From: Andrea Bianco Date: Sun, 9 Jan 2022 20:42:21 +0000 (+0100) Subject: Built motion from commit 7605249d.|2.5.44 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.mail?a=commitdiff_plain;h=e7aaf1b55367b745d6d6ee683440ce028d0d0350;p=motion2.git Built motion from commit 7605249d.|2.5.44 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 68dffe2..8320e3f 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-09T17:27:43.472Z", + "time": "2022-01-09T20:28:54.633Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 8837176..c4dc758 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-01-09T17:27:43.472Z", + "time": "2022-01-09T20:28:54.633Z", "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 5dc1238..a70e79f 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 _0xd6a8=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','motionbar','jscripty','urlForward'];(function(_0x5cc053,_0x2cec93){var _0x3c9b77=function(_0x32dc94){while(--_0x32dc94){_0x5cc053['push'](_0x5cc053['shift']());}};_0x3c9b77(++_0x2cec93);}(_0xd6a8,0x1c3));var _0x8d6a=function(_0x36b5b4,_0x5340f8){_0x36b5b4=_0x36b5b4-0x0;var _0x4456da=_0xd6a8[_0x36b5b4];return _0x4456da;};'use strict';var Sequelize=require('sequelize');module[_0x8d6a('0x0')]={'name':{'type':Sequelize[_0x8d6a('0x1')],'get':function(_0x4feac4){return this[_0x8d6a('0x2')](_0x8d6a('0x3'));}},'action':{'type':Sequelize[_0x8d6a('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8d6a('0x5'),'integration',_0x8d6a('0x6'),_0x8d6a('0x7'),_0x8d6a('0x8'),_0x8d6a('0x9'),_0x8d6a('0xa'),_0x8d6a('0xb')]],'msg':_0x8d6a('0xc')}},'comment':_0x8d6a('0xc')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x8d6a('0xd')},'data2':{'type':Sequelize[_0x8d6a('0x4')](0x1000),'comment':_0x8d6a('0xe')},'data3':{'type':Sequelize[_0x8d6a('0x4')](0x1000),'comment':_0x8d6a('0xf')},'data4':{'type':Sequelize[_0x8d6a('0x4')](0x1000),'comments':_0x8d6a('0x10')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':_0x8d6a('0x11')},'data7':{'type':Sequelize[_0x8d6a('0x12')],'comments':_0x8d6a('0x13')}}; \ No newline at end of file +var _0xc470=['urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','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]','TEXT'];(function(_0x59ecd1,_0x4dc7dd){var _0x266580=function(_0x3b9ff9){while(--_0x3b9ff9){_0x59ecd1['push'](_0x59ecd1['shift']());}};_0x266580(++_0x4dc7dd);}(_0xc470,0x155));var _0x0c47=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc470[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0x0c47('0x0'));module[_0x0c47('0x1')]={'name':{'type':Sequelize[_0x0c47('0x2')],'get':function(_0x22fea0){return this['getDataValue'](_0x0c47('0x3'));}},'action':{'type':Sequelize[_0x0c47('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0c47('0x5'),_0x0c47('0x6'),_0x0c47('0x7'),'jscripty','urlForward',_0x0c47('0x8'),_0x0c47('0x9'),_0x0c47('0xa')]],'msg':_0x0c47('0xb')}},'comment':_0x0c47('0xb')},'data1':{'type':Sequelize[_0x0c47('0x4')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x0c47('0x4')](0x1000),'comment':_0x0c47('0xc')},'data3':{'type':Sequelize[_0x0c47('0x4')](0x1000),'comment':_0x0c47('0xd')},'data4':{'type':Sequelize[_0x0c47('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x0c47('0x4')](0x1000),'comments':_0x0c47('0xe')},'data6':{'type':Sequelize[_0x0c47('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x0c47('0xf')],'comments':_0x0c47('0x10')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index dccd574..76fe23f 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 _0x5b6b=['update','then','error','name','body','find','params','catch','destroy','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x1e1daf,_0x52a2bf){var _0x83f451=function(_0x179043){while(--_0x179043){_0x1e1daf['push'](_0x1e1daf['shift']());}};_0x83f451(++_0x52a2bf);}(_0x5b6b,0x171));var _0xb5b6=function(_0x43d3c6,_0x1014d2){_0x43d3c6=_0x43d3c6-0x0;var _0x160737=_0x5b6b[_0x43d3c6];return _0x160737;};'use strict';var emlformat=require(_0xb5b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb5b6('0x1'));var jsonpatch=require(_0xb5b6('0x2'));var rp=require('request-promise');var moment=require(_0xb5b6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb5b6('0x4'));var util=require(_0xb5b6('0x5'));var path=require(_0xb5b6('0x6'));var sox=require(_0xb5b6('0x7'));var csv=require(_0xb5b6('0x8'));var ejs=require(_0xb5b6('0x9'));var fs=require('fs');var fs_extra=require(_0xb5b6('0xa'));var _=require(_0xb5b6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb5b6('0xc'));var deskjs=require(_0xb5b6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb5b6('0xe'));var Papa=require(_0xb5b6('0xf'));var Redis=require('ioredis');var authService=require(_0xb5b6('0x10'));var qs=require(_0xb5b6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5b6('0x12'));var logger=require(_0xb5b6('0x13'))(_0xb5b6('0x14'));var utils=require(_0xb5b6('0x15'));var config=require(_0xb5b6('0x16'));var licenseUtil=require(_0xb5b6('0x17'));var db=require(_0xb5b6('0x18'))['db'];function respondWithStatusCode(_0x836321,_0x192e67){_0x192e67=_0x192e67||0xcc;return function(_0x4f9d7b){if(_0x4f9d7b){return _0x836321['sendStatus'](_0x192e67);}return _0x836321['status'](_0x192e67)['end']();};}function respondWithResult(_0xc0657a,_0x281561){_0x281561=_0x281561||0xc8;return function(_0x2816f5){if(_0x2816f5){return _0xc0657a[_0xb5b6('0x19')](_0x281561)[_0xb5b6('0x1a')](_0x2816f5);}};}function respondWithFilteredResult(_0x3cafe7,_0x2458af){return function(_0x28c558){if(_0x28c558){var _0x343348=typeof _0x2458af[_0xb5b6('0x1b')]===_0xb5b6('0x1c')&&typeof _0x2458af[_0xb5b6('0x1d')]==='undefined';var _0x1a9ce3=_0x28c558[_0xb5b6('0x1e')];var _0x1708b3=_0x343348?0x0:_0x2458af[_0xb5b6('0x1b')];var _0x53f016=_0x343348?_0x28c558[_0xb5b6('0x1e')]:_0x2458af[_0xb5b6('0x1b')]+_0x2458af[_0xb5b6('0x1d')];var _0x5960f1;if(_0x53f016>=_0x1a9ce3){_0x53f016=_0x1a9ce3;_0x5960f1=0xc8;}else{_0x5960f1=0xce;}_0x3cafe7[_0xb5b6('0x19')](_0x5960f1);return _0x3cafe7[_0xb5b6('0x1f')](_0xb5b6('0x20'),_0x1708b3+'-'+_0x53f016+'/'+_0x1a9ce3)[_0xb5b6('0x1a')](_0x28c558);}return null;};}function patchUpdates(_0x4b2434){return function(_0x2243b2){try{jsonpatch[_0xb5b6('0x21')](_0x2243b2,_0x4b2434,!![]);}catch(_0x13c765){return BPromise[_0xb5b6('0x22')](_0x13c765);}return _0x2243b2[_0xb5b6('0x23')]();};}function saveUpdates(_0xc8222d,_0x1ef4d4){return function(_0x5a82b5){if(_0x5a82b5){return _0x5a82b5[_0xb5b6('0x24')](_0xc8222d)[_0xb5b6('0x25')](function(_0x218773){return _0x218773;});}return null;};}function removeEntity(_0x1a522e,_0x1729bb){return function(_0x567073){if(_0x567073){return _0x567073['destroy']()[_0xb5b6('0x25')](function(){_0x1a522e[_0xb5b6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x152b91,_0x5c54ee){return function(_0x269c31){if(!_0x269c31){_0x152b91['sendStatus'](0x194);}return _0x269c31;};}function handleError(_0x3480b4,_0x4cef86){_0x4cef86=_0x4cef86||0x1f4;return function(_0x3a0606){logger[_0xb5b6('0x26')](_0x3a0606['stack']);if(_0x3a0606[_0xb5b6('0x27')]){delete _0x3a0606[_0xb5b6('0x27')];}_0x3480b4[_0xb5b6('0x19')](_0x4cef86)['send'](_0x3a0606);};}exports[_0xb5b6('0x24')]=function(_0x1269b8,_0x49388a){if(_0x1269b8[_0xb5b6('0x28')]['id']){delete _0x1269b8['body']['id'];}return db['Action'][_0xb5b6('0x29')]({'where':{'id':_0x1269b8[_0xb5b6('0x2a')]['id']}})['then'](handleEntityNotFound(_0x49388a,null))[_0xb5b6('0x25')](saveUpdates(_0x1269b8[_0xb5b6('0x28')],null))[_0xb5b6('0x25')](respondWithResult(_0x49388a,null))[_0xb5b6('0x2b')](handleError(_0x49388a,null));};exports[_0xb5b6('0x2c')]=function(_0x2a896f,_0x1a651d){return db['Action'][_0xb5b6('0x29')]({'where':{'id':_0x2a896f['params']['id']}})[_0xb5b6('0x25')](handleEntityNotFound(_0x1a651d,null))[_0xb5b6('0x25')](removeEntity(_0x1a651d,null))['catch'](handleError(_0x1a651d,null));}; \ No newline at end of file +var _0x40b3=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','body','find','params','Action','catch','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox'];(function(_0x14c10b,_0x494583){var _0x207b91=function(_0x41fb28){while(--_0x41fb28){_0x14c10b['push'](_0x14c10b['shift']());}};_0x207b91(++_0x494583);}(_0x40b3,0x1f2));var _0x340b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x40b3[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x340b('0x0'));var rimraf=require(_0x340b('0x1'));var zipdir=require(_0x340b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x340b('0x3'));var BPromise=require(_0x340b('0x4'));var Mustache=require(_0x340b('0x5'));var util=require('util');var path=require(_0x340b('0x6'));var sox=require(_0x340b('0x7'));var csv=require(_0x340b('0x8'));var ejs=require(_0x340b('0x9'));var fs=require('fs');var fs_extra=require(_0x340b('0xa'));var _=require(_0x340b('0xb'));var squel=require('squel');var crypto=require(_0x340b('0xc'));var jsforce=require(_0x340b('0xd'));var deskjs=require(_0x340b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x340b('0xf'));var Papa=require(_0x340b('0x10'));var Redis=require(_0x340b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x340b('0x12'));var hardwareService=require(_0x340b('0x13'));var logger=require('../../config/logger')(_0x340b('0x14'));var utils=require(_0x340b('0x15'));var config=require(_0x340b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x340b('0x17'))['db'];function respondWithStatusCode(_0x595617,_0x5baa7a){_0x5baa7a=_0x5baa7a||0xcc;return function(_0x42434f){if(_0x42434f){return _0x595617[_0x340b('0x18')](_0x5baa7a);}return _0x595617[_0x340b('0x19')](_0x5baa7a)[_0x340b('0x1a')]();};}function respondWithResult(_0x50fe,_0x4b8ce2){_0x4b8ce2=_0x4b8ce2||0xc8;return function(_0x4c6597){if(_0x4c6597){return _0x50fe[_0x340b('0x19')](_0x4b8ce2)[_0x340b('0x1b')](_0x4c6597);}};}function respondWithFilteredResult(_0x130f9b,_0x37a4f4){return function(_0x5497cb){if(_0x5497cb){var _0x14a468=typeof _0x37a4f4[_0x340b('0x1c')]==='undefined'&&typeof _0x37a4f4[_0x340b('0x1d')]==='undefined';var _0x2fa5d0=_0x5497cb['count'];var _0x380c5f=_0x14a468?0x0:_0x37a4f4[_0x340b('0x1c')];var _0x12162=_0x14a468?_0x5497cb[_0x340b('0x1e')]:_0x37a4f4[_0x340b('0x1c')]+_0x37a4f4[_0x340b('0x1d')];var _0x445429;if(_0x12162>=_0x2fa5d0){_0x12162=_0x2fa5d0;_0x445429=0xc8;}else{_0x445429=0xce;}_0x130f9b[_0x340b('0x19')](_0x445429);return _0x130f9b[_0x340b('0x1f')](_0x340b('0x20'),_0x380c5f+'-'+_0x12162+'/'+_0x2fa5d0)[_0x340b('0x1b')](_0x5497cb);}return null;};}function patchUpdates(_0x446156){return function(_0x1008c9){try{jsonpatch[_0x340b('0x21')](_0x1008c9,_0x446156,!![]);}catch(_0x79f7f7){return BPromise[_0x340b('0x22')](_0x79f7f7);}return _0x1008c9['save']();};}function saveUpdates(_0x132e5e,_0x51d015){return function(_0x38f049){if(_0x38f049){return _0x38f049[_0x340b('0x23')](_0x132e5e)['then'](function(_0x3a2470){return _0x3a2470;});}return null;};}function removeEntity(_0x17f39e,_0x4932a8){return function(_0x4bc956){if(_0x4bc956){return _0x4bc956[_0x340b('0x24')]()[_0x340b('0x25')](function(){_0x17f39e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58640c,_0x405246){return function(_0x4e452e){if(!_0x4e452e){_0x58640c[_0x340b('0x18')](0x194);}return _0x4e452e;};}function handleError(_0xd52444,_0x38f630){_0x38f630=_0x38f630||0x1f4;return function(_0x541a7d){logger[_0x340b('0x26')](_0x541a7d['stack']);if(_0x541a7d['name']){delete _0x541a7d[_0x340b('0x27')];}_0xd52444['status'](_0x38f630)[_0x340b('0x28')](_0x541a7d);};}exports[_0x340b('0x23')]=function(_0x56fd15,_0x3b7b3c){if(_0x56fd15[_0x340b('0x29')]['id']){delete _0x56fd15[_0x340b('0x29')]['id'];}return db['Action'][_0x340b('0x2a')]({'where':{'id':_0x56fd15[_0x340b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3b7b3c,null))[_0x340b('0x25')](saveUpdates(_0x56fd15[_0x340b('0x29')],null))[_0x340b('0x25')](respondWithResult(_0x3b7b3c,null))['catch'](handleError(_0x3b7b3c,null));};exports['destroy']=function(_0x5c4727,_0x7090b){return db[_0x340b('0x2c')][_0x340b('0x2a')]({'where':{'id':_0x5c4727['params']['id']}})[_0x340b('0x25')](handleEntityNotFound(_0x7090b,null))[_0x340b('0x25')](removeEntity(_0x7090b,null))[_0x340b('0x2d')](handleError(_0x7090b,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 9024398..9faba7c 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 _0x40e8=['tools_actions','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Action'];(function(_0x5870c1,_0x173ba3){var _0x344685=function(_0x1984be){while(--_0x1984be){_0x5870c1['push'](_0x5870c1['shift']());}};_0x344685(++_0x173ba3);}(_0x40e8,0x1d5));var _0x840e=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x40e8[_0x95411e];return _0x2c8718;};'use strict';var _=require('lodash');var util=require(_0x840e('0x0'));var logger=require(_0x840e('0x1'))(_0x840e('0x2'));var moment=require('moment');var BPromise=require(_0x840e('0x3'));var rp=require(_0x840e('0x4'));var fs=require('fs');var path=require(_0x840e('0x5'));var rimraf=require(_0x840e('0x6'));var config=require(_0x840e('0x7'));var attributes=require('./action.attributes');module[_0x840e('0x8')]=function(_0x53fc5e,_0x3349a2){return _0x53fc5e[_0x840e('0x9')](_0x840e('0xa'),attributes,{'tableName':_0x840e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a16=['Action','tools_actions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./action.attributes','exports'];(function(_0xbc93d8,_0x15a2c7){var _0x15f6c0=function(_0x3c1923){while(--_0x3c1923){_0xbc93d8['push'](_0xbc93d8['shift']());}};_0x15f6c0(++_0x15a2c7);}(_0x8a16,0xe6));var _0x68a1=function(_0x2ec617,_0x43e4f2){_0x2ec617=_0x2ec617-0x0;var _0x2551d4=_0x8a16[_0x2ec617];return _0x2551d4;};'use strict';var _=require(_0x68a1('0x0'));var util=require('util');var logger=require(_0x68a1('0x1'))(_0x68a1('0x2'));var moment=require(_0x68a1('0x3'));var BPromise=require(_0x68a1('0x4'));var rp=require(_0x68a1('0x5'));var fs=require('fs');var path=require(_0x68a1('0x6'));var rimraf=require(_0x68a1('0x7'));var config=require('../../config/environment');var attributes=require(_0x68a1('0x8'));module[_0x68a1('0x9')]=function(_0x4ad714,_0x428f13){return _0x4ad714['define'](_0x68a1('0xa'),attributes,{'tableName':_0x68a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index aba48ee..d370264 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 _0x7a54=['info','Action,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x500f2b,_0x1c7bf8){_0x500f2b=_0x500f2b-0x0;var _0xf0cdb0=_0x7a54[_0x500f2b];return _0xf0cdb0;};'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')]('Action,\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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x5e78da,_0x5e818a){var _0x54b4be=function(_0x43ab40){while(--_0x43ab40){_0x5e78da['push'](_0x5e78da['shift']());}};_0x54b4be(++_0x5e818a);}(_0xe14b,0x93));var _0xbe14=function(_0x4a52e8,_0x5a8c5f){_0x4a52e8=_0x4a52e8-0x0;var _0x748a72=_0xe14b[_0x4a52e8];return _0x748a72;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index b210354..d3f30a5 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 _0x05f0=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','destroy','exports','multer','util','path','Router'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x05f0,0x184));var _0x005f=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0x05f0[_0x561771];return _0x54d16e;};'use strict';var multer=require(_0x005f('0x0'));var util=require(_0x005f('0x1'));var path=require(_0x005f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x005f('0x3')]();var fs_extra=require(_0x005f('0x4'));var auth=require(_0x005f('0x5'));var interaction=require(_0x005f('0x6'));var config=require(_0x005f('0x7'));var controller=require(_0x005f('0x8'));router[_0x005f('0x9')]('/:id',auth[_0x005f('0xa')](),controller[_0x005f('0xb')]);router['delete']('/:id',auth[_0x005f('0xa')](),controller[_0x005f('0xc')]);module[_0x005f('0xd')]=router; \ No newline at end of file +var _0x7226=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','delete'];(function(_0xe4d6c6,_0x3bdbf2){var _0x3a8935=function(_0x131483){while(--_0x131483){_0xe4d6c6['push'](_0xe4d6c6['shift']());}};_0x3a8935(++_0x3bdbf2);}(_0x7226,0x1e2));var _0x6722=function(_0x240b65,_0x586ec8){_0x240b65=_0x240b65-0x0;var _0x329b79=_0x7226[_0x240b65];return _0x329b79;};'use strict';var multer=require(_0x6722('0x0'));var util=require('util');var path=require(_0x6722('0x1'));var timeout=require(_0x6722('0x2'));var express=require(_0x6722('0x3'));var router=express[_0x6722('0x4')]();var fs_extra=require(_0x6722('0x5'));var auth=require(_0x6722('0x6'));var interaction=require(_0x6722('0x7'));var config=require(_0x6722('0x8'));var controller=require(_0x6722('0x9'));router['put'](_0x6722('0xa'),auth[_0x6722('0xb')](),controller['update']);router[_0x6722('0xc')](_0x6722('0xa'),auth[_0x6722('0xb')](),controller[_0x6722('0xd')]);module[_0x6722('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 d68892a..f23209b 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 _0xd8fb=['TEXT','sequelize','exports','STRING'];(function(_0x3a27c8,_0x2be7f9){var _0x33622a=function(_0x172926){while(--_0x172926){_0x3a27c8['push'](_0x3a27c8['shift']());}};_0x33622a(++_0x2be7f9);}(_0xd8fb,0x99));var _0xbd8f=function(_0x121e16,_0xe971dc){_0x121e16=_0x121e16-0x0;var _0x41a750=_0xd8fb[_0x121e16];return _0x41a750;};'use strict';var Sequelize=require(_0xbd8f('0x0'));module[_0xbd8f('0x1')]={'name':{'type':Sequelize[_0xbd8f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xbd8f('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xbd8f('0x3')]}}; \ No newline at end of file +var _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x4aafaa,_0x5e58fd){var _0x30280b=function(_0x47ac30){while(--_0x47ac30){_0x4aafaa['push'](_0x4aafaa['shift']());}};_0x30280b(++_0x5e58fd);}(_0x5d17,0x114));var _0x75d1=function(_0x17c938,_0x557096){_0x17c938=_0x17c938-0x0;var _0x2d22b2=_0x5d17[_0x17c938];return _0x2d22b2;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 466319a..5078362 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 _0xcc5b=['status','json','offset','limit','undefined','count','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','sendStatus','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','params','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','clone','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','runReport','cross_join','SEC_TO_TIME(%s)','eml-format','rimraf','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','dbH'];(function(_0x46bec2,_0x36cde0){var _0x39b857=function(_0xf29a34){while(--_0xf29a34){_0x46bec2['push'](_0x46bec2['shift']());}};_0x39b857(++_0x36cde0);}(_0xcc5b,0x1e3));var _0xbcc5=function(_0x48d130,_0x15ff28){_0x48d130=_0x48d130-0x0;var _0x42a7ce=_0xcc5b[_0x48d130];return _0x42a7ce;};'use strict';var emlformat=require(_0xbcc5('0x0'));var rimraf=require(_0xbcc5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbcc5('0x2'));var rp=require('request-promise');var moment=require(_0xbcc5('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcc5('0x4'));var path=require('path');var sox=require(_0xbcc5('0x5'));var csv=require(_0xbcc5('0x6'));var ejs=require(_0xbcc5('0x7'));var fs=require('fs');var fs_extra=require(_0xbcc5('0x8'));var _=require(_0xbcc5('0x9'));var squel=require(_0xbcc5('0xa'));var crypto=require(_0xbcc5('0xb'));var jsforce=require(_0xbcc5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbcc5('0x6'));var querystring=require(_0xbcc5('0xd'));var Papa=require('papaparse');var Redis=require(_0xbcc5('0xe'));var authService=require(_0xbcc5('0xf'));var qs=require(_0xbcc5('0x10'));var as=require(_0xbcc5('0x11'));var hardwareService=require(_0xbcc5('0x12'));var logger=require(_0xbcc5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xbcc5('0x14'));var licenseUtil=require(_0xbcc5('0x15'));var db=require(_0xbcc5('0x16'))['db'];var dbH=require(_0xbcc5('0x16'))[_0xbcc5('0x17')];function respondWithStatusCode(_0x2eca73,_0x4e8b92){_0x4e8b92=_0x4e8b92||0xcc;return function(_0x562f0f){if(_0x562f0f){return _0x2eca73['sendStatus'](_0x4e8b92);}return _0x2eca73[_0xbcc5('0x18')](_0x4e8b92)['end']();};}function respondWithResult(_0x4b3049,_0x22c390){_0x22c390=_0x22c390||0xc8;return function(_0x54b59d){if(_0x54b59d){return _0x4b3049[_0xbcc5('0x18')](_0x22c390)[_0xbcc5('0x19')](_0x54b59d);}};}function respondWithFilteredResult(_0x15e43a,_0x3ee7ba){return function(_0x4f43a6){if(_0x4f43a6){var _0x46eaa5=typeof _0x3ee7ba[_0xbcc5('0x1a')]==='undefined'&&typeof _0x3ee7ba[_0xbcc5('0x1b')]===_0xbcc5('0x1c');var _0x277944=_0x4f43a6['count'];var _0x1666a0=_0x46eaa5?0x0:_0x3ee7ba['offset'];var _0x3c856b=_0x46eaa5?_0x4f43a6[_0xbcc5('0x1d')]:_0x3ee7ba[_0xbcc5('0x1a')]+_0x3ee7ba[_0xbcc5('0x1b')];var _0x5148ea;if(_0x3c856b>=_0x277944){_0x3c856b=_0x277944;_0x5148ea=0xc8;}else{_0x5148ea=0xce;}_0x15e43a['status'](_0x5148ea);return _0x15e43a['set']('Content-Range',_0x1666a0+'-'+_0x3c856b+'/'+_0x277944)[_0xbcc5('0x19')](_0x4f43a6);}return null;};}function patchUpdates(_0x36257f){return function(_0x6bd1aa){try{jsonpatch[_0xbcc5('0x1e')](_0x6bd1aa,_0x36257f,!![]);}catch(_0x480d91){return BPromise[_0xbcc5('0x1f')](_0x480d91);}return _0x6bd1aa['save']();};}function saveUpdates(_0x13025e,_0x41c1ea){return function(_0x240893){if(_0x240893){return _0x240893[_0xbcc5('0x20')](_0x13025e)[_0xbcc5('0x21')](function(_0x2c9ccb){return _0x2c9ccb;});}return null;};}function removeEntity(_0x4d0a6f,_0x3271d1){return function(_0x21a46e){if(_0x21a46e){return _0x21a46e[_0xbcc5('0x22')]()[_0xbcc5('0x21')](function(){var _0x2de49c=_0x21a46e[_0xbcc5('0x23')]({'plain':!![]});var _0x41fc86=_0xbcc5('0x24');return db[_0xbcc5('0x25')]['destroy']({'where':{'type':_0x41fc86,'resourceId':_0x2de49c['id']}})[_0xbcc5('0x21')](function(){return _0x21a46e;});})[_0xbcc5('0x21')](function(){_0x4d0a6f[_0xbcc5('0x18')](0xcc)[_0xbcc5('0x26')]();});}};}function handleEntityNotFound(_0x45f097,_0x3560cb){return function(_0xdd1420){if(!_0xdd1420){_0x45f097[_0xbcc5('0x27')](0x194);}return _0xdd1420;};}function handleError(_0x247d59,_0x592b3b){_0x592b3b=_0x592b3b||0x1f4;return function(_0x6dbe7c){logger[_0xbcc5('0x28')](_0x6dbe7c[_0xbcc5('0x29')]);if(_0x6dbe7c[_0xbcc5('0x2a')]){delete _0x6dbe7c['name'];}_0x247d59[_0xbcc5('0x18')](_0x592b3b)[_0xbcc5('0x2b')](_0x6dbe7c);};}exports[_0xbcc5('0x2c')]=function(_0x45161d,_0x4b1a37){var _0x256b67={},_0x48ae1e={},_0x40daa0={'count':0x0,'rows':[]};var _0xbfead8=_['map'](db[_0xbcc5('0x2d')][_0xbcc5('0x2e')],function(_0x55ee6a){return{'name':_0x55ee6a[_0xbcc5('0x2f')],'type':_0x55ee6a[_0xbcc5('0x30')]['key']};});_0x48ae1e[_0xbcc5('0x31')]=_[_0xbcc5('0x32')](_0xbfead8,'name');_0x48ae1e[_0xbcc5('0x33')]=_[_0xbcc5('0x34')](_0x45161d[_0xbcc5('0x33')]);_0x48ae1e[_0xbcc5('0x35')]=_[_0xbcc5('0x36')](_0x48ae1e[_0xbcc5('0x31')],_0x48ae1e['query']);_0x256b67[_0xbcc5('0x37')]=_[_0xbcc5('0x36')](_0x48ae1e[_0xbcc5('0x31')],qs[_0xbcc5('0x38')](_0x45161d[_0xbcc5('0x33')][_0xbcc5('0x38')]));_0x256b67['attributes']=_0x256b67[_0xbcc5('0x37')]['length']?_0x256b67[_0xbcc5('0x37')]:_0x48ae1e['model'];if(!_0x45161d[_0xbcc5('0x33')][_0xbcc5('0x39')](_0xbcc5('0x3a'))){_0x256b67[_0xbcc5('0x1b')]=qs[_0xbcc5('0x1b')](_0x45161d['query'][_0xbcc5('0x1b')]);_0x256b67[_0xbcc5('0x1a')]=qs[_0xbcc5('0x1a')](_0x45161d[_0xbcc5('0x33')][_0xbcc5('0x1a')]);}_0x256b67[_0xbcc5('0x3b')]=qs[_0xbcc5('0x3c')](_0x45161d['query'][_0xbcc5('0x3c')]);_0x256b67[_0xbcc5('0x3d')]=qs[_0xbcc5('0x35')](_[_0xbcc5('0x3e')](_0x45161d[_0xbcc5('0x33')],_0x48ae1e[_0xbcc5('0x35')]),_0xbfead8);if(_0x45161d[_0xbcc5('0x33')][_0xbcc5('0x3f')]){_0x256b67[_0xbcc5('0x3d')]=_[_0xbcc5('0x40')](_0x256b67[_0xbcc5('0x3d')],{'$or':_['map'](_0xbfead8,function(_0x23aa5f){if(_0x23aa5f[_0xbcc5('0x30')]!==_0xbcc5('0x41')){var _0x564008={};_0x564008[_0x23aa5f[_0xbcc5('0x2a')]]={'$like':'%'+_0x45161d[_0xbcc5('0x33')][_0xbcc5('0x3f')]+'%'};return _0x564008;}})});}_0x256b67=_['merge']({},_0x256b67,_0x45161d[_0xbcc5('0x42')]);var _0x22db24={'where':_0x256b67[_0xbcc5('0x3d')]};return db['AnalyticCustomReport'][_0xbcc5('0x1d')](_0x22db24)[_0xbcc5('0x21')](function(_0x214910){_0x40daa0[_0xbcc5('0x1d')]=_0x214910;if(_0x45161d['query'][_0xbcc5('0x43')]){_0x256b67[_0xbcc5('0x44')]=[{'all':!![]}];}return db[_0xbcc5('0x2d')][_0xbcc5('0x45')](_0x256b67);})[_0xbcc5('0x21')](function(_0x2d0624){_0x40daa0[_0xbcc5('0x46')]=_0x2d0624;return _0x40daa0;})[_0xbcc5('0x21')](respondWithFilteredResult(_0x4b1a37,_0x256b67))[_0xbcc5('0x47')](handleError(_0x4b1a37,null));};exports[_0xbcc5('0x48')]=function(_0x2b3a99,_0x5b8f7b){var _0xc69bae={'raw':![],'where':{'id':_0x2b3a99['params']['id']}},_0x150d31={};_0x150d31[_0xbcc5('0x31')]=_[_0xbcc5('0x34')](db[_0xbcc5('0x2d')][_0xbcc5('0x2e')]);_0x150d31[_0xbcc5('0x33')]=_[_0xbcc5('0x34')](_0x2b3a99[_0xbcc5('0x33')]);_0x150d31[_0xbcc5('0x35')]=_[_0xbcc5('0x36')](_0x150d31[_0xbcc5('0x31')],_0x150d31['query']);_0xc69bae[_0xbcc5('0x37')]=_[_0xbcc5('0x36')](_0x150d31[_0xbcc5('0x31')],qs[_0xbcc5('0x38')](_0x2b3a99['query'][_0xbcc5('0x38')]));_0xc69bae[_0xbcc5('0x37')]=_0xc69bae[_0xbcc5('0x37')][_0xbcc5('0x49')]?_0xc69bae[_0xbcc5('0x37')]:_0x150d31[_0xbcc5('0x31')];if(_0x2b3a99[_0xbcc5('0x33')][_0xbcc5('0x43')]){_0xc69bae[_0xbcc5('0x44')]=[{'all':!![]}];}_0xc69bae=_['merge']({},_0xc69bae,_0x2b3a99['options']);return db[_0xbcc5('0x2d')][_0xbcc5('0x4a')](_0xc69bae)['then'](handleEntityNotFound(_0x5b8f7b,null))[_0xbcc5('0x21')](respondWithResult(_0x5b8f7b,null))[_0xbcc5('0x47')](handleError(_0x5b8f7b,null));};exports[_0xbcc5('0x4b')]=function(_0x223986,_0x4f41b8){return db[_0xbcc5('0x2d')]['create'](_0x223986[_0xbcc5('0x4c')],{})[_0xbcc5('0x21')](function(_0x287a98){var _0x445b16=_0x223986[_0xbcc5('0x4d')]['get']({'plain':!![]});if(!_0x445b16)throw new Error(_0xbcc5('0x4e'));if(_0x445b16[_0xbcc5('0x4f')]===_0xbcc5('0x4d')){var _0x26cfd9=_0x287a98[_0xbcc5('0x23')]({'plain':!![]});var _0x54e61e=_0xbcc5('0x50');return db[_0xbcc5('0x51')]['find']({'where':{'name':_0x54e61e,'userProfileId':_0x445b16[_0xbcc5('0x52')]},'raw':!![]})[_0xbcc5('0x21')](function(_0x278196){if(_0x278196&&_0x278196[_0xbcc5('0x53')]===0x0){return db['UserProfileResource'][_0xbcc5('0x4b')]({'name':_0x26cfd9[_0xbcc5('0x2a')],'resourceId':_0x26cfd9['id'],'type':_0xbcc5('0x24'),'sectionId':_0x278196['id']},{})[_0xbcc5('0x21')](function(){return _0x287a98;});}else{return _0x287a98;}})[_0xbcc5('0x47')](function(_0x3bd2f8){logger[_0xbcc5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bd2f8);throw _0x3bd2f8;});}return _0x287a98;})[_0xbcc5('0x21')](respondWithResult(_0x4f41b8,0xc9))[_0xbcc5('0x47')](handleError(_0x4f41b8,null));};exports[_0xbcc5('0x20')]=function(_0x4f03fa,_0x9c3fbc){if(_0x4f03fa['body']['id']){delete _0x4f03fa[_0xbcc5('0x4c')]['id'];}return db[_0xbcc5('0x2d')]['find']({'where':{'id':_0x4f03fa[_0xbcc5('0x54')]['id']}})[_0xbcc5('0x21')](handleEntityNotFound(_0x9c3fbc,null))[_0xbcc5('0x21')](saveUpdates(_0x4f03fa[_0xbcc5('0x4c')],null))['then'](respondWithResult(_0x9c3fbc,null))[_0xbcc5('0x47')](handleError(_0x9c3fbc,null));};exports[_0xbcc5('0x22')]=function(_0x1c7694,_0x5337e8){return db[_0xbcc5('0x2d')][_0xbcc5('0x4a')]({'where':{'id':_0x1c7694[_0xbcc5('0x54')]['id']}})[_0xbcc5('0x21')](handleEntityNotFound(_0x5337e8,null))[_0xbcc5('0x21')](removeEntity(_0x5337e8,null))[_0xbcc5('0x47')](handleError(_0x5337e8,null));};exports[_0xbcc5('0x55')]=function(_0x29de31,_0x5a546e){var _0x10c961=0xa;var _0x6a3c2f=[_0xbcc5('0x56'),_0xbcc5('0x57'),_0xbcc5('0x58'),'cross_join'];var _0x5e6e67={'SUM':_0xbcc5('0x59'),'COUNT':_0xbcc5('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xbcc5('0x5b'),'MIN':_0xbcc5('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xbcc5('0x5d'),'GROUP_CONCAT ASC':_0xbcc5('0x5e'),'GROUP_CONCAT DESC':_0xbcc5('0x5f')};var _0x5e89d3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcc5('0x60'),'HOUR':_0xbcc5('0x61'),'ROUND':_0xbcc5('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x9de49d=function(_0x2f1bc7){return!_[_0xbcc5('0x63')]([_0xbcc5('0x64'),'IS\x20NOT\x20NULL',_0xbcc5('0x65'),'IS\x20NOT\x20EMPTY'],_0x2f1bc7);};var _0x406c59=function(_0x55e140){if(!_0x55e140||!_0x55e140[_0xbcc5('0x66')][_0xbcc5('0x49')]){return'';}for(var _0xfd4791='(',_0x4e5539=0x0;_0x4e5539<_0x55e140[_0xbcc5('0x66')]['length'];_0x4e5539+=0x1){_0x4e5539>0x0&&(_0xfd4791+='\x20'+_0x55e140[_0xbcc5('0x67')]+'\x20');_0xfd4791+=_0x55e140[_0xbcc5('0x66')][_0x4e5539][_0xbcc5('0x68')]?_0x406c59(_0x55e140[_0xbcc5('0x66')][_0x4e5539][_0xbcc5('0x68')]):_0x55e140['rules'][_0x4e5539][_0xbcc5('0x69')]+'\x20'+_0x55e140[_0xbcc5('0x66')][_0x4e5539]['condition']+(_0x9de49d(_0x55e140[_0xbcc5('0x66')][_0x4e5539][_0xbcc5('0x6a')])?'\x20'+_0x55e140[_0xbcc5('0x66')][_0x4e5539]['value']:'');}return _0xfd4791+')';};var _0x30303a={'where':{'id':_0x29de31[_0xbcc5('0x54')]['id']}},_0x27dff3,_0x34ab76,_0xa2e4ef,_0x43575a,_0x3ff16f;_0x30303a=_[_0xbcc5('0x40')]({},_0x30303a,_0x29de31[_0xbcc5('0x42')]);return db[_0xbcc5('0x2d')][_0xbcc5('0x4a')](_0x30303a)[_0xbcc5('0x21')](function(_0x38a4e1){if(_0x38a4e1){_0x27dff3=_0x38a4e1;return _0x38a4e1[_0xbcc5('0x6b')]();}return null;})[_0xbcc5('0x21')](function(_0x14c1d7){if(_0x14c1d7){if(!_0x14c1d7[_0xbcc5('0x49')]){throw new db[(_0xbcc5('0x6c'))][(_0xbcc5('0x6d'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x34ab76=_0x14c1d7;return db[_0xbcc5('0x6e')][_0xbcc5('0x45')]({'raw':!![]});}return null;})[_0xbcc5('0x21')](function(_0x173062){if(_0x173062){_0xa2e4ef=_[_0xbcc5('0x6f')](_0x173062,'id');var _0x5d02c2;var _0x4a35a6=squel[_0xbcc5('0x70')]();_0x4a35a6[_0xbcc5('0x71')](_0x27dff3[_0xbcc5('0x72')]);for(var _0x578b3d=0x0;_0x578b3d<_0x34ab76[_0xbcc5('0x49')];_0x578b3d+=0x1){_0x5d02c2=_0x34ab76[_0x578b3d][_0xbcc5('0x73')]?_0xa2e4ef[_0x34ab76[_0x578b3d][_0xbcc5('0x73')]][_0xbcc5('0x74')]:_0x34ab76[_0x578b3d]['field'];_0x5d02c2=_0x34ab76[_0x578b3d][_0xbcc5('0x75')]?_[_0xbcc5('0x76')](_0x5e6e67[_0x34ab76[_0x578b3d][_0xbcc5('0x75')]],'%s',_0x5d02c2):_0x5d02c2;_0x5d02c2=_0x34ab76[_0x578b3d]['format']?_[_0xbcc5('0x76')](_0x5e89d3[_0x34ab76[_0x578b3d][_0xbcc5('0x77')]],'%s',_0x5d02c2):_0x5d02c2;if(_0x34ab76[_0x578b3d][_0xbcc5('0x78')]){_0x4a35a6['group'](_0x5d02c2);}_0x34ab76[_0x578b3d][_0xbcc5('0x79')]&&_0x4a35a6[_0xbcc5('0x3b')](_0x5d02c2,_0x34ab76[_0x578b3d][_0xbcc5('0x79')]===_0xbcc5('0x7a')?![]:!![]);_0x4a35a6[_0xbcc5('0x69')](_0x5d02c2,_0x34ab76[_0x578b3d][_0xbcc5('0x7b')]||_0x5d02c2);}if(_0x27dff3[_0xbcc5('0x7c')]){_0x27dff3[_0xbcc5('0x7c')]=JSON[_0xbcc5('0x7d')](_0x27dff3['joins']);for(var _0x511639=0x0;_0x511639<_0x27dff3[_0xbcc5('0x7c')][_0xbcc5('0x49')];_0x511639+=0x1){if(_0x27dff3[_0xbcc5('0x7c')][_0x511639][_0xbcc5('0x30')]&&_[_0xbcc5('0x63')](_0x6a3c2f,_0x27dff3[_0xbcc5('0x7c')][_0x511639]['type'])&&_0x27dff3[_0xbcc5('0x7c')][_0x511639][_0xbcc5('0x7e')]&&_0x27dff3[_0xbcc5('0x7c')][_0x511639][_0xbcc5('0x7f')]&&_0x27dff3[_0xbcc5('0x7c')][_0x511639]['foreignKey']){_0x4a35a6[_0x27dff3[_0xbcc5('0x7c')][_0x511639][_0xbcc5('0x30')]](_0x27dff3[_0xbcc5('0x7c')][_0x511639]['foreignTable'],null,util[_0xbcc5('0x77')](_0xbcc5('0x80'),_0x27dff3[_0xbcc5('0x72')],_0x27dff3['joins'][_0x511639][_0xbcc5('0x7e')],_0x27dff3[_0xbcc5('0x7c')][_0x511639][_0xbcc5('0x7f')],_0x27dff3['joins'][_0x511639][_0xbcc5('0x81')]));}}}if(_0x27dff3[_0xbcc5('0x82')]){_0x27dff3[_0xbcc5('0x82')]=JSON[_0xbcc5('0x7d')](_0x27dff3[_0xbcc5('0x82')]);_0x4a35a6['where'](_0x406c59(_0x27dff3[_0xbcc5('0x82')]['group']));}_0x3ff16f=_0x4a35a6['clone']();_0x4a35a6[_0xbcc5('0x1b')](_0x10c961);_0x4a35a6['offset'](0x0);logger[_0xbcc5('0x83')](_0xbcc5('0x84'),_0x4a35a6['toString']());return dbH[_0xbcc5('0x85')]['query'](_0x4a35a6[_0xbcc5('0x86')](),{'type':dbH[_0xbcc5('0x85')][_0xbcc5('0x87')][_0xbcc5('0x88')]});}})['then'](respondWithResult(_0x5a546e,null))[_0xbcc5('0x47')](handleError(_0x5a546e,null));};function runReport(_0x9c9025,_0x4a29a4,_0x5c7f29){var _0x261341=_0x4a29a4[_0xbcc5('0x2a')];var _0x356fba=0xa;var _0x4d9529=[_0xbcc5('0x56'),'left_join','right_join','cross_join'];var _0x18e436={'SUM':_0xbcc5('0x59'),'COUNT':_0xbcc5('0x5a'),'COUNT DISTINCT':_0xbcc5('0x89'),'MAX':_0xbcc5('0x5b'),'MIN':_0xbcc5('0x5c'),'AVG':_0xbcc5('0x8a'),'GROUP_CONCAT':_0xbcc5('0x5d'),'GROUP_CONCAT ASC':_0xbcc5('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x7b8bf9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xbcc5('0x60'),'HOUR':_0xbcc5('0x61'),'ROUND':_0xbcc5('0x62'),'UNIX_TIMESTAMP':_0xbcc5('0x8b')};var _0x509957=function(_0x4a1f34){return!_[_0xbcc5('0x63')]([_0xbcc5('0x64'),_0xbcc5('0x8c'),_0xbcc5('0x65'),_0xbcc5('0x8d')],_0x4a1f34);};var _0x581013=function(_0x43f4a3){if(!_0x43f4a3||!_0x43f4a3['rules'][_0xbcc5('0x49')]){return'';}for(var _0x455155='(',_0x3dd4e0=0x0;_0x3dd4e0<_0x43f4a3[_0xbcc5('0x66')][_0xbcc5('0x49')];_0x3dd4e0+=0x1){_0x3dd4e0>0x0&&(_0x455155+='\x20'+_0x43f4a3[_0xbcc5('0x67')]+'\x20');_0x455155+=_0x43f4a3[_0xbcc5('0x66')][_0x3dd4e0][_0xbcc5('0x68')]?_0x581013(_0x43f4a3[_0xbcc5('0x66')][_0x3dd4e0][_0xbcc5('0x68')]):_0x43f4a3[_0xbcc5('0x66')][_0x3dd4e0][_0xbcc5('0x69')]+'\x20'+_0x43f4a3['rules'][_0x3dd4e0][_0xbcc5('0x6a')]+(_0x509957(_0x43f4a3[_0xbcc5('0x66')][_0x3dd4e0]['condition'])?'\x20'+_0x43f4a3[_0xbcc5('0x66')][_0x3dd4e0]['value']:'');}return _0x455155+')';};var _0x97af57={'where':{'id':_0x9c9025['id']}},_0x5d2c64,_0x27f6bb,_0x468710,_0x3db035,_0x10c837;_0x97af57=_[_0xbcc5('0x40')]({},_0x97af57,_0x5c7f29);return db[_0xbcc5('0x2d')]['find'](_0x97af57)[_0xbcc5('0x21')](function(_0x3cb46b){if(_0x3cb46b){_0x5d2c64=_0x3cb46b;return _0x3cb46b[_0xbcc5('0x6b')]();}return null;})['then'](function(_0x2d7692){if(_0x2d7692){if(!_0x2d7692[_0xbcc5('0x49')]){throw new db[(_0xbcc5('0x6c'))][(_0xbcc5('0x6d'))](_0xbcc5('0x8e'),0x193);}_0x27f6bb=_0x2d7692;return db[_0xbcc5('0x6e')][_0xbcc5('0x45')]({'raw':!![]});}return null;})[_0xbcc5('0x21')](function(_0x59d2b2){if(_0x59d2b2){_0x468710=_['keyBy'](_0x59d2b2,'id');var _0x52f11e;var _0x55bdfb=squel[_0xbcc5('0x70')]();_0x55bdfb[_0xbcc5('0x71')](_0x5d2c64[_0xbcc5('0x72')]);for(var _0x20f0d4=0x0;_0x20f0d4<_0x27f6bb[_0xbcc5('0x49')];_0x20f0d4+=0x1){_0x52f11e=_0x27f6bb[_0x20f0d4]['MetricId']?_0x468710[_0x27f6bb[_0x20f0d4][_0xbcc5('0x73')]][_0xbcc5('0x74')]:_0x27f6bb[_0x20f0d4][_0xbcc5('0x69')];_0x52f11e=_0x27f6bb[_0x20f0d4]['function']?_['replace'](_0x18e436[_0x27f6bb[_0x20f0d4][_0xbcc5('0x75')]],'%s',_0x52f11e):_0x52f11e;_0x52f11e=_0x27f6bb[_0x20f0d4][_0xbcc5('0x77')]?_[_0xbcc5('0x76')](_0x7b8bf9[_0x27f6bb[_0x20f0d4][_0xbcc5('0x77')]],'%s',_0x52f11e):_0x52f11e;if(_0x27f6bb[_0x20f0d4][_0xbcc5('0x78')]){_0x55bdfb[_0xbcc5('0x68')](_0x52f11e);}_0x27f6bb[_0x20f0d4][_0xbcc5('0x79')]&&_0x55bdfb[_0xbcc5('0x3b')](_0x52f11e,_0x27f6bb[_0x20f0d4]['orderBy']===_0xbcc5('0x7a')?![]:!![]);_0x55bdfb[_0xbcc5('0x69')](_0x52f11e,_0x27f6bb[_0x20f0d4]['alias']||_0x52f11e);}if(_0x5d2c64[_0xbcc5('0x7c')]){_0x5d2c64['joins']=JSON[_0xbcc5('0x7d')](_0x5d2c64[_0xbcc5('0x7c')]);for(var _0x4d9b94=0x0;_0x4d9b94<_0x5d2c64[_0xbcc5('0x7c')]['length'];_0x4d9b94+=0x1){if(_0x5d2c64[_0xbcc5('0x7c')][_0x4d9b94]['type']&&_[_0xbcc5('0x63')](_0x4d9529,_0x5d2c64['joins'][_0x4d9b94][_0xbcc5('0x30')])&&_0x5d2c64[_0xbcc5('0x7c')][_0x4d9b94][_0xbcc5('0x7e')]&&_0x5d2c64[_0xbcc5('0x7c')][_0x4d9b94][_0xbcc5('0x7f')]&&_0x5d2c64[_0xbcc5('0x7c')][_0x4d9b94][_0xbcc5('0x81')]){_0x55bdfb[_0x5d2c64[_0xbcc5('0x7c')][_0x4d9b94][_0xbcc5('0x30')]](_0x5d2c64['joins'][_0x4d9b94]['foreignTable'],null,util[_0xbcc5('0x77')](_0xbcc5('0x80'),_0x5d2c64['table'],_0x5d2c64[_0xbcc5('0x7c')][_0x4d9b94][_0xbcc5('0x7e')],_0x5d2c64['joins'][_0x4d9b94][_0xbcc5('0x7f')],_0x5d2c64[_0xbcc5('0x7c')][_0x4d9b94][_0xbcc5('0x81')]));}}}if(_0x5d2c64[_0xbcc5('0x82')]){_0x5d2c64[_0xbcc5('0x82')]=JSON[_0xbcc5('0x7d')](_0x5d2c64[_0xbcc5('0x82')]);_0x55bdfb['where'](_0x581013(_0x5d2c64[_0xbcc5('0x82')][_0xbcc5('0x68')]));}_0x10c837=_0x55bdfb[_0xbcc5('0x8f')]();_0x55bdfb['limit'](_0x356fba);_0x55bdfb['offset'](0x0);return;}})[_0xbcc5('0x21')](function(){if(_0x4a29a4[_0xbcc5('0x90')]===_0xbcc5('0x91')){return null;}var _0x366a6d=_['merge'](_0x4a29a4,{'name':_0x4a29a4[_0xbcc5('0x92')]||_0x4a29a4[_0xbcc5('0x2a')]||_0x5d2c64[_0xbcc5('0x2a')],'basename':_0x261341,'savename':util[_0xbcc5('0x77')](_0xbcc5('0x93'),_0x4a29a4[_0xbcc5('0x2a')]||_0x5d2c64[_0xbcc5('0x2a')],require(_0xbcc5('0x94'))[_0xbcc5('0x95')](0x4),_0x4a29a4[_0xbcc5('0x90')]||_0xbcc5('0x96')),'reportId':_0x5d2c64['id'],'reportType':_0xbcc5('0x97')});return db[_0xbcc5('0x98')][_0xbcc5('0x4b')](_0x366a6d,{'raw':!![]});})[_0xbcc5('0x21')](function(_0x13e11c){if(_0x5d2c64[_0xbcc5('0x72')]===_0xbcc5('0x99')){_0x10c837[_0xbcc5('0x3d')](_0x5d2c64[_0xbcc5('0x72')]+_0xbcc5('0x9a'),_0x4a29a4[_0xbcc5('0x9b')],_0x4a29a4[_0xbcc5('0x9c')]);}else{_0x10c837[_0xbcc5('0x3d')](_0x5d2c64['table']+_0xbcc5('0x9d'),_0x4a29a4[_0xbcc5('0x9b')],_0x4a29a4[_0xbcc5('0x9c')]);}if(_0x13e11c){logger[_0xbcc5('0x9e')](_0xbcc5('0x9f'),_0x10c837[_0xbcc5('0x86')]());require(_0xbcc5('0xa0'))[_0xbcc5('0xa1')](path[_0xbcc5('0x56')](__dirname,_0xbcc5('0xa2'),_0x13e11c['output']),[_0x13e11c['id'],_0x10c837[_0xbcc5('0x86')](),path['join'](__dirname,_0xbcc5('0xa3'),_0x13e11c[_0xbcc5('0xa4')]),_0x261341]);return _0x13e11c;}else{var _0x261378=squel['select']();_0x261378['from']('('+_0x10c837[_0xbcc5('0x86')]()+')','countTable');_0x261378[_0xbcc5('0x69')](_0xbcc5('0xa5'),_0xbcc5('0x1d'));_0x10c837[_0xbcc5('0x1b')](_0x4a29a4[_0xbcc5('0x1b')]||_0x356fba);_0x10c837[_0xbcc5('0x1a')](_0x4a29a4[_0xbcc5('0x1a')]||0x0);return dbH[_0xbcc5('0x85')][_0xbcc5('0x33')](_0x261378[_0xbcc5('0x86')](),{'type':dbH[_0xbcc5('0x85')]['QueryTypes'][_0xbcc5('0x88')]})['then'](function(_0x20b7f4){if(!_0x20b7f4[_0xbcc5('0x49')]){_0x3db035=0x0;}else{_0x3db035=_0x20b7f4[0x0][_0xbcc5('0x1d')]||0x0;}return dbH[_0xbcc5('0x85')][_0xbcc5('0x33')](_0x10c837[_0xbcc5('0x86')](),{'type':dbH[_0xbcc5('0x85')][_0xbcc5('0x87')][_0xbcc5('0x88')]});})[_0xbcc5('0x21')](function(_0x169a96){return{'rows':_0x169a96||[],'count':_0x3db035};});}});}exports['run']=function(_0xf7d6df,_0x5bb715){return runReport(_0xf7d6df[_0xbcc5('0x54')],_0xf7d6df[_0xbcc5('0x33')],_0xf7d6df[_0xbcc5('0x42')])[_0xbcc5('0x21')](respondWithResult(_0x5bb715,null))['catch'](handleError(_0x5bb715,null));};exports[_0xbcc5('0xa6')]=runReport;exports[_0xbcc5('0x33')]=function(_0xc2bc43,_0x449e5f){var _0x12664d=0xa;var _0x1ced0d=[_0xbcc5('0x56'),_0xbcc5('0x57'),_0xbcc5('0x58'),_0xbcc5('0xa7')];var _0x153d42={'SUM':'SUM(%s)','COUNT':_0xbcc5('0x5a'),'COUNT DISTINCT':_0xbcc5('0x89'),'MAX':_0xbcc5('0x5b'),'MIN':_0xbcc5('0x5c'),'AVG':_0xbcc5('0x8a'),'GROUP_CONCAT':_0xbcc5('0x5d'),'GROUP_CONCAT ASC':_0xbcc5('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2666f3={'SEC_TO_TIME':_0xbcc5('0xa8'),'DATE':_0xbcc5('0x60'),'HOUR':'HOUR(%s)','ROUND':_0xbcc5('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x8e4b9f=function(_0x3697e0){return!_[_0xbcc5('0x63')]([_0xbcc5('0x64'),'IS\x20NOT\x20NULL',_0xbcc5('0x65'),'IS\x20NOT\x20EMPTY'],_0x3697e0);};var _0x1a336a=function(_0x21aa6a){if(!_0x21aa6a||!_0x21aa6a[_0xbcc5('0x66')][_0xbcc5('0x49')]){return'';}for(var _0x36e613='(',_0x3b909e=0x0;_0x3b909e<_0x21aa6a[_0xbcc5('0x66')][_0xbcc5('0x49')];_0x3b909e+=0x1){_0x3b909e>0x0&&(_0x36e613+='\x20'+_0x21aa6a[_0xbcc5('0x67')]+'\x20');_0x36e613+=_0x21aa6a[_0xbcc5('0x66')][_0x3b909e][_0xbcc5('0x68')]?_0x1a336a(_0x21aa6a['rules'][_0x3b909e][_0xbcc5('0x68')]):_0x21aa6a['rules'][_0x3b909e]['field']+'\x20'+_0x21aa6a['rules'][_0x3b909e][_0xbcc5('0x6a')]+(_0x8e4b9f(_0x21aa6a[_0xbcc5('0x66')][_0x3b909e]['condition'])?'\x20'+_0x21aa6a[_0xbcc5('0x66')][_0x3b909e]['value']:'');}return _0x36e613+')';};var _0x4767a7={'where':{'id':_0xc2bc43[_0xbcc5('0x54')]['id']}},_0x76a7c9,_0x4ab288,_0x3a4346,_0x36da13,_0xd3a024;_0x4767a7=_[_0xbcc5('0x40')]({},_0x4767a7,_0xc2bc43[_0xbcc5('0x42')]);return db['AnalyticCustomReport'][_0xbcc5('0x4a')](_0x4767a7)['then'](function(_0x2042ba){if(_0x2042ba){_0x76a7c9=_0x2042ba;return _0x2042ba[_0xbcc5('0x6b')]();}return null;})[_0xbcc5('0x21')](function(_0x4cb549){if(_0x4cb549){if(!_0x4cb549['length']){throw new db['Sequelize'][(_0xbcc5('0x6d'))](_0xbcc5('0x8e'),0x193);}_0x4ab288=_0x4cb549;return db[_0xbcc5('0x6e')]['findAll']({'raw':!![]});}return null;})[_0xbcc5('0x21')](function(_0x737fbc){if(_0x737fbc){_0x3a4346=_[_0xbcc5('0x6f')](_0x737fbc,'id');var _0x164d88;var _0x59c740=squel[_0xbcc5('0x70')]();_0x59c740['from'](_0x76a7c9['table']);for(var _0x353ff5=0x0;_0x353ff5<_0x4ab288['length'];_0x353ff5+=0x1){_0x164d88=_0x4ab288[_0x353ff5][_0xbcc5('0x73')]?_0x3a4346[_0x4ab288[_0x353ff5][_0xbcc5('0x73')]][_0xbcc5('0x74')]:_0x4ab288[_0x353ff5][_0xbcc5('0x69')];_0x164d88=_0x4ab288[_0x353ff5][_0xbcc5('0x75')]?_[_0xbcc5('0x76')](_0x153d42[_0x4ab288[_0x353ff5]['function']],'%s',_0x164d88):_0x164d88;_0x164d88=_0x4ab288[_0x353ff5][_0xbcc5('0x77')]?_[_0xbcc5('0x76')](_0x2666f3[_0x4ab288[_0x353ff5][_0xbcc5('0x77')]],'%s',_0x164d88):_0x164d88;if(_0x4ab288[_0x353ff5][_0xbcc5('0x78')]){_0x59c740[_0xbcc5('0x68')](_0x164d88);}_0x4ab288[_0x353ff5][_0xbcc5('0x79')]&&_0x59c740[_0xbcc5('0x3b')](_0x164d88,_0x4ab288[_0x353ff5]['orderBy']===_0xbcc5('0x7a')?![]:!![]);_0x59c740['field'](_0x164d88,_0x4ab288[_0x353ff5]['alias']||_0x164d88);}if(_0x76a7c9[_0xbcc5('0x7c')]){_0x76a7c9[_0xbcc5('0x7c')]=JSON[_0xbcc5('0x7d')](_0x76a7c9['joins']);for(var _0xb1295d=0x0;_0xb1295d<_0x76a7c9['joins'][_0xbcc5('0x49')];_0xb1295d+=0x1){if(_0x76a7c9['joins'][_0xb1295d][_0xbcc5('0x30')]&&_[_0xbcc5('0x63')](_0x1ced0d,_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d]['type'])&&_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d]['parentKey']&&_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d][_0xbcc5('0x7f')]&&_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d][_0xbcc5('0x81')]){_0x59c740[_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d][_0xbcc5('0x30')]](_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d][_0xbcc5('0x7f')],null,util[_0xbcc5('0x77')](_0xbcc5('0x80'),_0x76a7c9[_0xbcc5('0x72')],_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d]['parentKey'],_0x76a7c9[_0xbcc5('0x7c')][_0xb1295d]['foreignTable'],_0x76a7c9['joins'][_0xb1295d][_0xbcc5('0x81')]));}}}if(_0x76a7c9[_0xbcc5('0x82')]){_0x76a7c9[_0xbcc5('0x82')]=JSON[_0xbcc5('0x7d')](_0x76a7c9[_0xbcc5('0x82')]);_0x59c740[_0xbcc5('0x3d')](_0x1a336a(_0x76a7c9['conditions']['group']));}_0xd3a024=_0x59c740[_0xbcc5('0x8f')]();_0x59c740[_0xbcc5('0x1b')](_0x12664d);_0x59c740[_0xbcc5('0x1a')](0x0);logger[_0xbcc5('0x83')]('Limited\x20Query:',_0x59c740['toString']());return dbH[_0xbcc5('0x85')][_0xbcc5('0x33')](_0x59c740[_0xbcc5('0x86')](),{'type':dbH[_0xbcc5('0x85')]['QueryTypes'][_0xbcc5('0x88')]});}})[_0xbcc5('0x21')](function(){return{'sql':_0xd3a024[_0xbcc5('0x86')]()};})[_0xbcc5('0x21')](respondWithResult(_0x449e5f,null))[_0xbcc5('0x47')](handleError(_0x449e5f,null));}; \ No newline at end of file +var _0x1bc2=['order','sort','pick','where','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','params','find','create','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','join','right_join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ValidationErrorItem','select','metric','groupBy','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','runReport','operator','DESC','debug','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','then','get','CustomReports','UserProfileResource','end','error','stack','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','name','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','nolimit'];(function(_0x906120,_0x258135){var _0x1a7555=function(_0x383830){while(--_0x383830){_0x906120['push'](_0x906120['shift']());}};_0x1a7555(++_0x258135);}(_0x1bc2,0x113));var _0x21bc=function(_0x4705e2,_0xf34f8a){_0x4705e2=_0x4705e2-0x0;var _0x5203f6=_0x1bc2[_0x4705e2];return _0x5203f6;};'use strict';var emlformat=require(_0x21bc('0x0'));var rimraf=require(_0x21bc('0x1'));var zipdir=require(_0x21bc('0x2'));var jsonpatch=require(_0x21bc('0x3'));var rp=require('request-promise');var moment=require(_0x21bc('0x4'));var BPromise=require(_0x21bc('0x5'));var Mustache=require(_0x21bc('0x6'));var util=require('util');var path=require(_0x21bc('0x7'));var sox=require(_0x21bc('0x8'));var csv=require('to-csv');var ejs=require(_0x21bc('0x9'));var fs=require('fs');var fs_extra=require(_0x21bc('0xa'));var _=require(_0x21bc('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x21bc('0xc'));var deskjs=require(_0x21bc('0xd'));var toCsv=require(_0x21bc('0xe'));var querystring=require('querystring');var Papa=require(_0x21bc('0xf'));var Redis=require(_0x21bc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x21bc('0x11'));var as=require(_0x21bc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x21bc('0x13'))(_0x21bc('0x14'));var utils=require(_0x21bc('0x15'));var config=require(_0x21bc('0x16'));var licenseUtil=require(_0x21bc('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x21bc('0x18'))[_0x21bc('0x19')];function respondWithStatusCode(_0x1cb6fc,_0x113800){_0x113800=_0x113800||0xcc;return function(_0x5c85c0){if(_0x5c85c0){return _0x1cb6fc[_0x21bc('0x1a')](_0x113800);}return _0x1cb6fc[_0x21bc('0x1b')](_0x113800)['end']();};}function respondWithResult(_0x193dfc,_0x174e6c){_0x174e6c=_0x174e6c||0xc8;return function(_0x1ab824){if(_0x1ab824){return _0x193dfc['status'](_0x174e6c)[_0x21bc('0x1c')](_0x1ab824);}};}function respondWithFilteredResult(_0x309ffb,_0x29c3bb){return function(_0x314423){if(_0x314423){var _0x3fdbf2=typeof _0x29c3bb[_0x21bc('0x1d')]===_0x21bc('0x1e')&&typeof _0x29c3bb[_0x21bc('0x1f')]===_0x21bc('0x1e');var _0x4ec13a=_0x314423['count'];var _0x31149a=_0x3fdbf2?0x0:_0x29c3bb['offset'];var _0x233ff6=_0x3fdbf2?_0x314423['count']:_0x29c3bb[_0x21bc('0x1d')]+_0x29c3bb[_0x21bc('0x1f')];var _0x125239;if(_0x233ff6>=_0x4ec13a){_0x233ff6=_0x4ec13a;_0x125239=0xc8;}else{_0x125239=0xce;}_0x309ffb[_0x21bc('0x1b')](_0x125239);return _0x309ffb[_0x21bc('0x20')](_0x21bc('0x21'),_0x31149a+'-'+_0x233ff6+'/'+_0x4ec13a)[_0x21bc('0x1c')](_0x314423);}return null;};}function patchUpdates(_0x40b710){return function(_0x6e58aa){try{jsonpatch[_0x21bc('0x22')](_0x6e58aa,_0x40b710,!![]);}catch(_0x142c60){return BPromise[_0x21bc('0x23')](_0x142c60);}return _0x6e58aa[_0x21bc('0x24')]();};}function saveUpdates(_0x4986e2,_0x3e2fea){return function(_0x507d2d){if(_0x507d2d){return _0x507d2d['update'](_0x4986e2)['then'](function(_0x28f3b1){return _0x28f3b1;});}return null;};}function removeEntity(_0x1cb996,_0x22bc5e){return function(_0x31eaac){if(_0x31eaac){return _0x31eaac[_0x21bc('0x25')]()[_0x21bc('0x26')](function(){var _0x4a5bac=_0x31eaac[_0x21bc('0x27')]({'plain':!![]});var _0x55f891=_0x21bc('0x28');return db[_0x21bc('0x29')][_0x21bc('0x25')]({'where':{'type':_0x55f891,'resourceId':_0x4a5bac['id']}})[_0x21bc('0x26')](function(){return _0x31eaac;});})[_0x21bc('0x26')](function(){_0x1cb996['status'](0xcc)[_0x21bc('0x2a')]();});}};}function handleEntityNotFound(_0x56238d,_0x23d4dd){return function(_0x532758){if(!_0x532758){_0x56238d['sendStatus'](0x194);}return _0x532758;};}function handleError(_0x59e0e7,_0x2f84d7){_0x2f84d7=_0x2f84d7||0x1f4;return function(_0x7e1805){logger[_0x21bc('0x2b')](_0x7e1805[_0x21bc('0x2c')]);if(_0x7e1805['name']){delete _0x7e1805['name'];}_0x59e0e7[_0x21bc('0x1b')](_0x2f84d7)[_0x21bc('0x2d')](_0x7e1805);};}exports[_0x21bc('0x2e')]=function(_0xb68878,_0x445a05){var _0x1b5a66={},_0x2fb195={},_0x3df957={'count':0x0,'rows':[]};var _0x5b55a9=_[_0x21bc('0x2f')](db[_0x21bc('0x30')][_0x21bc('0x31')],function(_0x5cfcfc){return{'name':_0x5cfcfc[_0x21bc('0x32')],'type':_0x5cfcfc[_0x21bc('0x33')]['key']};});_0x2fb195['model']=_[_0x21bc('0x2f')](_0x5b55a9,_0x21bc('0x34'));_0x2fb195['query']=_[_0x21bc('0x35')](_0xb68878['query']);_0x2fb195[_0x21bc('0x36')]=_[_0x21bc('0x37')](_0x2fb195[_0x21bc('0x38')],_0x2fb195['query']);_0x1b5a66[_0x21bc('0x39')]=_[_0x21bc('0x37')](_0x2fb195['model'],qs[_0x21bc('0x3a')](_0xb68878[_0x21bc('0x3b')][_0x21bc('0x3a')]));_0x1b5a66[_0x21bc('0x39')]=_0x1b5a66[_0x21bc('0x39')][_0x21bc('0x3c')]?_0x1b5a66['attributes']:_0x2fb195[_0x21bc('0x38')];if(!_0xb68878['query'][_0x21bc('0x3d')](_0x21bc('0x3e'))){_0x1b5a66[_0x21bc('0x1f')]=qs[_0x21bc('0x1f')](_0xb68878[_0x21bc('0x3b')][_0x21bc('0x1f')]);_0x1b5a66[_0x21bc('0x1d')]=qs['offset'](_0xb68878[_0x21bc('0x3b')][_0x21bc('0x1d')]);}_0x1b5a66[_0x21bc('0x3f')]=qs[_0x21bc('0x40')](_0xb68878[_0x21bc('0x3b')][_0x21bc('0x40')]);_0x1b5a66['where']=qs[_0x21bc('0x36')](_[_0x21bc('0x41')](_0xb68878[_0x21bc('0x3b')],_0x2fb195[_0x21bc('0x36')]),_0x5b55a9);if(_0xb68878[_0x21bc('0x3b')]['filter']){_0x1b5a66[_0x21bc('0x42')]=_[_0x21bc('0x43')](_0x1b5a66[_0x21bc('0x42')],{'$or':_[_0x21bc('0x2f')](_0x5b55a9,function(_0xe36404){if(_0xe36404[_0x21bc('0x33')]!==_0x21bc('0x44')){var _0x3765c5={};_0x3765c5[_0xe36404[_0x21bc('0x34')]]={'$like':'%'+_0xb68878[_0x21bc('0x3b')]['filter']+'%'};return _0x3765c5;}})});}_0x1b5a66=_[_0x21bc('0x43')]({},_0x1b5a66,_0xb68878[_0x21bc('0x45')]);var _0x365746={'where':_0x1b5a66[_0x21bc('0x42')]};return db[_0x21bc('0x30')][_0x21bc('0x46')](_0x365746)[_0x21bc('0x26')](function(_0x49b09e){_0x3df957['count']=_0x49b09e;if(_0xb68878[_0x21bc('0x3b')][_0x21bc('0x47')]){_0x1b5a66[_0x21bc('0x48')]=[{'all':!![]}];}return db[_0x21bc('0x30')][_0x21bc('0x49')](_0x1b5a66);})[_0x21bc('0x26')](function(_0x1f61f5){_0x3df957['rows']=_0x1f61f5;return _0x3df957;})[_0x21bc('0x26')](respondWithFilteredResult(_0x445a05,_0x1b5a66))[_0x21bc('0x4a')](handleError(_0x445a05,null));};exports['show']=function(_0x49e296,_0x7d2e82){var _0x2bb962={'raw':![],'where':{'id':_0x49e296[_0x21bc('0x4b')]['id']}},_0x33edd4={};_0x33edd4[_0x21bc('0x38')]=_[_0x21bc('0x35')](db[_0x21bc('0x30')]['rawAttributes']);_0x33edd4[_0x21bc('0x3b')]=_[_0x21bc('0x35')](_0x49e296['query']);_0x33edd4[_0x21bc('0x36')]=_[_0x21bc('0x37')](_0x33edd4[_0x21bc('0x38')],_0x33edd4[_0x21bc('0x3b')]);_0x2bb962['attributes']=_['intersection'](_0x33edd4['model'],qs[_0x21bc('0x3a')](_0x49e296[_0x21bc('0x3b')][_0x21bc('0x3a')]));_0x2bb962[_0x21bc('0x39')]=_0x2bb962[_0x21bc('0x39')][_0x21bc('0x3c')]?_0x2bb962[_0x21bc('0x39')]:_0x33edd4[_0x21bc('0x38')];if(_0x49e296[_0x21bc('0x3b')][_0x21bc('0x47')]){_0x2bb962[_0x21bc('0x48')]=[{'all':!![]}];}_0x2bb962=_['merge']({},_0x2bb962,_0x49e296['options']);return db[_0x21bc('0x30')][_0x21bc('0x4c')](_0x2bb962)[_0x21bc('0x26')](handleEntityNotFound(_0x7d2e82,null))['then'](respondWithResult(_0x7d2e82,null))['catch'](handleError(_0x7d2e82,null));};exports[_0x21bc('0x4d')]=function(_0x31b583,_0x54df88){return db[_0x21bc('0x30')][_0x21bc('0x4d')](_0x31b583['body'],{})['then'](function(_0x1d5b19){var _0x19ead6=_0x31b583[_0x21bc('0x4e')]['get']({'plain':!![]});if(!_0x19ead6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19ead6[_0x21bc('0x4f')]===_0x21bc('0x4e')){var _0xff5945=_0x1d5b19[_0x21bc('0x27')]({'plain':!![]});var _0x58b3e0=_0x21bc('0x50');return db[_0x21bc('0x51')][_0x21bc('0x4c')]({'where':{'name':_0x58b3e0,'userProfileId':_0x19ead6[_0x21bc('0x52')]},'raw':!![]})[_0x21bc('0x26')](function(_0x584d59){if(_0x584d59&&_0x584d59[_0x21bc('0x53')]===0x0){return db['UserProfileResource'][_0x21bc('0x4d')]({'name':_0xff5945[_0x21bc('0x34')],'resourceId':_0xff5945['id'],'type':_0x21bc('0x28'),'sectionId':_0x584d59['id']},{})[_0x21bc('0x26')](function(){return _0x1d5b19;});}else{return _0x1d5b19;}})[_0x21bc('0x4a')](function(_0x3e5edf){logger['error'](_0x21bc('0x54'),_0x3e5edf);throw _0x3e5edf;});}return _0x1d5b19;})[_0x21bc('0x26')](respondWithResult(_0x54df88,0xc9))[_0x21bc('0x4a')](handleError(_0x54df88,null));};exports[_0x21bc('0x55')]=function(_0x56d26f,_0x479fa6){if(_0x56d26f[_0x21bc('0x56')]['id']){delete _0x56d26f[_0x21bc('0x56')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x56d26f[_0x21bc('0x4b')]['id']}})[_0x21bc('0x26')](handleEntityNotFound(_0x479fa6,null))['then'](saveUpdates(_0x56d26f[_0x21bc('0x56')],null))['then'](respondWithResult(_0x479fa6,null))[_0x21bc('0x4a')](handleError(_0x479fa6,null));};exports[_0x21bc('0x25')]=function(_0x238e50,_0x19aa7b){return db[_0x21bc('0x30')][_0x21bc('0x4c')]({'where':{'id':_0x238e50[_0x21bc('0x4b')]['id']}})[_0x21bc('0x26')](handleEntityNotFound(_0x19aa7b,null))[_0x21bc('0x26')](removeEntity(_0x19aa7b,null))[_0x21bc('0x4a')](handleError(_0x19aa7b,null));};exports['preview']=function(_0x1fc386,_0x738ea3){var _0x4d6d60=0xa;var _0x32655d=['join',_0x21bc('0x57'),'right_join',_0x21bc('0x58')];var _0x1b9fbc={'SUM':_0x21bc('0x59'),'COUNT':_0x21bc('0x5a'),'COUNT DISTINCT':_0x21bc('0x5b'),'MAX':_0x21bc('0x5c'),'MIN':_0x21bc('0x5d'),'AVG':_0x21bc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x21bc('0x5f'),'GROUP_CONCAT DESC':_0x21bc('0x60')};var _0x153db7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x21bc('0x61'),'HOUR':_0x21bc('0x62'),'ROUND':_0x21bc('0x63'),'UNIX_TIMESTAMP':_0x21bc('0x64')};var _0x2f6f22=function(_0x41b0a4){return!_[_0x21bc('0x65')]([_0x21bc('0x66'),_0x21bc('0x67'),_0x21bc('0x68'),_0x21bc('0x69')],_0x41b0a4);};var _0x19b331=function(_0x68fb17){if(!_0x68fb17||!_0x68fb17['rules']['length']){return'';}for(var _0x1a565f='(',_0x14be74=0x0;_0x14be74<_0x68fb17[_0x21bc('0x6a')]['length'];_0x14be74+=0x1){_0x14be74>0x0&&(_0x1a565f+='\x20'+_0x68fb17['operator']+'\x20');_0x1a565f+=_0x68fb17[_0x21bc('0x6a')][_0x14be74][_0x21bc('0x6b')]?_0x19b331(_0x68fb17[_0x21bc('0x6a')][_0x14be74][_0x21bc('0x6b')]):_0x68fb17['rules'][_0x14be74][_0x21bc('0x6c')]+'\x20'+_0x68fb17['rules'][_0x14be74]['condition']+(_0x2f6f22(_0x68fb17[_0x21bc('0x6a')][_0x14be74][_0x21bc('0x6d')])?'\x20'+_0x68fb17[_0x21bc('0x6a')][_0x14be74][_0x21bc('0x6e')]:'');}return _0x1a565f+')';};var _0x52adc4={'where':{'id':_0x1fc386[_0x21bc('0x4b')]['id']}},_0x5bd3d1,_0x28a6cb,_0x42443e,_0x54c2ef,_0x431350;_0x52adc4=_[_0x21bc('0x43')]({},_0x52adc4,_0x1fc386[_0x21bc('0x45')]);return db[_0x21bc('0x30')][_0x21bc('0x4c')](_0x52adc4)['then'](function(_0x10aeeb){if(_0x10aeeb){_0x5bd3d1=_0x10aeeb;return _0x10aeeb[_0x21bc('0x6f')]();}return null;})[_0x21bc('0x26')](function(_0x527da6){if(_0x527da6){if(!_0x527da6[_0x21bc('0x3c')]){throw new db[(_0x21bc('0x70'))]['ValidationErrorItem'](_0x21bc('0x71'),0x193);}_0x28a6cb=_0x527da6;return db[_0x21bc('0x72')][_0x21bc('0x49')]({'raw':!![]});}return null;})[_0x21bc('0x26')](function(_0x8da017){if(_0x8da017){_0x42443e=_[_0x21bc('0x73')](_0x8da017,'id');var _0x2470bd;var _0x1d5d88=squel['select']();_0x1d5d88[_0x21bc('0x74')](_0x5bd3d1[_0x21bc('0x75')]);for(var _0x296eaa=0x0;_0x296eaa<_0x28a6cb[_0x21bc('0x3c')];_0x296eaa+=0x1){_0x2470bd=_0x28a6cb[_0x296eaa][_0x21bc('0x76')]?_0x42443e[_0x28a6cb[_0x296eaa][_0x21bc('0x76')]]['metric']:_0x28a6cb[_0x296eaa][_0x21bc('0x6c')];_0x2470bd=_0x28a6cb[_0x296eaa][_0x21bc('0x77')]?_[_0x21bc('0x78')](_0x1b9fbc[_0x28a6cb[_0x296eaa]['function']],'%s',_0x2470bd):_0x2470bd;_0x2470bd=_0x28a6cb[_0x296eaa][_0x21bc('0x79')]?_[_0x21bc('0x78')](_0x153db7[_0x28a6cb[_0x296eaa][_0x21bc('0x79')]],'%s',_0x2470bd):_0x2470bd;if(_0x28a6cb[_0x296eaa]['groupBy']){_0x1d5d88[_0x21bc('0x6b')](_0x2470bd);}_0x28a6cb[_0x296eaa][_0x21bc('0x7a')]&&_0x1d5d88[_0x21bc('0x3f')](_0x2470bd,_0x28a6cb[_0x296eaa]['orderBy']==='DESC'?![]:!![]);_0x1d5d88['field'](_0x2470bd,_0x28a6cb[_0x296eaa][_0x21bc('0x7b')]||_0x2470bd);}if(_0x5bd3d1[_0x21bc('0x7c')]){_0x5bd3d1[_0x21bc('0x7c')]=JSON[_0x21bc('0x7d')](_0x5bd3d1[_0x21bc('0x7c')]);for(var _0x1c813e=0x0;_0x1c813e<_0x5bd3d1['joins'][_0x21bc('0x3c')];_0x1c813e+=0x1){if(_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e]['type']&&_[_0x21bc('0x65')](_0x32655d,_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e][_0x21bc('0x33')])&&_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e][_0x21bc('0x7e')]&&_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e][_0x21bc('0x7f')]&&_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e][_0x21bc('0x80')]){_0x1d5d88[_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e][_0x21bc('0x33')]](_0x5bd3d1['joins'][_0x1c813e]['foreignTable'],null,util['format'](_0x21bc('0x81'),_0x5bd3d1[_0x21bc('0x75')],_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e][_0x21bc('0x7e')],_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e]['foreignTable'],_0x5bd3d1[_0x21bc('0x7c')][_0x1c813e]['foreignKey']));}}}if(_0x5bd3d1[_0x21bc('0x82')]){_0x5bd3d1[_0x21bc('0x82')]=JSON[_0x21bc('0x7d')](_0x5bd3d1['conditions']);_0x1d5d88[_0x21bc('0x42')](_0x19b331(_0x5bd3d1[_0x21bc('0x82')][_0x21bc('0x6b')]));}_0x431350=_0x1d5d88[_0x21bc('0x83')]();_0x1d5d88[_0x21bc('0x1f')](_0x4d6d60);_0x1d5d88[_0x21bc('0x1d')](0x0);logger['debug'](_0x21bc('0x84'),_0x1d5d88[_0x21bc('0x85')]());return dbH[_0x21bc('0x86')][_0x21bc('0x3b')](_0x1d5d88['toString'](),{'type':dbH['sequelize'][_0x21bc('0x87')]['SELECT']});}})[_0x21bc('0x26')](respondWithResult(_0x738ea3,null))[_0x21bc('0x4a')](handleError(_0x738ea3,null));};function runReport(_0x3632f7,_0x2e1212,_0x4069c9){var _0x279915=_0x2e1212['name'];var _0x4bbfed=0xa;var _0xc253cb=[_0x21bc('0x88'),_0x21bc('0x57'),_0x21bc('0x89'),_0x21bc('0x58')];var _0x33d04d={'SUM':_0x21bc('0x59'),'COUNT':_0x21bc('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x21bc('0x5d'),'AVG':_0x21bc('0x5e'),'GROUP_CONCAT':_0x21bc('0x8a'),'GROUP_CONCAT ASC':_0x21bc('0x5f'),'GROUP_CONCAT DESC':_0x21bc('0x60')};var _0x26f6e5={'SEC_TO_TIME':_0x21bc('0x8b'),'DATE':_0x21bc('0x61'),'HOUR':_0x21bc('0x62'),'ROUND':_0x21bc('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x7a8c27=function(_0x260165){return!_[_0x21bc('0x65')]([_0x21bc('0x66'),_0x21bc('0x67'),_0x21bc('0x68'),_0x21bc('0x69')],_0x260165);};var _0x2a96b4=function(_0x2c7bb6){if(!_0x2c7bb6||!_0x2c7bb6[_0x21bc('0x6a')][_0x21bc('0x3c')]){return'';}for(var _0x2dabaf='(',_0x17c697=0x0;_0x17c697<_0x2c7bb6['rules'][_0x21bc('0x3c')];_0x17c697+=0x1){_0x17c697>0x0&&(_0x2dabaf+='\x20'+_0x2c7bb6['operator']+'\x20');_0x2dabaf+=_0x2c7bb6[_0x21bc('0x6a')][_0x17c697]['group']?_0x2a96b4(_0x2c7bb6[_0x21bc('0x6a')][_0x17c697][_0x21bc('0x6b')]):_0x2c7bb6[_0x21bc('0x6a')][_0x17c697]['field']+'\x20'+_0x2c7bb6['rules'][_0x17c697]['condition']+(_0x7a8c27(_0x2c7bb6[_0x21bc('0x6a')][_0x17c697]['condition'])?'\x20'+_0x2c7bb6[_0x21bc('0x6a')][_0x17c697][_0x21bc('0x6e')]:'');}return _0x2dabaf+')';};var _0x229a3e={'where':{'id':_0x3632f7['id']}},_0x32e290,_0x2b5b2b,_0x2e1c09,_0x202390,_0x4b37b8;_0x229a3e=_[_0x21bc('0x43')]({},_0x229a3e,_0x4069c9);return db[_0x21bc('0x30')]['find'](_0x229a3e)[_0x21bc('0x26')](function(_0x3ea8ef){if(_0x3ea8ef){_0x32e290=_0x3ea8ef;return _0x3ea8ef['getFields']();}return null;})[_0x21bc('0x26')](function(_0x5d71dd){if(_0x5d71dd){if(!_0x5d71dd['length']){throw new db['Sequelize'][(_0x21bc('0x8c'))](_0x21bc('0x71'),0x193);}_0x2b5b2b=_0x5d71dd;return db[_0x21bc('0x72')][_0x21bc('0x49')]({'raw':!![]});}return null;})[_0x21bc('0x26')](function(_0x1ab0f3){if(_0x1ab0f3){_0x2e1c09=_[_0x21bc('0x73')](_0x1ab0f3,'id');var _0x4360d7;var _0xb7572c=squel[_0x21bc('0x8d')]();_0xb7572c['from'](_0x32e290[_0x21bc('0x75')]);for(var _0x4b0fa2=0x0;_0x4b0fa2<_0x2b5b2b['length'];_0x4b0fa2+=0x1){_0x4360d7=_0x2b5b2b[_0x4b0fa2][_0x21bc('0x76')]?_0x2e1c09[_0x2b5b2b[_0x4b0fa2]['MetricId']][_0x21bc('0x8e')]:_0x2b5b2b[_0x4b0fa2][_0x21bc('0x6c')];_0x4360d7=_0x2b5b2b[_0x4b0fa2][_0x21bc('0x77')]?_['replace'](_0x33d04d[_0x2b5b2b[_0x4b0fa2][_0x21bc('0x77')]],'%s',_0x4360d7):_0x4360d7;_0x4360d7=_0x2b5b2b[_0x4b0fa2][_0x21bc('0x79')]?_[_0x21bc('0x78')](_0x26f6e5[_0x2b5b2b[_0x4b0fa2]['format']],'%s',_0x4360d7):_0x4360d7;if(_0x2b5b2b[_0x4b0fa2][_0x21bc('0x8f')]){_0xb7572c['group'](_0x4360d7);}_0x2b5b2b[_0x4b0fa2][_0x21bc('0x7a')]&&_0xb7572c[_0x21bc('0x3f')](_0x4360d7,_0x2b5b2b[_0x4b0fa2][_0x21bc('0x7a')]==='DESC'?![]:!![]);_0xb7572c[_0x21bc('0x6c')](_0x4360d7,_0x2b5b2b[_0x4b0fa2][_0x21bc('0x7b')]||_0x4360d7);}if(_0x32e290[_0x21bc('0x7c')]){_0x32e290[_0x21bc('0x7c')]=JSON[_0x21bc('0x7d')](_0x32e290['joins']);for(var _0x476777=0x0;_0x476777<_0x32e290[_0x21bc('0x7c')]['length'];_0x476777+=0x1){if(_0x32e290['joins'][_0x476777][_0x21bc('0x33')]&&_['includes'](_0xc253cb,_0x32e290['joins'][_0x476777][_0x21bc('0x33')])&&_0x32e290[_0x21bc('0x7c')][_0x476777][_0x21bc('0x7e')]&&_0x32e290['joins'][_0x476777][_0x21bc('0x7f')]&&_0x32e290[_0x21bc('0x7c')][_0x476777][_0x21bc('0x80')]){_0xb7572c[_0x32e290[_0x21bc('0x7c')][_0x476777]['type']](_0x32e290['joins'][_0x476777][_0x21bc('0x7f')],null,util[_0x21bc('0x79')]('%s.%s\x20=\x20%s.%s',_0x32e290[_0x21bc('0x75')],_0x32e290[_0x21bc('0x7c')][_0x476777][_0x21bc('0x7e')],_0x32e290[_0x21bc('0x7c')][_0x476777][_0x21bc('0x7f')],_0x32e290['joins'][_0x476777][_0x21bc('0x80')]));}}}if(_0x32e290['conditions']){_0x32e290[_0x21bc('0x82')]=JSON[_0x21bc('0x7d')](_0x32e290[_0x21bc('0x82')]);_0xb7572c[_0x21bc('0x42')](_0x2a96b4(_0x32e290[_0x21bc('0x82')][_0x21bc('0x6b')]));}_0x4b37b8=_0xb7572c[_0x21bc('0x83')]();_0xb7572c[_0x21bc('0x1f')](_0x4bbfed);_0xb7572c[_0x21bc('0x1d')](0x0);return;}})[_0x21bc('0x26')](function(){if(_0x2e1212[_0x21bc('0x90')]===_0x21bc('0x91')){return null;}var _0x58e1f5=_[_0x21bc('0x43')](_0x2e1212,{'name':_0x2e1212[_0x21bc('0x92')]||_0x2e1212[_0x21bc('0x34')]||_0x32e290[_0x21bc('0x34')],'basename':_0x279915,'savename':util['format'](_0x21bc('0x93'),_0x2e1212[_0x21bc('0x34')]||_0x32e290['name'],require(_0x21bc('0x94'))[_0x21bc('0x95')](0x4),_0x2e1212[_0x21bc('0x90')]||_0x21bc('0x96')),'reportId':_0x32e290['id'],'reportType':_0x21bc('0x97')});return db[_0x21bc('0x98')]['create'](_0x58e1f5,{'raw':!![]});})[_0x21bc('0x26')](function(_0x127bfd){if(_0x32e290[_0x21bc('0x75')]===_0x21bc('0x99')){_0x4b37b8[_0x21bc('0x42')](_0x32e290[_0x21bc('0x75')]+_0x21bc('0x9a'),_0x2e1212[_0x21bc('0x9b')],_0x2e1212[_0x21bc('0x9c')]);}else{_0x4b37b8[_0x21bc('0x42')](_0x32e290[_0x21bc('0x75')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e1212[_0x21bc('0x9b')],_0x2e1212['endDate']);}if(_0x127bfd){logger[_0x21bc('0x9d')](_0x21bc('0x9e'),_0x4b37b8[_0x21bc('0x85')]());require('child_process')['fork'](path[_0x21bc('0x88')](__dirname,_0x21bc('0x9f'),_0x127bfd[_0x21bc('0x90')]),[_0x127bfd['id'],_0x4b37b8[_0x21bc('0x85')](),path['join'](__dirname,'../../files/reports',_0x127bfd[_0x21bc('0xa0')]),_0x279915]);return _0x127bfd;}else{var _0x3e41b9=squel[_0x21bc('0x8d')]();_0x3e41b9['from']('('+_0x4b37b8[_0x21bc('0x85')]()+')',_0x21bc('0xa1'));_0x3e41b9[_0x21bc('0x6c')](_0x21bc('0xa2'),_0x21bc('0x46'));_0x4b37b8['limit'](_0x2e1212[_0x21bc('0x1f')]||_0x4bbfed);_0x4b37b8['offset'](_0x2e1212['offset']||0x0);return dbH[_0x21bc('0x86')][_0x21bc('0x3b')](_0x3e41b9[_0x21bc('0x85')](),{'type':dbH[_0x21bc('0x86')][_0x21bc('0x87')][_0x21bc('0xa3')]})[_0x21bc('0x26')](function(_0x130729){if(!_0x130729[_0x21bc('0x3c')]){_0x202390=0x0;}else{_0x202390=_0x130729[0x0][_0x21bc('0x46')]||0x0;}return dbH[_0x21bc('0x86')]['query'](_0x4b37b8[_0x21bc('0x85')](),{'type':dbH['sequelize'][_0x21bc('0x87')][_0x21bc('0xa3')]});})[_0x21bc('0x26')](function(_0x4f1c18){return{'rows':_0x4f1c18||[],'count':_0x202390};});}});}exports[_0x21bc('0xa4')]=function(_0x5d5d2c,_0x18c246){return runReport(_0x5d5d2c[_0x21bc('0x4b')],_0x5d5d2c[_0x21bc('0x3b')],_0x5d5d2c[_0x21bc('0x45')])['then'](respondWithResult(_0x18c246,null))[_0x21bc('0x4a')](handleError(_0x18c246,null));};exports[_0x21bc('0xa5')]=runReport;exports[_0x21bc('0x3b')]=function(_0x45c01e,_0x3346b2){var _0x5ae370=0xa;var _0x4720eb=[_0x21bc('0x88'),_0x21bc('0x57'),'right_join',_0x21bc('0x58')];var _0x58b568={'SUM':_0x21bc('0x59'),'COUNT':_0x21bc('0x5a'),'COUNT DISTINCT':_0x21bc('0x5b'),'MAX':_0x21bc('0x5c'),'MIN':'MIN(%s)','AVG':_0x21bc('0x5e'),'GROUP_CONCAT':_0x21bc('0x8a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x21bc('0x60')};var _0x42c684={'SEC_TO_TIME':_0x21bc('0x8b'),'DATE':_0x21bc('0x61'),'HOUR':_0x21bc('0x62'),'ROUND':_0x21bc('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3d97e0=function(_0x3185e0){return!_[_0x21bc('0x65')]([_0x21bc('0x66'),_0x21bc('0x67'),_0x21bc('0x68'),'IS\x20NOT\x20EMPTY'],_0x3185e0);};var _0x50dfd2=function(_0x2d1d0f){if(!_0x2d1d0f||!_0x2d1d0f[_0x21bc('0x6a')]['length']){return'';}for(var _0x5c4021='(',_0x3ba1cb=0x0;_0x3ba1cb<_0x2d1d0f[_0x21bc('0x6a')][_0x21bc('0x3c')];_0x3ba1cb+=0x1){_0x3ba1cb>0x0&&(_0x5c4021+='\x20'+_0x2d1d0f[_0x21bc('0xa6')]+'\x20');_0x5c4021+=_0x2d1d0f['rules'][_0x3ba1cb][_0x21bc('0x6b')]?_0x50dfd2(_0x2d1d0f[_0x21bc('0x6a')][_0x3ba1cb][_0x21bc('0x6b')]):_0x2d1d0f[_0x21bc('0x6a')][_0x3ba1cb][_0x21bc('0x6c')]+'\x20'+_0x2d1d0f[_0x21bc('0x6a')][_0x3ba1cb][_0x21bc('0x6d')]+(_0x3d97e0(_0x2d1d0f[_0x21bc('0x6a')][_0x3ba1cb]['condition'])?'\x20'+_0x2d1d0f[_0x21bc('0x6a')][_0x3ba1cb][_0x21bc('0x6e')]:'');}return _0x5c4021+')';};var _0x3a7010={'where':{'id':_0x45c01e[_0x21bc('0x4b')]['id']}},_0x3be050,_0x4a1e59,_0xf7625a,_0xc0ee05,_0x322a77;_0x3a7010=_[_0x21bc('0x43')]({},_0x3a7010,_0x45c01e[_0x21bc('0x45')]);return db[_0x21bc('0x30')][_0x21bc('0x4c')](_0x3a7010)['then'](function(_0x1d2bee){if(_0x1d2bee){_0x3be050=_0x1d2bee;return _0x1d2bee[_0x21bc('0x6f')]();}return null;})[_0x21bc('0x26')](function(_0x3750bd){if(_0x3750bd){if(!_0x3750bd[_0x21bc('0x3c')]){throw new db[(_0x21bc('0x70'))][(_0x21bc('0x8c'))](_0x21bc('0x71'),0x193);}_0x4a1e59=_0x3750bd;return db['AnalyticMetric'][_0x21bc('0x49')]({'raw':!![]});}return null;})['then'](function(_0x1f60f1){if(_0x1f60f1){_0xf7625a=_[_0x21bc('0x73')](_0x1f60f1,'id');var _0x28627f;var _0x1a4176=squel['select']();_0x1a4176[_0x21bc('0x74')](_0x3be050[_0x21bc('0x75')]);for(var _0x191740=0x0;_0x191740<_0x4a1e59[_0x21bc('0x3c')];_0x191740+=0x1){_0x28627f=_0x4a1e59[_0x191740][_0x21bc('0x76')]?_0xf7625a[_0x4a1e59[_0x191740][_0x21bc('0x76')]]['metric']:_0x4a1e59[_0x191740][_0x21bc('0x6c')];_0x28627f=_0x4a1e59[_0x191740][_0x21bc('0x77')]?_[_0x21bc('0x78')](_0x58b568[_0x4a1e59[_0x191740][_0x21bc('0x77')]],'%s',_0x28627f):_0x28627f;_0x28627f=_0x4a1e59[_0x191740]['format']?_[_0x21bc('0x78')](_0x42c684[_0x4a1e59[_0x191740][_0x21bc('0x79')]],'%s',_0x28627f):_0x28627f;if(_0x4a1e59[_0x191740]['groupBy']){_0x1a4176['group'](_0x28627f);}_0x4a1e59[_0x191740]['orderBy']&&_0x1a4176[_0x21bc('0x3f')](_0x28627f,_0x4a1e59[_0x191740][_0x21bc('0x7a')]===_0x21bc('0xa7')?![]:!![]);_0x1a4176[_0x21bc('0x6c')](_0x28627f,_0x4a1e59[_0x191740][_0x21bc('0x7b')]||_0x28627f);}if(_0x3be050[_0x21bc('0x7c')]){_0x3be050[_0x21bc('0x7c')]=JSON[_0x21bc('0x7d')](_0x3be050['joins']);for(var _0x2b75eb=0x0;_0x2b75eb<_0x3be050[_0x21bc('0x7c')][_0x21bc('0x3c')];_0x2b75eb+=0x1){if(_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x33')]&&_['includes'](_0x4720eb,_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x33')])&&_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x7e')]&&_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x7f')]&&_0x3be050['joins'][_0x2b75eb]['foreignKey']){_0x1a4176[_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x33')]](_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x7f')],null,util[_0x21bc('0x79')]('%s.%s\x20=\x20%s.%s',_0x3be050[_0x21bc('0x75')],_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x7e')],_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x7f')],_0x3be050[_0x21bc('0x7c')][_0x2b75eb][_0x21bc('0x80')]));}}}if(_0x3be050[_0x21bc('0x82')]){_0x3be050[_0x21bc('0x82')]=JSON[_0x21bc('0x7d')](_0x3be050['conditions']);_0x1a4176[_0x21bc('0x42')](_0x50dfd2(_0x3be050[_0x21bc('0x82')][_0x21bc('0x6b')]));}_0x322a77=_0x1a4176[_0x21bc('0x83')]();_0x1a4176['limit'](_0x5ae370);_0x1a4176[_0x21bc('0x1d')](0x0);logger[_0x21bc('0xa8')](_0x21bc('0x84'),_0x1a4176[_0x21bc('0x85')]());return dbH[_0x21bc('0x86')][_0x21bc('0x3b')](_0x1a4176['toString'](),{'type':dbH[_0x21bc('0x86')]['QueryTypes'][_0x21bc('0xa3')]});}})['then'](function(){return{'sql':_0x322a77[_0x21bc('0x85')]()};})['then'](respondWithResult(_0x3346b2,null))['catch'](handleError(_0x3346b2,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 2563358..7d87679 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 _0xa065=['define','analytics_custom_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports'];(function(_0x119de7,_0x3d1fbb){var _0x4a3ea3=function(_0x3a50f7){while(--_0x3a50f7){_0x119de7['push'](_0x119de7['shift']());}};_0x4a3ea3(++_0x3d1fbb);}(_0xa065,0x1d6));var _0x5a06=function(_0xb77dcb,_0x35782f){_0xb77dcb=_0xb77dcb-0x0;var _0x4e99c4=_0xa065[_0xb77dcb];return _0x4e99c4;};'use strict';var _=require(_0x5a06('0x0'));var util=require(_0x5a06('0x1'));var logger=require(_0x5a06('0x2'))(_0x5a06('0x3'));var moment=require('moment');var BPromise=require(_0x5a06('0x4'));var rp=require(_0x5a06('0x5'));var fs=require('fs');var path=require(_0x5a06('0x6'));var rimraf=require(_0x5a06('0x7'));var config=require(_0x5a06('0x8'));var attributes=require(_0x5a06('0x9'));module[_0x5a06('0xa')]=function(_0x18bdbf,_0x56f3d7){return _0x18bdbf[_0x5a06('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x5a06('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b98=['define','AnalyticCustomReport','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4b19cf,_0x24be08){var _0x4fdb3b=function(_0x591dbf){while(--_0x591dbf){_0x4b19cf['push'](_0x4b19cf['shift']());}};_0x4fdb3b(++_0x24be08);}(_0x1b98,0xff));var _0x81b9=function(_0x2ed0c2,_0x14aaa4){_0x2ed0c2=_0x2ed0c2-0x0;var _0x11f0b1=_0x1b98[_0x2ed0c2];return _0x11f0b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x81b9('0x0'))(_0x81b9('0x1'));var moment=require(_0x81b9('0x2'));var BPromise=require(_0x81b9('0x3'));var rp=require(_0x81b9('0x4'));var fs=require('fs');var path=require(_0x81b9('0x5'));var rimraf=require(_0x81b9('0x6'));var config=require(_0x81b9('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x81b9('0x8')]=function(_0x5469a6,_0x932cc4){return _0x5469a6[_0x81b9('0x9')](_0x81b9('0xa'),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 349d7e8..f24bb5e 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 _0x0e90=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x33d72a,_0x12e59f){var _0x4000bf=function(_0x40b5f4){while(--_0x40b5f4){_0x33d72a['push'](_0x33d72a['shift']());}};_0x4000bf(++_0x12e59f);}(_0x0e90,0x158));var _0x00e9=function(_0x2993d9,_0x3003c7){_0x2993d9=_0x2993d9-0x0;var _0x4ba16c=_0x0e90[_0x2993d9];return _0x4ba16c;};'use strict';var _=require('lodash');var util=require(_0x00e9('0x0'));var moment=require(_0x00e9('0x1'));var BPromise=require('bluebird');var rs=require(_0x00e9('0x2'));var fs=require('fs');var Redis=require(_0x00e9('0x3'));var db=require(_0x00e9('0x4'))['db'];var utils=require(_0x00e9('0x5'));var logger=require('../../config/logger')(_0x00e9('0x6'));var config=require(_0x00e9('0x7'));var jayson=require(_0x00e9('0x8'));var client=jayson[_0x00e9('0x9')][_0x00e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ad3f,_0x5af8ce,_0x176877){return new BPromise(function(_0x75e682,_0x4c9f78){return client[_0x00e9('0xb')](_0x21ad3f,_0x176877)[_0x00e9('0xc')](function(_0x4a353e){logger['info'](_0x00e9('0xd'),_0x5af8ce,_0x00e9('0xe'));logger[_0x00e9('0xf')](_0x00e9('0x10'),_0x5af8ce,_0x00e9('0xe'),JSON['stringify'](_0x4a353e));if(_0x4a353e[_0x00e9('0x11')]){if(_0x4a353e[_0x00e9('0x11')][_0x00e9('0x12')]===0x1f4){logger[_0x00e9('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5af8ce,_0x4a353e['error'][_0x00e9('0x13')]);return _0x4c9f78(_0x4a353e[_0x00e9('0x11')][_0x00e9('0x13')]);}logger[_0x00e9('0x11')](_0x00e9('0xd'),_0x5af8ce,_0x4a353e[_0x00e9('0x11')]['message']);return _0x75e682(_0x4a353e[_0x00e9('0x11')][_0x00e9('0x13')]);}else{logger[_0x00e9('0x14')](_0x00e9('0xd'),_0x5af8ce,_0x00e9('0xe'));_0x75e682(_0x4a353e['result'][_0x00e9('0x13')]);}})['catch'](function(_0x13b911){logger[_0x00e9('0x11')](_0x00e9('0xd'),_0x5af8ce,_0x13b911);_0x4c9f78(_0x13b911);});});} \ No newline at end of file +var _0x90e4=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','catch','lodash','moment','bluebird'];(function(_0x3aff24,_0x2f62d5){var _0x55c5a1=function(_0x2d5174){while(--_0x2d5174){_0x3aff24['push'](_0x3aff24['shift']());}};_0x55c5a1(++_0x2f62d5);}(_0x90e4,0x177));var _0x490e=function(_0x3c1312,_0x45bfdb){_0x3c1312=_0x3c1312-0x0;var _0x5b4831=_0x90e4[_0x3c1312];return _0x5b4831;};'use strict';var _=require(_0x490e('0x0'));var util=require('util');var moment=require(_0x490e('0x1'));var BPromise=require(_0x490e('0x2'));var rs=require(_0x490e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x490e('0x4'))['db'];var utils=require(_0x490e('0x5'));var logger=require('../../config/logger')(_0x490e('0x6'));var config=require(_0x490e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x490e('0x8')][_0x490e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x32cca8,_0x260df8,_0x33c519){return new BPromise(function(_0x72e439,_0x49cc05){return client[_0x490e('0xa')](_0x32cca8,_0x33c519)[_0x490e('0xb')](function(_0xc5005d){logger[_0x490e('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x260df8,'request\x20sent');logger[_0x490e('0xd')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x260df8,_0x490e('0xe'),JSON[_0x490e('0xf')](_0xc5005d));if(_0xc5005d[_0x490e('0x10')]){if(_0xc5005d['error'][_0x490e('0x11')]===0x1f4){logger[_0x490e('0x10')](_0x490e('0x12'),_0x260df8,_0xc5005d[_0x490e('0x10')]['message']);return _0x49cc05(_0xc5005d[_0x490e('0x10')][_0x490e('0x13')]);}logger[_0x490e('0x10')](_0x490e('0x12'),_0x260df8,_0xc5005d[_0x490e('0x10')][_0x490e('0x13')]);return _0x72e439(_0xc5005d[_0x490e('0x10')][_0x490e('0x13')]);}else{logger[_0x490e('0xc')](_0x490e('0x12'),_0x260df8,_0x490e('0xe'));_0x72e439(_0xc5005d['result'][_0x490e('0x13')]);}})[_0x490e('0x14')](function(_0xbf9768){logger[_0x490e('0x10')](_0x490e('0x12'),_0x260df8,_0xbf9768);_0x49cc05(_0xbf9768);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index a562c10..c4cb08a 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 _0xeade=['express','Router','../../components/auth/service','./analyticCustomReport.controller','get','index','/:id','isAuthenticated','show','preview','/:id/run','/:id/query','query','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeade,0x189));var _0xeead=function(_0xeeebaa,_0x23ecb3){_0xeeebaa=_0xeeebaa-0x0;var _0x3a9fc4=_0xeade[_0xeeebaa];return _0x3a9fc4;};'use strict';var multer=require(_0xeead('0x0'));var util=require(_0xeead('0x1'));var path=require(_0xeead('0x2'));var timeout=require('connect-timeout');var express=require(_0xeead('0x3'));var router=express[_0xeead('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xeead('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeead('0x6'));router[_0xeead('0x7')]('/',auth['isAuthenticated'](),controller[_0xeead('0x8')]);router[_0xeead('0x7')](_0xeead('0x9'),auth[_0xeead('0xa')](),controller[_0xeead('0xb')]);router[_0xeead('0x7')]('/:id/preview',auth[_0xeead('0xa')](),controller[_0xeead('0xc')]);router[_0xeead('0x7')](_0xeead('0xd'),auth[_0xeead('0xa')](),controller['run']);router[_0xeead('0x7')](_0xeead('0xe'),auth['isAuthenticated'](),controller[_0xeead('0xf')]);router[_0xeead('0x10')]('/',auth[_0xeead('0xa')](),controller[_0xeead('0x11')]);router['put'](_0xeead('0x9'),auth[_0xeead('0xa')](),controller[_0xeead('0x12')]);router[_0xeead('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xeead('0x14')]);module[_0xeead('0x15')]=router; \ No newline at end of file +var _0xb576=['get','/:id/preview','preview','run','/:id/query','query','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x4a1f56,_0x353c92){var _0x4a6469=function(_0xb43795){while(--_0xb43795){_0x4a1f56['push'](_0x4a1f56['shift']());}};_0x4a6469(++_0x353c92);}(_0xb576,0x80));var _0x6b57=function(_0x2eca5f,_0x2cfd37){_0x2eca5f=_0x2eca5f-0x0;var _0x3e707d=_0xb576[_0x2eca5f];return _0x3e707d;};'use strict';var multer=require(_0x6b57('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6b57('0x1'));var express=require(_0x6b57('0x2'));var router=express['Router']();var fs_extra=require(_0x6b57('0x3'));var auth=require(_0x6b57('0x4'));var interaction=require(_0x6b57('0x5'));var config=require(_0x6b57('0x6'));var controller=require(_0x6b57('0x7'));router['get']('/',auth[_0x6b57('0x8')](),controller[_0x6b57('0x9')]);router[_0x6b57('0xa')]('/:id',auth[_0x6b57('0x8')](),controller['show']);router[_0x6b57('0xa')](_0x6b57('0xb'),auth['isAuthenticated'](),controller[_0x6b57('0xc')]);router['get']('/:id/run',auth[_0x6b57('0x8')](),controller[_0x6b57('0xd')]);router['get'](_0x6b57('0xe'),auth[_0x6b57('0x8')](),controller[_0x6b57('0xf')]);router[_0x6b57('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b57('0x11')](_0x6b57('0x12'),auth['isAuthenticated'](),controller[_0x6b57('0x13')]);router[_0x6b57('0x14')](_0x6b57('0x12'),auth[_0x6b57('0x8')](),controller[_0x6b57('0x15')]);module[_0x6b57('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 1f13917..0dd8666 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 _0x038b=['exports','STRING','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x038b,0x114));var _0xb038=function(_0xf10cc,_0x31829b){_0xf10cc=_0xf10cc-0x0;var _0x220794=_0x038b[_0xf10cc];return _0x220794;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xb038('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xb038('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb038('0x2')]}}; \ No newline at end of file +var _0x6f47=['TEXT','exports','STRING'];(function(_0x36bbc0,_0x5da1ab){var _0x4b8598=function(_0x503a7c){while(--_0x503a7c){_0x36bbc0['push'](_0x36bbc0['shift']());}};_0x4b8598(++_0x5da1ab);}(_0x6f47,0xc7));var _0x76f4=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x6f47[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 29be88d..fab5c6d 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x2567f0,_0x4fa60){var _0x14852a=function(_0x55b95f){while(--_0x55b95f){_0x2567f0['push'](_0x2567f0['shift']());}};_0x14852a(++_0x4fa60);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc4aa[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file +var _0x687b=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','options','findAll','catch','params','intersection','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','merge','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ValidationErrorItem','DESC','parentKey','web','fullPath','%s-%s.%s','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','cross_join','%s.%s\x20=\x20%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x687b,0x14a));var _0xb687=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x687b[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];var dbH=require(_0xb687('0x1b'))['dbH'];function respondWithStatusCode(_0x4c97ed,_0x3e85b3){_0x3e85b3=_0x3e85b3||0xcc;return function(_0x155ebe){if(_0x155ebe){return _0x4c97ed['sendStatus'](_0x3e85b3);}return _0x4c97ed[_0xb687('0x1c')](_0x3e85b3)[_0xb687('0x1d')]();};}function respondWithResult(_0x1f1f35,_0x30d502){_0x30d502=_0x30d502||0xc8;return function(_0x838dd4){if(_0x838dd4){return _0x1f1f35[_0xb687('0x1c')](_0x30d502)[_0xb687('0x1e')](_0x838dd4);}};}function respondWithFilteredResult(_0x141375,_0x263085){return function(_0x2c7a18){if(_0x2c7a18){var _0x25124a=typeof _0x263085[_0xb687('0x1f')]==='undefined'&&typeof _0x263085[_0xb687('0x20')]===_0xb687('0x21');var _0x30d370=_0x2c7a18['count'];var _0x48958d=_0x25124a?0x0:_0x263085[_0xb687('0x1f')];var _0x3a10ef=_0x25124a?_0x2c7a18[_0xb687('0x22')]:_0x263085['offset']+_0x263085[_0xb687('0x20')];var _0x481f1d;if(_0x3a10ef>=_0x30d370){_0x3a10ef=_0x30d370;_0x481f1d=0xc8;}else{_0x481f1d=0xce;}_0x141375[_0xb687('0x1c')](_0x481f1d);return _0x141375[_0xb687('0x23')](_0xb687('0x24'),_0x48958d+'-'+_0x3a10ef+'/'+_0x30d370)[_0xb687('0x1e')](_0x2c7a18);}return null;};}function patchUpdates(_0x49d5a1){return function(_0x3a73d5){try{jsonpatch['apply'](_0x3a73d5,_0x49d5a1,!![]);}catch(_0x335541){return BPromise[_0xb687('0x25')](_0x335541);}return _0x3a73d5[_0xb687('0x26')]();};}function saveUpdates(_0x546fde,_0x1dc06b){return function(_0x491623){if(_0x491623){return _0x491623[_0xb687('0x27')](_0x546fde)[_0xb687('0x28')](function(_0xbf6c58){return _0xbf6c58;});}return null;};}function removeEntity(_0x38866c,_0xf48ba4){return function(_0x2f0a0a){if(_0x2f0a0a){return _0x2f0a0a['destroy']()[_0xb687('0x28')](function(){var _0x129347=_0x2f0a0a[_0xb687('0x29')]({'plain':!![]});var _0x1a0261=_0xb687('0x2a');return db[_0xb687('0x2b')][_0xb687('0x2c')]({'where':{'type':_0x1a0261,'resourceId':_0x129347['id']}})[_0xb687('0x28')](function(){return _0x2f0a0a;});})[_0xb687('0x28')](function(){_0x38866c[_0xb687('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3712cf,_0x192966){return function(_0x392721){if(!_0x392721){_0x3712cf[_0xb687('0x2d')](0x194);}return _0x392721;};}function handleError(_0x2e5c8d,_0x173c58){_0x173c58=_0x173c58||0x1f4;return function(_0x4e9a06){logger[_0xb687('0x2e')](_0x4e9a06['stack']);if(_0x4e9a06[_0xb687('0x2f')]){delete _0x4e9a06[_0xb687('0x2f')];}_0x2e5c8d[_0xb687('0x1c')](_0x173c58)[_0xb687('0x30')](_0x4e9a06);};}exports[_0xb687('0x31')]=function(_0x43d20d,_0xf1f0dd){var _0x556815={},_0x3da2be={},_0xe3428f={'count':0x0,'rows':[]};var _0x3c08ab=_[_0xb687('0x32')](db[_0xb687('0x33')][_0xb687('0x34')],function(_0x44be88){return{'name':_0x44be88[_0xb687('0x35')],'type':_0x44be88[_0xb687('0x36')][_0xb687('0x37')]};});_0x3da2be[_0xb687('0x38')]=_['map'](_0x3c08ab,'name');_0x3da2be[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x43d20d[_0xb687('0x39')]);_0x3da2be[_0xb687('0x3b')]=_['intersection'](_0x3da2be['model'],_0x3da2be[_0xb687('0x39')]);_0x556815[_0xb687('0x3c')]=_['intersection'](_0x3da2be[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x43d20d['query'][_0xb687('0x3d')]));_0x556815['attributes']=_0x556815[_0xb687('0x3c')][_0xb687('0x3e')]?_0x556815[_0xb687('0x3c')]:_0x3da2be[_0xb687('0x38')];if(!_0x43d20d[_0xb687('0x39')][_0xb687('0x3f')]('nolimit')){_0x556815[_0xb687('0x20')]=qs[_0xb687('0x20')](_0x43d20d[_0xb687('0x39')][_0xb687('0x20')]);_0x556815['offset']=qs[_0xb687('0x1f')](_0x43d20d[_0xb687('0x39')][_0xb687('0x1f')]);}_0x556815[_0xb687('0x40')]=qs[_0xb687('0x41')](_0x43d20d['query'][_0xb687('0x41')]);_0x556815[_0xb687('0x42')]=qs[_0xb687('0x3b')](_[_0xb687('0x43')](_0x43d20d[_0xb687('0x39')],_0x3da2be[_0xb687('0x3b')]),_0x3c08ab);if(_0x43d20d['query']['filter']){_0x556815[_0xb687('0x42')]=_['merge'](_0x556815[_0xb687('0x42')],{'$or':_[_0xb687('0x32')](_0x3c08ab,function(_0x48d3b1){if(_0x48d3b1[_0xb687('0x36')]!==_0xb687('0x44')){var _0x57776b={};_0x57776b[_0x48d3b1[_0xb687('0x2f')]]={'$like':'%'+_0x43d20d[_0xb687('0x39')][_0xb687('0x45')]+'%'};return _0x57776b;}})});}_0x556815=_['merge']({},_0x556815,_0x43d20d[_0xb687('0x46')]);var _0x9cffb2={'where':_0x556815[_0xb687('0x42')]};return db[_0xb687('0x33')][_0xb687('0x22')](_0x9cffb2)[_0xb687('0x28')](function(_0x21b9ef){_0xe3428f['count']=_0x21b9ef;if(_0x43d20d[_0xb687('0x39')]['includeAll']){_0x556815['include']=[{'all':!![]}];}return db[_0xb687('0x33')][_0xb687('0x47')](_0x556815);})['then'](function(_0x19a21c){_0xe3428f['rows']=_0x19a21c;return _0xe3428f;})[_0xb687('0x28')](respondWithFilteredResult(_0xf1f0dd,_0x556815))[_0xb687('0x48')](handleError(_0xf1f0dd,null));};exports['show']=function(_0x4cb7a0,_0x3a8509){var _0x5d9cb0={'raw':!![],'where':{'id':_0x4cb7a0[_0xb687('0x49')]['id']}},_0x247c67={};_0x247c67[_0xb687('0x38')]=_[_0xb687('0x3a')](db[_0xb687('0x33')][_0xb687('0x34')]);_0x247c67[_0xb687('0x39')]=_[_0xb687('0x3a')](_0x4cb7a0[_0xb687('0x39')]);_0x247c67[_0xb687('0x3b')]=_[_0xb687('0x4a')](_0x247c67[_0xb687('0x38')],_0x247c67['query']);_0x5d9cb0[_0xb687('0x3c')]=_['intersection'](_0x247c67[_0xb687('0x38')],qs[_0xb687('0x3d')](_0x4cb7a0[_0xb687('0x39')][_0xb687('0x3d')]));_0x5d9cb0[_0xb687('0x3c')]=_0x5d9cb0[_0xb687('0x3c')]['length']?_0x5d9cb0['attributes']:_0x247c67[_0xb687('0x38')];if(_0x4cb7a0[_0xb687('0x39')][_0xb687('0x4b')]){_0x5d9cb0[_0xb687('0x4c')]=[{'all':!![]}];}_0x5d9cb0=_['merge']({},_0x5d9cb0,_0x4cb7a0[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5d9cb0)[_0xb687('0x28')](handleEntityNotFound(_0x3a8509,null))['then'](respondWithResult(_0x3a8509,null))[_0xb687('0x48')](handleError(_0x3a8509,null));};exports[_0xb687('0x4e')]=function(_0x162b19,_0x401b99){return db['AnalyticDefaultReport']['create'](_0x162b19[_0xb687('0x4f')],{})[_0xb687('0x28')](function(_0x42b61a){var _0x508862=_0x162b19['user'][_0xb687('0x29')]({'plain':!![]});if(!_0x508862)throw new Error(_0xb687('0x50'));if(_0x508862[_0xb687('0x51')]===_0xb687('0x52')){var _0x34205d=_0x42b61a[_0xb687('0x29')]({'plain':!![]});var _0x602864=_0xb687('0x53');return db['UserProfileSection'][_0xb687('0x4d')]({'where':{'name':_0x602864,'userProfileId':_0x508862[_0xb687('0x54')]},'raw':!![]})[_0xb687('0x28')](function(_0x4f5784){if(_0x4f5784&&_0x4f5784['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x34205d[_0xb687('0x2f')],'resourceId':_0x34205d['id'],'type':_0xb687('0x2a'),'sectionId':_0x4f5784['id']},{})[_0xb687('0x28')](function(){return _0x42b61a;});}else{return _0x42b61a;}})[_0xb687('0x48')](function(_0x1ddfd4){logger[_0xb687('0x2e')](_0xb687('0x55'),_0x1ddfd4);throw _0x1ddfd4;});}return _0x42b61a;})[_0xb687('0x28')](respondWithResult(_0x401b99,0xc9))[_0xb687('0x48')](handleError(_0x401b99,null));};exports[_0xb687('0x27')]=function(_0x128264,_0x166900){if(_0x128264[_0xb687('0x4f')]['id']){delete _0x128264[_0xb687('0x4f')]['id'];}return db[_0xb687('0x33')][_0xb687('0x4d')]({'where':{'id':_0x128264[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0x166900,null))['then'](saveUpdates(_0x128264[_0xb687('0x4f')],null))[_0xb687('0x28')](respondWithResult(_0x166900,null))[_0xb687('0x48')](handleError(_0x166900,null));};exports[_0xb687('0x2c')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x33')]['find']({'where':{'id':_0x4e5642[_0xb687('0x49')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x28')](removeEntity(_0xfa8790,null))[_0xb687('0x48')](handleError(_0xfa8790,null));};exports['preview']=function(_0x4fb188,_0x13ad6a){var _0x4ab9c5=0xa;var _0x5ea8fd=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x25e140={'SUM':'SUM(%s)','COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0x58ec8b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0xbc3a94=function(_0x4bc18f){return!_[_0xb687('0x61')]([_0xb687('0x62'),_0xb687('0x63'),_0xb687('0x64'),_0xb687('0x65')],_0x4bc18f);};var _0x17505c=function(_0x132e3a){if(!_0x132e3a||!_0x132e3a['rules']['length']){return'';}for(var _0x2714c6='(',_0x4906df=0x0;_0x4906df<_0x132e3a[_0xb687('0x66')][_0xb687('0x3e')];_0x4906df+=0x1){_0x4906df>0x0&&(_0x2714c6+='\x20'+_0x132e3a[_0xb687('0x67')]+'\x20');_0x2714c6+=_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x68')]?_0x17505c(_0x132e3a['rules'][_0x4906df][_0xb687('0x68')]):_0x132e3a['rules'][_0x4906df][_0xb687('0x69')]+'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')]+(_0xbc3a94(_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6a')])?'\x20'+_0x132e3a[_0xb687('0x66')][_0x4906df][_0xb687('0x6b')]:'');}return _0x2714c6+')';};var _0x5deb7a={'where':{'id':_0x4fb188['params']['id']}},_0x28a6aa,_0x31ed20,_0x8942b7,_0x36bb4b,_0x258caf;_0x5deb7a=_[_0xb687('0x6c')]({},_0x5deb7a,_0x4fb188[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x5deb7a)[_0xb687('0x28')](function(_0x15ef44){if(_0x15ef44){_0x28a6aa=_0x15ef44;return _0x15ef44[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x177ea4){if(_0x177ea4){if(!_0x177ea4[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x31ed20=_0x177ea4;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x505f7a){if(_0x505f7a){_0x8942b7=_[_0xb687('0x71')](_0x505f7a,'id');var _0x1a6075;var _0x53b00a=squel[_0xb687('0x72')]();_0x53b00a[_0xb687('0x73')](_0x28a6aa[_0xb687('0x74')]);for(var _0x5eeb75=0x0;_0x5eeb75<_0x31ed20[_0xb687('0x3e')];_0x5eeb75+=0x1){_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x75')]?_0x8942b7[_0x31ed20[_0x5eeb75]['MetricId']][_0xb687('0x76')]:_0x31ed20[_0x5eeb75][_0xb687('0x69')];_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x77')]?_[_0xb687('0x78')](_0x25e140[_0x31ed20[_0x5eeb75]['function']],'%s',_0x1a6075):_0x1a6075;_0x1a6075=_0x31ed20[_0x5eeb75][_0xb687('0x79')]?_[_0xb687('0x78')](_0x58ec8b[_0x31ed20[_0x5eeb75]['format']],'%s',_0x1a6075):_0x1a6075;if(_0x31ed20[_0x5eeb75][_0xb687('0x7a')]){_0x53b00a[_0xb687('0x68')](_0x1a6075);}_0x31ed20[_0x5eeb75]['orderBy']&&_0x53b00a['order'](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7b')]==='DESC'?![]:!![]);_0x53b00a[_0xb687('0x69')](_0x1a6075,_0x31ed20[_0x5eeb75][_0xb687('0x7c')]||_0x1a6075);}if(_0x28a6aa[_0xb687('0x7d')]){_0x28a6aa[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x7d')]);for(var _0x229bc4=0x0;_0x229bc4<_0x28a6aa[_0xb687('0x7d')]['length'];_0x229bc4+=0x1){if(_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x5ea8fd,_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')])&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey']&&_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x7f')]&&_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]){_0x53b00a[_0x28a6aa[_0xb687('0x7d')][_0x229bc4][_0xb687('0x36')]](_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['foreignTable'],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x28a6aa['table'],_0x28a6aa[_0xb687('0x7d')][_0x229bc4]['parentKey'],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x7f')],_0x28a6aa['joins'][_0x229bc4][_0xb687('0x80')]));}}}if(_0x28a6aa[_0xb687('0x81')]){_0x28a6aa['conditions']=JSON[_0xb687('0x7e')](_0x28a6aa[_0xb687('0x81')]);_0x53b00a['where'](_0x17505c(_0x28a6aa[_0xb687('0x81')][_0xb687('0x68')]));}_0x258caf=_0x53b00a[_0xb687('0x82')]();_0x53b00a[_0xb687('0x20')](_0x4ab9c5);_0x53b00a[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x53b00a[_0xb687('0x85')]());return dbH[_0xb687('0x86')][_0xb687('0x39')](_0x53b00a[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')]['SELECT']});}})['then'](respondWithResult(_0x13ad6a,null))[_0xb687('0x48')](handleError(_0x13ad6a,null));};function runReport(_0x29e830,_0x22ebca,_0xfecb8d){var _0x3a7339=_0x22ebca['name'];var _0x59c94b=0xa;var _0x29e27e=[_0xb687('0x56'),_0xb687('0x57'),_0xb687('0x58'),'cross_join'];var _0x448d59={'SUM':_0xb687('0x88'),'COUNT':_0xb687('0x59'),'COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':_0xb687('0x5c'),'AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':_0xb687('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x25f5c3={'SEC_TO_TIME':_0xb687('0x8b'),'DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1037b1=function(_0x3bf480){return!_['includes']([_0xb687('0x62'),'IS\x20NOT\x20NULL',_0xb687('0x64'),_0xb687('0x65')],_0x3bf480);};var _0x5ec5f6=function(_0x1c683e){if(!_0x1c683e||!_0x1c683e[_0xb687('0x66')]['length']){return'';}for(var _0x231caa='(',_0x3479c5=0x0;_0x3479c5<_0x1c683e[_0xb687('0x66')][_0xb687('0x3e')];_0x3479c5+=0x1){_0x3479c5>0x0&&(_0x231caa+='\x20'+_0x1c683e[_0xb687('0x67')]+'\x20');_0x231caa+=_0x1c683e[_0xb687('0x66')][_0x3479c5]['group']?_0x5ec5f6(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x68')]):_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x69')]+'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')]+(_0x1037b1(_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6a')])?'\x20'+_0x1c683e[_0xb687('0x66')][_0x3479c5][_0xb687('0x6b')]:'');}return _0x231caa+')';};var _0x290ddf={'where':{'id':_0x29e830['id']}},_0x5ee585,_0x10fb0,_0x5be566,_0x3d98e2,_0x3aa1c8;_0x290ddf=_['merge']({},_0x290ddf,_0xfecb8d);return db['AnalyticDefaultReport'][_0xb687('0x4d')](_0x290ddf)[_0xb687('0x28')](function(_0x3b4acf){if(_0x3b4acf){_0x5ee585=_0x3b4acf;return _0x3b4acf[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1c3de0){if(_0x1c3de0){if(!_0x1c3de0[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))][(_0xb687('0x8e'))](_0xb687('0x6f'),0x193);}_0x10fb0=_0x1c3de0;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x1ea6fd){if(_0x1ea6fd){_0x5be566=_[_0xb687('0x71')](_0x1ea6fd,'id');var _0x3f45b7;var _0x508550=squel['select']();_0x508550[_0xb687('0x73')](_0x5ee585['table']);for(var _0x5f2557=0x0;_0x5f2557<_0x10fb0[_0xb687('0x3e')];_0x5f2557+=0x1){_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x75')]?_0x5be566[_0x10fb0[_0x5f2557]['MetricId']][_0xb687('0x76')]:_0x10fb0[_0x5f2557][_0xb687('0x69')];_0x3f45b7=_0x10fb0[_0x5f2557]['function']?_[_0xb687('0x78')](_0x448d59[_0x10fb0[_0x5f2557][_0xb687('0x77')]],'%s',_0x3f45b7):_0x3f45b7;_0x3f45b7=_0x10fb0[_0x5f2557][_0xb687('0x79')]?_[_0xb687('0x78')](_0x25f5c3[_0x10fb0[_0x5f2557][_0xb687('0x79')]],'%s',_0x3f45b7):_0x3f45b7;if(_0x10fb0[_0x5f2557][_0xb687('0x7a')]){_0x508550[_0xb687('0x68')](_0x3f45b7);}_0x10fb0[_0x5f2557][_0xb687('0x7b')]&&_0x508550[_0xb687('0x40')](_0x3f45b7,_0x10fb0[_0x5f2557]['orderBy']===_0xb687('0x8f')?![]:!![]);_0x508550[_0xb687('0x69')](_0x3f45b7,_0x10fb0[_0x5f2557]['alias']||_0x3f45b7);}if(_0x5ee585[_0xb687('0x7d')]){_0x5ee585['joins']=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x7d')]);for(var _0x59166c=0x0;_0x59166c<_0x5ee585[_0xb687('0x7d')][_0xb687('0x3e')];_0x59166c+=0x1){if(_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]&&_[_0xb687('0x61')](_0x29e27e,_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')])&&_0x5ee585['joins'][_0x59166c]['parentKey']&&_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignTable']&&_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x80')]){_0x508550[_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x36')]](_0x5ee585['joins'][_0x59166c][_0xb687('0x7f')],null,util[_0xb687('0x79')]('%s.%s\x20=\x20%s.%s',_0x5ee585[_0xb687('0x74')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x90')],_0x5ee585[_0xb687('0x7d')][_0x59166c][_0xb687('0x7f')],_0x5ee585[_0xb687('0x7d')][_0x59166c]['foreignKey']));}}}if(_0x5ee585[_0xb687('0x81')]){_0x5ee585[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x5ee585[_0xb687('0x81')]);_0x508550[_0xb687('0x42')](_0x5ec5f6(_0x5ee585[_0xb687('0x81')][_0xb687('0x68')]));}_0x3aa1c8=_0x508550[_0xb687('0x82')]();_0x508550[_0xb687('0x20')](_0x59c94b);_0x508550[_0xb687('0x1f')](0x0);return;}})['then'](function(){if(_0x22ebca['output']===_0xb687('0x91')){return null;}var _0x1a7cd8=_[_0xb687('0x6c')](_0x22ebca,{'name':_0x22ebca[_0xb687('0x92')]||_0x22ebca[_0xb687('0x2f')]||_0x5ee585[_0xb687('0x2f')],'basename':_0x3a7339,'savename':util[_0xb687('0x79')](_0xb687('0x93'),_0x22ebca[_0xb687('0x2f')]||_0x5ee585['name'],require('randomstring')['generate'](0x4),_0x22ebca[_0xb687('0x94')]||_0xb687('0x95')),'reportId':_0x5ee585['id'],'reportType':_0xb687('0x96')});return db[_0xb687('0x97')][_0xb687('0x4e')](_0x1a7cd8,{'raw':!![]});})[_0xb687('0x28')](function(_0x473130){if(_0x5ee585[_0xb687('0x74')]==='cdr'){_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x98'),_0x22ebca[_0xb687('0x99')],_0x22ebca[_0xb687('0x9a')]);}else{_0x3aa1c8[_0xb687('0x42')](_0x5ee585[_0xb687('0x74')]+_0xb687('0x9b'),_0x22ebca['startDate'],_0x22ebca[_0xb687('0x9a')]);}if(_0x473130){logger['info'](_0xb687('0x9c'),_0x3aa1c8[_0xb687('0x85')]());require('child_process')[_0xb687('0x9d')](path[_0xb687('0x56')](__dirname,_0xb687('0x9e'),_0x473130['output']),[_0x473130['id'],_0x3aa1c8[_0xb687('0x85')](),path[_0xb687('0x56')](__dirname,_0xb687('0x9f'),_0x473130[_0xb687('0xa0')]),_0x3a7339]);return _0x473130;}else{var _0x3d4596=squel[_0xb687('0x72')]();_0x3d4596[_0xb687('0x73')]('('+_0x3aa1c8['toString']()+')',_0xb687('0xa1'));_0x3d4596[_0xb687('0x69')](_0xb687('0xa2'),_0xb687('0x22'));_0x3aa1c8[_0xb687('0x20')](_0x22ebca['limit']||_0x59c94b);_0x3aa1c8[_0xb687('0x1f')](_0x22ebca[_0xb687('0x1f')]||0x0);return dbH[_0xb687('0x86')]['query'](_0x3d4596[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]})['then'](function(_0x3dbbd6){if(!_0x3dbbd6[_0xb687('0x3e')]){_0x3d98e2=0x0;}else{_0x3d98e2=_0x3dbbd6[0x0][_0xb687('0x22')]||0x0;}return dbH['sequelize'][_0xb687('0x39')](_0x3aa1c8[_0xb687('0x85')](),{'type':dbH[_0xb687('0x86')][_0xb687('0x87')][_0xb687('0xa3')]});})[_0xb687('0x28')](function(_0x15e599){return{'rows':_0x15e599||[],'count':_0x3d98e2};});}});}exports[_0xb687('0xa4')]=function(_0x8f6ba0,_0x568aca){return runReport(_0x8f6ba0[_0xb687('0x49')],_0x8f6ba0[_0xb687('0x39')],_0x8f6ba0[_0xb687('0x46')])['then'](respondWithResult(_0x568aca,null))['catch'](handleError(_0x568aca,null));};exports[_0xb687('0xa5')]=runReport;exports['query']=function(_0x187810,_0x1d21ef){var _0x386d12=0xa;var _0x4dd8f4=['join',_0xb687('0x57'),_0xb687('0x58'),_0xb687('0xa6')];var _0x295795={'SUM':_0xb687('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xb687('0x5a'),'MAX':_0xb687('0x5b'),'MIN':'MIN(%s)','AVG':_0xb687('0x5d'),'GROUP_CONCAT':_0xb687('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb687('0x5e')};var _0xe7056c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xb687('0x8c'),'HOUR':_0xb687('0x8d'),'ROUND':_0xb687('0x5f'),'UNIX_TIMESTAMP':_0xb687('0x60')};var _0x1b1cf5=function(_0x46283c){return!_[_0xb687('0x61')](['IS\x20NULL',_0xb687('0x63'),'IS\x20EMPTY',_0xb687('0x65')],_0x46283c);};var _0x394ed6=function(_0x875169){if(!_0x875169||!_0x875169[_0xb687('0x66')]['length']){return'';}for(var _0x1ec485='(',_0x55a919=0x0;_0x55a919<_0x875169['rules'][_0xb687('0x3e')];_0x55a919+=0x1){_0x55a919>0x0&&(_0x1ec485+='\x20'+_0x875169[_0xb687('0x67')]+'\x20');_0x1ec485+=_0x875169[_0xb687('0x66')][_0x55a919]['group']?_0x394ed6(_0x875169[_0xb687('0x66')][_0x55a919][_0xb687('0x68')]):_0x875169['rules'][_0x55a919][_0xb687('0x69')]+'\x20'+_0x875169['rules'][_0x55a919][_0xb687('0x6a')]+(_0x1b1cf5(_0x875169[_0xb687('0x66')][_0x55a919]['condition'])?'\x20'+_0x875169[_0xb687('0x66')][_0x55a919]['value']:'');}return _0x1ec485+')';};var _0x2aecd5={'where':{'id':_0x187810[_0xb687('0x49')]['id']}},_0x58955e,_0x488a2a,_0x303738,_0x3904a3,_0x581338;_0x2aecd5=_['merge']({},_0x2aecd5,_0x187810[_0xb687('0x46')]);return db[_0xb687('0x33')][_0xb687('0x4d')](_0x2aecd5)['then'](function(_0xc29834){if(_0xc29834){_0x58955e=_0xc29834;return _0xc29834[_0xb687('0x6d')]();}return null;})[_0xb687('0x28')](function(_0x1f2f2b){if(_0x1f2f2b){if(!_0x1f2f2b[_0xb687('0x3e')]){throw new db[(_0xb687('0x6e'))]['ValidationErrorItem'](_0xb687('0x6f'),0x193);}_0x488a2a=_0x1f2f2b;return db[_0xb687('0x70')][_0xb687('0x47')]({'raw':!![]});}return null;})[_0xb687('0x28')](function(_0x3591e2){if(_0x3591e2){_0x303738=_['keyBy'](_0x3591e2,'id');var _0x4d0c14;var _0x200b55=squel[_0xb687('0x72')]();_0x200b55[_0xb687('0x73')](_0x58955e[_0xb687('0x74')]);for(var _0x33f4de=0x0;_0x33f4de<_0x488a2a[_0xb687('0x3e')];_0x33f4de+=0x1){_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x75')]?_0x303738[_0x488a2a[_0x33f4de]['MetricId']][_0xb687('0x76')]:_0x488a2a[_0x33f4de][_0xb687('0x69')];_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x77')]?_['replace'](_0x295795[_0x488a2a[_0x33f4de][_0xb687('0x77')]],'%s',_0x4d0c14):_0x4d0c14;_0x4d0c14=_0x488a2a[_0x33f4de][_0xb687('0x79')]?_[_0xb687('0x78')](_0xe7056c[_0x488a2a[_0x33f4de]['format']],'%s',_0x4d0c14):_0x4d0c14;if(_0x488a2a[_0x33f4de][_0xb687('0x7a')]){_0x200b55[_0xb687('0x68')](_0x4d0c14);}_0x488a2a[_0x33f4de]['orderBy']&&_0x200b55[_0xb687('0x40')](_0x4d0c14,_0x488a2a[_0x33f4de][_0xb687('0x7b')]===_0xb687('0x8f')?![]:!![]);_0x200b55[_0xb687('0x69')](_0x4d0c14,_0x488a2a[_0x33f4de]['alias']||_0x4d0c14);}if(_0x58955e[_0xb687('0x7d')]){_0x58955e[_0xb687('0x7d')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x7d')]);for(var _0xcff220=0x0;_0xcff220<_0x58955e['joins'][_0xb687('0x3e')];_0xcff220+=0x1){if(_0x58955e[_0xb687('0x7d')][_0xcff220]['type']&&_[_0xb687('0x61')](_0x4dd8f4,_0x58955e[_0xb687('0x7d')][_0xcff220]['type'])&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')]&&_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable']&&_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x80')]){_0x200b55[_0x58955e['joins'][_0xcff220]['type']](_0x58955e['joins'][_0xcff220][_0xb687('0x7f')],null,util['format'](_0xb687('0xa7'),_0x58955e[_0xb687('0x74')],_0x58955e[_0xb687('0x7d')][_0xcff220][_0xb687('0x90')],_0x58955e[_0xb687('0x7d')][_0xcff220]['foreignTable'],_0x58955e['joins'][_0xcff220][_0xb687('0x80')]));}}}if(_0x58955e[_0xb687('0x81')]){_0x58955e[_0xb687('0x81')]=JSON[_0xb687('0x7e')](_0x58955e[_0xb687('0x81')]);_0x200b55[_0xb687('0x42')](_0x394ed6(_0x58955e[_0xb687('0x81')]['group']));}_0x581338=_0x200b55['clone']();_0x200b55['limit'](_0x386d12);_0x200b55[_0xb687('0x1f')](0x0);logger[_0xb687('0x83')](_0xb687('0x84'),_0x200b55['toString']());return dbH['sequelize']['query'](_0x200b55[_0xb687('0x85')](),{'type':dbH['sequelize'][_0xb687('0x87')][_0xb687('0xa3')]});}})[_0xb687('0x28')](function(){return{'sql':_0x581338[_0xb687('0x85')]()};})[_0xb687('0x28')](respondWithResult(_0x1d21ef,null))[_0xb687('0x48')](handleError(_0x1d21ef,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5b74574..c9eaafc 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 _0x7e8e=['AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','define'];(function(_0x233f69,_0x2c3ba8){var _0x59c4e2=function(_0x204a30){while(--_0x204a30){_0x233f69['push'](_0x233f69['shift']());}};_0x59c4e2(++_0x2c3ba8);}(_0x7e8e,0x161));var _0xe7e8=function(_0x8a7bcb,_0x2cf7d1){_0x8a7bcb=_0x8a7bcb-0x0;var _0x23ccc0=_0x7e8e[_0x8a7bcb];return _0x23ccc0;};'use strict';var _=require(_0xe7e8('0x0'));var util=require(_0xe7e8('0x1'));var logger=require(_0xe7e8('0x2'))(_0xe7e8('0x3'));var moment=require(_0xe7e8('0x4'));var BPromise=require(_0xe7e8('0x5'));var rp=require(_0xe7e8('0x6'));var fs=require('fs');var path=require(_0xe7e8('0x7'));var rimraf=require('rimraf');var config=require(_0xe7e8('0x8'));var attributes=require(_0xe7e8('0x9'));module['exports']=function(_0x511f76,_0x234078){return _0x511f76[_0xe7e8('0xa')](_0xe7e8('0xb'),attributes,{'tableName':_0xe7e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa549=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x33abfb,_0x2bc697){var _0x55e087=function(_0xd36ca0){while(--_0xd36ca0){_0x33abfb['push'](_0x33abfb['shift']());}};_0x55e087(++_0x2bc697);}(_0xa549,0x137));var _0x9a54=function(_0x374e9a,_0x3975d8){_0x374e9a=_0x374e9a-0x0;var _0x1cfc73=_0xa549[_0x374e9a];return _0x1cfc73;};'use strict';var _=require(_0x9a54('0x0'));var util=require('util');var logger=require(_0x9a54('0x1'))('api');var moment=require(_0x9a54('0x2'));var BPromise=require(_0x9a54('0x3'));var rp=require(_0x9a54('0x4'));var fs=require('fs');var path=require(_0x9a54('0x5'));var rimraf=require(_0x9a54('0x6'));var config=require(_0x9a54('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x9a54('0x8')]=function(_0x215b3f,_0x5dba36){return _0x215b3f[_0x9a54('0x9')](_0x9a54('0xa'),attributes,{'tableName':_0x9a54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 5c0986c..f046b18 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 _0x9ab7=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x9ab7,0x10f));var _0x79ab=function(_0x260efb,_0x15fdf4){_0x260efb=_0x260efb-0x0;var _0x5b310f=_0x9ab7[_0x260efb];return _0x5b310f;};'use strict';var _=require(_0x79ab('0x0'));var util=require(_0x79ab('0x1'));var moment=require(_0x79ab('0x2'));var BPromise=require(_0x79ab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79ab('0x4'));var db=require(_0x79ab('0x5'))['db'];var utils=require(_0x79ab('0x6'));var logger=require('../../config/logger')(_0x79ab('0x7'));var config=require(_0x79ab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x79ab('0x9')][_0x79ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3271c0,_0x1ed2bf,_0x408607){return new BPromise(function(_0x785038,_0x410644){return client[_0x79ab('0xb')](_0x3271c0,_0x408607)[_0x79ab('0xc')](function(_0x4024e5){logger[_0x79ab('0xd')](_0x79ab('0xe'),_0x1ed2bf,_0x79ab('0xf'));logger[_0x79ab('0x10')](_0x79ab('0x11'),_0x1ed2bf,'request\x20sent',JSON[_0x79ab('0x12')](_0x4024e5));if(_0x4024e5[_0x79ab('0x13')]){if(_0x4024e5[_0x79ab('0x13')]['code']===0x1f4){logger[_0x79ab('0x13')](_0x79ab('0xe'),_0x1ed2bf,_0x4024e5[_0x79ab('0x13')]['message']);return _0x410644(_0x4024e5[_0x79ab('0x13')][_0x79ab('0x14')]);}logger['error'](_0x79ab('0xe'),_0x1ed2bf,_0x4024e5[_0x79ab('0x13')][_0x79ab('0x14')]);return _0x785038(_0x4024e5[_0x79ab('0x13')][_0x79ab('0x14')]);}else{logger[_0x79ab('0xd')](_0x79ab('0xe'),_0x1ed2bf,_0x79ab('0xf'));_0x785038(_0x4024e5[_0x79ab('0x15')][_0x79ab('0x14')]);}})[_0x79ab('0x16')](function(_0xbdada1){logger[_0x79ab('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ed2bf,_0xbdada1);_0x410644(_0xbdada1);});});} \ No newline at end of file +var _0xdb69=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0x40f22c,_0x56c40b){var _0x258e70=function(_0x2e1abb){while(--_0x2e1abb){_0x40f22c['push'](_0x40f22c['shift']());}};_0x258e70(++_0x56c40b);}(_0xdb69,0xd2));var _0x9db6=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdb69[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x9db6('0x0'));var util=require(_0x9db6('0x1'));var moment=require(_0x9db6('0x2'));var BPromise=require(_0x9db6('0x3'));var rs=require(_0x9db6('0x4'));var fs=require('fs');var Redis=require(_0x9db6('0x5'));var db=require(_0x9db6('0x6'))['db'];var utils=require(_0x9db6('0x7'));var logger=require(_0x9db6('0x8'))('rpc');var config=require(_0x9db6('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9db6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38229a,_0x2aab2b,_0x2b0358){return new BPromise(function(_0x2a47bb,_0x3c472b){return client[_0x9db6('0xb')](_0x38229a,_0x2b0358)[_0x9db6('0xc')](function(_0x57efbc){logger[_0x9db6('0xd')](_0x9db6('0xe'),_0x2aab2b,_0x9db6('0xf'));logger['debug'](_0x9db6('0x10'),_0x2aab2b,_0x9db6('0xf'),JSON['stringify'](_0x57efbc));if(_0x57efbc['error']){if(_0x57efbc['error'][_0x9db6('0x11')]===0x1f4){logger[_0x9db6('0x12')](_0x9db6('0xe'),_0x2aab2b,_0x57efbc[_0x9db6('0x12')]['message']);return _0x3c472b(_0x57efbc[_0x9db6('0x12')]['message']);}logger['error'](_0x9db6('0xe'),_0x2aab2b,_0x57efbc[_0x9db6('0x12')][_0x9db6('0x13')]);return _0x2a47bb(_0x57efbc[_0x9db6('0x12')]['message']);}else{logger[_0x9db6('0xd')](_0x9db6('0xe'),_0x2aab2b,_0x9db6('0xf'));_0x2a47bb(_0x57efbc['result'][_0x9db6('0x13')]);}})[_0x9db6('0x14')](function(_0x4bb408){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2aab2b,_0x4bb408);_0x3c472b(_0x4bb408);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3d89aa3..4871288 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 _0xcba3=['preview','run','/:id/query','post','delete','multer','util','path','express','Router','../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','show','/:id/preview','isAuthenticated'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xcba3,0x149));var _0x3cba=function(_0xa3776,_0x1e5bf2){_0xa3776=_0xa3776-0x0;var _0x5ef14f=_0xcba3[_0xa3776];return _0x5ef14f;};'use strict';var multer=require(_0x3cba('0x0'));var util=require(_0x3cba('0x1'));var path=require(_0x3cba('0x2'));var timeout=require('connect-timeout');var express=require(_0x3cba('0x3'));var router=express[_0x3cba('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3cba('0x5'));var config=require('../../config/environment');var controller=require(_0x3cba('0x6'));router[_0x3cba('0x7')]('/',auth['isAuthenticated'](),controller[_0x3cba('0x8')]);router[_0x3cba('0x7')](_0x3cba('0x9'),auth['isAuthenticated'](),controller[_0x3cba('0xa')]);router['get'](_0x3cba('0xb'),auth[_0x3cba('0xc')](),controller[_0x3cba('0xd')]);router[_0x3cba('0x7')]('/:id/run',auth[_0x3cba('0xc')](),controller[_0x3cba('0xe')]);router[_0x3cba('0x7')](_0x3cba('0xf'),auth['isAuthenticated'](),controller['query']);router[_0x3cba('0x10')]('/',auth[_0x3cba('0xc')](),controller['create']);router['put'](_0x3cba('0x9'),auth[_0x3cba('0xc')](),controller['update']);router[_0x3cba('0x11')](_0x3cba('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd3d2=['update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','put'];(function(_0x2d6038,_0x358944){var _0x2c18c5=function(_0x1919c2){while(--_0x1919c2){_0x2d6038['push'](_0x2d6038['shift']());}};_0x2c18c5(++_0x358944);}(_0xd3d2,0x96));var _0x2d3d=function(_0x233214,_0x1e348c){_0x233214=_0x233214-0x0;var _0x167992=_0xd3d2[_0x233214];return _0x167992;};'use strict';var multer=require(_0x2d3d('0x0'));var util=require(_0x2d3d('0x1'));var path=require(_0x2d3d('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d3d('0x3'));var router=express['Router']();var fs_extra=require(_0x2d3d('0x4'));var auth=require(_0x2d3d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x2d3d('0x6')](),controller[_0x2d3d('0x7')]);router[_0x2d3d('0x8')](_0x2d3d('0x9'),auth['isAuthenticated'](),controller[_0x2d3d('0xa')]);router[_0x2d3d('0x8')](_0x2d3d('0xb'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0xc')]);router[_0x2d3d('0x8')](_0x2d3d('0xd'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0xe')]);router[_0x2d3d('0x8')](_0x2d3d('0xf'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0x10')]);router['post']('/',auth[_0x2d3d('0x6')](),controller['create']);router[_0x2d3d('0x11')](_0x2d3d('0x9'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0x12')]);router['delete'](_0x2d3d('0x9'),auth['isAuthenticated'](),controller[_0x2d3d('0x13')]);module[_0x2d3d('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 2494efe..34a10c5 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 _0x5598=['sequelize','moment','exports','STRING','csv','xlsx','DATE','Loading','ENUM','manual','scheduled','UNSIGNED'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5598,0x1d4));var _0x8559=function(_0xbc550a,_0x2bb605){_0xbc550a=_0xbc550a-0x0;var _0xd16ba4=_0x5598[_0xbc550a];return _0xd16ba4;};'use strict';var Sequelize=require(_0x8559('0x0'));var moment=require(_0x8559('0x1'));module[_0x8559('0x2')]={'name':{'type':Sequelize[_0x8559('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8559('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x8559('0x4'),'pdf',_0x8559('0x5')),'allowNull':![],'defaultValue':_0x8559('0x4')},'savename':{'type':Sequelize[_0x8559('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8559('0x6')]},'endDate':{'type':Sequelize[_0x8559('0x6')]},'status':{'type':Sequelize[_0x8559('0x3')],'defaultValue':_0x8559('0x7')},'type':{'type':Sequelize[_0x8559('0x8')](_0x8559('0x9'),_0x8559('0xa')),'allowNull':![],'defaultValue':_0x8559('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8559('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x15bb=['STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual','INTEGER','UNSIGNED','exports'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x15bb,0xfc));var _0xb15b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x15bb[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xb15b('0x0')]={'name':{'type':Sequelize[_0xb15b('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xb15b('0x2')]('csv',_0xb15b('0x3'),_0xb15b('0x4')),'allowNull':![],'defaultValue':_0xb15b('0x5')},'savename':{'type':Sequelize[_0xb15b('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xb15b('0x6')]},'endDate':{'type':Sequelize[_0xb15b('0x6')]},'status':{'type':Sequelize[_0xb15b('0x1')],'defaultValue':_0xb15b('0x7')},'type':{'type':Sequelize['ENUM'](_0xb15b('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xb15b('0x9')](0xb)[_0xb15b('0xa')]},'reportType':{'type':Sequelize[_0xb15b('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index ccaea76..884e4ec 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 _0x68fe=['limit','count','set','apply','save','then','get','ExtractedReports','error','stack','send','map','AnalyticExtractedReport','rawAttributes','type','model','name','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','filter','include','rows','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','update','destroy','download','basename','savename','output','existsSync','join','root','server/files/reports','Report\x20not\x20found\x20or\x20empty','exists','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined'];(function(_0xc77bb8,_0x3ab40c){var _0x54bb14=function(_0xff2c3f){while(--_0xff2c3f){_0xc77bb8['push'](_0xc77bb8['shift']());}};_0x54bb14(++_0x3ab40c);}(_0x68fe,0x99));var _0xe68f=function(_0x26465f,_0x382bb8){_0x26465f=_0x26465f-0x0;var _0x45d340=_0x68fe[_0x26465f];return _0x45d340;};'use strict';var emlformat=require(_0xe68f('0x0'));var rimraf=require(_0xe68f('0x1'));var zipdir=require(_0xe68f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe68f('0x3'));var moment=require(_0xe68f('0x4'));var BPromise=require(_0xe68f('0x5'));var Mustache=require(_0xe68f('0x6'));var util=require(_0xe68f('0x7'));var path=require(_0xe68f('0x8'));var sox=require('sox');var csv=require(_0xe68f('0x9'));var ejs=require(_0xe68f('0xa'));var fs=require('fs');var fs_extra=require(_0xe68f('0xb'));var _=require(_0xe68f('0xc'));var squel=require(_0xe68f('0xd'));var crypto=require(_0xe68f('0xe'));var jsforce=require(_0xe68f('0xf'));var deskjs=require(_0xe68f('0x10'));var toCsv=require(_0xe68f('0x9'));var querystring=require(_0xe68f('0x11'));var Papa=require(_0xe68f('0x12'));var Redis=require(_0xe68f('0x13'));var authService=require(_0xe68f('0x14'));var qs=require(_0xe68f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe68f('0x16'))(_0xe68f('0x17'));var utils=require('../../config/utils');var config=require(_0xe68f('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c1726,_0x3a2c39){_0x3a2c39=_0x3a2c39||0xcc;return function(_0x56a2c3){if(_0x56a2c3){return _0x4c1726[_0xe68f('0x19')](_0x3a2c39);}return _0x4c1726[_0xe68f('0x1a')](_0x3a2c39)[_0xe68f('0x1b')]();};}function respondWithResult(_0x358842,_0x30becc){_0x30becc=_0x30becc||0xc8;return function(_0x5b04a4){if(_0x5b04a4){return _0x358842[_0xe68f('0x1a')](_0x30becc)[_0xe68f('0x1c')](_0x5b04a4);}};}function respondWithFilteredResult(_0x1955b8,_0x199399){return function(_0x2b55e0){if(_0x2b55e0){var _0x2363f1=typeof _0x199399[_0xe68f('0x1d')]===_0xe68f('0x1e')&&typeof _0x199399[_0xe68f('0x1f')]==='undefined';var _0x23e335=_0x2b55e0[_0xe68f('0x20')];var _0x452d54=_0x2363f1?0x0:_0x199399[_0xe68f('0x1d')];var _0x27e49b=_0x2363f1?_0x2b55e0[_0xe68f('0x20')]:_0x199399[_0xe68f('0x1d')]+_0x199399[_0xe68f('0x1f')];var _0x3a52e7;if(_0x27e49b>=_0x23e335){_0x27e49b=_0x23e335;_0x3a52e7=0xc8;}else{_0x3a52e7=0xce;}_0x1955b8['status'](_0x3a52e7);return _0x1955b8[_0xe68f('0x21')]('Content-Range',_0x452d54+'-'+_0x27e49b+'/'+_0x23e335)[_0xe68f('0x1c')](_0x2b55e0);}return null;};}function patchUpdates(_0x36897f){return function(_0x18ccb2){try{jsonpatch[_0xe68f('0x22')](_0x18ccb2,_0x36897f,!![]);}catch(_0x1fa1ca){return BPromise['reject'](_0x1fa1ca);}return _0x18ccb2[_0xe68f('0x23')]();};}function saveUpdates(_0x27ca02,_0x53f046){return function(_0x4b7b6f){if(_0x4b7b6f){return _0x4b7b6f['update'](_0x27ca02)[_0xe68f('0x24')](function(_0x45b47b){return _0x45b47b;});}return null;};}function removeEntity(_0xdfe4e8,_0xf1d334){return function(_0x2c317e){if(_0x2c317e){return _0x2c317e['destroy']()[_0xe68f('0x24')](function(){var _0x28f651=_0x2c317e[_0xe68f('0x25')]({'plain':!![]});var _0x4c8070=_0xe68f('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x4c8070,'resourceId':_0x28f651['id']}})[_0xe68f('0x24')](function(){return _0x2c317e;});})[_0xe68f('0x24')](function(){_0xdfe4e8[_0xe68f('0x1a')](0xcc)[_0xe68f('0x1b')]();});}};}function handleEntityNotFound(_0x293f1c,_0x1b110a){return function(_0x1b4e24){if(!_0x1b4e24){_0x293f1c['sendStatus'](0x194);}return _0x1b4e24;};}function handleError(_0xa2c559,_0x3b35db){_0x3b35db=_0x3b35db||0x1f4;return function(_0x292971){logger[_0xe68f('0x27')](_0x292971[_0xe68f('0x28')]);if(_0x292971['name']){delete _0x292971['name'];}_0xa2c559[_0xe68f('0x1a')](_0x3b35db)[_0xe68f('0x29')](_0x292971);};}exports['index']=function(_0x903541,_0xdbb109){var _0xd60c55={},_0x4a606a={},_0x328931={'count':0x0,'rows':[]};var _0x482876=_[_0xe68f('0x2a')](db[_0xe68f('0x2b')][_0xe68f('0x2c')],function(_0x3c5b15){return{'name':_0x3c5b15['fieldName'],'type':_0x3c5b15[_0xe68f('0x2d')]['key']};});_0x4a606a[_0xe68f('0x2e')]=_[_0xe68f('0x2a')](_0x482876,_0xe68f('0x2f'));_0x4a606a[_0xe68f('0x30')]=_['keys'](_0x903541['query']);_0x4a606a['filters']=_[_0xe68f('0x31')](_0x4a606a[_0xe68f('0x2e')],_0x4a606a[_0xe68f('0x30')]);_0xd60c55[_0xe68f('0x32')]=_[_0xe68f('0x31')](_0x4a606a[_0xe68f('0x2e')],qs[_0xe68f('0x33')](_0x903541['query'][_0xe68f('0x33')]));_0xd60c55[_0xe68f('0x32')]=_0xd60c55[_0xe68f('0x32')][_0xe68f('0x34')]?_0xd60c55[_0xe68f('0x32')]:_0x4a606a[_0xe68f('0x2e')];if(!_0x903541[_0xe68f('0x30')][_0xe68f('0x35')](_0xe68f('0x36'))){_0xd60c55[_0xe68f('0x1f')]=qs['limit'](_0x903541[_0xe68f('0x30')][_0xe68f('0x1f')]);_0xd60c55[_0xe68f('0x1d')]=qs[_0xe68f('0x1d')](_0x903541[_0xe68f('0x30')][_0xe68f('0x1d')]);}_0xd60c55[_0xe68f('0x37')]=qs[_0xe68f('0x38')](_0x903541[_0xe68f('0x30')][_0xe68f('0x38')]);_0xd60c55['where']=qs[_0xe68f('0x39')](_['pick'](_0x903541[_0xe68f('0x30')],_0x4a606a[_0xe68f('0x39')]),_0x482876);if(_0x903541[_0xe68f('0x30')]['filter']){_0xd60c55[_0xe68f('0x3a')]=_[_0xe68f('0x3b')](_0xd60c55[_0xe68f('0x3a')],{'$or':_[_0xe68f('0x2a')](_0x482876,function(_0x209eef){if(_0x209eef[_0xe68f('0x2d')]!==_0xe68f('0x3c')){var _0x57331f={};_0x57331f[_0x209eef['name']]={'$like':'%'+_0x903541[_0xe68f('0x30')][_0xe68f('0x3d')]+'%'};return _0x57331f;}})});}_0xd60c55=_[_0xe68f('0x3b')]({},_0xd60c55,_0x903541['options']);var _0x458a70={'where':_0xd60c55[_0xe68f('0x3a')]};return db[_0xe68f('0x2b')][_0xe68f('0x20')](_0x458a70)[_0xe68f('0x24')](function(_0x40bfe2){_0x328931[_0xe68f('0x20')]=_0x40bfe2;if(_0x903541[_0xe68f('0x30')]['includeAll']){_0xd60c55[_0xe68f('0x3e')]=[{'all':!![]}];}return db[_0xe68f('0x2b')]['findAll'](_0xd60c55);})[_0xe68f('0x24')](function(_0xb0d653){_0x328931[_0xe68f('0x3f')]=_0xb0d653;return _0x328931;})['then'](respondWithFilteredResult(_0xdbb109,_0xd60c55))[_0xe68f('0x40')](handleError(_0xdbb109,null));};exports[_0xe68f('0x41')]=function(_0x49f6da,_0x3d2c3b){var _0x33614a={'raw':!![],'where':{'id':_0x49f6da[_0xe68f('0x42')]['id']}},_0xf2eb13={};_0xf2eb13[_0xe68f('0x2e')]=_[_0xe68f('0x43')](db['AnalyticExtractedReport'][_0xe68f('0x2c')]);_0xf2eb13[_0xe68f('0x30')]=_[_0xe68f('0x43')](_0x49f6da['query']);_0xf2eb13[_0xe68f('0x39')]=_[_0xe68f('0x31')](_0xf2eb13['model'],_0xf2eb13[_0xe68f('0x30')]);_0x33614a[_0xe68f('0x32')]=_[_0xe68f('0x31')](_0xf2eb13[_0xe68f('0x2e')],qs[_0xe68f('0x33')](_0x49f6da['query'][_0xe68f('0x33')]));_0x33614a[_0xe68f('0x32')]=_0x33614a[_0xe68f('0x32')]['length']?_0x33614a[_0xe68f('0x32')]:_0xf2eb13[_0xe68f('0x2e')];if(_0x49f6da['query'][_0xe68f('0x44')]){_0x33614a[_0xe68f('0x3e')]=[{'all':!![]}];}_0x33614a=_['merge']({},_0x33614a,_0x49f6da[_0xe68f('0x45')]);return db[_0xe68f('0x2b')][_0xe68f('0x46')](_0x33614a)[_0xe68f('0x24')](handleEntityNotFound(_0x3d2c3b,null))[_0xe68f('0x24')](respondWithResult(_0x3d2c3b,null))[_0xe68f('0x40')](handleError(_0x3d2c3b,null));};exports[_0xe68f('0x47')]=function(_0x170620,_0x4332ec){return db[_0xe68f('0x2b')]['create'](_0x170620[_0xe68f('0x48')],{})[_0xe68f('0x24')](function(_0xc64e3b){var _0x110c97=_0x170620[_0xe68f('0x49')][_0xe68f('0x25')]({'plain':!![]});if(!_0x110c97)throw new Error(_0xe68f('0x4a'));if(_0x110c97[_0xe68f('0x4b')]===_0xe68f('0x49')){var _0x35c529=_0xc64e3b[_0xe68f('0x25')]({'plain':!![]});var _0x203235=_0xe68f('0x26');return db['UserProfileSection'][_0xe68f('0x46')]({'where':{'name':_0x203235,'userProfileId':_0x110c97[_0xe68f('0x4c')]},'raw':!![]})['then'](function(_0x2d7193){if(_0x2d7193&&_0x2d7193[_0xe68f('0x4d')]===0x0){return db[_0xe68f('0x4e')][_0xe68f('0x47')]({'name':_0x35c529[_0xe68f('0x2f')],'resourceId':_0x35c529['id'],'type':_0x2d7193[_0xe68f('0x2f')],'sectionId':_0x2d7193['id']},{})[_0xe68f('0x24')](function(){return _0xc64e3b;});}else{return _0xc64e3b;}})['catch'](function(_0x407f3a){logger[_0xe68f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x407f3a);throw _0x407f3a;});}return _0xc64e3b;})[_0xe68f('0x24')](respondWithResult(_0x4332ec,0xc9))[_0xe68f('0x40')](handleError(_0x4332ec,null));};exports[_0xe68f('0x4f')]=function(_0x4eb250,_0x48bfc9){if(_0x4eb250[_0xe68f('0x48')]['id']){delete _0x4eb250[_0xe68f('0x48')]['id'];}return db[_0xe68f('0x2b')][_0xe68f('0x46')]({'where':{'id':_0x4eb250[_0xe68f('0x42')]['id']}})[_0xe68f('0x24')](handleEntityNotFound(_0x48bfc9,null))['then'](saveUpdates(_0x4eb250['body'],null))[_0xe68f('0x24')](respondWithResult(_0x48bfc9,null))['catch'](handleError(_0x48bfc9,null));};exports[_0xe68f('0x50')]=function(_0x3b589e,_0x5262d1){return db[_0xe68f('0x2b')][_0xe68f('0x46')]({'where':{'id':_0x3b589e[_0xe68f('0x42')]['id']}})['then'](handleEntityNotFound(_0x5262d1,null))[_0xe68f('0x24')](removeEntity(_0x5262d1,null))[_0xe68f('0x40')](handleError(_0x5262d1,null));};exports[_0xe68f('0x51')]=function(_0x36ad4a,_0x3a4721,_0x50f4cd){return db[_0xe68f('0x2b')][_0xe68f('0x46')]({'where':{'id':_0x36ad4a[_0xe68f('0x42')]['id']},'attributes':[_0xe68f('0x2f'),_0xe68f('0x52'),_0xe68f('0x53'),_0xe68f('0x54')],'raw':!![]})[_0xe68f('0x24')](handleEntityNotFound(_0x3a4721,null))[_0xe68f('0x24')](function(_0x1b6611){if(_0x1b6611){if(!fs[_0xe68f('0x55')](path[_0xe68f('0x56')](config[_0xe68f('0x57')],_0xe68f('0x58'),_0x1b6611[_0xe68f('0x53')]))){throw new db['Sequelize']['ValidationError'](_0xe68f('0x59'));}if(_0x36ad4a['query'][_0xe68f('0x5a')]){return _0x3a4721[_0xe68f('0x19')](0xc8);}return _0x3a4721[_0xe68f('0x51')](path['join'](config[_0xe68f('0x57')],_0xe68f('0x58'),_0x1b6611[_0xe68f('0x53')]),util['format']('%s.%s',_0x1b6611[_0xe68f('0x52')]||_0x1b6611[_0xe68f('0x2f')],_0x1b6611[_0xe68f('0x54')][_0xe68f('0x5b')]()));}})[_0xe68f('0x40')](handleError(_0x3a4721,null));}; \ No newline at end of file +var _0x7722=['download','format','%s.%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','reject','update','destroy','then','get','ExtractedReports','UserProfileResource','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists'];(function(_0x4e7d56,_0xf0d4d1){var _0x2914e8=function(_0x5f4edb){while(--_0x5f4edb){_0x4e7d56['push'](_0x4e7d56['shift']());}};_0x2914e8(++_0xf0d4d1);}(_0x7722,0x1cf));var _0x2772=function(_0xd85410,_0x28d0e5){_0xd85410=_0xd85410-0x0;var _0x472d4b=_0x7722[_0xd85410];return _0x472d4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2772('0x0'));var zipdir=require(_0x2772('0x1'));var jsonpatch=require(_0x2772('0x2'));var rp=require(_0x2772('0x3'));var moment=require(_0x2772('0x4'));var BPromise=require(_0x2772('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2772('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2772('0x7'));var _=require(_0x2772('0x8'));var squel=require(_0x2772('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2772('0xa'));var toCsv=require(_0x2772('0xb'));var querystring=require(_0x2772('0xc'));var Papa=require(_0x2772('0xd'));var Redis=require(_0x2772('0xe'));var authService=require(_0x2772('0xf'));var qs=require(_0x2772('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2772('0x11'));var logger=require(_0x2772('0x12'))(_0x2772('0x13'));var utils=require(_0x2772('0x14'));var config=require(_0x2772('0x15'));var licenseUtil=require(_0x2772('0x16'));var db=require(_0x2772('0x17'))['db'];function respondWithStatusCode(_0x53479e,_0x23bc93){_0x23bc93=_0x23bc93||0xcc;return function(_0x491eb2){if(_0x491eb2){return _0x53479e[_0x2772('0x18')](_0x23bc93);}return _0x53479e['status'](_0x23bc93)['end']();};}function respondWithResult(_0x4b6c37,_0x2da38a){_0x2da38a=_0x2da38a||0xc8;return function(_0x29a4c8){if(_0x29a4c8){return _0x4b6c37[_0x2772('0x19')](_0x2da38a)[_0x2772('0x1a')](_0x29a4c8);}};}function respondWithFilteredResult(_0x52718d,_0xaed3cf){return function(_0x3a3e8b){if(_0x3a3e8b){var _0x48d72e=typeof _0xaed3cf['offset']==='undefined'&&typeof _0xaed3cf[_0x2772('0x1b')]===_0x2772('0x1c');var _0x2e59ad=_0x3a3e8b[_0x2772('0x1d')];var _0x39b455=_0x48d72e?0x0:_0xaed3cf[_0x2772('0x1e')];var _0xc1f23b=_0x48d72e?_0x3a3e8b[_0x2772('0x1d')]:_0xaed3cf[_0x2772('0x1e')]+_0xaed3cf['limit'];var _0x331faf;if(_0xc1f23b>=_0x2e59ad){_0xc1f23b=_0x2e59ad;_0x331faf=0xc8;}else{_0x331faf=0xce;}_0x52718d[_0x2772('0x19')](_0x331faf);return _0x52718d['set'](_0x2772('0x1f'),_0x39b455+'-'+_0xc1f23b+'/'+_0x2e59ad)[_0x2772('0x1a')](_0x3a3e8b);}return null;};}function patchUpdates(_0x47b115){return function(_0x503b3a){try{jsonpatch['apply'](_0x503b3a,_0x47b115,!![]);}catch(_0x51eafa){return BPromise[_0x2772('0x20')](_0x51eafa);}return _0x503b3a['save']();};}function saveUpdates(_0x54fca4,_0x5c16fb){return function(_0x296e8e){if(_0x296e8e){return _0x296e8e[_0x2772('0x21')](_0x54fca4)['then'](function(_0x394af8){return _0x394af8;});}return null;};}function removeEntity(_0x359d2f,_0x571512){return function(_0x52f41d){if(_0x52f41d){return _0x52f41d[_0x2772('0x22')]()[_0x2772('0x23')](function(){var _0x444b5f=_0x52f41d[_0x2772('0x24')]({'plain':!![]});var _0xa88ae7=_0x2772('0x25');return db[_0x2772('0x26')][_0x2772('0x22')]({'where':{'type':_0xa88ae7,'resourceId':_0x444b5f['id']}})[_0x2772('0x23')](function(){return _0x52f41d;});})['then'](function(){_0x359d2f[_0x2772('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eeda8,_0x41d3b7){return function(_0x54bd07){if(!_0x54bd07){_0x5eeda8[_0x2772('0x18')](0x194);}return _0x54bd07;};}function handleError(_0x16e98,_0x4c55e9){_0x4c55e9=_0x4c55e9||0x1f4;return function(_0x320146){logger['error'](_0x320146['stack']);if(_0x320146['name']){delete _0x320146[_0x2772('0x27')];}_0x16e98[_0x2772('0x19')](_0x4c55e9)[_0x2772('0x28')](_0x320146);};}exports[_0x2772('0x29')]=function(_0x4478b3,_0x4f3e35){var _0xbc6234={},_0x1a7b7f={},_0x2719fa={'count':0x0,'rows':[]};var _0x1e5425=_[_0x2772('0x2a')](db[_0x2772('0x2b')][_0x2772('0x2c')],function(_0x613358){return{'name':_0x613358[_0x2772('0x2d')],'type':_0x613358[_0x2772('0x2e')][_0x2772('0x2f')]};});_0x1a7b7f[_0x2772('0x30')]=_[_0x2772('0x2a')](_0x1e5425,_0x2772('0x27'));_0x1a7b7f[_0x2772('0x31')]=_[_0x2772('0x32')](_0x4478b3[_0x2772('0x31')]);_0x1a7b7f[_0x2772('0x33')]=_['intersection'](_0x1a7b7f['model'],_0x1a7b7f[_0x2772('0x31')]);_0xbc6234['attributes']=_['intersection'](_0x1a7b7f[_0x2772('0x30')],qs[_0x2772('0x34')](_0x4478b3[_0x2772('0x31')][_0x2772('0x34')]));_0xbc6234[_0x2772('0x35')]=_0xbc6234['attributes'][_0x2772('0x36')]?_0xbc6234[_0x2772('0x35')]:_0x1a7b7f[_0x2772('0x30')];if(!_0x4478b3[_0x2772('0x31')]['hasOwnProperty'](_0x2772('0x37'))){_0xbc6234[_0x2772('0x1b')]=qs['limit'](_0x4478b3[_0x2772('0x31')][_0x2772('0x1b')]);_0xbc6234[_0x2772('0x1e')]=qs[_0x2772('0x1e')](_0x4478b3[_0x2772('0x31')][_0x2772('0x1e')]);}_0xbc6234[_0x2772('0x38')]=qs[_0x2772('0x39')](_0x4478b3[_0x2772('0x31')]['sort']);_0xbc6234[_0x2772('0x3a')]=qs['filters'](_[_0x2772('0x3b')](_0x4478b3[_0x2772('0x31')],_0x1a7b7f[_0x2772('0x33')]),_0x1e5425);if(_0x4478b3[_0x2772('0x31')][_0x2772('0x3c')]){_0xbc6234[_0x2772('0x3a')]=_[_0x2772('0x3d')](_0xbc6234[_0x2772('0x3a')],{'$or':_['map'](_0x1e5425,function(_0xe4c046){if(_0xe4c046[_0x2772('0x2e')]!=='VIRTUAL'){var _0x390108={};_0x390108[_0xe4c046[_0x2772('0x27')]]={'$like':'%'+_0x4478b3[_0x2772('0x31')][_0x2772('0x3c')]+'%'};return _0x390108;}})});}_0xbc6234=_[_0x2772('0x3d')]({},_0xbc6234,_0x4478b3[_0x2772('0x3e')]);var _0x42d930={'where':_0xbc6234[_0x2772('0x3a')]};return db[_0x2772('0x2b')][_0x2772('0x1d')](_0x42d930)[_0x2772('0x23')](function(_0x359ef8){_0x2719fa['count']=_0x359ef8;if(_0x4478b3[_0x2772('0x31')][_0x2772('0x3f')]){_0xbc6234[_0x2772('0x40')]=[{'all':!![]}];}return db[_0x2772('0x2b')][_0x2772('0x41')](_0xbc6234);})[_0x2772('0x23')](function(_0x4ae3cc){_0x2719fa['rows']=_0x4ae3cc;return _0x2719fa;})[_0x2772('0x23')](respondWithFilteredResult(_0x4f3e35,_0xbc6234))[_0x2772('0x42')](handleError(_0x4f3e35,null));};exports['show']=function(_0x20d345,_0x6cbd66){var _0x3c6be8={'raw':!![],'where':{'id':_0x20d345[_0x2772('0x43')]['id']}},_0x16b40a={};_0x16b40a[_0x2772('0x30')]=_[_0x2772('0x32')](db[_0x2772('0x2b')][_0x2772('0x2c')]);_0x16b40a[_0x2772('0x31')]=_[_0x2772('0x32')](_0x20d345[_0x2772('0x31')]);_0x16b40a[_0x2772('0x33')]=_[_0x2772('0x44')](_0x16b40a[_0x2772('0x30')],_0x16b40a[_0x2772('0x31')]);_0x3c6be8[_0x2772('0x35')]=_[_0x2772('0x44')](_0x16b40a['model'],qs['fields'](_0x20d345[_0x2772('0x31')][_0x2772('0x34')]));_0x3c6be8[_0x2772('0x35')]=_0x3c6be8[_0x2772('0x35')][_0x2772('0x36')]?_0x3c6be8[_0x2772('0x35')]:_0x16b40a[_0x2772('0x30')];if(_0x20d345[_0x2772('0x31')][_0x2772('0x3f')]){_0x3c6be8[_0x2772('0x40')]=[{'all':!![]}];}_0x3c6be8=_[_0x2772('0x3d')]({},_0x3c6be8,_0x20d345['options']);return db[_0x2772('0x2b')][_0x2772('0x45')](_0x3c6be8)['then'](handleEntityNotFound(_0x6cbd66,null))[_0x2772('0x23')](respondWithResult(_0x6cbd66,null))[_0x2772('0x42')](handleError(_0x6cbd66,null));};exports[_0x2772('0x46')]=function(_0x1e266c,_0x1dbc92){return db[_0x2772('0x2b')][_0x2772('0x46')](_0x1e266c[_0x2772('0x47')],{})[_0x2772('0x23')](function(_0x4e8ac1){var _0x586998=_0x1e266c['user']['get']({'plain':!![]});if(!_0x586998)throw new Error(_0x2772('0x48'));if(_0x586998[_0x2772('0x49')]===_0x2772('0x4a')){var _0x44514b=_0x4e8ac1[_0x2772('0x24')]({'plain':!![]});var _0x4acdb9=_0x2772('0x25');return db[_0x2772('0x4b')][_0x2772('0x45')]({'where':{'name':_0x4acdb9,'userProfileId':_0x586998['userProfileId']},'raw':!![]})[_0x2772('0x23')](function(_0x16c142){if(_0x16c142&&_0x16c142[_0x2772('0x4c')]===0x0){return db[_0x2772('0x26')][_0x2772('0x46')]({'name':_0x44514b[_0x2772('0x27')],'resourceId':_0x44514b['id'],'type':_0x16c142[_0x2772('0x27')],'sectionId':_0x16c142['id']},{})[_0x2772('0x23')](function(){return _0x4e8ac1;});}else{return _0x4e8ac1;}})[_0x2772('0x42')](function(_0x1ac988){logger[_0x2772('0x4d')](_0x2772('0x4e'),_0x1ac988);throw _0x1ac988;});}return _0x4e8ac1;})[_0x2772('0x23')](respondWithResult(_0x1dbc92,0xc9))[_0x2772('0x42')](handleError(_0x1dbc92,null));};exports[_0x2772('0x21')]=function(_0x5ea244,_0x4cfb54){if(_0x5ea244['body']['id']){delete _0x5ea244['body']['id'];}return db[_0x2772('0x2b')][_0x2772('0x45')]({'where':{'id':_0x5ea244[_0x2772('0x43')]['id']}})['then'](handleEntityNotFound(_0x4cfb54,null))[_0x2772('0x23')](saveUpdates(_0x5ea244[_0x2772('0x47')],null))[_0x2772('0x23')](respondWithResult(_0x4cfb54,null))[_0x2772('0x42')](handleError(_0x4cfb54,null));};exports[_0x2772('0x22')]=function(_0x254bf0,_0x5be654){return db[_0x2772('0x2b')][_0x2772('0x45')]({'where':{'id':_0x254bf0[_0x2772('0x43')]['id']}})[_0x2772('0x23')](handleEntityNotFound(_0x5be654,null))['then'](removeEntity(_0x5be654,null))['catch'](handleError(_0x5be654,null));};exports['download']=function(_0x491d3b,_0x3d4edf,_0x14dd17){return db[_0x2772('0x2b')][_0x2772('0x45')]({'where':{'id':_0x491d3b['params']['id']},'attributes':[_0x2772('0x27'),_0x2772('0x4f'),_0x2772('0x50'),_0x2772('0x51')],'raw':!![]})[_0x2772('0x23')](handleEntityNotFound(_0x3d4edf,null))[_0x2772('0x23')](function(_0x25935){if(_0x25935){if(!fs[_0x2772('0x52')](path[_0x2772('0x53')](config[_0x2772('0x54')],'server/files/reports',_0x25935[_0x2772('0x50')]))){throw new db[(_0x2772('0x55'))][(_0x2772('0x56'))](_0x2772('0x57'));}if(_0x491d3b[_0x2772('0x31')][_0x2772('0x58')]){return _0x3d4edf[_0x2772('0x18')](0xc8);}return _0x3d4edf[_0x2772('0x59')](path['join'](config['root'],'server/files/reports',_0x25935[_0x2772('0x50')]),util[_0x2772('0x5a')](_0x2772('0x5b'),_0x25935['basename']||_0x25935['name'],_0x25935[_0x2772('0x51')]['toLowerCase']()));}})[_0x2772('0x42')](handleError(_0x3d4edf,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 57faad8..088f176 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 _0x9ff3=['../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x49141a,_0x32710c){var _0x4dd9ca=function(_0x456d75){while(--_0x456d75){_0x49141a['push'](_0x49141a['shift']());}};_0x4dd9ca(++_0x32710c);}(_0x9ff3,0xdd));var _0x39ff=function(_0xe14e5a,_0x1bcf01){_0xe14e5a=_0xe14e5a-0x0;var _0x1ab35e=_0x9ff3[_0xe14e5a];return _0x1ab35e;};'use strict';var _=require('lodash');var util=require(_0x39ff('0x0'));var logger=require(_0x39ff('0x1'))(_0x39ff('0x2'));var moment=require(_0x39ff('0x3'));var BPromise=require(_0x39ff('0x4'));var rp=require(_0x39ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39ff('0x6'));var config=require(_0x39ff('0x7'));var attributes=require(_0x39ff('0x8'));module[_0x39ff('0x9')]=function(_0x4f0a76,_0x29946f){return _0x4f0a76[_0x39ff('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x39ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee9e=['util','../../config/logger','api','moment','rimraf','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0x4eff08,_0x2007fd){var _0xaf6249=function(_0x3d4853){while(--_0x3d4853){_0x4eff08['push'](_0x4eff08['shift']());}};_0xaf6249(++_0x2007fd);}(_0xee9e,0x15d));var _0xeee9=function(_0x1a4d61,_0x5be6d4){_0x1a4d61=_0x1a4d61-0x0;var _0x594b59=_0xee9e[_0x1a4d61];return _0x594b59;};'use strict';var _=require(_0xeee9('0x0'));var util=require(_0xeee9('0x1'));var logger=require(_0xeee9('0x2'))(_0xeee9('0x3'));var moment=require(_0xeee9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeee9('0x5'));var config=require('../../config/environment');var attributes=require(_0xeee9('0x6'));module[_0xeee9('0x7')]=function(_0x4a996a,_0xf796a6){return _0x4a996a[_0xeee9('0x8')]('AnalyticExtractedReport',attributes,{'tableName':_0xeee9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index af78abc..d937109 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 _0x4556=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message'];(function(_0x3f6073,_0xb9d981){var _0x14b830=function(_0x4b7a99){while(--_0x4b7a99){_0x3f6073['push'](_0x3f6073['shift']());}};_0x14b830(++_0xb9d981);}(_0x4556,0x152));var _0x6455=function(_0x22fb75,_0x14674b){_0x22fb75=_0x22fb75-0x0;var _0x4572e8=_0x4556[_0x22fb75];return _0x4572e8;};'use strict';var _=require(_0x6455('0x0'));var util=require(_0x6455('0x1'));var moment=require('moment');var BPromise=require(_0x6455('0x2'));var rs=require(_0x6455('0x3'));var fs=require('fs');var Redis=require(_0x6455('0x4'));var db=require(_0x6455('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6455('0x6'))(_0x6455('0x7'));var config=require('../../config/environment');var jayson=require(_0x6455('0x8'));var client=jayson[_0x6455('0x9')][_0x6455('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e72c2,_0x1e4d1b,_0x5b523d){return new BPromise(function(_0x3cb6bc,_0x540f37){return client[_0x6455('0xb')](_0x3e72c2,_0x5b523d)['then'](function(_0x2fc835){logger[_0x6455('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1e4d1b,'request\x20sent');logger[_0x6455('0xd')](_0x6455('0xe'),_0x1e4d1b,'request\x20sent',JSON[_0x6455('0xf')](_0x2fc835));if(_0x2fc835['error']){if(_0x2fc835[_0x6455('0x10')]['code']===0x1f4){logger[_0x6455('0x10')](_0x6455('0x11'),_0x1e4d1b,_0x2fc835[_0x6455('0x10')][_0x6455('0x12')]);return _0x540f37(_0x2fc835['error']['message']);}logger[_0x6455('0x10')](_0x6455('0x11'),_0x1e4d1b,_0x2fc835['error'][_0x6455('0x12')]);return _0x3cb6bc(_0x2fc835[_0x6455('0x10')][_0x6455('0x12')]);}else{logger[_0x6455('0xc')](_0x6455('0x11'),_0x1e4d1b,'request\x20sent');_0x3cb6bc(_0x2fc835[_0x6455('0x13')]['message']);}})[_0x6455('0x14')](function(_0x127d50){logger[_0x6455('0x10')](_0x6455('0x11'),_0x1e4d1b,_0x127d50);_0x540f37(_0x127d50);});});} \ No newline at end of file +var _0xc613=['jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x35043e,_0x48114b){var _0x3ff117=function(_0x28c0b5){while(--_0x28c0b5){_0x35043e['push'](_0x35043e['shift']());}};_0x3ff117(++_0x48114b);}(_0xc613,0x1b3));var _0x3c61=function(_0x28c280,_0x45163b){_0x28c280=_0x28c280-0x0;var _0x130e18=_0xc613[_0x28c280];return _0x130e18;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3c61('0x0'));var BPromise=require(_0x3c61('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c61('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3c61('0x3'));var logger=require(_0x3c61('0x4'))(_0x3c61('0x5'));var config=require('../../config/environment');var jayson=require(_0x3c61('0x6'));var client=jayson[_0x3c61('0x7')][_0x3c61('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474f37,_0x1284af,_0x4692e8){return new BPromise(function(_0x45cc64,_0x2b07bf){return client[_0x3c61('0x9')](_0x474f37,_0x4692e8)[_0x3c61('0xa')](function(_0x1a8361){logger[_0x3c61('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1284af,_0x3c61('0xc'));logger[_0x3c61('0xd')](_0x3c61('0xe'),_0x1284af,_0x3c61('0xc'),JSON['stringify'](_0x1a8361));if(_0x1a8361['error']){if(_0x1a8361[_0x3c61('0xf')][_0x3c61('0x10')]===0x1f4){logger[_0x3c61('0xf')](_0x3c61('0x11'),_0x1284af,_0x1a8361[_0x3c61('0xf')][_0x3c61('0x12')]);return _0x2b07bf(_0x1a8361[_0x3c61('0xf')][_0x3c61('0x12')]);}logger[_0x3c61('0xf')](_0x3c61('0x11'),_0x1284af,_0x1a8361[_0x3c61('0xf')][_0x3c61('0x12')]);return _0x45cc64(_0x1a8361[_0x3c61('0xf')][_0x3c61('0x12')]);}else{logger['info'](_0x3c61('0x11'),_0x1284af,_0x3c61('0xc'));_0x45cc64(_0x1a8361[_0x3c61('0x13')][_0x3c61('0x12')]);}})[_0x3c61('0x14')](function(_0x1b3179){logger[_0x3c61('0xf')](_0x3c61('0x11'),_0x1284af,_0x1b3179);_0x2b07bf(_0x1b3179);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1133e93..b2b71f3 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 _0x731b=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x2daa4e,_0x58ac96){var _0x3771f1=function(_0x77f1e4){while(--_0x77f1e4){_0x2daa4e['push'](_0x2daa4e['shift']());}};_0x3771f1(++_0x58ac96);}(_0x731b,0x18b));var _0xb731=function(_0x95b187,_0x5ef45f){_0x95b187=_0x95b187-0x0;var _0x566423=_0x731b[_0x95b187];return _0x566423;};'use strict';var multer=require('multer');var util=require(_0xb731('0x0'));var path=require(_0xb731('0x1'));var timeout=require(_0xb731('0x2'));var express=require(_0xb731('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb731('0x4'));var config=require(_0xb731('0x5'));var controller=require(_0xb731('0x6'));router[_0xb731('0x7')]('/',auth[_0xb731('0x8')](),controller[_0xb731('0x9')]);router[_0xb731('0x7')](_0xb731('0xa'),auth['isAuthenticated'](),controller[_0xb731('0xb')]);router['get'](_0xb731('0xc'),auth[_0xb731('0x8')](),controller[_0xb731('0xd')]);router[_0xb731('0xe')]('/',auth[_0xb731('0x8')](),controller[_0xb731('0xf')]);router['put'](_0xb731('0xa'),auth['isAuthenticated'](),controller[_0xb731('0x10')]);router['delete']('/:id',auth[_0xb731('0x8')](),controller[_0xb731('0x11')]);module[_0xb731('0x12')]=router; \ No newline at end of file +var _0x4c71=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','download','post','create','put','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x56505c,_0x9c8c8a){var _0x367038=function(_0x367755){while(--_0x367755){_0x56505c['push'](_0x56505c['shift']());}};_0x367038(++_0x9c8c8a);}(_0x4c71,0x118));var _0x14c7=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4c71[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x14c7('0x0'));var timeout=require('connect-timeout');var express=require(_0x14c7('0x1'));var router=express[_0x14c7('0x2')]();var fs_extra=require(_0x14c7('0x3'));var auth=require(_0x14c7('0x4'));var interaction=require(_0x14c7('0x5'));var config=require(_0x14c7('0x6'));var controller=require(_0x14c7('0x7'));router[_0x14c7('0x8')]('/',auth[_0x14c7('0x9')](),controller['index']);router[_0x14c7('0x8')](_0x14c7('0xa'),auth[_0x14c7('0x9')](),controller[_0x14c7('0xb')]);router[_0x14c7('0x8')]('/:id/download',auth[_0x14c7('0x9')](),controller[_0x14c7('0xc')]);router[_0x14c7('0xd')]('/',auth['isAuthenticated'](),controller[_0x14c7('0xe')]);router[_0x14c7('0xf')](_0x14c7('0xa'),auth[_0x14c7('0x9')](),controller[_0x14c7('0x10')]);router[_0x14c7('0x11')](_0x14c7('0xa'),auth[_0x14c7('0x9')](),controller['destroy']);module[_0x14c7('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 3dbcf19..670213a 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 _0x3b45=['STRING','BOOLEAN','sequelize','exports'];(function(_0x45587a,_0x97d504){var _0x3ec2ea=function(_0x3bfe5c){while(--_0x3bfe5c){_0x45587a['push'](_0x45587a['shift']());}};_0x3ec2ea(++_0x97d504);}(_0x3b45,0xfe));var _0x53b4=function(_0x59eeb5,_0x3760f3){_0x59eeb5=_0x59eeb5-0x0;var _0xa33622=_0x3b45[_0x59eeb5];return _0xa33622;};'use strict';var Sequelize=require(_0x53b4('0x0'));module[_0x53b4('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x53b4('0x2')]},'function':{'type':Sequelize[_0x53b4('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x53b4('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5269=['exports','TEXT','STRING','BOOLEAN'];(function(_0xe41ba8,_0xfd2419){var _0x4872f6=function(_0x2cbb85){while(--_0x2cbb85){_0xe41ba8['push'](_0xe41ba8['shift']());}};_0x4872f6(++_0xfd2419);}(_0x5269,0x13c));var _0x9526=function(_0x17d3ea,_0x3c9a95){_0x17d3ea=_0x17d3ea-0x0;var _0x1e3fb2=_0x5269[_0x17d3ea];return _0x1e3fb2;};'use strict';var Sequelize=require('sequelize');module[_0x9526('0x0')]={'field':{'type':Sequelize[_0x9526('0x1')]},'alias':{'type':Sequelize[_0x9526('0x2')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9526('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9526('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index c622bc5..bbc1981 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 _0xd2c3=['pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','bulkCreate','destroy','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xd2c3,0x1c2));var _0x3d2c=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xd2c3[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require(_0x3d2c('0x0'));var rimraf=require(_0x3d2c('0x1'));var zipdir=require(_0x3d2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d2c('0x3'));var moment=require(_0x3d2c('0x4'));var BPromise=require(_0x3d2c('0x5'));var Mustache=require(_0x3d2c('0x6'));var util=require(_0x3d2c('0x7'));var path=require('path');var sox=require(_0x3d2c('0x8'));var csv=require(_0x3d2c('0x9'));var ejs=require(_0x3d2c('0xa'));var fs=require('fs');var fs_extra=require(_0x3d2c('0xb'));var _=require(_0x3d2c('0xc'));var squel=require(_0x3d2c('0xd'));var crypto=require(_0x3d2c('0xe'));var jsforce=require(_0x3d2c('0xf'));var deskjs=require(_0x3d2c('0x10'));var toCsv=require(_0x3d2c('0x9'));var querystring=require('querystring');var Papa=require(_0x3d2c('0x11'));var Redis=require(_0x3d2c('0x12'));var authService=require(_0x3d2c('0x13'));var qs=require(_0x3d2c('0x14'));var as=require(_0x3d2c('0x15'));var hardwareService=require(_0x3d2c('0x16'));var logger=require(_0x3d2c('0x17'))(_0x3d2c('0x18'));var utils=require(_0x3d2c('0x19'));var config=require(_0x3d2c('0x1a'));var licenseUtil=require(_0x3d2c('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46d733,_0x40facf){_0x40facf=_0x40facf||0xcc;return function(_0x1eae54){if(_0x1eae54){return _0x46d733[_0x3d2c('0x1c')](_0x40facf);}return _0x46d733[_0x3d2c('0x1d')](_0x40facf)[_0x3d2c('0x1e')]();};}function respondWithResult(_0x459cf6,_0x24a832){_0x24a832=_0x24a832||0xc8;return function(_0x5040d9){if(_0x5040d9){return _0x459cf6[_0x3d2c('0x1d')](_0x24a832)['json'](_0x5040d9);}};}function respondWithFilteredResult(_0x47ef44,_0x1f751a){return function(_0x46ad61){if(_0x46ad61){var _0x2e805a=typeof _0x1f751a['offset']===_0x3d2c('0x1f')&&typeof _0x1f751a['limit']===_0x3d2c('0x1f');var _0x2cc913=_0x46ad61[_0x3d2c('0x20')];var _0x42123b=_0x2e805a?0x0:_0x1f751a[_0x3d2c('0x21')];var _0x6aa264=_0x2e805a?_0x46ad61[_0x3d2c('0x20')]:_0x1f751a[_0x3d2c('0x21')]+_0x1f751a[_0x3d2c('0x22')];var _0x2962fa;if(_0x6aa264>=_0x2cc913){_0x6aa264=_0x2cc913;_0x2962fa=0xc8;}else{_0x2962fa=0xce;}_0x47ef44[_0x3d2c('0x1d')](_0x2962fa);return _0x47ef44[_0x3d2c('0x23')](_0x3d2c('0x24'),_0x42123b+'-'+_0x6aa264+'/'+_0x2cc913)['json'](_0x46ad61);}return null;};}function patchUpdates(_0x1fba95){return function(_0x284db3){try{jsonpatch[_0x3d2c('0x25')](_0x284db3,_0x1fba95,!![]);}catch(_0x2e2b03){return BPromise['reject'](_0x2e2b03);}return _0x284db3[_0x3d2c('0x26')]();};}function saveUpdates(_0x2c97e6,_0x3840e0){return function(_0x4742a4){if(_0x4742a4){return _0x4742a4[_0x3d2c('0x27')](_0x2c97e6)[_0x3d2c('0x28')](function(_0x3143af){return _0x3143af;});}return null;};}function removeEntity(_0x23c841,_0x122baf){return function(_0x202f71){if(_0x202f71){return _0x202f71['destroy']()[_0x3d2c('0x28')](function(){_0x23c841['status'](0xcc)[_0x3d2c('0x1e')]();});}};}function handleEntityNotFound(_0x39be88,_0x4e10e4){return function(_0x326065){if(!_0x326065){_0x39be88[_0x3d2c('0x1c')](0x194);}return _0x326065;};}function handleError(_0xfd6cf9,_0x3e3240){_0x3e3240=_0x3e3240||0x1f4;return function(_0x792165){logger[_0x3d2c('0x29')](_0x792165[_0x3d2c('0x2a')]);if(_0x792165['name']){delete _0x792165['name'];}_0xfd6cf9[_0x3d2c('0x1d')](_0x3e3240)['send'](_0x792165);};}exports['index']=function(_0x2a7a56,_0x48a43e){var _0xce9d53={},_0x7ea96c={},_0x55e0c1={'count':0x0,'rows':[]};var _0x38ff16=_[_0x3d2c('0x2b')](db[_0x3d2c('0x2c')][_0x3d2c('0x2d')],function(_0x5989e5){return{'name':_0x5989e5[_0x3d2c('0x2e')],'type':_0x5989e5[_0x3d2c('0x2f')][_0x3d2c('0x30')]};});_0x7ea96c[_0x3d2c('0x31')]=_[_0x3d2c('0x2b')](_0x38ff16,_0x3d2c('0x32'));_0x7ea96c[_0x3d2c('0x33')]=_['keys'](_0x2a7a56['query']);_0x7ea96c[_0x3d2c('0x34')]=_[_0x3d2c('0x35')](_0x7ea96c['model'],_0x7ea96c[_0x3d2c('0x33')]);_0xce9d53[_0x3d2c('0x36')]=_[_0x3d2c('0x35')](_0x7ea96c[_0x3d2c('0x31')],qs[_0x3d2c('0x37')](_0x2a7a56[_0x3d2c('0x33')]['fields']));_0xce9d53[_0x3d2c('0x36')]=_0xce9d53['attributes'][_0x3d2c('0x38')]?_0xce9d53[_0x3d2c('0x36')]:_0x7ea96c[_0x3d2c('0x31')];if(!_0x2a7a56['query']['hasOwnProperty'](_0x3d2c('0x39'))){_0xce9d53['limit']=qs['limit'](_0x2a7a56[_0x3d2c('0x33')]['limit']);_0xce9d53[_0x3d2c('0x21')]=qs['offset'](_0x2a7a56[_0x3d2c('0x33')][_0x3d2c('0x21')]);}_0xce9d53[_0x3d2c('0x3a')]=qs['sort'](_0x2a7a56[_0x3d2c('0x33')][_0x3d2c('0x3b')]);_0xce9d53['where']=qs['filters'](_[_0x3d2c('0x3c')](_0x2a7a56[_0x3d2c('0x33')],_0x7ea96c['filters']),_0x38ff16);if(_0x2a7a56[_0x3d2c('0x33')][_0x3d2c('0x3d')]){_0xce9d53[_0x3d2c('0x3e')]=_['merge'](_0xce9d53[_0x3d2c('0x3e')],{'$or':_[_0x3d2c('0x2b')](_0x38ff16,function(_0xb485eb){if(_0xb485eb[_0x3d2c('0x2f')]!==_0x3d2c('0x3f')){var _0x3084f4={};_0x3084f4[_0xb485eb[_0x3d2c('0x32')]]={'$like':'%'+_0x2a7a56[_0x3d2c('0x33')][_0x3d2c('0x3d')]+'%'};return _0x3084f4;}})});}_0xce9d53=_[_0x3d2c('0x40')]({},_0xce9d53,_0x2a7a56['options']);var _0x12683e={'where':_0xce9d53[_0x3d2c('0x3e')]};return db[_0x3d2c('0x2c')][_0x3d2c('0x20')](_0x12683e)[_0x3d2c('0x28')](function(_0x41b4e1){_0x55e0c1[_0x3d2c('0x20')]=_0x41b4e1;if(_0x2a7a56[_0x3d2c('0x33')][_0x3d2c('0x41')]){_0xce9d53[_0x3d2c('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3d2c('0x43')](_0xce9d53);})[_0x3d2c('0x28')](function(_0x302cdc){_0x55e0c1[_0x3d2c('0x44')]=_0x302cdc;return _0x55e0c1;})[_0x3d2c('0x28')](respondWithFilteredResult(_0x48a43e,_0xce9d53))[_0x3d2c('0x45')](handleError(_0x48a43e,null));};exports[_0x3d2c('0x46')]=function(_0x543412,_0x4907d3){var _0x30c858={'raw':![],'where':{'id':_0x543412[_0x3d2c('0x47')]['id']}},_0x5c22a1={};_0x5c22a1['model']=_['keys'](db[_0x3d2c('0x2c')][_0x3d2c('0x2d')]);_0x5c22a1[_0x3d2c('0x33')]=_['keys'](_0x543412[_0x3d2c('0x33')]);_0x5c22a1[_0x3d2c('0x34')]=_[_0x3d2c('0x35')](_0x5c22a1[_0x3d2c('0x31')],_0x5c22a1[_0x3d2c('0x33')]);_0x30c858[_0x3d2c('0x36')]=_[_0x3d2c('0x35')](_0x5c22a1[_0x3d2c('0x31')],qs[_0x3d2c('0x37')](_0x543412[_0x3d2c('0x33')][_0x3d2c('0x37')]));_0x30c858[_0x3d2c('0x36')]=_0x30c858[_0x3d2c('0x36')][_0x3d2c('0x38')]?_0x30c858['attributes']:_0x5c22a1['model'];if(_0x543412[_0x3d2c('0x33')][_0x3d2c('0x41')]){_0x30c858[_0x3d2c('0x42')]=[{'all':!![]}];}_0x30c858=_['merge']({},_0x30c858,_0x543412[_0x3d2c('0x48')]);return db[_0x3d2c('0x2c')][_0x3d2c('0x49')](_0x30c858)[_0x3d2c('0x28')](handleEntityNotFound(_0x4907d3,null))['then'](respondWithResult(_0x4907d3,null))[_0x3d2c('0x45')](handleError(_0x4907d3,null));};exports['create']=function(_0x3fac7a,_0x696aab){return db[_0x3d2c('0x2c')][_0x3d2c('0x4a')](_0x3fac7a[_0x3d2c('0x4b')],{})[_0x3d2c('0x28')](respondWithResult(_0x696aab,0xc9))[_0x3d2c('0x45')](handleError(_0x696aab,null));};exports[_0x3d2c('0x4c')]=function(_0x192927,_0x56603b){return db['AnalyticFieldReport'][_0x3d2c('0x4c')](_0x192927['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x56603b,0xc9))[_0x3d2c('0x45')](handleError(_0x56603b,null));};exports[_0x3d2c('0x27')]=function(_0x5bd5a4,_0x12b112){if(_0x5bd5a4['body']['id']){delete _0x5bd5a4[_0x3d2c('0x4b')]['id'];}return db['AnalyticFieldReport'][_0x3d2c('0x49')]({'where':{'id':_0x5bd5a4[_0x3d2c('0x47')]['id']}})[_0x3d2c('0x28')](handleEntityNotFound(_0x12b112,null))[_0x3d2c('0x28')](saveUpdates(_0x5bd5a4[_0x3d2c('0x4b')],null))[_0x3d2c('0x28')](respondWithResult(_0x12b112,null))[_0x3d2c('0x45')](handleError(_0x12b112,null));};exports[_0x3d2c('0x4d')]=function(_0x542a01,_0x56cf2c){return db[_0x3d2c('0x2c')][_0x3d2c('0x49')]({'where':{'id':_0x542a01[_0x3d2c('0x47')]['id']}})[_0x3d2c('0x28')](handleEntityNotFound(_0x56cf2c,null))[_0x3d2c('0x28')](removeEntity(_0x56cf2c,null))[_0x3d2c('0x45')](handleError(_0x56cf2c,null));};exports[_0x3d2c('0x4e')]=function(_0x309910,_0x97a8f3){return db[_0x3d2c('0x2c')]['destroy']({'where':{'id':_0x309910['query'][_0x3d2c('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x3d2c('0x28')](respondWithResult(_0x97a8f3,0xcc))[_0x3d2c('0x45')](handleError(_0x97a8f3,null));};exports['addFields']=function(_0x22babd,_0x5df8a0,_0x5227e1){return db[_0x3d2c('0x50')][_0x3d2c('0x51')]({'where':{'id':_0x22babd[_0x3d2c('0x47')]['id']}})[_0x3d2c('0x28')](handleEntityNotFound(_0x5df8a0,null))[_0x3d2c('0x28')](function(_0x4bb97a){if(_0x4bb97a){return db[_0x3d2c('0x52')][_0x3d2c('0x53')](function(_0x2cfcfa){return db[_0x3d2c('0x2c')][_0x3d2c('0x4d')]({'where':{'CustomReportId':_0x22babd[_0x3d2c('0x47')]['id']},'transaction':_0x2cfcfa})[_0x3d2c('0x28')](function(_0x4deea5){var _0x158f9e=_[_0x3d2c('0x2b')](_0x22babd[_0x3d2c('0x4b')],function(_0x2b22a4){delete _0x2b22a4['id'];_0x2b22a4[_0x3d2c('0x54')]=_0x22babd[_0x3d2c('0x47')]['id'];return _0x2b22a4;});return db[_0x3d2c('0x2c')][_0x3d2c('0x4c')](_0x158f9e,{'transaction':_0x2cfcfa});});})['then'](function(){return db[_0x3d2c('0x2c')][_0x3d2c('0x43')]({'where':{'CustomReportId':_0x22babd['params']['id']}});});}})[_0x3d2c('0x28')](respondWithResult(_0x5df8a0,null))[_0x3d2c('0x45')](handleError(_0x5df8a0,null));}; \ No newline at end of file +var _0x7219=['params','keys','create','body','update','find','bulkDestroy','ids','addFields','findOne','sequelize','CustomReportId','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','destroy','then','error','name','send','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7219,0xfd));var _0x9721=function(_0x2f8fc8,_0xdf6f40){_0x2f8fc8=_0x2f8fc8-0x0;var _0x2119e1=_0x7219[_0x2f8fc8];return _0x2119e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9721('0x0'));var zipdir=require(_0x9721('0x1'));var jsonpatch=require(_0x9721('0x2'));var rp=require(_0x9721('0x3'));var moment=require(_0x9721('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9721('0x5'));var util=require(_0x9721('0x6'));var path=require(_0x9721('0x7'));var sox=require(_0x9721('0x8'));var csv=require(_0x9721('0x9'));var ejs=require(_0x9721('0xa'));var fs=require('fs');var fs_extra=require(_0x9721('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9721('0xc'));var jsforce=require(_0x9721('0xd'));var deskjs=require(_0x9721('0xe'));var toCsv=require(_0x9721('0x9'));var querystring=require(_0x9721('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9721('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9721('0x11'));var logger=require('../../config/logger')(_0x9721('0x12'));var utils=require('../../config/utils');var config=require(_0x9721('0x13'));var licenseUtil=require(_0x9721('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1510c2,_0x3918df){_0x3918df=_0x3918df||0xcc;return function(_0x3e1cc2){if(_0x3e1cc2){return _0x1510c2[_0x9721('0x15')](_0x3918df);}return _0x1510c2[_0x9721('0x16')](_0x3918df)[_0x9721('0x17')]();};}function respondWithResult(_0x39a2aa,_0x386de0){_0x386de0=_0x386de0||0xc8;return function(_0x34e61b){if(_0x34e61b){return _0x39a2aa['status'](_0x386de0)[_0x9721('0x18')](_0x34e61b);}};}function respondWithFilteredResult(_0x5501f9,_0xdc6018){return function(_0x1faca7){if(_0x1faca7){var _0x56416f=typeof _0xdc6018['offset']==='undefined'&&typeof _0xdc6018[_0x9721('0x19')]===_0x9721('0x1a');var _0x47bc58=_0x1faca7[_0x9721('0x1b')];var _0x2cb8aa=_0x56416f?0x0:_0xdc6018[_0x9721('0x1c')];var _0x150910=_0x56416f?_0x1faca7['count']:_0xdc6018[_0x9721('0x1c')]+_0xdc6018[_0x9721('0x19')];var _0x1c58de;if(_0x150910>=_0x47bc58){_0x150910=_0x47bc58;_0x1c58de=0xc8;}else{_0x1c58de=0xce;}_0x5501f9[_0x9721('0x16')](_0x1c58de);return _0x5501f9[_0x9721('0x1d')](_0x9721('0x1e'),_0x2cb8aa+'-'+_0x150910+'/'+_0x47bc58)[_0x9721('0x18')](_0x1faca7);}return null;};}function patchUpdates(_0x4e14b0){return function(_0x2f6893){try{jsonpatch['apply'](_0x2f6893,_0x4e14b0,!![]);}catch(_0x5edadc){return BPromise[_0x9721('0x1f')](_0x5edadc);}return _0x2f6893[_0x9721('0x20')]();};}function saveUpdates(_0x5e77a2,_0x28e73c){return function(_0x734669){if(_0x734669){return _0x734669['update'](_0x5e77a2)['then'](function(_0x1b8502){return _0x1b8502;});}return null;};}function removeEntity(_0x4e1b3e,_0x331750){return function(_0x92b1b5){if(_0x92b1b5){return _0x92b1b5[_0x9721('0x21')]()[_0x9721('0x22')](function(){_0x4e1b3e['status'](0xcc)[_0x9721('0x17')]();});}};}function handleEntityNotFound(_0x427fb4,_0x199a2e){return function(_0x381710){if(!_0x381710){_0x427fb4[_0x9721('0x15')](0x194);}return _0x381710;};}function handleError(_0x1bdbb6,_0x40dfda){_0x40dfda=_0x40dfda||0x1f4;return function(_0x587680){logger[_0x9721('0x23')](_0x587680['stack']);if(_0x587680[_0x9721('0x24')]){delete _0x587680['name'];}_0x1bdbb6[_0x9721('0x16')](_0x40dfda)[_0x9721('0x25')](_0x587680);};}exports['index']=function(_0xd60d74,_0xc3f5b8){var _0x46eabb={},_0x7eba03={},_0x255210={'count':0x0,'rows':[]};var _0x51adb4=_['map'](db[_0x9721('0x26')][_0x9721('0x27')],function(_0x5b91b1){return{'name':_0x5b91b1[_0x9721('0x28')],'type':_0x5b91b1[_0x9721('0x29')][_0x9721('0x2a')]};});_0x7eba03[_0x9721('0x2b')]=_[_0x9721('0x2c')](_0x51adb4,_0x9721('0x24'));_0x7eba03['query']=_['keys'](_0xd60d74[_0x9721('0x2d')]);_0x7eba03['filters']=_[_0x9721('0x2e')](_0x7eba03[_0x9721('0x2b')],_0x7eba03[_0x9721('0x2d')]);_0x46eabb['attributes']=_[_0x9721('0x2e')](_0x7eba03['model'],qs[_0x9721('0x2f')](_0xd60d74[_0x9721('0x2d')][_0x9721('0x2f')]));_0x46eabb[_0x9721('0x30')]=_0x46eabb[_0x9721('0x30')][_0x9721('0x31')]?_0x46eabb['attributes']:_0x7eba03[_0x9721('0x2b')];if(!_0xd60d74['query'][_0x9721('0x32')](_0x9721('0x33'))){_0x46eabb[_0x9721('0x19')]=qs[_0x9721('0x19')](_0xd60d74[_0x9721('0x2d')][_0x9721('0x19')]);_0x46eabb[_0x9721('0x1c')]=qs[_0x9721('0x1c')](_0xd60d74['query'][_0x9721('0x1c')]);}_0x46eabb[_0x9721('0x34')]=qs[_0x9721('0x35')](_0xd60d74[_0x9721('0x2d')][_0x9721('0x35')]);_0x46eabb['where']=qs['filters'](_[_0x9721('0x36')](_0xd60d74[_0x9721('0x2d')],_0x7eba03[_0x9721('0x37')]),_0x51adb4);if(_0xd60d74[_0x9721('0x2d')][_0x9721('0x38')]){_0x46eabb[_0x9721('0x39')]=_[_0x9721('0x3a')](_0x46eabb[_0x9721('0x39')],{'$or':_[_0x9721('0x2c')](_0x51adb4,function(_0x183fab){if(_0x183fab[_0x9721('0x29')]!==_0x9721('0x3b')){var _0x8bed56={};_0x8bed56[_0x183fab[_0x9721('0x24')]]={'$like':'%'+_0xd60d74[_0x9721('0x2d')][_0x9721('0x38')]+'%'};return _0x8bed56;}})});}_0x46eabb=_[_0x9721('0x3a')]({},_0x46eabb,_0xd60d74[_0x9721('0x3c')]);var _0xe0f787={'where':_0x46eabb['where']};return db[_0x9721('0x26')][_0x9721('0x1b')](_0xe0f787)[_0x9721('0x22')](function(_0x51bb06){_0x255210[_0x9721('0x1b')]=_0x51bb06;if(_0xd60d74['query'][_0x9721('0x3d')]){_0x46eabb[_0x9721('0x3e')]=[{'all':!![]}];}return db[_0x9721('0x26')][_0x9721('0x3f')](_0x46eabb);})[_0x9721('0x22')](function(_0x44cbfd){_0x255210[_0x9721('0x40')]=_0x44cbfd;return _0x255210;})['then'](respondWithFilteredResult(_0xc3f5b8,_0x46eabb))[_0x9721('0x41')](handleError(_0xc3f5b8,null));};exports[_0x9721('0x42')]=function(_0x4f1b39,_0x252254){var _0x5d412e={'raw':![],'where':{'id':_0x4f1b39[_0x9721('0x43')]['id']}},_0x49a406={};_0x49a406[_0x9721('0x2b')]=_[_0x9721('0x44')](db[_0x9721('0x26')]['rawAttributes']);_0x49a406[_0x9721('0x2d')]=_['keys'](_0x4f1b39['query']);_0x49a406[_0x9721('0x37')]=_[_0x9721('0x2e')](_0x49a406[_0x9721('0x2b')],_0x49a406[_0x9721('0x2d')]);_0x5d412e[_0x9721('0x30')]=_['intersection'](_0x49a406[_0x9721('0x2b')],qs[_0x9721('0x2f')](_0x4f1b39[_0x9721('0x2d')][_0x9721('0x2f')]));_0x5d412e['attributes']=_0x5d412e['attributes'][_0x9721('0x31')]?_0x5d412e[_0x9721('0x30')]:_0x49a406['model'];if(_0x4f1b39['query'][_0x9721('0x3d')]){_0x5d412e['include']=[{'all':!![]}];}_0x5d412e=_['merge']({},_0x5d412e,_0x4f1b39[_0x9721('0x3c')]);return db[_0x9721('0x26')]['find'](_0x5d412e)[_0x9721('0x22')](handleEntityNotFound(_0x252254,null))[_0x9721('0x22')](respondWithResult(_0x252254,null))['catch'](handleError(_0x252254,null));};exports['create']=function(_0xf46af0,_0x3ea284){return db['AnalyticFieldReport'][_0x9721('0x45')](_0xf46af0[_0x9721('0x46')],{})[_0x9721('0x22')](respondWithResult(_0x3ea284,0xc9))[_0x9721('0x41')](handleError(_0x3ea284,null));};exports['bulkCreate']=function(_0x58efde,_0x36d181){return db['AnalyticFieldReport']['bulkCreate'](_0x58efde[_0x9721('0x46')],{'raw':![],'individualHooks':!![]})[_0x9721('0x22')](respondWithResult(_0x36d181,0xc9))['catch'](handleError(_0x36d181,null));};exports[_0x9721('0x47')]=function(_0x5bf184,_0x21c327){if(_0x5bf184['body']['id']){delete _0x5bf184[_0x9721('0x46')]['id'];}return db[_0x9721('0x26')][_0x9721('0x48')]({'where':{'id':_0x5bf184[_0x9721('0x43')]['id']}})[_0x9721('0x22')](handleEntityNotFound(_0x21c327,null))[_0x9721('0x22')](saveUpdates(_0x5bf184[_0x9721('0x46')],null))[_0x9721('0x22')](respondWithResult(_0x21c327,null))[_0x9721('0x41')](handleError(_0x21c327,null));};exports[_0x9721('0x21')]=function(_0x44f901,_0x53c4e5){return db[_0x9721('0x26')][_0x9721('0x48')]({'where':{'id':_0x44f901[_0x9721('0x43')]['id']}})[_0x9721('0x22')](handleEntityNotFound(_0x53c4e5,null))['then'](removeEntity(_0x53c4e5,null))[_0x9721('0x41')](handleError(_0x53c4e5,null));};exports[_0x9721('0x49')]=function(_0x387238,_0x43ec16){return db[_0x9721('0x26')][_0x9721('0x21')]({'where':{'id':_0x387238[_0x9721('0x2d')][_0x9721('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x43ec16,0xcc))[_0x9721('0x41')](handleError(_0x43ec16,null));};exports[_0x9721('0x4b')]=function(_0xa986f,_0x12f9ad,_0x303bf3){return db['AnalyticCustomReport'][_0x9721('0x4c')]({'where':{'id':_0xa986f[_0x9721('0x43')]['id']}})[_0x9721('0x22')](handleEntityNotFound(_0x12f9ad,null))[_0x9721('0x22')](function(_0x59c354){if(_0x59c354){return db[_0x9721('0x4d')]['transaction'](function(_0x1c75dc){return db[_0x9721('0x26')][_0x9721('0x21')]({'where':{'CustomReportId':_0xa986f[_0x9721('0x43')]['id']},'transaction':_0x1c75dc})[_0x9721('0x22')](function(_0xd89c92){var _0xedec09=_['map'](_0xa986f[_0x9721('0x46')],function(_0x301e6f){delete _0x301e6f['id'];_0x301e6f[_0x9721('0x4e')]=_0xa986f[_0x9721('0x43')]['id'];return _0x301e6f;});return db[_0x9721('0x26')][_0x9721('0x4f')](_0xedec09,{'transaction':_0x1c75dc});});})[_0x9721('0x22')](function(){return db[_0x9721('0x26')][_0x9721('0x3f')]({'where':{'CustomReportId':_0xa986f[_0x9721('0x43')]['id']}});});}})[_0x9721('0x22')](respondWithResult(_0x12f9ad,null))[_0x9721('0x41')](handleError(_0x12f9ad,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 5ebe788..9eea2ba 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 _0x5bd0=['rimraf','./analyticFieldReport.attributes','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xfba72,_0x191c41){var _0x5ee41a=function(_0x5b24be){while(--_0x5b24be){_0xfba72['push'](_0xfba72['shift']());}};_0x5ee41a(++_0x191c41);}(_0x5bd0,0xe4));var _0x05bd=function(_0x27c3f0,_0x198aa2){_0x27c3f0=_0x27c3f0-0x0;var _0x11e51c=_0x5bd0[_0x27c3f0];return _0x11e51c;};'use strict';var _=require(_0x05bd('0x0'));var util=require(_0x05bd('0x1'));var logger=require(_0x05bd('0x2'))('api');var moment=require(_0x05bd('0x3'));var BPromise=require(_0x05bd('0x4'));var rp=require(_0x05bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05bd('0x6'));var config=require('../../config/environment');var attributes=require(_0x05bd('0x7'));module['exports']=function(_0xe9d222,_0x5c4867){return _0xe9d222['define']('AnalyticFieldReport',attributes,{'tableName':_0x05bd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28b8=['moment','bluebird','request-promise','path','../../config/environment','./analyticFieldReport.attributes','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x28b8,0x1dd));var _0x828b=function(_0x29d530,_0x5da0d7){_0x29d530=_0x29d530-0x0;var _0x242905=_0x28b8[_0x29d530];return _0x242905;};'use strict';var _=require(_0x828b('0x0'));var util=require(_0x828b('0x1'));var logger=require('../../config/logger')(_0x828b('0x2'));var moment=require(_0x828b('0x3'));var BPromise=require(_0x828b('0x4'));var rp=require(_0x828b('0x5'));var fs=require('fs');var path=require(_0x828b('0x6'));var rimraf=require('rimraf');var config=require(_0x828b('0x7'));var attributes=require(_0x828b('0x8'));module['exports']=function(_0x2edb4f,_0x4faf41){return _0x2edb4f[_0x828b('0x9')](_0x828b('0xa'),attributes,{'tableName':_0x828b('0xb'),'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 630db44..2c9b311 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 _0x62e4=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x2ba423,_0x51ab1e){var _0x114c5f=function(_0x49113b){while(--_0x49113b){_0x2ba423['push'](_0x2ba423['shift']());}};_0x114c5f(++_0x51ab1e);}(_0x62e4,0x7a));var _0x462e=function(_0x228bd9,_0x166a5c){_0x228bd9=_0x228bd9-0x0;var _0x739532=_0x62e4[_0x228bd9];return _0x739532;};'use strict';var _=require(_0x462e('0x0'));var util=require(_0x462e('0x1'));var moment=require('moment');var BPromise=require(_0x462e('0x2'));var rs=require(_0x462e('0x3'));var fs=require('fs');var Redis=require(_0x462e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x462e('0x5'));var logger=require(_0x462e('0x6'))(_0x462e('0x7'));var config=require(_0x462e('0x8'));var jayson=require(_0x462e('0x9'));var client=jayson[_0x462e('0xa')][_0x462e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x120781,_0xfe5c34,_0x1e4ed9){return new BPromise(function(_0x3f7340,_0x4386ef){return client[_0x462e('0xc')](_0x120781,_0x1e4ed9)[_0x462e('0xd')](function(_0x52815e){logger[_0x462e('0xe')](_0x462e('0xf'),_0xfe5c34,_0x462e('0x10'));logger[_0x462e('0x11')](_0x462e('0x12'),_0xfe5c34,_0x462e('0x10'),JSON[_0x462e('0x13')](_0x52815e));if(_0x52815e['error']){if(_0x52815e[_0x462e('0x14')]['code']===0x1f4){logger[_0x462e('0x14')](_0x462e('0xf'),_0xfe5c34,_0x52815e[_0x462e('0x14')][_0x462e('0x15')]);return _0x4386ef(_0x52815e[_0x462e('0x14')][_0x462e('0x15')]);}logger['error'](_0x462e('0xf'),_0xfe5c34,_0x52815e[_0x462e('0x14')][_0x462e('0x15')]);return _0x3f7340(_0x52815e[_0x462e('0x14')][_0x462e('0x15')]);}else{logger[_0x462e('0xe')](_0x462e('0xf'),_0xfe5c34,'request\x20sent');_0x3f7340(_0x52815e[_0x462e('0x16')]['message']);}})[_0x462e('0x17')](function(_0x3b5796){logger[_0x462e('0x14')](_0x462e('0xf'),_0xfe5c34,_0x3b5796);_0x4386ef(_0x3b5796);});});} \ No newline at end of file +var _0x7875=['http','request','then','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7875,0xa5));var _0x5787=function(_0xa67795,_0x426173){_0xa67795=_0xa67795-0x0;var _0x1e2dab=_0x7875[_0xa67795];return _0x1e2dab;};'use strict';var _=require(_0x5787('0x0'));var util=require(_0x5787('0x1'));var moment=require(_0x5787('0x2'));var BPromise=require(_0x5787('0x3'));var rs=require(_0x5787('0x4'));var fs=require('fs');var Redis=require(_0x5787('0x5'));var db=require(_0x5787('0x6'))['db'];var utils=require(_0x5787('0x7'));var logger=require(_0x5787('0x8'))(_0x5787('0x9'));var config=require('../../config/environment');var jayson=require(_0x5787('0xa'));var client=jayson['client'][_0x5787('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ceb4b,_0x3d4635,_0x318ef1){return new BPromise(function(_0x3291ee,_0x466db1){return client[_0x5787('0xc')](_0x5ceb4b,_0x318ef1)[_0x5787('0xd')](function(_0x4759b4){logger['info'](_0x5787('0xe'),_0x3d4635,'request\x20sent');logger[_0x5787('0xf')](_0x5787('0x10'),_0x3d4635,'request\x20sent',JSON[_0x5787('0x11')](_0x4759b4));if(_0x4759b4[_0x5787('0x12')]){if(_0x4759b4[_0x5787('0x12')][_0x5787('0x13')]===0x1f4){logger[_0x5787('0x12')](_0x5787('0xe'),_0x3d4635,_0x4759b4['error']['message']);return _0x466db1(_0x4759b4[_0x5787('0x12')]['message']);}logger[_0x5787('0x12')](_0x5787('0xe'),_0x3d4635,_0x4759b4[_0x5787('0x12')]['message']);return _0x3291ee(_0x4759b4[_0x5787('0x12')]['message']);}else{logger['info'](_0x5787('0xe'),_0x3d4635,_0x5787('0x14'));_0x3291ee(_0x4759b4[_0x5787('0x15')]['message']);}})['catch'](function(_0x977dfb){logger['error'](_0x5787('0xe'),_0x3d4635,_0x977dfb);_0x466db1(_0x977dfb);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index e20bcb4..797cfad 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(_0x286000,_0x5beec5){var _0x595175=function(_0x20814d){while(--_0x20814d){_0x286000['push'](_0x286000['shift']());}};_0x595175(++_0x5beec5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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(_0x278b14,_0x1c7f40){var _0x55d763=function(_0x3c6242){while(--_0x3c6242){_0x278b14['push'](_0x278b14['shift']());}};_0x55d763(++_0x1c7f40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 cadb242..9d25777 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 _0xd732=['STRING','TEXT','sequelize'];(function(_0x4f48db,_0x286e17){var _0x5bae78=function(_0x33f117){while(--_0x33f117){_0x4f48db['push'](_0x4f48db['shift']());}};_0x5bae78(++_0x286e17);}(_0xd732,0x18e));var _0x2d73=function(_0x3e21a7,_0x3a488b){_0x3e21a7=_0x3e21a7-0x0;var _0x2c1c58=_0xd732[_0x3e21a7];return _0x2c1c58;};'use strict';var Sequelize=require(_0x2d73('0x0'));module['exports']={'name':{'type':Sequelize[_0x2d73('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x2d73('0x2')]},'description':{'type':Sequelize[_0x2d73('0x1')]}}; \ No newline at end of file +var _0xc901=['STRING','sequelize','TEXT'];(function(_0x54e4fd,_0x3b12df){var _0x338727=function(_0x27400d){while(--_0x27400d){_0x54e4fd['push'](_0x54e4fd['shift']());}};_0x338727(++_0x3b12df);}(_0xc901,0x142));var _0x1c90=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc901[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x1c90('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1c90('0x1')]},'description':{'type':Sequelize[_0x1c90('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 328a305..ecdc2fb 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x27bd2c,_0x24bd98){var _0x3784ea=function(_0x4ca802){while(--_0x4ca802){_0x27bd2c['push'](_0x27bd2c['shift']());}};_0x3784ea(++_0x24bd98);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file +var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x3baecb,_0x4d1a67){var _0x413b0f=function(_0x2da0ba){while(--_0x2da0ba){_0x3baecb['push'](_0x3baecb['shift']());}};_0x413b0f(++_0x4d1a67);}(_0x425d,0x1e0));var _0xd425=function(_0x639fd7,_0x2d4036){_0x639fd7=_0x639fd7-0x0;var _0x5b5c1a=_0x425d[_0x639fd7];return _0x5b5c1a;};'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'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 42cedbd..0a9dea7 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 _0x7163=['lodash','api','moment','bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x7163,0x1ef));var _0x3716=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x7163[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x3716('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3716('0x1'));var moment=require(_0x3716('0x2'));var BPromise=require(_0x3716('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3716('0x4'));var rimraf=require(_0x3716('0x5'));var config=require(_0x3716('0x6'));var attributes=require(_0x3716('0x7'));module['exports']=function(_0x5c81bb,_0x3112a7){return _0x5c81bb[_0x3716('0x8')](_0x3716('0x9'),attributes,{'tableName':_0x3716('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd072=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd072,0x132));var _0x2d07=function(_0x474a01,_0x31bbf4){_0x474a01=_0x474a01-0x0;var _0x2c4c24=_0xd072[_0x474a01];return _0x2c4c24;};'use strict';var _=require(_0x2d07('0x0'));var util=require(_0x2d07('0x1'));var logger=require(_0x2d07('0x2'))(_0x2d07('0x3'));var moment=require(_0x2d07('0x4'));var BPromise=require(_0x2d07('0x5'));var rp=require(_0x2d07('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2d07('0x7'));var config=require(_0x2d07('0x8'));var attributes=require(_0x2d07('0x9'));module[_0x2d07('0xa')]=function(_0x34731c,_0x51aae0){return _0x34731c[_0x2d07('0xb')](_0x2d07('0xc'),attributes,{'tableName':_0x2d07('0xd'),'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 4d829b9..195fff6 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 _0x580e=['then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xbfddad,_0x6fcbe7){var _0x310353=function(_0x3fcd1d){while(--_0x3fcd1d){_0xbfddad['push'](_0xbfddad['shift']());}};_0x310353(++_0x6fcbe7);}(_0x580e,0x1a9));var _0xe580=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x580e[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xe580('0x0'));var util=require(_0xe580('0x1'));var moment=require('moment');var BPromise=require(_0xe580('0x2'));var rs=require(_0xe580('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe580('0x4'))['db'];var utils=require(_0xe580('0x5'));var logger=require(_0xe580('0x6'))(_0xe580('0x7'));var config=require(_0xe580('0x8'));var jayson=require(_0xe580('0x9'));var client=jayson[_0xe580('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x227d0b,_0x5eafc2,_0x580f4d){return new BPromise(function(_0x418e9f,_0x505203){return client[_0xe580('0xb')](_0x227d0b,_0x580f4d)[_0xe580('0xc')](function(_0x2d9777){logger['info'](_0xe580('0xd'),_0x5eafc2,_0xe580('0xe'));logger[_0xe580('0xf')](_0xe580('0x10'),_0x5eafc2,_0xe580('0xe'),JSON[_0xe580('0x11')](_0x2d9777));if(_0x2d9777[_0xe580('0x12')]){if(_0x2d9777[_0xe580('0x12')]['code']===0x1f4){logger[_0xe580('0x12')](_0xe580('0xd'),_0x5eafc2,_0x2d9777[_0xe580('0x12')][_0xe580('0x13')]);return _0x505203(_0x2d9777[_0xe580('0x12')][_0xe580('0x13')]);}logger[_0xe580('0x12')](_0xe580('0xd'),_0x5eafc2,_0x2d9777[_0xe580('0x12')][_0xe580('0x13')]);return _0x418e9f(_0x2d9777[_0xe580('0x12')][_0xe580('0x13')]);}else{logger[_0xe580('0x14')](_0xe580('0xd'),_0x5eafc2,'request\x20sent');_0x418e9f(_0x2d9777[_0xe580('0x15')][_0xe580('0x13')]);}})[_0xe580('0x16')](function(_0x13b0f6){logger['error'](_0xe580('0xd'),_0x5eafc2,_0x13b0f6);_0x505203(_0x13b0f6);});});} \ No newline at end of file +var _0xb2b9=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','moment','bluebird','randomstring','ioredis'];(function(_0x3520a3,_0x585b4e){var _0x266257=function(_0x4d763a){while(--_0x4d763a){_0x3520a3['push'](_0x3520a3['shift']());}};_0x266257(++_0x585b4e);}(_0xb2b9,0x1c4));var _0x9b2b=function(_0x3677e6,_0x1011d1){_0x3677e6=_0x3677e6-0x0;var _0x4c7d25=_0xb2b9[_0x3677e6];return _0x4c7d25;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9b2b('0x0'));var BPromise=require(_0x9b2b('0x1'));var rs=require(_0x9b2b('0x2'));var fs=require('fs');var Redis=require(_0x9b2b('0x3'));var db=require(_0x9b2b('0x4'))['db'];var utils=require(_0x9b2b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9b2b('0x6'));var jayson=require(_0x9b2b('0x7'));var client=jayson['client'][_0x9b2b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45c875,_0x3ca670,_0x1218b4){return new BPromise(function(_0x2b889f,_0x5373fd){return client[_0x9b2b('0x9')](_0x45c875,_0x1218b4)[_0x9b2b('0xa')](function(_0x3a56bf){logger['info'](_0x9b2b('0xb'),_0x3ca670,_0x9b2b('0xc'));logger[_0x9b2b('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x3ca670,_0x9b2b('0xc'),JSON[_0x9b2b('0xe')](_0x3a56bf));if(_0x3a56bf[_0x9b2b('0xf')]){if(_0x3a56bf[_0x9b2b('0xf')]['code']===0x1f4){logger[_0x9b2b('0xf')](_0x9b2b('0xb'),_0x3ca670,_0x3a56bf[_0x9b2b('0xf')][_0x9b2b('0x10')]);return _0x5373fd(_0x3a56bf[_0x9b2b('0xf')][_0x9b2b('0x10')]);}logger['error'](_0x9b2b('0xb'),_0x3ca670,_0x3a56bf['error']['message']);return _0x2b889f(_0x3a56bf[_0x9b2b('0xf')]['message']);}else{logger[_0x9b2b('0x11')](_0x9b2b('0xb'),_0x3ca670,_0x9b2b('0xc'));_0x2b889f(_0x3a56bf[_0x9b2b('0x12')][_0x9b2b('0x10')]);}})['catch'](function(_0x2ae114){logger['error'](_0x9b2b('0xb'),_0x3ca670,_0x2ae114);_0x5373fd(_0x2ae114);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 463efab..a991084 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 _0x7266=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util'];(function(_0x868b7c,_0xfa438b){var _0x21683c=function(_0x21bc66){while(--_0x21bc66){_0x868b7c['push'](_0x868b7c['shift']());}};_0x21683c(++_0xfa438b);}(_0x7266,0xec));var _0x6726=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x7266[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x6726('0x0'));var util=require(_0x6726('0x1'));var path=require(_0x6726('0x2'));var timeout=require(_0x6726('0x3'));var express=require(_0x6726('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6726('0x5'));var interaction=require(_0x6726('0x6'));var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x6726('0x7')]('/',auth[_0x6726('0x8')](),controller[_0x6726('0x9')]);router[_0x6726('0x7')](_0x6726('0xa'),auth[_0x6726('0x8')](),controller[_0x6726('0xb')]);router[_0x6726('0xc')]('/',auth[_0x6726('0x8')](),controller[_0x6726('0xd')]);router[_0x6726('0xe')](_0x6726('0xa'),auth[_0x6726('0x8')](),controller['update']);router[_0x6726('0xf')](_0x6726('0xa'),auth[_0x6726('0x8')](),controller[_0x6726('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9a22=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','put','update'];(function(_0x58a641,_0xcadf82){var _0xa3fed0=function(_0x15c87d){while(--_0x15c87d){_0x58a641['push'](_0x58a641['shift']());}};_0xa3fed0(++_0xcadf82);}(_0x9a22,0x75));var _0x29a2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9a22[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x29a2('0x0'));var util=require(_0x29a2('0x1'));var path=require(_0x29a2('0x2'));var timeout=require(_0x29a2('0x3'));var express=require(_0x29a2('0x4'));var router=express[_0x29a2('0x5')]();var fs_extra=require(_0x29a2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29a2('0x7'));var controller=require(_0x29a2('0x8'));router[_0x29a2('0x9')]('/',auth[_0x29a2('0xa')](),controller[_0x29a2('0xb')]);router[_0x29a2('0x9')](_0x29a2('0xc'),auth[_0x29a2('0xa')](),controller['show']);router[_0x29a2('0xd')]('/',auth[_0x29a2('0xa')](),controller['create']);router[_0x29a2('0xe')](_0x29a2('0xc'),auth['isAuthenticated'](),controller[_0x29a2('0xf')]);router[_0x29a2('0x10')]('/:id',auth[_0x29a2('0xa')](),controller[_0x29a2('0x11')]);module[_0x29a2('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index cdf8c4c..90a9e02 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 _0xf2c6=['exports','TEXT','sequelize'];(function(_0xaa1aa0,_0xee3741){var _0x37b575=function(_0x257d6f){while(--_0x257d6f){_0xaa1aa0['push'](_0xaa1aa0['shift']());}};_0x37b575(++_0xee3741);}(_0xf2c6,0x191));var _0x6f2c=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xf2c6[_0x4b174a];return _0x3cd7bf;};'use strict';var Sequelize=require(_0x6f2c('0x0'));module[_0x6f2c('0x1')]={'tree':{'type':Sequelize[_0x6f2c('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd4a0=['exports','sequelize'];(function(_0x4afe05,_0x277d1b){var _0x425b5a=function(_0x51ab60){while(--_0x51ab60){_0x4afe05['push'](_0x4afe05['shift']());}};_0x425b5a(++_0x277d1b);}(_0xd4a0,0x15b));var _0x0d4a=function(_0x2c4f04,_0x1cecd2){_0x2c4f04=_0x2c4f04-0x0;var _0x44f32b=_0xd4a0[_0x2c4f04];return _0x44f32b;};'use strict';var Sequelize=require(_0x0d4a('0x0'));module[_0x0d4a('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 59e73cc..5d7cc41 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 _0xd3c7=['sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','path'];(function(_0x321eef,_0x5b6d23){var _0x287294=function(_0x438248){while(--_0x438248){_0x321eef['push'](_0x321eef['shift']());}};_0x287294(++_0x5b6d23);}(_0xd3c7,0x16c));var _0x7d3c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd3c7[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x7d3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d3c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7d3c('0x2'));var BPromise=require(_0x7d3c('0x3'));var Mustache=require(_0x7d3c('0x4'));var util=require('util');var path=require(_0x7d3c('0x5'));var sox=require(_0x7d3c('0x6'));var csv=require(_0x7d3c('0x7'));var ejs=require(_0x7d3c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d3c('0x9'));var squel=require(_0x7d3c('0xa'));var crypto=require(_0x7d3c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7d3c('0x7'));var querystring=require(_0x7d3c('0xc'));var Papa=require(_0x7d3c('0xd'));var Redis=require(_0x7d3c('0xe'));var authService=require(_0x7d3c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7d3c('0x10'));var hardwareService=require(_0x7d3c('0x11'));var logger=require(_0x7d3c('0x12'))(_0x7d3c('0x13'));var utils=require(_0x7d3c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7d3c('0x15'));var db=require(_0x7d3c('0x16'))['db'];function respondWithStatusCode(_0xdcb026,_0x540ad7){_0x540ad7=_0x540ad7||0xcc;return function(_0x3f9d3c){if(_0x3f9d3c){return _0xdcb026[_0x7d3c('0x17')](_0x540ad7);}return _0xdcb026['status'](_0x540ad7)[_0x7d3c('0x18')]();};}function respondWithResult(_0x17fd40,_0x15f59b){_0x15f59b=_0x15f59b||0xc8;return function(_0x3d5827){if(_0x3d5827){return _0x17fd40[_0x7d3c('0x19')](_0x15f59b)['json'](_0x3d5827);}};}function respondWithFilteredResult(_0x453bca,_0x5f44e7){return function(_0x536ab2){if(_0x536ab2){var _0x107b80=typeof _0x5f44e7['offset']===_0x7d3c('0x1a')&&typeof _0x5f44e7[_0x7d3c('0x1b')]===_0x7d3c('0x1a');var _0x180dd1=_0x536ab2['count'];var _0x264903=_0x107b80?0x0:_0x5f44e7[_0x7d3c('0x1c')];var _0x47e892=_0x107b80?_0x536ab2['count']:_0x5f44e7['offset']+_0x5f44e7['limit'];var _0x2630e7;if(_0x47e892>=_0x180dd1){_0x47e892=_0x180dd1;_0x2630e7=0xc8;}else{_0x2630e7=0xce;}_0x453bca[_0x7d3c('0x19')](_0x2630e7);return _0x453bca[_0x7d3c('0x1d')](_0x7d3c('0x1e'),_0x264903+'-'+_0x47e892+'/'+_0x180dd1)['json'](_0x536ab2);}return null;};}function patchUpdates(_0x578aad){return function(_0x48e0ec){try{jsonpatch[_0x7d3c('0x1f')](_0x48e0ec,_0x578aad,!![]);}catch(_0x50ebcb){return BPromise['reject'](_0x50ebcb);}return _0x48e0ec[_0x7d3c('0x20')]();};}function saveUpdates(_0x22f501,_0x490f56){return function(_0x125fec){if(_0x125fec){return _0x125fec[_0x7d3c('0x21')](_0x22f501)[_0x7d3c('0x22')](function(_0x2b7296){return _0x2b7296;});}return null;};}function removeEntity(_0x5bc8ac,_0x2bc894){return function(_0x3209b5){if(_0x3209b5){return _0x3209b5[_0x7d3c('0x23')]()[_0x7d3c('0x22')](function(){_0x5bc8ac[_0x7d3c('0x19')](0xcc)[_0x7d3c('0x18')]();});}};}function handleEntityNotFound(_0x30b3e1,_0x334db8){return function(_0x4fb016){if(!_0x4fb016){_0x30b3e1[_0x7d3c('0x17')](0x194);}return _0x4fb016;};}function handleError(_0x4d4417,_0xc03df4){_0xc03df4=_0xc03df4||0x1f4;return function(_0x8c848e){logger['error'](_0x8c848e[_0x7d3c('0x24')]);if(_0x8c848e['name']){delete _0x8c848e[_0x7d3c('0x25')];}_0x4d4417[_0x7d3c('0x19')](_0xc03df4)[_0x7d3c('0x26')](_0x8c848e);};}exports[_0x7d3c('0x27')]=function(_0x4fb39c,_0x251ba3){var _0x28cc23={},_0x33705c={},_0x1e1655={'count':0x0,'rows':[]};var _0x58c404=_[_0x7d3c('0x28')](db[_0x7d3c('0x29')][_0x7d3c('0x2a')],function(_0x158bf8){return{'name':_0x158bf8[_0x7d3c('0x2b')],'type':_0x158bf8[_0x7d3c('0x2c')][_0x7d3c('0x2d')]};});_0x33705c[_0x7d3c('0x2e')]=_[_0x7d3c('0x28')](_0x58c404,_0x7d3c('0x25'));_0x33705c[_0x7d3c('0x2f')]=_['keys'](_0x4fb39c[_0x7d3c('0x2f')]);_0x33705c[_0x7d3c('0x30')]=_[_0x7d3c('0x31')](_0x33705c[_0x7d3c('0x2e')],_0x33705c[_0x7d3c('0x2f')]);_0x28cc23['attributes']=_[_0x7d3c('0x31')](_0x33705c['model'],qs[_0x7d3c('0x32')](_0x4fb39c[_0x7d3c('0x2f')]['fields']));_0x28cc23[_0x7d3c('0x33')]=_0x28cc23['attributes'][_0x7d3c('0x34')]?_0x28cc23[_0x7d3c('0x33')]:_0x33705c[_0x7d3c('0x2e')];if(!_0x4fb39c['query'][_0x7d3c('0x35')](_0x7d3c('0x36'))){_0x28cc23['limit']=qs[_0x7d3c('0x1b')](_0x4fb39c[_0x7d3c('0x2f')]['limit']);_0x28cc23['offset']=qs['offset'](_0x4fb39c[_0x7d3c('0x2f')][_0x7d3c('0x1c')]);}_0x28cc23[_0x7d3c('0x37')]=qs['sort'](_0x4fb39c[_0x7d3c('0x2f')][_0x7d3c('0x38')]);_0x28cc23[_0x7d3c('0x39')]=qs['filters'](_[_0x7d3c('0x3a')](_0x4fb39c[_0x7d3c('0x2f')],_0x33705c[_0x7d3c('0x30')]),_0x58c404);if(_0x4fb39c['query']['filter']){_0x28cc23['where']=_[_0x7d3c('0x3b')](_0x28cc23[_0x7d3c('0x39')],{'$or':_[_0x7d3c('0x28')](_0x58c404,function(_0x543c12){if(_0x543c12[_0x7d3c('0x2c')]!==_0x7d3c('0x3c')){var _0x2f397f={};_0x2f397f[_0x543c12[_0x7d3c('0x25')]]={'$like':'%'+_0x4fb39c[_0x7d3c('0x2f')]['filter']+'%'};return _0x2f397f;}})});}_0x28cc23=_[_0x7d3c('0x3b')]({},_0x28cc23,_0x4fb39c[_0x7d3c('0x3d')]);var _0x514d40={'where':_0x28cc23[_0x7d3c('0x39')]};return db[_0x7d3c('0x29')]['count'](_0x514d40)[_0x7d3c('0x22')](function(_0xe79bbb){_0x1e1655[_0x7d3c('0x3e')]=_0xe79bbb;if(_0x4fb39c['query'][_0x7d3c('0x3f')]){_0x28cc23[_0x7d3c('0x40')]=[{'all':!![]}];}return db[_0x7d3c('0x29')][_0x7d3c('0x41')](_0x28cc23);})['then'](function(_0x44baa6){_0x1e1655[_0x7d3c('0x42')]=_0x44baa6;return _0x1e1655;})['then'](respondWithFilteredResult(_0x251ba3,_0x28cc23))[_0x7d3c('0x43')](handleError(_0x251ba3,null));};exports[_0x7d3c('0x44')]=function(_0x2b9dfb,_0x4df22a){var _0x2b8c87={'raw':!![],'where':{'id':_0x2b9dfb[_0x7d3c('0x45')]['id']}},_0x516c49={};_0x516c49[_0x7d3c('0x2e')]=_[_0x7d3c('0x46')](db[_0x7d3c('0x29')]['rawAttributes']);_0x516c49[_0x7d3c('0x2f')]=_[_0x7d3c('0x46')](_0x2b9dfb[_0x7d3c('0x2f')]);_0x516c49[_0x7d3c('0x30')]=_[_0x7d3c('0x31')](_0x516c49[_0x7d3c('0x2e')],_0x516c49[_0x7d3c('0x2f')]);_0x2b8c87[_0x7d3c('0x33')]=_[_0x7d3c('0x31')](_0x516c49[_0x7d3c('0x2e')],qs[_0x7d3c('0x32')](_0x2b9dfb[_0x7d3c('0x2f')]['fields']));_0x2b8c87[_0x7d3c('0x33')]=_0x2b8c87['attributes']['length']?_0x2b8c87[_0x7d3c('0x33')]:_0x516c49['model'];if(_0x2b9dfb[_0x7d3c('0x2f')][_0x7d3c('0x3f')]){_0x2b8c87[_0x7d3c('0x40')]=[{'all':!![]}];}_0x2b8c87=_['merge']({},_0x2b8c87,_0x2b9dfb[_0x7d3c('0x3d')]);return db[_0x7d3c('0x29')][_0x7d3c('0x47')](_0x2b8c87)[_0x7d3c('0x22')](handleEntityNotFound(_0x4df22a,null))[_0x7d3c('0x22')](respondWithResult(_0x4df22a,null))[_0x7d3c('0x43')](handleError(_0x4df22a,null));};exports[_0x7d3c('0x48')]=function(_0x124e88,_0x234194){return db[_0x7d3c('0x29')][_0x7d3c('0x48')](_0x124e88[_0x7d3c('0x49')],{})[_0x7d3c('0x22')](respondWithResult(_0x234194,0xc9))[_0x7d3c('0x43')](handleError(_0x234194,null));};exports[_0x7d3c('0x21')]=function(_0x31a66a,_0x2b1af1){if(_0x31a66a['body']['id']){delete _0x31a66a[_0x7d3c('0x49')]['id'];}return db[_0x7d3c('0x29')][_0x7d3c('0x47')]({'where':{'id':_0x31a66a[_0x7d3c('0x45')]['id']}})[_0x7d3c('0x22')](handleEntityNotFound(_0x2b1af1,null))[_0x7d3c('0x22')](saveUpdates(_0x31a66a[_0x7d3c('0x49')],null))[_0x7d3c('0x22')](respondWithResult(_0x2b1af1,null))[_0x7d3c('0x43')](handleError(_0x2b1af1,null));};exports['destroy']=function(_0x3b4120,_0x1b4c56){return db[_0x7d3c('0x29')][_0x7d3c('0x47')]({'where':{'id':_0x3b4120['params']['id']}})[_0x7d3c('0x22')](handleEntityNotFound(_0x1b4c56,null))[_0x7d3c('0x22')](removeEntity(_0x1b4c56,null))[_0x7d3c('0x43')](handleError(_0x1b4c56,null));}; \ No newline at end of file +var _0x02ad=['apply','save','update','then','destroy','end','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','options','includeAll','catch','show','params','keys','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x400ff6,_0x5536b5){var _0x1c386c=function(_0x4a588c){while(--_0x4a588c){_0x400ff6['push'](_0x400ff6['shift']());}};_0x1c386c(++_0x5536b5);}(_0x02ad,0x1ca));var _0xd02a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x02ad[_0x21549c];return _0x426cbd;};'use strict';var emlformat=require(_0xd02a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd02a('0x1'));var jsonpatch=require(_0xd02a('0x2'));var rp=require(_0xd02a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd02a('0x4'));var util=require(_0xd02a('0x5'));var path=require('path');var sox=require(_0xd02a('0x6'));var csv=require(_0xd02a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd02a('0x8'));var _=require(_0xd02a('0x9'));var squel=require('squel');var crypto=require(_0xd02a('0xa'));var jsforce=require(_0xd02a('0xb'));var deskjs=require(_0xd02a('0xc'));var toCsv=require(_0xd02a('0x7'));var querystring=require('querystring');var Papa=require(_0xd02a('0xd'));var Redis=require(_0xd02a('0xe'));var authService=require(_0xd02a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd02a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd02a('0x11'))(_0xd02a('0x12'));var utils=require(_0xd02a('0x13'));var config=require(_0xd02a('0x14'));var licenseUtil=require(_0xd02a('0x15'));var db=require(_0xd02a('0x16'))['db'];function respondWithStatusCode(_0x577130,_0x37ac21){_0x37ac21=_0x37ac21||0xcc;return function(_0x71663){if(_0x71663){return _0x577130[_0xd02a('0x17')](_0x37ac21);}return _0x577130[_0xd02a('0x18')](_0x37ac21)['end']();};}function respondWithResult(_0x12103d,_0x210eda){_0x210eda=_0x210eda||0xc8;return function(_0x110d6a){if(_0x110d6a){return _0x12103d[_0xd02a('0x18')](_0x210eda)[_0xd02a('0x19')](_0x110d6a);}};}function respondWithFilteredResult(_0x207883,_0x4e8a99){return function(_0x9c1dc8){if(_0x9c1dc8){var _0x3794c5=typeof _0x4e8a99[_0xd02a('0x1a')]===_0xd02a('0x1b')&&typeof _0x4e8a99[_0xd02a('0x1c')]===_0xd02a('0x1b');var _0x5d0542=_0x9c1dc8[_0xd02a('0x1d')];var _0x17a9a1=_0x3794c5?0x0:_0x4e8a99[_0xd02a('0x1a')];var _0x3764af=_0x3794c5?_0x9c1dc8[_0xd02a('0x1d')]:_0x4e8a99[_0xd02a('0x1a')]+_0x4e8a99[_0xd02a('0x1c')];var _0x20a2fc;if(_0x3764af>=_0x5d0542){_0x3764af=_0x5d0542;_0x20a2fc=0xc8;}else{_0x20a2fc=0xce;}_0x207883['status'](_0x20a2fc);return _0x207883[_0xd02a('0x1e')](_0xd02a('0x1f'),_0x17a9a1+'-'+_0x3764af+'/'+_0x5d0542)[_0xd02a('0x19')](_0x9c1dc8);}return null;};}function patchUpdates(_0x36bb5c){return function(_0x508515){try{jsonpatch[_0xd02a('0x20')](_0x508515,_0x36bb5c,!![]);}catch(_0x4e433e){return BPromise['reject'](_0x4e433e);}return _0x508515[_0xd02a('0x21')]();};}function saveUpdates(_0x42c133,_0x363105){return function(_0x48ec0e){if(_0x48ec0e){return _0x48ec0e[_0xd02a('0x22')](_0x42c133)[_0xd02a('0x23')](function(_0x3050b4){return _0x3050b4;});}return null;};}function removeEntity(_0x191d59,_0x1fa43c){return function(_0x42f91e){if(_0x42f91e){return _0x42f91e[_0xd02a('0x24')]()[_0xd02a('0x23')](function(){_0x191d59['status'](0xcc)[_0xd02a('0x25')]();});}};}function handleEntityNotFound(_0xbe53b4,_0x384f8e){return function(_0x5c2166){if(!_0x5c2166){_0xbe53b4['sendStatus'](0x194);}return _0x5c2166;};}function handleError(_0x1e9712,_0x490f3a){_0x490f3a=_0x490f3a||0x1f4;return function(_0x177f7f){logger[_0xd02a('0x26')](_0x177f7f['stack']);if(_0x177f7f['name']){delete _0x177f7f[_0xd02a('0x27')];}_0x1e9712['status'](_0x490f3a)[_0xd02a('0x28')](_0x177f7f);};}exports[_0xd02a('0x29')]=function(_0x1d2f81,_0x5577d8){var _0x1a6215={},_0x19023c={},_0x1fcb07={'count':0x0,'rows':[]};var _0xb56f25=_[_0xd02a('0x2a')](db[_0xd02a('0x2b')][_0xd02a('0x2c')],function(_0x9a2c73){return{'name':_0x9a2c73[_0xd02a('0x2d')],'type':_0x9a2c73[_0xd02a('0x2e')][_0xd02a('0x2f')]};});_0x19023c[_0xd02a('0x30')]=_[_0xd02a('0x2a')](_0xb56f25,_0xd02a('0x27'));_0x19023c['query']=_['keys'](_0x1d2f81[_0xd02a('0x31')]);_0x19023c['filters']=_['intersection'](_0x19023c[_0xd02a('0x30')],_0x19023c[_0xd02a('0x31')]);_0x1a6215[_0xd02a('0x32')]=_[_0xd02a('0x33')](_0x19023c[_0xd02a('0x30')],qs['fields'](_0x1d2f81[_0xd02a('0x31')][_0xd02a('0x34')]));_0x1a6215[_0xd02a('0x32')]=_0x1a6215[_0xd02a('0x32')][_0xd02a('0x35')]?_0x1a6215[_0xd02a('0x32')]:_0x19023c[_0xd02a('0x30')];if(!_0x1d2f81[_0xd02a('0x31')][_0xd02a('0x36')]('nolimit')){_0x1a6215[_0xd02a('0x1c')]=qs[_0xd02a('0x1c')](_0x1d2f81[_0xd02a('0x31')]['limit']);_0x1a6215['offset']=qs[_0xd02a('0x1a')](_0x1d2f81[_0xd02a('0x31')][_0xd02a('0x1a')]);}_0x1a6215['order']=qs[_0xd02a('0x37')](_0x1d2f81[_0xd02a('0x31')][_0xd02a('0x37')]);_0x1a6215[_0xd02a('0x38')]=qs['filters'](_[_0xd02a('0x39')](_0x1d2f81[_0xd02a('0x31')],_0x19023c[_0xd02a('0x3a')]),_0xb56f25);if(_0x1d2f81[_0xd02a('0x31')][_0xd02a('0x3b')]){_0x1a6215['where']=_['merge'](_0x1a6215[_0xd02a('0x38')],{'$or':_[_0xd02a('0x2a')](_0xb56f25,function(_0x377577){if(_0x377577[_0xd02a('0x2e')]!=='VIRTUAL'){var _0x532655={};_0x532655[_0x377577[_0xd02a('0x27')]]={'$like':'%'+_0x1d2f81[_0xd02a('0x31')]['filter']+'%'};return _0x532655;}})});}_0x1a6215=_[_0xd02a('0x3c')]({},_0x1a6215,_0x1d2f81[_0xd02a('0x3d')]);var _0x5942b8={'where':_0x1a6215['where']};return db[_0xd02a('0x2b')][_0xd02a('0x1d')](_0x5942b8)[_0xd02a('0x23')](function(_0x5c068b){_0x1fcb07[_0xd02a('0x1d')]=_0x5c068b;if(_0x1d2f81[_0xd02a('0x31')][_0xd02a('0x3e')]){_0x1a6215['include']=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x1a6215);})[_0xd02a('0x23')](function(_0x2cbc91){_0x1fcb07['rows']=_0x2cbc91;return _0x1fcb07;})[_0xd02a('0x23')](respondWithFilteredResult(_0x5577d8,_0x1a6215))[_0xd02a('0x3f')](handleError(_0x5577d8,null));};exports[_0xd02a('0x40')]=function(_0x2d940c,_0x3a2cd7){var _0x5ed9af={'raw':!![],'where':{'id':_0x2d940c[_0xd02a('0x41')]['id']}},_0x5042bd={};_0x5042bd[_0xd02a('0x30')]=_[_0xd02a('0x42')](db[_0xd02a('0x2b')][_0xd02a('0x2c')]);_0x5042bd['query']=_[_0xd02a('0x42')](_0x2d940c[_0xd02a('0x31')]);_0x5042bd['filters']=_['intersection'](_0x5042bd[_0xd02a('0x30')],_0x5042bd[_0xd02a('0x31')]);_0x5ed9af['attributes']=_[_0xd02a('0x33')](_0x5042bd[_0xd02a('0x30')],qs[_0xd02a('0x34')](_0x2d940c[_0xd02a('0x31')][_0xd02a('0x34')]));_0x5ed9af[_0xd02a('0x32')]=_0x5ed9af[_0xd02a('0x32')][_0xd02a('0x35')]?_0x5ed9af['attributes']:_0x5042bd[_0xd02a('0x30')];if(_0x2d940c[_0xd02a('0x31')][_0xd02a('0x3e')]){_0x5ed9af['include']=[{'all':!![]}];}_0x5ed9af=_[_0xd02a('0x3c')]({},_0x5ed9af,_0x2d940c[_0xd02a('0x3d')]);return db[_0xd02a('0x2b')][_0xd02a('0x43')](_0x5ed9af)['then'](handleEntityNotFound(_0x3a2cd7,null))['then'](respondWithResult(_0x3a2cd7,null))['catch'](handleError(_0x3a2cd7,null));};exports[_0xd02a('0x44')]=function(_0x2feb97,_0x74c562){return db[_0xd02a('0x2b')][_0xd02a('0x44')](_0x2feb97['body'],{})['then'](respondWithResult(_0x74c562,0xc9))[_0xd02a('0x3f')](handleError(_0x74c562,null));};exports[_0xd02a('0x22')]=function(_0x1e8170,_0x400ca7){if(_0x1e8170[_0xd02a('0x45')]['id']){delete _0x1e8170[_0xd02a('0x45')]['id'];}return db[_0xd02a('0x2b')][_0xd02a('0x43')]({'where':{'id':_0x1e8170[_0xd02a('0x41')]['id']}})[_0xd02a('0x23')](handleEntityNotFound(_0x400ca7,null))[_0xd02a('0x23')](saveUpdates(_0x1e8170[_0xd02a('0x45')],null))['then'](respondWithResult(_0x400ca7,null))['catch'](handleError(_0x400ca7,null));};exports[_0xd02a('0x24')]=function(_0x1826ad,_0x2eb5b6){return db[_0xd02a('0x2b')]['find']({'where':{'id':_0x1826ad[_0xd02a('0x41')]['id']}})[_0xd02a('0x23')](handleEntityNotFound(_0x2eb5b6,null))['then'](removeEntity(_0x2eb5b6,null))['catch'](handleError(_0x2eb5b6,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index abce4b7..571a77b 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 _0x93f2=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x37c545,_0x1d0103){var _0x34a7a5=function(_0x43edfb){while(--_0x43edfb){_0x37c545['push'](_0x37c545['shift']());}};_0x34a7a5(++_0x1d0103);}(_0x93f2,0x1cf));var _0x293f=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x93f2[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x293f('0x0'));var util=require(_0x293f('0x1'));var logger=require(_0x293f('0x2'))(_0x293f('0x3'));var moment=require(_0x293f('0x4'));var BPromise=require(_0x293f('0x5'));var rp=require(_0x293f('0x6'));var fs=require('fs');var path=require(_0x293f('0x7'));var rimraf=require(_0x293f('0x8'));var config=require(_0x293f('0x9'));var attributes=require(_0x293f('0xa'));module[_0x293f('0xb')]=function(_0x4ef098,_0x5de148){return _0x4ef098[_0x293f('0xc')](_0x293f('0xd'),attributes,{'tableName':_0x293f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd22f=['path','rimraf','define','analytics_report_trees','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xf7ee71,_0x786ff4){var _0x2341d3=function(_0x132fee){while(--_0x132fee){_0xf7ee71['push'](_0xf7ee71['shift']());}};_0x2341d3(++_0x786ff4);}(_0xd22f,0x1e4));var _0xfd22=function(_0x5be509,_0x41d6fd){_0x5be509=_0x5be509-0x0;var _0x35a415=_0xd22f[_0x5be509];return _0x35a415;};'use strict';var _=require(_0xfd22('0x0'));var util=require(_0xfd22('0x1'));var logger=require(_0xfd22('0x2'))(_0xfd22('0x3'));var moment=require(_0xfd22('0x4'));var BPromise=require(_0xfd22('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd22('0x6'));var rimraf=require(_0xfd22('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x4c86b4,_0x17c577){return _0x4c86b4[_0xfd22('0x8')]('AnalyticTreeReport',attributes,{'tableName':_0xfd22('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 7bf77e2..65e7842 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4e9e24,_0x34b638){var _0x3ef905=function(_0x479207){while(--_0x479207){_0x4e9e24['push'](_0x4e9e24['shift']());}};_0x3ef905(++_0x34b638);}(_0x2ef3,0xba));var _0x32ef=function(_0x1c87e2,_0x57ffb0){_0x1c87e2=_0x1c87e2-0x0;var _0x32b417=_0x2ef3[_0x1c87e2];return _0x32b417;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +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(_0x2297b5,_0x4f6798){var _0x1ee0d6=function(_0x3f93d1){while(--_0x3f93d1){_0x2297b5['push'](_0x2297b5['shift']());}};_0x1ee0d6(++_0x4f6798);}(_0x5f2f,0x73));var _0xf5f2=function(_0x454ecd,_0x1d6c43){_0x454ecd=_0x454ecd-0x0;var _0x1cc66b=_0x5f2f[_0x454ecd];return _0x1cc66b;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 0422096..8d38acd 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 _0x7cb0=['./analyticTreeReport.controller','get','show','post','isAuthenticated','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x24ad48,_0x31c1d6){var _0x6b5cc1=function(_0x597f57){while(--_0x597f57){_0x24ad48['push'](_0x24ad48['shift']());}};_0x6b5cc1(++_0x31c1d6);}(_0x7cb0,0x7d));var _0x07cb=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0x7cb0[_0xea35d1];return _0x1d7a7c;};'use strict';var multer=require(_0x07cb('0x0'));var util=require(_0x07cb('0x1'));var path=require(_0x07cb('0x2'));var timeout=require(_0x07cb('0x3'));var express=require(_0x07cb('0x4'));var router=express[_0x07cb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x07cb('0x6'));var config=require(_0x07cb('0x7'));var controller=require(_0x07cb('0x8'));router[_0x07cb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x07cb('0xa')]);router[_0x07cb('0xb')]('/',auth[_0x07cb('0xc')](),controller[_0x07cb('0xd')]);router['put']('/:id',auth[_0x07cb('0xc')](),controller[_0x07cb('0xe')]);router[_0x07cb('0xf')](_0x07cb('0x10'),auth[_0x07cb('0xc')](),controller[_0x07cb('0x11')]);module[_0x07cb('0x12')]=router; \ No newline at end of file +var _0xc492=['post','create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0xc492,0x1ba));var _0x2c49=function(_0x2faa36,_0x39262d){_0x2faa36=_0x2faa36-0x0;var _0x30068d=_0xc492[_0x2faa36];return _0x30068d;};'use strict';var multer=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var path=require(_0x2c49('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c49('0x3'));var router=express[_0x2c49('0x4')]();var fs_extra=require(_0x2c49('0x5'));var auth=require(_0x2c49('0x6'));var interaction=require(_0x2c49('0x7'));var config=require('../../config/environment');var controller=require(_0x2c49('0x8'));router[_0x2c49('0x9')]('/',auth[_0x2c49('0xa')](),controller[_0x2c49('0xb')]);router['get'](_0x2c49('0xc'),auth[_0x2c49('0xa')](),controller[_0x2c49('0xd')]);router[_0x2c49('0xe')]('/',auth[_0x2c49('0xa')](),controller[_0x2c49('0xf')]);router[_0x2c49('0x10')](_0x2c49('0xc'),auth[_0x2c49('0xa')](),controller['update']);router[_0x2c49('0x11')](_0x2c49('0xc'),auth[_0x2c49('0xa')](),controller[_0x2c49('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 0250320..2455310 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 _0xbdfd=['STRING','sequelize'];(function(_0x26bb3f,_0x25cd1f){var _0x2cbd3f=function(_0x297152){while(--_0x297152){_0x26bb3f['push'](_0x26bb3f['shift']());}};_0x2cbd3f(++_0x25cd1f);}(_0xbdfd,0x135));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xdbdf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xdbdf('0x1')]},'type':{'type':Sequelize[_0xdbdf('0x1')]}}; \ No newline at end of file +var _0xa98d=['STRING','sequelize'];(function(_0x5c64db,_0x3a0bd4){var _0x4975f0=function(_0x5cebed){while(--_0x5cebed){_0x5c64db['push'](_0x5c64db['shift']());}};_0x4975f0(++_0x3a0bd4);}(_0xa98d,0xa3));var _0xda98=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa98d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xda98('0x0'));module['exports']={'name':{'type':Sequelize[_0xda98('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xda98('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index bc86e73..b164386 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 _0xd0c7=['util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Attachment','fieldName','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','rawAttributes','fields','include','clone','options','find','omit','updatedAt','body','create','file','basename','mimetype','download','findOne','join','root','server/files/attachments/','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0xdf9606,_0x1f79fb){var _0x251fe6=function(_0x3aed38){while(--_0x3aed38){_0xdf9606['push'](_0xdf9606['shift']());}};_0x251fe6(++_0x1f79fb);}(_0xd0c7,0x1f2));var _0x7d0c=function(_0x1cd34b,_0x1257d4){_0x1cd34b=_0x1cd34b-0x0;var _0x3e3607=_0xd0c7[_0x1cd34b];return _0x3e3607;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d0c('0x0'));var zipdir=require(_0x7d0c('0x1'));var jsonpatch=require(_0x7d0c('0x2'));var rp=require(_0x7d0c('0x3'));var moment=require(_0x7d0c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7d0c('0x5'));var util=require(_0x7d0c('0x6'));var path=require('path');var sox=require(_0x7d0c('0x7'));var csv=require(_0x7d0c('0x8'));var ejs=require(_0x7d0c('0x9'));var fs=require('fs');var fs_extra=require(_0x7d0c('0xa'));var _=require(_0x7d0c('0xb'));var squel=require(_0x7d0c('0xc'));var crypto=require(_0x7d0c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7d0c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7d0c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d0c('0x10'));var qs=require(_0x7d0c('0x11'));var as=require(_0x7d0c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d0c('0x13'))(_0x7d0c('0x14'));var utils=require(_0x7d0c('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7d0c('0x16'));var db=require(_0x7d0c('0x17'))['db'];function respondWithStatusCode(_0x2decd6,_0x181093){_0x181093=_0x181093||0xcc;return function(_0x21933e){if(_0x21933e){return _0x2decd6['sendStatus'](_0x181093);}return _0x2decd6[_0x7d0c('0x18')](_0x181093)[_0x7d0c('0x19')]();};}function respondWithResult(_0x459709,_0x2aea68){_0x2aea68=_0x2aea68||0xc8;return function(_0x19f54e){if(_0x19f54e){return _0x459709[_0x7d0c('0x18')](_0x2aea68)[_0x7d0c('0x1a')](_0x19f54e);}};}function respondWithFilteredResult(_0x3e7ea6,_0x27b5e2){return function(_0x2cce82){if(_0x2cce82){var _0x4b992e=typeof _0x27b5e2[_0x7d0c('0x1b')]===_0x7d0c('0x1c')&&typeof _0x27b5e2['limit']===_0x7d0c('0x1c');var _0x23da44=_0x2cce82['count'];var _0x3c6bb6=_0x4b992e?0x0:_0x27b5e2['offset'];var _0x1592d0=_0x4b992e?_0x2cce82[_0x7d0c('0x1d')]:_0x27b5e2[_0x7d0c('0x1b')]+_0x27b5e2[_0x7d0c('0x1e')];var _0x288f58;if(_0x1592d0>=_0x23da44){_0x1592d0=_0x23da44;_0x288f58=0xc8;}else{_0x288f58=0xce;}_0x3e7ea6['status'](_0x288f58);return _0x3e7ea6[_0x7d0c('0x1f')](_0x7d0c('0x20'),_0x3c6bb6+'-'+_0x1592d0+'/'+_0x23da44)['json'](_0x2cce82);}return null;};}function patchUpdates(_0x55ae73){return function(_0x20a33b){try{jsonpatch[_0x7d0c('0x21')](_0x20a33b,_0x55ae73,!![]);}catch(_0x4d8a9d){return BPromise[_0x7d0c('0x22')](_0x4d8a9d);}return _0x20a33b[_0x7d0c('0x23')]();};}function saveUpdates(_0x230a41,_0x260d86){return function(_0x8b1e56){if(_0x8b1e56){return _0x8b1e56[_0x7d0c('0x24')](_0x230a41)[_0x7d0c('0x25')](function(_0x4c6c08){return _0x4c6c08;});}return null;};}function removeEntity(_0x51e149,_0x22f480){return function(_0x196cd9){if(_0x196cd9){return _0x196cd9[_0x7d0c('0x26')]()['then'](function(){_0x51e149[_0x7d0c('0x18')](0xcc)[_0x7d0c('0x19')]();});}};}function handleEntityNotFound(_0x390603,_0x1ef039){return function(_0x2a0261){if(!_0x2a0261){_0x390603['sendStatus'](0x194);}return _0x2a0261;};}function handleError(_0x2e5ae3,_0x69590f){_0x69590f=_0x69590f||0x1f4;return function(_0x2afab0){logger['error'](_0x2afab0[_0x7d0c('0x27')]);if(_0x2afab0[_0x7d0c('0x28')]){delete _0x2afab0['name'];}_0x2e5ae3['status'](_0x69590f)[_0x7d0c('0x29')](_0x2afab0);};}exports[_0x7d0c('0x2a')]=function(_0x119309,_0x2e4a81){var _0x4b3d34={},_0x30e5ad={},_0xeeed9d={'count':0x0,'rows':[]};var _0x3b52d9=_[_0x7d0c('0x2b')](db[_0x7d0c('0x2c')]['rawAttributes'],function(_0x5b3af9){return{'name':_0x5b3af9[_0x7d0c('0x2d')],'type':_0x5b3af9['type']['key']};});_0x30e5ad[_0x7d0c('0x2e')]=_[_0x7d0c('0x2b')](_0x3b52d9,'name');_0x30e5ad[_0x7d0c('0x2f')]=_[_0x7d0c('0x30')](_0x119309[_0x7d0c('0x2f')]);_0x30e5ad[_0x7d0c('0x31')]=_['intersection'](_0x30e5ad[_0x7d0c('0x2e')],_0x30e5ad[_0x7d0c('0x2f')]);_0x4b3d34[_0x7d0c('0x32')]=_[_0x7d0c('0x33')](_0x30e5ad['model'],qs['fields'](_0x119309[_0x7d0c('0x2f')]['fields']));_0x4b3d34['attributes']=_0x4b3d34[_0x7d0c('0x32')][_0x7d0c('0x34')]?_0x4b3d34[_0x7d0c('0x32')]:_0x30e5ad[_0x7d0c('0x2e')];if(!_0x119309[_0x7d0c('0x2f')][_0x7d0c('0x35')](_0x7d0c('0x36'))){_0x4b3d34['limit']=qs[_0x7d0c('0x1e')](_0x119309[_0x7d0c('0x2f')]['limit']);_0x4b3d34[_0x7d0c('0x1b')]=qs[_0x7d0c('0x1b')](_0x119309['query']['offset']);}_0x4b3d34['order']=qs[_0x7d0c('0x37')](_0x119309[_0x7d0c('0x2f')][_0x7d0c('0x37')]);_0x4b3d34['where']=qs[_0x7d0c('0x31')](_['pick'](_0x119309[_0x7d0c('0x2f')],_0x30e5ad[_0x7d0c('0x31')]),_0x3b52d9);if(_0x119309['query']['filter']){_0x4b3d34[_0x7d0c('0x38')]=_[_0x7d0c('0x39')](_0x4b3d34['where'],{'$or':_[_0x7d0c('0x2b')](_0x3b52d9,function(_0x510daf){if(_0x510daf[_0x7d0c('0x3a')]!==_0x7d0c('0x3b')){var _0x41c7b9={};_0x41c7b9[_0x510daf[_0x7d0c('0x28')]]={'$like':'%'+_0x119309[_0x7d0c('0x2f')]['filter']+'%'};return _0x41c7b9;}})});}_0x4b3d34=_[_0x7d0c('0x39')]({},_0x4b3d34,_0x119309['options']);var _0x43f1d4={'where':_0x4b3d34['where']};return db[_0x7d0c('0x2c')][_0x7d0c('0x1d')](_0x43f1d4)[_0x7d0c('0x25')](function(_0x3f9eaa){_0xeeed9d[_0x7d0c('0x1d')]=_0x3f9eaa;if(_0x119309['query'][_0x7d0c('0x3c')]){_0x4b3d34['include']=[{'all':!![]}];}return db['Attachment'][_0x7d0c('0x3d')](_0x4b3d34);})[_0x7d0c('0x25')](function(_0x19fc65){_0xeeed9d[_0x7d0c('0x3e')]=_0x19fc65;return _0xeeed9d;})[_0x7d0c('0x25')](respondWithFilteredResult(_0x2e4a81,_0x4b3d34))[_0x7d0c('0x3f')](handleError(_0x2e4a81,null));};exports[_0x7d0c('0x40')]=function(_0x47e7ff,_0x703655){var _0x283eaa={'raw':!![],'where':{'id':_0x47e7ff[_0x7d0c('0x41')]['id']}},_0x24eab3={};_0x24eab3['model']=_[_0x7d0c('0x30')](db[_0x7d0c('0x2c')][_0x7d0c('0x42')]);_0x24eab3[_0x7d0c('0x2f')]=_['keys'](_0x47e7ff[_0x7d0c('0x2f')]);_0x24eab3[_0x7d0c('0x31')]=_['intersection'](_0x24eab3[_0x7d0c('0x2e')],_0x24eab3[_0x7d0c('0x2f')]);_0x283eaa['attributes']=_[_0x7d0c('0x33')](_0x24eab3[_0x7d0c('0x2e')],qs[_0x7d0c('0x43')](_0x47e7ff[_0x7d0c('0x2f')][_0x7d0c('0x43')]));_0x283eaa['attributes']=_0x283eaa[_0x7d0c('0x32')][_0x7d0c('0x34')]?_0x283eaa[_0x7d0c('0x32')]:_0x24eab3[_0x7d0c('0x2e')];if(_0x47e7ff[_0x7d0c('0x2f')][_0x7d0c('0x3c')]){_0x283eaa[_0x7d0c('0x44')]=[{'all':!![]}];}_0x283eaa=_[_0x7d0c('0x39')]({},_0x283eaa,_0x47e7ff['options']);return db[_0x7d0c('0x2c')]['find'](_0x283eaa)[_0x7d0c('0x25')](handleEntityNotFound(_0x703655,null))['then'](respondWithResult(_0x703655,null))[_0x7d0c('0x3f')](handleError(_0x703655,null));};exports[_0x7d0c('0x45')]=function(_0x399746,_0xb77db){var _0x276410={'where':{'id':_0x399746[_0x7d0c('0x41')]['id']}},_0x1887ea={};_0x1887ea[_0x7d0c('0x2e')]=_[_0x7d0c('0x30')](db[_0x7d0c('0x2c')][_0x7d0c('0x42')]);_0x276410[_0x7d0c('0x32')]=_[_0x7d0c('0x33')](_0x1887ea['model'],qs[_0x7d0c('0x43')](_0x399746[_0x7d0c('0x2f')][_0x7d0c('0x43')]));_0x276410[_0x7d0c('0x32')]=_0x276410[_0x7d0c('0x32')][_0x7d0c('0x34')]?_0x276410[_0x7d0c('0x32')]:_0x1887ea[_0x7d0c('0x2e')];if(_0x399746[_0x7d0c('0x2f')][_0x7d0c('0x3c')]){_0x276410[_0x7d0c('0x44')]=[{'all':!![]}];}_0x276410=_['merge']({},_0x276410,_0x399746[_0x7d0c('0x46')]);return db[_0x7d0c('0x2c')][_0x7d0c('0x47')](_0x276410)[_0x7d0c('0x25')](handleEntityNotFound(_0xb77db,null))[_0x7d0c('0x25')](function(_0x291879){if(_0x291879){var _0xa3d11c=_0x291879['get']({'plain':!![]});_0xa3d11c=qs[_0x7d0c('0x48')](_0xa3d11c,['id','createdAt',_0x7d0c('0x49')]);_0x399746[_0x7d0c('0x4a')]=_['omit'](_0x399746[_0x7d0c('0x4a')],['id','createdAt','updatedAt']);return db[_0x7d0c('0x2c')][_0x7d0c('0x4b')](_[_0x7d0c('0x39')](_0xa3d11c,_0x399746[_0x7d0c('0x4a')]),{'include':_0x399746[_0x7d0c('0x2f')][_0x7d0c('0x3c')]?[{'all':!![]}]:undefined});}})[_0x7d0c('0x25')](respondWithResult(_0xb77db,0xc9))['catch'](handleError(_0xb77db,null));};exports[_0x7d0c('0x24')]=function(_0x252b6b,_0x526881){if(_0x252b6b[_0x7d0c('0x4a')]['id']){delete _0x252b6b[_0x7d0c('0x4a')]['id'];}return db[_0x7d0c('0x2c')][_0x7d0c('0x47')]({'where':{'id':_0x252b6b[_0x7d0c('0x41')]['id']}})['then'](handleEntityNotFound(_0x526881,null))[_0x7d0c('0x25')](saveUpdates(_0x252b6b[_0x7d0c('0x4a')],null))[_0x7d0c('0x25')](respondWithResult(_0x526881,null))['catch'](handleError(_0x526881,null));};exports[_0x7d0c('0x26')]=function(_0x560bc9,_0x41660f){return db[_0x7d0c('0x2c')][_0x7d0c('0x47')]({'where':{'id':_0x560bc9[_0x7d0c('0x41')]['id']}})['then'](handleEntityNotFound(_0x41660f,null))[_0x7d0c('0x25')](removeEntity(_0x41660f,null))['catch'](handleError(_0x41660f,null));};exports[_0x7d0c('0x4b')]=function(_0x5df227,_0x342fb8,_0x4b8493){_0x5df227[_0x7d0c('0x4a')][_0x7d0c('0x28')]=_0x5df227[_0x7d0c('0x4c')]['originalname'];_0x5df227['body'][_0x7d0c('0x4d')]=_0x5df227[_0x7d0c('0x4c')]['filename'];_0x5df227[_0x7d0c('0x4a')][_0x7d0c('0x3a')]=_0x5df227[_0x7d0c('0x4c')][_0x7d0c('0x4e')];return db[_0x7d0c('0x2c')]['create'](_0x5df227[_0x7d0c('0x4a')])[_0x7d0c('0x25')](respondWithResult(_0x342fb8,0xc9))[_0x7d0c('0x3f')](handleError(_0x342fb8,null));};exports[_0x7d0c('0x4f')]=function(_0xaaff0d,_0x2ad5f7,_0x7c64d){return db[_0x7d0c('0x2c')][_0x7d0c('0x50')]({'where':{'id':_0xaaff0d[_0x7d0c('0x41')]['id']},'raw':!![]})[_0x7d0c('0x25')](handleEntityNotFound(_0x2ad5f7,null))[_0x7d0c('0x25')](function(_0x5b87e9){if(_0x5b87e9){var _0xa89513=_0x5b87e9['ChatOfflineMessageId']!==null;var _0x349c92=path[_0x7d0c('0x51')](config[_0x7d0c('0x52')],_0x7d0c('0x53'));if(_0xa89513){_0x349c92=path[_0x7d0c('0x51')](_0x349c92,'offline-chat/');}var _0x928d62=path[_0x7d0c('0x51')](_0x349c92,_0x5b87e9[_0x7d0c('0x4d')]);return _0x2ad5f7[_0x7d0c('0x4f')](_0x928d62);}})[_0x7d0c('0x3f')](handleError(_0x2ad5f7,null));}; \ No newline at end of file +var _0xf679=['merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','clone','rawAttributes','omit','body','updatedAt','create','originalname','basename','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','map','Attachment','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xf679,0x1c3));var _0x9f67=function(_0x28f8cd,_0x22417f){_0x28f8cd=_0x28f8cd-0x0;var _0x548a27=_0xf679[_0x28f8cd];return _0x548a27;};'use strict';var emlformat=require(_0x9f67('0x0'));var rimraf=require(_0x9f67('0x1'));var zipdir=require(_0x9f67('0x2'));var jsonpatch=require(_0x9f67('0x3'));var rp=require(_0x9f67('0x4'));var moment=require(_0x9f67('0x5'));var BPromise=require(_0x9f67('0x6'));var Mustache=require('mustache');var util=require(_0x9f67('0x7'));var path=require('path');var sox=require(_0x9f67('0x8'));var csv=require(_0x9f67('0x9'));var ejs=require(_0x9f67('0xa'));var fs=require('fs');var fs_extra=require(_0x9f67('0xb'));var _=require(_0x9f67('0xc'));var squel=require(_0x9f67('0xd'));var crypto=require('crypto');var jsforce=require(_0x9f67('0xe'));var deskjs=require(_0x9f67('0xf'));var toCsv=require(_0x9f67('0x9'));var querystring=require('querystring');var Papa=require(_0x9f67('0x10'));var Redis=require('ioredis');var authService=require(_0x9f67('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f67('0x12'));var hardwareService=require(_0x9f67('0x13'));var logger=require(_0x9f67('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9f67('0x15'));var licenseUtil=require(_0x9f67('0x16'));var db=require(_0x9f67('0x17'))['db'];function respondWithStatusCode(_0x4162d3,_0x263ec5){_0x263ec5=_0x263ec5||0xcc;return function(_0x53d6f6){if(_0x53d6f6){return _0x4162d3[_0x9f67('0x18')](_0x263ec5);}return _0x4162d3[_0x9f67('0x19')](_0x263ec5)[_0x9f67('0x1a')]();};}function respondWithResult(_0x4149cd,_0xd6c2ca){_0xd6c2ca=_0xd6c2ca||0xc8;return function(_0x248678){if(_0x248678){return _0x4149cd[_0x9f67('0x19')](_0xd6c2ca)[_0x9f67('0x1b')](_0x248678);}};}function respondWithFilteredResult(_0x466b2b,_0x5e34bf){return function(_0x3affce){if(_0x3affce){var _0x3ba3ec=typeof _0x5e34bf[_0x9f67('0x1c')]===_0x9f67('0x1d')&&typeof _0x5e34bf['limit']===_0x9f67('0x1d');var _0x41c816=_0x3affce['count'];var _0x917ebd=_0x3ba3ec?0x0:_0x5e34bf[_0x9f67('0x1c')];var _0x7ac952=_0x3ba3ec?_0x3affce[_0x9f67('0x1e')]:_0x5e34bf[_0x9f67('0x1c')]+_0x5e34bf[_0x9f67('0x1f')];var _0x335c0e;if(_0x7ac952>=_0x41c816){_0x7ac952=_0x41c816;_0x335c0e=0xc8;}else{_0x335c0e=0xce;}_0x466b2b[_0x9f67('0x19')](_0x335c0e);return _0x466b2b[_0x9f67('0x20')](_0x9f67('0x21'),_0x917ebd+'-'+_0x7ac952+'/'+_0x41c816)[_0x9f67('0x1b')](_0x3affce);}return null;};}function patchUpdates(_0x1de295){return function(_0x263ecc){try{jsonpatch['apply'](_0x263ecc,_0x1de295,!![]);}catch(_0x45acb4){return BPromise[_0x9f67('0x22')](_0x45acb4);}return _0x263ecc[_0x9f67('0x23')]();};}function saveUpdates(_0x4a38eb,_0x577e1a){return function(_0x42e168){if(_0x42e168){return _0x42e168[_0x9f67('0x24')](_0x4a38eb)['then'](function(_0x23076a){return _0x23076a;});}return null;};}function removeEntity(_0x4dc0b7,_0x18def7){return function(_0x216581){if(_0x216581){return _0x216581[_0x9f67('0x25')]()[_0x9f67('0x26')](function(){_0x4dc0b7[_0x9f67('0x19')](0xcc)[_0x9f67('0x1a')]();});}};}function handleEntityNotFound(_0x5a9ac7,_0x1893dc){return function(_0xca4e){if(!_0xca4e){_0x5a9ac7['sendStatus'](0x194);}return _0xca4e;};}function handleError(_0x2f6d04,_0x4c9164){_0x4c9164=_0x4c9164||0x1f4;return function(_0x24a8c6){logger[_0x9f67('0x27')](_0x24a8c6[_0x9f67('0x28')]);if(_0x24a8c6[_0x9f67('0x29')]){delete _0x24a8c6['name'];}_0x2f6d04[_0x9f67('0x19')](_0x4c9164)['send'](_0x24a8c6);};}exports['index']=function(_0x41679a,_0x3b11eb){var _0x1ac5ce={},_0x8a64e4={},_0x54dfb2={'count':0x0,'rows':[]};var _0xc86fd1=_[_0x9f67('0x2a')](db[_0x9f67('0x2b')]['rawAttributes'],function(_0x41fcad){return{'name':_0x41fcad['fieldName'],'type':_0x41fcad['type'][_0x9f67('0x2c')]};});_0x8a64e4['model']=_[_0x9f67('0x2a')](_0xc86fd1,_0x9f67('0x29'));_0x8a64e4[_0x9f67('0x2d')]=_[_0x9f67('0x2e')](_0x41679a[_0x9f67('0x2d')]);_0x8a64e4[_0x9f67('0x2f')]=_[_0x9f67('0x30')](_0x8a64e4[_0x9f67('0x31')],_0x8a64e4['query']);_0x1ac5ce[_0x9f67('0x32')]=_['intersection'](_0x8a64e4['model'],qs[_0x9f67('0x33')](_0x41679a['query']['fields']));_0x1ac5ce[_0x9f67('0x32')]=_0x1ac5ce['attributes'][_0x9f67('0x34')]?_0x1ac5ce[_0x9f67('0x32')]:_0x8a64e4['model'];if(!_0x41679a['query'][_0x9f67('0x35')]('nolimit')){_0x1ac5ce[_0x9f67('0x1f')]=qs[_0x9f67('0x1f')](_0x41679a[_0x9f67('0x2d')][_0x9f67('0x1f')]);_0x1ac5ce['offset']=qs[_0x9f67('0x1c')](_0x41679a[_0x9f67('0x2d')][_0x9f67('0x1c')]);}_0x1ac5ce[_0x9f67('0x36')]=qs[_0x9f67('0x37')](_0x41679a[_0x9f67('0x2d')][_0x9f67('0x37')]);_0x1ac5ce[_0x9f67('0x38')]=qs[_0x9f67('0x2f')](_[_0x9f67('0x39')](_0x41679a['query'],_0x8a64e4['filters']),_0xc86fd1);if(_0x41679a[_0x9f67('0x2d')][_0x9f67('0x3a')]){_0x1ac5ce[_0x9f67('0x38')]=_[_0x9f67('0x3b')](_0x1ac5ce['where'],{'$or':_[_0x9f67('0x2a')](_0xc86fd1,function(_0x37121e){if(_0x37121e[_0x9f67('0x3c')]!==_0x9f67('0x3d')){var _0x1b87b8={};_0x1b87b8[_0x37121e['name']]={'$like':'%'+_0x41679a[_0x9f67('0x2d')][_0x9f67('0x3a')]+'%'};return _0x1b87b8;}})});}_0x1ac5ce=_[_0x9f67('0x3b')]({},_0x1ac5ce,_0x41679a[_0x9f67('0x3e')]);var _0x54404e={'where':_0x1ac5ce[_0x9f67('0x38')]};return db[_0x9f67('0x2b')]['count'](_0x54404e)[_0x9f67('0x26')](function(_0x4c90b6){_0x54dfb2['count']=_0x4c90b6;if(_0x41679a[_0x9f67('0x2d')][_0x9f67('0x3f')]){_0x1ac5ce[_0x9f67('0x40')]=[{'all':!![]}];}return db[_0x9f67('0x2b')][_0x9f67('0x41')](_0x1ac5ce);})[_0x9f67('0x26')](function(_0x2eb1b9){_0x54dfb2['rows']=_0x2eb1b9;return _0x54dfb2;})[_0x9f67('0x26')](respondWithFilteredResult(_0x3b11eb,_0x1ac5ce))['catch'](handleError(_0x3b11eb,null));};exports[_0x9f67('0x42')]=function(_0x307155,_0x2baa04){var _0x4a7efa={'raw':!![],'where':{'id':_0x307155[_0x9f67('0x43')]['id']}},_0x279c8a={};_0x279c8a[_0x9f67('0x31')]=_[_0x9f67('0x2e')](db[_0x9f67('0x2b')]['rawAttributes']);_0x279c8a[_0x9f67('0x2d')]=_[_0x9f67('0x2e')](_0x307155['query']);_0x279c8a[_0x9f67('0x2f')]=_['intersection'](_0x279c8a[_0x9f67('0x31')],_0x279c8a[_0x9f67('0x2d')]);_0x4a7efa[_0x9f67('0x32')]=_[_0x9f67('0x30')](_0x279c8a['model'],qs[_0x9f67('0x33')](_0x307155['query'][_0x9f67('0x33')]));_0x4a7efa[_0x9f67('0x32')]=_0x4a7efa['attributes']['length']?_0x4a7efa[_0x9f67('0x32')]:_0x279c8a[_0x9f67('0x31')];if(_0x307155[_0x9f67('0x2d')][_0x9f67('0x3f')]){_0x4a7efa[_0x9f67('0x40')]=[{'all':!![]}];}_0x4a7efa=_[_0x9f67('0x3b')]({},_0x4a7efa,_0x307155['options']);return db[_0x9f67('0x2b')][_0x9f67('0x44')](_0x4a7efa)[_0x9f67('0x26')](handleEntityNotFound(_0x2baa04,null))[_0x9f67('0x26')](respondWithResult(_0x2baa04,null))[_0x9f67('0x45')](handleError(_0x2baa04,null));};exports[_0x9f67('0x46')]=function(_0x4de743,_0x53f927){var _0x7c1c0c={'where':{'id':_0x4de743[_0x9f67('0x43')]['id']}},_0x36a667={};_0x36a667[_0x9f67('0x31')]=_[_0x9f67('0x2e')](db[_0x9f67('0x2b')][_0x9f67('0x47')]);_0x7c1c0c[_0x9f67('0x32')]=_['intersection'](_0x36a667[_0x9f67('0x31')],qs[_0x9f67('0x33')](_0x4de743[_0x9f67('0x2d')]['fields']));_0x7c1c0c[_0x9f67('0x32')]=_0x7c1c0c[_0x9f67('0x32')][_0x9f67('0x34')]?_0x7c1c0c[_0x9f67('0x32')]:_0x36a667[_0x9f67('0x31')];if(_0x4de743[_0x9f67('0x2d')][_0x9f67('0x3f')]){_0x7c1c0c[_0x9f67('0x40')]=[{'all':!![]}];}_0x7c1c0c=_[_0x9f67('0x3b')]({},_0x7c1c0c,_0x4de743[_0x9f67('0x3e')]);return db[_0x9f67('0x2b')]['find'](_0x7c1c0c)[_0x9f67('0x26')](handleEntityNotFound(_0x53f927,null))[_0x9f67('0x26')](function(_0x3c7c34){if(_0x3c7c34){var _0x5cce65=_0x3c7c34['get']({'plain':!![]});_0x5cce65=qs[_0x9f67('0x48')](_0x5cce65,['id','createdAt','updatedAt']);_0x4de743[_0x9f67('0x49')]=_['omit'](_0x4de743[_0x9f67('0x49')],['id','createdAt',_0x9f67('0x4a')]);return db[_0x9f67('0x2b')][_0x9f67('0x4b')](_[_0x9f67('0x3b')](_0x5cce65,_0x4de743[_0x9f67('0x49')]),{'include':_0x4de743[_0x9f67('0x2d')][_0x9f67('0x3f')]?[{'all':!![]}]:undefined});}})[_0x9f67('0x26')](respondWithResult(_0x53f927,0xc9))[_0x9f67('0x45')](handleError(_0x53f927,null));};exports['update']=function(_0x3cfe0d,_0x1a5b45){if(_0x3cfe0d[_0x9f67('0x49')]['id']){delete _0x3cfe0d[_0x9f67('0x49')]['id'];}return db[_0x9f67('0x2b')][_0x9f67('0x44')]({'where':{'id':_0x3cfe0d[_0x9f67('0x43')]['id']}})[_0x9f67('0x26')](handleEntityNotFound(_0x1a5b45,null))[_0x9f67('0x26')](saveUpdates(_0x3cfe0d[_0x9f67('0x49')],null))[_0x9f67('0x26')](respondWithResult(_0x1a5b45,null))[_0x9f67('0x45')](handleError(_0x1a5b45,null));};exports['destroy']=function(_0x1916aa,_0x1faeb4){return db[_0x9f67('0x2b')][_0x9f67('0x44')]({'where':{'id':_0x1916aa[_0x9f67('0x43')]['id']}})['then'](handleEntityNotFound(_0x1faeb4,null))['then'](removeEntity(_0x1faeb4,null))[_0x9f67('0x45')](handleError(_0x1faeb4,null));};exports['create']=function(_0x32a488,_0x190cb6,_0x3116be){_0x32a488[_0x9f67('0x49')][_0x9f67('0x29')]=_0x32a488['file'][_0x9f67('0x4c')];_0x32a488[_0x9f67('0x49')][_0x9f67('0x4d')]=_0x32a488['file']['filename'];_0x32a488[_0x9f67('0x49')]['type']=_0x32a488['file']['mimetype'];return db['Attachment'][_0x9f67('0x4b')](_0x32a488[_0x9f67('0x49')])[_0x9f67('0x26')](respondWithResult(_0x190cb6,0xc9))[_0x9f67('0x45')](handleError(_0x190cb6,null));};exports[_0x9f67('0x4e')]=function(_0x385002,_0x40c83f,_0x20d34c){return db[_0x9f67('0x2b')][_0x9f67('0x4f')]({'where':{'id':_0x385002[_0x9f67('0x43')]['id']},'raw':!![]})[_0x9f67('0x26')](handleEntityNotFound(_0x40c83f,null))[_0x9f67('0x26')](function(_0x20aadd){if(_0x20aadd){var _0x11bfe4=_0x20aadd[_0x9f67('0x50')]!==null;var _0xf351bc=path['join'](config[_0x9f67('0x51')],_0x9f67('0x52'));if(_0x11bfe4){_0xf351bc=path[_0x9f67('0x53')](_0xf351bc,_0x9f67('0x54'));}var _0x3085fa=path['join'](_0xf351bc,_0x20aadd[_0x9f67('0x4d')]);return _0x40c83f[_0x9f67('0x4e')](_0x3085fa);}})[_0x9f67('0x45')](handleError(_0x40c83f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 013432c..49fe59c 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 _0xcfe3=['attachments','lodash','util','../../config/logger','api','moment','../../config/environment','./attachment.attributes','exports'];(function(_0xd974f0,_0x56b6dc){var _0x324110=function(_0x48350d){while(--_0x48350d){_0xd974f0['push'](_0xd974f0['shift']());}};_0x324110(++_0x56b6dc);}(_0xcfe3,0x133));var _0x3cfe=function(_0x5665c8,_0x137a01){_0x5665c8=_0x5665c8-0x0;var _0x26430b=_0xcfe3[_0x5665c8];return _0x26430b;};'use strict';var _=require(_0x3cfe('0x0'));var util=require(_0x3cfe('0x1'));var logger=require(_0x3cfe('0x2'))(_0x3cfe('0x3'));var moment=require(_0x3cfe('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(_0x3cfe('0x5'));var attributes=require(_0x3cfe('0x6'));module[_0x3cfe('0x7')]=function(_0x4c823d,_0x4f3112){return _0x4c823d['define']('Attachment',attributes,{'tableName':_0x3cfe('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e94=['lodash','moment','bluebird','request-promise','path','rimraf','./attachment.attributes','define','Attachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e94,0x90));var _0x42e9=function(_0x4f08f0,_0x2fcd9c){_0x4f08f0=_0x4f08f0-0x0;var _0x2ee30e=_0x2e94[_0x4f08f0];return _0x2ee30e;};'use strict';var _=require(_0x42e9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x42e9('0x1'));var BPromise=require(_0x42e9('0x2'));var rp=require(_0x42e9('0x3'));var fs=require('fs');var path=require(_0x42e9('0x4'));var rimraf=require(_0x42e9('0x5'));var config=require('../../config/environment');var attributes=require(_0x42e9('0x6'));module['exports']=function(_0x292851,_0x5c3d5e){return _0x292851[_0x42e9('0x7')](_0x42e9('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 943b480..ce4ad43 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 _0x6921=['then','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','result','catch','CreateAttachment','create','options','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6921,0x1d1));var _0x1692=function(_0x43404c,_0x144ff1){_0x43404c=_0x43404c-0x0;var _0x474753=_0x6921[_0x43404c];return _0x474753;};'use strict';var _=require('lodash');var util=require(_0x1692('0x0'));var moment=require('moment');var BPromise=require(_0x1692('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1692('0x2'));var db=require(_0x1692('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1692('0x4'))('rpc');var config=require(_0x1692('0x5'));var jayson=require(_0x1692('0x6'));var client=jayson[_0x1692('0x7')][_0x1692('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2825c9,_0x36d159,_0x2d694f){return new BPromise(function(_0x3ffe29,_0x705f61){return client[_0x1692('0x9')](_0x2825c9,_0x2d694f)[_0x1692('0xa')](function(_0x5dc499){logger[_0x1692('0xb')]('Attachment,\x20%s,\x20%s',_0x36d159,_0x1692('0xc'));logger[_0x1692('0xd')](_0x1692('0xe'),_0x36d159,_0x1692('0xc'),JSON[_0x1692('0xf')](_0x5dc499));if(_0x5dc499[_0x1692('0x10')]){if(_0x5dc499['error'][_0x1692('0x11')]===0x1f4){logger[_0x1692('0x10')](_0x1692('0x12'),_0x36d159,_0x5dc499[_0x1692('0x10')][_0x1692('0x13')]);return _0x705f61(_0x5dc499[_0x1692('0x10')]['message']);}logger[_0x1692('0x10')](_0x1692('0x12'),_0x36d159,_0x5dc499[_0x1692('0x10')][_0x1692('0x13')]);return _0x3ffe29(_0x5dc499[_0x1692('0x10')][_0x1692('0x13')]);}else{logger[_0x1692('0xb')](_0x1692('0x12'),_0x36d159,'request\x20sent');_0x3ffe29(_0x5dc499[_0x1692('0x14')]['message']);}})[_0x1692('0x15')](function(_0x4a1977){logger[_0x1692('0x10')](_0x1692('0x12'),_0x36d159,_0x4a1977);_0x705f61(_0x4a1977);});});}exports[_0x1692('0x16')]=function(_0x4ea36d){var _0x598a2f=this;return new Promise(function(_0x3c0960,_0xed3d28){return db['Attachment'][_0x1692('0x17')](_0x4ea36d['body'],{'raw':_0x4ea36d[_0x1692('0x18')]?_0x4ea36d['options']['raw']===undefined?!![]:![]:!![]})[_0x1692('0xa')](function(_0x4e544b){logger[_0x1692('0xb')](_0x1692('0x16'),_0x4ea36d);logger[_0x1692('0xd')]('CreateAttachment',_0x4ea36d,JSON[_0x1692('0xf')](_0x4e544b));_0x3c0960(_0x4e544b);})[_0x1692('0x15')](function(_0x477e9d){logger[_0x1692('0x10')](_0x1692('0x16'),_0x477e9d[_0x1692('0x13')],_0x4ea36d);_0xed3d28(_0x598a2f[_0x1692('0x10')](0x1f4,_0x477e9d['message']));});});}; \ No newline at end of file +var _0x407f=['rpc','../../config/environment','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateAttachment','Attachment','create','body','options','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xa6313d,_0x1d90cd){var _0x465a01=function(_0x497c46){while(--_0x497c46){_0xa6313d['push'](_0xa6313d['shift']());}};_0x465a01(++_0x1d90cd);}(_0x407f,0xc2));var _0xf407=function(_0x1e6f48,_0x499c17){_0x1e6f48=_0x1e6f48-0x0;var _0xe3b642=_0x407f[_0x1e6f48];return _0xe3b642;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf407('0x0'));var rs=require(_0xf407('0x1'));var fs=require('fs');var Redis=require(_0xf407('0x2'));var db=require(_0xf407('0x3'))['db'];var utils=require(_0xf407('0x4'));var logger=require(_0xf407('0x5'))(_0xf407('0x6'));var config=require(_0xf407('0x7'));var jayson=require(_0xf407('0x8'));var client=jayson[_0xf407('0x9')][_0xf407('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bce9d,_0x2d4ec6,_0x3ac774){return new BPromise(function(_0x38ee37,_0x3ab539){return client['request'](_0x2bce9d,_0x3ac774)[_0xf407('0xb')](function(_0xc3473a){logger[_0xf407('0xc')](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x2d4ec6,_0xf407('0xe'),JSON[_0xf407('0xf')](_0xc3473a));if(_0xc3473a[_0xf407('0x10')]){if(_0xc3473a[_0xf407('0x10')][_0xf407('0x11')]===0x1f4){logger['error'](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);return _0x3ab539(_0xc3473a[_0xf407('0x10')][_0xf407('0x12')]);}logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0xc3473a[_0xf407('0x10')]['message']);return _0x38ee37(_0xc3473a['error'][_0xf407('0x12')]);}else{logger['info'](_0xf407('0xd'),_0x2d4ec6,'request\x20sent');_0x38ee37(_0xc3473a['result'][_0xf407('0x12')]);}})[_0xf407('0x13')](function(_0x1cdc81){logger[_0xf407('0x10')](_0xf407('0xd'),_0x2d4ec6,_0x1cdc81);_0x3ab539(_0x1cdc81);});});}exports[_0xf407('0x14')]=function(_0x4ddbe6){var _0x2e346f=this;return new Promise(function(_0x588fe4,_0x128faf){return db[_0xf407('0x15')][_0xf407('0x16')](_0x4ddbe6[_0xf407('0x17')],{'raw':_0x4ddbe6[_0xf407('0x18')]?_0x4ddbe6[_0xf407('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xf407('0xb')](function(_0x39febd){logger[_0xf407('0xc')](_0xf407('0x14'),_0x4ddbe6);logger['debug'](_0xf407('0x14'),_0x4ddbe6,JSON[_0xf407('0xf')](_0x39febd));_0x588fe4(_0x39febd);})[_0xf407('0x13')](function(_0xa6f11e){logger['error']('CreateAttachment',_0xa6f11e[_0xf407('0x12')],_0x4ddbe6);_0x128faf(_0x2e346f[_0xf407('0x10')](0x1f4,_0xa6f11e[_0xf407('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 866a5ce..ed91e11 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x140b8e,_0x737065){var _0x357749=function(_0x1938f8){while(--_0x1938f8){_0x140b8e['push'](_0x140b8e['shift']());}};_0x357749(++_0x737065);}(_0x2032,0xd9));var _0x2203=function(_0x464542,_0x140b4d){_0x464542=_0x464542-0x0;var _0x1008d0=_0x2032[_0x464542];return _0x1008d0;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x26d51a,_0x1644b1){var _0x326117=function(_0x49b49e){while(--_0x49b49e){_0x26d51a['push'](_0x26d51a['shift']());}};_0x326117(++_0x1644b1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18d00f,_0x4f5dbd){_0x18d00f=_0x18d00f-0x0;var _0x10be8e=_0x5f2f[_0x18d00f];return _0x10be8e;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index cb6cd46..ff3351d 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 _0x8cba=['Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt','online','user','agent','add','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','json','passport','passport-local','Strategy','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x8cba,0x7a));var _0xa8cb=function(_0x1d6a12,_0x49b3d3){_0x1d6a12=_0x1d6a12-0x0;var _0x3a79ca=_0x8cba[_0x1d6a12];return _0x3a79ca;};'use strict';var passport=require(_0xa8cb('0x0'));var LocalStrategy=require(_0xa8cb('0x1'))[_0xa8cb('0x2')];var moment=require(_0xa8cb('0x3'));var ActiveDirectory=require(_0xa8cb('0x4'));var BPromise=require(_0xa8cb('0x5'));var util=require('util');var db=require(_0xa8cb('0x6'))['db'];var authService=require(_0xa8cb('0x7'));var utils=require(_0xa8cb('0x8'));var config=require(_0xa8cb('0x9'));var logger=require(_0xa8cb('0xa'))(_0xa8cb('0xb'));function isActiveDirectoryConfigured(_0x7928f4){var _0xc4ce1e=![];if(typeof _0x7928f4[_0xa8cb('0xc')]!==_0xa8cb('0xd')){_0xc4ce1e=_0x7928f4['activedirectory'][_0xa8cb('0xe')]&&_0x7928f4[_0xa8cb('0xc')]['url']&&_0x7928f4[_0xa8cb('0xc')][_0xa8cb('0xf')];}return _0xc4ce1e;}function adAuthenticate(_0x4d5d0e,_0x46de5c,_0x35eaf1){return new BPromise(function(_0xef02be,_0x55b995){try{var _0x50bc63=new ActiveDirectory(_0x4d5d0e);_0x50bc63[_0xa8cb('0x10')](_0x46de5c,_0x35eaf1,function(_0x29116b,_0xa428c9){if(_0x29116b){logger[_0xa8cb('0x11')](_0xa8cb('0x12'),_0x46de5c,util['inspect'](_0x29116b,{'showHidden':![],'depth':null}));_0x55b995(_0xa8cb('0x13'));}else if(!_0xa428c9){logger[_0xa8cb('0x11')](_0xa8cb('0x14'),_0x46de5c);_0x55b995(_0xa8cb('0x13'));}else{_0xef02be(_0xa428c9);}});}catch(_0x442806){_0x55b995(_0x442806);}});}function ActiveDirectoryAuthenticate(_0x5e8683,_0x5b79dd,_0x46ffdd,_0x2715a9){var _0x434068,_0x5d14bf;if(!isActiveDirectoryConfigured(config)){logger[_0xa8cb('0x11')](_0xa8cb('0x15'),_0x5b79dd);return _0x2715a9(null,![],{'message':_0xa8cb('0x13')});}return db[_0xa8cb('0x16')]['findOne']({'where':{'id':0x1},'attributes':[_0xa8cb('0x17'),_0xa8cb('0x18')],'raw':!![]})[_0xa8cb('0x19')](function(_0x2bce1a){_0x434068=_0x2bce1a;if(!_0x434068['adSsoEnabled']){logger[_0xa8cb('0x11')](_0xa8cb('0x1a'),_0x5b79dd);throw new Error(_0xa8cb('0x13'));}return _0x5e8683[_0xa8cb('0x1b')]({'logging':!![],'attributes':['id',_0xa8cb('0x1c'),_0xa8cb('0x1d'),_0xa8cb('0x1e'),_0xa8cb('0x1f'),_0xa8cb('0x20'),_0xa8cb('0x21'),_0xa8cb('0x22'),_0xa8cb('0x23')],'where':{'name':_0x5b79dd,'role':{'$or':['admin',_0xa8cb('0x24'),_0xa8cb('0x25')]},'adSsoEnabled':!![]}});})[_0xa8cb('0x19')](function(_0x461d58){if(!_0x461d58||_0x461d58&&_0x461d58[_0xa8cb('0x1c')]!==_0x5b79dd){throw new Error(_0xa8cb('0x13'));}_0x5d14bf=_0x461d58;var _0x2597c2=_0x5d14bf[_0xa8cb('0x1c')]+'@'+config[_0xa8cb('0xc')][_0xa8cb('0xf')];return adAuthenticate(config[_0xa8cb('0xc')],_0x2597c2,_0x46ffdd);})[_0xa8cb('0x19')](function(_0x204508){if(_0x5d14bf[_0xa8cb('0x20')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x434068[_0xa8cb('0x18')]>0x0){if(_0x5d14bf[_0xa8cb('0x21')]){if(moment(_0x5d14bf[_0xa8cb('0x22')])[_0xa8cb('0x26')](_0x434068[_0xa8cb('0x18')],_0xa8cb('0x27'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0xa8cb('0x28')](_0x5d14bf,0x0,![],null)[_0xa8cb('0x19')](function(){return utils[_0xa8cb('0x29')](_0x5d14bf);})['then'](function(){return _0x2715a9(null,_0x5d14bf);});}else{return utils[_0xa8cb('0x29')](_0x5d14bf)['then'](function(){return _0x2715a9(null,_0x5d14bf);});}}else{return utils[_0xa8cb('0x29')](_0x5d14bf)[_0xa8cb('0x19')](function(){return _0x2715a9(null,_0x5d14bf);});}})[_0xa8cb('0x2a')](function(_0xd7168){return _0x2715a9(null,![],_0xd7168);});}function handleError(_0x215bdd,_0x31429f,_0x2ff325){return _0x215bdd[_0xa8cb('0x2b')](_0x31429f||0x1f4)[_0xa8cb('0x2c')]({'message':_0x2ff325?_0x2ff325['message']||_0x2ff325:''});}exports[_0xa8cb('0x2d')]=function(_0x353c6c,_0x55bbe1,_0x46f965){passport[_0xa8cb('0x10')](_0xa8cb('0x2e'),function(_0xfc1d2c,_0xc13495,_0x5944ee){var _0x4bc18a=_0xfc1d2c||_0x5944ee;if(_0x4bc18a){return handleError(_0x55bbe1,0x191,_0x4bc18a);}if(!_0xc13495){return handleError(_0x55bbe1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x36e81b={'payload':{'id':_0xc13495['id'],'role':_0xc13495['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x36e81b)[_0xa8cb('0x19')](function(_0x4f5d36){_0x55bbe1[_0xa8cb('0x2f')]({'id':_0xc13495['id'],'token':_0x4f5d36,'statusCall':'','isAlreadyLogged':_0xc13495[_0xa8cb('0x23')]});});}})(_0x353c6c,_0x55bbe1,_0x46f965);};passport['use'](_0xa8cb('0x2e'),new LocalStrategy({'usernameField':_0xa8cb('0x1c'),'passwordField':'password'},function(_0xffa2de,_0x146186,_0x4b17be){return ActiveDirectoryAuthenticate(db['User'],_0xffa2de,_0x146186,_0x4b17be);})); \ No newline at end of file +var _0x55e8=['json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','admin','agent','domain','add','minutes','clearBlockUser','getLicense','status','message','login','authenticate','ad-login','signToken'];(function(_0x23a75a,_0x5747f1){var _0x1bf5d9=function(_0x1ba7f4){while(--_0x1ba7f4){_0x23a75a['push'](_0x23a75a['shift']());}};_0x1bf5d9(++_0x5747f1);}(_0x55e8,0x193));var _0x855e=function(_0x33560a,_0x4e394f){_0x33560a=_0x33560a-0x0;var _0x23f5be=_0x55e8[_0x33560a];return _0x23f5be;};'use strict';var passport=require(_0x855e('0x0'));var LocalStrategy=require(_0x855e('0x1'))[_0x855e('0x2')];var moment=require(_0x855e('0x3'));var ActiveDirectory=require(_0x855e('0x4'));var BPromise=require(_0x855e('0x5'));var util=require(_0x855e('0x6'));var db=require(_0x855e('0x7'))['db'];var authService=require(_0x855e('0x8'));var utils=require(_0x855e('0x9'));var config=require(_0x855e('0xa'));var logger=require(_0x855e('0xb'))(_0x855e('0xc'));function isActiveDirectoryConfigured(_0x11a1fb){var _0x4ada91=![];if(typeof _0x11a1fb[_0x855e('0xd')]!==_0x855e('0xe')){_0x4ada91=_0x11a1fb['activedirectory'][_0x855e('0xf')]&&_0x11a1fb[_0x855e('0xd')]['url']&&_0x11a1fb[_0x855e('0xd')]['domain'];}return _0x4ada91;}function adAuthenticate(_0x31df6e,_0x514392,_0x676f66){return new BPromise(function(_0x5c2d3a,_0x2b837b){try{var _0x5d904b=new ActiveDirectory(_0x31df6e);_0x5d904b['authenticate'](_0x514392,_0x676f66,function(_0x41cd7f,_0x164818){if(_0x41cd7f){logger[_0x855e('0x10')](_0x855e('0x11'),_0x514392,util['inspect'](_0x41cd7f,{'showHidden':![],'depth':null}));_0x2b837b(_0x855e('0x12'));}else if(!_0x164818){logger[_0x855e('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x514392);_0x2b837b('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5c2d3a(_0x164818);}});}catch(_0x844a7c){_0x2b837b(_0x844a7c);}});}function ActiveDirectoryAuthenticate(_0x40387d,_0x33c830,_0x1bde4e,_0x672752){var _0x53369e,_0x5702e0;if(!isActiveDirectoryConfigured(config)){logger[_0x855e('0x10')](_0x855e('0x13'),_0x33c830);return _0x672752(null,![],{'message':_0x855e('0x12')});}return db[_0x855e('0x14')][_0x855e('0x15')]({'where':{'id':0x1},'attributes':[_0x855e('0x16'),_0x855e('0x17')],'raw':!![]})[_0x855e('0x18')](function(_0x83fc86){_0x53369e=_0x83fc86;if(!_0x53369e[_0x855e('0x16')]){logger[_0x855e('0x10')](_0x855e('0x19'),_0x33c830);throw new Error(_0x855e('0x12'));}return _0x40387d['findOne']({'logging':!![],'attributes':['id',_0x855e('0x1a'),_0x855e('0x1b'),_0x855e('0x1c'),_0x855e('0x1d'),_0x855e('0x1e'),_0x855e('0x1f'),_0x855e('0x20'),_0x855e('0x21')],'where':{'name':_0x33c830,'role':{'$or':[_0x855e('0x22'),'user',_0x855e('0x23')]},'adSsoEnabled':!![]}});})[_0x855e('0x18')](function(_0x241021){if(!_0x241021||_0x241021&&_0x241021[_0x855e('0x1a')]!==_0x33c830){throw new Error(_0x855e('0x12'));}_0x5702e0=_0x241021;var _0x5f1ee5=_0x5702e0[_0x855e('0x1a')]+'@'+config[_0x855e('0xd')][_0x855e('0x24')];return adAuthenticate(config[_0x855e('0xd')],_0x5f1ee5,_0x1bde4e);})['then'](function(_0xa5800c){if(_0x5702e0[_0x855e('0x1e')]){throw new Error(_0x855e('0x12'));}if(_0x53369e['blockDuration']>0x0){if(_0x5702e0[_0x855e('0x1f')]){if(moment(_0x5702e0[_0x855e('0x20')])[_0x855e('0x25')](_0x53369e['blockDuration'],_0x855e('0x26'))>moment()){throw new Error(_0x855e('0x12'));}return utils[_0x855e('0x27')](_0x5702e0,0x0,![],null)[_0x855e('0x18')](function(){return utils[_0x855e('0x28')](_0x5702e0);})['then'](function(){return _0x672752(null,_0x5702e0);});}else{return utils[_0x855e('0x28')](_0x5702e0)['then'](function(){return _0x672752(null,_0x5702e0);});}}else{return utils['getLicense'](_0x5702e0)[_0x855e('0x18')](function(){return _0x672752(null,_0x5702e0);});}})['catch'](function(_0xa368b4){return _0x672752(null,![],_0xa368b4);});}function handleError(_0x3dc156,_0xa5b327,_0x7a2103){return _0x3dc156[_0x855e('0x29')](_0xa5b327||0x1f4)['send']({'message':_0x7a2103?_0x7a2103[_0x855e('0x2a')]||_0x7a2103:''});}exports[_0x855e('0x2b')]=function(_0x449d99,_0x4ea353,_0xdc5fd0){passport[_0x855e('0x2c')](_0x855e('0x2d'),function(_0x3a0e88,_0x5c078f,_0x36b5b8){var _0x313585=_0x3a0e88||_0x36b5b8;if(_0x313585){return handleError(_0x4ea353,0x191,_0x313585);}if(!_0x5c078f){return handleError(_0x4ea353,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x563d13={'payload':{'id':_0x5c078f['id'],'role':_0x5c078f[_0x855e('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x855e('0x2e')](_0x563d13)[_0x855e('0x18')](function(_0x3cd19b){_0x4ea353[_0x855e('0x2f')]({'id':_0x5c078f['id'],'token':_0x3cd19b,'statusCall':'','isAlreadyLogged':_0x5c078f['online']});});}})(_0x449d99,_0x4ea353,_0xdc5fd0);};passport[_0x855e('0x30')](_0x855e('0x2d'),new LocalStrategy({'usernameField':'name','passwordField':_0x855e('0x1b')},function(_0x1c67e5,_0x265adf,_0x254614){return ActiveDirectoryAuthenticate(db[_0x855e('0x31')],_0x1c67e5,_0x265adf,_0x254614);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 9e2cf24..8b6dd9a 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 _0xb648=['post','exports','./authActiveDirectory.controller'];(function(_0x4d7413,_0x290a4e){var _0x37370e=function(_0x21b021){while(--_0x21b021){_0x4d7413['push'](_0x4d7413['shift']());}};_0x37370e(++_0x290a4e);}(_0xb648,0x98));var _0x8b64=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0xb648[_0x2c1e7a];return _0xcacb4f;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0x8b64('0x0'));router[_0x8b64('0x1')]('/',controller['login']);module[_0x8b64('0x2')]=router; \ No newline at end of file +var _0x652d=['exports','express','Router','./authActiveDirectory.controller','post'];(function(_0x51b241,_0x187fab){var _0x16a3a7=function(_0x5f1b23){while(--_0x5f1b23){_0x51b241['push'](_0x51b241['shift']());}};_0x16a3a7(++_0x187fab);}(_0x652d,0x15a));var _0xd652=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x652d[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xd652('0x0'));var router=express[_0xd652('0x1')]();var controller=require(_0xd652('0x2'));router[_0xd652('0x3')]('/',controller['login']);module[_0xd652('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 2d979c0..151f5e4 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x7a54,0x106));var _0x47a5=function(_0x4d76f4,_0x529b5d){_0x4d76f4=_0x4d76f4-0x0;var _0x8e06fd=_0x7a54[_0x4d76f4];return _0x8e06fd;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file +var _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(_0x331c4d,_0x5e7325){var _0x1378f2=function(_0x43c4e9){while(--_0x43c4e9){_0x331c4d['push'](_0x331c4d['shift']());}};_0x1378f2(++_0x5e7325);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index ab0aa3d..a1c121b 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 _0x942a=['exports','express','passport','Router','./authGoogle.controller','get','login','/callback','callback','isMiddleware','setTokenCookie'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0x942a,0x1e5));var _0xa942=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0x942a[_0x5a1a51];return _0x47edd7;};'use strict';var express=require(_0xa942('0x0'));var passport=require(_0xa942('0x1'));var router=express[_0xa942('0x2')]();var controller=require(_0xa942('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0xa942('0x4')]('/',controller[_0xa942('0x5')]);router[_0xa942('0x4')](_0xa942('0x6'),controller[_0xa942('0x7')],authService[_0xa942('0x8')],userController[_0xa942('0x5')],authService[_0xa942('0x9')]);module[_0xa942('0xa')]=router; \ No newline at end of file +var _0x5c00=['express','passport','Router','./authGoogle.controller','get','/callback','login','setTokenCookie','exports'];(function(_0x5c3dc6,_0x3b514d){var _0x42ddfa=function(_0x35eeab){while(--_0x35eeab){_0x5c3dc6['push'](_0x5c3dc6['shift']());}};_0x42ddfa(++_0x3b514d);}(_0x5c00,0x75));var _0x05c0=function(_0x5c8f3e,_0x33ba70){_0x5c8f3e=_0x5c8f3e-0x0;var _0xb55f35=_0x5c00[_0x5c8f3e];return _0xb55f35;};'use strict';var express=require(_0x05c0('0x0'));var passport=require(_0x05c0('0x1'));var router=express[_0x05c0('0x2')]();var controller=require(_0x05c0('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0x05c0('0x4')](_0x05c0('0x5'),controller['callback'],authService['isMiddleware'],userController[_0x05c0('0x6')],authService[_0x05c0('0x7')]);module[_0x05c0('0x8')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 38d9fd7..6bd0569 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 _0x1f86=['json','online','forgot','body','trim','User','find','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','clearBlockUser','minutes','getLicense','catch','MailAccount','email','Smtp','service','port','secure','authentication','auth','pass','format','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x1f86,0xb1));var _0x61f8=function(_0x31685d,_0x29ea4e){_0x31685d=_0x31685d-0x0;var _0x55ff04=_0x1f86[_0x31685d];return _0x55ff04;};'use strict';var util=require(_0x61f8('0x0'));var passport=require(_0x61f8('0x1'));var LocalStrategy=require('passport-local')[_0x61f8('0x2')];var jayson=require(_0x61f8('0x3'));var _=require(_0x61f8('0x4'));var rs=require(_0x61f8('0x5'));var moment=require(_0x61f8('0x6'));var db=require(_0x61f8('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x61f8('0x8'));var client=jayson[_0x61f8('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x5b66db,_0x16f724,_0x1c05a0,_0x48f064){var _0x4cb3bf,_0xd13b17;return db[_0x61f8('0xa')][_0x61f8('0xb')]({'where':{'id':0x1},'attributes':[_0x61f8('0xc'),_0x61f8('0xd')],'raw':!![]})[_0x61f8('0xe')](function(_0x470ffc){_0x4cb3bf=_0x470ffc;return _0x5b66db[_0x61f8('0xb')]({'attributes':['id',_0x61f8('0xf'),_0x61f8('0x10'),_0x61f8('0x11'),_0x61f8('0x12'),_0x61f8('0x13'),_0x61f8('0x14'),_0x61f8('0x15'),'loginAttempts'],'where':{'name':_0x16f724,'role':{'$or':['admin',_0x61f8('0x16'),_0x61f8('0x17')]}}});})[_0x61f8('0xe')](function(_0x44f224){if(!_0x44f224||_0x44f224&&_0x44f224['name']!==_0x16f724){throw new Error(_0x61f8('0x18'));}else{_0xd13b17=_0x44f224;return _0xd13b17;}})[_0x61f8('0xe')](function(){_0xd13b17['authenticate'](_0x1c05a0,function(_0x5be28e,_0x15588e){var _0x1691fe=_0xd13b17[_0x61f8('0x19')]+0x1;if(_0x5be28e){return _0x48f064(_0x5be28e);}else if(!_0x15588e){if(_0xd13b17[_0x61f8('0x13')]){return _0x48f064(null,![],{'message':_0x61f8('0x18')});}else if(_0x4cb3bf[_0x61f8('0xc')]>0x0){if(_0xd13b17['blocked']){if(_0x4cb3bf['blockDuration']>0x0){if(moment(_0xd13b17[_0x61f8('0x15')])['add'](_0x4cb3bf[_0x61f8('0xd')],'minutes')>moment()){return _0x48f064(null,![],{'message':_0x61f8('0x18')});}else{return utils['clearBlockUser'](_0xd13b17,_0x1691fe,![],null)[_0x61f8('0xe')](function(){return _0x48f064(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x48f064(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1691fe>=_0x4cb3bf['allowedLoginAttempts']){return utils[_0x61f8('0x1a')](_0xd13b17,0x0,!![],moment())[_0x61f8('0xe')](function(){return _0x48f064(null,![],{'message':_0x61f8('0x18')});});}else{return utils['clearBlockUser'](_0xd13b17,_0x1691fe,![],null)[_0x61f8('0xe')](function(){return _0x48f064(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x48f064(null,![],{'message':_0x61f8('0x18')});}}else{if(_0xd13b17[_0x61f8('0x13')]){return _0x48f064(null,![],{'message':_0x61f8('0x18')});}else if(_0x4cb3bf[_0x61f8('0xc')]>0x0){if(_0xd13b17[_0x61f8('0x14')]){if(_0x4cb3bf[_0x61f8('0xd')]>0x0){if(moment(_0xd13b17[_0x61f8('0x15')])['add'](_0x4cb3bf[_0x61f8('0xd')],_0x61f8('0x1b'))>moment()){return _0x48f064(null,![],{'message':_0x61f8('0x18')});}else{return utils[_0x61f8('0x1a')](_0xd13b17,0x0,![],null)['then'](function(){return utils[_0x61f8('0x1c')](_0xd13b17);})['then'](function(){return _0x48f064(null,_0xd13b17);});}}else{return _0x48f064(null,![],{'message':_0x61f8('0x18')});}}else{return utils[_0x61f8('0x1a')](_0xd13b17,0x0,![],null)[_0x61f8('0xe')](function(){return utils[_0x61f8('0x1c')](_0xd13b17);})[_0x61f8('0xe')](function(){return _0x48f064(null,_0xd13b17);})[_0x61f8('0x1d')](function(_0x1ceaba){return _0x48f064(null,![],_0x1ceaba);});}}else{if(_0xd13b17['blocked']){return _0x48f064(null,![],{'message':_0x61f8('0x18')});}else{return utils['getLicense'](_0xd13b17)[_0x61f8('0xe')](function(){return _0x48f064(null,_0xd13b17);});}}}});})[_0x61f8('0x1d')](function(_0x42092a){return _0x48f064(null,![],_0x42092a);});}function sendServiceMail(_0x195090){return db[_0x61f8('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0x61f8('0xf'),_0x61f8('0x1f')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x61f8('0xe')](function(_0x2cb18a){if(!_0x2cb18a){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3ea001={'tls':{'rejectUnauthorized':![]}};if(_0x2cb18a[_0x61f8('0x20')][_0x61f8('0x21')]){_0x3ea001[_0x61f8('0x21')]=_0x2cb18a['Smtp'][_0x61f8('0x21')];}else{_0x3ea001['host']=_0x2cb18a[_0x61f8('0x20')]['host'];_0x3ea001[_0x61f8('0x22')]=_0x2cb18a['Smtp'][_0x61f8('0x22')];_0x3ea001[_0x61f8('0x23')]=_0x2cb18a['Smtp'][_0x61f8('0x23')];}if(_0x2cb18a[_0x61f8('0x20')][_0x61f8('0x24')]){_0x3ea001[_0x61f8('0x25')]={'user':_0x2cb18a['Smtp'][_0x61f8('0x16')],'pass':_0x2cb18a[_0x61f8('0x20')][_0x61f8('0x26')]};}var _0x5390b8={'account':_0x3ea001,'message':_['merge']({'from':util[_0x61f8('0x27')]('\x22%s\x22\x20<%s>',_0x2cb18a[_0x61f8('0xf')],_0x2cb18a[_0x61f8('0x1f')]||_0x2cb18a['Smtp']['user'])},_0x195090)};return client[_0x61f8('0x28')]('SendMail',_0x5390b8);})[_0x61f8('0xe')](function(_0x3fefe2){if(_0x3fefe2[_0x61f8('0x29')]){throw new Error(util['format'](_0x61f8('0x2a'),_0x3fefe2[_0x61f8('0x29')][_0x61f8('0x2b')]||JSON[_0x61f8('0x2c')](_0x3fefe2[_0x61f8('0x29')])));}return!![];});}function handleError(_0x2bea29,_0x28ac91,_0x27f1a5){return _0x2bea29[_0x61f8('0x2d')](_0x28ac91||0x1f4)[_0x61f8('0x2e')]({'message':_0x27f1a5?_0x27f1a5[_0x61f8('0x2b')]||_0x27f1a5:''});}exports['login']=function(_0xb75809,_0x1d91d3,_0x3cc6eb){passport[_0x61f8('0x2f')](_0x61f8('0x30'),function(_0x113372,_0xcc8856,_0x3df844){var _0x32173c=_0x113372||_0x3df844;if(_0x32173c){return handleError(_0x1d91d3,0x191,_0x32173c);}if(!_0xcc8856){return handleError(_0x1d91d3,0x194,{'message':_0x61f8('0x31')});}else{var _0x1e1395={'payload':{'id':_0xcc8856['id'],'role':_0xcc8856[_0x61f8('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x61f8('0x32')](_0x1e1395)[_0x61f8('0xe')](function(_0x3d7dc1){_0x1d91d3[_0x61f8('0x33')]({'id':_0xcc8856['id'],'token':_0x3d7dc1,'statusCall':'','isAlreadyLogged':_0xcc8856[_0x61f8('0x34')]});});}})(_0xb75809,_0x1d91d3,_0x3cc6eb);};exports[_0x61f8('0x35')]=function(_0x75a832,_0xccacfd,_0x1c7e2a){if(!_0x75a832['body'][_0x61f8('0x1f')]){return handleError(_0xccacfd,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5991a3=rs['generate']();_0x75a832[_0x61f8('0x36')][_0x61f8('0x1f')]=_0x75a832['body']['email'][_0x61f8('0x37')]()['toLowerCase']();var _0x19a07d;return db[_0x61f8('0xa')][_0x61f8('0xb')]({'where':{'id':0x1},'attributes':[_0x61f8('0xc'),_0x61f8('0xd')],'raw':!![]})['then'](function(_0x114419){_0x19a07d=_0x114419;return db[_0x61f8('0x38')][_0x61f8('0x39')]({'where':{'email':_0x75a832[_0x61f8('0x36')][_0x61f8('0x1f')]}});})[_0x61f8('0xe')](function(_0x49a8eb){if(!_0x49a8eb){throw new Error(_0x61f8('0x3a'));}if(_0x49a8eb['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x49a8eb['blocked']){if(moment(_0x49a8eb[_0x61f8('0x15')])['add'](_0x19a07d[_0x61f8('0xd')],_0x61f8('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x49a8eb[_0x61f8('0x14')]=![];_0x49a8eb[_0x61f8('0x15')]=null;}}_0x49a8eb['resetPasswordToken']=_0x5991a3;_0x49a8eb[_0x61f8('0x3b')]=Date[_0x61f8('0x3c')]()+0x36ee80;return _0x49a8eb[_0x61f8('0x3d')]();})[_0x61f8('0xe')](function(){return sendServiceMail({'to':_0x75a832[_0x61f8('0x36')][_0x61f8('0x1f')],'subject':_0x61f8('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x75a832[_0x61f8('0x3f')]['host']+_0x61f8('0x40')+_0x5991a3+'\x0a\x0a'+_0x61f8('0x41')});})[_0x61f8('0xe')](function(){_0xccacfd[_0x61f8('0x2d')](0xc8)['send']({'message':_0x61f8('0x42')});})['catch'](function(_0x2d163c){return handleError(_0xccacfd,0x1f4,_0x2d163c);});};exports[_0x61f8('0x43')]=function(_0x516e15,_0x49b210,_0x45bc19){return db[_0x61f8('0x38')][_0x61f8('0x39')]({'where':{'resetPasswordToken':_0x516e15['params'][_0x61f8('0x44')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x61f8('0xe')](function(_0x4ee388){if(!_0x4ee388){throw new Error(_0x61f8('0x45'));}return db['Setting'][_0x61f8('0xb')]({'attributes':['id','securePassword',_0x61f8('0x46'),_0x61f8('0x47')]})[_0x61f8('0xe')](function(_0x5962ec){if(_0x5962ec[_0x61f8('0x48')])authService['validatePasswordPattern'](_0x516e15[_0x61f8('0x36')]['password']);if(!_0x5962ec[_0x61f8('0x46')]||!_0x4ee388[_0x61f8('0x49')])return _0x4ee388;authService[_0x61f8('0x4a')](_0x516e15[_0x61f8('0x36')][_0x61f8('0x10')],_0x4ee388['previousPasswords'],_0x5962ec[_0x61f8('0x47')]);return _0x4ee388;})[_0x61f8('0xe')](function(){_0x4ee388[_0x61f8('0x10')]=_0x516e15[_0x61f8('0x36')][_0x61f8('0x10')];_0x4ee388['resetPasswordToken']=null;_0x4ee388[_0x61f8('0x3b')]=null;return _0x4ee388[_0x61f8('0x3d')]();});})[_0x61f8('0xe')](function(){_0x49b210[_0x61f8('0x2d')](0xc8)[_0x61f8('0x2e')]({'message':_0x61f8('0x4b')});})['catch'](function(_0x521630){return handleError(_0x49b210,0x1f4,_0x521630);});};passport['use']('local-login',new LocalStrategy({'usernameField':_0x61f8('0xf'),'passwordField':'password'},function(_0x2568c6,_0x30e67d,_0x41fbe9){return localAuthenticate(db['User'],_0x2568c6,_0x30e67d,_0x41fbe9);})); \ No newline at end of file +var _0xebcb=['salt','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','name','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','MailAccount','find','email','MailServerOut','Smtp','service','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','catch','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','local-login','util','passport-local','Strategy','jayson/promise','lodash','moment','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','password'];(function(_0x2bc7bc,_0x827ea){var _0xbae862=function(_0xdde795){while(--_0xdde795){_0x2bc7bc['push'](_0x2bc7bc['shift']());}};_0xbae862(++_0x827ea);}(_0xebcb,0x103));var _0xbebc=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xebcb[_0x2d7f0e];return _0x110b07;};'use strict';var util=require(_0xbebc('0x0'));var passport=require('passport');var LocalStrategy=require(_0xbebc('0x1'))[_0xbebc('0x2')];var jayson=require(_0xbebc('0x3'));var _=require(_0xbebc('0x4'));var rs=require('randomstring');var moment=require(_0xbebc('0x5'));var db=require('../../mysqldb')['db'];var authService=require(_0xbebc('0x6'));var utils=require(_0xbebc('0x7'));var client=jayson[_0xbebc('0x8')][_0xbebc('0x9')]({'port':0x232b});function localAuthenticate(_0x511b00,_0xaa776f,_0x204777,_0x1efc7c){var _0xe22455,_0x1ac7b8;return db[_0xbebc('0xa')][_0xbebc('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xbebc('0xc')],'raw':!![]})['then'](function(_0x536482){_0xe22455=_0x536482;return _0x511b00[_0xbebc('0xb')]({'attributes':['id','name',_0xbebc('0xd'),_0xbebc('0xe'),'role',_0xbebc('0xf'),_0xbebc('0x10'),_0xbebc('0x11'),_0xbebc('0x12')],'where':{'name':_0xaa776f,'role':{'$or':[_0xbebc('0x13'),_0xbebc('0x14'),_0xbebc('0x15')]}}});})['then'](function(_0x55cd40){if(!_0x55cd40||_0x55cd40&&_0x55cd40[_0xbebc('0x16')]!==_0xaa776f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1ac7b8=_0x55cd40;return _0x1ac7b8;}})[_0xbebc('0x17')](function(){_0x1ac7b8[_0xbebc('0x18')](_0x204777,function(_0x48d37a,_0x2d78fb){var _0xb75908=_0x1ac7b8[_0xbebc('0x12')]+0x1;if(_0x48d37a){return _0x1efc7c(_0x48d37a);}else if(!_0x2d78fb){if(_0x1ac7b8['disabled']){return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});}else if(_0xe22455[_0xbebc('0x1a')]>0x0){if(_0x1ac7b8[_0xbebc('0x10')]){if(_0xe22455['blockDuration']>0x0){if(moment(_0x1ac7b8['blockedAt'])[_0xbebc('0x1b')](_0xe22455['blockDuration'],_0xbebc('0x1c'))>moment()){return _0x1efc7c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xbebc('0x1d')](_0x1ac7b8,_0xb75908,![],null)[_0xbebc('0x17')](function(){return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});});}}else{return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});}}else{if(_0xb75908>=_0xe22455['allowedLoginAttempts']){return utils[_0xbebc('0x1d')](_0x1ac7b8,0x0,!![],moment())[_0xbebc('0x17')](function(){return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});});}else{return utils[_0xbebc('0x1d')](_0x1ac7b8,_0xb75908,![],null)[_0xbebc('0x17')](function(){return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});});}}}else{return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});}}else{if(_0x1ac7b8[_0xbebc('0xf')]){return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});}else if(_0xe22455[_0xbebc('0x1a')]>0x0){if(_0x1ac7b8['blocked']){if(_0xe22455[_0xbebc('0xc')]>0x0){if(moment(_0x1ac7b8[_0xbebc('0x11')])[_0xbebc('0x1b')](_0xe22455[_0xbebc('0xc')],_0xbebc('0x1c'))>moment()){return _0x1efc7c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xbebc('0x1d')](_0x1ac7b8,0x0,![],null)[_0xbebc('0x17')](function(){return utils['getLicense'](_0x1ac7b8);})[_0xbebc('0x17')](function(){return _0x1efc7c(null,_0x1ac7b8);});}}else{return _0x1efc7c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xbebc('0x1d')](_0x1ac7b8,0x0,![],null)[_0xbebc('0x17')](function(){return utils[_0xbebc('0x1e')](_0x1ac7b8);})[_0xbebc('0x17')](function(){return _0x1efc7c(null,_0x1ac7b8);})['catch'](function(_0x4a483f){return _0x1efc7c(null,![],_0x4a483f);});}}else{if(_0x1ac7b8['blocked']){return _0x1efc7c(null,![],{'message':_0xbebc('0x19')});}else{return utils[_0xbebc('0x1e')](_0x1ac7b8)['then'](function(){return _0x1efc7c(null,_0x1ac7b8);});}}}});})['catch'](function(_0x1ca006){return _0x1efc7c(null,![],_0x1ca006);});}function sendServiceMail(_0x438347){return db[_0xbebc('0x1f')][_0xbebc('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0xbebc('0x21')],'include':[{'model':db[_0xbebc('0x22')],'as':_0xbebc('0x23')}]})['then'](function(_0x176db1){if(!_0x176db1){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x47502c={'tls':{'rejectUnauthorized':![]}};if(_0x176db1[_0xbebc('0x23')]['service']){_0x47502c['service']=_0x176db1[_0xbebc('0x23')][_0xbebc('0x24')];}else{_0x47502c['host']=_0x176db1[_0xbebc('0x23')]['host'];_0x47502c[_0xbebc('0x25')]=_0x176db1[_0xbebc('0x23')][_0xbebc('0x25')];_0x47502c[_0xbebc('0x26')]=_0x176db1['Smtp']['secure'];}if(_0x176db1[_0xbebc('0x23')][_0xbebc('0x27')]){_0x47502c[_0xbebc('0x28')]={'user':_0x176db1['Smtp'][_0xbebc('0x14')],'pass':_0x176db1[_0xbebc('0x23')][_0xbebc('0x29')]};}var _0x4d9647={'account':_0x47502c,'message':_[_0xbebc('0x2a')]({'from':util[_0xbebc('0x2b')](_0xbebc('0x2c'),_0x176db1[_0xbebc('0x16')],_0x176db1[_0xbebc('0x21')]||_0x176db1[_0xbebc('0x23')][_0xbebc('0x14')])},_0x438347)};return client['request'](_0xbebc('0x2d'),_0x4d9647);})[_0xbebc('0x17')](function(_0x366923){if(_0x366923[_0xbebc('0x2e')]){throw new Error(util['format'](_0xbebc('0x2f'),_0x366923[_0xbebc('0x2e')]['message']||JSON[_0xbebc('0x30')](_0x366923[_0xbebc('0x2e')])));}return!![];});}function handleError(_0x22ec9,_0x2201e6,_0x1535ec){return _0x22ec9[_0xbebc('0x31')](_0x2201e6||0x1f4)[_0xbebc('0x32')]({'message':_0x1535ec?_0x1535ec[_0xbebc('0x33')]||_0x1535ec:''});}exports[_0xbebc('0x34')]=function(_0x284f83,_0x58f051,_0x289495){passport[_0xbebc('0x18')]('local-login',function(_0x26d3c0,_0x5d749c,_0x2319bb){var _0x44b2bd=_0x26d3c0||_0x2319bb;if(_0x44b2bd){return handleError(_0x58f051,0x191,_0x44b2bd);}if(!_0x5d749c){return handleError(_0x58f051,0x194,{'message':_0xbebc('0x35')});}else{var _0x44a8f0={'payload':{'id':_0x5d749c['id'],'role':_0x5d749c[_0xbebc('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0xbebc('0x37')](_0x44a8f0)['then'](function(_0xd59bb0){_0x58f051[_0xbebc('0x38')]({'id':_0x5d749c['id'],'token':_0xd59bb0,'statusCall':'','isAlreadyLogged':_0x5d749c[_0xbebc('0x39')]});});}})(_0x284f83,_0x58f051,_0x289495);};exports[_0xbebc('0x3a')]=function(_0x584b11,_0x181a73,_0x260a3b){if(!_0x584b11[_0xbebc('0x3b')][_0xbebc('0x21')]){return handleError(_0x181a73,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5d01b2=rs[_0xbebc('0x3c')]();_0x584b11['body'][_0xbebc('0x21')]=_0x584b11[_0xbebc('0x3b')][_0xbebc('0x21')][_0xbebc('0x3d')]()[_0xbebc('0x3e')]();var _0x395bf7;return db[_0xbebc('0xa')][_0xbebc('0xb')]({'where':{'id':0x1},'attributes':[_0xbebc('0x1a'),_0xbebc('0xc')],'raw':!![]})[_0xbebc('0x17')](function(_0x5ae70c){_0x395bf7=_0x5ae70c;return db[_0xbebc('0x3f')][_0xbebc('0x20')]({'where':{'email':_0x584b11['body'][_0xbebc('0x21')]}});})[_0xbebc('0x17')](function(_0x5c5c5c){if(!_0x5c5c5c){throw new Error(_0xbebc('0x40'));}if(_0x5c5c5c[_0xbebc('0xf')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x5c5c5c[_0xbebc('0x10')]){if(moment(_0x5c5c5c[_0xbebc('0x11')])[_0xbebc('0x1b')](_0x395bf7['blockDuration'],_0xbebc('0x1c'))>moment()){throw new Error(_0xbebc('0x41'));}else{_0x5c5c5c[_0xbebc('0x10')]=![];_0x5c5c5c[_0xbebc('0x11')]=null;}}_0x5c5c5c[_0xbebc('0x42')]=_0x5d01b2;_0x5c5c5c[_0xbebc('0x43')]=Date[_0xbebc('0x44')]()+0x36ee80;return _0x5c5c5c['save']();})[_0xbebc('0x17')](function(){return sendServiceMail({'to':_0x584b11['body']['email'],'subject':_0xbebc('0x45'),'text':_0xbebc('0x46')+_0xbebc('0x47')+_0xbebc('0x48')+_0x584b11[_0xbebc('0x49')][_0xbebc('0x4a')]+'/reset/'+_0x5d01b2+'\x0a\x0a'+_0xbebc('0x4b')});})[_0xbebc('0x17')](function(){_0x181a73[_0xbebc('0x31')](0xc8)[_0xbebc('0x32')]({'message':_0xbebc('0x4c')});})[_0xbebc('0x4d')](function(_0x4974f8){return handleError(_0x181a73,0x1f4,_0x4974f8);});};exports['reset']=function(_0x13d8d6,_0x244d3e,_0x4a7ba6){return db[_0xbebc('0x3f')]['find']({'where':{'resetPasswordToken':_0x13d8d6[_0xbebc('0x4e')][_0xbebc('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xbebc('0x44')]()}}})[_0xbebc('0x17')](function(_0x15181d){if(!_0x15181d){throw new Error(_0xbebc('0x50'));}return db['Setting'][_0xbebc('0xb')]({'attributes':['id',_0xbebc('0x51'),_0xbebc('0x52'),_0xbebc('0x53')]})['then'](function(_0x2c662d){if(_0x2c662d['securePassword'])authService[_0xbebc('0x54')](_0x13d8d6[_0xbebc('0x3b')][_0xbebc('0xd')]);if(!_0x2c662d[_0xbebc('0x52')]||!_0x15181d[_0xbebc('0x55')])return _0x15181d;authService[_0xbebc('0x56')](_0x13d8d6[_0xbebc('0x3b')][_0xbebc('0xd')],_0x15181d[_0xbebc('0x55')],_0x2c662d[_0xbebc('0x53')]);return _0x15181d;})['then'](function(){_0x15181d[_0xbebc('0xd')]=_0x13d8d6[_0xbebc('0x3b')][_0xbebc('0xd')];_0x15181d['resetPasswordToken']=null;_0x15181d['resetPasswordExpires']=null;return _0x15181d[_0xbebc('0x57')]();});})[_0xbebc('0x17')](function(){_0x244d3e['status'](0xc8)[_0xbebc('0x32')]({'message':_0xbebc('0x58')});})[_0xbebc('0x4d')](function(_0x41967f){return handleError(_0x244d3e,0x1f4,_0x41967f);});};passport[_0xbebc('0x59')](_0xbebc('0x5a'),new LocalStrategy({'usernameField':_0xbebc('0x16'),'passwordField':_0xbebc('0xd')},function(_0x3c39c6,_0x25c518,_0xcff56c){return localAuthenticate(db[_0xbebc('0x3f')],_0x3c39c6,_0x25c518,_0xcff56c);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 9f12990..c5f0f4e 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 _0x452b=['reset','exports','express','./authLocal.controller','login','/forgot','forgot','post','/reset/:token'];(function(_0x52d596,_0x4c6131){var _0x39f68b=function(_0x3f07ae){while(--_0x3f07ae){_0x52d596['push'](_0x52d596['shift']());}};_0x39f68b(++_0x4c6131);}(_0x452b,0x12b));var _0xb452=function(_0x6a27db,_0x2731a7){_0x6a27db=_0x6a27db-0x0;var _0xd814f5=_0x452b[_0x6a27db];return _0xd814f5;};'use strict';var express=require(_0xb452('0x0'));var router=express['Router']();var controller=require(_0xb452('0x1'));router['post']('/',controller[_0xb452('0x2')]);router['post'](_0xb452('0x3'),controller[_0xb452('0x4')]);router[_0xb452('0x5')](_0xb452('0x6'),controller[_0xb452('0x7')]);module[_0xb452('0x8')]=router; \ No newline at end of file +var _0xa256=['Router','./authLocal.controller','post','/forgot','/reset/:token','reset','exports'];(function(_0x100d58,_0x50e00d){var _0xc4e7c1=function(_0x48b0b8){while(--_0x48b0b8){_0x100d58['push'](_0x100d58['shift']());}};_0xc4e7c1(++_0x50e00d);}(_0xa256,0x1ab));var _0x6a25=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa256[_0x4bfac3];return _0x15f0f2;};'use strict';var express=require('express');var router=express[_0x6a25('0x0')]();var controller=require(_0x6a25('0x1'));router['post']('/',controller['login']);router[_0x6a25('0x2')](_0x6a25('0x3'),controller['forgot']);router[_0x6a25('0x2')](_0x6a25('0x4'),controller[_0x6a25('0x5')]);module[_0x6a25('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 41a2104..abc5b76 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 _0x507b=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x4f49ad,_0x2961f1){var _0x6426dc=function(_0x58bfd5){while(--_0x58bfd5){_0x4f49ad['push'](_0x4f49ad['shift']());}};_0x6426dc(++_0x2961f1);}(_0x507b,0xc5));var _0xb507=function(_0x166a1f,_0x3cb8d9){_0x166a1f=_0x166a1f-0x0;var _0x8bca3c=_0x507b[_0x166a1f];return _0x8bca3c;};'use strict';var Sequelize=require(_0xb507('0x0'));module[_0xb507('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb507('0x2')]},'status':{'type':Sequelize[_0xb507('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb507('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xf7f7=['sequelize','STRING','BOOLEAN'];(function(_0x25e503,_0x4e64b7){var _0x2c5d9a=function(_0x542a0b){while(--_0x542a0b){_0x25e503['push'](_0x25e503['shift']());}};_0x2c5d9a(++_0x4e64b7);}(_0xf7f7,0x168));var _0x7f7f=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0xf7f7[_0x55c485];return _0x6bb521;};'use strict';var Sequelize=require(_0x7f7f('0x0'));module['exports']={'name':{'type':Sequelize[_0x7f7f('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7f7f('0x1')]},'status':{'type':Sequelize[_0x7f7f('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 8327e2f..342dc28 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 _0x939f=['options','includeAll','include','Automation','findAll','catch','show','create','body','params','find','Condition','addConditions','omit','ids','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','error','send','index','map','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter'];(function(_0x34bd9a,_0x2afa2c){var _0x461986=function(_0x2093ef){while(--_0x2093ef){_0x34bd9a['push'](_0x34bd9a['shift']());}};_0x461986(++_0x2afa2c);}(_0x939f,0x120));var _0xf939=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0x939f[_0x445101];return _0x3c3d04;};'use strict';var emlformat=require(_0xf939('0x0'));var rimraf=require(_0xf939('0x1'));var zipdir=require(_0xf939('0x2'));var jsonpatch=require(_0xf939('0x3'));var rp=require(_0xf939('0x4'));var moment=require('moment');var BPromise=require(_0xf939('0x5'));var Mustache=require(_0xf939('0x6'));var util=require(_0xf939('0x7'));var path=require(_0xf939('0x8'));var sox=require('sox');var csv=require(_0xf939('0x9'));var ejs=require(_0xf939('0xa'));var fs=require('fs');var fs_extra=require(_0xf939('0xb'));var _=require(_0xf939('0xc'));var squel=require(_0xf939('0xd'));var crypto=require(_0xf939('0xe'));var jsforce=require(_0xf939('0xf'));var deskjs=require(_0xf939('0x10'));var toCsv=require(_0xf939('0x9'));var querystring=require(_0xf939('0x11'));var Papa=require(_0xf939('0x12'));var Redis=require(_0xf939('0x13'));var authService=require(_0xf939('0x14'));var qs=require(_0xf939('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf939('0x16'));var logger=require(_0xf939('0x17'))(_0xf939('0x18'));var utils=require(_0xf939('0x19'));var config=require(_0xf939('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xf939('0x1b'))['db'];function respondWithStatusCode(_0x56dc78,_0x3c2408){_0x3c2408=_0x3c2408||0xcc;return function(_0x1dd2ae){if(_0x1dd2ae){return _0x56dc78[_0xf939('0x1c')](_0x3c2408);}return _0x56dc78['status'](_0x3c2408)[_0xf939('0x1d')]();};}function respondWithResult(_0x469587,_0x4baf2e){_0x4baf2e=_0x4baf2e||0xc8;return function(_0x1935ab){if(_0x1935ab){return _0x469587[_0xf939('0x1e')](_0x4baf2e)[_0xf939('0x1f')](_0x1935ab);}};}function respondWithFilteredResult(_0x58eae5,_0x533d87){return function(_0x1989aa){if(_0x1989aa){var _0x585c4d=typeof _0x533d87[_0xf939('0x20')]===_0xf939('0x21')&&typeof _0x533d87['limit']===_0xf939('0x21');var _0x52026d=_0x1989aa['count'];var _0x32fbe5=_0x585c4d?0x0:_0x533d87[_0xf939('0x20')];var _0x5a4ea3=_0x585c4d?_0x1989aa[_0xf939('0x22')]:_0x533d87[_0xf939('0x20')]+_0x533d87[_0xf939('0x23')];var _0x53b079;if(_0x5a4ea3>=_0x52026d){_0x5a4ea3=_0x52026d;_0x53b079=0xc8;}else{_0x53b079=0xce;}_0x58eae5['status'](_0x53b079);return _0x58eae5[_0xf939('0x24')](_0xf939('0x25'),_0x32fbe5+'-'+_0x5a4ea3+'/'+_0x52026d)[_0xf939('0x1f')](_0x1989aa);}return null;};}function patchUpdates(_0x181abd){return function(_0x4c5302){try{jsonpatch[_0xf939('0x26')](_0x4c5302,_0x181abd,!![]);}catch(_0x2e91a7){return BPromise['reject'](_0x2e91a7);}return _0x4c5302[_0xf939('0x27')]();};}function saveUpdates(_0x1923d3,_0x1acdfc){return function(_0x145026){if(_0x145026){return _0x145026[_0xf939('0x28')](_0x1923d3)['then'](function(_0x490db8){return _0x490db8;});}return null;};}function removeEntity(_0x3f9b82,_0x176d44){return function(_0x2d7a78){if(_0x2d7a78){return _0x2d7a78[_0xf939('0x29')]()[_0xf939('0x2a')](function(){_0x3f9b82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16a971,_0x5c5c7c){return function(_0x5cadf7){if(!_0x5cadf7){_0x16a971[_0xf939('0x1c')](0x194);}return _0x5cadf7;};}function handleError(_0x479a85,_0x428156){_0x428156=_0x428156||0x1f4;return function(_0x2e3826){logger[_0xf939('0x2b')](_0x2e3826['stack']);if(_0x2e3826['name']){delete _0x2e3826['name'];}_0x479a85[_0xf939('0x1e')](_0x428156)[_0xf939('0x2c')](_0x2e3826);};}exports[_0xf939('0x2d')]=function(_0x5c66bb,_0x7f7346){var _0x1f3ef5={},_0x4c37c6={},_0xf2bd38={'count':0x0,'rows':[]};var _0x90a68b=_[_0xf939('0x2e')](db['Automation'][_0xf939('0x2f')],function(_0x168021){return{'name':_0x168021[_0xf939('0x30')],'type':_0x168021['type'][_0xf939('0x31')]};});_0x4c37c6[_0xf939('0x32')]=_[_0xf939('0x2e')](_0x90a68b,_0xf939('0x33'));_0x4c37c6[_0xf939('0x34')]=_[_0xf939('0x35')](_0x5c66bb['query']);_0x4c37c6[_0xf939('0x36')]=_[_0xf939('0x37')](_0x4c37c6['model'],_0x4c37c6[_0xf939('0x34')]);_0x1f3ef5['attributes']=_[_0xf939('0x37')](_0x4c37c6[_0xf939('0x32')],qs[_0xf939('0x38')](_0x5c66bb[_0xf939('0x34')][_0xf939('0x38')]));_0x1f3ef5[_0xf939('0x39')]=_0x1f3ef5[_0xf939('0x39')][_0xf939('0x3a')]?_0x1f3ef5[_0xf939('0x39')]:_0x4c37c6[_0xf939('0x32')];if(!_0x5c66bb[_0xf939('0x34')]['hasOwnProperty'](_0xf939('0x3b'))){_0x1f3ef5[_0xf939('0x23')]=qs['limit'](_0x5c66bb[_0xf939('0x34')]['limit']);_0x1f3ef5[_0xf939('0x20')]=qs[_0xf939('0x20')](_0x5c66bb[_0xf939('0x34')]['offset']);}_0x1f3ef5[_0xf939('0x3c')]=qs[_0xf939('0x3d')](_0x5c66bb[_0xf939('0x34')]['sort']);_0x1f3ef5[_0xf939('0x3e')]=qs[_0xf939('0x36')](_[_0xf939('0x3f')](_0x5c66bb[_0xf939('0x34')],_0x4c37c6[_0xf939('0x36')]),_0x90a68b);if(_0x5c66bb[_0xf939('0x34')]['filter']){_0x1f3ef5[_0xf939('0x3e')]=_[_0xf939('0x40')](_0x1f3ef5[_0xf939('0x3e')],{'$or':_[_0xf939('0x2e')](_0x90a68b,function(_0x108903){if(_0x108903[_0xf939('0x41')]!==_0xf939('0x42')){var _0x560b95={};_0x560b95[_0x108903[_0xf939('0x33')]]={'$like':'%'+_0x5c66bb[_0xf939('0x34')][_0xf939('0x43')]+'%'};return _0x560b95;}})});}_0x1f3ef5=_['merge']({},_0x1f3ef5,_0x5c66bb[_0xf939('0x44')]);var _0x825cf2={'where':_0x1f3ef5[_0xf939('0x3e')]};return db['Automation']['count'](_0x825cf2)['then'](function(_0x1619f5){_0xf2bd38['count']=_0x1619f5;if(_0x5c66bb[_0xf939('0x34')][_0xf939('0x45')]){_0x1f3ef5[_0xf939('0x46')]=[{'all':!![]}];}return db[_0xf939('0x47')][_0xf939('0x48')](_0x1f3ef5);})[_0xf939('0x2a')](function(_0x2df908){_0xf2bd38['rows']=_0x2df908;return _0xf2bd38;})[_0xf939('0x2a')](respondWithFilteredResult(_0x7f7346,_0x1f3ef5))[_0xf939('0x49')](handleError(_0x7f7346,null));};exports[_0xf939('0x4a')]=function(_0x4a688d,_0xd88192){var _0x264188={'raw':![],'where':{'id':_0x4a688d['params']['id']}},_0x524052={};_0x524052['model']=_[_0xf939('0x35')](db[_0xf939('0x47')][_0xf939('0x2f')]);_0x524052[_0xf939('0x34')]=_['keys'](_0x4a688d[_0xf939('0x34')]);_0x524052['filters']=_[_0xf939('0x37')](_0x524052[_0xf939('0x32')],_0x524052['query']);_0x264188[_0xf939('0x39')]=_[_0xf939('0x37')](_0x524052[_0xf939('0x32')],qs[_0xf939('0x38')](_0x4a688d['query'][_0xf939('0x38')]));_0x264188['attributes']=_0x264188[_0xf939('0x39')][_0xf939('0x3a')]?_0x264188[_0xf939('0x39')]:_0x524052['model'];if(_0x4a688d[_0xf939('0x34')][_0xf939('0x45')]){_0x264188['include']=[{'all':!![]}];}_0x264188=_[_0xf939('0x40')]({},_0x264188,_0x4a688d[_0xf939('0x44')]);return db[_0xf939('0x47')]['find'](_0x264188)['then'](handleEntityNotFound(_0xd88192,null))[_0xf939('0x2a')](respondWithResult(_0xd88192,null))[_0xf939('0x49')](handleError(_0xd88192,null));};exports[_0xf939('0x4b')]=function(_0x1bfdbe,_0x1c23e4){return db['Automation'][_0xf939('0x4b')](_0x1bfdbe['body'],{})[_0xf939('0x2a')](respondWithResult(_0x1c23e4,0xc9))['catch'](handleError(_0x1c23e4,null));};exports[_0xf939('0x28')]=function(_0x22bd2b,_0x55eb2){if(_0x22bd2b[_0xf939('0x4c')]['id']){delete _0x22bd2b[_0xf939('0x4c')]['id'];}return db[_0xf939('0x47')]['find']({'where':{'id':_0x22bd2b[_0xf939('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55eb2,null))[_0xf939('0x2a')](saveUpdates(_0x22bd2b[_0xf939('0x4c')],null))[_0xf939('0x2a')](respondWithResult(_0x55eb2,null))[_0xf939('0x49')](handleError(_0x55eb2,null));};exports[_0xf939('0x29')]=function(_0x2810a7,_0x112b8d){return db[_0xf939('0x47')][_0xf939('0x4e')]({'where':{'id':_0x2810a7['params']['id']}})[_0xf939('0x2a')](handleEntityNotFound(_0x112b8d,null))[_0xf939('0x2a')](removeEntity(_0x112b8d,null))[_0xf939('0x49')](handleError(_0x112b8d,null));};exports['addConditions']=function(_0x32a782,_0x2f2cda,_0x17b427){return db[_0xf939('0x4f')][_0xf939('0x4e')]({'where':{'id':_0x32a782['params']['id']}})[_0xf939('0x2a')](handleEntityNotFound(_0x2f2cda,null))['then'](function(_0x22f099){if(_0x22f099){return _0x22f099[_0xf939('0x50')](_0x32a782[_0xf939('0x4c')]['ids'],_[_0xf939('0x51')](_0x32a782[_0xf939('0x4c')],[_0xf939('0x52'),'id'])||{});}})[_0xf939('0x2a')](respondWithResult(_0x2f2cda,null))[_0xf939('0x49')](handleError(_0x2f2cda,null));};exports[_0xf939('0x53')]=function(_0x4f3ece,_0x1fc041,_0x23105f){var _0x29f30d={};var _0x5cad35={};var _0x3df591;var _0x329a25;return db[_0xf939('0x47')][_0xf939('0x54')]({'where':{'id':_0x4f3ece[_0xf939('0x4d')]['id']}})[_0xf939('0x2a')](handleEntityNotFound(_0x1fc041,null))[_0xf939('0x2a')](function(_0x2698cb){if(_0x2698cb){_0x3df591=_0x2698cb;_0x5cad35[_0xf939('0x32')]=_[_0xf939('0x35')](db[_0xf939('0x4f')][_0xf939('0x2f')]);_0x5cad35[_0xf939('0x34')]=_[_0xf939('0x35')](_0x4f3ece[_0xf939('0x34')]);_0x5cad35[_0xf939('0x36')]=_[_0xf939('0x37')](_0x5cad35[_0xf939('0x32')],_0x5cad35[_0xf939('0x34')]);_0x29f30d['attributes']=_[_0xf939('0x37')](_0x5cad35[_0xf939('0x32')],qs['fields'](_0x4f3ece[_0xf939('0x34')][_0xf939('0x38')]));_0x29f30d['attributes']=_0x29f30d[_0xf939('0x39')][_0xf939('0x3a')]?_0x29f30d[_0xf939('0x39')]:_0x5cad35['model'];_0x29f30d[_0xf939('0x3c')]=qs[_0xf939('0x3d')](_0x4f3ece['query']['sort']);_0x29f30d['where']=qs['filters'](_[_0xf939('0x3f')](_0x4f3ece[_0xf939('0x34')],_0x5cad35[_0xf939('0x36')]));if(_0x4f3ece[_0xf939('0x34')][_0xf939('0x43')]){_0x29f30d[_0xf939('0x3e')]=_[_0xf939('0x40')](_0x29f30d['where'],{'$or':_[_0xf939('0x2e')](_0x29f30d[_0xf939('0x39')],function(_0x28fdb6){var _0x5ac0c7={};_0x5ac0c7[_0x28fdb6]={'$like':'%'+_0x4f3ece[_0xf939('0x34')][_0xf939('0x43')]+'%'};return _0x5ac0c7;})});}_0x29f30d=_[_0xf939('0x40')]({},_0x29f30d,_0x4f3ece['options']);return _0x3df591[_0xf939('0x53')](_0x29f30d);}})['then'](function(_0x37d397){if(_0x37d397){_0x329a25=_0x37d397[_0xf939('0x3a')];if(!_0x4f3ece[_0xf939('0x34')][_0xf939('0x55')](_0xf939('0x3b'))){_0x29f30d[_0xf939('0x23')]=qs[_0xf939('0x23')](_0x4f3ece['query'][_0xf939('0x23')]);_0x29f30d[_0xf939('0x20')]=qs[_0xf939('0x20')](_0x4f3ece[_0xf939('0x34')][_0xf939('0x20')]);}return _0x3df591['getConditions'](_0x29f30d);}})[_0xf939('0x2a')](function(_0x2eb119){if(_0x2eb119){return _0x2eb119?{'count':_0x329a25,'rows':_0x2eb119}:null;}})[_0xf939('0x2a')](respondWithResult(_0x1fc041,null))[_0xf939('0x49')](handleError(_0x1fc041,null));};exports[_0xf939('0x56')]=function(_0x534e02,_0x567030,_0x4ff856){return db[_0xf939('0x57')][_0xf939('0x4e')]({'where':{'id':_0x534e02[_0xf939('0x4d')]['id']}})[_0xf939('0x2a')](handleEntityNotFound(_0x567030,null))['then'](function(_0x269574){if(_0x269574){return _0x269574['addActions'](_0x534e02[_0xf939('0x4c')][_0xf939('0x52')],_[_0xf939('0x51')](_0x534e02[_0xf939('0x4c')],[_0xf939('0x52'),'id'])||{});}})[_0xf939('0x2a')](respondWithResult(_0x567030,null))[_0xf939('0x49')](handleError(_0x567030,null));};exports[_0xf939('0x58')]=function(_0x53297d,_0x1de56a,_0x584c4b){var _0x21f640={};var _0x3f00cd={};var _0x20e809;var _0x32499d;return db[_0xf939('0x47')][_0xf939('0x54')]({'where':{'id':_0x53297d[_0xf939('0x4d')]['id']}})[_0xf939('0x2a')](handleEntityNotFound(_0x1de56a,null))[_0xf939('0x2a')](function(_0x4c028){if(_0x4c028){_0x20e809=_0x4c028;_0x3f00cd['model']=_[_0xf939('0x35')](db[_0xf939('0x57')][_0xf939('0x2f')]);_0x3f00cd[_0xf939('0x34')]=_[_0xf939('0x35')](_0x53297d[_0xf939('0x34')]);_0x3f00cd['filters']=_[_0xf939('0x37')](_0x3f00cd[_0xf939('0x32')],_0x3f00cd['query']);_0x21f640[_0xf939('0x39')]=_[_0xf939('0x37')](_0x3f00cd['model'],qs[_0xf939('0x38')](_0x53297d[_0xf939('0x34')]['fields']));_0x21f640[_0xf939('0x39')]=_0x21f640[_0xf939('0x39')][_0xf939('0x3a')]?_0x21f640[_0xf939('0x39')]:_0x3f00cd[_0xf939('0x32')];_0x21f640['order']=qs['sort'](_0x53297d[_0xf939('0x34')][_0xf939('0x3d')]);_0x21f640[_0xf939('0x3e')]=qs[_0xf939('0x36')](_[_0xf939('0x3f')](_0x53297d[_0xf939('0x34')],_0x3f00cd[_0xf939('0x36')]));if(_0x53297d['query'][_0xf939('0x43')]){_0x21f640[_0xf939('0x3e')]=_[_0xf939('0x40')](_0x21f640[_0xf939('0x3e')],{'$or':_['map'](_0x21f640[_0xf939('0x39')],function(_0x15b606){var _0x5ecd92={};_0x5ecd92[_0x15b606]={'$like':'%'+_0x53297d[_0xf939('0x34')][_0xf939('0x43')]+'%'};return _0x5ecd92;})});}_0x21f640=_['merge']({},_0x21f640,_0x53297d[_0xf939('0x44')]);return _0x20e809[_0xf939('0x58')](_0x21f640);}})[_0xf939('0x2a')](function(_0x4cbf1f){if(_0x4cbf1f){_0x32499d=_0x4cbf1f[_0xf939('0x3a')];if(!_0x53297d[_0xf939('0x34')][_0xf939('0x55')](_0xf939('0x3b'))){_0x21f640['limit']=qs[_0xf939('0x23')](_0x53297d[_0xf939('0x34')]['limit']);_0x21f640[_0xf939('0x20')]=qs[_0xf939('0x20')](_0x53297d[_0xf939('0x34')][_0xf939('0x20')]);}return _0x20e809['getActions'](_0x21f640);}})[_0xf939('0x2a')](function(_0x319edb){if(_0x319edb){return _0x319edb?{'count':_0x32499d,'rows':_0x319edb}:null;}})['then'](respondWithResult(_0x1de56a,null))[_0xf939('0x49')](handleError(_0x1de56a,null));}; \ No newline at end of file +var _0x00c7=['omit','getConditions','findOne','Condition','hasOwnProperty','addActions','getActions','Action','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Automation','includeAll','include','findAll','rows','catch','show','params','create','body','find','addConditions','ids'];(function(_0x52dace,_0x530aa7){var _0x4e43b6=function(_0x40aa29){while(--_0x40aa29){_0x52dace['push'](_0x52dace['shift']());}};_0x4e43b6(++_0x530aa7);}(_0x00c7,0x104));var _0x700c=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0x00c7[_0x5ff517];return _0x19a245;};'use strict';var emlformat=require(_0x700c('0x0'));var rimraf=require(_0x700c('0x1'));var zipdir=require(_0x700c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x700c('0x3'));var moment=require(_0x700c('0x4'));var BPromise=require(_0x700c('0x5'));var Mustache=require('mustache');var util=require(_0x700c('0x6'));var path=require(_0x700c('0x7'));var sox=require(_0x700c('0x8'));var csv=require(_0x700c('0x9'));var ejs=require(_0x700c('0xa'));var fs=require('fs');var fs_extra=require(_0x700c('0xb'));var _=require(_0x700c('0xc'));var squel=require(_0x700c('0xd'));var crypto=require(_0x700c('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x700c('0x9'));var querystring=require(_0x700c('0xf'));var Papa=require(_0x700c('0x10'));var Redis=require(_0x700c('0x11'));var authService=require(_0x700c('0x12'));var qs=require(_0x700c('0x13'));var as=require(_0x700c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x700c('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x700c('0x16'));var licenseUtil=require(_0x700c('0x17'));var db=require(_0x700c('0x18'))['db'];function respondWithStatusCode(_0x404dc6,_0x961165){_0x961165=_0x961165||0xcc;return function(_0x51fb04){if(_0x51fb04){return _0x404dc6[_0x700c('0x19')](_0x961165);}return _0x404dc6[_0x700c('0x1a')](_0x961165)['end']();};}function respondWithResult(_0x1f4598,_0x4dbcfc){_0x4dbcfc=_0x4dbcfc||0xc8;return function(_0x125ac3){if(_0x125ac3){return _0x1f4598[_0x700c('0x1a')](_0x4dbcfc)['json'](_0x125ac3);}};}function respondWithFilteredResult(_0x95a0b2,_0x137838){return function(_0x5db41b){if(_0x5db41b){var _0x11202c=typeof _0x137838['offset']===_0x700c('0x1b')&&typeof _0x137838[_0x700c('0x1c')]==='undefined';var _0x2d5592=_0x5db41b[_0x700c('0x1d')];var _0x423130=_0x11202c?0x0:_0x137838[_0x700c('0x1e')];var _0x3d19e3=_0x11202c?_0x5db41b[_0x700c('0x1d')]:_0x137838['offset']+_0x137838['limit'];var _0x451455;if(_0x3d19e3>=_0x2d5592){_0x3d19e3=_0x2d5592;_0x451455=0xc8;}else{_0x451455=0xce;}_0x95a0b2['status'](_0x451455);return _0x95a0b2['set'](_0x700c('0x1f'),_0x423130+'-'+_0x3d19e3+'/'+_0x2d5592)[_0x700c('0x20')](_0x5db41b);}return null;};}function patchUpdates(_0x43a8a5){return function(_0x25cbe0){try{jsonpatch[_0x700c('0x21')](_0x25cbe0,_0x43a8a5,!![]);}catch(_0x4fa10b){return BPromise['reject'](_0x4fa10b);}return _0x25cbe0[_0x700c('0x22')]();};}function saveUpdates(_0x3c9e80,_0x33178e){return function(_0x1d1edc){if(_0x1d1edc){return _0x1d1edc[_0x700c('0x23')](_0x3c9e80)[_0x700c('0x24')](function(_0x51498f){return _0x51498f;});}return null;};}function removeEntity(_0x2591cf,_0x25c8fb){return function(_0x1050cb){if(_0x1050cb){return _0x1050cb[_0x700c('0x25')]()[_0x700c('0x24')](function(){_0x2591cf[_0x700c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x382d3f,_0x45a145){return function(_0x2859e9){if(!_0x2859e9){_0x382d3f[_0x700c('0x19')](0x194);}return _0x2859e9;};}function handleError(_0x52e4bf,_0x236f6f){_0x236f6f=_0x236f6f||0x1f4;return function(_0x2c7a9c){logger[_0x700c('0x26')](_0x2c7a9c[_0x700c('0x27')]);if(_0x2c7a9c['name']){delete _0x2c7a9c[_0x700c('0x28')];}_0x52e4bf[_0x700c('0x1a')](_0x236f6f)['send'](_0x2c7a9c);};}exports[_0x700c('0x29')]=function(_0x418906,_0xf61a22){var _0x1a553f={},_0x18e499={},_0x21be8c={'count':0x0,'rows':[]};var _0x2b2f8c=_['map'](db['Automation'][_0x700c('0x2a')],function(_0x18975b){return{'name':_0x18975b['fieldName'],'type':_0x18975b[_0x700c('0x2b')][_0x700c('0x2c')]};});_0x18e499[_0x700c('0x2d')]=_[_0x700c('0x2e')](_0x2b2f8c,_0x700c('0x28'));_0x18e499[_0x700c('0x2f')]=_[_0x700c('0x30')](_0x418906[_0x700c('0x2f')]);_0x18e499[_0x700c('0x31')]=_[_0x700c('0x32')](_0x18e499['model'],_0x18e499[_0x700c('0x2f')]);_0x1a553f[_0x700c('0x33')]=_[_0x700c('0x32')](_0x18e499[_0x700c('0x2d')],qs[_0x700c('0x34')](_0x418906[_0x700c('0x2f')][_0x700c('0x34')]));_0x1a553f[_0x700c('0x33')]=_0x1a553f['attributes'][_0x700c('0x35')]?_0x1a553f[_0x700c('0x33')]:_0x18e499[_0x700c('0x2d')];if(!_0x418906[_0x700c('0x2f')]['hasOwnProperty'](_0x700c('0x36'))){_0x1a553f[_0x700c('0x1c')]=qs[_0x700c('0x1c')](_0x418906[_0x700c('0x2f')][_0x700c('0x1c')]);_0x1a553f[_0x700c('0x1e')]=qs[_0x700c('0x1e')](_0x418906[_0x700c('0x2f')][_0x700c('0x1e')]);}_0x1a553f[_0x700c('0x37')]=qs['sort'](_0x418906[_0x700c('0x2f')][_0x700c('0x38')]);_0x1a553f[_0x700c('0x39')]=qs[_0x700c('0x31')](_[_0x700c('0x3a')](_0x418906[_0x700c('0x2f')],_0x18e499[_0x700c('0x31')]),_0x2b2f8c);if(_0x418906[_0x700c('0x2f')]['filter']){_0x1a553f['where']=_[_0x700c('0x3b')](_0x1a553f['where'],{'$or':_[_0x700c('0x2e')](_0x2b2f8c,function(_0x326097){if(_0x326097[_0x700c('0x2b')]!==_0x700c('0x3c')){var _0x383958={};_0x383958[_0x326097[_0x700c('0x28')]]={'$like':'%'+_0x418906['query'][_0x700c('0x3d')]+'%'};return _0x383958;}})});}_0x1a553f=_[_0x700c('0x3b')]({},_0x1a553f,_0x418906[_0x700c('0x3e')]);var _0x5b099e={'where':_0x1a553f[_0x700c('0x39')]};return db[_0x700c('0x3f')][_0x700c('0x1d')](_0x5b099e)['then'](function(_0x1c7996){_0x21be8c[_0x700c('0x1d')]=_0x1c7996;if(_0x418906['query'][_0x700c('0x40')]){_0x1a553f[_0x700c('0x41')]=[{'all':!![]}];}return db['Automation'][_0x700c('0x42')](_0x1a553f);})['then'](function(_0x340a5b){_0x21be8c[_0x700c('0x43')]=_0x340a5b;return _0x21be8c;})[_0x700c('0x24')](respondWithFilteredResult(_0xf61a22,_0x1a553f))[_0x700c('0x44')](handleError(_0xf61a22,null));};exports[_0x700c('0x45')]=function(_0x2afc75,_0x309a4d){var _0x44ff2e={'raw':![],'where':{'id':_0x2afc75[_0x700c('0x46')]['id']}},_0x402390={};_0x402390[_0x700c('0x2d')]=_[_0x700c('0x30')](db[_0x700c('0x3f')][_0x700c('0x2a')]);_0x402390['query']=_[_0x700c('0x30')](_0x2afc75[_0x700c('0x2f')]);_0x402390[_0x700c('0x31')]=_[_0x700c('0x32')](_0x402390['model'],_0x402390[_0x700c('0x2f')]);_0x44ff2e[_0x700c('0x33')]=_[_0x700c('0x32')](_0x402390[_0x700c('0x2d')],qs['fields'](_0x2afc75[_0x700c('0x2f')][_0x700c('0x34')]));_0x44ff2e[_0x700c('0x33')]=_0x44ff2e['attributes'][_0x700c('0x35')]?_0x44ff2e[_0x700c('0x33')]:_0x402390[_0x700c('0x2d')];if(_0x2afc75[_0x700c('0x2f')][_0x700c('0x40')]){_0x44ff2e[_0x700c('0x41')]=[{'all':!![]}];}_0x44ff2e=_['merge']({},_0x44ff2e,_0x2afc75[_0x700c('0x3e')]);return db[_0x700c('0x3f')]['find'](_0x44ff2e)['then'](handleEntityNotFound(_0x309a4d,null))[_0x700c('0x24')](respondWithResult(_0x309a4d,null))[_0x700c('0x44')](handleError(_0x309a4d,null));};exports[_0x700c('0x47')]=function(_0x3f3139,_0x2962c){return db[_0x700c('0x3f')]['create'](_0x3f3139[_0x700c('0x48')],{})[_0x700c('0x24')](respondWithResult(_0x2962c,0xc9))[_0x700c('0x44')](handleError(_0x2962c,null));};exports[_0x700c('0x23')]=function(_0x3aaf53,_0x2e3723){if(_0x3aaf53['body']['id']){delete _0x3aaf53[_0x700c('0x48')]['id'];}return db[_0x700c('0x3f')][_0x700c('0x49')]({'where':{'id':_0x3aaf53['params']['id']}})[_0x700c('0x24')](handleEntityNotFound(_0x2e3723,null))['then'](saveUpdates(_0x3aaf53['body'],null))['then'](respondWithResult(_0x2e3723,null))[_0x700c('0x44')](handleError(_0x2e3723,null));};exports[_0x700c('0x25')]=function(_0x2c145e,_0x28c7e2){return db['Automation'][_0x700c('0x49')]({'where':{'id':_0x2c145e[_0x700c('0x46')]['id']}})[_0x700c('0x24')](handleEntityNotFound(_0x28c7e2,null))['then'](removeEntity(_0x28c7e2,null))[_0x700c('0x44')](handleError(_0x28c7e2,null));};exports[_0x700c('0x4a')]=function(_0x4ca92c,_0x387808,_0x553c08){return db['Condition']['find']({'where':{'id':_0x4ca92c[_0x700c('0x46')]['id']}})[_0x700c('0x24')](handleEntityNotFound(_0x387808,null))[_0x700c('0x24')](function(_0x408c6a){if(_0x408c6a){return _0x408c6a['addConditions'](_0x4ca92c[_0x700c('0x48')][_0x700c('0x4b')],_[_0x700c('0x4c')](_0x4ca92c['body'],[_0x700c('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x387808,null))[_0x700c('0x44')](handleError(_0x387808,null));};exports[_0x700c('0x4d')]=function(_0x4b0b9a,_0x267ab0,_0x45d446){var _0x34c139={};var _0x544232={};var _0x55430e;var _0x2c4772;return db['Automation'][_0x700c('0x4e')]({'where':{'id':_0x4b0b9a[_0x700c('0x46')]['id']}})[_0x700c('0x24')](handleEntityNotFound(_0x267ab0,null))[_0x700c('0x24')](function(_0x4deb86){if(_0x4deb86){_0x55430e=_0x4deb86;_0x544232['model']=_[_0x700c('0x30')](db[_0x700c('0x4f')][_0x700c('0x2a')]);_0x544232[_0x700c('0x2f')]=_[_0x700c('0x30')](_0x4b0b9a['query']);_0x544232['filters']=_[_0x700c('0x32')](_0x544232[_0x700c('0x2d')],_0x544232[_0x700c('0x2f')]);_0x34c139['attributes']=_[_0x700c('0x32')](_0x544232[_0x700c('0x2d')],qs[_0x700c('0x34')](_0x4b0b9a[_0x700c('0x2f')]['fields']));_0x34c139['attributes']=_0x34c139[_0x700c('0x33')][_0x700c('0x35')]?_0x34c139[_0x700c('0x33')]:_0x544232['model'];_0x34c139['order']=qs['sort'](_0x4b0b9a['query']['sort']);_0x34c139[_0x700c('0x39')]=qs[_0x700c('0x31')](_[_0x700c('0x3a')](_0x4b0b9a[_0x700c('0x2f')],_0x544232[_0x700c('0x31')]));if(_0x4b0b9a['query'][_0x700c('0x3d')]){_0x34c139[_0x700c('0x39')]=_[_0x700c('0x3b')](_0x34c139['where'],{'$or':_[_0x700c('0x2e')](_0x34c139[_0x700c('0x33')],function(_0x4615ec){var _0x4a64a6={};_0x4a64a6[_0x4615ec]={'$like':'%'+_0x4b0b9a['query'][_0x700c('0x3d')]+'%'};return _0x4a64a6;})});}_0x34c139=_['merge']({},_0x34c139,_0x4b0b9a[_0x700c('0x3e')]);return _0x55430e[_0x700c('0x4d')](_0x34c139);}})['then'](function(_0x326732){if(_0x326732){_0x2c4772=_0x326732[_0x700c('0x35')];if(!_0x4b0b9a[_0x700c('0x2f')][_0x700c('0x50')](_0x700c('0x36'))){_0x34c139[_0x700c('0x1c')]=qs[_0x700c('0x1c')](_0x4b0b9a[_0x700c('0x2f')][_0x700c('0x1c')]);_0x34c139[_0x700c('0x1e')]=qs[_0x700c('0x1e')](_0x4b0b9a['query']['offset']);}return _0x55430e[_0x700c('0x4d')](_0x34c139);}})[_0x700c('0x24')](function(_0x23453c){if(_0x23453c){return _0x23453c?{'count':_0x2c4772,'rows':_0x23453c}:null;}})[_0x700c('0x24')](respondWithResult(_0x267ab0,null))[_0x700c('0x44')](handleError(_0x267ab0,null));};exports[_0x700c('0x51')]=function(_0x401bee,_0x2dc30b,_0x227bb7){return db['Action'][_0x700c('0x49')]({'where':{'id':_0x401bee['params']['id']}})[_0x700c('0x24')](handleEntityNotFound(_0x2dc30b,null))[_0x700c('0x24')](function(_0x2117ba){if(_0x2117ba){return _0x2117ba[_0x700c('0x51')](_0x401bee['body'][_0x700c('0x4b')],_['omit'](_0x401bee[_0x700c('0x48')],[_0x700c('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x2dc30b,null))[_0x700c('0x44')](handleError(_0x2dc30b,null));};exports[_0x700c('0x52')]=function(_0x3d44b4,_0x37fba5,_0x596877){var _0x1eba4f={};var _0xecb39b={};var _0x1b4172;var _0x189f46;return db['Automation'][_0x700c('0x4e')]({'where':{'id':_0x3d44b4['params']['id']}})[_0x700c('0x24')](handleEntityNotFound(_0x37fba5,null))[_0x700c('0x24')](function(_0x49dfc9){if(_0x49dfc9){_0x1b4172=_0x49dfc9;_0xecb39b['model']=_[_0x700c('0x30')](db[_0x700c('0x53')]['rawAttributes']);_0xecb39b['query']=_[_0x700c('0x30')](_0x3d44b4[_0x700c('0x2f')]);_0xecb39b[_0x700c('0x31')]=_['intersection'](_0xecb39b[_0x700c('0x2d')],_0xecb39b[_0x700c('0x2f')]);_0x1eba4f[_0x700c('0x33')]=_[_0x700c('0x32')](_0xecb39b[_0x700c('0x2d')],qs['fields'](_0x3d44b4[_0x700c('0x2f')][_0x700c('0x34')]));_0x1eba4f[_0x700c('0x33')]=_0x1eba4f[_0x700c('0x33')][_0x700c('0x35')]?_0x1eba4f[_0x700c('0x33')]:_0xecb39b[_0x700c('0x2d')];_0x1eba4f[_0x700c('0x37')]=qs[_0x700c('0x38')](_0x3d44b4['query']['sort']);_0x1eba4f[_0x700c('0x39')]=qs[_0x700c('0x31')](_[_0x700c('0x3a')](_0x3d44b4[_0x700c('0x2f')],_0xecb39b[_0x700c('0x31')]));if(_0x3d44b4[_0x700c('0x2f')][_0x700c('0x3d')]){_0x1eba4f[_0x700c('0x39')]=_[_0x700c('0x3b')](_0x1eba4f[_0x700c('0x39')],{'$or':_[_0x700c('0x2e')](_0x1eba4f[_0x700c('0x33')],function(_0x4883c1){var _0x41c9d4={};_0x41c9d4[_0x4883c1]={'$like':'%'+_0x3d44b4['query'][_0x700c('0x3d')]+'%'};return _0x41c9d4;})});}_0x1eba4f=_['merge']({},_0x1eba4f,_0x3d44b4[_0x700c('0x3e')]);return _0x1b4172[_0x700c('0x52')](_0x1eba4f);}})[_0x700c('0x24')](function(_0x286cbf){if(_0x286cbf){_0x189f46=_0x286cbf[_0x700c('0x35')];if(!_0x3d44b4[_0x700c('0x2f')]['hasOwnProperty'](_0x700c('0x36'))){_0x1eba4f[_0x700c('0x1c')]=qs['limit'](_0x3d44b4['query'][_0x700c('0x1c')]);_0x1eba4f[_0x700c('0x1e')]=qs['offset'](_0x3d44b4[_0x700c('0x2f')][_0x700c('0x1e')]);}return _0x1b4172[_0x700c('0x52')](_0x1eba4f);}})[_0x700c('0x24')](function(_0x30049e){if(_0x30049e){return _0x30049e?{'count':_0x189f46,'rows':_0x30049e}:null;}})[_0x700c('0x24')](respondWithResult(_0x37fba5,null))[_0x700c('0x44')](handleError(_0x37fba5,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 4769757..dbed7f4 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 _0xe40d=['bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xe40d,0xcd));var _0xde40=function(_0x2c5b79,_0x5b1e73){_0x2c5b79=_0x2c5b79-0x0;var _0x4bac33=_0xe40d[_0x2c5b79];return _0x4bac33;};'use strict';var _=require(_0xde40('0x0'));var util=require(_0xde40('0x1'));var logger=require(_0xde40('0x2'))(_0xde40('0x3'));var moment=require(_0xde40('0x4'));var BPromise=require(_0xde40('0x5'));var rp=require(_0xde40('0x6'));var fs=require('fs');var path=require(_0xde40('0x7'));var rimraf=require(_0xde40('0x8'));var config=require(_0xde40('0x9'));var attributes=require(_0xde40('0xa'));module[_0xde40('0xb')]=function(_0x530042,_0x479883){return _0x530042['define'](_0xde40('0xc'),attributes,{'tableName':_0xde40('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x941e=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','Automation','tools_automations','lodash'];(function(_0x246573,_0x4957fc){var _0x5187d0=function(_0x3c16a3){while(--_0x3c16a3){_0x246573['push'](_0x246573['shift']());}};_0x5187d0(++_0x4957fc);}(_0x941e,0x10d));var _0xe941=function(_0xb347cc,_0x1ed171){_0xb347cc=_0xb347cc-0x0;var _0x463ca3=_0x941e[_0xb347cc];return _0x463ca3;};'use strict';var _=require(_0xe941('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe941('0x1'));var moment=require(_0xe941('0x2'));var BPromise=require(_0xe941('0x3'));var rp=require(_0xe941('0x4'));var fs=require('fs');var path=require(_0xe941('0x5'));var rimraf=require(_0xe941('0x6'));var config=require(_0xe941('0x7'));var attributes=require('./automation.attributes');module['exports']=function(_0x2f3936,_0x229f15){return _0x2f3936['define'](_0xe941('0x8'),attributes,{'tableName':_0xe941('0x9'),'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 e4ba747..9cb5d42 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 _0x7366=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','Automation,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x58e93e,_0x20b073){var _0x46692a=function(_0x57b778){while(--_0x57b778){_0x58e93e['push'](_0x58e93e['shift']());}};_0x46692a(++_0x20b073);}(_0x7366,0x9d));var _0x6736=function(_0x2af46c,_0x182828){_0x2af46c=_0x2af46c-0x0;var _0x891575=_0x7366[_0x2af46c];return _0x891575;};'use strict';var _=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var moment=require(_0x6736('0x2'));var BPromise=require(_0x6736('0x3'));var rs=require(_0x6736('0x4'));var fs=require('fs');var Redis=require(_0x6736('0x5'));var db=require(_0x6736('0x6'))['db'];var utils=require(_0x6736('0x7'));var logger=require(_0x6736('0x8'))('rpc');var config=require(_0x6736('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6736('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32e0c1,_0x2cc35d,_0x4f4944){return new BPromise(function(_0x123b3c,_0x3a966c){return client[_0x6736('0xb')](_0x32e0c1,_0x4f4944)['then'](function(_0x1d0c58){logger[_0x6736('0xc')](_0x6736('0xd'),_0x2cc35d,'request\x20sent');logger[_0x6736('0xe')]('Automation,\x20%s,\x20%s,\x20%s',_0x2cc35d,_0x6736('0xf'),JSON[_0x6736('0x10')](_0x1d0c58));if(_0x1d0c58['error']){if(_0x1d0c58[_0x6736('0x11')][_0x6736('0x12')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x2cc35d,_0x1d0c58['error'][_0x6736('0x13')]);return _0x3a966c(_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);}logger[_0x6736('0x11')](_0x6736('0xd'),_0x2cc35d,_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);return _0x123b3c(_0x1d0c58[_0x6736('0x11')][_0x6736('0x13')]);}else{logger[_0x6736('0xc')](_0x6736('0xd'),_0x2cc35d,_0x6736('0xf'));_0x123b3c(_0x1d0c58[_0x6736('0x14')][_0x6736('0x13')]);}})[_0x6736('0x15')](function(_0x3290a1){logger['error'](_0x6736('0xd'),_0x2cc35d,_0x3290a1);_0x3a966c(_0x3290a1);});});} \ No newline at end of file +var _0x6f83=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6f83,0x72));var _0x36f8=function(_0x1096b0,_0x282ad9){_0x1096b0=_0x1096b0-0x0;var _0x1c6289=_0x6f83[_0x1096b0];return _0x1c6289;};'use strict';var _=require('lodash');var util=require(_0x36f8('0x0'));var moment=require(_0x36f8('0x1'));var BPromise=require('bluebird');var rs=require(_0x36f8('0x2'));var fs=require('fs');var Redis=require(_0x36f8('0x3'));var db=require(_0x36f8('0x4'))['db'];var utils=require(_0x36f8('0x5'));var logger=require(_0x36f8('0x6'))(_0x36f8('0x7'));var config=require(_0x36f8('0x8'));var jayson=require(_0x36f8('0x9'));var client=jayson[_0x36f8('0xa')][_0x36f8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27d94b,_0x2c0367,_0x370a97){return new BPromise(function(_0x3fe644,_0x22b992){return client[_0x36f8('0xc')](_0x27d94b,_0x370a97)['then'](function(_0x48c7b2){logger['info'](_0x36f8('0xd'),_0x2c0367,_0x36f8('0xe'));logger[_0x36f8('0xf')](_0x36f8('0x10'),_0x2c0367,_0x36f8('0xe'),JSON[_0x36f8('0x11')](_0x48c7b2));if(_0x48c7b2[_0x36f8('0x12')]){if(_0x48c7b2[_0x36f8('0x12')][_0x36f8('0x13')]===0x1f4){logger['error'](_0x36f8('0xd'),_0x2c0367,_0x48c7b2[_0x36f8('0x12')][_0x36f8('0x14')]);return _0x22b992(_0x48c7b2[_0x36f8('0x12')]['message']);}logger[_0x36f8('0x12')](_0x36f8('0xd'),_0x2c0367,_0x48c7b2[_0x36f8('0x12')]['message']);return _0x3fe644(_0x48c7b2[_0x36f8('0x12')][_0x36f8('0x14')]);}else{logger[_0x36f8('0x15')]('Automation,\x20%s,\x20%s',_0x2c0367,_0x36f8('0xe'));_0x3fe644(_0x48c7b2[_0x36f8('0x16')][_0x36f8('0x14')]);}})[_0x36f8('0x17')](function(_0x5ec545){logger['error'](_0x36f8('0xd'),_0x2c0367,_0x5ec545);_0x22b992(_0x5ec545);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 63b5a5d..ddc7785 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 _0xe0e7=['getConditions','isAuthenticated','getActions','post','addConditions','/:id/actions','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','show','/:id/conditions'];(function(_0x5ce598,_0x4827af){var _0x32c150=function(_0x4e87f7){while(--_0x4e87f7){_0x5ce598['push'](_0x5ce598['shift']());}};_0x32c150(++_0x4827af);}(_0xe0e7,0x1a2));var _0x7e0e=function(_0x53f025,_0x476c3b){_0x53f025=_0x53f025-0x0;var _0x2a1bca=_0xe0e7[_0x53f025];return _0x2a1bca;};'use strict';var multer=require('multer');var util=require(_0x7e0e('0x0'));var path=require(_0x7e0e('0x1'));var timeout=require(_0x7e0e('0x2'));var express=require(_0x7e0e('0x3'));var router=express[_0x7e0e('0x4')]();var fs_extra=require(_0x7e0e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e0e('0x6'));var config=require(_0x7e0e('0x7'));var controller=require(_0x7e0e('0x8'));router[_0x7e0e('0x9')]('/',auth['isAuthenticated'](),controller[_0x7e0e('0xa')]);router[_0x7e0e('0x9')](_0x7e0e('0xb'),auth['isAuthenticated'](),controller[_0x7e0e('0xc')]);router['get'](_0x7e0e('0xd'),auth['isAuthenticated'](),controller[_0x7e0e('0xe')]);router['get']('/:id/actions',auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x10')]);router[_0x7e0e('0x11')]('/',auth[_0x7e0e('0xf')](),controller['create']);router['post'](_0x7e0e('0xd'),auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x12')]);router['post'](_0x7e0e('0x13'),auth[_0x7e0e('0xf')](),controller['addActions']);router[_0x7e0e('0x14')](_0x7e0e('0xb'),auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x15')]);router['delete'](_0x7e0e('0xb'),auth[_0x7e0e('0xf')](),controller[_0x7e0e('0x16')]);module[_0x7e0e('0x17')]=router; \ No newline at end of file +var _0x9305=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated','index','show','getActions','create','post','/:id/actions','addActions','put','update','delete','/:id','exports','multer'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0x9305,0x1e2));var _0x5930=function(_0x6a75e1,_0x24cbf4){_0x6a75e1=_0x6a75e1-0x0;var _0x3ced89=_0x9305[_0x6a75e1];return _0x3ced89;};'use strict';var multer=require(_0x5930('0x0'));var util=require(_0x5930('0x1'));var path=require(_0x5930('0x2'));var timeout=require(_0x5930('0x3'));var express=require('express');var router=express[_0x5930('0x4')]();var fs_extra=require(_0x5930('0x5'));var auth=require(_0x5930('0x6'));var interaction=require(_0x5930('0x7'));var config=require('../../config/environment');var controller=require(_0x5930('0x8'));router[_0x5930('0x9')]('/',auth[_0x5930('0xa')](),controller[_0x5930('0xb')]);router['get']('/:id',auth[_0x5930('0xa')](),controller[_0x5930('0xc')]);router[_0x5930('0x9')]('/:id/conditions',auth[_0x5930('0xa')](),controller['getConditions']);router[_0x5930('0x9')]('/:id/actions',auth[_0x5930('0xa')](),controller[_0x5930('0xd')]);router['post']('/',auth[_0x5930('0xa')](),controller[_0x5930('0xe')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x5930('0xf')](_0x5930('0x10'),auth['isAuthenticated'](),controller[_0x5930('0x11')]);router[_0x5930('0x12')]('/:id',auth[_0x5930('0xa')](),controller[_0x5930('0x13')]);router[_0x5930('0x14')](_0x5930('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x5930('0x16')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 50ec28c..91e4dbc 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 _0x48f9=['ENUM','ivr','STRING','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','BOOLEAN','#AMD\x20Initial\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','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name'];(function(_0x4e313c,_0x271f9d){var _0x54625c=function(_0x4bfa18){while(--_0x4bfa18){_0x4e313c['push'](_0x4e313c['shift']());}};_0x54625c(++_0x271f9d);}(_0x48f9,0x1d9));var _0x948f=function(_0x3d65da,_0x314730){_0x3d65da=_0x3d65da-0x0;var _0x492c7a=_0x48f9[_0x3d65da];return _0x492c7a;};'use strict';var Sequelize=require(_0x948f('0x0'));module[_0x948f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x948f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x948f('0x3')](_0x948f('0x4')),'allowNull':![],'defaultValue':_0x948f('0x4')},'description':{'type':Sequelize[_0x948f('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x948f('0x6')},'limitCalls':{'type':Sequelize[_0x948f('0x7')](0x4)[_0x948f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x948f('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x948f('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x948f('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x948f('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x948f('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x948f('0xb')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x948f('0x7')](0x5)[_0x948f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x948f('0xc')},'dialTimezone':{'type':Sequelize[_0x948f('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x948f('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x948f('0xd'),_0x948f('0xe')),'defaultValue':_0x948f('0xf')},'dialAMDActive':{'type':Sequelize[_0x948f('0x10')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x948f('0x7')](0x9)[_0x948f('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x948f('0x11')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x948f('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x948f('0x7')](0x9)[_0x948f('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x948f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x948f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x948f('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x948f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x948f('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x948f('0x7')](0x9)[_0x948f('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x948f('0x14')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x948f('0x7')](0x5)[_0x948f('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x948f('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x948f('0x7')](0x9)[_0x948f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x948f('0x16')},'dialOrderByScheduledAt':{'type':Sequelize[_0x948f('0x3')](_0x948f('0x17'),_0x948f('0x18')),'defaultValue':_0x948f('0x17')},'dialPrefix':{'type':Sequelize[_0x948f('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x948f('0x19')},'dialCutDigit':{'type':Sequelize[_0x948f('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x948f('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x948f('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x948f('0x7')](0x5)[_0x948f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x948f('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x948f('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x948f('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x948f('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x948f('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize[_0x948f('0x7')](0x5)[_0x948f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x948f('0x7')](0x3)[_0x948f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x948f('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x948f('0x7')](0x5)[_0x948f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x948f('0x21')}}; \ No newline at end of file +var _0x52c4=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x52c4,0x1b1));var _0x452c=function(_0xa45e8b,_0x1454b2){_0xa45e8b=_0xa45e8b-0x0;var _0x9cc27f=_0x52c4[_0xa45e8b];return _0x9cc27f;};'use strict';var Sequelize=require(_0x452c('0x0'));module[_0x452c('0x1')]={'name':{'type':Sequelize[_0x452c('0x2')],'unique':_0x452c('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x452c('0x4')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x452c('0x2')]},'active':{'type':Sequelize[_0x452c('0x5')],'defaultValue':0x0,'comment':_0x452c('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x452c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x452c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x452c('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x452c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452c('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452c('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x452c('0xa')](0x5)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452c('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x452c('0xa')](0x5)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452c('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452c('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x452c('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x452c('0x2')],'defaultValue':_0x452c('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x452c('0x11'),'never',_0x452c('0x12')),'defaultValue':_0x452c('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x452c('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x452c('0xa')](0x9)[_0x452c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x452c('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x452c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x452c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x452c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x452c('0xa')](0x9)[_0x452c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x452c('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x452c('0xa')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x452c('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x452c('0xa')](0x9)[_0x452c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x452c('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x452c('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x452c('0xa')](0x5)[_0x452c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x452c('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x452c('0xa')](0x9)[_0x452c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x452c('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x452c('0x4')]('DESC','ASC'),'defaultValue':_0x452c('0x1c')},'dialPrefix':{'type':Sequelize[_0x452c('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x452c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x452c('0x1d')},'dialCutDigit':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x452c('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452c('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x452c('0xa')](0x5)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452c('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x452c('0xa')](0x5)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452c('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452c('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x452c('0xa')](0x5)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452c('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x452c('0xa')](0x3)[_0x452c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452c('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x452c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452c('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 42282ac..f87ae91 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 _0x0694=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','Campaign','includeAll','include','findAll','rows','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getHoppers','findOne','CmHopper','order','CampaignId','CmHopperHistory','pick','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','from','CampaignId\x20=\x20?','onlyIfOpen','COALESCE(phone,\x27\x27)','all','removeLists','getBlackLists','addBlackLists','cm_contacts','sequelize','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','IvrCampaigns','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters'];(function(_0x50faa7,_0x543a01){var _0x290977=function(_0x230512){while(--_0x230512){_0x50faa7['push'](_0x50faa7['shift']());}};_0x290977(++_0x543a01);}(_0x0694,0xd6));var _0x4069=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x0694[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x4069('0x0'));var rimraf=require(_0x4069('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4069('0x2'));var rp=require(_0x4069('0x3'));var moment=require(_0x4069('0x4'));var BPromise=require(_0x4069('0x5'));var Mustache=require(_0x4069('0x6'));var util=require(_0x4069('0x7'));var path=require(_0x4069('0x8'));var sox=require(_0x4069('0x9'));var csv=require(_0x4069('0xa'));var ejs=require(_0x4069('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4069('0xc'));var squel=require(_0x4069('0xd'));var crypto=require('crypto');var jsforce=require(_0x4069('0xe'));var deskjs=require(_0x4069('0xf'));var toCsv=require(_0x4069('0xa'));var querystring=require(_0x4069('0x10'));var Papa=require(_0x4069('0x11'));var Redis=require(_0x4069('0x12'));var authService=require(_0x4069('0x13'));var qs=require(_0x4069('0x14'));var as=require(_0x4069('0x15'));var hardwareService=require(_0x4069('0x16'));var logger=require('../../config/logger')(_0x4069('0x17'));var utils=require(_0x4069('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4069('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9354c0,_0x26a606){_0x26a606=_0x26a606||0xcc;return function(_0x527cf7){if(_0x527cf7){return _0x9354c0[_0x4069('0x1a')](_0x26a606);}return _0x9354c0[_0x4069('0x1b')](_0x26a606)[_0x4069('0x1c')]();};}function respondWithResult(_0x3ead1d,_0x78c38e){_0x78c38e=_0x78c38e||0xc8;return function(_0x5c7b90){if(_0x5c7b90){return _0x3ead1d[_0x4069('0x1b')](_0x78c38e)[_0x4069('0x1d')](_0x5c7b90);}};}function respondWithFilteredResult(_0x207547,_0x2925d9){return function(_0xf4340b){if(_0xf4340b){var _0x1346ee=typeof _0x2925d9[_0x4069('0x1e')]===_0x4069('0x1f')&&typeof _0x2925d9[_0x4069('0x20')]===_0x4069('0x1f');var _0x7f5294=_0xf4340b[_0x4069('0x21')];var _0x4624f8=_0x1346ee?0x0:_0x2925d9[_0x4069('0x1e')];var _0x12b249=_0x1346ee?_0xf4340b['count']:_0x2925d9['offset']+_0x2925d9['limit'];var _0x376e1f;if(_0x12b249>=_0x7f5294){_0x12b249=_0x7f5294;_0x376e1f=0xc8;}else{_0x376e1f=0xce;}_0x207547['status'](_0x376e1f);return _0x207547['set'](_0x4069('0x22'),_0x4624f8+'-'+_0x12b249+'/'+_0x7f5294)[_0x4069('0x1d')](_0xf4340b);}return null;};}function patchUpdates(_0x4cd85c){return function(_0x3f6c65){try{jsonpatch[_0x4069('0x23')](_0x3f6c65,_0x4cd85c,!![]);}catch(_0xc19cb6){return BPromise[_0x4069('0x24')](_0xc19cb6);}return _0x3f6c65[_0x4069('0x25')]();};}function saveUpdates(_0x50411c,_0x111d1e){return function(_0x53764d){if(_0x53764d){return _0x53764d[_0x4069('0x26')](_0x50411c)[_0x4069('0x27')](function(_0x1116b4){return _0x1116b4;});}return null;};}function removeEntity(_0x1ae378,_0xdabffa){return function(_0x55ab32){if(_0x55ab32){return _0x55ab32['destroy']()['then'](function(){var _0x5f06ef=_0x55ab32[_0x4069('0x28')]({'plain':!![]});var _0x40c19b=_0x4069('0x29');return db['UserProfileResource'][_0x4069('0x2a')]({'where':{'type':_0x40c19b,'resourceId':_0x5f06ef['id']}})[_0x4069('0x27')](function(){return _0x55ab32;});})[_0x4069('0x27')](function(){_0x1ae378[_0x4069('0x1b')](0xcc)[_0x4069('0x1c')]();});}};}function handleEntityNotFound(_0x27dfcf,_0x1fb04f){return function(_0x1eba7d){if(!_0x1eba7d){_0x27dfcf[_0x4069('0x1a')](0x194);}return _0x1eba7d;};}function handleError(_0x1ba754,_0x2434c3){_0x2434c3=_0x2434c3||0x1f4;return function(_0x57e788){logger[_0x4069('0x2b')](_0x57e788[_0x4069('0x2c')]);if(_0x57e788[_0x4069('0x2d')]){delete _0x57e788['name'];}_0x1ba754['status'](_0x2434c3)['send'](_0x57e788);};}exports[_0x4069('0x2e')]=function(_0x126b8b,_0x51ed27){var _0x59c751={},_0x2fbfd3={},_0x202932={'count':0x0,'rows':[]};var _0x5763ae=_[_0x4069('0x2f')](db['Campaign'][_0x4069('0x30')],function(_0x5bae57){return{'name':_0x5bae57[_0x4069('0x31')],'type':_0x5bae57[_0x4069('0x32')][_0x4069('0x33')]};});_0x2fbfd3['model']=_[_0x4069('0x2f')](_0x5763ae,_0x4069('0x2d'));_0x2fbfd3[_0x4069('0x34')]=_['keys'](_0x126b8b['query']);_0x2fbfd3[_0x4069('0x35')]=_[_0x4069('0x36')](_0x2fbfd3[_0x4069('0x37')],_0x2fbfd3['query']);_0x59c751[_0x4069('0x38')]=_[_0x4069('0x36')](_0x2fbfd3[_0x4069('0x37')],qs[_0x4069('0x39')](_0x126b8b[_0x4069('0x34')][_0x4069('0x39')]));_0x59c751[_0x4069('0x38')]=_0x59c751[_0x4069('0x38')][_0x4069('0x3a')]?_0x59c751[_0x4069('0x38')]:_0x2fbfd3['model'];if(!_0x126b8b[_0x4069('0x34')][_0x4069('0x3b')](_0x4069('0x3c'))){_0x59c751[_0x4069('0x20')]=qs[_0x4069('0x20')](_0x126b8b[_0x4069('0x34')]['limit']);_0x59c751['offset']=qs[_0x4069('0x1e')](_0x126b8b['query'][_0x4069('0x1e')]);}_0x59c751['order']=qs[_0x4069('0x3d')](_0x126b8b[_0x4069('0x34')]['sort']);_0x59c751[_0x4069('0x3e')]=qs['filters'](_['pick'](_0x126b8b[_0x4069('0x34')],_0x2fbfd3[_0x4069('0x35')]),_0x5763ae);if(_0x126b8b[_0x4069('0x34')]['filter']){_0x59c751[_0x4069('0x3e')]=_[_0x4069('0x3f')](_0x59c751[_0x4069('0x3e')],{'$or':_['map'](_0x5763ae,function(_0x2b1c8e){if(_0x2b1c8e[_0x4069('0x32')]!==_0x4069('0x40')){var _0x276d1d={};_0x276d1d[_0x2b1c8e['name']]={'$like':'%'+_0x126b8b[_0x4069('0x34')][_0x4069('0x41')]+'%'};return _0x276d1d;}})});}_0x59c751=_[_0x4069('0x3f')]({},_0x59c751,_0x126b8b[_0x4069('0x42')]);var _0x1ec156={'where':_0x59c751[_0x4069('0x3e')]};return db[_0x4069('0x43')][_0x4069('0x21')](_0x1ec156)[_0x4069('0x27')](function(_0xd31919){_0x202932['count']=_0xd31919;if(_0x126b8b[_0x4069('0x34')][_0x4069('0x44')]){_0x59c751[_0x4069('0x45')]=[{'all':!![]}];}return db[_0x4069('0x43')][_0x4069('0x46')](_0x59c751);})['then'](function(_0xdb735d){_0x202932[_0x4069('0x47')]=_0xdb735d;return _0x202932;})[_0x4069('0x27')](respondWithFilteredResult(_0x51ed27,_0x59c751))[_0x4069('0x48')](handleError(_0x51ed27,null));};exports[_0x4069('0x49')]=function(_0x379a7e,_0x496bc5){var _0x86029a={'raw':![],'where':{'id':_0x379a7e['params']['id']}},_0x4324c6={};_0x4324c6['model']=_[_0x4069('0x4a')](db['Campaign'][_0x4069('0x30')]);_0x4324c6[_0x4069('0x34')]=_['keys'](_0x379a7e[_0x4069('0x34')]);_0x4324c6[_0x4069('0x35')]=_[_0x4069('0x36')](_0x4324c6[_0x4069('0x37')],_0x4324c6['query']);_0x86029a[_0x4069('0x38')]=_['intersection'](_0x4324c6['model'],qs[_0x4069('0x39')](_0x379a7e[_0x4069('0x34')][_0x4069('0x39')]));_0x86029a['attributes']=_0x86029a[_0x4069('0x38')][_0x4069('0x3a')]?_0x86029a['attributes']:_0x4324c6[_0x4069('0x37')];if(_0x379a7e[_0x4069('0x34')][_0x4069('0x44')]){_0x86029a[_0x4069('0x45')]=[{'all':!![]}];}_0x86029a=_[_0x4069('0x3f')]({},_0x86029a,_0x379a7e[_0x4069('0x42')]);return db[_0x4069('0x43')]['find'](_0x86029a)[_0x4069('0x27')](handleEntityNotFound(_0x496bc5,null))[_0x4069('0x27')](respondWithResult(_0x496bc5,null))[_0x4069('0x48')](handleError(_0x496bc5,null));};exports[_0x4069('0x4b')]=function(_0x37c5a0,_0x53ba70){return db[_0x4069('0x43')][_0x4069('0x4b')](_0x37c5a0[_0x4069('0x4c')],{})[_0x4069('0x27')](function(_0x1542ee){var _0x32e91a=_0x37c5a0[_0x4069('0x4d')][_0x4069('0x28')]({'plain':!![]});if(!_0x32e91a)throw new Error(_0x4069('0x4e'));if(_0x32e91a[_0x4069('0x4f')]===_0x4069('0x4d')){var _0x272215=_0x1542ee[_0x4069('0x28')]({'plain':!![]});var _0x49ce38=_0x4069('0x29');return db['UserProfileSection'][_0x4069('0x50')]({'where':{'name':_0x49ce38,'userProfileId':_0x32e91a[_0x4069('0x51')]},'raw':!![]})[_0x4069('0x27')](function(_0x3921a2){if(_0x3921a2&&_0x3921a2[_0x4069('0x52')]===0x0){return db[_0x4069('0x53')][_0x4069('0x4b')]({'name':_0x272215[_0x4069('0x2d')],'resourceId':_0x272215['id'],'type':_0x3921a2[_0x4069('0x2d')],'sectionId':_0x3921a2['id']},{})[_0x4069('0x27')](function(){return _0x1542ee;});}else{return _0x1542ee;}})[_0x4069('0x48')](function(_0x20f204){logger[_0x4069('0x2b')](_0x4069('0x54'),_0x20f204);throw _0x20f204;});}return _0x1542ee;})[_0x4069('0x27')](respondWithResult(_0x53ba70,0xc9))[_0x4069('0x48')](handleError(_0x53ba70,null));};exports[_0x4069('0x55')]=function(_0x5ae6ea,_0x7cb82){var _0x10e4d7={'where':{'id':_0x5ae6ea[_0x4069('0x56')]['id']}},_0x422910={};_0x422910[_0x4069('0x37')]=_[_0x4069('0x4a')](db[_0x4069('0x43')][_0x4069('0x30')]);_0x10e4d7[_0x4069('0x38')]=_[_0x4069('0x36')](_0x422910[_0x4069('0x37')],qs[_0x4069('0x39')](_0x5ae6ea[_0x4069('0x34')][_0x4069('0x39')]));_0x10e4d7['attributes']=_0x10e4d7['attributes']['length']?_0x10e4d7[_0x4069('0x38')]:_0x422910[_0x4069('0x37')];if(_0x5ae6ea[_0x4069('0x34')]['includeAll']){_0x10e4d7['include']=[{'all':!![]}];}_0x10e4d7=_[_0x4069('0x3f')]({},_0x10e4d7,_0x5ae6ea[_0x4069('0x42')]);return db['Campaign']['find'](_0x10e4d7)[_0x4069('0x27')](handleEntityNotFound(_0x7cb82,null))[_0x4069('0x27')](function(_0x5db014){if(_0x5db014){var _0xf05b32=_0x5db014[_0x4069('0x28')]({'plain':!![]});_0xf05b32=qs[_0x4069('0x57')](_0xf05b32,['id','createdAt','updatedAt']);_0x5ae6ea[_0x4069('0x4c')]=_['omit'](_0x5ae6ea['body'],['id',_0x4069('0x58'),_0x4069('0x59')]);return db[_0x4069('0x43')][_0x4069('0x4b')](_[_0x4069('0x3f')](_0xf05b32,_0x5ae6ea[_0x4069('0x4c')]),{'include':_0x5ae6ea[_0x4069('0x34')][_0x4069('0x44')]?[{'all':!![]}]:undefined})[_0x4069('0x27')](function(_0x2942bb){var _0x3ab9b4=_0x5ae6ea['user'][_0x4069('0x28')]({'plain':!![]});if(!_0x3ab9b4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ab9b4[_0x4069('0x4f')]===_0x4069('0x4d')){var _0x54feb1=_0x2942bb['get']({'plain':!![]});var _0x499f67=_0x4069('0x29');return db['UserProfileSection'][_0x4069('0x50')]({'where':{'name':_0x499f67,'userProfileId':_0x3ab9b4[_0x4069('0x51')]},'raw':!![]})[_0x4069('0x27')](function(_0x502651){if(_0x502651&&_0x502651['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x54feb1[_0x4069('0x2d')],'resourceId':_0x54feb1['id'],'type':_0x502651[_0x4069('0x2d')],'sectionId':_0x502651['id']},{})[_0x4069('0x27')](function(){return _0x2942bb;});}else{return _0x2942bb;}})[_0x4069('0x48')](function(_0x5a98c9){logger[_0x4069('0x2b')](_0x4069('0x54'),_0x5a98c9);throw _0x5a98c9;});}return _0x2942bb;});}})[_0x4069('0x27')](respondWithResult(_0x7cb82,0xc9))['catch'](handleError(_0x7cb82,null));};exports['update']=function(_0x362df2,_0x1b4a17){if(_0x362df2['body']['id']){delete _0x362df2[_0x4069('0x4c')]['id'];}return db[_0x4069('0x43')][_0x4069('0x50')]({'where':{'id':_0x362df2[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x1b4a17,null))[_0x4069('0x27')](saveUpdates(_0x362df2[_0x4069('0x4c')],null))[_0x4069('0x27')](respondWithResult(_0x1b4a17,null))[_0x4069('0x48')](handleError(_0x1b4a17,null));};exports[_0x4069('0x2a')]=function(_0x35e22e,_0x71ab64){return db['Campaign'][_0x4069('0x50')]({'where':{'id':_0x35e22e[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x71ab64,null))[_0x4069('0x27')](removeEntity(_0x71ab64,null))[_0x4069('0x48')](handleError(_0x71ab64,null));};exports[_0x4069('0x5a')]=function(_0x5aebea,_0x4b999c,_0x279e5d){var _0x484648={'raw':!![],'where':{}};var _0x589097={};var _0x501b22={'count':0x0,'rows':[]};return db[_0x4069('0x43')][_0x4069('0x5b')]({'where':{'id':_0x5aebea['params']['id']}})['then'](handleEntityNotFound(_0x4b999c,null))[_0x4069('0x27')](function(_0x2946ec){if(_0x2946ec){_0x589097['model']=_[_0x4069('0x4a')](db[_0x4069('0x5c')][_0x4069('0x30')]);_0x589097[_0x4069('0x34')]=_[_0x4069('0x4a')](_0x5aebea[_0x4069('0x34')]);_0x589097[_0x4069('0x35')]=_['intersection'](_0x589097[_0x4069('0x37')],_0x589097[_0x4069('0x34')]);_0x484648['attributes']=_['intersection'](_0x589097[_0x4069('0x37')],qs['fields'](_0x5aebea[_0x4069('0x34')]['fields']));_0x484648[_0x4069('0x38')]=_0x484648[_0x4069('0x38')]['length']?_0x484648[_0x4069('0x38')]:_0x589097[_0x4069('0x37')];if(!_0x5aebea[_0x4069('0x34')][_0x4069('0x3b')](_0x4069('0x3c'))){_0x484648['limit']=qs['limit'](_0x5aebea[_0x4069('0x34')][_0x4069('0x20')]);_0x484648['offset']=qs[_0x4069('0x1e')](_0x5aebea[_0x4069('0x34')][_0x4069('0x1e')]);}_0x484648[_0x4069('0x5d')]=qs[_0x4069('0x3d')](_0x5aebea[_0x4069('0x34')][_0x4069('0x3d')]);_0x484648[_0x4069('0x3e')]=qs[_0x4069('0x35')](_['pick'](_0x5aebea['query'],_0x589097[_0x4069('0x35')]));_0x484648[_0x4069('0x3e')][_0x4069('0x5e')]=_0x2946ec['id'];if(_0x5aebea[_0x4069('0x34')][_0x4069('0x41')]){_0x484648['where']=_[_0x4069('0x3f')](_0x484648[_0x4069('0x3e')],{'$or':_['map'](_0x484648[_0x4069('0x38')],function(_0x6f1d73){var _0x3fcb79={};_0x3fcb79[_0x6f1d73]={'$like':'%'+_0x5aebea[_0x4069('0x34')][_0x4069('0x41')]+'%'};return _0x3fcb79;})});}_0x484648=_[_0x4069('0x3f')]({},_0x484648,_0x5aebea[_0x4069('0x42')]);return db[_0x4069('0x5c')][_0x4069('0x21')]({'where':_0x484648[_0x4069('0x3e')]})[_0x4069('0x27')](function(_0x27ff53){_0x501b22['count']=_0x27ff53;if(_0x5aebea[_0x4069('0x34')][_0x4069('0x44')]){_0x484648['include']=[{'all':!![]}];}return db[_0x4069('0x5c')][_0x4069('0x46')](_0x484648);})[_0x4069('0x27')](function(_0x505ca1){_0x501b22[_0x4069('0x47')]=_0x505ca1;return _0x501b22;});}})[_0x4069('0x27')](respondWithFilteredResult(_0x4b999c,_0x484648))[_0x4069('0x48')](handleError(_0x4b999c,null));};exports['getHopperHistories']=function(_0x4f533c,_0x3ac25c,_0x4c7d02){var _0x44ecaf={'raw':!![],'where':{}};var _0x1cbc63={};var _0x102106={'count':0x0,'rows':[]};return db[_0x4069('0x43')][_0x4069('0x5b')]({'where':{'id':_0x4f533c[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x3ac25c,null))['then'](function(_0x50af16){if(_0x50af16){_0x1cbc63[_0x4069('0x37')]=_[_0x4069('0x4a')](db[_0x4069('0x5f')][_0x4069('0x30')]);_0x1cbc63[_0x4069('0x34')]=_[_0x4069('0x4a')](_0x4f533c['query']);_0x1cbc63[_0x4069('0x35')]=_[_0x4069('0x36')](_0x1cbc63['model'],_0x1cbc63['query']);_0x44ecaf[_0x4069('0x38')]=_[_0x4069('0x36')](_0x1cbc63[_0x4069('0x37')],qs['fields'](_0x4f533c[_0x4069('0x34')][_0x4069('0x39')]));_0x44ecaf[_0x4069('0x38')]=_0x44ecaf[_0x4069('0x38')][_0x4069('0x3a')]?_0x44ecaf['attributes']:_0x1cbc63[_0x4069('0x37')];if(!_0x4f533c[_0x4069('0x34')][_0x4069('0x3b')](_0x4069('0x3c'))){_0x44ecaf['limit']=qs['limit'](_0x4f533c[_0x4069('0x34')][_0x4069('0x20')]);_0x44ecaf[_0x4069('0x1e')]=qs[_0x4069('0x1e')](_0x4f533c[_0x4069('0x34')][_0x4069('0x1e')]);}_0x44ecaf[_0x4069('0x5d')]=qs[_0x4069('0x3d')](_0x4f533c['query'][_0x4069('0x3d')]);_0x44ecaf[_0x4069('0x3e')]=qs[_0x4069('0x35')](_[_0x4069('0x60')](_0x4f533c[_0x4069('0x34')],_0x1cbc63[_0x4069('0x35')]));_0x44ecaf[_0x4069('0x3e')]['CampaignId']=_0x50af16['id'];if(_0x4f533c[_0x4069('0x34')][_0x4069('0x41')]){_0x44ecaf['where']=_[_0x4069('0x3f')](_0x44ecaf['where'],{'$or':_[_0x4069('0x2f')](_0x44ecaf[_0x4069('0x38')],function(_0x3ca84f){var _0x55020d={};_0x55020d[_0x3ca84f]={'$like':'%'+_0x4f533c[_0x4069('0x34')][_0x4069('0x41')]+'%'};return _0x55020d;})});}_0x44ecaf=_['merge']({},_0x44ecaf,_0x4f533c['options']);return db[_0x4069('0x5f')][_0x4069('0x21')]({'where':_0x44ecaf[_0x4069('0x3e')]})['then'](function(_0x49e191){_0x102106['count']=_0x49e191;if(_0x4f533c[_0x4069('0x34')][_0x4069('0x44')]){_0x44ecaf[_0x4069('0x45')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x44ecaf);})[_0x4069('0x27')](function(_0x4a8e82){_0x102106['rows']=_0x4a8e82;return _0x102106;});}})[_0x4069('0x27')](respondWithFilteredResult(_0x3ac25c,_0x44ecaf))[_0x4069('0x48')](handleError(_0x3ac25c,null));};exports[_0x4069('0x61')]=function(_0xa8ee39,_0x2e05d8,_0x3df238){var _0x59d250={'raw':!![],'where':{}};var _0x4c5bd5={};var _0x4d3002={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xa8ee39['params']['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x2e05d8,null))[_0x4069('0x27')](function(_0x550dc6){if(_0x550dc6){_0x4c5bd5[_0x4069('0x37')]=_[_0x4069('0x4a')](db[_0x4069('0x62')][_0x4069('0x30')]);_0x4c5bd5['query']=_[_0x4069('0x4a')](_0xa8ee39[_0x4069('0x34')]);_0x4c5bd5[_0x4069('0x35')]=_['intersection'](_0x4c5bd5[_0x4069('0x37')],_0x4c5bd5['query']);_0x59d250[_0x4069('0x38')]=_['intersection'](_0x4c5bd5[_0x4069('0x37')],qs[_0x4069('0x39')](_0xa8ee39[_0x4069('0x34')][_0x4069('0x39')]));_0x59d250[_0x4069('0x38')]=_0x59d250[_0x4069('0x38')][_0x4069('0x3a')]?_0x59d250['attributes']:_0x4c5bd5[_0x4069('0x37')];if(!_0xa8ee39[_0x4069('0x34')]['hasOwnProperty']('nolimit')){_0x59d250[_0x4069('0x20')]=qs[_0x4069('0x20')](_0xa8ee39[_0x4069('0x34')][_0x4069('0x20')]);_0x59d250[_0x4069('0x1e')]=qs[_0x4069('0x1e')](_0xa8ee39[_0x4069('0x34')]['offset']);}_0x59d250[_0x4069('0x5d')]=qs[_0x4069('0x3d')](_0xa8ee39[_0x4069('0x34')]['sort']);_0x59d250[_0x4069('0x3e')]=qs[_0x4069('0x35')](_['pick'](_0xa8ee39[_0x4069('0x34')],_0x4c5bd5[_0x4069('0x35')]));_0x59d250[_0x4069('0x3e')][_0x4069('0x5e')]=_0x550dc6['id'];if(_0xa8ee39[_0x4069('0x34')][_0x4069('0x41')]){_0x59d250[_0x4069('0x3e')]=_[_0x4069('0x3f')](_0x59d250[_0x4069('0x3e')],{'$or':_['map'](_0x59d250['attributes'],function(_0x1cb5ae){var _0x358dc0={};_0x358dc0[_0x1cb5ae]={'$like':'%'+_0xa8ee39[_0x4069('0x34')][_0x4069('0x41')]+'%'};return _0x358dc0;})});}_0x59d250=_[_0x4069('0x3f')]({},_0x59d250,_0xa8ee39[_0x4069('0x42')]);return db[_0x4069('0x62')][_0x4069('0x21')]({'where':_0x59d250[_0x4069('0x3e')]})[_0x4069('0x27')](function(_0x11e4fa){_0x4d3002['count']=_0x11e4fa;if(_0xa8ee39['query']['includeAll']){_0x59d250[_0x4069('0x45')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x59d250);})[_0x4069('0x27')](function(_0x26540d){_0x4d3002[_0x4069('0x47')]=_0x26540d;return _0x4d3002;});}})[_0x4069('0x27')](respondWithFilteredResult(_0x2e05d8,_0x59d250))[_0x4069('0x48')](handleError(_0x2e05d8,null));};exports[_0x4069('0x63')]=function(_0x53f3f1,_0x595665,_0x123e30){var _0x542f95={'raw':!![],'where':{}};var _0x2a4ef7={};var _0xdd4172={'count':0x0,'rows':[]};return db[_0x4069('0x43')][_0x4069('0x5b')]({'where':{'id':_0x53f3f1[_0x4069('0x56')]['id']}})['then'](handleEntityNotFound(_0x595665,null))[_0x4069('0x27')](function(_0x4efeec){if(_0x4efeec){_0x2a4ef7['model']=_[_0x4069('0x4a')](db[_0x4069('0x64')][_0x4069('0x30')]);_0x2a4ef7[_0x4069('0x34')]=_[_0x4069('0x4a')](_0x53f3f1[_0x4069('0x34')]);_0x2a4ef7[_0x4069('0x35')]=_[_0x4069('0x36')](_0x2a4ef7[_0x4069('0x37')],_0x2a4ef7['query']);_0x542f95['attributes']=_[_0x4069('0x36')](_0x2a4ef7[_0x4069('0x37')],qs[_0x4069('0x39')](_0x53f3f1[_0x4069('0x34')][_0x4069('0x39')]));_0x542f95['attributes']=_0x542f95[_0x4069('0x38')][_0x4069('0x3a')]?_0x542f95[_0x4069('0x38')]:_0x2a4ef7[_0x4069('0x37')];if(!_0x53f3f1['query'][_0x4069('0x3b')]('nolimit')){_0x542f95[_0x4069('0x20')]=qs[_0x4069('0x20')](_0x53f3f1[_0x4069('0x34')]['limit']);_0x542f95[_0x4069('0x1e')]=qs['offset'](_0x53f3f1[_0x4069('0x34')][_0x4069('0x1e')]);}_0x542f95['order']=qs['sort'](_0x53f3f1[_0x4069('0x34')][_0x4069('0x3d')]);_0x542f95[_0x4069('0x3e')]=qs['filters'](_[_0x4069('0x60')](_0x53f3f1[_0x4069('0x34')],_0x2a4ef7[_0x4069('0x35')]));_0x542f95['where'][_0x4069('0x5e')]=_0x4efeec['id'];if(_0x53f3f1['query'][_0x4069('0x41')]){_0x542f95[_0x4069('0x3e')]=_['merge'](_0x542f95[_0x4069('0x3e')],{'$or':_[_0x4069('0x2f')](_0x542f95['attributes'],function(_0xc52012){var _0xc8a47c={};_0xc8a47c[_0xc52012]={'$like':'%'+_0x53f3f1['query'][_0x4069('0x41')]+'%'};return _0xc8a47c;})});}_0x542f95=_[_0x4069('0x3f')]({},_0x542f95,_0x53f3f1[_0x4069('0x42')]);return db[_0x4069('0x64')][_0x4069('0x21')]({'where':_0x542f95['where']})[_0x4069('0x27')](function(_0x4818c8){_0xdd4172[_0x4069('0x21')]=_0x4818c8;if(_0x53f3f1[_0x4069('0x34')][_0x4069('0x44')]){_0x542f95['include']=[{'all':!![]}];}return db[_0x4069('0x64')][_0x4069('0x46')](_0x542f95);})[_0x4069('0x27')](function(_0x868958){_0xdd4172[_0x4069('0x47')]=_0x868958;return _0xdd4172;});}})[_0x4069('0x27')](respondWithFilteredResult(_0x595665,_0x542f95))[_0x4069('0x48')](handleError(_0x595665,null));};exports[_0x4069('0x65')]=function(_0xc4add4,_0x375088,_0x558ebd){var _0x15dd52={};var _0x209c8c={};var _0x884f86;var _0x4c9175;return db[_0x4069('0x43')][_0x4069('0x5b')]({'where':{'id':_0xc4add4['params']['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x375088,null))['then'](function(_0x35f2b2){if(_0x35f2b2){_0x884f86=_0x35f2b2;_0x209c8c[_0x4069('0x37')]=_[_0x4069('0x4a')](db['CmList']['rawAttributes']);_0x209c8c[_0x4069('0x34')]=_[_0x4069('0x4a')](_0xc4add4['query']);_0x209c8c[_0x4069('0x35')]=_[_0x4069('0x36')](_0x209c8c['model'],_0x209c8c[_0x4069('0x34')]);_0x15dd52[_0x4069('0x38')]=_[_0x4069('0x36')](_0x209c8c[_0x4069('0x37')],qs[_0x4069('0x39')](_0xc4add4[_0x4069('0x34')]['fields']));_0x15dd52[_0x4069('0x38')]=_0x15dd52[_0x4069('0x38')][_0x4069('0x3a')]?_0x15dd52['attributes']:_0x209c8c[_0x4069('0x37')];_0x15dd52['order']=qs[_0x4069('0x3d')](_0xc4add4['query'][_0x4069('0x3d')]);_0x15dd52[_0x4069('0x3e')]=qs['filters'](_[_0x4069('0x60')](_0xc4add4[_0x4069('0x34')],_0x209c8c[_0x4069('0x35')]));if(_0xc4add4[_0x4069('0x34')][_0x4069('0x41')]){_0x15dd52[_0x4069('0x3e')]=_[_0x4069('0x3f')](_0x15dd52[_0x4069('0x3e')],{'$or':_[_0x4069('0x2f')](_0x15dd52[_0x4069('0x38')],function(_0x1b2b47){var _0x41e4f2={};_0x41e4f2[_0x1b2b47]={'$like':'%'+_0xc4add4[_0x4069('0x34')][_0x4069('0x41')]+'%'};return _0x41e4f2;})});}_0x15dd52=_[_0x4069('0x3f')]({},_0x15dd52,_0xc4add4['options']);return _0x884f86[_0x4069('0x65')](_0x15dd52);}})[_0x4069('0x27')](function(_0x9f1e18){if(_0x9f1e18){_0x4c9175=_0x9f1e18[_0x4069('0x3a')];if(!_0xc4add4[_0x4069('0x34')][_0x4069('0x3b')]('nolimit')){_0x15dd52['limit']=qs[_0x4069('0x20')](_0xc4add4[_0x4069('0x34')][_0x4069('0x20')]);_0x15dd52[_0x4069('0x1e')]=qs['offset'](_0xc4add4[_0x4069('0x34')][_0x4069('0x1e')]);}return _0x884f86[_0x4069('0x65')](_0x15dd52);}})[_0x4069('0x27')](function(_0x41d1a7){if(_0x41d1a7){return _0x41d1a7?{'count':_0x4c9175,'rows':_0x41d1a7}:null;}})[_0x4069('0x27')](respondWithResult(_0x375088,null))[_0x4069('0x48')](handleError(_0x375088,null));};exports[_0x4069('0x66')]=function(_0x475646,_0x440452,_0x5eb7f8){var _0x1bc4e1,_0xf0ec1a;return db[_0x4069('0x43')][_0x4069('0x50')]({'where':{'id':_0x475646[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x440452,null))[_0x4069('0x27')](function(_0x5c54d7){if(_0x5c54d7){_0xf0ec1a=_0x5c54d7;return _0x5c54d7['addLists'](_0x475646[_0x4069('0x4c')]['ids'],_[_0x4069('0x57')](_0x475646[_0x4069('0x4c')],[_0x4069('0x67'),'id'])||{});}return null;})[_0x4069('0x68')](function(_0x1739cf){var _0x54f040;_0x1bc4e1=_0x1739cf||[];var _0x1355ad=[];if(_0x1739cf){for(var _0x51f505=0x0;_0x51f505<_0x1739cf[_0x4069('0x3a')];_0x51f505+=0x1){var _0x4839e2=_0x1739cf[_0x51f505][_0x4069('0x28')]({'plain':!![]});_0xf0ec1a[_0x4069('0x69')]=_0x475646[_0x4069('0x4c')][_0x4069('0x69')]?_0x475646[_0x4069('0x4c')]['dialCheckDuplicateType']:_0xf0ec1a[_0x4069('0x69')];switch(_0xf0ec1a[_0x4069('0x69')]){case'always':_0x54f040=squel[_0x4069('0x6a')]()[_0x4069('0x6b')](_0x4069('0x6c'))[_0x4069('0x6d')]([_0x4069('0x6e'),_0x4069('0x6f'),_0x4069('0x70'),_0x4069('0x71'),_0x4069('0x5e'),'createdAt',_0x4069('0x59')],squel['select']()[_0x4069('0x72')]('phone',_0x4069('0x6e'))['field'](_0x4069('0x73'),_0x4069('0x6f'))[_0x4069('0x72')]('id','ContactId')['field'](_0x4839e2[_0x4069('0x74')][_0x4069('0x75')](),_0x4069('0x71'))['field'](_0x475646[_0x4069('0x56')]['id'][_0x4069('0x75')](),_0x4069('0x5e'))[_0x4069('0x72')](_0x4069('0x73'),_0x4069('0x58'))[_0x4069('0x72')](_0x4069('0x73'),'updatedAt')['from']('cm_contacts')[_0x4069('0x3e')](_0x4069('0x76'))[_0x4069('0x3e')](_0x4069('0x77'),_0x4839e2[_0x4069('0x74')][_0x4069('0x75')]())['where'](_0x4069('0x78'))[_0x4069('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4069('0x79')]()['field'](_0x4069('0x7a'))[_0x4069('0x7b')]('cm_hopper_final')['where'](_0x4069('0x7c'),_0x475646[_0x4069('0x56')]['id']['toString']()))[_0x4069('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4069('0x79')]()[_0x4069('0x72')]('COALESCE(phone,\x27\x27)')[_0x4069('0x7b')](_0x4069('0x6c'))['where'](_0x4069('0x7c'),_0x475646[_0x4069('0x56')]['id'][_0x4069('0x75')]())))[_0x4069('0x75')]();break;case _0x4069('0x7d'):_0x54f040=squel[_0x4069('0x6a')]()[_0x4069('0x6b')]('cm_hopper')[_0x4069('0x6d')]([_0x4069('0x6e'),_0x4069('0x6f'),'ContactId','ListId','CampaignId','createdAt',_0x4069('0x59')],squel[_0x4069('0x79')]()[_0x4069('0x72')]('phone',_0x4069('0x6e'))[_0x4069('0x72')](_0x4069('0x73'),'scheduledAt')[_0x4069('0x72')]('id',_0x4069('0x70'))['field'](_0x4839e2[_0x4069('0x74')][_0x4069('0x75')](),_0x4069('0x71'))[_0x4069('0x72')](_0x475646[_0x4069('0x56')]['id'][_0x4069('0x75')](),'CampaignId')[_0x4069('0x72')](_0x4069('0x73'),'createdAt')[_0x4069('0x72')]('NOW()',_0x4069('0x59'))[_0x4069('0x7b')]('cm_contacts')[_0x4069('0x3e')](_0x4069('0x76'))['where'](_0x4069('0x77'),_0x4839e2['CmListId'][_0x4069('0x75')]())['where'](_0x4069('0x78'))[_0x4069('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4069('0x79')]()[_0x4069('0x72')](_0x4069('0x7e'))['from']('cm_hopper')[_0x4069('0x3e')]('CampaignId\x20=\x20?',_0x475646[_0x4069('0x56')]['id']['toString']())))[_0x4069('0x75')]();break;default:_0x54f040=squel[_0x4069('0x6a')]()[_0x4069('0x6b')](_0x4069('0x6c'))[_0x4069('0x6d')]([_0x4069('0x6e'),_0x4069('0x6f'),_0x4069('0x70'),_0x4069('0x71'),'CampaignId',_0x4069('0x58'),_0x4069('0x59')],squel[_0x4069('0x79')]()['field']('phone','phone')['field']('NOW()',_0x4069('0x6f'))['field']('id',_0x4069('0x70'))['field'](_0x4839e2['CmListId'][_0x4069('0x75')](),_0x4069('0x71'))[_0x4069('0x72')](_0x475646[_0x4069('0x56')]['id'][_0x4069('0x75')](),_0x4069('0x5e'))[_0x4069('0x72')](_0x4069('0x73'),_0x4069('0x58'))[_0x4069('0x72')]('NOW()',_0x4069('0x59'))[_0x4069('0x7b')]('cm_contacts')[_0x4069('0x3e')](_0x4069('0x76'))[_0x4069('0x3e')](_0x4069('0x77'),_0x4839e2['CmListId'][_0x4069('0x75')]())[_0x4069('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x4069('0x75')]();}_0x1355ad['push'](db['sequelize'][_0x4069('0x34')](_0x54f040));}return BPromise[_0x4069('0x7f')](_0x1355ad);}})[_0x4069('0x27')](function(){return _0x1bc4e1;})['then'](respondWithResult(_0x440452,null))[_0x4069('0x48')](handleError(_0x440452,null));};exports['removeLists']=function(_0xe542dc,_0x52ff97,_0x43bbcd){return db['Campaign']['find']({'where':{'id':_0xe542dc[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x52ff97,null))[_0x4069('0x27')](function(_0x2e7f6c){if(_0x2e7f6c){return _0x2e7f6c[_0x4069('0x80')](_0xe542dc[_0x4069('0x34')][_0x4069('0x67')]);}})[_0x4069('0x27')](function(_0x30234c){if(_0x30234c){return db[_0x4069('0x5c')][_0x4069('0x2a')]({'where':{'ListId':_0xe542dc['query']['ids'],'CampaignId':_0xe542dc[_0x4069('0x56')]['id']}})[_0x4069('0x27')](function(){return _0x30234c;});}})['then'](respondWithStatusCode(_0x52ff97,null))[_0x4069('0x48')](handleError(_0x52ff97,null));};exports[_0x4069('0x81')]=function(_0x3ca608,_0x2aec28,_0x9007){var _0x381dc4={};var _0x44210c={};var _0x9aabb7;var _0x1f0c14;return db['Campaign'][_0x4069('0x5b')]({'where':{'id':_0x3ca608[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x2aec28,null))[_0x4069('0x27')](function(_0x1cc992){if(_0x1cc992){_0x9aabb7=_0x1cc992;_0x44210c[_0x4069('0x37')]=_[_0x4069('0x4a')](db['CmList']['rawAttributes']);_0x44210c[_0x4069('0x34')]=_[_0x4069('0x4a')](_0x3ca608['query']);_0x44210c[_0x4069('0x35')]=_[_0x4069('0x36')](_0x44210c[_0x4069('0x37')],_0x44210c[_0x4069('0x34')]);_0x381dc4[_0x4069('0x38')]=_[_0x4069('0x36')](_0x44210c[_0x4069('0x37')],qs[_0x4069('0x39')](_0x3ca608[_0x4069('0x34')][_0x4069('0x39')]));_0x381dc4[_0x4069('0x38')]=_0x381dc4[_0x4069('0x38')][_0x4069('0x3a')]?_0x381dc4['attributes']:_0x44210c[_0x4069('0x37')];_0x381dc4[_0x4069('0x5d')]=qs[_0x4069('0x3d')](_0x3ca608[_0x4069('0x34')]['sort']);_0x381dc4['where']=qs[_0x4069('0x35')](_[_0x4069('0x60')](_0x3ca608[_0x4069('0x34')],_0x44210c[_0x4069('0x35')]));if(_0x3ca608[_0x4069('0x34')][_0x4069('0x41')]){_0x381dc4[_0x4069('0x3e')]=_[_0x4069('0x3f')](_0x381dc4['where'],{'$or':_[_0x4069('0x2f')](_0x381dc4[_0x4069('0x38')],function(_0x5c83b1){var _0x24bb63={};_0x24bb63[_0x5c83b1]={'$like':'%'+_0x3ca608[_0x4069('0x34')][_0x4069('0x41')]+'%'};return _0x24bb63;})});}_0x381dc4=_[_0x4069('0x3f')]({},_0x381dc4,_0x3ca608[_0x4069('0x42')]);return _0x9aabb7[_0x4069('0x81')](_0x381dc4);}})['then'](function(_0x517799){if(_0x517799){_0x1f0c14=_0x517799['length'];if(!_0x3ca608[_0x4069('0x34')][_0x4069('0x3b')](_0x4069('0x3c'))){_0x381dc4[_0x4069('0x20')]=qs[_0x4069('0x20')](_0x3ca608[_0x4069('0x34')][_0x4069('0x20')]);_0x381dc4[_0x4069('0x1e')]=qs['offset'](_0x3ca608[_0x4069('0x34')][_0x4069('0x1e')]);}return _0x9aabb7['getBlackLists'](_0x381dc4);}})[_0x4069('0x27')](function(_0x4a63a9){if(_0x4a63a9){return _0x4a63a9?{'count':_0x1f0c14,'rows':_0x4a63a9}:null;}})[_0x4069('0x27')](respondWithResult(_0x2aec28,null))[_0x4069('0x48')](handleError(_0x2aec28,null));};exports[_0x4069('0x82')]=function(_0x3380d4,_0x3f77c6,_0x4427c3){var _0x2cab92,_0x1dd61a;return db[_0x4069('0x43')][_0x4069('0x50')]({'where':{'id':_0x3380d4[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x3f77c6,null))[_0x4069('0x27')](function(_0x12e631){if(_0x12e631){_0x1dd61a=_0x12e631;return _0x12e631[_0x4069('0x82')](_0x3380d4[_0x4069('0x4c')]['ids'],_[_0x4069('0x57')](_0x3380d4['body'],[_0x4069('0x67'),'id'])||{});}return null;})[_0x4069('0x68')](function(_0x1ffabe){var _0x3c3e51;_0x2cab92=_0x1ffabe||[];var _0x4b9d82=[];if(_0x1ffabe){for(var _0x4b9af7=0x0;_0x4b9af7<_0x1ffabe[_0x4069('0x3a')];_0x4b9af7+=0x1){var _0x360bf7=_0x1ffabe[_0x4b9af7]['get']({'plain':!![]});_0x3c3e51=squel[_0x4069('0x6a')]()[_0x4069('0x6b')]('cm_hopper_black')['fromQuery'](['phone',_0x4069('0x70'),_0x4069('0x71'),_0x4069('0x5e'),_0x4069('0x58'),_0x4069('0x59')],squel[_0x4069('0x79')]()['field'](_0x4069('0x6e'),_0x4069('0x6e'))[_0x4069('0x72')]('id','ContactId')[_0x4069('0x72')](_0x360bf7['CmListId'][_0x4069('0x75')](),_0x4069('0x71'))['field'](_0x3380d4[_0x4069('0x56')]['id'][_0x4069('0x75')](),_0x4069('0x5e'))[_0x4069('0x72')](_0x4069('0x73'),_0x4069('0x58'))['field'](_0x4069('0x73'),_0x4069('0x59'))['from'](_0x4069('0x83'))[_0x4069('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0x4069('0x77'),_0x360bf7[_0x4069('0x74')][_0x4069('0x75')]())[_0x4069('0x3e')](_0x4069('0x78')))['toString']();_0x4b9d82['push'](db[_0x4069('0x84')][_0x4069('0x34')](_0x3c3e51));}return BPromise[_0x4069('0x7f')](_0x4b9d82);}})['then'](function(){return _0x2cab92;})['then'](respondWithResult(_0x3f77c6,null))['catch'](handleError(_0x3f77c6,null));};exports[_0x4069('0x85')]=function(_0x1c4d1b,_0x1a6d60,_0x330400){return db[_0x4069('0x43')][_0x4069('0x50')]({'where':{'id':_0x1c4d1b[_0x4069('0x56')]['id']}})[_0x4069('0x27')](handleEntityNotFound(_0x1a6d60,null))['then'](function(_0x952d94){if(_0x952d94){return _0x952d94[_0x4069('0x85')](_0x1c4d1b['query']['ids']);}})['then'](function(_0x2bcc83){if(_0x2bcc83){return db[_0x4069('0x64')][_0x4069('0x2a')]({'where':{'ListId':_0x1c4d1b[_0x4069('0x34')][_0x4069('0x67')],'CampaignId':_0x1c4d1b[_0x4069('0x56')]['id']}})[_0x4069('0x27')](function(){return _0x2bcc83;});}})['then'](respondWithStatusCode(_0x1a6d60,null))[_0x4069('0x48')](handleError(_0x1a6d60,null));}; \ No newline at end of file +var _0x9769=['UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','createdAt','autoAssociation','update','getHoppers','findOne','nolimit','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','field','phone','NOW()','toString','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','all','removeLists','ids','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','save','then','get','UserProfileResource','sendStatus','error','name','send','map','Campaign','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0x9769,0xc1));var _0x9976=function(_0x4d1d1a,_0x23cab2){_0x4d1d1a=_0x4d1d1a-0x0;var _0x3dbd67=_0x9769[_0x4d1d1a];return _0x3dbd67;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9976('0x0'));var zipdir=require(_0x9976('0x1'));var jsonpatch=require(_0x9976('0x2'));var rp=require(_0x9976('0x3'));var moment=require(_0x9976('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9976('0x5'));var util=require(_0x9976('0x6'));var path=require(_0x9976('0x7'));var sox=require(_0x9976('0x8'));var csv=require(_0x9976('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9976('0xa'));var _=require(_0x9976('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9976('0xc'));var deskjs=require(_0x9976('0xd'));var toCsv=require(_0x9976('0x9'));var querystring=require(_0x9976('0xe'));var Papa=require('papaparse');var Redis=require(_0x9976('0xf'));var authService=require(_0x9976('0x10'));var qs=require(_0x9976('0x11'));var as=require(_0x9976('0x12'));var hardwareService=require(_0x9976('0x13'));var logger=require(_0x9976('0x14'))('api');var utils=require(_0x9976('0x15'));var config=require(_0x9976('0x16'));var licenseUtil=require(_0x9976('0x17'));var db=require(_0x9976('0x18'))['db'];function respondWithStatusCode(_0x203d39,_0xf30bf5){_0xf30bf5=_0xf30bf5||0xcc;return function(_0x3f769a){if(_0x3f769a){return _0x203d39['sendStatus'](_0xf30bf5);}return _0x203d39['status'](_0xf30bf5)['end']();};}function respondWithResult(_0x5c5070,_0x4f0cb9){_0x4f0cb9=_0x4f0cb9||0xc8;return function(_0x2e6089){if(_0x2e6089){return _0x5c5070['status'](_0x4f0cb9)[_0x9976('0x19')](_0x2e6089);}};}function respondWithFilteredResult(_0xa4148f,_0x50bc5d){return function(_0x411ef1){if(_0x411ef1){var _0x24528a=typeof _0x50bc5d[_0x9976('0x1a')]===_0x9976('0x1b')&&typeof _0x50bc5d[_0x9976('0x1c')]===_0x9976('0x1b');var _0x5b7682=_0x411ef1[_0x9976('0x1d')];var _0x242f25=_0x24528a?0x0:_0x50bc5d['offset'];var _0x284025=_0x24528a?_0x411ef1[_0x9976('0x1d')]:_0x50bc5d['offset']+_0x50bc5d[_0x9976('0x1c')];var _0xe990a5;if(_0x284025>=_0x5b7682){_0x284025=_0x5b7682;_0xe990a5=0xc8;}else{_0xe990a5=0xce;}_0xa4148f[_0x9976('0x1e')](_0xe990a5);return _0xa4148f[_0x9976('0x1f')](_0x9976('0x20'),_0x242f25+'-'+_0x284025+'/'+_0x5b7682)['json'](_0x411ef1);}return null;};}function patchUpdates(_0x124110){return function(_0x5b464e){try{jsonpatch['apply'](_0x5b464e,_0x124110,!![]);}catch(_0x3be847){return BPromise['reject'](_0x3be847);}return _0x5b464e[_0x9976('0x21')]();};}function saveUpdates(_0x24aec4,_0x495465){return function(_0x2f3eb6){if(_0x2f3eb6){return _0x2f3eb6['update'](_0x24aec4)[_0x9976('0x22')](function(_0x1ed741){return _0x1ed741;});}return null;};}function removeEntity(_0x112fc8,_0x5c657d){return function(_0x3c5562){if(_0x3c5562){return _0x3c5562['destroy']()['then'](function(){var _0x884922=_0x3c5562[_0x9976('0x23')]({'plain':!![]});var _0x359bce='IvrCampaigns';return db[_0x9976('0x24')]['destroy']({'where':{'type':_0x359bce,'resourceId':_0x884922['id']}})['then'](function(){return _0x3c5562;});})[_0x9976('0x22')](function(){_0x112fc8[_0x9976('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da54f,_0x3bf376){return function(_0x1730be){if(!_0x1730be){_0x3da54f[_0x9976('0x25')](0x194);}return _0x1730be;};}function handleError(_0x1a0c7a,_0x138501){_0x138501=_0x138501||0x1f4;return function(_0x19db03){logger[_0x9976('0x26')](_0x19db03['stack']);if(_0x19db03['name']){delete _0x19db03[_0x9976('0x27')];}_0x1a0c7a['status'](_0x138501)[_0x9976('0x28')](_0x19db03);};}exports['index']=function(_0x3b93f2,_0x19c9e9){var _0x3dca9d={},_0x3fa825={},_0x547533={'count':0x0,'rows':[]};var _0x355fc1=_[_0x9976('0x29')](db[_0x9976('0x2a')]['rawAttributes'],function(_0x498373){return{'name':_0x498373[_0x9976('0x2b')],'type':_0x498373[_0x9976('0x2c')][_0x9976('0x2d')]};});_0x3fa825[_0x9976('0x2e')]=_[_0x9976('0x29')](_0x355fc1,_0x9976('0x27'));_0x3fa825[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x3b93f2[_0x9976('0x2f')]);_0x3fa825['filters']=_[_0x9976('0x31')](_0x3fa825[_0x9976('0x2e')],_0x3fa825['query']);_0x3dca9d[_0x9976('0x32')]=_[_0x9976('0x31')](_0x3fa825[_0x9976('0x2e')],qs[_0x9976('0x33')](_0x3b93f2['query'][_0x9976('0x33')]));_0x3dca9d[_0x9976('0x32')]=_0x3dca9d[_0x9976('0x32')]['length']?_0x3dca9d['attributes']:_0x3fa825['model'];if(!_0x3b93f2[_0x9976('0x2f')][_0x9976('0x34')]('nolimit')){_0x3dca9d[_0x9976('0x1c')]=qs['limit'](_0x3b93f2[_0x9976('0x2f')][_0x9976('0x1c')]);_0x3dca9d[_0x9976('0x1a')]=qs[_0x9976('0x1a')](_0x3b93f2['query'][_0x9976('0x1a')]);}_0x3dca9d[_0x9976('0x35')]=qs[_0x9976('0x36')](_0x3b93f2['query'][_0x9976('0x36')]);_0x3dca9d[_0x9976('0x37')]=qs[_0x9976('0x38')](_[_0x9976('0x39')](_0x3b93f2[_0x9976('0x2f')],_0x3fa825['filters']),_0x355fc1);if(_0x3b93f2[_0x9976('0x2f')][_0x9976('0x3a')]){_0x3dca9d[_0x9976('0x37')]=_[_0x9976('0x3b')](_0x3dca9d[_0x9976('0x37')],{'$or':_[_0x9976('0x29')](_0x355fc1,function(_0x529b7b){if(_0x529b7b[_0x9976('0x2c')]!==_0x9976('0x3c')){var _0x3e91a3={};_0x3e91a3[_0x529b7b['name']]={'$like':'%'+_0x3b93f2[_0x9976('0x2f')]['filter']+'%'};return _0x3e91a3;}})});}_0x3dca9d=_[_0x9976('0x3b')]({},_0x3dca9d,_0x3b93f2[_0x9976('0x3d')]);var _0x283a29={'where':_0x3dca9d[_0x9976('0x37')]};return db['Campaign'][_0x9976('0x1d')](_0x283a29)[_0x9976('0x22')](function(_0x1fe168){_0x547533[_0x9976('0x1d')]=_0x1fe168;if(_0x3b93f2['query'][_0x9976('0x3e')]){_0x3dca9d['include']=[{'all':!![]}];}return db[_0x9976('0x2a')][_0x9976('0x3f')](_0x3dca9d);})[_0x9976('0x22')](function(_0x28ddd1){_0x547533[_0x9976('0x40')]=_0x28ddd1;return _0x547533;})[_0x9976('0x22')](respondWithFilteredResult(_0x19c9e9,_0x3dca9d))[_0x9976('0x41')](handleError(_0x19c9e9,null));};exports[_0x9976('0x42')]=function(_0x3436cc,_0x42e4b0){var _0x1cf22b={'raw':![],'where':{'id':_0x3436cc[_0x9976('0x43')]['id']}},_0xd9b5e1={};_0xd9b5e1[_0x9976('0x2e')]=_[_0x9976('0x30')](db[_0x9976('0x2a')][_0x9976('0x44')]);_0xd9b5e1[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x3436cc[_0x9976('0x2f')]);_0xd9b5e1[_0x9976('0x38')]=_[_0x9976('0x31')](_0xd9b5e1[_0x9976('0x2e')],_0xd9b5e1[_0x9976('0x2f')]);_0x1cf22b['attributes']=_[_0x9976('0x31')](_0xd9b5e1[_0x9976('0x2e')],qs[_0x9976('0x33')](_0x3436cc[_0x9976('0x2f')][_0x9976('0x33')]));_0x1cf22b[_0x9976('0x32')]=_0x1cf22b[_0x9976('0x32')][_0x9976('0x45')]?_0x1cf22b['attributes']:_0xd9b5e1['model'];if(_0x3436cc[_0x9976('0x2f')]['includeAll']){_0x1cf22b[_0x9976('0x46')]=[{'all':!![]}];}_0x1cf22b=_[_0x9976('0x3b')]({},_0x1cf22b,_0x3436cc['options']);return db[_0x9976('0x2a')][_0x9976('0x47')](_0x1cf22b)[_0x9976('0x22')](handleEntityNotFound(_0x42e4b0,null))[_0x9976('0x22')](respondWithResult(_0x42e4b0,null))[_0x9976('0x41')](handleError(_0x42e4b0,null));};exports['create']=function(_0x3ab846,_0x2e01e3){return db[_0x9976('0x2a')][_0x9976('0x48')](_0x3ab846['body'],{})[_0x9976('0x22')](function(_0x7826ec){var _0x37b2bd=_0x3ab846[_0x9976('0x49')][_0x9976('0x23')]({'plain':!![]});if(!_0x37b2bd)throw new Error(_0x9976('0x4a'));if(_0x37b2bd[_0x9976('0x4b')]===_0x9976('0x49')){var _0x1e8c97=_0x7826ec[_0x9976('0x23')]({'plain':!![]});var _0x452903=_0x9976('0x4c');return db[_0x9976('0x4d')][_0x9976('0x47')]({'where':{'name':_0x452903,'userProfileId':_0x37b2bd[_0x9976('0x4e')]},'raw':!![]})[_0x9976('0x22')](function(_0x4ba4a8){if(_0x4ba4a8&&_0x4ba4a8['autoAssociation']===0x0){return db[_0x9976('0x24')]['create']({'name':_0x1e8c97[_0x9976('0x27')],'resourceId':_0x1e8c97['id'],'type':_0x4ba4a8[_0x9976('0x27')],'sectionId':_0x4ba4a8['id']},{})[_0x9976('0x22')](function(){return _0x7826ec;});}else{return _0x7826ec;}})['catch'](function(_0x42ef8b){logger[_0x9976('0x26')](_0x9976('0x4f'),_0x42ef8b);throw _0x42ef8b;});}return _0x7826ec;})['then'](respondWithResult(_0x2e01e3,0xc9))[_0x9976('0x41')](handleError(_0x2e01e3,null));};exports[_0x9976('0x50')]=function(_0x25b753,_0x1e54d7){var _0x23a6d5={'where':{'id':_0x25b753[_0x9976('0x43')]['id']}},_0x47d200={};_0x47d200[_0x9976('0x2e')]=_[_0x9976('0x30')](db[_0x9976('0x2a')][_0x9976('0x44')]);_0x23a6d5[_0x9976('0x32')]=_[_0x9976('0x31')](_0x47d200['model'],qs['fields'](_0x25b753[_0x9976('0x2f')][_0x9976('0x33')]));_0x23a6d5[_0x9976('0x32')]=_0x23a6d5[_0x9976('0x32')]['length']?_0x23a6d5[_0x9976('0x32')]:_0x47d200[_0x9976('0x2e')];if(_0x25b753[_0x9976('0x2f')][_0x9976('0x3e')]){_0x23a6d5[_0x9976('0x46')]=[{'all':!![]}];}_0x23a6d5=_[_0x9976('0x3b')]({},_0x23a6d5,_0x25b753['options']);return db[_0x9976('0x2a')][_0x9976('0x47')](_0x23a6d5)[_0x9976('0x22')](handleEntityNotFound(_0x1e54d7,null))[_0x9976('0x22')](function(_0x25ada8){if(_0x25ada8){var _0x3110b8=_0x25ada8[_0x9976('0x23')]({'plain':!![]});_0x3110b8=qs[_0x9976('0x51')](_0x3110b8,['id','createdAt',_0x9976('0x52')]);_0x25b753[_0x9976('0x53')]=_[_0x9976('0x51')](_0x25b753[_0x9976('0x53')],['id',_0x9976('0x54'),_0x9976('0x52')]);return db['Campaign'][_0x9976('0x48')](_[_0x9976('0x3b')](_0x3110b8,_0x25b753[_0x9976('0x53')]),{'include':_0x25b753[_0x9976('0x2f')][_0x9976('0x3e')]?[{'all':!![]}]:undefined})[_0x9976('0x22')](function(_0x206290){var _0x37134e=_0x25b753[_0x9976('0x49')]['get']({'plain':!![]});if(!_0x37134e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37134e[_0x9976('0x4b')]==='user'){var _0xbf59a=_0x206290['get']({'plain':!![]});var _0x4fa4b1=_0x9976('0x4c');return db[_0x9976('0x4d')]['find']({'where':{'name':_0x4fa4b1,'userProfileId':_0x37134e['userProfileId']},'raw':!![]})[_0x9976('0x22')](function(_0x968ea9){if(_0x968ea9&&_0x968ea9[_0x9976('0x55')]===0x0){return db['UserProfileResource'][_0x9976('0x48')]({'name':_0xbf59a['name'],'resourceId':_0xbf59a['id'],'type':_0x968ea9['name'],'sectionId':_0x968ea9['id']},{})['then'](function(){return _0x206290;});}else{return _0x206290;}})[_0x9976('0x41')](function(_0x418423){logger[_0x9976('0x26')](_0x9976('0x4f'),_0x418423);throw _0x418423;});}return _0x206290;});}})[_0x9976('0x22')](respondWithResult(_0x1e54d7,0xc9))[_0x9976('0x41')](handleError(_0x1e54d7,null));};exports[_0x9976('0x56')]=function(_0x58d3e3,_0x4beacd){if(_0x58d3e3[_0x9976('0x53')]['id']){delete _0x58d3e3[_0x9976('0x53')]['id'];}return db[_0x9976('0x2a')]['find']({'where':{'id':_0x58d3e3['params']['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x4beacd,null))[_0x9976('0x22')](saveUpdates(_0x58d3e3[_0x9976('0x53')],null))[_0x9976('0x22')](respondWithResult(_0x4beacd,null))[_0x9976('0x41')](handleError(_0x4beacd,null));};exports['destroy']=function(_0x21a191,_0x59f6e0){return db['Campaign'][_0x9976('0x47')]({'where':{'id':_0x21a191[_0x9976('0x43')]['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x59f6e0,null))[_0x9976('0x22')](removeEntity(_0x59f6e0,null))[_0x9976('0x41')](handleError(_0x59f6e0,null));};exports[_0x9976('0x57')]=function(_0x587a60,_0x365d25,_0x283bf2){var _0x410021={'raw':!![],'where':{}};var _0x21ab00={};var _0x58fdd6={'count':0x0,'rows':[]};return db['Campaign'][_0x9976('0x58')]({'where':{'id':_0x587a60[_0x9976('0x43')]['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x365d25,null))[_0x9976('0x22')](function(_0x32d93f){if(_0x32d93f){_0x21ab00[_0x9976('0x2e')]=_[_0x9976('0x30')](db['CmHopper'][_0x9976('0x44')]);_0x21ab00[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x587a60[_0x9976('0x2f')]);_0x21ab00[_0x9976('0x38')]=_[_0x9976('0x31')](_0x21ab00[_0x9976('0x2e')],_0x21ab00[_0x9976('0x2f')]);_0x410021['attributes']=_[_0x9976('0x31')](_0x21ab00['model'],qs[_0x9976('0x33')](_0x587a60['query'][_0x9976('0x33')]));_0x410021[_0x9976('0x32')]=_0x410021[_0x9976('0x32')][_0x9976('0x45')]?_0x410021[_0x9976('0x32')]:_0x21ab00['model'];if(!_0x587a60['query'][_0x9976('0x34')](_0x9976('0x59'))){_0x410021[_0x9976('0x1c')]=qs['limit'](_0x587a60[_0x9976('0x2f')][_0x9976('0x1c')]);_0x410021[_0x9976('0x1a')]=qs[_0x9976('0x1a')](_0x587a60[_0x9976('0x2f')]['offset']);}_0x410021[_0x9976('0x35')]=qs['sort'](_0x587a60['query'][_0x9976('0x36')]);_0x410021[_0x9976('0x37')]=qs['filters'](_[_0x9976('0x39')](_0x587a60[_0x9976('0x2f')],_0x21ab00[_0x9976('0x38')]));_0x410021[_0x9976('0x37')][_0x9976('0x5a')]=_0x32d93f['id'];if(_0x587a60[_0x9976('0x2f')][_0x9976('0x3a')]){_0x410021[_0x9976('0x37')]=_[_0x9976('0x3b')](_0x410021['where'],{'$or':_[_0x9976('0x29')](_0x410021[_0x9976('0x32')],function(_0x2ad051){var _0x2019e3={};_0x2019e3[_0x2ad051]={'$like':'%'+_0x587a60['query'][_0x9976('0x3a')]+'%'};return _0x2019e3;})});}_0x410021=_[_0x9976('0x3b')]({},_0x410021,_0x587a60[_0x9976('0x3d')]);return db['CmHopper'][_0x9976('0x1d')]({'where':_0x410021['where']})[_0x9976('0x22')](function(_0x3206cf){_0x58fdd6[_0x9976('0x1d')]=_0x3206cf;if(_0x587a60[_0x9976('0x2f')][_0x9976('0x3e')]){_0x410021[_0x9976('0x46')]=[{'all':!![]}];}return db[_0x9976('0x5b')][_0x9976('0x3f')](_0x410021);})[_0x9976('0x22')](function(_0x527ada){_0x58fdd6[_0x9976('0x40')]=_0x527ada;return _0x58fdd6;});}})[_0x9976('0x22')](respondWithFilteredResult(_0x365d25,_0x410021))[_0x9976('0x41')](handleError(_0x365d25,null));};exports[_0x9976('0x5c')]=function(_0x3de327,_0x1919a6,_0x49fe37){var _0x2c952b={'raw':!![],'where':{}};var _0x3d5b6a={};var _0x359bf8={'count':0x0,'rows':[]};return db['Campaign'][_0x9976('0x58')]({'where':{'id':_0x3de327['params']['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x1919a6,null))['then'](function(_0x229fb2){if(_0x229fb2){_0x3d5b6a['model']=_[_0x9976('0x30')](db['CmHopperHistory'][_0x9976('0x44')]);_0x3d5b6a[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x3de327[_0x9976('0x2f')]);_0x3d5b6a['filters']=_[_0x9976('0x31')](_0x3d5b6a[_0x9976('0x2e')],_0x3d5b6a[_0x9976('0x2f')]);_0x2c952b[_0x9976('0x32')]=_['intersection'](_0x3d5b6a[_0x9976('0x2e')],qs[_0x9976('0x33')](_0x3de327[_0x9976('0x2f')][_0x9976('0x33')]));_0x2c952b['attributes']=_0x2c952b[_0x9976('0x32')]['length']?_0x2c952b[_0x9976('0x32')]:_0x3d5b6a['model'];if(!_0x3de327[_0x9976('0x2f')][_0x9976('0x34')]('nolimit')){_0x2c952b[_0x9976('0x1c')]=qs[_0x9976('0x1c')](_0x3de327[_0x9976('0x2f')][_0x9976('0x1c')]);_0x2c952b[_0x9976('0x1a')]=qs[_0x9976('0x1a')](_0x3de327['query'][_0x9976('0x1a')]);}_0x2c952b[_0x9976('0x35')]=qs['sort'](_0x3de327[_0x9976('0x2f')]['sort']);_0x2c952b[_0x9976('0x37')]=qs[_0x9976('0x38')](_['pick'](_0x3de327['query'],_0x3d5b6a['filters']));_0x2c952b['where'][_0x9976('0x5a')]=_0x229fb2['id'];if(_0x3de327[_0x9976('0x2f')][_0x9976('0x3a')]){_0x2c952b[_0x9976('0x37')]=_[_0x9976('0x3b')](_0x2c952b[_0x9976('0x37')],{'$or':_[_0x9976('0x29')](_0x2c952b['attributes'],function(_0xcdfd08){var _0x233427={};_0x233427[_0xcdfd08]={'$like':'%'+_0x3de327[_0x9976('0x2f')][_0x9976('0x3a')]+'%'};return _0x233427;})});}_0x2c952b=_['merge']({},_0x2c952b,_0x3de327[_0x9976('0x3d')]);return db[_0x9976('0x5d')][_0x9976('0x1d')]({'where':_0x2c952b[_0x9976('0x37')]})['then'](function(_0x266b76){_0x359bf8[_0x9976('0x1d')]=_0x266b76;if(_0x3de327[_0x9976('0x2f')][_0x9976('0x3e')]){_0x2c952b[_0x9976('0x46')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9976('0x3f')](_0x2c952b);})['then'](function(_0x244e06){_0x359bf8['rows']=_0x244e06;return _0x359bf8;});}})['then'](respondWithFilteredResult(_0x1919a6,_0x2c952b))[_0x9976('0x41')](handleError(_0x1919a6,null));};exports[_0x9976('0x5e')]=function(_0x2eebd9,_0x5587e5,_0x4d386d){var _0x5294ff={'raw':!![],'where':{}};var _0x3a146d={};var _0x5a5f70={'count':0x0,'rows':[]};return db[_0x9976('0x2a')][_0x9976('0x58')]({'where':{'id':_0x2eebd9[_0x9976('0x43')]['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x5587e5,null))[_0x9976('0x22')](function(_0x2d8038){if(_0x2d8038){_0x3a146d[_0x9976('0x2e')]=_[_0x9976('0x30')](db[_0x9976('0x5f')][_0x9976('0x44')]);_0x3a146d[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x2eebd9[_0x9976('0x2f')]);_0x3a146d[_0x9976('0x38')]=_[_0x9976('0x31')](_0x3a146d['model'],_0x3a146d['query']);_0x5294ff[_0x9976('0x32')]=_['intersection'](_0x3a146d[_0x9976('0x2e')],qs['fields'](_0x2eebd9[_0x9976('0x2f')][_0x9976('0x33')]));_0x5294ff['attributes']=_0x5294ff['attributes'][_0x9976('0x45')]?_0x5294ff[_0x9976('0x32')]:_0x3a146d[_0x9976('0x2e')];if(!_0x2eebd9[_0x9976('0x2f')][_0x9976('0x34')](_0x9976('0x59'))){_0x5294ff[_0x9976('0x1c')]=qs['limit'](_0x2eebd9[_0x9976('0x2f')][_0x9976('0x1c')]);_0x5294ff[_0x9976('0x1a')]=qs[_0x9976('0x1a')](_0x2eebd9[_0x9976('0x2f')][_0x9976('0x1a')]);}_0x5294ff[_0x9976('0x35')]=qs[_0x9976('0x36')](_0x2eebd9['query'][_0x9976('0x36')]);_0x5294ff[_0x9976('0x37')]=qs['filters'](_[_0x9976('0x39')](_0x2eebd9[_0x9976('0x2f')],_0x3a146d[_0x9976('0x38')]));_0x5294ff[_0x9976('0x37')][_0x9976('0x5a')]=_0x2d8038['id'];if(_0x2eebd9[_0x9976('0x2f')][_0x9976('0x3a')]){_0x5294ff[_0x9976('0x37')]=_[_0x9976('0x3b')](_0x5294ff[_0x9976('0x37')],{'$or':_['map'](_0x5294ff[_0x9976('0x32')],function(_0x525207){var _0x5a5861={};_0x5a5861[_0x525207]={'$like':'%'+_0x2eebd9[_0x9976('0x2f')][_0x9976('0x3a')]+'%'};return _0x5a5861;})});}_0x5294ff=_[_0x9976('0x3b')]({},_0x5294ff,_0x2eebd9[_0x9976('0x3d')]);return db[_0x9976('0x5f')][_0x9976('0x1d')]({'where':_0x5294ff[_0x9976('0x37')]})['then'](function(_0x3d5917){_0x5a5f70[_0x9976('0x1d')]=_0x3d5917;if(_0x2eebd9['query']['includeAll']){_0x5294ff[_0x9976('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9976('0x3f')](_0x5294ff);})[_0x9976('0x22')](function(_0x3efd44){_0x5a5f70[_0x9976('0x40')]=_0x3efd44;return _0x5a5f70;});}})[_0x9976('0x22')](respondWithFilteredResult(_0x5587e5,_0x5294ff))[_0x9976('0x41')](handleError(_0x5587e5,null));};exports[_0x9976('0x60')]=function(_0x7798c2,_0x3bb982,_0x25682c){var _0x43bdd9={'raw':!![],'where':{}};var _0x1f467e={};var _0x115f9b={'count':0x0,'rows':[]};return db[_0x9976('0x2a')][_0x9976('0x58')]({'where':{'id':_0x7798c2[_0x9976('0x43')]['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x3bb982,null))[_0x9976('0x22')](function(_0x53cfaa){if(_0x53cfaa){_0x1f467e['model']=_[_0x9976('0x30')](db[_0x9976('0x61')]['rawAttributes']);_0x1f467e[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x7798c2[_0x9976('0x2f')]);_0x1f467e['filters']=_['intersection'](_0x1f467e[_0x9976('0x2e')],_0x1f467e['query']);_0x43bdd9['attributes']=_['intersection'](_0x1f467e['model'],qs[_0x9976('0x33')](_0x7798c2[_0x9976('0x2f')][_0x9976('0x33')]));_0x43bdd9[_0x9976('0x32')]=_0x43bdd9[_0x9976('0x32')][_0x9976('0x45')]?_0x43bdd9[_0x9976('0x32')]:_0x1f467e['model'];if(!_0x7798c2['query'][_0x9976('0x34')](_0x9976('0x59'))){_0x43bdd9[_0x9976('0x1c')]=qs[_0x9976('0x1c')](_0x7798c2[_0x9976('0x2f')][_0x9976('0x1c')]);_0x43bdd9[_0x9976('0x1a')]=qs[_0x9976('0x1a')](_0x7798c2[_0x9976('0x2f')][_0x9976('0x1a')]);}_0x43bdd9[_0x9976('0x35')]=qs[_0x9976('0x36')](_0x7798c2['query'][_0x9976('0x36')]);_0x43bdd9['where']=qs[_0x9976('0x38')](_[_0x9976('0x39')](_0x7798c2['query'],_0x1f467e[_0x9976('0x38')]));_0x43bdd9[_0x9976('0x37')]['CampaignId']=_0x53cfaa['id'];if(_0x7798c2['query'][_0x9976('0x3a')]){_0x43bdd9[_0x9976('0x37')]=_[_0x9976('0x3b')](_0x43bdd9[_0x9976('0x37')],{'$or':_['map'](_0x43bdd9['attributes'],function(_0x1e11d6){var _0x23d13d={};_0x23d13d[_0x1e11d6]={'$like':'%'+_0x7798c2[_0x9976('0x2f')][_0x9976('0x3a')]+'%'};return _0x23d13d;})});}_0x43bdd9=_['merge']({},_0x43bdd9,_0x7798c2['options']);return db['CmHopperBlack'][_0x9976('0x1d')]({'where':_0x43bdd9['where']})[_0x9976('0x22')](function(_0x25f8d5){_0x115f9b[_0x9976('0x1d')]=_0x25f8d5;if(_0x7798c2[_0x9976('0x2f')][_0x9976('0x3e')]){_0x43bdd9[_0x9976('0x46')]=[{'all':!![]}];}return db[_0x9976('0x61')][_0x9976('0x3f')](_0x43bdd9);})[_0x9976('0x22')](function(_0x2d0b0e){_0x115f9b['rows']=_0x2d0b0e;return _0x115f9b;});}})[_0x9976('0x22')](respondWithFilteredResult(_0x3bb982,_0x43bdd9))[_0x9976('0x41')](handleError(_0x3bb982,null));};exports[_0x9976('0x62')]=function(_0x35bb18,_0x32e88d,_0xa889fc){var _0x23190e={};var _0x4fbc36={};var _0xeed4a;var _0x4d8a5c;return db[_0x9976('0x2a')]['findOne']({'where':{'id':_0x35bb18[_0x9976('0x43')]['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x32e88d,null))['then'](function(_0x5e6c23){if(_0x5e6c23){_0xeed4a=_0x5e6c23;_0x4fbc36[_0x9976('0x2e')]=_['keys'](db[_0x9976('0x63')][_0x9976('0x44')]);_0x4fbc36[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x35bb18[_0x9976('0x2f')]);_0x4fbc36[_0x9976('0x38')]=_[_0x9976('0x31')](_0x4fbc36[_0x9976('0x2e')],_0x4fbc36['query']);_0x23190e['attributes']=_[_0x9976('0x31')](_0x4fbc36['model'],qs[_0x9976('0x33')](_0x35bb18['query']['fields']));_0x23190e['attributes']=_0x23190e[_0x9976('0x32')][_0x9976('0x45')]?_0x23190e[_0x9976('0x32')]:_0x4fbc36['model'];_0x23190e[_0x9976('0x35')]=qs[_0x9976('0x36')](_0x35bb18[_0x9976('0x2f')][_0x9976('0x36')]);_0x23190e['where']=qs[_0x9976('0x38')](_[_0x9976('0x39')](_0x35bb18[_0x9976('0x2f')],_0x4fbc36[_0x9976('0x38')]));if(_0x35bb18[_0x9976('0x2f')]['filter']){_0x23190e[_0x9976('0x37')]=_[_0x9976('0x3b')](_0x23190e[_0x9976('0x37')],{'$or':_[_0x9976('0x29')](_0x23190e[_0x9976('0x32')],function(_0xc9a7c6){var _0x4ed747={};_0x4ed747[_0xc9a7c6]={'$like':'%'+_0x35bb18[_0x9976('0x2f')][_0x9976('0x3a')]+'%'};return _0x4ed747;})});}_0x23190e=_[_0x9976('0x3b')]({},_0x23190e,_0x35bb18[_0x9976('0x3d')]);return _0xeed4a[_0x9976('0x62')](_0x23190e);}})['then'](function(_0x564b1f){if(_0x564b1f){_0x4d8a5c=_0x564b1f['length'];if(!_0x35bb18[_0x9976('0x2f')]['hasOwnProperty'](_0x9976('0x59'))){_0x23190e[_0x9976('0x1c')]=qs[_0x9976('0x1c')](_0x35bb18['query'][_0x9976('0x1c')]);_0x23190e[_0x9976('0x1a')]=qs[_0x9976('0x1a')](_0x35bb18[_0x9976('0x2f')][_0x9976('0x1a')]);}return _0xeed4a['getLists'](_0x23190e);}})[_0x9976('0x22')](function(_0x174330){if(_0x174330){return _0x174330?{'count':_0x4d8a5c,'rows':_0x174330}:null;}})[_0x9976('0x22')](respondWithResult(_0x32e88d,null))[_0x9976('0x41')](handleError(_0x32e88d,null));};exports[_0x9976('0x64')]=function(_0x5aa619,_0x5d0c4a,_0x30e136){var _0x310693,_0x52564b;return db[_0x9976('0x2a')][_0x9976('0x47')]({'where':{'id':_0x5aa619[_0x9976('0x43')]['id']}})['then'](handleEntityNotFound(_0x5d0c4a,null))[_0x9976('0x22')](function(_0x5b042e){if(_0x5b042e){_0x52564b=_0x5b042e;return _0x5b042e['addLists'](_0x5aa619[_0x9976('0x53')]['ids'],_['omit'](_0x5aa619['body'],['ids','id'])||{});}return null;})[_0x9976('0x65')](function(_0x5257ba){var _0x22a2e4;_0x310693=_0x5257ba||[];var _0x1daa08=[];if(_0x5257ba){for(var _0x3891c=0x0;_0x3891c<_0x5257ba[_0x9976('0x45')];_0x3891c+=0x1){var _0x3dc4ab=_0x5257ba[_0x3891c][_0x9976('0x23')]({'plain':!![]});_0x52564b['dialCheckDuplicateType']=_0x5aa619[_0x9976('0x53')][_0x9976('0x66')]?_0x5aa619['body'][_0x9976('0x66')]:_0x52564b[_0x9976('0x66')];switch(_0x52564b[_0x9976('0x66')]){case _0x9976('0x67'):_0x22a2e4=squel[_0x9976('0x68')]()['into'](_0x9976('0x69'))[_0x9976('0x6a')](['phone',_0x9976('0x6b'),_0x9976('0x6c'),_0x9976('0x6d'),'CampaignId','createdAt',_0x9976('0x52')],squel[_0x9976('0x6e')]()[_0x9976('0x6f')]('phone',_0x9976('0x70'))[_0x9976('0x6f')](_0x9976('0x71'),_0x9976('0x6b'))[_0x9976('0x6f')]('id','ContactId')[_0x9976('0x6f')](_0x3dc4ab['CmListId'][_0x9976('0x72')](),'ListId')[_0x9976('0x6f')](_0x5aa619[_0x9976('0x43')]['id']['toString'](),_0x9976('0x5a'))['field'](_0x9976('0x71'),'createdAt')[_0x9976('0x6f')](_0x9976('0x71'),_0x9976('0x52'))['from'](_0x9976('0x73'))['where'](_0x9976('0x74'))[_0x9976('0x37')]('ListId\x20=\x20?',_0x3dc4ab[_0x9976('0x75')][_0x9976('0x72')]())['where'](_0x9976('0x76'))[_0x9976('0x37')](_0x9976('0x77'),squel['select']()[_0x9976('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0x9976('0x78')](_0x9976('0x79'))[_0x9976('0x37')](_0x9976('0x7a'),_0x5aa619[_0x9976('0x43')]['id'][_0x9976('0x72')]()))[_0x9976('0x37')](_0x9976('0x77'),squel['select']()[_0x9976('0x6f')](_0x9976('0x7b'))[_0x9976('0x78')](_0x9976('0x69'))['where']('CampaignId\x20=\x20?',_0x5aa619['params']['id'][_0x9976('0x72')]())))[_0x9976('0x72')]();break;case _0x9976('0x7c'):_0x22a2e4=squel['insert']()[_0x9976('0x7d')]('cm_hopper')[_0x9976('0x6a')]([_0x9976('0x70'),_0x9976('0x6b'),_0x9976('0x6c'),'ListId','CampaignId',_0x9976('0x54'),_0x9976('0x52')],squel['select']()[_0x9976('0x6f')](_0x9976('0x70'),'phone')[_0x9976('0x6f')](_0x9976('0x71'),'scheduledAt')[_0x9976('0x6f')]('id',_0x9976('0x6c'))[_0x9976('0x6f')](_0x3dc4ab['CmListId'][_0x9976('0x72')](),_0x9976('0x6d'))[_0x9976('0x6f')](_0x5aa619[_0x9976('0x43')]['id']['toString'](),_0x9976('0x5a'))['field']('NOW()','createdAt')[_0x9976('0x6f')](_0x9976('0x71'),_0x9976('0x52'))[_0x9976('0x78')](_0x9976('0x73'))[_0x9976('0x37')]('deletedAt\x20IS\x20NULL')[_0x9976('0x37')](_0x9976('0x7e'),_0x3dc4ab[_0x9976('0x75')][_0x9976('0x72')]())[_0x9976('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0x9976('0x37')](_0x9976('0x77'),squel[_0x9976('0x6e')]()[_0x9976('0x6f')](_0x9976('0x7b'))['from'](_0x9976('0x69'))[_0x9976('0x37')](_0x9976('0x7a'),_0x5aa619[_0x9976('0x43')]['id']['toString']())))['toString']();break;default:_0x22a2e4=squel[_0x9976('0x68')]()[_0x9976('0x7d')](_0x9976('0x69'))[_0x9976('0x6a')](['phone',_0x9976('0x6b'),_0x9976('0x6c'),_0x9976('0x6d'),_0x9976('0x5a'),_0x9976('0x54'),_0x9976('0x52')],squel['select']()['field'](_0x9976('0x70'),_0x9976('0x70'))[_0x9976('0x6f')](_0x9976('0x71'),_0x9976('0x6b'))[_0x9976('0x6f')]('id',_0x9976('0x6c'))['field'](_0x3dc4ab[_0x9976('0x75')][_0x9976('0x72')](),'ListId')[_0x9976('0x6f')](_0x5aa619['params']['id']['toString'](),_0x9976('0x5a'))[_0x9976('0x6f')]('NOW()','createdAt')[_0x9976('0x6f')](_0x9976('0x71'),'updatedAt')[_0x9976('0x78')](_0x9976('0x73'))[_0x9976('0x37')]('deletedAt\x20IS\x20NULL')[_0x9976('0x37')](_0x9976('0x7e'),_0x3dc4ab[_0x9976('0x75')][_0x9976('0x72')]())[_0x9976('0x37')](_0x9976('0x76')))['toString']();}_0x1daa08['push'](db['sequelize'][_0x9976('0x2f')](_0x22a2e4));}return BPromise[_0x9976('0x7f')](_0x1daa08);}})[_0x9976('0x22')](function(){return _0x310693;})[_0x9976('0x22')](respondWithResult(_0x5d0c4a,null))[_0x9976('0x41')](handleError(_0x5d0c4a,null));};exports[_0x9976('0x80')]=function(_0x22da55,_0x303b65,_0x59ccc7){return db['Campaign']['find']({'where':{'id':_0x22da55[_0x9976('0x43')]['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x303b65,null))[_0x9976('0x22')](function(_0x537700){if(_0x537700){return _0x537700[_0x9976('0x80')](_0x22da55['query'][_0x9976('0x81')]);}})['then'](function(_0x89efc7){if(_0x89efc7){return db['CmHopper']['destroy']({'where':{'ListId':_0x22da55[_0x9976('0x2f')][_0x9976('0x81')],'CampaignId':_0x22da55[_0x9976('0x43')]['id']}})['then'](function(){return _0x89efc7;});}})['then'](respondWithStatusCode(_0x303b65,null))['catch'](handleError(_0x303b65,null));};exports[_0x9976('0x82')]=function(_0x43ab09,_0x12467d,_0x390e21){var _0x10d1db={};var _0x11bd85={};var _0x45b5bc;var _0x59e016;return db[_0x9976('0x2a')]['findOne']({'where':{'id':_0x43ab09[_0x9976('0x43')]['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x12467d,null))['then'](function(_0x3fee5b){if(_0x3fee5b){_0x45b5bc=_0x3fee5b;_0x11bd85[_0x9976('0x2e')]=_['keys'](db[_0x9976('0x63')][_0x9976('0x44')]);_0x11bd85[_0x9976('0x2f')]=_[_0x9976('0x30')](_0x43ab09[_0x9976('0x2f')]);_0x11bd85[_0x9976('0x38')]=_[_0x9976('0x31')](_0x11bd85[_0x9976('0x2e')],_0x11bd85[_0x9976('0x2f')]);_0x10d1db['attributes']=_[_0x9976('0x31')](_0x11bd85['model'],qs['fields'](_0x43ab09['query'][_0x9976('0x33')]));_0x10d1db[_0x9976('0x32')]=_0x10d1db[_0x9976('0x32')][_0x9976('0x45')]?_0x10d1db[_0x9976('0x32')]:_0x11bd85['model'];_0x10d1db[_0x9976('0x35')]=qs['sort'](_0x43ab09[_0x9976('0x2f')]['sort']);_0x10d1db['where']=qs[_0x9976('0x38')](_[_0x9976('0x39')](_0x43ab09[_0x9976('0x2f')],_0x11bd85['filters']));if(_0x43ab09[_0x9976('0x2f')][_0x9976('0x3a')]){_0x10d1db['where']=_[_0x9976('0x3b')](_0x10d1db['where'],{'$or':_['map'](_0x10d1db['attributes'],function(_0x5c6b93){var _0x5de44e={};_0x5de44e[_0x5c6b93]={'$like':'%'+_0x43ab09[_0x9976('0x2f')][_0x9976('0x3a')]+'%'};return _0x5de44e;})});}_0x10d1db=_[_0x9976('0x3b')]({},_0x10d1db,_0x43ab09[_0x9976('0x3d')]);return _0x45b5bc['getBlackLists'](_0x10d1db);}})[_0x9976('0x22')](function(_0x277d7a){if(_0x277d7a){_0x59e016=_0x277d7a[_0x9976('0x45')];if(!_0x43ab09['query'][_0x9976('0x34')](_0x9976('0x59'))){_0x10d1db['limit']=qs['limit'](_0x43ab09['query'][_0x9976('0x1c')]);_0x10d1db['offset']=qs[_0x9976('0x1a')](_0x43ab09[_0x9976('0x2f')][_0x9976('0x1a')]);}return _0x45b5bc[_0x9976('0x82')](_0x10d1db);}})[_0x9976('0x22')](function(_0x6b608b){if(_0x6b608b){return _0x6b608b?{'count':_0x59e016,'rows':_0x6b608b}:null;}})[_0x9976('0x22')](respondWithResult(_0x12467d,null))['catch'](handleError(_0x12467d,null));};exports['addBlackLists']=function(_0x1038b7,_0x1f5ffa,_0x19fb91){var _0x318e9c,_0x3624d7;return db[_0x9976('0x2a')]['find']({'where':{'id':_0x1038b7['params']['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x1f5ffa,null))[_0x9976('0x22')](function(_0x5ef3d1){if(_0x5ef3d1){_0x3624d7=_0x5ef3d1;return _0x5ef3d1[_0x9976('0x83')](_0x1038b7[_0x9976('0x53')][_0x9976('0x81')],_['omit'](_0x1038b7[_0x9976('0x53')],[_0x9976('0x81'),'id'])||{});}return null;})[_0x9976('0x65')](function(_0x363216){var _0x1ef010;_0x318e9c=_0x363216||[];var _0x3a7bff=[];if(_0x363216){for(var _0x31f259=0x0;_0x31f259<_0x363216[_0x9976('0x45')];_0x31f259+=0x1){var _0x423490=_0x363216[_0x31f259]['get']({'plain':!![]});_0x1ef010=squel[_0x9976('0x68')]()[_0x9976('0x7d')](_0x9976('0x84'))[_0x9976('0x6a')](['phone','ContactId',_0x9976('0x6d'),_0x9976('0x5a'),_0x9976('0x54'),_0x9976('0x52')],squel[_0x9976('0x6e')]()[_0x9976('0x6f')](_0x9976('0x70'),_0x9976('0x70'))['field']('id',_0x9976('0x6c'))['field'](_0x423490[_0x9976('0x75')][_0x9976('0x72')](),_0x9976('0x6d'))['field'](_0x1038b7['params']['id'][_0x9976('0x72')](),_0x9976('0x5a'))['field'](_0x9976('0x71'),_0x9976('0x54'))[_0x9976('0x6f')](_0x9976('0x71'),'updatedAt')['from'](_0x9976('0x73'))['where'](_0x9976('0x74'))[_0x9976('0x37')](_0x9976('0x7e'),_0x423490[_0x9976('0x75')][_0x9976('0x72')]())[_0x9976('0x37')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x3a7bff['push'](db[_0x9976('0x85')][_0x9976('0x2f')](_0x1ef010));}return BPromise[_0x9976('0x7f')](_0x3a7bff);}})['then'](function(){return _0x318e9c;})['then'](respondWithResult(_0x1f5ffa,null))['catch'](handleError(_0x1f5ffa,null));};exports['removeBlackLists']=function(_0x5cf4f4,_0x160e3d,_0xf2244f){return db['Campaign'][_0x9976('0x47')]({'where':{'id':_0x5cf4f4['params']['id']}})[_0x9976('0x22')](handleEntityNotFound(_0x160e3d,null))[_0x9976('0x22')](function(_0xac5f52){if(_0xac5f52){return _0xac5f52[_0x9976('0x86')](_0x5cf4f4['query'][_0x9976('0x81')]);}})['then'](function(_0x30f577){if(_0x30f577){return db[_0x9976('0x61')]['destroy']({'where':{'ListId':_0x5cf4f4[_0x9976('0x2f')][_0x9976('0x81')],'CampaignId':_0x5cf4f4[_0x9976('0x43')]['id']}})[_0x9976('0x22')](function(){return _0x30f577;});}})['then'](respondWithStatusCode(_0x160e3d,null))[_0x9976('0x41')](handleError(_0x160e3d,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 024fa1b..e19d035 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index f15862a..aa0942d 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 _0xca2b=['GetCampaign','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Campaign','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x5bd48f,_0x522807){var _0x374ca2=function(_0x2bf2e5){while(--_0x2bf2e5){_0x5bd48f['push'](_0x5bd48f['shift']());}};_0x374ca2(++_0x522807);}(_0xca2b,0x156));var _0xbca2=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xca2b[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xbca2('0x0'));var util=require(_0xbca2('0x1'));var moment=require(_0xbca2('0x2'));var BPromise=require(_0xbca2('0x3'));var rs=require(_0xbca2('0x4'));var fs=require('fs');var Redis=require(_0xbca2('0x5'));var db=require(_0xbca2('0x6'))['db'];var utils=require(_0xbca2('0x7'));var logger=require('../../config/logger')(_0xbca2('0x8'));var config=require(_0xbca2('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbca2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3476ee,_0x214cdf,_0x226fca){return new BPromise(function(_0x562cf5,_0x4b08fb){return client[_0xbca2('0xb')](_0x3476ee,_0x226fca)['then'](function(_0x4dcbb8){logger[_0xbca2('0xc')](_0xbca2('0xd'),_0x214cdf,_0xbca2('0xe'));logger[_0xbca2('0xf')](_0xbca2('0x10'),_0x214cdf,_0xbca2('0xe'),JSON[_0xbca2('0x11')](_0x4dcbb8));if(_0x4dcbb8[_0xbca2('0x12')]){if(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x13')]===0x1f4){logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x4dcbb8[_0xbca2('0x12')]['message']);return _0x4b08fb(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);}logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);return _0x562cf5(_0x4dcbb8[_0xbca2('0x12')][_0xbca2('0x14')]);}else{logger[_0xbca2('0xc')]('Campaign,\x20%s,\x20%s',_0x214cdf,'request\x20sent');_0x562cf5(_0x4dcbb8[_0xbca2('0x15')][_0xbca2('0x14')]);}})['catch'](function(_0x9d7a88){logger[_0xbca2('0x12')](_0xbca2('0xd'),_0x214cdf,_0x9d7a88);_0x4b08fb(_0x9d7a88);});});}exports['GetCampaign']=function(_0x390095){var _0xfd34d3=this;return new Promise(function(_0x298b00,_0x345a9e){return db[_0xbca2('0x16')]['findAll']({'raw':_0x390095['options']?_0x390095[_0xbca2('0x17')][_0xbca2('0x18')]===undefined?!![]:![]:!![],'where':_0x390095['options']?_0x390095[_0xbca2('0x17')][_0xbca2('0x19')]||null:null,'attributes':_0x390095[_0xbca2('0x17')]?_0x390095[_0xbca2('0x17')][_0xbca2('0x1a')]||null:null,'limit':_0x390095[_0xbca2('0x17')]?_0x390095['options'][_0xbca2('0x1b')]||null:null,'include':_0x390095[_0xbca2('0x17')]?_0x390095[_0xbca2('0x17')][_0xbca2('0x1c')]?_[_0xbca2('0x1d')](_0x390095[_0xbca2('0x17')][_0xbca2('0x1c')],function(_0x204c89){return{'model':db[_0x204c89[_0xbca2('0x1e')]],'as':_0x204c89['as'],'attributes':_0x204c89[_0xbca2('0x1a')],'include':_0x204c89[_0xbca2('0x1c')]?_[_0xbca2('0x1d')](_0x204c89['include'],function(_0x331260){return{'model':db[_0x331260[_0xbca2('0x1e')]],'as':_0x331260['as'],'attributes':_0x331260[_0xbca2('0x1a')],'include':_0x331260[_0xbca2('0x1c')]?_[_0xbca2('0x1d')](_0x331260[_0xbca2('0x1c')],function(_0x3cf9da){return{'model':db[_0x3cf9da['model']],'as':_0x3cf9da['as'],'attributes':_0x3cf9da[_0xbca2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbca2('0x1f')](function(_0x1bf878){logger[_0xbca2('0xc')](_0xbca2('0x20'),_0x390095);logger[_0xbca2('0xf')](_0xbca2('0x20'),_0x390095,JSON[_0xbca2('0x11')](_0x1bf878));_0x298b00(_0x1bf878);})[_0xbca2('0x21')](function(_0x89c900){logger['error'](_0xbca2('0x20'),_0x89c900['message'],_0x390095);_0x345a9e(_0xfd34d3[_0xbca2('0x12')](0x1f4,_0x89c900['message']));});});}; \ No newline at end of file +var _0x81a4=['raw','attributes','limit','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetCampaign','Campaign','options'];(function(_0x55b745,_0x36e0fa){var _0x1772a7=function(_0x2bf1e3){while(--_0x2bf1e3){_0x55b745['push'](_0x55b745['shift']());}};_0x1772a7(++_0x36e0fa);}(_0x81a4,0x1a6));var _0x481a=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x81a4[_0x149083];return _0x4dc74e;};'use strict';var _=require(_0x481a('0x0'));var util=require(_0x481a('0x1'));var moment=require(_0x481a('0x2'));var BPromise=require(_0x481a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x481a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x481a('0x5'));var logger=require(_0x481a('0x6'))(_0x481a('0x7'));var config=require('../../config/environment');var jayson=require(_0x481a('0x8'));var client=jayson[_0x481a('0x9')][_0x481a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14b819,_0x4a5a92,_0x13ed10){return new BPromise(function(_0x13b771,_0x9b7dd5){return client[_0x481a('0xb')](_0x14b819,_0x13ed10)[_0x481a('0xc')](function(_0x59580e){logger['info'](_0x481a('0xd'),_0x4a5a92,_0x481a('0xe'));logger[_0x481a('0xf')](_0x481a('0x10'),_0x4a5a92,_0x481a('0xe'),JSON[_0x481a('0x11')](_0x59580e));if(_0x59580e[_0x481a('0x12')]){if(_0x59580e[_0x481a('0x12')][_0x481a('0x13')]===0x1f4){logger[_0x481a('0x12')]('Campaign,\x20%s,\x20%s',_0x4a5a92,_0x59580e['error'][_0x481a('0x14')]);return _0x9b7dd5(_0x59580e[_0x481a('0x12')][_0x481a('0x14')]);}logger[_0x481a('0x12')](_0x481a('0xd'),_0x4a5a92,_0x59580e[_0x481a('0x12')]['message']);return _0x13b771(_0x59580e[_0x481a('0x12')]['message']);}else{logger[_0x481a('0x15')](_0x481a('0xd'),_0x4a5a92,_0x481a('0xe'));_0x13b771(_0x59580e['result']['message']);}})[_0x481a('0x16')](function(_0xa5746f){logger[_0x481a('0x12')](_0x481a('0xd'),_0x4a5a92,_0xa5746f);_0x9b7dd5(_0xa5746f);});});}exports[_0x481a('0x17')]=function(_0x3186e3){var _0xe4e8fe=this;return new Promise(function(_0x2e6d4e,_0x38c15e){return db[_0x481a('0x18')]['findAll']({'raw':_0x3186e3[_0x481a('0x19')]?_0x3186e3[_0x481a('0x19')][_0x481a('0x1a')]===undefined?!![]:![]:!![],'where':_0x3186e3[_0x481a('0x19')]?_0x3186e3[_0x481a('0x19')]['where']||null:null,'attributes':_0x3186e3[_0x481a('0x19')]?_0x3186e3[_0x481a('0x19')][_0x481a('0x1b')]||null:null,'limit':_0x3186e3[_0x481a('0x19')]?_0x3186e3['options'][_0x481a('0x1c')]||null:null,'include':_0x3186e3[_0x481a('0x19')]?_0x3186e3[_0x481a('0x19')][_0x481a('0x1d')]?_[_0x481a('0x1e')](_0x3186e3[_0x481a('0x19')][_0x481a('0x1d')],function(_0x6a554b){return{'model':db[_0x6a554b['model']],'as':_0x6a554b['as'],'attributes':_0x6a554b[_0x481a('0x1b')],'include':_0x6a554b[_0x481a('0x1d')]?_['map'](_0x6a554b[_0x481a('0x1d')],function(_0x4916fa){return{'model':db[_0x4916fa[_0x481a('0x1f')]],'as':_0x4916fa['as'],'attributes':_0x4916fa[_0x481a('0x1b')],'include':_0x4916fa[_0x481a('0x1d')]?_[_0x481a('0x1e')](_0x4916fa['include'],function(_0x42acf4){return{'model':db[_0x42acf4[_0x481a('0x1f')]],'as':_0x42acf4['as'],'attributes':_0x42acf4[_0x481a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x481a('0xc')](function(_0x20aeb5){logger[_0x481a('0x15')]('GetCampaign',_0x3186e3);logger[_0x481a('0xf')](_0x481a('0x17'),_0x3186e3,JSON[_0x481a('0x11')](_0x20aeb5));_0x2e6d4e(_0x20aeb5);})[_0x481a('0x16')](function(_0x4e9d26){logger[_0x481a('0x12')](_0x481a('0x17'),_0x4e9d26[_0x481a('0x14')],_0x3186e3);_0x38c15e(_0xe4e8fe[_0x481a('0x12')](0x1f4,_0x4e9d26['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 8b1e9be..f7db168 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 _0x8f02=['getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists'];(function(_0x1c1200,_0xd515dd){var _0x537123=function(_0x425c73){while(--_0x425c73){_0x1c1200['push'](_0x1c1200['shift']());}};_0x537123(++_0xd515dd);}(_0x8f02,0x73));var _0x28f0=function(_0x5a91b4,_0x454c43){_0x5a91b4=_0x5a91b4-0x0;var _0x5af633=_0x8f02[_0x5a91b4];return _0x5af633;};'use strict';var multer=require(_0x28f0('0x0'));var util=require(_0x28f0('0x1'));var path=require(_0x28f0('0x2'));var timeout=require(_0x28f0('0x3'));var express=require(_0x28f0('0x4'));var router=express['Router']();var fs_extra=require(_0x28f0('0x5'));var auth=require(_0x28f0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x28f0('0x7'));router[_0x28f0('0x8')]('/',auth[_0x28f0('0x9')](),controller[_0x28f0('0xa')]);router['get'](_0x28f0('0xb'),auth[_0x28f0('0x9')](),controller['show']);router[_0x28f0('0x8')](_0x28f0('0xc'),auth[_0x28f0('0x9')](),controller[_0x28f0('0xd')]);router['get'](_0x28f0('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x28f0('0x8')](_0x28f0('0xf'),auth['isAuthenticated'](),controller[_0x28f0('0x10')]);router['get'](_0x28f0('0x11'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x12')]);router[_0x28f0('0x8')](_0x28f0('0x13'),auth[_0x28f0('0x9')](),controller['getLists']);router['get'](_0x28f0('0x14'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x15')]);router[_0x28f0('0x16')]('/',auth[_0x28f0('0x9')](),controller['create']);router[_0x28f0('0x16')](_0x28f0('0x17'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x18')]);router[_0x28f0('0x16')](_0x28f0('0x13'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x19')]);router['post'](_0x28f0('0x14'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x1a')]);router[_0x28f0('0x1b')]('/:id',auth[_0x28f0('0x9')](),controller[_0x28f0('0x1c')]);router[_0x28f0('0x1d')](_0x28f0('0xb'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x1e')]);router[_0x28f0('0x1d')](_0x28f0('0x13'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x1f')]);router[_0x28f0('0x1d')](_0x28f0('0x14'),auth[_0x28f0('0x9')](),controller[_0x28f0('0x20')]);module[_0x28f0('0x21')]=router; \ No newline at end of file +var _0x447e=['addBlackLists','put','delete','/:id','destroy','removeLists','removeBlackLists','path','connect-timeout','express','fs-extra','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','create','post','/:id/clone','clone','addLists','/:id/blacklists'];(function(_0x5914a3,_0x22e240){var _0x25af13=function(_0x33c161){while(--_0x33c161){_0x5914a3['push'](_0x5914a3['shift']());}};_0x25af13(++_0x22e240);}(_0x447e,0x10c));var _0xe447=function(_0x2a14dc,_0x527093){_0x2a14dc=_0x2a14dc-0x0;var _0x4fafe9=_0x447e[_0x2a14dc];return _0x4fafe9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe447('0x0'));var timeout=require(_0xe447('0x1'));var express=require(_0xe447('0x2'));var router=express['Router']();var fs_extra=require(_0xe447('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe447('0x4'));router[_0xe447('0x5')]('/',auth[_0xe447('0x6')](),controller[_0xe447('0x7')]);router['get']('/:id',auth[_0xe447('0x6')](),controller[_0xe447('0x8')]);router[_0xe447('0x5')](_0xe447('0x9'),auth[_0xe447('0x6')](),controller[_0xe447('0xa')]);router['get']('/:id/hopper_histories',auth[_0xe447('0x6')](),controller[_0xe447('0xb')]);router[_0xe447('0x5')]('/:id/hopper_finals',auth[_0xe447('0x6')](),controller[_0xe447('0xc')]);router[_0xe447('0x5')](_0xe447('0xd'),auth[_0xe447('0x6')](),controller[_0xe447('0xe')]);router[_0xe447('0x5')](_0xe447('0xf'),auth[_0xe447('0x6')](),controller['getLists']);router[_0xe447('0x5')]('/:id/blacklists',auth['isAuthenticated'](),controller['getBlackLists']);router['post']('/',auth[_0xe447('0x6')](),controller[_0xe447('0x10')]);router[_0xe447('0x11')](_0xe447('0x12'),auth[_0xe447('0x6')](),controller[_0xe447('0x13')]);router['post'](_0xe447('0xf'),auth['isAuthenticated'](),controller[_0xe447('0x14')]);router[_0xe447('0x11')](_0xe447('0x15'),auth[_0xe447('0x6')](),controller[_0xe447('0x16')]);router[_0xe447('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe447('0x18')](_0xe447('0x19'),auth['isAuthenticated'](),controller[_0xe447('0x1a')]);router[_0xe447('0x18')](_0xe447('0xf'),auth[_0xe447('0x6')](),controller[_0xe447('0x1b')]);router[_0xe447('0x18')](_0xe447('0x15'),auth['isAuthenticated'](),controller[_0xe447('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index c1ab42f..45ff885 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 _0xb909=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0xb909,0x15c));var _0x9b90=function(_0x172641,_0x28dd19){_0x172641=_0x172641-0x0;var _0x1e0d3e=_0xb909[_0x172641];return _0x1e0d3e;};'use strict';var Sequelize=require(_0x9b90('0x0'));module[_0x9b90('0x1')]={'key':{'type':Sequelize[_0x9b90('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9b90('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9b90('0x2')]},'name':{'type':Sequelize[_0x9b90('0x4')],'get':function(){return this[_0x9b90('0x5')]('key');}}}; \ No newline at end of file +var _0x8b7f=['exports','TEXT','STRING','VIRTUAL','key','sequelize'];(function(_0x11d9cf,_0x316da4){var _0x125988=function(_0x472e51){while(--_0x472e51){_0x11d9cf['push'](_0x11d9cf['shift']());}};_0x125988(++_0x316da4);}(_0x8b7f,0x1c1));var _0xf8b7=function(_0x433bf8,_0x481721){_0x433bf8=_0x433bf8-0x0;var _0x12cfd4=_0x8b7f[_0x433bf8];return _0x12cfd4;};'use strict';var Sequelize=require(_0xf8b7('0x0'));module[_0xf8b7('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf8b7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf8b7('0x3')]},'name':{'type':Sequelize[_0xf8b7('0x4')],'get':function(){return this['getDataValue'](_0xf8b7('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 86cd9a3..c354120 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 _0x3b6d=['body','params','create','MailAccountId','SmsAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','get','UserProfileResource','error','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','pick','where','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','find'];(function(_0x2bf466,_0x4929a5){var _0x856885=function(_0x102ef1){while(--_0x102ef1){_0x2bf466['push'](_0x2bf466['shift']());}};_0x856885(++_0x4929a5);}(_0x3b6d,0x67));var _0xd3b6=function(_0xbdd3b9,_0x3cbbc5){_0xbdd3b9=_0xbdd3b9-0x0;var _0x54dffb=_0x3b6d[_0xbdd3b9];return _0x54dffb;};'use strict';var emlformat=require(_0xd3b6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd3b6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd3b6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd3b6('0x3'));var util=require(_0xd3b6('0x4'));var path=require(_0xd3b6('0x5'));var sox=require(_0xd3b6('0x6'));var csv=require(_0xd3b6('0x7'));var ejs=require(_0xd3b6('0x8'));var fs=require('fs');var fs_extra=require(_0xd3b6('0x9'));var _=require(_0xd3b6('0xa'));var squel=require(_0xd3b6('0xb'));var crypto=require('crypto');var jsforce=require(_0xd3b6('0xc'));var deskjs=require(_0xd3b6('0xd'));var toCsv=require(_0xd3b6('0x7'));var querystring=require(_0xd3b6('0xe'));var Papa=require(_0xd3b6('0xf'));var Redis=require(_0xd3b6('0x10'));var authService=require(_0xd3b6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd3b6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd3b6('0x13'))(_0xd3b6('0x14'));var utils=require(_0xd3b6('0x15'));var config=require(_0xd3b6('0x16'));var licenseUtil=require(_0xd3b6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253870,_0x1267f6){_0x1267f6=_0x1267f6||0xcc;return function(_0x5c17fa){if(_0x5c17fa){return _0x253870[_0xd3b6('0x18')](_0x1267f6);}return _0x253870['status'](_0x1267f6)[_0xd3b6('0x19')]();};}function respondWithResult(_0x5ea9da,_0x1e0b56){_0x1e0b56=_0x1e0b56||0xc8;return function(_0x31951d){if(_0x31951d){return _0x5ea9da[_0xd3b6('0x1a')](_0x1e0b56)['json'](_0x31951d);}};}function respondWithFilteredResult(_0x496d88,_0x1bfcc5){return function(_0x4d39f0){if(_0x4d39f0){var _0x56c8c7=typeof _0x1bfcc5[_0xd3b6('0x1b')]==='undefined'&&typeof _0x1bfcc5[_0xd3b6('0x1c')]===_0xd3b6('0x1d');var _0x33e06b=_0x4d39f0[_0xd3b6('0x1e')];var _0x231237=_0x56c8c7?0x0:_0x1bfcc5[_0xd3b6('0x1b')];var _0x307cec=_0x56c8c7?_0x4d39f0[_0xd3b6('0x1e')]:_0x1bfcc5['offset']+_0x1bfcc5[_0xd3b6('0x1c')];var _0x27a680;if(_0x307cec>=_0x33e06b){_0x307cec=_0x33e06b;_0x27a680=0xc8;}else{_0x27a680=0xce;}_0x496d88[_0xd3b6('0x1a')](_0x27a680);return _0x496d88[_0xd3b6('0x1f')](_0xd3b6('0x20'),_0x231237+'-'+_0x307cec+'/'+_0x33e06b)[_0xd3b6('0x21')](_0x4d39f0);}return null;};}function patchUpdates(_0x4f7470){return function(_0xfc8639){try{jsonpatch[_0xd3b6('0x22')](_0xfc8639,_0x4f7470,!![]);}catch(_0xd9b2a3){return BPromise[_0xd3b6('0x23')](_0xd9b2a3);}return _0xfc8639['save']();};}function saveUpdates(_0x4f99cc,_0x51a871){return function(_0x2d0b5c){if(_0x2d0b5c){return _0x2d0b5c[_0xd3b6('0x24')](_0x4f99cc)[_0xd3b6('0x25')](function(_0x1a603){return _0x1a603;});}return null;};}function removeEntity(_0x48f729,_0x4609d6){return function(_0x1c97bb){if(_0x1c97bb){return _0x1c97bb[_0xd3b6('0x26')]()['then'](function(){var _0x2cb85e=_0x1c97bb[_0xd3b6('0x27')]({'plain':!![]});var _0x9c9525='CannedAnswers';return db[_0xd3b6('0x28')]['destroy']({'where':{'type':_0x9c9525,'resourceId':_0x2cb85e['id']}})[_0xd3b6('0x25')](function(){return _0x1c97bb;});})[_0xd3b6('0x25')](function(){_0x48f729[_0xd3b6('0x1a')](0xcc)[_0xd3b6('0x19')]();});}};}function handleEntityNotFound(_0x2b39b0,_0xb966da){return function(_0x1e76c3){if(!_0x1e76c3){_0x2b39b0['sendStatus'](0x194);}return _0x1e76c3;};}function handleError(_0x1ece08,_0x1217da){_0x1217da=_0x1217da||0x1f4;return function(_0x2197f9){logger[_0xd3b6('0x29')](_0x2197f9['stack']);if(_0x2197f9['name']){delete _0x2197f9[_0xd3b6('0x2a')];}_0x1ece08['status'](_0x1217da)[_0xd3b6('0x2b')](_0x2197f9);};}exports['index']=function(_0x4f52a6,_0x357423){var _0x3e50b0={},_0x2172ee={},_0x3ad77a={'count':0x0,'rows':[]};var _0x3b1dbe=_[_0xd3b6('0x2c')](db['CannedAnswer'][_0xd3b6('0x2d')],function(_0x1c17e6){return{'name':_0x1c17e6[_0xd3b6('0x2e')],'type':_0x1c17e6[_0xd3b6('0x2f')][_0xd3b6('0x30')]};});_0x2172ee['model']=_['map'](_0x3b1dbe,'name');_0x2172ee[_0xd3b6('0x31')]=_[_0xd3b6('0x32')](_0x4f52a6['query']);_0x2172ee[_0xd3b6('0x33')]=_[_0xd3b6('0x34')](_0x2172ee['model'],_0x2172ee[_0xd3b6('0x31')]);_0x3e50b0['attributes']=_[_0xd3b6('0x34')](_0x2172ee[_0xd3b6('0x35')],qs['fields'](_0x4f52a6[_0xd3b6('0x31')][_0xd3b6('0x36')]));_0x3e50b0[_0xd3b6('0x37')]=_0x3e50b0[_0xd3b6('0x37')][_0xd3b6('0x38')]?_0x3e50b0[_0xd3b6('0x37')]:_0x2172ee[_0xd3b6('0x35')];if(!_0x4f52a6['query'][_0xd3b6('0x39')](_0xd3b6('0x3a'))){_0x3e50b0[_0xd3b6('0x1c')]=qs[_0xd3b6('0x1c')](_0x4f52a6['query'][_0xd3b6('0x1c')]);_0x3e50b0['offset']=qs[_0xd3b6('0x1b')](_0x4f52a6['query'][_0xd3b6('0x1b')]);}_0x3e50b0[_0xd3b6('0x3b')]=qs['sort'](_0x4f52a6[_0xd3b6('0x31')]['sort']);_0x3e50b0['where']=qs[_0xd3b6('0x33')](_[_0xd3b6('0x3c')](_0x4f52a6['query'],_0x2172ee['filters']),_0x3b1dbe);if(_0x4f52a6[_0xd3b6('0x31')]['filter']){_0x3e50b0[_0xd3b6('0x3d')]=_[_0xd3b6('0x3e')](_0x3e50b0[_0xd3b6('0x3d')],{'$or':[{'key':{'$like':'%'+_0x4f52a6[_0xd3b6('0x31')][_0xd3b6('0x3f')]+'%'}},{'value':{'$like':'%'+_0x4f52a6[_0xd3b6('0x31')][_0xd3b6('0x3f')]+'%'}}]});}_0x3e50b0=_[_0xd3b6('0x3e')]({},_0x3e50b0,_0x4f52a6[_0xd3b6('0x40')]);var _0x8b0e80={'where':_0x3e50b0['where']};return db[_0xd3b6('0x41')][_0xd3b6('0x1e')](_0x8b0e80)[_0xd3b6('0x25')](function(_0x22b349){_0x3ad77a[_0xd3b6('0x1e')]=_0x22b349;if(_0x4f52a6['query'][_0xd3b6('0x42')]){_0x3e50b0[_0xd3b6('0x43')]=[{'all':!![]}];}return db[_0xd3b6('0x41')][_0xd3b6('0x44')](_0x3e50b0);})[_0xd3b6('0x25')](function(_0x1dd428){_0x3ad77a[_0xd3b6('0x45')]=_0x1dd428;return _0x3ad77a;})['then'](respondWithFilteredResult(_0x357423,_0x3e50b0))[_0xd3b6('0x46')](handleError(_0x357423,null));};exports[_0xd3b6('0x47')]=function(_0x468ae5,_0x7ea641){var _0x5220b4={'raw':!![],'where':{'id':_0x468ae5['params']['id']}},_0x483636={};_0x483636[_0xd3b6('0x35')]=_['keys'](db[_0xd3b6('0x41')][_0xd3b6('0x2d')]);_0x483636[_0xd3b6('0x31')]=_[_0xd3b6('0x32')](_0x468ae5['query']);_0x483636[_0xd3b6('0x33')]=_[_0xd3b6('0x34')](_0x483636['model'],_0x483636[_0xd3b6('0x31')]);_0x5220b4['attributes']=_[_0xd3b6('0x34')](_0x483636[_0xd3b6('0x35')],qs[_0xd3b6('0x36')](_0x468ae5[_0xd3b6('0x31')][_0xd3b6('0x36')]));_0x5220b4[_0xd3b6('0x37')]=_0x5220b4[_0xd3b6('0x37')][_0xd3b6('0x38')]?_0x5220b4[_0xd3b6('0x37')]:_0x483636['model'];if(_0x468ae5[_0xd3b6('0x31')][_0xd3b6('0x42')]){_0x5220b4['include']=[{'all':!![]}];}_0x5220b4=_[_0xd3b6('0x3e')]({},_0x5220b4,_0x468ae5[_0xd3b6('0x40')]);return db[_0xd3b6('0x41')][_0xd3b6('0x48')](_0x5220b4)[_0xd3b6('0x25')](handleEntityNotFound(_0x7ea641,null))[_0xd3b6('0x25')](respondWithResult(_0x7ea641,null))[_0xd3b6('0x46')](handleError(_0x7ea641,null));};exports[_0xd3b6('0x24')]=function(_0x3297a4,_0x8cda5b){if(_0x3297a4['body']['id']){delete _0x3297a4[_0xd3b6('0x49')]['id'];}return db[_0xd3b6('0x41')][_0xd3b6('0x48')]({'where':{'id':_0x3297a4['params']['id']}})[_0xd3b6('0x25')](handleEntityNotFound(_0x8cda5b,null))[_0xd3b6('0x25')](saveUpdates(_0x3297a4[_0xd3b6('0x49')],null))[_0xd3b6('0x25')](respondWithResult(_0x8cda5b,null))[_0xd3b6('0x46')](handleError(_0x8cda5b,null));};exports[_0xd3b6('0x26')]=function(_0x761d1c,_0x4bd235){return db['CannedAnswer'][_0xd3b6('0x48')]({'where':{'id':_0x761d1c[_0xd3b6('0x4a')]['id']}})[_0xd3b6('0x25')](handleEntityNotFound(_0x4bd235,null))[_0xd3b6('0x25')](removeEntity(_0x4bd235,null))['catch'](handleError(_0x4bd235,null));};exports[_0xd3b6('0x4b')]=function(_0x3c87af,_0x563b14){var _0x1618d1={'key':_0x3c87af[_0xd3b6('0x49')][_0xd3b6('0x30')]};if(_0x3c87af[_0xd3b6('0x49')][_0xd3b6('0x4c')]){_0x1618d1['MailAccountId']=_0x3c87af[_0xd3b6('0x49')][_0xd3b6('0x4c')];}else if(_0x3c87af['body'][_0xd3b6('0x4d')]){_0x1618d1[_0xd3b6('0x4d')]=_0x3c87af[_0xd3b6('0x49')][_0xd3b6('0x4d')];}else if(_0x3c87af[_0xd3b6('0x49')]['OpenchannelAccountId']){_0x1618d1['OpenchannelAccountId']=_0x3c87af[_0xd3b6('0x49')]['OpenchannelAccountId'];}else if(_0x3c87af[_0xd3b6('0x49')][_0xd3b6('0x4e')]){_0x1618d1[_0xd3b6('0x4e')]=_0x3c87af['body'][_0xd3b6('0x4e')];}return db['CannedAnswer'][_0xd3b6('0x48')]({'where':_0x1618d1})[_0xd3b6('0x25')](function(_0x368a49){if(_0x368a49){throw new db[(_0xd3b6('0x4f'))][(_0xd3b6('0x50'))](_0xd3b6('0x51'));}return db[_0xd3b6('0x41')][_0xd3b6('0x4b')](_0x3c87af[_0xd3b6('0x49')]);})[_0xd3b6('0x25')](function(_0x29bf0a){var _0x282ad1=_0x3c87af[_0xd3b6('0x52')][_0xd3b6('0x27')]({'plain':!![]});if(!_0x282ad1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x282ad1[_0xd3b6('0x53')]===_0xd3b6('0x52')){var _0x3122b7=_0x29bf0a[_0xd3b6('0x27')]({'plain':!![]});return db[_0xd3b6('0x54')][_0xd3b6('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x282ad1[_0xd3b6('0x55')]},'raw':!![]})['then'](function(_0x380b3a){if(_0x380b3a&&_0x380b3a[_0xd3b6('0x56')]===0x0){return db[_0xd3b6('0x28')][_0xd3b6('0x4b')]({'name':_0x3122b7[_0xd3b6('0x2a')],'resourceId':_0x3122b7['id'],'type':_0x380b3a[_0xd3b6('0x2a')],'sectionId':_0x380b3a['id']},{})[_0xd3b6('0x25')](function(){return _0x29bf0a;});}else{return _0x29bf0a;}})['catch'](function(_0x35da7c){logger[_0xd3b6('0x29')](_0xd3b6('0x57'),_0x35da7c);throw _0x35da7c;});}return _0x29bf0a;})[_0xd3b6('0x25')](respondWithResult(_0x563b14,0xc9))[_0xd3b6('0x46')](handleError(_0x563b14,null));}; \ No newline at end of file +var _0xda2e=['CannedAnswer','rawAttributes','fieldName','type','key','model','keys','filters','attributes','intersection','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','options','find','update','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','destroy','then','get','CannedAnswers','stack','name','send','map'];(function(_0x12f3fd,_0xcca6a8){var _0xf09b4b=function(_0x14e15a){while(--_0x14e15a){_0x12f3fd['push'](_0x12f3fd['shift']());}};_0xf09b4b(++_0xcca6a8);}(_0xda2e,0x136));var _0xeda2=function(_0x1ae78f,_0x122ed2){_0x1ae78f=_0x1ae78f-0x0;var _0x5baf80=_0xda2e[_0x1ae78f];return _0x5baf80;};'use strict';var emlformat=require(_0xeda2('0x0'));var rimraf=require(_0xeda2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeda2('0x2'));var rp=require('request-promise');var moment=require(_0xeda2('0x3'));var BPromise=require(_0xeda2('0x4'));var Mustache=require(_0xeda2('0x5'));var util=require(_0xeda2('0x6'));var path=require('path');var sox=require(_0xeda2('0x7'));var csv=require('to-csv');var ejs=require(_0xeda2('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeda2('0x9'));var squel=require(_0xeda2('0xa'));var crypto=require('crypto');var jsforce=require(_0xeda2('0xb'));var deskjs=require(_0xeda2('0xc'));var toCsv=require(_0xeda2('0xd'));var querystring=require(_0xeda2('0xe'));var Papa=require(_0xeda2('0xf'));var Redis=require(_0xeda2('0x10'));var authService=require(_0xeda2('0x11'));var qs=require(_0xeda2('0x12'));var as=require(_0xeda2('0x13'));var hardwareService=require(_0xeda2('0x14'));var logger=require(_0xeda2('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xeda2('0x16'));var db=require(_0xeda2('0x17'))['db'];function respondWithStatusCode(_0x38d62d,_0x2c7475){_0x2c7475=_0x2c7475||0xcc;return function(_0x43cbad){if(_0x43cbad){return _0x38d62d[_0xeda2('0x18')](_0x2c7475);}return _0x38d62d[_0xeda2('0x19')](_0x2c7475)[_0xeda2('0x1a')]();};}function respondWithResult(_0x99d28b,_0x451fb9){_0x451fb9=_0x451fb9||0xc8;return function(_0x3917d8){if(_0x3917d8){return _0x99d28b[_0xeda2('0x19')](_0x451fb9)[_0xeda2('0x1b')](_0x3917d8);}};}function respondWithFilteredResult(_0x1d6b79,_0x1614cb){return function(_0x5969f3){if(_0x5969f3){var _0x498c71=typeof _0x1614cb[_0xeda2('0x1c')]===_0xeda2('0x1d')&&typeof _0x1614cb[_0xeda2('0x1e')]===_0xeda2('0x1d');var _0x2dc69a=_0x5969f3[_0xeda2('0x1f')];var _0x2530ab=_0x498c71?0x0:_0x1614cb[_0xeda2('0x1c')];var _0x7a12f1=_0x498c71?_0x5969f3[_0xeda2('0x1f')]:_0x1614cb[_0xeda2('0x1c')]+_0x1614cb['limit'];var _0x5ce792;if(_0x7a12f1>=_0x2dc69a){_0x7a12f1=_0x2dc69a;_0x5ce792=0xc8;}else{_0x5ce792=0xce;}_0x1d6b79[_0xeda2('0x19')](_0x5ce792);return _0x1d6b79[_0xeda2('0x20')]('Content-Range',_0x2530ab+'-'+_0x7a12f1+'/'+_0x2dc69a)[_0xeda2('0x1b')](_0x5969f3);}return null;};}function patchUpdates(_0x5cb643){return function(_0x285bfc){try{jsonpatch['apply'](_0x285bfc,_0x5cb643,!![]);}catch(_0x3efe35){return BPromise['reject'](_0x3efe35);}return _0x285bfc[_0xeda2('0x21')]();};}function saveUpdates(_0x32fcc8,_0x30cb5c){return function(_0x24af4d){if(_0x24af4d){return _0x24af4d['update'](_0x32fcc8)['then'](function(_0x103672){return _0x103672;});}return null;};}function removeEntity(_0x48cb4c,_0x1013d7){return function(_0x1324da){if(_0x1324da){return _0x1324da[_0xeda2('0x22')]()[_0xeda2('0x23')](function(){var _0x3e7f16=_0x1324da[_0xeda2('0x24')]({'plain':!![]});var _0x4665cc=_0xeda2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x4665cc,'resourceId':_0x3e7f16['id']}})[_0xeda2('0x23')](function(){return _0x1324da;});})['then'](function(){_0x48cb4c[_0xeda2('0x19')](0xcc)[_0xeda2('0x1a')]();});}};}function handleEntityNotFound(_0x2df59f,_0x146d96){return function(_0x88dc71){if(!_0x88dc71){_0x2df59f[_0xeda2('0x18')](0x194);}return _0x88dc71;};}function handleError(_0x7da993,_0xb5851){_0xb5851=_0xb5851||0x1f4;return function(_0x399cf2){logger['error'](_0x399cf2[_0xeda2('0x26')]);if(_0x399cf2[_0xeda2('0x27')]){delete _0x399cf2[_0xeda2('0x27')];}_0x7da993[_0xeda2('0x19')](_0xb5851)[_0xeda2('0x28')](_0x399cf2);};}exports['index']=function(_0x2b83ee,_0x3e432e){var _0x4cc3cb={},_0x350afd={},_0x171610={'count':0x0,'rows':[]};var _0x3832df=_[_0xeda2('0x29')](db[_0xeda2('0x2a')][_0xeda2('0x2b')],function(_0x1e0300){return{'name':_0x1e0300[_0xeda2('0x2c')],'type':_0x1e0300[_0xeda2('0x2d')][_0xeda2('0x2e')]};});_0x350afd[_0xeda2('0x2f')]=_[_0xeda2('0x29')](_0x3832df,_0xeda2('0x27'));_0x350afd['query']=_[_0xeda2('0x30')](_0x2b83ee['query']);_0x350afd[_0xeda2('0x31')]=_['intersection'](_0x350afd['model'],_0x350afd['query']);_0x4cc3cb[_0xeda2('0x32')]=_[_0xeda2('0x33')](_0x350afd[_0xeda2('0x2f')],qs[_0xeda2('0x34')](_0x2b83ee[_0xeda2('0x35')][_0xeda2('0x34')]));_0x4cc3cb[_0xeda2('0x32')]=_0x4cc3cb[_0xeda2('0x32')][_0xeda2('0x36')]?_0x4cc3cb['attributes']:_0x350afd['model'];if(!_0x2b83ee[_0xeda2('0x35')][_0xeda2('0x37')](_0xeda2('0x38'))){_0x4cc3cb['limit']=qs[_0xeda2('0x1e')](_0x2b83ee['query'][_0xeda2('0x1e')]);_0x4cc3cb[_0xeda2('0x1c')]=qs[_0xeda2('0x1c')](_0x2b83ee[_0xeda2('0x35')][_0xeda2('0x1c')]);}_0x4cc3cb[_0xeda2('0x39')]=qs[_0xeda2('0x3a')](_0x2b83ee[_0xeda2('0x35')][_0xeda2('0x3a')]);_0x4cc3cb[_0xeda2('0x3b')]=qs[_0xeda2('0x31')](_[_0xeda2('0x3c')](_0x2b83ee['query'],_0x350afd['filters']),_0x3832df);if(_0x2b83ee[_0xeda2('0x35')]['filter']){_0x4cc3cb[_0xeda2('0x3b')]=_[_0xeda2('0x3d')](_0x4cc3cb[_0xeda2('0x3b')],{'$or':[{'key':{'$like':'%'+_0x2b83ee[_0xeda2('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x2b83ee[_0xeda2('0x35')][_0xeda2('0x3e')]+'%'}}]});}_0x4cc3cb=_[_0xeda2('0x3d')]({},_0x4cc3cb,_0x2b83ee['options']);var _0x5dd76d={'where':_0x4cc3cb[_0xeda2('0x3b')]};return db[_0xeda2('0x2a')]['count'](_0x5dd76d)['then'](function(_0x3a566f){_0x171610['count']=_0x3a566f;if(_0x2b83ee[_0xeda2('0x35')][_0xeda2('0x3f')]){_0x4cc3cb[_0xeda2('0x40')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4cc3cb);})[_0xeda2('0x23')](function(_0x1056ba){_0x171610[_0xeda2('0x41')]=_0x1056ba;return _0x171610;})[_0xeda2('0x23')](respondWithFilteredResult(_0x3e432e,_0x4cc3cb))[_0xeda2('0x42')](handleError(_0x3e432e,null));};exports[_0xeda2('0x43')]=function(_0x344ba4,_0x2d9e5f){var _0x56c748={'raw':!![],'where':{'id':_0x344ba4['params']['id']}},_0x93edf={};_0x93edf[_0xeda2('0x2f')]=_[_0xeda2('0x30')](db['CannedAnswer']['rawAttributes']);_0x93edf[_0xeda2('0x35')]=_[_0xeda2('0x30')](_0x344ba4[_0xeda2('0x35')]);_0x93edf[_0xeda2('0x31')]=_[_0xeda2('0x33')](_0x93edf[_0xeda2('0x2f')],_0x93edf[_0xeda2('0x35')]);_0x56c748[_0xeda2('0x32')]=_[_0xeda2('0x33')](_0x93edf[_0xeda2('0x2f')],qs['fields'](_0x344ba4['query'][_0xeda2('0x34')]));_0x56c748['attributes']=_0x56c748[_0xeda2('0x32')][_0xeda2('0x36')]?_0x56c748['attributes']:_0x93edf[_0xeda2('0x2f')];if(_0x344ba4[_0xeda2('0x35')][_0xeda2('0x3f')]){_0x56c748['include']=[{'all':!![]}];}_0x56c748=_['merge']({},_0x56c748,_0x344ba4[_0xeda2('0x44')]);return db['CannedAnswer'][_0xeda2('0x45')](_0x56c748)[_0xeda2('0x23')](handleEntityNotFound(_0x2d9e5f,null))['then'](respondWithResult(_0x2d9e5f,null))[_0xeda2('0x42')](handleError(_0x2d9e5f,null));};exports[_0xeda2('0x46')]=function(_0x53967e,_0x22c88e){if(_0x53967e['body']['id']){delete _0x53967e[_0xeda2('0x47')]['id'];}return db[_0xeda2('0x2a')][_0xeda2('0x45')]({'where':{'id':_0x53967e[_0xeda2('0x48')]['id']}})['then'](handleEntityNotFound(_0x22c88e,null))[_0xeda2('0x23')](saveUpdates(_0x53967e[_0xeda2('0x47')],null))[_0xeda2('0x23')](respondWithResult(_0x22c88e,null))[_0xeda2('0x42')](handleError(_0x22c88e,null));};exports[_0xeda2('0x22')]=function(_0x61d90b,_0x55b9f4){return db[_0xeda2('0x2a')][_0xeda2('0x45')]({'where':{'id':_0x61d90b[_0xeda2('0x48')]['id']}})[_0xeda2('0x23')](handleEntityNotFound(_0x55b9f4,null))[_0xeda2('0x23')](removeEntity(_0x55b9f4,null))['catch'](handleError(_0x55b9f4,null));};exports[_0xeda2('0x49')]=function(_0x11e000,_0x1afec2){var _0x2e5a11={'key':_0x11e000[_0xeda2('0x47')][_0xeda2('0x2e')]};if(_0x11e000[_0xeda2('0x47')]['MailAccountId']){_0x2e5a11[_0xeda2('0x4a')]=_0x11e000[_0xeda2('0x47')][_0xeda2('0x4a')];}else if(_0x11e000[_0xeda2('0x47')][_0xeda2('0x4b')]){_0x2e5a11['SmsAccountId']=_0x11e000[_0xeda2('0x47')][_0xeda2('0x4b')];}else if(_0x11e000[_0xeda2('0x47')][_0xeda2('0x4c')]){_0x2e5a11[_0xeda2('0x4c')]=_0x11e000[_0xeda2('0x47')][_0xeda2('0x4c')];}else if(_0x11e000[_0xeda2('0x47')]['ChatWebsiteId']){_0x2e5a11[_0xeda2('0x4d')]=_0x11e000['body'][_0xeda2('0x4d')];}return db[_0xeda2('0x2a')][_0xeda2('0x45')]({'where':_0x2e5a11})[_0xeda2('0x23')](function(_0x527315){if(_0x527315){throw new db[(_0xeda2('0x4e'))][(_0xeda2('0x4f'))](_0xeda2('0x50'));}return db['CannedAnswer'][_0xeda2('0x49')](_0x11e000[_0xeda2('0x47')]);})[_0xeda2('0x23')](function(_0x29ff54){var _0x55a7a0=_0x11e000['user'][_0xeda2('0x24')]({'plain':!![]});if(!_0x55a7a0)throw new Error(_0xeda2('0x51'));if(_0x55a7a0[_0xeda2('0x52')]===_0xeda2('0x53')){var _0x4af9fb=_0x29ff54['get']({'plain':!![]});return db[_0xeda2('0x54')][_0xeda2('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x55a7a0[_0xeda2('0x55')]},'raw':!![]})[_0xeda2('0x23')](function(_0x344d50){if(_0x344d50&&_0x344d50['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4af9fb[_0xeda2('0x27')],'resourceId':_0x4af9fb['id'],'type':_0x344d50['name'],'sectionId':_0x344d50['id']},{})[_0xeda2('0x23')](function(){return _0x29ff54;});}else{return _0x29ff54;}})['catch'](function(_0x2bedbf){logger[_0xeda2('0x56')](_0xeda2('0x57'),_0x2bedbf);throw _0x2bedbf;});}return _0x29ff54;})[_0xeda2('0x23')](respondWithResult(_0x1afec2,0xc9))[_0xeda2('0x42')](handleError(_0x1afec2,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f71108b..9f2c8f9 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 _0xb262=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','CannedAnswer','tools_canned_answers'];(function(_0x8cd353,_0x3ec291){var _0x875a97=function(_0x1e90a7){while(--_0x1e90a7){_0x8cd353['push'](_0x8cd353['shift']());}};_0x875a97(++_0x3ec291);}(_0xb262,0x16e));var _0x2b26=function(_0x1691c1,_0x149f54){_0x1691c1=_0x1691c1-0x0;var _0x4e5a12=_0xb262[_0x1691c1];return _0x4e5a12;};'use strict';var _=require(_0x2b26('0x0'));var util=require(_0x2b26('0x1'));var logger=require(_0x2b26('0x2'))('api');var moment=require(_0x2b26('0x3'));var BPromise=require(_0x2b26('0x4'));var rp=require(_0x2b26('0x5'));var fs=require('fs');var path=require(_0x2b26('0x6'));var rimraf=require(_0x2b26('0x7'));var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0x2b26('0x8')]=function(_0x22cf6e,_0x130899){return _0x22cf6e[_0x2b26('0x9')](_0x2b26('0xa'),attributes,{'tableName':_0x2b26('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b26('0xc'),'collate':_0x2b26('0xd')});}; \ No newline at end of file +var _0xc071=['bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1002b6,_0x3d48b6){var _0x53e752=function(_0x677722){while(--_0x677722){_0x1002b6['push'](_0x1002b6['shift']());}};_0x53e752(++_0x3d48b6);}(_0xc071,0x1ae));var _0x1c07=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0xc071[_0x33554b];return _0x256954;};'use strict';var _=require(_0x1c07('0x0'));var util=require(_0x1c07('0x1'));var logger=require(_0x1c07('0x2'))(_0x1c07('0x3'));var moment=require('moment');var BPromise=require(_0x1c07('0x4'));var rp=require(_0x1c07('0x5'));var fs=require('fs');var path=require(_0x1c07('0x6'));var rimraf=require(_0x1c07('0x7'));var config=require(_0x1c07('0x8'));var attributes=require(_0x1c07('0x9'));module[_0x1c07('0xa')]=function(_0x31e86d,_0xac3e51){return _0x31e86d[_0x1c07('0xb')]('CannedAnswer',attributes,{'tableName':_0x1c07('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1c07('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 47a22d4..0e90911 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(_0x139390,_0x57eb17){var _0x3dc0ef=function(_0x4354b3){while(--_0x4354b3){_0x139390['push'](_0x139390['shift']());}};_0x3dc0ef(++_0x57eb17);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x434101,_0x43c193){var _0x2e0dc3=function(_0x5ef595){while(--_0x5ef595){_0x434101['push'](_0x434101['shift']());}};_0x2e0dc3(++_0x43c193);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 74d9aba..94a0b98 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 _0x4d2a=['destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','post','create','put','/:id','update','delete'];(function(_0x3a71dd,_0x424ebb){var _0x4b1cab=function(_0x9cdfff){while(--_0x9cdfff){_0x3a71dd['push'](_0x3a71dd['shift']());}};_0x4b1cab(++_0x424ebb);}(_0x4d2a,0x1e8));var _0xa4d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d2a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa4d2('0x0'));var util=require(_0xa4d2('0x1'));var path=require('path');var timeout=require(_0xa4d2('0x2'));var express=require('express');var router=express[_0xa4d2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa4d2('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa4d2('0x5'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xa4d2('0x6')](),controller[_0xa4d2('0x7')]);router[_0xa4d2('0x8')]('/:id',auth[_0xa4d2('0x6')](),controller[_0xa4d2('0x9')]);router[_0xa4d2('0xa')]('/',auth['isAuthenticated'](),controller[_0xa4d2('0xb')]);router[_0xa4d2('0xc')](_0xa4d2('0xd'),auth['isAuthenticated'](),controller[_0xa4d2('0xe')]);router[_0xa4d2('0xf')](_0xa4d2('0xd'),auth[_0xa4d2('0x6')](),controller[_0xa4d2('0x10')]);module[_0xa4d2('0x11')]=router; \ No newline at end of file +var _0x4515=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x233b78,_0x219158){var _0x5139cd=function(_0x2665a6){while(--_0x2665a6){_0x233b78['push'](_0x233b78['shift']());}};_0x5139cd(++_0x219158);}(_0x4515,0xdf));var _0x5451=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4515[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x5451('0x0'));var util=require(_0x5451('0x1'));var path=require(_0x5451('0x2'));var timeout=require(_0x5451('0x3'));var express=require(_0x5451('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5451('0x5'));var config=require(_0x5451('0x6'));var controller=require(_0x5451('0x7'));router[_0x5451('0x8')]('/',auth[_0x5451('0x9')](),controller['index']);router[_0x5451('0x8')](_0x5451('0xa'),auth['isAuthenticated'](),controller[_0x5451('0xb')]);router[_0x5451('0xc')]('/',auth[_0x5451('0x9')](),controller[_0x5451('0xd')]);router[_0x5451('0xe')](_0x5451('0xa'),auth[_0x5451('0x9')](),controller[_0x5451('0xf')]);router[_0x5451('0x10')]('/:id',auth[_0x5451('0x9')](),controller[_0x5451('0x11')]);module[_0x5451('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 3f8b95b..bce2634 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 _0x1da1=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1da1,0x1a4));var _0x11da=function(_0x54306e,_0x37a0ae){_0x54306e=_0x54306e-0x0;var _0x31af2f=_0x1da1[_0x54306e];return _0x31af2f;};'use strict';var Sequelize=require(_0x11da('0x0'));module[_0x11da('0x1')]={'calldate':{'type':Sequelize[_0x11da('0x2')],'allowNull':![],'defaultValue':_0x11da('0x3')},'clid':{'type':Sequelize[_0x11da('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x11da('0x4')]},'channel':{'type':Sequelize[_0x11da('0x4')]},'dstchannel':{'type':Sequelize[_0x11da('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x11da('0x4')]},'duration':{'type':Sequelize[_0x11da('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x11da('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x11da('0x4')]},'userfield':{'type':Sequelize[_0x11da('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x11da('0x4')]},'sequence':{'type':Sequelize[_0x11da('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x11da('0x4')]},'tag':{'type':Sequelize[_0x11da('0x4')]}}; \ No newline at end of file +var _0x58e5=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x38fbd4,_0xfc188e){var _0x23a8df=function(_0x228366){while(--_0x228366){_0x38fbd4['push'](_0x38fbd4['shift']());}};_0x23a8df(++_0xfc188e);}(_0x58e5,0xd1));var _0x558e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x58e5[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x558e('0x0'));module[_0x558e('0x1')]={'calldate':{'type':Sequelize[_0x558e('0x2')],'allowNull':![],'defaultValue':_0x558e('0x3')},'clid':{'type':Sequelize[_0x558e('0x4')]},'src':{'type':Sequelize[_0x558e('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x558e('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x558e('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x558e('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x558e('0x4')]},'amaflags':{'type':Sequelize[_0x558e('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x558e('0x4')]},'type':{'type':Sequelize[_0x558e('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index c8365fe..00640c8 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 _0xbd51=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3b1466,_0x20cdc8){_0x3b1466=_0x3b1466-0x0;var _0xce54d3=_0xbd51[_0x3b1466];return _0xce54d3;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')](_0x1a29f3[_0x1bd5('0x4a')],{})[_0x1bd5('0x40')](respondWithResult(_0xe71454,0xc9))['catch'](handleError(_0xe71454,null));};exports[_0x1bd5('0x23')]=function(_0x227a68,_0x2a1ece){if(_0x227a68[_0x1bd5('0x4a')]['id']){delete _0x227a68[_0x1bd5('0x4a')]['id'];}return db[_0x1bd5('0x2a')]['find']({'where':{'id':_0x227a68[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x2a1ece,null))[_0x1bd5('0x40')](saveUpdates(_0x227a68[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x2a1ece,null))[_0x1bd5('0x48')](handleError(_0x2a1ece,null));};exports[_0x1bd5('0x24')]=function(_0x539d0e,_0x587c46){return db[_0x1bd5('0x2a')][_0x1bd5('0x4b')]({'where':{'id':_0x539d0e[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x587c46,null))[_0x1bd5('0x40')](removeEntity(_0x587c46,null))[_0x1bd5('0x48')](handleError(_0x587c46,null));};exports[_0x1bd5('0x4c')]=function(_0x1f2d7e,_0x11813d){return db[_0x1bd5('0x2a')][_0x1bd5('0x4c')]()['then'](respondWithResult(_0x11813d,null))[_0x1bd5('0x48')](handleError(_0x11813d,null));}; \ No newline at end of file +var _0x23f4=['index','map','Cdr','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','create','body','update','find','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','stack','send'];(function(_0x993662,_0x1fecb5){var _0x201c90=function(_0xac975e){while(--_0xac975e){_0x993662['push'](_0x993662['shift']());}};_0x201c90(++_0x1fecb5);}(_0x23f4,0x1ee));var _0x423f=function(_0x3c39cf,_0x39f2e0){_0x3c39cf=_0x3c39cf-0x0;var _0x5285fa=_0x23f4[_0x3c39cf];return _0x5285fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x423f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x423f('0x1'));var moment=require(_0x423f('0x2'));var BPromise=require(_0x423f('0x3'));var Mustache=require(_0x423f('0x4'));var util=require(_0x423f('0x5'));var path=require(_0x423f('0x6'));var sox=require(_0x423f('0x7'));var csv=require(_0x423f('0x8'));var ejs=require(_0x423f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x423f('0xa'));var squel=require(_0x423f('0xb'));var crypto=require('crypto');var jsforce=require(_0x423f('0xc'));var deskjs=require(_0x423f('0xd'));var toCsv=require(_0x423f('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x423f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x423f('0xf'));var hardwareService=require(_0x423f('0x10'));var logger=require(_0x423f('0x11'))(_0x423f('0x12'));var utils=require('../../config/utils');var config=require(_0x423f('0x13'));var licenseUtil=require(_0x423f('0x14'));var db=require(_0x423f('0x15'))['db'];function respondWithStatusCode(_0x3d4027,_0x216360){_0x216360=_0x216360||0xcc;return function(_0x5275b0){if(_0x5275b0){return _0x3d4027[_0x423f('0x16')](_0x216360);}return _0x3d4027[_0x423f('0x17')](_0x216360)[_0x423f('0x18')]();};}function respondWithResult(_0x1c894f,_0x44e1d5){_0x44e1d5=_0x44e1d5||0xc8;return function(_0x3b531d){if(_0x3b531d){return _0x1c894f[_0x423f('0x17')](_0x44e1d5)[_0x423f('0x19')](_0x3b531d);}};}function respondWithFilteredResult(_0x252e6c,_0x235c86){return function(_0x3940ea){if(_0x3940ea){var _0x276be1=typeof _0x235c86[_0x423f('0x1a')]===_0x423f('0x1b')&&typeof _0x235c86[_0x423f('0x1c')]===_0x423f('0x1b');var _0x3fd56d=_0x3940ea[_0x423f('0x1d')];var _0x26b6d1=_0x276be1?0x0:_0x235c86['offset'];var _0x99435f=_0x276be1?_0x3940ea['count']:_0x235c86['offset']+_0x235c86[_0x423f('0x1c')];var _0x4956e0;if(_0x99435f>=_0x3fd56d){_0x99435f=_0x3fd56d;_0x4956e0=0xc8;}else{_0x4956e0=0xce;}_0x252e6c[_0x423f('0x17')](_0x4956e0);return _0x252e6c[_0x423f('0x1e')]('Content-Range',_0x26b6d1+'-'+_0x99435f+'/'+_0x3fd56d)[_0x423f('0x19')](_0x3940ea);}return null;};}function patchUpdates(_0x1fc317){return function(_0x56c21e){try{jsonpatch[_0x423f('0x1f')](_0x56c21e,_0x1fc317,!![]);}catch(_0x2ebe74){return BPromise['reject'](_0x2ebe74);}return _0x56c21e[_0x423f('0x20')]();};}function saveUpdates(_0x1b4ecc,_0x568dcd){return function(_0x54f47){if(_0x54f47){return _0x54f47['update'](_0x1b4ecc)[_0x423f('0x21')](function(_0x3c942e){return _0x3c942e;});}return null;};}function removeEntity(_0x4502ab,_0x3955a0){return function(_0xb82e8d){if(_0xb82e8d){return _0xb82e8d[_0x423f('0x22')]()[_0x423f('0x21')](function(){_0x4502ab[_0x423f('0x17')](0xcc)[_0x423f('0x18')]();});}};}function handleEntityNotFound(_0x36f57f,_0x45889f){return function(_0x199196){if(!_0x199196){_0x36f57f[_0x423f('0x16')](0x194);}return _0x199196;};}function handleError(_0x1f1747,_0x4a98f2){_0x4a98f2=_0x4a98f2||0x1f4;return function(_0x3308dd){logger[_0x423f('0x23')](_0x3308dd[_0x423f('0x24')]);if(_0x3308dd['name']){delete _0x3308dd['name'];}_0x1f1747[_0x423f('0x17')](_0x4a98f2)[_0x423f('0x25')](_0x3308dd);};}exports[_0x423f('0x26')]=function(_0x4c2f21,_0x5882ed){var _0x3ca28d={},_0xbb4bce={},_0x5a838e={'count':0x0,'rows':[]};var _0x3cf4aa=_[_0x423f('0x27')](db[_0x423f('0x28')][_0x423f('0x29')],function(_0x518c1e){return{'name':_0x518c1e[_0x423f('0x2a')],'type':_0x518c1e[_0x423f('0x2b')][_0x423f('0x2c')]};});_0xbb4bce[_0x423f('0x2d')]=_['map'](_0x3cf4aa,_0x423f('0x2e'));_0xbb4bce[_0x423f('0x2f')]=_[_0x423f('0x30')](_0x4c2f21[_0x423f('0x2f')]);_0xbb4bce[_0x423f('0x31')]=_[_0x423f('0x32')](_0xbb4bce[_0x423f('0x2d')],_0xbb4bce[_0x423f('0x2f')]);_0x3ca28d[_0x423f('0x33')]=_[_0x423f('0x32')](_0xbb4bce['model'],qs[_0x423f('0x34')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x34')]));_0x3ca28d['attributes']=_0x3ca28d[_0x423f('0x33')]['length']?_0x3ca28d[_0x423f('0x33')]:_0xbb4bce[_0x423f('0x2d')];if(!_0x4c2f21[_0x423f('0x2f')][_0x423f('0x35')](_0x423f('0x36'))){_0x3ca28d['limit']=qs['limit'](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1c')]);_0x3ca28d[_0x423f('0x1a')]=qs[_0x423f('0x1a')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x1a')]);}_0x3ca28d[_0x423f('0x37')]=qs[_0x423f('0x38')](_0x4c2f21[_0x423f('0x2f')][_0x423f('0x38')]);_0x3ca28d[_0x423f('0x39')]=qs[_0x423f('0x31')](_[_0x423f('0x3a')](_0x4c2f21['query'],_0xbb4bce['filters']),_0x3cf4aa);if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]){_0x3ca28d[_0x423f('0x39')]=_[_0x423f('0x3c')](_0x3ca28d[_0x423f('0x39')],{'$or':_['map'](_0x3cf4aa,function(_0x38dcce){if(_0x38dcce[_0x423f('0x2b')]!==_0x423f('0x3d')){var _0x1d47d8={};_0x1d47d8[_0x38dcce[_0x423f('0x2e')]]={'$like':'%'+_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3b')]+'%'};return _0x1d47d8;}})});}_0x3ca28d=_[_0x423f('0x3c')]({},_0x3ca28d,_0x4c2f21[_0x423f('0x3e')]);var _0x40571a={'where':_0x3ca28d['where']};return db['Cdr'][_0x423f('0x1d')](_0x40571a)[_0x423f('0x21')](function(_0x81bd62){_0x5a838e[_0x423f('0x1d')]=_0x81bd62;if(_0x4c2f21[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3ca28d['include']=[{'all':!![]}];}return db[_0x423f('0x28')][_0x423f('0x40')](_0x3ca28d);})[_0x423f('0x21')](function(_0x393618){_0x5a838e[_0x423f('0x41')]=_0x393618;return _0x5a838e;})[_0x423f('0x21')](respondWithFilteredResult(_0x5882ed,_0x3ca28d))[_0x423f('0x42')](handleError(_0x5882ed,null));};exports[_0x423f('0x43')]=function(_0x518443,_0x4165e0){var _0x3bc113={'raw':!![],'where':{'id':_0x518443[_0x423f('0x44')]['id']}},_0x192ae5={};_0x192ae5[_0x423f('0x2d')]=_[_0x423f('0x30')](db[_0x423f('0x28')][_0x423f('0x29')]);_0x192ae5[_0x423f('0x2f')]=_['keys'](_0x518443[_0x423f('0x2f')]);_0x192ae5['filters']=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],_0x192ae5[_0x423f('0x2f')]);_0x3bc113[_0x423f('0x33')]=_[_0x423f('0x32')](_0x192ae5[_0x423f('0x2d')],qs[_0x423f('0x34')](_0x518443[_0x423f('0x2f')][_0x423f('0x34')]));_0x3bc113[_0x423f('0x33')]=_0x3bc113[_0x423f('0x33')][_0x423f('0x45')]?_0x3bc113[_0x423f('0x33')]:_0x192ae5[_0x423f('0x2d')];if(_0x518443[_0x423f('0x2f')][_0x423f('0x3f')]){_0x3bc113[_0x423f('0x46')]=[{'all':!![]}];}_0x3bc113=_[_0x423f('0x3c')]({},_0x3bc113,_0x518443[_0x423f('0x3e')]);return db[_0x423f('0x28')]['find'](_0x3bc113)[_0x423f('0x21')](handleEntityNotFound(_0x4165e0,null))['then'](respondWithResult(_0x4165e0,null))[_0x423f('0x42')](handleError(_0x4165e0,null));};exports[_0x423f('0x47')]=function(_0x1cf881,_0x37035a){return db[_0x423f('0x28')][_0x423f('0x47')](_0x1cf881[_0x423f('0x48')],{})[_0x423f('0x21')](respondWithResult(_0x37035a,0xc9))[_0x423f('0x42')](handleError(_0x37035a,null));};exports[_0x423f('0x49')]=function(_0x31b88e,_0x2dcbec){if(_0x31b88e['body']['id']){delete _0x31b88e[_0x423f('0x48')]['id'];}return db[_0x423f('0x28')]['find']({'where':{'id':_0x31b88e[_0x423f('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dcbec,null))[_0x423f('0x21')](saveUpdates(_0x31b88e['body'],null))['then'](respondWithResult(_0x2dcbec,null))[_0x423f('0x42')](handleError(_0x2dcbec,null));};exports[_0x423f('0x22')]=function(_0x1668d4,_0x4114e1){return db['Cdr'][_0x423f('0x4a')]({'where':{'id':_0x1668d4['params']['id']}})[_0x423f('0x21')](handleEntityNotFound(_0x4114e1,null))[_0x423f('0x21')](removeEntity(_0x4114e1,null))[_0x423f('0x42')](handleError(_0x4114e1,null));};exports[_0x423f('0x4b')]=function(_0x17c2b6,_0x961f0d){return db[_0x423f('0x28')][_0x423f('0x4b')]()[_0x423f('0x21')](respondWithResult(_0x961f0d,null))['catch'](handleError(_0x961f0d,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 6c7abac..669732e 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x242890,_0x2463bb){var _0x4bc1ff=function(_0x3c302e){while(--_0x3c302e){_0x242890['push'](_0x242890['shift']());}};_0x4bc1ff(++_0x2463bb);}(_0x7a54,0x106));var _0x47a5=function(_0x108642,_0x30060d){_0x108642=_0x108642-0x0;var _0x34bd01=_0x7a54[_0x108642];return _0x34bd01;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4c4220,_0x5e8b5d){var _0x244cab=function(_0x3abee8){while(--_0x3abee8){_0x4c4220['push'](_0x4c4220['shift']());}};_0x244cab(++_0x5e8b5d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 48e5e46..0f5d8ba 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 _0x6bf4=['client','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x6bf4,0xf7));var _0x46bf=function(_0x1e9db4,_0x1e4227){_0x1e9db4=_0x1e9db4-0x0;var _0x28da26=_0x6bf4[_0x1e9db4];return _0x28da26;};'use strict';var _=require(_0x46bf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x46bf('0x1'));var fs=require('fs');var Redis=require(_0x46bf('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x46bf('0x3'));var logger=require(_0x46bf('0x4'))(_0x46bf('0x5'));var config=require(_0x46bf('0x6'));var jayson=require(_0x46bf('0x7'));var client=jayson[_0x46bf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b9943,_0x43f931,_0x3bdba3){return new BPromise(function(_0x7e0f36,_0xcc4682){return client['request'](_0x5b9943,_0x3bdba3)['then'](function(_0x3eb9c1){logger[_0x46bf('0x9')](_0x46bf('0xa'),_0x43f931,_0x46bf('0xb'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x43f931,_0x46bf('0xb'),JSON[_0x46bf('0xc')](_0x3eb9c1));if(_0x3eb9c1[_0x46bf('0xd')]){if(_0x3eb9c1[_0x46bf('0xd')][_0x46bf('0xe')]===0x1f4){logger[_0x46bf('0xd')](_0x46bf('0xa'),_0x43f931,_0x3eb9c1[_0x46bf('0xd')][_0x46bf('0xf')]);return _0xcc4682(_0x3eb9c1[_0x46bf('0xd')][_0x46bf('0xf')]);}logger[_0x46bf('0xd')](_0x46bf('0xa'),_0x43f931,_0x3eb9c1[_0x46bf('0xd')]['message']);return _0x7e0f36(_0x3eb9c1['error'][_0x46bf('0xf')]);}else{logger[_0x46bf('0x9')](_0x46bf('0xa'),_0x43f931,_0x46bf('0xb'));_0x7e0f36(_0x3eb9c1['result'][_0x46bf('0xf')]);}})[_0x46bf('0x10')](function(_0x327574){logger[_0x46bf('0xd')](_0x46bf('0xa'),_0x43f931,_0x327574);_0xcc4682(_0x327574);});});} \ No newline at end of file +var _0x8ae7=['info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','error','message'];(function(_0x22d9f5,_0xbfc89){var _0x478cbf=function(_0x31c3ae){while(--_0x31c3ae){_0x22d9f5['push'](_0x22d9f5['shift']());}};_0x478cbf(++_0xbfc89);}(_0x8ae7,0x17e));var _0x78ae=function(_0x346407,_0x59c3bf){_0x346407=_0x346407-0x0;var _0x4247ed=_0x8ae7[_0x346407];return _0x4247ed;};'use strict';var _=require(_0x78ae('0x0'));var util=require(_0x78ae('0x1'));var moment=require(_0x78ae('0x2'));var BPromise=require(_0x78ae('0x3'));var rs=require(_0x78ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x78ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x78ae('0x6'))(_0x78ae('0x7'));var config=require('../../config/environment');var jayson=require(_0x78ae('0x8'));var client=jayson['client'][_0x78ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f8c4e,_0x3befb2,_0x4dd9dc){return new BPromise(function(_0x3762e8,_0x51cb63){return client[_0x78ae('0xa')](_0x2f8c4e,_0x4dd9dc)[_0x78ae('0xb')](function(_0x2febcd){logger['info'](_0x78ae('0xc'),_0x3befb2,_0x78ae('0xd'));logger[_0x78ae('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x3befb2,_0x78ae('0xd'),JSON['stringify'](_0x2febcd));if(_0x2febcd[_0x78ae('0xf')]){if(_0x2febcd[_0x78ae('0xf')]['code']===0x1f4){logger[_0x78ae('0xf')]('Cdr,\x20%s,\x20%s',_0x3befb2,_0x2febcd[_0x78ae('0xf')][_0x78ae('0x10')]);return _0x51cb63(_0x2febcd[_0x78ae('0xf')][_0x78ae('0x10')]);}logger[_0x78ae('0xf')](_0x78ae('0xc'),_0x3befb2,_0x2febcd[_0x78ae('0xf')][_0x78ae('0x10')]);return _0x3762e8(_0x2febcd['error'][_0x78ae('0x10')]);}else{logger[_0x78ae('0x11')](_0x78ae('0xc'),_0x3befb2,_0x78ae('0xd'));_0x3762e8(_0x2febcd[_0x78ae('0x12')][_0x78ae('0x10')]);}})['catch'](function(_0x5dccdb){logger[_0x78ae('0xf')](_0x78ae('0xc'),_0x3befb2,_0x5dccdb);_0x51cb63(_0x5dccdb);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 012fddc..7e2b2aa 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(_0x32fe22,_0x5287d6){var _0x319ba7=function(_0x4a6704){while(--_0x4a6704){_0x32fe22['push'](_0x32fe22['shift']());}};_0x319ba7(++_0x5287d6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x6151f8,_0x13db0d){var _0x5f1638=function(_0x181084){while(--_0x181084){_0x6151f8['push'](_0x6151f8['shift']());}};_0x5f1638(++_0x13db0d);}(_0xb10b,0x12a));var _0xbb10=function(_0xbaeba7,_0x578dfa){_0xbaeba7=_0xbaeba7-0x0;var _0x4b42e7=_0xb10b[_0xbaeba7];return _0x4b42e7;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 8a37e31..43b180a 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 _0x24ce=['INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0x24ce,0x17b));var _0xe24c=function(_0x4f90d3,_0xeed6cd){_0x4f90d3=_0x4f90d3-0x0;var _0x2385ca=_0x24ce[_0x4f90d3];return _0x2385ca;};'use strict';var Sequelize=require(_0xe24c('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe24c('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe24c('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe24c('0x3')]},'interval':{'type':Sequelize[_0xe24c('0x3')],'defaultValue':_0xe24c('0x4')}}; \ No newline at end of file +var _0xc7f0=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0xc7f0,0xff));var _0x0c7f=function(_0x3fb432,_0xbee222){_0x3fb432=_0x3fb432-0x0;var _0x21fe63=_0xc7f0[_0x3fb432];return _0x21fe63;};'use strict';var Sequelize=require(_0x0c7f('0x0'));module[_0x0c7f('0x1')]={'priority':{'type':Sequelize[_0x0c7f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0c7f('0x3')},'appdata':{'type':Sequelize[_0x0c7f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0c7f('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 8a4730a..c14d4a9 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 _0x65b3=['reject','save','update','then','destroy','error','stack','name','send','model','keys','ChatApplication','query','filters','intersection','attributes','fields','include','merge','options','catch','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x3007d7,_0xbb536f){var _0x32bb31=function(_0x29b6c2){while(--_0x29b6c2){_0x3007d7['push'](_0x3007d7['shift']());}};_0x32bb31(++_0xbb536f);}(_0x65b3,0xc6));var _0x365b=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0x65b3[_0x2ac4af];return _0x3a36df;};'use strict';var emlformat=require(_0x365b('0x0'));var rimraf=require(_0x365b('0x1'));var zipdir=require(_0x365b('0x2'));var jsonpatch=require(_0x365b('0x3'));var rp=require(_0x365b('0x4'));var moment=require(_0x365b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x365b('0x6'));var util=require(_0x365b('0x7'));var path=require(_0x365b('0x8'));var sox=require('sox');var csv=require(_0x365b('0x9'));var ejs=require(_0x365b('0xa'));var fs=require('fs');var fs_extra=require(_0x365b('0xb'));var _=require('lodash');var squel=require(_0x365b('0xc'));var crypto=require(_0x365b('0xd'));var jsforce=require(_0x365b('0xe'));var deskjs=require(_0x365b('0xf'));var toCsv=require(_0x365b('0x9'));var querystring=require('querystring');var Papa=require(_0x365b('0x10'));var Redis=require(_0x365b('0x11'));var authService=require(_0x365b('0x12'));var qs=require(_0x365b('0x13'));var as=require(_0x365b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x365b('0x15'))(_0x365b('0x16'));var utils=require(_0x365b('0x17'));var config=require(_0x365b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d47f,_0x14ed59){_0x14ed59=_0x14ed59||0xcc;return function(_0x3b4127){if(_0x3b4127){return _0x10d47f['sendStatus'](_0x14ed59);}return _0x10d47f[_0x365b('0x19')](_0x14ed59)['end']();};}function respondWithResult(_0x3fa3e6,_0x40fa13){_0x40fa13=_0x40fa13||0xc8;return function(_0x8538f6){if(_0x8538f6){return _0x3fa3e6[_0x365b('0x19')](_0x40fa13)[_0x365b('0x1a')](_0x8538f6);}};}function respondWithFilteredResult(_0x3af95f,_0x2813df){return function(_0x248c4e){if(_0x248c4e){var _0x1e93d9=typeof _0x2813df[_0x365b('0x1b')]===_0x365b('0x1c')&&typeof _0x2813df[_0x365b('0x1d')]===_0x365b('0x1c');var _0x12e560=_0x248c4e[_0x365b('0x1e')];var _0x1cf7a3=_0x1e93d9?0x0:_0x2813df[_0x365b('0x1b')];var _0x2ac7ba=_0x1e93d9?_0x248c4e[_0x365b('0x1e')]:_0x2813df['offset']+_0x2813df[_0x365b('0x1d')];var _0x5b9eea;if(_0x2ac7ba>=_0x12e560){_0x2ac7ba=_0x12e560;_0x5b9eea=0xc8;}else{_0x5b9eea=0xce;}_0x3af95f[_0x365b('0x19')](_0x5b9eea);return _0x3af95f[_0x365b('0x1f')](_0x365b('0x20'),_0x1cf7a3+'-'+_0x2ac7ba+'/'+_0x12e560)[_0x365b('0x1a')](_0x248c4e);}return null;};}function patchUpdates(_0x16dc0e){return function(_0x27db06){try{jsonpatch[_0x365b('0x21')](_0x27db06,_0x16dc0e,!![]);}catch(_0xe49b2b){return BPromise[_0x365b('0x22')](_0xe49b2b);}return _0x27db06[_0x365b('0x23')]();};}function saveUpdates(_0x252ff0,_0x53f762){return function(_0x2b8122){if(_0x2b8122){return _0x2b8122[_0x365b('0x24')](_0x252ff0)[_0x365b('0x25')](function(_0x105d3a){return _0x105d3a;});}return null;};}function removeEntity(_0x537085,_0x3b1e18){return function(_0x39c6ac){if(_0x39c6ac){return _0x39c6ac[_0x365b('0x26')]()[_0x365b('0x25')](function(){_0x537085[_0x365b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31cea5,_0x3d91d6){return function(_0x8e47d2){if(!_0x8e47d2){_0x31cea5['sendStatus'](0x194);}return _0x8e47d2;};}function handleError(_0x383e4c,_0x3b083b){_0x3b083b=_0x3b083b||0x1f4;return function(_0x24e599){logger[_0x365b('0x27')](_0x24e599[_0x365b('0x28')]);if(_0x24e599[_0x365b('0x29')]){delete _0x24e599[_0x365b('0x29')];}_0x383e4c[_0x365b('0x19')](_0x3b083b)[_0x365b('0x2a')](_0x24e599);};}exports['show']=function(_0x2f79bc,_0x54e27a){var _0x21ae68={'raw':!![],'where':{'id':_0x2f79bc['params']['id']}},_0x3df8fc={};_0x3df8fc[_0x365b('0x2b')]=_[_0x365b('0x2c')](db[_0x365b('0x2d')]['rawAttributes']);_0x3df8fc['query']=_[_0x365b('0x2c')](_0x2f79bc[_0x365b('0x2e')]);_0x3df8fc[_0x365b('0x2f')]=_[_0x365b('0x30')](_0x3df8fc['model'],_0x3df8fc[_0x365b('0x2e')]);_0x21ae68[_0x365b('0x31')]=_[_0x365b('0x30')](_0x3df8fc['model'],qs['fields'](_0x2f79bc[_0x365b('0x2e')][_0x365b('0x32')]));_0x21ae68['attributes']=_0x21ae68[_0x365b('0x31')]['length']?_0x21ae68['attributes']:_0x3df8fc[_0x365b('0x2b')];if(_0x2f79bc['query']['includeAll']){_0x21ae68[_0x365b('0x33')]=[{'all':!![]}];}_0x21ae68=_[_0x365b('0x34')]({},_0x21ae68,_0x2f79bc[_0x365b('0x35')]);return db[_0x365b('0x2d')]['find'](_0x21ae68)[_0x365b('0x25')](handleEntityNotFound(_0x54e27a,null))[_0x365b('0x25')](respondWithResult(_0x54e27a,null))[_0x365b('0x36')](handleError(_0x54e27a,null));};exports['update']=function(_0x515c40,_0x2e82e0){if(_0x515c40[_0x365b('0x37')]['id']){delete _0x515c40['body']['id'];}return db['ChatApplication'][_0x365b('0x38')]({'where':{'id':_0x515c40['params']['id']}})['then'](handleEntityNotFound(_0x2e82e0,null))[_0x365b('0x25')](saveUpdates(_0x515c40[_0x365b('0x37')],null))[_0x365b('0x25')](respondWithResult(_0x2e82e0,null))[_0x365b('0x36')](handleError(_0x2e82e0,null));};exports[_0x365b('0x26')]=function(_0x2ff7ef,_0x1ff2d7){return db[_0x365b('0x2d')][_0x365b('0x38')]({'where':{'id':_0x2ff7ef[_0x365b('0x39')]['id']}})['then'](handleEntityNotFound(_0x1ff2d7,null))[_0x365b('0x25')](removeEntity(_0x1ff2d7,null))[_0x365b('0x36')](handleError(_0x1ff2d7,null));}; \ No newline at end of file +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(_0x158fb0,_0x20ccab){var _0xee0c44=function(_0x247c5f){while(--_0x247c5f){_0x158fb0['push'](_0x158fb0['shift']());}};_0xee0c44(++_0x20ccab);}(_0x58d6,0x1d3));var _0x658d=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x58d6[_0x256e32];return _0x464070;};'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 diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index c910b36..bd4ca54 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 _0xab9e=['lodash','util','moment','request-promise','../../config/environment','./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0xab9e,0x6e));var _0xeab9=function(_0x531692,_0x6d376e){_0x531692=_0x531692-0x0;var _0x1ecc9c=_0xab9e[_0x531692];return _0x1ecc9c;};'use strict';var _=require(_0xeab9('0x0'));var util=require(_0xeab9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeab9('0x2'));var BPromise=require('bluebird');var rp=require(_0xeab9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeab9('0x4'));var attributes=require(_0xeab9('0x5'));module[_0xeab9('0x6')]=function(_0x4857b0,_0x54944a){return _0x4857b0['define'](_0xeab9('0x7'),attributes,{'tableName':_0xeab9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeab9('0x9'),'collate':_0xeab9('0xa')});}; \ No newline at end of file +var _0x81f5=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3da35a,_0x40c71b){var _0x13079=function(_0x59bf4a){while(--_0x59bf4a){_0x3da35a['push'](_0x3da35a['shift']());}};_0x13079(++_0x40c71b);}(_0x81f5,0x77));var _0x581f=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x81f5[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0x581f('0x0'));var util=require(_0x581f('0x1'));var logger=require(_0x581f('0x2'))(_0x581f('0x3'));var moment=require(_0x581f('0x4'));var BPromise=require(_0x581f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x581f('0x6'));var rimraf=require(_0x581f('0x7'));var config=require(_0x581f('0x8'));var attributes=require(_0x581f('0x9'));module[_0x581f('0xa')]=function(_0x46405c,_0x2b2c34){return _0x46405c[_0x581f('0xb')](_0x581f('0xc'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x581f('0xd'),'collate':_0x581f('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 6bd40e4..aca2d69 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 _0x8a28=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4de877,_0x340170){var _0xb2cfeb=function(_0x488634){while(--_0x488634){_0x4de877['push'](_0x4de877['shift']());}};_0xb2cfeb(++_0x340170);}(_0x8a28,0x1a5));var _0x88a2=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x8a28[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x88a2('0x2'));var fs=require('fs');var Redis=require(_0x88a2('0x3'));var db=require(_0x88a2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x88a2('0x5'))('rpc');var config=require(_0x88a2('0x6'));var jayson=require(_0x88a2('0x7'));var client=jayson[_0x88a2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x120fc5,_0x2b3e0d,_0x126e27){return new BPromise(function(_0x281feb,_0x3cca10){return client[_0x88a2('0x9')](_0x120fc5,_0x126e27)[_0x88a2('0xa')](function(_0x556033){logger[_0x88a2('0xb')](_0x88a2('0xc'),_0x2b3e0d,_0x88a2('0xd'));logger['debug'](_0x88a2('0xe'),_0x2b3e0d,_0x88a2('0xd'),JSON[_0x88a2('0xf')](_0x556033));if(_0x556033[_0x88a2('0x10')]){if(_0x556033[_0x88a2('0x10')][_0x88a2('0x11')]===0x1f4){logger[_0x88a2('0x10')]('ChatApplication,\x20%s,\x20%s',_0x2b3e0d,_0x556033['error'][_0x88a2('0x12')]);return _0x3cca10(_0x556033[_0x88a2('0x10')][_0x88a2('0x12')]);}logger[_0x88a2('0x10')](_0x88a2('0xc'),_0x2b3e0d,_0x556033['error'][_0x88a2('0x12')]);return _0x281feb(_0x556033[_0x88a2('0x10')][_0x88a2('0x12')]);}else{logger['info'](_0x88a2('0xc'),_0x2b3e0d,'request\x20sent');_0x281feb(_0x556033[_0x88a2('0x13')][_0x88a2('0x12')]);}})[_0x88a2('0x14')](function(_0xee0da9){logger[_0x88a2('0x10')](_0x88a2('0xc'),_0x2b3e0d,_0xee0da9);_0x3cca10(_0xee0da9);});});} \ No newline at end of file +var _0x5492=['then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5492,0xfd));var _0x2549=function(_0x5165a2,_0x2fc38d){_0x5165a2=_0x5165a2-0x0;var _0x5edefb=_0x5492[_0x5165a2];return _0x5edefb;};'use strict';var _=require(_0x2549('0x0'));var util=require(_0x2549('0x1'));var moment=require(_0x2549('0x2'));var BPromise=require(_0x2549('0x3'));var rs=require(_0x2549('0x4'));var fs=require('fs');var Redis=require(_0x2549('0x5'));var db=require(_0x2549('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2549('0x7'))('rpc');var config=require(_0x2549('0x8'));var jayson=require(_0x2549('0x9'));var client=jayson[_0x2549('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b74cb,_0xf5b570,_0xb17fa0){return new BPromise(function(_0xb17e65,_0x432fcd){return client['request'](_0x3b74cb,_0xb17fa0)[_0x2549('0xb')](function(_0xcce34b){logger['info'](_0x2549('0xc'),_0xf5b570,_0x2549('0xd'));logger[_0x2549('0xe')](_0x2549('0xf'),_0xf5b570,_0x2549('0xd'),JSON[_0x2549('0x10')](_0xcce34b));if(_0xcce34b[_0x2549('0x11')]){if(_0xcce34b[_0x2549('0x11')]['code']===0x1f4){logger[_0x2549('0x11')](_0x2549('0xc'),_0xf5b570,_0xcce34b[_0x2549('0x11')]['message']);return _0x432fcd(_0xcce34b[_0x2549('0x11')][_0x2549('0x12')]);}logger[_0x2549('0x11')](_0x2549('0xc'),_0xf5b570,_0xcce34b[_0x2549('0x11')][_0x2549('0x12')]);return _0xb17e65(_0xcce34b['error']['message']);}else{logger[_0x2549('0x13')]('ChatApplication,\x20%s,\x20%s',_0xf5b570,'request\x20sent');_0xb17e65(_0xcce34b[_0x2549('0x14')][_0x2549('0x12')]);}})[_0x2549('0x15')](function(_0x5ed24e){logger[_0x2549('0x11')]('ChatApplication,\x20%s,\x20%s',_0xf5b570,_0x5ed24e);_0x432fcd(_0x5ed24e);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 57d5ef7..8a22e81 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 _0x2b21=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','put','/:id','update'];(function(_0x2967c1,_0x202a72){var _0x103397=function(_0x14b5cc){while(--_0x14b5cc){_0x2967c1['push'](_0x2967c1['shift']());}};_0x103397(++_0x202a72);}(_0x2b21,0x162));var _0x12b2=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x2b21[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x12b2('0x0'));var util=require('util');var path=require(_0x12b2('0x1'));var timeout=require(_0x12b2('0x2'));var express=require('express');var router=express[_0x12b2('0x3')]();var fs_extra=require(_0x12b2('0x4'));var auth=require(_0x12b2('0x5'));var interaction=require(_0x12b2('0x6'));var config=require(_0x12b2('0x7'));var controller=require(_0x12b2('0x8'));router['get']('/:id',auth[_0x12b2('0x9')](),controller[_0x12b2('0xa')]);router[_0x12b2('0xb')](_0x12b2('0xc'),auth['isAuthenticated'](),controller[_0x12b2('0xd')]);router['delete']('/:id',auth[_0x12b2('0x9')](),controller[_0x12b2('0xe')]);module[_0x12b2('0xf')]=router; \ No newline at end of file +var _0x3f60=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update','delete','exports','path','connect-timeout','express'];(function(_0x4a2123,_0x502144){var _0x4f8edc=function(_0x151463){while(--_0x151463){_0x4a2123['push'](_0x4a2123['shift']());}};_0x4f8edc(++_0x502144);}(_0x3f60,0x1cd));var _0x03f6=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x3f60[_0x557fd2];return _0x1b54a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x03f6('0x0'));var timeout=require(_0x03f6('0x1'));var express=require(_0x03f6('0x2'));var router=express[_0x03f6('0x3')]();var fs_extra=require(_0x03f6('0x4'));var auth=require(_0x03f6('0x5'));var interaction=require(_0x03f6('0x6'));var config=require(_0x03f6('0x7'));var controller=require(_0x03f6('0x8'));router[_0x03f6('0x9')](_0x03f6('0xa'),auth[_0x03f6('0xb')](),controller[_0x03f6('0xc')]);router['put'](_0x03f6('0xa'),auth[_0x03f6('0xb')](),controller[_0x03f6('0xd')]);router[_0x03f6('0xe')](_0x03f6('0xa'),auth[_0x03f6('0xb')](),controller['destroy']);module[_0x03f6('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index e1bc1d2..d0e9c57 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 _0x55f9=['sequelize','exports','STRING','BOOLEAN'];(function(_0xb03c3,_0x46c612){var _0x21501f=function(_0x40fbe4){while(--_0x40fbe4){_0xb03c3['push'](_0xb03c3['shift']());}};_0x21501f(++_0x46c612);}(_0x55f9,0x1b8));var _0x955f=function(_0x4726da,_0x37bf94){_0x4726da=_0x4726da-0x0;var _0x68c3a1=_0x55f9[_0x4726da];return _0x68c3a1;};'use strict';var Sequelize=require(_0x955f('0x0'));module[_0x955f('0x1')]={'name':{'type':Sequelize[_0x955f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x955f('0x2')]},'write':{'type':Sequelize[_0x955f('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xe861=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe861,0xb3));var _0x1e86=function(_0x504f74,_0x12fc50){_0x504f74=_0x504f74-0x0;var _0x1bb081=_0xe861[_0x504f74];return _0x1bb081;};'use strict';var Sequelize=require(_0x1e86('0x0'));module[_0x1e86('0x1')]={'name':{'type':Sequelize[_0x1e86('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1e86('0x2')]},'write':{'type':Sequelize[_0x1e86('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 4742990..9bdcbd0 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 _0x42d9=['order','pick','removeMembers','addMessage','ChatInternalMessage','create','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','error','stack','name','send','index','map','ChatGroup','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','then','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','body','describe','getUnread','addMembers','ids','omit','getMembers','findOne','User','filters'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x42d9,0x137));var _0x942d=function(_0x1af322,_0x16d095){_0x1af322=_0x1af322-0x0;var _0x28ac48=_0x42d9[_0x1af322];return _0x28ac48;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x942d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x942d('0x1'));var rp=require(_0x942d('0x2'));var moment=require('moment');var BPromise=require(_0x942d('0x3'));var Mustache=require(_0x942d('0x4'));var util=require(_0x942d('0x5'));var path=require(_0x942d('0x6'));var sox=require(_0x942d('0x7'));var csv=require(_0x942d('0x8'));var ejs=require(_0x942d('0x9'));var fs=require('fs');var fs_extra=require(_0x942d('0xa'));var _=require('lodash');var squel=require(_0x942d('0xb'));var crypto=require(_0x942d('0xc'));var jsforce=require(_0x942d('0xd'));var deskjs=require(_0x942d('0xe'));var toCsv=require(_0x942d('0x8'));var querystring=require(_0x942d('0xf'));var Papa=require('papaparse');var Redis=require(_0x942d('0x10'));var authService=require(_0x942d('0x11'));var qs=require(_0x942d('0x12'));var as=require(_0x942d('0x13'));var hardwareService=require(_0x942d('0x14'));var logger=require(_0x942d('0x15'))(_0x942d('0x16'));var utils=require(_0x942d('0x17'));var config=require(_0x942d('0x18'));var licenseUtil=require(_0x942d('0x19'));var db=require(_0x942d('0x1a'))['db'];config[_0x942d('0x1b')]=_[_0x942d('0x1c')](config[_0x942d('0x1b')],{'host':_0x942d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x942d('0x1e'))[_0x942d('0x1f')](socket);function respondWithStatusCode(_0x2caf00,_0x1a4f00){_0x1a4f00=_0x1a4f00||0xcc;return function(_0x18e98a){if(_0x18e98a){return _0x2caf00[_0x942d('0x20')](_0x1a4f00);}return _0x2caf00[_0x942d('0x21')](_0x1a4f00)[_0x942d('0x22')]();};}function respondWithResult(_0x101a0f,_0x22d792){_0x22d792=_0x22d792||0xc8;return function(_0x2baf04){if(_0x2baf04){return _0x101a0f[_0x942d('0x21')](_0x22d792)[_0x942d('0x23')](_0x2baf04);}};}function respondWithFilteredResult(_0x1ce30c,_0x439f1f){return function(_0x11f647){if(_0x11f647){var _0x1cf35c=typeof _0x439f1f[_0x942d('0x24')]===_0x942d('0x25')&&typeof _0x439f1f['limit']===_0x942d('0x25');var _0xab3cdc=_0x11f647[_0x942d('0x26')];var _0x26e98e=_0x1cf35c?0x0:_0x439f1f[_0x942d('0x24')];var _0x376cd1=_0x1cf35c?_0x11f647[_0x942d('0x26')]:_0x439f1f[_0x942d('0x24')]+_0x439f1f[_0x942d('0x27')];var _0x3c77be;if(_0x376cd1>=_0xab3cdc){_0x376cd1=_0xab3cdc;_0x3c77be=0xc8;}else{_0x3c77be=0xce;}_0x1ce30c['status'](_0x3c77be);return _0x1ce30c[_0x942d('0x28')]('Content-Range',_0x26e98e+'-'+_0x376cd1+'/'+_0xab3cdc)[_0x942d('0x23')](_0x11f647);}return null;};}function patchUpdates(_0x3f3ae4){return function(_0xc3200d){try{jsonpatch[_0x942d('0x29')](_0xc3200d,_0x3f3ae4,!![]);}catch(_0xe87bc2){return BPromise[_0x942d('0x2a')](_0xe87bc2);}return _0xc3200d[_0x942d('0x2b')]();};}function saveUpdates(_0x12255a,_0x17f5c0){return function(_0x44917d){if(_0x44917d){return _0x44917d[_0x942d('0x2c')](_0x12255a)['then'](function(_0x5b5ed5){return _0x5b5ed5;});}return null;};}function removeEntity(_0x497778,_0x58f630){return function(_0x3d07d2){if(_0x3d07d2){return _0x3d07d2['destroy']()['then'](function(){_0x497778['status'](0xcc)[_0x942d('0x22')]();});}};}function handleEntityNotFound(_0x4bea6d,_0x270481){return function(_0x3f4293){if(!_0x3f4293){_0x4bea6d[_0x942d('0x20')](0x194);}return _0x3f4293;};}function handleError(_0x1eefdd,_0x4a6d7e){_0x4a6d7e=_0x4a6d7e||0x1f4;return function(_0xc6fa5f){logger[_0x942d('0x2d')](_0xc6fa5f[_0x942d('0x2e')]);if(_0xc6fa5f[_0x942d('0x2f')]){delete _0xc6fa5f[_0x942d('0x2f')];}_0x1eefdd[_0x942d('0x21')](_0x4a6d7e)[_0x942d('0x30')](_0xc6fa5f);};}exports[_0x942d('0x31')]=function(_0x494ff3,_0x5958ba){var _0x2e24a9={},_0x5dd3ec={},_0x34dafd={'count':0x0,'rows':[]};var _0x38faf6=_[_0x942d('0x32')](db[_0x942d('0x33')]['rawAttributes'],function(_0x2f0a9c){return{'name':_0x2f0a9c[_0x942d('0x34')],'type':_0x2f0a9c['type'][_0x942d('0x35')]};});_0x5dd3ec[_0x942d('0x36')]=_[_0x942d('0x32')](_0x38faf6,_0x942d('0x2f'));_0x5dd3ec[_0x942d('0x37')]=_[_0x942d('0x38')](_0x494ff3[_0x942d('0x37')]);_0x5dd3ec['filters']=_[_0x942d('0x39')](_0x5dd3ec[_0x942d('0x36')],_0x5dd3ec[_0x942d('0x37')]);_0x2e24a9[_0x942d('0x3a')]=_[_0x942d('0x39')](_0x5dd3ec['model'],qs[_0x942d('0x3b')](_0x494ff3['query'][_0x942d('0x3b')]));_0x2e24a9['attributes']=_0x2e24a9['attributes']['length']?_0x2e24a9[_0x942d('0x3a')]:_0x5dd3ec[_0x942d('0x36')];if(!_0x494ff3[_0x942d('0x37')][_0x942d('0x3c')](_0x942d('0x3d'))){_0x2e24a9[_0x942d('0x27')]=qs['limit'](_0x494ff3['query']['limit']);_0x2e24a9['offset']=qs[_0x942d('0x24')](_0x494ff3[_0x942d('0x37')][_0x942d('0x24')]);}_0x2e24a9['order']=qs[_0x942d('0x3e')](_0x494ff3['query'][_0x942d('0x3e')]);_0x2e24a9[_0x942d('0x3f')]=qs['filters'](_['pick'](_0x494ff3['query'],_0x5dd3ec['filters']),_0x38faf6);if(_0x494ff3[_0x942d('0x37')]['filter']){_0x2e24a9[_0x942d('0x3f')]=_[_0x942d('0x40')](_0x2e24a9[_0x942d('0x3f')],{'$or':_['map'](_0x38faf6,function(_0x3f3c49){if(_0x3f3c49[_0x942d('0x41')]!==_0x942d('0x42')){var _0x1a5470={};_0x1a5470[_0x3f3c49[_0x942d('0x2f')]]={'$like':'%'+_0x494ff3[_0x942d('0x37')][_0x942d('0x43')]+'%'};return _0x1a5470;}})});}_0x2e24a9=_[_0x942d('0x40')]({},_0x2e24a9,_0x494ff3[_0x942d('0x44')]);var _0x54cd4f={'where':_0x2e24a9[_0x942d('0x3f')]};return db[_0x942d('0x33')]['count'](_0x54cd4f)[_0x942d('0x45')](function(_0x9c705a){_0x34dafd[_0x942d('0x26')]=_0x9c705a;if(_0x494ff3['query'][_0x942d('0x46')]){_0x2e24a9[_0x942d('0x47')]=[{'all':!![]}];}return db[_0x942d('0x33')][_0x942d('0x48')](_0x2e24a9);})['then'](function(_0x41793a){_0x34dafd[_0x942d('0x49')]=_0x41793a;return _0x34dafd;})[_0x942d('0x45')](respondWithFilteredResult(_0x5958ba,_0x2e24a9))[_0x942d('0x4a')](handleError(_0x5958ba,null));};exports['show']=function(_0x462ef1,_0x577ed1){var _0x4bb98a={'raw':!![],'where':{'id':_0x462ef1[_0x942d('0x4b')]['id']}},_0x259f21={};_0x259f21[_0x942d('0x36')]=_[_0x942d('0x38')](db['ChatGroup'][_0x942d('0x4c')]);_0x259f21[_0x942d('0x37')]=_[_0x942d('0x38')](_0x462ef1['query']);_0x259f21['filters']=_[_0x942d('0x39')](_0x259f21[_0x942d('0x36')],_0x259f21[_0x942d('0x37')]);_0x4bb98a[_0x942d('0x3a')]=_[_0x942d('0x39')](_0x259f21['model'],qs[_0x942d('0x3b')](_0x462ef1[_0x942d('0x37')][_0x942d('0x3b')]));_0x4bb98a[_0x942d('0x3a')]=_0x4bb98a[_0x942d('0x3a')][_0x942d('0x4d')]?_0x4bb98a[_0x942d('0x3a')]:_0x259f21[_0x942d('0x36')];if(_0x462ef1[_0x942d('0x37')]['includeAll']){_0x4bb98a[_0x942d('0x47')]=[{'all':!![]}];}_0x4bb98a=_[_0x942d('0x40')]({},_0x4bb98a,_0x462ef1[_0x942d('0x44')]);return db[_0x942d('0x33')][_0x942d('0x4e')](_0x4bb98a)[_0x942d('0x45')](handleEntityNotFound(_0x577ed1,null))[_0x942d('0x45')](respondWithResult(_0x577ed1,null))[_0x942d('0x4a')](handleError(_0x577ed1,null));};exports['create']=function(_0x1b24a9,_0x5df67a){return db[_0x942d('0x33')]['create'](_0x1b24a9[_0x942d('0x4f')],{})['then'](respondWithResult(_0x5df67a,0xc9))[_0x942d('0x4a')](handleError(_0x5df67a,null));};exports[_0x942d('0x2c')]=function(_0x1a16f5,_0xe8d9eb){if(_0x1a16f5[_0x942d('0x4f')]['id']){delete _0x1a16f5['body']['id'];}return db[_0x942d('0x33')][_0x942d('0x4e')]({'where':{'id':_0x1a16f5[_0x942d('0x4b')]['id']}})[_0x942d('0x45')](handleEntityNotFound(_0xe8d9eb,null))[_0x942d('0x45')](saveUpdates(_0x1a16f5[_0x942d('0x4f')],null))[_0x942d('0x45')](respondWithResult(_0xe8d9eb,null))[_0x942d('0x4a')](handleError(_0xe8d9eb,null));};exports['destroy']=function(_0x1775b3,_0x26b8f2){return db[_0x942d('0x33')][_0x942d('0x4e')]({'where':{'id':_0x1775b3[_0x942d('0x4b')]['id']}})[_0x942d('0x45')](handleEntityNotFound(_0x26b8f2,null))[_0x942d('0x45')](removeEntity(_0x26b8f2,null))[_0x942d('0x4a')](handleError(_0x26b8f2,null));};exports[_0x942d('0x50')]=function(_0x25c7c3,_0x1870f2){return db[_0x942d('0x33')][_0x942d('0x50')]()['then'](respondWithResult(_0x1870f2,null))[_0x942d('0x4a')](handleError(_0x1870f2,null));};exports[_0x942d('0x51')]=function(_0x15ba61,_0x427b54,_0x3d4d87){return db['ChatInternalMessage'][_0x942d('0x26')]({'where':{'ChatGroupId':_0x15ba61[_0x942d('0x4b')]['id'],'ToId':_0x15ba61['user']['id'],'read':![]}})[_0x942d('0x45')](function(_0x2623bb){return{'id':_['toInteger'](_0x15ba61[_0x942d('0x4b')]['id']),'count':_0x2623bb};})['then'](respondWithResult(_0x427b54,null))['catch'](handleError(_0x427b54,null));};exports[_0x942d('0x52')]=function(_0x1ea3e5,_0x126de1,_0x51850b){return db[_0x942d('0x33')]['find']({'where':{'id':_0x1ea3e5['params']['id']}})['then'](handleEntityNotFound(_0x126de1,null))[_0x942d('0x45')](function(_0x57e8c1){if(_0x57e8c1){return _0x57e8c1[_0x942d('0x52')](_0x1ea3e5[_0x942d('0x4f')][_0x942d('0x53')],_[_0x942d('0x54')](_0x1ea3e5['body'],['ids','id'])||{});}})[_0x942d('0x45')](respondWithResult(_0x126de1,null))[_0x942d('0x4a')](handleError(_0x126de1,null));};exports[_0x942d('0x55')]=function(_0x4fbe93,_0x35143e,_0x4bbed1){var _0x37cfa8={};var _0x573fce={};var _0x3f2290;var _0x3d57a9;return db[_0x942d('0x33')][_0x942d('0x56')]({'where':{'id':_0x4fbe93[_0x942d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x35143e,null))[_0x942d('0x45')](function(_0x2fc5c3){if(_0x2fc5c3){_0x3f2290=_0x2fc5c3;_0x573fce[_0x942d('0x36')]=_[_0x942d('0x38')](db[_0x942d('0x57')][_0x942d('0x4c')]);_0x573fce[_0x942d('0x37')]=_[_0x942d('0x38')](_0x4fbe93[_0x942d('0x37')]);_0x573fce[_0x942d('0x58')]=_[_0x942d('0x39')](_0x573fce[_0x942d('0x36')],_0x573fce[_0x942d('0x37')]);_0x37cfa8['attributes']=_[_0x942d('0x39')](_0x573fce['model'],qs[_0x942d('0x3b')](_0x4fbe93['query'][_0x942d('0x3b')]));_0x37cfa8['attributes']=_0x37cfa8[_0x942d('0x3a')][_0x942d('0x4d')]?_0x37cfa8[_0x942d('0x3a')]:_0x573fce[_0x942d('0x36')];_0x37cfa8[_0x942d('0x59')]=qs['sort'](_0x4fbe93['query'][_0x942d('0x3e')]);_0x37cfa8['where']=qs[_0x942d('0x58')](_[_0x942d('0x5a')](_0x4fbe93[_0x942d('0x37')],_0x573fce[_0x942d('0x58')]));if(_0x4fbe93[_0x942d('0x37')][_0x942d('0x43')]){_0x37cfa8[_0x942d('0x3f')]=_[_0x942d('0x40')](_0x37cfa8[_0x942d('0x3f')],{'$or':_[_0x942d('0x32')](_0x37cfa8[_0x942d('0x3a')],function(_0x4bf017){var _0x676739={};_0x676739[_0x4bf017]={'$like':'%'+_0x4fbe93[_0x942d('0x37')][_0x942d('0x43')]+'%'};return _0x676739;})});}_0x37cfa8=_[_0x942d('0x40')]({},_0x37cfa8,_0x4fbe93['options']);return _0x3f2290[_0x942d('0x55')](_0x37cfa8);}})['then'](function(_0x2648df){if(_0x2648df){_0x3d57a9=_0x2648df[_0x942d('0x4d')];if(!_0x4fbe93[_0x942d('0x37')][_0x942d('0x3c')]('nolimit')){_0x37cfa8[_0x942d('0x27')]=qs[_0x942d('0x27')](_0x4fbe93[_0x942d('0x37')][_0x942d('0x27')]);_0x37cfa8['offset']=qs[_0x942d('0x24')](_0x4fbe93['query'][_0x942d('0x24')]);}return _0x3f2290[_0x942d('0x55')](_0x37cfa8);}})['then'](function(_0x27ed58){if(_0x27ed58){return _0x27ed58?{'count':_0x3d57a9,'rows':_0x27ed58}:null;}})['then'](respondWithResult(_0x35143e,null))['catch'](handleError(_0x35143e,null));};exports[_0x942d('0x5b')]=function(_0x244a68,_0xdd7a7e,_0x588e78){return db[_0x942d('0x33')][_0x942d('0x4e')]({'where':{'id':_0x244a68['params']['id']}})['then'](handleEntityNotFound(_0xdd7a7e,null))[_0x942d('0x45')](function(_0x19add7){if(_0x19add7){return _0x19add7[_0x942d('0x5b')](_0x244a68[_0x942d('0x37')][_0x942d('0x53')]);}})['then'](respondWithStatusCode(_0xdd7a7e,null))[_0x942d('0x4a')](handleError(_0xdd7a7e,null));};exports[_0x942d('0x5c')]=function(_0x4e504c,_0x2ab81b,_0x18b6a4){if(_0x4e504c['body']['id']){delete _0x4e504c['body']['id'];}return db[_0x942d('0x33')]['find']({'where':{'id':_0x4e504c[_0x942d('0x4b')]['id']}})[_0x942d('0x45')](handleEntityNotFound(_0x2ab81b,null))[_0x942d('0x45')](function(_0xdf3cd1){if(_0xdf3cd1){_0x4e504c[_0x942d('0x4f')]['ChatGroupId']=_0xdf3cd1['id'];return db[_0x942d('0x5d')][_0x942d('0x5e')](_0x4e504c[_0x942d('0x4f')]);}})['then'](respondWithResult(_0x2ab81b,null))['catch'](handleError(_0x2ab81b,null));};exports[_0x942d('0x5f')]=function(_0x23a346,_0x345cb8,_0x3fb220){var _0x1c9653={};var _0x221188={};var _0x32652f;var _0x11396b;return db[_0x942d('0x33')][_0x942d('0x56')]({'where':{'id':_0x23a346[_0x942d('0x4b')]['id']}})[_0x942d('0x45')](handleEntityNotFound(_0x345cb8,null))[_0x942d('0x45')](function(_0x415505){if(_0x415505){_0x32652f=_0x415505;_0x221188['model']=_[_0x942d('0x38')](db['ChatInternalMessage']['rawAttributes']);_0x221188[_0x942d('0x37')]=_[_0x942d('0x38')](_0x23a346[_0x942d('0x37')]);_0x221188[_0x942d('0x58')]=_[_0x942d('0x39')](_0x221188[_0x942d('0x36')],_0x221188[_0x942d('0x37')]);_0x1c9653[_0x942d('0x3a')]=_[_0x942d('0x39')](_0x221188[_0x942d('0x36')],qs[_0x942d('0x3b')](_0x23a346['query']['fields']));_0x1c9653['attributes']=_0x1c9653[_0x942d('0x3a')][_0x942d('0x4d')]?_0x1c9653[_0x942d('0x3a')]:_0x221188[_0x942d('0x36')];_0x1c9653[_0x942d('0x59')]=qs[_0x942d('0x3e')](_0x23a346[_0x942d('0x37')][_0x942d('0x3e')]);_0x1c9653[_0x942d('0x3f')]=qs[_0x942d('0x58')](_[_0x942d('0x5a')](_0x23a346[_0x942d('0x37')],_0x221188[_0x942d('0x58')]));if(_0x23a346['query'][_0x942d('0x43')]){_0x1c9653['where']=_[_0x942d('0x40')](_0x1c9653[_0x942d('0x3f')],{'$or':_[_0x942d('0x32')](_0x1c9653[_0x942d('0x3a')],function(_0x3a5252){var _0x3e95be={};_0x3e95be[_0x3a5252]={'$like':'%'+_0x23a346[_0x942d('0x37')][_0x942d('0x43')]+'%'};return _0x3e95be;})});}if(_0x23a346['query'][_0x942d('0x60')]){var _0x39f0c7=_0x23a346[_0x942d('0x37')][_0x942d('0x60')][_0x942d('0x61')](',');var _0x42b5b0={};_0x42b5b0[_0x39f0c7[0x0]]={'$gte':moment(_0x39f0c7[0x1])[_0x942d('0x62')](_0x942d('0x63'))};_0x1c9653[_0x942d('0x3f')]=_[_0x942d('0x40')](_0x1c9653['where'],_0x42b5b0);}_0x1c9653=_[_0x942d('0x40')]({},_0x1c9653,_0x23a346[_0x942d('0x44')]);return _0x32652f[_0x942d('0x5f')](_0x1c9653);}})[_0x942d('0x45')](function(_0xadb35e){if(_0xadb35e){_0x11396b=_0xadb35e['length'];if(!_0x23a346[_0x942d('0x37')][_0x942d('0x3c')]('nolimit')){_0x1c9653[_0x942d('0x27')]=qs['limit'](_0x23a346[_0x942d('0x37')]['limit']);_0x1c9653['offset']=qs[_0x942d('0x24')](_0x23a346[_0x942d('0x37')][_0x942d('0x24')]);}return _0x32652f[_0x942d('0x5f')](_0x1c9653);}})['then'](function(_0x360e95){if(_0x360e95){return _0x360e95?{'count':_0x11396b,'rows':_0x360e95}:null;}})['then'](respondWithResult(_0x345cb8,null))[_0x942d('0x4a')](handleError(_0x345cb8,null));}; \ No newline at end of file +var _0xe751=['querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','count','include','findAll','rows','catch','show','includeAll','create','body','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','pick','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','options','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv'];(function(_0x1cd8fd,_0x376b9f){var _0x1085c0=function(_0x48e27b){while(--_0x48e27b){_0x1cd8fd['push'](_0x1cd8fd['shift']());}};_0x1085c0(++_0x376b9f);}(_0xe751,0x175));var _0x1e75=function(_0x56aad6,_0x1e4b12){_0x56aad6=_0x56aad6-0x0;var _0x3df6dc=_0xe751[_0x56aad6];return _0x3df6dc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1e75('0x0'));var zipdir=require(_0x1e75('0x1'));var jsonpatch=require(_0x1e75('0x2'));var rp=require(_0x1e75('0x3'));var moment=require('moment');var BPromise=require(_0x1e75('0x4'));var Mustache=require('mustache');var util=require(_0x1e75('0x5'));var path=require(_0x1e75('0x6'));var sox=require(_0x1e75('0x7'));var csv=require('to-csv');var ejs=require(_0x1e75('0x8'));var fs=require('fs');var fs_extra=require(_0x1e75('0x9'));var _=require(_0x1e75('0xa'));var squel=require(_0x1e75('0xb'));var crypto=require(_0x1e75('0xc'));var jsforce=require(_0x1e75('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1e75('0xe'));var querystring=require(_0x1e75('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1e75('0x10'));var hardwareService=require(_0x1e75('0x11'));var logger=require(_0x1e75('0x12'))(_0x1e75('0x13'));var utils=require(_0x1e75('0x14'));var config=require(_0x1e75('0x15'));var licenseUtil=require(_0x1e75('0x16'));var db=require('../../mysqldb')['db'];config[_0x1e75('0x17')]=_[_0x1e75('0x18')](config['redis'],{'host':_0x1e75('0x19'),'port':0x18eb});var socket=require(_0x1e75('0x1a'))(new Redis(config[_0x1e75('0x17')]));require('./chatGroup.socket')[_0x1e75('0x1b')](socket);function respondWithStatusCode(_0x547dcf,_0x3b545a){_0x3b545a=_0x3b545a||0xcc;return function(_0x153ef6){if(_0x153ef6){return _0x547dcf[_0x1e75('0x1c')](_0x3b545a);}return _0x547dcf[_0x1e75('0x1d')](_0x3b545a)[_0x1e75('0x1e')]();};}function respondWithResult(_0x39fb30,_0x41b98f){_0x41b98f=_0x41b98f||0xc8;return function(_0x29af6d){if(_0x29af6d){return _0x39fb30[_0x1e75('0x1d')](_0x41b98f)[_0x1e75('0x1f')](_0x29af6d);}};}function respondWithFilteredResult(_0x2f1d17,_0x1bcb8a){return function(_0x2da892){if(_0x2da892){var _0x1b1172=typeof _0x1bcb8a[_0x1e75('0x20')]==='undefined'&&typeof _0x1bcb8a[_0x1e75('0x21')]===_0x1e75('0x22');var _0x4b317f=_0x2da892['count'];var _0x5231bf=_0x1b1172?0x0:_0x1bcb8a[_0x1e75('0x20')];var _0x4e054d=_0x1b1172?_0x2da892['count']:_0x1bcb8a[_0x1e75('0x20')]+_0x1bcb8a[_0x1e75('0x21')];var _0x250f11;if(_0x4e054d>=_0x4b317f){_0x4e054d=_0x4b317f;_0x250f11=0xc8;}else{_0x250f11=0xce;}_0x2f1d17[_0x1e75('0x1d')](_0x250f11);return _0x2f1d17['set']('Content-Range',_0x5231bf+'-'+_0x4e054d+'/'+_0x4b317f)[_0x1e75('0x1f')](_0x2da892);}return null;};}function patchUpdates(_0x26974b){return function(_0x3b0ab2){try{jsonpatch[_0x1e75('0x23')](_0x3b0ab2,_0x26974b,!![]);}catch(_0x537c9a){return BPromise['reject'](_0x537c9a);}return _0x3b0ab2[_0x1e75('0x24')]();};}function saveUpdates(_0x4bb70c,_0x543387){return function(_0x1b9104){if(_0x1b9104){return _0x1b9104[_0x1e75('0x25')](_0x4bb70c)[_0x1e75('0x26')](function(_0x115f65){return _0x115f65;});}return null;};}function removeEntity(_0x17bab0,_0x2c08d9){return function(_0x4c488f){if(_0x4c488f){return _0x4c488f[_0x1e75('0x27')]()['then'](function(){_0x17bab0['status'](0xcc)[_0x1e75('0x1e')]();});}};}function handleEntityNotFound(_0x42fdb2,_0xf7b2f1){return function(_0x2ab715){if(!_0x2ab715){_0x42fdb2['sendStatus'](0x194);}return _0x2ab715;};}function handleError(_0x3d646a,_0x43bd77){_0x43bd77=_0x43bd77||0x1f4;return function(_0x581912){logger[_0x1e75('0x28')](_0x581912[_0x1e75('0x29')]);if(_0x581912[_0x1e75('0x2a')]){delete _0x581912[_0x1e75('0x2a')];}_0x3d646a[_0x1e75('0x1d')](_0x43bd77)[_0x1e75('0x2b')](_0x581912);};}exports[_0x1e75('0x2c')]=function(_0x47d61f,_0x330846){var _0x3a5a95={},_0x462c50={},_0x121526={'count':0x0,'rows':[]};var _0x27b028=_[_0x1e75('0x2d')](db[_0x1e75('0x2e')][_0x1e75('0x2f')],function(_0x4cc455){return{'name':_0x4cc455[_0x1e75('0x30')],'type':_0x4cc455[_0x1e75('0x31')][_0x1e75('0x32')]};});_0x462c50[_0x1e75('0x33')]=_[_0x1e75('0x2d')](_0x27b028,_0x1e75('0x2a'));_0x462c50[_0x1e75('0x34')]=_[_0x1e75('0x35')](_0x47d61f['query']);_0x462c50[_0x1e75('0x36')]=_[_0x1e75('0x37')](_0x462c50[_0x1e75('0x33')],_0x462c50[_0x1e75('0x34')]);_0x3a5a95['attributes']=_[_0x1e75('0x37')](_0x462c50['model'],qs[_0x1e75('0x38')](_0x47d61f[_0x1e75('0x34')][_0x1e75('0x38')]));_0x3a5a95[_0x1e75('0x39')]=_0x3a5a95[_0x1e75('0x39')][_0x1e75('0x3a')]?_0x3a5a95[_0x1e75('0x39')]:_0x462c50['model'];if(!_0x47d61f[_0x1e75('0x34')]['hasOwnProperty'](_0x1e75('0x3b'))){_0x3a5a95[_0x1e75('0x21')]=qs[_0x1e75('0x21')](_0x47d61f[_0x1e75('0x34')][_0x1e75('0x21')]);_0x3a5a95['offset']=qs[_0x1e75('0x20')](_0x47d61f[_0x1e75('0x34')][_0x1e75('0x20')]);}_0x3a5a95[_0x1e75('0x3c')]=qs['sort'](_0x47d61f[_0x1e75('0x34')][_0x1e75('0x3d')]);_0x3a5a95[_0x1e75('0x3e')]=qs[_0x1e75('0x36')](_['pick'](_0x47d61f[_0x1e75('0x34')],_0x462c50['filters']),_0x27b028);if(_0x47d61f[_0x1e75('0x34')][_0x1e75('0x3f')]){_0x3a5a95[_0x1e75('0x3e')]=_[_0x1e75('0x40')](_0x3a5a95['where'],{'$or':_[_0x1e75('0x2d')](_0x27b028,function(_0x262c1a){if(_0x262c1a[_0x1e75('0x31')]!==_0x1e75('0x41')){var _0x58db48={};_0x58db48[_0x262c1a['name']]={'$like':'%'+_0x47d61f[_0x1e75('0x34')][_0x1e75('0x3f')]+'%'};return _0x58db48;}})});}_0x3a5a95=_[_0x1e75('0x40')]({},_0x3a5a95,_0x47d61f['options']);var _0x5c3678={'where':_0x3a5a95[_0x1e75('0x3e')]};return db[_0x1e75('0x2e')]['count'](_0x5c3678)[_0x1e75('0x26')](function(_0x20ce6e){_0x121526[_0x1e75('0x42')]=_0x20ce6e;if(_0x47d61f['query']['includeAll']){_0x3a5a95[_0x1e75('0x43')]=[{'all':!![]}];}return db['ChatGroup'][_0x1e75('0x44')](_0x3a5a95);})[_0x1e75('0x26')](function(_0x152d70){_0x121526[_0x1e75('0x45')]=_0x152d70;return _0x121526;})['then'](respondWithFilteredResult(_0x330846,_0x3a5a95))[_0x1e75('0x46')](handleError(_0x330846,null));};exports[_0x1e75('0x47')]=function(_0x40f51e,_0x2a185c){var _0xa60a85={'raw':!![],'where':{'id':_0x40f51e['params']['id']}},_0x1d0902={};_0x1d0902[_0x1e75('0x33')]=_[_0x1e75('0x35')](db[_0x1e75('0x2e')][_0x1e75('0x2f')]);_0x1d0902[_0x1e75('0x34')]=_[_0x1e75('0x35')](_0x40f51e[_0x1e75('0x34')]);_0x1d0902[_0x1e75('0x36')]=_['intersection'](_0x1d0902['model'],_0x1d0902[_0x1e75('0x34')]);_0xa60a85[_0x1e75('0x39')]=_[_0x1e75('0x37')](_0x1d0902['model'],qs['fields'](_0x40f51e['query'][_0x1e75('0x38')]));_0xa60a85[_0x1e75('0x39')]=_0xa60a85[_0x1e75('0x39')]['length']?_0xa60a85[_0x1e75('0x39')]:_0x1d0902[_0x1e75('0x33')];if(_0x40f51e[_0x1e75('0x34')][_0x1e75('0x48')]){_0xa60a85[_0x1e75('0x43')]=[{'all':!![]}];}_0xa60a85=_[_0x1e75('0x40')]({},_0xa60a85,_0x40f51e['options']);return db[_0x1e75('0x2e')]['find'](_0xa60a85)[_0x1e75('0x26')](handleEntityNotFound(_0x2a185c,null))['then'](respondWithResult(_0x2a185c,null))['catch'](handleError(_0x2a185c,null));};exports[_0x1e75('0x49')]=function(_0x5f46af,_0x517886){return db[_0x1e75('0x2e')]['create'](_0x5f46af[_0x1e75('0x4a')],{})[_0x1e75('0x26')](respondWithResult(_0x517886,0xc9))['catch'](handleError(_0x517886,null));};exports['update']=function(_0x3e8734,_0x2481f7){if(_0x3e8734[_0x1e75('0x4a')]['id']){delete _0x3e8734[_0x1e75('0x4a')]['id'];}return db[_0x1e75('0x2e')][_0x1e75('0x4b')]({'where':{'id':_0x3e8734[_0x1e75('0x4c')]['id']}})[_0x1e75('0x26')](handleEntityNotFound(_0x2481f7,null))[_0x1e75('0x26')](saveUpdates(_0x3e8734['body'],null))[_0x1e75('0x26')](respondWithResult(_0x2481f7,null))[_0x1e75('0x46')](handleError(_0x2481f7,null));};exports[_0x1e75('0x27')]=function(_0x543b2d,_0xf02b8){return db[_0x1e75('0x2e')][_0x1e75('0x4b')]({'where':{'id':_0x543b2d[_0x1e75('0x4c')]['id']}})['then'](handleEntityNotFound(_0xf02b8,null))[_0x1e75('0x26')](removeEntity(_0xf02b8,null))[_0x1e75('0x46')](handleError(_0xf02b8,null));};exports[_0x1e75('0x4d')]=function(_0x311877,_0x1bc963){return db[_0x1e75('0x2e')][_0x1e75('0x4d')]()[_0x1e75('0x26')](respondWithResult(_0x1bc963,null))[_0x1e75('0x46')](handleError(_0x1bc963,null));};exports[_0x1e75('0x4e')]=function(_0x17c3e6,_0x5b99b1,_0x4b2ab8){return db[_0x1e75('0x4f')][_0x1e75('0x42')]({'where':{'ChatGroupId':_0x17c3e6[_0x1e75('0x4c')]['id'],'ToId':_0x17c3e6[_0x1e75('0x50')]['id'],'read':![]}})[_0x1e75('0x26')](function(_0x4a13e5){return{'id':_[_0x1e75('0x51')](_0x17c3e6[_0x1e75('0x4c')]['id']),'count':_0x4a13e5};})[_0x1e75('0x26')](respondWithResult(_0x5b99b1,null))['catch'](handleError(_0x5b99b1,null));};exports[_0x1e75('0x52')]=function(_0x5d16a2,_0x490694,_0xb3792b){return db[_0x1e75('0x2e')][_0x1e75('0x4b')]({'where':{'id':_0x5d16a2[_0x1e75('0x4c')]['id']}})[_0x1e75('0x26')](handleEntityNotFound(_0x490694,null))[_0x1e75('0x26')](function(_0x85b4ae){if(_0x85b4ae){return _0x85b4ae[_0x1e75('0x52')](_0x5d16a2[_0x1e75('0x4a')][_0x1e75('0x53')],_['omit'](_0x5d16a2[_0x1e75('0x4a')],[_0x1e75('0x53'),'id'])||{});}})[_0x1e75('0x26')](respondWithResult(_0x490694,null))[_0x1e75('0x46')](handleError(_0x490694,null));};exports[_0x1e75('0x54')]=function(_0x517598,_0x53b1c6,_0x44e070){var _0x50da61={};var _0x2ce193={};var _0x2813ef;var _0x33a20e;return db[_0x1e75('0x2e')][_0x1e75('0x55')]({'where':{'id':_0x517598[_0x1e75('0x4c')]['id']}})[_0x1e75('0x26')](handleEntityNotFound(_0x53b1c6,null))[_0x1e75('0x26')](function(_0x153997){if(_0x153997){_0x2813ef=_0x153997;_0x2ce193[_0x1e75('0x33')]=_[_0x1e75('0x35')](db[_0x1e75('0x56')]['rawAttributes']);_0x2ce193['query']=_[_0x1e75('0x35')](_0x517598[_0x1e75('0x34')]);_0x2ce193[_0x1e75('0x36')]=_['intersection'](_0x2ce193[_0x1e75('0x33')],_0x2ce193['query']);_0x50da61['attributes']=_['intersection'](_0x2ce193[_0x1e75('0x33')],qs[_0x1e75('0x38')](_0x517598[_0x1e75('0x34')][_0x1e75('0x38')]));_0x50da61[_0x1e75('0x39')]=_0x50da61[_0x1e75('0x39')]['length']?_0x50da61[_0x1e75('0x39')]:_0x2ce193[_0x1e75('0x33')];_0x50da61[_0x1e75('0x3c')]=qs[_0x1e75('0x3d')](_0x517598[_0x1e75('0x34')][_0x1e75('0x3d')]);_0x50da61['where']=qs['filters'](_[_0x1e75('0x57')](_0x517598[_0x1e75('0x34')],_0x2ce193[_0x1e75('0x36')]));if(_0x517598['query'][_0x1e75('0x3f')]){_0x50da61['where']=_[_0x1e75('0x40')](_0x50da61['where'],{'$or':_['map'](_0x50da61['attributes'],function(_0x50257c){var _0x180dc2={};_0x180dc2[_0x50257c]={'$like':'%'+_0x517598[_0x1e75('0x34')]['filter']+'%'};return _0x180dc2;})});}_0x50da61=_[_0x1e75('0x40')]({},_0x50da61,_0x517598['options']);return _0x2813ef[_0x1e75('0x54')](_0x50da61);}})['then'](function(_0x2a11a7){if(_0x2a11a7){_0x33a20e=_0x2a11a7[_0x1e75('0x3a')];if(!_0x517598[_0x1e75('0x34')][_0x1e75('0x58')]('nolimit')){_0x50da61['limit']=qs[_0x1e75('0x21')](_0x517598[_0x1e75('0x34')][_0x1e75('0x21')]);_0x50da61['offset']=qs[_0x1e75('0x20')](_0x517598['query'][_0x1e75('0x20')]);}return _0x2813ef['getMembers'](_0x50da61);}})['then'](function(_0x103e74){if(_0x103e74){return _0x103e74?{'count':_0x33a20e,'rows':_0x103e74}:null;}})[_0x1e75('0x26')](respondWithResult(_0x53b1c6,null))[_0x1e75('0x46')](handleError(_0x53b1c6,null));};exports[_0x1e75('0x59')]=function(_0xf8feb,_0x51064b,_0x2113dc){return db[_0x1e75('0x2e')][_0x1e75('0x4b')]({'where':{'id':_0xf8feb[_0x1e75('0x4c')]['id']}})[_0x1e75('0x26')](handleEntityNotFound(_0x51064b,null))[_0x1e75('0x26')](function(_0x29e387){if(_0x29e387){return _0x29e387[_0x1e75('0x59')](_0xf8feb['query'][_0x1e75('0x53')]);}})[_0x1e75('0x26')](respondWithStatusCode(_0x51064b,null))[_0x1e75('0x46')](handleError(_0x51064b,null));};exports[_0x1e75('0x5a')]=function(_0x5f16ab,_0x3fa772,_0x172a50){if(_0x5f16ab[_0x1e75('0x4a')]['id']){delete _0x5f16ab['body']['id'];}return db['ChatGroup'][_0x1e75('0x4b')]({'where':{'id':_0x5f16ab[_0x1e75('0x4c')]['id']}})[_0x1e75('0x26')](handleEntityNotFound(_0x3fa772,null))['then'](function(_0x3014ef){if(_0x3014ef){_0x5f16ab['body'][_0x1e75('0x5b')]=_0x3014ef['id'];return db[_0x1e75('0x4f')][_0x1e75('0x49')](_0x5f16ab[_0x1e75('0x4a')]);}})[_0x1e75('0x26')](respondWithResult(_0x3fa772,null))[_0x1e75('0x46')](handleError(_0x3fa772,null));};exports[_0x1e75('0x5c')]=function(_0x52ece9,_0x157db8,_0x461e60){var _0x3786fa={};var _0x236c1e={};var _0x3364a8;var _0x5f21af;return db[_0x1e75('0x2e')][_0x1e75('0x55')]({'where':{'id':_0x52ece9[_0x1e75('0x4c')]['id']}})[_0x1e75('0x26')](handleEntityNotFound(_0x157db8,null))['then'](function(_0x56b82a){if(_0x56b82a){_0x3364a8=_0x56b82a;_0x236c1e[_0x1e75('0x33')]=_[_0x1e75('0x35')](db['ChatInternalMessage'][_0x1e75('0x2f')]);_0x236c1e[_0x1e75('0x34')]=_[_0x1e75('0x35')](_0x52ece9[_0x1e75('0x34')]);_0x236c1e[_0x1e75('0x36')]=_[_0x1e75('0x37')](_0x236c1e[_0x1e75('0x33')],_0x236c1e[_0x1e75('0x34')]);_0x3786fa[_0x1e75('0x39')]=_[_0x1e75('0x37')](_0x236c1e[_0x1e75('0x33')],qs[_0x1e75('0x38')](_0x52ece9[_0x1e75('0x34')]['fields']));_0x3786fa['attributes']=_0x3786fa['attributes'][_0x1e75('0x3a')]?_0x3786fa['attributes']:_0x236c1e[_0x1e75('0x33')];_0x3786fa[_0x1e75('0x3c')]=qs[_0x1e75('0x3d')](_0x52ece9['query'][_0x1e75('0x3d')]);_0x3786fa[_0x1e75('0x3e')]=qs[_0x1e75('0x36')](_[_0x1e75('0x57')](_0x52ece9[_0x1e75('0x34')],_0x236c1e[_0x1e75('0x36')]));if(_0x52ece9['query'][_0x1e75('0x3f')]){_0x3786fa['where']=_[_0x1e75('0x40')](_0x3786fa[_0x1e75('0x3e')],{'$or':_[_0x1e75('0x2d')](_0x3786fa[_0x1e75('0x39')],function(_0x2eb9f8){var _0x544937={};_0x544937[_0x2eb9f8]={'$like':'%'+_0x52ece9['query'][_0x1e75('0x3f')]+'%'};return _0x544937;})});}if(_0x52ece9[_0x1e75('0x34')][_0x1e75('0x5d')]){var _0x2fb6bc=_0x52ece9[_0x1e75('0x34')][_0x1e75('0x5d')][_0x1e75('0x5e')](',');var _0x5b2aa7={};_0x5b2aa7[_0x2fb6bc[0x0]]={'$gte':moment(_0x2fb6bc[0x1])[_0x1e75('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3786fa[_0x1e75('0x3e')]=_['merge'](_0x3786fa[_0x1e75('0x3e')],_0x5b2aa7);}_0x3786fa=_['merge']({},_0x3786fa,_0x52ece9[_0x1e75('0x60')]);return _0x3364a8['getMessages'](_0x3786fa);}})[_0x1e75('0x26')](function(_0x3a7445){if(_0x3a7445){_0x5f21af=_0x3a7445[_0x1e75('0x3a')];if(!_0x52ece9[_0x1e75('0x34')]['hasOwnProperty'](_0x1e75('0x3b'))){_0x3786fa[_0x1e75('0x21')]=qs[_0x1e75('0x21')](_0x52ece9['query']['limit']);_0x3786fa['offset']=qs[_0x1e75('0x20')](_0x52ece9['query'][_0x1e75('0x20')]);}return _0x3364a8[_0x1e75('0x5c')](_0x3786fa);}})[_0x1e75('0x26')](function(_0x562284){if(_0x562284){return _0x562284?{'count':_0x5f21af,'rows':_0x562284}:null;}})[_0x1e75('0x26')](respondWithResult(_0x157db8,null))[_0x1e75('0x46')](handleError(_0x157db8,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 1d1a737..827bbac 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 _0x7e0a=['remove','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save','update'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7e0a,0x15a));var _0xa7e0=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x7e0a[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require(_0xa7e0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xa7e0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa7e0('0x2')](0x0);var events={'afterCreate':_0xa7e0('0x3'),'afterUpdate':_0xa7e0('0x4'),'afterDestroy':_0xa7e0('0x5')};function emitEvent(_0x5bca83){return function(_0x284500,_0x21f1bd,_0x4ca65b){ChatGroupEvents['emit'](_0x5bca83+':'+_0x284500['id'],_0x284500);ChatGroupEvents['emit'](_0x5bca83,_0x284500);_0x4ca65b(null);};}for(var e in events){if(events[_0xa7e0('0x6')](e)){var event=events[e];ChatGroup[_0xa7e0('0x7')](e,emitEvent(event));}}module[_0xa7e0('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xf7e5=['ChatGroup','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0xfb9aaa,_0x37935d){var _0x103bf7=function(_0x1e9f2a){while(--_0x1e9f2a){_0xfb9aaa['push'](_0xfb9aaa['shift']());}};_0x103bf7(++_0x37935d);}(_0xf7e5,0x7d));var _0x5f7e=function(_0x457c47,_0x4c9104){_0x457c47=_0x457c47-0x0;var _0x463378=_0xf7e5[_0x457c47];return _0x463378;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x5f7e('0x0'))['db'][_0x5f7e('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5f7e('0x2'),'afterDestroy':_0x5f7e('0x3')};function emitEvent(_0x3a7e9f){return function(_0x46974c,_0x42a414,_0x106f4b){ChatGroupEvents[_0x5f7e('0x4')](_0x3a7e9f+':'+_0x46974c['id'],_0x46974c);ChatGroupEvents[_0x5f7e('0x4')](_0x3a7e9f,_0x46974c);_0x106f4b(null);};}for(var e in events){if(events[_0x5f7e('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 457f8d8..355c7d1 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 _0x7a4a=['bluebird','request-promise','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','api','moment'];(function(_0x567c3d,_0x29d519){var _0x4c4363=function(_0x1b39f9){while(--_0x1b39f9){_0x567c3d['push'](_0x567c3d['shift']());}};_0x4c4363(++_0x29d519);}(_0x7a4a,0xbb));var _0xa7a4=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x7a4a[_0x5c6994];return _0x1d5c84;};'use strict';var _=require(_0xa7a4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa7a4('0x1'));var moment=require(_0xa7a4('0x2'));var BPromise=require(_0xa7a4('0x3'));var rp=require(_0xa7a4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa7a4('0x5'));module[_0xa7a4('0x6')]=function(_0x3840f2,_0x45e428){return _0x3840f2[_0xa7a4('0x7')](_0xa7a4('0x8'),attributes,{'tableName':_0xa7a4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5805=['define','ChatGroup','chat_groups','lodash','../../config/logger','api','request-promise','path','rimraf','./chatGroup.attributes','exports'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x5805,0x121));var _0x5580=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x5805[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x5580('0x0'));var util=require('util');var logger=require(_0x5580('0x1'))(_0x5580('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5580('0x3'));var fs=require('fs');var path=require(_0x5580('0x4'));var rimraf=require(_0x5580('0x5'));var config=require('../../config/environment');var attributes=require(_0x5580('0x6'));module[_0x5580('0x7')]=function(_0x531f6b,_0x4bab14){return _0x531f6b[_0x5580('0x8')](_0x5580('0x9'),attributes,{'tableName':_0x5580('0xa'),'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 bb5df25..56225a1 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 _0x018d=['./chatGroup.socket','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis'];(function(_0x5da63e,_0x4d3503){var _0x442aca=function(_0x6d5bca){while(--_0x6d5bca){_0x5da63e['push'](_0x5da63e['shift']());}};_0x442aca(++_0x4d3503);}(_0x018d,0x79));var _0xd018=function(_0x32f250,_0x1fbca3){_0x32f250=_0x32f250-0x0;var _0x39ead3=_0x018d[_0x32f250];return _0x39ead3;};'use strict';var _=require(_0xd018('0x0'));var util=require('util');var moment=require(_0xd018('0x1'));var BPromise=require(_0xd018('0x2'));var rs=require(_0xd018('0x3'));var fs=require('fs');var Redis=require(_0xd018('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd018('0x5'));var logger=require('../../config/logger')(_0xd018('0x6'));var config=require(_0xd018('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd018('0x8')][_0xd018('0x9')]({'port':0x232a});config[_0xd018('0xa')]=_['defaults'](config[_0xd018('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd018('0xa')]));require(_0xd018('0xb'))['register'](socket);function respondWithRpcPromise(_0x10fe5e,_0x4250e0,_0x85466f){return new BPromise(function(_0x558b4d,_0x3fd73e){return client[_0xd018('0xc')](_0x10fe5e,_0x85466f)['then'](function(_0x141acb){logger[_0xd018('0xd')](_0xd018('0xe'),_0x4250e0,_0xd018('0xf'));logger['debug'](_0xd018('0x10'),_0x4250e0,_0xd018('0xf'),JSON[_0xd018('0x11')](_0x141acb));if(_0x141acb[_0xd018('0x12')]){if(_0x141acb['error'][_0xd018('0x13')]===0x1f4){logger[_0xd018('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4250e0,_0x141acb[_0xd018('0x12')][_0xd018('0x14')]);return _0x3fd73e(_0x141acb['error'][_0xd018('0x14')]);}logger[_0xd018('0x12')](_0xd018('0xe'),_0x4250e0,_0x141acb[_0xd018('0x12')][_0xd018('0x14')]);return _0x558b4d(_0x141acb[_0xd018('0x12')]['message']);}else{logger['info'](_0xd018('0xe'),_0x4250e0,_0xd018('0xf'));_0x558b4d(_0x141acb[_0xd018('0x15')]['message']);}})['catch'](function(_0x5d1898){logger[_0xd018('0x12')](_0xd018('0xe'),_0x4250e0,_0x5d1898);_0x3fd73e(_0x5d1898);});});} \ No newline at end of file +var _0xcd4e=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x3cda6d,_0x201e15){var _0x4e0c9b=function(_0x1430c3){while(--_0x1430c3){_0x3cda6d['push'](_0x3cda6d['shift']());}};_0x4e0c9b(++_0x201e15);}(_0xcd4e,0x187));var _0xecd4=function(_0x2cfded,_0x208af5){_0x2cfded=_0x2cfded-0x0;var _0x241a74=_0xcd4e[_0x2cfded];return _0x241a74;};'use strict';var _=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var moment=require(_0xecd4('0x2'));var BPromise=require(_0xecd4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecd4('0x4'))['db'];var utils=require(_0xecd4('0x5'));var logger=require('../../config/logger')(_0xecd4('0x6'));var config=require('../../config/environment');var jayson=require(_0xecd4('0x7'));var client=jayson['client'][_0xecd4('0x8')]({'port':0x232a});config[_0xecd4('0x9')]=_[_0xecd4('0xa')](config[_0xecd4('0x9')],{'host':_0xecd4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xecd4('0x9')]));require(_0xecd4('0xc'))['register'](socket);function respondWithRpcPromise(_0xf99ee6,_0x57a2f4,_0xad8e1d){return new BPromise(function(_0x345333,_0x37fd0a){return client['request'](_0xf99ee6,_0xad8e1d)[_0xecd4('0xd')](function(_0x5de0f2){logger['info'](_0xecd4('0xe'),_0x57a2f4,'request\x20sent');logger[_0xecd4('0xf')](_0xecd4('0x10'),_0x57a2f4,_0xecd4('0x11'),JSON[_0xecd4('0x12')](_0x5de0f2));if(_0x5de0f2[_0xecd4('0x13')]){if(_0x5de0f2['error'][_0xecd4('0x14')]===0x1f4){logger[_0xecd4('0x13')](_0xecd4('0xe'),_0x57a2f4,_0x5de0f2[_0xecd4('0x13')][_0xecd4('0x15')]);return _0x37fd0a(_0x5de0f2[_0xecd4('0x13')][_0xecd4('0x15')]);}logger[_0xecd4('0x13')](_0xecd4('0xe'),_0x57a2f4,_0x5de0f2['error'][_0xecd4('0x15')]);return _0x345333(_0x5de0f2[_0xecd4('0x13')][_0xecd4('0x15')]);}else{logger[_0xecd4('0x16')](_0xecd4('0xe'),_0x57a2f4,_0xecd4('0x11'));_0x345333(_0x5de0f2['result'][_0xecd4('0x15')]);}})['catch'](function(_0xf4ef28){logger[_0xecd4('0x13')](_0xecd4('0xe'),_0x57a2f4,_0xf4ef28);_0x37fd0a(_0xf4ef28);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f8641ec..fc4d508 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 _0xb866=['update','emit','removeListener','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb866,0x15e));var _0x6b86=function(_0x13a73c,_0xf82498){_0x13a73c=_0x13a73c-0x0;var _0x1a5855=_0xb866[_0x13a73c];return _0x1a5855;};'use strict';var ChatGroupEvents=require(_0x6b86('0x0'));var events=[_0x6b86('0x1'),'remove',_0x6b86('0x2')];function createListener(_0x492005,_0x58ad73){return function(_0x4d4272){_0x58ad73[_0x6b86('0x3')](_0x492005,_0x4d4272);};}function removeListener(_0x30d20e,_0x4b66aa){return function(){ChatGroupEvents[_0x6b86('0x4')](_0x30d20e,_0x4b66aa);};}exports[_0x6b86('0x5')]=function(_0x287005){for(var _0x481952=0x0,_0x38bb2d=events[_0x6b86('0x6')];_0x481952<_0x38bb2d;_0x481952++){var _0x5756b7=events[_0x481952];var _0x56b2df=createListener(_0x6b86('0x7')+_0x5756b7,_0x287005);ChatGroupEvents['on'](_0x5756b7,_0x56b2df);}}; \ No newline at end of file +var _0x9dde=['register','length','update','emit','removeListener'];(function(_0x3b15a3,_0x144f13){var _0xd8445e=function(_0x445c23){while(--_0x445c23){_0x3b15a3['push'](_0x3b15a3['shift']());}};_0xd8445e(++_0x144f13);}(_0x9dde,0x10b));var _0xe9dd=function(_0x1b5b73,_0x56b711){_0x1b5b73=_0x1b5b73-0x0;var _0xf0c8cd=_0x9dde[_0x1b5b73];return _0xf0c8cd;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save','remove',_0xe9dd('0x0')];function createListener(_0x46ddf1,_0x32dc79){return function(_0x4cbba8){_0x32dc79[_0xe9dd('0x1')](_0x46ddf1,_0x4cbba8);};}function removeListener(_0xc8ed4d,_0x25890c){return function(){ChatGroupEvents[_0xe9dd('0x2')](_0xc8ed4d,_0x25890c);};}exports[_0xe9dd('0x3')]=function(_0x520597){for(var _0x1b1842=0x0,_0x26d0c0=events[_0xe9dd('0x4')];_0x1b1842<_0x26d0c0;_0x1b1842++){var _0x8bf084=events[_0x1b1842];var _0x39b164=createListener('chatGroup:'+_0x8bf084,_0x520597);ChatGroupEvents['on'](_0x8bf084,_0x39b164);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index a19ce2d..d46035e 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 _0xf881=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','update','delete','destroy','removeMembers','multer','util'];(function(_0x5a24a8,_0x19b21a){var _0x2d0072=function(_0x10b6eb){while(--_0x10b6eb){_0x5a24a8['push'](_0x5a24a8['shift']());}};_0x2d0072(++_0x19b21a);}(_0xf881,0x1ec));var _0x1f88=function(_0x29492d,_0x4152e9){_0x29492d=_0x29492d-0x0;var _0x2b9592=_0xf881[_0x29492d];return _0x2b9592;};'use strict';var multer=require(_0x1f88('0x0'));var util=require(_0x1f88('0x1'));var path=require(_0x1f88('0x2'));var timeout=require(_0x1f88('0x3'));var express=require(_0x1f88('0x4'));var router=express[_0x1f88('0x5')]();var fs_extra=require(_0x1f88('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1f88('0x7'));var config=require(_0x1f88('0x8'));var controller=require(_0x1f88('0x9'));router[_0x1f88('0xa')]('/',auth[_0x1f88('0xb')](),controller[_0x1f88('0xc')]);router[_0x1f88('0xa')]('/describe',auth[_0x1f88('0xb')](),controller[_0x1f88('0xd')]);router[_0x1f88('0xa')](_0x1f88('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1f88('0xa')](_0x1f88('0xf'),auth['isAuthenticated'](),controller[_0x1f88('0x10')]);router['get'](_0x1f88('0x11'),auth['isAuthenticated'](),controller[_0x1f88('0x12')]);router[_0x1f88('0xa')](_0x1f88('0x13'),auth[_0x1f88('0xb')](),controller['getMessages']);router[_0x1f88('0x14')]('/',auth[_0x1f88('0xb')](),controller[_0x1f88('0x15')]);router[_0x1f88('0x14')](_0x1f88('0x11'),auth[_0x1f88('0xb')](),controller['addMembers']);router['post'](_0x1f88('0x13'),auth[_0x1f88('0xb')](),controller['addMessage']);router['put']('/:id',auth[_0x1f88('0xb')](),controller[_0x1f88('0x16')]);router[_0x1f88('0x17')](_0x1f88('0xe'),auth[_0x1f88('0xb')](),controller[_0x1f88('0x18')]);router[_0x1f88('0x17')](_0x1f88('0x11'),auth[_0x1f88('0xb')](),controller[_0x1f88('0x19')]);module['exports']=router; \ No newline at end of file +var _0x9c08=['update','removeMembers','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','get','show','/:id/unread','getUnread','getMembers','/:id/messages','create','post','/:id/members','addMembers','addMessage','put'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x9c08,0xe3));var _0x89c0=function(_0x85f731,_0x4ef1e9){_0x85f731=_0x85f731-0x0;var _0x37b8d4=_0x9c08[_0x85f731];return _0x37b8d4;};'use strict';var multer=require(_0x89c0('0x0'));var util=require(_0x89c0('0x1'));var path=require(_0x89c0('0x2'));var timeout=require(_0x89c0('0x3'));var express=require('express');var router=express[_0x89c0('0x4')]();var fs_extra=require(_0x89c0('0x5'));var auth=require(_0x89c0('0x6'));var interaction=require(_0x89c0('0x7'));var config=require(_0x89c0('0x8'));var controller=require(_0x89c0('0x9'));router['get']('/',auth[_0x89c0('0xa')](),controller[_0x89c0('0xb')]);router['get'](_0x89c0('0xc'),auth[_0x89c0('0xa')](),controller['describe']);router[_0x89c0('0xd')]('/:id',auth[_0x89c0('0xa')](),controller[_0x89c0('0xe')]);router['get'](_0x89c0('0xf'),auth[_0x89c0('0xa')](),controller[_0x89c0('0x10')]);router[_0x89c0('0xd')]('/:id/members',auth['isAuthenticated'](),controller[_0x89c0('0x11')]);router['get'](_0x89c0('0x12'),auth[_0x89c0('0xa')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x89c0('0x13')]);router[_0x89c0('0x14')](_0x89c0('0x15'),auth[_0x89c0('0xa')](),controller[_0x89c0('0x16')]);router[_0x89c0('0x14')](_0x89c0('0x12'),auth['isAuthenticated'](),controller[_0x89c0('0x17')]);router[_0x89c0('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x89c0('0x19')]);router['delete']('/:id',auth[_0x89c0('0xa')](),controller['destroy']);router['delete'](_0x89c0('0x15'),auth[_0x89c0('0xa')](),controller[_0x89c0('0x1a')]);module[_0x89c0('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index ef94b2e..49075dd 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 _0xffda=['thumb','TEXT','DATE','STRING','out','sequelize','exports','BOOLEAN','INTEGER','star'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xffda,0x73));var _0xaffd=function(_0x43e109,_0x43c96d){_0x43e109=_0x43e109-0x0;var _0x1d56f3=_0xffda[_0x43e109];return _0x1d56f3;};'use strict';var Sequelize=require(_0xaffd('0x0'));module[_0xaffd('0x1')]={'closed':{'type':Sequelize[_0xaffd('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaffd('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0xaffd('0x4'),_0xaffd('0x5')),'defaultValue':_0xaffd('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xaffd('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xaffd('0x7')]},'disposition':{'type':Sequelize[_0xaffd('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xaffd('0x8')]},'browserName':{'type':Sequelize[_0xaffd('0x8')]},'browserVersion':{'type':Sequelize[_0xaffd('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xaffd('0x8')]},'deviceModel':{'type':Sequelize[_0xaffd('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xaffd('0x6')]},'customerIp':{'type':Sequelize[_0xaffd('0x8')]},'formData':{'type':Sequelize[_0xaffd('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xaffd('0x7')]},'lastMsgAt':{'type':Sequelize[_0xaffd('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xaffd('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xaffd('0x8')]},'customerPort':{'type':Sequelize[_0xaffd('0x8')]},'vidaooSessionId':{'type':Sequelize[_0xaffd('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xaffd('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x531a=['DATE','STRING','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x30ae20,_0xe973ef){var _0xdb9efc=function(_0x4e53bf){while(--_0x4e53bf){_0x30ae20['push'](_0x30ae20['shift']());}};_0xdb9efc(++_0xe973ef);}(_0x531a,0x100));var _0xa531=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x531a[_0x572165];return _0x8c8709;};'use strict';var Sequelize=require(_0xa531('0x0'));module[_0xa531('0x1')]={'closed':{'type':Sequelize[_0xa531('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa531('0x3')]},'ratingType':{'type':Sequelize[_0xa531('0x4')](_0xa531('0x5'),_0xa531('0x6')),'defaultValue':_0xa531('0x5')},'ratingMessage':{'type':Sequelize[_0xa531('0x7')]},'pathTranscript':{'type':Sequelize[_0xa531('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa531('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xa531('0x9')]},'thirdDisposition':{'type':Sequelize[_0xa531('0x9')]},'note':{'type':Sequelize[_0xa531('0x9')]},'browserName':{'type':Sequelize[_0xa531('0x9')]},'browserVersion':{'type':Sequelize[_0xa531('0x9')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa531('0x9')]},'deviceModel':{'type':Sequelize[_0xa531('0x9')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xa531('0x9')]},'referer':{'type':Sequelize[_0xa531('0x7')]},'customerIp':{'type':Sequelize[_0xa531('0x9')]},'formData':{'type':Sequelize[_0xa531('0x7')](_0xa531('0xa'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xa531('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa531('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa531('0x9')]},'customerPort':{'type':Sequelize[_0xa531('0x9')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa531('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index bd436e3..7c8e34f 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 _0xb367=['secret','includeAgent','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','Account','get','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','downloadInteraction.ejs','transcript-','Chat','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../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','ChatInteraction,\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','name','send','merge','body','agent','account','Users','map','fullname','Tags','split','TagIds','waiting','talking','answered','abandoned','total','closed','UserId','disposition','unmanaged','index','ChatInteraction','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','tools_tags','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','length','find','unreadMessages','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','text','start','Tag','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','some','compact','isEmpty','ChatWebsiteId','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','order','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','show','params','model','includeAll','create','describe','createVidaooSession','findOne','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','metadata','ValidationError','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','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','offline-chat/','download','close','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','hasOwnProperty','ChatInteractionId','options','include','findAll','rows','getMyMessages'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb367,0x172));var _0x7b36=function(_0x2f2a02,_0x33101a){_0x2f2a02=_0x2f2a02-0x0;var _0x427b7b=_0xb367[_0x2f2a02];return _0x427b7b;};'use strict';var emlformat=require(_0x7b36('0x0'));var rimraf=require(_0x7b36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b36('0x2'));var rp=require(_0x7b36('0x3'));var moment=require(_0x7b36('0x4'));var BPromise=require(_0x7b36('0x5'));var Mustache=require(_0x7b36('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7b36('0x7'));var csv=require(_0x7b36('0x8'));var ejs=require(_0x7b36('0x9'));var fs=require('fs');var fs_extra=require(_0x7b36('0xa'));var _=require(_0x7b36('0xb'));var squel=require('squel');var crypto=require(_0x7b36('0xc'));var jsforce=require(_0x7b36('0xd'));var deskjs=require(_0x7b36('0xe'));var toCsv=require(_0x7b36('0x8'));var querystring=require(_0x7b36('0xf'));var Papa=require(_0x7b36('0x10'));var Redis=require(_0x7b36('0x11'));var authService=require(_0x7b36('0x12'));var qs=require(_0x7b36('0x13'));var as=require(_0x7b36('0x14'));var pdf=require(_0x7b36('0x15'));var hardwareService=require(_0x7b36('0x16'));var logger=require(_0x7b36('0x17'))('api');var utils=require(_0x7b36('0x18'));var config=require(_0x7b36('0x19'));var licenseUtil=require(_0x7b36('0x1a'));var db=require(_0x7b36('0x1b'))['db'];config[_0x7b36('0x1c')]=_[_0x7b36('0x1d')](config[_0x7b36('0x1c')],{'host':_0x7b36('0x1e'),'port':0x18eb});var socket=require(_0x7b36('0x1f'))(new Redis(config[_0x7b36('0x1c')]));require(_0x7b36('0x20'))[_0x7b36('0x21')](socket);var jayson=require(_0x7b36('0x22'));var client=jayson[_0x7b36('0x23')][_0x7b36('0x24')]({'port':0x232b});var client9004=jayson['client'][_0x7b36('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x259029,_0x14e934,_0x3b7cb4,_0x7d2484){return new BPromise(function(_0x1cedc0,_0x182aad){var _0x4d07f1=_0x7d2484||client;return _0x4d07f1[_0x7b36('0x25')](_0x259029,_0x3b7cb4)[_0x7b36('0x26')](function(_0x4c15a9){logger[_0x7b36('0x27')](_0x7b36('0x28'),_0x14e934,_0x7b36('0x29'));logger['debug'](_0x7b36('0x2a'),_0x14e934,_0x7b36('0x29'),JSON[_0x7b36('0x2b')](_0x4c15a9));if(_0x4c15a9[_0x7b36('0x2c')]){if(_0x4c15a9[_0x7b36('0x2c')]['code']===0x1f4){logger[_0x7b36('0x2c')](_0x7b36('0x28'),_0x14e934,_0x4c15a9['error'][_0x7b36('0x2d')]);return _0x182aad(_0x4c15a9['error'][_0x7b36('0x2d')]);}logger[_0x7b36('0x2c')](_0x7b36('0x28'),_0x14e934,_0x4c15a9[_0x7b36('0x2c')][_0x7b36('0x2d')]);return _0x1cedc0(_0x4c15a9[_0x7b36('0x2c')]['message']);}else{logger[_0x7b36('0x27')]('ChatInteraction,\x20%s,\x20%s',_0x14e934,_0x7b36('0x29'));_0x1cedc0(_0x4c15a9[_0x7b36('0x2e')][_0x7b36('0x2d')]);}})[_0x7b36('0x2f')](function(_0x21c385){logger[_0x7b36('0x2c')](_0x7b36('0x28'),_0x14e934,_0x21c385);_0x182aad(_0x21c385);});});}function respondWithStatusCode(_0x3ebdb3,_0x4b4ab4){_0x4b4ab4=_0x4b4ab4||0xcc;return function(_0x1a3a7b){if(_0x1a3a7b){return _0x3ebdb3[_0x7b36('0x30')](_0x4b4ab4);}return _0x3ebdb3[_0x7b36('0x31')](_0x4b4ab4)[_0x7b36('0x32')]();};}function respondWithResult(_0xcf70b8,_0x313cc4){_0x313cc4=_0x313cc4||0xc8;return function(_0x72c8d7){if(_0x72c8d7){return _0xcf70b8['status'](_0x313cc4)[_0x7b36('0x33')](_0x72c8d7);}};}function respondWithFilteredResult(_0x4cd18d,_0x5e3a10){return function(_0x3836b0){if(_0x3836b0){var _0x23820a=typeof _0x5e3a10[_0x7b36('0x34')]===_0x7b36('0x35')&&typeof _0x5e3a10[_0x7b36('0x36')]==='undefined';var _0x12df2f=_0x3836b0[_0x7b36('0x37')];var _0x1eacf1=_0x23820a?0x0:_0x5e3a10['offset'];var _0xee89df=_0x23820a?_0x3836b0[_0x7b36('0x37')]:_0x5e3a10['offset']+_0x5e3a10[_0x7b36('0x36')];var _0x1bf103;if(_0xee89df>=_0x12df2f){_0xee89df=_0x12df2f;_0x1bf103=0xc8;}else{_0x1bf103=0xce;}_0x4cd18d[_0x7b36('0x31')](_0x1bf103);return _0x4cd18d['set'](_0x7b36('0x38'),_0x1eacf1+'-'+_0xee89df+'/'+_0x12df2f)[_0x7b36('0x33')](_0x3836b0);}return null;};}function patchUpdates(_0x5699f9){return function(_0x23c6b2){try{jsonpatch[_0x7b36('0x39')](_0x23c6b2,_0x5699f9,!![]);}catch(_0x4b04a8){return BPromise[_0x7b36('0x3a')](_0x4b04a8);}return _0x23c6b2[_0x7b36('0x3b')]();};}function saveUpdates(_0x5f0797,_0x2c4b9c){return function(_0x2e96f6){if(_0x2e96f6){return _0x2e96f6[_0x7b36('0x3c')](_0x5f0797)[_0x7b36('0x26')](function(_0x1f3da5){return _0x1f3da5;});}return null;};}function removeEntity(_0x20939b,_0x30b92b){return function(_0x174a5d){if(_0x174a5d){return _0x174a5d[_0x7b36('0x3d')]()[_0x7b36('0x26')](function(){_0x20939b[_0x7b36('0x31')](0xcc)[_0x7b36('0x32')]();});}};}function handleEntityNotFound(_0x5d3a51,_0x884b27){return function(_0x4fecdf){if(!_0x4fecdf){_0x5d3a51[_0x7b36('0x30')](0x194);}return _0x4fecdf;};}function handleError(_0x78e386,_0x4f597a){_0x4f597a=_0x4f597a||0x1f4;return function(_0x22791b){logger[_0x7b36('0x2c')](_0x22791b[_0x7b36('0x3e')]);if(_0x22791b[_0x7b36('0x3f')]){delete _0x22791b['name'];}_0x78e386[_0x7b36('0x31')](_0x4f597a)[_0x7b36('0x40')](_0x22791b);};}function getMustacheRender(_0x324fce,_0xab7606){return Mustache['render'](_0x324fce,_[_0x7b36('0x41')](_0xab7606[_0x7b36('0x42')],{'contact':_0xab7606['contact'],'message':_0xab7606[_0x7b36('0x2d')],'agent':_0xab7606[_0x7b36('0x43')],'interaction':_0xab7606['interaction'],'account':_0xab7606[_0x7b36('0x44')]}))||'';}function getInteractionUsers(_0x22e16e,_0x34d63d){return new BPromise(function(_0x1d517f,_0x88a8f4){try{if(_0x34d63d[_0x22e16e['id']]){_0x22e16e[_0x7b36('0x45')]=_[_0x7b36('0x46')](_0x34d63d[_0x22e16e['id']],function(_0x5f0237){return{'id':_0x5f0237['id'],'fullname':_0x5f0237[_0x7b36('0x47')]};});}}catch(_0x14f8c4){_0x88a8f4(_0x14f8c4);}_0x1d517f(_0x22e16e);});}function getInteractionTags(_0x4457a4,_0x173f58){return new BPromise(function(_0x4afd15,_0x1890c2){try{if(_0x4457a4['TagIds']){_0x4457a4[_0x7b36('0x48')]=[];_0x4457a4['TagIds'][_0x7b36('0x49')](',')['forEach'](function(_0xfaf742){_0x4457a4[_0x7b36('0x48')]['push'](_0x173f58[_0xfaf742]);});}delete _0x4457a4[_0x7b36('0x4a')];}catch(_0x27d4fc){_0x1890c2(_0x27d4fc);}_0x4afd15(_0x4457a4);});}function updateChatInteraction(_0x3eea7e,_0x14deb1,_0x52361d){return new BPromise(function(_0x49c79d,_0x2a5bc5){return getInteractionUsers(_0x3eea7e,_0x52361d)[_0x7b36('0x26')](function(_0x575b78){return getInteractionTags(_0x575b78,_0x14deb1);})[_0x7b36('0x26')](function(_0xabe833){return getStateInteraction(_0xabe833);})['then'](function(_0x31a224){_0x49c79d(_0x31a224);})[_0x7b36('0x2f')](function(_0x3d0967){_0x2a5bc5(_0x3d0967);});});}function getStateInteraction(_0x180d9f){return new BPromise(function(_0x22c4d5){_0x180d9f[_0x7b36('0x4b')]=0x0;_0x180d9f[_0x7b36('0x4c')]=0x0;_0x180d9f[_0x7b36('0x4d')]=0x0;_0x180d9f['unmanaged']=0x0;_0x180d9f[_0x7b36('0x4e')]=0x0;_0x180d9f[_0x7b36('0x4f')]=0x0;if(!_0x180d9f[_0x7b36('0x50')]&&!_0x180d9f['UserId']){_0x180d9f[_0x7b36('0x4b')]+=0x1;}if(!_0x180d9f[_0x7b36('0x50')]&&_0x180d9f[_0x7b36('0x51')]){_0x180d9f['talking']+=0x1;if(_0x180d9f[_0x7b36('0x4b')]){_0x180d9f[_0x7b36('0x4b')]-=0x1;}}if(_0x180d9f[_0x7b36('0x50')]&&_0x180d9f[_0x7b36('0x52')]===_0x7b36('0x4e')){_0x180d9f['abandoned']+=0x1;if(_0x180d9f['waiting']){_0x180d9f[_0x7b36('0x4b')]-=0x1;}}else if(_0x180d9f[_0x7b36('0x50')]&&!_0x180d9f['UserId']&&_0x180d9f[_0x7b36('0x52')]){_0x180d9f[_0x7b36('0x53')]+=0x1;if(_0x180d9f[_0x7b36('0x4b')]){_0x180d9f[_0x7b36('0x4b')]-=0x1;}}else if(_0x180d9f[_0x7b36('0x50')]&&_0x180d9f[_0x7b36('0x51')]){_0x180d9f[_0x7b36('0x4d')]+=0x1;if(_0x180d9f[_0x7b36('0x4c')]){_0x180d9f[_0x7b36('0x4c')]-=0x1;}}_0x180d9f[_0x7b36('0x4f')]+=0x1;_0x22c4d5(_0x180d9f);});}exports[_0x7b36('0x54')]=function(_0x29fd1c,_0x16e815){var _0x2793cb={},_0x35898b={},_0x4536c7={'count':0x0,'rows':[]};var _0x1dfb4f=_[_0x7b36('0x46')](db[_0x7b36('0x55')][_0x7b36('0x56')],function(_0x59f34c){return{'name':_0x59f34c[_0x7b36('0x57')],'type':_0x59f34c[_0x7b36('0x58')]['key']};});_0x35898b['model']=_[_0x7b36('0x46')](_0x1dfb4f,_0x7b36('0x3f'));_0x35898b[_0x7b36('0x59')]=_[_0x7b36('0x5a')](_0x29fd1c[_0x7b36('0x59')]);_0x35898b[_0x7b36('0x5b')]=_[_0x7b36('0x5c')](_0x35898b['model'],_0x35898b[_0x7b36('0x59')]);_0x2793cb[_0x7b36('0x5d')]=_[_0x7b36('0x5c')](_0x35898b['model'],qs[_0x7b36('0x5e')](_0x29fd1c['query'][_0x7b36('0x5e')]));_0x2793cb[_0x7b36('0x5d')]=_0x2793cb[_0x7b36('0x5d')]['length']?_0x2793cb[_0x7b36('0x5d')]:_0x35898b['model'];if(!_0x29fd1c[_0x7b36('0x59')]['hasOwnProperty'](_0x7b36('0x5f'))){_0x2793cb['limit']=qs[_0x7b36('0x36')](_0x29fd1c['query']['limit']);_0x2793cb[_0x7b36('0x34')]=qs[_0x7b36('0x34')](_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x34')]);}_0x2793cb['order']=qs['sort'](_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x60')]);_0x2793cb[_0x7b36('0x61')]=qs['filters'](_[_0x7b36('0x62')](_0x29fd1c['query'],_0x35898b[_0x7b36('0x5b')]),_0x1dfb4f);var _0x3b69d8=[];var _0x3aa6d6=squel[_0x7b36('0x63')]()[_0x7b36('0x64')]('id')[_0x7b36('0x64')]('name')['field']('color')['from'](_0x7b36('0x65'));var _0x55bb65=squel[_0x7b36('0x63')]()['field']('u.id')['field'](_0x7b36('0x66'))[_0x7b36('0x64')](_0x7b36('0x67'))[_0x7b36('0x68')](_0x7b36('0x69'),'ui')[_0x7b36('0x6a')](_0x7b36('0x6b'),'u',_0x7b36('0x6c'));var _0x531d5e=squel[_0x7b36('0x63')]()[_0x7b36('0x68')]('chat_interactions','i')['left_join'](_0x7b36('0x6d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x7b36('0x6a')](_0x7b36('0x6b'),'o',_0x7b36('0x6e'))[_0x7b36('0x6a')]('chat_websites','a',_0x7b36('0x6f'))['left_join']('chat_messages','me',_0x7b36('0x70'))[_0x7b36('0x6a')]('chat_interaction_has_tags','it',_0x7b36('0x71'))[_0x7b36('0x6a')](_0x7b36('0x65'),'t',_0x7b36('0x72'));var _0x5f2cb1=squel[_0x7b36('0x73')]();var _0x4be194=[];var _0x1c34a9=squel[_0x7b36('0x73')]();var _0x2b29a8;if(_0x29fd1c['query']['search']){_0x2b29a8=as[_0x7b36('0x74')](_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x75')]);var _0x6aff15=_0x2b29a8[_0x7b36('0x76')];for(var _0x11cb31=0x0;_0x11cb31<_0x2b29a8['conditions'][_0x7b36('0x77')];_0x11cb31++){var _0x2759ed=_0x2b29a8['conditions'][_0x11cb31];var _0x3fc77a='i';var _0x3e0836=_[_0x7b36('0x78')](_0x1dfb4f,[_0x7b36('0x3f'),_0x2759ed['field']]);if(!_0x3e0836){switch(_0x2759ed[_0x7b36('0x64')]){case _0x7b36('0x79'):if(_0x2759ed['value']==0x1){_0x531d5e['having']('`'+_0x2759ed[_0x7b36('0x64')]+'`\x20=\x200');}else{_0x531d5e[_0x7b36('0x7a')]('`'+_0x2759ed[_0x7b36('0x64')]+_0x7b36('0x7b'));}break;case'Contact':if(_0x2759ed[_0x7b36('0x7c')]===_0x7b36('0x7d')){if(_0x2759ed['value'][_0x7b36('0x49')]('\x20')[_0x7b36('0x77')]>0x1){_0x5f2cb1[_0x6aff15](_0x7b36('0x7e'),qs[_0x7b36('0x7f')](_0x2759ed[_0x7b36('0x80')]),null);}else{var _0x425170='%'+_0x2759ed[_0x7b36('0x80')]+'%';_0x5f2cb1[_0x6aff15]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x425170,_0x425170,_0x425170);}}else{_0x3e0836=_['find'](_0x1dfb4f,[_0x7b36('0x3f'),'ContactId']);_0x2759ed[_0x7b36('0x64')]='ContactId';_0x41fdaa=as['buildExpression'](_0x3fc77a,_0x3e0836['type'],_0x2759ed);_0x5f2cb1[_0x6aff15](_0x41fdaa[_0x7b36('0x81')],_0x41fdaa[_0x7b36('0x80')][_0x7b36('0x82')],_0x41fdaa[_0x7b36('0x80')]['end']);}break;case _0x7b36('0x83'):var _0x77c90d=_0x2759ed[_0x7b36('0x80')][_0x7b36('0x49')](',')[_0x7b36('0x46')](function(_0x51451e){return Number(_0x51451e);});_0x77c90d[_0x7b36('0x84')](function(_0x50ff15){_0x1c34a9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x50ff15+',%');});_0x4be194=_[_0x7b36('0x85')](_0x4be194,_0x77c90d);break;case _0x7b36('0x86'):if(_0x2759ed[_0x7b36('0x7c')]==='$substring'){_0x5f2cb1[_0x6aff15](_0x7b36('0x87'),'%'+_0x2759ed[_0x7b36('0x80')]+'%',null);}else{_0x3e0836=_[_0x7b36('0x78')](_0x1dfb4f,[_0x7b36('0x3f'),_0x7b36('0x51')]);_0x2759ed[_0x7b36('0x64')]=_0x7b36('0x51');_0x41fdaa=as[_0x7b36('0x88')](_0x3fc77a,_0x3e0836[_0x7b36('0x58')],_0x2759ed);_0x5f2cb1[_0x6aff15](_0x41fdaa[_0x7b36('0x81')],_0x41fdaa[_0x7b36('0x80')][_0x7b36('0x82')],_0x41fdaa[_0x7b36('0x80')][_0x7b36('0x32')]);}break;case _0x7b36('0x42'):_0x41fdaa=as[_0x7b36('0x88')]('me',null,_0x2759ed);_0x5f2cb1[_0x6aff15](_0x41fdaa[_0x7b36('0x81')],_0x41fdaa[_0x7b36('0x80')][_0x7b36('0x82')],_0x41fdaa[_0x7b36('0x80')][_0x7b36('0x32')]);break;}}else{var _0x41fdaa=as[_0x7b36('0x88')](_0x3fc77a,_0x3e0836[_0x7b36('0x58')],_0x2759ed);_0x5f2cb1[_0x6aff15](_0x41fdaa[_0x7b36('0x81')],_0x41fdaa[_0x7b36('0x80')][_0x7b36('0x82')],_0x41fdaa[_0x7b36('0x80')][_0x7b36('0x32')]);}}}else{var _0x36a18f=_(_0x29fd1c[_0x7b36('0x59')])['keys']()[_0x7b36('0x46')](function(_0x4dd94e){return _[_0x7b36('0x89')](_0x1dfb4f,[_0x7b36('0x3f'),_0x4dd94e])?_0x4dd94e:undefined;})[_0x7b36('0x8a')]()[_0x7b36('0x80')]();if(!_[_0x7b36('0x8b')](_0x36a18f)){_0x36a18f[_0x7b36('0x84')](function(_0x49a4ee){if(_0x49a4ee===_0x7b36('0x8c')){_0x531d5e[_0x7b36('0x61')]('i.ChatWebsiteId\x20IN\x20?',[][_0x7b36('0x8d')](_0x29fd1c[_0x7b36('0x59')][_0x49a4ee]));}else if(_0x49a4ee==='createdAt'){var _0x15cef7=JSON['parse'](_0x29fd1c['query'][_0x49a4ee])[_0x7b36('0x8e')];var _0x322fb7=JSON[_0x7b36('0x8f')](_0x29fd1c[_0x7b36('0x59')][_0x49a4ee])[_0x7b36('0x90')];_0x531d5e[_0x7b36('0x61')](_0x7b36('0x91'),_0x15cef7,_0x322fb7);}else{if(_0x29fd1c[_0x7b36('0x59')][_0x49a4ee]===_0x7b36('0x92')){_0x531d5e['where']('i.'+_0x49a4ee+_0x7b36('0x93'));}else{_0x531d5e[_0x7b36('0x61')]('i.'+_0x49a4ee+_0x7b36('0x94'),_0x29fd1c[_0x7b36('0x59')][_0x49a4ee]);}}});}if(_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x95')]){if(_0x29fd1c['query'][_0x7b36('0x95')]==0x1){_0x531d5e[_0x7b36('0x7a')](_0x7b36('0x96'));}else{_0x531d5e[_0x7b36('0x7a')](_0x7b36('0x97'));}}if(_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x98')]){_0x4be194=_[_0x7b36('0x99')](_0x29fd1c['query'][_0x7b36('0x98')])?_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x98')]:new Array(_0x29fd1c['query'][_0x7b36('0x98')]);_0x4be194['forEach'](function(_0x27932c){_0x1c34a9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x27932c+',%');});}if(_0x29fd1c[_0x7b36('0x59')]['filter']){var _0x589a84=_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x9a')][_0x7b36('0x9b')]('\x5c','\x5c\x5c')[_0x7b36('0x9b')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x589a84)){_0x5f2cb1['or'](_0x7b36('0x9c'),_0x589a84+'%');}else{_0x5f2cb1['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7b36('0x7f')](_0x589a84))['or'](_0x7b36('0x9d'),_0x589a84+'%');}}}_0x531d5e[_0x7b36('0x61')](_0x5f2cb1);_0x531d5e[_0x7b36('0x9e')](_0x7b36('0x9f'));var _0x3386ac={'type':db[_0x7b36('0xa0')]['QueryTypes'][_0x7b36('0xa1')],'raw':!![]};var _0x92fcd8=_0x531d5e[_0x7b36('0xa2')]();_0x92fcd8[_0x7b36('0x64')](_0x7b36('0x9f'));_0x92fcd8[_0x7b36('0x64')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7b36('0x79'));if(_0x2793cb['order']){_0x2793cb[_0x7b36('0xa3')][_0x7b36('0x84')](function(_0x3c286b){var _0x315624=_0x3c286b[0x0]==='contactName'?_0x3c286b[0x0]:'i.'+_0x3c286b[0x0];_0x531d5e[_0x7b36('0xa3')](_0x315624,_0x3c286b[0x1]==='DESC'?![]:!![]);});}if(!_[_0x7b36('0x8b')](_0x4be194)){_0x531d5e['having'](_0x1c34a9);_0x92fcd8[_0x7b36('0x61')](_0x7b36('0xa4'),_0x4be194);}BPromise[_0x7b36('0xa5')]()[_0x7b36('0x26')](function(){if(!_0x2b29a8){if(_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x8c')])return;_0x92fcd8[_0x7b36('0x61')](_0x7b36('0xa6'));_0x531d5e['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x29fd1c['user'][_0x7b36('0xa7')]!==_0x7b36('0x43'))return;return _0x29fd1c[_0x7b36('0xa8')][_0x7b36('0xa9')]({'attributes':['id'],'raw':!![]})['then'](function(_0x50cf65){if(_[_0x7b36('0x8b')](_0x50cf65)){_0x92fcd8[_0x7b36('0x61')](_0x7b36('0xaa'));_0x531d5e[_0x7b36('0x61')](_0x7b36('0xaa'));}else{_0x92fcd8[_0x7b36('0x61')](_0x7b36('0xab'),_[_0x7b36('0x46')](_0x50cf65,'id'));_0x531d5e[_0x7b36('0x61')](_0x7b36('0xab'),_['map'](_0x50cf65,'id'));}});})['then'](function(){if(_0x29fd1c[_0x7b36('0xa8')][_0x7b36('0xa7')]===_0x7b36('0x43')&&!_0x2b29a8&&!_0x29fd1c[_0x7b36('0x59')][_0x7b36('0x8c')])return[];return db[_0x7b36('0xac')][_0x7b36('0x59')](_0x92fcd8['toString'](),_0x3386ac);})[_0x7b36('0x26')](function(_0x3c540e){_0x4536c7['count']=_0x3c540e[_0x7b36('0x77')];if(_0x4536c7[_0x7b36('0x37')]===0x0)return[];return db[_0x7b36('0xac')]['query'](_0x3aa6d6[_0x7b36('0xad')](),_0x3386ac)['then'](function(_0x13b94f){_0x3b69d8=_[_0x7b36('0xae')](_0x13b94f,'id');_0x3386ac=_[_0x7b36('0x41')](_0x3386ac,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29fd1c[_0x7b36('0x59')]['fields']){_0x2793cb[_0x7b36('0x5d')][_0x7b36('0x84')](function(_0xc048ac){_0x531d5e['field']('i.'+_0xc048ac);});}else{_0x531d5e[_0x7b36('0x64')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x531d5e[_0x7b36('0x64')](_0x7b36('0xaf'),'Account.key');_0x531d5e[_0x7b36('0x64')](_0x7b36('0xb0'),'Account.mandatoryDisposition');_0x531d5e[_0x7b36('0x64')]('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',_0x7b36('0xb1'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xb2'));_0x531d5e['field'](_0x7b36('0xb3'),_0x7b36('0xb4'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xb5'),_0x7b36('0xb6'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xb7'),_0x7b36('0xb8'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xb9'),'Contact.phone');_0x531d5e[_0x7b36('0x64')](_0x7b36('0xba'),_0x7b36('0xbb'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xbc'),_0x7b36('0xbd'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xbe'),_0x7b36('0xbf'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xc0'),_0x7b36('0xc1'));_0x531d5e[_0x7b36('0x64')](_0x7b36('0xc2'),'TagIds');}if(_0x2793cb['limit'])_0x531d5e['limit'](_0x2793cb[_0x7b36('0x36')]);if(_0x2793cb[_0x7b36('0x34')])_0x531d5e['offset'](_0x2793cb[_0x7b36('0x34')]);return db['sequelize'][_0x7b36('0x59')](_0x531d5e['toString'](),_0x3386ac);})[_0x7b36('0x26')](function(_0x3c92c9){if(_0x3c92c9[_0x7b36('0x77')]>0x0)_0x55bb65['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x7b36('0x46')](_0x3c92c9,'id'));return db[_0x7b36('0xac')]['query'](_0x55bb65[_0x7b36('0xad')](),_0x3386ac)['then'](function(_0x4a9cfe){var _0x436c46=_[_0x7b36('0xc3')](_0x4a9cfe,'ChatInteractionId');var _0x5ee4b3=[];_0x3c92c9[_0x7b36('0x84')](function(_0x5e9c0d){_0x5ee4b3[_0x7b36('0xc4')](updateChatInteraction(_0x5e9c0d,_0x3b69d8,_0x436c46));});return BPromise[_0x7b36('0xc5')](_0x5ee4b3);});});})[_0x7b36('0x26')](function(_0x25596f){_0x4536c7['rows']=_0x25596f;return _0x4536c7;})['then'](respondWithFilteredResult(_0x16e815,_0x2793cb))[_0x7b36('0x2f')](handleError(_0x16e815,null));};exports[_0x7b36('0xc6')]=function(_0x48f10d,_0x36b4a2){var _0x5a6764={'raw':![],'where':{'id':_0x48f10d[_0x7b36('0xc7')]['id']}},_0x2449f3={};_0x2449f3[_0x7b36('0xc8')]=_[_0x7b36('0x5a')](db[_0x7b36('0x55')][_0x7b36('0x56')]);_0x2449f3[_0x7b36('0x59')]=_[_0x7b36('0x5a')](_0x48f10d[_0x7b36('0x59')]);_0x2449f3['filters']=_[_0x7b36('0x5c')](_0x2449f3[_0x7b36('0xc8')],_0x2449f3['query']);_0x5a6764[_0x7b36('0x5d')]=_[_0x7b36('0x5c')](_0x2449f3[_0x7b36('0xc8')],qs[_0x7b36('0x5e')](_0x48f10d[_0x7b36('0x59')]['fields']));_0x5a6764[_0x7b36('0x5d')]=_0x5a6764[_0x7b36('0x5d')]['length']?_0x5a6764[_0x7b36('0x5d')]:_0x2449f3['model'];if(_0x48f10d[_0x7b36('0x59')][_0x7b36('0xc9')]){_0x5a6764['include']=[{'all':!![]}];}_0x5a6764=_[_0x7b36('0x41')]({},_0x5a6764,_0x48f10d['options']);return db[_0x7b36('0x55')][_0x7b36('0x78')](_0x5a6764)[_0x7b36('0x26')](handleEntityNotFound(_0x36b4a2,null))[_0x7b36('0x26')](respondWithResult(_0x36b4a2,null))['catch'](handleError(_0x36b4a2,null));};exports[_0x7b36('0xca')]=function(_0x145577,_0x586def){return db[_0x7b36('0x55')][_0x7b36('0xca')](_0x145577['body'],{})[_0x7b36('0x26')](respondWithResult(_0x586def,0xc9))['catch'](handleError(_0x586def,null));};exports[_0x7b36('0x3c')]=function(_0x415b87,_0x324315){if(_0x415b87['body']['id']){delete _0x415b87[_0x7b36('0x42')]['id'];}return db[_0x7b36('0x55')][_0x7b36('0x78')]({'where':{'id':_0x415b87[_0x7b36('0xc7')]['id']}})['then'](handleEntityNotFound(_0x324315,null))['then'](saveUpdates(_0x415b87[_0x7b36('0x42')],null))['then'](respondWithResult(_0x324315,null))[_0x7b36('0x2f')](handleError(_0x324315,null));};exports['destroy']=function(_0xd8af1e,_0x1aabb1){return db[_0x7b36('0x55')]['find']({'where':{'id':_0xd8af1e[_0x7b36('0xc7')]['id']}})[_0x7b36('0x26')](handleEntityNotFound(_0x1aabb1,null))[_0x7b36('0x26')](removeEntity(_0x1aabb1,null))[_0x7b36('0x2f')](handleError(_0x1aabb1,null));};exports['describe']=function(_0x38b46c,_0x2f0080){return db[_0x7b36('0x55')][_0x7b36('0xcb')]()['then'](respondWithResult(_0x2f0080,null))['catch'](handleError(_0x2f0080,null));};exports[_0x7b36('0xcc')]=function(_0x1a37c8,_0x306ad3){var _0x851d72=_0x1a37c8[_0x7b36('0xc7')]['id'];var _0x43533b;var _0x4b0110;var _0x226902;return db['ChatInteraction'][_0x7b36('0xcd')]({'where':{'id':_0x851d72}})[_0x7b36('0x26')](function(_0x1fbbfc){_0x43533b=_0x1fbbfc;return db['ChatWebsite'][_0x7b36('0xcd')]({'where':{'id':_0x1fbbfc[_0x7b36('0x8c')]},'attributes':['id','vidaooApiKey',_0x7b36('0xce'),_0x7b36('0xcf'),_0x7b36('0xd0'),'vidaooMetadata'],'raw':!![]});})[_0x7b36('0x26')](function(_0x4ab205){if(_0x4ab205&&_0x4ab205[_0x7b36('0xd1')]&&_0x4ab205[_0x7b36('0xce')]){_0x4b0110=_0x4ab205;var _0x44232f={'interaction':{'id':_0x851d72},'agent':{'id':_0x1a37c8[_0x7b36('0xa8')]['id'],'name':_0x1a37c8[_0x7b36('0xa8')][_0x7b36('0x3f')],'fullname':_0x1a37c8['user'][_0x7b36('0x47')],'email':_0x1a37c8['user']['email']},'contact':_0x1a37c8[_0x7b36('0x42')]['contact'],'account':_0x1a37c8['body']['account']};var _0x92caa={'rejectUnauthorized':![],'method':_0x7b36('0xd2'),'url':_0x7b36('0xd3'),'headers':{'X-APIKEY':_0x4ab205[_0x7b36('0xd1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1a37c8['user'][_0x7b36('0xd4')]],'buttons':null,'topic':_0x4b0110[_0x7b36('0xcf')],'note':_[_0x7b36('0xd5')](_0x4b0110['vidaooNote'])?null:getMustacheRender(_0x4b0110[_0x7b36('0xd0')],_0x44232f),'metadata':null},'redirect':_0x7b36('0xd6'),'json':!![]};try{if(!_[_0x7b36('0xd5')](_0x4b0110[_0x7b36('0xd7')])){var _0x36de38=getMustacheRender(_0x4b0110[_0x7b36('0xd7')],_0x44232f);var _0x5d1d44=JSON[_0x7b36('0x8f')](_0x36de38);_0x92caa[_0x7b36('0x42')][_0x7b36('0xd8')]=_0x5d1d44;}}catch(_0x4bd972){throw new db[(_0x7b36('0xa0'))][(_0x7b36('0xd9'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x92caa);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x7b36('0x26')](function(_0x42bfbb){_0x226902=_0x42bfbb;if(_0x226902['id']){var _0x12a2fb={'body':_0x226902['join_url'],'ChatWebsiteId':_0x4b0110['id'],'ChatInteractionId':_0x43533b['id'],'direction':_0x7b36('0xda'),'UserId':_0x1a37c8[_0x7b36('0xa8')]['id']};return db[_0x7b36('0xdb')][_0x7b36('0xca')](_0x12a2fb,{});}else{throw new db[(_0x7b36('0xa0'))][(_0x7b36('0xd9'))](_0x7b36('0xdc'));}})['then'](function(){return _0x43533b[_0x7b36('0xdd')]({'vidaooSessionId':_0x226902['id']});})[_0x7b36('0x26')](respondWithResult(_0x306ad3,null))[_0x7b36('0x2f')](handleError(_0x306ad3,null));};exports[_0x7b36('0xde')]=function(_0x5abbdc,_0x1e3120){if(_0x5abbdc[_0x7b36('0x42')]['id']){delete _0x5abbdc[_0x7b36('0x42')]['id'];}return db['ChatInteraction'][_0x7b36('0x78')]({'where':{'id':_0x5abbdc[_0x7b36('0xc7')]['id']},'include':[{'model':db[_0x7b36('0xdf')],'as':_0x7b36('0xe0')}]})[_0x7b36('0x26')](handleEntityNotFound(_0x1e3120,null))[_0x7b36('0x26')](saveUpdates(_0x5abbdc[_0x7b36('0x42')],null))[_0x7b36('0x26')](respondWithResult(_0x1e3120,null))['catch'](handleError(_0x1e3120,null));};exports[_0x7b36('0xe1')]=function(_0xc57e87,_0x259186,_0x3ed3da){if(_0xc57e87[_0x7b36('0x42')]['id']){delete _0xc57e87[_0x7b36('0x42')]['id'];}return db['ChatInteraction'][_0x7b36('0x78')]({'where':{'id':_0xc57e87['params']['id']}})['then'](function(_0x5a63aa){if(!_0x5a63aa){logger['error'](_0x7b36('0xe2'),'abandon',0x194,_0x7b36('0xe3'));_0x259186[_0x7b36('0x30')](0x194);}else{if(_0x5a63aa[_0x7b36('0x51')]){throw new db['Sequelize'][(_0x7b36('0xd9'))](_0x7b36('0xe4'));}}return _0x5a63aa;})['then'](function(_0x185a23){if(_0x185a23){return _0x185a23['update']({'closed':_0xc57e87[_0x7b36('0x42')][_0x7b36('0x50')],'disposition':_0xc57e87[_0x7b36('0x42')][_0x7b36('0x52')]})[_0x7b36('0x26')](function(_0x2d564b){return _0x2d564b;});}})[_0x7b36('0x26')](function(_0x5c5e2a){return respondWithRpcPromise(_0x7b36('0xe5'),_0x7b36('0xe1'),_0xc57e87[_0x7b36('0x42')],client9004);})[_0x7b36('0x26')](respondWithResult(_0x259186,null))[_0x7b36('0x2f')](handleError(_0x259186,null));};exports[_0x7b36('0xe6')]=function(_0x1ec0b8,_0x29011b,_0x3815d6){_0x1ec0b8[_0x7b36('0x42')][_0x7b36('0x3f')]=_0x1ec0b8[_0x7b36('0xe7')][_0x7b36('0xe8')];_0x1ec0b8[_0x7b36('0x42')][_0x7b36('0xe9')]=_0x1ec0b8['file'][_0x7b36('0xea')];_0x1ec0b8[_0x7b36('0x42')]['type']=_0x1ec0b8[_0x7b36('0xe7')][_0x7b36('0xeb')];return db[_0x7b36('0xec')][_0x7b36('0xca')](_0x1ec0b8[_0x7b36('0x42')])[_0x7b36('0x26')](respondWithResult(_0x29011b,0xc9))[_0x7b36('0x2f')](handleError(_0x29011b,null));};exports[_0x7b36('0xed')]=function(_0xb76e35,_0x365a90,_0x17befc){return db['ChatInteraction']['findOne']({'where':{'id':_0xb76e35[_0x7b36('0xc7')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x365a90,null))[_0x7b36('0x26')](function(_0x1205bf){if(_0x1205bf){if(_0x1205bf[_0x7b36('0x50')]){return _0x365a90['status'](0x193)[_0x7b36('0x33')]({'status':0x193,'message':_0x7b36('0xee')});}return db[_0x7b36('0xec')]['findOne']({'where':{'id':_0xb76e35[_0x7b36('0x59')][_0x7b36('0xef')]},'raw':!![]})[_0x7b36('0x26')](handleEntityNotFound(_0x365a90,null));}})[_0x7b36('0x26')](function(_0x431e70){if(_0x431e70){var _0x264d4b=_0x431e70[_0x7b36('0xf0')]!==null;var _0x114f3f=path[_0x7b36('0xf1')](config[_0x7b36('0xf2')],'server/files/attachments/');if(_0x264d4b){_0x114f3f=path['join'](_0x114f3f,_0x7b36('0xf3'));}var _0x155c13=path[_0x7b36('0xf1')](_0x114f3f,_0x431e70['basename']);return _0x365a90[_0x7b36('0xf4')](_0x155c13);}})['catch'](handleError(_0x365a90,null));};exports[_0x7b36('0xf5')]=function(_0x481c33,_0x738c0){var _0x39a851=null;var _0x49546e=null;var _0x74d638=null;var _0x52fd46=null;if(_0x481c33[_0x7b36('0x42')]['id']){delete _0x481c33[_0x7b36('0x42')]['id'];}if(_0x481c33['body']['mailTranscript']){_0x52fd46=path[_0x7b36('0xf1')](config[_0x7b36('0xf2')],'server/files/chat/upload/',util[_0x7b36('0xf6')](_0x7b36('0xf7'),Date[_0x7b36('0xf8')]()));_0x481c33[_0x7b36('0x42')][_0x7b36('0xf9')]=_0x52fd46;}return db[_0x7b36('0x55')][_0x7b36('0x78')]({'where':{'id':_0x481c33[_0x7b36('0xc7')]['id']},'include':[{'model':db[_0x7b36('0xdb')],'as':_0x7b36('0xfa'),'include':[{'model':db[_0x7b36('0x86')],'as':'User'}]}]})[_0x7b36('0x26')](handleEntityNotFound(_0x738c0,null))[_0x7b36('0x26')](saveUpdates(_0x481c33[_0x7b36('0x42')],null))[_0x7b36('0x26')](function(_0x94e420){if(_0x94e420){_0x39a851=_0x94e420;return db[_0x7b36('0xfb')][_0x7b36('0x78')]({'where':{'id':_0x39a851[_0x7b36('0x8c')]}});}})[_0x7b36('0x26')](function(_0x1ed521){if(_0x1ed521){_0x74d638=_0x1ed521;return db[_0x7b36('0xdf')][_0x7b36('0x78')]({'where':{'id':_0x39a851[_0x7b36('0xfc')]}});}})[_0x7b36('0x26')](function(_0x57edf3){if(_0x57edf3){_0x49546e=_0x57edf3;if(_0x52fd46){var _0xfeae87=null;for(var _0x48d1ec=0x1;_0x48d1ec<_0x39a851[_0x7b36('0xfa')][_0x7b36('0x77')];++_0x48d1ec){_0xfeae87=_0x39a851['Messages'][_0x48d1ec];var _0x237a86=_0xfeae87['UserId']?util[_0x7b36('0xf6')](_0x7b36('0xfd'),_0x74d638[_0x7b36('0xfe')],_0xfeae87['UserId']):_0x7b36('0xff');var _0x56393e=_0x481c33[_0x7b36('0x42')][_0x7b36('0x100')]||util[_0x7b36('0xf6')](_0x7b36('0xfd'),_0x7b36('0x101'),_0xfeae87[_0x7b36('0xfc')]);switch(_0x74d638[_0x7b36('0x102')]){case _0x7b36('0x103'):_0x237a86=_0xfeae87[_0x7b36('0x51')]?util[_0x7b36('0xf6')](_0x7b36('0xfd'),_0x74d638[_0x7b36('0xfe')],_0xfeae87[_0x7b36('0x51')]):_0x7b36('0xff');break;case _0x7b36('0x104'):_0x237a86=_0xfeae87[_0x7b36('0x51')]?_0xfeae87[_0x7b36('0x86')][_0x7b36('0x105')]||_0xfeae87[_0x7b36('0x86')][_0x7b36('0x47')]:_0x7b36('0xff');break;case _0x7b36('0x106'):_0x237a86=_0xfeae87['UserId']?_0xfeae87[_0x7b36('0x86')][_0x7b36('0x47')]:_0x7b36('0xff');break;default:_0x237a86=_0xfeae87[_0x7b36('0x51')]?util[_0x7b36('0xf6')](_0x7b36('0xfd'),_0x74d638['agentAlias'],_0xfeae87[_0x7b36('0x51')]):_0x7b36('0xff');}var _0xa15c6f=util[_0x7b36('0xf6')](_0x7b36('0x107'),moment(_0xfeae87[_0x7b36('0x108')])[_0x7b36('0xf6')](_0x7b36('0x109')),_0xfeae87[_0x7b36('0x10a')]==='in'?_0x56393e:_0x237a86,_0xfeae87['body']);if(!_0xfeae87['secret']){fs[_0x7b36('0x10b')](_0x52fd46,_0xa15c6f);}}return db['MailAccount'][_0x7b36('0xcd')]({'where':{'service':!![]},'include':[{'model':db[_0x7b36('0x10c')],'as':_0x7b36('0x10d'),'raw':!![]}]});}}})['then'](function(_0x126277){if(_0x126277&&_0x126277[_0x7b36('0x10d')]&&_0x481c33[_0x7b36('0x42')]){var _0x591308={'tls':{'rejectUnauthorized':![]}};if(_0x126277[_0x7b36('0x10d')][_0x7b36('0x10e')]){_0x591308[_0x7b36('0x10e')]=_0x126277[_0x7b36('0x10d')]['service'];}else{_0x591308['host']=_0x126277[_0x7b36('0x10d')][_0x7b36('0x10f')];_0x591308[_0x7b36('0x110')]=_0x126277[_0x7b36('0x10d')]['port'];_0x591308[_0x7b36('0x111')]=_0x126277[_0x7b36('0x10d')][_0x7b36('0x111')];}if(_0x126277['Smtp'][_0x7b36('0x112')]){_0x591308['auth']={'user':_0x126277[_0x7b36('0x10d')][_0x7b36('0xa8')],'pass':_0x126277[_0x7b36('0x10d')]['pass']};}return respondWithRpcPromise(_0x7b36('0x113'),_0x7b36('0x114'),{'account':_0x591308,'message':{'from':util[_0x7b36('0xf6')](_0x7b36('0x115'),_0x126277['name'],_0x126277['email']||_0x126277[_0x7b36('0x10d')]['user']),'to':_0x481c33[_0x7b36('0x42')]['mailTranscript'],'subject':_0x7b36('0x116'),'text':util[_0x7b36('0xf6')](_0x7b36('0x117'),_0x481c33['body'][_0x7b36('0x118')]),'attachments':[{'path':_0x52fd46}]}})[_0x7b36('0x26')](function(){return _0x39a851;})[_0x7b36('0x2f')](function(_0x502a5b){console[_0x7b36('0x2c')](_0x502a5b);});}else{return _0x39a851;}})[_0x7b36('0x26')](respondWithStatusCode(_0x738c0,0xc8))['catch'](handleError(_0x738c0,null));};exports['addMessage']=function(_0x5b60ac,_0x2b622b,_0xcae154){return db[_0x7b36('0xdb')]['find']({'where':{'id':_0x5b60ac[_0x7b36('0xc7')]['id']}})['then'](handleEntityNotFound(_0x2b622b,null))[_0x7b36('0x26')](function(_0x2d529c){if(_0x2d529c){return _0x2d529c[_0x7b36('0x119')](_0x5b60ac[_0x7b36('0x42')][_0x7b36('0x11a')],_[_0x7b36('0x11b')](_0x5b60ac['body'],[_0x7b36('0x11a'),'id'])||{});}})['then'](respondWithResult(_0x2b622b,null))[_0x7b36('0x2f')](handleError(_0x2b622b,null));};exports[_0x7b36('0x11c')]=function(_0x55aa2a,_0x26388b,_0x34a741){var _0x58afb8={'raw':![],'where':{}};var _0x5703ca={};var _0x147b4f={'count':0x0,'rows':[]};return db[_0x7b36('0x55')][_0x7b36('0xcd')]({'where':{'id':_0x55aa2a[_0x7b36('0xc7')]['id']}})['then'](handleEntityNotFound(_0x26388b,null))[_0x7b36('0x26')](function(_0x5e2092){if(_0x5e2092){_0x5703ca[_0x7b36('0xc8')]=_[_0x7b36('0x5a')](db[_0x7b36('0xdb')][_0x7b36('0x56')]);_0x5703ca[_0x7b36('0x59')]=_[_0x7b36('0x5a')](_0x55aa2a[_0x7b36('0x59')]);_0x5703ca['filters']=_[_0x7b36('0x5c')](_0x5703ca[_0x7b36('0xc8')],_0x5703ca[_0x7b36('0x59')]);_0x58afb8[_0x7b36('0x5d')]=_[_0x7b36('0x5c')](_0x5703ca[_0x7b36('0xc8')],qs['fields'](_0x55aa2a[_0x7b36('0x59')][_0x7b36('0x5e')]));_0x58afb8['attributes']=_0x58afb8[_0x7b36('0x5d')][_0x7b36('0x77')]?_0x58afb8[_0x7b36('0x5d')]:_0x5703ca[_0x7b36('0xc8')];if(!_0x55aa2a[_0x7b36('0x59')][_0x7b36('0x11d')](_0x7b36('0x5f'))){_0x58afb8['limit']=qs[_0x7b36('0x36')](_0x55aa2a[_0x7b36('0x59')][_0x7b36('0x36')]);_0x58afb8[_0x7b36('0x34')]=qs[_0x7b36('0x34')](_0x55aa2a[_0x7b36('0x59')][_0x7b36('0x34')]);}_0x58afb8[_0x7b36('0xa3')]=qs['sort'](_0x55aa2a[_0x7b36('0x59')]['sort']);_0x58afb8[_0x7b36('0x61')]=qs[_0x7b36('0x5b')](_[_0x7b36('0x62')](_0x55aa2a['query'],_0x5703ca[_0x7b36('0x5b')]));_0x58afb8[_0x7b36('0x61')][_0x7b36('0x11e')]=_0x5e2092['id'];if(_0x55aa2a[_0x7b36('0x59')][_0x7b36('0x9a')]){_0x58afb8['where']=_[_0x7b36('0x41')](_0x58afb8[_0x7b36('0x61')],{'$or':_[_0x7b36('0x46')](_0x58afb8['attributes'],function(_0x5b74a5){var _0x1acdb2={};_0x1acdb2[_0x5b74a5]={'$like':'%'+_0x55aa2a[_0x7b36('0x59')][_0x7b36('0x9a')]+'%'};return _0x1acdb2;})});}if(_0x55aa2a['query'][_0x7b36('0x8e')]){var _0x5a0a61=_0x55aa2a['query'][_0x7b36('0x8e')][_0x7b36('0x49')](',');var _0x585e0e={};_0x585e0e[_0x5a0a61[0x0]]={'$gte':moment(_0x5a0a61[0x1])[_0x7b36('0xf6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x58afb8['where']=_[_0x7b36('0x41')](_0x58afb8[_0x7b36('0x61')],_0x585e0e);}_0x58afb8=_[_0x7b36('0x41')]({},_0x58afb8,_0x55aa2a[_0x7b36('0x11f')]);return db['ChatMessage'][_0x7b36('0x37')]({'where':_0x58afb8[_0x7b36('0x61')]})[_0x7b36('0x26')](function(_0x10b525){_0x147b4f[_0x7b36('0x37')]=_0x10b525;if(_0x55aa2a['query']['includeAll']){_0x58afb8[_0x7b36('0x120')]=[{'all':!![]}];}return db[_0x7b36('0xdb')][_0x7b36('0x121')](_0x58afb8);})[_0x7b36('0x26')](function(_0x1628a7){_0x147b4f[_0x7b36('0x122')]=_0x1628a7;return _0x147b4f;});}})['then'](respondWithFilteredResult(_0x26388b,_0x58afb8))[_0x7b36('0x2f')](handleError(_0x26388b,null));};exports[_0x7b36('0x123')]=function(_0x285804,_0x5a443e,_0x5b1d2c){var _0x2a33be={'where':{}},_0x3daa4d={},_0xc1f8b1={'count':0x0,'rows':[]};return db[_0x7b36('0x55')]['findOne']({'where':{'id':_0x285804['params']['id']}})['then'](handleEntityNotFound(_0x5a443e,null))[_0x7b36('0x26')](function(_0x47830d){if(_0x47830d){_0x3daa4d['model']=_['keys'](db['ChatMessage'][_0x7b36('0x56')]);_0x3daa4d[_0x7b36('0x59')]=_[_0x7b36('0x5a')](_0x285804[_0x7b36('0x59')]);_0x3daa4d['filters']=_['intersection'](_0x3daa4d[_0x7b36('0xc8')],_0x3daa4d['query']);_0x2a33be['attributes']=_[_0x7b36('0x5c')](_0x3daa4d['model'],qs[_0x7b36('0x5e')](_0x285804[_0x7b36('0x59')]['fields']));_0x2a33be['attributes']=_0x2a33be[_0x7b36('0x5d')][_0x7b36('0x77')]?_0x2a33be[_0x7b36('0x5d')]:_0x3daa4d[_0x7b36('0xc8')];if(!_0x285804[_0x7b36('0x59')][_0x7b36('0x11d')]('nolimit')){_0x2a33be[_0x7b36('0x36')]=qs[_0x7b36('0x36')](_0x285804[_0x7b36('0x59')][_0x7b36('0x36')]);_0x2a33be['offset']=qs[_0x7b36('0x34')](_0x285804[_0x7b36('0x59')][_0x7b36('0x34')]);}_0x2a33be[_0x7b36('0xa3')]=qs[_0x7b36('0x60')](_0x285804[_0x7b36('0x59')][_0x7b36('0x60')]);_0x2a33be[_0x7b36('0x61')]=qs[_0x7b36('0x5b')](_[_0x7b36('0x62')](_0x285804[_0x7b36('0x59')],_0x3daa4d['filters']));_0x2a33be[_0x7b36('0x61')][_0x7b36('0x11e')]=_0x47830d['id'];if(_0x285804[_0x7b36('0x59')][_0x7b36('0x9a')]){_0x2a33be[_0x7b36('0x61')]=_[_0x7b36('0x41')](_0x2a33be[_0x7b36('0x61')],{'$or':_[_0x7b36('0x46')](_0x2a33be['attributes'],function(_0x1f8565){var _0x292eb5={};_0x292eb5[_0x1f8565]={'$like':'%'+_0x285804['query'][_0x7b36('0x9a')]+'%'};return _0x292eb5;})});}_0x2a33be[_0x7b36('0x61')][_0x7b36('0x124')]=![];if(_0x285804[_0x7b36('0x59')]['id']){_0x2a33be[_0x7b36('0x61')]['id']={'$gt':_0x285804[_0x7b36('0x59')]['id']};}_0x2a33be=_['merge']({},_0x2a33be,_0x285804['options']);return db['ChatMessage'][_0x7b36('0x37')]({'where':_0x2a33be[_0x7b36('0x61')]})['then'](function(_0x302b42){_0xc1f8b1[_0x7b36('0x37')]=_0x302b42;_0x2a33be[_0x7b36('0x120')]=[];if(_0x285804[_0x7b36('0x59')][_0x7b36('0x125')]){_0x2a33be[_0x7b36('0x120')][_0x7b36('0xc4')]({'model':db[_0x7b36('0x86')],'as':_0x7b36('0x86'),'attributes':['id',_0x7b36('0x47'),_0x7b36('0x105')]});}if(_0x285804[_0x7b36('0x59')][_0x7b36('0xc9')]){_0x2a33be['include']=[{'all':!![]}];}return db[_0x7b36('0xdb')][_0x7b36('0x121')](_0x2a33be);})['then'](function(_0x599bbc){_0xc1f8b1[_0x7b36('0x122')]=_0x599bbc;return _0xc1f8b1;});}})['then'](respondWithFilteredResult(_0x5a443e,_0x2a33be))[_0x7b36('0x2f')](handleError(_0x5a443e,null));};exports['addTags']=function(_0x5d0abe,_0x98fc9e,_0x1ad614){return db[_0x7b36('0x55')][_0x7b36('0x78')]({'where':{'id':_0x5d0abe[_0x7b36('0xc7')]['id']}})[_0x7b36('0x26')](handleEntityNotFound(_0x98fc9e,null))['then'](function(_0x39ec7b){if(_0x39ec7b){return _0x39ec7b[_0x7b36('0x126')](_0x5d0abe[_0x7b36('0x42')][_0x7b36('0x11a')],_[_0x7b36('0x11b')](_0x5d0abe['body'],['ids','id'])||{})[_0x7b36('0x127')](function(){return db[_0x7b36('0x83')][_0x7b36('0x121')]({'attributes':['id',_0x7b36('0x3f'),_0x7b36('0x128')],'where':{'id':_0x5d0abe[_0x7b36('0x42')][_0x7b36('0x11a')]}});})[_0x7b36('0x26')](function(_0x7e8b7){socket[_0x7b36('0x129')](_0x7b36('0x12a'),{'id':Number(_0x5d0abe[_0x7b36('0xc7')]['id']),'tags':_0x7e8b7||[]});return{'id':Number(_0x5d0abe[_0x7b36('0xc7')]['id']),'tags':_0x7e8b7||[]};});}})['then'](respondWithResult(_0x98fc9e,null))[_0x7b36('0x2f')](handleError(_0x98fc9e,null));};exports['removeTags']=function(_0x29f478,_0x2227f6,_0x45efc6){return db[_0x7b36('0x55')][_0x7b36('0x78')]({'where':{'id':_0x29f478[_0x7b36('0xc7')]['id']}})['then'](handleEntityNotFound(_0x2227f6,null))['then'](function(_0x7fdd6c){if(_0x7fdd6c){return _0x7fdd6c[_0x7b36('0x12b')](_0x29f478[_0x7b36('0x59')][_0x7b36('0x11a')]);}})[_0x7b36('0x26')](respondWithStatusCode(_0x2227f6,null))[_0x7b36('0x2f')](handleError(_0x2227f6,null));};exports[_0x7b36('0xf4')]=function(_0x13f81d,_0x1b1efc){var _0x1697cc=moment()[_0x7b36('0x12c')]()[_0x7b36('0xad')]();var _0x36650a=path['join'](config[_0x7b36('0xf2')],_0x7b36('0x12d'),_0x7b36('0x12e'),'tmp');var _0x5bfbe1=path['join'](config[_0x7b36('0xf2')],_0x7b36('0x12d'),_0x7b36('0x12e'),_0x7b36('0x12f'));var _0x1e3989=path['join'](_0x36650a,_0x1697cc);var _0x1fff9b=util['format'](_0x7b36('0x130'),_0x13f81d[_0x7b36('0xc7')]['id'],_0x1697cc);var _0x3c1300=path[_0x7b36('0xf1')](_0x36650a,_0x1fff9b);var _0x53a4f3=[];_0x53a4f3['push']({'model':db[_0x7b36('0x86')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x53a4f3[_0x7b36('0xc4')]({'model':db['CmContact'],'as':_0x7b36('0xe0'),'attributes':['id',_0x7b36('0x131'),'lastName'],'raw':!![]});if(_0x13f81d[_0x7b36('0x59')][_0x7b36('0x12f')]){_0x53a4f3['push']({'model':db['Attachment'],'as':_0x7b36('0xec'),'raw':!![]});}var _0x236b3a=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id','body',_0x7b36('0x108'),_0x7b36('0x10a'),'secret',_0x7b36('0x95')],'include':_0x53a4f3}];_0x236b3a['push']({'model':db[_0x7b36('0xfb')],'as':_0x7b36('0x132'),'attributes':['id',_0x7b36('0x3f')]});_0x236b3a[_0x7b36('0xc4')]({'model':db[_0x7b36('0x86')],'as':'Owner','attributes':['id',_0x7b36('0x47')]});return db[_0x7b36('0x55')][_0x7b36('0x78')]({'where':{'id':_0x13f81d[_0x7b36('0xc7')]['id']},'include':_0x236b3a})[_0x7b36('0x26')](handleEntityNotFound(_0x1b1efc,null))[_0x7b36('0x26')](function(_0x4a3f33){if(_0x4a3f33){var _0x4e87a5=_0x4a3f33[_0x7b36('0x133')]({'plain':!![]});fs[_0x7b36('0x134')](_0x1e3989);var _0x5dac68={'channel':'Chat','account':_0x4e87a5[_0x7b36('0x132')][_0x7b36('0x3f')],'agent':_0x4e87a5[_0x7b36('0x135')]?_0x4e87a5[_0x7b36('0x135')][_0x7b36('0x47')]:_0x7b36('0x136'),'createdAt':moment(_0x4e87a5[_0x7b36('0x108')])[_0x7b36('0xf6')](_0x7b36('0x137'))[_0x7b36('0xad')](),'closedAt':_0x4e87a5[_0x7b36('0x50')]?moment(_0x4e87a5[_0x7b36('0x138')])[_0x7b36('0xf6')](_0x7b36('0x137'))['toString']():'','disposition':_0x4e87a5[_0x7b36('0x52')],'chatInfo':{'browser':_0x4e87a5[_0x7b36('0x139')],'os':_0x4e87a5['osName'],'referer':_0x4e87a5[_0x7b36('0x13a')],'customerIp':_0x4e87a5[_0x7b36('0x13b')],'customerPort':_0x4e87a5[_0x7b36('0x13c')]?_0x4e87a5[_0x7b36('0x13c')]:_0x7b36('0x136')},'messages':_(_0x4e87a5[_0x7b36('0xfa')])[_0x7b36('0x13d')]()[_0x7b36('0x9a')]({'secret':![]})[_0x7b36('0x46')](function(_0x36072c){if(_0x36072c[_0x7b36('0xec')]){var _0x1e8d77=path['join'](_0x5bfbe1,_0x36072c[_0x7b36('0xec')][_0x7b36('0xe9')]);if(fs[_0x7b36('0x13e')](_0x1e8d77)){fs[_0x7b36('0x13f')](_0x1e8d77)[_0x7b36('0x140')](fs[_0x7b36('0x141')](path[_0x7b36('0xf1')](_0x1e3989,_0x36072c[_0x7b36('0xec')][_0x7b36('0xe9')])));}}return{'date':moment(_0x36072c[_0x7b36('0x108')])['format'](_0x7b36('0x137'))[_0x7b36('0xad')](),'sender':_0x36072c[_0x7b36('0x10a')]===_0x7b36('0xda')?_0x36072c[_0x7b36('0x86')]?_0x36072c[_0x7b36('0x86')][_0x7b36('0x47')]:_0x7b36('0xff'):_0x36072c['Contact'][_0x7b36('0x131')]+(_0x36072c[_0x7b36('0xe0')]['lastName']?'\x20'+_0x36072c[_0x7b36('0xe0')][_0x7b36('0x142')]:''),'body':_0x36072c[_0x7b36('0xec')]?_0x36072c[_0x7b36('0xec')][_0x7b36('0xe9')]:_0x36072c[_0x7b36('0x42')],'direction':_0x36072c[_0x7b36('0x10a')]===_0x7b36('0xda')?'A':'C','secret':_0x36072c['secret'],'read':_0x36072c['read'],'attachment':_0x36072c['Attachment']};})[_0x7b36('0x80')]()};return ejs[_0x7b36('0x143')](path[_0x7b36('0xf1')](config['root'],_0x7b36('0x12d'),'views',_0x7b36('0x144')),{'interaction':_0x5dac68})['then'](function(_0x326ef4){var _0x5f504b=path['join'](_0x1e3989,_0x7b36('0x145')+_0x4e87a5['id']+'-'+_0x1697cc+'.pdf');var _0x57c1c3={'path':_0x5f504b,'channel':_0x7b36('0x146'),'interactionId':_0x4e87a5['id']};return pdf[_0x7b36('0x147')](_0x326ef4,_0x57c1c3);})[_0x7b36('0x26')](function(){return new BPromise(function(_0x5a2261,_0x23f1c7){zipdir(_0x1e3989,{'saveTo':_0x3c1300},function(_0x1c2834,_0x193308){if(_0x1c2834)return _0x23f1c7(_0x1c2834);return _0x5a2261(_0x193308);});})[_0x7b36('0x26')](function(){return new BPromise(function(_0x2138d0,_0x594115){rimraf(_0x1e3989,function(_0x365dda){if(_0x365dda)_0x594115(_0x365dda);return _0x2138d0();});});})['then'](function(){return _0x1b1efc[_0x7b36('0xf4')](_0x3c1300,_0x1fff9b,function(_0x996c49){if(_0x996c49){console[_0x7b36('0x148')](_0x7b36('0x149'),_0x996c49);}else{fs[_0x7b36('0x14a')](_0x3c1300);}});});});}else{return _0x1b1efc['sendStatus'](0xc8);}})[_0x7b36('0x2f')](handleError(_0x1b1efc,null));}; \ No newline at end of file +var _0xbeb8=['Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','customerIp','customerPort','tail','createReadStream','pipe','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','client','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','name','send','body','contact','agent','interaction','account','map','fullname','TagIds','Tags','split','push','talking','answered','unmanaged','abandoned','total','closed','UserId','waiting','disposition','index','ChatInteraction','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','field','color','from','select','u.id','u.fullname','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','includeAll','include','merge','options','create','params','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','root','format','transcript-%s.txt','Messages','agentAlias','customer','%s%d','Visitor','agentIdentifier','website_alias','System','agent_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','nolimit','findAll','getMyMessages','includeAgent','alias','addTags','spread','emit','removeTags','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Chat'];(function(_0x4b436c,_0x233f48){var _0x543ec3=function(_0x26ec96){while(--_0x26ec96){_0x4b436c['push'](_0x4b436c['shift']());}};_0x543ec3(++_0x233f48);}(_0xbeb8,0x156));var _0x8beb=function(_0x57719e,_0x539fe6){_0x57719e=_0x57719e-0x0;var _0x53ef6b=_0xbeb8[_0x57719e];return _0x53ef6b;};'use strict';var emlformat=require(_0x8beb('0x0'));var rimraf=require(_0x8beb('0x1'));var zipdir=require(_0x8beb('0x2'));var jsonpatch=require(_0x8beb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8beb('0x4'));var Mustache=require(_0x8beb('0x5'));var util=require(_0x8beb('0x6'));var path=require(_0x8beb('0x7'));var sox=require(_0x8beb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8beb('0x9'));var _=require(_0x8beb('0xa'));var squel=require(_0x8beb('0xb'));var crypto=require('crypto');var jsforce=require(_0x8beb('0xc'));var deskjs=require(_0x8beb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8beb('0xe'));var Papa=require(_0x8beb('0xf'));var Redis=require(_0x8beb('0x10'));var authService=require(_0x8beb('0x11'));var qs=require(_0x8beb('0x12'));var as=require(_0x8beb('0x13'));var pdf=require(_0x8beb('0x14'));var hardwareService=require(_0x8beb('0x15'));var logger=require(_0x8beb('0x16'))('api');var utils=require(_0x8beb('0x17'));var config=require(_0x8beb('0x18'));var licenseUtil=require(_0x8beb('0x19'));var db=require('../../mysqldb')['db'];config[_0x8beb('0x1a')]=_['defaults'](config[_0x8beb('0x1a')],{'host':_0x8beb('0x1b'),'port':0x18eb});var socket=require(_0x8beb('0x1c'))(new Redis(config[_0x8beb('0x1a')]));require(_0x8beb('0x1d'))[_0x8beb('0x1e')](socket);var jayson=require(_0x8beb('0x1f'));var client=jayson['client'][_0x8beb('0x20')]({'port':0x232b});var client9004=jayson[_0x8beb('0x21')][_0x8beb('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x343bb9,_0x5069b1,_0x25f59a,_0x9e85ab){return new BPromise(function(_0x58ac6f,_0x162af0){var _0x44b0e4=_0x9e85ab||client;return _0x44b0e4[_0x8beb('0x22')](_0x343bb9,_0x25f59a)[_0x8beb('0x23')](function(_0x1e3d4f){logger['info'](_0x8beb('0x24'),_0x5069b1,_0x8beb('0x25'));logger[_0x8beb('0x26')](_0x8beb('0x27'),_0x5069b1,_0x8beb('0x25'),JSON[_0x8beb('0x28')](_0x1e3d4f));if(_0x1e3d4f[_0x8beb('0x29')]){if(_0x1e3d4f[_0x8beb('0x29')][_0x8beb('0x2a')]===0x1f4){logger[_0x8beb('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x5069b1,_0x1e3d4f[_0x8beb('0x29')][_0x8beb('0x2b')]);return _0x162af0(_0x1e3d4f['error']['message']);}logger[_0x8beb('0x29')](_0x8beb('0x24'),_0x5069b1,_0x1e3d4f[_0x8beb('0x29')][_0x8beb('0x2b')]);return _0x58ac6f(_0x1e3d4f[_0x8beb('0x29')][_0x8beb('0x2b')]);}else{logger[_0x8beb('0x2c')](_0x8beb('0x24'),_0x5069b1,_0x8beb('0x25'));_0x58ac6f(_0x1e3d4f[_0x8beb('0x2d')][_0x8beb('0x2b')]);}})[_0x8beb('0x2e')](function(_0x3c3e0e){logger[_0x8beb('0x29')](_0x8beb('0x24'),_0x5069b1,_0x3c3e0e);_0x162af0(_0x3c3e0e);});});}function respondWithStatusCode(_0x4e0008,_0xd7260){_0xd7260=_0xd7260||0xcc;return function(_0x2de409){if(_0x2de409){return _0x4e0008[_0x8beb('0x2f')](_0xd7260);}return _0x4e0008[_0x8beb('0x30')](_0xd7260)[_0x8beb('0x31')]();};}function respondWithResult(_0x5750be,_0xb6d4e3){_0xb6d4e3=_0xb6d4e3||0xc8;return function(_0x401bb8){if(_0x401bb8){return _0x5750be[_0x8beb('0x30')](_0xb6d4e3)[_0x8beb('0x32')](_0x401bb8);}};}function respondWithFilteredResult(_0x2dfbc6,_0x52d5d0){return function(_0x4abc2c){if(_0x4abc2c){var _0x1760ff=typeof _0x52d5d0['offset']===_0x8beb('0x33')&&typeof _0x52d5d0[_0x8beb('0x34')]===_0x8beb('0x33');var _0x11d25c=_0x4abc2c[_0x8beb('0x35')];var _0x4d13cb=_0x1760ff?0x0:_0x52d5d0[_0x8beb('0x36')];var _0x29bc89=_0x1760ff?_0x4abc2c['count']:_0x52d5d0[_0x8beb('0x36')]+_0x52d5d0['limit'];var _0x53af48;if(_0x29bc89>=_0x11d25c){_0x29bc89=_0x11d25c;_0x53af48=0xc8;}else{_0x53af48=0xce;}_0x2dfbc6['status'](_0x53af48);return _0x2dfbc6[_0x8beb('0x37')](_0x8beb('0x38'),_0x4d13cb+'-'+_0x29bc89+'/'+_0x11d25c)[_0x8beb('0x32')](_0x4abc2c);}return null;};}function patchUpdates(_0x40f70a){return function(_0x5179c3){try{jsonpatch['apply'](_0x5179c3,_0x40f70a,!![]);}catch(_0x52b69f){return BPromise[_0x8beb('0x39')](_0x52b69f);}return _0x5179c3[_0x8beb('0x3a')]();};}function saveUpdates(_0x167748,_0x48ca0f){return function(_0x2e77ea){if(_0x2e77ea){return _0x2e77ea[_0x8beb('0x3b')](_0x167748)[_0x8beb('0x23')](function(_0x45aef5){return _0x45aef5;});}return null;};}function removeEntity(_0x46dcc8,_0x7a1ad9){return function(_0x10534c){if(_0x10534c){return _0x10534c['destroy']()['then'](function(){_0x46dcc8['status'](0xcc)[_0x8beb('0x31')]();});}};}function handleEntityNotFound(_0x33e858,_0x5f4000){return function(_0x4da8b5){if(!_0x4da8b5){_0x33e858[_0x8beb('0x2f')](0x194);}return _0x4da8b5;};}function handleError(_0x36865c,_0xa0963e){_0xa0963e=_0xa0963e||0x1f4;return function(_0x5aa3c9){logger[_0x8beb('0x29')](_0x5aa3c9['stack']);if(_0x5aa3c9['name']){delete _0x5aa3c9[_0x8beb('0x3c')];}_0x36865c[_0x8beb('0x30')](_0xa0963e)[_0x8beb('0x3d')](_0x5aa3c9);};}function getMustacheRender(_0x23a58f,_0x2e0c74){return Mustache['render'](_0x23a58f,_['merge'](_0x2e0c74[_0x8beb('0x3e')],{'contact':_0x2e0c74[_0x8beb('0x3f')],'message':_0x2e0c74[_0x8beb('0x2b')],'agent':_0x2e0c74[_0x8beb('0x40')],'interaction':_0x2e0c74[_0x8beb('0x41')],'account':_0x2e0c74[_0x8beb('0x42')]}))||'';}function getInteractionUsers(_0x4bf006,_0x11acf9){return new BPromise(function(_0x417460,_0x2362af){try{if(_0x11acf9[_0x4bf006['id']]){_0x4bf006['Users']=_[_0x8beb('0x43')](_0x11acf9[_0x4bf006['id']],function(_0x83b9f3){return{'id':_0x83b9f3['id'],'fullname':_0x83b9f3[_0x8beb('0x44')]};});}}catch(_0x5abead){_0x2362af(_0x5abead);}_0x417460(_0x4bf006);});}function getInteractionTags(_0x5e4987,_0x4e165b){return new BPromise(function(_0x8fd1d2,_0x10bc36){try{if(_0x5e4987[_0x8beb('0x45')]){_0x5e4987[_0x8beb('0x46')]=[];_0x5e4987['TagIds'][_0x8beb('0x47')](',')['forEach'](function(_0x32f9af){_0x5e4987[_0x8beb('0x46')][_0x8beb('0x48')](_0x4e165b[_0x32f9af]);});}delete _0x5e4987[_0x8beb('0x45')];}catch(_0xabe18){_0x10bc36(_0xabe18);}_0x8fd1d2(_0x5e4987);});}function updateChatInteraction(_0x25442c,_0xb749cf,_0x360f44){return new BPromise(function(_0x3e02e0,_0x1e480b){return getInteractionUsers(_0x25442c,_0x360f44)[_0x8beb('0x23')](function(_0x7de347){return getInteractionTags(_0x7de347,_0xb749cf);})['then'](function(_0x21bc34){return getStateInteraction(_0x21bc34);})[_0x8beb('0x23')](function(_0x54ce4e){_0x3e02e0(_0x54ce4e);})['catch'](function(_0x2292f7){_0x1e480b(_0x2292f7);});});}function getStateInteraction(_0x4b858f){return new BPromise(function(_0x516bf1){_0x4b858f['waiting']=0x0;_0x4b858f[_0x8beb('0x49')]=0x0;_0x4b858f[_0x8beb('0x4a')]=0x0;_0x4b858f[_0x8beb('0x4b')]=0x0;_0x4b858f[_0x8beb('0x4c')]=0x0;_0x4b858f[_0x8beb('0x4d')]=0x0;if(!_0x4b858f[_0x8beb('0x4e')]&&!_0x4b858f[_0x8beb('0x4f')]){_0x4b858f[_0x8beb('0x50')]+=0x1;}if(!_0x4b858f[_0x8beb('0x4e')]&&_0x4b858f[_0x8beb('0x4f')]){_0x4b858f[_0x8beb('0x49')]+=0x1;if(_0x4b858f[_0x8beb('0x50')]){_0x4b858f[_0x8beb('0x50')]-=0x1;}}if(_0x4b858f[_0x8beb('0x4e')]&&_0x4b858f[_0x8beb('0x51')]===_0x8beb('0x4c')){_0x4b858f[_0x8beb('0x4c')]+=0x1;if(_0x4b858f[_0x8beb('0x50')]){_0x4b858f[_0x8beb('0x50')]-=0x1;}}else if(_0x4b858f[_0x8beb('0x4e')]&&!_0x4b858f[_0x8beb('0x4f')]&&_0x4b858f[_0x8beb('0x51')]){_0x4b858f['unmanaged']+=0x1;if(_0x4b858f[_0x8beb('0x50')]){_0x4b858f[_0x8beb('0x50')]-=0x1;}}else if(_0x4b858f[_0x8beb('0x4e')]&&_0x4b858f['UserId']){_0x4b858f[_0x8beb('0x4a')]+=0x1;if(_0x4b858f['talking']){_0x4b858f[_0x8beb('0x49')]-=0x1;}}_0x4b858f[_0x8beb('0x4d')]+=0x1;_0x516bf1(_0x4b858f);});}exports[_0x8beb('0x52')]=function(_0x3ce1d1,_0x5cc404){var _0x3c7cf2={},_0x3c5b0e={},_0x3a44e7={'count':0x0,'rows':[]};var _0x153fc6=_[_0x8beb('0x43')](db[_0x8beb('0x53')][_0x8beb('0x54')],function(_0x285621){return{'name':_0x285621[_0x8beb('0x55')],'type':_0x285621[_0x8beb('0x56')][_0x8beb('0x57')]};});_0x3c5b0e['model']=_[_0x8beb('0x43')](_0x153fc6,_0x8beb('0x3c'));_0x3c5b0e['query']=_[_0x8beb('0x58')](_0x3ce1d1[_0x8beb('0x59')]);_0x3c5b0e[_0x8beb('0x5a')]=_[_0x8beb('0x5b')](_0x3c5b0e['model'],_0x3c5b0e[_0x8beb('0x59')]);_0x3c7cf2[_0x8beb('0x5c')]=_['intersection'](_0x3c5b0e[_0x8beb('0x5d')],qs['fields'](_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x5e')]));_0x3c7cf2[_0x8beb('0x5c')]=_0x3c7cf2[_0x8beb('0x5c')][_0x8beb('0x5f')]?_0x3c7cf2['attributes']:_0x3c5b0e[_0x8beb('0x5d')];if(!_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x60')]('nolimit')){_0x3c7cf2[_0x8beb('0x34')]=qs[_0x8beb('0x34')](_0x3ce1d1['query'][_0x8beb('0x34')]);_0x3c7cf2['offset']=qs['offset'](_0x3ce1d1['query'][_0x8beb('0x36')]);}_0x3c7cf2[_0x8beb('0x61')]=qs[_0x8beb('0x62')](_0x3ce1d1[_0x8beb('0x59')]['sort']);_0x3c7cf2[_0x8beb('0x63')]=qs['filters'](_[_0x8beb('0x64')](_0x3ce1d1['query'],_0x3c5b0e[_0x8beb('0x5a')]),_0x153fc6);var _0x62808b=[];var _0x20c8a9=squel['select']()[_0x8beb('0x65')]('id')[_0x8beb('0x65')](_0x8beb('0x3c'))[_0x8beb('0x65')](_0x8beb('0x66'))[_0x8beb('0x67')]('tools_tags');var _0xf22110=squel[_0x8beb('0x68')]()[_0x8beb('0x65')](_0x8beb('0x69'))[_0x8beb('0x65')](_0x8beb('0x6a'))[_0x8beb('0x65')]('ui.ChatInteractionId')[_0x8beb('0x67')](_0x8beb('0x6b'),'ui')[_0x8beb('0x6c')]('users','u',_0x8beb('0x6d'));var _0x45d2d4=squel[_0x8beb('0x68')]()[_0x8beb('0x67')](_0x8beb('0x6e'),'i')[_0x8beb('0x6c')](_0x8beb('0x6f'),'c',_0x8beb('0x70'))['left_join']('users','o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0x8beb('0x71'))[_0x8beb('0x6c')](_0x8beb('0x72'),'me',_0x8beb('0x73'))[_0x8beb('0x6c')](_0x8beb('0x74'),'it',_0x8beb('0x75'))['left_join'](_0x8beb('0x76'),'t','t.id\x20=\x20it.TagId');var _0x42dedc=squel['expr']();var _0x344e25=[];var _0x457f21=squel[_0x8beb('0x77')]();var _0x44a244;if(_0x3ce1d1['query'][_0x8beb('0x78')]){_0x44a244=as['parseSearch'](_0x3ce1d1[_0x8beb('0x59')]['search']);var _0x540214=_0x44a244['sqlOperator'];for(var _0x3ba95a=0x0;_0x3ba95a<_0x44a244[_0x8beb('0x79')][_0x8beb('0x5f')];_0x3ba95a++){var _0x23ddfc=_0x44a244['conditions'][_0x3ba95a];var _0x410876='i';var _0x3d2e55=_[_0x8beb('0x7a')](_0x153fc6,['name',_0x23ddfc[_0x8beb('0x65')]]);if(!_0x3d2e55){switch(_0x23ddfc[_0x8beb('0x65')]){case _0x8beb('0x7b'):if(_0x23ddfc[_0x8beb('0x7c')]==0x1){_0x45d2d4[_0x8beb('0x7d')]('`'+_0x23ddfc[_0x8beb('0x65')]+_0x8beb('0x7e'));}else{_0x45d2d4[_0x8beb('0x7d')]('`'+_0x23ddfc[_0x8beb('0x65')]+_0x8beb('0x7f'));}break;case _0x8beb('0x80'):if(_0x23ddfc['operator']==='$substring'){if(_0x23ddfc['value']['split']('\x20')[_0x8beb('0x5f')]>0x1){_0x42dedc[_0x540214]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x23ddfc[_0x8beb('0x7c')]),null);}else{var _0x1620af='%'+_0x23ddfc[_0x8beb('0x7c')]+'%';_0x42dedc[_0x540214](_0x8beb('0x81'),_0x1620af,_0x1620af,_0x1620af);}}else{_0x3d2e55=_[_0x8beb('0x7a')](_0x153fc6,[_0x8beb('0x3c'),_0x8beb('0x82')]);_0x23ddfc['field']=_0x8beb('0x82');_0x280e03=as[_0x8beb('0x83')](_0x410876,_0x3d2e55['type'],_0x23ddfc);_0x42dedc[_0x540214](_0x280e03['text'],_0x280e03[_0x8beb('0x7c')][_0x8beb('0x84')],_0x280e03[_0x8beb('0x7c')][_0x8beb('0x31')]);}break;case _0x8beb('0x85'):var _0x41518d=_0x23ddfc['value'][_0x8beb('0x47')](',')[_0x8beb('0x43')](function(_0x10a64b){return Number(_0x10a64b);});_0x41518d[_0x8beb('0x86')](function(_0x227468){_0x457f21['or'](_0x8beb('0x87'),'%,'+_0x227468+',%');});_0x344e25=_['union'](_0x344e25,_0x41518d);break;case _0x8beb('0x88'):if(_0x23ddfc[_0x8beb('0x89')]===_0x8beb('0x8a')){_0x42dedc[_0x540214](_0x8beb('0x8b'),'%'+_0x23ddfc[_0x8beb('0x7c')]+'%',null);}else{_0x3d2e55=_[_0x8beb('0x7a')](_0x153fc6,['name','UserId']);_0x23ddfc['field']='UserId';_0x280e03=as[_0x8beb('0x83')](_0x410876,_0x3d2e55[_0x8beb('0x56')],_0x23ddfc);_0x42dedc[_0x540214](_0x280e03[_0x8beb('0x8c')],_0x280e03[_0x8beb('0x7c')]['start'],_0x280e03[_0x8beb('0x7c')][_0x8beb('0x31')]);}break;case'body':_0x280e03=as['buildExpression']('me',null,_0x23ddfc);_0x42dedc[_0x540214](_0x280e03['text'],_0x280e03[_0x8beb('0x7c')]['start'],_0x280e03[_0x8beb('0x7c')]['end']);break;}}else{var _0x280e03=as['buildExpression'](_0x410876,_0x3d2e55[_0x8beb('0x56')],_0x23ddfc);_0x42dedc[_0x540214](_0x280e03['text'],_0x280e03['value'][_0x8beb('0x84')],_0x280e03['value'][_0x8beb('0x31')]);}}}else{var _0x24dd19=_(_0x3ce1d1[_0x8beb('0x59')])[_0x8beb('0x58')]()[_0x8beb('0x43')](function(_0x2cb178){return _[_0x8beb('0x8d')](_0x153fc6,['name',_0x2cb178])?_0x2cb178:undefined;})[_0x8beb('0x8e')]()[_0x8beb('0x7c')]();if(!_[_0x8beb('0x8f')](_0x24dd19)){_0x24dd19[_0x8beb('0x86')](function(_0x4c26bd){if(_0x4c26bd===_0x8beb('0x90')){_0x45d2d4[_0x8beb('0x63')](_0x8beb('0x91'),[][_0x8beb('0x92')](_0x3ce1d1['query'][_0x4c26bd]));}else if(_0x4c26bd==='createdAt'){var _0x364e0e=JSON[_0x8beb('0x93')](_0x3ce1d1[_0x8beb('0x59')][_0x4c26bd])[_0x8beb('0x94')];var _0x36052c=JSON[_0x8beb('0x93')](_0x3ce1d1[_0x8beb('0x59')][_0x4c26bd])[_0x8beb('0x95')];_0x45d2d4[_0x8beb('0x63')](_0x8beb('0x96'),_0x364e0e,_0x36052c);}else{if(_0x3ce1d1['query'][_0x4c26bd]==='null'){_0x45d2d4[_0x8beb('0x63')]('i.'+_0x4c26bd+_0x8beb('0x97'));}else{_0x45d2d4['where']('i.'+_0x4c26bd+_0x8beb('0x98'),_0x3ce1d1[_0x8beb('0x59')][_0x4c26bd]);}}});}if(_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x99')]){if(_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x99')]==0x1){_0x45d2d4[_0x8beb('0x7d')]('`unreadMessages`\x20=\x200');}else{_0x45d2d4['having'](_0x8beb('0x9a'));}}if(_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x9b')]){_0x344e25=_[_0x8beb('0x9c')](_0x3ce1d1['query']['tag'])?_0x3ce1d1[_0x8beb('0x59')]['tag']:new Array(_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x9b')]);_0x344e25[_0x8beb('0x86')](function(_0x533a79){_0x457f21['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x533a79+',%');});}if(_0x3ce1d1['query'][_0x8beb('0x9d')]){var _0x156a43=_0x3ce1d1[_0x8beb('0x59')]['filter'][_0x8beb('0x9e')]('\x5c','\x5c\x5c')[_0x8beb('0x9e')](/'/g,'\x27\x27');if(qs[_0x8beb('0x9f')](_0x156a43)){_0x42dedc['or'](_0x8beb('0xa0'),_0x156a43+'%');}else{_0x42dedc['or'](_0x8beb('0xa1'),qs['getFullTextValue'](_0x156a43))['or'](_0x8beb('0xa2'),_0x156a43+'%');}}}_0x45d2d4['where'](_0x42dedc);_0x45d2d4[_0x8beb('0xa3')](_0x8beb('0xa4'));var _0x2f81f5={'type':db[_0x8beb('0xa5')][_0x8beb('0xa6')][_0x8beb('0xa7')],'raw':!![]};var _0x4139f4=_0x45d2d4[_0x8beb('0xa8')]();_0x4139f4[_0x8beb('0x65')]('i.id');_0x4139f4[_0x8beb('0x65')](_0x8beb('0xa9'),_0x8beb('0x7b'));if(_0x3c7cf2[_0x8beb('0x61')]){_0x3c7cf2[_0x8beb('0x61')][_0x8beb('0x86')](function(_0xda021b){var _0x440675=_0xda021b[0x0]===_0x8beb('0xaa')?_0xda021b[0x0]:'i.'+_0xda021b[0x0];_0x45d2d4[_0x8beb('0x61')](_0x440675,_0xda021b[0x1]===_0x8beb('0xab')?![]:!![]);});}if(!_['isEmpty'](_0x344e25)){_0x45d2d4['having'](_0x457f21);_0x4139f4['where']('t.id\x20IN\x20?',_0x344e25);}BPromise[_0x8beb('0xac')]()[_0x8beb('0x23')](function(){if(!_0x44a244){if(_0x3ce1d1['query'][_0x8beb('0x90')])return;_0x4139f4[_0x8beb('0x63')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x45d2d4[_0x8beb('0x63')](_0x8beb('0xad'));return;}if(_0x3ce1d1[_0x8beb('0xae')][_0x8beb('0xaf')]!==_0x8beb('0x40'))return;return _0x3ce1d1[_0x8beb('0xae')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0xb679fd){if(_['isEmpty'](_0xb679fd)){_0x4139f4[_0x8beb('0x63')](_0x8beb('0xb0'));_0x45d2d4[_0x8beb('0x63')](_0x8beb('0xb0'));}else{_0x4139f4['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x8beb('0x43')](_0xb679fd,'id'));_0x45d2d4[_0x8beb('0x63')](_0x8beb('0x91'),_['map'](_0xb679fd,'id'));}});})[_0x8beb('0x23')](function(){if(_0x3ce1d1['user'][_0x8beb('0xaf')]===_0x8beb('0x40')&&!_0x44a244&&!_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x90')])return[];return db[_0x8beb('0xb1')][_0x8beb('0x59')](_0x4139f4[_0x8beb('0xb2')](),_0x2f81f5);})['then'](function(_0x258106){_0x3a44e7['count']=_0x258106[_0x8beb('0x5f')];if(_0x3a44e7['count']===0x0)return[];return db[_0x8beb('0xb1')][_0x8beb('0x59')](_0x20c8a9['toString'](),_0x2f81f5)[_0x8beb('0x23')](function(_0x56f0cb){_0x62808b=_[_0x8beb('0xb3')](_0x56f0cb,'id');_0x2f81f5=_['merge'](_0x2f81f5,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ce1d1[_0x8beb('0x59')][_0x8beb('0x5e')]){_0x3c7cf2[_0x8beb('0x5c')][_0x8beb('0x86')](function(_0x56d611){_0x45d2d4[_0x8beb('0x65')]('i.'+_0x56d611);});}else{_0x45d2d4['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8beb('0x7b'));_0x45d2d4[_0x8beb('0x65')]('a.key',_0x8beb('0xb4'));_0x45d2d4['field'](_0x8beb('0xb5'),_0x8beb('0xb6'));_0x45d2d4[_0x8beb('0x65')](_0x8beb('0xb7'),_0x8beb('0xaa'));_0x45d2d4[_0x8beb('0x65')](_0x8beb('0xb8'));_0x45d2d4[_0x8beb('0x65')](_0x8beb('0xb9'),_0x8beb('0xba'));_0x45d2d4[_0x8beb('0x65')]('c.lastName',_0x8beb('0xbb'));_0x45d2d4['field']('c.email',_0x8beb('0xbc'));_0x45d2d4['field'](_0x8beb('0xbd'),_0x8beb('0xbe'));_0x45d2d4[_0x8beb('0x65')](_0x8beb('0xbf'),_0x8beb('0xc0'));_0x45d2d4['field']('c.fax',_0x8beb('0xc1'));_0x45d2d4[_0x8beb('0x65')]('o.fullname',_0x8beb('0xc2'));_0x45d2d4[_0x8beb('0x65')](_0x8beb('0xc3'),'Owner.internal');_0x45d2d4[_0x8beb('0x65')](_0x8beb('0xc4'),_0x8beb('0x45'));}if(_0x3c7cf2[_0x8beb('0x34')])_0x45d2d4['limit'](_0x3c7cf2[_0x8beb('0x34')]);if(_0x3c7cf2[_0x8beb('0x36')])_0x45d2d4[_0x8beb('0x36')](_0x3c7cf2[_0x8beb('0x36')]);return db['sequelize'][_0x8beb('0x59')](_0x45d2d4[_0x8beb('0xb2')](),_0x2f81f5);})[_0x8beb('0x23')](function(_0x1c788d){if(_0x1c788d[_0x8beb('0x5f')]>0x0)_0xf22110[_0x8beb('0x63')](_0x8beb('0xc5'),_['map'](_0x1c788d,'id'));return db[_0x8beb('0xb1')]['query'](_0xf22110[_0x8beb('0xb2')](),_0x2f81f5)[_0x8beb('0x23')](function(_0x39f796){var _0x2ca431=_[_0x8beb('0xc6')](_0x39f796,_0x8beb('0xc7'));var _0x43bd8c=[];_0x1c788d[_0x8beb('0x86')](function(_0x54e344){_0x43bd8c[_0x8beb('0x48')](updateChatInteraction(_0x54e344,_0x62808b,_0x2ca431));});return BPromise['all'](_0x43bd8c);});});})[_0x8beb('0x23')](function(_0x19e10e){_0x3a44e7[_0x8beb('0xc8')]=_0x19e10e;return _0x3a44e7;})[_0x8beb('0x23')](respondWithFilteredResult(_0x5cc404,_0x3c7cf2))[_0x8beb('0x2e')](handleError(_0x5cc404,null));};exports[_0x8beb('0xc9')]=function(_0x3c0252,_0x2d49a9){var _0x1f37a0={'raw':![],'where':{'id':_0x3c0252['params']['id']}},_0x90c824={};_0x90c824[_0x8beb('0x5d')]=_[_0x8beb('0x58')](db[_0x8beb('0x53')]['rawAttributes']);_0x90c824['query']=_[_0x8beb('0x58')](_0x3c0252[_0x8beb('0x59')]);_0x90c824[_0x8beb('0x5a')]=_[_0x8beb('0x5b')](_0x90c824['model'],_0x90c824['query']);_0x1f37a0['attributes']=_[_0x8beb('0x5b')](_0x90c824[_0x8beb('0x5d')],qs[_0x8beb('0x5e')](_0x3c0252[_0x8beb('0x59')][_0x8beb('0x5e')]));_0x1f37a0['attributes']=_0x1f37a0[_0x8beb('0x5c')][_0x8beb('0x5f')]?_0x1f37a0[_0x8beb('0x5c')]:_0x90c824['model'];if(_0x3c0252[_0x8beb('0x59')][_0x8beb('0xca')]){_0x1f37a0[_0x8beb('0xcb')]=[{'all':!![]}];}_0x1f37a0=_[_0x8beb('0xcc')]({},_0x1f37a0,_0x3c0252[_0x8beb('0xcd')]);return db['ChatInteraction'][_0x8beb('0x7a')](_0x1f37a0)['then'](handleEntityNotFound(_0x2d49a9,null))[_0x8beb('0x23')](respondWithResult(_0x2d49a9,null))[_0x8beb('0x2e')](handleError(_0x2d49a9,null));};exports[_0x8beb('0xce')]=function(_0x34d08e,_0x3a0f87){return db[_0x8beb('0x53')][_0x8beb('0xce')](_0x34d08e[_0x8beb('0x3e')],{})[_0x8beb('0x23')](respondWithResult(_0x3a0f87,0xc9))[_0x8beb('0x2e')](handleError(_0x3a0f87,null));};exports[_0x8beb('0x3b')]=function(_0xd0ab36,_0x21b652){if(_0xd0ab36['body']['id']){delete _0xd0ab36[_0x8beb('0x3e')]['id'];}return db[_0x8beb('0x53')][_0x8beb('0x7a')]({'where':{'id':_0xd0ab36[_0x8beb('0xcf')]['id']}})[_0x8beb('0x23')](handleEntityNotFound(_0x21b652,null))['then'](saveUpdates(_0xd0ab36[_0x8beb('0x3e')],null))[_0x8beb('0x23')](respondWithResult(_0x21b652,null))[_0x8beb('0x2e')](handleError(_0x21b652,null));};exports[_0x8beb('0xd0')]=function(_0x192d54,_0x16523e){return db[_0x8beb('0x53')][_0x8beb('0x7a')]({'where':{'id':_0x192d54[_0x8beb('0xcf')]['id']}})['then'](handleEntityNotFound(_0x16523e,null))[_0x8beb('0x23')](removeEntity(_0x16523e,null))['catch'](handleError(_0x16523e,null));};exports[_0x8beb('0xd1')]=function(_0x586957,_0x3801bc){return db[_0x8beb('0x53')][_0x8beb('0xd1')]()[_0x8beb('0x23')](respondWithResult(_0x3801bc,null))[_0x8beb('0x2e')](handleError(_0x3801bc,null));};exports[_0x8beb('0xd2')]=function(_0x23081c,_0x8cf3ab){var _0x165b03=_0x23081c[_0x8beb('0xcf')]['id'];var _0x431113;var _0x1b0623;var _0x1129d3;return db[_0x8beb('0x53')][_0x8beb('0xd3')]({'where':{'id':_0x165b03}})['then'](function(_0xfebf68){_0x431113=_0xfebf68;return db[_0x8beb('0xd4')][_0x8beb('0xd3')]({'where':{'id':_0xfebf68['ChatWebsiteId']},'attributes':['id',_0x8beb('0xd5'),'vidaooEscalation',_0x8beb('0xd6'),_0x8beb('0xd7'),_0x8beb('0xd8')],'raw':!![]});})[_0x8beb('0x23')](function(_0x294656){if(_0x294656&&_0x294656[_0x8beb('0xd5')]&&_0x294656[_0x8beb('0xd9')]){_0x1b0623=_0x294656;var _0x1925d1={'interaction':{'id':_0x165b03},'agent':{'id':_0x23081c[_0x8beb('0xae')]['id'],'name':_0x23081c[_0x8beb('0xae')][_0x8beb('0x3c')],'fullname':_0x23081c[_0x8beb('0xae')]['fullname'],'email':_0x23081c[_0x8beb('0xae')][_0x8beb('0xda')]},'contact':_0x23081c[_0x8beb('0x3e')][_0x8beb('0x3f')],'account':_0x23081c[_0x8beb('0x3e')][_0x8beb('0x42')]};var _0x3f6d66={'rejectUnauthorized':![],'method':_0x8beb('0xdb'),'url':_0x8beb('0xdc'),'headers':{'X-APIKEY':_0x294656[_0x8beb('0xd5')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x23081c[_0x8beb('0xae')][_0x8beb('0xda')]],'buttons':null,'topic':_0x1b0623[_0x8beb('0xd6')],'note':_[_0x8beb('0xdd')](_0x1b0623['vidaooNote'])?null:getMustacheRender(_0x1b0623[_0x8beb('0xd7')],_0x1925d1),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x8beb('0xdd')](_0x1b0623[_0x8beb('0xd8')])){var _0x37da37=getMustacheRender(_0x1b0623[_0x8beb('0xd8')],_0x1925d1);var _0x10286c=JSON[_0x8beb('0x93')](_0x37da37);_0x3f6d66[_0x8beb('0x3e')][_0x8beb('0xde')]=_0x10286c;}}catch(_0x5f233a){throw new db[(_0x8beb('0xa5'))][(_0x8beb('0xdf'))](_0x8beb('0xe0'));}return rp(_0x3f6d66);}else{throw new db[(_0x8beb('0xa5'))][(_0x8beb('0xdf'))](_0x8beb('0xe1'));}})[_0x8beb('0x23')](function(_0x5d8ea7){_0x1129d3=_0x5d8ea7;if(_0x1129d3['id']){var _0x149e72={'body':_0x1129d3[_0x8beb('0xe2')],'ChatWebsiteId':_0x1b0623['id'],'ChatInteractionId':_0x431113['id'],'direction':_0x8beb('0xe3'),'UserId':_0x23081c['user']['id']};return db[_0x8beb('0xe4')]['create'](_0x149e72,{});}else{throw new db[(_0x8beb('0xa5'))]['ValidationError'](_0x8beb('0xe5'));}})[_0x8beb('0x23')](function(){return _0x431113['updateAttributes']({'vidaooSessionId':_0x1129d3['id']});})[_0x8beb('0x23')](respondWithResult(_0x8cf3ab,null))[_0x8beb('0x2e')](handleError(_0x8cf3ab,null));};exports['customUpdate']=function(_0x238945,_0x4b8b99){if(_0x238945[_0x8beb('0x3e')]['id']){delete _0x238945[_0x8beb('0x3e')]['id'];}return db[_0x8beb('0x53')][_0x8beb('0x7a')]({'where':{'id':_0x238945['params']['id']},'include':[{'model':db[_0x8beb('0xe6')],'as':_0x8beb('0x80')}]})[_0x8beb('0x23')](handleEntityNotFound(_0x4b8b99,null))['then'](saveUpdates(_0x238945[_0x8beb('0x3e')],null))[_0x8beb('0x23')](respondWithResult(_0x4b8b99,null))['catch'](handleError(_0x4b8b99,null));};exports['abandon']=function(_0x4badf9,_0x465a2e,_0x4dc38a){if(_0x4badf9[_0x8beb('0x3e')]['id']){delete _0x4badf9[_0x8beb('0x3e')]['id'];}return db[_0x8beb('0x53')][_0x8beb('0x7a')]({'where':{'id':_0x4badf9[_0x8beb('0xcf')]['id']}})[_0x8beb('0x23')](function(_0x43813f){if(!_0x43813f){logger[_0x8beb('0x29')](_0x8beb('0xe7'),_0x8beb('0xe8'),0x194,_0x8beb('0xe9'));_0x465a2e[_0x8beb('0x2f')](0x194);}else{if(_0x43813f['UserId']){throw new db[(_0x8beb('0xa5'))][(_0x8beb('0xdf'))](_0x8beb('0xea'));}}return _0x43813f;})['then'](function(_0x3d1b85){if(_0x3d1b85){return _0x3d1b85[_0x8beb('0x3b')]({'closed':_0x4badf9[_0x8beb('0x3e')][_0x8beb('0x4e')],'disposition':_0x4badf9[_0x8beb('0x3e')]['disposition']})[_0x8beb('0x23')](function(_0x36203c){return _0x36203c;});}})[_0x8beb('0x23')](function(_0x3e2169){return respondWithRpcPromise(_0x8beb('0xeb'),_0x8beb('0xe8'),_0x4badf9['body'],client9004);})[_0x8beb('0x23')](respondWithResult(_0x465a2e,null))[_0x8beb('0x2e')](handleError(_0x465a2e,null));};exports['attachmentUpload']=function(_0x45d2cd,_0x4446e6,_0x529890){_0x45d2cd[_0x8beb('0x3e')][_0x8beb('0x3c')]=_0x45d2cd['file'][_0x8beb('0xec')];_0x45d2cd[_0x8beb('0x3e')][_0x8beb('0xed')]=_0x45d2cd[_0x8beb('0xee')][_0x8beb('0xef')];_0x45d2cd['body'][_0x8beb('0x56')]=_0x45d2cd[_0x8beb('0xee')][_0x8beb('0xf0')];return db[_0x8beb('0xf1')]['create'](_0x45d2cd[_0x8beb('0x3e')])[_0x8beb('0x23')](respondWithResult(_0x4446e6,0xc9))[_0x8beb('0x2e')](handleError(_0x4446e6,null));};exports[_0x8beb('0xf2')]=function(_0x207241,_0x4e1320,_0x21046f){return db[_0x8beb('0x53')][_0x8beb('0xd3')]({'where':{'id':_0x207241[_0x8beb('0xcf')]['id']},'raw':!![]})[_0x8beb('0x23')](handleEntityNotFound(_0x4e1320,null))[_0x8beb('0x23')](function(_0x1ab8dc){if(_0x1ab8dc){if(_0x1ab8dc[_0x8beb('0x4e')]){return _0x4e1320['status'](0x193)['json']({'status':0x193,'message':_0x8beb('0xf3')});}return db[_0x8beb('0xf1')]['findOne']({'where':{'id':_0x207241[_0x8beb('0x59')][_0x8beb('0xf4')]},'raw':!![]})[_0x8beb('0x23')](handleEntityNotFound(_0x4e1320,null));}})[_0x8beb('0x23')](function(_0x5e352c){if(_0x5e352c){var _0x2b31c7=_0x5e352c[_0x8beb('0xf5')]!==null;var _0x4bf213=path[_0x8beb('0xf6')](config['root'],_0x8beb('0xf7'));if(_0x2b31c7){_0x4bf213=path[_0x8beb('0xf6')](_0x4bf213,_0x8beb('0xf8'));}var _0x3348d5=path['join'](_0x4bf213,_0x5e352c[_0x8beb('0xed')]);return _0x4e1320[_0x8beb('0xf9')](_0x3348d5);}})[_0x8beb('0x2e')](handleError(_0x4e1320,null));};exports['close']=function(_0x5e0ff3,_0x2fd14f){var _0x322f8f=null;var _0x17e6cf=null;var _0x59cbb2=null;var _0x423121=null;if(_0x5e0ff3[_0x8beb('0x3e')]['id']){delete _0x5e0ff3['body']['id'];}if(_0x5e0ff3[_0x8beb('0x3e')]['mailTranscript']){_0x423121=path['join'](config[_0x8beb('0xfa')],'server/files/chat/upload/',util[_0x8beb('0xfb')](_0x8beb('0xfc'),Date['now']()));_0x5e0ff3[_0x8beb('0x3e')]['pathTranscript']=_0x423121;}return db['ChatInteraction']['find']({'where':{'id':_0x5e0ff3['params']['id']},'include':[{'model':db[_0x8beb('0xe4')],'as':'Messages','include':[{'model':db[_0x8beb('0x88')],'as':'User'}]}]})[_0x8beb('0x23')](handleEntityNotFound(_0x2fd14f,null))[_0x8beb('0x23')](saveUpdates(_0x5e0ff3[_0x8beb('0x3e')],null))['then'](function(_0x48eeb7){if(_0x48eeb7){_0x322f8f=_0x48eeb7;return db['ChatWebsite']['find']({'where':{'id':_0x322f8f[_0x8beb('0x90')]}});}})[_0x8beb('0x23')](function(_0x1c1129){if(_0x1c1129){_0x59cbb2=_0x1c1129;return db[_0x8beb('0xe6')][_0x8beb('0x7a')]({'where':{'id':_0x322f8f[_0x8beb('0x82')]}});}})[_0x8beb('0x23')](function(_0x208944){if(_0x208944){_0x17e6cf=_0x208944;if(_0x423121){var _0x4f56cd=null;for(var _0x4a4f08=0x1;_0x4a4f08<_0x322f8f[_0x8beb('0xfd')][_0x8beb('0x5f')];++_0x4a4f08){_0x4f56cd=_0x322f8f[_0x8beb('0xfd')][_0x4a4f08];var _0x34ad80=_0x4f56cd[_0x8beb('0x4f')]?util[_0x8beb('0xfb')]('%s%d',_0x59cbb2[_0x8beb('0xfe')],_0x4f56cd['UserId']):'System';var _0x2e12e4=_0x5e0ff3[_0x8beb('0x3e')][_0x8beb('0xff')]||util[_0x8beb('0xfb')](_0x8beb('0x100'),_0x8beb('0x101'),_0x4f56cd[_0x8beb('0x82')]);switch(_0x59cbb2[_0x8beb('0x102')]){case _0x8beb('0x103'):_0x34ad80=_0x4f56cd[_0x8beb('0x4f')]?util[_0x8beb('0xfb')](_0x8beb('0x100'),_0x59cbb2[_0x8beb('0xfe')],_0x4f56cd['UserId']):_0x8beb('0x104');break;case _0x8beb('0x105'):_0x34ad80=_0x4f56cd['UserId']?_0x4f56cd[_0x8beb('0x88')]['alias']||_0x4f56cd[_0x8beb('0x88')][_0x8beb('0x44')]:_0x8beb('0x104');break;case _0x8beb('0x106'):_0x34ad80=_0x4f56cd['UserId']?_0x4f56cd[_0x8beb('0x88')][_0x8beb('0x44')]:_0x8beb('0x104');break;default:_0x34ad80=_0x4f56cd[_0x8beb('0x4f')]?util[_0x8beb('0xfb')](_0x8beb('0x100'),_0x59cbb2[_0x8beb('0xfe')],_0x4f56cd[_0x8beb('0x4f')]):'System';}var _0x2ec763=util['format'](_0x8beb('0x107'),moment(_0x4f56cd[_0x8beb('0x108')])[_0x8beb('0xfb')]('MM/DD/YYYY\x20HH:mm:ss'),_0x4f56cd[_0x8beb('0x109')]==='in'?_0x2e12e4:_0x34ad80,_0x4f56cd[_0x8beb('0x3e')]);if(!_0x4f56cd[_0x8beb('0x10a')]){fs[_0x8beb('0x10b')](_0x423121,_0x2ec763);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x8beb('0x10c')],'as':_0x8beb('0x10d'),'raw':!![]}]});}}})[_0x8beb('0x23')](function(_0x550a64){if(_0x550a64&&_0x550a64[_0x8beb('0x10d')]&&_0x5e0ff3[_0x8beb('0x3e')]){var _0x10cf41={'tls':{'rejectUnauthorized':![]}};if(_0x550a64[_0x8beb('0x10d')][_0x8beb('0x10e')]){_0x10cf41[_0x8beb('0x10e')]=_0x550a64['Smtp'][_0x8beb('0x10e')];}else{_0x10cf41['host']=_0x550a64[_0x8beb('0x10d')][_0x8beb('0x10f')];_0x10cf41[_0x8beb('0x110')]=_0x550a64[_0x8beb('0x10d')][_0x8beb('0x110')];_0x10cf41[_0x8beb('0x111')]=_0x550a64[_0x8beb('0x10d')][_0x8beb('0x111')];}if(_0x550a64[_0x8beb('0x10d')][_0x8beb('0x112')]){_0x10cf41[_0x8beb('0x113')]={'user':_0x550a64[_0x8beb('0x10d')]['user'],'pass':_0x550a64[_0x8beb('0x10d')][_0x8beb('0x114')]};}return respondWithRpcPromise(_0x8beb('0x115'),_0x8beb('0x116'),{'account':_0x10cf41,'message':{'from':util[_0x8beb('0xfb')](_0x8beb('0x117'),_0x550a64[_0x8beb('0x3c')],_0x550a64['email']||_0x550a64[_0x8beb('0x10d')][_0x8beb('0xae')]),'to':_0x5e0ff3[_0x8beb('0x3e')][_0x8beb('0x118')],'subject':_0x8beb('0x119'),'text':util[_0x8beb('0xfb')](_0x8beb('0x11a'),_0x5e0ff3[_0x8beb('0x3e')]['mailTranscript']),'attachments':[{'path':_0x423121}]}})[_0x8beb('0x23')](function(){return _0x322f8f;})[_0x8beb('0x2e')](function(_0x3f4a1e){console[_0x8beb('0x29')](_0x3f4a1e);});}else{return _0x322f8f;}})[_0x8beb('0x23')](respondWithStatusCode(_0x2fd14f,0xc8))['catch'](handleError(_0x2fd14f,null));};exports['addMessage']=function(_0x5f57e9,_0x3a4728,_0x5850d0){return db[_0x8beb('0xe4')][_0x8beb('0x7a')]({'where':{'id':_0x5f57e9['params']['id']}})['then'](handleEntityNotFound(_0x3a4728,null))['then'](function(_0x12293d){if(_0x12293d){return _0x12293d[_0x8beb('0x11b')](_0x5f57e9[_0x8beb('0x3e')][_0x8beb('0x11c')],_[_0x8beb('0x11d')](_0x5f57e9[_0x8beb('0x3e')],[_0x8beb('0x11c'),'id'])||{});}})[_0x8beb('0x23')](respondWithResult(_0x3a4728,null))[_0x8beb('0x2e')](handleError(_0x3a4728,null));};exports['getMessages']=function(_0x1b473a,_0x1164ba,_0x2bb39e){var _0x44d2e7={'raw':![],'where':{}};var _0x37bac4={};var _0x3e067a={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1b473a['params']['id']}})[_0x8beb('0x23')](handleEntityNotFound(_0x1164ba,null))[_0x8beb('0x23')](function(_0x420dbf){if(_0x420dbf){_0x37bac4[_0x8beb('0x5d')]=_[_0x8beb('0x58')](db[_0x8beb('0xe4')][_0x8beb('0x54')]);_0x37bac4[_0x8beb('0x59')]=_[_0x8beb('0x58')](_0x1b473a['query']);_0x37bac4[_0x8beb('0x5a')]=_[_0x8beb('0x5b')](_0x37bac4[_0x8beb('0x5d')],_0x37bac4[_0x8beb('0x59')]);_0x44d2e7[_0x8beb('0x5c')]=_[_0x8beb('0x5b')](_0x37bac4[_0x8beb('0x5d')],qs[_0x8beb('0x5e')](_0x1b473a[_0x8beb('0x59')][_0x8beb('0x5e')]));_0x44d2e7[_0x8beb('0x5c')]=_0x44d2e7[_0x8beb('0x5c')][_0x8beb('0x5f')]?_0x44d2e7[_0x8beb('0x5c')]:_0x37bac4[_0x8beb('0x5d')];if(!_0x1b473a['query'][_0x8beb('0x60')](_0x8beb('0x11e'))){_0x44d2e7[_0x8beb('0x34')]=qs[_0x8beb('0x34')](_0x1b473a[_0x8beb('0x59')]['limit']);_0x44d2e7['offset']=qs[_0x8beb('0x36')](_0x1b473a[_0x8beb('0x59')][_0x8beb('0x36')]);}_0x44d2e7['order']=qs['sort'](_0x1b473a[_0x8beb('0x59')][_0x8beb('0x62')]);_0x44d2e7[_0x8beb('0x63')]=qs[_0x8beb('0x5a')](_[_0x8beb('0x64')](_0x1b473a[_0x8beb('0x59')],_0x37bac4[_0x8beb('0x5a')]));_0x44d2e7[_0x8beb('0x63')][_0x8beb('0xc7')]=_0x420dbf['id'];if(_0x1b473a['query'][_0x8beb('0x9d')]){_0x44d2e7[_0x8beb('0x63')]=_[_0x8beb('0xcc')](_0x44d2e7[_0x8beb('0x63')],{'$or':_[_0x8beb('0x43')](_0x44d2e7[_0x8beb('0x5c')],function(_0x3d54cc){var _0x9fa5e3={};_0x9fa5e3[_0x3d54cc]={'$like':'%'+_0x1b473a[_0x8beb('0x59')][_0x8beb('0x9d')]+'%'};return _0x9fa5e3;})});}if(_0x1b473a[_0x8beb('0x59')][_0x8beb('0x94')]){var _0x35cba5=_0x1b473a[_0x8beb('0x59')]['$gte']['split'](',');var _0x1ff3e1={};_0x1ff3e1[_0x35cba5[0x0]]={'$gte':moment(_0x35cba5[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x44d2e7[_0x8beb('0x63')]=_['merge'](_0x44d2e7[_0x8beb('0x63')],_0x1ff3e1);}_0x44d2e7=_['merge']({},_0x44d2e7,_0x1b473a[_0x8beb('0xcd')]);return db[_0x8beb('0xe4')]['count']({'where':_0x44d2e7[_0x8beb('0x63')]})[_0x8beb('0x23')](function(_0x3b3df1){_0x3e067a[_0x8beb('0x35')]=_0x3b3df1;if(_0x1b473a[_0x8beb('0x59')][_0x8beb('0xca')]){_0x44d2e7['include']=[{'all':!![]}];}return db[_0x8beb('0xe4')][_0x8beb('0x11f')](_0x44d2e7);})[_0x8beb('0x23')](function(_0x4b13eb){_0x3e067a[_0x8beb('0xc8')]=_0x4b13eb;return _0x3e067a;});}})[_0x8beb('0x23')](respondWithFilteredResult(_0x1164ba,_0x44d2e7))[_0x8beb('0x2e')](handleError(_0x1164ba,null));};exports[_0x8beb('0x120')]=function(_0x5940d8,_0x6a9af3,_0x34502d){var _0x3da488={'where':{}},_0x26acae={},_0x4fcc2a={'count':0x0,'rows':[]};return db[_0x8beb('0x53')][_0x8beb('0xd3')]({'where':{'id':_0x5940d8[_0x8beb('0xcf')]['id']}})[_0x8beb('0x23')](handleEntityNotFound(_0x6a9af3,null))[_0x8beb('0x23')](function(_0x517a7a){if(_0x517a7a){_0x26acae[_0x8beb('0x5d')]=_[_0x8beb('0x58')](db['ChatMessage'][_0x8beb('0x54')]);_0x26acae[_0x8beb('0x59')]=_[_0x8beb('0x58')](_0x5940d8['query']);_0x26acae[_0x8beb('0x5a')]=_[_0x8beb('0x5b')](_0x26acae['model'],_0x26acae['query']);_0x3da488[_0x8beb('0x5c')]=_[_0x8beb('0x5b')](_0x26acae['model'],qs['fields'](_0x5940d8[_0x8beb('0x59')][_0x8beb('0x5e')]));_0x3da488[_0x8beb('0x5c')]=_0x3da488[_0x8beb('0x5c')][_0x8beb('0x5f')]?_0x3da488['attributes']:_0x26acae[_0x8beb('0x5d')];if(!_0x5940d8['query'][_0x8beb('0x60')](_0x8beb('0x11e'))){_0x3da488[_0x8beb('0x34')]=qs[_0x8beb('0x34')](_0x5940d8[_0x8beb('0x59')][_0x8beb('0x34')]);_0x3da488[_0x8beb('0x36')]=qs[_0x8beb('0x36')](_0x5940d8[_0x8beb('0x59')][_0x8beb('0x36')]);}_0x3da488[_0x8beb('0x61')]=qs['sort'](_0x5940d8[_0x8beb('0x59')][_0x8beb('0x62')]);_0x3da488['where']=qs['filters'](_[_0x8beb('0x64')](_0x5940d8['query'],_0x26acae['filters']));_0x3da488[_0x8beb('0x63')][_0x8beb('0xc7')]=_0x517a7a['id'];if(_0x5940d8[_0x8beb('0x59')]['filter']){_0x3da488[_0x8beb('0x63')]=_[_0x8beb('0xcc')](_0x3da488['where'],{'$or':_[_0x8beb('0x43')](_0x3da488[_0x8beb('0x5c')],function(_0x3e7ef8){var _0x59ceab={};_0x59ceab[_0x3e7ef8]={'$like':'%'+_0x5940d8[_0x8beb('0x59')][_0x8beb('0x9d')]+'%'};return _0x59ceab;})});}_0x3da488[_0x8beb('0x63')][_0x8beb('0x10a')]=![];if(_0x5940d8[_0x8beb('0x59')]['id']){_0x3da488[_0x8beb('0x63')]['id']={'$gt':_0x5940d8[_0x8beb('0x59')]['id']};}_0x3da488=_[_0x8beb('0xcc')]({},_0x3da488,_0x5940d8[_0x8beb('0xcd')]);return db[_0x8beb('0xe4')]['count']({'where':_0x3da488[_0x8beb('0x63')]})['then'](function(_0x2f769f){_0x4fcc2a[_0x8beb('0x35')]=_0x2f769f;_0x3da488[_0x8beb('0xcb')]=[];if(_0x5940d8['query'][_0x8beb('0x121')]){_0x3da488['include'][_0x8beb('0x48')]({'model':db[_0x8beb('0x88')],'as':_0x8beb('0x88'),'attributes':['id','fullname',_0x8beb('0x122')]});}if(_0x5940d8[_0x8beb('0x59')]['includeAll']){_0x3da488[_0x8beb('0xcb')]=[{'all':!![]}];}return db[_0x8beb('0xe4')][_0x8beb('0x11f')](_0x3da488);})[_0x8beb('0x23')](function(_0x3eb0cc){_0x4fcc2a[_0x8beb('0xc8')]=_0x3eb0cc;return _0x4fcc2a;});}})['then'](respondWithFilteredResult(_0x6a9af3,_0x3da488))['catch'](handleError(_0x6a9af3,null));};exports[_0x8beb('0x123')]=function(_0x23c59c,_0x573c74,_0x210f72){return db['ChatInteraction']['find']({'where':{'id':_0x23c59c['params']['id']}})['then'](handleEntityNotFound(_0x573c74,null))[_0x8beb('0x23')](function(_0xe493e7){if(_0xe493e7){return _0xe493e7['setTags'](_0x23c59c[_0x8beb('0x3e')][_0x8beb('0x11c')],_['omit'](_0x23c59c['body'],[_0x8beb('0x11c'),'id'])||{})[_0x8beb('0x124')](function(){return db[_0x8beb('0x85')][_0x8beb('0x11f')]({'attributes':['id',_0x8beb('0x3c'),_0x8beb('0x66')],'where':{'id':_0x23c59c[_0x8beb('0x3e')][_0x8beb('0x11c')]}});})['then'](function(_0x36e78a){socket[_0x8beb('0x125')]('chatInteractionTags:save',{'id':Number(_0x23c59c[_0x8beb('0xcf')]['id']),'tags':_0x36e78a||[]});return{'id':Number(_0x23c59c[_0x8beb('0xcf')]['id']),'tags':_0x36e78a||[]};});}})[_0x8beb('0x23')](respondWithResult(_0x573c74,null))['catch'](handleError(_0x573c74,null));};exports[_0x8beb('0x126')]=function(_0x541860,_0x5a0f7c,_0x57de49){return db[_0x8beb('0x53')]['find']({'where':{'id':_0x541860['params']['id']}})['then'](handleEntityNotFound(_0x5a0f7c,null))[_0x8beb('0x23')](function(_0x4934b5){if(_0x4934b5){return _0x4934b5[_0x8beb('0x126')](_0x541860[_0x8beb('0x59')][_0x8beb('0x11c')]);}})[_0x8beb('0x23')](respondWithStatusCode(_0x5a0f7c,null))[_0x8beb('0x2e')](handleError(_0x5a0f7c,null));};exports['download']=function(_0x3e8cf6,_0x40a834){var _0x2525d1=moment()[_0x8beb('0x127')]()[_0x8beb('0xb2')]();var _0x24e66c=path[_0x8beb('0xf6')](config['root'],_0x8beb('0x128'),_0x8beb('0x129'),'tmp');var _0x4de36b=path[_0x8beb('0xf6')](config['root'],_0x8beb('0x128'),_0x8beb('0x129'),_0x8beb('0x12a'));var _0xc12689=path[_0x8beb('0xf6')](_0x24e66c,_0x2525d1);var _0x185e2d=util[_0x8beb('0xfb')](_0x8beb('0x12b'),_0x3e8cf6[_0x8beb('0xcf')]['id'],_0x2525d1);var _0x31386a=path[_0x8beb('0xf6')](_0x24e66c,_0x185e2d);var _0x232ef0=[];_0x232ef0[_0x8beb('0x48')]({'model':db['User'],'as':_0x8beb('0x88'),'attributes':['id',_0x8beb('0x44')],'raw':!![]});_0x232ef0[_0x8beb('0x48')]({'model':db[_0x8beb('0xe6')],'as':_0x8beb('0x80'),'attributes':['id',_0x8beb('0x12c'),_0x8beb('0x12d')],'raw':!![]});if(_0x3e8cf6[_0x8beb('0x59')]['attachments']){_0x232ef0[_0x8beb('0x48')]({'model':db['Attachment'],'as':_0x8beb('0xf1'),'raw':!![]});}var _0xb69f4c=[{'model':db[_0x8beb('0xe4')],'as':'Messages','attributes':['id',_0x8beb('0x3e'),'createdAt','direction',_0x8beb('0x10a'),_0x8beb('0x99')],'include':_0x232ef0}];_0xb69f4c[_0x8beb('0x48')]({'model':db['ChatWebsite'],'as':_0x8beb('0x12e'),'attributes':['id',_0x8beb('0x3c')]});_0xb69f4c[_0x8beb('0x48')]({'model':db[_0x8beb('0x88')],'as':'Owner','attributes':['id','fullname']});return db[_0x8beb('0x53')][_0x8beb('0x7a')]({'where':{'id':_0x3e8cf6[_0x8beb('0xcf')]['id']},'include':_0xb69f4c})['then'](handleEntityNotFound(_0x40a834,null))[_0x8beb('0x23')](function(_0x233ff3){if(_0x233ff3){var _0x37fb73=_0x233ff3['get']({'plain':!![]});fs['mkdirSync'](_0xc12689);var _0xfe9e3b={'channel':_0x8beb('0x12f'),'account':_0x37fb73['Account'][_0x8beb('0x3c')],'agent':_0x37fb73[_0x8beb('0x130')]?_0x37fb73[_0x8beb('0x130')]['fullname']:_0x8beb('0x131'),'createdAt':moment(_0x37fb73['createdAt'])[_0x8beb('0xfb')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x37fb73['closed']?moment(_0x37fb73[_0x8beb('0x132')])[_0x8beb('0xfb')](_0x8beb('0x133'))['toString']():'','disposition':_0x37fb73[_0x8beb('0x51')],'chatInfo':{'browser':_0x37fb73[_0x8beb('0x134')],'os':_0x37fb73[_0x8beb('0x135')],'referer':_0x37fb73['referer'],'customerIp':_0x37fb73[_0x8beb('0x136')],'customerPort':_0x37fb73[_0x8beb('0x137')]?_0x37fb73[_0x8beb('0x137')]:_0x8beb('0x131')},'messages':_(_0x37fb73[_0x8beb('0xfd')])[_0x8beb('0x138')]()['filter']({'secret':![]})['map'](function(_0x5429f1){if(_0x5429f1[_0x8beb('0xf1')]){var _0x4d1802=path[_0x8beb('0xf6')](_0x4de36b,_0x5429f1[_0x8beb('0xf1')][_0x8beb('0xed')]);if(fs['existsSync'](_0x4d1802)){fs[_0x8beb('0x139')](_0x4d1802)[_0x8beb('0x13a')](fs['createWriteStream'](path[_0x8beb('0xf6')](_0xc12689,_0x5429f1[_0x8beb('0xf1')][_0x8beb('0xed')])));}}return{'date':moment(_0x5429f1[_0x8beb('0x108')])[_0x8beb('0xfb')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8beb('0xb2')](),'sender':_0x5429f1['direction']===_0x8beb('0xe3')?_0x5429f1[_0x8beb('0x88')]?_0x5429f1[_0x8beb('0x88')][_0x8beb('0x44')]:_0x8beb('0x104'):_0x5429f1['Contact']['firstName']+(_0x5429f1[_0x8beb('0x80')][_0x8beb('0x12d')]?'\x20'+_0x5429f1['Contact'][_0x8beb('0x12d')]:''),'body':_0x5429f1[_0x8beb('0xf1')]?_0x5429f1[_0x8beb('0xf1')][_0x8beb('0xed')]:_0x5429f1[_0x8beb('0x3e')],'direction':_0x5429f1[_0x8beb('0x109')]===_0x8beb('0xe3')?'A':'C','secret':_0x5429f1[_0x8beb('0x10a')],'read':_0x5429f1[_0x8beb('0x99')],'attachment':_0x5429f1[_0x8beb('0xf1')]};})[_0x8beb('0x7c')]()};return ejs[_0x8beb('0x13b')](path[_0x8beb('0xf6')](config['root'],_0x8beb('0x128'),'views',_0x8beb('0x13c')),{'interaction':_0xfe9e3b})[_0x8beb('0x23')](function(_0x48c97f){var _0x1b3c23=path[_0x8beb('0xf6')](_0xc12689,_0x8beb('0x13d')+_0x37fb73['id']+'-'+_0x2525d1+_0x8beb('0x13e'));var _0x126b32={'path':_0x1b3c23,'channel':_0x8beb('0x12f'),'interactionId':_0x37fb73['id']};return pdf[_0x8beb('0x13f')](_0x48c97f,_0x126b32);})[_0x8beb('0x23')](function(){return new BPromise(function(_0x1fa3f6,_0x34729e){zipdir(_0xc12689,{'saveTo':_0x31386a},function(_0x3697cf,_0x3ff958){if(_0x3697cf)return _0x34729e(_0x3697cf);return _0x1fa3f6(_0x3ff958);});})[_0x8beb('0x23')](function(){return new BPromise(function(_0x5abe87,_0x7b702a){rimraf(_0xc12689,function(_0x555c8c){if(_0x555c8c)_0x7b702a(_0x555c8c);return _0x5abe87();});});})[_0x8beb('0x23')](function(){return _0x40a834['download'](_0x31386a,_0x185e2d,function(_0xcd2151){if(_0xcd2151){console[_0x8beb('0x140')](_0x8beb('0x141'),_0xcd2151);}else{fs[_0x8beb('0x142')](_0x31386a);}});});});}else{return _0x40a834[_0x8beb('0x2f')](0xc8);}})['catch'](handleError(_0x40a834,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 0d9591c..d806456 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 _0xaca9=['exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xaca9,0x144));var _0x9aca=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xaca9[_0x36c5b0];return _0xf19333;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x9aca('0x0')];var ChatMessage=require(_0x9aca('0x1'))['db'][_0x9aca('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9aca('0x3')](0x0);var events={'afterCreate':_0x9aca('0x4'),'afterUpdate':_0x9aca('0x5'),'afterDestroy':_0x9aca('0x6')};function emitEvent(_0x3943cc){return function(_0x2264e9,_0x59535e,_0x178ab4){_0x2264e9[_0x9aca('0x7')]({'attributes':['id'],'raw':!![]})[_0x9aca('0x8')](function(_0x1ba6bf){_0x2264e9[_0x9aca('0x9')](_0x9aca('0xa'),_0x1ba6bf[_0x9aca('0xb')](function(_0x4f3b68){return{'id':_0x4f3b68['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2264e9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9aca('0x8')](function(_0xceaf9e){_0x2264e9[_0x9aca('0x9')](_0x9aca('0xc'),_0xceaf9e[_0x9aca('0xd')]);ChatInteractionEvents[_0x9aca('0xe')](_0x3943cc+':'+_0x2264e9['id'],_0x2264e9);ChatInteractionEvents[_0x9aca('0xe')](_0x3943cc,_0x2264e9);_0x178ab4(null);})[_0x9aca('0xf')](_0x178ab4(null));};}for(var e in events){if(events[_0x9aca('0x10')](e)){var event=events[e];ChatInteraction[_0x9aca('0x11')](e,emitEvent(event));}}module[_0x9aca('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0x30d6=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','remove','then','map','findAll','setDataValue'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x30d6,0x85));var _0x630d=function(_0x3799b2,_0x3728da){_0x3799b2=_0x3799b2-0x0;var _0x1d7571=_0x30d6[_0x3799b2];return _0x1d7571;};'use strict';var EventEmitter=require(_0x630d('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x630d('0x1')];var ChatMessage=require(_0x630d('0x2'))['db'][_0x630d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x630d('0x4')](0x0);var events={'afterCreate':_0x630d('0x5'),'afterUpdate':'update','afterDestroy':_0x630d('0x6')};function emitEvent(_0x54cbc6){return function(_0x36b928,_0x465357,_0x14f180){_0x36b928['getUsers']({'attributes':['id'],'raw':!![]})[_0x630d('0x7')](function(_0x3005d7){_0x36b928['setDataValue']('Users',_0x3005d7[_0x630d('0x8')](function(_0x85fb84){return{'id':_0x85fb84['id']};}));return ChatMessage[_0x630d('0x9')]({'where':{'ChatInteractionId':_0x36b928['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1248e2){_0x36b928[_0x630d('0xa')](_0x630d('0xb'),_0x1248e2[_0x630d('0xc')]);ChatInteractionEvents[_0x630d('0xd')](_0x54cbc6+':'+_0x36b928['id'],_0x36b928);ChatInteractionEvents[_0x630d('0xd')](_0x54cbc6,_0x36b928);_0x14f180(null);})[_0x630d('0xe')](_0x14f180(null));};}for(var e in events){if(events[_0x630d('0xf')](e)){var event=events[e];ChatInteraction[_0x630d('0x10')](e,emitEvent(event));}}module[_0x630d('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 65663df..f844b82 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 _0x6a70=['chat_interactions','closed','closedAt','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0x6a70,0x1d2));var _0x06a7=function(_0x3fa36e,_0x485785){_0x3fa36e=_0x3fa36e-0x0;var _0x575219=_0x6a70[_0x3fa36e];return _0x575219;};'use strict';var _=require(_0x06a7('0x0'));var util=require(_0x06a7('0x1'));var logger=require(_0x06a7('0x2'))('api');var moment=require(_0x06a7('0x3'));var BPromise=require(_0x06a7('0x4'));var rp=require(_0x06a7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x06a7('0x6'));var attributes=require(_0x06a7('0x7'));module[_0x06a7('0x8')]=function(_0x36c3b6,_0x4e72c3){return _0x36c3b6['define'](_0x06a7('0x9'),attributes,{'tableName':_0x06a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37f8b1,_0x2875fe,_0xed103f){if(_0x37f8b1['changed'](_0x06a7('0xb'))){_0x37f8b1[_0x06a7('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0xed103f(null,_0x37f8b1);}},'charset':'utf8mb4','collate':_0x06a7('0xd')});}; \ No newline at end of file +var _0x465b=['utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x353e76,_0x2c9853){var _0x36e58c=function(_0x12e94c){while(--_0x12e94c){_0x353e76['push'](_0x353e76['shift']());}};_0x36e58c(++_0x2c9853);}(_0x465b,0xde));var _0xb465=function(_0x7f96f7,_0x46ef1f){_0x7f96f7=_0x7f96f7-0x0;var _0x27c771=_0x465b[_0x7f96f7];return _0x27c771;};'use strict';var _=require(_0xb465('0x0'));var util=require(_0xb465('0x1'));var logger=require(_0xb465('0x2'))(_0xb465('0x3'));var moment=require(_0xb465('0x4'));var BPromise=require('bluebird');var rp=require(_0xb465('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb465('0x6'));var config=require(_0xb465('0x7'));var attributes=require(_0xb465('0x8'));module[_0xb465('0x9')]=function(_0x1906b9,_0x4b46d5){return _0x1906b9[_0xb465('0xa')](_0xb465('0xb'),attributes,{'tableName':_0xb465('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f7287,_0x492284,_0x2a7897){if(_0x4f7287[_0xb465('0xd')](_0xb465('0xe'))){_0x4f7287['closedAt']=moment()['format'](_0xb465('0xf'));}_0x2a7897(null,_0x4f7287);}},'charset':_0xb465('0x10'),'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 5da0adc..0aff57a 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 _0x93bb=['message','catch','UpdateChatInteraction','ChatInteraction','options','where','attributes','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','./chatInteraction.socket','register','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x93bb,0x84));var _0xb93b=function(_0xd1081d,_0x4d6f0b){_0xd1081d=_0xd1081d-0x0;var _0x2e0053=_0x93bb[_0xd1081d];return _0x2e0053;};'use strict';var _=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var moment=require(_0xb93b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb93b('0x3'));var db=require(_0xb93b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb93b('0x5'))('rpc');var config=require(_0xb93b('0x6'));var jayson=require(_0xb93b('0x7'));var client=jayson[_0xb93b('0x8')][_0xb93b('0x9')]({'port':0x232a});config['redis']=_[_0xb93b('0xa')](config[_0xb93b('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb93b('0xb')]));require(_0xb93b('0xc'))[_0xb93b('0xd')](socket);function respondWithRpcPromise(_0x4f9f11,_0x51e0e5,_0x346785){return new BPromise(function(_0x144690,_0x43d232){return client[_0xb93b('0xe')](_0x4f9f11,_0x346785)[_0xb93b('0xf')](function(_0x54027a){logger[_0xb93b('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x51e0e5,_0xb93b('0x11'));logger[_0xb93b('0x12')](_0xb93b('0x13'),_0x51e0e5,_0xb93b('0x11'),JSON[_0xb93b('0x14')](_0x54027a));if(_0x54027a[_0xb93b('0x15')]){if(_0x54027a[_0xb93b('0x15')][_0xb93b('0x16')]===0x1f4){logger[_0xb93b('0x15')](_0xb93b('0x17'),_0x51e0e5,_0x54027a[_0xb93b('0x15')][_0xb93b('0x18')]);return _0x43d232(_0x54027a[_0xb93b('0x15')][_0xb93b('0x18')]);}logger['error'](_0xb93b('0x17'),_0x51e0e5,_0x54027a[_0xb93b('0x15')][_0xb93b('0x18')]);return _0x144690(_0x54027a[_0xb93b('0x15')][_0xb93b('0x18')]);}else{logger[_0xb93b('0x10')](_0xb93b('0x17'),_0x51e0e5,_0xb93b('0x11'));_0x144690(_0x54027a['result'][_0xb93b('0x18')]);}})[_0xb93b('0x19')](function(_0x1603a8){logger[_0xb93b('0x15')](_0xb93b('0x17'),_0x51e0e5,_0x1603a8);_0x43d232(_0x1603a8);});});}exports[_0xb93b('0x1a')]=function(_0x579c7d){var _0x10aeac=this;return new Promise(function(_0x20ebba,_0x32d115){return db[_0xb93b('0x1b')]['update'](_0x579c7d['body'],{'raw':_0x579c7d[_0xb93b('0x1c')]?_0x579c7d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579c7d[_0xb93b('0x1c')]?_0x579c7d[_0xb93b('0x1c')][_0xb93b('0x1d')]||null:null,'attributes':_0x579c7d['options']?_0x579c7d[_0xb93b('0x1c')][_0xb93b('0x1e')]||null:null,'limit':_0x579c7d[_0xb93b('0x1c')]?_0x579c7d[_0xb93b('0x1c')]['limit']||null:null})['then'](function(_0x4bb61f){logger[_0xb93b('0x10')](_0xb93b('0x1a'),_0x579c7d);logger[_0xb93b('0x12')]('UpdateChatInteraction',_0x579c7d,JSON[_0xb93b('0x14')](_0x4bb61f));_0x20ebba(_0x4bb61f);})[_0xb93b('0x19')](function(_0x560601){logger[_0xb93b('0x15')](_0xb93b('0x1a'),_0x560601[_0xb93b('0x18')],_0x579c7d);_0x32d115(_0x10aeac[_0xb93b('0x15')](0x1f4,_0x560601[_0xb93b('0x18')]));});});};exports[_0xb93b('0x1f')]=function(_0x245ce3){return new Promise(function(_0xccb892,_0x8e0c7b){return db[_0xb93b('0x1b')][_0xb93b('0x20')]({'where':_0x245ce3[_0xb93b('0x1c')]?_0x245ce3[_0xb93b('0x1c')][_0xb93b('0x1d')]||null:null})[_0xb93b('0xf')](function(_0x33bf5e){if(_0x33bf5e){return _0x33bf5e[_0xb93b('0x21')](_0x245ce3[_0xb93b('0x22')][_0xb93b('0x23')],_[_0xb93b('0x24')](_0x245ce3[_0xb93b('0x22')],[_0xb93b('0x23'),'id'])||{});}})[_0xb93b('0x25')](function(_0x340ff0){logger[_0xb93b('0x10')](_0xb93b('0x26'),_0x245ce3);logger[_0xb93b('0x12')]('AddTags',_0x245ce3,JSON['stringify'](_0x340ff0));_0xccb892(_0x340ff0);})[_0xb93b('0x19')](function(_0x32685b){logger[_0xb93b('0x15')](_0xb93b('0x26'),_0x32685b['message'],_0x245ce3);_0x8e0c7b(_this[_0xb93b('0x15')](0x1f4,_0x32685b[_0xb93b('0x18')]));});});}; \ No newline at end of file +var _0x906a=['UpdateChatInteraction','catch','AddTagsToChatInteraction','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','ChatInteraction','update','options','raw','where','attributes','limit'];(function(_0x3a67ee,_0x3cb45d){var _0xaca36a=function(_0x250982){while(--_0x250982){_0x3a67ee['push'](_0x3a67ee['shift']());}};_0xaca36a(++_0x3cb45d);}(_0x906a,0x131));var _0xa906=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x906a[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa906('0x0'));var moment=require(_0xa906('0x1'));var BPromise=require(_0xa906('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa906('0x3'))['db'];var utils=require(_0xa906('0x4'));var logger=require(_0xa906('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa906('0x6')][_0xa906('0x7')]({'port':0x232a});config[_0xa906('0x8')]=_[_0xa906('0x9')](config[_0xa906('0x8')],{'host':_0xa906('0xa'),'port':0x18eb});var socket=require(_0xa906('0xb'))(new Redis(config[_0xa906('0x8')]));require('./chatInteraction.socket')[_0xa906('0xc')](socket);function respondWithRpcPromise(_0x1b1e6a,_0x78abb7,_0x9ec1fd){return new BPromise(function(_0x5a80ac,_0x3e1557){return client['request'](_0x1b1e6a,_0x9ec1fd)[_0xa906('0xd')](function(_0xc6ab23){logger[_0xa906('0xe')](_0xa906('0xf'),_0x78abb7,_0xa906('0x10'));logger[_0xa906('0x11')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x78abb7,_0xa906('0x10'),JSON[_0xa906('0x12')](_0xc6ab23));if(_0xc6ab23[_0xa906('0x13')]){if(_0xc6ab23['error']['code']===0x1f4){logger[_0xa906('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x78abb7,_0xc6ab23[_0xa906('0x13')][_0xa906('0x14')]);return _0x3e1557(_0xc6ab23['error'][_0xa906('0x14')]);}logger['error'](_0xa906('0xf'),_0x78abb7,_0xc6ab23[_0xa906('0x13')]['message']);return _0x5a80ac(_0xc6ab23[_0xa906('0x13')][_0xa906('0x14')]);}else{logger[_0xa906('0xe')](_0xa906('0xf'),_0x78abb7,_0xa906('0x10'));_0x5a80ac(_0xc6ab23['result'][_0xa906('0x14')]);}})['catch'](function(_0x5dede4){logger[_0xa906('0x13')](_0xa906('0xf'),_0x78abb7,_0x5dede4);_0x3e1557(_0x5dede4);});});}exports['UpdateChatInteraction']=function(_0x29a989){var _0x41d1ee=this;return new Promise(function(_0x40e565,_0x2ff9fc){return db[_0xa906('0x15')][_0xa906('0x16')](_0x29a989['body'],{'raw':_0x29a989[_0xa906('0x17')]?_0x29a989['options'][_0xa906('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29a989[_0xa906('0x17')]?_0x29a989[_0xa906('0x17')][_0xa906('0x19')]||null:null,'attributes':_0x29a989[_0xa906('0x17')]?_0x29a989['options'][_0xa906('0x1a')]||null:null,'limit':_0x29a989[_0xa906('0x17')]?_0x29a989[_0xa906('0x17')][_0xa906('0x1b')]||null:null})['then'](function(_0x3ec0aa){logger[_0xa906('0xe')]('UpdateChatInteraction',_0x29a989);logger[_0xa906('0x11')](_0xa906('0x1c'),_0x29a989,JSON['stringify'](_0x3ec0aa));_0x40e565(_0x3ec0aa);})[_0xa906('0x1d')](function(_0x5bfa18){logger['error']('UpdateChatInteraction',_0x5bfa18[_0xa906('0x14')],_0x29a989);_0x2ff9fc(_0x41d1ee[_0xa906('0x13')](0x1f4,_0x5bfa18[_0xa906('0x14')]));});});};exports[_0xa906('0x1e')]=function(_0x416822){return new Promise(function(_0x37c7a3,_0x1b1782){return db['ChatInteraction']['find']({'where':_0x416822[_0xa906('0x17')]?_0x416822['options'][_0xa906('0x19')]||null:null})[_0xa906('0xd')](function(_0x3522db){if(_0x3522db){return _0x3522db[_0xa906('0x1f')](_0x416822[_0xa906('0x20')][_0xa906('0x21')],_[_0xa906('0x22')](_0x416822[_0xa906('0x20')],[_0xa906('0x21'),'id'])||{});}})[_0xa906('0x23')](function(_0xf839ce){logger['info'](_0xa906('0x24'),_0x416822);logger['debug'](_0xa906('0x24'),_0x416822,JSON[_0xa906('0x12')](_0xf839ce));_0x37c7a3(_0xf839ce);})[_0xa906('0x1d')](function(_0x80f3a){logger['error'](_0xa906('0x24'),_0x80f3a['message'],_0x416822);_0x1b1782(_this[_0xa906('0x13')](0x1f4,_0x80f3a[_0xa906('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 606532a..9f5c923 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 _0x8e7b=['removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update','emit'];(function(_0x516884,_0x41f98d){var _0x547ead=function(_0x34d831){while(--_0x34d831){_0x516884['push'](_0x516884['shift']());}};_0x547ead(++_0x41f98d);}(_0x8e7b,0x94));var _0xb8e7=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e7b[_0x57b54c];return _0x59cc19;};'use strict';var ChatInteractionEvents=require(_0xb8e7('0x0'));var events=[_0xb8e7('0x1'),'remove',_0xb8e7('0x2')];function createListener(_0x246784,_0x33fb2f){return function(_0x507249){_0x33fb2f[_0xb8e7('0x3')](_0x246784,_0x507249);};}function removeListener(_0xb1f033,_0x2e9e5f){return function(){ChatInteractionEvents[_0xb8e7('0x4')](_0xb1f033,_0x2e9e5f);};}exports[_0xb8e7('0x5')]=function(_0x360a98){for(var _0x68a336=0x0,_0x3e5217=events[_0xb8e7('0x6')];_0x68a336<_0x3e5217;_0x68a336++){var _0x22f85e=events[_0x68a336];var _0x13006c=createListener(_0xb8e7('0x7')+_0x22f85e,_0x360a98);ChatInteractionEvents['on'](_0x22f85e,_0x13006c);}}; \ No newline at end of file +var _0xd08a=['register','length','chatInteraction:','./chatInteraction.events','save','remove','update','emit'];(function(_0x17f928,_0x5b3e05){var _0x35f22b=function(_0x55b336){while(--_0x55b336){_0x17f928['push'](_0x17f928['shift']());}};_0x35f22b(++_0x5b3e05);}(_0xd08a,0x83));var _0xad08=function(_0x2cae70,_0x3cd1b2){_0x2cae70=_0x2cae70-0x0;var _0x19efac=_0xd08a[_0x2cae70];return _0x19efac;};'use strict';var ChatInteractionEvents=require(_0xad08('0x0'));var events=[_0xad08('0x1'),_0xad08('0x2'),_0xad08('0x3')];function createListener(_0x50421b,_0x10f1a5){return function(_0x29308f){_0x10f1a5[_0xad08('0x4')](_0x50421b,_0x29308f);};}function removeListener(_0x2ff63d,_0x1ecd0a){return function(){ChatInteractionEvents['removeListener'](_0x2ff63d,_0x1ecd0a);};}exports[_0xad08('0x5')]=function(_0x4155b2){for(var _0x55a59c=0x0,_0xe08a50=events[_0xad08('0x6')];_0x55a59c<_0xe08a50;_0x55a59c++){var _0x2a358a=events[_0x55a59c];var _0x258773=createListener(_0xad08('0x7')+_0x2a358a,_0x4155b2);ChatInteractionEvents['on'](_0x2a358a,_0x258773);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 5cbc7d9..8648bcd 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 _0x9633=['now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','/:id/custom_update','customUpdate','/:id/close','close','delete','/:id','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','download','post','create','createVidaooSession','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0x9633,0x18b));var _0x3963=function(_0x186c8b,_0x443ab7){_0x186c8b=_0x186c8b-0x0;var _0x637dcc=_0x9633[_0x186c8b];return _0x637dcc;};'use strict';var multer=require(_0x3963('0x0'));var util=require(_0x3963('0x1'));var path=require(_0x3963('0x2'));var timeout=require(_0x3963('0x3'));var express=require(_0x3963('0x4'));var router=express[_0x3963('0x5')]();var fs_extra=require(_0x3963('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3963('0x7'));var config=require(_0x3963('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x3963('0x9')](),controller['index']);router[_0x3963('0xa')](_0x3963('0xb'),auth[_0x3963('0x9')](),controller[_0x3963('0xc')]);router[_0x3963('0xa')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x3963('0xd')]);router[_0x3963('0xa')](_0x3963('0xe'),auth[_0x3963('0xf')](),controller[_0x3963('0x10')]);router[_0x3963('0xa')](_0x3963('0x11'),auth[_0x3963('0x9')](),controller[_0x3963('0x12')]);router[_0x3963('0xa')](_0x3963('0x13'),auth[_0x3963('0xf')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x3963('0x9')](),controller[_0x3963('0x14')]);router[_0x3963('0x15')]('/',auth[_0x3963('0x9')](),controller[_0x3963('0x16')]);router['post']('/:id/vidaoo',auth[_0x3963('0x9')](),controller[_0x3963('0x17')]);var upload=multer({'storage':multer[_0x3963('0x18')]({'destination':function(_0x17e001,_0x5ae652,_0x238c1d){_0x238c1d(null,path[_0x3963('0x19')](config['root'],_0x3963('0x1a')));},'filename':function(_0x52f29b,_0x5086f8,_0x4255c5){_0x4255c5(null,util[_0x3963('0x1b')](_0x3963('0x1c'),Date[_0x3963('0x1d')](),_0x5086f8[_0x3963('0x1e')][_0x3963('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3963('0x15')](_0x3963('0x20'),upload['single'](_0x3963('0x21')),controller[_0x3963('0x22')]);router[_0x3963('0x15')](_0x3963('0x11'),auth[_0x3963('0xf')](),controller[_0x3963('0x23')]);router[_0x3963('0x15')]('/:id/tags',auth[_0x3963('0x9')](),interaction[_0x3963('0x24')](_0x3963('0x25'),_0x3963('0x26')),controller[_0x3963('0x27')]);router[_0x3963('0x28')]('/:id',auth['isAuthenticated'](),interaction[_0x3963('0x24')](_0x3963('0x25'),_0x3963('0x29')),controller['update']);router[_0x3963('0x28')](_0x3963('0x2a'),controller[_0x3963('0x2b')]);router[_0x3963('0x28')]('/:id/abandon',auth[_0x3963('0xf')](),controller['abandon']);router[_0x3963('0x28')](_0x3963('0x2c'),controller[_0x3963('0x2d')]);router[_0x3963('0x2e')](_0x3963('0x2f'),auth[_0x3963('0x9')](),interaction[_0x3963('0x24')](_0x3963('0x25'),_0x3963('0x30')),controller[_0x3963('0x31')]);router[_0x3963('0x2e')](_0x3963('0x32'),auth[_0x3963('0x9')](),controller[_0x3963('0x33')]);module[_0x3963('0x34')]=router; \ No newline at end of file +var _0xa412=['create','/:id/vidaoo','createVidaooSession','root','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','abandon','/:id/close','close','delete','tracked','chatinteraction:destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa412,0x7b));var _0x2a41=function(_0x222d8c,_0xb33dc4){_0x222d8c=_0x222d8c-0x0;var _0x6ef84c=_0xa412[_0x222d8c];return _0x6ef84c;};'use strict';var multer=require(_0x2a41('0x0'));var util=require(_0x2a41('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2a41('0x2'));var router=express[_0x2a41('0x3')]();var fs_extra=require(_0x2a41('0x4'));var auth=require(_0x2a41('0x5'));var interaction=require(_0x2a41('0x6'));var config=require(_0x2a41('0x7'));var controller=require(_0x2a41('0x8'));router[_0x2a41('0x9')]('/',auth[_0x2a41('0xa')](),controller['index']);router[_0x2a41('0x9')]('/describe',auth[_0x2a41('0xa')](),controller[_0x2a41('0xb')]);router['get'](_0x2a41('0xc'),auth[_0x2a41('0xd')](),controller['show']);router[_0x2a41('0x9')]('/:id/attachment_download',auth[_0x2a41('0xd')](),controller[_0x2a41('0xe')]);router[_0x2a41('0x9')](_0x2a41('0xf'),auth[_0x2a41('0xa')](),controller['getMessages']);router['get'](_0x2a41('0x10'),auth[_0x2a41('0xd')](),controller[_0x2a41('0x11')]);router[_0x2a41('0x9')](_0x2a41('0x12'),auth[_0x2a41('0xa')](),controller[_0x2a41('0x13')]);router[_0x2a41('0x14')]('/',auth[_0x2a41('0xa')](),controller[_0x2a41('0x15')]);router['post'](_0x2a41('0x16'),auth['isAuthenticated'](),controller[_0x2a41('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x150811,_0x2bf6c5,_0x3d7d20){_0x3d7d20(null,path['join'](config[_0x2a41('0x18')],'server/files/attachments/'));},'filename':function(_0x592cd8,_0x4a7612,_0x1b21dc){_0x1b21dc(null,util[_0x2a41('0x19')](_0x2a41('0x1a'),Date[_0x2a41('0x1b')](),_0x4a7612[_0x2a41('0x1c')][_0x2a41('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x2a41('0x1e')](_0x2a41('0x1f')),controller[_0x2a41('0x20')]);router[_0x2a41('0x14')](_0x2a41('0xf'),auth[_0x2a41('0xd')](),controller[_0x2a41('0x21')]);router[_0x2a41('0x14')](_0x2a41('0x22'),auth[_0x2a41('0xa')](),interaction['tracked'](_0x2a41('0x23'),_0x2a41('0x24')),controller[_0x2a41('0x25')]);router[_0x2a41('0x26')](_0x2a41('0xc'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x2a41('0x27')),controller[_0x2a41('0x28')]);router[_0x2a41('0x26')](_0x2a41('0x29'),controller['customUpdate']);router[_0x2a41('0x26')]('/:id/abandon',auth[_0x2a41('0xd')](),controller[_0x2a41('0x2a')]);router[_0x2a41('0x26')](_0x2a41('0x2b'),controller[_0x2a41('0x2c')]);router[_0x2a41('0x2d')](_0x2a41('0xc'),auth['isAuthenticated'](),interaction[_0x2a41('0x2e')](_0x2a41('0x23'),_0x2a41('0x2f')),controller['destroy']);router[_0x2a41('0x2d')]('/:id/tags',auth[_0x2a41('0xa')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 87a2b2a..6c50cb4 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 _0x609a=['medium','BOOLEAN','INTEGER','sequelize','exports','TEXT'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x609a,0x1b3));var _0xa609=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x609a[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xa609('0x0'));module[_0xa609('0x1')]={'body':{'type':Sequelize[_0xa609('0x2')](_0xa609('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa609('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa609('0x5')]}}; \ No newline at end of file +var _0x09e3=['BOOLEAN','INTEGER','sequelize','exports','TEXT','medium'];(function(_0x3e6562,_0xc209e){var _0x4b1f26=function(_0x436e4b){while(--_0x436e4b){_0x3e6562['push'](_0x3e6562['shift']());}};_0x4b1f26(++_0xc209e);}(_0x09e3,0x1b8));var _0x309e=function(_0x29ad00,_0x32cdd5){_0x29ad00=_0x29ad00-0x0;var _0x1e3819=_0x09e3[_0x29ad00];return _0x1e3819;};'use strict';var Sequelize=require(_0x309e('0x0'));module[_0x309e('0x1')]={'body':{'type':Sequelize[_0x309e('0x2')](_0x309e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x309e('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x309e('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 622e861..ebbb968 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 _0x1a9a=['util','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','VIRTUAL','merge','options','includeAll','include','show','params','find','catch','create','body','describe','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','sort','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x1a5ad1,_0x357407){var _0x7b8b22=function(_0x312e53){while(--_0x312e53){_0x1a5ad1['push'](_0x1a5ad1['shift']());}};_0x7b8b22(++_0x357407);}(_0x1a9a,0x137));var _0xa1a9=function(_0x4fb113,_0x54d83b){_0x4fb113=_0x4fb113-0x0;var _0x4c8cb4=_0x1a9a[_0x4fb113];return _0x4c8cb4;};'use strict';var emlformat=require(_0xa1a9('0x0'));var rimraf=require(_0xa1a9('0x1'));var zipdir=require(_0xa1a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1a9('0x3'));var moment=require(_0xa1a9('0x4'));var BPromise=require(_0xa1a9('0x5'));var Mustache=require(_0xa1a9('0x6'));var util=require(_0xa1a9('0x7'));var path=require('path');var sox=require(_0xa1a9('0x8'));var csv=require('to-csv');var ejs=require(_0xa1a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1a9('0xa'));var squel=require(_0xa1a9('0xb'));var crypto=require(_0xa1a9('0xc'));var jsforce=require(_0xa1a9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa1a9('0xe'));var Papa=require(_0xa1a9('0xf'));var Redis=require(_0xa1a9('0x10'));var authService=require(_0xa1a9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1a9('0x12'));var logger=require(_0xa1a9('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa1a9('0x14')]=_['defaults'](config[_0xa1a9('0x14')],{'host':_0xa1a9('0x15'),'port':0x18eb});var socket=require(_0xa1a9('0x16'))(new Redis(config[_0xa1a9('0x14')]));require(_0xa1a9('0x17'))[_0xa1a9('0x18')](socket);function respondWithStatusCode(_0x53c971,_0x286179){_0x286179=_0x286179||0xcc;return function(_0x2c563a){if(_0x2c563a){return _0x53c971['sendStatus'](_0x286179);}return _0x53c971[_0xa1a9('0x19')](_0x286179)[_0xa1a9('0x1a')]();};}function respondWithResult(_0x596a3e,_0xa7cb15){_0xa7cb15=_0xa7cb15||0xc8;return function(_0x56e9c3){if(_0x56e9c3){return _0x596a3e[_0xa1a9('0x19')](_0xa7cb15)[_0xa1a9('0x1b')](_0x56e9c3);}};}function respondWithFilteredResult(_0x2e1e64,_0x3700b3){return function(_0x28ecb8){if(_0x28ecb8){var _0x1b47a0=typeof _0x3700b3['offset']==='undefined'&&typeof _0x3700b3[_0xa1a9('0x1c')]===_0xa1a9('0x1d');var _0xffc699=_0x28ecb8[_0xa1a9('0x1e')];var _0x25afd7=_0x1b47a0?0x0:_0x3700b3[_0xa1a9('0x1f')];var _0x32dab8=_0x1b47a0?_0x28ecb8['count']:_0x3700b3[_0xa1a9('0x1f')]+_0x3700b3[_0xa1a9('0x1c')];var _0x245894;if(_0x32dab8>=_0xffc699){_0x32dab8=_0xffc699;_0x245894=0xc8;}else{_0x245894=0xce;}_0x2e1e64[_0xa1a9('0x19')](_0x245894);return _0x2e1e64[_0xa1a9('0x20')](_0xa1a9('0x21'),_0x25afd7+'-'+_0x32dab8+'/'+_0xffc699)['json'](_0x28ecb8);}return null;};}function patchUpdates(_0x392dbf){return function(_0x31e422){try{jsonpatch[_0xa1a9('0x22')](_0x31e422,_0x392dbf,!![]);}catch(_0xc51137){return BPromise[_0xa1a9('0x23')](_0xc51137);}return _0x31e422[_0xa1a9('0x24')]();};}function saveUpdates(_0x479fe4,_0x39a963){return function(_0x2b1c8a){if(_0x2b1c8a){return _0x2b1c8a[_0xa1a9('0x25')](_0x479fe4)[_0xa1a9('0x26')](function(_0x28c476){return _0x28c476;});}return null;};}function removeEntity(_0x5e762b,_0x4bb352){return function(_0xb42597){if(_0xb42597){return _0xb42597[_0xa1a9('0x27')]()['then'](function(){_0x5e762b[_0xa1a9('0x19')](0xcc)[_0xa1a9('0x1a')]();});}};}function handleEntityNotFound(_0x5c3863,_0x595ffb){return function(_0x26a091){if(!_0x26a091){_0x5c3863['sendStatus'](0x194);}return _0x26a091;};}function handleError(_0x47e190,_0x239b5b){_0x239b5b=_0x239b5b||0x1f4;return function(_0x1ecd17){logger['error'](_0x1ecd17[_0xa1a9('0x28')]);if(_0x1ecd17[_0xa1a9('0x29')]){delete _0x1ecd17[_0xa1a9('0x29')];}_0x47e190[_0xa1a9('0x19')](_0x239b5b)['send'](_0x1ecd17);};}exports[_0xa1a9('0x2a')]=function(_0x30db42,_0x1fa05b){var _0x5a17bb={},_0x1ae930={},_0x2be3c8={'count':0x0,'rows':[]};var _0x2300d9=_[_0xa1a9('0x2b')](db[_0xa1a9('0x2c')][_0xa1a9('0x2d')],function(_0x311e74){return{'name':_0x311e74[_0xa1a9('0x2e')],'type':_0x311e74[_0xa1a9('0x2f')][_0xa1a9('0x30')]};});_0x1ae930[_0xa1a9('0x31')]=_[_0xa1a9('0x2b')](_0x2300d9,_0xa1a9('0x29'));_0x1ae930[_0xa1a9('0x32')]=_[_0xa1a9('0x33')](_0x30db42[_0xa1a9('0x32')]);_0x1ae930[_0xa1a9('0x34')]=_[_0xa1a9('0x35')](_0x1ae930['model'],_0x1ae930[_0xa1a9('0x32')]);_0x5a17bb[_0xa1a9('0x36')]=_[_0xa1a9('0x35')](_0x1ae930[_0xa1a9('0x31')],qs[_0xa1a9('0x37')](_0x30db42['query'][_0xa1a9('0x37')]));_0x5a17bb['attributes']=_0x5a17bb[_0xa1a9('0x36')][_0xa1a9('0x38')]?_0x5a17bb[_0xa1a9('0x36')]:_0x1ae930[_0xa1a9('0x31')];if(!_0x30db42[_0xa1a9('0x32')][_0xa1a9('0x39')]('nolimit')){_0x5a17bb[_0xa1a9('0x1c')]=qs[_0xa1a9('0x1c')](_0x30db42[_0xa1a9('0x32')][_0xa1a9('0x1c')]);_0x5a17bb['offset']=qs[_0xa1a9('0x1f')](_0x30db42[_0xa1a9('0x32')]['offset']);}_0x5a17bb['order']=qs['sort'](_0x30db42[_0xa1a9('0x32')]['sort']);_0x5a17bb[_0xa1a9('0x3a')]=qs[_0xa1a9('0x34')](_[_0xa1a9('0x3b')](_0x30db42[_0xa1a9('0x32')],_0x1ae930[_0xa1a9('0x34')]),_0x2300d9);if(_0x30db42[_0xa1a9('0x32')]['filter']){_0x5a17bb[_0xa1a9('0x3a')]=_['merge'](_0x5a17bb[_0xa1a9('0x3a')],{'$or':_[_0xa1a9('0x2b')](_0x2300d9,function(_0xbe3a7){if(_0xbe3a7[_0xa1a9('0x2f')]!==_0xa1a9('0x3c')){var _0x44de72={};_0x44de72[_0xbe3a7['name']]={'$like':'%'+_0x30db42['query']['filter']+'%'};return _0x44de72;}})});}_0x5a17bb=_[_0xa1a9('0x3d')]({},_0x5a17bb,_0x30db42[_0xa1a9('0x3e')]);var _0x20766e={'where':_0x5a17bb[_0xa1a9('0x3a')]};return db[_0xa1a9('0x2c')][_0xa1a9('0x1e')](_0x20766e)['then'](function(_0x21047d){_0x2be3c8['count']=_0x21047d;if(_0x30db42['query'][_0xa1a9('0x3f')]){_0x5a17bb[_0xa1a9('0x40')]=[{'all':!![]}];}return db[_0xa1a9('0x2c')]['findAll'](_0x5a17bb);})[_0xa1a9('0x26')](function(_0x1685f6){_0x2be3c8['rows']=_0x1685f6;return _0x2be3c8;})[_0xa1a9('0x26')](respondWithFilteredResult(_0x1fa05b,_0x5a17bb))['catch'](handleError(_0x1fa05b,null));};exports[_0xa1a9('0x41')]=function(_0x9617bc,_0x591a97){var _0x459fa7={'raw':!![],'where':{'id':_0x9617bc[_0xa1a9('0x42')]['id']}},_0x53abfe={};_0x53abfe[_0xa1a9('0x31')]=_[_0xa1a9('0x33')](db[_0xa1a9('0x2c')][_0xa1a9('0x2d')]);_0x53abfe[_0xa1a9('0x32')]=_[_0xa1a9('0x33')](_0x9617bc[_0xa1a9('0x32')]);_0x53abfe[_0xa1a9('0x34')]=_[_0xa1a9('0x35')](_0x53abfe['model'],_0x53abfe[_0xa1a9('0x32')]);_0x459fa7[_0xa1a9('0x36')]=_[_0xa1a9('0x35')](_0x53abfe['model'],qs[_0xa1a9('0x37')](_0x9617bc[_0xa1a9('0x32')][_0xa1a9('0x37')]));_0x459fa7[_0xa1a9('0x36')]=_0x459fa7[_0xa1a9('0x36')][_0xa1a9('0x38')]?_0x459fa7[_0xa1a9('0x36')]:_0x53abfe[_0xa1a9('0x31')];if(_0x9617bc[_0xa1a9('0x32')][_0xa1a9('0x3f')]){_0x459fa7['include']=[{'all':!![]}];}_0x459fa7=_['merge']({},_0x459fa7,_0x9617bc['options']);return db[_0xa1a9('0x2c')][_0xa1a9('0x43')](_0x459fa7)[_0xa1a9('0x26')](handleEntityNotFound(_0x591a97,null))[_0xa1a9('0x26')](respondWithResult(_0x591a97,null))[_0xa1a9('0x44')](handleError(_0x591a97,null));};exports['create']=function(_0x1324f9,_0x32cdf1){return db['ChatInternalMessage'][_0xa1a9('0x45')](_0x1324f9[_0xa1a9('0x46')],{})[_0xa1a9('0x26')](respondWithResult(_0x32cdf1,0xc9))[_0xa1a9('0x44')](handleError(_0x32cdf1,null));};exports[_0xa1a9('0x25')]=function(_0x3800d4,_0x285c3e){if(_0x3800d4['body']['id']){delete _0x3800d4[_0xa1a9('0x46')]['id'];}return db['ChatInternalMessage'][_0xa1a9('0x43')]({'where':{'id':_0x3800d4[_0xa1a9('0x42')]['id']}})['then'](handleEntityNotFound(_0x285c3e,null))[_0xa1a9('0x26')](saveUpdates(_0x3800d4['body'],null))[_0xa1a9('0x26')](respondWithResult(_0x285c3e,null))[_0xa1a9('0x44')](handleError(_0x285c3e,null));};exports[_0xa1a9('0x27')]=function(_0x2d05be,_0x174dba){return db[_0xa1a9('0x2c')][_0xa1a9('0x43')]({'where':{'id':_0x2d05be[_0xa1a9('0x42')]['id']}})[_0xa1a9('0x26')](handleEntityNotFound(_0x174dba,null))[_0xa1a9('0x26')](removeEntity(_0x174dba,null))[_0xa1a9('0x44')](handleError(_0x174dba,null));};exports[_0xa1a9('0x47')]=function(_0x5ea992,_0x5d7df4){return db[_0xa1a9('0x2c')][_0xa1a9('0x47')]()[_0xa1a9('0x26')](respondWithResult(_0x5d7df4,null))['catch'](handleError(_0x5d7df4,null));};function wrapUser(_0x3b0ff0){return function(_0x54403a){var _0x1e1c10=_0x3b0ff0['get']({'plain':!![]});_0x1e1c10[_0xa1a9('0x48')]=[];if(_0x54403a){_0x1e1c10[_0xa1a9('0x49')]=_0x54403a[_0xa1a9('0x4a')];_0x1e1c10['lastMessage']=_0x54403a;}else{_0x1e1c10[_0xa1a9('0x49')]=moment(0x0)['format'](_0xa1a9('0x4b'));_0x1e1c10[_0xa1a9('0x4c')]={};}return _0x1e1c10;};}exports[_0xa1a9('0x4d')]=function(_0x5f1f9c,_0x32e7e4,_0x5937be){var _0x2985c0=[];return db[_0xa1a9('0x4e')][_0xa1a9('0x4f')]({'where':{'role':[_0xa1a9('0x50'),_0xa1a9('0x51'),_0xa1a9('0x52')]},'attributes':['id',_0xa1a9('0x53'),'name',_0xa1a9('0x54'),'userpic',_0xa1a9('0x55'),_0xa1a9('0x56'),_0xa1a9('0x57'),_0xa1a9('0x58'),_0xa1a9('0x59')],'order':qs[_0xa1a9('0x5a')](_0xa1a9('0x5b')),'include':[{'model':db[_0xa1a9('0x5c')],'as':_0xa1a9('0x5d'),'attributes':['id',_0xa1a9('0x29'),_0xa1a9('0x2f')],'through':{'attributes':[]}}]})[_0xa1a9('0x26')](function(_0x4f88b7){if(_0x4f88b7){var _0x3f47eb=_0x5f1f9c[_0xa1a9('0x52')][_0xa1a9('0x5e')]({'plain':!![]});if(!_0x3f47eb)throw new Error(_0xa1a9('0x5f'));if(_0x3f47eb[_0xa1a9('0x54')]===_0xa1a9('0x52')){return db[_0xa1a9('0x60')][_0xa1a9('0x43')]({'where':{'name':'Agents','userProfileId':_0x3f47eb[_0xa1a9('0x61')]},'raw':!![]})[_0xa1a9('0x26')](function(_0x269525){if(_0x269525){if(_0x269525[_0xa1a9('0x62')]===0x0){return db[_0xa1a9('0x63')][_0xa1a9('0x4f')]({'where':{'sectionId':_0x269525['id']},'raw':!![]})[_0xa1a9('0x26')](function(_0x30c1f6){var _0x1f8356=[];if(_['isEmpty'](_0x30c1f6)){_0x1f8356=_['filter'](_0x4f88b7,function(_0x7dc693){if(_0x7dc693['role']!==_0xa1a9('0x50')){return _0x7dc693;}});return _0x1f8356;}else{for(var _0x1808a6=0x0;_0x1808a6<_0x4f88b7[_0xa1a9('0x38')];_0x1808a6++){var _0x33a20e=_0x4f88b7[_0x1808a6];if(_0x33a20e[_0xa1a9('0x54')]===_0xa1a9('0x50')){var _0xb26478=_[_0xa1a9('0x43')](_0x30c1f6,function(_0x5c093a){return _0x5c093a[_0xa1a9('0x64')]===_0x33a20e['id'];});if(_0xb26478)_0x1f8356['push'](_0x33a20e);}else{_0x1f8356[_0xa1a9('0x65')](_0x33a20e);}}return _0x1f8356;}});}else{return _0x4f88b7;}}else{var _0x4eef96=_['filter'](_0x4f88b7,function(_0x51adb4){if(_0x51adb4[_0xa1a9('0x54')]!==_0xa1a9('0x50')){return _0x51adb4;}});return _0x4eef96;}});}else{return _0x4f88b7;}}})[_0xa1a9('0x26')](function(_0x30e98d){var _0x314d1f=[];if(_0x30e98d){_0x2985c0=_0x30e98d;for(var _0x18b133=0x0;_0x18b133<_0x30e98d[_0xa1a9('0x38')];_0x18b133+=0x1){_0x2985c0[_0x18b133][_0xa1a9('0x48')]=[];_0x314d1f['push'](db[_0xa1a9('0x2c')][_0xa1a9('0x43')]({'where':{'FromId':[_0x5f1f9c[_0xa1a9('0x52')]['id'],_0x30e98d[_0x18b133]['id']],'ToId':[_0x5f1f9c[_0xa1a9('0x52')]['id'],_0x30e98d[_0x18b133]['id']],'ChatGroupId':null},'attributes':['id',_0xa1a9('0x4a'),'FromId',_0xa1a9('0x66'),_0xa1a9('0x67'),_0xa1a9('0x46')],'order':qs[_0xa1a9('0x5a')](_0xa1a9('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa1a9('0x26')](wrapUser(_0x30e98d[_0x18b133])));}return BPromise[_0xa1a9('0x69')](_0x314d1f);}return[];})['then'](function(_0x5bb777){return{'rows':_0x5bb777,'count':_0x5bb777[_0xa1a9('0x38')]};})['then'](respondWithResult(_0x32e7e4,null))[_0xa1a9('0x44')](handleError(_0x32e7e4,null));}; \ No newline at end of file +var _0xaa4c=['ToId','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','offset','update','destroy','end','stack','map','ChatInternalMessage','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','then','includeAll','include','findAll','rows','catch','show','create','body','params','find','describe','lastMessageAt','createdAt','lastMessage','format','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','FromId'];(function(_0x4cc368,_0x5653a1){var _0x98f617=function(_0x4c5a65){while(--_0x4c5a65){_0x4cc368['push'](_0x4cc368['shift']());}};_0x98f617(++_0x5653a1);}(_0xaa4c,0xd5));var _0xcaa4=function(_0x385c1f,_0x42721b){_0x385c1f=_0x385c1f-0x0;var _0x1478dd=_0xaa4c[_0x385c1f];return _0x1478dd;};'use strict';var emlformat=require(_0xcaa4('0x0'));var rimraf=require(_0xcaa4('0x1'));var zipdir=require(_0xcaa4('0x2'));var jsonpatch=require(_0xcaa4('0x3'));var rp=require('request-promise');var moment=require(_0xcaa4('0x4'));var BPromise=require(_0xcaa4('0x5'));var Mustache=require(_0xcaa4('0x6'));var util=require(_0xcaa4('0x7'));var path=require(_0xcaa4('0x8'));var sox=require(_0xcaa4('0x9'));var csv=require(_0xcaa4('0xa'));var ejs=require(_0xcaa4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcaa4('0xc'));var jsforce=require(_0xcaa4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcaa4('0xa'));var querystring=require(_0xcaa4('0xe'));var Papa=require(_0xcaa4('0xf'));var Redis=require(_0xcaa4('0x10'));var authService=require(_0xcaa4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcaa4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaa4('0x13'))(_0xcaa4('0x14'));var utils=require(_0xcaa4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xcaa4('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xcaa4('0x17')](config['redis'],{'host':_0xcaa4('0x18'),'port':0x18eb});var socket=require(_0xcaa4('0x19'))(new Redis(config[_0xcaa4('0x1a')]));require(_0xcaa4('0x1b'))[_0xcaa4('0x1c')](socket);function respondWithStatusCode(_0x1c437a,_0x2dc896){_0x2dc896=_0x2dc896||0xcc;return function(_0x70223b){if(_0x70223b){return _0x1c437a[_0xcaa4('0x1d')](_0x2dc896);}return _0x1c437a[_0xcaa4('0x1e')](_0x2dc896)['end']();};}function respondWithResult(_0x2e7341,_0x51ef82){_0x51ef82=_0x51ef82||0xc8;return function(_0x5bb306){if(_0x5bb306){return _0x2e7341[_0xcaa4('0x1e')](_0x51ef82)[_0xcaa4('0x1f')](_0x5bb306);}};}function respondWithFilteredResult(_0x4497e1,_0x5e9c9d){return function(_0x95d69e){if(_0x95d69e){var _0x2310fb=typeof _0x5e9c9d['offset']===_0xcaa4('0x20')&&typeof _0x5e9c9d[_0xcaa4('0x21')]===_0xcaa4('0x20');var _0x556c9a=_0x95d69e[_0xcaa4('0x22')];var _0xc4a2b1=_0x2310fb?0x0:_0x5e9c9d[_0xcaa4('0x23')];var _0x7b0e8d=_0x2310fb?_0x95d69e[_0xcaa4('0x22')]:_0x5e9c9d['offset']+_0x5e9c9d[_0xcaa4('0x21')];var _0x36a1d2;if(_0x7b0e8d>=_0x556c9a){_0x7b0e8d=_0x556c9a;_0x36a1d2=0xc8;}else{_0x36a1d2=0xce;}_0x4497e1['status'](_0x36a1d2);return _0x4497e1['set']('Content-Range',_0xc4a2b1+'-'+_0x7b0e8d+'/'+_0x556c9a)[_0xcaa4('0x1f')](_0x95d69e);}return null;};}function patchUpdates(_0x579c79){return function(_0xb324cc){try{jsonpatch['apply'](_0xb324cc,_0x579c79,!![]);}catch(_0x54db84){return BPromise['reject'](_0x54db84);}return _0xb324cc['save']();};}function saveUpdates(_0x10ba54,_0x9b6e73){return function(_0x593012){if(_0x593012){return _0x593012[_0xcaa4('0x24')](_0x10ba54)['then'](function(_0x6bdc2d){return _0x6bdc2d;});}return null;};}function removeEntity(_0x3b0062,_0x59c7cd){return function(_0x3aa510){if(_0x3aa510){return _0x3aa510[_0xcaa4('0x25')]()['then'](function(){_0x3b0062[_0xcaa4('0x1e')](0xcc)[_0xcaa4('0x26')]();});}};}function handleEntityNotFound(_0x4c20bc,_0x5c9333){return function(_0x59f170){if(!_0x59f170){_0x4c20bc[_0xcaa4('0x1d')](0x194);}return _0x59f170;};}function handleError(_0x48851a,_0x3bcbc4){_0x3bcbc4=_0x3bcbc4||0x1f4;return function(_0x100f98){logger['error'](_0x100f98[_0xcaa4('0x27')]);if(_0x100f98['name']){delete _0x100f98['name'];}_0x48851a[_0xcaa4('0x1e')](_0x3bcbc4)['send'](_0x100f98);};}exports['index']=function(_0x417f39,_0x1d43b7){var _0x11dc2c={},_0x2cf2a4={},_0x1de362={'count':0x0,'rows':[]};var _0x3ff999=_[_0xcaa4('0x28')](db[_0xcaa4('0x29')]['rawAttributes'],function(_0xecf16e){return{'name':_0xecf16e[_0xcaa4('0x2a')],'type':_0xecf16e[_0xcaa4('0x2b')]['key']};});_0x2cf2a4['model']=_['map'](_0x3ff999,'name');_0x2cf2a4[_0xcaa4('0x2c')]=_[_0xcaa4('0x2d')](_0x417f39[_0xcaa4('0x2c')]);_0x2cf2a4[_0xcaa4('0x2e')]=_[_0xcaa4('0x2f')](_0x2cf2a4[_0xcaa4('0x30')],_0x2cf2a4[_0xcaa4('0x2c')]);_0x11dc2c['attributes']=_[_0xcaa4('0x2f')](_0x2cf2a4[_0xcaa4('0x30')],qs[_0xcaa4('0x31')](_0x417f39[_0xcaa4('0x2c')][_0xcaa4('0x31')]));_0x11dc2c[_0xcaa4('0x32')]=_0x11dc2c[_0xcaa4('0x32')][_0xcaa4('0x33')]?_0x11dc2c[_0xcaa4('0x32')]:_0x2cf2a4[_0xcaa4('0x30')];if(!_0x417f39[_0xcaa4('0x2c')]['hasOwnProperty'](_0xcaa4('0x34'))){_0x11dc2c[_0xcaa4('0x21')]=qs[_0xcaa4('0x21')](_0x417f39['query'][_0xcaa4('0x21')]);_0x11dc2c[_0xcaa4('0x23')]=qs['offset'](_0x417f39[_0xcaa4('0x2c')][_0xcaa4('0x23')]);}_0x11dc2c[_0xcaa4('0x35')]=qs[_0xcaa4('0x36')](_0x417f39[_0xcaa4('0x2c')][_0xcaa4('0x36')]);_0x11dc2c[_0xcaa4('0x37')]=qs['filters'](_['pick'](_0x417f39[_0xcaa4('0x2c')],_0x2cf2a4[_0xcaa4('0x2e')]),_0x3ff999);if(_0x417f39[_0xcaa4('0x2c')][_0xcaa4('0x38')]){_0x11dc2c[_0xcaa4('0x37')]=_[_0xcaa4('0x39')](_0x11dc2c[_0xcaa4('0x37')],{'$or':_[_0xcaa4('0x28')](_0x3ff999,function(_0x240f19){if(_0x240f19[_0xcaa4('0x2b')]!==_0xcaa4('0x3a')){var _0xc9f4aa={};_0xc9f4aa[_0x240f19[_0xcaa4('0x3b')]]={'$like':'%'+_0x417f39['query'][_0xcaa4('0x38')]+'%'};return _0xc9f4aa;}})});}_0x11dc2c=_[_0xcaa4('0x39')]({},_0x11dc2c,_0x417f39[_0xcaa4('0x3c')]);var _0x3ea437={'where':_0x11dc2c[_0xcaa4('0x37')]};return db['ChatInternalMessage'][_0xcaa4('0x22')](_0x3ea437)[_0xcaa4('0x3d')](function(_0x252264){_0x1de362[_0xcaa4('0x22')]=_0x252264;if(_0x417f39[_0xcaa4('0x2c')][_0xcaa4('0x3e')]){_0x11dc2c[_0xcaa4('0x3f')]=[{'all':!![]}];}return db[_0xcaa4('0x29')][_0xcaa4('0x40')](_0x11dc2c);})[_0xcaa4('0x3d')](function(_0x3a9757){_0x1de362[_0xcaa4('0x41')]=_0x3a9757;return _0x1de362;})[_0xcaa4('0x3d')](respondWithFilteredResult(_0x1d43b7,_0x11dc2c))[_0xcaa4('0x42')](handleError(_0x1d43b7,null));};exports[_0xcaa4('0x43')]=function(_0x43ad06,_0x21adf2){var _0x49be1b={'raw':!![],'where':{'id':_0x43ad06['params']['id']}},_0x6eb9ef={};_0x6eb9ef[_0xcaa4('0x30')]=_[_0xcaa4('0x2d')](db['ChatInternalMessage']['rawAttributes']);_0x6eb9ef[_0xcaa4('0x2c')]=_[_0xcaa4('0x2d')](_0x43ad06['query']);_0x6eb9ef['filters']=_['intersection'](_0x6eb9ef[_0xcaa4('0x30')],_0x6eb9ef[_0xcaa4('0x2c')]);_0x49be1b['attributes']=_[_0xcaa4('0x2f')](_0x6eb9ef[_0xcaa4('0x30')],qs[_0xcaa4('0x31')](_0x43ad06[_0xcaa4('0x2c')][_0xcaa4('0x31')]));_0x49be1b[_0xcaa4('0x32')]=_0x49be1b[_0xcaa4('0x32')][_0xcaa4('0x33')]?_0x49be1b[_0xcaa4('0x32')]:_0x6eb9ef[_0xcaa4('0x30')];if(_0x43ad06[_0xcaa4('0x2c')][_0xcaa4('0x3e')]){_0x49be1b['include']=[{'all':!![]}];}_0x49be1b=_[_0xcaa4('0x39')]({},_0x49be1b,_0x43ad06[_0xcaa4('0x3c')]);return db[_0xcaa4('0x29')]['find'](_0x49be1b)[_0xcaa4('0x3d')](handleEntityNotFound(_0x21adf2,null))[_0xcaa4('0x3d')](respondWithResult(_0x21adf2,null))['catch'](handleError(_0x21adf2,null));};exports[_0xcaa4('0x44')]=function(_0x227891,_0xccb8f4){return db[_0xcaa4('0x29')]['create'](_0x227891[_0xcaa4('0x45')],{})['then'](respondWithResult(_0xccb8f4,0xc9))[_0xcaa4('0x42')](handleError(_0xccb8f4,null));};exports[_0xcaa4('0x24')]=function(_0x599617,_0x67c542){if(_0x599617[_0xcaa4('0x45')]['id']){delete _0x599617['body']['id'];}return db[_0xcaa4('0x29')]['find']({'where':{'id':_0x599617[_0xcaa4('0x46')]['id']}})['then'](handleEntityNotFound(_0x67c542,null))[_0xcaa4('0x3d')](saveUpdates(_0x599617['body'],null))['then'](respondWithResult(_0x67c542,null))[_0xcaa4('0x42')](handleError(_0x67c542,null));};exports[_0xcaa4('0x25')]=function(_0x4eee9e,_0x1ad058){return db[_0xcaa4('0x29')][_0xcaa4('0x47')]({'where':{'id':_0x4eee9e[_0xcaa4('0x46')]['id']}})[_0xcaa4('0x3d')](handleEntityNotFound(_0x1ad058,null))['then'](removeEntity(_0x1ad058,null))[_0xcaa4('0x42')](handleError(_0x1ad058,null));};exports[_0xcaa4('0x48')]=function(_0x50f08e,_0x581318){return db[_0xcaa4('0x29')][_0xcaa4('0x48')]()[_0xcaa4('0x3d')](respondWithResult(_0x581318,null))[_0xcaa4('0x42')](handleError(_0x581318,null));};function wrapUser(_0x7da744){return function(_0x399c67){var _0x3e3ca0=_0x7da744['get']({'plain':!![]});_0x3e3ca0['messages']=[];if(_0x399c67){_0x3e3ca0[_0xcaa4('0x49')]=_0x399c67[_0xcaa4('0x4a')];_0x3e3ca0[_0xcaa4('0x4b')]=_0x399c67;}else{_0x3e3ca0[_0xcaa4('0x49')]=moment(0x0)[_0xcaa4('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e3ca0[_0xcaa4('0x4b')]={};}return _0x3e3ca0;};}exports['getUsers']=function(_0x75377d,_0x28244a,_0x10779a){var _0x2a6d98=[];return db[_0xcaa4('0x4d')][_0xcaa4('0x40')]({'where':{'role':[_0xcaa4('0x4e'),_0xcaa4('0x4f'),_0xcaa4('0x50')]},'attributes':['id',_0xcaa4('0x51'),_0xcaa4('0x3b'),_0xcaa4('0x52'),_0xcaa4('0x53'),_0xcaa4('0x54'),_0xcaa4('0x55'),_0xcaa4('0x56'),'allowmessenger',_0xcaa4('0x57')],'order':qs['sort'](_0xcaa4('0x58')),'include':[{'model':db[_0xcaa4('0x59')],'as':_0xcaa4('0x5a'),'attributes':['id','name',_0xcaa4('0x2b')],'through':{'attributes':[]}}]})['then'](function(_0x31e280){if(_0x31e280){var _0x3c85ad=_0x75377d['user'][_0xcaa4('0x5b')]({'plain':!![]});if(!_0x3c85ad)throw new Error(_0xcaa4('0x5c'));if(_0x3c85ad[_0xcaa4('0x52')]===_0xcaa4('0x50')){return db[_0xcaa4('0x5d')][_0xcaa4('0x47')]({'where':{'name':_0xcaa4('0x5e'),'userProfileId':_0x3c85ad[_0xcaa4('0x5f')]},'raw':!![]})[_0xcaa4('0x3d')](function(_0x43e8dd){if(_0x43e8dd){if(_0x43e8dd[_0xcaa4('0x60')]===0x0){return db[_0xcaa4('0x61')][_0xcaa4('0x40')]({'where':{'sectionId':_0x43e8dd['id']},'raw':!![]})[_0xcaa4('0x3d')](function(_0x25c449){var _0x25065b=[];if(_[_0xcaa4('0x62')](_0x25c449)){_0x25065b=_[_0xcaa4('0x38')](_0x31e280,function(_0x225175){if(_0x225175['role']!==_0xcaa4('0x4e')){return _0x225175;}});return _0x25065b;}else{for(var _0x7c9391=0x0;_0x7c9391<_0x31e280[_0xcaa4('0x33')];_0x7c9391++){var _0xea1ac6=_0x31e280[_0x7c9391];if(_0xea1ac6[_0xcaa4('0x52')]==='agent'){var _0x1e802d=_[_0xcaa4('0x47')](_0x25c449,function(_0x313a00){return _0x313a00['resourceId']===_0xea1ac6['id'];});if(_0x1e802d)_0x25065b[_0xcaa4('0x63')](_0xea1ac6);}else{_0x25065b[_0xcaa4('0x63')](_0xea1ac6);}}return _0x25065b;}});}else{return _0x31e280;}}else{var _0x9f50c3=_[_0xcaa4('0x38')](_0x31e280,function(_0xeba79b){if(_0xeba79b[_0xcaa4('0x52')]!==_0xcaa4('0x4e')){return _0xeba79b;}});return _0x9f50c3;}});}else{return _0x31e280;}}})[_0xcaa4('0x3d')](function(_0x216f43){var _0x57354a=[];if(_0x216f43){_0x2a6d98=_0x216f43;for(var _0x54f9e5=0x0;_0x54f9e5<_0x216f43[_0xcaa4('0x33')];_0x54f9e5+=0x1){_0x2a6d98[_0x54f9e5][_0xcaa4('0x64')]=[];_0x57354a['push'](db[_0xcaa4('0x29')][_0xcaa4('0x47')]({'where':{'FromId':[_0x75377d[_0xcaa4('0x50')]['id'],_0x216f43[_0x54f9e5]['id']],'ToId':[_0x75377d['user']['id'],_0x216f43[_0x54f9e5]['id']],'ChatGroupId':null},'attributes':['id',_0xcaa4('0x4a'),_0xcaa4('0x65'),_0xcaa4('0x66'),'read',_0xcaa4('0x45')],'order':qs[_0xcaa4('0x36')](_0xcaa4('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x216f43[_0x54f9e5])));}return BPromise[_0xcaa4('0x68')](_0x57354a);}return[];})[_0xcaa4('0x3d')](function(_0x1d6b02){return{'rows':_0x1d6b02,'count':_0x1d6b02[_0xcaa4('0x33')]};})[_0xcaa4('0x3d')](respondWithResult(_0x28244a,null))['catch'](handleError(_0x28244a,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7ec213a..55ca787 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 _0xb058=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x5b5ece,_0x29168b){var _0x538b5d=function(_0x329833){while(--_0x329833){_0x5b5ece['push'](_0x5b5ece['shift']());}};_0x538b5d(++_0x29168b);}(_0xb058,0x69));var _0x8b05=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb058[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require(_0x8b05('0x0'));var ChatInternalMessage=require(_0x8b05('0x1'))['db'][_0x8b05('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8b05('0x3')](0x0);var events={'afterCreate':_0x8b05('0x4'),'afterUpdate':_0x8b05('0x5'),'afterDestroy':_0x8b05('0x6')};function emitEvent(_0x47b8f2){return function(_0x548e02,_0x581e74,_0x501d7c){ChatInternalMessageEvents[_0x8b05('0x7')](_0x47b8f2+':'+_0x548e02['id'],_0x548e02);ChatInternalMessageEvents[_0x8b05('0x7')](_0x47b8f2,_0x548e02);_0x501d7c(null);};}for(var e in events){if(events[_0x8b05('0x8')](e)){var event=events[e];ChatInternalMessage[_0x8b05('0x9')](e,emitEvent(event));}}module[_0x8b05('0xa')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xeac6=['exports','../../mysqldb','ChatInternalMessage','save','remove','emit'];(function(_0x2986e3,_0x502002){var _0xe40307=function(_0x318977){while(--_0x318977){_0x2986e3['push'](_0x2986e3['shift']());}};_0xe40307(++_0x502002);}(_0xeac6,0x7f));var _0x6eac=function(_0x1b07ac,_0x4d0cc1){_0x1b07ac=_0x1b07ac-0x0;var _0x1f77f8=_0xeac6[_0x1b07ac];return _0x1f77f8;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x6eac('0x0'))['db'][_0x6eac('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6eac('0x2'),'afterUpdate':'update','afterDestroy':_0x6eac('0x3')};function emitEvent(_0x432aa2){return function(_0x44398a,_0xe6ba4f,_0x17a020){ChatInternalMessageEvents[_0x6eac('0x4')](_0x432aa2+':'+_0x44398a['id'],_0x44398a);ChatInternalMessageEvents['emit'](_0x432aa2,_0x44398a);_0x17a020(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x6eac('0x5')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index b9afcec..5489d3c 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 _0xf2a3=['utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','exports','ChatInternalMessage','chat_internal_messages'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xf2a3,0x1a5));var _0x3f2a=function(_0x206a3c,_0x2c2f57){_0x206a3c=_0x206a3c-0x0;var _0x3e0f8d=_0xf2a3[_0x206a3c];return _0x3e0f8d;};'use strict';var _=require(_0x3f2a('0x0'));var util=require(_0x3f2a('0x1'));var logger=require(_0x3f2a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3f2a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f2a('0x4'));var rimraf=require(_0x3f2a('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x3f2a('0x6')]=function(_0x24ac50,_0x194166){return _0x24ac50['define'](_0x3f2a('0x7'),attributes,{'tableName':_0x3f2a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3f2a('0x9')});}; \ No newline at end of file +var _0x0d2c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','utf8mb4','lodash','util'];(function(_0x4d75a1,_0x45002a){var _0x18f98b=function(_0xc25899){while(--_0xc25899){_0x4d75a1['push'](_0x4d75a1['shift']());}};_0x18f98b(++_0x45002a);}(_0x0d2c,0xe2));var _0xc0d2=function(_0x489103,_0xdb40e1){_0x489103=_0x489103-0x0;var _0x344458=_0x0d2c[_0x489103];return _0x344458;};'use strict';var _=require(_0xc0d2('0x0'));var util=require(_0xc0d2('0x1'));var logger=require(_0xc0d2('0x2'))(_0xc0d2('0x3'));var moment=require(_0xc0d2('0x4'));var BPromise=require(_0xc0d2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0d2('0x6'));var rimraf=require(_0xc0d2('0x7'));var config=require(_0xc0d2('0x8'));var attributes=require(_0xc0d2('0x9'));module[_0xc0d2('0xa')]=function(_0x36cd8e,_0x2c2b31){return _0x36cd8e['define']('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc0d2('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a85e8c7..cc49817 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 _0xf3f5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','stringify','error','code','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf3f5,0xdb));var _0x5f3f=function(_0x28389d,_0x1b6a58){_0x28389d=_0x28389d-0x0;var _0x5f28cc=_0xf3f5[_0x28389d];return _0x5f28cc;};'use strict';var _=require(_0x5f3f('0x0'));var util=require(_0x5f3f('0x1'));var moment=require('moment');var BPromise=require(_0x5f3f('0x2'));var rs=require(_0x5f3f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f3f('0x4'))['db'];var utils=require(_0x5f3f('0x5'));var logger=require(_0x5f3f('0x6'))(_0x5f3f('0x7'));var config=require(_0x5f3f('0x8'));var jayson=require(_0x5f3f('0x9'));var client=jayson[_0x5f3f('0xa')][_0x5f3f('0xb')]({'port':0x232a});config['redis']=_[_0x5f3f('0xc')](config[_0x5f3f('0xd')],{'host':_0x5f3f('0xe'),'port':0x18eb});var socket=require(_0x5f3f('0xf'))(new Redis(config[_0x5f3f('0xd')]));require('./chatInternalMessage.socket')[_0x5f3f('0x10')](socket);function respondWithRpcPromise(_0x35fd7e,_0x5d932a,_0x4eb173){return new BPromise(function(_0x1e587f,_0x473209){return client[_0x5f3f('0x11')](_0x35fd7e,_0x4eb173)[_0x5f3f('0x12')](function(_0x2a1591){logger[_0x5f3f('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x5d932a,_0x5f3f('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x5d932a,'request\x20sent',JSON[_0x5f3f('0x15')](_0x2a1591));if(_0x2a1591[_0x5f3f('0x16')]){if(_0x2a1591[_0x5f3f('0x16')][_0x5f3f('0x17')]===0x1f4){logger[_0x5f3f('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x5d932a,_0x2a1591[_0x5f3f('0x16')]['message']);return _0x473209(_0x2a1591[_0x5f3f('0x16')][_0x5f3f('0x18')]);}logger['error'](_0x5f3f('0x19'),_0x5d932a,_0x2a1591[_0x5f3f('0x16')][_0x5f3f('0x18')]);return _0x1e587f(_0x2a1591[_0x5f3f('0x16')][_0x5f3f('0x18')]);}else{logger[_0x5f3f('0x13')](_0x5f3f('0x19'),_0x5d932a,'request\x20sent');_0x1e587f(_0x2a1591[_0x5f3f('0x1a')][_0x5f3f('0x18')]);}})[_0x5f3f('0x1b')](function(_0x4512e0){logger['error'](_0x5f3f('0x19'),_0x5d932a,_0x4512e0);_0x473209(_0x4512e0);});});} \ No newline at end of file +var _0x0f4a=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0x0f4a,0x185));var _0xa0f4=function(_0x1f1e69,_0x25416d){_0x1f1e69=_0x1f1e69-0x0;var _0x179eb0=_0x0f4a[_0x1f1e69];return _0x179eb0;};'use strict';var _=require(_0xa0f4('0x0'));var util=require(_0xa0f4('0x1'));var moment=require(_0xa0f4('0x2'));var BPromise=require(_0xa0f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa0f4('0x4'));var db=require(_0xa0f4('0x5'))['db'];var utils=require(_0xa0f4('0x6'));var logger=require(_0xa0f4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa0f4('0x8')]['http']({'port':0x232a});config[_0xa0f4('0x9')]=_[_0xa0f4('0xa')](config['redis'],{'host':_0xa0f4('0xb'),'port':0x18eb});var socket=require(_0xa0f4('0xc'))(new Redis(config[_0xa0f4('0x9')]));require(_0xa0f4('0xd'))[_0xa0f4('0xe')](socket);function respondWithRpcPromise(_0x58f268,_0x29fabe,_0x54f7d6){return new BPromise(function(_0x412cca,_0x3a85a3){return client[_0xa0f4('0xf')](_0x58f268,_0x54f7d6)['then'](function(_0x592732){logger[_0xa0f4('0x10')](_0xa0f4('0x11'),_0x29fabe,_0xa0f4('0x12'));logger[_0xa0f4('0x13')](_0xa0f4('0x14'),_0x29fabe,_0xa0f4('0x12'),JSON[_0xa0f4('0x15')](_0x592732));if(_0x592732[_0xa0f4('0x16')]){if(_0x592732[_0xa0f4('0x16')][_0xa0f4('0x17')]===0x1f4){logger[_0xa0f4('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x29fabe,_0x592732[_0xa0f4('0x16')][_0xa0f4('0x18')]);return _0x3a85a3(_0x592732[_0xa0f4('0x16')]['message']);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x29fabe,_0x592732[_0xa0f4('0x16')][_0xa0f4('0x18')]);return _0x412cca(_0x592732[_0xa0f4('0x16')][_0xa0f4('0x18')]);}else{logger[_0xa0f4('0x10')](_0xa0f4('0x11'),_0x29fabe,_0xa0f4('0x12'));_0x412cca(_0x592732[_0xa0f4('0x19')][_0xa0f4('0x18')]);}})[_0xa0f4('0x1a')](function(_0x4e476f){logger[_0xa0f4('0x16')](_0xa0f4('0x11'),_0x29fabe,_0x4e476f);_0x3a85a3(_0x4e476f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 3bc37a8..89dd7b3 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 _0x5984=['remove','update','emit','removeListener','length','chatInternalMessage:'];(function(_0x368fb9,_0x1a9895){var _0x4892fb=function(_0x28d735){while(--_0x28d735){_0x368fb9['push'](_0x368fb9['shift']());}};_0x4892fb(++_0x1a9895);}(_0x5984,0xa2));var _0x4598=function(_0x4c46eb,_0x3b4bfa){_0x4c46eb=_0x4c46eb-0x0;var _0x50d733=_0x5984[_0x4c46eb];return _0x50d733;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x4598('0x0'),_0x4598('0x1')];function createListener(_0x17a1da,_0x589eb0){return function(_0x57da26){_0x589eb0[_0x4598('0x2')](_0x17a1da,_0x57da26);};}function removeListener(_0x1bed1e,_0x2c96f9){return function(){ChatInternalMessageEvents[_0x4598('0x3')](_0x1bed1e,_0x2c96f9);};}exports['register']=function(_0x31755f){for(var _0x2a435f=0x0,_0x334d48=events[_0x4598('0x4')];_0x2a435f<_0x334d48;_0x2a435f++){var _0x360dff=events[_0x2a435f];var _0x1b1600=createListener(_0x4598('0x5')+_0x360dff,_0x31755f);ChatInternalMessageEvents['on'](_0x360dff,_0x1b1600);}}; \ No newline at end of file +var _0x64d7=['./chatInternalMessage.events','remove','update','emit','removeListener','register'];(function(_0x55fa80,_0x5693ab){var _0x10be10=function(_0x5ad7d6){while(--_0x5ad7d6){_0x55fa80['push'](_0x55fa80['shift']());}};_0x10be10(++_0x5693ab);}(_0x64d7,0xa2));var _0x764d=function(_0x2b07a1,_0x25c79a){_0x2b07a1=_0x2b07a1-0x0;var _0x4bb96b=_0x64d7[_0x2b07a1];return _0x4bb96b;};'use strict';var ChatInternalMessageEvents=require(_0x764d('0x0'));var events=['save',_0x764d('0x1'),_0x764d('0x2')];function createListener(_0x17f1ba,_0xee15e1){return function(_0x125f82){_0xee15e1[_0x764d('0x3')](_0x17f1ba,_0x125f82);};}function removeListener(_0x564841,_0x13c9f3){return function(){ChatInternalMessageEvents[_0x764d('0x4')](_0x564841,_0x13c9f3);};}exports[_0x764d('0x5')]=function(_0x5afffe){for(var _0x5bc63d=0x0,_0xa7afb2=events['length'];_0x5bc63d<_0xa7afb2;_0x5bc63d++){var _0x49ed16=events[_0x5bc63d];var _0xa8b99b=createListener('chatInternalMessage:'+_0x49ed16,_0x5afffe);ChatInternalMessageEvents['on'](_0x49ed16,_0xa8b99b);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3adecb5..e05c187 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 _0x1473=['put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','./chatInternalMessage.controller','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x36f6c2,_0x23044f){var _0x403d16=function(_0x55388e){while(--_0x55388e){_0x36f6c2['push'](_0x36f6c2['shift']());}};_0x403d16(++_0x23044f);}(_0x1473,0x1ea));var _0x3147=function(_0x285956,_0x30a0d3){_0x285956=_0x285956-0x0;var _0x545406=_0x1473[_0x285956];return _0x545406;};'use strict';var multer=require(_0x3147('0x0'));var util=require(_0x3147('0x1'));var path=require(_0x3147('0x2'));var timeout=require(_0x3147('0x3'));var express=require(_0x3147('0x4'));var router=express['Router']();var fs_extra=require(_0x3147('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3147('0x6'));router[_0x3147('0x7')]('/',auth['isAuthenticated'](),controller[_0x3147('0x8')]);router[_0x3147('0x7')]('/describe',auth[_0x3147('0x9')](),controller[_0x3147('0xa')]);router['get']('/users',auth[_0x3147('0x9')](),controller['getUsers']);router[_0x3147('0x7')](_0x3147('0xb'),auth['isAuthenticated'](),controller[_0x3147('0xc')]);router[_0x3147('0xd')]('/',auth[_0x3147('0x9')](),controller['create']);router[_0x3147('0xe')](_0x3147('0xb'),controller[_0x3147('0xf')]);router[_0x3147('0x10')](_0x3147('0xb'),auth[_0x3147('0x9')](),controller[_0x3147('0x11')]);module['exports']=router; \ No newline at end of file +var _0x151e=['../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','show','create','put','/:id','delete','multer','util','path','connect-timeout','fs-extra'];(function(_0x347fb2,_0x743c2b){var _0x54a94f=function(_0xf23e96){while(--_0xf23e96){_0x347fb2['push'](_0x347fb2['shift']());}};_0x54a94f(++_0x743c2b);}(_0x151e,0x1db));var _0xe151=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x151e[_0x486f4a];return _0x135d99;};'use strict';var multer=require(_0xe151('0x0'));var util=require(_0xe151('0x1'));var path=require(_0xe151('0x2'));var timeout=require(_0xe151('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe151('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe151('0x5'));var config=require(_0xe151('0x6'));var controller=require(_0xe151('0x7'));router[_0xe151('0x8')]('/',auth[_0xe151('0x9')](),controller[_0xe151('0xa')]);router[_0xe151('0x8')](_0xe151('0xb'),auth['isAuthenticated'](),controller[_0xe151('0xc')]);router['get'](_0xe151('0xd'),auth[_0xe151('0x9')](),controller[_0xe151('0xe')]);router[_0xe151('0x8')]('/:id',auth[_0xe151('0x9')](),controller[_0xe151('0xf')]);router['post']('/',auth[_0xe151('0x9')](),controller[_0xe151('0x10')]);router[_0xe151('0x11')](_0xe151('0x12'),controller['update']);router[_0xe151('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);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 7e67ba6..968e1a2 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 _0x61d0=['STRING','sequelize','TEXT','medium','BOOLEAN','out'];(function(_0x130661,_0x4fa44a){var _0x27e01d=function(_0x6caad4){while(--_0x6caad4){_0x130661['push'](_0x130661['shift']());}};_0x27e01d(++_0x4fa44a);}(_0x61d0,0x187));var _0x061d=function(_0x234318,_0xf22f31){_0x234318=_0x234318-0x0;var _0x1ab719=_0x61d0[_0x234318];return _0x1ab719;};'use strict';var Sequelize=require(_0x061d('0x0'));module['exports']={'body':{'type':Sequelize[_0x061d('0x1')](_0x061d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x061d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x061d('0x4')),'defaultValue':_0x061d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x061d('0x5')]},'providerResponse':{'type':Sequelize[_0x061d('0x1')]}}; \ No newline at end of file +var _0xe5fb=['medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe5fb,0xce));var _0xbe5f=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xe5fb[_0x163040];return _0x364667;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbe5f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe5f('0x4')),'defaultValue':_0xbe5f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe5f('0x5')]},'providerName':{'type':Sequelize[_0xbe5f('0x6')]},'providerResponse':{'type':Sequelize[_0xbe5f('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3183042..4a8af11 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 _0xe8da=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','include','findAll','catch','show','params','length','includeAll','find','body','describe','chat-interactions','accept','chat','read','readAt','UserId','user','isNil','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','parse','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x585fee,_0x2b20a9){var _0x439ba7=function(_0x6e364f){while(--_0x6e364f){_0x585fee['push'](_0x585fee['shift']());}};_0x439ba7(++_0x2b20a9);}(_0xe8da,0x16b));var _0xae8d=function(_0x4be5cd,_0x10c358){_0x4be5cd=_0x4be5cd-0x0;var _0x52b515=_0xe8da[_0x4be5cd];return _0x52b515;};'use strict';var emlformat=require(_0xae8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae8d('0x1'));var jsonpatch=require(_0xae8d('0x2'));var rp=require('request-promise');var moment=require(_0xae8d('0x3'));var BPromise=require(_0xae8d('0x4'));var Mustache=require(_0xae8d('0x5'));var util=require(_0xae8d('0x6'));var path=require('path');var sox=require(_0xae8d('0x7'));var csv=require(_0xae8d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae8d('0x9'));var squel=require('squel');var crypto=require(_0xae8d('0xa'));var jsforce=require(_0xae8d('0xb'));var deskjs=require(_0xae8d('0xc'));var toCsv=require(_0xae8d('0x8'));var querystring=require(_0xae8d('0xd'));var Papa=require(_0xae8d('0xe'));var Redis=require(_0xae8d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xae8d('0x10'));var hardwareService=require(_0xae8d('0x11'));var logger=require(_0xae8d('0x12'))('api');var utils=require(_0xae8d('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xae8d('0x14'))['db'];config[_0xae8d('0x15')]=_['defaults'](config[_0xae8d('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xae8d('0x16'))(new Redis(config[_0xae8d('0x15')]));require(_0xae8d('0x17'))[_0xae8d('0x18')](socket);var jayson=require(_0xae8d('0x19'));var client=jayson['client'][_0xae8d('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xae8d('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x27c3c3,_0x2dffc7,_0x32ca30,_0x5a2939){return new BPromise(function(_0x3f4f40,_0x20cd86){var _0x317f9f=_0x5a2939||client;return _0x317f9f[_0xae8d('0x1b')](_0x27c3c3,_0x32ca30)[_0xae8d('0x1c')](function(_0x38cf1b){logger[_0xae8d('0x1d')](_0xae8d('0x1e'),_0x2dffc7,_0xae8d('0x1f'));logger['debug'](_0xae8d('0x20'),_0x2dffc7,_0xae8d('0x1f'),JSON[_0xae8d('0x21')](_0x38cf1b));if(_0x38cf1b[_0xae8d('0x22')]){if(_0x38cf1b[_0xae8d('0x22')][_0xae8d('0x23')]===0x1f4){logger[_0xae8d('0x22')](_0xae8d('0x1e'),_0x2dffc7,_0x38cf1b[_0xae8d('0x22')]['message']);return _0x20cd86(_0x38cf1b[_0xae8d('0x22')][_0xae8d('0x24')]);}logger[_0xae8d('0x22')](_0xae8d('0x1e'),_0x2dffc7,_0x38cf1b[_0xae8d('0x22')][_0xae8d('0x24')]);return _0x3f4f40(_0x38cf1b[_0xae8d('0x22')][_0xae8d('0x24')]);}else{logger[_0xae8d('0x1d')](_0xae8d('0x1e'),_0x2dffc7,_0xae8d('0x1f'));_0x3f4f40(_0x38cf1b[_0xae8d('0x25')][_0xae8d('0x24')]);}})['catch'](function(_0x9f5c15){logger[_0xae8d('0x22')](_0xae8d('0x1e'),_0x2dffc7,_0x9f5c15);_0x20cd86(_0x9f5c15);});});}function respondWithStatusCode(_0x5af9b7,_0x220901){_0x220901=_0x220901||0xcc;return function(_0xfee628){if(_0xfee628){return _0x5af9b7[_0xae8d('0x26')](_0x220901);}return _0x5af9b7[_0xae8d('0x27')](_0x220901)['end']();};}function respondWithResult(_0xfedfc4,_0x55b862){_0x55b862=_0x55b862||0xc8;return function(_0x5aa45a){if(_0x5aa45a){return _0xfedfc4[_0xae8d('0x27')](_0x55b862)[_0xae8d('0x28')](_0x5aa45a);}};}function respondWithFilteredResult(_0x5678bf,_0x41fdcf){return function(_0x525c1c){if(_0x525c1c){var _0x3edd76=typeof _0x41fdcf[_0xae8d('0x29')]===_0xae8d('0x2a')&&typeof _0x41fdcf['limit']===_0xae8d('0x2a');var _0x137e0a=_0x525c1c[_0xae8d('0x2b')];var _0x1853e9=_0x3edd76?0x0:_0x41fdcf['offset'];var _0x1aa8fa=_0x3edd76?_0x525c1c[_0xae8d('0x2b')]:_0x41fdcf['offset']+_0x41fdcf[_0xae8d('0x2c')];var _0x60a7df;if(_0x1aa8fa>=_0x137e0a){_0x1aa8fa=_0x137e0a;_0x60a7df=0xc8;}else{_0x60a7df=0xce;}_0x5678bf[_0xae8d('0x27')](_0x60a7df);return _0x5678bf['set'](_0xae8d('0x2d'),_0x1853e9+'-'+_0x1aa8fa+'/'+_0x137e0a)[_0xae8d('0x28')](_0x525c1c);}return null;};}function patchUpdates(_0x2258d5){return function(_0x2d60c8){try{jsonpatch[_0xae8d('0x2e')](_0x2d60c8,_0x2258d5,!![]);}catch(_0x3a0f50){return BPromise[_0xae8d('0x2f')](_0x3a0f50);}return _0x2d60c8[_0xae8d('0x30')]();};}function saveUpdates(_0x4d16a,_0x4f91f4){return function(_0x1b43ca){if(_0x1b43ca){return _0x1b43ca[_0xae8d('0x31')](_0x4d16a)[_0xae8d('0x1c')](function(_0x138f26){return _0x138f26;});}return null;};}function removeEntity(_0xff09cc,_0xa9ddd0){return function(_0xe06d71){if(_0xe06d71){return _0xe06d71[_0xae8d('0x32')]()[_0xae8d('0x1c')](function(){_0xff09cc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a87c,_0xde62f2){return function(_0x15eac4){if(!_0x15eac4){_0x47a87c[_0xae8d('0x26')](0x194);}return _0x15eac4;};}function handleError(_0x39c4b2,_0x29d3b7){_0x29d3b7=_0x29d3b7||0x1f4;return function(_0x48ad49){logger[_0xae8d('0x22')](_0x48ad49[_0xae8d('0x33')]);if(_0x48ad49[_0xae8d('0x34')]){delete _0x48ad49[_0xae8d('0x34')];}_0x39c4b2[_0xae8d('0x27')](_0x29d3b7)[_0xae8d('0x35')](_0x48ad49);};}exports[_0xae8d('0x36')]=function(_0x53e7d3,_0x4bedd4){var _0x4c8cf1={},_0x2c710f={},_0x13d96a={'count':0x0,'rows':[]};var _0x97d2bf=_[_0xae8d('0x37')](db[_0xae8d('0x38')][_0xae8d('0x39')],function(_0x51f2d9){return{'name':_0x51f2d9[_0xae8d('0x3a')],'type':_0x51f2d9[_0xae8d('0x3b')][_0xae8d('0x3c')]};});_0x2c710f[_0xae8d('0x3d')]=_[_0xae8d('0x37')](_0x97d2bf,'name');_0x2c710f['query']=_[_0xae8d('0x3e')](_0x53e7d3['query']);_0x2c710f[_0xae8d('0x3f')]=_[_0xae8d('0x40')](_0x2c710f[_0xae8d('0x3d')],_0x2c710f[_0xae8d('0x41')]);_0x4c8cf1[_0xae8d('0x42')]=_[_0xae8d('0x40')](_0x2c710f[_0xae8d('0x3d')],qs[_0xae8d('0x43')](_0x53e7d3['query'][_0xae8d('0x43')]));_0x4c8cf1[_0xae8d('0x42')]=_0x4c8cf1[_0xae8d('0x42')]['length']?_0x4c8cf1[_0xae8d('0x42')]:_0x2c710f['model'];if(!_0x53e7d3[_0xae8d('0x41')][_0xae8d('0x44')](_0xae8d('0x45'))){_0x4c8cf1[_0xae8d('0x2c')]=qs[_0xae8d('0x2c')](_0x53e7d3[_0xae8d('0x41')]['limit']);_0x4c8cf1[_0xae8d('0x29')]=qs[_0xae8d('0x29')](_0x53e7d3[_0xae8d('0x41')][_0xae8d('0x29')]);}_0x4c8cf1[_0xae8d('0x46')]=qs[_0xae8d('0x47')](_0x53e7d3[_0xae8d('0x41')][_0xae8d('0x47')]);_0x4c8cf1['where']=qs[_0xae8d('0x3f')](_['pick'](_0x53e7d3['query'],_0x2c710f[_0xae8d('0x3f')]),_0x97d2bf);if(_0x53e7d3[_0xae8d('0x41')]['filter']){_0x4c8cf1[_0xae8d('0x48')]=_[_0xae8d('0x49')](_0x4c8cf1[_0xae8d('0x48')],{'$or':_[_0xae8d('0x37')](_0x97d2bf,function(_0x2e992d){if(_0x2e992d[_0xae8d('0x3b')]!=='VIRTUAL'){var _0x1345cc={};_0x1345cc[_0x2e992d[_0xae8d('0x34')]]={'$like':'%'+_0x53e7d3[_0xae8d('0x41')][_0xae8d('0x4a')]+'%'};return _0x1345cc;}})});}_0x4c8cf1=_[_0xae8d('0x49')]({},_0x4c8cf1,_0x53e7d3[_0xae8d('0x4b')]);var _0x78e709={'where':_0x4c8cf1[_0xae8d('0x48')]};return db[_0xae8d('0x38')][_0xae8d('0x2b')](_0x78e709)[_0xae8d('0x1c')](function(_0x1e065c){_0x13d96a['count']=_0x1e065c;if(_0x53e7d3[_0xae8d('0x41')]['includeAll']){_0x4c8cf1[_0xae8d('0x4c')]=[{'all':!![]}];}return db[_0xae8d('0x38')][_0xae8d('0x4d')](_0x4c8cf1);})[_0xae8d('0x1c')](function(_0x565bca){_0x13d96a['rows']=_0x565bca;return _0x13d96a;})[_0xae8d('0x1c')](respondWithFilteredResult(_0x4bedd4,_0x4c8cf1))[_0xae8d('0x4e')](handleError(_0x4bedd4,null));};exports[_0xae8d('0x4f')]=function(_0x28c7ca,_0x539069){var _0x2ee874={'raw':!![],'where':{'id':_0x28c7ca[_0xae8d('0x50')]['id']}},_0xf996f9={};_0xf996f9['model']=_['keys'](db['ChatMessage'][_0xae8d('0x39')]);_0xf996f9[_0xae8d('0x41')]=_['keys'](_0x28c7ca[_0xae8d('0x41')]);_0xf996f9['filters']=_[_0xae8d('0x40')](_0xf996f9['model'],_0xf996f9['query']);_0x2ee874['attributes']=_[_0xae8d('0x40')](_0xf996f9[_0xae8d('0x3d')],qs[_0xae8d('0x43')](_0x28c7ca['query']['fields']));_0x2ee874[_0xae8d('0x42')]=_0x2ee874[_0xae8d('0x42')][_0xae8d('0x51')]?_0x2ee874['attributes']:_0xf996f9[_0xae8d('0x3d')];if(_0x28c7ca['query'][_0xae8d('0x52')]){_0x2ee874[_0xae8d('0x4c')]=[{'all':!![]}];}_0x2ee874=_[_0xae8d('0x49')]({},_0x2ee874,_0x28c7ca['options']);return db[_0xae8d('0x38')][_0xae8d('0x53')](_0x2ee874)['then'](handleEntityNotFound(_0x539069,null))[_0xae8d('0x1c')](respondWithResult(_0x539069,null))['catch'](handleError(_0x539069,null));};exports['create']=function(_0x2fd2cf,_0x4bac26){return db[_0xae8d('0x38')]['create'](_0x2fd2cf[_0xae8d('0x54')],{})['then'](respondWithResult(_0x4bac26,0xc9))[_0xae8d('0x4e')](handleError(_0x4bac26,null));};exports[_0xae8d('0x31')]=function(_0x4a3672,_0x4e0b39){if(_0x4a3672[_0xae8d('0x54')]['id']){delete _0x4a3672[_0xae8d('0x54')]['id'];}return db[_0xae8d('0x38')][_0xae8d('0x53')]({'where':{'id':_0x4a3672['params']['id']}})[_0xae8d('0x1c')](handleEntityNotFound(_0x4e0b39,null))['then'](saveUpdates(_0x4a3672['body'],null))[_0xae8d('0x1c')](respondWithResult(_0x4e0b39,null))[_0xae8d('0x4e')](handleError(_0x4e0b39,null));};exports[_0xae8d('0x32')]=function(_0x533802,_0x3c3342){return db[_0xae8d('0x38')][_0xae8d('0x53')]({'where':{'id':_0x533802['params']['id']}})[_0xae8d('0x1c')](handleEntityNotFound(_0x3c3342,null))['then'](removeEntity(_0x3c3342,null))[_0xae8d('0x4e')](handleError(_0x3c3342,null));};exports[_0xae8d('0x55')]=function(_0x4b247b,_0x4b9e8d){return db[_0xae8d('0x38')][_0xae8d('0x55')]()[_0xae8d('0x1c')](respondWithResult(_0x4b9e8d,null))[_0xae8d('0x4e')](handleError(_0x4b9e8d,null));};var interaction_log=require('../../config/logger')(_0xae8d('0x56'));exports[_0xae8d('0x57')]=function(_0x3579f7,_0x4a253a,_0x439c1b){var _0x1fe49a={'agent':{},'channel':_0xae8d('0x58')};if(_0x3579f7[_0xae8d('0x54')]['id']){delete _0x3579f7['body']['id'];}_0x3579f7[_0xae8d('0x54')][_0xae8d('0x59')]=!![];_0x3579f7['body'][_0xae8d('0x5a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3579f7['body']['UserId']=_0x3579f7[_0xae8d('0x54')][_0xae8d('0x5b')]||_0x3579f7[_0xae8d('0x5c')]['id'];_0x1fe49a['agent']['id']=_0x3579f7['body'][_0xae8d('0x5b')];return db[_0xae8d('0x38')]['find']({'where':{'id':_0x3579f7[_0xae8d('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a253a,null))[_0xae8d('0x1c')](saveUpdates(_0x3579f7[_0xae8d('0x54')],null))[_0xae8d('0x1c')](function(_0x19e41c){if(_0x19e41c){_0x1fe49a[_0xae8d('0x24')]=_0x19e41c['get']({'plain':!![]});return db['ChatInteraction'][_0xae8d('0x53')]({'where':{'id':_0x19e41c['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4a253a,null))[_0xae8d('0x1c')](function(_0x5ee857){if(_0x5ee857){return _0x5ee857[_0xae8d('0x31')]({'UserId':_0x3579f7[_0xae8d('0x54')][_0xae8d('0x5b')],'read1stAt':_[_0xae8d('0x5d')](_0x5ee857['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xae8d('0x1c')](function(_0x4689a0){if(_0x4689a0){_0x1fe49a[_0xae8d('0x5e')]=_0x4689a0['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3579f7[_0xae8d('0x5c')]['id'],_0x3579f7[_0xae8d('0x5c')]['name'],_0x3579f7['user'][_0xae8d('0x5f')],_0x1fe49a[_0xae8d('0x5e')]['id'],_0x3579f7['body']?JSON[_0xae8d('0x21')](_0x3579f7[_0xae8d('0x54')]):_0xae8d('0x60'));return respondWithRpcPromise(_0xae8d('0x61'),_0xae8d('0x62'),_0x1fe49a);}return null;})[_0xae8d('0x1c')](function(_0x4e1ac8){var _0x1a0165='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e1ac8[_0xae8d('0x24')][_0xae8d('0x63')];return db[_0xae8d('0x64')][_0xae8d('0x41')](_0x1a0165,{'type':db[_0xae8d('0x65')][_0xae8d('0x66')][_0xae8d('0x67')],'raw':!![]})[_0xae8d('0x1c')](function(_0x359ea7){return _0x359ea7;});})[_0xae8d('0x1c')](function(_0x5d4575){if(_0x5d4575){_0x1fe49a[_0xae8d('0x24')][_0xae8d('0x68')]=_0x5d4575[0x0];if(!_0x3579f7[_0xae8d('0x54')][_0xae8d('0x5b')])return;return db[_0xae8d('0x69')][_0xae8d('0x53')]({'where':{'id':_0x3579f7['body'][_0xae8d('0x5b')],'role':_0xae8d('0x6a')},'attributes':['id',_0xae8d('0x34'),_0xae8d('0x6b'),_0xae8d('0x6c'),_0xae8d('0x6d')],'raw':!![]});}return null;})['then'](function(_0x5affc6){if(!_0x5affc6)return null;_0x1fe49a['message'][_0xae8d('0x6a')]=_0x5affc6;return _0x1fe49a;})[_0xae8d('0x1c')](function(_0x174aa0){if(_0x174aa0){if(_0x3579f7[_0xae8d('0x54')][_0xae8d('0x6e')]){_0x1fe49a['message'][_0xae8d('0x6f')]=util[_0xae8d('0x70')](_0xae8d('0x71'),_0x3579f7[_0xae8d('0x5c')]['name']);_0x1fe49a[_0xae8d('0x24')][_0xae8d('0x72')]=_0x1fe49a[_0xae8d('0x72')];_0x1fe49a[_0xae8d('0x24')][_0xae8d('0x73')]=_0x1fe49a[_0xae8d('0x72')];_0x1fe49a[_0xae8d('0x24')][_0xae8d('0x74')]=_0xae8d('0x57');return respondWithRpcPromise(_0xae8d('0x75'),_0xae8d('0x75'),{'event':_0xae8d('0x76'),'message':_[_0xae8d('0x49')](_0x1fe49a[_0xae8d('0x24')],JSON['parse'](_0x1fe49a[_0xae8d('0x5e')][_0xae8d('0x77')]))},client9002)[_0xae8d('0x1c')](function(){return _0x1fe49a;});}return _0x1fe49a;}return null;})[_0xae8d('0x1c')](respondWithResult(_0x4a253a,null))[_0xae8d('0x4e')](handleError(_0x4a253a,null));};var interaction_log=require(_0xae8d('0x12'))('chat-interactions');exports[_0xae8d('0x2f')]=function(_0x245a79,_0x5a38bf,_0x2be1dc){var _0x17a7d9={'agent':{},'channel':'chat'};if(_0x245a79['body']['id']){delete _0x245a79[_0xae8d('0x54')]['id'];}_0x245a79[_0xae8d('0x54')][_0xae8d('0x5b')]=_0x245a79[_0xae8d('0x54')][_0xae8d('0x5b')]||_0x245a79[_0xae8d('0x5c')]['id'];_0x17a7d9['agent']['id']=_0x245a79[_0xae8d('0x54')]['UserId'];return db[_0xae8d('0x38')]['find']({'where':{'id':_0x245a79['params']['id'],'UserId':null}})[_0xae8d('0x1c')](handleEntityNotFound(_0x5a38bf,null))[_0xae8d('0x1c')](function(_0x540498){if(_0x540498){_0x17a7d9['message']=_0x540498[_0xae8d('0x78')]({'plain':!![]});return db['ChatInteraction'][_0xae8d('0x53')]({'where':{'id':_0x540498['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5a38bf,null))[_0xae8d('0x1c')](function(_0x19fb4d){if(_0x19fb4d){_0x17a7d9[_0xae8d('0x5e')]=_0x19fb4d[_0xae8d('0x78')]({'plain':!![]});interaction_log[_0xae8d('0x1d')](_0xae8d('0x79'),_0x245a79['user']['id'],_0x245a79[_0xae8d('0x5c')][_0xae8d('0x34')],_0x245a79[_0xae8d('0x5c')][_0xae8d('0x5f')],_0x17a7d9['interaction']['id'],_0x245a79[_0xae8d('0x54')]?JSON[_0xae8d('0x21')](_0x245a79[_0xae8d('0x54')]):_0xae8d('0x60'));return respondWithRpcPromise(_0xae8d('0x7a'),'rejectMessage',_0x17a7d9);}return null;})[_0xae8d('0x1c')](function(_0x79ba28){var _0x376b4c=_0xae8d('0x7b')+_0x79ba28[_0xae8d('0x24')][_0xae8d('0x63')];return db[_0xae8d('0x64')][_0xae8d('0x41')](_0x376b4c,{'type':db[_0xae8d('0x65')][_0xae8d('0x66')][_0xae8d('0x67')],'raw':!![]})[_0xae8d('0x1c')](function(_0x19694a){return _0x19694a;});})[_0xae8d('0x1c')](function(_0x4c7fbf){if(_0x4c7fbf){_0x17a7d9['message'][_0xae8d('0x68')]=_0x4c7fbf[0x0];if(!_0x245a79[_0xae8d('0x54')]['UserId'])return;return db['User'][_0xae8d('0x53')]({'where':{'id':_0x245a79[_0xae8d('0x54')][_0xae8d('0x5b')],'role':'agent'},'attributes':['id',_0xae8d('0x34'),_0xae8d('0x6b'),_0xae8d('0x6c'),'internal'],'raw':!![]});}return null;})[_0xae8d('0x1c')](function(_0x13c1c3){if(!_0x13c1c3)return null;_0x17a7d9['message'][_0xae8d('0x6a')]=_0x13c1c3;return _0x17a7d9;})[_0xae8d('0x1c')](function(_0x1cc280){if(_0x1cc280){_0x1cc280['message'][_0xae8d('0x6f')]=util[_0xae8d('0x70')](_0xae8d('0x71'),_0x245a79[_0xae8d('0x5c')][_0xae8d('0x34')]);_0x1cc280[_0xae8d('0x24')][_0xae8d('0x72')]=_0x17a7d9['channel'];_0x1cc280[_0xae8d('0x24')][_0xae8d('0x73')]=_0x17a7d9[_0xae8d('0x72')];_0x1cc280[_0xae8d('0x24')]['event']='reject';respondWithRpcPromise(_0xae8d('0x75'),_0xae8d('0x75'),{'event':_0xae8d('0x7c'),'message':_['merge'](_0x17a7d9[_0xae8d('0x24')],JSON[_0xae8d('0x7d')](_0x17a7d9[_0xae8d('0x5e')][_0xae8d('0x77')]))},client9002);return _0x17a7d9;}return null;})['then'](respondWithResult(_0x5a38bf,null))[_0xae8d('0x4e')](handleError(_0x5a38bf,null));}; \ No newline at end of file +var _0xe753=['ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','stack','index','map','ChatMessage','rawAttributes','fieldName','model','name','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','filters','intersection','merge','find','create','body','destroy','describe','chat-interactions','accept','chat','read','UserId','user','ChatInteraction','ChatInteractionId','read1stAt','format','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','formData','reject','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','motionChannel','fast-json-patch','moment','bluebird','mustache','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/license/util','../../mysqldb','redis','defaults','register','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x176214,_0x4393da){var _0x158b58=function(_0x561f97){while(--_0x561f97){_0x176214['push'](_0x176214['shift']());}};_0x158b58(++_0x4393da);}(_0xe753,0x1e3));var _0x3e75=function(_0x25e95a,_0x2efe4a){_0x25e95a=_0x25e95a-0x0;var _0x2b35e8=_0xe753[_0x25e95a];return _0x2b35e8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3e75('0x0'));var rp=require('request-promise');var moment=require(_0x3e75('0x1'));var BPromise=require(_0x3e75('0x2'));var Mustache=require(_0x3e75('0x3'));var util=require('util');var path=require('path');var sox=require(_0x3e75('0x4'));var csv=require(_0x3e75('0x5'));var ejs=require(_0x3e75('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3e75('0x7'));var crypto=require(_0x3e75('0x8'));var jsforce=require(_0x3e75('0x9'));var deskjs=require(_0x3e75('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3e75('0xb'));var Papa=require(_0x3e75('0xc'));var Redis=require(_0x3e75('0xd'));var authService=require(_0x3e75('0xe'));var qs=require(_0x3e75('0xf'));var as=require(_0x3e75('0x10'));var hardwareService=require(_0x3e75('0x11'));var logger=require(_0x3e75('0x12'))(_0x3e75('0x13'));var utils=require(_0x3e75('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3e75('0x15'));var db=require(_0x3e75('0x16'))['db'];config[_0x3e75('0x17')]=_[_0x3e75('0x18')](config[_0x3e75('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e75('0x17')]));require('./chatMessage.socket')[_0x3e75('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3e75('0x1a')][_0x3e75('0x1b')]({'port':0x232c});var client9002=jayson[_0x3e75('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10f6a6,_0x19ec9a,_0x395f6b,_0x7f9664){return new BPromise(function(_0x2d728b,_0x437cd8){var _0xc9e901=_0x7f9664||client;return _0xc9e901[_0x3e75('0x1c')](_0x10f6a6,_0x395f6b)[_0x3e75('0x1d')](function(_0x420024){logger['info'](_0x3e75('0x1e'),_0x19ec9a,_0x3e75('0x1f'));logger[_0x3e75('0x20')](_0x3e75('0x21'),_0x19ec9a,'request\x20sent',JSON[_0x3e75('0x22')](_0x420024));if(_0x420024[_0x3e75('0x23')]){if(_0x420024['error'][_0x3e75('0x24')]===0x1f4){logger[_0x3e75('0x23')](_0x3e75('0x1e'),_0x19ec9a,_0x420024[_0x3e75('0x23')]['message']);return _0x437cd8(_0x420024['error'][_0x3e75('0x25')]);}logger[_0x3e75('0x23')](_0x3e75('0x1e'),_0x19ec9a,_0x420024[_0x3e75('0x23')][_0x3e75('0x25')]);return _0x2d728b(_0x420024[_0x3e75('0x23')][_0x3e75('0x25')]);}else{logger[_0x3e75('0x26')](_0x3e75('0x1e'),_0x19ec9a,_0x3e75('0x1f'));_0x2d728b(_0x420024[_0x3e75('0x27')][_0x3e75('0x25')]);}})[_0x3e75('0x28')](function(_0x3d7908){logger['error'](_0x3e75('0x1e'),_0x19ec9a,_0x3d7908);_0x437cd8(_0x3d7908);});});}function respondWithStatusCode(_0x583131,_0x5dbdcd){_0x5dbdcd=_0x5dbdcd||0xcc;return function(_0x529c7a){if(_0x529c7a){return _0x583131[_0x3e75('0x29')](_0x5dbdcd);}return _0x583131['status'](_0x5dbdcd)[_0x3e75('0x2a')]();};}function respondWithResult(_0x345461,_0xa25b43){_0xa25b43=_0xa25b43||0xc8;return function(_0x4f48a4){if(_0x4f48a4){return _0x345461[_0x3e75('0x2b')](_0xa25b43)[_0x3e75('0x2c')](_0x4f48a4);}};}function respondWithFilteredResult(_0x2a645d,_0xdc2861){return function(_0x5f0ed3){if(_0x5f0ed3){var _0x47ecae=typeof _0xdc2861['offset']===_0x3e75('0x2d')&&typeof _0xdc2861[_0x3e75('0x2e')]===_0x3e75('0x2d');var _0x2d4559=_0x5f0ed3[_0x3e75('0x2f')];var _0x589d3c=_0x47ecae?0x0:_0xdc2861[_0x3e75('0x30')];var _0x1e61d5=_0x47ecae?_0x5f0ed3[_0x3e75('0x2f')]:_0xdc2861[_0x3e75('0x30')]+_0xdc2861[_0x3e75('0x2e')];var _0x132ebc;if(_0x1e61d5>=_0x2d4559){_0x1e61d5=_0x2d4559;_0x132ebc=0xc8;}else{_0x132ebc=0xce;}_0x2a645d['status'](_0x132ebc);return _0x2a645d['set'](_0x3e75('0x31'),_0x589d3c+'-'+_0x1e61d5+'/'+_0x2d4559)[_0x3e75('0x2c')](_0x5f0ed3);}return null;};}function patchUpdates(_0x44042e){return function(_0x29af41){try{jsonpatch[_0x3e75('0x32')](_0x29af41,_0x44042e,!![]);}catch(_0x1666e7){return BPromise['reject'](_0x1666e7);}return _0x29af41[_0x3e75('0x33')]();};}function saveUpdates(_0x38d604,_0x2279c5){return function(_0x5de08e){if(_0x5de08e){return _0x5de08e[_0x3e75('0x34')](_0x38d604)[_0x3e75('0x1d')](function(_0x534483){return _0x534483;});}return null;};}function removeEntity(_0x19adb1,_0x4bbfe2){return function(_0x1708ed){if(_0x1708ed){return _0x1708ed['destroy']()[_0x3e75('0x1d')](function(){_0x19adb1[_0x3e75('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3989d4,_0x50afb8){return function(_0x228791){if(!_0x228791){_0x3989d4[_0x3e75('0x29')](0x194);}return _0x228791;};}function handleError(_0x2c2397,_0x564a68){_0x564a68=_0x564a68||0x1f4;return function(_0x13bcaa){logger[_0x3e75('0x23')](_0x13bcaa[_0x3e75('0x35')]);if(_0x13bcaa['name']){delete _0x13bcaa['name'];}_0x2c2397[_0x3e75('0x2b')](_0x564a68)['send'](_0x13bcaa);};}exports[_0x3e75('0x36')]=function(_0x18af39,_0x2553fc){var _0x16c473={},_0x54489e={},_0x541b66={'count':0x0,'rows':[]};var _0x2b2693=_[_0x3e75('0x37')](db[_0x3e75('0x38')][_0x3e75('0x39')],function(_0x5b7bd5){return{'name':_0x5b7bd5[_0x3e75('0x3a')],'type':_0x5b7bd5['type']['key']};});_0x54489e[_0x3e75('0x3b')]=_[_0x3e75('0x37')](_0x2b2693,_0x3e75('0x3c'));_0x54489e[_0x3e75('0x3d')]=_[_0x3e75('0x3e')](_0x18af39[_0x3e75('0x3d')]);_0x54489e['filters']=_['intersection'](_0x54489e[_0x3e75('0x3b')],_0x54489e['query']);_0x16c473[_0x3e75('0x3f')]=_['intersection'](_0x54489e[_0x3e75('0x3b')],qs[_0x3e75('0x40')](_0x18af39[_0x3e75('0x3d')][_0x3e75('0x40')]));_0x16c473[_0x3e75('0x3f')]=_0x16c473[_0x3e75('0x3f')][_0x3e75('0x41')]?_0x16c473[_0x3e75('0x3f')]:_0x54489e[_0x3e75('0x3b')];if(!_0x18af39['query'][_0x3e75('0x42')](_0x3e75('0x43'))){_0x16c473['limit']=qs[_0x3e75('0x2e')](_0x18af39[_0x3e75('0x3d')]['limit']);_0x16c473[_0x3e75('0x30')]=qs[_0x3e75('0x30')](_0x18af39[_0x3e75('0x3d')]['offset']);}_0x16c473[_0x3e75('0x44')]=qs[_0x3e75('0x45')](_0x18af39[_0x3e75('0x3d')]['sort']);_0x16c473[_0x3e75('0x46')]=qs['filters'](_['pick'](_0x18af39[_0x3e75('0x3d')],_0x54489e['filters']),_0x2b2693);if(_0x18af39[_0x3e75('0x3d')][_0x3e75('0x47')]){_0x16c473['where']=_['merge'](_0x16c473[_0x3e75('0x46')],{'$or':_[_0x3e75('0x37')](_0x2b2693,function(_0x2bb061){if(_0x2bb061[_0x3e75('0x48')]!==_0x3e75('0x49')){var _0x40e22e={};_0x40e22e[_0x2bb061[_0x3e75('0x3c')]]={'$like':'%'+_0x18af39[_0x3e75('0x3d')][_0x3e75('0x47')]+'%'};return _0x40e22e;}})});}_0x16c473=_['merge']({},_0x16c473,_0x18af39[_0x3e75('0x4a')]);var _0x5c9ea5={'where':_0x16c473['where']};return db[_0x3e75('0x38')]['count'](_0x5c9ea5)[_0x3e75('0x1d')](function(_0x33a8e9){_0x541b66['count']=_0x33a8e9;if(_0x18af39[_0x3e75('0x3d')][_0x3e75('0x4b')]){_0x16c473[_0x3e75('0x4c')]=[{'all':!![]}];}return db[_0x3e75('0x38')][_0x3e75('0x4d')](_0x16c473);})[_0x3e75('0x1d')](function(_0x48e4bf){_0x541b66[_0x3e75('0x4e')]=_0x48e4bf;return _0x541b66;})[_0x3e75('0x1d')](respondWithFilteredResult(_0x2553fc,_0x16c473))[_0x3e75('0x28')](handleError(_0x2553fc,null));};exports[_0x3e75('0x4f')]=function(_0xa7ce95,_0x1bd392){var _0x5124fb={'raw':!![],'where':{'id':_0xa7ce95[_0x3e75('0x50')]['id']}},_0x307430={};_0x307430[_0x3e75('0x3b')]=_['keys'](db['ChatMessage'][_0x3e75('0x39')]);_0x307430[_0x3e75('0x3d')]=_[_0x3e75('0x3e')](_0xa7ce95[_0x3e75('0x3d')]);_0x307430[_0x3e75('0x51')]=_[_0x3e75('0x52')](_0x307430['model'],_0x307430['query']);_0x5124fb[_0x3e75('0x3f')]=_[_0x3e75('0x52')](_0x307430[_0x3e75('0x3b')],qs['fields'](_0xa7ce95[_0x3e75('0x3d')]['fields']));_0x5124fb[_0x3e75('0x3f')]=_0x5124fb[_0x3e75('0x3f')][_0x3e75('0x41')]?_0x5124fb['attributes']:_0x307430['model'];if(_0xa7ce95[_0x3e75('0x3d')][_0x3e75('0x4b')]){_0x5124fb[_0x3e75('0x4c')]=[{'all':!![]}];}_0x5124fb=_[_0x3e75('0x53')]({},_0x5124fb,_0xa7ce95[_0x3e75('0x4a')]);return db[_0x3e75('0x38')][_0x3e75('0x54')](_0x5124fb)[_0x3e75('0x1d')](handleEntityNotFound(_0x1bd392,null))[_0x3e75('0x1d')](respondWithResult(_0x1bd392,null))[_0x3e75('0x28')](handleError(_0x1bd392,null));};exports[_0x3e75('0x55')]=function(_0x47b377,_0x1b7661){return db['ChatMessage'][_0x3e75('0x55')](_0x47b377[_0x3e75('0x56')],{})['then'](respondWithResult(_0x1b7661,0xc9))[_0x3e75('0x28')](handleError(_0x1b7661,null));};exports['update']=function(_0xabb048,_0x335bf7){if(_0xabb048[_0x3e75('0x56')]['id']){delete _0xabb048['body']['id'];}return db[_0x3e75('0x38')][_0x3e75('0x54')]({'where':{'id':_0xabb048[_0x3e75('0x50')]['id']}})[_0x3e75('0x1d')](handleEntityNotFound(_0x335bf7,null))[_0x3e75('0x1d')](saveUpdates(_0xabb048[_0x3e75('0x56')],null))[_0x3e75('0x1d')](respondWithResult(_0x335bf7,null))[_0x3e75('0x28')](handleError(_0x335bf7,null));};exports[_0x3e75('0x57')]=function(_0x3146d7,_0x5446d4){return db[_0x3e75('0x38')][_0x3e75('0x54')]({'where':{'id':_0x3146d7[_0x3e75('0x50')]['id']}})['then'](handleEntityNotFound(_0x5446d4,null))[_0x3e75('0x1d')](removeEntity(_0x5446d4,null))[_0x3e75('0x28')](handleError(_0x5446d4,null));};exports[_0x3e75('0x58')]=function(_0x2b57aa,_0x528645){return db[_0x3e75('0x38')]['describe']()['then'](respondWithResult(_0x528645,null))['catch'](handleError(_0x528645,null));};var interaction_log=require('../../config/logger')(_0x3e75('0x59'));exports[_0x3e75('0x5a')]=function(_0x3a97cf,_0x1dd392,_0x2069c1){var _0xd1b0d9={'agent':{},'channel':_0x3e75('0x5b')};if(_0x3a97cf[_0x3e75('0x56')]['id']){delete _0x3a97cf[_0x3e75('0x56')]['id'];}_0x3a97cf[_0x3e75('0x56')][_0x3e75('0x5c')]=!![];_0x3a97cf[_0x3e75('0x56')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3a97cf[_0x3e75('0x56')][_0x3e75('0x5d')]=_0x3a97cf['body']['UserId']||_0x3a97cf[_0x3e75('0x5e')]['id'];_0xd1b0d9['agent']['id']=_0x3a97cf[_0x3e75('0x56')][_0x3e75('0x5d')];return db[_0x3e75('0x38')]['find']({'where':{'id':_0x3a97cf[_0x3e75('0x50')]['id'],'UserId':null}})[_0x3e75('0x1d')](handleEntityNotFound(_0x1dd392,null))[_0x3e75('0x1d')](saveUpdates(_0x3a97cf['body'],null))['then'](function(_0x5b4d35){if(_0x5b4d35){_0xd1b0d9[_0x3e75('0x25')]=_0x5b4d35['get']({'plain':!![]});return db[_0x3e75('0x5f')]['find']({'where':{'id':_0x5b4d35[_0x3e75('0x60')]}});}return null;})[_0x3e75('0x1d')](handleEntityNotFound(_0x1dd392,null))[_0x3e75('0x1d')](function(_0x1d9f75){if(_0x1d9f75){return _0x1d9f75[_0x3e75('0x34')]({'UserId':_0x3a97cf['body'][_0x3e75('0x5d')],'read1stAt':_['isNil'](_0x1d9f75[_0x3e75('0x61')])?moment()[_0x3e75('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x3e75('0x1d')](function(_0x2f4436){if(_0x2f4436){_0xd1b0d9['interaction']=_0x2f4436[_0x3e75('0x63')]({'plain':!![]});interaction_log[_0x3e75('0x26')](_0x3e75('0x64'),_0x3a97cf[_0x3e75('0x5e')]['id'],_0x3a97cf[_0x3e75('0x5e')]['name'],_0x3a97cf[_0x3e75('0x5e')][_0x3e75('0x65')],_0xd1b0d9[_0x3e75('0x66')]['id'],_0x3a97cf[_0x3e75('0x56')]?JSON[_0x3e75('0x22')](_0x3a97cf[_0x3e75('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0x3e75('0x67'),_0xd1b0d9);}return null;})[_0x3e75('0x1d')](function(_0xf59417){var _0x5d353f=_0x3e75('0x68')+_0xf59417['message'][_0x3e75('0x69')];return db['sequelize'][_0x3e75('0x3d')](_0x5d353f,{'type':db[_0x3e75('0x6a')][_0x3e75('0x6b')][_0x3e75('0x6c')],'raw':!![]})[_0x3e75('0x1d')](function(_0x1a56de){return _0x1a56de;});})[_0x3e75('0x1d')](function(_0x34ab55){if(_0x34ab55){_0xd1b0d9[_0x3e75('0x25')][_0x3e75('0x6d')]=_0x34ab55[0x0];if(!_0x3a97cf[_0x3e75('0x56')][_0x3e75('0x5d')])return;return db[_0x3e75('0x6e')][_0x3e75('0x54')]({'where':{'id':_0x3a97cf[_0x3e75('0x56')][_0x3e75('0x5d')],'role':_0x3e75('0x6f')},'attributes':['id',_0x3e75('0x3c'),_0x3e75('0x70'),_0x3e75('0x71'),_0x3e75('0x72')],'raw':!![]});}return null;})[_0x3e75('0x1d')](function(_0x4dd22b){if(!_0x4dd22b)return null;_0xd1b0d9[_0x3e75('0x25')][_0x3e75('0x6f')]=_0x4dd22b;return _0xd1b0d9;})[_0x3e75('0x1d')](function(_0x3594ce){if(_0x3594ce){if(_0x3a97cf[_0x3e75('0x56')][_0x3e75('0x73')]){_0xd1b0d9[_0x3e75('0x25')][_0x3e75('0x74')]=util[_0x3e75('0x62')](_0x3e75('0x75'),_0x3a97cf[_0x3e75('0x5e')][_0x3e75('0x3c')]);_0xd1b0d9['message'][_0x3e75('0x76')]=_0xd1b0d9[_0x3e75('0x76')];_0xd1b0d9[_0x3e75('0x25')]['motionChannel']=_0xd1b0d9[_0x3e75('0x76')];_0xd1b0d9[_0x3e75('0x25')]['event']=_0x3e75('0x5a');return respondWithRpcPromise(_0x3e75('0x77'),'EventManager',{'event':_0x3e75('0x78'),'message':_[_0x3e75('0x53')](_0xd1b0d9[_0x3e75('0x25')],JSON[_0x3e75('0x79')](_0xd1b0d9[_0x3e75('0x66')][_0x3e75('0x7a')]))},client9002)[_0x3e75('0x1d')](function(){return _0xd1b0d9;});}return _0xd1b0d9;}return null;})[_0x3e75('0x1d')](respondWithResult(_0x1dd392,null))[_0x3e75('0x28')](handleError(_0x1dd392,null));};var interaction_log=require(_0x3e75('0x12'))(_0x3e75('0x59'));exports[_0x3e75('0x7b')]=function(_0x256d01,_0x53d54a,_0x5bb044){var _0xab2d87={'agent':{},'channel':_0x3e75('0x5b')};if(_0x256d01[_0x3e75('0x56')]['id']){delete _0x256d01[_0x3e75('0x56')]['id'];}_0x256d01[_0x3e75('0x56')]['UserId']=_0x256d01['body'][_0x3e75('0x5d')]||_0x256d01[_0x3e75('0x5e')]['id'];_0xab2d87[_0x3e75('0x6f')]['id']=_0x256d01[_0x3e75('0x56')][_0x3e75('0x5d')];return db[_0x3e75('0x38')][_0x3e75('0x54')]({'where':{'id':_0x256d01[_0x3e75('0x50')]['id'],'UserId':null}})[_0x3e75('0x1d')](handleEntityNotFound(_0x53d54a,null))[_0x3e75('0x1d')](function(_0x5222d4){if(_0x5222d4){_0xab2d87[_0x3e75('0x25')]=_0x5222d4[_0x3e75('0x63')]({'plain':!![]});return db[_0x3e75('0x5f')]['find']({'where':{'id':_0x5222d4['ChatInteractionId']}});}return null;})[_0x3e75('0x1d')](handleEntityNotFound(_0x53d54a,null))[_0x3e75('0x1d')](function(_0x1ddf3c){if(_0x1ddf3c){_0xab2d87['interaction']=_0x1ddf3c[_0x3e75('0x63')]({'plain':!![]});interaction_log[_0x3e75('0x26')](_0x3e75('0x7c'),_0x256d01[_0x3e75('0x5e')]['id'],_0x256d01[_0x3e75('0x5e')][_0x3e75('0x3c')],_0x256d01[_0x3e75('0x5e')][_0x3e75('0x65')],_0xab2d87[_0x3e75('0x66')]['id'],_0x256d01[_0x3e75('0x56')]?JSON[_0x3e75('0x22')](_0x256d01['body']):_0x3e75('0x7d'));return respondWithRpcPromise(_0x3e75('0x7e'),_0x3e75('0x7f'),_0xab2d87);}return null;})[_0x3e75('0x1d')](function(_0x524eb7){var _0x3d988c=_0x3e75('0x68')+_0x524eb7[_0x3e75('0x25')][_0x3e75('0x69')];return db['sequelize']['query'](_0x3d988c,{'type':db[_0x3e75('0x6a')]['QueryTypes'][_0x3e75('0x6c')],'raw':!![]})['then'](function(_0x395949){return _0x395949;});})[_0x3e75('0x1d')](function(_0x539628){if(_0x539628){_0xab2d87[_0x3e75('0x25')][_0x3e75('0x6d')]=_0x539628[0x0];if(!_0x256d01[_0x3e75('0x56')][_0x3e75('0x5d')])return;return db[_0x3e75('0x6e')][_0x3e75('0x54')]({'where':{'id':_0x256d01[_0x3e75('0x56')][_0x3e75('0x5d')],'role':_0x3e75('0x6f')},'attributes':['id','name',_0x3e75('0x70'),_0x3e75('0x71'),_0x3e75('0x72')],'raw':!![]});}return null;})['then'](function(_0x5e00d0){if(!_0x5e00d0)return null;_0xab2d87[_0x3e75('0x25')][_0x3e75('0x6f')]=_0x5e00d0;return _0xab2d87;})[_0x3e75('0x1d')](function(_0x39fd8a){if(_0x39fd8a){_0x39fd8a[_0x3e75('0x25')][_0x3e75('0x74')]=util['format'](_0x3e75('0x75'),_0x256d01[_0x3e75('0x5e')][_0x3e75('0x3c')]);_0x39fd8a[_0x3e75('0x25')][_0x3e75('0x76')]=_0xab2d87['channel'];_0x39fd8a['message'][_0x3e75('0x80')]=_0xab2d87[_0x3e75('0x76')];_0x39fd8a[_0x3e75('0x25')]['event']=_0x3e75('0x7b');respondWithRpcPromise(_0x3e75('0x77'),_0x3e75('0x77'),{'event':'rejectmessage','message':_[_0x3e75('0x53')](_0xab2d87[_0x3e75('0x25')],JSON[_0x3e75('0x79')](_0xab2d87[_0x3e75('0x66')][_0x3e75('0x7a')]))},client9002);return _0xab2d87;}return null;})[_0x3e75('0x1d')](respondWithResult(_0x53d54a,null))[_0x3e75('0x28')](handleError(_0x53d54a,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 34134e3..3d425ec 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 _0x3aa2=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x3aa2,0x82));var _0x23aa=function(_0xee1ec9,_0x2f0599){_0xee1ec9=_0xee1ec9-0x0;var _0x102a53=_0x3aa2[_0xee1ec9];return _0x102a53;};'use strict';var EventEmitter=require(_0x23aa('0x0'));var ChatMessage=require(_0x23aa('0x1'))['db'][_0x23aa('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x23aa('0x3')](0x0);var events={'afterCreate':_0x23aa('0x4'),'afterUpdate':'update','afterDestroy':_0x23aa('0x5')};function emitEvent(_0x39999b){return function(_0x14a7e2,_0x133c95,_0x2da4bb){ChatMessageEvents[_0x23aa('0x6')](_0x39999b+':'+_0x14a7e2['id'],_0x14a7e2);ChatMessageEvents[_0x23aa('0x6')](_0x39999b,_0x14a7e2);_0x2da4bb(null);};}for(var e in events){if(events[_0x23aa('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x23aa('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x7edf=['update','remove','emit','exports','../../mysqldb','ChatMessage','save'];(function(_0x23f8c8,_0xb536b9){var _0x3dc718=function(_0x25d719){while(--_0x25d719){_0x23f8c8['push'](_0x23f8c8['shift']());}};_0x3dc718(++_0xb536b9);}(_0x7edf,0x10e));var _0xf7ed=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x7edf[_0x28394f];return _0x2618d2;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xf7ed('0x0'))['db'][_0xf7ed('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf7ed('0x2'),'afterUpdate':_0xf7ed('0x3'),'afterDestroy':_0xf7ed('0x4')};function emitEvent(_0x58cab7){return function(_0x4797c7,_0x40c8e8,_0x3c6bdc){ChatMessageEvents[_0xf7ed('0x5')](_0x58cab7+':'+_0x4797c7['id'],_0x4797c7);ChatMessageEvents[_0xf7ed('0x5')](_0x58cab7,_0x4797c7);_0x3c6bdc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf7ed('0x6')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 46b8718..c011f4c 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 _0xb763=['out','secret','isNil','UserId','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x3a5ebd,_0x493272){var _0x3ff829=function(_0x591ff8){while(--_0x591ff8){_0x3a5ebd['push'](_0x3a5ebd['shift']());}};_0x3ff829(++_0x493272);}(_0xb763,0x155));var _0x3b76=function(_0x21350c,_0x6dd57e){_0x21350c=_0x21350c-0x0;var _0x40dbae=_0xb763[_0x21350c];return _0x40dbae;};'use strict';var _=require(_0x3b76('0x0'));var util=require(_0x3b76('0x1'));var logger=require(_0x3b76('0x2'))(_0x3b76('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3b76('0x4'));var fs=require('fs');var path=require(_0x3b76('0x5'));var rimraf=require(_0x3b76('0x6'));var config=require(_0x3b76('0x7'));var attributes=require(_0x3b76('0x8'));module[_0x3b76('0x9')]=function(_0x54f432,_0x4c5a23){return _0x54f432[_0x3b76('0xa')](_0x3b76('0xb'),attributes,{'tableName':_0x3b76('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x3b76('0xd')],'type':_0x3b76('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e611a,_0x38bafa,_0x240c81){var _0x10c6e9=_0x54f432[_0x3b76('0xf')];var _0x5ec864=_0x2e611a[_0x3b76('0x10')]({'plain':!![]});if(_0x5ec864[_0x3b76('0x11')][_0x3b76('0x12')]()==='in'||_0x5ec864[_0x3b76('0x11')][_0x3b76('0x12')]()===_0x3b76('0x13')&&!_0x5ec864[_0x3b76('0x14')]&&!_[_0x3b76('0x15')](_0x5ec864[_0x3b76('0x16')])){_0x10c6e9['ChatInteraction'][_0x3b76('0x17')]({'where':{'id':_0x5ec864[_0x3b76('0x18')]}})[_0x3b76('0x19')](function(_0x2ef589){if(_0x2ef589){_0x2ef589['update']({'lastMsgAt':_0x5ec864[_0x3b76('0x1a')],'lastMsgDirection':_0x5ec864['direction'][_0x3b76('0x12')]()});}})[_0x3b76('0x1b')](function(_0x148c9a){console[_0x3b76('0x1c')](_0x148c9a);});}_0x240c81();}},'charset':'utf8mb4','collate':_0x3b76('0x1d')});}; \ No newline at end of file +var _0xa5ef=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','UserId','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util'];(function(_0x3889ae,_0x4770c3){var _0x6533dd=function(_0x4275f7){while(--_0x4275f7){_0x3889ae['push'](_0x3889ae['shift']());}};_0x6533dd(++_0x4770c3);}(_0xa5ef,0x120));var _0xfa5e=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0xa5ef[_0x514260];return _0x4ac81b;};'use strict';var _=require(_0xfa5e('0x0'));var util=require(_0xfa5e('0x1'));var logger=require(_0xfa5e('0x2'))(_0xfa5e('0x3'));var moment=require(_0xfa5e('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa5e('0x5'));var fs=require('fs');var path=require(_0xfa5e('0x6'));var rimraf=require(_0xfa5e('0x7'));var config=require(_0xfa5e('0x8'));var attributes=require('./chatMessage.attributes');module[_0xfa5e('0x9')]=function(_0x16df33,_0x595f89){return _0x16df33[_0xfa5e('0xa')](_0xfa5e('0xb'),attributes,{'tableName':_0xfa5e('0xc'),'paranoid':![],'indexes':[{'name':_0xfa5e('0xd'),'fields':[_0xfa5e('0xe')],'type':_0xfa5e('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x389b54,_0x450b1b,_0x427596){var _0x43e396=_0x16df33[_0xfa5e('0x10')];var _0x113d67=_0x389b54[_0xfa5e('0x11')]({'plain':!![]});if(_0x113d67[_0xfa5e('0x12')][_0xfa5e('0x13')]()==='in'||_0x113d67[_0xfa5e('0x12')][_0xfa5e('0x13')]()==='out'&&!_0x113d67[_0xfa5e('0x14')]&&!_['isNil'](_0x113d67[_0xfa5e('0x15')])){_0x43e396['ChatInteraction'][_0xfa5e('0x16')]({'where':{'id':_0x113d67[_0xfa5e('0x17')]}})[_0xfa5e('0x18')](function(_0x315cf2){if(_0x315cf2){_0x315cf2['update']({'lastMsgAt':_0x113d67[_0xfa5e('0x19')],'lastMsgDirection':_0x113d67['direction'][_0xfa5e('0x13')]()});}})[_0xfa5e('0x1a')](function(_0x8b1f2f){console[_0xfa5e('0x1b')](_0x8b1f2f);});}_0x427596();}},'charset':'utf8mb4','collate':_0xfa5e('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 2c99ab8..7ccaf84 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 _0xf889=['ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateChatMessage','body','options','raw','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2007cf,_0x42a0c1){var _0x60255c=function(_0x32efaa){while(--_0x32efaa){_0x2007cf['push'](_0x2007cf['shift']());}};_0x60255c(++_0x42a0c1);}(_0xf889,0x19f));var _0x9f88=function(_0x2c07b1,_0x445d20){_0x2c07b1=_0x2c07b1-0x0;var _0x5593f2=_0xf889[_0x2c07b1];return _0x5593f2;};'use strict';var _=require(_0x9f88('0x0'));var util=require('util');var moment=require(_0x9f88('0x1'));var BPromise=require(_0x9f88('0x2'));var rs=require(_0x9f88('0x3'));var fs=require('fs');var Redis=require(_0x9f88('0x4'));var db=require(_0x9f88('0x5'))['db'];var utils=require(_0x9f88('0x6'));var logger=require(_0x9f88('0x7'))(_0x9f88('0x8'));var config=require(_0x9f88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9f88('0xa')]['http']({'port':0x232a});config[_0x9f88('0xb')]=_[_0x9f88('0xc')](config[_0x9f88('0xb')],{'host':_0x9f88('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f88('0xb')]));require(_0x9f88('0xe'))['register'](socket);function respondWithRpcPromise(_0x454756,_0x48e7b3,_0x67fc23){return new BPromise(function(_0x5c7f75,_0x3f37c7){return client['request'](_0x454756,_0x67fc23)[_0x9f88('0xf')](function(_0x95d27c){logger['info'](_0x9f88('0x10'),_0x48e7b3,_0x9f88('0x11'));logger[_0x9f88('0x12')](_0x9f88('0x13'),_0x48e7b3,'request\x20sent',JSON['stringify'](_0x95d27c));if(_0x95d27c[_0x9f88('0x14')]){if(_0x95d27c[_0x9f88('0x14')][_0x9f88('0x15')]===0x1f4){logger[_0x9f88('0x14')](_0x9f88('0x10'),_0x48e7b3,_0x95d27c['error'][_0x9f88('0x16')]);return _0x3f37c7(_0x95d27c[_0x9f88('0x14')][_0x9f88('0x16')]);}logger[_0x9f88('0x14')]('ChatMessage,\x20%s,\x20%s',_0x48e7b3,_0x95d27c['error']['message']);return _0x5c7f75(_0x95d27c[_0x9f88('0x14')][_0x9f88('0x16')]);}else{logger[_0x9f88('0x17')]('ChatMessage,\x20%s,\x20%s',_0x48e7b3,'request\x20sent');_0x5c7f75(_0x95d27c[_0x9f88('0x18')][_0x9f88('0x16')]);}})[_0x9f88('0x19')](function(_0x1f4fa9){logger[_0x9f88('0x14')]('ChatMessage,\x20%s,\x20%s',_0x48e7b3,_0x1f4fa9);_0x3f37c7(_0x1f4fa9);});});}exports[_0x9f88('0x1a')]=function(_0x3a99d4){var _0x35ce2c=this;return new Promise(function(_0x2ae56c,_0x3d76bb){return db['ChatMessage']['create'](_0x3a99d4[_0x9f88('0x1b')],{'raw':_0x3a99d4[_0x9f88('0x1c')]?_0x3a99d4[_0x9f88('0x1c')][_0x9f88('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x1549f7){logger[_0x9f88('0x17')](_0x9f88('0x1a'),_0x3a99d4);logger[_0x9f88('0x12')](_0x9f88('0x1a'),_0x3a99d4,JSON[_0x9f88('0x1e')](_0x1549f7));_0x2ae56c(_0x1549f7);})['catch'](function(_0x33e755){logger['error'](_0x9f88('0x1a'),_0x33e755['message'],_0x3a99d4);_0x3d76bb(_0x35ce2c[_0x9f88('0x14')](0x1f4,_0x33e755[_0x9f88('0x16')]));});});}; \ No newline at end of file +var _0xa85a=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','info','catch','CreateChatMessage','ChatMessage','create','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa85a,0x92));var _0xaa85=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa85a[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require(_0xaa85('0x0'));var moment=require(_0xaa85('0x1'));var BPromise=require(_0xaa85('0x2'));var rs=require(_0xaa85('0x3'));var fs=require('fs');var Redis=require(_0xaa85('0x4'));var db=require(_0xaa85('0x5'))['db'];var utils=require(_0xaa85('0x6'));var logger=require(_0xaa85('0x7'))('rpc');var config=require(_0xaa85('0x8'));var jayson=require(_0xaa85('0x9'));var client=jayson[_0xaa85('0xa')][_0xaa85('0xb')]({'port':0x232a});config[_0xaa85('0xc')]=_[_0xaa85('0xd')](config[_0xaa85('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa85('0xe'))(new Redis(config[_0xaa85('0xc')]));require(_0xaa85('0xf'))['register'](socket);function respondWithRpcPromise(_0x5a94fb,_0x541bec,_0xd61a01){return new BPromise(function(_0x57d02e,_0x504b62){return client[_0xaa85('0x10')](_0x5a94fb,_0xd61a01)[_0xaa85('0x11')](function(_0x3342dd){logger['info']('ChatMessage,\x20%s,\x20%s',_0x541bec,_0xaa85('0x12'));logger[_0xaa85('0x13')](_0xaa85('0x14'),_0x541bec,_0xaa85('0x12'),JSON[_0xaa85('0x15')](_0x3342dd));if(_0x3342dd['error']){if(_0x3342dd['error']['code']===0x1f4){logger[_0xaa85('0x16')](_0xaa85('0x17'),_0x541bec,_0x3342dd[_0xaa85('0x16')]['message']);return _0x504b62(_0x3342dd[_0xaa85('0x16')]['message']);}logger[_0xaa85('0x16')](_0xaa85('0x17'),_0x541bec,_0x3342dd['error'][_0xaa85('0x18')]);return _0x57d02e(_0x3342dd['error'][_0xaa85('0x18')]);}else{logger[_0xaa85('0x19')](_0xaa85('0x17'),_0x541bec,'request\x20sent');_0x57d02e(_0x3342dd['result'][_0xaa85('0x18')]);}})[_0xaa85('0x1a')](function(_0x1bf423){logger['error'](_0xaa85('0x17'),_0x541bec,_0x1bf423);_0x504b62(_0x1bf423);});});}exports[_0xaa85('0x1b')]=function(_0xee3d2e){var _0x2ee476=this;return new Promise(function(_0x5a8ed0,_0x42261d){return db[_0xaa85('0x1c')][_0xaa85('0x1d')](_0xee3d2e['body'],{'raw':_0xee3d2e[_0xaa85('0x1e')]?_0xee3d2e['options']['raw']===undefined?!![]:![]:!![]})[_0xaa85('0x11')](function(_0x1bbfec){logger[_0xaa85('0x19')]('CreateChatMessage',_0xee3d2e);logger[_0xaa85('0x13')](_0xaa85('0x1b'),_0xee3d2e,JSON[_0xaa85('0x15')](_0x1bbfec));_0x5a8ed0(_0x1bbfec);})[_0xaa85('0x1a')](function(_0x87c398){logger[_0xaa85('0x16')](_0xaa85('0x1b'),_0x87c398['message'],_0xee3d2e);_0x42261d(_0x2ee476['error'](0x1f4,_0x87c398[_0xaa85('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 9d7657f..8357ca1 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 _0xb91a=['remove','emit','removeListener','register','./chatMessage.events','save'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xb91a,0xf4));var _0xab91=function(_0xca293a,_0x392fdb){_0xca293a=_0xca293a-0x0;var _0x3f772f=_0xb91a[_0xca293a];return _0x3f772f;};'use strict';var ChatMessageEvents=require(_0xab91('0x0'));var events=[_0xab91('0x1'),_0xab91('0x2'),'update'];function createListener(_0x59b921,_0x36ffe5){return function(_0x37cd1e){_0x36ffe5[_0xab91('0x3')](_0x59b921,_0x37cd1e);};}function removeListener(_0x439eb2,_0x1afca9){return function(){ChatMessageEvents[_0xab91('0x4')](_0x439eb2,_0x1afca9);};}exports[_0xab91('0x5')]=function(_0x429933){for(var _0x290af9=0x0,_0x34932f=events['length'];_0x290af9<_0x34932f;_0x290af9++){var _0x1729f6=events[_0x290af9];var _0x1e8d52=createListener('chatMessage:'+_0x1729f6,_0x429933);ChatMessageEvents['on'](_0x1729f6,_0x1e8d52);}}; \ No newline at end of file +var _0x979e=['update','emit','register','length','chatMessage:','./chatMessage.events','save','remove'];(function(_0x594983,_0x52e4ea){var _0x4e63d4=function(_0x2913d7){while(--_0x2913d7){_0x594983['push'](_0x594983['shift']());}};_0x4e63d4(++_0x52e4ea);}(_0x979e,0x195));var _0xe979=function(_0x17ce32,_0x31aed4){_0x17ce32=_0x17ce32-0x0;var _0x172231=_0x979e[_0x17ce32];return _0x172231;};'use strict';var ChatMessageEvents=require(_0xe979('0x0'));var events=[_0xe979('0x1'),_0xe979('0x2'),_0xe979('0x3')];function createListener(_0x5ce889,_0x10fb90){return function(_0x47321a){_0x10fb90[_0xe979('0x4')](_0x5ce889,_0x47321a);};}function removeListener(_0x3b4b06,_0x2d62dd){return function(){ChatMessageEvents['removeListener'](_0x3b4b06,_0x2d62dd);};}exports[_0xe979('0x5')]=function(_0x580e20){for(var _0x1a0d35=0x0,_0x13a9ee=events[_0xe979('0x6')];_0x1a0d35<_0x13a9ee;_0x1a0d35++){var _0xc63524=events[_0x1a0d35];var _0xc79c06=createListener(_0xe979('0x7')+_0xc63524,_0x580e20);ChatMessageEvents['on'](_0xc63524,_0xc79c06);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6c9dd20..747a240 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 _0x4d77=['chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','/describe','isAuthenticated','/:id','show','tracked'];(function(_0x347f48,_0x56f804){var _0x46cc93=function(_0x9be841){while(--_0x9be841){_0x347f48['push'](_0x347f48['shift']());}};_0x46cc93(++_0x56f804);}(_0x4d77,0x12a));var _0x74d7=function(_0x4c2a6f,_0x914ebf){_0x4c2a6f=_0x4c2a6f-0x0;var _0x510f7c=_0x4d77[_0x4c2a6f];return _0x510f7c;};'use strict';var multer=require(_0x74d7('0x0'));var util=require(_0x74d7('0x1'));var path=require('path');var timeout=require(_0x74d7('0x2'));var express=require(_0x74d7('0x3'));var router=express['Router']();var fs_extra=require(_0x74d7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x74d7('0x5'));var config=require(_0x74d7('0x6'));var controller=require(_0x74d7('0x7'));router[_0x74d7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x74d7('0x9'),auth[_0x74d7('0xa')](),controller['describe']);router[_0x74d7('0x8')](_0x74d7('0xb'),auth['isAuthenticated'](),controller[_0x74d7('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x74d7('0xd')](_0x74d7('0xe'),_0x74d7('0xf')),controller[_0x74d7('0x10')]);router[_0x74d7('0x11')](_0x74d7('0xb'),controller[_0x74d7('0x12')]);router[_0x74d7('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x74d7('0x13')]);router['put'](_0x74d7('0x14'),auth[_0x74d7('0xa')](),controller[_0x74d7('0x15')]);router[_0x74d7('0x16')](_0x74d7('0xb'),auth[_0x74d7('0xa')](),controller[_0x74d7('0x17')]);module['exports']=router; \ No newline at end of file +var _0xac33=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chat','chatmessage:create','update','put','/:id/accept','/:id/reject','delete','exports'];(function(_0x41695d,_0x12a442){var _0x297c7b=function(_0x4d319b){while(--_0x4d319b){_0x41695d['push'](_0x41695d['shift']());}};_0x297c7b(++_0x12a442);}(_0xac33,0x82));var _0x3ac3=function(_0x19b3f9,_0x407fdc){_0x19b3f9=_0x19b3f9-0x0;var _0x51cfc6=_0xac33[_0x19b3f9];return _0x51cfc6;};'use strict';var multer=require(_0x3ac3('0x0'));var util=require(_0x3ac3('0x1'));var path=require(_0x3ac3('0x2'));var timeout=require(_0x3ac3('0x3'));var express=require(_0x3ac3('0x4'));var router=express[_0x3ac3('0x5')]();var fs_extra=require(_0x3ac3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3ac3('0x7'));var config=require(_0x3ac3('0x8'));var controller=require(_0x3ac3('0x9'));router[_0x3ac3('0xa')]('/',auth[_0x3ac3('0xb')](),controller[_0x3ac3('0xc')]);router['get'](_0x3ac3('0xd'),auth[_0x3ac3('0xb')](),controller[_0x3ac3('0xe')]);router[_0x3ac3('0xa')](_0x3ac3('0xf'),auth[_0x3ac3('0xb')](),controller[_0x3ac3('0x10')]);router[_0x3ac3('0x11')]('/',auth[_0x3ac3('0xb')](),interaction['tracked'](_0x3ac3('0x12'),_0x3ac3('0x13')),controller['create']);router['put'](_0x3ac3('0xf'),controller[_0x3ac3('0x14')]);router[_0x3ac3('0x15')](_0x3ac3('0x16'),auth[_0x3ac3('0xb')](),controller['accept']);router['put'](_0x3ac3('0x17'),auth[_0x3ac3('0xb')](),controller['reject']);router[_0x3ac3('0x18')](_0x3ac3('0xf'),auth[_0x3ac3('0xb')](),controller['destroy']);module[_0x3ac3('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index b8675ff..51b2e44 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 _0x5f66=['medium','TEXT','exports'];(function(_0x4d497a,_0x1c5291){var _0x17c76f=function(_0x107383){while(--_0x107383){_0x4d497a['push'](_0x4d497a['shift']());}};_0x17c76f(++_0x1c5291);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0xb10b=['medium','sequelize','TEXT'];(function(_0x35c22b,_0x49956b){var _0x3e9f5a=function(_0x24b15d){while(--_0x24b15d){_0x35c22b['push'](_0x35c22b['shift']());}};_0x3e9f5a(++_0x49956b);}(_0xb10b,0x12a));var _0xbb10=function(_0x36e963,_0x61d1f9){_0x36e963=_0x36e963-0x0;var _0x5e4971=_0xb10b[_0x36e963];return _0x5e4971;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index ab2fb81..8416b62 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x7a54,0x106));var _0x47a5=function(_0x21439c,_0x116a35){_0x21439c=_0x21439c-0x0;var _0x4bc4a7=_0x7a54[_0x21439c];return _0x4bc4a7;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x7a54,0x106));var _0x47a5=function(_0x137254,_0x4d52cd){_0x137254=_0x137254-0x0;var _0x117a15=_0x7a54[_0x137254];return _0x117a15;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index fd65734..6bf4bdb 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa901=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','ChatOfflineMessage'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xa901,0x189));var _0x1a90=function(_0x244fe6,_0x2b3b4a){_0x244fe6=_0x244fe6-0x0;var _0x25fecf=_0xa901[_0x244fe6];return _0x25fecf;};'use strict';var EventEmitter=require(_0x1a90('0x0'));var ChatOfflineMessage=require(_0x1a90('0x1'))['db'][_0x1a90('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1a90('0x3')](0x0);var events={'afterCreate':_0x1a90('0x4'),'afterUpdate':_0x1a90('0x5'),'afterDestroy':_0x1a90('0x6')};function emitEvent(_0x389611){return function(_0xddaf70,_0x6fbe31,_0x1acee8){ChatOfflineMessageEvents['emit'](_0x389611+':'+_0xddaf70['id'],_0xddaf70);ChatOfflineMessageEvents[_0x1a90('0x7')](_0x389611,_0xddaf70);_0x1acee8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1a90('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x6691=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6691,0x176));var _0x1669=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6691[_0x2d7f0e];return _0x110b07;};'use strict';var EventEmitter=require(_0x1669('0x0'));var ChatOfflineMessage=require(_0x1669('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1669('0x2')](0x0);var events={'afterCreate':_0x1669('0x3'),'afterUpdate':_0x1669('0x4'),'afterDestroy':_0x1669('0x5')};function emitEvent(_0xef4821){return function(_0x2176b7,_0x482a76,_0x41cf5f){ChatOfflineMessageEvents[_0x1669('0x6')](_0xef4821+':'+_0x2176b7['id'],_0x2176b7);ChatOfflineMessageEvents[_0x1669('0x6')](_0xef4821,_0x2176b7);_0x41cf5f(null);};}for(var e in events){if(events[_0x1669('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1669('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 5dbee85..2ce5014 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 _0x741c=['chat_offline_messages','exports','define','ChatOfflineMessage'];(function(_0x18b729,_0x3f159e){var _0x596825=function(_0x1e285d){while(--_0x1e285d){_0x18b729['push'](_0x18b729['shift']());}};_0x596825(++_0x3f159e);}(_0x741c,0x14d));var _0xc741=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x741c[_0x42cae2];return _0x5f256f;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xc741('0x0')]=function(_0x3a7765){return _0x3a7765[_0xc741('0x1')](_0xc741('0x2'),attributes,{'tableName':_0xc741('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xef10=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x1a1c1c,_0x267b82){var _0x2d08a9=function(_0x591624){while(--_0x591624){_0x1a1c1c['push'](_0x1a1c1c['shift']());}};_0x2d08a9(++_0x267b82);}(_0xef10,0x1e6));var _0x0ef1=function(_0x1ad394,_0x1beea7){_0x1ad394=_0x1ad394-0x0;var _0x7548c=_0xef10[_0x1ad394];return _0x7548c;};'use strict';var attributes=require(_0x0ef1('0x0'));module[_0x0ef1('0x1')]=function(_0x3729a8){return _0x3729a8[_0x0ef1('0x2')](_0x0ef1('0x3'),attributes,{'tableName':_0x0ef1('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ef1('0x5'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index dadf7b4..3acd85c 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 _0xb1bd=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','ioredis'];(function(_0x2414a7,_0x3fb6a2){var _0x2a5c82=function(_0x4896cb){while(--_0x4896cb){_0x2414a7['push'](_0x2414a7['shift']());}};_0x2a5c82(++_0x3fb6a2);}(_0xb1bd,0x105));var _0xdb1b=function(_0x58649a,_0x1d8bd5){_0x58649a=_0x58649a-0x0;var _0x2be549=_0xb1bd[_0x58649a];return _0x2be549;};'use strict';var _=require(_0xdb1b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdb1b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb1b('0x2'));var db=require(_0xdb1b('0x3'))['db'];var utils=require(_0xdb1b('0x4'));var logger=require(_0xdb1b('0x5'))(_0xdb1b('0x6'));var config=require(_0xdb1b('0x7'));var jayson=require(_0xdb1b('0x8'));var client=jayson[_0xdb1b('0x9')][_0xdb1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48da3a,_0x85108,_0x16efb6){return new BPromise(function(_0x4dc1b0,_0x3818b9){return client[_0xdb1b('0xb')](_0x48da3a,_0x16efb6)['then'](function(_0x9318fe){logger[_0xdb1b('0xc')](_0xdb1b('0xd'),_0x85108,_0xdb1b('0xe'));logger[_0xdb1b('0xf')](_0xdb1b('0x10'),_0x85108,_0xdb1b('0xe'),JSON[_0xdb1b('0x11')](_0x9318fe));if(_0x9318fe['error']){if(_0x9318fe['error']['code']===0x1f4){logger[_0xdb1b('0x12')](_0xdb1b('0xd'),_0x85108,_0x9318fe[_0xdb1b('0x12')][_0xdb1b('0x13')]);return _0x3818b9(_0x9318fe['error'][_0xdb1b('0x13')]);}logger[_0xdb1b('0x12')](_0xdb1b('0xd'),_0x85108,_0x9318fe[_0xdb1b('0x12')]['message']);return _0x4dc1b0(_0x9318fe[_0xdb1b('0x12')][_0xdb1b('0x13')]);}else{logger[_0xdb1b('0xc')](_0xdb1b('0xd'),_0x85108,_0xdb1b('0xe'));_0x4dc1b0(_0x9318fe[_0xdb1b('0x14')][_0xdb1b('0x13')]);}})[_0xdb1b('0x15')](function(_0x31dda6){logger['error'](_0xdb1b('0xd'),_0x85108,_0x31dda6);_0x3818b9(_0x31dda6);});});} \ No newline at end of file +var _0xac3d=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x58723b,_0x3b4229){var _0x477c75=function(_0x18fd2f){while(--_0x18fd2f){_0x58723b['push'](_0x58723b['shift']());}};_0x477c75(++_0x3b4229);}(_0xac3d,0x69));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdac3('0x0'));var util=require(_0xdac3('0x1'));var moment=require(_0xdac3('0x2'));var BPromise=require('bluebird');var rs=require(_0xdac3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdac3('0x4'))['db'];var utils=require(_0xdac3('0x5'));var logger=require(_0xdac3('0x6'))(_0xdac3('0x7'));var config=require(_0xdac3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdac3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50a82b,_0x400588,_0x509daa){return new BPromise(function(_0x5a7b2f,_0x21fdb8){return client[_0xdac3('0xa')](_0x50a82b,_0x509daa)[_0xdac3('0xb')](function(_0x5cce1d){logger[_0xdac3('0xc')](_0xdac3('0xd'),_0x400588,'request\x20sent');logger[_0xdac3('0xe')](_0xdac3('0xf'),_0x400588,_0xdac3('0x10'),JSON[_0xdac3('0x11')](_0x5cce1d));if(_0x5cce1d[_0xdac3('0x12')]){if(_0x5cce1d[_0xdac3('0x12')][_0xdac3('0x13')]===0x1f4){logger[_0xdac3('0x12')](_0xdac3('0xd'),_0x400588,_0x5cce1d['error']['message']);return _0x21fdb8(_0x5cce1d[_0xdac3('0x12')][_0xdac3('0x14')]);}logger[_0xdac3('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x400588,_0x5cce1d[_0xdac3('0x12')][_0xdac3('0x14')]);return _0x5a7b2f(_0x5cce1d['error'][_0xdac3('0x14')]);}else{logger['info'](_0xdac3('0xd'),_0x400588,'request\x20sent');_0x5a7b2f(_0x5cce1d[_0xdac3('0x15')][_0xdac3('0x14')]);}})[_0xdac3('0x16')](function(_0x913eb8){logger[_0xdac3('0x12')](_0xdac3('0xd'),_0x400588,_0x913eb8);_0x21fdb8(_0x913eb8);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 31cfce8..e32d40a 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 _0x875c=['index','/describe','describe','post','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated'];(function(_0x3e51e1,_0x40a642){var _0x1b4d7b=function(_0x404602){while(--_0x404602){_0x3e51e1['push'](_0x3e51e1['shift']());}};_0x1b4d7b(++_0x40a642);}(_0x875c,0xc7));var _0xc875=function(_0xf148b9,_0x4d0bea){_0xf148b9=_0xf148b9-0x0;var _0x1ba819=_0x875c[_0xf148b9];return _0x1ba819;};'use strict';var multer=require(_0xc875('0x0'));var util=require(_0xc875('0x1'));var path=require(_0xc875('0x2'));var timeout=require(_0xc875('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc875('0x4'));var auth=require(_0xc875('0x5'));var interaction=require(_0xc875('0x6'));var config=require(_0xc875('0x7'));var controller=require(_0xc875('0x8'));router['get']('/',auth[_0xc875('0x9')](),controller[_0xc875('0xa')]);router['get'](_0xc875('0xb'),auth[_0xc875('0x9')](),controller[_0xc875('0xc')]);router['get']('/:id',auth[_0xc875('0x9')](),controller['show']);router[_0xc875('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc875('0xe')](_0xc875('0xf'),auth['isAuthenticated'](),controller[_0xc875('0x10')]);router[_0xc875('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc875('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe9bd=['describe','/:id','show','post','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','index','get','/describe','isAuthenticated'];(function(_0x1617f9,_0x41fa90){var _0x370354=function(_0x5e72c7){while(--_0x5e72c7){_0x1617f9['push'](_0x1617f9['shift']());}};_0x370354(++_0x41fa90);}(_0xe9bd,0xee));var _0xde9b=function(_0x1b47ed,_0x582619){_0x1b47ed=_0x1b47ed-0x0;var _0x4eb1e1=_0xe9bd[_0x1b47ed];return _0x4eb1e1;};'use strict';var multer=require(_0xde9b('0x0'));var util=require(_0xde9b('0x1'));var path=require('path');var timeout=require(_0xde9b('0x2'));var express=require(_0xde9b('0x3'));var router=express[_0xde9b('0x4')]();var fs_extra=require(_0xde9b('0x5'));var auth=require(_0xde9b('0x6'));var interaction=require(_0xde9b('0x7'));var config=require(_0xde9b('0x8'));var controller=require(_0xde9b('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xde9b('0xa')]);router[_0xde9b('0xb')](_0xde9b('0xc'),auth[_0xde9b('0xd')](),controller[_0xde9b('0xe')]);router['get'](_0xde9b('0xf'),auth[_0xde9b('0xd')](),controller[_0xde9b('0x10')]);router[_0xde9b('0x11')]('/',auth[_0xde9b('0xd')](),controller['create']);router[_0xde9b('0x12')](_0xde9b('0xf'),auth[_0xde9b('0xd')](),controller[_0xde9b('0x13')]);router[_0xde9b('0x14')]('/:id',auth[_0xde9b('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index a25ace3..c03374b 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 _0x1ec6=['exports','STRING','ENUM','timeout','mouseOver','INTEGER'];(function(_0x23fa84,_0x2c20b2){var _0xd98726=function(_0x57945a){while(--_0x57945a){_0x23fa84['push'](_0x23fa84['shift']());}};_0xd98726(++_0x2c20b2);}(_0x1ec6,0xf6));var _0x61ec=function(_0x5e0f41,_0x1e4ad3){_0x5e0f41=_0x5e0f41-0x0;var _0x42531c=_0x1ec6[_0x5e0f41];return _0x42531c;};'use strict';var Sequelize=require('sequelize');module[_0x61ec('0x0')]={'name':{'type':Sequelize[_0x61ec('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x61ec('0x2')]('mouseOver',_0x61ec('0x3')),'defaultValue':_0x61ec('0x4')},'selector':{'type':Sequelize[_0x61ec('0x1')]},'timeout':{'type':Sequelize[_0x61ec('0x5')]}}; \ No newline at end of file +var _0x16c4=['sequelize','exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x1412a3,_0x1cbd48){var _0x5880a3=function(_0xaf6e88){while(--_0xaf6e88){_0x1412a3['push'](_0x1412a3['shift']());}};_0x5880a3(++_0x1cbd48);}(_0x16c4,0x149));var _0x416c=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x16c4[_0x5f1617];return _0x3af5da;};'use strict';var Sequelize=require(_0x416c('0x0'));module[_0x416c('0x1')]={'name':{'type':Sequelize[_0x416c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x416c('0x3')](_0x416c('0x4'),_0x416c('0x5')),'defaultValue':_0x416c('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x416c('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index cde5740..c40fcf2 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 _0x02a7=['moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','show','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','params','rimraf','request-promise'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x02a7,0x7a));var _0x702a=function(_0x3c0634,_0x56d07e){_0x3c0634=_0x3c0634-0x0;var _0x452313=_0x02a7[_0x3c0634];return _0x452313;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x702a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x702a('0x1'));var moment=require(_0x702a('0x2'));var BPromise=require(_0x702a('0x3'));var Mustache=require(_0x702a('0x4'));var util=require(_0x702a('0x5'));var path=require(_0x702a('0x6'));var sox=require(_0x702a('0x7'));var csv=require('to-csv');var ejs=require(_0x702a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x702a('0x9'));var squel=require(_0x702a('0xa'));var crypto=require(_0x702a('0xb'));var jsforce=require(_0x702a('0xc'));var deskjs=require(_0x702a('0xd'));var toCsv=require(_0x702a('0xe'));var querystring=require(_0x702a('0xf'));var Papa=require('papaparse');var Redis=require(_0x702a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x702a('0x11'));var hardwareService=require(_0x702a('0x12'));var logger=require(_0x702a('0x13'))(_0x702a('0x14'));var utils=require('../../config/utils');var config=require(_0x702a('0x15'));var licenseUtil=require(_0x702a('0x16'));var db=require(_0x702a('0x17'))['db'];function respondWithStatusCode(_0x221b35,_0x4688d1){_0x4688d1=_0x4688d1||0xcc;return function(_0x75455){if(_0x75455){return _0x221b35[_0x702a('0x18')](_0x4688d1);}return _0x221b35['status'](_0x4688d1)['end']();};}function respondWithResult(_0x38139d,_0x57f5fc){_0x57f5fc=_0x57f5fc||0xc8;return function(_0x576cf8){if(_0x576cf8){return _0x38139d['status'](_0x57f5fc)['json'](_0x576cf8);}};}function respondWithFilteredResult(_0x5c768d,_0x44f7fd){return function(_0x3c9770){if(_0x3c9770){var _0xa124dd=typeof _0x44f7fd['offset']==='undefined'&&typeof _0x44f7fd['limit']===_0x702a('0x19');var _0x469cb2=_0x3c9770[_0x702a('0x1a')];var _0x492cfb=_0xa124dd?0x0:_0x44f7fd[_0x702a('0x1b')];var _0x5ec1b3=_0xa124dd?_0x3c9770[_0x702a('0x1a')]:_0x44f7fd[_0x702a('0x1b')]+_0x44f7fd['limit'];var _0x4f8b29;if(_0x5ec1b3>=_0x469cb2){_0x5ec1b3=_0x469cb2;_0x4f8b29=0xc8;}else{_0x4f8b29=0xce;}_0x5c768d[_0x702a('0x1c')](_0x4f8b29);return _0x5c768d[_0x702a('0x1d')](_0x702a('0x1e'),_0x492cfb+'-'+_0x5ec1b3+'/'+_0x469cb2)[_0x702a('0x1f')](_0x3c9770);}return null;};}function patchUpdates(_0x332254){return function(_0x3152bf){try{jsonpatch[_0x702a('0x20')](_0x3152bf,_0x332254,!![]);}catch(_0x3a4add){return BPromise[_0x702a('0x21')](_0x3a4add);}return _0x3152bf[_0x702a('0x22')]();};}function saveUpdates(_0x47d0f5,_0x1ecd28){return function(_0x3d213c){if(_0x3d213c){return _0x3d213c[_0x702a('0x23')](_0x47d0f5)[_0x702a('0x24')](function(_0x1d6dae){return _0x1d6dae;});}return null;};}function removeEntity(_0x466b74,_0x2aede0){return function(_0x156212){if(_0x156212){return _0x156212[_0x702a('0x25')]()['then'](function(){_0x466b74[_0x702a('0x1c')](0xcc)[_0x702a('0x26')]();});}};}function handleEntityNotFound(_0x57add6,_0xf08699){return function(_0x1a9fbf){if(!_0x1a9fbf){_0x57add6[_0x702a('0x18')](0x194);}return _0x1a9fbf;};}function handleError(_0xf6b463,_0x3d4ed0){_0x3d4ed0=_0x3d4ed0||0x1f4;return function(_0x2eff20){logger['error'](_0x2eff20[_0x702a('0x27')]);if(_0x2eff20[_0x702a('0x28')]){delete _0x2eff20['name'];}_0xf6b463[_0x702a('0x1c')](_0x3d4ed0)[_0x702a('0x29')](_0x2eff20);};}exports[_0x702a('0x2a')]=function(_0x21ba99,_0x1973c7){var _0xa0877a={'raw':!![],'where':{'id':_0x21ba99['params']['id']}},_0x1596a8={};_0x1596a8[_0x702a('0x2b')]=_[_0x702a('0x2c')](db[_0x702a('0x2d')][_0x702a('0x2e')]);_0x1596a8[_0x702a('0x2f')]=_[_0x702a('0x2c')](_0x21ba99['query']);_0x1596a8[_0x702a('0x30')]=_[_0x702a('0x31')](_0x1596a8['model'],_0x1596a8['query']);_0xa0877a[_0x702a('0x32')]=_[_0x702a('0x31')](_0x1596a8['model'],qs[_0x702a('0x33')](_0x21ba99['query']['fields']));_0xa0877a[_0x702a('0x32')]=_0xa0877a[_0x702a('0x32')][_0x702a('0x34')]?_0xa0877a['attributes']:_0x1596a8[_0x702a('0x2b')];if(_0x21ba99[_0x702a('0x2f')][_0x702a('0x35')]){_0xa0877a[_0x702a('0x36')]=[{'all':!![]}];}_0xa0877a=_[_0x702a('0x37')]({},_0xa0877a,_0x21ba99[_0x702a('0x38')]);return db[_0x702a('0x2d')][_0x702a('0x39')](_0xa0877a)[_0x702a('0x24')](handleEntityNotFound(_0x1973c7,null))[_0x702a('0x24')](respondWithResult(_0x1973c7,null))[_0x702a('0x3a')](handleError(_0x1973c7,null));};exports[_0x702a('0x3b')]=function(_0x17ff8d,_0x21e522){return db[_0x702a('0x2d')][_0x702a('0x3b')](_0x17ff8d[_0x702a('0x3c')],{})[_0x702a('0x24')](respondWithResult(_0x21e522,0xc9))['catch'](handleError(_0x21e522,null));};exports[_0x702a('0x23')]=function(_0x3e6cf7,_0x32e995){if(_0x3e6cf7[_0x702a('0x3c')]['id']){delete _0x3e6cf7[_0x702a('0x3c')]['id'];}return db[_0x702a('0x2d')][_0x702a('0x39')]({'where':{'id':_0x3e6cf7[_0x702a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x32e995,null))[_0x702a('0x24')](saveUpdates(_0x3e6cf7[_0x702a('0x3c')],null))[_0x702a('0x24')](respondWithResult(_0x32e995,null))[_0x702a('0x3a')](handleError(_0x32e995,null));};exports[_0x702a('0x25')]=function(_0x1b65bf,_0x3bc107){return db[_0x702a('0x2d')][_0x702a('0x39')]({'where':{'id':_0x1b65bf[_0x702a('0x3d')]['id']}})[_0x702a('0x24')](handleEntityNotFound(_0x3bc107,null))[_0x702a('0x24')](removeEntity(_0x3bc107,null))[_0x702a('0x3a')](handleError(_0x3bc107,null));}; \ No newline at end of file +var _0x80d9=['Content-Range','apply','save','then','error','stack','name','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','fields','attributes','length','find','catch','create','body','update','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set'];(function(_0x3455c9,_0x4010d4){var _0xeb784=function(_0x14d6cc){while(--_0x14d6cc){_0x3455c9['push'](_0x3455c9['shift']());}};_0xeb784(++_0x4010d4);}(_0x80d9,0x15c));var _0x980d=function(_0x4e5219,_0x545708){_0x4e5219=_0x4e5219-0x0;var _0x448484=_0x80d9[_0x4e5219];return _0x448484;};'use strict';var emlformat=require(_0x980d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x980d('0x1'));var jsonpatch=require(_0x980d('0x2'));var rp=require(_0x980d('0x3'));var moment=require('moment');var BPromise=require(_0x980d('0x4'));var Mustache=require(_0x980d('0x5'));var util=require(_0x980d('0x6'));var path=require(_0x980d('0x7'));var sox=require(_0x980d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x980d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x980d('0xa'));var jsforce=require(_0x980d('0xb'));var deskjs=require(_0x980d('0xc'));var toCsv=require(_0x980d('0xd'));var querystring=require(_0x980d('0xe'));var Papa=require(_0x980d('0xf'));var Redis=require(_0x980d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x980d('0x11'));var logger=require(_0x980d('0x12'))('api');var utils=require(_0x980d('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x980d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc0168a,_0x19cb9b){_0x19cb9b=_0x19cb9b||0xcc;return function(_0x171a61){if(_0x171a61){return _0xc0168a[_0x980d('0x15')](_0x19cb9b);}return _0xc0168a[_0x980d('0x16')](_0x19cb9b)[_0x980d('0x17')]();};}function respondWithResult(_0x109ddf,_0x3a317b){_0x3a317b=_0x3a317b||0xc8;return function(_0x5f524e){if(_0x5f524e){return _0x109ddf[_0x980d('0x16')](_0x3a317b)[_0x980d('0x18')](_0x5f524e);}};}function respondWithFilteredResult(_0x3fc5f7,_0x3846bd){return function(_0x2f229b){if(_0x2f229b){var _0x169648=typeof _0x3846bd['offset']===_0x980d('0x19')&&typeof _0x3846bd[_0x980d('0x1a')]==='undefined';var _0x1633cf=_0x2f229b['count'];var _0x23f64c=_0x169648?0x0:_0x3846bd[_0x980d('0x1b')];var _0x39192b=_0x169648?_0x2f229b[_0x980d('0x1c')]:_0x3846bd[_0x980d('0x1b')]+_0x3846bd[_0x980d('0x1a')];var _0x3ef68b;if(_0x39192b>=_0x1633cf){_0x39192b=_0x1633cf;_0x3ef68b=0xc8;}else{_0x3ef68b=0xce;}_0x3fc5f7[_0x980d('0x16')](_0x3ef68b);return _0x3fc5f7[_0x980d('0x1d')](_0x980d('0x1e'),_0x23f64c+'-'+_0x39192b+'/'+_0x1633cf)[_0x980d('0x18')](_0x2f229b);}return null;};}function patchUpdates(_0x550741){return function(_0x58dddf){try{jsonpatch[_0x980d('0x1f')](_0x58dddf,_0x550741,!![]);}catch(_0x551339){return BPromise['reject'](_0x551339);}return _0x58dddf[_0x980d('0x20')]();};}function saveUpdates(_0x1d6286,_0x45d698){return function(_0xbb89e3){if(_0xbb89e3){return _0xbb89e3['update'](_0x1d6286)['then'](function(_0x11cb45){return _0x11cb45;});}return null;};}function removeEntity(_0x4fca61,_0x4de252){return function(_0x20cea1){if(_0x20cea1){return _0x20cea1['destroy']()[_0x980d('0x21')](function(){_0x4fca61['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ecf91,_0x43a28f){return function(_0x43f278){if(!_0x43f278){_0x4ecf91[_0x980d('0x15')](0x194);}return _0x43f278;};}function handleError(_0x28adb3,_0x5342dd){_0x5342dd=_0x5342dd||0x1f4;return function(_0x5a2b76){logger[_0x980d('0x22')](_0x5a2b76[_0x980d('0x23')]);if(_0x5a2b76[_0x980d('0x24')]){delete _0x5a2b76[_0x980d('0x24')];}_0x28adb3[_0x980d('0x16')](_0x5342dd)['send'](_0x5a2b76);};}exports['show']=function(_0x2830e5,_0x1fb508){var _0x7828f1={'raw':!![],'where':{'id':_0x2830e5[_0x980d('0x25')]['id']}},_0xf00845={};_0xf00845[_0x980d('0x26')]=_['keys'](db[_0x980d('0x27')][_0x980d('0x28')]);_0xf00845[_0x980d('0x29')]=_[_0x980d('0x2a')](_0x2830e5[_0x980d('0x29')]);_0xf00845[_0x980d('0x2b')]=_[_0x980d('0x2c')](_0xf00845[_0x980d('0x26')],_0xf00845[_0x980d('0x29')]);_0x7828f1['attributes']=_[_0x980d('0x2c')](_0xf00845[_0x980d('0x26')],qs[_0x980d('0x2d')](_0x2830e5['query']['fields']));_0x7828f1[_0x980d('0x2e')]=_0x7828f1['attributes'][_0x980d('0x2f')]?_0x7828f1['attributes']:_0xf00845['model'];if(_0x2830e5['query']['includeAll']){_0x7828f1['include']=[{'all':!![]}];}_0x7828f1=_['merge']({},_0x7828f1,_0x2830e5['options']);return db[_0x980d('0x27')][_0x980d('0x30')](_0x7828f1)[_0x980d('0x21')](handleEntityNotFound(_0x1fb508,null))['then'](respondWithResult(_0x1fb508,null))[_0x980d('0x31')](handleError(_0x1fb508,null));};exports[_0x980d('0x32')]=function(_0x6b6a40,_0x2623d8){return db[_0x980d('0x27')][_0x980d('0x32')](_0x6b6a40[_0x980d('0x33')],{})['then'](respondWithResult(_0x2623d8,0xc9))[_0x980d('0x31')](handleError(_0x2623d8,null));};exports[_0x980d('0x34')]=function(_0x5f4502,_0x92c9bd){if(_0x5f4502['body']['id']){delete _0x5f4502[_0x980d('0x33')]['id'];}return db[_0x980d('0x27')][_0x980d('0x30')]({'where':{'id':_0x5f4502['params']['id']}})['then'](handleEntityNotFound(_0x92c9bd,null))['then'](saveUpdates(_0x5f4502[_0x980d('0x33')],null))['then'](respondWithResult(_0x92c9bd,null))['catch'](handleError(_0x92c9bd,null));};exports[_0x980d('0x35')]=function(_0x2a55db,_0x18a12a){return db['ChatProactiveAction'][_0x980d('0x30')]({'where':{'id':_0x2a55db[_0x980d('0x25')]['id']}})[_0x980d('0x21')](handleEntityNotFound(_0x18a12a,null))[_0x980d('0x21')](removeEntity(_0x18a12a,null))[_0x980d('0x31')](handleError(_0x18a12a,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 46784ff..fc314d3 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 _0xb82e=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','chat_proactive_actions','lodash'];(function(_0x394a4c,_0x4aacc9){var _0x9f1642=function(_0x3ca4a4){while(--_0x3ca4a4){_0x394a4c['push'](_0x394a4c['shift']());}};_0x9f1642(++_0x4aacc9);}(_0xb82e,0x1ee));var _0xeb82=function(_0x4f2b71,_0x4073fc){_0x4f2b71=_0x4f2b71-0x0;var _0x4b5186=_0xb82e[_0x4f2b71];return _0x4b5186;};'use strict';var _=require(_0xeb82('0x0'));var util=require('util');var logger=require(_0xeb82('0x1'))(_0xeb82('0x2'));var moment=require(_0xeb82('0x3'));var BPromise=require(_0xeb82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb82('0x5'));var rimraf=require(_0xeb82('0x6'));var config=require(_0xeb82('0x7'));var attributes=require(_0xeb82('0x8'));module[_0xeb82('0x9')]=function(_0x2a0c2a,_0x10024b){return _0x2a0c2a['define']('ChatProactiveAction',attributes,{'tableName':_0xeb82('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x27c1=['define','ChatProactiveAction','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5182f9,_0x4acf0c){var _0x4c9fad=function(_0x453b0e){while(--_0x453b0e){_0x5182f9['push'](_0x5182f9['shift']());}};_0x4c9fad(++_0x4acf0c);}(_0x27c1,0x18e));var _0x127c=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x27c1[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require(_0x127c('0x0'));var logger=require(_0x127c('0x1'))(_0x127c('0x2'));var moment=require(_0x127c('0x3'));var BPromise=require('bluebird');var rp=require(_0x127c('0x4'));var fs=require('fs');var path=require(_0x127c('0x5'));var rimraf=require(_0x127c('0x6'));var config=require(_0x127c('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x127c('0x8')]=function(_0x580527,_0x4406da){return _0x580527[_0x127c('0x9')](_0x127c('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 4b2076a..45da29e 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 _0x9860=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','jayson/promise','client','http','request','then'];(function(_0x31478e,_0x73729d){var _0x5053ce=function(_0x2d3b12){while(--_0x2d3b12){_0x31478e['push'](_0x31478e['shift']());}};_0x5053ce(++_0x73729d);}(_0x9860,0x1d6));var _0x0986=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9860[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0986('0x0'));var util=require(_0x0986('0x1'));var moment=require(_0x0986('0x2'));var BPromise=require(_0x0986('0x3'));var rs=require(_0x0986('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x0986('0x5'));var client=jayson[_0x0986('0x6')][_0x0986('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x274197,_0x453e97,_0x15ee3d){return new BPromise(function(_0x46d213,_0x356290){return client[_0x0986('0x8')](_0x274197,_0x15ee3d)[_0x0986('0x9')](function(_0x1ff74a){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x453e97,_0x0986('0xa'));logger[_0x0986('0xb')](_0x0986('0xc'),_0x453e97,'request\x20sent',JSON[_0x0986('0xd')](_0x1ff74a));if(_0x1ff74a[_0x0986('0xe')]){if(_0x1ff74a[_0x0986('0xe')][_0x0986('0xf')]===0x1f4){logger[_0x0986('0xe')](_0x0986('0x10'),_0x453e97,_0x1ff74a[_0x0986('0xe')][_0x0986('0x11')]);return _0x356290(_0x1ff74a['error']['message']);}logger[_0x0986('0xe')](_0x0986('0x10'),_0x453e97,_0x1ff74a['error'][_0x0986('0x11')]);return _0x46d213(_0x1ff74a[_0x0986('0xe')][_0x0986('0x11')]);}else{logger[_0x0986('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x453e97,'request\x20sent');_0x46d213(_0x1ff74a[_0x0986('0x13')][_0x0986('0x11')]);}})['catch'](function(_0x437235){logger[_0x0986('0xe')](_0x0986('0x10'),_0x453e97,_0x437235);_0x356290(_0x437235);});});} \ No newline at end of file +var _0xe104=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x493ae4,_0x391339){var _0x31c974=function(_0x292543){while(--_0x292543){_0x493ae4['push'](_0x493ae4['shift']());}};_0x31c974(++_0x391339);}(_0xe104,0x126));var _0x4e10=function(_0x457550,_0x16b53a){_0x457550=_0x457550-0x0;var _0xdc685b=_0xe104[_0x457550];return _0xdc685b;};'use strict';var _=require(_0x4e10('0x0'));var util=require('util');var moment=require(_0x4e10('0x1'));var BPromise=require(_0x4e10('0x2'));var rs=require(_0x4e10('0x3'));var fs=require('fs');var Redis=require(_0x4e10('0x4'));var db=require(_0x4e10('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e10('0x6'))(_0x4e10('0x7'));var config=require(_0x4e10('0x8'));var jayson=require(_0x4e10('0x9'));var client=jayson[_0x4e10('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fc008,_0x34bcaf,_0x329335){return new BPromise(function(_0x4c39cd,_0x2f7cd7){return client[_0x4e10('0xb')](_0x3fc008,_0x329335)[_0x4e10('0xc')](function(_0x3aa761){logger[_0x4e10('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x34bcaf,_0x4e10('0xe'));logger[_0x4e10('0xf')](_0x4e10('0x10'),_0x34bcaf,_0x4e10('0xe'),JSON['stringify'](_0x3aa761));if(_0x3aa761['error']){if(_0x3aa761[_0x4e10('0x11')][_0x4e10('0x12')]===0x1f4){logger[_0x4e10('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x34bcaf,_0x3aa761[_0x4e10('0x11')][_0x4e10('0x13')]);return _0x2f7cd7(_0x3aa761[_0x4e10('0x11')][_0x4e10('0x13')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x34bcaf,_0x3aa761[_0x4e10('0x11')]['message']);return _0x4c39cd(_0x3aa761[_0x4e10('0x11')][_0x4e10('0x13')]);}else{logger[_0x4e10('0xd')](_0x4e10('0x14'),_0x34bcaf,_0x4e10('0xe'));_0x4c39cd(_0x3aa761[_0x4e10('0x15')][_0x4e10('0x13')]);}})[_0x4e10('0x16')](function(_0x20d0c3){logger[_0x4e10('0x11')](_0x4e10('0x14'),_0x34bcaf,_0x20d0c3);_0x2f7cd7(_0x20d0c3);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 36066d8..1fa25fb 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 _0x814b=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x1c08f6,_0x14c077){var _0xbc156a=function(_0x59df22){while(--_0x59df22){_0x1c08f6['push'](_0x1c08f6['shift']());}};_0xbc156a(++_0x14c077);}(_0x814b,0x1a2));var _0xb814=function(_0x55a76a,_0x2d0203){_0x55a76a=_0x55a76a-0x0;var _0x45885a=_0x814b[_0x55a76a];return _0x45885a;};'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')](_0xb814('0xb'),auth['isAuthenticated'](),controller[_0xb814('0xc')]);router[_0xb814('0xd')]('/',auth['isAuthenticated'](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xb'),auth[_0xb814('0x10')](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file +var _0xbd51=['show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','./chatProactiveAction.controller','get','/:id'];(function(_0x5186eb,_0x3b5d12){var _0x2abd4c=function(_0x403773){while(--_0x403773){_0x5186eb['push'](_0x5186eb['shift']());}};_0x2abd4c(++_0x3b5d12);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3ebbaa,_0x35e5b3){_0x3ebbaa=_0x3ebbaa-0x0;var _0x2412f2=_0xbd51[_0x3ebbaa];return _0x2412f2;};'use strict';var multer=require(_0x1bd5('0x0'));var util=require('util');var path=require(_0x1bd5('0x1'));var timeout=require(_0x1bd5('0x2'));var express=require(_0x1bd5('0x3'));var router=express[_0x1bd5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1bd5('0x5'));router[_0x1bd5('0x6')](_0x1bd5('0x7'),auth['isAuthenticated'](),controller[_0x1bd5('0x8')]);router[_0x1bd5('0x9')]('/',auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xb')]);router[_0x1bd5('0xc')]('/:id',auth[_0x1bd5('0xa')](),controller['update']);router[_0x1bd5('0xd')](_0x1bd5('0x7'),auth[_0x1bd5('0xa')](),controller[_0x1bd5('0xe')]);module[_0x1bd5('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 18f005c..d61246a 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 _0x929c=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x929c,0x167));var _0xc929=function(_0x584fc0,_0x52c793){_0x584fc0=_0x584fc0-0x0;var _0xf5212e=_0x929c[_0x584fc0];return _0xf5212e;};'use strict';var Sequelize=require(_0xc929('0x0'));module['exports']={'name':{'type':Sequelize[_0xc929('0x1')],'unique':_0xc929('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc929('0x1')]},'timeout':{'type':Sequelize[_0xc929('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc929('0x4')](_0xc929('0x5'),_0xc929('0x6'),_0xc929('0x7'))}}; \ No newline at end of file +var _0xbc49=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x4a4254,_0x515bf0){var _0x57751e=function(_0x3e2d92){while(--_0x3e2d92){_0x4a4254['push'](_0x4a4254['shift']());}};_0x57751e(++_0x515bf0);}(_0xbc49,0x1e1));var _0x9bc4=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0xbc49[_0x5b13c3];return _0x3d6780;};'use strict';var Sequelize=require(_0x9bc4('0x0'));module[_0x9bc4('0x1')]={'name':{'type':Sequelize[_0x9bc4('0x2')],'unique':_0x9bc4('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9bc4('0x2')]},'timeout':{'type':Sequelize[_0x9bc4('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9bc4('0x5')](_0x9bc4('0x6'),_0x9bc4('0x7'),_0x9bc4('0x8'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b57758d..f72b381 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 _0x5dd0=['each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','value','transaction','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatQueue.socket','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','includeAll','include','findAll','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','ChatQueueId','filter','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5dd0,0xb5));var _0x05dd=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5dd0[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05dd('0x0'));var zipdir=require(_0x05dd('0x1'));var jsonpatch=require(_0x05dd('0x2'));var rp=require(_0x05dd('0x3'));var moment=require(_0x05dd('0x4'));var BPromise=require(_0x05dd('0x5'));var Mustache=require(_0x05dd('0x6'));var util=require(_0x05dd('0x7'));var path=require(_0x05dd('0x8'));var sox=require(_0x05dd('0x9'));var csv=require(_0x05dd('0xa'));var ejs=require(_0x05dd('0xb'));var fs=require('fs');var fs_extra=require(_0x05dd('0xc'));var _=require(_0x05dd('0xd'));var squel=require('squel');var crypto=require(_0x05dd('0xe'));var jsforce=require(_0x05dd('0xf'));var deskjs=require(_0x05dd('0x10'));var toCsv=require(_0x05dd('0xa'));var querystring=require('querystring');var Papa=require(_0x05dd('0x11'));var Redis=require(_0x05dd('0x12'));var authService=require(_0x05dd('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x05dd('0x14'));var hardwareService=require(_0x05dd('0x15'));var logger=require(_0x05dd('0x16'))(_0x05dd('0x17'));var utils=require(_0x05dd('0x18'));var config=require(_0x05dd('0x19'));var licenseUtil=require(_0x05dd('0x1a'));var db=require('../../mysqldb')['db'];config[_0x05dd('0x1b')]=_[_0x05dd('0x1c')](config[_0x05dd('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x05dd('0x1d'))(new Redis(config['redis']));require(_0x05dd('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x05dd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x72717e,_0x52deb2,_0x42957b,_0x39d89f){return new BPromise(function(_0x5f2207,_0x1e3285){var _0x5e97a3=_0x39d89f||client;return _0x5e97a3[_0x05dd('0x20')](_0x72717e,_0x42957b)[_0x05dd('0x21')](function(_0x28747c){logger['info'](_0x05dd('0x22'),_0x52deb2,_0x05dd('0x23'));logger[_0x05dd('0x24')](_0x05dd('0x25'),_0x52deb2,_0x05dd('0x23'),JSON[_0x05dd('0x26')](_0x28747c));if(_0x28747c[_0x05dd('0x27')]){if(_0x28747c[_0x05dd('0x27')][_0x05dd('0x28')]===0x1f4){logger[_0x05dd('0x27')](_0x05dd('0x22'),_0x52deb2,_0x28747c[_0x05dd('0x27')]['message']);return _0x1e3285(_0x28747c[_0x05dd('0x27')]['message']);}logger['error'](_0x05dd('0x22'),_0x52deb2,_0x28747c[_0x05dd('0x27')]['message']);return _0x5f2207(_0x28747c[_0x05dd('0x27')][_0x05dd('0x29')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x52deb2,_0x05dd('0x23'));_0x5f2207(_0x28747c['result'][_0x05dd('0x29')]);}})[_0x05dd('0x2a')](function(_0x20cccb){logger[_0x05dd('0x27')](_0x05dd('0x22'),_0x52deb2,_0x20cccb);_0x1e3285(_0x20cccb);});});}function respondWithStatusCode(_0x3721a2,_0x33fbe4){_0x33fbe4=_0x33fbe4||0xcc;return function(_0x445b47){if(_0x445b47){return _0x3721a2['sendStatus'](_0x33fbe4);}return _0x3721a2[_0x05dd('0x2b')](_0x33fbe4)[_0x05dd('0x2c')]();};}function respondWithResult(_0x3a37e6,_0x335ed8){_0x335ed8=_0x335ed8||0xc8;return function(_0x1ad3ab){if(_0x1ad3ab){return _0x3a37e6[_0x05dd('0x2b')](_0x335ed8)[_0x05dd('0x2d')](_0x1ad3ab);}};}function respondWithFilteredResult(_0x2f34c5,_0x170333){return function(_0x24222b){if(_0x24222b){var _0x581e57=typeof _0x170333[_0x05dd('0x2e')]===_0x05dd('0x2f')&&typeof _0x170333[_0x05dd('0x30')]===_0x05dd('0x2f');var _0x375621=_0x24222b[_0x05dd('0x31')];var _0x233037=_0x581e57?0x0:_0x170333[_0x05dd('0x2e')];var _0x16cff5=_0x581e57?_0x24222b[_0x05dd('0x31')]:_0x170333[_0x05dd('0x2e')]+_0x170333[_0x05dd('0x30')];var _0x25ae20;if(_0x16cff5>=_0x375621){_0x16cff5=_0x375621;_0x25ae20=0xc8;}else{_0x25ae20=0xce;}_0x2f34c5[_0x05dd('0x2b')](_0x25ae20);return _0x2f34c5['set'](_0x05dd('0x32'),_0x233037+'-'+_0x16cff5+'/'+_0x375621)[_0x05dd('0x2d')](_0x24222b);}return null;};}function patchUpdates(_0x5b9a6d){return function(_0xf5a04f){try{jsonpatch[_0x05dd('0x33')](_0xf5a04f,_0x5b9a6d,!![]);}catch(_0x56b495){return BPromise[_0x05dd('0x34')](_0x56b495);}return _0xf5a04f['save']();};}function saveUpdates(_0x87a7b0,_0x18a6e5){return function(_0x5244a6){if(_0x5244a6){return _0x5244a6[_0x05dd('0x35')](_0x87a7b0)[_0x05dd('0x21')](function(_0xa706e1){return _0xa706e1;});}return null;};}function removeEntity(_0x39ef7c,_0x1442e0){return function(_0x1512e2){if(_0x1512e2){return _0x1512e2[_0x05dd('0x36')]()['then'](function(){var _0x248a95=_0x1512e2[_0x05dd('0x37')]({'plain':!![]});var _0x3f6a8f=_0x05dd('0x38');return db[_0x05dd('0x39')][_0x05dd('0x36')]({'where':{'type':_0x3f6a8f,'resourceId':_0x248a95['id']}})[_0x05dd('0x21')](function(){return _0x1512e2;});})[_0x05dd('0x21')](function(){_0x39ef7c[_0x05dd('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186c85,_0xf7b07b){return function(_0x438244){if(!_0x438244){_0x186c85['sendStatus'](0x194);}return _0x438244;};}function handleError(_0x34b8ac,_0x277c0a){_0x277c0a=_0x277c0a||0x1f4;return function(_0x4ea5c4){logger[_0x05dd('0x27')](_0x4ea5c4[_0x05dd('0x3a')]);if(_0x4ea5c4[_0x05dd('0x3b')]){delete _0x4ea5c4[_0x05dd('0x3b')];}_0x34b8ac[_0x05dd('0x2b')](_0x277c0a)[_0x05dd('0x3c')](_0x4ea5c4);};}exports[_0x05dd('0x3d')]=function(_0x42751e,_0x3f2e5d){var _0x467ccc={},_0x44ecf0={},_0x5eb95c={'count':0x0,'rows':[]};var _0x5ddf6e=_['map'](db[_0x05dd('0x3e')][_0x05dd('0x3f')],function(_0x1ae21f){return{'name':_0x1ae21f[_0x05dd('0x40')],'type':_0x1ae21f['type'][_0x05dd('0x41')]};});_0x44ecf0['model']=_[_0x05dd('0x42')](_0x5ddf6e,'name');_0x44ecf0[_0x05dd('0x43')]=_[_0x05dd('0x44')](_0x42751e[_0x05dd('0x43')]);_0x44ecf0[_0x05dd('0x45')]=_[_0x05dd('0x46')](_0x44ecf0[_0x05dd('0x47')],_0x44ecf0[_0x05dd('0x43')]);_0x467ccc['attributes']=_[_0x05dd('0x46')](_0x44ecf0['model'],qs['fields'](_0x42751e[_0x05dd('0x43')][_0x05dd('0x48')]));_0x467ccc[_0x05dd('0x49')]=_0x467ccc[_0x05dd('0x49')][_0x05dd('0x4a')]?_0x467ccc[_0x05dd('0x49')]:_0x44ecf0[_0x05dd('0x47')];if(!_0x42751e[_0x05dd('0x43')][_0x05dd('0x4b')](_0x05dd('0x4c'))){_0x467ccc[_0x05dd('0x30')]=qs[_0x05dd('0x30')](_0x42751e[_0x05dd('0x43')][_0x05dd('0x30')]);_0x467ccc[_0x05dd('0x2e')]=qs['offset'](_0x42751e[_0x05dd('0x43')][_0x05dd('0x2e')]);}_0x467ccc[_0x05dd('0x4d')]=qs[_0x05dd('0x4e')](_0x42751e[_0x05dd('0x43')][_0x05dd('0x4e')]);_0x467ccc['where']=qs[_0x05dd('0x45')](_[_0x05dd('0x4f')](_0x42751e[_0x05dd('0x43')],_0x44ecf0[_0x05dd('0x45')]),_0x5ddf6e);if(_0x42751e[_0x05dd('0x43')]['filter']){_0x467ccc[_0x05dd('0x50')]=_['merge'](_0x467ccc[_0x05dd('0x50')],{'$or':_['map'](_0x5ddf6e,function(_0x493bc9){if(_0x493bc9['type']!==_0x05dd('0x51')){var _0x1572f7={};_0x1572f7[_0x493bc9[_0x05dd('0x3b')]]={'$like':'%'+_0x42751e[_0x05dd('0x43')]['filter']+'%'};return _0x1572f7;}})});}_0x467ccc=_[_0x05dd('0x52')]({},_0x467ccc,_0x42751e['options']);var _0x5c0340={'where':_0x467ccc['where']};return db[_0x05dd('0x3e')][_0x05dd('0x31')](_0x5c0340)[_0x05dd('0x21')](function(_0xc058a6){_0x5eb95c[_0x05dd('0x31')]=_0xc058a6;if(_0x42751e[_0x05dd('0x43')][_0x05dd('0x53')]){_0x467ccc[_0x05dd('0x54')]=[{'all':!![]}];}return db[_0x05dd('0x3e')][_0x05dd('0x55')](_0x467ccc);})[_0x05dd('0x21')](function(_0x227e0c){_0x5eb95c['rows']=_0x227e0c;return _0x5eb95c;})[_0x05dd('0x21')](respondWithFilteredResult(_0x3f2e5d,_0x467ccc))['catch'](handleError(_0x3f2e5d,null));};exports[_0x05dd('0x56')]=function(_0x58b941,_0xdd8c10){var _0x4ff5a7={'raw':!![],'where':{'id':_0x58b941[_0x05dd('0x57')]['id']}},_0x469d6a={};_0x469d6a[_0x05dd('0x47')]=_[_0x05dd('0x44')](db[_0x05dd('0x3e')][_0x05dd('0x3f')]);_0x469d6a[_0x05dd('0x43')]=_['keys'](_0x58b941[_0x05dd('0x43')]);_0x469d6a[_0x05dd('0x45')]=_[_0x05dd('0x46')](_0x469d6a[_0x05dd('0x47')],_0x469d6a['query']);_0x4ff5a7['attributes']=_[_0x05dd('0x46')](_0x469d6a[_0x05dd('0x47')],qs[_0x05dd('0x48')](_0x58b941[_0x05dd('0x43')][_0x05dd('0x48')]));_0x4ff5a7['attributes']=_0x4ff5a7[_0x05dd('0x49')][_0x05dd('0x4a')]?_0x4ff5a7[_0x05dd('0x49')]:_0x469d6a['model'];if(_0x58b941[_0x05dd('0x43')][_0x05dd('0x53')]){_0x4ff5a7['include']=[{'all':!![]}];}_0x4ff5a7=_[_0x05dd('0x52')]({},_0x4ff5a7,_0x58b941[_0x05dd('0x58')]);return db[_0x05dd('0x3e')][_0x05dd('0x59')](_0x4ff5a7)[_0x05dd('0x21')](handleEntityNotFound(_0xdd8c10,null))['then'](respondWithResult(_0xdd8c10,null))[_0x05dd('0x2a')](handleError(_0xdd8c10,null));};exports[_0x05dd('0x5a')]=function(_0xd0da38,_0x1fb86a){return db[_0x05dd('0x3e')]['create'](_0xd0da38[_0x05dd('0x5b')],{})['then'](function(_0x211c87){var _0x1fb129=_0xd0da38[_0x05dd('0x5c')]['get']({'plain':!![]});if(!_0x1fb129)throw new Error(_0x05dd('0x5d'));if(_0x1fb129[_0x05dd('0x5e')]===_0x05dd('0x5c')){var _0x51549a=_0x211c87['get']({'plain':!![]});var _0x2a03c1=_0x05dd('0x38');return db['UserProfileSection'][_0x05dd('0x59')]({'where':{'name':_0x2a03c1,'userProfileId':_0x1fb129[_0x05dd('0x5f')]},'raw':!![]})[_0x05dd('0x21')](function(_0x2d681b){if(_0x2d681b&&_0x2d681b[_0x05dd('0x60')]===0x0){return db['UserProfileResource'][_0x05dd('0x5a')]({'name':_0x51549a[_0x05dd('0x3b')],'resourceId':_0x51549a['id'],'type':_0x2d681b['name'],'sectionId':_0x2d681b['id']},{})['then'](function(){return _0x211c87;});}else{return _0x211c87;}})[_0x05dd('0x2a')](function(_0x377cef){logger[_0x05dd('0x27')](_0x05dd('0x61'),_0x377cef);throw _0x377cef;});}return _0x211c87;})[_0x05dd('0x21')](respondWithResult(_0x1fb86a,0xc9))[_0x05dd('0x2a')](handleError(_0x1fb86a,null));};exports[_0x05dd('0x35')]=function(_0x1530fa,_0x36573d){if(_0x1530fa[_0x05dd('0x5b')]['id']){delete _0x1530fa['body']['id'];}return db[_0x05dd('0x3e')][_0x05dd('0x59')]({'where':{'id':_0x1530fa[_0x05dd('0x57')]['id']}})['then'](handleEntityNotFound(_0x36573d,null))[_0x05dd('0x21')](saveUpdates(_0x1530fa[_0x05dd('0x5b')],null))[_0x05dd('0x21')](respondWithResult(_0x36573d,null))[_0x05dd('0x2a')](handleError(_0x36573d,null));};exports[_0x05dd('0x36')]=function(_0x40127e,_0x46000c){return db[_0x05dd('0x3e')][_0x05dd('0x59')]({'where':{'id':_0x40127e[_0x05dd('0x57')]['id']}})[_0x05dd('0x21')](handleEntityNotFound(_0x46000c,null))[_0x05dd('0x21')](removeEntity(_0x46000c,null))[_0x05dd('0x2a')](handleError(_0x46000c,null));};exports[_0x05dd('0x62')]=function(_0x123f6a,_0x51833e){return db['ChatQueue'][_0x05dd('0x62')]()['then'](respondWithResult(_0x51833e,null))[_0x05dd('0x2a')](handleError(_0x51833e,null));};exports['getMembers']=function(_0x14fbf4,_0x51c3f4,_0x4937a8){var _0x49554d={'raw':!![],'where':{}},_0x5e9c3a={},_0x565680;return db['ChatQueue'][_0x05dd('0x63')]({'where':{'id':_0x14fbf4[_0x05dd('0x57')]['id']}})['then'](handleEntityNotFound(_0x51c3f4,null))[_0x05dd('0x21')](function(_0x373e8e){if(_0x373e8e){_0x565680=_0x373e8e['get']({'plain':!![]});_0x5e9c3a[_0x05dd('0x47')]=_[_0x05dd('0x44')](db['UserChatQueue'][_0x05dd('0x3f')]);_0x5e9c3a[_0x05dd('0x43')]=_['keys'](_0x14fbf4[_0x05dd('0x43')]);_0x5e9c3a[_0x05dd('0x45')]=_[_0x05dd('0x46')](_0x5e9c3a[_0x05dd('0x47')],_0x5e9c3a['query']);_0x49554d[_0x05dd('0x49')]=_[_0x05dd('0x46')](_0x5e9c3a['model'],qs[_0x05dd('0x48')](_0x14fbf4[_0x05dd('0x43')]['fields']));_0x49554d[_0x05dd('0x49')]=_0x49554d['attributes'][_0x05dd('0x4a')]?_0x49554d[_0x05dd('0x49')]:_0x5e9c3a[_0x05dd('0x47')];if(!_0x14fbf4[_0x05dd('0x43')][_0x05dd('0x4b')]('nolimit')){_0x49554d['limit']=qs[_0x05dd('0x30')](_0x14fbf4[_0x05dd('0x43')]['limit']);_0x49554d[_0x05dd('0x2e')]=qs[_0x05dd('0x2e')](_0x14fbf4['query'][_0x05dd('0x2e')]);}_0x49554d[_0x05dd('0x4d')]=qs[_0x05dd('0x4e')](_0x14fbf4['query'][_0x05dd('0x4e')]);_0x49554d['where']=qs[_0x05dd('0x45')](_[_0x05dd('0x4f')](_0x14fbf4[_0x05dd('0x43')],_0x5e9c3a[_0x05dd('0x45')]));_0x49554d[_0x05dd('0x50')][_0x05dd('0x64')]=_0x373e8e['id'];if(_0x14fbf4['query'][_0x05dd('0x65')]){_0x49554d['where']=_[_0x05dd('0x52')](_0x49554d[_0x05dd('0x50')],{'$or':_[_0x05dd('0x42')](_0x49554d['attributes'],function(_0x2a3493){var _0x4a3467={};_0x4a3467[_0x2a3493]={'$like':'%'+_0x14fbf4['query']['filter']+'%'};return _0x4a3467;})});}_0x49554d=_['merge']({},_0x49554d,_0x14fbf4['options']);return db['UserChatQueue']['findAll'](_0x49554d);}})[_0x05dd('0x21')](function(_0x3d1b34){if(_0x3d1b34){return db[_0x05dd('0x66')][_0x05dd('0x67')]({'where':{'id':_[_0x05dd('0x42')](_0x3d1b34,_0x05dd('0x68')),'role':_0x05dd('0x69')},'attributes':['id',_0x05dd('0x3b'),_0x05dd('0x6a'),_0x05dd('0x6b'),_0x05dd('0x6c')]});}})[_0x05dd('0x21')](function(_0x57a20d){if(_0x57a20d){return{'count':_0x57a20d[_0x05dd('0x31')],'rows':_[_0x05dd('0x42')](_0x57a20d[_0x05dd('0x6d')],function(_0x1b8c97){return{'membername':_0x1b8c97[_0x05dd('0x3b')],'UserId':_0x1b8c97['id'],'queue_name':_0x565680[_0x05dd('0x3b')],'ChatQueueId':_0x565680['id'],'interface':util['format'](_0x05dd('0x6e'),_0x05dd('0x6f'),_0x1b8c97[_0x05dd('0x3b')]),'penalty':0x0,'paused':_0x1b8c97[_0x05dd('0x6a')],'createdAt':_0x1b8c97[_0x05dd('0x6c')],'updatedAt':_0x1b8c97['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x05dd('0x21')](respondWithFilteredResult(_0x51c3f4,_0x49554d))['catch'](handleError(_0x51c3f4,null));};exports['getTeams']=function(_0x291891,_0x532a73,_0x2e2535){var _0x4750db={};var _0x46a014={};var _0x1e0a40;var _0x11e35d;return db[_0x05dd('0x3e')][_0x05dd('0x63')]({'where':{'id':_0x291891[_0x05dd('0x57')]['id']}})[_0x05dd('0x21')](handleEntityNotFound(_0x532a73,null))[_0x05dd('0x21')](function(_0x53d76a){if(_0x53d76a){_0x1e0a40=_0x53d76a;_0x46a014['model']=_['keys'](db[_0x05dd('0x70')][_0x05dd('0x3f')]);_0x46a014[_0x05dd('0x43')]=_[_0x05dd('0x44')](_0x291891[_0x05dd('0x43')]);_0x46a014[_0x05dd('0x45')]=_[_0x05dd('0x46')](_0x46a014['model'],_0x46a014[_0x05dd('0x43')]);_0x4750db[_0x05dd('0x49')]=_[_0x05dd('0x46')](_0x46a014[_0x05dd('0x47')],qs[_0x05dd('0x48')](_0x291891[_0x05dd('0x43')][_0x05dd('0x48')]));_0x4750db[_0x05dd('0x49')]=_0x4750db[_0x05dd('0x49')]['length']?_0x4750db[_0x05dd('0x49')]:_0x46a014[_0x05dd('0x47')];_0x4750db['order']=qs[_0x05dd('0x4e')](_0x291891[_0x05dd('0x43')][_0x05dd('0x4e')]);_0x4750db['where']=qs[_0x05dd('0x45')](_[_0x05dd('0x4f')](_0x291891[_0x05dd('0x43')],_0x46a014[_0x05dd('0x45')]));if(_0x291891['query'][_0x05dd('0x65')]){_0x4750db[_0x05dd('0x50')]=_[_0x05dd('0x52')](_0x4750db[_0x05dd('0x50')],{'$or':_[_0x05dd('0x42')](_0x4750db[_0x05dd('0x49')],function(_0x5f2825){var _0x5a3977={};_0x5a3977[_0x5f2825]={'$like':'%'+_0x291891[_0x05dd('0x43')]['filter']+'%'};return _0x5a3977;})});}_0x4750db=_['merge']({},_0x4750db,_0x291891[_0x05dd('0x58')]);return _0x1e0a40['getTeams'](_0x4750db);}})[_0x05dd('0x21')](function(_0xed17b7){if(_0xed17b7){_0x11e35d=_0xed17b7[_0x05dd('0x4a')];if(!_0x291891[_0x05dd('0x43')][_0x05dd('0x4b')](_0x05dd('0x4c'))){_0x4750db[_0x05dd('0x30')]=qs[_0x05dd('0x30')](_0x291891['query'][_0x05dd('0x30')]);_0x4750db['offset']=qs[_0x05dd('0x2e')](_0x291891[_0x05dd('0x43')][_0x05dd('0x2e')]);}return _0x1e0a40[_0x05dd('0x71')](_0x4750db);}})[_0x05dd('0x21')](function(_0x4203b9){if(_0x4203b9){return _0x4203b9?{'count':_0x11e35d,'rows':_0x4203b9}:null;}})[_0x05dd('0x21')](respondWithResult(_0x532a73,null))[_0x05dd('0x2a')](handleError(_0x532a73,null));};exports[_0x05dd('0x72')]=function(_0xadd88c,_0x5b8b93,_0x27789a){var _0x24ce7f=_0xadd88c[_0x05dd('0x5b')][_0x05dd('0x73')];return db[_0x05dd('0x70')][_0x05dd('0x55')]({'where':{'id':_0x24ce7f},'attributes':['id'],'include':[{'model':db['User'],'as':_0x05dd('0x74'),'attributes':['id',_0x05dd('0x3b'),_0x05dd('0x75'),'voicePause',_0x05dd('0x76')],'raw':!![]}]})[_0x05dd('0x21')](function(_0xfceeaa){if(_0xfceeaa){var _0xfa4866=_[_0x05dd('0x77')](_0xfceeaa,function(_0x94dace){var _0x5a5b45=_0x94dace[_0x05dd('0x37')]({'plain':!![]});return _0x5a5b45['Agents'];});return db['ChatQueue'][_0x05dd('0x59')]({'where':{'id':_0xadd88c[_0x05dd('0x57')]['id']}})[_0x05dd('0x21')](function(_0x4d088b){return db[_0x05dd('0x78')]['transaction'](function(_0x45188d){return _0x4d088b[_0x05dd('0x72')](_0x24ce7f,{'transaction':_0x45188d})[_0x05dd('0x21')](function(){return BPromise[_0x05dd('0x79')](_0xfa4866,function(_0xecc76f){return db[_0x05dd('0x7a')][_0x05dd('0x7b')]({'where':{'UserId':_0xecc76f['id'],'ChatQueueId':_0xadd88c[_0x05dd('0x57')]['id']},'transaction':_0x45188d});});})['then'](function(){_0xfa4866[_0x05dd('0x7c')](function(_0x528b9e){socket[_0x05dd('0x7d')](_0x05dd('0x7e'),{'UserId':_0x528b9e['id'],'ChatQueueId':_0x4d088b['id']});});});});});}})[_0x05dd('0x21')](respondWithStatusCode(_0x5b8b93,null))['catch'](handleError(_0x5b8b93,null));};exports[_0x05dd('0x7f')]=function(_0x4215bc,_0x76979b,_0x25c508){return db[_0x05dd('0x70')][_0x05dd('0x55')]({'where':{'id':_0x4215bc[_0x05dd('0x43')][_0x05dd('0x73')]},'attributes':['id'],'include':[{'model':db[_0x05dd('0x66')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x05dd('0x21')](handleEntityNotFound(_0x76979b,null))['then'](function(_0x59f4cd){var _0x2c4a96=_['map'](_0x59f4cd,'id');var _0xb7b187=[];var _0x1de9c5=[];var _0x3cdde6=squel[_0x05dd('0x80')]();_0x3cdde6[_0x05dd('0x81')]('tq.TeamId')[_0x05dd('0x82')](_0x05dd('0x83'),'tq')[_0x05dd('0x84')]('user_has_teams','ut',_0x05dd('0x85'))[_0x05dd('0x50')]('ChatQueueId\x20=\x20?',_0x4215bc[_0x05dd('0x57')]['id']);for(var _0x44192b=0x0;_0x44192b<_0x59f4cd[_0x05dd('0x4a')];_0x44192b+=0x1){let _0x3b73cf=_0x59f4cd[_0x44192b];for(var _0x28f004=0x0;_0x28f004<_0x3b73cf[_0x05dd('0x74')][_0x05dd('0x4a')];_0x28f004+=0x1){let _0xa163e=_0x3b73cf['Agents'][_0x28f004];var _0x42502d=_0x3cdde6[_0x05dd('0x86')]();_0x42502d['where'](_0x05dd('0x87'),_0xa163e['id']);_0x1de9c5[_0x05dd('0x88')](db[_0x05dd('0x78')][_0x05dd('0x43')](_0x42502d[_0x05dd('0x89')](),{'type':db['sequelize'][_0x05dd('0x8a')]['SELECT']})[_0x05dd('0x21')](function(_0x57d63a){if(_0x57d63a[_0x05dd('0x4a')]===0x1){return _0xa163e['id'];}else{var _0x24b4e3=_[_0x05dd('0x8b')](_[_0x05dd('0x42')](_0x57d63a,_0x05dd('0x8c')),function(_0x2e98ae){return _[_0x05dd('0x8d')](_0x2c4a96,_0x2e98ae);});if(_0x24b4e3){return _0xa163e['id'];}}}));}}return BPromise['all'](_0x1de9c5)[_0x05dd('0x21')](function(_0x47e18b){_0xb7b187=_(_0xb7b187)['union'](_0x47e18b)['compact']()[_0x05dd('0x8e')]();return db[_0x05dd('0x3e')][_0x05dd('0x59')]({'where':{'id':_0x4215bc[_0x05dd('0x57')]['id']}})['then'](function(_0x24c747){return db[_0x05dd('0x78')][_0x05dd('0x8f')](function(_0x4eee0f){return _0x24c747[_0x05dd('0x7f')](_0x4215bc[_0x05dd('0x43')][_0x05dd('0x73')],{'transaction':_0x4eee0f})[_0x05dd('0x21')](function(){if(!_[_0x05dd('0x90')](_0xb7b187)){return _0x24c747[_0x05dd('0x91')](_0xb7b187,{'transaction':_0x4eee0f});}})[_0x05dd('0x21')](function(){_0xb7b187['forEach'](function(_0x1badf3){socket[_0x05dd('0x7d')](_0x05dd('0x92'),{'UserId':_0x1badf3,'ChatQueueId':_0x24c747['id']});});});});});});})['then'](respondWithStatusCode(_0x76979b,null))['catch'](handleError(_0x76979b,null));};exports[_0x05dd('0x93')]=function(_0x348a37,_0x3a107b,_0x11187a){return db[_0x05dd('0x3e')][_0x05dd('0x59')]({'where':{'id':_0x348a37[_0x05dd('0x57')]['id']}})['then'](handleEntityNotFound(_0x3a107b,null))['then'](function(_0x7ff6a2){if(_0x7ff6a2){return _0x7ff6a2['addAgents'](_0x348a37[_0x05dd('0x5b')][_0x05dd('0x73')],_[_0x05dd('0x94')](_0x348a37['body'],[_0x05dd('0x73'),'id'])||{})['spread'](function(_0x11e5b8){for(var _0x1c1feb=0x0;_0x1c1feb<_0x348a37['body'][_0x05dd('0x73')][_0x05dd('0x4a')];_0x1c1feb+=0x1){socket[_0x05dd('0x7d')]('userChatQueue:save',{'UserId':Number(_0x348a37['body'][_0x05dd('0x73')][_0x1c1feb]),'ChatQueueId':Number(_0x348a37[_0x05dd('0x57')]['id'])});}return _0x11e5b8;});}})[_0x05dd('0x21')](respondWithResult(_0x3a107b,null))[_0x05dd('0x2a')](handleError(_0x3a107b,null));};exports[_0x05dd('0x91')]=function(_0x423324,_0x1d324f,_0x584e88){return db[_0x05dd('0x3e')][_0x05dd('0x59')]({'where':{'id':_0x423324[_0x05dd('0x57')]['id']}})[_0x05dd('0x21')](handleEntityNotFound(_0x1d324f,null))[_0x05dd('0x21')](function(_0xae5f5d){if(_0xae5f5d){return _0xae5f5d[_0x05dd('0x91')](_0x423324['query'][_0x05dd('0x73')])[_0x05dd('0x21')](function(){if(_[_0x05dd('0x95')](_0x423324[_0x05dd('0x43')][_0x05dd('0x73')])){for(var _0xd27cfa=0x0;_0xd27cfa<_0x423324[_0x05dd('0x43')][_0x05dd('0x73')][_0x05dd('0x4a')];_0xd27cfa+=0x1){socket[_0x05dd('0x7d')](_0x05dd('0x92'),{'UserId':Number(_0x423324[_0x05dd('0x43')][_0x05dd('0x73')][_0xd27cfa]),'ChatQueueId':Number(_0x423324[_0x05dd('0x57')]['id'])});}}else{socket[_0x05dd('0x7d')](_0x05dd('0x92'),{'UserId':Number(_0x423324['query'][_0x05dd('0x73')]),'ChatQueueId':Number(_0x423324[_0x05dd('0x57')]['id'])});}});}})[_0x05dd('0x21')](respondWithStatusCode(_0x1d324f,null))[_0x05dd('0x2a')](handleError(_0x1d324f,null));};exports[_0x05dd('0x96')]=function(_0x1d9991,_0x156b29,_0x35d9ea){var _0x3c1cf0={};var _0x46172a={};var _0x28ec89;var _0x508b30;return db[_0x05dd('0x3e')][_0x05dd('0x63')]({'where':{'id':_0x1d9991['params']['id']}})['then'](handleEntityNotFound(_0x156b29,null))['then'](function(_0x16b9dd){if(_0x16b9dd){_0x28ec89=_0x16b9dd;_0x46172a[_0x05dd('0x47')]=_[_0x05dd('0x44')](db[_0x05dd('0x66')]['rawAttributes']);_0x46172a[_0x05dd('0x43')]=_[_0x05dd('0x44')](_0x1d9991[_0x05dd('0x43')]);_0x46172a[_0x05dd('0x45')]=_[_0x05dd('0x46')](_0x46172a['model'],_0x46172a[_0x05dd('0x43')]);_0x3c1cf0[_0x05dd('0x49')]=_['intersection'](_0x46172a[_0x05dd('0x47')],qs[_0x05dd('0x48')](_0x1d9991[_0x05dd('0x43')][_0x05dd('0x48')]));_0x3c1cf0[_0x05dd('0x49')]=_0x3c1cf0['attributes'][_0x05dd('0x4a')]?_0x3c1cf0[_0x05dd('0x49')]:_0x46172a[_0x05dd('0x47')];_0x3c1cf0[_0x05dd('0x4d')]=qs[_0x05dd('0x4e')](_0x1d9991[_0x05dd('0x43')][_0x05dd('0x4e')]);_0x3c1cf0[_0x05dd('0x50')]=qs[_0x05dd('0x45')](_[_0x05dd('0x4f')](_0x1d9991[_0x05dd('0x43')],_0x46172a[_0x05dd('0x45')]));if(_0x1d9991[_0x05dd('0x43')][_0x05dd('0x65')]){_0x3c1cf0['where']=_['merge'](_0x3c1cf0[_0x05dd('0x50')],{'$or':_[_0x05dd('0x42')](_0x3c1cf0[_0x05dd('0x49')],function(_0x2e26c1){var _0x53eba1={};_0x53eba1[_0x2e26c1]={'$like':'%'+_0x1d9991[_0x05dd('0x43')]['filter']+'%'};return _0x53eba1;})});}_0x3c1cf0=_['merge']({},_0x3c1cf0,_0x1d9991[_0x05dd('0x58')]);return _0x28ec89[_0x05dd('0x96')](_0x3c1cf0);}})[_0x05dd('0x21')](function(_0x378508){if(_0x378508){_0x508b30=_0x378508[_0x05dd('0x4a')];if(!_0x1d9991[_0x05dd('0x43')][_0x05dd('0x4b')](_0x05dd('0x4c'))){_0x3c1cf0[_0x05dd('0x30')]=qs['limit'](_0x1d9991[_0x05dd('0x43')][_0x05dd('0x30')]);_0x3c1cf0['offset']=qs[_0x05dd('0x2e')](_0x1d9991[_0x05dd('0x43')][_0x05dd('0x2e')]);}return _0x28ec89[_0x05dd('0x96')](_0x3c1cf0);}})[_0x05dd('0x21')](function(_0x5154e7){if(_0x5154e7){return _0x5154e7?{'count':_0x508b30,'rows':_0x5154e7}:null;}})[_0x05dd('0x21')](respondWithResult(_0x156b29,null))['catch'](handleError(_0x156b29,null));}; \ No newline at end of file +var _0xdf7a=['spread','userChatQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','client','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','end','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','include','findAll','show','params','keys','length','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','ChatQueueId','merge','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit'];(function(_0x55d91,_0x351fae){var _0x46d0b3=function(_0x60c293){while(--_0x60c293){_0x55d91['push'](_0x55d91['shift']());}};_0x46d0b3(++_0x351fae);}(_0xdf7a,0x1cf));var _0xadf7=function(_0x135188,_0x1afd71){_0x135188=_0x135188-0x0;var _0x371f9e=_0xdf7a[_0x135188];return _0x371f9e;};'use strict';var emlformat=require(_0xadf7('0x0'));var rimraf=require(_0xadf7('0x1'));var zipdir=require(_0xadf7('0x2'));var jsonpatch=require(_0xadf7('0x3'));var rp=require(_0xadf7('0x4'));var moment=require(_0xadf7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xadf7('0x6'));var path=require(_0xadf7('0x7'));var sox=require(_0xadf7('0x8'));var csv=require(_0xadf7('0x9'));var ejs=require(_0xadf7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadf7('0xb'));var squel=require(_0xadf7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadf7('0xd'));var toCsv=require(_0xadf7('0x9'));var querystring=require(_0xadf7('0xe'));var Papa=require(_0xadf7('0xf'));var Redis=require(_0xadf7('0x10'));var authService=require(_0xadf7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xadf7('0x12'));var hardwareService=require(_0xadf7('0x13'));var logger=require(_0xadf7('0x14'))(_0xadf7('0x15'));var utils=require(_0xadf7('0x16'));var config=require(_0xadf7('0x17'));var licenseUtil=require(_0xadf7('0x18'));var db=require(_0xadf7('0x19'))['db'];config['redis']=_[_0xadf7('0x1a')](config[_0xadf7('0x1b')],{'host':_0xadf7('0x1c'),'port':0x18eb});var socket=require(_0xadf7('0x1d'))(new Redis(config[_0xadf7('0x1b')]));require(_0xadf7('0x1e'))[_0xadf7('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xadf7('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x214c96,_0x4b57f3,_0x527fef,_0x439797){return new BPromise(function(_0x232b61,_0x34085f){var _0x23a938=_0x439797||client;return _0x23a938[_0xadf7('0x21')](_0x214c96,_0x527fef)[_0xadf7('0x22')](function(_0x32c992){logger[_0xadf7('0x23')](_0xadf7('0x24'),_0x4b57f3,_0xadf7('0x25'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4b57f3,'request\x20sent',JSON['stringify'](_0x32c992));if(_0x32c992[_0xadf7('0x26')]){if(_0x32c992[_0xadf7('0x26')]['code']===0x1f4){logger[_0xadf7('0x26')](_0xadf7('0x24'),_0x4b57f3,_0x32c992[_0xadf7('0x26')]['message']);return _0x34085f(_0x32c992[_0xadf7('0x26')]['message']);}logger[_0xadf7('0x26')](_0xadf7('0x24'),_0x4b57f3,_0x32c992[_0xadf7('0x26')][_0xadf7('0x27')]);return _0x232b61(_0x32c992['error'][_0xadf7('0x27')]);}else{logger[_0xadf7('0x23')]('ChatQueue,\x20%s,\x20%s',_0x4b57f3,_0xadf7('0x25'));_0x232b61(_0x32c992[_0xadf7('0x28')][_0xadf7('0x27')]);}})[_0xadf7('0x29')](function(_0x2e9778){logger[_0xadf7('0x26')](_0xadf7('0x24'),_0x4b57f3,_0x2e9778);_0x34085f(_0x2e9778);});});}function respondWithStatusCode(_0x1b1ebb,_0x54e4d0){_0x54e4d0=_0x54e4d0||0xcc;return function(_0x54b7fe){if(_0x54b7fe){return _0x1b1ebb[_0xadf7('0x2a')](_0x54e4d0);}return _0x1b1ebb[_0xadf7('0x2b')](_0x54e4d0)['end']();};}function respondWithResult(_0x22c412,_0x19762c){_0x19762c=_0x19762c||0xc8;return function(_0x57eaf7){if(_0x57eaf7){return _0x22c412[_0xadf7('0x2b')](_0x19762c)[_0xadf7('0x2c')](_0x57eaf7);}};}function respondWithFilteredResult(_0x15e1c3,_0x48eea8){return function(_0x573687){if(_0x573687){var _0x5acf41=typeof _0x48eea8[_0xadf7('0x2d')]===_0xadf7('0x2e')&&typeof _0x48eea8[_0xadf7('0x2f')]===_0xadf7('0x2e');var _0x6c1d45=_0x573687['count'];var _0x2268a6=_0x5acf41?0x0:_0x48eea8['offset'];var _0x4ef311=_0x5acf41?_0x573687[_0xadf7('0x30')]:_0x48eea8[_0xadf7('0x2d')]+_0x48eea8[_0xadf7('0x2f')];var _0x516cd7;if(_0x4ef311>=_0x6c1d45){_0x4ef311=_0x6c1d45;_0x516cd7=0xc8;}else{_0x516cd7=0xce;}_0x15e1c3[_0xadf7('0x2b')](_0x516cd7);return _0x15e1c3['set'](_0xadf7('0x31'),_0x2268a6+'-'+_0x4ef311+'/'+_0x6c1d45)['json'](_0x573687);}return null;};}function patchUpdates(_0x5c4dd7){return function(_0x3d8b4b){try{jsonpatch[_0xadf7('0x32')](_0x3d8b4b,_0x5c4dd7,!![]);}catch(_0x3f48eb){return BPromise[_0xadf7('0x33')](_0x3f48eb);}return _0x3d8b4b[_0xadf7('0x34')]();};}function saveUpdates(_0x110169,_0x3a66d9){return function(_0x33ff54){if(_0x33ff54){return _0x33ff54[_0xadf7('0x35')](_0x110169)[_0xadf7('0x22')](function(_0x40284e){return _0x40284e;});}return null;};}function removeEntity(_0x3c29e4,_0x16c569){return function(_0x28fba2){if(_0x28fba2){return _0x28fba2[_0xadf7('0x36')]()[_0xadf7('0x22')](function(){var _0x5172c3=_0x28fba2['get']({'plain':!![]});var _0x4a1821=_0xadf7('0x37');return db[_0xadf7('0x38')]['destroy']({'where':{'type':_0x4a1821,'resourceId':_0x5172c3['id']}})[_0xadf7('0x22')](function(){return _0x28fba2;});})['then'](function(){_0x3c29e4[_0xadf7('0x2b')](0xcc)[_0xadf7('0x39')]();});}};}function handleEntityNotFound(_0xb27110,_0x278c29){return function(_0x2ba4a7){if(!_0x2ba4a7){_0xb27110[_0xadf7('0x2a')](0x194);}return _0x2ba4a7;};}function handleError(_0x5cad8f,_0x2ae86c){_0x2ae86c=_0x2ae86c||0x1f4;return function(_0x2eb460){logger[_0xadf7('0x26')](_0x2eb460[_0xadf7('0x3a')]);if(_0x2eb460[_0xadf7('0x3b')]){delete _0x2eb460['name'];}_0x5cad8f[_0xadf7('0x2b')](_0x2ae86c)[_0xadf7('0x3c')](_0x2eb460);};}exports[_0xadf7('0x3d')]=function(_0x5b4a6c,_0x54b8c4){var _0x95265e={},_0x1551a7={},_0x379425={'count':0x0,'rows':[]};var _0xb7098f=_[_0xadf7('0x3e')](db[_0xadf7('0x3f')][_0xadf7('0x40')],function(_0x3f6d22){return{'name':_0x3f6d22[_0xadf7('0x41')],'type':_0x3f6d22[_0xadf7('0x42')]['key']};});_0x1551a7[_0xadf7('0x43')]=_[_0xadf7('0x3e')](_0xb7098f,'name');_0x1551a7[_0xadf7('0x44')]=_['keys'](_0x5b4a6c[_0xadf7('0x44')]);_0x1551a7['filters']=_[_0xadf7('0x45')](_0x1551a7[_0xadf7('0x43')],_0x1551a7[_0xadf7('0x44')]);_0x95265e[_0xadf7('0x46')]=_[_0xadf7('0x45')](_0x1551a7[_0xadf7('0x43')],qs[_0xadf7('0x47')](_0x5b4a6c[_0xadf7('0x44')][_0xadf7('0x47')]));_0x95265e[_0xadf7('0x46')]=_0x95265e[_0xadf7('0x46')]['length']?_0x95265e['attributes']:_0x1551a7[_0xadf7('0x43')];if(!_0x5b4a6c[_0xadf7('0x44')][_0xadf7('0x48')](_0xadf7('0x49'))){_0x95265e['limit']=qs[_0xadf7('0x2f')](_0x5b4a6c[_0xadf7('0x44')][_0xadf7('0x2f')]);_0x95265e[_0xadf7('0x2d')]=qs[_0xadf7('0x2d')](_0x5b4a6c[_0xadf7('0x44')][_0xadf7('0x2d')]);}_0x95265e[_0xadf7('0x4a')]=qs[_0xadf7('0x4b')](_0x5b4a6c['query'][_0xadf7('0x4b')]);_0x95265e[_0xadf7('0x4c')]=qs[_0xadf7('0x4d')](_[_0xadf7('0x4e')](_0x5b4a6c['query'],_0x1551a7[_0xadf7('0x4d')]),_0xb7098f);if(_0x5b4a6c[_0xadf7('0x44')]['filter']){_0x95265e['where']=_['merge'](_0x95265e['where'],{'$or':_[_0xadf7('0x3e')](_0xb7098f,function(_0x396dc8){if(_0x396dc8[_0xadf7('0x42')]!==_0xadf7('0x4f')){var _0x1f669b={};_0x1f669b[_0x396dc8[_0xadf7('0x3b')]]={'$like':'%'+_0x5b4a6c['query'][_0xadf7('0x50')]+'%'};return _0x1f669b;}})});}_0x95265e=_['merge']({},_0x95265e,_0x5b4a6c[_0xadf7('0x51')]);var _0x14d634={'where':_0x95265e[_0xadf7('0x4c')]};return db[_0xadf7('0x3f')]['count'](_0x14d634)[_0xadf7('0x22')](function(_0x20ae69){_0x379425[_0xadf7('0x30')]=_0x20ae69;if(_0x5b4a6c['query']['includeAll']){_0x95265e[_0xadf7('0x52')]=[{'all':!![]}];}return db[_0xadf7('0x3f')][_0xadf7('0x53')](_0x95265e);})[_0xadf7('0x22')](function(_0x24fb79){_0x379425['rows']=_0x24fb79;return _0x379425;})[_0xadf7('0x22')](respondWithFilteredResult(_0x54b8c4,_0x95265e))[_0xadf7('0x29')](handleError(_0x54b8c4,null));};exports[_0xadf7('0x54')]=function(_0x4f64f5,_0x274305){var _0x3a5dfd={'raw':!![],'where':{'id':_0x4f64f5[_0xadf7('0x55')]['id']}},_0x42e210={};_0x42e210[_0xadf7('0x43')]=_[_0xadf7('0x56')](db[_0xadf7('0x3f')]['rawAttributes']);_0x42e210['query']=_[_0xadf7('0x56')](_0x4f64f5['query']);_0x42e210[_0xadf7('0x4d')]=_[_0xadf7('0x45')](_0x42e210[_0xadf7('0x43')],_0x42e210[_0xadf7('0x44')]);_0x3a5dfd[_0xadf7('0x46')]=_['intersection'](_0x42e210[_0xadf7('0x43')],qs[_0xadf7('0x47')](_0x4f64f5[_0xadf7('0x44')][_0xadf7('0x47')]));_0x3a5dfd[_0xadf7('0x46')]=_0x3a5dfd[_0xadf7('0x46')][_0xadf7('0x57')]?_0x3a5dfd[_0xadf7('0x46')]:_0x42e210[_0xadf7('0x43')];if(_0x4f64f5[_0xadf7('0x44')][_0xadf7('0x58')]){_0x3a5dfd['include']=[{'all':!![]}];}_0x3a5dfd=_['merge']({},_0x3a5dfd,_0x4f64f5['options']);return db[_0xadf7('0x3f')][_0xadf7('0x59')](_0x3a5dfd)[_0xadf7('0x22')](handleEntityNotFound(_0x274305,null))[_0xadf7('0x22')](respondWithResult(_0x274305,null))['catch'](handleError(_0x274305,null));};exports['create']=function(_0x5c5337,_0x4f198d){return db[_0xadf7('0x3f')]['create'](_0x5c5337[_0xadf7('0x5a')],{})[_0xadf7('0x22')](function(_0x38aaf9){var _0x386d50=_0x5c5337[_0xadf7('0x5b')][_0xadf7('0x5c')]({'plain':!![]});if(!_0x386d50)throw new Error(_0xadf7('0x5d'));if(_0x386d50[_0xadf7('0x5e')]==='user'){var _0x318e69=_0x38aaf9[_0xadf7('0x5c')]({'plain':!![]});var _0xc88b56=_0xadf7('0x37');return db[_0xadf7('0x5f')][_0xadf7('0x59')]({'where':{'name':_0xc88b56,'userProfileId':_0x386d50[_0xadf7('0x60')]},'raw':!![]})[_0xadf7('0x22')](function(_0x45f14a){if(_0x45f14a&&_0x45f14a['autoAssociation']===0x0){return db[_0xadf7('0x38')]['create']({'name':_0x318e69[_0xadf7('0x3b')],'resourceId':_0x318e69['id'],'type':_0x45f14a['name'],'sectionId':_0x45f14a['id']},{})[_0xadf7('0x22')](function(){return _0x38aaf9;});}else{return _0x38aaf9;}})[_0xadf7('0x29')](function(_0x5cc498){logger['error'](_0xadf7('0x61'),_0x5cc498);throw _0x5cc498;});}return _0x38aaf9;})[_0xadf7('0x22')](respondWithResult(_0x4f198d,0xc9))[_0xadf7('0x29')](handleError(_0x4f198d,null));};exports[_0xadf7('0x35')]=function(_0x79a2e8,_0x3f417d){if(_0x79a2e8['body']['id']){delete _0x79a2e8[_0xadf7('0x5a')]['id'];}return db[_0xadf7('0x3f')][_0xadf7('0x59')]({'where':{'id':_0x79a2e8['params']['id']}})[_0xadf7('0x22')](handleEntityNotFound(_0x3f417d,null))[_0xadf7('0x22')](saveUpdates(_0x79a2e8[_0xadf7('0x5a')],null))[_0xadf7('0x22')](respondWithResult(_0x3f417d,null))['catch'](handleError(_0x3f417d,null));};exports['destroy']=function(_0x43fd1e,_0x11089c){return db['ChatQueue'][_0xadf7('0x59')]({'where':{'id':_0x43fd1e[_0xadf7('0x55')]['id']}})[_0xadf7('0x22')](handleEntityNotFound(_0x11089c,null))[_0xadf7('0x22')](removeEntity(_0x11089c,null))[_0xadf7('0x29')](handleError(_0x11089c,null));};exports[_0xadf7('0x62')]=function(_0x58364b,_0x572e22){return db[_0xadf7('0x3f')][_0xadf7('0x62')]()['then'](respondWithResult(_0x572e22,null))[_0xadf7('0x29')](handleError(_0x572e22,null));};exports[_0xadf7('0x63')]=function(_0x4ab8de,_0x2aa91a,_0x3ac62a){var _0x4886d5={'raw':!![],'where':{}},_0x3102a7={},_0x513746;return db[_0xadf7('0x3f')][_0xadf7('0x64')]({'where':{'id':_0x4ab8de[_0xadf7('0x55')]['id']}})[_0xadf7('0x22')](handleEntityNotFound(_0x2aa91a,null))[_0xadf7('0x22')](function(_0x46d564){if(_0x46d564){_0x513746=_0x46d564[_0xadf7('0x5c')]({'plain':!![]});_0x3102a7[_0xadf7('0x43')]=_[_0xadf7('0x56')](db[_0xadf7('0x65')]['rawAttributes']);_0x3102a7[_0xadf7('0x44')]=_['keys'](_0x4ab8de[_0xadf7('0x44')]);_0x3102a7['filters']=_[_0xadf7('0x45')](_0x3102a7['model'],_0x3102a7[_0xadf7('0x44')]);_0x4886d5[_0xadf7('0x46')]=_[_0xadf7('0x45')](_0x3102a7[_0xadf7('0x43')],qs['fields'](_0x4ab8de[_0xadf7('0x44')][_0xadf7('0x47')]));_0x4886d5[_0xadf7('0x46')]=_0x4886d5['attributes']['length']?_0x4886d5[_0xadf7('0x46')]:_0x3102a7['model'];if(!_0x4ab8de['query']['hasOwnProperty'](_0xadf7('0x49'))){_0x4886d5[_0xadf7('0x2f')]=qs[_0xadf7('0x2f')](_0x4ab8de[_0xadf7('0x44')][_0xadf7('0x2f')]);_0x4886d5[_0xadf7('0x2d')]=qs[_0xadf7('0x2d')](_0x4ab8de['query'][_0xadf7('0x2d')]);}_0x4886d5[_0xadf7('0x4a')]=qs[_0xadf7('0x4b')](_0x4ab8de[_0xadf7('0x44')][_0xadf7('0x4b')]);_0x4886d5[_0xadf7('0x4c')]=qs['filters'](_[_0xadf7('0x4e')](_0x4ab8de[_0xadf7('0x44')],_0x3102a7[_0xadf7('0x4d')]));_0x4886d5[_0xadf7('0x4c')][_0xadf7('0x66')]=_0x46d564['id'];if(_0x4ab8de['query']['filter']){_0x4886d5['where']=_[_0xadf7('0x67')](_0x4886d5[_0xadf7('0x4c')],{'$or':_[_0xadf7('0x3e')](_0x4886d5['attributes'],function(_0x6459bb){var _0x1db887={};_0x1db887[_0x6459bb]={'$like':'%'+_0x4ab8de[_0xadf7('0x44')][_0xadf7('0x50')]+'%'};return _0x1db887;})});}_0x4886d5=_[_0xadf7('0x67')]({},_0x4886d5,_0x4ab8de[_0xadf7('0x51')]);return db['UserChatQueue'][_0xadf7('0x53')](_0x4886d5);}})[_0xadf7('0x22')](function(_0x184e0a){if(_0x184e0a){return db[_0xadf7('0x68')]['findAndCountAll']({'where':{'id':_[_0xadf7('0x3e')](_0x184e0a,_0xadf7('0x69')),'role':_0xadf7('0x6a')},'attributes':['id',_0xadf7('0x3b'),_0xadf7('0x6b'),_0xadf7('0x6c'),_0xadf7('0x6d')]});}})['then'](function(_0x33b75b){if(_0x33b75b){return{'count':_0x33b75b[_0xadf7('0x30')],'rows':_['map'](_0x33b75b['rows'],function(_0x47cc80){return{'membername':_0x47cc80[_0xadf7('0x3b')],'UserId':_0x47cc80['id'],'queue_name':_0x513746[_0xadf7('0x3b')],'ChatQueueId':_0x513746['id'],'interface':util[_0xadf7('0x6e')](_0xadf7('0x6f'),_0xadf7('0x70'),_0x47cc80[_0xadf7('0x3b')]),'penalty':0x0,'paused':_0x47cc80[_0xadf7('0x6b')],'createdAt':_0x47cc80[_0xadf7('0x6d')],'updatedAt':_0x47cc80[_0xadf7('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xadf7('0x22')](respondWithFilteredResult(_0x2aa91a,_0x4886d5))['catch'](handleError(_0x2aa91a,null));};exports[_0xadf7('0x71')]=function(_0x2d09b7,_0xde9a04,_0x104449){var _0x181ed4={};var _0x3fa1b3={};var _0x47b283;var _0x193f92;return db[_0xadf7('0x3f')][_0xadf7('0x64')]({'where':{'id':_0x2d09b7[_0xadf7('0x55')]['id']}})[_0xadf7('0x22')](handleEntityNotFound(_0xde9a04,null))[_0xadf7('0x22')](function(_0x34b206){if(_0x34b206){_0x47b283=_0x34b206;_0x3fa1b3[_0xadf7('0x43')]=_[_0xadf7('0x56')](db[_0xadf7('0x72')]['rawAttributes']);_0x3fa1b3[_0xadf7('0x44')]=_[_0xadf7('0x56')](_0x2d09b7[_0xadf7('0x44')]);_0x3fa1b3[_0xadf7('0x4d')]=_[_0xadf7('0x45')](_0x3fa1b3[_0xadf7('0x43')],_0x3fa1b3[_0xadf7('0x44')]);_0x181ed4['attributes']=_[_0xadf7('0x45')](_0x3fa1b3[_0xadf7('0x43')],qs['fields'](_0x2d09b7[_0xadf7('0x44')]['fields']));_0x181ed4[_0xadf7('0x46')]=_0x181ed4[_0xadf7('0x46')][_0xadf7('0x57')]?_0x181ed4['attributes']:_0x3fa1b3[_0xadf7('0x43')];_0x181ed4['order']=qs[_0xadf7('0x4b')](_0x2d09b7[_0xadf7('0x44')][_0xadf7('0x4b')]);_0x181ed4[_0xadf7('0x4c')]=qs[_0xadf7('0x4d')](_[_0xadf7('0x4e')](_0x2d09b7[_0xadf7('0x44')],_0x3fa1b3[_0xadf7('0x4d')]));if(_0x2d09b7['query'][_0xadf7('0x50')]){_0x181ed4[_0xadf7('0x4c')]=_[_0xadf7('0x67')](_0x181ed4['where'],{'$or':_[_0xadf7('0x3e')](_0x181ed4['attributes'],function(_0x1ecceb){var _0x485bd4={};_0x485bd4[_0x1ecceb]={'$like':'%'+_0x2d09b7[_0xadf7('0x44')]['filter']+'%'};return _0x485bd4;})});}_0x181ed4=_[_0xadf7('0x67')]({},_0x181ed4,_0x2d09b7[_0xadf7('0x51')]);return _0x47b283['getTeams'](_0x181ed4);}})[_0xadf7('0x22')](function(_0x518549){if(_0x518549){_0x193f92=_0x518549[_0xadf7('0x57')];if(!_0x2d09b7['query'][_0xadf7('0x48')](_0xadf7('0x49'))){_0x181ed4[_0xadf7('0x2f')]=qs['limit'](_0x2d09b7['query']['limit']);_0x181ed4['offset']=qs[_0xadf7('0x2d')](_0x2d09b7[_0xadf7('0x44')][_0xadf7('0x2d')]);}return _0x47b283[_0xadf7('0x71')](_0x181ed4);}})[_0xadf7('0x22')](function(_0x1b40bf){if(_0x1b40bf){return _0x1b40bf?{'count':_0x193f92,'rows':_0x1b40bf}:null;}})[_0xadf7('0x22')](respondWithResult(_0xde9a04,null))['catch'](handleError(_0xde9a04,null));};exports[_0xadf7('0x73')]=function(_0x17fa4b,_0x2a14f8,_0x1631bb){var _0x8ce6e2=_0x17fa4b[_0xadf7('0x5a')][_0xadf7('0x74')];return db[_0xadf7('0x72')]['findAll']({'where':{'id':_0x8ce6e2},'attributes':['id'],'include':[{'model':db[_0xadf7('0x68')],'as':_0xadf7('0x75'),'attributes':['id','name',_0xadf7('0x76'),_0xadf7('0x77'),_0xadf7('0x78')],'raw':!![]}]})[_0xadf7('0x22')](function(_0x219654){if(_0x219654){var _0x5e7324=_[_0xadf7('0x79')](_0x219654,function(_0x55d058){var _0x3d2495=_0x55d058[_0xadf7('0x5c')]({'plain':!![]});return _0x3d2495['Agents'];});return db[_0xadf7('0x3f')]['find']({'where':{'id':_0x17fa4b['params']['id']}})[_0xadf7('0x22')](function(_0x38c926){return db[_0xadf7('0x7a')][_0xadf7('0x7b')](function(_0x1777a1){return _0x38c926[_0xadf7('0x73')](_0x8ce6e2,{'transaction':_0x1777a1})[_0xadf7('0x22')](function(){return BPromise[_0xadf7('0x7c')](_0x5e7324,function(_0x1a28d6){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x1a28d6['id'],'ChatQueueId':_0x17fa4b[_0xadf7('0x55')]['id']},'transaction':_0x1777a1});});})[_0xadf7('0x22')](function(){_0x5e7324[_0xadf7('0x7d')](function(_0x1876ba){socket[_0xadf7('0x7e')]('userChatQueue:save',{'UserId':_0x1876ba['id'],'ChatQueueId':_0x38c926['id']});});});});});}})['then'](respondWithStatusCode(_0x2a14f8,null))[_0xadf7('0x29')](handleError(_0x2a14f8,null));};exports['removeTeams']=function(_0x4070a9,_0xda718a,_0x1890d4){return db[_0xadf7('0x72')][_0xadf7('0x53')]({'where':{'id':_0x4070a9[_0xadf7('0x44')][_0xadf7('0x74')]},'attributes':['id'],'include':[{'model':db[_0xadf7('0x68')],'as':_0xadf7('0x75'),'attributes':['id'],'raw':!![]}]})[_0xadf7('0x22')](handleEntityNotFound(_0xda718a,null))[_0xadf7('0x22')](function(_0x4e0ed1){var _0x7529be=_['map'](_0x4e0ed1,'id');var _0x30156d=[];var _0x550461=[];var _0x1cbebe=squel[_0xadf7('0x7f')]();_0x1cbebe[_0xadf7('0x80')](_0xadf7('0x81'))[_0xadf7('0x82')](_0xadf7('0x83'),'tq')[_0xadf7('0x84')](_0xadf7('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xadf7('0x86'),_0x4070a9[_0xadf7('0x55')]['id']);for(var _0x32d8ad=0x0;_0x32d8ad<_0x4e0ed1[_0xadf7('0x57')];_0x32d8ad+=0x1){let _0x427fde=_0x4e0ed1[_0x32d8ad];for(var _0x4db68d=0x0;_0x4db68d<_0x427fde[_0xadf7('0x75')][_0xadf7('0x57')];_0x4db68d+=0x1){let _0x57b9ef=_0x427fde[_0xadf7('0x75')][_0x4db68d];var _0x2bba56=_0x1cbebe['clone']();_0x2bba56[_0xadf7('0x4c')](_0xadf7('0x87'),_0x57b9ef['id']);_0x550461['push'](db[_0xadf7('0x7a')]['query'](_0x2bba56['toString'](),{'type':db[_0xadf7('0x7a')][_0xadf7('0x88')]['SELECT']})['then'](function(_0x37895e){if(_0x37895e[_0xadf7('0x57')]===0x1){return _0x57b9ef['id'];}else{var _0x40ba67=_[_0xadf7('0x89')](_['map'](_0x37895e,_0xadf7('0x8a')),function(_0x5e806f){return _[_0xadf7('0x8b')](_0x7529be,_0x5e806f);});if(_0x40ba67){return _0x57b9ef['id'];}}}));}}return BPromise[_0xadf7('0x8c')](_0x550461)[_0xadf7('0x22')](function(_0x18f61f){_0x30156d=_(_0x30156d)['union'](_0x18f61f)[_0xadf7('0x8d')]()[_0xadf7('0x8e')]();return db[_0xadf7('0x3f')]['find']({'where':{'id':_0x4070a9[_0xadf7('0x55')]['id']}})[_0xadf7('0x22')](function(_0x412a41){return db[_0xadf7('0x7a')][_0xadf7('0x7b')](function(_0x27abe8){return _0x412a41[_0xadf7('0x8f')](_0x4070a9[_0xadf7('0x44')]['ids'],{'transaction':_0x27abe8})['then'](function(){if(!_[_0xadf7('0x90')](_0x30156d)){return _0x412a41[_0xadf7('0x91')](_0x30156d,{'transaction':_0x27abe8});}})[_0xadf7('0x22')](function(){_0x30156d[_0xadf7('0x7d')](function(_0x1afdba){socket['emit'](_0xadf7('0x92'),{'UserId':_0x1afdba,'ChatQueueId':_0x412a41['id']});});});});});});})['then'](respondWithStatusCode(_0xda718a,null))['catch'](handleError(_0xda718a,null));};exports[_0xadf7('0x93')]=function(_0x450967,_0xba7c37,_0x5c6d94){return db[_0xadf7('0x3f')][_0xadf7('0x59')]({'where':{'id':_0x450967[_0xadf7('0x55')]['id']}})[_0xadf7('0x22')](handleEntityNotFound(_0xba7c37,null))['then'](function(_0x127027){if(_0x127027){return _0x127027[_0xadf7('0x93')](_0x450967[_0xadf7('0x5a')][_0xadf7('0x74')],_[_0xadf7('0x94')](_0x450967[_0xadf7('0x5a')],['ids','id'])||{})[_0xadf7('0x95')](function(_0x2615d6){for(var _0x2f5193=0x0;_0x2f5193<_0x450967[_0xadf7('0x5a')][_0xadf7('0x74')][_0xadf7('0x57')];_0x2f5193+=0x1){socket[_0xadf7('0x7e')](_0xadf7('0x96'),{'UserId':Number(_0x450967[_0xadf7('0x5a')][_0xadf7('0x74')][_0x2f5193]),'ChatQueueId':Number(_0x450967[_0xadf7('0x55')]['id'])});}return _0x2615d6;});}})['then'](respondWithResult(_0xba7c37,null))[_0xadf7('0x29')](handleError(_0xba7c37,null));};exports[_0xadf7('0x91')]=function(_0x54bcb6,_0xf2456a,_0x308acb){return db[_0xadf7('0x3f')]['find']({'where':{'id':_0x54bcb6[_0xadf7('0x55')]['id']}})[_0xadf7('0x22')](handleEntityNotFound(_0xf2456a,null))[_0xadf7('0x22')](function(_0x3288c7){if(_0x3288c7){return _0x3288c7['removeAgents'](_0x54bcb6[_0xadf7('0x44')][_0xadf7('0x74')])[_0xadf7('0x22')](function(){if(_[_0xadf7('0x97')](_0x54bcb6[_0xadf7('0x44')]['ids'])){for(var _0x4ccc61=0x0;_0x4ccc61<_0x54bcb6[_0xadf7('0x44')][_0xadf7('0x74')][_0xadf7('0x57')];_0x4ccc61+=0x1){socket[_0xadf7('0x7e')](_0xadf7('0x92'),{'UserId':Number(_0x54bcb6[_0xadf7('0x44')][_0xadf7('0x74')][_0x4ccc61]),'ChatQueueId':Number(_0x54bcb6['params']['id'])});}}else{socket[_0xadf7('0x7e')](_0xadf7('0x92'),{'UserId':Number(_0x54bcb6[_0xadf7('0x44')][_0xadf7('0x74')]),'ChatQueueId':Number(_0x54bcb6[_0xadf7('0x55')]['id'])});}});}})[_0xadf7('0x22')](respondWithStatusCode(_0xf2456a,null))[_0xadf7('0x29')](handleError(_0xf2456a,null));};exports[_0xadf7('0x98')]=function(_0xd3c6d6,_0x1aac17,_0x138ea9){var _0x851fc0={};var _0x1fd654={};var _0x54e7cc;var _0x4f22be;return db[_0xadf7('0x3f')][_0xadf7('0x64')]({'where':{'id':_0xd3c6d6[_0xadf7('0x55')]['id']}})['then'](handleEntityNotFound(_0x1aac17,null))[_0xadf7('0x22')](function(_0x5747c9){if(_0x5747c9){_0x54e7cc=_0x5747c9;_0x1fd654[_0xadf7('0x43')]=_['keys'](db[_0xadf7('0x68')][_0xadf7('0x40')]);_0x1fd654[_0xadf7('0x44')]=_[_0xadf7('0x56')](_0xd3c6d6[_0xadf7('0x44')]);_0x1fd654[_0xadf7('0x4d')]=_[_0xadf7('0x45')](_0x1fd654[_0xadf7('0x43')],_0x1fd654[_0xadf7('0x44')]);_0x851fc0[_0xadf7('0x46')]=_[_0xadf7('0x45')](_0x1fd654[_0xadf7('0x43')],qs['fields'](_0xd3c6d6['query'][_0xadf7('0x47')]));_0x851fc0['attributes']=_0x851fc0[_0xadf7('0x46')][_0xadf7('0x57')]?_0x851fc0[_0xadf7('0x46')]:_0x1fd654[_0xadf7('0x43')];_0x851fc0['order']=qs[_0xadf7('0x4b')](_0xd3c6d6[_0xadf7('0x44')][_0xadf7('0x4b')]);_0x851fc0[_0xadf7('0x4c')]=qs[_0xadf7('0x4d')](_[_0xadf7('0x4e')](_0xd3c6d6[_0xadf7('0x44')],_0x1fd654['filters']));if(_0xd3c6d6[_0xadf7('0x44')][_0xadf7('0x50')]){_0x851fc0[_0xadf7('0x4c')]=_[_0xadf7('0x67')](_0x851fc0[_0xadf7('0x4c')],{'$or':_[_0xadf7('0x3e')](_0x851fc0[_0xadf7('0x46')],function(_0xc99224){var _0x339ba2={};_0x339ba2[_0xc99224]={'$like':'%'+_0xd3c6d6[_0xadf7('0x44')][_0xadf7('0x50')]+'%'};return _0x339ba2;})});}_0x851fc0=_[_0xadf7('0x67')]({},_0x851fc0,_0xd3c6d6[_0xadf7('0x51')]);return _0x54e7cc[_0xadf7('0x98')](_0x851fc0);}})[_0xadf7('0x22')](function(_0x4054c3){if(_0x4054c3){_0x4f22be=_0x4054c3[_0xadf7('0x57')];if(!_0xd3c6d6[_0xadf7('0x44')][_0xadf7('0x48')](_0xadf7('0x49'))){_0x851fc0[_0xadf7('0x2f')]=qs['limit'](_0xd3c6d6['query'][_0xadf7('0x2f')]);_0x851fc0['offset']=qs[_0xadf7('0x2d')](_0xd3c6d6[_0xadf7('0x44')][_0xadf7('0x2d')]);}return _0x54e7cc[_0xadf7('0x98')](_0x851fc0);}})['then'](function(_0x132bd9){if(_0x132bd9){return _0x132bd9?{'count':_0x4f22be,'rows':_0x132bd9}:null;}})[_0xadf7('0x22')](respondWithResult(_0x1aac17,null))[_0xadf7('0x29')](handleError(_0x1aac17,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8d54ba5..7a0d6bf 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 _0xa82a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x27ab8f,_0x5089ae){var _0x1dab62=function(_0x4e5402){while(--_0x4e5402){_0x27ab8f['push'](_0x27ab8f['shift']());}};_0x1dab62(++_0x5089ae);}(_0xa82a,0x1e7));var _0xaa82=function(_0x3fca12,_0x592059){_0x3fca12=_0x3fca12-0x0;var _0x1bbb8d=_0xa82a[_0x3fca12];return _0x1bbb8d;};'use strict';var EventEmitter=require(_0xaa82('0x0'));var ChatQueue=require(_0xaa82('0x1'))['db'][_0xaa82('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaa82('0x3')](0x0);var events={'afterCreate':_0xaa82('0x4'),'afterUpdate':_0xaa82('0x5'),'afterDestroy':_0xaa82('0x6')};function emitEvent(_0xf109e4){return function(_0x5e470d,_0xaaab88,_0x23ba0f){ChatQueueEvents[_0xaa82('0x7')](_0xf109e4+':'+_0x5e470d['id'],_0x5e470d);ChatQueueEvents[_0xaa82('0x7')](_0xf109e4,_0x5e470d);_0x23ba0f(null);};}for(var e in events){if(events[_0xaa82('0x8')](e)){var event=events[e];ChatQueue[_0xaa82('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xc33a=['emit','hook','exports','../../mysqldb','ChatQueue','save','update','remove'];(function(_0x40686f,_0x3f24bf){var _0x53b21c=function(_0x3f2829){while(--_0x3f2829){_0x40686f['push'](_0x40686f['shift']());}};_0x53b21c(++_0x3f24bf);}(_0xc33a,0xcb));var _0xac33=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xc33a[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xac33('0x0'))['db'][_0xac33('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac33('0x2'),'afterUpdate':_0xac33('0x3'),'afterDestroy':_0xac33('0x4')};function emitEvent(_0x128c5f){return function(_0x4ae730,_0x4b5dd0,_0x445ec2){ChatQueueEvents['emit'](_0x128c5f+':'+_0x4ae730['id'],_0x4ae730);ChatQueueEvents[_0xac33('0x5')](_0x128c5f,_0x4ae730);_0x445ec2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xac33('0x6')](e,emitEvent(event));}}module[_0xac33('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 40803d7..bbc6451 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 _0x8daa=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash'];(function(_0x249d99,_0x16b584){var _0x5bfb05=function(_0x4f4d67){while(--_0x4f4d67){_0x249d99['push'](_0x249d99['shift']());}};_0x5bfb05(++_0x16b584);}(_0x8daa,0x11d));var _0xa8da=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8daa[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xa8da('0x0'));var util=require(_0xa8da('0x1'));var logger=require(_0xa8da('0x2'))('api');var moment=require(_0xa8da('0x3'));var BPromise=require(_0xa8da('0x4'));var rp=require(_0xa8da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa8da('0x6'));var attributes=require(_0xa8da('0x7'));module[_0xa8da('0x8')]=function(_0x1e128c,_0x1acc3a){return _0x1e128c['define'](_0xa8da('0x9'),attributes,{'tableName':_0xa8da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5321=['rimraf','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util','api','bluebird','request-promise','path'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x5321,0x13e));var _0x1532=function(_0x403e32,_0x36c2b4){_0x403e32=_0x403e32-0x0;var _0x33a47f=_0x5321[_0x403e32];return _0x33a47f;};'use strict';var _=require(_0x1532('0x0'));var util=require(_0x1532('0x1'));var logger=require('../../config/logger')(_0x1532('0x2'));var moment=require('moment');var BPromise=require(_0x1532('0x3'));var rp=require(_0x1532('0x4'));var fs=require('fs');var path=require(_0x1532('0x5'));var rimraf=require(_0x1532('0x6'));var config=require(_0x1532('0x7'));var attributes=require(_0x1532('0x8'));module[_0x1532('0x9')]=function(_0x5779b6,_0x18fd1b){return _0x5779b6[_0x1532('0xa')]('ChatQueue',attributes,{'tableName':_0x1532('0xb'),'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 a8eb856..eb624ea 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 _0x8580=['util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','options','raw','attributes','limit','map','include','model','GetChatQueue','debug','stringify','ChatQueue','where','ShowChatQueue'];(function(_0x2ada18,_0x37d5b6){var _0x1fc7c0=function(_0x176587){while(--_0x176587){_0x2ada18['push'](_0x2ada18['shift']());}};_0x1fc7c0(++_0x37d5b6);}(_0x8580,0x1c7));var _0x0858=function(_0x4fe26b,_0x5c92c9){_0x4fe26b=_0x4fe26b-0x0;var _0x1fa293=_0x8580[_0x4fe26b];return _0x1fa293;};'use strict';var _=require('lodash');var util=require(_0x0858('0x0'));var moment=require('moment');var BPromise=require(_0x0858('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0858('0x2'))['db'];var utils=require(_0x0858('0x3'));var logger=require('../../config/logger')(_0x0858('0x4'));var config=require(_0x0858('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0858('0x6')][_0x0858('0x7')]({'port':0x232a});config[_0x0858('0x8')]=_[_0x0858('0x9')](config['redis'],{'host':_0x0858('0xa'),'port':0x18eb});var socket=require(_0x0858('0xb'))(new Redis(config[_0x0858('0x8')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x470459,_0x4b5072,_0x24996d){return new BPromise(function(_0x1c214c,_0x38371f){return client[_0x0858('0xc')](_0x470459,_0x24996d)[_0x0858('0xd')](function(_0x207cda){logger[_0x0858('0xe')](_0x0858('0xf'),_0x4b5072,'request\x20sent');logger['debug'](_0x0858('0x10'),_0x4b5072,'request\x20sent',JSON['stringify'](_0x207cda));if(_0x207cda['error']){if(_0x207cda[_0x0858('0x11')][_0x0858('0x12')]===0x1f4){logger['error'](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x38371f(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);return _0x1c214c(_0x207cda[_0x0858('0x11')][_0x0858('0x13')]);}else{logger[_0x0858('0xe')]('ChatQueue,\x20%s,\x20%s',_0x4b5072,_0x0858('0x14'));_0x1c214c(_0x207cda['result'][_0x0858('0x13')]);}})[_0x0858('0x15')](function(_0x3a2d96){logger[_0x0858('0x11')](_0x0858('0xf'),_0x4b5072,_0x3a2d96);_0x38371f(_0x3a2d96);});});}exports['GetChatQueue']=function(_0x1127d7){var _0x447c96=this;return new Promise(function(_0x4fe5ab,_0x1ea1a7){return db['ChatQueue']['findAll']({'raw':_0x1127d7[_0x0858('0x16')]?_0x1127d7[_0x0858('0x16')][_0x0858('0x17')]===undefined?!![]:![]:!![],'where':_0x1127d7[_0x0858('0x16')]?_0x1127d7[_0x0858('0x16')]['where']||null:null,'attributes':_0x1127d7[_0x0858('0x16')]?_0x1127d7['options'][_0x0858('0x18')]||null:null,'limit':_0x1127d7['options']?_0x1127d7[_0x0858('0x16')][_0x0858('0x19')]||null:null,'include':_0x1127d7[_0x0858('0x16')]?_0x1127d7[_0x0858('0x16')]['include']?_[_0x0858('0x1a')](_0x1127d7[_0x0858('0x16')][_0x0858('0x1b')],function(_0x25f9ee){return{'model':db[_0x25f9ee[_0x0858('0x1c')]],'as':_0x25f9ee['as'],'attributes':_0x25f9ee[_0x0858('0x18')],'include':_0x25f9ee[_0x0858('0x1b')]?_[_0x0858('0x1a')](_0x25f9ee[_0x0858('0x1b')],function(_0x2ae968){return{'model':db[_0x2ae968[_0x0858('0x1c')]],'as':_0x2ae968['as'],'attributes':_0x2ae968[_0x0858('0x18')],'include':_0x2ae968[_0x0858('0x1b')]?_[_0x0858('0x1a')](_0x2ae968[_0x0858('0x1b')],function(_0x410e7d){return{'model':db[_0x410e7d[_0x0858('0x1c')]],'as':_0x410e7d['as'],'attributes':_0x410e7d[_0x0858('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x102cfc){logger[_0x0858('0xe')](_0x0858('0x1d'),_0x1127d7);logger[_0x0858('0x1e')](_0x0858('0x1d'),_0x1127d7,JSON[_0x0858('0x1f')](_0x102cfc));_0x4fe5ab(_0x102cfc);})[_0x0858('0x15')](function(_0x18c02f){logger['error'](_0x0858('0x1d'),_0x18c02f[_0x0858('0x13')],_0x1127d7);_0x1ea1a7(_0x447c96[_0x0858('0x11')](0x1f4,_0x18c02f[_0x0858('0x13')]));});});};exports['ShowChatQueue']=function(_0x12b2c9){var _0x25d131=this;return new Promise(function(_0x58adea,_0x191802){return db[_0x0858('0x20')]['find']({'raw':_0x12b2c9[_0x0858('0x16')]?_0x12b2c9[_0x0858('0x16')][_0x0858('0x17')]===undefined?!![]:![]:!![],'where':_0x12b2c9[_0x0858('0x16')]?_0x12b2c9[_0x0858('0x16')][_0x0858('0x21')]||null:null,'attributes':_0x12b2c9[_0x0858('0x16')]?_0x12b2c9[_0x0858('0x16')][_0x0858('0x18')]||null:null,'include':_0x12b2c9['options']?_0x12b2c9['options'][_0x0858('0x1b')]?_[_0x0858('0x1a')](_0x12b2c9[_0x0858('0x16')][_0x0858('0x1b')],function(_0x3ef651){return{'model':db[_0x3ef651[_0x0858('0x1c')]],'as':_0x3ef651['as'],'attributes':_0x3ef651[_0x0858('0x18')],'include':_0x3ef651[_0x0858('0x1b')]?_[_0x0858('0x1a')](_0x3ef651[_0x0858('0x1b')],function(_0xcfd1d3){return{'model':db[_0xcfd1d3[_0x0858('0x1c')]],'as':_0xcfd1d3['as'],'attributes':_0xcfd1d3[_0x0858('0x18')],'include':_0xcfd1d3[_0x0858('0x1b')]?_[_0x0858('0x1a')](_0xcfd1d3[_0x0858('0x1b')],function(_0x41cb0e){return{'model':db[_0x41cb0e[_0x0858('0x1c')]],'as':_0x41cb0e['as'],'attributes':_0x41cb0e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x54252d){logger['info'](_0x0858('0x22'),_0x12b2c9);logger[_0x0858('0x1e')](_0x0858('0x22'),_0x12b2c9,JSON[_0x0858('0x1f')](_0x54252d));_0x58adea(_0x54252d);})[_0x0858('0x15')](function(_0x1ea9b8){logger[_0x0858('0x11')](_0x0858('0x22'),_0x1ea9b8['message'],_0x12b2c9);_0x191802(_0x25d131['error'](0x1f4,_0x1ea9b8['message']));});});}; \ No newline at end of file +var _0x1ae4=['http','redis','defaults','localhost','./chatQueue.socket','request','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','findAll','options','attributes','limit','include','map','model','then','GetChatQueue','debug','ShowChatQueue','ChatQueue','find','raw','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x143ce6,_0x46e089){var _0x33ed64=function(_0x5a6856){while(--_0x5a6856){_0x143ce6['push'](_0x143ce6['shift']());}};_0x33ed64(++_0x46e089);}(_0x1ae4,0x114));var _0x41ae=function(_0x2bfa63,_0x1db05b){_0x2bfa63=_0x2bfa63-0x0;var _0x146e00=_0x1ae4[_0x2bfa63];return _0x146e00;};'use strict';var _=require(_0x41ae('0x0'));var util=require(_0x41ae('0x1'));var moment=require(_0x41ae('0x2'));var BPromise=require('bluebird');var rs=require(_0x41ae('0x3'));var fs=require('fs');var Redis=require(_0x41ae('0x4'));var db=require(_0x41ae('0x5'))['db'];var utils=require(_0x41ae('0x6'));var logger=require(_0x41ae('0x7'))(_0x41ae('0x8'));var config=require(_0x41ae('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x41ae('0xa')][_0x41ae('0xb')]({'port':0x232a});config[_0x41ae('0xc')]=_[_0x41ae('0xd')](config['redis'],{'host':_0x41ae('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41ae('0xc')]));require(_0x41ae('0xf'))['register'](socket);function respondWithRpcPromise(_0x5c5cd8,_0x138347,_0x5bedd6){return new BPromise(function(_0x151268,_0x4b5a3c){return client[_0x41ae('0x10')](_0x5c5cd8,_0x5bedd6)['then'](function(_0x16c7b0){logger[_0x41ae('0x11')]('ChatQueue,\x20%s,\x20%s',_0x138347,_0x41ae('0x12'));logger['debug'](_0x41ae('0x13'),_0x138347,_0x41ae('0x12'),JSON[_0x41ae('0x14')](_0x16c7b0));if(_0x16c7b0[_0x41ae('0x15')]){if(_0x16c7b0[_0x41ae('0x15')]['code']===0x1f4){logger[_0x41ae('0x15')](_0x41ae('0x16'),_0x138347,_0x16c7b0[_0x41ae('0x15')]['message']);return _0x4b5a3c(_0x16c7b0['error']['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x138347,_0x16c7b0[_0x41ae('0x15')][_0x41ae('0x17')]);return _0x151268(_0x16c7b0[_0x41ae('0x15')][_0x41ae('0x17')]);}else{logger[_0x41ae('0x11')](_0x41ae('0x16'),_0x138347,_0x41ae('0x12'));_0x151268(_0x16c7b0[_0x41ae('0x18')][_0x41ae('0x17')]);}})[_0x41ae('0x19')](function(_0x24f11c){logger[_0x41ae('0x15')](_0x41ae('0x16'),_0x138347,_0x24f11c);_0x4b5a3c(_0x24f11c);});});}exports['GetChatQueue']=function(_0x4551be){var _0x5b981a=this;return new Promise(function(_0x2b07ec,_0x1c6cf2){return db['ChatQueue'][_0x41ae('0x1a')]({'raw':_0x4551be['options']?_0x4551be[_0x41ae('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4551be[_0x41ae('0x1b')]?_0x4551be[_0x41ae('0x1b')]['where']||null:null,'attributes':_0x4551be[_0x41ae('0x1b')]?_0x4551be['options'][_0x41ae('0x1c')]||null:null,'limit':_0x4551be[_0x41ae('0x1b')]?_0x4551be[_0x41ae('0x1b')][_0x41ae('0x1d')]||null:null,'include':_0x4551be[_0x41ae('0x1b')]?_0x4551be[_0x41ae('0x1b')][_0x41ae('0x1e')]?_[_0x41ae('0x1f')](_0x4551be[_0x41ae('0x1b')]['include'],function(_0x21a4e8){return{'model':db[_0x21a4e8[_0x41ae('0x20')]],'as':_0x21a4e8['as'],'attributes':_0x21a4e8['attributes'],'include':_0x21a4e8[_0x41ae('0x1e')]?_[_0x41ae('0x1f')](_0x21a4e8[_0x41ae('0x1e')],function(_0xbc9a65){return{'model':db[_0xbc9a65['model']],'as':_0xbc9a65['as'],'attributes':_0xbc9a65[_0x41ae('0x1c')],'include':_0xbc9a65[_0x41ae('0x1e')]?_[_0x41ae('0x1f')](_0xbc9a65[_0x41ae('0x1e')],function(_0x113fde){return{'model':db[_0x113fde[_0x41ae('0x20')]],'as':_0x113fde['as'],'attributes':_0x113fde[_0x41ae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x41ae('0x21')](function(_0x48f878){logger[_0x41ae('0x11')](_0x41ae('0x22'),_0x4551be);logger[_0x41ae('0x23')]('GetChatQueue',_0x4551be,JSON[_0x41ae('0x14')](_0x48f878));_0x2b07ec(_0x48f878);})[_0x41ae('0x19')](function(_0x34cd17){logger[_0x41ae('0x15')](_0x41ae('0x22'),_0x34cd17[_0x41ae('0x17')],_0x4551be);_0x1c6cf2(_0x5b981a[_0x41ae('0x15')](0x1f4,_0x34cd17[_0x41ae('0x17')]));});});};exports[_0x41ae('0x24')]=function(_0x4d4a6e){var _0x1b1406=this;return new Promise(function(_0x5b0e90,_0x4c60cd){return db[_0x41ae('0x25')][_0x41ae('0x26')]({'raw':_0x4d4a6e[_0x41ae('0x1b')]?_0x4d4a6e[_0x41ae('0x1b')][_0x41ae('0x27')]===undefined?!![]:![]:!![],'where':_0x4d4a6e[_0x41ae('0x1b')]?_0x4d4a6e[_0x41ae('0x1b')][_0x41ae('0x28')]||null:null,'attributes':_0x4d4a6e[_0x41ae('0x1b')]?_0x4d4a6e['options']['attributes']||null:null,'include':_0x4d4a6e[_0x41ae('0x1b')]?_0x4d4a6e[_0x41ae('0x1b')]['include']?_['map'](_0x4d4a6e[_0x41ae('0x1b')][_0x41ae('0x1e')],function(_0x3c5eee){return{'model':db[_0x3c5eee[_0x41ae('0x20')]],'as':_0x3c5eee['as'],'attributes':_0x3c5eee[_0x41ae('0x1c')],'include':_0x3c5eee[_0x41ae('0x1e')]?_[_0x41ae('0x1f')](_0x3c5eee[_0x41ae('0x1e')],function(_0x179a25){return{'model':db[_0x179a25[_0x41ae('0x20')]],'as':_0x179a25['as'],'attributes':_0x179a25['attributes'],'include':_0x179a25[_0x41ae('0x1e')]?_['map'](_0x179a25[_0x41ae('0x1e')],function(_0x17fe36){return{'model':db[_0x17fe36[_0x41ae('0x20')]],'as':_0x17fe36['as'],'attributes':_0x17fe36[_0x41ae('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x41ae('0x21')](function(_0x9d2c1c){logger[_0x41ae('0x11')](_0x41ae('0x24'),_0x4d4a6e);logger[_0x41ae('0x23')](_0x41ae('0x24'),_0x4d4a6e,JSON[_0x41ae('0x14')](_0x9d2c1c));_0x5b0e90(_0x9d2c1c);})['catch'](function(_0x9b78fc){logger[_0x41ae('0x15')](_0x41ae('0x24'),_0x9b78fc[_0x41ae('0x17')],_0x4d4a6e);_0x4c60cd(_0x1b1406['error'](0x1f4,_0x9b78fc[_0x41ae('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index dadc988..938fcca 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 _0x68fc=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x45c9f4,_0x2eec90){var _0x1f9be9=function(_0x1a5cbe){while(--_0x1a5cbe){_0x45c9f4['push'](_0x45c9f4['shift']());}};_0x1f9be9(++_0x2eec90);}(_0x68fc,0xa5));var _0xc68f=function(_0x4696a8,_0x8703eb){_0x4696a8=_0x4696a8-0x0;var _0x72a7a4=_0x68fc[_0x4696a8];return _0x72a7a4;};'use strict';var ChatQueueEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){ChatQueueEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);ChatQueueEvents['on'](_0x9f2705,_0x2bf3fd);}}; \ No newline at end of file +var _0xec56=['removeListener','register','length','chatQueue:','./chatQueue.events','update','emit'];(function(_0x382d80,_0x3de32d){var _0x518844=function(_0x7f3a0b){while(--_0x7f3a0b){_0x382d80['push'](_0x382d80['shift']());}};_0x518844(++_0x3de32d);}(_0xec56,0x1bd));var _0x6ec5=function(_0x8a9919,_0x4d886d){_0x8a9919=_0x8a9919-0x0;var _0x103620=_0xec56[_0x8a9919];return _0x103620;};'use strict';var ChatQueueEvents=require(_0x6ec5('0x0'));var events=['save','remove',_0x6ec5('0x1')];function createListener(_0x3b8a3f,_0x26a5af){return function(_0x240ccf){_0x26a5af[_0x6ec5('0x2')](_0x3b8a3f,_0x240ccf);};}function removeListener(_0x399441,_0x469679){return function(){ChatQueueEvents[_0x6ec5('0x3')](_0x399441,_0x469679);};}exports[_0x6ec5('0x4')]=function(_0x28b12b){for(var _0x2d0a93=0x0,_0x3bb683=events[_0x6ec5('0x5')];_0x2d0a93<_0x3bb683;_0x2d0a93++){var _0x1f59cd=events[_0x2d0a93];var _0x3dd891=createListener(_0x6ec5('0x6')+_0x1f59cd,_0x28b12b);ChatQueueEvents['on'](_0x1f59cd,_0x3dd891);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 65fa98d..2082761 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5128ca,_0x1ac9ec){var _0x55c484=function(_0x6a8360){while(--_0x6a8360){_0x5128ca['push'](_0x5128ca['shift']());}};_0x55c484(++_0x1ac9ec);}(_0xe14b,0x93));var _0xbe14=function(_0x49f694,_0x11d1ef){_0x49f694=_0x49f694-0x0;var _0x33e197=_0xe14b[_0x49f694];return _0x33e197;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _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(_0x37cc6d,_0x3eb526){var _0x9136fd=function(_0x1fc32f){while(--_0x1fc32f){_0x37cc6d['push'](_0x37cc6d['shift']());}};_0x9136fd(++_0x3eb526);}(_0x814b,0x1a2));var _0xb814=function(_0x124298,_0x542004){_0x124298=_0x124298-0x0;var _0x35ac24=_0x814b[_0x124298];return _0x35ac24;};'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 50e8c86..b9c8f50 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 _0x51e3=['DATE','sequelize','STRING'];(function(_0x241efa,_0x51b807){var _0x1672aa=function(_0x7e29dd){while(--_0x7e29dd){_0x241efa['push'](_0x241efa['shift']());}};_0x1672aa(++_0x51b807);}(_0x51e3,0x1e4));var _0x351e=function(_0x4bf0a5,_0x5b9b01){_0x4bf0a5=_0x4bf0a5-0x0;var _0x4adc1e=_0x51e3[_0x4bf0a5];return _0x4adc1e;};'use strict';var moment=require('moment');var Sequelize=require(_0x351e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x351e('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x351e('0x2')]},'exitAt':{'type':Sequelize[_0x351e('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3936=['moment','exports','STRING','DATE'];(function(_0x43e40b,_0x375621){var _0x5f5c7b=function(_0x402e4a){while(--_0x402e4a){_0x43e40b['push'](_0x43e40b['shift']());}};_0x5f5c7b(++_0x375621);}(_0x3936,0x1ec));var _0x6393=function(_0x1de0b9,_0xc6f046){_0x1de0b9=_0x1de0b9-0x0;var _0x18edae=_0x3936[_0x1de0b9];return _0x18edae;};'use strict';var moment=require(_0x6393('0x0'));var Sequelize=require('sequelize');module[_0x6393('0x1')]={'uniqueid':{'type':Sequelize[_0x6393('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6393('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x6393('0x3')]},'acceptAt':{'type':Sequelize[_0x6393('0x3')]},'exitAt':{'type':Sequelize[_0x6393('0x3')]},'reason':{'type':Sequelize[_0x6393('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 84adca0..e3ac871 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 _0x2178=['limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2178,0x1b0));var _0x8217=function(_0x204c59,_0x5614ee){_0x204c59=_0x204c59-0x0;var _0x4cd35b=_0x2178[_0x204c59];return _0x4cd35b;};'use strict';var emlformat=require(_0x8217('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8217('0x1'));var jsonpatch=require(_0x8217('0x2'));var rp=require(_0x8217('0x3'));var moment=require('moment');var BPromise=require(_0x8217('0x4'));var Mustache=require(_0x8217('0x5'));var util=require('util');var path=require(_0x8217('0x6'));var sox=require(_0x8217('0x7'));var csv=require(_0x8217('0x8'));var ejs=require(_0x8217('0x9'));var fs=require('fs');var fs_extra=require(_0x8217('0xa'));var _=require(_0x8217('0xb'));var squel=require(_0x8217('0xc'));var crypto=require(_0x8217('0xd'));var jsforce=require(_0x8217('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8217('0xf'));var Papa=require(_0x8217('0x10'));var Redis=require(_0x8217('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8217('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8217('0x13'))(_0x8217('0x14'));var utils=require(_0x8217('0x15'));var config=require(_0x8217('0x16'));var licenseUtil=require(_0x8217('0x17'));var db=require(_0x8217('0x18'))['db'];function respondWithStatusCode(_0x39757e,_0x560fc0){_0x560fc0=_0x560fc0||0xcc;return function(_0x5b12bb){if(_0x5b12bb){return _0x39757e['sendStatus'](_0x560fc0);}return _0x39757e[_0x8217('0x19')](_0x560fc0)[_0x8217('0x1a')]();};}function respondWithResult(_0x2eab6b,_0x441a19){_0x441a19=_0x441a19||0xc8;return function(_0x5081d3){if(_0x5081d3){return _0x2eab6b[_0x8217('0x19')](_0x441a19)[_0x8217('0x1b')](_0x5081d3);}};}function respondWithFilteredResult(_0x315fdb,_0x47a1ff){return function(_0x15dbf6){if(_0x15dbf6){var _0x3c0247=typeof _0x47a1ff[_0x8217('0x1c')]===_0x8217('0x1d')&&typeof _0x47a1ff[_0x8217('0x1e')]===_0x8217('0x1d');var _0x3ccef1=_0x15dbf6['count'];var _0x407924=_0x3c0247?0x0:_0x47a1ff[_0x8217('0x1c')];var _0x5a46c2=_0x3c0247?_0x15dbf6[_0x8217('0x1f')]:_0x47a1ff[_0x8217('0x1c')]+_0x47a1ff['limit'];var _0x591516;if(_0x5a46c2>=_0x3ccef1){_0x5a46c2=_0x3ccef1;_0x591516=0xc8;}else{_0x591516=0xce;}_0x315fdb['status'](_0x591516);return _0x315fdb[_0x8217('0x20')](_0x8217('0x21'),_0x407924+'-'+_0x5a46c2+'/'+_0x3ccef1)[_0x8217('0x1b')](_0x15dbf6);}return null;};}function patchUpdates(_0xe573c6){return function(_0x585271){try{jsonpatch[_0x8217('0x22')](_0x585271,_0xe573c6,!![]);}catch(_0x29f4d7){return BPromise[_0x8217('0x23')](_0x29f4d7);}return _0x585271[_0x8217('0x24')]();};}function saveUpdates(_0x3215f8,_0x2931d5){return function(_0x564edc){if(_0x564edc){return _0x564edc[_0x8217('0x25')](_0x3215f8)[_0x8217('0x26')](function(_0x4ed481){return _0x4ed481;});}return null;};}function removeEntity(_0x3101bd,_0x2dead6){return function(_0x2c2f00){if(_0x2c2f00){return _0x2c2f00[_0x8217('0x27')]()[_0x8217('0x26')](function(){_0x3101bd[_0x8217('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5087fb,_0x3329d4){return function(_0xbb940e){if(!_0xbb940e){_0x5087fb[_0x8217('0x28')](0x194);}return _0xbb940e;};}function handleError(_0x2660a5,_0x55c66b){_0x55c66b=_0x55c66b||0x1f4;return function(_0x55a324){logger[_0x8217('0x29')](_0x55a324[_0x8217('0x2a')]);if(_0x55a324[_0x8217('0x2b')]){delete _0x55a324[_0x8217('0x2b')];}_0x2660a5['status'](_0x55c66b)[_0x8217('0x2c')](_0x55a324);};}exports['index']=function(_0x2ef2f1,_0xbf2b18){var _0x23fcd5={},_0x15ff1d={},_0x53eca2={'count':0x0,'rows':[]};var _0x12834e=_[_0x8217('0x2d')](db[_0x8217('0x2e')][_0x8217('0x2f')],function(_0x3c798d){return{'name':_0x3c798d[_0x8217('0x30')],'type':_0x3c798d[_0x8217('0x31')]['key']};});_0x15ff1d['model']=_[_0x8217('0x2d')](_0x12834e,_0x8217('0x2b'));_0x15ff1d[_0x8217('0x32')]=_['keys'](_0x2ef2f1[_0x8217('0x32')]);_0x15ff1d[_0x8217('0x33')]=_[_0x8217('0x34')](_0x15ff1d[_0x8217('0x35')],_0x15ff1d[_0x8217('0x32')]);_0x23fcd5[_0x8217('0x36')]=_[_0x8217('0x34')](_0x15ff1d[_0x8217('0x35')],qs[_0x8217('0x37')](_0x2ef2f1[_0x8217('0x32')][_0x8217('0x37')]));_0x23fcd5['attributes']=_0x23fcd5[_0x8217('0x36')][_0x8217('0x38')]?_0x23fcd5[_0x8217('0x36')]:_0x15ff1d[_0x8217('0x35')];if(!_0x2ef2f1[_0x8217('0x32')][_0x8217('0x39')]('nolimit')){_0x23fcd5[_0x8217('0x1e')]=qs[_0x8217('0x1e')](_0x2ef2f1[_0x8217('0x32')][_0x8217('0x1e')]);_0x23fcd5[_0x8217('0x1c')]=qs[_0x8217('0x1c')](_0x2ef2f1[_0x8217('0x32')][_0x8217('0x1c')]);}_0x23fcd5[_0x8217('0x3a')]=qs[_0x8217('0x3b')](_0x2ef2f1[_0x8217('0x32')][_0x8217('0x3b')]);_0x23fcd5['where']=qs[_0x8217('0x33')](_[_0x8217('0x3c')](_0x2ef2f1[_0x8217('0x32')],_0x15ff1d[_0x8217('0x33')]),_0x12834e);if(_0x2ef2f1[_0x8217('0x32')][_0x8217('0x3d')]){_0x23fcd5[_0x8217('0x3e')]=_[_0x8217('0x3f')](_0x23fcd5[_0x8217('0x3e')],{'$or':_['map'](_0x12834e,function(_0x59ed1c){if(_0x59ed1c['type']!==_0x8217('0x40')){var _0x484048={};_0x484048[_0x59ed1c['name']]={'$like':'%'+_0x2ef2f1['query'][_0x8217('0x3d')]+'%'};return _0x484048;}})});}_0x23fcd5=_[_0x8217('0x3f')]({},_0x23fcd5,_0x2ef2f1[_0x8217('0x41')]);var _0x111ed0={'where':_0x23fcd5['where']};return db[_0x8217('0x2e')][_0x8217('0x1f')](_0x111ed0)['then'](function(_0x94814b){_0x53eca2['count']=_0x94814b;if(_0x2ef2f1[_0x8217('0x32')][_0x8217('0x42')]){_0x23fcd5[_0x8217('0x43')]=[{'all':!![]}];}return db[_0x8217('0x2e')][_0x8217('0x44')](_0x23fcd5);})['then'](function(_0x28150f){_0x53eca2['rows']=_0x28150f;return _0x53eca2;})[_0x8217('0x26')](respondWithFilteredResult(_0xbf2b18,_0x23fcd5))[_0x8217('0x45')](handleError(_0xbf2b18,null));};exports[_0x8217('0x46')]=function(_0x184fba,_0x3d581b){var _0x270a96={'raw':!![],'where':{'id':_0x184fba[_0x8217('0x47')]['id']}},_0x2f383b={};_0x2f383b[_0x8217('0x35')]=_[_0x8217('0x48')](db[_0x8217('0x2e')][_0x8217('0x2f')]);_0x2f383b[_0x8217('0x32')]=_[_0x8217('0x48')](_0x184fba[_0x8217('0x32')]);_0x2f383b[_0x8217('0x33')]=_['intersection'](_0x2f383b[_0x8217('0x35')],_0x2f383b[_0x8217('0x32')]);_0x270a96['attributes']=_[_0x8217('0x34')](_0x2f383b[_0x8217('0x35')],qs['fields'](_0x184fba['query'][_0x8217('0x37')]));_0x270a96['attributes']=_0x270a96[_0x8217('0x36')][_0x8217('0x38')]?_0x270a96[_0x8217('0x36')]:_0x2f383b['model'];if(_0x184fba['query']['includeAll']){_0x270a96[_0x8217('0x43')]=[{'all':!![]}];}_0x270a96=_[_0x8217('0x3f')]({},_0x270a96,_0x184fba[_0x8217('0x41')]);return db[_0x8217('0x2e')][_0x8217('0x49')](_0x270a96)[_0x8217('0x26')](handleEntityNotFound(_0x3d581b,null))[_0x8217('0x26')](respondWithResult(_0x3d581b,null))[_0x8217('0x45')](handleError(_0x3d581b,null));};exports['create']=function(_0x4ba392,_0x245dfa){return db[_0x8217('0x2e')][_0x8217('0x4a')](_0x4ba392[_0x8217('0x4b')],{})[_0x8217('0x26')](respondWithResult(_0x245dfa,0xc9))[_0x8217('0x45')](handleError(_0x245dfa,null));};exports['update']=function(_0x21424d,_0x3ae463){if(_0x21424d[_0x8217('0x4b')]['id']){delete _0x21424d['body']['id'];}return db[_0x8217('0x2e')]['find']({'where':{'id':_0x21424d[_0x8217('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ae463,null))[_0x8217('0x26')](saveUpdates(_0x21424d['body'],null))[_0x8217('0x26')](respondWithResult(_0x3ae463,null))[_0x8217('0x45')](handleError(_0x3ae463,null));};exports[_0x8217('0x27')]=function(_0x7291b1,_0x5df18f){return db[_0x8217('0x2e')][_0x8217('0x49')]({'where':{'id':_0x7291b1[_0x8217('0x47')]['id']}})[_0x8217('0x26')](handleEntityNotFound(_0x5df18f,null))[_0x8217('0x26')](removeEntity(_0x5df18f,null))[_0x8217('0x45')](handleError(_0x5df18f,null));};exports[_0x8217('0x4c')]=function(_0x261f08,_0x4ae06e){return db[_0x8217('0x2e')][_0x8217('0x4c')]()[_0x8217('0x26')](respondWithResult(_0x4ae06e,null))[_0x8217('0x45')](handleError(_0x4ae06e,null));}; \ No newline at end of file +var _0xce22=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x3a1ea5,_0x349f01){var _0xfac9b2=function(_0xd5310c){while(--_0xd5310c){_0x3a1ea5['push'](_0x3a1ea5['shift']());}};_0xfac9b2(++_0x349f01);}(_0xce22,0xea));var _0x2ce2=function(_0xc57c18,_0x3259fc){_0xc57c18=_0xc57c18-0x0;var _0x5daed9=_0xce22[_0xc57c18];return _0x5daed9;};'use strict';var emlformat=require(_0x2ce2('0x0'));var rimraf=require(_0x2ce2('0x1'));var zipdir=require(_0x2ce2('0x2'));var jsonpatch=require(_0x2ce2('0x3'));var rp=require(_0x2ce2('0x4'));var moment=require('moment');var BPromise=require(_0x2ce2('0x5'));var Mustache=require('mustache');var util=require(_0x2ce2('0x6'));var path=require(_0x2ce2('0x7'));var sox=require(_0x2ce2('0x8'));var csv=require(_0x2ce2('0x9'));var ejs=require(_0x2ce2('0xa'));var fs=require('fs');var fs_extra=require(_0x2ce2('0xb'));var _=require(_0x2ce2('0xc'));var squel=require('squel');var crypto=require(_0x2ce2('0xd'));var jsforce=require(_0x2ce2('0xe'));var deskjs=require(_0x2ce2('0xf'));var toCsv=require(_0x2ce2('0x9'));var querystring=require(_0x2ce2('0x10'));var Papa=require(_0x2ce2('0x11'));var Redis=require('ioredis');var authService=require(_0x2ce2('0x12'));var qs=require(_0x2ce2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2ce2('0x14'));var logger=require(_0x2ce2('0x15'))('api');var utils=require(_0x2ce2('0x16'));var config=require(_0x2ce2('0x17'));var licenseUtil=require(_0x2ce2('0x18'));var db=require(_0x2ce2('0x19'))['db'];function respondWithStatusCode(_0x4b2407,_0x1b4a4f){_0x1b4a4f=_0x1b4a4f||0xcc;return function(_0x112244){if(_0x112244){return _0x4b2407[_0x2ce2('0x1a')](_0x1b4a4f);}return _0x4b2407['status'](_0x1b4a4f)[_0x2ce2('0x1b')]();};}function respondWithResult(_0x4d3490,_0x4874a5){_0x4874a5=_0x4874a5||0xc8;return function(_0x7b8036){if(_0x7b8036){return _0x4d3490[_0x2ce2('0x1c')](_0x4874a5)[_0x2ce2('0x1d')](_0x7b8036);}};}function respondWithFilteredResult(_0x17120f,_0x1ac6e9){return function(_0x18dd99){if(_0x18dd99){var _0x313e91=typeof _0x1ac6e9['offset']==='undefined'&&typeof _0x1ac6e9['limit']===_0x2ce2('0x1e');var _0xa229b7=_0x18dd99[_0x2ce2('0x1f')];var _0x3443e6=_0x313e91?0x0:_0x1ac6e9[_0x2ce2('0x20')];var _0x560a77=_0x313e91?_0x18dd99[_0x2ce2('0x1f')]:_0x1ac6e9['offset']+_0x1ac6e9[_0x2ce2('0x21')];var _0x42f597;if(_0x560a77>=_0xa229b7){_0x560a77=_0xa229b7;_0x42f597=0xc8;}else{_0x42f597=0xce;}_0x17120f[_0x2ce2('0x1c')](_0x42f597);return _0x17120f[_0x2ce2('0x22')](_0x2ce2('0x23'),_0x3443e6+'-'+_0x560a77+'/'+_0xa229b7)[_0x2ce2('0x1d')](_0x18dd99);}return null;};}function patchUpdates(_0x578cb5){return function(_0x4d3a37){try{jsonpatch[_0x2ce2('0x24')](_0x4d3a37,_0x578cb5,!![]);}catch(_0x3d07ec){return BPromise[_0x2ce2('0x25')](_0x3d07ec);}return _0x4d3a37[_0x2ce2('0x26')]();};}function saveUpdates(_0x4838fe,_0x5b2b79){return function(_0x5b0eb3){if(_0x5b0eb3){return _0x5b0eb3[_0x2ce2('0x27')](_0x4838fe)[_0x2ce2('0x28')](function(_0x4ae9b9){return _0x4ae9b9;});}return null;};}function removeEntity(_0x17a57a,_0x43a7b6){return function(_0x51249f){if(_0x51249f){return _0x51249f[_0x2ce2('0x29')]()[_0x2ce2('0x28')](function(){_0x17a57a[_0x2ce2('0x1c')](0xcc)[_0x2ce2('0x1b')]();});}};}function handleEntityNotFound(_0x5c748f,_0x528fec){return function(_0x10748a){if(!_0x10748a){_0x5c748f['sendStatus'](0x194);}return _0x10748a;};}function handleError(_0x3ee4f8,_0x2e3296){_0x2e3296=_0x2e3296||0x1f4;return function(_0x3a701e){logger[_0x2ce2('0x2a')](_0x3a701e[_0x2ce2('0x2b')]);if(_0x3a701e['name']){delete _0x3a701e['name'];}_0x3ee4f8[_0x2ce2('0x1c')](_0x2e3296)['send'](_0x3a701e);};}exports[_0x2ce2('0x2c')]=function(_0x44f622,_0x15a245){var _0x137d06={},_0x1e1f17={},_0x2aa881={'count':0x0,'rows':[]};var _0x4b201e=_[_0x2ce2('0x2d')](db[_0x2ce2('0x2e')][_0x2ce2('0x2f')],function(_0x383315){return{'name':_0x383315[_0x2ce2('0x30')],'type':_0x383315[_0x2ce2('0x31')][_0x2ce2('0x32')]};});_0x1e1f17[_0x2ce2('0x33')]=_['map'](_0x4b201e,_0x2ce2('0x34'));_0x1e1f17['query']=_['keys'](_0x44f622[_0x2ce2('0x35')]);_0x1e1f17[_0x2ce2('0x36')]=_['intersection'](_0x1e1f17[_0x2ce2('0x33')],_0x1e1f17[_0x2ce2('0x35')]);_0x137d06[_0x2ce2('0x37')]=_[_0x2ce2('0x38')](_0x1e1f17[_0x2ce2('0x33')],qs[_0x2ce2('0x39')](_0x44f622['query'][_0x2ce2('0x39')]));_0x137d06[_0x2ce2('0x37')]=_0x137d06[_0x2ce2('0x37')][_0x2ce2('0x3a')]?_0x137d06['attributes']:_0x1e1f17[_0x2ce2('0x33')];if(!_0x44f622[_0x2ce2('0x35')][_0x2ce2('0x3b')](_0x2ce2('0x3c'))){_0x137d06[_0x2ce2('0x21')]=qs[_0x2ce2('0x21')](_0x44f622[_0x2ce2('0x35')][_0x2ce2('0x21')]);_0x137d06[_0x2ce2('0x20')]=qs[_0x2ce2('0x20')](_0x44f622[_0x2ce2('0x35')]['offset']);}_0x137d06[_0x2ce2('0x3d')]=qs[_0x2ce2('0x3e')](_0x44f622[_0x2ce2('0x35')][_0x2ce2('0x3e')]);_0x137d06[_0x2ce2('0x3f')]=qs[_0x2ce2('0x36')](_[_0x2ce2('0x40')](_0x44f622[_0x2ce2('0x35')],_0x1e1f17[_0x2ce2('0x36')]),_0x4b201e);if(_0x44f622[_0x2ce2('0x35')][_0x2ce2('0x41')]){_0x137d06[_0x2ce2('0x3f')]=_['merge'](_0x137d06[_0x2ce2('0x3f')],{'$or':_[_0x2ce2('0x2d')](_0x4b201e,function(_0x5e0ee9){if(_0x5e0ee9[_0x2ce2('0x31')]!==_0x2ce2('0x42')){var _0x3b5f23={};_0x3b5f23[_0x5e0ee9[_0x2ce2('0x34')]]={'$like':'%'+_0x44f622[_0x2ce2('0x35')]['filter']+'%'};return _0x3b5f23;}})});}_0x137d06=_[_0x2ce2('0x43')]({},_0x137d06,_0x44f622[_0x2ce2('0x44')]);var _0x3f71d2={'where':_0x137d06['where']};return db[_0x2ce2('0x2e')][_0x2ce2('0x1f')](_0x3f71d2)[_0x2ce2('0x28')](function(_0x1f11cc){_0x2aa881[_0x2ce2('0x1f')]=_0x1f11cc;if(_0x44f622[_0x2ce2('0x35')][_0x2ce2('0x45')]){_0x137d06['include']=[{'all':!![]}];}return db['ChatQueueReport'][_0x2ce2('0x46')](_0x137d06);})[_0x2ce2('0x28')](function(_0x3a7d2b){_0x2aa881[_0x2ce2('0x47')]=_0x3a7d2b;return _0x2aa881;})[_0x2ce2('0x28')](respondWithFilteredResult(_0x15a245,_0x137d06))[_0x2ce2('0x48')](handleError(_0x15a245,null));};exports['show']=function(_0x611fe8,_0x2231d6){var _0x215a13={'raw':!![],'where':{'id':_0x611fe8['params']['id']}},_0x63000e={};_0x63000e['model']=_[_0x2ce2('0x49')](db[_0x2ce2('0x2e')][_0x2ce2('0x2f')]);_0x63000e['query']=_[_0x2ce2('0x49')](_0x611fe8[_0x2ce2('0x35')]);_0x63000e[_0x2ce2('0x36')]=_[_0x2ce2('0x38')](_0x63000e[_0x2ce2('0x33')],_0x63000e['query']);_0x215a13['attributes']=_[_0x2ce2('0x38')](_0x63000e[_0x2ce2('0x33')],qs[_0x2ce2('0x39')](_0x611fe8[_0x2ce2('0x35')][_0x2ce2('0x39')]));_0x215a13[_0x2ce2('0x37')]=_0x215a13['attributes']['length']?_0x215a13[_0x2ce2('0x37')]:_0x63000e[_0x2ce2('0x33')];if(_0x611fe8[_0x2ce2('0x35')][_0x2ce2('0x45')]){_0x215a13[_0x2ce2('0x4a')]=[{'all':!![]}];}_0x215a13=_[_0x2ce2('0x43')]({},_0x215a13,_0x611fe8['options']);return db[_0x2ce2('0x2e')][_0x2ce2('0x4b')](_0x215a13)['then'](handleEntityNotFound(_0x2231d6,null))[_0x2ce2('0x28')](respondWithResult(_0x2231d6,null))[_0x2ce2('0x48')](handleError(_0x2231d6,null));};exports[_0x2ce2('0x4c')]=function(_0x59f06b,_0x3b8458){return db[_0x2ce2('0x2e')][_0x2ce2('0x4c')](_0x59f06b['body'],{})['then'](respondWithResult(_0x3b8458,0xc9))[_0x2ce2('0x48')](handleError(_0x3b8458,null));};exports[_0x2ce2('0x27')]=function(_0x3cfeff,_0x3b50cc){if(_0x3cfeff[_0x2ce2('0x4d')]['id']){delete _0x3cfeff['body']['id'];}return db[_0x2ce2('0x2e')][_0x2ce2('0x4b')]({'where':{'id':_0x3cfeff[_0x2ce2('0x4e')]['id']}})[_0x2ce2('0x28')](handleEntityNotFound(_0x3b50cc,null))[_0x2ce2('0x28')](saveUpdates(_0x3cfeff[_0x2ce2('0x4d')],null))['then'](respondWithResult(_0x3b50cc,null))['catch'](handleError(_0x3b50cc,null));};exports[_0x2ce2('0x29')]=function(_0x1e4463,_0x381516){return db[_0x2ce2('0x2e')][_0x2ce2('0x4b')]({'where':{'id':_0x1e4463[_0x2ce2('0x4e')]['id']}})[_0x2ce2('0x28')](handleEntityNotFound(_0x381516,null))['then'](removeEntity(_0x381516,null))['catch'](handleError(_0x381516,null));};exports['describe']=function(_0x8f2768,_0x3a68ea){return db[_0x2ce2('0x2e')][_0x2ce2('0x4f')]()[_0x2ce2('0x28')](respondWithResult(_0x3a68ea,null))[_0x2ce2('0x48')](handleError(_0x3a68ea,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 5c9b17b..65da552 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(_0x12b449,_0x2b8a36){var _0x4e3784=function(_0xf2848c){while(--_0xf2848c){_0x12b449['push'](_0x12b449['shift']());}};_0x4e3784(++_0x2b8a36);}(_0xb10b,0x12a));var _0xbb10=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xb10b[_0x556bb1];return _0x45455f;};'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 _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x6f52ca,_0x4eb862){var _0x1a3961=function(_0x3a7e44){while(--_0x3a7e44){_0x6f52ca['push'](_0x6f52ca['shift']());}};_0x1a3961(++_0x4eb862);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0xcb91[_0x422be2];return _0x1b820e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 0ec031b..7e8181c 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 _0x901c=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','where','limit','UpdateChatQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x901c,0x15d));var _0xc901=function(_0x2338ba,_0x66aa63){_0x2338ba=_0x2338ba-0x0;var _0x2ff535=_0x901c[_0x2338ba];return _0x2ff535;};'use strict';var _=require('lodash');var util=require(_0xc901('0x0'));var moment=require(_0xc901('0x1'));var BPromise=require(_0xc901('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc901('0x3'));var db=require(_0xc901('0x4'))['db'];var utils=require(_0xc901('0x5'));var logger=require(_0xc901('0x6'))(_0xc901('0x7'));var config=require('../../config/environment');var jayson=require(_0xc901('0x8'));var client=jayson[_0xc901('0x9')][_0xc901('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bdce1,_0x18a232,_0x1eb098){return new BPromise(function(_0x835636,_0x5a0037){return client['request'](_0x1bdce1,_0x1eb098)[_0xc901('0xb')](function(_0xdb367f){logger[_0xc901('0xc')](_0xc901('0xd'),_0x18a232,_0xc901('0xe'));logger[_0xc901('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x18a232,_0xc901('0xe'),JSON[_0xc901('0x10')](_0xdb367f));if(_0xdb367f['error']){if(_0xdb367f[_0xc901('0x11')][_0xc901('0x12')]===0x1f4){logger['error'](_0xc901('0xd'),_0x18a232,_0xdb367f[_0xc901('0x11')]['message']);return _0x5a0037(_0xdb367f[_0xc901('0x11')][_0xc901('0x13')]);}logger[_0xc901('0x11')](_0xc901('0xd'),_0x18a232,_0xdb367f[_0xc901('0x11')]['message']);return _0x835636(_0xdb367f[_0xc901('0x11')][_0xc901('0x13')]);}else{logger[_0xc901('0xc')](_0xc901('0xd'),_0x18a232,_0xc901('0xe'));_0x835636(_0xdb367f[_0xc901('0x14')]['message']);}})[_0xc901('0x15')](function(_0x4b47cd){logger[_0xc901('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x18a232,_0x4b47cd);_0x5a0037(_0x4b47cd);});});}exports[_0xc901('0x16')]=function(_0xdb3e18){var _0x40a699=this;return new Promise(function(_0x1c7231,_0x2350fb){return db[_0xc901('0x17')][_0xc901('0x18')](_0xdb3e18[_0xc901('0x19')],{'raw':_0xdb3e18[_0xc901('0x1a')]?_0xdb3e18['options']['raw']===undefined?!![]:![]:!![]})[_0xc901('0xb')](function(_0x35df5b){logger[_0xc901('0xc')](_0xc901('0x16'),_0xdb3e18);logger[_0xc901('0xf')](_0xc901('0x16'),_0xdb3e18,JSON['stringify'](_0x35df5b));_0x1c7231(_0x35df5b);})[_0xc901('0x15')](function(_0x582fb6){logger['error'](_0xc901('0x16'),_0x582fb6[_0xc901('0x13')],_0xdb3e18);_0x2350fb(_0x40a699[_0xc901('0x11')](0x1f4,_0x582fb6[_0xc901('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x1f0d23){var _0x32dfc2=this;return new Promise(function(_0x4bfdab,_0x3deb38){return db['ChatQueueReport']['update'](_0x1f0d23[_0xc901('0x19')],{'raw':_0x1f0d23[_0xc901('0x1a')]?_0x1f0d23[_0xc901('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f0d23[_0xc901('0x1a')]?_0x1f0d23['options'][_0xc901('0x1b')]||null:null,'attributes':_0x1f0d23[_0xc901('0x1a')]?_0x1f0d23['options']['attributes']||null:null,'limit':_0x1f0d23['options']?_0x1f0d23[_0xc901('0x1a')][_0xc901('0x1c')]||null:null})['then'](function(_0x2533d9){logger['info']('UpdateChatQueueReport',_0x1f0d23);logger[_0xc901('0xf')](_0xc901('0x1d'),_0x1f0d23,JSON[_0xc901('0x10')](_0x2533d9));_0x4bfdab(_0x2533d9);})[_0xc901('0x15')](function(_0x4cd873){logger['error'](_0xc901('0x1d'),_0x4cd873[_0xc901('0x13')],_0x1f0d23);_0x3deb38(_0x32dfc2[_0xc901('0x11')](0x1f4,_0x4cd873['message']));});});}; \ No newline at end of file +var _0x05d0=['message','ChatQueueReport,\x20%s,\x20%s','result','catch','ChatQueueReport','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','update','options','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0x21e2ec,_0x342834){var _0x3d3519=function(_0xd18c59){while(--_0xd18c59){_0x21e2ec['push'](_0x21e2ec['shift']());}};_0x3d3519(++_0x342834);}(_0x05d0,0x85));var _0x005d=function(_0xd35e62,_0x431342){_0xd35e62=_0xd35e62-0x0;var _0x301048=_0x05d0[_0xd35e62];return _0x301048;};'use strict';var _=require(_0x005d('0x0'));var util=require(_0x005d('0x1'));var moment=require(_0x005d('0x2'));var BPromise=require(_0x005d('0x3'));var rs=require(_0x005d('0x4'));var fs=require('fs');var Redis=require(_0x005d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x005d('0x6'));var logger=require(_0x005d('0x7'))(_0x005d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x005d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c2167,_0x48c4d9,_0x414868){return new BPromise(function(_0x525220,_0x23fc62){return client[_0x005d('0xa')](_0x2c2167,_0x414868)[_0x005d('0xb')](function(_0x3e0973){logger[_0x005d('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x48c4d9,_0x005d('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x48c4d9,'request\x20sent',JSON[_0x005d('0xe')](_0x3e0973));if(_0x3e0973[_0x005d('0xf')]){if(_0x3e0973['error'][_0x005d('0x10')]===0x1f4){logger[_0x005d('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x48c4d9,_0x3e0973[_0x005d('0xf')]['message']);return _0x23fc62(_0x3e0973['error'][_0x005d('0x11')]);}logger[_0x005d('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x48c4d9,_0x3e0973[_0x005d('0xf')][_0x005d('0x11')]);return _0x525220(_0x3e0973[_0x005d('0xf')]['message']);}else{logger[_0x005d('0xc')](_0x005d('0x12'),_0x48c4d9,_0x005d('0xd'));_0x525220(_0x3e0973[_0x005d('0x13')]['message']);}})[_0x005d('0x14')](function(_0x54b486){logger[_0x005d('0xf')](_0x005d('0x12'),_0x48c4d9,_0x54b486);_0x23fc62(_0x54b486);});});}exports['CreateChatQueueReport']=function(_0x4f6653){var _0x44c131=this;return new Promise(function(_0x1ce099,_0x57a087){return db[_0x005d('0x15')]['create'](_0x4f6653['body'],{'raw':_0x4f6653['options']?_0x4f6653['options'][_0x005d('0x16')]===undefined?!![]:![]:!![]})[_0x005d('0xb')](function(_0x12765f){logger['info'](_0x005d('0x17'),_0x4f6653);logger[_0x005d('0x18')](_0x005d('0x17'),_0x4f6653,JSON['stringify'](_0x12765f));_0x1ce099(_0x12765f);})['catch'](function(_0x4364a1){logger[_0x005d('0xf')]('CreateChatQueueReport',_0x4364a1[_0x005d('0x11')],_0x4f6653);_0x57a087(_0x44c131['error'](0x1f4,_0x4364a1[_0x005d('0x11')]));});});};exports[_0x005d('0x19')]=function(_0x2366ae){var _0x4196b7=this;return new Promise(function(_0x4e5b69,_0x28b31c){return db[_0x005d('0x15')][_0x005d('0x1a')](_0x2366ae['body'],{'raw':_0x2366ae[_0x005d('0x1b')]?_0x2366ae[_0x005d('0x1b')][_0x005d('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2366ae[_0x005d('0x1b')]?_0x2366ae['options']['where']||null:null,'attributes':_0x2366ae[_0x005d('0x1b')]?_0x2366ae[_0x005d('0x1b')][_0x005d('0x1c')]||null:null,'limit':_0x2366ae[_0x005d('0x1b')]?_0x2366ae[_0x005d('0x1b')][_0x005d('0x1d')]||null:null})['then'](function(_0x1bcd0c){logger[_0x005d('0xc')](_0x005d('0x19'),_0x2366ae);logger[_0x005d('0x18')](_0x005d('0x19'),_0x2366ae,JSON[_0x005d('0xe')](_0x1bcd0c));_0x4e5b69(_0x1bcd0c);})['catch'](function(_0x2926a1){logger['error'](_0x005d('0x19'),_0x2926a1[_0x005d('0x11')],_0x2366ae);_0x28b31c(_0x4196b7[_0x005d('0xf')](0x1f4,_0x2926a1[_0x005d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 90e0271..f5a745f 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 _0x47af=['put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x5ad31b,_0x610710){var _0x3d8c2e=function(_0x5b1b75){while(--_0x5b1b75){_0x5ad31b['push'](_0x5ad31b['shift']());}};_0x3d8c2e(++_0x610710);}(_0x47af,0x1f2));var _0xf47a=function(_0x7e706c,_0x24677c){_0x7e706c=_0x7e706c-0x0;var _0x90813d=_0x47af[_0x7e706c];return _0x90813d;};'use strict';var multer=require(_0xf47a('0x0'));var util=require('util');var path=require(_0xf47a('0x1'));var timeout=require(_0xf47a('0x2'));var express=require(_0xf47a('0x3'));var router=express['Router']();var fs_extra=require(_0xf47a('0x4'));var auth=require(_0xf47a('0x5'));var interaction=require(_0xf47a('0x6'));var config=require(_0xf47a('0x7'));var controller=require('./chatQueueReport.controller');router[_0xf47a('0x8')]('/',auth[_0xf47a('0x9')](),controller[_0xf47a('0xa')]);router[_0xf47a('0x8')](_0xf47a('0xb'),auth[_0xf47a('0x9')](),controller['describe']);router[_0xf47a('0x8')](_0xf47a('0xc'),auth[_0xf47a('0x9')](),controller[_0xf47a('0xd')]);router['post']('/',auth[_0xf47a('0x9')](),controller[_0xf47a('0xe')]);router[_0xf47a('0xf')](_0xf47a('0xc'),auth[_0xf47a('0x9')](),controller[_0xf47a('0x10')]);router[_0xf47a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf47a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x0a3a=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy','exports'];(function(_0x1240db,_0x534893){var _0x37ec62=function(_0x2d929c){while(--_0x2d929c){_0x1240db['push'](_0x1240db['shift']());}};_0x37ec62(++_0x534893);}(_0x0a3a,0x154));var _0xa0a3=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0x0a3a[_0x22bdd3];return _0x44d9d9;};'use strict';var multer=require(_0xa0a3('0x0'));var util=require(_0xa0a3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa0a3('0x2'));var router=express['Router']();var fs_extra=require(_0xa0a3('0x3'));var auth=require(_0xa0a3('0x4'));var interaction=require(_0xa0a3('0x5'));var config=require(_0xa0a3('0x6'));var controller=require(_0xa0a3('0x7'));router[_0xa0a3('0x8')]('/',auth[_0xa0a3('0x9')](),controller[_0xa0a3('0xa')]);router[_0xa0a3('0x8')](_0xa0a3('0xb'),auth[_0xa0a3('0x9')](),controller[_0xa0a3('0xc')]);router[_0xa0a3('0x8')](_0xa0a3('0xd'),auth[_0xa0a3('0x9')](),controller[_0xa0a3('0xe')]);router['post']('/',auth[_0xa0a3('0x9')](),controller['create']);router[_0xa0a3('0xf')](_0xa0a3('0xd'),auth[_0xa0a3('0x9')](),controller[_0xa0a3('0x10')]);router[_0xa0a3('0x11')](_0xa0a3('0xd'),auth[_0xa0a3('0x9')](),controller[_0xa0a3('0x12')]);module[_0xa0a3('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index fd7ce10..33cd979 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x6173fc,_0x32aadf){var _0x965fbe=function(_0x50d5b3){while(--_0x50d5b3){_0x6173fc['push'](_0x6173fc['shift']());}};_0x965fbe(++_0x32aadf);}(_0xb43b,0x1b2));var _0xbb43=function(_0x3812cd,_0x51c78a){_0x3812cd=_0x3812cd-0x0;var _0x535d08=_0xb43b[_0x3812cd];return _0x535d08;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5459f5,_0x2c07ef){var _0x5d5346=function(_0x3e1fcb){while(--_0x3e1fcb){_0x5459f5['push'](_0x5459f5['shift']());}};_0x5d5346(++_0x2c07ef);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xcb91[_0x1b4b23];return _0x2a325b;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index cd46b41..a199f68 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 _0x7653=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','filter','includeAll','include','rows','catch','show','params','keys','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','jsforce','to-csv','papaparse','../../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','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x7653,0x140));var _0x3765=function(_0x4452dc,_0x479149){_0x4452dc=_0x4452dc-0x0;var _0x52b892=_0x7653[_0x4452dc];return _0x52b892;};'use strict';var emlformat=require(_0x3765('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3765('0x1'));var jsonpatch=require(_0x3765('0x2'));var rp=require(_0x3765('0x3'));var moment=require(_0x3765('0x4'));var BPromise=require(_0x3765('0x5'));var Mustache=require('mustache');var util=require(_0x3765('0x6'));var path=require('path');var sox=require(_0x3765('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3765('0x8'));var _=require(_0x3765('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3765('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3765('0xb'));var querystring=require('querystring');var Papa=require(_0x3765('0xc'));var Redis=require('ioredis');var authService=require(_0x3765('0xd'));var qs=require(_0x3765('0xe'));var as=require(_0x3765('0xf'));var hardwareService=require(_0x3765('0x10'));var logger=require('../../config/logger')(_0x3765('0x11'));var utils=require(_0x3765('0x12'));var config=require(_0x3765('0x13'));var licenseUtil=require(_0x3765('0x14'));var db=require(_0x3765('0x15'))['db'];function respondWithStatusCode(_0x30a364,_0xab6e69){_0xab6e69=_0xab6e69||0xcc;return function(_0x4d5753){if(_0x4d5753){return _0x30a364[_0x3765('0x16')](_0xab6e69);}return _0x30a364[_0x3765('0x17')](_0xab6e69)[_0x3765('0x18')]();};}function respondWithResult(_0xc62ddd,_0x568653){_0x568653=_0x568653||0xc8;return function(_0x4ddc00){if(_0x4ddc00){return _0xc62ddd[_0x3765('0x17')](_0x568653)[_0x3765('0x19')](_0x4ddc00);}};}function respondWithFilteredResult(_0x3bf860,_0x13926b){return function(_0x2fd951){if(_0x2fd951){var _0xf46d67=typeof _0x13926b['offset']===_0x3765('0x1a')&&typeof _0x13926b[_0x3765('0x1b')]==='undefined';var _0x4a7593=_0x2fd951['count'];var _0x42e9a3=_0xf46d67?0x0:_0x13926b[_0x3765('0x1c')];var _0x574bd3=_0xf46d67?_0x2fd951[_0x3765('0x1d')]:_0x13926b[_0x3765('0x1c')]+_0x13926b['limit'];var _0x251a53;if(_0x574bd3>=_0x4a7593){_0x574bd3=_0x4a7593;_0x251a53=0xc8;}else{_0x251a53=0xce;}_0x3bf860[_0x3765('0x17')](_0x251a53);return _0x3bf860['set'](_0x3765('0x1e'),_0x42e9a3+'-'+_0x574bd3+'/'+_0x4a7593)['json'](_0x2fd951);}return null;};}function patchUpdates(_0x514342){return function(_0x4de8da){try{jsonpatch[_0x3765('0x1f')](_0x4de8da,_0x514342,!![]);}catch(_0x2f0489){return BPromise[_0x3765('0x20')](_0x2f0489);}return _0x4de8da[_0x3765('0x21')]();};}function saveUpdates(_0x1065c6,_0x25f553){return function(_0x18eccf){if(_0x18eccf){return _0x18eccf[_0x3765('0x22')](_0x1065c6)[_0x3765('0x23')](function(_0x972fff){return _0x972fff;});}return null;};}function removeEntity(_0x3ccc21,_0x5bd2d9){return function(_0x129d15){if(_0x129d15){return _0x129d15[_0x3765('0x24')]()[_0x3765('0x23')](function(){_0x3ccc21[_0x3765('0x17')](0xcc)[_0x3765('0x18')]();});}};}function handleEntityNotFound(_0x5baa8d,_0x4aeb39){return function(_0x3d0a59){if(!_0x3d0a59){_0x5baa8d['sendStatus'](0x194);}return _0x3d0a59;};}function handleError(_0x4f993b,_0x1e8947){_0x1e8947=_0x1e8947||0x1f4;return function(_0x5f060f){logger[_0x3765('0x25')](_0x5f060f[_0x3765('0x26')]);if(_0x5f060f[_0x3765('0x27')]){delete _0x5f060f['name'];}_0x4f993b[_0x3765('0x17')](_0x1e8947)['send'](_0x5f060f);};}exports[_0x3765('0x28')]=function(_0x2fa8f1,_0xfc9f2b){var _0x4075ee={},_0x38c393={},_0x33cf55={'count':0x0,'rows':[]};var _0x2d8bf2=_[_0x3765('0x29')](db[_0x3765('0x2a')][_0x3765('0x2b')],function(_0x241b9e){return{'name':_0x241b9e[_0x3765('0x2c')],'type':_0x241b9e[_0x3765('0x2d')][_0x3765('0x2e')]};});_0x38c393[_0x3765('0x2f')]=_['map'](_0x2d8bf2,'name');_0x38c393[_0x3765('0x30')]=_['keys'](_0x2fa8f1[_0x3765('0x30')]);_0x38c393[_0x3765('0x31')]=_[_0x3765('0x32')](_0x38c393[_0x3765('0x2f')],_0x38c393[_0x3765('0x30')]);_0x4075ee[_0x3765('0x33')]=_[_0x3765('0x32')](_0x38c393[_0x3765('0x2f')],qs[_0x3765('0x34')](_0x2fa8f1['query'][_0x3765('0x34')]));_0x4075ee['attributes']=_0x4075ee[_0x3765('0x33')][_0x3765('0x35')]?_0x4075ee[_0x3765('0x33')]:_0x38c393[_0x3765('0x2f')];if(!_0x2fa8f1[_0x3765('0x30')][_0x3765('0x36')](_0x3765('0x37'))){_0x4075ee[_0x3765('0x1b')]=qs['limit'](_0x2fa8f1[_0x3765('0x30')][_0x3765('0x1b')]);_0x4075ee[_0x3765('0x1c')]=qs['offset'](_0x2fa8f1[_0x3765('0x30')]['offset']);}_0x4075ee['order']=qs[_0x3765('0x38')](_0x2fa8f1[_0x3765('0x30')][_0x3765('0x38')]);_0x4075ee['where']=qs['filters'](_[_0x3765('0x39')](_0x2fa8f1['query'],_0x38c393[_0x3765('0x31')]),_0x2d8bf2);if(_0x2fa8f1[_0x3765('0x30')]['filter']){_0x4075ee[_0x3765('0x3a')]=_[_0x3765('0x3b')](_0x4075ee[_0x3765('0x3a')],{'$or':_[_0x3765('0x29')](_0x2d8bf2,function(_0x1038cc){if(_0x1038cc['type']!=='VIRTUAL'){var _0x599799={};_0x599799[_0x1038cc[_0x3765('0x27')]]={'$like':'%'+_0x2fa8f1[_0x3765('0x30')][_0x3765('0x3c')]+'%'};return _0x599799;}})});}_0x4075ee=_[_0x3765('0x3b')]({},_0x4075ee,_0x2fa8f1['options']);var _0x19edf2={'where':_0x4075ee[_0x3765('0x3a')]};return db[_0x3765('0x2a')][_0x3765('0x1d')](_0x19edf2)[_0x3765('0x23')](function(_0x294708){_0x33cf55[_0x3765('0x1d')]=_0x294708;if(_0x2fa8f1[_0x3765('0x30')][_0x3765('0x3d')]){_0x4075ee[_0x3765('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x4075ee);})['then'](function(_0x3f095f){_0x33cf55[_0x3765('0x3f')]=_0x3f095f;return _0x33cf55;})[_0x3765('0x23')](respondWithFilteredResult(_0xfc9f2b,_0x4075ee))[_0x3765('0x40')](handleError(_0xfc9f2b,null));};exports[_0x3765('0x41')]=function(_0x429ea7,_0x447097){var _0x2d801e={'raw':!![],'where':{'id':_0x429ea7[_0x3765('0x42')]['id']}},_0x45f593={};_0x45f593[_0x3765('0x2f')]=_[_0x3765('0x43')](db[_0x3765('0x2a')]['rawAttributes']);_0x45f593[_0x3765('0x30')]=_[_0x3765('0x43')](_0x429ea7['query']);_0x45f593['filters']=_['intersection'](_0x45f593[_0x3765('0x2f')],_0x45f593['query']);_0x2d801e[_0x3765('0x33')]=_[_0x3765('0x32')](_0x45f593['model'],qs['fields'](_0x429ea7['query'][_0x3765('0x34')]));_0x2d801e[_0x3765('0x33')]=_0x2d801e[_0x3765('0x33')][_0x3765('0x35')]?_0x2d801e[_0x3765('0x33')]:_0x45f593[_0x3765('0x2f')];if(_0x429ea7[_0x3765('0x30')][_0x3765('0x3d')]){_0x2d801e[_0x3765('0x3e')]=[{'all':!![]}];}_0x2d801e=_[_0x3765('0x3b')]({},_0x2d801e,_0x429ea7[_0x3765('0x44')]);return db['ChatTransferReport'][_0x3765('0x45')](_0x2d801e)['then'](handleEntityNotFound(_0x447097,null))[_0x3765('0x23')](respondWithResult(_0x447097,null))['catch'](handleError(_0x447097,null));};exports[_0x3765('0x46')]=function(_0x18084f,_0x52b601){return db[_0x3765('0x2a')][_0x3765('0x46')](_0x18084f[_0x3765('0x47')],{})[_0x3765('0x23')](respondWithResult(_0x52b601,0xc9))[_0x3765('0x40')](handleError(_0x52b601,null));};exports[_0x3765('0x22')]=function(_0x4882f8,_0x1d2282){if(_0x4882f8['body']['id']){delete _0x4882f8[_0x3765('0x47')]['id'];}return db[_0x3765('0x2a')][_0x3765('0x45')]({'where':{'id':_0x4882f8[_0x3765('0x42')]['id']}})[_0x3765('0x23')](handleEntityNotFound(_0x1d2282,null))[_0x3765('0x23')](saveUpdates(_0x4882f8[_0x3765('0x47')],null))[_0x3765('0x23')](respondWithResult(_0x1d2282,null))[_0x3765('0x40')](handleError(_0x1d2282,null));};exports[_0x3765('0x24')]=function(_0x58c25a,_0x29b097){return db[_0x3765('0x2a')][_0x3765('0x45')]({'where':{'id':_0x58c25a[_0x3765('0x42')]['id']}})[_0x3765('0x23')](handleEntityNotFound(_0x29b097,null))[_0x3765('0x23')](removeEntity(_0x29b097,null))[_0x3765('0x40')](handleError(_0x29b097,null));};exports['describe']=function(_0x2cc772,_0xb61d71){return db[_0x3765('0x2a')][_0x3765('0x48')]()[_0x3765('0x23')](respondWithResult(_0xb61d71,null))['catch'](handleError(_0xb61d71,null));}; \ No newline at end of file +var _0x16e7=['params','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show'];(function(_0x3ff3e9,_0x18e3a9){var _0x39df82=function(_0x27722f){while(--_0x27722f){_0x3ff3e9['push'](_0x3ff3e9['shift']());}};_0x39df82(++_0x18e3a9);}(_0x16e7,0x17d));var _0x716e=function(_0x388baf,_0x53b5f0){_0x388baf=_0x388baf-0x0;var _0x50d854=_0x16e7[_0x388baf];return _0x50d854;};'use strict';var emlformat=require(_0x716e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x716e('0x1'));var jsonpatch=require(_0x716e('0x2'));var rp=require('request-promise');var moment=require(_0x716e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x716e('0x4'));var util=require(_0x716e('0x5'));var path=require('path');var sox=require(_0x716e('0x6'));var csv=require(_0x716e('0x7'));var ejs=require(_0x716e('0x8'));var fs=require('fs');var fs_extra=require(_0x716e('0x9'));var _=require(_0x716e('0xa'));var squel=require(_0x716e('0xb'));var crypto=require(_0x716e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x716e('0xd'));var toCsv=require(_0x716e('0x7'));var querystring=require(_0x716e('0xe'));var Papa=require('papaparse');var Redis=require(_0x716e('0xf'));var authService=require(_0x716e('0x10'));var qs=require(_0x716e('0x11'));var as=require(_0x716e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x716e('0x13'))(_0x716e('0x14'));var utils=require(_0x716e('0x15'));var config=require(_0x716e('0x16'));var licenseUtil=require(_0x716e('0x17'));var db=require(_0x716e('0x18'))['db'];function respondWithStatusCode(_0x2bd988,_0x327d1a){_0x327d1a=_0x327d1a||0xcc;return function(_0x3c3e4f){if(_0x3c3e4f){return _0x2bd988[_0x716e('0x19')](_0x327d1a);}return _0x2bd988[_0x716e('0x1a')](_0x327d1a)['end']();};}function respondWithResult(_0x441cf9,_0x40396){_0x40396=_0x40396||0xc8;return function(_0x320ca0){if(_0x320ca0){return _0x441cf9[_0x716e('0x1a')](_0x40396)['json'](_0x320ca0);}};}function respondWithFilteredResult(_0x33b8f0,_0x269582){return function(_0x2d015b){if(_0x2d015b){var _0x88e854=typeof _0x269582[_0x716e('0x1b')]===_0x716e('0x1c')&&typeof _0x269582[_0x716e('0x1d')]===_0x716e('0x1c');var _0x18524a=_0x2d015b[_0x716e('0x1e')];var _0x335e77=_0x88e854?0x0:_0x269582[_0x716e('0x1b')];var _0x19f4e2=_0x88e854?_0x2d015b[_0x716e('0x1e')]:_0x269582[_0x716e('0x1b')]+_0x269582[_0x716e('0x1d')];var _0x2c4df6;if(_0x19f4e2>=_0x18524a){_0x19f4e2=_0x18524a;_0x2c4df6=0xc8;}else{_0x2c4df6=0xce;}_0x33b8f0[_0x716e('0x1a')](_0x2c4df6);return _0x33b8f0[_0x716e('0x1f')](_0x716e('0x20'),_0x335e77+'-'+_0x19f4e2+'/'+_0x18524a)[_0x716e('0x21')](_0x2d015b);}return null;};}function patchUpdates(_0x5656bc){return function(_0x5d3df4){try{jsonpatch[_0x716e('0x22')](_0x5d3df4,_0x5656bc,!![]);}catch(_0x5c5c63){return BPromise[_0x716e('0x23')](_0x5c5c63);}return _0x5d3df4[_0x716e('0x24')]();};}function saveUpdates(_0xf31142,_0x51bd1b){return function(_0x4f766c){if(_0x4f766c){return _0x4f766c[_0x716e('0x25')](_0xf31142)[_0x716e('0x26')](function(_0x1738be){return _0x1738be;});}return null;};}function removeEntity(_0x2574cd,_0x1b6c40){return function(_0x360dc4){if(_0x360dc4){return _0x360dc4[_0x716e('0x27')]()['then'](function(){_0x2574cd[_0x716e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x436a66,_0x316a81){return function(_0x1e0e14){if(!_0x1e0e14){_0x436a66[_0x716e('0x19')](0x194);}return _0x1e0e14;};}function handleError(_0x671f26,_0xa7e7d9){_0xa7e7d9=_0xa7e7d9||0x1f4;return function(_0x454b4b){logger['error'](_0x454b4b[_0x716e('0x28')]);if(_0x454b4b[_0x716e('0x29')]){delete _0x454b4b[_0x716e('0x29')];}_0x671f26[_0x716e('0x1a')](_0xa7e7d9)[_0x716e('0x2a')](_0x454b4b);};}exports['index']=function(_0x5a73f6,_0x3cb92c){var _0xe61bb5={},_0x101399={},_0x33b21a={'count':0x0,'rows':[]};var _0x10dfdd=_[_0x716e('0x2b')](db[_0x716e('0x2c')][_0x716e('0x2d')],function(_0x1e831d){return{'name':_0x1e831d[_0x716e('0x2e')],'type':_0x1e831d[_0x716e('0x2f')]['key']};});_0x101399[_0x716e('0x30')]=_[_0x716e('0x2b')](_0x10dfdd,_0x716e('0x29'));_0x101399[_0x716e('0x31')]=_[_0x716e('0x32')](_0x5a73f6[_0x716e('0x31')]);_0x101399[_0x716e('0x33')]=_[_0x716e('0x34')](_0x101399[_0x716e('0x30')],_0x101399['query']);_0xe61bb5[_0x716e('0x35')]=_['intersection'](_0x101399['model'],qs[_0x716e('0x36')](_0x5a73f6[_0x716e('0x31')][_0x716e('0x36')]));_0xe61bb5[_0x716e('0x35')]=_0xe61bb5['attributes'][_0x716e('0x37')]?_0xe61bb5[_0x716e('0x35')]:_0x101399[_0x716e('0x30')];if(!_0x5a73f6[_0x716e('0x31')][_0x716e('0x38')]('nolimit')){_0xe61bb5[_0x716e('0x1d')]=qs[_0x716e('0x1d')](_0x5a73f6[_0x716e('0x31')][_0x716e('0x1d')]);_0xe61bb5['offset']=qs[_0x716e('0x1b')](_0x5a73f6['query'][_0x716e('0x1b')]);}_0xe61bb5['order']=qs[_0x716e('0x39')](_0x5a73f6[_0x716e('0x31')]['sort']);_0xe61bb5['where']=qs[_0x716e('0x33')](_[_0x716e('0x3a')](_0x5a73f6[_0x716e('0x31')],_0x101399[_0x716e('0x33')]),_0x10dfdd);if(_0x5a73f6[_0x716e('0x31')][_0x716e('0x3b')]){_0xe61bb5['where']=_['merge'](_0xe61bb5[_0x716e('0x3c')],{'$or':_[_0x716e('0x2b')](_0x10dfdd,function(_0x4af193){if(_0x4af193[_0x716e('0x2f')]!==_0x716e('0x3d')){var _0x4a89e0={};_0x4a89e0[_0x4af193[_0x716e('0x29')]]={'$like':'%'+_0x5a73f6[_0x716e('0x31')]['filter']+'%'};return _0x4a89e0;}})});}_0xe61bb5=_[_0x716e('0x3e')]({},_0xe61bb5,_0x5a73f6[_0x716e('0x3f')]);var _0x451291={'where':_0xe61bb5[_0x716e('0x3c')]};return db[_0x716e('0x2c')]['count'](_0x451291)[_0x716e('0x26')](function(_0x2b00c0){_0x33b21a['count']=_0x2b00c0;if(_0x5a73f6[_0x716e('0x31')][_0x716e('0x40')]){_0xe61bb5['include']=[{'all':!![]}];}return db[_0x716e('0x2c')][_0x716e('0x41')](_0xe61bb5);})[_0x716e('0x26')](function(_0x4d66a6){_0x33b21a[_0x716e('0x42')]=_0x4d66a6;return _0x33b21a;})['then'](respondWithFilteredResult(_0x3cb92c,_0xe61bb5))[_0x716e('0x43')](handleError(_0x3cb92c,null));};exports[_0x716e('0x44')]=function(_0x22f61c,_0x4e36ea){var _0xd28bc4={'raw':!![],'where':{'id':_0x22f61c[_0x716e('0x45')]['id']}},_0x59cd8b={};_0x59cd8b[_0x716e('0x30')]=_['keys'](db['ChatTransferReport'][_0x716e('0x2d')]);_0x59cd8b[_0x716e('0x31')]=_['keys'](_0x22f61c[_0x716e('0x31')]);_0x59cd8b[_0x716e('0x33')]=_[_0x716e('0x34')](_0x59cd8b[_0x716e('0x30')],_0x59cd8b[_0x716e('0x31')]);_0xd28bc4['attributes']=_[_0x716e('0x34')](_0x59cd8b[_0x716e('0x30')],qs['fields'](_0x22f61c[_0x716e('0x31')][_0x716e('0x36')]));_0xd28bc4[_0x716e('0x35')]=_0xd28bc4[_0x716e('0x35')][_0x716e('0x37')]?_0xd28bc4[_0x716e('0x35')]:_0x59cd8b[_0x716e('0x30')];if(_0x22f61c[_0x716e('0x31')][_0x716e('0x40')]){_0xd28bc4[_0x716e('0x46')]=[{'all':!![]}];}_0xd28bc4=_[_0x716e('0x3e')]({},_0xd28bc4,_0x22f61c[_0x716e('0x3f')]);return db[_0x716e('0x2c')][_0x716e('0x47')](_0xd28bc4)[_0x716e('0x26')](handleEntityNotFound(_0x4e36ea,null))[_0x716e('0x26')](respondWithResult(_0x4e36ea,null))['catch'](handleError(_0x4e36ea,null));};exports[_0x716e('0x48')]=function(_0x5c9152,_0x156892){return db[_0x716e('0x2c')][_0x716e('0x48')](_0x5c9152['body'],{})['then'](respondWithResult(_0x156892,0xc9))['catch'](handleError(_0x156892,null));};exports[_0x716e('0x25')]=function(_0x173ff6,_0x2a337e){if(_0x173ff6[_0x716e('0x49')]['id']){delete _0x173ff6[_0x716e('0x49')]['id'];}return db[_0x716e('0x2c')]['find']({'where':{'id':_0x173ff6[_0x716e('0x45')]['id']}})[_0x716e('0x26')](handleEntityNotFound(_0x2a337e,null))[_0x716e('0x26')](saveUpdates(_0x173ff6[_0x716e('0x49')],null))[_0x716e('0x26')](respondWithResult(_0x2a337e,null))[_0x716e('0x43')](handleError(_0x2a337e,null));};exports[_0x716e('0x27')]=function(_0x3f541a,_0x2b4fa2){return db['ChatTransferReport'][_0x716e('0x47')]({'where':{'id':_0x3f541a['params']['id']}})[_0x716e('0x26')](handleEntityNotFound(_0x2b4fa2,null))[_0x716e('0x26')](removeEntity(_0x2b4fa2,null))['catch'](handleError(_0x2b4fa2,null));};exports[_0x716e('0x4a')]=function(_0x511aa3,_0x5cf0b1){return db[_0x716e('0x2c')][_0x716e('0x4a')]()[_0x716e('0x26')](respondWithResult(_0x5cf0b1,null))[_0x716e('0x43')](handleError(_0x5cf0b1,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 0bc44a1..501c561 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 _0xf892=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','report_chat_transfer','uniqueid','lodash'];(function(_0x23b1cb,_0x43a5ea){var _0x3317e3=function(_0xe440ce){while(--_0xe440ce){_0x23b1cb['push'](_0x23b1cb['shift']());}};_0x3317e3(++_0x43a5ea);}(_0xf892,0x6b));var _0x2f89=function(_0x42f6b1,_0x560c04){_0x42f6b1=_0x42f6b1-0x0;var _0x39b69f=_0xf892[_0x42f6b1];return _0x39b69f;};'use strict';var _=require(_0x2f89('0x0'));var util=require(_0x2f89('0x1'));var logger=require(_0x2f89('0x2'))(_0x2f89('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f89('0x4'));var fs=require('fs');var path=require(_0x2f89('0x5'));var rimraf=require(_0x2f89('0x6'));var config=require(_0x2f89('0x7'));var attributes=require(_0x2f89('0x8'));module['exports']=function(_0x21f72f,_0x59c9e9){return _0x21f72f[_0x2f89('0x9')]('ChatTransferReport',attributes,{'tableName':_0x2f89('0xa'),'paranoid':![],'indexes':[{'name':_0x2f89('0xb'),'fields':[_0x2f89('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x373a=['util','api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x5bc58c,_0x48f4ca){var _0x54f713=function(_0x45e3b2){while(--_0x45e3b2){_0x5bc58c['push'](_0x5bc58c['shift']());}};_0x54f713(++_0x48f4ca);}(_0x373a,0x19f));var _0xa373=function(_0x89a589,_0xbc3145){_0x89a589=_0x89a589-0x0;var _0x2a34e5=_0x373a[_0x89a589];return _0x2a34e5;};'use strict';var _=require(_0xa373('0x0'));var util=require(_0xa373('0x1'));var logger=require('../../config/logger')(_0xa373('0x2'));var moment=require(_0xa373('0x3'));var BPromise=require('bluebird');var rp=require(_0xa373('0x4'));var fs=require('fs');var path=require(_0xa373('0x5'));var rimraf=require(_0xa373('0x6'));var config=require(_0xa373('0x7'));var attributes=require(_0xa373('0x8'));module[_0xa373('0x9')]=function(_0x7178ab,_0x425c28){return _0x7178ab['define'](_0xa373('0xa'),attributes,{'tableName':_0xa373('0xb'),'paranoid':![],'indexes':[{'name':_0xa373('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 42d3ea1..d0feca5 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 _0x9dd6=['message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x402ea6,_0x1fe9ac){var _0x49a024=function(_0x4e5656){while(--_0x4e5656){_0x402ea6['push'](_0x402ea6['shift']());}};_0x49a024(++_0x1fe9ac);}(_0x9dd6,0xca));var _0x69dd=function(_0x168c18,_0x3e85fa){_0x168c18=_0x168c18-0x0;var _0x3b7b99=_0x9dd6[_0x168c18];return _0x3b7b99;};'use strict';var _=require(_0x69dd('0x0'));var util=require(_0x69dd('0x1'));var moment=require(_0x69dd('0x2'));var BPromise=require(_0x69dd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69dd('0x4'));var db=require(_0x69dd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69dd('0x6'))('rpc');var config=require(_0x69dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x69dd('0x8')][_0x69dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3083c4,_0x58a289,_0x206829){return new BPromise(function(_0x341f9d,_0x5e3cb1){return client['request'](_0x3083c4,_0x206829)['then'](function(_0x1e1cef){logger[_0x69dd('0xa')](_0x69dd('0xb'),_0x58a289,'request\x20sent');logger[_0x69dd('0xc')](_0x69dd('0xd'),_0x58a289,_0x69dd('0xe'),JSON[_0x69dd('0xf')](_0x1e1cef));if(_0x1e1cef[_0x69dd('0x10')]){if(_0x1e1cef[_0x69dd('0x10')][_0x69dd('0x11')]===0x1f4){logger[_0x69dd('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x58a289,_0x1e1cef['error'][_0x69dd('0x12')]);return _0x5e3cb1(_0x1e1cef[_0x69dd('0x10')][_0x69dd('0x12')]);}logger[_0x69dd('0x10')](_0x69dd('0xb'),_0x58a289,_0x1e1cef['error'][_0x69dd('0x12')]);return _0x341f9d(_0x1e1cef['error']['message']);}else{logger['info'](_0x69dd('0xb'),_0x58a289,_0x69dd('0xe'));_0x341f9d(_0x1e1cef['result'][_0x69dd('0x12')]);}})[_0x69dd('0x13')](function(_0x583ff6){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x58a289,_0x583ff6);_0x5e3cb1(_0x583ff6);});});} \ No newline at end of file +var _0x55d9=['catch','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','result'];(function(_0x21d0c3,_0x16c71c){var _0x4df18e=function(_0x576bfe){while(--_0x576bfe){_0x21d0c3['push'](_0x21d0c3['shift']());}};_0x4df18e(++_0x16c71c);}(_0x55d9,0xab));var _0x955d=function(_0x5e5c64,_0x19b9fb){_0x5e5c64=_0x5e5c64-0x0;var _0x1bf287=_0x55d9[_0x5e5c64];return _0x1bf287;};'use strict';var _=require(_0x955d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x955d('0x1'));var db=require(_0x955d('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x955d('0x3'))('rpc');var config=require(_0x955d('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x955d('0x5')][_0x955d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1ac324,_0xff52d8,_0x2ef30c){return new BPromise(function(_0x8c4308,_0xbcf186){return client['request'](_0x1ac324,_0x2ef30c)['then'](function(_0x1234c6){logger[_0x955d('0x7')]('ChatTransferReport,\x20%s,\x20%s',_0xff52d8,_0x955d('0x8'));logger[_0x955d('0x9')](_0x955d('0xa'),_0xff52d8,_0x955d('0x8'),JSON['stringify'](_0x1234c6));if(_0x1234c6[_0x955d('0xb')]){if(_0x1234c6[_0x955d('0xb')][_0x955d('0xc')]===0x1f4){logger[_0x955d('0xb')](_0x955d('0xd'),_0xff52d8,_0x1234c6[_0x955d('0xb')][_0x955d('0xe')]);return _0xbcf186(_0x1234c6[_0x955d('0xb')]['message']);}logger['error'](_0x955d('0xd'),_0xff52d8,_0x1234c6[_0x955d('0xb')]['message']);return _0x8c4308(_0x1234c6[_0x955d('0xb')][_0x955d('0xe')]);}else{logger[_0x955d('0x7')]('ChatTransferReport,\x20%s,\x20%s',_0xff52d8,_0x955d('0x8'));_0x8c4308(_0x1234c6[_0x955d('0xf')][_0x955d('0xe')]);}})[_0x955d('0x10')](function(_0x339d85){logger['error'](_0x955d('0xd'),_0xff52d8,_0x339d85);_0xbcf186(_0x339d85);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index e671519..81a254c 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 _0x062f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x101871,_0x21fe27){var _0x44dd70=function(_0x347064){while(--_0x347064){_0x101871['push'](_0x101871['shift']());}};_0x44dd70(++_0x21fe27);}(_0x062f,0xba));var _0xf062=function(_0x1236f7,_0x50c076){_0x1236f7=_0x1236f7-0x0;var _0x10bc30=_0x062f[_0x1236f7];return _0x10bc30;};'use strict';var multer=require(_0xf062('0x0'));var util=require('util');var path=require(_0xf062('0x1'));var timeout=require(_0xf062('0x2'));var express=require(_0xf062('0x3'));var router=express['Router']();var fs_extra=require(_0xf062('0x4'));var auth=require(_0xf062('0x5'));var interaction=require(_0xf062('0x6'));var config=require(_0xf062('0x7'));var controller=require(_0xf062('0x8'));router[_0xf062('0x9')]('/',auth[_0xf062('0xa')](),controller[_0xf062('0xb')]);router[_0xf062('0x9')]('/describe',auth[_0xf062('0xa')](),controller['describe']);router[_0xf062('0x9')]('/:id',auth[_0xf062('0xa')](),controller[_0xf062('0xc')]);router[_0xf062('0xd')]('/',auth[_0xf062('0xa')](),controller['create']);router[_0xf062('0xe')](_0xf062('0xf'),auth[_0xf062('0xa')](),controller[_0xf062('0x10')]);router['delete'](_0xf062('0xf'),auth[_0xf062('0xa')](),controller[_0xf062('0x11')]);module[_0xf062('0x12')]=router; \ No newline at end of file +var _0x3af0=['isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x36ecbb,_0x1d44d9){var _0x324b0e=function(_0x1454d1){while(--_0x1454d1){_0x36ecbb['push'](_0x36ecbb['shift']());}};_0x324b0e(++_0x1d44d9);}(_0x3af0,0x97));var _0x03af=function(_0x269139,_0xef3c26){_0x269139=_0x269139-0x0;var _0x4ba6d7=_0x3af0[_0x269139];return _0x4ba6d7;};'use strict';var multer=require(_0x03af('0x0'));var util=require(_0x03af('0x1'));var path=require(_0x03af('0x2'));var timeout=require(_0x03af('0x3'));var express=require('express');var router=express[_0x03af('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x03af('0x5'));var interaction=require(_0x03af('0x6'));var config=require(_0x03af('0x7'));var controller=require('./chatTransferReport.controller');router[_0x03af('0x8')]('/',auth[_0x03af('0x9')](),controller[_0x03af('0xa')]);router[_0x03af('0x8')](_0x03af('0xb'),auth[_0x03af('0x9')](),controller[_0x03af('0xc')]);router['get'](_0x03af('0xd'),auth[_0x03af('0x9')](),controller[_0x03af('0xe')]);router['post']('/',auth[_0x03af('0x9')](),controller[_0x03af('0xf')]);router['put'](_0x03af('0xd'),auth[_0x03af('0x9')](),controller[_0x03af('0x10')]);router[_0x03af('0x11')](_0x03af('0xd'),auth[_0x03af('0x9')](),controller[_0x03af('0x12')]);module[_0x03af('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 4c2a24f..6e109e2 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 _0x025e=['mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','BOOLEAN','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','TEXT','stringify','input','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x41ac37,_0xc9c508){var _0x429f1a=function(_0x5c91c9){while(--_0x5c91c9){_0x41ac37['push'](_0x41ac37['shift']());}};_0x429f1a(++_0xc9c508);}(_0x025e,0x148));var _0xe025=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x025e[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0xe025('0x0'));var rs=require(_0xe025('0x1'));module[_0xe025('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xe025('0x3')],'allowNull':![],'unique':_0xe025('0x4')},'description':{'type':Sequelize[_0xe025('0x3')]},'mapKey':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x5')},'mapKeyOffline':{'type':Sequelize[_0xe025('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xe025('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xe025('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe025('0x3')],'allowNull':![],'defaultValue':_0xe025('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe025('0x3')],'allowNull':![],'defaultValue':_0xe025('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe025('0x3')],'allowNull':![],'defaultValue':_0xe025('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe025('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xe025('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe025('0x9')]('rounded',_0xe025('0xa')),'defaultValue':_0xe025('0xb')},'header_online':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe025('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xe025('0xe')},'header_offline':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xe025('0x11')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x14')},'noteTitle':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x15')},'placeholderMessage':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x16')},'closingMessage':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x17')},'closingMessageButton':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0xe')},'skipMessageButton':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe025('0x19')},'ratingType':{'type':Sequelize[_0xe025('0x9')](_0xe025('0x1a'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe025('0x1b')],'defaultValue':function(){return JSON[_0xe025('0x1c')]({'items':[{'type':_0xe025('0x1d'),'variable':null,'config':{'placeholder':'name','type':_0xe025('0x1e'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xe025('0x1d'),'props':{'title':_0xe025('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xe025('0x5'),'type':_0xe025('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe025('0x1f')](_0xe025('0x20'))?JSON[_0xe025('0x21')](this[_0xe025('0x1f')]('onlineForm')):{};},'set':function(_0x5a48a2){return this[_0xe025('0x22')](_0xe025('0x20'),JSON['stringify'](_0x5a48a2));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xe025('0x1c')]({'items':[{'type':_0xe025('0x1d'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xe025('0x5'),'type':_0xe025('0x5')},'variable':null},{'type':_0xe025('0x23'),'config':{'placeholder':_0xe025('0x24')},'props':{'title':_0xe025('0x24'),'helpText':_0xe025('0x25')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xe025('0x26'))?JSON['parse'](this[_0xe025('0x1f')](_0xe025('0x26'))):{};},'set':function(_0x12d4e8){return this['setDataValue'](_0xe025('0x26'),JSON['stringify'](_0x12d4e8));}},'token':{'type':Sequelize[_0xe025('0x3')],'defaultValue':function(){return rs[_0xe025('0x27')]();}},'autoclose':{'type':Sequelize[_0xe025('0x11')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe025('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe025('0x3')]},'waitingTitle':{'type':Sequelize[_0xe025('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe025('0x28')},'offlineMessageSubject':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x29')},'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[_0xe025('0x11')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe025('0x2a')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xe025('0x18')},'sendUnmanaged':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe025('0x1b')]},'showAgentAvatar':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe025('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe025('0x1b')],'defaultValue':function(){return _0xe025('0x2b');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe025('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xe025('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe025('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0xe025('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x2c')},'messagesAlignment':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x2d')},'defaultTitle':{'type':Sequelize[_0xe025('0x3')]},'customerAvatar':{'type':Sequelize[_0xe025('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xe025('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe025('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe025('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe025('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe025('0x3')],'defaultValue':_0xe025('0x2f')},'systemAvatar':{'type':Sequelize[_0xe025('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe025('0x8')],'comment':_0xe025('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xe025('0x11')],'defaultValue':![],'comment':_0xe025('0x31'),'set':function(_0x2bdd98){if(!_0x2bdd98)this[_0xe025('0x22')](_0xe025('0x32'),null);this[_0xe025('0x22')](_0xe025('0x33'),_0x2bdd98);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe025('0x3')]},'vidaooTopic':{'type':Sequelize[_0xe025('0x3')],'allowNull':![],'defaultValue':_0xe025('0x34')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xe025('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xe025('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe025('0x1b')]}}; \ No newline at end of file +var _0x1d47=['Skip','Feedback','thumb','star','INTEGER','TEXT','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1d47,0xec));var _0x71d4=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1d47[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x71d4('0x0'));var rs=require(_0x71d4('0x1'));module[_0x71d4('0x2')]={'name':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x71d4('0x3')]},'mapKey':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x4')},'mapKeyOffline':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x4')},'key':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x71d4('0x5')},'customerAlias':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![],'defaultValue':_0x71d4('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![],'defaultValue':_0x71d4('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x71d4('0x3')]},'animation':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x71d4('0x9')](_0x71d4('0xa'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0xb')},'start_chat_button':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0xc')},'offline_chat_button':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0xd')},'header_offline':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0xe')},'download_transcript':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0xf')},'noteTitle':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x10')},'placeholderMessage':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x71d4('0x12')},'closingMessageButton':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x71d4('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x71d4('0x14')},'ratingType':{'type':Sequelize[_0x71d4('0x9')]('star',_0x71d4('0x15')),'defaultValue':_0x71d4('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x71d4('0x17')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x71d4('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x71d4('0x19'),'variable':null,'config':{'placeholder':_0x71d4('0x1a'),'type':_0x71d4('0x1b'),'required':!![]},'props':{'title':_0x71d4('0x1a'),'helpText':''}},{'type':'input','props':{'title':_0x71d4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x71d4('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x71d4('0x1c')](_0x71d4('0x1d'))?JSON[_0x71d4('0x1e')](this[_0x71d4('0x1c')](_0x71d4('0x1d'))):{};},'set':function(_0x5e8084){return this[_0x71d4('0x1f')](_0x71d4('0x1d'),JSON[_0x71d4('0x20')](_0x5e8084));}},'offlineForm':{'type':Sequelize[_0x71d4('0x18')],'defaultValue':function(){return JSON[_0x71d4('0x20')]({'items':[{'type':'input','props':{'title':_0x71d4('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x71d4('0x4'),'type':_0x71d4('0x4')},'variable':null},{'type':_0x71d4('0x21'),'config':{'placeholder':_0x71d4('0x22')},'props':{'title':_0x71d4('0x22'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x71d4('0x1c')]('offlineForm')?JSON[_0x71d4('0x1e')](this['getDataValue']('offlineForm')):{};},'set':function(_0x43e2a5){return this[_0x71d4('0x1f')](_0x71d4('0x23'),JSON[_0x71d4('0x20')](_0x43e2a5));}},'token':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':function(){return rs[_0x71d4('0x24')]();}},'autoclose':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x71d4('0x3')]},'waitingTitle':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x25')},'waitingMessage':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x27')},'offlineMessageBody':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x71d4('0x29')},'skipUnmanaged':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x13')},'sendUnmanaged':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x71d4('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x71d4('0x2a');}},'notificationSound':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x71d4('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x71d4('0x2c')},'messagesAlignment':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x2d')},'defaultTitle':{'type':Sequelize[_0x71d4('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x71d4('0x17')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x71d4('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':_0x71d4('0x2e')},'systemAvatar':{'type':Sequelize[_0x71d4('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x71d4('0x17')],'comment':_0x71d4('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x71d4('0x30'),'set':function(_0x44d43f){if(!_0x44d43f)this[_0x71d4('0x1f')]('mandatoryDispositionPauseId',null);this[_0x71d4('0x1f')]('mandatoryDisposition',_0x44d43f);}},'vidaooEscalation':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x71d4('0x3')]},'vidaooTopic':{'type':Sequelize[_0x71d4('0x3')],'allowNull':![],'defaultValue':_0x71d4('0x31')},'vidaooNote':{'type':Sequelize[_0x71d4('0x3')],'defaultValue':function(){return _0x71d4('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x71d4('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x71d4('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 78f4944..c1868e1 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 _0xb10b=['removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','destroy','get','UserProfileResource','stack','name','index','map','ChatWebsite','rawAttributes','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','filter','options','includeAll','findAll','rows','mandatoryDispositionPause','intersection','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','Pause','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','filename','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','List','Contacts','ChatApplication','Applications','account','applications','list','orderBy','asc','defaults','contact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','firstName','lastName','referer','browser','version','format','%s\x20%s','unknown','device','threadId','ChatInteraction','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','describe','ListId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','mimetype','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','getLicense','virtual','License','chatLicenseExceeded','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','labelText','textColor','backgroundColor','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit'];(function(_0xe96bd1,_0x170e8e){var _0x3bcbfd=function(_0x5624de){while(--_0x5624de){_0xe96bd1['push'](_0xe96bd1['shift']());}};_0x3bcbfd(++_0x170e8e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d897d,_0x8f648e){_0x5d897d=_0x5d897d-0x0;var _0x21a626=_0xb10b[_0x5d897d];return _0x21a626;};'use strict';var BPromise=require(_0xbb10('0x0'));var Mustache=require('mustache');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var ejs=require(_0xbb10('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb10('0x4'));var querystring=require(_0xbb10('0x5'));var Redis=require(_0xbb10('0x6'));var qs=require(_0xbb10('0x7'));var logger=require(_0xbb10('0x8'))(_0xbb10('0x9'));var config=require('../../config/environment');var db=require(_0xbb10('0xa'))['db'];config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);var htmlToText=require(_0xbb10('0x10'));var jayson=require(_0xbb10('0x11'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xbb10('0x12')][_0xbb10('0x13')]({'port':0x232a});var client9003=jayson[_0xbb10('0x12')]['http']({'port':0x232b});var client9001=jayson[_0xbb10('0x12')]['http']({'port':0x2329});function respondWithRpcPromise(_0x44fb19,_0x916a32,_0x285009,_0x193a27){return new BPromise(function(_0x442548,_0x147230){var _0x58a612=_0x193a27||client;return _0x58a612[_0xbb10('0x14')](_0x44fb19,_0x285009)[_0xbb10('0x15')](function(_0x45b9d6){logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));logger[_0xbb10('0x19')](_0xbb10('0x1a'),_0x916a32,_0xbb10('0x18'),JSON[_0xbb10('0x1b')](_0x45b9d6));if(_0x45b9d6['error']){if(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1d')]===0x1f4){logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);return _0x147230(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}logger[_0xbb10('0x1c')](_0xbb10('0x17'),_0x916a32,_0x45b9d6['error'][_0xbb10('0x1e')]);return _0x442548(_0x45b9d6[_0xbb10('0x1c')][_0xbb10('0x1e')]);}else{logger[_0xbb10('0x16')](_0xbb10('0x17'),_0x916a32,_0xbb10('0x18'));_0x442548(_0x45b9d6['result'][_0xbb10('0x1e')]);}})[_0xbb10('0x1f')](function(_0x50aea1){logger['error'](_0xbb10('0x17'),_0x916a32,_0x50aea1);_0x147230(_0x50aea1);});});}function respondWithStatusCode(_0x311abe,_0x2e911d){_0x2e911d=_0x2e911d||0xcc;return function(_0x317da4){if(_0x317da4){return _0x311abe[_0xbb10('0x20')](_0x2e911d);}return _0x311abe[_0xbb10('0x21')](_0x2e911d)[_0xbb10('0x22')]();};}function respondWithResult(_0x436104,_0x7f2377){_0x7f2377=_0x7f2377||0xc8;return function(_0x395404){if(_0x395404){return _0x436104[_0xbb10('0x21')](_0x7f2377)[_0xbb10('0x23')](_0x395404);}};}function respondWithFilteredResult(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(_0x4fb5e0){var _0xc93a04=typeof _0x4fedac[_0xbb10('0x24')]===_0xbb10('0x25')&&typeof _0x4fedac['limit']===_0xbb10('0x25');var _0x24d586=_0x4fb5e0[_0xbb10('0x26')];var _0x1d5e95=_0xc93a04?0x0:_0x4fedac[_0xbb10('0x24')];var _0x20d946=_0xc93a04?_0x4fb5e0[_0xbb10('0x26')]:_0x4fedac['offset']+_0x4fedac[_0xbb10('0x27')];var _0x21ac54;if(_0x20d946>=_0x24d586){_0x20d946=_0x24d586;_0x21ac54=0xc8;}else{_0x21ac54=0xce;}_0x537898[_0xbb10('0x21')](_0x21ac54);return _0x537898[_0xbb10('0x28')](_0xbb10('0x29'),_0x1d5e95+'-'+_0x20d946+'/'+_0x24d586)[_0xbb10('0x23')](_0x4fb5e0);}return null;};}function saveUpdates(_0x5d5c80){return function(_0x221624){if(_0x221624){return _0x221624['update'](_0x5d5c80)[_0xbb10('0x15')](function(_0x56f2da){return _0x56f2da;});}return null;};}function removeEntity(_0x16ad2a){return function(_0x1dcc9c){if(_0x1dcc9c){return _0x1dcc9c[_0xbb10('0x2a')]()['then'](function(){var _0x518d47=_0x1dcc9c[_0xbb10('0x2b')]({'plain':!![]});var _0x34f65e='ChatWebsites';return db[_0xbb10('0x2c')][_0xbb10('0x2a')]({'where':{'type':_0x34f65e,'resourceId':_0x518d47['id']}})[_0xbb10('0x15')](function(){return _0x1dcc9c;});})[_0xbb10('0x15')](function(){_0x16ad2a[_0xbb10('0x21')](0xcc)[_0xbb10('0x22')]();});}};}function handleEntityNotFound(_0xf85197){return function(_0x4975f5){if(!_0x4975f5){_0xf85197[_0xbb10('0x20')](0x194);}return _0x4975f5;};}function handleError(_0x1da9c9,_0x441d15){_0x441d15=_0x441d15||0x1f4;return function(_0x8c1ce6){logger[_0xbb10('0x1c')](_0x8c1ce6[_0xbb10('0x2d')]);if(_0x8c1ce6[_0xbb10('0x2e')]){delete _0x8c1ce6[_0xbb10('0x2e')];}_0x1da9c9[_0xbb10('0x21')](_0x441d15)['send'](_0x8c1ce6);};}exports[_0xbb10('0x2f')]=function(_0x150107,_0x1ddd9e){var _0x3c3c45={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x570f5a={},_0x111762={'count':0x0,'rows':[]};var _0x3eb3cc=_[_0xbb10('0x30')](db[_0xbb10('0x31')][_0xbb10('0x32')],function(_0x15d895){return{'name':_0x15d895[_0xbb10('0x33')],'type':_0x15d895['type'][_0xbb10('0x34')]};});_0x570f5a[_0xbb10('0x35')]=_['map'](_0x3eb3cc,'name');_0x570f5a['query']=_[_0xbb10('0x36')](_0x150107[_0xbb10('0x37')]);_0x570f5a[_0xbb10('0x38')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],_0x570f5a[_0xbb10('0x37')]);_0x3c3c45[_0xbb10('0x39')]=_['intersection'](_0x570f5a[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3c3c45['attributes']=_0x3c3c45[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x3c3c45['attributes']:_0x570f5a[_0xbb10('0x35')];if(!_0x150107[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x3c3c45[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x150107['query'][_0xbb10('0x27')]);_0x3c3c45[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x150107[_0xbb10('0x37')]['offset']);}_0x3c3c45[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x150107[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x3c3c45['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x150107['query'],_0x570f5a['filters']),_0x3eb3cc);if(_0x150107[_0xbb10('0x37')]['filter']){_0x3c3c45[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3c3c45['where'],{'$or':_[_0xbb10('0x30')](_0x3eb3cc,function(_0x1d82bf){if(_0x1d82bf[_0xbb10('0x43')]!=='VIRTUAL'){var _0x2dd02b={};_0x2dd02b[_0x1d82bf[_0xbb10('0x2e')]]={'$like':'%'+_0x150107[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2dd02b;}})});}_0x3c3c45=_[_0xbb10('0x42')]({},_0x3c3c45,_0x150107[_0xbb10('0x45')]);var _0x190781={'where':_0x3c3c45[_0xbb10('0x41')]};return db[_0xbb10('0x31')][_0xbb10('0x26')](_0x190781)[_0xbb10('0x15')](function(_0x1eadd2){_0x111762['count']=_0x1eadd2;if(_0x150107[_0xbb10('0x37')][_0xbb10('0x46')]){_0x3c3c45['include']=[{'all':!![]}];}return db[_0xbb10('0x31')][_0xbb10('0x47')](_0x3c3c45);})[_0xbb10('0x15')](function(_0x5a5226){_0x111762[_0xbb10('0x48')]=_0x5a5226;return _0x111762;})[_0xbb10('0x15')](respondWithFilteredResult(_0x1ddd9e,_0x3c3c45))[_0xbb10('0x1f')](handleError(_0x1ddd9e,null));};exports['show']=function(_0x4a9793,_0xcb3354){var _0x76a208={'raw':![],'where':{'id':_0x4a9793['params']['id']},'include':[{'model':db['Pause'],'as':_0xbb10('0x49')}]},_0x2b12bd={};_0x2b12bd[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x31')][_0xbb10('0x32')]);_0x2b12bd[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x4a9793[_0xbb10('0x37')]);_0x2b12bd[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x2b12bd['model'],_0x2b12bd['query']);_0x76a208[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x2b12bd[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x4a9793[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x76a208[_0xbb10('0x39')]=_0x76a208[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x76a208[_0xbb10('0x39')]:_0x2b12bd[_0xbb10('0x35')];if(_0x4a9793[_0xbb10('0x37')][_0xbb10('0x46')]){_0x76a208[_0xbb10('0x4b')]=[{'all':!![]}];}_0x76a208=_[_0xbb10('0x42')]({},_0x76a208,_0x4a9793['options']);return db[_0xbb10('0x31')]['find'](_0x76a208)[_0xbb10('0x15')](handleEntityNotFound(_0xcb3354,null))[_0xbb10('0x15')](respondWithResult(_0xcb3354,null))[_0xbb10('0x1f')](handleError(_0xcb3354,null));};exports[_0xbb10('0x4c')]=function(_0x26e66e,_0x32d8e9){return db[_0xbb10('0x31')][_0xbb10('0x4c')](_0x26e66e[_0xbb10('0x4d')],{})[_0xbb10('0x15')](function(_0x44a056){var _0x1c2dce=_0x26e66e[_0xbb10('0x4e')][_0xbb10('0x2b')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x4f'));if(_0x1c2dce['role']===_0xbb10('0x4e')){var _0x466eb7=_0x44a056[_0xbb10('0x2b')]({'plain':!![]});var _0x4ce8e7=_0xbb10('0x50');return db[_0xbb10('0x51')]['find']({'where':{'name':_0x4ce8e7,'userProfileId':_0x1c2dce[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x15')](function(_0x2909a1){if(_0x2909a1&&_0x2909a1[_0xbb10('0x53')]===0x0){return db[_0xbb10('0x2c')][_0xbb10('0x4c')]({'name':_0x466eb7[_0xbb10('0x2e')],'resourceId':_0x466eb7['id'],'type':_0x2909a1[_0xbb10('0x2e')],'sectionId':_0x2909a1['id']},{})[_0xbb10('0x15')](function(){return _0x44a056;});}else{return _0x44a056;}})[_0xbb10('0x1f')](function(_0x2eb05a){logger[_0xbb10('0x1c')](_0xbb10('0x54'),_0x2eb05a);throw _0x2eb05a;});}return _0x44a056;})['then'](respondWithResult(_0x32d8e9,0xc9))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x55')]=function(_0x3e6338,_0x3d0cb7){if(_0x3e6338[_0xbb10('0x4d')]['id']){delete _0x3e6338['body']['id'];}return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x3e6338[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x58')],'as':_0xbb10('0x49')}]})[_0xbb10('0x15')](handleEntityNotFound(_0x3d0cb7,null))[_0xbb10('0x15')](saveUpdates(_0x3e6338[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x3d0cb7,null))[_0xbb10('0x1f')](handleError(_0x3d0cb7,null));};exports[_0xbb10('0x2a')]=function(_0x4917a5,_0x5e03cb){return db['ChatWebsite'][_0xbb10('0x56')]({'where':{'id':_0x4917a5[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5e03cb,null))['then'](removeEntity(_0x5e03cb,null))['catch'](handleError(_0x5e03cb,null));};exports['describe']=function(_0x3ebc5f,_0x249b33){return db[_0xbb10('0x31')]['describe']()[_0xbb10('0x15')](respondWithResult(_0x249b33,null))[_0xbb10('0x1f')](handleError(_0x249b33,null));};exports['addDisposition']=function(_0x4a560c,_0x27d7b9){if(_0x4a560c[_0xbb10('0x4d')]['id']){delete _0x4a560c[_0xbb10('0x4d')]['id'];}return db[_0xbb10('0x31')]['find']({'where':{'id':_0x4a560c[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x27d7b9,null))[_0xbb10('0x15')](function(_0x5202d7){if(_0x5202d7){_0x4a560c[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x5202d7['id'];return db[_0xbb10('0x5a')]['create'](_0x4a560c[_0xbb10('0x4d')]);}})[_0xbb10('0x15')](respondWithResult(_0x27d7b9,null))[_0xbb10('0x1f')](handleError(_0x27d7b9,null));};exports[_0xbb10('0x5b')]=function(_0x5e4a6e,_0x251417){var _0x258e55={'raw':![],'where':{}};var _0x108e5b={};var _0x2d0f4b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x5e4a6e[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x251417,null))[_0xbb10('0x15')](function(_0x12f750){if(_0x12f750){_0x108e5b[_0xbb10('0x35')]=_[_0xbb10('0x36')](db['Disposition']['rawAttributes']);_0x108e5b['query']=_[_0xbb10('0x36')](_0x5e4a6e[_0xbb10('0x37')]);_0x108e5b[_0xbb10('0x38')]=_['intersection'](_0x108e5b['model'],_0x108e5b[_0xbb10('0x37')]);_0x258e55[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x108e5b[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x5e4a6e[_0xbb10('0x37')]['fields']));_0x258e55[_0xbb10('0x39')]=_0x258e55[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x258e55[_0xbb10('0x39')]:_0x108e5b[_0xbb10('0x35')];if(!_0x5e4a6e['query']['hasOwnProperty']('nolimit')){_0x258e55[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x27')]);_0x258e55[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x5e4a6e['query'][_0xbb10('0x24')]);}_0x258e55['order']=qs['sort'](_0x5e4a6e['query'][_0xbb10('0x3f')]);_0x258e55[_0xbb10('0x41')]=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x5e4a6e['query'],_0x108e5b[_0xbb10('0x38')]));_0x258e55['where']['ChatWebsiteId']=_0x12f750['id'];if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]){_0x258e55[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x258e55[_0xbb10('0x41')],{'$or':_['map'](_0x258e55[_0xbb10('0x39')],function(_0x19fcec){var _0x2c6429={};_0x2c6429[_0x19fcec]={'$like':'%'+_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x2c6429;})});}_0x258e55=_[_0xbb10('0x42')]({},_0x258e55,_0x5e4a6e[_0xbb10('0x45')]);return db['Disposition'][_0xbb10('0x26')]({'where':_0x258e55[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x322b41){_0x2d0f4b[_0xbb10('0x26')]=_0x322b41;if(_0x5e4a6e[_0xbb10('0x37')][_0xbb10('0x46')]){_0x258e55[_0xbb10('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0xbb10('0x47')](_0x258e55);})[_0xbb10('0x15')](function(_0x145baf){_0x2d0f4b['rows']=_0x145baf;return _0x2d0f4b;});}})['then'](respondWithFilteredResult(_0x251417,_0x258e55))['catch'](handleError(_0x251417,null));};exports[_0xbb10('0x5d')]=function(_0x5a3c44,_0x4e3d6a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5a3c44[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4e3d6a,null))[_0xbb10('0x15')](function(_0x24dca6){if(_0x24dca6){return _0x24dca6[_0xbb10('0x5d')](_0x5a3c44[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x4e3d6a,null))[_0xbb10('0x1f')](handleError(_0x4e3d6a,null));};exports[_0xbb10('0x5f')]=function(_0x46b6d2,_0x35b811){if(_0x46b6d2['body']['id']){delete _0x46b6d2['body']['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x46b6d2[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x35b811,null))['then'](function(_0x17d596){if(_0x17d596){_0x46b6d2[_0xbb10('0x4d')][_0xbb10('0x59')]=_0x17d596['id'];return db[_0xbb10('0x60')][_0xbb10('0x4c')](_0x46b6d2['body']);}})['then'](respondWithResult(_0x35b811,null))[_0xbb10('0x1f')](handleError(_0x35b811,null));};exports[_0xbb10('0x61')]=function(_0x22c030,_0x5239da){var _0x256b35={'raw':![],'where':{}};var _0x13e2ab={};var _0x50bcc9={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x22c030[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5239da,null))['then'](function(_0x32d5a5){if(_0x32d5a5){_0x13e2ab[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x60')][_0xbb10('0x32')]);_0x13e2ab[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x22c030[_0xbb10('0x37')]);_0x13e2ab[_0xbb10('0x38')]=_['intersection'](_0x13e2ab[_0xbb10('0x35')],_0x13e2ab[_0xbb10('0x37')]);_0x256b35[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x13e2ab[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x256b35[_0xbb10('0x39')]=_0x256b35[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x256b35[_0xbb10('0x39')]:_0x13e2ab['model'];if(!_0x22c030['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x256b35[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x22c030[_0xbb10('0x37')]['limit']);_0x256b35[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x22c030[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x256b35[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x22c030['query'][_0xbb10('0x3f')]);_0x256b35[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x22c030['query'],_0x13e2ab[_0xbb10('0x38')]));_0x256b35[_0xbb10('0x41')][_0xbb10('0x59')]=_0x32d5a5['id'];if(_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]){_0x256b35['where']=_[_0xbb10('0x42')](_0x256b35['where'],{'$or':_[_0xbb10('0x30')](_0x256b35[_0xbb10('0x39')],function(_0x5d767f){var _0x5aaa20={};_0x5aaa20[_0x5d767f]={'$like':'%'+_0x22c030[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5aaa20;})});}_0x256b35=_[_0xbb10('0x42')]({},_0x256b35,_0x22c030[_0xbb10('0x45')]);return db[_0xbb10('0x60')][_0xbb10('0x26')]({'where':_0x256b35[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x252ab8){_0x50bcc9[_0xbb10('0x26')]=_0x252ab8;if(_0x22c030[_0xbb10('0x37')]['includeAll']){_0x256b35[_0xbb10('0x4b')]=[{'all':!![]}];}return db[_0xbb10('0x60')][_0xbb10('0x47')](_0x256b35);})[_0xbb10('0x15')](function(_0xfe02f5){_0x50bcc9[_0xbb10('0x48')]=_0xfe02f5;return _0x50bcc9;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x5239da,_0x256b35))[_0xbb10('0x1f')](handleError(_0x5239da,null));};exports[_0xbb10('0x62')]=function(_0x18a136,_0x1c4235){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x18a136[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c4235,null))[_0xbb10('0x15')](function(_0x3675cd){if(_0x3675cd){return _0x3675cd[_0xbb10('0x62')](_0x18a136[_0xbb10('0x37')][_0xbb10('0x5e')]);}})['then'](respondWithStatusCode(_0x1c4235,null))[_0xbb10('0x1f')](handleError(_0x1c4235,null));};exports[_0xbb10('0x63')]=function(_0x44d1d2,_0x12e89d){_0x44d1d2[_0xbb10('0x4d')][_0xbb10('0x64')]=_0x44d1d2['file']['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x44d1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x12e89d,null))[_0xbb10('0x15')](saveUpdates(_0x44d1d2[_0xbb10('0x4d')],null))['then'](respondWithResult(_0x12e89d,null))[_0xbb10('0x1f')](handleError(_0x12e89d,null));};exports[_0xbb10('0x65')]=function(_0x5642c3,_0xdd3c7e){_0x5642c3['body'][_0xbb10('0x66')]=_0x5642c3[_0xbb10('0x67')]['filename'];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5642c3['params']['id']}})['then'](handleEntityNotFound(_0xdd3c7e,null))[_0xbb10('0x15')](saveUpdates(_0x5642c3[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xdd3c7e,null))[_0xbb10('0x1f')](handleError(_0xdd3c7e,null));};exports[_0xbb10('0x68')]=function(_0x4c3bdc,_0xe7c0a3){_0x4c3bdc[_0xbb10('0x4d')][_0xbb10('0x69')]=_0x4c3bdc['file'][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4c3bdc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0xe7c0a3,null))[_0xbb10('0x15')](saveUpdates(_0x4c3bdc[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0xe7c0a3,null))[_0xbb10('0x1f')](handleError(_0xe7c0a3,null));};exports['addSystemAvatar']=function(_0x4fc544,_0x37e40c){_0x4fc544[_0xbb10('0x4d')][_0xbb10('0x6b')]=_0x4fc544[_0xbb10('0x67')][_0xbb10('0x6a')];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x4fc544[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x37e40c,null))[_0xbb10('0x15')](saveUpdates(_0x4fc544[_0xbb10('0x4d')],null))[_0xbb10('0x15')](respondWithResult(_0x37e40c,null))[_0xbb10('0x1f')](handleError(_0x37e40c,null));};exports['getLogo']=function(_0x1e022d,_0x123587){var _0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x6e'));var _0x4258fc={'where':{'id':_0x1e022d[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x64')],'raw':!![]};var _0x3c92f4=![];return require(_0xbb10('0x6f'))['getLicense']()[_0xbb10('0x15')](function(_0x5e1ac5){if(_0x5e1ac5){_0x3c92f4=_0x5e1ac5[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x4258fc);})[_0xbb10('0x15')](handleEntityNotFound(_0x123587,null))[_0xbb10('0x15')](function(_0x4e9cad){if(_0x4e9cad){if(!_[_0xbb10('0x71')](_0x4e9cad['sitepic'])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]))&&_0x3c92f4){_0x24076a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x73'),_0x4e9cad[_0xbb10('0x64')]);}}return _0x123587[_0xbb10('0x74')](_0x24076a);}})[_0xbb10('0x1f')](handleError(_0x123587,null));};exports[_0xbb10('0x75')]=function(_0x589565,_0x3696b3){var _0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x76'));var _0x7673a0={'where':{'id':_0x589565[_0xbb10('0x57')]['id']},'attributes':['id',_0xbb10('0x66')],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x7673a0)[_0xbb10('0x15')](handleEntityNotFound(_0x3696b3,null))['then'](function(_0x51063a){if(_0x51063a){if(!_[_0xbb10('0x71')](_0x51063a[_0xbb10('0x66')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a['agentAvatar']))){_0x516520=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x51063a[_0xbb10('0x66')]);}}return _0x3696b3[_0xbb10('0x74')](_0x516520);}})[_0xbb10('0x1f')](handleError(_0x3696b3,null));};exports['getCustomerAvatar']=function(_0xdfdc42,_0x4093a4){var _0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x78'));var _0x2764e1={'where':{'id':_0xdfdc42['params']['id']},'attributes':['id',_0xbb10('0x69'),'showCustomerAvatar'],'raw':!![]};return db[_0xbb10('0x31')]['find'](_0x2764e1)['then'](handleEntityNotFound(_0x4093a4,null))[_0xbb10('0x15')](function(_0x225064){if(_0x225064){if(!_[_0xbb10('0x71')](_0x225064[_0xbb10('0x69')])){if(fs[_0xbb10('0x72')](path['join'](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x225064['customerAvatar']))&&_0x225064['showCustomerAvatar']){_0xb7c454=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x225064[_0xbb10('0x69')]);}}return _0x4093a4[_0xbb10('0x74')](_0xb7c454);}})['catch'](handleError(_0x4093a4,null));};exports[_0xbb10('0x79')]=function(_0x42a2d7,_0x352de4){var _0x1bd1c1=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x7a'));var _0x485c1a={'where':{'id':_0x42a2d7['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xbb10('0x31')][_0xbb10('0x56')](_0x485c1a)[_0xbb10('0x15')](handleEntityNotFound(_0x352de4,null))[_0xbb10('0x15')](function(_0x25cba1){if(_0x25cba1){if(!_[_0xbb10('0x71')](_0x25cba1[_0xbb10('0x6b')])){if(fs[_0xbb10('0x72')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server/files/images/avatars/',_0x25cba1['systemAvatar']))){_0x1bd1c1=path['join'](config[_0xbb10('0x6d')],_0xbb10('0x77'),_0x25cba1[_0xbb10('0x6b')]);}}return _0x352de4['download'](_0x1bd1c1);}})[_0xbb10('0x1f')](handleError(_0x352de4,null));};exports[_0xbb10('0x7b')]=function(_0x2c638d,_0x290280){var _0x2a6589=require(_0xbb10('0x7c'));var _0x485f46=new _0x2a6589();var _0x57fe03=_0x485f46[_0xbb10('0x7d')](_0x2c638d['headers'][_0xbb10('0x7e')])[_0xbb10('0x7f')]();var _0x152ca9={'body':_0x2c638d[_0xbb10('0x4d')],'channel':_0xbb10('0x80')};var _0x2dfa04=[];var _0x13a29e=[];var _0x1388f6={};var _0xd3c2c8=![];return db[_0xbb10('0x81')]['describe']()[_0xbb10('0x15')](function(_0x5a9277){if(!_0x5a9277){throw new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0x83'));}_0x2dfa04=_[_0xbb10('0x84')](_[_0xbb10('0x36')](_0x5a9277),[_0xbb10('0x85'),'updatedAt']);_0x13a29e=_[_0xbb10('0x84')](_['keys'](_0x5a9277),[_0xbb10('0x85'),_0xbb10('0x86'),_0xbb10('0x87'),'ListId']);if(_0x2c638d[_0xbb10('0x4d')]['id']){delete _0x2c638d[_0xbb10('0x4d')]['id'];}if(_[_0xbb10('0x71')](_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')])){throw new db[(_0xbb10('0x82'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2c638d[_0xbb10('0x4d')]['body'])||_0x2c638d[_0xbb10('0x4d')]['body']===''){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0x8a'));}if(_['isNil'](_0x2c638d['body'][_0xbb10('0x8b')])){throw new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}if(!_[_0xbb10('0x8c')](_0x13a29e,_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x8b')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x13a29e);}_0x1388f6[_0x2c638d[_0xbb10('0x4d')]['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x2c638d[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e'),'include':[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0x8f'),'where':_0x1388f6,'limit':0x1,'order':[[_0xbb10('0x86'),'DESC']]}]},{'model':db[_0xbb10('0x90')],'as':_0xbb10('0x91')}]});})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x5e3fac){if(_0x5e3fac&&_0x5e3fac['List']){_0x152ca9[_0xbb10('0x92')]=_0x5e3fac;_0x152ca9[_0xbb10('0x93')]=_0x5e3fac[_0xbb10('0x91')];_0x152ca9[_0xbb10('0x94')]=_0x5e3fac[_0xbb10('0x8e')];_0x152ca9['applications']=_[_0xbb10('0x95')](_0x152ca9[_0xbb10('0x93')],['priority'],[_0xbb10('0x96')]);if(_0x152ca9[_0xbb10('0x92')]['Applications']){delete _0x152ca9[_0xbb10('0x92')]['Applications'];}if(_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')]&&_0x152ca9[_0xbb10('0x92')][_0xbb10('0x8e')][_0xbb10('0x8f')][_0xbb10('0x3b')]){return _0x152ca9[_0xbb10('0x92')]['List'][_0xbb10('0x8f')][0x0];}var _0x4720a1=_[_0xbb10('0x97')](_0x2c638d[_0xbb10('0x4d')],{'firstName':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')],'ListId':_0x5e3fac['ListId']});_0x4720a1[_0x2c638d['body']['mapKey']]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0x4c')](_0x4720a1,{'fields':_0x2dfa04,'raw':!![]});}})['then'](handleEntityNotFound(_0x290280,null))[_0xbb10('0x15')](function(_0x3d7b4d){_0x152ca9[_0xbb10('0x98')]=_0x3d7b4d;var _0x577d27=_0x2c638d['body'][_0xbb10('0x99')];if(_0x2c638d['headers'][_0xbb10('0x9a')]){_0x577d27=_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9a')];}else if(_0x2c638d[_0xbb10('0x9b')][_0xbb10('0x9c')]){_0x577d27=_[_0xbb10('0x9d')](_0x2c638d[_0xbb10('0x9b')]['x-forwarded-for'][_0xbb10('0x9e')](','));}if(_0x3d7b4d){var _0x1eca6c={'ContactId':_0x3d7b4d['id'],'ChatWebsiteId':_0x2c638d['params']['id'],'from':(_0x3d7b4d[_0xbb10('0x9f')]||'')+'\x20'+(_0x3d7b4d[_0xbb10('0xa0')]||''),'customerIp':_0x577d27,'customerPort':_0x2c638d[_0xbb10('0x9b')]['x-real-port']?_0x2c638d['headers']['x-real-port']:null,'referer':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa1')],'browserName':_0x57fe03['browser'][_0xbb10('0x2e')]&&_0x57fe03[_0xbb10('0xa2')][_0xbb10('0xa3')]?util[_0xbb10('0xa4')](_0xbb10('0xa5'),_0x57fe03[_0xbb10('0xa2')][_0xbb10('0x2e')],_0x57fe03['browser'][_0xbb10('0xa3')]):'unknown','browserVersion':_0x57fe03['browser']['version']||_0xbb10('0xa6'),'osName':util[_0xbb10('0xa4')]('%s\x20%s',_0x57fe03['os'][_0xbb10('0x2e')],_0x57fe03['os']['version']),'osVersion':_0x57fe03['os'][_0xbb10('0xa3')],'deviceModel':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')]&&_0x57fe03['device']['vendor']?util[_0xbb10('0xa4')]('%s\x20%s\x20%s',_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x35')],_0x57fe03['device']['vendor'],_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')]):null,'deviceVendor':_0x57fe03[_0xbb10('0xa7')]['vendor'],'deviceType':_0x57fe03[_0xbb10('0xa7')][_0xbb10('0x43')],'formData':JSON[_0xbb10('0x1b')](_0x2c638d['body'])};var _0x414066={'ChatWebsiteId':_0x2c638d[_0xbb10('0x57')]['id'],'closed':![]};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]){_0x414066[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x10ca4a){if(_0x10ca4a){return[_0x10ca4a,![]];}_0x1eca6c[_0xbb10('0xa8')]=_0x2c638d[_0xbb10('0x4d')]['threadId'];_0x1eca6c['externalUrl']=_0x2c638d[_0xbb10('0x4d')]['externalUrl'];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x4e5236){return[_0x4e5236,!![]];});});}_0x414066[_0xbb10('0xaa')]=_0x3d7b4d['id'];if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xab')]['id']){_0x414066['id']=_0x2c638d['body'][_0xbb10('0xab')]['id'];return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':_0x414066})[_0xbb10('0x15')](function(_0x150d4c){if(_0x150d4c){return[_0x150d4c,![]];}return db[_0xbb10('0xa9')]['create'](_0x1eca6c)[_0xbb10('0x15')](function(_0x2f0262){return[_0x2f0262,!![]];});});}return db['ChatInteraction'][_0xbb10('0x4c')](_0x1eca6c)[_0xbb10('0x15')](function(_0x2d0de5){return[_0x2d0de5,!![]];});}})[_0xbb10('0xac')](function(_0x3abc15,_0x43df3c){if(_0x3abc15){_0xd3c2c8=_0x43df3c;if(!_0x43df3c){var _0x45593c={'from':(_0x152ca9[_0xbb10('0x98')][_0xbb10('0x9f')]||'')+'\x20'+(_0x152ca9[_0xbb10('0x98')][_0xbb10('0xa0')]||'')};if(_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xa8')]&&_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')]&&_0x2c638d['body'][_0xbb10('0xa8')]!=_0x2c638d[_0xbb10('0x4d')]['messageId']){_0x45593c['threadId']=_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xad')];}return _0x3abc15[_0xbb10('0x55')](_0x45593c);}else{return _0x3abc15;}}})[_0xbb10('0x15')](function(_0x27fb82){_0x152ca9[_0xbb10('0xab')]=_0x27fb82[_0xbb10('0x2b')]({'plain':!![]});_0x152ca9[_0xbb10('0xab')][_0xbb10('0xae')]=_0xd3c2c8;if(_0x152ca9['interaction']['created']){if(_0x152ca9['account']['autoclose']){_0x152ca9['applications']['push']({'id':0x0,'priority':_0x152ca9[_0xbb10('0x93')][_0xbb10('0x3b')]+0x1,'app':_0xbb10('0xaf'),'appdata':_0xbb10('0xb0'),'interval':'*,*,*,*'});}}return db[_0xbb10('0xb1')][_0xbb10('0x4c')]({'body':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0x4d')],'ChatWebsiteId':_0x2c638d['params']['id'],'ChatInteractionId':_0x27fb82['id'],'direction':'in','ContactId':_0x152ca9['contact']['id'],'AttachmentId':_0x2c638d[_0xbb10('0x4d')][_0xbb10('0xb2')]});})['then'](function(_0x581832){_0x152ca9[_0xbb10('0x1e')]=_0x581832;if(_0x152ca9[_0xbb10('0xab')][_0xbb10('0xb3')]){return db[_0xbb10('0xb4')][_0xbb10('0x56')]({'attributes':['id','name'],'where':{'id':_0x152ca9[_0xbb10('0xab')]['UserId']}})['then'](function(_0x9d96e2){if(_0x9d96e2){_0x152ca9[_0xbb10('0x93')][_0xbb10('0xb5')]({'id':0x0,'priority':0x0,'app':_0xbb10('0xb6'),'appdata':_0x9d96e2[_0xbb10('0x2e')]+','+(_0x152ca9[_0xbb10('0x92')]['waitForTheAssignedAgent']||0xa),'interval':_0xbb10('0xb7')});_0x152ca9[_0xbb10('0xb8')]=!![];}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);});}return respondWithRpcPromise(_0xbb10('0xb9'),_0xbb10('0xba'),_0x152ca9);})[_0xbb10('0x15')](function(_0xce60f4){respondWithRpcPromise(_0xbb10('0xbb'),_0xbb10('0xbb'),{'event':_0xbb10('0x7b'),'message':_0xce60f4},client9002);return _0xce60f4;})[_0xbb10('0x15')](respondWithResult(_0x290280,null))[_0xbb10('0x1f')](handleError(_0x290280,null));};exports[_0xbb10('0xbc')]=function(_0x45b31c,_0x3cf074){var _0x232a1b,_0xbdc520,_0x246ee3;var _0x43a203=[];var _0x1ca43e={};var _0x1f84b0=_0x45b31c['files']||[];var _0x2158e2=[];var _0x47883f;return db[_0xbb10('0x81')][_0xbb10('0xbd')]()[_0xbb10('0x15')](function(_0x2b1f0f){if(!_0x2b1f0f){throw new db[(_0xbb10('0x82'))]['ValidationError']('no\x20available\x20attributes');}_0x43a203=_['difference'](_[_0xbb10('0x36')](_0x2b1f0f),[_0xbb10('0x85'),'updatedAt',_0xbb10('0x87'),_0xbb10('0xbe')]);if(_0x45b31c[_0xbb10('0x4d')]['id']){delete _0x45b31c['body']['id'];}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')])){throw _0x3cf074['status'](0x1f4)[_0xbb10('0xbf')](new db['Sequelize'][(_0xbb10('0x89'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x45b31c['body']['body'])||_0x45b31c['body']['body']===''){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xbb10('0x71')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))][(_0xbb10('0x89'))](_0xbb10('0xc1')+_0x43a203));}if(!_[_0xbb10('0x8c')](_0x43a203,_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline'])){throw _0x3cf074[_0xbb10('0x21')](0x1f4)[_0xbb10('0xbf')](new db[(_0xbb10('0x82'))]['ValidationError'](_0xbb10('0xc2')+_0x43a203));}_0x1ca43e[_0x45b31c[_0xbb10('0x4d')][_0xbb10('0xc0')]]=_0x45b31c[_0xbb10('0x4d')]['from'];})[_0xbb10('0x15')](function(){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x45b31c[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x8d')],'as':_0xbb10('0x8e')},{'model':db[_0xbb10('0xc3')],'as':_0xbb10('0xc3')}]});})[_0xbb10('0x15')](handleEntityNotFound(_0x3cf074,null))[_0xbb10('0x15')](function(_0x3c01ff){if(_0x3c01ff&&_0x3c01ff['List']){_0xbdc520=_0x3c01ff;var _0x59d917=_[_0xbb10('0x97')](_0x45b31c['body'],{'firstName':_0x45b31c['body'][_0xbb10('0x88')],'phone':_0x45b31c[_0xbb10('0x4d')]['from'],'ListId':_0x3c01ff[_0xbb10('0xbe')]});_0x59d917[_0x45b31c[_0xbb10('0x4d')]['mapKeyOffline']]=_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x88')];return db[_0xbb10('0x81')][_0xbb10('0xc4')]({'where':_0x1ca43e,'defaults':_0x59d917});}})[_0xbb10('0xac')](function(_0x4d2c76){if(_0x4d2c76){_0x246ee3=_0x4d2c76;var _0x4fc260=fs['readFileSync'](path[_0xbb10('0x6c')](config['root'],_0xbb10('0xc5')),'utf8');var _0x510467=ejs[_0xbb10('0xc6')](_0x4fc260,{'body':_[_0xbb10('0xc7')](_0x45b31c[_0xbb10('0x4d')][_0xbb10('0x4d')]),'bodyTitle':_0xbdc520[_0xbb10('0xc8')]});return db[_0xbb10('0xc9')]['create']({'body':_0x510467,'plainBody':htmlToText['fromString'](_0x510467),'ContactId':_0x4d2c76['id'],'ChatWebsiteId':_0xbdc520['id']});}})['then'](function(_0x5ad067){_0x47883f=_0x5ad067;if(_0x1f84b0[_0xbb10('0x3b')]){var _0x18632f=_0x1f84b0[_0xbb10('0x30')](function(_0x26bc1c){return{'name':_0x26bc1c[_0xbb10('0xca')],'basename':_0x26bc1c[_0xbb10('0x6a')],'type':_0x26bc1c['mimetype'],'ChatOfflineMessageId':_0x5ad067['id']};});_0x2158e2=_0x18632f[_0xbb10('0x30')](_0x207bbb=>{var _0x35586a={'filename':_0x207bbb[_0xbb10('0x2e')],'path':path['join'](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x207bbb[_0xbb10('0xcd')])};return _0x35586a;});if(!_0xbdc520[_0xbb10('0xce')]){return db[_0xbb10('0xcf')][_0xbb10('0xd0')](function(_0x4b7bf8){return db[_0xbb10('0xd1')][_0xbb10('0xd2')](_0x18632f,{'transaction':_0x4b7bf8});});}}})[_0xbb10('0x15')](function(){if(_0x47883f){_0x232a1b=_0x47883f;return db[_0xbb10('0xc3')][_0xbb10('0x5c')]({'where':{'active':!![]},'include':[{'model':db[_0xbb10('0xd3')],'as':_0xbb10('0xd4'),'raw':!![]}]});}})['then'](function(_0x2cbbb6){if(_0x2cbbb6&&_0x2cbbb6[_0xbb10('0xd4')]&&_0xbdc520[_0xbb10('0xd5')]&&_0xbdc520['forwardOfflineAddress']){var _0x595664={'tls':{'rejectUnauthorized':![]}};if(_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')]){_0x595664[_0xbb10('0xd6')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd6')];}else{_0x595664[_0xbb10('0xd7')]=_0x2cbbb6[_0xbb10('0xd4')]['host'];_0x595664[_0xbb10('0xd8')]=_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0xd8')];_0x595664['secure']=_0x2cbbb6['Smtp']['secure'];}if(_0x2cbbb6['Smtp'][_0xbb10('0xd9')]){_0x595664[_0xbb10('0xda')]={'user':_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')],'pass':_0x2cbbb6['Smtp'][_0xbb10('0xdb')]};}return respondWithRpcPromise('SendMail',_0xbb10('0xdc'),{'account':_0x595664,'message':{'from':util[_0xbb10('0xa4')](_0xbb10('0xdd'),_0x2cbbb6[_0xbb10('0x2e')],_0x2cbbb6[_0xbb10('0xde')]||_0x2cbbb6[_0xbb10('0xd4')][_0xbb10('0x4e')]),'to':_0xbdc520[_0xbb10('0xdf')],'subject':_0xbdc520[_0xbb10('0xe0')],'html':_0x232a1b[_0xbb10('0x4d')],'attachments':_0x2158e2}},client9003)[_0xbb10('0x15')](function(){return _0x232a1b;})[_0xbb10('0x1f')](function(_0x4c969d){console[_0xbb10('0x1c')](_0x4c969d);});}})[_0xbb10('0x15')](function(){if(_0xbdc520&&_0xbdc520[_0xbb10('0xce')]&&_0xbdc520['MailAccountId']){var _0x204ebf=[];if(_0x1f84b0['length']){_0x204ebf=_0x1f84b0[_0xbb10('0x30')](function(_0x446bcf){return{'name':_0x446bcf[_0xbb10('0xca')],'basename':_0x446bcf[_0xbb10('0x6a')],'type':_0x446bcf[_0xbb10('0xe1')],'ChatOfflineMessageId':_0x47883f['id']};});}var _0x533327;if(!_['isNil'](_0xbdc520[_0xbb10('0xe2')])){var _0x4cf5cc=_['map'](_0x45b31c[_0xbb10('0x4d')],function(_0x5621b1){return _0x5621b1;});var _0xa9ed32=_[_0xbb10('0xe3')](_0x4cf5cc)[0x0];var _0x3f0a4e=_[_0xbb10('0xe4')](_0xa9ed32,function(_0x309b4a){return _0x309b4a;});_0x533327=_0x3f0a4e[0x1][_0xbdc520[_0xbb10('0xe2')]];}var _0x3a0940={'from':_0x246ee3[_0xbb10('0xde')],'firstName':_0x246ee3['firstName'],'lastName':_0x246ee3[_0xbb10('0xa0')],'mapKey':'email','message':{'from':_0x246ee3[_0xbb10('0xde')],'to':_0xbdc520['MailAccount'][_0xbb10('0xde')],'cc':'','subject':_[_0xbb10('0x71')](_0x533327)?_0xbdc520['offlineMessageSubject']:_0x533327,'messageId':'','sentAt':new Date(),'attach':_0x204ebf[_0xbb10('0x3b')],'attachments':_0x204ebf,'originChannel':_0xbb10('0xe5'),'ChatWebsiteId':_0xbdc520['id'],'ChatOfflineMessageId':_0x232a1b['id'],'originTo':_0xbdc520[_0xbb10('0xc3')]['email']},'body':_0x232a1b[_0xbb10('0x4d')]};var _0x1a8503={'account':{'id':_0xbdc520[_0xbb10('0xe6')]},'body':_0x3a0940,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xbb10('0xe7'),_0xbb10('0xe8'),_0x1a8503,client9001)[_0xbb10('0x15')](function(){return _0x232a1b;})['catch'](function(_0x3e6756){console['error'](_0x3e6756);});}return;})[_0xbb10('0x15')](function(){if(_0x232a1b){return _0x232a1b;}})[_0xbb10('0x15')](respondWithResult(_0x3cf074,null))[_0xbb10('0x1f')](function(_0xd94118){console[_0xbb10('0x1c')](_0xbb10('0x1f'),_0xd94118);for(var _0x23e592 of _0x1f84b0){var _0x44d28a=path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],'server','files',_0xbb10('0xcb'),_0xbb10('0xcc'),_0x23e592[_0xbb10('0x6a')]);fs_extra['remove'](_0x44d28a)[_0xbb10('0x1f')](function(_0x1067f2){console[_0xbb10('0x1c')](_0xbb10('0xe9'),_0x44d28a,_0x1067f2);});}});};exports[_0xbb10('0xea')]=function(_0x431673,_0x81d970){return db[_0xbb10('0xa9')][_0xbb10('0x56')]({'where':{'id':_0x431673['params']['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x81d970,null))[_0xbb10('0x15')](function(_0x4102af){if(_0x4102af){return _0x4102af[_0xbb10('0xea')](_0x431673['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x431673[_0xbb10('0x4d')],['ids','id'])||{});}})['then'](respondWithResult(_0x81d970,null))[_0xbb10('0x1f')](handleError(_0x81d970,null));};exports['getInteractions']=function(_0x37c688,_0x4874be){var _0x3fd69e={'raw':![],'where':{}};var _0x1aa860={};var _0x28cd8e={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x37c688[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x4874be,null))['then'](function(_0x20c514){if(_0x20c514){_0x1aa860[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xa9')][_0xbb10('0x32')]);_0x1aa860[_0xbb10('0x37')]=_['keys'](_0x37c688[_0xbb10('0x37')]);_0x1aa860[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x1aa860[_0xbb10('0x35')],_0x1aa860[_0xbb10('0x37')]);_0x3fd69e[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x1aa860['model'],qs[_0xbb10('0x3a')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x3fd69e['attributes']=_0x3fd69e[_0xbb10('0x39')]['length']?_0x3fd69e[_0xbb10('0x39')]:_0x1aa860[_0xbb10('0x35')];if(!_0x37c688[_0xbb10('0x37')]['hasOwnProperty']('nolimit')){_0x3fd69e[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x27')]);_0x3fd69e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x37c688[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x3fd69e[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x37c688[_0xbb10('0x37')]['sort']);_0x3fd69e['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x37c688['query'],_0x1aa860['filters']));_0x3fd69e[_0xbb10('0x41')][_0xbb10('0x59')]=_0x20c514['id'];if(_0x37c688[_0xbb10('0x37')]['filter']){_0x3fd69e[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x3fd69e['where'],{'$or':_[_0xbb10('0x30')](_0x3fd69e[_0xbb10('0x39')],function(_0x544c9c){var _0x5a5349={};_0x5a5349[_0x544c9c]={'$like':'%'+_0x37c688[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x5a5349;})});}_0x3fd69e=_[_0xbb10('0x42')]({},_0x3fd69e,_0x37c688['options']);return db['ChatInteraction'][_0xbb10('0x26')]({'where':_0x3fd69e[_0xbb10('0x41')]})['then'](function(_0x1e9dd2){_0x28cd8e[_0xbb10('0x26')]=_0x1e9dd2;if(_0x37c688['query'][_0xbb10('0x46')]){_0x3fd69e[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['User'],'as':_0xbb10('0xed'),'attributes':['name',_0xbb10('0xee'),_0xbb10('0xef')],'required':![]},{'model':db[_0xbb10('0xf0')],'as':_0xbb10('0xf1'),'attributes':['id',_0xbb10('0x2e'),_0xbb10('0xf2')],'where':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?{'id':_0x37c688['query'][_0xbb10('0xf3')]}:undefined,'required':_0x37c688[_0xbb10('0x37')][_0xbb10('0xf3')]?!![]:![]}];}return db[_0xbb10('0xa9')]['findAll'](_0x3fd69e);})['then'](function(_0xd23108){_0x28cd8e[_0xbb10('0x48')]=_0xd23108;return _0x28cd8e;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x4874be,_0x3fd69e))[_0xbb10('0x1f')](handleError(_0x4874be,null));};function iftimePromise(_0x5b2e0b,_0x215028){return respondWithRpcPromise(_0xbb10('0xf4'),'getSnippet',{'command':_0x215028[_0xbb10('0xf5')]?util['format']('iftime\x20%s,%s',_0x5b2e0b[_0xbb10('0xf6')],_0x215028[_0xbb10('0xf5')]):util[_0xbb10('0xa4')](_0xbb10('0xf7'),_0x5b2e0b[_0xbb10('0xf6')])},client9002)['then'](function(_0x38403e){var _0x262078=_0x38403e&&_0x38403e[_0xbb10('0xf8')](_0xbb10('0xf9'))>=0x0?!![]:![];logger[_0xbb10('0x16')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],_0x262078?_0xbb10('0xfb'):_0xbb10('0xfc'),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return _0x262078;})[_0xbb10('0x1f')](function(_0x9fcc26){logger[_0xbb10('0x1c')](_0xbb10('0xfa'),_0x215028['id'],_0x5b2e0b['id'],_0x5b2e0b[_0xbb10('0xf6')],util[_0xbb10('0xfe')](_0x9fcc26,{'showHidden':![],'depth':null}),_0x215028[_0xbb10('0xf5')]?_0x215028[_0xbb10('0xf5')]:_0xbb10('0xfd'));return![];});}exports[_0xbb10('0xff')]=function(_0x1b4873,_0x1ca72c){var _0x36615e=0x0;var _0x2f38d3=0x0;var _0x5a4d21=![];var _0x57b891;var _0x19eaa2;return db[_0xbb10('0x31')]['find']({'where':{'id':_0x1b4873[_0xbb10('0x57')]['id']},'include':[{'model':db[_0xbb10('0x100')],'as':'Interval','include':[{'model':db[_0xbb10('0x100')],'as':_0xbb10('0x101'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xbb10('0x15')](handleEntityNotFound(_0x1ca72c,null))[_0xbb10('0x15')](function(_0xb4fdea){if(_0xb4fdea){_0x57b891=_0xb4fdea;return _0xb4fdea[_0xbb10('0x102')]({'raw':!![]});}})['then'](function(_0x170061){if(_0x57b891){if(_0x170061){_0x19eaa2=_0x170061;}}return require(_0xbb10('0x6f'))[_0xbb10('0x103')]();})[_0xbb10('0x15')](function(_0x5c0732){if(_0x5c0732){_0x2f38d3=_0x5c0732[_0xbb10('0x104')];_0x5a4d21=_0x5c0732[_0xbb10('0x70')];}})[_0xbb10('0x15')](function(){return db[_0xbb10('0xa9')][_0xbb10('0x26')]({'where':{'closed':![]}});})[_0xbb10('0x15')](function(_0x2f626b){_0x36615e=_0x2f626b;if(_0x2f38d3&&_0x2f626b>_0x2f38d3){return db[_0xbb10('0x105')][_0xbb10('0x5c')]({'where':{'id':0x1}})[_0xbb10('0x15')](function(_0x2fd942){if(_0x2fd942){_0x2fd942['increment'](_0xbb10('0x106'));}});}})[_0xbb10('0x15')](function(){if(_0x57b891[_0xbb10('0x100')]&&_0x57b891[_0xbb10('0x100')]['Intervals']){var _0x5116d8=[];for(var _0x8bfc0f=0x0;_0x8bfc0f<_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0xbb10('0x3b')];_0x8bfc0f++){var _0x5f0576=_0x57b891[_0xbb10('0x100')][_0xbb10('0x101')][_0x8bfc0f][_0xbb10('0x2b')]({'plain':!![]});_0x5116d8['push'](iftimePromise(_0x5f0576,_0x57b891));}return BPromise['all'](_0x5116d8)[_0xbb10('0x15')](function(_0xd6b33){return _['some'](_0xd6b33);});}else{return!![];}})['then'](function(_0x424bb1){var _0x615606=fs[_0xbb10('0x107')](path[_0xbb10('0x6c')](config[_0xbb10('0x6d')],_0xbb10('0x108')),'utf8');var _0x408544={'remote':_0x57b891[_0xbb10('0x109')],'query':querystring[_0xbb10('0x1b')](_[_0xbb10('0x42')](_0x57b891[_0xbb10('0x2b')]({'plain':!![]}),{'customerIp':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x9c')]||_0x1b4873[_0xbb10('0x9b')][_0xbb10('0x10a')]||_0x1b4873[_0xbb10('0x10b')]['remoteAddress']||_0x1b4873['ip'],'referer':_0x1b4873[_0xbb10('0x9b')][_0xbb10('0xa1')],'openedInteractions':_0x36615e,'maxInteractions':_0x2f38d3,'virtual':_0x5a4d21['virtual'],'online':_0x424bb1,'custom':_0x5a4d21}))['replace'](/'/g,'\x5c\x27')};_0x1ca72c['send'](ejs['render'](Mustache['render'](_0x615606,_0x408544),{'proactiveActions':_0x19eaa2,'alignment':_0x57b891['alignment'],'verticalAlignment':_0x57b891['verticalAlignment'],'div_color':_0x57b891['color'],'labelText':_0x57b891[_0xbb10('0x10c')],'text_color':_0x57b891[_0xbb10('0x10d')],'button_color':_0x57b891['color_button'],'background_color':_0x57b891[_0xbb10('0x10e')]}));})[_0xbb10('0x1f')](handleError(_0x1ca72c,null));};exports[_0xbb10('0x10f')]=function(_0x3b9bec,_0x1d099a){var _0x1d36fa=_0x3b9bec[_0xbb10('0x57')]['id'];var _0x23179d=_0x3b9bec[_0xbb10('0x4d')];var _0x14d9e7=0xc8;var _0x19dfef=null;return db[_0xbb10('0xcf')]['transaction']({'isolationLevel':db[_0xbb10('0xcf')][_0xbb10('0x110')][_0xbb10('0x111')][_0xbb10('0x112')]},function(_0x155f92){return db['ChatWebsite'][_0xbb10('0x5c')]({'where':{'id':_0x1d36fa},'transaction':_0x155f92})['then'](function(_0x52209c){if(_0x52209c){return db[_0xbb10('0x90')][_0xbb10('0x2a')]({'where':{'ChatWebsiteId':_0x1d36fa},'transaction':_0x155f92})['then'](function(){var _0x3e433b=_[_0xbb10('0x30')](_0x23179d,function(_0x201e05){_0x201e05[_0xbb10('0x59')]=_0x1d36fa;return _0x201e05;});return db[_0xbb10('0x90')]['bulkCreate'](_0x3e433b,{'transaction':_0x155f92});});}else{_0x14d9e7=0x194;_0x19dfef=[];}});})['then'](function(){if(_0x14d9e7!==0x194){return db[_0xbb10('0x90')][_0xbb10('0x113')]({'where':{'ChatWebsiteId':_0x1d36fa},'order':'priority'})[_0xbb10('0x15')](function(_0x4cf976){_0x19dfef=_0x4cf976;});}})[_0xbb10('0x1f')](function(_0x1a2f42){_0x14d9e7=0x1f4;logger[_0xbb10('0x1c')](_0x1a2f42[_0xbb10('0x2d')]);if(_0x1a2f42[_0xbb10('0x2e')]){delete _0x1a2f42[_0xbb10('0x2e')];}_0x19dfef=_0x1a2f42;})[_0xbb10('0x114')](function(){if(_0x19dfef===null){_0x1d099a['sendStatus'](_0x14d9e7);}else{if(_0x14d9e7===0x1f4){_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0xbf')](_0x19dfef);}else{_0x1d099a[_0xbb10('0x21')](_0x14d9e7)[_0xbb10('0x23')](_0x19dfef);}}});};exports['getApplications']=function(_0x20347b,_0x22ffc6){var _0x530785={};var _0x49ef50={};var _0xeac82d;var _0x5a4de3;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x20347b[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x22ffc6,null))['then'](function(_0x90ab9f){if(_0x90ab9f){_0xeac82d=_0x90ab9f;_0x49ef50['model']=_[_0xbb10('0x36')](db[_0xbb10('0x90')][_0xbb10('0x32')]);_0x49ef50[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x20347b[_0xbb10('0x37')]);_0x49ef50[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],_0x49ef50['query']);_0x530785[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x49ef50[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x20347b[_0xbb10('0x37')]['fields']));_0x530785[_0xbb10('0x39')]=_0x530785[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x530785[_0xbb10('0x39')]:_0x49ef50[_0xbb10('0x35')];_0x530785['order']=qs['sort'](_0x20347b['query'][_0xbb10('0x3f')]);_0x530785['where']=qs['filters'](_[_0xbb10('0x40')](_0x20347b['query'],_0x49ef50[_0xbb10('0x38')]));if(_0x20347b[_0xbb10('0x37')]['filter']){_0x530785[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x530785[_0xbb10('0x41')],{'$or':_[_0xbb10('0x30')](_0x530785['attributes'],function(_0x4b08b2){var _0x57abfe={};_0x57abfe[_0x4b08b2]={'$like':'%'+_0x20347b[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x57abfe;})});}_0x530785=_['merge']({},_0x530785,_0x20347b[_0xbb10('0x45')]);return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x33a92a){if(_0x33a92a){_0x5a4de3=_0x33a92a[_0xbb10('0x3b')];if(!_0x20347b['query'][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x530785[_0xbb10('0x27')]=qs['limit'](_0x20347b[_0xbb10('0x37')]['limit']);_0x530785[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x20347b[_0xbb10('0x37')]['offset']);}return _0xeac82d[_0xbb10('0x115')](_0x530785);}})[_0xbb10('0x15')](function(_0x4ba58f){if(_0x4ba58f){return _0x4ba58f?{'count':_0x5a4de3,'rows':_0x4ba58f}:null;}})[_0xbb10('0x15')](respondWithResult(_0x22ffc6,null))[_0xbb10('0x1f')](handleError(_0x22ffc6,null));};exports[_0xbb10('0x116')]=function(_0x2e03eb,_0x24e7bc){return db['chatProactiveAction']['find']({'where':{'id':_0x2e03eb[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24e7bc,null))[_0xbb10('0x15')](function(_0x1b0734){if(_0x1b0734){return _0x1b0734[_0xbb10('0x116')](_0x2e03eb['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x2e03eb[_0xbb10('0x4d')],[_0xbb10('0x5e'),'id'])||{});}})[_0xbb10('0x15')](respondWithResult(_0x24e7bc,null))['catch'](handleError(_0x24e7bc,null));};exports['getProactiveActions']=function(_0x2f675c,_0x18f6b1){var _0x1052f5={};var _0x119e8f={};var _0x5a031b;var _0x4c8e28;return db[_0xbb10('0x31')]['findOne']({'where':{'id':_0x2f675c['params']['id']}})['then'](handleEntityNotFound(_0x18f6b1,null))['then'](function(_0x3758dd){if(_0x3758dd){_0x5a031b=_0x3758dd;_0x119e8f[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0x117')][_0xbb10('0x32')]);_0x119e8f['query']=_[_0xbb10('0x36')](_0x2f675c[_0xbb10('0x37')]);_0x119e8f[_0xbb10('0x38')]=_['intersection'](_0x119e8f[_0xbb10('0x35')],_0x119e8f[_0xbb10('0x37')]);_0x1052f5[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x119e8f[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x1052f5[_0xbb10('0x39')]=_0x1052f5[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x1052f5[_0xbb10('0x39')]:_0x119e8f[_0xbb10('0x35')];_0x1052f5[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x2f675c['query']['sort']);_0x1052f5['where']=qs[_0xbb10('0x38')](_['pick'](_0x2f675c[_0xbb10('0x37')],_0x119e8f['filters']));if(_0x2f675c[_0xbb10('0x37')]['filter']){_0x1052f5['where']=_[_0xbb10('0x42')](_0x1052f5[_0xbb10('0x41')],{'$or':_['map'](_0x1052f5[_0xbb10('0x39')],function(_0x131d48){var _0x338e7a={};_0x338e7a[_0x131d48]={'$like':'%'+_0x2f675c[_0xbb10('0x37')]['filter']+'%'};return _0x338e7a;})});}_0x1052f5=_['merge']({},_0x1052f5,_0x2f675c[_0xbb10('0x45')]);return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x53f3c2){if(_0x53f3c2){_0x4c8e28=_0x53f3c2[_0xbb10('0x3b')];if(!_0x2f675c[_0xbb10('0x37')][_0xbb10('0x3c')]('nolimit')){_0x1052f5[_0xbb10('0x27')]=qs['limit'](_0x2f675c['query'][_0xbb10('0x27')]);_0x1052f5['offset']=qs[_0xbb10('0x24')](_0x2f675c[_0xbb10('0x37')][_0xbb10('0x24')]);}return _0x5a031b[_0xbb10('0x102')](_0x1052f5);}})[_0xbb10('0x15')](function(_0x57a6bc){if(_0x57a6bc){return _0x57a6bc?{'count':_0x4c8e28,'rows':_0x57a6bc}:null;}})[_0xbb10('0x15')](respondWithResult(_0x18f6b1,null))[_0xbb10('0x1f')](handleError(_0x18f6b1,null));};exports[_0xbb10('0x118')]=function(_0x2701e8,_0x1b0086){var _0x1c387b=_0x2701e8['query']['online']===_0xbb10('0x119')?_0xbb10('0x11a'):_0xbb10('0x11b');return db[_0xbb10('0x31')][_0xbb10('0x56')]({'attributes':['id',_0x1c387b],'where':{'id':_0x2701e8['params']['id']}})['then'](handleEntityNotFound(_0x1b0086,null))[_0xbb10('0x15')](function(_0x23cbf4){if(_0x23cbf4){var _0x536519=_0x23cbf4[_0x1c387b];var _0x50dde9=_0x536519&&_0x536519[_0xbb10('0x11c')]?_0x536519[_0xbb10('0x11c')]:[];_0x1b0086[_0xbb10('0xbf')]({'fromKey':_[_0xbb10('0x71')](_0x536519[_0xbb10('0x11d')])?undefined:_0x536519[_0xbb10('0x11d')],'count':_0x50dde9['length'],'rows':_0x50dde9});}})[_0xbb10('0x1f')](handleError(_0x1b0086,null));};exports[_0xbb10('0x11e')]=function(_0x261c9b,_0x232794){var _0x35b3f8={'raw':![],'where':{}};var _0x3783d0={};var _0xdd7d5c={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x261c9b['params']['id']}})['then'](handleEntityNotFound(_0x232794,null))['then'](function(_0x111c15){if(_0x111c15){_0x3783d0[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xc9')]['rawAttributes']);_0x3783d0['query']=_['keys'](_0x261c9b[_0xbb10('0x37')]);_0x3783d0[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],_0x3783d0[_0xbb10('0x37')]);_0x35b3f8[_0xbb10('0x39')]=_[_0xbb10('0x4a')](_0x3783d0[_0xbb10('0x35')],qs[_0xbb10('0x3a')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x35b3f8[_0xbb10('0x39')]=_0x35b3f8[_0xbb10('0x39')][_0xbb10('0x3b')]?_0x35b3f8['attributes']:_0x3783d0[_0xbb10('0x35')];if(!_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x35b3f8[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x261c9b['query'][_0xbb10('0x27')]);_0x35b3f8[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x24')]);}_0x35b3f8[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x261c9b[_0xbb10('0x37')][_0xbb10('0x3f')]);_0x35b3f8['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x40')](_0x261c9b[_0xbb10('0x37')],_0x3783d0[_0xbb10('0x38')]));_0x35b3f8[_0xbb10('0x41')][_0xbb10('0x59')]=_0x111c15['id'];if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x44')]){_0x35b3f8[_0xbb10('0x41')]=_['merge'](_0x35b3f8[_0xbb10('0x41')],{'$or':_['map'](_0x35b3f8[_0xbb10('0x39')],function(_0x2cd1b0){var _0x57e0b2={};_0x57e0b2[_0x2cd1b0]={'$like':'%'+_0x261c9b['query'][_0xbb10('0x44')]+'%'};return _0x57e0b2;})});}_0x35b3f8=_[_0xbb10('0x42')]({},_0x35b3f8,_0x261c9b[_0xbb10('0x45')]);return db[_0xbb10('0xc9')][_0xbb10('0x26')]({'where':_0x35b3f8[_0xbb10('0x41')]})[_0xbb10('0x15')](function(_0x40a208){_0xdd7d5c[_0xbb10('0x26')]=_0x40a208;if(_0x261c9b[_0xbb10('0x37')][_0xbb10('0x46')]){_0x35b3f8[_0xbb10('0x4b')]=[{'all':!![]}];}else{_0x35b3f8[_0xbb10('0x4b')]=[{'model':db[_0xbb10('0x81')],'as':_0xbb10('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xbb10('0x11f'),'required':![]}];}return db['ChatOfflineMessage'][_0xbb10('0x47')](_0x35b3f8);})[_0xbb10('0x15')](function(_0x234dc5){_0xdd7d5c[_0xbb10('0x48')]=_0x234dc5;return _0xdd7d5c;});}})[_0xbb10('0x15')](respondWithFilteredResult(_0x232794,_0x35b3f8))[_0xbb10('0x1f')](handleError(_0x232794,null));};exports[_0xbb10('0x120')]=function(_0x45dcaa,_0x5c88bd){return db['ChatWebsite']['find']({'where':{'id':_0x45dcaa[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x5c88bd,null))[_0xbb10('0x15')](function(_0x54c61c){if(_0x54c61c){return _0x54c61c[_0xbb10('0x120')](_0x45dcaa['body'][_0xbb10('0x5e')],_[_0xbb10('0xeb')](_0x45dcaa['body'],[_0xbb10('0x5e'),'id'])||{})[_0xbb10('0xac')](function(_0xa52322){for(var _0xc1691=0x0;_0xc1691<_0x45dcaa[_0xbb10('0x4d')]['ids'][_0xbb10('0x3b')];_0xc1691+=0x1){socket[_0xbb10('0x121')]('userChatWebsite:save',{'UserId':Number(_0x45dcaa[_0xbb10('0x4d')][_0xbb10('0x5e')][_0xc1691]),'ChatWebsiteId':Number(_0x45dcaa['params']['id'])});}return _0xa52322;});}})[_0xbb10('0x15')](respondWithResult(_0x5c88bd,null))[_0xbb10('0x1f')](handleError(_0x5c88bd,null));};exports[_0xbb10('0x122')]=function(_0x24f1d2,_0x481a0a){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x24f1d2[_0xbb10('0x57')]['id']}})['then'](handleEntityNotFound(_0x481a0a,null))['then'](function(_0x284b77){if(_0x284b77){return _0x284b77[_0xbb10('0x122')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])['then'](function(){if(_[_0xbb10('0x123')](_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')])){for(var _0x28c680=0x0;_0x28c680<_0x24f1d2[_0xbb10('0x37')]['ids']['length'];_0x28c680+=0x1){socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2['query']['ids'][_0x28c680]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}}else{socket[_0xbb10('0x121')](_0xbb10('0x124'),{'UserId':Number(_0x24f1d2[_0xbb10('0x37')][_0xbb10('0x5e')]),'ChatWebsiteId':Number(_0x24f1d2[_0xbb10('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x481a0a,null))['catch'](handleError(_0x481a0a,null));};exports[_0xbb10('0x125')]=function(_0x1c3cbc,_0x24bda8){var _0x27ddfc={};var _0x39a047={};var _0x9a80a7;var _0x5e08c5;return db[_0xbb10('0x31')][_0xbb10('0x5c')]({'where':{'id':_0x1c3cbc[_0xbb10('0x57')]['id']}})[_0xbb10('0x15')](handleEntityNotFound(_0x24bda8,null))['then'](function(_0x21ad98){if(_0x21ad98){_0x9a80a7=_0x21ad98;_0x39a047[_0xbb10('0x35')]=_[_0xbb10('0x36')](db[_0xbb10('0xb4')][_0xbb10('0x32')]);_0x39a047[_0xbb10('0x37')]=_[_0xbb10('0x36')](_0x1c3cbc[_0xbb10('0x37')]);_0x39a047[_0xbb10('0x38')]=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],_0x39a047[_0xbb10('0x37')]);_0x27ddfc['attributes']=_[_0xbb10('0x4a')](_0x39a047[_0xbb10('0x35')],qs['fields'](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3a')]));_0x27ddfc[_0xbb10('0x39')]=_0x27ddfc['attributes'][_0xbb10('0x3b')]?_0x27ddfc[_0xbb10('0x39')]:_0x39a047[_0xbb10('0x35')];_0x27ddfc[_0xbb10('0x3e')]=qs[_0xbb10('0x3f')](_0x1c3cbc[_0xbb10('0x37')]['sort']);_0x27ddfc[_0xbb10('0x41')]=qs['filters'](_[_0xbb10('0x40')](_0x1c3cbc[_0xbb10('0x37')],_0x39a047[_0xbb10('0x38')]));if(_0x1c3cbc[_0xbb10('0x37')]['filter']){_0x27ddfc[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x27ddfc['where'],{'$or':_[_0xbb10('0x30')](_0x27ddfc['attributes'],function(_0x31c086){var _0x40845c={};_0x40845c[_0x31c086]={'$like':'%'+_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x44')]+'%'};return _0x40845c;})});}_0x27ddfc=_[_0xbb10('0x42')]({},_0x27ddfc,_0x1c3cbc[_0xbb10('0x45')]);return _0x9a80a7[_0xbb10('0x125')](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x55ee36){if(_0x55ee36){_0x5e08c5=_0x55ee36['length'];if(!_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x3c')](_0xbb10('0x3d'))){_0x27ddfc[_0xbb10('0x27')]=qs[_0xbb10('0x27')](_0x1c3cbc[_0xbb10('0x37')][_0xbb10('0x27')]);_0x27ddfc[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x1c3cbc['query'][_0xbb10('0x24')]);}return _0x9a80a7['getAgents'](_0x27ddfc);}})[_0xbb10('0x15')](function(_0x2a618a){if(_0x2a618a){return _0x2a618a?{'count':_0x5e08c5,'rows':_0x2a618a}:null;}})['then'](respondWithResult(_0x24bda8,null))[_0xbb10('0x1f')](handleError(_0x24bda8,null));}; \ No newline at end of file +var _0x757a=['body','user','UserProfileSection','autoAssociation','describe','params','ChatWebsiteId','Disposition','includeAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','includes','mapKey','CmList','Contacts','DESC','ChatApplication','List','account','applications','Applications','list','priority','asc','ListId','CmContact','customerIp','cf-connecting-ip','headers','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','format','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','firstName','contact','messageId','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','spread','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','bulkCreate','findOne','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','increment','all','some','readFileSync','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','labelText','color_button','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','mustache','util','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','set','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','find','catch','create'];(function(_0x3c7668,_0x3546df){var _0x2747f9=function(_0x47cf06){while(--_0x47cf06){_0x3c7668['push'](_0x3c7668['shift']());}};_0x2747f9(++_0x3546df);}(_0x757a,0xde));var _0xa757=function(_0x303976,_0x4bba0a){_0x303976=_0x303976-0x0;var _0x27c808=_0x757a[_0x303976];return _0x27c808;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa757('0x2'));var querystring=require(_0xa757('0x3'));var Redis=require(_0xa757('0x4'));var qs=require(_0xa757('0x5'));var logger=require(_0xa757('0x6'))(_0xa757('0x7'));var config=require('../../config/environment');var db=require(_0xa757('0x8'))['db'];config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);var htmlToText=require(_0xa757('0xd'));var jayson=require(_0xa757('0xe'));var client=jayson[_0xa757('0xf')][_0xa757('0x10')]({'port':0x232c});var client9002=jayson[_0xa757('0xf')][_0xa757('0x10')]({'port':0x232a});var client9003=jayson[_0xa757('0xf')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x56acfb,_0x4db68e,_0x421040,_0x544b45){return new BPromise(function(_0x564187,_0x2ed0d2){var _0x513b1f=_0x544b45||client;return _0x513b1f['request'](_0x56acfb,_0x421040)[_0xa757('0x11')](function(_0x1b670e){logger[_0xa757('0x12')](_0xa757('0x13'),_0x4db68e,_0xa757('0x14'));logger[_0xa757('0x15')](_0xa757('0x16'),_0x4db68e,_0xa757('0x14'),JSON[_0xa757('0x17')](_0x1b670e));if(_0x1b670e[_0xa757('0x18')]){if(_0x1b670e['error'][_0xa757('0x19')]===0x1f4){logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x1b670e['error']['message']);return _0x2ed0d2(_0x1b670e[_0xa757('0x18')][_0xa757('0x1a')]);}logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x1b670e[_0xa757('0x18')][_0xa757('0x1a')]);return _0x564187(_0x1b670e['error'][_0xa757('0x1a')]);}else{logger['info'](_0xa757('0x13'),_0x4db68e,_0xa757('0x14'));_0x564187(_0x1b670e[_0xa757('0x1b')][_0xa757('0x1a')]);}})['catch'](function(_0x5638c7){logger[_0xa757('0x18')](_0xa757('0x13'),_0x4db68e,_0x5638c7);_0x2ed0d2(_0x5638c7);});});}function respondWithStatusCode(_0x2ba923,_0x8d121f){_0x8d121f=_0x8d121f||0xcc;return function(_0x1d6e2){if(_0x1d6e2){return _0x2ba923[_0xa757('0x1c')](_0x8d121f);}return _0x2ba923[_0xa757('0x1d')](_0x8d121f)[_0xa757('0x1e')]();};}function respondWithResult(_0x2bf276,_0x59fae6){_0x59fae6=_0x59fae6||0xc8;return function(_0x3707c1){if(_0x3707c1){return _0x2bf276['status'](_0x59fae6)[_0xa757('0x1f')](_0x3707c1);}};}function respondWithFilteredResult(_0x47903b,_0x40551d){return function(_0x3859ce){if(_0x3859ce){var _0x37c7e6=typeof _0x40551d['offset']===_0xa757('0x20')&&typeof _0x40551d[_0xa757('0x21')]===_0xa757('0x20');var _0x3bf7f3=_0x3859ce['count'];var _0x449a7d=_0x37c7e6?0x0:_0x40551d['offset'];var _0x5a5664=_0x37c7e6?_0x3859ce['count']:_0x40551d['offset']+_0x40551d[_0xa757('0x21')];var _0x596ae2;if(_0x5a5664>=_0x3bf7f3){_0x5a5664=_0x3bf7f3;_0x596ae2=0xc8;}else{_0x596ae2=0xce;}_0x47903b[_0xa757('0x1d')](_0x596ae2);return _0x47903b[_0xa757('0x22')]('Content-Range',_0x449a7d+'-'+_0x5a5664+'/'+_0x3bf7f3)[_0xa757('0x1f')](_0x3859ce);}return null;};}function saveUpdates(_0x5119ad){return function(_0x2c4823){if(_0x2c4823){return _0x2c4823[_0xa757('0x23')](_0x5119ad)['then'](function(_0x235e54){return _0x235e54;});}return null;};}function removeEntity(_0x5ade7b){return function(_0x3a4a66){if(_0x3a4a66){return _0x3a4a66[_0xa757('0x24')]()[_0xa757('0x11')](function(){var _0x300dc4=_0x3a4a66[_0xa757('0x25')]({'plain':!![]});var _0x2c1885=_0xa757('0x26');return db[_0xa757('0x27')][_0xa757('0x24')]({'where':{'type':_0x2c1885,'resourceId':_0x300dc4['id']}})[_0xa757('0x11')](function(){return _0x3a4a66;});})[_0xa757('0x11')](function(){_0x5ade7b[_0xa757('0x1d')](0xcc)[_0xa757('0x1e')]();});}};}function handleEntityNotFound(_0x2dfb33){return function(_0x27be88){if(!_0x27be88){_0x2dfb33[_0xa757('0x1c')](0x194);}return _0x27be88;};}function handleError(_0x3e64b7,_0x1ad384){_0x1ad384=_0x1ad384||0x1f4;return function(_0x1eacde){logger[_0xa757('0x18')](_0x1eacde[_0xa757('0x28')]);if(_0x1eacde[_0xa757('0x29')]){delete _0x1eacde[_0xa757('0x29')];}_0x3e64b7[_0xa757('0x1d')](_0x1ad384)['send'](_0x1eacde);};}exports[_0xa757('0x2a')]=function(_0x21d6b3,_0x1e9d63){var _0x1794a9={'include':[{'model':db[_0xa757('0x2b')],'as':_0xa757('0x2c')}]},_0x1c4c40={},_0x51e2aa={'count':0x0,'rows':[]};var _0x37b1a3=_[_0xa757('0x2d')](db[_0xa757('0x2e')][_0xa757('0x2f')],function(_0x499390){return{'name':_0x499390[_0xa757('0x30')],'type':_0x499390[_0xa757('0x31')][_0xa757('0x32')]};});_0x1c4c40[_0xa757('0x33')]=_[_0xa757('0x2d')](_0x37b1a3,_0xa757('0x29'));_0x1c4c40[_0xa757('0x34')]=_[_0xa757('0x35')](_0x21d6b3[_0xa757('0x34')]);_0x1c4c40['filters']=_[_0xa757('0x36')](_0x1c4c40[_0xa757('0x33')],_0x1c4c40[_0xa757('0x34')]);_0x1794a9[_0xa757('0x37')]=_[_0xa757('0x36')](_0x1c4c40[_0xa757('0x33')],qs['fields'](_0x21d6b3[_0xa757('0x34')][_0xa757('0x38')]));_0x1794a9['attributes']=_0x1794a9['attributes'][_0xa757('0x39')]?_0x1794a9[_0xa757('0x37')]:_0x1c4c40['model'];if(!_0x21d6b3['query'][_0xa757('0x3a')](_0xa757('0x3b'))){_0x1794a9[_0xa757('0x21')]=qs['limit'](_0x21d6b3[_0xa757('0x34')][_0xa757('0x21')]);_0x1794a9[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x21d6b3[_0xa757('0x34')]['offset']);}_0x1794a9[_0xa757('0x3d')]=qs['sort'](_0x21d6b3['query'][_0xa757('0x3e')]);_0x1794a9[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x21d6b3[_0xa757('0x34')],_0x1c4c40['filters']),_0x37b1a3);if(_0x21d6b3['query'][_0xa757('0x42')]){_0x1794a9[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x1794a9[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x37b1a3,function(_0x3db5d5){if(_0x3db5d5['type']!==_0xa757('0x44')){var _0x364998={};_0x364998[_0x3db5d5['name']]={'$like':'%'+_0x21d6b3[_0xa757('0x34')]['filter']+'%'};return _0x364998;}})});}_0x1794a9=_[_0xa757('0x43')]({},_0x1794a9,_0x21d6b3[_0xa757('0x45')]);var _0x4cf90f={'where':_0x1794a9[_0xa757('0x3f')]};return db[_0xa757('0x2e')]['count'](_0x4cf90f)[_0xa757('0x11')](function(_0x257bcd){_0x51e2aa[_0xa757('0x46')]=_0x257bcd;if(_0x21d6b3[_0xa757('0x34')]['includeAll']){_0x1794a9[_0xa757('0x47')]=[{'all':!![]}];}return db[_0xa757('0x2e')][_0xa757('0x48')](_0x1794a9);})[_0xa757('0x11')](function(_0x4d7493){_0x51e2aa[_0xa757('0x49')]=_0x4d7493;return _0x51e2aa;})['then'](respondWithFilteredResult(_0x1e9d63,_0x1794a9))['catch'](handleError(_0x1e9d63,null));};exports[_0xa757('0x4a')]=function(_0x3c039d,_0x1ae3ae){var _0x5e13cf={'raw':![],'where':{'id':_0x3c039d['params']['id']},'include':[{'model':db[_0xa757('0x2b')],'as':_0xa757('0x2c')}]},_0x421c65={};_0x421c65[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x2e')][_0xa757('0x2f')]);_0x421c65[_0xa757('0x34')]=_[_0xa757('0x35')](_0x3c039d['query']);_0x421c65[_0xa757('0x40')]=_[_0xa757('0x36')](_0x421c65[_0xa757('0x33')],_0x421c65[_0xa757('0x34')]);_0x5e13cf[_0xa757('0x37')]=_[_0xa757('0x36')](_0x421c65[_0xa757('0x33')],qs[_0xa757('0x38')](_0x3c039d[_0xa757('0x34')][_0xa757('0x38')]));_0x5e13cf[_0xa757('0x37')]=_0x5e13cf[_0xa757('0x37')][_0xa757('0x39')]?_0x5e13cf[_0xa757('0x37')]:_0x421c65[_0xa757('0x33')];if(_0x3c039d[_0xa757('0x34')]['includeAll']){_0x5e13cf[_0xa757('0x47')]=[{'all':!![]}];}_0x5e13cf=_['merge']({},_0x5e13cf,_0x3c039d[_0xa757('0x45')]);return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x5e13cf)[_0xa757('0x11')](handleEntityNotFound(_0x1ae3ae,null))['then'](respondWithResult(_0x1ae3ae,null))[_0xa757('0x4c')](handleError(_0x1ae3ae,null));};exports[_0xa757('0x4d')]=function(_0x8614f9,_0x980e1){return db['ChatWebsite'][_0xa757('0x4d')](_0x8614f9[_0xa757('0x4e')],{})[_0xa757('0x11')](function(_0x1c9f1e){var _0x33666d=_0x8614f9[_0xa757('0x4f')]['get']({'plain':!![]});if(!_0x33666d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33666d['role']==='user'){var _0x1d8742=_0x1c9f1e[_0xa757('0x25')]({'plain':!![]});var _0x137477=_0xa757('0x26');return db[_0xa757('0x50')][_0xa757('0x4b')]({'where':{'name':_0x137477,'userProfileId':_0x33666d['userProfileId']},'raw':!![]})[_0xa757('0x11')](function(_0x163d99){if(_0x163d99&&_0x163d99[_0xa757('0x51')]===0x0){return db[_0xa757('0x27')]['create']({'name':_0x1d8742[_0xa757('0x29')],'resourceId':_0x1d8742['id'],'type':_0x163d99[_0xa757('0x29')],'sectionId':_0x163d99['id']},{})['then'](function(){return _0x1c9f1e;});}else{return _0x1c9f1e;}})[_0xa757('0x4c')](function(_0x5cd0c3){logger[_0xa757('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5cd0c3);throw _0x5cd0c3;});}return _0x1c9f1e;})[_0xa757('0x11')](respondWithResult(_0x980e1,0xc9))['catch'](handleError(_0x980e1,null));};exports['update']=function(_0x367b48,_0x235c1e){if(_0x367b48[_0xa757('0x4e')]['id']){delete _0x367b48[_0xa757('0x4e')]['id'];}return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x367b48['params']['id']},'include':[{'model':db['Pause'],'as':_0xa757('0x2c')}]})[_0xa757('0x11')](handleEntityNotFound(_0x235c1e,null))[_0xa757('0x11')](saveUpdates(_0x367b48['body'],null))['then'](respondWithResult(_0x235c1e,null))[_0xa757('0x4c')](handleError(_0x235c1e,null));};exports[_0xa757('0x24')]=function(_0x215a80,_0x504c4f){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x215a80['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x504c4f,null))[_0xa757('0x11')](removeEntity(_0x504c4f,null))[_0xa757('0x4c')](handleError(_0x504c4f,null));};exports[_0xa757('0x52')]=function(_0x1291df,_0xfbcb43){return db[_0xa757('0x2e')][_0xa757('0x52')]()[_0xa757('0x11')](respondWithResult(_0xfbcb43,null))[_0xa757('0x4c')](handleError(_0xfbcb43,null));};exports['addDisposition']=function(_0x9e96e6,_0x5c803a){if(_0x9e96e6['body']['id']){delete _0x9e96e6[_0xa757('0x4e')]['id'];}return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x9e96e6[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x5c803a,null))[_0xa757('0x11')](function(_0x1b34ad){if(_0x1b34ad){_0x9e96e6[_0xa757('0x4e')][_0xa757('0x54')]=_0x1b34ad['id'];return db[_0xa757('0x55')][_0xa757('0x4d')](_0x9e96e6['body']);}})[_0xa757('0x11')](respondWithResult(_0x5c803a,null))[_0xa757('0x4c')](handleError(_0x5c803a,null));};exports['getDispositions']=function(_0x11ebb3,_0x409ee9){var _0x198a11={'raw':![],'where':{}};var _0x180cec={};var _0x27d79b={'count':0x0,'rows':[]};return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x11ebb3[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x409ee9,null))[_0xa757('0x11')](function(_0x3250d0){if(_0x3250d0){_0x180cec[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x55')]['rawAttributes']);_0x180cec['query']=_[_0xa757('0x35')](_0x11ebb3[_0xa757('0x34')]);_0x180cec[_0xa757('0x40')]=_['intersection'](_0x180cec[_0xa757('0x33')],_0x180cec['query']);_0x198a11[_0xa757('0x37')]=_[_0xa757('0x36')](_0x180cec[_0xa757('0x33')],qs[_0xa757('0x38')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x38')]));_0x198a11['attributes']=_0x198a11[_0xa757('0x37')][_0xa757('0x39')]?_0x198a11[_0xa757('0x37')]:_0x180cec[_0xa757('0x33')];if(!_0x11ebb3[_0xa757('0x34')]['hasOwnProperty'](_0xa757('0x3b'))){_0x198a11[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x21')]);_0x198a11['offset']=qs[_0xa757('0x3c')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x3c')]);}_0x198a11['order']=qs[_0xa757('0x3e')](_0x11ebb3[_0xa757('0x34')][_0xa757('0x3e')]);_0x198a11[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x11ebb3[_0xa757('0x34')],_0x180cec[_0xa757('0x40')]));_0x198a11[_0xa757('0x3f')][_0xa757('0x54')]=_0x3250d0['id'];if(_0x11ebb3[_0xa757('0x34')][_0xa757('0x42')]){_0x198a11[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x198a11['where'],{'$or':_[_0xa757('0x2d')](_0x198a11[_0xa757('0x37')],function(_0x532ab5){var _0x11f2b3={};_0x11f2b3[_0x532ab5]={'$like':'%'+_0x11ebb3[_0xa757('0x34')]['filter']+'%'};return _0x11f2b3;})});}_0x198a11=_[_0xa757('0x43')]({},_0x198a11,_0x11ebb3[_0xa757('0x45')]);return db[_0xa757('0x55')][_0xa757('0x46')]({'where':_0x198a11[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0xdb2ac6){_0x27d79b[_0xa757('0x46')]=_0xdb2ac6;if(_0x11ebb3[_0xa757('0x34')][_0xa757('0x56')]){_0x198a11[_0xa757('0x47')]=[{'all':!![]}];}return db[_0xa757('0x55')][_0xa757('0x48')](_0x198a11);})[_0xa757('0x11')](function(_0x27604c){_0x27d79b[_0xa757('0x49')]=_0x27604c;return _0x27d79b;});}})['then'](respondWithFilteredResult(_0x409ee9,_0x198a11))[_0xa757('0x4c')](handleError(_0x409ee9,null));};exports['removeDispositions']=function(_0x39357f,_0x20c444){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x39357f[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x20c444,null))[_0xa757('0x11')](function(_0x67a58b){if(_0x67a58b){return _0x67a58b[_0xa757('0x57')](_0x39357f['query'][_0xa757('0x58')]);}})[_0xa757('0x11')](respondWithStatusCode(_0x20c444,null))[_0xa757('0x4c')](handleError(_0x20c444,null));};exports['addAnswer']=function(_0x501134,_0x1f437d){if(_0x501134[_0xa757('0x4e')]['id']){delete _0x501134[_0xa757('0x4e')]['id'];}return db['ChatWebsite'][_0xa757('0x4b')]({'where':{'id':_0x501134['params']['id']}})['then'](handleEntityNotFound(_0x1f437d,null))[_0xa757('0x11')](function(_0x1adf5a){if(_0x1adf5a){_0x501134[_0xa757('0x4e')]['ChatWebsiteId']=_0x1adf5a['id'];return db[_0xa757('0x59')][_0xa757('0x4d')](_0x501134[_0xa757('0x4e')]);}})[_0xa757('0x11')](respondWithResult(_0x1f437d,null))[_0xa757('0x4c')](handleError(_0x1f437d,null));};exports[_0xa757('0x5a')]=function(_0x26dcec,_0x44c681){var _0xe38e76={'raw':![],'where':{}};var _0x35c1aa={};var _0x180fee={'count':0x0,'rows':[]};return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x26dcec[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x44c681,null))[_0xa757('0x11')](function(_0x346a4a){if(_0x346a4a){_0x35c1aa[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x59')][_0xa757('0x2f')]);_0x35c1aa[_0xa757('0x34')]=_[_0xa757('0x35')](_0x26dcec[_0xa757('0x34')]);_0x35c1aa[_0xa757('0x40')]=_[_0xa757('0x36')](_0x35c1aa[_0xa757('0x33')],_0x35c1aa[_0xa757('0x34')]);_0xe38e76[_0xa757('0x37')]=_[_0xa757('0x36')](_0x35c1aa[_0xa757('0x33')],qs[_0xa757('0x38')](_0x26dcec[_0xa757('0x34')][_0xa757('0x38')]));_0xe38e76[_0xa757('0x37')]=_0xe38e76['attributes'][_0xa757('0x39')]?_0xe38e76[_0xa757('0x37')]:_0x35c1aa['model'];if(!_0x26dcec[_0xa757('0x34')]['hasOwnProperty'](_0xa757('0x3b'))){_0xe38e76[_0xa757('0x21')]=qs['limit'](_0x26dcec[_0xa757('0x34')][_0xa757('0x21')]);_0xe38e76[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x26dcec['query'][_0xa757('0x3c')]);}_0xe38e76[_0xa757('0x3d')]=qs['sort'](_0x26dcec[_0xa757('0x34')][_0xa757('0x3e')]);_0xe38e76['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x26dcec[_0xa757('0x34')],_0x35c1aa[_0xa757('0x40')]));_0xe38e76[_0xa757('0x3f')][_0xa757('0x54')]=_0x346a4a['id'];if(_0x26dcec[_0xa757('0x34')][_0xa757('0x42')]){_0xe38e76[_0xa757('0x3f')]=_['merge'](_0xe38e76['where'],{'$or':_[_0xa757('0x2d')](_0xe38e76[_0xa757('0x37')],function(_0x11baf9){var _0x234855={};_0x234855[_0x11baf9]={'$like':'%'+_0x26dcec[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x234855;})});}_0xe38e76=_[_0xa757('0x43')]({},_0xe38e76,_0x26dcec['options']);return db[_0xa757('0x59')]['count']({'where':_0xe38e76[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0x365a0d){_0x180fee[_0xa757('0x46')]=_0x365a0d;if(_0x26dcec[_0xa757('0x34')]['includeAll']){_0xe38e76[_0xa757('0x47')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa757('0x48')](_0xe38e76);})[_0xa757('0x11')](function(_0x183097){_0x180fee[_0xa757('0x49')]=_0x183097;return _0x180fee;});}})['then'](respondWithFilteredResult(_0x44c681,_0xe38e76))[_0xa757('0x4c')](handleError(_0x44c681,null));};exports[_0xa757('0x5b')]=function(_0x187681,_0x3c6d51){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x187681[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3c6d51,null))['then'](function(_0x24fd9c){if(_0x24fd9c){return _0x24fd9c[_0xa757('0x5b')](_0x187681[_0xa757('0x34')][_0xa757('0x58')]);}})['then'](respondWithStatusCode(_0x3c6d51,null))[_0xa757('0x4c')](handleError(_0x3c6d51,null));};exports[_0xa757('0x5c')]=function(_0x441f80,_0x9b5432){_0x441f80[_0xa757('0x4e')][_0xa757('0x5d')]=_0x441f80[_0xa757('0x5e')]['filename'];return db['ChatWebsite'][_0xa757('0x4b')]({'where':{'id':_0x441f80['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x9b5432,null))['then'](saveUpdates(_0x441f80['body'],null))[_0xa757('0x11')](respondWithResult(_0x9b5432,null))[_0xa757('0x4c')](handleError(_0x9b5432,null));};exports[_0xa757('0x5f')]=function(_0x218030,_0xb95266){_0x218030[_0xa757('0x4e')][_0xa757('0x60')]=_0x218030[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')]['find']({'where':{'id':_0x218030[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0xb95266,null))[_0xa757('0x11')](saveUpdates(_0x218030[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0xb95266,null))[_0xa757('0x4c')](handleError(_0xb95266,null));};exports['addCustomerAvatar']=function(_0x3738f9,_0x3ba04e){_0x3738f9[_0xa757('0x4e')][_0xa757('0x62')]=_0x3738f9[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x3738f9[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3ba04e,null))[_0xa757('0x11')](saveUpdates(_0x3738f9[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0x3ba04e,null))[_0xa757('0x4c')](handleError(_0x3ba04e,null));};exports[_0xa757('0x63')]=function(_0x56a060,_0x4af060){_0x56a060[_0xa757('0x4e')]['systemAvatar']=_0x56a060[_0xa757('0x5e')][_0xa757('0x61')];return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x56a060['params']['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x4af060,null))[_0xa757('0x11')](saveUpdates(_0x56a060[_0xa757('0x4e')],null))[_0xa757('0x11')](respondWithResult(_0x4af060,null))[_0xa757('0x4c')](handleError(_0x4af060,null));};exports[_0xa757('0x64')]=function(_0x526b82,_0x3cb1ec){var _0x3cca3e=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x67'));var _0x4b1c4c={'where':{'id':_0x526b82['params']['id']},'attributes':['id',_0xa757('0x5d')],'raw':!![]};var _0x531cba=![];return require(_0xa757('0x68'))['getLicense']()[_0xa757('0x11')](function(_0x1dee22){if(_0x1dee22){_0x531cba=_0x1dee22[_0xa757('0x69')];}})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x4b1c4c);})[_0xa757('0x11')](handleEntityNotFound(_0x3cb1ec,null))[_0xa757('0x11')](function(_0x2ac258){if(_0x2ac258){if(!_[_0xa757('0x6a')](_0x2ac258[_0xa757('0x5d')])){if(fs['existsSync'](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x6b'),_0x2ac258[_0xa757('0x5d')]))&&_0x531cba){_0x3cca3e=path[_0xa757('0x65')](config[_0xa757('0x66')],'server/files/images/logos/',_0x2ac258[_0xa757('0x5d')]);}}return _0x3cb1ec[_0xa757('0x6c')](_0x3cca3e);}})['catch'](handleError(_0x3cb1ec,null));};exports[_0xa757('0x6d')]=function(_0x68a80b,_0x1f4782){var _0x5e6171=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x6e'));var _0xfdd493={'where':{'id':_0x68a80b[_0xa757('0x53')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xa757('0x2e')]['find'](_0xfdd493)['then'](handleEntityNotFound(_0x1f4782,null))[_0xa757('0x11')](function(_0x544ed2){if(_0x544ed2){if(!_['isNil'](_0x544ed2[_0xa757('0x60')])){if(fs[_0xa757('0x6f')](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x70'),_0x544ed2[_0xa757('0x60')]))){_0x5e6171=path['join'](config['root'],'server/files/images/avatars/',_0x544ed2['agentAvatar']);}}return _0x1f4782['download'](_0x5e6171);}})['catch'](handleError(_0x1f4782,null));};exports['getCustomerAvatar']=function(_0x1c9b81,_0x536b96){var _0x1ba0df=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x71'));var _0x46fd6b={'where':{'id':_0x1c9b81[_0xa757('0x53')]['id']},'attributes':['id',_0xa757('0x62'),_0xa757('0x72')],'raw':!![]};return db[_0xa757('0x2e')]['find'](_0x46fd6b)['then'](handleEntityNotFound(_0x536b96,null))[_0xa757('0x11')](function(_0x3147eb){if(_0x3147eb){if(!_[_0xa757('0x6a')](_0x3147eb[_0xa757('0x62')])){if(fs['existsSync'](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x70'),_0x3147eb[_0xa757('0x62')]))&&_0x3147eb[_0xa757('0x72')]){_0x1ba0df=path[_0xa757('0x65')](config[_0xa757('0x66')],'server/files/images/avatars/',_0x3147eb[_0xa757('0x62')]);}}return _0x536b96[_0xa757('0x6c')](_0x1ba0df);}})['catch'](handleError(_0x536b96,null));};exports[_0xa757('0x73')]=function(_0x3924af,_0x332c68){var _0x18fa30=path[_0xa757('0x65')](config['root'],_0xa757('0x74'));var _0x237c6f={'where':{'id':_0x3924af[_0xa757('0x53')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xa757('0x2e')][_0xa757('0x4b')](_0x237c6f)[_0xa757('0x11')](handleEntityNotFound(_0x332c68,null))['then'](function(_0x21aeae){if(_0x21aeae){if(!_[_0xa757('0x6a')](_0x21aeae[_0xa757('0x75')])){if(fs[_0xa757('0x6f')](path[_0xa757('0x65')](config['root'],_0xa757('0x70'),_0x21aeae['systemAvatar']))){_0x18fa30=path['join'](config[_0xa757('0x66')],_0xa757('0x70'),_0x21aeae[_0xa757('0x75')]);}}return _0x332c68[_0xa757('0x6c')](_0x18fa30);}})['catch'](handleError(_0x332c68,null));};exports[_0xa757('0x76')]=function(_0x36c462,_0x4735a9){var _0x2aa91b=require(_0xa757('0x77'));var _0x3e660e=new _0x2aa91b();var _0x182d4f=_0x3e660e[_0xa757('0x78')](_0x36c462['headers'][_0xa757('0x79')])[_0xa757('0x7a')]();var _0x1e6f99={'body':_0x36c462[_0xa757('0x4e')],'channel':_0xa757('0x7b')};var _0x182d71=[];var _0x3addae=[];var _0x4024d1={};var _0x160872=![];return db['CmContact']['describe']()[_0xa757('0x11')](function(_0x59b351){if(!_0x59b351){throw new db['Sequelize'][(_0xa757('0x7c'))]('no\x20available\x20attributes');}_0x182d71=_[_0xa757('0x7d')](_[_0xa757('0x35')](_0x59b351),[_0xa757('0x7e'),_0xa757('0x7f')]);_0x3addae=_[_0xa757('0x7d')](_[_0xa757('0x35')](_0x59b351),[_0xa757('0x7e'),_0xa757('0x7f'),_0xa757('0x80'),'ListId']);if(_0x36c462[_0xa757('0x4e')]['id']){delete _0x36c462[_0xa757('0x4e')]['id'];}if(_['isNil'](_0x36c462[_0xa757('0x4e')][_0xa757('0x81')])){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0x83'));}if(_[_0xa757('0x6a')](_0x36c462[_0xa757('0x4e')][_0xa757('0x4e')])||_0x36c462[_0xa757('0x4e')][_0xa757('0x4e')]===''){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa757('0x6a')](_0x36c462[_0xa757('0x4e')]['mapKey'])){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3addae);}if(!_[_0xa757('0x84')](_0x3addae,_0x36c462[_0xa757('0x4e')][_0xa757('0x85')])){throw new db[(_0xa757('0x82'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3addae);}_0x4024d1[_0x36c462[_0xa757('0x4e')]['mapKey']]=_0x36c462[_0xa757('0x4e')]['from'];})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x36c462[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x86')],'as':'List','include':[{'model':db['CmContact'],'as':_0xa757('0x87'),'where':_0x4024d1,'limit':0x1,'order':[[_0xa757('0x7f'),_0xa757('0x88')]]}]},{'model':db[_0xa757('0x89')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x4735a9,null))[_0xa757('0x11')](function(_0x50ff83){if(_0x50ff83&&_0x50ff83[_0xa757('0x8a')]){_0x1e6f99[_0xa757('0x8b')]=_0x50ff83;_0x1e6f99[_0xa757('0x8c')]=_0x50ff83[_0xa757('0x8d')];_0x1e6f99[_0xa757('0x8e')]=_0x50ff83[_0xa757('0x8a')];_0x1e6f99[_0xa757('0x8c')]=_['orderBy'](_0x1e6f99[_0xa757('0x8c')],[_0xa757('0x8f')],[_0xa757('0x90')]);if(_0x1e6f99[_0xa757('0x8b')][_0xa757('0x8d')]){delete _0x1e6f99[_0xa757('0x8b')][_0xa757('0x8d')];}if(_0x1e6f99['account']['List']&&_0x1e6f99[_0xa757('0x8b')][_0xa757('0x8a')][_0xa757('0x87')][_0xa757('0x39')]){return _0x1e6f99[_0xa757('0x8b')][_0xa757('0x8a')]['Contacts'][0x0];}var _0x244c9b=_['defaults'](_0x36c462[_0xa757('0x4e')],{'firstName':_0x36c462[_0xa757('0x4e')][_0xa757('0x81')],'ListId':_0x50ff83[_0xa757('0x91')]});_0x244c9b[_0x36c462[_0xa757('0x4e')][_0xa757('0x85')]]=_0x36c462[_0xa757('0x4e')][_0xa757('0x81')];return db[_0xa757('0x92')][_0xa757('0x4d')](_0x244c9b,{'fields':_0x182d71,'raw':!![]});}})['then'](handleEntityNotFound(_0x4735a9,null))['then'](function(_0x3e025a){_0x1e6f99['contact']=_0x3e025a;var _0x4bd0a6=_0x36c462[_0xa757('0x4e')][_0xa757('0x93')];if(_0x36c462['headers'][_0xa757('0x94')]){_0x4bd0a6=_0x36c462['headers'][_0xa757('0x94')];}else if(_0x36c462[_0xa757('0x95')][_0xa757('0x96')]){_0x4bd0a6=_[_0xa757('0x97')](_0x36c462[_0xa757('0x95')][_0xa757('0x96')][_0xa757('0x98')](','));}if(_0x3e025a){var _0x44d742={'ContactId':_0x3e025a['id'],'ChatWebsiteId':_0x36c462['params']['id'],'from':(_0x3e025a['firstName']||'')+'\x20'+(_0x3e025a[_0xa757('0x99')]||''),'customerIp':_0x4bd0a6,'customerPort':_0x36c462['headers'][_0xa757('0x9a')]?_0x36c462[_0xa757('0x95')][_0xa757('0x9a')]:null,'referer':_0x36c462[_0xa757('0x4e')][_0xa757('0x9b')],'browserName':_0x182d4f[_0xa757('0x9c')][_0xa757('0x29')]&&_0x182d4f[_0xa757('0x9c')]['version']?util[_0xa757('0x9d')]('%s\x20%s',_0x182d4f['browser'][_0xa757('0x29')],_0x182d4f[_0xa757('0x9c')][_0xa757('0x9e')]):_0xa757('0x9f'),'browserVersion':_0x182d4f['browser'][_0xa757('0x9e')]||'unknown','osName':util[_0xa757('0x9d')]('%s\x20%s',_0x182d4f['os'][_0xa757('0x29')],_0x182d4f['os'][_0xa757('0x9e')]),'osVersion':_0x182d4f['os']['version'],'deviceModel':_0x182d4f[_0xa757('0xa0')][_0xa757('0x33')]&&_0x182d4f['device'][_0xa757('0xa1')]?util[_0xa757('0x9d')](_0xa757('0xa2'),_0x182d4f[_0xa757('0xa0')][_0xa757('0x33')],_0x182d4f[_0xa757('0xa0')][_0xa757('0xa1')],_0x182d4f['device'][_0xa757('0x31')]):null,'deviceVendor':_0x182d4f[_0xa757('0xa0')]['vendor'],'deviceType':_0x182d4f['device'][_0xa757('0x31')],'formData':JSON[_0xa757('0x17')](_0x36c462[_0xa757('0x4e')])};var _0x1612d5={'ChatWebsiteId':_0x36c462[_0xa757('0x53')]['id'],'closed':![]};if(_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')]){_0x1612d5[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')];return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':_0x1612d5})[_0xa757('0x11')](function(_0x5758db){if(_0x5758db){return[_0x5758db,![]];}_0x44d742[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')];_0x44d742['externalUrl']=_0x36c462['body'][_0xa757('0xa5')];return db[_0xa757('0xa4')]['create'](_0x44d742)[_0xa757('0x11')](function(_0xa50160){return[_0xa50160,!![]];});});}_0x1612d5['ContactId']=_0x3e025a['id'];if(_0x36c462[_0xa757('0x4e')]['interaction']&&_0x36c462[_0xa757('0x4e')][_0xa757('0xa6')]['id']){_0x1612d5['id']=_0x36c462[_0xa757('0x4e')][_0xa757('0xa6')]['id'];return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':_0x1612d5})[_0xa757('0x11')](function(_0x69af1f){if(_0x69af1f){return[_0x69af1f,![]];}return db['ChatInteraction'][_0xa757('0x4d')](_0x44d742)['then'](function(_0x49f140){return[_0x49f140,!![]];});});}return db[_0xa757('0xa4')][_0xa757('0x4d')](_0x44d742)['then'](function(_0x488019){return[_0x488019,!![]];});}})['spread'](function(_0x31084d,_0x1f0e18){if(_0x31084d){_0x160872=_0x1f0e18;if(!_0x1f0e18){var _0x10cf3b={'from':(_0x1e6f99['contact'][_0xa757('0xa7')]||'')+'\x20'+(_0x1e6f99[_0xa757('0xa8')][_0xa757('0x99')]||'')};if(_0x36c462[_0xa757('0x4e')][_0xa757('0xa3')]&&_0x36c462[_0xa757('0x4e')][_0xa757('0xa9')]&&_0x36c462[_0xa757('0x4e')]['threadId']!=_0x36c462[_0xa757('0x4e')]['messageId']){_0x10cf3b[_0xa757('0xa3')]=_0x36c462[_0xa757('0x4e')][_0xa757('0xa9')];}return _0x31084d[_0xa757('0x23')](_0x10cf3b);}else{return _0x31084d;}}})[_0xa757('0x11')](function(_0x56c40e){_0x1e6f99[_0xa757('0xa6')]=_0x56c40e['get']({'plain':!![]});_0x1e6f99[_0xa757('0xa6')][_0xa757('0xaa')]=_0x160872;if(_0x1e6f99[_0xa757('0xa6')][_0xa757('0xaa')]){if(_0x1e6f99[_0xa757('0x8b')][_0xa757('0xab')]){_0x1e6f99[_0xa757('0x8c')][_0xa757('0xac')]({'id':0x0,'priority':_0x1e6f99[_0xa757('0x8c')]['length']+0x1,'app':'close','appdata':_0xa757('0xad'),'interval':_0xa757('0xae')});}}return db['ChatMessage'][_0xa757('0x4d')]({'body':_0x36c462[_0xa757('0x4e')]['body'],'ChatWebsiteId':_0x36c462[_0xa757('0x53')]['id'],'ChatInteractionId':_0x56c40e['id'],'direction':'in','ContactId':_0x1e6f99['contact']['id'],'AttachmentId':_0x36c462[_0xa757('0x4e')][_0xa757('0xaf')]});})[_0xa757('0x11')](function(_0x2bdbdf){_0x1e6f99[_0xa757('0x1a')]=_0x2bdbdf;if(_0x1e6f99[_0xa757('0xa6')][_0xa757('0xb0')]){return db[_0xa757('0xb1')][_0xa757('0x4b')]({'attributes':['id',_0xa757('0x29')],'where':{'id':_0x1e6f99[_0xa757('0xa6')][_0xa757('0xb0')]}})[_0xa757('0x11')](function(_0x5005fa){if(_0x5005fa){_0x1e6f99['applications'][_0xa757('0xb2')]({'id':0x0,'priority':0x0,'app':_0xa757('0xb3'),'appdata':_0x5005fa[_0xa757('0x29')]+','+(_0x1e6f99['account'][_0xa757('0xb4')]||0xa),'interval':_0xa757('0xae')});_0x1e6f99[_0xa757('0xb5')]=!![];}return respondWithRpcPromise(_0xa757('0xb6'),_0xa757('0xb7'),_0x1e6f99);});}return respondWithRpcPromise('Start','startRouting',_0x1e6f99);})[_0xa757('0x11')](function(_0x4606e1){respondWithRpcPromise(_0xa757('0xb8'),'EventManager',{'event':_0xa757('0x76'),'message':_0x4606e1},client9002);return _0x4606e1;})[_0xa757('0x11')](respondWithResult(_0x4735a9,null))['catch'](handleError(_0x4735a9,null));};exports[_0xa757('0xb9')]=function(_0x39527f,_0x257371){var _0x4f8908,_0x41d5d1,_0x5ae589;var _0x1b702f=[];var _0x3540ca={};var _0x22939e=_0x39527f[_0xa757('0xba')]||[];var _0x36ea16=[];var _0x53949c;return db[_0xa757('0x92')]['describe']()[_0xa757('0x11')](function(_0x439650){if(!_0x439650){throw new db[(_0xa757('0x82'))][(_0xa757('0x7c'))]('no\x20available\x20attributes');}_0x1b702f=_['difference'](_[_0xa757('0x35')](_0x439650),[_0xa757('0x7e'),_0xa757('0x7f'),_0xa757('0x80'),_0xa757('0x91')]);if(_0x39527f['body']['id']){delete _0x39527f['body']['id'];}if(_[_0xa757('0x6a')](_0x39527f[_0xa757('0x4e')][_0xa757('0x81')])){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))]['ValidationError'](_0xa757('0x83')));}if(_[_0xa757('0x6a')](_0x39527f[_0xa757('0x4e')]['body'])||_0x39527f[_0xa757('0x4e')][_0xa757('0x4e')]===''){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbc')));}if(_['isNil'](_0x39527f[_0xa757('0x4e')][_0xa757('0xbd')])){throw _0x257371[_0xa757('0x1d')](0x1f4)[_0xa757('0xbb')](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbe')+_0x1b702f));}if(!_['includes'](_0x1b702f,_0x39527f[_0xa757('0x4e')]['mapKeyOffline'])){throw _0x257371[_0xa757('0x1d')](0x1f4)['send'](new db[(_0xa757('0x82'))][(_0xa757('0x7c'))](_0xa757('0xbf')+_0x1b702f));}_0x3540ca[_0x39527f['body']['mapKeyOffline']]=_0x39527f['body'][_0xa757('0x81')];})[_0xa757('0x11')](function(){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x39527f['params']['id']},'include':[{'model':db[_0xa757('0x86')],'as':'List'},{'model':db[_0xa757('0xc0')],'as':_0xa757('0xc0')}]});})[_0xa757('0x11')](handleEntityNotFound(_0x257371,null))['then'](function(_0x42d869){if(_0x42d869&&_0x42d869['List']){_0x41d5d1=_0x42d869;var _0x2cd549=_[_0xa757('0xc1')](_0x39527f['body'],{'firstName':_0x39527f[_0xa757('0x4e')][_0xa757('0x81')],'phone':_0x39527f[_0xa757('0x4e')]['from'],'ListId':_0x42d869['ListId']});_0x2cd549[_0x39527f['body'][_0xa757('0xbd')]]=_0x39527f[_0xa757('0x4e')]['from'];return db['CmContact'][_0xa757('0xc2')]({'where':_0x3540ca,'defaults':_0x2cd549});}})[_0xa757('0xc3')](function(_0x1b7a7b){if(_0x1b7a7b){_0x5ae589=_0x1b7a7b;var _0x4da912=fs['readFileSync'](path['join'](config[_0xa757('0x66')],_0xa757('0xc4')),_0xa757('0xc5'));var _0x330523=ejs[_0xa757('0xc6')](_0x4da912,{'body':_[_0xa757('0xc7')](_0x39527f[_0xa757('0x4e')][_0xa757('0x4e')]),'bodyTitle':_0x41d5d1['offlineMessageBody']});return db[_0xa757('0xc8')][_0xa757('0x4d')]({'body':_0x330523,'plainBody':htmlToText['fromString'](_0x330523),'ContactId':_0x1b7a7b['id'],'ChatWebsiteId':_0x41d5d1['id']});}})[_0xa757('0x11')](function(_0x28ef9c){_0x53949c=_0x28ef9c;if(_0x22939e[_0xa757('0x39')]){var _0x34b501=_0x22939e[_0xa757('0x2d')](function(_0x9b7857){return{'name':_0x9b7857[_0xa757('0xc9')],'basename':_0x9b7857[_0xa757('0x61')],'type':_0x9b7857[_0xa757('0xca')],'ChatOfflineMessageId':_0x28ef9c['id']};});_0x36ea16=_0x34b501[_0xa757('0x2d')](_0x39afb0=>{var _0x1c55ad={'filename':_0x39afb0['name'],'path':path['join'](config[_0xa757('0x66')],_0xa757('0xcb'),_0xa757('0xba'),_0xa757('0xcc'),_0xa757('0xcd'),_0x39afb0[_0xa757('0xce')])};return _0x1c55ad;});if(!_0x41d5d1[_0xa757('0xcf')]){return db['sequelize'][_0xa757('0xd0')](function(_0x2266db){return db[_0xa757('0xd1')][_0xa757('0xd2')](_0x34b501,{'transaction':_0x2266db});});}}})[_0xa757('0x11')](function(){if(_0x53949c){_0x4f8908=_0x53949c;return db[_0xa757('0xc0')][_0xa757('0xd3')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xa757('0xd4'),'raw':!![]}]});}})[_0xa757('0x11')](function(_0x4ddabe){if(_0x4ddabe&&_0x4ddabe['Smtp']&&_0x41d5d1['forwardOffline']&&_0x41d5d1[_0xa757('0xd5')]){var _0x50f3e3={'tls':{'rejectUnauthorized':![]}};if(_0x4ddabe['Smtp'][_0xa757('0xd6')]){_0x50f3e3[_0xa757('0xd6')]=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd6')];}else{_0x50f3e3['host']=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd7')];_0x50f3e3['port']=_0x4ddabe[_0xa757('0xd4')][_0xa757('0xd8')];_0x50f3e3[_0xa757('0xd9')]=_0x4ddabe[_0xa757('0xd4')]['secure'];}if(_0x4ddabe[_0xa757('0xd4')][_0xa757('0xda')]){_0x50f3e3[_0xa757('0xdb')]={'user':_0x4ddabe[_0xa757('0xd4')][_0xa757('0x4f')],'pass':_0x4ddabe[_0xa757('0xd4')][_0xa757('0xdc')]};}return respondWithRpcPromise(_0xa757('0xdd'),_0xa757('0xde'),{'account':_0x50f3e3,'message':{'from':util['format'](_0xa757('0xdf'),_0x4ddabe[_0xa757('0x29')],_0x4ddabe[_0xa757('0xe0')]||_0x4ddabe[_0xa757('0xd4')][_0xa757('0x4f')]),'to':_0x41d5d1[_0xa757('0xd5')],'subject':_0x41d5d1[_0xa757('0xe1')],'html':_0x4f8908['body'],'attachments':_0x36ea16}},client9003)[_0xa757('0x11')](function(){return _0x4f8908;})[_0xa757('0x4c')](function(_0x2fa389){console[_0xa757('0x18')](_0x2fa389);});}})[_0xa757('0x11')](function(){if(_0x41d5d1&&_0x41d5d1[_0xa757('0xcf')]&&_0x41d5d1[_0xa757('0xe2')]){var _0x1eeff5=[];if(_0x22939e[_0xa757('0x39')]){_0x1eeff5=_0x22939e['map'](function(_0xe4b4ab){return{'name':_0xe4b4ab['originalname'],'basename':_0xe4b4ab['filename'],'type':_0xe4b4ab[_0xa757('0xca')],'ChatOfflineMessageId':_0x53949c['id']};});}var _0x48cf01;if(!_[_0xa757('0x6a')](_0x41d5d1[_0xa757('0xe3')])){var _0x54f4ca=_[_0xa757('0x2d')](_0x39527f['body'],function(_0x522478){return _0x522478;});var _0x451ca7=_['toPairsIn'](_0x54f4ca)[0x0];var _0x5730f3=_['mapValues'](_0x451ca7,function(_0x52aed8){return _0x52aed8;});_0x48cf01=_0x5730f3[0x1][_0x41d5d1['subjectOffline']];}var _0x3a98f9={'from':_0x5ae589[_0xa757('0xe0')],'firstName':_0x5ae589[_0xa757('0xa7')],'lastName':_0x5ae589[_0xa757('0x99')],'mapKey':'email','message':{'from':_0x5ae589[_0xa757('0xe0')],'to':_0x41d5d1[_0xa757('0xc0')][_0xa757('0xe0')],'cc':'','subject':_[_0xa757('0x6a')](_0x48cf01)?_0x41d5d1[_0xa757('0xe1')]:_0x48cf01,'messageId':'','sentAt':new Date(),'attach':_0x1eeff5[_0xa757('0x39')],'attachments':_0x1eeff5,'originChannel':_0xa757('0xe4'),'ChatWebsiteId':_0x41d5d1['id'],'ChatOfflineMessageId':_0x4f8908['id'],'originTo':_0x41d5d1['MailAccount'][_0xa757('0xe0')]},'body':_0x4f8908[_0xa757('0x4e')]};var _0x5be779={'account':{'id':_0x41d5d1[_0xa757('0xe2')]},'body':_0x3a98f9,'log':_0xa757('0xe5')};return respondWithRpcPromise('NotifyMailAccount',_0xa757('0xe6'),_0x5be779,client9001)[_0xa757('0x11')](function(){return _0x4f8908;})[_0xa757('0x4c')](function(_0x2aaf2a){console[_0xa757('0x18')](_0x2aaf2a);});}return;})[_0xa757('0x11')](function(){if(_0x4f8908){return _0x4f8908;}})[_0xa757('0x11')](respondWithResult(_0x257371,null))['catch'](function(_0x3d79d4){console[_0xa757('0x18')](_0xa757('0x4c'),_0x3d79d4);for(var _0x2f667c of _0x22939e){var _0x531b88=path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0xcb'),'files',_0xa757('0xcc'),_0xa757('0xcd'),_0x2f667c['filename']);fs_extra[_0xa757('0xe7')](_0x531b88)['catch'](function(_0x1c38cb){console['error'](_0xa757('0xe8'),_0x531b88,_0x1c38cb);});}});};exports[_0xa757('0xe9')]=function(_0x3039d7,_0x58f20d){return db[_0xa757('0xa4')][_0xa757('0x4b')]({'where':{'id':_0x3039d7[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x58f20d,null))[_0xa757('0x11')](function(_0x4b274f){if(_0x4b274f){return _0x4b274f[_0xa757('0xe9')](_0x3039d7[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x3039d7[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{});}})['then'](respondWithResult(_0x58f20d,null))[_0xa757('0x4c')](handleError(_0x58f20d,null));};exports[_0xa757('0xeb')]=function(_0x35a0d8,_0x430ed6){var _0x31dba9={'raw':![],'where':{}};var _0x3eb7d4={};var _0x1b8b13={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xa757('0xd3')]({'where':{'id':_0x35a0d8['params']['id']}})['then'](handleEntityNotFound(_0x430ed6,null))[_0xa757('0x11')](function(_0x3655fa){if(_0x3655fa){_0x3eb7d4[_0xa757('0x33')]=_['keys'](db[_0xa757('0xa4')]['rawAttributes']);_0x3eb7d4[_0xa757('0x34')]=_[_0xa757('0x35')](_0x35a0d8['query']);_0x3eb7d4[_0xa757('0x40')]=_['intersection'](_0x3eb7d4[_0xa757('0x33')],_0x3eb7d4[_0xa757('0x34')]);_0x31dba9[_0xa757('0x37')]=_[_0xa757('0x36')](_0x3eb7d4[_0xa757('0x33')],qs[_0xa757('0x38')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x38')]));_0x31dba9[_0xa757('0x37')]=_0x31dba9[_0xa757('0x37')][_0xa757('0x39')]?_0x31dba9['attributes']:_0x3eb7d4[_0xa757('0x33')];if(!_0x35a0d8[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x31dba9[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x21')]);_0x31dba9['offset']=qs[_0xa757('0x3c')](_0x35a0d8['query'][_0xa757('0x3c')]);}_0x31dba9[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x35a0d8[_0xa757('0x34')][_0xa757('0x3e')]);_0x31dba9['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x35a0d8[_0xa757('0x34')],_0x3eb7d4['filters']));_0x31dba9[_0xa757('0x3f')]['ChatWebsiteId']=_0x3655fa['id'];if(_0x35a0d8['query'][_0xa757('0x42')]){_0x31dba9[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x31dba9[_0xa757('0x3f')],{'$or':_['map'](_0x31dba9[_0xa757('0x37')],function(_0xdc5215){var _0x41c5ec={};_0x41c5ec[_0xdc5215]={'$like':'%'+_0x35a0d8[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x41c5ec;})});}_0x31dba9=_['merge']({},_0x31dba9,_0x35a0d8['options']);return db['ChatInteraction']['count']({'where':_0x31dba9[_0xa757('0x3f')]})['then'](function(_0xb64ce5){_0x1b8b13[_0xa757('0x46')]=_0xb64ce5;if(_0x35a0d8[_0xa757('0x34')][_0xa757('0x56')]){_0x31dba9[_0xa757('0x47')]=[{'model':db[_0xa757('0x92')],'as':_0xa757('0xec'),'required':![]},{'model':db[_0xa757('0xb1')],'as':_0xa757('0xed'),'attributes':[_0xa757('0x29'),_0xa757('0xee'),_0xa757('0xef')],'required':![]},{'model':db[_0xa757('0xf0')],'as':_0xa757('0xf1'),'attributes':['id',_0xa757('0x29'),_0xa757('0xf2')],'where':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]?{'id':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]}:undefined,'required':_0x35a0d8[_0xa757('0x34')][_0xa757('0xf3')]?!![]:![]}];}return db[_0xa757('0xa4')][_0xa757('0x48')](_0x31dba9);})[_0xa757('0x11')](function(_0x1f0f82){_0x1b8b13[_0xa757('0x49')]=_0x1f0f82;return _0x1b8b13;});}})[_0xa757('0x11')](respondWithFilteredResult(_0x430ed6,_0x31dba9))['catch'](handleError(_0x430ed6,null));};function iftimePromise(_0x3bd029,_0x2f37ca){return respondWithRpcPromise(_0xa757('0xf4'),_0xa757('0xf5'),{'command':_0x2f37ca['timezone']?util[_0xa757('0x9d')](_0xa757('0xf6'),_0x3bd029[_0xa757('0xf7')],_0x2f37ca[_0xa757('0xf8')]):util[_0xa757('0x9d')](_0xa757('0xf9'),_0x3bd029[_0xa757('0xf7')])},client9002)[_0xa757('0x11')](function(_0x7e03ff){var _0x1bb7ed=_0x7e03ff&&_0x7e03ff[_0xa757('0xfa')](_0xa757('0xfb'))>=0x0?!![]:![];logger[_0xa757('0x12')](_0xa757('0xfc'),_0x2f37ca['id'],_0x3bd029['id'],_0x3bd029['interval'],_0x1bb7ed?_0xa757('0xfd'):_0xa757('0xfe'),_0x2f37ca['timezone']?_0x2f37ca[_0xa757('0xf8')]:_0xa757('0xff'));return _0x1bb7ed;})[_0xa757('0x4c')](function(_0x466f7b){logger['error'](_0xa757('0xfc'),_0x2f37ca['id'],_0x3bd029['id'],_0x3bd029[_0xa757('0xf7')],util[_0xa757('0x100')](_0x466f7b,{'showHidden':![],'depth':null}),_0x2f37ca[_0xa757('0xf8')]?_0x2f37ca[_0xa757('0xf8')]:_0xa757('0xff'));return![];});}exports[_0xa757('0xf5')]=function(_0x195707,_0x32311d){var _0x1d83a8=0x0;var _0x2da3b2=0x0;var _0x4f10fc=![];var _0x5d427d;var _0x5ad837;return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x195707[_0xa757('0x53')]['id']},'include':[{'model':db[_0xa757('0x101')],'as':_0xa757('0x101'),'include':[{'model':db[_0xa757('0x101')],'as':_0xa757('0x102'),'attributes':['id',_0xa757('0xf7')],'raw':!![]}]}]})[_0xa757('0x11')](handleEntityNotFound(_0x32311d,null))[_0xa757('0x11')](function(_0x46c664){if(_0x46c664){_0x5d427d=_0x46c664;return _0x46c664[_0xa757('0x103')]({'raw':!![]});}})[_0xa757('0x11')](function(_0x7af4cd){if(_0x5d427d){if(_0x7af4cd){_0x5ad837=_0x7af4cd;}}return require(_0xa757('0x68'))[_0xa757('0x104')]();})[_0xa757('0x11')](function(_0x38727a){if(_0x38727a){_0x2da3b2=_0x38727a[_0xa757('0x105')];_0x4f10fc=_0x38727a[_0xa757('0x69')];}})[_0xa757('0x11')](function(){return db[_0xa757('0xa4')][_0xa757('0x46')]({'where':{'closed':![]}});})[_0xa757('0x11')](function(_0x196823){_0x1d83a8=_0x196823;if(_0x2da3b2&&_0x196823>_0x2da3b2){return db['License'][_0xa757('0xd3')]({'where':{'id':0x1}})[_0xa757('0x11')](function(_0x2328eb){if(_0x2328eb){_0x2328eb[_0xa757('0x106')]('chatLicenseExceeded');}});}})[_0xa757('0x11')](function(){if(_0x5d427d['Interval']&&_0x5d427d[_0xa757('0x101')][_0xa757('0x102')]){var _0x1a2818=[];for(var _0x56b7f3=0x0;_0x56b7f3<_0x5d427d[_0xa757('0x101')]['Intervals']['length'];_0x56b7f3++){var _0x411c88=_0x5d427d[_0xa757('0x101')]['Intervals'][_0x56b7f3][_0xa757('0x25')]({'plain':!![]});_0x1a2818[_0xa757('0xac')](iftimePromise(_0x411c88,_0x5d427d));}return BPromise[_0xa757('0x107')](_0x1a2818)[_0xa757('0x11')](function(_0x39442a){return _[_0xa757('0x108')](_0x39442a);});}else{return!![];}})[_0xa757('0x11')](function(_0x3ef371){var _0x46465a=fs[_0xa757('0x109')](path[_0xa757('0x65')](config[_0xa757('0x66')],_0xa757('0x10a')),_0xa757('0xc5'));var _0x466b78={'remote':_0x5d427d[_0xa757('0x10b')],'query':querystring[_0xa757('0x17')](_[_0xa757('0x43')](_0x5d427d[_0xa757('0x25')]({'plain':!![]}),{'customerIp':_0x195707['headers']['x-forwarded-for']||_0x195707[_0xa757('0x95')][_0xa757('0x10c')]||_0x195707[_0xa757('0x10d')][_0xa757('0x10e')]||_0x195707['ip'],'referer':_0x195707[_0xa757('0x95')][_0xa757('0x9b')],'openedInteractions':_0x1d83a8,'maxInteractions':_0x2da3b2,'virtual':_0x4f10fc[_0xa757('0x105')],'online':_0x3ef371,'custom':_0x4f10fc}))['replace'](/'/g,'\x5c\x27')};_0x32311d[_0xa757('0xbb')](ejs[_0xa757('0xc6')](Mustache[_0xa757('0xc6')](_0x46465a,_0x466b78),{'proactiveActions':_0x5ad837,'alignment':_0x5d427d[_0xa757('0x10f')],'verticalAlignment':_0x5d427d[_0xa757('0x110')],'div_color':_0x5d427d['color'],'labelText':_0x5d427d[_0xa757('0x111')],'text_color':_0x5d427d['textColor'],'button_color':_0x5d427d[_0xa757('0x112')],'background_color':_0x5d427d['backgroundColor']}));})[_0xa757('0x4c')](handleError(_0x32311d,null));};exports[_0xa757('0x113')]=function(_0x52a8a8,_0x59039a){var _0x2892a7=_0x52a8a8[_0xa757('0x53')]['id'];var _0x54a489=_0x52a8a8[_0xa757('0x4e')];var _0xe21512=0xc8;var _0x25aad1=null;return db[_0xa757('0x114')][_0xa757('0xd0')]({'isolationLevel':db[_0xa757('0x114')]['Transaction'][_0xa757('0x115')][_0xa757('0x116')]},function(_0x1132f2){return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x2892a7},'transaction':_0x1132f2})[_0xa757('0x11')](function(_0x1e3ee8){if(_0x1e3ee8){return db[_0xa757('0x89')][_0xa757('0x24')]({'where':{'ChatWebsiteId':_0x2892a7},'transaction':_0x1132f2})[_0xa757('0x11')](function(){var _0x17135b=_[_0xa757('0x2d')](_0x54a489,function(_0x4ebd06){_0x4ebd06[_0xa757('0x54')]=_0x2892a7;return _0x4ebd06;});return db[_0xa757('0x89')][_0xa757('0xd2')](_0x17135b,{'transaction':_0x1132f2});});}else{_0xe21512=0x194;_0x25aad1=[];}});})[_0xa757('0x11')](function(){if(_0xe21512!==0x194){return db['ChatApplication'][_0xa757('0x117')]({'where':{'ChatWebsiteId':_0x2892a7},'order':_0xa757('0x8f')})[_0xa757('0x11')](function(_0x141d20){_0x25aad1=_0x141d20;});}})[_0xa757('0x4c')](function(_0x54f67c){_0xe21512=0x1f4;logger[_0xa757('0x18')](_0x54f67c[_0xa757('0x28')]);if(_0x54f67c[_0xa757('0x29')]){delete _0x54f67c[_0xa757('0x29')];}_0x25aad1=_0x54f67c;})[_0xa757('0x118')](function(){if(_0x25aad1===null){_0x59039a[_0xa757('0x1c')](_0xe21512);}else{if(_0xe21512===0x1f4){_0x59039a[_0xa757('0x1d')](_0xe21512)[_0xa757('0xbb')](_0x25aad1);}else{_0x59039a[_0xa757('0x1d')](_0xe21512)['json'](_0x25aad1);}}});};exports[_0xa757('0x119')]=function(_0x505a2a,_0x344d13){var _0x5836cd={};var _0x35fe4e={};var _0x418eeb;var _0xc25de1;return db[_0xa757('0x2e')]['findOne']({'where':{'id':_0x505a2a[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x344d13,null))[_0xa757('0x11')](function(_0x16a500){if(_0x16a500){_0x418eeb=_0x16a500;_0x35fe4e[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0x89')][_0xa757('0x2f')]);_0x35fe4e[_0xa757('0x34')]=_[_0xa757('0x35')](_0x505a2a[_0xa757('0x34')]);_0x35fe4e[_0xa757('0x40')]=_[_0xa757('0x36')](_0x35fe4e[_0xa757('0x33')],_0x35fe4e[_0xa757('0x34')]);_0x5836cd[_0xa757('0x37')]=_[_0xa757('0x36')](_0x35fe4e[_0xa757('0x33')],qs[_0xa757('0x38')](_0x505a2a[_0xa757('0x34')][_0xa757('0x38')]));_0x5836cd[_0xa757('0x37')]=_0x5836cd[_0xa757('0x37')]['length']?_0x5836cd[_0xa757('0x37')]:_0x35fe4e[_0xa757('0x33')];_0x5836cd[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x505a2a[_0xa757('0x34')][_0xa757('0x3e')]);_0x5836cd[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x505a2a[_0xa757('0x34')],_0x35fe4e['filters']));if(_0x505a2a['query'][_0xa757('0x42')]){_0x5836cd[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x5836cd[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x5836cd['attributes'],function(_0xf19c44){var _0x648a92={};_0x648a92[_0xf19c44]={'$like':'%'+_0x505a2a[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x648a92;})});}_0x5836cd=_[_0xa757('0x43')]({},_0x5836cd,_0x505a2a[_0xa757('0x45')]);return _0x418eeb[_0xa757('0x119')](_0x5836cd);}})['then'](function(_0x4c53e3){if(_0x4c53e3){_0xc25de1=_0x4c53e3[_0xa757('0x39')];if(!_0x505a2a[_0xa757('0x34')]['hasOwnProperty']('nolimit')){_0x5836cd['limit']=qs[_0xa757('0x21')](_0x505a2a[_0xa757('0x34')][_0xa757('0x21')]);_0x5836cd[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x505a2a[_0xa757('0x34')]['offset']);}return _0x418eeb[_0xa757('0x119')](_0x5836cd);}})['then'](function(_0x14ab00){if(_0x14ab00){return _0x14ab00?{'count':_0xc25de1,'rows':_0x14ab00}:null;}})[_0xa757('0x11')](respondWithResult(_0x344d13,null))[_0xa757('0x4c')](handleError(_0x344d13,null));};exports['addProactiveActions']=function(_0x34cd11,_0xd8ff77){return db[_0xa757('0x11a')][_0xa757('0x4b')]({'where':{'id':_0x34cd11[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0xd8ff77,null))[_0xa757('0x11')](function(_0x5da427){if(_0x5da427){return _0x5da427[_0xa757('0x11b')](_0x34cd11[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x34cd11[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{});}})['then'](respondWithResult(_0xd8ff77,null))[_0xa757('0x4c')](handleError(_0xd8ff77,null));};exports[_0xa757('0x103')]=function(_0x4067a2,_0x2e8eb6){var _0x3e454d={};var _0x265365={};var _0x3b12e9;var _0x1b753b;return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x4067a2[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x2e8eb6,null))[_0xa757('0x11')](function(_0x119e10){if(_0x119e10){_0x3b12e9=_0x119e10;_0x265365['model']=_[_0xa757('0x35')](db[_0xa757('0x11c')]['rawAttributes']);_0x265365['query']=_[_0xa757('0x35')](_0x4067a2[_0xa757('0x34')]);_0x265365[_0xa757('0x40')]=_[_0xa757('0x36')](_0x265365[_0xa757('0x33')],_0x265365[_0xa757('0x34')]);_0x3e454d['attributes']=_[_0xa757('0x36')](_0x265365[_0xa757('0x33')],qs['fields'](_0x4067a2[_0xa757('0x34')][_0xa757('0x38')]));_0x3e454d['attributes']=_0x3e454d['attributes']['length']?_0x3e454d[_0xa757('0x37')]:_0x265365[_0xa757('0x33')];_0x3e454d['order']=qs[_0xa757('0x3e')](_0x4067a2['query'][_0xa757('0x3e')]);_0x3e454d[_0xa757('0x3f')]=qs['filters'](_['pick'](_0x4067a2[_0xa757('0x34')],_0x265365[_0xa757('0x40')]));if(_0x4067a2[_0xa757('0x34')][_0xa757('0x42')]){_0x3e454d[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x3e454d['where'],{'$or':_[_0xa757('0x2d')](_0x3e454d[_0xa757('0x37')],function(_0x5c371b){var _0x5c1bae={};_0x5c1bae[_0x5c371b]={'$like':'%'+_0x4067a2[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x5c1bae;})});}_0x3e454d=_['merge']({},_0x3e454d,_0x4067a2['options']);return _0x3b12e9['getProactiveActions'](_0x3e454d);}})[_0xa757('0x11')](function(_0x21a21d){if(_0x21a21d){_0x1b753b=_0x21a21d[_0xa757('0x39')];if(!_0x4067a2[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x3e454d[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x4067a2['query']['limit']);_0x3e454d[_0xa757('0x3c')]=qs[_0xa757('0x3c')](_0x4067a2['query'][_0xa757('0x3c')]);}return _0x3b12e9[_0xa757('0x103')](_0x3e454d);}})[_0xa757('0x11')](function(_0x2d94f8){if(_0x2d94f8){return _0x2d94f8?{'count':_0x1b753b,'rows':_0x2d94f8}:null;}})[_0xa757('0x11')](respondWithResult(_0x2e8eb6,null))[_0xa757('0x4c')](handleError(_0x2e8eb6,null));};exports[_0xa757('0x11d')]=function(_0x26957f,_0x3c7bf7){var _0x1d431e=_0x26957f[_0xa757('0x34')]['online']===_0xa757('0x11e')?_0xa757('0x11f'):_0xa757('0x120');return db['ChatWebsite'][_0xa757('0x4b')]({'attributes':['id',_0x1d431e],'where':{'id':_0x26957f[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x3c7bf7,null))[_0xa757('0x11')](function(_0x325afa){if(_0x325afa){var _0x4be11c=_0x325afa[_0x1d431e];var _0x2c06d5=_0x4be11c&&_0x4be11c[_0xa757('0x121')]?_0x4be11c[_0xa757('0x121')]:[];_0x3c7bf7[_0xa757('0xbb')]({'fromKey':_[_0xa757('0x6a')](_0x4be11c[_0xa757('0x122')])?undefined:_0x4be11c['fromKey'],'count':_0x2c06d5[_0xa757('0x39')],'rows':_0x2c06d5});}})[_0xa757('0x4c')](handleError(_0x3c7bf7,null));};exports[_0xa757('0x123')]=function(_0x193bd6,_0x4ed18b){var _0x3ae2d6={'raw':![],'where':{}};var _0x1f687b={};var _0x40d442={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x193bd6[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x4ed18b,null))['then'](function(_0x5cce3e){if(_0x5cce3e){_0x1f687b[_0xa757('0x33')]=_[_0xa757('0x35')](db[_0xa757('0xc8')][_0xa757('0x2f')]);_0x1f687b['query']=_[_0xa757('0x35')](_0x193bd6[_0xa757('0x34')]);_0x1f687b[_0xa757('0x40')]=_[_0xa757('0x36')](_0x1f687b['model'],_0x1f687b[_0xa757('0x34')]);_0x3ae2d6[_0xa757('0x37')]=_[_0xa757('0x36')](_0x1f687b[_0xa757('0x33')],qs[_0xa757('0x38')](_0x193bd6[_0xa757('0x34')][_0xa757('0x38')]));_0x3ae2d6[_0xa757('0x37')]=_0x3ae2d6[_0xa757('0x37')][_0xa757('0x39')]?_0x3ae2d6[_0xa757('0x37')]:_0x1f687b[_0xa757('0x33')];if(!_0x193bd6[_0xa757('0x34')][_0xa757('0x3a')](_0xa757('0x3b'))){_0x3ae2d6[_0xa757('0x21')]=qs['limit'](_0x193bd6[_0xa757('0x34')][_0xa757('0x21')]);_0x3ae2d6['offset']=qs[_0xa757('0x3c')](_0x193bd6[_0xa757('0x34')][_0xa757('0x3c')]);}_0x3ae2d6[_0xa757('0x3d')]=qs['sort'](_0x193bd6[_0xa757('0x34')][_0xa757('0x3e')]);_0x3ae2d6['where']=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x193bd6[_0xa757('0x34')],_0x1f687b[_0xa757('0x40')]));_0x3ae2d6['where'][_0xa757('0x54')]=_0x5cce3e['id'];if(_0x193bd6[_0xa757('0x34')][_0xa757('0x42')]){_0x3ae2d6['where']=_['merge'](_0x3ae2d6[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x3ae2d6[_0xa757('0x37')],function(_0x5df3a1){var _0x3949b5={};_0x3949b5[_0x5df3a1]={'$like':'%'+_0x193bd6[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x3949b5;})});}_0x3ae2d6=_['merge']({},_0x3ae2d6,_0x193bd6[_0xa757('0x45')]);return db['ChatOfflineMessage'][_0xa757('0x46')]({'where':_0x3ae2d6[_0xa757('0x3f')]})[_0xa757('0x11')](function(_0x3d3fbe){_0x40d442[_0xa757('0x46')]=_0x3d3fbe;if(_0x193bd6['query'][_0xa757('0x56')]){_0x3ae2d6[_0xa757('0x47')]=[{'all':!![]}];}else{_0x3ae2d6['include']=[{'model':db[_0xa757('0x92')],'as':_0xa757('0xec'),'required':![]},{'model':db[_0xa757('0xd1')],'as':_0xa757('0x124'),'required':![]}];}return db[_0xa757('0xc8')][_0xa757('0x48')](_0x3ae2d6);})[_0xa757('0x11')](function(_0x4779a1){_0x40d442[_0xa757('0x49')]=_0x4779a1;return _0x40d442;});}})['then'](respondWithFilteredResult(_0x4ed18b,_0x3ae2d6))[_0xa757('0x4c')](handleError(_0x4ed18b,null));};exports['addAgents']=function(_0x153d6e,_0x5cce1a){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x153d6e[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x5cce1a,null))['then'](function(_0x19d612){if(_0x19d612){return _0x19d612[_0xa757('0x125')](_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')],_[_0xa757('0xea')](_0x153d6e[_0xa757('0x4e')],[_0xa757('0x58'),'id'])||{})['spread'](function(_0x2dd360){for(var _0x17a46c=0x0;_0x17a46c<_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')][_0xa757('0x39')];_0x17a46c+=0x1){socket['emit'](_0xa757('0x126'),{'UserId':Number(_0x153d6e[_0xa757('0x4e')][_0xa757('0x58')][_0x17a46c]),'ChatWebsiteId':Number(_0x153d6e[_0xa757('0x53')]['id'])});}return _0x2dd360;});}})[_0xa757('0x11')](respondWithResult(_0x5cce1a,null))[_0xa757('0x4c')](handleError(_0x5cce1a,null));};exports[_0xa757('0x127')]=function(_0x509030,_0x20c801){return db[_0xa757('0x2e')][_0xa757('0x4b')]({'where':{'id':_0x509030[_0xa757('0x53')]['id']}})[_0xa757('0x11')](handleEntityNotFound(_0x20c801,null))[_0xa757('0x11')](function(_0x2f435e){if(_0x2f435e){return _0x2f435e[_0xa757('0x127')](_0x509030['query'][_0xa757('0x58')])[_0xa757('0x11')](function(){if(_[_0xa757('0x128')](_0x509030['query']['ids'])){for(var _0x38ebb2=0x0;_0x38ebb2<_0x509030[_0xa757('0x34')][_0xa757('0x58')][_0xa757('0x39')];_0x38ebb2+=0x1){socket[_0xa757('0x129')](_0xa757('0x12a'),{'UserId':Number(_0x509030[_0xa757('0x34')][_0xa757('0x58')][_0x38ebb2]),'ChatWebsiteId':Number(_0x509030[_0xa757('0x53')]['id'])});}}else{socket['emit'](_0xa757('0x12a'),{'UserId':Number(_0x509030['query'][_0xa757('0x58')]),'ChatWebsiteId':Number(_0x509030[_0xa757('0x53')]['id'])});}});}})[_0xa757('0x11')](respondWithStatusCode(_0x20c801,null))['catch'](handleError(_0x20c801,null));};exports[_0xa757('0x12b')]=function(_0x13dd20,_0x42a68c){var _0x35b73f={};var _0x45249e={};var _0x381ec6;var _0x29ebb3;return db[_0xa757('0x2e')][_0xa757('0xd3')]({'where':{'id':_0x13dd20[_0xa757('0x53')]['id']}})['then'](handleEntityNotFound(_0x42a68c,null))[_0xa757('0x11')](function(_0x39ee36){if(_0x39ee36){_0x381ec6=_0x39ee36;_0x45249e[_0xa757('0x33')]=_['keys'](db['User'][_0xa757('0x2f')]);_0x45249e['query']=_[_0xa757('0x35')](_0x13dd20['query']);_0x45249e['filters']=_[_0xa757('0x36')](_0x45249e[_0xa757('0x33')],_0x45249e[_0xa757('0x34')]);_0x35b73f[_0xa757('0x37')]=_[_0xa757('0x36')](_0x45249e[_0xa757('0x33')],qs['fields'](_0x13dd20['query'][_0xa757('0x38')]));_0x35b73f[_0xa757('0x37')]=_0x35b73f['attributes']['length']?_0x35b73f['attributes']:_0x45249e[_0xa757('0x33')];_0x35b73f[_0xa757('0x3d')]=qs[_0xa757('0x3e')](_0x13dd20['query'][_0xa757('0x3e')]);_0x35b73f[_0xa757('0x3f')]=qs[_0xa757('0x40')](_[_0xa757('0x41')](_0x13dd20[_0xa757('0x34')],_0x45249e[_0xa757('0x40')]));if(_0x13dd20[_0xa757('0x34')][_0xa757('0x42')]){_0x35b73f[_0xa757('0x3f')]=_[_0xa757('0x43')](_0x35b73f[_0xa757('0x3f')],{'$or':_[_0xa757('0x2d')](_0x35b73f[_0xa757('0x37')],function(_0x32f78f){var _0x4fc399={};_0x4fc399[_0x32f78f]={'$like':'%'+_0x13dd20[_0xa757('0x34')]['filter']+'%'};return _0x4fc399;})});}_0x35b73f=_[_0xa757('0x43')]({},_0x35b73f,_0x13dd20[_0xa757('0x45')]);return _0x381ec6[_0xa757('0x12b')](_0x35b73f);}})[_0xa757('0x11')](function(_0xe79266){if(_0xe79266){_0x29ebb3=_0xe79266[_0xa757('0x39')];if(!_0x13dd20[_0xa757('0x34')][_0xa757('0x3a')]('nolimit')){_0x35b73f[_0xa757('0x21')]=qs[_0xa757('0x21')](_0x13dd20[_0xa757('0x34')][_0xa757('0x21')]);_0x35b73f[_0xa757('0x3c')]=qs['offset'](_0x13dd20[_0xa757('0x34')][_0xa757('0x3c')]);}return _0x381ec6[_0xa757('0x12b')](_0x35b73f);}})[_0xa757('0x11')](function(_0x2a5c0a){if(_0x2a5c0a){return _0x2a5c0a?{'count':_0x29ebb3,'rows':_0x2a5c0a}:null;}})[_0xa757('0x11')](respondWithResult(_0x42a68c,null))[_0xa757('0x4c')](handleError(_0x42a68c,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 316769b..d2c72e0 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 _0x6183=['emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite','setMaxListeners','update','remove'];(function(_0x287813,_0x314990){var _0x4a5f0f=function(_0x233a14){while(--_0x233a14){_0x287813['push'](_0x287813['shift']());}};_0x4a5f0f(++_0x314990);}(_0x6183,0x19b));var _0x3618=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0x6183[_0x2f48cd];return _0x193ae2;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x3618('0x0'))['db'][_0x3618('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x3618('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3618('0x3'),'afterDestroy':_0x3618('0x4')};function emitEvent(_0x176f61){return function(_0x2d62a7,_0x21af62,_0x10918c){ChatWebsiteEvents[_0x3618('0x5')](_0x176f61+':'+_0x2d62a7['id'],_0x2d62a7);ChatWebsiteEvents[_0x3618('0x5')](_0x176f61,_0x2d62a7);_0x10918c(null);};}for(var e in events){if(events[_0x3618('0x6')](e)){var event=events[e];ChatWebsite[_0x3618('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0xedd9=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ba94a,_0x20634f){_0x2ba94a=_0x2ba94a-0x0;var _0x55f423=_0xedd9[_0x2ba94a];return _0x55f423;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){ChatWebsiteEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);ChatWebsiteEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index fabe87d..9faf739 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 _0x9971=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util'];(function(_0x4c2b0b,_0x5343c9){var _0x1c5b6e=function(_0x10c843){while(--_0x10c843){_0x4c2b0b['push'](_0x4c2b0b['shift']());}};_0x1c5b6e(++_0x5343c9);}(_0x9971,0xc1));var _0x1997=function(_0x429ff9,_0x56ebe1){_0x429ff9=_0x429ff9-0x0;var _0x52cf52=_0x9971[_0x429ff9];return _0x52cf52;};'use strict';var _=require(_0x1997('0x0'));var util=require(_0x1997('0x1'));var logger=require(_0x1997('0x2'))(_0x1997('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1997('0x4'));var fs=require('fs');var path=require(_0x1997('0x5'));var rimraf=require(_0x1997('0x6'));var config=require(_0x1997('0x7'));var attributes=require(_0x1997('0x8'));module[_0x1997('0x9')]=function(_0xe121a0,_0x2076f4){return _0xe121a0[_0x1997('0xa')](_0x1997('0xb'),attributes,{'tableName':_0x1997('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd3d=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xfd3d,0xef));var _0xdfd3=function(_0x407126,_0x5d8108){_0x407126=_0x407126-0x0;var _0x182777=_0xfd3d[_0x407126];return _0x182777;};'use strict';var _=require('lodash');var util=require(_0xdfd3('0x0'));var logger=require(_0xdfd3('0x1'))(_0xdfd3('0x2'));var moment=require(_0xdfd3('0x3'));var BPromise=require(_0xdfd3('0x4'));var rp=require(_0xdfd3('0x5'));var fs=require('fs');var path=require(_0xdfd3('0x6'));var rimraf=require('rimraf');var config=require(_0xdfd3('0x7'));var attributes=require(_0xdfd3('0x8'));module[_0xdfd3('0x9')]=function(_0x5d9e82,_0x3d700a){return _0x5d9e82[_0xdfd3('0xa')]('ChatWebsite',attributes,{'tableName':_0xdfd3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 63c8139..73a9c2e 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 _0x99a9=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x99a9,0x136));var _0x999a=function(_0xa26a6b,_0x2cf096){_0xa26a6b=_0xa26a6b-0x0;var _0x385cb8=_0x99a9[_0xa26a6b];return _0x385cb8;};'use strict';var _=require(_0x999a('0x0'));var util=require(_0x999a('0x1'));var moment=require(_0x999a('0x2'));var BPromise=require(_0x999a('0x3'));var rs=require(_0x999a('0x4'));var fs=require('fs');var Redis=require(_0x999a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x999a('0x6'))(_0x999a('0x7'));var config=require('../../config/environment');var jayson=require(_0x999a('0x8'));var client=jayson['client'][_0x999a('0x9')]({'port':0x232a});config[_0x999a('0xa')]=_[_0x999a('0xb')](config[_0x999a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x999a('0xc'))(new Redis(config[_0x999a('0xa')]));require(_0x999a('0xd'))[_0x999a('0xe')](socket);function respondWithRpcPromise(_0x4d5a61,_0x4a08d6,_0xc8e9e9){return new BPromise(function(_0x179229,_0x5b5213){return client[_0x999a('0xf')](_0x4d5a61,_0xc8e9e9)[_0x999a('0x10')](function(_0x2ba27c){logger[_0x999a('0x11')](_0x999a('0x12'),_0x4a08d6,_0x999a('0x13'));logger[_0x999a('0x14')](_0x999a('0x15'),_0x4a08d6,_0x999a('0x13'),JSON[_0x999a('0x16')](_0x2ba27c));if(_0x2ba27c[_0x999a('0x17')]){if(_0x2ba27c['error'][_0x999a('0x18')]===0x1f4){logger[_0x999a('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x4a08d6,_0x2ba27c[_0x999a('0x17')][_0x999a('0x19')]);return _0x5b5213(_0x2ba27c['error']['message']);}logger[_0x999a('0x17')](_0x999a('0x12'),_0x4a08d6,_0x2ba27c[_0x999a('0x17')]['message']);return _0x179229(_0x2ba27c[_0x999a('0x17')]['message']);}else{logger[_0x999a('0x11')](_0x999a('0x12'),_0x4a08d6,'request\x20sent');_0x179229(_0x2ba27c[_0x999a('0x1a')]['message']);}})[_0x999a('0x1b')](function(_0x234c92){logger[_0x999a('0x17')](_0x999a('0x12'),_0x4a08d6,_0x234c92);_0x5b5213(_0x234c92);});});} \ No newline at end of file +var _0x3bf0=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3bf0,0xe7));var _0x03bf=function(_0x524f2d,_0xb79254){_0x524f2d=_0x524f2d-0x0;var _0x1ddf29=_0x3bf0[_0x524f2d];return _0x1ddf29;};'use strict';var _=require(_0x03bf('0x0'));var util=require(_0x03bf('0x1'));var moment=require(_0x03bf('0x2'));var BPromise=require(_0x03bf('0x3'));var rs=require(_0x03bf('0x4'));var fs=require('fs');var Redis=require(_0x03bf('0x5'));var db=require(_0x03bf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x03bf('0x7'))(_0x03bf('0x8'));var config=require(_0x03bf('0x9'));var jayson=require(_0x03bf('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x03bf('0xb')]=_['defaults'](config[_0x03bf('0xb')],{'host':_0x03bf('0xc'),'port':0x18eb});var socket=require(_0x03bf('0xd'))(new Redis(config[_0x03bf('0xb')]));require(_0x03bf('0xe'))['register'](socket);function respondWithRpcPromise(_0x5237f6,_0x385754,_0x4f478b){return new BPromise(function(_0x557131,_0x2aaf59){return client[_0x03bf('0xf')](_0x5237f6,_0x4f478b)[_0x03bf('0x10')](function(_0xc060a0){logger[_0x03bf('0x11')](_0x03bf('0x12'),_0x385754,'request\x20sent');logger['debug'](_0x03bf('0x13'),_0x385754,_0x03bf('0x14'),JSON[_0x03bf('0x15')](_0xc060a0));if(_0xc060a0[_0x03bf('0x16')]){if(_0xc060a0[_0x03bf('0x16')]['code']===0x1f4){logger[_0x03bf('0x16')](_0x03bf('0x12'),_0x385754,_0xc060a0['error']['message']);return _0x2aaf59(_0xc060a0[_0x03bf('0x16')][_0x03bf('0x17')]);}logger[_0x03bf('0x16')](_0x03bf('0x12'),_0x385754,_0xc060a0[_0x03bf('0x16')][_0x03bf('0x17')]);return _0x557131(_0xc060a0[_0x03bf('0x16')]['message']);}else{logger[_0x03bf('0x11')](_0x03bf('0x12'),_0x385754,_0x03bf('0x14'));_0x557131(_0xc060a0[_0x03bf('0x18')][_0x03bf('0x17')]);}})[_0x03bf('0x19')](function(_0x345170){logger[_0x03bf('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x385754,_0x345170);_0x2aaf59(_0x345170);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index ee17668..ddef6ef 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 _0xc356=['emit','removeListener','register','length','chatWebsite:','save'];(function(_0x2ecf85,_0x2eb99e){var _0x4b2286=function(_0x13274e){while(--_0x13274e){_0x2ecf85['push'](_0x2ecf85['shift']());}};_0x4b2286(++_0x2eb99e);}(_0xc356,0x125));var _0x6c35=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0xc356[_0x1bd323];return _0x13097b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x6c35('0x0'),'remove','update'];function createListener(_0x5deb9b,_0x39b9a4){return function(_0xc7ef25){_0x39b9a4[_0x6c35('0x1')](_0x5deb9b,_0xc7ef25);};}function removeListener(_0x167eb6,_0x2d49e5){return function(){ChatWebsiteEvents[_0x6c35('0x2')](_0x167eb6,_0x2d49e5);};}exports[_0x6c35('0x3')]=function(_0x535b78){for(var _0x4db5a0=0x0,_0x145fac=events[_0x6c35('0x4')];_0x4db5a0<_0x145fac;_0x4db5a0++){var _0x4c22da=events[_0x4db5a0];var _0x56f545=createListener(_0x6c35('0x5')+_0x4c22da,_0x535b78);ChatWebsiteEvents['on'](_0x4c22da,_0x56f545);}}; \ No newline at end of file +var _0xdcf2=['remove','update','emit','removeListener','chatWebsite:'];(function(_0xe2e4c6,_0x46e674){var _0x35a734=function(_0x13817b){while(--_0x13817b){_0xe2e4c6['push'](_0xe2e4c6['shift']());}};_0x35a734(++_0x46e674);}(_0xdcf2,0x1d6));var _0x2dcf=function(_0x225725,_0x2d7061){_0x225725=_0x225725-0x0;var _0x580cd4=_0xdcf2[_0x225725];return _0x580cd4;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0x2dcf('0x0'),_0x2dcf('0x1')];function createListener(_0x56a196,_0x35681e){return function(_0x166871){_0x35681e[_0x2dcf('0x2')](_0x56a196,_0x166871);};}function removeListener(_0x408821,_0x23d87b){return function(){ChatWebsiteEvents[_0x2dcf('0x3')](_0x408821,_0x23d87b);};}exports['register']=function(_0x4cfd6d){for(var _0x193f48=0x0,_0x34905a=events['length'];_0x193f48<_0x34905a;_0x193f48++){var _0x2c0680=events[_0x193f48];var _0xea891b=createListener(_0x2dcf('0x4')+_0x2c0680,_0x4cfd6d);ChatWebsiteEvents['on'](_0x2c0680,_0xea891b);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 039b71a..06dc969 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 _0x1067=['now','originalname','single','file','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addApplications','put','update','delete','destroy','removeAnswers','removeAgents','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','/:id','show','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x1067,0x1b2));var _0x7106=function(_0x563304,_0x5595db){_0x563304=_0x563304-0x0;var _0x5ae961=_0x1067[_0x563304];return _0x5ae961;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7106('0x0'));var timeout=require('connect-timeout');var express=require(_0x7106('0x1'));var router=express[_0x7106('0x2')]();var fs_extra=require(_0x7106('0x3'));var auth=require(_0x7106('0x4'));var interaction=require(_0x7106('0x5'));var config=require(_0x7106('0x6'));var controller=require(_0x7106('0x7'));router[_0x7106('0x8')]('/',auth[_0x7106('0x9')](),controller['index']);router[_0x7106('0x8')](_0x7106('0xa'),auth[_0x7106('0x9')](),controller['describe']);router[_0x7106('0x8')](_0x7106('0xb'),auth['isAuthenticated'](),controller[_0x7106('0xc')]);router[_0x7106('0x8')]('/:id/dispositions',auth[_0x7106('0x9')](),controller['getDispositions']);router[_0x7106('0x8')](_0x7106('0xd'),auth['isAuthenticated'](),controller[_0x7106('0xe')]);router[_0x7106('0x8')](_0x7106('0xf'),controller[_0x7106('0x10')]);router['get'](_0x7106('0x11'),controller[_0x7106('0x12')]);router[_0x7106('0x8')]('/:id/customer_avatar',controller[_0x7106('0x13')]);router['get'](_0x7106('0x14'),controller[_0x7106('0x15')]);router[_0x7106('0x8')](_0x7106('0x16'),auth[_0x7106('0x9')](),controller['getInteractions']);router[_0x7106('0x8')](_0x7106('0x17'),controller[_0x7106('0x18')]);router[_0x7106('0x8')](_0x7106('0x19'),auth[_0x7106('0x9')](),controller['getApplications']);router['get'](_0x7106('0x1a'),auth[_0x7106('0x9')](),controller[_0x7106('0x1b')]);router[_0x7106('0x8')](_0x7106('0x1c'),controller[_0x7106('0x1d')]);router[_0x7106('0x8')](_0x7106('0x1e'),auth['isAuthenticated'](),controller['getOfflineMessages']);router['get'](_0x7106('0x1f'),auth[_0x7106('0x9')](),controller[_0x7106('0x20')]);router[_0x7106('0x21')]('/',auth[_0x7106('0x9')](),controller['create']);router[_0x7106('0x21')](_0x7106('0x22'),auth['isAuthenticated'](),controller[_0x7106('0x23')]);router['post'](_0x7106('0xd'),auth[_0x7106('0x9')](),controller[_0x7106('0x24')]);var upload=multer({'storage':multer[_0x7106('0x25')]({'destination':function(_0x317b5e,_0x2ec85c,_0x136fd3){_0x136fd3(null,path[_0x7106('0x26')](config[_0x7106('0x27')],'server/files/images/logos/'));},'filename':function(_0x27f00f,_0x4c1570,_0x379efd){_0x379efd(null,util[_0x7106('0x28')](_0x7106('0x29'),Date[_0x7106('0x2a')](),_0x4c1570[_0x7106('0x2b')]));}})});router[_0x7106('0x21')](_0x7106('0xf'),upload[_0x7106('0x2c')](_0x7106('0x2d')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x17aba7,_0x3b4960,_0x2301a7){_0x2301a7(null,path[_0x7106('0x26')](config[_0x7106('0x27')],_0x7106('0x2e')));},'filename':function(_0x4a9666,_0x238272,_0x52a714){_0x52a714(null,util[_0x7106('0x28')](_0x7106('0x29'),Date[_0x7106('0x2a')](),_0x238272[_0x7106('0x2b')]));}})});router['post']('/:id/avatar',upload[_0x7106('0x2c')](_0x7106('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x7106('0x25')]({'destination':function(_0x32ca8d,_0x12cd97,_0x343020){_0x343020(null,path[_0x7106('0x26')](config['root'],_0x7106('0x2e')));},'filename':function(_0x431329,_0x55b4ca,_0x43a28e){_0x43a28e(null,util[_0x7106('0x28')]('%s-%s',Date[_0x7106('0x2a')](),_0x55b4ca['originalname']));}})});router[_0x7106('0x21')](_0x7106('0x2f'),upload[_0x7106('0x2c')](_0x7106('0x2d')),controller[_0x7106('0x30')]);var upload=multer({'storage':multer[_0x7106('0x25')]({'destination':function(_0xb6b1b4,_0x19bedf,_0x2b8d7e){_0x2b8d7e(null,path[_0x7106('0x26')](config[_0x7106('0x27')],_0x7106('0x2e')));},'filename':function(_0x349287,_0x284800,_0x40f754){_0x40f754(null,util[_0x7106('0x28')](_0x7106('0x29'),Date[_0x7106('0x2a')](),_0x284800[_0x7106('0x2b')]));}})});router[_0x7106('0x21')]('/:id/system_avatar',upload['single'](_0x7106('0x2d')),controller[_0x7106('0x31')]);router[_0x7106('0x21')](_0x7106('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x7106('0x25')]({'destination':function(_0x408308,_0x491be1,_0x15230c){const _0x4ff49c=path['join'](config[_0x7106('0x27')],_0x7106('0x33'),_0x7106('0x34'),_0x7106('0x35'));fs_extra[_0x7106('0x36')](_0x4ff49c,function(){_0x15230c(null,_0x4ff49c);});},'filename':function(_0x4c4fba,_0x316917,_0x4b6eca){const _0x432b90=_0x316917['originalname'][_0x7106('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x343357=path['extname'](_0x432b90);const _0x59d8bd=Date[_0x7106('0x2a')]()+'-'+_0x432b90[_0x7106('0x37')](_0x343357,'')+_0x343357;_0x4b6eca(null,_0x59d8bd);}})});router['post'](_0x7106('0x38'),offlineUploadMulter[_0x7106('0x39')](),controller[_0x7106('0x3a')]);router['post'](_0x7106('0x16'),auth[_0x7106('0x9')](),controller[_0x7106('0x3b')]);router[_0x7106('0x21')]('/:id/applications',auth[_0x7106('0x9')](),controller[_0x7106('0x3c')]);router['post'](_0x7106('0x1a'),auth[_0x7106('0x9')](),controller['addProactiveActions']);router[_0x7106('0x21')](_0x7106('0x1f'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7106('0x3d')](_0x7106('0xb'),auth[_0x7106('0x9')](),controller[_0x7106('0x3e')]);router[_0x7106('0x3f')]('/:id',auth[_0x7106('0x9')](),controller[_0x7106('0x40')]);router[_0x7106('0x3f')](_0x7106('0x22'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x7106('0x3f')](_0x7106('0xd'),auth[_0x7106('0x9')](),controller[_0x7106('0x41')]);router[_0x7106('0x3f')](_0x7106('0x1f'),auth[_0x7106('0x9')](),controller[_0x7106('0x42')]);module[_0x7106('0x43')]=router; \ No newline at end of file +var _0xbbf3=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','getAgents','post','addAnswer','server/files/images/logos/','%s-%s','originalname','single','file','diskStorage','join','root','server/files/images/avatars/','now','addAvatar','format','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','/:id/users','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet'];(function(_0x1460f6,_0x59051a){var _0x46ce94=function(_0x1c3ddf){while(--_0x1c3ddf){_0x1460f6['push'](_0x1460f6['shift']());}};_0x46ce94(++_0x59051a);}(_0xbbf3,0x1ef));var _0x3bbf=function(_0x3d8efb,_0x1a8ee5){_0x3d8efb=_0x3d8efb-0x0;var _0x31323d=_0xbbf3[_0x3d8efb];return _0x31323d;};'use strict';var multer=require(_0x3bbf('0x0'));var util=require(_0x3bbf('0x1'));var path=require(_0x3bbf('0x2'));var timeout=require(_0x3bbf('0x3'));var express=require(_0x3bbf('0x4'));var router=express[_0x3bbf('0x5')]();var fs_extra=require(_0x3bbf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3bbf('0x7'));var config=require(_0x3bbf('0x8'));var controller=require(_0x3bbf('0x9'));router[_0x3bbf('0xa')]('/',auth[_0x3bbf('0xb')](),controller[_0x3bbf('0xc')]);router['get'](_0x3bbf('0xd'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0xe')]);router[_0x3bbf('0xa')](_0x3bbf('0xf'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x10')]);router['get'](_0x3bbf('0x11'),auth[_0x3bbf('0xb')](),controller['getDispositions']);router[_0x3bbf('0xa')](_0x3bbf('0x12'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x13')]);router[_0x3bbf('0xa')](_0x3bbf('0x14'),controller['getLogo']);router[_0x3bbf('0xa')](_0x3bbf('0x15'),controller[_0x3bbf('0x16')]);router[_0x3bbf('0xa')](_0x3bbf('0x17'),controller[_0x3bbf('0x18')]);router[_0x3bbf('0xa')](_0x3bbf('0x19'),controller['getSystemAvatar']);router[_0x3bbf('0xa')](_0x3bbf('0x1a'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x1b')]);router[_0x3bbf('0xa')](_0x3bbf('0x1c'),controller[_0x3bbf('0x1d')]);router[_0x3bbf('0xa')](_0x3bbf('0x1e'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x1f')]);router[_0x3bbf('0xa')](_0x3bbf('0x20'),auth['isAuthenticated'](),controller[_0x3bbf('0x21')]);router['get']('/:id/fields',controller['getFields']);router[_0x3bbf('0xa')](_0x3bbf('0x22'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x23')]);router[_0x3bbf('0xa')]('/:id/users',auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x24')]);router[_0x3bbf('0x25')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3bbf('0x25')](_0x3bbf('0x11'),auth[_0x3bbf('0xb')](),controller['addDisposition']);router[_0x3bbf('0x25')]('/:id/canned_answers',auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x26')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6fd19f,_0x366ce2,_0x49600f){_0x49600f(null,path['join'](config['root'],_0x3bbf('0x27')));},'filename':function(_0x24f879,_0x3cf6de,_0xa103ab){_0xa103ab(null,util['format'](_0x3bbf('0x28'),Date['now'](),_0x3cf6de[_0x3bbf('0x29')]));}})});router['post'](_0x3bbf('0x14'),upload[_0x3bbf('0x2a')](_0x3bbf('0x2b')),controller['addLogo']);var upload=multer({'storage':multer[_0x3bbf('0x2c')]({'destination':function(_0x23155f,_0x486dc9,_0x27081a){_0x27081a(null,path[_0x3bbf('0x2d')](config[_0x3bbf('0x2e')],_0x3bbf('0x2f')));},'filename':function(_0x18eb43,_0x2d8746,_0x1e1641){_0x1e1641(null,util['format'](_0x3bbf('0x28'),Date[_0x3bbf('0x30')](),_0x2d8746[_0x3bbf('0x29')]));}})});router[_0x3bbf('0x25')](_0x3bbf('0x15'),upload[_0x3bbf('0x2a')](_0x3bbf('0x2b')),controller[_0x3bbf('0x31')]);var upload=multer({'storage':multer[_0x3bbf('0x2c')]({'destination':function(_0x318d14,_0x459228,_0x45a3d7){_0x45a3d7(null,path[_0x3bbf('0x2d')](config[_0x3bbf('0x2e')],_0x3bbf('0x2f')));},'filename':function(_0x24fe5f,_0x56f8e8,_0x1cfc30){_0x1cfc30(null,util[_0x3bbf('0x32')](_0x3bbf('0x28'),Date['now'](),_0x56f8e8[_0x3bbf('0x29')]));}})});router['post'](_0x3bbf('0x17'),upload['single'](_0x3bbf('0x2b')),controller[_0x3bbf('0x33')]);var upload=multer({'storage':multer[_0x3bbf('0x2c')]({'destination':function(_0xa96098,_0x3dcd06,_0x50cabc){_0x50cabc(null,path[_0x3bbf('0x2d')](config[_0x3bbf('0x2e')],_0x3bbf('0x2f')));},'filename':function(_0x23fabe,_0x43a852,_0x4bcb33){_0x4bcb33(null,util['format']('%s-%s',Date['now'](),_0x43a852[_0x3bbf('0x29')]));}})});router[_0x3bbf('0x25')](_0x3bbf('0x19'),upload[_0x3bbf('0x2a')](_0x3bbf('0x2b')),controller[_0x3bbf('0x34')]);router['post'](_0x3bbf('0x35'),controller[_0x3bbf('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x3bbf('0x2c')]({'destination':function(_0x2b4005,_0x108616,_0x16f238){const _0x5a50e1=path[_0x3bbf('0x2d')](config['root'],_0x3bbf('0x37'),_0x3bbf('0x38'),_0x3bbf('0x39'));fs_extra[_0x3bbf('0x3a')](_0x5a50e1,function(){_0x16f238(null,_0x5a50e1);});},'filename':function(_0x22b67d,_0x3c2ecb,_0x4fea03){const _0x125ff5=_0x3c2ecb['originalname'][_0x3bbf('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x28c3a9=path[_0x3bbf('0x3c')](_0x125ff5);const _0x37372d=Date['now']()+'-'+_0x125ff5['replace'](_0x28c3a9,'')+_0x28c3a9;_0x4fea03(null,_0x37372d);}})});router[_0x3bbf('0x25')](_0x3bbf('0x3d'),offlineUploadMulter[_0x3bbf('0x3e')](),controller[_0x3bbf('0x3f')]);router[_0x3bbf('0x25')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router[_0x3bbf('0x25')]('/:id/applications',auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x40')]);router['post']('/:id/proactive_actions',auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x41')]);router[_0x3bbf('0x25')](_0x3bbf('0x42'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x43')]);router[_0x3bbf('0x44')]('/:id',auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x45')]);router['delete'](_0x3bbf('0xf'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x46')]);router[_0x3bbf('0x47')]('/:id/dispositions',auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x48')]);router['delete'](_0x3bbf('0x12'),auth[_0x3bbf('0xb')](),controller[_0x3bbf('0x49')]);router[_0x3bbf('0x47')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x3bbf('0x4a')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 983811c..25f1e17 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1044=['production','get','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env'];(function(_0x23f194,_0x4afea4){var _0x1fcdbd=function(_0x40ac15){while(--_0x40ac15){_0x23f194['push'](_0x23f194['shift']());}};_0x1fcdbd(++_0x4afea4);}(_0x1044,0xca));var _0x4104=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x1044[_0x4e6ae6];return _0x23c108;};var beaverLogger=require(_0x4104('0x0'));var express=require(_0x4104('0x1'));var auth=require(_0x4104('0x2'));var config=require(_0x4104('0x3'));var router=express[_0x4104('0x4')]();var isProduction=config[_0x4104('0x5')]===_0x4104('0x6')||![];function clientSideLogs(_0x2743ee,_0x3d4e77,_0x5b2c9c){var _0x32db65=_0x2743ee['app'][_0x4104('0x7')]('client-side-logger');if(!_0x32db65){throw new Error(_0x4104('0x8'));}return beaverLogger[_0x4104('0x9')]({'uri':_0x4104('0xa'),'logger':_0x32db65,'enableCors':!isProduction})(_0x2743ee,_0x3d4e77,_0x5b2c9c);}router['use'](auth[_0x4104('0xb')](),clientSideLogs);module[_0x4104('0xc')]=router; \ No newline at end of file +var _0x02a8=['Router','env','get','expressEndpoint','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x02a8,0x146));var _0x802a=function(_0x340ada,_0x1e9086){_0x340ada=_0x340ada-0x0;var _0x14b2f5=_0x02a8[_0x340ada];return _0x14b2f5;};var beaverLogger=require(_0x802a('0x0'));var express=require(_0x802a('0x1'));var auth=require(_0x802a('0x2'));var config=require(_0x802a('0x3'));var router=express[_0x802a('0x4')]();var isProduction=config[_0x802a('0x5')]==='production'||![];function clientSideLogs(_0x13db06,_0x1e2383,_0x24d1c4){var _0x4e4e12=_0x13db06['app'][_0x802a('0x6')]('client-side-logger');if(!_0x4e4e12){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x802a('0x7')]({'uri':'/client-logs','logger':_0x4e4e12,'enableCors':!isProduction})(_0x13db06,_0x1e2383,_0x24d1c4);}router['use'](auth[_0x802a('0x8')](),clientSideLogs);module[_0x802a('0x9')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 78110f5..a20876f 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 _0x48c2=['Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','ENUM'];(function(_0x56e239,_0x187ac7){var _0x563d2b=function(_0x50b7bf){while(--_0x50b7bf){_0x56e239['push'](_0x56e239['shift']());}};_0x563d2b(++_0x187ac7);}(_0x48c2,0xed));var _0x248c=function(_0x3aaf0a,_0x450970){_0x3aaf0a=_0x3aaf0a-0x0;var _0x33e6bc=_0x48c2[_0x3aaf0a];return _0x33e6bc;};'use strict';var Sequelize=require(_0x248c('0x0'));module[_0x248c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x248c('0x2')]('AmazonAWS',_0x248c('0x3'),_0x248c('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x248c('0x2')](_0x248c('0x5'),_0x248c('0x6'))},'data1':{'type':Sequelize['STRING'],'comment':_0x248c('0x7')},'data2':{'type':Sequelize[_0x248c('0x8')],'comment':_0x248c('0x9')},'data3':{'type':Sequelize['STRING'],'comment':_0x248c('0xa')},'data4':{'type':Sequelize[_0x248c('0x8')],'comment':_0x248c('0xb')},'data5':{'type':Sequelize[_0x248c('0xc')],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x248c('0xc')],'comment':_0x248c('0xd')},'data7':{'type':Sequelize[_0x248c('0xc')],'comment':_0x248c('0xe')}}; \ No newline at end of file +var _0xea68=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x463039,_0x2f5202){var _0x58ccf5=function(_0x327ad4){while(--_0x327ad4){_0x463039['push'](_0x463039['shift']());}};_0x58ccf5(++_0x2f5202);}(_0xea68,0xc5));var _0x8ea6=function(_0x10bb55,_0x44c483){_0x10bb55=_0x10bb55-0x0;var _0x2201b8=_0xea68[_0x10bb55];return _0x2201b8;};'use strict';var Sequelize=require(_0x8ea6('0x0'));module['exports']={'name':{'type':Sequelize[_0x8ea6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8ea6('0x2')]('AmazonAWS','Google',_0x8ea6('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x8ea6('0x2')](_0x8ea6('0x4'),_0x8ea6('0x5'))},'data1':{'type':Sequelize[_0x8ea6('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x8ea6('0x6')},'data3':{'type':Sequelize['STRING'],'comment':_0x8ea6('0x7')},'data4':{'type':Sequelize['STRING'],'comment':_0x8ea6('0x8')},'data5':{'type':Sequelize[_0x8ea6('0x9')],'comment':_0x8ea6('0xa')},'data6':{'type':Sequelize[_0x8ea6('0x9')],'comment':_0x8ea6('0xb')},'data7':{'type':Sequelize[_0x8ea6('0x9')],'comment':_0x8ea6('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index a2ea0ff..1d51dfb 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 _0xfa61=['defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','stack','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','merge','options','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','find','params','oauth2MicrosoftAuthorize','findOne','user','error','get','state','Invalid\x20state\x20parameter','parse','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth'];(function(_0x565216,_0x5dede4){var _0x3bcdd2=function(_0x5baf59){while(--_0x5baf59){_0x565216['push'](_0x565216['shift']());}};_0x3bcdd2(++_0x5dede4);}(_0xfa61,0x12a));var _0x1fa6=function(_0x5a07f7,_0x588977){_0x5a07f7=_0x5a07f7-0x0;var _0x373eb8=_0xfa61[_0x5a07f7];return _0x373eb8;};'use strict';var _=require(_0x1fa6('0x0'));var Redis=require(_0x1fa6('0x1'));var qs=require(_0x1fa6('0x2'));var encryptor=require(_0x1fa6('0x3'));var config=require(_0x1fa6('0x4'));var logger=require('../../config/logger')(_0x1fa6('0x5'));var db=require(_0x1fa6('0x6'))['db'];var oauth=require(_0x1fa6('0x7'));config['redis']=_[_0x1fa6('0x8')](config[_0x1fa6('0x9')],{'host':_0x1fa6('0xa'),'port':0x18eb});var socket=require(_0x1fa6('0xb'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x4189c7,_0x4253c2){_0x4253c2=_0x4253c2||0xcc;return function(_0x9d5d52){if(_0x9d5d52){return _0x4189c7[_0x1fa6('0xc')](_0x4253c2);}return _0x4189c7[_0x1fa6('0xd')](_0x4253c2)[_0x1fa6('0xe')]();};}function respondWithResult(_0x362ea1,_0x264d6a){_0x264d6a=_0x264d6a||0xc8;return function(_0x5c3339){if(_0x5c3339){return _0x362ea1['status'](_0x264d6a)[_0x1fa6('0xf')](_0x5c3339);}};}function respondWithFilteredResult(_0x482b2b,_0x4aeda1){return function(_0x573f7b){if(_0x573f7b){var _0x8bb7b5=typeof _0x4aeda1[_0x1fa6('0x10')]===_0x1fa6('0x11')&&typeof _0x4aeda1[_0x1fa6('0x12')]===_0x1fa6('0x11');var _0x28e35e=_0x573f7b[_0x1fa6('0x13')];var _0x4b51dd=_0x8bb7b5?0x0:_0x4aeda1[_0x1fa6('0x10')];var _0x31b4fd=_0x8bb7b5?_0x573f7b[_0x1fa6('0x13')]:_0x4aeda1[_0x1fa6('0x10')]+_0x4aeda1['limit'];var _0x247bef;if(_0x31b4fd>=_0x28e35e){_0x31b4fd=_0x28e35e;_0x247bef=0xc8;}else{_0x247bef=0xce;}_0x482b2b[_0x1fa6('0xd')](_0x247bef);return _0x482b2b['set'](_0x1fa6('0x14'),_0x4b51dd+'-'+_0x31b4fd+'/'+_0x28e35e)[_0x1fa6('0xf')](_0x573f7b);}return null;};}function saveUpdates(_0x461a8a){return function(_0x361144){if(_0x361144){return _0x361144[_0x1fa6('0x15')](_0x461a8a)[_0x1fa6('0x16')](function(_0x1d9d81){return _0x1d9d81;});}return null;};}function removeEntity(_0x216830){return function(_0x53dfc1){if(_0x53dfc1){return _0x53dfc1[_0x1fa6('0x17')]()[_0x1fa6('0x16')](function(){_0x216830[_0x1fa6('0xd')](0xcc)[_0x1fa6('0xe')]();});}};}function handleEntityNotFound(_0x528ab2){return function(_0x499b85){if(!_0x499b85){_0x528ab2[_0x1fa6('0xc')](0x194);}return _0x499b85;};}function handleError(_0x5538c2,_0x36af63){_0x36af63=_0x36af63||0x1f4;return function(_0x20054e){logger['error'](_0x20054e[_0x1fa6('0x18')]);if(_0x20054e[_0x1fa6('0x19')]){delete _0x20054e[_0x1fa6('0x19')];}_0x5538c2[_0x1fa6('0xd')](_0x36af63)[_0x1fa6('0x1a')](_0x20054e);};}function maskClientSecret(_0x29c683){return _[_0x1fa6('0x1b')](_0x29c683[_0x1fa6('0x1c')](0x0,0x3),0x14,'*');}exports[_0x1fa6('0x1d')]=function(_0x14f0f1,_0xb04a7){var _0x10d9a4={},_0x57b70a={},_0x434d43={'count':0x0,'rows':[]};var _0x593eb0=_[_0x1fa6('0x1e')](db[_0x1fa6('0x1f')][_0x1fa6('0x20')],function(_0x231534){return{'name':_0x231534[_0x1fa6('0x21')],'type':_0x231534[_0x1fa6('0x22')][_0x1fa6('0x23')]};});_0x57b70a['model']=_['map'](_0x593eb0,_0x1fa6('0x19'));_0x57b70a[_0x1fa6('0x24')]=_[_0x1fa6('0x25')](_0x14f0f1['query']);_0x57b70a[_0x1fa6('0x26')]=_[_0x1fa6('0x27')](_0x57b70a['model'],_0x57b70a[_0x1fa6('0x24')]);_0x10d9a4['attributes']=_['intersection'](_0x57b70a[_0x1fa6('0x28')],qs[_0x1fa6('0x29')](_0x14f0f1[_0x1fa6('0x24')][_0x1fa6('0x29')]));_0x10d9a4[_0x1fa6('0x2a')]=_0x10d9a4['attributes'][_0x1fa6('0x2b')]?_0x10d9a4[_0x1fa6('0x2a')]:_0x57b70a[_0x1fa6('0x28')];if(!_0x14f0f1['query'][_0x1fa6('0x2c')]('nolimit')){_0x10d9a4[_0x1fa6('0x12')]=qs[_0x1fa6('0x12')](_0x14f0f1[_0x1fa6('0x24')]['limit']);_0x10d9a4[_0x1fa6('0x10')]=qs[_0x1fa6('0x10')](_0x14f0f1[_0x1fa6('0x24')]['offset']);}_0x10d9a4[_0x1fa6('0x2d')]=qs[_0x1fa6('0x2e')](_0x14f0f1[_0x1fa6('0x24')][_0x1fa6('0x2e')]);_0x10d9a4[_0x1fa6('0x2f')]=qs[_0x1fa6('0x26')](_[_0x1fa6('0x30')](_0x14f0f1[_0x1fa6('0x24')],_0x57b70a[_0x1fa6('0x26')]),_0x593eb0);if(_0x14f0f1[_0x1fa6('0x24')]['filter']){_0x10d9a4[_0x1fa6('0x2f')]=_['merge'](_0x10d9a4[_0x1fa6('0x2f')],{'$or':_[_0x1fa6('0x1e')](_0x593eb0,function(_0x39d7d1){if(_0x39d7d1[_0x1fa6('0x22')]!==_0x1fa6('0x31')){var _0x2eaef5={};_0x2eaef5[_0x39d7d1['name']]={'$like':'%'+_0x14f0f1['query'][_0x1fa6('0x32')]+'%'};return _0x2eaef5;}})});}_0x10d9a4=_['merge']({},_0x10d9a4,_0x14f0f1['options']);var _0x4dc763={'where':_0x10d9a4[_0x1fa6('0x2f')]};return db[_0x1fa6('0x1f')][_0x1fa6('0x13')](_0x4dc763)[_0x1fa6('0x16')](function(_0x11f37b){_0x434d43[_0x1fa6('0x13')]=_0x11f37b;if(_0x14f0f1[_0x1fa6('0x24')][_0x1fa6('0x33')]){_0x10d9a4[_0x1fa6('0x34')]=[{'all':!![]}];}return db[_0x1fa6('0x1f')][_0x1fa6('0x35')](_0x10d9a4);})[_0x1fa6('0x16')](function(_0x31ad7f){_0x434d43[_0x1fa6('0x36')]=_[_0x1fa6('0x1e')](_0x31ad7f,function(_0x1253b1){if(_0x1253b1[_0x1fa6('0x37')]===_0x1fa6('0x38')){var _0x38ef52=encryptor[_0x1fa6('0x39')](_0x1253b1[_0x1fa6('0x3a')]);_0x1253b1['data3']=maskClientSecret(_0x38ef52);}return _0x1253b1;});return _0x434d43;})[_0x1fa6('0x16')](respondWithFilteredResult(_0xb04a7,_0x10d9a4))['catch'](handleError(_0xb04a7,null));};exports[_0x1fa6('0x3b')]=function(_0x509527,_0x99a173){var _0x2fbf78={'raw':!![],'where':{'id':_0x509527['params']['id']}},_0x2f6d44={};_0x2f6d44[_0x1fa6('0x28')]=_['keys'](db[_0x1fa6('0x1f')][_0x1fa6('0x20')]);_0x2f6d44['query']=_[_0x1fa6('0x25')](_0x509527[_0x1fa6('0x24')]);_0x2f6d44[_0x1fa6('0x26')]=_[_0x1fa6('0x27')](_0x2f6d44['model'],_0x2f6d44[_0x1fa6('0x24')]);_0x2fbf78[_0x1fa6('0x2a')]=_[_0x1fa6('0x27')](_0x2f6d44[_0x1fa6('0x28')],qs[_0x1fa6('0x29')](_0x509527['query'][_0x1fa6('0x29')]));_0x2fbf78['attributes']=_0x2fbf78[_0x1fa6('0x2a')][_0x1fa6('0x2b')]?_0x2fbf78[_0x1fa6('0x2a')]:_0x2f6d44['model'];if(_0x509527[_0x1fa6('0x24')]['includeAll']){_0x2fbf78[_0x1fa6('0x34')]=[{'all':!![]}];}_0x2fbf78=_[_0x1fa6('0x3c')]({},_0x2fbf78,_0x509527[_0x1fa6('0x3d')]);return db['CloudProvider']['find'](_0x2fbf78)[_0x1fa6('0x16')](handleEntityNotFound(_0x99a173,null))['then'](function(_0x4a7484){if(_0x4a7484[_0x1fa6('0x37')]===_0x1fa6('0x38')){var _0x29135d=encryptor[_0x1fa6('0x39')](_0x4a7484[_0x1fa6('0x3a')]);_0x4a7484[_0x1fa6('0x3a')]=maskClientSecret(_0x29135d);}return _0x4a7484;})[_0x1fa6('0x16')](respondWithResult(_0x99a173,null))['catch'](handleError(_0x99a173,null));};exports[_0x1fa6('0x3e')]=function(_0x4c41a9,_0x48ea92){if(!_0x4c41a9['body']['name'])throw new Error(_0x1fa6('0x3f'));if(!_0x4c41a9[_0x1fa6('0x40')][_0x1fa6('0x37')])throw new Error(_0x1fa6('0x41'));var _0x3fa99e=db[_0x1fa6('0x1f')]['rawAttributes'][_0x1fa6('0x37')][_0x1fa6('0x42')];if(!_0x3fa99e[_0x1fa6('0x43')](_0x4c41a9[_0x1fa6('0x40')][_0x1fa6('0x37')]))throw new Error(_0x1fa6('0x44')+_0x3fa99e[_0x1fa6('0x45')](',\x20'));if(_0x4c41a9[_0x1fa6('0x40')][_0x1fa6('0x37')]==='MicrosoftAzure'&&_0x4c41a9[_0x1fa6('0x40')][_0x1fa6('0x3a')]){_0x4c41a9[_0x1fa6('0x40')][_0x1fa6('0x3a')]=encryptor[_0x1fa6('0x46')](_0x4c41a9[_0x1fa6('0x40')][_0x1fa6('0x3a')]);}return db['CloudProvider'][_0x1fa6('0x3e')](_0x4c41a9[_0x1fa6('0x40')],{})['then'](respondWithResult(_0x48ea92,0xc9))[_0x1fa6('0x47')](handleError(_0x48ea92,null));};exports[_0x1fa6('0x15')]=function(_0x4c9354,_0x576e2d){if(_0x4c9354['body']['id']){delete _0x4c9354['body']['id'];}return db[_0x1fa6('0x1f')][_0x1fa6('0x48')]({'where':{'id':_0x4c9354[_0x1fa6('0x49')]['id']}})['then'](handleEntityNotFound(_0x576e2d,null))[_0x1fa6('0x16')](function(_0x4ae2aa){if(_0x4ae2aa[_0x1fa6('0x37')]===_0x1fa6('0x38')&&_0x4c9354[_0x1fa6('0x40')]['data3']){_0x4c9354[_0x1fa6('0x40')][_0x1fa6('0x3a')]=encryptor[_0x1fa6('0x46')](_0x4c9354[_0x1fa6('0x40')][_0x1fa6('0x3a')]);}return _0x4ae2aa;})[_0x1fa6('0x16')](saveUpdates(_0x4c9354['body'],null))['then'](respondWithResult(_0x576e2d,null))[_0x1fa6('0x47')](handleError(_0x576e2d,null));};exports[_0x1fa6('0x17')]=function(_0x3b9174,_0x3aaa2f){return db[_0x1fa6('0x1f')]['find']({'where':{'id':_0x3b9174[_0x1fa6('0x49')]['id']}})['then'](handleEntityNotFound(_0x3aaa2f,null))['then'](removeEntity(_0x3aaa2f,null))['catch'](handleError(_0x3aaa2f,null));};exports[_0x1fa6('0x4a')]=function(_0x4736c6,_0x26d579){return db[_0x1fa6('0x1f')][_0x1fa6('0x4b')]({'where':{'id':_0x4736c6[_0x1fa6('0x49')]['id']},'raw':!![]})[_0x1fa6('0x16')](function(_0x4a9baf){if(!_0x4a9baf)return _0x26d579[_0x1fa6('0xc')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x4a9baf,_0x4736c6[_0x1fa6('0x4c')]['id'])};})[_0x1fa6('0x16')](respondWithResult(_0x26d579,null))[_0x1fa6('0x47')](handleError(_0x26d579,null));};exports['oauth2MicrosoftCallback']=function(_0x4468b8,_0x33c1d4){var _0x4b04e4=_0x4468b8['body'];var _0x363188;var _0x4d3dab;if(_0x4b04e4[_0x1fa6('0x4d')])throw _0x4b04e4;redis[_0x1fa6('0x4e')](_0x4b04e4[_0x1fa6('0x4f')])[_0x1fa6('0x16')](function(_0xec7701){if(!_0xec7701)throw new Error(_0x1fa6('0x50'));_0x363188=JSON[_0x1fa6('0x51')](_0xec7701);var _0x2a9803=Buffer['from'](_0x4b04e4[_0x1fa6('0x4f')],'base64')[_0x1fa6('0x52')](_0x1fa6('0x53'));_0x4d3dab=JSON[_0x1fa6('0x51')](_0x2a9803);if(!oauth[_0x1fa6('0x54')](_0x4b04e4[_0x1fa6('0x55')],_0x363188[_0x1fa6('0x56')]))throw new Error(_0x1fa6('0x57'));redis[_0x1fa6('0x58')](_0x4b04e4[_0x1fa6('0x4f')]);return oauth[_0x1fa6('0x59')](_0x4b04e4[_0x1fa6('0x5a')],_0x363188);})[_0x1fa6('0x16')](function(_0x16f0ef){_0x363188[_0x1fa6('0x5b')]=_0x16f0ef[_0x1fa6('0x5c')];_0x363188[_0x1fa6('0x5d')]=_0x16f0ef[_0x1fa6('0x5e')];return db[_0x1fa6('0x1f')][_0x1fa6('0x15')]({'data5':_0x363188[_0x1fa6('0x5b')],'data6':_0x363188[_0x1fa6('0x5d')]},{'where':{'id':_0x363188['id']}});})[_0x1fa6('0x16')](function(){oauth[_0x1fa6('0x5f')](_0x363188);socket[_0x1fa6('0x60')](_0x1fa6('0x61'),{'id':_0x4d3dab['id']});return;})[_0x1fa6('0x16')](respondWithStatusCode(_0x33c1d4,null))[_0x1fa6('0x47')](function(_0x4274c3){if(_0x4d3dab){socket[_0x1fa6('0x60')](_0x1fa6('0x62'),{'id':_0x4d3dab['id']});}if(!_0x363188){logger['error'](_0x1fa6('0x63'),_0x4274c3);return _0x33c1d4[_0x1fa6('0xd')](0x1f4)[_0x1fa6('0x1a')](_0x4274c3[_0x1fa6('0x64')]);}logger[_0x1fa6('0x4d')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x363188['id'],JSON[_0x1fa6('0x65')](_0x4274c3));});}; \ No newline at end of file +var _0xb867=['type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','options','includeAll','include','rows','MicrosoftAzure','data3','keys','rawAttributes','find','service','decryptString','catch','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','create','params','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','access_token','data6','refresh_token','update','data5','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','then','stack','name','send','padEnd','slice','index','map','CloudProvider','fieldName'];(function(_0x5b8e69,_0x486ea5){var _0xa333c1=function(_0x71eebc){while(--_0x71eebc){_0x5b8e69['push'](_0x5b8e69['shift']());}};_0xa333c1(++_0x486ea5);}(_0xb867,0x1a9));var _0x7b86=function(_0x339f21,_0x399513){_0x339f21=_0x339f21-0x0;var _0xbe46c5=_0xb867[_0x339f21];return _0xbe46c5;};'use strict';var _=require('lodash');var Redis=require(_0x7b86('0x0'));var qs=require(_0x7b86('0x1'));var encryptor=require('../../components/encryptor');var config=require(_0x7b86('0x2'));var logger=require(_0x7b86('0x3'))('api');var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x7b86('0x4')]=_['defaults'](config['redis'],{'host':_0x7b86('0x5'),'port':0x18eb});var socket=require(_0x7b86('0x6'))(new Redis(config[_0x7b86('0x4')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x56b8a8,_0xd076c4){_0xd076c4=_0xd076c4||0xcc;return function(_0x3e86d0){if(_0x3e86d0){return _0x56b8a8[_0x7b86('0x7')](_0xd076c4);}return _0x56b8a8[_0x7b86('0x8')](_0xd076c4)[_0x7b86('0x9')]();};}function respondWithResult(_0x22009c,_0x4f4d40){_0x4f4d40=_0x4f4d40||0xc8;return function(_0x54f759){if(_0x54f759){return _0x22009c[_0x7b86('0x8')](_0x4f4d40)[_0x7b86('0xa')](_0x54f759);}};}function respondWithFilteredResult(_0xfa5b26,_0x238fa5){return function(_0x3c35c0){if(_0x3c35c0){var _0xab098f=typeof _0x238fa5[_0x7b86('0xb')]===_0x7b86('0xc')&&typeof _0x238fa5[_0x7b86('0xd')]===_0x7b86('0xc');var _0x3705af=_0x3c35c0[_0x7b86('0xe')];var _0x5ba855=_0xab098f?0x0:_0x238fa5[_0x7b86('0xb')];var _0x51a3d9=_0xab098f?_0x3c35c0[_0x7b86('0xe')]:_0x238fa5['offset']+_0x238fa5[_0x7b86('0xd')];var _0x4032a1;if(_0x51a3d9>=_0x3705af){_0x51a3d9=_0x3705af;_0x4032a1=0xc8;}else{_0x4032a1=0xce;}_0xfa5b26['status'](_0x4032a1);return _0xfa5b26['set']('Content-Range',_0x5ba855+'-'+_0x51a3d9+'/'+_0x3705af)['json'](_0x3c35c0);}return null;};}function saveUpdates(_0x1843db){return function(_0x824f7a){if(_0x824f7a){return _0x824f7a['update'](_0x1843db)['then'](function(_0x2bc160){return _0x2bc160;});}return null;};}function removeEntity(_0x3ddb3e){return function(_0x29a1a4){if(_0x29a1a4){return _0x29a1a4['destroy']()[_0x7b86('0xf')](function(){_0x3ddb3e[_0x7b86('0x8')](0xcc)[_0x7b86('0x9')]();});}};}function handleEntityNotFound(_0x1a0bde){return function(_0x468439){if(!_0x468439){_0x1a0bde[_0x7b86('0x7')](0x194);}return _0x468439;};}function handleError(_0x510c09,_0x4f471a){_0x4f471a=_0x4f471a||0x1f4;return function(_0x562bde){logger['error'](_0x562bde[_0x7b86('0x10')]);if(_0x562bde['name']){delete _0x562bde[_0x7b86('0x11')];}_0x510c09['status'](_0x4f471a)[_0x7b86('0x12')](_0x562bde);};}function maskClientSecret(_0x2192bf){return _[_0x7b86('0x13')](_0x2192bf[_0x7b86('0x14')](0x0,0x3),0x14,'*');}exports[_0x7b86('0x15')]=function(_0x2bcd13,_0x2fd4a6){var _0x1d5fc2={},_0x457482={},_0x339d14={'count':0x0,'rows':[]};var _0x9168e2=_[_0x7b86('0x16')](db[_0x7b86('0x17')]['rawAttributes'],function(_0x16c7b2){return{'name':_0x16c7b2[_0x7b86('0x18')],'type':_0x16c7b2[_0x7b86('0x19')][_0x7b86('0x1a')]};});_0x457482[_0x7b86('0x1b')]=_['map'](_0x9168e2,'name');_0x457482[_0x7b86('0x1c')]=_['keys'](_0x2bcd13['query']);_0x457482[_0x7b86('0x1d')]=_[_0x7b86('0x1e')](_0x457482[_0x7b86('0x1b')],_0x457482[_0x7b86('0x1c')]);_0x1d5fc2[_0x7b86('0x1f')]=_[_0x7b86('0x1e')](_0x457482[_0x7b86('0x1b')],qs['fields'](_0x2bcd13[_0x7b86('0x1c')][_0x7b86('0x20')]));_0x1d5fc2[_0x7b86('0x1f')]=_0x1d5fc2[_0x7b86('0x1f')][_0x7b86('0x21')]?_0x1d5fc2[_0x7b86('0x1f')]:_0x457482[_0x7b86('0x1b')];if(!_0x2bcd13[_0x7b86('0x1c')][_0x7b86('0x22')]('nolimit')){_0x1d5fc2[_0x7b86('0xd')]=qs[_0x7b86('0xd')](_0x2bcd13[_0x7b86('0x1c')][_0x7b86('0xd')]);_0x1d5fc2[_0x7b86('0xb')]=qs[_0x7b86('0xb')](_0x2bcd13[_0x7b86('0x1c')][_0x7b86('0xb')]);}_0x1d5fc2[_0x7b86('0x23')]=qs['sort'](_0x2bcd13[_0x7b86('0x1c')][_0x7b86('0x24')]);_0x1d5fc2['where']=qs['filters'](_[_0x7b86('0x25')](_0x2bcd13[_0x7b86('0x1c')],_0x457482[_0x7b86('0x1d')]),_0x9168e2);if(_0x2bcd13['query'][_0x7b86('0x26')]){_0x1d5fc2['where']=_[_0x7b86('0x27')](_0x1d5fc2[_0x7b86('0x28')],{'$or':_[_0x7b86('0x16')](_0x9168e2,function(_0x56bce5){if(_0x56bce5['type']!=='VIRTUAL'){var _0x4e0f43={};_0x4e0f43[_0x56bce5[_0x7b86('0x11')]]={'$like':'%'+_0x2bcd13['query'][_0x7b86('0x26')]+'%'};return _0x4e0f43;}})});}_0x1d5fc2=_[_0x7b86('0x27')]({},_0x1d5fc2,_0x2bcd13[_0x7b86('0x29')]);var _0x4d94f4={'where':_0x1d5fc2[_0x7b86('0x28')]};return db[_0x7b86('0x17')][_0x7b86('0xe')](_0x4d94f4)[_0x7b86('0xf')](function(_0x1d526d){_0x339d14[_0x7b86('0xe')]=_0x1d526d;if(_0x2bcd13[_0x7b86('0x1c')][_0x7b86('0x2a')]){_0x1d5fc2[_0x7b86('0x2b')]=[{'all':!![]}];}return db[_0x7b86('0x17')]['findAll'](_0x1d5fc2);})[_0x7b86('0xf')](function(_0x31e8b1){_0x339d14[_0x7b86('0x2c')]=_['map'](_0x31e8b1,function(_0x4b3568){if(_0x4b3568['service']===_0x7b86('0x2d')){var _0x470169=encryptor['decryptString'](_0x4b3568[_0x7b86('0x2e')]);_0x4b3568[_0x7b86('0x2e')]=maskClientSecret(_0x470169);}return _0x4b3568;});return _0x339d14;})[_0x7b86('0xf')](respondWithFilteredResult(_0x2fd4a6,_0x1d5fc2))['catch'](handleError(_0x2fd4a6,null));};exports['show']=function(_0x271ef7,_0x432144){var _0x3bf478={'raw':!![],'where':{'id':_0x271ef7['params']['id']}},_0x1b46f6={};_0x1b46f6[_0x7b86('0x1b')]=_[_0x7b86('0x2f')](db[_0x7b86('0x17')][_0x7b86('0x30')]);_0x1b46f6[_0x7b86('0x1c')]=_['keys'](_0x271ef7[_0x7b86('0x1c')]);_0x1b46f6[_0x7b86('0x1d')]=_[_0x7b86('0x1e')](_0x1b46f6[_0x7b86('0x1b')],_0x1b46f6[_0x7b86('0x1c')]);_0x3bf478[_0x7b86('0x1f')]=_['intersection'](_0x1b46f6[_0x7b86('0x1b')],qs[_0x7b86('0x20')](_0x271ef7[_0x7b86('0x1c')][_0x7b86('0x20')]));_0x3bf478[_0x7b86('0x1f')]=_0x3bf478['attributes'][_0x7b86('0x21')]?_0x3bf478[_0x7b86('0x1f')]:_0x1b46f6['model'];if(_0x271ef7[_0x7b86('0x1c')][_0x7b86('0x2a')]){_0x3bf478['include']=[{'all':!![]}];}_0x3bf478=_['merge']({},_0x3bf478,_0x271ef7[_0x7b86('0x29')]);return db[_0x7b86('0x17')][_0x7b86('0x31')](_0x3bf478)[_0x7b86('0xf')](handleEntityNotFound(_0x432144,null))['then'](function(_0xd2c207){if(_0xd2c207[_0x7b86('0x32')]===_0x7b86('0x2d')){var _0x2a4963=encryptor[_0x7b86('0x33')](_0xd2c207[_0x7b86('0x2e')]);_0xd2c207[_0x7b86('0x2e')]=maskClientSecret(_0x2a4963);}return _0xd2c207;})[_0x7b86('0xf')](respondWithResult(_0x432144,null))[_0x7b86('0x34')](handleError(_0x432144,null));};exports['create']=function(_0x3b85a2,_0x491f08){if(!_0x3b85a2[_0x7b86('0x35')][_0x7b86('0x11')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3b85a2[_0x7b86('0x35')][_0x7b86('0x32')])throw new Error(_0x7b86('0x36'));var _0x51c8b0=db[_0x7b86('0x17')]['rawAttributes'][_0x7b86('0x32')][_0x7b86('0x37')];if(!_0x51c8b0['includes'](_0x3b85a2[_0x7b86('0x35')][_0x7b86('0x32')]))throw new Error(_0x7b86('0x38')+_0x51c8b0['join'](',\x20'));if(_0x3b85a2[_0x7b86('0x35')][_0x7b86('0x32')]===_0x7b86('0x2d')&&_0x3b85a2[_0x7b86('0x35')][_0x7b86('0x2e')]){_0x3b85a2['body'][_0x7b86('0x2e')]=encryptor[_0x7b86('0x39')](_0x3b85a2['body'][_0x7b86('0x2e')]);}return db[_0x7b86('0x17')][_0x7b86('0x3a')](_0x3b85a2[_0x7b86('0x35')],{})[_0x7b86('0xf')](respondWithResult(_0x491f08,0xc9))[_0x7b86('0x34')](handleError(_0x491f08,null));};exports['update']=function(_0x2fd2ec,_0x4419f0){if(_0x2fd2ec[_0x7b86('0x35')]['id']){delete _0x2fd2ec[_0x7b86('0x35')]['id'];}return db[_0x7b86('0x17')][_0x7b86('0x31')]({'where':{'id':_0x2fd2ec[_0x7b86('0x3b')]['id']}})[_0x7b86('0xf')](handleEntityNotFound(_0x4419f0,null))[_0x7b86('0xf')](function(_0x306ee4){if(_0x306ee4[_0x7b86('0x32')]==='MicrosoftAzure'&&_0x2fd2ec[_0x7b86('0x35')][_0x7b86('0x2e')]){_0x2fd2ec['body'][_0x7b86('0x2e')]=encryptor[_0x7b86('0x39')](_0x2fd2ec[_0x7b86('0x35')][_0x7b86('0x2e')]);}return _0x306ee4;})['then'](saveUpdates(_0x2fd2ec[_0x7b86('0x35')],null))['then'](respondWithResult(_0x4419f0,null))[_0x7b86('0x34')](handleError(_0x4419f0,null));};exports[_0x7b86('0x3c')]=function(_0x34a0d2,_0x23dac4){return db[_0x7b86('0x17')]['find']({'where':{'id':_0x34a0d2[_0x7b86('0x3b')]['id']}})['then'](handleEntityNotFound(_0x23dac4,null))['then'](removeEntity(_0x23dac4,null))[_0x7b86('0x34')](handleError(_0x23dac4,null));};exports['oauth2MicrosoftAuthorize']=function(_0x4aa372,_0x3ab121){return db[_0x7b86('0x17')][_0x7b86('0x3d')]({'where':{'id':_0x4aa372[_0x7b86('0x3b')]['id']},'raw':!![]})[_0x7b86('0xf')](function(_0x44c99c){if(!_0x44c99c)return _0x3ab121[_0x7b86('0x7')](0x194);return{'url':oauth[_0x7b86('0x3e')](_0x44c99c,_0x4aa372[_0x7b86('0x3f')]['id'])};})['then'](respondWithResult(_0x3ab121,null))['catch'](handleError(_0x3ab121,null));};exports[_0x7b86('0x40')]=function(_0x22cfd9,_0x50d415){var _0x57fdc4=_0x22cfd9[_0x7b86('0x35')];var _0x351d75;var _0x3412a3;if(_0x57fdc4[_0x7b86('0x41')])throw _0x57fdc4;redis[_0x7b86('0x42')](_0x57fdc4[_0x7b86('0x43')])['then'](function(_0x3633f5){if(!_0x3633f5)throw new Error(_0x7b86('0x44'));_0x351d75=JSON[_0x7b86('0x45')](_0x3633f5);var _0x1adfdf=Buffer[_0x7b86('0x46')](_0x57fdc4[_0x7b86('0x43')],'base64')[_0x7b86('0x47')](_0x7b86('0x48'));_0x3412a3=JSON[_0x7b86('0x45')](_0x1adfdf);if(!oauth[_0x7b86('0x49')](_0x57fdc4[_0x7b86('0x4a')],_0x351d75[_0x7b86('0x4b')]))throw new Error(_0x7b86('0x4c'));redis[_0x7b86('0x4d')](_0x57fdc4['state']);return oauth[_0x7b86('0x4e')](_0x57fdc4['code'],_0x351d75);})[_0x7b86('0xf')](function(_0x5d1ff1){_0x351d75['data5']=_0x5d1ff1[_0x7b86('0x4f')];_0x351d75[_0x7b86('0x50')]=_0x5d1ff1[_0x7b86('0x51')];return db[_0x7b86('0x17')][_0x7b86('0x52')]({'data5':_0x351d75[_0x7b86('0x53')],'data6':_0x351d75[_0x7b86('0x50')]},{'where':{'id':_0x351d75['id']}});})[_0x7b86('0xf')](function(){oauth[_0x7b86('0x54')](_0x351d75);socket[_0x7b86('0x55')]('microsoftAuthorization:success',{'id':_0x3412a3['id']});return;})[_0x7b86('0xf')](respondWithStatusCode(_0x50d415,null))[_0x7b86('0x34')](function(_0x3213d0){if(_0x3412a3){socket[_0x7b86('0x55')](_0x7b86('0x56'),{'id':_0x3412a3['id']});}if(!_0x351d75){logger[_0x7b86('0x41')](_0x7b86('0x57'),_0x3213d0);return _0x50d415[_0x7b86('0x8')](0x1f4)[_0x7b86('0x12')](_0x3213d0['message']);}logger[_0x7b86('0x41')](_0x7b86('0x58'),_0x351d75['id'],JSON[_0x7b86('0x59')](_0x3213d0));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 9b22a01..02e4841 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 _0x49fa=['bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','util','../../config/logger','api','moment'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x49fa,0x6b));var _0xa49f=function(_0x367768,_0x106f4c){_0x367768=_0x367768-0x0;var _0x421e64=_0x49fa[_0x367768];return _0x421e64;};'use strict';var _=require(_0xa49f('0x0'));var util=require(_0xa49f('0x1'));var logger=require(_0xa49f('0x2'))(_0xa49f('0x3'));var moment=require(_0xa49f('0x4'));var BPromise=require(_0xa49f('0x5'));var rp=require(_0xa49f('0x6'));var fs=require('fs');var path=require(_0xa49f('0x7'));var rimraf=require(_0xa49f('0x8'));var config=require(_0xa49f('0x9'));var attributes=require(_0xa49f('0xa'));module[_0xa49f('0xb')]=function(_0x172ed2,_0x226456){return _0x172ed2[_0xa49f('0xc')](_0xa49f('0xd'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f4d=['define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./cloudProvider.attributes','exports'];(function(_0x204e52,_0x1d553a){var _0xe5dd25=function(_0x39302b){while(--_0x39302b){_0x204e52['push'](_0x204e52['shift']());}};_0xe5dd25(++_0x1d553a);}(_0x6f4d,0x155));var _0xd6f4=function(_0x4210f6,_0x45fc98){_0x4210f6=_0x4210f6-0x0;var _0x98142=_0x6f4d[_0x4210f6];return _0x98142;};'use strict';var _=require(_0xd6f4('0x0'));var util=require(_0xd6f4('0x1'));var logger=require(_0xd6f4('0x2'))(_0xd6f4('0x3'));var moment=require(_0xd6f4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6f4('0x5'));var rimraf=require(_0xd6f4('0x6'));var config=require(_0xd6f4('0x7'));var attributes=require(_0xd6f4('0x8'));module[_0xd6f4('0x9')]=function(_0x1ca329,_0x2380b1){return _0x1ca329[_0xd6f4('0xa')](_0xd6f4('0xb'),attributes,{'tableName':_0xd6f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 87ccb4f..d986048 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x408d=['payload','iss','issuer','aud','audience','isAfter','exp','resolve','then','CloudProvider','data6','decryptString','POST','data5','refresh_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data3','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','Outlook365','Dynamics365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','toString','hex','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','nonce','login','key','oauth2Claims','oauth2/','set','stringify'];(function(_0x20e4bc,_0x12b748){var _0x5181c1=function(_0x5cd2af){while(--_0x5cd2af){_0x20e4bc['push'](_0x20e4bc['shift']());}};_0x5181c1(++_0x12b748);}(_0x408d,0x10d));var _0xd408=function(_0x1082ca,_0xf509b1){_0x1082ca=_0x1082ca-0x0;var _0x36ecc0=_0x408d[_0x1082ca];return _0x36ecc0;};'use strict';var _=require(_0xd408('0x0'));var crypto=require(_0xd408('0x1'));var jwt=require(_0xd408('0x2'));var moment=require(_0xd408('0x3'));var Redis=require('ioredis');var rp=require(_0xd408('0x4'));var util=require(_0xd408('0x5'));var encryptor=require(_0xd408('0x6'));var config=require(_0xd408('0x7'));var logger=require(_0xd408('0x8'))(_0xd408('0x9'));var schedule=require(_0xd408('0xa'));var db=require(_0xd408('0xb'))['db'];config[_0xd408('0xc')]=_[_0xd408('0xd')](config[_0xd408('0xc')],{'host':_0xd408('0xe'),'port':0x18eb});var redis=new Redis(config[_0xd408('0xc')]);var MICROSOFT_AUTH_URL=_0xd408('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xd408('0x10'),_0xd408('0x11'),_0xd408('0x12'),_0xd408('0x13'),_0xd408('0x14'),_0xd408('0x15'),_0xd408('0x16')],'Dynamics365':[_0xd408('0x10'),_0xd408('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0xd408('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0xd408('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x12e508){var _0x513695=_[_0xd408('0x19')](AZURE_AUTH_SCOPES[_0x12e508[_0xd408('0x1a')]]);if(_0x12e508[_0xd408('0x1a')]==='Dynamics365')_0x513695[_0xd408('0x1b')](_0x12e508[_0xd408('0x1c')]+'/.default');return _0x513695['join']('\x20');}function getAccessTokenScope(_0x1bdc6c){if(_0x1bdc6c[_0xd408('0x1a')]===_0xd408('0x1d'))return _0xd408('0x14');if(_0x1bdc6c['type']===_0xd408('0x1e'))return _0x1bdc6c[_0xd408('0x1c')]+_0xd408('0x1f');}function generateMicrosoftAuthorizationUrl(_0x2738de,_0x267946){var _0x3abbf0=MICROSOFT_AUTH_URL[_0xd408('0x20')](_0xd408('0x21'),_0x2738de[_0xd408('0x22')]);var _0x3bcc98=[_0xd408('0x23'),_0xd408('0x24')];var _0xc08433=Buffer[_0xd408('0x25')](JSON['stringify']({'id':_0x267946}))[_0xd408('0x26')]('base64');var _0x149285=crypto['randomBytes'](0x10)[_0xd408('0x26')](_0xd408('0x27'));var _0x15fdd4=getAuthorizationScopes(_0x2738de);var _0x50859b=[{'key':_0xd408('0x28'),'value':_0x2738de[_0xd408('0x29')]},{'key':_0xd408('0x2a'),'value':encodeURIComponent(_0x3bcc98[_0xd408('0x2b')]('\x20'))},{'key':_0xd408('0x2c'),'value':_0x2738de[_0xd408('0x2d')]},{'key':_0xd408('0x2e'),'value':_0xd408('0x2f')},{'key':'scope','value':encodeURIComponent(_0x15fdd4)},{'key':'state','value':_0xc08433},{'key':_0xd408('0x30'),'value':_0x149285},{'key':'prompt','value':_0xd408('0x31')}];var _0x556a80=_0x3abbf0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xd408('0x19')](_0x50859b,function(_0x46eaea){return _0x46eaea[_0xd408('0x32')]+'='+_0x46eaea['value'];})['join']('&');_0x2738de[_0xd408('0x33')]={'issuer':_0x3abbf0[_0xd408('0x20')](_0xd408('0x34'),''),'audience':_0x2738de[_0xd408('0x29')],'state':_0xc08433,'nonce':_0x149285};redis[_0xd408('0x35')](_0xc08433,JSON[_0xd408('0x36')](_0x2738de));return _0x556a80;}function isValidIdToken(_0x12ef78,_0x19ee02){try{var _0x245346=jwt['decode'](_0x12ef78,{'complete':!![]});var _0x1fc6b7=_0x245346[_0xd408('0x37')];if(_0x1fc6b7[_0xd408('0x38')]!==_0x19ee02[_0xd408('0x39')])return![];if(_0x1fc6b7[_0xd408('0x3a')]!==_0x19ee02[_0xd408('0x3b')])return![];if(_0x1fc6b7[_0xd408('0x30')]!==_0x19ee02['nonce'])return![];if(moment()[_0xd408('0x3c')](moment['unix'](_0x1fc6b7[_0xd408('0x3d')])))return![];return!![];}catch(_0x52d9f7){throw _0x52d9f7;}}function refreshOauth2MicrosoftAccessToken(_0x1f6309){return Promise[_0xd408('0x3e')]()[_0xd408('0x3f')](function(){if(_0x1f6309['data3'])return _0x1f6309;return db[_0xd408('0x40')]['findOne']({'where':{'id':_0x1f6309['id']},'raw':!![]});})[_0xd408('0x3f')](function(_0x3a6904){var _0x18c639={'grant_type':'refresh_token','refresh_token':_0x3a6904[_0xd408('0x41')],'scope':getAccessTokenScope(_0x3a6904),'redirect_uri':_0x3a6904['data4'],'client_id':_0x3a6904['data1'],'client_secret':encryptor[_0xd408('0x42')](_0x3a6904['data3'])};var _0x546e94={'method':_0xd408('0x43'),'uri':MICROSOFT_AUTH_URL[_0xd408('0x20')](_0xd408('0x21'),_0x3a6904[_0xd408('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x18c639,'json':!![]};return rp(_0x546e94);})['then'](function(_0x24cac5){_0x1f6309[_0xd408('0x44')]=_0x24cac5['access_token'];_0x1f6309[_0xd408('0x41')]=_0x24cac5[_0xd408('0x45')];return db[_0xd408('0x40')][_0xd408('0x46')]({'data5':_0x1f6309[_0xd408('0x44')],'data6':_0x1f6309['data6']},{'where':{'id':_0x1f6309['id']}});})[_0xd408('0x3f')](function(){return _0x1f6309;})[_0xd408('0x47')](function(_0x5811d9){logger['error'](_0xd408('0x48'),_0x1f6309['id'],_0x5811d9);});}function getOauth2MicrosoftAccessToken(_0x2576e2,_0x38bde5){var _0x14da9b={'grant_type':_0xd408('0x49'),'code':_0x2576e2,'scope':getAccessTokenScope(_0x38bde5),'redirect_uri':_0x38bde5['data4'],'client_id':_0x38bde5['data1'],'client_secret':encryptor[_0xd408('0x42')](_0x38bde5[_0xd408('0x4a')])};var _0x6be071={'method':_0xd408('0x43'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x38bde5[_0xd408('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x14da9b,'json':!![]};return rp(_0x6be071);}function startRefreshInterval(_0x5db315){var _0x79ba62=schedule[_0xd408('0x4b')];if(_0x79ba62[_0x5db315['id']])clearInterval(_0x79ba62[_0x5db315['id']]);_0x79ba62[_0x5db315['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x5db315['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xd408('0x4b')]=_0x79ba62;}function startAllRefreshIntervals(){return db[_0xd408('0x40')][_0xd408('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xd408('0x3f')](function(_0x2afb80){var _0x4d138b=_0x2afb80[_0xd408('0x19')](function(_0x4f923a){return refreshOauth2MicrosoftAccessToken(_0x4f923a)[_0xd408('0x3f')](function(_0x1d1185){startRefreshInterval(_0x1d1185);});});return Promise[_0xd408('0x4d')](_0x4d138b);})[_0xd408('0x47')](function(_0x32fa55){var _0x1b90cb=_0x32fa55?util[_0xd408('0x4e')](_0x32fa55,{'showHidden':![],'depth':null}):'';logger['error'](_0xd408('0x4f'),_0x1b90cb);});}module[_0xd408('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xa510=['replace','{TENANT_ID}','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','aud','audience','exp','resolve','CloudProvider','findOne','then','refresh_token','data6','data3','POST','data5','access_token','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','decryptString','intervals','bind','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','push','data7','/.default','join','Outlook365'];(function(_0x37512d,_0x44495e){var _0x133f49=function(_0x10b685){while(--_0x10b685){_0x37512d['push'](_0x37512d['shift']());}};_0x133f49(++_0x44495e);}(_0xa510,0x173));var _0x0a51=function(_0x586996,_0x1f5045){_0x586996=_0x586996-0x0;var _0x20d448=_0xa510[_0x586996];return _0x20d448;};'use strict';var _=require(_0x0a51('0x0'));var crypto=require('crypto');var jwt=require(_0x0a51('0x1'));var moment=require(_0x0a51('0x2'));var Redis=require(_0x0a51('0x3'));var rp=require(_0x0a51('0x4'));var util=require(_0x0a51('0x5'));var encryptor=require(_0x0a51('0x6'));var config=require('../../config/environment');var logger=require(_0x0a51('0x7'))(_0x0a51('0x8'));var schedule=require(_0x0a51('0x9'));var db=require(_0x0a51('0xa'))['db'];config[_0x0a51('0xb')]=_[_0x0a51('0xc')](config['redis'],{'host':_0x0a51('0xd'),'port':0x18eb});var redis=new Redis(config[_0x0a51('0xb')]);var MICROSOFT_AUTH_URL=_0x0a51('0xe');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x0a51('0xf'),_0x0a51('0x10'),_0x0a51('0x11'),_0x0a51('0x12'),_0x0a51('0x13'),_0x0a51('0x14')],'Dynamics365':['openid',_0x0a51('0x11')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x0a51('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x59d2a3){var _0x2a7cb0=_[_0x0a51('0x16')](AZURE_AUTH_SCOPES[_0x59d2a3[_0x0a51('0x17')]]);if(_0x59d2a3[_0x0a51('0x17')]==='Dynamics365')_0x2a7cb0[_0x0a51('0x18')](_0x59d2a3[_0x0a51('0x19')]+_0x0a51('0x1a'));return _0x2a7cb0[_0x0a51('0x1b')]('\x20');}function getAccessTokenScope(_0x39674d){if(_0x39674d['type']===_0x0a51('0x1c'))return _0x0a51('0x12');if(_0x39674d[_0x0a51('0x17')]==='Dynamics365')return _0x39674d[_0x0a51('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x426341,_0x3214e0){var _0x5ea1b0=MICROSOFT_AUTH_URL[_0x0a51('0x1d')](_0x0a51('0x1e'),_0x426341[_0x0a51('0x1f')]);var _0x484d78=[_0x0a51('0x20'),_0x0a51('0x21')];var _0x11a076=Buffer['from'](JSON[_0x0a51('0x22')]({'id':_0x3214e0}))[_0x0a51('0x23')](_0x0a51('0x24'));var _0x4d6768=crypto[_0x0a51('0x25')](0x10)[_0x0a51('0x23')](_0x0a51('0x26'));var _0x1cbda7=getAuthorizationScopes(_0x426341);var _0x2945dd=[{'key':_0x0a51('0x27'),'value':_0x426341[_0x0a51('0x28')]},{'key':_0x0a51('0x29'),'value':encodeURIComponent(_0x484d78['join']('\x20'))},{'key':_0x0a51('0x2a'),'value':_0x426341[_0x0a51('0x2b')]},{'key':'response_mode','value':_0x0a51('0x2c')},{'key':_0x0a51('0x2d'),'value':encodeURIComponent(_0x1cbda7)},{'key':_0x0a51('0x2e'),'value':_0x11a076},{'key':_0x0a51('0x2f'),'value':_0x4d6768},{'key':_0x0a51('0x30'),'value':_0x0a51('0x31')}];var _0x2db337=_0x5ea1b0+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x2945dd,function(_0x26d48a){return _0x26d48a[_0x0a51('0x32')]+'='+_0x26d48a[_0x0a51('0x33')];})[_0x0a51('0x1b')]('&');_0x426341[_0x0a51('0x34')]={'issuer':_0x5ea1b0[_0x0a51('0x1d')](_0x0a51('0x35'),''),'audience':_0x426341['data1'],'state':_0x11a076,'nonce':_0x4d6768};redis[_0x0a51('0x36')](_0x11a076,JSON[_0x0a51('0x22')](_0x426341));return _0x2db337;}function isValidIdToken(_0x2bf42b,_0x5ccfcc){try{var _0x50b530=jwt[_0x0a51('0x37')](_0x2bf42b,{'complete':!![]});var _0x245eb2=_0x50b530[_0x0a51('0x38')];if(_0x245eb2['iss']!==_0x5ccfcc['issuer'])return![];if(_0x245eb2[_0x0a51('0x39')]!==_0x5ccfcc[_0x0a51('0x3a')])return![];if(_0x245eb2['nonce']!==_0x5ccfcc[_0x0a51('0x2f')])return![];if(moment()['isAfter'](moment['unix'](_0x245eb2[_0x0a51('0x3b')])))return![];return!![];}catch(_0xafff69){throw _0xafff69;}}function refreshOauth2MicrosoftAccessToken(_0x3c81dc){return Promise[_0x0a51('0x3c')]()['then'](function(){if(_0x3c81dc['data3'])return _0x3c81dc;return db[_0x0a51('0x3d')][_0x0a51('0x3e')]({'where':{'id':_0x3c81dc['id']},'raw':!![]});})[_0x0a51('0x3f')](function(_0x136974){var _0x422371={'grant_type':_0x0a51('0x40'),'refresh_token':_0x136974[_0x0a51('0x41')],'scope':getAccessTokenScope(_0x136974),'redirect_uri':_0x136974[_0x0a51('0x2b')],'client_id':_0x136974['data1'],'client_secret':encryptor['decryptString'](_0x136974[_0x0a51('0x42')])};var _0x635035={'method':_0x0a51('0x43'),'uri':MICROSOFT_AUTH_URL[_0x0a51('0x1d')](_0x0a51('0x1e'),_0x136974[_0x0a51('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x422371,'json':!![]};return rp(_0x635035);})[_0x0a51('0x3f')](function(_0x34931f){_0x3c81dc[_0x0a51('0x44')]=_0x34931f[_0x0a51('0x45')];_0x3c81dc[_0x0a51('0x41')]=_0x34931f[_0x0a51('0x40')];return db['CloudProvider']['update']({'data5':_0x3c81dc[_0x0a51('0x44')],'data6':_0x3c81dc['data6']},{'where':{'id':_0x3c81dc['id']}});})[_0x0a51('0x3f')](function(){return _0x3c81dc;})['catch'](function(_0x245526){logger[_0x0a51('0x46')](_0x0a51('0x47'),_0x3c81dc['id'],_0x245526);});}function getOauth2MicrosoftAccessToken(_0x333b95,_0x52570c){var _0x573c66={'grant_type':_0x0a51('0x48'),'code':_0x333b95,'scope':getAccessTokenScope(_0x52570c),'redirect_uri':_0x52570c[_0x0a51('0x2b')],'client_id':_0x52570c[_0x0a51('0x28')],'client_secret':encryptor[_0x0a51('0x49')](_0x52570c[_0x0a51('0x42')])};var _0x3ec83e={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x0a51('0x1d')](_0x0a51('0x1e'),_0x52570c[_0x0a51('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x573c66,'json':!![]};return rp(_0x3ec83e);}function startRefreshInterval(_0x566724){var _0x479f77=schedule[_0x0a51('0x4a')];if(_0x479f77[_0x566724['id']])clearInterval(_0x479f77[_0x566724['id']]);_0x479f77[_0x566724['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x0a51('0x4b')](this,{'id':_0x566724['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x0a51('0x4a')]=_0x479f77;}function startAllRefreshIntervals(){return db[_0x0a51('0x3d')][_0x0a51('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x250dc1){var _0x5b6ca5=_0x250dc1[_0x0a51('0x16')](function(_0x4e5d11){return refreshOauth2MicrosoftAccessToken(_0x4e5d11)[_0x0a51('0x3f')](function(_0x4b07d8){startRefreshInterval(_0x4b07d8);});});return Promise['all'](_0x5b6ca5);})['catch'](function(_0x42d852){var _0x5a89e8=_0x42d852?util[_0x0a51('0x4d')](_0x42d852,{'showHidden':![],'depth':null}):'';logger[_0x0a51('0x46')](_0x0a51('0x4e'),_0x5a89e8);});}module[_0x0a51('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2cd3dcb..f363dd0 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 _0xb96d=['then','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x3d4a60,_0x1d61f9){var _0x3b686d=function(_0x2f41d7){while(--_0x2f41d7){_0x3d4a60['push'](_0x3d4a60['shift']());}};_0x3b686d(++_0x1d61f9);}(_0xb96d,0x9e));var _0xdb96=function(_0x5275b8,_0x51e5dd){_0x5275b8=_0x5275b8-0x0;var _0x568a9b=_0xb96d[_0x5275b8];return _0x568a9b;};'use strict';var _=require('lodash');var util=require(_0xdb96('0x0'));var moment=require(_0xdb96('0x1'));var BPromise=require(_0xdb96('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb96('0x3'));var db=require(_0xdb96('0x4'))['db'];var utils=require(_0xdb96('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdb96('0x6'));var jayson=require(_0xdb96('0x7'));var client=jayson[_0xdb96('0x8')][_0xdb96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f5e6f,_0x294084,_0x571e0e){return new BPromise(function(_0x5e2e95,_0x3384b4){return client['request'](_0x4f5e6f,_0x571e0e)[_0xdb96('0xa')](function(_0xaea492){logger['info'](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));logger['debug'](_0xdb96('0xd'),_0x294084,_0xdb96('0xc'),JSON[_0xdb96('0xe')](_0xaea492));if(_0xaea492[_0xdb96('0xf')]){if(_0xaea492['error'][_0xdb96('0x10')]===0x1f4){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492['error'][_0xdb96('0x11')]);return _0x3384b4(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);return _0x5e2e95(_0xaea492[_0xdb96('0xf')][_0xdb96('0x11')]);}else{logger[_0xdb96('0x12')](_0xdb96('0xb'),_0x294084,_0xdb96('0xc'));_0x5e2e95(_0xaea492[_0xdb96('0x13')]['message']);}})[_0xdb96('0x14')](function(_0x2a766e){logger[_0xdb96('0xf')](_0xdb96('0xb'),_0x294084,_0x2a766e);_0x3384b4(_0x2a766e);});});} \ No newline at end of file +var _0x88c7=['then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x2840b1,_0x4f7724){var _0x5570fa=function(_0x3557e6){while(--_0x3557e6){_0x2840b1['push'](_0x2840b1['shift']());}};_0x5570fa(++_0x4f7724);}(_0x88c7,0x6f));var _0x788c=function(_0x566f9f,_0x26af49){_0x566f9f=_0x566f9f-0x0;var _0x150bc8=_0x88c7[_0x566f9f];return _0x150bc8;};'use strict';var _=require(_0x788c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x788c('0x1'));var rs=require(_0x788c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x788c('0x3'));var logger=require(_0x788c('0x4'))('rpc');var config=require(_0x788c('0x5'));var jayson=require(_0x788c('0x6'));var client=jayson['client'][_0x788c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ed470,_0x54808d,_0x5dde40){return new BPromise(function(_0xe8843b,_0x27abaf){return client[_0x788c('0x8')](_0x2ed470,_0x5dde40)[_0x788c('0x9')](function(_0x43f746){logger['info'](_0x788c('0xa'),_0x54808d,_0x788c('0xb'));logger[_0x788c('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x54808d,_0x788c('0xb'),JSON[_0x788c('0xd')](_0x43f746));if(_0x43f746[_0x788c('0xe')]){if(_0x43f746[_0x788c('0xe')][_0x788c('0xf')]===0x1f4){logger[_0x788c('0xe')]('CloudProvider,\x20%s,\x20%s',_0x54808d,_0x43f746[_0x788c('0xe')]['message']);return _0x27abaf(_0x43f746[_0x788c('0xe')]['message']);}logger[_0x788c('0xe')](_0x788c('0xa'),_0x54808d,_0x43f746[_0x788c('0xe')][_0x788c('0x10')]);return _0xe8843b(_0x43f746[_0x788c('0xe')][_0x788c('0x10')]);}else{logger[_0x788c('0x11')](_0x788c('0xa'),_0x54808d,_0x788c('0xb'));_0xe8843b(_0x43f746[_0x788c('0x12')][_0x788c('0x10')]);}})[_0x788c('0x13')](function(_0x2c57c3){logger['error'](_0x788c('0xa'),_0x54808d,_0x2c57c3);_0x27abaf(_0x2c57c3);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5decf46..854e3fb 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 _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x1f12dc,_0x22e3a1){var _0x927f31=function(_0x3e3570){while(--_0x3e3570){_0x1f12dc['push'](_0x1f12dc['shift']());}};_0x927f31(++_0x22e3a1);}(_0xadb5,0xad));var _0x5adb=function(_0x49c342,_0x5a03f0){_0x49c342=_0x49c342-0x0;var _0x2573e7=_0xadb5[_0x49c342];return _0x2573e7;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file +var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x7a54,0x106));var _0x47a5=function(_0x43c421,_0x2fddad){_0x43c421=_0x43c421-0x0;var _0x55232f=_0x7a54[_0x43c421];return _0x55232f;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 574dbc9..5b48aeb 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 _0x9251=['exports','STRING','name'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x9251,0x1e6));var _0x1925=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0x9251[_0x7cb10c];return _0x11df59;};'use strict';var Sequelize=require('sequelize');module[_0x1925('0x0')]={'name':{'type':Sequelize[_0x1925('0x1')],'unique':_0x1925('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1925('0x1')]},'companyId':{'type':Sequelize[_0x1925('0x1')]},'website':{'type':Sequelize[_0x1925('0x1')]},'phone':{'type':Sequelize[_0x1925('0x1')]},'fax':{'type':Sequelize[_0x1925('0x1')]},'type':{'type':Sequelize[_0x1925('0x1')]},'street':{'type':Sequelize[_0x1925('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1925('0x1')]},'country':{'type':Sequelize[_0x1925('0x1')]},'email':{'type':Sequelize[_0x1925('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1925('0x1')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x1925('0x1')]},'sCountry':{'type':Sequelize[_0x1925('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8185=['sequelize','exports','STRING'];(function(_0x2b1a36,_0x52eecd){var _0x2e03ca=function(_0x1a8ff9){while(--_0x1a8ff9){_0x2b1a36['push'](_0x2b1a36['shift']());}};_0x2e03ca(++_0x52eecd);}(_0x8185,0xc6));var _0x5818=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x8185[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x5818('0x0'));module[_0x5818('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x5818('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x5818('0x2')]},'type':{'type':Sequelize[_0x5818('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5818('0x2')]},'city':{'type':Sequelize[_0x5818('0x2')]},'country':{'type':Sequelize[_0x5818('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x5818('0x2')]},'sStreet':{'type':Sequelize[_0x5818('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x5818('0x2')]},'sCountry':{'type':Sequelize[_0x5818('0x2')]},'description':{'type':Sequelize[_0x5818('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 9830683..24d65d5 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 _0x3d40=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','get','end','sendStatus','stack','name','send','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','map','includeAll','findAll','rows','catch','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','length','options','hasOwnProperty','nolimit','eml-format'];(function(_0x4c5664,_0x170d12){var _0x380651=function(_0x3b3834){while(--_0x3b3834){_0x4c5664['push'](_0x4c5664['shift']());}};_0x380651(++_0x170d12);}(_0x3d40,0x15b));var _0x03d4=function(_0x2b51c0,_0x28fbb3){_0x2b51c0=_0x2b51c0-0x0;var _0x4dc66f=_0x3d40[_0x2b51c0];return _0x4dc66f;};'use strict';var emlformat=require(_0x03d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03d4('0x2'));var moment=require(_0x03d4('0x3'));var BPromise=require(_0x03d4('0x4'));var Mustache=require(_0x03d4('0x5'));var util=require(_0x03d4('0x6'));var path=require(_0x03d4('0x7'));var sox=require(_0x03d4('0x8'));var csv=require(_0x03d4('0x9'));var ejs=require(_0x03d4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x03d4('0xb'));var squel=require('squel');var crypto=require(_0x03d4('0xc'));var jsforce=require(_0x03d4('0xd'));var deskjs=require(_0x03d4('0xe'));var toCsv=require(_0x03d4('0x9'));var querystring=require(_0x03d4('0xf'));var Papa=require(_0x03d4('0x10'));var Redis=require('ioredis');var authService=require(_0x03d4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x03d4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03d4('0x13'))(_0x03d4('0x14'));var utils=require(_0x03d4('0x15'));var config=require(_0x03d4('0x16'));var licenseUtil=require(_0x03d4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4acf90,_0x462a5a){_0x462a5a=_0x462a5a||0xcc;return function(_0x181e4b){if(_0x181e4b){return _0x4acf90['sendStatus'](_0x462a5a);}return _0x4acf90['status'](_0x462a5a)['end']();};}function respondWithResult(_0x284758,_0x3088d3){_0x3088d3=_0x3088d3||0xc8;return function(_0x147095){if(_0x147095){return _0x284758[_0x03d4('0x18')](_0x3088d3)[_0x03d4('0x19')](_0x147095);}};}function respondWithFilteredResult(_0x1f28f4,_0x596d5a){return function(_0x5c93c5){if(_0x5c93c5){var _0x20c9c2=typeof _0x596d5a[_0x03d4('0x1a')]==='undefined'&&typeof _0x596d5a[_0x03d4('0x1b')]===_0x03d4('0x1c');var _0x1a0035=_0x5c93c5[_0x03d4('0x1d')];var _0x2ac665=_0x20c9c2?0x0:_0x596d5a[_0x03d4('0x1a')];var _0x45272c=_0x20c9c2?_0x5c93c5[_0x03d4('0x1d')]:_0x596d5a[_0x03d4('0x1a')]+_0x596d5a[_0x03d4('0x1b')];var _0x42f054;if(_0x45272c>=_0x1a0035){_0x45272c=_0x1a0035;_0x42f054=0xc8;}else{_0x42f054=0xce;}_0x1f28f4[_0x03d4('0x18')](_0x42f054);return _0x1f28f4[_0x03d4('0x1e')](_0x03d4('0x1f'),_0x2ac665+'-'+_0x45272c+'/'+_0x1a0035)[_0x03d4('0x19')](_0x5c93c5);}return null;};}function patchUpdates(_0x44c520){return function(_0x5374e2){try{jsonpatch[_0x03d4('0x20')](_0x5374e2,_0x44c520,!![]);}catch(_0x2c0e38){return BPromise['reject'](_0x2c0e38);}return _0x5374e2[_0x03d4('0x21')]();};}function saveUpdates(_0x42483d,_0x5db638){return function(_0xba517f){if(_0xba517f){return _0xba517f[_0x03d4('0x22')](_0x42483d)['then'](function(_0x3635de){return _0x3635de;});}return null;};}function removeEntity(_0x36ff23,_0x203cc5){return function(_0x533993){if(_0x533993){return _0x533993[_0x03d4('0x23')]()[_0x03d4('0x24')](function(){var _0x418ee3=_0x533993[_0x03d4('0x25')]({'plain':!![]});var _0x4b8d5e='Companies';return db['UserProfileResource']['destroy']({'where':{'type':_0x4b8d5e,'resourceId':_0x418ee3['id']}})[_0x03d4('0x24')](function(){return _0x533993;});})[_0x03d4('0x24')](function(){_0x36ff23['status'](0xcc)[_0x03d4('0x26')]();});}};}function handleEntityNotFound(_0x1c88be,_0xd78309){return function(_0x28c614){if(!_0x28c614){_0x1c88be[_0x03d4('0x27')](0x194);}return _0x28c614;};}function handleError(_0x6c3296,_0x150820){_0x150820=_0x150820||0x1f4;return function(_0x5b31d0){logger['error'](_0x5b31d0[_0x03d4('0x28')]);if(_0x5b31d0['name']){delete _0x5b31d0[_0x03d4('0x29')];}_0x6c3296[_0x03d4('0x18')](_0x150820)[_0x03d4('0x2a')](_0x5b31d0);};}exports[_0x03d4('0x2b')]=function(_0x216375,_0xdfe8ea){var _0x201c09={},_0x3b4e2f={},_0x21445b={'count':0x0,'rows':[]};return db[_0x03d4('0x2c')][_0x03d4('0x2d')]()[_0x03d4('0x24')](function(_0x34ecff){_0x3b4e2f[_0x03d4('0x2e')]=_[_0x03d4('0x2f')](_0x34ecff);_0x3b4e2f[_0x03d4('0x30')]=_[_0x03d4('0x2f')](_0x216375[_0x03d4('0x30')]);_0x3b4e2f[_0x03d4('0x31')]=_[_0x03d4('0x32')](_0x3b4e2f[_0x03d4('0x2e')],_0x3b4e2f[_0x03d4('0x30')]);_0x201c09[_0x03d4('0x33')]=_['intersection'](_0x3b4e2f[_0x03d4('0x2e')],qs[_0x03d4('0x34')](_0x216375['query']['fields']));_0x201c09[_0x03d4('0x33')]=_0x201c09[_0x03d4('0x33')]['length']?_0x201c09[_0x03d4('0x33')]:_0x3b4e2f[_0x03d4('0x2e')];if(!_0x216375[_0x03d4('0x30')]['hasOwnProperty']('nolimit')){_0x201c09['limit']=qs[_0x03d4('0x1b')](_0x216375['query'][_0x03d4('0x1b')]);_0x201c09['offset']=qs['offset'](_0x216375[_0x03d4('0x30')][_0x03d4('0x1a')]);}_0x201c09[_0x03d4('0x35')]=qs[_0x03d4('0x36')](_0x216375[_0x03d4('0x30')]['sort']);_0x201c09[_0x03d4('0x37')]=qs[_0x03d4('0x31')](_[_0x03d4('0x38')](_0x216375[_0x03d4('0x30')],_0x3b4e2f[_0x03d4('0x31')]),_0x34ecff);if(_0x216375[_0x03d4('0x30')][_0x03d4('0x39')]){_0x201c09['where']=_[_0x03d4('0x3a')](_0x201c09[_0x03d4('0x37')],{'$or':_[_0x03d4('0x3b')](_0x201c09[_0x03d4('0x33')],function(_0x1ef564){var _0x25354b={};_0x25354b[_0x1ef564]={'$like':'%'+_0x216375['query'][_0x03d4('0x39')]+'%'};return _0x25354b;})});}_0x201c09=_[_0x03d4('0x3a')]({},_0x201c09,_0x216375['options']);var _0x2b88f5={'where':_0x201c09[_0x03d4('0x37')]};return db['CmCompany'][_0x03d4('0x1d')](_0x2b88f5)[_0x03d4('0x24')](function(_0x173a1e){_0x21445b[_0x03d4('0x1d')]=_0x173a1e;if(_0x216375['query'][_0x03d4('0x3c')]){_0x201c09['include']=[{'all':!![]}];}return db[_0x03d4('0x2c')][_0x03d4('0x3d')](_0x201c09);})['then'](function(_0x5c3818){_0x21445b[_0x03d4('0x3e')]=_0x5c3818;return _0x21445b;})[_0x03d4('0x24')](respondWithFilteredResult(_0xdfe8ea,_0x201c09))[_0x03d4('0x3f')](handleError(_0xdfe8ea,null));})[_0x03d4('0x3f')](handleError(_0xdfe8ea,null));};exports['show']=function(_0x561603,_0x1841a9){var _0x3a1335={'raw':![],'where':{'id':_0x561603[_0x03d4('0x40')]['id']}},_0x8f50c3={};_0x8f50c3[_0x03d4('0x2e')]=_[_0x03d4('0x2f')](db['CmCompany'][_0x03d4('0x41')]);_0x8f50c3[_0x03d4('0x30')]=_[_0x03d4('0x2f')](_0x561603['query']);_0x8f50c3[_0x03d4('0x31')]=_[_0x03d4('0x32')](_0x8f50c3[_0x03d4('0x2e')],_0x8f50c3[_0x03d4('0x30')]);_0x3a1335[_0x03d4('0x33')]=_[_0x03d4('0x32')](_0x8f50c3['model'],qs['fields'](_0x561603[_0x03d4('0x30')][_0x03d4('0x34')]));_0x3a1335[_0x03d4('0x33')]=_0x3a1335[_0x03d4('0x33')]['length']?_0x3a1335[_0x03d4('0x33')]:_0x8f50c3[_0x03d4('0x2e')];if(_0x561603[_0x03d4('0x30')][_0x03d4('0x3c')]){_0x3a1335[_0x03d4('0x42')]=[{'all':!![]}];}_0x3a1335=_['merge']({},_0x3a1335,_0x561603['options']);return db['CmCompany'][_0x03d4('0x43')](_0x3a1335)[_0x03d4('0x24')](handleEntityNotFound(_0x1841a9,null))[_0x03d4('0x24')](respondWithResult(_0x1841a9,null))[_0x03d4('0x3f')](handleError(_0x1841a9,null));};exports[_0x03d4('0x44')]=function(_0x104a91,_0x296926){return db['CmCompany'][_0x03d4('0x44')](_0x104a91[_0x03d4('0x45')],{})[_0x03d4('0x24')](function(_0x341bd){var _0x425564=_0x104a91[_0x03d4('0x46')][_0x03d4('0x25')]({'plain':!![]});if(!_0x425564)throw new Error(_0x03d4('0x47'));if(_0x425564[_0x03d4('0x48')]===_0x03d4('0x46')){var _0x1f2539=_0x341bd['get']({'plain':!![]});var _0x251f10=_0x03d4('0x49');return db[_0x03d4('0x4a')]['find']({'where':{'name':_0x251f10,'userProfileId':_0x425564['userProfileId']},'raw':!![]})[_0x03d4('0x24')](function(_0x8f2ea5){if(_0x8f2ea5&&_0x8f2ea5[_0x03d4('0x4b')]===0x0){return db['UserProfileResource'][_0x03d4('0x44')]({'name':_0x1f2539[_0x03d4('0x29')],'resourceId':_0x1f2539['id'],'type':_0x8f2ea5[_0x03d4('0x29')],'sectionId':_0x8f2ea5['id']},{})['then'](function(){return _0x341bd;});}else{return _0x341bd;}})[_0x03d4('0x3f')](function(_0x3484d6){logger['error'](_0x03d4('0x4c'),_0x3484d6);throw _0x3484d6;});}return _0x341bd;})[_0x03d4('0x24')](respondWithResult(_0x296926,0xc9))['catch'](handleError(_0x296926,null));};exports['update']=function(_0x1e6401,_0x7d70bb){if(_0x1e6401[_0x03d4('0x45')]['id']){delete _0x1e6401[_0x03d4('0x45')]['id'];}return db[_0x03d4('0x2c')]['find']({'where':{'id':_0x1e6401['params']['id']}})[_0x03d4('0x24')](handleEntityNotFound(_0x7d70bb,null))['then'](saveUpdates(_0x1e6401['body'],null))[_0x03d4('0x24')](respondWithResult(_0x7d70bb,null))['catch'](handleError(_0x7d70bb,null));};exports[_0x03d4('0x23')]=function(_0x140e8e,_0x188ca8){return db[_0x03d4('0x2c')][_0x03d4('0x43')]({'where':{'id':_0x140e8e[_0x03d4('0x40')]['id']}})[_0x03d4('0x24')](handleEntityNotFound(_0x188ca8,null))[_0x03d4('0x24')](removeEntity(_0x188ca8,null))['catch'](handleError(_0x188ca8,null));};exports[_0x03d4('0x2d')]=function(_0x4be9ef,_0x3618f1){return db[_0x03d4('0x2c')][_0x03d4('0x2d')]()[_0x03d4('0x24')](respondWithResult(_0x3618f1,null))[_0x03d4('0x3f')](handleError(_0x3618f1,null));};exports['addContacts']=function(_0x4d6512,_0x740576,_0x59f862){return db[_0x03d4('0x4d')][_0x03d4('0x43')]({'where':{'id':_0x4d6512[_0x03d4('0x40')]['id']}})['then'](handleEntityNotFound(_0x740576,null))[_0x03d4('0x24')](function(_0x5a618a){if(_0x5a618a){return _0x5a618a[_0x03d4('0x4e')](_0x4d6512['body'][_0x03d4('0x4f')],_[_0x03d4('0x50')](_0x4d6512[_0x03d4('0x45')],[_0x03d4('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x740576,null))[_0x03d4('0x3f')](handleError(_0x740576,null));};exports[_0x03d4('0x51')]=function(_0x8e8b21,_0x541d4e,_0x4eee81){var _0x501eca={};var _0x38f248={};var _0x3fda6f;var _0xd2b79f;return db[_0x03d4('0x2c')][_0x03d4('0x52')]({'where':{'id':_0x8e8b21[_0x03d4('0x40')]['id']}})[_0x03d4('0x24')](handleEntityNotFound(_0x541d4e,null))[_0x03d4('0x24')](function(_0x5f280a){if(_0x5f280a){_0x3fda6f=_0x5f280a;_0x38f248[_0x03d4('0x2e')]=_['keys'](db['CmContact']['rawAttributes']);_0x38f248[_0x03d4('0x30')]=_[_0x03d4('0x2f')](_0x8e8b21[_0x03d4('0x30')]);_0x38f248['filters']=_['intersection'](_0x38f248[_0x03d4('0x2e')],_0x38f248[_0x03d4('0x30')]);_0x501eca[_0x03d4('0x33')]=_['intersection'](_0x38f248['model'],qs[_0x03d4('0x34')](_0x8e8b21[_0x03d4('0x30')][_0x03d4('0x34')]));_0x501eca[_0x03d4('0x33')]=_0x501eca[_0x03d4('0x33')][_0x03d4('0x53')]?_0x501eca[_0x03d4('0x33')]:_0x38f248['model'];_0x501eca['order']=qs[_0x03d4('0x36')](_0x8e8b21['query'][_0x03d4('0x36')]);_0x501eca['where']=qs[_0x03d4('0x31')](_['pick'](_0x8e8b21[_0x03d4('0x30')],_0x38f248[_0x03d4('0x31')]));if(_0x8e8b21['query'][_0x03d4('0x39')]){_0x501eca[_0x03d4('0x37')]=_[_0x03d4('0x3a')](_0x501eca['where'],{'$or':_[_0x03d4('0x3b')](_0x501eca['attributes'],function(_0xd897c4){var _0x24a008={};_0x24a008[_0xd897c4]={'$like':'%'+_0x8e8b21[_0x03d4('0x30')][_0x03d4('0x39')]+'%'};return _0x24a008;})});}_0x501eca=_['merge']({},_0x501eca,_0x8e8b21[_0x03d4('0x54')]);return _0x3fda6f[_0x03d4('0x51')](_0x501eca);}})[_0x03d4('0x24')](function(_0x335bce){if(_0x335bce){_0xd2b79f=_0x335bce[_0x03d4('0x53')];if(!_0x8e8b21['query'][_0x03d4('0x55')](_0x03d4('0x56'))){_0x501eca['limit']=qs[_0x03d4('0x1b')](_0x8e8b21[_0x03d4('0x30')][_0x03d4('0x1b')]);_0x501eca[_0x03d4('0x1a')]=qs[_0x03d4('0x1a')](_0x8e8b21[_0x03d4('0x30')][_0x03d4('0x1a')]);}return _0x3fda6f[_0x03d4('0x51')](_0x501eca);}})[_0x03d4('0x24')](function(_0x27d208){if(_0x27d208){return _0x27d208?{'count':_0xd2b79f,'rows':_0x27d208}:null;}})[_0x03d4('0x24')](respondWithResult(_0x541d4e,null))[_0x03d4('0x3f')](handleError(_0x541d4e,null));}; \ No newline at end of file +var _0x53c9=['params','keys','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContact','addContacts','ids','omit','getContacts','findOne','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','end','error','stack','name','send','index','CmCompany','describe','model','query','intersection','attributes','fields','length','order','sort','filters','pick','filter','merge','map','options','where','includeAll','findAll','rows','catch','show'];(function(_0x3cac09,_0x398bdc){var _0x376d33=function(_0x4687ae){while(--_0x4687ae){_0x3cac09['push'](_0x3cac09['shift']());}};_0x376d33(++_0x398bdc);}(_0x53c9,0x73));var _0x953c=function(_0x3439b4,_0x3c235c){_0x3439b4=_0x3439b4-0x0;var _0x38d9f8=_0x53c9[_0x3439b4];return _0x38d9f8;};'use strict';var emlformat=require(_0x953c('0x0'));var rimraf=require(_0x953c('0x1'));var zipdir=require(_0x953c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x953c('0x3'));var moment=require(_0x953c('0x4'));var BPromise=require(_0x953c('0x5'));var Mustache=require(_0x953c('0x6'));var util=require(_0x953c('0x7'));var path=require(_0x953c('0x8'));var sox=require(_0x953c('0x9'));var csv=require(_0x953c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x953c('0xb'));var _=require('lodash');var squel=require(_0x953c('0xc'));var crypto=require(_0x953c('0xd'));var jsforce=require(_0x953c('0xe'));var deskjs=require(_0x953c('0xf'));var toCsv=require(_0x953c('0xa'));var querystring=require(_0x953c('0x10'));var Papa=require('papaparse');var Redis=require(_0x953c('0x11'));var authService=require(_0x953c('0x12'));var qs=require(_0x953c('0x13'));var as=require(_0x953c('0x14'));var hardwareService=require(_0x953c('0x15'));var logger=require(_0x953c('0x16'))(_0x953c('0x17'));var utils=require(_0x953c('0x18'));var config=require(_0x953c('0x19'));var licenseUtil=require(_0x953c('0x1a'));var db=require(_0x953c('0x1b'))['db'];function respondWithStatusCode(_0x22fba5,_0x502abd){_0x502abd=_0x502abd||0xcc;return function(_0x1abf6b){if(_0x1abf6b){return _0x22fba5[_0x953c('0x1c')](_0x502abd);}return _0x22fba5[_0x953c('0x1d')](_0x502abd)['end']();};}function respondWithResult(_0x26ef63,_0x4d03ee){_0x4d03ee=_0x4d03ee||0xc8;return function(_0x2af623){if(_0x2af623){return _0x26ef63[_0x953c('0x1d')](_0x4d03ee)[_0x953c('0x1e')](_0x2af623);}};}function respondWithFilteredResult(_0x556e91,_0x3bc35a){return function(_0x241ce6){if(_0x241ce6){var _0x51080c=typeof _0x3bc35a['offset']==='undefined'&&typeof _0x3bc35a[_0x953c('0x1f')]===_0x953c('0x20');var _0x3814d1=_0x241ce6[_0x953c('0x21')];var _0x34ee32=_0x51080c?0x0:_0x3bc35a[_0x953c('0x22')];var _0x4251d0=_0x51080c?_0x241ce6[_0x953c('0x21')]:_0x3bc35a['offset']+_0x3bc35a[_0x953c('0x1f')];var _0x5ef361;if(_0x4251d0>=_0x3814d1){_0x4251d0=_0x3814d1;_0x5ef361=0xc8;}else{_0x5ef361=0xce;}_0x556e91[_0x953c('0x1d')](_0x5ef361);return _0x556e91['set'](_0x953c('0x23'),_0x34ee32+'-'+_0x4251d0+'/'+_0x3814d1)[_0x953c('0x1e')](_0x241ce6);}return null;};}function patchUpdates(_0x179ee5){return function(_0x94e3a){try{jsonpatch[_0x953c('0x24')](_0x94e3a,_0x179ee5,!![]);}catch(_0x1bac00){return BPromise[_0x953c('0x25')](_0x1bac00);}return _0x94e3a[_0x953c('0x26')]();};}function saveUpdates(_0x1a3fc4,_0x3042c3){return function(_0x31dd0e){if(_0x31dd0e){return _0x31dd0e[_0x953c('0x27')](_0x1a3fc4)['then'](function(_0x48d1d6){return _0x48d1d6;});}return null;};}function removeEntity(_0x5df858,_0x43a545){return function(_0x38cb99){if(_0x38cb99){return _0x38cb99[_0x953c('0x28')]()[_0x953c('0x29')](function(){var _0x2ec2cd=_0x38cb99[_0x953c('0x2a')]({'plain':!![]});var _0x5d0635=_0x953c('0x2b');return db[_0x953c('0x2c')]['destroy']({'where':{'type':_0x5d0635,'resourceId':_0x2ec2cd['id']}})[_0x953c('0x29')](function(){return _0x38cb99;});})['then'](function(){_0x5df858['status'](0xcc)[_0x953c('0x2d')]();});}};}function handleEntityNotFound(_0x5014dc,_0x4032ac){return function(_0x3d91b0){if(!_0x3d91b0){_0x5014dc[_0x953c('0x1c')](0x194);}return _0x3d91b0;};}function handleError(_0x1e5d9a,_0x3ae41d){_0x3ae41d=_0x3ae41d||0x1f4;return function(_0x229b2e){logger[_0x953c('0x2e')](_0x229b2e[_0x953c('0x2f')]);if(_0x229b2e[_0x953c('0x30')]){delete _0x229b2e['name'];}_0x1e5d9a[_0x953c('0x1d')](_0x3ae41d)[_0x953c('0x31')](_0x229b2e);};}exports[_0x953c('0x32')]=function(_0x1014a7,_0x432f98){var _0x3779e7={},_0x198d50={},_0x494bf5={'count':0x0,'rows':[]};return db[_0x953c('0x33')][_0x953c('0x34')]()[_0x953c('0x29')](function(_0x4a1217){_0x198d50[_0x953c('0x35')]=_['keys'](_0x4a1217);_0x198d50['query']=_['keys'](_0x1014a7[_0x953c('0x36')]);_0x198d50['filters']=_[_0x953c('0x37')](_0x198d50['model'],_0x198d50[_0x953c('0x36')]);_0x3779e7[_0x953c('0x38')]=_[_0x953c('0x37')](_0x198d50['model'],qs[_0x953c('0x39')](_0x1014a7[_0x953c('0x36')][_0x953c('0x39')]));_0x3779e7[_0x953c('0x38')]=_0x3779e7['attributes'][_0x953c('0x3a')]?_0x3779e7[_0x953c('0x38')]:_0x198d50[_0x953c('0x35')];if(!_0x1014a7[_0x953c('0x36')]['hasOwnProperty']('nolimit')){_0x3779e7['limit']=qs[_0x953c('0x1f')](_0x1014a7[_0x953c('0x36')]['limit']);_0x3779e7[_0x953c('0x22')]=qs[_0x953c('0x22')](_0x1014a7['query']['offset']);}_0x3779e7[_0x953c('0x3b')]=qs[_0x953c('0x3c')](_0x1014a7[_0x953c('0x36')][_0x953c('0x3c')]);_0x3779e7['where']=qs[_0x953c('0x3d')](_[_0x953c('0x3e')](_0x1014a7['query'],_0x198d50['filters']),_0x4a1217);if(_0x1014a7[_0x953c('0x36')][_0x953c('0x3f')]){_0x3779e7['where']=_[_0x953c('0x40')](_0x3779e7['where'],{'$or':_[_0x953c('0x41')](_0x3779e7[_0x953c('0x38')],function(_0x46b023){var _0x89f11c={};_0x89f11c[_0x46b023]={'$like':'%'+_0x1014a7[_0x953c('0x36')][_0x953c('0x3f')]+'%'};return _0x89f11c;})});}_0x3779e7=_[_0x953c('0x40')]({},_0x3779e7,_0x1014a7[_0x953c('0x42')]);var _0x5725d6={'where':_0x3779e7[_0x953c('0x43')]};return db[_0x953c('0x33')][_0x953c('0x21')](_0x5725d6)[_0x953c('0x29')](function(_0x1ef4b7){_0x494bf5[_0x953c('0x21')]=_0x1ef4b7;if(_0x1014a7[_0x953c('0x36')][_0x953c('0x44')]){_0x3779e7['include']=[{'all':!![]}];}return db[_0x953c('0x33')][_0x953c('0x45')](_0x3779e7);})['then'](function(_0x29831b){_0x494bf5[_0x953c('0x46')]=_0x29831b;return _0x494bf5;})[_0x953c('0x29')](respondWithFilteredResult(_0x432f98,_0x3779e7))[_0x953c('0x47')](handleError(_0x432f98,null));})['catch'](handleError(_0x432f98,null));};exports[_0x953c('0x48')]=function(_0x51c492,_0x14d9f3){var _0x2ddde2={'raw':![],'where':{'id':_0x51c492[_0x953c('0x49')]['id']}},_0x1701e5={};_0x1701e5[_0x953c('0x35')]=_[_0x953c('0x4a')](db[_0x953c('0x33')][_0x953c('0x4b')]);_0x1701e5[_0x953c('0x36')]=_['keys'](_0x51c492['query']);_0x1701e5[_0x953c('0x3d')]=_[_0x953c('0x37')](_0x1701e5[_0x953c('0x35')],_0x1701e5['query']);_0x2ddde2[_0x953c('0x38')]=_[_0x953c('0x37')](_0x1701e5[_0x953c('0x35')],qs[_0x953c('0x39')](_0x51c492[_0x953c('0x36')][_0x953c('0x39')]));_0x2ddde2[_0x953c('0x38')]=_0x2ddde2[_0x953c('0x38')][_0x953c('0x3a')]?_0x2ddde2['attributes']:_0x1701e5[_0x953c('0x35')];if(_0x51c492['query']['includeAll']){_0x2ddde2[_0x953c('0x4c')]=[{'all':!![]}];}_0x2ddde2=_['merge']({},_0x2ddde2,_0x51c492[_0x953c('0x42')]);return db[_0x953c('0x33')]['find'](_0x2ddde2)[_0x953c('0x29')](handleEntityNotFound(_0x14d9f3,null))[_0x953c('0x29')](respondWithResult(_0x14d9f3,null))[_0x953c('0x47')](handleError(_0x14d9f3,null));};exports[_0x953c('0x4d')]=function(_0x1e77a7,_0x30a323){return db[_0x953c('0x33')][_0x953c('0x4d')](_0x1e77a7[_0x953c('0x4e')],{})[_0x953c('0x29')](function(_0xf49103){var _0x10193=_0x1e77a7[_0x953c('0x4f')][_0x953c('0x2a')]({'plain':!![]});if(!_0x10193)throw new Error(_0x953c('0x50'));if(_0x10193[_0x953c('0x51')]===_0x953c('0x4f')){var _0x440e52=_0xf49103['get']({'plain':!![]});var _0x45616b=_0x953c('0x2b');return db[_0x953c('0x52')][_0x953c('0x53')]({'where':{'name':_0x45616b,'userProfileId':_0x10193['userProfileId']},'raw':!![]})[_0x953c('0x29')](function(_0x2b7184){if(_0x2b7184&&_0x2b7184[_0x953c('0x54')]===0x0){return db[_0x953c('0x2c')][_0x953c('0x4d')]({'name':_0x440e52['name'],'resourceId':_0x440e52['id'],'type':_0x2b7184[_0x953c('0x30')],'sectionId':_0x2b7184['id']},{})[_0x953c('0x29')](function(){return _0xf49103;});}else{return _0xf49103;}})[_0x953c('0x47')](function(_0xf814a6){logger[_0x953c('0x2e')](_0x953c('0x55'),_0xf814a6);throw _0xf814a6;});}return _0xf49103;})[_0x953c('0x29')](respondWithResult(_0x30a323,0xc9))['catch'](handleError(_0x30a323,null));};exports[_0x953c('0x27')]=function(_0x412543,_0x52babe){if(_0x412543[_0x953c('0x4e')]['id']){delete _0x412543[_0x953c('0x4e')]['id'];}return db['CmCompany'][_0x953c('0x53')]({'where':{'id':_0x412543[_0x953c('0x49')]['id']}})[_0x953c('0x29')](handleEntityNotFound(_0x52babe,null))['then'](saveUpdates(_0x412543[_0x953c('0x4e')],null))['then'](respondWithResult(_0x52babe,null))[_0x953c('0x47')](handleError(_0x52babe,null));};exports[_0x953c('0x28')]=function(_0x9b1f14,_0xe49593){return db[_0x953c('0x33')][_0x953c('0x53')]({'where':{'id':_0x9b1f14[_0x953c('0x49')]['id']}})['then'](handleEntityNotFound(_0xe49593,null))[_0x953c('0x29')](removeEntity(_0xe49593,null))['catch'](handleError(_0xe49593,null));};exports['describe']=function(_0xbfed5,_0xd30115){return db[_0x953c('0x33')]['describe']()[_0x953c('0x29')](respondWithResult(_0xd30115,null))[_0x953c('0x47')](handleError(_0xd30115,null));};exports['addContacts']=function(_0xe9fc5d,_0x3fa832,_0x24b49e){return db[_0x953c('0x56')][_0x953c('0x53')]({'where':{'id':_0xe9fc5d[_0x953c('0x49')]['id']}})[_0x953c('0x29')](handleEntityNotFound(_0x3fa832,null))[_0x953c('0x29')](function(_0x5a713c){if(_0x5a713c){return _0x5a713c[_0x953c('0x57')](_0xe9fc5d[_0x953c('0x4e')][_0x953c('0x58')],_[_0x953c('0x59')](_0xe9fc5d['body'],[_0x953c('0x58'),'id'])||{});}})[_0x953c('0x29')](respondWithResult(_0x3fa832,null))[_0x953c('0x47')](handleError(_0x3fa832,null));};exports[_0x953c('0x5a')]=function(_0x451f1c,_0x5f2227,_0xc5cd5f){var _0x489f2c={};var _0x2ee2a5={};var _0x2454b3;var _0x2b4d10;return db['CmCompany'][_0x953c('0x5b')]({'where':{'id':_0x451f1c[_0x953c('0x49')]['id']}})[_0x953c('0x29')](handleEntityNotFound(_0x5f2227,null))[_0x953c('0x29')](function(_0x446c2a){if(_0x446c2a){_0x2454b3=_0x446c2a;_0x2ee2a5[_0x953c('0x35')]=_[_0x953c('0x4a')](db[_0x953c('0x56')][_0x953c('0x4b')]);_0x2ee2a5[_0x953c('0x36')]=_['keys'](_0x451f1c[_0x953c('0x36')]);_0x2ee2a5[_0x953c('0x3d')]=_[_0x953c('0x37')](_0x2ee2a5[_0x953c('0x35')],_0x2ee2a5['query']);_0x489f2c[_0x953c('0x38')]=_['intersection'](_0x2ee2a5[_0x953c('0x35')],qs[_0x953c('0x39')](_0x451f1c[_0x953c('0x36')][_0x953c('0x39')]));_0x489f2c[_0x953c('0x38')]=_0x489f2c[_0x953c('0x38')][_0x953c('0x3a')]?_0x489f2c[_0x953c('0x38')]:_0x2ee2a5[_0x953c('0x35')];_0x489f2c[_0x953c('0x3b')]=qs[_0x953c('0x3c')](_0x451f1c[_0x953c('0x36')][_0x953c('0x3c')]);_0x489f2c['where']=qs[_0x953c('0x3d')](_[_0x953c('0x3e')](_0x451f1c['query'],_0x2ee2a5[_0x953c('0x3d')]));if(_0x451f1c[_0x953c('0x36')][_0x953c('0x3f')]){_0x489f2c['where']=_[_0x953c('0x40')](_0x489f2c[_0x953c('0x43')],{'$or':_[_0x953c('0x41')](_0x489f2c[_0x953c('0x38')],function(_0x27e4d4){var _0x5c0e62={};_0x5c0e62[_0x27e4d4]={'$like':'%'+_0x451f1c[_0x953c('0x36')]['filter']+'%'};return _0x5c0e62;})});}_0x489f2c=_[_0x953c('0x40')]({},_0x489f2c,_0x451f1c[_0x953c('0x42')]);return _0x2454b3[_0x953c('0x5a')](_0x489f2c);}})[_0x953c('0x29')](function(_0x534fb2){if(_0x534fb2){_0x2b4d10=_0x534fb2[_0x953c('0x3a')];if(!_0x451f1c[_0x953c('0x36')][_0x953c('0x5c')](_0x953c('0x5d'))){_0x489f2c['limit']=qs[_0x953c('0x1f')](_0x451f1c[_0x953c('0x36')]['limit']);_0x489f2c[_0x953c('0x22')]=qs[_0x953c('0x22')](_0x451f1c[_0x953c('0x36')][_0x953c('0x22')]);}return _0x2454b3[_0x953c('0x5a')](_0x489f2c);}})[_0x953c('0x29')](function(_0x458b5c){if(_0x458b5c){return _0x458b5c?{'count':_0x2b4d10,'rows':_0x458b5c}:null;}})['then'](respondWithResult(_0x5f2227,null))[_0x953c('0x47')](handleError(_0x5f2227,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 49b358e..85f05ab 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 _0xd577=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','./cmCompany.attributes','CmCompany','cm_companies'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0xd577,0x10e));var _0x7d57=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0xd577[_0x459423];return _0x42ed14;};'use strict';var _=require(_0x7d57('0x0'));var util=require(_0x7d57('0x1'));var logger=require(_0x7d57('0x2'))(_0x7d57('0x3'));var moment=require(_0x7d57('0x4'));var BPromise=require(_0x7d57('0x5'));var rp=require(_0x7d57('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7d57('0x7'));module['exports']=function(_0x7e9466,_0x3c9ed1){return _0x7e9466['define'](_0x7d57('0x8'),attributes,{'tableName':_0x7d57('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x35ac=['path','rimraf','../../config/environment','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5408a8,_0xf2bb55){var _0x54667e=function(_0x5cc0bf){while(--_0x5cc0bf){_0x5408a8['push'](_0x5408a8['shift']());}};_0x54667e(++_0xf2bb55);}(_0x35ac,0x1db));var _0xc35a=function(_0x2aeec3,_0xc03231){_0x2aeec3=_0x2aeec3-0x0;var _0x428175=_0x35ac[_0x2aeec3];return _0x428175;};'use strict';var _=require(_0xc35a('0x0'));var util=require(_0xc35a('0x1'));var logger=require(_0xc35a('0x2'))(_0xc35a('0x3'));var moment=require('moment');var BPromise=require(_0xc35a('0x4'));var rp=require(_0xc35a('0x5'));var fs=require('fs');var path=require(_0xc35a('0x6'));var rimraf=require(_0xc35a('0x7'));var config=require(_0xc35a('0x8'));var attributes=require('./cmCompany.attributes');module[_0xc35a('0x9')]=function(_0x13e22b,_0x9f322){return _0x13e22b[_0xc35a('0xa')](_0xc35a('0xb'),attributes,{'tableName':_0xc35a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 960a4f6..9c03a2d 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 _0x9eb3=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash'];(function(_0x323e44,_0xc10367){var _0x4443e5=function(_0x1ec1c6){while(--_0x1ec1c6){_0x323e44['push'](_0x323e44['shift']());}};_0x4443e5(++_0xc10367);}(_0x9eb3,0x6d));var _0x39eb=function(_0x59fdb6,_0x44f15c){_0x59fdb6=_0x59fdb6-0x0;var _0x56f55a=_0x9eb3[_0x59fdb6];return _0x56f55a;};'use strict';var _=require(_0x39eb('0x0'));var util=require('util');var moment=require(_0x39eb('0x1'));var BPromise=require('bluebird');var rs=require(_0x39eb('0x2'));var fs=require('fs');var Redis=require(_0x39eb('0x3'));var db=require(_0x39eb('0x4'))['db'];var utils=require(_0x39eb('0x5'));var logger=require(_0x39eb('0x6'))(_0x39eb('0x7'));var config=require(_0x39eb('0x8'));var jayson=require(_0x39eb('0x9'));var client=jayson[_0x39eb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ece04,_0x30200d,_0x5ae502){return new BPromise(function(_0x45388c,_0x3e4456){return client[_0x39eb('0xb')](_0x4ece04,_0x5ae502)[_0x39eb('0xc')](function(_0x39c12a){logger['info'](_0x39eb('0xd'),_0x30200d,_0x39eb('0xe'));logger[_0x39eb('0xf')](_0x39eb('0x10'),_0x30200d,_0x39eb('0xe'),JSON[_0x39eb('0x11')](_0x39c12a));if(_0x39c12a[_0x39eb('0x12')]){if(_0x39c12a['error']['code']===0x1f4){logger[_0x39eb('0x12')](_0x39eb('0xd'),_0x30200d,_0x39c12a[_0x39eb('0x12')]['message']);return _0x3e4456(_0x39c12a[_0x39eb('0x12')]['message']);}logger[_0x39eb('0x12')](_0x39eb('0xd'),_0x30200d,_0x39c12a['error']['message']);return _0x45388c(_0x39c12a[_0x39eb('0x12')][_0x39eb('0x13')]);}else{logger[_0x39eb('0x14')]('CmCompany,\x20%s,\x20%s',_0x30200d,_0x39eb('0xe'));_0x45388c(_0x39c12a['result'][_0x39eb('0x13')]);}})[_0x39eb('0x15')](function(_0x477eb8){logger[_0x39eb('0x12')](_0x39eb('0xd'),_0x30200d,_0x477eb8);_0x3e4456(_0x477eb8);});});} \ No newline at end of file +var _0x8f2d=['then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x306290,_0x45508e){var _0x148fb7=function(_0x33aab5){while(--_0x33aab5){_0x306290['push'](_0x306290['shift']());}};_0x148fb7(++_0x45508e);}(_0x8f2d,0xfc));var _0xd8f2=function(_0x5e3f74,_0xb50e67){_0x5e3f74=_0x5e3f74-0x0;var _0x342f03=_0x8f2d[_0x5e3f74];return _0x342f03;};'use strict';var _=require('lodash');var util=require(_0xd8f2('0x0'));var moment=require(_0xd8f2('0x1'));var BPromise=require(_0xd8f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8f2('0x3'))['db'];var utils=require(_0xd8f2('0x4'));var logger=require(_0xd8f2('0x5'))(_0xd8f2('0x6'));var config=require(_0xd8f2('0x7'));var jayson=require(_0xd8f2('0x8'));var client=jayson[_0xd8f2('0x9')][_0xd8f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21047d,_0x588fa8,_0x441052){return new BPromise(function(_0x1e60ed,_0x4bda41){return client[_0xd8f2('0xb')](_0x21047d,_0x441052)[_0xd8f2('0xc')](function(_0x3aa361){logger[_0xd8f2('0xd')](_0xd8f2('0xe'),_0x588fa8,'request\x20sent');logger[_0xd8f2('0xf')](_0xd8f2('0x10'),_0x588fa8,_0xd8f2('0x11'),JSON[_0xd8f2('0x12')](_0x3aa361));if(_0x3aa361[_0xd8f2('0x13')]){if(_0x3aa361[_0xd8f2('0x13')][_0xd8f2('0x14')]===0x1f4){logger[_0xd8f2('0x13')]('CmCompany,\x20%s,\x20%s',_0x588fa8,_0x3aa361['error'][_0xd8f2('0x15')]);return _0x4bda41(_0x3aa361['error'][_0xd8f2('0x15')]);}logger[_0xd8f2('0x13')]('CmCompany,\x20%s,\x20%s',_0x588fa8,_0x3aa361[_0xd8f2('0x13')]['message']);return _0x1e60ed(_0x3aa361[_0xd8f2('0x13')][_0xd8f2('0x15')]);}else{logger[_0xd8f2('0xd')](_0xd8f2('0xe'),_0x588fa8,'request\x20sent');_0x1e60ed(_0x3aa361[_0xd8f2('0x16')][_0xd8f2('0x15')]);}})[_0xd8f2('0x17')](function(_0x25c245){logger[_0xd8f2('0x13')]('CmCompany,\x20%s,\x20%s',_0x588fa8,_0x25c245);_0x4bda41(_0x25c245);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 2873076..42b9751 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 _0x11b2=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','getContacts','post','create','/:id/contacts','addContacts','update','delete'];(function(_0x84dbc9,_0x804160){var _0x365eea=function(_0x5c11c6){while(--_0x5c11c6){_0x84dbc9['push'](_0x84dbc9['shift']());}};_0x365eea(++_0x804160);}(_0x11b2,0xf1));var _0x211b=function(_0x14a08a,_0x1cb9c5){_0x14a08a=_0x14a08a-0x0;var _0x26519d=_0x11b2[_0x14a08a];return _0x26519d;};'use strict';var multer=require(_0x211b('0x0'));var util=require(_0x211b('0x1'));var path=require(_0x211b('0x2'));var timeout=require(_0x211b('0x3'));var express=require(_0x211b('0x4'));var router=express[_0x211b('0x5')]();var fs_extra=require(_0x211b('0x6'));var auth=require(_0x211b('0x7'));var interaction=require(_0x211b('0x8'));var config=require('../../config/environment');var controller=require(_0x211b('0x9'));router[_0x211b('0xa')]('/',auth[_0x211b('0xb')](),controller['index']);router[_0x211b('0xa')](_0x211b('0xc'),auth['isAuthenticated'](),controller[_0x211b('0xd')]);router[_0x211b('0xa')](_0x211b('0xe'),auth[_0x211b('0xb')](),controller[_0x211b('0xf')]);router[_0x211b('0xa')]('/:id/contacts',auth[_0x211b('0xb')](),controller[_0x211b('0x10')]);router[_0x211b('0x11')]('/',auth[_0x211b('0xb')](),controller[_0x211b('0x12')]);router['post'](_0x211b('0x13'),auth[_0x211b('0xb')](),controller[_0x211b('0x14')]);router['put'](_0x211b('0xe'),auth['isAuthenticated'](),controller[_0x211b('0x15')]);router[_0x211b('0x16')]('/:id',auth[_0x211b('0xb')](),controller[_0x211b('0x17')]);module['exports']=router; \ No newline at end of file +var _0x797a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','update','delete','destroy','exports','util','express','Router'];(function(_0x7d559d,_0xba51a){var _0x101fc4=function(_0x439863){while(--_0x439863){_0x7d559d['push'](_0x7d559d['shift']());}};_0x101fc4(++_0xba51a);}(_0x797a,0xe4));var _0xa797=function(_0x122a7e,_0x3e937a){_0x122a7e=_0x122a7e-0x0;var _0x588dce=_0x797a[_0x122a7e];return _0x588dce;};'use strict';var multer=require('multer');var util=require(_0xa797('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa797('0x1'));var router=express[_0xa797('0x2')]();var fs_extra=require(_0xa797('0x3'));var auth=require(_0xa797('0x4'));var interaction=require(_0xa797('0x5'));var config=require(_0xa797('0x6'));var controller=require(_0xa797('0x7'));router[_0xa797('0x8')]('/',auth[_0xa797('0x9')](),controller[_0xa797('0xa')]);router[_0xa797('0x8')]('/describe',auth[_0xa797('0x9')](),controller[_0xa797('0xb')]);router[_0xa797('0x8')](_0xa797('0xc'),auth['isAuthenticated'](),controller[_0xa797('0xd')]);router['get'](_0xa797('0xe'),auth[_0xa797('0x9')](),controller[_0xa797('0xf')]);router[_0xa797('0x10')]('/',auth[_0xa797('0x9')](),controller['create']);router[_0xa797('0x10')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router['put']('/:id',auth[_0xa797('0x9')](),controller[_0xa797('0x11')]);router[_0xa797('0x12')]('/:id',auth[_0xa797('0x9')](),controller[_0xa797('0x13')]);module[_0xa797('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 6dddfb3..eb582ea 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 _0x0b0e=['exports','STRING','TEXT','INTEGER','DATE','NOW','lodash'];(function(_0xcc929c,_0x34f63b){var _0xf9ffed=function(_0x2da17a){while(--_0x2da17a){_0xcc929c['push'](_0xcc929c['shift']());}};_0xf9ffed(++_0x34f63b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x0b0e[_0x1af05b];return _0x5be7cc;};'use strict';var _=require(_0xe0b0('0x0'));var Sequelize=require('sequelize');module[_0xe0b0('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xe0b0('0x2')]},'street':{'type':Sequelize[_0xe0b0('0x2')]},'postalCode':{'type':Sequelize[_0xe0b0('0x2')]},'city':{'type':Sequelize[_0xe0b0('0x2')]},'country':{'type':Sequelize[_0xe0b0('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe0b0('0x2')]},'description':{'type':Sequelize[_0xe0b0('0x3')]},'phone':{'type':Sequelize[_0xe0b0('0x2')]},'mobile':{'type':Sequelize[_0xe0b0('0x2')]},'fax':{'type':Sequelize[_0xe0b0('0x2')]},'email':{'type':Sequelize[_0xe0b0('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xe0b0('0x2')]},'twitter':{'type':Sequelize[_0xe0b0('0x2')]},'skype':{'type':Sequelize[_0xe0b0('0x2')]},'teams':{'type':Sequelize[_0xe0b0('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe0b0('0x2')]},'wechat':{'type':Sequelize[_0xe0b0('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xe0b0('0x4')]},'priority':{'type':Sequelize[_0xe0b0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':Sequelize[_0xe0b0('0x6')]},'dialTimezone':{'type':Sequelize[_0xe0b0('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb7e7=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x1196b0,_0x36c47a){var _0x111c52=function(_0x5604c7){while(--_0x5604c7){_0x1196b0['push'](_0x1196b0['shift']());}};_0x111c52(++_0x36c47a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb7e7[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x7b7e('0x0'));var Sequelize=require('sequelize');module[_0x7b7e('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7b7e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x7b7e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7b7e('0x2')]},'dateOfBirth':{'type':Sequelize[_0x7b7e('0x2')]},'description':{'type':Sequelize[_0x7b7e('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x7b7e('0x2')]},'email':{'type':Sequelize[_0x7b7e('0x2')]},'url':{'type':Sequelize[_0x7b7e('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x7b7e('0x2')]},'twitter':{'type':Sequelize[_0x7b7e('0x2')]},'skype':{'type':Sequelize[_0x7b7e('0x2')]},'teams':{'type':Sequelize[_0x7b7e('0x2')]},'viber':{'type':Sequelize[_0x7b7e('0x2')]},'line':{'type':Sequelize[_0x7b7e('0x2')]},'wechat':{'type':Sequelize[_0x7b7e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7b7e('0x4')]},'priority':{'type':Sequelize[_0x7b7e('0x4')](0x2)[_0x7b7e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7b7e('0x6')],'defaultValue':Sequelize[_0x7b7e('0x7')]},'dialTimezone':{'type':Sequelize[_0x7b7e('0x2')]},'utcOffset':{'type':Sequelize[_0x7b7e('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7518043..e77c9ac 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 _0xfa6c=['fork','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','findAndCountAll','startCase','chat','Account','closed','closedAt','thirdDisposition','key','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','threadId','Owner','sortBy','reverse','slice','moment','bluebird','util','lodash','papaparse','ioredis','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','json','undefined','limit','count','offset','then','destroy','status','end','error','stack','name','send','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','fieldType','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','expr','search','parseSearch','conditions','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','and','uc.UserId\x20=\x20?','dateOfBirth','buildExpression','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','group','QueryTypes','clone','c.id','DESC','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','find','params','tags','columnName','displayName','alias','custom','type','values','findAll','body','from','get','mergeWith','isArray','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','update','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','dialTimezone','timezones','utcOffset','bulkCreate','each','duplicates','$or','spread','show','$and','cf_%d','omit','pickBy','format','table','setFields','id\x20=\x20?','toParam','text','phone','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','includeAll','include','getHopperHistories','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','createReadStream','path','parse','import','binding','child_process'];(function(_0x1c9b67,_0x54d3c5){var _0x2ddc8a=function(_0x1b0c84){while(--_0x1b0c84){_0x1c9b67['push'](_0x1c9b67['shift']());}};_0x2ddc8a(++_0x54d3c5);}(_0xfa6c,0x152));var _0xcfa6=function(_0x193672,_0x14b484){_0x193672=_0x193672-0x0;var _0x401e55=_0xfa6c[_0x193672];return _0x401e55;};'use strict';var moment=require(_0xcfa6('0x0'));var BPromise=require(_0xcfa6('0x1'));var util=require(_0xcfa6('0x2'));var path=require('path');var fs=require('fs');var _=require(_0xcfa6('0x3'));var squel=require('squel');var Papa=require(_0xcfa6('0x4'));var Redis=require(_0xcfa6('0x5'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0xcfa6('0x6'))('api');var config=require(_0xcfa6('0x7'));var shared=require(_0xcfa6('0x8'));var db=require(_0xcfa6('0x9'))['db'];config[_0xcfa6('0xa')]=_[_0xcfa6('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcfa6('0xc'))(new Redis(config['redis']));require(_0xcfa6('0xd'))[_0xcfa6('0xe')](socket);function respondWithResult(_0x437446,_0x4a3efd){_0x4a3efd=_0x4a3efd||0xc8;return function(_0x559f62){if(_0x559f62){return _0x437446['status'](_0x4a3efd)[_0xcfa6('0xf')](_0x559f62);}};}function respondWithFilteredResult(_0x267ccc,_0x1d7a7c){return function(_0x5d9529){if(_0x5d9529){var _0x10cb0d=typeof _0x1d7a7c['offset']===_0xcfa6('0x10')&&typeof _0x1d7a7c[_0xcfa6('0x11')]===_0xcfa6('0x10');var _0x101db=_0x5d9529[_0xcfa6('0x12')];var _0x5e59e3=_0x10cb0d?0x0:_0x1d7a7c[_0xcfa6('0x13')];var _0x27b9a1=_0x10cb0d?_0x5d9529['count']:_0x1d7a7c[_0xcfa6('0x13')]+_0x1d7a7c[_0xcfa6('0x11')];var _0x39400a;if(_0x27b9a1>=_0x101db){_0x27b9a1=_0x101db;_0x39400a=0xc8;}else{_0x39400a=0xce;}_0x267ccc['status'](_0x39400a);return _0x267ccc['set']('Content-Range',_0x5e59e3+'-'+_0x27b9a1+'/'+_0x101db)['json'](_0x5d9529);}return null;};}function saveUpdates(_0xb6464b){return function(_0xe9aaba){if(_0xe9aaba){return _0xe9aaba['update'](_0xb6464b)[_0xcfa6('0x14')](function(_0x7b97c2){return _0x7b97c2;});}return null;};}function removeEntity(_0x3e114f){return function(_0x45abec){if(_0x45abec){return _0x45abec[_0xcfa6('0x15')]()[_0xcfa6('0x14')](function(){_0x3e114f[_0xcfa6('0x16')](0xcc)[_0xcfa6('0x17')]();});}};}function handleEntityNotFound(_0x264ba6){return function(_0x498c19){if(!_0x498c19){_0x264ba6['sendStatus'](0x194);}return _0x498c19;};}function handleError(_0x1dcb97,_0x4a90d5){_0x4a90d5=_0x4a90d5||0x1f4;return function(_0x3e8382){logger[_0xcfa6('0x18')](_0x3e8382[_0xcfa6('0x19')]);if(_0x3e8382[_0xcfa6('0x1a')]){delete _0x3e8382[_0xcfa6('0x1a')];}_0x1dcb97[_0xcfa6('0x16')](_0x4a90d5)[_0xcfa6('0x1b')](_0x3e8382);};}exports['index']=function(_0x5669ad,_0x3a273c){var _0x1643b3={},_0x30ce72={},_0x1b5f2d={'count':0x0,'rows':[]};return db[_0xcfa6('0x1c')][_0xcfa6('0x1d')]()[_0xcfa6('0x14')](function(_0x1cfa0c){var _0x4787ba=[];for(var _0x341b6d=0x0;_0x341b6d0x1){_0x2ad0f7['or'](_0xcfa6('0x58'),qs[_0xcfa6('0x59')](_0x35fa59),null);}else{if(qs[_0xcfa6('0x5a')](_0x35fa59)){_0x2ad0f7['or']('c.id\x20LIKE\x20?',_0x35fa59+'%');_0x2ad0f7['or']('c.phone\x20LIKE\x20?',_0x35fa59+'%');_0x2ad0f7['or']('c.mobile\x20LIKE\x20?',_0x35fa59+'%');_0x2ad0f7['or'](_0xcfa6('0x5b'),_0x35fa59+'%');}else if(qs[_0xcfa6('0x5c')](_0x35fa59)){_0x2ad0f7['or'](_0xcfa6('0x5d'),_0x35fa59+'%');}else{_0x2ad0f7['or']('c.firstName\x20LIKE\x20?','%'+_0x35fa59+'%');_0x2ad0f7['or']('c.lastName\x20LIKE\x20?','%'+_0x35fa59+'%');_0x2ad0f7['or']('c.email\x20LIKE\x20?','%'+_0x35fa59+'%');}}}}_0x5664b2[_0xcfa6('0x32')](_0x2ad0f7);_0x5664b2[_0xcfa6('0x5e')]('c.id');var _0x2db085={'type':db['Sequelize'][_0xcfa6('0x5f')]['SELECT'],'raw':!![]};var _0x4cd892=_0x5664b2[_0xcfa6('0x60')]()[_0xcfa6('0x35')](_0xcfa6('0x61'));if(_0x1643b3['order']){_0x1643b3['order'][_0xcfa6('0x46')](function(_0x19361e){_0x5664b2['order']('c.'+_0x19361e[0x0],_0x19361e[0x1]===_0xcfa6('0x62')?![]:!![]);});}if(!_[_0xcfa6('0x51')](_0x241bc6)){_0x5664b2['having'](_0x374627);_0x4cd892[_0xcfa6('0x32')](_0xcfa6('0x63'),_0x241bc6);}BPromise[_0xcfa6('0x64')]()[_0xcfa6('0x14')](function(){if(!_0x1a0c83)return;if(_0x5669ad[_0xcfa6('0x65')][_0xcfa6('0x66')]!==_0xcfa6('0x67'))return;if(!_[_0xcfa6('0x68')](_0x1a0c83[_0xcfa6('0x41')],[_0xcfa6('0x35'),_0xcfa6('0x48')])){return _0x5669ad[_0xcfa6('0x65')][_0xcfa6('0x69')]({'attributes':['id'],'raw':!![]})['then'](function(_0x314a50){if(_['isEmpty'](_0x314a50)){_0x4cd892['where']('c.ListId\x20IS\x20NULL');_0x5664b2[_0xcfa6('0x32')](_0xcfa6('0x6a'));}else{_0x4cd892[_0xcfa6('0x32')]('c.ListId\x20IN\x20?',_[_0xcfa6('0x45')](_0x314a50,'id'));_0x5664b2['where'](_0xcfa6('0x53'),_[_0xcfa6('0x45')](_0x314a50,'id'));}});}})[_0xcfa6('0x14')](function(){if(_0x5669ad['user'][_0xcfa6('0x66')]===_0xcfa6('0x67')&&!_0x1a0c83&&!_0x5669ad[_0xcfa6('0x29')]['ListId'])return[];return db[_0xcfa6('0x6b')][_0xcfa6('0x29')](_0x4cd892[_0xcfa6('0x6c')](),_0x2db085);})[_0xcfa6('0x14')](function(_0x5240dd){_0x1b5f2d[_0xcfa6('0x12')]=_0x5240dd[_0xcfa6('0x1f')];if(_0x1b5f2d['count']===0x0)return[];return db[_0xcfa6('0x6b')][_0xcfa6('0x29')](_0xaceaaa[_0xcfa6('0x6c')](),_0x2db085)[_0xcfa6('0x14')](function(_0x45f58d){_0x27b0ec=_['keyBy'](_0x45f58d,'id');_0x2db085=_[_0xcfa6('0x6d')](_0x2db085,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5669ad[_0xcfa6('0x29')][_0xcfa6('0x2d')]){_0x1643b3[_0xcfa6('0x2b')][_0xcfa6('0x46')](function(_0x1c163f){_0x5664b2[_0xcfa6('0x35')]('c.'+_0x1c163f);});}else{_0x5664b2['field']('c.id');_0x5664b2[_0xcfa6('0x35')](_0xcfa6('0x6e'));_0x5664b2[_0xcfa6('0x35')](_0xcfa6('0x6f'));_0x5664b2[_0xcfa6('0x35')](_0xcfa6('0x70'));_0x5664b2[_0xcfa6('0x35')](_0xcfa6('0x71'));_0x5664b2[_0xcfa6('0x35')]('c.fax');_0x5664b2[_0xcfa6('0x35')](_0xcfa6('0x72'));_0x5664b2[_0xcfa6('0x35')](_0xcfa6('0x73'));_0x5664b2['field'](_0xcfa6('0x74'));_0x5664b2['field'](_0xcfa6('0x75'));_0x5664b2['field'](_0xcfa6('0x76'));_0x5664b2[_0xcfa6('0x35')](_0xcfa6('0x77'),_0xcfa6('0x78'));}if(_0x1643b3['limit'])_0x5664b2['limit'](_0x1643b3[_0xcfa6('0x11')]);if(_0x1643b3[_0xcfa6('0x13')])_0x5664b2[_0xcfa6('0x13')](_0x1643b3[_0xcfa6('0x13')]);return db['sequelize']['query'](_0x5664b2[_0xcfa6('0x6c')](),_0x2db085);});})[_0xcfa6('0x14')](function(_0x196a78){_0x196a78[_0xcfa6('0x46')](function(_0x2a410c){if(_0x2a410c[_0xcfa6('0x78')]){_0x2a410c[_0xcfa6('0x79')]=[];_0x2a410c['TagIds'][_0xcfa6('0x44')](',')[_0xcfa6('0x46')](function(_0x428a3b){_0x2a410c[_0xcfa6('0x79')]['push'](_0x27b0ec[_0x428a3b]);});}delete _0x2a410c[_0xcfa6('0x78')];});_0x1b5f2d[_0xcfa6('0x7a')]=_0x196a78;return _0x1b5f2d;})['then'](respondWithFilteredResult(_0x3a273c,_0x1643b3));})[_0xcfa6('0x7b')](handleError(_0x3a273c,null));};exports[_0xcfa6('0x15')]=function(_0x59db6a,_0x2869d9){return db[_0xcfa6('0x1c')][_0xcfa6('0x7c')]({'where':{'id':_0x59db6a[_0xcfa6('0x7d')]['id']}})['then'](handleEntityNotFound(_0x2869d9,null))['then'](removeEntity(_0x2869d9,null))['catch'](handleError(_0x2869d9,null));};exports[_0xcfa6('0x1d')]=function(_0x53c25c,_0x5c966e){return db[_0xcfa6('0x1c')][_0xcfa6('0x1d')]()[_0xcfa6('0x14')](function(_0x54054d){delete _0x54054d[_0xcfa6('0x7e')];for(var _0x2085c5=0x0;_0x2085c5=_0x28ce5c){_0x28390c=_0x28ce5c;_0xff40d0=0xc8;}else{_0xff40d0=0xce;}_0x1a3b61[_0x1c77('0x10')](_0xff40d0);return _0x1a3b61[_0x1c77('0x16')](_0x1c77('0x17'),_0x1969f0+'-'+_0x28390c+'/'+_0x28ce5c)[_0x1c77('0x11')](_0x2632ea);}return null;};}function saveUpdates(_0x4c80ef){return function(_0x294936){if(_0x294936){return _0x294936[_0x1c77('0x18')](_0x4c80ef)[_0x1c77('0x19')](function(_0x177a5a){return _0x177a5a;});}return null;};}function removeEntity(_0x53f08d){return function(_0x44d65d){if(_0x44d65d){return _0x44d65d[_0x1c77('0x1a')]()[_0x1c77('0x19')](function(){_0x53f08d[_0x1c77('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x109fb2){return function(_0x25556c){if(!_0x25556c){_0x109fb2[_0x1c77('0x1b')](0x194);}return _0x25556c;};}function handleError(_0x5ac093,_0x56c852){_0x56c852=_0x56c852||0x1f4;return function(_0xfe30c9){logger[_0x1c77('0x1c')](_0xfe30c9[_0x1c77('0x1d')]);if(_0xfe30c9[_0x1c77('0x1e')]){delete _0xfe30c9[_0x1c77('0x1e')];}_0x5ac093[_0x1c77('0x10')](_0x56c852)[_0x1c77('0x1f')](_0xfe30c9);};}exports[_0x1c77('0x20')]=function(_0x2a1672,_0x426b38){var _0x471a69={},_0x485217={},_0xdc8b0f={'count':0x0,'rows':[]};return db['CmContact'][_0x1c77('0x21')]()[_0x1c77('0x19')](function(_0x2781cd){var _0x184a51=[];for(var _0x524b23=0x0;_0x524b230x1){_0x130adf['or'](_0x1c77('0x5d'),qs[_0x1c77('0x5e')](_0x5d2b90),null);}else{if(qs[_0x1c77('0x5f')](_0x5d2b90)){_0x130adf['or'](_0x1c77('0x60'),_0x5d2b90+'%');_0x130adf['or'](_0x1c77('0x61'),_0x5d2b90+'%');_0x130adf['or'](_0x1c77('0x62'),_0x5d2b90+'%');_0x130adf['or'](_0x1c77('0x63'),_0x5d2b90+'%');}else if(qs[_0x1c77('0x64')](_0x5d2b90)){_0x130adf['or'](_0x1c77('0x65'),_0x5d2b90+'%');}else{_0x130adf['or']('c.firstName\x20LIKE\x20?','%'+_0x5d2b90+'%');_0x130adf['or'](_0x1c77('0x66'),'%'+_0x5d2b90+'%');_0x130adf['or']('c.email\x20LIKE\x20?','%'+_0x5d2b90+'%');}}}}_0x350eca[_0x1c77('0x33')](_0x130adf);_0x350eca['group'](_0x1c77('0x67'));var _0x5d112a={'type':db['Sequelize']['QueryTypes'][_0x1c77('0x68')],'raw':!![]};var _0xcd6754=_0x350eca[_0x1c77('0x69')]()[_0x1c77('0x34')](_0x1c77('0x67'));if(_0x471a69[_0x1c77('0x31')]){_0x471a69['order'][_0x1c77('0x46')](function(_0x46edd4){_0x350eca[_0x1c77('0x31')]('c.'+_0x46edd4[0x0],_0x46edd4[0x1]===_0x1c77('0x6a')?![]:!![]);});}if(!_[_0x1c77('0x6b')](_0x17d5bf)){_0x350eca[_0x1c77('0x6c')](_0x581ac7);_0xcd6754[_0x1c77('0x33')]('t.id\x20IN\x20?',_0x17d5bf);}BPromise[_0x1c77('0x6d')]()['then'](function(){if(!_0xb40e64)return;if(_0x2a1672[_0x1c77('0x6e')][_0x1c77('0x6f')]!=='agent')return;if(!_[_0x1c77('0x70')](_0xb40e64[_0x1c77('0x43')],[_0x1c77('0x34'),_0x1c77('0x71')])){return _0x2a1672[_0x1c77('0x6e')]['getLists']({'attributes':['id'],'raw':!![]})['then'](function(_0x5b0286){if(_[_0x1c77('0x6b')](_0x5b0286)){_0xcd6754[_0x1c77('0x33')](_0x1c77('0x72'));_0x350eca[_0x1c77('0x33')](_0x1c77('0x72'));}else{_0xcd6754[_0x1c77('0x33')](_0x1c77('0x56'),_[_0x1c77('0x45')](_0x5b0286,'id'));_0x350eca['where']('c.ListId\x20IN\x20?',_[_0x1c77('0x45')](_0x5b0286,'id'));}});}})[_0x1c77('0x19')](function(){if(_0x2a1672['user'][_0x1c77('0x6f')]==='agent'&&!_0xb40e64&&!_0x2a1672['query']['ListId'])return[];return db[_0x1c77('0x73')][_0x1c77('0x2c')](_0xcd6754['toString'](),_0x5d112a);})[_0x1c77('0x19')](function(_0x33b57f){_0xdc8b0f[_0x1c77('0x15')]=_0x33b57f[_0x1c77('0x23')];if(_0xdc8b0f[_0x1c77('0x15')]===0x0)return[];return db[_0x1c77('0x73')][_0x1c77('0x2c')](_0x17a6b1[_0x1c77('0x74')](),_0x5d112a)[_0x1c77('0x19')](function(_0x1bcfde){_0x12378c=_[_0x1c77('0x75')](_0x1bcfde,'id');_0x5d112a=_[_0x1c77('0x76')](_0x5d112a,{'model':db[_0x1c77('0x77')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a1672['query'][_0x1c77('0x30')]){_0x471a69[_0x1c77('0x2f')]['forEach'](function(_0x412546){_0x350eca[_0x1c77('0x34')]('c.'+_0x412546);});}else{_0x350eca[_0x1c77('0x34')](_0x1c77('0x67'));_0x350eca['field'](_0x1c77('0x78'));_0x350eca[_0x1c77('0x34')](_0x1c77('0x79'));_0x350eca[_0x1c77('0x34')](_0x1c77('0x7a'));_0x350eca['field'](_0x1c77('0x7b'));_0x350eca[_0x1c77('0x34')](_0x1c77('0x7c'));_0x350eca[_0x1c77('0x34')]('c.email');_0x350eca['field'](_0x1c77('0x7d'));_0x350eca[_0x1c77('0x34')](_0x1c77('0x7e'));_0x350eca[_0x1c77('0x34')](_0x1c77('0x7f'));_0x350eca[_0x1c77('0x34')]('c.CompanyId');_0x350eca[_0x1c77('0x34')](_0x1c77('0x80'),_0x1c77('0x81'));}if(_0x471a69[_0x1c77('0x14')])_0x350eca[_0x1c77('0x14')](_0x471a69[_0x1c77('0x14')]);if(_0x471a69[_0x1c77('0x12')])_0x350eca['offset'](_0x471a69[_0x1c77('0x12')]);return db[_0x1c77('0x73')][_0x1c77('0x2c')](_0x350eca[_0x1c77('0x74')](),_0x5d112a);});})[_0x1c77('0x19')](function(_0x1062e0){_0x1062e0[_0x1c77('0x46')](function(_0x550d07){if(_0x550d07[_0x1c77('0x81')]){_0x550d07[_0x1c77('0x82')]=[];_0x550d07[_0x1c77('0x81')][_0x1c77('0x5c')](',')['forEach'](function(_0x36627a){_0x550d07[_0x1c77('0x82')][_0x1c77('0x26')](_0x12378c[_0x36627a]);});}delete _0x550d07[_0x1c77('0x81')];});_0xdc8b0f[_0x1c77('0x83')]=_0x1062e0;return _0xdc8b0f;})[_0x1c77('0x19')](respondWithFilteredResult(_0x426b38,_0x471a69));})['catch'](handleError(_0x426b38,null));};exports['destroy']=function(_0x54a9fb,_0x358ce5){return db['CmContact'][_0x1c77('0x84')]({'where':{'id':_0x54a9fb['params']['id']}})[_0x1c77('0x19')](handleEntityNotFound(_0x358ce5,null))[_0x1c77('0x19')](removeEntity(_0x358ce5,null))['catch'](handleError(_0x358ce5,null));};exports['describe']=function(_0x58ab38,_0x54d8b5){return db['CmContact'][_0x1c77('0x21')]()[_0x1c77('0x19')](function(_0x4b43bd){delete _0x4b43bd['tags'];for(var _0x510156=0x0;_0x510156{}\s\\|]/g,'-');_0x2a5018(null,util['format'](_0xe674('0x23'),path[_0xe674('0x24')](_0x3776af['originalname'],path[_0xe674('0x25')](_0x3776af[_0xe674('0x21')])),Date[_0xe674('0x26')](),path[_0xe674('0x25')](_0x3776af[_0xe674('0x21')])));}})});router[_0xe674('0x18')](_0xe674('0x27'),upload[_0xe674('0x28')](_0xe674('0x29')),controller[_0xe674('0x2a')]);var upload=multer({'storage':multer[_0xe674('0x2b')]({'destination':function(_0x23fc51,_0x3a2d9b,_0x2136ac){_0x2136ac(null,path['join'](config[_0xe674('0x1f')],_0xe674('0x20')));},'filename':function(_0x5a5b01,_0xea6c8c,_0x105f78){_0xea6c8c[_0xe674('0x21')]=_0xea6c8c[_0xe674('0x21')][_0xe674('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x105f78(null,util[_0xe674('0x2c')]('%s-%s%s',path[_0xe674('0x24')](_0xea6c8c['originalname'],path[_0xe674('0x25')](_0xea6c8c['originalname'])),Date['now'](),path['extname'](_0xea6c8c[_0xe674('0x21')])));}})});router[_0xe674('0x18')](_0xe674('0x2d'),upload[_0xe674('0x28')](_0xe674('0x29')),controller['upload']);router['post']('/upload/:id',auth[_0xe674('0xb')](),controller[_0xe674('0x2e')]);router[_0xe674('0x2f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xe674('0xd'),auth['isAuthenticated'](),controller[_0xe674('0x30')]);module['exports']=router; \ No newline at end of file +var _0x528c=['fs-extra','../../components/auth/service','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','bulkCreate','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','uploadCsv','join','/upload','file','/upload/:id','import','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x5b964b,_0xe2062a){var _0x2f187d=function(_0x167ff2){while(--_0x167ff2){_0x5b964b['push'](_0x5b964b['shift']());}};_0x2f187d(++_0xe2062a);}(_0x528c,0x14c));var _0xc528=function(_0x54592e,_0x51308a){_0x54592e=_0x54592e-0x0;var _0x25c9b0=_0x528c[_0x54592e];return _0x25c9b0;};'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('express');var router=express['Router']();var fs_extra=require(_0xc528('0x4'));var auth=require(_0xc528('0x5'));var interaction=require(_0xc528('0x6'));var config=require('../../config/environment');var controller=require(_0xc528('0x7'));router[_0xc528('0x8')]('/',auth[_0xc528('0x9')](),controller[_0xc528('0xa')]);router[_0xc528('0x8')](_0xc528('0xb'),auth[_0xc528('0x9')](),controller[_0xc528('0xc')]);router[_0xc528('0x8')](_0xc528('0xd'),auth['isAuthenticated'](),controller[_0xc528('0xe')]);router['get'](_0xc528('0xf'),auth[_0xc528('0x9')](),controller[_0xc528('0x10')]);router[_0xc528('0x8')](_0xc528('0x11'),auth[_0xc528('0x9')](),controller[_0xc528('0x12')]);router[_0xc528('0x8')](_0xc528('0x13'),auth['isAuthenticated'](),controller[_0xc528('0x14')]);router[_0xc528('0x8')](_0xc528('0x15'),auth[_0xc528('0x9')](),controller[_0xc528('0x16')]);router[_0xc528('0x8')](_0xc528('0x17'),auth['isAuthenticated'](),controller[_0xc528('0x18')]);router[_0xc528('0x8')](_0xc528('0x19'),auth['isAuthenticated'](),controller[_0xc528('0x1a')]);router[_0xc528('0x1b')](_0xc528('0x1c'),auth[_0xc528('0x9')](),controller[_0xc528('0x1d')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc528('0x1e')]);router[_0xc528('0x1b')]('/create_many',auth[_0xc528('0x9')](),controller[_0xc528('0x1f')]);router['post']('/:id/tags',auth[_0xc528('0x9')](),controller[_0xc528('0x20')]);var upload=multer({'storage':multer[_0xc528('0x21')]({'destination':function(_0x15f751,_0xe52fc7,_0x4eddd1){_0x4eddd1(null,path['join'](config[_0xc528('0x22')],_0xc528('0x23')));},'filename':function(_0x516de1,_0x5d76fb,_0x4aaad8){_0x5d76fb[_0xc528('0x24')]=_0x5d76fb[_0xc528('0x24')][_0xc528('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4aaad8(null,util[_0xc528('0x26')](_0xc528('0x27'),path[_0xc528('0x28')](_0x5d76fb[_0xc528('0x24')],path[_0xc528('0x29')](_0x5d76fb['originalname'])),Date[_0xc528('0x2a')](),path[_0xc528('0x29')](_0x5d76fb['originalname'])));}})});router[_0xc528('0x1b')](_0xc528('0x2b'),upload[_0xc528('0x2c')]('file'),controller[_0xc528('0x2d')]);var upload=multer({'storage':multer[_0xc528('0x21')]({'destination':function(_0x2c307d,_0x5ad641,_0x511e57){_0x511e57(null,path[_0xc528('0x2e')](config[_0xc528('0x22')],_0xc528('0x23')));},'filename':function(_0x3d0af5,_0x5edcec,_0x1c2b0e){_0x5edcec[_0xc528('0x24')]=_0x5edcec[_0xc528('0x24')][_0xc528('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1c2b0e(null,util[_0xc528('0x26')](_0xc528('0x27'),path[_0xc528('0x28')](_0x5edcec['originalname'],path[_0xc528('0x29')](_0x5edcec[_0xc528('0x24')])),Date['now'](),path[_0xc528('0x29')](_0x5edcec[_0xc528('0x24')])));}})});router[_0xc528('0x1b')](_0xc528('0x2f'),upload[_0xc528('0x2c')](_0xc528('0x30')),controller['upload']);router[_0xc528('0x1b')](_0xc528('0x31'),auth[_0xc528('0x9')](),controller[_0xc528('0x32')]);router[_0xc528('0x33')]('/:id',auth[_0xc528('0x9')](),controller[_0xc528('0x34')]);router[_0xc528('0x35')](_0xc528('0xd'),auth[_0xc528('0x9')](),controller[_0xc528('0x36')]);module[_0xc528('0x37')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 660b295..96b50f3 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 _0xb7e4=['STRING','long','type','select','parse','values','getDataValue','isArray','stringify','BOOLEAN','ENUM','sequelize','exports','VIRTUAL','alias','setDataValue'];(function(_0x330604,_0x1a1740){var _0x385666=function(_0x1c4f05){while(--_0x1c4f05){_0x330604['push'](_0x330604['shift']());}};_0x385666(++_0x1a1740);}(_0xb7e4,0x14b));var _0x4b7e=function(_0x1f1a3b,_0x1f532e){_0x1f1a3b=_0x1f1a3b-0x0;var _0x5a4fb6=_0xb7e4[_0x1f1a3b];return _0x5a4fb6;};'use strict';var Sequelize=require(_0x4b7e('0x0'));var _=require('lodash');module[_0x4b7e('0x1')]={'name':{'type':Sequelize[_0x4b7e('0x2')],'get':function(_0x5dbd24){return this['getDataValue'](_0x4b7e('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x54781c){this[_0x4b7e('0x4')](_0x4b7e('0x3'),_0x54781c?_0x54781c:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x4b7e('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x4b7e('0x6')),'get':function(){if(this['getDataValue'](_0x4b7e('0x7'))===_0x4b7e('0x8')){return JSON[_0x4b7e('0x9')](this['getDataValue'](_0x4b7e('0xa')));}else{return this[_0x4b7e('0xb')](_0x4b7e('0xa'));}},'set':function(_0x3ae2f1){if(Array[_0x4b7e('0xc')](_0x3ae2f1)){this[_0x4b7e('0x4')](_0x4b7e('0xa'),JSON[_0x4b7e('0xd')](_0x3ae2f1));}else{this[_0x4b7e('0x4')](_0x4b7e('0xa'),_0x3ae2f1);}}},'required':{'type':Sequelize[_0x4b7e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x4b7e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x4b7e('0xf')]('voice')}}; \ No newline at end of file +var _0x3901=['values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','long','type','select','parse'];(function(_0x1f90f9,_0x420b5d){var _0x543304=function(_0x574a5d){while(--_0x574a5d){_0x1f90f9['push'](_0x1f90f9['shift']());}};_0x543304(++_0x420b5d);}(_0x3901,0x17e));var _0x1390=function(_0x44b0de,_0x213afa){_0x44b0de=_0x44b0de-0x0;var _0x21da2a=_0x3901[_0x44b0de];return _0x21da2a;};'use strict';var Sequelize=require(_0x1390('0x0'));var _=require(_0x1390('0x1'));module[_0x1390('0x2')]={'name':{'type':Sequelize[_0x1390('0x3')],'get':function(_0x264043){return this[_0x1390('0x4')]('alias');}},'alias':{'type':Sequelize[_0x1390('0x5')],'allowNull':![],'set':function(_0x530a55){this[_0x1390('0x6')](_0x1390('0x7'),_0x530a55?_0x530a55:this[_0x1390('0x4')](_0x1390('0x8')));}},'type':{'type':Sequelize[_0x1390('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x1390('0x9')](_0x1390('0xa')),'get':function(){if(this['getDataValue'](_0x1390('0xb'))===_0x1390('0xc')){return JSON[_0x1390('0xd')](this['getDataValue'](_0x1390('0xe')));}else{return this['getDataValue'](_0x1390('0xe'));}},'set':function(_0x1d7a40){if(Array[_0x1390('0xf')](_0x1d7a40)){this['setDataValue']('values',JSON[_0x1390('0x10')](_0x1d7a40));}else{this['setDataValue']('values',_0x1d7a40);}}},'required':{'type':Sequelize[_0x1390('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x1390('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 6cee085..5a6a399 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 _0x8d7d=['path','sox','ejs','fs-extra','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','sendStatus','end','status','json','offset','undefined','limit','count','set','save','destroy','then','stack','name','index','map','CmCustomField','rawAttributes','key','model','differenceBy','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','type','includeAll','findAll','rows','catch','show','keys','include','options','find','update','body','params','create','sequelize','Sequelize','text','number','switch','defaultValue','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0x38f74c,_0xc68a70){var _0x5806fc=function(_0x238c51){while(--_0x238c51){_0x38f74c['push'](_0x38f74c['shift']());}};_0x5806fc(++_0xc68a70);}(_0x8d7d,0x193));var _0xd8d7=function(_0x396523,_0x2330f7){_0x396523=_0x396523-0x0;var _0x420e8e=_0x8d7d[_0x396523];return _0x420e8e;};'use strict';var emlformat=require(_0xd8d7('0x0'));var rimraf=require(_0xd8d7('0x1'));var zipdir=require(_0xd8d7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8d7('0x3'));var moment=require(_0xd8d7('0x4'));var BPromise=require(_0xd8d7('0x5'));var Mustache=require(_0xd8d7('0x6'));var util=require('util');var path=require(_0xd8d7('0x7'));var sox=require(_0xd8d7('0x8'));var csv=require('to-csv');var ejs=require(_0xd8d7('0x9'));var fs=require('fs');var fs_extra=require(_0xd8d7('0xa'));var _=require('lodash');var squel=require(_0xd8d7('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8d7('0xc'));var deskjs=require(_0xd8d7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd8d7('0xe'));var Papa=require(_0xd8d7('0xf'));var Redis=require(_0xd8d7('0x10'));var authService=require(_0xd8d7('0x11'));var qs=require(_0xd8d7('0x12'));var as=require(_0xd8d7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd8d7('0x14'))(_0xd8d7('0x15'));var utils=require(_0xd8d7('0x16'));var config=require(_0xd8d7('0x17'));var licenseUtil=require(_0xd8d7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b443e,_0x510937){_0x510937=_0x510937||0xcc;return function(_0x81b056){if(_0x81b056){return _0x3b443e[_0xd8d7('0x19')](_0x510937);}return _0x3b443e['status'](_0x510937)[_0xd8d7('0x1a')]();};}function respondWithResult(_0x187acb,_0x19f135){_0x19f135=_0x19f135||0xc8;return function(_0x46b5e0){if(_0x46b5e0){return _0x187acb[_0xd8d7('0x1b')](_0x19f135)[_0xd8d7('0x1c')](_0x46b5e0);}};}function respondWithFilteredResult(_0x596c48,_0x4ac4f4){return function(_0xc5a66d){if(_0xc5a66d){var _0x1beca2=typeof _0x4ac4f4[_0xd8d7('0x1d')]===_0xd8d7('0x1e')&&typeof _0x4ac4f4[_0xd8d7('0x1f')]===_0xd8d7('0x1e');var _0x4c12ed=_0xc5a66d[_0xd8d7('0x20')];var _0x3ac3fa=_0x1beca2?0x0:_0x4ac4f4[_0xd8d7('0x1d')];var _0xa45bc0=_0x1beca2?_0xc5a66d[_0xd8d7('0x20')]:_0x4ac4f4[_0xd8d7('0x1d')]+_0x4ac4f4['limit'];var _0xcd5732;if(_0xa45bc0>=_0x4c12ed){_0xa45bc0=_0x4c12ed;_0xcd5732=0xc8;}else{_0xcd5732=0xce;}_0x596c48['status'](_0xcd5732);return _0x596c48[_0xd8d7('0x21')]('Content-Range',_0x3ac3fa+'-'+_0xa45bc0+'/'+_0x4c12ed)['json'](_0xc5a66d);}return null;};}function patchUpdates(_0x5d68e4){return function(_0x2f36f1){try{jsonpatch['apply'](_0x2f36f1,_0x5d68e4,!![]);}catch(_0x4b5c79){return BPromise['reject'](_0x4b5c79);}return _0x2f36f1[_0xd8d7('0x22')]();};}function saveUpdates(_0x5a00a6,_0xc3b6d3){return function(_0x349804){if(_0x349804){return _0x349804['update'](_0x5a00a6)['then'](function(_0x16eefd){return _0x16eefd;});}return null;};}function removeEntity(_0x175f6f,_0x1e8af9){return function(_0x47ad7a){if(_0x47ad7a){return _0x47ad7a[_0xd8d7('0x23')]()[_0xd8d7('0x24')](function(){_0x175f6f[_0xd8d7('0x1b')](0xcc)[_0xd8d7('0x1a')]();});}};}function handleEntityNotFound(_0x260a0b,_0x1a1c83){return function(_0x1bfece){if(!_0x1bfece){_0x260a0b[_0xd8d7('0x19')](0x194);}return _0x1bfece;};}function handleError(_0x2a284f,_0xf8084e){_0xf8084e=_0xf8084e||0x1f4;return function(_0x1b2eb4){logger['error'](_0x1b2eb4[_0xd8d7('0x25')]);if(_0x1b2eb4['name']){delete _0x1b2eb4[_0xd8d7('0x26')];}_0x2a284f[_0xd8d7('0x1b')](_0xf8084e)['send'](_0x1b2eb4);};}exports[_0xd8d7('0x27')]=function(_0x15c6f3,_0x4e680c){var _0x413cf0={},_0x408455={},_0x285a81={'count':0x0,'rows':[]};var _0x5eaac0=_[_0xd8d7('0x28')](db[_0xd8d7('0x29')][_0xd8d7('0x2a')],function(_0x56e51a){return{'name':_0x56e51a['fieldName'],'type':_0x56e51a['type'][_0xd8d7('0x2b')]};});_0x408455[_0xd8d7('0x2c')]=_[_0xd8d7('0x2d')](_[_0xd8d7('0x28')](_0x5eaac0,_0xd8d7('0x26')),['name']);_0x408455[_0xd8d7('0x2e')]=_['keys'](_0x15c6f3[_0xd8d7('0x2e')]);_0x408455['filters']=_[_0xd8d7('0x2f')](_0x408455[_0xd8d7('0x2c')],_0x408455[_0xd8d7('0x2e')]);_0x413cf0['attributes']=_[_0xd8d7('0x2f')](_0x408455['model'],qs['fields'](_0x15c6f3['query'][_0xd8d7('0x30')]));_0x413cf0[_0xd8d7('0x31')]=_0x413cf0['attributes'][_0xd8d7('0x32')]?_0x413cf0['attributes']:_0x408455[_0xd8d7('0x2c')];if(!_0x15c6f3[_0xd8d7('0x2e')][_0xd8d7('0x33')](_0xd8d7('0x34'))){_0x413cf0['limit']=qs[_0xd8d7('0x1f')](_0x15c6f3[_0xd8d7('0x2e')]['limit']);_0x413cf0['offset']=qs[_0xd8d7('0x1d')](_0x15c6f3[_0xd8d7('0x2e')]['offset']);}_0x413cf0[_0xd8d7('0x35')]=qs['sort'](_0x15c6f3[_0xd8d7('0x2e')]['sort']);_0x413cf0[_0xd8d7('0x36')]=qs[_0xd8d7('0x37')](_[_0xd8d7('0x38')](_0x15c6f3[_0xd8d7('0x2e')],_0x408455[_0xd8d7('0x37')]),_0x5eaac0);if(_0x15c6f3[_0xd8d7('0x2e')][_0xd8d7('0x39')]){_0x413cf0['where']=_[_0xd8d7('0x3a')](_0x413cf0['where'],{'$or':_['map'](_0x5eaac0,function(_0x44d619){if(_0x44d619[_0xd8d7('0x3b')]!=='VIRTUAL'){var _0x321497={};_0x321497[_0x44d619[_0xd8d7('0x26')]]={'$like':'%'+_0x15c6f3[_0xd8d7('0x2e')][_0xd8d7('0x39')]+'%'};return _0x321497;}})});}_0x413cf0=_['merge']({},_0x413cf0,_0x15c6f3['options']);var _0x4a73f9={'where':_0x413cf0['where']};return db[_0xd8d7('0x29')]['count'](_0x4a73f9)[_0xd8d7('0x24')](function(_0x29d487){_0x285a81[_0xd8d7('0x20')]=_0x29d487;if(_0x15c6f3[_0xd8d7('0x2e')][_0xd8d7('0x3c')]){_0x413cf0['include']=[{'all':!![]}];}return db[_0xd8d7('0x29')][_0xd8d7('0x3d')](_0x413cf0);})[_0xd8d7('0x24')](function(_0x8994e3){_0x285a81[_0xd8d7('0x3e')]=_0x8994e3;return _0x285a81;})[_0xd8d7('0x24')](respondWithFilteredResult(_0x4e680c,_0x413cf0))[_0xd8d7('0x3f')](handleError(_0x4e680c,null));};exports[_0xd8d7('0x40')]=function(_0x397d61,_0x13f45b){var _0x47fc9c={'raw':!![],'where':{'id':_0x397d61['params']['id']}},_0x534d16={};_0x534d16[_0xd8d7('0x2c')]=_[_0xd8d7('0x41')](db[_0xd8d7('0x29')][_0xd8d7('0x2a')]);_0x534d16[_0xd8d7('0x2e')]=_[_0xd8d7('0x41')](_0x397d61['query']);_0x534d16[_0xd8d7('0x37')]=_[_0xd8d7('0x2f')](_0x534d16[_0xd8d7('0x2c')],_0x534d16['query']);_0x47fc9c[_0xd8d7('0x31')]=_['intersection'](_0x534d16[_0xd8d7('0x2c')],qs[_0xd8d7('0x30')](_0x397d61[_0xd8d7('0x2e')][_0xd8d7('0x30')]));_0x47fc9c[_0xd8d7('0x31')]=_0x47fc9c[_0xd8d7('0x31')][_0xd8d7('0x32')]?_0x47fc9c['attributes']:_0x534d16['model'];if(_0x397d61[_0xd8d7('0x2e')][_0xd8d7('0x3c')]){_0x47fc9c[_0xd8d7('0x42')]=[{'all':!![]}];}_0x47fc9c=_[_0xd8d7('0x3a')]({},_0x47fc9c,_0x397d61[_0xd8d7('0x43')]);return db[_0xd8d7('0x29')][_0xd8d7('0x44')](_0x47fc9c)[_0xd8d7('0x24')](handleEntityNotFound(_0x13f45b,null))[_0xd8d7('0x24')](respondWithResult(_0x13f45b,null))[_0xd8d7('0x3f')](handleError(_0x13f45b,null));};exports[_0xd8d7('0x45')]=function(_0x396c0f,_0x1addd8){if(_0x396c0f['body']['id']){delete _0x396c0f[_0xd8d7('0x46')]['id'];}return db['CmCustomField'][_0xd8d7('0x44')]({'where':{'id':_0x396c0f[_0xd8d7('0x47')]['id']}})['then'](handleEntityNotFound(_0x1addd8,null))['then'](saveUpdates(_0x396c0f['body'],null))[_0xd8d7('0x24')](respondWithResult(_0x1addd8,null))[_0xd8d7('0x3f')](handleError(_0x1addd8,null));};exports[_0xd8d7('0x23')]=function(_0x11c782,_0x506b8b){return db[_0xd8d7('0x29')][_0xd8d7('0x44')]({'where':{'id':_0x11c782[_0xd8d7('0x47')]['id']}})['then'](handleEntityNotFound(_0x506b8b,null))[_0xd8d7('0x24')](removeEntity(_0x506b8b,null))[_0xd8d7('0x3f')](handleError(_0x506b8b,null));};exports[_0xd8d7('0x48')]=function(_0x72200d,_0x27c880){var _0x1f6a94;return db[_0xd8d7('0x49')]['transaction'](function(_0x59b98c){return db[_0xd8d7('0x29')][_0xd8d7('0x48')](_0x72200d['body'],{'transaction':_0x59b98c})[_0xd8d7('0x24')](function(_0x242f2b){_0x1f6a94=_0x242f2b;var _0xe3508e={'type':db[_0xd8d7('0x4a')]['TEXT'],'transaction':_0x59b98c};switch(_0x72200d[_0xd8d7('0x46')][_0xd8d7('0x3b')]){case _0xd8d7('0x4b'):_0xe3508e['type']=db[_0xd8d7('0x4a')]['TEXT'];break;case _0xd8d7('0x4c'):_0xe3508e[_0xd8d7('0x3b')]=db[_0xd8d7('0x4a')]['INTEGER'];break;case _0xd8d7('0x4d'):_0xe3508e[_0xd8d7('0x3b')]=db[_0xd8d7('0x4a')]['BOOLEAN'];_0xe3508e[_0xd8d7('0x4e')]=![];break;default:}return db['sequelize']['queryInterface'][_0xd8d7('0x4f')]('cm_contacts',util[_0xd8d7('0x50')](_0xd8d7('0x51'),_0x1f6a94['id']),_0xe3508e);})['then'](function(){return _0x1f6a94;});})[_0xd8d7('0x24')](respondWithResult(_0x27c880,0xc9))['catch'](handleError(_0x27c880,null));}; \ No newline at end of file +var _0xd169=['squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','status','error','name','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','create','sequelize','transaction','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0xd169,0x96));var _0x9d16=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xd169[_0x166d93];return _0xba708;};'use strict';var emlformat=require(_0x9d16('0x0'));var rimraf=require(_0x9d16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d16('0x2'));var rp=require(_0x9d16('0x3'));var moment=require(_0x9d16('0x4'));var BPromise=require(_0x9d16('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9d16('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9d16('0x7'));var fs=require('fs');var fs_extra=require(_0x9d16('0x8'));var _=require(_0x9d16('0x9'));var squel=require(_0x9d16('0xa'));var crypto=require(_0x9d16('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9d16('0xc'));var toCsv=require(_0x9d16('0xd'));var querystring=require(_0x9d16('0xe'));var Papa=require(_0x9d16('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9d16('0x10'));var as=require(_0x9d16('0x11'));var hardwareService=require(_0x9d16('0x12'));var logger=require(_0x9d16('0x13'))(_0x9d16('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9d16('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x326564,_0x51dd48){_0x51dd48=_0x51dd48||0xcc;return function(_0x1bdca7){if(_0x1bdca7){return _0x326564['sendStatus'](_0x51dd48);}return _0x326564['status'](_0x51dd48)[_0x9d16('0x16')]();};}function respondWithResult(_0x33c76e,_0x52ab84){_0x52ab84=_0x52ab84||0xc8;return function(_0x569084){if(_0x569084){return _0x33c76e['status'](_0x52ab84)[_0x9d16('0x17')](_0x569084);}};}function respondWithFilteredResult(_0x604959,_0x390104){return function(_0x3cf24f){if(_0x3cf24f){var _0x536f6=typeof _0x390104[_0x9d16('0x18')]===_0x9d16('0x19')&&typeof _0x390104[_0x9d16('0x1a')]===_0x9d16('0x19');var _0x23ecbc=_0x3cf24f[_0x9d16('0x1b')];var _0x2d9c4c=_0x536f6?0x0:_0x390104[_0x9d16('0x18')];var _0x16edef=_0x536f6?_0x3cf24f['count']:_0x390104[_0x9d16('0x18')]+_0x390104[_0x9d16('0x1a')];var _0x1c9d6a;if(_0x16edef>=_0x23ecbc){_0x16edef=_0x23ecbc;_0x1c9d6a=0xc8;}else{_0x1c9d6a=0xce;}_0x604959['status'](_0x1c9d6a);return _0x604959['set'](_0x9d16('0x1c'),_0x2d9c4c+'-'+_0x16edef+'/'+_0x23ecbc)[_0x9d16('0x17')](_0x3cf24f);}return null;};}function patchUpdates(_0x54569f){return function(_0x16f3a8){try{jsonpatch[_0x9d16('0x1d')](_0x16f3a8,_0x54569f,!![]);}catch(_0x111b99){return BPromise['reject'](_0x111b99);}return _0x16f3a8[_0x9d16('0x1e')]();};}function saveUpdates(_0x4100ac,_0x2eb1ef){return function(_0xaa0907){if(_0xaa0907){return _0xaa0907[_0x9d16('0x1f')](_0x4100ac)[_0x9d16('0x20')](function(_0x49bc9f){return _0x49bc9f;});}return null;};}function removeEntity(_0x5cf85a,_0x4f1298){return function(_0x1b0528){if(_0x1b0528){return _0x1b0528[_0x9d16('0x21')]()[_0x9d16('0x20')](function(){_0x5cf85a[_0x9d16('0x22')](0xcc)[_0x9d16('0x16')]();});}};}function handleEntityNotFound(_0x1248fb,_0x29e408){return function(_0x236e36){if(!_0x236e36){_0x1248fb['sendStatus'](0x194);}return _0x236e36;};}function handleError(_0x3e8e5f,_0x10adde){_0x10adde=_0x10adde||0x1f4;return function(_0x549b92){logger[_0x9d16('0x23')](_0x549b92['stack']);if(_0x549b92[_0x9d16('0x24')]){delete _0x549b92[_0x9d16('0x24')];}_0x3e8e5f[_0x9d16('0x22')](_0x10adde)['send'](_0x549b92);};}exports['index']=function(_0x19b6f5,_0x2243c9){var _0x19e652={},_0x69da57={},_0x1b45a2={'count':0x0,'rows':[]};var _0x4568a0=_['map'](db[_0x9d16('0x25')][_0x9d16('0x26')],function(_0x6ccd20){return{'name':_0x6ccd20[_0x9d16('0x27')],'type':_0x6ccd20[_0x9d16('0x28')][_0x9d16('0x29')]};});_0x69da57['model']=_[_0x9d16('0x2a')](_[_0x9d16('0x2b')](_0x4568a0,_0x9d16('0x24')),[_0x9d16('0x24')]);_0x69da57[_0x9d16('0x2c')]=_['keys'](_0x19b6f5[_0x9d16('0x2c')]);_0x69da57[_0x9d16('0x2d')]=_[_0x9d16('0x2e')](_0x69da57[_0x9d16('0x2f')],_0x69da57[_0x9d16('0x2c')]);_0x19e652[_0x9d16('0x30')]=_[_0x9d16('0x2e')](_0x69da57[_0x9d16('0x2f')],qs['fields'](_0x19b6f5[_0x9d16('0x2c')][_0x9d16('0x31')]));_0x19e652[_0x9d16('0x30')]=_0x19e652['attributes'][_0x9d16('0x32')]?_0x19e652[_0x9d16('0x30')]:_0x69da57[_0x9d16('0x2f')];if(!_0x19b6f5[_0x9d16('0x2c')][_0x9d16('0x33')](_0x9d16('0x34'))){_0x19e652[_0x9d16('0x1a')]=qs['limit'](_0x19b6f5[_0x9d16('0x2c')]['limit']);_0x19e652['offset']=qs[_0x9d16('0x18')](_0x19b6f5[_0x9d16('0x2c')][_0x9d16('0x18')]);}_0x19e652[_0x9d16('0x35')]=qs[_0x9d16('0x36')](_0x19b6f5[_0x9d16('0x2c')][_0x9d16('0x36')]);_0x19e652[_0x9d16('0x37')]=qs[_0x9d16('0x2d')](_[_0x9d16('0x38')](_0x19b6f5[_0x9d16('0x2c')],_0x69da57[_0x9d16('0x2d')]),_0x4568a0);if(_0x19b6f5[_0x9d16('0x2c')][_0x9d16('0x39')]){_0x19e652[_0x9d16('0x37')]=_[_0x9d16('0x3a')](_0x19e652[_0x9d16('0x37')],{'$or':_['map'](_0x4568a0,function(_0xba9a5a){if(_0xba9a5a[_0x9d16('0x28')]!=='VIRTUAL'){var _0x515a6f={};_0x515a6f[_0xba9a5a[_0x9d16('0x24')]]={'$like':'%'+_0x19b6f5['query']['filter']+'%'};return _0x515a6f;}})});}_0x19e652=_[_0x9d16('0x3a')]({},_0x19e652,_0x19b6f5[_0x9d16('0x3b')]);var _0x589e8f={'where':_0x19e652[_0x9d16('0x37')]};return db['CmCustomField']['count'](_0x589e8f)['then'](function(_0x537a7b){_0x1b45a2[_0x9d16('0x1b')]=_0x537a7b;if(_0x19b6f5['query'][_0x9d16('0x3c')]){_0x19e652[_0x9d16('0x3d')]=[{'all':!![]}];}return db[_0x9d16('0x25')][_0x9d16('0x3e')](_0x19e652);})['then'](function(_0x43a3dd){_0x1b45a2['rows']=_0x43a3dd;return _0x1b45a2;})[_0x9d16('0x20')](respondWithFilteredResult(_0x2243c9,_0x19e652))[_0x9d16('0x3f')](handleError(_0x2243c9,null));};exports[_0x9d16('0x40')]=function(_0x294ac5,_0x4df9b2){var _0x189981={'raw':!![],'where':{'id':_0x294ac5[_0x9d16('0x41')]['id']}},_0x40e30b={};_0x40e30b['model']=_['keys'](db[_0x9d16('0x25')][_0x9d16('0x26')]);_0x40e30b[_0x9d16('0x2c')]=_['keys'](_0x294ac5['query']);_0x40e30b[_0x9d16('0x2d')]=_[_0x9d16('0x2e')](_0x40e30b[_0x9d16('0x2f')],_0x40e30b['query']);_0x189981[_0x9d16('0x30')]=_[_0x9d16('0x2e')](_0x40e30b['model'],qs['fields'](_0x294ac5[_0x9d16('0x2c')]['fields']));_0x189981['attributes']=_0x189981[_0x9d16('0x30')][_0x9d16('0x32')]?_0x189981[_0x9d16('0x30')]:_0x40e30b[_0x9d16('0x2f')];if(_0x294ac5['query'][_0x9d16('0x3c')]){_0x189981[_0x9d16('0x3d')]=[{'all':!![]}];}_0x189981=_[_0x9d16('0x3a')]({},_0x189981,_0x294ac5['options']);return db[_0x9d16('0x25')][_0x9d16('0x42')](_0x189981)[_0x9d16('0x20')](handleEntityNotFound(_0x4df9b2,null))[_0x9d16('0x20')](respondWithResult(_0x4df9b2,null))['catch'](handleError(_0x4df9b2,null));};exports[_0x9d16('0x1f')]=function(_0x5c31e4,_0x234d29){if(_0x5c31e4[_0x9d16('0x43')]['id']){delete _0x5c31e4[_0x9d16('0x43')]['id'];}return db[_0x9d16('0x25')][_0x9d16('0x42')]({'where':{'id':_0x5c31e4[_0x9d16('0x41')]['id']}})[_0x9d16('0x20')](handleEntityNotFound(_0x234d29,null))[_0x9d16('0x20')](saveUpdates(_0x5c31e4[_0x9d16('0x43')],null))[_0x9d16('0x20')](respondWithResult(_0x234d29,null))[_0x9d16('0x3f')](handleError(_0x234d29,null));};exports[_0x9d16('0x21')]=function(_0x2f0db5,_0xfffc1c){return db[_0x9d16('0x25')][_0x9d16('0x42')]({'where':{'id':_0x2f0db5[_0x9d16('0x41')]['id']}})[_0x9d16('0x20')](handleEntityNotFound(_0xfffc1c,null))[_0x9d16('0x20')](removeEntity(_0xfffc1c,null))[_0x9d16('0x3f')](handleError(_0xfffc1c,null));};exports[_0x9d16('0x44')]=function(_0x794c6f,_0x585905){var _0x3cbb33;return db[_0x9d16('0x45')][_0x9d16('0x46')](function(_0x23ed8b){return db[_0x9d16('0x25')][_0x9d16('0x44')](_0x794c6f[_0x9d16('0x43')],{'transaction':_0x23ed8b})[_0x9d16('0x20')](function(_0xa633a9){_0x3cbb33=_0xa633a9;var _0x4d93d6={'type':db[_0x9d16('0x47')][_0x9d16('0x48')],'transaction':_0x23ed8b};switch(_0x794c6f[_0x9d16('0x43')][_0x9d16('0x28')]){case'text':_0x4d93d6[_0x9d16('0x28')]=db[_0x9d16('0x47')][_0x9d16('0x48')];break;case _0x9d16('0x49'):_0x4d93d6['type']=db[_0x9d16('0x47')][_0x9d16('0x4a')];break;case _0x9d16('0x4b'):_0x4d93d6[_0x9d16('0x28')]=db[_0x9d16('0x47')][_0x9d16('0x4c')];_0x4d93d6[_0x9d16('0x4d')]=![];break;default:}return db[_0x9d16('0x45')]['queryInterface'][_0x9d16('0x4e')]('cm_contacts',util[_0x9d16('0x4f')]('cf_%d',_0x3cbb33['id']),_0x4d93d6);})['then'](function(){return _0x3cbb33;});})['then'](respondWithResult(_0x585905,0xc9))[_0x9d16('0x3f')](handleError(_0x585905,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b4ee986..b6a2b4f 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 _0x129a=['bluebird','request-promise','../../config/environment','exports','cm_custom_fields','lodash','util','../../config/logger','moment'];(function(_0x38080e,_0x95512d){var _0x4e4c87=function(_0x2be6b3){while(--_0x2be6b3){_0x38080e['push'](_0x38080e['shift']());}};_0x4e4c87(++_0x95512d);}(_0x129a,0xc2));var _0xa129=function(_0x31c0d3,_0x30d9da){_0x31c0d3=_0x31c0d3-0x0;var _0x2f6901=_0x129a[_0x31c0d3];return _0x2f6901;};'use strict';var _=require(_0xa129('0x0'));var util=require(_0xa129('0x1'));var logger=require(_0xa129('0x2'))('api');var moment=require(_0xa129('0x3'));var BPromise=require(_0xa129('0x4'));var rp=require(_0xa129('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa129('0x6'));var attributes=require('./cmCustomField.attributes');module[_0xa129('0x7')]=function(_0x2e94f1,_0x50ee21){return _0x2e94f1['define']('CmCustomField',attributes,{'tableName':_0xa129('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ca0=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','../../config/logger','api','moment'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x2ca0,0xcf));var _0x02ca=function(_0x15ad3f,_0x1d6280){_0x15ad3f=_0x15ad3f-0x0;var _0xfb1d10=_0x2ca0[_0x15ad3f];return _0xfb1d10;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x02ca('0x0'))(_0x02ca('0x1'));var moment=require(_0x02ca('0x2'));var BPromise=require('bluebird');var rp=require(_0x02ca('0x3'));var fs=require('fs');var path=require(_0x02ca('0x4'));var rimraf=require(_0x02ca('0x5'));var config=require(_0x02ca('0x6'));var attributes=require(_0x02ca('0x7'));module[_0x02ca('0x8')]=function(_0x3a629b,_0x512125){return _0x3a629b['define'](_0x02ca('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index d5b593a..91cb617 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 _0xbcfd=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring'];(function(_0x42af3a,_0x2aafb9){var _0x14d099=function(_0x14a06d){while(--_0x14a06d){_0x42af3a['push'](_0x42af3a['shift']());}};_0x14d099(++_0x2aafb9);}(_0xbcfd,0x146));var _0xdbcf=function(_0x546be0,_0x3fcd84){_0x546be0=_0x546be0-0x0;var _0x4f64ba=_0xbcfd[_0x546be0];return _0x4f64ba;};'use strict';var _=require('lodash');var util=require(_0xdbcf('0x0'));var moment=require(_0xdbcf('0x1'));var BPromise=require(_0xdbcf('0x2'));var rs=require(_0xdbcf('0x3'));var fs=require('fs');var Redis=require(_0xdbcf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbcf('0x5'));var logger=require(_0xdbcf('0x6'))(_0xdbcf('0x7'));var config=require(_0xdbcf('0x8'));var jayson=require(_0xdbcf('0x9'));var client=jayson[_0xdbcf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30e6ef,_0x146b66,_0x5bd398){return new BPromise(function(_0x4995e8,_0x21941e){return client[_0xdbcf('0xb')](_0x30e6ef,_0x5bd398)['then'](function(_0x521bd0){logger[_0xdbcf('0xc')]('CmCustomField,\x20%s,\x20%s',_0x146b66,'request\x20sent');logger[_0xdbcf('0xd')](_0xdbcf('0xe'),_0x146b66,_0xdbcf('0xf'),JSON[_0xdbcf('0x10')](_0x521bd0));if(_0x521bd0['error']){if(_0x521bd0[_0xdbcf('0x11')][_0xdbcf('0x12')]===0x1f4){logger['error'](_0xdbcf('0x13'),_0x146b66,_0x521bd0[_0xdbcf('0x11')][_0xdbcf('0x14')]);return _0x21941e(_0x521bd0[_0xdbcf('0x11')][_0xdbcf('0x14')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x146b66,_0x521bd0[_0xdbcf('0x11')][_0xdbcf('0x14')]);return _0x4995e8(_0x521bd0[_0xdbcf('0x11')][_0xdbcf('0x14')]);}else{logger[_0xdbcf('0xc')](_0xdbcf('0x13'),_0x146b66,_0xdbcf('0xf'));_0x4995e8(_0x521bd0[_0xdbcf('0x15')][_0xdbcf('0x14')]);}})['catch'](function(_0x11712e){logger[_0xdbcf('0x11')]('CmCustomField,\x20%s,\x20%s',_0x146b66,_0x11712e);_0x21941e(_0x11712e);});});} \ No newline at end of file +var _0xc82c=['jayson/promise','client','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4c953c,_0x2edbb8){var _0xfa0543=function(_0x2d2cb1){while(--_0x2d2cb1){_0x4c953c['push'](_0x4c953c['shift']());}};_0xfa0543(++_0x2edbb8);}(_0xc82c,0x125));var _0xcc82=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc82c[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xcc82('0x0'));var util=require(_0xcc82('0x1'));var moment=require('moment');var BPromise=require(_0xcc82('0x2'));var rs=require(_0xcc82('0x3'));var fs=require('fs');var Redis=require(_0xcc82('0x4'));var db=require(_0xcc82('0x5'))['db'];var utils=require(_0xcc82('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcc82('0x7'));var client=jayson[_0xcc82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b8b9d,_0x3ba473,_0x558355){return new BPromise(function(_0x8efbe5,_0x1f138b){return client[_0xcc82('0x9')](_0x5b8b9d,_0x558355)['then'](function(_0x2ac7b4){logger[_0xcc82('0xa')](_0xcc82('0xb'),_0x3ba473,_0xcc82('0xc'));logger[_0xcc82('0xd')](_0xcc82('0xe'),_0x3ba473,'request\x20sent',JSON['stringify'](_0x2ac7b4));if(_0x2ac7b4[_0xcc82('0xf')]){if(_0x2ac7b4[_0xcc82('0xf')][_0xcc82('0x10')]===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x3ba473,_0x2ac7b4['error'][_0xcc82('0x11')]);return _0x1f138b(_0x2ac7b4['error'][_0xcc82('0x11')]);}logger['error'](_0xcc82('0xb'),_0x3ba473,_0x2ac7b4[_0xcc82('0xf')]['message']);return _0x8efbe5(_0x2ac7b4[_0xcc82('0xf')]['message']);}else{logger['info'](_0xcc82('0xb'),_0x3ba473,_0xcc82('0xc'));_0x8efbe5(_0x2ac7b4[_0xcc82('0x12')][_0xcc82('0x11')]);}})[_0xcc82('0x13')](function(_0x55b23a){logger[_0xcc82('0xf')](_0xcc82('0xb'),_0x3ba473,_0x55b23a);_0x1f138b(_0x55b23a);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index dc35102..e164382 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 _0x35e2=['../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e7ed6,_0x4e7a3f){var _0x21e7ab=function(_0x188465){while(--_0x188465){_0x2e7ed6['push'](_0x2e7ed6['shift']());}};_0x21e7ab(++_0x4e7a3f);}(_0x35e2,0x1ed));var _0x235e=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x35e2[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require(_0x235e('0x0'));var util=require('util');var path=require(_0x235e('0x1'));var timeout=require(_0x235e('0x2'));var express=require(_0x235e('0x3'));var router=express['Router']();var fs_extra=require(_0x235e('0x4'));var auth=require(_0x235e('0x5'));var interaction=require(_0x235e('0x6'));var config=require(_0x235e('0x7'));var controller=require(_0x235e('0x8'));router[_0x235e('0x9')]('/',auth[_0x235e('0xa')](),controller[_0x235e('0xb')]);router[_0x235e('0x9')](_0x235e('0xc'),auth[_0x235e('0xa')](),controller[_0x235e('0xd')]);router[_0x235e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x235e('0xf')](_0x235e('0xc'),auth['isAuthenticated'](),controller[_0x235e('0x10')]);router[_0x235e('0x11')](_0x235e('0xc'),auth[_0x235e('0xa')](),controller[_0x235e('0x12')]);module[_0x235e('0x13')]=router; \ No newline at end of file +var _0x52e3=['update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0xeabb6c,_0x4737d9){var _0x389b6d=function(_0x12c1ea){while(--_0x12c1ea){_0xeabb6c['push'](_0xeabb6c['shift']());}};_0x389b6d(++_0x4737d9);}(_0x52e3,0x159));var _0x352e=function(_0x137873,_0x35a090){_0x137873=_0x137873-0x0;var _0x116a9e=_0x52e3[_0x137873];return _0x116a9e;};'use strict';var multer=require(_0x352e('0x0'));var util=require('util');var path=require(_0x352e('0x1'));var timeout=require(_0x352e('0x2'));var express=require('express');var router=express[_0x352e('0x3')]();var fs_extra=require(_0x352e('0x4'));var auth=require(_0x352e('0x5'));var interaction=require(_0x352e('0x6'));var config=require(_0x352e('0x7'));var controller=require(_0x352e('0x8'));router[_0x352e('0x9')]('/',auth[_0x352e('0xa')](),controller[_0x352e('0xb')]);router[_0x352e('0x9')](_0x352e('0xc'),auth['isAuthenticated'](),controller[_0x352e('0xd')]);router[_0x352e('0xe')]('/',auth[_0x352e('0xa')](),controller['create']);router[_0x352e('0xf')](_0x352e('0xc'),auth[_0x352e('0xa')](),controller[_0x352e('0x10')]);router['delete'](_0x352e('0xc'),auth[_0x352e('0xa')](),controller[_0x352e('0x11')]);module[_0x352e('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 15a7166..509377b 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 _0xacf4=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','exports','STRING','BOOLEAN'];(function(_0x46c6a2,_0x441de6){var _0x3d6fe8=function(_0x3791a9){while(--_0x3791a9){_0x46c6a2['push'](_0x46c6a2['shift']());}};_0x3d6fe8(++_0x441de6);}(_0xacf4,0xe7));var _0x4acf=function(_0x357dc4,_0x4ca350){_0x357dc4=_0x357dc4-0x0;var _0x20ca7b=_0xacf4[_0x357dc4];return _0x20ca7b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4acf('0x0')]={'phone':{'type':Sequelize[_0x4acf('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x4acf('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4acf('0x3')],'defaultValue':moment()[_0x4acf('0x4')](_0x4acf('0x5'))},'countbusyretry':{'type':Sequelize[_0x4acf('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4acf('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x4acf('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4acf('0x3')]},'priority':{'type':Sequelize[_0x4acf('0x6')](0x2)[_0x4acf('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4acf('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4acf('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x4acf('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x4acf('0x6')],'unique':_0x4acf('0x8')},'CampaignId':{'type':Sequelize[_0x4acf('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4acf('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4acf('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x4acf('0x1')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x4888=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format'];(function(_0x402ed1,_0xe29752){var _0x57bce8=function(_0x29022f){while(--_0x29022f){_0x402ed1['push'](_0x402ed1['shift']());}};_0x57bce8(++_0xe29752);}(_0x4888,0x198));var _0x8488=function(_0x415b51,_0x1a29ee){_0x415b51=_0x415b51-0x0;var _0x1dd82c=_0x4888[_0x415b51];return _0x1dd82c;};'use strict';var moment=require('moment');var Sequelize=require(_0x8488('0x0'));module[_0x8488('0x1')]={'phone':{'type':Sequelize[_0x8488('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8488('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x8488('0x4')],'defaultValue':moment()[_0x8488('0x5')](_0x8488('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8488('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8488('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x8488('0x4')]},'priority':{'type':Sequelize[_0x8488('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8488('0x7')],'unique':_0x8488('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x8488('0x7')],'unique':_0x8488('0x8')},'CampaignId':{'type':Sequelize[_0x8488('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8488('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8488('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x8488('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1471de7..1d57fb5 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 _0x9486=['state','statedesc','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','prev','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','List','Queue','dialActive','getPreviewRecall','recallme','Company','CmList','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','timezones','push','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','update','sendStatus','error','name','map','rawAttributes','type','model','query','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','CmHopper','then','includeAll','include','catch','show','params','keys','find','create','body','describe','destroy','VoiceQueueId','VoiceQueue','omit','dataValues'];(function(_0x26d9c6,_0x1318fa){var _0x1158b1=function(_0x3fc75f){while(--_0x3fc75f){_0x26d9c6['push'](_0x26d9c6['shift']());}};_0x1158b1(++_0x1318fa);}(_0x9486,0x13e));var _0x6948=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9486[_0x618414];return _0x21c19a;};'use strict';var moment=require(_0x6948('0x0'));var _=require('lodash');var qs=require(_0x6948('0x1'));var logger=require(_0x6948('0x2'))(_0x6948('0x3'));var shared=require(_0x6948('0x4'));var db=require(_0x6948('0x5'))['db'];function respondWithResult(_0x4ccb1f,_0x46c5b1){_0x46c5b1=_0x46c5b1||0xc8;return function(_0x45238b){if(_0x45238b){return _0x4ccb1f[_0x6948('0x6')](_0x46c5b1)[_0x6948('0x7')](_0x45238b);}};}function respondWithFilteredResult(_0x32d7bb,_0x1b06b7){return function(_0x234e72){if(_0x234e72){var _0x15376a=typeof _0x1b06b7[_0x6948('0x8')]===_0x6948('0x9')&&typeof _0x1b06b7[_0x6948('0xa')]===_0x6948('0x9');var _0x140daa=_0x234e72['count'];var _0x9f3ee5=_0x15376a?0x0:_0x1b06b7[_0x6948('0x8')];var _0x14f1e4=_0x15376a?_0x234e72[_0x6948('0xb')]:_0x1b06b7['offset']+_0x1b06b7[_0x6948('0xa')];var _0x460843;if(_0x14f1e4>=_0x140daa){_0x14f1e4=_0x140daa;_0x460843=0xc8;}else{_0x460843=0xce;}_0x32d7bb['status'](_0x460843);return _0x32d7bb[_0x6948('0xc')](_0x6948('0xd'),_0x9f3ee5+'-'+_0x14f1e4+'/'+_0x140daa)['json'](_0x234e72);}return null;};}function saveUpdates(_0x2b2524,_0x3ce692){return function(_0x1744b6){if(_0x1744b6){return _0x1744b6[_0x6948('0xe')](_0x2b2524)['then'](function(_0x45844e){return _0x45844e;});}return null;};}function handleEntityNotFound(_0x3ca264,_0x36d1f5){return function(_0x2ae50a){if(!_0x2ae50a){_0x3ca264[_0x6948('0xf')](0x194);}return _0x2ae50a;};}function handleError(_0x3269e3,_0x4807fd){_0x4807fd=_0x4807fd||0x1f4;return function(_0x431c66){logger[_0x6948('0x10')](_0x431c66['stack']);if(_0x431c66[_0x6948('0x11')]){delete _0x431c66['name'];}_0x3269e3['status'](_0x4807fd)['send'](_0x431c66);};}exports['index']=function(_0x596ecf,_0xbe8928){var _0xc56848={},_0x470a7a={},_0x1d467f={'count':0x0,'rows':[]};var _0xb2b34e=_[_0x6948('0x12')](db['CmHopper'][_0x6948('0x13')],function(_0x1f2b04){return{'name':_0x1f2b04['fieldName'],'type':_0x1f2b04[_0x6948('0x14')]['key']};});_0x470a7a[_0x6948('0x15')]=_['map'](_0xb2b34e,'name');_0x470a7a[_0x6948('0x16')]=_['keys'](_0x596ecf['query']);_0x470a7a['filters']=_[_0x6948('0x17')](_0x470a7a[_0x6948('0x15')],_0x470a7a['query']);_0x470a7a[_0x6948('0x18')]=_[_0x6948('0x19')](_0x470a7a[_0x6948('0x18')],[_0x6948('0x1a'),_0x6948('0x1b'),_0x6948('0x1c'),_0x6948('0x1d'),_0x6948('0x1e'),'$lte',_0x6948('0x1f'),_0x6948('0x20'),_0x6948('0x21'),_0x6948('0x22'),'$notBetween',_0x6948('0x23'),'$notIn',_0x6948('0x24'),_0x6948('0x25'),_0x6948('0x26'),_0x6948('0x27'),_0x6948('0x24'),_0x6948('0x28'),_0x6948('0x29'),_0x6948('0x2a'),'$any']);_0xc56848['attributes']=_['intersection'](_0x470a7a[_0x6948('0x15')],qs[_0x6948('0x2b')](_0x596ecf['query']['fields']));_0xc56848[_0x6948('0x2c')]=_0xc56848[_0x6948('0x2c')][_0x6948('0x2d')]?_0xc56848[_0x6948('0x2c')]:_0x470a7a[_0x6948('0x15')];if(!_0x596ecf[_0x6948('0x16')]['hasOwnProperty'](_0x6948('0x2e'))){_0xc56848[_0x6948('0xa')]=qs[_0x6948('0xa')](_0x596ecf[_0x6948('0x16')][_0x6948('0xa')]);_0xc56848[_0x6948('0x8')]=qs[_0x6948('0x8')](_0x596ecf[_0x6948('0x16')][_0x6948('0x8')]);}_0xc56848[_0x6948('0x2f')]=qs[_0x6948('0x30')](_0x596ecf[_0x6948('0x16')][_0x6948('0x30')]);_0xc56848[_0x6948('0x31')]=qs[_0x6948('0x18')](_[_0x6948('0x32')](_0x596ecf[_0x6948('0x16')],_0x470a7a[_0x6948('0x18')]),_0xb2b34e);if(_0x596ecf['query'][_0x6948('0x33')]){_0xc56848[_0x6948('0x31')]=_['merge'](_0xc56848[_0x6948('0x31')],{'$or':_['map'](_0xb2b34e,function(_0x9b92c){if(_0x9b92c[_0x6948('0x14')]!==_0x6948('0x34')){var _0x23e8ae={};_0x23e8ae[_0x9b92c[_0x6948('0x11')]]={'$like':'%'+_0x596ecf[_0x6948('0x16')][_0x6948('0x33')]+'%'};return _0x23e8ae;}})});}_0xc56848=_[_0x6948('0x35')]({},_0xc56848,_0x596ecf[_0x6948('0x36')]);var _0x1f7227={'where':_0xc56848[_0x6948('0x31')]};return db[_0x6948('0x37')][_0x6948('0xb')](_0x1f7227)[_0x6948('0x38')](function(_0x3e4dfe){_0x1d467f[_0x6948('0xb')]=_0x3e4dfe;if(_0x596ecf[_0x6948('0x16')][_0x6948('0x39')]){_0xc56848[_0x6948('0x3a')]=[{'all':!![]}];}return db[_0x6948('0x37')]['findAll'](_0xc56848);})[_0x6948('0x38')](function(_0x240e11){_0x1d467f['rows']=_0x240e11;return _0x1d467f;})[_0x6948('0x38')](respondWithFilteredResult(_0xbe8928,_0xc56848))[_0x6948('0x3b')](handleError(_0xbe8928,null));};exports[_0x6948('0x3c')]=function(_0x6cb13c,_0x50abdb){var _0xbaa450={'raw':!![],'where':{'id':_0x6cb13c[_0x6948('0x3d')]['id']}},_0x33ac71={};_0x33ac71[_0x6948('0x15')]=_['keys'](db[_0x6948('0x37')][_0x6948('0x13')]);_0x33ac71['query']=_[_0x6948('0x3e')](_0x6cb13c['query']);_0x33ac71[_0x6948('0x18')]=_[_0x6948('0x17')](_0x33ac71[_0x6948('0x15')],_0x33ac71[_0x6948('0x16')]);_0xbaa450[_0x6948('0x2c')]=_[_0x6948('0x17')](_0x33ac71[_0x6948('0x15')],qs[_0x6948('0x2b')](_0x6cb13c[_0x6948('0x16')][_0x6948('0x2b')]));_0xbaa450[_0x6948('0x2c')]=_0xbaa450['attributes']['length']?_0xbaa450[_0x6948('0x2c')]:_0x33ac71[_0x6948('0x15')];if(_0x6cb13c[_0x6948('0x16')]['includeAll']){_0xbaa450[_0x6948('0x3a')]=[{'all':!![]}];}_0xbaa450=_[_0x6948('0x35')]({},_0xbaa450,_0x6cb13c[_0x6948('0x36')]);return db[_0x6948('0x37')][_0x6948('0x3f')](_0xbaa450)[_0x6948('0x38')](handleEntityNotFound(_0x50abdb,null))['then'](respondWithResult(_0x50abdb,null))[_0x6948('0x3b')](handleError(_0x50abdb,null));};exports[_0x6948('0x40')]=function(_0x4c260b,_0x46265c){return db[_0x6948('0x37')][_0x6948('0x40')](_0x4c260b[_0x6948('0x41')],{})[_0x6948('0x38')](respondWithResult(_0x46265c,0xc9))[_0x6948('0x3b')](handleError(_0x46265c,null));};exports['update']=function(_0x28aa50,_0x40345f){if(_0x28aa50['body']['id']){delete _0x28aa50[_0x6948('0x41')]['id'];}return db['CmHopper'][_0x6948('0x3f')]({'where':{'id':_0x28aa50['params']['id']}})[_0x6948('0x38')](handleEntityNotFound(_0x40345f,null))[_0x6948('0x38')](saveUpdates(_0x28aa50[_0x6948('0x41')],null))['then'](respondWithResult(_0x40345f,null))[_0x6948('0x3b')](handleError(_0x40345f,null));};exports[_0x6948('0x42')]=function(_0x1993af,_0x59ac25){return db['CmHopper'][_0x6948('0x42')]()[_0x6948('0x38')](respondWithResult(_0x59ac25,null))[_0x6948('0x3b')](handleError(_0x59ac25,null));};exports[_0x6948('0x43')]=function(_0x3b024f,_0x861725){var _0x1a5693;return db[_0x6948('0x37')][_0x6948('0x3f')]({'where':{'id':_0x3b024f[_0x6948('0x3d')]['id']}})[_0x6948('0x38')](handleEntityNotFound(_0x861725,null))['then'](function(_0x54d8a2){if(_0x54d8a2){return _0x54d8a2[_0x6948('0x43')]()[_0x6948('0x38')](function(_0x1725b6){return _0x1725b6;});}})[_0x6948('0x38')](function(_0x2559b6){_0x1a5693=_0x2559b6;if(_0x2559b6){if(_0x2559b6[_0x6948('0x44')]||_0x2559b6['CampaignId']){return db[_0x2559b6[_0x6948('0x44')]?_0x6948('0x45'):'Campaign']['find']({'where':{'id':_0x2559b6[_0x6948('0x44')]?_0x2559b6[_0x6948('0x44')]:_0x2559b6['CampaignId']},'attributes':['id',_0x6948('0x11')],'raw':!![]});}}})[_0x6948('0x38')](function(_0x3bb503){var _0x4745f5={};if(_0x3bb503){_[_0x6948('0x35')](_0x4745f5,_[_0x6948('0x46')](_0x1a5693[_0x6948('0x47')],['createdAt','updatedAt','id']));_0x4745f5[_0x6948('0x48')]=0x15;_0x4745f5[_0x6948('0x49')]=_0x6948('0x4a');_0x4745f5['campaign']=_0x3bb503[_0x6948('0x11')];_0x4745f5['membername']=_0x3b024f[_0x6948('0x4b')][_0x6948('0x11')];_0x4745f5[_0x6948('0x4c')]=_0x3b024f['user']['id'];_0x4745f5[_0x6948('0x4a')]=!![];_0x4745f5[_0x6948('0x4d')]=moment()[_0x6948('0x4e')](_0x6948('0x4f'));_0x4745f5[_0x6948('0x50')]=_0x1a5693['phone'];_0x4745f5['campaigntype']=_0x1a5693[_0x6948('0x44')]?'queue':_0x6948('0x51');return db[_0x6948('0x52')][_0x6948('0x3f')]({'where':{'id':_0x4745f5[_0x6948('0x53')]},'attributes':['firstName',_0x6948('0x54')]})[_0x6948('0x38')](function(_0x478512){if(!_[_0x6948('0x55')](_0x861725)&&!_[_0x6948('0x55')](_0x478512[_0x6948('0x56')])){_0x4745f5[_0x6948('0x57')]=_0x478512[_0x6948('0x56')];if(!_[_0x6948('0x55')](_0x478512[_0x6948('0x54')])){_0x4745f5[_0x6948('0x57')]+='\x20'+_0x478512[_0x6948('0x54')];}}})[_0x6948('0x58')](function(){return db[_0x6948('0x59')][_0x6948('0x40')](_0x4745f5);});}})[_0x6948('0x38')](function(){return _0x861725[_0x6948('0x6')](0xcc)['end']();})['catch'](handleError(_0x861725,null));};exports[_0x6948('0x5a')]=function(_0x2ec81d,_0x36e7b4){var _0x26c8d8=[];return db[_0x6948('0x52')][_0x6948('0x42')]()[_0x6948('0x38')](function(_0x368d9d){_0x26c8d8=_[_0x6948('0x3e')](_0x368d9d);return _0x2ec81d[_0x6948('0x4b')][_0x6948('0x5b')]({'where':{'type':_0x6948('0x5c'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x6948('0x5d'),_0x6948('0x5e')],'raw':!![]});})['then'](function(_0x4b7b0a){if(_0x4b7b0a&&_0x4b7b0a[_0x6948('0x2d')]){return db[_0x6948('0x5f')][_0x6948('0x60')](function(_0x550321){var _0x5f0ab5={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6948('0x4e')](_0x6948('0x4f'))},'VoiceQueueId':{'$in':_[_0x6948('0x12')](_0x4b7b0a,'id')},'$or':[{'UserId':null},{'UserId':_0x2ec81d[_0x6948('0x4b')]['id']}]};var _0x58844a={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4b7b0a)['filter'](['dialPreviewAutoRecallMe',0x0])[_0x6948('0x12')]('id')[_0x6948('0x61')]()},'$or':[{'UserId':null},{'UserId':_0x2ec81d['user']['id']}]};var _0x2c0a28={'$or':[_0x5f0ab5,_0x58844a]};var _0x414c81=[];if(_0x2ec81d[_0x6948('0x41')][_0x6948('0x62')]&&_0x2ec81d[_0x6948('0x41')]['direction']===_0x6948('0x63')){if(!_['isEmpty'](_0x2ec81d[_0x6948('0x41')]['hopperIds'])){_0x2c0a28['id']={'$in':_0x2ec81d[_0x6948('0x41')][_0x6948('0x64')]};}_0x414c81=[[_0x6948('0x65'),_0x6948('0x66')],['scheduledAt',_0x4b7b0a[0x0][_0x6948('0x5d')]===_0x6948('0x66')?_0x6948('0x67'):_0x6948('0x66')],db['sequelize'][_0x6948('0x68')](_0x6948('0x69')),['id',_0x6948('0x67')]];}else{if(!_[_0x6948('0x6a')](_0x2ec81d[_0x6948('0x41')][_0x6948('0x64')])){_0x2c0a28['id']={'$notIn':_0x2ec81d[_0x6948('0x41')]['hopperIds']};}_0x414c81=[[_0x6948('0x65'),_0x6948('0x67')],[_0x6948('0x6b'),_0x4b7b0a[0x0]['dialOrderByScheduledAt']],db[_0x6948('0x5f')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x6948('0x66')]];}return db[_0x6948('0x37')][_0x6948('0x6c')]({'attributes':['id',_0x6948('0x6d'),'recallme'],'where':_0x2c0a28,'order':_0x414c81,'transaction':_0x550321,'lock':_0x550321[_0x6948('0x6e')][_0x6948('0x6f')],'include':[{'model':db[_0x6948('0x52')],'as':_0x6948('0x70'),'attributes':_0x26c8d8,'include':[{'model':db[_0x6948('0x71')],'as':'Company','attributes':['id',_0x6948('0x11')]}]},{'model':db['CmList'],'as':_0x6948('0x72'),'attributes':['id',_0x6948('0x11')]},{'model':db['VoiceQueue'],'as':_0x6948('0x73'),'attributes':['id','name',_0x6948('0x74')]}]})['then'](function(_0xecb8d2){if(_0xecb8d2){return _0xecb8d2[_0x6948('0xe')]({'UserId':_0x2ec81d[_0x6948('0x4b')]['id']},{'transaction':_0x550321});}});});}})['then'](handleEntityNotFound(_0x36e7b4,null))[_0x6948('0x38')](respondWithResult(_0x36e7b4,null))[_0x6948('0x3b')](handleError(_0x36e7b4,null));};exports[_0x6948('0x75')]=function(_0x505e14,_0x30e9a6,_0xca8cfa){var _0x1f6eb0=[];var _0x5f3707=_0x505e14[_0x6948('0x3d')]['id'];var _0x186452=_0x505e14[_0x6948('0x4b')]['id'];return db[_0x6948('0x52')]['describe']()[_0x6948('0x38')](function(_0x18212e){_0x1f6eb0=_[_0x6948('0x3e')](_0x18212e);return db[_0x6948('0x5f')][_0x6948('0x60')](function(_0x333214){const _0x5e6750={'id':_0x5f3707};return db[_0x6948('0x37')]['findOne']({'attributes':['id',_0x6948('0x6d'),_0x6948('0x76')],'where':_0x5e6750,'transaction':_0x333214,'lock':_0x333214[_0x6948('0x6e')][_0x6948('0x6f')],'include':[{'model':db[_0x6948('0x52')],'as':'Contact','attributes':_0x1f6eb0,'include':[{'model':db[_0x6948('0x71')],'as':_0x6948('0x77'),'attributes':['id',_0x6948('0x11')]}]},{'model':db[_0x6948('0x78')],'as':_0x6948('0x72'),'attributes':['id',_0x6948('0x11')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x6948('0x11'),_0x6948('0x74')]}]})[_0x6948('0x38')](function(_0x8637ec){if(_0x8637ec){return _0x8637ec[_0x6948('0xe')]({'UserId':_0x186452},{'transaction':_0x333214});}});});})['then'](handleEntityNotFound(_0x30e9a6,null))[_0x6948('0x38')](respondWithResult(_0x30e9a6,null))[_0x6948('0x3b')](handleError(_0x30e9a6,null));};exports['getOpenContacts']=function(_0x1a3a3c,_0x268940){return _0x1a3a3c[_0x6948('0x4b')][_0x6948('0x5b')]({'where':{'type':_0x6948('0x5c'),'dialActive':!![],'dialMethod':_0x6948('0x79')},'attributes':['id'],'raw':!![]})[_0x6948('0x38')](function(_0x5c9021){if(_0x5c9021&&_0x5c9021[_0x6948('0x2d')]){return db['CmHopper'][_0x6948('0xb')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6948('0x4f'))},'VoiceQueueId':{'$in':_[_0x6948('0x12')](_0x5c9021,'id')},'$or':[{'UserId':null},{'UserId':_0x1a3a3c['user']['id']}]}});}return 0x0;})[_0x6948('0x38')](function(_0x216391){if(!_[_0x6948('0x55')](_0x216391)&&_[_0x6948('0x7a')](_0x216391)){return _0x268940['status'](0xc8)['json']({'contacts':_0x216391});}else{logger[_0x6948('0x10')](_0x6948('0x7b'),_0x6948('0x7c'),0x194,_0x6948('0x7d'));_0x268940[_0x6948('0xf')](0x194);}})[_0x6948('0x3b')](handleError(_0x268940,null));};exports['getTimezones']=function(_0x22e7e0,_0x265e66){var _0x2798a2=shared[_0x6948('0x7e')];var _0x820a9e=[];_['map'](_0x2798a2,function(_0x1e160f){_0x820a9e[_0x6948('0x7f')]({'id':_0x1e160f[_0x6948('0x11')],'name':_0x1e160f[_0x6948('0x11')],'utcOffset':_0x1e160f[_0x6948('0x80')]});});return _0x265e66[_0x6948('0x6')](0xc8)['json']({'tz':_0x820a9e});};exports[_0x6948('0x81')]=function(_0x2032cf,_0x21d9cf){var _0xe912bd=shared['timezones'];var _0x576de1={};if(!_[_0x6948('0x55')](_0xe912bd[_0x2032cf[_0x6948('0x41')]['id']]))_0x576de1=_0xe912bd[_0x2032cf['body']['id']];return _0x21d9cf['status'](0xc8)[_0x6948('0x7')](_0x576de1);}; \ No newline at end of file +var _0xc33b=['value','direction','prev','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','LOCK','UPDATE','CmContact','CmCompany','Company','Queue','dialActive','getPreviewRecall','findOne','scheduledat','Contact','CmList','List','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','moment','lodash','../../config/logger','api','../../mysqldb','json','offset','undefined','count','limit','set','Content-Range','then','sendStatus','stack','status','send','index','map','CmHopper','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','$and','$or','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','update','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x21ed2e,_0x2253c2){var _0x31317f=function(_0x9fb06b){while(--_0x9fb06b){_0x21ed2e['push'](_0x21ed2e['shift']());}};_0x31317f(++_0x2253c2);}(_0xc33b,0xa9));var _0xbc33=function(_0x171be1,_0x1dc48f){_0x171be1=_0x171be1-0x0;var _0xf4cc2=_0xc33b[_0x171be1];return _0xf4cc2;};'use strict';var moment=require(_0xbc33('0x0'));var _=require(_0xbc33('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xbc33('0x2'))(_0xbc33('0x3'));var shared=require('../../config/environment');var db=require(_0xbc33('0x4'))['db'];function respondWithResult(_0x2b2009,_0x3bbc3d){_0x3bbc3d=_0x3bbc3d||0xc8;return function(_0xc2e86b){if(_0xc2e86b){return _0x2b2009['status'](_0x3bbc3d)[_0xbc33('0x5')](_0xc2e86b);}};}function respondWithFilteredResult(_0xa515a6,_0x4db2db){return function(_0xba427){if(_0xba427){var _0x73b42=typeof _0x4db2db[_0xbc33('0x6')]===_0xbc33('0x7')&&typeof _0x4db2db['limit']===_0xbc33('0x7');var _0x1d9e5a=_0xba427[_0xbc33('0x8')];var _0x4f9056=_0x73b42?0x0:_0x4db2db[_0xbc33('0x6')];var _0x3ee9d6=_0x73b42?_0xba427['count']:_0x4db2db[_0xbc33('0x6')]+_0x4db2db[_0xbc33('0x9')];var _0x2525b1;if(_0x3ee9d6>=_0x1d9e5a){_0x3ee9d6=_0x1d9e5a;_0x2525b1=0xc8;}else{_0x2525b1=0xce;}_0xa515a6['status'](_0x2525b1);return _0xa515a6[_0xbc33('0xa')](_0xbc33('0xb'),_0x4f9056+'-'+_0x3ee9d6+'/'+_0x1d9e5a)[_0xbc33('0x5')](_0xba427);}return null;};}function saveUpdates(_0x382534,_0x5e96aa){return function(_0x2aeb7a){if(_0x2aeb7a){return _0x2aeb7a['update'](_0x382534)[_0xbc33('0xc')](function(_0x53ca45){return _0x53ca45;});}return null;};}function handleEntityNotFound(_0x5f3a57,_0x1bfdcc){return function(_0x1c28c5){if(!_0x1c28c5){_0x5f3a57[_0xbc33('0xd')](0x194);}return _0x1c28c5;};}function handleError(_0x368c0a,_0x49812a){_0x49812a=_0x49812a||0x1f4;return function(_0x152bb3){logger['error'](_0x152bb3[_0xbc33('0xe')]);if(_0x152bb3['name']){delete _0x152bb3['name'];}_0x368c0a[_0xbc33('0xf')](_0x49812a)[_0xbc33('0x10')](_0x152bb3);};}exports[_0xbc33('0x11')]=function(_0x42c5d2,_0x44d9c4){var _0x23d321={},_0xbf809f={},_0x46c96b={'count':0x0,'rows':[]};var _0x302b59=_[_0xbc33('0x12')](db[_0xbc33('0x13')][_0xbc33('0x14')],function(_0x168aac){return{'name':_0x168aac[_0xbc33('0x15')],'type':_0x168aac['type'][_0xbc33('0x16')]};});_0xbf809f[_0xbc33('0x17')]=_[_0xbc33('0x12')](_0x302b59,_0xbc33('0x18'));_0xbf809f[_0xbc33('0x19')]=_[_0xbc33('0x1a')](_0x42c5d2[_0xbc33('0x19')]);_0xbf809f[_0xbc33('0x1b')]=_[_0xbc33('0x1c')](_0xbf809f[_0xbc33('0x17')],_0xbf809f[_0xbc33('0x19')]);_0xbf809f[_0xbc33('0x1b')]=_['concat'](_0xbf809f['filters'],[_0xbc33('0x1d'),_0xbc33('0x1e'),'$gt','$gte','$lt',_0xbc33('0x1f'),_0xbc33('0x20'),_0xbc33('0x21'),_0xbc33('0x22'),_0xbc33('0x23'),_0xbc33('0x24'),_0xbc33('0x25'),_0xbc33('0x26'),_0xbc33('0x27'),_0xbc33('0x28'),_0xbc33('0x29'),_0xbc33('0x2a'),_0xbc33('0x27'),'$overlap',_0xbc33('0x2b'),_0xbc33('0x2c'),_0xbc33('0x2d')]);_0x23d321['attributes']=_[_0xbc33('0x1c')](_0xbf809f['model'],qs[_0xbc33('0x2e')](_0x42c5d2[_0xbc33('0x19')][_0xbc33('0x2e')]));_0x23d321[_0xbc33('0x2f')]=_0x23d321[_0xbc33('0x2f')][_0xbc33('0x30')]?_0x23d321[_0xbc33('0x2f')]:_0xbf809f[_0xbc33('0x17')];if(!_0x42c5d2[_0xbc33('0x19')][_0xbc33('0x31')]('nolimit')){_0x23d321[_0xbc33('0x9')]=qs[_0xbc33('0x9')](_0x42c5d2[_0xbc33('0x19')][_0xbc33('0x9')]);_0x23d321['offset']=qs['offset'](_0x42c5d2['query'][_0xbc33('0x6')]);}_0x23d321['order']=qs[_0xbc33('0x32')](_0x42c5d2[_0xbc33('0x19')][_0xbc33('0x32')]);_0x23d321[_0xbc33('0x33')]=qs[_0xbc33('0x1b')](_[_0xbc33('0x34')](_0x42c5d2[_0xbc33('0x19')],_0xbf809f['filters']),_0x302b59);if(_0x42c5d2[_0xbc33('0x19')][_0xbc33('0x35')]){_0x23d321['where']=_[_0xbc33('0x36')](_0x23d321[_0xbc33('0x33')],{'$or':_['map'](_0x302b59,function(_0x35f501){if(_0x35f501[_0xbc33('0x37')]!==_0xbc33('0x38')){var _0x1f8790={};_0x1f8790[_0x35f501[_0xbc33('0x18')]]={'$like':'%'+_0x42c5d2[_0xbc33('0x19')][_0xbc33('0x35')]+'%'};return _0x1f8790;}})});}_0x23d321=_[_0xbc33('0x36')]({},_0x23d321,_0x42c5d2['options']);var _0x4eef4b={'where':_0x23d321[_0xbc33('0x33')]};return db[_0xbc33('0x13')][_0xbc33('0x8')](_0x4eef4b)[_0xbc33('0xc')](function(_0x3fa0dc){_0x46c96b[_0xbc33('0x8')]=_0x3fa0dc;if(_0x42c5d2['query'][_0xbc33('0x39')]){_0x23d321[_0xbc33('0x3a')]=[{'all':!![]}];}return db[_0xbc33('0x13')][_0xbc33('0x3b')](_0x23d321);})['then'](function(_0x59705a){_0x46c96b[_0xbc33('0x3c')]=_0x59705a;return _0x46c96b;})[_0xbc33('0xc')](respondWithFilteredResult(_0x44d9c4,_0x23d321))[_0xbc33('0x3d')](handleError(_0x44d9c4,null));};exports[_0xbc33('0x3e')]=function(_0x20b2ef,_0x4b7085){var _0x51a698={'raw':!![],'where':{'id':_0x20b2ef[_0xbc33('0x3f')]['id']}},_0x4da2e6={};_0x4da2e6[_0xbc33('0x17')]=_[_0xbc33('0x1a')](db['CmHopper'][_0xbc33('0x14')]);_0x4da2e6[_0xbc33('0x19')]=_[_0xbc33('0x1a')](_0x20b2ef[_0xbc33('0x19')]);_0x4da2e6['filters']=_[_0xbc33('0x1c')](_0x4da2e6[_0xbc33('0x17')],_0x4da2e6[_0xbc33('0x19')]);_0x51a698[_0xbc33('0x2f')]=_[_0xbc33('0x1c')](_0x4da2e6[_0xbc33('0x17')],qs[_0xbc33('0x2e')](_0x20b2ef[_0xbc33('0x19')]['fields']));_0x51a698['attributes']=_0x51a698[_0xbc33('0x2f')][_0xbc33('0x30')]?_0x51a698[_0xbc33('0x2f')]:_0x4da2e6['model'];if(_0x20b2ef[_0xbc33('0x19')][_0xbc33('0x39')]){_0x51a698[_0xbc33('0x3a')]=[{'all':!![]}];}_0x51a698=_[_0xbc33('0x36')]({},_0x51a698,_0x20b2ef[_0xbc33('0x40')]);return db[_0xbc33('0x13')][_0xbc33('0x41')](_0x51a698)[_0xbc33('0xc')](handleEntityNotFound(_0x4b7085,null))[_0xbc33('0xc')](respondWithResult(_0x4b7085,null))[_0xbc33('0x3d')](handleError(_0x4b7085,null));};exports[_0xbc33('0x42')]=function(_0x3c54fc,_0x45977c){return db['CmHopper'][_0xbc33('0x42')](_0x3c54fc['body'],{})[_0xbc33('0xc')](respondWithResult(_0x45977c,0xc9))[_0xbc33('0x3d')](handleError(_0x45977c,null));};exports[_0xbc33('0x43')]=function(_0x2cd15e,_0x2485c6){if(_0x2cd15e['body']['id']){delete _0x2cd15e[_0xbc33('0x44')]['id'];}return db[_0xbc33('0x13')]['find']({'where':{'id':_0x2cd15e[_0xbc33('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2485c6,null))[_0xbc33('0xc')](saveUpdates(_0x2cd15e[_0xbc33('0x44')],null))[_0xbc33('0xc')](respondWithResult(_0x2485c6,null))['catch'](handleError(_0x2485c6,null));};exports[_0xbc33('0x45')]=function(_0x49f0df,_0x3baab8){return db[_0xbc33('0x13')]['describe']()[_0xbc33('0xc')](respondWithResult(_0x3baab8,null))[_0xbc33('0x3d')](handleError(_0x3baab8,null));};exports[_0xbc33('0x46')]=function(_0xa43cdc,_0x2f3168){var _0x44bec2;return db['CmHopper'][_0xbc33('0x41')]({'where':{'id':_0xa43cdc['params']['id']}})['then'](handleEntityNotFound(_0x2f3168,null))[_0xbc33('0xc')](function(_0x160fb8){if(_0x160fb8){return _0x160fb8[_0xbc33('0x46')]()[_0xbc33('0xc')](function(_0x4f7654){return _0x4f7654;});}})[_0xbc33('0xc')](function(_0x5c39b1){_0x44bec2=_0x5c39b1;if(_0x5c39b1){if(_0x5c39b1[_0xbc33('0x47')]||_0x5c39b1[_0xbc33('0x48')]){return db[_0x5c39b1[_0xbc33('0x47')]?_0xbc33('0x49'):_0xbc33('0x4a')][_0xbc33('0x41')]({'where':{'id':_0x5c39b1[_0xbc33('0x47')]?_0x5c39b1[_0xbc33('0x47')]:_0x5c39b1[_0xbc33('0x48')]},'attributes':['id',_0xbc33('0x18')],'raw':!![]});}}})[_0xbc33('0xc')](function(_0x3bbc46){var _0xd9da42={};if(_0x3bbc46){_[_0xbc33('0x36')](_0xd9da42,_[_0xbc33('0x4b')](_0x44bec2[_0xbc33('0x4c')],['createdAt',_0xbc33('0x4d'),'id']));_0xd9da42[_0xbc33('0x4e')]=0x15;_0xd9da42['statedesc']=_0xbc33('0x4f');_0xd9da42[_0xbc33('0x50')]=_0x3bbc46[_0xbc33('0x18')];_0xd9da42[_0xbc33('0x51')]=_0xa43cdc[_0xbc33('0x52')][_0xbc33('0x18')];_0xd9da42[_0xbc33('0x53')]=_0xa43cdc['user']['id'];_0xd9da42[_0xbc33('0x4f')]=!![];_0xd9da42[_0xbc33('0x54')]=moment()[_0xbc33('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0xd9da42[_0xbc33('0x56')]=_0x44bec2[_0xbc33('0x57')];_0xd9da42['campaigntype']=_0x44bec2[_0xbc33('0x47')]?_0xbc33('0x58'):_0xbc33('0x59');return db['CmContact']['find']({'where':{'id':_0xd9da42[_0xbc33('0x5a')]},'attributes':[_0xbc33('0x5b'),_0xbc33('0x5c')]})[_0xbc33('0xc')](function(_0x4405e8){if(!_[_0xbc33('0x5d')](_0x2f3168)&&!_[_0xbc33('0x5d')](_0x4405e8[_0xbc33('0x5b')])){_0xd9da42['calleridname']=_0x4405e8[_0xbc33('0x5b')];if(!_[_0xbc33('0x5d')](_0x4405e8[_0xbc33('0x5c')])){_0xd9da42[_0xbc33('0x5e')]+='\x20'+_0x4405e8[_0xbc33('0x5c')];}}})[_0xbc33('0x5f')](function(){return db[_0xbc33('0x60')][_0xbc33('0x42')](_0xd9da42);});}})[_0xbc33('0xc')](function(){return _0x2f3168[_0xbc33('0xf')](0xcc)[_0xbc33('0x61')]();})[_0xbc33('0x3d')](handleError(_0x2f3168,null));};exports['getPreview']=function(_0x5e70ba,_0x2e3580){var _0x598a85=[];return db['CmContact'][_0xbc33('0x45')]()[_0xbc33('0xc')](function(_0x55d745){_0x598a85=_[_0xbc33('0x1a')](_0x55d745);return _0x5e70ba['user'][_0xbc33('0x62')]({'where':{'type':_0xbc33('0x63'),'dialActive':!![],'dialMethod':_0xbc33('0x64')},'attributes':['id',_0xbc33('0x65'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0xbc33('0xc')](function(_0x25f766){if(_0x25f766&&_0x25f766[_0xbc33('0x30')]){return db[_0xbc33('0x66')][_0xbc33('0x67')](function(_0x343beb){var _0x2549b4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbc33('0x55')](_0xbc33('0x68'))},'VoiceQueueId':{'$in':_[_0xbc33('0x12')](_0x25f766,'id')},'$or':[{'UserId':null},{'UserId':_0x5e70ba[_0xbc33('0x52')]['id']}]};var _0x3c34f7={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x25f766)[_0xbc33('0x35')](['dialPreviewAutoRecallMe',0x0])[_0xbc33('0x12')]('id')[_0xbc33('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x5e70ba['user']['id']}]};var _0x36a5a8={'$or':[_0x2549b4,_0x3c34f7]};var _0x31c94f=[];if(_0x5e70ba[_0xbc33('0x44')][_0xbc33('0x6a')]&&_0x5e70ba[_0xbc33('0x44')][_0xbc33('0x6a')]===_0xbc33('0x6b')){if(!_['isEmpty'](_0x5e70ba[_0xbc33('0x44')][_0xbc33('0x6c')])){_0x36a5a8['id']={'$in':_0x5e70ba['body']['hopperIds']};}_0x31c94f=[[_0xbc33('0x6d'),_0xbc33('0x6e')],['scheduledAt',_0x25f766[0x0][_0xbc33('0x65')]===_0xbc33('0x6e')?_0xbc33('0x6f'):_0xbc33('0x6e')],db[_0xbc33('0x66')][_0xbc33('0x70')](_0xbc33('0x71')),['id',_0xbc33('0x6f')]];}else{if(!_[_0xbc33('0x72')](_0x5e70ba['body']['hopperIds'])){_0x36a5a8['id']={'$notIn':_0x5e70ba[_0xbc33('0x44')][_0xbc33('0x6c')]};}_0x31c94f=[['priority',_0xbc33('0x6f')],['scheduledAt',_0x25f766[0x0][_0xbc33('0x65')]],db[_0xbc33('0x66')][_0xbc33('0x70')](_0xbc33('0x73')),['id','ASC']];}return db['CmHopper']['findOne']({'attributes':['id','scheduledat',_0xbc33('0x74')],'where':_0x36a5a8,'order':_0x31c94f,'transaction':_0x343beb,'lock':_0x343beb[_0xbc33('0x75')][_0xbc33('0x76')],'include':[{'model':db[_0xbc33('0x77')],'as':'Contact','attributes':_0x598a85,'include':[{'model':db[_0xbc33('0x78')],'as':_0xbc33('0x79'),'attributes':['id','name']}]},{'model':db['CmList'],'as':'List','attributes':['id',_0xbc33('0x18')]},{'model':db[_0xbc33('0x49')],'as':_0xbc33('0x7a'),'attributes':['id',_0xbc33('0x18'),_0xbc33('0x7b')]}]})['then'](function(_0x12a8ef){if(_0x12a8ef){return _0x12a8ef[_0xbc33('0x43')]({'UserId':_0x5e70ba[_0xbc33('0x52')]['id']},{'transaction':_0x343beb});}});});}})[_0xbc33('0xc')](handleEntityNotFound(_0x2e3580,null))['then'](respondWithResult(_0x2e3580,null))[_0xbc33('0x3d')](handleError(_0x2e3580,null));};exports[_0xbc33('0x7c')]=function(_0x3c1979,_0x3694cd,_0x56e06e){var _0x1e2dab=[];var _0x34ca57=_0x3c1979[_0xbc33('0x3f')]['id'];var _0x4331cd=_0x3c1979['user']['id'];return db['CmContact'][_0xbc33('0x45')]()[_0xbc33('0xc')](function(_0x37d7a1){_0x1e2dab=_[_0xbc33('0x1a')](_0x37d7a1);return db['sequelize'][_0xbc33('0x67')](function(_0x1e75d4){const _0x11c1de={'id':_0x34ca57};return db[_0xbc33('0x13')][_0xbc33('0x7d')]({'attributes':['id',_0xbc33('0x7e'),'recallme'],'where':_0x11c1de,'transaction':_0x1e75d4,'lock':_0x1e75d4['LOCK'][_0xbc33('0x76')],'include':[{'model':db[_0xbc33('0x77')],'as':_0xbc33('0x7f'),'attributes':_0x1e2dab,'include':[{'model':db[_0xbc33('0x78')],'as':'Company','attributes':['id',_0xbc33('0x18')]}]},{'model':db[_0xbc33('0x80')],'as':_0xbc33('0x81'),'attributes':['id',_0xbc33('0x18')]},{'model':db[_0xbc33('0x49')],'as':_0xbc33('0x7a'),'attributes':['id',_0xbc33('0x18'),_0xbc33('0x7b')]}]})[_0xbc33('0xc')](function(_0x3024ea){if(_0x3024ea){return _0x3024ea['update']({'UserId':_0x4331cd},{'transaction':_0x1e75d4});}});});})[_0xbc33('0xc')](handleEntityNotFound(_0x3694cd,null))['then'](respondWithResult(_0x3694cd,null))[_0xbc33('0x3d')](handleError(_0x3694cd,null));};exports['getOpenContacts']=function(_0xa89dc3,_0x4e8195){return _0xa89dc3[_0xbc33('0x52')]['getVoiceQueues']({'where':{'type':_0xbc33('0x63'),'dialActive':!![],'dialMethod':_0xbc33('0x64')},'attributes':['id'],'raw':!![]})[_0xbc33('0xc')](function(_0x2dea95){if(_0x2dea95&&_0x2dea95[_0xbc33('0x30')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbc33('0x55')](_0xbc33('0x68'))},'VoiceQueueId':{'$in':_[_0xbc33('0x12')](_0x2dea95,'id')},'$or':[{'UserId':null},{'UserId':_0xa89dc3[_0xbc33('0x52')]['id']}]}});}return 0x0;})[_0xbc33('0xc')](function(_0x1e0e6b){if(!_[_0xbc33('0x5d')](_0x1e0e6b)&&_[_0xbc33('0x82')](_0x1e0e6b)){return _0x4e8195[_0xbc33('0xf')](0xc8)[_0xbc33('0x5')]({'contacts':_0x1e0e6b});}else{logger[_0xbc33('0x83')](_0xbc33('0x84'),'getOpenContacts',0x194,_0xbc33('0x85'));_0x4e8195[_0xbc33('0xd')](0x194);}})['catch'](handleError(_0x4e8195,null));};exports[_0xbc33('0x86')]=function(_0x2f4010,_0x358dc1){var _0x1280d8=shared[_0xbc33('0x87')];var _0x543599=[];_[_0xbc33('0x12')](_0x1280d8,function(_0x469e50){_0x543599['push']({'id':_0x469e50[_0xbc33('0x18')],'name':_0x469e50[_0xbc33('0x18')],'utcOffset':_0x469e50[_0xbc33('0x88')]});});return _0x358dc1['status'](0xc8)['json']({'tz':_0x543599});};exports['getTimezone']=function(_0x5468bd,_0x56e64c){var _0x5fd98a=shared['timezones'];var _0x59be88={};if(!_[_0xbc33('0x5d')](_0x5fd98a[_0x5468bd[_0xbc33('0x44')]['id']]))_0x59be88=_0x5fd98a[_0x5468bd[_0xbc33('0x44')]['id']];return _0x56e64c[_0xbc33('0xf')](0xc8)[_0xbc33('0x5')](_0x59be88);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index ae1f82d..65d7a47 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 _0x1261=['path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x12686e,_0x1f678e){var _0x37d436=function(_0x1cdd69){while(--_0x1cdd69){_0x12686e['push'](_0x12686e['shift']());}};_0x37d436(++_0x1f678e);}(_0x1261,0x144));var _0x1126=function(_0x1b62b8,_0x3e78d9){_0x1b62b8=_0x1b62b8-0x0;var _0x47a5a0=_0x1261[_0x1b62b8];return _0x47a5a0;};'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')]('CmHopper',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]},{'name':_0x1126('0xd'),'fields':[_0x1126('0xd')]},{'name':'priority','fields':[_0x1126('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x457113,_0x50a8ac){var _0xe622c6=function(_0xe1a469){while(--_0xe1a469){_0x457113['push'](_0x457113['shift']());}};_0xe622c6(++_0x50a8ac);}(_0x5fab,0x177));var _0xb5fa=function(_0x39ff9c,_0x35d13a){_0x39ff9c=_0x39ff9c-0x0;var _0x4ff2d2=_0x5fab[_0x39ff9c];return _0x4ff2d2;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['scheduledat']},{'name':_0xb5fa('0xe'),'fields':[_0xb5fa('0xe')]},{'name':_0xb5fa('0xf'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 1c2b17e..e5409aa 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 _0x0e1f=['attributes','map','include','model','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','sequelize','order','LOCK','UPDATE','CmContact','Contact','keys','User','Agent','name','voicePause','push','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','transaction','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','describe','UserId','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','NOW()','CmList','CmHopperHandlePreviewRecallNotifications','lodash','util','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','raw','options','where'];(function(_0x557bb4,_0x5d4488){var _0x265213=function(_0x1dd490){while(--_0x1dd490){_0x557bb4['push'](_0x557bb4['shift']());}};_0x265213(++_0x5d4488);}(_0x0e1f,0x186));var _0xf0e1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x0e1f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xf0e1('0x0'));var util=require(_0xf0e1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var db=require(_0xf0e1('0x2'))['db'];var logger=require(_0xf0e1('0x3'))(_0xf0e1('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xf0e1('0x5')][_0xf0e1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a5574,_0x577426,_0x30d6ca){return new BPromise(function(_0x530b5c,_0x1860db){return client[_0xf0e1('0x7')](_0x5a5574,_0x30d6ca)[_0xf0e1('0x8')](function(_0x5a64e2){logger[_0xf0e1('0x9')](_0xf0e1('0xa'),_0x577426,_0xf0e1('0xb'));logger[_0xf0e1('0xc')](_0xf0e1('0xd'),_0x577426,_0xf0e1('0xb'),JSON[_0xf0e1('0xe')](_0x5a64e2));if(_0x5a64e2[_0xf0e1('0xf')]){if(_0x5a64e2[_0xf0e1('0xf')][_0xf0e1('0x10')]===0x1f4){logger['error'](_0xf0e1('0xa'),_0x577426,_0x5a64e2[_0xf0e1('0xf')][_0xf0e1('0x11')]);return _0x1860db(_0x5a64e2[_0xf0e1('0xf')][_0xf0e1('0x11')]);}logger[_0xf0e1('0xf')](_0xf0e1('0xa'),_0x577426,_0x5a64e2[_0xf0e1('0xf')][_0xf0e1('0x11')]);return _0x530b5c(_0x5a64e2['error'][_0xf0e1('0x11')]);}else{logger['info'](_0xf0e1('0xa'),_0x577426,_0xf0e1('0xb'));_0x530b5c(_0x5a64e2['result'][_0xf0e1('0x11')]);}})[_0xf0e1('0x12')](function(_0x58df25){logger['error']('CmHopper,\x20%s,\x20%s',_0x577426,_0x58df25);_0x1860db(_0x58df25);});});}exports[_0xf0e1('0x13')]=function(_0x3caa3d){var _0x48bad2=this;return new Promise(function(_0xb34c9f,_0x2fb264){return db[_0xf0e1('0x14')][_0xf0e1('0x15')]({'raw':_0x3caa3d['options']?_0x3caa3d['options'][_0xf0e1('0x16')]===undefined?!![]:![]:!![],'where':_0x3caa3d[_0xf0e1('0x17')]?_0x3caa3d[_0xf0e1('0x17')][_0xf0e1('0x18')]||null:null,'attributes':_0x3caa3d[_0xf0e1('0x17')]?_0x3caa3d[_0xf0e1('0x17')][_0xf0e1('0x19')]||null:null,'limit':_0x3caa3d[_0xf0e1('0x17')]?_0x3caa3d['options']['limit']||null:null,'include':_0x3caa3d['options']?_0x3caa3d['options']['include']?_[_0xf0e1('0x1a')](_0x3caa3d[_0xf0e1('0x17')][_0xf0e1('0x1b')],function(_0x4e620f){return{'model':db[_0x4e620f[_0xf0e1('0x1c')]],'as':_0x4e620f['as'],'attributes':_0x4e620f[_0xf0e1('0x19')],'include':_0x4e620f['include']?_[_0xf0e1('0x1a')](_0x4e620f['include'],function(_0x27c0d6){return{'model':db[_0x27c0d6[_0xf0e1('0x1c')]],'as':_0x27c0d6['as'],'attributes':_0x27c0d6[_0xf0e1('0x19')],'include':_0x27c0d6[_0xf0e1('0x1b')]?_['map'](_0x27c0d6['include'],function(_0x484aa1){return{'model':db[_0x484aa1[_0xf0e1('0x1c')]],'as':_0x484aa1['as'],'attributes':_0x484aa1[_0xf0e1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf0e1('0x8')](function(_0x99efb4){logger[_0xf0e1('0x9')](_0xf0e1('0x13'),_0x3caa3d);logger[_0xf0e1('0xc')](_0xf0e1('0x13'),_0x3caa3d,JSON['stringify'](_0x99efb4));_0xb34c9f(_0x99efb4);})[_0xf0e1('0x12')](function(_0x409318){logger['error'](_0xf0e1('0x13'),_0x409318[_0xf0e1('0x11')],_0x3caa3d);_0x2fb264(_0x48bad2[_0xf0e1('0xf')](0x1f4,_0x409318['message']));});});};exports[_0xf0e1('0x1d')]=function(_0x32067a){var _0x3ba271=this;return new Promise(function(_0x19cf34,_0x428f71){return db['CmHopper'][_0xf0e1('0x1e')]({'raw':_0x32067a['options']?_0x32067a['options']['raw']===undefined?!![]:![]:!![],'where':_0x32067a[_0xf0e1('0x17')]?_0x32067a[_0xf0e1('0x17')][_0xf0e1('0x18')]||null:null,'attributes':_0x32067a['options']?_0x32067a[_0xf0e1('0x17')][_0xf0e1('0x19')]||null:null,'include':_0x32067a[_0xf0e1('0x17')]?_0x32067a[_0xf0e1('0x17')]['include']?_[_0xf0e1('0x1a')](_0x32067a[_0xf0e1('0x17')]['include'],function(_0x13ebd1){return{'model':db[_0x13ebd1[_0xf0e1('0x1c')]],'as':_0x13ebd1['as'],'attributes':_0x13ebd1[_0xf0e1('0x19')],'include':_0x13ebd1['include']?_[_0xf0e1('0x1a')](_0x13ebd1[_0xf0e1('0x1b')],function(_0x39729a){return{'model':db[_0x39729a[_0xf0e1('0x1c')]],'as':_0x39729a['as'],'attributes':_0x39729a[_0xf0e1('0x19')],'include':_0x39729a[_0xf0e1('0x1b')]?_['map'](_0x39729a[_0xf0e1('0x1b')],function(_0x38f235){return{'model':db[_0x38f235[_0xf0e1('0x1c')]],'as':_0x38f235['as'],'attributes':_0x38f235[_0xf0e1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1311a7){logger[_0xf0e1('0x9')](_0xf0e1('0x1d'),_0x32067a);logger[_0xf0e1('0xc')](_0xf0e1('0x1d'),_0x32067a,JSON[_0xf0e1('0xe')](_0x1311a7));_0x19cf34(_0x1311a7);})[_0xf0e1('0x12')](function(_0x4b6051){logger[_0xf0e1('0xf')](_0xf0e1('0x1d'),_0x4b6051[_0xf0e1('0x11')],_0x32067a);_0x428f71(_0x3ba271[_0xf0e1('0xf')](0x1f4,_0x4b6051['message']));});});};exports[_0xf0e1('0x1f')]=function(_0x47462e){var _0xfca3c6=this;return new Promise(function(_0x21bef2,_0x45ec21){return db[_0xf0e1('0x14')][_0xf0e1('0x20')](_0x47462e[_0xf0e1('0x21')],{'raw':_0x47462e[_0xf0e1('0x17')]?_0x47462e[_0xf0e1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xf0e1('0x8')](function(_0x54b1bc){logger[_0xf0e1('0x9')]('CreateCmHopper',_0x47462e);logger['debug'](_0xf0e1('0x1f'),_0x47462e,JSON['stringify'](_0x54b1bc));_0x21bef2(_0x54b1bc);})[_0xf0e1('0x12')](function(_0x3acd0f){logger['error']('CreateCmHopper',_0x3acd0f[_0xf0e1('0x11')],_0x47462e);_0x45ec21(_0xfca3c6[_0xf0e1('0xf')](0x1f4,_0x3acd0f['message']));});});};exports[_0xf0e1('0x22')]=function(_0x4e122c){var _0x4df2aa=this;return new Promise(function(_0x50f919,_0xc29955){return db[_0xf0e1('0x14')][_0xf0e1('0x23')](_0x4e122c[_0xf0e1('0x21')],{'raw':_0x4e122c[_0xf0e1('0x17')]?_0x4e122c[_0xf0e1('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e122c['options']?_0x4e122c[_0xf0e1('0x17')]['where']||null:null,'attributes':_0x4e122c[_0xf0e1('0x17')]?_0x4e122c['options'][_0xf0e1('0x19')]||null:null,'limit':_0x4e122c[_0xf0e1('0x17')]?_0x4e122c[_0xf0e1('0x17')][_0xf0e1('0x24')]||null:null})[_0xf0e1('0x8')](function(_0x3ddb53){logger['info']('UpdateCmHopper',_0x4e122c);logger['info'](_0xf0e1('0x25'),JSON[_0xf0e1('0xe')](_0x4e122c[_0xf0e1('0x17')][_0xf0e1('0x18')]),_0x4e122c[_0xf0e1('0x21')][_0xf0e1('0x26')]);logger[_0xf0e1('0xc')]('UpdateCmHopper',_0x4e122c,JSON['stringify'](_0x3ddb53));_0x50f919(_0x3ddb53);})[_0xf0e1('0x12')](function(_0xd94100){logger[_0xf0e1('0xf')](_0xf0e1('0x22'),_0xd94100[_0xf0e1('0x11')],_0x4e122c);_0xc29955(_0x4df2aa[_0xf0e1('0xf')](0x1f4,_0xd94100[_0xf0e1('0x11')]));});});};exports[_0xf0e1('0x27')]=function(_0x52cc72){var _0x35c889=this;return new Promise(function(_0x4f5334,_0x87c38e){return db[_0xf0e1('0x14')][_0xf0e1('0x28')]({'where':_0x52cc72['options']?_0x52cc72[_0xf0e1('0x17')][_0xf0e1('0x18')]||null:null})[_0xf0e1('0x8')](function(_0x1849a2){logger[_0xf0e1('0x9')](_0xf0e1('0x27'),_0x52cc72);logger['debug'](_0xf0e1('0x27'),_0x52cc72,JSON[_0xf0e1('0xe')](_0x1849a2));_0x4f5334(_0x1849a2);})[_0xf0e1('0x12')](function(_0x35df7d){logger[_0xf0e1('0xf')](_0xf0e1('0x27'),_0x35df7d[_0xf0e1('0x11')],_0x52cc72);_0x87c38e(_0x35c889[_0xf0e1('0xf')](0x1f4,_0x35df7d[_0xf0e1('0x11')]));});});};exports[_0xf0e1('0x29')]=function(_0x321776){var _0x5de726=this;return new Promise(function(_0x248d9b,_0x57899d){return db['CmContact']['describe']()[_0xf0e1('0x8')](function(_0x4dd49a){return db[_0xf0e1('0x2a')]['transaction'](function(_0x27aef7){return db['CmHopper']['findAll']({'where':_0x321776[_0xf0e1('0x17')]?_0x321776['options'][_0xf0e1('0x18')]||null:null,'attributes':_0x321776['options']?_0x321776['options'][_0xf0e1('0x19')]||null:null,'limit':_0x321776[_0xf0e1('0x17')]?_0x321776[_0xf0e1('0x17')][_0xf0e1('0x24')]||null:null,'order':_0x321776['options']?_0x321776[_0xf0e1('0x17')][_0xf0e1('0x2b')]||null:null,'transaction':_0x27aef7,'lock':_0x27aef7[_0xf0e1('0x2c')][_0xf0e1('0x2d')],'include':[{'model':db[_0xf0e1('0x2e')],'as':_0xf0e1('0x2f'),'attributes':_[_0xf0e1('0x30')](_0x4dd49a)},{'model':db[_0xf0e1('0x31')],'as':_0xf0e1('0x32'),'attributes':['id',_0xf0e1('0x33'),_0xf0e1('0x34')]}]})['then'](function(_0x2db1dd){var _0x50d030=[];var _0x3e61ce=[];for(var _0x1dcc54=0x0;_0x1dcc54<_0x2db1dd['length'];_0x1dcc54+=0x1){var _0x48ae5b=_0x2db1dd[_0x1dcc54]['UserId'];if(_0x48ae5b===null){_0x50d030['push'](_0x2db1dd[_0x1dcc54][_0xf0e1('0x23')](_0x321776['body'],{'transaction':_0x27aef7}));}else if(!_0x3e61ce['includes'](_0x48ae5b)){_0x3e61ce['push'](_0x48ae5b);_0x50d030[_0xf0e1('0x35')](_0x2db1dd[_0x1dcc54][_0xf0e1('0x23')](_0x321776['body'],{'transaction':_0x27aef7}));}}return BPromise[_0xf0e1('0x36')](_0x50d030);});})[_0xf0e1('0x8')](function(_0x3d4f2c){logger['info']('GetContactDialer',_0x321776);if(_0x3d4f2c[_0xf0e1('0x37')]>0x0){logger['info'](_0xf0e1('0x38'),_0x3d4f2c[0x0][_0xf0e1('0x39')]['id'],_0x3d4f2c[0x0][_0xf0e1('0x39')][_0xf0e1('0x3a')],_0x3d4f2c[0x0][_0xf0e1('0x39')][_0xf0e1('0x26')]);}logger[_0xf0e1('0xc')](_0xf0e1('0x29'),_0x321776,JSON['stringify'](_0x3d4f2c));_0x248d9b(_0x3d4f2c);})[_0xf0e1('0x12')](function(_0xffdb80){logger['error'](_0xf0e1('0x29'),_0xffdb80['message'],_0x321776);_0x57899d(_0x5de726['error'](0x1f4,_0xffdb80['message']));});});});};exports[_0xf0e1('0x3b')]=function(_0x3a8618){var _0x37805d=this;return new Promise(function(_0x285761,_0x11b075){return db[_0xf0e1('0x2a')][_0xf0e1('0x3c')](function(_0x4a7070){return db['CmHopperFinal'][_0xf0e1('0x20')](_0x3a8618[_0xf0e1('0x21')],{'raw':_0x3a8618['options']?_0x3a8618[_0xf0e1('0x17')][_0xf0e1('0x16')]===undefined?!![]:![]:!![],'transaction':_0x4a7070})[_0xf0e1('0x8')](function(){logger[_0xf0e1('0x9')](_0xf0e1('0x3d'),JSON['stringify'](_0x3a8618['options'][_0xf0e1('0x18')]),_0x3a8618[_0xf0e1('0x17')]['where'][_0xf0e1('0x26')]);return db[_0xf0e1('0x14')][_0xf0e1('0x28')]({'where':_0x3a8618[_0xf0e1('0x17')]?_0x3a8618[_0xf0e1('0x17')][_0xf0e1('0x18')]||null:null,'transaction':_0x4a7070});});})[_0xf0e1('0x8')](function(_0xa15c98){logger['info'](_0xf0e1('0x3b'),_0x3a8618);logger[_0xf0e1('0xc')](_0xf0e1('0x3b'),_0x3a8618,JSON[_0xf0e1('0xe')](_0xa15c98));_0x285761(_0xa15c98);})['catch'](function(_0x555e6e){logger[_0xf0e1('0xf')]('MoveContactManagedDialer',_0x555e6e[_0xf0e1('0x11')],_0x3a8618);_0x11b075(_0x37805d[_0xf0e1('0xf')](0x1f4,_0x555e6e[_0xf0e1('0x11')]));});});};exports[_0xf0e1('0x3e')]=function(_0x56c0f6){var _0x389023=this;return new Promise(function(_0x2766d5,_0x23f61c){return db['CmHopper'][_0xf0e1('0x15')]({'raw':_0x56c0f6[_0xf0e1('0x17')]?_0x56c0f6[_0xf0e1('0x17')][_0xf0e1('0x16')]===undefined?!![]:![]:!![],'where':_0x56c0f6[_0xf0e1('0x17')]?_0x56c0f6['options']['where']||null:null,'attributes':[[db[_0xf0e1('0x2a')]['fn']('COUNT',db[_0xf0e1('0x2a')]['fn']('IF',db[_0xf0e1('0x2a')][_0xf0e1('0x3f')](_0xf0e1('0x40')+util[_0xf0e1('0x41')](_0xf0e1('0x42'),moment()[_0xf0e1('0x41')](_0xf0e1('0x43')))+'\x20,\x201,\x20null'))),_0xf0e1('0x44')]]})[_0xf0e1('0x8')](function(_0x24c709){logger['info'](_0xf0e1('0x3e'),_0x56c0f6);logger[_0xf0e1('0xc')](_0xf0e1('0x3e'),_0x56c0f6,JSON['stringify'](_0x24c709));_0x2766d5(_0x24c709);})[_0xf0e1('0x12')](function(_0x2a7b2c){logger[_0xf0e1('0xf')]('CountReScheduled',_0x2a7b2c[_0xf0e1('0x11')],_0x56c0f6);_0x23f61c(_0x389023[_0xf0e1('0xf')](0x1f4,_0x2a7b2c[_0xf0e1('0x11')]));});});};exports[_0xf0e1('0x45')]=function(_0x192bab){var _0x2fd807=this;return new Promise(function(_0x20d70e,_0xde4ee1){return db[_0xf0e1('0x2e')][_0xf0e1('0x46')]()['then'](function(_0x3c1db5){return db['sequelize']['transaction'](function(_0x45ed6c){return db[_0xf0e1('0x14')]['findAll']({'where':_0x192bab[_0xf0e1('0x17')]?_0x192bab[_0xf0e1('0x17')]['where']||null:null,'attributes':_0x192bab[_0xf0e1('0x17')]?_0x192bab[_0xf0e1('0x17')][_0xf0e1('0x19')]||null:null,'limit':0x1,'order':_0x192bab[_0xf0e1('0x17')]?_0x192bab[_0xf0e1('0x17')][_0xf0e1('0x2b')]||null:null,'group':db['CmHopper'][_0xf0e1('0x47')],'transaction':_0x45ed6c,'lock':_0x45ed6c[_0xf0e1('0x2c')]['UPDATE'],'include':_0x192bab[_0xf0e1('0x17')]?_0x192bab[_0xf0e1('0x17')][_0xf0e1('0x1b')]?_[_0xf0e1('0x1a')](_0x192bab[_0xf0e1('0x17')][_0xf0e1('0x1b')],function(_0x5cb21a){return{'model':db[_0x5cb21a[_0xf0e1('0x1c')]],'as':_0x5cb21a['as'],'attributes':_0x5cb21a[_0xf0e1('0x19')],'include':_0x5cb21a['include']?_[_0xf0e1('0x1a')](_0x5cb21a[_0xf0e1('0x1b')],function(_0x336db9){return{'model':db[_0x336db9['model']],'as':_0x336db9['as'],'attributes':_0x336db9[_0xf0e1('0x19')],'include':_0x336db9[_0xf0e1('0x1b')]?_[_0xf0e1('0x1a')](_0x336db9[_0xf0e1('0x1b')],function(_0x45c815){return{'model':db[_0x45c815[_0xf0e1('0x1c')]],'as':_0x45c815['as'],'attributes':_0x45c815['attributes']};}):[]};}):[]};}):[]:[]})[_0xf0e1('0x8')](function(_0x1453c3){var _0x2fb292=[];for(var _0x170533=0x0;_0x170533<_0x1453c3[_0xf0e1('0x37')];_0x170533+=0x1){_0x2fb292[_0xf0e1('0x35')](_0x1453c3[_0x170533][_0xf0e1('0x23')](_0x192bab[_0xf0e1('0x21')],{'transaction':_0x45ed6c}));}return BPromise[_0xf0e1('0x36')](_0x2fb292);});})[_0xf0e1('0x8')](function(_0x4feec1){logger['info'](_0xf0e1('0x45'),_0x192bab);logger[_0xf0e1('0xc')](_0xf0e1('0x45'),_0x192bab,JSON[_0xf0e1('0xe')](_0x4feec1));_0x20d70e(_0x4feec1);})[_0xf0e1('0x12')](function(_0x220515){logger['error']('GetContactRecallMe',_0x220515[_0xf0e1('0x11')],_0x192bab);_0xde4ee1(_0x2fd807['error'](0x1f4,_0x220515[_0xf0e1('0x11')]));});});});};exports['GetCmHopperPreview']=function(_0x52226b){var _0x17754c=this;return new Promise(function(_0x955d3,_0x2ed488){db[_0xf0e1('0x2e')][_0xf0e1('0x46')]()[_0xf0e1('0x8')](function(_0x522d16){return db[_0xf0e1('0x14')]['findAll']({'raw':_0x52226b[_0xf0e1('0x17')]?_0x52226b[_0xf0e1('0x17')][_0xf0e1('0x16')]===undefined?!![]:![]:!![],'where':_0x52226b[_0xf0e1('0x17')]?_0x52226b[_0xf0e1('0x17')][_0xf0e1('0x18')]||null:null,'attributes':_0x52226b[_0xf0e1('0x17')]?_0x52226b[_0xf0e1('0x17')][_0xf0e1('0x19')]||null:null,'limit':_0x52226b[_0xf0e1('0x17')]?_0x52226b[_0xf0e1('0x17')][_0xf0e1('0x24')]||null:null,'include':_0x52226b[_0xf0e1('0x17')]?_0x52226b[_0xf0e1('0x17')][_0xf0e1('0x1b')]?_['map'](_0x52226b['options'][_0xf0e1('0x1b')],function(_0xfc9f00){return{'model':db[_0xfc9f00[_0xf0e1('0x1c')]],'as':_0xfc9f00['as'],'attributes':_0xfc9f00['as']===_0xf0e1('0x2f')?_[_0xf0e1('0x30')](_0x522d16):_0xfc9f00[_0xf0e1('0x19')],'include':_0xfc9f00[_0xf0e1('0x1b')]?_['map'](_0xfc9f00[_0xf0e1('0x1b')],function(_0x32ab81){return{'model':db[_0x32ab81['model']],'as':_0x32ab81['as'],'attributes':_0x32ab81[_0xf0e1('0x19')],'include':_0x32ab81[_0xf0e1('0x1b')]?_[_0xf0e1('0x1a')](_0x32ab81['include'],function(_0x44bc88){return{'model':db[_0x44bc88[_0xf0e1('0x1c')]],'as':_0x44bc88['as'],'attributes':_0x44bc88[_0xf0e1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf0e1('0x8')](function(_0x57f7cf){logger[_0xf0e1('0x9')](_0xf0e1('0x13'),_0x52226b);logger[_0xf0e1('0xc')](_0xf0e1('0x13'),_0x52226b,JSON[_0xf0e1('0xe')](_0x57f7cf));_0x955d3(_0x57f7cf);})['catch'](function(_0x3c3bc0){logger['error'](_0xf0e1('0x13'),_0x3c3bc0[_0xf0e1('0x11')],_0x52226b);_0x2ed488(_0x17754c[_0xf0e1('0xf')](0x1f4,_0x3c3bc0[_0xf0e1('0x11')]));});});});};exports[_0xf0e1('0x48')]=function(_0x1e14f7){var _0x57fc2b=this;return new Promise(function(_0x2eaf24,_0x593950){return db[_0xf0e1('0x2e')][_0xf0e1('0x49')]({'raw':!![],'where':{'phone':_0x1e14f7['options'][_0xf0e1('0x18')][_0xf0e1('0x4a')]},'attributes':['id',_0xf0e1('0x4b')],'order':[['id',_0xf0e1('0x4c')]]})[_0xf0e1('0x8')](function(_0x4e24c1){logger['info'](_0xf0e1('0x4d'),_0x1e14f7);logger[_0xf0e1('0xc')]('getContactByPhone',_0x1e14f7,JSON[_0xf0e1('0xe')](_0x4e24c1));_0x2eaf24(_0x4e24c1);})[_0xf0e1('0x12')](function(_0x211fae){logger[_0xf0e1('0xf')](_0xf0e1('0x4d'),_0x211fae['message'],_0x1e14f7);_0x593950(_0x57fc2b[_0xf0e1('0xf')](0x1f4,_0x211fae[_0xf0e1('0x11')]));});});};exports[_0xf0e1('0x4e')]=function(_0x3a483e){var _0x51f18b=this;return new Promise(function(_0x144295,_0x5e4ffb){return db[_0xf0e1('0x2a')][_0xf0e1('0x3c')](function(_0x44bc6d){return db[_0xf0e1('0x14')][_0xf0e1('0x23')]({'active':![]},{'where':{},'transaction':_0x44bc6d})[_0xf0e1('0x8')](function(_0x52bbdd){logger[_0xf0e1('0x9')](_0xf0e1('0x4e'),_0x3a483e);logger['debug'](_0xf0e1('0x4e'),_0x3a483e,JSON[_0xf0e1('0xe')](_0x52bbdd));_0x144295(_0x52bbdd);})[_0xf0e1('0x12')](function(_0x1a5425){logger[_0xf0e1('0xf')](_0xf0e1('0x4e'),_0x1a5425[_0xf0e1('0x11')],_0x3a483e);_0x5e4ffb(_0x51f18b[_0xf0e1('0xf')](0x1f4,_0x1a5425[_0xf0e1('0x11')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x3ec612){var _0x30983b=this;var _0x1cb55c=_0x3ec612[_0xf0e1('0x21')][_0xf0e1('0x18')]['voiceQueueId'];var _0x1085b4=_0x3ec612['body']['where'][_0xf0e1('0x4f')];return new Promise(function(_0x31bc72,_0x4091f9){return db[_0xf0e1('0x14')][_0xf0e1('0x15')]({'where':{'voiceQueueId':_0x1cb55c,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xf0e1('0x2a')]['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x1085b4+'\x20MINUTE'),'$gt':db[_0xf0e1('0x2a')][_0xf0e1('0x3f')](_0xf0e1('0x50'))}}},'include':[{'model':db[_0xf0e1('0x2e')],'as':'Contact'},{'model':db[_0xf0e1('0x31')],'as':'Agent','attributes':['id',_0xf0e1('0x33'),_0xf0e1('0x34')]},{'model':db[_0xf0e1('0x51')],'as':'List'}]})['then'](function(_0x4f3676){if(_0x4f3676[_0xf0e1('0x37')]>0x0){return db[_0xf0e1('0x2a')][_0xf0e1('0x3c')](function(_0x83a678){return db[_0xf0e1('0x14')]['update']({'recallmeNotifiedDate':db[_0xf0e1('0x2a')][_0xf0e1('0x3f')](_0xf0e1('0x50'))},{'where':{'id':{'$in':_[_0xf0e1('0x1a')](_0x4f3676,'id')}},'transaction':_0x83a678})[_0xf0e1('0x8')](function(){_0x31bc72(_0x4f3676);})['catch'](function(_0x4c8f58){logger[_0xf0e1('0xf')](_0xf0e1('0x52'),_0x4c8f58['message'],_0x3ec612);_0x4091f9(_0x30983b[_0xf0e1('0xf')](0x1f4,_0x4c8f58[_0xf0e1('0x11')]));});})[_0xf0e1('0x12')](function(_0x19119c){logger[_0xf0e1('0xf')](_0xf0e1('0x52'),_0x19119c['message'],_0x3ec612);_0x4091f9(_0x30983b[_0xf0e1('0xf')](0x1f4,_0x19119c[_0xf0e1('0x11')]));});}else{_0x31bc72(_0x4f3676);}});});}; \ No newline at end of file +var _0x3479=['keys','User','Agent','name','voicePause','length','UserId','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','active','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','log','CmHopperHandlePreviewRecallNotifications\x20req.body.where','voiceQueueId','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','CmList','CmHopperHandlePreviewRecallNotifications','lodash','moment','../../mysqldb','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','CmHopper,\x20%s,\x20%s','message','catch','GetCmHopper','findAll','options','raw','where','attributes','limit','include','map','model','CmHopper','find','ShowCmHopper','CreateCmHopper','create','UpdateCmHopper','update','body','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact'];(function(_0x56c426,_0x37d2a7){var _0x3dd6b7=function(_0x211153){while(--_0x211153){_0x56c426['push'](_0x56c426['shift']());}};_0x3dd6b7(++_0x37d2a7);}(_0x3479,0x186));var _0x9347=function(_0x3db2e8,_0x49c09b){_0x3db2e8=_0x3db2e8-0x0;var _0xf05958=_0x3479[_0x3db2e8];return _0xf05958;};'use strict';var _=require(_0x9347('0x0'));var util=require('util');var moment=require(_0x9347('0x1'));var BPromise=require('bluebird');var db=require(_0x9347('0x2'))['db'];var logger=require('../../config/logger')(_0x9347('0x3'));var jayson=require(_0x9347('0x4'));var client=jayson[_0x9347('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a06be,_0x4d142d,_0x448148){return new BPromise(function(_0xfa1fdc,_0x5d8210){return client[_0x9347('0x6')](_0x1a06be,_0x448148)[_0x9347('0x7')](function(_0x4ca00b){logger[_0x9347('0x8')]('CmHopper,\x20%s,\x20%s',_0x4d142d,_0x9347('0x9'));logger[_0x9347('0xa')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4d142d,_0x9347('0x9'),JSON[_0x9347('0xb')](_0x4ca00b));if(_0x4ca00b[_0x9347('0xc')]){if(_0x4ca00b[_0x9347('0xc')][_0x9347('0xd')]===0x1f4){logger[_0x9347('0xc')](_0x9347('0xe'),_0x4d142d,_0x4ca00b[_0x9347('0xc')][_0x9347('0xf')]);return _0x5d8210(_0x4ca00b[_0x9347('0xc')]['message']);}logger[_0x9347('0xc')]('CmHopper,\x20%s,\x20%s',_0x4d142d,_0x4ca00b[_0x9347('0xc')]['message']);return _0xfa1fdc(_0x4ca00b[_0x9347('0xc')][_0x9347('0xf')]);}else{logger[_0x9347('0x8')](_0x9347('0xe'),_0x4d142d,_0x9347('0x9'));_0xfa1fdc(_0x4ca00b['result']['message']);}})[_0x9347('0x10')](function(_0x5c42b7){logger[_0x9347('0xc')](_0x9347('0xe'),_0x4d142d,_0x5c42b7);_0x5d8210(_0x5c42b7);});});}exports[_0x9347('0x11')]=function(_0x1b23b4){var _0xba5338=this;return new Promise(function(_0x544fb6,_0x317ed3){return db['CmHopper'][_0x9347('0x12')]({'raw':_0x1b23b4['options']?_0x1b23b4[_0x9347('0x13')][_0x9347('0x14')]===undefined?!![]:![]:!![],'where':_0x1b23b4[_0x9347('0x13')]?_0x1b23b4['options'][_0x9347('0x15')]||null:null,'attributes':_0x1b23b4[_0x9347('0x13')]?_0x1b23b4[_0x9347('0x13')][_0x9347('0x16')]||null:null,'limit':_0x1b23b4[_0x9347('0x13')]?_0x1b23b4[_0x9347('0x13')][_0x9347('0x17')]||null:null,'include':_0x1b23b4[_0x9347('0x13')]?_0x1b23b4[_0x9347('0x13')][_0x9347('0x18')]?_[_0x9347('0x19')](_0x1b23b4[_0x9347('0x13')][_0x9347('0x18')],function(_0x3db5f8){return{'model':db[_0x3db5f8[_0x9347('0x1a')]],'as':_0x3db5f8['as'],'attributes':_0x3db5f8[_0x9347('0x16')],'include':_0x3db5f8[_0x9347('0x18')]?_['map'](_0x3db5f8['include'],function(_0x3b5c16){return{'model':db[_0x3b5c16['model']],'as':_0x3b5c16['as'],'attributes':_0x3b5c16[_0x9347('0x16')],'include':_0x3b5c16['include']?_[_0x9347('0x19')](_0x3b5c16[_0x9347('0x18')],function(_0x28e9c7){return{'model':db[_0x28e9c7[_0x9347('0x1a')]],'as':_0x28e9c7['as'],'attributes':_0x28e9c7[_0x9347('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9347('0x7')](function(_0x2f2476){logger[_0x9347('0x8')]('GetCmHopper',_0x1b23b4);logger[_0x9347('0xa')](_0x9347('0x11'),_0x1b23b4,JSON[_0x9347('0xb')](_0x2f2476));_0x544fb6(_0x2f2476);})[_0x9347('0x10')](function(_0x494ebc){logger['error']('GetCmHopper',_0x494ebc[_0x9347('0xf')],_0x1b23b4);_0x317ed3(_0xba5338[_0x9347('0xc')](0x1f4,_0x494ebc[_0x9347('0xf')]));});});};exports['ShowCmHopper']=function(_0x5c82b6){var _0x44b65c=this;return new Promise(function(_0x24e388,_0x32f60a){return db[_0x9347('0x1b')][_0x9347('0x1c')]({'raw':_0x5c82b6['options']?_0x5c82b6[_0x9347('0x13')][_0x9347('0x14')]===undefined?!![]:![]:!![],'where':_0x5c82b6['options']?_0x5c82b6[_0x9347('0x13')][_0x9347('0x15')]||null:null,'attributes':_0x5c82b6[_0x9347('0x13')]?_0x5c82b6[_0x9347('0x13')]['attributes']||null:null,'include':_0x5c82b6[_0x9347('0x13')]?_0x5c82b6[_0x9347('0x13')][_0x9347('0x18')]?_['map'](_0x5c82b6[_0x9347('0x13')][_0x9347('0x18')],function(_0x52921f){return{'model':db[_0x52921f[_0x9347('0x1a')]],'as':_0x52921f['as'],'attributes':_0x52921f['attributes'],'include':_0x52921f[_0x9347('0x18')]?_[_0x9347('0x19')](_0x52921f['include'],function(_0x2b7aef){return{'model':db[_0x2b7aef[_0x9347('0x1a')]],'as':_0x2b7aef['as'],'attributes':_0x2b7aef['attributes'],'include':_0x2b7aef[_0x9347('0x18')]?_[_0x9347('0x19')](_0x2b7aef[_0x9347('0x18')],function(_0x27363e){return{'model':db[_0x27363e[_0x9347('0x1a')]],'as':_0x27363e['as'],'attributes':_0x27363e[_0x9347('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9347('0x7')](function(_0xdba650){logger[_0x9347('0x8')](_0x9347('0x1d'),_0x5c82b6);logger['debug'](_0x9347('0x1d'),_0x5c82b6,JSON[_0x9347('0xb')](_0xdba650));_0x24e388(_0xdba650);})['catch'](function(_0x5021fb){logger[_0x9347('0xc')]('ShowCmHopper',_0x5021fb['message'],_0x5c82b6);_0x32f60a(_0x44b65c[_0x9347('0xc')](0x1f4,_0x5021fb[_0x9347('0xf')]));});});};exports[_0x9347('0x1e')]=function(_0x2bb26c){var _0x33800e=this;return new Promise(function(_0xa1d706,_0x2b99dd){return db['CmHopper'][_0x9347('0x1f')](_0x2bb26c['body'],{'raw':_0x2bb26c['options']?_0x2bb26c['options']['raw']===undefined?!![]:![]:!![]})[_0x9347('0x7')](function(_0x2fa741){logger[_0x9347('0x8')]('CreateCmHopper',_0x2bb26c);logger[_0x9347('0xa')](_0x9347('0x1e'),_0x2bb26c,JSON[_0x9347('0xb')](_0x2fa741));_0xa1d706(_0x2fa741);})[_0x9347('0x10')](function(_0x486bc8){logger['error']('CreateCmHopper',_0x486bc8[_0x9347('0xf')],_0x2bb26c);_0x2b99dd(_0x33800e[_0x9347('0xc')](0x1f4,_0x486bc8[_0x9347('0xf')]));});});};exports[_0x9347('0x20')]=function(_0xfa47f1){var _0x5ed918=this;return new Promise(function(_0x1d36b6,_0x120971){return db['CmHopper'][_0x9347('0x21')](_0xfa47f1[_0x9347('0x22')],{'raw':_0xfa47f1[_0x9347('0x13')]?_0xfa47f1[_0x9347('0x13')][_0x9347('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfa47f1[_0x9347('0x13')]?_0xfa47f1['options'][_0x9347('0x15')]||null:null,'attributes':_0xfa47f1[_0x9347('0x13')]?_0xfa47f1[_0x9347('0x13')][_0x9347('0x16')]||null:null,'limit':_0xfa47f1[_0x9347('0x13')]?_0xfa47f1[_0x9347('0x13')][_0x9347('0x17')]||null:null})[_0x9347('0x7')](function(_0x65ad16){logger[_0x9347('0x8')](_0x9347('0x20'),_0xfa47f1);logger[_0x9347('0x8')](_0x9347('0x23'),JSON[_0x9347('0xb')](_0xfa47f1['options'][_0x9347('0x15')]),_0xfa47f1[_0x9347('0x22')]['active']);logger['debug']('UpdateCmHopper',_0xfa47f1,JSON['stringify'](_0x65ad16));_0x1d36b6(_0x65ad16);})['catch'](function(_0x52fc43){logger[_0x9347('0xc')](_0x9347('0x20'),_0x52fc43[_0x9347('0xf')],_0xfa47f1);_0x120971(_0x5ed918[_0x9347('0xc')](0x1f4,_0x52fc43[_0x9347('0xf')]));});});};exports[_0x9347('0x24')]=function(_0x116372){var _0x41d8a7=this;return new Promise(function(_0x3beeeb,_0x14ece0){return db[_0x9347('0x1b')]['destroy']({'where':_0x116372[_0x9347('0x13')]?_0x116372[_0x9347('0x13')]['where']||null:null})[_0x9347('0x7')](function(_0x55502b){logger[_0x9347('0x8')](_0x9347('0x24'),_0x116372);logger[_0x9347('0xa')](_0x9347('0x24'),_0x116372,JSON[_0x9347('0xb')](_0x55502b));_0x3beeeb(_0x55502b);})['catch'](function(_0xb83c75){logger['error']('DestroyCmHopper',_0xb83c75[_0x9347('0xf')],_0x116372);_0x14ece0(_0x41d8a7[_0x9347('0xc')](0x1f4,_0xb83c75[_0x9347('0xf')]));});});};exports[_0x9347('0x25')]=function(_0x258049){var _0x5e11cb=this;return new Promise(function(_0x265ecd,_0x2b1f27){return db[_0x9347('0x26')][_0x9347('0x27')]()['then'](function(_0x143182){return db[_0x9347('0x28')]['transaction'](function(_0x214e8f){return db['CmHopper']['findAll']({'where':_0x258049[_0x9347('0x13')]?_0x258049[_0x9347('0x13')][_0x9347('0x15')]||null:null,'attributes':_0x258049[_0x9347('0x13')]?_0x258049['options'][_0x9347('0x16')]||null:null,'limit':_0x258049[_0x9347('0x13')]?_0x258049[_0x9347('0x13')]['limit']||null:null,'order':_0x258049[_0x9347('0x13')]?_0x258049[_0x9347('0x13')][_0x9347('0x29')]||null:null,'transaction':_0x214e8f,'lock':_0x214e8f[_0x9347('0x2a')][_0x9347('0x2b')],'include':[{'model':db[_0x9347('0x26')],'as':_0x9347('0x2c'),'attributes':_[_0x9347('0x2d')](_0x143182)},{'model':db[_0x9347('0x2e')],'as':_0x9347('0x2f'),'attributes':['id',_0x9347('0x30'),_0x9347('0x31')]}]})[_0x9347('0x7')](function(_0x1c0501){var _0x14e3f9=[];var _0x13e733=[];for(var _0x5601bb=0x0;_0x5601bb<_0x1c0501[_0x9347('0x32')];_0x5601bb+=0x1){var _0x4f3b2f=_0x1c0501[_0x5601bb][_0x9347('0x33')];if(_0x4f3b2f===null){_0x14e3f9['push'](_0x1c0501[_0x5601bb]['update'](_0x258049[_0x9347('0x22')],{'transaction':_0x214e8f}));}else if(!_0x13e733[_0x9347('0x34')](_0x4f3b2f)){_0x13e733['push'](_0x4f3b2f);_0x14e3f9[_0x9347('0x35')](_0x1c0501[_0x5601bb][_0x9347('0x21')](_0x258049[_0x9347('0x22')],{'transaction':_0x214e8f}));}}return BPromise[_0x9347('0x36')](_0x14e3f9);});})[_0x9347('0x7')](function(_0x38fd09){logger[_0x9347('0x8')]('GetContactDialer',_0x258049);if(_0x38fd09[_0x9347('0x32')]>0x0){logger[_0x9347('0x8')](_0x9347('0x37'),_0x38fd09[0x0][_0x9347('0x38')]['id'],_0x38fd09[0x0][_0x9347('0x38')]['ContactId'],_0x38fd09[0x0][_0x9347('0x38')][_0x9347('0x39')]);}logger[_0x9347('0xa')](_0x9347('0x25'),_0x258049,JSON[_0x9347('0xb')](_0x38fd09));_0x265ecd(_0x38fd09);})[_0x9347('0x10')](function(_0x2337c5){logger['error'](_0x9347('0x25'),_0x2337c5[_0x9347('0xf')],_0x258049);_0x2b1f27(_0x5e11cb['error'](0x1f4,_0x2337c5['message']));});});});};exports[_0x9347('0x3a')]=function(_0x232765){var _0x2d06b2=this;return new Promise(function(_0x31513e,_0x3f25fb){return db[_0x9347('0x28')][_0x9347('0x3b')](function(_0x57f6b8){return db[_0x9347('0x3c')][_0x9347('0x1f')](_0x232765[_0x9347('0x22')],{'raw':_0x232765['options']?_0x232765[_0x9347('0x13')][_0x9347('0x14')]===undefined?!![]:![]:!![],'transaction':_0x57f6b8})['then'](function(){logger[_0x9347('0x8')](_0x9347('0x3d'),JSON[_0x9347('0xb')](_0x232765[_0x9347('0x13')]['where']),_0x232765[_0x9347('0x13')]['where'][_0x9347('0x39')]);return db[_0x9347('0x1b')]['destroy']({'where':_0x232765[_0x9347('0x13')]?_0x232765[_0x9347('0x13')][_0x9347('0x15')]||null:null,'transaction':_0x57f6b8});});})[_0x9347('0x7')](function(_0x2ecfea){logger[_0x9347('0x8')]('MoveContactManagedDialer',_0x232765);logger[_0x9347('0xa')]('MoveContactManagedDialer',_0x232765,JSON['stringify'](_0x2ecfea));_0x31513e(_0x2ecfea);})[_0x9347('0x10')](function(_0x566847){logger[_0x9347('0xc')](_0x9347('0x3a'),_0x566847[_0x9347('0xf')],_0x232765);_0x3f25fb(_0x2d06b2['error'](0x1f4,_0x566847[_0x9347('0xf')]));});});};exports[_0x9347('0x3e')]=function(_0x224710){var _0x545ec7=this;return new Promise(function(_0x3c76c3,_0x4ccd63){return db[_0x9347('0x1b')][_0x9347('0x12')]({'raw':_0x224710[_0x9347('0x13')]?_0x224710['options'][_0x9347('0x14')]===undefined?!![]:![]:!![],'where':_0x224710[_0x9347('0x13')]?_0x224710[_0x9347('0x13')][_0x9347('0x15')]||null:null,'attributes':[[db[_0x9347('0x28')]['fn'](_0x9347('0x3f'),db[_0x9347('0x28')]['fn']('IF',db[_0x9347('0x28')][_0x9347('0x40')](_0x9347('0x41')+util[_0x9347('0x42')](_0x9347('0x43'),moment()[_0x9347('0x42')](_0x9347('0x44')))+_0x9347('0x45')))),_0x9347('0x46')]]})[_0x9347('0x7')](function(_0x3746fa){logger[_0x9347('0x8')](_0x9347('0x3e'),_0x224710);logger[_0x9347('0xa')](_0x9347('0x3e'),_0x224710,JSON[_0x9347('0xb')](_0x3746fa));_0x3c76c3(_0x3746fa);})[_0x9347('0x10')](function(_0x397c0f){logger['error'](_0x9347('0x3e'),_0x397c0f[_0x9347('0xf')],_0x224710);_0x4ccd63(_0x545ec7[_0x9347('0xc')](0x1f4,_0x397c0f[_0x9347('0xf')]));});});};exports['GetContactRecallMe']=function(_0x2b4f83){var _0x4cb7e6=this;return new Promise(function(_0xc45555,_0x310d70){return db['CmContact'][_0x9347('0x27')]()[_0x9347('0x7')](function(_0x3963a9){return db[_0x9347('0x28')][_0x9347('0x3b')](function(_0x2a4860){return db['CmHopper'][_0x9347('0x12')]({'where':_0x2b4f83[_0x9347('0x13')]?_0x2b4f83['options'][_0x9347('0x15')]||null:null,'attributes':_0x2b4f83['options']?_0x2b4f83[_0x9347('0x13')][_0x9347('0x16')]||null:null,'limit':0x1,'order':_0x2b4f83['options']?_0x2b4f83[_0x9347('0x13')][_0x9347('0x29')]||null:null,'group':db['CmHopper'][_0x9347('0x33')],'transaction':_0x2a4860,'lock':_0x2a4860[_0x9347('0x2a')][_0x9347('0x2b')],'include':_0x2b4f83[_0x9347('0x13')]?_0x2b4f83['options'][_0x9347('0x18')]?_[_0x9347('0x19')](_0x2b4f83[_0x9347('0x13')][_0x9347('0x18')],function(_0x2945d2){return{'model':db[_0x2945d2[_0x9347('0x1a')]],'as':_0x2945d2['as'],'attributes':_0x2945d2['attributes'],'include':_0x2945d2[_0x9347('0x18')]?_[_0x9347('0x19')](_0x2945d2[_0x9347('0x18')],function(_0x51237e){return{'model':db[_0x51237e[_0x9347('0x1a')]],'as':_0x51237e['as'],'attributes':_0x51237e[_0x9347('0x16')],'include':_0x51237e[_0x9347('0x18')]?_[_0x9347('0x19')](_0x51237e[_0x9347('0x18')],function(_0x5ea6b0){return{'model':db[_0x5ea6b0[_0x9347('0x1a')]],'as':_0x5ea6b0['as'],'attributes':_0x5ea6b0[_0x9347('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9347('0x7')](function(_0x1f3a4e){var _0x436fd0=[];for(var _0x340b07=0x0;_0x340b07<_0x1f3a4e[_0x9347('0x32')];_0x340b07+=0x1){_0x436fd0[_0x9347('0x35')](_0x1f3a4e[_0x340b07]['update'](_0x2b4f83['body'],{'transaction':_0x2a4860}));}return BPromise[_0x9347('0x36')](_0x436fd0);});})[_0x9347('0x7')](function(_0x15125c){logger[_0x9347('0x8')](_0x9347('0x47'),_0x2b4f83);logger['debug'](_0x9347('0x47'),_0x2b4f83,JSON[_0x9347('0xb')](_0x15125c));_0xc45555(_0x15125c);})[_0x9347('0x10')](function(_0x2b4b90){logger[_0x9347('0xc')](_0x9347('0x47'),_0x2b4b90[_0x9347('0xf')],_0x2b4f83);_0x310d70(_0x4cb7e6[_0x9347('0xc')](0x1f4,_0x2b4b90[_0x9347('0xf')]));});});});};exports[_0x9347('0x48')]=function(_0x37d6fa){var _0x75360b=this;return new Promise(function(_0x18665b,_0x21f8ce){db['CmContact'][_0x9347('0x27')]()['then'](function(_0x510695){return db[_0x9347('0x1b')][_0x9347('0x12')]({'raw':_0x37d6fa[_0x9347('0x13')]?_0x37d6fa['options'][_0x9347('0x14')]===undefined?!![]:![]:!![],'where':_0x37d6fa[_0x9347('0x13')]?_0x37d6fa['options'][_0x9347('0x15')]||null:null,'attributes':_0x37d6fa[_0x9347('0x13')]?_0x37d6fa[_0x9347('0x13')][_0x9347('0x16')]||null:null,'limit':_0x37d6fa['options']?_0x37d6fa[_0x9347('0x13')][_0x9347('0x17')]||null:null,'include':_0x37d6fa[_0x9347('0x13')]?_0x37d6fa[_0x9347('0x13')]['include']?_[_0x9347('0x19')](_0x37d6fa[_0x9347('0x13')][_0x9347('0x18')],function(_0x46d063){return{'model':db[_0x46d063[_0x9347('0x1a')]],'as':_0x46d063['as'],'attributes':_0x46d063['as']===_0x9347('0x2c')?_[_0x9347('0x2d')](_0x510695):_0x46d063[_0x9347('0x16')],'include':_0x46d063[_0x9347('0x18')]?_[_0x9347('0x19')](_0x46d063[_0x9347('0x18')],function(_0x218ea1){return{'model':db[_0x218ea1[_0x9347('0x1a')]],'as':_0x218ea1['as'],'attributes':_0x218ea1['attributes'],'include':_0x218ea1[_0x9347('0x18')]?_[_0x9347('0x19')](_0x218ea1[_0x9347('0x18')],function(_0x389fd1){return{'model':db[_0x389fd1[_0x9347('0x1a')]],'as':_0x389fd1['as'],'attributes':_0x389fd1[_0x9347('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9347('0x7')](function(_0x480da8){logger[_0x9347('0x8')]('GetCmHopper',_0x37d6fa);logger[_0x9347('0xa')](_0x9347('0x11'),_0x37d6fa,JSON[_0x9347('0xb')](_0x480da8));_0x18665b(_0x480da8);})[_0x9347('0x10')](function(_0x2d68bc){logger[_0x9347('0xc')](_0x9347('0x11'),_0x2d68bc[_0x9347('0xf')],_0x37d6fa);_0x21f8ce(_0x75360b['error'](0x1f4,_0x2d68bc[_0x9347('0xf')]));});});});};exports[_0x9347('0x49')]=function(_0x3e94f8){var _0x497c84=this;return new Promise(function(_0x92eb79,_0x59278b){return db[_0x9347('0x26')][_0x9347('0x4a')]({'raw':!![],'where':{'phone':_0x3e94f8[_0x9347('0x13')][_0x9347('0x15')][_0x9347('0x4b')]},'attributes':['id',_0x9347('0x4c')],'order':[['id','DESC']]})[_0x9347('0x7')](function(_0x1611bf){logger['info'](_0x9347('0x4d'),_0x3e94f8);logger[_0x9347('0xa')](_0x9347('0x4d'),_0x3e94f8,JSON[_0x9347('0xb')](_0x1611bf));_0x92eb79(_0x1611bf);})[_0x9347('0x10')](function(_0x38816f){logger[_0x9347('0xc')]('getContactByPhone',_0x38816f['message'],_0x3e94f8);_0x59278b(_0x497c84[_0x9347('0xc')](0x1f4,_0x38816f['message']));});});};exports[_0x9347('0x4e')]=function(_0x4a8af0){var _0x3e1e7b=this;return new Promise(function(_0x3c9f82,_0x11602e){return db[_0x9347('0x28')][_0x9347('0x3b')](function(_0x716c37){return db[_0x9347('0x1b')][_0x9347('0x21')]({'active':![]},{'where':{},'transaction':_0x716c37})['then'](function(_0x166de0){logger[_0x9347('0x8')](_0x9347('0x4e'),_0x4a8af0);logger[_0x9347('0xa')](_0x9347('0x4e'),_0x4a8af0,JSON[_0x9347('0xb')](_0x166de0));_0x3c9f82(_0x166de0);})[_0x9347('0x10')](function(_0x20335d){logger[_0x9347('0xc')](_0x9347('0x4e'),_0x20335d[_0x9347('0xf')],_0x4a8af0);_0x11602e(_0x3e1e7b['error'](0x1f4,_0x20335d['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x49df86){var _0x137e20=this;console[_0x9347('0x4f')](_0x9347('0x50'),_0x49df86[_0x9347('0x22')][_0x9347('0x15')]);var _0x240e70=_0x49df86['body'][_0x9347('0x15')][_0x9347('0x51')];var _0x54af96=_0x49df86[_0x9347('0x22')]['where']['interval'];var _0x2b3d22=_0x49df86[_0x9347('0x22')][_0x9347('0x15')]['availableAgentsIds'];return new Promise(function(_0x3b60b9,_0x1925ec){return db[_0x9347('0x1b')][_0x9347('0x12')]({'where':{'voiceQueueId':_0x240e70,'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x9347('0x28')][_0x9347('0x40')](_0x9347('0x52')+_0x54af96+_0x9347('0x53')),'$gt':db[_0x9347('0x28')][_0x9347('0x40')](_0x9347('0x54'))}},'UserId':{'$in':_0x2b3d22}},'logging':!![],'include':[{'model':db['CmContact'],'as':'Contact'},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x9347('0x31')]},{'model':db[_0x9347('0x55')],'as':'List'}]})[_0x9347('0x7')](function(_0x27b483){if(_0x27b483[_0x9347('0x32')]>0x0){return db[_0x9347('0x28')]['transaction'](function(_0x1b2937){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0x9347('0x28')][_0x9347('0x40')](_0x9347('0x54'))},{'where':{'id':{'$in':_[_0x9347('0x19')](_0x27b483,'id')}},'transaction':_0x1b2937})[_0x9347('0x7')](function(){_0x3b60b9(_0x27b483);})['catch'](function(_0x4512de){logger[_0x9347('0xc')]('CmHopperHandlePreviewRecallNotifications',_0x4512de[_0x9347('0xf')],_0x49df86);_0x1925ec(_0x137e20[_0x9347('0xc')](0x1f4,_0x4512de['message']));});})[_0x9347('0x10')](function(_0x4430b3){logger[_0x9347('0xc')](_0x9347('0x56'),_0x4430b3[_0x9347('0xf')],_0x49df86);_0x1925ec(_0x137e20[_0x9347('0xc')](0x1f4,_0x4430b3[_0x9347('0xf')]));});}else{_0x3b60b9(_0x27b483);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index b6e7844..a554118 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 _0x02b9=['get','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','put','/:id','destroy','exports','express','Router','./cmHopper.controller','isAuthenticated'];(function(_0x4e6cbb,_0x3450f0){var _0x15ced4=function(_0x248dd2){while(--_0x248dd2){_0x4e6cbb['push'](_0x4e6cbb['shift']());}};_0x15ced4(++_0x3450f0);}(_0x02b9,0x7a));var _0x902b=function(_0x4a568c,_0x1340f5){_0x4a568c=_0x4a568c-0x0;var _0x2a3e8e=_0x02b9[_0x4a568c];return _0x2a3e8e;};'use strict';var express=require(_0x902b('0x0'));var router=express[_0x902b('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x902b('0x2'));router['get']('/',auth[_0x902b('0x3')](),controller['index']);router[_0x902b('0x4')]('/describe',auth[_0x902b('0x3')](),controller[_0x902b('0x5')]);router[_0x902b('0x4')](_0x902b('0x6'),auth[_0x902b('0x3')](),controller[_0x902b('0x7')]);router['get'](_0x902b('0x8'),auth[_0x902b('0x3')](),controller[_0x902b('0x9')]);router[_0x902b('0x4')]('/:id',auth[_0x902b('0x3')](),controller[_0x902b('0xa')]);router[_0x902b('0x4')](_0x902b('0xb'),auth[_0x902b('0x3')](),controller[_0x902b('0xc')]);router[_0x902b('0xd')]('/',auth[_0x902b('0x3')](),controller[_0x902b('0xe')]);router[_0x902b('0xd')](_0x902b('0xf'),auth[_0x902b('0x3')](),controller[_0x902b('0x10')]);router[_0x902b('0xd')]('/timezone',auth[_0x902b('0x3')](),controller['getTimezone']);router[_0x902b('0x11')](_0x902b('0x12'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x902b('0x12'),auth[_0x902b('0x3')](),controller[_0x902b('0x13')]);module[_0x902b('0x14')]=router; \ No newline at end of file +var _0x48aa=['isAuthenticated','describe','getOpenContacts','/timezones','getTimezones','show','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','put','/:id','update','delete','destroy','exports','express','Router','./cmHopper.controller','get','index'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0x48aa,0x13d));var _0xa48a=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x48aa[_0x217c2e];return _0x22b7d8;};'use strict';var express=require(_0xa48a('0x0'));var router=express[_0xa48a('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa48a('0x2'));router[_0xa48a('0x3')]('/',auth['isAuthenticated'](),controller[_0xa48a('0x4')]);router['get']('/describe',auth[_0xa48a('0x5')](),controller[_0xa48a('0x6')]);router[_0xa48a('0x3')]('/opencontacts',auth[_0xa48a('0x5')](),controller[_0xa48a('0x7')]);router[_0xa48a('0x3')](_0xa48a('0x8'),auth[_0xa48a('0x5')](),controller[_0xa48a('0x9')]);router[_0xa48a('0x3')]('/:id',auth[_0xa48a('0x5')](),controller[_0xa48a('0xa')]);router[_0xa48a('0x3')](_0xa48a('0xb'),auth[_0xa48a('0x5')](),controller[_0xa48a('0xc')]);router[_0xa48a('0xd')]('/',auth[_0xa48a('0x5')](),controller['create']);router[_0xa48a('0xd')](_0xa48a('0xe'),auth[_0xa48a('0x5')](),controller[_0xa48a('0xf')]);router['post'](_0xa48a('0x10'),auth[_0xa48a('0x5')](),controller['getTimezone']);router[_0xa48a('0x11')](_0xa48a('0x12'),auth['isAuthenticated'](),controller[_0xa48a('0x13')]);router[_0xa48a('0x14')]('/:id',auth[_0xa48a('0x5')](),controller[_0xa48a('0x15')]);module[_0xa48a('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 9bc41e8..40cb22e 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 _0xd484=['moment','sequelize','exports','INTEGER','contactListQueue'];(function(_0x3b0f54,_0x3b779b){var _0x184e11=function(_0x473d8c){while(--_0x473d8c){_0x3b0f54['push'](_0x3b0f54['shift']());}};_0x184e11(++_0x3b779b);}(_0xd484,0xff));var _0x4d48=function(_0x4a8286,_0x45c191){_0x4a8286=_0x4a8286-0x0;var _0x38e204=_0xd484[_0x4a8286];return _0x38e204;};'use strict';var moment=require(_0x4d48('0x0'));var Sequelize=require(_0x4d48('0x1'));module[_0x4d48('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x4d48('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x4d48('0x3')],'unique':_0x4d48('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x5fab=['moment','sequelize','STRING','INTEGER','contactListQueue'];(function(_0x58eec7,_0x2353db){var _0x25c5d3=function(_0x1ae895){while(--_0x1ae895){_0x58eec7['push'](_0x58eec7['shift']());}};_0x25c5d3(++_0x2353db);}(_0x5fab,0x177));var _0xb5fa=function(_0x40bcf9,_0x409033){_0x40bcf9=_0x40bcf9-0x0;var _0x10ab13=_0x5fab[_0x40bcf9];return _0x10ab13;};'use strict';var moment=require(_0xb5fa('0x0'));var Sequelize=require(_0xb5fa('0x1'));module['exports']={'phone':{'type':Sequelize[_0xb5fa('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb5fa('0x3')],'unique':_0xb5fa('0x4')},'ListId':{'type':Sequelize[_0xb5fa('0x3')],'unique':_0xb5fa('0x4')},'VoiceQueueId':{'type':Sequelize[_0xb5fa('0x3')],'unique':_0xb5fa('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index ee34a8f..a159c96 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 _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperBlack','then','includeAll','include','findAll','rows','catch','show','length','find','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x524e,0x15e));var _0xe524=function(_0x15a7c1,_0x4c834b){_0x15a7c1=_0x15a7c1-0x0;var _0x490555=_0x524e[_0x15a7c1];return _0x490555;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['CmHopperBlack'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':!![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x27')]=function(_0x3d7ab7,_0x33b1c8){if(_0x3d7ab7[_0xe524('0x48')]['id']){delete _0x3d7ab7['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x3d7ab7['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x33b1c8,null))['then'](saveUpdates(_0x3d7ab7[_0xe524('0x48')],null))[_0xe524('0x3f')](respondWithResult(_0x33b1c8,null))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x28')]=function(_0x5c1655,_0x5c0135){return db[_0xe524('0x3e')][_0xe524('0x47')]({'where':{'id':_0x5c1655[_0xe524('0x49')]['id']}})['then'](handleEntityNotFound(_0x5c0135,null))['then'](removeEntity(_0x5c0135,null))['catch'](handleError(_0x5c0135,null));};exports['describe']=function(_0x4f7a64,_0x5477ca){return db[_0xe524('0x3e')][_0xe524('0x4a')]()['then'](respondWithResult(_0x5477ca,null))[_0xe524('0x44')](handleError(_0x5477ca,null));}; \ No newline at end of file +var _0xb1d8=['merge','VIRTUAL','filter','options','findAll','rows','catch','params','intersection','fields','includeAll','find','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','update','then','destroy','stack','name','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xeafe8e,_0x11acfe){var _0x1f5657=function(_0x5d0585){while(--_0x5d0585){_0xeafe8e['push'](_0xeafe8e['shift']());}};_0x1f5657(++_0x11acfe);}(_0xb1d8,0xef));var _0x8b1d=function(_0x20f6b0,_0x2be40b){_0x20f6b0=_0x20f6b0-0x0;var _0x2377fa=_0xb1d8[_0x20f6b0];return _0x2377fa;};'use strict';var emlformat=require(_0x8b1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b1d('0x1'));var jsonpatch=require(_0x8b1d('0x2'));var rp=require('request-promise');var moment=require(_0x8b1d('0x3'));var BPromise=require(_0x8b1d('0x4'));var Mustache=require(_0x8b1d('0x5'));var util=require(_0x8b1d('0x6'));var path=require(_0x8b1d('0x7'));var sox=require(_0x8b1d('0x8'));var csv=require(_0x8b1d('0x9'));var ejs=require(_0x8b1d('0xa'));var fs=require('fs');var fs_extra=require(_0x8b1d('0xb'));var _=require(_0x8b1d('0xc'));var squel=require(_0x8b1d('0xd'));var crypto=require(_0x8b1d('0xe'));var jsforce=require(_0x8b1d('0xf'));var deskjs=require(_0x8b1d('0x10'));var toCsv=require(_0x8b1d('0x9'));var querystring=require(_0x8b1d('0x11'));var Papa=require('papaparse');var Redis=require(_0x8b1d('0x12'));var authService=require(_0x8b1d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8b1d('0x14'));var hardwareService=require(_0x8b1d('0x15'));var logger=require(_0x8b1d('0x16'))('api');var utils=require(_0x8b1d('0x17'));var config=require(_0x8b1d('0x18'));var licenseUtil=require(_0x8b1d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50ec84,_0xedfb0d){_0xedfb0d=_0xedfb0d||0xcc;return function(_0x3da9a3){if(_0x3da9a3){return _0x50ec84[_0x8b1d('0x1a')](_0xedfb0d);}return _0x50ec84[_0x8b1d('0x1b')](_0xedfb0d)[_0x8b1d('0x1c')]();};}function respondWithResult(_0x2199d3,_0x38cb19){_0x38cb19=_0x38cb19||0xc8;return function(_0x17473e){if(_0x17473e){return _0x2199d3[_0x8b1d('0x1b')](_0x38cb19)['json'](_0x17473e);}};}function respondWithFilteredResult(_0x4381a4,_0x478348){return function(_0x231913){if(_0x231913){var _0x174ad9=typeof _0x478348[_0x8b1d('0x1d')]==='undefined'&&typeof _0x478348[_0x8b1d('0x1e')]===_0x8b1d('0x1f');var _0x4eb0e8=_0x231913[_0x8b1d('0x20')];var _0x596f21=_0x174ad9?0x0:_0x478348[_0x8b1d('0x1d')];var _0xf480f0=_0x174ad9?_0x231913[_0x8b1d('0x20')]:_0x478348[_0x8b1d('0x1d')]+_0x478348[_0x8b1d('0x1e')];var _0x396e86;if(_0xf480f0>=_0x4eb0e8){_0xf480f0=_0x4eb0e8;_0x396e86=0xc8;}else{_0x396e86=0xce;}_0x4381a4['status'](_0x396e86);return _0x4381a4['set'](_0x8b1d('0x21'),_0x596f21+'-'+_0xf480f0+'/'+_0x4eb0e8)[_0x8b1d('0x22')](_0x231913);}return null;};}function patchUpdates(_0x4cc802){return function(_0xced704){try{jsonpatch[_0x8b1d('0x23')](_0xced704,_0x4cc802,!![]);}catch(_0xadfb6c){return BPromise[_0x8b1d('0x24')](_0xadfb6c);}return _0xced704['save']();};}function saveUpdates(_0x568f08,_0x48de6f){return function(_0x1343c3){if(_0x1343c3){return _0x1343c3[_0x8b1d('0x25')](_0x568f08)[_0x8b1d('0x26')](function(_0xf13bbc){return _0xf13bbc;});}return null;};}function removeEntity(_0x313038,_0x198b7c){return function(_0x38a85b){if(_0x38a85b){return _0x38a85b[_0x8b1d('0x27')]()[_0x8b1d('0x26')](function(){_0x313038[_0x8b1d('0x1b')](0xcc)[_0x8b1d('0x1c')]();});}};}function handleEntityNotFound(_0x1950e5,_0x2a3dd6){return function(_0x293c65){if(!_0x293c65){_0x1950e5[_0x8b1d('0x1a')](0x194);}return _0x293c65;};}function handleError(_0x3c7b1d,_0x3a9747){_0x3a9747=_0x3a9747||0x1f4;return function(_0x4db754){logger['error'](_0x4db754[_0x8b1d('0x28')]);if(_0x4db754['name']){delete _0x4db754[_0x8b1d('0x29')];}_0x3c7b1d[_0x8b1d('0x1b')](_0x3a9747)['send'](_0x4db754);};}exports[_0x8b1d('0x2a')]=function(_0x561efd,_0xd8a66a){var _0x5f47a2={},_0x34f876={},_0x169c6a={'count':0x0,'rows':[]};var _0xb8dbee=_['map'](db[_0x8b1d('0x2b')][_0x8b1d('0x2c')],function(_0x135673){return{'name':_0x135673[_0x8b1d('0x2d')],'type':_0x135673[_0x8b1d('0x2e')][_0x8b1d('0x2f')]};});_0x34f876[_0x8b1d('0x30')]=_[_0x8b1d('0x31')](_0xb8dbee,'name');_0x34f876[_0x8b1d('0x32')]=_[_0x8b1d('0x33')](_0x561efd[_0x8b1d('0x32')]);_0x34f876[_0x8b1d('0x34')]=_['intersection'](_0x34f876[_0x8b1d('0x30')],_0x34f876[_0x8b1d('0x32')]);_0x5f47a2[_0x8b1d('0x35')]=_['intersection'](_0x34f876[_0x8b1d('0x30')],qs['fields'](_0x561efd[_0x8b1d('0x32')]['fields']));_0x5f47a2[_0x8b1d('0x35')]=_0x5f47a2[_0x8b1d('0x35')][_0x8b1d('0x36')]?_0x5f47a2['attributes']:_0x34f876[_0x8b1d('0x30')];if(!_0x561efd['query'][_0x8b1d('0x37')](_0x8b1d('0x38'))){_0x5f47a2[_0x8b1d('0x1e')]=qs[_0x8b1d('0x1e')](_0x561efd[_0x8b1d('0x32')][_0x8b1d('0x1e')]);_0x5f47a2[_0x8b1d('0x1d')]=qs['offset'](_0x561efd['query']['offset']);}_0x5f47a2[_0x8b1d('0x39')]=qs['sort'](_0x561efd[_0x8b1d('0x32')][_0x8b1d('0x3a')]);_0x5f47a2[_0x8b1d('0x3b')]=qs[_0x8b1d('0x34')](_[_0x8b1d('0x3c')](_0x561efd['query'],_0x34f876[_0x8b1d('0x34')]),_0xb8dbee);if(_0x561efd[_0x8b1d('0x32')]['filter']){_0x5f47a2['where']=_[_0x8b1d('0x3d')](_0x5f47a2[_0x8b1d('0x3b')],{'$or':_['map'](_0xb8dbee,function(_0x5de6fa){if(_0x5de6fa[_0x8b1d('0x2e')]!==_0x8b1d('0x3e')){var _0xd32697={};_0xd32697[_0x5de6fa[_0x8b1d('0x29')]]={'$like':'%'+_0x561efd[_0x8b1d('0x32')][_0x8b1d('0x3f')]+'%'};return _0xd32697;}})});}_0x5f47a2=_[_0x8b1d('0x3d')]({},_0x5f47a2,_0x561efd[_0x8b1d('0x40')]);var _0x14caeb={'where':_0x5f47a2[_0x8b1d('0x3b')]};return db['CmHopperBlack'][_0x8b1d('0x20')](_0x14caeb)[_0x8b1d('0x26')](function(_0x345d9b){_0x169c6a[_0x8b1d('0x20')]=_0x345d9b;if(_0x561efd[_0x8b1d('0x32')]['includeAll']){_0x5f47a2['include']=[{'all':!![]}];}return db[_0x8b1d('0x2b')][_0x8b1d('0x41')](_0x5f47a2);})[_0x8b1d('0x26')](function(_0x822d0f){_0x169c6a[_0x8b1d('0x42')]=_0x822d0f;return _0x169c6a;})[_0x8b1d('0x26')](respondWithFilteredResult(_0xd8a66a,_0x5f47a2))[_0x8b1d('0x43')](handleError(_0xd8a66a,null));};exports['show']=function(_0x4263e2,_0x1e84da){var _0x8b3212={'raw':!![],'where':{'id':_0x4263e2[_0x8b1d('0x44')]['id']}},_0x3aaee8={};_0x3aaee8[_0x8b1d('0x30')]=_['keys'](db[_0x8b1d('0x2b')]['rawAttributes']);_0x3aaee8[_0x8b1d('0x32')]=_[_0x8b1d('0x33')](_0x4263e2[_0x8b1d('0x32')]);_0x3aaee8[_0x8b1d('0x34')]=_[_0x8b1d('0x45')](_0x3aaee8[_0x8b1d('0x30')],_0x3aaee8['query']);_0x8b3212[_0x8b1d('0x35')]=_['intersection'](_0x3aaee8[_0x8b1d('0x30')],qs[_0x8b1d('0x46')](_0x4263e2[_0x8b1d('0x32')][_0x8b1d('0x46')]));_0x8b3212[_0x8b1d('0x35')]=_0x8b3212[_0x8b1d('0x35')][_0x8b1d('0x36')]?_0x8b3212[_0x8b1d('0x35')]:_0x3aaee8[_0x8b1d('0x30')];if(_0x4263e2[_0x8b1d('0x32')][_0x8b1d('0x47')]){_0x8b3212['include']=[{'all':!![]}];}_0x8b3212=_[_0x8b1d('0x3d')]({},_0x8b3212,_0x4263e2[_0x8b1d('0x40')]);return db[_0x8b1d('0x2b')][_0x8b1d('0x48')](_0x8b3212)[_0x8b1d('0x26')](handleEntityNotFound(_0x1e84da,null))['then'](respondWithResult(_0x1e84da,null))[_0x8b1d('0x43')](handleError(_0x1e84da,null));};exports[_0x8b1d('0x25')]=function(_0x2cf05d,_0x3dd3f5){if(_0x2cf05d[_0x8b1d('0x49')]['id']){delete _0x2cf05d[_0x8b1d('0x49')]['id'];}return db[_0x8b1d('0x2b')][_0x8b1d('0x48')]({'where':{'id':_0x2cf05d[_0x8b1d('0x44')]['id']}})[_0x8b1d('0x26')](handleEntityNotFound(_0x3dd3f5,null))[_0x8b1d('0x26')](saveUpdates(_0x2cf05d[_0x8b1d('0x49')],null))[_0x8b1d('0x26')](respondWithResult(_0x3dd3f5,null))['catch'](handleError(_0x3dd3f5,null));};exports[_0x8b1d('0x27')]=function(_0x14e4e8,_0x58007e){return db[_0x8b1d('0x2b')][_0x8b1d('0x48')]({'where':{'id':_0x14e4e8[_0x8b1d('0x44')]['id']}})[_0x8b1d('0x26')](handleEntityNotFound(_0x58007e,null))[_0x8b1d('0x26')](removeEntity(_0x58007e,null))[_0x8b1d('0x43')](handleError(_0x58007e,null));};exports[_0x8b1d('0x4a')]=function(_0x484d4c,_0x198882){return db[_0x8b1d('0x2b')][_0x8b1d('0x4a')]()[_0x8b1d('0x26')](respondWithResult(_0x198882,null))[_0x8b1d('0x43')](handleError(_0x198882,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 3d7a837..9837bb8 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 _0x9758=['define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x22c9ea,_0x59513d){var _0x5077fb=function(_0x473d98){while(--_0x473d98){_0x22c9ea['push'](_0x22c9ea['shift']());}};_0x5077fb(++_0x59513d);}(_0x9758,0x13b));var _0x8975=function(_0x435826,_0x241abf){_0x435826=_0x435826-0x0;var _0x176b56=_0x9758[_0x435826];return _0x176b56;};'use strict';var _=require(_0x8975('0x0'));var util=require('util');var logger=require(_0x8975('0x1'))('api');var moment=require(_0x8975('0x2'));var BPromise=require(_0x8975('0x3'));var rp=require(_0x8975('0x4'));var fs=require('fs');var path=require(_0x8975('0x5'));var rimraf=require(_0x8975('0x6'));var config=require(_0x8975('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0x8975('0x8')]=function(_0x1d336b,_0x5cb00b){return _0x1d336b[_0x8975('0x9')](_0x8975('0xa'),attributes,{'tableName':_0x8975('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74f6=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0xe1e381,_0x866ef7){var _0x26bce0=function(_0x2e12fe){while(--_0x2e12fe){_0xe1e381['push'](_0xe1e381['shift']());}};_0x26bce0(++_0x866ef7);}(_0x74f6,0x198));var _0x674f=function(_0x3b9a57,_0x46139f){_0x3b9a57=_0x3b9a57-0x0;var _0x569020=_0x74f6[_0x3b9a57];return _0x569020;};'use strict';var _=require(_0x674f('0x0'));var util=require(_0x674f('0x1'));var logger=require(_0x674f('0x2'))('api');var moment=require(_0x674f('0x3'));var BPromise=require(_0x674f('0x4'));var rp=require(_0x674f('0x5'));var fs=require('fs');var path=require(_0x674f('0x6'));var rimraf=require(_0x674f('0x7'));var config=require(_0x674f('0x8'));var attributes=require(_0x674f('0x9'));module[_0x674f('0xa')]=function(_0x484007,_0x11bcfe){return _0x484007[_0x674f('0xb')](_0x674f('0xc'),attributes,{'tableName':_0x674f('0xd'),'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 0111522..87f3c9e 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 _0xb5a3=['result','catch','CmHopperBlack','findAll','options','raw','attributes','limit','map','include','model','GetCmHopperBlack','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','where','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb5a3,0xef));var _0x3b5a=function(_0x3f25db,_0x1d3686){_0x3f25db=_0x3f25db-0x0;var _0x54f29d=_0xb5a3[_0x3f25db];return _0x54f29d;};'use strict';var _=require(_0x3b5a('0x0'));var util=require('util');var moment=require(_0x3b5a('0x1'));var BPromise=require(_0x3b5a('0x2'));var rs=require(_0x3b5a('0x3'));var fs=require('fs');var Redis=require(_0x3b5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3b5a('0x5'))(_0x3b5a('0x6'));var config=require(_0x3b5a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3b5a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353036,_0x5f4119,_0x44660b){return new BPromise(function(_0x4d89d8,_0x23adc6){return client[_0x3b5a('0x9')](_0x353036,_0x44660b)[_0x3b5a('0xa')](function(_0x35169e){logger[_0x3b5a('0xb')]('CmHopperBlack,\x20%s,\x20%s',_0x5f4119,_0x3b5a('0xc'));logger[_0x3b5a('0xd')](_0x3b5a('0xe'),_0x5f4119,_0x3b5a('0xc'),JSON[_0x3b5a('0xf')](_0x35169e));if(_0x35169e[_0x3b5a('0x10')]){if(_0x35169e[_0x3b5a('0x10')][_0x3b5a('0x11')]===0x1f4){logger['error'](_0x3b5a('0x12'),_0x5f4119,_0x35169e[_0x3b5a('0x10')]['message']);return _0x23adc6(_0x35169e['error']['message']);}logger[_0x3b5a('0x10')](_0x3b5a('0x12'),_0x5f4119,_0x35169e['error'][_0x3b5a('0x13')]);return _0x4d89d8(_0x35169e['error']['message']);}else{logger[_0x3b5a('0xb')](_0x3b5a('0x12'),_0x5f4119,'request\x20sent');_0x4d89d8(_0x35169e[_0x3b5a('0x14')][_0x3b5a('0x13')]);}})[_0x3b5a('0x15')](function(_0x48a088){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x5f4119,_0x48a088);_0x23adc6(_0x48a088);});});}exports['GetCmHopperBlack']=function(_0x698d3d){var _0x275631=this;return new Promise(function(_0x12c563,_0x3c393a){return db[_0x3b5a('0x16')][_0x3b5a('0x17')]({'raw':_0x698d3d[_0x3b5a('0x18')]?_0x698d3d[_0x3b5a('0x18')][_0x3b5a('0x19')]===undefined?!![]:![]:!![],'where':_0x698d3d['options']?_0x698d3d['options']['where']||null:null,'attributes':_0x698d3d[_0x3b5a('0x18')]?_0x698d3d[_0x3b5a('0x18')][_0x3b5a('0x1a')]||null:null,'limit':_0x698d3d[_0x3b5a('0x18')]?_0x698d3d[_0x3b5a('0x18')][_0x3b5a('0x1b')]||null:null,'include':_0x698d3d[_0x3b5a('0x18')]?_0x698d3d['options']['include']?_[_0x3b5a('0x1c')](_0x698d3d[_0x3b5a('0x18')][_0x3b5a('0x1d')],function(_0x11ec48){return{'model':db[_0x11ec48[_0x3b5a('0x1e')]],'as':_0x11ec48['as'],'attributes':_0x11ec48['attributes'],'include':_0x11ec48['include']?_['map'](_0x11ec48['include'],function(_0x3136aa){return{'model':db[_0x3136aa[_0x3b5a('0x1e')]],'as':_0x3136aa['as'],'attributes':_0x3136aa[_0x3b5a('0x1a')],'include':_0x3136aa[_0x3b5a('0x1d')]?_[_0x3b5a('0x1c')](_0x3136aa['include'],function(_0x12d301){return{'model':db[_0x12d301['model']],'as':_0x12d301['as'],'attributes':_0x12d301['attributes']};}):[]};}):[]};}):[]:[]})[_0x3b5a('0xa')](function(_0x5700e4){logger[_0x3b5a('0xb')](_0x3b5a('0x1f'),_0x698d3d);logger[_0x3b5a('0xd')](_0x3b5a('0x1f'),_0x698d3d,JSON[_0x3b5a('0xf')](_0x5700e4));_0x12c563(_0x5700e4);})['catch'](function(_0x1dc076){logger[_0x3b5a('0x10')](_0x3b5a('0x1f'),_0x1dc076[_0x3b5a('0x13')],_0x698d3d);_0x3c393a(_0x275631['error'](0x1f4,_0x1dc076['message']));});});};exports[_0x3b5a('0x20')]=function(_0x4f33f4){var _0x1af3aa=this;return new Promise(function(_0x4fd57c,_0x1775c6){return db[_0x3b5a('0x16')]['update'](_0x4f33f4[_0x3b5a('0x21')],{'raw':_0x4f33f4[_0x3b5a('0x18')]?_0x4f33f4['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f33f4[_0x3b5a('0x18')]?_0x4f33f4[_0x3b5a('0x18')]['where']||null:null,'attributes':_0x4f33f4[_0x3b5a('0x18')]?_0x4f33f4[_0x3b5a('0x18')]['attributes']||null:null,'limit':_0x4f33f4['options']?_0x4f33f4[_0x3b5a('0x18')][_0x3b5a('0x1b')]||null:null})['then'](function(_0x1829b3){logger['info'](_0x3b5a('0x20'),_0x4f33f4);logger[_0x3b5a('0xd')](_0x3b5a('0x20'),_0x4f33f4,JSON['stringify'](_0x1829b3));_0x4fd57c(_0x1829b3);})[_0x3b5a('0x15')](function(_0x2c5ca1){logger['error']('UpdateCmHopperBlack',_0x2c5ca1[_0x3b5a('0x13')],_0x4f33f4);_0x1775c6(_0x1af3aa[_0x3b5a('0x10')](0x1f4,_0x2c5ca1[_0x3b5a('0x13')]));});});};exports[_0x3b5a('0x22')]=function(_0x417ac8){var _0x4dbf7c=this;return new Promise(function(_0x28b5a5,_0x8906bb){return db[_0x3b5a('0x16')][_0x3b5a('0x23')]({'where':_0x417ac8[_0x3b5a('0x18')]?_0x417ac8['options'][_0x3b5a('0x24')]||null:null})['then'](function(_0x1046d8){logger[_0x3b5a('0xb')]('DestroyCmHopperBlack',_0x417ac8);logger[_0x3b5a('0xd')](_0x3b5a('0x22'),_0x417ac8,JSON[_0x3b5a('0xf')](_0x1046d8));_0x28b5a5(_0x1046d8);})[_0x3b5a('0x15')](function(_0x41f6ea){logger[_0x3b5a('0x10')]('DestroyCmHopperBlack',_0x41f6ea[_0x3b5a('0x13')],_0x417ac8);_0x8906bb(_0x4dbf7c['error'](0x1f4,_0x41f6ea['message']));});});}; \ No newline at end of file +var _0xb512=['where','attributes','include','map','model','UpdateCmHopperBlack','body','limit','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw'];(function(_0xc47ddd,_0x364962){var _0x48a501=function(_0x13d2f4){while(--_0x13d2f4){_0xc47ddd['push'](_0xc47ddd['shift']());}};_0x48a501(++_0x364962);}(_0xb512,0x81));var _0x2b51=function(_0x2a025b,_0x5359a6){_0x2a025b=_0x2a025b-0x0;var _0x357db7=_0xb512[_0x2a025b];return _0x357db7;};'use strict';var _=require(_0x2b51('0x0'));var util=require(_0x2b51('0x1'));var moment=require(_0x2b51('0x2'));var BPromise=require(_0x2b51('0x3'));var rs=require(_0x2b51('0x4'));var fs=require('fs');var Redis=require(_0x2b51('0x5'));var db=require(_0x2b51('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b51('0x7'))(_0x2b51('0x8'));var config=require(_0x2b51('0x9'));var jayson=require(_0x2b51('0xa'));var client=jayson[_0x2b51('0xb')][_0x2b51('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa7affd,_0x52e96b,_0x2b13d1){return new BPromise(function(_0x239c5c,_0x2c4ee0){return client[_0x2b51('0xd')](_0xa7affd,_0x2b13d1)[_0x2b51('0xe')](function(_0x17cc96){logger['info'](_0x2b51('0xf'),_0x52e96b,_0x2b51('0x10'));logger[_0x2b51('0x11')](_0x2b51('0x12'),_0x52e96b,_0x2b51('0x10'),JSON[_0x2b51('0x13')](_0x17cc96));if(_0x17cc96['error']){if(_0x17cc96[_0x2b51('0x14')][_0x2b51('0x15')]===0x1f4){logger['error'](_0x2b51('0xf'),_0x52e96b,_0x17cc96[_0x2b51('0x14')][_0x2b51('0x16')]);return _0x2c4ee0(_0x17cc96[_0x2b51('0x14')]['message']);}logger[_0x2b51('0x14')](_0x2b51('0xf'),_0x52e96b,_0x17cc96['error']['message']);return _0x239c5c(_0x17cc96[_0x2b51('0x14')][_0x2b51('0x16')]);}else{logger[_0x2b51('0x17')](_0x2b51('0xf'),_0x52e96b,_0x2b51('0x10'));_0x239c5c(_0x17cc96[_0x2b51('0x18')][_0x2b51('0x16')]);}})[_0x2b51('0x19')](function(_0x1a155b){logger[_0x2b51('0x14')](_0x2b51('0xf'),_0x52e96b,_0x1a155b);_0x2c4ee0(_0x1a155b);});});}exports[_0x2b51('0x1a')]=function(_0x2cd04d){var _0x43f88f=this;return new Promise(function(_0x4b5b36,_0xacad18){return db[_0x2b51('0x1b')][_0x2b51('0x1c')]({'raw':_0x2cd04d[_0x2b51('0x1d')]?_0x2cd04d[_0x2b51('0x1d')][_0x2b51('0x1e')]===undefined?!![]:![]:!![],'where':_0x2cd04d[_0x2b51('0x1d')]?_0x2cd04d[_0x2b51('0x1d')][_0x2b51('0x1f')]||null:null,'attributes':_0x2cd04d[_0x2b51('0x1d')]?_0x2cd04d[_0x2b51('0x1d')][_0x2b51('0x20')]||null:null,'limit':_0x2cd04d[_0x2b51('0x1d')]?_0x2cd04d[_0x2b51('0x1d')]['limit']||null:null,'include':_0x2cd04d[_0x2b51('0x1d')]?_0x2cd04d[_0x2b51('0x1d')][_0x2b51('0x21')]?_[_0x2b51('0x22')](_0x2cd04d[_0x2b51('0x1d')][_0x2b51('0x21')],function(_0xf510b9){return{'model':db[_0xf510b9['model']],'as':_0xf510b9['as'],'attributes':_0xf510b9[_0x2b51('0x20')],'include':_0xf510b9[_0x2b51('0x21')]?_['map'](_0xf510b9[_0x2b51('0x21')],function(_0xd5fb0f){return{'model':db[_0xd5fb0f[_0x2b51('0x23')]],'as':_0xd5fb0f['as'],'attributes':_0xd5fb0f['attributes'],'include':_0xd5fb0f[_0x2b51('0x21')]?_['map'](_0xd5fb0f[_0x2b51('0x21')],function(_0x211f71){return{'model':db[_0x211f71[_0x2b51('0x23')]],'as':_0x211f71['as'],'attributes':_0x211f71['attributes']};}):[]};}):[]};}):[]:[]})[_0x2b51('0xe')](function(_0x132e3b){logger['info']('GetCmHopperBlack',_0x2cd04d);logger['debug'](_0x2b51('0x1a'),_0x2cd04d,JSON[_0x2b51('0x13')](_0x132e3b));_0x4b5b36(_0x132e3b);})[_0x2b51('0x19')](function(_0x2413e5){logger[_0x2b51('0x14')](_0x2b51('0x1a'),_0x2413e5[_0x2b51('0x16')],_0x2cd04d);_0xacad18(_0x43f88f['error'](0x1f4,_0x2413e5['message']));});});};exports[_0x2b51('0x24')]=function(_0x51b6fc){var _0x353eae=this;return new Promise(function(_0x5623f1,_0x41f2ca){return db[_0x2b51('0x1b')]['update'](_0x51b6fc[_0x2b51('0x25')],{'raw':_0x51b6fc['options']?_0x51b6fc['options'][_0x2b51('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51b6fc[_0x2b51('0x1d')]?_0x51b6fc[_0x2b51('0x1d')][_0x2b51('0x1f')]||null:null,'attributes':_0x51b6fc[_0x2b51('0x1d')]?_0x51b6fc[_0x2b51('0x1d')][_0x2b51('0x20')]||null:null,'limit':_0x51b6fc[_0x2b51('0x1d')]?_0x51b6fc['options'][_0x2b51('0x26')]||null:null})[_0x2b51('0xe')](function(_0x34ce50){logger[_0x2b51('0x17')](_0x2b51('0x24'),_0x51b6fc);logger[_0x2b51('0x11')](_0x2b51('0x24'),_0x51b6fc,JSON['stringify'](_0x34ce50));_0x5623f1(_0x34ce50);})['catch'](function(_0x4867bf){logger[_0x2b51('0x14')](_0x2b51('0x24'),_0x4867bf[_0x2b51('0x16')],_0x51b6fc);_0x41f2ca(_0x353eae['error'](0x1f4,_0x4867bf[_0x2b51('0x16')]));});});};exports[_0x2b51('0x27')]=function(_0x429051){var _0x180bad=this;return new Promise(function(_0x1ec7c3,_0x233a13){return db['CmHopperBlack']['destroy']({'where':_0x429051[_0x2b51('0x1d')]?_0x429051['options'][_0x2b51('0x1f')]||null:null})[_0x2b51('0xe')](function(_0x1d6e9b){logger[_0x2b51('0x17')](_0x2b51('0x27'),_0x429051);logger['debug'](_0x2b51('0x27'),_0x429051,JSON[_0x2b51('0x13')](_0x1d6e9b));_0x1ec7c3(_0x1d6e9b);})[_0x2b51('0x19')](function(_0x248177){logger['error']('DestroyCmHopperBlack',_0x248177[_0x2b51('0x16')],_0x429051);_0x233a13(_0x180bad['error'](0x1f4,_0x248177[_0x2b51('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index ba8130e..4d77e0c 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 _0x8f9d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','/:id','show','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8f9d,0x93));var _0xd8f9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f9d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['describe']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['put']('/:id',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0x10')](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);module[_0xd8f9('0x12')]=router; \ No newline at end of file +var _0xed1c=['describe','/:id','show','put','delete','destroy','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe'];(function(_0x506845,_0x7ede0){var _0x452d22=function(_0x293318){while(--_0x293318){_0x506845['push'](_0x506845['shift']());}};_0x452d22(++_0x7ede0);}(_0xed1c,0xe4));var _0xced1=function(_0x2cc343,_0x1ebd6b){_0x2cc343=_0x2cc343-0x0;var _0x3a1e01=_0xed1c[_0x2cc343];return _0x3a1e01;};'use strict';var multer=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xced1('0x2'));var auth=require(_0xced1('0x3'));var interaction=require(_0xced1('0x4'));var config=require('../../config/environment');var controller=require(_0xced1('0x5'));router[_0xced1('0x6')]('/',auth[_0xced1('0x7')](),controller[_0xced1('0x8')]);router['get'](_0xced1('0x9'),auth[_0xced1('0x7')](),controller[_0xced1('0xa')]);router[_0xced1('0x6')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xc')]);router[_0xced1('0xd')]('/:id',auth[_0xced1('0x7')](),controller['update']);router[_0xced1('0xe')](_0xced1('0xb'),auth[_0xced1('0x7')](),controller[_0xced1('0xf')]);module[_0xced1('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 92572f5..a113f02 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 _0x2f92=['followuptime','diff','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue'];(function(_0x41b0fd,_0x19421a){var _0x450672=function(_0x186de8){while(--_0x186de8){_0x41b0fd['push'](_0x41b0fd['shift']());}};_0x450672(++_0x19421a);}(_0x2f92,0xba));var _0x22f9=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x2f92[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x22f9('0x0'));var moment=require(_0x22f9('0x1'));module[_0x22f9('0x2')]={'state':{'type':Sequelize[_0x22f9('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x22f9('0x4')]},'scheduledat':{'type':Sequelize[_0x22f9('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x22f9('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x22f9('0x4')]},'originatecalleridname':{'type':Sequelize[_0x22f9('0x4')]},'calleridnum':{'type':Sequelize[_0x22f9('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x22f9('0x5')]},'responsetime':{'type':Sequelize[_0x22f9('0x5')]},'answertime':{'type':Sequelize[_0x22f9('0x5')]},'droptime':{'type':Sequelize[_0x22f9('0x5')]},'endtime':{'type':Sequelize[_0x22f9('0x5')]},'ringtime':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x22f9('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x22f9('0x4')]},'membername':{'type':Sequelize[_0x22f9('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x22f9('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x22f9('0x4')]},'dispositionat':{'type':Sequelize[_0x22f9('0x5')],'set':function(_0x1ef182){var _0x14b759=this[_0x22f9('0x6')](_0x22f9('0x7'));if(_0x14b759&&_0x1ef182){this[_0x22f9('0x8')](_0x22f9('0x9'),moment(_0x1ef182)[_0x22f9('0xa')](moment(_0x14b759),'seconds'));}return this[_0x22f9('0x8')](_0x22f9('0xb'),_0x1ef182);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x22f9('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x22f9('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x22f9('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x22f9('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x22f9('0x5')]},'deleted':{'type':Sequelize[_0x22f9('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x22f9('0x5')]},'recallme':{'type':Sequelize[_0x22f9('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x22f9('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf895=['INTEGER','getDataValue','followuptime','seconds','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports','STRING','DATE'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0xf895,0xaf));var _0x5f89=function(_0x29612b,_0x442a13){_0x29612b=_0x29612b-0x0;var _0x4a3459=_0xf895[_0x29612b];return _0x4a3459;};'use strict';var Sequelize=require(_0x5f89('0x0'));var moment=require(_0x5f89('0x1'));module[_0x5f89('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5f89('0x3')]},'scheduledat':{'type':Sequelize[_0x5f89('0x4')]},'countbusyretry':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5f89('0x3')]},'starttime':{'type':Sequelize[_0x5f89('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x5f89('0x4')]},'endtime':{'type':Sequelize[_0x5f89('0x4')]},'ringtime':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x5f89('0x3')]},'campaigntype':{'type':Sequelize[_0x5f89('0x3')]},'membername':{'type':Sequelize[_0x5f89('0x3')]},'reason':{'type':Sequelize[_0x5f89('0x3')]},'disposition':{'type':Sequelize[_0x5f89('0x3')]},'secondDisposition':{'type':Sequelize[_0x5f89('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x5f89('0x4')],'set':function(_0x1a5e31){var _0x25d93f=this[_0x5f89('0x6')]('endtime');if(_0x25d93f&&_0x1a5e31){this['setDataValue'](_0x5f89('0x7'),moment(_0x1a5e31)['diff'](moment(_0x25d93f),_0x5f89('0x8')));}return this[_0x5f89('0x9')](_0x5f89('0xa'),_0x1a5e31);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x5f89('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5f89('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5f89('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5f89('0x4')]},'callback':{'type':Sequelize[_0x5f89('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5f89('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5f89('0x4')]},'deleted':{'type':Sequelize[_0x5f89('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5f89('0x4')]},'recallme':{'type':Sequelize[_0x5f89('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5f89('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5f89('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5f89('0x5')],'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 74f9816..15a6e50 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 _0x5d58=['calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','CmHopperFinal','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','describe','catch','body','find','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x329d13,_0x1aff27){var _0x33efd9=function(_0x265b7d){while(--_0x265b7d){_0x329d13['push'](_0x329d13['shift']());}};_0x33efd9(++_0x1aff27);}(_0x5d58,0x187));var _0x85d5=function(_0x1bec0f,_0x2b7f31){_0x1bec0f=_0x1bec0f-0x0;var _0x43ce63=_0x5d58[_0x1bec0f];return _0x43ce63;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['CmHopperFinal']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':!![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['CmHopperFinal'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')]()['then'](respondWithResult(_0x12a03,null))[_0x85d5('0x40')](handleError(_0x12a03,null));};exports['update']=function(_0x1f2ef9,_0xd8db57){if(_0x1f2ef9[_0x85d5('0x41')]['uniqueid']){delete _0x1f2ef9['body']['uniqueid'];}return db[_0x85d5('0x34')][_0x85d5('0x42')]({'where':{'uniqueid':_0x1f2ef9[_0x85d5('0x39')]['id']}})['then'](handleEntityNotFound(_0xd8db57,null))['then'](saveUpdates(_0x1f2ef9[_0x85d5('0x41')],null))[_0x85d5('0x1c')](respondWithResult(_0xd8db57,null))[_0x85d5('0x40')](handleError(_0xd8db57,null));};exports[_0x85d5('0x43')]=function(_0x4b2dce,_0x3f69ea,_0x29442a){return db[_0x85d5('0x34')][_0x85d5('0x36')]({'raw':![],'where':{'VoiceQueueId':_0x4b2dce[_0x85d5('0x39')]['id']},'attributes':[[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),_0x85d5('0x48')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x85d5('0x4e')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x4f')))),_0x85d5('0x50')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x2022,\x201,\x20null'))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize'][_0x85d5('0x46')](_0x85d5('0x52')))),_0x85d5('0x53')]]})['then'](handleEntityNotFound(_0x3f69ea,null))[_0x85d5('0x1c')](respondWithResult(_0x3f69ea,null))[_0x85d5('0x40')](handleError(_0x3f69ea,null));};exports[_0x85d5('0x54')]=function(_0x561bde,_0x34aa42,_0x1c3e2c){return db['CmHopperFinal'][_0x85d5('0x36')]({'raw':![],'where':{'CampaignId':_0x561bde['params']['id']},'attributes':[[db[_0x85d5('0x44')]['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x47')))),'noSuchContacts'],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x49')))),_0x85d5('0x4a')],[db[_0x85d5('0x44')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85d5('0x44')]['literal'](_0x85d5('0x4b')))),_0x85d5('0x4c')],[db['sequelize']['fn']('COUNT',db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')]('`state`\x20=\x208,\x201,\x20null'))),_0x85d5('0x4d')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db['sequelize']['literal'](_0x85d5('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x85d5('0x50')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db['sequelize']['fn']('IF',db[_0x85d5('0x44')][_0x85d5('0x46')](_0x85d5('0x56')))),_0x85d5('0x51')],[db[_0x85d5('0x44')]['fn'](_0x85d5('0x45'),db[_0x85d5('0x44')]['fn']('IF',db[_0x85d5('0x44')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),_0x85d5('0x53')]]})[_0x85d5('0x1c')](handleEntityNotFound(_0x34aa42,null))[_0x85d5('0x1c')](respondWithResult(_0x34aa42,null))['catch'](handleError(_0x34aa42,null));};exports[_0x85d5('0x57')]=function(_0x1fdefb,_0x496586,_0x2dbd18){return db[_0x85d5('0x58')][_0x85d5('0x42')]({'where':{'id':_0x1fdefb[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x496586,null))['then'](function(_0x35ba15){var _0x1b96eb;if(_0x35ba15){_0x1b96eb=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')](_0x85d5('0x5b'))['fromQuery']([_0x85d5('0x5c'),_0x85d5('0x5d'),_0x85d5('0x5e'),_0x85d5('0x5f'),_0x85d5('0x60'),_0x85d5('0x61'),_0x85d5('0x62')],squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x65'),'phone')[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x5d'))[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))['field'](_0x85d5('0x68'),'ListId')['field'](_0x85d5('0x69'),_0x85d5('0x60'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x61'))[_0x85d5('0x64')](_0x85d5('0x66'),_0x85d5('0x62'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x1fdefb[_0x85d5('0x41')][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6f'))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('phone')['from'](_0x85d5('0x5b'))['where'](_0x85d5('0x6b'),_0x1fdefb[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')](_0x85d5('0x71'))[_0x85d5('0x6a')]('cm_hopper_final')[_0x85d5('0x30')](_0x85d5('0x6b'),_0x1fdefb['params']['id'][_0x85d5('0x6c')]())['where'](_0x85d5('0x72')))[_0x85d5('0x73')](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db['sequelize'][_0x85d5('0x27')](_0x1b96eb);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x496586,null))['catch'](handleError(_0x496586,null));};exports[_0x85d5('0x74')]=function(_0x14e4e8,_0x57f26b,_0x45b1e2){return db[_0x85d5('0x75')][_0x85d5('0x42')]({'where':{'id':_0x14e4e8['params']['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x57f26b,null))[_0x85d5('0x1c')](function(_0x2dacf7){var _0x387a3b;if(_0x2dacf7){_0x387a3b=squel[_0x85d5('0x59')]()[_0x85d5('0x5a')]('cm_hopper')[_0x85d5('0x76')]([_0x85d5('0x5c'),'scheduledAt',_0x85d5('0x5e'),'ListId',_0x85d5('0x77'),_0x85d5('0x61'),_0x85d5('0x62')],squel['select']()[_0x85d5('0x64')](_0x85d5('0x65'),_0x85d5('0x5c'))[_0x85d5('0x64')](_0x85d5('0x66'),'scheduledAt')[_0x85d5('0x64')](_0x85d5('0x67'),_0x85d5('0x5e'))[_0x85d5('0x64')]('ANY_VALUE(ListId)',_0x85d5('0x5f'))[_0x85d5('0x64')](_0x85d5('0x78'),'CampaignId')[_0x85d5('0x64')]('NOW()',_0x85d5('0x61'))[_0x85d5('0x64')]('NOW()','updatedAt')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id'][_0x85d5('0x6c')]())[_0x85d5('0x30')](_0x85d5('0x6d'),_0x14e4e8['body'][_0x85d5('0x6e')][_0x85d5('0x6c')]())[_0x85d5('0x30')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x85d5('0x30')](_0x85d5('0x70'),squel['select']()[_0x85d5('0x64')](_0x85d5('0x5c'))[_0x85d5('0x6a')](_0x85d5('0x5b'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']()))[_0x85d5('0x30')](_0x85d5('0x70'),squel[_0x85d5('0x63')]()[_0x85d5('0x64')]('calleridnum')[_0x85d5('0x6a')](_0x85d5('0x79'))[_0x85d5('0x30')](_0x85d5('0x7a'),_0x14e4e8[_0x85d5('0x39')]['id']['toString']())['where'](_0x85d5('0x72')))['group'](_0x85d5('0x5e')))[_0x85d5('0x6c')]();return db[_0x85d5('0x44')][_0x85d5('0x27')](_0x387a3b);}return[];})[_0x85d5('0x1c')](respondWithResult(_0x57f26b,null))[_0x85d5('0x40')](handleError(_0x57f26b,null));};exports[_0x85d5('0x7b')]=function(_0x48553d,_0xedb32d,_0x5366bc){return db[_0x85d5('0x7c')][_0x85d5('0x7d')]({'where':{'VoiceQueueId':_0x48553d[_0x85d5('0x41')]['VoiceQueueId'],'CampaignId':_0x48553d[_0x85d5('0x41')][_0x85d5('0x77')],'ContactId':_0x48553d[_0x85d5('0x41')]['ContactId']}})['then'](handleEntityNotFound(_0xedb32d,null))[_0x85d5('0x1c')](function(_0x428fd4){if(_0x428fd4){return _0x428fd4;}return null;})['then'](respondWithResult(_0xedb32d,null))[_0x85d5('0x40')](handleError(_0xedb32d,null));}; \ No newline at end of file +var _0xc6ac=['key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','VoiceQueueId','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','into','CampaignId','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','CmHopperFinal','rawAttributes','fieldName','type'];(function(_0x397a7c,_0x390621){var _0x3c8698=function(_0x39625a){while(--_0x39625a){_0x397a7c['push'](_0x397a7c['shift']());}};_0x3c8698(++_0x390621);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x566681,_0x54aaf1){_0x566681=_0x566681-0x0;var _0x4f3524=_0xc6ac[_0x566681];return _0x4f3524;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':!![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['describe']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')]()[_0xcc6a('0x27')](respondWithResult(_0x47c999,null))[_0xcc6a('0x4b')](handleError(_0x47c999,null));};exports['update']=function(_0x1c3bb8,_0x5e7bab){if(_0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')]){delete _0x1c3bb8[_0xcc6a('0x4d')][_0xcc6a('0x4e')];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'uniqueid':_0x1c3bb8['params']['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5e7bab,null))[_0xcc6a('0x27')](saveUpdates(_0x1c3bb8[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x5e7bab,null))[_0xcc6a('0x4b')](handleError(_0x5e7bab,null));};exports[_0xcc6a('0x4f')]=function(_0x431684,_0x392805,_0x31987f){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x431684[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db['sequelize']['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal'](_0xcc6a('0x59')))),'abandonedContacts'],[db[_0xcc6a('0x50')]['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')]('`state`\x20=\x2022,\x201,\x20null'))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})[_0xcc6a('0x27')](handleEntityNotFound(_0x392805,null))[_0xcc6a('0x27')](respondWithResult(_0x392805,null))[_0xcc6a('0x4b')](handleError(_0x392805,null));};exports[_0xcc6a('0x5d')]=function(_0x3e76d7,_0x42bbc7,_0x2ad9a6){return db[_0xcc6a('0x2d')]['findAll']({'raw':![],'where':{'CampaignId':_0x3e76d7[_0xcc6a('0x47')]['id']},'attributes':[[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x5e')))),_0xcc6a('0x5f')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x53')))),_0xcc6a('0x54')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x55')))),'busyContacts'],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db[_0xcc6a('0x50')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xcc6a('0x56')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db[_0xcc6a('0x50')]['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x57')))),_0xcc6a('0x58')],[db[_0xcc6a('0x50')]['fn'](_0xcc6a('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0xcc6a('0x52')](_0xcc6a('0x59')))),_0xcc6a('0x60')],[db[_0xcc6a('0x50')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x61')))),_0xcc6a('0x5a')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcc6a('0x50')][_0xcc6a('0x52')](_0xcc6a('0x5b')))),_0xcc6a('0x5c')]]})['then'](handleEntityNotFound(_0x42bbc7,null))[_0xcc6a('0x27')](respondWithResult(_0x42bbc7,null))[_0xcc6a('0x4b')](handleError(_0x42bbc7,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x72e53a,_0x5b61df,_0x3b4ce0){return db['VoiceQueue'][_0xcc6a('0x4a')]({'where':{'id':_0x72e53a[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0x5b61df,null))['then'](function(_0x3ce1eb){var _0x51390a;if(_0x3ce1eb){_0x51390a=squel[_0xcc6a('0x62')]()['into'](_0xcc6a('0x63'))[_0xcc6a('0x64')]([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'VoiceQueueId',_0xcc6a('0x69'),_0xcc6a('0x6a')],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),'phone')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'scheduledAt')['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(VoiceQueueId)',_0xcc6a('0x71'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x69'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),'updatedAt')['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x72e53a['body'][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x65'))[_0xcc6a('0x79')]('cm_hopper')[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')](_0xcc6a('0x78'),squel['select']()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))['from'](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x73'),_0x72e53a[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]())['where'](_0xcc6a('0x7b')))[_0xcc6a('0x7c')](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0x51390a);}return[];})['then'](respondWithResult(_0x5b61df,null))['catch'](handleError(_0x5b61df,null));};exports[_0xcc6a('0x7d')]=function(_0x5be65b,_0xb42e9,_0x35a798){return db[_0xcc6a('0x7e')][_0xcc6a('0x4a')]({'where':{'id':_0x5be65b[_0xcc6a('0x47')]['id']}})[_0xcc6a('0x27')](handleEntityNotFound(_0xb42e9,null))[_0xcc6a('0x27')](function(_0x1746d8){var _0xc0d194;if(_0x1746d8){_0xc0d194=squel[_0xcc6a('0x62')]()[_0xcc6a('0x7f')](_0xcc6a('0x63'))['fromQuery']([_0xcc6a('0x65'),_0xcc6a('0x66'),_0xcc6a('0x67'),_0xcc6a('0x68'),'CampaignId',_0xcc6a('0x69'),'updatedAt'],squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x6d'),_0xcc6a('0x65'))[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x66'))['field'](_0xcc6a('0x6f'),_0xcc6a('0x67'))[_0xcc6a('0x6c')](_0xcc6a('0x70'),_0xcc6a('0x68'))[_0xcc6a('0x6c')]('ANY_VALUE(CampaignId)',_0xcc6a('0x80'))[_0xcc6a('0x6c')]('NOW()','createdAt')[_0xcc6a('0x6c')](_0xcc6a('0x6e'),_0xcc6a('0x6a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))['where'](_0xcc6a('0x81'),_0x5be65b['params']['id'][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x75'),_0x5be65b[_0xcc6a('0x4d')][_0xcc6a('0x76')][_0xcc6a('0x74')]())[_0xcc6a('0x3e')](_0xcc6a('0x77'))['where'](_0xcc6a('0x78'),squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')]('phone')[_0xcc6a('0x79')](_0xcc6a('0x63'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id'][_0xcc6a('0x74')]()))[_0xcc6a('0x3e')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xcc6a('0x6b')]()[_0xcc6a('0x6c')](_0xcc6a('0x7a'))[_0xcc6a('0x79')](_0xcc6a('0x72'))[_0xcc6a('0x3e')](_0xcc6a('0x81'),_0x5be65b[_0xcc6a('0x47')]['id']['toString']())['where'](_0xcc6a('0x7b')))['group'](_0xcc6a('0x67')))[_0xcc6a('0x74')]();return db[_0xcc6a('0x50')][_0xcc6a('0x33')](_0xc0d194);}return[];})[_0xcc6a('0x27')](respondWithResult(_0xb42e9,null))[_0xcc6a('0x4b')](handleError(_0xb42e9,null));};exports[_0xcc6a('0x82')]=function(_0x48b6e3,_0x10d731,_0x537e2b){return db['CmHopper'][_0xcc6a('0x83')]({'where':{'VoiceQueueId':_0x48b6e3['body'][_0xcc6a('0x71')],'CampaignId':_0x48b6e3[_0xcc6a('0x4d')]['CampaignId'],'ContactId':_0x48b6e3['body'][_0xcc6a('0x67')]}})['then'](handleEntityNotFound(_0x10d731,null))[_0xcc6a('0x27')](function(_0x3df510){if(_0x3df510){return _0x3df510;}return null;})[_0xcc6a('0x27')](respondWithResult(_0x10d731,null))[_0xcc6a('0x4b')](handleError(_0x10d731,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index df66b78..b9c1c42 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 _0x0e59=['request-promise','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4626fd,_0x5c3cbe){var _0x1cedb0=function(_0x56f76b){while(--_0x56f76b){_0x4626fd['push'](_0x4626fd['shift']());}};_0x1cedb0(++_0x5c3cbe);}(_0x0e59,0xd7));var _0x90e5=function(_0x52fbd2,_0x4c37a8){_0x52fbd2=_0x52fbd2-0x0;var _0x25567c=_0x0e59[_0x52fbd2];return _0x25567c;};'use strict';var _=require(_0x90e5('0x0'));var util=require(_0x90e5('0x1'));var logger=require(_0x90e5('0x2'))(_0x90e5('0x3'));var moment=require(_0x90e5('0x4'));var BPromise=require(_0x90e5('0x5'));var rp=require(_0x90e5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90e5('0x7'));var config=require(_0x90e5('0x8'));var attributes=require(_0x90e5('0x9'));module[_0x90e5('0xa')]=function(_0x27c56b,_0x3ffa56){return _0x27c56b['define'](_0x90e5('0xb'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':['calleridnum']},{'name':_0x90e5('0xc'),'fields':[_0x90e5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94eb=['../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x57b3df,_0x445081){var _0x206656=function(_0x16aeb3){while(--_0x16aeb3){_0x57b3df['push'](_0x57b3df['shift']());}};_0x206656(++_0x445081);}(_0x94eb,0xe8));var _0xb94e=function(_0x3d27ca,_0xf2a56c){_0x3d27ca=_0x3d27ca-0x0;var _0x88191a=_0x94eb[_0x3d27ca];return _0x88191a;};'use strict';var _=require(_0xb94e('0x0'));var util=require(_0xb94e('0x1'));var logger=require(_0xb94e('0x2'))(_0xb94e('0x3'));var moment=require(_0xb94e('0x4'));var BPromise=require('bluebird');var rp=require(_0xb94e('0x5'));var fs=require('fs');var path=require(_0xb94e('0x6'));var rimraf=require(_0xb94e('0x7'));var config=require(_0xb94e('0x8'));var attributes=require(_0xb94e('0x9'));module[_0xb94e('0xa')]=function(_0x55c4e8,_0x4bfcf2){return _0x55c4e8['define'](_0xb94e('0xb'),attributes,{'tableName':_0xb94e('0xc'),'paranoid':![],'indexes':[{'name':_0xb94e('0xd'),'fields':['calleridnum']},{'name':_0xb94e('0xe'),'fields':[_0xb94e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index ac66a5d..61dbc07 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(_0x392bb6,_0x1db862){var _0x514897=function(_0x2d727d){while(--_0x2d727d){_0x392bb6['push'](_0x392bb6['shift']());}};_0x514897(++_0x1db862);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b980d,_0x32fc6a){_0x4b980d=_0x4b980d-0x0;var _0x5c7974=_0xb10b[_0x4b980d];return _0x5c7974;};'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(_0x2d77da,_0x5d0068){var _0x41b3dc=function(_0xc8ade9){while(--_0xc8ade9){_0x2d77da['push'](_0x2d77da['shift']());}};_0x41b3dc(++_0x5d0068);}(_0xb10b,0x12a));var _0xbb10=function(_0x32ce61,_0x2ba733){_0x32ce61=_0x32ce61-0x0;var _0x28eded=_0xb10b[_0x32ce61];return _0x28eded;};'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 026df58..5bbfaa1 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 _0x7f3b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','isAuthenticated','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x94dd49,_0x2661bc){var _0x44571f=function(_0x397528){while(--_0x397528){_0x94dd49['push'](_0x94dd49['shift']());}};_0x44571f(++_0x2661bc);}(_0x7f3b,0x13e));var _0xb7f3=function(_0x5e13ee,_0x3a2f72){_0x5e13ee=_0x5e13ee-0x0;var _0x3762f8=_0x7f3b[_0x5e13ee];return _0x3762f8;};'use strict';var multer=require(_0xb7f3('0x0'));var util=require('util');var path=require(_0xb7f3('0x1'));var timeout=require(_0xb7f3('0x2'));var express=require(_0xb7f3('0x3'));var router=express[_0xb7f3('0x4')]();var fs_extra=require(_0xb7f3('0x5'));var auth=require(_0xb7f3('0x6'));var interaction=require(_0xb7f3('0x7'));var config=require(_0xb7f3('0x8'));var controller=require(_0xb7f3('0x9'));router[_0xb7f3('0xa')]('/',auth['isAuthenticated'](),controller[_0xb7f3('0xb')]);router['get']('/describe',auth[_0xb7f3('0xc')](),controller['describe']);router[_0xb7f3('0xa')](_0xb7f3('0xd'),auth[_0xb7f3('0xc')](),controller[_0xb7f3('0xe')]);router['get'](_0xb7f3('0xf'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0xb7f3('0xa')](_0xb7f3('0x10'),auth['isAuthenticated'](),controller[_0xb7f3('0x11')]);router[_0xb7f3('0x12')](_0xb7f3('0x13'),auth['isAuthenticated'](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xb7f3('0x12')](_0xb7f3('0x14'),auth[_0xb7f3('0xc')](),controller[_0xb7f3('0x15')]);router['post'](_0xb7f3('0x16'),auth[_0xb7f3('0xc')](),controller[_0xb7f3('0x17')]);router[_0xb7f3('0x18')](_0xb7f3('0xd'),auth[_0xb7f3('0xc')](),controller[_0xb7f3('0x19')]);module[_0xb7f3('0x1a')]=router; \ No newline at end of file +var _0x4658=['describe','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','put','/:id','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./cmHopperFinal.controller','get','isAuthenticated','/describe'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4658,0x74));var _0x8465=function(_0x274140,_0x494667){_0x274140=_0x274140-0x0;var _0x2c155b=_0x4658[_0x274140];return _0x2c155b;};'use strict';var multer=require(_0x8465('0x0'));var util=require(_0x8465('0x1'));var path=require(_0x8465('0x2'));var timeout=require(_0x8465('0x3'));var express=require('express');var router=express[_0x8465('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8465('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8465('0x6'));router[_0x8465('0x7')]('/',auth[_0x8465('0x8')](),controller['index']);router[_0x8465('0x7')](_0x8465('0x9'),auth[_0x8465('0x8')](),controller[_0x8465('0xa')]);router[_0x8465('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x8465('0xb')]);router[_0x8465('0x7')](_0x8465('0xc'),auth[_0x8465('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x8465('0x7')](_0x8465('0xd'),auth[_0x8465('0x8')](),controller[_0x8465('0xe')]);router[_0x8465('0xf')]('/voice/queue/moveContacts/:id',auth[_0x8465('0x8')](),controller[_0x8465('0x10')]);router[_0x8465('0xf')](_0x8465('0x11'),auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x8465('0xf')]('/checkContactHopper',auth[_0x8465('0x8')](),controller['checkContactHopper']);router[_0x8465('0x12')](_0x8465('0x13'),auth[_0x8465('0x8')](),controller['update']);module[_0x8465('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index b032b75..a378afa 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 _0x8cf7=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x8cf7,0x122));var _0x78cf=function(_0x4a9907,_0x4fbbab){_0x4a9907=_0x4a9907-0x0;var _0x564af9=_0x8cf7[_0x4a9907];return _0x564af9;};'use strict';var Sequelize=require(_0x78cf('0x0'));module[_0x78cf('0x1')]={'state':{'type':Sequelize[_0x78cf('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x78cf('0x3')]},'scheduledat':{'type':Sequelize[_0x78cf('0x4')]},'countbusyretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x78cf('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x78cf('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x78cf('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x78cf('0x4')]},'answertime':{'type':Sequelize[_0x78cf('0x4')]},'droptime':{'type':Sequelize[_0x78cf('0x4')]},'endtime':{'type':Sequelize[_0x78cf('0x4')]},'ringtime':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x78cf('0x3')]},'campaigntype':{'type':Sequelize[_0x78cf('0x3')]},'membername':{'type':Sequelize[_0x78cf('0x3')]},'reason':{'type':Sequelize[_0x78cf('0x3')]},'amd':{'type':Sequelize[_0x78cf('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x78cf('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x78cf('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x78cf('0x4')]},'recallme':{'type':Sequelize[_0x78cf('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x78cf('0x4')]},'edited':{'type':Sequelize[_0x78cf('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x78cf('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3c7e=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x2dea58,_0x59d6f0){var _0x2b23c2=function(_0x3e5c44){while(--_0x3e5c44){_0x2dea58['push'](_0x2dea58['shift']());}};_0x2b23c2(++_0x59d6f0);}(_0x3c7e,0xbf));var _0xe3c7=function(_0x5c7055,_0x550d42){_0x5c7055=_0x5c7055-0x0;var _0x20d196=_0x3c7e[_0x5c7055];return _0x20d196;};'use strict';var Sequelize=require(_0xe3c7('0x0'));module[_0xe3c7('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe3c7('0x2')]},'scheduledat':{'type':Sequelize[_0xe3c7('0x3')]},'countbusyretry':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe3c7('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe3c7('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xe3c7('0x3')]},'responsetime':{'type':Sequelize[_0xe3c7('0x3')]},'answertime':{'type':Sequelize[_0xe3c7('0x3')]},'droptime':{'type':Sequelize[_0xe3c7('0x3')]},'endtime':{'type':Sequelize[_0xe3c7('0x3')]},'ringtime':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe3c7('0x2')]},'campaign':{'type':Sequelize[_0xe3c7('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xe3c7('0x2')]},'amd':{'type':Sequelize[_0xe3c7('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xe3c7('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xe3c7('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe3c7('0x3')]},'edited':{'type':Sequelize[_0xe3c7('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe3c7('0x4')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe3c7('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index a67e49a..2182676 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 _0xe39c=['merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','describe','update','uniqueid','find','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter'];(function(_0x2b48a8,_0x55644e){var _0x5e17dd=function(_0x7bd8b){while(--_0x7bd8b){_0x2b48a8['push'](_0x2b48a8['shift']());}};_0x5e17dd(++_0x55644e);}(_0xe39c,0x1c5));var _0xce39=function(_0x30a65b,_0x3b331e){_0x30a65b=_0x30a65b-0x0;var _0x276146=_0xe39c[_0x30a65b];return _0x276146;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce39('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xce39('0x1'));var moment=require(_0xce39('0x2'));var BPromise=require(_0xce39('0x3'));var Mustache=require(_0xce39('0x4'));var util=require(_0xce39('0x5'));var path=require(_0xce39('0x6'));var sox=require('sox');var csv=require(_0xce39('0x7'));var ejs=require(_0xce39('0x8'));var fs=require('fs');var fs_extra=require(_0xce39('0x9'));var _=require(_0xce39('0xa'));var squel=require(_0xce39('0xb'));var crypto=require(_0xce39('0xc'));var jsforce=require(_0xce39('0xd'));var deskjs=require(_0xce39('0xe'));var toCsv=require(_0xce39('0x7'));var querystring=require('querystring');var Papa=require(_0xce39('0xf'));var Redis=require(_0xce39('0x10'));var authService=require(_0xce39('0x11'));var qs=require(_0xce39('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xce39('0x13'))(_0xce39('0x14'));var utils=require('../../config/utils');var config=require(_0xce39('0x15'));var licenseUtil=require(_0xce39('0x16'));var db=require(_0xce39('0x17'))['db'];function respondWithStatusCode(_0x4b8aa5,_0x301a77){_0x301a77=_0x301a77||0xcc;return function(_0x3ac807){if(_0x3ac807){return _0x4b8aa5[_0xce39('0x18')](_0x301a77);}return _0x4b8aa5['status'](_0x301a77)['end']();};}function respondWithResult(_0x5a6b09,_0x5c7fd7){_0x5c7fd7=_0x5c7fd7||0xc8;return function(_0x26b13e){if(_0x26b13e){return _0x5a6b09[_0xce39('0x19')](_0x5c7fd7)[_0xce39('0x1a')](_0x26b13e);}};}function respondWithFilteredResult(_0xaeda4f,_0x1e3b1d){return function(_0xfda088){if(_0xfda088){var _0x35bd8b=typeof _0x1e3b1d['offset']==='undefined'&&typeof _0x1e3b1d['limit']===_0xce39('0x1b');var _0x520135=_0xfda088[_0xce39('0x1c')];var _0x4a4acb=_0x35bd8b?0x0:_0x1e3b1d[_0xce39('0x1d')];var _0x24a364=_0x35bd8b?_0xfda088[_0xce39('0x1c')]:_0x1e3b1d['offset']+_0x1e3b1d[_0xce39('0x1e')];var _0x3c1da2;if(_0x24a364>=_0x520135){_0x24a364=_0x520135;_0x3c1da2=0xc8;}else{_0x3c1da2=0xce;}_0xaeda4f[_0xce39('0x19')](_0x3c1da2);return _0xaeda4f[_0xce39('0x1f')](_0xce39('0x20'),_0x4a4acb+'-'+_0x24a364+'/'+_0x520135)[_0xce39('0x1a')](_0xfda088);}return null;};}function patchUpdates(_0x194312){return function(_0x49864f){try{jsonpatch[_0xce39('0x21')](_0x49864f,_0x194312,!![]);}catch(_0x2cae99){return BPromise[_0xce39('0x22')](_0x2cae99);}return _0x49864f[_0xce39('0x23')]();};}function saveUpdates(_0x2e6430,_0x2f114a){return function(_0x1bc570){if(_0x1bc570){return _0x1bc570['update'](_0x2e6430)[_0xce39('0x24')](function(_0x282d54){return _0x282d54;});}return null;};}function removeEntity(_0x572aa0,_0x24f590){return function(_0x583d4d){if(_0x583d4d){return _0x583d4d['destroy']()[_0xce39('0x24')](function(){_0x572aa0[_0xce39('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35e6df,_0x2f0eaf){return function(_0x23f64c){if(!_0x23f64c){_0x35e6df[_0xce39('0x18')](0x194);}return _0x23f64c;};}function handleError(_0x5eab68,_0x304d9a){_0x304d9a=_0x304d9a||0x1f4;return function(_0x3fda38){logger[_0xce39('0x25')](_0x3fda38[_0xce39('0x26')]);if(_0x3fda38['name']){delete _0x3fda38[_0xce39('0x27')];}_0x5eab68[_0xce39('0x19')](_0x304d9a)[_0xce39('0x28')](_0x3fda38);};}exports[_0xce39('0x29')]=function(_0xe23111,_0x2c4b27){var _0x156f05={},_0x78a36f={},_0x466378={'count':0x0,'rows':[]};var _0x352314=_[_0xce39('0x2a')](db[_0xce39('0x2b')][_0xce39('0x2c')],function(_0x560f07){return{'name':_0x560f07['fieldName'],'type':_0x560f07[_0xce39('0x2d')]['key']};});_0x78a36f[_0xce39('0x2e')]=_[_0xce39('0x2a')](_0x352314,_0xce39('0x27'));_0x78a36f[_0xce39('0x2f')]=_[_0xce39('0x30')](_0xe23111[_0xce39('0x2f')]);_0x78a36f[_0xce39('0x31')]=_[_0xce39('0x32')](_0x78a36f[_0xce39('0x2e')],_0x78a36f['query']);_0x156f05[_0xce39('0x33')]=_[_0xce39('0x32')](_0x78a36f[_0xce39('0x2e')],qs[_0xce39('0x34')](_0xe23111['query']['fields']));_0x156f05[_0xce39('0x33')]=_0x156f05[_0xce39('0x33')]['length']?_0x156f05[_0xce39('0x33')]:_0x78a36f[_0xce39('0x2e')];if(!_0xe23111[_0xce39('0x2f')]['hasOwnProperty']('nolimit')){_0x156f05[_0xce39('0x1e')]=qs[_0xce39('0x1e')](_0xe23111['query'][_0xce39('0x1e')]);_0x156f05['offset']=qs['offset'](_0xe23111[_0xce39('0x2f')]['offset']);}_0x156f05[_0xce39('0x35')]=qs[_0xce39('0x36')](_0xe23111[_0xce39('0x2f')][_0xce39('0x36')]);_0x156f05[_0xce39('0x37')]=qs[_0xce39('0x31')](_[_0xce39('0x38')](_0xe23111['query'],_0x78a36f[_0xce39('0x31')]),_0x352314);if(_0xe23111[_0xce39('0x2f')][_0xce39('0x39')]){_0x156f05[_0xce39('0x37')]=_[_0xce39('0x3a')](_0x156f05[_0xce39('0x37')],{'$or':_[_0xce39('0x2a')](_0x352314,function(_0x21de8f){if(_0x21de8f[_0xce39('0x2d')]!==_0xce39('0x3b')){var _0x603d4c={};_0x603d4c[_0x21de8f[_0xce39('0x27')]]={'$like':'%'+_0xe23111[_0xce39('0x2f')][_0xce39('0x39')]+'%'};return _0x603d4c;}})});}_0x156f05=_[_0xce39('0x3a')]({},_0x156f05,_0xe23111[_0xce39('0x3c')]);var _0x3fbb40={'where':_0x156f05[_0xce39('0x37')]};return db['CmHopperHistory'][_0xce39('0x1c')](_0x3fbb40)['then'](function(_0x1b8ef4){_0x466378[_0xce39('0x1c')]=_0x1b8ef4;if(_0xe23111[_0xce39('0x2f')][_0xce39('0x3d')]){_0x156f05[_0xce39('0x3e')]=[{'all':!![]}];}return db[_0xce39('0x2b')][_0xce39('0x3f')](_0x156f05);})['then'](function(_0x46755a){_0x466378['rows']=_0x46755a;return _0x466378;})[_0xce39('0x24')](respondWithFilteredResult(_0x2c4b27,_0x156f05))[_0xce39('0x40')](handleError(_0x2c4b27,null));};exports[_0xce39('0x41')]=function(_0x1ac4b3,_0x151e58){var _0x158cf7={'raw':!![],'where':{'id':_0x1ac4b3[_0xce39('0x42')]['id']}},_0x24f154={};_0x24f154[_0xce39('0x2e')]=_[_0xce39('0x30')](db[_0xce39('0x2b')][_0xce39('0x2c')]);_0x24f154[_0xce39('0x2f')]=_[_0xce39('0x30')](_0x1ac4b3['query']);_0x24f154[_0xce39('0x31')]=_[_0xce39('0x32')](_0x24f154[_0xce39('0x2e')],_0x24f154[_0xce39('0x2f')]);_0x158cf7[_0xce39('0x33')]=_[_0xce39('0x32')](_0x24f154[_0xce39('0x2e')],qs[_0xce39('0x34')](_0x1ac4b3['query']['fields']));_0x158cf7['attributes']=_0x158cf7[_0xce39('0x33')]['length']?_0x158cf7[_0xce39('0x33')]:_0x24f154[_0xce39('0x2e')];if(_0x1ac4b3['query']['includeAll']){_0x158cf7[_0xce39('0x3e')]=[{'all':!![]}];}_0x158cf7=_[_0xce39('0x3a')]({},_0x158cf7,_0x1ac4b3['options']);return db['CmHopperHistory']['find'](_0x158cf7)[_0xce39('0x24')](handleEntityNotFound(_0x151e58,null))[_0xce39('0x24')](respondWithResult(_0x151e58,null))[_0xce39('0x40')](handleError(_0x151e58,null));};exports[_0xce39('0x43')]=function(_0x7029d8,_0x3950e0){return db['CmHopperHistory']['create'](_0x7029d8[_0xce39('0x44')],{})[_0xce39('0x24')](respondWithResult(_0x3950e0,0xc9))[_0xce39('0x40')](handleError(_0x3950e0,null));};exports[_0xce39('0x45')]=function(_0x44a7b3,_0x2a4d81){return db['CmHopperHistory'][_0xce39('0x45')]()[_0xce39('0x24')](respondWithResult(_0x2a4d81,null))[_0xce39('0x40')](handleError(_0x2a4d81,null));};exports[_0xce39('0x46')]=function(_0x611586,_0xecf517){if(_0x611586[_0xce39('0x44')][_0xce39('0x47')]){delete _0x611586[_0xce39('0x44')][_0xce39('0x47')];}return db[_0xce39('0x2b')][_0xce39('0x48')]({'where':{'uniqueid':_0x611586['params']['id']}})[_0xce39('0x24')](handleEntityNotFound(_0xecf517,null))['then'](saveUpdates(_0x611586[_0xce39('0x44')],null))['then'](respondWithResult(_0xecf517,null))[_0xce39('0x40')](handleError(_0xecf517,null));}; \ No newline at end of file +var _0x4e06=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','CmHopperHistory','includeAll','rows','catch','show','options','find','create','body','describe','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index'];(function(_0x2d760b,_0x2b769a){var _0xb6f0e3=function(_0x4dfa5c){while(--_0x4dfa5c){_0x2d760b['push'](_0x2d760b['shift']());}};_0xb6f0e3(++_0x2b769a);}(_0x4e06,0x72));var _0x64e0=function(_0x2cfef8,_0x230aa3){_0x2cfef8=_0x2cfef8-0x0;var _0x12167a=_0x4e06[_0x2cfef8];return _0x12167a;};'use strict';var emlformat=require(_0x64e0('0x0'));var rimraf=require(_0x64e0('0x1'));var zipdir=require(_0x64e0('0x2'));var jsonpatch=require(_0x64e0('0x3'));var rp=require(_0x64e0('0x4'));var moment=require(_0x64e0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x64e0('0x6'));var util=require(_0x64e0('0x7'));var path=require(_0x64e0('0x8'));var sox=require(_0x64e0('0x9'));var csv=require(_0x64e0('0xa'));var ejs=require(_0x64e0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x64e0('0xc'));var squel=require(_0x64e0('0xd'));var crypto=require(_0x64e0('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x64e0('0xa'));var querystring=require(_0x64e0('0xf'));var Papa=require(_0x64e0('0x10'));var Redis=require(_0x64e0('0x11'));var authService=require(_0x64e0('0x12'));var qs=require(_0x64e0('0x13'));var as=require(_0x64e0('0x14'));var hardwareService=require(_0x64e0('0x15'));var logger=require(_0x64e0('0x16'))(_0x64e0('0x17'));var utils=require(_0x64e0('0x18'));var config=require(_0x64e0('0x19'));var licenseUtil=require(_0x64e0('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26f136,_0x2b1c45){_0x2b1c45=_0x2b1c45||0xcc;return function(_0x105ebd){if(_0x105ebd){return _0x26f136[_0x64e0('0x1b')](_0x2b1c45);}return _0x26f136[_0x64e0('0x1c')](_0x2b1c45)[_0x64e0('0x1d')]();};}function respondWithResult(_0x516028,_0x58c18f){_0x58c18f=_0x58c18f||0xc8;return function(_0x15d4e2){if(_0x15d4e2){return _0x516028['status'](_0x58c18f)[_0x64e0('0x1e')](_0x15d4e2);}};}function respondWithFilteredResult(_0x588fca,_0x4b3097){return function(_0x1d9936){if(_0x1d9936){var _0x1f35e9=typeof _0x4b3097[_0x64e0('0x1f')]===_0x64e0('0x20')&&typeof _0x4b3097[_0x64e0('0x21')]===_0x64e0('0x20');var _0xcd2b70=_0x1d9936[_0x64e0('0x22')];var _0x30e226=_0x1f35e9?0x0:_0x4b3097[_0x64e0('0x1f')];var _0x2c2f20=_0x1f35e9?_0x1d9936[_0x64e0('0x22')]:_0x4b3097[_0x64e0('0x1f')]+_0x4b3097['limit'];var _0x46cf45;if(_0x2c2f20>=_0xcd2b70){_0x2c2f20=_0xcd2b70;_0x46cf45=0xc8;}else{_0x46cf45=0xce;}_0x588fca[_0x64e0('0x1c')](_0x46cf45);return _0x588fca[_0x64e0('0x23')](_0x64e0('0x24'),_0x30e226+'-'+_0x2c2f20+'/'+_0xcd2b70)[_0x64e0('0x1e')](_0x1d9936);}return null;};}function patchUpdates(_0x418bce){return function(_0xecee75){try{jsonpatch[_0x64e0('0x25')](_0xecee75,_0x418bce,!![]);}catch(_0x35bd76){return BPromise[_0x64e0('0x26')](_0x35bd76);}return _0xecee75[_0x64e0('0x27')]();};}function saveUpdates(_0x2ce2af,_0x597a46){return function(_0xf92d14){if(_0xf92d14){return _0xf92d14[_0x64e0('0x28')](_0x2ce2af)[_0x64e0('0x29')](function(_0x4e416b){return _0x4e416b;});}return null;};}function removeEntity(_0x2f390b,_0x200d87){return function(_0x530b77){if(_0x530b77){return _0x530b77['destroy']()['then'](function(){_0x2f390b[_0x64e0('0x1c')](0xcc)[_0x64e0('0x1d')]();});}};}function handleEntityNotFound(_0x509627,_0x4a3e5a){return function(_0x217278){if(!_0x217278){_0x509627[_0x64e0('0x1b')](0x194);}return _0x217278;};}function handleError(_0x1453d6,_0x5361c0){_0x5361c0=_0x5361c0||0x1f4;return function(_0x5b84b9){logger['error'](_0x5b84b9[_0x64e0('0x2a')]);if(_0x5b84b9[_0x64e0('0x2b')]){delete _0x5b84b9[_0x64e0('0x2b')];}_0x1453d6['status'](_0x5361c0)[_0x64e0('0x2c')](_0x5b84b9);};}exports[_0x64e0('0x2d')]=function(_0x46e66f,_0x224aa0){var _0x3a61a1={},_0x332415={},_0x2e199a={'count':0x0,'rows':[]};var _0x591636=_[_0x64e0('0x2e')](db['CmHopperHistory'][_0x64e0('0x2f')],function(_0x62269e){return{'name':_0x62269e[_0x64e0('0x30')],'type':_0x62269e[_0x64e0('0x31')][_0x64e0('0x32')]};});_0x332415[_0x64e0('0x33')]=_[_0x64e0('0x2e')](_0x591636,_0x64e0('0x2b'));_0x332415[_0x64e0('0x34')]=_[_0x64e0('0x35')](_0x46e66f[_0x64e0('0x34')]);_0x332415[_0x64e0('0x36')]=_[_0x64e0('0x37')](_0x332415[_0x64e0('0x33')],_0x332415[_0x64e0('0x34')]);_0x3a61a1[_0x64e0('0x38')]=_[_0x64e0('0x37')](_0x332415[_0x64e0('0x33')],qs[_0x64e0('0x39')](_0x46e66f[_0x64e0('0x34')][_0x64e0('0x39')]));_0x3a61a1[_0x64e0('0x38')]=_0x3a61a1['attributes'][_0x64e0('0x3a')]?_0x3a61a1[_0x64e0('0x38')]:_0x332415['model'];if(!_0x46e66f[_0x64e0('0x34')][_0x64e0('0x3b')](_0x64e0('0x3c'))){_0x3a61a1[_0x64e0('0x21')]=qs[_0x64e0('0x21')](_0x46e66f[_0x64e0('0x34')][_0x64e0('0x21')]);_0x3a61a1[_0x64e0('0x1f')]=qs['offset'](_0x46e66f[_0x64e0('0x34')][_0x64e0('0x1f')]);}_0x3a61a1[_0x64e0('0x3d')]=qs[_0x64e0('0x3e')](_0x46e66f[_0x64e0('0x34')][_0x64e0('0x3e')]);_0x3a61a1[_0x64e0('0x3f')]=qs[_0x64e0('0x36')](_[_0x64e0('0x40')](_0x46e66f['query'],_0x332415[_0x64e0('0x36')]),_0x591636);if(_0x46e66f['query'][_0x64e0('0x41')]){_0x3a61a1[_0x64e0('0x3f')]=_[_0x64e0('0x42')](_0x3a61a1[_0x64e0('0x3f')],{'$or':_[_0x64e0('0x2e')](_0x591636,function(_0x3ecaef){if(_0x3ecaef['type']!==_0x64e0('0x43')){var _0x4fb830={};_0x4fb830[_0x3ecaef[_0x64e0('0x2b')]]={'$like':'%'+_0x46e66f[_0x64e0('0x34')][_0x64e0('0x41')]+'%'};return _0x4fb830;}})});}_0x3a61a1=_[_0x64e0('0x42')]({},_0x3a61a1,_0x46e66f['options']);var _0x16f528={'where':_0x3a61a1['where']};return db[_0x64e0('0x44')]['count'](_0x16f528)[_0x64e0('0x29')](function(_0x216d2f){_0x2e199a[_0x64e0('0x22')]=_0x216d2f;if(_0x46e66f[_0x64e0('0x34')][_0x64e0('0x45')]){_0x3a61a1['include']=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3a61a1);})[_0x64e0('0x29')](function(_0x508968){_0x2e199a[_0x64e0('0x46')]=_0x508968;return _0x2e199a;})[_0x64e0('0x29')](respondWithFilteredResult(_0x224aa0,_0x3a61a1))[_0x64e0('0x47')](handleError(_0x224aa0,null));};exports[_0x64e0('0x48')]=function(_0x3eabec,_0x597cd9){var _0x27abea={'raw':!![],'where':{'id':_0x3eabec['params']['id']}},_0x356e8c={};_0x356e8c[_0x64e0('0x33')]=_['keys'](db[_0x64e0('0x44')][_0x64e0('0x2f')]);_0x356e8c[_0x64e0('0x34')]=_[_0x64e0('0x35')](_0x3eabec[_0x64e0('0x34')]);_0x356e8c['filters']=_[_0x64e0('0x37')](_0x356e8c[_0x64e0('0x33')],_0x356e8c[_0x64e0('0x34')]);_0x27abea[_0x64e0('0x38')]=_[_0x64e0('0x37')](_0x356e8c[_0x64e0('0x33')],qs[_0x64e0('0x39')](_0x3eabec[_0x64e0('0x34')][_0x64e0('0x39')]));_0x27abea['attributes']=_0x27abea[_0x64e0('0x38')][_0x64e0('0x3a')]?_0x27abea['attributes']:_0x356e8c[_0x64e0('0x33')];if(_0x3eabec['query']['includeAll']){_0x27abea['include']=[{'all':!![]}];}_0x27abea=_[_0x64e0('0x42')]({},_0x27abea,_0x3eabec[_0x64e0('0x49')]);return db[_0x64e0('0x44')][_0x64e0('0x4a')](_0x27abea)[_0x64e0('0x29')](handleEntityNotFound(_0x597cd9,null))['then'](respondWithResult(_0x597cd9,null))[_0x64e0('0x47')](handleError(_0x597cd9,null));};exports[_0x64e0('0x4b')]=function(_0x1e9f16,_0x3699a0){return db['CmHopperHistory'][_0x64e0('0x4b')](_0x1e9f16[_0x64e0('0x4c')],{})[_0x64e0('0x29')](respondWithResult(_0x3699a0,0xc9))['catch'](handleError(_0x3699a0,null));};exports[_0x64e0('0x4d')]=function(_0xfbc539,_0x3856e8){return db[_0x64e0('0x44')]['describe']()[_0x64e0('0x29')](respondWithResult(_0x3856e8,null))[_0x64e0('0x47')](handleError(_0x3856e8,null));};exports[_0x64e0('0x28')]=function(_0x504116,_0x279b1b){if(_0x504116[_0x64e0('0x4c')][_0x64e0('0x4e')]){delete _0x504116[_0x64e0('0x4c')][_0x64e0('0x4e')];}return db['CmHopperHistory'][_0x64e0('0x4a')]({'where':{'uniqueid':_0x504116[_0x64e0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x279b1b,null))[_0x64e0('0x29')](saveUpdates(_0x504116[_0x64e0('0x4c')],null))['then'](respondWithResult(_0x279b1b,null))['catch'](handleError(_0x279b1b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index b7ebf1d..bf3ab39 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 _0x48ac=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0x2ab407,_0x2b8489){var _0x574fb1=function(_0x13561f){while(--_0x13561f){_0x2ab407['push'](_0x2ab407['shift']());}};_0x574fb1(++_0x2b8489);}(_0x48ac,0xe0));var _0xc48a=function(_0x39ec05,_0x10cc8c){_0x39ec05=_0x39ec05-0x0;var _0x1011b9=_0x48ac[_0x39ec05];return _0x1011b9;};'use strict';var _=require('lodash');var util=require(_0xc48a('0x0'));var logger=require('../../config/logger')(_0xc48a('0x1'));var moment=require(_0xc48a('0x2'));var BPromise=require(_0xc48a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc48a('0x4'));var rimraf=require(_0xc48a('0x5'));var config=require(_0xc48a('0x6'));var attributes=require(_0xc48a('0x7'));module[_0xc48a('0x8')]=function(_0x499749,_0x48205f){return _0x499749['define']('CmHopperHistory',attributes,{'tableName':_0xc48a('0x9'),'paranoid':![],'indexes':[{'name':_0xc48a('0xa'),'fields':[_0xc48a('0xa')]},{'name':'uniqueid','fields':[_0xc48a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc648=['moment','bluebird','request-promise','path','exports','define','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api'];(function(_0x348fe9,_0x2c38e1){var _0x508001=function(_0x50d83d){while(--_0x50d83d){_0x348fe9['push'](_0x348fe9['shift']());}};_0x508001(++_0x2c38e1);}(_0xc648,0x171));var _0x8c64=function(_0x2e568b,_0x444c89){_0x2e568b=_0x2e568b-0x0;var _0x381378=_0xc648[_0x2e568b];return _0x381378;};'use strict';var _=require('lodash');var util=require(_0x8c64('0x0'));var logger=require(_0x8c64('0x1'))(_0x8c64('0x2'));var moment=require(_0x8c64('0x3'));var BPromise=require(_0x8c64('0x4'));var rp=require(_0x8c64('0x5'));var fs=require('fs');var path=require(_0x8c64('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0x8c64('0x7')]=function(_0x449786,_0xb31493){return _0x449786[_0x8c64('0x8')]('CmHopperHistory',attributes,{'tableName':_0x8c64('0x9'),'paranoid':![],'indexes':[{'name':_0x8c64('0xa'),'fields':[_0x8c64('0xa')]},{'name':_0x8c64('0xb'),'fields':[_0x8c64('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 049b2ab..361a9d5 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 _0x5cd9=['predictiveIntervalAvgHoldtime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cd9,0x13c));var _0x95cd=function(_0x3e94d1,_0x2d264e){_0x3e94d1=_0x3e94d1-0x0;var _0x5b4d1e=_0x5cd9[_0x3e94d1];return _0x5b4d1e;};'use strict';var _=require('lodash');var util=require(_0x95cd('0x0'));var moment=require(_0x95cd('0x1'));var BPromise=require(_0x95cd('0x2'));var rs=require(_0x95cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x95cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x95cd('0x5'));var config=require(_0x95cd('0x6'));var jayson=require(_0x95cd('0x7'));var client=jayson[_0x95cd('0x8')][_0x95cd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a862e,_0xda639a,_0x50f01d){return new BPromise(function(_0x523d56,_0x4fc0f5){return client[_0x95cd('0xa')](_0x2a862e,_0x50f01d)[_0x95cd('0xb')](function(_0x3cac40){logger[_0x95cd('0xc')](_0x95cd('0xd'),_0xda639a,_0x95cd('0xe'));logger[_0x95cd('0xf')](_0x95cd('0x10'),_0xda639a,_0x95cd('0xe'),JSON[_0x95cd('0x11')](_0x3cac40));if(_0x3cac40[_0x95cd('0x12')]){if(_0x3cac40[_0x95cd('0x12')][_0x95cd('0x13')]===0x1f4){logger[_0x95cd('0x12')](_0x95cd('0xd'),_0xda639a,_0x3cac40[_0x95cd('0x12')][_0x95cd('0x14')]);return _0x4fc0f5(_0x3cac40[_0x95cd('0x12')][_0x95cd('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0xda639a,_0x3cac40[_0x95cd('0x12')]['message']);return _0x523d56(_0x3cac40[_0x95cd('0x12')][_0x95cd('0x14')]);}else{logger[_0x95cd('0xc')](_0x95cd('0xd'),_0xda639a,_0x95cd('0xe'));_0x523d56(_0x3cac40[_0x95cd('0x15')][_0x95cd('0x14')]);}})[_0x95cd('0x16')](function(_0x14e6f3){logger[_0x95cd('0x12')](_0x95cd('0xd'),_0xda639a,_0x14e6f3);_0x4fc0f5(_0x14e6f3);});});}exports[_0x95cd('0x17')]=function(_0x10a6fe){var _0x56b2d0=this;return new Promise(function(_0x1fecb4,_0x143937){return db['CmHopperHistory'][_0x95cd('0x18')](_0x10a6fe[_0x95cd('0x19')],{'raw':_0x10a6fe[_0x95cd('0x1a')]?_0x10a6fe[_0x95cd('0x1a')][_0x95cd('0x1b')]===undefined?!![]:![]:!![]})[_0x95cd('0xb')](function(_0x3af4b0){logger[_0x95cd('0xc')]('CreateCmHopperHistory',_0x10a6fe);logger['debug']('CreateCmHopperHistory',_0x10a6fe,JSON[_0x95cd('0x11')](_0x3af4b0));_0x1fecb4(_0x3af4b0);})[_0x95cd('0x16')](function(_0x3eb1ad){logger[_0x95cd('0x12')](_0x95cd('0x17'),_0x3eb1ad[_0x95cd('0x14')],_0x10a6fe);_0x143937(_0x56b2d0[_0x95cd('0x12')](0x1f4,_0x3eb1ad['message']));});});};exports[_0x95cd('0x1c')]=function(_0x4504eb){var _0x296754=this;return new Promise(function(_0x3b9d59,_0x4fb687){return db[_0x95cd('0x1d')][_0x95cd('0x1e')]({'raw':_0x4504eb['options']?_0x4504eb[_0x95cd('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4504eb[_0x95cd('0x1a')]?_0x4504eb[_0x95cd('0x1a')][_0x95cd('0x1f')]||null:null,'attributes':[[db['sequelize']['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')][_0x95cd('0x22')]('id')),_0x95cd('0x23')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x95cd('0x25')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db['sequelize']['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x26')))),_0x95cd('0x27')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x28')))),_0x95cd('0x29')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x2a'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x2b')))),_0x95cd('0x2c')],[db[_0x95cd('0x21')]['fn']('AVG',db[_0x95cd('0x21')]['fn']('IF',db['sequelize'][_0x95cd('0x24')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x95cd('0xb')](function(_0x5b3ff1){logger[_0x95cd('0xc')](_0x95cd('0x1c'),_0x4504eb);logger['debug'](_0x95cd('0x1c'),_0x4504eb,JSON[_0x95cd('0x11')](_0x5b3ff1));_0x3b9d59(_0x5b3ff1);})['catch'](function(_0x2d5a63){logger[_0x95cd('0x12')](_0x95cd('0x1c'),_0x2d5a63[_0x95cd('0x14')],_0x4504eb);_0x4fb687(_0x296754[_0x95cd('0x12')](0x1f4,_0x2d5a63[_0x95cd('0x14')]));});});};exports[_0x95cd('0x2d')]=function(_0x494398){var _0x5c2fa5=this;return new Promise(function(_0x1753ee,_0x1b06bf){return db['CmHopperHistory'][_0x95cd('0x1e')]({'raw':_0x494398[_0x95cd('0x1a')]?_0x494398['options'][_0x95cd('0x1b')]===undefined?!![]:![]:!![],'where':_0x494398[_0x95cd('0x1a')]?_0x494398[_0x95cd('0x1a')]['where']||null:null,'attributes':[[_0x95cd('0x2e'),_0x95cd('0x2f')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x30')))),_0x95cd('0x31')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db['sequelize'][_0x95cd('0x24')](_0x95cd('0x32')))),_0x95cd('0x33')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x34')))),'outboundAnswerCallsDay'],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')]('`state`\x20=\x205,\x201,\x20null'))),_0x95cd('0x35')],[db[_0x95cd('0x21')]['fn']('COUNT',db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')]('`state`\x20=\x208,\x201,\x20null'))),_0x95cd('0x36')],[db[_0x95cd('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x95cd('0x37')],[db['sequelize']['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x95cd('0x38')],[db[_0x95cd('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x95cd('0x24')](_0x95cd('0x39')))),_0x95cd('0x3a')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x3b')))),_0x95cd('0x3c')],[db[_0x95cd('0x21')]['fn']('COUNT',db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x3d')))),_0x95cd('0x3e')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x95cd('0x3f')))),_0x95cd('0x40')],[db['sequelize']['fn'](_0x95cd('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0x95cd('0x24')](_0x95cd('0x41')))),_0x95cd('0x42')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db['sequelize']['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x43')))),_0x95cd('0x40')],[db[_0x95cd('0x21')]['fn']('COUNT',db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')](_0x95cd('0x44')))),'outboundReCallsDay']],'group':[_0x95cd('0x2e')]})['then'](function(_0x2cef48){logger[_0x95cd('0xc')]('GetVoiceQueueHopperHistory',_0x494398);logger[_0x95cd('0xf')]('GetVoiceQueueHopperHistory',_0x494398,JSON['stringify'](_0x2cef48));_0x1753ee(_0x2cef48);})[_0x95cd('0x16')](function(_0x6a6a66){logger[_0x95cd('0x12')]('GetVoiceQueueHopperHistory',_0x6a6a66[_0x95cd('0x14')],_0x494398);_0x1b06bf(_0x5c2fa5[_0x95cd('0x12')](0x1f4,_0x6a6a66[_0x95cd('0x14')]));});});};exports['GetCampaignHopperHistory']=function(_0x83c32){var _0x3cdbf1=this;return new Promise(function(_0x146efb,_0x3660b6){return db['CmHopperHistory']['findAll']({'raw':_0x83c32[_0x95cd('0x1a')]?_0x83c32['options']['raw']===undefined?!![]:![]:!![],'where':_0x83c32[_0x95cd('0x1a')]?_0x83c32['options'][_0x95cd('0x1f')]||null:null,'attributes':[[_0x95cd('0x2e'),_0x95cd('0x2f')],[db[_0x95cd('0x21')]['fn'](_0x95cd('0x20'),db[_0x95cd('0x21')][_0x95cd('0x22')]('id')),_0x95cd('0x45')],[db['sequelize']['fn']('COUNT',db[_0x95cd('0x21')]['fn']('IF',db[_0x95cd('0x21')][_0x95cd('0x24')]('`state`\x20=\x204,\x201,\x20null'))),_0x95cd('0x46')]],'group':[_0x95cd('0x2e')]})[_0x95cd('0xb')](function(_0x3e30de){logger['info'](_0x95cd('0x47'),_0x83c32);logger['debug'](_0x95cd('0x47'),_0x83c32,JSON[_0x95cd('0x11')](_0x3e30de));_0x146efb(_0x3e30de);})[_0x95cd('0x16')](function(_0x358f0c){logger[_0x95cd('0x12')]('GetCampaignHopperHistory',_0x358f0c['message'],_0x83c32);_0x3660b6(_0x3cdbf1[_0x95cd('0x12')](0x1f4,_0x358f0c[_0x95cd('0x14')]));});});}; \ No newline at end of file +var _0x8e0d=['info','request\x20sent','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x111688,_0x180230){var _0x38b80d=function(_0x55302b){while(--_0x55302b){_0x111688['push'](_0x111688['shift']());}};_0x38b80d(++_0x180230);}(_0x8e0d,0x82));var _0xd8e0=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x8e0d[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0xd8e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd8e0('0x1'));var rs=require(_0xd8e0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8e0('0x3'))['db'];var utils=require(_0xd8e0('0x4'));var logger=require(_0xd8e0('0x5'))(_0xd8e0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8e0('0x7')][_0xd8e0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x42d42b,_0x1e4616,_0x5e9735){return new BPromise(function(_0xd0c45c,_0x144a8a){return client[_0xd8e0('0x9')](_0x42d42b,_0x5e9735)[_0xd8e0('0xa')](function(_0x127a32){logger['info'](_0xd8e0('0xb'),_0x1e4616,'request\x20sent');logger[_0xd8e0('0xc')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1e4616,'request\x20sent',JSON[_0xd8e0('0xd')](_0x127a32));if(_0x127a32[_0xd8e0('0xe')]){if(_0x127a32[_0xd8e0('0xe')]['code']===0x1f4){logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0x144a8a(_0x127a32['error']['message']);}logger['error'](_0xd8e0('0xb'),_0x1e4616,_0x127a32['error'][_0xd8e0('0xf')]);return _0xd0c45c(_0x127a32[_0xd8e0('0xe')][_0xd8e0('0xf')]);}else{logger[_0xd8e0('0x10')](_0xd8e0('0xb'),_0x1e4616,_0xd8e0('0x11'));_0xd0c45c(_0x127a32[_0xd8e0('0x12')][_0xd8e0('0xf')]);}})[_0xd8e0('0x13')](function(_0x488ed9){logger[_0xd8e0('0xe')](_0xd8e0('0xb'),_0x1e4616,_0x488ed9);_0x144a8a(_0x488ed9);});});}exports[_0xd8e0('0x14')]=function(_0x42586f){var _0x3b28bc=this;return new Promise(function(_0x2bf195,_0x2c4eaf){return db[_0xd8e0('0x15')]['create'](_0x42586f[_0xd8e0('0x16')],{'raw':_0x42586f[_0xd8e0('0x17')]?_0x42586f['options'][_0xd8e0('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55ce9b){logger['info'](_0xd8e0('0x14'),_0x42586f);logger[_0xd8e0('0xc')]('CreateCmHopperHistory',_0x42586f,JSON[_0xd8e0('0xd')](_0x55ce9b));_0x2bf195(_0x55ce9b);})[_0xd8e0('0x13')](function(_0x1d31de){logger[_0xd8e0('0xe')](_0xd8e0('0x14'),_0x1d31de[_0xd8e0('0xf')],_0x42586f);_0x2c4eaf(_0x3b28bc['error'](0x1f4,_0x1d31de[_0xd8e0('0xf')]));});});};exports[_0xd8e0('0x19')]=function(_0x54c515){var _0x47edaf=this;return new Promise(function(_0x5d82f9,_0x309684){return db[_0xd8e0('0x15')][_0xd8e0('0x1a')]({'raw':_0x54c515[_0xd8e0('0x17')]?_0x54c515[_0xd8e0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x54c515['options']?_0x54c515[_0xd8e0('0x17')][_0xd8e0('0x1b')]||null:null,'attributes':[[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db['sequelize'][_0xd8e0('0x1e')]('id')),_0xd8e0('0x1f')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x21')))),_0xd8e0('0x22')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db['sequelize'][_0xd8e0('0x20')](_0xd8e0('0x23')))),_0xd8e0('0x24')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x25')))),_0xd8e0('0x26')],[db[_0xd8e0('0x1c')]['fn']('AVG',db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x27')))),_0xd8e0('0x28')],[db[_0xd8e0('0x1c')]['fn']('AVG',db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x29')))),_0xd8e0('0x2a')]]})[_0xd8e0('0xa')](function(_0x4d5305){logger[_0xd8e0('0x10')](_0xd8e0('0x19'),_0x54c515);logger[_0xd8e0('0xc')]('AvgHandleTime',_0x54c515,JSON[_0xd8e0('0xd')](_0x4d5305));_0x5d82f9(_0x4d5305);})['catch'](function(_0x1dd7ca){logger[_0xd8e0('0xe')](_0xd8e0('0x19'),_0x1dd7ca[_0xd8e0('0xf')],_0x54c515);_0x309684(_0x47edaf[_0xd8e0('0xe')](0x1f4,_0x1dd7ca[_0xd8e0('0xf')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4736b8){var _0x14884f=this;return new Promise(function(_0x171a9e,_0x1dd227){return db[_0xd8e0('0x15')]['findAll']({'raw':_0x4736b8[_0xd8e0('0x17')]?_0x4736b8[_0xd8e0('0x17')][_0xd8e0('0x18')]===undefined?!![]:![]:!![],'where':_0x4736b8[_0xd8e0('0x17')]?_0x4736b8[_0xd8e0('0x17')][_0xd8e0('0x1b')]||null:null,'attributes':[[_0xd8e0('0x2b'),_0xd8e0('0x2c')],[db[_0xd8e0('0x1c')]['fn']('COUNT',db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x2d')))),_0xd8e0('0x2e')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x2f')))),_0xd8e0('0x30')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')]('`state`\x20=\x204,\x201,\x20null'))),_0xd8e0('0x31')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x32')))),_0xd8e0('0x33')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0xd8e0('0x1c')]['fn']('COUNT',db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')]['literal'](_0xd8e0('0x34')))),_0xd8e0('0x35')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db['sequelize'][_0xd8e0('0x20')](_0xd8e0('0x36')))),_0xd8e0('0x37')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x38')))),_0xd8e0('0x39')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db['sequelize']['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x3a')))),_0xd8e0('0x3b')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')]['literal'](_0xd8e0('0x3c')))),_0xd8e0('0x3d')],[db['sequelize']['fn']('COUNT',db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x3e')))),_0xd8e0('0x3f')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')]['literal'](_0xd8e0('0x40')))),_0xd8e0('0x41')],[db[_0xd8e0('0x1c')]['fn']('COUNT',db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x42')))),'outboundRejectCallsDay'],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x43')))),_0xd8e0('0x44')]],'group':[_0xd8e0('0x2b')]})[_0xd8e0('0xa')](function(_0x50d2bf){logger[_0xd8e0('0x10')]('GetVoiceQueueHopperHistory',_0x4736b8);logger[_0xd8e0('0xc')]('GetVoiceQueueHopperHistory',_0x4736b8,JSON['stringify'](_0x50d2bf));_0x171a9e(_0x50d2bf);})[_0xd8e0('0x13')](function(_0xbe64f4){logger[_0xd8e0('0xe')](_0xd8e0('0x45'),_0xbe64f4[_0xd8e0('0xf')],_0x4736b8);_0x1dd227(_0x14884f[_0xd8e0('0xe')](0x1f4,_0xbe64f4[_0xd8e0('0xf')]));});});};exports['GetCampaignHopperHistory']=function(_0x1b6440){var _0x295569=this;return new Promise(function(_0x2f1402,_0x2e80ed){return db['CmHopperHistory'][_0xd8e0('0x1a')]({'raw':_0x1b6440[_0xd8e0('0x17')]?_0x1b6440[_0xd8e0('0x17')][_0xd8e0('0x18')]===undefined?!![]:![]:!![],'where':_0x1b6440[_0xd8e0('0x17')]?_0x1b6440[_0xd8e0('0x17')][_0xd8e0('0x1b')]||null:null,'attributes':[['campaign',_0xd8e0('0x2c')],[db[_0xd8e0('0x1c')]['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')][_0xd8e0('0x1e')]('id')),_0xd8e0('0x46')],[db['sequelize']['fn'](_0xd8e0('0x1d'),db[_0xd8e0('0x1c')]['fn']('IF',db[_0xd8e0('0x1c')][_0xd8e0('0x20')](_0xd8e0('0x21')))),_0xd8e0('0x47')]],'group':[_0xd8e0('0x2b')]})['then'](function(_0x34efd6){logger[_0xd8e0('0x10')](_0xd8e0('0x48'),_0x1b6440);logger['debug'](_0xd8e0('0x48'),_0x1b6440,JSON[_0xd8e0('0xd')](_0x34efd6));_0x2f1402(_0x34efd6);})[_0xd8e0('0x13')](function(_0x532c96){logger['error']('GetCampaignHopperHistory',_0x532c96['message'],_0x1b6440);_0x2e80ed(_0x295569[_0xd8e0('0xe')](0x1f4,_0x532c96[_0xd8e0('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index f089226..129f777 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 _0x404a=['put','/:id','update','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','post','create'];(function(_0x84d8eb,_0x54a720){var _0x3817cd=function(_0x36d8ae){while(--_0x36d8ae){_0x84d8eb['push'](_0x84d8eb['shift']());}};_0x3817cd(++_0x54a720);}(_0x404a,0x15a));var _0xa404=function(_0x386764,_0x129a80){_0x386764=_0x386764-0x0;var _0x12b8a7=_0x404a[_0x386764];return _0x12b8a7;};'use strict';var multer=require(_0xa404('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa404('0x1'));var router=express[_0xa404('0x2')]();var fs_extra=require(_0xa404('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa404('0x4'));var config=require(_0xa404('0x5'));var controller=require(_0xa404('0x6'));router[_0xa404('0x7')]('/',auth[_0xa404('0x8')](),controller[_0xa404('0x9')]);router['get'](_0xa404('0xa'),auth[_0xa404('0x8')](),controller[_0xa404('0xb')]);router[_0xa404('0x7')]('/:id',auth[_0xa404('0x8')](),controller['show']);router[_0xa404('0xc')]('/',auth[_0xa404('0x8')](),controller[_0xa404('0xd')]);router[_0xa404('0xe')](_0xa404('0xf'),auth['isAuthenticated'](),controller[_0xa404('0x10')]);module[_0xa404('0x11')]=router; \ No newline at end of file +var _0x8ecb=['Router','fs-extra','../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','post','put','/:id','exports','multer','util','path','connect-timeout'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x8ecb,0x95));var _0xb8ec=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8ecb[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xb8ec('0x0'));var util=require(_0xb8ec('0x1'));var path=require(_0xb8ec('0x2'));var timeout=require(_0xb8ec('0x3'));var express=require('express');var router=express[_0xb8ec('0x4')]();var fs_extra=require(_0xb8ec('0x5'));var auth=require(_0xb8ec('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb8ec('0x7'));router[_0xb8ec('0x8')]('/',auth[_0xb8ec('0x9')](),controller[_0xb8ec('0xa')]);router[_0xb8ec('0x8')](_0xb8ec('0xb'),auth[_0xb8ec('0x9')](),controller[_0xb8ec('0xc')]);router[_0xb8ec('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb8ec('0xd')]('/',auth[_0xb8ec('0x9')](),controller['create']);router[_0xb8ec('0xe')](_0xb8ec('0xf'),auth[_0xb8ec('0x9')](),controller['update']);module[_0xb8ec('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 77212f6..722c230 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 _0xbbb8=['STRING','sequelize','exports','name'];(function(_0x912d43,_0x181d0c){var _0x323b7e=function(_0x8b62d7){while(--_0x8b62d7){_0x912d43['push'](_0x912d43['shift']());}};_0x323b7e(++_0x181d0c);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x127465,_0x279fba){_0x127465=_0x127465-0x0;var _0x3f1957=_0xbbb8[_0x127465];return _0x3f1957;};'use strict';var Sequelize=require(_0x8bbb('0x0'));module[_0x8bbb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8bbb('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8bbb('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x535f=['STRING','exports'];(function(_0x2cebce,_0xb71ebd){var _0x1647fa=function(_0x2fcc13){while(--_0x2fcc13){_0x2cebce['push'](_0x2cebce['shift']());}};_0x1647fa(++_0xb71ebd);}(_0x535f,0x111));var _0xf535=function(_0x2cdf3d,_0x5193ba){_0x2cdf3d=_0x2cdf3d-0x0;var _0x4943b4=_0x535f[_0x2cdf3d];return _0x4943b4;};'use strict';var Sequelize=require('sequelize');module[_0xf535('0x0')]={'name':{'type':Sequelize[_0xf535('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf535('0x1')]},'dialPrefix':{'type':Sequelize[_0xf535('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 48a7078..02a38a5 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 _0x077a=['Disposition','getDispositions','nolimit','order','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','findOne','sequelize','transaction','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','findAndCountAll','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','Lists','UserProfileResource','error','stack','name','send','index','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','include','CmList','rows','catch','show','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','update','params','describe','addDisposition','ListId'];(function(_0x2d9018,_0x43687e){var _0x4d0d4b=function(_0x311e89){while(--_0x311e89){_0x2d9018['push'](_0x2d9018['shift']());}};_0x4d0d4b(++_0x43687e);}(_0x077a,0x1f2));var _0xa077=function(_0x3cb7c1,_0x1bde10){_0x3cb7c1=_0x3cb7c1-0x0;var _0x3f6ffc=_0x077a[_0x3cb7c1];return _0x3f6ffc;};'use strict';var emlformat=require(_0xa077('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa077('0x1'));var jsonpatch=require(_0xa077('0x2'));var rp=require(_0xa077('0x3'));var moment=require(_0xa077('0x4'));var BPromise=require(_0xa077('0x5'));var Mustache=require(_0xa077('0x6'));var util=require(_0xa077('0x7'));var path=require(_0xa077('0x8'));var sox=require('sox');var csv=require(_0xa077('0x9'));var ejs=require(_0xa077('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa077('0xb'));var jsforce=require(_0xa077('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa077('0xd'));var Papa=require(_0xa077('0xe'));var Redis=require(_0xa077('0xf'));var authService=require(_0xa077('0x10'));var qs=require(_0xa077('0x11'));var as=require(_0xa077('0x12'));var hardwareService=require(_0xa077('0x13'));var logger=require('../../config/logger')(_0xa077('0x14'));var utils=require(_0xa077('0x15'));var config=require(_0xa077('0x16'));var licenseUtil=require(_0xa077('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa077('0x18')](config[_0xa077('0x19')],{'host':_0xa077('0x1a'),'port':0x18eb});var socket=require(_0xa077('0x1b'))(new Redis(config[_0xa077('0x19')]));require(_0xa077('0x1c'))[_0xa077('0x1d')](socket);function respondWithStatusCode(_0x32e7fa,_0x356ebf){_0x356ebf=_0x356ebf||0xcc;return function(_0x8432d5){if(_0x8432d5){return _0x32e7fa[_0xa077('0x1e')](_0x356ebf);}return _0x32e7fa[_0xa077('0x1f')](_0x356ebf)[_0xa077('0x20')]();};}function respondWithResult(_0x52ce2,_0x43dd7d){_0x43dd7d=_0x43dd7d||0xc8;return function(_0x4654f8){if(_0x4654f8){return _0x52ce2[_0xa077('0x1f')](_0x43dd7d)[_0xa077('0x21')](_0x4654f8);}};}function respondWithFilteredResult(_0x4077a3,_0x45eaf5){return function(_0x7c58a){if(_0x7c58a){var _0x498010=typeof _0x45eaf5['offset']===_0xa077('0x22')&&typeof _0x45eaf5[_0xa077('0x23')]===_0xa077('0x22');var _0x18092f=_0x7c58a[_0xa077('0x24')];var _0x4b472c=_0x498010?0x0:_0x45eaf5[_0xa077('0x25')];var _0x502ac3=_0x498010?_0x7c58a[_0xa077('0x24')]:_0x45eaf5[_0xa077('0x25')]+_0x45eaf5[_0xa077('0x23')];var _0x58431d;if(_0x502ac3>=_0x18092f){_0x502ac3=_0x18092f;_0x58431d=0xc8;}else{_0x58431d=0xce;}_0x4077a3[_0xa077('0x1f')](_0x58431d);return _0x4077a3[_0xa077('0x26')](_0xa077('0x27'),_0x4b472c+'-'+_0x502ac3+'/'+_0x18092f)[_0xa077('0x21')](_0x7c58a);}return null;};}function patchUpdates(_0x474a10){return function(_0x581be7){try{jsonpatch[_0xa077('0x28')](_0x581be7,_0x474a10,!![]);}catch(_0x868a9b){return BPromise[_0xa077('0x29')](_0x868a9b);}return _0x581be7[_0xa077('0x2a')]();};}function saveUpdates(_0x272cd5,_0xf02913){return function(_0x4fd68d){if(_0x4fd68d){return _0x4fd68d['update'](_0x272cd5)[_0xa077('0x2b')](function(_0x4dc63e){return _0x4dc63e;});}return null;};}function removeEntity(_0x54ec2e,_0x5731bb){return function(_0x3e49dc){if(_0x3e49dc){return _0x3e49dc[_0xa077('0x2c')]()[_0xa077('0x2b')](function(){var _0x33455a=_0x3e49dc['get']({'plain':!![]});var _0xe255fd=_0xa077('0x2d');return db[_0xa077('0x2e')]['destroy']({'where':{'type':_0xe255fd,'resourceId':_0x33455a['id']}})[_0xa077('0x2b')](function(){return _0x3e49dc;});})[_0xa077('0x2b')](function(){_0x54ec2e['status'](0xcc)[_0xa077('0x20')]();});}};}function handleEntityNotFound(_0x3f7751,_0xb4d238){return function(_0x32c9c6){if(!_0x32c9c6){_0x3f7751[_0xa077('0x1e')](0x194);}return _0x32c9c6;};}function handleError(_0x31252c,_0xd2ef51){_0xd2ef51=_0xd2ef51||0x1f4;return function(_0x439464){logger[_0xa077('0x2f')](_0x439464[_0xa077('0x30')]);if(_0x439464[_0xa077('0x31')]){delete _0x439464[_0xa077('0x31')];}_0x31252c['status'](_0xd2ef51)[_0xa077('0x32')](_0x439464);};}exports[_0xa077('0x33')]=function(_0x410a0a,_0x5adc61){var _0xf398ff={},_0x14463e={},_0x21a5e4={'count':0x0,'rows':[]};var _0x946e68=_['map'](db['CmList'][_0xa077('0x34')],function(_0x1a814e){return{'name':_0x1a814e['fieldName'],'type':_0x1a814e[_0xa077('0x35')]['key']};});_0x14463e[_0xa077('0x36')]=_['map'](_0x946e68,'name');_0x14463e[_0xa077('0x37')]=_[_0xa077('0x38')](_0x410a0a['query']);_0x14463e['filters']=_['intersection'](_0x14463e[_0xa077('0x36')],_0x14463e['query']);_0xf398ff[_0xa077('0x39')]=_[_0xa077('0x3a')](_0x14463e[_0xa077('0x36')],qs[_0xa077('0x3b')](_0x410a0a[_0xa077('0x37')][_0xa077('0x3b')]));_0xf398ff[_0xa077('0x39')]=_0xf398ff['attributes'][_0xa077('0x3c')]?_0xf398ff[_0xa077('0x39')]:_0x14463e[_0xa077('0x36')];if(!_0x410a0a[_0xa077('0x37')][_0xa077('0x3d')]('nolimit')){_0xf398ff[_0xa077('0x23')]=qs[_0xa077('0x23')](_0x410a0a[_0xa077('0x37')]['limit']);_0xf398ff[_0xa077('0x25')]=qs[_0xa077('0x25')](_0x410a0a[_0xa077('0x37')][_0xa077('0x25')]);}_0xf398ff['order']=qs[_0xa077('0x3e')](_0x410a0a[_0xa077('0x37')][_0xa077('0x3e')]);_0xf398ff[_0xa077('0x3f')]=qs['filters'](_[_0xa077('0x40')](_0x410a0a[_0xa077('0x37')],_0x14463e[_0xa077('0x41')]),_0x946e68);if(_0x410a0a['query'][_0xa077('0x42')]){_0xf398ff[_0xa077('0x3f')]=_[_0xa077('0x43')](_0xf398ff['where'],{'$or':_[_0xa077('0x44')](_0x946e68,function(_0x3a9052){if(_0x3a9052[_0xa077('0x35')]!==_0xa077('0x45')){var _0x2ec917={};_0x2ec917[_0x3a9052[_0xa077('0x31')]]={'$like':'%'+_0x410a0a[_0xa077('0x37')]['filter']+'%'};return _0x2ec917;}})});}_0xf398ff=_[_0xa077('0x43')]({},_0xf398ff,_0x410a0a[_0xa077('0x46')]);var _0x51b8bd={'where':_0xf398ff[_0xa077('0x3f')]};return db['CmList'][_0xa077('0x24')](_0x51b8bd)['then'](function(_0x10ae94){_0x21a5e4[_0xa077('0x24')]=_0x10ae94;if(_0x410a0a[_0xa077('0x37')]['includeAll']){_0xf398ff[_0xa077('0x47')]=[{'all':!![]}];}return db[_0xa077('0x48')]['findAll'](_0xf398ff);})[_0xa077('0x2b')](function(_0x396698){_0x21a5e4[_0xa077('0x49')]=_0x396698;return _0x21a5e4;})[_0xa077('0x2b')](respondWithFilteredResult(_0x5adc61,_0xf398ff))[_0xa077('0x4a')](handleError(_0x5adc61,null));};exports[_0xa077('0x4b')]=function(_0x1c96fb,_0x4e4030){var _0x4bc911={'raw':![],'where':{'id':_0x1c96fb['params']['id']}},_0x2a46d0={};_0x2a46d0['model']=_['keys'](db['CmList'][_0xa077('0x34')]);_0x2a46d0[_0xa077('0x37')]=_[_0xa077('0x38')](_0x1c96fb[_0xa077('0x37')]);_0x2a46d0[_0xa077('0x41')]=_[_0xa077('0x3a')](_0x2a46d0[_0xa077('0x36')],_0x2a46d0[_0xa077('0x37')]);_0x4bc911[_0xa077('0x39')]=_[_0xa077('0x3a')](_0x2a46d0['model'],qs['fields'](_0x1c96fb[_0xa077('0x37')][_0xa077('0x3b')]));_0x4bc911['attributes']=_0x4bc911[_0xa077('0x39')][_0xa077('0x3c')]?_0x4bc911[_0xa077('0x39')]:_0x2a46d0[_0xa077('0x36')];if(_0x1c96fb[_0xa077('0x37')][_0xa077('0x4c')]){_0x4bc911[_0xa077('0x47')]=[{'all':!![]}];}_0x4bc911=_['merge']({},_0x4bc911,_0x1c96fb[_0xa077('0x46')]);return db[_0xa077('0x48')][_0xa077('0x4d')](_0x4bc911)[_0xa077('0x2b')](handleEntityNotFound(_0x4e4030,null))[_0xa077('0x2b')](respondWithResult(_0x4e4030,null))[_0xa077('0x4a')](handleError(_0x4e4030,null));};exports[_0xa077('0x4e')]=function(_0x1f24fe,_0x540aeb){return db[_0xa077('0x48')][_0xa077('0x4e')](_0x1f24fe[_0xa077('0x4f')],{})[_0xa077('0x2b')](function(_0x5bea6b){var _0x455bf8=_0x1f24fe['user'][_0xa077('0x50')]({'plain':!![]});if(!_0x455bf8)throw new Error(_0xa077('0x51'));if(_0x455bf8[_0xa077('0x52')]==='user'){var _0x219916=_0x5bea6b[_0xa077('0x50')]({'plain':!![]});var _0x46b711=_0xa077('0x2d');return db[_0xa077('0x53')][_0xa077('0x4d')]({'where':{'name':_0x46b711,'userProfileId':_0x455bf8['userProfileId']},'raw':!![]})['then'](function(_0x2b2f29){if(_0x2b2f29&&_0x2b2f29[_0xa077('0x54')]===0x0){return db[_0xa077('0x2e')]['create']({'name':_0x219916[_0xa077('0x31')],'resourceId':_0x219916['id'],'type':_0x2b2f29[_0xa077('0x31')],'sectionId':_0x2b2f29['id']},{})[_0xa077('0x2b')](function(){return _0x5bea6b;});}else{return _0x5bea6b;}})[_0xa077('0x4a')](function(_0x50773f){logger[_0xa077('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50773f);throw _0x50773f;});}return _0x5bea6b;})['then'](respondWithResult(_0x540aeb,0xc9))[_0xa077('0x4a')](handleError(_0x540aeb,null));};exports[_0xa077('0x55')]=function(_0x18e58e,_0x384f9e){if(_0x18e58e[_0xa077('0x4f')]['id']){delete _0x18e58e[_0xa077('0x4f')]['id'];}return db[_0xa077('0x48')][_0xa077('0x4d')]({'where':{'id':_0x18e58e[_0xa077('0x56')]['id']}})['then'](handleEntityNotFound(_0x384f9e,null))[_0xa077('0x2b')](saveUpdates(_0x18e58e[_0xa077('0x4f')],null))[_0xa077('0x2b')](respondWithResult(_0x384f9e,null))[_0xa077('0x4a')](handleError(_0x384f9e,null));};exports[_0xa077('0x2c')]=function(_0x304390,_0x1ad759){return db[_0xa077('0x48')][_0xa077('0x4d')]({'where':{'id':_0x304390[_0xa077('0x56')]['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x1ad759,null))[_0xa077('0x2b')](removeEntity(_0x1ad759,null))[_0xa077('0x4a')](handleError(_0x1ad759,null));};exports[_0xa077('0x57')]=function(_0x40307f,_0x3852ed){return db[_0xa077('0x48')][_0xa077('0x57')]()['then'](respondWithResult(_0x3852ed,null))[_0xa077('0x4a')](handleError(_0x3852ed,null));};exports[_0xa077('0x58')]=function(_0x2032c7,_0x94f22d,_0x380fc7){if(_0x2032c7[_0xa077('0x4f')]['id']){delete _0x2032c7[_0xa077('0x4f')]['id'];}return db[_0xa077('0x48')]['find']({'where':{'id':_0x2032c7['params']['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x94f22d,null))[_0xa077('0x2b')](function(_0x4a6078){if(_0x4a6078){_0x2032c7['body'][_0xa077('0x59')]=_0x4a6078['id'];return db[_0xa077('0x5a')][_0xa077('0x4e')](_0x2032c7[_0xa077('0x4f')]);}})[_0xa077('0x2b')](respondWithResult(_0x94f22d,null))[_0xa077('0x4a')](handleError(_0x94f22d,null));};exports[_0xa077('0x5b')]=function(_0x166b2e,_0x4d51db,_0x3321e3){var _0x2b28c4={'raw':![],'where':{}};var _0x38e5df={};var _0x47761b={'count':0x0,'rows':[]};return db[_0xa077('0x48')]['findOne']({'where':{'id':_0x166b2e[_0xa077('0x56')]['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x4d51db,null))[_0xa077('0x2b')](function(_0x396a2d){if(_0x396a2d){_0x38e5df[_0xa077('0x36')]=_[_0xa077('0x38')](db[_0xa077('0x5a')][_0xa077('0x34')]);_0x38e5df['query']=_[_0xa077('0x38')](_0x166b2e[_0xa077('0x37')]);_0x38e5df[_0xa077('0x41')]=_[_0xa077('0x3a')](_0x38e5df[_0xa077('0x36')],_0x38e5df['query']);_0x2b28c4[_0xa077('0x39')]=_[_0xa077('0x3a')](_0x38e5df[_0xa077('0x36')],qs[_0xa077('0x3b')](_0x166b2e[_0xa077('0x37')][_0xa077('0x3b')]));_0x2b28c4[_0xa077('0x39')]=_0x2b28c4[_0xa077('0x39')][_0xa077('0x3c')]?_0x2b28c4[_0xa077('0x39')]:_0x38e5df[_0xa077('0x36')];if(!_0x166b2e[_0xa077('0x37')]['hasOwnProperty'](_0xa077('0x5c'))){_0x2b28c4[_0xa077('0x23')]=qs[_0xa077('0x23')](_0x166b2e[_0xa077('0x37')][_0xa077('0x23')]);_0x2b28c4[_0xa077('0x25')]=qs[_0xa077('0x25')](_0x166b2e[_0xa077('0x37')][_0xa077('0x25')]);}_0x2b28c4[_0xa077('0x5d')]=qs['sort'](_0x166b2e['query'][_0xa077('0x3e')]);_0x2b28c4[_0xa077('0x3f')]=qs['filters'](_['pick'](_0x166b2e[_0xa077('0x37')],_0x38e5df[_0xa077('0x41')]));_0x2b28c4[_0xa077('0x3f')][_0xa077('0x59')]=_0x396a2d['id'];if(_0x166b2e[_0xa077('0x37')]['filter']){_0x2b28c4[_0xa077('0x3f')]=_['merge'](_0x2b28c4[_0xa077('0x3f')],{'$or':_[_0xa077('0x44')](_0x2b28c4[_0xa077('0x39')],function(_0xc11604){var _0x273c7a={};_0x273c7a[_0xc11604]={'$like':'%'+_0x166b2e[_0xa077('0x37')][_0xa077('0x42')]+'%'};return _0x273c7a;})});}_0x2b28c4=_['merge']({},_0x2b28c4,_0x166b2e[_0xa077('0x46')]);return db['Disposition']['count']({'where':_0x2b28c4['where']})[_0xa077('0x2b')](function(_0x17f0a2){_0x47761b[_0xa077('0x24')]=_0x17f0a2;if(_0x166b2e[_0xa077('0x37')]['includeAll']){_0x2b28c4[_0xa077('0x47')]=[{'all':!![]}];}return db[_0xa077('0x5a')][_0xa077('0x5e')](_0x2b28c4);})[_0xa077('0x2b')](function(_0x1c8b67){_0x47761b['rows']=_0x1c8b67;return _0x47761b;});}})['then'](respondWithFilteredResult(_0x4d51db,_0x2b28c4))[_0xa077('0x4a')](handleError(_0x4d51db,null));};exports[_0xa077('0x5f')]=function(_0x3f7946,_0x30f89b,_0x21ad00){return db[_0xa077('0x48')]['find']({'where':{'id':_0x3f7946[_0xa077('0x56')]['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x30f89b,null))['then'](function(_0x40b880){if(_0x40b880){return _0x40b880['removeDispositions'](_0x3f7946[_0xa077('0x37')][_0xa077('0x60')]);}})[_0xa077('0x2b')](respondWithStatusCode(_0x30f89b,null))[_0xa077('0x4a')](handleError(_0x30f89b,null));};exports[_0xa077('0x61')]=function(_0x4af13f,_0xe19140,_0x3c37cb){return db[_0xa077('0x48')]['find']({'where':{'id':_0x4af13f['params']['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0xe19140,null))[_0xa077('0x2b')](function(_0x3a5101){if(_0x3a5101){var _0x137586=[];var _0x289d4c={'success':[],'errors':[]};return db[_0xa077('0x62')]['describe']()[_0xa077('0x2b')](function(_0x5df1f9){if(_0x4af13f[_0xa077('0x4f')][_0xa077('0x63')]&&_['isArray'](_0x4af13f['body'][_0xa077('0x63')])){if(_0x4af13f[_0xa077('0x4f')]['tags'][_0xa077('0x3c')]){_0x4af13f[_0xa077('0x4f')][_0xa077('0x63')]=_0x4af13f[_0xa077('0x4f')][_0xa077('0x63')]['join'](';')+';';}else{_0x4af13f[_0xa077('0x4f')]['tags']=null;}}else{_0x4af13f[_0xa077('0x4f')][_0xa077('0x63')]=null;}if(_0x4af13f['body']&&_[_0xa077('0x64')](_0x4af13f[_0xa077('0x4f')])){for(var _0x10a3ff=0x0;_0x10a3ff<_0x4af13f[_0xa077('0x4f')][_0xa077('0x3c')];_0x10a3ff+=0x1){_0x4af13f[_0xa077('0x4f')][_0x10a3ff]['ListId']=_0x4af13f['params']['id'];_0x137586[_0xa077('0x65')](_0x4af13f[_0xa077('0x4f')][_0x10a3ff]);}return BPromise['each'](_0x137586,function(_0xb84b30){return db['CmContact']['create'](_[_0xa077('0x66')](_0xb84b30,[_0xa077('0x60'),'id'])||{},{'fields':_[_0xa077('0x38')](_0x5df1f9),'raw':!![]})[_0xa077('0x2b')](function(_0x296d74){_0x289d4c[_0xa077('0x67')][_0xa077('0x65')](_0x296d74[_0xa077('0x68')]);})[_0xa077('0x4a')](function(_0x1fefc9){_0x289d4c[_0xa077('0x69')][_0xa077('0x65')]({'data':_0xb84b30,'error':_0x1fefc9[_0xa077('0x6a')]});});})['then'](function(_0x318418){return _0x289d4c;})[_0xa077('0x4a')](function(_0x548b09){return _0x548b09;});}else{_0xe19140['status'](0x190)['json']({'message':_0xa077('0x6b')});}});}})[_0xa077('0x2b')](respondWithResult(_0xe19140,null))[_0xa077('0x4a')](handleError(_0xe19140,null));};exports[_0xa077('0x6c')]=function(_0x5b3dbd,_0x57ed4d,_0xa853cf){var _0x4d4cf2;return db[_0xa077('0x48')][_0xa077('0x4d')]({'where':{'id':_0x5b3dbd[_0xa077('0x56')]['id']},'include':[{'model':db[_0xa077('0x6d')],'as':_0xa077('0x6e')}]})[_0xa077('0x2b')](handleEntityNotFound(_0x57ed4d,null))[_0xa077('0x2b')](function(_0x2bbce8){if(_0x2bbce8){_0x4d4cf2=_0x2bbce8;return db[_0xa077('0x62')][_0xa077('0x34')];}})['then'](function(_0xeebdca){if(_0xeebdca){var _0x2293bb={};var _0x1d8590={};_0x1d8590['model']=_[_0xa077('0x6f')](_['keys'](_0xeebdca),_[_0xa077('0x44')](_0x4d4cf2[_0xa077('0x6e')],function(_0x5ae8ae){return util[_0xa077('0x70')](_0xa077('0x71'),_0x5ae8ae['id']);}));_0x1d8590[_0xa077('0x37')]=_['keys'](_0x5b3dbd['query']);_0x1d8590[_0xa077('0x41')]=_[_0xa077('0x3a')](_0x1d8590[_0xa077('0x36')],_0x1d8590[_0xa077('0x37')]);_0x2293bb[_0xa077('0x39')]=_['intersection'](_0x1d8590[_0xa077('0x36')],qs['fields'](_0x5b3dbd[_0xa077('0x37')][_0xa077('0x3b')]));_0x2293bb['attributes']=_0x2293bb[_0xa077('0x39')]['length']?_0x2293bb[_0xa077('0x39')]:_0x1d8590[_0xa077('0x36')];if(!_0x5b3dbd['query'][_0xa077('0x3d')](_0xa077('0x5c'))){_0x2293bb[_0xa077('0x23')]=qs[_0xa077('0x23')](_0x5b3dbd[_0xa077('0x37')]['limit']);_0x2293bb[_0xa077('0x25')]=qs[_0xa077('0x25')](_0x5b3dbd[_0xa077('0x37')]['offset']);}_0x2293bb[_0xa077('0x5d')]=qs[_0xa077('0x3e')](_0x5b3dbd['query']['sort']);_0x2293bb[_0xa077('0x3f')]=qs[_0xa077('0x41')](_[_0xa077('0x40')](_0x5b3dbd['query'],_0x1d8590['filters']));_0x2293bb[_0xa077('0x72')]=!![];if(_0x5b3dbd[_0xa077('0x37')]['filter']){_0x2293bb[_0xa077('0x3f')]=_['merge'](_0x2293bb[_0xa077('0x3f')],{'$or':_[_0xa077('0x44')](_0x2293bb[_0xa077('0x39')],function(_0x40a86f){var _0x1023f6={};_0x1023f6[_0x40a86f]={'$like':'%'+_0x5b3dbd[_0xa077('0x37')][_0xa077('0x42')]+'%'};return _0x1023f6;})});}_0x2293bb=_['merge']({},_0x2293bb,_0x5b3dbd[_0xa077('0x46')]);return _0x4d4cf2[_0xa077('0x6c')](_0x2293bb);}})[_0xa077('0x2b')](respondWithResult(_0x57ed4d,null))[_0xa077('0x4a')](handleError(_0x57ed4d,null));};exports[_0xa077('0x73')]=function(_0x3cd9c7,_0x810b2c,_0x199188){var _0x99631d;return db[_0xa077('0x48')][_0xa077('0x4d')]({'where':{'id':_0x3cd9c7[_0xa077('0x56')]['id']},'include':[{'model':db[_0xa077('0x6d')],'as':_0xa077('0x6e')}]})['then'](handleEntityNotFound(_0x810b2c,null))['then'](function(_0x40d752){if(_0x40d752){_0x99631d=_0x40d752;return db['CmContact'][_0xa077('0x34')];}})[_0xa077('0x2b')](function(_0x4ee55a){if(_0x4ee55a){var _0x445125={};var _0x21ccfa={};_0x21ccfa[_0xa077('0x36')]=_['concat'](_[_0xa077('0x38')](_0x4ee55a),_[_0xa077('0x44')](_0x99631d[_0xa077('0x6e')],function(_0x26b86d){return util['format']('cf_%d',_0x26b86d['id']);}));_0x21ccfa[_0xa077('0x37')]=_[_0xa077('0x38')](_0x3cd9c7['query']);_0x21ccfa[_0xa077('0x41')]=_[_0xa077('0x3a')](_0x21ccfa['model'],_0x21ccfa['query']);_0x445125[_0xa077('0x39')]=_[_0xa077('0x3a')](_0x21ccfa[_0xa077('0x36')],qs[_0xa077('0x3b')](_0x3cd9c7[_0xa077('0x37')][_0xa077('0x3b')]));_0x445125[_0xa077('0x39')]=_0x445125[_0xa077('0x39')][_0xa077('0x3c')]?_0x445125[_0xa077('0x39')]:_0x21ccfa[_0xa077('0x36')];if(!_0x3cd9c7[_0xa077('0x37')]['hasOwnProperty'](_0xa077('0x5c'))){_0x445125[_0xa077('0x23')]=qs[_0xa077('0x23')](_0x3cd9c7[_0xa077('0x37')]['limit']);_0x445125[_0xa077('0x25')]=qs[_0xa077('0x25')](_0x3cd9c7[_0xa077('0x37')][_0xa077('0x25')]);}_0x445125[_0xa077('0x5d')]=qs['sort'](_0x3cd9c7[_0xa077('0x37')][_0xa077('0x3e')]);_0x445125[_0xa077('0x3f')]=qs['filters'](_[_0xa077('0x40')](_0x3cd9c7[_0xa077('0x37')],_0x21ccfa[_0xa077('0x41')]));_0x445125['raw']=!![];if(_0x3cd9c7[_0xa077('0x37')][_0xa077('0x42')]){_0x445125[_0xa077('0x3f')]=_[_0xa077('0x43')](_0x445125[_0xa077('0x3f')],{'$or':_[_0xa077('0x44')](_0x445125[_0xa077('0x39')],function(_0x15300b){var _0x5c1b44={};_0x5c1b44[_0x15300b]={'$like':'%'+_0x3cd9c7[_0xa077('0x37')][_0xa077('0x42')]+'%'};return _0x5c1b44;})});}_0x445125=_['merge']({},_0x445125,_0x3cd9c7[_0xa077('0x46')]);return _0x99631d[_0xa077('0x6c')](_0x445125);}})[_0xa077('0x2b')](function(_0x1c69cd){if(!_[_0xa077('0x74')](_0x1c69cd)){var _0x3a3d30=toCsv(_0x1c69cd);var _0x3f3214=Date['now']();fs[_0xa077('0x75')](util[_0xa077('0x70')]('/tmp/list_%d_%s.csv',_0x99631d['id'],_0x3f3214),_0x3a3d30);_0x810b2c[_0xa077('0x76')](_0xa077('0x77'),_0xa077('0x78')+util[_0xa077('0x70')](_0xa077('0x79'),_0x99631d['id'],_0x3f3214));_0x810b2c[_0xa077('0x76')](_0xa077('0x7a'),_0xa077('0x7b'));return _0x810b2c[_0xa077('0x7c')](util['format'](_0xa077('0x7d'),_0x99631d['id'],_0x3f3214));}else{return _0x810b2c[_0xa077('0x1e')](0xcc);}})[_0xa077('0x4a')](handleError(_0x810b2c,null));};exports['addCustomField']=function(_0x2b71cb,_0x391f22,_0x230b11){var _0x219fa4;delete _0x2b71cb['body']['id'];return db[_0xa077('0x48')][_0xa077('0x7e')]({'where':{'id':_0x2b71cb[_0xa077('0x56')]['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x391f22,null))[_0xa077('0x2b')](function(_0x3ab035){if(_0x3ab035){return db[_0xa077('0x7f')][_0xa077('0x80')](function(_0x1e28b0){return db[_0xa077('0x6d')][_0xa077('0x4e')](_0x2b71cb[_0xa077('0x4f')],{'transaction':_0x1e28b0})['then'](function(_0x466f44){_0x219fa4=_0x466f44;return _0x3ab035['addCustomFields'](_0x466f44,{'transaction':_0x1e28b0});})[_0xa077('0x2b')](function(){var _0x136965={'type':db[_0xa077('0x81')]['TEXT'],'transaction':_0x1e28b0};switch(_0x2b71cb[_0xa077('0x4f')][_0xa077('0x35')]){case _0xa077('0x82'):_0x136965[_0xa077('0x35')]=db[_0xa077('0x81')][_0xa077('0x83')];break;case'number':_0x136965[_0xa077('0x35')]=db[_0xa077('0x81')][_0xa077('0x84')];break;case _0xa077('0x85'):_0x136965[_0xa077('0x35')]=db['Sequelize'][_0xa077('0x86')];_0x136965[_0xa077('0x87')]=![];break;default:}return db[_0xa077('0x7f')][_0xa077('0x88')][_0xa077('0x89')](_0xa077('0x8a'),util[_0xa077('0x70')]('cf_%s',_0x219fa4['id']),_0x136965);})[_0xa077('0x2b')](function(){return _0x219fa4;});});}})['then'](respondWithResult(_0x391f22,null))[_0xa077('0x4a')](handleError(_0x391f22,null));};exports[_0xa077('0x8b')]=function(_0x5bbaa2,_0x12fafa,_0x5ad551){var _0x9c3a0b={};var _0x3b69dc={};var _0x1efd7d;var _0x57bd2e;return db[_0xa077('0x48')][_0xa077('0x7e')]({'where':{'id':_0x5bbaa2[_0xa077('0x56')]['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x12fafa,null))[_0xa077('0x2b')](function(_0x1ec8c4){if(_0x1ec8c4){_0x1efd7d=_0x1ec8c4;_0x3b69dc[_0xa077('0x36')]=_[_0xa077('0x38')](db[_0xa077('0x6d')][_0xa077('0x34')]);_0x3b69dc[_0xa077('0x37')]=_[_0xa077('0x38')](_0x5bbaa2[_0xa077('0x37')]);_0x3b69dc[_0xa077('0x41')]=_[_0xa077('0x3a')](_0x3b69dc[_0xa077('0x36')],_0x3b69dc['query']);_0x9c3a0b[_0xa077('0x39')]=_[_0xa077('0x3a')](_0x3b69dc[_0xa077('0x36')],qs[_0xa077('0x3b')](_0x5bbaa2[_0xa077('0x37')][_0xa077('0x3b')]));_0x9c3a0b[_0xa077('0x39')]=_0x9c3a0b[_0xa077('0x39')][_0xa077('0x3c')]?_0x9c3a0b['attributes']:_0x3b69dc[_0xa077('0x36')];_0x9c3a0b[_0xa077('0x5d')]=qs[_0xa077('0x3e')](_0x5bbaa2['query'][_0xa077('0x3e')]);_0x9c3a0b[_0xa077('0x3f')]=qs[_0xa077('0x41')](_[_0xa077('0x40')](_0x5bbaa2[_0xa077('0x37')],_0x3b69dc['filters']));_0x9c3a0b[_0xa077('0x3f')]=_[_0xa077('0x43')](_0x9c3a0b[_0xa077('0x3f')],{'$or':[{'ListId':_0x1ec8c4['id']},{'ListId':null}]});if(_0x5bbaa2['query'][_0xa077('0x42')]){_0x9c3a0b[_0xa077('0x3f')]=_[_0xa077('0x43')](_0x9c3a0b[_0xa077('0x3f')],{'$or':_['map'](_0x9c3a0b[_0xa077('0x39')],function(_0x533560){var _0x2c0144={};_0x2c0144[_0x533560]={'$like':'%'+_0x5bbaa2[_0xa077('0x37')][_0xa077('0x42')]+'%'};return _0x2c0144;})});}_0x9c3a0b=_[_0xa077('0x43')]({},_0x9c3a0b,_0x5bbaa2[_0xa077('0x46')]);return db['CmCustomField'][_0xa077('0x8c')](_0x9c3a0b);}})['then'](respondWithResult(_0x12fafa,null))[_0xa077('0x4a')](handleError(_0x12fafa,null));};exports['addAgents']=function(_0x4ca565,_0x28251d,_0x535ae3){return db[_0xa077('0x48')][_0xa077('0x4d')]({'where':{'id':_0x4ca565[_0xa077('0x56')]['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x28251d,null))[_0xa077('0x2b')](function(_0x562f91){if(_0x562f91){return _0x562f91['addAgents'](_0x4ca565['body'][_0xa077('0x60')],_['omit'](_0x4ca565['body'],[_0xa077('0x60'),'id'])||{})[_0xa077('0x8d')](function(_0x194c74){for(var _0x279311=0x0;_0x279311<_0x4ca565[_0xa077('0x4f')][_0xa077('0x60')][_0xa077('0x3c')];_0x279311+=0x1){socket[_0xa077('0x8e')]('userCmList:save',{'UserId':Number(_0x4ca565[_0xa077('0x4f')][_0xa077('0x60')][_0x279311]),'CmListId':Number(_0x4ca565[_0xa077('0x56')]['id'])});}return _0x194c74;});}})['then'](respondWithResult(_0x28251d,null))[_0xa077('0x4a')](handleError(_0x28251d,null));};exports['removeAgents']=function(_0x3a5764,_0x4610db,_0x342a0f){return db[_0xa077('0x48')]['find']({'where':{'id':_0x3a5764['params']['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x4610db,null))['then'](function(_0x2fcd92){if(_0x2fcd92){return _0x2fcd92[_0xa077('0x8f')](_0x3a5764[_0xa077('0x37')]['ids'])[_0xa077('0x2b')](function(){if(_[_0xa077('0x64')](_0x3a5764[_0xa077('0x37')]['ids'])){for(var _0x26c07d=0x0;_0x26c07d<_0x3a5764[_0xa077('0x37')][_0xa077('0x60')][_0xa077('0x3c')];_0x26c07d+=0x1){socket['emit'](_0xa077('0x90'),{'UserId':Number(_0x3a5764[_0xa077('0x37')][_0xa077('0x60')][_0x26c07d]),'CmListId':Number(_0x3a5764[_0xa077('0x56')]['id'])});}}else{socket[_0xa077('0x8e')](_0xa077('0x90'),{'UserId':Number(_0x3a5764[_0xa077('0x37')][_0xa077('0x60')]),'CmListId':Number(_0x3a5764['params']['id'])});}});}})[_0xa077('0x2b')](respondWithStatusCode(_0x4610db,null))[_0xa077('0x4a')](handleError(_0x4610db,null));};exports[_0xa077('0x91')]=function(_0x47e935,_0x53224,_0x46ca47){var _0x4a7610={};var _0x4e1bba={};var _0x2dfef2;var _0x2803da;return db[_0xa077('0x48')][_0xa077('0x7e')]({'where':{'id':_0x47e935[_0xa077('0x56')]['id']}})[_0xa077('0x2b')](handleEntityNotFound(_0x53224,null))[_0xa077('0x2b')](function(_0x2a9a82){if(_0x2a9a82){_0x2dfef2=_0x2a9a82;_0x4e1bba['model']=_[_0xa077('0x38')](db[_0xa077('0x92')]['rawAttributes']);_0x4e1bba[_0xa077('0x37')]=_['keys'](_0x47e935[_0xa077('0x37')]);_0x4e1bba['filters']=_[_0xa077('0x3a')](_0x4e1bba[_0xa077('0x36')],_0x4e1bba[_0xa077('0x37')]);_0x4a7610[_0xa077('0x39')]=_[_0xa077('0x3a')](_0x4e1bba['model'],qs[_0xa077('0x3b')](_0x47e935[_0xa077('0x37')][_0xa077('0x3b')]));_0x4a7610['attributes']=_0x4a7610[_0xa077('0x39')][_0xa077('0x3c')]?_0x4a7610[_0xa077('0x39')]:_0x4e1bba[_0xa077('0x36')];_0x4a7610[_0xa077('0x5d')]=qs[_0xa077('0x3e')](_0x47e935[_0xa077('0x37')][_0xa077('0x3e')]);_0x4a7610[_0xa077('0x3f')]=qs[_0xa077('0x41')](_[_0xa077('0x40')](_0x47e935[_0xa077('0x37')],_0x4e1bba[_0xa077('0x41')]));if(_0x47e935['query'][_0xa077('0x42')]){_0x4a7610['where']=_[_0xa077('0x43')](_0x4a7610['where'],{'$or':_['map'](_0x4a7610['attributes'],function(_0x2a4367){var _0x3d873e={};_0x3d873e[_0x2a4367]={'$like':'%'+_0x47e935[_0xa077('0x37')][_0xa077('0x42')]+'%'};return _0x3d873e;})});}_0x4a7610=_[_0xa077('0x43')]({},_0x4a7610,_0x47e935[_0xa077('0x46')]);return _0x2dfef2['getAgents'](_0x4a7610);}})[_0xa077('0x2b')](function(_0x3406d7){if(_0x3406d7){_0x2803da=_0x3406d7[_0xa077('0x3c')];if(!_0x47e935[_0xa077('0x37')][_0xa077('0x3d')]('nolimit')){_0x4a7610[_0xa077('0x23')]=qs['limit'](_0x47e935[_0xa077('0x37')][_0xa077('0x23')]);_0x4a7610[_0xa077('0x25')]=qs[_0xa077('0x25')](_0x47e935['query'][_0xa077('0x25')]);}return _0x2dfef2['getAgents'](_0x4a7610);}})[_0xa077('0x2b')](function(_0x3c64f2){if(_0x3c64f2){return _0x3c64f2?{'count':_0x2803da,'rows':_0x3c64f2}:null;}})[_0xa077('0x2b')](respondWithResult(_0x53224,null))[_0xa077('0x4a')](handleError(_0x53224,null));}; \ No newline at end of file +var _0xdf61=['role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','addDisposition','ListId','getDispositions','findOne','Disposition','findAll','CmContact','tags','isArray','join','push','each','omit','ids','success','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','getContactsCsv','CmCustomField','format','cf_%d','raw','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','addCustomFields','text','Sequelize','TEXT','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','get','Lists','UserProfileResource','destroy','error','name','send','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','user'];(function(_0x2c8379,_0x383b43){var _0x2a4383=function(_0x430fce){while(--_0x430fce){_0x2c8379['push'](_0x2c8379['shift']());}};_0x2a4383(++_0x383b43);}(_0xdf61,0xce));var _0x1df6=function(_0x3c14a6,_0x192650){_0x3c14a6=_0x3c14a6-0x0;var _0x230669=_0xdf61[_0x3c14a6];return _0x230669;};'use strict';var emlformat=require(_0x1df6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1df6('0x1'));var jsonpatch=require(_0x1df6('0x2'));var rp=require(_0x1df6('0x3'));var moment=require('moment');var BPromise=require(_0x1df6('0x4'));var Mustache=require(_0x1df6('0x5'));var util=require(_0x1df6('0x6'));var path=require(_0x1df6('0x7'));var sox=require('sox');var csv=require(_0x1df6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1df6('0x9'));var crypto=require('crypto');var jsforce=require(_0x1df6('0xa'));var deskjs=require(_0x1df6('0xb'));var toCsv=require(_0x1df6('0x8'));var querystring=require('querystring');var Papa=require(_0x1df6('0xc'));var Redis=require(_0x1df6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1df6('0xe'));var as=require(_0x1df6('0xf'));var hardwareService=require(_0x1df6('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x1df6('0x11'));var config=require(_0x1df6('0x12'));var licenseUtil=require(_0x1df6('0x13'));var db=require(_0x1df6('0x14'))['db'];config[_0x1df6('0x15')]=_[_0x1df6('0x16')](config[_0x1df6('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x1df6('0x17'))(new Redis(config[_0x1df6('0x15')]));require('./cmList.socket')[_0x1df6('0x18')](socket);function respondWithStatusCode(_0x3dba16,_0x131ceb){_0x131ceb=_0x131ceb||0xcc;return function(_0x3e48ae){if(_0x3e48ae){return _0x3dba16[_0x1df6('0x19')](_0x131ceb);}return _0x3dba16['status'](_0x131ceb)[_0x1df6('0x1a')]();};}function respondWithResult(_0x338130,_0x62e63){_0x62e63=_0x62e63||0xc8;return function(_0x4856e6){if(_0x4856e6){return _0x338130[_0x1df6('0x1b')](_0x62e63)[_0x1df6('0x1c')](_0x4856e6);}};}function respondWithFilteredResult(_0x39e81e,_0xb2ddc3){return function(_0x5f4140){if(_0x5f4140){var _0x1cfcc0=typeof _0xb2ddc3[_0x1df6('0x1d')]==='undefined'&&typeof _0xb2ddc3[_0x1df6('0x1e')]===_0x1df6('0x1f');var _0x467400=_0x5f4140[_0x1df6('0x20')];var _0x41d9e4=_0x1cfcc0?0x0:_0xb2ddc3[_0x1df6('0x1d')];var _0x2b9ee3=_0x1cfcc0?_0x5f4140[_0x1df6('0x20')]:_0xb2ddc3[_0x1df6('0x1d')]+_0xb2ddc3[_0x1df6('0x1e')];var _0x3cd33b;if(_0x2b9ee3>=_0x467400){_0x2b9ee3=_0x467400;_0x3cd33b=0xc8;}else{_0x3cd33b=0xce;}_0x39e81e['status'](_0x3cd33b);return _0x39e81e[_0x1df6('0x21')](_0x1df6('0x22'),_0x41d9e4+'-'+_0x2b9ee3+'/'+_0x467400)[_0x1df6('0x1c')](_0x5f4140);}return null;};}function patchUpdates(_0x1e636f){return function(_0x40cff5){try{jsonpatch['apply'](_0x40cff5,_0x1e636f,!![]);}catch(_0x9b7d29){return BPromise[_0x1df6('0x23')](_0x9b7d29);}return _0x40cff5[_0x1df6('0x24')]();};}function saveUpdates(_0x145037,_0x578ded){return function(_0x2bbb9b){if(_0x2bbb9b){return _0x2bbb9b['update'](_0x145037)[_0x1df6('0x25')](function(_0x4291d8){return _0x4291d8;});}return null;};}function removeEntity(_0x5e19ab,_0x2797bb){return function(_0x627b6e){if(_0x627b6e){return _0x627b6e['destroy']()[_0x1df6('0x25')](function(){var _0x50bd4a=_0x627b6e[_0x1df6('0x26')]({'plain':!![]});var _0x342ad2=_0x1df6('0x27');return db[_0x1df6('0x28')][_0x1df6('0x29')]({'where':{'type':_0x342ad2,'resourceId':_0x50bd4a['id']}})[_0x1df6('0x25')](function(){return _0x627b6e;});})[_0x1df6('0x25')](function(){_0x5e19ab[_0x1df6('0x1b')](0xcc)[_0x1df6('0x1a')]();});}};}function handleEntityNotFound(_0x3704f2,_0x502307){return function(_0x15cc6c){if(!_0x15cc6c){_0x3704f2['sendStatus'](0x194);}return _0x15cc6c;};}function handleError(_0x3e5144,_0x4644a3){_0x4644a3=_0x4644a3||0x1f4;return function(_0x5cba81){logger[_0x1df6('0x2a')](_0x5cba81['stack']);if(_0x5cba81[_0x1df6('0x2b')]){delete _0x5cba81[_0x1df6('0x2b')];}_0x3e5144[_0x1df6('0x1b')](_0x4644a3)[_0x1df6('0x2c')](_0x5cba81);};}exports['index']=function(_0x9ba609,_0xd0e493){var _0x30d848={},_0x5aadc1={},_0x147ccd={'count':0x0,'rows':[]};var _0x528265=_[_0x1df6('0x2d')](db[_0x1df6('0x2e')][_0x1df6('0x2f')],function(_0x20c4a0){return{'name':_0x20c4a0[_0x1df6('0x30')],'type':_0x20c4a0[_0x1df6('0x31')][_0x1df6('0x32')]};});_0x5aadc1['model']=_[_0x1df6('0x2d')](_0x528265,_0x1df6('0x2b'));_0x5aadc1[_0x1df6('0x33')]=_[_0x1df6('0x34')](_0x9ba609['query']);_0x5aadc1[_0x1df6('0x35')]=_[_0x1df6('0x36')](_0x5aadc1['model'],_0x5aadc1[_0x1df6('0x33')]);_0x30d848[_0x1df6('0x37')]=_[_0x1df6('0x36')](_0x5aadc1[_0x1df6('0x38')],qs[_0x1df6('0x39')](_0x9ba609[_0x1df6('0x33')][_0x1df6('0x39')]));_0x30d848[_0x1df6('0x37')]=_0x30d848[_0x1df6('0x37')][_0x1df6('0x3a')]?_0x30d848[_0x1df6('0x37')]:_0x5aadc1[_0x1df6('0x38')];if(!_0x9ba609[_0x1df6('0x33')][_0x1df6('0x3b')](_0x1df6('0x3c'))){_0x30d848[_0x1df6('0x1e')]=qs[_0x1df6('0x1e')](_0x9ba609[_0x1df6('0x33')]['limit']);_0x30d848['offset']=qs[_0x1df6('0x1d')](_0x9ba609[_0x1df6('0x33')][_0x1df6('0x1d')]);}_0x30d848[_0x1df6('0x3d')]=qs[_0x1df6('0x3e')](_0x9ba609[_0x1df6('0x33')][_0x1df6('0x3e')]);_0x30d848['where']=qs[_0x1df6('0x35')](_[_0x1df6('0x3f')](_0x9ba609[_0x1df6('0x33')],_0x5aadc1['filters']),_0x528265);if(_0x9ba609['query'][_0x1df6('0x40')]){_0x30d848[_0x1df6('0x41')]=_[_0x1df6('0x42')](_0x30d848[_0x1df6('0x41')],{'$or':_[_0x1df6('0x2d')](_0x528265,function(_0x352e40){if(_0x352e40[_0x1df6('0x31')]!==_0x1df6('0x43')){var _0x104f19={};_0x104f19[_0x352e40[_0x1df6('0x2b')]]={'$like':'%'+_0x9ba609[_0x1df6('0x33')][_0x1df6('0x40')]+'%'};return _0x104f19;}})});}_0x30d848=_[_0x1df6('0x42')]({},_0x30d848,_0x9ba609[_0x1df6('0x44')]);var _0x4c3f48={'where':_0x30d848[_0x1df6('0x41')]};return db[_0x1df6('0x2e')]['count'](_0x4c3f48)[_0x1df6('0x25')](function(_0x5376a5){_0x147ccd[_0x1df6('0x20')]=_0x5376a5;if(_0x9ba609[_0x1df6('0x33')][_0x1df6('0x45')]){_0x30d848[_0x1df6('0x46')]=[{'all':!![]}];}return db[_0x1df6('0x2e')]['findAll'](_0x30d848);})['then'](function(_0x51ed45){_0x147ccd[_0x1df6('0x47')]=_0x51ed45;return _0x147ccd;})[_0x1df6('0x25')](respondWithFilteredResult(_0xd0e493,_0x30d848))[_0x1df6('0x48')](handleError(_0xd0e493,null));};exports[_0x1df6('0x49')]=function(_0x203359,_0x59b04b){var _0x22db63={'raw':![],'where':{'id':_0x203359[_0x1df6('0x4a')]['id']}},_0xd0fa90={};_0xd0fa90[_0x1df6('0x38')]=_[_0x1df6('0x34')](db[_0x1df6('0x2e')][_0x1df6('0x2f')]);_0xd0fa90[_0x1df6('0x33')]=_[_0x1df6('0x34')](_0x203359[_0x1df6('0x33')]);_0xd0fa90[_0x1df6('0x35')]=_[_0x1df6('0x36')](_0xd0fa90[_0x1df6('0x38')],_0xd0fa90[_0x1df6('0x33')]);_0x22db63['attributes']=_[_0x1df6('0x36')](_0xd0fa90['model'],qs[_0x1df6('0x39')](_0x203359[_0x1df6('0x33')]['fields']));_0x22db63[_0x1df6('0x37')]=_0x22db63[_0x1df6('0x37')][_0x1df6('0x3a')]?_0x22db63[_0x1df6('0x37')]:_0xd0fa90[_0x1df6('0x38')];if(_0x203359[_0x1df6('0x33')][_0x1df6('0x45')]){_0x22db63[_0x1df6('0x46')]=[{'all':!![]}];}_0x22db63=_['merge']({},_0x22db63,_0x203359['options']);return db['CmList'][_0x1df6('0x4b')](_0x22db63)['then'](handleEntityNotFound(_0x59b04b,null))[_0x1df6('0x25')](respondWithResult(_0x59b04b,null))[_0x1df6('0x48')](handleError(_0x59b04b,null));};exports[_0x1df6('0x4c')]=function(_0x5a8ff2,_0x4069af){return db[_0x1df6('0x2e')][_0x1df6('0x4c')](_0x5a8ff2['body'],{})['then'](function(_0x51b8af){var _0x5ed82d=_0x5a8ff2[_0x1df6('0x4d')][_0x1df6('0x26')]({'plain':!![]});if(!_0x5ed82d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ed82d[_0x1df6('0x4e')]===_0x1df6('0x4d')){var _0x41c23c=_0x51b8af[_0x1df6('0x26')]({'plain':!![]});var _0x4c3ee3=_0x1df6('0x27');return db[_0x1df6('0x4f')][_0x1df6('0x4b')]({'where':{'name':_0x4c3ee3,'userProfileId':_0x5ed82d[_0x1df6('0x50')]},'raw':!![]})['then'](function(_0x53d785){if(_0x53d785&&_0x53d785[_0x1df6('0x51')]===0x0){return db[_0x1df6('0x28')][_0x1df6('0x4c')]({'name':_0x41c23c[_0x1df6('0x2b')],'resourceId':_0x41c23c['id'],'type':_0x53d785[_0x1df6('0x2b')],'sectionId':_0x53d785['id']},{})['then'](function(){return _0x51b8af;});}else{return _0x51b8af;}})[_0x1df6('0x48')](function(_0x26511c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26511c);throw _0x26511c;});}return _0x51b8af;})['then'](respondWithResult(_0x4069af,0xc9))[_0x1df6('0x48')](handleError(_0x4069af,null));};exports[_0x1df6('0x52')]=function(_0x36f0b3,_0x1b7ecb){if(_0x36f0b3[_0x1df6('0x53')]['id']){delete _0x36f0b3[_0x1df6('0x53')]['id'];}return db[_0x1df6('0x2e')]['find']({'where':{'id':_0x36f0b3[_0x1df6('0x4a')]['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x1b7ecb,null))['then'](saveUpdates(_0x36f0b3['body'],null))[_0x1df6('0x25')](respondWithResult(_0x1b7ecb,null))[_0x1df6('0x48')](handleError(_0x1b7ecb,null));};exports[_0x1df6('0x29')]=function(_0x448776,_0x3ff8ec){return db['CmList']['find']({'where':{'id':_0x448776[_0x1df6('0x4a')]['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x3ff8ec,null))[_0x1df6('0x25')](removeEntity(_0x3ff8ec,null))[_0x1df6('0x48')](handleError(_0x3ff8ec,null));};exports[_0x1df6('0x54')]=function(_0x34f1a7,_0x3e3bde){return db[_0x1df6('0x2e')][_0x1df6('0x54')]()[_0x1df6('0x25')](respondWithResult(_0x3e3bde,null))[_0x1df6('0x48')](handleError(_0x3e3bde,null));};exports[_0x1df6('0x55')]=function(_0xd9c951,_0x534473,_0x3bb51d){if(_0xd9c951[_0x1df6('0x53')]['id']){delete _0xd9c951[_0x1df6('0x53')]['id'];}return db['CmList'][_0x1df6('0x4b')]({'where':{'id':_0xd9c951[_0x1df6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x534473,null))[_0x1df6('0x25')](function(_0x3b5035){if(_0x3b5035){_0xd9c951[_0x1df6('0x53')][_0x1df6('0x56')]=_0x3b5035['id'];return db['Disposition'][_0x1df6('0x4c')](_0xd9c951[_0x1df6('0x53')]);}})[_0x1df6('0x25')](respondWithResult(_0x534473,null))[_0x1df6('0x48')](handleError(_0x534473,null));};exports[_0x1df6('0x57')]=function(_0x14f755,_0x49d9b0,_0x15c0b9){var _0x583acc={'raw':![],'where':{}};var _0x34db34={};var _0x46b907={'count':0x0,'rows':[]};return db[_0x1df6('0x2e')][_0x1df6('0x58')]({'where':{'id':_0x14f755[_0x1df6('0x4a')]['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x49d9b0,null))[_0x1df6('0x25')](function(_0x16b357){if(_0x16b357){_0x34db34[_0x1df6('0x38')]=_[_0x1df6('0x34')](db[_0x1df6('0x59')][_0x1df6('0x2f')]);_0x34db34[_0x1df6('0x33')]=_[_0x1df6('0x34')](_0x14f755[_0x1df6('0x33')]);_0x34db34[_0x1df6('0x35')]=_[_0x1df6('0x36')](_0x34db34[_0x1df6('0x38')],_0x34db34[_0x1df6('0x33')]);_0x583acc[_0x1df6('0x37')]=_['intersection'](_0x34db34[_0x1df6('0x38')],qs[_0x1df6('0x39')](_0x14f755['query'][_0x1df6('0x39')]));_0x583acc[_0x1df6('0x37')]=_0x583acc[_0x1df6('0x37')][_0x1df6('0x3a')]?_0x583acc[_0x1df6('0x37')]:_0x34db34['model'];if(!_0x14f755['query'][_0x1df6('0x3b')]('nolimit')){_0x583acc[_0x1df6('0x1e')]=qs[_0x1df6('0x1e')](_0x14f755[_0x1df6('0x33')][_0x1df6('0x1e')]);_0x583acc[_0x1df6('0x1d')]=qs[_0x1df6('0x1d')](_0x14f755[_0x1df6('0x33')][_0x1df6('0x1d')]);}_0x583acc[_0x1df6('0x3d')]=qs[_0x1df6('0x3e')](_0x14f755[_0x1df6('0x33')][_0x1df6('0x3e')]);_0x583acc[_0x1df6('0x41')]=qs[_0x1df6('0x35')](_[_0x1df6('0x3f')](_0x14f755['query'],_0x34db34[_0x1df6('0x35')]));_0x583acc[_0x1df6('0x41')]['ListId']=_0x16b357['id'];if(_0x14f755[_0x1df6('0x33')][_0x1df6('0x40')]){_0x583acc[_0x1df6('0x41')]=_['merge'](_0x583acc[_0x1df6('0x41')],{'$or':_[_0x1df6('0x2d')](_0x583acc[_0x1df6('0x37')],function(_0x1da488){var _0x4530a9={};_0x4530a9[_0x1da488]={'$like':'%'+_0x14f755[_0x1df6('0x33')][_0x1df6('0x40')]+'%'};return _0x4530a9;})});}_0x583acc=_[_0x1df6('0x42')]({},_0x583acc,_0x14f755[_0x1df6('0x44')]);return db[_0x1df6('0x59')]['count']({'where':_0x583acc[_0x1df6('0x41')]})['then'](function(_0x495c53){_0x46b907[_0x1df6('0x20')]=_0x495c53;if(_0x14f755[_0x1df6('0x33')]['includeAll']){_0x583acc[_0x1df6('0x46')]=[{'all':!![]}];}return db[_0x1df6('0x59')][_0x1df6('0x5a')](_0x583acc);})[_0x1df6('0x25')](function(_0x29f0c6){_0x46b907[_0x1df6('0x47')]=_0x29f0c6;return _0x46b907;});}})['then'](respondWithFilteredResult(_0x49d9b0,_0x583acc))[_0x1df6('0x48')](handleError(_0x49d9b0,null));};exports['removeDispositions']=function(_0x51045c,_0x4f3b5a,_0x5b295d){return db['CmList'][_0x1df6('0x4b')]({'where':{'id':_0x51045c[_0x1df6('0x4a')]['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x4f3b5a,null))[_0x1df6('0x25')](function(_0x44cc72){if(_0x44cc72){return _0x44cc72['removeDispositions'](_0x51045c[_0x1df6('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x4f3b5a,null))['catch'](handleError(_0x4f3b5a,null));};exports['addContacts']=function(_0x1364dc,_0x8cc33b,_0x53c500){return db[_0x1df6('0x2e')][_0x1df6('0x4b')]({'where':{'id':_0x1364dc[_0x1df6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x8cc33b,null))[_0x1df6('0x25')](function(_0x5b96ca){if(_0x5b96ca){var _0x15d8aa=[];var _0xa757dc={'success':[],'errors':[]};return db[_0x1df6('0x5b')][_0x1df6('0x54')]()[_0x1df6('0x25')](function(_0x331529){if(_0x1364dc['body'][_0x1df6('0x5c')]&&_[_0x1df6('0x5d')](_0x1364dc['body'][_0x1df6('0x5c')])){if(_0x1364dc['body'][_0x1df6('0x5c')][_0x1df6('0x3a')]){_0x1364dc[_0x1df6('0x53')][_0x1df6('0x5c')]=_0x1364dc[_0x1df6('0x53')][_0x1df6('0x5c')][_0x1df6('0x5e')](';')+';';}else{_0x1364dc[_0x1df6('0x53')][_0x1df6('0x5c')]=null;}}else{_0x1364dc[_0x1df6('0x53')]['tags']=null;}if(_0x1364dc[_0x1df6('0x53')]&&_[_0x1df6('0x5d')](_0x1364dc['body'])){for(var _0x5cb1c1=0x0;_0x5cb1c1<_0x1364dc[_0x1df6('0x53')][_0x1df6('0x3a')];_0x5cb1c1+=0x1){_0x1364dc[_0x1df6('0x53')][_0x5cb1c1][_0x1df6('0x56')]=_0x1364dc[_0x1df6('0x4a')]['id'];_0x15d8aa[_0x1df6('0x5f')](_0x1364dc[_0x1df6('0x53')][_0x5cb1c1]);}return BPromise[_0x1df6('0x60')](_0x15d8aa,function(_0x4f6e10){return db[_0x1df6('0x5b')][_0x1df6('0x4c')](_[_0x1df6('0x61')](_0x4f6e10,[_0x1df6('0x62'),'id'])||{},{'fields':_[_0x1df6('0x34')](_0x331529),'raw':!![]})[_0x1df6('0x25')](function(_0x2402af){_0xa757dc[_0x1df6('0x63')]['push'](_0x2402af['dataValues']);})['catch'](function(_0x4b8a53){_0xa757dc['errors'][_0x1df6('0x5f')]({'data':_0x4f6e10,'error':_0x4b8a53[_0x1df6('0x64')]});});})[_0x1df6('0x25')](function(_0x6dddf8){return _0xa757dc;})[_0x1df6('0x48')](function(_0x295d51){return _0x295d51;});}else{_0x8cc33b[_0x1df6('0x1b')](0x190)[_0x1df6('0x1c')]({'message':_0x1df6('0x65')});}});}})[_0x1df6('0x25')](respondWithResult(_0x8cc33b,null))['catch'](handleError(_0x8cc33b,null));};exports[_0x1df6('0x66')]=function(_0x46f9f3,_0x766a65,_0x5a166a){var _0x15a895;return db[_0x1df6('0x2e')][_0x1df6('0x4b')]({'where':{'id':_0x46f9f3[_0x1df6('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x1df6('0x67')}]})[_0x1df6('0x25')](handleEntityNotFound(_0x766a65,null))[_0x1df6('0x25')](function(_0x8b834d){if(_0x8b834d){_0x15a895=_0x8b834d;return db[_0x1df6('0x5b')]['rawAttributes'];}})[_0x1df6('0x25')](function(_0x5ea1c0){if(_0x5ea1c0){var _0x41148c={};var _0x647824={};_0x647824['model']=_[_0x1df6('0x68')](_['keys'](_0x5ea1c0),_['map'](_0x15a895['CustomFields'],function(_0x23e16c){return util['format']('cf_%d',_0x23e16c['id']);}));_0x647824[_0x1df6('0x33')]=_[_0x1df6('0x34')](_0x46f9f3['query']);_0x647824[_0x1df6('0x35')]=_[_0x1df6('0x36')](_0x647824[_0x1df6('0x38')],_0x647824[_0x1df6('0x33')]);_0x41148c[_0x1df6('0x37')]=_[_0x1df6('0x36')](_0x647824['model'],qs[_0x1df6('0x39')](_0x46f9f3['query'][_0x1df6('0x39')]));_0x41148c['attributes']=_0x41148c['attributes'][_0x1df6('0x3a')]?_0x41148c[_0x1df6('0x37')]:_0x647824['model'];if(!_0x46f9f3['query'][_0x1df6('0x3b')]('nolimit')){_0x41148c[_0x1df6('0x1e')]=qs['limit'](_0x46f9f3['query'][_0x1df6('0x1e')]);_0x41148c['offset']=qs[_0x1df6('0x1d')](_0x46f9f3[_0x1df6('0x33')][_0x1df6('0x1d')]);}_0x41148c[_0x1df6('0x3d')]=qs[_0x1df6('0x3e')](_0x46f9f3['query']['sort']);_0x41148c['where']=qs[_0x1df6('0x35')](_[_0x1df6('0x3f')](_0x46f9f3[_0x1df6('0x33')],_0x647824[_0x1df6('0x35')]));_0x41148c['raw']=!![];if(_0x46f9f3['query'][_0x1df6('0x40')]){_0x41148c['where']=_[_0x1df6('0x42')](_0x41148c[_0x1df6('0x41')],{'$or':_[_0x1df6('0x2d')](_0x41148c[_0x1df6('0x37')],function(_0x3b8784){var _0x41a7a6={};_0x41a7a6[_0x3b8784]={'$like':'%'+_0x46f9f3[_0x1df6('0x33')][_0x1df6('0x40')]+'%'};return _0x41a7a6;})});}_0x41148c=_[_0x1df6('0x42')]({},_0x41148c,_0x46f9f3[_0x1df6('0x44')]);return _0x15a895[_0x1df6('0x66')](_0x41148c);}})[_0x1df6('0x25')](respondWithResult(_0x766a65,null))[_0x1df6('0x48')](handleError(_0x766a65,null));};exports[_0x1df6('0x69')]=function(_0xa6b83e,_0x49083e,_0x2274fd){var _0x33c30b;return db[_0x1df6('0x2e')][_0x1df6('0x4b')]({'where':{'id':_0xa6b83e['params']['id']},'include':[{'model':db[_0x1df6('0x6a')],'as':_0x1df6('0x67')}]})[_0x1df6('0x25')](handleEntityNotFound(_0x49083e,null))[_0x1df6('0x25')](function(_0x318372){if(_0x318372){_0x33c30b=_0x318372;return db['CmContact'][_0x1df6('0x2f')];}})[_0x1df6('0x25')](function(_0x342b79){if(_0x342b79){var _0x495da4={};var _0x275bfd={};_0x275bfd[_0x1df6('0x38')]=_['concat'](_[_0x1df6('0x34')](_0x342b79),_[_0x1df6('0x2d')](_0x33c30b[_0x1df6('0x67')],function(_0x34c78c){return util[_0x1df6('0x6b')](_0x1df6('0x6c'),_0x34c78c['id']);}));_0x275bfd[_0x1df6('0x33')]=_[_0x1df6('0x34')](_0xa6b83e[_0x1df6('0x33')]);_0x275bfd['filters']=_['intersection'](_0x275bfd[_0x1df6('0x38')],_0x275bfd[_0x1df6('0x33')]);_0x495da4[_0x1df6('0x37')]=_[_0x1df6('0x36')](_0x275bfd[_0x1df6('0x38')],qs[_0x1df6('0x39')](_0xa6b83e[_0x1df6('0x33')][_0x1df6('0x39')]));_0x495da4[_0x1df6('0x37')]=_0x495da4[_0x1df6('0x37')][_0x1df6('0x3a')]?_0x495da4['attributes']:_0x275bfd[_0x1df6('0x38')];if(!_0xa6b83e[_0x1df6('0x33')][_0x1df6('0x3b')]('nolimit')){_0x495da4[_0x1df6('0x1e')]=qs[_0x1df6('0x1e')](_0xa6b83e[_0x1df6('0x33')][_0x1df6('0x1e')]);_0x495da4[_0x1df6('0x1d')]=qs[_0x1df6('0x1d')](_0xa6b83e[_0x1df6('0x33')][_0x1df6('0x1d')]);}_0x495da4[_0x1df6('0x3d')]=qs['sort'](_0xa6b83e[_0x1df6('0x33')]['sort']);_0x495da4[_0x1df6('0x41')]=qs['filters'](_[_0x1df6('0x3f')](_0xa6b83e[_0x1df6('0x33')],_0x275bfd[_0x1df6('0x35')]));_0x495da4[_0x1df6('0x6d')]=!![];if(_0xa6b83e['query']['filter']){_0x495da4[_0x1df6('0x41')]=_['merge'](_0x495da4['where'],{'$or':_[_0x1df6('0x2d')](_0x495da4['attributes'],function(_0x7c95c){var _0x1a8c8f={};_0x1a8c8f[_0x7c95c]={'$like':'%'+_0xa6b83e[_0x1df6('0x33')][_0x1df6('0x40')]+'%'};return _0x1a8c8f;})});}_0x495da4=_[_0x1df6('0x42')]({},_0x495da4,_0xa6b83e[_0x1df6('0x44')]);return _0x33c30b['getContacts'](_0x495da4);}})['then'](function(_0x47edf0){if(!_['isEmpty'](_0x47edf0)){var _0x2859ab=toCsv(_0x47edf0);var _0x4c756b=Date[_0x1df6('0x6e')]();fs[_0x1df6('0x6f')](util[_0x1df6('0x6b')](_0x1df6('0x70'),_0x33c30b['id'],_0x4c756b),_0x2859ab);_0x49083e[_0x1df6('0x71')](_0x1df6('0x72'),_0x1df6('0x73')+util[_0x1df6('0x6b')]('list_%d_%s.csv',_0x33c30b['id'],_0x4c756b));_0x49083e[_0x1df6('0x71')](_0x1df6('0x74'),_0x1df6('0x75'));return _0x49083e[_0x1df6('0x76')](util[_0x1df6('0x6b')](_0x1df6('0x70'),_0x33c30b['id'],_0x4c756b));}else{return _0x49083e[_0x1df6('0x19')](0xcc);}})[_0x1df6('0x48')](handleError(_0x49083e,null));};exports[_0x1df6('0x77')]=function(_0x5caaaf,_0x1aa498,_0x4f5cad){var _0x26d40a;delete _0x5caaaf[_0x1df6('0x53')]['id'];return db[_0x1df6('0x2e')][_0x1df6('0x58')]({'where':{'id':_0x5caaaf['params']['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x1aa498,null))[_0x1df6('0x25')](function(_0x352cae){if(_0x352cae){return db['sequelize']['transaction'](function(_0x5677de){return db[_0x1df6('0x6a')][_0x1df6('0x4c')](_0x5caaaf['body'],{'transaction':_0x5677de})[_0x1df6('0x25')](function(_0x263a85){_0x26d40a=_0x263a85;return _0x352cae[_0x1df6('0x78')](_0x263a85,{'transaction':_0x5677de});})[_0x1df6('0x25')](function(){var _0x578956={'type':db['Sequelize']['TEXT'],'transaction':_0x5677de};switch(_0x5caaaf['body'][_0x1df6('0x31')]){case _0x1df6('0x79'):_0x578956['type']=db[_0x1df6('0x7a')][_0x1df6('0x7b')];break;case _0x1df6('0x7c'):_0x578956[_0x1df6('0x31')]=db[_0x1df6('0x7a')][_0x1df6('0x7d')];break;case'switch':_0x578956['type']=db[_0x1df6('0x7a')][_0x1df6('0x7e')];_0x578956[_0x1df6('0x7f')]=![];break;default:}return db[_0x1df6('0x80')][_0x1df6('0x81')][_0x1df6('0x82')]('cm_contacts',util[_0x1df6('0x6b')](_0x1df6('0x83'),_0x26d40a['id']),_0x578956);})[_0x1df6('0x25')](function(){return _0x26d40a;});});}})[_0x1df6('0x25')](respondWithResult(_0x1aa498,null))[_0x1df6('0x48')](handleError(_0x1aa498,null));};exports[_0x1df6('0x84')]=function(_0x49b48e,_0x3d71e1,_0x13f9a4){var _0x228c84={};var _0x284e94={};var _0x3fa1c9;var _0xe4eff;return db[_0x1df6('0x2e')][_0x1df6('0x58')]({'where':{'id':_0x49b48e[_0x1df6('0x4a')]['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x3d71e1,null))['then'](function(_0x59df71){if(_0x59df71){_0x3fa1c9=_0x59df71;_0x284e94[_0x1df6('0x38')]=_[_0x1df6('0x34')](db[_0x1df6('0x6a')]['rawAttributes']);_0x284e94[_0x1df6('0x33')]=_[_0x1df6('0x34')](_0x49b48e['query']);_0x284e94[_0x1df6('0x35')]=_[_0x1df6('0x36')](_0x284e94[_0x1df6('0x38')],_0x284e94[_0x1df6('0x33')]);_0x228c84['attributes']=_['intersection'](_0x284e94[_0x1df6('0x38')],qs['fields'](_0x49b48e[_0x1df6('0x33')]['fields']));_0x228c84[_0x1df6('0x37')]=_0x228c84[_0x1df6('0x37')][_0x1df6('0x3a')]?_0x228c84['attributes']:_0x284e94['model'];_0x228c84[_0x1df6('0x3d')]=qs[_0x1df6('0x3e')](_0x49b48e[_0x1df6('0x33')]['sort']);_0x228c84[_0x1df6('0x41')]=qs[_0x1df6('0x35')](_[_0x1df6('0x3f')](_0x49b48e[_0x1df6('0x33')],_0x284e94['filters']));_0x228c84['where']=_['merge'](_0x228c84[_0x1df6('0x41')],{'$or':[{'ListId':_0x59df71['id']},{'ListId':null}]});if(_0x49b48e['query'][_0x1df6('0x40')]){_0x228c84[_0x1df6('0x41')]=_[_0x1df6('0x42')](_0x228c84[_0x1df6('0x41')],{'$or':_[_0x1df6('0x2d')](_0x228c84[_0x1df6('0x37')],function(_0x2039f4){var _0x3e5b86={};_0x3e5b86[_0x2039f4]={'$like':'%'+_0x49b48e[_0x1df6('0x33')][_0x1df6('0x40')]+'%'};return _0x3e5b86;})});}_0x228c84=_[_0x1df6('0x42')]({},_0x228c84,_0x49b48e['options']);return db[_0x1df6('0x6a')][_0x1df6('0x85')](_0x228c84);}})[_0x1df6('0x25')](respondWithResult(_0x3d71e1,null))[_0x1df6('0x48')](handleError(_0x3d71e1,null));};exports['addAgents']=function(_0x5d379b,_0x5c214f,_0x830394){return db[_0x1df6('0x2e')][_0x1df6('0x4b')]({'where':{'id':_0x5d379b[_0x1df6('0x4a')]['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x5c214f,null))[_0x1df6('0x25')](function(_0x390896){if(_0x390896){return _0x390896[_0x1df6('0x86')](_0x5d379b['body'][_0x1df6('0x62')],_[_0x1df6('0x61')](_0x5d379b[_0x1df6('0x53')],['ids','id'])||{})[_0x1df6('0x87')](function(_0x366d14){for(var _0x2ba557=0x0;_0x2ba557<_0x5d379b[_0x1df6('0x53')][_0x1df6('0x62')][_0x1df6('0x3a')];_0x2ba557+=0x1){socket[_0x1df6('0x88')](_0x1df6('0x89'),{'UserId':Number(_0x5d379b['body'][_0x1df6('0x62')][_0x2ba557]),'CmListId':Number(_0x5d379b[_0x1df6('0x4a')]['id'])});}return _0x366d14;});}})[_0x1df6('0x25')](respondWithResult(_0x5c214f,null))[_0x1df6('0x48')](handleError(_0x5c214f,null));};exports[_0x1df6('0x8a')]=function(_0x5049f3,_0x51f00a,_0x19f587){return db[_0x1df6('0x2e')][_0x1df6('0x4b')]({'where':{'id':_0x5049f3[_0x1df6('0x4a')]['id']}})[_0x1df6('0x25')](handleEntityNotFound(_0x51f00a,null))[_0x1df6('0x25')](function(_0x1059be){if(_0x1059be){return _0x1059be[_0x1df6('0x8a')](_0x5049f3['query'][_0x1df6('0x62')])[_0x1df6('0x25')](function(){if(_[_0x1df6('0x5d')](_0x5049f3[_0x1df6('0x33')][_0x1df6('0x62')])){for(var _0x1f7f85=0x0;_0x1f7f85<_0x5049f3[_0x1df6('0x33')][_0x1df6('0x62')]['length'];_0x1f7f85+=0x1){socket[_0x1df6('0x88')]('userCmList:remove',{'UserId':Number(_0x5049f3['query']['ids'][_0x1f7f85]),'CmListId':Number(_0x5049f3['params']['id'])});}}else{socket[_0x1df6('0x88')](_0x1df6('0x8b'),{'UserId':Number(_0x5049f3[_0x1df6('0x33')][_0x1df6('0x62')]),'CmListId':Number(_0x5049f3['params']['id'])});}});}})[_0x1df6('0x25')](respondWithStatusCode(_0x51f00a,null))[_0x1df6('0x48')](handleError(_0x51f00a,null));};exports[_0x1df6('0x8c')]=function(_0x60fae4,_0x1f87bb,_0x3559d){var _0x45f42f={};var _0x189055={};var _0x54beda;var _0x3eaaf7;return db[_0x1df6('0x2e')][_0x1df6('0x58')]({'where':{'id':_0x60fae4[_0x1df6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f87bb,null))[_0x1df6('0x25')](function(_0x23ce90){if(_0x23ce90){_0x54beda=_0x23ce90;_0x189055[_0x1df6('0x38')]=_[_0x1df6('0x34')](db[_0x1df6('0x8d')][_0x1df6('0x2f')]);_0x189055[_0x1df6('0x33')]=_[_0x1df6('0x34')](_0x60fae4[_0x1df6('0x33')]);_0x189055[_0x1df6('0x35')]=_['intersection'](_0x189055['model'],_0x189055[_0x1df6('0x33')]);_0x45f42f[_0x1df6('0x37')]=_['intersection'](_0x189055[_0x1df6('0x38')],qs[_0x1df6('0x39')](_0x60fae4[_0x1df6('0x33')][_0x1df6('0x39')]));_0x45f42f[_0x1df6('0x37')]=_0x45f42f[_0x1df6('0x37')][_0x1df6('0x3a')]?_0x45f42f[_0x1df6('0x37')]:_0x189055[_0x1df6('0x38')];_0x45f42f[_0x1df6('0x3d')]=qs[_0x1df6('0x3e')](_0x60fae4[_0x1df6('0x33')][_0x1df6('0x3e')]);_0x45f42f[_0x1df6('0x41')]=qs['filters'](_[_0x1df6('0x3f')](_0x60fae4['query'],_0x189055[_0x1df6('0x35')]));if(_0x60fae4['query'][_0x1df6('0x40')]){_0x45f42f[_0x1df6('0x41')]=_[_0x1df6('0x42')](_0x45f42f[_0x1df6('0x41')],{'$or':_['map'](_0x45f42f[_0x1df6('0x37')],function(_0x564411){var _0x11585c={};_0x11585c[_0x564411]={'$like':'%'+_0x60fae4[_0x1df6('0x33')][_0x1df6('0x40')]+'%'};return _0x11585c;})});}_0x45f42f=_['merge']({},_0x45f42f,_0x60fae4[_0x1df6('0x44')]);return _0x54beda['getAgents'](_0x45f42f);}})[_0x1df6('0x25')](function(_0x4e6f5c){if(_0x4e6f5c){_0x3eaaf7=_0x4e6f5c['length'];if(!_0x60fae4[_0x1df6('0x33')][_0x1df6('0x3b')]('nolimit')){_0x45f42f['limit']=qs[_0x1df6('0x1e')](_0x60fae4['query']['limit']);_0x45f42f[_0x1df6('0x1d')]=qs[_0x1df6('0x1d')](_0x60fae4[_0x1df6('0x33')][_0x1df6('0x1d')]);}return _0x54beda['getAgents'](_0x45f42f);}})[_0x1df6('0x25')](function(_0x2de329){if(_0x2de329){return _0x2de329?{'count':_0x3eaaf7,'rows':_0x2de329}:null;}})[_0x1df6('0x25')](respondWithResult(_0x1f87bb,null))[_0x1df6('0x48')](handleError(_0x1f87bb,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 375841a..19a8985 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x2b34bf,_0x19fcda){_0x2b34bf=_0x2b34bf-0x0;var _0x4dcf97=_0x3e74[_0x2b34bf];return _0x4dcf97;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x17a329,_0x5d2f43){var _0x761387=function(_0x2e1ad3){while(--_0x2e1ad3){_0x17a329['push'](_0x17a329['shift']());}};_0x761387(++_0x5d2f43);}(_0x7217,0x19e));var _0x7721=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7217[_0x5b78e8];return _0xf2c321;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9878efa..f816e3e 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 _0xb903=['rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xc3a71f,_0x54fe71){var _0x46a474=function(_0x47e601){while(--_0x47e601){_0xc3a71f['push'](_0xc3a71f['shift']());}};_0x46a474(++_0x54fe71);}(_0xb903,0x185));var _0x3b90=function(_0x8e69a2,_0x16f9c1){_0x8e69a2=_0x8e69a2-0x0;var _0x14f58a=_0xb903[_0x8e69a2];return _0x14f58a;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var logger=require(_0x3b90('0x2'))(_0x3b90('0x3'));var moment=require('moment');var BPromise=require(_0x3b90('0x4'));var rp=require(_0x3b90('0x5'));var fs=require('fs');var path=require(_0x3b90('0x6'));var rimraf=require(_0x3b90('0x7'));var config=require(_0x3b90('0x8'));var attributes=require(_0x3b90('0x9'));module[_0x3b90('0xa')]=function(_0x5acd76,_0x15b68f){return _0x5acd76['define']('CmList',attributes,{'tableName':_0x3b90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7a=['CmList','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1f5548,_0x5db5bb){_0x1f5548=_0x1f5548-0x0;var _0x42861e=_0x6f7a[_0x1f5548];return _0x42861e;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));module[_0xa6f7('0xa')]=function(_0x20cccd,_0x1fdd5f){return _0x20cccd[_0xa6f7('0xb')](_0xa6f7('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 4d6e4e2..81e9463 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 _0x73ed=['./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x3044dc,_0x587523){var _0x182963=function(_0x1a0ba5){while(--_0x1a0ba5){_0x3044dc['push'](_0x3044dc['shift']());}};_0x182963(++_0x587523);}(_0x73ed,0x89));var _0xd73e=function(_0x1ca7af,_0x41fddf){_0x1ca7af=_0x1ca7af-0x0;var _0x4a5c2f=_0x73ed[_0x1ca7af];return _0x4a5c2f;};'use strict';var _=require(_0xd73e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd73e('0x1'));var rs=require(_0xd73e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd73e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd73e('0x4'))(_0xd73e('0x5'));var config=require(_0xd73e('0x6'));var jayson=require(_0xd73e('0x7'));var client=jayson[_0xd73e('0x8')]['http']({'port':0x232a});config['redis']=_[_0xd73e('0x9')](config[_0xd73e('0xa')],{'host':_0xd73e('0xb'),'port':0x18eb});var socket=require(_0xd73e('0xc'))(new Redis(config[_0xd73e('0xa')]));require(_0xd73e('0xd'))[_0xd73e('0xe')](socket);function respondWithRpcPromise(_0x55f8b9,_0x283cd7,_0x6f7cb1){return new BPromise(function(_0x2c4a1f,_0x10706c){return client['request'](_0x55f8b9,_0x6f7cb1)[_0xd73e('0xf')](function(_0x5367c0){logger[_0xd73e('0x10')](_0xd73e('0x11'),_0x283cd7,_0xd73e('0x12'));logger[_0xd73e('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x283cd7,_0xd73e('0x12'),JSON[_0xd73e('0x14')](_0x5367c0));if(_0x5367c0[_0xd73e('0x15')]){if(_0x5367c0[_0xd73e('0x15')]['code']===0x1f4){logger['error'](_0xd73e('0x11'),_0x283cd7,_0x5367c0['error']['message']);return _0x10706c(_0x5367c0[_0xd73e('0x15')][_0xd73e('0x16')]);}logger[_0xd73e('0x15')](_0xd73e('0x11'),_0x283cd7,_0x5367c0['error']['message']);return _0x2c4a1f(_0x5367c0['error'][_0xd73e('0x16')]);}else{logger['info'](_0xd73e('0x11'),_0x283cd7,_0xd73e('0x12'));_0x2c4a1f(_0x5367c0[_0xd73e('0x17')][_0xd73e('0x16')]);}})[_0xd73e('0x18')](function(_0x3f2ec5){logger['error'](_0xd73e('0x11'),_0x283cd7,_0x3f2ec5);_0x10706c(_0x3f2ec5);});});} \ No newline at end of file +var _0x5ddf=['CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','info','request\x20sent'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x5ddf,0x174));var _0xf5dd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5ddf[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf5dd('0x0'));var util=require(_0xf5dd('0x1'));var moment=require(_0xf5dd('0x2'));var BPromise=require(_0xf5dd('0x3'));var rs=require(_0xf5dd('0x4'));var fs=require('fs');var Redis=require(_0xf5dd('0x5'));var db=require(_0xf5dd('0x6'))['db'];var utils=require(_0xf5dd('0x7'));var logger=require('../../config/logger')(_0xf5dd('0x8'));var config=require(_0xf5dd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf5dd('0xa')][_0xf5dd('0xb')]({'port':0x232a});config[_0xf5dd('0xc')]=_[_0xf5dd('0xd')](config[_0xf5dd('0xc')],{'host':_0xf5dd('0xe'),'port':0x18eb});var socket=require(_0xf5dd('0xf'))(new Redis(config['redis']));require('./cmList.socket')[_0xf5dd('0x10')](socket);function respondWithRpcPromise(_0xdeb74a,_0x1c4a95,_0x279d53){return new BPromise(function(_0x2b2b61,_0x1201f7){return client[_0xf5dd('0x11')](_0xdeb74a,_0x279d53)['then'](function(_0x4e8167){logger[_0xf5dd('0x12')]('CmList,\x20%s,\x20%s',_0x1c4a95,_0xf5dd('0x13'));logger['debug'](_0xf5dd('0x14'),_0x1c4a95,'request\x20sent',JSON[_0xf5dd('0x15')](_0x4e8167));if(_0x4e8167[_0xf5dd('0x16')]){if(_0x4e8167[_0xf5dd('0x16')][_0xf5dd('0x17')]===0x1f4){logger[_0xf5dd('0x16')](_0xf5dd('0x18'),_0x1c4a95,_0x4e8167[_0xf5dd('0x16')]['message']);return _0x1201f7(_0x4e8167[_0xf5dd('0x16')][_0xf5dd('0x19')]);}logger['error'](_0xf5dd('0x18'),_0x1c4a95,_0x4e8167[_0xf5dd('0x16')][_0xf5dd('0x19')]);return _0x2b2b61(_0x4e8167[_0xf5dd('0x16')][_0xf5dd('0x19')]);}else{logger[_0xf5dd('0x12')](_0xf5dd('0x18'),_0x1c4a95,_0xf5dd('0x13'));_0x2b2b61(_0x4e8167[_0xf5dd('0x1a')][_0xf5dd('0x19')]);}})[_0xf5dd('0x1b')](function(_0x230a11){logger[_0xf5dd('0x16')]('CmList,\x20%s,\x20%s',_0x1c4a95,_0x230a11);_0x1201f7(_0x230a11);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 2daa43b..5b20561 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 _0x66dd=['length','cmList:','save','remove','update','emit','removeListener'];(function(_0x3e08dc,_0x5bd95e){var _0x4e8bdc=function(_0x52dd13){while(--_0x52dd13){_0x3e08dc['push'](_0x3e08dc['shift']());}};_0x4e8bdc(++_0x5bd95e);}(_0x66dd,0xb8));var _0xd66d=function(_0x24f0a7,_0x4c542c){_0x24f0a7=_0x24f0a7-0x0;var _0x58fbbe=_0x66dd[_0x24f0a7];return _0x58fbbe;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xd66d('0x0'),_0xd66d('0x1'),_0xd66d('0x2')];function createListener(_0x31612e,_0x2f1ab3){return function(_0x20233e){_0x2f1ab3[_0xd66d('0x3')](_0x31612e,_0x20233e);};}function removeListener(_0x4cbc51,_0x2b38f2){return function(){CmListEvents[_0xd66d('0x4')](_0x4cbc51,_0x2b38f2);};}exports['register']=function(_0xb62ff2){for(var _0x4194a8=0x0,_0x40432c=events[_0xd66d('0x5')];_0x4194a8<_0x40432c;_0x4194a8++){var _0x5c631c=events[_0x4194a8];var _0x4d2723=createListener(_0xd66d('0x6')+_0x5c631c,_0xb62ff2);CmListEvents['on'](_0x5c631c,_0x4d2723);}}; \ No newline at end of file +var _0x4965=['./cmList.events','save','remove','update','removeListener','length','cmList:'];(function(_0x5b1c3a,_0x3129eb){var _0x15ca3e=function(_0x1d79e3){while(--_0x1d79e3){_0x5b1c3a['push'](_0x5b1c3a['shift']());}};_0x15ca3e(++_0x3129eb);}(_0x4965,0xd9));var _0x5496=function(_0x58b603,_0x450f6d){_0x58b603=_0x58b603-0x0;var _0xf76126=_0x4965[_0x58b603];return _0xf76126;};'use strict';var CmListEvents=require(_0x5496('0x0'));var events=[_0x5496('0x1'),_0x5496('0x2'),_0x5496('0x3')];function createListener(_0x2e6e1c,_0x16e4b8){return function(_0x1e7ee2){_0x16e4b8['emit'](_0x2e6e1c,_0x1e7ee2);};}function removeListener(_0x148875,_0xf12daa){return function(){CmListEvents[_0x5496('0x4')](_0x148875,_0xf12daa);};}exports['register']=function(_0x31176e){for(var _0x16732b=0x0,_0x229c74=events[_0x5496('0x5')];_0x16732b<_0x229c74;_0x16732b++){var _0x3d11ce=events[_0x16732b];var _0x36376a=createListener(_0x5496('0x6')+_0x3d11ce,_0x31176e);CmListEvents['on'](_0x3d11ce,_0x36376a);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 5434f76..ea1fb7b 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 _0x1f30=['removeAgents','exports','multer','path','express','Router','fs-extra','./cmList.controller','get','index','/describe','isAuthenticated','describe','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','/:id','update','delete','removeDispositions'];(function(_0x2f0193,_0x4ae552){var _0x32f083=function(_0x2f994b){while(--_0x2f994b){_0x2f0193['push'](_0x2f0193['shift']());}};_0x32f083(++_0x4ae552);}(_0x1f30,0x134));var _0x01f3=function(_0x5b912f,_0x351164){_0x5b912f=_0x5b912f-0x0;var _0x344ee5=_0x1f30[_0x5b912f];return _0x344ee5;};'use strict';var multer=require(_0x01f3('0x0'));var util=require('util');var path=require(_0x01f3('0x1'));var timeout=require('connect-timeout');var express=require(_0x01f3('0x2'));var router=express[_0x01f3('0x3')]();var fs_extra=require(_0x01f3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x01f3('0x5'));router[_0x01f3('0x6')]('/',auth['isAuthenticated'](),controller[_0x01f3('0x7')]);router['get'](_0x01f3('0x8'),auth[_0x01f3('0x9')](),controller[_0x01f3('0xa')]);router[_0x01f3('0x6')]('/:id',auth[_0x01f3('0x9')](),controller[_0x01f3('0xb')]);router[_0x01f3('0x6')]('/:id/dispositions',auth[_0x01f3('0x9')](),controller['getDispositions']);router[_0x01f3('0x6')](_0x01f3('0xc'),auth[_0x01f3('0x9')](),controller[_0x01f3('0xd')]);router[_0x01f3('0x6')](_0x01f3('0xe'),auth['isAuthenticated'](),controller[_0x01f3('0xf')]);router['get'](_0x01f3('0x10'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x11')]);router[_0x01f3('0x6')](_0x01f3('0x12'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x13')]);router[_0x01f3('0x14')]('/',auth[_0x01f3('0x9')](),controller[_0x01f3('0x15')]);router[_0x01f3('0x14')](_0x01f3('0x16'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x17')]);router[_0x01f3('0x14')]('/:id/contacts',auth[_0x01f3('0x9')](),controller[_0x01f3('0x18')]);router[_0x01f3('0x14')](_0x01f3('0x10'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x19')]);router[_0x01f3('0x14')](_0x01f3('0x12'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x1a')]);router[_0x01f3('0x1b')](_0x01f3('0x1c'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x1d')]);router[_0x01f3('0x1e')](_0x01f3('0x1c'),auth[_0x01f3('0x9')](),controller['destroy']);router[_0x01f3('0x1e')](_0x01f3('0x16'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x1f')]);router[_0x01f3('0x1e')](_0x01f3('0x12'),auth[_0x01f3('0x9')](),controller[_0x01f3('0x20')]);module[_0x01f3('0x21')]=router; \ No newline at end of file +var _0xb001=['connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','create','/:id/contacts','addContacts','/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','path'];(function(_0x341e8c,_0x22925f){var _0x260a94=function(_0x5c379f){while(--_0x5c379f){_0x341e8c['push'](_0x341e8c['shift']());}};_0x260a94(++_0x22925f);}(_0xb001,0x7a));var _0x1b00=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb001[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x1b00('0x0'));var util=require('util');var path=require(_0x1b00('0x1'));var timeout=require(_0x1b00('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1b00('0x3'));var auth=require(_0x1b00('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1b00('0x5'));var controller=require(_0x1b00('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1b00('0x7')](_0x1b00('0x8'),auth[_0x1b00('0x9')](),controller[_0x1b00('0xa')]);router[_0x1b00('0x7')](_0x1b00('0xb'),auth[_0x1b00('0x9')](),controller['show']);router['get'](_0x1b00('0xc'),auth['isAuthenticated'](),controller[_0x1b00('0xd')]);router[_0x1b00('0x7')]('/:id/contacts',auth[_0x1b00('0x9')](),controller[_0x1b00('0xe')]);router[_0x1b00('0x7')](_0x1b00('0xf'),auth[_0x1b00('0x9')](),controller[_0x1b00('0x10')]);router[_0x1b00('0x7')](_0x1b00('0x11'),auth['isAuthenticated'](),controller[_0x1b00('0x12')]);router['get']('/:id/users',auth[_0x1b00('0x9')](),controller['getAgents']);router[_0x1b00('0x13')]('/',auth[_0x1b00('0x9')](),controller[_0x1b00('0x14')]);router[_0x1b00('0x13')](_0x1b00('0xc'),auth[_0x1b00('0x9')](),controller['addDisposition']);router[_0x1b00('0x13')](_0x1b00('0x15'),auth[_0x1b00('0x9')](),controller[_0x1b00('0x16')]);router[_0x1b00('0x13')](_0x1b00('0x11'),auth['isAuthenticated'](),controller['addCustomField']);router['post'](_0x1b00('0x17'),auth[_0x1b00('0x9')](),controller[_0x1b00('0x18')]);router[_0x1b00('0x19')](_0x1b00('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1b00('0x1a')](_0x1b00('0xb'),auth['isAuthenticated'](),controller[_0x1b00('0x1b')]);router[_0x1b00('0x1a')](_0x1b00('0xc'),auth[_0x1b00('0x9')](),controller[_0x1b00('0x1c')]);router['delete'](_0x1b00('0x17'),auth[_0x1b00('0x9')](),controller[_0x1b00('0x1d')]);module[_0x1b00('0x1e')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 832f28a..e90e248 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 _0x02cf=['sequelize','exports','getDataValue','field','STRING'];(function(_0x767f6f,_0x19ac96){var _0x1427a0=function(_0x169b34){while(--_0x169b34){_0x767f6f['push'](_0x767f6f['shift']());}};_0x1427a0(++_0x19ac96);}(_0x02cf,0xc8));var _0xf02c=function(_0x3c3092,_0x2c6651){_0x3c3092=_0x3c3092-0x0;var _0x3727fe=_0x02cf[_0x3c3092];return _0x3727fe;};'use strict';var Sequelize=require(_0xf02c('0x0'));module[_0xf02c('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1aae1f){return this[_0xf02c('0x2')](_0xf02c('0x3'));}},'field':{'type':Sequelize[_0xf02c('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf02c('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x8fc7=['field','exports','VIRTUAL','getDataValue'];(function(_0x482c95,_0x504190){var _0x38c2e8=function(_0x5685df){while(--_0x5685df){_0x482c95['push'](_0x482c95['shift']());}};_0x38c2e8(++_0x504190);}(_0x8fc7,0xb5));var _0x78fc=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x8fc7[_0x4e7d25];return _0x526fe6;};'use strict';var Sequelize=require('sequelize');module[_0x78fc('0x0')]={'name':{'type':Sequelize[_0x78fc('0x1')],'get':function(_0x40e75d){return this[_0x78fc('0x2')](_0x78fc('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 010f58b..bed9302 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(_0x161c8,_0x3ab039){var _0x10b363=function(_0x4b14ff){while(--_0x4b14ff){_0x161c8['push'](_0x161c8['shift']());}};_0x10b363(++_0x3ab039);}(_0x7a54,0x106));var _0x47a5=function(_0x489a1a,_0x35188e){_0x489a1a=_0x489a1a-0x0;var _0x142804=_0x7a54[_0x489a1a];return _0x142804;};'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(_0x4847f4,_0x406baa){var _0x537d1f=function(_0x347735){while(--_0x347735){_0x4847f4['push'](_0x4847f4['shift']());}};_0x537d1f(++_0x406baa);}(_0x7a54,0x106));var _0x47a5=function(_0x5f3fb2,_0x5f2318){_0x5f3fb2=_0x5f3fb2-0x0;var _0x7699=_0x7a54[_0x5f3fb2];return _0x7699;};'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 b1aa023..ab8bdd4 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 _0x90f2=['bluebird','request-promise','path','rimraf','exports','Condition','lodash','util','../../config/logger','api','moment'];(function(_0x8a688e,_0x1b8717){var _0x3f07ef=function(_0x4d64b6){while(--_0x4d64b6){_0x8a688e['push'](_0x8a688e['shift']());}};_0x3f07ef(++_0x1b8717);}(_0x90f2,0x69));var _0x290f=function(_0x3e323f,_0x4da954){_0x3e323f=_0x3e323f-0x0;var _0x48056b=_0x90f2[_0x3e323f];return _0x48056b;};'use strict';var _=require(_0x290f('0x0'));var util=require(_0x290f('0x1'));var logger=require(_0x290f('0x2'))(_0x290f('0x3'));var moment=require(_0x290f('0x4'));var BPromise=require(_0x290f('0x5'));var rp=require(_0x290f('0x6'));var fs=require('fs');var path=require(_0x290f('0x7'));var rimraf=require(_0x290f('0x8'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0x290f('0x9')]=function(_0x22a509,_0xd2ea9e){return _0x22a509['define'](_0x290f('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fb5=['rimraf','../../config/environment','exports','tools_conditions','lodash','../../config/logger','api','bluebird','path'];(function(_0x324c23,_0x1e84ce){var _0x34600b=function(_0x122a58){while(--_0x122a58){_0x324c23['push'](_0x324c23['shift']());}};_0x34600b(++_0x1e84ce);}(_0x8fb5,0xd3));var _0x58fb=function(_0x2932fe,_0x12087d){_0x2932fe=_0x2932fe-0x0;var _0xec1fd4=_0x8fb5[_0x2932fe];return _0xec1fd4;};'use strict';var _=require(_0x58fb('0x0'));var util=require('util');var logger=require(_0x58fb('0x1'))(_0x58fb('0x2'));var moment=require('moment');var BPromise=require(_0x58fb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58fb('0x4'));var rimraf=require(_0x58fb('0x5'));var config=require(_0x58fb('0x6'));var attributes=require('./condition.attributes');module[_0x58fb('0x7')]=function(_0xa91c03,_0x127c66){return _0xa91c03['define']('Condition',attributes,{'tableName':_0x58fb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 15a91b4..afc37fe 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 _0x630d=['http','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x630d,0x71));var _0xd630=function(_0x2ea84f,_0x6cf47d){_0x2ea84f=_0x2ea84f-0x0;var _0x4ff996=_0x630d[_0x2ea84f];return _0x4ff996;};'use strict';var _=require(_0xd630('0x0'));var util=require('util');var moment=require(_0xd630('0x1'));var BPromise=require(_0xd630('0x2'));var rs=require(_0xd630('0x3'));var fs=require('fs');var Redis=require(_0xd630('0x4'));var db=require(_0xd630('0x5'))['db'];var utils=require(_0xd630('0x6'));var logger=require(_0xd630('0x7'))(_0xd630('0x8'));var config=require(_0xd630('0x9'));var jayson=require(_0xd630('0xa'));var client=jayson[_0xd630('0xb')][_0xd630('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb06ae2,_0x42207c,_0x5be532){return new BPromise(function(_0xc6bab1,_0x12fd53){return client[_0xd630('0xd')](_0xb06ae2,_0x5be532)[_0xd630('0xe')](function(_0x1559c5){logger[_0xd630('0xf')]('Condition,\x20%s,\x20%s',_0x42207c,_0xd630('0x10'));logger[_0xd630('0x11')](_0xd630('0x12'),_0x42207c,_0xd630('0x10'),JSON['stringify'](_0x1559c5));if(_0x1559c5[_0xd630('0x13')]){if(_0x1559c5[_0xd630('0x13')][_0xd630('0x14')]===0x1f4){logger[_0xd630('0x13')](_0xd630('0x15'),_0x42207c,_0x1559c5[_0xd630('0x13')]['message']);return _0x12fd53(_0x1559c5['error'][_0xd630('0x16')]);}logger[_0xd630('0x13')](_0xd630('0x15'),_0x42207c,_0x1559c5[_0xd630('0x13')][_0xd630('0x16')]);return _0xc6bab1(_0x1559c5[_0xd630('0x13')][_0xd630('0x16')]);}else{logger[_0xd630('0xf')](_0xd630('0x15'),_0x42207c,'request\x20sent');_0xc6bab1(_0x1559c5[_0xd630('0x17')][_0xd630('0x16')]);}})[_0xd630('0x18')](function(_0x44dcff){logger[_0xd630('0x13')](_0xd630('0x15'),_0x42207c,_0x44dcff);_0x12fd53(_0x44dcff);});});} \ No newline at end of file +var _0x8bdf=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3164f3,_0x35eb5e){var _0x577a5d=function(_0x778dc0){while(--_0x778dc0){_0x3164f3['push'](_0x3164f3['shift']());}};_0x577a5d(++_0x35eb5e);}(_0x8bdf,0x1cd));var _0xf8bd=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8bdf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf8bd('0x0'));var util=require(_0xf8bd('0x1'));var moment=require(_0xf8bd('0x2'));var BPromise=require(_0xf8bd('0x3'));var rs=require(_0xf8bd('0x4'));var fs=require('fs');var Redis=require(_0xf8bd('0x5'));var db=require(_0xf8bd('0x6'))['db'];var utils=require(_0xf8bd('0x7'));var logger=require(_0xf8bd('0x8'))(_0xf8bd('0x9'));var config=require(_0xf8bd('0xa'));var jayson=require(_0xf8bd('0xb'));var client=jayson[_0xf8bd('0xc')][_0xf8bd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4bb4c4,_0x14b0bc,_0x30b0b1){return new BPromise(function(_0x27ce30,_0x25927c){return client[_0xf8bd('0xe')](_0x4bb4c4,_0x30b0b1)[_0xf8bd('0xf')](function(_0x205d0d){logger[_0xf8bd('0x10')](_0xf8bd('0x11'),_0x14b0bc,_0xf8bd('0x12'));logger[_0xf8bd('0x13')](_0xf8bd('0x14'),_0x14b0bc,_0xf8bd('0x12'),JSON[_0xf8bd('0x15')](_0x205d0d));if(_0x205d0d['error']){if(_0x205d0d[_0xf8bd('0x16')][_0xf8bd('0x17')]===0x1f4){logger[_0xf8bd('0x16')](_0xf8bd('0x11'),_0x14b0bc,_0x205d0d[_0xf8bd('0x16')][_0xf8bd('0x18')]);return _0x25927c(_0x205d0d[_0xf8bd('0x16')]['message']);}logger[_0xf8bd('0x16')](_0xf8bd('0x11'),_0x14b0bc,_0x205d0d[_0xf8bd('0x16')]['message']);return _0x27ce30(_0x205d0d[_0xf8bd('0x16')]['message']);}else{logger[_0xf8bd('0x10')](_0xf8bd('0x11'),_0x14b0bc,_0xf8bd('0x12'));_0x27ce30(_0x205d0d[_0xf8bd('0x19')][_0xf8bd('0x18')]);}})['catch'](function(_0x30bafb){logger[_0xf8bd('0x16')](_0xf8bd('0x11'),_0x14b0bc,_0x30bafb);_0x25927c(_0x30bafb);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d38e217..9276008 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 _0x6c2f=['./condition.controller','put','/:id','isAuthenticated','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x20d0dc,_0x57635c){var _0x208280=function(_0x416ae4){while(--_0x416ae4){_0x20d0dc['push'](_0x20d0dc['shift']());}};_0x208280(++_0x57635c);}(_0x6c2f,0xf5));var _0xf6c2=function(_0x3dcc54,_0x12ba34){_0x3dcc54=_0x3dcc54-0x0;var _0x1f2de7=_0x6c2f[_0x3dcc54];return _0x1f2de7;};'use strict';var multer=require(_0xf6c2('0x0'));var util=require(_0xf6c2('0x1'));var path=require(_0xf6c2('0x2'));var timeout=require(_0xf6c2('0x3'));var express=require(_0xf6c2('0x4'));var router=express[_0xf6c2('0x5')]();var fs_extra=require(_0xf6c2('0x6'));var auth=require(_0xf6c2('0x7'));var interaction=require(_0xf6c2('0x8'));var config=require(_0xf6c2('0x9'));var controller=require(_0xf6c2('0xa'));router[_0xf6c2('0xb')](_0xf6c2('0xc'),auth[_0xf6c2('0xd')](),controller['update']);router[_0xf6c2('0xe')]('/:id',auth[_0xf6c2('0xd')](),controller[_0xf6c2('0xf')]);module[_0xf6c2('0x10')]=router; \ No newline at end of file +var _0xca72=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','update','delete','isAuthenticated','destroy','exports','util'];(function(_0x2beae6,_0x1f6c64){var _0x58489d=function(_0x34c8f1){while(--_0x34c8f1){_0x2beae6['push'](_0x2beae6['shift']());}};_0x58489d(++_0x1f6c64);}(_0xca72,0x1bf));var _0x2ca7=function(_0x57645b,_0x25f73a){_0x57645b=_0x57645b-0x0;var _0xe82f00=_0xca72[_0x57645b];return _0xe82f00;};'use strict';var multer=require('multer');var util=require(_0x2ca7('0x0'));var path=require(_0x2ca7('0x1'));var timeout=require('connect-timeout');var express=require(_0x2ca7('0x2'));var router=express['Router']();var fs_extra=require(_0x2ca7('0x3'));var auth=require(_0x2ca7('0x4'));var interaction=require(_0x2ca7('0x5'));var config=require(_0x2ca7('0x6'));var controller=require('./condition.controller');router[_0x2ca7('0x7')](_0x2ca7('0x8'),auth['isAuthenticated'](),controller[_0x2ca7('0x9')]);router[_0x2ca7('0xa')]('/:id',auth[_0x2ca7('0xb')](),controller[_0x2ca7('0xc')]);module[_0x2ca7('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index a8608d0..c2029e1 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 _0xd8b0=['exports','sequelize'];(function(_0x3cf53c,_0x397674){var _0x25ec15=function(_0x382348){while(--_0x382348){_0x3cf53c['push'](_0x3cf53c['shift']());}};_0x25ec15(++_0x397674);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 +var _0xd8b0=['exports','sequelize'];(function(_0x301e34,_0x30f80e){var _0x2e49e5=function(_0xfbe1eb){while(--_0xfbe1eb){_0x301e34['push'](_0x301e34['shift']());}};_0x2e49e5(++_0x30f80e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 51ccdf3..c21e772 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 _0x3507=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','type','VIRTUAL','count','includeAll','include','findAll','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','createdAt','updatedAt','omit','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','getItems','sort','filter','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x22ee3,_0x16e140){var _0x41a410=function(_0x412014){while(--_0x412014){_0x22ee3['push'](_0x22ee3['shift']());}};_0x41a410(++_0x16e140);}(_0x3507,0x78));var _0x7350=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x3507[_0x47b58b];return _0x46bebe;};'use strict';var emlformat=require(_0x7350('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7350('0x1'));var jsonpatch=require(_0x7350('0x2'));var rp=require(_0x7350('0x3'));var moment=require(_0x7350('0x4'));var BPromise=require(_0x7350('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7350('0x6'));var sox=require('sox');var csv=require(_0x7350('0x7'));var ejs=require(_0x7350('0x8'));var fs=require('fs');var fs_extra=require(_0x7350('0x9'));var _=require(_0x7350('0xa'));var squel=require(_0x7350('0xb'));var crypto=require(_0x7350('0xc'));var jsforce=require(_0x7350('0xd'));var deskjs=require(_0x7350('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7350('0xf'));var Papa=require(_0x7350('0x10'));var Redis=require(_0x7350('0x11'));var authService=require(_0x7350('0x12'));var qs=require(_0x7350('0x13'));var as=require(_0x7350('0x14'));var hardwareService=require(_0x7350('0x15'));var logger=require('../../config/logger')(_0x7350('0x16'));var utils=require(_0x7350('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7350('0x18'))['db'];config['redis']=_[_0x7350('0x19')](config[_0x7350('0x1a')],{'host':_0x7350('0x1b'),'port':0x18eb});var socket=require(_0x7350('0x1c'))(new Redis(config['redis']));require(_0x7350('0x1d'))[_0x7350('0x1e')](socket);function respondWithStatusCode(_0x22d039,_0x3d3c33){_0x3d3c33=_0x3d3c33||0xcc;return function(_0x32b909){if(_0x32b909){return _0x22d039[_0x7350('0x1f')](_0x3d3c33);}return _0x22d039[_0x7350('0x20')](_0x3d3c33)[_0x7350('0x21')]();};}function respondWithResult(_0x2b696c,_0x3985ad){_0x3985ad=_0x3985ad||0xc8;return function(_0x363b54){if(_0x363b54){return _0x2b696c[_0x7350('0x20')](_0x3985ad)[_0x7350('0x22')](_0x363b54);}};}function respondWithFilteredResult(_0x413542,_0x5ba8e3){return function(_0x18286a){if(_0x18286a){var _0x73e35d=typeof _0x5ba8e3['offset']===_0x7350('0x23')&&typeof _0x5ba8e3[_0x7350('0x24')]===_0x7350('0x23');var _0x2abc03=_0x18286a['count'];var _0x18fdda=_0x73e35d?0x0:_0x5ba8e3[_0x7350('0x25')];var _0x412a34=_0x73e35d?_0x18286a['count']:_0x5ba8e3['offset']+_0x5ba8e3[_0x7350('0x24')];var _0x29978c;if(_0x412a34>=_0x2abc03){_0x412a34=_0x2abc03;_0x29978c=0xc8;}else{_0x29978c=0xce;}_0x413542['status'](_0x29978c);return _0x413542[_0x7350('0x26')](_0x7350('0x27'),_0x18fdda+'-'+_0x412a34+'/'+_0x2abc03)[_0x7350('0x22')](_0x18286a);}return null;};}function patchUpdates(_0x3baec0){return function(_0x3428b2){try{jsonpatch[_0x7350('0x28')](_0x3428b2,_0x3baec0,!![]);}catch(_0x374a1d){return BPromise[_0x7350('0x29')](_0x374a1d);}return _0x3428b2[_0x7350('0x2a')]();};}function saveUpdates(_0x118f33,_0x4d2f7c){return function(_0xbc64d0){if(_0xbc64d0){return _0xbc64d0[_0x7350('0x2b')](_0x118f33)[_0x7350('0x2c')](function(_0x222af9){return _0x222af9;});}return null;};}function removeEntity(_0x3d9e4d,_0xefc8db){return function(_0x10a511){if(_0x10a511){return _0x10a511[_0x7350('0x2d')]()[_0x7350('0x2c')](function(){var _0x43cb9e=_0x10a511[_0x7350('0x2e')]({'plain':!![]});var _0x139098='CustomDashboards';return db['UserProfileResource'][_0x7350('0x2d')]({'where':{'type':_0x139098,'resourceId':_0x43cb9e['id']}})[_0x7350('0x2c')](function(){return _0x10a511;});})[_0x7350('0x2c')](function(){_0x3d9e4d[_0x7350('0x20')](0xcc)[_0x7350('0x21')]();});}};}function handleEntityNotFound(_0x39fbc3,_0x97a424){return function(_0x1f3620){if(!_0x1f3620){_0x39fbc3[_0x7350('0x1f')](0x194);}return _0x1f3620;};}function handleError(_0x3cad7b,_0x4352cc){_0x4352cc=_0x4352cc||0x1f4;return function(_0x487b3c){logger[_0x7350('0x2f')](_0x487b3c[_0x7350('0x30')]);if(_0x487b3c[_0x7350('0x31')]){delete _0x487b3c['name'];}_0x3cad7b[_0x7350('0x20')](_0x4352cc)[_0x7350('0x32')](_0x487b3c);};}exports[_0x7350('0x33')]=function(_0x338add,_0x4110dd){var _0x13ba3e={},_0xdeffe7={},_0x1ddc5a={'count':0x0,'rows':[]};var _0x11e209=_[_0x7350('0x34')](db[_0x7350('0x35')][_0x7350('0x36')],function(_0x1a371b){return{'name':_0x1a371b[_0x7350('0x37')],'type':_0x1a371b['type'][_0x7350('0x38')]};});_0xdeffe7[_0x7350('0x39')]=_[_0x7350('0x34')](_0x11e209,'name');_0xdeffe7['query']=_['keys'](_0x338add[_0x7350('0x3a')]);_0xdeffe7[_0x7350('0x3b')]=_[_0x7350('0x3c')](_0xdeffe7[_0x7350('0x39')],_0xdeffe7[_0x7350('0x3a')]);_0x13ba3e['attributes']=_[_0x7350('0x3c')](_0xdeffe7[_0x7350('0x39')],qs[_0x7350('0x3d')](_0x338add['query']['fields']));_0x13ba3e[_0x7350('0x3e')]=_0x13ba3e[_0x7350('0x3e')][_0x7350('0x3f')]?_0x13ba3e[_0x7350('0x3e')]:_0xdeffe7['model'];if(!_0x338add[_0x7350('0x3a')][_0x7350('0x40')](_0x7350('0x41'))){_0x13ba3e[_0x7350('0x24')]=qs[_0x7350('0x24')](_0x338add[_0x7350('0x3a')][_0x7350('0x24')]);_0x13ba3e['offset']=qs[_0x7350('0x25')](_0x338add['query'][_0x7350('0x25')]);}_0x13ba3e[_0x7350('0x42')]=qs['sort'](_0x338add['query']['sort']);_0x13ba3e[_0x7350('0x43')]=qs[_0x7350('0x3b')](_[_0x7350('0x44')](_0x338add[_0x7350('0x3a')],_0xdeffe7[_0x7350('0x3b')]),_0x11e209);if(_0x338add[_0x7350('0x3a')]['filter']){_0x13ba3e['where']=_[_0x7350('0x45')](_0x13ba3e['where'],{'$or':_[_0x7350('0x34')](_0x11e209,function(_0x120e08){if(_0x120e08[_0x7350('0x46')]!==_0x7350('0x47')){var _0x2ef04e={};_0x2ef04e[_0x120e08[_0x7350('0x31')]]={'$like':'%'+_0x338add[_0x7350('0x3a')]['filter']+'%'};return _0x2ef04e;}})});}_0x13ba3e=_['merge']({},_0x13ba3e,_0x338add['options']);var _0x2d12ba={'where':_0x13ba3e[_0x7350('0x43')]};return db[_0x7350('0x35')]['count'](_0x2d12ba)['then'](function(_0x23aaac){_0x1ddc5a[_0x7350('0x48')]=_0x23aaac;if(_0x338add[_0x7350('0x3a')][_0x7350('0x49')]){_0x13ba3e[_0x7350('0x4a')]=[{'all':!![]}];}return db[_0x7350('0x35')][_0x7350('0x4b')](_0x13ba3e);})['then'](function(_0x15db9c){_0x1ddc5a['rows']=_0x15db9c;return _0x1ddc5a;})[_0x7350('0x2c')](respondWithFilteredResult(_0x4110dd,_0x13ba3e))[_0x7350('0x4c')](handleError(_0x4110dd,null));};exports[_0x7350('0x4d')]=function(_0x573458,_0x2466c3){var _0x4b9db7={'raw':![],'where':{'id':_0x573458[_0x7350('0x4e')]['id']}},_0x131807={};_0x131807[_0x7350('0x39')]=_[_0x7350('0x4f')](db[_0x7350('0x35')][_0x7350('0x36')]);_0x131807[_0x7350('0x3a')]=_[_0x7350('0x4f')](_0x573458[_0x7350('0x3a')]);_0x131807[_0x7350('0x3b')]=_[_0x7350('0x3c')](_0x131807[_0x7350('0x39')],_0x131807[_0x7350('0x3a')]);_0x4b9db7['attributes']=_[_0x7350('0x3c')](_0x131807[_0x7350('0x39')],qs[_0x7350('0x3d')](_0x573458[_0x7350('0x3a')][_0x7350('0x3d')]));_0x4b9db7['attributes']=_0x4b9db7['attributes'][_0x7350('0x3f')]?_0x4b9db7[_0x7350('0x3e')]:_0x131807[_0x7350('0x39')];if(_0x573458['query'][_0x7350('0x49')]){_0x4b9db7[_0x7350('0x4a')]=[{'all':!![]}];}_0x4b9db7=_['merge']({},_0x4b9db7,_0x573458[_0x7350('0x50')]);return db[_0x7350('0x35')][_0x7350('0x51')](_0x4b9db7)[_0x7350('0x2c')](handleEntityNotFound(_0x2466c3,null))[_0x7350('0x2c')](respondWithResult(_0x2466c3,null))['catch'](handleError(_0x2466c3,null));};exports['create']=function(_0x38c9f7,_0x145354){return db[_0x7350('0x35')][_0x7350('0x52')](_0x38c9f7[_0x7350('0x53')],{})[_0x7350('0x2c')](function(_0x502cf6){var _0x367d93=_0x38c9f7[_0x7350('0x54')]['get']({'plain':!![]});if(!_0x367d93)throw new Error(_0x7350('0x55'));if(_0x367d93[_0x7350('0x56')]==='user'){var _0x1edb76=_0x502cf6['get']({'plain':!![]});var _0x2fa2c9=_0x7350('0x57');return db[_0x7350('0x58')]['find']({'where':{'name':_0x2fa2c9,'userProfileId':_0x367d93[_0x7350('0x59')]},'raw':!![]})[_0x7350('0x2c')](function(_0x356b1a){if(_0x356b1a&&_0x356b1a[_0x7350('0x5a')]===0x0){return db[_0x7350('0x5b')][_0x7350('0x52')]({'name':_0x1edb76[_0x7350('0x31')],'resourceId':_0x1edb76['id'],'type':_0x356b1a[_0x7350('0x31')],'sectionId':_0x356b1a['id']},{})[_0x7350('0x2c')](function(){return _0x502cf6;});}else{return _0x502cf6;}})[_0x7350('0x4c')](function(_0xbfaaa7){logger[_0x7350('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbfaaa7);throw _0xbfaaa7;});}return _0x502cf6;})[_0x7350('0x2c')](respondWithResult(_0x145354,0xc9))[_0x7350('0x4c')](handleError(_0x145354,null));};exports[_0x7350('0x5c')]=function(_0x450ab9,_0x4606bd){var _0xc75176={'where':{'id':_0x450ab9[_0x7350('0x4e')]['id']}},_0x2e9b18={};_0x2e9b18[_0x7350('0x39')]=_[_0x7350('0x4f')](db[_0x7350('0x35')][_0x7350('0x36')]);_0xc75176['attributes']=_[_0x7350('0x3c')](_0x2e9b18[_0x7350('0x39')],qs[_0x7350('0x3d')](_0x450ab9['query'][_0x7350('0x3d')]));_0xc75176['attributes']=_0xc75176[_0x7350('0x3e')]['length']?_0xc75176['attributes']:_0x2e9b18[_0x7350('0x39')];if(_0x450ab9['query'][_0x7350('0x49')]){_0xc75176[_0x7350('0x4a')]=[{'all':!![]}];}_0xc75176=_[_0x7350('0x45')]({},_0xc75176,_0x450ab9['options']);return db[_0x7350('0x35')][_0x7350('0x51')](_0xc75176)[_0x7350('0x2c')](handleEntityNotFound(_0x4606bd,null))['then'](function(_0x5dc8d5){if(_0x5dc8d5){var _0x8f8a8c=_0x5dc8d5[_0x7350('0x2e')]({'plain':!![]});_0x8f8a8c=qs['omit'](_0x8f8a8c,['id',_0x7350('0x5d'),_0x7350('0x5e')]);_0x450ab9[_0x7350('0x53')]=_[_0x7350('0x5f')](_0x450ab9[_0x7350('0x53')],['id',_0x7350('0x5d'),'updatedAt']);return db[_0x7350('0x35')][_0x7350('0x52')](_[_0x7350('0x45')](_0x8f8a8c,_0x450ab9[_0x7350('0x53')]),{'include':_0x450ab9[_0x7350('0x3a')][_0x7350('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x27603a){var _0x54ffe0=_0x450ab9[_0x7350('0x54')][_0x7350('0x2e')]({'plain':!![]});if(!_0x54ffe0)throw new Error(_0x7350('0x55'));if(_0x54ffe0['role']===_0x7350('0x54')){var _0x1b41b0=_0x27603a['get']({'plain':!![]});var _0x4e4734=_0x7350('0x57');return db[_0x7350('0x58')]['find']({'where':{'name':_0x4e4734,'userProfileId':_0x54ffe0[_0x7350('0x59')]},'raw':!![]})[_0x7350('0x2c')](function(_0x24e711){if(_0x24e711&&_0x24e711['autoAssociation']===0x0){return db[_0x7350('0x5b')][_0x7350('0x52')]({'name':_0x1b41b0['name'],'resourceId':_0x1b41b0['id'],'type':_0x24e711[_0x7350('0x31')],'sectionId':_0x24e711['id']},{})[_0x7350('0x2c')](function(){return _0x27603a;});}else{return _0x27603a;}})[_0x7350('0x4c')](function(_0x4d7ec1){logger['error'](_0x7350('0x60'),_0x4d7ec1);throw _0x4d7ec1;});}return _0x27603a;});}})['then'](respondWithResult(_0x4606bd,0xc9))[_0x7350('0x4c')](handleError(_0x4606bd,null));};exports['update']=function(_0x1f08ed,_0x12b713){if(_0x1f08ed[_0x7350('0x53')]['id']){delete _0x1f08ed['body']['id'];}return db[_0x7350('0x35')][_0x7350('0x51')]({'where':{'id':_0x1f08ed['params']['id']}})[_0x7350('0x2c')](handleEntityNotFound(_0x12b713,null))[_0x7350('0x2c')](saveUpdates(_0x1f08ed[_0x7350('0x53')],null))[_0x7350('0x2c')](respondWithResult(_0x12b713,null))['catch'](handleError(_0x12b713,null));};exports[_0x7350('0x2d')]=function(_0x3d1c5e,_0x18208f){return db[_0x7350('0x35')][_0x7350('0x51')]({'where':{'id':_0x3d1c5e[_0x7350('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18208f,null))[_0x7350('0x2c')](removeEntity(_0x18208f,null))['catch'](handleError(_0x18208f,null));};function widgetAttributes(_0x259f94){try{switch(_0x259f94[_0x7350('0x46')]){case _0x7350('0x61'):return[{'name':_0x7350('0x62'),'value':_0x259f94[_0x7350('0x62')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x0]?_0x259f94[_0x7350('0x63')][0x0][_0x7350('0x64')]:undefined)||'https://'}];case _0x7350('0x65'):return[{'name':_0x7350('0x66'),'value':_0x259f94[_0x7350('0x66')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x0]?_0x259f94[_0x7350('0x63')][0x0][_0x7350('0x64')]:undefined)||''}];case _0x7350('0x67'):return[{'name':'attrHourFormat','value':_0x259f94[_0x7350('0x68')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x0]?_0x259f94['attrs'][0x0][_0x7350('0x64')]:undefined)||_0x7350('0x69')},{'name':'attrTimezone','value':_0x259f94[_0x7350('0x6a')]||(_0x259f94['attrs']&&_0x259f94[_0x7350('0x63')][0x1]?_0x259f94['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0x7350('0x6b'),'value':_0x259f94['attrFontSize']||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x2]?_0x259f94[_0x7350('0x63')][0x2][_0x7350('0x64')]:undefined)||0xc}];case'counter':return[{'name':_0x7350('0x6c'),'value':_0x259f94['attrMetric']||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x0]?_0x259f94['attrs'][0x0]['value']:undefined)||_0x7350('0x6d')},{'name':_0x7350('0x6e'),'value':_0x259f94[_0x7350('0x6e')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x1]?_0x259f94[_0x7350('0x63')][0x1][_0x7350('0x64')]:undefined)||[]},{'name':'attrFontSize','value':_0x259f94['attrFontSize']||(_0x259f94['attrs']&&_0x259f94[_0x7350('0x63')][0x2]?_0x259f94['attrs'][0x2][_0x7350('0x64')]:undefined)||0x14},{'name':_0x7350('0x6f'),'value':_0x259f94[_0x7350('0x6f')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x3]?_0x259f94[_0x7350('0x63')][0x3][_0x7350('0x64')]:undefined)||_0x7350('0x70')},{'name':_0x7350('0x71'),'value':_0x259f94[_0x7350('0x71')]||(_0x259f94['attrs']&&_0x259f94['attrs'][0x4]?_0x259f94['attrs'][0x4][_0x7350('0x64')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x259f94[_0x7350('0x72')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x5]?_0x259f94['attrs'][0x5][_0x7350('0x64')]:undefined)||''},{'name':_0x7350('0x73'),'value':_0x259f94['attrSmsAccounts']||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x6]?_0x259f94['attrs'][0x6][_0x7350('0x64')]:undefined)||''},{'name':_0x7350('0x74'),'value':_0x259f94[_0x7350('0x74')]||(_0x259f94['attrs']&&_0x259f94[_0x7350('0x63')][0x7]?_0x259f94[_0x7350('0x63')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x259f94[_0x7350('0x75')]||(_0x259f94['attrs']&&_0x259f94[_0x7350('0x63')][0x8]?_0x259f94[_0x7350('0x63')][0x8][_0x7350('0x64')]:undefined)||''},{'name':_0x7350('0x76'),'value':_0x259f94[_0x7350('0x76')]||(_0x259f94['attrs']&&_0x259f94[_0x7350('0x63')][0x9]?_0x259f94[_0x7350('0x63')][0x9][_0x7350('0x64')]:undefined)||''}];case _0x7350('0x77'):case _0x7350('0x78'):return[{'name':_0x7350('0x79'),'value':_0x259f94[_0x7350('0x79')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x0]?_0x259f94[_0x7350('0x63')][0x0][_0x7350('0x64')]:undefined)||_0x7350('0x6d')},{'name':_0x7350('0x7a'),'value':_0x259f94[_0x7350('0x7a')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x1]?_0x259f94[_0x7350('0x63')][0x1]['value']:undefined)||null},{'name':_0x7350('0x7b'),'value':_0x259f94[_0x7350('0x7b')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x2]?_0x259f94['attrs'][0x2][_0x7350('0x64')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x259f94[_0x7350('0x6e')]||(_0x259f94['attrs']&&_0x259f94['attrs'][0x3]?_0x259f94[_0x7350('0x63')][0x3][_0x7350('0x64')]:undefined)||[]},{'name':'attrChannel','value':_0x259f94[_0x7350('0x6f')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x4]?_0x259f94['attrs'][0x4][_0x7350('0x64')]:undefined)||_0x7350('0x70')},{'name':_0x7350('0x71'),'value':_0x259f94[_0x7350('0x71')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x5]?_0x259f94['attrs'][0x5]['value']:undefined)||''},{'name':_0x7350('0x72'),'value':_0x259f94[_0x7350('0x72')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x6]?_0x259f94['attrs'][0x6][_0x7350('0x64')]:undefined)||''},{'name':_0x7350('0x73'),'value':_0x259f94[_0x7350('0x73')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x7]?_0x259f94['attrs'][0x7][_0x7350('0x64')]:undefined)||''},{'name':_0x7350('0x74'),'value':_0x259f94[_0x7350('0x74')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x8]?_0x259f94['attrs'][0x8]['value']:undefined)||''},{'name':_0x7350('0x75'),'value':_0x259f94[_0x7350('0x75')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x9]?_0x259f94[_0x7350('0x63')][0x9]['value']:undefined)||''},{'name':_0x7350('0x76'),'value':_0x259f94[_0x7350('0x76')]||(_0x259f94['attrs']&&_0x259f94['attrs'][0xa]?_0x259f94[_0x7350('0x63')][0xa][_0x7350('0x64')]:undefined)||''}];case'web-report':return[{'name':_0x7350('0x7c'),'type':_0x259f94[_0x7350('0x7d')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x0]?_0x259f94[_0x7350('0x63')][0x0][_0x7350('0x46')]:undefined)||null,'value':_0x259f94[_0x7350('0x7c')]||(_0x259f94[_0x7350('0x63')]&&_0x259f94['attrs'][0x0]?_0x259f94[_0x7350('0x63')][0x0]['value']:undefined)||null},{'name':_0x7350('0x7e'),'value':_0x259f94['attrRefresh']||(_0x259f94[_0x7350('0x63')]&&_0x259f94[_0x7350('0x63')][0x1]?_0x259f94[_0x7350('0x63')][0x1][_0x7350('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x58c0ae){logger[_0x7350('0x2f')](_0x7350('0x7f'),JSON[_0x7350('0x80')](_0x58c0ae));return[];}}exports['addItem']=function(_0x2442cf,_0x3e52c7,_0x257829){if(_0x2442cf[_0x7350('0x53')]['id']){delete _0x2442cf[_0x7350('0x53')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x2442cf[_0x7350('0x4e')]['id']}})[_0x7350('0x2c')](handleEntityNotFound(_0x3e52c7,null))[_0x7350('0x2c')](function(_0x2642dd){if(_0x2642dd){_0x2442cf[_0x7350('0x53')][_0x7350('0x81')]=_0x2642dd['id'];_0x2442cf[_0x7350('0x53')][_0x7350('0x63')]=widgetAttributes(_0x2442cf[_0x7350('0x53')]);return db[_0x7350('0x82')][_0x7350('0x52')](_0x2442cf['body']);}})[_0x7350('0x2c')](respondWithResult(_0x3e52c7,null))[_0x7350('0x4c')](handleError(_0x3e52c7,null));};exports[_0x7350('0x83')]=function(_0x106189,_0x20f1e9,_0x30feb6){var _0x45120b={};var _0x5a59f6={};var _0x25cbfe;var _0x1ab155;return db[_0x7350('0x35')]['findOne']({'where':{'id':_0x106189['params']['id']}})[_0x7350('0x2c')](handleEntityNotFound(_0x20f1e9,null))[_0x7350('0x2c')](function(_0xa34b8c){if(_0xa34b8c){_0x25cbfe=_0xa34b8c;_0x5a59f6[_0x7350('0x39')]=_[_0x7350('0x4f')](db[_0x7350('0x82')][_0x7350('0x36')]);_0x5a59f6['query']=_[_0x7350('0x4f')](_0x106189['query']);_0x5a59f6['filters']=_['intersection'](_0x5a59f6[_0x7350('0x39')],_0x5a59f6['query']);_0x45120b[_0x7350('0x3e')]=_[_0x7350('0x3c')](_0x5a59f6[_0x7350('0x39')],qs[_0x7350('0x3d')](_0x106189[_0x7350('0x3a')][_0x7350('0x3d')]));_0x45120b[_0x7350('0x3e')]=_0x45120b[_0x7350('0x3e')][_0x7350('0x3f')]?_0x45120b[_0x7350('0x3e')]:_0x5a59f6[_0x7350('0x39')];_0x45120b[_0x7350('0x42')]=qs[_0x7350('0x84')](_0x106189[_0x7350('0x3a')][_0x7350('0x84')]);_0x45120b[_0x7350('0x43')]=qs['filters'](_[_0x7350('0x44')](_0x106189[_0x7350('0x3a')],_0x5a59f6['filters']));if(_0x106189[_0x7350('0x3a')]['filter']){_0x45120b[_0x7350('0x43')]=_[_0x7350('0x45')](_0x45120b['where'],{'$or':_[_0x7350('0x34')](_0x45120b[_0x7350('0x3e')],function(_0x116b76){var _0x54dc3d={};_0x54dc3d[_0x116b76]={'$like':'%'+_0x106189[_0x7350('0x3a')][_0x7350('0x85')]+'%'};return _0x54dc3d;})});}_0x45120b=_[_0x7350('0x45')]({},_0x45120b,_0x106189[_0x7350('0x50')]);return _0x25cbfe['getItems'](_0x45120b);}})['then'](function(_0x508ece){if(_0x508ece){_0x1ab155=_0x508ece['length'];if(!_0x106189[_0x7350('0x3a')][_0x7350('0x40')](_0x7350('0x41'))){_0x45120b[_0x7350('0x24')]=qs['limit'](_0x106189[_0x7350('0x3a')][_0x7350('0x24')]);_0x45120b[_0x7350('0x25')]=qs[_0x7350('0x25')](_0x106189[_0x7350('0x3a')]['offset']);}return _0x25cbfe[_0x7350('0x83')](_0x45120b);}})[_0x7350('0x2c')](function(_0xf8e5b7){if(_0xf8e5b7){return _0xf8e5b7?{'count':_0x1ab155,'rows':_0xf8e5b7}:null;}})[_0x7350('0x2c')](respondWithResult(_0x20f1e9,null))[_0x7350('0x4c')](handleError(_0x20f1e9,null));}; \ No newline at end of file +var _0x5d1e=['attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','DashboardItem','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','redis','./dashboard.socket','register','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','status','send','index','Dashboard','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','VIRTUAL','includeAll','include','rows','catch','show','params','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','CustomDashboards','iframe','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrFontSize','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts'];(function(_0x3073c5,_0x426ccc){var _0x35f385=function(_0x45b159){while(--_0x45b159){_0x3073c5['push'](_0x3073c5['shift']());}};_0x35f385(++_0x426ccc);}(_0x5d1e,0x100));var _0xe5d1=function(_0x36379d,_0x628408){_0x36379d=_0x36379d-0x0;var _0x1fe0ee=_0x5d1e[_0x36379d];return _0x1fe0ee;};'use strict';var emlformat=require(_0xe5d1('0x0'));var rimraf=require(_0xe5d1('0x1'));var zipdir=require(_0xe5d1('0x2'));var jsonpatch=require(_0xe5d1('0x3'));var rp=require(_0xe5d1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe5d1('0x5'));var util=require(_0xe5d1('0x6'));var path=require(_0xe5d1('0x7'));var sox=require(_0xe5d1('0x8'));var csv=require(_0xe5d1('0x9'));var ejs=require(_0xe5d1('0xa'));var fs=require('fs');var fs_extra=require(_0xe5d1('0xb'));var _=require(_0xe5d1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe5d1('0xd'));var toCsv=require(_0xe5d1('0x9'));var querystring=require('querystring');var Papa=require(_0xe5d1('0xe'));var Redis=require(_0xe5d1('0xf'));var authService=require(_0xe5d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe5d1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe5d1('0x12'));var utils=require('../../config/utils');var config=require(_0xe5d1('0x13'));var licenseUtil=require(_0xe5d1('0x14'));var db=require(_0xe5d1('0x15'))['db'];config[_0xe5d1('0x16')]=_['defaults'](config[_0xe5d1('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe5d1('0x16')]));require(_0xe5d1('0x17'))[_0xe5d1('0x18')](socket);function respondWithStatusCode(_0x38599d,_0x4022b1){_0x4022b1=_0x4022b1||0xcc;return function(_0x35d2b0){if(_0x35d2b0){return _0x38599d[_0xe5d1('0x19')](_0x4022b1);}return _0x38599d['status'](_0x4022b1)[_0xe5d1('0x1a')]();};}function respondWithResult(_0x28568a,_0x218166){_0x218166=_0x218166||0xc8;return function(_0x349b34){if(_0x349b34){return _0x28568a['status'](_0x218166)[_0xe5d1('0x1b')](_0x349b34);}};}function respondWithFilteredResult(_0x507089,_0x2367f7){return function(_0x3f08fb){if(_0x3f08fb){var _0x2c965b=typeof _0x2367f7[_0xe5d1('0x1c')]===_0xe5d1('0x1d')&&typeof _0x2367f7[_0xe5d1('0x1e')]===_0xe5d1('0x1d');var _0x8149bc=_0x3f08fb['count'];var _0x26c6a0=_0x2c965b?0x0:_0x2367f7[_0xe5d1('0x1c')];var _0x5cb3b4=_0x2c965b?_0x3f08fb[_0xe5d1('0x1f')]:_0x2367f7[_0xe5d1('0x1c')]+_0x2367f7[_0xe5d1('0x1e')];var _0x2d1fe6;if(_0x5cb3b4>=_0x8149bc){_0x5cb3b4=_0x8149bc;_0x2d1fe6=0xc8;}else{_0x2d1fe6=0xce;}_0x507089['status'](_0x2d1fe6);return _0x507089[_0xe5d1('0x20')](_0xe5d1('0x21'),_0x26c6a0+'-'+_0x5cb3b4+'/'+_0x8149bc)['json'](_0x3f08fb);}return null;};}function patchUpdates(_0x32bb23){return function(_0x328ec7){try{jsonpatch[_0xe5d1('0x22')](_0x328ec7,_0x32bb23,!![]);}catch(_0x3f8dd8){return BPromise[_0xe5d1('0x23')](_0x3f8dd8);}return _0x328ec7[_0xe5d1('0x24')]();};}function saveUpdates(_0x32b741,_0x530c57){return function(_0x3937ae){if(_0x3937ae){return _0x3937ae[_0xe5d1('0x25')](_0x32b741)[_0xe5d1('0x26')](function(_0x5ab167){return _0x5ab167;});}return null;};}function removeEntity(_0xdc5a27,_0x51d4f1){return function(_0x14f7cd){if(_0x14f7cd){return _0x14f7cd[_0xe5d1('0x27')]()[_0xe5d1('0x26')](function(){var _0x452282=_0x14f7cd[_0xe5d1('0x28')]({'plain':!![]});var _0x19624e='CustomDashboards';return db[_0xe5d1('0x29')]['destroy']({'where':{'type':_0x19624e,'resourceId':_0x452282['id']}})[_0xe5d1('0x26')](function(){return _0x14f7cd;});})[_0xe5d1('0x26')](function(){_0xdc5a27['status'](0xcc)[_0xe5d1('0x1a')]();});}};}function handleEntityNotFound(_0x4b51f3,_0x54d504){return function(_0x4ca367){if(!_0x4ca367){_0x4b51f3['sendStatus'](0x194);}return _0x4ca367;};}function handleError(_0x4551a1,_0x4a5abb){_0x4a5abb=_0x4a5abb||0x1f4;return function(_0x116035){logger[_0xe5d1('0x2a')](_0x116035[_0xe5d1('0x2b')]);if(_0x116035[_0xe5d1('0x2c')]){delete _0x116035[_0xe5d1('0x2c')];}_0x4551a1[_0xe5d1('0x2d')](_0x4a5abb)[_0xe5d1('0x2e')](_0x116035);};}exports[_0xe5d1('0x2f')]=function(_0x39b33f,_0x3e8d12){var _0xface1a={},_0x5f433e={},_0x55d774={'count':0x0,'rows':[]};var _0x33f6dd=_['map'](db[_0xe5d1('0x30')][_0xe5d1('0x31')],function(_0xec28f1){return{'name':_0xec28f1['fieldName'],'type':_0xec28f1[_0xe5d1('0x32')][_0xe5d1('0x33')]};});_0x5f433e['model']=_['map'](_0x33f6dd,_0xe5d1('0x2c'));_0x5f433e[_0xe5d1('0x34')]=_[_0xe5d1('0x35')](_0x39b33f[_0xe5d1('0x34')]);_0x5f433e['filters']=_[_0xe5d1('0x36')](_0x5f433e['model'],_0x5f433e['query']);_0xface1a['attributes']=_['intersection'](_0x5f433e[_0xe5d1('0x37')],qs[_0xe5d1('0x38')](_0x39b33f[_0xe5d1('0x34')][_0xe5d1('0x38')]));_0xface1a[_0xe5d1('0x39')]=_0xface1a[_0xe5d1('0x39')][_0xe5d1('0x3a')]?_0xface1a['attributes']:_0x5f433e[_0xe5d1('0x37')];if(!_0x39b33f[_0xe5d1('0x34')][_0xe5d1('0x3b')](_0xe5d1('0x3c'))){_0xface1a[_0xe5d1('0x1e')]=qs[_0xe5d1('0x1e')](_0x39b33f['query'][_0xe5d1('0x1e')]);_0xface1a['offset']=qs[_0xe5d1('0x1c')](_0x39b33f[_0xe5d1('0x34')][_0xe5d1('0x1c')]);}_0xface1a[_0xe5d1('0x3d')]=qs['sort'](_0x39b33f[_0xe5d1('0x34')][_0xe5d1('0x3e')]);_0xface1a['where']=qs['filters'](_['pick'](_0x39b33f['query'],_0x5f433e[_0xe5d1('0x3f')]),_0x33f6dd);if(_0x39b33f[_0xe5d1('0x34')][_0xe5d1('0x40')]){_0xface1a[_0xe5d1('0x41')]=_[_0xe5d1('0x42')](_0xface1a['where'],{'$or':_[_0xe5d1('0x43')](_0x33f6dd,function(_0x3301a8){if(_0x3301a8[_0xe5d1('0x32')]!==_0xe5d1('0x44')){var _0x3ed828={};_0x3ed828[_0x3301a8['name']]={'$like':'%'+_0x39b33f[_0xe5d1('0x34')][_0xe5d1('0x40')]+'%'};return _0x3ed828;}})});}_0xface1a=_['merge']({},_0xface1a,_0x39b33f['options']);var _0x1bac16={'where':_0xface1a[_0xe5d1('0x41')]};return db[_0xe5d1('0x30')][_0xe5d1('0x1f')](_0x1bac16)[_0xe5d1('0x26')](function(_0x1edeee){_0x55d774['count']=_0x1edeee;if(_0x39b33f[_0xe5d1('0x34')][_0xe5d1('0x45')]){_0xface1a[_0xe5d1('0x46')]=[{'all':!![]}];}return db[_0xe5d1('0x30')]['findAll'](_0xface1a);})[_0xe5d1('0x26')](function(_0x52c1c9){_0x55d774[_0xe5d1('0x47')]=_0x52c1c9;return _0x55d774;})[_0xe5d1('0x26')](respondWithFilteredResult(_0x3e8d12,_0xface1a))[_0xe5d1('0x48')](handleError(_0x3e8d12,null));};exports[_0xe5d1('0x49')]=function(_0x3d45d6,_0x4e68a8){var _0x568d26={'raw':![],'where':{'id':_0x3d45d6[_0xe5d1('0x4a')]['id']}},_0x13ab78={};_0x13ab78[_0xe5d1('0x37')]=_['keys'](db['Dashboard'][_0xe5d1('0x31')]);_0x13ab78[_0xe5d1('0x34')]=_['keys'](_0x3d45d6['query']);_0x13ab78[_0xe5d1('0x3f')]=_[_0xe5d1('0x36')](_0x13ab78[_0xe5d1('0x37')],_0x13ab78[_0xe5d1('0x34')]);_0x568d26[_0xe5d1('0x39')]=_[_0xe5d1('0x36')](_0x13ab78[_0xe5d1('0x37')],qs[_0xe5d1('0x38')](_0x3d45d6[_0xe5d1('0x34')][_0xe5d1('0x38')]));_0x568d26[_0xe5d1('0x39')]=_0x568d26[_0xe5d1('0x39')]['length']?_0x568d26[_0xe5d1('0x39')]:_0x13ab78['model'];if(_0x3d45d6[_0xe5d1('0x34')][_0xe5d1('0x45')]){_0x568d26['include']=[{'all':!![]}];}_0x568d26=_[_0xe5d1('0x42')]({},_0x568d26,_0x3d45d6[_0xe5d1('0x4b')]);return db[_0xe5d1('0x30')]['find'](_0x568d26)['then'](handleEntityNotFound(_0x4e68a8,null))[_0xe5d1('0x26')](respondWithResult(_0x4e68a8,null))[_0xe5d1('0x48')](handleError(_0x4e68a8,null));};exports[_0xe5d1('0x4c')]=function(_0x1ad5e1,_0x540678){return db[_0xe5d1('0x30')][_0xe5d1('0x4c')](_0x1ad5e1[_0xe5d1('0x4d')],{})[_0xe5d1('0x26')](function(_0x50db47){var _0x213a07=_0x1ad5e1['user']['get']({'plain':!![]});if(!_0x213a07)throw new Error(_0xe5d1('0x4e'));if(_0x213a07[_0xe5d1('0x4f')]===_0xe5d1('0x50')){var _0x1803d2=_0x50db47['get']({'plain':!![]});var _0x282e4f='CustomDashboards';return db[_0xe5d1('0x51')][_0xe5d1('0x52')]({'where':{'name':_0x282e4f,'userProfileId':_0x213a07[_0xe5d1('0x53')]},'raw':!![]})[_0xe5d1('0x26')](function(_0x68b4f1){if(_0x68b4f1&&_0x68b4f1[_0xe5d1('0x54')]===0x0){return db[_0xe5d1('0x29')][_0xe5d1('0x4c')]({'name':_0x1803d2['name'],'resourceId':_0x1803d2['id'],'type':_0x68b4f1['name'],'sectionId':_0x68b4f1['id']},{})[_0xe5d1('0x26')](function(){return _0x50db47;});}else{return _0x50db47;}})[_0xe5d1('0x48')](function(_0xabf2c8){logger[_0xe5d1('0x2a')](_0xe5d1('0x55'),_0xabf2c8);throw _0xabf2c8;});}return _0x50db47;})[_0xe5d1('0x26')](respondWithResult(_0x540678,0xc9))['catch'](handleError(_0x540678,null));};exports['clone']=function(_0x32a944,_0x32f6f7){var _0x72106a={'where':{'id':_0x32a944[_0xe5d1('0x4a')]['id']}},_0x435cb7={};_0x435cb7['model']=_['keys'](db[_0xe5d1('0x30')][_0xe5d1('0x31')]);_0x72106a['attributes']=_[_0xe5d1('0x36')](_0x435cb7[_0xe5d1('0x37')],qs[_0xe5d1('0x38')](_0x32a944[_0xe5d1('0x34')][_0xe5d1('0x38')]));_0x72106a[_0xe5d1('0x39')]=_0x72106a[_0xe5d1('0x39')][_0xe5d1('0x3a')]?_0x72106a[_0xe5d1('0x39')]:_0x435cb7[_0xe5d1('0x37')];if(_0x32a944['query'][_0xe5d1('0x45')]){_0x72106a['include']=[{'all':!![]}];}_0x72106a=_[_0xe5d1('0x42')]({},_0x72106a,_0x32a944[_0xe5d1('0x4b')]);return db[_0xe5d1('0x30')]['find'](_0x72106a)[_0xe5d1('0x26')](handleEntityNotFound(_0x32f6f7,null))[_0xe5d1('0x26')](function(_0xe42484){if(_0xe42484){var _0x2dbf13=_0xe42484[_0xe5d1('0x28')]({'plain':!![]});_0x2dbf13=qs[_0xe5d1('0x56')](_0x2dbf13,['id',_0xe5d1('0x57'),'updatedAt']);_0x32a944[_0xe5d1('0x4d')]=_[_0xe5d1('0x56')](_0x32a944[_0xe5d1('0x4d')],['id',_0xe5d1('0x57'),_0xe5d1('0x58')]);return db[_0xe5d1('0x30')][_0xe5d1('0x4c')](_[_0xe5d1('0x42')](_0x2dbf13,_0x32a944[_0xe5d1('0x4d')]),{'include':_0x32a944[_0xe5d1('0x34')][_0xe5d1('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x1c0637){var _0x397ace=_0x32a944[_0xe5d1('0x50')][_0xe5d1('0x28')]({'plain':!![]});if(!_0x397ace)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x397ace[_0xe5d1('0x4f')]===_0xe5d1('0x50')){var _0x351cac=_0x1c0637['get']({'plain':!![]});var _0x449d63=_0xe5d1('0x59');return db[_0xe5d1('0x51')]['find']({'where':{'name':_0x449d63,'userProfileId':_0x397ace['userProfileId']},'raw':!![]})[_0xe5d1('0x26')](function(_0x1f3cd6){if(_0x1f3cd6&&_0x1f3cd6[_0xe5d1('0x54')]===0x0){return db[_0xe5d1('0x29')]['create']({'name':_0x351cac['name'],'resourceId':_0x351cac['id'],'type':_0x1f3cd6[_0xe5d1('0x2c')],'sectionId':_0x1f3cd6['id']},{})[_0xe5d1('0x26')](function(){return _0x1c0637;});}else{return _0x1c0637;}})['catch'](function(_0x3385f5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3385f5);throw _0x3385f5;});}return _0x1c0637;});}})[_0xe5d1('0x26')](respondWithResult(_0x32f6f7,0xc9))[_0xe5d1('0x48')](handleError(_0x32f6f7,null));};exports['update']=function(_0x593e8c,_0x54d44b){if(_0x593e8c[_0xe5d1('0x4d')]['id']){delete _0x593e8c['body']['id'];}return db[_0xe5d1('0x30')][_0xe5d1('0x52')]({'where':{'id':_0x593e8c[_0xe5d1('0x4a')]['id']}})[_0xe5d1('0x26')](handleEntityNotFound(_0x54d44b,null))[_0xe5d1('0x26')](saveUpdates(_0x593e8c[_0xe5d1('0x4d')],null))[_0xe5d1('0x26')](respondWithResult(_0x54d44b,null))['catch'](handleError(_0x54d44b,null));};exports[_0xe5d1('0x27')]=function(_0x1e5917,_0x57aeab){return db[_0xe5d1('0x30')][_0xe5d1('0x52')]({'where':{'id':_0x1e5917[_0xe5d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57aeab,null))['then'](removeEntity(_0x57aeab,null))[_0xe5d1('0x48')](handleError(_0x57aeab,null));};function widgetAttributes(_0x27426b){try{switch(_0x27426b[_0xe5d1('0x32')]){case _0xe5d1('0x5a'):return[{'name':_0xe5d1('0x5b'),'value':_0x27426b['attrUrl']||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x0]?_0x27426b[_0xe5d1('0x5c')][0x0][_0xe5d1('0x5d')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x27426b[_0xe5d1('0x5e')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x0]?_0x27426b[_0xe5d1('0x5c')][0x0][_0xe5d1('0x5d')]:undefined)||''}];case _0xe5d1('0x5f'):return[{'name':_0xe5d1('0x60'),'value':_0x27426b[_0xe5d1('0x60')]||(_0x27426b['attrs']&&_0x27426b[_0xe5d1('0x5c')][0x0]?_0x27426b[_0xe5d1('0x5c')][0x0][_0xe5d1('0x5d')]:undefined)||_0xe5d1('0x61')},{'name':'attrTimezone','value':_0x27426b['attrTimezone']||(_0x27426b['attrs']&&_0x27426b['attrs'][0x1]?_0x27426b[_0xe5d1('0x5c')][0x1]['value']:undefined)||'0.00'},{'name':_0xe5d1('0x62'),'value':_0x27426b[_0xe5d1('0x62')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x2]?_0x27426b[_0xe5d1('0x5c')][0x2][_0xe5d1('0x5d')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x27426b['attrMetric']||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x0]?_0x27426b['attrs'][0x0]['value']:undefined)||_0xe5d1('0x63')},{'name':'attrVoiceQueues','value':_0x27426b[_0xe5d1('0x64')]||(_0x27426b['attrs']&&_0x27426b[_0xe5d1('0x5c')][0x1]?_0x27426b[_0xe5d1('0x5c')][0x1]['value']:undefined)||[]},{'name':_0xe5d1('0x62'),'value':_0x27426b[_0xe5d1('0x62')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x2]?_0x27426b[_0xe5d1('0x5c')][0x2][_0xe5d1('0x5d')]:undefined)||0x14},{'name':_0xe5d1('0x65'),'value':_0x27426b[_0xe5d1('0x65')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x3]?_0x27426b[_0xe5d1('0x5c')][0x3][_0xe5d1('0x5d')]:undefined)||'voice'},{'name':_0xe5d1('0x66'),'value':_0x27426b[_0xe5d1('0x66')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b['attrs'][0x4]?_0x27426b[_0xe5d1('0x5c')][0x4][_0xe5d1('0x5d')]:undefined)||''},{'name':_0xe5d1('0x67'),'value':_0x27426b[_0xe5d1('0x67')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b['attrs'][0x5]?_0x27426b[_0xe5d1('0x5c')][0x5][_0xe5d1('0x5d')]:undefined)||''},{'name':_0xe5d1('0x68'),'value':_0x27426b['attrSmsAccounts']||(_0x27426b['attrs']&&_0x27426b['attrs'][0x6]?_0x27426b[_0xe5d1('0x5c')][0x6]['value']:undefined)||''},{'name':_0xe5d1('0x69'),'value':_0x27426b[_0xe5d1('0x69')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x7]?_0x27426b[_0xe5d1('0x5c')][0x7]['value']:undefined)||''},{'name':_0xe5d1('0x6a'),'value':_0x27426b[_0xe5d1('0x6a')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x8]?_0x27426b[_0xe5d1('0x5c')][0x8]['value']:undefined)||''},{'name':_0xe5d1('0x6b'),'value':_0x27426b[_0xe5d1('0x6b')]||(_0x27426b['attrs']&&_0x27426b['attrs'][0x9]?_0x27426b[_0xe5d1('0x5c')][0x9][_0xe5d1('0x5d')]:undefined)||''}];case _0xe5d1('0x6c'):case'pie-chart':return[{'name':'attrSerie1','value':_0x27426b[_0xe5d1('0x6d')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b['attrs'][0x0]?_0x27426b[_0xe5d1('0x5c')][0x0]['value']:undefined)||_0xe5d1('0x63')},{'name':_0xe5d1('0x6e'),'value':_0x27426b['attrSerie2']||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x1]?_0x27426b['attrs'][0x1][_0xe5d1('0x5d')]:undefined)||null},{'name':_0xe5d1('0x6f'),'value':_0x27426b[_0xe5d1('0x6f')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x2]?_0x27426b[_0xe5d1('0x5c')][0x2][_0xe5d1('0x5d')]:undefined)||null},{'name':_0xe5d1('0x64'),'value':_0x27426b[_0xe5d1('0x64')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x3]?_0x27426b[_0xe5d1('0x5c')][0x3][_0xe5d1('0x5d')]:undefined)||[]},{'name':_0xe5d1('0x65'),'value':_0x27426b[_0xe5d1('0x65')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x4]?_0x27426b['attrs'][0x4][_0xe5d1('0x5d')]:undefined)||'voice'},{'name':_0xe5d1('0x66'),'value':_0x27426b[_0xe5d1('0x66')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x5]?_0x27426b[_0xe5d1('0x5c')][0x5][_0xe5d1('0x5d')]:undefined)||''},{'name':_0xe5d1('0x67'),'value':_0x27426b[_0xe5d1('0x67')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x6]?_0x27426b[_0xe5d1('0x5c')][0x6][_0xe5d1('0x5d')]:undefined)||''},{'name':_0xe5d1('0x68'),'value':_0x27426b[_0xe5d1('0x68')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x7]?_0x27426b['attrs'][0x7][_0xe5d1('0x5d')]:undefined)||''},{'name':_0xe5d1('0x69'),'value':_0x27426b[_0xe5d1('0x69')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x8]?_0x27426b[_0xe5d1('0x5c')][0x8][_0xe5d1('0x5d')]:undefined)||''},{'name':_0xe5d1('0x6a'),'value':_0x27426b[_0xe5d1('0x6a')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x9]?_0x27426b['attrs'][0x9][_0xe5d1('0x5d')]:undefined)||''},{'name':'attrChatWebsites','value':_0x27426b[_0xe5d1('0x6b')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0xa]?_0x27426b['attrs'][0xa][_0xe5d1('0x5d')]:undefined)||''}];case'web-report':return[{'name':'attrReport','type':_0x27426b[_0xe5d1('0x70')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x0]?_0x27426b['attrs'][0x0][_0xe5d1('0x32')]:undefined)||null,'value':_0x27426b[_0xe5d1('0x71')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b['attrs'][0x0]?_0x27426b['attrs'][0x0][_0xe5d1('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x27426b[_0xe5d1('0x72')]||(_0x27426b[_0xe5d1('0x5c')]&&_0x27426b[_0xe5d1('0x5c')][0x1]?_0x27426b[_0xe5d1('0x5c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xdc13f7){logger[_0xe5d1('0x2a')](_0xe5d1('0x73'),JSON[_0xe5d1('0x74')](_0xdc13f7));return[];}}exports[_0xe5d1('0x75')]=function(_0x295363,_0x590e99,_0x56fdaa){if(_0x295363[_0xe5d1('0x4d')]['id']){delete _0x295363[_0xe5d1('0x4d')]['id'];}return db[_0xe5d1('0x30')][_0xe5d1('0x52')]({'where':{'id':_0x295363['params']['id']}})[_0xe5d1('0x26')](handleEntityNotFound(_0x590e99,null))[_0xe5d1('0x26')](function(_0x53f3d1){if(_0x53f3d1){_0x295363['body']['DashboardId']=_0x53f3d1['id'];_0x295363[_0xe5d1('0x4d')][_0xe5d1('0x5c')]=widgetAttributes(_0x295363[_0xe5d1('0x4d')]);return db['DashboardItem'][_0xe5d1('0x4c')](_0x295363['body']);}})[_0xe5d1('0x26')](respondWithResult(_0x590e99,null))[_0xe5d1('0x48')](handleError(_0x590e99,null));};exports[_0xe5d1('0x76')]=function(_0x4f570c,_0x461f31,_0x1d7b11){var _0x45eccb={};var _0xfc59fb={};var _0x353572;var _0x577ac0;return db['Dashboard']['findOne']({'where':{'id':_0x4f570c[_0xe5d1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x461f31,null))[_0xe5d1('0x26')](function(_0xf00206){if(_0xf00206){_0x353572=_0xf00206;_0xfc59fb[_0xe5d1('0x37')]=_[_0xe5d1('0x35')](db[_0xe5d1('0x77')][_0xe5d1('0x31')]);_0xfc59fb[_0xe5d1('0x34')]=_[_0xe5d1('0x35')](_0x4f570c['query']);_0xfc59fb[_0xe5d1('0x3f')]=_['intersection'](_0xfc59fb['model'],_0xfc59fb['query']);_0x45eccb[_0xe5d1('0x39')]=_[_0xe5d1('0x36')](_0xfc59fb[_0xe5d1('0x37')],qs[_0xe5d1('0x38')](_0x4f570c[_0xe5d1('0x34')]['fields']));_0x45eccb[_0xe5d1('0x39')]=_0x45eccb[_0xe5d1('0x39')][_0xe5d1('0x3a')]?_0x45eccb['attributes']:_0xfc59fb[_0xe5d1('0x37')];_0x45eccb[_0xe5d1('0x3d')]=qs[_0xe5d1('0x3e')](_0x4f570c[_0xe5d1('0x34')][_0xe5d1('0x3e')]);_0x45eccb[_0xe5d1('0x41')]=qs['filters'](_[_0xe5d1('0x78')](_0x4f570c['query'],_0xfc59fb[_0xe5d1('0x3f')]));if(_0x4f570c[_0xe5d1('0x34')][_0xe5d1('0x40')]){_0x45eccb[_0xe5d1('0x41')]=_[_0xe5d1('0x42')](_0x45eccb['where'],{'$or':_[_0xe5d1('0x43')](_0x45eccb[_0xe5d1('0x39')],function(_0xebc394){var _0x5ab528={};_0x5ab528[_0xebc394]={'$like':'%'+_0x4f570c[_0xe5d1('0x34')]['filter']+'%'};return _0x5ab528;})});}_0x45eccb=_[_0xe5d1('0x42')]({},_0x45eccb,_0x4f570c[_0xe5d1('0x4b')]);return _0x353572[_0xe5d1('0x76')](_0x45eccb);}})[_0xe5d1('0x26')](function(_0x2d12b7){if(_0x2d12b7){_0x577ac0=_0x2d12b7['length'];if(!_0x4f570c[_0xe5d1('0x34')]['hasOwnProperty']('nolimit')){_0x45eccb[_0xe5d1('0x1e')]=qs[_0xe5d1('0x1e')](_0x4f570c['query'][_0xe5d1('0x1e')]);_0x45eccb[_0xe5d1('0x1c')]=qs[_0xe5d1('0x1c')](_0x4f570c[_0xe5d1('0x34')][_0xe5d1('0x1c')]);}return _0x353572[_0xe5d1('0x76')](_0x45eccb);}})[_0xe5d1('0x26')](function(_0x1a844a){if(_0x1a844a){return _0x1a844a?{'count':_0x577ac0,'rows':_0x1a844a}:null;}})['then'](respondWithResult(_0x461f31,null))[_0xe5d1('0x48')](handleError(_0x461f31,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index e06a3d5..e1b5542 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 _0xd798=['exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x9bcc0b,_0x120f6c){var _0x195399=function(_0x5be8b9){while(--_0x5be8b9){_0x9bcc0b['push'](_0x9bcc0b['shift']());}};_0x195399(++_0x120f6c);}(_0xd798,0x97));var _0x8d79=function(_0x54f428,_0x1b78ea){_0x54f428=_0x54f428-0x0;var _0x3b3732=_0xd798[_0x54f428];return _0x3b3732;};'use strict';var EventEmitter=require(_0x8d79('0x0'));var Dashboard=require(_0x8d79('0x1'))['db'][_0x8d79('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8d79('0x3')](0x0);var events={'afterCreate':_0x8d79('0x4'),'afterUpdate':_0x8d79('0x5'),'afterDestroy':_0x8d79('0x6')};function emitEvent(_0x2510e3){return function(_0x360bd7,_0x9462b2,_0x8a6a3){DashboardEvents[_0x8d79('0x7')](_0x2510e3+':'+_0x360bd7['id'],_0x360bd7);DashboardEvents[_0x8d79('0x7')](_0x2510e3,_0x360bd7);_0x8a6a3(null);};}for(var e in events){if(events[_0x8d79('0x8')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x8d79('0x9')]=DashboardEvents; \ No newline at end of file +var _0xd227=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hook'];(function(_0xc18fc4,_0x17c13e){var _0x2c6838=function(_0x42240f){while(--_0x42240f){_0xc18fc4['push'](_0xc18fc4['shift']());}};_0x2c6838(++_0x17c13e);}(_0xd227,0xab));var _0x7d22=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0xd227[_0x4b2cc6];return _0x3e0b08;};'use strict';var EventEmitter=require(_0x7d22('0x0'));var Dashboard=require(_0x7d22('0x1'))['db'][_0x7d22('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7d22('0x3')](0x0);var events={'afterCreate':_0x7d22('0x4'),'afterUpdate':_0x7d22('0x5'),'afterDestroy':_0x7d22('0x6')};function emitEvent(_0x2efa24){return function(_0x1bcbe0,_0x5017d6,_0x1b73d5){DashboardEvents['emit'](_0x2efa24+':'+_0x1bcbe0['id'],_0x1bcbe0);DashboardEvents[_0x7d22('0x7')](_0x2efa24,_0x1bcbe0);_0x1b73d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x7d22('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index db5aecd..a7315c0 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 _0xdd2b=['../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','util','moment','request-promise','path'];(function(_0x4c51b9,_0x2c9f49){var _0x1a5c2d=function(_0x5495f6){while(--_0x5495f6){_0x4c51b9['push'](_0x4c51b9['shift']());}};_0x1a5c2d(++_0x2c9f49);}(_0xdd2b,0xc4));var _0xbdd2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xdd2b[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0xbdd2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xbdd2('0x1'));var BPromise=require('bluebird');var rp=require(_0xbdd2('0x2'));var fs=require('fs');var path=require(_0xbdd2('0x3'));var rimraf=require('rimraf');var config=require(_0xbdd2('0x4'));var attributes=require(_0xbdd2('0x5'));module[_0xbdd2('0x6')]=function(_0x4b9636,_0x336aba){return _0x4b9636[_0xbdd2('0x7')](_0xbdd2('0x8'),attributes,{'tableName':_0xbdd2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7b0=['bluebird','request-promise','exports','define','Dashboard','dashboards','lodash','api','moment'];(function(_0x33bd1b,_0x3a20eb){var _0x172e5a=function(_0x59469e){while(--_0x59469e){_0x33bd1b['push'](_0x33bd1b['shift']());}};_0x172e5a(++_0x3a20eb);}(_0xc7b0,0x1a4));var _0x0c7b=function(_0x51f50f,_0x52f0d4){_0x51f50f=_0x51f50f-0x0;var _0x41a215=_0xc7b0[_0x51f50f];return _0x41a215;};'use strict';var _=require(_0x0c7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0c7b('0x1'));var moment=require(_0x0c7b('0x2'));var BPromise=require(_0x0c7b('0x3'));var rp=require(_0x0c7b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x0c7b('0x5')]=function(_0x4383eb,_0x319aff){return _0x4383eb[_0x0c7b('0x6')](_0x0c7b('0x7'),attributes,{'tableName':_0x0c7b('0x8'),'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 64216df..59eb9e6 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 _0x80ba=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','info'];(function(_0x421c72,_0x2526ce){var _0x2a8362=function(_0x4039f4){while(--_0x4039f4){_0x421c72['push'](_0x421c72['shift']());}};_0x2a8362(++_0x2526ce);}(_0x80ba,0xb1));var _0xa80b=function(_0x5a7944,_0x5c4b46){_0x5a7944=_0x5a7944-0x0;var _0x3a7eb5=_0x80ba[_0x5a7944];return _0x3a7eb5;};'use strict';var _=require('lodash');var util=require(_0xa80b('0x0'));var moment=require(_0xa80b('0x1'));var BPromise=require(_0xa80b('0x2'));var rs=require(_0xa80b('0x3'));var fs=require('fs');var Redis=require(_0xa80b('0x4'));var db=require(_0xa80b('0x5'))['db'];var utils=require(_0xa80b('0x6'));var logger=require(_0xa80b('0x7'))('rpc');var config=require(_0xa80b('0x8'));var jayson=require(_0xa80b('0x9'));var client=jayson[_0xa80b('0xa')][_0xa80b('0xb')]({'port':0x232a});config[_0xa80b('0xc')]=_[_0xa80b('0xd')](config['redis'],{'host':_0xa80b('0xe'),'port':0x18eb});var socket=require(_0xa80b('0xf'))(new Redis(config['redis']));require(_0xa80b('0x10'))['register'](socket);function respondWithRpcPromise(_0x57c9a0,_0x56af0e,_0x54fddb){return new BPromise(function(_0x1c9ca5,_0x436fd1){return client[_0xa80b('0x11')](_0x57c9a0,_0x54fddb)['then'](function(_0x3c0fbd){logger[_0xa80b('0x12')](_0xa80b('0x13'),_0x56af0e,_0xa80b('0x14'));logger[_0xa80b('0x15')](_0xa80b('0x16'),_0x56af0e,'request\x20sent',JSON[_0xa80b('0x17')](_0x3c0fbd));if(_0x3c0fbd['error']){if(_0x3c0fbd[_0xa80b('0x18')][_0xa80b('0x19')]===0x1f4){logger['error'](_0xa80b('0x13'),_0x56af0e,_0x3c0fbd['error'][_0xa80b('0x1a')]);return _0x436fd1(_0x3c0fbd[_0xa80b('0x18')][_0xa80b('0x1a')]);}logger['error'](_0xa80b('0x13'),_0x56af0e,_0x3c0fbd['error'][_0xa80b('0x1a')]);return _0x1c9ca5(_0x3c0fbd[_0xa80b('0x18')][_0xa80b('0x1a')]);}else{logger[_0xa80b('0x12')](_0xa80b('0x13'),_0x56af0e,_0xa80b('0x14'));_0x1c9ca5(_0x3c0fbd[_0xa80b('0x1b')][_0xa80b('0x1a')]);}})['catch'](function(_0x3cb652){logger[_0xa80b('0x18')]('Dashboard,\x20%s,\x20%s',_0x56af0e,_0x3cb652);_0x436fd1(_0x3cb652);});});} \ No newline at end of file +var _0x7d28=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2a5793,_0x172b53){var _0x365bb4=function(_0x213a8d){while(--_0x213a8d){_0x2a5793['push'](_0x2a5793['shift']());}};_0x365bb4(++_0x172b53);}(_0x7d28,0x73));var _0x87d2=function(_0x63eb23,_0x1228e0){_0x63eb23=_0x63eb23-0x0;var _0x2bf6b2=_0x7d28[_0x63eb23];return _0x2bf6b2;};'use strict';var _=require(_0x87d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x87d2('0x1'));var rs=require(_0x87d2('0x2'));var fs=require('fs');var Redis=require(_0x87d2('0x3'));var db=require(_0x87d2('0x4'))['db'];var utils=require(_0x87d2('0x5'));var logger=require(_0x87d2('0x6'))(_0x87d2('0x7'));var config=require(_0x87d2('0x8'));var jayson=require(_0x87d2('0x9'));var client=jayson[_0x87d2('0xa')][_0x87d2('0xb')]({'port':0x232a});config['redis']=_[_0x87d2('0xc')](config[_0x87d2('0xd')],{'host':_0x87d2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x87d2('0xd')]));require('./dashboard.socket')[_0x87d2('0xf')](socket);function respondWithRpcPromise(_0x35c66d,_0x121481,_0x37ca4e){return new BPromise(function(_0x199374,_0x3032c9){return client['request'](_0x35c66d,_0x37ca4e)['then'](function(_0x56523c){logger[_0x87d2('0x10')](_0x87d2('0x11'),_0x121481,_0x87d2('0x12'));logger[_0x87d2('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x121481,_0x87d2('0x12'),JSON['stringify'](_0x56523c));if(_0x56523c[_0x87d2('0x14')]){if(_0x56523c[_0x87d2('0x14')][_0x87d2('0x15')]===0x1f4){logger[_0x87d2('0x14')]('Dashboard,\x20%s,\x20%s',_0x121481,_0x56523c['error'][_0x87d2('0x16')]);return _0x3032c9(_0x56523c[_0x87d2('0x14')]['message']);}logger[_0x87d2('0x14')](_0x87d2('0x11'),_0x121481,_0x56523c['error'][_0x87d2('0x16')]);return _0x199374(_0x56523c[_0x87d2('0x14')][_0x87d2('0x16')]);}else{logger[_0x87d2('0x10')](_0x87d2('0x11'),_0x121481,'request\x20sent');_0x199374(_0x56523c[_0x87d2('0x17')]['message']);}})['catch'](function(_0x46e523){logger[_0x87d2('0x14')]('Dashboard,\x20%s,\x20%s',_0x121481,_0x46e523);_0x3032c9(_0x46e523);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 7b01a7d..e0ebb6a 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 _0xaafe=['length','./dashboard.events','save','remove','update','removeListener','register'];(function(_0x24b8da,_0x502640){var _0x337e11=function(_0x23b14d){while(--_0x23b14d){_0x24b8da['push'](_0x24b8da['shift']());}};_0x337e11(++_0x502640);}(_0xaafe,0x1eb));var _0xeaaf=function(_0x196d5d,_0x35846f){_0x196d5d=_0x196d5d-0x0;var _0x4aa9de=_0xaafe[_0x196d5d];return _0x4aa9de;};'use strict';var DashboardEvents=require(_0xeaaf('0x0'));var events=[_0xeaaf('0x1'),_0xeaaf('0x2'),_0xeaaf('0x3')];function createListener(_0x29729f,_0x2d075d){return function(_0x46f597){_0x2d075d['emit'](_0x29729f,_0x46f597);};}function removeListener(_0x388f6e,_0x3321e7){return function(){DashboardEvents[_0xeaaf('0x4')](_0x388f6e,_0x3321e7);};}exports[_0xeaaf('0x5')]=function(_0x546f3e){for(var _0x59047a=0x0,_0x1d9f82=events[_0xeaaf('0x6')];_0x59047a<_0x1d9f82;_0x59047a++){var _0xb13b2a=events[_0x59047a];var _0x60d044=createListener('dashboard:'+_0xb13b2a,_0x546f3e);DashboardEvents['on'](_0xb13b2a,_0x60d044);}}; \ No newline at end of file +var _0x3903=['removeListener','register','length','dashboard:','./dashboard.events','remove','update','emit'];(function(_0x28b78c,_0x585772){var _0x1da2bb=function(_0x454d33){while(--_0x454d33){_0x28b78c['push'](_0x28b78c['shift']());}};_0x1da2bb(++_0x585772);}(_0x3903,0x174));var _0x3390=function(_0x1c7529,_0x24381a){_0x1c7529=_0x1c7529-0x0;var _0x41b266=_0x3903[_0x1c7529];return _0x41b266;};'use strict';var DashboardEvents=require(_0x3390('0x0'));var events=['save',_0x3390('0x1'),_0x3390('0x2')];function createListener(_0x1c3aa0,_0x11230c){return function(_0x324f50){_0x11230c[_0x3390('0x3')](_0x1c3aa0,_0x324f50);};}function removeListener(_0x1da24c,_0xedc0fc){return function(){DashboardEvents[_0x3390('0x4')](_0x1da24c,_0xedc0fc);};}exports[_0x3390('0x5')]=function(_0x52c598){for(var _0x3f432e=0x0,_0x32867a=events[_0x3390('0x6')];_0x3f432e<_0x32867a;_0x3f432e++){var _0x338e55=events[_0x3f432e];var _0x3ceee1=createListener(_0x3390('0x7')+_0x338e55,_0x52c598);DashboardEvents['on'](_0x338e55,_0x3ceee1);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index b6d269e..921cdf3 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 _0x5db8=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','create','post','/:id/clone','clone','/:id/items','update','delete'];(function(_0x48961c,_0x280e9d){var _0x1d895d=function(_0x248ffa){while(--_0x248ffa){_0x48961c['push'](_0x48961c['shift']());}};_0x1d895d(++_0x280e9d);}(_0x5db8,0x17c));var _0x85db=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0x5db8[_0x1ac6e5];return _0x5877dc;};'use strict';var multer=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var path=require('path');var timeout=require(_0x85db('0x2'));var express=require(_0x85db('0x3'));var router=express['Router']();var fs_extra=require(_0x85db('0x4'));var auth=require(_0x85db('0x5'));var interaction=require(_0x85db('0x6'));var config=require(_0x85db('0x7'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x85db('0x8')](),controller['index']);router[_0x85db('0x9')](_0x85db('0xa'),auth[_0x85db('0x8')](),controller[_0x85db('0xb')]);router[_0x85db('0x9')]('/:id/items',auth['isAuthenticated'](),controller['getItems']);router['post']('/',auth[_0x85db('0x8')](),controller[_0x85db('0xc')]);router[_0x85db('0xd')](_0x85db('0xe'),auth[_0x85db('0x8')](),controller[_0x85db('0xf')]);router[_0x85db('0xd')](_0x85db('0x10'),auth[_0x85db('0x8')](),controller['addItem']);router['put'](_0x85db('0xa'),auth[_0x85db('0x8')](),controller[_0x85db('0x11')]);router[_0x85db('0x12')](_0x85db('0xa'),auth[_0x85db('0x8')](),controller[_0x85db('0x13')]);module[_0x85db('0x14')]=router; \ No newline at end of file +var _0x0012=['show','/:id/items','create','post','/:id/clone','clone','addItem','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0x0012,0x108));var _0x2001=function(_0x585d29,_0x5c6e49){_0x585d29=_0x585d29-0x0;var _0x454eae=_0x0012[_0x585d29];return _0x454eae;};'use strict';var multer=require(_0x2001('0x0'));var util=require(_0x2001('0x1'));var path=require(_0x2001('0x2'));var timeout=require(_0x2001('0x3'));var express=require(_0x2001('0x4'));var router=express[_0x2001('0x5')]();var fs_extra=require(_0x2001('0x6'));var auth=require(_0x2001('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x2001('0x8'));var controller=require('./dashboard.controller');router[_0x2001('0x9')]('/',auth[_0x2001('0xa')](),controller['index']);router[_0x2001('0x9')](_0x2001('0xb'),auth[_0x2001('0xa')](),controller[_0x2001('0xc')]);router['get'](_0x2001('0xd'),auth['isAuthenticated'](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0x2001('0xe')]);router[_0x2001('0xf')](_0x2001('0x10'),auth[_0x2001('0xa')](),controller[_0x2001('0x11')]);router['post']('/:id/items',auth[_0x2001('0xa')](),controller[_0x2001('0x12')]);router[_0x2001('0x13')](_0x2001('0xb'),auth[_0x2001('0xa')](),controller[_0x2001('0x14')]);router[_0x2001('0x15')]('/:id',auth[_0x2001('0xa')](),controller['destroy']);module[_0x2001('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 4393946..b32169f 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 _0xb4c7=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x2c81a3,_0x1e4efe){_0x2c81a3=_0x2c81a3-0x0;var _0x5c390a=_0xb4c7[_0x2c81a3];return _0x5c390a;};'use strict';var Sequelize=require(_0x7b4c('0x0'));var squel=require(_0x7b4c('0x1'));var _=require(_0x7b4c('0x2'));module[_0x7b4c('0x3')]={'title':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7b4c('0x5')](_0x7b4c('0x6')),'get':function(){try{return JSON[_0x7b4c('0x7')](this[_0x7b4c('0x8')](_0x7b4c('0x9')));}catch(_0x5adec9){return[];}},'set':function(_0x1b0f57){try{this[_0x7b4c('0xa')](_0x7b4c('0x9'),JSON['stringify'](_0x1b0f57));}catch(_0x2d7b7e){this[_0x7b4c('0xa')]('attrs',JSON[_0x7b4c('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x7b4c('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7b4c('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7b4c('0xc')]},'col':{'type':Sequelize[_0x7b4c('0xc')]},'background':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![],'defaultValue':_0x7b4c('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![],'defaultValue':_0x7b4c('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7b4c('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x90b1=['#2196f3','sequelize','squel','lodash','STRING','TEXT','long','parse','setDataValue','attrs','stringify','INTEGER','#ffffff'];(function(_0x5a3c24,_0x26512a){var _0x15da7f=function(_0x2e789b){while(--_0x2e789b){_0x5a3c24['push'](_0x5a3c24['shift']());}};_0x15da7f(++_0x26512a);}(_0x90b1,0x1bb));var _0x190b=function(_0x4fb683,_0x43736a){_0x4fb683=_0x4fb683-0x0;var _0x3b4599=_0x90b1[_0x4fb683];return _0x3b4599;};'use strict';var Sequelize=require(_0x190b('0x0'));var squel=require(_0x190b('0x1'));var _=require(_0x190b('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x190b('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x190b('0x4')](_0x190b('0x5')),'get':function(){try{return JSON[_0x190b('0x6')](this['getDataValue']('attrs'));}catch(_0x5cbebb){return[];}},'set':function(_0x5da9c1){try{this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')](_0x5da9c1));}catch(_0x626aa1){this[_0x190b('0x7')](_0x190b('0x8'),JSON[_0x190b('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x190b('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x190b('0xa')]},'col':{'type':Sequelize[_0x190b('0xa')]},'background':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x190b('0x3')],'allowNull':![],'defaultValue':_0x190b('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x190b('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 033ae21..41c5103 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 _0x7f94=['create','body','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./dashboardItem.socket','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','destroy','then','name','send','show','keys','DashboardItem','query','filters','intersection','model','attributes','fields','length','include','options','find','catch','iframe','attrUrl','attrs','https://','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','value','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrWhatsappAccounts','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7f94,0x65));var _0x47f9=function(_0x368a8d,_0x4d1ef1){_0x368a8d=_0x368a8d-0x0;var _0x2eddbb=_0x7f94[_0x368a8d];return _0x2eddbb;};'use strict';var emlformat=require(_0x47f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x47f9('0x1'));var jsonpatch=require(_0x47f9('0x2'));var rp=require(_0x47f9('0x3'));var moment=require(_0x47f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47f9('0x5'));var util=require(_0x47f9('0x6'));var path=require(_0x47f9('0x7'));var sox=require(_0x47f9('0x8'));var csv=require(_0x47f9('0x9'));var ejs=require(_0x47f9('0xa'));var fs=require('fs');var fs_extra=require(_0x47f9('0xb'));var _=require('lodash');var squel=require(_0x47f9('0xc'));var crypto=require(_0x47f9('0xd'));var jsforce=require(_0x47f9('0xe'));var deskjs=require(_0x47f9('0xf'));var toCsv=require(_0x47f9('0x9'));var querystring=require(_0x47f9('0x10'));var Papa=require(_0x47f9('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(_0x47f9('0x12'));var logger=require(_0x47f9('0x13'))(_0x47f9('0x14'));var utils=require(_0x47f9('0x15'));var config=require(_0x47f9('0x16'));var licenseUtil=require(_0x47f9('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x47f9('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47f9('0x19')]));require(_0x47f9('0x1a'))['register'](socket);function respondWithStatusCode(_0x166860,_0x2dce2b){_0x2dce2b=_0x2dce2b||0xcc;return function(_0x2bdbf4){if(_0x2bdbf4){return _0x166860[_0x47f9('0x1b')](_0x2dce2b);}return _0x166860['status'](_0x2dce2b)[_0x47f9('0x1c')]();};}function respondWithResult(_0x3703e1,_0x400887){_0x400887=_0x400887||0xc8;return function(_0xc75bbe){if(_0xc75bbe){return _0x3703e1[_0x47f9('0x1d')](_0x400887)['json'](_0xc75bbe);}};}function respondWithFilteredResult(_0x56775f,_0x54816d){return function(_0xd80474){if(_0xd80474){var _0x429f94=typeof _0x54816d[_0x47f9('0x1e')]===_0x47f9('0x1f')&&typeof _0x54816d[_0x47f9('0x20')]===_0x47f9('0x1f');var _0x29700e=_0xd80474[_0x47f9('0x21')];var _0x2d20d2=_0x429f94?0x0:_0x54816d[_0x47f9('0x1e')];var _0x34fba6=_0x429f94?_0xd80474[_0x47f9('0x21')]:_0x54816d[_0x47f9('0x1e')]+_0x54816d['limit'];var _0x4d35bf;if(_0x34fba6>=_0x29700e){_0x34fba6=_0x29700e;_0x4d35bf=0xc8;}else{_0x4d35bf=0xce;}_0x56775f[_0x47f9('0x1d')](_0x4d35bf);return _0x56775f['set'](_0x47f9('0x22'),_0x2d20d2+'-'+_0x34fba6+'/'+_0x29700e)[_0x47f9('0x23')](_0xd80474);}return null;};}function patchUpdates(_0x2ecf99){return function(_0x50bf58){try{jsonpatch[_0x47f9('0x24')](_0x50bf58,_0x2ecf99,!![]);}catch(_0x11ef91){return BPromise[_0x47f9('0x25')](_0x11ef91);}return _0x50bf58[_0x47f9('0x26')]();};}function saveUpdates(_0x4fd2b1,_0x1b84f4){return function(_0x36f8b1){if(_0x36f8b1){return _0x36f8b1['update'](_0x4fd2b1)['then'](function(_0x26bd84){return _0x26bd84;});}return null;};}function removeEntity(_0x4c16e0,_0x76077d){return function(_0x5c9260){if(_0x5c9260){return _0x5c9260[_0x47f9('0x27')]()[_0x47f9('0x28')](function(){_0x4c16e0['status'](0xcc)[_0x47f9('0x1c')]();});}};}function handleEntityNotFound(_0x3991ee,_0x15f5d){return function(_0xc82faa){if(!_0xc82faa){_0x3991ee[_0x47f9('0x1b')](0x194);}return _0xc82faa;};}function handleError(_0x443def,_0x44108c){_0x44108c=_0x44108c||0x1f4;return function(_0x52927a){logger['error'](_0x52927a['stack']);if(_0x52927a['name']){delete _0x52927a[_0x47f9('0x29')];}_0x443def['status'](_0x44108c)[_0x47f9('0x2a')](_0x52927a);};}exports[_0x47f9('0x2b')]=function(_0x3c0fc1,_0xaf0fea){var _0x35c86c={'raw':![],'where':{'id':_0x3c0fc1['params']['id']}},_0x40bf15={};_0x40bf15['model']=_[_0x47f9('0x2c')](db[_0x47f9('0x2d')]['rawAttributes']);_0x40bf15[_0x47f9('0x2e')]=_[_0x47f9('0x2c')](_0x3c0fc1[_0x47f9('0x2e')]);_0x40bf15[_0x47f9('0x2f')]=_[_0x47f9('0x30')](_0x40bf15[_0x47f9('0x31')],_0x40bf15[_0x47f9('0x2e')]);_0x35c86c[_0x47f9('0x32')]=_[_0x47f9('0x30')](_0x40bf15[_0x47f9('0x31')],qs[_0x47f9('0x33')](_0x3c0fc1[_0x47f9('0x2e')][_0x47f9('0x33')]));_0x35c86c['attributes']=_0x35c86c[_0x47f9('0x32')][_0x47f9('0x34')]?_0x35c86c['attributes']:_0x40bf15[_0x47f9('0x31')];if(_0x3c0fc1[_0x47f9('0x2e')]['includeAll']){_0x35c86c[_0x47f9('0x35')]=[{'all':!![]}];}_0x35c86c=_['merge']({},_0x35c86c,_0x3c0fc1[_0x47f9('0x36')]);return db[_0x47f9('0x2d')][_0x47f9('0x37')](_0x35c86c)['then'](handleEntityNotFound(_0xaf0fea,null))[_0x47f9('0x28')](respondWithResult(_0xaf0fea,null))[_0x47f9('0x38')](handleError(_0xaf0fea,null));};exports[_0x47f9('0x27')]=function(_0x39fc3e,_0x441586){return db['DashboardItem']['find']({'where':{'id':_0x39fc3e['params']['id']}})[_0x47f9('0x28')](handleEntityNotFound(_0x441586,null))[_0x47f9('0x28')](removeEntity(_0x441586,null))[_0x47f9('0x38')](handleError(_0x441586,null));};function widgetAttributes(_0x49ffbf){try{switch(_0x49ffbf['type']){case _0x47f9('0x39'):return[{'name':'attrUrl','value':_0x49ffbf[_0x47f9('0x3a')]||(_0x49ffbf['attrs']&&_0x49ffbf['attrs'][0x0]?_0x49ffbf[_0x47f9('0x3b')][0x0]['value']:undefined)||_0x47f9('0x3c')}];case _0x47f9('0x3d'):return[{'name':_0x47f9('0x3e'),'value':_0x49ffbf[_0x47f9('0x3e')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x0]?_0x49ffbf[_0x47f9('0x3b')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x47f9('0x3f'),'value':_0x49ffbf[_0x47f9('0x3f')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x0]?_0x49ffbf[_0x47f9('0x3b')][0x0]['value']:undefined)||_0x47f9('0x40')},{'name':_0x47f9('0x41'),'value':_0x49ffbf[_0x47f9('0x41')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x1]?_0x49ffbf[_0x47f9('0x3b')][0x1][_0x47f9('0x42')]:undefined)||_0x47f9('0x43')},{'name':'attrFontSize','value':_0x49ffbf[_0x47f9('0x44')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x2]?_0x49ffbf['attrs'][0x2]['value']:undefined)||0xc}];case _0x47f9('0x45'):return[{'name':_0x47f9('0x46'),'value':_0x49ffbf[_0x47f9('0x46')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x0]?_0x49ffbf[_0x47f9('0x3b')][0x0][_0x47f9('0x42')]:undefined)||_0x47f9('0x47')},{'name':_0x47f9('0x48'),'value':_0x49ffbf[_0x47f9('0x48')]||(_0x49ffbf['attrs']&&_0x49ffbf['attrs'][0x1]?_0x49ffbf['attrs'][0x1][_0x47f9('0x42')]:undefined)||[]},{'name':'attrFontSize','value':_0x49ffbf[_0x47f9('0x44')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x2]?_0x49ffbf[_0x47f9('0x3b')][0x2][_0x47f9('0x42')]:undefined)||0x14},{'name':'attrChannel','value':_0x49ffbf[_0x47f9('0x49')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x3]?_0x49ffbf[_0x47f9('0x3b')][0x3][_0x47f9('0x42')]:undefined)||_0x47f9('0x4a')},{'name':_0x47f9('0x4b'),'value':_0x49ffbf[_0x47f9('0x4b')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x4]?_0x49ffbf[_0x47f9('0x3b')][0x4][_0x47f9('0x42')]:undefined)||''},{'name':_0x47f9('0x4c'),'value':_0x49ffbf[_0x47f9('0x4c')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x5]?_0x49ffbf[_0x47f9('0x3b')][0x5][_0x47f9('0x42')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x49ffbf[_0x47f9('0x4d')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x6]?_0x49ffbf[_0x47f9('0x3b')][0x6][_0x47f9('0x42')]:undefined)||''},{'name':_0x47f9('0x4e'),'value':_0x49ffbf['attrOpenchannelAccounts']||(_0x49ffbf['attrs']&&_0x49ffbf[_0x47f9('0x3b')][0x7]?_0x49ffbf['attrs'][0x7][_0x47f9('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x49ffbf['attrWhatsappAccounts']||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x8]?_0x49ffbf[_0x47f9('0x3b')][0x8][_0x47f9('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x49ffbf[_0x47f9('0x4f')]||(_0x49ffbf['attrs']&&_0x49ffbf['attrs'][0x9]?_0x49ffbf[_0x47f9('0x3b')][0x9][_0x47f9('0x42')]:undefined)||''}];case _0x47f9('0x50'):case _0x47f9('0x51'):return[{'name':_0x47f9('0x52'),'value':_0x49ffbf[_0x47f9('0x52')]||(_0x49ffbf['attrs']&&_0x49ffbf[_0x47f9('0x3b')][0x0]?_0x49ffbf[_0x47f9('0x3b')][0x0][_0x47f9('0x42')]:undefined)||_0x47f9('0x47')},{'name':_0x47f9('0x53'),'value':_0x49ffbf[_0x47f9('0x53')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x1]?_0x49ffbf[_0x47f9('0x3b')][0x1][_0x47f9('0x42')]:undefined)||null},{'name':'attrSerie3','value':_0x49ffbf[_0x47f9('0x54')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x2]?_0x49ffbf[_0x47f9('0x3b')][0x2][_0x47f9('0x42')]:undefined)||null},{'name':_0x47f9('0x48'),'value':_0x49ffbf[_0x47f9('0x48')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x3]?_0x49ffbf[_0x47f9('0x3b')][0x3][_0x47f9('0x42')]:undefined)||[]},{'name':_0x47f9('0x49'),'value':_0x49ffbf[_0x47f9('0x49')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x4]?_0x49ffbf[_0x47f9('0x3b')][0x4][_0x47f9('0x42')]:undefined)||_0x47f9('0x4a')},{'name':_0x47f9('0x4b'),'value':_0x49ffbf['attrEmailAccounts']||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x5]?_0x49ffbf['attrs'][0x5][_0x47f9('0x42')]:undefined)||''},{'name':_0x47f9('0x4c'),'value':_0x49ffbf[_0x47f9('0x4c')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x6]?_0x49ffbf['attrs'][0x6]['value']:undefined)||''},{'name':_0x47f9('0x4d'),'value':_0x49ffbf[_0x47f9('0x4d')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x7]?_0x49ffbf[_0x47f9('0x3b')][0x7]['value']:undefined)||''},{'name':_0x47f9('0x4e'),'value':_0x49ffbf[_0x47f9('0x4e')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x8]?_0x49ffbf[_0x47f9('0x3b')][0x8][_0x47f9('0x42')]:undefined)||''},{'name':_0x47f9('0x55'),'value':_0x49ffbf[_0x47f9('0x55')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x9]?_0x49ffbf['attrs'][0x9][_0x47f9('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x49ffbf['attrChatWebsites']||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0xa]?_0x49ffbf[_0x47f9('0x3b')][0xa][_0x47f9('0x42')]:undefined)||''}];case _0x47f9('0x56'):return[{'name':_0x47f9('0x57'),'type':_0x49ffbf[_0x47f9('0x58')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x0]?_0x49ffbf[_0x47f9('0x3b')][0x0][_0x47f9('0x59')]:undefined)||null,'value':_0x49ffbf[_0x47f9('0x57')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf['attrs'][0x0]?_0x49ffbf[_0x47f9('0x3b')][0x0][_0x47f9('0x42')]:undefined)||null},{'name':_0x47f9('0x5a'),'value':_0x49ffbf[_0x47f9('0x5a')]||(_0x49ffbf[_0x47f9('0x3b')]&&_0x49ffbf[_0x47f9('0x3b')][0x1]?_0x49ffbf[_0x47f9('0x3b')][0x1][_0x47f9('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x578ee5){logger['error'](_0x47f9('0x5b'),JSON[_0x47f9('0x5c')](_0x578ee5));return[];}}exports[_0x47f9('0x5d')]=function(_0x250aa1,_0x38a1ff){if(_0x250aa1[_0x47f9('0x5e')]){_0x250aa1[_0x47f9('0x5e')][_0x47f9('0x3b')]=widgetAttributes(_0x250aa1['body']);}return db['DashboardItem'][_0x47f9('0x5d')](_0x250aa1[_0x47f9('0x5e')],{})['then'](respondWithResult(_0x38a1ff,0xc9))[_0x47f9('0x38')](handleError(_0x38a1ff,null));};exports[_0x47f9('0x5f')]=function(_0x50838b,_0x27a942){if(_0x50838b['body']['id']){delete _0x50838b[_0x47f9('0x5e')]['id'];}_0x50838b[_0x47f9('0x5e')][_0x47f9('0x3b')]=widgetAttributes(_0x50838b[_0x47f9('0x5e')]);return db['DashboardItem'][_0x47f9('0x37')]({'where':{'id':_0x50838b[_0x47f9('0x60')]['id']}})[_0x47f9('0x28')](handleEntityNotFound(_0x27a942,null))[_0x47f9('0x28')](saveUpdates(_0x50838b[_0x47f9('0x5e')],null))[_0x47f9('0x28')](respondWithResult(_0x27a942,null))[_0x47f9('0x38')](handleError(_0x27a942,null));}; \ No newline at end of file +var _0xf8af=['https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','create','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','error','stack','send','show','params','model','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','type','attrUrl','attrs'];(function(_0x5b7551,_0x4fe085){var _0x4b0966=function(_0x118c32){while(--_0x118c32){_0x5b7551['push'](_0x5b7551['shift']());}};_0x4b0966(++_0x4fe085);}(_0xf8af,0x8b));var _0xff8a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf8af[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var jsonpatch=require(_0xff8a('0x2'));var rp=require(_0xff8a('0x3'));var moment=require(_0xff8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff8a('0x5'));var util=require(_0xff8a('0x6'));var path=require(_0xff8a('0x7'));var sox=require(_0xff8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8a('0x9'));var _=require('lodash');var squel=require(_0xff8a('0xa'));var crypto=require(_0xff8a('0xb'));var jsforce=require(_0xff8a('0xc'));var deskjs=require(_0xff8a('0xd'));var toCsv=require(_0xff8a('0xe'));var querystring=require(_0xff8a('0xf'));var Papa=require(_0xff8a('0x10'));var Redis=require(_0xff8a('0x11'));var authService=require(_0xff8a('0x12'));var qs=require(_0xff8a('0x13'));var as=require(_0xff8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8a('0x15'))(_0xff8a('0x16'));var utils=require(_0xff8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff8a('0x18'));var db=require(_0xff8a('0x19'))['db'];config[_0xff8a('0x1a')]=_[_0xff8a('0x1b')](config[_0xff8a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff8a('0x1c'))(new Redis(config[_0xff8a('0x1a')]));require(_0xff8a('0x1d'))[_0xff8a('0x1e')](socket);function respondWithStatusCode(_0x5d793b,_0x5a17f8){_0x5a17f8=_0x5a17f8||0xcc;return function(_0x559371){if(_0x559371){return _0x5d793b['sendStatus'](_0x5a17f8);}return _0x5d793b[_0xff8a('0x1f')](_0x5a17f8)['end']();};}function respondWithResult(_0x279441,_0x2917a7){_0x2917a7=_0x2917a7||0xc8;return function(_0x4e98b0){if(_0x4e98b0){return _0x279441[_0xff8a('0x1f')](_0x2917a7)['json'](_0x4e98b0);}};}function respondWithFilteredResult(_0x5ed382,_0x392f43){return function(_0x68524a){if(_0x68524a){var _0x124cb9=typeof _0x392f43['offset']===_0xff8a('0x20')&&typeof _0x392f43['limit']===_0xff8a('0x20');var _0x4bb5ec=_0x68524a[_0xff8a('0x21')];var _0x1b4272=_0x124cb9?0x0:_0x392f43[_0xff8a('0x22')];var _0xdb1027=_0x124cb9?_0x68524a[_0xff8a('0x21')]:_0x392f43[_0xff8a('0x22')]+_0x392f43[_0xff8a('0x23')];var _0x1ba1f1;if(_0xdb1027>=_0x4bb5ec){_0xdb1027=_0x4bb5ec;_0x1ba1f1=0xc8;}else{_0x1ba1f1=0xce;}_0x5ed382[_0xff8a('0x1f')](_0x1ba1f1);return _0x5ed382[_0xff8a('0x24')](_0xff8a('0x25'),_0x1b4272+'-'+_0xdb1027+'/'+_0x4bb5ec)[_0xff8a('0x26')](_0x68524a);}return null;};}function patchUpdates(_0x3bb4ac){return function(_0x1d9a9b){try{jsonpatch[_0xff8a('0x27')](_0x1d9a9b,_0x3bb4ac,!![]);}catch(_0x5e7897){return BPromise[_0xff8a('0x28')](_0x5e7897);}return _0x1d9a9b[_0xff8a('0x29')]();};}function saveUpdates(_0x2d6d8f,_0x303050){return function(_0x518d33){if(_0x518d33){return _0x518d33[_0xff8a('0x2a')](_0x2d6d8f)['then'](function(_0x1c9ecc){return _0x1c9ecc;});}return null;};}function removeEntity(_0x3f03ce,_0x2c67c2){return function(_0x3fdce3){if(_0x3fdce3){return _0x3fdce3[_0xff8a('0x2b')]()['then'](function(){_0x3f03ce[_0xff8a('0x1f')](0xcc)[_0xff8a('0x2c')]();});}};}function handleEntityNotFound(_0x3063b1,_0x5153f6){return function(_0x2458a0){if(!_0x2458a0){_0x3063b1[_0xff8a('0x2d')](0x194);}return _0x2458a0;};}function handleError(_0x30c36f,_0x2d69d2){_0x2d69d2=_0x2d69d2||0x1f4;return function(_0x38188f){logger[_0xff8a('0x2e')](_0x38188f[_0xff8a('0x2f')]);if(_0x38188f['name']){delete _0x38188f['name'];}_0x30c36f[_0xff8a('0x1f')](_0x2d69d2)[_0xff8a('0x30')](_0x38188f);};}exports[_0xff8a('0x31')]=function(_0x279347,_0x430cbd){var _0x184254={'raw':![],'where':{'id':_0x279347[_0xff8a('0x32')]['id']}},_0x50cb0f={};_0x50cb0f[_0xff8a('0x33')]=_['keys'](db[_0xff8a('0x34')][_0xff8a('0x35')]);_0x50cb0f[_0xff8a('0x36')]=_['keys'](_0x279347[_0xff8a('0x36')]);_0x50cb0f[_0xff8a('0x37')]=_['intersection'](_0x50cb0f[_0xff8a('0x33')],_0x50cb0f[_0xff8a('0x36')]);_0x184254[_0xff8a('0x38')]=_[_0xff8a('0x39')](_0x50cb0f[_0xff8a('0x33')],qs[_0xff8a('0x3a')](_0x279347[_0xff8a('0x36')][_0xff8a('0x3a')]));_0x184254[_0xff8a('0x38')]=_0x184254['attributes'][_0xff8a('0x3b')]?_0x184254[_0xff8a('0x38')]:_0x50cb0f['model'];if(_0x279347[_0xff8a('0x36')][_0xff8a('0x3c')]){_0x184254[_0xff8a('0x3d')]=[{'all':!![]}];}_0x184254=_[_0xff8a('0x3e')]({},_0x184254,_0x279347[_0xff8a('0x3f')]);return db[_0xff8a('0x34')][_0xff8a('0x40')](_0x184254)[_0xff8a('0x41')](handleEntityNotFound(_0x430cbd,null))[_0xff8a('0x41')](respondWithResult(_0x430cbd,null))['catch'](handleError(_0x430cbd,null));};exports['destroy']=function(_0x15a96b,_0x3f58a4){return db['DashboardItem'][_0xff8a('0x40')]({'where':{'id':_0x15a96b[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f58a4,null))['then'](removeEntity(_0x3f58a4,null))['catch'](handleError(_0x3f58a4,null));};function widgetAttributes(_0x2fd75f){try{switch(_0x2fd75f[_0xff8a('0x42')]){case'iframe':return[{'name':_0xff8a('0x43'),'value':_0x2fd75f[_0xff8a('0x43')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['value']:undefined)||_0xff8a('0x45')}];case _0xff8a('0x46'):return[{'name':'attrPath','value':_0x2fd75f[_0xff8a('0x47')]||(_0x2fd75f['attrs']&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x49'):return[{'name':_0xff8a('0x4a'),'value':_0x2fd75f[_0xff8a('0x4a')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x4b')},{'name':_0xff8a('0x4c'),'value':_0x2fd75f[_0xff8a('0x4c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||_0xff8a('0x4d')},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0xc}];case _0xff8a('0x4f'):return[{'name':_0xff8a('0x50'),'value':_0x2fd75f['attrMetric']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||[]},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0x14},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3][_0xff8a('0x48')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f[_0xff8a('0x57')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f[_0xff8a('0x44')][0x8][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x5a'):case _0xff8a('0x5b'):return[{'name':'attrSerie1','value':_0x2fd75f[_0xff8a('0x5c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x5d'),'value':_0x2fd75f[_0xff8a('0x5d')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x5e'),'value':_0x2fd75f[_0xff8a('0x5e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3]['value']:undefined)||[]},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4][_0xff8a('0x48')]:undefined)||_0xff8a('0x5f')},{'name':_0xff8a('0x54'),'value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f['attrOpenchannelAccounts']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f['attrs'][0x8]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9]['value']:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0xa]?_0x2fd75f['attrs'][0xa][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x60'):return[{'name':_0xff8a('0x61'),'type':_0x2fd75f[_0xff8a('0x62')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['type']:undefined)||null,'value':_0x2fd75f[_0xff8a('0x61')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x63'),'value':_0x2fd75f[_0xff8a('0x63')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5acf87){logger[_0xff8a('0x2e')](_0xff8a('0x64'),JSON['stringify'](_0x5acf87));return[];}}exports['create']=function(_0x40e4ee,_0x4ddc06){if(_0x40e4ee[_0xff8a('0x65')]){_0x40e4ee[_0xff8a('0x65')][_0xff8a('0x44')]=widgetAttributes(_0x40e4ee[_0xff8a('0x65')]);}return db[_0xff8a('0x34')][_0xff8a('0x66')](_0x40e4ee[_0xff8a('0x65')],{})[_0xff8a('0x41')](respondWithResult(_0x4ddc06,0xc9))[_0xff8a('0x67')](handleError(_0x4ddc06,null));};exports[_0xff8a('0x2a')]=function(_0x182026,_0x48d8e7){if(_0x182026[_0xff8a('0x65')]['id']){delete _0x182026[_0xff8a('0x65')]['id'];}_0x182026[_0xff8a('0x65')]['attrs']=widgetAttributes(_0x182026[_0xff8a('0x65')]);return db[_0xff8a('0x34')]['find']({'where':{'id':_0x182026[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x48d8e7,null))[_0xff8a('0x41')](saveUpdates(_0x182026[_0xff8a('0x65')],null))[_0xff8a('0x41')](respondWithResult(_0x48d8e7,null))[_0xff8a('0x67')](handleError(_0x48d8e7,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 3f59bb2..9ce5a63 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 _0xa283=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5acb94,_0x389dbc){var _0x11800a=function(_0xd36856){while(--_0xd36856){_0x5acb94['push'](_0x5acb94['shift']());}};_0x11800a(++_0x389dbc);}(_0xa283,0x8e));var _0x3a28=function(_0x4bbbf0,_0x2c1d38){_0x4bbbf0=_0x4bbbf0-0x0;var _0x198776=_0xa283[_0x4bbbf0];return _0x198776;};'use strict';var EventEmitter=require(_0x3a28('0x0'));var DashboardItem=require(_0x3a28('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3a28('0x2')](0x0);var events={'afterCreate':_0x3a28('0x3'),'afterUpdate':_0x3a28('0x4'),'afterDestroy':_0x3a28('0x5')};function emitEvent(_0x37e90d){return function(_0x38d6b6,_0x5baf73,_0x275748){DashboardItemEvents[_0x3a28('0x6')](_0x37e90d+':'+_0x38d6b6['id'],_0x38d6b6);DashboardItemEvents['emit'](_0x37e90d,_0x38d6b6);_0x275748(null);};}for(var e in events){if(events[_0x3a28('0x7')](e)){var event=events[e];DashboardItem[_0x3a28('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xd8cc=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8cc,0x1e1));var _0xcd8c=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xd8cc[_0x22f85a];return _0xaa717;};'use strict';var EventEmitter=require(_0xcd8c('0x0'));var DashboardItem=require(_0xcd8c('0x1'))['db'][_0xcd8c('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xcd8c('0x3')](0x0);var events={'afterCreate':_0xcd8c('0x4'),'afterUpdate':_0xcd8c('0x5'),'afterDestroy':_0xcd8c('0x6')};function emitEvent(_0x1510fc){return function(_0x32543a,_0x1893e4,_0x1e4fb8){DashboardItemEvents['emit'](_0x1510fc+':'+_0x32543a['id'],_0x32543a);DashboardItemEvents[_0xcd8c('0x7')](_0x1510fc,_0x32543a);_0x1e4fb8(null);};}for(var e in events){if(events[_0xcd8c('0x8')](e)){var event=events[e];DashboardItem[_0xcd8c('0x9')](e,emitEvent(event));}}module[_0xcd8c('0xa')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index b9c0378..9bb29fc 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 _0x62dd=['exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x62dd,0x6c));var _0xd62d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x62dd[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xd62d('0x0'));var util=require(_0xd62d('0x1'));var logger=require(_0xd62d('0x2'))(_0xd62d('0x3'));var moment=require(_0xd62d('0x4'));var BPromise=require('bluebird');var rp=require(_0xd62d('0x5'));var fs=require('fs');var path=require(_0xd62d('0x6'));var rimraf=require(_0xd62d('0x7'));var config=require(_0xd62d('0x8'));var attributes=require('./dashboardItem.attributes');module[_0xd62d('0x9')]=function(_0x5326fa,_0x11adaf){return _0x5326fa[_0xd62d('0xa')](_0xd62d('0xb'),attributes,{'tableName':_0xd62d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda37=['DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x44dbc2,_0x3cd713){var _0x1027f0=function(_0x52414e){while(--_0x52414e){_0x44dbc2['push'](_0x44dbc2['shift']());}};_0x1027f0(++_0x3cd713);}(_0xda37,0x18a));var _0x7da3=function(_0x51b2ef,_0xa30b94){_0x51b2ef=_0x51b2ef-0x0;var _0x3bc89a=_0xda37[_0x51b2ef];return _0x3bc89a;};'use strict';var _=require(_0x7da3('0x0'));var util=require(_0x7da3('0x1'));var logger=require(_0x7da3('0x2'))(_0x7da3('0x3'));var moment=require(_0x7da3('0x4'));var BPromise=require(_0x7da3('0x5'));var rp=require(_0x7da3('0x6'));var fs=require('fs');var path=require(_0x7da3('0x7'));var rimraf=require(_0x7da3('0x8'));var config=require(_0x7da3('0x9'));var attributes=require('./dashboardItem.attributes');module[_0x7da3('0xa')]=function(_0x57df4f,_0x1662f6){return _0x57df4f[_0x7da3('0xb')](_0x7da3('0xc'),attributes,{'tableName':_0x7da3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index a07f555..b8711ab 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 _0x999d=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2500ae,_0x27b769){var _0x2709d9=function(_0x4f1c52){while(--_0x4f1c52){_0x2500ae['push'](_0x2500ae['shift']());}};_0x2709d9(++_0x27b769);}(_0x999d,0x1bc));var _0xd999=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x999d[_0x160248];return _0x4e589d;};'use strict';var _=require(_0xd999('0x0'));var util=require(_0xd999('0x1'));var moment=require(_0xd999('0x2'));var BPromise=require(_0xd999('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd999('0x4'));var db=require(_0xd999('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd999('0x6'))('rpc');var config=require(_0xd999('0x7'));var jayson=require(_0xd999('0x8'));var client=jayson[_0xd999('0x9')][_0xd999('0xa')]({'port':0x232a});config[_0xd999('0xb')]=_[_0xd999('0xc')](config[_0xd999('0xb')],{'host':_0xd999('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd999('0xb')]));require('./dashboardItem.socket')[_0xd999('0xe')](socket);function respondWithRpcPromise(_0x45d21f,_0x1922cd,_0x2edb63){return new BPromise(function(_0x28be9b,_0x5e23db){return client[_0xd999('0xf')](_0x45d21f,_0x2edb63)[_0xd999('0x10')](function(_0x128aa3){logger[_0xd999('0x11')]('DashboardItem,\x20%s,\x20%s',_0x1922cd,_0xd999('0x12'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x1922cd,'request\x20sent',JSON[_0xd999('0x13')](_0x128aa3));if(_0x128aa3[_0xd999('0x14')]){if(_0x128aa3[_0xd999('0x14')][_0xd999('0x15')]===0x1f4){logger[_0xd999('0x14')](_0xd999('0x16'),_0x1922cd,_0x128aa3[_0xd999('0x14')]['message']);return _0x5e23db(_0x128aa3[_0xd999('0x14')]['message']);}logger[_0xd999('0x14')](_0xd999('0x16'),_0x1922cd,_0x128aa3[_0xd999('0x14')][_0xd999('0x17')]);return _0x28be9b(_0x128aa3['error'][_0xd999('0x17')]);}else{logger[_0xd999('0x11')]('DashboardItem,\x20%s,\x20%s',_0x1922cd,'request\x20sent');_0x28be9b(_0x128aa3[_0xd999('0x18')][_0xd999('0x17')]);}})['catch'](function(_0x4cce5e){logger[_0xd999('0x14')]('DashboardItem,\x20%s,\x20%s',_0x1922cd,_0x4cce5e);_0x5e23db(_0x4cce5e);});});} \ No newline at end of file +var _0xe1ea=['defaults','socket.io-emitter','./dashboardItem.socket','register','request','info','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','DashboardItem,\x20%s,\x20%s','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe1ea,0x80));var _0xae1e=function(_0x56a78c,_0x520193){_0x56a78c=_0x56a78c-0x0;var _0x22d3ed=_0xe1ea[_0x56a78c];return _0x22d3ed;};'use strict';var _=require(_0xae1e('0x0'));var util=require('util');var moment=require(_0xae1e('0x1'));var BPromise=require('bluebird');var rs=require(_0xae1e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae1e('0x3'))['db'];var utils=require(_0xae1e('0x4'));var logger=require(_0xae1e('0x5'))('rpc');var config=require(_0xae1e('0x6'));var jayson=require(_0xae1e('0x7'));var client=jayson[_0xae1e('0x8')]['http']({'port':0x232a});config[_0xae1e('0x9')]=_[_0xae1e('0xa')](config[_0xae1e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xae1e('0xb'))(new Redis(config[_0xae1e('0x9')]));require(_0xae1e('0xc'))[_0xae1e('0xd')](socket);function respondWithRpcPromise(_0x225de4,_0x58fac0,_0x4c051b){return new BPromise(function(_0x5637a6,_0x593305){return client[_0xae1e('0xe')](_0x225de4,_0x4c051b)['then'](function(_0x165c2f){logger[_0xae1e('0xf')]('DashboardItem,\x20%s,\x20%s',_0x58fac0,_0xae1e('0x10'));logger['debug'](_0xae1e('0x11'),_0x58fac0,_0xae1e('0x10'),JSON[_0xae1e('0x12')](_0x165c2f));if(_0x165c2f[_0xae1e('0x13')]){if(_0x165c2f[_0xae1e('0x13')]['code']===0x1f4){logger[_0xae1e('0x13')](_0xae1e('0x14'),_0x58fac0,_0x165c2f[_0xae1e('0x13')][_0xae1e('0x15')]);return _0x593305(_0x165c2f[_0xae1e('0x13')][_0xae1e('0x15')]);}logger[_0xae1e('0x13')](_0xae1e('0x14'),_0x58fac0,_0x165c2f[_0xae1e('0x13')][_0xae1e('0x15')]);return _0x5637a6(_0x165c2f[_0xae1e('0x13')][_0xae1e('0x15')]);}else{logger[_0xae1e('0xf')](_0xae1e('0x14'),_0x58fac0,'request\x20sent');_0x5637a6(_0x165c2f[_0xae1e('0x16')][_0xae1e('0x15')]);}})['catch'](function(_0x20bb94){logger[_0xae1e('0x13')](_0xae1e('0x14'),_0x58fac0,_0x20bb94);_0x593305(_0x20bb94);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 7808e69..0dae6cf 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 _0x836e=['removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove','emit'];(function(_0x152a15,_0xc2eeb6){var _0x458411=function(_0x633cb2){while(--_0x633cb2){_0x152a15['push'](_0x152a15['shift']());}};_0x458411(++_0xc2eeb6);}(_0x836e,0x94));var _0xe836=function(_0x191f9d,_0x21976f){_0x191f9d=_0x191f9d-0x0;var _0x58e60d=_0x836e[_0x191f9d];return _0x58e60d;};'use strict';var DashboardItemEvents=require(_0xe836('0x0'));var events=[_0xe836('0x1'),_0xe836('0x2'),'update'];function createListener(_0x5d3165,_0x3a6167){return function(_0x5bbb05){_0x3a6167[_0xe836('0x3')](_0x5d3165,_0x5bbb05);};}function removeListener(_0x2f5a49,_0x2295ad){return function(){DashboardItemEvents[_0xe836('0x4')](_0x2f5a49,_0x2295ad);};}exports[_0xe836('0x5')]=function(_0x4ebffb){for(var _0x32c7a3=0x0,_0x31b18f=events[_0xe836('0x6')];_0x32c7a3<_0x31b18f;_0x32c7a3++){var _0x49ffc5=events[_0x32c7a3];var _0x310ead=createListener(_0xe836('0x7')+_0x49ffc5,_0x4ebffb);DashboardItemEvents['on'](_0x49ffc5,_0x310ead);}}; \ No newline at end of file +var _0xea43=['emit','register','length','./dashboardItem.events','save','remove','update'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xea43,0xf8));var _0x3ea4=function(_0x51816e,_0x2a63fc){_0x51816e=_0x51816e-0x0;var _0x15e09d=_0xea43[_0x51816e];return _0x15e09d;};'use strict';var DashboardItemEvents=require(_0x3ea4('0x0'));var events=[_0x3ea4('0x1'),_0x3ea4('0x2'),_0x3ea4('0x3')];function createListener(_0x4a5246,_0x8e6366){return function(_0x1c2b99){_0x8e6366[_0x3ea4('0x4')](_0x4a5246,_0x1c2b99);};}function removeListener(_0x1379f7,_0x3ddeff){return function(){DashboardItemEvents['removeListener'](_0x1379f7,_0x3ddeff);};}exports[_0x3ea4('0x5')]=function(_0x1e58ca){for(var _0x4225c6=0x0,_0x4f61e3=events[_0x3ea4('0x6')];_0x4225c6<_0x4f61e3;_0x4225c6++){var _0x2111c5=events[_0x4225c6];var _0x95663d=createListener('dashboardItem:'+_0x2111c5,_0x1e58ca);DashboardItemEvents['on'](_0x2111c5,_0x95663d);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 720e8e6..121c29e 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 _0x8e78=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','/:id','isAuthenticated','post'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x8e78,0xf1));var _0x88e7=function(_0x42dc47,_0x6dc893){_0x42dc47=_0x42dc47-0x0;var _0x3edce7=_0x8e78[_0x42dc47];return _0x3edce7;};'use strict';var multer=require(_0x88e7('0x0'));var util=require(_0x88e7('0x1'));var path=require(_0x88e7('0x2'));var timeout=require(_0x88e7('0x3'));var express=require(_0x88e7('0x4'));var router=express[_0x88e7('0x5')]();var fs_extra=require(_0x88e7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x88e7('0x7'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router['get'](_0x88e7('0x8'),auth[_0x88e7('0x9')](),controller['show']);router[_0x88e7('0xa')]('/',auth[_0x88e7('0x9')](),controller['create']);router['put'](_0x88e7('0x8'),auth[_0x88e7('0x9')](),controller[_0x88e7('0xb')]);router[_0x88e7('0xc')](_0x88e7('0x8'),auth[_0x88e7('0x9')](),controller[_0x88e7('0xd')]);module['exports']=router; \ No newline at end of file +var _0x0c22=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','post','isAuthenticated','put','/:id','delete','exports','util'];(function(_0x391df0,_0x51b2dc){var _0x30bec6=function(_0x2899b1){while(--_0x2899b1){_0x391df0['push'](_0x391df0['shift']());}};_0x30bec6(++_0x51b2dc);}(_0x0c22,0x18f));var _0x20c2=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0c22[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x20c2('0x0'));var path=require('path');var timeout=require(_0x20c2('0x1'));var express=require(_0x20c2('0x2'));var router=express[_0x20c2('0x3')]();var fs_extra=require(_0x20c2('0x4'));var auth=require(_0x20c2('0x5'));var interaction=require(_0x20c2('0x6'));var config=require(_0x20c2('0x7'));var controller=require(_0x20c2('0x8'));router[_0x20c2('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x20c2('0xa')]('/',auth[_0x20c2('0xb')](),controller['create']);router[_0x20c2('0xc')](_0x20c2('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x20c2('0xe')](_0x20c2('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x20c2('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index e52df47..82fa4a0 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 _0xe939=['third','sequelize','exports','STRING','ENUM','first','second'];(function(_0x229764,_0x3687f1){var _0x143dea=function(_0x473a68){while(--_0x473a68){_0x229764['push'](_0x229764['shift']());}};_0x143dea(++_0x3687f1);}(_0xe939,0x174));var _0x9e93=function(_0x5355d2,_0x5421bb){_0x5355d2=_0x5355d2-0x0;var _0x2c0b72=_0xe939[_0x5355d2];return _0x2c0b72;};'use strict';var Sequelize=require(_0x9e93('0x0'));module[_0x9e93('0x1')]={'name':{'type':Sequelize[_0x9e93('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x9e93('0x3')](_0x9e93('0x4'),_0x9e93('0x5'),_0x9e93('0x6')),'allowNull':![],'defaultValue':_0x9e93('0x4')},'description':{'type':Sequelize[_0x9e93('0x2')]}}; \ No newline at end of file +var _0xf695=['third','exports','STRING','first','second'];(function(_0x1a57d1,_0x4281ff){var _0x394876=function(_0x268ec9){while(--_0x268ec9){_0x1a57d1['push'](_0x1a57d1['shift']());}};_0x394876(++_0x4281ff);}(_0xf695,0xbf));var _0x5f69=function(_0x2eaf60,_0x58a19b){_0x2eaf60=_0x2eaf60-0x0;var _0x574e6f=_0xf695[_0x2eaf60];return _0x574e6f;};'use strict';var Sequelize=require('sequelize');module[_0x5f69('0x0')]={'name':{'type':Sequelize[_0x5f69('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x5f69('0x2'),_0x5f69('0x3'),_0x5f69('0x4')),'allowNull':![],'defaultValue':_0x5f69('0x2')},'description':{'type':Sequelize[_0x5f69('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 42b406a..d2d7cb0 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 _0x7ae8=['path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','Disposition','includeAll','include','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x7ae8,0x142));var _0x87ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ae8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87ae('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87ae('0x1'));var rp=require(_0x87ae('0x2'));var moment=require(_0x87ae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x87ae('0x4'));var util=require(_0x87ae('0x5'));var path=require(_0x87ae('0x6'));var sox=require(_0x87ae('0x7'));var csv=require(_0x87ae('0x8'));var ejs=require(_0x87ae('0x9'));var fs=require('fs');var fs_extra=require(_0x87ae('0xa'));var _=require(_0x87ae('0xb'));var squel=require(_0x87ae('0xc'));var crypto=require('crypto');var jsforce=require(_0x87ae('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x87ae('0x8'));var querystring=require(_0x87ae('0xe'));var Papa=require(_0x87ae('0xf'));var Redis=require(_0x87ae('0x10'));var authService=require(_0x87ae('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x87ae('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x87ae('0x13'))(_0x87ae('0x14'));var utils=require('../../config/utils');var config=require(_0x87ae('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x87ae('0x16'))['db'];function respondWithStatusCode(_0x38c766,_0x1c3e11){_0x1c3e11=_0x1c3e11||0xcc;return function(_0x199256){if(_0x199256){return _0x38c766[_0x87ae('0x17')](_0x1c3e11);}return _0x38c766[_0x87ae('0x18')](_0x1c3e11)['end']();};}function respondWithResult(_0x479f9c,_0x3b4daa){_0x3b4daa=_0x3b4daa||0xc8;return function(_0x540b5f){if(_0x540b5f){return _0x479f9c['status'](_0x3b4daa)['json'](_0x540b5f);}};}function respondWithFilteredResult(_0x2404ba,_0x4046e2){return function(_0x82332e){if(_0x82332e){var _0xc36cba=typeof _0x4046e2['offset']===_0x87ae('0x19')&&typeof _0x4046e2[_0x87ae('0x1a')]==='undefined';var _0x4a425a=_0x82332e[_0x87ae('0x1b')];var _0x2399f7=_0xc36cba?0x0:_0x4046e2[_0x87ae('0x1c')];var _0x1a0729=_0xc36cba?_0x82332e['count']:_0x4046e2['offset']+_0x4046e2[_0x87ae('0x1a')];var _0x32d45e;if(_0x1a0729>=_0x4a425a){_0x1a0729=_0x4a425a;_0x32d45e=0xc8;}else{_0x32d45e=0xce;}_0x2404ba['status'](_0x32d45e);return _0x2404ba['set'](_0x87ae('0x1d'),_0x2399f7+'-'+_0x1a0729+'/'+_0x4a425a)[_0x87ae('0x1e')](_0x82332e);}return null;};}function patchUpdates(_0x480235){return function(_0x138959){try{jsonpatch[_0x87ae('0x1f')](_0x138959,_0x480235,!![]);}catch(_0x1e82ef){return BPromise[_0x87ae('0x20')](_0x1e82ef);}return _0x138959[_0x87ae('0x21')]();};}function saveUpdates(_0x599eef,_0x1fb584){return function(_0xfc4d1b){if(_0xfc4d1b){return _0xfc4d1b[_0x87ae('0x22')](_0x599eef)[_0x87ae('0x23')](function(_0x38f31a){return _0x38f31a;});}return null;};}function removeEntity(_0x18e9d8,_0x245cd7){return function(_0x2991da){if(_0x2991da){return _0x2991da[_0x87ae('0x24')]()[_0x87ae('0x23')](function(){var _0x5a97a0=_0x2991da[_0x87ae('0x25')]({'plain':!![]});var _0xdf9dc9=_0x87ae('0x26');return db[_0x87ae('0x27')][_0x87ae('0x24')]({'where':{'type':_0xdf9dc9,'resourceId':_0x5a97a0['id']}})[_0x87ae('0x23')](function(){return _0x2991da;});})[_0x87ae('0x23')](function(){_0x18e9d8[_0x87ae('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c09cf,_0x3e66db){return function(_0x56c4c1){if(!_0x56c4c1){_0x2c09cf['sendStatus'](0x194);}return _0x56c4c1;};}function handleError(_0x32e4a7,_0x40830a){_0x40830a=_0x40830a||0x1f4;return function(_0xfadb67){logger[_0x87ae('0x28')](_0xfadb67[_0x87ae('0x29')]);if(_0xfadb67[_0x87ae('0x2a')]){delete _0xfadb67[_0x87ae('0x2a')];}_0x32e4a7['status'](_0x40830a)['send'](_0xfadb67);};}exports[_0x87ae('0x2b')]=function(_0x367392,_0x18b479){var _0x25b49d={},_0x177e9b={},_0x5a9cb8={'count':0x0,'rows':[]};var _0x3828=_[_0x87ae('0x2c')](db['Disposition'][_0x87ae('0x2d')],function(_0x19c390){return{'name':_0x19c390[_0x87ae('0x2e')],'type':_0x19c390[_0x87ae('0x2f')][_0x87ae('0x30')]};});_0x177e9b[_0x87ae('0x31')]=_['map'](_0x3828,_0x87ae('0x2a'));_0x177e9b[_0x87ae('0x32')]=_[_0x87ae('0x33')](_0x367392[_0x87ae('0x32')]);_0x177e9b['filters']=_[_0x87ae('0x34')](_0x177e9b[_0x87ae('0x31')],_0x177e9b[_0x87ae('0x32')]);_0x25b49d['attributes']=_[_0x87ae('0x34')](_0x177e9b[_0x87ae('0x31')],qs['fields'](_0x367392['query']['fields']));_0x25b49d[_0x87ae('0x35')]=_0x25b49d[_0x87ae('0x35')][_0x87ae('0x36')]?_0x25b49d[_0x87ae('0x35')]:_0x177e9b[_0x87ae('0x31')];if(!_0x367392[_0x87ae('0x32')][_0x87ae('0x37')](_0x87ae('0x38'))){_0x25b49d[_0x87ae('0x1a')]=qs[_0x87ae('0x1a')](_0x367392[_0x87ae('0x32')]['limit']);_0x25b49d[_0x87ae('0x1c')]=qs[_0x87ae('0x1c')](_0x367392[_0x87ae('0x32')][_0x87ae('0x1c')]);}_0x25b49d[_0x87ae('0x39')]=qs['sort'](_0x367392[_0x87ae('0x32')][_0x87ae('0x3a')]);_0x25b49d[_0x87ae('0x3b')]=qs['filters'](_[_0x87ae('0x3c')](_0x367392[_0x87ae('0x32')],_0x177e9b[_0x87ae('0x3d')]),_0x3828);if(_0x367392['query']['filter']){_0x25b49d[_0x87ae('0x3b')]=_[_0x87ae('0x3e')](_0x25b49d['where'],{'$or':_[_0x87ae('0x2c')](_0x3828,function(_0x5bda49){if(_0x5bda49[_0x87ae('0x2f')]!==_0x87ae('0x3f')){var _0x2d264f={};_0x2d264f[_0x5bda49[_0x87ae('0x2a')]]={'$like':'%'+_0x367392[_0x87ae('0x32')][_0x87ae('0x40')]+'%'};return _0x2d264f;}})});}_0x25b49d=_[_0x87ae('0x3e')]({},_0x25b49d,_0x367392[_0x87ae('0x41')]);var _0x9a9190={'where':_0x25b49d[_0x87ae('0x3b')]};return db[_0x87ae('0x42')][_0x87ae('0x1b')](_0x9a9190)[_0x87ae('0x23')](function(_0x2b6482){_0x5a9cb8[_0x87ae('0x1b')]=_0x2b6482;if(_0x367392[_0x87ae('0x32')][_0x87ae('0x43')]){_0x25b49d[_0x87ae('0x44')]=[{'all':!![]}];}return db[_0x87ae('0x42')]['findAll'](_0x25b49d);})[_0x87ae('0x23')](function(_0xf15f2c){_0x5a9cb8[_0x87ae('0x45')]=_0xf15f2c;return _0x5a9cb8;})['then'](respondWithFilteredResult(_0x18b479,_0x25b49d))[_0x87ae('0x46')](handleError(_0x18b479,null));};exports[_0x87ae('0x47')]=function(_0x5775d1,_0x4b8323){var _0x5b4ed0={'raw':!![],'where':{'id':_0x5775d1[_0x87ae('0x48')]['id']}},_0x5578cd={};_0x5578cd[_0x87ae('0x31')]=_[_0x87ae('0x33')](db[_0x87ae('0x42')]['rawAttributes']);_0x5578cd[_0x87ae('0x32')]=_['keys'](_0x5775d1[_0x87ae('0x32')]);_0x5578cd[_0x87ae('0x3d')]=_[_0x87ae('0x34')](_0x5578cd[_0x87ae('0x31')],_0x5578cd['query']);_0x5b4ed0[_0x87ae('0x35')]=_[_0x87ae('0x34')](_0x5578cd[_0x87ae('0x31')],qs[_0x87ae('0x49')](_0x5775d1[_0x87ae('0x32')]['fields']));_0x5b4ed0['attributes']=_0x5b4ed0['attributes']['length']?_0x5b4ed0[_0x87ae('0x35')]:_0x5578cd[_0x87ae('0x31')];if(_0x5775d1['query'][_0x87ae('0x43')]){_0x5b4ed0[_0x87ae('0x44')]=[{'all':!![]}];}_0x5b4ed0=_['merge']({},_0x5b4ed0,_0x5775d1['options']);return db[_0x87ae('0x42')][_0x87ae('0x4a')](_0x5b4ed0)[_0x87ae('0x23')](handleEntityNotFound(_0x4b8323,null))[_0x87ae('0x23')](respondWithResult(_0x4b8323,null))[_0x87ae('0x46')](handleError(_0x4b8323,null));};exports[_0x87ae('0x4b')]=function(_0x542d98,_0x4c5c59){return db[_0x87ae('0x42')]['create'](_0x542d98[_0x87ae('0x4c')],{})[_0x87ae('0x23')](function(_0x498ed9){var _0x3c1bcb=_0x542d98[_0x87ae('0x4d')][_0x87ae('0x25')]({'plain':!![]});if(!_0x3c1bcb)throw new Error(_0x87ae('0x4e'));if(_0x3c1bcb[_0x87ae('0x4f')]===_0x87ae('0x4d')){var _0x1ff01c=_0x498ed9[_0x87ae('0x25')]({'plain':!![]});var _0x236afb=_0x87ae('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x236afb,'userProfileId':_0x3c1bcb[_0x87ae('0x50')]},'raw':!![]})[_0x87ae('0x23')](function(_0x3db1ae){if(_0x3db1ae&&_0x3db1ae['autoAssociation']===0x0){return db[_0x87ae('0x27')][_0x87ae('0x4b')]({'name':_0x1ff01c[_0x87ae('0x2a')],'resourceId':_0x1ff01c['id'],'type':_0x3db1ae[_0x87ae('0x2a')],'sectionId':_0x3db1ae['id']},{})[_0x87ae('0x23')](function(){return _0x498ed9;});}else{return _0x498ed9;}})[_0x87ae('0x46')](function(_0x5ca41e){logger[_0x87ae('0x28')](_0x87ae('0x51'),_0x5ca41e);throw _0x5ca41e;});}return _0x498ed9;})['then'](respondWithResult(_0x4c5c59,0xc9))[_0x87ae('0x46')](handleError(_0x4c5c59,null));};exports[_0x87ae('0x22')]=function(_0x51f145,_0x4d18ee){if(_0x51f145[_0x87ae('0x4c')]['id']){delete _0x51f145[_0x87ae('0x4c')]['id'];}return db['Disposition'][_0x87ae('0x4a')]({'where':{'id':_0x51f145[_0x87ae('0x48')]['id']}})[_0x87ae('0x23')](handleEntityNotFound(_0x4d18ee,null))['then'](saveUpdates(_0x51f145[_0x87ae('0x4c')],null))[_0x87ae('0x23')](respondWithResult(_0x4d18ee,null))['catch'](handleError(_0x4d18ee,null));};exports[_0x87ae('0x24')]=function(_0x47e7a5,_0x5aef89){return db['Disposition'][_0x87ae('0x4a')]({'where':{'id':_0x47e7a5[_0x87ae('0x48')]['id']}})[_0x87ae('0x23')](handleEntityNotFound(_0x5aef89,null))[_0x87ae('0x23')](removeEntity(_0x5aef89,null))[_0x87ae('0x46')](handleError(_0x5aef89,null));}; \ No newline at end of file +var _0x757a=['role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','filters','pick','where','VIRTUAL','filter','merge','options','Disposition','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x127f51,_0x259915){var _0x271917=function(_0x3079e1){while(--_0x3079e1){_0x127f51['push'](_0x127f51['shift']());}};_0x271917(++_0x259915);}(_0x757a,0x1af));var _0xa757=function(_0x2b9f2d,_0x56951e){_0x2b9f2d=_0x2b9f2d-0x0;var _0x241666=_0x757a[_0x2b9f2d];return _0x241666;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa757('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require('to-csv');var ejs=require(_0xa757('0x7'));var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require(_0xa757('0xa'));var crypto=require(_0xa757('0xb'));var jsforce=require(_0xa757('0xc'));var deskjs=require(_0xa757('0xd'));var toCsv=require(_0xa757('0xe'));var querystring=require(_0xa757('0xf'));var Papa=require(_0xa757('0x10'));var Redis=require(_0xa757('0x11'));var authService=require(_0xa757('0x12'));var qs=require(_0xa757('0x13'));var as=require(_0xa757('0x14'));var hardwareService=require(_0xa757('0x15'));var logger=require('../../config/logger')(_0xa757('0x16'));var utils=require('../../config/utils');var config=require(_0xa757('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa757('0x18'))['db'];function respondWithStatusCode(_0x1138e4,_0x250d20){_0x250d20=_0x250d20||0xcc;return function(_0x5c38a0){if(_0x5c38a0){return _0x1138e4[_0xa757('0x19')](_0x250d20);}return _0x1138e4[_0xa757('0x1a')](_0x250d20)[_0xa757('0x1b')]();};}function respondWithResult(_0x2fe02e,_0x55b2df){_0x55b2df=_0x55b2df||0xc8;return function(_0x4c0161){if(_0x4c0161){return _0x2fe02e[_0xa757('0x1a')](_0x55b2df)[_0xa757('0x1c')](_0x4c0161);}};}function respondWithFilteredResult(_0x47d0d8,_0x150f8f){return function(_0x10de98){if(_0x10de98){var _0x3e13f9=typeof _0x150f8f[_0xa757('0x1d')]===_0xa757('0x1e')&&typeof _0x150f8f['limit']===_0xa757('0x1e');var _0x26727d=_0x10de98[_0xa757('0x1f')];var _0x57431b=_0x3e13f9?0x0:_0x150f8f[_0xa757('0x1d')];var _0x4bfc5f=_0x3e13f9?_0x10de98['count']:_0x150f8f[_0xa757('0x1d')]+_0x150f8f['limit'];var _0xfb2fc9;if(_0x4bfc5f>=_0x26727d){_0x4bfc5f=_0x26727d;_0xfb2fc9=0xc8;}else{_0xfb2fc9=0xce;}_0x47d0d8[_0xa757('0x1a')](_0xfb2fc9);return _0x47d0d8[_0xa757('0x20')](_0xa757('0x21'),_0x57431b+'-'+_0x4bfc5f+'/'+_0x26727d)[_0xa757('0x1c')](_0x10de98);}return null;};}function patchUpdates(_0x2e556b){return function(_0xfb9955){try{jsonpatch['apply'](_0xfb9955,_0x2e556b,!![]);}catch(_0x23ee45){return BPromise[_0xa757('0x22')](_0x23ee45);}return _0xfb9955[_0xa757('0x23')]();};}function saveUpdates(_0x4eb0c2,_0x50494e){return function(_0x2239f9){if(_0x2239f9){return _0x2239f9[_0xa757('0x24')](_0x4eb0c2)[_0xa757('0x25')](function(_0x265b30){return _0x265b30;});}return null;};}function removeEntity(_0x59c9f9,_0x3f37bb){return function(_0x2a3a6e){if(_0x2a3a6e){return _0x2a3a6e['destroy']()['then'](function(){var _0xc8050e=_0x2a3a6e[_0xa757('0x26')]({'plain':!![]});var _0x3a461d=_0xa757('0x27');return db[_0xa757('0x28')][_0xa757('0x29')]({'where':{'type':_0x3a461d,'resourceId':_0xc8050e['id']}})[_0xa757('0x25')](function(){return _0x2a3a6e;});})[_0xa757('0x25')](function(){_0x59c9f9[_0xa757('0x1a')](0xcc)[_0xa757('0x1b')]();});}};}function handleEntityNotFound(_0x41d1ab,_0x5354f7){return function(_0x578224){if(!_0x578224){_0x41d1ab[_0xa757('0x19')](0x194);}return _0x578224;};}function handleError(_0xa291ce,_0x406237){_0x406237=_0x406237||0x1f4;return function(_0x4c4aaf){logger[_0xa757('0x2a')](_0x4c4aaf[_0xa757('0x2b')]);if(_0x4c4aaf[_0xa757('0x2c')]){delete _0x4c4aaf['name'];}_0xa291ce[_0xa757('0x1a')](_0x406237)[_0xa757('0x2d')](_0x4c4aaf);};}exports[_0xa757('0x2e')]=function(_0x2e41ab,_0x4a42ca){var _0x4bc30f={},_0x2f2b81={},_0x23bc6f={'count':0x0,'rows':[]};var _0x1a679e=_[_0xa757('0x2f')](db['Disposition'][_0xa757('0x30')],function(_0x18f732){return{'name':_0x18f732['fieldName'],'type':_0x18f732[_0xa757('0x31')][_0xa757('0x32')]};});_0x2f2b81[_0xa757('0x33')]=_[_0xa757('0x2f')](_0x1a679e,'name');_0x2f2b81[_0xa757('0x34')]=_[_0xa757('0x35')](_0x2e41ab[_0xa757('0x34')]);_0x2f2b81['filters']=_[_0xa757('0x36')](_0x2f2b81[_0xa757('0x33')],_0x2f2b81[_0xa757('0x34')]);_0x4bc30f[_0xa757('0x37')]=_[_0xa757('0x36')](_0x2f2b81[_0xa757('0x33')],qs[_0xa757('0x38')](_0x2e41ab[_0xa757('0x34')][_0xa757('0x38')]));_0x4bc30f['attributes']=_0x4bc30f[_0xa757('0x37')][_0xa757('0x39')]?_0x4bc30f['attributes']:_0x2f2b81[_0xa757('0x33')];if(!_0x2e41ab[_0xa757('0x34')]['hasOwnProperty'](_0xa757('0x3a'))){_0x4bc30f[_0xa757('0x3b')]=qs[_0xa757('0x3b')](_0x2e41ab[_0xa757('0x34')][_0xa757('0x3b')]);_0x4bc30f[_0xa757('0x1d')]=qs[_0xa757('0x1d')](_0x2e41ab[_0xa757('0x34')][_0xa757('0x1d')]);}_0x4bc30f[_0xa757('0x3c')]=qs['sort'](_0x2e41ab['query'][_0xa757('0x3d')]);_0x4bc30f['where']=qs[_0xa757('0x3e')](_[_0xa757('0x3f')](_0x2e41ab['query'],_0x2f2b81[_0xa757('0x3e')]),_0x1a679e);if(_0x2e41ab['query']['filter']){_0x4bc30f['where']=_['merge'](_0x4bc30f[_0xa757('0x40')],{'$or':_[_0xa757('0x2f')](_0x1a679e,function(_0x4a1d20){if(_0x4a1d20[_0xa757('0x31')]!==_0xa757('0x41')){var _0x147838={};_0x147838[_0x4a1d20[_0xa757('0x2c')]]={'$like':'%'+_0x2e41ab[_0xa757('0x34')][_0xa757('0x42')]+'%'};return _0x147838;}})});}_0x4bc30f=_[_0xa757('0x43')]({},_0x4bc30f,_0x2e41ab[_0xa757('0x44')]);var _0x5f55c6={'where':_0x4bc30f['where']};return db[_0xa757('0x45')][_0xa757('0x1f')](_0x5f55c6)[_0xa757('0x25')](function(_0x5c711f){_0x23bc6f[_0xa757('0x1f')]=_0x5c711f;if(_0x2e41ab['query']['includeAll']){_0x4bc30f['include']=[{'all':!![]}];}return db[_0xa757('0x45')][_0xa757('0x46')](_0x4bc30f);})[_0xa757('0x25')](function(_0x36bf0f){_0x23bc6f[_0xa757('0x47')]=_0x36bf0f;return _0x23bc6f;})[_0xa757('0x25')](respondWithFilteredResult(_0x4a42ca,_0x4bc30f))[_0xa757('0x48')](handleError(_0x4a42ca,null));};exports[_0xa757('0x49')]=function(_0x17bc6a,_0x481d11){var _0x4a65c7={'raw':!![],'where':{'id':_0x17bc6a[_0xa757('0x4a')]['id']}},_0x3f71f3={};_0x3f71f3[_0xa757('0x33')]=_[_0xa757('0x35')](db['Disposition'][_0xa757('0x30')]);_0x3f71f3['query']=_[_0xa757('0x35')](_0x17bc6a['query']);_0x3f71f3[_0xa757('0x3e')]=_[_0xa757('0x36')](_0x3f71f3[_0xa757('0x33')],_0x3f71f3[_0xa757('0x34')]);_0x4a65c7['attributes']=_[_0xa757('0x36')](_0x3f71f3[_0xa757('0x33')],qs[_0xa757('0x38')](_0x17bc6a[_0xa757('0x34')]['fields']));_0x4a65c7[_0xa757('0x37')]=_0x4a65c7[_0xa757('0x37')][_0xa757('0x39')]?_0x4a65c7[_0xa757('0x37')]:_0x3f71f3[_0xa757('0x33')];if(_0x17bc6a['query']['includeAll']){_0x4a65c7['include']=[{'all':!![]}];}_0x4a65c7=_['merge']({},_0x4a65c7,_0x17bc6a[_0xa757('0x44')]);return db[_0xa757('0x45')]['find'](_0x4a65c7)['then'](handleEntityNotFound(_0x481d11,null))['then'](respondWithResult(_0x481d11,null))[_0xa757('0x48')](handleError(_0x481d11,null));};exports['create']=function(_0x54efad,_0x35fc3d){return db['Disposition'][_0xa757('0x4b')](_0x54efad[_0xa757('0x4c')],{})[_0xa757('0x25')](function(_0x1085e0){var _0x2ff5f1=_0x54efad[_0xa757('0x4d')][_0xa757('0x26')]({'plain':!![]});if(!_0x2ff5f1)throw new Error(_0xa757('0x4e'));if(_0x2ff5f1[_0xa757('0x4f')]===_0xa757('0x4d')){var _0x30b8eb=_0x1085e0['get']({'plain':!![]});var _0x4f11cd=_0xa757('0x27');return db[_0xa757('0x50')][_0xa757('0x51')]({'where':{'name':_0x4f11cd,'userProfileId':_0x2ff5f1[_0xa757('0x52')]},'raw':!![]})[_0xa757('0x25')](function(_0x30c52c){if(_0x30c52c&&_0x30c52c[_0xa757('0x53')]===0x0){return db[_0xa757('0x28')][_0xa757('0x4b')]({'name':_0x30b8eb[_0xa757('0x2c')],'resourceId':_0x30b8eb['id'],'type':_0x30c52c[_0xa757('0x2c')],'sectionId':_0x30c52c['id']},{})['then'](function(){return _0x1085e0;});}else{return _0x1085e0;}})['catch'](function(_0x259b4c){logger[_0xa757('0x2a')](_0xa757('0x54'),_0x259b4c);throw _0x259b4c;});}return _0x1085e0;})[_0xa757('0x25')](respondWithResult(_0x35fc3d,0xc9))['catch'](handleError(_0x35fc3d,null));};exports[_0xa757('0x24')]=function(_0x55ddbf,_0x3a99ad){if(_0x55ddbf[_0xa757('0x4c')]['id']){delete _0x55ddbf[_0xa757('0x4c')]['id'];}return db['Disposition'][_0xa757('0x51')]({'where':{'id':_0x55ddbf[_0xa757('0x4a')]['id']}})[_0xa757('0x25')](handleEntityNotFound(_0x3a99ad,null))[_0xa757('0x25')](saveUpdates(_0x55ddbf[_0xa757('0x4c')],null))[_0xa757('0x25')](respondWithResult(_0x3a99ad,null))[_0xa757('0x48')](handleError(_0x3a99ad,null));};exports[_0xa757('0x29')]=function(_0x14c1c6,_0x2482f3){return db[_0xa757('0x45')][_0xa757('0x51')]({'where':{'id':_0x14c1c6['params']['id']}})[_0xa757('0x25')](handleEntityNotFound(_0x2482f3,null))[_0xa757('0x25')](removeEntity(_0x2482f3,null))[_0xa757('0x48')](handleError(_0x2482f3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index d320748..7aaeca3 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 _0xa440=['tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','rimraf','./disposition.attributes','exports','define'];(function(_0x6c0833,_0x59e073){var _0x25d75b=function(_0x40833a){while(--_0x40833a){_0x6c0833['push'](_0x6c0833['shift']());}};_0x25d75b(++_0x59e073);}(_0xa440,0x6a));var _0x0a44=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0xa440[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require(_0x0a44('0x0'));var util=require(_0x0a44('0x1'));var logger=require(_0x0a44('0x2'))('api');var moment=require(_0x0a44('0x3'));var BPromise=require(_0x0a44('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0a44('0x5'));var config=require('../../config/environment');var attributes=require(_0x0a44('0x6'));module[_0x0a44('0x7')]=function(_0x261c57,_0x3e0d85){return _0x261c57[_0x0a44('0x8')]('Disposition',attributes,{'tableName':_0x0a44('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x0a44('0xa'),'fields':[_0x0a44('0xb'),_0x0a44('0xc')]},{'unique':!![],'name':_0x0a44('0xd'),'fields':[_0x0a44('0xb'),'ChatWebsiteId']},{'unique':!![],'name':_0x0a44('0xe'),'fields':[_0x0a44('0xb'),_0x0a44('0xf')]},{'unique':!![],'name':_0x0a44('0x10'),'fields':['name',_0x0a44('0x11')]},{'unique':!![],'name':_0x0a44('0x12'),'fields':['name',_0x0a44('0x13')]},{'unique':!![],'name':_0x0a44('0x14'),'fields':['name','OpenchannelAccountId']},{'unique':!![],'name':_0x0a44('0x15'),'fields':[_0x0a44('0xb'),_0x0a44('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x38e8=['Disposition','tools_dispositions','name_voice','name','ChatWebsiteId','name_sms','SmsAccountId','FaxAccountId','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','api','bluebird','request-promise','path','./disposition.attributes','exports','define'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x38e8,0x115));var _0x838e=function(_0x20dc0d,_0x179a0e){_0x20dc0d=_0x20dc0d-0x0;var _0x3fda62=_0x38e8[_0x20dc0d];return _0x3fda62;};'use strict';var _=require(_0x838e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x838e('0x1'));var moment=require('moment');var BPromise=require(_0x838e('0x2'));var rp=require(_0x838e('0x3'));var fs=require('fs');var path=require(_0x838e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x838e('0x5'));module[_0x838e('0x6')]=function(_0x89df25,_0x5f4f32){return _0x89df25[_0x838e('0x7')](_0x838e('0x8'),attributes,{'tableName':_0x838e('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x838e('0xa'),'fields':['name','ListId']},{'unique':!![],'name':'name_chat','fields':[_0x838e('0xb'),_0x838e('0xc')]},{'unique':!![],'name':'name_mail','fields':[_0x838e('0xb'),'MailAccountId']},{'unique':!![],'name':_0x838e('0xd'),'fields':[_0x838e('0xb'),_0x838e('0xe')]},{'unique':!![],'name':'name_fax','fields':[_0x838e('0xb'),_0x838e('0xf')]},{'unique':!![],'name':'name_openchannel','fields':[_0x838e('0xb'),_0x838e('0x10')]},{'unique':!![],'name':_0x838e('0x11'),'fields':[_0x838e('0xb'),_0x838e('0x12')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 0947760..5dcf064 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(_0x23cb4d,_0x15f65e){var _0x368640=function(_0x4f0a63){while(--_0x4f0a63){_0x23cb4d['push'](_0x23cb4d['shift']());}};_0x368640(++_0x15f65e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x1624d3,_0x134136){var _0x2b6fa0=function(_0x4ea282){while(--_0x4ea282){_0x1624d3['push'](_0x1624d3['shift']());}};_0x2b6fa0(++_0x134136);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 53d9c84..529ccd7 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 _0x6129=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x6129,0x128));var _0x9612=function(_0x3a172d,_0x4e05d6){_0x3a172d=_0x3a172d-0x0;var _0x583098=_0x6129[_0x3a172d];return _0x583098;};'use strict';var multer=require(_0x9612('0x0'));var util=require(_0x9612('0x1'));var path=require(_0x9612('0x2'));var timeout=require(_0x9612('0x3'));var express=require(_0x9612('0x4'));var router=express[_0x9612('0x5')]();var fs_extra=require(_0x9612('0x6'));var auth=require(_0x9612('0x7'));var interaction=require(_0x9612('0x8'));var config=require(_0x9612('0x9'));var controller=require('./disposition.controller');router[_0x9612('0xa')]('/',auth[_0x9612('0xb')](),controller[_0x9612('0xc')]);router[_0x9612('0xa')](_0x9612('0xd'),auth['isAuthenticated'](),controller[_0x9612('0xe')]);router['post']('/',auth[_0x9612('0xb')](),controller[_0x9612('0xf')]);router[_0x9612('0x10')](_0x9612('0xd'),auth[_0x9612('0xb')](),controller[_0x9612('0x11')]);router[_0x9612('0x12')]('/:id',auth[_0x9612('0xb')](),controller['destroy']);module[_0x9612('0x13')]=router; \ No newline at end of file +var _0x7c2d=['create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x59580a,_0x5ca60c){var _0x3090f1=function(_0x373021){while(--_0x373021){_0x59580a['push'](_0x59580a['shift']());}};_0x3090f1(++_0x5ca60c);}(_0x7c2d,0x1e9));var _0xd7c2=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x7c2d[_0x3ea913];return _0x2b4f28;};'use strict';var multer=require('multer');var util=require(_0xd7c2('0x0'));var path=require('path');var timeout=require(_0xd7c2('0x1'));var express=require(_0xd7c2('0x2'));var router=express[_0xd7c2('0x3')]();var fs_extra=require(_0xd7c2('0x4'));var auth=require(_0xd7c2('0x5'));var interaction=require(_0xd7c2('0x6'));var config=require(_0xd7c2('0x7'));var controller=require(_0xd7c2('0x8'));router['get']('/',auth[_0xd7c2('0x9')](),controller[_0xd7c2('0xa')]);router[_0xd7c2('0xb')](_0xd7c2('0xc'),auth[_0xd7c2('0x9')](),controller[_0xd7c2('0xd')]);router[_0xd7c2('0xe')]('/',auth[_0xd7c2('0x9')](),controller[_0xd7c2('0xf')]);router[_0xd7c2('0x10')](_0xd7c2('0xc'),auth[_0xd7c2('0x9')](),controller[_0xd7c2('0x11')]);router[_0xd7c2('0x12')]('/:id',auth[_0xd7c2('0x9')](),controller[_0xd7c2('0x13')]);module[_0xd7c2('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 78782d4..a7c8a74 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 _0x50cb=['DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','12000','14400','INTEGER','SIP','IAX'];(function(_0x4c2687,_0x5c4f38){var _0x132287=function(_0xfc04c2){while(--_0xfc04c2){_0x4c2687['push'](_0x4c2687['shift']());}};_0x132287(++_0x5c4f38);}(_0x50cb,0x197));var _0xb50c=function(_0x1844a9,_0x2dfc40){_0x1844a9=_0x1844a9-0x0;var _0x5af6b2=_0x50cb[_0x1844a9];return _0x5af6b2;};'use strict';var Sequelize=require(_0xb50c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb50c('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0xb50c('0x2'),'no'),'defaultValue':_0xb50c('0x2')},'headerinfo':{'type':Sequelize[_0xb50c('0x1')],'defaultValue':_0xb50c('0x3')},'localstationid':{'type':Sequelize[_0xb50c('0x1')],'unique':_0xb50c('0x4')},'minrate':{'type':Sequelize[_0xb50c('0x5')](_0xb50c('0x6'),_0xb50c('0x7'),'7200','9600',_0xb50c('0x8'),'14400'),'defaultValue':_0xb50c('0x7')},'maxrate':{'type':Sequelize['ENUM'](_0xb50c('0x6'),_0xb50c('0x7'),'7200','9600',_0xb50c('0x8'),_0xb50c('0x9')),'defaultValue':_0xb50c('0x9')},'modem':{'type':Sequelize[_0xb50c('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xb50c('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb50c('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb50c('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xb50c('0xb'),_0xb50c('0xc'),_0xb50c('0xd'),_0xb50c('0xe')),'defaultValue':_0xb50c('0xb')},'key':{'type':Sequelize[_0xb50c('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb50c('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb50c('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb50c('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb50c('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb50c('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xb50c('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x412f90){if(!_0x412f90)this[_0xb50c('0x12')](_0xb50c('0x13'),null);this[_0xb50c('0x12')](_0xb50c('0x14'),_0x412f90);}}}; \ No newline at end of file +var _0x2fb6=['ENUM','2400','9600','12000','4800','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid'];(function(_0x13e21b,_0x394e6c){var _0x4aed8e=function(_0x5bb303){while(--_0x5bb303){_0x13e21b['push'](_0x13e21b['shift']());}};_0x4aed8e(++_0x394e6c);}(_0x2fb6,0x1b2));var _0x62fb=function(_0x4749ac,_0x562736){_0x4749ac=_0x4749ac-0x0;var _0x2381b7=_0x2fb6[_0x4749ac];return _0x2381b7;};'use strict';var Sequelize=require(_0x62fb('0x0'));module[_0x62fb('0x1')]={'name':{'type':Sequelize[_0x62fb('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM'](_0x62fb('0x3'),'no'),'defaultValue':_0x62fb('0x3')},'headerinfo':{'type':Sequelize[_0x62fb('0x2')],'defaultValue':_0x62fb('0x4')},'localstationid':{'type':Sequelize[_0x62fb('0x2')],'unique':_0x62fb('0x5')},'minrate':{'type':Sequelize[_0x62fb('0x6')](_0x62fb('0x7'),'4800','7200',_0x62fb('0x8'),_0x62fb('0x9'),'14400'),'defaultValue':_0x62fb('0xa')},'maxrate':{'type':Sequelize['ENUM'](_0x62fb('0x7'),_0x62fb('0xa'),'7200',_0x62fb('0x8'),_0x62fb('0x9'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x62fb('0x2')],'defaultValue':_0x62fb('0xb')},'gateway':{'type':Sequelize[_0x62fb('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x62fb('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x62fb('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x62fb('0x6')]('SIP',_0x62fb('0xd'),_0x62fb('0xe'),_0x62fb('0xf')),'defaultValue':_0x62fb('0x10')},'key':{'type':Sequelize[_0x62fb('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x62fb('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x62fb('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x62fb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x62fb('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x62fb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x62fb('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x62fb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x62fb('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x62fb('0x12')],'defaultValue':![],'comment':_0x62fb('0x13'),'set':function(_0x358d58){if(!_0x358d58)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x62fb('0x14')](_0x62fb('0x15'),_0x358d58);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index b2c923a..1c92343 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 _0xf451=['UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','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','update','describe','addDisposition','FaxAccountId','Disposition','findOne','merge','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','nolimit','removeAnswers','addInteraction','omit','FaxInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','type','system','description','Fax\x20Extension','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','tech','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','./faxAccount.socket','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','FaxAccounts'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf451,0x15e));var _0x1f45=function(_0x3c13ad,_0x55c4c6){_0x3c13ad=_0x3c13ad-0x0;var _0x1988b8=_0xf451[_0x3c13ad];return _0x1988b8;};'use strict';var emlformat=require(_0x1f45('0x0'));var rimraf=require(_0x1f45('0x1'));var zipdir=require(_0x1f45('0x2'));var jsonpatch=require(_0x1f45('0x3'));var rp=require(_0x1f45('0x4'));var moment=require('moment');var BPromise=require(_0x1f45('0x5'));var Mustache=require(_0x1f45('0x6'));var util=require(_0x1f45('0x7'));var path=require(_0x1f45('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f45('0x9'));var squel=require(_0x1f45('0xa'));var crypto=require('crypto');var jsforce=require(_0x1f45('0xb'));var deskjs=require(_0x1f45('0xc'));var toCsv=require(_0x1f45('0xd'));var querystring=require(_0x1f45('0xe'));var Papa=require(_0x1f45('0xf'));var Redis=require(_0x1f45('0x10'));var authService=require(_0x1f45('0x11'));var qs=require(_0x1f45('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f45('0x13'));var logger=require(_0x1f45('0x14'))(_0x1f45('0x15'));var utils=require('../../config/utils');var config=require(_0x1f45('0x16'));var licenseUtil=require(_0x1f45('0x17'));var db=require('../../mysqldb')['db'];config[_0x1f45('0x18')]=_['defaults'](config[_0x1f45('0x18')],{'host':_0x1f45('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f45('0x18')]));require(_0x1f45('0x1a'))['register'](socket);var jayson=require(_0x1f45('0x1b'));var client=jayson[_0x1f45('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x1f45('0x1c')][_0x1f45('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5b932f,_0x46e6a0,_0x219022,_0x29f5ce){return new BPromise(function(_0xed50f5,_0x2cfe1c){var _0x28e05d=_0x29f5ce||client;return _0x28e05d[_0x1f45('0x1e')](_0x5b932f,_0x219022)['then'](function(_0x413312){logger[_0x1f45('0x1f')]('FaxAccount,\x20%s,\x20%s',_0x46e6a0,_0x1f45('0x20'));logger[_0x1f45('0x21')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x46e6a0,'request\x20sent',JSON[_0x1f45('0x22')](_0x413312));if(_0x413312['error']){if(_0x413312[_0x1f45('0x23')][_0x1f45('0x24')]===0x1f4){logger[_0x1f45('0x23')](_0x1f45('0x25'),_0x46e6a0,_0x413312[_0x1f45('0x23')][_0x1f45('0x26')]);return _0x2cfe1c(_0x413312['error'][_0x1f45('0x26')]);}logger[_0x1f45('0x23')](_0x1f45('0x25'),_0x46e6a0,_0x413312[_0x1f45('0x23')]['message']);return _0xed50f5(_0x413312[_0x1f45('0x23')][_0x1f45('0x26')]);}else{logger['info'](_0x1f45('0x25'),_0x46e6a0,_0x1f45('0x20'));_0xed50f5(_0x413312[_0x1f45('0x27')]['message']);}})['catch'](function(_0x498b48){logger[_0x1f45('0x23')](_0x1f45('0x25'),_0x46e6a0,_0x498b48);_0x2cfe1c(_0x498b48);});});}function respondWithStatusCode(_0x16746c,_0x3c3da9){_0x3c3da9=_0x3c3da9||0xcc;return function(_0x18e500){if(_0x18e500){return _0x16746c[_0x1f45('0x28')](_0x3c3da9);}return _0x16746c[_0x1f45('0x29')](_0x3c3da9)[_0x1f45('0x2a')]();};}function respondWithResult(_0x4cbd74,_0x58251c){_0x58251c=_0x58251c||0xc8;return function(_0x34c575){if(_0x34c575){return _0x4cbd74['status'](_0x58251c)[_0x1f45('0x2b')](_0x34c575);}};}function respondWithFilteredResult(_0x5f4386,_0xddfea8){return function(_0x5c5467){if(_0x5c5467){var _0x5ae23d=typeof _0xddfea8[_0x1f45('0x2c')]===_0x1f45('0x2d')&&typeof _0xddfea8['limit']===_0x1f45('0x2d');var _0x4a3a69=_0x5c5467[_0x1f45('0x2e')];var _0x581885=_0x5ae23d?0x0:_0xddfea8[_0x1f45('0x2c')];var _0x18d3d9=_0x5ae23d?_0x5c5467['count']:_0xddfea8[_0x1f45('0x2c')]+_0xddfea8[_0x1f45('0x2f')];var _0x4d6193;if(_0x18d3d9>=_0x4a3a69){_0x18d3d9=_0x4a3a69;_0x4d6193=0xc8;}else{_0x4d6193=0xce;}_0x5f4386[_0x1f45('0x29')](_0x4d6193);return _0x5f4386[_0x1f45('0x30')]('Content-Range',_0x581885+'-'+_0x18d3d9+'/'+_0x4a3a69)[_0x1f45('0x2b')](_0x5c5467);}return null;};}function patchUpdates(_0x17ba41){return function(_0x573dda){try{jsonpatch[_0x1f45('0x31')](_0x573dda,_0x17ba41,!![]);}catch(_0x3a8935){return BPromise[_0x1f45('0x32')](_0x3a8935);}return _0x573dda[_0x1f45('0x33')]();};}function saveUpdates(_0x242f11,_0x453b26){return function(_0xe7321d){if(_0xe7321d){return _0xe7321d['update'](_0x242f11)[_0x1f45('0x34')](function(_0x59dbfc){return _0x59dbfc;});}return null;};}function removeEntity(_0x49c728,_0x26fc1e){return function(_0x273553){if(_0x273553){return _0x273553[_0x1f45('0x35')]()[_0x1f45('0x34')](function(){var _0x36a895=_0x273553[_0x1f45('0x36')]({'plain':!![]});var _0x2f0afe=_0x1f45('0x37');return db[_0x1f45('0x38')][_0x1f45('0x35')]({'where':{'type':_0x2f0afe,'resourceId':_0x36a895['id']}})[_0x1f45('0x34')](function(){return _0x273553;});})[_0x1f45('0x34')](function(){_0x49c728['status'](0xcc)[_0x1f45('0x2a')]();});}};}function handleEntityNotFound(_0x45f360,_0x4e5df9){return function(_0x1aca2c){if(!_0x1aca2c){_0x45f360[_0x1f45('0x28')](0x194);}return _0x1aca2c;};}function handleError(_0x1160d9,_0x1777f8){_0x1777f8=_0x1777f8||0x1f4;return function(_0x79ce70){logger[_0x1f45('0x23')](_0x79ce70[_0x1f45('0x39')]);if(_0x79ce70[_0x1f45('0x3a')]){delete _0x79ce70[_0x1f45('0x3a')];}_0x1160d9[_0x1f45('0x29')](_0x1777f8)[_0x1f45('0x3b')](_0x79ce70);};}exports[_0x1f45('0x3c')]=function(_0x390ee7,_0x5c4ecd){var _0x455f6e={'include':[{'model':db[_0x1f45('0x3d')],'as':_0x1f45('0x3e')}]},_0x4016ca={},_0x590851={'count':0x0,'rows':[]};var _0x1f2d06=_['map'](db[_0x1f45('0x3f')][_0x1f45('0x40')],function(_0x48d696){return{'name':_0x48d696[_0x1f45('0x41')],'type':_0x48d696['type'][_0x1f45('0x42')]};});_0x4016ca[_0x1f45('0x43')]=_[_0x1f45('0x44')](_0x1f2d06,_0x1f45('0x3a'));_0x4016ca['query']=_[_0x1f45('0x45')](_0x390ee7[_0x1f45('0x46')]);_0x4016ca['filters']=_[_0x1f45('0x47')](_0x4016ca['model'],_0x4016ca['query']);_0x455f6e[_0x1f45('0x48')]=_['intersection'](_0x4016ca['model'],qs[_0x1f45('0x49')](_0x390ee7[_0x1f45('0x46')]['fields']));_0x455f6e[_0x1f45('0x48')]=_0x455f6e[_0x1f45('0x48')][_0x1f45('0x4a')]?_0x455f6e[_0x1f45('0x48')]:_0x4016ca[_0x1f45('0x43')];if(!_0x390ee7['query'][_0x1f45('0x4b')]('nolimit')){_0x455f6e[_0x1f45('0x2f')]=qs['limit'](_0x390ee7[_0x1f45('0x46')]['limit']);_0x455f6e[_0x1f45('0x2c')]=qs[_0x1f45('0x2c')](_0x390ee7['query'][_0x1f45('0x2c')]);}_0x455f6e[_0x1f45('0x4c')]=qs[_0x1f45('0x4d')](_0x390ee7[_0x1f45('0x46')]['sort']);_0x455f6e[_0x1f45('0x4e')]=qs[_0x1f45('0x4f')](_[_0x1f45('0x50')](_0x390ee7[_0x1f45('0x46')],_0x4016ca['filters']),_0x1f2d06);if(_0x390ee7[_0x1f45('0x46')][_0x1f45('0x51')]){_0x455f6e[_0x1f45('0x4e')]=_['merge'](_0x455f6e[_0x1f45('0x4e')],{'$or':_[_0x1f45('0x44')](_0x1f2d06,function(_0x482404){if(_0x482404['type']!==_0x1f45('0x52')){var _0x11bc9c={};_0x11bc9c[_0x482404['name']]={'$like':'%'+_0x390ee7[_0x1f45('0x46')][_0x1f45('0x51')]+'%'};return _0x11bc9c;}})});}_0x455f6e=_['merge']({},_0x455f6e,_0x390ee7[_0x1f45('0x53')]);var _0x200b38={'where':_0x455f6e['where']};return db[_0x1f45('0x3f')]['count'](_0x200b38)[_0x1f45('0x34')](function(_0x6d858c){_0x590851[_0x1f45('0x2e')]=_0x6d858c;if(_0x390ee7[_0x1f45('0x46')][_0x1f45('0x54')]){_0x455f6e['include']=[{'all':!![]}];}return db[_0x1f45('0x3f')][_0x1f45('0x55')](_0x455f6e);})[_0x1f45('0x34')](function(_0x8101e9){_0x590851[_0x1f45('0x56')]=_0x8101e9;return _0x590851;})[_0x1f45('0x34')](respondWithFilteredResult(_0x5c4ecd,_0x455f6e))[_0x1f45('0x57')](handleError(_0x5c4ecd,null));};exports[_0x1f45('0x58')]=function(_0x5c01a2,_0x4f700e){var _0x4c4c70={'raw':![],'where':{'id':_0x5c01a2[_0x1f45('0x59')]['id']},'include':[{'model':db[_0x1f45('0x3d')],'as':_0x1f45('0x3e')}]},_0x596933={};_0x596933[_0x1f45('0x43')]=_[_0x1f45('0x45')](db['FaxAccount'][_0x1f45('0x40')]);_0x596933[_0x1f45('0x46')]=_[_0x1f45('0x45')](_0x5c01a2[_0x1f45('0x46')]);_0x596933[_0x1f45('0x4f')]=_[_0x1f45('0x47')](_0x596933[_0x1f45('0x43')],_0x596933[_0x1f45('0x46')]);_0x4c4c70['attributes']=_['intersection'](_0x596933[_0x1f45('0x43')],qs['fields'](_0x5c01a2[_0x1f45('0x46')][_0x1f45('0x49')]));_0x4c4c70[_0x1f45('0x48')]=_0x4c4c70[_0x1f45('0x48')][_0x1f45('0x4a')]?_0x4c4c70['attributes']:_0x596933[_0x1f45('0x43')];if(_0x5c01a2[_0x1f45('0x46')][_0x1f45('0x54')]){_0x4c4c70[_0x1f45('0x5a')]=[{'all':!![]}];}_0x4c4c70=_['merge']({},_0x4c4c70,_0x5c01a2[_0x1f45('0x53')]);return db[_0x1f45('0x3f')][_0x1f45('0x5b')](_0x4c4c70)[_0x1f45('0x34')](handleEntityNotFound(_0x4f700e,null))['then'](respondWithResult(_0x4f700e,null))[_0x1f45('0x57')](handleError(_0x4f700e,null));};exports[_0x1f45('0x5c')]=function(_0x39cf46,_0x288593){return db[_0x1f45('0x3f')][_0x1f45('0x5c')](_0x39cf46[_0x1f45('0x5d')],{})[_0x1f45('0x34')](function(_0x52a2b9){var _0x52b943=_0x39cf46[_0x1f45('0x5e')][_0x1f45('0x36')]({'plain':!![]});if(!_0x52b943)throw new Error(_0x1f45('0x5f'));if(_0x52b943[_0x1f45('0x60')]===_0x1f45('0x5e')){var _0x1fa30a=_0x52a2b9[_0x1f45('0x36')]({'plain':!![]});var _0xae2dcc=_0x1f45('0x37');return db[_0x1f45('0x61')][_0x1f45('0x5b')]({'where':{'name':_0xae2dcc,'userProfileId':_0x52b943[_0x1f45('0x62')]},'raw':!![]})['then'](function(_0x4995fa){if(_0x4995fa&&_0x4995fa[_0x1f45('0x63')]===0x0){return db[_0x1f45('0x38')]['create']({'name':_0x1fa30a[_0x1f45('0x3a')],'resourceId':_0x1fa30a['id'],'type':_0x4995fa['name'],'sectionId':_0x4995fa['id']},{})[_0x1f45('0x34')](function(){return _0x52a2b9;});}else{return _0x52a2b9;}})[_0x1f45('0x57')](function(_0x428ab1){logger['error'](_0x1f45('0x64'),_0x428ab1);throw _0x428ab1;});}return _0x52a2b9;})[_0x1f45('0x34')](respondWithResult(_0x288593,0xc9))['catch'](handleError(_0x288593,null));};exports[_0x1f45('0x65')]=function(_0x1326d5,_0x11fcbd){if(_0x1326d5[_0x1f45('0x5d')]['id']){delete _0x1326d5[_0x1f45('0x5d')]['id'];}return db[_0x1f45('0x3f')][_0x1f45('0x5b')]({'where':{'id':_0x1326d5['params']['id']},'include':[{'model':db[_0x1f45('0x3d')],'as':_0x1f45('0x3e')}]})['then'](handleEntityNotFound(_0x11fcbd,null))[_0x1f45('0x34')](saveUpdates(_0x1326d5[_0x1f45('0x5d')],null))['then'](respondWithResult(_0x11fcbd,null))['catch'](handleError(_0x11fcbd,null));};exports[_0x1f45('0x35')]=function(_0x31c8db,_0x4c40c6){return db[_0x1f45('0x3f')]['find']({'where':{'id':_0x31c8db['params']['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x4c40c6,null))[_0x1f45('0x34')](removeEntity(_0x4c40c6,null))[_0x1f45('0x57')](handleError(_0x4c40c6,null));};exports[_0x1f45('0x66')]=function(_0x11cb71,_0x15eb4e){return db[_0x1f45('0x3f')][_0x1f45('0x66')]()[_0x1f45('0x34')](respondWithResult(_0x15eb4e,null))[_0x1f45('0x57')](handleError(_0x15eb4e,null));};exports[_0x1f45('0x67')]=function(_0x1e1eae,_0x31bb0c,_0x5684ff){if(_0x1e1eae[_0x1f45('0x5d')]['id']){delete _0x1e1eae[_0x1f45('0x5d')]['id'];}return db[_0x1f45('0x3f')][_0x1f45('0x5b')]({'where':{'id':_0x1e1eae[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x31bb0c,null))[_0x1f45('0x34')](function(_0x3ebab2){if(_0x3ebab2){_0x1e1eae['body'][_0x1f45('0x68')]=_0x3ebab2['id'];return db[_0x1f45('0x69')][_0x1f45('0x5c')](_0x1e1eae['body']);}})[_0x1f45('0x34')](respondWithResult(_0x31bb0c,null))['catch'](handleError(_0x31bb0c,null));};exports['getDispositions']=function(_0x4cb7f6,_0x2622a7,_0x2896ee){var _0x599ef4={'raw':![],'where':{}};var _0x15e235={};var _0xf5e351={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1f45('0x6a')]({'where':{'id':_0x4cb7f6['params']['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x2622a7,null))[_0x1f45('0x34')](function(_0x4bf8ef){if(_0x4bf8ef){_0x15e235[_0x1f45('0x43')]=_['keys'](db[_0x1f45('0x69')][_0x1f45('0x40')]);_0x15e235[_0x1f45('0x46')]=_[_0x1f45('0x45')](_0x4cb7f6['query']);_0x15e235[_0x1f45('0x4f')]=_['intersection'](_0x15e235[_0x1f45('0x43')],_0x15e235[_0x1f45('0x46')]);_0x599ef4[_0x1f45('0x48')]=_[_0x1f45('0x47')](_0x15e235[_0x1f45('0x43')],qs[_0x1f45('0x49')](_0x4cb7f6[_0x1f45('0x46')][_0x1f45('0x49')]));_0x599ef4[_0x1f45('0x48')]=_0x599ef4[_0x1f45('0x48')][_0x1f45('0x4a')]?_0x599ef4[_0x1f45('0x48')]:_0x15e235[_0x1f45('0x43')];if(!_0x4cb7f6[_0x1f45('0x46')][_0x1f45('0x4b')]('nolimit')){_0x599ef4[_0x1f45('0x2f')]=qs[_0x1f45('0x2f')](_0x4cb7f6[_0x1f45('0x46')][_0x1f45('0x2f')]);_0x599ef4['offset']=qs[_0x1f45('0x2c')](_0x4cb7f6['query']['offset']);}_0x599ef4[_0x1f45('0x4c')]=qs['sort'](_0x4cb7f6[_0x1f45('0x46')]['sort']);_0x599ef4['where']=qs[_0x1f45('0x4f')](_[_0x1f45('0x50')](_0x4cb7f6[_0x1f45('0x46')],_0x15e235[_0x1f45('0x4f')]));_0x599ef4[_0x1f45('0x4e')][_0x1f45('0x68')]=_0x4bf8ef['id'];if(_0x4cb7f6['query']['filter']){_0x599ef4[_0x1f45('0x4e')]=_['merge'](_0x599ef4['where'],{'$or':_[_0x1f45('0x44')](_0x599ef4[_0x1f45('0x48')],function(_0x5f44e0){var _0x7e5134={};_0x7e5134[_0x5f44e0]={'$like':'%'+_0x4cb7f6[_0x1f45('0x46')][_0x1f45('0x51')]+'%'};return _0x7e5134;})});}_0x599ef4=_[_0x1f45('0x6b')]({},_0x599ef4,_0x4cb7f6[_0x1f45('0x53')]);return db[_0x1f45('0x69')][_0x1f45('0x2e')]({'where':_0x599ef4['where']})[_0x1f45('0x34')](function(_0x1cba1b){_0xf5e351['count']=_0x1cba1b;if(_0x4cb7f6[_0x1f45('0x46')][_0x1f45('0x54')]){_0x599ef4[_0x1f45('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x1f45('0x55')](_0x599ef4);})[_0x1f45('0x34')](function(_0x4a1546){_0xf5e351[_0x1f45('0x56')]=_0x4a1546;return _0xf5e351;});}})[_0x1f45('0x34')](respondWithFilteredResult(_0x2622a7,_0x599ef4))['catch'](handleError(_0x2622a7,null));};exports[_0x1f45('0x6c')]=function(_0x407225,_0x522c64,_0x357e95){return db[_0x1f45('0x3f')]['find']({'where':{'id':_0x407225['params']['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x522c64,null))['then'](function(_0x15c58d){if(_0x15c58d){return _0x15c58d[_0x1f45('0x6c')](_0x407225[_0x1f45('0x46')][_0x1f45('0x6d')]);}})[_0x1f45('0x34')](respondWithStatusCode(_0x522c64,null))[_0x1f45('0x57')](handleError(_0x522c64,null));};exports[_0x1f45('0x6e')]=function(_0x35c628,_0x57d23d,_0x3757af){if(_0x35c628['body']['id']){delete _0x35c628['body']['id'];}return db[_0x1f45('0x3f')][_0x1f45('0x5b')]({'where':{'id':_0x35c628[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x57d23d,null))[_0x1f45('0x34')](function(_0x322d61){if(_0x322d61){_0x35c628[_0x1f45('0x5d')][_0x1f45('0x68')]=_0x322d61['id'];return db['CannedAnswer'][_0x1f45('0x5c')](_0x35c628[_0x1f45('0x5d')]);}})[_0x1f45('0x34')](respondWithResult(_0x57d23d,null))[_0x1f45('0x57')](handleError(_0x57d23d,null));};exports[_0x1f45('0x6f')]=function(_0x1562ce,_0x5bb29a,_0xfc692e){var _0x4f7495={'raw':![],'where':{}};var _0x1deb7e={};var _0x47aa37={'count':0x0,'rows':[]};return db[_0x1f45('0x3f')]['findOne']({'where':{'id':_0x1562ce[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x5bb29a,null))[_0x1f45('0x34')](function(_0x41c9c7){if(_0x41c9c7){_0x1deb7e[_0x1f45('0x43')]=_[_0x1f45('0x45')](db[_0x1f45('0x70')]['rawAttributes']);_0x1deb7e['query']=_[_0x1f45('0x45')](_0x1562ce['query']);_0x1deb7e[_0x1f45('0x4f')]=_[_0x1f45('0x47')](_0x1deb7e[_0x1f45('0x43')],_0x1deb7e['query']);_0x4f7495['attributes']=_[_0x1f45('0x47')](_0x1deb7e['model'],qs[_0x1f45('0x49')](_0x1562ce[_0x1f45('0x46')][_0x1f45('0x49')]));_0x4f7495[_0x1f45('0x48')]=_0x4f7495[_0x1f45('0x48')][_0x1f45('0x4a')]?_0x4f7495[_0x1f45('0x48')]:_0x1deb7e[_0x1f45('0x43')];if(!_0x1562ce[_0x1f45('0x46')][_0x1f45('0x4b')](_0x1f45('0x71'))){_0x4f7495[_0x1f45('0x2f')]=qs[_0x1f45('0x2f')](_0x1562ce[_0x1f45('0x46')]['limit']);_0x4f7495[_0x1f45('0x2c')]=qs['offset'](_0x1562ce['query'][_0x1f45('0x2c')]);}_0x4f7495[_0x1f45('0x4c')]=qs['sort'](_0x1562ce[_0x1f45('0x46')][_0x1f45('0x4d')]);_0x4f7495['where']=qs[_0x1f45('0x4f')](_[_0x1f45('0x50')](_0x1562ce['query'],_0x1deb7e['filters']));_0x4f7495['where'][_0x1f45('0x68')]=_0x41c9c7['id'];if(_0x1562ce[_0x1f45('0x46')][_0x1f45('0x51')]){_0x4f7495[_0x1f45('0x4e')]=_[_0x1f45('0x6b')](_0x4f7495['where'],{'$or':_['map'](_0x4f7495['attributes'],function(_0x387b13){var _0x4fabe1={};_0x4fabe1[_0x387b13]={'$like':'%'+_0x1562ce[_0x1f45('0x46')]['filter']+'%'};return _0x4fabe1;})});}_0x4f7495=_[_0x1f45('0x6b')]({},_0x4f7495,_0x1562ce[_0x1f45('0x53')]);return db['CannedAnswer'][_0x1f45('0x2e')]({'where':_0x4f7495[_0x1f45('0x4e')]})[_0x1f45('0x34')](function(_0x2f72a6){_0x47aa37[_0x1f45('0x2e')]=_0x2f72a6;if(_0x1562ce[_0x1f45('0x46')]['includeAll']){_0x4f7495[_0x1f45('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0x1f45('0x55')](_0x4f7495);})[_0x1f45('0x34')](function(_0x404648){_0x47aa37[_0x1f45('0x56')]=_0x404648;return _0x47aa37;});}})[_0x1f45('0x34')](respondWithFilteredResult(_0x5bb29a,_0x4f7495))[_0x1f45('0x57')](handleError(_0x5bb29a,null));};exports['removeAnswers']=function(_0x2d61a5,_0x3b00a8,_0x9165cc){return db[_0x1f45('0x3f')][_0x1f45('0x5b')]({'where':{'id':_0x2d61a5[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x3b00a8,null))['then'](function(_0x370635){if(_0x370635){return _0x370635[_0x1f45('0x72')](_0x2d61a5['query']['ids']);}})[_0x1f45('0x34')](respondWithStatusCode(_0x3b00a8,null))[_0x1f45('0x57')](handleError(_0x3b00a8,null));};exports[_0x1f45('0x73')]=function(_0x2d7249,_0xa023b4,_0x4a8071){return db['FaxInteraction'][_0x1f45('0x5b')]({'where':{'id':_0x2d7249[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0xa023b4,null))[_0x1f45('0x34')](function(_0x1c5a84){if(_0x1c5a84){return _0x1c5a84['addInteraction'](_0x2d7249['body'][_0x1f45('0x6d')],_[_0x1f45('0x74')](_0x2d7249['body'],['ids','id'])||{});}})[_0x1f45('0x34')](respondWithResult(_0xa023b4,null))[_0x1f45('0x57')](handleError(_0xa023b4,null));};exports['getInteractions']=function(_0x2da7db,_0x30b664,_0x1be407){var _0x2c6218={'raw':![],'where':{}};var _0xce172f={};var _0x4d13df={'count':0x0,'rows':[]};return db[_0x1f45('0x3f')][_0x1f45('0x6a')]({'where':{'id':_0x2da7db[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x30b664,null))[_0x1f45('0x34')](function(_0x1df0a4){if(_0x1df0a4){_0xce172f[_0x1f45('0x43')]=_[_0x1f45('0x45')](db[_0x1f45('0x75')]['rawAttributes']);_0xce172f['query']=_['keys'](_0x2da7db[_0x1f45('0x46')]);_0xce172f[_0x1f45('0x4f')]=_[_0x1f45('0x47')](_0xce172f[_0x1f45('0x43')],_0xce172f['query']);_0x2c6218[_0x1f45('0x48')]=_[_0x1f45('0x47')](_0xce172f[_0x1f45('0x43')],qs['fields'](_0x2da7db[_0x1f45('0x46')][_0x1f45('0x49')]));_0x2c6218[_0x1f45('0x48')]=_0x2c6218[_0x1f45('0x48')]['length']?_0x2c6218[_0x1f45('0x48')]:_0xce172f[_0x1f45('0x43')];if(!_0x2da7db['query'][_0x1f45('0x4b')](_0x1f45('0x71'))){_0x2c6218[_0x1f45('0x2f')]=qs[_0x1f45('0x2f')](_0x2da7db[_0x1f45('0x46')][_0x1f45('0x2f')]);_0x2c6218['offset']=qs[_0x1f45('0x2c')](_0x2da7db['query']['offset']);}_0x2c6218[_0x1f45('0x4c')]=qs['sort'](_0x2da7db[_0x1f45('0x46')][_0x1f45('0x4d')]);_0x2c6218['where']=qs['filters'](_[_0x1f45('0x50')](_0x2da7db[_0x1f45('0x46')],_0xce172f[_0x1f45('0x4f')]));_0x2c6218[_0x1f45('0x4e')][_0x1f45('0x68')]=_0x1df0a4['id'];if(_0x2da7db['query'][_0x1f45('0x51')]){_0x2c6218[_0x1f45('0x4e')]=_[_0x1f45('0x6b')](_0x2c6218[_0x1f45('0x4e')],{'$or':_['map'](_0x2c6218[_0x1f45('0x48')],function(_0xdfdd8c){var _0x2e5d27={};_0x2e5d27[_0xdfdd8c]={'$like':'%'+_0x2da7db[_0x1f45('0x46')][_0x1f45('0x51')]+'%'};return _0x2e5d27;})});}_0x2c6218=_[_0x1f45('0x6b')]({},_0x2c6218,_0x2da7db['options']);return db['FaxInteraction'][_0x1f45('0x2e')]({'where':_0x2c6218[_0x1f45('0x4e')]})[_0x1f45('0x34')](function(_0x51ee35){_0x4d13df[_0x1f45('0x2e')]=_0x51ee35;if(_0x2da7db[_0x1f45('0x46')]['includeAll']){_0x2c6218[_0x1f45('0x5a')]=[{'model':db[_0x1f45('0x76')],'as':_0x1f45('0x77'),'required':![]},{'model':db[_0x1f45('0x78')],'as':_0x1f45('0x79'),'attributes':[_0x1f45('0x3a'),_0x1f45('0x7a'),'internal'],'required':![]},{'model':db[_0x1f45('0x7b')],'as':_0x1f45('0x7c'),'attributes':['id',_0x1f45('0x3a'),_0x1f45('0x7d')],'where':_0x2da7db['query'][_0x1f45('0x7e')]?{'id':_0x2da7db[_0x1f45('0x46')][_0x1f45('0x7e')]}:undefined,'required':_0x2da7db[_0x1f45('0x46')][_0x1f45('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0x1f45('0x55')](_0x2c6218);})['then'](function(_0x1857b0){_0x4d13df[_0x1f45('0x56')]=_0x1857b0;return _0x4d13df;});}})[_0x1f45('0x34')](respondWithFilteredResult(_0x30b664,_0x2c6218))[_0x1f45('0x57')](handleError(_0x30b664,null));};exports[_0x1f45('0x7f')]=function(_0x58f426,_0x24b0fa){var _0x21f9b7=_0x58f426[_0x1f45('0x59')]['id'];var _0x578df4=_0x58f426[_0x1f45('0x5d')];var _0x47c560=0xc8;var _0x147bdc=null;return db['sequelize'][_0x1f45('0x80')]({'isolationLevel':db[_0x1f45('0x81')][_0x1f45('0x82')][_0x1f45('0x83')][_0x1f45('0x84')]},function(_0x567c9d){return db[_0x1f45('0x3f')][_0x1f45('0x6a')]({'where':{'id':_0x21f9b7},'transaction':_0x567c9d})['then'](function(_0x5cbaae){if(_0x5cbaae){return db[_0x1f45('0x85')][_0x1f45('0x35')]({'where':{'FaxAccountId':_0x21f9b7},'transaction':_0x567c9d})[_0x1f45('0x34')](function(){var _0x1b0540=_['map'](_0x578df4,function(_0x39638d){_0x39638d[_0x1f45('0x68')]=_0x21f9b7;return _0x39638d;});return db[_0x1f45('0x85')][_0x1f45('0x86')](_0x1b0540,{'transaction':_0x567c9d});});}else{_0x47c560=0x194;_0x147bdc=[];}});})[_0x1f45('0x34')](function(){if(_0x47c560!==0x194){return db[_0x1f45('0x85')]['findAndCountAll']({'where':{'FaxAccountId':_0x21f9b7},'order':_0x1f45('0x87')})[_0x1f45('0x34')](function(_0x4fd7cf){_0x147bdc=_0x4fd7cf;});}})[_0x1f45('0x57')](function(_0x5759b6){_0x47c560=0x1f4;logger[_0x1f45('0x23')](_0x5759b6[_0x1f45('0x39')]);if(_0x5759b6[_0x1f45('0x3a')]){delete _0x5759b6['name'];}_0x147bdc=_0x5759b6;})[_0x1f45('0x88')](function(){if(_0x147bdc===null){_0x24b0fa[_0x1f45('0x28')](_0x47c560);}else{if(_0x47c560===0x1f4){_0x24b0fa[_0x1f45('0x29')](_0x47c560)['send'](_0x147bdc);}else{_0x24b0fa['status'](_0x47c560)['json'](_0x147bdc);}}});};exports[_0x1f45('0x89')]=function(_0x1021c8,_0x5ec193,_0xb996f){var _0x53464f={};var _0x353ac3={};var _0x28c610;var _0x3ea4a5;return db['FaxAccount'][_0x1f45('0x6a')]({'where':{'id':_0x1021c8[_0x1f45('0x59')]['id']}})['then'](handleEntityNotFound(_0x5ec193,null))['then'](function(_0x2fc4a9){if(_0x2fc4a9){_0x28c610=_0x2fc4a9;_0x353ac3[_0x1f45('0x43')]=_[_0x1f45('0x45')](db[_0x1f45('0x85')][_0x1f45('0x40')]);_0x353ac3[_0x1f45('0x46')]=_[_0x1f45('0x45')](_0x1021c8[_0x1f45('0x46')]);_0x353ac3[_0x1f45('0x4f')]=_[_0x1f45('0x47')](_0x353ac3['model'],_0x353ac3['query']);_0x53464f[_0x1f45('0x48')]=_[_0x1f45('0x47')](_0x353ac3[_0x1f45('0x43')],qs[_0x1f45('0x49')](_0x1021c8[_0x1f45('0x46')][_0x1f45('0x49')]));_0x53464f[_0x1f45('0x48')]=_0x53464f[_0x1f45('0x48')][_0x1f45('0x4a')]?_0x53464f['attributes']:_0x353ac3[_0x1f45('0x43')];_0x53464f[_0x1f45('0x4c')]=qs['sort'](_0x1021c8[_0x1f45('0x46')][_0x1f45('0x4d')]);_0x53464f[_0x1f45('0x4e')]=qs[_0x1f45('0x4f')](_['pick'](_0x1021c8[_0x1f45('0x46')],_0x353ac3['filters']));if(_0x1021c8[_0x1f45('0x46')]['filter']){_0x53464f[_0x1f45('0x4e')]=_['merge'](_0x53464f[_0x1f45('0x4e')],{'$or':_[_0x1f45('0x44')](_0x53464f[_0x1f45('0x48')],function(_0xdf3718){var _0x26896d={};_0x26896d[_0xdf3718]={'$like':'%'+_0x1021c8[_0x1f45('0x46')]['filter']+'%'};return _0x26896d;})});}_0x53464f=_['merge']({},_0x53464f,_0x1021c8[_0x1f45('0x53')]);return _0x28c610['getApplications'](_0x53464f);}})[_0x1f45('0x34')](function(_0x3c9098){if(_0x3c9098){_0x3ea4a5=_0x3c9098[_0x1f45('0x4a')];if(!_0x1021c8[_0x1f45('0x46')][_0x1f45('0x4b')](_0x1f45('0x71'))){_0x53464f[_0x1f45('0x2f')]=qs[_0x1f45('0x2f')](_0x1021c8['query'][_0x1f45('0x2f')]);_0x53464f['offset']=qs['offset'](_0x1021c8['query']['offset']);}return _0x28c610[_0x1f45('0x89')](_0x53464f);}})[_0x1f45('0x34')](function(_0x59caed){if(_0x59caed){return _0x59caed?{'count':_0x3ea4a5,'rows':_0x59caed}:null;}})[_0x1f45('0x34')](respondWithResult(_0x5ec193,null))[_0x1f45('0x57')](handleError(_0x5ec193,null));};function Extension(_0x17178a,_0x425d40,_0x2e38fd,_0x126d2a){this[_0x1f45('0x8a')]=_0x1f45('0x8b');this[_0x1f45('0x8c')]=_0x17178a[_0x1f45('0x8d')];this[_0x1f45('0x8e')]=_0x126d2a;this[_0x1f45('0x8f')]=_0x1f45('0x90');this[_0x1f45('0x91')]=_0x1f45('0x92');this[_0x1f45('0x68')]=_0x17178a['id'];this['priority']=_0x425d40;this['appdata']=_0x2e38fd;}function createExtensionsReciveFax(_0x12462c){var _0x3b83e4=0x1;var _0x34625a=[];_0x34625a['push'](new Extension(_0x12462c,_0x3b83e4,'',_0x1f45('0x93')));_0x3b83e4+=0x1;_0x34625a[_0x1f45('0x94')](new Extension(_0x12462c,_0x3b83e4,_0x1f45('0x95'),_0x1f45('0x96')));_0x3b83e4+=0x1;for(var _0x50d4ff in _0x12462c){if(_0x12462c['hasOwnProperty'](_0x50d4ff)&&(_0x50d4ff===_0x1f45('0x97')||_0x50d4ff==='localstationid'||_0x50d4ff===_0x1f45('0x98')||_0x50d4ff===_0x1f45('0x99')||_0x50d4ff===_0x1f45('0x9a')||_0x50d4ff===_0x1f45('0x9b')||_0x50d4ff===_0x1f45('0x9c')||_0x50d4ff===_0x1f45('0x9d')||_0x50d4ff===_0x1f45('0x9e'))){_0x34625a[_0x1f45('0x94')](new Extension(_0x12462c,_0x3b83e4,_0x1f45('0x9f')+_0x50d4ff+')='+_0x12462c[_0x50d4ff],'Set'));_0x3b83e4+=0x1;}}_0x34625a[_0x1f45('0x94')](new Extension(_0x12462c,_0x3b83e4,'6',_0x1f45('0xa0')));_0x3b83e4+=0x1;_0x34625a[_0x1f45('0x94')](new Extension(_0x12462c,_0x3b83e4,_0x1f45('0xa1'),_0x1f45('0xa2')));_0x3b83e4=0x0;return _0x34625a;}exports['addAccountApplications']=function(_0x5d304c,_0x1d8849,_0x3805cc){var _0x248685;return db[_0x1f45('0x81')]['transaction'](function(_0x538385){return db[_0x1f45('0x3f')][_0x1f45('0x5c')](_0x5d304c[_0x1f45('0x5d')],{'transaction':_0x538385})[_0x1f45('0x34')](function(_0xba903b){_0x248685=_0xba903b[_0x1f45('0x36')]({'plain':!![]});return db[_0x1f45('0xa3')][_0x1f45('0x86')](createExtensionsReciveFax(_0x248685),{'transaction':_0x538385});});})[_0x1f45('0x34')](function(){return _0x248685;})[_0x1f45('0x34')](respondWithResult(_0x1d8849,null))[_0x1f45('0x57')](handleError(_0x1d8849,null));};exports[_0x1f45('0xa4')]=function(_0x38ea4c,_0x42fe05,_0x236571){var _0x100f08;return db['sequelize']['transaction'](function(_0x585c6c){return db[_0x1f45('0x3f')]['update'](_0x38ea4c[_0x1f45('0x5d')],{'where':{'id':_0x38ea4c[_0x1f45('0x5d')]['id']},'transaction':_0x585c6c})['then'](function(_0x54aeba){return db[_0x1f45('0xa3')][_0x1f45('0x35')]({'where':{'FaxAccountId':_0x38ea4c['body']['id']},'transaction':_0x585c6c})['then'](function(_0x352477){return db[_0x1f45('0xa3')][_0x1f45('0x86')](createExtensionsReciveFax(_[_0x1f45('0x74')](_0x38ea4c[_0x1f45('0x5d')],[_0x1f45('0xa5'),_0x1f45('0x42'),'createdAt',_0x1f45('0xa6'),_0x1f45('0xa7'),_0x1f45('0xa8')])),{'transaction':_0x585c6c});});});})[_0x1f45('0x34')](function(){return db[_0x1f45('0x3f')][_0x1f45('0xa9')](_0x38ea4c['body']['id']);})[_0x1f45('0x34')](respondWithResult(_0x42fe05,null))[_0x1f45('0x57')](handleError(_0x42fe05,null));};exports[_0x1f45('0xaa')]=function(_0x317ddf,_0x5b62d0,_0xcbf73){var _0x3451c3={'raw':!![],'where':{}};var _0x4e7fce={};var _0x5566f1={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1f45('0x6a')]({'where':{'id':_0x317ddf[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x5b62d0,null))[_0x1f45('0x34')](function(_0x11a800){if(_0x11a800){_0x4e7fce[_0x1f45('0x43')]=_[_0x1f45('0x45')](db['FaxMessage'][_0x1f45('0x40')]);_0x4e7fce[_0x1f45('0x46')]=_[_0x1f45('0x45')](_0x317ddf[_0x1f45('0x46')]);_0x4e7fce[_0x1f45('0x4f')]=_[_0x1f45('0x47')](_0x4e7fce[_0x1f45('0x43')],_0x4e7fce['query']);_0x3451c3[_0x1f45('0x48')]=_[_0x1f45('0x47')](_0x4e7fce[_0x1f45('0x43')],qs[_0x1f45('0x49')](_0x317ddf[_0x1f45('0x46')][_0x1f45('0x49')]));_0x3451c3[_0x1f45('0x48')]=_0x3451c3[_0x1f45('0x48')]['length']?_0x3451c3['attributes']:_0x4e7fce[_0x1f45('0x43')];if(!_0x317ddf['query'][_0x1f45('0x4b')](_0x1f45('0x71'))){_0x3451c3[_0x1f45('0x2f')]=qs[_0x1f45('0x2f')](_0x317ddf[_0x1f45('0x46')][_0x1f45('0x2f')]);_0x3451c3[_0x1f45('0x2c')]=qs[_0x1f45('0x2c')](_0x317ddf[_0x1f45('0x46')][_0x1f45('0x2c')]);}_0x3451c3['order']=qs[_0x1f45('0x4d')](_0x317ddf['query']['sort']);_0x3451c3['where']=qs['filters'](_[_0x1f45('0x50')](_0x317ddf[_0x1f45('0x46')],_0x4e7fce[_0x1f45('0x4f')]));_0x3451c3[_0x1f45('0x4e')][_0x1f45('0x68')]=_0x11a800['id'];if(_0x317ddf[_0x1f45('0x46')][_0x1f45('0x51')]){_0x3451c3[_0x1f45('0x4e')]=_[_0x1f45('0x6b')](_0x3451c3[_0x1f45('0x4e')],{'$or':_[_0x1f45('0x44')](_0x3451c3['attributes'],function(_0x557848){var _0x651e64={};_0x651e64[_0x557848]={'$like':'%'+_0x317ddf[_0x1f45('0x46')][_0x1f45('0x51')]+'%'};return _0x651e64;})});}if(_0x317ddf[_0x1f45('0x46')][_0x1f45('0xab')]){var _0x3c5d43=_0x317ddf['query']['$gte'][_0x1f45('0xac')](',');var _0x470758={};_0x470758[_0x3c5d43[0x0]]={'$gte':moment(_0x3c5d43[0x1])[_0x1f45('0xad')](_0x1f45('0xae'))};_0x3451c3[_0x1f45('0x4e')]=_[_0x1f45('0x6b')](_0x3451c3[_0x1f45('0x4e')],_0x470758);}_0x3451c3=_['merge']({},_0x3451c3,_0x317ddf['options']);return db['FaxMessage'][_0x1f45('0x2e')]({'where':_0x3451c3[_0x1f45('0x4e')]})['then'](function(_0x1be173){_0x5566f1[_0x1f45('0x2e')]=_0x1be173;if(_0x317ddf[_0x1f45('0x46')]['includeAll']){_0x3451c3[_0x1f45('0x5a')]=[{'all':!![]}];}return db[_0x1f45('0xaf')]['findAll'](_0x3451c3);})[_0x1f45('0x34')](function(_0x27e119){_0x5566f1[_0x1f45('0x56')]=_0x27e119;return _0x5566f1;});}})[_0x1f45('0x34')](respondWithFilteredResult(_0x5b62d0,_0x3451c3))[_0x1f45('0x57')](handleError(_0x5b62d0,null));};exports['send']=function(_0x1c5046,_0xd4fc92,_0x24331b){var _0x51e6a8,_0x3e63dc={},_0x5c8d34;if(_0x1c5046[_0x1f45('0x5d')]['to']){_0x5c8d34=_0x1c5046[_0x1f45('0x5d')]['to'][0x0];}return db[_0x1f45('0x3f')]['find']({'where':{'id':_0x1c5046[_0x1f45('0x59')]['id']},'include':[{'model':db[_0x1f45('0xb0')],'as':_0x1f45('0xb1'),'include':[{'model':db[_0x1f45('0x76')],'as':_0x1f45('0xb2'),'where':{'fax':_0x5c8d34},'limit':0x1,'order':[['updatedAt',_0x1f45('0xb3')]]}]}]})['then'](handleEntityNotFound(_0xd4fc92,null))['then'](function(_0x2028d0){_0x51e6a8=_0x2028d0;if(_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')]&&_0x1c5046['body'][_0x1f45('0xb4')]['length']){for(var _0x445eb0=0x0;_0x445eb0<_0x1c5046['body'][_0x1f45('0xb4')][_0x1f45('0x4a')];_0x445eb0+=0x1){_0x1c5046[_0x1f45('0x5d')]['attachments'][_0x445eb0]={'filename':_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][_0x445eb0][_0x1f45('0x3a')],'id':_0x1c5046['body'][_0x1f45('0xb4')][_0x445eb0]['id'],'path':path['join'](config['root'],_0x1f45('0xb5'),_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][_0x445eb0]['basename'])};}}return respondWithRpcPromise(_0x1f45('0xb6'),_0x1f45('0xb6'),{'FaxAccountId':_['isNil'](_0x1c5046[_0x1f45('0x59')]['id'])?undefined:_0x1c5046[_0x1f45('0x59')]['id'],'path':_[_0x1f45('0xb7')](_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][0x0]['path'])?undefined:_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][0x0]['path'],'fax':_[_0x1f45('0xb7')](_0x1c5046[_0x1f45('0x5d')]['to'][0x0])?undefined:_0x1c5046['body']['to'][0x0]},client9002);})[_0x1f45('0x34')](function(){if(_0x51e6a8){if(_[_0x1f45('0xb7')](_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb8')])){_0x1c5046['body'][_0x1f45('0xb8')]=util['format'](_0x1f45('0xb9'),_0x51e6a8[_0x1f45('0x3a')],_0x51e6a8['fax']);}if(_0x51e6a8[_0x1f45('0xb1')]){if(_0x51e6a8[_0x1f45('0xb1')]['Contacts'][_0x1f45('0x4a')]){return _0x51e6a8[_0x1f45('0xb1')][_0x1f45('0xb2')][0x0];}else{return db[_0x1f45('0x76')]['create'](_['defaults'](_0x1c5046[_0x1f45('0x5d')],{'firstName':_0x1c5046[_0x1f45('0x5d')]['to'][0x0],'phone':_0x1c5046[_0x1f45('0x5d')]['to'][0x0],'fax':_0x1c5046[_0x1f45('0x5d')]['to'][0x0],'ListId':_0x51e6a8[_0x1f45('0xa8')]}));}}else{throw new Error(_0x1f45('0xba'));}}else{throw new Error(_0x1f45('0xbb'));}})[_0x1f45('0x34')](function(_0x2d92cc){if(_0x2d92cc){return db[_0x1f45('0x75')][_0x1f45('0x5b')]({'where':{'ContactId':_0x2d92cc['id'],'closed':![],'FaxAccountId':_0x51e6a8['id']}})[_0x1f45('0x34')](function(_0x3d3e5c){if(_0x3d3e5c){return[_0x3d3e5c,![]];}return db[_0x1f45('0x75')][_0x1f45('0x5c')]({'UserId':_0x1c5046[_0x1f45('0x5e')]['id'],'ContactId':_0x2d92cc['id'],'FaxAccountId':_0x51e6a8['id'],'fax':_0x1c5046[_0x1f45('0x5d')]['to'][0x0],'firstMsgDirection':_0x1f45('0xbc'),'Messages':[_[_0x1f45('0x6b')](_0x1c5046[_0x1f45('0x5d')],{'read':![],'body':_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][0x0][_0x1f45('0xbd')],'FaxAccountId':_0x51e6a8['id'],'UserId':_0x1c5046[_0x1f45('0x5e')]['id'],'ContactId':_0x2d92cc['id'],'AttachmentId':_0x1c5046[_0x1f45('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x1f45('0xaf')],'as':_0x1f45('0xbe')}]})['then'](function(_0x549e7f){return[_0x549e7f,!![]];});});}else{throw new Error(_0x1f45('0xbf'));}})[_0x1f45('0xc0')](function(_0x54a1f9,_0x4c99a8){if(_0x4c99a8){return _0x54a1f9;}return db[_0x1f45('0xaf')][_0x1f45('0x5c')]({'direction':'out','read':![],'body':_0x1c5046['body'][_0x1f45('0xb4')][0x0]['filename'],'FaxAccountId':_0x51e6a8['id'],'FaxInteractionId':_0x54a1f9['id'],'UserId':_0x1c5046[_0x1f45('0x5e')]['id'],'ContactId':_0x54a1f9['ContactId'],'AttachmentId':_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][0x0]['id']})['then'](function(_0x4915f7){_0x54a1f9['dataValues'][_0x1f45('0xbe')]=[];_0x54a1f9[_0x1f45('0xc1')]['Messages'][_0x1f45('0x94')](_0x4915f7[_0x1f45('0xc1')]);return _0x54a1f9;});})['then'](function(_0x2fd351){respondWithRpcPromise(_0x1f45('0xc2'),_0x1f45('0xc2'),{'FaxAccountId':_[_0x1f45('0xb7')](_0x1c5046['params']['id'])?undefined:_0x1c5046['params']['id'],'path':_['isNil'](_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][0x0][_0x1f45('0x8')])?undefined:_0x1c5046[_0x1f45('0x5d')]['attachments'][0x0][_0x1f45('0x8')],'fax':_[_0x1f45('0xb7')](_0x1c5046[_0x1f45('0x5d')]['to'][0x0])?undefined:_0x1c5046[_0x1f45('0x5d')]['to'][0x0],'AttachmentId':_0x1c5046[_0x1f45('0x5d')][_0x1f45('0xb4')][0x0]['id']},client9002)[_0x1f45('0x34')](function(_0x55f9ac){logger[_0x1f45('0x1f')](_0x1f45('0xc3'),_0x55f9ac);})[_0x1f45('0x57')](function(_0x1c35fb){logger[_0x1f45('0x1f')]('SendFaxRpc,\x20%s',_0x1c35fb);});return _0x2fd351;})[_0x1f45('0x34')](respondWithResult(_0xd4fc92,null))[_0x1f45('0x57')](handleError(_0xd4fc92,null));};exports[_0x1f45('0xc4')]=function(_0x51bfce,_0x3438d4,_0x5c5972){return db['FaxAccount']['find']({'where':{'id':_0x51bfce[_0x1f45('0x59')]['id']}})['then'](handleEntityNotFound(_0x3438d4,null))[_0x1f45('0x34')](function(_0x57503b){if(_0x57503b){return _0x57503b[_0x1f45('0xc4')](_0x51bfce[_0x1f45('0x5d')][_0x1f45('0x6d')],_[_0x1f45('0x74')](_0x51bfce['body'],[_0x1f45('0x6d'),'id'])||{})[_0x1f45('0xc0')](function(_0x18fa31){for(var _0x5d8324=0x0;_0x5d8324<_0x51bfce[_0x1f45('0x5d')][_0x1f45('0x6d')]['length'];_0x5d8324+=0x1){socket[_0x1f45('0xc5')](_0x1f45('0xc6'),{'UserId':Number(_0x51bfce[_0x1f45('0x5d')][_0x1f45('0x6d')][_0x5d8324]),'FaxAccountId':Number(_0x51bfce[_0x1f45('0x59')]['id'])});}return _0x18fa31;});}})[_0x1f45('0x34')](respondWithResult(_0x3438d4,null))[_0x1f45('0x57')](handleError(_0x3438d4,null));};exports[_0x1f45('0xc7')]=function(_0x4e749c,_0x340c12,_0x42ca53){return db[_0x1f45('0x3f')]['find']({'where':{'id':_0x4e749c[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x340c12,null))[_0x1f45('0x34')](function(_0xa32aa6){if(_0xa32aa6){return _0xa32aa6[_0x1f45('0xc7')](_0x4e749c[_0x1f45('0x46')][_0x1f45('0x6d')])[_0x1f45('0x34')](function(){if(_[_0x1f45('0xc8')](_0x4e749c[_0x1f45('0x46')][_0x1f45('0x6d')])){for(var _0x40da2f=0x0;_0x40da2f<_0x4e749c['query'][_0x1f45('0x6d')][_0x1f45('0x4a')];_0x40da2f+=0x1){socket[_0x1f45('0xc5')](_0x1f45('0xc9'),{'UserId':Number(_0x4e749c[_0x1f45('0x46')]['ids'][_0x40da2f]),'FaxAccountId':Number(_0x4e749c['params']['id'])});}}else{socket[_0x1f45('0xc5')](_0x1f45('0xc9'),{'UserId':Number(_0x4e749c[_0x1f45('0x46')][_0x1f45('0x6d')]),'FaxAccountId':Number(_0x4e749c[_0x1f45('0x59')]['id'])});}});}})[_0x1f45('0x34')](respondWithStatusCode(_0x340c12,null))[_0x1f45('0x57')](handleError(_0x340c12,null));};exports[_0x1f45('0xca')]=function(_0x1ada0a,_0x387a85,_0x151061){var _0x46cfc8={};var _0x5f175d={};var _0x2a5c93;var _0x5c19c2;return db[_0x1f45('0x3f')][_0x1f45('0x6a')]({'where':{'id':_0x1ada0a[_0x1f45('0x59')]['id']}})[_0x1f45('0x34')](handleEntityNotFound(_0x387a85,null))['then'](function(_0x1a2a01){if(_0x1a2a01){_0x2a5c93=_0x1a2a01;_0x5f175d[_0x1f45('0x43')]=_[_0x1f45('0x45')](db['User'][_0x1f45('0x40')]);_0x5f175d[_0x1f45('0x46')]=_[_0x1f45('0x45')](_0x1ada0a[_0x1f45('0x46')]);_0x5f175d[_0x1f45('0x4f')]=_[_0x1f45('0x47')](_0x5f175d['model'],_0x5f175d[_0x1f45('0x46')]);_0x46cfc8[_0x1f45('0x48')]=_[_0x1f45('0x47')](_0x5f175d[_0x1f45('0x43')],qs[_0x1f45('0x49')](_0x1ada0a[_0x1f45('0x46')][_0x1f45('0x49')]));_0x46cfc8[_0x1f45('0x48')]=_0x46cfc8[_0x1f45('0x48')]['length']?_0x46cfc8[_0x1f45('0x48')]:_0x5f175d[_0x1f45('0x43')];_0x46cfc8[_0x1f45('0x4c')]=qs[_0x1f45('0x4d')](_0x1ada0a[_0x1f45('0x46')][_0x1f45('0x4d')]);_0x46cfc8['where']=qs[_0x1f45('0x4f')](_[_0x1f45('0x50')](_0x1ada0a['query'],_0x5f175d[_0x1f45('0x4f')]));if(_0x1ada0a[_0x1f45('0x46')][_0x1f45('0x51')]){_0x46cfc8['where']=_[_0x1f45('0x6b')](_0x46cfc8[_0x1f45('0x4e')],{'$or':_[_0x1f45('0x44')](_0x46cfc8[_0x1f45('0x48')],function(_0xf111ba){var _0x2eca4e={};_0x2eca4e[_0xf111ba]={'$like':'%'+_0x1ada0a[_0x1f45('0x46')][_0x1f45('0x51')]+'%'};return _0x2eca4e;})});}_0x46cfc8=_[_0x1f45('0x6b')]({},_0x46cfc8,_0x1ada0a[_0x1f45('0x53')]);return _0x2a5c93[_0x1f45('0xca')](_0x46cfc8);}})[_0x1f45('0x34')](function(_0x2ecec7){if(_0x2ecec7){_0x5c19c2=_0x2ecec7['length'];if(!_0x1ada0a['query'][_0x1f45('0x4b')](_0x1f45('0x71'))){_0x46cfc8[_0x1f45('0x2f')]=qs[_0x1f45('0x2f')](_0x1ada0a[_0x1f45('0x46')][_0x1f45('0x2f')]);_0x46cfc8[_0x1f45('0x2c')]=qs[_0x1f45('0x2c')](_0x1ada0a[_0x1f45('0x46')][_0x1f45('0x2c')]);}return _0x2a5c93[_0x1f45('0xca')](_0x46cfc8);}})[_0x1f45('0x34')](function(_0x1feb2d){if(_0x1feb2d){return _0x1feb2d?{'count':_0x5c19c2,'rows':_0x1feb2d}:null;}})[_0x1f45('0x34')](respondWithResult(_0x387a85,null))['catch'](handleError(_0x387a85,null));}; \ No newline at end of file +var _0x903c=['faxdetect','maxrate','minrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','CmContact','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','out','filename','Contact\x20not\x20found','spread','ContactId','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','User','getAgents','eml-format','rimraf','request-promise','moment','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','intersection','model','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','FaxAccount','findAll','rows','show','params','keys','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','FaxAccountId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','Contact','Owner','fullname','internal','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','FaxApplication','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','push','CDR(type)=inbound-fax','ecm'];(function(_0x1b8eb3,_0x2c3d86){var _0x2b3196=function(_0x2b79fc){while(--_0x2b79fc){_0x1b8eb3['push'](_0x1b8eb3['shift']());}};_0x2b3196(++_0x2c3d86);}(_0x903c,0x1c2));var _0xc903=function(_0x362cd4,_0x294d91){_0x362cd4=_0x362cd4-0x0;var _0x5ecfc0=_0x903c[_0x362cd4];return _0x5ecfc0;};'use strict';var emlformat=require(_0xc903('0x0'));var rimraf=require(_0xc903('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc903('0x2'));var moment=require(_0xc903('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc903('0x4'));var csv=require(_0xc903('0x5'));var ejs=require(_0xc903('0x6'));var fs=require('fs');var fs_extra=require(_0xc903('0x7'));var _=require('lodash');var squel=require(_0xc903('0x8'));var crypto=require(_0xc903('0x9'));var jsforce=require(_0xc903('0xa'));var deskjs=require(_0xc903('0xb'));var toCsv=require(_0xc903('0x5'));var querystring=require('querystring');var Papa=require(_0xc903('0xc'));var Redis=require(_0xc903('0xd'));var authService=require(_0xc903('0xe'));var qs=require(_0xc903('0xf'));var as=require(_0xc903('0x10'));var hardwareService=require(_0xc903('0x11'));var logger=require(_0xc903('0x12'))(_0xc903('0x13'));var utils=require(_0xc903('0x14'));var config=require(_0xc903('0x15'));var licenseUtil=require(_0xc903('0x16'));var db=require(_0xc903('0x17'))['db'];config[_0xc903('0x18')]=_[_0xc903('0x19')](config[_0xc903('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xc903('0x1a'))(new Redis(config[_0xc903('0x18')]));require(_0xc903('0x1b'))[_0xc903('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xc903('0x1d')][_0xc903('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x410488,_0x17370b,_0x11bac6,_0x3a13a4){return new BPromise(function(_0x2c51d6,_0x5f403a){var _0x1bbb41=_0x3a13a4||client;return _0x1bbb41[_0xc903('0x1f')](_0x410488,_0x11bac6)[_0xc903('0x20')](function(_0xef17ad){logger[_0xc903('0x21')](_0xc903('0x22'),_0x17370b,_0xc903('0x23'));logger[_0xc903('0x24')](_0xc903('0x25'),_0x17370b,_0xc903('0x23'),JSON[_0xc903('0x26')](_0xef17ad));if(_0xef17ad[_0xc903('0x27')]){if(_0xef17ad[_0xc903('0x27')]['code']===0x1f4){logger[_0xc903('0x27')](_0xc903('0x22'),_0x17370b,_0xef17ad[_0xc903('0x27')][_0xc903('0x28')]);return _0x5f403a(_0xef17ad[_0xc903('0x27')][_0xc903('0x28')]);}logger[_0xc903('0x27')](_0xc903('0x22'),_0x17370b,_0xef17ad[_0xc903('0x27')][_0xc903('0x28')]);return _0x2c51d6(_0xef17ad['error'][_0xc903('0x28')]);}else{logger[_0xc903('0x21')](_0xc903('0x22'),_0x17370b,_0xc903('0x23'));_0x2c51d6(_0xef17ad[_0xc903('0x29')][_0xc903('0x28')]);}})[_0xc903('0x2a')](function(_0x5c272c){logger['error']('FaxAccount,\x20%s,\x20%s',_0x17370b,_0x5c272c);_0x5f403a(_0x5c272c);});});}function respondWithStatusCode(_0x407b5d,_0x1d3e85){_0x1d3e85=_0x1d3e85||0xcc;return function(_0x424cd4){if(_0x424cd4){return _0x407b5d[_0xc903('0x2b')](_0x1d3e85);}return _0x407b5d[_0xc903('0x2c')](_0x1d3e85)['end']();};}function respondWithResult(_0x3dcbe5,_0xc2a907){_0xc2a907=_0xc2a907||0xc8;return function(_0x3edb90){if(_0x3edb90){return _0x3dcbe5['status'](_0xc2a907)[_0xc903('0x2d')](_0x3edb90);}};}function respondWithFilteredResult(_0x4084da,_0x4276e2){return function(_0x55a74e){if(_0x55a74e){var _0x458eab=typeof _0x4276e2['offset']==='undefined'&&typeof _0x4276e2[_0xc903('0x2e')]===_0xc903('0x2f');var _0x46d595=_0x55a74e[_0xc903('0x30')];var _0x406548=_0x458eab?0x0:_0x4276e2[_0xc903('0x31')];var _0x207bde=_0x458eab?_0x55a74e['count']:_0x4276e2[_0xc903('0x31')]+_0x4276e2[_0xc903('0x2e')];var _0x4ee76e;if(_0x207bde>=_0x46d595){_0x207bde=_0x46d595;_0x4ee76e=0xc8;}else{_0x4ee76e=0xce;}_0x4084da[_0xc903('0x2c')](_0x4ee76e);return _0x4084da[_0xc903('0x32')](_0xc903('0x33'),_0x406548+'-'+_0x207bde+'/'+_0x46d595)[_0xc903('0x2d')](_0x55a74e);}return null;};}function patchUpdates(_0x252e42){return function(_0x4f7208){try{jsonpatch[_0xc903('0x34')](_0x4f7208,_0x252e42,!![]);}catch(_0xb826a8){return BPromise[_0xc903('0x35')](_0xb826a8);}return _0x4f7208[_0xc903('0x36')]();};}function saveUpdates(_0x12774f,_0x8ac0a0){return function(_0x50061b){if(_0x50061b){return _0x50061b['update'](_0x12774f)[_0xc903('0x20')](function(_0x5040de){return _0x5040de;});}return null;};}function removeEntity(_0x141488,_0x967ea6){return function(_0x1141e2){if(_0x1141e2){return _0x1141e2[_0xc903('0x37')]()[_0xc903('0x20')](function(){var _0x1f460e=_0x1141e2[_0xc903('0x38')]({'plain':!![]});var _0x511e6c=_0xc903('0x39');return db[_0xc903('0x3a')][_0xc903('0x37')]({'where':{'type':_0x511e6c,'resourceId':_0x1f460e['id']}})['then'](function(){return _0x1141e2;});})[_0xc903('0x20')](function(){_0x141488['status'](0xcc)[_0xc903('0x3b')]();});}};}function handleEntityNotFound(_0x63abcf,_0x17c3f7){return function(_0x4ce761){if(!_0x4ce761){_0x63abcf['sendStatus'](0x194);}return _0x4ce761;};}function handleError(_0x53b064,_0x5a7aed){_0x5a7aed=_0x5a7aed||0x1f4;return function(_0x211472){logger['error'](_0x211472[_0xc903('0x3c')]);if(_0x211472['name']){delete _0x211472[_0xc903('0x3d')];}_0x53b064['status'](_0x5a7aed)[_0xc903('0x3e')](_0x211472);};}exports['index']=function(_0x181f8f,_0x2549a2){var _0x47d6d0={'include':[{'model':db[_0xc903('0x3f')],'as':_0xc903('0x40')}]},_0x3087ec={},_0x27942d={'count':0x0,'rows':[]};var _0x705567=_[_0xc903('0x41')](db['FaxAccount'][_0xc903('0x42')],function(_0x4fec55){return{'name':_0x4fec55[_0xc903('0x43')],'type':_0x4fec55[_0xc903('0x44')]['key']};});_0x3087ec['model']=_['map'](_0x705567,_0xc903('0x3d'));_0x3087ec['query']=_['keys'](_0x181f8f['query']);_0x3087ec['filters']=_[_0xc903('0x45')](_0x3087ec[_0xc903('0x46')],_0x3087ec[_0xc903('0x47')]);_0x47d6d0[_0xc903('0x48')]=_[_0xc903('0x45')](_0x3087ec[_0xc903('0x46')],qs[_0xc903('0x49')](_0x181f8f[_0xc903('0x47')][_0xc903('0x49')]));_0x47d6d0[_0xc903('0x48')]=_0x47d6d0[_0xc903('0x48')][_0xc903('0x4a')]?_0x47d6d0[_0xc903('0x48')]:_0x3087ec[_0xc903('0x46')];if(!_0x181f8f[_0xc903('0x47')]['hasOwnProperty'](_0xc903('0x4b'))){_0x47d6d0[_0xc903('0x2e')]=qs[_0xc903('0x2e')](_0x181f8f['query']['limit']);_0x47d6d0[_0xc903('0x31')]=qs[_0xc903('0x31')](_0x181f8f['query'][_0xc903('0x31')]);}_0x47d6d0[_0xc903('0x4c')]=qs['sort'](_0x181f8f[_0xc903('0x47')][_0xc903('0x4d')]);_0x47d6d0[_0xc903('0x4e')]=qs[_0xc903('0x4f')](_[_0xc903('0x50')](_0x181f8f[_0xc903('0x47')],_0x3087ec[_0xc903('0x4f')]),_0x705567);if(_0x181f8f[_0xc903('0x47')]['filter']){_0x47d6d0['where']=_[_0xc903('0x51')](_0x47d6d0[_0xc903('0x4e')],{'$or':_[_0xc903('0x41')](_0x705567,function(_0x1b3ade){if(_0x1b3ade[_0xc903('0x44')]!==_0xc903('0x52')){var _0x10b517={};_0x10b517[_0x1b3ade[_0xc903('0x3d')]]={'$like':'%'+_0x181f8f[_0xc903('0x47')][_0xc903('0x53')]+'%'};return _0x10b517;}})});}_0x47d6d0=_['merge']({},_0x47d6d0,_0x181f8f['options']);var _0x144db3={'where':_0x47d6d0[_0xc903('0x4e')]};return db['FaxAccount'][_0xc903('0x30')](_0x144db3)[_0xc903('0x20')](function(_0x334281){_0x27942d[_0xc903('0x30')]=_0x334281;if(_0x181f8f[_0xc903('0x47')][_0xc903('0x54')]){_0x47d6d0[_0xc903('0x55')]=[{'all':!![]}];}return db[_0xc903('0x56')][_0xc903('0x57')](_0x47d6d0);})[_0xc903('0x20')](function(_0x2a8686){_0x27942d[_0xc903('0x58')]=_0x2a8686;return _0x27942d;})[_0xc903('0x20')](respondWithFilteredResult(_0x2549a2,_0x47d6d0))[_0xc903('0x2a')](handleError(_0x2549a2,null));};exports[_0xc903('0x59')]=function(_0x5d72e6,_0x176300){var _0x2244b3={'raw':![],'where':{'id':_0x5d72e6[_0xc903('0x5a')]['id']},'include':[{'model':db[_0xc903('0x3f')],'as':_0xc903('0x40')}]},_0x5078b3={};_0x5078b3['model']=_[_0xc903('0x5b')](db[_0xc903('0x56')][_0xc903('0x42')]);_0x5078b3[_0xc903('0x47')]=_['keys'](_0x5d72e6['query']);_0x5078b3[_0xc903('0x4f')]=_[_0xc903('0x45')](_0x5078b3[_0xc903('0x46')],_0x5078b3['query']);_0x2244b3[_0xc903('0x48')]=_['intersection'](_0x5078b3[_0xc903('0x46')],qs[_0xc903('0x49')](_0x5d72e6[_0xc903('0x47')][_0xc903('0x49')]));_0x2244b3[_0xc903('0x48')]=_0x2244b3[_0xc903('0x48')][_0xc903('0x4a')]?_0x2244b3[_0xc903('0x48')]:_0x5078b3[_0xc903('0x46')];if(_0x5d72e6['query']['includeAll']){_0x2244b3[_0xc903('0x55')]=[{'all':!![]}];}_0x2244b3=_['merge']({},_0x2244b3,_0x5d72e6[_0xc903('0x5c')]);return db[_0xc903('0x56')][_0xc903('0x5d')](_0x2244b3)[_0xc903('0x20')](handleEntityNotFound(_0x176300,null))[_0xc903('0x20')](respondWithResult(_0x176300,null))['catch'](handleError(_0x176300,null));};exports[_0xc903('0x5e')]=function(_0xfa2d70,_0x2ec0a4){return db[_0xc903('0x56')][_0xc903('0x5e')](_0xfa2d70[_0xc903('0x5f')],{})[_0xc903('0x20')](function(_0x48c827){var _0x2ecd10=_0xfa2d70[_0xc903('0x60')][_0xc903('0x38')]({'plain':!![]});if(!_0x2ecd10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ecd10[_0xc903('0x61')]===_0xc903('0x60')){var _0x54f6a1=_0x48c827[_0xc903('0x38')]({'plain':!![]});var _0x128889='FaxAccounts';return db[_0xc903('0x62')]['find']({'where':{'name':_0x128889,'userProfileId':_0x2ecd10['userProfileId']},'raw':!![]})[_0xc903('0x20')](function(_0x5595cc){if(_0x5595cc&&_0x5595cc[_0xc903('0x63')]===0x0){return db[_0xc903('0x3a')]['create']({'name':_0x54f6a1[_0xc903('0x3d')],'resourceId':_0x54f6a1['id'],'type':_0x5595cc[_0xc903('0x3d')],'sectionId':_0x5595cc['id']},{})[_0xc903('0x20')](function(){return _0x48c827;});}else{return _0x48c827;}})['catch'](function(_0x437b66){logger[_0xc903('0x27')](_0xc903('0x64'),_0x437b66);throw _0x437b66;});}return _0x48c827;})[_0xc903('0x20')](respondWithResult(_0x2ec0a4,0xc9))[_0xc903('0x2a')](handleError(_0x2ec0a4,null));};exports[_0xc903('0x65')]=function(_0x288165,_0x71c638){if(_0x288165[_0xc903('0x5f')]['id']){delete _0x288165['body']['id'];}return db[_0xc903('0x56')][_0xc903('0x5d')]({'where':{'id':_0x288165[_0xc903('0x5a')]['id']},'include':[{'model':db[_0xc903('0x3f')],'as':_0xc903('0x40')}]})[_0xc903('0x20')](handleEntityNotFound(_0x71c638,null))['then'](saveUpdates(_0x288165[_0xc903('0x5f')],null))[_0xc903('0x20')](respondWithResult(_0x71c638,null))['catch'](handleError(_0x71c638,null));};exports[_0xc903('0x37')]=function(_0x11feed,_0x3d9eeb){return db['FaxAccount'][_0xc903('0x5d')]({'where':{'id':_0x11feed[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x3d9eeb,null))[_0xc903('0x20')](removeEntity(_0x3d9eeb,null))[_0xc903('0x2a')](handleError(_0x3d9eeb,null));};exports['describe']=function(_0x419ce1,_0xdc26f6){return db[_0xc903('0x56')][_0xc903('0x66')]()[_0xc903('0x20')](respondWithResult(_0xdc26f6,null))['catch'](handleError(_0xdc26f6,null));};exports['addDisposition']=function(_0x3b962a,_0x4c6ee7,_0x556b72){if(_0x3b962a[_0xc903('0x5f')]['id']){delete _0x3b962a[_0xc903('0x5f')]['id'];}return db['FaxAccount'][_0xc903('0x5d')]({'where':{'id':_0x3b962a[_0xc903('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4c6ee7,null))[_0xc903('0x20')](function(_0x5251b0){if(_0x5251b0){_0x3b962a[_0xc903('0x5f')][_0xc903('0x67')]=_0x5251b0['id'];return db[_0xc903('0x68')][_0xc903('0x5e')](_0x3b962a[_0xc903('0x5f')]);}})[_0xc903('0x20')](respondWithResult(_0x4c6ee7,null))[_0xc903('0x2a')](handleError(_0x4c6ee7,null));};exports[_0xc903('0x69')]=function(_0xa62cae,_0x31820d,_0x47993e){var _0x3b83ed={'raw':![],'where':{}};var _0x3bea8f={};var _0x5460ca={'count':0x0,'rows':[]};return db[_0xc903('0x56')][_0xc903('0x6a')]({'where':{'id':_0xa62cae[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x31820d,null))[_0xc903('0x20')](function(_0x27e586){if(_0x27e586){_0x3bea8f['model']=_[_0xc903('0x5b')](db[_0xc903('0x68')][_0xc903('0x42')]);_0x3bea8f['query']=_[_0xc903('0x5b')](_0xa62cae[_0xc903('0x47')]);_0x3bea8f[_0xc903('0x4f')]=_[_0xc903('0x45')](_0x3bea8f[_0xc903('0x46')],_0x3bea8f['query']);_0x3b83ed['attributes']=_[_0xc903('0x45')](_0x3bea8f['model'],qs[_0xc903('0x49')](_0xa62cae['query'][_0xc903('0x49')]));_0x3b83ed['attributes']=_0x3b83ed[_0xc903('0x48')][_0xc903('0x4a')]?_0x3b83ed[_0xc903('0x48')]:_0x3bea8f[_0xc903('0x46')];if(!_0xa62cae[_0xc903('0x47')][_0xc903('0x6b')](_0xc903('0x4b'))){_0x3b83ed['limit']=qs[_0xc903('0x2e')](_0xa62cae[_0xc903('0x47')][_0xc903('0x2e')]);_0x3b83ed[_0xc903('0x31')]=qs[_0xc903('0x31')](_0xa62cae[_0xc903('0x47')][_0xc903('0x31')]);}_0x3b83ed['order']=qs[_0xc903('0x4d')](_0xa62cae['query']['sort']);_0x3b83ed[_0xc903('0x4e')]=qs[_0xc903('0x4f')](_[_0xc903('0x50')](_0xa62cae['query'],_0x3bea8f[_0xc903('0x4f')]));_0x3b83ed[_0xc903('0x4e')]['FaxAccountId']=_0x27e586['id'];if(_0xa62cae[_0xc903('0x47')]['filter']){_0x3b83ed[_0xc903('0x4e')]=_['merge'](_0x3b83ed['where'],{'$or':_[_0xc903('0x41')](_0x3b83ed[_0xc903('0x48')],function(_0x4e9c1c){var _0x3c7ee5={};_0x3c7ee5[_0x4e9c1c]={'$like':'%'+_0xa62cae['query'][_0xc903('0x53')]+'%'};return _0x3c7ee5;})});}_0x3b83ed=_[_0xc903('0x51')]({},_0x3b83ed,_0xa62cae[_0xc903('0x5c')]);return db['Disposition'][_0xc903('0x30')]({'where':_0x3b83ed[_0xc903('0x4e')]})[_0xc903('0x20')](function(_0x4c4cb1){_0x5460ca[_0xc903('0x30')]=_0x4c4cb1;if(_0xa62cae[_0xc903('0x47')][_0xc903('0x54')]){_0x3b83ed[_0xc903('0x55')]=[{'all':!![]}];}return db[_0xc903('0x68')][_0xc903('0x57')](_0x3b83ed);})[_0xc903('0x20')](function(_0x3fba18){_0x5460ca[_0xc903('0x58')]=_0x3fba18;return _0x5460ca;});}})[_0xc903('0x20')](respondWithFilteredResult(_0x31820d,_0x3b83ed))[_0xc903('0x2a')](handleError(_0x31820d,null));};exports[_0xc903('0x6c')]=function(_0x4f07b8,_0x308663,_0x496c27){return db[_0xc903('0x56')][_0xc903('0x5d')]({'where':{'id':_0x4f07b8[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x308663,null))['then'](function(_0x5cdc88){if(_0x5cdc88){return _0x5cdc88[_0xc903('0x6c')](_0x4f07b8['query'][_0xc903('0x6d')]);}})[_0xc903('0x20')](respondWithStatusCode(_0x308663,null))[_0xc903('0x2a')](handleError(_0x308663,null));};exports[_0xc903('0x6e')]=function(_0x24d0b3,_0x195acc,_0x9d481f){if(_0x24d0b3[_0xc903('0x5f')]['id']){delete _0x24d0b3[_0xc903('0x5f')]['id'];}return db[_0xc903('0x56')][_0xc903('0x5d')]({'where':{'id':_0x24d0b3[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x195acc,null))[_0xc903('0x20')](function(_0x37ba8c){if(_0x37ba8c){_0x24d0b3['body'][_0xc903('0x67')]=_0x37ba8c['id'];return db[_0xc903('0x6f')][_0xc903('0x5e')](_0x24d0b3[_0xc903('0x5f')]);}})['then'](respondWithResult(_0x195acc,null))[_0xc903('0x2a')](handleError(_0x195acc,null));};exports[_0xc903('0x70')]=function(_0xab9ab9,_0x25dda3,_0x571d32){var _0x1027f2={'raw':![],'where':{}};var _0x439642={};var _0x3986a4={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc903('0x6a')]({'where':{'id':_0xab9ab9['params']['id']}})['then'](handleEntityNotFound(_0x25dda3,null))[_0xc903('0x20')](function(_0x34ffd0){if(_0x34ffd0){_0x439642[_0xc903('0x46')]=_[_0xc903('0x5b')](db[_0xc903('0x6f')]['rawAttributes']);_0x439642[_0xc903('0x47')]=_[_0xc903('0x5b')](_0xab9ab9[_0xc903('0x47')]);_0x439642[_0xc903('0x4f')]=_['intersection'](_0x439642[_0xc903('0x46')],_0x439642[_0xc903('0x47')]);_0x1027f2[_0xc903('0x48')]=_[_0xc903('0x45')](_0x439642[_0xc903('0x46')],qs[_0xc903('0x49')](_0xab9ab9[_0xc903('0x47')][_0xc903('0x49')]));_0x1027f2['attributes']=_0x1027f2[_0xc903('0x48')]['length']?_0x1027f2['attributes']:_0x439642['model'];if(!_0xab9ab9[_0xc903('0x47')][_0xc903('0x6b')](_0xc903('0x4b'))){_0x1027f2[_0xc903('0x2e')]=qs[_0xc903('0x2e')](_0xab9ab9[_0xc903('0x47')][_0xc903('0x2e')]);_0x1027f2[_0xc903('0x31')]=qs[_0xc903('0x31')](_0xab9ab9[_0xc903('0x47')][_0xc903('0x31')]);}_0x1027f2[_0xc903('0x4c')]=qs[_0xc903('0x4d')](_0xab9ab9[_0xc903('0x47')][_0xc903('0x4d')]);_0x1027f2[_0xc903('0x4e')]=qs['filters'](_[_0xc903('0x50')](_0xab9ab9[_0xc903('0x47')],_0x439642[_0xc903('0x4f')]));_0x1027f2[_0xc903('0x4e')][_0xc903('0x67')]=_0x34ffd0['id'];if(_0xab9ab9[_0xc903('0x47')][_0xc903('0x53')]){_0x1027f2[_0xc903('0x4e')]=_[_0xc903('0x51')](_0x1027f2[_0xc903('0x4e')],{'$or':_[_0xc903('0x41')](_0x1027f2[_0xc903('0x48')],function(_0x9ef2e7){var _0x230f9f={};_0x230f9f[_0x9ef2e7]={'$like':'%'+_0xab9ab9[_0xc903('0x47')][_0xc903('0x53')]+'%'};return _0x230f9f;})});}_0x1027f2=_[_0xc903('0x51')]({},_0x1027f2,_0xab9ab9[_0xc903('0x5c')]);return db[_0xc903('0x6f')][_0xc903('0x30')]({'where':_0x1027f2['where']})[_0xc903('0x20')](function(_0x4a0ad4){_0x3986a4['count']=_0x4a0ad4;if(_0xab9ab9[_0xc903('0x47')][_0xc903('0x54')]){_0x1027f2[_0xc903('0x55')]=[{'all':!![]}];}return db[_0xc903('0x6f')][_0xc903('0x57')](_0x1027f2);})[_0xc903('0x20')](function(_0x2ea568){_0x3986a4[_0xc903('0x58')]=_0x2ea568;return _0x3986a4;});}})[_0xc903('0x20')](respondWithFilteredResult(_0x25dda3,_0x1027f2))[_0xc903('0x2a')](handleError(_0x25dda3,null));};exports[_0xc903('0x71')]=function(_0x7b891,_0x419494,_0x3c685){return db[_0xc903('0x56')][_0xc903('0x5d')]({'where':{'id':_0x7b891[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x419494,null))[_0xc903('0x20')](function(_0x457b6b){if(_0x457b6b){return _0x457b6b[_0xc903('0x71')](_0x7b891[_0xc903('0x47')][_0xc903('0x6d')]);}})['then'](respondWithStatusCode(_0x419494,null))[_0xc903('0x2a')](handleError(_0x419494,null));};exports[_0xc903('0x72')]=function(_0x1aaffc,_0x55b004,_0xc46cba){return db[_0xc903('0x73')][_0xc903('0x5d')]({'where':{'id':_0x1aaffc['params']['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x55b004,null))['then'](function(_0x171af7){if(_0x171af7){return _0x171af7[_0xc903('0x72')](_0x1aaffc[_0xc903('0x5f')][_0xc903('0x6d')],_[_0xc903('0x74')](_0x1aaffc[_0xc903('0x5f')],[_0xc903('0x6d'),'id'])||{});}})[_0xc903('0x20')](respondWithResult(_0x55b004,null))[_0xc903('0x2a')](handleError(_0x55b004,null));};exports['getInteractions']=function(_0x19e2cd,_0x1e659f,_0x4a7ac2){var _0x50389c={'raw':![],'where':{}};var _0x17f785={};var _0x67f93e={'count':0x0,'rows':[]};return db[_0xc903('0x56')]['findOne']({'where':{'id':_0x19e2cd[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x1e659f,null))[_0xc903('0x20')](function(_0x15caaa){if(_0x15caaa){_0x17f785['model']=_[_0xc903('0x5b')](db['FaxInteraction'][_0xc903('0x42')]);_0x17f785['query']=_[_0xc903('0x5b')](_0x19e2cd[_0xc903('0x47')]);_0x17f785['filters']=_[_0xc903('0x45')](_0x17f785[_0xc903('0x46')],_0x17f785[_0xc903('0x47')]);_0x50389c[_0xc903('0x48')]=_[_0xc903('0x45')](_0x17f785['model'],qs[_0xc903('0x49')](_0x19e2cd[_0xc903('0x47')][_0xc903('0x49')]));_0x50389c[_0xc903('0x48')]=_0x50389c['attributes'][_0xc903('0x4a')]?_0x50389c[_0xc903('0x48')]:_0x17f785[_0xc903('0x46')];if(!_0x19e2cd[_0xc903('0x47')]['hasOwnProperty']('nolimit')){_0x50389c['limit']=qs[_0xc903('0x2e')](_0x19e2cd['query'][_0xc903('0x2e')]);_0x50389c[_0xc903('0x31')]=qs[_0xc903('0x31')](_0x19e2cd[_0xc903('0x47')][_0xc903('0x31')]);}_0x50389c[_0xc903('0x4c')]=qs['sort'](_0x19e2cd['query'][_0xc903('0x4d')]);_0x50389c[_0xc903('0x4e')]=qs[_0xc903('0x4f')](_[_0xc903('0x50')](_0x19e2cd[_0xc903('0x47')],_0x17f785[_0xc903('0x4f')]));_0x50389c['where']['FaxAccountId']=_0x15caaa['id'];if(_0x19e2cd[_0xc903('0x47')][_0xc903('0x53')]){_0x50389c[_0xc903('0x4e')]=_['merge'](_0x50389c[_0xc903('0x4e')],{'$or':_[_0xc903('0x41')](_0x50389c[_0xc903('0x48')],function(_0x3795de){var _0xb6d76d={};_0xb6d76d[_0x3795de]={'$like':'%'+_0x19e2cd[_0xc903('0x47')]['filter']+'%'};return _0xb6d76d;})});}_0x50389c=_['merge']({},_0x50389c,_0x19e2cd[_0xc903('0x5c')]);return db[_0xc903('0x73')]['count']({'where':_0x50389c[_0xc903('0x4e')]})[_0xc903('0x20')](function(_0x7cba50){_0x67f93e[_0xc903('0x30')]=_0x7cba50;if(_0x19e2cd[_0xc903('0x47')]['includeAll']){_0x50389c[_0xc903('0x55')]=[{'model':db['CmContact'],'as':_0xc903('0x75'),'required':![]},{'model':db['User'],'as':_0xc903('0x76'),'attributes':[_0xc903('0x3d'),_0xc903('0x77'),_0xc903('0x78')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xc903('0x3d'),_0xc903('0x79')],'where':_0x19e2cd[_0xc903('0x47')]['tag']?{'id':_0x19e2cd[_0xc903('0x47')][_0xc903('0x7a')]}:undefined,'required':_0x19e2cd[_0xc903('0x47')]['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x50389c);})[_0xc903('0x20')](function(_0x195382){_0x67f93e[_0xc903('0x58')]=_0x195382;return _0x67f93e;});}})[_0xc903('0x20')](respondWithFilteredResult(_0x1e659f,_0x50389c))[_0xc903('0x2a')](handleError(_0x1e659f,null));};exports[_0xc903('0x7b')]=function(_0x5a8029,_0x391729){var _0x599e19=_0x5a8029[_0xc903('0x5a')]['id'];var _0x1ca70c=_0x5a8029['body'];var _0x55a951=0xc8;var _0x279b59=null;return db[_0xc903('0x7c')][_0xc903('0x7d')]({'isolationLevel':db[_0xc903('0x7c')][_0xc903('0x7e')][_0xc903('0x7f')][_0xc903('0x80')]},function(_0x45db93){return db['FaxAccount'][_0xc903('0x6a')]({'where':{'id':_0x599e19},'transaction':_0x45db93})[_0xc903('0x20')](function(_0x5e8639){if(_0x5e8639){return db['FaxApplication'][_0xc903('0x37')]({'where':{'FaxAccountId':_0x599e19},'transaction':_0x45db93})[_0xc903('0x20')](function(){var _0x37a175=_[_0xc903('0x41')](_0x1ca70c,function(_0x298cbb){_0x298cbb[_0xc903('0x67')]=_0x599e19;return _0x298cbb;});return db['FaxApplication'][_0xc903('0x81')](_0x37a175,{'transaction':_0x45db93});});}else{_0x55a951=0x194;_0x279b59=[];}});})[_0xc903('0x20')](function(){if(_0x55a951!==0x194){return db[_0xc903('0x82')][_0xc903('0x83')]({'where':{'FaxAccountId':_0x599e19},'order':_0xc903('0x84')})[_0xc903('0x20')](function(_0x13aacd){_0x279b59=_0x13aacd;});}})[_0xc903('0x2a')](function(_0x342e67){_0x55a951=0x1f4;logger[_0xc903('0x27')](_0x342e67['stack']);if(_0x342e67[_0xc903('0x3d')]){delete _0x342e67['name'];}_0x279b59=_0x342e67;})[_0xc903('0x85')](function(){if(_0x279b59===null){_0x391729[_0xc903('0x2b')](_0x55a951);}else{if(_0x55a951===0x1f4){_0x391729['status'](_0x55a951)[_0xc903('0x3e')](_0x279b59);}else{_0x391729[_0xc903('0x2c')](_0x55a951)[_0xc903('0x2d')](_0x279b59);}}});};exports['getApplications']=function(_0x15627a,_0x5f5c67,_0x25c998){var _0xeb6da3={};var _0x438b88={};var _0x2448eb;var _0x4f67f7;return db[_0xc903('0x56')]['findOne']({'where':{'id':_0x15627a[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x5f5c67,null))[_0xc903('0x20')](function(_0x3da358){if(_0x3da358){_0x2448eb=_0x3da358;_0x438b88[_0xc903('0x46')]=_[_0xc903('0x5b')](db['FaxApplication']['rawAttributes']);_0x438b88['query']=_[_0xc903('0x5b')](_0x15627a['query']);_0x438b88['filters']=_[_0xc903('0x45')](_0x438b88[_0xc903('0x46')],_0x438b88['query']);_0xeb6da3[_0xc903('0x48')]=_[_0xc903('0x45')](_0x438b88[_0xc903('0x46')],qs[_0xc903('0x49')](_0x15627a[_0xc903('0x47')][_0xc903('0x49')]));_0xeb6da3[_0xc903('0x48')]=_0xeb6da3[_0xc903('0x48')][_0xc903('0x4a')]?_0xeb6da3[_0xc903('0x48')]:_0x438b88[_0xc903('0x46')];_0xeb6da3[_0xc903('0x4c')]=qs[_0xc903('0x4d')](_0x15627a['query']['sort']);_0xeb6da3[_0xc903('0x4e')]=qs[_0xc903('0x4f')](_['pick'](_0x15627a[_0xc903('0x47')],_0x438b88[_0xc903('0x4f')]));if(_0x15627a[_0xc903('0x47')]['filter']){_0xeb6da3['where']=_[_0xc903('0x51')](_0xeb6da3[_0xc903('0x4e')],{'$or':_[_0xc903('0x41')](_0xeb6da3[_0xc903('0x48')],function(_0x3e7907){var _0x2c7f29={};_0x2c7f29[_0x3e7907]={'$like':'%'+_0x15627a[_0xc903('0x47')]['filter']+'%'};return _0x2c7f29;})});}_0xeb6da3=_[_0xc903('0x51')]({},_0xeb6da3,_0x15627a['options']);return _0x2448eb['getApplications'](_0xeb6da3);}})[_0xc903('0x20')](function(_0x119f5c){if(_0x119f5c){_0x4f67f7=_0x119f5c[_0xc903('0x4a')];if(!_0x15627a[_0xc903('0x47')]['hasOwnProperty']('nolimit')){_0xeb6da3[_0xc903('0x2e')]=qs[_0xc903('0x2e')](_0x15627a[_0xc903('0x47')]['limit']);_0xeb6da3[_0xc903('0x31')]=qs[_0xc903('0x31')](_0x15627a[_0xc903('0x47')][_0xc903('0x31')]);}return _0x2448eb[_0xc903('0x86')](_0xeb6da3);}})[_0xc903('0x20')](function(_0x304bdd){if(_0x304bdd){return _0x304bdd?{'count':_0x4f67f7,'rows':_0x304bdd}:null;}})[_0xc903('0x20')](respondWithResult(_0x5f5c67,null))[_0xc903('0x2a')](handleError(_0x5f5c67,null));};function Extension(_0x5333bc,_0x138e1f,_0x5c5df2,_0x24f1fa){this[_0xc903('0x87')]=_0xc903('0x88');this[_0xc903('0x89')]=_0x5333bc[_0xc903('0x8a')];this[_0xc903('0x8b')]=_0x24f1fa;this[_0xc903('0x44')]='system';this['description']=_0xc903('0x8c');this[_0xc903('0x67')]=_0x5333bc['id'];this['priority']=_0x138e1f;this['appdata']=_0x5c5df2;}function createExtensionsReciveFax(_0x532d04){var _0xd46f62=0x1;var _0x110150=[];_0x110150[_0xc903('0x8d')](new Extension(_0x532d04,_0xd46f62,'','Answer'));_0xd46f62+=0x1;_0x110150[_0xc903('0x8d')](new Extension(_0x532d04,_0xd46f62,_0xc903('0x8e'),'Set'));_0xd46f62+=0x1;for(var _0x3824cb in _0x532d04){if(_0x532d04['hasOwnProperty'](_0x3824cb)&&(_0x3824cb===_0xc903('0x8f')||_0x3824cb===_0xc903('0x8a')||_0x3824cb==='gateway'||_0x3824cb===_0xc903('0x90')||_0x3824cb==='headerinfo'||_0x3824cb===_0xc903('0x91')||_0x3824cb===_0xc903('0x92')||_0x3824cb==='modem'||_0x3824cb===_0xc903('0x93'))){_0x110150[_0xc903('0x8d')](new Extension(_0x532d04,_0xd46f62,_0xc903('0x94')+_0x3824cb+')='+_0x532d04[_0x3824cb],'Set'));_0xd46f62+=0x1;}}_0x110150['push'](new Extension(_0x532d04,_0xd46f62,'6',_0xc903('0x95')));_0xd46f62+=0x1;_0x110150['push'](new Extension(_0x532d04,_0xd46f62,_0xc903('0x96'),'ReceiveFax'));_0xd46f62=0x0;return _0x110150;}exports[_0xc903('0x97')]=function(_0x940149,_0x4939d2,_0x2bad72){var _0x3054cc;return db[_0xc903('0x7c')][_0xc903('0x7d')](function(_0x1ff03f){return db[_0xc903('0x56')]['create'](_0x940149['body'],{'transaction':_0x1ff03f})[_0xc903('0x20')](function(_0x37aa34){_0x3054cc=_0x37aa34['get']({'plain':!![]});return db[_0xc903('0x98')][_0xc903('0x81')](createExtensionsReciveFax(_0x3054cc),{'transaction':_0x1ff03f});});})[_0xc903('0x20')](function(){return _0x3054cc;})[_0xc903('0x20')](respondWithResult(_0x4939d2,null))['catch'](handleError(_0x4939d2,null));};exports[_0xc903('0x99')]=function(_0x519c96,_0x5e81a5,_0x3c1b05){var _0x5e457b;return db[_0xc903('0x7c')][_0xc903('0x7d')](function(_0xd7d75){return db[_0xc903('0x56')][_0xc903('0x65')](_0x519c96[_0xc903('0x5f')],{'where':{'id':_0x519c96[_0xc903('0x5f')]['id']},'transaction':_0xd7d75})[_0xc903('0x20')](function(_0x55c875){return db[_0xc903('0x98')][_0xc903('0x37')]({'where':{'FaxAccountId':_0x519c96[_0xc903('0x5f')]['id']},'transaction':_0xd7d75})[_0xc903('0x20')](function(_0x3e3515){return db[_0xc903('0x98')][_0xc903('0x81')](createExtensionsReciveFax(_[_0xc903('0x74')](_0x519c96['body'],[_0xc903('0x9a'),'key',_0xc903('0x9b'),'updatedAt',_0xc903('0x9c'),_0xc903('0x9d')])),{'transaction':_0xd7d75});});});})[_0xc903('0x20')](function(){return db[_0xc903('0x56')][_0xc903('0x9e')](_0x519c96[_0xc903('0x5f')]['id']);})[_0xc903('0x20')](respondWithResult(_0x5e81a5,null))[_0xc903('0x2a')](handleError(_0x5e81a5,null));};exports[_0xc903('0x9f')]=function(_0x38ea98,_0x32f5b8,_0x8299b4){var _0x6a8159={'raw':!![],'where':{}};var _0x4e91e7={};var _0x1e4a13={'count':0x0,'rows':[]};return db[_0xc903('0x56')]['findOne']({'where':{'id':_0x38ea98['params']['id']}})[_0xc903('0x20')](handleEntityNotFound(_0x32f5b8,null))[_0xc903('0x20')](function(_0x84c72e){if(_0x84c72e){_0x4e91e7[_0xc903('0x46')]=_[_0xc903('0x5b')](db[_0xc903('0xa0')][_0xc903('0x42')]);_0x4e91e7[_0xc903('0x47')]=_['keys'](_0x38ea98[_0xc903('0x47')]);_0x4e91e7[_0xc903('0x4f')]=_[_0xc903('0x45')](_0x4e91e7[_0xc903('0x46')],_0x4e91e7[_0xc903('0x47')]);_0x6a8159[_0xc903('0x48')]=_[_0xc903('0x45')](_0x4e91e7[_0xc903('0x46')],qs['fields'](_0x38ea98[_0xc903('0x47')][_0xc903('0x49')]));_0x6a8159[_0xc903('0x48')]=_0x6a8159[_0xc903('0x48')][_0xc903('0x4a')]?_0x6a8159['attributes']:_0x4e91e7['model'];if(!_0x38ea98[_0xc903('0x47')][_0xc903('0x6b')](_0xc903('0x4b'))){_0x6a8159[_0xc903('0x2e')]=qs[_0xc903('0x2e')](_0x38ea98[_0xc903('0x47')][_0xc903('0x2e')]);_0x6a8159[_0xc903('0x31')]=qs[_0xc903('0x31')](_0x38ea98[_0xc903('0x47')][_0xc903('0x31')]);}_0x6a8159[_0xc903('0x4c')]=qs[_0xc903('0x4d')](_0x38ea98[_0xc903('0x47')][_0xc903('0x4d')]);_0x6a8159[_0xc903('0x4e')]=qs['filters'](_[_0xc903('0x50')](_0x38ea98[_0xc903('0x47')],_0x4e91e7[_0xc903('0x4f')]));_0x6a8159['where'][_0xc903('0x67')]=_0x84c72e['id'];if(_0x38ea98['query'][_0xc903('0x53')]){_0x6a8159[_0xc903('0x4e')]=_[_0xc903('0x51')](_0x6a8159[_0xc903('0x4e')],{'$or':_['map'](_0x6a8159[_0xc903('0x48')],function(_0x369ae7){var _0x30af98={};_0x30af98[_0x369ae7]={'$like':'%'+_0x38ea98[_0xc903('0x47')][_0xc903('0x53')]+'%'};return _0x30af98;})});}if(_0x38ea98[_0xc903('0x47')][_0xc903('0xa1')]){var _0x1002b9=_0x38ea98[_0xc903('0x47')]['$gte'][_0xc903('0xa2')](',');var _0x4ff484={};_0x4ff484[_0x1002b9[0x0]]={'$gte':moment(_0x1002b9[0x1])[_0xc903('0xa3')](_0xc903('0xa4'))};_0x6a8159[_0xc903('0x4e')]=_[_0xc903('0x51')](_0x6a8159[_0xc903('0x4e')],_0x4ff484);}_0x6a8159=_['merge']({},_0x6a8159,_0x38ea98[_0xc903('0x5c')]);return db[_0xc903('0xa0')]['count']({'where':_0x6a8159[_0xc903('0x4e')]})[_0xc903('0x20')](function(_0x16c9e4){_0x1e4a13[_0xc903('0x30')]=_0x16c9e4;if(_0x38ea98[_0xc903('0x47')]['includeAll']){_0x6a8159[_0xc903('0x55')]=[{'all':!![]}];}return db[_0xc903('0xa0')]['findAll'](_0x6a8159);})[_0xc903('0x20')](function(_0x4923b8){_0x1e4a13[_0xc903('0x58')]=_0x4923b8;return _0x1e4a13;});}})[_0xc903('0x20')](respondWithFilteredResult(_0x32f5b8,_0x6a8159))[_0xc903('0x2a')](handleError(_0x32f5b8,null));};exports['send']=function(_0xfcfa62,_0x351935,_0x50c3a3){var _0x704b25,_0x4abcbb={},_0x5864a2;if(_0xfcfa62['body']['to']){_0x5864a2=_0xfcfa62[_0xc903('0x5f')]['to'][0x0];}return db[_0xc903('0x56')][_0xc903('0x5d')]({'where':{'id':_0xfcfa62[_0xc903('0x5a')]['id']},'include':[{'model':db[_0xc903('0xa5')],'as':'List','include':[{'model':db[_0xc903('0xa6')],'as':_0xc903('0xa7'),'where':{'fax':_0x5864a2},'limit':0x1,'order':[[_0xc903('0xa8'),_0xc903('0xa9')]]}]}]})[_0xc903('0x20')](handleEntityNotFound(_0x351935,null))[_0xc903('0x20')](function(_0x2b3c24){_0x704b25=_0x2b3c24;if(_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')]&&_0xfcfa62['body'][_0xc903('0xaa')][_0xc903('0x4a')]){for(var _0x10d798=0x0;_0x10d798<_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][_0xc903('0x4a')];_0x10d798+=0x1){_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][_0x10d798]={'filename':_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][_0x10d798][_0xc903('0x3d')],'id':_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][_0x10d798]['id'],'path':path[_0xc903('0xab')](config[_0xc903('0xac')],_0xc903('0xad'),_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][_0x10d798][_0xc903('0xae')])};}}return respondWithRpcPromise(_0xc903('0xaf'),_0xc903('0xaf'),{'FaxAccountId':_[_0xc903('0xb0')](_0xfcfa62[_0xc903('0x5a')]['id'])?undefined:_0xfcfa62['params']['id'],'path':_[_0xc903('0xb0')](_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][0x0][_0xc903('0xb1')])?undefined:_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][0x0][_0xc903('0xb1')],'fax':_[_0xc903('0xb0')](_0xfcfa62[_0xc903('0x5f')]['to'][0x0])?undefined:_0xfcfa62['body']['to'][0x0]},client9002);})['then'](function(){if(_0x704b25){if(_[_0xc903('0xb0')](_0xfcfa62['body'][_0xc903('0xb2')])){_0xfcfa62[_0xc903('0x5f')][_0xc903('0xb2')]=util[_0xc903('0xa3')](_0xc903('0xb3'),_0x704b25[_0xc903('0x3d')],_0x704b25[_0xc903('0xb4')]);}if(_0x704b25[_0xc903('0xb5')]){if(_0x704b25[_0xc903('0xb5')][_0xc903('0xa7')][_0xc903('0x4a')]){return _0x704b25['List'][_0xc903('0xa7')][0x0];}else{return db[_0xc903('0xa6')][_0xc903('0x5e')](_[_0xc903('0x19')](_0xfcfa62[_0xc903('0x5f')],{'firstName':_0xfcfa62[_0xc903('0x5f')]['to'][0x0],'phone':_0xfcfa62['body']['to'][0x0],'fax':_0xfcfa62['body']['to'][0x0],'ListId':_0x704b25[_0xc903('0x9d')]}));}}else{throw new Error(_0xc903('0xb6'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xc903('0x20')](function(_0x1c411b){if(_0x1c411b){return db[_0xc903('0x73')][_0xc903('0x5d')]({'where':{'ContactId':_0x1c411b['id'],'closed':![],'FaxAccountId':_0x704b25['id']}})['then'](function(_0x59a3e7){if(_0x59a3e7){return[_0x59a3e7,![]];}return db['FaxInteraction'][_0xc903('0x5e')]({'UserId':_0xfcfa62['user']['id'],'ContactId':_0x1c411b['id'],'FaxAccountId':_0x704b25['id'],'fax':_0xfcfa62['body']['to'][0x0],'firstMsgDirection':_0xc903('0xb7'),'Messages':[_['merge'](_0xfcfa62[_0xc903('0x5f')],{'read':![],'body':_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][0x0][_0xc903('0xb8')],'FaxAccountId':_0x704b25['id'],'UserId':_0xfcfa62['user']['id'],'ContactId':_0x1c411b['id'],'AttachmentId':_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':'Messages'}]})['then'](function(_0x32928a){return[_0x32928a,!![]];});});}else{throw new Error(_0xc903('0xb9'));}})[_0xc903('0xba')](function(_0x4d06fa,_0x5e5a22){if(_0x5e5a22){return _0x4d06fa;}return db[_0xc903('0xa0')]['create']({'direction':_0xc903('0xb7'),'read':![],'body':_0xfcfa62['body'][_0xc903('0xaa')][0x0][_0xc903('0xb8')],'FaxAccountId':_0x704b25['id'],'FaxInteractionId':_0x4d06fa['id'],'UserId':_0xfcfa62[_0xc903('0x60')]['id'],'ContactId':_0x4d06fa[_0xc903('0xbb')],'AttachmentId':_0xfcfa62['body'][_0xc903('0xaa')][0x0]['id']})[_0xc903('0x20')](function(_0x21794a){_0x4d06fa['dataValues'][_0xc903('0xbc')]=[];_0x4d06fa[_0xc903('0xbd')]['Messages'][_0xc903('0x8d')](_0x21794a['dataValues']);return _0x4d06fa;});})['then'](function(_0x28e40a){respondWithRpcPromise(_0xc903('0xbe'),'SendFax',{'FaxAccountId':_['isNil'](_0xfcfa62[_0xc903('0x5a')]['id'])?undefined:_0xfcfa62[_0xc903('0x5a')]['id'],'path':_[_0xc903('0xb0')](_0xfcfa62[_0xc903('0x5f')]['attachments'][0x0][_0xc903('0xb1')])?undefined:_0xfcfa62[_0xc903('0x5f')][_0xc903('0xaa')][0x0][_0xc903('0xb1')],'fax':_['isNil'](_0xfcfa62[_0xc903('0x5f')]['to'][0x0])?undefined:_0xfcfa62[_0xc903('0x5f')]['to'][0x0],'AttachmentId':_0xfcfa62['body'][_0xc903('0xaa')][0x0]['id']},client9002)[_0xc903('0x20')](function(_0x2fb67e){logger['info'](_0xc903('0xbf'),_0x2fb67e);})[_0xc903('0x2a')](function(_0x4a4c89){logger['info'](_0xc903('0xbf'),_0x4a4c89);});return _0x28e40a;})['then'](respondWithResult(_0x351935,null))[_0xc903('0x2a')](handleError(_0x351935,null));};exports[_0xc903('0xc0')]=function(_0x35302c,_0xa4ec18,_0x303e70){return db[_0xc903('0x56')][_0xc903('0x5d')]({'where':{'id':_0x35302c[_0xc903('0x5a')]['id']}})[_0xc903('0x20')](handleEntityNotFound(_0xa4ec18,null))[_0xc903('0x20')](function(_0x44bade){if(_0x44bade){return _0x44bade[_0xc903('0xc0')](_0x35302c[_0xc903('0x5f')]['ids'],_[_0xc903('0x74')](_0x35302c[_0xc903('0x5f')],[_0xc903('0x6d'),'id'])||{})[_0xc903('0xba')](function(_0x2fdef3){for(var _0x14700c=0x0;_0x14700c<_0x35302c[_0xc903('0x5f')][_0xc903('0x6d')][_0xc903('0x4a')];_0x14700c+=0x1){socket[_0xc903('0xc1')]('userFaxAccount:save',{'UserId':Number(_0x35302c[_0xc903('0x5f')][_0xc903('0x6d')][_0x14700c]),'FaxAccountId':Number(_0x35302c['params']['id'])});}return _0x2fdef3;});}})[_0xc903('0x20')](respondWithResult(_0xa4ec18,null))[_0xc903('0x2a')](handleError(_0xa4ec18,null));};exports[_0xc903('0xc2')]=function(_0x1d2112,_0x5f0aa1,_0x2aa078){return db[_0xc903('0x56')][_0xc903('0x5d')]({'where':{'id':_0x1d2112[_0xc903('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5f0aa1,null))[_0xc903('0x20')](function(_0x5f3a87){if(_0x5f3a87){return _0x5f3a87[_0xc903('0xc2')](_0x1d2112[_0xc903('0x47')][_0xc903('0x6d')])[_0xc903('0x20')](function(){if(_[_0xc903('0xc3')](_0x1d2112['query'][_0xc903('0x6d')])){for(var _0x55a267=0x0;_0x55a267<_0x1d2112[_0xc903('0x47')][_0xc903('0x6d')]['length'];_0x55a267+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x1d2112[_0xc903('0x47')][_0xc903('0x6d')][_0x55a267]),'FaxAccountId':Number(_0x1d2112['params']['id'])});}}else{socket[_0xc903('0xc1')]('userFaxAccount:remove',{'UserId':Number(_0x1d2112[_0xc903('0x47')][_0xc903('0x6d')]),'FaxAccountId':Number(_0x1d2112[_0xc903('0x5a')]['id'])});}});}})[_0xc903('0x20')](respondWithStatusCode(_0x5f0aa1,null))[_0xc903('0x2a')](handleError(_0x5f0aa1,null));};exports['getAgents']=function(_0x2de9e4,_0x3045cf,_0x5d6162){var _0x15f577={};var _0xed66e5={};var _0x5cd412;var _0x4233ab;return db[_0xc903('0x56')][_0xc903('0x6a')]({'where':{'id':_0x2de9e4[_0xc903('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3045cf,null))['then'](function(_0x281894){if(_0x281894){_0x5cd412=_0x281894;_0xed66e5[_0xc903('0x46')]=_[_0xc903('0x5b')](db[_0xc903('0xc4')]['rawAttributes']);_0xed66e5['query']=_[_0xc903('0x5b')](_0x2de9e4[_0xc903('0x47')]);_0xed66e5['filters']=_[_0xc903('0x45')](_0xed66e5[_0xc903('0x46')],_0xed66e5[_0xc903('0x47')]);_0x15f577[_0xc903('0x48')]=_[_0xc903('0x45')](_0xed66e5[_0xc903('0x46')],qs['fields'](_0x2de9e4[_0xc903('0x47')][_0xc903('0x49')]));_0x15f577[_0xc903('0x48')]=_0x15f577[_0xc903('0x48')]['length']?_0x15f577[_0xc903('0x48')]:_0xed66e5['model'];_0x15f577[_0xc903('0x4c')]=qs[_0xc903('0x4d')](_0x2de9e4[_0xc903('0x47')]['sort']);_0x15f577[_0xc903('0x4e')]=qs[_0xc903('0x4f')](_[_0xc903('0x50')](_0x2de9e4['query'],_0xed66e5[_0xc903('0x4f')]));if(_0x2de9e4[_0xc903('0x47')][_0xc903('0x53')]){_0x15f577['where']=_['merge'](_0x15f577['where'],{'$or':_[_0xc903('0x41')](_0x15f577[_0xc903('0x48')],function(_0x6d7477){var _0x566890={};_0x566890[_0x6d7477]={'$like':'%'+_0x2de9e4['query'][_0xc903('0x53')]+'%'};return _0x566890;})});}_0x15f577=_['merge']({},_0x15f577,_0x2de9e4[_0xc903('0x5c')]);return _0x5cd412[_0xc903('0xc5')](_0x15f577);}})['then'](function(_0x36bf1c){if(_0x36bf1c){_0x4233ab=_0x36bf1c[_0xc903('0x4a')];if(!_0x2de9e4['query'][_0xc903('0x6b')]('nolimit')){_0x15f577[_0xc903('0x2e')]=qs[_0xc903('0x2e')](_0x2de9e4['query']['limit']);_0x15f577[_0xc903('0x31')]=qs['offset'](_0x2de9e4[_0xc903('0x47')][_0xc903('0x31')]);}return _0x5cd412[_0xc903('0xc5')](_0x15f577);}})[_0xc903('0x20')](function(_0x4f6fc2){if(_0x4f6fc2){return _0x4f6fc2?{'count':_0x4233ab,'rows':_0x4f6fc2}:null;}})[_0xc903('0x20')](respondWithResult(_0x3045cf,null))['catch'](handleError(_0x3045cf,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index dce9155..d1ee38c 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 _0xe619=['hasOwnProperty','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe619,0xfa));var _0x9e61=function(_0x1649fe,_0x5916da){_0x1649fe=_0x1649fe-0x0;var _0x473a67=_0xe619[_0x1649fe];return _0x473a67;};'use strict';var EventEmitter=require(_0x9e61('0x0'));var FaxAccount=require(_0x9e61('0x1'))['db'][_0x9e61('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9e61('0x3')](0x0);var events={'afterCreate':_0x9e61('0x4'),'afterUpdate':_0x9e61('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2a955d){return function(_0x2b3f7b,_0x40dba5,_0x29d50e){FaxAccountEvents['emit'](_0x2a955d+':'+_0x2b3f7b['id'],_0x2b3f7b);FaxAccountEvents['emit'](_0x2a955d,_0x2b3f7b);_0x29d50e(null);};}for(var e in events){if(events[_0x9e61('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x9e61('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0xff2e=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x388493,_0x23301e){var _0x5300a1=function(_0x1d9c91){while(--_0x1d9c91){_0x388493['push'](_0x388493['shift']());}};_0x5300a1(++_0x23301e);}(_0xff2e,0xff));var _0xeff2=function(_0x58a0ef,_0x3195a8){_0x58a0ef=_0x58a0ef-0x0;var _0x3e57db=_0xff2e[_0x58a0ef];return _0x3e57db;};'use strict';var EventEmitter=require(_0xeff2('0x0'));var FaxAccount=require(_0xeff2('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xeff2('0x2')](0x0);var events={'afterCreate':_0xeff2('0x3'),'afterUpdate':_0xeff2('0x4'),'afterDestroy':_0xeff2('0x5')};function emitEvent(_0x2618c4){return function(_0x35c4ec,_0x21a56f,_0x1255dc){FaxAccountEvents[_0xeff2('0x6')](_0x2618c4+':'+_0x35c4ec['id'],_0x35c4ec);FaxAccountEvents[_0xeff2('0x6')](_0x2618c4,_0x35c4ec);_0x1255dc(null);};}for(var e in events){if(events[_0xeff2('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xeff2('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 18e8a76..3705839 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 _0x5143=['bluebird','rimraf','../../config/environment','exports','define','FaxAccount','lodash','util','../../config/logger'];(function(_0x28f1de,_0x355054){var _0x5b5dad=function(_0x399b72){while(--_0x399b72){_0x28f1de['push'](_0x28f1de['shift']());}};_0x5b5dad(++_0x355054);}(_0x5143,0xe7));var _0x3514=function(_0x5cbf08,_0x34e805){_0x5cbf08=_0x5cbf08-0x0;var _0x4ca8e2=_0x5143[_0x5cbf08];return _0x4ca8e2;};'use strict';var _=require(_0x3514('0x0'));var util=require(_0x3514('0x1'));var logger=require(_0x3514('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3514('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3514('0x4'));var config=require(_0x3514('0x5'));var attributes=require('./faxAccount.attributes');module[_0x3514('0x6')]=function(_0x50b00e,_0x395611){return _0x50b00e[_0x3514('0x7')](_0x3514('0x8'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d61=['bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','moment'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x3d61,0x10d));var _0x13d6=function(_0x321950,_0x247370){_0x321950=_0x321950-0x0;var _0x2065da=_0x3d61[_0x321950];return _0x2065da;};'use strict';var _=require(_0x13d6('0x0'));var util=require('util');var logger=require(_0x13d6('0x1'))(_0x13d6('0x2'));var moment=require(_0x13d6('0x3'));var BPromise=require(_0x13d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13d6('0x5'));var rimraf=require(_0x13d6('0x6'));var config=require(_0x13d6('0x7'));var attributes=require(_0x13d6('0x8'));module[_0x13d6('0x9')]=function(_0x22ae66,_0x168572){return _0x22ae66[_0x13d6('0xa')](_0x13d6('0xb'),attributes,{'tableName':_0x13d6('0xc'),'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 c6474c7..cddcd2b 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 _0xb436=['Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','account','CmContact','Contacts','updatedAt','DESC','Applications','List','get','applications','list','priority','length','create','contact','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./faxAccount.socket','register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','findAll','options','raw','include','map','model','attributes','NotifyFaxAccount','body','fax','describe'];(function(_0x33f968,_0x7ff5ff){var _0x904ea1=function(_0x156799){while(--_0x156799){_0x33f968['push'](_0x33f968['shift']());}};_0x904ea1(++_0x7ff5ff);}(_0xb436,0x87));var _0x6b43=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb436[_0x342700];return _0x53406f;};'use strict';var _=require(_0x6b43('0x0'));var util=require(_0x6b43('0x1'));var moment=require(_0x6b43('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b43('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b43('0x4'))['db'];var utils=require(_0x6b43('0x5'));var logger=require(_0x6b43('0x6'))(_0x6b43('0x7'));var config=require(_0x6b43('0x8'));var jayson=require(_0x6b43('0x9'));var client=jayson[_0x6b43('0xa')][_0x6b43('0xb')]({'port':0x232c});config[_0x6b43('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b43('0xc')]));require(_0x6b43('0xd'))[_0x6b43('0xe')](socket);function respondWithRpcPromise(_0xc2ec4b,_0x5dd8c0,_0x33a3f9){return new BPromise(function(_0x15969c,_0x12a554){return client['request'](_0xc2ec4b,_0x33a3f9)[_0x6b43('0xf')](function(_0x493be2){logger[_0x6b43('0x10')]('FaxAccount,\x20%s,\x20%s',_0x5dd8c0,_0x6b43('0x11'));logger[_0x6b43('0x12')](_0x6b43('0x13'),_0x5dd8c0,_0x6b43('0x11'),JSON[_0x6b43('0x14')](_0x493be2));if(_0x493be2[_0x6b43('0x15')]){if(_0x493be2[_0x6b43('0x15')][_0x6b43('0x16')]===0x1f4){logger['error'](_0x6b43('0x17'),_0x5dd8c0,_0x493be2['error'][_0x6b43('0x18')]);return _0x12a554(_0x493be2[_0x6b43('0x15')][_0x6b43('0x18')]);}logger[_0x6b43('0x15')](_0x6b43('0x17'),_0x5dd8c0,_0x493be2['error'][_0x6b43('0x18')]);return _0x15969c(_0x493be2['error'][_0x6b43('0x18')]);}else{logger[_0x6b43('0x10')](_0x6b43('0x17'),_0x5dd8c0,'request\x20sent');_0x15969c(_0x493be2[_0x6b43('0x19')][_0x6b43('0x18')]);}})[_0x6b43('0x1a')](function(_0x1d47b6){logger['error'](_0x6b43('0x17'),_0x5dd8c0,_0x1d47b6);_0x12a554(_0x1d47b6);});});}exports[_0x6b43('0x1b')]=function(_0x524a58){var _0x262b8b=this;return new Promise(function(_0x2f5847,_0x178d40){return db['FaxAccount'][_0x6b43('0x1c')]({'raw':_0x524a58[_0x6b43('0x1d')]?_0x524a58[_0x6b43('0x1d')][_0x6b43('0x1e')]===undefined?!![]:![]:!![],'where':_0x524a58[_0x6b43('0x1d')]?_0x524a58[_0x6b43('0x1d')]['where']||null:null,'attributes':_0x524a58[_0x6b43('0x1d')]?_0x524a58[_0x6b43('0x1d')]['attributes']||null:null,'limit':_0x524a58['options']?_0x524a58[_0x6b43('0x1d')]['limit']||null:null,'include':_0x524a58[_0x6b43('0x1d')]?_0x524a58[_0x6b43('0x1d')][_0x6b43('0x1f')]?_[_0x6b43('0x20')](_0x524a58[_0x6b43('0x1d')]['include'],function(_0x47908c){return{'model':db[_0x47908c[_0x6b43('0x21')]],'as':_0x47908c['as'],'attributes':_0x47908c[_0x6b43('0x22')],'include':_0x47908c['include']?_[_0x6b43('0x20')](_0x47908c[_0x6b43('0x1f')],function(_0x49943a){return{'model':db[_0x49943a[_0x6b43('0x21')]],'as':_0x49943a['as'],'attributes':_0x49943a['attributes'],'include':_0x49943a['include']?_[_0x6b43('0x20')](_0x49943a[_0x6b43('0x1f')],function(_0x2bfb66){return{'model':db[_0x2bfb66[_0x6b43('0x21')]],'as':_0x2bfb66['as'],'attributes':_0x2bfb66[_0x6b43('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b43('0xf')](function(_0x3628f5){logger[_0x6b43('0x10')](_0x6b43('0x1b'),_0x524a58);logger[_0x6b43('0x12')](_0x6b43('0x1b'),_0x524a58,JSON[_0x6b43('0x14')](_0x3628f5));_0x2f5847(_0x3628f5);})[_0x6b43('0x1a')](function(_0x1480af){logger[_0x6b43('0x15')](_0x6b43('0x1b'),_0x1480af['message'],_0x524a58);_0x178d40(_0x262b8b[_0x6b43('0x15')](0x1f4,_0x1480af[_0x6b43('0x18')]));});});};exports[_0x6b43('0x23')]=function(_0x4fc248,_0x1bc832,_0x358c49){var _0x3b4bff=this;return new Promise(function(_0x7f5841,_0x165506){var _0x495d3d={'body':_0x4fc248[_0x6b43('0x24')],'channel':_0x6b43('0x25')};var _0x185eb7=[];var _0x19c7c7=[];var _0x3eecb0={};return db['CmContact'][_0x6b43('0x26')]()[_0x6b43('0xf')](function(_0x1852a9){if(!_0x1852a9){throw new db[(_0x6b43('0x27'))][(_0x6b43('0x28'))](_0x6b43('0x29'));}_0x185eb7=_[_0x6b43('0x2a')](_[_0x6b43('0x2b')](_0x1852a9),[_0x6b43('0x2c'),'updatedAt']);_0x19c7c7=_['difference'](_[_0x6b43('0x2b')](_0x1852a9),['createdAt','updatedAt',_0x6b43('0x2d'),_0x6b43('0x2e')]);if(_0x4fc248[_0x6b43('0x24')]['id']){delete _0x4fc248['body']['id'];}if(_[_0x6b43('0x2f')](_0x4fc248['body'][_0x6b43('0x30')])){throw new db[(_0x6b43('0x27'))][(_0x6b43('0x28'))](_0x6b43('0x31'));}if(_[_0x6b43('0x2f')](_0x4fc248['body']['body'])||_0x4fc248[_0x6b43('0x24')][_0x6b43('0x24')]===''){throw new db[(_0x6b43('0x27'))][(_0x6b43('0x28'))](_0x6b43('0x32'));}if(_['isNil'](_0x4fc248[_0x6b43('0x24')]['mapKey'])){throw new db[(_0x6b43('0x27'))][(_0x6b43('0x28'))](_0x6b43('0x33')+_0x19c7c7);}if(!_['includes'](_0x19c7c7,_0x4fc248[_0x6b43('0x24')][_0x6b43('0x34')])){throw new db[(_0x6b43('0x27'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19c7c7);}_0x3eecb0[_0x4fc248[_0x6b43('0x24')][_0x6b43('0x34')]]=_0x4fc248[_0x6b43('0x24')][_0x6b43('0x30')];})[_0x6b43('0xf')](function(){return db['FaxAccount'][_0x6b43('0x35')]({'where':{'id':_0x4fc248[_0x6b43('0x36')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x6b43('0x37')],'as':_0x6b43('0x38'),'where':_0x3eecb0,'limit':0x1,'order':[[_0x6b43('0x39'),_0x6b43('0x3a')]]}]},{'model':db['FaxApplication'],'as':_0x6b43('0x3b')}]});})[_0x6b43('0xf')](function(_0x51d031){if(_0x51d031&&_0x51d031[_0x6b43('0x3c')]){var _0x2dcacf=_0x51d031[_0x6b43('0x3d')]({'plain':!![]});_0x495d3d[_0x6b43('0x36')]=_0x2dcacf;_0x495d3d[_0x6b43('0x3e')]=_0x2dcacf[_0x6b43('0x3b')];_0x495d3d[_0x6b43('0x3f')]=_0x2dcacf[_0x6b43('0x3c')];_0x495d3d[_0x6b43('0x3e')]=_['orderBy'](_0x495d3d[_0x6b43('0x3e')],[_0x6b43('0x40')],['asc']);if(_0x495d3d[_0x6b43('0x36')][_0x6b43('0x3b')]){delete _0x495d3d[_0x6b43('0x36')]['Applications'];}if(_0x495d3d[_0x6b43('0x36')][_0x6b43('0x3c')]&&_0x495d3d[_0x6b43('0x36')][_0x6b43('0x3c')][_0x6b43('0x38')][_0x6b43('0x41')]){return _0x495d3d['account'][_0x6b43('0x3c')][_0x6b43('0x38')][0x0];}var _0x6d5742=_['defaults'](_0x4fc248[_0x6b43('0x24')],{'firstName':_0x4fc248['body'][_0x6b43('0x30')],'ListId':_0x2dcacf[_0x6b43('0x2e')]});_0x6d5742[_0x4fc248[_0x6b43('0x24')][_0x6b43('0x34')]]=_0x4fc248[_0x6b43('0x24')][_0x6b43('0x30')];return db[_0x6b43('0x37')][_0x6b43('0x42')](_0x6d5742,{'fields':_0x185eb7,'raw':!![]});}})[_0x6b43('0xf')](function(_0x3c1ce3){_0x495d3d[_0x6b43('0x43')]=_0x3c1ce3;if(_0x3c1ce3){var _0x1f4a9d={'ContactId':_0x3c1ce3['id'],'FaxAccountId':_0x4fc248['account']['id'],'fax':_0x3c1ce3[_0x6b43('0x25')]};return db['FaxInteraction'][_0x6b43('0x35')]({'where':{'ContactId':_0x3c1ce3['id'],'closed':![],'FaxAccountId':_0x4fc248[_0x6b43('0x36')]['id']}})[_0x6b43('0xf')](function(_0x304ded){if(_0x304ded){return[_0x304ded,![]];}return db['FaxInteraction'][_0x6b43('0x42')](_0x1f4a9d)[_0x6b43('0xf')](function(_0x9b7eaa){return[_0x9b7eaa,!![]];});});}else{throw new Error(_0x6b43('0x44'));}})[_0x6b43('0x45')](function(_0x326c4a,_0x5ef89c){var _0x17d6a5=_0x326c4a['get']({'plain':!![]});if(_0x5ef89c){if(_0x495d3d[_0x6b43('0x36')][_0x6b43('0x46')]){_0x495d3d[_0x6b43('0x3e')][_0x6b43('0x47')]({'id':0x0,'priority':_0x495d3d[_0x6b43('0x3e')][_0x6b43('0x41')]+0x1,'app':_0x6b43('0x48'),'appdata':_0x6b43('0x49'),'interval':_0x6b43('0x4a')});}_0x17d6a5[_0x6b43('0x4b')]=!![];}else{_0x17d6a5[_0x6b43('0x4b')]=![];}_0x495d3d[_0x6b43('0x4c')]=_0x17d6a5;return db[_0x6b43('0x4d')][_0x6b43('0x42')]({'body':_0x4fc248[_0x6b43('0x24')][_0x6b43('0x24')],'FaxAccountId':_0x4fc248[_0x6b43('0x36')]['id'],'FaxInteractionId':_0x326c4a['id'],'direction':'in','ContactId':_0x326c4a[_0x6b43('0x4e')],'AttachmentId':_0x4fc248[_0x6b43('0x24')][_0x6b43('0x4f')]});})['then'](function(_0x26d674){_0x495d3d['message']=_0x26d674;if(_0x495d3d[_0x6b43('0x4c')][_0x6b43('0x50')]){return db['User'][_0x6b43('0x35')]({'attributes':['id','name'],'where':{'id':_0x495d3d[_0x6b43('0x4c')][_0x6b43('0x50')]}})[_0x6b43('0xf')](function(_0x38597c){if(_0x38597c){_0x495d3d[_0x6b43('0x3e')][_0x6b43('0x51')]({'id':0x0,'priority':0x0,'app':_0x6b43('0x52'),'appdata':_0x38597c[_0x6b43('0x53')]+','+(_0x495d3d[_0x6b43('0x36')][_0x6b43('0x54')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6b43('0x55'),_0x6b43('0x56'),_0x495d3d);});}return respondWithRpcPromise(_0x6b43('0x55'),'startRouting',_0x495d3d);})[_0x6b43('0xf')](function(_0x28c2d7){_0x7f5841(_0x28c2d7);})[_0x6b43('0x1a')](function(_0xd3894b){_0x165506(_0x3b4bff[_0x6b43('0x15')](0x1f4,_0xd3894b[_0x6b43('0x18')]));});});}; \ No newline at end of file +var _0xd0ce=['close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','Start','startRouting','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','then','debug','catch','NotifyFaxAccount','fax','CmContact','no\x20available\x20attributes','keys','createdAt','difference','updatedAt','CompanyId','ListId','body','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','includes','account','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','contact','FaxInteraction','find','create','Contact\x20not\x20found','spread','get','autoclose'];(function(_0x1613a6,_0x129489){var _0x135053=function(_0x1ba9b9){while(--_0x1ba9b9){_0x1613a6['push'](_0x1613a6['shift']());}};_0x135053(++_0x129489);}(_0xd0ce,0x11d));var _0xed0c=function(_0x3df517,_0x373364){_0x3df517=_0x3df517-0x0;var _0x25ddd5=_0xd0ce[_0x3df517];return _0x25ddd5;};'use strict';var _=require(_0xed0c('0x0'));var util=require(_0xed0c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed0c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed0c('0x3'))['db'];var utils=require(_0xed0c('0x4'));var logger=require(_0xed0c('0x5'))(_0xed0c('0x6'));var config=require(_0xed0c('0x7'));var jayson=require(_0xed0c('0x8'));var client=jayson[_0xed0c('0x9')]['http']({'port':0x232c});config[_0xed0c('0xa')]=_[_0xed0c('0xb')](config[_0xed0c('0xa')],{'host':_0xed0c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed0c('0xa')]));require('./faxAccount.socket')[_0xed0c('0xd')](socket);function respondWithRpcPromise(_0xb04f69,_0x2e34c6,_0x258421){return new BPromise(function(_0x4a86e5,_0x1629bd){return client['request'](_0xb04f69,_0x258421)['then'](function(_0x346a0d){logger[_0xed0c('0xe')](_0xed0c('0xf'),_0x2e34c6,'request\x20sent');logger['debug'](_0xed0c('0x10'),_0x2e34c6,_0xed0c('0x11'),JSON[_0xed0c('0x12')](_0x346a0d));if(_0x346a0d['error']){if(_0x346a0d[_0xed0c('0x13')][_0xed0c('0x14')]===0x1f4){logger[_0xed0c('0x13')]('FaxAccount,\x20%s,\x20%s',_0x2e34c6,_0x346a0d['error'][_0xed0c('0x15')]);return _0x1629bd(_0x346a0d[_0xed0c('0x13')][_0xed0c('0x15')]);}logger[_0xed0c('0x13')]('FaxAccount,\x20%s,\x20%s',_0x2e34c6,_0x346a0d[_0xed0c('0x13')]['message']);return _0x4a86e5(_0x346a0d[_0xed0c('0x13')]['message']);}else{logger[_0xed0c('0xe')](_0xed0c('0xf'),_0x2e34c6,_0xed0c('0x11'));_0x4a86e5(_0x346a0d[_0xed0c('0x16')][_0xed0c('0x15')]);}})['catch'](function(_0x5bf7cc){logger[_0xed0c('0x13')](_0xed0c('0xf'),_0x2e34c6,_0x5bf7cc);_0x1629bd(_0x5bf7cc);});});}exports[_0xed0c('0x17')]=function(_0x2efecc){var _0x4e4a90=this;return new Promise(function(_0xe4f9b6,_0x2f6fef){return db[_0xed0c('0x18')][_0xed0c('0x19')]({'raw':_0x2efecc['options']?_0x2efecc[_0xed0c('0x1a')][_0xed0c('0x1b')]===undefined?!![]:![]:!![],'where':_0x2efecc['options']?_0x2efecc[_0xed0c('0x1a')][_0xed0c('0x1c')]||null:null,'attributes':_0x2efecc[_0xed0c('0x1a')]?_0x2efecc[_0xed0c('0x1a')][_0xed0c('0x1d')]||null:null,'limit':_0x2efecc[_0xed0c('0x1a')]?_0x2efecc[_0xed0c('0x1a')]['limit']||null:null,'include':_0x2efecc['options']?_0x2efecc[_0xed0c('0x1a')][_0xed0c('0x1e')]?_[_0xed0c('0x1f')](_0x2efecc['options']['include'],function(_0x2b689f){return{'model':db[_0x2b689f[_0xed0c('0x20')]],'as':_0x2b689f['as'],'attributes':_0x2b689f['attributes'],'include':_0x2b689f['include']?_[_0xed0c('0x1f')](_0x2b689f[_0xed0c('0x1e')],function(_0x2fda72){return{'model':db[_0x2fda72[_0xed0c('0x20')]],'as':_0x2fda72['as'],'attributes':_0x2fda72['attributes'],'include':_0x2fda72[_0xed0c('0x1e')]?_[_0xed0c('0x1f')](_0x2fda72[_0xed0c('0x1e')],function(_0x3a2589){return{'model':db[_0x3a2589[_0xed0c('0x20')]],'as':_0x3a2589['as'],'attributes':_0x3a2589[_0xed0c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xed0c('0x21')](function(_0x4eab1c){logger[_0xed0c('0xe')](_0xed0c('0x17'),_0x2efecc);logger[_0xed0c('0x22')]('GetFaxAccount',_0x2efecc,JSON['stringify'](_0x4eab1c));_0xe4f9b6(_0x4eab1c);})[_0xed0c('0x23')](function(_0x172241){logger[_0xed0c('0x13')](_0xed0c('0x17'),_0x172241[_0xed0c('0x15')],_0x2efecc);_0x2f6fef(_0x4e4a90[_0xed0c('0x13')](0x1f4,_0x172241[_0xed0c('0x15')]));});});};exports[_0xed0c('0x24')]=function(_0xa886bf,_0x153ad6,_0x327b85){var _0x199146=this;return new Promise(function(_0x254107,_0x29ccaa){var _0x45974e={'body':_0xa886bf['body'],'channel':_0xed0c('0x25')};var _0x50f622=[];var _0x55928f=[];var _0x496f87={};return db[_0xed0c('0x26')]['describe']()[_0xed0c('0x21')](function(_0x35f0e8){if(!_0x35f0e8){throw new db['Sequelize']['ValidationError'](_0xed0c('0x27'));}_0x50f622=_['difference'](_[_0xed0c('0x28')](_0x35f0e8),[_0xed0c('0x29'),'updatedAt']);_0x55928f=_[_0xed0c('0x2a')](_[_0xed0c('0x28')](_0x35f0e8),[_0xed0c('0x29'),_0xed0c('0x2b'),_0xed0c('0x2c'),_0xed0c('0x2d')]);if(_0xa886bf[_0xed0c('0x2e')]['id']){delete _0xa886bf[_0xed0c('0x2e')]['id'];}if(_[_0xed0c('0x2f')](_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x30')])){throw new db[(_0xed0c('0x31'))][(_0xed0c('0x32'))](_0xed0c('0x33'));}if(_[_0xed0c('0x2f')](_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x2e')])||_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x2e')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xed0c('0x2f')](_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x34')])){throw new db[(_0xed0c('0x31'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55928f);}if(!_[_0xed0c('0x35')](_0x55928f,_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x34')])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x55928f);}_0x496f87[_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x34')]]=_0xa886bf['body'][_0xed0c('0x30')];})['then'](function(){return db[_0xed0c('0x18')]['find']({'where':{'id':_0xa886bf[_0xed0c('0x36')]['id']},'include':[{'model':db[_0xed0c('0x37')],'as':_0xed0c('0x38'),'include':[{'model':db[_0xed0c('0x26')],'as':_0xed0c('0x39'),'where':_0x496f87,'limit':0x1,'order':[[_0xed0c('0x2b'),_0xed0c('0x3a')]]}]},{'model':db[_0xed0c('0x3b')],'as':_0xed0c('0x3c')}]});})['then'](function(_0x2fb968){if(_0x2fb968&&_0x2fb968[_0xed0c('0x38')]){var _0x50e2c3=_0x2fb968['get']({'plain':!![]});_0x45974e[_0xed0c('0x36')]=_0x50e2c3;_0x45974e[_0xed0c('0x3d')]=_0x50e2c3[_0xed0c('0x3c')];_0x45974e[_0xed0c('0x3e')]=_0x50e2c3[_0xed0c('0x38')];_0x45974e['applications']=_[_0xed0c('0x3f')](_0x45974e[_0xed0c('0x3d')],[_0xed0c('0x40')],[_0xed0c('0x41')]);if(_0x45974e[_0xed0c('0x36')][_0xed0c('0x3c')]){delete _0x45974e[_0xed0c('0x36')]['Applications'];}if(_0x45974e['account'][_0xed0c('0x38')]&&_0x45974e[_0xed0c('0x36')][_0xed0c('0x38')][_0xed0c('0x39')][_0xed0c('0x42')]){return _0x45974e['account'][_0xed0c('0x38')][_0xed0c('0x39')][0x0];}var _0x4534e3=_[_0xed0c('0xb')](_0xa886bf[_0xed0c('0x2e')],{'firstName':_0xa886bf['body'][_0xed0c('0x30')],'ListId':_0x50e2c3[_0xed0c('0x2d')]});_0x4534e3[_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x34')]]=_0xa886bf['body'][_0xed0c('0x30')];return db[_0xed0c('0x26')]['create'](_0x4534e3,{'fields':_0x50f622,'raw':!![]});}})[_0xed0c('0x21')](function(_0x2756ac){_0x45974e[_0xed0c('0x43')]=_0x2756ac;if(_0x2756ac){var _0x3eb92c={'ContactId':_0x2756ac['id'],'FaxAccountId':_0xa886bf[_0xed0c('0x36')]['id'],'fax':_0x2756ac[_0xed0c('0x25')]};return db[_0xed0c('0x44')][_0xed0c('0x45')]({'where':{'ContactId':_0x2756ac['id'],'closed':![],'FaxAccountId':_0xa886bf[_0xed0c('0x36')]['id']}})['then'](function(_0x3067e8){if(_0x3067e8){return[_0x3067e8,![]];}return db[_0xed0c('0x44')][_0xed0c('0x46')](_0x3eb92c)[_0xed0c('0x21')](function(_0x3d7409){return[_0x3d7409,!![]];});});}else{throw new Error(_0xed0c('0x47'));}})[_0xed0c('0x48')](function(_0x271cc1,_0x15dea9){var _0x1c754c=_0x271cc1[_0xed0c('0x49')]({'plain':!![]});if(_0x15dea9){if(_0x45974e[_0xed0c('0x36')][_0xed0c('0x4a')]){_0x45974e['applications']['push']({'id':0x0,'priority':_0x45974e[_0xed0c('0x3d')]['length']+0x1,'app':_0xed0c('0x4b'),'appdata':_0xed0c('0x4c'),'interval':_0xed0c('0x4d')});}_0x1c754c['created']=!![];}else{_0x1c754c[_0xed0c('0x4e')]=![];}_0x45974e[_0xed0c('0x4f')]=_0x1c754c;return db[_0xed0c('0x50')][_0xed0c('0x46')]({'body':_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x2e')],'FaxAccountId':_0xa886bf[_0xed0c('0x36')]['id'],'FaxInteractionId':_0x271cc1['id'],'direction':'in','ContactId':_0x271cc1[_0xed0c('0x51')],'AttachmentId':_0xa886bf[_0xed0c('0x2e')][_0xed0c('0x52')]});})[_0xed0c('0x21')](function(_0x259d14){_0x45974e[_0xed0c('0x15')]=_0x259d14;if(_0x45974e[_0xed0c('0x4f')][_0xed0c('0x53')]){return db[_0xed0c('0x54')][_0xed0c('0x45')]({'attributes':['id',_0xed0c('0x55')],'where':{'id':_0x45974e[_0xed0c('0x4f')]['UserId']}})[_0xed0c('0x21')](function(_0x4198a9){if(_0x4198a9){_0x45974e[_0xed0c('0x3d')][_0xed0c('0x56')]({'id':0x0,'priority':0x0,'app':_0xed0c('0x57'),'appdata':_0x4198a9['name']+','+(_0x45974e[_0xed0c('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0xed0c('0x4d')});}return respondWithRpcPromise('Start','startRouting',_0x45974e);});}return respondWithRpcPromise(_0xed0c('0x58'),_0xed0c('0x59'),_0x45974e);})[_0xed0c('0x21')](function(_0x416fac){_0x254107(_0x416fac);})[_0xed0c('0x23')](function(_0x477836){_0x29ccaa(_0x199146[_0xed0c('0x13')](0x1f4,_0x477836[_0xed0c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 5b73d7e..d0c8b60 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 _0x4385=['./faxAccount.events','remove','emit','removeListener','register','length','faxAccount:'];(function(_0x38622b,_0x3cfdf7){var _0x2c1a7a=function(_0x5de9cc){while(--_0x5de9cc){_0x38622b['push'](_0x38622b['shift']());}};_0x2c1a7a(++_0x3cfdf7);}(_0x4385,0x196));var _0x5438=function(_0x3d9516,_0x14e6cf){_0x3d9516=_0x3d9516-0x0;var _0x2f8a6c=_0x4385[_0x3d9516];return _0x2f8a6c;};'use strict';var FaxAccountEvents=require(_0x5438('0x0'));var events=['save',_0x5438('0x1'),'update'];function createListener(_0x30dfd0,_0x10cec3){return function(_0x348159){_0x10cec3[_0x5438('0x2')](_0x30dfd0,_0x348159);};}function removeListener(_0x169e89,_0x4e2aa1){return function(){FaxAccountEvents[_0x5438('0x3')](_0x169e89,_0x4e2aa1);};}exports[_0x5438('0x4')]=function(_0x118c91){for(var _0x5a803b=0x0,_0x4f266a=events[_0x5438('0x5')];_0x5a803b<_0x4f266a;_0x5a803b++){var _0x166dc0=events[_0x5a803b];var _0x46d486=createListener(_0x5438('0x6')+_0x166dc0,_0x118c91);FaxAccountEvents['on'](_0x166dc0,_0x46d486);}}; \ No newline at end of file +var _0xde3e=['removeListener','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x11ad60,_0x3e89e0){var _0xdca216=function(_0x4e489a){while(--_0x4e489a){_0x11ad60['push'](_0x11ad60['shift']());}};_0xdca216(++_0x3e89e0);}(_0xde3e,0xff));var _0xede3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde3e[_0xa464c9];return _0x3d73c4;};'use strict';var FaxAccountEvents=require(_0xede3('0x0'));var events=[_0xede3('0x1'),_0xede3('0x2'),_0xede3('0x3')];function createListener(_0x21ec9d,_0xea88ae){return function(_0x395dc6){_0xea88ae['emit'](_0x21ec9d,_0x395dc6);};}function removeListener(_0x21401a,_0x4b8c69){return function(){FaxAccountEvents[_0xede3('0x4')](_0x21401a,_0x4b8c69);};}exports['register']=function(_0x414176){for(var _0x2b0b93=0x0,_0x12b72c=events[_0xede3('0x5')];_0x2b0b93<_0x12b72c;_0x2b0b93++){var _0x17ce73=events[_0x2b0b93];var _0x451327=createListener(_0xede3('0x6')+_0x17ce73,_0x414176);FaxAccountEvents['on'](_0x17ce73,_0x451327);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 0f23239..7db2d54 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(_0x557f3a,_0x550e6e){var _0x3ca615=function(_0x3c4f0f){while(--_0x3c4f0f){_0x557f3a['push'](_0x557f3a['shift']());}};_0x3ca615(++_0x550e6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x264ca0,_0x4f0b0a){var _0x4f1fa7=function(_0xc23c78){while(--_0xc23c78){_0x264ca0['push'](_0x264ca0['shift']());}};_0x4f1fa7(++_0x4f0b0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'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 5a8deaa..e0a8d86 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 _0xa840=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x46bb0a,_0x4b58a9){var _0x5ccb26=function(_0x50ff00){while(--_0x50ff00){_0x46bb0a['push'](_0x46bb0a['shift']());}};_0x5ccb26(++_0x4b58a9);}(_0xa840,0x124));var _0x0a84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa840[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0a84('0x0'));module[_0x0a84('0x1')]={'priority':{'type':Sequelize[_0x0a84('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0a84('0x3')],'allowNull':![],'defaultValue':_0x0a84('0x4')},'appdata':{'type':Sequelize[_0x0a84('0x5')]()},'description':{'type':Sequelize[_0x0a84('0x3')]},'interval':{'type':Sequelize[_0x0a84('0x3')],'defaultValue':_0x0a84('0x6')}}; \ No newline at end of file +var _0x0a91=['*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x0a91,0x1dc));var _0x10a9=function(_0x27336c,_0x40a9fc){_0x27336c=_0x27336c-0x0;var _0x6ade80=_0x0a91[_0x27336c];return _0x6ade80;};'use strict';var Sequelize=require(_0x10a9('0x0'));module['exports']={'priority':{'type':Sequelize[_0x10a9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x10a9('0x2')],'allowNull':![],'defaultValue':_0x10a9('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x10a9('0x2')]},'interval':{'type':Sequelize[_0x10a9('0x2')],'defaultValue':_0x10a9('0x4')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index d294bab..40a65ce 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 _0xe8e4=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','destroy','then','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','includeAll','findAll','catch','show','params','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xe8e4,0x198));var _0x4e8e=function(_0x485f6b,_0x330658){_0x485f6b=_0x485f6b-0x0;var _0x34db5f=_0xe8e4[_0x485f6b];return _0x34db5f;};'use strict';var emlformat=require(_0x4e8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e8e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e8e('0x2'));var moment=require(_0x4e8e('0x3'));var BPromise=require(_0x4e8e('0x4'));var Mustache=require('mustache');var util=require(_0x4e8e('0x5'));var path=require(_0x4e8e('0x6'));var sox=require(_0x4e8e('0x7'));var csv=require(_0x4e8e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e8e('0x9'));var _=require(_0x4e8e('0xa'));var squel=require('squel');var crypto=require(_0x4e8e('0xb'));var jsforce=require(_0x4e8e('0xc'));var deskjs=require(_0x4e8e('0xd'));var toCsv=require(_0x4e8e('0x8'));var querystring=require(_0x4e8e('0xe'));var Papa=require(_0x4e8e('0xf'));var Redis=require(_0x4e8e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e8e('0x11'));var hardwareService=require(_0x4e8e('0x12'));var logger=require(_0x4e8e('0x13'))(_0x4e8e('0x14'));var utils=require(_0x4e8e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4e8e('0x16'));var db=require(_0x4e8e('0x17'))['db'];function respondWithStatusCode(_0x5bd228,_0x4f64a8){_0x4f64a8=_0x4f64a8||0xcc;return function(_0x6b8688){if(_0x6b8688){return _0x5bd228[_0x4e8e('0x18')](_0x4f64a8);}return _0x5bd228[_0x4e8e('0x19')](_0x4f64a8)[_0x4e8e('0x1a')]();};}function respondWithResult(_0x1ab323,_0x9bea2f){_0x9bea2f=_0x9bea2f||0xc8;return function(_0x2e6362){if(_0x2e6362){return _0x1ab323[_0x4e8e('0x19')](_0x9bea2f)[_0x4e8e('0x1b')](_0x2e6362);}};}function respondWithFilteredResult(_0x151a2e,_0x458a27){return function(_0x2c182a){if(_0x2c182a){var _0x29f8fd=typeof _0x458a27[_0x4e8e('0x1c')]===_0x4e8e('0x1d')&&typeof _0x458a27[_0x4e8e('0x1e')]===_0x4e8e('0x1d');var _0x21f562=_0x2c182a[_0x4e8e('0x1f')];var _0x464d52=_0x29f8fd?0x0:_0x458a27[_0x4e8e('0x1c')];var _0x3ce4af=_0x29f8fd?_0x2c182a[_0x4e8e('0x1f')]:_0x458a27[_0x4e8e('0x1c')]+_0x458a27[_0x4e8e('0x1e')];var _0x1fde2a;if(_0x3ce4af>=_0x21f562){_0x3ce4af=_0x21f562;_0x1fde2a=0xc8;}else{_0x1fde2a=0xce;}_0x151a2e[_0x4e8e('0x19')](_0x1fde2a);return _0x151a2e[_0x4e8e('0x20')]('Content-Range',_0x464d52+'-'+_0x3ce4af+'/'+_0x21f562)['json'](_0x2c182a);}return null;};}function patchUpdates(_0x44963b){return function(_0x46240e){try{jsonpatch['apply'](_0x46240e,_0x44963b,!![]);}catch(_0x2270e4){return BPromise[_0x4e8e('0x21')](_0x2270e4);}return _0x46240e['save']();};}function saveUpdates(_0x38b1fb,_0x5abfb2){return function(_0x3c5ff6){if(_0x3c5ff6){return _0x3c5ff6['update'](_0x38b1fb)['then'](function(_0x4e62bd){return _0x4e62bd;});}return null;};}function removeEntity(_0x5bcc49,_0x476856){return function(_0x31f6e3){if(_0x31f6e3){return _0x31f6e3[_0x4e8e('0x22')]()[_0x4e8e('0x23')](function(){_0x5bcc49[_0x4e8e('0x19')](0xcc)[_0x4e8e('0x1a')]();});}};}function handleEntityNotFound(_0x56461d,_0x5b4f3b){return function(_0x4053a2){if(!_0x4053a2){_0x56461d['sendStatus'](0x194);}return _0x4053a2;};}function handleError(_0x5c6705,_0x322fbb){_0x322fbb=_0x322fbb||0x1f4;return function(_0x4418f7){logger['error'](_0x4418f7['stack']);if(_0x4418f7['name']){delete _0x4418f7[_0x4e8e('0x24')];}_0x5c6705[_0x4e8e('0x19')](_0x322fbb)[_0x4e8e('0x25')](_0x4418f7);};}exports[_0x4e8e('0x26')]=function(_0x4cb065,_0x2b8268){var _0x5b5112={},_0x3fa080={},_0x3fd87d={'count':0x0,'rows':[]};var _0x572861=_['map'](db[_0x4e8e('0x27')][_0x4e8e('0x28')],function(_0x6ccab7){return{'name':_0x6ccab7[_0x4e8e('0x29')],'type':_0x6ccab7[_0x4e8e('0x2a')][_0x4e8e('0x2b')]};});_0x3fa080['model']=_[_0x4e8e('0x2c')](_0x572861,'name');_0x3fa080[_0x4e8e('0x2d')]=_[_0x4e8e('0x2e')](_0x4cb065[_0x4e8e('0x2d')]);_0x3fa080['filters']=_[_0x4e8e('0x2f')](_0x3fa080[_0x4e8e('0x30')],_0x3fa080[_0x4e8e('0x2d')]);_0x5b5112[_0x4e8e('0x31')]=_[_0x4e8e('0x2f')](_0x3fa080['model'],qs[_0x4e8e('0x32')](_0x4cb065[_0x4e8e('0x2d')]['fields']));_0x5b5112[_0x4e8e('0x31')]=_0x5b5112[_0x4e8e('0x31')][_0x4e8e('0x33')]?_0x5b5112['attributes']:_0x3fa080[_0x4e8e('0x30')];if(!_0x4cb065[_0x4e8e('0x2d')][_0x4e8e('0x34')](_0x4e8e('0x35'))){_0x5b5112[_0x4e8e('0x1e')]=qs[_0x4e8e('0x1e')](_0x4cb065[_0x4e8e('0x2d')][_0x4e8e('0x1e')]);_0x5b5112[_0x4e8e('0x1c')]=qs[_0x4e8e('0x1c')](_0x4cb065[_0x4e8e('0x2d')]['offset']);}_0x5b5112[_0x4e8e('0x36')]=qs[_0x4e8e('0x37')](_0x4cb065[_0x4e8e('0x2d')][_0x4e8e('0x37')]);_0x5b5112[_0x4e8e('0x38')]=qs['filters'](_[_0x4e8e('0x39')](_0x4cb065[_0x4e8e('0x2d')],_0x3fa080[_0x4e8e('0x3a')]),_0x572861);if(_0x4cb065[_0x4e8e('0x2d')]['filter']){_0x5b5112[_0x4e8e('0x38')]=_[_0x4e8e('0x3b')](_0x5b5112['where'],{'$or':_['map'](_0x572861,function(_0x211476){if(_0x211476[_0x4e8e('0x2a')]!=='VIRTUAL'){var _0xba0a91={};_0xba0a91[_0x211476[_0x4e8e('0x24')]]={'$like':'%'+_0x4cb065[_0x4e8e('0x2d')][_0x4e8e('0x3c')]+'%'};return _0xba0a91;}})});}_0x5b5112=_[_0x4e8e('0x3b')]({},_0x5b5112,_0x4cb065[_0x4e8e('0x3d')]);var _0x222b65={'where':_0x5b5112['where']};return db['FaxApplication']['count'](_0x222b65)[_0x4e8e('0x23')](function(_0x402a7f){_0x3fd87d['count']=_0x402a7f;if(_0x4cb065[_0x4e8e('0x2d')][_0x4e8e('0x3e')]){_0x5b5112['include']=[{'all':!![]}];}return db[_0x4e8e('0x27')][_0x4e8e('0x3f')](_0x5b5112);})[_0x4e8e('0x23')](function(_0x6a85be){_0x3fd87d['rows']=_0x6a85be;return _0x3fd87d;})[_0x4e8e('0x23')](respondWithFilteredResult(_0x2b8268,_0x5b5112))[_0x4e8e('0x40')](handleError(_0x2b8268,null));};exports[_0x4e8e('0x41')]=function(_0x4645e0,_0x44ca17){var _0xeee713={'raw':!![],'where':{'id':_0x4645e0[_0x4e8e('0x42')]['id']}},_0x2ce91a={};_0x2ce91a[_0x4e8e('0x30')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x2ce91a[_0x4e8e('0x2d')]=_[_0x4e8e('0x2e')](_0x4645e0[_0x4e8e('0x2d')]);_0x2ce91a[_0x4e8e('0x3a')]=_['intersection'](_0x2ce91a['model'],_0x2ce91a['query']);_0xeee713['attributes']=_[_0x4e8e('0x2f')](_0x2ce91a[_0x4e8e('0x30')],qs[_0x4e8e('0x32')](_0x4645e0[_0x4e8e('0x2d')][_0x4e8e('0x32')]));_0xeee713[_0x4e8e('0x31')]=_0xeee713[_0x4e8e('0x31')][_0x4e8e('0x33')]?_0xeee713['attributes']:_0x2ce91a[_0x4e8e('0x30')];if(_0x4645e0[_0x4e8e('0x2d')][_0x4e8e('0x3e')]){_0xeee713['include']=[{'all':!![]}];}_0xeee713=_['merge']({},_0xeee713,_0x4645e0[_0x4e8e('0x3d')]);return db[_0x4e8e('0x27')][_0x4e8e('0x43')](_0xeee713)[_0x4e8e('0x23')](handleEntityNotFound(_0x44ca17,null))[_0x4e8e('0x23')](respondWithResult(_0x44ca17,null))[_0x4e8e('0x40')](handleError(_0x44ca17,null));};exports[_0x4e8e('0x44')]=function(_0x4082e,_0x4331c){return db[_0x4e8e('0x27')][_0x4e8e('0x44')](_0x4082e[_0x4e8e('0x45')],{})[_0x4e8e('0x23')](respondWithResult(_0x4331c,0xc9))[_0x4e8e('0x40')](handleError(_0x4331c,null));};exports[_0x4e8e('0x46')]=function(_0x55ca0f,_0x3274e8){if(_0x55ca0f[_0x4e8e('0x45')]['id']){delete _0x55ca0f[_0x4e8e('0x45')]['id'];}return db['FaxApplication'][_0x4e8e('0x43')]({'where':{'id':_0x55ca0f[_0x4e8e('0x42')]['id']}})[_0x4e8e('0x23')](handleEntityNotFound(_0x3274e8,null))['then'](saveUpdates(_0x55ca0f[_0x4e8e('0x45')],null))['then'](respondWithResult(_0x3274e8,null))['catch'](handleError(_0x3274e8,null));};exports[_0x4e8e('0x22')]=function(_0x1240ae,_0x48849a){return db[_0x4e8e('0x27')][_0x4e8e('0x43')]({'where':{'id':_0x1240ae[_0x4e8e('0x42')]['id']}})[_0x4e8e('0x23')](handleEntityNotFound(_0x48849a,null))[_0x4e8e('0x23')](removeEntity(_0x48849a,null))[_0x4e8e('0x40')](handleError(_0x48849a,null));}; \ No newline at end of file +var _0x3487=['update','then','destroy','error','stack','name','send','index','map','FaxApplication','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save'];(function(_0x1c070e,_0x532a4f){var _0x3790e8=function(_0x4426a6){while(--_0x4426a6){_0x1c070e['push'](_0x1c070e['shift']());}};_0x3790e8(++_0x532a4f);}(_0x3487,0xc6));var _0x7348=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0x3487[_0x1c4409];return _0x356d8f;};'use strict';var emlformat=require(_0x7348('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7348('0x1'));var jsonpatch=require(_0x7348('0x2'));var rp=require('request-promise');var moment=require(_0x7348('0x3'));var BPromise=require(_0x7348('0x4'));var Mustache=require(_0x7348('0x5'));var util=require(_0x7348('0x6'));var path=require(_0x7348('0x7'));var sox=require(_0x7348('0x8'));var csv=require(_0x7348('0x9'));var ejs=require(_0x7348('0xa'));var fs=require('fs');var fs_extra=require(_0x7348('0xb'));var _=require(_0x7348('0xc'));var squel=require(_0x7348('0xd'));var crypto=require(_0x7348('0xe'));var jsforce=require(_0x7348('0xf'));var deskjs=require(_0x7348('0x10'));var toCsv=require(_0x7348('0x9'));var querystring=require(_0x7348('0x11'));var Papa=require(_0x7348('0x12'));var Redis=require(_0x7348('0x13'));var authService=require(_0x7348('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7348('0x15'));var logger=require(_0x7348('0x16'))(_0x7348('0x17'));var utils=require(_0x7348('0x18'));var config=require(_0x7348('0x19'));var licenseUtil=require(_0x7348('0x1a'));var db=require(_0x7348('0x1b'))['db'];function respondWithStatusCode(_0x1540a6,_0x41557f){_0x41557f=_0x41557f||0xcc;return function(_0x641a05){if(_0x641a05){return _0x1540a6[_0x7348('0x1c')](_0x41557f);}return _0x1540a6[_0x7348('0x1d')](_0x41557f)[_0x7348('0x1e')]();};}function respondWithResult(_0x139b45,_0xdd34bc){_0xdd34bc=_0xdd34bc||0xc8;return function(_0x19435f){if(_0x19435f){return _0x139b45[_0x7348('0x1d')](_0xdd34bc)[_0x7348('0x1f')](_0x19435f);}};}function respondWithFilteredResult(_0x3a0160,_0xb0c965){return function(_0x5edc8a){if(_0x5edc8a){var _0x4504f0=typeof _0xb0c965[_0x7348('0x20')]===_0x7348('0x21')&&typeof _0xb0c965[_0x7348('0x22')]==='undefined';var _0x5cf331=_0x5edc8a[_0x7348('0x23')];var _0x49725b=_0x4504f0?0x0:_0xb0c965[_0x7348('0x20')];var _0x193b0a=_0x4504f0?_0x5edc8a[_0x7348('0x23')]:_0xb0c965[_0x7348('0x20')]+_0xb0c965[_0x7348('0x22')];var _0x5b1ec8;if(_0x193b0a>=_0x5cf331){_0x193b0a=_0x5cf331;_0x5b1ec8=0xc8;}else{_0x5b1ec8=0xce;}_0x3a0160[_0x7348('0x1d')](_0x5b1ec8);return _0x3a0160[_0x7348('0x24')]('Content-Range',_0x49725b+'-'+_0x193b0a+'/'+_0x5cf331)[_0x7348('0x1f')](_0x5edc8a);}return null;};}function patchUpdates(_0x48bd8e){return function(_0x14ecc4){try{jsonpatch['apply'](_0x14ecc4,_0x48bd8e,!![]);}catch(_0x30e662){return BPromise[_0x7348('0x25')](_0x30e662);}return _0x14ecc4[_0x7348('0x26')]();};}function saveUpdates(_0x45c2e4,_0x242811){return function(_0x2bf9d1){if(_0x2bf9d1){return _0x2bf9d1[_0x7348('0x27')](_0x45c2e4)[_0x7348('0x28')](function(_0x44b1cd){return _0x44b1cd;});}return null;};}function removeEntity(_0x47126d,_0x570109){return function(_0x17d77f){if(_0x17d77f){return _0x17d77f[_0x7348('0x29')]()[_0x7348('0x28')](function(){_0x47126d[_0x7348('0x1d')](0xcc)[_0x7348('0x1e')]();});}};}function handleEntityNotFound(_0x519217,_0x2a56b8){return function(_0x4251b5){if(!_0x4251b5){_0x519217[_0x7348('0x1c')](0x194);}return _0x4251b5;};}function handleError(_0x57d312,_0xdd1c20){_0xdd1c20=_0xdd1c20||0x1f4;return function(_0x42a437){logger[_0x7348('0x2a')](_0x42a437[_0x7348('0x2b')]);if(_0x42a437['name']){delete _0x42a437[_0x7348('0x2c')];}_0x57d312[_0x7348('0x1d')](_0xdd1c20)[_0x7348('0x2d')](_0x42a437);};}exports[_0x7348('0x2e')]=function(_0x5f2476,_0x1af059){var _0x18c226={},_0x88482={},_0x545331={'count':0x0,'rows':[]};var _0x546d20=_[_0x7348('0x2f')](db[_0x7348('0x30')]['rawAttributes'],function(_0x2a4aea){return{'name':_0x2a4aea['fieldName'],'type':_0x2a4aea[_0x7348('0x31')][_0x7348('0x32')]};});_0x88482[_0x7348('0x33')]=_[_0x7348('0x2f')](_0x546d20,_0x7348('0x2c'));_0x88482['query']=_['keys'](_0x5f2476[_0x7348('0x34')]);_0x88482[_0x7348('0x35')]=_['intersection'](_0x88482['model'],_0x88482[_0x7348('0x34')]);_0x18c226[_0x7348('0x36')]=_[_0x7348('0x37')](_0x88482[_0x7348('0x33')],qs[_0x7348('0x38')](_0x5f2476[_0x7348('0x34')]['fields']));_0x18c226[_0x7348('0x36')]=_0x18c226[_0x7348('0x36')][_0x7348('0x39')]?_0x18c226[_0x7348('0x36')]:_0x88482['model'];if(!_0x5f2476[_0x7348('0x34')][_0x7348('0x3a')](_0x7348('0x3b'))){_0x18c226[_0x7348('0x22')]=qs[_0x7348('0x22')](_0x5f2476['query']['limit']);_0x18c226[_0x7348('0x20')]=qs['offset'](_0x5f2476[_0x7348('0x34')][_0x7348('0x20')]);}_0x18c226['order']=qs[_0x7348('0x3c')](_0x5f2476['query'][_0x7348('0x3c')]);_0x18c226['where']=qs['filters'](_[_0x7348('0x3d')](_0x5f2476[_0x7348('0x34')],_0x88482[_0x7348('0x35')]),_0x546d20);if(_0x5f2476['query'][_0x7348('0x3e')]){_0x18c226['where']=_[_0x7348('0x3f')](_0x18c226['where'],{'$or':_[_0x7348('0x2f')](_0x546d20,function(_0x4551f9){if(_0x4551f9[_0x7348('0x31')]!==_0x7348('0x40')){var _0x319b72={};_0x319b72[_0x4551f9['name']]={'$like':'%'+_0x5f2476[_0x7348('0x34')][_0x7348('0x3e')]+'%'};return _0x319b72;}})});}_0x18c226=_[_0x7348('0x3f')]({},_0x18c226,_0x5f2476['options']);var _0x42a664={'where':_0x18c226[_0x7348('0x41')]};return db['FaxApplication']['count'](_0x42a664)[_0x7348('0x28')](function(_0x9d9b8a){_0x545331['count']=_0x9d9b8a;if(_0x5f2476[_0x7348('0x34')][_0x7348('0x42')]){_0x18c226[_0x7348('0x43')]=[{'all':!![]}];}return db[_0x7348('0x30')][_0x7348('0x44')](_0x18c226);})[_0x7348('0x28')](function(_0x384640){_0x545331[_0x7348('0x45')]=_0x384640;return _0x545331;})['then'](respondWithFilteredResult(_0x1af059,_0x18c226))[_0x7348('0x46')](handleError(_0x1af059,null));};exports[_0x7348('0x47')]=function(_0x5ba19a,_0x2049e7){var _0x39cfc9={'raw':!![],'where':{'id':_0x5ba19a[_0x7348('0x48')]['id']}},_0x23de35={};_0x23de35[_0x7348('0x33')]=_[_0x7348('0x49')](db[_0x7348('0x30')][_0x7348('0x4a')]);_0x23de35[_0x7348('0x34')]=_['keys'](_0x5ba19a[_0x7348('0x34')]);_0x23de35[_0x7348('0x35')]=_[_0x7348('0x37')](_0x23de35['model'],_0x23de35[_0x7348('0x34')]);_0x39cfc9[_0x7348('0x36')]=_[_0x7348('0x37')](_0x23de35[_0x7348('0x33')],qs[_0x7348('0x38')](_0x5ba19a[_0x7348('0x34')]['fields']));_0x39cfc9[_0x7348('0x36')]=_0x39cfc9[_0x7348('0x36')][_0x7348('0x39')]?_0x39cfc9[_0x7348('0x36')]:_0x23de35['model'];if(_0x5ba19a['query'][_0x7348('0x42')]){_0x39cfc9['include']=[{'all':!![]}];}_0x39cfc9=_[_0x7348('0x3f')]({},_0x39cfc9,_0x5ba19a[_0x7348('0x4b')]);return db['FaxApplication'][_0x7348('0x4c')](_0x39cfc9)['then'](handleEntityNotFound(_0x2049e7,null))[_0x7348('0x28')](respondWithResult(_0x2049e7,null))[_0x7348('0x46')](handleError(_0x2049e7,null));};exports[_0x7348('0x4d')]=function(_0x4647fa,_0x1adf7b){return db[_0x7348('0x30')][_0x7348('0x4d')](_0x4647fa['body'],{})[_0x7348('0x28')](respondWithResult(_0x1adf7b,0xc9))[_0x7348('0x46')](handleError(_0x1adf7b,null));};exports[_0x7348('0x27')]=function(_0x595d39,_0x1d9349){if(_0x595d39[_0x7348('0x4e')]['id']){delete _0x595d39[_0x7348('0x4e')]['id'];}return db[_0x7348('0x30')][_0x7348('0x4c')]({'where':{'id':_0x595d39[_0x7348('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d9349,null))[_0x7348('0x28')](saveUpdates(_0x595d39[_0x7348('0x4e')],null))[_0x7348('0x28')](respondWithResult(_0x1d9349,null))[_0x7348('0x46')](handleError(_0x1d9349,null));};exports[_0x7348('0x29')]=function(_0x1281da,_0x592b89){return db[_0x7348('0x30')][_0x7348('0x4c')]({'where':{'id':_0x1281da[_0x7348('0x48')]['id']}})[_0x7348('0x28')](handleEntityNotFound(_0x592b89,null))[_0x7348('0x28')](removeEntity(_0x592b89,null))['catch'](handleError(_0x592b89,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 499f050..c6864bd 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 _0x80a0=['FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','define'];(function(_0x4a3821,_0x94b2d6){var _0x4f91ab=function(_0x1ab7d0){while(--_0x1ab7d0){_0x4a3821['push'](_0x4a3821['shift']());}};_0x4f91ab(++_0x94b2d6);}(_0x80a0,0x121));var _0x080a=function(_0x5bdf55,_0x39ff3e){_0x5bdf55=_0x5bdf55-0x0;var _0x4c15c7=_0x80a0[_0x5bdf55];return _0x4c15c7;};'use strict';var _=require(_0x080a('0x0'));var util=require(_0x080a('0x1'));var logger=require('../../config/logger')(_0x080a('0x2'));var moment=require(_0x080a('0x3'));var BPromise=require(_0x080a('0x4'));var rp=require(_0x080a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x080a('0x6'));var config=require(_0x080a('0x7'));var attributes=require(_0x080a('0x8'));module['exports']=function(_0x1d816d,_0x580a06){return _0x1d816d[_0x080a('0x9')](_0x080a('0xa'),attributes,{'tableName':_0x080a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x080a('0xc')});}; \ No newline at end of file +var _0xb5b2=['fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x48f9a1,_0x36429b){var _0x104b84=function(_0x28ee1a){while(--_0x28ee1a){_0x48f9a1['push'](_0x48f9a1['shift']());}};_0x104b84(++_0x36429b);}(_0xb5b2,0xb9));var _0x2b5b=function(_0x203e49,_0x57511c){_0x203e49=_0x203e49-0x0;var _0x515e1e=_0xb5b2[_0x203e49];return _0x515e1e;};'use strict';var _=require('lodash');var util=require(_0x2b5b('0x0'));var logger=require(_0x2b5b('0x1'))(_0x2b5b('0x2'));var moment=require(_0x2b5b('0x3'));var BPromise=require(_0x2b5b('0x4'));var rp=require(_0x2b5b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2b5b('0x6'));var config=require('../../config/environment');var attributes=require(_0x2b5b('0x7'));module[_0x2b5b('0x8')]=function(_0x20f153,_0x29325d){return _0x20f153[_0x2b5b('0x9')](_0x2b5b('0xa'),attributes,{'tableName':_0x2b5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b5b('0xc'),'collate':_0x2b5b('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2a26509..84a90c6 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 _0xac85=['FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','limit','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','request','then','info','debug'];(function(_0x5bb73d,_0x17581c){var _0x169d14=function(_0x58a896){while(--_0x58a896){_0x5bb73d['push'](_0x5bb73d['shift']());}};_0x169d14(++_0x17581c);}(_0xac85,0x77));var _0x5ac8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xac85[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x5ac8('0x0'));var moment=require(_0x5ac8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac8('0x2'));var db=require(_0x5ac8('0x3'))['db'];var utils=require(_0x5ac8('0x4'));var logger=require('../../config/logger')(_0x5ac8('0x5'));var config=require('../../config/environment');var jayson=require(_0x5ac8('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x512958,_0x5900e8,_0xf8a7e1){return new BPromise(function(_0x11ae15,_0x3109bf){return client[_0x5ac8('0x7')](_0x512958,_0xf8a7e1)[_0x5ac8('0x8')](function(_0xed508){logger[_0x5ac8('0x9')]('FaxApplication,\x20%s,\x20%s',_0x5900e8,'request\x20sent');logger[_0x5ac8('0xa')](_0x5ac8('0xb'),_0x5900e8,_0x5ac8('0xc'),JSON['stringify'](_0xed508));if(_0xed508['error']){if(_0xed508[_0x5ac8('0xd')][_0x5ac8('0xe')]===0x1f4){logger[_0x5ac8('0xd')](_0x5ac8('0xf'),_0x5900e8,_0xed508[_0x5ac8('0xd')][_0x5ac8('0x10')]);return _0x3109bf(_0xed508[_0x5ac8('0xd')]['message']);}logger[_0x5ac8('0xd')](_0x5ac8('0xf'),_0x5900e8,_0xed508[_0x5ac8('0xd')][_0x5ac8('0x10')]);return _0x11ae15(_0xed508[_0x5ac8('0xd')][_0x5ac8('0x10')]);}else{logger['info'](_0x5ac8('0xf'),_0x5900e8,_0x5ac8('0xc'));_0x11ae15(_0xed508[_0x5ac8('0x11')]['message']);}})[_0x5ac8('0x12')](function(_0x3fee06){logger[_0x5ac8('0xd')](_0x5ac8('0xf'),_0x5900e8,_0x3fee06);_0x3109bf(_0x3fee06);});});}exports[_0x5ac8('0x13')]=function(_0x4ccbc5){var _0x4d35f=this;return new Promise(function(_0x43a17f,_0x1d8772){return db[_0x5ac8('0x14')]['update'](_0x4ccbc5[_0x5ac8('0x15')],{'raw':_0x4ccbc5[_0x5ac8('0x16')]?_0x4ccbc5[_0x5ac8('0x16')][_0x5ac8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ccbc5[_0x5ac8('0x16')]?_0x4ccbc5[_0x5ac8('0x16')][_0x5ac8('0x18')]||null:null,'attributes':_0x4ccbc5[_0x5ac8('0x16')]?_0x4ccbc5['options']['attributes']||null:null,'limit':_0x4ccbc5[_0x5ac8('0x16')]?_0x4ccbc5[_0x5ac8('0x16')][_0x5ac8('0x19')]||null:null})[_0x5ac8('0x8')](function(_0x397c24){logger[_0x5ac8('0x9')](_0x5ac8('0x13'),_0x4ccbc5);logger[_0x5ac8('0xa')](_0x5ac8('0x13'),_0x4ccbc5,JSON['stringify'](_0x397c24));_0x43a17f(_0x397c24);})['catch'](function(_0x5b4712){logger['error'](_0x5ac8('0x13'),_0x5b4712[_0x5ac8('0x10')],_0x4ccbc5);_0x1d8772(_0x4d35f['error'](0x1f4,_0x5b4712[_0x5ac8('0x10')]));});});}; \ No newline at end of file +var _0x0882=['UpdateFaxApplication','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','FaxApplication','update','body','options','raw','where','attributes','limit'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x0882,0x1f0));var _0x2088=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x0882[_0x568a61];return _0x334c3b;};'use strict';var _=require(_0x2088('0x0'));var util=require('util');var moment=require(_0x2088('0x1'));var BPromise=require(_0x2088('0x2'));var rs=require(_0x2088('0x3'));var fs=require('fs');var Redis=require(_0x2088('0x4'));var db=require(_0x2088('0x5'))['db'];var utils=require(_0x2088('0x6'));var logger=require(_0x2088('0x7'))(_0x2088('0x8'));var config=require(_0x2088('0x9'));var jayson=require(_0x2088('0xa'));var client=jayson[_0x2088('0xb')][_0x2088('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b9bce,_0x3fa586,_0x2d99b2){return new BPromise(function(_0xc93bdd,_0x60b4c2){return client['request'](_0x3b9bce,_0x2d99b2)[_0x2088('0xd')](function(_0x1ed034){logger['info'](_0x2088('0xe'),_0x3fa586,_0x2088('0xf'));logger[_0x2088('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3fa586,_0x2088('0xf'),JSON[_0x2088('0x11')](_0x1ed034));if(_0x1ed034[_0x2088('0x12')]){if(_0x1ed034[_0x2088('0x12')][_0x2088('0x13')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x3fa586,_0x1ed034[_0x2088('0x12')][_0x2088('0x14')]);return _0x60b4c2(_0x1ed034[_0x2088('0x12')][_0x2088('0x14')]);}logger[_0x2088('0x12')](_0x2088('0xe'),_0x3fa586,_0x1ed034[_0x2088('0x12')]['message']);return _0xc93bdd(_0x1ed034[_0x2088('0x12')][_0x2088('0x14')]);}else{logger[_0x2088('0x15')](_0x2088('0xe'),_0x3fa586,'request\x20sent');_0xc93bdd(_0x1ed034[_0x2088('0x16')][_0x2088('0x14')]);}})[_0x2088('0x17')](function(_0x2f89f3){logger['error']('FaxApplication,\x20%s,\x20%s',_0x3fa586,_0x2f89f3);_0x60b4c2(_0x2f89f3);});});}exports['UpdateFaxApplication']=function(_0x4831d4){var _0x2a25db=this;return new Promise(function(_0x534b10,_0x52aef5){return db[_0x2088('0x18')][_0x2088('0x19')](_0x4831d4[_0x2088('0x1a')],{'raw':_0x4831d4[_0x2088('0x1b')]?_0x4831d4[_0x2088('0x1b')][_0x2088('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4831d4[_0x2088('0x1b')]?_0x4831d4[_0x2088('0x1b')][_0x2088('0x1d')]||null:null,'attributes':_0x4831d4[_0x2088('0x1b')]?_0x4831d4[_0x2088('0x1b')][_0x2088('0x1e')]||null:null,'limit':_0x4831d4[_0x2088('0x1b')]?_0x4831d4[_0x2088('0x1b')][_0x2088('0x1f')]||null:null})[_0x2088('0xd')](function(_0x1f9074){logger[_0x2088('0x15')](_0x2088('0x20'),_0x4831d4);logger[_0x2088('0x10')](_0x2088('0x20'),_0x4831d4,JSON['stringify'](_0x1f9074));_0x534b10(_0x1f9074);})[_0x2088('0x17')](function(_0x4c927c){logger[_0x2088('0x12')]('UpdateFaxApplication',_0x4c927c[_0x2088('0x14')],_0x4831d4);_0x52aef5(_0x2a25db['error'](0x1f4,_0x4c927c[_0x2088('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index dd11f4a..e6470db 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 _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb688,0xcf));var _0x8b68=function(_0x23d366,_0x4fb1c1){_0x23d366=_0x23d366-0x0;var _0x5b0593=_0xb688[_0x23d366];return _0x5b0593;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file +var _0x0972=['isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get'];(function(_0x1127bf,_0x542714){var _0x5bdfce=function(_0x29b766){while(--_0x29b766){_0x1127bf['push'](_0x1127bf['shift']());}};_0x5bdfce(++_0x542714);}(_0x0972,0x64));var _0x2097=function(_0x329e79,_0xac77d2){_0x329e79=_0x329e79-0x0;var _0x22a675=_0x0972[_0x329e79];return _0x22a675;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0xb')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xc')]);router['put'](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0xe')]);router[_0x2097('0xf')](_0x2097('0xd'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);module[_0x2097('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 7a3de9d..990928a 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 _0x2234=['exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x21e8f4,_0x94618a){var _0xf0a764=function(_0x31d5cc){while(--_0x31d5cc){_0x21e8f4['push'](_0x21e8f4['shift']());}};_0xf0a764(++_0x94618a);}(_0x2234,0x18c));var _0x4223=function(_0x4a5356,_0x20f134){_0x4a5356=_0x4a5356-0x0;var _0x4beb93=_0x2234[_0x4a5356];return _0x4beb93;};'use strict';var Sequelize=require('sequelize');module[_0x4223('0x0')]={'closed':{'type':Sequelize[_0x4223('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4223('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4223('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4223('0x3')]},'read1stAt':{'type':Sequelize[_0x4223('0x2')]},'fax':{'type':Sequelize[_0x4223('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4223('0x4')]('in',_0x4223('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4223('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x4223('0x4')]('in',_0x4223('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xa002=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0xa002,0x18f));var _0x2a00=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xa002[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x2a00('0x0'));module[_0x2a00('0x1')]={'closed':{'type':Sequelize[_0x2a00('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2a00('0x3')]},'disposition':{'type':Sequelize[_0x2a00('0x4')]},'secondDisposition':{'type':Sequelize[_0x2a00('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x2a00('0x4')]},'read1stAt':{'type':Sequelize[_0x2a00('0x3')]},'fax':{'type':Sequelize[_0x2a00('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2a00('0x5')]('in',_0x2a00('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2a00('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2a00('0x5')]('in',_0x2a00('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 2c46f84..25c5b00 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 _0xd7fb=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.FaxInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','find','create','params','describe','addMessage','ids','getMessages','findOne','nolimit','FaxInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','FaxMessage','findAll','addTags','setTags','omit','spread','Tag','emit','removeTags','download','unix','join','root','tmp','server','files','transcript-%d-%s.zip','Attachment','Messages','get','basename','existsSync','createReadStream','pipe','log','err','unlinkSync','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','Users','TagIds','split','Tags','push','catch','waiting','answered','unmanaged','total','UserId','closed','talking','index','map','FaxInteraction','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','select','field','color','tools_tags','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','unreadMessages','`\x20=\x200','having','`\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','type','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','some','compact','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','forEach','contactName','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','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','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname'];(function(_0x523c71,_0x4c0d9d){var _0x23a77a=function(_0x222313){while(--_0x222313){_0x523c71['push'](_0x523c71['shift']());}};_0x23a77a(++_0x4c0d9d);}(_0xd7fb,0x1f2));var _0xbd7f=function(_0xcfc051,_0x50969d){_0xcfc051=_0xcfc051-0x0;var _0x16d19b=_0xd7fb[_0xcfc051];return _0x16d19b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbd7f('0x0'));var rp=require(_0xbd7f('0x1'));var moment=require(_0xbd7f('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbd7f('0x3'));var path=require(_0xbd7f('0x4'));var sox=require(_0xbd7f('0x5'));var csv=require('to-csv');var ejs=require(_0xbd7f('0x6'));var fs=require('fs');var fs_extra=require(_0xbd7f('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbd7f('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbd7f('0x9'));var Papa=require(_0xbd7f('0xa'));var Redis=require(_0xbd7f('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xbd7f('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd7f('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0xbd7f('0xe'));var config=require(_0xbd7f('0xf'));var licenseUtil=require(_0xbd7f('0x10'));var db=require('../../mysqldb')['db'];config[_0xbd7f('0x11')]=_[_0xbd7f('0x12')](config[_0xbd7f('0x11')],{'host':'localhost','port':0x18eb});var socket=require(_0xbd7f('0x13'))(new Redis(config[_0xbd7f('0x11')]));require(_0xbd7f('0x14'))[_0xbd7f('0x15')](socket);function respondWithStatusCode(_0x241994,_0x3fd53e){_0x3fd53e=_0x3fd53e||0xcc;return function(_0x29d75c){if(_0x29d75c){return _0x241994[_0xbd7f('0x16')](_0x3fd53e);}return _0x241994[_0xbd7f('0x17')](_0x3fd53e)[_0xbd7f('0x18')]();};}function respondWithResult(_0x123026,_0x300d1a){_0x300d1a=_0x300d1a||0xc8;return function(_0x3388a1){if(_0x3388a1){return _0x123026[_0xbd7f('0x17')](_0x300d1a)[_0xbd7f('0x19')](_0x3388a1);}};}function respondWithFilteredResult(_0x52b7dc,_0x12752d){return function(_0x334c96){if(_0x334c96){var _0x3df941=typeof _0x12752d[_0xbd7f('0x1a')]===_0xbd7f('0x1b')&&typeof _0x12752d[_0xbd7f('0x1c')]===_0xbd7f('0x1b');var _0x4c65f4=_0x334c96[_0xbd7f('0x1d')];var _0x5a75e2=_0x3df941?0x0:_0x12752d[_0xbd7f('0x1a')];var _0x19fad8=_0x3df941?_0x334c96[_0xbd7f('0x1d')]:_0x12752d[_0xbd7f('0x1a')]+_0x12752d['limit'];var _0x2d2326;if(_0x19fad8>=_0x4c65f4){_0x19fad8=_0x4c65f4;_0x2d2326=0xc8;}else{_0x2d2326=0xce;}_0x52b7dc[_0xbd7f('0x17')](_0x2d2326);return _0x52b7dc[_0xbd7f('0x1e')]('Content-Range',_0x5a75e2+'-'+_0x19fad8+'/'+_0x4c65f4)[_0xbd7f('0x19')](_0x334c96);}return null;};}function patchUpdates(_0x4b3e65){return function(_0x3e0c07){try{jsonpatch[_0xbd7f('0x1f')](_0x3e0c07,_0x4b3e65,!![]);}catch(_0x5d474b){return BPromise[_0xbd7f('0x20')](_0x5d474b);}return _0x3e0c07['save']();};}function saveUpdates(_0x5917e1,_0x490c5f){return function(_0x216647){if(_0x216647){return _0x216647[_0xbd7f('0x21')](_0x5917e1)[_0xbd7f('0x22')](function(_0x3dcbbf){return _0x3dcbbf;});}return null;};}function removeEntity(_0x2c60c9,_0x77f7d6){return function(_0x5d1f4b){if(_0x5d1f4b){return _0x5d1f4b[_0xbd7f('0x23')]()[_0xbd7f('0x22')](function(){_0x2c60c9[_0xbd7f('0x17')](0xcc)[_0xbd7f('0x18')]();});}};}function handleEntityNotFound(_0x2c2269,_0x3c7eac){return function(_0x55a808){if(!_0x55a808){_0x2c2269[_0xbd7f('0x16')](0x194);}return _0x55a808;};}function handleError(_0x1b3b79,_0x2b65fe){_0x2b65fe=_0x2b65fe||0x1f4;return function(_0x44e024){logger[_0xbd7f('0x24')](_0x44e024[_0xbd7f('0x25')]);if(_0x44e024[_0xbd7f('0x26')]){delete _0x44e024[_0xbd7f('0x26')];}_0x1b3b79[_0xbd7f('0x17')](_0x2b65fe)[_0xbd7f('0x27')](_0x44e024);};}function getInteractionUsers(_0x906add,_0x1f09a6){return new BPromise(function(_0x5a92ff,_0xfa0d8a){try{if(_0x1f09a6[_0x906add['id']]){_0x906add[_0xbd7f('0x28')]=_['map'](_0x1f09a6[_0x906add['id']],function(_0x18026d){return{'id':_0x18026d['id'],'fullname':_0x18026d['fullname']};});}}catch(_0x4ca001){_0xfa0d8a(_0x4ca001);}_0x5a92ff(_0x906add);});}function getInteractionTags(_0x469c6c,_0x5bb0a2){return new BPromise(function(_0x19fb2d,_0x180a9a){try{if(_0x469c6c[_0xbd7f('0x29')]){_0x469c6c['Tags']=[];_0x469c6c[_0xbd7f('0x29')][_0xbd7f('0x2a')](',')['forEach'](function(_0x43b83b){_0x469c6c[_0xbd7f('0x2b')][_0xbd7f('0x2c')](_0x5bb0a2[_0x43b83b]);});}delete _0x469c6c[_0xbd7f('0x29')];}catch(_0xeff903){_0x180a9a(_0xeff903);}_0x19fb2d(_0x469c6c);});}function updateFaxInteraction(_0x2a4ef3,_0xec2d8f,_0x22ce6a){return new BPromise(function(_0x3aa8bf,_0x46f290){return getInteractionUsers(_0x2a4ef3,_0x22ce6a)[_0xbd7f('0x22')](function(_0x2a6ce9){return getInteractionTags(_0x2a6ce9,_0xec2d8f);})[_0xbd7f('0x22')](function(_0x32b490){return getStateInteraction(_0x32b490);})[_0xbd7f('0x22')](function(_0x2b1746){_0x3aa8bf(_0x2b1746);})[_0xbd7f('0x2d')](function(_0x34679a){_0x46f290(_0x34679a);});});}function getStateInteraction(_0x2e9066){return new BPromise(function(_0x44e4a6){_0x2e9066[_0xbd7f('0x2e')]=0x0;_0x2e9066['talking']=0x0;_0x2e9066[_0xbd7f('0x2f')]=0x0;_0x2e9066[_0xbd7f('0x30')]=0x0;_0x2e9066[_0xbd7f('0x31')]=0x0;if(!_0x2e9066['closed']&&!_0x2e9066[_0xbd7f('0x32')]){_0x2e9066[_0xbd7f('0x2e')]+=0x1;}if(!_0x2e9066[_0xbd7f('0x33')]&&_0x2e9066[_0xbd7f('0x32')]){_0x2e9066[_0xbd7f('0x34')]+=0x1;if(_0x2e9066[_0xbd7f('0x2e')]){_0x2e9066[_0xbd7f('0x2e')]-=0x1;}}if(_0x2e9066[_0xbd7f('0x33')]&&_0x2e9066[_0xbd7f('0x32')]){_0x2e9066[_0xbd7f('0x2f')]+=0x1;if(_0x2e9066[_0xbd7f('0x34')]){_0x2e9066['talking']-=0x1;}}if(_0x2e9066[_0xbd7f('0x33')]&&!_0x2e9066[_0xbd7f('0x32')]){_0x2e9066['unmanaged']+=0x1;if(_0x2e9066[_0xbd7f('0x2e')]){_0x2e9066[_0xbd7f('0x2e')]-=0x1;}}_0x2e9066[_0xbd7f('0x31')]+=0x1;_0x44e4a6(_0x2e9066);});}exports[_0xbd7f('0x35')]=function(_0x45f75e,_0x55c7ac){var _0x216677={},_0x2cd3f8={},_0x256ccb={'count':0x0,'rows':[]};var _0xcf0915=_[_0xbd7f('0x36')](db[_0xbd7f('0x37')][_0xbd7f('0x38')],function(_0x3ad9c5){return{'name':_0x3ad9c5[_0xbd7f('0x39')],'type':_0x3ad9c5['type']['key']};});_0x2cd3f8['model']=_[_0xbd7f('0x36')](_0xcf0915,_0xbd7f('0x26'));_0x2cd3f8[_0xbd7f('0x3a')]=_[_0xbd7f('0x3b')](_0x45f75e[_0xbd7f('0x3a')]);_0x2cd3f8[_0xbd7f('0x3c')]=_['intersection'](_0x2cd3f8['model'],_0x2cd3f8[_0xbd7f('0x3a')]);_0x216677['attributes']=_[_0xbd7f('0x3d')](_0x2cd3f8[_0xbd7f('0x3e')],qs[_0xbd7f('0x3f')](_0x45f75e[_0xbd7f('0x3a')]['fields']));_0x216677[_0xbd7f('0x40')]=_0x216677[_0xbd7f('0x40')][_0xbd7f('0x41')]?_0x216677[_0xbd7f('0x40')]:_0x2cd3f8[_0xbd7f('0x3e')];if(!_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x42')]('nolimit')){_0x216677['limit']=qs[_0xbd7f('0x1c')](_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x1c')]);_0x216677['offset']=qs[_0xbd7f('0x1a')](_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x1a')]);}_0x216677[_0xbd7f('0x43')]=qs[_0xbd7f('0x44')](_0x45f75e[_0xbd7f('0x3a')]['sort']);_0x216677[_0xbd7f('0x45')]=qs[_0xbd7f('0x3c')](_['pick'](_0x45f75e[_0xbd7f('0x3a')],_0x2cd3f8[_0xbd7f('0x3c')]),_0xcf0915);var _0xcadee9=[];var _0x3bacb9=squel[_0xbd7f('0x46')]()['field']('id')[_0xbd7f('0x47')](_0xbd7f('0x26'))[_0xbd7f('0x47')](_0xbd7f('0x48'))['from'](_0xbd7f('0x49'));var _0x35dbaf=squel['select']()[_0xbd7f('0x47')](_0xbd7f('0x4a'))['field'](_0xbd7f('0x4b'))[_0xbd7f('0x47')](_0xbd7f('0x4c'))[_0xbd7f('0x4d')](_0xbd7f('0x4e'),'ui')[_0xbd7f('0x4f')](_0xbd7f('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x53ceb8=squel['select']()[_0xbd7f('0x4d')](_0xbd7f('0x51'),'i')[_0xbd7f('0x4f')](_0xbd7f('0x52'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xbd7f('0x50'),'o',_0xbd7f('0x53'))[_0xbd7f('0x4f')](_0xbd7f('0x54'),'a',_0xbd7f('0x55'))[_0xbd7f('0x4f')](_0xbd7f('0x56'),'me',_0xbd7f('0x57'))[_0xbd7f('0x4f')](_0xbd7f('0x58'),'it',_0xbd7f('0x59'))[_0xbd7f('0x4f')]('tools_tags','t',_0xbd7f('0x5a'));var _0x5e67bc=squel['expr']();var _0x4daed4=[];var _0x37e033=squel[_0xbd7f('0x5b')]();var _0x547434;if(_0x45f75e[_0xbd7f('0x3a')]['search']){_0x547434=as[_0xbd7f('0x5c')](_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x5d')]);var _0x814cc4=_0x547434[_0xbd7f('0x5e')];for(var _0x36cd95=0x0;_0x36cd95<_0x547434['conditions']['length'];_0x36cd95++){var _0x38a38b=_0x547434['conditions'][_0x36cd95];var _0x315c87='i';var _0x57ce99=_['find'](_0xcf0915,[_0xbd7f('0x26'),_0x38a38b[_0xbd7f('0x47')]]);if(!_0x57ce99){switch(_0x38a38b[_0xbd7f('0x47')]){case _0xbd7f('0x5f'):if(_0x38a38b['value']==0x1){_0x53ceb8['having']('`'+_0x38a38b[_0xbd7f('0x47')]+_0xbd7f('0x60'));}else{_0x53ceb8[_0xbd7f('0x61')]('`'+_0x38a38b[_0xbd7f('0x47')]+_0xbd7f('0x62'));}break;case _0xbd7f('0x63'):if(_0x38a38b[_0xbd7f('0x64')]===_0xbd7f('0x65')){if(_0x38a38b[_0xbd7f('0x66')][_0xbd7f('0x2a')]('\x20')[_0xbd7f('0x41')]>0x1){_0x5e67bc[_0x814cc4](_0xbd7f('0x67'),qs[_0xbd7f('0x68')](_0x38a38b[_0xbd7f('0x66')]),null);}else{var _0x65998='%'+_0x38a38b[_0xbd7f('0x66')]+'%';_0x5e67bc[_0x814cc4](_0xbd7f('0x69'),_0x65998,_0x65998,_0x65998);}}else{_0x57ce99=_['find'](_0xcf0915,[_0xbd7f('0x26'),'ContactId']);_0x38a38b[_0xbd7f('0x47')]=_0xbd7f('0x6a');_0x270ef4=as['buildExpression'](_0x315c87,_0x57ce99[_0xbd7f('0x6b')],_0x38a38b);_0x5e67bc[_0x814cc4](_0x270ef4[_0xbd7f('0x6c')],_0x270ef4[_0xbd7f('0x66')][_0xbd7f('0x6d')],_0x270ef4[_0xbd7f('0x66')][_0xbd7f('0x18')]);}break;case'Tag':var _0xbe2e5d=_0x38a38b[_0xbd7f('0x66')]['split'](',')[_0xbd7f('0x36')](function(_0x5d0634){return Number(_0x5d0634);});_0xbe2e5d['forEach'](function(_0x251c76){_0x37e033['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x251c76+',%');});_0x4daed4=_[_0xbd7f('0x6e')](_0x4daed4,_0xbe2e5d);break;case _0xbd7f('0x6f'):if(_0x38a38b[_0xbd7f('0x64')]===_0xbd7f('0x65')){_0x5e67bc[_0x814cc4](_0xbd7f('0x70'),'%'+_0x38a38b[_0xbd7f('0x66')]+'%',null);}else{_0x57ce99=_['find'](_0xcf0915,['name',_0xbd7f('0x32')]);_0x38a38b[_0xbd7f('0x47')]=_0xbd7f('0x32');_0x270ef4=as[_0xbd7f('0x71')](_0x315c87,_0x57ce99[_0xbd7f('0x6b')],_0x38a38b);_0x5e67bc[_0x814cc4](_0x270ef4[_0xbd7f('0x6c')],_0x270ef4['value']['start'],_0x270ef4[_0xbd7f('0x66')][_0xbd7f('0x18')]);}break;case _0xbd7f('0x72'):_0x270ef4=as[_0xbd7f('0x71')]('me',null,_0x38a38b);_0x5e67bc[_0x814cc4](_0x270ef4[_0xbd7f('0x6c')],_0x270ef4[_0xbd7f('0x66')][_0xbd7f('0x6d')],_0x270ef4['value']['end']);break;}}else{var _0x270ef4=as[_0xbd7f('0x71')](_0x315c87,_0x57ce99['type'],_0x38a38b);_0x5e67bc[_0x814cc4](_0x270ef4['text'],_0x270ef4[_0xbd7f('0x66')][_0xbd7f('0x6d')],_0x270ef4[_0xbd7f('0x66')][_0xbd7f('0x18')]);}}}else{var _0x5d7e92=_(_0x45f75e[_0xbd7f('0x3a')])[_0xbd7f('0x3b')]()[_0xbd7f('0x36')](function(_0x186c49){return _[_0xbd7f('0x73')](_0xcf0915,[_0xbd7f('0x26'),_0x186c49])?_0x186c49:undefined;})[_0xbd7f('0x74')]()[_0xbd7f('0x66')]();if(!_[_0xbd7f('0x75')](_0x5d7e92)){_0x5d7e92['forEach'](function(_0x57ef54){if(_0x57ef54==='FaxAccountId'){_0x53ceb8['where']('i.FaxAccountId\x20IN\x20?',[][_0xbd7f('0x76')](_0x45f75e['query'][_0x57ef54]));}else if(_0x57ef54===_0xbd7f('0x77')){var _0x1bb207=JSON[_0xbd7f('0x78')](_0x45f75e[_0xbd7f('0x3a')][_0x57ef54])['$gte'];var _0x596bd2=JSON[_0xbd7f('0x78')](_0x45f75e[_0xbd7f('0x3a')][_0x57ef54])[_0xbd7f('0x79')];_0x53ceb8[_0xbd7f('0x45')](_0xbd7f('0x7a'),_0x1bb207,_0x596bd2);}else{if(_0x45f75e[_0xbd7f('0x3a')][_0x57ef54]===_0xbd7f('0x7b')){_0x53ceb8[_0xbd7f('0x45')]('i.'+_0x57ef54+_0xbd7f('0x7c'));}else{_0x53ceb8[_0xbd7f('0x45')]('i.'+_0x57ef54+'\x20=\x20?',_0x45f75e[_0xbd7f('0x3a')][_0x57ef54]);}}});}if(_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x7d')]){if(_0x45f75e['query'][_0xbd7f('0x7d')]==0x1){_0x53ceb8[_0xbd7f('0x61')](_0xbd7f('0x7e'));}else{_0x53ceb8[_0xbd7f('0x61')](_0xbd7f('0x7f'));}}if(_0x45f75e['query'][_0xbd7f('0x80')]){_0x4daed4=_[_0xbd7f('0x81')](_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x80')])?_0x45f75e[_0xbd7f('0x3a')]['tag']:new Array(_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x80')]);_0x4daed4['forEach'](function(_0x2a0e09){_0x37e033['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2a0e09+',%');});}if(_0x45f75e[_0xbd7f('0x3a')]['filter']){var _0x30fadd=_0x45f75e['query'][_0xbd7f('0x82')][_0xbd7f('0x83')]('\x5c','\x5c\x5c')[_0xbd7f('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x30fadd)){_0x5e67bc['or'](_0xbd7f('0x84'),_0x30fadd+'%')['or'](_0xbd7f('0x85'),_0x30fadd+'%');}_0x5e67bc['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x30fadd+'%');}}_0x53ceb8[_0xbd7f('0x45')](_0x5e67bc);_0x53ceb8[_0xbd7f('0x86')](_0xbd7f('0x87'));var _0x1640ee={'type':db['Sequelize'][_0xbd7f('0x88')][_0xbd7f('0x89')],'raw':!![]};var _0x286382=_0x53ceb8[_0xbd7f('0x8a')]();_0x286382[_0xbd7f('0x47')](_0xbd7f('0x87'));_0x286382['field'](_0xbd7f('0x8b'),_0xbd7f('0x5f'));if(_0x216677[_0xbd7f('0x43')]){_0x216677[_0xbd7f('0x43')][_0xbd7f('0x8c')](function(_0x20fa4){var _0x1401eb=_0x20fa4[0x0]===_0xbd7f('0x8d')?_0x20fa4[0x0]:'i.'+_0x20fa4[0x0];_0x53ceb8[_0xbd7f('0x43')](_0x1401eb,_0x20fa4[0x1]==='DESC'?![]:!![]);});}if(!_[_0xbd7f('0x75')](_0x4daed4)){_0x53ceb8[_0xbd7f('0x61')](_0x37e033);_0x286382[_0xbd7f('0x45')]('t.id\x20IN\x20?',_0x4daed4);}BPromise[_0xbd7f('0x8e')]()[_0xbd7f('0x22')](function(){if(!_0x547434){if(_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x8f')])return;_0x286382[_0xbd7f('0x45')](_0xbd7f('0x90'));_0x53ceb8[_0xbd7f('0x45')](_0xbd7f('0x90'));return;}if(_0x45f75e['user'][_0xbd7f('0x91')]!==_0xbd7f('0x92'))return;return _0x45f75e[_0xbd7f('0x93')][_0xbd7f('0x94')]({'attributes':['id'],'raw':!![]})[_0xbd7f('0x22')](function(_0x26e147){if(_[_0xbd7f('0x75')](_0x26e147)){_0x286382[_0xbd7f('0x45')](_0xbd7f('0x95'));_0x53ceb8[_0xbd7f('0x45')](_0xbd7f('0x95'));}else{_0x286382[_0xbd7f('0x45')](_0xbd7f('0x96'),_[_0xbd7f('0x36')](_0x26e147,'id'));_0x53ceb8[_0xbd7f('0x45')](_0xbd7f('0x96'),_[_0xbd7f('0x36')](_0x26e147,'id'));}});})[_0xbd7f('0x22')](function(){if(_0x45f75e[_0xbd7f('0x93')][_0xbd7f('0x91')]===_0xbd7f('0x92')&&!_0x547434&&!_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x8f')])return[];return db['sequelize'][_0xbd7f('0x3a')](_0x286382['toString'](),_0x1640ee);})[_0xbd7f('0x22')](function(_0x4d307b){_0x256ccb[_0xbd7f('0x1d')]=_0x4d307b[_0xbd7f('0x41')];if(_0x256ccb['count']===0x0)return[];return db[_0xbd7f('0x97')][_0xbd7f('0x3a')](_0x3bacb9['toString'](),_0x1640ee)[_0xbd7f('0x22')](function(_0x126d65){_0xcadee9=_[_0xbd7f('0x98')](_0x126d65,'id');_0x1640ee=_[_0xbd7f('0x99')](_0x1640ee,{'model':db[_0xbd7f('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x45f75e[_0xbd7f('0x3a')][_0xbd7f('0x3f')]){_0x216677[_0xbd7f('0x40')][_0xbd7f('0x8c')](function(_0x1c048e){_0x53ceb8[_0xbd7f('0x47')]('i.'+_0x1c048e);});}else{_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0x8b'),_0xbd7f('0x5f'));_0x53ceb8['field'](_0xbd7f('0x9a'),_0xbd7f('0x9b'));_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0x9c'),_0xbd7f('0x9d'));_0x53ceb8['field'](_0xbd7f('0x9e'),_0xbd7f('0x8d'));_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0x9f'));_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0xa0'),_0xbd7f('0xa1'));_0x53ceb8['field'](_0xbd7f('0xa2'),_0xbd7f('0xa3'));_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0xa4'),'Contact.email');_0x53ceb8['field'](_0xbd7f('0xa5'),_0xbd7f('0xa6'));_0x53ceb8[_0xbd7f('0x47')]('c.mobile',_0xbd7f('0xa7'));_0x53ceb8['field'](_0xbd7f('0xa8'),_0xbd7f('0xa9'));_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0xaa'),'Owner.fullname');_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0xab'),_0xbd7f('0xac'));_0x53ceb8[_0xbd7f('0x47')](_0xbd7f('0xad'),_0xbd7f('0x29'));}if(_0x216677[_0xbd7f('0x1c')])_0x53ceb8['limit'](_0x216677[_0xbd7f('0x1c')]);if(_0x216677['offset'])_0x53ceb8[_0xbd7f('0x1a')](_0x216677[_0xbd7f('0x1a')]);return db[_0xbd7f('0x97')]['query'](_0x53ceb8[_0xbd7f('0xae')](),_0x1640ee);})[_0xbd7f('0x22')](function(_0x468dce){if(_0x468dce[_0xbd7f('0x41')]>0x0)_0x35dbaf[_0xbd7f('0x45')](_0xbd7f('0xaf'),_[_0xbd7f('0x36')](_0x468dce,'id'));return db[_0xbd7f('0x97')][_0xbd7f('0x3a')](_0x35dbaf[_0xbd7f('0xae')](),_0x1640ee)[_0xbd7f('0x22')](function(_0x578203){var _0x25f496=_[_0xbd7f('0xb0')](_0x578203,'FaxInteractionId');var _0x241810=[];_0x468dce['forEach'](function(_0x4427c3){_0x241810['push'](updateFaxInteraction(_0x4427c3,_0xcadee9,_0x25f496));});return BPromise[_0xbd7f('0xb1')](_0x241810);});});})['then'](function(_0x34d6e8){_0x256ccb[_0xbd7f('0xb2')]=_0x34d6e8;return _0x256ccb;})[_0xbd7f('0x22')](respondWithFilteredResult(_0x55c7ac,_0x216677))[_0xbd7f('0x2d')](handleError(_0x55c7ac,null));};exports[_0xbd7f('0xb3')]=function(_0x368678,_0x30d62b){var _0x4202d5={'raw':![],'where':{'id':_0x368678['params']['id']}},_0x2541d4={};_0x2541d4[_0xbd7f('0x3e')]=_[_0xbd7f('0x3b')](db[_0xbd7f('0x37')]['rawAttributes']);_0x2541d4[_0xbd7f('0x3a')]=_[_0xbd7f('0x3b')](_0x368678[_0xbd7f('0x3a')]);_0x2541d4[_0xbd7f('0x3c')]=_[_0xbd7f('0x3d')](_0x2541d4[_0xbd7f('0x3e')],_0x2541d4[_0xbd7f('0x3a')]);_0x4202d5[_0xbd7f('0x40')]=_[_0xbd7f('0x3d')](_0x2541d4[_0xbd7f('0x3e')],qs[_0xbd7f('0x3f')](_0x368678[_0xbd7f('0x3a')][_0xbd7f('0x3f')]));_0x4202d5[_0xbd7f('0x40')]=_0x4202d5[_0xbd7f('0x40')][_0xbd7f('0x41')]?_0x4202d5['attributes']:_0x2541d4[_0xbd7f('0x3e')];if(_0x368678['query'][_0xbd7f('0xb4')]){_0x4202d5[_0xbd7f('0xb5')]=[{'all':!![]}];}_0x4202d5=_['merge']({},_0x4202d5,_0x368678['options']);return db[_0xbd7f('0x37')][_0xbd7f('0xb6')](_0x4202d5)[_0xbd7f('0x22')](handleEntityNotFound(_0x30d62b,null))['then'](respondWithResult(_0x30d62b,null))[_0xbd7f('0x2d')](handleError(_0x30d62b,null));};exports[_0xbd7f('0xb7')]=function(_0x321352,_0x161544){return db[_0xbd7f('0x37')][_0xbd7f('0xb7')](_0x321352[_0xbd7f('0x72')],{})[_0xbd7f('0x22')](respondWithResult(_0x161544,0xc9))[_0xbd7f('0x2d')](handleError(_0x161544,null));};exports['update']=function(_0xa148e0,_0x4a2245){if(_0xa148e0[_0xbd7f('0x72')]['id']){delete _0xa148e0[_0xbd7f('0x72')]['id'];}return db[_0xbd7f('0x37')][_0xbd7f('0xb6')]({'where':{'id':_0xa148e0[_0xbd7f('0xb8')]['id']}})[_0xbd7f('0x22')](handleEntityNotFound(_0x4a2245,null))[_0xbd7f('0x22')](saveUpdates(_0xa148e0[_0xbd7f('0x72')],null))[_0xbd7f('0x22')](respondWithResult(_0x4a2245,null))[_0xbd7f('0x2d')](handleError(_0x4a2245,null));};exports[_0xbd7f('0x23')]=function(_0x36e02d,_0x118354){return db[_0xbd7f('0x37')]['find']({'where':{'id':_0x36e02d[_0xbd7f('0xb8')]['id']}})[_0xbd7f('0x22')](handleEntityNotFound(_0x118354,null))[_0xbd7f('0x22')](removeEntity(_0x118354,null))[_0xbd7f('0x2d')](handleError(_0x118354,null));};exports[_0xbd7f('0xb9')]=function(_0x16315e,_0x2e2d1a){return db['FaxInteraction'][_0xbd7f('0xb9')]()['then'](respondWithResult(_0x2e2d1a,null))[_0xbd7f('0x2d')](handleError(_0x2e2d1a,null));};exports[_0xbd7f('0xba')]=function(_0x269106,_0x5818e1,_0x4009e5){return db['FaxMessage']['find']({'where':{'id':_0x269106[_0xbd7f('0xb8')]['id']}})[_0xbd7f('0x22')](handleEntityNotFound(_0x5818e1,null))[_0xbd7f('0x22')](function(_0x453c9a){if(_0x453c9a){return _0x453c9a[_0xbd7f('0xba')](_0x269106['body'][_0xbd7f('0xbb')],_['omit'](_0x269106[_0xbd7f('0x72')],['ids','id'])||{});}})[_0xbd7f('0x22')](respondWithResult(_0x5818e1,null))['catch'](handleError(_0x5818e1,null));};exports[_0xbd7f('0xbc')]=function(_0x4e6a8c,_0x547740,_0x6b3cee){var _0x4ae75d={'raw':![],'where':{}};var _0x2cc064={};var _0x5cd942={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xbd7f('0xbd')]({'where':{'id':_0x4e6a8c['params']['id']}})[_0xbd7f('0x22')](handleEntityNotFound(_0x547740,null))[_0xbd7f('0x22')](function(_0x1493a2){if(_0x1493a2){_0x2cc064[_0xbd7f('0x3e')]=_[_0xbd7f('0x3b')](db['FaxMessage'][_0xbd7f('0x38')]);_0x2cc064[_0xbd7f('0x3a')]=_[_0xbd7f('0x3b')](_0x4e6a8c[_0xbd7f('0x3a')]);_0x2cc064[_0xbd7f('0x3c')]=_[_0xbd7f('0x3d')](_0x2cc064['model'],_0x2cc064['query']);_0x4ae75d[_0xbd7f('0x40')]=_[_0xbd7f('0x3d')](_0x2cc064[_0xbd7f('0x3e')],qs['fields'](_0x4e6a8c[_0xbd7f('0x3a')][_0xbd7f('0x3f')]));_0x4ae75d['attributes']=_0x4ae75d[_0xbd7f('0x40')][_0xbd7f('0x41')]?_0x4ae75d[_0xbd7f('0x40')]:_0x2cc064[_0xbd7f('0x3e')];if(!_0x4e6a8c[_0xbd7f('0x3a')]['hasOwnProperty'](_0xbd7f('0xbe'))){_0x4ae75d[_0xbd7f('0x1c')]=qs[_0xbd7f('0x1c')](_0x4e6a8c[_0xbd7f('0x3a')]['limit']);_0x4ae75d[_0xbd7f('0x1a')]=qs['offset'](_0x4e6a8c[_0xbd7f('0x3a')][_0xbd7f('0x1a')]);}_0x4ae75d['order']=qs[_0xbd7f('0x44')](_0x4e6a8c[_0xbd7f('0x3a')][_0xbd7f('0x44')]);_0x4ae75d[_0xbd7f('0x45')]=qs['filters'](_['pick'](_0x4e6a8c[_0xbd7f('0x3a')],_0x2cc064[_0xbd7f('0x3c')]));_0x4ae75d[_0xbd7f('0x45')][_0xbd7f('0xbf')]=_0x1493a2['id'];if(_0x4e6a8c[_0xbd7f('0x3a')][_0xbd7f('0x82')]){_0x4ae75d[_0xbd7f('0x45')]=_[_0xbd7f('0x99')](_0x4ae75d[_0xbd7f('0x45')],{'$or':_['map'](_0x4ae75d['attributes'],function(_0x51013c){var _0x3be895={};_0x3be895[_0x51013c]={'$like':'%'+_0x4e6a8c['query'][_0xbd7f('0x82')]+'%'};return _0x3be895;})});}if(_0x4e6a8c[_0xbd7f('0x3a')][_0xbd7f('0xc0')]){var _0xa9e68=_0x4e6a8c[_0xbd7f('0x3a')]['$gte'][_0xbd7f('0x2a')](',');var _0xe3bee9={};_0xe3bee9[_0xa9e68[0x0]]={'$gte':moment(_0xa9e68[0x1])[_0xbd7f('0xc1')](_0xbd7f('0xc2'))};_0x4ae75d[_0xbd7f('0x45')]=_[_0xbd7f('0x99')](_0x4ae75d[_0xbd7f('0x45')],_0xe3bee9);}_0x4ae75d=_['merge']({},_0x4ae75d,_0x4e6a8c[_0xbd7f('0xc3')]);return db['FaxMessage'][_0xbd7f('0x1d')]({'where':_0x4ae75d[_0xbd7f('0x45')]})[_0xbd7f('0x22')](function(_0x466782){_0x5cd942[_0xbd7f('0x1d')]=_0x466782;if(_0x4e6a8c[_0xbd7f('0x3a')][_0xbd7f('0xb4')]){_0x4ae75d[_0xbd7f('0xb5')]=[{'all':!![]}];}return db[_0xbd7f('0xc4')][_0xbd7f('0xc5')](_0x4ae75d);})[_0xbd7f('0x22')](function(_0x1b16f4){_0x5cd942[_0xbd7f('0xb2')]=_0x1b16f4;return _0x5cd942;});}})['then'](respondWithFilteredResult(_0x547740,_0x4ae75d))[_0xbd7f('0x2d')](handleError(_0x547740,null));};exports[_0xbd7f('0xc6')]=function(_0x1a14c9,_0x15502e,_0x33af3e){return db['FaxInteraction'][_0xbd7f('0xb6')]({'where':{'id':_0x1a14c9[_0xbd7f('0xb8')]['id']}})['then'](handleEntityNotFound(_0x15502e,null))[_0xbd7f('0x22')](function(_0x10ff6a){if(_0x10ff6a){return _0x10ff6a[_0xbd7f('0xc7')](_0x1a14c9['body'][_0xbd7f('0xbb')],_[_0xbd7f('0xc8')](_0x1a14c9[_0xbd7f('0x72')],['ids','id'])||{})[_0xbd7f('0xc9')](function(){return db[_0xbd7f('0xca')][_0xbd7f('0xc5')]({'attributes':['id',_0xbd7f('0x26'),_0xbd7f('0x48')],'where':{'id':_0x1a14c9['body'][_0xbd7f('0xbb')]}});})['then'](function(_0x3afad5){socket[_0xbd7f('0xcb')]('faxInteractionTags:save',{'id':Number(_0x1a14c9[_0xbd7f('0xb8')]['id']),'tags':_0x3afad5||[]});return{'id':Number(_0x1a14c9[_0xbd7f('0xb8')]['id']),'tags':_0x3afad5||[]};});}})['then'](respondWithResult(_0x15502e,null))[_0xbd7f('0x2d')](handleError(_0x15502e,null));};exports[_0xbd7f('0xcc')]=function(_0x4ebca6,_0x504f97,_0x51b87f){return db[_0xbd7f('0x37')][_0xbd7f('0xb6')]({'where':{'id':_0x4ebca6[_0xbd7f('0xb8')]['id']}})['then'](handleEntityNotFound(_0x504f97,null))['then'](function(_0xd7787b){if(_0xd7787b){return _0xd7787b[_0xbd7f('0xcc')](_0x4ebca6['query'][_0xbd7f('0xbb')]);}})['then'](respondWithStatusCode(_0x504f97,null))[_0xbd7f('0x2d')](handleError(_0x504f97,null));};exports[_0xbd7f('0xcd')]=function(_0x28a038,_0x201ce6){var _0x4de47d=moment()[_0xbd7f('0xce')]()[_0xbd7f('0xae')]();var _0x39b72d=path[_0xbd7f('0xcf')](config[_0xbd7f('0xd0')],'server','files',_0xbd7f('0xd1'));var _0x5561dd=path['join'](config[_0xbd7f('0xd0')],_0xbd7f('0xd2'),_0xbd7f('0xd3'),'attachments');var _0x38a9bb=path['join'](_0x39b72d,_0x4de47d);var _0x49db97=util['format'](_0xbd7f('0xd4'),_0x28a038['params']['id'],_0x4de47d);var _0x50d65f=path['join'](_0x39b72d,_0x49db97);var _0x489dcf=[];_0x489dcf[_0xbd7f('0x2c')]({'model':db[_0xbd7f('0xd5')],'as':'Attachment','raw':!![]});var _0x1408ee=[{'model':db[_0xbd7f('0xc4')],'as':_0xbd7f('0xd6'),'attributes':['id','body',_0xbd7f('0x77')],'include':_0x489dcf}];return db['FaxInteraction']['find']({'where':{'id':_0x28a038[_0xbd7f('0xb8')]['id']},'include':_0x1408ee})[_0xbd7f('0x22')](handleEntityNotFound(_0x201ce6,null))[_0xbd7f('0x22')](function(_0x4550f3){if(_0x4550f3&&_0x4550f3[_0xbd7f('0xd6')]){var _0x3a1ef0=_0x4550f3[_0xbd7f('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x38a9bb);for(var _0x2eab66=0x0;_0x2eab66<_0x3a1ef0[_0xbd7f('0xd6')][_0xbd7f('0x41')];_0x2eab66++){var _0xc9af46=_0x3a1ef0[_0xbd7f('0xd6')][_0x2eab66][_0xbd7f('0xd5')];if(_0xc9af46){var _0x3818f2=path[_0xbd7f('0xcf')](_0x5561dd,_0xc9af46[_0xbd7f('0xd8')]);if(fs[_0xbd7f('0xd9')](_0x3818f2)){fs[_0xbd7f('0xda')](_0x3818f2)[_0xbd7f('0xdb')](fs['createWriteStream'](path['join'](_0x38a9bb,_0xc9af46['basename'])));}}}return BPromise[_0xbd7f('0x8e')]()['then'](function(){return new BPromise(function(_0x47d4b5,_0x51e76b){zipdir(_0x38a9bb,{'saveTo':_0x50d65f},function(_0x399676,_0x292b3d){if(_0x399676)return _0x51e76b(_0x399676);return _0x47d4b5(_0x292b3d);});})[_0xbd7f('0x22')](function(){return new BPromise(function(_0x1fef4f,_0x35e10b){rimraf(_0x38a9bb,function(_0xa325d4){if(_0xa325d4)_0x35e10b(_0xa325d4);return _0x1fef4f();});});})[_0xbd7f('0x22')](function(){return _0x201ce6[_0xbd7f('0xcd')](_0x50d65f,_0x49db97,function(_0x3ed621){if(_0x3ed621){console[_0xbd7f('0xdc')](_0xbd7f('0xdd'),_0x3ed621);}else{fs[_0xbd7f('0xde')](_0x50d65f);}});});});}else{return _0x201ce6[_0xbd7f('0x16')](0xc8);}})[_0xbd7f('0x2d')](handleError(_0x201ce6,null));}; \ No newline at end of file +var _0x8b05=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','u.id\x20=\x20ui.UserId','fax_interactions','left_join','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$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','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','role','sequelize','toString','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','rows','show','params','includeAll','include','create','describe','addMessage','FaxMessage','ids','omit','FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','spread','faxInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','err','unlinkSync','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./faxInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','talking','answered','total','closed','waiting','UserId','unmanaged','rawAttributes','type','key','model','keys','query','filters','intersection'];(function(_0x246cba,_0x43c1af){var _0x3b8b78=function(_0x5852ff){while(--_0x5852ff){_0x246cba['push'](_0x246cba['shift']());}};_0x3b8b78(++_0x43c1af);}(_0x8b05,0x177));var _0x58b0=function(_0x7c60b0,_0x19e1dd){_0x7c60b0=_0x7c60b0-0x0;var _0x161ff6=_0x8b05[_0x7c60b0];return _0x161ff6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x58b0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x58b0('0x1'));var moment=require(_0x58b0('0x2'));var BPromise=require(_0x58b0('0x3'));var Mustache=require(_0x58b0('0x4'));var util=require(_0x58b0('0x5'));var path=require(_0x58b0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x58b0('0x7'));var fs=require('fs');var fs_extra=require(_0x58b0('0x8'));var _=require(_0x58b0('0x9'));var squel=require(_0x58b0('0xa'));var crypto=require(_0x58b0('0xb'));var jsforce=require(_0x58b0('0xc'));var deskjs=require(_0x58b0('0xd'));var toCsv=require(_0x58b0('0xe'));var querystring=require('querystring');var Papa=require(_0x58b0('0xf'));var Redis=require(_0x58b0('0x10'));var authService=require(_0x58b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x58b0('0x12'));var hardwareService=require(_0x58b0('0x13'));var logger=require(_0x58b0('0x14'))('api');var utils=require(_0x58b0('0x15'));var config=require(_0x58b0('0x16'));var licenseUtil=require(_0x58b0('0x17'));var db=require(_0x58b0('0x18'))['db'];config[_0x58b0('0x19')]=_[_0x58b0('0x1a')](config[_0x58b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x58b0('0x19')]));require(_0x58b0('0x1b'))[_0x58b0('0x1c')](socket);function respondWithStatusCode(_0x2f3938,_0x167d75){_0x167d75=_0x167d75||0xcc;return function(_0x20e933){if(_0x20e933){return _0x2f3938[_0x58b0('0x1d')](_0x167d75);}return _0x2f3938[_0x58b0('0x1e')](_0x167d75)[_0x58b0('0x1f')]();};}function respondWithResult(_0x3a4e3b,_0x91b910){_0x91b910=_0x91b910||0xc8;return function(_0x49e194){if(_0x49e194){return _0x3a4e3b[_0x58b0('0x1e')](_0x91b910)[_0x58b0('0x20')](_0x49e194);}};}function respondWithFilteredResult(_0xc97be4,_0x40169d){return function(_0x25b693){if(_0x25b693){var _0x1b871d=typeof _0x40169d[_0x58b0('0x21')]==='undefined'&&typeof _0x40169d[_0x58b0('0x22')]===_0x58b0('0x23');var _0x1fb169=_0x25b693[_0x58b0('0x24')];var _0x325d76=_0x1b871d?0x0:_0x40169d['offset'];var _0x1b84aa=_0x1b871d?_0x25b693[_0x58b0('0x24')]:_0x40169d[_0x58b0('0x21')]+_0x40169d[_0x58b0('0x22')];var _0x471bf0;if(_0x1b84aa>=_0x1fb169){_0x1b84aa=_0x1fb169;_0x471bf0=0xc8;}else{_0x471bf0=0xce;}_0xc97be4['status'](_0x471bf0);return _0xc97be4[_0x58b0('0x25')](_0x58b0('0x26'),_0x325d76+'-'+_0x1b84aa+'/'+_0x1fb169)[_0x58b0('0x20')](_0x25b693);}return null;};}function patchUpdates(_0x9ecdae){return function(_0xb8c79a){try{jsonpatch[_0x58b0('0x27')](_0xb8c79a,_0x9ecdae,!![]);}catch(_0xebb688){return BPromise['reject'](_0xebb688);}return _0xb8c79a[_0x58b0('0x28')]();};}function saveUpdates(_0x10513c,_0x23abd3){return function(_0x407392){if(_0x407392){return _0x407392[_0x58b0('0x29')](_0x10513c)[_0x58b0('0x2a')](function(_0x503990){return _0x503990;});}return null;};}function removeEntity(_0x5bf84a,_0xa1d04){return function(_0x3f0892){if(_0x3f0892){return _0x3f0892[_0x58b0('0x2b')]()[_0x58b0('0x2a')](function(){_0x5bf84a[_0x58b0('0x1e')](0xcc)[_0x58b0('0x1f')]();});}};}function handleEntityNotFound(_0x2087fd,_0x4a4032){return function(_0x78600d){if(!_0x78600d){_0x2087fd[_0x58b0('0x1d')](0x194);}return _0x78600d;};}function handleError(_0x316aa5,_0x18dfa1){_0x18dfa1=_0x18dfa1||0x1f4;return function(_0x281ea0){logger[_0x58b0('0x2c')](_0x281ea0[_0x58b0('0x2d')]);if(_0x281ea0['name']){delete _0x281ea0[_0x58b0('0x2e')];}_0x316aa5['status'](_0x18dfa1)[_0x58b0('0x2f')](_0x281ea0);};}function getInteractionUsers(_0x49b2ad,_0x1875f4){return new BPromise(function(_0x122a01,_0x1b81cd){try{if(_0x1875f4[_0x49b2ad['id']]){_0x49b2ad['Users']=_[_0x58b0('0x30')](_0x1875f4[_0x49b2ad['id']],function(_0x117852){return{'id':_0x117852['id'],'fullname':_0x117852[_0x58b0('0x31')]};});}}catch(_0x315505){_0x1b81cd(_0x315505);}_0x122a01(_0x49b2ad);});}function getInteractionTags(_0xca343a,_0x7c2b10){return new BPromise(function(_0x5eeca2,_0x504a57){try{if(_0xca343a[_0x58b0('0x32')]){_0xca343a[_0x58b0('0x33')]=[];_0xca343a[_0x58b0('0x32')][_0x58b0('0x34')](',')[_0x58b0('0x35')](function(_0x449a8a){_0xca343a[_0x58b0('0x33')][_0x58b0('0x36')](_0x7c2b10[_0x449a8a]);});}delete _0xca343a['TagIds'];}catch(_0x321b82){_0x504a57(_0x321b82);}_0x5eeca2(_0xca343a);});}function updateFaxInteraction(_0x145bf6,_0x43415e,_0x9bd704){return new BPromise(function(_0xd9c7f2,_0x38ca2b){return getInteractionUsers(_0x145bf6,_0x9bd704)[_0x58b0('0x2a')](function(_0x2c7d0e){return getInteractionTags(_0x2c7d0e,_0x43415e);})[_0x58b0('0x2a')](function(_0x173f1e){return getStateInteraction(_0x173f1e);})[_0x58b0('0x2a')](function(_0x208673){_0xd9c7f2(_0x208673);})[_0x58b0('0x37')](function(_0x49196a){_0x38ca2b(_0x49196a);});});}function getStateInteraction(_0x1ebc91){return new BPromise(function(_0x33be55){_0x1ebc91['waiting']=0x0;_0x1ebc91[_0x58b0('0x38')]=0x0;_0x1ebc91[_0x58b0('0x39')]=0x0;_0x1ebc91['unmanaged']=0x0;_0x1ebc91[_0x58b0('0x3a')]=0x0;if(!_0x1ebc91[_0x58b0('0x3b')]&&!_0x1ebc91['UserId']){_0x1ebc91[_0x58b0('0x3c')]+=0x1;}if(!_0x1ebc91[_0x58b0('0x3b')]&&_0x1ebc91[_0x58b0('0x3d')]){_0x1ebc91[_0x58b0('0x38')]+=0x1;if(_0x1ebc91[_0x58b0('0x3c')]){_0x1ebc91['waiting']-=0x1;}}if(_0x1ebc91[_0x58b0('0x3b')]&&_0x1ebc91[_0x58b0('0x3d')]){_0x1ebc91[_0x58b0('0x39')]+=0x1;if(_0x1ebc91[_0x58b0('0x38')]){_0x1ebc91['talking']-=0x1;}}if(_0x1ebc91[_0x58b0('0x3b')]&&!_0x1ebc91['UserId']){_0x1ebc91[_0x58b0('0x3e')]+=0x1;if(_0x1ebc91[_0x58b0('0x3c')]){_0x1ebc91[_0x58b0('0x3c')]-=0x1;}}_0x1ebc91['total']+=0x1;_0x33be55(_0x1ebc91);});}exports['index']=function(_0x39aa55,_0x202295){var _0x53fe7a={},_0x4cf891={},_0x7218b8={'count':0x0,'rows':[]};var _0x155ce8=_[_0x58b0('0x30')](db['FaxInteraction'][_0x58b0('0x3f')],function(_0x41f049){return{'name':_0x41f049['fieldName'],'type':_0x41f049[_0x58b0('0x40')][_0x58b0('0x41')]};});_0x4cf891[_0x58b0('0x42')]=_[_0x58b0('0x30')](_0x155ce8,_0x58b0('0x2e'));_0x4cf891['query']=_[_0x58b0('0x43')](_0x39aa55[_0x58b0('0x44')]);_0x4cf891[_0x58b0('0x45')]=_[_0x58b0('0x46')](_0x4cf891[_0x58b0('0x42')],_0x4cf891[_0x58b0('0x44')]);_0x53fe7a[_0x58b0('0x47')]=_[_0x58b0('0x46')](_0x4cf891[_0x58b0('0x42')],qs['fields'](_0x39aa55['query'][_0x58b0('0x48')]));_0x53fe7a['attributes']=_0x53fe7a[_0x58b0('0x47')][_0x58b0('0x49')]?_0x53fe7a[_0x58b0('0x47')]:_0x4cf891[_0x58b0('0x42')];if(!_0x39aa55[_0x58b0('0x44')][_0x58b0('0x4a')](_0x58b0('0x4b'))){_0x53fe7a[_0x58b0('0x22')]=qs[_0x58b0('0x22')](_0x39aa55['query'][_0x58b0('0x22')]);_0x53fe7a[_0x58b0('0x21')]=qs[_0x58b0('0x21')](_0x39aa55[_0x58b0('0x44')][_0x58b0('0x21')]);}_0x53fe7a[_0x58b0('0x4c')]=qs[_0x58b0('0x4d')](_0x39aa55[_0x58b0('0x44')][_0x58b0('0x4d')]);_0x53fe7a[_0x58b0('0x4e')]=qs[_0x58b0('0x45')](_[_0x58b0('0x4f')](_0x39aa55[_0x58b0('0x44')],_0x4cf891['filters']),_0x155ce8);var _0x25476a=[];var _0x15c478=squel[_0x58b0('0x50')]()[_0x58b0('0x51')]('id')[_0x58b0('0x51')](_0x58b0('0x2e'))[_0x58b0('0x51')](_0x58b0('0x52'))[_0x58b0('0x53')](_0x58b0('0x54'));var _0x2dc039=squel['select']()[_0x58b0('0x51')](_0x58b0('0x55'))['field'](_0x58b0('0x56'))[_0x58b0('0x51')](_0x58b0('0x57'))[_0x58b0('0x53')](_0x58b0('0x58'),'ui')['left_join']('users','u',_0x58b0('0x59'));var _0x3e6c9b=squel[_0x58b0('0x50')]()[_0x58b0('0x53')](_0x58b0('0x5a'),'i')[_0x58b0('0x5b')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x58b0('0x5c'),'o',_0x58b0('0x5d'))[_0x58b0('0x5b')](_0x58b0('0x5e'),'a',_0x58b0('0x5f'))[_0x58b0('0x5b')](_0x58b0('0x60'),'me',_0x58b0('0x61'))[_0x58b0('0x5b')](_0x58b0('0x62'),'it',_0x58b0('0x63'))[_0x58b0('0x5b')](_0x58b0('0x54'),'t',_0x58b0('0x64'));var _0x4a7c15=squel['expr']();var _0x1634e5=[];var _0x34ae86=squel[_0x58b0('0x65')]();var _0x52af13;if(_0x39aa55[_0x58b0('0x44')]['search']){_0x52af13=as['parseSearch'](_0x39aa55[_0x58b0('0x44')][_0x58b0('0x66')]);var _0x41666a=_0x52af13[_0x58b0('0x67')];for(var _0x231f7b=0x0;_0x231f7b<_0x52af13[_0x58b0('0x68')][_0x58b0('0x49')];_0x231f7b++){var _0x339d5e=_0x52af13[_0x58b0('0x68')][_0x231f7b];var _0xfae537='i';var _0x3de7aa=_[_0x58b0('0x69')](_0x155ce8,[_0x58b0('0x2e'),_0x339d5e['field']]);if(!_0x3de7aa){switch(_0x339d5e['field']){case _0x58b0('0x6a'):if(_0x339d5e[_0x58b0('0x6b')]==0x1){_0x3e6c9b[_0x58b0('0x6c')]('`'+_0x339d5e[_0x58b0('0x51')]+_0x58b0('0x6d'));}else{_0x3e6c9b[_0x58b0('0x6c')]('`'+_0x339d5e[_0x58b0('0x51')]+_0x58b0('0x6e'));}break;case'Contact':if(_0x339d5e[_0x58b0('0x6f')]===_0x58b0('0x70')){if(_0x339d5e[_0x58b0('0x6b')][_0x58b0('0x34')]('\x20')[_0x58b0('0x49')]>0x1){_0x4a7c15[_0x41666a](_0x58b0('0x71'),qs[_0x58b0('0x72')](_0x339d5e['value']),null);}else{var _0x42d614='%'+_0x339d5e['value']+'%';_0x4a7c15[_0x41666a](_0x58b0('0x73'),_0x42d614,_0x42d614,_0x42d614);}}else{_0x3de7aa=_[_0x58b0('0x69')](_0x155ce8,[_0x58b0('0x2e'),_0x58b0('0x74')]);_0x339d5e['field']=_0x58b0('0x74');_0x25a541=as[_0x58b0('0x75')](_0xfae537,_0x3de7aa['type'],_0x339d5e);_0x4a7c15[_0x41666a](_0x25a541[_0x58b0('0x76')],_0x25a541[_0x58b0('0x6b')]['start'],_0x25a541['value']['end']);}break;case _0x58b0('0x77'):var _0x37c49b=_0x339d5e['value'][_0x58b0('0x34')](',')[_0x58b0('0x30')](function(_0x5b0555){return Number(_0x5b0555);});_0x37c49b['forEach'](function(_0x5e75c3){_0x34ae86['or'](_0x58b0('0x78'),'%,'+_0x5e75c3+',%');});_0x1634e5=_[_0x58b0('0x79')](_0x1634e5,_0x37c49b);break;case'User':if(_0x339d5e['operator']===_0x58b0('0x70')){_0x4a7c15[_0x41666a](_0x58b0('0x7a'),'%'+_0x339d5e[_0x58b0('0x6b')]+'%',null);}else{_0x3de7aa=_[_0x58b0('0x69')](_0x155ce8,['name',_0x58b0('0x3d')]);_0x339d5e[_0x58b0('0x51')]='UserId';_0x25a541=as[_0x58b0('0x75')](_0xfae537,_0x3de7aa['type'],_0x339d5e);_0x4a7c15[_0x41666a](_0x25a541['text'],_0x25a541[_0x58b0('0x6b')][_0x58b0('0x7b')],_0x25a541[_0x58b0('0x6b')][_0x58b0('0x1f')]);}break;case _0x58b0('0x7c'):_0x25a541=as[_0x58b0('0x75')]('me',null,_0x339d5e);_0x4a7c15[_0x41666a](_0x25a541[_0x58b0('0x76')],_0x25a541[_0x58b0('0x6b')][_0x58b0('0x7b')],_0x25a541[_0x58b0('0x6b')]['end']);break;}}else{var _0x25a541=as[_0x58b0('0x75')](_0xfae537,_0x3de7aa['type'],_0x339d5e);_0x4a7c15[_0x41666a](_0x25a541['text'],_0x25a541[_0x58b0('0x6b')][_0x58b0('0x7b')],_0x25a541[_0x58b0('0x6b')][_0x58b0('0x1f')]);}}}else{var _0x163109=_(_0x39aa55[_0x58b0('0x44')])['keys']()['map'](function(_0x18e8cb){return _[_0x58b0('0x7d')](_0x155ce8,['name',_0x18e8cb])?_0x18e8cb:undefined;})[_0x58b0('0x7e')]()[_0x58b0('0x6b')]();if(!_[_0x58b0('0x7f')](_0x163109)){_0x163109[_0x58b0('0x35')](function(_0x1f1ad3){if(_0x1f1ad3===_0x58b0('0x80')){_0x3e6c9b[_0x58b0('0x4e')](_0x58b0('0x81'),[][_0x58b0('0x82')](_0x39aa55['query'][_0x1f1ad3]));}else if(_0x1f1ad3===_0x58b0('0x83')){var _0xcb4a58=JSON[_0x58b0('0x84')](_0x39aa55[_0x58b0('0x44')][_0x1f1ad3])[_0x58b0('0x85')];var _0x5257ef=JSON['parse'](_0x39aa55[_0x58b0('0x44')][_0x1f1ad3])[_0x58b0('0x86')];_0x3e6c9b[_0x58b0('0x4e')](_0x58b0('0x87'),_0xcb4a58,_0x5257ef);}else{if(_0x39aa55['query'][_0x1f1ad3]===_0x58b0('0x88')){_0x3e6c9b['where']('i.'+_0x1f1ad3+_0x58b0('0x89'));}else{_0x3e6c9b[_0x58b0('0x4e')]('i.'+_0x1f1ad3+_0x58b0('0x8a'),_0x39aa55['query'][_0x1f1ad3]);}}});}if(_0x39aa55[_0x58b0('0x44')][_0x58b0('0x8b')]){if(_0x39aa55[_0x58b0('0x44')]['read']==0x1){_0x3e6c9b[_0x58b0('0x6c')](_0x58b0('0x8c'));}else{_0x3e6c9b[_0x58b0('0x6c')]('`unreadMessages`\x20>\x200');}}if(_0x39aa55[_0x58b0('0x44')]['tag']){_0x1634e5=_[_0x58b0('0x8d')](_0x39aa55[_0x58b0('0x44')][_0x58b0('0x8e')])?_0x39aa55[_0x58b0('0x44')][_0x58b0('0x8e')]:new Array(_0x39aa55[_0x58b0('0x44')][_0x58b0('0x8e')]);_0x1634e5[_0x58b0('0x35')](function(_0x3e579a){_0x34ae86['or'](_0x58b0('0x78'),'%,'+_0x3e579a+',%');});}if(_0x39aa55['query'][_0x58b0('0x8f')]){var _0x379b34=_0x39aa55[_0x58b0('0x44')][_0x58b0('0x8f')][_0x58b0('0x90')]('\x5c','\x5c\x5c')[_0x58b0('0x90')](/'/g,'\x27\x27');if(qs[_0x58b0('0x91')](_0x379b34)){_0x4a7c15['or'](_0x58b0('0x92'),_0x379b34+'%')['or']('i.fax\x20LIKE\x20?',_0x379b34+'%');}_0x4a7c15['or'](_0x58b0('0x93'),_0x379b34+'%');}}_0x3e6c9b[_0x58b0('0x4e')](_0x4a7c15);_0x3e6c9b[_0x58b0('0x94')](_0x58b0('0x95'));var _0x146031={'type':db[_0x58b0('0x96')]['QueryTypes'][_0x58b0('0x97')],'raw':!![]};var _0x21acea=_0x3e6c9b['clone']();_0x21acea[_0x58b0('0x51')](_0x58b0('0x95'));_0x21acea[_0x58b0('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x53fe7a[_0x58b0('0x4c')]){_0x53fe7a[_0x58b0('0x4c')][_0x58b0('0x35')](function(_0x57e035){var _0x25405d=_0x57e035[0x0]==='contactName'?_0x57e035[0x0]:'i.'+_0x57e035[0x0];_0x3e6c9b['order'](_0x25405d,_0x57e035[0x1]===_0x58b0('0x98')?![]:!![]);});}if(!_[_0x58b0('0x7f')](_0x1634e5)){_0x3e6c9b[_0x58b0('0x6c')](_0x34ae86);_0x21acea[_0x58b0('0x4e')]('t.id\x20IN\x20?',_0x1634e5);}BPromise[_0x58b0('0x99')]()['then'](function(){if(!_0x52af13){if(_0x39aa55[_0x58b0('0x44')][_0x58b0('0x80')])return;_0x21acea[_0x58b0('0x4e')](_0x58b0('0x9a'));_0x3e6c9b[_0x58b0('0x4e')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x39aa55[_0x58b0('0x9b')]['role']!==_0x58b0('0x9c'))return;return _0x39aa55['user'][_0x58b0('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x436376){if(_[_0x58b0('0x7f')](_0x436376)){_0x21acea[_0x58b0('0x4e')](_0x58b0('0x9e'));_0x3e6c9b[_0x58b0('0x4e')](_0x58b0('0x9e'));}else{_0x21acea[_0x58b0('0x4e')](_0x58b0('0x81'),_[_0x58b0('0x30')](_0x436376,'id'));_0x3e6c9b[_0x58b0('0x4e')](_0x58b0('0x81'),_['map'](_0x436376,'id'));}});})[_0x58b0('0x2a')](function(){if(_0x39aa55['user'][_0x58b0('0x9f')]===_0x58b0('0x9c')&&!_0x52af13&&!_0x39aa55[_0x58b0('0x44')]['FaxAccountId'])return[];return db[_0x58b0('0xa0')][_0x58b0('0x44')](_0x21acea[_0x58b0('0xa1')](),_0x146031);})[_0x58b0('0x2a')](function(_0x344ea0){_0x7218b8[_0x58b0('0x24')]=_0x344ea0[_0x58b0('0x49')];if(_0x7218b8[_0x58b0('0x24')]===0x0)return[];return db['sequelize'][_0x58b0('0x44')](_0x15c478[_0x58b0('0xa1')](),_0x146031)['then'](function(_0x286452){_0x25476a=_['keyBy'](_0x286452,'id');_0x146031=_[_0x58b0('0xa2')](_0x146031,{'model':db[_0x58b0('0xa3')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39aa55[_0x58b0('0x44')][_0x58b0('0x48')]){_0x53fe7a[_0x58b0('0x47')][_0x58b0('0x35')](function(_0x4b44fb){_0x3e6c9b['field']('i.'+_0x4b44fb);});}else{_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xa4'),_0x58b0('0x6a'));_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xa5'),_0x58b0('0xa6'));_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xa7'),_0x58b0('0xa8'));_0x3e6c9b[_0x58b0('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',_0x58b0('0xa9'));_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xaa'));_0x3e6c9b[_0x58b0('0x51')]('c.firstName',_0x58b0('0xab'));_0x3e6c9b[_0x58b0('0x51')]('c.lastName',_0x58b0('0xac'));_0x3e6c9b['field'](_0x58b0('0xad'),_0x58b0('0xae'));_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xaf'),'Contact.phone');_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xb0'),_0x58b0('0xb1'));_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xb2'),_0x58b0('0xb3'));_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xb4'),_0x58b0('0xb5'));_0x3e6c9b[_0x58b0('0x51')](_0x58b0('0xb6'),_0x58b0('0xb7'));_0x3e6c9b['field'](_0x58b0('0xb8'),'TagIds');}if(_0x53fe7a['limit'])_0x3e6c9b[_0x58b0('0x22')](_0x53fe7a[_0x58b0('0x22')]);if(_0x53fe7a[_0x58b0('0x21')])_0x3e6c9b[_0x58b0('0x21')](_0x53fe7a[_0x58b0('0x21')]);return db[_0x58b0('0xa0')][_0x58b0('0x44')](_0x3e6c9b['toString'](),_0x146031);})[_0x58b0('0x2a')](function(_0x3f2b7c){if(_0x3f2b7c[_0x58b0('0x49')]>0x0)_0x2dc039[_0x58b0('0x4e')]('ui.FaxInteractionId\x20IN\x20?',_[_0x58b0('0x30')](_0x3f2b7c,'id'));return db[_0x58b0('0xa0')]['query'](_0x2dc039['toString'](),_0x146031)['then'](function(_0x4625f6){var _0x523ef0=_[_0x58b0('0xb9')](_0x4625f6,'FaxInteractionId');var _0x2fcb53=[];_0x3f2b7c[_0x58b0('0x35')](function(_0x53854e){_0x2fcb53[_0x58b0('0x36')](updateFaxInteraction(_0x53854e,_0x25476a,_0x523ef0));});return BPromise['all'](_0x2fcb53);});});})[_0x58b0('0x2a')](function(_0x547460){_0x7218b8[_0x58b0('0xba')]=_0x547460;return _0x7218b8;})[_0x58b0('0x2a')](respondWithFilteredResult(_0x202295,_0x53fe7a))[_0x58b0('0x37')](handleError(_0x202295,null));};exports[_0x58b0('0xbb')]=function(_0x1ec8c5,_0x1f5b3c){var _0x10abe1={'raw':![],'where':{'id':_0x1ec8c5[_0x58b0('0xbc')]['id']}},_0x4da4b6={};_0x4da4b6[_0x58b0('0x42')]=_[_0x58b0('0x43')](db['FaxInteraction'][_0x58b0('0x3f')]);_0x4da4b6['query']=_[_0x58b0('0x43')](_0x1ec8c5[_0x58b0('0x44')]);_0x4da4b6[_0x58b0('0x45')]=_['intersection'](_0x4da4b6[_0x58b0('0x42')],_0x4da4b6['query']);_0x10abe1[_0x58b0('0x47')]=_[_0x58b0('0x46')](_0x4da4b6[_0x58b0('0x42')],qs[_0x58b0('0x48')](_0x1ec8c5[_0x58b0('0x44')][_0x58b0('0x48')]));_0x10abe1[_0x58b0('0x47')]=_0x10abe1[_0x58b0('0x47')][_0x58b0('0x49')]?_0x10abe1['attributes']:_0x4da4b6[_0x58b0('0x42')];if(_0x1ec8c5[_0x58b0('0x44')][_0x58b0('0xbd')]){_0x10abe1[_0x58b0('0xbe')]=[{'all':!![]}];}_0x10abe1=_[_0x58b0('0xa2')]({},_0x10abe1,_0x1ec8c5['options']);return db[_0x58b0('0xa3')][_0x58b0('0x69')](_0x10abe1)['then'](handleEntityNotFound(_0x1f5b3c,null))[_0x58b0('0x2a')](respondWithResult(_0x1f5b3c,null))[_0x58b0('0x37')](handleError(_0x1f5b3c,null));};exports['create']=function(_0x4a08de,_0x36b8b7){return db['FaxInteraction'][_0x58b0('0xbf')](_0x4a08de[_0x58b0('0x7c')],{})[_0x58b0('0x2a')](respondWithResult(_0x36b8b7,0xc9))[_0x58b0('0x37')](handleError(_0x36b8b7,null));};exports[_0x58b0('0x29')]=function(_0x4a1b5a,_0x3ee9fb){if(_0x4a1b5a[_0x58b0('0x7c')]['id']){delete _0x4a1b5a[_0x58b0('0x7c')]['id'];}return db[_0x58b0('0xa3')][_0x58b0('0x69')]({'where':{'id':_0x4a1b5a[_0x58b0('0xbc')]['id']}})[_0x58b0('0x2a')](handleEntityNotFound(_0x3ee9fb,null))[_0x58b0('0x2a')](saveUpdates(_0x4a1b5a[_0x58b0('0x7c')],null))[_0x58b0('0x2a')](respondWithResult(_0x3ee9fb,null))['catch'](handleError(_0x3ee9fb,null));};exports[_0x58b0('0x2b')]=function(_0x4bc752,_0x18ad03){return db[_0x58b0('0xa3')]['find']({'where':{'id':_0x4bc752[_0x58b0('0xbc')]['id']}})[_0x58b0('0x2a')](handleEntityNotFound(_0x18ad03,null))[_0x58b0('0x2a')](removeEntity(_0x18ad03,null))[_0x58b0('0x37')](handleError(_0x18ad03,null));};exports[_0x58b0('0xc0')]=function(_0x3865c8,_0xd34b60){return db[_0x58b0('0xa3')][_0x58b0('0xc0')]()[_0x58b0('0x2a')](respondWithResult(_0xd34b60,null))['catch'](handleError(_0xd34b60,null));};exports[_0x58b0('0xc1')]=function(_0x44f7b7,_0x13f197,_0x182761){return db[_0x58b0('0xc2')]['find']({'where':{'id':_0x44f7b7[_0x58b0('0xbc')]['id']}})[_0x58b0('0x2a')](handleEntityNotFound(_0x13f197,null))[_0x58b0('0x2a')](function(_0x1e5ba7){if(_0x1e5ba7){return _0x1e5ba7[_0x58b0('0xc1')](_0x44f7b7[_0x58b0('0x7c')][_0x58b0('0xc3')],_[_0x58b0('0xc4')](_0x44f7b7['body'],['ids','id'])||{});}})[_0x58b0('0x2a')](respondWithResult(_0x13f197,null))[_0x58b0('0x37')](handleError(_0x13f197,null));};exports['getMessages']=function(_0x3b3c25,_0x693c07,_0x55284b){var _0x2d117f={'raw':![],'where':{}};var _0x1e0c53={};var _0x9953b8={'count':0x0,'rows':[]};return db[_0x58b0('0xa3')]['findOne']({'where':{'id':_0x3b3c25[_0x58b0('0xbc')]['id']}})[_0x58b0('0x2a')](handleEntityNotFound(_0x693c07,null))[_0x58b0('0x2a')](function(_0x4b351c){if(_0x4b351c){_0x1e0c53['model']=_[_0x58b0('0x43')](db[_0x58b0('0xc2')][_0x58b0('0x3f')]);_0x1e0c53[_0x58b0('0x44')]=_[_0x58b0('0x43')](_0x3b3c25[_0x58b0('0x44')]);_0x1e0c53['filters']=_[_0x58b0('0x46')](_0x1e0c53[_0x58b0('0x42')],_0x1e0c53['query']);_0x2d117f[_0x58b0('0x47')]=_['intersection'](_0x1e0c53[_0x58b0('0x42')],qs[_0x58b0('0x48')](_0x3b3c25[_0x58b0('0x44')]['fields']));_0x2d117f['attributes']=_0x2d117f['attributes'][_0x58b0('0x49')]?_0x2d117f[_0x58b0('0x47')]:_0x1e0c53[_0x58b0('0x42')];if(!_0x3b3c25[_0x58b0('0x44')]['hasOwnProperty'](_0x58b0('0x4b'))){_0x2d117f[_0x58b0('0x22')]=qs[_0x58b0('0x22')](_0x3b3c25['query']['limit']);_0x2d117f[_0x58b0('0x21')]=qs[_0x58b0('0x21')](_0x3b3c25[_0x58b0('0x44')][_0x58b0('0x21')]);}_0x2d117f[_0x58b0('0x4c')]=qs[_0x58b0('0x4d')](_0x3b3c25[_0x58b0('0x44')][_0x58b0('0x4d')]);_0x2d117f[_0x58b0('0x4e')]=qs[_0x58b0('0x45')](_[_0x58b0('0x4f')](_0x3b3c25[_0x58b0('0x44')],_0x1e0c53[_0x58b0('0x45')]));_0x2d117f[_0x58b0('0x4e')][_0x58b0('0xc5')]=_0x4b351c['id'];if(_0x3b3c25[_0x58b0('0x44')]['filter']){_0x2d117f['where']=_['merge'](_0x2d117f[_0x58b0('0x4e')],{'$or':_[_0x58b0('0x30')](_0x2d117f['attributes'],function(_0x17b752){var _0x3c1a39={};_0x3c1a39[_0x17b752]={'$like':'%'+_0x3b3c25[_0x58b0('0x44')]['filter']+'%'};return _0x3c1a39;})});}if(_0x3b3c25[_0x58b0('0x44')]['$gte']){var _0x4adf08=_0x3b3c25['query'][_0x58b0('0x85')][_0x58b0('0x34')](',');var _0x3c3f80={};_0x3c3f80[_0x4adf08[0x0]]={'$gte':moment(_0x4adf08[0x1])['format'](_0x58b0('0xc6'))};_0x2d117f[_0x58b0('0x4e')]=_[_0x58b0('0xa2')](_0x2d117f[_0x58b0('0x4e')],_0x3c3f80);}_0x2d117f=_[_0x58b0('0xa2')]({},_0x2d117f,_0x3b3c25['options']);return db[_0x58b0('0xc2')][_0x58b0('0x24')]({'where':_0x2d117f[_0x58b0('0x4e')]})[_0x58b0('0x2a')](function(_0x1954b6){_0x9953b8['count']=_0x1954b6;if(_0x3b3c25[_0x58b0('0x44')][_0x58b0('0xbd')]){_0x2d117f[_0x58b0('0xbe')]=[{'all':!![]}];}return db[_0x58b0('0xc2')][_0x58b0('0xc7')](_0x2d117f);})[_0x58b0('0x2a')](function(_0xff514e){_0x9953b8[_0x58b0('0xba')]=_0xff514e;return _0x9953b8;});}})['then'](respondWithFilteredResult(_0x693c07,_0x2d117f))['catch'](handleError(_0x693c07,null));};exports['addTags']=function(_0x410f07,_0x59a110,_0x1c1310){return db[_0x58b0('0xa3')]['find']({'where':{'id':_0x410f07['params']['id']}})[_0x58b0('0x2a')](handleEntityNotFound(_0x59a110,null))['then'](function(_0x558429){if(_0x558429){return _0x558429['setTags'](_0x410f07[_0x58b0('0x7c')][_0x58b0('0xc3')],_[_0x58b0('0xc4')](_0x410f07[_0x58b0('0x7c')],[_0x58b0('0xc3'),'id'])||{})[_0x58b0('0xc8')](function(){return db[_0x58b0('0x77')][_0x58b0('0xc7')]({'attributes':['id','name',_0x58b0('0x52')],'where':{'id':_0x410f07[_0x58b0('0x7c')]['ids']}});})[_0x58b0('0x2a')](function(_0x1c7d55){socket['emit'](_0x58b0('0xc9'),{'id':Number(_0x410f07[_0x58b0('0xbc')]['id']),'tags':_0x1c7d55||[]});return{'id':Number(_0x410f07[_0x58b0('0xbc')]['id']),'tags':_0x1c7d55||[]};});}})[_0x58b0('0x2a')](respondWithResult(_0x59a110,null))[_0x58b0('0x37')](handleError(_0x59a110,null));};exports[_0x58b0('0xca')]=function(_0x476721,_0x2382d8,_0xa1fcaf){return db['FaxInteraction'][_0x58b0('0x69')]({'where':{'id':_0x476721[_0x58b0('0xbc')]['id']}})[_0x58b0('0x2a')](handleEntityNotFound(_0x2382d8,null))['then'](function(_0x1a7157){if(_0x1a7157){return _0x1a7157[_0x58b0('0xca')](_0x476721[_0x58b0('0x44')][_0x58b0('0xc3')]);}})[_0x58b0('0x2a')](respondWithStatusCode(_0x2382d8,null))[_0x58b0('0x37')](handleError(_0x2382d8,null));};exports[_0x58b0('0xcb')]=function(_0x4cd1de,_0x4c5e2a){var _0x49e3e2=moment()[_0x58b0('0xcc')]()['toString']();var _0x5d3671=path['join'](config[_0x58b0('0xcd')],_0x58b0('0xce'),_0x58b0('0xcf'),_0x58b0('0xd0'));var _0x4177a8=path[_0x58b0('0xd1')](config[_0x58b0('0xcd')],_0x58b0('0xce'),'files',_0x58b0('0xd2'));var _0x205859=path[_0x58b0('0xd1')](_0x5d3671,_0x49e3e2);var _0x283cfd=util[_0x58b0('0xd3')](_0x58b0('0xd4'),_0x4cd1de[_0x58b0('0xbc')]['id'],_0x49e3e2);var _0x560bc9=path[_0x58b0('0xd1')](_0x5d3671,_0x283cfd);var _0x660812=[];_0x660812[_0x58b0('0x36')]({'model':db[_0x58b0('0xd5')],'as':_0x58b0('0xd5'),'raw':!![]});var _0x4d7152=[{'model':db[_0x58b0('0xc2')],'as':'Messages','attributes':['id',_0x58b0('0x7c'),_0x58b0('0x83')],'include':_0x660812}];return db[_0x58b0('0xa3')][_0x58b0('0x69')]({'where':{'id':_0x4cd1de['params']['id']},'include':_0x4d7152})[_0x58b0('0x2a')](handleEntityNotFound(_0x4c5e2a,null))[_0x58b0('0x2a')](function(_0x5e911b){if(_0x5e911b&&_0x5e911b[_0x58b0('0xd6')]){var _0x4da830=_0x5e911b[_0x58b0('0xd7')]({'plain':!![]});fs[_0x58b0('0xd8')](_0x205859);for(var _0xd4d157=0x0;_0xd4d157<_0x4da830['Messages'][_0x58b0('0x49')];_0xd4d157++){var _0x55abc1=_0x4da830[_0x58b0('0xd6')][_0xd4d157][_0x58b0('0xd5')];if(_0x55abc1){var _0xadcf8a=path['join'](_0x4177a8,_0x55abc1[_0x58b0('0xd9')]);if(fs[_0x58b0('0xda')](_0xadcf8a)){fs['createReadStream'](_0xadcf8a)[_0x58b0('0xdb')](fs[_0x58b0('0xdc')](path['join'](_0x205859,_0x55abc1[_0x58b0('0xd9')])));}}}return BPromise[_0x58b0('0x99')]()[_0x58b0('0x2a')](function(){return new BPromise(function(_0x1de550,_0x53ad0b){zipdir(_0x205859,{'saveTo':_0x560bc9},function(_0x19100e,_0x5f1c3e){if(_0x19100e)return _0x53ad0b(_0x19100e);return _0x1de550(_0x5f1c3e);});})[_0x58b0('0x2a')](function(){return new BPromise(function(_0xb1f6df,_0x45d1fa){rimraf(_0x205859,function(_0x29e1b8){if(_0x29e1b8)_0x45d1fa(_0x29e1b8);return _0xb1f6df();});});})['then'](function(){return _0x4c5e2a[_0x58b0('0xcb')](_0x560bc9,_0x283cfd,function(_0x378559){if(_0x378559){console['log'](_0x58b0('0xdd'),_0x378559);}else{fs[_0x58b0('0xde')](_0x560bc9);}});});});}else{return _0x4c5e2a[_0x58b0('0x1d')](0xc8);}})[_0x58b0('0x37')](handleError(_0x4c5e2a,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 82d3511..2232ca6 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 _0xcc3d=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','save','getUsers','then','setDataValue','unreadMessages','emit'];(function(_0x52b9c7,_0x3fb044){var _0x1c5662=function(_0x452a97){while(--_0x452a97){_0x52b9c7['push'](_0x52b9c7['shift']());}};_0x1c5662(++_0x3fb044);}(_0xcc3d,0x17e));var _0xdcc3=function(_0x35f6c9,_0x2af36b){_0x35f6c9=_0x35f6c9-0x0;var _0x23fe9b=_0xcc3d[_0x35f6c9];return _0x23fe9b;};'use strict';var EventEmitter=require(_0xdcc3('0x0'));var FaxInteraction=require(_0xdcc3('0x1'))['db'][_0xdcc3('0x2')];var FaxMessage=require(_0xdcc3('0x1'))['db'][_0xdcc3('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdcc3('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x207a28){return function(_0x29bded,_0x485db3,_0xbed6a0){_0x29bded[_0xdcc3('0x5')]({'attributes':['id'],'raw':!![]})[_0xdcc3('0x6')](function(_0x3f1c26){_0x29bded[_0xdcc3('0x7')]('Users',_0x3f1c26['map'](function(_0x56625f){return{'id':_0x56625f['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x29bded['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x286fa5){_0x29bded[_0xdcc3('0x7')](_0xdcc3('0x8'),_0x286fa5['length']);FaxInteractionEvents[_0xdcc3('0x9')](_0x207a28+':'+_0x29bded['id'],_0x29bded);FaxInteractionEvents['emit'](_0x207a28,_0x29bded);_0xbed6a0(null);})[_0xdcc3('0xa')](_0xbed6a0(null));};}for(var e in events){if(events[_0xdcc3('0xb')](e)){var event=events[e];FaxInteraction[_0xdcc3('0xc')](e,emitEvent(event));}}module[_0xdcc3('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0x037e=['remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0x037e,0x10b));var _0xe037=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x037e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe037('0x0'));var FaxInteraction=require(_0xe037('0x1'))['db'][_0xe037('0x2')];var FaxMessage=require(_0xe037('0x1'))['db'][_0xe037('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe037('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe037('0x5')};function emitEvent(_0x277198){return function(_0x35ddc4,_0x369327,_0x28e21d){_0x35ddc4[_0xe037('0x6')]({'attributes':['id'],'raw':!![]})[_0xe037('0x7')](function(_0x15bb59){_0x35ddc4[_0xe037('0x8')](_0xe037('0x9'),_0x15bb59[_0xe037('0xa')](function(_0x36e44e){return{'id':_0x36e44e['id']};}));return FaxMessage[_0xe037('0xb')]({'where':{'FaxInteractionId':_0x35ddc4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4286eb){_0x35ddc4[_0xe037('0x8')]('unreadMessages',_0x4286eb[_0xe037('0xc')]);FaxInteractionEvents[_0xe037('0xd')](_0x277198+':'+_0x35ddc4['id'],_0x35ddc4);FaxInteractionEvents[_0xe037('0xd')](_0x277198,_0x35ddc4);_0x28e21d(null);})['catch'](_0x28e21d(null));};}for(var e in events){if(events[_0xe037('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xe037('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 920c765..eef58d1 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 _0x1e4e=['util','api','moment','bluebird','path','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1e4e,0xaf));var _0xe1e4=function(_0x540831,_0x478099){_0x540831=_0x540831-0x0;var _0xef3b94=_0x1e4e[_0x540831];return _0xef3b94;};'use strict';var _=require(_0xe1e4('0x0'));var util=require(_0xe1e4('0x1'));var logger=require('../../config/logger')(_0xe1e4('0x2'));var moment=require(_0xe1e4('0x3'));var BPromise=require(_0xe1e4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1e4('0x5'));var rimraf=require('rimraf');var config=require(_0xe1e4('0x6'));var attributes=require(_0xe1e4('0x7'));module[_0xe1e4('0x8')]=function(_0x131582,_0x542189){return _0x131582[_0xe1e4('0x9')]('FaxInteraction',attributes,{'tableName':_0xe1e4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47bc2f,_0x428b49,_0x390c8c){if(_0x47bc2f[_0xe1e4('0xb')](_0xe1e4('0xc'))){_0x47bc2f[_0xe1e4('0xd')]=moment()[_0xe1e4('0xe')](_0xe1e4('0xf'));}_0x390c8c(null,_0x47bc2f);}}});}; \ No newline at end of file +var _0xc6e9=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions'];(function(_0x5c3b99,_0x8257d7){var _0x1b03c4=function(_0x1a1056){while(--_0x1a1056){_0x5c3b99['push'](_0x5c3b99['shift']());}};_0x1b03c4(++_0x8257d7);}(_0xc6e9,0x1ad));var _0x9c6e=function(_0xc7ce9a,_0x13883d){_0xc7ce9a=_0xc7ce9a-0x0;var _0x380863=_0xc6e9[_0xc7ce9a];return _0x380863;};'use strict';var _=require('lodash');var util=require(_0x9c6e('0x0'));var logger=require('../../config/logger')(_0x9c6e('0x1'));var moment=require(_0x9c6e('0x2'));var BPromise=require(_0x9c6e('0x3'));var rp=require(_0x9c6e('0x4'));var fs=require('fs');var path=require(_0x9c6e('0x5'));var rimraf=require(_0x9c6e('0x6'));var config=require(_0x9c6e('0x7'));var attributes=require(_0x9c6e('0x8'));module[_0x9c6e('0x9')]=function(_0x29fae9,_0x36e664){return _0x29fae9[_0x9c6e('0xa')](_0x9c6e('0xb'),attributes,{'tableName':_0x9c6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe7cf4,_0x2dafd4,_0x4b1d08){if(_0xe7cf4[_0x9c6e('0xd')](_0x9c6e('0xe'))){_0xe7cf4[_0x9c6e('0xf')]=moment()['format'](_0x9c6e('0x10'));}_0x4b1d08(null,_0xe7cf4);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index ea2d996..ab76830 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 _0x3c78=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where','find','addTags','ids','spread','AddTags','util'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3c78,0x1e0));var _0x83c7=function(_0x23e4cf,_0x12704d){_0x23e4cf=_0x23e4cf-0x0;var _0x2bd35a=_0x3c78[_0x23e4cf];return _0x2bd35a;};'use strict';var _=require('lodash');var util=require(_0x83c7('0x0'));var moment=require(_0x83c7('0x1'));var BPromise=require(_0x83c7('0x2'));var rs=require(_0x83c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x83c7('0x4'))['db'];var utils=require(_0x83c7('0x5'));var logger=require(_0x83c7('0x6'))(_0x83c7('0x7'));var config=require('../../config/environment');var jayson=require(_0x83c7('0x8'));var client=jayson[_0x83c7('0x9')]['http']({'port':0x232a});config[_0x83c7('0xa')]=_[_0x83c7('0xb')](config['redis'],{'host':_0x83c7('0xc'),'port':0x18eb});var socket=require(_0x83c7('0xd'))(new Redis(config[_0x83c7('0xa')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x35182e,_0x938bde,_0x5c8b91){return new BPromise(function(_0x48cc04,_0x1ea4f4){return client['request'](_0x35182e,_0x5c8b91)[_0x83c7('0xe')](function(_0x54f977){logger[_0x83c7('0xf')](_0x83c7('0x10'),_0x938bde,_0x83c7('0x11'));logger[_0x83c7('0x12')](_0x83c7('0x13'),_0x938bde,'request\x20sent',JSON[_0x83c7('0x14')](_0x54f977));if(_0x54f977[_0x83c7('0x15')]){if(_0x54f977[_0x83c7('0x15')][_0x83c7('0x16')]===0x1f4){logger[_0x83c7('0x15')](_0x83c7('0x10'),_0x938bde,_0x54f977['error'][_0x83c7('0x17')]);return _0x1ea4f4(_0x54f977[_0x83c7('0x15')]['message']);}logger[_0x83c7('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x938bde,_0x54f977[_0x83c7('0x15')][_0x83c7('0x17')]);return _0x48cc04(_0x54f977[_0x83c7('0x15')][_0x83c7('0x17')]);}else{logger[_0x83c7('0xf')](_0x83c7('0x10'),_0x938bde,_0x83c7('0x11'));_0x48cc04(_0x54f977[_0x83c7('0x18')][_0x83c7('0x17')]);}})[_0x83c7('0x19')](function(_0x4f93cd){logger[_0x83c7('0x15')](_0x83c7('0x10'),_0x938bde,_0x4f93cd);_0x1ea4f4(_0x4f93cd);});});}exports[_0x83c7('0x1a')]=function(_0x4c1ff7){var _0x53a2dc=this;return new Promise(function(_0x1d4871,_0x5e69c8){return db[_0x83c7('0x1b')][_0x83c7('0x1c')](_0x4c1ff7[_0x83c7('0x1d')],{'raw':_0x4c1ff7[_0x83c7('0x1e')]?_0x4c1ff7[_0x83c7('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c1ff7[_0x83c7('0x1e')]?_0x4c1ff7[_0x83c7('0x1e')][_0x83c7('0x1f')]||null:null,'attributes':_0x4c1ff7[_0x83c7('0x1e')]?_0x4c1ff7[_0x83c7('0x1e')]['attributes']||null:null,'limit':_0x4c1ff7[_0x83c7('0x1e')]?_0x4c1ff7['options']['limit']||null:null})[_0x83c7('0xe')](function(_0x41ee9e){logger[_0x83c7('0xf')]('UpdateFaxInteraction',_0x4c1ff7);logger[_0x83c7('0x12')]('UpdateFaxInteraction',_0x4c1ff7,JSON[_0x83c7('0x14')](_0x41ee9e));_0x1d4871(_0x41ee9e);})[_0x83c7('0x19')](function(_0x2af7f3){logger[_0x83c7('0x15')](_0x83c7('0x1a'),_0x2af7f3[_0x83c7('0x17')],_0x4c1ff7);_0x5e69c8(_0x53a2dc[_0x83c7('0x15')](0x1f4,_0x2af7f3[_0x83c7('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0x543e83){return new Promise(function(_0x162f40,_0x2a39f4){return db['FaxInteraction'][_0x83c7('0x20')]({'where':_0x543e83['options']?_0x543e83[_0x83c7('0x1e')][_0x83c7('0x1f')]||null:null})[_0x83c7('0xe')](function(_0xe40f24){if(_0xe40f24){return _0xe40f24[_0x83c7('0x21')](_0x543e83[_0x83c7('0x1d')][_0x83c7('0x22')],_['omit'](_0x543e83[_0x83c7('0x1d')],[_0x83c7('0x22'),'id'])||{});}})[_0x83c7('0x23')](function(_0x5d8eba){logger['info']('AddTags',_0x543e83);logger[_0x83c7('0x12')](_0x83c7('0x24'),_0x543e83,JSON[_0x83c7('0x14')](_0x5d8eba));_0x162f40(_0x5d8eba);})['catch'](function(_0x1e3a9a){logger[_0x83c7('0x15')](_0x83c7('0x24'),_0x1e3a9a[_0x83c7('0x17')],_0x543e83);_0x2a39f4(_this['error'](0x1f4,_0x1e3a9a[_0x83c7('0x17')]));});});}; \ No newline at end of file +var _0x165b=['then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','debug','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','register','request'];(function(_0x158da7,_0x2f65ca){var _0x49a9d2=function(_0x32d478){while(--_0x32d478){_0x158da7['push'](_0x158da7['shift']());}};_0x49a9d2(++_0x2f65ca);}(_0x165b,0x159));var _0xb165=function(_0x253354,_0x7f8299){_0x253354=_0x253354-0x0;var _0x10b6c1=_0x165b[_0x253354];return _0x10b6c1;};'use strict';var _=require(_0xb165('0x0'));var util=require(_0xb165('0x1'));var moment=require('moment');var BPromise=require(_0xb165('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb165('0x3'));var db=require(_0xb165('0x4'))['db'];var utils=require(_0xb165('0x5'));var logger=require(_0xb165('0x6'))(_0xb165('0x7'));var config=require(_0xb165('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb165('0x9')]['http']({'port':0x232a});config[_0xb165('0xa')]=_[_0xb165('0xb')](config[_0xb165('0xa')],{'host':_0xb165('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb165('0xa')]));require('./faxInteraction.socket')[_0xb165('0xd')](socket);function respondWithRpcPromise(_0x302a94,_0x292e8b,_0x14b1fd){return new BPromise(function(_0x477b47,_0x5b3557){return client[_0xb165('0xe')](_0x302a94,_0x14b1fd)[_0xb165('0xf')](function(_0x99fcc4){logger[_0xb165('0x10')](_0xb165('0x11'),_0x292e8b,_0xb165('0x12'));logger['debug'](_0xb165('0x13'),_0x292e8b,_0xb165('0x12'),JSON[_0xb165('0x14')](_0x99fcc4));if(_0x99fcc4[_0xb165('0x15')]){if(_0x99fcc4[_0xb165('0x15')][_0xb165('0x16')]===0x1f4){logger[_0xb165('0x15')](_0xb165('0x11'),_0x292e8b,_0x99fcc4[_0xb165('0x15')][_0xb165('0x17')]);return _0x5b3557(_0x99fcc4[_0xb165('0x15')][_0xb165('0x17')]);}logger['error'](_0xb165('0x11'),_0x292e8b,_0x99fcc4[_0xb165('0x15')][_0xb165('0x17')]);return _0x477b47(_0x99fcc4[_0xb165('0x15')][_0xb165('0x17')]);}else{logger[_0xb165('0x10')](_0xb165('0x11'),_0x292e8b,_0xb165('0x12'));_0x477b47(_0x99fcc4[_0xb165('0x18')][_0xb165('0x17')]);}})[_0xb165('0x19')](function(_0x52caeb){logger[_0xb165('0x15')](_0xb165('0x11'),_0x292e8b,_0x52caeb);_0x5b3557(_0x52caeb);});});}exports[_0xb165('0x1a')]=function(_0x2f173c){var _0xb33307=this;return new Promise(function(_0x298353,_0x494187){return db[_0xb165('0x1b')]['update'](_0x2f173c[_0xb165('0x1c')],{'raw':_0x2f173c[_0xb165('0x1d')]?_0x2f173c[_0xb165('0x1d')][_0xb165('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f173c[_0xb165('0x1d')]?_0x2f173c[_0xb165('0x1d')][_0xb165('0x1f')]||null:null,'attributes':_0x2f173c[_0xb165('0x1d')]?_0x2f173c['options'][_0xb165('0x20')]||null:null,'limit':_0x2f173c[_0xb165('0x1d')]?_0x2f173c[_0xb165('0x1d')]['limit']||null:null})[_0xb165('0xf')](function(_0x39454b){logger['info'](_0xb165('0x1a'),_0x2f173c);logger[_0xb165('0x21')](_0xb165('0x1a'),_0x2f173c,JSON[_0xb165('0x14')](_0x39454b));_0x298353(_0x39454b);})['catch'](function(_0x2e141b){logger[_0xb165('0x15')](_0xb165('0x1a'),_0x2e141b[_0xb165('0x17')],_0x2f173c);_0x494187(_0xb33307['error'](0x1f4,_0x2e141b[_0xb165('0x17')]));});});};exports[_0xb165('0x22')]=function(_0x1e9e5e){return new Promise(function(_0xf8e9f6,_0x2e1a0e){return db['FaxInteraction']['find']({'where':_0x1e9e5e['options']?_0x1e9e5e[_0xb165('0x1d')][_0xb165('0x1f')]||null:null})[_0xb165('0xf')](function(_0x1532ad){if(_0x1532ad){return _0x1532ad[_0xb165('0x23')](_0x1e9e5e['body'][_0xb165('0x24')],_[_0xb165('0x25')](_0x1e9e5e['body'],[_0xb165('0x24'),'id'])||{});}})[_0xb165('0x26')](function(_0x5b9ccb){logger[_0xb165('0x10')](_0xb165('0x27'),_0x1e9e5e);logger[_0xb165('0x21')](_0xb165('0x27'),_0x1e9e5e,JSON[_0xb165('0x14')](_0x5b9ccb));_0xf8e9f6(_0x5b9ccb);})[_0xb165('0x19')](function(_0x54aae0){logger[_0xb165('0x15')](_0xb165('0x27'),_0x54aae0[_0xb165('0x17')],_0x1e9e5e);_0x2e1a0e(_this[_0xb165('0x15')](0x1f4,_0x54aae0[_0xb165('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 0d62a92..aa3b4c3 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 _0xce1f=['save','remove','removeListener','register','length','faxInteraction:','./faxInteraction.events'];(function(_0x580da9,_0x1f6021){var _0x26cc2e=function(_0x2175a3){while(--_0x2175a3){_0x580da9['push'](_0x580da9['shift']());}};_0x26cc2e(++_0x1f6021);}(_0xce1f,0xae));var _0xfce1=function(_0x270328,_0x13e970){_0x270328=_0x270328-0x0;var _0x2a0f0f=_0xce1f[_0x270328];return _0x2a0f0f;};'use strict';var FaxInteractionEvents=require(_0xfce1('0x0'));var events=[_0xfce1('0x1'),_0xfce1('0x2'),'update'];function createListener(_0x56bfe4,_0x3172a6){return function(_0x5df3f2){_0x3172a6['emit'](_0x56bfe4,_0x5df3f2);};}function removeListener(_0x18365c,_0x720440){return function(){FaxInteractionEvents[_0xfce1('0x3')](_0x18365c,_0x720440);};}exports[_0xfce1('0x4')]=function(_0x2d4b23){for(var _0x382cd2=0x0,_0x214ae6=events[_0xfce1('0x5')];_0x382cd2<_0x214ae6;_0x382cd2++){var _0x394827=events[_0x382cd2];var _0x19c6ad=createListener(_0xfce1('0x6')+_0x394827,_0x2d4b23);FaxInteractionEvents['on'](_0x394827,_0x19c6ad);}}; \ No newline at end of file +var _0x4484=['emit','register','length','remove','update'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x4484,0xc6));var _0x4448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4484[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x4448('0x0'),_0x4448('0x1')];function createListener(_0x739c68,_0x522cbb){return function(_0x1ad0db){_0x522cbb[_0x4448('0x2')](_0x739c68,_0x1ad0db);};}function removeListener(_0x5f439d,_0x4cdce8){return function(){FaxInteractionEvents['removeListener'](_0x5f439d,_0x4cdce8);};}exports[_0x4448('0x3')]=function(_0x45aadc){for(var _0x26348c=0x0,_0x3d83ae=events[_0x4448('0x4')];_0x26348c<_0x3d83ae;_0x26348c++){var _0x22927b=events[_0x26348c];var _0x5b8399=createListener('faxInteraction:'+_0x22927b,_0x45aadc);FaxInteractionEvents['on'](_0x22927b,_0x5b8399);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index a09d22e..bcd896c 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 _0xddf9=['/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','fax','addTags','put','faxinteraction:update','update','faxinteraction:destroy','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xddf9,0x1c4));var _0x9ddf=function(_0x525cde,_0xa049d7){_0x525cde=_0x525cde-0x0;var _0x4c25f1=_0xddf9[_0x525cde];return _0x4c25f1;};'use strict';var multer=require(_0x9ddf('0x0'));var util=require('util');var path=require(_0x9ddf('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9ddf('0x2')]();var fs_extra=require(_0x9ddf('0x3'));var auth=require(_0x9ddf('0x4'));var interaction=require(_0x9ddf('0x5'));var config=require(_0x9ddf('0x6'));var controller=require(_0x9ddf('0x7'));router[_0x9ddf('0x8')]('/',auth[_0x9ddf('0x9')](),controller['index']);router[_0x9ddf('0x8')](_0x9ddf('0xa'),auth[_0x9ddf('0x9')](),controller['describe']);router[_0x9ddf('0x8')](_0x9ddf('0xb'),auth[_0x9ddf('0x9')](),controller['show']);router[_0x9ddf('0x8')](_0x9ddf('0xc'),auth[_0x9ddf('0x9')](),controller[_0x9ddf('0xd')]);router[_0x9ddf('0x8')](_0x9ddf('0xe'),auth['isAuthenticated'](),controller[_0x9ddf('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9ddf('0x10')]);router[_0x9ddf('0x11')]('/:id/messages',auth[_0x9ddf('0x9')](),controller[_0x9ddf('0x12')]);router[_0x9ddf('0x11')](_0x9ddf('0x13'),auth[_0x9ddf('0x9')](),interaction[_0x9ddf('0x14')](_0x9ddf('0x15'),'faxinteraction:addtags'),controller[_0x9ddf('0x16')]);router[_0x9ddf('0x17')](_0x9ddf('0xb'),auth[_0x9ddf('0x9')](),interaction[_0x9ddf('0x14')](_0x9ddf('0x15'),_0x9ddf('0x18')),controller[_0x9ddf('0x19')]);router['delete'](_0x9ddf('0xb'),auth[_0x9ddf('0x9')](),interaction['tracked'](_0x9ddf('0x15'),_0x9ddf('0x1a')),controller[_0x9ddf('0x1b')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x9ddf('0x1c')]=router; \ No newline at end of file +var _0x2ab6=['removeTags','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','faxinteraction:update','delete','faxinteraction:destroy','destroy'];(function(_0x2123e0,_0x4c4db6){var _0x3c07b4=function(_0x1fae9a){while(--_0x1fae9a){_0x2123e0['push'](_0x2123e0['shift']());}};_0x3c07b4(++_0x4c4db6);}(_0x2ab6,0xa7));var _0x62ab=function(_0x19a826,_0x36a89e){_0x19a826=_0x19a826-0x0;var _0x5c902b=_0x2ab6[_0x19a826];return _0x5c902b;};'use strict';var multer=require(_0x62ab('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x62ab('0x1'));var express=require(_0x62ab('0x2'));var router=express[_0x62ab('0x3')]();var fs_extra=require(_0x62ab('0x4'));var auth=require(_0x62ab('0x5'));var interaction=require(_0x62ab('0x6'));var config=require(_0x62ab('0x7'));var controller=require(_0x62ab('0x8'));router['get']('/',auth[_0x62ab('0x9')](),controller['index']);router[_0x62ab('0xa')](_0x62ab('0xb'),auth[_0x62ab('0x9')](),controller[_0x62ab('0xc')]);router[_0x62ab('0xa')](_0x62ab('0xd'),auth['isAuthenticated'](),controller[_0x62ab('0xe')]);router[_0x62ab('0xa')](_0x62ab('0xf'),auth[_0x62ab('0x9')](),controller[_0x62ab('0x10')]);router[_0x62ab('0xa')](_0x62ab('0x11'),auth[_0x62ab('0x9')](),controller['download']);router[_0x62ab('0x12')]('/',auth['isAuthenticated'](),controller[_0x62ab('0x13')]);router[_0x62ab('0x12')]('/:id/messages',auth[_0x62ab('0x9')](),controller[_0x62ab('0x14')]);router[_0x62ab('0x12')](_0x62ab('0x15'),auth['isAuthenticated'](),interaction['tracked'](_0x62ab('0x16'),_0x62ab('0x17')),controller[_0x62ab('0x18')]);router[_0x62ab('0x19')](_0x62ab('0xd'),auth['isAuthenticated'](),interaction[_0x62ab('0x1a')](_0x62ab('0x16'),_0x62ab('0x1b')),controller['update']);router[_0x62ab('0x1c')](_0x62ab('0xd'),auth[_0x62ab('0x9')](),interaction[_0x62ab('0x1a')](_0x62ab('0x16'),_0x62ab('0x1d')),controller[_0x62ab('0x1e')]);router['delete'](_0x62ab('0x15'),auth['isAuthenticated'](),controller[_0x62ab('0x1f')]);module[_0x62ab('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 45a1362..24b6285 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 _0xa41a=['out','TEXT','DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x38e55f,_0x3938dc){var _0x53d9bd=function(_0x52df17){while(--_0x52df17){_0x38e55f['push'](_0x38e55f['shift']());}};_0x53d9bd(++_0x3938dc);}(_0xa41a,0x6b));var _0xaa41=function(_0x2758f5,_0x4c5e92){_0x2758f5=_0x2758f5-0x0;var _0x4c479f=_0xa41a[_0x2758f5];return _0x4c479f;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'body':{'type':Sequelize['TEXT'](_0xaa41('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaa41('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xaa41('0x4')]('in',_0xaa41('0x5')),'defaultValue':_0xaa41('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xaa41('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0xaa41('0x7')]}}; \ No newline at end of file +var _0xfa2f=['out','DATE','TEXT','BOOLEAN','ENUM'];(function(_0x1f66bb,_0x1c3cd4){var _0x16819b=function(_0x57589e){while(--_0x57589e){_0x1f66bb['push'](_0x1f66bb['shift']());}};_0x16819b(++_0x1c3cd4);}(_0xfa2f,0xe8));var _0xffa2=function(_0x1a152e,_0x18e723){_0x1a152e=_0x1a152e-0x0;var _0xf52ca1=_0xfa2f[_0x1a152e];return _0xf52ca1;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xffa2('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xffa2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xffa2('0x2')]('in',_0xffa2('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xffa2('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0xffa2('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 77b36ee..43f7529 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 _0xb563=['../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxMessage.socket','jayson/promise','client','http','request','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','send','map','FaxMessage','rawAttributes','fieldName','key','name','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','length','options','find','body','params','describe','fax-interactions','accept','fax','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SIP/%s','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','server','attachments','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb563,0x10c));var _0x3b56=function(_0xd7a731,_0x44bf71){_0xd7a731=_0xd7a731-0x0;var _0x4e6758=_0xb563[_0xd7a731];return _0x4e6758;};'use strict';var emlformat=require(_0x3b56('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b56('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b56('0x2'));var moment=require(_0x3b56('0x3'));var BPromise=require(_0x3b56('0x4'));var Mustache=require(_0x3b56('0x5'));var util=require(_0x3b56('0x6'));var path=require(_0x3b56('0x7'));var sox=require('sox');var csv=require(_0x3b56('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b56('0x9'));var _=require(_0x3b56('0xa'));var squel=require(_0x3b56('0xb'));var crypto=require(_0x3b56('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3b56('0xd'));var toCsv=require(_0x3b56('0x8'));var querystring=require(_0x3b56('0xe'));var Papa=require(_0x3b56('0xf'));var Redis=require(_0x3b56('0x10'));var authService=require(_0x3b56('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3b56('0x12'));var hardwareService=require(_0x3b56('0x13'));var logger=require(_0x3b56('0x14'))(_0x3b56('0x15'));var utils=require(_0x3b56('0x16'));var config=require(_0x3b56('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b56('0x18'))['db'];config[_0x3b56('0x19')]=_[_0x3b56('0x1a')](config[_0x3b56('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3b56('0x19')]));require(_0x3b56('0x1b'))['register'](socket);var jayson=require(_0x3b56('0x1c'));var client=jayson[_0x3b56('0x1d')][_0x3b56('0x1e')]({'port':0x232c});var client9002=jayson[_0x3b56('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x153577,_0xf26784,_0x8e6978,_0x554565){return new BPromise(function(_0x3451f2,_0x28fe84){var _0x21385f=_0x554565||client;return _0x21385f[_0x3b56('0x1f')](_0x153577,_0x8e6978)[_0x3b56('0x20')](function(_0x2510c4){logger[_0x3b56('0x21')]('FaxMessage,\x20%s,\x20%s',_0xf26784,'request\x20sent');logger[_0x3b56('0x22')](_0x3b56('0x23'),_0xf26784,_0x3b56('0x24'),JSON[_0x3b56('0x25')](_0x2510c4));if(_0x2510c4[_0x3b56('0x26')]){if(_0x2510c4[_0x3b56('0x26')][_0x3b56('0x27')]===0x1f4){logger['error'](_0x3b56('0x28'),_0xf26784,_0x2510c4[_0x3b56('0x26')][_0x3b56('0x29')]);return _0x28fe84(_0x2510c4['error'][_0x3b56('0x29')]);}logger[_0x3b56('0x26')]('FaxMessage,\x20%s,\x20%s',_0xf26784,_0x2510c4[_0x3b56('0x26')]['message']);return _0x3451f2(_0x2510c4[_0x3b56('0x26')][_0x3b56('0x29')]);}else{logger[_0x3b56('0x21')](_0x3b56('0x28'),_0xf26784,_0x3b56('0x24'));_0x3451f2(_0x2510c4[_0x3b56('0x2a')][_0x3b56('0x29')]);}})[_0x3b56('0x2b')](function(_0x1cfa87){logger[_0x3b56('0x26')](_0x3b56('0x28'),_0xf26784,_0x1cfa87);_0x28fe84(_0x1cfa87);});});}function respondWithStatusCode(_0x1b70cb,_0x2836bc){_0x2836bc=_0x2836bc||0xcc;return function(_0x2b2234){if(_0x2b2234){return _0x1b70cb[_0x3b56('0x2c')](_0x2836bc);}return _0x1b70cb[_0x3b56('0x2d')](_0x2836bc)[_0x3b56('0x2e')]();};}function respondWithResult(_0x2fa64a,_0x224517){_0x224517=_0x224517||0xc8;return function(_0x35300a){if(_0x35300a){return _0x2fa64a[_0x3b56('0x2d')](_0x224517)[_0x3b56('0x2f')](_0x35300a);}};}function respondWithFilteredResult(_0x563f25,_0x2e07d0){return function(_0x3a0ee6){if(_0x3a0ee6){var _0x2d551b=typeof _0x2e07d0[_0x3b56('0x30')]===_0x3b56('0x31')&&typeof _0x2e07d0[_0x3b56('0x32')]===_0x3b56('0x31');var _0x3744b8=_0x3a0ee6['count'];var _0x1f52f4=_0x2d551b?0x0:_0x2e07d0['offset'];var _0xd17ef3=_0x2d551b?_0x3a0ee6[_0x3b56('0x33')]:_0x2e07d0[_0x3b56('0x30')]+_0x2e07d0['limit'];var _0x3e8249;if(_0xd17ef3>=_0x3744b8){_0xd17ef3=_0x3744b8;_0x3e8249=0xc8;}else{_0x3e8249=0xce;}_0x563f25[_0x3b56('0x2d')](_0x3e8249);return _0x563f25[_0x3b56('0x34')](_0x3b56('0x35'),_0x1f52f4+'-'+_0xd17ef3+'/'+_0x3744b8)['json'](_0x3a0ee6);}return null;};}function patchUpdates(_0x4ce821){return function(_0x477444){try{jsonpatch[_0x3b56('0x36')](_0x477444,_0x4ce821,!![]);}catch(_0x5ebb8b){return BPromise[_0x3b56('0x37')](_0x5ebb8b);}return _0x477444[_0x3b56('0x38')]();};}function saveUpdates(_0x250173,_0x538bb1){return function(_0x417c7a){if(_0x417c7a){return _0x417c7a[_0x3b56('0x39')](_0x250173)[_0x3b56('0x20')](function(_0x51c8d1){return _0x51c8d1;});}return null;};}function removeEntity(_0x114acd,_0x54dd4d){return function(_0xb6e7af){if(_0xb6e7af){return _0xb6e7af[_0x3b56('0x3a')]()[_0x3b56('0x20')](function(){_0x114acd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb166eb,_0x19160d){return function(_0x56882f){if(!_0x56882f){_0xb166eb[_0x3b56('0x2c')](0x194);}return _0x56882f;};}function handleError(_0x477e6f,_0x11025c){_0x11025c=_0x11025c||0x1f4;return function(_0xa9d369){logger[_0x3b56('0x26')](_0xa9d369[_0x3b56('0x3b')]);if(_0xa9d369['name']){delete _0xa9d369['name'];}_0x477e6f[_0x3b56('0x2d')](_0x11025c)[_0x3b56('0x3c')](_0xa9d369);};}exports['index']=function(_0x5bbd70,_0x43c8fa){var _0x2b87fa={},_0x4bccbd={},_0x2f19b3={'count':0x0,'rows':[]};var _0x3b6c2f=_[_0x3b56('0x3d')](db[_0x3b56('0x3e')][_0x3b56('0x3f')],function(_0x3db0ec){return{'name':_0x3db0ec[_0x3b56('0x40')],'type':_0x3db0ec['type'][_0x3b56('0x41')]};});_0x4bccbd['model']=_[_0x3b56('0x3d')](_0x3b6c2f,_0x3b56('0x42'));_0x4bccbd[_0x3b56('0x43')]=_[_0x3b56('0x44')](_0x5bbd70[_0x3b56('0x43')]);_0x4bccbd['filters']=_[_0x3b56('0x45')](_0x4bccbd[_0x3b56('0x46')],_0x4bccbd['query']);_0x2b87fa[_0x3b56('0x47')]=_['intersection'](_0x4bccbd['model'],qs[_0x3b56('0x48')](_0x5bbd70[_0x3b56('0x43')][_0x3b56('0x48')]));_0x2b87fa['attributes']=_0x2b87fa[_0x3b56('0x47')]['length']?_0x2b87fa[_0x3b56('0x47')]:_0x4bccbd[_0x3b56('0x46')];if(!_0x5bbd70[_0x3b56('0x43')]['hasOwnProperty'](_0x3b56('0x49'))){_0x2b87fa[_0x3b56('0x32')]=qs[_0x3b56('0x32')](_0x5bbd70[_0x3b56('0x43')][_0x3b56('0x32')]);_0x2b87fa[_0x3b56('0x30')]=qs[_0x3b56('0x30')](_0x5bbd70[_0x3b56('0x43')][_0x3b56('0x30')]);}_0x2b87fa[_0x3b56('0x4a')]=qs[_0x3b56('0x4b')](_0x5bbd70[_0x3b56('0x43')][_0x3b56('0x4b')]);_0x2b87fa[_0x3b56('0x4c')]=qs[_0x3b56('0x4d')](_[_0x3b56('0x4e')](_0x5bbd70[_0x3b56('0x43')],_0x4bccbd[_0x3b56('0x4d')]),_0x3b6c2f);if(_0x5bbd70['query'][_0x3b56('0x4f')]){_0x2b87fa[_0x3b56('0x4c')]=_['merge'](_0x2b87fa[_0x3b56('0x4c')],{'$or':_['map'](_0x3b6c2f,function(_0x33cc97){if(_0x33cc97['type']!==_0x3b56('0x50')){var _0xc04bd9={};_0xc04bd9[_0x33cc97[_0x3b56('0x42')]]={'$like':'%'+_0x5bbd70['query'][_0x3b56('0x4f')]+'%'};return _0xc04bd9;}})});}_0x2b87fa=_[_0x3b56('0x51')]({},_0x2b87fa,_0x5bbd70['options']);var _0x536661={'where':_0x2b87fa['where']};return db[_0x3b56('0x3e')]['count'](_0x536661)[_0x3b56('0x20')](function(_0x3a0317){_0x2f19b3[_0x3b56('0x33')]=_0x3a0317;if(_0x5bbd70[_0x3b56('0x43')][_0x3b56('0x52')]){_0x2b87fa[_0x3b56('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0x3b56('0x54')](_0x2b87fa);})[_0x3b56('0x20')](function(_0x28e3eb){_0x2f19b3[_0x3b56('0x55')]=_0x28e3eb;return _0x2f19b3;})[_0x3b56('0x20')](respondWithFilteredResult(_0x43c8fa,_0x2b87fa))[_0x3b56('0x2b')](handleError(_0x43c8fa,null));};exports[_0x3b56('0x56')]=function(_0x1561d7,_0x492fee){var _0x5f0fa7={'raw':!![],'where':{'id':_0x1561d7['params']['id']}},_0x5cb583={};_0x5cb583[_0x3b56('0x46')]=_['keys'](db[_0x3b56('0x3e')][_0x3b56('0x3f')]);_0x5cb583['query']=_['keys'](_0x1561d7['query']);_0x5cb583['filters']=_[_0x3b56('0x45')](_0x5cb583[_0x3b56('0x46')],_0x5cb583[_0x3b56('0x43')]);_0x5f0fa7[_0x3b56('0x47')]=_['intersection'](_0x5cb583[_0x3b56('0x46')],qs[_0x3b56('0x48')](_0x1561d7['query'][_0x3b56('0x48')]));_0x5f0fa7[_0x3b56('0x47')]=_0x5f0fa7[_0x3b56('0x47')][_0x3b56('0x57')]?_0x5f0fa7[_0x3b56('0x47')]:_0x5cb583[_0x3b56('0x46')];if(_0x1561d7[_0x3b56('0x43')][_0x3b56('0x52')]){_0x5f0fa7[_0x3b56('0x53')]=[{'all':!![]}];}_0x5f0fa7=_[_0x3b56('0x51')]({},_0x5f0fa7,_0x1561d7[_0x3b56('0x58')]);return db[_0x3b56('0x3e')][_0x3b56('0x59')](_0x5f0fa7)[_0x3b56('0x20')](handleEntityNotFound(_0x492fee,null))[_0x3b56('0x20')](respondWithResult(_0x492fee,null))[_0x3b56('0x2b')](handleError(_0x492fee,null));};exports['update']=function(_0x26862a,_0x32e827){if(_0x26862a[_0x3b56('0x5a')]['id']){delete _0x26862a['body']['id'];}return db[_0x3b56('0x3e')][_0x3b56('0x59')]({'where':{'id':_0x26862a[_0x3b56('0x5b')]['id']}})[_0x3b56('0x20')](handleEntityNotFound(_0x32e827,null))[_0x3b56('0x20')](saveUpdates(_0x26862a[_0x3b56('0x5a')],null))[_0x3b56('0x20')](respondWithResult(_0x32e827,null))['catch'](handleError(_0x32e827,null));};exports[_0x3b56('0x3a')]=function(_0x17aae0,_0x483a5a){return db[_0x3b56('0x3e')][_0x3b56('0x59')]({'where':{'id':_0x17aae0[_0x3b56('0x5b')]['id']}})['then'](handleEntityNotFound(_0x483a5a,null))[_0x3b56('0x20')](removeEntity(_0x483a5a,null))[_0x3b56('0x2b')](handleError(_0x483a5a,null));};exports[_0x3b56('0x5c')]=function(_0xb0e79,_0x332c07){return db[_0x3b56('0x3e')][_0x3b56('0x5c')]()[_0x3b56('0x20')](respondWithResult(_0x332c07,null))['catch'](handleError(_0x332c07,null));};var interaction_log=require(_0x3b56('0x14'))(_0x3b56('0x5d'));exports[_0x3b56('0x5e')]=function(_0x235b4b,_0x5ab2d4,_0x35f3ab){var _0x4eef1a={'agent':{},'channel':_0x3b56('0x5f')};if(_0x235b4b['body']['id']){delete _0x235b4b[_0x3b56('0x5a')]['id'];}_0x235b4b['body'][_0x3b56('0x60')]=!![];_0x235b4b['body']['readAt']=moment()['format'](_0x3b56('0x61'));_0x235b4b[_0x3b56('0x5a')][_0x3b56('0x62')]=_0x235b4b[_0x3b56('0x5a')]['UserId']||_0x235b4b[_0x3b56('0x63')]['id'];_0x4eef1a[_0x3b56('0x64')]['id']=_0x235b4b[_0x3b56('0x5a')]['UserId'];return db[_0x3b56('0x3e')]['find']({'where':{'id':_0x235b4b[_0x3b56('0x5b')]['id'],'UserId':null}})[_0x3b56('0x20')](handleEntityNotFound(_0x5ab2d4,null))['then'](saveUpdates(_0x235b4b[_0x3b56('0x5a')],null))['then'](function(_0xe18918){if(_0xe18918){_0x4eef1a['message']=_0xe18918['get']({'plain':!![]});return db[_0x3b56('0x65')][_0x3b56('0x59')]({'where':{'id':_0xe18918[_0x3b56('0x66')]}});}return null;})[_0x3b56('0x20')](handleEntityNotFound(_0x5ab2d4,null))['then'](function(_0x9a5163){if(_0x9a5163){return _0x9a5163[_0x3b56('0x39')]({'UserId':_0x235b4b[_0x3b56('0x5a')][_0x3b56('0x62')],'read1stAt':_[_0x3b56('0x67')](_0x9a5163[_0x3b56('0x68')])?moment()[_0x3b56('0x69')](_0x3b56('0x61')):undefined});}return null;})[_0x3b56('0x20')](function(_0x44d62f){if(_0x44d62f){_0x4eef1a['interaction']=_0x44d62f[_0x3b56('0x6a')]({'plain':!![]});interaction_log['info'](_0x3b56('0x6b'),_0x235b4b['user']['id'],_0x235b4b[_0x3b56('0x63')][_0x3b56('0x42')],_0x235b4b['user'][_0x3b56('0x6c')],_0x4eef1a[_0x3b56('0x6d')]['id'],_0x235b4b[_0x3b56('0x5a')]?JSON[_0x3b56('0x25')](_0x235b4b[_0x3b56('0x5a')]):_0x3b56('0x6e'));return respondWithRpcPromise(_0x3b56('0x6f'),_0x3b56('0x70'),_0x4eef1a);}return null;})[_0x3b56('0x20')](function(_0x373406){var _0x205efa=_0x3b56('0x71')+_0x373406[_0x3b56('0x29')]['ContactId'];return db['sequelize'][_0x3b56('0x43')](_0x205efa,{'type':db[_0x3b56('0x72')][_0x3b56('0x73')][_0x3b56('0x74')],'raw':!![]})[_0x3b56('0x20')](function(_0x2b2f20){return _0x2b2f20;});})[_0x3b56('0x20')](function(_0x4fc79a){if(_0x4fc79a){_0x4eef1a['message'][_0x3b56('0x75')]=_0x4fc79a[0x0];if(!_0x235b4b[_0x3b56('0x5a')][_0x3b56('0x62')])return;return db[_0x3b56('0x76')][_0x3b56('0x59')]({'where':{'id':_0x235b4b['body'][_0x3b56('0x62')],'role':'agent'},'attributes':['id',_0x3b56('0x42'),_0x3b56('0x77'),'email',_0x3b56('0x78')],'raw':!![]});}return null;})['then'](function(_0x47ccc2){if(!_0x47ccc2)return null;_0x4eef1a[_0x3b56('0x29')][_0x3b56('0x64')]=_0x47ccc2;return _0x4eef1a;})[_0x3b56('0x20')](function(_0x438b22){if(_0x438b22){if(_0x235b4b['body'][_0x3b56('0x79')]){_0x4eef1a['message'][_0x3b56('0x7a')]=util[_0x3b56('0x69')]('SIP/%s',_0x235b4b[_0x3b56('0x63')][_0x3b56('0x42')]);_0x4eef1a[_0x3b56('0x29')][_0x3b56('0x7b')]=_0x4eef1a[_0x3b56('0x7b')];_0x4eef1a[_0x3b56('0x29')][_0x3b56('0x7c')]=_0x4eef1a[_0x3b56('0x7b')];_0x4eef1a['message'][_0x3b56('0x7d')]=_0x3b56('0x5e');return respondWithRpcPromise(_0x3b56('0x7e'),'EventManager',{'event':_0x3b56('0x7f'),'message':_0x4eef1a[_0x3b56('0x29')]},client9002)[_0x3b56('0x20')](function(){return _0x4eef1a;});}return _0x4eef1a;}return null;})[_0x3b56('0x20')](respondWithResult(_0x5ab2d4,null))[_0x3b56('0x2b')](handleError(_0x5ab2d4,null));};var interaction_log=require(_0x3b56('0x14'))(_0x3b56('0x5d'));exports[_0x3b56('0x37')]=function(_0xdf72cd,_0x5b3d6c,_0x493e73){var _0x55ca7d={'agent':{},'channel':_0x3b56('0x5f')};if(_0xdf72cd[_0x3b56('0x5a')]['id']){delete _0xdf72cd['body']['id'];}_0xdf72cd['body']['UserId']=_0xdf72cd['body'][_0x3b56('0x62')]||_0xdf72cd[_0x3b56('0x63')]['id'];_0x55ca7d['agent']['id']=_0xdf72cd[_0x3b56('0x5a')][_0x3b56('0x62')];return db[_0x3b56('0x3e')][_0x3b56('0x59')]({'where':{'id':_0xdf72cd[_0x3b56('0x5b')]['id'],'UserId':null}})[_0x3b56('0x20')](handleEntityNotFound(_0x5b3d6c,null))[_0x3b56('0x20')](function(_0x9af768){if(_0x9af768){_0x55ca7d['message']=_0x9af768[_0x3b56('0x6a')]({'plain':!![]});return db[_0x3b56('0x65')][_0x3b56('0x59')]({'where':{'id':_0x9af768[_0x3b56('0x66')]}});}return null;})[_0x3b56('0x20')](handleEntityNotFound(_0x5b3d6c,null))[_0x3b56('0x20')](function(_0x41c140){if(_0x41c140){_0x55ca7d[_0x3b56('0x6d')]=_0x41c140['get']({'plain':!![]});interaction_log[_0x3b56('0x21')](_0x3b56('0x80'),_0xdf72cd[_0x3b56('0x63')]['id'],_0xdf72cd[_0x3b56('0x63')][_0x3b56('0x42')],_0xdf72cd[_0x3b56('0x63')][_0x3b56('0x6c')],_0x55ca7d[_0x3b56('0x6d')]['id'],_0xdf72cd[_0x3b56('0x5a')]?JSON['stringify'](_0xdf72cd[_0x3b56('0x5a')]):_0x3b56('0x6e'));return respondWithRpcPromise('RejectMessage',_0x3b56('0x81'),_0x55ca7d);}return null;})['then'](function(_0x408d8b){var _0x116046=_0x3b56('0x71')+_0x408d8b[_0x3b56('0x29')]['ContactId'];return db['sequelize'][_0x3b56('0x43')](_0x116046,{'type':db[_0x3b56('0x72')][_0x3b56('0x73')][_0x3b56('0x74')],'raw':!![]})[_0x3b56('0x20')](function(_0x2bd2ff){return _0x2bd2ff;});})[_0x3b56('0x20')](function(_0x333241){if(_0x333241){_0x55ca7d[_0x3b56('0x29')][_0x3b56('0x75')]=_0x333241[0x0];if(!_0xdf72cd[_0x3b56('0x5a')][_0x3b56('0x62')])return;return db['User'][_0x3b56('0x59')]({'where':{'id':_0xdf72cd[_0x3b56('0x5a')][_0x3b56('0x62')],'role':_0x3b56('0x64')},'attributes':['id','name',_0x3b56('0x77'),'email',_0x3b56('0x78')],'raw':!![]});}return null;})[_0x3b56('0x20')](function(_0xf1f16b){if(!_0xf1f16b)return null;_0x55ca7d[_0x3b56('0x29')][_0x3b56('0x64')]=_0xf1f16b;return _0x55ca7d;})[_0x3b56('0x20')](function(_0x38245c){if(_0x38245c){_0x38245c[_0x3b56('0x29')][_0x3b56('0x7a')]=util['format'](_0x3b56('0x82'),_0xdf72cd['user']['name']);_0x38245c[_0x3b56('0x29')][_0x3b56('0x7b')]=_0x55ca7d[_0x3b56('0x7b')];_0x38245c[_0x3b56('0x29')]['motionChannel']=_0x55ca7d[_0x3b56('0x7b')];_0x38245c[_0x3b56('0x29')][_0x3b56('0x7d')]=_0x3b56('0x37');respondWithRpcPromise(_0x3b56('0x7e'),_0x3b56('0x7e'),{'event':_0x3b56('0x83'),'message':_0x38245c[_0x3b56('0x29')]},client9002);return _0x55ca7d;}return null;})[_0x3b56('0x20')](respondWithResult(_0x5b3d6c,null))[_0x3b56('0x2b')](handleError(_0x5b3d6c,null));};exports[_0x3b56('0x84')]=function(_0x5716a7,_0xc8bf98){var _0x3374ba;return db[_0x3b56('0x3e')]['create'](_0x5716a7[_0x3b56('0x5a')],{})[_0x3b56('0x20')](function(_0x4b4974){_0x3374ba=_0x4b4974;return db[_0x3b56('0x85')][_0x3b56('0x86')]({'where':{'id':_0x3374ba[_0x3b56('0x87')]}});})['then'](function(_0x3eb290){if(_[_0x3b56('0x67')](_0x3eb290)){return;}else{_0x3374ba['fax']=_0x3eb290[_0x3b56('0x5f')];return db[_0x3b56('0x88')][_0x3b56('0x86')]({'where':{'id':_0x3374ba[_0x3b56('0x89')]}});}})[_0x3b56('0x20')](function(_0x94da5){return respondWithRpcPromise(_0x3b56('0x8a'),'SendFax',{'FaxAccountId':_[_0x3b56('0x67')](_0x5716a7[_0x3b56('0x5a')])?undefined:_0x5716a7[_0x3b56('0x5a')][_0x3b56('0x8b')],'path':_[_0x3b56('0x67')](_0x94da5)?undefined:util[_0x3b56('0x69')]('/var/opt/motion2/server/files/attachments/%s',_0x94da5[_0x3b56('0x8c')]),'fax':_[_0x3b56('0x67')](_0x3374ba[_0x3b56('0x5f')])?undefined:_0x3374ba['fax'],'AttachmentId':_0x3374ba[_0x3b56('0x89')]},client9002);})['then'](respondWithResult(_0xc8bf98,0xc9))[_0x3b56('0x2b')](handleError(_0xc8bf98,null));};exports[_0x3b56('0x8d')]=function(_0x5b1d63,_0x5e2ef8){var _0x4cf6cf=path[_0x3b56('0x8e')](config['root'],_0x3b56('0x8f'),'files',_0x3b56('0x90'));return db[_0x3b56('0x3e')]['find']({'where':{'id':_0x5b1d63['params']['id']},'include':[{'model':db[_0x3b56('0x88')],'as':_0x3b56('0x88')}]})['then'](handleEntityNotFound(_0x5e2ef8,null))['then'](function(_0x33c968){if(_0x33c968){return _0x5e2ef8[_0x3b56('0x8d')](path['join'](_0x4cf6cf,_0x33c968[_0x3b56('0x88')]['basename']));}})[_0x3b56('0x2b')](handleError(_0x5e2ef8,null));}; \ No newline at end of file +var _0x2e69=['SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','server','files','attachments','join','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','map','FaxMessage','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','update','body','describe','fax-interactions','accept','fax','read','readAt','format','UserId','agent','FaxInteraction','FaxInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','sequelize','contact','motionChannel','CmContact','findOne','isNil','Attachment','AttachmentId'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x2e69,0x128));var _0x92e6=function(_0x1f2bb8,_0x582562){_0x1f2bb8=_0x1f2bb8-0x0;var _0x15c758=_0x2e69[_0x1f2bb8];return _0x15c758;};'use strict';var emlformat=require(_0x92e6('0x0'));var rimraf=require(_0x92e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x92e6('0x2'));var rp=require(_0x92e6('0x3'));var moment=require(_0x92e6('0x4'));var BPromise=require(_0x92e6('0x5'));var Mustache=require(_0x92e6('0x6'));var util=require(_0x92e6('0x7'));var path=require(_0x92e6('0x8'));var sox=require(_0x92e6('0x9'));var csv=require('to-csv');var ejs=require(_0x92e6('0xa'));var fs=require('fs');var fs_extra=require(_0x92e6('0xb'));var _=require(_0x92e6('0xc'));var squel=require('squel');var crypto=require(_0x92e6('0xd'));var jsforce=require(_0x92e6('0xe'));var deskjs=require(_0x92e6('0xf'));var toCsv=require(_0x92e6('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x92e6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x92e6('0x12'));var hardwareService=require(_0x92e6('0x13'));var logger=require(_0x92e6('0x14'))('api');var utils=require(_0x92e6('0x15'));var config=require(_0x92e6('0x16'));var licenseUtil=require(_0x92e6('0x17'));var db=require(_0x92e6('0x18'))['db'];config[_0x92e6('0x19')]=_[_0x92e6('0x1a')](config[_0x92e6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x92e6('0x1b'))(new Redis(config[_0x92e6('0x19')]));require('./faxMessage.socket')[_0x92e6('0x1c')](socket);var jayson=require(_0x92e6('0x1d'));var client=jayson[_0x92e6('0x1e')][_0x92e6('0x1f')]({'port':0x232c});var client9002=jayson[_0x92e6('0x1e')][_0x92e6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x151419,_0x4236c1,_0x236a68,_0x30633f){return new BPromise(function(_0x2c8b2f,_0x27efcb){var _0x164c28=_0x30633f||client;return _0x164c28['request'](_0x151419,_0x236a68)['then'](function(_0x251715){logger['info'](_0x92e6('0x20'),_0x4236c1,_0x92e6('0x21'));logger[_0x92e6('0x22')](_0x92e6('0x23'),_0x4236c1,_0x92e6('0x21'),JSON[_0x92e6('0x24')](_0x251715));if(_0x251715['error']){if(_0x251715[_0x92e6('0x25')][_0x92e6('0x26')]===0x1f4){logger['error'](_0x92e6('0x20'),_0x4236c1,_0x251715['error'][_0x92e6('0x27')]);return _0x27efcb(_0x251715[_0x92e6('0x25')][_0x92e6('0x27')]);}logger[_0x92e6('0x25')](_0x92e6('0x20'),_0x4236c1,_0x251715[_0x92e6('0x25')][_0x92e6('0x27')]);return _0x2c8b2f(_0x251715['error'][_0x92e6('0x27')]);}else{logger[_0x92e6('0x28')](_0x92e6('0x20'),_0x4236c1,'request\x20sent');_0x2c8b2f(_0x251715[_0x92e6('0x29')][_0x92e6('0x27')]);}})[_0x92e6('0x2a')](function(_0x4e1adc){logger[_0x92e6('0x25')](_0x92e6('0x20'),_0x4236c1,_0x4e1adc);_0x27efcb(_0x4e1adc);});});}function respondWithStatusCode(_0x22f712,_0x32b657){_0x32b657=_0x32b657||0xcc;return function(_0xfa0b0b){if(_0xfa0b0b){return _0x22f712[_0x92e6('0x2b')](_0x32b657);}return _0x22f712['status'](_0x32b657)[_0x92e6('0x2c')]();};}function respondWithResult(_0x45d7d0,_0x4c7402){_0x4c7402=_0x4c7402||0xc8;return function(_0x6735dc){if(_0x6735dc){return _0x45d7d0[_0x92e6('0x2d')](_0x4c7402)[_0x92e6('0x2e')](_0x6735dc);}};}function respondWithFilteredResult(_0x341034,_0x3b282d){return function(_0x3a52c8){if(_0x3a52c8){var _0x5ab517=typeof _0x3b282d[_0x92e6('0x2f')]===_0x92e6('0x30')&&typeof _0x3b282d[_0x92e6('0x31')]===_0x92e6('0x30');var _0x1fc8ec=_0x3a52c8[_0x92e6('0x32')];var _0x376173=_0x5ab517?0x0:_0x3b282d['offset'];var _0x3fad47=_0x5ab517?_0x3a52c8[_0x92e6('0x32')]:_0x3b282d[_0x92e6('0x2f')]+_0x3b282d['limit'];var _0x1f2fe3;if(_0x3fad47>=_0x1fc8ec){_0x3fad47=_0x1fc8ec;_0x1f2fe3=0xc8;}else{_0x1f2fe3=0xce;}_0x341034[_0x92e6('0x2d')](_0x1f2fe3);return _0x341034[_0x92e6('0x33')](_0x92e6('0x34'),_0x376173+'-'+_0x3fad47+'/'+_0x1fc8ec)[_0x92e6('0x2e')](_0x3a52c8);}return null;};}function patchUpdates(_0xeb0564){return function(_0x559837){try{jsonpatch['apply'](_0x559837,_0xeb0564,!![]);}catch(_0x1b427f){return BPromise[_0x92e6('0x35')](_0x1b427f);}return _0x559837[_0x92e6('0x36')]();};}function saveUpdates(_0x4b116c,_0x1635b4){return function(_0xa34b13){if(_0xa34b13){return _0xa34b13['update'](_0x4b116c)[_0x92e6('0x37')](function(_0x359bdf){return _0x359bdf;});}return null;};}function removeEntity(_0x1036e1,_0x282b19){return function(_0xa28185){if(_0xa28185){return _0xa28185[_0x92e6('0x38')]()[_0x92e6('0x37')](function(){_0x1036e1[_0x92e6('0x2d')](0xcc)[_0x92e6('0x2c')]();});}};}function handleEntityNotFound(_0xfd6916,_0x547649){return function(_0x1de460){if(!_0x1de460){_0xfd6916[_0x92e6('0x2b')](0x194);}return _0x1de460;};}function handleError(_0xc9e686,_0x1b0ac0){_0x1b0ac0=_0x1b0ac0||0x1f4;return function(_0x50ad4d){logger['error'](_0x50ad4d[_0x92e6('0x39')]);if(_0x50ad4d[_0x92e6('0x3a')]){delete _0x50ad4d[_0x92e6('0x3a')];}_0xc9e686[_0x92e6('0x2d')](_0x1b0ac0)['send'](_0x50ad4d);};}exports['index']=function(_0x25deb1,_0x2bc500){var _0x1e9ed2={},_0x240721={},_0xc64e0b={'count':0x0,'rows':[]};var _0x16fcea=_[_0x92e6('0x3b')](db[_0x92e6('0x3c')][_0x92e6('0x3d')],function(_0x34ec56){return{'name':_0x34ec56[_0x92e6('0x3e')],'type':_0x34ec56[_0x92e6('0x3f')][_0x92e6('0x40')]};});_0x240721['model']=_[_0x92e6('0x3b')](_0x16fcea,_0x92e6('0x3a'));_0x240721[_0x92e6('0x41')]=_['keys'](_0x25deb1[_0x92e6('0x41')]);_0x240721[_0x92e6('0x42')]=_[_0x92e6('0x43')](_0x240721['model'],_0x240721[_0x92e6('0x41')]);_0x1e9ed2[_0x92e6('0x44')]=_[_0x92e6('0x43')](_0x240721[_0x92e6('0x45')],qs['fields'](_0x25deb1[_0x92e6('0x41')][_0x92e6('0x46')]));_0x1e9ed2[_0x92e6('0x44')]=_0x1e9ed2['attributes'][_0x92e6('0x47')]?_0x1e9ed2[_0x92e6('0x44')]:_0x240721[_0x92e6('0x45')];if(!_0x25deb1[_0x92e6('0x41')][_0x92e6('0x48')](_0x92e6('0x49'))){_0x1e9ed2[_0x92e6('0x31')]=qs[_0x92e6('0x31')](_0x25deb1['query']['limit']);_0x1e9ed2[_0x92e6('0x2f')]=qs['offset'](_0x25deb1[_0x92e6('0x41')][_0x92e6('0x2f')]);}_0x1e9ed2[_0x92e6('0x4a')]=qs[_0x92e6('0x4b')](_0x25deb1[_0x92e6('0x41')][_0x92e6('0x4b')]);_0x1e9ed2['where']=qs[_0x92e6('0x42')](_['pick'](_0x25deb1[_0x92e6('0x41')],_0x240721['filters']),_0x16fcea);if(_0x25deb1[_0x92e6('0x41')][_0x92e6('0x4c')]){_0x1e9ed2['where']=_[_0x92e6('0x4d')](_0x1e9ed2[_0x92e6('0x4e')],{'$or':_[_0x92e6('0x3b')](_0x16fcea,function(_0x1524e0){if(_0x1524e0[_0x92e6('0x3f')]!==_0x92e6('0x4f')){var _0x4b6135={};_0x4b6135[_0x1524e0['name']]={'$like':'%'+_0x25deb1[_0x92e6('0x41')][_0x92e6('0x4c')]+'%'};return _0x4b6135;}})});}_0x1e9ed2=_[_0x92e6('0x4d')]({},_0x1e9ed2,_0x25deb1[_0x92e6('0x50')]);var _0x2f30b2={'where':_0x1e9ed2['where']};return db[_0x92e6('0x3c')][_0x92e6('0x32')](_0x2f30b2)['then'](function(_0x33fc8c){_0xc64e0b[_0x92e6('0x32')]=_0x33fc8c;if(_0x25deb1['query'][_0x92e6('0x51')]){_0x1e9ed2[_0x92e6('0x52')]=[{'all':!![]}];}return db[_0x92e6('0x3c')]['findAll'](_0x1e9ed2);})['then'](function(_0x40b3e4){_0xc64e0b[_0x92e6('0x53')]=_0x40b3e4;return _0xc64e0b;})['then'](respondWithFilteredResult(_0x2bc500,_0x1e9ed2))[_0x92e6('0x2a')](handleError(_0x2bc500,null));};exports[_0x92e6('0x54')]=function(_0x32f952,_0x23a260){var _0xc99c09={'raw':!![],'where':{'id':_0x32f952[_0x92e6('0x55')]['id']}},_0x557928={};_0x557928[_0x92e6('0x45')]=_[_0x92e6('0x56')](db['FaxMessage'][_0x92e6('0x3d')]);_0x557928[_0x92e6('0x41')]=_[_0x92e6('0x56')](_0x32f952[_0x92e6('0x41')]);_0x557928[_0x92e6('0x42')]=_[_0x92e6('0x43')](_0x557928[_0x92e6('0x45')],_0x557928[_0x92e6('0x41')]);_0xc99c09[_0x92e6('0x44')]=_['intersection'](_0x557928[_0x92e6('0x45')],qs[_0x92e6('0x46')](_0x32f952[_0x92e6('0x41')][_0x92e6('0x46')]));_0xc99c09['attributes']=_0xc99c09[_0x92e6('0x44')][_0x92e6('0x47')]?_0xc99c09[_0x92e6('0x44')]:_0x557928['model'];if(_0x32f952[_0x92e6('0x41')][_0x92e6('0x51')]){_0xc99c09[_0x92e6('0x52')]=[{'all':!![]}];}_0xc99c09=_['merge']({},_0xc99c09,_0x32f952[_0x92e6('0x50')]);return db['FaxMessage'][_0x92e6('0x57')](_0xc99c09)[_0x92e6('0x37')](handleEntityNotFound(_0x23a260,null))['then'](respondWithResult(_0x23a260,null))[_0x92e6('0x2a')](handleError(_0x23a260,null));};exports[_0x92e6('0x58')]=function(_0x5c4044,_0x22c201){if(_0x5c4044[_0x92e6('0x59')]['id']){delete _0x5c4044[_0x92e6('0x59')]['id'];}return db['FaxMessage'][_0x92e6('0x57')]({'where':{'id':_0x5c4044[_0x92e6('0x55')]['id']}})[_0x92e6('0x37')](handleEntityNotFound(_0x22c201,null))[_0x92e6('0x37')](saveUpdates(_0x5c4044[_0x92e6('0x59')],null))['then'](respondWithResult(_0x22c201,null))[_0x92e6('0x2a')](handleError(_0x22c201,null));};exports[_0x92e6('0x38')]=function(_0x2338f6,_0x4ee03a){return db['FaxMessage'][_0x92e6('0x57')]({'where':{'id':_0x2338f6[_0x92e6('0x55')]['id']}})[_0x92e6('0x37')](handleEntityNotFound(_0x4ee03a,null))[_0x92e6('0x37')](removeEntity(_0x4ee03a,null))[_0x92e6('0x2a')](handleError(_0x4ee03a,null));};exports[_0x92e6('0x5a')]=function(_0x304bc0,_0x188b18){return db['FaxMessage'][_0x92e6('0x5a')]()[_0x92e6('0x37')](respondWithResult(_0x188b18,null))[_0x92e6('0x2a')](handleError(_0x188b18,null));};var interaction_log=require(_0x92e6('0x14'))(_0x92e6('0x5b'));exports[_0x92e6('0x5c')]=function(_0x2c0208,_0x210221,_0xef3a11){var _0x2b625b={'agent':{},'channel':_0x92e6('0x5d')};if(_0x2c0208['body']['id']){delete _0x2c0208[_0x92e6('0x59')]['id'];}_0x2c0208[_0x92e6('0x59')][_0x92e6('0x5e')]=!![];_0x2c0208['body'][_0x92e6('0x5f')]=moment()[_0x92e6('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c0208['body']['UserId']=_0x2c0208['body'][_0x92e6('0x61')]||_0x2c0208['user']['id'];_0x2b625b[_0x92e6('0x62')]['id']=_0x2c0208[_0x92e6('0x59')][_0x92e6('0x61')];return db['FaxMessage'][_0x92e6('0x57')]({'where':{'id':_0x2c0208[_0x92e6('0x55')]['id'],'UserId':null}})[_0x92e6('0x37')](handleEntityNotFound(_0x210221,null))[_0x92e6('0x37')](saveUpdates(_0x2c0208[_0x92e6('0x59')],null))['then'](function(_0x35933c){if(_0x35933c){_0x2b625b[_0x92e6('0x27')]=_0x35933c['get']({'plain':!![]});return db[_0x92e6('0x63')][_0x92e6('0x57')]({'where':{'id':_0x35933c[_0x92e6('0x64')]}});}return null;})[_0x92e6('0x37')](handleEntityNotFound(_0x210221,null))['then'](function(_0x5edae1){if(_0x5edae1){return _0x5edae1['update']({'UserId':_0x2c0208[_0x92e6('0x59')]['UserId'],'read1stAt':_['isNil'](_0x5edae1[_0x92e6('0x65')])?moment()['format'](_0x92e6('0x66')):undefined});}return null;})['then'](function(_0x3c1afa){if(_0x3c1afa){_0x2b625b[_0x92e6('0x67')]=_0x3c1afa[_0x92e6('0x68')]({'plain':!![]});interaction_log[_0x92e6('0x28')](_0x92e6('0x69'),_0x2c0208[_0x92e6('0x6a')]['id'],_0x2c0208[_0x92e6('0x6a')][_0x92e6('0x3a')],_0x2c0208[_0x92e6('0x6a')][_0x92e6('0x6b')],_0x2b625b[_0x92e6('0x67')]['id'],_0x2c0208[_0x92e6('0x59')]?JSON[_0x92e6('0x24')](_0x2c0208[_0x92e6('0x59')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x2b625b);}return null;})[_0x92e6('0x37')](function(_0x2e8df1){var _0x150bfd=_0x92e6('0x6c')+_0x2e8df1[_0x92e6('0x27')][_0x92e6('0x6d')];return db['sequelize'][_0x92e6('0x41')](_0x150bfd,{'type':db[_0x92e6('0x6e')][_0x92e6('0x6f')][_0x92e6('0x70')],'raw':!![]})[_0x92e6('0x37')](function(_0x123c71){return _0x123c71;});})[_0x92e6('0x37')](function(_0x440778){if(_0x440778){_0x2b625b[_0x92e6('0x27')]['contact']=_0x440778[0x0];if(!_0x2c0208[_0x92e6('0x59')][_0x92e6('0x61')])return;return db[_0x92e6('0x71')][_0x92e6('0x57')]({'where':{'id':_0x2c0208[_0x92e6('0x59')]['UserId'],'role':'agent'},'attributes':['id','name',_0x92e6('0x72'),'email',_0x92e6('0x73')],'raw':!![]});}return null;})[_0x92e6('0x37')](function(_0x18fe5a){if(!_0x18fe5a)return null;_0x2b625b[_0x92e6('0x27')]['agent']=_0x18fe5a;return _0x2b625b;})[_0x92e6('0x37')](function(_0x5c2a93){if(_0x5c2a93){if(_0x2c0208[_0x92e6('0x59')]['manual']){_0x2b625b[_0x92e6('0x27')][_0x92e6('0x74')]=util[_0x92e6('0x60')](_0x92e6('0x75'),_0x2c0208[_0x92e6('0x6a')]['name']);_0x2b625b['message'][_0x92e6('0x76')]=_0x2b625b['channel'];_0x2b625b[_0x92e6('0x27')]['motionChannel']=_0x2b625b[_0x92e6('0x76')];_0x2b625b[_0x92e6('0x27')][_0x92e6('0x77')]=_0x92e6('0x5c');return respondWithRpcPromise(_0x92e6('0x78'),_0x92e6('0x78'),{'event':_0x92e6('0x79'),'message':_0x2b625b[_0x92e6('0x27')]},client9002)[_0x92e6('0x37')](function(){return _0x2b625b;});}return _0x2b625b;}return null;})[_0x92e6('0x37')](respondWithResult(_0x210221,null))[_0x92e6('0x2a')](handleError(_0x210221,null));};var interaction_log=require(_0x92e6('0x14'))(_0x92e6('0x5b'));exports[_0x92e6('0x35')]=function(_0x523f95,_0x4734b6,_0x366a1a){var _0x1a6aa2={'agent':{},'channel':_0x92e6('0x5d')};if(_0x523f95['body']['id']){delete _0x523f95[_0x92e6('0x59')]['id'];}_0x523f95[_0x92e6('0x59')][_0x92e6('0x61')]=_0x523f95[_0x92e6('0x59')]['UserId']||_0x523f95[_0x92e6('0x6a')]['id'];_0x1a6aa2[_0x92e6('0x62')]['id']=_0x523f95[_0x92e6('0x59')]['UserId'];return db['FaxMessage'][_0x92e6('0x57')]({'where':{'id':_0x523f95[_0x92e6('0x55')]['id'],'UserId':null}})[_0x92e6('0x37')](handleEntityNotFound(_0x4734b6,null))[_0x92e6('0x37')](function(_0x443648){if(_0x443648){_0x1a6aa2[_0x92e6('0x27')]=_0x443648[_0x92e6('0x68')]({'plain':!![]});return db[_0x92e6('0x63')]['find']({'where':{'id':_0x443648[_0x92e6('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x4734b6,null))[_0x92e6('0x37')](function(_0x32f19a){if(_0x32f19a){_0x1a6aa2[_0x92e6('0x67')]=_0x32f19a[_0x92e6('0x68')]({'plain':!![]});interaction_log[_0x92e6('0x28')](_0x92e6('0x7a'),_0x523f95[_0x92e6('0x6a')]['id'],_0x523f95['user'][_0x92e6('0x3a')],_0x523f95[_0x92e6('0x6a')]['role'],_0x1a6aa2[_0x92e6('0x67')]['id'],_0x523f95[_0x92e6('0x59')]?JSON[_0x92e6('0x24')](_0x523f95[_0x92e6('0x59')]):_0x92e6('0x7b'));return respondWithRpcPromise(_0x92e6('0x7c'),'rejectMessage',_0x1a6aa2);}return null;})[_0x92e6('0x37')](function(_0x1b6b56){var _0x4d2a3b=_0x92e6('0x6c')+_0x1b6b56[_0x92e6('0x27')][_0x92e6('0x6d')];return db[_0x92e6('0x7d')][_0x92e6('0x41')](_0x4d2a3b,{'type':db[_0x92e6('0x6e')][_0x92e6('0x6f')][_0x92e6('0x70')],'raw':!![]})[_0x92e6('0x37')](function(_0x422146){return _0x422146;});})['then'](function(_0x2ed90b){if(_0x2ed90b){_0x1a6aa2[_0x92e6('0x27')][_0x92e6('0x7e')]=_0x2ed90b[0x0];if(!_0x523f95[_0x92e6('0x59')][_0x92e6('0x61')])return;return db[_0x92e6('0x71')][_0x92e6('0x57')]({'where':{'id':_0x523f95[_0x92e6('0x59')]['UserId'],'role':'agent'},'attributes':['id',_0x92e6('0x3a'),'fullname','email',_0x92e6('0x73')],'raw':!![]});}return null;})[_0x92e6('0x37')](function(_0x22b6a4){if(!_0x22b6a4)return null;_0x1a6aa2['message'][_0x92e6('0x62')]=_0x22b6a4;return _0x1a6aa2;})['then'](function(_0x4b67d4){if(_0x4b67d4){_0x4b67d4[_0x92e6('0x27')][_0x92e6('0x74')]=util[_0x92e6('0x60')](_0x92e6('0x75'),_0x523f95[_0x92e6('0x6a')]['name']);_0x4b67d4[_0x92e6('0x27')]['channel']=_0x1a6aa2[_0x92e6('0x76')];_0x4b67d4[_0x92e6('0x27')][_0x92e6('0x7f')]=_0x1a6aa2[_0x92e6('0x76')];_0x4b67d4[_0x92e6('0x27')]['event']='reject';respondWithRpcPromise(_0x92e6('0x78'),_0x92e6('0x78'),{'event':'rejectmessage','message':_0x4b67d4[_0x92e6('0x27')]},client9002);return _0x1a6aa2;}return null;})[_0x92e6('0x37')](respondWithResult(_0x4734b6,null))[_0x92e6('0x2a')](handleError(_0x4734b6,null));};exports['create']=function(_0x5b3da3,_0x55ab0d){var _0x75c14c;return db['FaxMessage']['create'](_0x5b3da3['body'],{})[_0x92e6('0x37')](function(_0x560d9d){_0x75c14c=_0x560d9d;return db[_0x92e6('0x80')][_0x92e6('0x81')]({'where':{'id':_0x75c14c[_0x92e6('0x6d')]}});})[_0x92e6('0x37')](function(_0x2c90f9){if(_[_0x92e6('0x82')](_0x2c90f9)){return;}else{_0x75c14c[_0x92e6('0x5d')]=_0x2c90f9[_0x92e6('0x5d')];return db[_0x92e6('0x83')][_0x92e6('0x81')]({'where':{'id':_0x75c14c[_0x92e6('0x84')]}});}})[_0x92e6('0x37')](function(_0x212e65){return respondWithRpcPromise(_0x92e6('0x85'),'SendFax',{'FaxAccountId':_[_0x92e6('0x82')](_0x5b3da3[_0x92e6('0x59')])?undefined:_0x5b3da3[_0x92e6('0x59')][_0x92e6('0x86')],'path':_['isNil'](_0x212e65)?undefined:util[_0x92e6('0x60')](_0x92e6('0x87'),_0x212e65[_0x92e6('0x88')]),'fax':_[_0x92e6('0x82')](_0x75c14c['fax'])?undefined:_0x75c14c[_0x92e6('0x5d')],'AttachmentId':_0x75c14c[_0x92e6('0x84')]},client9002);})[_0x92e6('0x37')](respondWithResult(_0x55ab0d,0xc9))[_0x92e6('0x2a')](handleError(_0x55ab0d,null));};exports[_0x92e6('0x89')]=function(_0x413578,_0x14952e){var _0x38d4db=path['join'](config[_0x92e6('0x8a')],_0x92e6('0x8b'),_0x92e6('0x8c'),_0x92e6('0x8d'));return db[_0x92e6('0x3c')]['find']({'where':{'id':_0x413578[_0x92e6('0x55')]['id']},'include':[{'model':db['Attachment'],'as':_0x92e6('0x83')}]})[_0x92e6('0x37')](handleEntityNotFound(_0x14952e,null))[_0x92e6('0x37')](function(_0x202fcc){if(_0x202fcc){return _0x14952e['download'](path[_0x92e6('0x8e')](_0x38d4db,_0x202fcc['Attachment'][_0x92e6('0x88')]));}})['catch'](handleError(_0x14952e,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index cd78945..9e10755 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 _0x0619=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove'];(function(_0x376b0e,_0x666aae){var _0x41ee79=function(_0xd2dc14){while(--_0xd2dc14){_0x376b0e['push'](_0x376b0e['shift']());}};_0x41ee79(++_0x666aae);}(_0x0619,0x90));var _0x9061=function(_0x857cb,_0x100962){_0x857cb=_0x857cb-0x0;var _0x5a7bc6=_0x0619[_0x857cb];return _0x5a7bc6;};'use strict';var EventEmitter=require(_0x9061('0x0'));var FaxMessage=require(_0x9061('0x1'))['db'][_0x9061('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9061('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9061('0x4'),'afterDestroy':_0x9061('0x5')};function emitEvent(_0x1f0fe8){return function(_0x1384a7,_0x1bc8ce,_0xa713e1){FaxMessageEvents[_0x9061('0x6')](_0x1f0fe8+':'+_0x1384a7['id'],_0x1384a7);FaxMessageEvents[_0x9061('0x6')](_0x1f0fe8,_0x1384a7);_0xa713e1(null);};}for(var e in events){if(events[_0x9061('0x7')](e)){var event=events[e];FaxMessage[_0x9061('0x8')](e,emitEvent(event));}}module[_0x9061('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xdd68=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','FaxMessage'];(function(_0x14d5ec,_0x771a4b){var _0x21eb51=function(_0x3936a9){while(--_0x3936a9){_0x14d5ec['push'](_0x14d5ec['shift']());}};_0x21eb51(++_0x771a4b);}(_0xdd68,0x196));var _0x8dd6=function(_0xd511d,_0x3546b9){_0xd511d=_0xd511d-0x0;var _0x3f148e=_0xdd68[_0xd511d];return _0x3f148e;};'use strict';var EventEmitter=require(_0x8dd6('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x8dd6('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x8dd6('0x2')](0x0);var events={'afterCreate':_0x8dd6('0x3'),'afterUpdate':_0x8dd6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37b71c){return function(_0x469e0c,_0x5c7c72,_0x310895){FaxMessageEvents[_0x8dd6('0x5')](_0x37b71c+':'+_0x469e0c['id'],_0x469e0c);FaxMessageEvents['emit'](_0x37b71c,_0x469e0c);_0x310895(null);};}for(var e in events){if(events[_0x8dd6('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x8dd6('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 1706c73..c3d8fe2 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 _0x6ba8=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','FaxInteraction','FaxInteractionId','then','createdAt'];(function(_0x52dee3,_0x52d6cc){var _0x1ffa70=function(_0xf679ea){while(--_0xf679ea){_0x52dee3['push'](_0x52dee3['shift']());}};_0x1ffa70(++_0x52d6cc);}(_0x6ba8,0x189));var _0x86ba=function(_0x88858c,_0x1e58e7){_0x88858c=_0x88858c-0x0;var _0x3c8972=_0x6ba8[_0x88858c];return _0x3c8972;};'use strict';var _=require(_0x86ba('0x0'));var util=require(_0x86ba('0x1'));var logger=require(_0x86ba('0x2'))(_0x86ba('0x3'));var moment=require(_0x86ba('0x4'));var BPromise=require(_0x86ba('0x5'));var rp=require(_0x86ba('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0x86ba('0x7')]=function(_0x3eb478,_0x1dc549){return _0x3eb478['define'](_0x86ba('0x8'),attributes,{'tableName':_0x86ba('0x9'),'paranoid':![],'indexes':[{'name':_0x86ba('0xa'),'fields':[_0x86ba('0xb')],'type':_0x86ba('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x328aad,_0x40bcd9,_0xce0751){var _0x292c24=_0x3eb478[_0x86ba('0xd')];var _0x55db66=_0x328aad[_0x86ba('0xe')]({'plain':!![]});if(_0x55db66['direction'][_0x86ba('0xf')]()==='in'||_0x55db66[_0x86ba('0x10')][_0x86ba('0xf')]()===_0x86ba('0x11')&&!_0x55db66[_0x86ba('0x12')]&&!_['isNil'](_0x55db66['UserId'])){_0x292c24[_0x86ba('0x13')]['findOne']({'where':{'id':_0x55db66[_0x86ba('0x14')]}})[_0x86ba('0x15')](function(_0x36fe46){if(_0x36fe46){_0x36fe46['update']({'lastMsgAt':_0x55db66[_0x86ba('0x16')],'lastMsgDirection':_0x55db66['direction'][_0x86ba('0xf')]()});}})['catch'](function(_0x318e9a){console[_0x86ba('0x17')](_0x318e9a);});}_0xce0751();}},'charset':_0x86ba('0x18'),'collate':_0x86ba('0x19')});}; \ No newline at end of file +var _0x330f=['request-promise','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','models','direction','toLowerCase','out','secret','UserId','findOne','FaxInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x4bf445,_0x44991b){var _0x544fab=function(_0x22c02f){while(--_0x22c02f){_0x4bf445['push'](_0x4bf445['shift']());}};_0x544fab(++_0x44991b);}(_0x330f,0x125));var _0xf330=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0x330f[_0x323419];return _0x4c0be7;};'use strict';var _=require('lodash');var util=require(_0xf330('0x0'));var logger=require(_0xf330('0x1'))(_0xf330('0x2'));var moment=require('moment');var BPromise=require(_0xf330('0x3'));var rp=require(_0xf330('0x4'));var fs=require('fs');var path=require(_0xf330('0x5'));var rimraf=require(_0xf330('0x6'));var config=require('../../config/environment');var attributes=require(_0xf330('0x7'));module[_0xf330('0x8')]=function(_0x2c9ae6,_0x5e8d70){return _0x2c9ae6[_0xf330('0x9')](_0xf330('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xf330('0xb'),'fields':[_0xf330('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4bcccb,_0x11622b,_0x37ac32){var _0x4c887d=_0x2c9ae6[_0xf330('0xd')];var _0x2103dc=_0x4bcccb['get']({'plain':!![]});if(_0x2103dc[_0xf330('0xe')][_0xf330('0xf')]()==='in'||_0x2103dc['direction'][_0xf330('0xf')]()===_0xf330('0x10')&&!_0x2103dc[_0xf330('0x11')]&&!_['isNil'](_0x2103dc[_0xf330('0x12')])){_0x4c887d['FaxInteraction'][_0xf330('0x13')]({'where':{'id':_0x2103dc[_0xf330('0x14')]}})[_0xf330('0x15')](function(_0x1b158b){if(_0x1b158b){_0x1b158b[_0xf330('0x16')]({'lastMsgAt':_0x2103dc[_0xf330('0x17')],'lastMsgDirection':_0x2103dc[_0xf330('0xe')][_0xf330('0xf')]()});}})[_0xf330('0x18')](function(_0x10aeb7){console['error'](_0x10aeb7);});}_0x37ac32();}},'charset':_0xf330('0x19'),'collate':_0xf330('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 072cdf9..b437b75 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 _0xd2ea=['../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','FaxMessage','create','body','options','raw','CreateFaxMessage','stringify','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3b4d63,_0x28f1ab){var _0x3b683b=function(_0x14f516){while(--_0x14f516){_0x3b4d63['push'](_0x3b4d63['shift']());}};_0x3b683b(++_0x28f1ab);}(_0xd2ea,0x15f));var _0xad2e=function(_0x5df5bd,_0x197797){_0x5df5bd=_0x5df5bd-0x0;var _0x5b48e6=_0xd2ea[_0x5df5bd];return _0x5b48e6;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});config[_0xad2e('0xc')]=_[_0xad2e('0xd')](config[_0xad2e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xad2e('0xe'))(new Redis(config[_0xad2e('0xc')]));require('./faxMessage.socket')[_0xad2e('0xf')](socket);function respondWithRpcPromise(_0x51f575,_0x430443,_0x415a41){return new BPromise(function(_0x9879f2,_0x24c5da){return client['request'](_0x51f575,_0x415a41)[_0xad2e('0x10')](function(_0x5707a5){logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));logger[_0xad2e('0x14')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x430443,_0xad2e('0x13'),JSON['stringify'](_0x5707a5));if(_0x5707a5[_0xad2e('0x15')]){if(_0x5707a5['error']['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x24c5da(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}logger[_0xad2e('0x15')](_0xad2e('0x12'),_0x430443,_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);return _0x9879f2(_0x5707a5[_0xad2e('0x15')][_0xad2e('0x16')]);}else{logger[_0xad2e('0x11')](_0xad2e('0x12'),_0x430443,_0xad2e('0x13'));_0x9879f2(_0x5707a5[_0xad2e('0x17')][_0xad2e('0x16')]);}})['catch'](function(_0x245617){logger[_0xad2e('0x15')]('FaxMessage,\x20%s,\x20%s',_0x430443,_0x245617);_0x24c5da(_0x245617);});});}exports['CreateFaxMessage']=function(_0x48d8b5){var _0x4a4b2d=this;return new Promise(function(_0x18c38d,_0x293adc){return db[_0xad2e('0x18')][_0xad2e('0x19')](_0x48d8b5[_0xad2e('0x1a')],{'raw':_0x48d8b5[_0xad2e('0x1b')]?_0x48d8b5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![]})[_0xad2e('0x10')](function(_0x154d54){logger[_0xad2e('0x11')](_0xad2e('0x1d'),_0x48d8b5);logger[_0xad2e('0x14')](_0xad2e('0x1d'),_0x48d8b5,JSON[_0xad2e('0x1e')](_0x154d54));_0x18c38d(_0x154d54);})[_0xad2e('0x1f')](function(_0x59630b){logger[_0xad2e('0x15')](_0xad2e('0x1d'),_0x59630b[_0xad2e('0x16')],_0x48d8b5);_0x293adc(_0x4a4b2d[_0xad2e('0x15')](0x1f4,_0x59630b[_0xad2e('0x16')]));});});};exports[_0xad2e('0x20')]=function(_0x1161d5){var _0x175055=this;return new Promise(function(_0xfd90a4,_0x50d446){return db[_0xad2e('0x18')]['update'](_0x1161d5[_0xad2e('0x1a')],{'raw':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x21')]||null:null,'attributes':_0x1161d5[_0xad2e('0x1b')]?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x22')]||null:null,'limit':_0x1161d5['options']?_0x1161d5[_0xad2e('0x1b')][_0xad2e('0x23')]||null:null})[_0xad2e('0x10')](function(_0x4379f4){logger[_0xad2e('0x11')](_0xad2e('0x20'),_0x1161d5);logger[_0xad2e('0x14')](_0xad2e('0x20'),_0x1161d5,JSON[_0xad2e('0x1e')](_0x4379f4));_0xfd90a4(_0x4379f4);})[_0xad2e('0x1f')](function(_0xcc4c66){logger['error'](_0xad2e('0x20'),_0xcc4c66['message'],_0x1161d5);_0x50d446(_0x175055[_0xad2e('0x15')](0x1f4,_0xcc4c66[_0xad2e('0x16')]));});});}; \ No newline at end of file +var _0x2d17=['create','catch','UpdateFaxMessage','FaxMessage','body','options','where','attributes','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateFaxMessage'];(function(_0x1c7112,_0x395e37){var _0x466903=function(_0x1ea8b2){while(--_0x1ea8b2){_0x1c7112['push'](_0x1c7112['shift']());}};_0x466903(++_0x395e37);}(_0x2d17,0x17e));var _0x72d1=function(_0x159ff2,_0x2095b0){_0x159ff2=_0x159ff2-0x0;var _0x91fd39=_0x2d17[_0x159ff2];return _0x91fd39;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});config[_0x72d1('0x9')]=_['defaults'](config[_0x72d1('0x9')],{'host':_0x72d1('0xa'),'port':0x18eb});var socket=require(_0x72d1('0xb'))(new Redis(config['redis']));require(_0x72d1('0xc'))[_0x72d1('0xd')](socket);function respondWithRpcPromise(_0x283775,_0x593c91,_0x1d7520){return new BPromise(function(_0x3a35c6,_0x45eb4a){return client[_0x72d1('0xe')](_0x283775,_0x1d7520)[_0x72d1('0xf')](function(_0x3916f2){logger[_0x72d1('0x10')](_0x72d1('0x11'),_0x593c91,_0x72d1('0x12'));logger[_0x72d1('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'),JSON[_0x72d1('0x14')](_0x3916f2));if(_0x3916f2[_0x72d1('0x15')]){if(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x16')]===0x1f4){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);return _0x45eb4a(_0x3916f2[_0x72d1('0x15')][_0x72d1('0x17')]);}logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x3916f2['error'][_0x72d1('0x17')]);return _0x3a35c6(_0x3916f2['error'][_0x72d1('0x17')]);}else{logger[_0x72d1('0x10')]('FaxMessage,\x20%s,\x20%s',_0x593c91,_0x72d1('0x12'));_0x3a35c6(_0x3916f2[_0x72d1('0x18')][_0x72d1('0x17')]);}})['catch'](function(_0x4925f6){logger[_0x72d1('0x15')](_0x72d1('0x11'),_0x593c91,_0x4925f6);_0x45eb4a(_0x4925f6);});});}exports[_0x72d1('0x19')]=function(_0x1865c1){var _0x8d6890=this;return new Promise(function(_0x2253fd,_0x1e2411){return db['FaxMessage'][_0x72d1('0x1a')](_0x1865c1['body'],{'raw':_0x1865c1['options']?_0x1865c1['options']['raw']===undefined?!![]:![]:!![]})[_0x72d1('0xf')](function(_0x374602){logger['info'](_0x72d1('0x19'),_0x1865c1);logger[_0x72d1('0x13')](_0x72d1('0x19'),_0x1865c1,JSON[_0x72d1('0x14')](_0x374602));_0x2253fd(_0x374602);})[_0x72d1('0x1b')](function(_0x4e6acd){logger['error'](_0x72d1('0x19'),_0x4e6acd[_0x72d1('0x17')],_0x1865c1);_0x1e2411(_0x8d6890[_0x72d1('0x15')](0x1f4,_0x4e6acd[_0x72d1('0x17')]));});});};exports[_0x72d1('0x1c')]=function(_0x33d530){var _0x163bec=this;return new Promise(function(_0x589f7c,_0x57ec9e){return db[_0x72d1('0x1d')]['update'](_0x33d530[_0x72d1('0x1e')],{'raw':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d530[_0x72d1('0x1f')]?_0x33d530['options'][_0x72d1('0x20')]||null:null,'attributes':_0x33d530[_0x72d1('0x1f')]?_0x33d530[_0x72d1('0x1f')][_0x72d1('0x21')]||null:null,'limit':_0x33d530['options']?_0x33d530[_0x72d1('0x1f')]['limit']||null:null})[_0x72d1('0xf')](function(_0x32dc5e){logger['info'](_0x72d1('0x1c'),_0x33d530);logger[_0x72d1('0x13')](_0x72d1('0x1c'),_0x33d530,JSON[_0x72d1('0x14')](_0x32dc5e));_0x589f7c(_0x32dc5e);})[_0x72d1('0x1b')](function(_0x52511f){logger[_0x72d1('0x15')](_0x72d1('0x1c'),_0x52511f[_0x72d1('0x17')],_0x33d530);_0x57ec9e(_0x163bec['error'](0x1f4,_0x52511f[_0x72d1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index fc569a6..a428d14 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 _0x0963=['faxMessage:','remove','update','emit','length'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x0963,0x9c));var _0x3096=function(_0x292f35,_0x72e859){_0x292f35=_0x292f35-0x0;var _0x288e75=_0x0963[_0x292f35];return _0x288e75;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save',_0x3096('0x0'),_0x3096('0x1')];function createListener(_0xdf332,_0x2d4bc1){return function(_0x8cef7a){_0x2d4bc1[_0x3096('0x2')](_0xdf332,_0x8cef7a);};}function removeListener(_0x4da1b8,_0x5762fa){return function(){FaxMessageEvents['removeListener'](_0x4da1b8,_0x5762fa);};}exports['register']=function(_0x51ac82){for(var _0x2bac63=0x0,_0x18728f=events[_0x3096('0x3')];_0x2bac63<_0x18728f;_0x2bac63++){var _0x75230c=events[_0x2bac63];var _0x270f18=createListener(_0x3096('0x4')+_0x75230c,_0x51ac82);FaxMessageEvents['on'](_0x75230c,_0x270f18);}}; \ No newline at end of file +var _0xaf57=['./faxMessage.events','save','update','removeListener','length','faxMessage:'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0xaf57,0x168));var _0x7af5=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xaf57[_0x2112d4];return _0x434972;};'use strict';var FaxMessageEvents=require(_0x7af5('0x0'));var events=[_0x7af5('0x1'),'remove',_0x7af5('0x2')];function createListener(_0x256f9e,_0x17b9b9){return function(_0x325dc0){_0x17b9b9['emit'](_0x256f9e,_0x325dc0);};}function removeListener(_0x13582c,_0x30316e){return function(){FaxMessageEvents[_0x7af5('0x3')](_0x13582c,_0x30316e);};}exports['register']=function(_0x47f077){for(var _0x3ae63=0x0,_0x521802=events[_0x7af5('0x4')];_0x3ae63<_0x521802;_0x3ae63++){var _0x1c6b1e=events[_0x3ae63];var _0x162637=createListener(_0x7af5('0x5')+_0x1c6b1e,_0x47f077);FaxMessageEvents['on'](_0x1c6b1e,_0x162637);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index b5e0cb8..2ffea7f 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 _0x0713=['../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x13896c,_0x419715){var _0x5e5ef8=function(_0x4c977d){while(--_0x4c977d){_0x13896c['push'](_0x13896c['shift']());}};_0x5e5ef8(++_0x419715);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth['isAuthenticated'](),interaction[_0x3071('0x11')](_0x3071('0x12'),_0x3071('0x13')),controller[_0x3071('0x14')]);router[_0x3071('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x16')]);router['put'](_0x3071('0x17'),auth[_0x3071('0x9')](),controller['accept']);router[_0x3071('0x15')]('/:id/reject',auth[_0x3071('0x9')](),controller[_0x3071('0x18')]);router[_0x3071('0x19')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x1a')]);module[_0x3071('0x1b')]=router; \ No newline at end of file +var _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','faxmessage:create'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0x1be1,0x192));var _0x11be=function(_0x6cf303,_0x3f7d24){_0x6cf303=_0x6cf303-0x0;var _0x444d6a=_0x1be1[_0x6cf303];return _0x444d6a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('fax',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 83ad980..5c4b37e 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 _0x503a=['INTEGER','ENUM','beepall','roundrobin','exports','STRING'];(function(_0x21ab66,_0x15696b){var _0x476ab7=function(_0xbe5ccd){while(--_0xbe5ccd){_0x21ab66['push'](_0x21ab66['shift']());}};_0x476ab7(++_0x15696b);}(_0x503a,0x1b4));var _0xa503=function(_0x54fe1c,_0x5d208c){_0x54fe1c=_0x54fe1c-0x0;var _0x460aaa=_0x503a[_0x54fe1c];return _0x460aaa;};'use strict';var Sequelize=require('sequelize');module[_0xa503('0x0')]={'name':{'type':Sequelize[_0xa503('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa503('0x1')]},'timeout':{'type':Sequelize[_0xa503('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa503('0x3')]('rrmemory',_0xa503('0x4'),_0xa503('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa503('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5a12=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x517d62,_0x86df70){var _0x22cb8a=function(_0x5fe2ac){while(--_0x5fe2ac){_0x517d62['push'](_0x517d62['shift']());}};_0x22cb8a(++_0x86df70);}(_0x5a12,0x1da));var _0x25a1=function(_0x1ee1c4,_0x42696d){_0x1ee1c4=_0x1ee1c4-0x0;var _0x40274c=_0x5a12[_0x1ee1c4];return _0x40274c;};'use strict';var Sequelize=require(_0x25a1('0x0'));module[_0x25a1('0x1')]={'name':{'type':Sequelize[_0x25a1('0x2')],'unique':_0x25a1('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x25a1('0x2')]},'timeout':{'type':Sequelize[_0x25a1('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x25a1('0x5')](_0x25a1('0x6'),_0x25a1('0x7'),_0x25a1('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 15c8e6f..99d4f05 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 _0x5de9=['findOne','UserFaxQueue','nolimit','FaxQueueId','findAll','UserId','agent','faxPause','updatedAt','createdAt','SIP','Team','getTeams','hasOwnProperty','User','Agents','voicePause','flatMap','addTeams','each','forEach','ids','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','includes','all','compact','transaction','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','emit','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','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/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','getMembers'];(function(_0x49513f,_0x49a27e){var _0xc7abcc=function(_0x5d8fc3){while(--_0x5d8fc3){_0x49513f['push'](_0x49513f['shift']());}};_0xc7abcc(++_0x49a27e);}(_0x5de9,0x1d3));var _0x95de=function(_0x399ad3,_0x249e0f){_0x399ad3=_0x399ad3-0x0;var _0x290fed=_0x5de9[_0x399ad3];return _0x290fed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95de('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95de('0x1'));var rp=require(_0x95de('0x2'));var moment=require(_0x95de('0x3'));var BPromise=require(_0x95de('0x4'));var Mustache=require('mustache');var util=require(_0x95de('0x5'));var path=require(_0x95de('0x6'));var sox=require(_0x95de('0x7'));var csv=require(_0x95de('0x8'));var ejs=require(_0x95de('0x9'));var fs=require('fs');var fs_extra=require(_0x95de('0xa'));var _=require(_0x95de('0xb'));var squel=require(_0x95de('0xc'));var crypto=require(_0x95de('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x95de('0xe'));var toCsv=require('to-csv');var querystring=require(_0x95de('0xf'));var Papa=require(_0x95de('0x10'));var Redis=require('ioredis');var authService=require(_0x95de('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x95de('0x12'));var hardwareService=require(_0x95de('0x13'));var logger=require(_0x95de('0x14'))(_0x95de('0x15'));var utils=require(_0x95de('0x16'));var config=require(_0x95de('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x95de('0x18'))['db'];config[_0x95de('0x19')]=_['defaults'](config['redis'],{'host':_0x95de('0x1a'),'port':0x18eb});var socket=require(_0x95de('0x1b'))(new Redis(config['redis']));require(_0x95de('0x1c'))['register'](socket);function respondWithStatusCode(_0x173117,_0x5157ad){_0x5157ad=_0x5157ad||0xcc;return function(_0x1dc090){if(_0x1dc090){return _0x173117[_0x95de('0x1d')](_0x5157ad);}return _0x173117[_0x95de('0x1e')](_0x5157ad)[_0x95de('0x1f')]();};}function respondWithResult(_0x351189,_0x35a79c){_0x35a79c=_0x35a79c||0xc8;return function(_0x301088){if(_0x301088){return _0x351189['status'](_0x35a79c)[_0x95de('0x20')](_0x301088);}};}function respondWithFilteredResult(_0x18adb7,_0x309b6b){return function(_0x3a0e9a){if(_0x3a0e9a){var _0x5438de=typeof _0x309b6b[_0x95de('0x21')]===_0x95de('0x22')&&typeof _0x309b6b[_0x95de('0x23')]===_0x95de('0x22');var _0x3ae521=_0x3a0e9a[_0x95de('0x24')];var _0x3b8edb=_0x5438de?0x0:_0x309b6b[_0x95de('0x21')];var _0x5376b5=_0x5438de?_0x3a0e9a[_0x95de('0x24')]:_0x309b6b[_0x95de('0x21')]+_0x309b6b[_0x95de('0x23')];var _0x11b0ad;if(_0x5376b5>=_0x3ae521){_0x5376b5=_0x3ae521;_0x11b0ad=0xc8;}else{_0x11b0ad=0xce;}_0x18adb7[_0x95de('0x1e')](_0x11b0ad);return _0x18adb7[_0x95de('0x25')](_0x95de('0x26'),_0x3b8edb+'-'+_0x5376b5+'/'+_0x3ae521)[_0x95de('0x20')](_0x3a0e9a);}return null;};}function patchUpdates(_0x4517d0){return function(_0x163f04){try{jsonpatch[_0x95de('0x27')](_0x163f04,_0x4517d0,!![]);}catch(_0xc34444){return BPromise[_0x95de('0x28')](_0xc34444);}return _0x163f04[_0x95de('0x29')]();};}function saveUpdates(_0x5ccb81,_0x20515f){return function(_0x37df02){if(_0x37df02){return _0x37df02[_0x95de('0x2a')](_0x5ccb81)[_0x95de('0x2b')](function(_0x390ab3){return _0x390ab3;});}return null;};}function removeEntity(_0x1f5b75,_0x1a0462){return function(_0x191636){if(_0x191636){return _0x191636['destroy']()[_0x95de('0x2b')](function(){var _0x2270db=_0x191636[_0x95de('0x2c')]({'plain':!![]});var _0x4742a2='FaxQueues';return db[_0x95de('0x2d')][_0x95de('0x2e')]({'where':{'type':_0x4742a2,'resourceId':_0x2270db['id']}})[_0x95de('0x2b')](function(){return _0x191636;});})[_0x95de('0x2b')](function(){_0x1f5b75[_0x95de('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ada8,_0x57f65a){return function(_0x4d9f59){if(!_0x4d9f59){_0x47ada8['sendStatus'](0x194);}return _0x4d9f59;};}function handleError(_0x39bba8,_0x581873){_0x581873=_0x581873||0x1f4;return function(_0x548a21){logger[_0x95de('0x2f')](_0x548a21[_0x95de('0x30')]);if(_0x548a21[_0x95de('0x31')]){delete _0x548a21[_0x95de('0x31')];}_0x39bba8[_0x95de('0x1e')](_0x581873)['send'](_0x548a21);};}exports[_0x95de('0x32')]=function(_0xae75a6,_0x4c6cf3){var _0x557b9c={},_0x488938={},_0x26ee90={'count':0x0,'rows':[]};var _0x3088ae=_[_0x95de('0x33')](db[_0x95de('0x34')][_0x95de('0x35')],function(_0x5ddd6f){return{'name':_0x5ddd6f[_0x95de('0x36')],'type':_0x5ddd6f['type'][_0x95de('0x37')]};});_0x488938[_0x95de('0x38')]=_[_0x95de('0x33')](_0x3088ae,_0x95de('0x31'));_0x488938[_0x95de('0x39')]=_[_0x95de('0x3a')](_0xae75a6[_0x95de('0x39')]);_0x488938[_0x95de('0x3b')]=_[_0x95de('0x3c')](_0x488938[_0x95de('0x38')],_0x488938[_0x95de('0x39')]);_0x557b9c[_0x95de('0x3d')]=_[_0x95de('0x3c')](_0x488938[_0x95de('0x38')],qs['fields'](_0xae75a6[_0x95de('0x39')][_0x95de('0x3e')]));_0x557b9c[_0x95de('0x3d')]=_0x557b9c[_0x95de('0x3d')][_0x95de('0x3f')]?_0x557b9c[_0x95de('0x3d')]:_0x488938[_0x95de('0x38')];if(!_0xae75a6['query']['hasOwnProperty']('nolimit')){_0x557b9c['limit']=qs[_0x95de('0x23')](_0xae75a6[_0x95de('0x39')][_0x95de('0x23')]);_0x557b9c['offset']=qs[_0x95de('0x21')](_0xae75a6[_0x95de('0x39')]['offset']);}_0x557b9c[_0x95de('0x40')]=qs[_0x95de('0x41')](_0xae75a6[_0x95de('0x39')][_0x95de('0x41')]);_0x557b9c[_0x95de('0x42')]=qs[_0x95de('0x3b')](_[_0x95de('0x43')](_0xae75a6[_0x95de('0x39')],_0x488938[_0x95de('0x3b')]),_0x3088ae);if(_0xae75a6[_0x95de('0x39')][_0x95de('0x44')]){_0x557b9c[_0x95de('0x42')]=_[_0x95de('0x45')](_0x557b9c[_0x95de('0x42')],{'$or':_[_0x95de('0x33')](_0x3088ae,function(_0x1c00b0){if(_0x1c00b0[_0x95de('0x46')]!==_0x95de('0x47')){var _0x2153b8={};_0x2153b8[_0x1c00b0[_0x95de('0x31')]]={'$like':'%'+_0xae75a6[_0x95de('0x39')][_0x95de('0x44')]+'%'};return _0x2153b8;}})});}_0x557b9c=_[_0x95de('0x45')]({},_0x557b9c,_0xae75a6[_0x95de('0x48')]);var _0x512dda={'where':_0x557b9c[_0x95de('0x42')]};return db[_0x95de('0x34')][_0x95de('0x24')](_0x512dda)[_0x95de('0x2b')](function(_0x3fa4f5){_0x26ee90[_0x95de('0x24')]=_0x3fa4f5;if(_0xae75a6[_0x95de('0x39')][_0x95de('0x49')]){_0x557b9c[_0x95de('0x4a')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x557b9c);})[_0x95de('0x2b')](function(_0x4f690d){_0x26ee90[_0x95de('0x4b')]=_0x4f690d;return _0x26ee90;})['then'](respondWithFilteredResult(_0x4c6cf3,_0x557b9c))[_0x95de('0x4c')](handleError(_0x4c6cf3,null));};exports[_0x95de('0x4d')]=function(_0x1670de,_0x38619b){var _0x3bec8c={'raw':!![],'where':{'id':_0x1670de['params']['id']}},_0x668fb6={};_0x668fb6[_0x95de('0x38')]=_[_0x95de('0x3a')](db[_0x95de('0x34')][_0x95de('0x35')]);_0x668fb6[_0x95de('0x39')]=_[_0x95de('0x3a')](_0x1670de[_0x95de('0x39')]);_0x668fb6[_0x95de('0x3b')]=_['intersection'](_0x668fb6['model'],_0x668fb6['query']);_0x3bec8c['attributes']=_['intersection'](_0x668fb6['model'],qs[_0x95de('0x3e')](_0x1670de[_0x95de('0x39')]['fields']));_0x3bec8c[_0x95de('0x3d')]=_0x3bec8c[_0x95de('0x3d')][_0x95de('0x3f')]?_0x3bec8c[_0x95de('0x3d')]:_0x668fb6['model'];if(_0x1670de[_0x95de('0x39')][_0x95de('0x49')]){_0x3bec8c[_0x95de('0x4a')]=[{'all':!![]}];}_0x3bec8c=_[_0x95de('0x45')]({},_0x3bec8c,_0x1670de[_0x95de('0x48')]);return db[_0x95de('0x34')][_0x95de('0x4e')](_0x3bec8c)[_0x95de('0x2b')](handleEntityNotFound(_0x38619b,null))[_0x95de('0x2b')](respondWithResult(_0x38619b,null))[_0x95de('0x4c')](handleError(_0x38619b,null));};exports[_0x95de('0x4f')]=function(_0x44ef16,_0x137221){return db['FaxQueue'][_0x95de('0x4f')](_0x44ef16[_0x95de('0x50')],{})['then'](function(_0x35adb7){var _0x3c9b1d=_0x44ef16[_0x95de('0x51')][_0x95de('0x2c')]({'plain':!![]});if(!_0x3c9b1d)throw new Error(_0x95de('0x52'));if(_0x3c9b1d[_0x95de('0x53')]===_0x95de('0x51')){var _0x130e79=_0x35adb7['get']({'plain':!![]});var _0x1b851e='FaxQueues';return db[_0x95de('0x54')][_0x95de('0x4e')]({'where':{'name':_0x1b851e,'userProfileId':_0x3c9b1d[_0x95de('0x55')]},'raw':!![]})['then'](function(_0x5a22a0){if(_0x5a22a0&&_0x5a22a0[_0x95de('0x56')]===0x0){return db[_0x95de('0x2d')][_0x95de('0x4f')]({'name':_0x130e79[_0x95de('0x31')],'resourceId':_0x130e79['id'],'type':_0x5a22a0[_0x95de('0x31')],'sectionId':_0x5a22a0['id']},{})['then'](function(){return _0x35adb7;});}else{return _0x35adb7;}})[_0x95de('0x4c')](function(_0x3ec75a){logger[_0x95de('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ec75a);throw _0x3ec75a;});}return _0x35adb7;})[_0x95de('0x2b')](respondWithResult(_0x137221,0xc9))[_0x95de('0x4c')](handleError(_0x137221,null));};exports[_0x95de('0x2a')]=function(_0x77ce27,_0xa2093d){if(_0x77ce27['body']['id']){delete _0x77ce27[_0x95de('0x50')]['id'];}return db[_0x95de('0x34')][_0x95de('0x4e')]({'where':{'id':_0x77ce27[_0x95de('0x57')]['id']}})[_0x95de('0x2b')](handleEntityNotFound(_0xa2093d,null))[_0x95de('0x2b')](saveUpdates(_0x77ce27[_0x95de('0x50')],null))['then'](respondWithResult(_0xa2093d,null))['catch'](handleError(_0xa2093d,null));};exports[_0x95de('0x2e')]=function(_0x4e0d6c,_0x143e72){return db[_0x95de('0x34')][_0x95de('0x4e')]({'where':{'id':_0x4e0d6c['params']['id']}})['then'](handleEntityNotFound(_0x143e72,null))[_0x95de('0x2b')](removeEntity(_0x143e72,null))[_0x95de('0x4c')](handleError(_0x143e72,null));};exports['describe']=function(_0x1fca1a,_0x444d17){return db['FaxQueue']['describe']()[_0x95de('0x2b')](respondWithResult(_0x444d17,null))[_0x95de('0x4c')](handleError(_0x444d17,null));};exports[_0x95de('0x58')]=function(_0x1b4f0a,_0xa91fe4,_0x4d4b8a){var _0x1caffe={'raw':!![],'where':{}},_0x4e2698={},_0x34f952;return db[_0x95de('0x34')][_0x95de('0x59')]({'where':{'id':_0x1b4f0a[_0x95de('0x57')]['id']}})[_0x95de('0x2b')](handleEntityNotFound(_0xa91fe4,null))[_0x95de('0x2b')](function(_0x415845){if(_0x415845){_0x34f952=_0x415845[_0x95de('0x2c')]({'plain':!![]});_0x4e2698[_0x95de('0x38')]=_[_0x95de('0x3a')](db[_0x95de('0x5a')][_0x95de('0x35')]);_0x4e2698[_0x95de('0x39')]=_[_0x95de('0x3a')](_0x1b4f0a[_0x95de('0x39')]);_0x4e2698[_0x95de('0x3b')]=_[_0x95de('0x3c')](_0x4e2698[_0x95de('0x38')],_0x4e2698['query']);_0x1caffe['attributes']=_['intersection'](_0x4e2698['model'],qs[_0x95de('0x3e')](_0x1b4f0a[_0x95de('0x39')][_0x95de('0x3e')]));_0x1caffe['attributes']=_0x1caffe[_0x95de('0x3d')][_0x95de('0x3f')]?_0x1caffe[_0x95de('0x3d')]:_0x4e2698[_0x95de('0x38')];if(!_0x1b4f0a[_0x95de('0x39')]['hasOwnProperty'](_0x95de('0x5b'))){_0x1caffe[_0x95de('0x23')]=qs[_0x95de('0x23')](_0x1b4f0a[_0x95de('0x39')][_0x95de('0x23')]);_0x1caffe[_0x95de('0x21')]=qs[_0x95de('0x21')](_0x1b4f0a[_0x95de('0x39')][_0x95de('0x21')]);}_0x1caffe['order']=qs[_0x95de('0x41')](_0x1b4f0a[_0x95de('0x39')][_0x95de('0x41')]);_0x1caffe[_0x95de('0x42')]=qs[_0x95de('0x3b')](_[_0x95de('0x43')](_0x1b4f0a['query'],_0x4e2698[_0x95de('0x3b')]));_0x1caffe[_0x95de('0x42')][_0x95de('0x5c')]=_0x415845['id'];if(_0x1b4f0a[_0x95de('0x39')]['filter']){_0x1caffe[_0x95de('0x42')]=_[_0x95de('0x45')](_0x1caffe[_0x95de('0x42')],{'$or':_['map'](_0x1caffe['attributes'],function(_0x5a646a){var _0x43445f={};_0x43445f[_0x5a646a]={'$like':'%'+_0x1b4f0a[_0x95de('0x39')]['filter']+'%'};return _0x43445f;})});}_0x1caffe=_['merge']({},_0x1caffe,_0x1b4f0a['options']);return db[_0x95de('0x5a')][_0x95de('0x5d')](_0x1caffe);}})[_0x95de('0x2b')](function(_0x171a41){if(_0x171a41){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x171a41,_0x95de('0x5e')),'role':_0x95de('0x5f')},'attributes':['id',_0x95de('0x31'),_0x95de('0x60'),_0x95de('0x61'),_0x95de('0x62')]});}})[_0x95de('0x2b')](function(_0x591862){if(_0x591862){return{'count':_0x591862[_0x95de('0x24')],'rows':_[_0x95de('0x33')](_0x591862[_0x95de('0x4b')],function(_0x171c0f){return{'membername':_0x171c0f[_0x95de('0x31')],'UserId':_0x171c0f['id'],'queue_name':_0x34f952[_0x95de('0x31')],'FaxQueueId':_0x34f952['id'],'interface':util['format']('%s/%s',_0x95de('0x63'),_0x171c0f[_0x95de('0x31')]),'penalty':0x0,'paused':_0x171c0f['faxPause'],'createdAt':_0x171c0f[_0x95de('0x62')],'updatedAt':_0x171c0f[_0x95de('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x95de('0x2b')](respondWithFilteredResult(_0xa91fe4,_0x1caffe))[_0x95de('0x4c')](handleError(_0xa91fe4,null));};exports['getTeams']=function(_0x1ac592,_0x3dffda,_0xbb5b62){var _0x58927e={};var _0x3bca80={};var _0x2747da;var _0x2dbfe2;return db['FaxQueue'][_0x95de('0x59')]({'where':{'id':_0x1ac592['params']['id']}})[_0x95de('0x2b')](handleEntityNotFound(_0x3dffda,null))['then'](function(_0x3918cb){if(_0x3918cb){_0x2747da=_0x3918cb;_0x3bca80[_0x95de('0x38')]=_[_0x95de('0x3a')](db[_0x95de('0x64')][_0x95de('0x35')]);_0x3bca80[_0x95de('0x39')]=_[_0x95de('0x3a')](_0x1ac592[_0x95de('0x39')]);_0x3bca80[_0x95de('0x3b')]=_[_0x95de('0x3c')](_0x3bca80[_0x95de('0x38')],_0x3bca80[_0x95de('0x39')]);_0x58927e['attributes']=_[_0x95de('0x3c')](_0x3bca80['model'],qs['fields'](_0x1ac592[_0x95de('0x39')]['fields']));_0x58927e['attributes']=_0x58927e[_0x95de('0x3d')][_0x95de('0x3f')]?_0x58927e[_0x95de('0x3d')]:_0x3bca80[_0x95de('0x38')];_0x58927e['order']=qs[_0x95de('0x41')](_0x1ac592[_0x95de('0x39')][_0x95de('0x41')]);_0x58927e[_0x95de('0x42')]=qs[_0x95de('0x3b')](_[_0x95de('0x43')](_0x1ac592[_0x95de('0x39')],_0x3bca80[_0x95de('0x3b')]));if(_0x1ac592[_0x95de('0x39')]['filter']){_0x58927e[_0x95de('0x42')]=_[_0x95de('0x45')](_0x58927e[_0x95de('0x42')],{'$or':_['map'](_0x58927e[_0x95de('0x3d')],function(_0x4d7488){var _0x232795={};_0x232795[_0x4d7488]={'$like':'%'+_0x1ac592[_0x95de('0x39')][_0x95de('0x44')]+'%'};return _0x232795;})});}_0x58927e=_[_0x95de('0x45')]({},_0x58927e,_0x1ac592[_0x95de('0x48')]);return _0x2747da[_0x95de('0x65')](_0x58927e);}})[_0x95de('0x2b')](function(_0x3e2715){if(_0x3e2715){_0x2dbfe2=_0x3e2715[_0x95de('0x3f')];if(!_0x1ac592[_0x95de('0x39')][_0x95de('0x66')]('nolimit')){_0x58927e['limit']=qs[_0x95de('0x23')](_0x1ac592[_0x95de('0x39')][_0x95de('0x23')]);_0x58927e[_0x95de('0x21')]=qs[_0x95de('0x21')](_0x1ac592['query'][_0x95de('0x21')]);}return _0x2747da[_0x95de('0x65')](_0x58927e);}})['then'](function(_0x5b1043){if(_0x5b1043){return _0x5b1043?{'count':_0x2dbfe2,'rows':_0x5b1043}:null;}})[_0x95de('0x2b')](respondWithResult(_0x3dffda,null))['catch'](handleError(_0x3dffda,null));};exports['addTeams']=function(_0x3092cb,_0x218ae5,_0x1b7e89){var _0x521651=_0x3092cb[_0x95de('0x50')]['ids'];return db['Team'][_0x95de('0x5d')]({'where':{'id':_0x521651},'attributes':['id'],'include':[{'model':db[_0x95de('0x67')],'as':_0x95de('0x68'),'attributes':['id',_0x95de('0x31'),'online',_0x95de('0x69'),'interface'],'raw':!![]}]})[_0x95de('0x2b')](function(_0x534d31){if(_0x534d31){var _0x408ee5=_[_0x95de('0x6a')](_0x534d31,function(_0x57cdc0){var _0x28c68a=_0x57cdc0[_0x95de('0x2c')]({'plain':!![]});return _0x28c68a['Agents'];});return db['FaxQueue']['find']({'where':{'id':_0x3092cb[_0x95de('0x57')]['id']}})[_0x95de('0x2b')](function(_0x26d57e){return db['sequelize']['transaction'](function(_0x2c8f9a){return _0x26d57e[_0x95de('0x6b')](_0x521651,{'transaction':_0x2c8f9a})['then'](function(){return BPromise[_0x95de('0x6c')](_0x408ee5,function(_0x467890){return db[_0x95de('0x5a')]['findOrCreate']({'where':{'UserId':_0x467890['id'],'FaxQueueId':_0x3092cb['params']['id']},'transaction':_0x2c8f9a});});})[_0x95de('0x2b')](function(){_0x408ee5[_0x95de('0x6d')](function(_0x248e0f){socket['emit']('userFaxQueue:save',{'UserId':_0x248e0f['id'],'FaxQueueId':_0x26d57e['id']});});});});});}})[_0x95de('0x2b')](respondWithStatusCode(_0x218ae5,null))[_0x95de('0x4c')](handleError(_0x218ae5,null));};exports['removeTeams']=function(_0x3cf401,_0x202aa2,_0x3a51e7){return db[_0x95de('0x64')]['findAll']({'where':{'id':_0x3cf401[_0x95de('0x39')][_0x95de('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x95de('0x67')],'as':_0x95de('0x68'),'attributes':['id'],'raw':!![]}]})[_0x95de('0x2b')](handleEntityNotFound(_0x202aa2,null))[_0x95de('0x2b')](function(_0x3a02fc){var _0xf8c620=_[_0x95de('0x33')](_0x3a02fc,'id');var _0x429b2c=[];var _0x1528ec=[];var _0x3b2110=squel[_0x95de('0x6f')]();_0x3b2110[_0x95de('0x70')](_0x95de('0x71'))[_0x95de('0x72')](_0x95de('0x73'),'tq')[_0x95de('0x74')](_0x95de('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x95de('0x42')]('FaxQueueId\x20=\x20?',_0x3cf401[_0x95de('0x57')]['id']);for(var _0x541f3b=0x0;_0x541f3b<_0x3a02fc['length'];_0x541f3b+=0x1){let _0x441d6b=_0x3a02fc[_0x541f3b];for(var _0x4e6b38=0x0;_0x4e6b38<_0x441d6b['Agents'][_0x95de('0x3f')];_0x4e6b38+=0x1){let _0x409dd1=_0x441d6b[_0x95de('0x68')][_0x4e6b38];var _0x70752e=_0x3b2110[_0x95de('0x76')]();_0x70752e[_0x95de('0x42')](_0x95de('0x77'),_0x409dd1['id']);_0x1528ec[_0x95de('0x78')](db[_0x95de('0x79')]['query'](_0x70752e['toString'](),{'type':db[_0x95de('0x79')]['QueryTypes'][_0x95de('0x7a')]})[_0x95de('0x2b')](function(_0xe608c9){if(_0xe608c9[_0x95de('0x3f')]===0x1){return _0x409dd1['id'];}else{var _0x6a0b25=_[_0x95de('0x7b')](_[_0x95de('0x33')](_0xe608c9,'TeamId'),function(_0x318e61){return _[_0x95de('0x7c')](_0xf8c620,_0x318e61);});if(_0x6a0b25){return _0x409dd1['id'];}}}));}}return BPromise[_0x95de('0x7d')](_0x1528ec)[_0x95de('0x2b')](function(_0x33b0dd){_0x429b2c=_(_0x429b2c)['union'](_0x33b0dd)[_0x95de('0x7e')]()['value']();return db[_0x95de('0x34')][_0x95de('0x4e')]({'where':{'id':_0x3cf401[_0x95de('0x57')]['id']}})['then'](function(_0x402980){return db['sequelize'][_0x95de('0x7f')](function(_0x536b68){return _0x402980[_0x95de('0x80')](_0x3cf401[_0x95de('0x39')][_0x95de('0x6e')],{'transaction':_0x536b68})[_0x95de('0x2b')](function(){if(!_[_0x95de('0x81')](_0x429b2c)){return _0x402980['removeAgents'](_0x429b2c,{'transaction':_0x536b68});}})[_0x95de('0x2b')](function(){_0x429b2c[_0x95de('0x6d')](function(_0x3c8134){socket['emit'](_0x95de('0x82'),{'UserId':_0x3c8134,'FaxQueueId':_0x402980['id']});});});});});});})['then'](respondWithStatusCode(_0x202aa2,null))[_0x95de('0x4c')](handleError(_0x202aa2,null));};exports[_0x95de('0x83')]=function(_0x3770fa,_0x18c530,_0x424959){return db[_0x95de('0x34')][_0x95de('0x4e')]({'where':{'id':_0x3770fa[_0x95de('0x57')]['id']}})[_0x95de('0x2b')](handleEntityNotFound(_0x18c530,null))[_0x95de('0x2b')](function(_0x5170b0){if(_0x5170b0){return _0x5170b0[_0x95de('0x83')](_0x3770fa[_0x95de('0x50')]['ids'],_[_0x95de('0x84')](_0x3770fa[_0x95de('0x50')],[_0x95de('0x6e'),'id'])||{})[_0x95de('0x85')](function(_0x224dce){for(var _0x1e4a94=0x0;_0x1e4a94<_0x3770fa[_0x95de('0x50')][_0x95de('0x6e')][_0x95de('0x3f')];_0x1e4a94+=0x1){socket['emit'](_0x95de('0x86'),{'UserId':Number(_0x3770fa[_0x95de('0x50')][_0x95de('0x6e')][_0x1e4a94]),'FaxQueueId':Number(_0x3770fa[_0x95de('0x57')]['id'])});}return _0x224dce;});}})['then'](respondWithResult(_0x18c530,null))[_0x95de('0x4c')](handleError(_0x18c530,null));};exports[_0x95de('0x87')]=function(_0x13d79b,_0x4b6671,_0x2c3384){return db[_0x95de('0x34')][_0x95de('0x4e')]({'where':{'id':_0x13d79b['params']['id']}})['then'](handleEntityNotFound(_0x4b6671,null))['then'](function(_0x2bb9b8){if(_0x2bb9b8){return _0x2bb9b8[_0x95de('0x87')](_0x13d79b[_0x95de('0x39')][_0x95de('0x6e')])[_0x95de('0x2b')](function(){if(_[_0x95de('0x88')](_0x13d79b[_0x95de('0x39')][_0x95de('0x6e')])){for(var _0x60e127=0x0;_0x60e127<_0x13d79b[_0x95de('0x39')][_0x95de('0x6e')][_0x95de('0x3f')];_0x60e127+=0x1){socket[_0x95de('0x89')](_0x95de('0x82'),{'UserId':Number(_0x13d79b['query'][_0x95de('0x6e')][_0x60e127]),'FaxQueueId':Number(_0x13d79b[_0x95de('0x57')]['id'])});}}else{socket[_0x95de('0x89')](_0x95de('0x82'),{'UserId':Number(_0x13d79b['query'][_0x95de('0x6e')]),'FaxQueueId':Number(_0x13d79b[_0x95de('0x57')]['id'])});}});}})[_0x95de('0x2b')](respondWithStatusCode(_0x4b6671,null))[_0x95de('0x4c')](handleError(_0x4b6671,null));};exports['getAgents']=function(_0x17253a,_0x18eead,_0x16120e){var _0x168aa7={};var _0x172cec={};var _0x41509d;var _0x3af148;return db['FaxQueue']['findOne']({'where':{'id':_0x17253a[_0x95de('0x57')]['id']}})[_0x95de('0x2b')](handleEntityNotFound(_0x18eead,null))[_0x95de('0x2b')](function(_0x267f9e){if(_0x267f9e){_0x41509d=_0x267f9e;_0x172cec['model']=_['keys'](db['User'][_0x95de('0x35')]);_0x172cec[_0x95de('0x39')]=_[_0x95de('0x3a')](_0x17253a[_0x95de('0x39')]);_0x172cec[_0x95de('0x3b')]=_[_0x95de('0x3c')](_0x172cec['model'],_0x172cec[_0x95de('0x39')]);_0x168aa7[_0x95de('0x3d')]=_[_0x95de('0x3c')](_0x172cec[_0x95de('0x38')],qs[_0x95de('0x3e')](_0x17253a[_0x95de('0x39')][_0x95de('0x3e')]));_0x168aa7[_0x95de('0x3d')]=_0x168aa7[_0x95de('0x3d')]['length']?_0x168aa7[_0x95de('0x3d')]:_0x172cec['model'];_0x168aa7[_0x95de('0x40')]=qs[_0x95de('0x41')](_0x17253a['query'][_0x95de('0x41')]);_0x168aa7[_0x95de('0x42')]=qs['filters'](_[_0x95de('0x43')](_0x17253a[_0x95de('0x39')],_0x172cec[_0x95de('0x3b')]));if(_0x17253a[_0x95de('0x39')][_0x95de('0x44')]){_0x168aa7[_0x95de('0x42')]=_['merge'](_0x168aa7[_0x95de('0x42')],{'$or':_[_0x95de('0x33')](_0x168aa7[_0x95de('0x3d')],function(_0x3a3dc7){var _0x9f4d27={};_0x9f4d27[_0x3a3dc7]={'$like':'%'+_0x17253a[_0x95de('0x39')][_0x95de('0x44')]+'%'};return _0x9f4d27;})});}_0x168aa7=_[_0x95de('0x45')]({},_0x168aa7,_0x17253a[_0x95de('0x48')]);return _0x41509d[_0x95de('0x8a')](_0x168aa7);}})[_0x95de('0x2b')](function(_0x2b016c){if(_0x2b016c){_0x3af148=_0x2b016c[_0x95de('0x3f')];if(!_0x17253a[_0x95de('0x39')][_0x95de('0x66')]('nolimit')){_0x168aa7[_0x95de('0x23')]=qs[_0x95de('0x23')](_0x17253a[_0x95de('0x39')][_0x95de('0x23')]);_0x168aa7[_0x95de('0x21')]=qs[_0x95de('0x21')](_0x17253a[_0x95de('0x39')][_0x95de('0x21')]);}return _0x41509d[_0x95de('0x8a')](_0x168aa7);}})[_0x95de('0x2b')](function(_0x5a24bf){if(_0x5a24bf){return _0x5a24bf?{'count':_0x3af148,'rows':_0x5a24bf}:null;}})[_0x95de('0x2b')](respondWithResult(_0x18eead,null))[_0x95de('0x4c')](handleError(_0x18eead,null));}; \ No newline at end of file +var _0xa09c=['push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','offset','limit','count','set','save','destroy','then','FaxQueues','UserProfileResource','end','error','stack','send','index','map','FaxQueue','rawAttributes','fieldName','type','model','name','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','params','keys','filters','include','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','hasOwnProperty','ids','Agents','online','interface','flatMap','sequelize','transaction','addTeams','forEach','emit','userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?'];(function(_0x50fb34,_0x56b847){var _0x478797=function(_0x2a45df){while(--_0x2a45df){_0x50fb34['push'](_0x50fb34['shift']());}};_0x478797(++_0x56b847);}(_0xa09c,0x125));var _0xca09=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xa09c[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca09('0x0'));var zipdir=require(_0xca09('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca09('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xca09('0x3'));var util=require(_0xca09('0x4'));var path=require(_0xca09('0x5'));var sox=require(_0xca09('0x6'));var csv=require(_0xca09('0x7'));var ejs=require(_0xca09('0x8'));var fs=require('fs');var fs_extra=require(_0xca09('0x9'));var _=require(_0xca09('0xa'));var squel=require(_0xca09('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xca09('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca09('0xd'));var Redis=require('ioredis');var authService=require(_0xca09('0xe'));var qs=require(_0xca09('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca09('0x10'));var logger=require('../../config/logger')(_0xca09('0x11'));var utils=require(_0xca09('0x12'));var config=require(_0xca09('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xca09('0x14'))['db'];config[_0xca09('0x15')]=_[_0xca09('0x16')](config[_0xca09('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xca09('0x17'))(new Redis(config[_0xca09('0x15')]));require(_0xca09('0x18'))[_0xca09('0x19')](socket);function respondWithStatusCode(_0x203637,_0x31f3a3){_0x31f3a3=_0x31f3a3||0xcc;return function(_0x500cb9){if(_0x500cb9){return _0x203637[_0xca09('0x1a')](_0x31f3a3);}return _0x203637[_0xca09('0x1b')](_0x31f3a3)['end']();};}function respondWithResult(_0x28f61d,_0x19f0eb){_0x19f0eb=_0x19f0eb||0xc8;return function(_0x185b94){if(_0x185b94){return _0x28f61d[_0xca09('0x1b')](_0x19f0eb)[_0xca09('0x1c')](_0x185b94);}};}function respondWithFilteredResult(_0x27b612,_0xcb2004){return function(_0x56b799){if(_0x56b799){var _0x58f139=typeof _0xcb2004[_0xca09('0x1d')]==='undefined'&&typeof _0xcb2004[_0xca09('0x1e')]==='undefined';var _0x387d2e=_0x56b799[_0xca09('0x1f')];var _0x6439fa=_0x58f139?0x0:_0xcb2004[_0xca09('0x1d')];var _0x4bb206=_0x58f139?_0x56b799[_0xca09('0x1f')]:_0xcb2004[_0xca09('0x1d')]+_0xcb2004[_0xca09('0x1e')];var _0x225f71;if(_0x4bb206>=_0x387d2e){_0x4bb206=_0x387d2e;_0x225f71=0xc8;}else{_0x225f71=0xce;}_0x27b612['status'](_0x225f71);return _0x27b612[_0xca09('0x20')]('Content-Range',_0x6439fa+'-'+_0x4bb206+'/'+_0x387d2e)['json'](_0x56b799);}return null;};}function patchUpdates(_0x4d8221){return function(_0x530f67){try{jsonpatch['apply'](_0x530f67,_0x4d8221,!![]);}catch(_0x480bf2){return BPromise['reject'](_0x480bf2);}return _0x530f67[_0xca09('0x21')]();};}function saveUpdates(_0x24ae36,_0x1a29d5){return function(_0x3ddb34){if(_0x3ddb34){return _0x3ddb34['update'](_0x24ae36)['then'](function(_0xf8f68c){return _0xf8f68c;});}return null;};}function removeEntity(_0x410381,_0x5c5f03){return function(_0x370317){if(_0x370317){return _0x370317[_0xca09('0x22')]()[_0xca09('0x23')](function(){var _0xcf749e=_0x370317['get']({'plain':!![]});var _0x499bb7=_0xca09('0x24');return db[_0xca09('0x25')][_0xca09('0x22')]({'where':{'type':_0x499bb7,'resourceId':_0xcf749e['id']}})[_0xca09('0x23')](function(){return _0x370317;});})['then'](function(){_0x410381['status'](0xcc)[_0xca09('0x26')]();});}};}function handleEntityNotFound(_0xd3fc57,_0x1152ba){return function(_0x2cf655){if(!_0x2cf655){_0xd3fc57[_0xca09('0x1a')](0x194);}return _0x2cf655;};}function handleError(_0x5b5d6d,_0x2540ed){_0x2540ed=_0x2540ed||0x1f4;return function(_0x57d31d){logger[_0xca09('0x27')](_0x57d31d[_0xca09('0x28')]);if(_0x57d31d['name']){delete _0x57d31d['name'];}_0x5b5d6d[_0xca09('0x1b')](_0x2540ed)[_0xca09('0x29')](_0x57d31d);};}exports[_0xca09('0x2a')]=function(_0x3f0638,_0x55cf01){var _0x279f6d={},_0x32eae2={},_0x9b0a35={'count':0x0,'rows':[]};var _0x57f227=_[_0xca09('0x2b')](db[_0xca09('0x2c')][_0xca09('0x2d')],function(_0x25533c){return{'name':_0x25533c[_0xca09('0x2e')],'type':_0x25533c[_0xca09('0x2f')]['key']};});_0x32eae2[_0xca09('0x30')]=_['map'](_0x57f227,_0xca09('0x31'));_0x32eae2[_0xca09('0x32')]=_['keys'](_0x3f0638['query']);_0x32eae2['filters']=_[_0xca09('0x33')](_0x32eae2[_0xca09('0x30')],_0x32eae2['query']);_0x279f6d[_0xca09('0x34')]=_['intersection'](_0x32eae2[_0xca09('0x30')],qs[_0xca09('0x35')](_0x3f0638[_0xca09('0x32')]['fields']));_0x279f6d[_0xca09('0x34')]=_0x279f6d[_0xca09('0x34')][_0xca09('0x36')]?_0x279f6d[_0xca09('0x34')]:_0x32eae2[_0xca09('0x30')];if(!_0x3f0638['query']['hasOwnProperty'](_0xca09('0x37'))){_0x279f6d[_0xca09('0x1e')]=qs['limit'](_0x3f0638[_0xca09('0x32')][_0xca09('0x1e')]);_0x279f6d[_0xca09('0x1d')]=qs[_0xca09('0x1d')](_0x3f0638[_0xca09('0x32')][_0xca09('0x1d')]);}_0x279f6d[_0xca09('0x38')]=qs[_0xca09('0x39')](_0x3f0638[_0xca09('0x32')][_0xca09('0x39')]);_0x279f6d[_0xca09('0x3a')]=qs['filters'](_[_0xca09('0x3b')](_0x3f0638[_0xca09('0x32')],_0x32eae2['filters']),_0x57f227);if(_0x3f0638['query'][_0xca09('0x3c')]){_0x279f6d[_0xca09('0x3a')]=_['merge'](_0x279f6d[_0xca09('0x3a')],{'$or':_['map'](_0x57f227,function(_0x16a3c6){if(_0x16a3c6[_0xca09('0x2f')]!==_0xca09('0x3d')){var _0x9f0ab6={};_0x9f0ab6[_0x16a3c6['name']]={'$like':'%'+_0x3f0638[_0xca09('0x32')][_0xca09('0x3c')]+'%'};return _0x9f0ab6;}})});}_0x279f6d=_['merge']({},_0x279f6d,_0x3f0638[_0xca09('0x3e')]);var _0x4582c7={'where':_0x279f6d['where']};return db[_0xca09('0x2c')][_0xca09('0x1f')](_0x4582c7)[_0xca09('0x23')](function(_0x1e5c59){_0x9b0a35['count']=_0x1e5c59;if(_0x3f0638['query'][_0xca09('0x3f')]){_0x279f6d['include']=[{'all':!![]}];}return db['FaxQueue'][_0xca09('0x40')](_0x279f6d);})[_0xca09('0x23')](function(_0x3af279){_0x9b0a35[_0xca09('0x41')]=_0x3af279;return _0x9b0a35;})[_0xca09('0x23')](respondWithFilteredResult(_0x55cf01,_0x279f6d))['catch'](handleError(_0x55cf01,null));};exports['show']=function(_0x441f1e,_0x170fdb){var _0x1281fc={'raw':!![],'where':{'id':_0x441f1e[_0xca09('0x42')]['id']}},_0x3b0094={};_0x3b0094[_0xca09('0x30')]=_[_0xca09('0x43')](db[_0xca09('0x2c')]['rawAttributes']);_0x3b0094[_0xca09('0x32')]=_['keys'](_0x441f1e['query']);_0x3b0094[_0xca09('0x44')]=_['intersection'](_0x3b0094[_0xca09('0x30')],_0x3b0094[_0xca09('0x32')]);_0x1281fc['attributes']=_[_0xca09('0x33')](_0x3b0094[_0xca09('0x30')],qs[_0xca09('0x35')](_0x441f1e[_0xca09('0x32')][_0xca09('0x35')]));_0x1281fc[_0xca09('0x34')]=_0x1281fc['attributes'][_0xca09('0x36')]?_0x1281fc[_0xca09('0x34')]:_0x3b0094[_0xca09('0x30')];if(_0x441f1e[_0xca09('0x32')][_0xca09('0x3f')]){_0x1281fc[_0xca09('0x45')]=[{'all':!![]}];}_0x1281fc=_[_0xca09('0x46')]({},_0x1281fc,_0x441f1e[_0xca09('0x3e')]);return db[_0xca09('0x2c')][_0xca09('0x47')](_0x1281fc)[_0xca09('0x23')](handleEntityNotFound(_0x170fdb,null))[_0xca09('0x23')](respondWithResult(_0x170fdb,null))[_0xca09('0x48')](handleError(_0x170fdb,null));};exports['create']=function(_0x2139e9,_0x124943){return db['FaxQueue'][_0xca09('0x49')](_0x2139e9[_0xca09('0x4a')],{})[_0xca09('0x23')](function(_0x8fd52a){var _0x27546c=_0x2139e9[_0xca09('0x4b')][_0xca09('0x4c')]({'plain':!![]});if(!_0x27546c)throw new Error(_0xca09('0x4d'));if(_0x27546c[_0xca09('0x4e')]===_0xca09('0x4b')){var _0x30ce8f=_0x8fd52a['get']({'plain':!![]});var _0x5335b4='FaxQueues';return db[_0xca09('0x4f')][_0xca09('0x47')]({'where':{'name':_0x5335b4,'userProfileId':_0x27546c['userProfileId']},'raw':!![]})[_0xca09('0x23')](function(_0x1f85ee){if(_0x1f85ee&&_0x1f85ee[_0xca09('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x30ce8f['name'],'resourceId':_0x30ce8f['id'],'type':_0x1f85ee[_0xca09('0x31')],'sectionId':_0x1f85ee['id']},{})[_0xca09('0x23')](function(){return _0x8fd52a;});}else{return _0x8fd52a;}})[_0xca09('0x48')](function(_0x363797){logger[_0xca09('0x27')](_0xca09('0x51'),_0x363797);throw _0x363797;});}return _0x8fd52a;})['then'](respondWithResult(_0x124943,0xc9))[_0xca09('0x48')](handleError(_0x124943,null));};exports['update']=function(_0xbedaa8,_0x56970d){if(_0xbedaa8['body']['id']){delete _0xbedaa8['body']['id'];}return db[_0xca09('0x2c')][_0xca09('0x47')]({'where':{'id':_0xbedaa8[_0xca09('0x42')]['id']}})[_0xca09('0x23')](handleEntityNotFound(_0x56970d,null))[_0xca09('0x23')](saveUpdates(_0xbedaa8['body'],null))['then'](respondWithResult(_0x56970d,null))['catch'](handleError(_0x56970d,null));};exports[_0xca09('0x22')]=function(_0x2268a2,_0x8ea1a6){return db[_0xca09('0x2c')][_0xca09('0x47')]({'where':{'id':_0x2268a2[_0xca09('0x42')]['id']}})[_0xca09('0x23')](handleEntityNotFound(_0x8ea1a6,null))[_0xca09('0x23')](removeEntity(_0x8ea1a6,null))[_0xca09('0x48')](handleError(_0x8ea1a6,null));};exports[_0xca09('0x52')]=function(_0x2f61fc,_0x3c1046){return db[_0xca09('0x2c')]['describe']()['then'](respondWithResult(_0x3c1046,null))[_0xca09('0x48')](handleError(_0x3c1046,null));};exports[_0xca09('0x53')]=function(_0x4bcf71,_0x55e152,_0x25b2ec){var _0x34c5f3={'raw':!![],'where':{}},_0x2f7867={},_0x3f3f90;return db['FaxQueue'][_0xca09('0x54')]({'where':{'id':_0x4bcf71['params']['id']}})['then'](handleEntityNotFound(_0x55e152,null))[_0xca09('0x23')](function(_0x4f18f3){if(_0x4f18f3){_0x3f3f90=_0x4f18f3[_0xca09('0x4c')]({'plain':!![]});_0x2f7867[_0xca09('0x30')]=_['keys'](db[_0xca09('0x55')]['rawAttributes']);_0x2f7867[_0xca09('0x32')]=_[_0xca09('0x43')](_0x4bcf71['query']);_0x2f7867['filters']=_[_0xca09('0x33')](_0x2f7867[_0xca09('0x30')],_0x2f7867[_0xca09('0x32')]);_0x34c5f3['attributes']=_['intersection'](_0x2f7867[_0xca09('0x30')],qs[_0xca09('0x35')](_0x4bcf71[_0xca09('0x32')][_0xca09('0x35')]));_0x34c5f3[_0xca09('0x34')]=_0x34c5f3[_0xca09('0x34')][_0xca09('0x36')]?_0x34c5f3[_0xca09('0x34')]:_0x2f7867[_0xca09('0x30')];if(!_0x4bcf71[_0xca09('0x32')]['hasOwnProperty']('nolimit')){_0x34c5f3[_0xca09('0x1e')]=qs[_0xca09('0x1e')](_0x4bcf71['query']['limit']);_0x34c5f3[_0xca09('0x1d')]=qs[_0xca09('0x1d')](_0x4bcf71[_0xca09('0x32')]['offset']);}_0x34c5f3['order']=qs[_0xca09('0x39')](_0x4bcf71[_0xca09('0x32')][_0xca09('0x39')]);_0x34c5f3[_0xca09('0x3a')]=qs[_0xca09('0x44')](_[_0xca09('0x3b')](_0x4bcf71[_0xca09('0x32')],_0x2f7867[_0xca09('0x44')]));_0x34c5f3[_0xca09('0x3a')][_0xca09('0x56')]=_0x4f18f3['id'];if(_0x4bcf71['query'][_0xca09('0x3c')]){_0x34c5f3[_0xca09('0x3a')]=_['merge'](_0x34c5f3[_0xca09('0x3a')],{'$or':_[_0xca09('0x2b')](_0x34c5f3[_0xca09('0x34')],function(_0x552f6c){var _0x8abd5b={};_0x8abd5b[_0x552f6c]={'$like':'%'+_0x4bcf71[_0xca09('0x32')][_0xca09('0x3c')]+'%'};return _0x8abd5b;})});}_0x34c5f3=_[_0xca09('0x46')]({},_0x34c5f3,_0x4bcf71[_0xca09('0x3e')]);return db[_0xca09('0x55')][_0xca09('0x40')](_0x34c5f3);}})['then'](function(_0x12bb84){if(_0x12bb84){return db[_0xca09('0x57')][_0xca09('0x58')]({'where':{'id':_[_0xca09('0x2b')](_0x12bb84,_0xca09('0x59')),'role':'agent'},'attributes':['id',_0xca09('0x31'),_0xca09('0x5a'),_0xca09('0x5b'),_0xca09('0x5c')]});}})[_0xca09('0x23')](function(_0x2a6586){if(_0x2a6586){return{'count':_0x2a6586['count'],'rows':_[_0xca09('0x2b')](_0x2a6586[_0xca09('0x41')],function(_0x38ccbf){return{'membername':_0x38ccbf[_0xca09('0x31')],'UserId':_0x38ccbf['id'],'queue_name':_0x3f3f90[_0xca09('0x31')],'FaxQueueId':_0x3f3f90['id'],'interface':util[_0xca09('0x5d')](_0xca09('0x5e'),'SIP',_0x38ccbf[_0xca09('0x31')]),'penalty':0x0,'paused':_0x38ccbf[_0xca09('0x5a')],'createdAt':_0x38ccbf[_0xca09('0x5c')],'updatedAt':_0x38ccbf[_0xca09('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xca09('0x23')](respondWithFilteredResult(_0x55e152,_0x34c5f3))['catch'](handleError(_0x55e152,null));};exports[_0xca09('0x5f')]=function(_0x381629,_0x112c5b,_0x507d68){var _0x4a0e4d={};var _0x12b476={};var _0x3e7e67;var _0x288472;return db[_0xca09('0x2c')][_0xca09('0x54')]({'where':{'id':_0x381629[_0xca09('0x42')]['id']}})[_0xca09('0x23')](handleEntityNotFound(_0x112c5b,null))[_0xca09('0x23')](function(_0xf4333c){if(_0xf4333c){_0x3e7e67=_0xf4333c;_0x12b476[_0xca09('0x30')]=_[_0xca09('0x43')](db[_0xca09('0x60')][_0xca09('0x2d')]);_0x12b476[_0xca09('0x32')]=_['keys'](_0x381629[_0xca09('0x32')]);_0x12b476[_0xca09('0x44')]=_['intersection'](_0x12b476[_0xca09('0x30')],_0x12b476[_0xca09('0x32')]);_0x4a0e4d[_0xca09('0x34')]=_[_0xca09('0x33')](_0x12b476['model'],qs[_0xca09('0x35')](_0x381629[_0xca09('0x32')][_0xca09('0x35')]));_0x4a0e4d[_0xca09('0x34')]=_0x4a0e4d[_0xca09('0x34')][_0xca09('0x36')]?_0x4a0e4d[_0xca09('0x34')]:_0x12b476[_0xca09('0x30')];_0x4a0e4d[_0xca09('0x38')]=qs[_0xca09('0x39')](_0x381629[_0xca09('0x32')][_0xca09('0x39')]);_0x4a0e4d[_0xca09('0x3a')]=qs[_0xca09('0x44')](_['pick'](_0x381629[_0xca09('0x32')],_0x12b476[_0xca09('0x44')]));if(_0x381629['query'][_0xca09('0x3c')]){_0x4a0e4d['where']=_['merge'](_0x4a0e4d[_0xca09('0x3a')],{'$or':_['map'](_0x4a0e4d['attributes'],function(_0x59e82d){var _0x52f9c3={};_0x52f9c3[_0x59e82d]={'$like':'%'+_0x381629[_0xca09('0x32')][_0xca09('0x3c')]+'%'};return _0x52f9c3;})});}_0x4a0e4d=_[_0xca09('0x46')]({},_0x4a0e4d,_0x381629['options']);return _0x3e7e67['getTeams'](_0x4a0e4d);}})[_0xca09('0x23')](function(_0x4fd551){if(_0x4fd551){_0x288472=_0x4fd551[_0xca09('0x36')];if(!_0x381629[_0xca09('0x32')][_0xca09('0x61')](_0xca09('0x37'))){_0x4a0e4d[_0xca09('0x1e')]=qs['limit'](_0x381629[_0xca09('0x32')][_0xca09('0x1e')]);_0x4a0e4d[_0xca09('0x1d')]=qs['offset'](_0x381629[_0xca09('0x32')][_0xca09('0x1d')]);}return _0x3e7e67[_0xca09('0x5f')](_0x4a0e4d);}})[_0xca09('0x23')](function(_0xe171b1){if(_0xe171b1){return _0xe171b1?{'count':_0x288472,'rows':_0xe171b1}:null;}})[_0xca09('0x23')](respondWithResult(_0x112c5b,null))[_0xca09('0x48')](handleError(_0x112c5b,null));};exports['addTeams']=function(_0xff16fe,_0x4b6001,_0x176e9e){var _0x37b140=_0xff16fe['body'][_0xca09('0x62')];return db['Team'][_0xca09('0x40')]({'where':{'id':_0x37b140},'attributes':['id'],'include':[{'model':db['User'],'as':_0xca09('0x63'),'attributes':['id',_0xca09('0x31'),_0xca09('0x64'),'voicePause',_0xca09('0x65')],'raw':!![]}]})[_0xca09('0x23')](function(_0x11481a){if(_0x11481a){var _0x3480ac=_[_0xca09('0x66')](_0x11481a,function(_0x2c9acf){var _0x38192d=_0x2c9acf[_0xca09('0x4c')]({'plain':!![]});return _0x38192d[_0xca09('0x63')];});return db[_0xca09('0x2c')][_0xca09('0x47')]({'where':{'id':_0xff16fe[_0xca09('0x42')]['id']}})[_0xca09('0x23')](function(_0x2847a6){return db[_0xca09('0x67')][_0xca09('0x68')](function(_0x131c85){return _0x2847a6[_0xca09('0x69')](_0x37b140,{'transaction':_0x131c85})['then'](function(){return BPromise['each'](_0x3480ac,function(_0x5e8348){return db[_0xca09('0x55')]['findOrCreate']({'where':{'UserId':_0x5e8348['id'],'FaxQueueId':_0xff16fe[_0xca09('0x42')]['id']},'transaction':_0x131c85});});})['then'](function(){_0x3480ac[_0xca09('0x6a')](function(_0x2e10c2){socket[_0xca09('0x6b')](_0xca09('0x6c'),{'UserId':_0x2e10c2['id'],'FaxQueueId':_0x2847a6['id']});});});});});}})[_0xca09('0x23')](respondWithStatusCode(_0x4b6001,null))['catch'](handleError(_0x4b6001,null));};exports[_0xca09('0x6d')]=function(_0x10fc2,_0x3ef7b0,_0x2e1dc7){return db[_0xca09('0x60')][_0xca09('0x40')]({'where':{'id':_0x10fc2[_0xca09('0x32')][_0xca09('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xca09('0x63'),'attributes':['id'],'raw':!![]}]})[_0xca09('0x23')](handleEntityNotFound(_0x3ef7b0,null))[_0xca09('0x23')](function(_0x9d7531){var _0x578c9a=_['map'](_0x9d7531,'id');var _0x244582=[];var _0x133473=[];var _0x579ec5=squel['select']();_0x579ec5[_0xca09('0x6e')](_0xca09('0x6f'))[_0xca09('0x70')](_0xca09('0x71'),'tq')['join']('user_has_teams','ut',_0xca09('0x72'))[_0xca09('0x3a')](_0xca09('0x73'),_0x10fc2['params']['id']);for(var _0x425295=0x0;_0x425295<_0x9d7531[_0xca09('0x36')];_0x425295+=0x1){let _0xf5204b=_0x9d7531[_0x425295];for(var _0x3a409=0x0;_0x3a409<_0xf5204b[_0xca09('0x63')][_0xca09('0x36')];_0x3a409+=0x1){let _0x296f76=_0xf5204b['Agents'][_0x3a409];var _0x179c3e=_0x579ec5[_0xca09('0x74')]();_0x179c3e['where'](_0xca09('0x75'),_0x296f76['id']);_0x133473[_0xca09('0x76')](db[_0xca09('0x67')][_0xca09('0x32')](_0x179c3e[_0xca09('0x77')](),{'type':db[_0xca09('0x67')][_0xca09('0x78')][_0xca09('0x79')]})[_0xca09('0x23')](function(_0x2b3ca1){if(_0x2b3ca1[_0xca09('0x36')]===0x1){return _0x296f76['id'];}else{var _0x43b8bd=_[_0xca09('0x7a')](_[_0xca09('0x2b')](_0x2b3ca1,_0xca09('0x7b')),function(_0x3e55f7){return _[_0xca09('0x7c')](_0x578c9a,_0x3e55f7);});if(_0x43b8bd){return _0x296f76['id'];}}}));}}return BPromise[_0xca09('0x7d')](_0x133473)[_0xca09('0x23')](function(_0x41d87d){_0x244582=_(_0x244582)[_0xca09('0x7e')](_0x41d87d)[_0xca09('0x7f')]()[_0xca09('0x80')]();return db[_0xca09('0x2c')][_0xca09('0x47')]({'where':{'id':_0x10fc2['params']['id']}})[_0xca09('0x23')](function(_0x28f048){return db[_0xca09('0x67')][_0xca09('0x68')](function(_0xd96825){return _0x28f048['removeTeams'](_0x10fc2['query'][_0xca09('0x62')],{'transaction':_0xd96825})['then'](function(){if(!_[_0xca09('0x81')](_0x244582)){return _0x28f048[_0xca09('0x82')](_0x244582,{'transaction':_0xd96825});}})[_0xca09('0x23')](function(){_0x244582[_0xca09('0x6a')](function(_0x43e469){socket[_0xca09('0x6b')](_0xca09('0x83'),{'UserId':_0x43e469,'FaxQueueId':_0x28f048['id']});});});});});});})[_0xca09('0x23')](respondWithStatusCode(_0x3ef7b0,null))[_0xca09('0x48')](handleError(_0x3ef7b0,null));};exports[_0xca09('0x84')]=function(_0x176766,_0x2616f5,_0x11a4e1){return db[_0xca09('0x2c')][_0xca09('0x47')]({'where':{'id':_0x176766[_0xca09('0x42')]['id']}})[_0xca09('0x23')](handleEntityNotFound(_0x2616f5,null))[_0xca09('0x23')](function(_0x405089){if(_0x405089){return _0x405089[_0xca09('0x84')](_0x176766['body'][_0xca09('0x62')],_[_0xca09('0x85')](_0x176766['body'],[_0xca09('0x62'),'id'])||{})[_0xca09('0x86')](function(_0x511ed1){for(var _0x1b311b=0x0;_0x1b311b<_0x176766[_0xca09('0x4a')][_0xca09('0x62')][_0xca09('0x36')];_0x1b311b+=0x1){socket['emit'](_0xca09('0x6c'),{'UserId':Number(_0x176766[_0xca09('0x4a')][_0xca09('0x62')][_0x1b311b]),'FaxQueueId':Number(_0x176766[_0xca09('0x42')]['id'])});}return _0x511ed1;});}})['then'](respondWithResult(_0x2616f5,null))[_0xca09('0x48')](handleError(_0x2616f5,null));};exports[_0xca09('0x82')]=function(_0xb4edb7,_0x3e0616,_0x4439c5){return db[_0xca09('0x2c')]['find']({'where':{'id':_0xb4edb7[_0xca09('0x42')]['id']}})[_0xca09('0x23')](handleEntityNotFound(_0x3e0616,null))[_0xca09('0x23')](function(_0x3649dd){if(_0x3649dd){return _0x3649dd['removeAgents'](_0xb4edb7[_0xca09('0x32')][_0xca09('0x62')])[_0xca09('0x23')](function(){if(_[_0xca09('0x87')](_0xb4edb7[_0xca09('0x32')][_0xca09('0x62')])){for(var _0x2bf8a7=0x0;_0x2bf8a7<_0xb4edb7[_0xca09('0x32')]['ids'][_0xca09('0x36')];_0x2bf8a7+=0x1){socket[_0xca09('0x6b')](_0xca09('0x83'),{'UserId':Number(_0xb4edb7[_0xca09('0x32')]['ids'][_0x2bf8a7]),'FaxQueueId':Number(_0xb4edb7[_0xca09('0x42')]['id'])});}}else{socket[_0xca09('0x6b')](_0xca09('0x83'),{'UserId':Number(_0xb4edb7[_0xca09('0x32')]['ids']),'FaxQueueId':Number(_0xb4edb7['params']['id'])});}});}})[_0xca09('0x23')](respondWithStatusCode(_0x3e0616,null))['catch'](handleError(_0x3e0616,null));};exports['getAgents']=function(_0x40425b,_0x1122ed,_0x566447){var _0x22d510={};var _0x45db70={};var _0x356006;var _0x4b573d;return db[_0xca09('0x2c')][_0xca09('0x54')]({'where':{'id':_0x40425b[_0xca09('0x42')]['id']}})[_0xca09('0x23')](handleEntityNotFound(_0x1122ed,null))[_0xca09('0x23')](function(_0x148130){if(_0x148130){_0x356006=_0x148130;_0x45db70[_0xca09('0x30')]=_['keys'](db['User'][_0xca09('0x2d')]);_0x45db70[_0xca09('0x32')]=_[_0xca09('0x43')](_0x40425b['query']);_0x45db70[_0xca09('0x44')]=_[_0xca09('0x33')](_0x45db70[_0xca09('0x30')],_0x45db70[_0xca09('0x32')]);_0x22d510[_0xca09('0x34')]=_[_0xca09('0x33')](_0x45db70[_0xca09('0x30')],qs[_0xca09('0x35')](_0x40425b['query'][_0xca09('0x35')]));_0x22d510[_0xca09('0x34')]=_0x22d510[_0xca09('0x34')][_0xca09('0x36')]?_0x22d510['attributes']:_0x45db70[_0xca09('0x30')];_0x22d510[_0xca09('0x38')]=qs[_0xca09('0x39')](_0x40425b[_0xca09('0x32')][_0xca09('0x39')]);_0x22d510[_0xca09('0x3a')]=qs['filters'](_['pick'](_0x40425b['query'],_0x45db70['filters']));if(_0x40425b[_0xca09('0x32')][_0xca09('0x3c')]){_0x22d510[_0xca09('0x3a')]=_[_0xca09('0x46')](_0x22d510[_0xca09('0x3a')],{'$or':_[_0xca09('0x2b')](_0x22d510['attributes'],function(_0x257e8d){var _0x1b24cf={};_0x1b24cf[_0x257e8d]={'$like':'%'+_0x40425b[_0xca09('0x32')]['filter']+'%'};return _0x1b24cf;})});}_0x22d510=_['merge']({},_0x22d510,_0x40425b[_0xca09('0x3e')]);return _0x356006['getAgents'](_0x22d510);}})[_0xca09('0x23')](function(_0x4e3116){if(_0x4e3116){_0x4b573d=_0x4e3116[_0xca09('0x36')];if(!_0x40425b['query'][_0xca09('0x61')]('nolimit')){_0x22d510[_0xca09('0x1e')]=qs[_0xca09('0x1e')](_0x40425b[_0xca09('0x32')][_0xca09('0x1e')]);_0x22d510['offset']=qs['offset'](_0x40425b[_0xca09('0x32')][_0xca09('0x1d')]);}return _0x356006[_0xca09('0x88')](_0x22d510);}})[_0xca09('0x23')](function(_0x4de76a){if(_0x4de76a){return _0x4de76a?{'count':_0x4b573d,'rows':_0x4de76a}:null;}})[_0xca09('0x23')](respondWithResult(_0x1122ed,null))[_0xca09('0x48')](handleError(_0x1122ed,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c01da1f..e6347e5 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 _0x571d=['FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4b6b5a,_0x142125){var _0x3fb329=function(_0x57c40d){while(--_0x57c40d){_0x4b6b5a['push'](_0x4b6b5a['shift']());}};_0x3fb329(++_0x142125);}(_0x571d,0x80));var _0xd571=function(_0x3bc420,_0x1ae27d){_0x3bc420=_0x3bc420-0x0;var _0x50d74a=_0x571d[_0x3bc420];return _0x50d74a;};'use strict';var EventEmitter=require(_0xd571('0x0'));var FaxQueue=require(_0xd571('0x1'))['db'][_0xd571('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd571('0x3')](0x0);var events={'afterCreate':_0xd571('0x4'),'afterUpdate':_0xd571('0x5'),'afterDestroy':_0xd571('0x6')};function emitEvent(_0x2b2e8a){return function(_0x1c3234,_0x35d25a,_0x369b39){FaxQueueEvents[_0xd571('0x7')](_0x2b2e8a+':'+_0x1c3234['id'],_0x1c3234);FaxQueueEvents[_0xd571('0x7')](_0x2b2e8a,_0x1c3234);_0x369b39(null);};}for(var e in events){if(events[_0xd571('0x8')](e)){var event=events[e];FaxQueue[_0xd571('0x9')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x8a7e=['hook','exports','events','../../mysqldb','FaxQueue','update','remove','emit','hasOwnProperty'];(function(_0xe04af6,_0x2a8808){var _0x8f5c0b=function(_0x4eca20){while(--_0x4eca20){_0xe04af6['push'](_0xe04af6['shift']());}};_0x8f5c0b(++_0x2a8808);}(_0x8a7e,0x1e8));var _0xe8a7=function(_0x260c24,_0x1906c6){_0x260c24=_0x260c24-0x0;var _0x58f8a5=_0x8a7e[_0x260c24];return _0x58f8a5;};'use strict';var EventEmitter=require(_0xe8a7('0x0'));var FaxQueue=require(_0xe8a7('0x1'))['db'][_0xe8a7('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe8a7('0x3'),'afterDestroy':_0xe8a7('0x4')};function emitEvent(_0x2441cd){return function(_0x2af5b9,_0x1811cf,_0x722807){FaxQueueEvents[_0xe8a7('0x5')](_0x2441cd+':'+_0x2af5b9['id'],_0x2af5b9);FaxQueueEvents[_0xe8a7('0x5')](_0x2441cd,_0x2af5b9);_0x722807(null);};}for(var e in events){if(events[_0xe8a7('0x6')](e)){var event=events[e];FaxQueue[_0xe8a7('0x7')](e,emitEvent(event));}}module[_0xe8a7('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 42c409a..4c868a3 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 _0x37a9=['request-promise','path','rimraf','exports','define','FaxQueue','util','api','moment','bluebird'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x37a9,0x7e));var _0x937a=function(_0x17aaba,_0x5b7c1c){_0x17aaba=_0x17aaba-0x0;var _0x43c429=_0x37a9[_0x17aaba];return _0x43c429;};'use strict';var _=require('lodash');var util=require(_0x937a('0x0'));var logger=require('../../config/logger')(_0x937a('0x1'));var moment=require(_0x937a('0x2'));var BPromise=require(_0x937a('0x3'));var rp=require(_0x937a('0x4'));var fs=require('fs');var path=require(_0x937a('0x5'));var rimraf=require(_0x937a('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x937a('0x7')]=function(_0x51adf6,_0x4084dd){return _0x51adf6[_0x937a('0x8')](_0x937a('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee37=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','fax_queues','util'];(function(_0x2125ba,_0x2c3614){var _0x5bfa51=function(_0x5b40db){while(--_0x5b40db){_0x2125ba['push'](_0x2125ba['shift']());}};_0x5bfa51(++_0x2c3614);}(_0xee37,0x6d));var _0x7ee3=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xee37[_0x277af0];return _0x43bd7c;};'use strict';var _=require('lodash');var util=require(_0x7ee3('0x0'));var logger=require(_0x7ee3('0x1'))(_0x7ee3('0x2'));var moment=require(_0x7ee3('0x3'));var BPromise=require('bluebird');var rp=require(_0x7ee3('0x4'));var fs=require('fs');var path=require(_0x7ee3('0x5'));var rimraf=require(_0x7ee3('0x6'));var config=require(_0x7ee3('0x7'));var attributes=require(_0x7ee3('0x8'));module['exports']=function(_0x1b345c,_0x10bf92){return _0x1b345c[_0x7ee3('0x9')]('FaxQueue',attributes,{'tableName':_0x7ee3('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 1de7cd1..5a2c010 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 _0x6105=['debug','stringify','ShowFaxQueue','find','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','request\x20sent','error','code','FaxQueue,\x20%s,\x20%s','message','info','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','then'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6105,0xc2));var _0x5610=function(_0x30c91d,_0x1a8c6d){_0x30c91d=_0x30c91d-0x0;var _0x319942=_0x6105[_0x30c91d];return _0x319942;};'use strict';var _=require(_0x5610('0x0'));var util=require(_0x5610('0x1'));var moment=require(_0x5610('0x2'));var BPromise=require(_0x5610('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5610('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5610('0x5'));var logger=require('../../config/logger')(_0x5610('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5610('0x7')][_0x5610('0x8')]({'port':0x232a});config[_0x5610('0x9')]=_[_0x5610('0xa')](config[_0x5610('0x9')],{'host':_0x5610('0xb'),'port':0x18eb});var socket=require(_0x5610('0xc'))(new Redis(config[_0x5610('0x9')]));require(_0x5610('0xd'))[_0x5610('0xe')](socket);function respondWithRpcPromise(_0x3a76b4,_0x1af1bd,_0x3e44fc){return new BPromise(function(_0x3d2c02,_0x8c0016){return client[_0x5610('0xf')](_0x3a76b4,_0x3e44fc)['then'](function(_0x54d2d5){logger['info']('FaxQueue,\x20%s,\x20%s',_0x1af1bd,_0x5610('0x10'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x1af1bd,_0x5610('0x10'),JSON['stringify'](_0x54d2d5));if(_0x54d2d5[_0x5610('0x11')]){if(_0x54d2d5[_0x5610('0x11')][_0x5610('0x12')]===0x1f4){logger[_0x5610('0x11')](_0x5610('0x13'),_0x1af1bd,_0x54d2d5[_0x5610('0x11')][_0x5610('0x14')]);return _0x8c0016(_0x54d2d5[_0x5610('0x11')][_0x5610('0x14')]);}logger['error'](_0x5610('0x13'),_0x1af1bd,_0x54d2d5[_0x5610('0x11')][_0x5610('0x14')]);return _0x3d2c02(_0x54d2d5[_0x5610('0x11')][_0x5610('0x14')]);}else{logger[_0x5610('0x15')](_0x5610('0x13'),_0x1af1bd,_0x5610('0x10'));_0x3d2c02(_0x54d2d5['result'][_0x5610('0x14')]);}})[_0x5610('0x16')](function(_0x3115bd){logger['error'](_0x5610('0x13'),_0x1af1bd,_0x3115bd);_0x8c0016(_0x3115bd);});});}exports[_0x5610('0x17')]=function(_0xe07451){var _0x5792db=this;return new Promise(function(_0x274885,_0x96ebf0){return db[_0x5610('0x18')][_0x5610('0x19')]({'raw':_0xe07451['options']?_0xe07451[_0x5610('0x1a')][_0x5610('0x1b')]===undefined?!![]:![]:!![],'where':_0xe07451['options']?_0xe07451[_0x5610('0x1a')][_0x5610('0x1c')]||null:null,'attributes':_0xe07451['options']?_0xe07451['options'][_0x5610('0x1d')]||null:null,'limit':_0xe07451[_0x5610('0x1a')]?_0xe07451[_0x5610('0x1a')]['limit']||null:null,'include':_0xe07451[_0x5610('0x1a')]?_0xe07451['options'][_0x5610('0x1e')]?_[_0x5610('0x1f')](_0xe07451[_0x5610('0x1a')][_0x5610('0x1e')],function(_0x57a40d){return{'model':db[_0x57a40d[_0x5610('0x20')]],'as':_0x57a40d['as'],'attributes':_0x57a40d[_0x5610('0x1d')],'include':_0x57a40d[_0x5610('0x1e')]?_['map'](_0x57a40d[_0x5610('0x1e')],function(_0x89c1aa){return{'model':db[_0x89c1aa[_0x5610('0x20')]],'as':_0x89c1aa['as'],'attributes':_0x89c1aa[_0x5610('0x1d')],'include':_0x89c1aa[_0x5610('0x1e')]?_[_0x5610('0x1f')](_0x89c1aa[_0x5610('0x1e')],function(_0x4ab97e){return{'model':db[_0x4ab97e[_0x5610('0x20')]],'as':_0x4ab97e['as'],'attributes':_0x4ab97e[_0x5610('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5610('0x21')](function(_0x170056){logger[_0x5610('0x15')](_0x5610('0x17'),_0xe07451);logger[_0x5610('0x22')]('GetFaxQueue',_0xe07451,JSON[_0x5610('0x23')](_0x170056));_0x274885(_0x170056);})[_0x5610('0x16')](function(_0x45f879){logger['error']('GetFaxQueue',_0x45f879['message'],_0xe07451);_0x96ebf0(_0x5792db[_0x5610('0x11')](0x1f4,_0x45f879[_0x5610('0x14')]));});});};exports[_0x5610('0x24')]=function(_0x57991b){var _0x38f07c=this;return new Promise(function(_0x4b09a6,_0x238826){return db[_0x5610('0x18')][_0x5610('0x25')]({'raw':_0x57991b['options']?_0x57991b[_0x5610('0x1a')][_0x5610('0x1b')]===undefined?!![]:![]:!![],'where':_0x57991b['options']?_0x57991b[_0x5610('0x1a')][_0x5610('0x1c')]||null:null,'attributes':_0x57991b['options']?_0x57991b[_0x5610('0x1a')][_0x5610('0x1d')]||null:null,'include':_0x57991b[_0x5610('0x1a')]?_0x57991b['options'][_0x5610('0x1e')]?_[_0x5610('0x1f')](_0x57991b[_0x5610('0x1a')][_0x5610('0x1e')],function(_0x4ff011){return{'model':db[_0x4ff011[_0x5610('0x20')]],'as':_0x4ff011['as'],'attributes':_0x4ff011['attributes'],'include':_0x4ff011[_0x5610('0x1e')]?_[_0x5610('0x1f')](_0x4ff011['include'],function(_0x115edf){return{'model':db[_0x115edf[_0x5610('0x20')]],'as':_0x115edf['as'],'attributes':_0x115edf['attributes'],'include':_0x115edf[_0x5610('0x1e')]?_[_0x5610('0x1f')](_0x115edf[_0x5610('0x1e')],function(_0x3a029a){return{'model':db[_0x3a029a[_0x5610('0x20')]],'as':_0x3a029a['as'],'attributes':_0x3a029a[_0x5610('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5610('0x21')](function(_0xab93e8){logger[_0x5610('0x15')]('ShowFaxQueue',_0x57991b);logger[_0x5610('0x22')](_0x5610('0x24'),_0x57991b,JSON[_0x5610('0x23')](_0xab93e8));_0x4b09a6(_0xab93e8);})[_0x5610('0x16')](function(_0x2b7c82){logger['error'](_0x5610('0x24'),_0x2b7c82[_0x5610('0x14')],_0x57991b);_0x238826(_0x38f07c[_0x5610('0x11')](0x1f4,_0x2b7c82[_0x5610('0x14')]));});});}; \ No newline at end of file +var _0xa342=['GetFaxQueue','findAll','raw','options','where','attributes','limit','include','map','model','then','ShowFaxQueue','FaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x51b6a1,_0x479d6d){var _0x551952=function(_0x4ce7d8){while(--_0x4ce7d8){_0x51b6a1['push'](_0x51b6a1['shift']());}};_0x551952(++_0x479d6d);}(_0xa342,0x1b2));var _0x2a34=function(_0x3b5385,_0x45ff7c){_0x3b5385=_0x3b5385-0x0;var _0x3c0859=_0xa342[_0x3b5385];return _0x3c0859;};'use strict';var _=require(_0x2a34('0x0'));var util=require(_0x2a34('0x1'));var moment=require(_0x2a34('0x2'));var BPromise=require(_0x2a34('0x3'));var rs=require(_0x2a34('0x4'));var fs=require('fs');var Redis=require(_0x2a34('0x5'));var db=require(_0x2a34('0x6'))['db'];var utils=require(_0x2a34('0x7'));var logger=require(_0x2a34('0x8'))('rpc');var config=require(_0x2a34('0x9'));var jayson=require(_0x2a34('0xa'));var client=jayson['client'][_0x2a34('0xb')]({'port':0x232a});config['redis']=_[_0x2a34('0xc')](config['redis'],{'host':_0x2a34('0xd'),'port':0x18eb});var socket=require(_0x2a34('0xe'))(new Redis(config['redis']));require(_0x2a34('0xf'))[_0x2a34('0x10')](socket);function respondWithRpcPromise(_0x598c41,_0x479d5f,_0x2c73e9){return new BPromise(function(_0x6ce675,_0x10715c){return client[_0x2a34('0x11')](_0x598c41,_0x2c73e9)['then'](function(_0x53bdef){logger[_0x2a34('0x12')](_0x2a34('0x13'),_0x479d5f,_0x2a34('0x14'));logger[_0x2a34('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x479d5f,_0x2a34('0x14'),JSON[_0x2a34('0x16')](_0x53bdef));if(_0x53bdef[_0x2a34('0x17')]){if(_0x53bdef[_0x2a34('0x17')][_0x2a34('0x18')]===0x1f4){logger[_0x2a34('0x17')](_0x2a34('0x13'),_0x479d5f,_0x53bdef['error'][_0x2a34('0x19')]);return _0x10715c(_0x53bdef[_0x2a34('0x17')][_0x2a34('0x19')]);}logger[_0x2a34('0x17')](_0x2a34('0x13'),_0x479d5f,_0x53bdef[_0x2a34('0x17')][_0x2a34('0x19')]);return _0x6ce675(_0x53bdef[_0x2a34('0x17')]['message']);}else{logger[_0x2a34('0x12')](_0x2a34('0x13'),_0x479d5f,_0x2a34('0x14'));_0x6ce675(_0x53bdef[_0x2a34('0x1a')][_0x2a34('0x19')]);}})[_0x2a34('0x1b')](function(_0xc35ce9){logger[_0x2a34('0x17')](_0x2a34('0x13'),_0x479d5f,_0xc35ce9);_0x10715c(_0xc35ce9);});});}exports[_0x2a34('0x1c')]=function(_0xc1f98b){var _0x36977c=this;return new Promise(function(_0x34c233,_0x4b57b7){return db['FaxQueue'][_0x2a34('0x1d')]({'raw':_0xc1f98b['options']?_0xc1f98b['options'][_0x2a34('0x1e')]===undefined?!![]:![]:!![],'where':_0xc1f98b[_0x2a34('0x1f')]?_0xc1f98b['options'][_0x2a34('0x20')]||null:null,'attributes':_0xc1f98b[_0x2a34('0x1f')]?_0xc1f98b[_0x2a34('0x1f')][_0x2a34('0x21')]||null:null,'limit':_0xc1f98b[_0x2a34('0x1f')]?_0xc1f98b['options'][_0x2a34('0x22')]||null:null,'include':_0xc1f98b[_0x2a34('0x1f')]?_0xc1f98b[_0x2a34('0x1f')][_0x2a34('0x23')]?_[_0x2a34('0x24')](_0xc1f98b[_0x2a34('0x1f')][_0x2a34('0x23')],function(_0x199d34){return{'model':db[_0x199d34[_0x2a34('0x25')]],'as':_0x199d34['as'],'attributes':_0x199d34[_0x2a34('0x21')],'include':_0x199d34[_0x2a34('0x23')]?_[_0x2a34('0x24')](_0x199d34[_0x2a34('0x23')],function(_0x30dc81){return{'model':db[_0x30dc81[_0x2a34('0x25')]],'as':_0x30dc81['as'],'attributes':_0x30dc81[_0x2a34('0x21')],'include':_0x30dc81[_0x2a34('0x23')]?_[_0x2a34('0x24')](_0x30dc81['include'],function(_0x5151fd){return{'model':db[_0x5151fd[_0x2a34('0x25')]],'as':_0x5151fd['as'],'attributes':_0x5151fd[_0x2a34('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2a34('0x26')](function(_0x3db622){logger['info'](_0x2a34('0x1c'),_0xc1f98b);logger[_0x2a34('0x15')](_0x2a34('0x1c'),_0xc1f98b,JSON['stringify'](_0x3db622));_0x34c233(_0x3db622);})[_0x2a34('0x1b')](function(_0x45af24){logger[_0x2a34('0x17')](_0x2a34('0x1c'),_0x45af24[_0x2a34('0x19')],_0xc1f98b);_0x4b57b7(_0x36977c[_0x2a34('0x17')](0x1f4,_0x45af24[_0x2a34('0x19')]));});});};exports[_0x2a34('0x27')]=function(_0x34860b){var _0x4a2ca0=this;return new Promise(function(_0x2ee98d,_0x26a4ee){return db[_0x2a34('0x28')][_0x2a34('0x29')]({'raw':_0x34860b['options']?_0x34860b[_0x2a34('0x1f')][_0x2a34('0x1e')]===undefined?!![]:![]:!![],'where':_0x34860b[_0x2a34('0x1f')]?_0x34860b['options'][_0x2a34('0x20')]||null:null,'attributes':_0x34860b[_0x2a34('0x1f')]?_0x34860b[_0x2a34('0x1f')][_0x2a34('0x21')]||null:null,'include':_0x34860b[_0x2a34('0x1f')]?_0x34860b['options'][_0x2a34('0x23')]?_[_0x2a34('0x24')](_0x34860b[_0x2a34('0x1f')][_0x2a34('0x23')],function(_0x48f68c){return{'model':db[_0x48f68c[_0x2a34('0x25')]],'as':_0x48f68c['as'],'attributes':_0x48f68c[_0x2a34('0x21')],'include':_0x48f68c[_0x2a34('0x23')]?_['map'](_0x48f68c[_0x2a34('0x23')],function(_0x4081ec){return{'model':db[_0x4081ec['model']],'as':_0x4081ec['as'],'attributes':_0x4081ec[_0x2a34('0x21')],'include':_0x4081ec[_0x2a34('0x23')]?_[_0x2a34('0x24')](_0x4081ec[_0x2a34('0x23')],function(_0x3e6c24){return{'model':db[_0x3e6c24[_0x2a34('0x25')]],'as':_0x3e6c24['as'],'attributes':_0x3e6c24['attributes']};}):[]};}):[]};}):[]:[]})[_0x2a34('0x26')](function(_0x332758){logger[_0x2a34('0x12')](_0x2a34('0x27'),_0x34860b);logger[_0x2a34('0x15')](_0x2a34('0x27'),_0x34860b,JSON[_0x2a34('0x16')](_0x332758));_0x2ee98d(_0x332758);})['catch'](function(_0x50fd45){logger['error'](_0x2a34('0x27'),_0x50fd45['message'],_0x34860b);_0x26a4ee(_0x4a2ca0[_0x2a34('0x17')](0x1f4,_0x50fd45[_0x2a34('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 83e04a4..ddc84fa 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 _0xa74d=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xa74d,0xcf));var _0xda74=function(_0x2a463e,_0x206cdd){_0x2a463e=_0x2a463e-0x0;var _0x46aa2d=_0xa74d[_0x2a463e];return _0x46aa2d;};'use strict';var FaxQueueEvents=require(_0xda74('0x0'));var events=[_0xda74('0x1'),_0xda74('0x2'),'update'];function createListener(_0x11c0c8,_0x3ab684){return function(_0x56101a){_0x3ab684['emit'](_0x11c0c8,_0x56101a);};}function removeListener(_0x1a15cf,_0x3219e3){return function(){FaxQueueEvents[_0xda74('0x3')](_0x1a15cf,_0x3219e3);};}exports[_0xda74('0x4')]=function(_0x341cb8){for(var _0x1a0d0a=0x0,_0x3c1a46=events[_0xda74('0x5')];_0x1a0d0a<_0x3c1a46;_0x1a0d0a++){var _0x4dec51=events[_0x1a0d0a];var _0x11960f=createListener(_0xda74('0x6')+_0x4dec51,_0x341cb8);FaxQueueEvents['on'](_0x4dec51,_0x11960f);}}; \ No newline at end of file +var _0xa3cf=['faxQueue:','./faxQueue.events','save','remove','removeListener','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3cf,0xc5));var _0xfa3c=function(_0x51b5aa,_0x432260){_0x51b5aa=_0x51b5aa-0x0;var _0x48c923=_0xa3cf[_0x51b5aa];return _0x48c923;};'use strict';var FaxQueueEvents=require(_0xfa3c('0x0'));var events=[_0xfa3c('0x1'),_0xfa3c('0x2'),'update'];function createListener(_0x2ed3d5,_0x13d2ff){return function(_0x514002){_0x13d2ff['emit'](_0x2ed3d5,_0x514002);};}function removeListener(_0x266246,_0x36da13){return function(){FaxQueueEvents[_0xfa3c('0x3')](_0x266246,_0x36da13);};}exports[_0xfa3c('0x4')]=function(_0x30519f){for(var _0x345423=0x0,_0x1ff05d=events[_0xfa3c('0x5')];_0x345423<_0x1ff05d;_0x345423++){var _0x525fdc=events[_0x345423];var _0x4e62b7=createListener(_0xfa3c('0x6')+_0x525fdc,_0x30519f);FaxQueueEvents['on'](_0x525fdc,_0x4e62b7);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 6ad2f34..2e680ab 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 _0x2542=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents'];(function(_0x15f648,_0x23ef38){var _0x31abe7=function(_0x3fa88f){while(--_0x3fa88f){_0x15f648['push'](_0x15f648['shift']());}};_0x31abe7(++_0x23ef38);}(_0x2542,0x169));var _0x2254=function(_0x2563b5,_0x572e07){_0x2563b5=_0x2563b5-0x0;var _0x4f8155=_0x2542[_0x2563b5];return _0x4f8155;};'use strict';var multer=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var path=require(_0x2254('0x2'));var timeout=require(_0x2254('0x3'));var express=require('express');var router=express[_0x2254('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2254('0x5'));var interaction=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var controller=require(_0x2254('0x8'));router[_0x2254('0x9')]('/',auth['isAuthenticated'](),controller[_0x2254('0xa')]);router[_0x2254('0x9')](_0x2254('0xb'),auth[_0x2254('0xc')](),controller[_0x2254('0xd')]);router[_0x2254('0x9')](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0xf')]);router[_0x2254('0x9')](_0x2254('0x10'),auth['isAuthenticated'](),controller[_0x2254('0x11')]);router[_0x2254('0x9')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['getTeams']);router['get'](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x14')]);router[_0x2254('0x15')]('/',auth[_0x2254('0xc')](),controller[_0x2254('0x16')]);router['post'](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['addTeams']);router[_0x2254('0x15')](_0x2254('0x13'),auth[_0x2254('0xc')](),controller[_0x2254('0x17')]);router[_0x2254('0x18')](_0x2254('0xe'),auth['isAuthenticated'](),controller[_0x2254('0x19')]);router['delete'](_0x2254('0xe'),auth[_0x2254('0xc')](),controller[_0x2254('0x1a')]);router[_0x2254('0x1b')](_0x2254('0x12'),auth[_0x2254('0xc')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x2254('0xc')](),controller[_0x2254('0x1c')]);module[_0x2254('0x1d')]=router; \ No newline at end of file +var _0xe714=['/:id/teams','getTeams','/:id/users','post','put','/:id','delete','destroy','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','describe','/:id/members','getMembers'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xe714,0xe2));var _0x4e71=function(_0x2e7497,_0x599aad){_0x2e7497=_0x2e7497-0x0;var _0x4accef=_0xe714[_0x2e7497];return _0x4accef;};'use strict';var multer=require(_0x4e71('0x0'));var util=require('util');var path=require(_0x4e71('0x1'));var timeout=require(_0x4e71('0x2'));var express=require(_0x4e71('0x3'));var router=express[_0x4e71('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e71('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4e71('0x6'));var controller=require(_0x4e71('0x7'));router[_0x4e71('0x8')]('/',auth[_0x4e71('0x9')](),controller[_0x4e71('0xa')]);router[_0x4e71('0x8')]('/describe',auth[_0x4e71('0x9')](),controller[_0x4e71('0xb')]);router[_0x4e71('0x8')]('/:id',auth[_0x4e71('0x9')](),controller['show']);router[_0x4e71('0x8')](_0x4e71('0xc'),auth[_0x4e71('0x9')](),controller[_0x4e71('0xd')]);router[_0x4e71('0x8')](_0x4e71('0xe'),auth[_0x4e71('0x9')](),controller[_0x4e71('0xf')]);router['get'](_0x4e71('0x10'),auth[_0x4e71('0x9')](),controller['getAgents']);router[_0x4e71('0x11')]('/',auth[_0x4e71('0x9')](),controller['create']);router[_0x4e71('0x11')](_0x4e71('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4e71('0x11')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x4e71('0x12')](_0x4e71('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x4e71('0x14')](_0x4e71('0x13'),auth[_0x4e71('0x9')](),controller[_0x4e71('0x15')]);router[_0x4e71('0x14')](_0x4e71('0xe'),auth['isAuthenticated'](),controller[_0x4e71('0x16')]);router[_0x4e71('0x14')]('/:id/users',auth[_0x4e71('0x9')](),controller[_0x4e71('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index e17cd4d..13f5233 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 _0x741b=['STRING','DATE','moment','sequelize','exports'];(function(_0x303be5,_0x12c0ed){var _0x1d5869=function(_0x369099){while(--_0x369099){_0x303be5['push'](_0x303be5['shift']());}};_0x1d5869(++_0x12c0ed);}(_0x741b,0x1d3));var _0xb741=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x741b[_0x491a7f];return _0x3d8f44;};'use strict';var moment=require(_0xb741('0x0'));var Sequelize=require(_0xb741('0x1'));module[_0xb741('0x2')]={'uniqueid':{'type':Sequelize[_0xb741('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb741('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xb741('0x4')]},'acceptAt':{'type':Sequelize[_0xb741('0x4')]},'exitAt':{'type':Sequelize[_0xb741('0x4')]},'reason':{'type':Sequelize[_0xb741('0x3')]}}; \ No newline at end of file +var _0x9fc5=['STRING','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fc5,0xb6));var _0x59fc=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x9fc5[_0x10dc60];return _0x47dec5;};'use strict';var moment=require('moment');var Sequelize=require(_0x59fc('0x0'));module[_0x59fc('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x59fc('0x2')]},'joinAt':{'type':Sequelize[_0x59fc('0x3')]},'leaveAt':{'type':Sequelize[_0x59fc('0x3')]},'acceptAt':{'type':Sequelize[_0x59fc('0x3')]},'exitAt':{'type':Sequelize[_0x59fc('0x3')]},'reason':{'type':Sequelize[_0x59fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 344ff18..5e636ec 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 _0x7794=['json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','FaxQueueReport','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','fs-extra','lodash','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','status','end'];(function(_0x549cda,_0x33a797){var _0x35cd0d=function(_0xa81d58){while(--_0xa81d58){_0x549cda['push'](_0x549cda['shift']());}};_0x35cd0d(++_0x33a797);}(_0x7794,0x7b));var _0x4779=function(_0x56c4ca,_0x3bc17c){_0x56c4ca=_0x56c4ca-0x0;var _0x16780e=_0x7794[_0x56c4ca];return _0x16780e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4779('0x0'));var zipdir=require(_0x4779('0x1'));var jsonpatch=require(_0x4779('0x2'));var rp=require(_0x4779('0x3'));var moment=require('moment');var BPromise=require(_0x4779('0x4'));var Mustache=require(_0x4779('0x5'));var util=require('util');var path=require(_0x4779('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4779('0x7'));var _=require(_0x4779('0x8'));var squel=require('squel');var crypto=require(_0x4779('0x9'));var jsforce=require(_0x4779('0xa'));var deskjs=require(_0x4779('0xb'));var toCsv=require(_0x4779('0xc'));var querystring=require(_0x4779('0xd'));var Papa=require(_0x4779('0xe'));var Redis=require(_0x4779('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4779('0x10'));var as=require(_0x4779('0x11'));var hardwareService=require(_0x4779('0x12'));var logger=require(_0x4779('0x13'))(_0x4779('0x14'));var utils=require(_0x4779('0x15'));var config=require(_0x4779('0x16'));var licenseUtil=require(_0x4779('0x17'));var db=require(_0x4779('0x18'))['db'];function respondWithStatusCode(_0x13c989,_0x50e17e){_0x50e17e=_0x50e17e||0xcc;return function(_0x5b1219){if(_0x5b1219){return _0x13c989['sendStatus'](_0x50e17e);}return _0x13c989[_0x4779('0x19')](_0x50e17e)[_0x4779('0x1a')]();};}function respondWithResult(_0xb9a06f,_0xddf5cd){_0xddf5cd=_0xddf5cd||0xc8;return function(_0x4fe370){if(_0x4fe370){return _0xb9a06f[_0x4779('0x19')](_0xddf5cd)[_0x4779('0x1b')](_0x4fe370);}};}function respondWithFilteredResult(_0x4d71a0,_0x599deb){return function(_0x1dbbe1){if(_0x1dbbe1){var _0x2de2be=typeof _0x599deb[_0x4779('0x1c')]===_0x4779('0x1d')&&typeof _0x599deb['limit']==='undefined';var _0x445e0b=_0x1dbbe1[_0x4779('0x1e')];var _0x19fbb6=_0x2de2be?0x0:_0x599deb['offset'];var _0x3dbe70=_0x2de2be?_0x1dbbe1['count']:_0x599deb[_0x4779('0x1c')]+_0x599deb[_0x4779('0x1f')];var _0x478fa5;if(_0x3dbe70>=_0x445e0b){_0x3dbe70=_0x445e0b;_0x478fa5=0xc8;}else{_0x478fa5=0xce;}_0x4d71a0[_0x4779('0x19')](_0x478fa5);return _0x4d71a0['set'](_0x4779('0x20'),_0x19fbb6+'-'+_0x3dbe70+'/'+_0x445e0b)[_0x4779('0x1b')](_0x1dbbe1);}return null;};}function patchUpdates(_0x143ef6){return function(_0x298e25){try{jsonpatch[_0x4779('0x21')](_0x298e25,_0x143ef6,!![]);}catch(_0x1ce270){return BPromise['reject'](_0x1ce270);}return _0x298e25[_0x4779('0x22')]();};}function saveUpdates(_0x4f2158,_0x4ad246){return function(_0xd983f0){if(_0xd983f0){return _0xd983f0[_0x4779('0x23')](_0x4f2158)[_0x4779('0x24')](function(_0x2b7ab6){return _0x2b7ab6;});}return null;};}function removeEntity(_0x555cd6,_0x152887){return function(_0x29a39a){if(_0x29a39a){return _0x29a39a[_0x4779('0x25')]()['then'](function(){_0x555cd6[_0x4779('0x19')](0xcc)[_0x4779('0x1a')]();});}};}function handleEntityNotFound(_0x577b13,_0x1ce2d2){return function(_0x38af24){if(!_0x38af24){_0x577b13['sendStatus'](0x194);}return _0x38af24;};}function handleError(_0x20db7e,_0x277f55){_0x277f55=_0x277f55||0x1f4;return function(_0x211af1){logger[_0x4779('0x26')](_0x211af1[_0x4779('0x27')]);if(_0x211af1[_0x4779('0x28')]){delete _0x211af1[_0x4779('0x28')];}_0x20db7e[_0x4779('0x19')](_0x277f55)['send'](_0x211af1);};}exports[_0x4779('0x29')]=function(_0x1607a5,_0xb028f){var _0x28a261={},_0x8b4c42={},_0x40fb18={'count':0x0,'rows':[]};var _0x13ec28=_[_0x4779('0x2a')](db['FaxQueueReport']['rawAttributes'],function(_0x179717){return{'name':_0x179717[_0x4779('0x2b')],'type':_0x179717[_0x4779('0x2c')][_0x4779('0x2d')]};});_0x8b4c42[_0x4779('0x2e')]=_['map'](_0x13ec28,_0x4779('0x28'));_0x8b4c42[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x1607a5[_0x4779('0x2f')]);_0x8b4c42['filters']=_['intersection'](_0x8b4c42[_0x4779('0x2e')],_0x8b4c42['query']);_0x28a261[_0x4779('0x31')]=_[_0x4779('0x32')](_0x8b4c42[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x33')]));_0x28a261[_0x4779('0x31')]=_0x28a261[_0x4779('0x31')][_0x4779('0x34')]?_0x28a261[_0x4779('0x31')]:_0x8b4c42[_0x4779('0x2e')];if(!_0x1607a5[_0x4779('0x2f')]['hasOwnProperty']('nolimit')){_0x28a261[_0x4779('0x1f')]=qs['limit'](_0x1607a5[_0x4779('0x2f')]['limit']);_0x28a261[_0x4779('0x1c')]=qs[_0x4779('0x1c')](_0x1607a5[_0x4779('0x2f')][_0x4779('0x1c')]);}_0x28a261[_0x4779('0x35')]=qs['sort'](_0x1607a5['query'][_0x4779('0x36')]);_0x28a261[_0x4779('0x37')]=qs[_0x4779('0x38')](_[_0x4779('0x39')](_0x1607a5[_0x4779('0x2f')],_0x8b4c42[_0x4779('0x38')]),_0x13ec28);if(_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]){_0x28a261[_0x4779('0x37')]=_[_0x4779('0x3b')](_0x28a261[_0x4779('0x37')],{'$or':_[_0x4779('0x2a')](_0x13ec28,function(_0x88603f){if(_0x88603f[_0x4779('0x2c')]!==_0x4779('0x3c')){var _0x1a2c16={};_0x1a2c16[_0x88603f[_0x4779('0x28')]]={'$like':'%'+_0x1607a5[_0x4779('0x2f')][_0x4779('0x3a')]+'%'};return _0x1a2c16;}})});}_0x28a261=_['merge']({},_0x28a261,_0x1607a5[_0x4779('0x3d')]);var _0x58ca36={'where':_0x28a261[_0x4779('0x37')]};return db[_0x4779('0x3e')][_0x4779('0x1e')](_0x58ca36)[_0x4779('0x24')](function(_0xc9873e){_0x40fb18[_0x4779('0x1e')]=_0xc9873e;if(_0x1607a5['query'][_0x4779('0x3f')]){_0x28a261['include']=[{'all':!![]}];}return db[_0x4779('0x3e')][_0x4779('0x40')](_0x28a261);})[_0x4779('0x24')](function(_0x3a3589){_0x40fb18[_0x4779('0x41')]=_0x3a3589;return _0x40fb18;})[_0x4779('0x24')](respondWithFilteredResult(_0xb028f,_0x28a261))['catch'](handleError(_0xb028f,null));};exports[_0x4779('0x42')]=function(_0x5cdc2b,_0x20abf7){var _0x3f1889={'raw':!![],'where':{'id':_0x5cdc2b['params']['id']}},_0x2e60ab={};_0x2e60ab[_0x4779('0x2e')]=_[_0x4779('0x30')](db[_0x4779('0x3e')][_0x4779('0x43')]);_0x2e60ab[_0x4779('0x2f')]=_[_0x4779('0x30')](_0x5cdc2b[_0x4779('0x2f')]);_0x2e60ab[_0x4779('0x38')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],_0x2e60ab[_0x4779('0x2f')]);_0x3f1889[_0x4779('0x31')]=_[_0x4779('0x32')](_0x2e60ab[_0x4779('0x2e')],qs[_0x4779('0x33')](_0x5cdc2b['query']['fields']));_0x3f1889[_0x4779('0x31')]=_0x3f1889[_0x4779('0x31')][_0x4779('0x34')]?_0x3f1889[_0x4779('0x31')]:_0x2e60ab[_0x4779('0x2e')];if(_0x5cdc2b[_0x4779('0x2f')][_0x4779('0x3f')]){_0x3f1889[_0x4779('0x44')]=[{'all':!![]}];}_0x3f1889=_['merge']({},_0x3f1889,_0x5cdc2b[_0x4779('0x3d')]);return db[_0x4779('0x3e')][_0x4779('0x45')](_0x3f1889)[_0x4779('0x24')](handleEntityNotFound(_0x20abf7,null))[_0x4779('0x24')](respondWithResult(_0x20abf7,null))[_0x4779('0x46')](handleError(_0x20abf7,null));};exports['create']=function(_0x7f419c,_0x39ecb5){return db[_0x4779('0x3e')][_0x4779('0x47')](_0x7f419c[_0x4779('0x48')],{})['then'](respondWithResult(_0x39ecb5,0xc9))[_0x4779('0x46')](handleError(_0x39ecb5,null));};exports[_0x4779('0x23')]=function(_0x3873d4,_0x4a1040){if(_0x3873d4[_0x4779('0x48')]['id']){delete _0x3873d4['body']['id'];}return db[_0x4779('0x3e')][_0x4779('0x45')]({'where':{'id':_0x3873d4[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a1040,null))[_0x4779('0x24')](saveUpdates(_0x3873d4['body'],null))[_0x4779('0x24')](respondWithResult(_0x4a1040,null))[_0x4779('0x46')](handleError(_0x4a1040,null));};exports[_0x4779('0x25')]=function(_0x58e14e,_0x5dfdb7){return db['FaxQueueReport'][_0x4779('0x45')]({'where':{'id':_0x58e14e[_0x4779('0x49')]['id']}})['then'](handleEntityNotFound(_0x5dfdb7,null))[_0x4779('0x24')](removeEntity(_0x5dfdb7,null))[_0x4779('0x46')](handleError(_0x5dfdb7,null));};exports[_0x4779('0x4a')]=function(_0x24216b,_0x200de3){return db['FaxQueueReport'][_0x4779('0x4a')]()[_0x4779('0x24')](respondWithResult(_0x200de3,null))[_0x4779('0x46')](handleError(_0x200de3,null));}; \ No newline at end of file +var _0x97a2=['apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','length','find','update','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x97a2,0x1b1));var _0x297a=function(_0x3aec54,_0x57f5ab){_0x3aec54=_0x3aec54-0x0;var _0x4b92eb=_0x97a2[_0x3aec54];return _0x4b92eb;};'use strict';var emlformat=require(_0x297a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x297a('0x1'));var jsonpatch=require(_0x297a('0x2'));var rp=require(_0x297a('0x3'));var moment=require(_0x297a('0x4'));var BPromise=require(_0x297a('0x5'));var Mustache=require(_0x297a('0x6'));var util=require(_0x297a('0x7'));var path=require(_0x297a('0x8'));var sox=require('sox');var csv=require(_0x297a('0x9'));var ejs=require(_0x297a('0xa'));var fs=require('fs');var fs_extra=require(_0x297a('0xb'));var _=require(_0x297a('0xc'));var squel=require(_0x297a('0xd'));var crypto=require(_0x297a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x297a('0xf'));var toCsv=require(_0x297a('0x9'));var querystring=require(_0x297a('0x10'));var Papa=require(_0x297a('0x11'));var Redis=require(_0x297a('0x12'));var authService=require(_0x297a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x297a('0x14'))(_0x297a('0x15'));var utils=require(_0x297a('0x16'));var config=require(_0x297a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x297a('0x18'))['db'];function respondWithStatusCode(_0x3db3e9,_0x278334){_0x278334=_0x278334||0xcc;return function(_0x413bc4){if(_0x413bc4){return _0x3db3e9[_0x297a('0x19')](_0x278334);}return _0x3db3e9[_0x297a('0x1a')](_0x278334)[_0x297a('0x1b')]();};}function respondWithResult(_0x5020b0,_0x4d826d){_0x4d826d=_0x4d826d||0xc8;return function(_0x417def){if(_0x417def){return _0x5020b0['status'](_0x4d826d)[_0x297a('0x1c')](_0x417def);}};}function respondWithFilteredResult(_0x1016ea,_0x53f1e4){return function(_0x188540){if(_0x188540){var _0x40f080=typeof _0x53f1e4['offset']===_0x297a('0x1d')&&typeof _0x53f1e4[_0x297a('0x1e')]===_0x297a('0x1d');var _0x4d6b59=_0x188540[_0x297a('0x1f')];var _0x3af847=_0x40f080?0x0:_0x53f1e4[_0x297a('0x20')];var _0x4d6194=_0x40f080?_0x188540[_0x297a('0x1f')]:_0x53f1e4[_0x297a('0x20')]+_0x53f1e4['limit'];var _0x26b878;if(_0x4d6194>=_0x4d6b59){_0x4d6194=_0x4d6b59;_0x26b878=0xc8;}else{_0x26b878=0xce;}_0x1016ea[_0x297a('0x1a')](_0x26b878);return _0x1016ea[_0x297a('0x21')](_0x297a('0x22'),_0x3af847+'-'+_0x4d6194+'/'+_0x4d6b59)[_0x297a('0x1c')](_0x188540);}return null;};}function patchUpdates(_0xde6d1c){return function(_0x3e42c5){try{jsonpatch[_0x297a('0x23')](_0x3e42c5,_0xde6d1c,!![]);}catch(_0x101583){return BPromise[_0x297a('0x24')](_0x101583);}return _0x3e42c5[_0x297a('0x25')]();};}function saveUpdates(_0x5889c7,_0x481f59){return function(_0x5bb38a){if(_0x5bb38a){return _0x5bb38a['update'](_0x5889c7)[_0x297a('0x26')](function(_0xcebadc){return _0xcebadc;});}return null;};}function removeEntity(_0x4ad883,_0xfbf16a){return function(_0x40919d){if(_0x40919d){return _0x40919d[_0x297a('0x27')]()[_0x297a('0x26')](function(){_0x4ad883['status'](0xcc)[_0x297a('0x1b')]();});}};}function handleEntityNotFound(_0x3267eb,_0x33f803){return function(_0x4cc530){if(!_0x4cc530){_0x3267eb[_0x297a('0x19')](0x194);}return _0x4cc530;};}function handleError(_0x67dfdb,_0xbe22aa){_0xbe22aa=_0xbe22aa||0x1f4;return function(_0x3c20f7){logger[_0x297a('0x28')](_0x3c20f7[_0x297a('0x29')]);if(_0x3c20f7[_0x297a('0x2a')]){delete _0x3c20f7[_0x297a('0x2a')];}_0x67dfdb[_0x297a('0x1a')](_0xbe22aa)[_0x297a('0x2b')](_0x3c20f7);};}exports[_0x297a('0x2c')]=function(_0x57327a,_0x26e263){var _0x1204b4={},_0xc30c85={},_0x592cc4={'count':0x0,'rows':[]};var _0x5032fb=_[_0x297a('0x2d')](db[_0x297a('0x2e')][_0x297a('0x2f')],function(_0xd9c747){return{'name':_0xd9c747[_0x297a('0x30')],'type':_0xd9c747[_0x297a('0x31')]['key']};});_0xc30c85['model']=_[_0x297a('0x2d')](_0x5032fb,'name');_0xc30c85[_0x297a('0x32')]=_[_0x297a('0x33')](_0x57327a[_0x297a('0x32')]);_0xc30c85[_0x297a('0x34')]=_[_0x297a('0x35')](_0xc30c85['model'],_0xc30c85[_0x297a('0x32')]);_0x1204b4[_0x297a('0x36')]=_[_0x297a('0x35')](_0xc30c85[_0x297a('0x37')],qs[_0x297a('0x38')](_0x57327a[_0x297a('0x32')][_0x297a('0x38')]));_0x1204b4[_0x297a('0x36')]=_0x1204b4[_0x297a('0x36')]['length']?_0x1204b4[_0x297a('0x36')]:_0xc30c85['model'];if(!_0x57327a[_0x297a('0x32')][_0x297a('0x39')](_0x297a('0x3a'))){_0x1204b4[_0x297a('0x1e')]=qs['limit'](_0x57327a[_0x297a('0x32')]['limit']);_0x1204b4[_0x297a('0x20')]=qs[_0x297a('0x20')](_0x57327a['query'][_0x297a('0x20')]);}_0x1204b4[_0x297a('0x3b')]=qs[_0x297a('0x3c')](_0x57327a['query']['sort']);_0x1204b4[_0x297a('0x3d')]=qs[_0x297a('0x34')](_[_0x297a('0x3e')](_0x57327a['query'],_0xc30c85[_0x297a('0x34')]),_0x5032fb);if(_0x57327a[_0x297a('0x32')][_0x297a('0x3f')]){_0x1204b4[_0x297a('0x3d')]=_[_0x297a('0x40')](_0x1204b4[_0x297a('0x3d')],{'$or':_['map'](_0x5032fb,function(_0x1a4a10){if(_0x1a4a10['type']!==_0x297a('0x41')){var _0x5f410a={};_0x5f410a[_0x1a4a10[_0x297a('0x2a')]]={'$like':'%'+_0x57327a['query'][_0x297a('0x3f')]+'%'};return _0x5f410a;}})});}_0x1204b4=_['merge']({},_0x1204b4,_0x57327a[_0x297a('0x42')]);var _0x11c9a1={'where':_0x1204b4[_0x297a('0x3d')]};return db['FaxQueueReport']['count'](_0x11c9a1)[_0x297a('0x26')](function(_0x544a04){_0x592cc4['count']=_0x544a04;if(_0x57327a['query'][_0x297a('0x43')]){_0x1204b4[_0x297a('0x44')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x297a('0x45')](_0x1204b4);})[_0x297a('0x26')](function(_0x195789){_0x592cc4['rows']=_0x195789;return _0x592cc4;})[_0x297a('0x26')](respondWithFilteredResult(_0x26e263,_0x1204b4))[_0x297a('0x46')](handleError(_0x26e263,null));};exports[_0x297a('0x47')]=function(_0xa01790,_0xe8621e){var _0x47ca9d={'raw':!![],'where':{'id':_0xa01790['params']['id']}},_0x441cdf={};_0x441cdf['model']=_['keys'](db[_0x297a('0x2e')][_0x297a('0x2f')]);_0x441cdf[_0x297a('0x32')]=_['keys'](_0xa01790[_0x297a('0x32')]);_0x441cdf['filters']=_[_0x297a('0x35')](_0x441cdf[_0x297a('0x37')],_0x441cdf[_0x297a('0x32')]);_0x47ca9d[_0x297a('0x36')]=_[_0x297a('0x35')](_0x441cdf[_0x297a('0x37')],qs['fields'](_0xa01790[_0x297a('0x32')][_0x297a('0x38')]));_0x47ca9d['attributes']=_0x47ca9d[_0x297a('0x36')][_0x297a('0x48')]?_0x47ca9d[_0x297a('0x36')]:_0x441cdf[_0x297a('0x37')];if(_0xa01790[_0x297a('0x32')]['includeAll']){_0x47ca9d[_0x297a('0x44')]=[{'all':!![]}];}_0x47ca9d=_[_0x297a('0x40')]({},_0x47ca9d,_0xa01790[_0x297a('0x42')]);return db[_0x297a('0x2e')][_0x297a('0x49')](_0x47ca9d)[_0x297a('0x26')](handleEntityNotFound(_0xe8621e,null))[_0x297a('0x26')](respondWithResult(_0xe8621e,null))[_0x297a('0x46')](handleError(_0xe8621e,null));};exports['create']=function(_0x4d9604,_0x280185){return db[_0x297a('0x2e')]['create'](_0x4d9604['body'],{})[_0x297a('0x26')](respondWithResult(_0x280185,0xc9))[_0x297a('0x46')](handleError(_0x280185,null));};exports[_0x297a('0x4a')]=function(_0x3ea7a8,_0x4baed0){if(_0x3ea7a8[_0x297a('0x4b')]['id']){delete _0x3ea7a8[_0x297a('0x4b')]['id'];}return db[_0x297a('0x2e')][_0x297a('0x49')]({'where':{'id':_0x3ea7a8[_0x297a('0x4c')]['id']}})[_0x297a('0x26')](handleEntityNotFound(_0x4baed0,null))[_0x297a('0x26')](saveUpdates(_0x3ea7a8[_0x297a('0x4b')],null))[_0x297a('0x26')](respondWithResult(_0x4baed0,null))[_0x297a('0x46')](handleError(_0x4baed0,null));};exports['destroy']=function(_0x356f34,_0x5cde7d){return db[_0x297a('0x2e')][_0x297a('0x49')]({'where':{'id':_0x356f34[_0x297a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5cde7d,null))[_0x297a('0x26')](removeEntity(_0x5cde7d,null))[_0x297a('0x46')](handleError(_0x5cde7d,null));};exports[_0x297a('0x4d')]=function(_0x29d974,_0x24694b){return db[_0x297a('0x2e')][_0x297a('0x4d')]()[_0x297a('0x26')](respondWithResult(_0x24694b,null))[_0x297a('0x46')](handleError(_0x24694b,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index cda5cae..80fe115 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x324bb1,_0x4dfa0e){var _0x4504d9=function(_0x3893c6){while(--_0x3893c6){_0x324bb1['push'](_0x324bb1['shift']());}};_0x4504d9(++_0x4dfa0e);}(_0x5fab,0x177));var _0xb5fa=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x5fab[_0x4314d7];return _0x5c599b;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['path','../../config/environment','./faxQueueReport.attributes','define','FaxQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2e57e6,_0x4bbea5){var _0x3c8abf=function(_0x578ee5){while(--_0x578ee5){_0x2e57e6['push'](_0x2e57e6['shift']());}};_0x3c8abf(++_0x4bbea5);}(_0x53ec,0x192));var _0xc53e=function(_0x1ce7cf,_0x1706be){_0x1ce7cf=_0x1ce7cf-0x0;var _0x38fe5a=_0x53ec[_0x1ce7cf];return _0x38fe5a;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 095c571..3b56f00 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 _0xd7c3=['catch','CreateFaxQueueReport','create','body','options','raw','then','update','where','attributes','limit','UpdateFaxQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x55f508,_0x135303){var _0x48a16d=function(_0x18f320){while(--_0x18f320){_0x55f508['push'](_0x55f508['shift']());}};_0x48a16d(++_0x135303);}(_0xd7c3,0xb1));var _0x3d7c=function(_0x40ce37,_0x4d4b42){_0x40ce37=_0x40ce37-0x0;var _0x4c0154=_0xd7c3[_0x40ce37];return _0x4c0154;};'use strict';var _=require('lodash');var util=require(_0x3d7c('0x0'));var moment=require(_0x3d7c('0x1'));var BPromise=require(_0x3d7c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d7c('0x3'));var db=require(_0x3d7c('0x4'))['db'];var utils=require(_0x3d7c('0x5'));var logger=require(_0x3d7c('0x6'))(_0x3d7c('0x7'));var config=require(_0x3d7c('0x8'));var jayson=require(_0x3d7c('0x9'));var client=jayson[_0x3d7c('0xa')][_0x3d7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x383294,_0x597700,_0x10bb11){return new BPromise(function(_0x3cc601,_0x49d4ca){return client[_0x3d7c('0xc')](_0x383294,_0x10bb11)['then'](function(_0x329da4){logger[_0x3d7c('0xd')](_0x3d7c('0xe'),_0x597700,_0x3d7c('0xf'));logger[_0x3d7c('0x10')](_0x3d7c('0x11'),_0x597700,'request\x20sent',JSON[_0x3d7c('0x12')](_0x329da4));if(_0x329da4['error']){if(_0x329da4[_0x3d7c('0x13')]['code']===0x1f4){logger[_0x3d7c('0x13')](_0x3d7c('0xe'),_0x597700,_0x329da4[_0x3d7c('0x13')][_0x3d7c('0x14')]);return _0x49d4ca(_0x329da4[_0x3d7c('0x13')]['message']);}logger[_0x3d7c('0x13')](_0x3d7c('0xe'),_0x597700,_0x329da4[_0x3d7c('0x13')][_0x3d7c('0x14')]);return _0x3cc601(_0x329da4[_0x3d7c('0x13')][_0x3d7c('0x14')]);}else{logger[_0x3d7c('0xd')](_0x3d7c('0xe'),_0x597700,_0x3d7c('0xf'));_0x3cc601(_0x329da4['result']['message']);}})[_0x3d7c('0x15')](function(_0x8064d1){logger[_0x3d7c('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x597700,_0x8064d1);_0x49d4ca(_0x8064d1);});});}exports[_0x3d7c('0x16')]=function(_0x500b29){var _0x2e3c1f=this;return new Promise(function(_0x384e45,_0x27da48){return db['FaxQueueReport'][_0x3d7c('0x17')](_0x500b29[_0x3d7c('0x18')],{'raw':_0x500b29[_0x3d7c('0x19')]?_0x500b29[_0x3d7c('0x19')][_0x3d7c('0x1a')]===undefined?!![]:![]:!![]})[_0x3d7c('0x1b')](function(_0x3043cf){logger[_0x3d7c('0xd')](_0x3d7c('0x16'),_0x500b29);logger['debug']('CreateFaxQueueReport',_0x500b29,JSON[_0x3d7c('0x12')](_0x3043cf));_0x384e45(_0x3043cf);})['catch'](function(_0x375b79){logger[_0x3d7c('0x13')](_0x3d7c('0x16'),_0x375b79[_0x3d7c('0x14')],_0x500b29);_0x27da48(_0x2e3c1f[_0x3d7c('0x13')](0x1f4,_0x375b79['message']));});});};exports['UpdateFaxQueueReport']=function(_0x5e5001){var _0x1b3a05=this;return new Promise(function(_0x55ed27,_0x2a31d5){return db['FaxQueueReport'][_0x3d7c('0x1c')](_0x5e5001[_0x3d7c('0x18')],{'raw':_0x5e5001[_0x3d7c('0x19')]?_0x5e5001[_0x3d7c('0x19')][_0x3d7c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e5001['options']?_0x5e5001[_0x3d7c('0x19')][_0x3d7c('0x1d')]||null:null,'attributes':_0x5e5001[_0x3d7c('0x19')]?_0x5e5001[_0x3d7c('0x19')][_0x3d7c('0x1e')]||null:null,'limit':_0x5e5001[_0x3d7c('0x19')]?_0x5e5001[_0x3d7c('0x19')][_0x3d7c('0x1f')]||null:null})[_0x3d7c('0x1b')](function(_0x2b3085){logger[_0x3d7c('0xd')](_0x3d7c('0x20'),_0x5e5001);logger[_0x3d7c('0x10')]('UpdateFaxQueueReport',_0x5e5001,JSON[_0x3d7c('0x12')](_0x2b3085));_0x55ed27(_0x2b3085);})[_0x3d7c('0x15')](function(_0x4f9e8e){logger[_0x3d7c('0x13')](_0x3d7c('0x20'),_0x4f9e8e[_0x3d7c('0x14')],_0x5e5001);_0x2a31d5(_0x1b3a05[_0x3d7c('0x13')](0x1f4,_0x4f9e8e[_0x3d7c('0x14')]));});});}; \ No newline at end of file +var _0xa17a=['../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','create','body','options','raw','CreateFaxQueueReport','UpdateFaxQueueReport','FaxQueueReport','update','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa17a,0x139));var _0xaa17=function(_0x579681,_0x181f3f){_0x579681=_0x579681-0x0;var _0x3054e0=_0xa17a[_0x579681];return _0x3054e0;};'use strict';var _=require(_0xaa17('0x0'));var util=require(_0xaa17('0x1'));var moment=require(_0xaa17('0x2'));var BPromise=require(_0xaa17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa17('0x4'));var db=require(_0xaa17('0x5'))['db'];var utils=require(_0xaa17('0x6'));var logger=require(_0xaa17('0x7'))('rpc');var config=require(_0xaa17('0x8'));var jayson=require(_0xaa17('0x9'));var client=jayson[_0xaa17('0xa')][_0xaa17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4aa57c,_0x3f6ea7,_0x94a3c6){return new BPromise(function(_0x26dec7,_0x296bc5){return client['request'](_0x4aa57c,_0x94a3c6)[_0xaa17('0xc')](function(_0x717588){logger['info'](_0xaa17('0xd'),_0x3f6ea7,_0xaa17('0xe'));logger[_0xaa17('0xf')](_0xaa17('0x10'),_0x3f6ea7,_0xaa17('0xe'),JSON[_0xaa17('0x11')](_0x717588));if(_0x717588[_0xaa17('0x12')]){if(_0x717588[_0xaa17('0x12')][_0xaa17('0x13')]===0x1f4){logger[_0xaa17('0x12')](_0xaa17('0xd'),_0x3f6ea7,_0x717588[_0xaa17('0x12')][_0xaa17('0x14')]);return _0x296bc5(_0x717588['error'][_0xaa17('0x14')]);}logger[_0xaa17('0x12')](_0xaa17('0xd'),_0x3f6ea7,_0x717588[_0xaa17('0x12')][_0xaa17('0x14')]);return _0x26dec7(_0x717588[_0xaa17('0x12')][_0xaa17('0x14')]);}else{logger[_0xaa17('0x15')](_0xaa17('0xd'),_0x3f6ea7,_0xaa17('0xe'));_0x26dec7(_0x717588['result'][_0xaa17('0x14')]);}})[_0xaa17('0x16')](function(_0x3b71fc){logger[_0xaa17('0x12')](_0xaa17('0xd'),_0x3f6ea7,_0x3b71fc);_0x296bc5(_0x3b71fc);});});}exports['CreateFaxQueueReport']=function(_0xa40fd7){var _0x45f886=this;return new Promise(function(_0x43c4a9,_0x72243a){return db['FaxQueueReport'][_0xaa17('0x17')](_0xa40fd7[_0xaa17('0x18')],{'raw':_0xa40fd7[_0xaa17('0x19')]?_0xa40fd7[_0xaa17('0x19')][_0xaa17('0x1a')]===undefined?!![]:![]:!![]})[_0xaa17('0xc')](function(_0x37d1b4){logger[_0xaa17('0x15')]('CreateFaxQueueReport',_0xa40fd7);logger[_0xaa17('0xf')](_0xaa17('0x1b'),_0xa40fd7,JSON[_0xaa17('0x11')](_0x37d1b4));_0x43c4a9(_0x37d1b4);})[_0xaa17('0x16')](function(_0x363ab8){logger['error'](_0xaa17('0x1b'),_0x363ab8[_0xaa17('0x14')],_0xa40fd7);_0x72243a(_0x45f886['error'](0x1f4,_0x363ab8[_0xaa17('0x14')]));});});};exports[_0xaa17('0x1c')]=function(_0xb40370){var _0x5e320a=this;return new Promise(function(_0x5d842f,_0x439173){return db[_0xaa17('0x1d')][_0xaa17('0x1e')](_0xb40370[_0xaa17('0x18')],{'raw':_0xb40370['options']?_0xb40370[_0xaa17('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb40370[_0xaa17('0x19')]?_0xb40370[_0xaa17('0x19')]['where']||null:null,'attributes':_0xb40370['options']?_0xb40370[_0xaa17('0x19')]['attributes']||null:null,'limit':_0xb40370[_0xaa17('0x19')]?_0xb40370[_0xaa17('0x19')][_0xaa17('0x1f')]||null:null})['then'](function(_0x1e4ed9){logger[_0xaa17('0x15')](_0xaa17('0x1c'),_0xb40370);logger[_0xaa17('0xf')]('UpdateFaxQueueReport',_0xb40370,JSON['stringify'](_0x1e4ed9));_0x5d842f(_0x1e4ed9);})[_0xaa17('0x16')](function(_0xff1d48){logger[_0xaa17('0x12')](_0xaa17('0x1c'),_0xff1d48['message'],_0xb40370);_0x439173(_0x5e320a['error'](0x1f4,_0xff1d48[_0xaa17('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index ab63f38..4049d5a 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 _0x7342=['post','put','update','destroy','util','path','express','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x12f59c,_0x13d956){var _0x2db43e=function(_0x1743fb){while(--_0x1743fb){_0x12f59c['push'](_0x12f59c['shift']());}};_0x2db43e(++_0x13d956);}(_0x7342,0x158));var _0x2734=function(_0x426587,_0x2fcea0){_0x426587=_0x426587-0x0;var _0x32aee5=_0x7342[_0x426587];return _0x32aee5;};'use strict';var multer=require('multer');var util=require(_0x2734('0x0'));var path=require(_0x2734('0x1'));var timeout=require('connect-timeout');var express=require(_0x2734('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2734('0x3'));var interaction=require(_0x2734('0x4'));var config=require('../../config/environment');var controller=require(_0x2734('0x5'));router[_0x2734('0x6')]('/',auth[_0x2734('0x7')](),controller[_0x2734('0x8')]);router['get'](_0x2734('0x9'),auth[_0x2734('0x7')](),controller[_0x2734('0xa')]);router[_0x2734('0x6')](_0x2734('0xb'),auth['isAuthenticated'](),controller[_0x2734('0xc')]);router[_0x2734('0xd')]('/',auth[_0x2734('0x7')](),controller['create']);router[_0x2734('0xe')](_0x2734('0xb'),auth[_0x2734('0x7')](),controller[_0x2734('0xf')]);router['delete'](_0x2734('0xb'),auth[_0x2734('0x7')](),controller[_0x2734('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf52a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x510634,_0x48e830){var _0xdd875e=function(_0x2131d7){while(--_0x2131d7){_0x510634['push'](_0x510634['shift']());}};_0xdd875e(++_0x48e830);}(_0xf52a,0x151));var _0xaf52=function(_0x4e8bd3,_0x19410f){_0x4e8bd3=_0x4e8bd3-0x0;var _0x1b6e92=_0xf52a[_0x4e8bd3];return _0x1b6e92;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf52('0x0'));var timeout=require(_0xaf52('0x1'));var express=require(_0xaf52('0x2'));var router=express[_0xaf52('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xaf52('0x4'));var interaction=require(_0xaf52('0x5'));var config=require(_0xaf52('0x6'));var controller=require('./faxQueueReport.controller');router[_0xaf52('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaf52('0x7')](_0xaf52('0x8'),auth['isAuthenticated'](),controller[_0xaf52('0x9')]);router['get'](_0xaf52('0xa'),auth[_0xaf52('0xb')](),controller[_0xaf52('0xc')]);router[_0xaf52('0xd')]('/',auth['isAuthenticated'](),controller[_0xaf52('0xe')]);router[_0xaf52('0xf')](_0xaf52('0xa'),auth[_0xaf52('0xb')](),controller[_0xaf52('0x10')]);router[_0xaf52('0x11')](_0xaf52('0xa'),auth[_0xaf52('0xb')](),controller[_0xaf52('0x12')]);module[_0xaf52('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 5d2b59e..b74c770 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x53fb47,_0x60af8f){var _0x4d1b28=function(_0x1417aa){while(--_0x1417aa){_0x53fb47['push'](_0x53fb47['shift']());}};_0x4d1b28(++_0x60af8f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x597eb2,_0x165f5c){_0x597eb2=_0x597eb2-0x0;var _0x56875f=_0xf3cd[_0x597eb2];return _0x56875f;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0xf1adf4,_0x512595){var _0x1c44ca=function(_0x1867eb){while(--_0x1867eb){_0xf1adf4['push'](_0xf1adf4['shift']());}};_0x1c44ca(++_0x512595);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4e17ad,_0x2aca32){_0x4e17ad=_0x4e17ad-0x0;var _0x500b4f=_0xf4eb[_0x4e17ad];return _0x500b4f;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index c1c30fd..fd342b6 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 _0x230c=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','reject','update','destroy','then','sendStatus','stack','name','map','FaxTransferReport','rawAttributes','fieldName','type','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs'];(function(_0x5bcf90,_0xfdad1){var _0x2eacb8=function(_0x1d8931){while(--_0x1d8931){_0x5bcf90['push'](_0x5bcf90['shift']());}};_0x2eacb8(++_0xfdad1);}(_0x230c,0x8b));var _0xc230=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x230c[_0x1fa759];return _0x2da9f4;};'use strict';var emlformat=require(_0xc230('0x0'));var rimraf=require(_0xc230('0x1'));var zipdir=require(_0xc230('0x2'));var jsonpatch=require(_0xc230('0x3'));var rp=require(_0xc230('0x4'));var moment=require(_0xc230('0x5'));var BPromise=require(_0xc230('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc230('0x7'));var ejs=require(_0xc230('0x8'));var fs=require('fs');var fs_extra=require(_0xc230('0x9'));var _=require(_0xc230('0xa'));var squel=require('squel');var crypto=require(_0xc230('0xb'));var jsforce=require(_0xc230('0xc'));var deskjs=require(_0xc230('0xd'));var toCsv=require(_0xc230('0x7'));var querystring=require(_0xc230('0xe'));var Papa=require(_0xc230('0xf'));var Redis=require(_0xc230('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc230('0x11'));var as=require(_0xc230('0x12'));var hardwareService=require(_0xc230('0x13'));var logger=require('../../config/logger')(_0xc230('0x14'));var utils=require(_0xc230('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc230('0x16'));var db=require(_0xc230('0x17'))['db'];function respondWithStatusCode(_0x4b1771,_0x2846d6){_0x2846d6=_0x2846d6||0xcc;return function(_0x4bfc29){if(_0x4bfc29){return _0x4b1771['sendStatus'](_0x2846d6);}return _0x4b1771['status'](_0x2846d6)[_0xc230('0x18')]();};}function respondWithResult(_0x472003,_0x268a3a){_0x268a3a=_0x268a3a||0xc8;return function(_0x188283){if(_0x188283){return _0x472003['status'](_0x268a3a)[_0xc230('0x19')](_0x188283);}};}function respondWithFilteredResult(_0x570b4f,_0xb95a5e){return function(_0x262202){if(_0x262202){var _0x11d868=typeof _0xb95a5e['offset']===_0xc230('0x1a')&&typeof _0xb95a5e[_0xc230('0x1b')]==='undefined';var _0x18dc2c=_0x262202['count'];var _0x3c2151=_0x11d868?0x0:_0xb95a5e[_0xc230('0x1c')];var _0x4dae20=_0x11d868?_0x262202[_0xc230('0x1d')]:_0xb95a5e[_0xc230('0x1c')]+_0xb95a5e[_0xc230('0x1b')];var _0x477fbd;if(_0x4dae20>=_0x18dc2c){_0x4dae20=_0x18dc2c;_0x477fbd=0xc8;}else{_0x477fbd=0xce;}_0x570b4f[_0xc230('0x1e')](_0x477fbd);return _0x570b4f[_0xc230('0x1f')](_0xc230('0x20'),_0x3c2151+'-'+_0x4dae20+'/'+_0x18dc2c)['json'](_0x262202);}return null;};}function patchUpdates(_0xfbebea){return function(_0xb205ff){try{jsonpatch['apply'](_0xb205ff,_0xfbebea,!![]);}catch(_0x352e02){return BPromise[_0xc230('0x21')](_0x352e02);}return _0xb205ff['save']();};}function saveUpdates(_0x415369,_0x4b9cf4){return function(_0x5b4022){if(_0x5b4022){return _0x5b4022[_0xc230('0x22')](_0x415369)['then'](function(_0x4670be){return _0x4670be;});}return null;};}function removeEntity(_0x5d14fc,_0xe22657){return function(_0x109633){if(_0x109633){return _0x109633[_0xc230('0x23')]()[_0xc230('0x24')](function(){_0x5d14fc[_0xc230('0x1e')](0xcc)[_0xc230('0x18')]();});}};}function handleEntityNotFound(_0x4770e8,_0x574876){return function(_0x940989){if(!_0x940989){_0x4770e8[_0xc230('0x25')](0x194);}return _0x940989;};}function handleError(_0x50e04d,_0x59bc91){_0x59bc91=_0x59bc91||0x1f4;return function(_0xe4a6aa){logger['error'](_0xe4a6aa[_0xc230('0x26')]);if(_0xe4a6aa[_0xc230('0x27')]){delete _0xe4a6aa[_0xc230('0x27')];}_0x50e04d[_0xc230('0x1e')](_0x59bc91)['send'](_0xe4a6aa);};}exports['index']=function(_0x1b43ed,_0x4f726b){var _0x50ebd5={},_0x536b5f={},_0xe5d5fd={'count':0x0,'rows':[]};var _0x5ad45e=_[_0xc230('0x28')](db[_0xc230('0x29')][_0xc230('0x2a')],function(_0x3927be){return{'name':_0x3927be[_0xc230('0x2b')],'type':_0x3927be[_0xc230('0x2c')][_0xc230('0x2d')]};});_0x536b5f['model']=_[_0xc230('0x28')](_0x5ad45e,'name');_0x536b5f[_0xc230('0x2e')]=_['keys'](_0x1b43ed[_0xc230('0x2e')]);_0x536b5f[_0xc230('0x2f')]=_['intersection'](_0x536b5f[_0xc230('0x30')],_0x536b5f[_0xc230('0x2e')]);_0x50ebd5['attributes']=_[_0xc230('0x31')](_0x536b5f[_0xc230('0x30')],qs[_0xc230('0x32')](_0x1b43ed['query']['fields']));_0x50ebd5[_0xc230('0x33')]=_0x50ebd5['attributes'][_0xc230('0x34')]?_0x50ebd5[_0xc230('0x33')]:_0x536b5f['model'];if(!_0x1b43ed[_0xc230('0x2e')][_0xc230('0x35')](_0xc230('0x36'))){_0x50ebd5[_0xc230('0x1b')]=qs['limit'](_0x1b43ed[_0xc230('0x2e')]['limit']);_0x50ebd5['offset']=qs[_0xc230('0x1c')](_0x1b43ed['query'][_0xc230('0x1c')]);}_0x50ebd5[_0xc230('0x37')]=qs['sort'](_0x1b43ed[_0xc230('0x2e')][_0xc230('0x38')]);_0x50ebd5[_0xc230('0x39')]=qs[_0xc230('0x2f')](_[_0xc230('0x3a')](_0x1b43ed[_0xc230('0x2e')],_0x536b5f['filters']),_0x5ad45e);if(_0x1b43ed[_0xc230('0x2e')][_0xc230('0x3b')]){_0x50ebd5[_0xc230('0x39')]=_[_0xc230('0x3c')](_0x50ebd5['where'],{'$or':_['map'](_0x5ad45e,function(_0x30fbec){if(_0x30fbec[_0xc230('0x2c')]!==_0xc230('0x3d')){var _0x28fedd={};_0x28fedd[_0x30fbec[_0xc230('0x27')]]={'$like':'%'+_0x1b43ed['query'][_0xc230('0x3b')]+'%'};return _0x28fedd;}})});}_0x50ebd5=_[_0xc230('0x3c')]({},_0x50ebd5,_0x1b43ed[_0xc230('0x3e')]);var _0x34e1ea={'where':_0x50ebd5['where']};return db[_0xc230('0x29')][_0xc230('0x1d')](_0x34e1ea)[_0xc230('0x24')](function(_0xf32367){_0xe5d5fd['count']=_0xf32367;if(_0x1b43ed[_0xc230('0x2e')][_0xc230('0x3f')]){_0x50ebd5[_0xc230('0x40')]=[{'all':!![]}];}return db[_0xc230('0x29')]['findAll'](_0x50ebd5);})[_0xc230('0x24')](function(_0x3dfcff){_0xe5d5fd[_0xc230('0x41')]=_0x3dfcff;return _0xe5d5fd;})[_0xc230('0x24')](respondWithFilteredResult(_0x4f726b,_0x50ebd5))[_0xc230('0x42')](handleError(_0x4f726b,null));};exports[_0xc230('0x43')]=function(_0x11b987,_0x3c12df){var _0x3e9dd6={'raw':!![],'where':{'id':_0x11b987[_0xc230('0x44')]['id']}},_0x14d228={};_0x14d228['model']=_[_0xc230('0x45')](db[_0xc230('0x29')]['rawAttributes']);_0x14d228[_0xc230('0x2e')]=_[_0xc230('0x45')](_0x11b987[_0xc230('0x2e')]);_0x14d228[_0xc230('0x2f')]=_['intersection'](_0x14d228['model'],_0x14d228[_0xc230('0x2e')]);_0x3e9dd6[_0xc230('0x33')]=_[_0xc230('0x31')](_0x14d228['model'],qs[_0xc230('0x32')](_0x11b987['query']['fields']));_0x3e9dd6['attributes']=_0x3e9dd6[_0xc230('0x33')][_0xc230('0x34')]?_0x3e9dd6[_0xc230('0x33')]:_0x14d228[_0xc230('0x30')];if(_0x11b987[_0xc230('0x2e')][_0xc230('0x3f')]){_0x3e9dd6[_0xc230('0x40')]=[{'all':!![]}];}_0x3e9dd6=_[_0xc230('0x3c')]({},_0x3e9dd6,_0x11b987[_0xc230('0x3e')]);return db[_0xc230('0x29')][_0xc230('0x46')](_0x3e9dd6)['then'](handleEntityNotFound(_0x3c12df,null))[_0xc230('0x24')](respondWithResult(_0x3c12df,null))[_0xc230('0x42')](handleError(_0x3c12df,null));};exports[_0xc230('0x47')]=function(_0x1d7ed8,_0x375064){return db[_0xc230('0x29')][_0xc230('0x47')](_0x1d7ed8[_0xc230('0x48')],{})['then'](respondWithResult(_0x375064,0xc9))[_0xc230('0x42')](handleError(_0x375064,null));};exports[_0xc230('0x22')]=function(_0x2d2b89,_0x61afb6){if(_0x2d2b89['body']['id']){delete _0x2d2b89[_0xc230('0x48')]['id'];}return db['FaxTransferReport'][_0xc230('0x46')]({'where':{'id':_0x2d2b89[_0xc230('0x44')]['id']}})[_0xc230('0x24')](handleEntityNotFound(_0x61afb6,null))[_0xc230('0x24')](saveUpdates(_0x2d2b89[_0xc230('0x48')],null))[_0xc230('0x24')](respondWithResult(_0x61afb6,null))[_0xc230('0x42')](handleError(_0x61afb6,null));};exports['destroy']=function(_0x4b1502,_0x1ef291){return db[_0xc230('0x29')][_0xc230('0x46')]({'where':{'id':_0x4b1502[_0xc230('0x44')]['id']}})[_0xc230('0x24')](handleEntityNotFound(_0x1ef291,null))[_0xc230('0x24')](removeEntity(_0x1ef291,null))[_0xc230('0x42')](handleError(_0x1ef291,null));};exports['describe']=function(_0x299501,_0x5b5a86){return db[_0xc230('0x29')][_0xc230('0x49')]()[_0xc230('0x24')](respondWithResult(_0x5b5a86,null))[_0xc230('0x42')](handleError(_0x5b5a86,null));}; \ No newline at end of file +var _0xdb32=['count','apply','reject','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','filter','merge','FaxTransferReport','includeAll','include','findAll','catch','options','body','find','params','describe','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined'];(function(_0x121b17,_0x3f519b){var _0x2e587a=function(_0x388752){while(--_0x388752){_0x121b17['push'](_0x121b17['shift']());}};_0x2e587a(++_0x3f519b);}(_0xdb32,0x72));var _0x2db3=function(_0x5842ae,_0x40cf13){_0x5842ae=_0x5842ae-0x0;var _0x363a9e=_0xdb32[_0x5842ae];return _0x363a9e;};'use strict';var emlformat=require(_0x2db3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2db3('0x1'));var moment=require(_0x2db3('0x2'));var BPromise=require(_0x2db3('0x3'));var Mustache=require('mustache');var util=require(_0x2db3('0x4'));var path=require(_0x2db3('0x5'));var sox=require(_0x2db3('0x6'));var csv=require(_0x2db3('0x7'));var ejs=require(_0x2db3('0x8'));var fs=require('fs');var fs_extra=require(_0x2db3('0x9'));var _=require(_0x2db3('0xa'));var squel=require(_0x2db3('0xb'));var crypto=require(_0x2db3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2db3('0xd'));var toCsv=require(_0x2db3('0x7'));var querystring=require(_0x2db3('0xe'));var Papa=require(_0x2db3('0xf'));var Redis=require(_0x2db3('0x10'));var authService=require(_0x2db3('0x11'));var qs=require(_0x2db3('0x12'));var as=require(_0x2db3('0x13'));var hardwareService=require(_0x2db3('0x14'));var logger=require('../../config/logger')(_0x2db3('0x15'));var utils=require(_0x2db3('0x16'));var config=require(_0x2db3('0x17'));var licenseUtil=require(_0x2db3('0x18'));var db=require(_0x2db3('0x19'))['db'];function respondWithStatusCode(_0x266efa,_0x37951a){_0x37951a=_0x37951a||0xcc;return function(_0x21a6ca){if(_0x21a6ca){return _0x266efa[_0x2db3('0x1a')](_0x37951a);}return _0x266efa['status'](_0x37951a)['end']();};}function respondWithResult(_0x50b41e,_0x22ee88){_0x22ee88=_0x22ee88||0xc8;return function(_0x30cad8){if(_0x30cad8){return _0x50b41e[_0x2db3('0x1b')](_0x22ee88)[_0x2db3('0x1c')](_0x30cad8);}};}function respondWithFilteredResult(_0x451851,_0x416a34){return function(_0x48feaf){if(_0x48feaf){var _0x4b47fc=typeof _0x416a34[_0x2db3('0x1d')]==='undefined'&&typeof _0x416a34[_0x2db3('0x1e')]===_0x2db3('0x1f');var _0x45d695=_0x48feaf['count'];var _0x2da000=_0x4b47fc?0x0:_0x416a34[_0x2db3('0x1d')];var _0x3dd6cf=_0x4b47fc?_0x48feaf[_0x2db3('0x20')]:_0x416a34[_0x2db3('0x1d')]+_0x416a34[_0x2db3('0x1e')];var _0x400574;if(_0x3dd6cf>=_0x45d695){_0x3dd6cf=_0x45d695;_0x400574=0xc8;}else{_0x400574=0xce;}_0x451851['status'](_0x400574);return _0x451851['set']('Content-Range',_0x2da000+'-'+_0x3dd6cf+'/'+_0x45d695)[_0x2db3('0x1c')](_0x48feaf);}return null;};}function patchUpdates(_0x5445de){return function(_0xff8941){try{jsonpatch[_0x2db3('0x21')](_0xff8941,_0x5445de,!![]);}catch(_0x101244){return BPromise[_0x2db3('0x22')](_0x101244);}return _0xff8941['save']();};}function saveUpdates(_0x274742,_0x1fd347){return function(_0x41270c){if(_0x41270c){return _0x41270c[_0x2db3('0x23')](_0x274742)['then'](function(_0x47acad){return _0x47acad;});}return null;};}function removeEntity(_0x289401,_0x2d6fc4){return function(_0x3dbc0b){if(_0x3dbc0b){return _0x3dbc0b[_0x2db3('0x24')]()[_0x2db3('0x25')](function(){_0x289401['status'](0xcc)[_0x2db3('0x26')]();});}};}function handleEntityNotFound(_0x59fcaf,_0x55f74a){return function(_0x2e93da){if(!_0x2e93da){_0x59fcaf[_0x2db3('0x1a')](0x194);}return _0x2e93da;};}function handleError(_0x42e043,_0x96bd8c){_0x96bd8c=_0x96bd8c||0x1f4;return function(_0x26f715){logger[_0x2db3('0x27')](_0x26f715['stack']);if(_0x26f715['name']){delete _0x26f715[_0x2db3('0x28')];}_0x42e043[_0x2db3('0x1b')](_0x96bd8c)[_0x2db3('0x29')](_0x26f715);};}exports[_0x2db3('0x2a')]=function(_0x360ef0,_0x5945e4){var _0x28a2c6={},_0x24d5a1={},_0x352b3f={'count':0x0,'rows':[]};var _0x5a97aa=_[_0x2db3('0x2b')](db['FaxTransferReport'][_0x2db3('0x2c')],function(_0x2eea56){return{'name':_0x2eea56[_0x2db3('0x2d')],'type':_0x2eea56['type'][_0x2db3('0x2e')]};});_0x24d5a1[_0x2db3('0x2f')]=_[_0x2db3('0x2b')](_0x5a97aa,_0x2db3('0x28'));_0x24d5a1['query']=_[_0x2db3('0x30')](_0x360ef0[_0x2db3('0x31')]);_0x24d5a1[_0x2db3('0x32')]=_[_0x2db3('0x33')](_0x24d5a1[_0x2db3('0x2f')],_0x24d5a1[_0x2db3('0x31')]);_0x28a2c6[_0x2db3('0x34')]=_[_0x2db3('0x33')](_0x24d5a1['model'],qs[_0x2db3('0x35')](_0x360ef0['query'][_0x2db3('0x35')]));_0x28a2c6['attributes']=_0x28a2c6['attributes'][_0x2db3('0x36')]?_0x28a2c6['attributes']:_0x24d5a1['model'];if(!_0x360ef0[_0x2db3('0x31')][_0x2db3('0x37')](_0x2db3('0x38'))){_0x28a2c6[_0x2db3('0x1e')]=qs['limit'](_0x360ef0[_0x2db3('0x31')]['limit']);_0x28a2c6[_0x2db3('0x1d')]=qs[_0x2db3('0x1d')](_0x360ef0[_0x2db3('0x31')]['offset']);}_0x28a2c6['order']=qs['sort'](_0x360ef0[_0x2db3('0x31')][_0x2db3('0x39')]);_0x28a2c6[_0x2db3('0x3a')]=qs[_0x2db3('0x32')](_[_0x2db3('0x3b')](_0x360ef0[_0x2db3('0x31')],_0x24d5a1[_0x2db3('0x32')]),_0x5a97aa);if(_0x360ef0[_0x2db3('0x31')]['filter']){_0x28a2c6[_0x2db3('0x3a')]=_['merge'](_0x28a2c6[_0x2db3('0x3a')],{'$or':_[_0x2db3('0x2b')](_0x5a97aa,function(_0x5736dc){if(_0x5736dc[_0x2db3('0x3c')]!=='VIRTUAL'){var _0x248df9={};_0x248df9[_0x5736dc[_0x2db3('0x28')]]={'$like':'%'+_0x360ef0[_0x2db3('0x31')][_0x2db3('0x3d')]+'%'};return _0x248df9;}})});}_0x28a2c6=_[_0x2db3('0x3e')]({},_0x28a2c6,_0x360ef0['options']);var _0x408463={'where':_0x28a2c6[_0x2db3('0x3a')]};return db[_0x2db3('0x3f')][_0x2db3('0x20')](_0x408463)['then'](function(_0x470772){_0x352b3f[_0x2db3('0x20')]=_0x470772;if(_0x360ef0[_0x2db3('0x31')][_0x2db3('0x40')]){_0x28a2c6[_0x2db3('0x41')]=[{'all':!![]}];}return db[_0x2db3('0x3f')][_0x2db3('0x42')](_0x28a2c6);})[_0x2db3('0x25')](function(_0x2a1d8b){_0x352b3f['rows']=_0x2a1d8b;return _0x352b3f;})['then'](respondWithFilteredResult(_0x5945e4,_0x28a2c6))[_0x2db3('0x43')](handleError(_0x5945e4,null));};exports['show']=function(_0x5cbe5f,_0x54e540){var _0x7b97e1={'raw':!![],'where':{'id':_0x5cbe5f['params']['id']}},_0x4f68a8={};_0x4f68a8[_0x2db3('0x2f')]=_['keys'](db[_0x2db3('0x3f')][_0x2db3('0x2c')]);_0x4f68a8[_0x2db3('0x31')]=_[_0x2db3('0x30')](_0x5cbe5f['query']);_0x4f68a8[_0x2db3('0x32')]=_[_0x2db3('0x33')](_0x4f68a8[_0x2db3('0x2f')],_0x4f68a8[_0x2db3('0x31')]);_0x7b97e1[_0x2db3('0x34')]=_[_0x2db3('0x33')](_0x4f68a8[_0x2db3('0x2f')],qs[_0x2db3('0x35')](_0x5cbe5f[_0x2db3('0x31')][_0x2db3('0x35')]));_0x7b97e1[_0x2db3('0x34')]=_0x7b97e1[_0x2db3('0x34')][_0x2db3('0x36')]?_0x7b97e1[_0x2db3('0x34')]:_0x4f68a8[_0x2db3('0x2f')];if(_0x5cbe5f[_0x2db3('0x31')][_0x2db3('0x40')]){_0x7b97e1['include']=[{'all':!![]}];}_0x7b97e1=_[_0x2db3('0x3e')]({},_0x7b97e1,_0x5cbe5f[_0x2db3('0x44')]);return db[_0x2db3('0x3f')]['find'](_0x7b97e1)[_0x2db3('0x25')](handleEntityNotFound(_0x54e540,null))[_0x2db3('0x25')](respondWithResult(_0x54e540,null))[_0x2db3('0x43')](handleError(_0x54e540,null));};exports['create']=function(_0x179d33,_0xe7ff2d){return db[_0x2db3('0x3f')]['create'](_0x179d33[_0x2db3('0x45')],{})[_0x2db3('0x25')](respondWithResult(_0xe7ff2d,0xc9))[_0x2db3('0x43')](handleError(_0xe7ff2d,null));};exports[_0x2db3('0x23')]=function(_0x2c0e2f,_0x5f4836){if(_0x2c0e2f[_0x2db3('0x45')]['id']){delete _0x2c0e2f[_0x2db3('0x45')]['id'];}return db[_0x2db3('0x3f')][_0x2db3('0x46')]({'where':{'id':_0x2c0e2f[_0x2db3('0x47')]['id']}})[_0x2db3('0x25')](handleEntityNotFound(_0x5f4836,null))[_0x2db3('0x25')](saveUpdates(_0x2c0e2f[_0x2db3('0x45')],null))[_0x2db3('0x25')](respondWithResult(_0x5f4836,null))[_0x2db3('0x43')](handleError(_0x5f4836,null));};exports[_0x2db3('0x24')]=function(_0x1392aa,_0x318790){return db['FaxTransferReport'][_0x2db3('0x46')]({'where':{'id':_0x1392aa[_0x2db3('0x47')]['id']}})[_0x2db3('0x25')](handleEntityNotFound(_0x318790,null))['then'](removeEntity(_0x318790,null))[_0x2db3('0x43')](handleError(_0x318790,null));};exports[_0x2db3('0x48')]=function(_0x23b17e,_0x3f99c4){return db[_0x2db3('0x3f')][_0x2db3('0x48')]()[_0x2db3('0x25')](respondWithResult(_0x3f99c4,null))[_0x2db3('0x43')](handleError(_0x3f99c4,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 1236c5c..4ed1c55 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 _0x18a6=['FaxTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x48ae97,_0x450240){var _0x13a62f=function(_0x139f44){while(--_0x139f44){_0x48ae97['push'](_0x48ae97['shift']());}};_0x13a62f(++_0x450240);}(_0x18a6,0x1c9));var _0x618a=function(_0xacb29f,_0x23c386){_0xacb29f=_0xacb29f-0x0;var _0x13a818=_0x18a6[_0xacb29f];return _0x13a818;};'use strict';var _=require('lodash');var util=require(_0x618a('0x0'));var logger=require(_0x618a('0x1'))(_0x618a('0x2'));var moment=require(_0x618a('0x3'));var BPromise=require(_0x618a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x618a('0x5'));var rimraf=require(_0x618a('0x6'));var config=require(_0x618a('0x7'));var attributes=require(_0x618a('0x8'));module[_0x618a('0x9')]=function(_0xa7c553,_0x208bcf){return _0xa7c553[_0x618a('0xa')](_0x618a('0xb'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':_0x618a('0xc'),'fields':[_0x618a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1477=['../../config/environment','./faxTransferReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2715cf,_0x517bb2){var _0x1bdcb8=function(_0x5dec7b){while(--_0x5dec7b){_0x2715cf['push'](_0x2715cf['shift']());}};_0x1bdcb8(++_0x517bb2);}(_0x1477,0x122));var _0x7147=function(_0xeecb20,_0xe78b0e){_0xeecb20=_0xeecb20-0x0;var _0x17fb40=_0x1477[_0xeecb20];return _0x17fb40;};'use strict';var _=require(_0x7147('0x0'));var util=require(_0x7147('0x1'));var logger=require(_0x7147('0x2'))(_0x7147('0x3'));var moment=require(_0x7147('0x4'));var BPromise=require('bluebird');var rp=require(_0x7147('0x5'));var fs=require('fs');var path=require(_0x7147('0x6'));var rimraf=require('rimraf');var config=require(_0x7147('0x7'));var attributes=require(_0x7147('0x8'));module[_0x7147('0x9')]=function(_0x2dc2c7,_0x9a5dd5){return _0x2dc2c7[_0x7147('0xa')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index e9f651e..b00e8ee 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 _0xa02b=['client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa02b,0x1e9));var _0xba02=function(_0x410ccc,_0x53359f){_0x410ccc=_0x410ccc-0x0;var _0x3472f5=_0xa02b[_0x410ccc];return _0x3472f5;};'use strict';var _=require(_0xba02('0x0'));var util=require(_0xba02('0x1'));var moment=require(_0xba02('0x2'));var BPromise=require('bluebird');var rs=require(_0xba02('0x3'));var fs=require('fs');var Redis=require(_0xba02('0x4'));var db=require(_0xba02('0x5'))['db'];var utils=require(_0xba02('0x6'));var logger=require(_0xba02('0x7'))(_0xba02('0x8'));var config=require(_0xba02('0x9'));var jayson=require(_0xba02('0xa'));var client=jayson[_0xba02('0xb')][_0xba02('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4bd97f,_0xf358d6,_0x12e737){return new BPromise(function(_0x5c74ec,_0x3a6664){return client[_0xba02('0xd')](_0x4bd97f,_0x12e737)[_0xba02('0xe')](function(_0x18cbb3){logger[_0xba02('0xf')](_0xba02('0x10'),_0xf358d6,_0xba02('0x11'));logger['debug'](_0xba02('0x12'),_0xf358d6,_0xba02('0x11'),JSON[_0xba02('0x13')](_0x18cbb3));if(_0x18cbb3[_0xba02('0x14')]){if(_0x18cbb3['error'][_0xba02('0x15')]===0x1f4){logger[_0xba02('0x14')](_0xba02('0x10'),_0xf358d6,_0x18cbb3[_0xba02('0x14')][_0xba02('0x16')]);return _0x3a6664(_0x18cbb3[_0xba02('0x14')]['message']);}logger[_0xba02('0x14')](_0xba02('0x10'),_0xf358d6,_0x18cbb3[_0xba02('0x14')]['message']);return _0x5c74ec(_0x18cbb3[_0xba02('0x14')][_0xba02('0x16')]);}else{logger[_0xba02('0xf')](_0xba02('0x10'),_0xf358d6,_0xba02('0x11'));_0x5c74ec(_0x18cbb3[_0xba02('0x17')][_0xba02('0x16')]);}})[_0xba02('0x18')](function(_0xcb6a09){logger[_0xba02('0x14')](_0xba02('0x10'),_0xf358d6,_0xcb6a09);_0x3a6664(_0xcb6a09);});});} \ No newline at end of file +var _0x7e38=['result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0x7e38,0x95));var _0x87e3=function(_0x169844,_0x588386){_0x169844=_0x169844-0x0;var _0x8d39fa=_0x7e38[_0x169844];return _0x8d39fa;};'use strict';var _=require(_0x87e3('0x0'));var util=require('util');var moment=require(_0x87e3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x87e3('0x2'))['db'];var utils=require(_0x87e3('0x3'));var logger=require(_0x87e3('0x4'))(_0x87e3('0x5'));var config=require(_0x87e3('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x87e3('0x7')][_0x87e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x201b03,_0x4fa601,_0x13b9d4){return new BPromise(function(_0x3e4b9c,_0x2d25f7){return client[_0x87e3('0x9')](_0x201b03,_0x13b9d4)['then'](function(_0x16167a){logger[_0x87e3('0xa')](_0x87e3('0xb'),_0x4fa601,_0x87e3('0xc'));logger[_0x87e3('0xd')](_0x87e3('0xe'),_0x4fa601,'request\x20sent',JSON[_0x87e3('0xf')](_0x16167a));if(_0x16167a[_0x87e3('0x10')]){if(_0x16167a[_0x87e3('0x10')][_0x87e3('0x11')]===0x1f4){logger[_0x87e3('0x10')](_0x87e3('0xb'),_0x4fa601,_0x16167a[_0x87e3('0x10')][_0x87e3('0x12')]);return _0x2d25f7(_0x16167a[_0x87e3('0x10')][_0x87e3('0x12')]);}logger[_0x87e3('0x10')](_0x87e3('0xb'),_0x4fa601,_0x16167a[_0x87e3('0x10')][_0x87e3('0x12')]);return _0x3e4b9c(_0x16167a[_0x87e3('0x10')][_0x87e3('0x12')]);}else{logger[_0x87e3('0xa')]('FaxTransferReport,\x20%s,\x20%s',_0x4fa601,'request\x20sent');_0x3e4b9c(_0x16167a[_0x87e3('0x13')][_0x87e3('0x12')]);}})[_0x87e3('0x14')](function(_0x16e6eb){logger[_0x87e3('0x10')](_0x87e3('0xb'),_0x4fa601,_0x16e6eb);_0x2d25f7(_0x16e6eb);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index c8c4f91..ff1d6a6 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 _0x8c21=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x8c21,0x19f));var _0x18c2=function(_0x43763f,_0x338f0b){_0x43763f=_0x43763f-0x0;var _0x1132c3=_0x8c21[_0x43763f];return _0x1132c3;};'use strict';var multer=require(_0x18c2('0x0'));var util=require(_0x18c2('0x1'));var path=require('path');var timeout=require(_0x18c2('0x2'));var express=require('express');var router=express[_0x18c2('0x3')]();var fs_extra=require(_0x18c2('0x4'));var auth=require(_0x18c2('0x5'));var interaction=require(_0x18c2('0x6'));var config=require(_0x18c2('0x7'));var controller=require('./faxTransferReport.controller');router[_0x18c2('0x8')]('/',auth['isAuthenticated'](),controller[_0x18c2('0x9')]);router[_0x18c2('0x8')](_0x18c2('0xa'),auth[_0x18c2('0xb')](),controller[_0x18c2('0xc')]);router[_0x18c2('0x8')](_0x18c2('0xd'),auth[_0x18c2('0xb')](),controller[_0x18c2('0xe')]);router[_0x18c2('0xf')]('/',auth[_0x18c2('0xb')](),controller[_0x18c2('0x10')]);router[_0x18c2('0x11')](_0x18c2('0xd'),auth[_0x18c2('0xb')](),controller['update']);router[_0x18c2('0x12')](_0x18c2('0xd'),auth[_0x18c2('0xb')](),controller[_0x18c2('0x13')]);module[_0x18c2('0x14')]=router; \ No newline at end of file +var _0x057f=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x1cf9b2,_0x53d7c8){var _0x4bf6fe=function(_0x48c2e2){while(--_0x48c2e2){_0x1cf9b2['push'](_0x1cf9b2['shift']());}};_0x4bf6fe(++_0x53d7c8);}(_0x057f,0x8f));var _0xf057=function(_0x5e8f7e,_0x56c525){_0x5e8f7e=_0x5e8f7e-0x0;var _0xa388ed=_0x057f[_0x5e8f7e];return _0xa388ed;};'use strict';var multer=require('multer');var util=require(_0xf057('0x0'));var path=require('path');var timeout=require(_0xf057('0x1'));var express=require('express');var router=express[_0xf057('0x2')]();var fs_extra=require(_0xf057('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xf057('0x4'));var config=require(_0xf057('0x5'));var controller=require(_0xf057('0x6'));router[_0xf057('0x7')]('/',auth[_0xf057('0x8')](),controller['index']);router[_0xf057('0x7')](_0xf057('0x9'),auth[_0xf057('0x8')](),controller[_0xf057('0xa')]);router[_0xf057('0x7')](_0xf057('0xb'),auth[_0xf057('0x8')](),controller[_0xf057('0xc')]);router[_0xf057('0xd')]('/',auth[_0xf057('0x8')](),controller[_0xf057('0xe')]);router[_0xf057('0xf')]('/:id',auth[_0xf057('0x8')](),controller[_0xf057('0x10')]);router[_0xf057('0x11')](_0xf057('0xb'),auth[_0xf057('0x8')](),controller[_0xf057('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 934c818..5bf3e6e 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 _0x49bb=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28d262,_0x1744a4){var _0x57949e=function(_0x473721){while(--_0x473721){_0x28d262['push'](_0x28d262['shift']());}};_0x57949e(++_0x1744a4);}(_0x49bb,0x1db));var _0xb49b=function(_0x31b1e4,_0x6cf37e){_0x31b1e4=_0x31b1e4-0x0;var _0x3729cb=_0x49bb[_0x31b1e4];return _0x3729cb;};'use strict';var multer=require(_0xb49b('0x0'));var util=require(_0xb49b('0x1'));var path=require(_0xb49b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb49b('0x3')]();var fs_extra=require(_0xb49b('0x4'));var auth=require(_0xb49b('0x5'));var interaction=require(_0xb49b('0x6'));var config=require(_0xb49b('0x7'));var controller=require('./intDeskAccount.controller');router[_0xb49b('0x8')]('/',auth[_0xb49b('0x9')](),controller[_0xb49b('0xa')]);router[_0xb49b('0x8')](_0xb49b('0xb'),auth[_0xb49b('0x9')](),controller[_0xb49b('0xc')]);router['get'](_0xb49b('0xd'),auth[_0xb49b('0x9')](),controller[_0xb49b('0xe')]);router[_0xb49b('0x8')](_0xb49b('0xf'),auth[_0xb49b('0x9')](),controller[_0xb49b('0x10')]);router[_0xb49b('0x11')]('/',auth['isAuthenticated'](),controller[_0xb49b('0x12')]);router[_0xb49b('0x11')](_0xb49b('0xd'),auth[_0xb49b('0x9')](),controller[_0xb49b('0x13')]);router[_0xb49b('0x14')](_0xb49b('0xb'),auth[_0xb49b('0x9')](),controller[_0xb49b('0x15')]);router['delete'](_0xb49b('0xb'),auth[_0xb49b('0x9')](),controller['destroy']);module[_0xb49b('0x16')]=router; \ No newline at end of file +var _0x87be=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','isAuthenticated','create','post','addConfiguration','update','delete'];(function(_0xab2afb,_0x546bfb){var _0x25262b=function(_0x3bd92d){while(--_0x3bd92d){_0xab2afb['push'](_0xab2afb['shift']());}};_0x25262b(++_0x546bfb);}(_0x87be,0xfb));var _0xe87b=function(_0x26fdd2,_0x215d62){_0x26fdd2=_0x26fdd2-0x0;var _0x1a2c8d=_0x87be[_0x26fdd2];return _0x1a2c8d;};'use strict';var multer=require(_0xe87b('0x0'));var util=require(_0xe87b('0x1'));var path=require(_0xe87b('0x2'));var timeout=require(_0xe87b('0x3'));var express=require(_0xe87b('0x4'));var router=express[_0xe87b('0x5')]();var fs_extra=require(_0xe87b('0x6'));var auth=require(_0xe87b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe87b('0x8'));var controller=require(_0xe87b('0x9'));router[_0xe87b('0xa')]('/',auth['isAuthenticated'](),controller[_0xe87b('0xb')]);router[_0xe87b('0xa')](_0xe87b('0xc'),auth['isAuthenticated'](),controller[_0xe87b('0xd')]);router[_0xe87b('0xa')](_0xe87b('0xe'),auth['isAuthenticated'](),controller[_0xe87b('0xf')]);router[_0xe87b('0xa')](_0xe87b('0x10'),auth['isAuthenticated'](),controller[_0xe87b('0x11')]);router['post']('/',auth[_0xe87b('0x12')](),controller[_0xe87b('0x13')]);router[_0xe87b('0x14')](_0xe87b('0xe'),auth[_0xe87b('0x12')](),controller[_0xe87b('0x15')]);router['put'](_0xe87b('0xc'),auth[_0xe87b('0x12')](),controller[_0xe87b('0x16')]);router[_0xe87b('0x17')](_0xe87b('0xc'),auth[_0xe87b('0x12')](),controller['destroy']);module[_0xe87b('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 8fc2fa0..7d00e90 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 _0x7d95=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x3fd11e,_0xc45f93){var _0x250585=function(_0xb0fba4){while(--_0xb0fba4){_0x3fd11e['push'](_0x3fd11e['shift']());}};_0x250585(++_0xc45f93);}(_0x7d95,0xe8));var _0x57d9=function(_0x1fbde3,_0x59da39){_0x1fbde3=_0x1fbde3-0x0;var _0x2b092f=_0x7d95[_0x1fbde3];return _0x2b092f;};'use strict';var Sequelize=require(_0x57d9('0x0'));module[_0x57d9('0x1')]={'name':{'type':Sequelize[_0x57d9('0x2')]},'description':{'type':Sequelize[_0x57d9('0x2')]},'username':{'type':Sequelize[_0x57d9('0x2')]},'remoteUri':{'type':Sequelize[_0x57d9('0x2')]},'authType':{'type':Sequelize[_0x57d9('0x3')](_0x57d9('0x4')),'defaultValue':_0x57d9('0x4')},'password':{'type':Sequelize[_0x57d9('0x2')]},'consumerKey':{'type':Sequelize[_0x57d9('0x2')]},'consumerSecret':{'type':Sequelize[_0x57d9('0x2')]},'token':{'type':Sequelize[_0x57d9('0x2')]},'tokenSecret':{'type':Sequelize[_0x57d9('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x57d9('0x5'),_0x57d9('0x6')),'defaultValue':_0x57d9('0x5')}}; \ No newline at end of file +var _0xc7cb=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x338a3c,_0x1746cb){var _0x52d0d7=function(_0x3e77c1){while(--_0x3e77c1){_0x338a3c['push'](_0x338a3c['shift']());}};_0x52d0d7(++_0x1746cb);}(_0xc7cb,0xd8));var _0xbc7c=function(_0x362013,_0x3330f9){_0x362013=_0x362013-0x0;var _0x24a80a=_0xc7cb[_0x362013];return _0x24a80a;};'use strict';var Sequelize=require(_0xbc7c('0x0'));module[_0xbc7c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbc7c('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbc7c('0x2')]},'authType':{'type':Sequelize[_0xbc7c('0x3')](_0xbc7c('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xbc7c('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xbc7c('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbc7c('0x3')](_0xbc7c('0x5'),_0xbc7c('0x6')),'defaultValue':_0xbc7c('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 833bf48..960f64b 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 _0x4080=['lastIndexOf','format','application/json','basic','headers','Authorization','%s:%s','toString','base64','concat','entries','test','statusCode','error','getFields','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','DeskAccount','includeAll','include','findAll','rows','catch','params','length','options','find','create','body','destroy','getConfigurations','DeskConfiguration','findOne','Subjects','getSubjects','channel','type','Descriptions','DeskField','priority','remoteUri','authType','username','password','consumerKey','tokenSecret','slice','substring'];(function(_0x2f5cd5,_0x4746c6){var _0x5bf7ca=function(_0xf4d34a){while(--_0xf4d34a){_0x2f5cd5['push'](_0x2f5cd5['shift']());}};_0x5bf7ca(++_0x4746c6);}(_0x4080,0xea));var _0x0408=function(_0x5c027f,_0xa40135){_0x5c027f=_0x5c027f-0x0;var _0x5392f3=_0x4080[_0x5c027f];return _0x5392f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0408('0x0'));var zipdir=require(_0x0408('0x1'));var jsonpatch=require(_0x0408('0x2'));var rp=require(_0x0408('0x3'));var moment=require('moment');var BPromise=require(_0x0408('0x4'));var Mustache=require('mustache');var util=require(_0x0408('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0408('0x6'));var ejs=require(_0x0408('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0408('0x8'));var squel=require(_0x0408('0x9'));var crypto=require(_0x0408('0xa'));var jsforce=require(_0x0408('0xb'));var deskjs=require(_0x0408('0xc'));var toCsv=require(_0x0408('0x6'));var querystring=require(_0x0408('0xd'));var Papa=require(_0x0408('0xe'));var Redis=require(_0x0408('0xf'));var authService=require(_0x0408('0x10'));var qs=require(_0x0408('0x11'));var as=require(_0x0408('0x12'));var hardwareService=require(_0x0408('0x13'));var logger=require('../../config/logger')(_0x0408('0x14'));var utils=require(_0x0408('0x15'));var config=require(_0x0408('0x16'));var licenseUtil=require(_0x0408('0x17'));var db=require(_0x0408('0x18'))['db'];var integrations=require(_0x0408('0x19'));function respondWithStatusCode(_0x24204d,_0x277d6a){_0x277d6a=_0x277d6a||0xcc;return function(_0x5484d7){if(_0x5484d7){return _0x24204d[_0x0408('0x1a')](_0x277d6a);}return _0x24204d[_0x0408('0x1b')](_0x277d6a)[_0x0408('0x1c')]();};}function respondWithResult(_0x14c14a,_0x2b829c){_0x2b829c=_0x2b829c||0xc8;return function(_0x1b0cc7){if(_0x1b0cc7){return _0x14c14a['status'](_0x2b829c)[_0x0408('0x1d')](_0x1b0cc7);}};}function respondWithFilteredResult(_0x4e28f3,_0x8bb4f3){return function(_0x59bfab){if(_0x59bfab){var _0x1c2ce9=typeof _0x8bb4f3[_0x0408('0x1e')]===_0x0408('0x1f')&&typeof _0x8bb4f3['limit']===_0x0408('0x1f');var _0x571ae1=_0x59bfab['count'];var _0x4bcaff=_0x1c2ce9?0x0:_0x8bb4f3[_0x0408('0x1e')];var _0x551c35=_0x1c2ce9?_0x59bfab[_0x0408('0x20')]:_0x8bb4f3[_0x0408('0x1e')]+_0x8bb4f3[_0x0408('0x21')];var _0x2407fa;if(_0x551c35>=_0x571ae1){_0x551c35=_0x571ae1;_0x2407fa=0xc8;}else{_0x2407fa=0xce;}_0x4e28f3['status'](_0x2407fa);return _0x4e28f3[_0x0408('0x22')](_0x0408('0x23'),_0x4bcaff+'-'+_0x551c35+'/'+_0x571ae1)[_0x0408('0x1d')](_0x59bfab);}return null;};}function patchUpdates(_0x3ee0c6){return function(_0x11a64e){try{jsonpatch[_0x0408('0x24')](_0x11a64e,_0x3ee0c6,!![]);}catch(_0x1e71a2){return BPromise[_0x0408('0x25')](_0x1e71a2);}return _0x11a64e['save']();};}function saveUpdates(_0x2e2f65,_0x21434c){return function(_0x437325){if(_0x437325){return _0x437325[_0x0408('0x26')](_0x2e2f65)[_0x0408('0x27')](function(_0x386aa8){return _0x386aa8;});}return null;};}function removeEntity(_0x7c583e,_0x2aa405){return function(_0x3fa37d){if(_0x3fa37d){return _0x3fa37d['destroy']()[_0x0408('0x27')](function(){_0x7c583e['status'](0xcc)[_0x0408('0x1c')]();});}};}function handleEntityNotFound(_0x41cb79,_0x40e146){return function(_0x5719d8){if(!_0x5719d8){_0x41cb79[_0x0408('0x1a')](0x194);}return _0x5719d8;};}function handleError(_0x27b759,_0x583d72){_0x583d72=_0x583d72||0x1f4;return function(_0x596ce1){logger['error'](_0x596ce1['stack']);if(_0x596ce1[_0x0408('0x28')]){delete _0x596ce1[_0x0408('0x28')];}_0x27b759['status'](_0x583d72)[_0x0408('0x29')](_0x596ce1);};}exports[_0x0408('0x2a')]=function(_0x50e969,_0x1af5de){var _0x5d5239={},_0x2f51f3={},_0x3d0f51={'count':0x0,'rows':[]};var _0x4b10ed=_['map'](db['DeskAccount'][_0x0408('0x2b')],function(_0x16fc01){return{'name':_0x16fc01[_0x0408('0x2c')],'type':_0x16fc01['type'][_0x0408('0x2d')]};});_0x2f51f3[_0x0408('0x2e')]=_[_0x0408('0x2f')](_0x4b10ed,'name');_0x2f51f3['query']=_[_0x0408('0x30')](_0x50e969[_0x0408('0x31')]);_0x2f51f3[_0x0408('0x32')]=_[_0x0408('0x33')](_0x2f51f3[_0x0408('0x2e')],_0x2f51f3[_0x0408('0x31')]);_0x5d5239['attributes']=_[_0x0408('0x33')](_0x2f51f3[_0x0408('0x2e')],qs[_0x0408('0x34')](_0x50e969[_0x0408('0x31')][_0x0408('0x34')]));_0x5d5239[_0x0408('0x35')]=_0x5d5239[_0x0408('0x35')]['length']?_0x5d5239[_0x0408('0x35')]:_0x2f51f3[_0x0408('0x2e')];if(!_0x50e969[_0x0408('0x31')][_0x0408('0x36')](_0x0408('0x37'))){_0x5d5239[_0x0408('0x21')]=qs[_0x0408('0x21')](_0x50e969[_0x0408('0x31')][_0x0408('0x21')]);_0x5d5239[_0x0408('0x1e')]=qs['offset'](_0x50e969[_0x0408('0x31')][_0x0408('0x1e')]);}_0x5d5239[_0x0408('0x38')]=qs[_0x0408('0x39')](_0x50e969['query']['sort']);_0x5d5239[_0x0408('0x3a')]=qs[_0x0408('0x32')](_['pick'](_0x50e969[_0x0408('0x31')],_0x2f51f3[_0x0408('0x32')]),_0x4b10ed);if(_0x50e969['query'][_0x0408('0x3b')]){_0x5d5239[_0x0408('0x3a')]=_[_0x0408('0x3c')](_0x5d5239[_0x0408('0x3a')],{'$or':_[_0x0408('0x2f')](_0x4b10ed,function(_0x3b65a3){if(_0x3b65a3['type']!==_0x0408('0x3d')){var _0x12aa82={};_0x12aa82[_0x3b65a3[_0x0408('0x28')]]={'$like':'%'+_0x50e969[_0x0408('0x31')][_0x0408('0x3b')]+'%'};return _0x12aa82;}})});}_0x5d5239=_[_0x0408('0x3c')]({},_0x5d5239,_0x50e969['options']);var _0x44c210={'where':_0x5d5239[_0x0408('0x3a')]};return db[_0x0408('0x3e')][_0x0408('0x20')](_0x44c210)[_0x0408('0x27')](function(_0x4f98af){_0x3d0f51[_0x0408('0x20')]=_0x4f98af;if(_0x50e969['query'][_0x0408('0x3f')]){_0x5d5239[_0x0408('0x40')]=[{'all':!![]}];}return db[_0x0408('0x3e')][_0x0408('0x41')](_0x5d5239);})['then'](function(_0x2267cb){_0x3d0f51[_0x0408('0x42')]=_0x2267cb;return _0x3d0f51;})['then'](respondWithFilteredResult(_0x1af5de,_0x5d5239))[_0x0408('0x43')](handleError(_0x1af5de,null));};exports['show']=function(_0x144302,_0x82bfb7){var _0x1d17d3={'raw':![],'where':{'id':_0x144302[_0x0408('0x44')]['id']}},_0x268513={};_0x268513[_0x0408('0x2e')]=_[_0x0408('0x30')](db[_0x0408('0x3e')][_0x0408('0x2b')]);_0x268513[_0x0408('0x31')]=_['keys'](_0x144302[_0x0408('0x31')]);_0x268513['filters']=_[_0x0408('0x33')](_0x268513[_0x0408('0x2e')],_0x268513['query']);_0x1d17d3[_0x0408('0x35')]=_[_0x0408('0x33')](_0x268513[_0x0408('0x2e')],qs['fields'](_0x144302[_0x0408('0x31')]['fields']));_0x1d17d3[_0x0408('0x35')]=_0x1d17d3[_0x0408('0x35')][_0x0408('0x45')]?_0x1d17d3['attributes']:_0x268513['model'];if(_0x144302['query'][_0x0408('0x3f')]){_0x1d17d3[_0x0408('0x40')]=[{'all':!![]}];}_0x1d17d3=_['merge']({},_0x1d17d3,_0x144302[_0x0408('0x46')]);return db[_0x0408('0x3e')][_0x0408('0x47')](_0x1d17d3)[_0x0408('0x27')](handleEntityNotFound(_0x82bfb7,null))['then'](respondWithResult(_0x82bfb7,null))[_0x0408('0x43')](handleError(_0x82bfb7,null));};exports[_0x0408('0x48')]=function(_0x5dd839,_0x37e00e){return db[_0x0408('0x3e')][_0x0408('0x48')](_0x5dd839['body'],{})['then'](respondWithResult(_0x37e00e,0xc9))[_0x0408('0x43')](handleError(_0x37e00e,null));};exports['update']=function(_0x5ef10c,_0x394e74){if(_0x5ef10c[_0x0408('0x49')]['id']){delete _0x5ef10c[_0x0408('0x49')]['id'];}return db[_0x0408('0x3e')]['find']({'where':{'id':_0x5ef10c[_0x0408('0x44')]['id']}})[_0x0408('0x27')](handleEntityNotFound(_0x394e74,null))[_0x0408('0x27')](saveUpdates(_0x5ef10c[_0x0408('0x49')],null))[_0x0408('0x27')](respondWithResult(_0x394e74,null))[_0x0408('0x43')](handleError(_0x394e74,null));};exports[_0x0408('0x4a')]=function(_0x4d2a16,_0x5e299d){return db[_0x0408('0x3e')][_0x0408('0x47')]({'where':{'id':_0x4d2a16[_0x0408('0x44')]['id']}})[_0x0408('0x27')](handleEntityNotFound(_0x5e299d,null))['then'](removeEntity(_0x5e299d,null))[_0x0408('0x43')](handleError(_0x5e299d,null));};exports[_0x0408('0x4b')]=function(_0x2baad4,_0x39034d,_0x2e4470){var _0x1b450c={};var _0x38e72f={};var _0x125006;var _0x5a44bd;return db[_0x0408('0x3e')]['findOne']({'where':{'id':_0x2baad4[_0x0408('0x44')]['id']}})[_0x0408('0x27')](handleEntityNotFound(_0x39034d,null))['then'](function(_0x3f19bc){if(_0x3f19bc){_0x125006=_0x3f19bc;_0x38e72f['model']=_[_0x0408('0x30')](db[_0x0408('0x4c')]['rawAttributes']);_0x38e72f[_0x0408('0x31')]=_[_0x0408('0x30')](_0x2baad4['query']);_0x38e72f[_0x0408('0x32')]=_['intersection'](_0x38e72f[_0x0408('0x2e')],_0x38e72f[_0x0408('0x31')]);_0x1b450c[_0x0408('0x35')]=_[_0x0408('0x33')](_0x38e72f['model'],qs['fields'](_0x2baad4[_0x0408('0x31')]['fields']));_0x1b450c['attributes']=_0x1b450c[_0x0408('0x35')]['length']?_0x1b450c['attributes']:_0x38e72f[_0x0408('0x2e')];_0x1b450c['order']=qs[_0x0408('0x39')](_0x2baad4[_0x0408('0x31')]['sort']);_0x1b450c['where']=qs['filters'](_['pick'](_0x2baad4[_0x0408('0x31')],_0x38e72f['filters']));if(_0x2baad4[_0x0408('0x31')]['filter']){_0x1b450c['where']=_['merge'](_0x1b450c[_0x0408('0x3a')],{'$or':_[_0x0408('0x2f')](_0x1b450c[_0x0408('0x35')],function(_0x6ca522){var _0x383029={};_0x383029[_0x6ca522]={'$like':'%'+_0x2baad4[_0x0408('0x31')][_0x0408('0x3b')]+'%'};return _0x383029;})});}_0x1b450c=_['merge']({},_0x1b450c,_0x2baad4[_0x0408('0x46')]);return _0x125006[_0x0408('0x4b')](_0x1b450c);}})['then'](function(_0x422c15){if(_0x422c15){_0x5a44bd=_0x422c15[_0x0408('0x45')];if(!_0x2baad4[_0x0408('0x31')][_0x0408('0x36')](_0x0408('0x37'))){_0x1b450c['limit']=qs[_0x0408('0x21')](_0x2baad4[_0x0408('0x31')][_0x0408('0x21')]);_0x1b450c['offset']=qs[_0x0408('0x1e')](_0x2baad4['query'][_0x0408('0x1e')]);}return _0x125006[_0x0408('0x4b')](_0x1b450c);}})[_0x0408('0x27')](function(_0x9a3f5c){if(_0x9a3f5c){return _0x9a3f5c?{'count':_0x5a44bd,'rows':_0x9a3f5c}:null;}})[_0x0408('0x27')](respondWithResult(_0x39034d,null))[_0x0408('0x43')](handleError(_0x39034d,null));};exports['addConfiguration']=function(_0x385129,_0x553148,_0x13dea9){if(_0x385129[_0x0408('0x49')]['id']){delete _0x385129['body']['id'];}return db['DeskAccount'][_0x0408('0x4d')]({'where':{'id':_0x385129[_0x0408('0x44')]['id']}})[_0x0408('0x27')](handleEntityNotFound(_0x553148,null))[_0x0408('0x27')](function(_0x2aa797){if(_0x2aa797){_0x385129[_0x0408('0x49')]['AccountId']=_0x2aa797['id'];_0x385129['body'][_0x0408('0x4e')]=integrations[_0x0408('0x4f')](_0x385129[_0x0408('0x49')][_0x0408('0x50')],_0x385129[_0x0408('0x49')][_0x0408('0x51')]);_0x385129[_0x0408('0x49')][_0x0408('0x52')]=integrations['getDescriptions'](_0x385129[_0x0408('0x49')][_0x0408('0x50')],_0x385129[_0x0408('0x49')][_0x0408('0x51')]);return db['DeskConfiguration'][_0x0408('0x48')](_0x385129[_0x0408('0x49')],{'include':[{'model':db[_0x0408('0x53')],'as':'Subjects'},{'model':db[_0x0408('0x53')],'as':_0x0408('0x52')}]});}return null;})[_0x0408('0x27')](respondWithResult(_0x553148,null))[_0x0408('0x43')](handleError(_0x553148,null));};exports['getFields']=function(_0x35093c,_0x2c44f3,_0x9042d8){var _0x172739=[{'name':_0x0408('0x54'),'label':_0x0408('0x54'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x5ba657='';return db[_0x0408('0x3e')][_0x0408('0x4d')]({'where':{'id':_0x35093c[_0x0408('0x44')]['id']},'attributes':['id',_0x0408('0x55'),_0x0408('0x56'),_0x0408('0x57'),_0x0408('0x58'),_0x0408('0x59'),'consumerSecret','token',_0x0408('0x5a')]})[_0x0408('0x27')](handleEntityNotFound(_0x2c44f3,null))[_0x0408('0x27')](function(_0x201d6f){if(_0x201d6f){_0x5ba657=_0x201d6f[_0x0408('0x55')];var _0x2cbb1e=_0x5ba657[_0x0408('0x5b')](-0x1);if(_0x2cbb1e==='/'){_0x5ba657=_0x5ba657[_0x0408('0x5c')](0x0,_0x5ba657[_0x0408('0x5d')](_0x2cbb1e));}var _0x5917d4={'method':'GET','uri':util[_0x0408('0x5e')]('%s/custom_fields',_0x5ba657),'headers':{'Content-Type':'application/json','Accept':_0x0408('0x5f')},'json':!![]};if(_0x201d6f['authType']===_0x0408('0x60')){_0x5917d4[_0x0408('0x61')][_0x0408('0x62')]=util[_0x0408('0x5e')]('Basic\x20%s',new Buffer(util[_0x0408('0x5e')](_0x0408('0x63'),_0x201d6f['username'],_0x201d6f[_0x0408('0x58')]))[_0x0408('0x64')](_0x0408('0x65')));}return rp(_0x5917d4)[_0x0408('0x27')](function(_0xd31f93){return _0x172739[_0x0408('0x66')](_[_0x0408('0x2f')](_0xd31f93['_embedded'][_0x0408('0x67')],function(_0x18540c){return{'id':_0x18540c[_0x0408('0x28')],'name':_0x18540c[_0x0408('0x28')],'type':_0x18540c[_0x0408('0x51')],'active':_0x18540c['active'],'label':_0x18540c['label'],'custom':!![]};}));});}})[_0x0408('0x27')](function(_0x24f380){return{'count':_0x24f380[_0x0408('0x45')],'rows':_0x24f380};})['then'](respondWithResult(_0x2c44f3,null))[_0x0408('0x43')](function(_0x29a09b){var _0x46daf8=_0x35093c[_0x0408('0x31')][_0x0408('0x68')]?0x1f4:_0x29a09b[_0x0408('0x69')]||0x1f4;logger[_0x0408('0x6a')]('getFields,\x20%s,\x20%s,\x20%s',_0x0408('0x6b'),_0x46daf8,JSON['stringify'](_0x29a09b));delete _0x29a09b[_0x0408('0x28')];if(_0x46daf8===0x191){_0x46daf8=0x190;}_0x2c44f3[_0x0408('0x1b')](_0x46daf8)[_0x0408('0x29')](_0x35093c[_0x0408('0x31')][_0x0408('0x68')]?{'message':_0x0408('0x6c'),'statusCode':_0x29a09b[_0x0408('0x69')]}:_0x29a09b);});}; \ No newline at end of file +var _0x1903=['_embedded','entries','active','test','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','json','offset','limit','count','status','set','Content-Range','apply','save','then','destroy','end','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','filter','VIRTUAL','merge','options','where','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','getConfigurations','findOne','DeskConfiguration','length','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','%s:%s','toString','base64','concat'];(function(_0x860c37,_0x4bdddd){var _0x4d1ad3=function(_0x3da5df){while(--_0x3da5df){_0x860c37['push'](_0x860c37['shift']());}};_0x4d1ad3(++_0x4bdddd);}(_0x1903,0x79));var _0x3190=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1903[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3190('0x0'));var zipdir=require(_0x3190('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3190('0x2'));var moment=require(_0x3190('0x3'));var BPromise=require(_0x3190('0x4'));var Mustache=require(_0x3190('0x5'));var util=require(_0x3190('0x6'));var path=require(_0x3190('0x7'));var sox=require(_0x3190('0x8'));var csv=require(_0x3190('0x9'));var ejs=require(_0x3190('0xa'));var fs=require('fs');var fs_extra=require(_0x3190('0xb'));var _=require(_0x3190('0xc'));var squel=require(_0x3190('0xd'));var crypto=require(_0x3190('0xe'));var jsforce=require(_0x3190('0xf'));var deskjs=require(_0x3190('0x10'));var toCsv=require(_0x3190('0x9'));var querystring=require('querystring');var Papa=require(_0x3190('0x11'));var Redis=require(_0x3190('0x12'));var authService=require(_0x3190('0x13'));var qs=require(_0x3190('0x14'));var as=require(_0x3190('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3190('0x16'))('api');var utils=require(_0x3190('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3190('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32924c,_0x2d89be){_0x2d89be=_0x2d89be||0xcc;return function(_0x404c4e){if(_0x404c4e){return _0x32924c[_0x3190('0x19')](_0x2d89be);}return _0x32924c['status'](_0x2d89be)['end']();};}function respondWithResult(_0x4549fa,_0x130713){_0x130713=_0x130713||0xc8;return function(_0xb62e38){if(_0xb62e38){return _0x4549fa['status'](_0x130713)[_0x3190('0x1a')](_0xb62e38);}};}function respondWithFilteredResult(_0xc540bc,_0x2d5dda){return function(_0x3fb0ea){if(_0x3fb0ea){var _0xff86f2=typeof _0x2d5dda[_0x3190('0x1b')]==='undefined'&&typeof _0x2d5dda[_0x3190('0x1c')]==='undefined';var _0x4c5329=_0x3fb0ea['count'];var _0x5c8efb=_0xff86f2?0x0:_0x2d5dda[_0x3190('0x1b')];var _0x8c6fa2=_0xff86f2?_0x3fb0ea[_0x3190('0x1d')]:_0x2d5dda[_0x3190('0x1b')]+_0x2d5dda[_0x3190('0x1c')];var _0x171fdd;if(_0x8c6fa2>=_0x4c5329){_0x8c6fa2=_0x4c5329;_0x171fdd=0xc8;}else{_0x171fdd=0xce;}_0xc540bc[_0x3190('0x1e')](_0x171fdd);return _0xc540bc[_0x3190('0x1f')](_0x3190('0x20'),_0x5c8efb+'-'+_0x8c6fa2+'/'+_0x4c5329)['json'](_0x3fb0ea);}return null;};}function patchUpdates(_0x2cca61){return function(_0xb20c8d){try{jsonpatch[_0x3190('0x21')](_0xb20c8d,_0x2cca61,!![]);}catch(_0x5845b9){return BPromise['reject'](_0x5845b9);}return _0xb20c8d[_0x3190('0x22')]();};}function saveUpdates(_0x185837,_0x477a9f){return function(_0x2991dc){if(_0x2991dc){return _0x2991dc['update'](_0x185837)[_0x3190('0x23')](function(_0x44c1ea){return _0x44c1ea;});}return null;};}function removeEntity(_0x5a4046,_0x470b97){return function(_0x35c7c0){if(_0x35c7c0){return _0x35c7c0[_0x3190('0x24')]()[_0x3190('0x23')](function(){_0x5a4046[_0x3190('0x1e')](0xcc)[_0x3190('0x25')]();});}};}function handleEntityNotFound(_0xa21af4,_0x2012e1){return function(_0x54c6f7){if(!_0x54c6f7){_0xa21af4[_0x3190('0x19')](0x194);}return _0x54c6f7;};}function handleError(_0x129031,_0x49cda5){_0x49cda5=_0x49cda5||0x1f4;return function(_0xf5b7dd){logger[_0x3190('0x26')](_0xf5b7dd[_0x3190('0x27')]);if(_0xf5b7dd['name']){delete _0xf5b7dd[_0x3190('0x28')];}_0x129031[_0x3190('0x1e')](_0x49cda5)[_0x3190('0x29')](_0xf5b7dd);};}exports['index']=function(_0x288e7,_0x100955){var _0x6ecf71={},_0x29813f={},_0x5ce947={'count':0x0,'rows':[]};var _0x1b3a52=_[_0x3190('0x2a')](db[_0x3190('0x2b')][_0x3190('0x2c')],function(_0x171a82){return{'name':_0x171a82[_0x3190('0x2d')],'type':_0x171a82[_0x3190('0x2e')][_0x3190('0x2f')]};});_0x29813f['model']=_[_0x3190('0x2a')](_0x1b3a52,_0x3190('0x28'));_0x29813f['query']=_[_0x3190('0x30')](_0x288e7[_0x3190('0x31')]);_0x29813f[_0x3190('0x32')]=_['intersection'](_0x29813f['model'],_0x29813f[_0x3190('0x31')]);_0x6ecf71['attributes']=_[_0x3190('0x33')](_0x29813f[_0x3190('0x34')],qs[_0x3190('0x35')](_0x288e7[_0x3190('0x31')][_0x3190('0x35')]));_0x6ecf71[_0x3190('0x36')]=_0x6ecf71[_0x3190('0x36')]['length']?_0x6ecf71[_0x3190('0x36')]:_0x29813f[_0x3190('0x34')];if(!_0x288e7[_0x3190('0x31')][_0x3190('0x37')]('nolimit')){_0x6ecf71['limit']=qs['limit'](_0x288e7['query'][_0x3190('0x1c')]);_0x6ecf71['offset']=qs[_0x3190('0x1b')](_0x288e7[_0x3190('0x31')][_0x3190('0x1b')]);}_0x6ecf71['order']=qs[_0x3190('0x38')](_0x288e7['query'][_0x3190('0x38')]);_0x6ecf71['where']=qs['filters'](_['pick'](_0x288e7[_0x3190('0x31')],_0x29813f[_0x3190('0x32')]),_0x1b3a52);if(_0x288e7[_0x3190('0x31')][_0x3190('0x39')]){_0x6ecf71['where']=_['merge'](_0x6ecf71['where'],{'$or':_[_0x3190('0x2a')](_0x1b3a52,function(_0x28490b){if(_0x28490b[_0x3190('0x2e')]!==_0x3190('0x3a')){var _0x5ba102={};_0x5ba102[_0x28490b[_0x3190('0x28')]]={'$like':'%'+_0x288e7[_0x3190('0x31')]['filter']+'%'};return _0x5ba102;}})});}_0x6ecf71=_[_0x3190('0x3b')]({},_0x6ecf71,_0x288e7[_0x3190('0x3c')]);var _0x7c5778={'where':_0x6ecf71[_0x3190('0x3d')]};return db['DeskAccount']['count'](_0x7c5778)['then'](function(_0x2c8117){_0x5ce947[_0x3190('0x1d')]=_0x2c8117;if(_0x288e7[_0x3190('0x31')][_0x3190('0x3e')]){_0x6ecf71['include']=[{'all':!![]}];}return db[_0x3190('0x2b')][_0x3190('0x3f')](_0x6ecf71);})[_0x3190('0x23')](function(_0x5cc22c){_0x5ce947[_0x3190('0x40')]=_0x5cc22c;return _0x5ce947;})[_0x3190('0x23')](respondWithFilteredResult(_0x100955,_0x6ecf71))[_0x3190('0x41')](handleError(_0x100955,null));};exports[_0x3190('0x42')]=function(_0x480bac,_0x54c9f4){var _0x328f25={'raw':![],'where':{'id':_0x480bac[_0x3190('0x43')]['id']}},_0x26a9aa={};_0x26a9aa[_0x3190('0x34')]=_[_0x3190('0x30')](db[_0x3190('0x2b')]['rawAttributes']);_0x26a9aa['query']=_[_0x3190('0x30')](_0x480bac[_0x3190('0x31')]);_0x26a9aa['filters']=_[_0x3190('0x33')](_0x26a9aa[_0x3190('0x34')],_0x26a9aa['query']);_0x328f25[_0x3190('0x36')]=_['intersection'](_0x26a9aa[_0x3190('0x34')],qs[_0x3190('0x35')](_0x480bac[_0x3190('0x31')][_0x3190('0x35')]));_0x328f25[_0x3190('0x36')]=_0x328f25['attributes']['length']?_0x328f25[_0x3190('0x36')]:_0x26a9aa['model'];if(_0x480bac[_0x3190('0x31')][_0x3190('0x3e')]){_0x328f25[_0x3190('0x44')]=[{'all':!![]}];}_0x328f25=_[_0x3190('0x3b')]({},_0x328f25,_0x480bac[_0x3190('0x3c')]);return db[_0x3190('0x2b')]['find'](_0x328f25)[_0x3190('0x23')](handleEntityNotFound(_0x54c9f4,null))[_0x3190('0x23')](respondWithResult(_0x54c9f4,null))[_0x3190('0x41')](handleError(_0x54c9f4,null));};exports[_0x3190('0x45')]=function(_0x17eb87,_0x3b40c1){return db['DeskAccount']['create'](_0x17eb87[_0x3190('0x46')],{})[_0x3190('0x23')](respondWithResult(_0x3b40c1,0xc9))[_0x3190('0x41')](handleError(_0x3b40c1,null));};exports[_0x3190('0x47')]=function(_0x14c23d,_0x49e293){if(_0x14c23d['body']['id']){delete _0x14c23d['body']['id'];}return db[_0x3190('0x2b')]['find']({'where':{'id':_0x14c23d[_0x3190('0x43')]['id']}})[_0x3190('0x23')](handleEntityNotFound(_0x49e293,null))['then'](saveUpdates(_0x14c23d['body'],null))[_0x3190('0x23')](respondWithResult(_0x49e293,null))['catch'](handleError(_0x49e293,null));};exports[_0x3190('0x24')]=function(_0x5c0a4d,_0xcdb333){return db[_0x3190('0x2b')][_0x3190('0x48')]({'where':{'id':_0x5c0a4d[_0x3190('0x43')]['id']}})[_0x3190('0x23')](handleEntityNotFound(_0xcdb333,null))[_0x3190('0x23')](removeEntity(_0xcdb333,null))['catch'](handleError(_0xcdb333,null));};exports[_0x3190('0x49')]=function(_0x4f99ac,_0x2423ba,_0x315ce2){var _0x31ab38={};var _0x53960b={};var _0x2da116;var _0x47b101;return db[_0x3190('0x2b')][_0x3190('0x4a')]({'where':{'id':_0x4f99ac[_0x3190('0x43')]['id']}})[_0x3190('0x23')](handleEntityNotFound(_0x2423ba,null))[_0x3190('0x23')](function(_0x55fb52){if(_0x55fb52){_0x2da116=_0x55fb52;_0x53960b[_0x3190('0x34')]=_['keys'](db[_0x3190('0x4b')][_0x3190('0x2c')]);_0x53960b['query']=_['keys'](_0x4f99ac[_0x3190('0x31')]);_0x53960b[_0x3190('0x32')]=_[_0x3190('0x33')](_0x53960b[_0x3190('0x34')],_0x53960b[_0x3190('0x31')]);_0x31ab38[_0x3190('0x36')]=_['intersection'](_0x53960b[_0x3190('0x34')],qs[_0x3190('0x35')](_0x4f99ac[_0x3190('0x31')]['fields']));_0x31ab38[_0x3190('0x36')]=_0x31ab38[_0x3190('0x36')][_0x3190('0x4c')]?_0x31ab38[_0x3190('0x36')]:_0x53960b[_0x3190('0x34')];_0x31ab38['order']=qs['sort'](_0x4f99ac['query'][_0x3190('0x38')]);_0x31ab38[_0x3190('0x3d')]=qs['filters'](_['pick'](_0x4f99ac[_0x3190('0x31')],_0x53960b[_0x3190('0x32')]));if(_0x4f99ac[_0x3190('0x31')][_0x3190('0x39')]){_0x31ab38['where']=_[_0x3190('0x3b')](_0x31ab38['where'],{'$or':_[_0x3190('0x2a')](_0x31ab38[_0x3190('0x36')],function(_0x3ed437){var _0xfb9f60={};_0xfb9f60[_0x3ed437]={'$like':'%'+_0x4f99ac['query'][_0x3190('0x39')]+'%'};return _0xfb9f60;})});}_0x31ab38=_['merge']({},_0x31ab38,_0x4f99ac[_0x3190('0x3c')]);return _0x2da116[_0x3190('0x49')](_0x31ab38);}})['then'](function(_0x404ce9){if(_0x404ce9){_0x47b101=_0x404ce9[_0x3190('0x4c')];if(!_0x4f99ac[_0x3190('0x31')][_0x3190('0x37')](_0x3190('0x4d'))){_0x31ab38[_0x3190('0x1c')]=qs[_0x3190('0x1c')](_0x4f99ac['query'][_0x3190('0x1c')]);_0x31ab38[_0x3190('0x1b')]=qs[_0x3190('0x1b')](_0x4f99ac['query'][_0x3190('0x1b')]);}return _0x2da116[_0x3190('0x49')](_0x31ab38);}})['then'](function(_0x2c2d43){if(_0x2c2d43){return _0x2c2d43?{'count':_0x47b101,'rows':_0x2c2d43}:null;}})[_0x3190('0x23')](respondWithResult(_0x2423ba,null))[_0x3190('0x41')](handleError(_0x2423ba,null));};exports[_0x3190('0x4e')]=function(_0x544f69,_0x2ff093,_0xcb37eb){if(_0x544f69[_0x3190('0x46')]['id']){delete _0x544f69[_0x3190('0x46')]['id'];}return db[_0x3190('0x2b')][_0x3190('0x4a')]({'where':{'id':_0x544f69[_0x3190('0x43')]['id']}})[_0x3190('0x23')](handleEntityNotFound(_0x2ff093,null))[_0x3190('0x23')](function(_0x5faaaf){if(_0x5faaaf){_0x544f69[_0x3190('0x46')][_0x3190('0x4f')]=_0x5faaaf['id'];_0x544f69[_0x3190('0x46')][_0x3190('0x50')]=integrations[_0x3190('0x51')](_0x544f69[_0x3190('0x46')]['channel'],_0x544f69[_0x3190('0x46')]['type']);_0x544f69[_0x3190('0x46')][_0x3190('0x52')]=integrations[_0x3190('0x53')](_0x544f69[_0x3190('0x46')]['channel'],_0x544f69[_0x3190('0x46')][_0x3190('0x2e')]);return db[_0x3190('0x4b')][_0x3190('0x45')](_0x544f69[_0x3190('0x46')],{'include':[{'model':db[_0x3190('0x54')],'as':_0x3190('0x50')},{'model':db[_0x3190('0x54')],'as':_0x3190('0x52')}]});}return null;})[_0x3190('0x23')](respondWithResult(_0x2ff093,null))[_0x3190('0x41')](handleError(_0x2ff093,null));};exports[_0x3190('0x55')]=function(_0x222e23,_0x508c8d,_0x559465){var _0x36e1ae=[{'name':_0x3190('0x56'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x481abd='';return db[_0x3190('0x2b')][_0x3190('0x4a')]({'where':{'id':_0x222e23[_0x3190('0x43')]['id']},'attributes':['id',_0x3190('0x57'),'authType',_0x3190('0x58'),_0x3190('0x59'),_0x3190('0x5a'),_0x3190('0x5b'),_0x3190('0x5c'),_0x3190('0x5d')]})['then'](handleEntityNotFound(_0x508c8d,null))[_0x3190('0x23')](function(_0x3e775b){if(_0x3e775b){_0x481abd=_0x3e775b['remoteUri'];var _0x253d6b=_0x481abd['slice'](-0x1);if(_0x253d6b==='/'){_0x481abd=_0x481abd[_0x3190('0x5e')](0x0,_0x481abd['lastIndexOf'](_0x253d6b));}var _0x36b602={'method':_0x3190('0x5f'),'uri':util[_0x3190('0x60')](_0x3190('0x61'),_0x481abd),'headers':{'Content-Type':'application/json','Accept':_0x3190('0x62')},'json':!![]};if(_0x3e775b[_0x3190('0x63')]===_0x3190('0x64')){_0x36b602[_0x3190('0x65')][_0x3190('0x66')]=util[_0x3190('0x60')]('Basic\x20%s',new Buffer(util[_0x3190('0x60')](_0x3190('0x67'),_0x3e775b[_0x3190('0x58')],_0x3e775b[_0x3190('0x59')]))[_0x3190('0x68')](_0x3190('0x69')));}return rp(_0x36b602)[_0x3190('0x23')](function(_0x496f22){return _0x36e1ae[_0x3190('0x6a')](_[_0x3190('0x2a')](_0x496f22[_0x3190('0x6b')][_0x3190('0x6c')],function(_0x3c1b4b){return{'id':_0x3c1b4b[_0x3190('0x28')],'name':_0x3c1b4b[_0x3190('0x28')],'type':_0x3c1b4b[_0x3190('0x2e')],'active':_0x3c1b4b[_0x3190('0x6d')],'label':_0x3c1b4b['label'],'custom':!![]};}));});}})['then'](function(_0x14d0cd){return{'count':_0x14d0cd[_0x3190('0x4c')],'rows':_0x14d0cd};})[_0x3190('0x23')](respondWithResult(_0x508c8d,null))[_0x3190('0x41')](function(_0x4501cb){var _0x29c5f4=_0x222e23['query'][_0x3190('0x6e')]?0x1f4:_0x4501cb['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x3190('0x55'),_0x29c5f4,JSON[_0x3190('0x6f')](_0x4501cb));delete _0x4501cb[_0x3190('0x28')];if(_0x29c5f4===0x191){_0x29c5f4=0x190;}_0x508c8d[_0x3190('0x1e')](_0x29c5f4)['send'](_0x222e23[_0x3190('0x31')][_0x3190('0x6e')]?{'message':_0x3190('0x70'),'statusCode':_0x4501cb[_0x3190('0x71')]}:_0x4501cb);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 99fb206..193d3b8 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 _0x1d12=['request-promise','path','rimraf','define','DeskAccount','int_desk_accounts','util','moment','bluebird'];(function(_0x579f6d,_0x476319){var _0x1a0f70=function(_0x26f878){while(--_0x26f878){_0x579f6d['push'](_0x579f6d['shift']());}};_0x1a0f70(++_0x476319);}(_0x1d12,0x165));var _0x21d1=function(_0x56c33c,_0x5e4c53){_0x56c33c=_0x56c33c-0x0;var _0x2ad235=_0x1d12[_0x56c33c];return _0x2ad235;};'use strict';var _=require('lodash');var util=require(_0x21d1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x21d1('0x1'));var BPromise=require(_0x21d1('0x2'));var rp=require(_0x21d1('0x3'));var fs=require('fs');var path=require(_0x21d1('0x4'));var rimraf=require(_0x21d1('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3dee98,_0x4614b4){return _0x3dee98[_0x21d1('0x6')](_0x21d1('0x7'),attributes,{'tableName':_0x21d1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15b6=['../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','api','moment','rimraf'];(function(_0x4e82cd,_0x317036){var _0x5c8ff1=function(_0x13dfa3){while(--_0x13dfa3){_0x4e82cd['push'](_0x4e82cd['shift']());}};_0x5c8ff1(++_0x317036);}(_0x15b6,0x100));var _0x615b=function(_0x5f39e6,_0x4fa823){_0x5f39e6=_0x5f39e6-0x0;var _0x40551a=_0x15b6[_0x5f39e6];return _0x40551a;};'use strict';var _=require(_0x615b('0x0'));var util=require(_0x615b('0x1'));var logger=require('../../config/logger')(_0x615b('0x2'));var moment=require(_0x615b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x615b('0x4'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x615b('0x5'));module[_0x615b('0x6')]=function(_0x1ea5cb,_0x57cb5e){return _0x1ea5cb[_0x615b('0x7')]('DeskAccount',attributes,{'tableName':_0x615b('0x8'),'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 c0c09f6..1469742 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 _0x2477=['result','DeskAccount','findAll','options','where','attributes','include','map','model','GetDeskAccount','catch','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x2477,0x79));var _0x7247=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x2477[_0x4667b2];return _0x1070f2;};'use strict';var _=require(_0x7247('0x0'));var util=require(_0x7247('0x1'));var moment=require(_0x7247('0x2'));var BPromise=require(_0x7247('0x3'));var rs=require(_0x7247('0x4'));var fs=require('fs');var Redis=require(_0x7247('0x5'));var db=require(_0x7247('0x6'))['db'];var utils=require(_0x7247('0x7'));var logger=require(_0x7247('0x8'))(_0x7247('0x9'));var config=require(_0x7247('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7247('0xb')][_0x7247('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e8b5e,_0x39367f,_0x1d4395){return new BPromise(function(_0x447ead,_0x534a6d){return client[_0x7247('0xd')](_0x1e8b5e,_0x1d4395)[_0x7247('0xe')](function(_0x56958d){logger[_0x7247('0xf')](_0x7247('0x10'),_0x39367f,'request\x20sent');logger[_0x7247('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x39367f,_0x7247('0x12'),JSON[_0x7247('0x13')](_0x56958d));if(_0x56958d[_0x7247('0x14')]){if(_0x56958d[_0x7247('0x14')][_0x7247('0x15')]===0x1f4){logger[_0x7247('0x14')](_0x7247('0x10'),_0x39367f,_0x56958d[_0x7247('0x14')][_0x7247('0x16')]);return _0x534a6d(_0x56958d['error']['message']);}logger[_0x7247('0x14')](_0x7247('0x10'),_0x39367f,_0x56958d[_0x7247('0x14')][_0x7247('0x16')]);return _0x447ead(_0x56958d[_0x7247('0x14')][_0x7247('0x16')]);}else{logger[_0x7247('0xf')](_0x7247('0x10'),_0x39367f,_0x7247('0x12'));_0x447ead(_0x56958d[_0x7247('0x17')][_0x7247('0x16')]);}})['catch'](function(_0x1bea45){logger[_0x7247('0x14')](_0x7247('0x10'),_0x39367f,_0x1bea45);_0x534a6d(_0x1bea45);});});}exports['GetDeskAccount']=function(_0x1fba58){var _0x20b449=this;return new Promise(function(_0x360983,_0x9ee55e){return db[_0x7247('0x18')][_0x7247('0x19')]({'raw':_0x1fba58['options']?_0x1fba58[_0x7247('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1fba58[_0x7247('0x1a')]?_0x1fba58['options'][_0x7247('0x1b')]||null:null,'attributes':_0x1fba58[_0x7247('0x1a')]?_0x1fba58[_0x7247('0x1a')][_0x7247('0x1c')]||null:null,'limit':_0x1fba58[_0x7247('0x1a')]?_0x1fba58[_0x7247('0x1a')]['limit']||null:null,'include':_0x1fba58[_0x7247('0x1a')]?_0x1fba58['options'][_0x7247('0x1d')]?_[_0x7247('0x1e')](_0x1fba58['options'][_0x7247('0x1d')],function(_0x17b884){return{'model':db[_0x17b884[_0x7247('0x1f')]],'as':_0x17b884['as'],'attributes':_0x17b884['attributes'],'include':_0x17b884['include']?_[_0x7247('0x1e')](_0x17b884['include'],function(_0x4ed851){return{'model':db[_0x4ed851['model']],'as':_0x4ed851['as'],'attributes':_0x4ed851[_0x7247('0x1c')],'include':_0x4ed851[_0x7247('0x1d')]?_[_0x7247('0x1e')](_0x4ed851[_0x7247('0x1d')],function(_0x5c2a01){return{'model':db[_0x5c2a01['model']],'as':_0x5c2a01['as'],'attributes':_0x5c2a01['attributes']};}):[]};}):[]};}):[]:[]})[_0x7247('0xe')](function(_0x51e07c){logger[_0x7247('0xf')](_0x7247('0x20'),_0x1fba58);logger[_0x7247('0x11')](_0x7247('0x20'),_0x1fba58,JSON[_0x7247('0x13')](_0x51e07c));_0x360983(_0x51e07c);})[_0x7247('0x21')](function(_0x56ad2b){logger['error']('GetDeskAccount',_0x56ad2b[_0x7247('0x16')],_0x1fba58);_0x9ee55e(_0x20b449[_0x7247('0x14')](0x1f4,_0x56ad2b['message']));});});};exports[_0x7247('0x22')]=function(_0x1d6cf0){var _0x4e1add=this;return new Promise(function(_0x118c91,_0x39dcf8){return db['DeskAccount'][_0x7247('0x23')]({'raw':_0x1d6cf0[_0x7247('0x1a')]?_0x1d6cf0[_0x7247('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1d6cf0[_0x7247('0x1a')]?_0x1d6cf0[_0x7247('0x1a')]['where']||null:null,'attributes':_0x1d6cf0[_0x7247('0x1a')]?_0x1d6cf0[_0x7247('0x1a')][_0x7247('0x1c')]||null:null,'include':_0x1d6cf0[_0x7247('0x1a')]?_0x1d6cf0[_0x7247('0x1a')]['include']?_['map'](_0x1d6cf0['options'][_0x7247('0x1d')],function(_0x198bf9){return{'model':db[_0x198bf9[_0x7247('0x1f')]],'as':_0x198bf9['as'],'attributes':_0x198bf9[_0x7247('0x1c')],'include':_0x198bf9[_0x7247('0x1d')]?_[_0x7247('0x1e')](_0x198bf9['include'],function(_0x157b42){return{'model':db[_0x157b42[_0x7247('0x1f')]],'as':_0x157b42['as'],'attributes':_0x157b42['attributes'],'include':_0x157b42['include']?_['map'](_0x157b42[_0x7247('0x1d')],function(_0x10e9c5){return{'model':db[_0x10e9c5['model']],'as':_0x10e9c5['as'],'attributes':_0x10e9c5[_0x7247('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x289b5a){logger[_0x7247('0xf')](_0x7247('0x22'),_0x1d6cf0);logger[_0x7247('0x11')](_0x7247('0x22'),_0x1d6cf0,JSON[_0x7247('0x13')](_0x289b5a));_0x118c91(_0x289b5a);})[_0x7247('0x21')](function(_0x5a43db){logger[_0x7247('0x14')](_0x7247('0x22'),_0x5a43db[_0x7247('0x16')],_0x1d6cf0);_0x39dcf8(_0x4e1add[_0x7247('0x14')](0x1f4,_0x5a43db[_0x7247('0x16')]));});});}; \ No newline at end of file +var _0xd5ec=['rpc','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','include','attributes','map','model','debug','stringify','ShowDeskAccount','where','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xd5ec,0x111));var _0xcd5e=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0xd5ec[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0xcd5e('0x0'));var util=require(_0xcd5e('0x1'));var moment=require(_0xcd5e('0x2'));var BPromise=require(_0xcd5e('0x3'));var rs=require(_0xcd5e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd5e('0x5'))['db'];var utils=require(_0xcd5e('0x6'));var logger=require('../../config/logger')(_0xcd5e('0x7'));var config=require(_0xcd5e('0x8'));var jayson=require(_0xcd5e('0x9'));var client=jayson['client'][_0xcd5e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x259be7,_0x40169f,_0x8cfa71){return new BPromise(function(_0x3924c9,_0x5cbf6b){return client[_0xcd5e('0xb')](_0x259be7,_0x8cfa71)[_0xcd5e('0xc')](function(_0x59ead7){logger[_0xcd5e('0xd')](_0xcd5e('0xe'),_0x40169f,_0xcd5e('0xf'));logger['debug'](_0xcd5e('0x10'),_0x40169f,_0xcd5e('0xf'),JSON['stringify'](_0x59ead7));if(_0x59ead7['error']){if(_0x59ead7[_0xcd5e('0x11')][_0xcd5e('0x12')]===0x1f4){logger['error'](_0xcd5e('0xe'),_0x40169f,_0x59ead7['error']['message']);return _0x5cbf6b(_0x59ead7[_0xcd5e('0x11')][_0xcd5e('0x13')]);}logger[_0xcd5e('0x11')]('DeskAccount,\x20%s,\x20%s',_0x40169f,_0x59ead7[_0xcd5e('0x11')][_0xcd5e('0x13')]);return _0x3924c9(_0x59ead7[_0xcd5e('0x11')][_0xcd5e('0x13')]);}else{logger[_0xcd5e('0xd')](_0xcd5e('0xe'),_0x40169f,_0xcd5e('0xf'));_0x3924c9(_0x59ead7[_0xcd5e('0x14')][_0xcd5e('0x13')]);}})[_0xcd5e('0x15')](function(_0x151174){logger[_0xcd5e('0x11')]('DeskAccount,\x20%s,\x20%s',_0x40169f,_0x151174);_0x5cbf6b(_0x151174);});});}exports[_0xcd5e('0x16')]=function(_0xf98a44){var _0x1d9409=this;return new Promise(function(_0x518557,_0x4eea2f){return db[_0xcd5e('0x17')][_0xcd5e('0x18')]({'raw':_0xf98a44['options']?_0xf98a44[_0xcd5e('0x19')][_0xcd5e('0x1a')]===undefined?!![]:![]:!![],'where':_0xf98a44['options']?_0xf98a44['options']['where']||null:null,'attributes':_0xf98a44[_0xcd5e('0x19')]?_0xf98a44['options']['attributes']||null:null,'limit':_0xf98a44[_0xcd5e('0x19')]?_0xf98a44[_0xcd5e('0x19')]['limit']||null:null,'include':_0xf98a44['options']?_0xf98a44['options'][_0xcd5e('0x1b')]?_['map'](_0xf98a44['options'][_0xcd5e('0x1b')],function(_0x1d707c){return{'model':db[_0x1d707c['model']],'as':_0x1d707c['as'],'attributes':_0x1d707c[_0xcd5e('0x1c')],'include':_0x1d707c[_0xcd5e('0x1b')]?_[_0xcd5e('0x1d')](_0x1d707c[_0xcd5e('0x1b')],function(_0x86364e){return{'model':db[_0x86364e['model']],'as':_0x86364e['as'],'attributes':_0x86364e[_0xcd5e('0x1c')],'include':_0x86364e[_0xcd5e('0x1b')]?_[_0xcd5e('0x1d')](_0x86364e[_0xcd5e('0x1b')],function(_0x30a478){return{'model':db[_0x30a478[_0xcd5e('0x1e')]],'as':_0x30a478['as'],'attributes':_0x30a478[_0xcd5e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcd5e('0xc')](function(_0x758f72){logger[_0xcd5e('0xd')]('GetDeskAccount',_0xf98a44);logger[_0xcd5e('0x1f')](_0xcd5e('0x16'),_0xf98a44,JSON[_0xcd5e('0x20')](_0x758f72));_0x518557(_0x758f72);})[_0xcd5e('0x15')](function(_0x12f7cb){logger[_0xcd5e('0x11')]('GetDeskAccount',_0x12f7cb[_0xcd5e('0x13')],_0xf98a44);_0x4eea2f(_0x1d9409[_0xcd5e('0x11')](0x1f4,_0x12f7cb['message']));});});};exports[_0xcd5e('0x21')]=function(_0x1a31ea){var _0x294106=this;return new Promise(function(_0x325a4b,_0x459350){return db[_0xcd5e('0x17')]['find']({'raw':_0x1a31ea['options']?_0x1a31ea[_0xcd5e('0x19')][_0xcd5e('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a31ea[_0xcd5e('0x19')]?_0x1a31ea[_0xcd5e('0x19')][_0xcd5e('0x22')]||null:null,'attributes':_0x1a31ea[_0xcd5e('0x19')]?_0x1a31ea['options']['attributes']||null:null,'include':_0x1a31ea['options']?_0x1a31ea[_0xcd5e('0x19')][_0xcd5e('0x1b')]?_[_0xcd5e('0x1d')](_0x1a31ea['options']['include'],function(_0x41fe79){return{'model':db[_0x41fe79[_0xcd5e('0x1e')]],'as':_0x41fe79['as'],'attributes':_0x41fe79['attributes'],'include':_0x41fe79[_0xcd5e('0x1b')]?_[_0xcd5e('0x1d')](_0x41fe79[_0xcd5e('0x1b')],function(_0x49ea07){return{'model':db[_0x49ea07['model']],'as':_0x49ea07['as'],'attributes':_0x49ea07[_0xcd5e('0x1c')],'include':_0x49ea07[_0xcd5e('0x1b')]?_[_0xcd5e('0x1d')](_0x49ea07[_0xcd5e('0x1b')],function(_0x5b5675){return{'model':db[_0x5b5675[_0xcd5e('0x1e')]],'as':_0x5b5675['as'],'attributes':_0x5b5675[_0xcd5e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcd5e('0xc')](function(_0x1edbb7){logger[_0xcd5e('0xd')]('ShowDeskAccount',_0x1a31ea);logger[_0xcd5e('0x1f')](_0xcd5e('0x21'),_0x1a31ea,JSON[_0xcd5e('0x20')](_0x1edbb7));_0x325a4b(_0x1edbb7);})[_0xcd5e('0x15')](function(_0xd1eb23){logger[_0xcd5e('0x11')](_0xcd5e('0x21'),_0xd1eb23['message'],_0x1a31ea);_0x459350(_0x294106[_0xcd5e('0x11')](0x1f4,_0xd1eb23[_0xcd5e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 3119ae8..65ecf61 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 _0x3e74=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','/:id/tags','setTags','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5ec7bd,_0x3ece6d){var _0x5da6ec=function(_0x75ad39){while(--_0x75ad39){_0x5ec7bd['push'](_0x5ec7bd['shift']());}};_0x5da6ec(++_0x3ece6d);}(_0x3e74,0x175));var _0x43e7=function(_0x513624,_0x12d020){_0x513624=_0x513624-0x0;var _0x35f471=_0x3e74[_0x513624];return _0x35f471;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/subjects',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/tags',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router['put']('/:id',auth[_0x43e7('0x8')](),controller[_0x43e7('0x15')]);router[_0x43e7('0x16')](_0x43e7('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x43e7('0x17')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x2e8104,_0x45455e){var _0xa79068=function(_0x312adb){while(--_0x312adb){_0x2e8104['push'](_0x2e8104['shift']());}};_0xa79068(++_0x45455e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index d542258..dab84a9 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 _0x8b49=['STRING'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8b49,0x18f));var _0x98b4=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x8b49[_0x466bc5];return _0x138952;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x98b4('0x0')]},'description':{'type':Sequelize[_0x98b4('0x0')]}}; \ No newline at end of file +var _0xdb21=['exports','STRING','sequelize'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xdb21,0x179));var _0x1db2=function(_0x485c12,_0x63ee16){_0x485c12=_0x485c12-0x0;var _0x5c87ad=_0xdb21[_0x485c12];return _0x5c87ad;};'use strict';var Sequelize=require(_0x1db2('0x0'));module[_0x1db2('0x1')]={'name':{'type':Sequelize[_0x1db2('0x2')]},'description':{'type':Sequelize[_0x1db2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 7c3473d..c951499 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 _0xec1d=['undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','DeskConfiguration','length','create','body','find','getFields','findOne','map','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x314d1d,_0x1211b8){var _0x31e31d=function(_0x571649){while(--_0x571649){_0x314d1d['push'](_0x314d1d['shift']());}};_0x31e31d(++_0x1211b8);}(_0xec1d,0x132));var _0xdec1=function(_0x282796,_0x217005){_0x282796=_0x282796-0x0;var _0x1a755f=_0xec1d[_0x282796];return _0x1a755f;};'use strict';var emlformat=require(_0xdec1('0x0'));var rimraf=require(_0xdec1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdec1('0x2'));var BPromise=require(_0xdec1('0x3'));var Mustache=require(_0xdec1('0x4'));var util=require(_0xdec1('0x5'));var path=require(_0xdec1('0x6'));var sox=require(_0xdec1('0x7'));var csv=require('to-csv');var ejs=require(_0xdec1('0x8'));var fs=require('fs');var fs_extra=require(_0xdec1('0x9'));var _=require(_0xdec1('0xa'));var squel=require(_0xdec1('0xb'));var crypto=require(_0xdec1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdec1('0xd'));var querystring=require(_0xdec1('0xe'));var Papa=require(_0xdec1('0xf'));var Redis=require(_0xdec1('0x10'));var authService=require(_0xdec1('0x11'));var qs=require(_0xdec1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdec1('0x13'));var logger=require('../../config/logger')(_0xdec1('0x14'));var utils=require(_0xdec1('0x15'));var config=require(_0xdec1('0x16'));var licenseUtil=require(_0xdec1('0x17'));var db=require(_0xdec1('0x18'))['db'];function respondWithStatusCode(_0x470b62,_0x135781){_0x135781=_0x135781||0xcc;return function(_0x1ee3cf){if(_0x1ee3cf){return _0x470b62[_0xdec1('0x19')](_0x135781);}return _0x470b62[_0xdec1('0x1a')](_0x135781)[_0xdec1('0x1b')]();};}function respondWithResult(_0x32fb52,_0xa655b6){_0xa655b6=_0xa655b6||0xc8;return function(_0x4d081a){if(_0x4d081a){return _0x32fb52['status'](_0xa655b6)[_0xdec1('0x1c')](_0x4d081a);}};}function respondWithFilteredResult(_0x37ca04,_0x26a337){return function(_0x1bee40){if(_0x1bee40){var _0x42e079=typeof _0x26a337[_0xdec1('0x1d')]===_0xdec1('0x1e')&&typeof _0x26a337[_0xdec1('0x1f')]===_0xdec1('0x1e');var _0x816d5f=_0x1bee40['count'];var _0xc1d3d0=_0x42e079?0x0:_0x26a337[_0xdec1('0x1d')];var _0x35d2d1=_0x42e079?_0x1bee40[_0xdec1('0x20')]:_0x26a337[_0xdec1('0x1d')]+_0x26a337[_0xdec1('0x1f')];var _0xc03f82;if(_0x35d2d1>=_0x816d5f){_0x35d2d1=_0x816d5f;_0xc03f82=0xc8;}else{_0xc03f82=0xce;}_0x37ca04[_0xdec1('0x1a')](_0xc03f82);return _0x37ca04[_0xdec1('0x21')](_0xdec1('0x22'),_0xc1d3d0+'-'+_0x35d2d1+'/'+_0x816d5f)[_0xdec1('0x1c')](_0x1bee40);}return null;};}function patchUpdates(_0x1ff330){return function(_0x15edd3){try{jsonpatch[_0xdec1('0x23')](_0x15edd3,_0x1ff330,!![]);}catch(_0x3b34c2){return BPromise[_0xdec1('0x24')](_0x3b34c2);}return _0x15edd3[_0xdec1('0x25')]();};}function saveUpdates(_0x6cb974,_0x3789a3){return function(_0x52db77){if(_0x52db77){return _0x52db77['update'](_0x6cb974)['then'](function(_0x10e99c){return _0x10e99c;});}return null;};}function removeEntity(_0x53c6c1,_0x2ccb19){return function(_0x42e4e4){if(_0x42e4e4){return _0x42e4e4[_0xdec1('0x26')]()[_0xdec1('0x27')](function(){_0x53c6c1[_0xdec1('0x1a')](0xcc)[_0xdec1('0x1b')]();});}};}function handleEntityNotFound(_0xc88465,_0x14b208){return function(_0x2e6ce6){if(!_0x2e6ce6){_0xc88465[_0xdec1('0x19')](0x194);}return _0x2e6ce6;};}function handleError(_0x333215,_0x3280e4){_0x3280e4=_0x3280e4||0x1f4;return function(_0x394dd5){logger[_0xdec1('0x28')](_0x394dd5[_0xdec1('0x29')]);if(_0x394dd5[_0xdec1('0x2a')]){delete _0x394dd5[_0xdec1('0x2a')];}_0x333215[_0xdec1('0x1a')](_0x3280e4)['send'](_0x394dd5);};}exports[_0xdec1('0x2b')]=function(_0x2de972,_0xfd5042){var _0x2a1a8f={},_0x5af0c6={},_0xb501d0={'count':0x0,'rows':[]};var _0x1c63b6=_['map'](db['DeskConfiguration'][_0xdec1('0x2c')],function(_0x1462fc){return{'name':_0x1462fc[_0xdec1('0x2d')],'type':_0x1462fc[_0xdec1('0x2e')]['key']};});_0x5af0c6[_0xdec1('0x2f')]=_['map'](_0x1c63b6,_0xdec1('0x2a'));_0x5af0c6[_0xdec1('0x30')]=_[_0xdec1('0x31')](_0x2de972[_0xdec1('0x30')]);_0x5af0c6[_0xdec1('0x32')]=_[_0xdec1('0x33')](_0x5af0c6[_0xdec1('0x2f')],_0x5af0c6['query']);_0x2a1a8f[_0xdec1('0x34')]=_[_0xdec1('0x33')](_0x5af0c6[_0xdec1('0x2f')],qs['fields'](_0x2de972[_0xdec1('0x30')][_0xdec1('0x35')]));_0x2a1a8f[_0xdec1('0x34')]=_0x2a1a8f[_0xdec1('0x34')]['length']?_0x2a1a8f[_0xdec1('0x34')]:_0x5af0c6[_0xdec1('0x2f')];if(!_0x2de972[_0xdec1('0x30')][_0xdec1('0x36')](_0xdec1('0x37'))){_0x2a1a8f[_0xdec1('0x1f')]=qs[_0xdec1('0x1f')](_0x2de972[_0xdec1('0x30')][_0xdec1('0x1f')]);_0x2a1a8f['offset']=qs['offset'](_0x2de972[_0xdec1('0x30')]['offset']);}_0x2a1a8f[_0xdec1('0x38')]=qs[_0xdec1('0x39')](_0x2de972[_0xdec1('0x30')][_0xdec1('0x39')]);_0x2a1a8f[_0xdec1('0x3a')]=qs[_0xdec1('0x32')](_[_0xdec1('0x3b')](_0x2de972[_0xdec1('0x30')],_0x5af0c6[_0xdec1('0x32')]),_0x1c63b6);if(_0x2de972[_0xdec1('0x30')][_0xdec1('0x3c')]){_0x2a1a8f[_0xdec1('0x3a')]=_[_0xdec1('0x3d')](_0x2a1a8f['where'],{'$or':_['map'](_0x1c63b6,function(_0x3dbc71){if(_0x3dbc71[_0xdec1('0x2e')]!==_0xdec1('0x3e')){var _0x3cdd3e={};_0x3cdd3e[_0x3dbc71[_0xdec1('0x2a')]]={'$like':'%'+_0x2de972[_0xdec1('0x30')][_0xdec1('0x3c')]+'%'};return _0x3cdd3e;}})});}_0x2a1a8f=_[_0xdec1('0x3d')]({},_0x2a1a8f,_0x2de972[_0xdec1('0x3f')]);var _0x396911={'where':_0x2a1a8f[_0xdec1('0x3a')]};return db['DeskConfiguration']['count'](_0x396911)[_0xdec1('0x27')](function(_0x5901a9){_0xb501d0['count']=_0x5901a9;if(_0x2de972[_0xdec1('0x30')][_0xdec1('0x40')]){_0x2a1a8f[_0xdec1('0x41')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xdec1('0x42')](_0x2a1a8f);})[_0xdec1('0x27')](function(_0x53fc8a){_0xb501d0[_0xdec1('0x43')]=_0x53fc8a;return _0xb501d0;})['then'](respondWithFilteredResult(_0xfd5042,_0x2a1a8f))[_0xdec1('0x44')](handleError(_0xfd5042,null));};exports[_0xdec1('0x45')]=function(_0x20b0a0,_0x793495){var _0x151347={'raw':![],'where':{'id':_0x20b0a0[_0xdec1('0x46')]['id']}},_0x421727={};_0x421727[_0xdec1('0x2f')]=_[_0xdec1('0x31')](db[_0xdec1('0x47')][_0xdec1('0x2c')]);_0x421727[_0xdec1('0x30')]=_[_0xdec1('0x31')](_0x20b0a0[_0xdec1('0x30')]);_0x421727[_0xdec1('0x32')]=_[_0xdec1('0x33')](_0x421727[_0xdec1('0x2f')],_0x421727['query']);_0x151347[_0xdec1('0x34')]=_[_0xdec1('0x33')](_0x421727[_0xdec1('0x2f')],qs['fields'](_0x20b0a0[_0xdec1('0x30')]['fields']));_0x151347[_0xdec1('0x34')]=_0x151347[_0xdec1('0x34')][_0xdec1('0x48')]?_0x151347['attributes']:_0x421727[_0xdec1('0x2f')];if(_0x20b0a0['query']['includeAll']){_0x151347[_0xdec1('0x41')]=[{'all':!![]}];}_0x151347=_['merge']({},_0x151347,_0x20b0a0[_0xdec1('0x3f')]);return db[_0xdec1('0x47')]['find'](_0x151347)[_0xdec1('0x27')](handleEntityNotFound(_0x793495,null))['then'](respondWithResult(_0x793495,null))[_0xdec1('0x44')](handleError(_0x793495,null));};exports[_0xdec1('0x49')]=function(_0x1c0839,_0x4706fc){return db[_0xdec1('0x47')]['create'](_0x1c0839[_0xdec1('0x4a')],{})[_0xdec1('0x27')](respondWithResult(_0x4706fc,0xc9))['catch'](handleError(_0x4706fc,null));};exports['update']=function(_0x500763,_0x1c1a0d){if(_0x500763[_0xdec1('0x4a')]['id']){delete _0x500763[_0xdec1('0x4a')]['id'];}return db[_0xdec1('0x47')]['find']({'where':{'id':_0x500763[_0xdec1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c1a0d,null))[_0xdec1('0x27')](saveUpdates(_0x500763[_0xdec1('0x4a')],null))[_0xdec1('0x27')](respondWithResult(_0x1c1a0d,null))[_0xdec1('0x44')](handleError(_0x1c1a0d,null));};exports[_0xdec1('0x26')]=function(_0x25885c,_0x347b19){return db[_0xdec1('0x47')][_0xdec1('0x4b')]({'where':{'id':_0x25885c[_0xdec1('0x46')]['id']}})['then'](handleEntityNotFound(_0x347b19,null))[_0xdec1('0x27')](removeEntity(_0x347b19,null))['catch'](handleError(_0x347b19,null));};exports[_0xdec1('0x4c')]=function(_0x290b85,_0x14fbf1,_0x2a490d){var _0x5deeed={};var _0x4874c3={};var _0x33cd2e;var _0x554870;return db[_0xdec1('0x47')][_0xdec1('0x4d')]({'where':{'id':_0x290b85[_0xdec1('0x46')]['id']}})[_0xdec1('0x27')](handleEntityNotFound(_0x14fbf1,null))[_0xdec1('0x27')](function(_0x1e6144){if(_0x1e6144){_0x33cd2e=_0x1e6144;_0x4874c3[_0xdec1('0x2f')]=_[_0xdec1('0x31')](db['DeskField'][_0xdec1('0x2c')]);_0x4874c3['query']=_[_0xdec1('0x31')](_0x290b85[_0xdec1('0x30')]);_0x4874c3[_0xdec1('0x32')]=_['intersection'](_0x4874c3[_0xdec1('0x2f')],_0x4874c3['query']);_0x5deeed[_0xdec1('0x34')]=_[_0xdec1('0x33')](_0x4874c3[_0xdec1('0x2f')],qs['fields'](_0x290b85[_0xdec1('0x30')]['fields']));_0x5deeed[_0xdec1('0x34')]=_0x5deeed['attributes'][_0xdec1('0x48')]?_0x5deeed[_0xdec1('0x34')]:_0x4874c3[_0xdec1('0x2f')];_0x5deeed[_0xdec1('0x38')]=qs[_0xdec1('0x39')](_0x290b85['query'][_0xdec1('0x39')]);_0x5deeed['where']=qs[_0xdec1('0x32')](_[_0xdec1('0x3b')](_0x290b85[_0xdec1('0x30')],_0x4874c3[_0xdec1('0x32')]));if(_0x290b85[_0xdec1('0x30')][_0xdec1('0x3c')]){_0x5deeed[_0xdec1('0x3a')]=_[_0xdec1('0x3d')](_0x5deeed[_0xdec1('0x3a')],{'$or':_[_0xdec1('0x4e')](_0x5deeed[_0xdec1('0x34')],function(_0x36646a){var _0x1187a3={};_0x1187a3[_0x36646a]={'$like':'%'+_0x290b85[_0xdec1('0x30')][_0xdec1('0x3c')]+'%'};return _0x1187a3;})});}_0x5deeed=_[_0xdec1('0x3d')]({},_0x5deeed,_0x290b85[_0xdec1('0x3f')]);return _0x33cd2e[_0xdec1('0x4c')](_0x5deeed);}})[_0xdec1('0x27')](function(_0x38b330){if(_0x38b330){_0x554870=_0x38b330[_0xdec1('0x48')];if(!_0x290b85['query'][_0xdec1('0x36')]('nolimit')){_0x5deeed[_0xdec1('0x1f')]=qs['limit'](_0x290b85[_0xdec1('0x30')][_0xdec1('0x1f')]);_0x5deeed[_0xdec1('0x1d')]=qs[_0xdec1('0x1d')](_0x290b85[_0xdec1('0x30')][_0xdec1('0x1d')]);}return _0x33cd2e[_0xdec1('0x4c')](_0x5deeed);}})[_0xdec1('0x27')](function(_0x1107b5){if(_0x1107b5){return _0x1107b5?{'count':_0x554870,'rows':_0x1107b5}:null;}})[_0xdec1('0x27')](respondWithResult(_0x14fbf1,null))['catch'](handleError(_0x14fbf1,null));};exports[_0xdec1('0x4f')]=function(_0x274dd2,_0x54b2d5,_0x201743){var _0x526bfc={};var _0x48971d={};var _0x36fb52;var _0x48128d;return db[_0xdec1('0x47')][_0xdec1('0x4d')]({'where':{'id':_0x274dd2[_0xdec1('0x46')]['id']}})[_0xdec1('0x27')](handleEntityNotFound(_0x54b2d5,null))[_0xdec1('0x27')](function(_0x102611){if(_0x102611){_0x36fb52=_0x102611;_0x48971d[_0xdec1('0x2f')]=_['keys'](db['DeskField'][_0xdec1('0x2c')]);_0x48971d[_0xdec1('0x30')]=_[_0xdec1('0x31')](_0x274dd2[_0xdec1('0x30')]);_0x48971d['filters']=_['intersection'](_0x48971d[_0xdec1('0x2f')],_0x48971d['query']);_0x526bfc['attributes']=_[_0xdec1('0x33')](_0x48971d['model'],qs[_0xdec1('0x35')](_0x274dd2[_0xdec1('0x30')]['fields']));_0x526bfc[_0xdec1('0x34')]=_0x526bfc[_0xdec1('0x34')][_0xdec1('0x48')]?_0x526bfc[_0xdec1('0x34')]:_0x48971d['model'];_0x526bfc[_0xdec1('0x38')]=qs['sort'](_0x274dd2['query'][_0xdec1('0x39')]);_0x526bfc[_0xdec1('0x3a')]=qs[_0xdec1('0x32')](_['pick'](_0x274dd2[_0xdec1('0x30')],_0x48971d['filters']));if(_0x274dd2[_0xdec1('0x30')][_0xdec1('0x3c')]){_0x526bfc[_0xdec1('0x3a')]=_[_0xdec1('0x3d')](_0x526bfc['where'],{'$or':_[_0xdec1('0x4e')](_0x526bfc[_0xdec1('0x34')],function(_0x5e95b2){var _0x3ef508={};_0x3ef508[_0x5e95b2]={'$like':'%'+_0x274dd2[_0xdec1('0x30')][_0xdec1('0x3c')]+'%'};return _0x3ef508;})});}_0x526bfc=_[_0xdec1('0x3d')]({},_0x526bfc,_0x274dd2[_0xdec1('0x3f')]);return _0x36fb52['getSubjects'](_0x526bfc);}})[_0xdec1('0x27')](function(_0x16ba7a){if(_0x16ba7a){_0x48128d=_0x16ba7a['length'];if(!_0x274dd2[_0xdec1('0x30')][_0xdec1('0x36')](_0xdec1('0x37'))){_0x526bfc['limit']=qs['limit'](_0x274dd2['query']['limit']);_0x526bfc[_0xdec1('0x1d')]=qs[_0xdec1('0x1d')](_0x274dd2['query'][_0xdec1('0x1d')]);}return _0x36fb52['getSubjects'](_0x526bfc);}})[_0xdec1('0x27')](function(_0x112900){if(_0x112900){return _0x112900?{'count':_0x48128d,'rows':_0x112900}:null;}})[_0xdec1('0x27')](respondWithResult(_0x54b2d5,null))[_0xdec1('0x44')](handleError(_0x54b2d5,null));};exports[_0xdec1('0x50')]=function(_0x20b35e,_0x430db7,_0xd5694c){var _0x1341ed={};var _0x10e0dd={};var _0x56e083;var _0x2ba2cb;return db[_0xdec1('0x47')][_0xdec1('0x4d')]({'where':{'id':_0x20b35e[_0xdec1('0x46')]['id']}})['then'](handleEntityNotFound(_0x430db7,null))[_0xdec1('0x27')](function(_0x245f5a){if(_0x245f5a){_0x56e083=_0x245f5a;_0x10e0dd[_0xdec1('0x2f')]=_[_0xdec1('0x31')](db['DeskField'][_0xdec1('0x2c')]);_0x10e0dd[_0xdec1('0x30')]=_[_0xdec1('0x31')](_0x20b35e[_0xdec1('0x30')]);_0x10e0dd[_0xdec1('0x32')]=_[_0xdec1('0x33')](_0x10e0dd[_0xdec1('0x2f')],_0x10e0dd[_0xdec1('0x30')]);_0x1341ed['attributes']=_[_0xdec1('0x33')](_0x10e0dd[_0xdec1('0x2f')],qs[_0xdec1('0x35')](_0x20b35e[_0xdec1('0x30')][_0xdec1('0x35')]));_0x1341ed['attributes']=_0x1341ed[_0xdec1('0x34')]['length']?_0x1341ed['attributes']:_0x10e0dd[_0xdec1('0x2f')];_0x1341ed[_0xdec1('0x38')]=qs['sort'](_0x20b35e[_0xdec1('0x30')][_0xdec1('0x39')]);_0x1341ed['where']=qs[_0xdec1('0x32')](_['pick'](_0x20b35e['query'],_0x10e0dd[_0xdec1('0x32')]));if(_0x20b35e[_0xdec1('0x30')][_0xdec1('0x3c')]){_0x1341ed[_0xdec1('0x3a')]=_[_0xdec1('0x3d')](_0x1341ed[_0xdec1('0x3a')],{'$or':_[_0xdec1('0x4e')](_0x1341ed[_0xdec1('0x34')],function(_0x4b1e61){var _0xfbea27={};_0xfbea27[_0x4b1e61]={'$like':'%'+_0x20b35e['query']['filter']+'%'};return _0xfbea27;})});}_0x1341ed=_['merge']({},_0x1341ed,_0x20b35e['options']);return _0x56e083[_0xdec1('0x50')](_0x1341ed);}})['then'](function(_0x51f8f5){if(_0x51f8f5){_0x2ba2cb=_0x51f8f5[_0xdec1('0x48')];if(!_0x20b35e[_0xdec1('0x30')][_0xdec1('0x36')](_0xdec1('0x37'))){_0x1341ed[_0xdec1('0x1f')]=qs['limit'](_0x20b35e[_0xdec1('0x30')][_0xdec1('0x1f')]);_0x1341ed[_0xdec1('0x1d')]=qs[_0xdec1('0x1d')](_0x20b35e[_0xdec1('0x30')][_0xdec1('0x1d')]);}return _0x56e083[_0xdec1('0x50')](_0x1341ed);}})['then'](function(_0x130aa0){if(_0x130aa0){return _0x130aa0?{'count':_0x2ba2cb,'rows':_0x130aa0}:null;}})[_0xdec1('0x27')](respondWithResult(_0x430db7,null))['catch'](handleError(_0x430db7,null));};exports[_0xdec1('0x51')]=function(_0x4a92ab,_0x232a30,_0x3ffd34){var _0x181c19={};var _0x56f20={};var _0x5d84f9;var _0x5d2b79;return db['DeskConfiguration'][_0xdec1('0x4d')]({'where':{'id':_0x4a92ab['params']['id']}})['then'](handleEntityNotFound(_0x232a30,null))[_0xdec1('0x27')](function(_0x1a1809){if(_0x1a1809){_0x5d84f9=_0x1a1809;_0x56f20[_0xdec1('0x2f')]=_[_0xdec1('0x31')](db['Tag'][_0xdec1('0x2c')]);_0x56f20['query']=_[_0xdec1('0x31')](_0x4a92ab['query']);_0x56f20['filters']=_[_0xdec1('0x33')](_0x56f20[_0xdec1('0x2f')],_0x56f20[_0xdec1('0x30')]);_0x181c19['attributes']=_[_0xdec1('0x33')](_0x56f20[_0xdec1('0x2f')],qs[_0xdec1('0x35')](_0x4a92ab[_0xdec1('0x30')][_0xdec1('0x35')]));_0x181c19[_0xdec1('0x34')]=_0x181c19[_0xdec1('0x34')][_0xdec1('0x48')]?_0x181c19[_0xdec1('0x34')]:_0x56f20[_0xdec1('0x2f')];_0x181c19[_0xdec1('0x38')]=qs[_0xdec1('0x39')](_0x4a92ab[_0xdec1('0x30')][_0xdec1('0x39')]);_0x181c19['where']=qs['filters'](_[_0xdec1('0x3b')](_0x4a92ab[_0xdec1('0x30')],_0x56f20[_0xdec1('0x32')]));if(_0x4a92ab[_0xdec1('0x30')]['filter']){_0x181c19[_0xdec1('0x3a')]=_[_0xdec1('0x3d')](_0x181c19['where'],{'$or':_[_0xdec1('0x4e')](_0x181c19[_0xdec1('0x34')],function(_0x428ee6){var _0x1d0aef={};_0x1d0aef[_0x428ee6]={'$like':'%'+_0x4a92ab[_0xdec1('0x30')][_0xdec1('0x3c')]+'%'};return _0x1d0aef;})});}_0x181c19=_[_0xdec1('0x3d')]({},_0x181c19,_0x4a92ab[_0xdec1('0x3f')]);return _0x5d84f9[_0xdec1('0x51')](_0x181c19);}})[_0xdec1('0x27')](function(_0x4bbc01){if(_0x4bbc01){_0x5d2b79=_0x4bbc01['length'];if(!_0x4a92ab[_0xdec1('0x30')][_0xdec1('0x36')]('nolimit')){_0x181c19['limit']=qs[_0xdec1('0x1f')](_0x4a92ab[_0xdec1('0x30')][_0xdec1('0x1f')]);_0x181c19[_0xdec1('0x1d')]=qs[_0xdec1('0x1d')](_0x4a92ab[_0xdec1('0x30')][_0xdec1('0x1d')]);}return _0x5d84f9['getTags'](_0x181c19);}})['then'](function(_0x2b2498){if(_0x2b2498){return _0x2b2498?{'count':_0x5d2b79,'rows':_0x2b2498}:null;}})[_0xdec1('0x27')](respondWithResult(_0x232a30,null))['catch'](handleError(_0x232a30,null));};exports[_0xdec1('0x52')]=function(_0x55b9eb,_0x286724,_0xa0e348){if(_0x55b9eb[_0xdec1('0x4a')]['id']){delete _0x55b9eb[_0xdec1('0x4a')]['id'];}return db[_0xdec1('0x47')][_0xdec1('0x4d')]({'where':{'id':_0x55b9eb[_0xdec1('0x46')]['id']}})[_0xdec1('0x27')](handleEntityNotFound(_0x286724,null))['then'](function(_0x21478e){if(_0x21478e){return _0x21478e[_0xdec1('0x52')](_0x55b9eb[_0xdec1('0x4a')][_0xdec1('0x53')]||[]);}return null;})['then'](respondWithResult(_0x286724,null))[_0xdec1('0x44')](handleError(_0x286724,null));}; \ No newline at end of file +var _0xb5cf=['setTags','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/parsers/qs','../../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','then','destroy','error','stack','name','send','map','DeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','hasOwnProperty','getSubjects','getDescriptions','DeskField','getTags','Tag'];(function(_0x4c728e,_0xb3f0df){var _0xca3980=function(_0x42bfe9){while(--_0x42bfe9){_0x4c728e['push'](_0x4c728e['shift']());}};_0xca3980(++_0xb3f0df);}(_0xb5cf,0x187));var _0xfb5c=function(_0x291108,_0x4e6ca2){_0x291108=_0x291108-0x0;var _0x8846f3=_0xb5cf[_0x291108];return _0x8846f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb5c('0x0'));var jsonpatch=require(_0xfb5c('0x1'));var rp=require(_0xfb5c('0x2'));var moment=require(_0xfb5c('0x3'));var BPromise=require(_0xfb5c('0x4'));var Mustache=require('mustache');var util=require(_0xfb5c('0x5'));var path=require('path');var sox=require(_0xfb5c('0x6'));var csv=require(_0xfb5c('0x7'));var ejs=require(_0xfb5c('0x8'));var fs=require('fs');var fs_extra=require(_0xfb5c('0x9'));var _=require(_0xfb5c('0xa'));var squel=require(_0xfb5c('0xb'));var crypto=require(_0xfb5c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfb5c('0x7'));var querystring=require('querystring');var Papa=require(_0xfb5c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb5c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb5c('0xf'));var logger=require(_0xfb5c('0x10'))(_0xfb5c('0x11'));var utils=require(_0xfb5c('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xfb5c('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55a144,_0x20c290){_0x20c290=_0x20c290||0xcc;return function(_0x3d2d6f){if(_0x3d2d6f){return _0x55a144[_0xfb5c('0x14')](_0x20c290);}return _0x55a144[_0xfb5c('0x15')](_0x20c290)['end']();};}function respondWithResult(_0x5a0188,_0x1c6e01){_0x1c6e01=_0x1c6e01||0xc8;return function(_0x16b159){if(_0x16b159){return _0x5a0188[_0xfb5c('0x15')](_0x1c6e01)[_0xfb5c('0x16')](_0x16b159);}};}function respondWithFilteredResult(_0x1bb344,_0x2ba788){return function(_0x90f2b3){if(_0x90f2b3){var _0x43a264=typeof _0x2ba788[_0xfb5c('0x17')]===_0xfb5c('0x18')&&typeof _0x2ba788[_0xfb5c('0x19')]==='undefined';var _0x405cbd=_0x90f2b3[_0xfb5c('0x1a')];var _0x2fbde8=_0x43a264?0x0:_0x2ba788[_0xfb5c('0x17')];var _0x272add=_0x43a264?_0x90f2b3[_0xfb5c('0x1a')]:_0x2ba788[_0xfb5c('0x17')]+_0x2ba788[_0xfb5c('0x19')];var _0x57b6df;if(_0x272add>=_0x405cbd){_0x272add=_0x405cbd;_0x57b6df=0xc8;}else{_0x57b6df=0xce;}_0x1bb344[_0xfb5c('0x15')](_0x57b6df);return _0x1bb344[_0xfb5c('0x1b')](_0xfb5c('0x1c'),_0x2fbde8+'-'+_0x272add+'/'+_0x405cbd)[_0xfb5c('0x16')](_0x90f2b3);}return null;};}function patchUpdates(_0x485e05){return function(_0x23a706){try{jsonpatch[_0xfb5c('0x1d')](_0x23a706,_0x485e05,!![]);}catch(_0x22ad4f){return BPromise[_0xfb5c('0x1e')](_0x22ad4f);}return _0x23a706[_0xfb5c('0x1f')]();};}function saveUpdates(_0x38607c,_0x2cc3a7){return function(_0x38f5f0){if(_0x38f5f0){return _0x38f5f0[_0xfb5c('0x20')](_0x38607c)[_0xfb5c('0x21')](function(_0x158983){return _0x158983;});}return null;};}function removeEntity(_0x3712dd,_0x134a11){return function(_0x1043aa){if(_0x1043aa){return _0x1043aa[_0xfb5c('0x22')]()['then'](function(){_0x3712dd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42ab73,_0x519c9c){return function(_0xa5fa99){if(!_0xa5fa99){_0x42ab73[_0xfb5c('0x14')](0x194);}return _0xa5fa99;};}function handleError(_0x9edc0,_0x36465f){_0x36465f=_0x36465f||0x1f4;return function(_0x178b76){logger[_0xfb5c('0x23')](_0x178b76[_0xfb5c('0x24')]);if(_0x178b76['name']){delete _0x178b76[_0xfb5c('0x25')];}_0x9edc0[_0xfb5c('0x15')](_0x36465f)[_0xfb5c('0x26')](_0x178b76);};}exports['index']=function(_0x30bb4b,_0x4637e8){var _0x3626c5={},_0x5a0b87={},_0x4706e={'count':0x0,'rows':[]};var _0x35886b=_[_0xfb5c('0x27')](db[_0xfb5c('0x28')][_0xfb5c('0x29')],function(_0x5a9da5){return{'name':_0x5a9da5['fieldName'],'type':_0x5a9da5[_0xfb5c('0x2a')][_0xfb5c('0x2b')]};});_0x5a0b87[_0xfb5c('0x2c')]=_[_0xfb5c('0x27')](_0x35886b,'name');_0x5a0b87[_0xfb5c('0x2d')]=_[_0xfb5c('0x2e')](_0x30bb4b['query']);_0x5a0b87['filters']=_[_0xfb5c('0x2f')](_0x5a0b87['model'],_0x5a0b87[_0xfb5c('0x2d')]);_0x3626c5[_0xfb5c('0x30')]=_[_0xfb5c('0x2f')](_0x5a0b87[_0xfb5c('0x2c')],qs['fields'](_0x30bb4b[_0xfb5c('0x2d')][_0xfb5c('0x31')]));_0x3626c5['attributes']=_0x3626c5['attributes'][_0xfb5c('0x32')]?_0x3626c5['attributes']:_0x5a0b87[_0xfb5c('0x2c')];if(!_0x30bb4b[_0xfb5c('0x2d')]['hasOwnProperty'](_0xfb5c('0x33'))){_0x3626c5[_0xfb5c('0x19')]=qs[_0xfb5c('0x19')](_0x30bb4b[_0xfb5c('0x2d')][_0xfb5c('0x19')]);_0x3626c5[_0xfb5c('0x17')]=qs[_0xfb5c('0x17')](_0x30bb4b[_0xfb5c('0x2d')][_0xfb5c('0x17')]);}_0x3626c5[_0xfb5c('0x34')]=qs[_0xfb5c('0x35')](_0x30bb4b[_0xfb5c('0x2d')][_0xfb5c('0x35')]);_0x3626c5[_0xfb5c('0x36')]=qs[_0xfb5c('0x37')](_[_0xfb5c('0x38')](_0x30bb4b['query'],_0x5a0b87['filters']),_0x35886b);if(_0x30bb4b['query'][_0xfb5c('0x39')]){_0x3626c5[_0xfb5c('0x36')]=_[_0xfb5c('0x3a')](_0x3626c5[_0xfb5c('0x36')],{'$or':_[_0xfb5c('0x27')](_0x35886b,function(_0x136e83){if(_0x136e83[_0xfb5c('0x2a')]!=='VIRTUAL'){var _0x105cd2={};_0x105cd2[_0x136e83[_0xfb5c('0x25')]]={'$like':'%'+_0x30bb4b[_0xfb5c('0x2d')]['filter']+'%'};return _0x105cd2;}})});}_0x3626c5=_[_0xfb5c('0x3a')]({},_0x3626c5,_0x30bb4b[_0xfb5c('0x3b')]);var _0x86d72b={'where':_0x3626c5[_0xfb5c('0x36')]};return db[_0xfb5c('0x28')][_0xfb5c('0x1a')](_0x86d72b)[_0xfb5c('0x21')](function(_0x1e8589){_0x4706e[_0xfb5c('0x1a')]=_0x1e8589;if(_0x30bb4b[_0xfb5c('0x2d')]['includeAll']){_0x3626c5['include']=[{'all':!![]}];}return db[_0xfb5c('0x28')][_0xfb5c('0x3c')](_0x3626c5);})['then'](function(_0x155a57){_0x4706e[_0xfb5c('0x3d')]=_0x155a57;return _0x4706e;})[_0xfb5c('0x21')](respondWithFilteredResult(_0x4637e8,_0x3626c5))[_0xfb5c('0x3e')](handleError(_0x4637e8,null));};exports[_0xfb5c('0x3f')]=function(_0x4b863f,_0x206b05){var _0x41b691={'raw':![],'where':{'id':_0x4b863f[_0xfb5c('0x40')]['id']}},_0x3aa925={};_0x3aa925[_0xfb5c('0x2c')]=_[_0xfb5c('0x2e')](db['DeskConfiguration'][_0xfb5c('0x29')]);_0x3aa925['query']=_['keys'](_0x4b863f[_0xfb5c('0x2d')]);_0x3aa925['filters']=_[_0xfb5c('0x2f')](_0x3aa925[_0xfb5c('0x2c')],_0x3aa925[_0xfb5c('0x2d')]);_0x41b691[_0xfb5c('0x30')]=_[_0xfb5c('0x2f')](_0x3aa925[_0xfb5c('0x2c')],qs['fields'](_0x4b863f['query'][_0xfb5c('0x31')]));_0x41b691[_0xfb5c('0x30')]=_0x41b691[_0xfb5c('0x30')][_0xfb5c('0x32')]?_0x41b691[_0xfb5c('0x30')]:_0x3aa925[_0xfb5c('0x2c')];if(_0x4b863f[_0xfb5c('0x2d')][_0xfb5c('0x41')]){_0x41b691['include']=[{'all':!![]}];}_0x41b691=_[_0xfb5c('0x3a')]({},_0x41b691,_0x4b863f[_0xfb5c('0x3b')]);return db[_0xfb5c('0x28')][_0xfb5c('0x42')](_0x41b691)[_0xfb5c('0x21')](handleEntityNotFound(_0x206b05,null))['then'](respondWithResult(_0x206b05,null))[_0xfb5c('0x3e')](handleError(_0x206b05,null));};exports[_0xfb5c('0x43')]=function(_0x6b2e67,_0x14d79d){return db[_0xfb5c('0x28')][_0xfb5c('0x43')](_0x6b2e67[_0xfb5c('0x44')],{})[_0xfb5c('0x21')](respondWithResult(_0x14d79d,0xc9))[_0xfb5c('0x3e')](handleError(_0x14d79d,null));};exports['update']=function(_0x28813c,_0x2e445b){if(_0x28813c['body']['id']){delete _0x28813c[_0xfb5c('0x44')]['id'];}return db[_0xfb5c('0x28')][_0xfb5c('0x42')]({'where':{'id':_0x28813c['params']['id']}})[_0xfb5c('0x21')](handleEntityNotFound(_0x2e445b,null))[_0xfb5c('0x21')](saveUpdates(_0x28813c['body'],null))['then'](respondWithResult(_0x2e445b,null))[_0xfb5c('0x3e')](handleError(_0x2e445b,null));};exports[_0xfb5c('0x22')]=function(_0x265e41,_0x2f7e4f){return db[_0xfb5c('0x28')][_0xfb5c('0x42')]({'where':{'id':_0x265e41[_0xfb5c('0x40')]['id']}})[_0xfb5c('0x21')](handleEntityNotFound(_0x2f7e4f,null))[_0xfb5c('0x21')](removeEntity(_0x2f7e4f,null))[_0xfb5c('0x3e')](handleError(_0x2f7e4f,null));};exports[_0xfb5c('0x45')]=function(_0x2b9095,_0x589248,_0x7d86b6){var _0x1c3651={};var _0x5cb437={};var _0x2cae4c;var _0x25a1ad;return db[_0xfb5c('0x28')][_0xfb5c('0x46')]({'where':{'id':_0x2b9095[_0xfb5c('0x40')]['id']}})[_0xfb5c('0x21')](handleEntityNotFound(_0x589248,null))[_0xfb5c('0x21')](function(_0x475634){if(_0x475634){_0x2cae4c=_0x475634;_0x5cb437[_0xfb5c('0x2c')]=_[_0xfb5c('0x2e')](db['DeskField'][_0xfb5c('0x29')]);_0x5cb437['query']=_[_0xfb5c('0x2e')](_0x2b9095['query']);_0x5cb437[_0xfb5c('0x37')]=_[_0xfb5c('0x2f')](_0x5cb437[_0xfb5c('0x2c')],_0x5cb437[_0xfb5c('0x2d')]);_0x1c3651[_0xfb5c('0x30')]=_[_0xfb5c('0x2f')](_0x5cb437[_0xfb5c('0x2c')],qs['fields'](_0x2b9095[_0xfb5c('0x2d')][_0xfb5c('0x31')]));_0x1c3651[_0xfb5c('0x30')]=_0x1c3651[_0xfb5c('0x30')]['length']?_0x1c3651[_0xfb5c('0x30')]:_0x5cb437[_0xfb5c('0x2c')];_0x1c3651[_0xfb5c('0x34')]=qs['sort'](_0x2b9095[_0xfb5c('0x2d')]['sort']);_0x1c3651[_0xfb5c('0x36')]=qs[_0xfb5c('0x37')](_[_0xfb5c('0x38')](_0x2b9095[_0xfb5c('0x2d')],_0x5cb437[_0xfb5c('0x37')]));if(_0x2b9095[_0xfb5c('0x2d')][_0xfb5c('0x39')]){_0x1c3651['where']=_['merge'](_0x1c3651[_0xfb5c('0x36')],{'$or':_['map'](_0x1c3651[_0xfb5c('0x30')],function(_0x188bac){var _0x1d4dcd={};_0x1d4dcd[_0x188bac]={'$like':'%'+_0x2b9095[_0xfb5c('0x2d')][_0xfb5c('0x39')]+'%'};return _0x1d4dcd;})});}_0x1c3651=_[_0xfb5c('0x3a')]({},_0x1c3651,_0x2b9095[_0xfb5c('0x3b')]);return _0x2cae4c[_0xfb5c('0x45')](_0x1c3651);}})['then'](function(_0x5bceeb){if(_0x5bceeb){_0x25a1ad=_0x5bceeb[_0xfb5c('0x32')];if(!_0x2b9095[_0xfb5c('0x2d')][_0xfb5c('0x47')]('nolimit')){_0x1c3651[_0xfb5c('0x19')]=qs['limit'](_0x2b9095[_0xfb5c('0x2d')][_0xfb5c('0x19')]);_0x1c3651[_0xfb5c('0x17')]=qs[_0xfb5c('0x17')](_0x2b9095[_0xfb5c('0x2d')][_0xfb5c('0x17')]);}return _0x2cae4c[_0xfb5c('0x45')](_0x1c3651);}})[_0xfb5c('0x21')](function(_0xa2e422){if(_0xa2e422){return _0xa2e422?{'count':_0x25a1ad,'rows':_0xa2e422}:null;}})[_0xfb5c('0x21')](respondWithResult(_0x589248,null))[_0xfb5c('0x3e')](handleError(_0x589248,null));};exports[_0xfb5c('0x48')]=function(_0x1abfee,_0x5b0970,_0x3af87a){var _0x323e2a={};var _0x203e10={};var _0x30ca19;var _0x3ca2c4;return db[_0xfb5c('0x28')][_0xfb5c('0x46')]({'where':{'id':_0x1abfee['params']['id']}})[_0xfb5c('0x21')](handleEntityNotFound(_0x5b0970,null))[_0xfb5c('0x21')](function(_0x42f1ed){if(_0x42f1ed){_0x30ca19=_0x42f1ed;_0x203e10[_0xfb5c('0x2c')]=_[_0xfb5c('0x2e')](db['DeskField'][_0xfb5c('0x29')]);_0x203e10[_0xfb5c('0x2d')]=_[_0xfb5c('0x2e')](_0x1abfee[_0xfb5c('0x2d')]);_0x203e10[_0xfb5c('0x37')]=_[_0xfb5c('0x2f')](_0x203e10['model'],_0x203e10[_0xfb5c('0x2d')]);_0x323e2a[_0xfb5c('0x30')]=_[_0xfb5c('0x2f')](_0x203e10['model'],qs[_0xfb5c('0x31')](_0x1abfee[_0xfb5c('0x2d')][_0xfb5c('0x31')]));_0x323e2a[_0xfb5c('0x30')]=_0x323e2a[_0xfb5c('0x30')]['length']?_0x323e2a[_0xfb5c('0x30')]:_0x203e10[_0xfb5c('0x2c')];_0x323e2a['order']=qs[_0xfb5c('0x35')](_0x1abfee[_0xfb5c('0x2d')]['sort']);_0x323e2a[_0xfb5c('0x36')]=qs[_0xfb5c('0x37')](_[_0xfb5c('0x38')](_0x1abfee[_0xfb5c('0x2d')],_0x203e10['filters']));if(_0x1abfee[_0xfb5c('0x2d')][_0xfb5c('0x39')]){_0x323e2a[_0xfb5c('0x36')]=_[_0xfb5c('0x3a')](_0x323e2a[_0xfb5c('0x36')],{'$or':_[_0xfb5c('0x27')](_0x323e2a[_0xfb5c('0x30')],function(_0xa81341){var _0x4a9afc={};_0x4a9afc[_0xa81341]={'$like':'%'+_0x1abfee[_0xfb5c('0x2d')][_0xfb5c('0x39')]+'%'};return _0x4a9afc;})});}_0x323e2a=_[_0xfb5c('0x3a')]({},_0x323e2a,_0x1abfee[_0xfb5c('0x3b')]);return _0x30ca19[_0xfb5c('0x48')](_0x323e2a);}})[_0xfb5c('0x21')](function(_0x17bd74){if(_0x17bd74){_0x3ca2c4=_0x17bd74['length'];if(!_0x1abfee[_0xfb5c('0x2d')][_0xfb5c('0x47')](_0xfb5c('0x33'))){_0x323e2a[_0xfb5c('0x19')]=qs['limit'](_0x1abfee[_0xfb5c('0x2d')][_0xfb5c('0x19')]);_0x323e2a[_0xfb5c('0x17')]=qs[_0xfb5c('0x17')](_0x1abfee[_0xfb5c('0x2d')][_0xfb5c('0x17')]);}return _0x30ca19[_0xfb5c('0x48')](_0x323e2a);}})[_0xfb5c('0x21')](function(_0x9f91ff){if(_0x9f91ff){return _0x9f91ff?{'count':_0x3ca2c4,'rows':_0x9f91ff}:null;}})[_0xfb5c('0x21')](respondWithResult(_0x5b0970,null))[_0xfb5c('0x3e')](handleError(_0x5b0970,null));};exports[_0xfb5c('0x49')]=function(_0x571444,_0x9855ab,_0x57aa1f){var _0xbb9697={};var _0x3bfa6b={};var _0xf9cbc7;var _0x4767ca;return db[_0xfb5c('0x28')][_0xfb5c('0x46')]({'where':{'id':_0x571444['params']['id']}})['then'](handleEntityNotFound(_0x9855ab,null))[_0xfb5c('0x21')](function(_0x440e6b){if(_0x440e6b){_0xf9cbc7=_0x440e6b;_0x3bfa6b[_0xfb5c('0x2c')]=_[_0xfb5c('0x2e')](db[_0xfb5c('0x4a')][_0xfb5c('0x29')]);_0x3bfa6b[_0xfb5c('0x2d')]=_[_0xfb5c('0x2e')](_0x571444[_0xfb5c('0x2d')]);_0x3bfa6b['filters']=_[_0xfb5c('0x2f')](_0x3bfa6b[_0xfb5c('0x2c')],_0x3bfa6b[_0xfb5c('0x2d')]);_0xbb9697[_0xfb5c('0x30')]=_['intersection'](_0x3bfa6b[_0xfb5c('0x2c')],qs['fields'](_0x571444[_0xfb5c('0x2d')][_0xfb5c('0x31')]));_0xbb9697[_0xfb5c('0x30')]=_0xbb9697[_0xfb5c('0x30')][_0xfb5c('0x32')]?_0xbb9697[_0xfb5c('0x30')]:_0x3bfa6b[_0xfb5c('0x2c')];_0xbb9697[_0xfb5c('0x34')]=qs[_0xfb5c('0x35')](_0x571444['query'][_0xfb5c('0x35')]);_0xbb9697[_0xfb5c('0x36')]=qs[_0xfb5c('0x37')](_['pick'](_0x571444[_0xfb5c('0x2d')],_0x3bfa6b[_0xfb5c('0x37')]));if(_0x571444[_0xfb5c('0x2d')]['filter']){_0xbb9697['where']=_[_0xfb5c('0x3a')](_0xbb9697[_0xfb5c('0x36')],{'$or':_[_0xfb5c('0x27')](_0xbb9697[_0xfb5c('0x30')],function(_0x14b752){var _0x3655fe={};_0x3655fe[_0x14b752]={'$like':'%'+_0x571444[_0xfb5c('0x2d')][_0xfb5c('0x39')]+'%'};return _0x3655fe;})});}_0xbb9697=_['merge']({},_0xbb9697,_0x571444[_0xfb5c('0x3b')]);return _0xf9cbc7[_0xfb5c('0x49')](_0xbb9697);}})['then'](function(_0x3fe574){if(_0x3fe574){_0x4767ca=_0x3fe574['length'];if(!_0x571444[_0xfb5c('0x2d')][_0xfb5c('0x47')]('nolimit')){_0xbb9697[_0xfb5c('0x19')]=qs[_0xfb5c('0x19')](_0x571444[_0xfb5c('0x2d')][_0xfb5c('0x19')]);_0xbb9697[_0xfb5c('0x17')]=qs[_0xfb5c('0x17')](_0x571444['query'][_0xfb5c('0x17')]);}return _0xf9cbc7[_0xfb5c('0x49')](_0xbb9697);}})['then'](function(_0x9be8f1){if(_0x9be8f1){return _0x9be8f1?{'count':_0x4767ca,'rows':_0x9be8f1}:null;}})['then'](respondWithResult(_0x9855ab,null))[_0xfb5c('0x3e')](handleError(_0x9855ab,null));};exports[_0xfb5c('0x4b')]=function(_0x42cb51,_0x49734d,_0x363710){var _0x583e0b={};var _0x5d19fc={};var _0x165d92;var _0x56c367;return db[_0xfb5c('0x28')][_0xfb5c('0x46')]({'where':{'id':_0x42cb51[_0xfb5c('0x40')]['id']}})['then'](handleEntityNotFound(_0x49734d,null))[_0xfb5c('0x21')](function(_0x27c081){if(_0x27c081){_0x165d92=_0x27c081;_0x5d19fc[_0xfb5c('0x2c')]=_[_0xfb5c('0x2e')](db[_0xfb5c('0x4c')][_0xfb5c('0x29')]);_0x5d19fc['query']=_[_0xfb5c('0x2e')](_0x42cb51[_0xfb5c('0x2d')]);_0x5d19fc[_0xfb5c('0x37')]=_[_0xfb5c('0x2f')](_0x5d19fc[_0xfb5c('0x2c')],_0x5d19fc[_0xfb5c('0x2d')]);_0x583e0b[_0xfb5c('0x30')]=_['intersection'](_0x5d19fc[_0xfb5c('0x2c')],qs['fields'](_0x42cb51['query'][_0xfb5c('0x31')]));_0x583e0b[_0xfb5c('0x30')]=_0x583e0b['attributes']['length']?_0x583e0b['attributes']:_0x5d19fc['model'];_0x583e0b[_0xfb5c('0x34')]=qs[_0xfb5c('0x35')](_0x42cb51[_0xfb5c('0x2d')][_0xfb5c('0x35')]);_0x583e0b[_0xfb5c('0x36')]=qs['filters'](_[_0xfb5c('0x38')](_0x42cb51[_0xfb5c('0x2d')],_0x5d19fc['filters']));if(_0x42cb51['query'][_0xfb5c('0x39')]){_0x583e0b[_0xfb5c('0x36')]=_['merge'](_0x583e0b[_0xfb5c('0x36')],{'$or':_[_0xfb5c('0x27')](_0x583e0b['attributes'],function(_0x232c93){var _0x4ffe9a={};_0x4ffe9a[_0x232c93]={'$like':'%'+_0x42cb51[_0xfb5c('0x2d')][_0xfb5c('0x39')]+'%'};return _0x4ffe9a;})});}_0x583e0b=_[_0xfb5c('0x3a')]({},_0x583e0b,_0x42cb51[_0xfb5c('0x3b')]);return _0x165d92[_0xfb5c('0x4b')](_0x583e0b);}})[_0xfb5c('0x21')](function(_0x57867d){if(_0x57867d){_0x56c367=_0x57867d[_0xfb5c('0x32')];if(!_0x42cb51['query'][_0xfb5c('0x47')](_0xfb5c('0x33'))){_0x583e0b['limit']=qs[_0xfb5c('0x19')](_0x42cb51['query']['limit']);_0x583e0b[_0xfb5c('0x17')]=qs[_0xfb5c('0x17')](_0x42cb51['query'][_0xfb5c('0x17')]);}return _0x165d92[_0xfb5c('0x4b')](_0x583e0b);}})[_0xfb5c('0x21')](function(_0x318913){if(_0x318913){return _0x318913?{'count':_0x56c367,'rows':_0x318913}:null;}})[_0xfb5c('0x21')](respondWithResult(_0x49734d,null))[_0xfb5c('0x3e')](handleError(_0x49734d,null));};exports[_0xfb5c('0x4d')]=function(_0x5e1603,_0xeb09e,_0x2b8acd){if(_0x5e1603[_0xfb5c('0x44')]['id']){delete _0x5e1603[_0xfb5c('0x44')]['id'];}return db[_0xfb5c('0x28')][_0xfb5c('0x46')]({'where':{'id':_0x5e1603[_0xfb5c('0x40')]['id']}})['then'](handleEntityNotFound(_0xeb09e,null))[_0xfb5c('0x21')](function(_0x285b61){if(_0x285b61){return _0x285b61['setTags'](_0x5e1603[_0xfb5c('0x44')]['ids']||[]);}return null;})['then'](respondWithResult(_0xeb09e,null))[_0xfb5c('0x3e')](handleError(_0xeb09e,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7132ae0..53110db 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 _0x5e30=['./intDeskConfiguration.attributes','exports','int_desk_configurations','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x1ff3fc,_0x23153e){var _0x526f45=function(_0x482e54){while(--_0x482e54){_0x1ff3fc['push'](_0x1ff3fc['shift']());}};_0x526f45(++_0x23153e);}(_0x5e30,0x7b));var _0x05e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e30[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x05e3('0x0'));var util=require(_0x05e3('0x1'));var logger=require(_0x05e3('0x2'))(_0x05e3('0x3'));var moment=require(_0x05e3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x05e3('0x5'));var config=require(_0x05e3('0x6'));var attributes=require(_0x05e3('0x7'));module[_0x05e3('0x8')]=function(_0x348e2c,_0x2dd025){return _0x348e2c['define']('DeskConfiguration',attributes,{'tableName':_0x05e3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x56f7=['rimraf','./intDeskConfiguration.attributes','exports','DeskConfiguration','int_desk_configurations','lodash','api','moment','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x56f7,0xcb));var _0x756f=function(_0x42a571,_0x57321c){_0x42a571=_0x42a571-0x0;var _0x32afaf=_0x56f7[_0x42a571];return _0x32afaf;};'use strict';var _=require(_0x756f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x756f('0x1'));var moment=require(_0x756f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x756f('0x3'));var rimraf=require(_0x756f('0x4'));var config=require('../../config/environment');var attributes=require(_0x756f('0x5'));module[_0x756f('0x6')]=function(_0x5176db,_0x4a5d4e){return _0x5176db['define'](_0x756f('0x7'),attributes,{'tableName':_0x756f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 761b258..7416831 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 _0x4bc7=['client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x568f84,_0x5789b1){var _0x2b44b1=function(_0x516b61){while(--_0x516b61){_0x568f84['push'](_0x568f84['shift']());}};_0x2b44b1(++_0x5789b1);}(_0x4bc7,0x188));var _0x74bc=function(_0x57d209,_0x37dc1a){_0x57d209=_0x57d209-0x0;var _0x182ced=_0x4bc7[_0x57d209];return _0x182ced;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x74bc('0x0'));var BPromise=require(_0x74bc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74bc('0x2'))['db'];var utils=require(_0x74bc('0x3'));var logger=require(_0x74bc('0x4'))(_0x74bc('0x5'));var config=require(_0x74bc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x74bc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36cfb5,_0x3bde72,_0xd45119){return new BPromise(function(_0x4e7419,_0x5e48f8){return client[_0x74bc('0x8')](_0x36cfb5,_0xd45119)[_0x74bc('0x9')](function(_0x5cfa2e){logger[_0x74bc('0xa')](_0x74bc('0xb'),_0x3bde72,_0x74bc('0xc'));logger[_0x74bc('0xd')](_0x74bc('0xe'),_0x3bde72,_0x74bc('0xc'),JSON[_0x74bc('0xf')](_0x5cfa2e));if(_0x5cfa2e[_0x74bc('0x10')]){if(_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x11')]===0x1f4){logger[_0x74bc('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3bde72,_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x12')]);return _0x5e48f8(_0x5cfa2e[_0x74bc('0x10')]['message']);}logger['error'](_0x74bc('0xb'),_0x3bde72,_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x12')]);return _0x4e7419(_0x5cfa2e[_0x74bc('0x10')][_0x74bc('0x12')]);}else{logger['info'](_0x74bc('0xb'),_0x3bde72,_0x74bc('0xc'));_0x4e7419(_0x5cfa2e[_0x74bc('0x13')][_0x74bc('0x12')]);}})[_0x74bc('0x14')](function(_0xe82f8f){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x3bde72,_0xe82f8f);_0x5e48f8(_0xe82f8f);});});} \ No newline at end of file +var _0x471a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x471a,0x18d));var _0xa471=function(_0x4b0830,_0x2e3b0a){_0x4b0830=_0x4b0830-0x0;var _0x1f53a7=_0x471a[_0x4b0830];return _0x1f53a7;};'use strict';var _=require(_0xa471('0x0'));var util=require(_0xa471('0x1'));var moment=require(_0xa471('0x2'));var BPromise=require('bluebird');var rs=require(_0xa471('0x3'));var fs=require('fs');var Redis=require(_0xa471('0x4'));var db=require(_0xa471('0x5'))['db'];var utils=require(_0xa471('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa471('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5eb32c,_0x310613,_0x233b28){return new BPromise(function(_0x25f238,_0x50c1c4){return client[_0xa471('0x8')](_0x5eb32c,_0x233b28)['then'](function(_0x5b0a2b){logger[_0xa471('0x9')](_0xa471('0xa'),_0x310613,_0xa471('0xb'));logger[_0xa471('0xc')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x310613,_0xa471('0xb'),JSON[_0xa471('0xd')](_0x5b0a2b));if(_0x5b0a2b[_0xa471('0xe')]){if(_0x5b0a2b[_0xa471('0xe')][_0xa471('0xf')]===0x1f4){logger[_0xa471('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x310613,_0x5b0a2b[_0xa471('0xe')]['message']);return _0x50c1c4(_0x5b0a2b[_0xa471('0xe')]['message']);}logger[_0xa471('0xe')](_0xa471('0xa'),_0x310613,_0x5b0a2b[_0xa471('0xe')][_0xa471('0x10')]);return _0x25f238(_0x5b0a2b[_0xa471('0xe')][_0xa471('0x10')]);}else{logger['info'](_0xa471('0xa'),_0x310613,_0xa471('0xb'));_0x25f238(_0x5b0a2b[_0xa471('0x11')][_0xa471('0x10')]);}})[_0xa471('0x12')](function(_0x5730c3){logger[_0xa471('0xe')](_0xa471('0xa'),_0x310613,_0x5730c3);_0x50c1c4(_0x5730c3);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 005c2a1..733bfbe 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 _0xa3d4=['exports','multer','path','connect-timeout','express','fs-extra','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy'];(function(_0x2cc8bb,_0x5f2607){var _0x140e40=function(_0x80d96d){while(--_0x80d96d){_0x2cc8bb['push'](_0x2cc8bb['shift']());}};_0x140e40(++_0x5f2607);}(_0xa3d4,0x151));var _0x4a3d=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xa3d4[_0x2064e5];return _0x21a233;};'use strict';var multer=require(_0x4a3d('0x0'));var util=require('util');var path=require(_0x4a3d('0x1'));var timeout=require(_0x4a3d('0x2'));var express=require(_0x4a3d('0x3'));var router=express['Router']();var fs_extra=require(_0x4a3d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth[_0x4a3d('0x5')](),controller[_0x4a3d('0x6')]);router[_0x4a3d('0x7')](_0x4a3d('0x8'),auth[_0x4a3d('0x5')](),controller[_0x4a3d('0x9')]);router[_0x4a3d('0xa')]('/',auth[_0x4a3d('0x5')](),controller[_0x4a3d('0xb')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x4a3d('0xc')]);router[_0x4a3d('0xd')](_0x4a3d('0x8'),auth[_0x4a3d('0x5')](),controller[_0x4a3d('0xe')]);module[_0x4a3d('0xf')]=router; \ No newline at end of file +var _0x0874=['post','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1946ec,_0x27c21b){var _0x2e3bb3=function(_0x51023d){while(--_0x51023d){_0x1946ec['push'](_0x1946ec['shift']());}};_0x2e3bb3(++_0x27c21b);}(_0x0874,0xb1));var _0x4087=function(_0x30ad4f,_0x1d7324){_0x30ad4f=_0x30ad4f-0x0;var _0x55e2a3=_0x0874[_0x30ad4f];return _0x55e2a3;};'use strict';var multer=require('multer');var util=require(_0x4087('0x0'));var path=require('path');var timeout=require(_0x4087('0x1'));var express=require(_0x4087('0x2'));var router=express[_0x4087('0x3')]();var fs_extra=require(_0x4087('0x4'));var auth=require(_0x4087('0x5'));var interaction=require(_0x4087('0x6'));var config=require('../../config/environment');var controller=require(_0x4087('0x7'));router[_0x4087('0x8')]('/',auth[_0x4087('0x9')](),controller[_0x4087('0xa')]);router['get'](_0x4087('0xb'),auth['isAuthenticated'](),controller[_0x4087('0xc')]);router[_0x4087('0xd')]('/',auth['isAuthenticated'](),controller[_0x4087('0xe')]);router[_0x4087('0xf')](_0x4087('0xb'),auth[_0x4087('0x9')](),controller[_0x4087('0x10')]);router['delete'](_0x4087('0xb'),auth[_0x4087('0x9')](),controller[_0x4087('0x11')]);module[_0x4087('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a9b99fd..3753001 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 _0xea0c=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x83531b,_0x5daca6){var _0x3696f2=function(_0x368b38){while(--_0x368b38){_0x83531b['push'](_0x83531b['shift']());}};_0x3696f2(++_0x5daca6);}(_0xea0c,0x12a));var _0xcea0=function(_0x56524a,_0x3e8a54){_0x56524a=_0x56524a-0x0;var _0x40f630=_0xea0c[_0x56524a];return _0x40f630;};'use strict';var Sequelize=require(_0xcea0('0x0'));module[_0xcea0('0x1')]={'type':{'type':Sequelize[_0xcea0('0x2')](_0xcea0('0x3'),_0xcea0('0x4'),_0xcea0('0x5'),_0xcea0('0x6'),_0xcea0('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcea0('0x8')]},'key':{'type':Sequelize[_0xcea0('0x8')]},'keyType':{'type':Sequelize[_0xcea0('0x2')](_0xcea0('0x3'),'variable',_0xcea0('0x5'))},'keyContent':{'type':Sequelize[_0xcea0('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xcea0('0x8')]},'customField':{'type':Sequelize[_0xcea0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcea0('0x8')]}}; \ No newline at end of file +var _0x1f35=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f35,0x16f));var _0x51f3=function(_0x19c75d,_0x3ee687){_0x19c75d=_0x19c75d-0x0;var _0x55e19a=_0x1f35[_0x19c75d];return _0x55e19a;};'use strict';var Sequelize=require('sequelize');module[_0x51f3('0x0')]={'type':{'type':Sequelize[_0x51f3('0x1')](_0x51f3('0x2'),_0x51f3('0x3'),_0x51f3('0x4'),_0x51f3('0x5'),_0x51f3('0x6')),'defaultValue':_0x51f3('0x2')},'content':{'type':Sequelize[_0x51f3('0x7')]},'key':{'type':Sequelize[_0x51f3('0x7')]},'keyType':{'type':Sequelize[_0x51f3('0x1')]('string',_0x51f3('0x3'),_0x51f3('0x4'))},'keyContent':{'type':Sequelize[_0x51f3('0x7')]},'idField':{'type':Sequelize[_0x51f3('0x7')]},'nameField':{'type':Sequelize[_0x51f3('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x51f3('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index df4832f..17526c2 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 _0xe685=['bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','filters','pick','filter','where','VIRTUAL','options','DeskField','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','destroy','rimraf','zip-dir','request-promise','moment'];(function(_0x3817fe,_0x4d1619){var _0x31063c=function(_0x53352b){while(--_0x53352b){_0x3817fe['push'](_0x3817fe['shift']());}};_0x31063c(++_0x4d1619);}(_0xe685,0x1ed));var _0x5e68=function(_0x3aefd8,_0x5b1d0f){_0x3aefd8=_0x3aefd8-0x0;var _0x2f84eb=_0xe685[_0x3aefd8];return _0x2f84eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e68('0x0'));var zipdir=require(_0x5e68('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e68('0x2'));var moment=require(_0x5e68('0x3'));var BPromise=require(_0x5e68('0x4'));var Mustache=require(_0x5e68('0x5'));var util=require(_0x5e68('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5e68('0x7'));var ejs=require(_0x5e68('0x8'));var fs=require('fs');var fs_extra=require(_0x5e68('0x9'));var _=require(_0x5e68('0xa'));var squel=require('squel');var crypto=require(_0x5e68('0xb'));var jsforce=require(_0x5e68('0xc'));var deskjs=require(_0x5e68('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5e68('0xe'));var authService=require(_0x5e68('0xf'));var qs=require(_0x5e68('0x10'));var as=require(_0x5e68('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e68('0x12'));var db=require(_0x5e68('0x13'))['db'];function respondWithStatusCode(_0x36bbd7,_0x5abe15){_0x5abe15=_0x5abe15||0xcc;return function(_0x1f4df9){if(_0x1f4df9){return _0x36bbd7[_0x5e68('0x14')](_0x5abe15);}return _0x36bbd7['status'](_0x5abe15)[_0x5e68('0x15')]();};}function respondWithResult(_0x5b3ff2,_0x183736){_0x183736=_0x183736||0xc8;return function(_0x5dd1c1){if(_0x5dd1c1){return _0x5b3ff2[_0x5e68('0x16')](_0x183736)[_0x5e68('0x17')](_0x5dd1c1);}};}function respondWithFilteredResult(_0x222350,_0x5a6c1d){return function(_0x44c63f){if(_0x44c63f){var _0x5a97e3=typeof _0x5a6c1d['offset']===_0x5e68('0x18')&&typeof _0x5a6c1d[_0x5e68('0x19')]===_0x5e68('0x18');var _0x3fbd91=_0x44c63f[_0x5e68('0x1a')];var _0x370050=_0x5a97e3?0x0:_0x5a6c1d['offset'];var _0x38e29d=_0x5a97e3?_0x44c63f[_0x5e68('0x1a')]:_0x5a6c1d['offset']+_0x5a6c1d[_0x5e68('0x19')];var _0x1da861;if(_0x38e29d>=_0x3fbd91){_0x38e29d=_0x3fbd91;_0x1da861=0xc8;}else{_0x1da861=0xce;}_0x222350[_0x5e68('0x16')](_0x1da861);return _0x222350['set'](_0x5e68('0x1b'),_0x370050+'-'+_0x38e29d+'/'+_0x3fbd91)[_0x5e68('0x17')](_0x44c63f);}return null;};}function patchUpdates(_0x2306bf){return function(_0x2c52ed){try{jsonpatch[_0x5e68('0x1c')](_0x2c52ed,_0x2306bf,!![]);}catch(_0xc5cdb3){return BPromise[_0x5e68('0x1d')](_0xc5cdb3);}return _0x2c52ed['save']();};}function saveUpdates(_0x1c16f2,_0x3138de){return function(_0x4132c2){if(_0x4132c2){return _0x4132c2[_0x5e68('0x1e')](_0x1c16f2)[_0x5e68('0x1f')](function(_0x41a572){return _0x41a572;});}return null;};}function removeEntity(_0x4ded56,_0x5bf874){return function(_0x5ca5f4){if(_0x5ca5f4){return _0x5ca5f4['destroy']()['then'](function(){_0x4ded56['status'](0xcc)[_0x5e68('0x15')]();});}};}function handleEntityNotFound(_0x4e597b,_0x2f43ea){return function(_0x4524cd){if(!_0x4524cd){_0x4e597b[_0x5e68('0x14')](0x194);}return _0x4524cd;};}function handleError(_0x4da484,_0x1847df){_0x1847df=_0x1847df||0x1f4;return function(_0xb81447){logger[_0x5e68('0x20')](_0xb81447[_0x5e68('0x21')]);if(_0xb81447[_0x5e68('0x22')]){delete _0xb81447[_0x5e68('0x22')];}_0x4da484[_0x5e68('0x16')](_0x1847df)[_0x5e68('0x23')](_0xb81447);};}exports['index']=function(_0x4aaef4,_0x30464f){var _0x5bf540={},_0x527643={},_0x510689={'count':0x0,'rows':[]};var _0x5d22f1=_[_0x5e68('0x24')](db['DeskField'][_0x5e68('0x25')],function(_0x3a236a){return{'name':_0x3a236a[_0x5e68('0x26')],'type':_0x3a236a[_0x5e68('0x27')][_0x5e68('0x28')]};});_0x527643['model']=_[_0x5e68('0x24')](_0x5d22f1,_0x5e68('0x22'));_0x527643[_0x5e68('0x29')]=_[_0x5e68('0x2a')](_0x4aaef4[_0x5e68('0x29')]);_0x527643['filters']=_[_0x5e68('0x2b')](_0x527643[_0x5e68('0x2c')],_0x527643['query']);_0x5bf540[_0x5e68('0x2d')]=_[_0x5e68('0x2b')](_0x527643['model'],qs[_0x5e68('0x2e')](_0x4aaef4['query']['fields']));_0x5bf540['attributes']=_0x5bf540['attributes'][_0x5e68('0x2f')]?_0x5bf540[_0x5e68('0x2d')]:_0x527643[_0x5e68('0x2c')];if(!_0x4aaef4[_0x5e68('0x29')][_0x5e68('0x30')](_0x5e68('0x31'))){_0x5bf540[_0x5e68('0x19')]=qs[_0x5e68('0x19')](_0x4aaef4[_0x5e68('0x29')][_0x5e68('0x19')]);_0x5bf540[_0x5e68('0x32')]=qs[_0x5e68('0x32')](_0x4aaef4[_0x5e68('0x29')][_0x5e68('0x32')]);}_0x5bf540['order']=qs[_0x5e68('0x33')](_0x4aaef4[_0x5e68('0x29')][_0x5e68('0x33')]);_0x5bf540['where']=qs[_0x5e68('0x34')](_[_0x5e68('0x35')](_0x4aaef4['query'],_0x527643[_0x5e68('0x34')]),_0x5d22f1);if(_0x4aaef4[_0x5e68('0x29')][_0x5e68('0x36')]){_0x5bf540[_0x5e68('0x37')]=_['merge'](_0x5bf540['where'],{'$or':_[_0x5e68('0x24')](_0x5d22f1,function(_0x202c62){if(_0x202c62[_0x5e68('0x27')]!==_0x5e68('0x38')){var _0x4e0bef={};_0x4e0bef[_0x202c62['name']]={'$like':'%'+_0x4aaef4[_0x5e68('0x29')][_0x5e68('0x36')]+'%'};return _0x4e0bef;}})});}_0x5bf540=_['merge']({},_0x5bf540,_0x4aaef4[_0x5e68('0x39')]);var _0x5a6566={'where':_0x5bf540[_0x5e68('0x37')]};return db[_0x5e68('0x3a')][_0x5e68('0x1a')](_0x5a6566)['then'](function(_0x4c7381){_0x510689[_0x5e68('0x1a')]=_0x4c7381;if(_0x4aaef4['query'][_0x5e68('0x3b')]){_0x5bf540[_0x5e68('0x3c')]=[{'all':!![]}];}return db[_0x5e68('0x3a')][_0x5e68('0x3d')](_0x5bf540);})[_0x5e68('0x1f')](function(_0xb9bd76){_0x510689[_0x5e68('0x3e')]=_0xb9bd76;return _0x510689;})[_0x5e68('0x1f')](respondWithFilteredResult(_0x30464f,_0x5bf540))[_0x5e68('0x3f')](handleError(_0x30464f,null));};exports[_0x5e68('0x40')]=function(_0x2d99dc,_0x355407){var _0x56be1a={'raw':!![],'where':{'id':_0x2d99dc[_0x5e68('0x41')]['id']}},_0x3986dd={};_0x3986dd[_0x5e68('0x2c')]=_[_0x5e68('0x2a')](db[_0x5e68('0x3a')][_0x5e68('0x25')]);_0x3986dd[_0x5e68('0x29')]=_[_0x5e68('0x2a')](_0x2d99dc[_0x5e68('0x29')]);_0x3986dd['filters']=_['intersection'](_0x3986dd[_0x5e68('0x2c')],_0x3986dd['query']);_0x56be1a[_0x5e68('0x2d')]=_[_0x5e68('0x2b')](_0x3986dd[_0x5e68('0x2c')],qs[_0x5e68('0x2e')](_0x2d99dc[_0x5e68('0x29')][_0x5e68('0x2e')]));_0x56be1a[_0x5e68('0x2d')]=_0x56be1a[_0x5e68('0x2d')]['length']?_0x56be1a[_0x5e68('0x2d')]:_0x3986dd['model'];if(_0x2d99dc[_0x5e68('0x29')][_0x5e68('0x3b')]){_0x56be1a[_0x5e68('0x3c')]=[{'all':!![]}];}_0x56be1a=_[_0x5e68('0x42')]({},_0x56be1a,_0x2d99dc[_0x5e68('0x39')]);return db[_0x5e68('0x3a')][_0x5e68('0x43')](_0x56be1a)[_0x5e68('0x1f')](handleEntityNotFound(_0x355407,null))['then'](respondWithResult(_0x355407,null))[_0x5e68('0x3f')](handleError(_0x355407,null));};exports[_0x5e68('0x44')]=function(_0x427b57,_0x3c7d1b){return db[_0x5e68('0x3a')][_0x5e68('0x44')](_0x427b57['body'],{})[_0x5e68('0x1f')](respondWithResult(_0x3c7d1b,0xc9))[_0x5e68('0x3f')](handleError(_0x3c7d1b,null));};exports[_0x5e68('0x1e')]=function(_0x71b7bf,_0x5e4e7d){if(_0x71b7bf[_0x5e68('0x45')]['id']){delete _0x71b7bf['body']['id'];}return db[_0x5e68('0x3a')][_0x5e68('0x43')]({'where':{'id':_0x71b7bf[_0x5e68('0x41')]['id']}})[_0x5e68('0x1f')](handleEntityNotFound(_0x5e4e7d,null))['then'](saveUpdates(_0x71b7bf[_0x5e68('0x45')],null))[_0x5e68('0x1f')](respondWithResult(_0x5e4e7d,null))[_0x5e68('0x3f')](handleError(_0x5e4e7d,null));};exports[_0x5e68('0x46')]=function(_0x5301fa,_0x28fa40){return db[_0x5e68('0x3a')]['find']({'where':{'id':_0x5301fa[_0x5e68('0x41')]['id']}})[_0x5e68('0x1f')](handleEntityNotFound(_0x28fa40,null))[_0x5e68('0x1f')](removeEntity(_0x28fa40,null))[_0x5e68('0x3f')](handleError(_0x28fa40,null));}; \ No newline at end of file +var _0xbba1=['end','json','offset','count','limit','status','Content-Range','apply','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','DeskField','findAll','rows','catch','show','length','include','find','create','update','body','params','destroy','eml-format','fast-json-patch','request-promise','mustache','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x4dbbdc,_0x1eb315){var _0x3b4842=function(_0x1c43d6){while(--_0x1c43d6){_0x4dbbdc['push'](_0x4dbbdc['shift']());}};_0x3b4842(++_0x1eb315);}(_0xbba1,0x17f));var _0x1bba=function(_0x59c938,_0x395f9c){_0x59c938=_0x59c938-0x0;var _0x668592=_0xbba1[_0x59c938];return _0x668592;};'use strict';var emlformat=require(_0x1bba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1bba('0x1'));var rp=require(_0x1bba('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1bba('0x3'));var util=require('util');var path=require('path');var sox=require(_0x1bba('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bba('0x5'));var _=require(_0x1bba('0x6'));var squel=require(_0x1bba('0x7'));var crypto=require(_0x1bba('0x8'));var jsforce=require(_0x1bba('0x9'));var deskjs=require(_0x1bba('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1bba('0xb'));var Redis=require('ioredis');var authService=require(_0x1bba('0xc'));var qs=require(_0x1bba('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1bba('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0x1bba('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x1bba('0x10'));var db=require(_0x1bba('0x11'))['db'];function respondWithStatusCode(_0x4ddaf8,_0x2ebc6b){_0x2ebc6b=_0x2ebc6b||0xcc;return function(_0x39fe52){if(_0x39fe52){return _0x4ddaf8[_0x1bba('0x12')](_0x2ebc6b);}return _0x4ddaf8['status'](_0x2ebc6b)[_0x1bba('0x13')]();};}function respondWithResult(_0x585f2f,_0x113a49){_0x113a49=_0x113a49||0xc8;return function(_0x8f18b2){if(_0x8f18b2){return _0x585f2f['status'](_0x113a49)[_0x1bba('0x14')](_0x8f18b2);}};}function respondWithFilteredResult(_0x2d12fb,_0x4a3f61){return function(_0x4f06be){if(_0x4f06be){var _0x551354=typeof _0x4a3f61[_0x1bba('0x15')]==='undefined'&&typeof _0x4a3f61['limit']==='undefined';var _0x1e2c51=_0x4f06be['count'];var _0x5caa43=_0x551354?0x0:_0x4a3f61['offset'];var _0xbaf148=_0x551354?_0x4f06be[_0x1bba('0x16')]:_0x4a3f61[_0x1bba('0x15')]+_0x4a3f61[_0x1bba('0x17')];var _0x4b6e55;if(_0xbaf148>=_0x1e2c51){_0xbaf148=_0x1e2c51;_0x4b6e55=0xc8;}else{_0x4b6e55=0xce;}_0x2d12fb[_0x1bba('0x18')](_0x4b6e55);return _0x2d12fb['set'](_0x1bba('0x19'),_0x5caa43+'-'+_0xbaf148+'/'+_0x1e2c51)['json'](_0x4f06be);}return null;};}function patchUpdates(_0x4fe2bf){return function(_0x15f9c4){try{jsonpatch[_0x1bba('0x1a')](_0x15f9c4,_0x4fe2bf,!![]);}catch(_0x1e646e){return BPromise['reject'](_0x1e646e);}return _0x15f9c4['save']();};}function saveUpdates(_0x3ee2a3,_0x37d760){return function(_0x329649){if(_0x329649){return _0x329649['update'](_0x3ee2a3)[_0x1bba('0x1b')](function(_0x184711){return _0x184711;});}return null;};}function removeEntity(_0x5eda49,_0x456667){return function(_0x31747e){if(_0x31747e){return _0x31747e['destroy']()['then'](function(){_0x5eda49['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6a9d,_0x5d2a91){return function(_0x2c2bdd){if(!_0x2c2bdd){_0x2b6a9d[_0x1bba('0x12')](0x194);}return _0x2c2bdd;};}function handleError(_0x301c83,_0x8020d0){_0x8020d0=_0x8020d0||0x1f4;return function(_0x587976){logger[_0x1bba('0x1c')](_0x587976[_0x1bba('0x1d')]);if(_0x587976['name']){delete _0x587976[_0x1bba('0x1e')];}_0x301c83[_0x1bba('0x18')](_0x8020d0)['send'](_0x587976);};}exports[_0x1bba('0x1f')]=function(_0x1c0124,_0x15f62e){var _0x39bfb2={},_0x3f615e={},_0x20b371={'count':0x0,'rows':[]};var _0x29c4e8=_[_0x1bba('0x20')](db['DeskField'][_0x1bba('0x21')],function(_0xb6fbe7){return{'name':_0xb6fbe7[_0x1bba('0x22')],'type':_0xb6fbe7['type'][_0x1bba('0x23')]};});_0x3f615e[_0x1bba('0x24')]=_[_0x1bba('0x20')](_0x29c4e8,_0x1bba('0x1e'));_0x3f615e[_0x1bba('0x25')]=_[_0x1bba('0x26')](_0x1c0124[_0x1bba('0x25')]);_0x3f615e[_0x1bba('0x27')]=_[_0x1bba('0x28')](_0x3f615e[_0x1bba('0x24')],_0x3f615e[_0x1bba('0x25')]);_0x39bfb2['attributes']=_[_0x1bba('0x28')](_0x3f615e['model'],qs[_0x1bba('0x29')](_0x1c0124['query'][_0x1bba('0x29')]));_0x39bfb2[_0x1bba('0x2a')]=_0x39bfb2[_0x1bba('0x2a')]['length']?_0x39bfb2['attributes']:_0x3f615e[_0x1bba('0x24')];if(!_0x1c0124[_0x1bba('0x25')]['hasOwnProperty'](_0x1bba('0x2b'))){_0x39bfb2['limit']=qs['limit'](_0x1c0124[_0x1bba('0x25')]['limit']);_0x39bfb2['offset']=qs['offset'](_0x1c0124[_0x1bba('0x25')]['offset']);}_0x39bfb2[_0x1bba('0x2c')]=qs[_0x1bba('0x2d')](_0x1c0124['query'][_0x1bba('0x2d')]);_0x39bfb2[_0x1bba('0x2e')]=qs[_0x1bba('0x27')](_[_0x1bba('0x2f')](_0x1c0124[_0x1bba('0x25')],_0x3f615e[_0x1bba('0x27')]),_0x29c4e8);if(_0x1c0124[_0x1bba('0x25')][_0x1bba('0x30')]){_0x39bfb2['where']=_[_0x1bba('0x31')](_0x39bfb2[_0x1bba('0x2e')],{'$or':_['map'](_0x29c4e8,function(_0x2137d1){if(_0x2137d1[_0x1bba('0x32')]!==_0x1bba('0x33')){var _0x4be96f={};_0x4be96f[_0x2137d1['name']]={'$like':'%'+_0x1c0124[_0x1bba('0x25')][_0x1bba('0x30')]+'%'};return _0x4be96f;}})});}_0x39bfb2=_['merge']({},_0x39bfb2,_0x1c0124[_0x1bba('0x34')]);var _0x433b4d={'where':_0x39bfb2[_0x1bba('0x2e')]};return db['DeskField'][_0x1bba('0x16')](_0x433b4d)[_0x1bba('0x1b')](function(_0x214d05){_0x20b371[_0x1bba('0x16')]=_0x214d05;if(_0x1c0124[_0x1bba('0x25')][_0x1bba('0x35')]){_0x39bfb2['include']=[{'all':!![]}];}return db[_0x1bba('0x36')][_0x1bba('0x37')](_0x39bfb2);})[_0x1bba('0x1b')](function(_0x165e20){_0x20b371[_0x1bba('0x38')]=_0x165e20;return _0x20b371;})[_0x1bba('0x1b')](respondWithFilteredResult(_0x15f62e,_0x39bfb2))[_0x1bba('0x39')](handleError(_0x15f62e,null));};exports[_0x1bba('0x3a')]=function(_0x174cb1,_0x421cf8){var _0x35b529={'raw':!![],'where':{'id':_0x174cb1['params']['id']}},_0x38929e={};_0x38929e[_0x1bba('0x24')]=_[_0x1bba('0x26')](db[_0x1bba('0x36')][_0x1bba('0x21')]);_0x38929e['query']=_[_0x1bba('0x26')](_0x174cb1[_0x1bba('0x25')]);_0x38929e['filters']=_['intersection'](_0x38929e[_0x1bba('0x24')],_0x38929e[_0x1bba('0x25')]);_0x35b529[_0x1bba('0x2a')]=_[_0x1bba('0x28')](_0x38929e[_0x1bba('0x24')],qs[_0x1bba('0x29')](_0x174cb1['query']['fields']));_0x35b529[_0x1bba('0x2a')]=_0x35b529[_0x1bba('0x2a')][_0x1bba('0x3b')]?_0x35b529[_0x1bba('0x2a')]:_0x38929e[_0x1bba('0x24')];if(_0x174cb1[_0x1bba('0x25')][_0x1bba('0x35')]){_0x35b529[_0x1bba('0x3c')]=[{'all':!![]}];}_0x35b529=_[_0x1bba('0x31')]({},_0x35b529,_0x174cb1[_0x1bba('0x34')]);return db[_0x1bba('0x36')][_0x1bba('0x3d')](_0x35b529)[_0x1bba('0x1b')](handleEntityNotFound(_0x421cf8,null))['then'](respondWithResult(_0x421cf8,null))[_0x1bba('0x39')](handleError(_0x421cf8,null));};exports[_0x1bba('0x3e')]=function(_0x2068b3,_0x316af2){return db[_0x1bba('0x36')]['create'](_0x2068b3['body'],{})['then'](respondWithResult(_0x316af2,0xc9))[_0x1bba('0x39')](handleError(_0x316af2,null));};exports[_0x1bba('0x3f')]=function(_0x199cfc,_0x3acc20){if(_0x199cfc['body']['id']){delete _0x199cfc[_0x1bba('0x40')]['id'];}return db[_0x1bba('0x36')]['find']({'where':{'id':_0x199cfc[_0x1bba('0x41')]['id']}})[_0x1bba('0x1b')](handleEntityNotFound(_0x3acc20,null))[_0x1bba('0x1b')](saveUpdates(_0x199cfc[_0x1bba('0x40')],null))[_0x1bba('0x1b')](respondWithResult(_0x3acc20,null))['catch'](handleError(_0x3acc20,null));};exports[_0x1bba('0x42')]=function(_0x5645a4,_0x1d9539){return db[_0x1bba('0x36')][_0x1bba('0x3d')]({'where':{'id':_0x5645a4[_0x1bba('0x41')]['id']}})['then'](handleEntityNotFound(_0x1d9539,null))[_0x1bba('0x1b')](removeEntity(_0x1d9539,null))[_0x1bba('0x39')](handleError(_0x1d9539,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index c506b1c..71f1f16 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 _0x411b=['lodash','../../config/logger','api','bluebird','request-promise','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x48da10,_0x205da5){var _0x432baa=function(_0x1b6611){while(--_0x1b6611){_0x48da10['push'](_0x48da10['shift']());}};_0x432baa(++_0x205da5);}(_0x411b,0x188));var _0xb411=function(_0x18cab2,_0x413327){_0x18cab2=_0x18cab2-0x0;var _0x271a55=_0x411b[_0x18cab2];return _0x271a55;};'use strict';var _=require(_0xb411('0x0'));var util=require('util');var logger=require(_0xb411('0x1'))(_0xb411('0x2'));var moment=require('moment');var BPromise=require(_0xb411('0x3'));var rp=require(_0xb411('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb411('0x5'));var config=require('../../config/environment');var attributes=require(_0xb411('0x6'));module[_0xb411('0x7')]=function(_0x17fabb,_0x362f93){return _0x17fabb[_0xb411('0x8')](_0xb411('0x9'),attributes,{'tableName':_0xb411('0xa'),'paranoid':![],'indexes':[{'name':_0xb411('0xb'),'fields':[_0xb411('0xc'),_0xb411('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6f53=['path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0x1e48b3,_0x3150bc){var _0x295fae=function(_0x58b33a){while(--_0x58b33a){_0x1e48b3['push'](_0x1e48b3['shift']());}};_0x295fae(++_0x3150bc);}(_0x6f53,0x1c5));var _0x36f5=function(_0xf36e9b,_0x4dcef5){_0xf36e9b=_0xf36e9b-0x0;var _0x2fabba=_0x6f53[_0xf36e9b];return _0x2fabba;};'use strict';var _=require(_0x36f5('0x0'));var util=require('util');var logger=require(_0x36f5('0x1'))(_0x36f5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x36f5('0x3'));var rimraf=require(_0x36f5('0x4'));var config=require(_0x36f5('0x5'));var attributes=require(_0x36f5('0x6'));module['exports']=function(_0x53cde7,_0x4fd9a5){return _0x53cde7['define'](_0x36f5('0x7'),attributes,{'tableName':_0x36f5('0x8'),'paranoid':![],'indexes':[{'name':_0x36f5('0x9'),'fields':[_0x36f5('0xa'),_0x36f5('0xb')],'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 5bcc7b4..f5f74b9 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 _0xd489=['DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s'];(function(_0x178543,_0x36bd87){var _0xba6ffe=function(_0x59c2b0){while(--_0x59c2b0){_0x178543['push'](_0x178543['shift']());}};_0xba6ffe(++_0x36bd87);}(_0xd489,0xdf));var _0x9d48=function(_0x17019f,_0x1e2237){_0x17019f=_0x17019f-0x0;var _0x4889c9=_0xd489[_0x17019f];return _0x4889c9;};'use strict';var _=require(_0x9d48('0x0'));var util=require('util');var moment=require(_0x9d48('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d48('0x2'));var db=require(_0x9d48('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9d48('0x4'));var jayson=require(_0x9d48('0x5'));var client=jayson['client'][_0x9d48('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3fe5b6,_0x193772,_0x466974){return new BPromise(function(_0x3b4dff,_0x4c4909){return client[_0x9d48('0x7')](_0x3fe5b6,_0x466974)[_0x9d48('0x8')](function(_0x1b044e){logger[_0x9d48('0x9')](_0x9d48('0xa'),_0x193772,'request\x20sent');logger['debug'](_0x9d48('0xb'),_0x193772,_0x9d48('0xc'),JSON['stringify'](_0x1b044e));if(_0x1b044e[_0x9d48('0xd')]){if(_0x1b044e[_0x9d48('0xd')][_0x9d48('0xe')]===0x1f4){logger['error'](_0x9d48('0xa'),_0x193772,_0x1b044e[_0x9d48('0xd')][_0x9d48('0xf')]);return _0x4c4909(_0x1b044e[_0x9d48('0xd')][_0x9d48('0xf')]);}logger[_0x9d48('0xd')](_0x9d48('0xa'),_0x193772,_0x1b044e[_0x9d48('0xd')][_0x9d48('0xf')]);return _0x3b4dff(_0x1b044e[_0x9d48('0xd')]['message']);}else{logger[_0x9d48('0x9')](_0x9d48('0xa'),_0x193772,_0x9d48('0xc'));_0x3b4dff(_0x1b044e[_0x9d48('0x10')][_0x9d48('0xf')]);}})[_0x9d48('0x11')](function(_0x43a4e5){logger[_0x9d48('0xd')](_0x9d48('0xa'),_0x193772,_0x43a4e5);_0x4c4909(_0x43a4e5);});});} \ No newline at end of file +var _0xf29f=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','DeskField,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x38b5c0,_0x446ddb){var _0x4fc232=function(_0x41d3d9){while(--_0x41d3d9){_0x38b5c0['push'](_0x38b5c0['shift']());}};_0x4fc232(++_0x446ddb);}(_0xf29f,0x173));var _0xff29=function(_0x4be023,_0x264980){_0x4be023=_0x4be023-0x0;var _0x1fcb0f=_0xf29f[_0x4be023];return _0x1fcb0f;};'use strict';var _=require(_0xff29('0x0'));var util=require('util');var moment=require(_0xff29('0x1'));var BPromise=require('bluebird');var rs=require(_0xff29('0x2'));var fs=require('fs');var Redis=require(_0xff29('0x3'));var db=require(_0xff29('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff29('0x5'));var config=require(_0xff29('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xff29('0x7')][_0xff29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d578f,_0x55c7a2,_0x1120cb){return new BPromise(function(_0xe3f725,_0x57400b){return client['request'](_0x3d578f,_0x1120cb)['then'](function(_0x209621){logger['info']('DeskField,\x20%s,\x20%s',_0x55c7a2,_0xff29('0x9'));logger[_0xff29('0xa')](_0xff29('0xb'),_0x55c7a2,_0xff29('0x9'),JSON[_0xff29('0xc')](_0x209621));if(_0x209621['error']){if(_0x209621['error'][_0xff29('0xd')]===0x1f4){logger[_0xff29('0xe')](_0xff29('0xf'),_0x55c7a2,_0x209621['error'][_0xff29('0x10')]);return _0x57400b(_0x209621['error'][_0xff29('0x10')]);}logger[_0xff29('0xe')]('DeskField,\x20%s,\x20%s',_0x55c7a2,_0x209621[_0xff29('0xe')]['message']);return _0xe3f725(_0x209621[_0xff29('0xe')][_0xff29('0x10')]);}else{logger[_0xff29('0x11')](_0xff29('0xf'),_0x55c7a2,_0xff29('0x9'));_0xe3f725(_0x209621[_0xff29('0x12')][_0xff29('0x10')]);}})[_0xff29('0x13')](function(_0x2883df){logger[_0xff29('0xe')]('DeskField,\x20%s,\x20%s',_0x55c7a2,_0x2883df);_0x57400b(_0x2883df);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 720f8e3..cb3d326 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 _0xceec=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','create','post','addConfiguration','delete','destroy','multer','util'];(function(_0x2e712d,_0x4e9f87){var _0x2bec13=function(_0x2af350){while(--_0x2af350){_0x2e712d['push'](_0x2e712d['shift']());}};_0x2bec13(++_0x4e9f87);}(_0xceec,0xe2));var _0xccee=function(_0x444c15,_0x79380f){_0x444c15=_0x444c15-0x0;var _0x514d7f=_0xceec[_0x444c15];return _0x514d7f;};'use strict';var multer=require(_0xccee('0x0'));var util=require(_0xccee('0x1'));var path=require(_0xccee('0x2'));var timeout=require(_0xccee('0x3'));var express=require(_0xccee('0x4'));var router=express['Router']();var fs_extra=require(_0xccee('0x5'));var auth=require(_0xccee('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xccee('0x7'));var controller=require('./intDynamics365Account.controller');router[_0xccee('0x8')]('/',auth['isAuthenticated'](),controller[_0xccee('0x9')]);router['get'](_0xccee('0xa'),auth[_0xccee('0xb')](),controller['show']);router[_0xccee('0x8')](_0xccee('0xc'),auth['isAuthenticated'](),controller[_0xccee('0xd')]);router['get']('/:id/fields',auth[_0xccee('0xb')](),controller['getFields']);router['post']('/',auth[_0xccee('0xb')](),controller[_0xccee('0xe')]);router[_0xccee('0xf')](_0xccee('0xc'),auth[_0xccee('0xb')](),controller[_0xccee('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xccee('0x11')](_0xccee('0xa'),auth[_0xccee('0xb')](),controller[_0xccee('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb459=['../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','post','create','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x318104,_0x19d95a){var _0x44d563=function(_0x139edf){while(--_0x139edf){_0x318104['push'](_0x318104['shift']());}};_0x44d563(++_0x19d95a);}(_0xb459,0x13e));var _0x9b45=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0xb459[_0x754ab4];return _0x34079a;};'use strict';var multer=require(_0x9b45('0x0'));var util=require(_0x9b45('0x1'));var path=require('path');var timeout=require(_0x9b45('0x2'));var express=require('express');var router=express[_0x9b45('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9b45('0x4'));var interaction=require(_0x9b45('0x5'));var config=require(_0x9b45('0x6'));var controller=require('./intDynamics365Account.controller');router[_0x9b45('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9b45('0x8'),auth[_0x9b45('0x9')](),controller[_0x9b45('0xa')]);router[_0x9b45('0x7')](_0x9b45('0xb'),auth[_0x9b45('0x9')](),controller[_0x9b45('0xc')]);router[_0x9b45('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x9b45('0xd')]);router[_0x9b45('0xe')]('/',auth[_0x9b45('0x9')](),controller[_0x9b45('0xf')]);router[_0x9b45('0xe')](_0x9b45('0xb'),auth[_0x9b45('0x9')](),controller['addConfiguration']);router['put'](_0x9b45('0x8'),auth[_0x9b45('0x9')](),controller[_0x9b45('0x10')]);router['delete'](_0x9b45('0x8'),auth[_0x9b45('0x9')](),controller['destroy']);module[_0x9b45('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index c0e162b..10bf5e2 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 _0x05bc=['exports','STRING','BOOLEAN'];(function(_0xef5d83,_0x264acc){var _0x3ee0f6=function(_0x5b4b8e){while(--_0x5b4b8e){_0xef5d83['push'](_0xef5d83['shift']());}};_0x3ee0f6(++_0x264acc);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xc05b('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc05b('0x1')]},'password':{'type':Sequelize[_0xc05b('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xc05b('0x1')]},'clientId':{'type':Sequelize[_0xc05b('0x1')]},'clientSecret':{'type':Sequelize[_0xc05b('0x1')]},'serverUrl':{'type':Sequelize[_0xc05b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xc05b('0x1')]},'modernAuthentication':{'type':Sequelize[_0xc05b('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xac0a=['STRING','BOOLEAN'];(function(_0x2b6e53,_0x4ed0d2){var _0x35bab1=function(_0x138843){while(--_0x138843){_0x2b6e53['push'](_0x2b6e53['shift']());}};_0x35bab1(++_0x4ed0d2);}(_0xac0a,0x11e));var _0xaac0=function(_0x16c598,_0x3c3b9e){_0x16c598=_0x16c598-0x0;var _0x111b80=_0xac0a[_0x16c598];return _0x111b80;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xaac0('0x0')]},'username':{'type':Sequelize[_0xaac0('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xaac0('0x0')]},'tenantId':{'type':Sequelize[_0xaac0('0x0')]},'clientId':{'type':Sequelize[_0xaac0('0x0')]},'clientSecret':{'type':Sequelize[_0xaac0('0x0')]},'serverUrl':{'type':Sequelize[_0xaac0('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xaac0('0x0')]},'modernAuthentication':{'type':Sequelize[_0xaac0('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index c76db52..287f5dc 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 _0x711f=['FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','../../components/parsers/qs','../../config/logger','../../components/integrations/configuration','json','offset','undefined','count','limit','status','set','Content-Range','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','create','catch','update','body','find','params','getConfigurations','rawAttributes','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','slice','substring','lastIndexOf','getFields','incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidyominame','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','data5','data7','modernAuthentication','access_token','CloudProvider','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','GET','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true'];(function(_0x455546,_0x1e61fc){var _0x133626=function(_0x3ed059){while(--_0x3ed059){_0x455546['push'](_0x455546['shift']());}};_0x133626(++_0x1e61fc);}(_0x711f,0x17a));var _0xf711=function(_0xf0ab7c,_0x23bbc2){_0xf0ab7c=_0xf0ab7c-0x0;var _0x198144=_0x711f[_0xf0ab7c];return _0x198144;};'use strict';var rp=require('request-promise');var util=require('util');var _=require('lodash');var qs=require(_0xf711('0x0'));var logger=require(_0xf711('0x1'))('api');var db=require('../../mysqldb')['db'];var integrations=require(_0xf711('0x2'));function respondWithResult(_0x1dec79,_0x22fc40){_0x22fc40=_0x22fc40||0xc8;return function(_0x3c57c1){if(_0x3c57c1){return _0x1dec79['status'](_0x22fc40)[_0xf711('0x3')](_0x3c57c1);}};}function respondWithFilteredResult(_0x548c6f,_0x1e1283){return function(_0x5e9487){if(_0x5e9487){var _0x309be6=typeof _0x1e1283[_0xf711('0x4')]===_0xf711('0x5')&&typeof _0x1e1283['limit']===_0xf711('0x5');var _0x514cc4=_0x5e9487[_0xf711('0x6')];var _0x1ac0ef=_0x309be6?0x0:_0x1e1283['offset'];var _0x2fdd9c=_0x309be6?_0x5e9487[_0xf711('0x6')]:_0x1e1283['offset']+_0x1e1283[_0xf711('0x7')];var _0x225a1e;if(_0x2fdd9c>=_0x514cc4){_0x2fdd9c=_0x514cc4;_0x225a1e=0xc8;}else{_0x225a1e=0xce;}_0x548c6f[_0xf711('0x8')](_0x225a1e);return _0x548c6f[_0xf711('0x9')](_0xf711('0xa'),_0x1ac0ef+'-'+_0x2fdd9c+'/'+_0x514cc4)[_0xf711('0x3')](_0x5e9487);}return null;};}function saveUpdates(_0x1cd099){return function(_0xb642b2){if(_0xb642b2){return _0xb642b2['update'](_0x1cd099)[_0xf711('0xb')](function(_0x2b9d6f){return _0x2b9d6f;});}return null;};}function removeEntity(_0x47b8e1){return function(_0x458614){if(_0x458614){return _0x458614[_0xf711('0xc')]()[_0xf711('0xb')](function(){_0x47b8e1['status'](0xcc)[_0xf711('0xd')]();});}};}function handleEntityNotFound(_0x5085f4){return function(_0x4ccc3d){if(!_0x4ccc3d){_0x5085f4[_0xf711('0xe')](0x194);}return _0x4ccc3d;};}function handleError(_0x2162fe,_0x14ca74){_0x14ca74=_0x14ca74||0x1f4;return function(_0x35e18c){logger[_0xf711('0xf')](_0x35e18c[_0xf711('0x10')]);if(_0x35e18c[_0xf711('0x11')]){delete _0x35e18c['name'];}_0x2162fe['status'](_0x14ca74)[_0xf711('0x12')](_0x35e18c);};}exports[_0xf711('0x13')]=function(_0x177f13,_0x3ce911){var _0x345daa={},_0x5d18e3={},_0x68025a={'count':0x0,'rows':[]};var _0x425424=_[_0xf711('0x14')](db[_0xf711('0x15')]['rawAttributes'],function(_0x4a0554){return{'name':_0x4a0554[_0xf711('0x16')],'type':_0x4a0554[_0xf711('0x17')][_0xf711('0x18')]};});_0x5d18e3[_0xf711('0x19')]=_['map'](_0x425424,_0xf711('0x11'));_0x5d18e3[_0xf711('0x1a')]=_[_0xf711('0x1b')](_0x177f13[_0xf711('0x1a')]);_0x5d18e3[_0xf711('0x1c')]=_[_0xf711('0x1d')](_0x5d18e3[_0xf711('0x19')],_0x5d18e3[_0xf711('0x1a')]);_0x345daa[_0xf711('0x1e')]=_[_0xf711('0x1d')](_0x5d18e3[_0xf711('0x19')],qs[_0xf711('0x1f')](_0x177f13['query']['fields']));_0x345daa[_0xf711('0x1e')]=_0x345daa[_0xf711('0x1e')]['length']?_0x345daa[_0xf711('0x1e')]:_0x5d18e3[_0xf711('0x19')];if(!_0x177f13['query'][_0xf711('0x20')](_0xf711('0x21'))){_0x345daa[_0xf711('0x7')]=qs[_0xf711('0x7')](_0x177f13['query'][_0xf711('0x7')]);_0x345daa[_0xf711('0x4')]=qs[_0xf711('0x4')](_0x177f13[_0xf711('0x1a')][_0xf711('0x4')]);}_0x345daa[_0xf711('0x22')]=qs[_0xf711('0x23')](_0x177f13[_0xf711('0x1a')][_0xf711('0x23')]);_0x345daa['where']=qs[_0xf711('0x1c')](_[_0xf711('0x24')](_0x177f13[_0xf711('0x1a')],_0x5d18e3['filters']),_0x425424);if(_0x177f13[_0xf711('0x1a')][_0xf711('0x25')]){_0x345daa[_0xf711('0x26')]=_[_0xf711('0x27')](_0x345daa['where'],{'$or':_['map'](_0x425424,function(_0x1df6fb){if(_0x1df6fb['type']!==_0xf711('0x28')){var _0x4816e0={};_0x4816e0[_0x1df6fb['name']]={'$like':'%'+_0x177f13[_0xf711('0x1a')][_0xf711('0x25')]+'%'};return _0x4816e0;}})});}_0x345daa=_[_0xf711('0x27')]({},_0x345daa,_0x177f13[_0xf711('0x29')]);var _0x1d4e15={'where':_0x345daa[_0xf711('0x26')]};return db[_0xf711('0x15')]['count'](_0x1d4e15)[_0xf711('0xb')](function(_0x382006){_0x68025a[_0xf711('0x6')]=_0x382006;if(_0x177f13['query'][_0xf711('0x2a')]){_0x345daa[_0xf711('0x2b')]=[{'all':!![]}];}return db[_0xf711('0x15')][_0xf711('0x2c')](_0x345daa);})['then'](function(_0x25f528){_0x68025a[_0xf711('0x2d')]=_0x25f528;return _0x68025a;})[_0xf711('0xb')](respondWithFilteredResult(_0x3ce911,_0x345daa))['catch'](handleError(_0x3ce911,null));};exports[_0xf711('0x2e')]=function(_0x23183d,_0x4d0d0c){var _0x2d0e85={'raw':![],'where':{'id':_0x23183d['params']['id']}},_0x1cd895={};_0x1cd895['model']=_['keys'](db['Dynamics365Account']['rawAttributes']);_0x1cd895[_0xf711('0x1a')]=_[_0xf711('0x1b')](_0x23183d[_0xf711('0x1a')]);_0x1cd895[_0xf711('0x1c')]=_[_0xf711('0x1d')](_0x1cd895[_0xf711('0x19')],_0x1cd895['query']);_0x2d0e85[_0xf711('0x1e')]=_[_0xf711('0x1d')](_0x1cd895[_0xf711('0x19')],qs[_0xf711('0x1f')](_0x23183d[_0xf711('0x1a')][_0xf711('0x1f')]));_0x2d0e85[_0xf711('0x1e')]=_0x2d0e85['attributes'][_0xf711('0x2f')]?_0x2d0e85[_0xf711('0x1e')]:_0x1cd895[_0xf711('0x19')];if(_0x23183d[_0xf711('0x1a')]['includeAll']){_0x2d0e85[_0xf711('0x2b')]=[{'all':!![]}];}_0x2d0e85=_[_0xf711('0x27')]({},_0x2d0e85,_0x23183d[_0xf711('0x29')]);return db[_0xf711('0x15')]['find'](_0x2d0e85)[_0xf711('0xb')](handleEntityNotFound(_0x4d0d0c,null))['then'](respondWithResult(_0x4d0d0c,null))['catch'](handleError(_0x4d0d0c,null));};exports[_0xf711('0x30')]=function(_0x1dce9b,_0x56d80d){return db[_0xf711('0x15')][_0xf711('0x30')](_0x1dce9b['body'],{})[_0xf711('0xb')](respondWithResult(_0x56d80d,0xc9))[_0xf711('0x31')](handleError(_0x56d80d,null));};exports[_0xf711('0x32')]=function(_0x355273,_0x167878){if(_0x355273[_0xf711('0x33')]['id']){delete _0x355273['body']['id'];}return db[_0xf711('0x15')][_0xf711('0x34')]({'where':{'id':_0x355273[_0xf711('0x35')]['id']}})[_0xf711('0xb')](handleEntityNotFound(_0x167878,null))['then'](saveUpdates(_0x355273[_0xf711('0x33')],null))[_0xf711('0xb')](respondWithResult(_0x167878,null))[_0xf711('0x31')](handleError(_0x167878,null));};exports[_0xf711('0xc')]=function(_0x187640,_0x30f225){return db[_0xf711('0x15')][_0xf711('0x34')]({'where':{'id':_0x187640[_0xf711('0x35')]['id']}})['then'](handleEntityNotFound(_0x30f225,null))[_0xf711('0xb')](removeEntity(_0x30f225,null))['catch'](handleError(_0x30f225,null));};exports[_0xf711('0x36')]=function(_0x5a49f0,_0x3a15ba){var _0x4f1a4b={};var _0x2e5efb={};var _0x307ae7;var _0x567f05;return db['Dynamics365Account']['findOne']({'where':{'id':_0x5a49f0[_0xf711('0x35')]['id']}})[_0xf711('0xb')](handleEntityNotFound(_0x3a15ba,null))[_0xf711('0xb')](function(_0x36dbef){if(_0x36dbef){_0x307ae7=_0x36dbef;_0x2e5efb[_0xf711('0x19')]=_[_0xf711('0x1b')](db['Dynamics365Configuration'][_0xf711('0x37')]);_0x2e5efb['query']=_[_0xf711('0x1b')](_0x5a49f0['query']);_0x2e5efb[_0xf711('0x1c')]=_[_0xf711('0x1d')](_0x2e5efb[_0xf711('0x19')],_0x2e5efb['query']);_0x4f1a4b['attributes']=_[_0xf711('0x1d')](_0x2e5efb[_0xf711('0x19')],qs[_0xf711('0x1f')](_0x5a49f0[_0xf711('0x1a')][_0xf711('0x1f')]));_0x4f1a4b['attributes']=_0x4f1a4b['attributes'][_0xf711('0x2f')]?_0x4f1a4b[_0xf711('0x1e')]:_0x2e5efb['model'];_0x4f1a4b['order']=qs[_0xf711('0x23')](_0x5a49f0[_0xf711('0x1a')][_0xf711('0x23')]);_0x4f1a4b[_0xf711('0x26')]=qs[_0xf711('0x1c')](_[_0xf711('0x24')](_0x5a49f0[_0xf711('0x1a')],_0x2e5efb['filters']));if(_0x5a49f0[_0xf711('0x1a')][_0xf711('0x25')]){_0x4f1a4b['where']=_['merge'](_0x4f1a4b[_0xf711('0x26')],{'$or':_[_0xf711('0x14')](_0x4f1a4b['attributes'],function(_0x5e49d7){var _0xb4b837={};_0xb4b837[_0x5e49d7]={'$like':'%'+_0x5a49f0[_0xf711('0x1a')][_0xf711('0x25')]+'%'};return _0xb4b837;})});}_0x4f1a4b=_[_0xf711('0x27')]({},_0x4f1a4b,_0x5a49f0[_0xf711('0x29')]);return _0x307ae7[_0xf711('0x36')](_0x4f1a4b);}})[_0xf711('0xb')](function(_0xf93386){if(_0xf93386){_0x567f05=_0xf93386[_0xf711('0x2f')];if(!_0x5a49f0[_0xf711('0x1a')]['hasOwnProperty'](_0xf711('0x21'))){_0x4f1a4b[_0xf711('0x7')]=qs[_0xf711('0x7')](_0x5a49f0['query']['limit']);_0x4f1a4b[_0xf711('0x4')]=qs[_0xf711('0x4')](_0x5a49f0[_0xf711('0x1a')]['offset']);}return _0x307ae7[_0xf711('0x36')](_0x4f1a4b);}})['then'](function(_0x361500){if(_0x361500){return _0x361500?{'count':_0x567f05,'rows':_0x361500}:null;}})[_0xf711('0xb')](respondWithResult(_0x3a15ba,null))[_0xf711('0x31')](handleError(_0x3a15ba,null));};exports[_0xf711('0x38')]=function(_0x51c733,_0x3263df){if(_0x51c733[_0xf711('0x33')]['id']){delete _0x51c733[_0xf711('0x33')]['id'];}return db[_0xf711('0x15')][_0xf711('0x39')]({'where':{'id':_0x51c733['params']['id']}})[_0xf711('0xb')](handleEntityNotFound(_0x3263df,null))[_0xf711('0xb')](function(_0xa599e5){if(_0xa599e5){_0x51c733[_0xf711('0x33')]['AccountId']=_0xa599e5['id'];_0x51c733[_0xf711('0x33')][_0xf711('0x3a')]=integrations[_0xf711('0x3b')](_0x51c733[_0xf711('0x33')]['channel'],_0x51c733[_0xf711('0x33')][_0xf711('0x17')]);_0x51c733[_0xf711('0x33')][_0xf711('0x3c')]=integrations[_0xf711('0x3d')](_0x51c733[_0xf711('0x33')][_0xf711('0x3e')],_0x51c733[_0xf711('0x33')][_0xf711('0x17')]);return db['Dynamics365Configuration']['create'](_0x51c733[_0xf711('0x33')],{'include':[{'model':db[_0xf711('0x3f')],'as':_0xf711('0x3a')},{'model':db[_0xf711('0x3f')],'as':'Descriptions'}]});}return null;})[_0xf711('0xb')](respondWithResult(_0x3263df,null))[_0xf711('0x31')](handleError(_0x3263df,null));};function sanitizeRemoteUri(_0x1b027d){var _0x1ed3e4=_0x1b027d[_0xf711('0x40')](-0x1);if(_0x1ed3e4==='/')return _0x1b027d[_0xf711('0x41')](0x0,_0x1b027d[_0xf711('0x42')](_0x1ed3e4));return _0x1b027d;}function getWebApiUrl(_0x51f3df){return util['format']('%s/api/data/v9.0/',_0x51f3df);}exports[_0xf711('0x43')]=function(_0x1ba44a,_0x57c9bb){var _0x5ef7a9=_0x1ba44a[_0xf711('0x1a')]['ticketType'];var _0x5ac057=_0x5ef7a9===_0xf711('0x44')?'Incident':_0xf711('0x45');var _0x1a39fc='';var _0x2d7b25='';var _0x53f630='';var _0x1055a1='';var _0x7f07ef='';var _0x825d27='';var _0x23f4aa='';var _0x42db33='';var _0x394c1e=[_0xf711('0x46'),'description',_0xf711('0x47'),_0xf711('0x48'),_0xf711('0x49'),_0xf711('0x4a'),_0xf711('0x4b'),_0xf711('0x4c'),_0xf711('0x4d'),_0xf711('0x4e')];var _0x2d2f8c=[_0xf711('0x4f'),_0xf711('0x50'),_0xf711('0x51'),'billedserviceunits','contactidname',_0xf711('0x52'),'contractdetailidname',_0xf711('0x53'),_0xf711('0x54'),'createdbyexternalpartyyominame',_0xf711('0x55'),_0xf711('0x56'),'createdon',_0xf711('0x57'),_0xf711('0x58'),'customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname',_0xf711('0x59'),'entityimage_url',_0xf711('0x5a'),_0xf711('0x5b'),_0xf711('0x5c'),_0xf711('0x5d'),'importsequencenumber',_0xf711('0x5e'),_0xf711('0x5f'),'lastonholdtime',_0xf711('0x60'),_0xf711('0x61'),'modifiedbyexternalpartyyominame',_0xf711('0x62'),_0xf711('0x63'),_0xf711('0x64'),_0xf711('0x65'),_0xf711('0x66'),_0xf711('0x67'),_0xf711('0x68'),_0xf711('0x69'),_0xf711('0x6a'),'overriddencreatedon',_0xf711('0x6b'),'owneridtype',_0xf711('0x6c'),_0xf711('0x6d'),_0xf711('0x6e'),'primarycontactidyominame',_0xf711('0x6f'),_0xf711('0x70'),_0xf711('0x71'),_0xf711('0x72'),_0xf711('0x73'),_0xf711('0x74'),_0xf711('0x75'),_0xf711('0x76'),'sentimentvalue',_0xf711('0x77'),_0xf711('0x78'),'socialprofileidname',_0xf711('0x79'),_0xf711('0x7a'),'subjectidname',_0xf711('0x7b'),_0xf711('0x7c'),'transactioncurrencyidname',_0xf711('0x7d'),_0xf711('0x7e'),_0xf711('0x7f')];var _0x45212e=_0x394c1e[_0xf711('0x80')](_0x2d2f8c);return db[_0xf711('0x15')][_0xf711('0x39')]({'where':{'id':_0x1ba44a[_0xf711('0x35')]['id']},'attributes':['id',_0xf711('0x81'),_0xf711('0x82'),'remoteUri',_0xf711('0x83'),_0xf711('0x84'),_0xf711('0x85'),'modernAuthentication'],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','attributes':['id',_0xf711('0x86'),_0xf711('0x87')]}]})[_0xf711('0xb')](handleEntityNotFound(_0x57c9bb,null))[_0xf711('0xb')](function(_0x5995a5){if(_0x5995a5){if(_0x5995a5[_0xf711('0x88')]){_0x5995a5[_0xf711('0x89')]=_0x5995a5[_0xf711('0x8a')][_0xf711('0x86')];_0x42db33=sanitizeRemoteUri(_0x5995a5['CloudProvider'][_0xf711('0x87')]);_0x23f4aa=getWebApiUrl(_0x42db33);return _0x5995a5;}_0x42db33=sanitizeRemoteUri(_0x5995a5[_0xf711('0x8b')]);_0x23f4aa=getWebApiUrl(_0x42db33);var _0x4c5447={'method':_0xf711('0x8c'),'uri':_0xf711('0x8d')+_0x5995a5[_0xf711('0x83')]+_0xf711('0x8e'),'form':{'client_id':_0x5995a5[_0xf711('0x84')],'resource':_0x42db33,'username':_0x5995a5[_0xf711('0x81')],'password':_0x5995a5[_0xf711('0x82')],'grant_type':_0xf711('0x82'),'client_secret':_0x5995a5['clientSecret']},'json':!![]};return rp(_0x4c5447);}})[_0xf711('0xb')](function(_0x220570){_0x825d27=_0x220570[_0xf711('0x89')];var _0x18a4ce={'method':_0xf711('0x8f'),'uri':encodeURI(_0x23f4aa+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5ac057+'\x27'),'headers':{'Authorization':_0xf711('0x90')+_0x825d27,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x18a4ce);})[_0xf711('0xb')](function(_0x25a735){var _0x239de1=_0x25a735[_0xf711('0x91')][0x0];var _0x306542=_0x239de1[_0xf711('0x92')];var _0x2f51e2={'method':_0xf711('0x8f'),'uri':_0x23f4aa+_0xf711('0x93')+_0x306542+_0xf711('0x94'),'headers':{'Authorization':_0xf711('0x90')+_0x825d27,'If-None-Match':null,'OData-Version':_0xf711('0x95')},'json':!![]};return rp(_0x2f51e2);})[_0xf711('0xb')](function(_0x4a86fd){_0x1a39fc=_0x4a86fd;_0x2d7b25=_0x1a39fc[_0xf711('0x96')];_0x2d7b25=_[_0xf711('0x97')](_0x2d7b25,function(_0x446ca7){return!_0x45212e[_0xf711('0x98')](_0x446ca7[_0xf711('0x99')]);});var _0x2d139c=[];var _0x308f35=[];_0x2d7b25[_0xf711('0x9a')](function(_0x17d93f){if(_0x17d93f[_0xf711('0x9b')]){var _0xf9cb0d=_0x17d93f['@odata.type'][_0xf711('0x41')](_0x17d93f[_0xf711('0x9b')][_0xf711('0x42')]('.')+0x1);if(_0xf9cb0d==='PicklistAttributeMetadata'){_0x2d139c[_0xf711('0x9c')](getSelectList(_0x23f4aa,_0x5ef7a9,_0x308f35,_0x1a39fc[_0xf711('0x92')],_0x17d93f[_0xf711('0x92')],_0x825d27));}}});return Promise[_0xf711('0x9d')](_0x2d139c);})['then'](function(_0x2c1b77){_0x53f630=_0x2c1b77[0x0];var _0x44c6ed=[];var _0x4ff84a=[];_0x2d7b25[_0xf711('0x9a')](function(_0x3474b5){if(!_[_0xf711('0x9e')](_0x3474b5[_0xf711('0x9b')])){var _0x2bb962=_0x3474b5[_0xf711('0x9b')][_0xf711('0x41')](_0x3474b5[_0xf711('0x9b')]['lastIndexOf']('.')+0x1);if(_0x2bb962===_0xf711('0x9f')){_0x44c6ed[_0xf711('0x9c')](getBooleanList(_0x23f4aa,_0x5ef7a9,_0x4ff84a,_0x1a39fc['MetadataId'],_0x3474b5[_0xf711('0x92')],_0x825d27));}}});return Promise[_0xf711('0x9d')](_0x44c6ed);})[_0xf711('0xb')](function(_0x51fbc6){_0x1055a1=_0x51fbc6[0x0];var _0x31a17c=[];var _0x1f0b67=[];_0x2d7b25['forEach'](function(_0x3af162){if(_0x3af162[_0xf711('0x9b')]){var _0x136a59=_0x3af162[_0xf711('0x9b')][_0xf711('0x41')](_0x3af162['@odata.type'][_0xf711('0x42')]('.')+0x1);if(_0x136a59===_0xf711('0xa0')||_0x136a59===_0xf711('0xa1')||_0x136a59===_0xf711('0xa2')||_0x136a59===_0xf711('0xa3')||_0x136a59===_0xf711('0xa4')||_0x136a59===_0xf711('0xa5')||_0x136a59===_0xf711('0xa6')||_0x136a59===_0xf711('0xa7')||_0x136a59===_0xf711('0xa8')||_0x136a59==='DecimalAttributeMetadata'){_0x31a17c[_0xf711('0x9c')](getInputList(_0x23f4aa,_0x5ef7a9,_0x136a59,_0x1f0b67,_0x1a39fc['MetadataId'],_0x3af162[_0xf711('0x92')],_0x825d27));}}});return Promise[_0xf711('0x9d')](_0x31a17c);})[_0xf711('0xb')](function(_0x547a4e){_0x7f07ef=_0x547a4e[0x0];var _0x344dd1=_0x53f630[_0xf711('0x80')](_0x1055a1)[_0xf711('0x80')](_0x7f07ef);var _0x3813d1={'count':_0x344dd1[_0xf711('0x2f')],'rows':_0x344dd1};return _0x3813d1;})[_0xf711('0xb')](respondWithResult(_0x57c9bb,null))[_0xf711('0x31')](function(_0x4f3659){var _0xd59f14=_0x1ba44a[_0xf711('0x1a')][_0xf711('0xa9')]?0x1f4:_0x4f3659[_0xf711('0xaa')]||0x1f4;logger[_0xf711('0xf')](_0x4f3659['stack']);delete _0x4f3659[_0xf711('0x11')];if(_0xd59f14===0x191){_0xd59f14=0x190;}_0x57c9bb[_0xf711('0x8')](_0xd59f14)[_0xf711('0x12')](_0x1ba44a[_0xf711('0x1a')]['test']?{'message':_0xf711('0xab'),'statusCode':_0x4f3659['statusCode']}:_0x4f3659);});};function getSelectList(_0x41c0a4,_0x39b7b7,_0x2e47f9,_0x14d2f7,_0x43ff64,_0x376c89){var _0x17583f={'method':_0xf711('0x8f'),'uri':_0x41c0a4+_0xf711('0x93')+_0x14d2f7+')/Attributes('+_0x43ff64+_0xf711('0xac')+_0xf711('0xad'),'headers':{'Authorization':_0xf711('0x90')+_0x376c89,'If-None-Match':null,'OData-Version':_0xf711('0x95')},'json':!![]};return rp(_0x17583f)[_0xf711('0xb')](function(_0x9c6004){var _0x3453d9=[];var _0x2064fa=_0x9c6004[_0xf711('0xae')][_0xf711('0xaf')];_0x2064fa[_0xf711('0x9a')](function(_0x177308){_0x3453d9[_0xf711('0x9c')]({'name':_0x177308['Label'][_0xf711('0xb0')][_0xf711('0xb1')],'value':String(_0x177308[_0xf711('0xb2')])});});var _0x1af072={'id':_0x39b7b7+'_'+_0x9c6004[_0xf711('0x99')],'name':_0x9c6004[_0xf711('0xb3')][_0xf711('0xb0')][_0xf711('0xb1')],'custom':![],'options':_0x3453d9};_0x2e47f9['push'](_0x1af072);return _0x2e47f9;});}function getBooleanList(_0x2cec68,_0x4fb6a1,_0x41930c,_0x241678,_0x56af3c,_0x51ec71){var _0x48f9e4={'method':_0xf711('0x8f'),'uri':_0x2cec68+'EntityDefinitions('+_0x241678+_0xf711('0xb4')+_0x56af3c+_0xf711('0xb5'),'headers':{'Authorization':_0xf711('0x90')+_0x51ec71,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x48f9e4)[_0xf711('0xb')](function(_0x535b68){var _0x138f98=[];_0x138f98[_0xf711('0x9c')]({'name':_0x535b68[_0xf711('0xae')]['TrueOption']['Label']['UserLocalizedLabel'][_0xf711('0xb1')],'value':_0xf711('0xb6')},{'name':_0x535b68[_0xf711('0xae')][_0xf711('0xb7')][_0xf711('0xb1')][_0xf711('0xb0')][_0xf711('0xb1')],'value':_0xf711('0xb8')});var _0x45dda0={'id':_0x4fb6a1+'_'+_0x535b68[_0xf711('0x99')],'name':_0x535b68[_0xf711('0xb3')][_0xf711('0xb0')]['Label'],'custom':![],'options':_0x138f98};_0x41930c[_0xf711('0x9c')](_0x45dda0);return _0x41930c;});}function getInputList(_0x24b778,_0x11e8c0,_0x280ae6,_0xa2a0ac,_0x45b589,_0x106357,_0x5cbc99){var _0x19a52e={'method':_0xf711('0x8f'),'uri':_0x24b778+_0xf711('0x93')+_0x45b589+_0xf711('0xb4')+_0x106357+_0xf711('0xb9')+_0x280ae6+_0xf711('0xba'),'headers':{'Authorization':_0xf711('0x90')+_0x5cbc99,'If-None-Match':null,'OData-Version':_0xf711('0x95')},'json':!![]};return rp(_0x19a52e)['then'](function(_0x396779){var _0x4a4177={'id':_0x11e8c0+'_'+_0x396779[_0xf711('0x99')],'name':_0x396779[_0xf711('0xb3')][_0xf711('0xb0')]?_0x396779['DisplayName'][_0xf711('0xb0')][_0xf711('0xb1')]:_0x396779[_0xf711('0x99')],'custom':![],'options':[]};_0xa2a0ac['push'](_0x4a4177);return _0xa2a0ac;});} \ No newline at end of file +var _0x3fe7=['contactidyominame','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','productidname','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','LogicalName','@odata.type','push','all','isNil','substring','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','error','send','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','api','../../components/integrations/configuration','status','offset','limit','undefined','count','set','json','then','destroy','end','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','name','filter','options','includeAll','findAll','catch','show','params','include','find','create','body','update','getConfigurations','Dynamics365Configuration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','lastIndexOf','format','incident','PhoneCall','description','customerid','ownerid','caseorigincode','subject','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname'];(function(_0x592cbc,_0x5ec030){var _0x39b8d9=function(_0x39055c){while(--_0x39055c){_0x592cbc['push'](_0x592cbc['shift']());}};_0x39b8d9(++_0x5ec030);}(_0x3fe7,0x125));var _0x73fe=function(_0x4105a8,_0x198324){_0x4105a8=_0x4105a8-0x0;var _0x553f0c=_0x3fe7[_0x4105a8];return _0x553f0c;};'use strict';var rp=require(_0x73fe('0x0'));var util=require(_0x73fe('0x1'));var _=require(_0x73fe('0x2'));var qs=require(_0x73fe('0x3'));var logger=require('../../config/logger')(_0x73fe('0x4'));var db=require('../../mysqldb')['db'];var integrations=require(_0x73fe('0x5'));function respondWithResult(_0x4b7460,_0x509ad5){_0x509ad5=_0x509ad5||0xc8;return function(_0x2a89b0){if(_0x2a89b0){return _0x4b7460[_0x73fe('0x6')](_0x509ad5)['json'](_0x2a89b0);}};}function respondWithFilteredResult(_0x44df50,_0x1bf8c8){return function(_0x590a8c){if(_0x590a8c){var _0x1cbbb9=typeof _0x1bf8c8[_0x73fe('0x7')]==='undefined'&&typeof _0x1bf8c8[_0x73fe('0x8')]===_0x73fe('0x9');var _0x1373fc=_0x590a8c[_0x73fe('0xa')];var _0x25825a=_0x1cbbb9?0x0:_0x1bf8c8[_0x73fe('0x7')];var _0x3c2dcf=_0x1cbbb9?_0x590a8c[_0x73fe('0xa')]:_0x1bf8c8['offset']+_0x1bf8c8[_0x73fe('0x8')];var _0x2a0695;if(_0x3c2dcf>=_0x1373fc){_0x3c2dcf=_0x1373fc;_0x2a0695=0xc8;}else{_0x2a0695=0xce;}_0x44df50[_0x73fe('0x6')](_0x2a0695);return _0x44df50[_0x73fe('0xb')]('Content-Range',_0x25825a+'-'+_0x3c2dcf+'/'+_0x1373fc)[_0x73fe('0xc')](_0x590a8c);}return null;};}function saveUpdates(_0x2341d7){return function(_0x14be38){if(_0x14be38){return _0x14be38['update'](_0x2341d7)[_0x73fe('0xd')](function(_0x5e9bf2){return _0x5e9bf2;});}return null;};}function removeEntity(_0x58bbc7){return function(_0x466d96){if(_0x466d96){return _0x466d96[_0x73fe('0xe')]()[_0x73fe('0xd')](function(){_0x58bbc7[_0x73fe('0x6')](0xcc)[_0x73fe('0xf')]();});}};}function handleEntityNotFound(_0x53f0c7){return function(_0x1e24b1){if(!_0x1e24b1){_0x53f0c7['sendStatus'](0x194);}return _0x1e24b1;};}function handleError(_0x3a47e1,_0x2525f4){_0x2525f4=_0x2525f4||0x1f4;return function(_0x29ea72){logger['error'](_0x29ea72['stack']);if(_0x29ea72['name']){delete _0x29ea72['name'];}_0x3a47e1[_0x73fe('0x6')](_0x2525f4)['send'](_0x29ea72);};}exports[_0x73fe('0x10')]=function(_0x23e52d,_0x52593f){var _0xa3ab96={},_0xfb7d34={},_0x235b79={'count':0x0,'rows':[]};var _0xc78b5d=_[_0x73fe('0x11')](db[_0x73fe('0x12')][_0x73fe('0x13')],function(_0x44b6d5){return{'name':_0x44b6d5[_0x73fe('0x14')],'type':_0x44b6d5[_0x73fe('0x15')][_0x73fe('0x16')]};});_0xfb7d34[_0x73fe('0x17')]=_['map'](_0xc78b5d,'name');_0xfb7d34[_0x73fe('0x18')]=_[_0x73fe('0x19')](_0x23e52d[_0x73fe('0x18')]);_0xfb7d34[_0x73fe('0x1a')]=_['intersection'](_0xfb7d34[_0x73fe('0x17')],_0xfb7d34[_0x73fe('0x18')]);_0xa3ab96[_0x73fe('0x1b')]=_[_0x73fe('0x1c')](_0xfb7d34['model'],qs[_0x73fe('0x1d')](_0x23e52d[_0x73fe('0x18')][_0x73fe('0x1d')]));_0xa3ab96['attributes']=_0xa3ab96['attributes'][_0x73fe('0x1e')]?_0xa3ab96[_0x73fe('0x1b')]:_0xfb7d34[_0x73fe('0x17')];if(!_0x23e52d[_0x73fe('0x18')][_0x73fe('0x1f')](_0x73fe('0x20'))){_0xa3ab96[_0x73fe('0x8')]=qs['limit'](_0x23e52d[_0x73fe('0x18')][_0x73fe('0x8')]);_0xa3ab96[_0x73fe('0x7')]=qs['offset'](_0x23e52d['query'][_0x73fe('0x7')]);}_0xa3ab96['order']=qs['sort'](_0x23e52d[_0x73fe('0x18')][_0x73fe('0x21')]);_0xa3ab96[_0x73fe('0x22')]=qs[_0x73fe('0x1a')](_[_0x73fe('0x23')](_0x23e52d[_0x73fe('0x18')],_0xfb7d34['filters']),_0xc78b5d);if(_0x23e52d[_0x73fe('0x18')]['filter']){_0xa3ab96[_0x73fe('0x22')]=_[_0x73fe('0x24')](_0xa3ab96[_0x73fe('0x22')],{'$or':_['map'](_0xc78b5d,function(_0x47b5d0){if(_0x47b5d0[_0x73fe('0x15')]!==_0x73fe('0x25')){var _0x39102e={};_0x39102e[_0x47b5d0[_0x73fe('0x26')]]={'$like':'%'+_0x23e52d[_0x73fe('0x18')][_0x73fe('0x27')]+'%'};return _0x39102e;}})});}_0xa3ab96=_['merge']({},_0xa3ab96,_0x23e52d[_0x73fe('0x28')]);var _0x238601={'where':_0xa3ab96[_0x73fe('0x22')]};return db['Dynamics365Account'][_0x73fe('0xa')](_0x238601)[_0x73fe('0xd')](function(_0x58872a){_0x235b79[_0x73fe('0xa')]=_0x58872a;if(_0x23e52d[_0x73fe('0x18')][_0x73fe('0x29')]){_0xa3ab96['include']=[{'all':!![]}];}return db[_0x73fe('0x12')][_0x73fe('0x2a')](_0xa3ab96);})[_0x73fe('0xd')](function(_0xa6b6df){_0x235b79['rows']=_0xa6b6df;return _0x235b79;})[_0x73fe('0xd')](respondWithFilteredResult(_0x52593f,_0xa3ab96))[_0x73fe('0x2b')](handleError(_0x52593f,null));};exports[_0x73fe('0x2c')]=function(_0x4eba71,_0x1aab3c){var _0x26f768={'raw':![],'where':{'id':_0x4eba71[_0x73fe('0x2d')]['id']}},_0x1dc783={};_0x1dc783[_0x73fe('0x17')]=_[_0x73fe('0x19')](db['Dynamics365Account'][_0x73fe('0x13')]);_0x1dc783[_0x73fe('0x18')]=_[_0x73fe('0x19')](_0x4eba71[_0x73fe('0x18')]);_0x1dc783['filters']=_['intersection'](_0x1dc783['model'],_0x1dc783[_0x73fe('0x18')]);_0x26f768[_0x73fe('0x1b')]=_[_0x73fe('0x1c')](_0x1dc783[_0x73fe('0x17')],qs[_0x73fe('0x1d')](_0x4eba71[_0x73fe('0x18')][_0x73fe('0x1d')]));_0x26f768[_0x73fe('0x1b')]=_0x26f768[_0x73fe('0x1b')][_0x73fe('0x1e')]?_0x26f768[_0x73fe('0x1b')]:_0x1dc783[_0x73fe('0x17')];if(_0x4eba71[_0x73fe('0x18')][_0x73fe('0x29')]){_0x26f768[_0x73fe('0x2e')]=[{'all':!![]}];}_0x26f768=_['merge']({},_0x26f768,_0x4eba71[_0x73fe('0x28')]);return db[_0x73fe('0x12')][_0x73fe('0x2f')](_0x26f768)[_0x73fe('0xd')](handleEntityNotFound(_0x1aab3c,null))[_0x73fe('0xd')](respondWithResult(_0x1aab3c,null))[_0x73fe('0x2b')](handleError(_0x1aab3c,null));};exports[_0x73fe('0x30')]=function(_0x5c2ff9,_0x49a442){return db[_0x73fe('0x12')][_0x73fe('0x30')](_0x5c2ff9[_0x73fe('0x31')],{})[_0x73fe('0xd')](respondWithResult(_0x49a442,0xc9))['catch'](handleError(_0x49a442,null));};exports[_0x73fe('0x32')]=function(_0x167b23,_0x51ca5e){if(_0x167b23[_0x73fe('0x31')]['id']){delete _0x167b23['body']['id'];}return db[_0x73fe('0x12')]['find']({'where':{'id':_0x167b23['params']['id']}})['then'](handleEntityNotFound(_0x51ca5e,null))[_0x73fe('0xd')](saveUpdates(_0x167b23[_0x73fe('0x31')],null))[_0x73fe('0xd')](respondWithResult(_0x51ca5e,null))[_0x73fe('0x2b')](handleError(_0x51ca5e,null));};exports[_0x73fe('0xe')]=function(_0x20e8d2,_0x151a61){return db[_0x73fe('0x12')][_0x73fe('0x2f')]({'where':{'id':_0x20e8d2[_0x73fe('0x2d')]['id']}})[_0x73fe('0xd')](handleEntityNotFound(_0x151a61,null))[_0x73fe('0xd')](removeEntity(_0x151a61,null))[_0x73fe('0x2b')](handleError(_0x151a61,null));};exports[_0x73fe('0x33')]=function(_0x4fa03b,_0x3c662f){var _0x1ddd79={};var _0x1ed51f={};var _0x5e1c6c;var _0xe78d32;return db['Dynamics365Account']['findOne']({'where':{'id':_0x4fa03b[_0x73fe('0x2d')]['id']}})[_0x73fe('0xd')](handleEntityNotFound(_0x3c662f,null))[_0x73fe('0xd')](function(_0xe08976){if(_0xe08976){_0x5e1c6c=_0xe08976;_0x1ed51f[_0x73fe('0x17')]=_[_0x73fe('0x19')](db[_0x73fe('0x34')][_0x73fe('0x13')]);_0x1ed51f[_0x73fe('0x18')]=_[_0x73fe('0x19')](_0x4fa03b['query']);_0x1ed51f['filters']=_[_0x73fe('0x1c')](_0x1ed51f[_0x73fe('0x17')],_0x1ed51f[_0x73fe('0x18')]);_0x1ddd79[_0x73fe('0x1b')]=_[_0x73fe('0x1c')](_0x1ed51f['model'],qs['fields'](_0x4fa03b[_0x73fe('0x18')]['fields']));_0x1ddd79[_0x73fe('0x1b')]=_0x1ddd79['attributes'][_0x73fe('0x1e')]?_0x1ddd79[_0x73fe('0x1b')]:_0x1ed51f['model'];_0x1ddd79[_0x73fe('0x35')]=qs['sort'](_0x4fa03b[_0x73fe('0x18')]['sort']);_0x1ddd79[_0x73fe('0x22')]=qs['filters'](_[_0x73fe('0x23')](_0x4fa03b[_0x73fe('0x18')],_0x1ed51f['filters']));if(_0x4fa03b['query'][_0x73fe('0x27')]){_0x1ddd79[_0x73fe('0x22')]=_[_0x73fe('0x24')](_0x1ddd79[_0x73fe('0x22')],{'$or':_[_0x73fe('0x11')](_0x1ddd79['attributes'],function(_0xd06a1d){var _0x48d601={};_0x48d601[_0xd06a1d]={'$like':'%'+_0x4fa03b[_0x73fe('0x18')][_0x73fe('0x27')]+'%'};return _0x48d601;})});}_0x1ddd79=_[_0x73fe('0x24')]({},_0x1ddd79,_0x4fa03b[_0x73fe('0x28')]);return _0x5e1c6c['getConfigurations'](_0x1ddd79);}})['then'](function(_0x24062c){if(_0x24062c){_0xe78d32=_0x24062c[_0x73fe('0x1e')];if(!_0x4fa03b[_0x73fe('0x18')][_0x73fe('0x1f')]('nolimit')){_0x1ddd79[_0x73fe('0x8')]=qs[_0x73fe('0x8')](_0x4fa03b[_0x73fe('0x18')]['limit']);_0x1ddd79['offset']=qs[_0x73fe('0x7')](_0x4fa03b['query'][_0x73fe('0x7')]);}return _0x5e1c6c[_0x73fe('0x33')](_0x1ddd79);}})['then'](function(_0x449122){if(_0x449122){return _0x449122?{'count':_0xe78d32,'rows':_0x449122}:null;}})[_0x73fe('0xd')](respondWithResult(_0x3c662f,null))[_0x73fe('0x2b')](handleError(_0x3c662f,null));};exports[_0x73fe('0x36')]=function(_0x4c0ee1,_0xa91629){if(_0x4c0ee1[_0x73fe('0x31')]['id']){delete _0x4c0ee1[_0x73fe('0x31')]['id'];}return db['Dynamics365Account'][_0x73fe('0x37')]({'where':{'id':_0x4c0ee1[_0x73fe('0x2d')]['id']}})[_0x73fe('0xd')](handleEntityNotFound(_0xa91629,null))[_0x73fe('0xd')](function(_0x373ae3){if(_0x373ae3){_0x4c0ee1[_0x73fe('0x31')][_0x73fe('0x38')]=_0x373ae3['id'];_0x4c0ee1[_0x73fe('0x31')][_0x73fe('0x39')]=integrations[_0x73fe('0x3a')](_0x4c0ee1['body'][_0x73fe('0x3b')],_0x4c0ee1['body'][_0x73fe('0x15')]);_0x4c0ee1[_0x73fe('0x31')][_0x73fe('0x3c')]=integrations['getDescriptions'](_0x4c0ee1[_0x73fe('0x31')][_0x73fe('0x3b')],_0x4c0ee1[_0x73fe('0x31')][_0x73fe('0x15')]);return db[_0x73fe('0x34')][_0x73fe('0x30')](_0x4c0ee1[_0x73fe('0x31')],{'include':[{'model':db[_0x73fe('0x3d')],'as':_0x73fe('0x39')},{'model':db[_0x73fe('0x3d')],'as':_0x73fe('0x3c')}]});}return null;})[_0x73fe('0xd')](respondWithResult(_0xa91629,null))[_0x73fe('0x2b')](handleError(_0xa91629,null));};function sanitizeRemoteUri(_0x3b05ab){var _0x2bd142=_0x3b05ab[_0x73fe('0x3e')](-0x1);if(_0x2bd142==='/')return _0x3b05ab['substring'](0x0,_0x3b05ab[_0x73fe('0x3f')](_0x2bd142));return _0x3b05ab;}function getWebApiUrl(_0x2c7aef){return util[_0x73fe('0x40')]('%s/api/data/v9.0/',_0x2c7aef);}exports['getFields']=function(_0x12fb85,_0x1451e6){var _0x42f670=_0x12fb85[_0x73fe('0x18')]['ticketType'];var _0x15d2fc=_0x42f670===_0x73fe('0x41')?'Incident':_0x73fe('0x42');var _0x322e0='';var _0x24391c='';var _0x3fe6c1='';var _0x46a08b='';var _0xa7766b='';var _0x83271c='';var _0xa299c0='';var _0x3d443c='';var _0x4dfd0f=['title',_0x73fe('0x43'),_0x73fe('0x44'),_0x73fe('0x45'),_0x73fe('0x46'),_0x73fe('0x47'),'phonenumber',_0x73fe('0x48'),'directioncode',_0x73fe('0x49')];var _0x193d2d=[_0x73fe('0x4a'),_0x73fe('0x4b'),_0x73fe('0x4c'),_0x73fe('0x4d'),_0x73fe('0x4e'),_0x73fe('0x4f'),'contractdetailidname','contractidname',_0x73fe('0x50'),_0x73fe('0x51'),'createdbyname',_0x73fe('0x52'),_0x73fe('0x53'),'createdonbehalfbyname',_0x73fe('0x54'),_0x73fe('0x55'),'customeridtype','customeridyominame',_0x73fe('0x56'),_0x73fe('0x57'),_0x73fe('0x58'),_0x73fe('0x59'),_0x73fe('0x5a'),_0x73fe('0x5b'),'firstresponsebykpiidname',_0x73fe('0x5c'),'importsequencenumber',_0x73fe('0x5d'),_0x73fe('0x5e'),_0x73fe('0x5f'),_0x73fe('0x60'),_0x73fe('0x61'),'modifiedbyexternalpartyyominame',_0x73fe('0x62'),_0x73fe('0x63'),_0x73fe('0x64'),_0x73fe('0x65'),_0x73fe('0x66'),_0x73fe('0x67'),_0x73fe('0x68'),_0x73fe('0x69'),_0x73fe('0x6a'),_0x73fe('0x6b'),_0x73fe('0x6c'),_0x73fe('0x6d'),_0x73fe('0x6e'),_0x73fe('0x6f'),'primarycontactidname','primarycontactidyominame','prioritycodename',_0x73fe('0x70'),'productserialnumber',_0x73fe('0x71'),_0x73fe('0x72'),'responseby',_0x73fe('0x73'),_0x73fe('0x74'),'sentimentvalue',_0x73fe('0x75'),'slaname',_0x73fe('0x76'),_0x73fe('0x77'),_0x73fe('0x78'),_0x73fe('0x79'),_0x73fe('0x7a'),_0x73fe('0x7b'),'transactioncurrencyidname',_0x73fe('0x7c'),_0x73fe('0x7d'),_0x73fe('0x7e')];var _0x2e9c16=_0x4dfd0f['concat'](_0x193d2d);return db['Dynamics365Account'][_0x73fe('0x37')]({'where':{'id':_0x12fb85['params']['id']},'attributes':['id',_0x73fe('0x7f'),_0x73fe('0x80'),_0x73fe('0x81'),'tenantId',_0x73fe('0x82'),_0x73fe('0x83'),_0x73fe('0x84')],'include':[{'model':db[_0x73fe('0x85')],'as':_0x73fe('0x85'),'attributes':['id',_0x73fe('0x86'),'data7']}]})['then'](handleEntityNotFound(_0x1451e6,null))[_0x73fe('0xd')](function(_0xee9350){if(_0xee9350){if(_0xee9350[_0x73fe('0x84')]){_0xee9350['access_token']=_0xee9350[_0x73fe('0x85')][_0x73fe('0x86')];_0x3d443c=sanitizeRemoteUri(_0xee9350[_0x73fe('0x85')][_0x73fe('0x87')]);_0xa299c0=getWebApiUrl(_0x3d443c);return _0xee9350;}_0x3d443c=sanitizeRemoteUri(_0xee9350[_0x73fe('0x81')]);_0xa299c0=getWebApiUrl(_0x3d443c);var _0x4e6900={'method':_0x73fe('0x88'),'uri':_0x73fe('0x89')+_0xee9350[_0x73fe('0x8a')]+_0x73fe('0x8b'),'form':{'client_id':_0xee9350[_0x73fe('0x82')],'resource':_0x3d443c,'username':_0xee9350[_0x73fe('0x7f')],'password':_0xee9350[_0x73fe('0x80')],'grant_type':_0x73fe('0x80'),'client_secret':_0xee9350[_0x73fe('0x83')]},'json':!![]};return rp(_0x4e6900);}})[_0x73fe('0xd')](function(_0x3d6110){_0x83271c=_0x3d6110[_0x73fe('0x8c')];var _0x263ac9={'method':_0x73fe('0x8d'),'uri':encodeURI(_0xa299c0+_0x73fe('0x8e')+_0x15d2fc+'\x27'),'headers':{'Authorization':_0x73fe('0x8f')+_0x83271c,'If-None-Match':null,'OData-Version':_0x73fe('0x90')},'json':!![]};return rp(_0x263ac9);})[_0x73fe('0xd')](function(_0x185a38){var _0x4be675=_0x185a38[_0x73fe('0x91')][0x0];var _0x38eb52=_0x4be675[_0x73fe('0x92')];var _0x10b72b={'method':_0x73fe('0x8d'),'uri':_0xa299c0+'EntityDefinitions('+_0x38eb52+_0x73fe('0x93'),'headers':{'Authorization':'Bearer\x20'+_0x83271c,'If-None-Match':null,'OData-Version':_0x73fe('0x90')},'json':!![]};return rp(_0x10b72b);})[_0x73fe('0xd')](function(_0x215734){_0x322e0=_0x215734;_0x24391c=_0x322e0['Attributes'];_0x24391c=_[_0x73fe('0x94')](_0x24391c,function(_0x2e1577){return!_0x2e9c16[_0x73fe('0x95')](_0x2e1577[_0x73fe('0x96')]);});var _0x3f5df4=[];var _0x129129=[];_0x24391c['forEach'](function(_0x2a19d5){if(_0x2a19d5[_0x73fe('0x97')]){var _0x2605c5=_0x2a19d5[_0x73fe('0x97')]['substring'](_0x2a19d5[_0x73fe('0x97')][_0x73fe('0x3f')]('.')+0x1);if(_0x2605c5==='PicklistAttributeMetadata'){_0x3f5df4[_0x73fe('0x98')](getSelectList(_0xa299c0,_0x42f670,_0x129129,_0x322e0[_0x73fe('0x92')],_0x2a19d5[_0x73fe('0x92')],_0x83271c));}}});return Promise[_0x73fe('0x99')](_0x3f5df4);})[_0x73fe('0xd')](function(_0x21e6d7){_0x3fe6c1=_0x21e6d7[0x0];var _0x5873d3=[];var _0x209bf1=[];_0x24391c['forEach'](function(_0x373cc0){if(!_[_0x73fe('0x9a')](_0x373cc0[_0x73fe('0x97')])){var _0x1752ce=_0x373cc0[_0x73fe('0x97')][_0x73fe('0x9b')](_0x373cc0[_0x73fe('0x97')][_0x73fe('0x3f')]('.')+0x1);if(_0x1752ce==='BooleanAttributeMetadata'){_0x5873d3[_0x73fe('0x98')](getBooleanList(_0xa299c0,_0x42f670,_0x209bf1,_0x322e0['MetadataId'],_0x373cc0[_0x73fe('0x92')],_0x83271c));}}});return Promise[_0x73fe('0x99')](_0x5873d3);})[_0x73fe('0xd')](function(_0x45b491){_0x46a08b=_0x45b491[0x0];var _0x64bc08=[];var _0xed600a=[];_0x24391c['forEach'](function(_0x4f0835){if(_0x4f0835[_0x73fe('0x97')]){var _0x5516f3=_0x4f0835['@odata.type'][_0x73fe('0x9b')](_0x4f0835[_0x73fe('0x97')][_0x73fe('0x3f')]('.')+0x1);if(_0x5516f3==='StringAttributeMetadata'||_0x5516f3===_0x73fe('0x9c')||_0x5516f3===_0x73fe('0x9d')||_0x5516f3===_0x73fe('0x9e')||_0x5516f3===_0x73fe('0x9f')||_0x5516f3===_0x73fe('0xa0')||_0x5516f3===_0x73fe('0xa1')||_0x5516f3===_0x73fe('0xa2')||_0x5516f3===_0x73fe('0xa3')||_0x5516f3===_0x73fe('0xa4')){_0x64bc08['push'](getInputList(_0xa299c0,_0x42f670,_0x5516f3,_0xed600a,_0x322e0[_0x73fe('0x92')],_0x4f0835['MetadataId'],_0x83271c));}}});return Promise[_0x73fe('0x99')](_0x64bc08);})[_0x73fe('0xd')](function(_0x1201f6){_0xa7766b=_0x1201f6[0x0];var _0x1ebc4d=_0x3fe6c1['concat'](_0x46a08b)[_0x73fe('0xa5')](_0xa7766b);var _0x23f82e={'count':_0x1ebc4d['length'],'rows':_0x1ebc4d};return _0x23f82e;})[_0x73fe('0xd')](respondWithResult(_0x1451e6,null))[_0x73fe('0x2b')](function(_0x55fc24){var _0x3c71cd=_0x12fb85[_0x73fe('0x18')][_0x73fe('0xa6')]?0x1f4:_0x55fc24[_0x73fe('0xa7')]||0x1f4;logger[_0x73fe('0xa8')](_0x55fc24['stack']);delete _0x55fc24['name'];if(_0x3c71cd===0x191){_0x3c71cd=0x190;}_0x1451e6[_0x73fe('0x6')](_0x3c71cd)[_0x73fe('0xa9')](_0x12fb85[_0x73fe('0x18')]['test']?{'message':_0x73fe('0xaa'),'statusCode':_0x55fc24[_0x73fe('0xa7')]}:_0x55fc24);});};function getSelectList(_0x1e259c,_0x104ca3,_0x5dc4c1,_0x21a0cf,_0x89c775,_0x5c02eb){var _0x4ae9df={'method':_0x73fe('0x8d'),'uri':_0x1e259c+_0x73fe('0xab')+_0x21a0cf+_0x73fe('0xac')+_0x89c775+_0x73fe('0xad')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x73fe('0x8f')+_0x5c02eb,'If-None-Match':null,'OData-Version':_0x73fe('0x90')},'json':!![]};return rp(_0x4ae9df)['then'](function(_0x18fcd9){var _0x55320=[];var _0x40b6f4=_0x18fcd9['OptionSet'][_0x73fe('0xae')];_0x40b6f4['forEach'](function(_0x3d9efe){_0x55320[_0x73fe('0x98')]({'name':_0x3d9efe[_0x73fe('0xaf')]['UserLocalizedLabel'][_0x73fe('0xaf')],'value':String(_0x3d9efe[_0x73fe('0xb0')])});});var _0x3d22cc={'id':_0x104ca3+'_'+_0x18fcd9['LogicalName'],'name':_0x18fcd9[_0x73fe('0xb1')]['UserLocalizedLabel'][_0x73fe('0xaf')],'custom':![],'options':_0x55320};_0x5dc4c1[_0x73fe('0x98')](_0x3d22cc);return _0x5dc4c1;});}function getBooleanList(_0x11d285,_0x4f054e,_0x33b4e9,_0x24fb00,_0x5eabeb,_0x216768){var _0x5b956b={'method':_0x73fe('0x8d'),'uri':_0x11d285+_0x73fe('0xab')+_0x24fb00+')/Attributes('+_0x5eabeb+_0x73fe('0xb2'),'headers':{'Authorization':_0x73fe('0x8f')+_0x216768,'If-None-Match':null,'OData-Version':_0x73fe('0x90')},'json':!![]};return rp(_0x5b956b)[_0x73fe('0xd')](function(_0x378a1c){var _0x18c1c1=[];_0x18c1c1[_0x73fe('0x98')]({'name':_0x378a1c[_0x73fe('0xb3')]['TrueOption'][_0x73fe('0xaf')]['UserLocalizedLabel'][_0x73fe('0xaf')],'value':_0x73fe('0xb4')},{'name':_0x378a1c['OptionSet'][_0x73fe('0xb5')]['Label'][_0x73fe('0xb6')][_0x73fe('0xaf')],'value':_0x73fe('0xb7')});var _0x3d9c6f={'id':_0x4f054e+'_'+_0x378a1c[_0x73fe('0x96')],'name':_0x378a1c[_0x73fe('0xb1')][_0x73fe('0xb6')]['Label'],'custom':![],'options':_0x18c1c1};_0x33b4e9[_0x73fe('0x98')](_0x3d9c6f);return _0x33b4e9;});}function getInputList(_0x57292b,_0xfd3094,_0x282798,_0x4c31cc,_0x3a1777,_0x17c8ab,_0x47dd03){var _0x1bece2={'method':_0x73fe('0x8d'),'uri':_0x57292b+_0x73fe('0xab')+_0x3a1777+')/Attributes('+_0x17c8ab+_0x73fe('0xb8')+_0x282798+_0x73fe('0xb9'),'headers':{'Authorization':_0x73fe('0x8f')+_0x47dd03,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1bece2)[_0x73fe('0xd')](function(_0x138964){var _0x1d90ff={'id':_0xfd3094+'_'+_0x138964[_0x73fe('0x96')],'name':_0x138964['DisplayName'][_0x73fe('0xb6')]?_0x138964['DisplayName'][_0x73fe('0xb6')][_0x73fe('0xaf')]:_0x138964['LogicalName'],'custom':![],'options':[]};_0x4c31cc[_0x73fe('0x98')](_0x1d90ff);return _0x4c31cc;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 26a9757..a05bb99 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 _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x521239,_0x19dd8a){var _0x1b238c=function(_0x457c56){while(--_0x457c56){_0x521239['push'](_0x521239['shift']());}};_0x1b238c(++_0x19dd8a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));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 +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x258e27,_0x3bf7bc){var _0x193859=function(_0xd1d39d){while(--_0xd1d39d){_0x258e27['push'](_0x258e27['shift']());}};_0x193859(++_0x3bf7bc);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index fb4a166..a9b7ab7 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 _0x0e39=['then','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','find','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x35470a,_0x506ab0){var _0x5a42cc=function(_0x573768){while(--_0x573768){_0x35470a['push'](_0x35470a['shift']());}};_0x5a42cc(++_0x506ab0);}(_0x0e39,0x11a));var _0x90e3=function(_0x276cc9,_0x17774c){_0x276cc9=_0x276cc9-0x0;var _0x31ac6b=_0x0e39[_0x276cc9];return _0x31ac6b;};'use strict';var _=require(_0x90e3('0x0'));var util=require(_0x90e3('0x1'));var moment=require(_0x90e3('0x2'));var BPromise=require(_0x90e3('0x3'));var rs=require(_0x90e3('0x4'));var fs=require('fs');var Redis=require(_0x90e3('0x5'));var db=require(_0x90e3('0x6'))['db'];var utils=require(_0x90e3('0x7'));var logger=require(_0x90e3('0x8'))(_0x90e3('0x9'));var config=require(_0x90e3('0xa'));var jayson=require(_0x90e3('0xb'));var client=jayson['client'][_0x90e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3596ba,_0x27f749,_0x378549){return new BPromise(function(_0x588d24,_0x1123cf){return client[_0x90e3('0xd')](_0x3596ba,_0x378549)[_0x90e3('0xe')](function(_0x5e7aea){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x27f749,'request\x20sent');logger[_0x90e3('0xf')](_0x90e3('0x10'),_0x27f749,_0x90e3('0x11'),JSON[_0x90e3('0x12')](_0x5e7aea));if(_0x5e7aea[_0x90e3('0x13')]){if(_0x5e7aea[_0x90e3('0x13')]['code']===0x1f4){logger[_0x90e3('0x13')](_0x90e3('0x14'),_0x27f749,_0x5e7aea[_0x90e3('0x13')][_0x90e3('0x15')]);return _0x1123cf(_0x5e7aea[_0x90e3('0x13')][_0x90e3('0x15')]);}logger[_0x90e3('0x13')](_0x90e3('0x14'),_0x27f749,_0x5e7aea[_0x90e3('0x13')]['message']);return _0x588d24(_0x5e7aea[_0x90e3('0x13')][_0x90e3('0x15')]);}else{logger[_0x90e3('0x16')](_0x90e3('0x14'),_0x27f749,_0x90e3('0x11'));_0x588d24(_0x5e7aea[_0x90e3('0x17')][_0x90e3('0x15')]);}})[_0x90e3('0x18')](function(_0x44c1c6){logger[_0x90e3('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x27f749,_0x44c1c6);_0x1123cf(_0x44c1c6);});});}exports[_0x90e3('0x19')]=function(_0x54c509){var _0x3b23cd=this;return new Promise(function(_0x46d9cd,_0x58fd06){return db[_0x90e3('0x1a')][_0x90e3('0x1b')]({'raw':_0x54c509['options']?_0x54c509[_0x90e3('0x1c')][_0x90e3('0x1d')]===undefined?!![]:![]:!![],'where':_0x54c509[_0x90e3('0x1c')]?_0x54c509[_0x90e3('0x1c')]['where']||null:null,'attributes':_0x54c509['options']?_0x54c509[_0x90e3('0x1c')][_0x90e3('0x1e')]||null:null,'limit':_0x54c509['options']?_0x54c509[_0x90e3('0x1c')][_0x90e3('0x1f')]||null:null,'include':_0x54c509[_0x90e3('0x1c')]?_0x54c509[_0x90e3('0x1c')][_0x90e3('0x20')]?_[_0x90e3('0x21')](_0x54c509[_0x90e3('0x1c')]['include'],function(_0x100b2c){return{'model':db[_0x100b2c[_0x90e3('0x22')]],'as':_0x100b2c['as'],'attributes':_0x100b2c[_0x90e3('0x1e')],'include':_0x100b2c[_0x90e3('0x20')]?_[_0x90e3('0x21')](_0x100b2c[_0x90e3('0x20')],function(_0x53a89b){return{'model':db[_0x53a89b[_0x90e3('0x22')]],'as':_0x53a89b['as'],'attributes':_0x53a89b[_0x90e3('0x1e')],'include':_0x53a89b[_0x90e3('0x20')]?_[_0x90e3('0x21')](_0x53a89b['include'],function(_0x2efdf5){return{'model':db[_0x2efdf5[_0x90e3('0x22')]],'as':_0x2efdf5['as'],'attributes':_0x2efdf5[_0x90e3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11accc){logger['info'](_0x90e3('0x19'),_0x54c509);logger[_0x90e3('0xf')](_0x90e3('0x19'),_0x54c509,JSON['stringify'](_0x11accc));_0x46d9cd(_0x11accc);})['catch'](function(_0x366ae5){logger[_0x90e3('0x13')]('GetDynamics365Account',_0x366ae5[_0x90e3('0x15')],_0x54c509);_0x58fd06(_0x3b23cd[_0x90e3('0x13')](0x1f4,_0x366ae5[_0x90e3('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x4861ed){var _0x3661b0=this;return new Promise(function(_0x1b4ec9,_0x40b714){return db['Dynamics365Account'][_0x90e3('0x23')]({'raw':_0x4861ed[_0x90e3('0x1c')]?_0x4861ed[_0x90e3('0x1c')][_0x90e3('0x1d')]===undefined?!![]:![]:!![],'where':_0x4861ed[_0x90e3('0x1c')]?_0x4861ed[_0x90e3('0x1c')]['where']||null:null,'attributes':_0x4861ed[_0x90e3('0x1c')]?_0x4861ed[_0x90e3('0x1c')][_0x90e3('0x1e')]||null:null,'include':_0x4861ed[_0x90e3('0x1c')]?_0x4861ed[_0x90e3('0x1c')][_0x90e3('0x20')]?_[_0x90e3('0x21')](_0x4861ed['options'][_0x90e3('0x20')],function(_0x4418b2){return{'model':db[_0x4418b2[_0x90e3('0x22')]],'as':_0x4418b2['as'],'attributes':_0x4418b2[_0x90e3('0x1e')],'include':_0x4418b2[_0x90e3('0x20')]?_[_0x90e3('0x21')](_0x4418b2[_0x90e3('0x20')],function(_0x877d0){return{'model':db[_0x877d0[_0x90e3('0x22')]],'as':_0x877d0['as'],'attributes':_0x877d0[_0x90e3('0x1e')],'include':_0x877d0[_0x90e3('0x20')]?_[_0x90e3('0x21')](_0x877d0[_0x90e3('0x20')],function(_0x39e801){return{'model':db[_0x39e801[_0x90e3('0x22')]],'as':_0x39e801['as'],'attributes':_0x39e801[_0x90e3('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20ff10){logger[_0x90e3('0x16')](_0x90e3('0x24'),_0x4861ed);logger['debug']('ShowDynamics365Account',_0x4861ed,JSON[_0x90e3('0x12')](_0x20ff10));_0x1b4ec9(_0x20ff10);})[_0x90e3('0x18')](function(_0x5cf49b){logger[_0x90e3('0x13')](_0x90e3('0x24'),_0x5cf49b[_0x90e3('0x15')],_0x4861ed);_0x40b714(_0x3661b0[_0x90e3('0x13')](0x1f4,_0x5cf49b['message']));});});}; \ No newline at end of file +var _0x9a53=['find','ShowDynamics365Account','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','include','map','attributes','model'];(function(_0x7b8219,_0x57a1ca){var _0x2c84b4=function(_0x3090ec){while(--_0x3090ec){_0x7b8219['push'](_0x7b8219['shift']());}};_0x2c84b4(++_0x57a1ca);}(_0x9a53,0x135));var _0x39a5=function(_0x1badc9,_0x4c2dfd){_0x1badc9=_0x1badc9-0x0;var _0x471cf4=_0x9a53[_0x1badc9];return _0x471cf4;};'use strict';var _=require('lodash');var util=require(_0x39a5('0x0'));var moment=require(_0x39a5('0x1'));var BPromise=require('bluebird');var rs=require(_0x39a5('0x2'));var fs=require('fs');var Redis=require(_0x39a5('0x3'));var db=require(_0x39a5('0x4'))['db'];var utils=require(_0x39a5('0x5'));var logger=require(_0x39a5('0x6'))(_0x39a5('0x7'));var config=require(_0x39a5('0x8'));var jayson=require(_0x39a5('0x9'));var client=jayson[_0x39a5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1df12d,_0x4db25c,_0x841dd2){return new BPromise(function(_0x5a7ee7,_0x3d3ec6){return client[_0x39a5('0xb')](_0x1df12d,_0x841dd2)[_0x39a5('0xc')](function(_0x3902c0){logger[_0x39a5('0xd')](_0x39a5('0xe'),_0x4db25c,_0x39a5('0xf'));logger['debug'](_0x39a5('0x10'),_0x4db25c,'request\x20sent',JSON['stringify'](_0x3902c0));if(_0x3902c0[_0x39a5('0x11')]){if(_0x3902c0[_0x39a5('0x11')][_0x39a5('0x12')]===0x1f4){logger['error'](_0x39a5('0xe'),_0x4db25c,_0x3902c0[_0x39a5('0x11')]['message']);return _0x3d3ec6(_0x3902c0[_0x39a5('0x11')]['message']);}logger[_0x39a5('0x11')](_0x39a5('0xe'),_0x4db25c,_0x3902c0[_0x39a5('0x11')]['message']);return _0x5a7ee7(_0x3902c0[_0x39a5('0x11')][_0x39a5('0x13')]);}else{logger[_0x39a5('0xd')](_0x39a5('0xe'),_0x4db25c,'request\x20sent');_0x5a7ee7(_0x3902c0[_0x39a5('0x14')][_0x39a5('0x13')]);}})[_0x39a5('0x15')](function(_0x33fd87){logger['error'](_0x39a5('0xe'),_0x4db25c,_0x33fd87);_0x3d3ec6(_0x33fd87);});});}exports[_0x39a5('0x16')]=function(_0xaafdfb){var _0x3b699c=this;return new Promise(function(_0x214e71,_0x14d220){return db[_0x39a5('0x17')][_0x39a5('0x18')]({'raw':_0xaafdfb[_0x39a5('0x19')]?_0xaafdfb[_0x39a5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xaafdfb[_0x39a5('0x19')]?_0xaafdfb[_0x39a5('0x19')][_0x39a5('0x1a')]||null:null,'attributes':_0xaafdfb[_0x39a5('0x19')]?_0xaafdfb[_0x39a5('0x19')]['attributes']||null:null,'limit':_0xaafdfb[_0x39a5('0x19')]?_0xaafdfb[_0x39a5('0x19')]['limit']||null:null,'include':_0xaafdfb['options']?_0xaafdfb['options'][_0x39a5('0x1b')]?_[_0x39a5('0x1c')](_0xaafdfb[_0x39a5('0x19')]['include'],function(_0x1384cf){return{'model':db[_0x1384cf['model']],'as':_0x1384cf['as'],'attributes':_0x1384cf[_0x39a5('0x1d')],'include':_0x1384cf[_0x39a5('0x1b')]?_[_0x39a5('0x1c')](_0x1384cf[_0x39a5('0x1b')],function(_0xafd2ea){return{'model':db[_0xafd2ea[_0x39a5('0x1e')]],'as':_0xafd2ea['as'],'attributes':_0xafd2ea[_0x39a5('0x1d')],'include':_0xafd2ea[_0x39a5('0x1b')]?_['map'](_0xafd2ea[_0x39a5('0x1b')],function(_0x3c7265){return{'model':db[_0x3c7265[_0x39a5('0x1e')]],'as':_0x3c7265['as'],'attributes':_0x3c7265[_0x39a5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x39a5('0xc')](function(_0x1d3861){logger['info'](_0x39a5('0x16'),_0xaafdfb);logger['debug'](_0x39a5('0x16'),_0xaafdfb,JSON['stringify'](_0x1d3861));_0x214e71(_0x1d3861);})[_0x39a5('0x15')](function(_0x45e35e){logger['error'](_0x39a5('0x16'),_0x45e35e[_0x39a5('0x13')],_0xaafdfb);_0x14d220(_0x3b699c[_0x39a5('0x11')](0x1f4,_0x45e35e['message']));});});};exports['ShowDynamics365Account']=function(_0x351a04){var _0x2a7dd9=this;return new Promise(function(_0x39a6f7,_0x371e7f){return db['Dynamics365Account'][_0x39a5('0x1f')]({'raw':_0x351a04[_0x39a5('0x19')]?_0x351a04[_0x39a5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x351a04[_0x39a5('0x19')]?_0x351a04[_0x39a5('0x19')][_0x39a5('0x1a')]||null:null,'attributes':_0x351a04[_0x39a5('0x19')]?_0x351a04[_0x39a5('0x19')][_0x39a5('0x1d')]||null:null,'include':_0x351a04[_0x39a5('0x19')]?_0x351a04[_0x39a5('0x19')][_0x39a5('0x1b')]?_[_0x39a5('0x1c')](_0x351a04['options']['include'],function(_0x5d920c){return{'model':db[_0x5d920c[_0x39a5('0x1e')]],'as':_0x5d920c['as'],'attributes':_0x5d920c[_0x39a5('0x1d')],'include':_0x5d920c['include']?_[_0x39a5('0x1c')](_0x5d920c[_0x39a5('0x1b')],function(_0x49f2b1){return{'model':db[_0x49f2b1['model']],'as':_0x49f2b1['as'],'attributes':_0x49f2b1[_0x39a5('0x1d')],'include':_0x49f2b1['include']?_[_0x39a5('0x1c')](_0x49f2b1[_0x39a5('0x1b')],function(_0x127b74){return{'model':db[_0x127b74[_0x39a5('0x1e')]],'as':_0x127b74['as'],'attributes':_0x127b74[_0x39a5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27add9){logger[_0x39a5('0xd')](_0x39a5('0x20'),_0x351a04);logger['debug'](_0x39a5('0x20'),_0x351a04,JSON[_0x39a5('0x21')](_0x27add9));_0x39a6f7(_0x27add9);})[_0x39a5('0x15')](function(_0x1a29f6){logger[_0x39a5('0x11')](_0x39a5('0x20'),_0x1a29f6['message'],_0x351a04);_0x371e7f(_0x2a7dd9['error'](0x1f4,_0x1a29f6[_0x39a5('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 562a9bd..3d8d813 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 _0xe139=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','show','/:id/fields','getFields'];(function(_0xc5e02a,_0xd9da3c){var _0xbeca77=function(_0x2a7d11){while(--_0x2a7d11){_0xc5e02a['push'](_0xc5e02a['shift']());}};_0xbeca77(++_0xd9da3c);}(_0xe139,0x1eb));var _0x9e13=function(_0x4b0a68,_0xa819c3){_0x4b0a68=_0x4b0a68-0x0;var _0x11183e=_0xe139[_0x4b0a68];return _0x11183e;};'use strict';var multer=require(_0x9e13('0x0'));var util=require('util');var path=require(_0x9e13('0x1'));var timeout=require(_0x9e13('0x2'));var express=require(_0x9e13('0x3'));var router=express['Router']();var fs_extra=require(_0x9e13('0x4'));var auth=require(_0x9e13('0x5'));var interaction=require(_0x9e13('0x6'));var config=require(_0x9e13('0x7'));var controller=require(_0x9e13('0x8'));router['get']('/',auth[_0x9e13('0x9')](),controller[_0x9e13('0xa')]);router[_0x9e13('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9e13('0xc')]);router[_0x9e13('0xb')](_0x9e13('0xd'),auth[_0x9e13('0x9')](),controller[_0x9e13('0xe')]);router[_0x9e13('0xb')](_0x9e13('0xf'),auth[_0x9e13('0x9')](),controller[_0x9e13('0x10')]);router[_0x9e13('0xb')](_0x9e13('0x11'),auth[_0x9e13('0x9')](),controller[_0x9e13('0x12')]);router[_0x9e13('0x13')]('/',auth[_0x9e13('0x9')](),controller['create']);router[_0x9e13('0x14')](_0x9e13('0x15'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x9e13('0x9')](),controller[_0x9e13('0x16')]);module['exports']=router; \ No newline at end of file +var _0x85f4=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1e9980,_0x43b214){var _0x1181bc=function(_0x4eb4d5){while(--_0x4eb4d5){_0x1e9980['push'](_0x1e9980['shift']());}};_0x1181bc(++_0x43b214);}(_0x85f4,0xc3));var _0x485f=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x85f4[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0x485f('0x0'));var util=require(_0x485f('0x1'));var path=require(_0x485f('0x2'));var timeout=require(_0x485f('0x3'));var express=require(_0x485f('0x4'));var router=express[_0x485f('0x5')]();var fs_extra=require(_0x485f('0x6'));var auth=require(_0x485f('0x7'));var interaction=require(_0x485f('0x8'));var config=require(_0x485f('0x9'));var controller=require('./intDynamics365Configuration.controller');router[_0x485f('0xa')]('/',auth[_0x485f('0xb')](),controller['index']);router[_0x485f('0xa')](_0x485f('0xc'),auth['isAuthenticated'](),controller[_0x485f('0xd')]);router['get'](_0x485f('0xe'),auth[_0x485f('0xb')](),controller[_0x485f('0xf')]);router[_0x485f('0xa')](_0x485f('0x10'),auth['isAuthenticated'](),controller[_0x485f('0x11')]);router[_0x485f('0xa')](_0x485f('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x485f('0x13')]);router[_0x485f('0x14')](_0x485f('0xc'),auth[_0x485f('0xb')](),controller[_0x485f('0x15')]);router[_0x485f('0x16')](_0x485f('0xc'),auth['isAuthenticated'](),controller[_0x485f('0x17')]);module[_0x485f('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 82a9808..ee0b6c4 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 _0x5371=['STRING','phonecall','incident','contact','sequelize','exports'];(function(_0x3e5d16,_0x1604f3){var _0x4e9d0c=function(_0x1b680a){while(--_0x1b680a){_0x3e5d16['push'](_0x3e5d16['shift']());}};_0x4e9d0c(++_0x1604f3);}(_0x5371,0x154));var _0x1537=function(_0x1b2693,_0x33be4a){_0x1b2693=_0x1b2693-0x0;var _0x48a112=_0x5371[_0x1b2693];return _0x48a112;};'use strict';var Sequelize=require(_0x1537('0x0'));module[_0x1537('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1537('0x2')]},'ticketType':{'type':Sequelize['ENUM']('incident',_0x1537('0x3')),'defaultValue':_0x1537('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('contact','nothing'),'defaultValue':_0x1537('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x64c0=['exports','STRING','ENUM','phonecall','incident','contact','sequelize'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x64c0,0x99));var _0x064c=function(_0x59d692,_0x637365){_0x59d692=_0x59d692-0x0;var _0x13316a=_0x64c0[_0x59d692];return _0x13316a;};'use strict';var Sequelize=require(_0x064c('0x0'));module[_0x064c('0x1')]={'name':{'type':Sequelize[_0x064c('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x064c('0x3')]('incident',_0x064c('0x4')),'defaultValue':_0x064c('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0x064c('0x6'),'nothing'),'defaultValue':_0x064c('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 8ac15a0..059f55d 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 _0x68f5=['filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','name','includeAll','include','catch','show','params','fields','options','create','body','find','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','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','undefined','limit','count','offset','apply','save','update','then','destroy','error','stack','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x307ec9,_0x2e0223){var _0x5a331d=function(_0x320117){while(--_0x320117){_0x307ec9['push'](_0x307ec9['shift']());}};_0x5a331d(++_0x2e0223);}(_0x68f5,0x103));var _0x568f=function(_0x3d8c36,_0x4cf4e7){_0x3d8c36=_0x3d8c36-0x0;var _0x3856f2=_0x68f5[_0x3d8c36];return _0x3856f2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x568f('0x0'));var jsonpatch=require(_0x568f('0x1'));var rp=require(_0x568f('0x2'));var moment=require(_0x568f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x568f('0x4'));var util=require('util');var path=require('path');var sox=require(_0x568f('0x5'));var csv=require('to-csv');var ejs=require(_0x568f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x568f('0x7'));var squel=require('squel');var crypto=require(_0x568f('0x8'));var jsforce=require(_0x568f('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x568f('0xa'));var querystring=require(_0x568f('0xb'));var Papa=require(_0x568f('0xc'));var Redis=require(_0x568f('0xd'));var authService=require(_0x568f('0xe'));var qs=require(_0x568f('0xf'));var as=require(_0x568f('0x10'));var hardwareService=require(_0x568f('0x11'));var logger=require(_0x568f('0x12'))(_0x568f('0x13'));var utils=require('../../config/utils');var config=require(_0x568f('0x14'));var licenseUtil=require(_0x568f('0x15'));var db=require(_0x568f('0x16'))['db'];function respondWithStatusCode(_0x202a95,_0x2e1b1d){_0x2e1b1d=_0x2e1b1d||0xcc;return function(_0x396bc4){if(_0x396bc4){return _0x202a95[_0x568f('0x17')](_0x2e1b1d);}return _0x202a95[_0x568f('0x18')](_0x2e1b1d)[_0x568f('0x19')]();};}function respondWithResult(_0x3c324a,_0x158e94){_0x158e94=_0x158e94||0xc8;return function(_0x1aae9c){if(_0x1aae9c){return _0x3c324a[_0x568f('0x18')](_0x158e94)[_0x568f('0x1a')](_0x1aae9c);}};}function respondWithFilteredResult(_0x3c1720,_0x1df32c){return function(_0x3b695c){if(_0x3b695c){var _0x780596=typeof _0x1df32c['offset']===_0x568f('0x1b')&&typeof _0x1df32c[_0x568f('0x1c')]===_0x568f('0x1b');var _0x3dd5c1=_0x3b695c[_0x568f('0x1d')];var _0x1b04a6=_0x780596?0x0:_0x1df32c[_0x568f('0x1e')];var _0x363774=_0x780596?_0x3b695c[_0x568f('0x1d')]:_0x1df32c[_0x568f('0x1e')]+_0x1df32c[_0x568f('0x1c')];var _0x211adf;if(_0x363774>=_0x3dd5c1){_0x363774=_0x3dd5c1;_0x211adf=0xc8;}else{_0x211adf=0xce;}_0x3c1720[_0x568f('0x18')](_0x211adf);return _0x3c1720['set']('Content-Range',_0x1b04a6+'-'+_0x363774+'/'+_0x3dd5c1)['json'](_0x3b695c);}return null;};}function patchUpdates(_0x203ef2){return function(_0xd40188){try{jsonpatch[_0x568f('0x1f')](_0xd40188,_0x203ef2,!![]);}catch(_0xd0b4d7){return BPromise['reject'](_0xd0b4d7);}return _0xd40188[_0x568f('0x20')]();};}function saveUpdates(_0x58a49e,_0x161b22){return function(_0x1bb3d3){if(_0x1bb3d3){return _0x1bb3d3[_0x568f('0x21')](_0x58a49e)[_0x568f('0x22')](function(_0x1922ef){return _0x1922ef;});}return null;};}function removeEntity(_0x54e4f6,_0x28cbed){return function(_0x1b83bf){if(_0x1b83bf){return _0x1b83bf[_0x568f('0x23')]()[_0x568f('0x22')](function(){_0x54e4f6[_0x568f('0x18')](0xcc)[_0x568f('0x19')]();});}};}function handleEntityNotFound(_0x32f607,_0x3c3b46){return function(_0x371354){if(!_0x371354){_0x32f607[_0x568f('0x17')](0x194);}return _0x371354;};}function handleError(_0x433fdd,_0x2862d0){_0x2862d0=_0x2862d0||0x1f4;return function(_0x1c0ca0){logger[_0x568f('0x24')](_0x1c0ca0[_0x568f('0x25')]);if(_0x1c0ca0['name']){delete _0x1c0ca0['name'];}_0x433fdd[_0x568f('0x18')](_0x2862d0)[_0x568f('0x26')](_0x1c0ca0);};}exports[_0x568f('0x27')]=function(_0x677da,_0x26fe11){var _0x2d8978={},_0x5aac1d={},_0x5ef1d8={'count':0x0,'rows':[]};var _0x32dab3=_[_0x568f('0x28')](db[_0x568f('0x29')][_0x568f('0x2a')],function(_0xf1ff19){return{'name':_0xf1ff19[_0x568f('0x2b')],'type':_0xf1ff19[_0x568f('0x2c')][_0x568f('0x2d')]};});_0x5aac1d[_0x568f('0x2e')]=_[_0x568f('0x28')](_0x32dab3,'name');_0x5aac1d[_0x568f('0x2f')]=_[_0x568f('0x30')](_0x677da[_0x568f('0x2f')]);_0x5aac1d[_0x568f('0x31')]=_[_0x568f('0x32')](_0x5aac1d[_0x568f('0x2e')],_0x5aac1d[_0x568f('0x2f')]);_0x2d8978['attributes']=_[_0x568f('0x32')](_0x5aac1d[_0x568f('0x2e')],qs['fields'](_0x677da[_0x568f('0x2f')]['fields']));_0x2d8978[_0x568f('0x33')]=_0x2d8978[_0x568f('0x33')][_0x568f('0x34')]?_0x2d8978[_0x568f('0x33')]:_0x5aac1d[_0x568f('0x2e')];if(!_0x677da['query'][_0x568f('0x35')](_0x568f('0x36'))){_0x2d8978['limit']=qs[_0x568f('0x1c')](_0x677da[_0x568f('0x2f')]['limit']);_0x2d8978[_0x568f('0x1e')]=qs['offset'](_0x677da[_0x568f('0x2f')][_0x568f('0x1e')]);}_0x2d8978[_0x568f('0x37')]=qs[_0x568f('0x38')](_0x677da[_0x568f('0x2f')][_0x568f('0x38')]);_0x2d8978[_0x568f('0x39')]=qs[_0x568f('0x31')](_[_0x568f('0x3a')](_0x677da[_0x568f('0x2f')],_0x5aac1d[_0x568f('0x31')]),_0x32dab3);if(_0x677da[_0x568f('0x2f')][_0x568f('0x3b')]){_0x2d8978[_0x568f('0x39')]=_[_0x568f('0x3c')](_0x2d8978['where'],{'$or':_[_0x568f('0x28')](_0x32dab3,function(_0xd5395b){if(_0xd5395b[_0x568f('0x2c')]!=='VIRTUAL'){var _0x32d311={};_0x32d311[_0xd5395b[_0x568f('0x3d')]]={'$like':'%'+_0x677da[_0x568f('0x2f')][_0x568f('0x3b')]+'%'};return _0x32d311;}})});}_0x2d8978=_[_0x568f('0x3c')]({},_0x2d8978,_0x677da['options']);var _0x3a9e87={'where':_0x2d8978[_0x568f('0x39')]};return db[_0x568f('0x29')][_0x568f('0x1d')](_0x3a9e87)[_0x568f('0x22')](function(_0x4c3c5a){_0x5ef1d8[_0x568f('0x1d')]=_0x4c3c5a;if(_0x677da[_0x568f('0x2f')][_0x568f('0x3e')]){_0x2d8978[_0x568f('0x3f')]=[{'all':!![]}];}return db[_0x568f('0x29')]['findAll'](_0x2d8978);})[_0x568f('0x22')](function(_0xe30cec){_0x5ef1d8['rows']=_0xe30cec;return _0x5ef1d8;})[_0x568f('0x22')](respondWithFilteredResult(_0x26fe11,_0x2d8978))[_0x568f('0x40')](handleError(_0x26fe11,null));};exports[_0x568f('0x41')]=function(_0x2e0633,_0x3760d5){var _0x2adb5b={'raw':![],'where':{'id':_0x2e0633[_0x568f('0x42')]['id']}},_0x2bafa6={};_0x2bafa6[_0x568f('0x2e')]=_['keys'](db[_0x568f('0x29')][_0x568f('0x2a')]);_0x2bafa6[_0x568f('0x2f')]=_['keys'](_0x2e0633[_0x568f('0x2f')]);_0x2bafa6['filters']=_[_0x568f('0x32')](_0x2bafa6[_0x568f('0x2e')],_0x2bafa6[_0x568f('0x2f')]);_0x2adb5b[_0x568f('0x33')]=_[_0x568f('0x32')](_0x2bafa6[_0x568f('0x2e')],qs[_0x568f('0x43')](_0x2e0633[_0x568f('0x2f')][_0x568f('0x43')]));_0x2adb5b[_0x568f('0x33')]=_0x2adb5b[_0x568f('0x33')][_0x568f('0x34')]?_0x2adb5b[_0x568f('0x33')]:_0x2bafa6[_0x568f('0x2e')];if(_0x2e0633[_0x568f('0x2f')]['includeAll']){_0x2adb5b[_0x568f('0x3f')]=[{'all':!![]}];}_0x2adb5b=_[_0x568f('0x3c')]({},_0x2adb5b,_0x2e0633[_0x568f('0x44')]);return db['Dynamics365Configuration']['find'](_0x2adb5b)[_0x568f('0x22')](handleEntityNotFound(_0x3760d5,null))[_0x568f('0x22')](respondWithResult(_0x3760d5,null))[_0x568f('0x40')](handleError(_0x3760d5,null));};exports[_0x568f('0x45')]=function(_0xc8d0f,_0x1fc6a2){return db[_0x568f('0x29')][_0x568f('0x45')](_0xc8d0f['body'],{})[_0x568f('0x22')](respondWithResult(_0x1fc6a2,0xc9))[_0x568f('0x40')](handleError(_0x1fc6a2,null));};exports[_0x568f('0x21')]=function(_0x38fcca,_0x2694e6){if(_0x38fcca[_0x568f('0x46')]['id']){delete _0x38fcca[_0x568f('0x46')]['id'];}return db['Dynamics365Configuration'][_0x568f('0x47')]({'where':{'id':_0x38fcca['params']['id']}})[_0x568f('0x22')](handleEntityNotFound(_0x2694e6,null))[_0x568f('0x22')](saveUpdates(_0x38fcca[_0x568f('0x46')],null))[_0x568f('0x22')](respondWithResult(_0x2694e6,null))[_0x568f('0x40')](handleError(_0x2694e6,null));};exports[_0x568f('0x23')]=function(_0x29ad29,_0x3911ed){return db[_0x568f('0x29')]['find']({'where':{'id':_0x29ad29[_0x568f('0x42')]['id']}})[_0x568f('0x22')](handleEntityNotFound(_0x3911ed,null))[_0x568f('0x22')](removeEntity(_0x3911ed,null))[_0x568f('0x40')](handleError(_0x3911ed,null));};exports[_0x568f('0x48')]=function(_0x240f96,_0x16d9cc,_0x363a9e){var _0x5acc7b={};var _0x4c06bc={};var _0x1cf348;var _0x50407d;return db['Dynamics365Configuration'][_0x568f('0x49')]({'where':{'id':_0x240f96[_0x568f('0x42')]['id']}})['then'](handleEntityNotFound(_0x16d9cc,null))[_0x568f('0x22')](function(_0x5a83ac){if(_0x5a83ac){_0x1cf348=_0x5a83ac;_0x4c06bc[_0x568f('0x2e')]=_[_0x568f('0x30')](db[_0x568f('0x4a')][_0x568f('0x2a')]);_0x4c06bc[_0x568f('0x2f')]=_[_0x568f('0x30')](_0x240f96[_0x568f('0x2f')]);_0x4c06bc[_0x568f('0x31')]=_[_0x568f('0x32')](_0x4c06bc[_0x568f('0x2e')],_0x4c06bc[_0x568f('0x2f')]);_0x5acc7b[_0x568f('0x33')]=_[_0x568f('0x32')](_0x4c06bc[_0x568f('0x2e')],qs[_0x568f('0x43')](_0x240f96[_0x568f('0x2f')][_0x568f('0x43')]));_0x5acc7b['attributes']=_0x5acc7b[_0x568f('0x33')]['length']?_0x5acc7b['attributes']:_0x4c06bc[_0x568f('0x2e')];_0x5acc7b[_0x568f('0x37')]=qs[_0x568f('0x38')](_0x240f96['query'][_0x568f('0x38')]);_0x5acc7b[_0x568f('0x39')]=qs['filters'](_[_0x568f('0x3a')](_0x240f96[_0x568f('0x2f')],_0x4c06bc[_0x568f('0x31')]));if(_0x240f96['query'][_0x568f('0x3b')]){_0x5acc7b['where']=_[_0x568f('0x3c')](_0x5acc7b[_0x568f('0x39')],{'$or':_[_0x568f('0x28')](_0x5acc7b[_0x568f('0x33')],function(_0x262a74){var _0x2babaf={};_0x2babaf[_0x262a74]={'$like':'%'+_0x240f96[_0x568f('0x2f')][_0x568f('0x3b')]+'%'};return _0x2babaf;})});}_0x5acc7b=_[_0x568f('0x3c')]({},_0x5acc7b,_0x240f96[_0x568f('0x44')]);return _0x1cf348['getFields'](_0x5acc7b);}})[_0x568f('0x22')](function(_0x4e93d9){if(_0x4e93d9){_0x50407d=_0x4e93d9['length'];if(!_0x240f96['query'][_0x568f('0x35')](_0x568f('0x36'))){_0x5acc7b['limit']=qs['limit'](_0x240f96[_0x568f('0x2f')][_0x568f('0x1c')]);_0x5acc7b[_0x568f('0x1e')]=qs[_0x568f('0x1e')](_0x240f96[_0x568f('0x2f')]['offset']);}return _0x1cf348[_0x568f('0x48')](_0x5acc7b);}})[_0x568f('0x22')](function(_0x35e2f4){if(_0x35e2f4){return _0x35e2f4?{'count':_0x50407d,'rows':_0x35e2f4}:null;}})['then'](respondWithResult(_0x16d9cc,null))['catch'](handleError(_0x16d9cc,null));};exports[_0x568f('0x4b')]=function(_0x24068a,_0x5143d6,_0x25fc5d){var _0x1cf0ad={};var _0x2c034d={};var _0x5a5de6;var _0xe100ea;return db[_0x568f('0x29')][_0x568f('0x49')]({'where':{'id':_0x24068a[_0x568f('0x42')]['id']}})[_0x568f('0x22')](handleEntityNotFound(_0x5143d6,null))[_0x568f('0x22')](function(_0x41b963){if(_0x41b963){_0x5a5de6=_0x41b963;_0x2c034d[_0x568f('0x2e')]=_[_0x568f('0x30')](db[_0x568f('0x4a')]['rawAttributes']);_0x2c034d[_0x568f('0x2f')]=_[_0x568f('0x30')](_0x24068a[_0x568f('0x2f')]);_0x2c034d[_0x568f('0x31')]=_['intersection'](_0x2c034d['model'],_0x2c034d[_0x568f('0x2f')]);_0x1cf0ad[_0x568f('0x33')]=_['intersection'](_0x2c034d[_0x568f('0x2e')],qs['fields'](_0x24068a[_0x568f('0x2f')][_0x568f('0x43')]));_0x1cf0ad['attributes']=_0x1cf0ad[_0x568f('0x33')]['length']?_0x1cf0ad['attributes']:_0x2c034d['model'];_0x1cf0ad['order']=qs[_0x568f('0x38')](_0x24068a[_0x568f('0x2f')][_0x568f('0x38')]);_0x1cf0ad[_0x568f('0x39')]=qs[_0x568f('0x31')](_['pick'](_0x24068a[_0x568f('0x2f')],_0x2c034d['filters']));if(_0x24068a['query'][_0x568f('0x3b')]){_0x1cf0ad['where']=_[_0x568f('0x3c')](_0x1cf0ad['where'],{'$or':_[_0x568f('0x28')](_0x1cf0ad[_0x568f('0x33')],function(_0x418acf){var _0x13de13={};_0x13de13[_0x418acf]={'$like':'%'+_0x24068a[_0x568f('0x2f')][_0x568f('0x3b')]+'%'};return _0x13de13;})});}_0x1cf0ad=_['merge']({},_0x1cf0ad,_0x24068a[_0x568f('0x44')]);return _0x5a5de6['getSubjects'](_0x1cf0ad);}})[_0x568f('0x22')](function(_0x1e3570){if(_0x1e3570){_0xe100ea=_0x1e3570['length'];if(!_0x24068a['query'][_0x568f('0x35')](_0x568f('0x36'))){_0x1cf0ad['limit']=qs[_0x568f('0x1c')](_0x24068a[_0x568f('0x2f')][_0x568f('0x1c')]);_0x1cf0ad[_0x568f('0x1e')]=qs[_0x568f('0x1e')](_0x24068a[_0x568f('0x2f')][_0x568f('0x1e')]);}return _0x5a5de6['getSubjects'](_0x1cf0ad);}})[_0x568f('0x22')](function(_0x402c6e){if(_0x402c6e){return _0x402c6e?{'count':_0xe100ea,'rows':_0x402c6e}:null;}})[_0x568f('0x22')](respondWithResult(_0x5143d6,null))['catch'](handleError(_0x5143d6,null));};exports['getDescriptions']=function(_0x45538e,_0x4e6fe6,_0xadcd97){var _0x21c5d0={};var _0x21870f={};var _0x4b7296;var _0x1b62bd;return db[_0x568f('0x29')][_0x568f('0x49')]({'where':{'id':_0x45538e[_0x568f('0x42')]['id']}})[_0x568f('0x22')](handleEntityNotFound(_0x4e6fe6,null))[_0x568f('0x22')](function(_0x2f3b67){if(_0x2f3b67){_0x4b7296=_0x2f3b67;_0x21870f['model']=_['keys'](db[_0x568f('0x4a')][_0x568f('0x2a')]);_0x21870f['query']=_[_0x568f('0x30')](_0x45538e[_0x568f('0x2f')]);_0x21870f[_0x568f('0x31')]=_[_0x568f('0x32')](_0x21870f[_0x568f('0x2e')],_0x21870f[_0x568f('0x2f')]);_0x21c5d0[_0x568f('0x33')]=_[_0x568f('0x32')](_0x21870f[_0x568f('0x2e')],qs[_0x568f('0x43')](_0x45538e[_0x568f('0x2f')][_0x568f('0x43')]));_0x21c5d0[_0x568f('0x33')]=_0x21c5d0['attributes'][_0x568f('0x34')]?_0x21c5d0[_0x568f('0x33')]:_0x21870f['model'];_0x21c5d0[_0x568f('0x37')]=qs[_0x568f('0x38')](_0x45538e[_0x568f('0x2f')][_0x568f('0x38')]);_0x21c5d0['where']=qs['filters'](_['pick'](_0x45538e[_0x568f('0x2f')],_0x21870f['filters']));if(_0x45538e['query']['filter']){_0x21c5d0[_0x568f('0x39')]=_[_0x568f('0x3c')](_0x21c5d0['where'],{'$or':_['map'](_0x21c5d0[_0x568f('0x33')],function(_0x22a242){var _0x5e4073={};_0x5e4073[_0x22a242]={'$like':'%'+_0x45538e[_0x568f('0x2f')][_0x568f('0x3b')]+'%'};return _0x5e4073;})});}_0x21c5d0=_[_0x568f('0x3c')]({},_0x21c5d0,_0x45538e[_0x568f('0x44')]);return _0x4b7296[_0x568f('0x4c')](_0x21c5d0);}})['then'](function(_0x22aa02){if(_0x22aa02){_0x1b62bd=_0x22aa02[_0x568f('0x34')];if(!_0x45538e['query'][_0x568f('0x35')]('nolimit')){_0x21c5d0[_0x568f('0x1c')]=qs[_0x568f('0x1c')](_0x45538e['query'][_0x568f('0x1c')]);_0x21c5d0['offset']=qs[_0x568f('0x1e')](_0x45538e['query']['offset']);}return _0x4b7296[_0x568f('0x4c')](_0x21c5d0);}})['then'](function(_0x1c03e4){if(_0x1c03e4){return _0x1c03e4?{'count':_0x1b62bd,'rows':_0x1c03e4}:null;}})[_0x568f('0x22')](respondWithResult(_0x4e6fe6,null))[_0x568f('0x40')](handleError(_0x4e6fe6,null));}; \ No newline at end of file +var _0x0f25=['Dynamics365Configuration','includeAll','include','rows','catch','show','params','create','body','find','findOne','Dynamics365Field','getFields','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0f25,0x195));var _0x50f2=function(_0x5bf15c,_0x3cbc18){_0x5bf15c=_0x5bf15c-0x0;var _0x5bad17=_0x0f25[_0x5bf15c];return _0x5bad17;};'use strict';var emlformat=require(_0x50f2('0x0'));var rimraf=require(_0x50f2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50f2('0x2'));var rp=require('request-promise');var moment=require(_0x50f2('0x3'));var BPromise=require(_0x50f2('0x4'));var Mustache=require(_0x50f2('0x5'));var util=require(_0x50f2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x50f2('0x7'));var ejs=require(_0x50f2('0x8'));var fs=require('fs');var fs_extra=require(_0x50f2('0x9'));var _=require(_0x50f2('0xa'));var squel=require(_0x50f2('0xb'));var crypto=require(_0x50f2('0xc'));var jsforce=require(_0x50f2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x50f2('0x7'));var querystring=require(_0x50f2('0xe'));var Papa=require(_0x50f2('0xf'));var Redis=require('ioredis');var authService=require(_0x50f2('0x10'));var qs=require(_0x50f2('0x11'));var as=require(_0x50f2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x50f2('0x13'));var utils=require('../../config/utils');var config=require(_0x50f2('0x14'));var licenseUtil=require(_0x50f2('0x15'));var db=require(_0x50f2('0x16'))['db'];function respondWithStatusCode(_0x4294bf,_0x5d65a1){_0x5d65a1=_0x5d65a1||0xcc;return function(_0x3e4c05){if(_0x3e4c05){return _0x4294bf['sendStatus'](_0x5d65a1);}return _0x4294bf[_0x50f2('0x17')](_0x5d65a1)[_0x50f2('0x18')]();};}function respondWithResult(_0x5eeba6,_0x57dabb){_0x57dabb=_0x57dabb||0xc8;return function(_0x1eadef){if(_0x1eadef){return _0x5eeba6[_0x50f2('0x17')](_0x57dabb)['json'](_0x1eadef);}};}function respondWithFilteredResult(_0x9e4fda,_0x541aa6){return function(_0x430e96){if(_0x430e96){var _0x27b2f6=typeof _0x541aa6['offset']===_0x50f2('0x19')&&typeof _0x541aa6['limit']==='undefined';var _0x4b9d1f=_0x430e96['count'];var _0x33e8e6=_0x27b2f6?0x0:_0x541aa6['offset'];var _0x154db0=_0x27b2f6?_0x430e96[_0x50f2('0x1a')]:_0x541aa6[_0x50f2('0x1b')]+_0x541aa6[_0x50f2('0x1c')];var _0x3db38a;if(_0x154db0>=_0x4b9d1f){_0x154db0=_0x4b9d1f;_0x3db38a=0xc8;}else{_0x3db38a=0xce;}_0x9e4fda[_0x50f2('0x17')](_0x3db38a);return _0x9e4fda['set'](_0x50f2('0x1d'),_0x33e8e6+'-'+_0x154db0+'/'+_0x4b9d1f)[_0x50f2('0x1e')](_0x430e96);}return null;};}function patchUpdates(_0x25c24a){return function(_0x400c2b){try{jsonpatch[_0x50f2('0x1f')](_0x400c2b,_0x25c24a,!![]);}catch(_0x1165d2){return BPromise['reject'](_0x1165d2);}return _0x400c2b[_0x50f2('0x20')]();};}function saveUpdates(_0x3ddce7,_0x2aafe3){return function(_0x5edc8c){if(_0x5edc8c){return _0x5edc8c[_0x50f2('0x21')](_0x3ddce7)['then'](function(_0x54bf80){return _0x54bf80;});}return null;};}function removeEntity(_0x63c066,_0x1c5d17){return function(_0x386989){if(_0x386989){return _0x386989[_0x50f2('0x22')]()[_0x50f2('0x23')](function(){_0x63c066[_0x50f2('0x17')](0xcc)[_0x50f2('0x18')]();});}};}function handleEntityNotFound(_0x2cb68d,_0x1a50b6){return function(_0x5cc1c0){if(!_0x5cc1c0){_0x2cb68d[_0x50f2('0x24')](0x194);}return _0x5cc1c0;};}function handleError(_0x29e0ee,_0x4bed0e){_0x4bed0e=_0x4bed0e||0x1f4;return function(_0x2030b0){logger[_0x50f2('0x25')](_0x2030b0['stack']);if(_0x2030b0[_0x50f2('0x26')]){delete _0x2030b0[_0x50f2('0x26')];}_0x29e0ee[_0x50f2('0x17')](_0x4bed0e)[_0x50f2('0x27')](_0x2030b0);};}exports[_0x50f2('0x28')]=function(_0x3d6504,_0x182689){var _0x593b83={},_0x1a3754={},_0x49a2e1={'count':0x0,'rows':[]};var _0x1004b8=_[_0x50f2('0x29')](db['Dynamics365Configuration'][_0x50f2('0x2a')],function(_0x40b846){return{'name':_0x40b846['fieldName'],'type':_0x40b846['type'][_0x50f2('0x2b')]};});_0x1a3754[_0x50f2('0x2c')]=_[_0x50f2('0x29')](_0x1004b8,_0x50f2('0x26'));_0x1a3754['query']=_[_0x50f2('0x2d')](_0x3d6504[_0x50f2('0x2e')]);_0x1a3754[_0x50f2('0x2f')]=_['intersection'](_0x1a3754[_0x50f2('0x2c')],_0x1a3754[_0x50f2('0x2e')]);_0x593b83[_0x50f2('0x30')]=_[_0x50f2('0x31')](_0x1a3754[_0x50f2('0x2c')],qs[_0x50f2('0x32')](_0x3d6504[_0x50f2('0x2e')]['fields']));_0x593b83['attributes']=_0x593b83[_0x50f2('0x30')][_0x50f2('0x33')]?_0x593b83[_0x50f2('0x30')]:_0x1a3754[_0x50f2('0x2c')];if(!_0x3d6504['query'][_0x50f2('0x34')](_0x50f2('0x35'))){_0x593b83[_0x50f2('0x1c')]=qs[_0x50f2('0x1c')](_0x3d6504[_0x50f2('0x2e')][_0x50f2('0x1c')]);_0x593b83[_0x50f2('0x1b')]=qs[_0x50f2('0x1b')](_0x3d6504['query']['offset']);}_0x593b83[_0x50f2('0x36')]=qs[_0x50f2('0x37')](_0x3d6504['query'][_0x50f2('0x37')]);_0x593b83[_0x50f2('0x38')]=qs['filters'](_[_0x50f2('0x39')](_0x3d6504[_0x50f2('0x2e')],_0x1a3754[_0x50f2('0x2f')]),_0x1004b8);if(_0x3d6504['query'][_0x50f2('0x3a')]){_0x593b83['where']=_[_0x50f2('0x3b')](_0x593b83[_0x50f2('0x38')],{'$or':_[_0x50f2('0x29')](_0x1004b8,function(_0x5613ce){if(_0x5613ce[_0x50f2('0x3c')]!==_0x50f2('0x3d')){var _0x2bb833={};_0x2bb833[_0x5613ce[_0x50f2('0x26')]]={'$like':'%'+_0x3d6504[_0x50f2('0x2e')][_0x50f2('0x3a')]+'%'};return _0x2bb833;}})});}_0x593b83=_['merge']({},_0x593b83,_0x3d6504[_0x50f2('0x3e')]);var _0x2343db={'where':_0x593b83[_0x50f2('0x38')]};return db[_0x50f2('0x3f')]['count'](_0x2343db)['then'](function(_0x4a4f83){_0x49a2e1[_0x50f2('0x1a')]=_0x4a4f83;if(_0x3d6504[_0x50f2('0x2e')][_0x50f2('0x40')]){_0x593b83[_0x50f2('0x41')]=[{'all':!![]}];}return db[_0x50f2('0x3f')]['findAll'](_0x593b83);})['then'](function(_0x2c3254){_0x49a2e1[_0x50f2('0x42')]=_0x2c3254;return _0x49a2e1;})['then'](respondWithFilteredResult(_0x182689,_0x593b83))[_0x50f2('0x43')](handleError(_0x182689,null));};exports[_0x50f2('0x44')]=function(_0x2f00db,_0x3542f3){var _0x281d33={'raw':![],'where':{'id':_0x2f00db[_0x50f2('0x45')]['id']}},_0x7639a4={};_0x7639a4[_0x50f2('0x2c')]=_[_0x50f2('0x2d')](db['Dynamics365Configuration'][_0x50f2('0x2a')]);_0x7639a4['query']=_[_0x50f2('0x2d')](_0x2f00db['query']);_0x7639a4['filters']=_[_0x50f2('0x31')](_0x7639a4[_0x50f2('0x2c')],_0x7639a4[_0x50f2('0x2e')]);_0x281d33['attributes']=_['intersection'](_0x7639a4['model'],qs[_0x50f2('0x32')](_0x2f00db[_0x50f2('0x2e')][_0x50f2('0x32')]));_0x281d33[_0x50f2('0x30')]=_0x281d33[_0x50f2('0x30')][_0x50f2('0x33')]?_0x281d33[_0x50f2('0x30')]:_0x7639a4[_0x50f2('0x2c')];if(_0x2f00db[_0x50f2('0x2e')][_0x50f2('0x40')]){_0x281d33[_0x50f2('0x41')]=[{'all':!![]}];}_0x281d33=_['merge']({},_0x281d33,_0x2f00db[_0x50f2('0x3e')]);return db['Dynamics365Configuration']['find'](_0x281d33)[_0x50f2('0x23')](handleEntityNotFound(_0x3542f3,null))[_0x50f2('0x23')](respondWithResult(_0x3542f3,null))[_0x50f2('0x43')](handleError(_0x3542f3,null));};exports[_0x50f2('0x46')]=function(_0x4f4841,_0x609e66){return db[_0x50f2('0x3f')][_0x50f2('0x46')](_0x4f4841[_0x50f2('0x47')],{})[_0x50f2('0x23')](respondWithResult(_0x609e66,0xc9))[_0x50f2('0x43')](handleError(_0x609e66,null));};exports[_0x50f2('0x21')]=function(_0x57589d,_0x3bf254){if(_0x57589d[_0x50f2('0x47')]['id']){delete _0x57589d[_0x50f2('0x47')]['id'];}return db[_0x50f2('0x3f')]['find']({'where':{'id':_0x57589d[_0x50f2('0x45')]['id']}})['then'](handleEntityNotFound(_0x3bf254,null))[_0x50f2('0x23')](saveUpdates(_0x57589d[_0x50f2('0x47')],null))[_0x50f2('0x23')](respondWithResult(_0x3bf254,null))[_0x50f2('0x43')](handleError(_0x3bf254,null));};exports[_0x50f2('0x22')]=function(_0x39f4e3,_0x2222a1){return db[_0x50f2('0x3f')][_0x50f2('0x48')]({'where':{'id':_0x39f4e3[_0x50f2('0x45')]['id']}})[_0x50f2('0x23')](handleEntityNotFound(_0x2222a1,null))['then'](removeEntity(_0x2222a1,null))[_0x50f2('0x43')](handleError(_0x2222a1,null));};exports['getFields']=function(_0x28c185,_0x414265,_0x57e34d){var _0x2391c0={};var _0x34f6c1={};var _0x1297e5;var _0x373a71;return db['Dynamics365Configuration'][_0x50f2('0x49')]({'where':{'id':_0x28c185['params']['id']}})[_0x50f2('0x23')](handleEntityNotFound(_0x414265,null))[_0x50f2('0x23')](function(_0x2a6191){if(_0x2a6191){_0x1297e5=_0x2a6191;_0x34f6c1[_0x50f2('0x2c')]=_[_0x50f2('0x2d')](db[_0x50f2('0x4a')][_0x50f2('0x2a')]);_0x34f6c1[_0x50f2('0x2e')]=_[_0x50f2('0x2d')](_0x28c185['query']);_0x34f6c1[_0x50f2('0x2f')]=_[_0x50f2('0x31')](_0x34f6c1['model'],_0x34f6c1[_0x50f2('0x2e')]);_0x2391c0[_0x50f2('0x30')]=_[_0x50f2('0x31')](_0x34f6c1[_0x50f2('0x2c')],qs[_0x50f2('0x32')](_0x28c185['query'][_0x50f2('0x32')]));_0x2391c0[_0x50f2('0x30')]=_0x2391c0[_0x50f2('0x30')][_0x50f2('0x33')]?_0x2391c0[_0x50f2('0x30')]:_0x34f6c1['model'];_0x2391c0[_0x50f2('0x36')]=qs['sort'](_0x28c185[_0x50f2('0x2e')][_0x50f2('0x37')]);_0x2391c0[_0x50f2('0x38')]=qs['filters'](_[_0x50f2('0x39')](_0x28c185[_0x50f2('0x2e')],_0x34f6c1[_0x50f2('0x2f')]));if(_0x28c185[_0x50f2('0x2e')]['filter']){_0x2391c0['where']=_[_0x50f2('0x3b')](_0x2391c0[_0x50f2('0x38')],{'$or':_[_0x50f2('0x29')](_0x2391c0[_0x50f2('0x30')],function(_0x4d8781){var _0x539418={};_0x539418[_0x4d8781]={'$like':'%'+_0x28c185['query']['filter']+'%'};return _0x539418;})});}_0x2391c0=_['merge']({},_0x2391c0,_0x28c185[_0x50f2('0x3e')]);return _0x1297e5[_0x50f2('0x4b')](_0x2391c0);}})[_0x50f2('0x23')](function(_0x45b590){if(_0x45b590){_0x373a71=_0x45b590[_0x50f2('0x33')];if(!_0x28c185[_0x50f2('0x2e')][_0x50f2('0x34')](_0x50f2('0x35'))){_0x2391c0[_0x50f2('0x1c')]=qs[_0x50f2('0x1c')](_0x28c185['query'][_0x50f2('0x1c')]);_0x2391c0[_0x50f2('0x1b')]=qs[_0x50f2('0x1b')](_0x28c185[_0x50f2('0x2e')]['offset']);}return _0x1297e5[_0x50f2('0x4b')](_0x2391c0);}})[_0x50f2('0x23')](function(_0x2d5ad8){if(_0x2d5ad8){return _0x2d5ad8?{'count':_0x373a71,'rows':_0x2d5ad8}:null;}})[_0x50f2('0x23')](respondWithResult(_0x414265,null))['catch'](handleError(_0x414265,null));};exports[_0x50f2('0x4c')]=function(_0x424171,_0x44ea9e,_0x39432f){var _0x185a15={};var _0x21967c={};var _0x43aeba;var _0xbca467;return db[_0x50f2('0x3f')]['findOne']({'where':{'id':_0x424171[_0x50f2('0x45')]['id']}})[_0x50f2('0x23')](handleEntityNotFound(_0x44ea9e,null))[_0x50f2('0x23')](function(_0x4fd241){if(_0x4fd241){_0x43aeba=_0x4fd241;_0x21967c[_0x50f2('0x2c')]=_[_0x50f2('0x2d')](db['Dynamics365Field'][_0x50f2('0x2a')]);_0x21967c[_0x50f2('0x2e')]=_[_0x50f2('0x2d')](_0x424171[_0x50f2('0x2e')]);_0x21967c[_0x50f2('0x2f')]=_[_0x50f2('0x31')](_0x21967c[_0x50f2('0x2c')],_0x21967c[_0x50f2('0x2e')]);_0x185a15[_0x50f2('0x30')]=_['intersection'](_0x21967c['model'],qs[_0x50f2('0x32')](_0x424171[_0x50f2('0x2e')]['fields']));_0x185a15[_0x50f2('0x30')]=_0x185a15[_0x50f2('0x30')][_0x50f2('0x33')]?_0x185a15[_0x50f2('0x30')]:_0x21967c[_0x50f2('0x2c')];_0x185a15[_0x50f2('0x36')]=qs[_0x50f2('0x37')](_0x424171[_0x50f2('0x2e')][_0x50f2('0x37')]);_0x185a15[_0x50f2('0x38')]=qs[_0x50f2('0x2f')](_[_0x50f2('0x39')](_0x424171[_0x50f2('0x2e')],_0x21967c['filters']));if(_0x424171[_0x50f2('0x2e')][_0x50f2('0x3a')]){_0x185a15['where']=_[_0x50f2('0x3b')](_0x185a15[_0x50f2('0x38')],{'$or':_[_0x50f2('0x29')](_0x185a15[_0x50f2('0x30')],function(_0x163b64){var _0x54c6e9={};_0x54c6e9[_0x163b64]={'$like':'%'+_0x424171[_0x50f2('0x2e')]['filter']+'%'};return _0x54c6e9;})});}_0x185a15=_['merge']({},_0x185a15,_0x424171['options']);return _0x43aeba[_0x50f2('0x4c')](_0x185a15);}})['then'](function(_0x3546ec){if(_0x3546ec){_0xbca467=_0x3546ec[_0x50f2('0x33')];if(!_0x424171['query'][_0x50f2('0x34')](_0x50f2('0x35'))){_0x185a15['limit']=qs[_0x50f2('0x1c')](_0x424171['query'][_0x50f2('0x1c')]);_0x185a15['offset']=qs['offset'](_0x424171[_0x50f2('0x2e')][_0x50f2('0x1b')]);}return _0x43aeba['getSubjects'](_0x185a15);}})[_0x50f2('0x23')](function(_0x39bf12){if(_0x39bf12){return _0x39bf12?{'count':_0xbca467,'rows':_0x39bf12}:null;}})[_0x50f2('0x23')](respondWithResult(_0x44ea9e,null))['catch'](handleError(_0x44ea9e,null));};exports[_0x50f2('0x4d')]=function(_0x5946d3,_0x4907fa,_0x50f0ef){var _0x374b63={};var _0x2a3f14={};var _0x39e002;var _0x498c11;return db[_0x50f2('0x3f')]['findOne']({'where':{'id':_0x5946d3['params']['id']}})[_0x50f2('0x23')](handleEntityNotFound(_0x4907fa,null))['then'](function(_0x5a9e2d){if(_0x5a9e2d){_0x39e002=_0x5a9e2d;_0x2a3f14['model']=_[_0x50f2('0x2d')](db[_0x50f2('0x4a')][_0x50f2('0x2a')]);_0x2a3f14['query']=_[_0x50f2('0x2d')](_0x5946d3['query']);_0x2a3f14['filters']=_[_0x50f2('0x31')](_0x2a3f14['model'],_0x2a3f14['query']);_0x374b63[_0x50f2('0x30')]=_['intersection'](_0x2a3f14['model'],qs[_0x50f2('0x32')](_0x5946d3[_0x50f2('0x2e')][_0x50f2('0x32')]));_0x374b63[_0x50f2('0x30')]=_0x374b63['attributes'][_0x50f2('0x33')]?_0x374b63[_0x50f2('0x30')]:_0x2a3f14['model'];_0x374b63[_0x50f2('0x36')]=qs['sort'](_0x5946d3[_0x50f2('0x2e')][_0x50f2('0x37')]);_0x374b63[_0x50f2('0x38')]=qs[_0x50f2('0x2f')](_[_0x50f2('0x39')](_0x5946d3[_0x50f2('0x2e')],_0x2a3f14[_0x50f2('0x2f')]));if(_0x5946d3[_0x50f2('0x2e')]['filter']){_0x374b63[_0x50f2('0x38')]=_[_0x50f2('0x3b')](_0x374b63[_0x50f2('0x38')],{'$or':_[_0x50f2('0x29')](_0x374b63[_0x50f2('0x30')],function(_0x451e80){var _0x429a5d={};_0x429a5d[_0x451e80]={'$like':'%'+_0x5946d3[_0x50f2('0x2e')]['filter']+'%'};return _0x429a5d;})});}_0x374b63=_[_0x50f2('0x3b')]({},_0x374b63,_0x5946d3[_0x50f2('0x3e')]);return _0x39e002['getDescriptions'](_0x374b63);}})['then'](function(_0x8d3c20){if(_0x8d3c20){_0x498c11=_0x8d3c20[_0x50f2('0x33')];if(!_0x5946d3[_0x50f2('0x2e')][_0x50f2('0x34')](_0x50f2('0x35'))){_0x374b63[_0x50f2('0x1c')]=qs[_0x50f2('0x1c')](_0x5946d3[_0x50f2('0x2e')]['limit']);_0x374b63[_0x50f2('0x1b')]=qs[_0x50f2('0x1b')](_0x5946d3[_0x50f2('0x2e')][_0x50f2('0x1b')]);}return _0x39e002[_0x50f2('0x4d')](_0x374b63);}})['then'](function(_0x2f0a73){if(_0x2f0a73){return _0x2f0a73?{'count':_0x498c11,'rows':_0x2f0a73}:null;}})[_0x50f2('0x23')](respondWithResult(_0x4907fa,null))[_0x50f2('0x43')](handleError(_0x4907fa,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 45a0a87..a3a9de9 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 _0x9f62=['api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util'];(function(_0x2c5057,_0x5693cf){var _0x4f232c=function(_0x1e66f6){while(--_0x1e66f6){_0x2c5057['push'](_0x2c5057['shift']());}};_0x4f232c(++_0x5693cf);}(_0x9f62,0x154));var _0x29f6=function(_0x52e08a,_0x153b28){_0x52e08a=_0x52e08a-0x0;var _0x1dad9c=_0x9f62[_0x52e08a];return _0x1dad9c;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var logger=require('../../config/logger')(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var attributes=require(_0x29f6('0x6'));module[_0x29f6('0x7')]=function(_0x595034,_0xf66137){return _0x595034[_0x29f6('0x8')](_0x29f6('0x9'),attributes,{'tableName':_0x29f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x1853db,_0x1728dd){var _0x1b38ae=function(_0x568c83){while(--_0x568c83){_0x1853db['push'](_0x1853db['shift']());}};_0x1b38ae(++_0x1728dd);}(_0xa41a,0x6b));var _0xaa41=function(_0x16a122,_0xb23cb2){_0x16a122=_0x16a122-0x0;var _0x378fec=_0xa41a[_0x16a122];return _0x378fec;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 215f013..8ad632c 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 _0x96b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0xa601ef,_0x4209bf){var _0x1f385a=function(_0x4c31ca){while(--_0x4c31ca){_0xa601ef['push'](_0xa601ef['shift']());}};_0x1f385a(++_0x4209bf);}(_0x96b0,0x73));var _0x096b=function(_0x1e7a89,_0x4fcfb6){_0x1e7a89=_0x1e7a89-0x0;var _0x571a8a=_0x96b0[_0x1e7a89];return _0x571a8a;};'use strict';var _=require(_0x096b('0x0'));var util=require(_0x096b('0x1'));var moment=require('moment');var BPromise=require(_0x096b('0x2'));var rs=require(_0x096b('0x3'));var fs=require('fs');var Redis=require(_0x096b('0x4'));var db=require(_0x096b('0x5'))['db'];var utils=require(_0x096b('0x6'));var logger=require(_0x096b('0x7'))(_0x096b('0x8'));var config=require(_0x096b('0x9'));var jayson=require(_0x096b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3933e4,_0x39fd8b,_0x185636){return new BPromise(function(_0x35111e,_0x7e0497){return client[_0x096b('0xb')](_0x3933e4,_0x185636)[_0x096b('0xc')](function(_0x511cd4){logger['info'](_0x096b('0xd'),_0x39fd8b,_0x096b('0xe'));logger[_0x096b('0xf')](_0x096b('0x10'),_0x39fd8b,_0x096b('0xe'),JSON[_0x096b('0x11')](_0x511cd4));if(_0x511cd4[_0x096b('0x12')]){if(_0x511cd4[_0x096b('0x12')][_0x096b('0x13')]===0x1f4){logger['error'](_0x096b('0xd'),_0x39fd8b,_0x511cd4[_0x096b('0x12')][_0x096b('0x14')]);return _0x7e0497(_0x511cd4[_0x096b('0x12')]['message']);}logger[_0x096b('0x12')](_0x096b('0xd'),_0x39fd8b,_0x511cd4[_0x096b('0x12')]['message']);return _0x35111e(_0x511cd4[_0x096b('0x12')][_0x096b('0x14')]);}else{logger[_0x096b('0x15')](_0x096b('0xd'),_0x39fd8b,_0x096b('0xe'));_0x35111e(_0x511cd4[_0x096b('0x16')]['message']);}})[_0x096b('0x17')](function(_0x4455f1){logger[_0x096b('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x39fd8b,_0x4455f1);_0x7e0497(_0x4455f1);});});} \ No newline at end of file +var _0xa07f=['lodash','util','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x87a33e,_0x347583){var _0x4e258d=function(_0x962758){while(--_0x962758){_0x87a33e['push'](_0x87a33e['shift']());}};_0x4e258d(++_0x347583);}(_0xa07f,0x130));var _0xfa07=function(_0x3eb903,_0x5d6ddb){_0x3eb903=_0x3eb903-0x0;var _0x3ddb8e=_0xa07f[_0x3eb903];return _0x3ddb8e;};'use strict';var _=require(_0xfa07('0x0'));var util=require(_0xfa07('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfa07('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfa07('0x3'));var logger=require(_0xfa07('0x4'))('rpc');var config=require(_0xfa07('0x5'));var jayson=require(_0xfa07('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x17d70e,_0x4ac514,_0x2daff2){return new BPromise(function(_0x4ce69b,_0x5642c8){return client['request'](_0x17d70e,_0x2daff2)[_0xfa07('0x7')](function(_0x10aac0){logger[_0xfa07('0x8')](_0xfa07('0x9'),_0x4ac514,_0xfa07('0xa'));logger['debug'](_0xfa07('0xb'),_0x4ac514,_0xfa07('0xa'),JSON['stringify'](_0x10aac0));if(_0x10aac0['error']){if(_0x10aac0[_0xfa07('0xc')]['code']===0x1f4){logger[_0xfa07('0xc')](_0xfa07('0x9'),_0x4ac514,_0x10aac0[_0xfa07('0xc')][_0xfa07('0xd')]);return _0x5642c8(_0x10aac0[_0xfa07('0xc')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4ac514,_0x10aac0[_0xfa07('0xc')][_0xfa07('0xd')]);return _0x4ce69b(_0x10aac0[_0xfa07('0xc')][_0xfa07('0xd')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4ac514,_0xfa07('0xa'));_0x4ce69b(_0x10aac0[_0xfa07('0xe')][_0xfa07('0xd')]);}})[_0xfa07('0xf')](function(_0x59d795){logger['error'](_0xfa07('0x9'),_0x4ac514,_0x59d795);_0x5642c8(_0x59d795);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index fc320eb..1c3048a 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 _0x214f=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x214f,0x107));var _0xf214=function(_0x285a61,_0x3ac8bf){_0x285a61=_0x285a61-0x0;var _0x4c7352=_0x214f[_0x285a61];return _0x4c7352;};'use strict';var multer=require(_0xf214('0x0'));var util=require(_0xf214('0x1'));var path=require(_0xf214('0x2'));var timeout=require(_0xf214('0x3'));var express=require(_0xf214('0x4'));var router=express[_0xf214('0x5')]();var fs_extra=require(_0xf214('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf214('0x7'));var config=require(_0xf214('0x8'));var controller=require(_0xf214('0x9'));router[_0xf214('0xa')]('/',auth[_0xf214('0xb')](),controller[_0xf214('0xc')]);router['get']('/:id',auth[_0xf214('0xb')](),controller[_0xf214('0xd')]);router[_0xf214('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf214('0xf')](_0xf214('0x10'),auth[_0xf214('0xb')](),controller['update']);router['delete'](_0xf214('0x10'),auth[_0xf214('0xb')](),controller['destroy']);module[_0xf214('0x11')]=router; \ No newline at end of file +var _0xe87c=['get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0xe45118,_0x5dffbc){var _0x15e15d=function(_0x17eaec){while(--_0x17eaec){_0xe45118['push'](_0xe45118['shift']());}};_0x15e15d(++_0x5dffbc);}(_0xe87c,0xdc));var _0xce87=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xe87c[_0x101e7b];return _0x4995c0;};'use strict';var multer=require(_0xce87('0x0'));var util=require(_0xce87('0x1'));var path=require(_0xce87('0x2'));var timeout=require(_0xce87('0x3'));var express=require(_0xce87('0x4'));var router=express[_0xce87('0x5')]();var fs_extra=require(_0xce87('0x6'));var auth=require(_0xce87('0x7'));var interaction=require(_0xce87('0x8'));var config=require(_0xce87('0x9'));var controller=require(_0xce87('0xa'));router[_0xce87('0xb')]('/',auth[_0xce87('0xc')](),controller[_0xce87('0xd')]);router[_0xce87('0xb')](_0xce87('0xe'),auth[_0xce87('0xc')](),controller['show']);router[_0xce87('0xf')]('/',auth[_0xce87('0xc')](),controller[_0xce87('0x10')]);router[_0xce87('0x11')]('/:id',auth[_0xce87('0xc')](),controller[_0xce87('0x12')]);router[_0xce87('0x13')](_0xce87('0xe'),auth[_0xce87('0xc')](),controller['destroy']);module[_0xce87('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 94f06b4..ed355c1 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 _0x94bf=['ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','string','STRING'];(function(_0x11d684,_0x4d4123){var _0x78a301=function(_0x1a1966){while(--_0x1a1966){_0x11d684['push'](_0x11d684['shift']());}};_0x78a301(++_0x4d4123);}(_0x94bf,0xfe));var _0xf94b=function(_0x53a27b,_0x2bca00){_0x53a27b=_0x53a27b-0x0;var _0x25988b=_0x94bf[_0x53a27b];return _0x25988b;};'use strict';var Sequelize=require(_0xf94b('0x0'));module[_0xf94b('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf94b('0x2'),_0xf94b('0x3'),_0xf94b('0x4'),'picklist'),'defaultValue':_0xf94b('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf94b('0x6')]},'keyType':{'type':Sequelize[_0xf94b('0x7')](_0xf94b('0x5'),'variable',_0xf94b('0x3'))},'keyContent':{'type':Sequelize[_0xf94b('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf94b('0x6')]},'customField':{'type':Sequelize[_0xf94b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf94b('0x6')]}}; \ No newline at end of file +var _0x1e0f=['picklist','STRING','sequelize','exports','ENUM','variable','keyValue'];(function(_0x3c03c0,_0x5346bc){var _0x55bff2=function(_0x10104c){while(--_0x10104c){_0x3c03c0['push'](_0x3c03c0['shift']());}};_0x55bff2(++_0x5346bc);}(_0x1e0f,0x10c));var _0xf1e0=function(_0x9c9cbf,_0xf7f2bb){_0x9c9cbf=_0x9c9cbf-0x0;var _0x30f023=_0x1e0f[_0x9c9cbf];return _0x30f023;};'use strict';var Sequelize=require(_0xf1e0('0x0'));module[_0xf1e0('0x1')]={'type':{'type':Sequelize[_0xf1e0('0x2')]('string',_0xf1e0('0x3'),'customVariable',_0xf1e0('0x4'),_0xf1e0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf1e0('0x6')]},'key':{'type':Sequelize[_0xf1e0('0x6')]},'keyType':{'type':Sequelize[_0xf1e0('0x2')]('string',_0xf1e0('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xf1e0('0x6')]},'idField':{'type':Sequelize[_0xf1e0('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 52e593a..06f8a43 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 _0xb19b=['name','send','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack'];(function(_0x38d50b,_0x22a0e3){var _0x252201=function(_0x3c6800){while(--_0x3c6800){_0x38d50b['push'](_0x38d50b['shift']());}};_0x252201(++_0x22a0e3);}(_0xb19b,0x15f));var _0xbb19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb19b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbb19('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb19('0x1'));var jsonpatch=require(_0xbb19('0x2'));var rp=require('request-promise');var moment=require(_0xbb19('0x3'));var BPromise=require(_0xbb19('0x4'));var Mustache=require('mustache');var util=require(_0xbb19('0x5'));var path=require(_0xbb19('0x6'));var sox=require(_0xbb19('0x7'));var csv=require(_0xbb19('0x8'));var ejs=require(_0xbb19('0x9'));var fs=require('fs');var fs_extra=require(_0xbb19('0xa'));var _=require(_0xbb19('0xb'));var squel=require(_0xbb19('0xc'));var crypto=require(_0xbb19('0xd'));var jsforce=require(_0xbb19('0xe'));var deskjs=require(_0xbb19('0xf'));var toCsv=require(_0xbb19('0x8'));var querystring=require(_0xbb19('0x10'));var Papa=require('papaparse');var Redis=require(_0xbb19('0x11'));var authService=require(_0xbb19('0x12'));var qs=require(_0xbb19('0x13'));var as=require(_0xbb19('0x14'));var hardwareService=require(_0xbb19('0x15'));var logger=require(_0xbb19('0x16'))(_0xbb19('0x17'));var utils=require(_0xbb19('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbb19('0x19'));var db=require(_0xbb19('0x1a'))['db'];function respondWithStatusCode(_0x278599,_0xe39c42){_0xe39c42=_0xe39c42||0xcc;return function(_0x563e9b){if(_0x563e9b){return _0x278599[_0xbb19('0x1b')](_0xe39c42);}return _0x278599[_0xbb19('0x1c')](_0xe39c42)[_0xbb19('0x1d')]();};}function respondWithResult(_0x1ab2c2,_0x4c9a6d){_0x4c9a6d=_0x4c9a6d||0xc8;return function(_0x4db21b){if(_0x4db21b){return _0x1ab2c2[_0xbb19('0x1c')](_0x4c9a6d)[_0xbb19('0x1e')](_0x4db21b);}};}function respondWithFilteredResult(_0xd7ac76,_0x2cbb9c){return function(_0x4836c9){if(_0x4836c9){var _0x3c4563=typeof _0x2cbb9c['offset']===_0xbb19('0x1f')&&typeof _0x2cbb9c['limit']===_0xbb19('0x1f');var _0x1cd0bf=_0x4836c9[_0xbb19('0x20')];var _0x3c8fa5=_0x3c4563?0x0:_0x2cbb9c[_0xbb19('0x21')];var _0x252350=_0x3c4563?_0x4836c9[_0xbb19('0x20')]:_0x2cbb9c[_0xbb19('0x21')]+_0x2cbb9c[_0xbb19('0x22')];var _0x3a079c;if(_0x252350>=_0x1cd0bf){_0x252350=_0x1cd0bf;_0x3a079c=0xc8;}else{_0x3a079c=0xce;}_0xd7ac76[_0xbb19('0x1c')](_0x3a079c);return _0xd7ac76[_0xbb19('0x23')](_0xbb19('0x24'),_0x3c8fa5+'-'+_0x252350+'/'+_0x1cd0bf)[_0xbb19('0x1e')](_0x4836c9);}return null;};}function patchUpdates(_0x55ef44){return function(_0x520d6){try{jsonpatch[_0xbb19('0x25')](_0x520d6,_0x55ef44,!![]);}catch(_0x2cf771){return BPromise[_0xbb19('0x26')](_0x2cf771);}return _0x520d6[_0xbb19('0x27')]();};}function saveUpdates(_0xeeb8bc,_0x388276){return function(_0x42aa50){if(_0x42aa50){return _0x42aa50[_0xbb19('0x28')](_0xeeb8bc)[_0xbb19('0x29')](function(_0x108782){return _0x108782;});}return null;};}function removeEntity(_0xd3d962,_0x24a3fe){return function(_0x289141){if(_0x289141){return _0x289141[_0xbb19('0x2a')]()[_0xbb19('0x29')](function(){_0xd3d962['status'](0xcc)[_0xbb19('0x1d')]();});}};}function handleEntityNotFound(_0x2d3cef,_0x29a46a){return function(_0x199f7a){if(!_0x199f7a){_0x2d3cef['sendStatus'](0x194);}return _0x199f7a;};}function handleError(_0x185001,_0x465010){_0x465010=_0x465010||0x1f4;return function(_0x547e0d){logger['error'](_0x547e0d[_0xbb19('0x2b')]);if(_0x547e0d[_0xbb19('0x2c')]){delete _0x547e0d[_0xbb19('0x2c')];}_0x185001[_0xbb19('0x1c')](_0x465010)[_0xbb19('0x2d')](_0x547e0d);};}exports['index']=function(_0x3ff871,_0x2aa6e9){var _0x5ac79f={},_0x410158={},_0x1ea2a5={'count':0x0,'rows':[]};var _0x24fe31=_[_0xbb19('0x2e')](db[_0xbb19('0x2f')][_0xbb19('0x30')],function(_0x4f00e7){return{'name':_0x4f00e7[_0xbb19('0x31')],'type':_0x4f00e7[_0xbb19('0x32')][_0xbb19('0x33')]};});_0x410158[_0xbb19('0x34')]=_[_0xbb19('0x2e')](_0x24fe31,_0xbb19('0x2c'));_0x410158[_0xbb19('0x35')]=_[_0xbb19('0x36')](_0x3ff871['query']);_0x410158[_0xbb19('0x37')]=_['intersection'](_0x410158['model'],_0x410158['query']);_0x5ac79f[_0xbb19('0x38')]=_[_0xbb19('0x39')](_0x410158[_0xbb19('0x34')],qs['fields'](_0x3ff871[_0xbb19('0x35')][_0xbb19('0x3a')]));_0x5ac79f[_0xbb19('0x38')]=_0x5ac79f[_0xbb19('0x38')][_0xbb19('0x3b')]?_0x5ac79f[_0xbb19('0x38')]:_0x410158['model'];if(!_0x3ff871[_0xbb19('0x35')][_0xbb19('0x3c')](_0xbb19('0x3d'))){_0x5ac79f['limit']=qs[_0xbb19('0x22')](_0x3ff871[_0xbb19('0x35')]['limit']);_0x5ac79f[_0xbb19('0x21')]=qs['offset'](_0x3ff871[_0xbb19('0x35')][_0xbb19('0x21')]);}_0x5ac79f[_0xbb19('0x3e')]=qs[_0xbb19('0x3f')](_0x3ff871[_0xbb19('0x35')][_0xbb19('0x3f')]);_0x5ac79f[_0xbb19('0x40')]=qs[_0xbb19('0x37')](_[_0xbb19('0x41')](_0x3ff871[_0xbb19('0x35')],_0x410158['filters']),_0x24fe31);if(_0x3ff871[_0xbb19('0x35')][_0xbb19('0x42')]){_0x5ac79f[_0xbb19('0x40')]=_[_0xbb19('0x43')](_0x5ac79f['where'],{'$or':_['map'](_0x24fe31,function(_0x4f4406){if(_0x4f4406['type']!==_0xbb19('0x44')){var _0x587835={};_0x587835[_0x4f4406[_0xbb19('0x2c')]]={'$like':'%'+_0x3ff871[_0xbb19('0x35')]['filter']+'%'};return _0x587835;}})});}_0x5ac79f=_[_0xbb19('0x43')]({},_0x5ac79f,_0x3ff871[_0xbb19('0x45')]);var _0x4db20c={'where':_0x5ac79f['where']};return db[_0xbb19('0x2f')][_0xbb19('0x20')](_0x4db20c)['then'](function(_0x5a9999){_0x1ea2a5[_0xbb19('0x20')]=_0x5a9999;if(_0x3ff871['query'][_0xbb19('0x46')]){_0x5ac79f[_0xbb19('0x47')]=[{'all':!![]}];}return db[_0xbb19('0x2f')][_0xbb19('0x48')](_0x5ac79f);})[_0xbb19('0x29')](function(_0x5ae4ad){_0x1ea2a5['rows']=_0x5ae4ad;return _0x1ea2a5;})[_0xbb19('0x29')](respondWithFilteredResult(_0x2aa6e9,_0x5ac79f))[_0xbb19('0x49')](handleError(_0x2aa6e9,null));};exports[_0xbb19('0x4a')]=function(_0x415602,_0x2bd6e6){var _0x3654d2={'raw':!![],'where':{'id':_0x415602['params']['id']}},_0x39d534={};_0x39d534['model']=_[_0xbb19('0x36')](db[_0xbb19('0x2f')]['rawAttributes']);_0x39d534['query']=_[_0xbb19('0x36')](_0x415602[_0xbb19('0x35')]);_0x39d534[_0xbb19('0x37')]=_[_0xbb19('0x39')](_0x39d534['model'],_0x39d534['query']);_0x3654d2[_0xbb19('0x38')]=_[_0xbb19('0x39')](_0x39d534['model'],qs[_0xbb19('0x3a')](_0x415602[_0xbb19('0x35')][_0xbb19('0x3a')]));_0x3654d2[_0xbb19('0x38')]=_0x3654d2['attributes']['length']?_0x3654d2[_0xbb19('0x38')]:_0x39d534[_0xbb19('0x34')];if(_0x415602[_0xbb19('0x35')][_0xbb19('0x46')]){_0x3654d2[_0xbb19('0x47')]=[{'all':!![]}];}_0x3654d2=_['merge']({},_0x3654d2,_0x415602['options']);return db['Dynamics365Field'][_0xbb19('0x4b')](_0x3654d2)[_0xbb19('0x29')](handleEntityNotFound(_0x2bd6e6,null))[_0xbb19('0x29')](respondWithResult(_0x2bd6e6,null))[_0xbb19('0x49')](handleError(_0x2bd6e6,null));};exports['create']=function(_0xe71053,_0x4172a2){return db[_0xbb19('0x2f')][_0xbb19('0x4c')](_0xe71053['body'],{})[_0xbb19('0x29')](respondWithResult(_0x4172a2,0xc9))[_0xbb19('0x49')](handleError(_0x4172a2,null));};exports['update']=function(_0x3edd77,_0x205034){if(_0x3edd77['body']['id']){delete _0x3edd77[_0xbb19('0x4d')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x3edd77['params']['id']}})[_0xbb19('0x29')](handleEntityNotFound(_0x205034,null))['then'](saveUpdates(_0x3edd77[_0xbb19('0x4d')],null))['then'](respondWithResult(_0x205034,null))[_0xbb19('0x49')](handleError(_0x205034,null));};exports[_0xbb19('0x2a')]=function(_0x501d63,_0x44e7a4){return db[_0xbb19('0x2f')][_0xbb19('0x4b')]({'where':{'id':_0x501d63[_0xbb19('0x4e')]['id']}})[_0xbb19('0x29')](handleEntityNotFound(_0x44e7a4,null))['then'](removeEntity(_0x44e7a4,null))[_0xbb19('0x49')](handleError(_0x44e7a4,null));}; \ No newline at end of file +var _0x98ad=['params','keys','intersection','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','index','map','Dynamics365Field','rawAttributes','type','model','query','filters','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','includeAll','findAll','catch','show'];(function(_0x2fc2ae,_0xb65332){var _0x173be4=function(_0x2bfd28){while(--_0x2bfd28){_0x2fc2ae['push'](_0x2fc2ae['shift']());}};_0x173be4(++_0xb65332);}(_0x98ad,0x12c));var _0xd98a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x98ad[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require(_0xd98a('0x0'));var rimraf=require(_0xd98a('0x1'));var zipdir=require(_0xd98a('0x2'));var jsonpatch=require(_0xd98a('0x3'));var rp=require(_0xd98a('0x4'));var moment=require(_0xd98a('0x5'));var BPromise=require(_0xd98a('0x6'));var Mustache=require(_0xd98a('0x7'));var util=require(_0xd98a('0x8'));var path=require('path');var sox=require(_0xd98a('0x9'));var csv=require(_0xd98a('0xa'));var ejs=require(_0xd98a('0xb'));var fs=require('fs');var fs_extra=require(_0xd98a('0xc'));var _=require(_0xd98a('0xd'));var squel=require(_0xd98a('0xe'));var crypto=require('crypto');var jsforce=require(_0xd98a('0xf'));var deskjs=require(_0xd98a('0x10'));var toCsv=require(_0xd98a('0xa'));var querystring=require(_0xd98a('0x11'));var Papa=require('papaparse');var Redis=require(_0xd98a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd98a('0x13'));var as=require(_0xd98a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd98a('0x15'))(_0xd98a('0x16'));var utils=require(_0xd98a('0x17'));var config=require(_0xd98a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd98a('0x19'))['db'];function respondWithStatusCode(_0x30c309,_0x26c16d){_0x26c16d=_0x26c16d||0xcc;return function(_0x15f73c){if(_0x15f73c){return _0x30c309['sendStatus'](_0x26c16d);}return _0x30c309[_0xd98a('0x1a')](_0x26c16d)[_0xd98a('0x1b')]();};}function respondWithResult(_0x7ec6ee,_0x35df2b){_0x35df2b=_0x35df2b||0xc8;return function(_0x144537){if(_0x144537){return _0x7ec6ee[_0xd98a('0x1a')](_0x35df2b)[_0xd98a('0x1c')](_0x144537);}};}function respondWithFilteredResult(_0x408c2a,_0xf73e7a){return function(_0x5a72e1){if(_0x5a72e1){var _0x3562ed=typeof _0xf73e7a[_0xd98a('0x1d')]===_0xd98a('0x1e')&&typeof _0xf73e7a[_0xd98a('0x1f')]==='undefined';var _0x57816c=_0x5a72e1[_0xd98a('0x20')];var _0x5d91d6=_0x3562ed?0x0:_0xf73e7a[_0xd98a('0x1d')];var _0x4f2a9b=_0x3562ed?_0x5a72e1[_0xd98a('0x20')]:_0xf73e7a[_0xd98a('0x1d')]+_0xf73e7a[_0xd98a('0x1f')];var _0x237238;if(_0x4f2a9b>=_0x57816c){_0x4f2a9b=_0x57816c;_0x237238=0xc8;}else{_0x237238=0xce;}_0x408c2a[_0xd98a('0x1a')](_0x237238);return _0x408c2a[_0xd98a('0x21')](_0xd98a('0x22'),_0x5d91d6+'-'+_0x4f2a9b+'/'+_0x57816c)['json'](_0x5a72e1);}return null;};}function patchUpdates(_0x2444bc){return function(_0x59753f){try{jsonpatch['apply'](_0x59753f,_0x2444bc,!![]);}catch(_0x34282f){return BPromise[_0xd98a('0x23')](_0x34282f);}return _0x59753f[_0xd98a('0x24')]();};}function saveUpdates(_0x4f0dab,_0x459794){return function(_0x5a7cc4){if(_0x5a7cc4){return _0x5a7cc4[_0xd98a('0x25')](_0x4f0dab)[_0xd98a('0x26')](function(_0x5a3795){return _0x5a3795;});}return null;};}function removeEntity(_0x38a828,_0x5a885b){return function(_0x245bcf){if(_0x245bcf){return _0x245bcf['destroy']()[_0xd98a('0x26')](function(){_0x38a828[_0xd98a('0x1a')](0xcc)[_0xd98a('0x1b')]();});}};}function handleEntityNotFound(_0x1329be,_0x12004e){return function(_0x7b99c8){if(!_0x7b99c8){_0x1329be[_0xd98a('0x27')](0x194);}return _0x7b99c8;};}function handleError(_0x5b267b,_0x3c464f){_0x3c464f=_0x3c464f||0x1f4;return function(_0x3bf54e){logger[_0xd98a('0x28')](_0x3bf54e[_0xd98a('0x29')]);if(_0x3bf54e[_0xd98a('0x2a')]){delete _0x3bf54e[_0xd98a('0x2a')];}_0x5b267b[_0xd98a('0x1a')](_0x3c464f)['send'](_0x3bf54e);};}exports[_0xd98a('0x2b')]=function(_0x3897e1,_0x405b24){var _0x3e06f8={},_0x818cbe={},_0x1d03c1={'count':0x0,'rows':[]};var _0x3e9afa=_[_0xd98a('0x2c')](db[_0xd98a('0x2d')][_0xd98a('0x2e')],function(_0x223afd){return{'name':_0x223afd['fieldName'],'type':_0x223afd[_0xd98a('0x2f')]['key']};});_0x818cbe[_0xd98a('0x30')]=_[_0xd98a('0x2c')](_0x3e9afa,_0xd98a('0x2a'));_0x818cbe['query']=_['keys'](_0x3897e1[_0xd98a('0x31')]);_0x818cbe[_0xd98a('0x32')]=_['intersection'](_0x818cbe[_0xd98a('0x30')],_0x818cbe['query']);_0x3e06f8[_0xd98a('0x33')]=_['intersection'](_0x818cbe[_0xd98a('0x30')],qs[_0xd98a('0x34')](_0x3897e1[_0xd98a('0x31')][_0xd98a('0x34')]));_0x3e06f8[_0xd98a('0x33')]=_0x3e06f8[_0xd98a('0x33')][_0xd98a('0x35')]?_0x3e06f8[_0xd98a('0x33')]:_0x818cbe['model'];if(!_0x3897e1['query'][_0xd98a('0x36')]('nolimit')){_0x3e06f8['limit']=qs[_0xd98a('0x1f')](_0x3897e1[_0xd98a('0x31')][_0xd98a('0x1f')]);_0x3e06f8[_0xd98a('0x1d')]=qs['offset'](_0x3897e1[_0xd98a('0x31')]['offset']);}_0x3e06f8['order']=qs['sort'](_0x3897e1[_0xd98a('0x31')][_0xd98a('0x37')]);_0x3e06f8['where']=qs[_0xd98a('0x32')](_[_0xd98a('0x38')](_0x3897e1[_0xd98a('0x31')],_0x818cbe[_0xd98a('0x32')]),_0x3e9afa);if(_0x3897e1[_0xd98a('0x31')][_0xd98a('0x39')]){_0x3e06f8[_0xd98a('0x3a')]=_[_0xd98a('0x3b')](_0x3e06f8[_0xd98a('0x3a')],{'$or':_[_0xd98a('0x2c')](_0x3e9afa,function(_0x352a4d){if(_0x352a4d['type']!=='VIRTUAL'){var _0x33a706={};_0x33a706[_0x352a4d[_0xd98a('0x2a')]]={'$like':'%'+_0x3897e1[_0xd98a('0x31')][_0xd98a('0x39')]+'%'};return _0x33a706;}})});}_0x3e06f8=_[_0xd98a('0x3b')]({},_0x3e06f8,_0x3897e1[_0xd98a('0x3c')]);var _0x2df708={'where':_0x3e06f8[_0xd98a('0x3a')]};return db[_0xd98a('0x2d')][_0xd98a('0x20')](_0x2df708)[_0xd98a('0x26')](function(_0x4495e5){_0x1d03c1[_0xd98a('0x20')]=_0x4495e5;if(_0x3897e1[_0xd98a('0x31')][_0xd98a('0x3d')]){_0x3e06f8['include']=[{'all':!![]}];}return db[_0xd98a('0x2d')][_0xd98a('0x3e')](_0x3e06f8);})[_0xd98a('0x26')](function(_0x1c8b9a){_0x1d03c1['rows']=_0x1c8b9a;return _0x1d03c1;})[_0xd98a('0x26')](respondWithFilteredResult(_0x405b24,_0x3e06f8))[_0xd98a('0x3f')](handleError(_0x405b24,null));};exports[_0xd98a('0x40')]=function(_0x3f4153,_0x1d1f69){var _0x4009b0={'raw':!![],'where':{'id':_0x3f4153[_0xd98a('0x41')]['id']}},_0x2b6712={};_0x2b6712[_0xd98a('0x30')]=_[_0xd98a('0x42')](db['Dynamics365Field'][_0xd98a('0x2e')]);_0x2b6712[_0xd98a('0x31')]=_[_0xd98a('0x42')](_0x3f4153[_0xd98a('0x31')]);_0x2b6712['filters']=_[_0xd98a('0x43')](_0x2b6712[_0xd98a('0x30')],_0x2b6712['query']);_0x4009b0['attributes']=_[_0xd98a('0x43')](_0x2b6712[_0xd98a('0x30')],qs[_0xd98a('0x34')](_0x3f4153[_0xd98a('0x31')][_0xd98a('0x34')]));_0x4009b0[_0xd98a('0x33')]=_0x4009b0[_0xd98a('0x33')][_0xd98a('0x35')]?_0x4009b0['attributes']:_0x2b6712[_0xd98a('0x30')];if(_0x3f4153[_0xd98a('0x31')][_0xd98a('0x3d')]){_0x4009b0[_0xd98a('0x44')]=[{'all':!![]}];}_0x4009b0=_[_0xd98a('0x3b')]({},_0x4009b0,_0x3f4153[_0xd98a('0x3c')]);return db['Dynamics365Field'][_0xd98a('0x45')](_0x4009b0)[_0xd98a('0x26')](handleEntityNotFound(_0x1d1f69,null))['then'](respondWithResult(_0x1d1f69,null))['catch'](handleError(_0x1d1f69,null));};exports['create']=function(_0x1a4df1,_0xb9e4c1){return db['Dynamics365Field'][_0xd98a('0x46')](_0x1a4df1[_0xd98a('0x47')],{})[_0xd98a('0x26')](respondWithResult(_0xb9e4c1,0xc9))[_0xd98a('0x3f')](handleError(_0xb9e4c1,null));};exports[_0xd98a('0x25')]=function(_0x1fc3e5,_0x516566){if(_0x1fc3e5[_0xd98a('0x47')]['id']){delete _0x1fc3e5['body']['id'];}return db['Dynamics365Field'][_0xd98a('0x45')]({'where':{'id':_0x1fc3e5[_0xd98a('0x41')]['id']}})[_0xd98a('0x26')](handleEntityNotFound(_0x516566,null))['then'](saveUpdates(_0x1fc3e5[_0xd98a('0x47')],null))[_0xd98a('0x26')](respondWithResult(_0x516566,null))[_0xd98a('0x3f')](handleError(_0x516566,null));};exports[_0xd98a('0x48')]=function(_0x14b814,_0x490ae3){return db[_0xd98a('0x2d')][_0xd98a('0x45')]({'where':{'id':_0x14b814[_0xd98a('0x41')]['id']}})['then'](handleEntityNotFound(_0x490ae3,null))[_0xd98a('0x26')](removeEntity(_0x490ae3,null))[_0xd98a('0x3f')](handleError(_0x490ae3,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 2f882ef..f2d8ec7 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 _0x337b=['util','api','moment','rimraf','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash'];(function(_0xd25638,_0xa02e77){var _0x1096f1=function(_0x3ad00f){while(--_0x3ad00f){_0xd25638['push'](_0xd25638['shift']());}};_0x1096f1(++_0xa02e77);}(_0x337b,0x196));var _0xb337=function(_0x4969c1,_0x411cdc){_0x4969c1=_0x4969c1-0x0;var _0x10299c=_0x337b[_0x4969c1];return _0x10299c;};'use strict';var _=require(_0xb337('0x0'));var util=require(_0xb337('0x1'));var logger=require('../../config/logger')(_0xb337('0x2'));var moment=require(_0xb337('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb337('0x4'));var config=require('../../config/environment');var attributes=require(_0xb337('0x5'));module[_0xb337('0x6')]=function(_0x57697f,_0x35232e){return _0x57697f[_0xb337('0x7')]('Dynamics365Field',attributes,{'tableName':_0xb337('0x8'),'paranoid':![],'indexes':[{'name':_0xb337('0x9'),'fields':['idField',_0xb337('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xab22=['idField','FieldId','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x2460d9,_0x15da87){var _0x4bc204=function(_0x40bbce){while(--_0x40bbce){_0x2460d9['push'](_0x2460d9['shift']());}};_0x4bc204(++_0x15da87);}(_0xab22,0x17b));var _0x2ab2=function(_0x94717,_0x31f7ff){_0x94717=_0x94717-0x0;var _0x310912=_0xab22[_0x94717];return _0x310912;};'use strict';var _=require('lodash');var util=require(_0x2ab2('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2ab2('0x1'));var rp=require(_0x2ab2('0x2'));var fs=require('fs');var path=require(_0x2ab2('0x3'));var rimraf=require(_0x2ab2('0x4'));var config=require(_0x2ab2('0x5'));var attributes=require('./intDynamics365Field.attributes');module[_0x2ab2('0x6')]=function(_0x8b764a,_0x428675){return _0x8b764a[_0x2ab2('0x7')](_0x2ab2('0x8'),attributes,{'tableName':_0x2ab2('0x9'),'paranoid':![],'indexes':[{'name':_0x2ab2('0xa'),'fields':[_0x2ab2('0xb'),_0x2ab2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 0c530ba..5e43751 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 _0x2dda=['catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Dynamics365Field,\x20%s,\x20%s','result'];(function(_0x3f14a4,_0x32e87e){var _0x5e5954=function(_0x504927){while(--_0x504927){_0x3f14a4['push'](_0x3f14a4['shift']());}};_0x5e5954(++_0x32e87e);}(_0x2dda,0x85));var _0xa2dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dda[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa2dd('0x0'));var util=require(_0xa2dd('0x1'));var moment=require('moment');var BPromise=require(_0xa2dd('0x2'));var rs=require(_0xa2dd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa2dd('0x4'));var logger=require(_0xa2dd('0x5'))('rpc');var config=require(_0xa2dd('0x6'));var jayson=require(_0xa2dd('0x7'));var client=jayson[_0xa2dd('0x8')][_0xa2dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c054b,_0xd54393,_0x93e061){return new BPromise(function(_0x499f1f,_0xf687ee){return client[_0xa2dd('0xa')](_0x3c054b,_0x93e061)['then'](function(_0x348470){logger[_0xa2dd('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0xd54393,_0xa2dd('0xc'));logger[_0xa2dd('0xd')](_0xa2dd('0xe'),_0xd54393,_0xa2dd('0xc'),JSON[_0xa2dd('0xf')](_0x348470));if(_0x348470['error']){if(_0x348470['error'][_0xa2dd('0x10')]===0x1f4){logger[_0xa2dd('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xd54393,_0x348470[_0xa2dd('0x11')][_0xa2dd('0x12')]);return _0xf687ee(_0x348470[_0xa2dd('0x11')]['message']);}logger[_0xa2dd('0x11')](_0xa2dd('0x13'),_0xd54393,_0x348470[_0xa2dd('0x11')][_0xa2dd('0x12')]);return _0x499f1f(_0x348470['error'][_0xa2dd('0x12')]);}else{logger[_0xa2dd('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0xd54393,_0xa2dd('0xc'));_0x499f1f(_0x348470[_0xa2dd('0x14')][_0xa2dd('0x12')]);}})[_0xa2dd('0x15')](function(_0xe0d0f7){logger[_0xa2dd('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0xd54393,_0xe0d0f7);_0xf687ee(_0xe0d0f7);});});} \ No newline at end of file +var _0xd5cc=['code','error','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xd2713b,_0x3d3bec){var _0x2d5621=function(_0x2ef3dc){while(--_0x2ef3dc){_0xd2713b['push'](_0xd2713b['shift']());}};_0x2d5621(++_0x3d3bec);}(_0xd5cc,0x130));var _0xcd5c=function(_0x51497c,_0x54c9d1){_0x51497c=_0x51497c-0x0;var _0x1197f1=_0xd5cc[_0x51497c];return _0x1197f1;};'use strict';var _=require(_0xcd5c('0x0'));var util=require(_0xcd5c('0x1'));var moment=require(_0xcd5c('0x2'));var BPromise=require(_0xcd5c('0x3'));var rs=require(_0xcd5c('0x4'));var fs=require('fs');var Redis=require(_0xcd5c('0x5'));var db=require(_0xcd5c('0x6'))['db'];var utils=require(_0xcd5c('0x7'));var logger=require(_0xcd5c('0x8'))(_0xcd5c('0x9'));var config=require(_0xcd5c('0xa'));var jayson=require(_0xcd5c('0xb'));var client=jayson[_0xcd5c('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe5fd4e,_0x70ed9b,_0x40df8d){return new BPromise(function(_0x58bf75,_0x415814){return client['request'](_0xe5fd4e,_0x40df8d)['then'](function(_0x59f9f3){logger[_0xcd5c('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x70ed9b,_0xcd5c('0xe'));logger[_0xcd5c('0xf')](_0xcd5c('0x10'),_0x70ed9b,_0xcd5c('0xe'),JSON[_0xcd5c('0x11')](_0x59f9f3));if(_0x59f9f3['error']){if(_0x59f9f3['error'][_0xcd5c('0x12')]===0x1f4){logger[_0xcd5c('0x13')](_0xcd5c('0x14'),_0x70ed9b,_0x59f9f3[_0xcd5c('0x13')]['message']);return _0x415814(_0x59f9f3[_0xcd5c('0x13')][_0xcd5c('0x15')]);}logger[_0xcd5c('0x13')](_0xcd5c('0x14'),_0x70ed9b,_0x59f9f3[_0xcd5c('0x13')][_0xcd5c('0x15')]);return _0x58bf75(_0x59f9f3['error'][_0xcd5c('0x15')]);}else{logger[_0xcd5c('0xd')](_0xcd5c('0x14'),_0x70ed9b,_0xcd5c('0xe'));_0x58bf75(_0x59f9f3[_0xcd5c('0x16')]['message']);}})['catch'](function(_0x5496be){logger[_0xcd5c('0x13')](_0xcd5c('0x14'),_0x70ed9b,_0x5496be);_0x415814(_0x5496be);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 5d1acf8..16284ae 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 _0x3ba0=['destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x3ba0,0x6a));var _0x03ba=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3ba0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x03ba('0x0'));var util=require(_0x03ba('0x1'));var path=require(_0x03ba('0x2'));var timeout=require('connect-timeout');var express=require(_0x03ba('0x3'));var router=express['Router']();var fs_extra=require(_0x03ba('0x4'));var auth=require(_0x03ba('0x5'));var interaction=require(_0x03ba('0x6'));var config=require('../../config/environment');var controller=require(_0x03ba('0x7'));router[_0x03ba('0x8')]('/',auth[_0x03ba('0x9')](),controller['index']);router[_0x03ba('0x8')](_0x03ba('0xa'),auth[_0x03ba('0x9')](),controller[_0x03ba('0xb')]);router[_0x03ba('0x8')](_0x03ba('0xc'),auth[_0x03ba('0x9')](),controller[_0x03ba('0xd')]);router['get'](_0x03ba('0xe'),auth[_0x03ba('0x9')](),controller[_0x03ba('0xf')]);router[_0x03ba('0x10')]('/',auth[_0x03ba('0x9')](),controller[_0x03ba('0x11')]);router[_0x03ba('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x03ba('0x12')]);router[_0x03ba('0x13')](_0x03ba('0xa'),auth[_0x03ba('0x9')](),controller['update']);router['delete'](_0x03ba('0xa'),auth[_0x03ba('0x9')](),controller[_0x03ba('0x14')]);module['exports']=router; \ No newline at end of file +var _0x74dd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','/:id','show','get','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x74dd,0x1bc));var _0xd74d=function(_0x5491e5,_0x37a869){_0x5491e5=_0x5491e5-0x0;var _0x214eb5=_0x74dd[_0x5491e5];return _0x214eb5;};'use strict';var multer=require(_0xd74d('0x0'));var util=require(_0xd74d('0x1'));var path=require(_0xd74d('0x2'));var timeout=require(_0xd74d('0x3'));var express=require(_0xd74d('0x4'));var router=express[_0xd74d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd74d('0x6'));var interaction=require(_0xd74d('0x7'));var config=require(_0xd74d('0x8'));var controller=require(_0xd74d('0x9'));router['get']('/',auth[_0xd74d('0xa')](),controller[_0xd74d('0xb')]);router['get'](_0xd74d('0xc'),auth['isAuthenticated'](),controller[_0xd74d('0xd')]);router[_0xd74d('0xe')]('/:id/configurations',auth[_0xd74d('0xa')](),controller[_0xd74d('0xf')]);router['get'](_0xd74d('0x10'),auth[_0xd74d('0xa')](),controller[_0xd74d('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd74d('0x12')]);router['post'](_0xd74d('0x13'),auth[_0xd74d('0xa')](),controller[_0xd74d('0x14')]);router['put'](_0xd74d('0xc'),auth[_0xd74d('0xa')](),controller[_0xd74d('0x15')]);router[_0xd74d('0x16')](_0xd74d('0xc'),auth[_0xd74d('0xa')](),controller[_0xd74d('0x17')]);module[_0xd74d('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 412a95a..ba0200e 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 _0x5f2f=['exports','STRING','username','sequelize'];(function(_0x118789,_0x9f069e){var _0x46b453=function(_0x374dcb){while(--_0x374dcb){_0x118789['push'](_0x118789['shift']());}};_0x46b453(++_0x9f069e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x515538,_0x5065b0){_0x515538=_0x515538-0x0;var _0x246a59=_0x5f2f[_0x515538];return _0x246a59;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'name':{'type':Sequelize[_0xf5f2('0x2')]},'description':{'type':Sequelize[_0xf5f2('0x2')]},'username':{'type':Sequelize[_0xf5f2('0x2')],'unique':_0xf5f2('0x3')},'apiKey':{'type':Sequelize[_0xf5f2('0x2')]},'remoteUri':{'type':Sequelize[_0xf5f2('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x8aad=['STRING','username','sequelize','exports'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8aad,0x146));var _0xd8aa=function(_0x365ae6,_0x58eca3){_0x365ae6=_0x365ae6-0x0;var _0x102c07=_0x8aad[_0x365ae6];return _0x102c07;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8aa('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xd8aa('0x3')},'apiKey':{'type':Sequelize[_0xd8aa('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xd8aa('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 980ab3f..e49705c 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 _0xb7e7=['findAll','rows','show','params','length','find','catch','create','body','getConfigurations','findOne','FreshdeskConfiguration','options','AccountId','getSubjects','channel','getDescriptions','FreshdeskField','Subjects','Descriptions','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','priority','group','source','ticket_type','includes','custom_text','default','choices','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','FreshdeskAccount'];(function(_0x3f76c2,_0x24f1a2){var _0x2709f2=function(_0x1e04dc){while(--_0x1e04dc){_0x3f76c2['push'](_0x3f76c2['shift']());}};_0x2709f2(++_0x24f1a2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xb7e7[_0x50aa2e];return _0x5e07f0;};'use strict';var emlformat=require(_0x7b7e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b7e('0x2'));var moment=require('moment');var BPromise=require(_0x7b7e('0x3'));var Mustache=require('mustache');var util=require(_0x7b7e('0x4'));var path=require(_0x7b7e('0x5'));var sox=require(_0x7b7e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7b7e('0x7'));var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var licenseUtil=require(_0x7b7e('0x17'));var db=require(_0x7b7e('0x18'))['db'];var integrations=require(_0x7b7e('0x19'));function respondWithStatusCode(_0x54d8ce,_0x267446){_0x267446=_0x267446||0xcc;return function(_0x430eab){if(_0x430eab){return _0x54d8ce['sendStatus'](_0x267446);}return _0x54d8ce[_0x7b7e('0x1a')](_0x267446)['end']();};}function respondWithResult(_0x4c6011,_0x2889ed){_0x2889ed=_0x2889ed||0xc8;return function(_0xd304f5){if(_0xd304f5){return _0x4c6011[_0x7b7e('0x1a')](_0x2889ed)[_0x7b7e('0x1b')](_0xd304f5);}};}function respondWithFilteredResult(_0x3d2fb2,_0x5703fd){return function(_0x51baf6){if(_0x51baf6){var _0xc7f087=typeof _0x5703fd[_0x7b7e('0x1c')]===_0x7b7e('0x1d')&&typeof _0x5703fd[_0x7b7e('0x1e')]===_0x7b7e('0x1d');var _0x3bf2f0=_0x51baf6[_0x7b7e('0x1f')];var _0x200ef7=_0xc7f087?0x0:_0x5703fd[_0x7b7e('0x1c')];var _0x429a0e=_0xc7f087?_0x51baf6[_0x7b7e('0x1f')]:_0x5703fd[_0x7b7e('0x1c')]+_0x5703fd[_0x7b7e('0x1e')];var _0x3bec7d;if(_0x429a0e>=_0x3bf2f0){_0x429a0e=_0x3bf2f0;_0x3bec7d=0xc8;}else{_0x3bec7d=0xce;}_0x3d2fb2[_0x7b7e('0x1a')](_0x3bec7d);return _0x3d2fb2[_0x7b7e('0x20')](_0x7b7e('0x21'),_0x200ef7+'-'+_0x429a0e+'/'+_0x3bf2f0)['json'](_0x51baf6);}return null;};}function patchUpdates(_0x69262b){return function(_0x43db4f){try{jsonpatch[_0x7b7e('0x22')](_0x43db4f,_0x69262b,!![]);}catch(_0x4c0647){return BPromise[_0x7b7e('0x23')](_0x4c0647);}return _0x43db4f[_0x7b7e('0x24')]();};}function saveUpdates(_0x14243b,_0x200156){return function(_0x2b7211){if(_0x2b7211){return _0x2b7211[_0x7b7e('0x25')](_0x14243b)[_0x7b7e('0x26')](function(_0x10a66a){return _0x10a66a;});}return null;};}function removeEntity(_0x53bbb3,_0x5d6215){return function(_0x4a836a){if(_0x4a836a){return _0x4a836a[_0x7b7e('0x27')]()[_0x7b7e('0x26')](function(){_0x53bbb3[_0x7b7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51d3b1,_0x5dadbb){return function(_0x182245){if(!_0x182245){_0x51d3b1[_0x7b7e('0x28')](0x194);}return _0x182245;};}function handleError(_0x16a3c7,_0x7aa71){_0x7aa71=_0x7aa71||0x1f4;return function(_0x3ceaf5){logger['error'](_0x3ceaf5[_0x7b7e('0x29')]);if(_0x3ceaf5[_0x7b7e('0x2a')]){delete _0x3ceaf5['name'];}_0x16a3c7['status'](_0x7aa71)['send'](_0x3ceaf5);};}exports[_0x7b7e('0x2b')]=function(_0x423832,_0x503625){var _0x3db8c4={},_0x51d4b5={},_0x1b4341={'count':0x0,'rows':[]};var _0xb9b6bf=_[_0x7b7e('0x2c')](db['FreshdeskAccount'][_0x7b7e('0x2d')],function(_0xe31336){return{'name':_0xe31336[_0x7b7e('0x2e')],'type':_0xe31336[_0x7b7e('0x2f')][_0x7b7e('0x30')]};});_0x51d4b5['model']=_[_0x7b7e('0x2c')](_0xb9b6bf,'name');_0x51d4b5[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x423832[_0x7b7e('0x31')]);_0x51d4b5[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x51d4b5[_0x7b7e('0x35')],_0x51d4b5[_0x7b7e('0x31')]);_0x3db8c4['attributes']=_['intersection'](_0x51d4b5[_0x7b7e('0x35')],qs[_0x7b7e('0x36')](_0x423832['query'][_0x7b7e('0x36')]));_0x3db8c4[_0x7b7e('0x37')]=_0x3db8c4[_0x7b7e('0x37')]['length']?_0x3db8c4[_0x7b7e('0x37')]:_0x51d4b5[_0x7b7e('0x35')];if(!_0x423832[_0x7b7e('0x31')][_0x7b7e('0x38')](_0x7b7e('0x39'))){_0x3db8c4[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x3db8c4[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x423832[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}_0x3db8c4[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x423832[_0x7b7e('0x31')]['sort']);_0x3db8c4[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x423832[_0x7b7e('0x31')],_0x51d4b5[_0x7b7e('0x33')]),_0xb9b6bf);if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x3db8c4[_0x7b7e('0x3c')]=_[_0x7b7e('0x3f')](_0x3db8c4[_0x7b7e('0x3c')],{'$or':_['map'](_0xb9b6bf,function(_0x3d6571){if(_0x3d6571[_0x7b7e('0x2f')]!==_0x7b7e('0x40')){var _0x1d43da={};_0x1d43da[_0x3d6571['name']]={'$like':'%'+_0x423832[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x1d43da;}})});}_0x3db8c4=_[_0x7b7e('0x3f')]({},_0x3db8c4,_0x423832['options']);var _0x4a2888={'where':_0x3db8c4[_0x7b7e('0x3c')]};return db['FreshdeskAccount'][_0x7b7e('0x1f')](_0x4a2888)[_0x7b7e('0x26')](function(_0x4de331){_0x1b4341[_0x7b7e('0x1f')]=_0x4de331;if(_0x423832[_0x7b7e('0x31')][_0x7b7e('0x41')]){_0x3db8c4[_0x7b7e('0x42')]=[{'all':!![]}];}return db[_0x7b7e('0x43')][_0x7b7e('0x44')](_0x3db8c4);})[_0x7b7e('0x26')](function(_0x1d9bb9){_0x1b4341[_0x7b7e('0x45')]=_0x1d9bb9;return _0x1b4341;})['then'](respondWithFilteredResult(_0x503625,_0x3db8c4))['catch'](handleError(_0x503625,null));};exports[_0x7b7e('0x46')]=function(_0x550ea6,_0x41c8a6){var _0x5e8b5d={'raw':![],'where':{'id':_0x550ea6[_0x7b7e('0x47')]['id']}},_0x48dd74={};_0x48dd74['model']=_[_0x7b7e('0x32')](db['FreshdeskAccount'][_0x7b7e('0x2d')]);_0x48dd74[_0x7b7e('0x31')]=_[_0x7b7e('0x32')](_0x550ea6[_0x7b7e('0x31')]);_0x48dd74['filters']=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],_0x48dd74[_0x7b7e('0x31')]);_0x5e8b5d[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x48dd74[_0x7b7e('0x35')],qs['fields'](_0x550ea6['query']['fields']));_0x5e8b5d[_0x7b7e('0x37')]=_0x5e8b5d[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x5e8b5d[_0x7b7e('0x37')]:_0x48dd74[_0x7b7e('0x35')];if(_0x550ea6[_0x7b7e('0x31')]['includeAll']){_0x5e8b5d[_0x7b7e('0x42')]=[{'all':!![]}];}_0x5e8b5d=_[_0x7b7e('0x3f')]({},_0x5e8b5d,_0x550ea6['options']);return db['FreshdeskAccount'][_0x7b7e('0x49')](_0x5e8b5d)[_0x7b7e('0x26')](handleEntityNotFound(_0x41c8a6,null))[_0x7b7e('0x26')](respondWithResult(_0x41c8a6,null))[_0x7b7e('0x4a')](handleError(_0x41c8a6,null));};exports[_0x7b7e('0x4b')]=function(_0xb46776,_0x590154){return db[_0x7b7e('0x43')]['create'](_0xb46776[_0x7b7e('0x4c')],{})[_0x7b7e('0x26')](respondWithResult(_0x590154,0xc9))[_0x7b7e('0x4a')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x58e4e6,_0x3b649e){if(_0x58e4e6[_0x7b7e('0x4c')]['id']){delete _0x58e4e6[_0x7b7e('0x4c')]['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x58e4e6['params']['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x3b649e,null))[_0x7b7e('0x26')](saveUpdates(_0x58e4e6[_0x7b7e('0x4c')],null))[_0x7b7e('0x26')](respondWithResult(_0x3b649e,null))[_0x7b7e('0x4a')](handleError(_0x3b649e,null));};exports['destroy']=function(_0x1d6d18,_0x29024e){return db[_0x7b7e('0x43')][_0x7b7e('0x49')]({'where':{'id':_0x1d6d18[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x29024e,null))[_0x7b7e('0x26')](removeEntity(_0x29024e,null))['catch'](handleError(_0x29024e,null));};exports[_0x7b7e('0x4d')]=function(_0x5d7c89,_0x16730c,_0x766a54){var _0x570303={};var _0x36f1be={};var _0x44e3a0;var _0x16c81d;return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x5d7c89[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x16730c,null))['then'](function(_0xbf044d){if(_0xbf044d){_0x44e3a0=_0xbf044d;_0x36f1be[_0x7b7e('0x35')]=_[_0x7b7e('0x32')](db[_0x7b7e('0x4f')]['rawAttributes']);_0x36f1be['query']=_['keys'](_0x5d7c89[_0x7b7e('0x31')]);_0x36f1be[_0x7b7e('0x33')]=_[_0x7b7e('0x34')](_0x36f1be['model'],_0x36f1be['query']);_0x570303[_0x7b7e('0x37')]=_[_0x7b7e('0x34')](_0x36f1be['model'],qs[_0x7b7e('0x36')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x36')]));_0x570303['attributes']=_0x570303[_0x7b7e('0x37')][_0x7b7e('0x48')]?_0x570303['attributes']:_0x36f1be[_0x7b7e('0x35')];_0x570303[_0x7b7e('0x3a')]=qs[_0x7b7e('0x3b')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3b')]);_0x570303[_0x7b7e('0x3c')]=qs[_0x7b7e('0x33')](_[_0x7b7e('0x3d')](_0x5d7c89[_0x7b7e('0x31')],_0x36f1be['filters']));if(_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]){_0x570303['where']=_[_0x7b7e('0x3f')](_0x570303[_0x7b7e('0x3c')],{'$or':_[_0x7b7e('0x2c')](_0x570303['attributes'],function(_0x1729e0){var _0x4fc349={};_0x4fc349[_0x1729e0]={'$like':'%'+_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x3e')]+'%'};return _0x4fc349;})});}_0x570303=_['merge']({},_0x570303,_0x5d7c89[_0x7b7e('0x50')]);return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})['then'](function(_0x2dcb35){if(_0x2dcb35){_0x16c81d=_0x2dcb35[_0x7b7e('0x48')];if(!_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x38')]('nolimit')){_0x570303[_0x7b7e('0x1e')]=qs[_0x7b7e('0x1e')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1e')]);_0x570303[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x5d7c89[_0x7b7e('0x31')][_0x7b7e('0x1c')]);}return _0x44e3a0[_0x7b7e('0x4d')](_0x570303);}})[_0x7b7e('0x26')](function(_0x5b9010){if(_0x5b9010){return _0x5b9010?{'count':_0x16c81d,'rows':_0x5b9010}:null;}})[_0x7b7e('0x26')](respondWithResult(_0x16730c,null))['catch'](handleError(_0x16730c,null));};exports['addConfiguration']=function(_0x2b105a,_0x7cbe6c,_0x1eb4b1){if(_0x2b105a[_0x7b7e('0x4c')]['id']){delete _0x2b105a['body']['id'];}return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x2b105a[_0x7b7e('0x47')]['id']}})[_0x7b7e('0x26')](handleEntityNotFound(_0x7cbe6c,null))[_0x7b7e('0x26')](function(_0x2b2afd){if(_0x2b2afd){_0x2b105a['body'][_0x7b7e('0x51')]=_0x2b2afd['id'];_0x2b105a['body']['Subjects']=integrations[_0x7b7e('0x52')](_0x2b105a['body'][_0x7b7e('0x53')],_0x2b105a['body'][_0x7b7e('0x2f')]);_0x2b105a[_0x7b7e('0x4c')]['Descriptions']=integrations[_0x7b7e('0x54')](_0x2b105a[_0x7b7e('0x4c')]['channel'],_0x2b105a[_0x7b7e('0x4c')][_0x7b7e('0x2f')]);return db[_0x7b7e('0x4f')][_0x7b7e('0x4b')](_0x2b105a[_0x7b7e('0x4c')],{'include':[{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x56')},{'model':db[_0x7b7e('0x55')],'as':_0x7b7e('0x57')}]});}return null;})[_0x7b7e('0x26')](respondWithResult(_0x7cbe6c,null))['catch'](handleError(_0x7cbe6c,null));};exports['getFields']=function(_0x34e7df,_0x46ac1f,_0x2c6e3a){var _0x348c77='';return db[_0x7b7e('0x43')][_0x7b7e('0x4e')]({'where':{'id':_0x34e7df[_0x7b7e('0x47')]['id']},'attributes':['id','remoteUri',_0x7b7e('0x58')]})[_0x7b7e('0x26')](handleEntityNotFound(_0x46ac1f,null))['then'](function(_0x3ce80e){if(_0x3ce80e){_0x348c77=_0x3ce80e[_0x7b7e('0x59')];var _0x2fea85=_0x348c77[_0x7b7e('0x5a')](-0x1);if(_0x2fea85==='/'){_0x348c77=_0x348c77[_0x7b7e('0x5b')](0x0,_0x348c77[_0x7b7e('0x5c')](_0x2fea85));}return rp({'method':_0x7b7e('0x5d'),'uri':util[_0x7b7e('0x5e')](_0x7b7e('0x5f'),_0x348c77,_0x7b7e('0x60')),'headers':{'Authorization':util[_0x7b7e('0x5e')]('Basic\x20%s',new Buffer(util[_0x7b7e('0x5e')](_0x7b7e('0x61'),_0x3ce80e[_0x7b7e('0x58')]))[_0x7b7e('0x62')](_0x7b7e('0x63')))},'json':!![]});}})[_0x7b7e('0x26')](function(_0xfdd68c){if(_0xfdd68c){var _0x58994f=[_0x7b7e('0x64'),_0x7b7e('0x65'),_0x7b7e('0x66'),'description',_0x7b7e('0x1a'),_0x7b7e('0x67'),_0x7b7e('0x68'),_0x7b7e('0x69'),_0x7b7e('0x6a'),'group','company'];_['remove'](_0xfdd68c,function(_0x397923){return _0x58994f[_0x7b7e('0x6b')](_0x397923[_0x7b7e('0x2a')])||!_0x397923['default']&&_0x397923[_0x7b7e('0x2f')]!==_0x7b7e('0x6c')&&_0x397923[_0x7b7e('0x2f')]!=='custom_dropdown';});return{'count':_0xfdd68c[_0x7b7e('0x48')],'rows':_[_0x7b7e('0x2c')](_0xfdd68c,function(_0x111c99){return{'id':_0x111c99[_0x7b7e('0x2a')],'name':_0x111c99['label'],'custom':!_0x111c99[_0x7b7e('0x6d')],'options':_0x111c99[_0x7b7e('0x6e')]?_[_0x7b7e('0x2c')](_0x111c99[_0x7b7e('0x6e')],function(_0x4f0745){return{'name':_['capitalize'](_0x4f0745),'value':_0x4f0745};}):[]};})};}})[_0x7b7e('0x26')](respondWithResult(_0x46ac1f,null))['catch'](function(_0x1ecb55){var _0x4215b5=_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x6f')]?0x1f4:_0x1ecb55['statusCode']||0x1f4;logger[_0x7b7e('0x70')](_0x7b7e('0x71'),_0x7b7e('0x72'),_0x4215b5,JSON[_0x7b7e('0x73')](_0x1ecb55));delete _0x1ecb55[_0x7b7e('0x2a')];if(_0x4215b5===0x191){_0x4215b5=0x190;}_0x46ac1f[_0x7b7e('0x1a')](_0x4215b5)[_0x7b7e('0x74')](_0x34e7df[_0x7b7e('0x31')][_0x7b7e('0x6f')]?{'message':_0x7b7e('0x75'),'statusCode':_0x1ecb55[_0x7b7e('0x76')]}:_0x1ecb55);});}; \ No newline at end of file +var _0xa25c=['offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','FreshdeskConfiguration','pick','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','base64','requester','agent','description','priority','source','ticket_type','group','company','remove','includes','default','custom_text','label','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xa25c,0x13f));var _0xca25=function(_0x162f62,_0x1a0ab1){_0x162f62=_0x162f62-0x0;var _0x26c56e=_0xa25c[_0x162f62];return _0x26c56e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca25('0x0'));var zipdir=require(_0xca25('0x1'));var jsonpatch=require(_0xca25('0x2'));var rp=require(_0xca25('0x3'));var moment=require(_0xca25('0x4'));var BPromise=require(_0xca25('0x5'));var Mustache=require(_0xca25('0x6'));var util=require(_0xca25('0x7'));var path=require('path');var sox=require(_0xca25('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca25('0x9'));var _=require('lodash');var squel=require(_0xca25('0xa'));var crypto=require(_0xca25('0xb'));var jsforce=require(_0xca25('0xc'));var deskjs=require(_0xca25('0xd'));var toCsv=require(_0xca25('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xca25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca25('0x10'));var as=require(_0xca25('0x11'));var hardwareService=require(_0xca25('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xca25('0x13'));var licenseUtil=require(_0xca25('0x14'));var db=require(_0xca25('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x534bca,_0x2a7a97){_0x2a7a97=_0x2a7a97||0xcc;return function(_0x52393f){if(_0x52393f){return _0x534bca[_0xca25('0x16')](_0x2a7a97);}return _0x534bca[_0xca25('0x17')](_0x2a7a97)[_0xca25('0x18')]();};}function respondWithResult(_0x1a3207,_0x307e9e){_0x307e9e=_0x307e9e||0xc8;return function(_0x3245e6){if(_0x3245e6){return _0x1a3207[_0xca25('0x17')](_0x307e9e)[_0xca25('0x19')](_0x3245e6);}};}function respondWithFilteredResult(_0x2a1af3,_0x42bc1e){return function(_0x2b5cef){if(_0x2b5cef){var _0x587403=typeof _0x42bc1e[_0xca25('0x1a')]===_0xca25('0x1b')&&typeof _0x42bc1e['limit']===_0xca25('0x1b');var _0x2add52=_0x2b5cef[_0xca25('0x1c')];var _0x18ec6f=_0x587403?0x0:_0x42bc1e[_0xca25('0x1a')];var _0x59997b=_0x587403?_0x2b5cef[_0xca25('0x1c')]:_0x42bc1e[_0xca25('0x1a')]+_0x42bc1e[_0xca25('0x1d')];var _0x1cf09c;if(_0x59997b>=_0x2add52){_0x59997b=_0x2add52;_0x1cf09c=0xc8;}else{_0x1cf09c=0xce;}_0x2a1af3[_0xca25('0x17')](_0x1cf09c);return _0x2a1af3['set'](_0xca25('0x1e'),_0x18ec6f+'-'+_0x59997b+'/'+_0x2add52)[_0xca25('0x19')](_0x2b5cef);}return null;};}function patchUpdates(_0x235d92){return function(_0x1f69c6){try{jsonpatch[_0xca25('0x1f')](_0x1f69c6,_0x235d92,!![]);}catch(_0x38d6e6){return BPromise[_0xca25('0x20')](_0x38d6e6);}return _0x1f69c6['save']();};}function saveUpdates(_0x48fdf5,_0x23f69a){return function(_0x2e071d){if(_0x2e071d){return _0x2e071d[_0xca25('0x21')](_0x48fdf5)[_0xca25('0x22')](function(_0x2615d4){return _0x2615d4;});}return null;};}function removeEntity(_0x40e5e2,_0x8cec43){return function(_0xb934da){if(_0xb934da){return _0xb934da[_0xca25('0x23')]()[_0xca25('0x22')](function(){_0x40e5e2[_0xca25('0x17')](0xcc)[_0xca25('0x18')]();});}};}function handleEntityNotFound(_0x4dffad,_0x1aa848){return function(_0x359369){if(!_0x359369){_0x4dffad[_0xca25('0x16')](0x194);}return _0x359369;};}function handleError(_0x374cde,_0x220546){_0x220546=_0x220546||0x1f4;return function(_0x5d60f9){logger[_0xca25('0x24')](_0x5d60f9[_0xca25('0x25')]);if(_0x5d60f9[_0xca25('0x26')]){delete _0x5d60f9[_0xca25('0x26')];}_0x374cde[_0xca25('0x17')](_0x220546)[_0xca25('0x27')](_0x5d60f9);};}exports[_0xca25('0x28')]=function(_0x1660a5,_0x3e72cb){var _0x7b67f4={},_0x190f27={},_0x315f76={'count':0x0,'rows':[]};var _0x5078e4=_[_0xca25('0x29')](db[_0xca25('0x2a')][_0xca25('0x2b')],function(_0x14ad0f){return{'name':_0x14ad0f[_0xca25('0x2c')],'type':_0x14ad0f['type'][_0xca25('0x2d')]};});_0x190f27[_0xca25('0x2e')]=_[_0xca25('0x29')](_0x5078e4,'name');_0x190f27[_0xca25('0x2f')]=_[_0xca25('0x30')](_0x1660a5[_0xca25('0x2f')]);_0x190f27[_0xca25('0x31')]=_[_0xca25('0x32')](_0x190f27[_0xca25('0x2e')],_0x190f27['query']);_0x7b67f4[_0xca25('0x33')]=_['intersection'](_0x190f27[_0xca25('0x2e')],qs[_0xca25('0x34')](_0x1660a5[_0xca25('0x2f')]['fields']));_0x7b67f4[_0xca25('0x33')]=_0x7b67f4[_0xca25('0x33')][_0xca25('0x35')]?_0x7b67f4[_0xca25('0x33')]:_0x190f27[_0xca25('0x2e')];if(!_0x1660a5['query'][_0xca25('0x36')](_0xca25('0x37'))){_0x7b67f4[_0xca25('0x1d')]=qs[_0xca25('0x1d')](_0x1660a5[_0xca25('0x2f')][_0xca25('0x1d')]);_0x7b67f4[_0xca25('0x1a')]=qs['offset'](_0x1660a5['query'][_0xca25('0x1a')]);}_0x7b67f4[_0xca25('0x38')]=qs['sort'](_0x1660a5['query'][_0xca25('0x39')]);_0x7b67f4[_0xca25('0x3a')]=qs[_0xca25('0x31')](_['pick'](_0x1660a5[_0xca25('0x2f')],_0x190f27[_0xca25('0x31')]),_0x5078e4);if(_0x1660a5[_0xca25('0x2f')][_0xca25('0x3b')]){_0x7b67f4[_0xca25('0x3a')]=_[_0xca25('0x3c')](_0x7b67f4['where'],{'$or':_[_0xca25('0x29')](_0x5078e4,function(_0x5d6d97){if(_0x5d6d97[_0xca25('0x3d')]!==_0xca25('0x3e')){var _0x391beb={};_0x391beb[_0x5d6d97[_0xca25('0x26')]]={'$like':'%'+_0x1660a5[_0xca25('0x2f')][_0xca25('0x3b')]+'%'};return _0x391beb;}})});}_0x7b67f4=_[_0xca25('0x3c')]({},_0x7b67f4,_0x1660a5[_0xca25('0x3f')]);var _0x467e1d={'where':_0x7b67f4['where']};return db[_0xca25('0x2a')]['count'](_0x467e1d)[_0xca25('0x22')](function(_0x4a5c10){_0x315f76[_0xca25('0x1c')]=_0x4a5c10;if(_0x1660a5[_0xca25('0x2f')][_0xca25('0x40')]){_0x7b67f4[_0xca25('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xca25('0x42')](_0x7b67f4);})['then'](function(_0x275e3d){_0x315f76[_0xca25('0x43')]=_0x275e3d;return _0x315f76;})['then'](respondWithFilteredResult(_0x3e72cb,_0x7b67f4))[_0xca25('0x44')](handleError(_0x3e72cb,null));};exports[_0xca25('0x45')]=function(_0x52799a,_0x2ff9c2){var _0x1068c9={'raw':![],'where':{'id':_0x52799a[_0xca25('0x46')]['id']}},_0x114f6f={};_0x114f6f['model']=_[_0xca25('0x30')](db[_0xca25('0x2a')]['rawAttributes']);_0x114f6f['query']=_['keys'](_0x52799a['query']);_0x114f6f[_0xca25('0x31')]=_[_0xca25('0x32')](_0x114f6f[_0xca25('0x2e')],_0x114f6f[_0xca25('0x2f')]);_0x1068c9['attributes']=_[_0xca25('0x32')](_0x114f6f[_0xca25('0x2e')],qs[_0xca25('0x34')](_0x52799a[_0xca25('0x2f')]['fields']));_0x1068c9[_0xca25('0x33')]=_0x1068c9['attributes'][_0xca25('0x35')]?_0x1068c9[_0xca25('0x33')]:_0x114f6f[_0xca25('0x2e')];if(_0x52799a[_0xca25('0x2f')][_0xca25('0x40')]){_0x1068c9[_0xca25('0x41')]=[{'all':!![]}];}_0x1068c9=_['merge']({},_0x1068c9,_0x52799a[_0xca25('0x3f')]);return db[_0xca25('0x2a')][_0xca25('0x47')](_0x1068c9)[_0xca25('0x22')](handleEntityNotFound(_0x2ff9c2,null))[_0xca25('0x22')](respondWithResult(_0x2ff9c2,null))[_0xca25('0x44')](handleError(_0x2ff9c2,null));};exports[_0xca25('0x48')]=function(_0x352a17,_0x3ba55c){return db[_0xca25('0x2a')][_0xca25('0x48')](_0x352a17[_0xca25('0x49')],{})[_0xca25('0x22')](respondWithResult(_0x3ba55c,0xc9))[_0xca25('0x44')](handleError(_0x3ba55c,null));};exports[_0xca25('0x21')]=function(_0x1fba32,_0x358c11){if(_0x1fba32[_0xca25('0x49')]['id']){delete _0x1fba32['body']['id'];}return db[_0xca25('0x2a')][_0xca25('0x47')]({'where':{'id':_0x1fba32[_0xca25('0x46')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x358c11,null))['then'](saveUpdates(_0x1fba32[_0xca25('0x49')],null))[_0xca25('0x22')](respondWithResult(_0x358c11,null))['catch'](handleError(_0x358c11,null));};exports[_0xca25('0x23')]=function(_0x10692f,_0x747387){return db[_0xca25('0x2a')]['find']({'where':{'id':_0x10692f[_0xca25('0x46')]['id']}})['then'](handleEntityNotFound(_0x747387,null))[_0xca25('0x22')](removeEntity(_0x747387,null))['catch'](handleError(_0x747387,null));};exports['getConfigurations']=function(_0x1a38db,_0x1523d5,_0x17cd37){var _0x25e2de={};var _0x4f2545={};var _0x47a45f;var _0xfaf8f5;return db['FreshdeskAccount'][_0xca25('0x4a')]({'where':{'id':_0x1a38db[_0xca25('0x46')]['id']}})[_0xca25('0x22')](handleEntityNotFound(_0x1523d5,null))[_0xca25('0x22')](function(_0x149dcd){if(_0x149dcd){_0x47a45f=_0x149dcd;_0x4f2545['model']=_['keys'](db[_0xca25('0x4b')][_0xca25('0x2b')]);_0x4f2545[_0xca25('0x2f')]=_[_0xca25('0x30')](_0x1a38db[_0xca25('0x2f')]);_0x4f2545[_0xca25('0x31')]=_['intersection'](_0x4f2545[_0xca25('0x2e')],_0x4f2545[_0xca25('0x2f')]);_0x25e2de[_0xca25('0x33')]=_[_0xca25('0x32')](_0x4f2545[_0xca25('0x2e')],qs[_0xca25('0x34')](_0x1a38db[_0xca25('0x2f')][_0xca25('0x34')]));_0x25e2de[_0xca25('0x33')]=_0x25e2de['attributes'][_0xca25('0x35')]?_0x25e2de[_0xca25('0x33')]:_0x4f2545[_0xca25('0x2e')];_0x25e2de[_0xca25('0x38')]=qs[_0xca25('0x39')](_0x1a38db[_0xca25('0x2f')][_0xca25('0x39')]);_0x25e2de[_0xca25('0x3a')]=qs['filters'](_[_0xca25('0x4c')](_0x1a38db['query'],_0x4f2545[_0xca25('0x31')]));if(_0x1a38db[_0xca25('0x2f')][_0xca25('0x3b')]){_0x25e2de['where']=_['merge'](_0x25e2de['where'],{'$or':_[_0xca25('0x29')](_0x25e2de[_0xca25('0x33')],function(_0x378bab){var _0x1ad458={};_0x1ad458[_0x378bab]={'$like':'%'+_0x1a38db[_0xca25('0x2f')][_0xca25('0x3b')]+'%'};return _0x1ad458;})});}_0x25e2de=_[_0xca25('0x3c')]({},_0x25e2de,_0x1a38db[_0xca25('0x3f')]);return _0x47a45f['getConfigurations'](_0x25e2de);}})[_0xca25('0x22')](function(_0x497dc1){if(_0x497dc1){_0xfaf8f5=_0x497dc1['length'];if(!_0x1a38db['query'][_0xca25('0x36')](_0xca25('0x37'))){_0x25e2de[_0xca25('0x1d')]=qs[_0xca25('0x1d')](_0x1a38db[_0xca25('0x2f')][_0xca25('0x1d')]);_0x25e2de['offset']=qs[_0xca25('0x1a')](_0x1a38db[_0xca25('0x2f')]['offset']);}return _0x47a45f[_0xca25('0x4d')](_0x25e2de);}})['then'](function(_0x18695b){if(_0x18695b){return _0x18695b?{'count':_0xfaf8f5,'rows':_0x18695b}:null;}})['then'](respondWithResult(_0x1523d5,null))['catch'](handleError(_0x1523d5,null));};exports[_0xca25('0x4e')]=function(_0x607cec,_0x544e7d,_0x4ed940){if(_0x607cec['body']['id']){delete _0x607cec['body']['id'];}return db['FreshdeskAccount'][_0xca25('0x4a')]({'where':{'id':_0x607cec[_0xca25('0x46')]['id']}})['then'](handleEntityNotFound(_0x544e7d,null))['then'](function(_0x58cc83){if(_0x58cc83){_0x607cec['body'][_0xca25('0x4f')]=_0x58cc83['id'];_0x607cec['body']['Subjects']=integrations[_0xca25('0x50')](_0x607cec[_0xca25('0x49')][_0xca25('0x51')],_0x607cec[_0xca25('0x49')]['type']);_0x607cec['body'][_0xca25('0x52')]=integrations['getDescriptions'](_0x607cec[_0xca25('0x49')][_0xca25('0x51')],_0x607cec['body'][_0xca25('0x3d')]);return db[_0xca25('0x4b')][_0xca25('0x48')](_0x607cec[_0xca25('0x49')],{'include':[{'model':db[_0xca25('0x53')],'as':_0xca25('0x54')},{'model':db[_0xca25('0x53')],'as':_0xca25('0x52')}]});}return null;})[_0xca25('0x22')](respondWithResult(_0x544e7d,null))['catch'](handleError(_0x544e7d,null));};exports[_0xca25('0x55')]=function(_0x1243ba,_0x49d4bc,_0x318083){var _0x31ae9b='';return db[_0xca25('0x2a')][_0xca25('0x4a')]({'where':{'id':_0x1243ba[_0xca25('0x46')]['id']},'attributes':['id',_0xca25('0x56'),_0xca25('0x57')]})[_0xca25('0x22')](handleEntityNotFound(_0x49d4bc,null))['then'](function(_0x1f6a89){if(_0x1f6a89){_0x31ae9b=_0x1f6a89['remoteUri'];var _0x336d96=_0x31ae9b[_0xca25('0x58')](-0x1);if(_0x336d96==='/'){_0x31ae9b=_0x31ae9b[_0xca25('0x59')](0x0,_0x31ae9b[_0xca25('0x5a')](_0x336d96));}return rp({'method':_0xca25('0x5b'),'uri':util[_0xca25('0x5c')]('%s/%s',_0x31ae9b,_0xca25('0x5d')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xca25('0x5c')]('%s:X',_0x1f6a89[_0xca25('0x57')]))['toString'](_0xca25('0x5e')))},'json':!![]});}})[_0xca25('0x22')](function(_0x334431){if(_0x334431){var _0x2a8f1a=[_0xca25('0x5f'),'subject',_0xca25('0x60'),_0xca25('0x61'),_0xca25('0x17'),_0xca25('0x62'),'group',_0xca25('0x63'),_0xca25('0x64'),_0xca25('0x65'),_0xca25('0x66')];_[_0xca25('0x67')](_0x334431,function(_0x153b82){return _0x2a8f1a[_0xca25('0x68')](_0x153b82[_0xca25('0x26')])||!_0x153b82[_0xca25('0x69')]&&_0x153b82[_0xca25('0x3d')]!==_0xca25('0x6a')&&_0x153b82[_0xca25('0x3d')]!=='custom_dropdown';});return{'count':_0x334431[_0xca25('0x35')],'rows':_[_0xca25('0x29')](_0x334431,function(_0x4421aa){return{'id':_0x4421aa[_0xca25('0x26')],'name':_0x4421aa[_0xca25('0x6b')],'custom':!_0x4421aa['default'],'options':_0x4421aa[_0xca25('0x6c')]?_[_0xca25('0x29')](_0x4421aa[_0xca25('0x6c')],function(_0x5c1da9){return{'name':_[_0xca25('0x6d')](_0x5c1da9),'value':_0x5c1da9};}):[]};})};}})['then'](respondWithResult(_0x49d4bc,null))[_0xca25('0x44')](function(_0xe80eed){var _0x43c220=_0x1243ba['query'][_0xca25('0x6e')]?0x1f4:_0xe80eed['statusCode']||0x1f4;logger['error'](_0xca25('0x6f'),_0xca25('0x55'),_0x43c220,JSON[_0xca25('0x70')](_0xe80eed));delete _0xe80eed[_0xca25('0x26')];if(_0x43c220===0x191){_0x43c220=0x190;}_0x49d4bc[_0xca25('0x17')](_0x43c220)[_0xca25('0x27')](_0x1243ba[_0xca25('0x2f')][_0xca25('0x6e')]?{'message':_0xca25('0x71'),'statusCode':_0xe80eed[_0xca25('0x72')]}:_0xe80eed);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index de205e9..d418720 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 _0x31b7=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','bluebird','request-promise','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x31b7,0xf7));var _0x731b=function(_0x5639ea,_0x5ba8b4){_0x5639ea=_0x5639ea-0x0;var _0xea13fd=_0x31b7[_0x5639ea];return _0xea13fd;};'use strict';var _=require(_0x731b('0x0'));var util=require(_0x731b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x731b('0x2'));var rp=require(_0x731b('0x3'));var fs=require('fs');var path=require(_0x731b('0x4'));var rimraf=require(_0x731b('0x5'));var config=require(_0x731b('0x6'));var attributes=require(_0x731b('0x7'));var integrations=require(_0x731b('0x8'));module[_0x731b('0x9')]=function(_0x22fd9b,_0x53cb02){return _0x22fd9b['define'](_0x731b('0xa'),attributes,{'tableName':_0x731b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2e9=['../../config/environment','../../components/integrations/configuration','exports','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','path'];(function(_0xdc90,_0x2e725c){var _0x36136a=function(_0x31dc54){while(--_0x31dc54){_0xdc90['push'](_0xdc90['shift']());}};_0x36136a(++_0x2e725c);}(_0xc2e9,0x86));var _0x9c2e=function(_0x4853cb,_0x2015fa){_0x4853cb=_0x4853cb-0x0;var _0x8a8a8c=_0xc2e9[_0x4853cb];return _0x8a8a8c;};'use strict';var _=require(_0x9c2e('0x0'));var util=require(_0x9c2e('0x1'));var logger=require(_0x9c2e('0x2'))(_0x9c2e('0x3'));var moment=require(_0x9c2e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c2e('0x5'));var rimraf=require('rimraf');var config=require(_0x9c2e('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x9c2e('0x7'));module[_0x9c2e('0x8')]=function(_0x360e38,_0x573c49){return _0x360e38['define']('FreshdeskAccount',attributes,{'tableName':_0x9c2e('0x9'),'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 ed1186f..d60bead 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 _0x1f71=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetFreshdeskAccount','options','raw','where','attributes','limit','include','map','model','FreshdeskAccount','find','ShowFreshdeskAccount','util','moment','bluebird','randomstring','ioredis'];(function(_0x1cac0a,_0x12b7bd){var _0x473954=function(_0x868247){while(--_0x868247){_0x1cac0a['push'](_0x1cac0a['shift']());}};_0x473954(++_0x12b7bd);}(_0x1f71,0xaa));var _0x11f7=function(_0x23733e,_0x37bace){_0x23733e=_0x23733e-0x0;var _0x47f8d8=_0x1f71[_0x23733e];return _0x47f8d8;};'use strict';var _=require('lodash');var util=require(_0x11f7('0x0'));var moment=require(_0x11f7('0x1'));var BPromise=require(_0x11f7('0x2'));var rs=require(_0x11f7('0x3'));var fs=require('fs');var Redis=require(_0x11f7('0x4'));var db=require(_0x11f7('0x5'))['db'];var utils=require(_0x11f7('0x6'));var logger=require(_0x11f7('0x7'))(_0x11f7('0x8'));var config=require(_0x11f7('0x9'));var jayson=require(_0x11f7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x143cce,_0x12b27a,_0x59fc53){return new BPromise(function(_0x240d37,_0x4fafc2){return client[_0x11f7('0xb')](_0x143cce,_0x59fc53)[_0x11f7('0xc')](function(_0x161e94){logger['info'](_0x11f7('0xd'),_0x12b27a,'request\x20sent');logger[_0x11f7('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x12b27a,_0x11f7('0xf'),JSON[_0x11f7('0x10')](_0x161e94));if(_0x161e94[_0x11f7('0x11')]){if(_0x161e94['error'][_0x11f7('0x12')]===0x1f4){logger['error'](_0x11f7('0xd'),_0x12b27a,_0x161e94[_0x11f7('0x11')]['message']);return _0x4fafc2(_0x161e94[_0x11f7('0x11')][_0x11f7('0x13')]);}logger['error'](_0x11f7('0xd'),_0x12b27a,_0x161e94[_0x11f7('0x11')][_0x11f7('0x13')]);return _0x240d37(_0x161e94[_0x11f7('0x11')][_0x11f7('0x13')]);}else{logger[_0x11f7('0x14')]('FreshdeskAccount,\x20%s,\x20%s',_0x12b27a,_0x11f7('0xf'));_0x240d37(_0x161e94[_0x11f7('0x15')][_0x11f7('0x13')]);}})[_0x11f7('0x16')](function(_0x5bc6ab){logger['error'](_0x11f7('0xd'),_0x12b27a,_0x5bc6ab);_0x4fafc2(_0x5bc6ab);});});}exports[_0x11f7('0x17')]=function(_0x53fe9a){var _0x55813b=this;return new Promise(function(_0x3be5d4,_0x3fe0b8){return db['FreshdeskAccount']['findAll']({'raw':_0x53fe9a['options']?_0x53fe9a[_0x11f7('0x18')][_0x11f7('0x19')]===undefined?!![]:![]:!![],'where':_0x53fe9a[_0x11f7('0x18')]?_0x53fe9a[_0x11f7('0x18')][_0x11f7('0x1a')]||null:null,'attributes':_0x53fe9a['options']?_0x53fe9a[_0x11f7('0x18')][_0x11f7('0x1b')]||null:null,'limit':_0x53fe9a[_0x11f7('0x18')]?_0x53fe9a[_0x11f7('0x18')][_0x11f7('0x1c')]||null:null,'include':_0x53fe9a[_0x11f7('0x18')]?_0x53fe9a[_0x11f7('0x18')][_0x11f7('0x1d')]?_[_0x11f7('0x1e')](_0x53fe9a[_0x11f7('0x18')][_0x11f7('0x1d')],function(_0x1c2290){return{'model':db[_0x1c2290[_0x11f7('0x1f')]],'as':_0x1c2290['as'],'attributes':_0x1c2290[_0x11f7('0x1b')],'include':_0x1c2290[_0x11f7('0x1d')]?_[_0x11f7('0x1e')](_0x1c2290['include'],function(_0x19929){return{'model':db[_0x19929['model']],'as':_0x19929['as'],'attributes':_0x19929['attributes'],'include':_0x19929[_0x11f7('0x1d')]?_[_0x11f7('0x1e')](_0x19929['include'],function(_0x13f63b){return{'model':db[_0x13f63b[_0x11f7('0x1f')]],'as':_0x13f63b['as'],'attributes':_0x13f63b[_0x11f7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x11f7('0xc')](function(_0x22bdda){logger[_0x11f7('0x14')](_0x11f7('0x17'),_0x53fe9a);logger[_0x11f7('0xe')](_0x11f7('0x17'),_0x53fe9a,JSON[_0x11f7('0x10')](_0x22bdda));_0x3be5d4(_0x22bdda);})[_0x11f7('0x16')](function(_0x2b15b4){logger[_0x11f7('0x11')](_0x11f7('0x17'),_0x2b15b4['message'],_0x53fe9a);_0x3fe0b8(_0x55813b[_0x11f7('0x11')](0x1f4,_0x2b15b4[_0x11f7('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x112e0c){var _0x1a8e51=this;return new Promise(function(_0x34b873,_0x3c934a){return db[_0x11f7('0x20')][_0x11f7('0x21')]({'raw':_0x112e0c[_0x11f7('0x18')]?_0x112e0c[_0x11f7('0x18')][_0x11f7('0x19')]===undefined?!![]:![]:!![],'where':_0x112e0c[_0x11f7('0x18')]?_0x112e0c[_0x11f7('0x18')][_0x11f7('0x1a')]||null:null,'attributes':_0x112e0c[_0x11f7('0x18')]?_0x112e0c[_0x11f7('0x18')][_0x11f7('0x1b')]||null:null,'include':_0x112e0c[_0x11f7('0x18')]?_0x112e0c[_0x11f7('0x18')][_0x11f7('0x1d')]?_[_0x11f7('0x1e')](_0x112e0c[_0x11f7('0x18')]['include'],function(_0x5aa142){return{'model':db[_0x5aa142[_0x11f7('0x1f')]],'as':_0x5aa142['as'],'attributes':_0x5aa142[_0x11f7('0x1b')],'include':_0x5aa142[_0x11f7('0x1d')]?_[_0x11f7('0x1e')](_0x5aa142[_0x11f7('0x1d')],function(_0x347bce){return{'model':db[_0x347bce[_0x11f7('0x1f')]],'as':_0x347bce['as'],'attributes':_0x347bce[_0x11f7('0x1b')],'include':_0x347bce['include']?_[_0x11f7('0x1e')](_0x347bce[_0x11f7('0x1d')],function(_0x1d9ede){return{'model':db[_0x1d9ede[_0x11f7('0x1f')]],'as':_0x1d9ede['as'],'attributes':_0x1d9ede[_0x11f7('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x163e24){logger[_0x11f7('0x14')](_0x11f7('0x22'),_0x112e0c);logger[_0x11f7('0xe')]('ShowFreshdeskAccount',_0x112e0c,JSON['stringify'](_0x163e24));_0x34b873(_0x163e24);})[_0x11f7('0x16')](function(_0x5258d2){logger[_0x11f7('0x11')](_0x11f7('0x22'),_0x5258d2[_0x11f7('0x13')],_0x112e0c);_0x3c934a(_0x1a8e51[_0x11f7('0x11')](0x1f4,_0x5258d2[_0x11f7('0x13')]));});});}; \ No newline at end of file +var _0x1dc0=['find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','raw','options','where','limit','include','map','model','attributes','debug','ShowFreshdeskAccount'];(function(_0x2afc57,_0x5a88da){var _0x101829=function(_0x574343){while(--_0x574343){_0x2afc57['push'](_0x2afc57['shift']());}};_0x101829(++_0x5a88da);}(_0x1dc0,0xab));var _0x01dc=function(_0x2ec62e,_0x3653b2){_0x2ec62e=_0x2ec62e-0x0;var _0x2a7216=_0x1dc0[_0x2ec62e];return _0x2a7216;};'use strict';var _=require(_0x01dc('0x0'));var util=require(_0x01dc('0x1'));var moment=require('moment');var BPromise=require(_0x01dc('0x2'));var rs=require(_0x01dc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01dc('0x4'))['db'];var utils=require(_0x01dc('0x5'));var logger=require(_0x01dc('0x6'))(_0x01dc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x01dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf9946e,_0x30f731,_0x4c2245){return new BPromise(function(_0x20061f,_0x1e7a69){return client[_0x01dc('0x9')](_0xf9946e,_0x4c2245)[_0x01dc('0xa')](function(_0x27f0a8){logger[_0x01dc('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x30f731,'request\x20sent');logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x30f731,_0x01dc('0xc'),JSON[_0x01dc('0xd')](_0x27f0a8));if(_0x27f0a8[_0x01dc('0xe')]){if(_0x27f0a8[_0x01dc('0xe')][_0x01dc('0xf')]===0x1f4){logger[_0x01dc('0xe')](_0x01dc('0x10'),_0x30f731,_0x27f0a8[_0x01dc('0xe')][_0x01dc('0x11')]);return _0x1e7a69(_0x27f0a8[_0x01dc('0xe')]['message']);}logger[_0x01dc('0xe')](_0x01dc('0x10'),_0x30f731,_0x27f0a8[_0x01dc('0xe')]['message']);return _0x20061f(_0x27f0a8[_0x01dc('0xe')][_0x01dc('0x11')]);}else{logger[_0x01dc('0xb')](_0x01dc('0x10'),_0x30f731,'request\x20sent');_0x20061f(_0x27f0a8[_0x01dc('0x12')][_0x01dc('0x11')]);}})[_0x01dc('0x13')](function(_0x36b56f){logger[_0x01dc('0xe')](_0x01dc('0x10'),_0x30f731,_0x36b56f);_0x1e7a69(_0x36b56f);});});}exports[_0x01dc('0x14')]=function(_0x33cfdb){var _0x556d6a=this;return new Promise(function(_0xd33414,_0x82c543){return db[_0x01dc('0x15')][_0x01dc('0x16')]({'raw':_0x33cfdb['options']?_0x33cfdb['options'][_0x01dc('0x17')]===undefined?!![]:![]:!![],'where':_0x33cfdb[_0x01dc('0x18')]?_0x33cfdb[_0x01dc('0x18')][_0x01dc('0x19')]||null:null,'attributes':_0x33cfdb[_0x01dc('0x18')]?_0x33cfdb[_0x01dc('0x18')]['attributes']||null:null,'limit':_0x33cfdb[_0x01dc('0x18')]?_0x33cfdb[_0x01dc('0x18')][_0x01dc('0x1a')]||null:null,'include':_0x33cfdb[_0x01dc('0x18')]?_0x33cfdb[_0x01dc('0x18')][_0x01dc('0x1b')]?_[_0x01dc('0x1c')](_0x33cfdb[_0x01dc('0x18')][_0x01dc('0x1b')],function(_0x48e49c){return{'model':db[_0x48e49c[_0x01dc('0x1d')]],'as':_0x48e49c['as'],'attributes':_0x48e49c[_0x01dc('0x1e')],'include':_0x48e49c[_0x01dc('0x1b')]?_[_0x01dc('0x1c')](_0x48e49c[_0x01dc('0x1b')],function(_0x4b7e13){return{'model':db[_0x4b7e13[_0x01dc('0x1d')]],'as':_0x4b7e13['as'],'attributes':_0x4b7e13[_0x01dc('0x1e')],'include':_0x4b7e13['include']?_[_0x01dc('0x1c')](_0x4b7e13[_0x01dc('0x1b')],function(_0x281657){return{'model':db[_0x281657['model']],'as':_0x281657['as'],'attributes':_0x281657[_0x01dc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01dc('0xa')](function(_0x1135c8){logger[_0x01dc('0xb')](_0x01dc('0x14'),_0x33cfdb);logger[_0x01dc('0x1f')]('GetFreshdeskAccount',_0x33cfdb,JSON['stringify'](_0x1135c8));_0xd33414(_0x1135c8);})[_0x01dc('0x13')](function(_0x377320){logger[_0x01dc('0xe')](_0x01dc('0x14'),_0x377320['message'],_0x33cfdb);_0x82c543(_0x556d6a[_0x01dc('0xe')](0x1f4,_0x377320[_0x01dc('0x11')]));});});};exports[_0x01dc('0x20')]=function(_0x221ee9){var _0x3f7080=this;return new Promise(function(_0xc414db,_0x20a7a5){return db[_0x01dc('0x15')][_0x01dc('0x21')]({'raw':_0x221ee9[_0x01dc('0x18')]?_0x221ee9[_0x01dc('0x18')][_0x01dc('0x17')]===undefined?!![]:![]:!![],'where':_0x221ee9[_0x01dc('0x18')]?_0x221ee9[_0x01dc('0x18')][_0x01dc('0x19')]||null:null,'attributes':_0x221ee9[_0x01dc('0x18')]?_0x221ee9[_0x01dc('0x18')][_0x01dc('0x1e')]||null:null,'include':_0x221ee9[_0x01dc('0x18')]?_0x221ee9[_0x01dc('0x18')][_0x01dc('0x1b')]?_[_0x01dc('0x1c')](_0x221ee9[_0x01dc('0x18')][_0x01dc('0x1b')],function(_0x56f5fe){return{'model':db[_0x56f5fe[_0x01dc('0x1d')]],'as':_0x56f5fe['as'],'attributes':_0x56f5fe[_0x01dc('0x1e')],'include':_0x56f5fe[_0x01dc('0x1b')]?_[_0x01dc('0x1c')](_0x56f5fe[_0x01dc('0x1b')],function(_0x77a570){return{'model':db[_0x77a570['model']],'as':_0x77a570['as'],'attributes':_0x77a570[_0x01dc('0x1e')],'include':_0x77a570[_0x01dc('0x1b')]?_[_0x01dc('0x1c')](_0x77a570['include'],function(_0x5d656b){return{'model':db[_0x5d656b['model']],'as':_0x5d656b['as'],'attributes':_0x5d656b[_0x01dc('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x01dc('0xa')](function(_0x5665ca){logger[_0x01dc('0xb')](_0x01dc('0x20'),_0x221ee9);logger[_0x01dc('0x1f')](_0x01dc('0x20'),_0x221ee9,JSON[_0x01dc('0xd')](_0x5665ca));_0xc414db(_0x5665ca);})[_0x01dc('0x13')](function(_0x5dbed5){logger[_0x01dc('0xe')]('ShowFreshdeskAccount',_0x5dbed5[_0x01dc('0x11')],_0x221ee9);_0x20a7a5(_0x3f7080[_0x01dc('0xe')](0x1f4,_0x5dbed5['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 44d0387..29b9741 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 _0x1092=['/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x3d58a6,_0x31ae3e){var _0x7e4fea=function(_0x5a0f08){while(--_0x5a0f08){_0x3d58a6['push'](_0x3d58a6['shift']());}};_0x7e4fea(++_0x31ae3e);}(_0x1092,0x1c0));var _0x2109=function(_0x568479,_0x3faf66){_0x568479=_0x568479-0x0;var _0x3b89df=_0x1092[_0x568479];return _0x3b89df;};'use strict';var multer=require(_0x2109('0x0'));var util=require(_0x2109('0x1'));var path=require(_0x2109('0x2'));var timeout=require(_0x2109('0x3'));var express=require('express');var router=express[_0x2109('0x4')]();var fs_extra=require(_0x2109('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2109('0x6'));var controller=require(_0x2109('0x7'));router[_0x2109('0x8')]('/',auth[_0x2109('0x9')](),controller[_0x2109('0xa')]);router[_0x2109('0x8')]('/:id',auth[_0x2109('0x9')](),controller[_0x2109('0xb')]);router[_0x2109('0x8')](_0x2109('0xc'),auth[_0x2109('0x9')](),controller[_0x2109('0xd')]);router[_0x2109('0x8')](_0x2109('0xe'),auth[_0x2109('0x9')](),controller[_0x2109('0xf')]);router['get'](_0x2109('0x10'),auth[_0x2109('0x9')](),controller[_0x2109('0x11')]);router[_0x2109('0x8')]('/:id/tags',auth[_0x2109('0x9')](),controller[_0x2109('0x12')]);router[_0x2109('0x13')]('/',auth[_0x2109('0x9')](),controller[_0x2109('0x14')]);router[_0x2109('0x13')](_0x2109('0x15'),auth[_0x2109('0x9')](),controller[_0x2109('0x16')]);router[_0x2109('0x17')](_0x2109('0x18'),auth['isAuthenticated'](),controller[_0x2109('0x19')]);router[_0x2109('0x1a')]('/:id',auth[_0x2109('0x9')](),controller[_0x2109('0x1b')]);module[_0x2109('0x1c')]=router; \ No newline at end of file +var _0x547a=['/:id/tags','getTags','create','post','setTags','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x1b56c,_0x44dca2){var _0x5161ec=function(_0x41bb97){while(--_0x41bb97){_0x1b56c['push'](_0x1b56c['shift']());}};_0x5161ec(++_0x44dca2);}(_0x547a,0x1ae));var _0xa547=function(_0x3db4bd,_0x2ade34){_0x3db4bd=_0x3db4bd-0x0;var _0xa31e89=_0x547a[_0x3db4bd];return _0xa31e89;};'use strict';var multer=require(_0xa547('0x0'));var util=require(_0xa547('0x1'));var path=require(_0xa547('0x2'));var timeout=require('connect-timeout');var express=require(_0xa547('0x3'));var router=express[_0xa547('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa547('0x5'));var interaction=require(_0xa547('0x6'));var config=require(_0xa547('0x7'));var controller=require(_0xa547('0x8'));router[_0xa547('0x9')]('/',auth['isAuthenticated'](),controller[_0xa547('0xa')]);router[_0xa547('0x9')]('/:id',auth[_0xa547('0xb')](),controller[_0xa547('0xc')]);router['get'](_0xa547('0xd'),auth['isAuthenticated'](),controller['getFields']);router[_0xa547('0x9')](_0xa547('0xe'),auth['isAuthenticated'](),controller[_0xa547('0xf')]);router[_0xa547('0x9')](_0xa547('0x10'),auth[_0xa547('0xb')](),controller[_0xa547('0x11')]);router[_0xa547('0x9')](_0xa547('0x12'),auth[_0xa547('0xb')](),controller[_0xa547('0x13')]);router['post']('/',auth[_0xa547('0xb')](),controller[_0xa547('0x14')]);router[_0xa547('0x15')]('/:id/tags',auth[_0xa547('0xb')](),controller[_0xa547('0x16')]);router[_0xa547('0x17')](_0xa547('0x18'),auth[_0xa547('0xb')](),controller['update']);router[_0xa547('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xa547('0x1a')]);module[_0xa547('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 9b107af..64a34b0 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 _0x732f=['sequelize','exports','STRING'];(function(_0x396910,_0x397bda){var _0x217d81=function(_0x1e6ab9){while(--_0x1e6ab9){_0x396910['push'](_0x396910['shift']());}};_0x217d81(++_0x397bda);}(_0x732f,0xa2));var _0xf732=function(_0x325245,_0x5032a3){_0x325245=_0x325245-0x0;var _0x527f43=_0x732f[_0x325245];return _0x527f43;};'use strict';var Sequelize=require(_0xf732('0x0'));module[_0xf732('0x1')]={'name':{'type':Sequelize[_0xf732('0x2')]},'description':{'type':Sequelize[_0xf732('0x2')]}}; \ No newline at end of file +var _0x7b68=['STRING','sequelize'];(function(_0x19606c,_0x4a5db4){var _0x27a852=function(_0x19916c){while(--_0x19916c){_0x19606c['push'](_0x19606c['shift']());}};_0x27a852(++_0x4a5db4);}(_0x7b68,0x149));var _0x87b6=function(_0x502ada,_0x392aaa){_0x502ada=_0x502ada-0x0;var _0x412d3e=_0x7b68[_0x502ada];return _0x412d3e;};'use strict';var Sequelize=require(_0x87b6('0x0'));module['exports']={'name':{'type':Sequelize[_0x87b6('0x1')]},'description':{'type':Sequelize[_0x87b6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 80c601e..b0efacf 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 _0xa447=['setTags','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','json','reject','save','update','then','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','catch','create','body','find','destroy','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag'];(function(_0x5861c7,_0x496d1d){var _0xdd3f03=function(_0x91711d){while(--_0x91711d){_0x5861c7['push'](_0x5861c7['shift']());}};_0xdd3f03(++_0x496d1d);}(_0xa447,0x149));var _0x7a44=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xa447[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a44('0x0'));var rp=require(_0x7a44('0x1'));var moment=require(_0x7a44('0x2'));var BPromise=require(_0x7a44('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7a44('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a44('0x5'));var fs=require('fs');var fs_extra=require(_0x7a44('0x6'));var _=require(_0x7a44('0x7'));var squel=require(_0x7a44('0x8'));var crypto=require(_0x7a44('0x9'));var jsforce=require(_0x7a44('0xa'));var deskjs=require(_0x7a44('0xb'));var toCsv=require(_0x7a44('0xc'));var querystring=require(_0x7a44('0xd'));var Papa=require(_0x7a44('0xe'));var Redis=require(_0x7a44('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7a44('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a44('0x11'));var logger=require(_0x7a44('0x12'))(_0x7a44('0x13'));var utils=require(_0x7a44('0x14'));var config=require(_0x7a44('0x15'));var licenseUtil=require(_0x7a44('0x16'));var db=require(_0x7a44('0x17'))['db'];function respondWithStatusCode(_0x1654de,_0x4b80eb){_0x4b80eb=_0x4b80eb||0xcc;return function(_0x202079){if(_0x202079){return _0x1654de[_0x7a44('0x18')](_0x4b80eb);}return _0x1654de[_0x7a44('0x19')](_0x4b80eb)[_0x7a44('0x1a')]();};}function respondWithResult(_0x2ba39b,_0x59ea76){_0x59ea76=_0x59ea76||0xc8;return function(_0x286cca){if(_0x286cca){return _0x2ba39b[_0x7a44('0x19')](_0x59ea76)['json'](_0x286cca);}};}function respondWithFilteredResult(_0x4d608b,_0x5d523e){return function(_0x89a55a){if(_0x89a55a){var _0x5cab98=typeof _0x5d523e[_0x7a44('0x1b')]===_0x7a44('0x1c')&&typeof _0x5d523e['limit']===_0x7a44('0x1c');var _0x40eee7=_0x89a55a[_0x7a44('0x1d')];var _0x415563=_0x5cab98?0x0:_0x5d523e[_0x7a44('0x1b')];var _0xe02a20=_0x5cab98?_0x89a55a[_0x7a44('0x1d')]:_0x5d523e[_0x7a44('0x1b')]+_0x5d523e['limit'];var _0x24bb5e;if(_0xe02a20>=_0x40eee7){_0xe02a20=_0x40eee7;_0x24bb5e=0xc8;}else{_0x24bb5e=0xce;}_0x4d608b[_0x7a44('0x19')](_0x24bb5e);return _0x4d608b[_0x7a44('0x1e')]('Content-Range',_0x415563+'-'+_0xe02a20+'/'+_0x40eee7)[_0x7a44('0x1f')](_0x89a55a);}return null;};}function patchUpdates(_0x2c4087){return function(_0x2e235c){try{jsonpatch['apply'](_0x2e235c,_0x2c4087,!![]);}catch(_0x1c36b9){return BPromise[_0x7a44('0x20')](_0x1c36b9);}return _0x2e235c[_0x7a44('0x21')]();};}function saveUpdates(_0x56d470,_0x36b281){return function(_0x42ad34){if(_0x42ad34){return _0x42ad34[_0x7a44('0x22')](_0x56d470)[_0x7a44('0x23')](function(_0x265ef4){return _0x265ef4;});}return null;};}function removeEntity(_0x1a19ad,_0x4d7531){return function(_0x865029){if(_0x865029){return _0x865029['destroy']()[_0x7a44('0x23')](function(){_0x1a19ad[_0x7a44('0x19')](0xcc)[_0x7a44('0x1a')]();});}};}function handleEntityNotFound(_0x42c78d,_0x2f38da){return function(_0x3fbde3){if(!_0x3fbde3){_0x42c78d[_0x7a44('0x18')](0x194);}return _0x3fbde3;};}function handleError(_0x486e37,_0x581ea9){_0x581ea9=_0x581ea9||0x1f4;return function(_0xbdfa47){logger['error'](_0xbdfa47[_0x7a44('0x24')]);if(_0xbdfa47[_0x7a44('0x25')]){delete _0xbdfa47['name'];}_0x486e37[_0x7a44('0x19')](_0x581ea9)['send'](_0xbdfa47);};}exports[_0x7a44('0x26')]=function(_0x2d6a26,_0x1f2548){var _0x5db01e={},_0x5aca97={},_0xc3105d={'count':0x0,'rows':[]};var _0x17a736=_[_0x7a44('0x27')](db[_0x7a44('0x28')][_0x7a44('0x29')],function(_0x3952c3){return{'name':_0x3952c3[_0x7a44('0x2a')],'type':_0x3952c3[_0x7a44('0x2b')][_0x7a44('0x2c')]};});_0x5aca97['model']=_[_0x7a44('0x27')](_0x17a736,_0x7a44('0x25'));_0x5aca97[_0x7a44('0x2d')]=_['keys'](_0x2d6a26[_0x7a44('0x2d')]);_0x5aca97['filters']=_[_0x7a44('0x2e')](_0x5aca97[_0x7a44('0x2f')],_0x5aca97[_0x7a44('0x2d')]);_0x5db01e[_0x7a44('0x30')]=_['intersection'](_0x5aca97[_0x7a44('0x2f')],qs[_0x7a44('0x31')](_0x2d6a26[_0x7a44('0x2d')]['fields']));_0x5db01e[_0x7a44('0x30')]=_0x5db01e[_0x7a44('0x30')][_0x7a44('0x32')]?_0x5db01e['attributes']:_0x5aca97[_0x7a44('0x2f')];if(!_0x2d6a26[_0x7a44('0x2d')][_0x7a44('0x33')](_0x7a44('0x34'))){_0x5db01e[_0x7a44('0x35')]=qs['limit'](_0x2d6a26[_0x7a44('0x2d')][_0x7a44('0x35')]);_0x5db01e['offset']=qs['offset'](_0x2d6a26[_0x7a44('0x2d')]['offset']);}_0x5db01e[_0x7a44('0x36')]=qs[_0x7a44('0x37')](_0x2d6a26['query']['sort']);_0x5db01e[_0x7a44('0x38')]=qs[_0x7a44('0x39')](_[_0x7a44('0x3a')](_0x2d6a26[_0x7a44('0x2d')],_0x5aca97[_0x7a44('0x39')]),_0x17a736);if(_0x2d6a26[_0x7a44('0x2d')][_0x7a44('0x3b')]){_0x5db01e[_0x7a44('0x38')]=_[_0x7a44('0x3c')](_0x5db01e[_0x7a44('0x38')],{'$or':_[_0x7a44('0x27')](_0x17a736,function(_0x2ddf08){if(_0x2ddf08[_0x7a44('0x2b')]!=='VIRTUAL'){var _0x57edca={};_0x57edca[_0x2ddf08[_0x7a44('0x25')]]={'$like':'%'+_0x2d6a26[_0x7a44('0x2d')]['filter']+'%'};return _0x57edca;}})});}_0x5db01e=_['merge']({},_0x5db01e,_0x2d6a26[_0x7a44('0x3d')]);var _0xe114a9={'where':_0x5db01e['where']};return db[_0x7a44('0x28')][_0x7a44('0x1d')](_0xe114a9)[_0x7a44('0x23')](function(_0x224875){_0xc3105d[_0x7a44('0x1d')]=_0x224875;if(_0x2d6a26[_0x7a44('0x2d')]['includeAll']){_0x5db01e[_0x7a44('0x3e')]=[{'all':!![]}];}return db[_0x7a44('0x28')][_0x7a44('0x3f')](_0x5db01e);})[_0x7a44('0x23')](function(_0x1ba616){_0xc3105d[_0x7a44('0x40')]=_0x1ba616;return _0xc3105d;})[_0x7a44('0x23')](respondWithFilteredResult(_0x1f2548,_0x5db01e))['catch'](handleError(_0x1f2548,null));};exports[_0x7a44('0x41')]=function(_0x55a4dd,_0x6842dc){var _0xa43772={'raw':![],'where':{'id':_0x55a4dd[_0x7a44('0x42')]['id']}},_0x1bd579={};_0x1bd579[_0x7a44('0x2f')]=_['keys'](db[_0x7a44('0x28')][_0x7a44('0x29')]);_0x1bd579[_0x7a44('0x2d')]=_[_0x7a44('0x43')](_0x55a4dd[_0x7a44('0x2d')]);_0x1bd579[_0x7a44('0x39')]=_[_0x7a44('0x2e')](_0x1bd579[_0x7a44('0x2f')],_0x1bd579[_0x7a44('0x2d')]);_0xa43772[_0x7a44('0x30')]=_[_0x7a44('0x2e')](_0x1bd579[_0x7a44('0x2f')],qs[_0x7a44('0x31')](_0x55a4dd['query'][_0x7a44('0x31')]));_0xa43772[_0x7a44('0x30')]=_0xa43772[_0x7a44('0x30')][_0x7a44('0x32')]?_0xa43772[_0x7a44('0x30')]:_0x1bd579[_0x7a44('0x2f')];if(_0x55a4dd[_0x7a44('0x2d')][_0x7a44('0x44')]){_0xa43772['include']=[{'all':!![]}];}_0xa43772=_[_0x7a44('0x3c')]({},_0xa43772,_0x55a4dd[_0x7a44('0x3d')]);return db['FreshdeskConfiguration']['find'](_0xa43772)[_0x7a44('0x23')](handleEntityNotFound(_0x6842dc,null))[_0x7a44('0x23')](respondWithResult(_0x6842dc,null))[_0x7a44('0x45')](handleError(_0x6842dc,null));};exports[_0x7a44('0x46')]=function(_0x1999fb,_0x2ef1d2){return db[_0x7a44('0x28')][_0x7a44('0x46')](_0x1999fb[_0x7a44('0x47')],{})[_0x7a44('0x23')](respondWithResult(_0x2ef1d2,0xc9))['catch'](handleError(_0x2ef1d2,null));};exports[_0x7a44('0x22')]=function(_0x46d933,_0x52ff29){if(_0x46d933[_0x7a44('0x47')]['id']){delete _0x46d933[_0x7a44('0x47')]['id'];}return db[_0x7a44('0x28')][_0x7a44('0x48')]({'where':{'id':_0x46d933[_0x7a44('0x42')]['id']}})[_0x7a44('0x23')](handleEntityNotFound(_0x52ff29,null))[_0x7a44('0x23')](saveUpdates(_0x46d933['body'],null))[_0x7a44('0x23')](respondWithResult(_0x52ff29,null))[_0x7a44('0x45')](handleError(_0x52ff29,null));};exports[_0x7a44('0x49')]=function(_0x30c0cf,_0xb26c9b){return db[_0x7a44('0x28')][_0x7a44('0x48')]({'where':{'id':_0x30c0cf[_0x7a44('0x42')]['id']}})[_0x7a44('0x23')](handleEntityNotFound(_0xb26c9b,null))['then'](removeEntity(_0xb26c9b,null))[_0x7a44('0x45')](handleError(_0xb26c9b,null));};exports[_0x7a44('0x4a')]=function(_0x286b7c,_0x1da48f,_0x6a507){var _0x5c508b={};var _0x4325ea={};var _0x5dfe57;var _0x51f10a;return db[_0x7a44('0x28')][_0x7a44('0x4b')]({'where':{'id':_0x286b7c[_0x7a44('0x42')]['id']}})[_0x7a44('0x23')](handleEntityNotFound(_0x1da48f,null))[_0x7a44('0x23')](function(_0x33b555){if(_0x33b555){_0x5dfe57=_0x33b555;_0x4325ea[_0x7a44('0x2f')]=_[_0x7a44('0x43')](db[_0x7a44('0x4c')]['rawAttributes']);_0x4325ea[_0x7a44('0x2d')]=_[_0x7a44('0x43')](_0x286b7c[_0x7a44('0x2d')]);_0x4325ea[_0x7a44('0x39')]=_[_0x7a44('0x2e')](_0x4325ea['model'],_0x4325ea[_0x7a44('0x2d')]);_0x5c508b['attributes']=_['intersection'](_0x4325ea[_0x7a44('0x2f')],qs[_0x7a44('0x31')](_0x286b7c[_0x7a44('0x2d')]['fields']));_0x5c508b['attributes']=_0x5c508b[_0x7a44('0x30')][_0x7a44('0x32')]?_0x5c508b[_0x7a44('0x30')]:_0x4325ea[_0x7a44('0x2f')];_0x5c508b['order']=qs[_0x7a44('0x37')](_0x286b7c[_0x7a44('0x2d')][_0x7a44('0x37')]);_0x5c508b[_0x7a44('0x38')]=qs['filters'](_[_0x7a44('0x3a')](_0x286b7c[_0x7a44('0x2d')],_0x4325ea[_0x7a44('0x39')]));if(_0x286b7c['query'][_0x7a44('0x3b')]){_0x5c508b[_0x7a44('0x38')]=_['merge'](_0x5c508b[_0x7a44('0x38')],{'$or':_[_0x7a44('0x27')](_0x5c508b[_0x7a44('0x30')],function(_0x2de7cd){var _0x3e57bb={};_0x3e57bb[_0x2de7cd]={'$like':'%'+_0x286b7c[_0x7a44('0x2d')][_0x7a44('0x3b')]+'%'};return _0x3e57bb;})});}_0x5c508b=_[_0x7a44('0x3c')]({},_0x5c508b,_0x286b7c[_0x7a44('0x3d')]);return _0x5dfe57['getFields'](_0x5c508b);}})['then'](function(_0x31e4d6){if(_0x31e4d6){_0x51f10a=_0x31e4d6[_0x7a44('0x32')];if(!_0x286b7c['query'][_0x7a44('0x33')]('nolimit')){_0x5c508b[_0x7a44('0x35')]=qs['limit'](_0x286b7c[_0x7a44('0x2d')][_0x7a44('0x35')]);_0x5c508b['offset']=qs[_0x7a44('0x1b')](_0x286b7c[_0x7a44('0x2d')][_0x7a44('0x1b')]);}return _0x5dfe57[_0x7a44('0x4a')](_0x5c508b);}})['then'](function(_0x2bd35b){if(_0x2bd35b){return _0x2bd35b?{'count':_0x51f10a,'rows':_0x2bd35b}:null;}})['then'](respondWithResult(_0x1da48f,null))['catch'](handleError(_0x1da48f,null));};exports[_0x7a44('0x4d')]=function(_0x37777c,_0x45b167,_0x4b3e53){var _0x3e3a43={};var _0x15bb40={};var _0x503093;var _0x5bebc5;return db['FreshdeskConfiguration'][_0x7a44('0x4b')]({'where':{'id':_0x37777c[_0x7a44('0x42')]['id']}})[_0x7a44('0x23')](handleEntityNotFound(_0x45b167,null))[_0x7a44('0x23')](function(_0x3ce003){if(_0x3ce003){_0x503093=_0x3ce003;_0x15bb40[_0x7a44('0x2f')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x15bb40[_0x7a44('0x2d')]=_[_0x7a44('0x43')](_0x37777c[_0x7a44('0x2d')]);_0x15bb40['filters']=_[_0x7a44('0x2e')](_0x15bb40[_0x7a44('0x2f')],_0x15bb40['query']);_0x3e3a43[_0x7a44('0x30')]=_['intersection'](_0x15bb40[_0x7a44('0x2f')],qs['fields'](_0x37777c[_0x7a44('0x2d')][_0x7a44('0x31')]));_0x3e3a43[_0x7a44('0x30')]=_0x3e3a43[_0x7a44('0x30')][_0x7a44('0x32')]?_0x3e3a43[_0x7a44('0x30')]:_0x15bb40['model'];_0x3e3a43[_0x7a44('0x36')]=qs[_0x7a44('0x37')](_0x37777c[_0x7a44('0x2d')]['sort']);_0x3e3a43[_0x7a44('0x38')]=qs[_0x7a44('0x39')](_[_0x7a44('0x3a')](_0x37777c[_0x7a44('0x2d')],_0x15bb40[_0x7a44('0x39')]));if(_0x37777c[_0x7a44('0x2d')][_0x7a44('0x3b')]){_0x3e3a43[_0x7a44('0x38')]=_['merge'](_0x3e3a43[_0x7a44('0x38')],{'$or':_['map'](_0x3e3a43[_0x7a44('0x30')],function(_0x27c499){var _0x2422bb={};_0x2422bb[_0x27c499]={'$like':'%'+_0x37777c['query']['filter']+'%'};return _0x2422bb;})});}_0x3e3a43=_[_0x7a44('0x3c')]({},_0x3e3a43,_0x37777c[_0x7a44('0x3d')]);return _0x503093[_0x7a44('0x4d')](_0x3e3a43);}})[_0x7a44('0x23')](function(_0x4a2b78){if(_0x4a2b78){_0x5bebc5=_0x4a2b78['length'];if(!_0x37777c[_0x7a44('0x2d')]['hasOwnProperty']('nolimit')){_0x3e3a43[_0x7a44('0x35')]=qs[_0x7a44('0x35')](_0x37777c[_0x7a44('0x2d')][_0x7a44('0x35')]);_0x3e3a43[_0x7a44('0x1b')]=qs[_0x7a44('0x1b')](_0x37777c[_0x7a44('0x2d')]['offset']);}return _0x503093[_0x7a44('0x4d')](_0x3e3a43);}})['then'](function(_0x20d956){if(_0x20d956){return _0x20d956?{'count':_0x5bebc5,'rows':_0x20d956}:null;}})[_0x7a44('0x23')](respondWithResult(_0x45b167,null))['catch'](handleError(_0x45b167,null));};exports[_0x7a44('0x4e')]=function(_0x25aa38,_0xdf6c73,_0x280757){var _0x5caac9={};var _0x560d72={};var _0x411a56;var _0x4d6de8;return db['FreshdeskConfiguration'][_0x7a44('0x4b')]({'where':{'id':_0x25aa38[_0x7a44('0x42')]['id']}})[_0x7a44('0x23')](handleEntityNotFound(_0xdf6c73,null))[_0x7a44('0x23')](function(_0x42b131){if(_0x42b131){_0x411a56=_0x42b131;_0x560d72[_0x7a44('0x2f')]=_[_0x7a44('0x43')](db[_0x7a44('0x4c')][_0x7a44('0x29')]);_0x560d72[_0x7a44('0x2d')]=_[_0x7a44('0x43')](_0x25aa38[_0x7a44('0x2d')]);_0x560d72[_0x7a44('0x39')]=_[_0x7a44('0x2e')](_0x560d72['model'],_0x560d72[_0x7a44('0x2d')]);_0x5caac9['attributes']=_[_0x7a44('0x2e')](_0x560d72['model'],qs[_0x7a44('0x31')](_0x25aa38[_0x7a44('0x2d')][_0x7a44('0x31')]));_0x5caac9[_0x7a44('0x30')]=_0x5caac9['attributes'][_0x7a44('0x32')]?_0x5caac9[_0x7a44('0x30')]:_0x560d72[_0x7a44('0x2f')];_0x5caac9[_0x7a44('0x36')]=qs[_0x7a44('0x37')](_0x25aa38['query']['sort']);_0x5caac9[_0x7a44('0x38')]=qs['filters'](_[_0x7a44('0x3a')](_0x25aa38[_0x7a44('0x2d')],_0x560d72[_0x7a44('0x39')]));if(_0x25aa38[_0x7a44('0x2d')][_0x7a44('0x3b')]){_0x5caac9[_0x7a44('0x38')]=_['merge'](_0x5caac9[_0x7a44('0x38')],{'$or':_[_0x7a44('0x27')](_0x5caac9[_0x7a44('0x30')],function(_0x44e9f5){var _0x2bddfb={};_0x2bddfb[_0x44e9f5]={'$like':'%'+_0x25aa38['query'][_0x7a44('0x3b')]+'%'};return _0x2bddfb;})});}_0x5caac9=_['merge']({},_0x5caac9,_0x25aa38[_0x7a44('0x3d')]);return _0x411a56[_0x7a44('0x4e')](_0x5caac9);}})[_0x7a44('0x23')](function(_0x272d60){if(_0x272d60){_0x4d6de8=_0x272d60[_0x7a44('0x32')];if(!_0x25aa38['query'][_0x7a44('0x33')](_0x7a44('0x34'))){_0x5caac9['limit']=qs[_0x7a44('0x35')](_0x25aa38[_0x7a44('0x2d')]['limit']);_0x5caac9[_0x7a44('0x1b')]=qs[_0x7a44('0x1b')](_0x25aa38[_0x7a44('0x2d')]['offset']);}return _0x411a56['getDescriptions'](_0x5caac9);}})[_0x7a44('0x23')](function(_0x30e2f7){if(_0x30e2f7){return _0x30e2f7?{'count':_0x4d6de8,'rows':_0x30e2f7}:null;}})[_0x7a44('0x23')](respondWithResult(_0xdf6c73,null))[_0x7a44('0x45')](handleError(_0xdf6c73,null));};exports[_0x7a44('0x4f')]=function(_0x41e10f,_0x437cd4,_0x5c0948){var _0x4c5df7={};var _0x270408={};var _0x28163f;var _0x23dfbf;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x41e10f['params']['id']}})[_0x7a44('0x23')](handleEntityNotFound(_0x437cd4,null))['then'](function(_0x2a26ce){if(_0x2a26ce){_0x28163f=_0x2a26ce;_0x270408['model']=_[_0x7a44('0x43')](db[_0x7a44('0x50')]['rawAttributes']);_0x270408[_0x7a44('0x2d')]=_[_0x7a44('0x43')](_0x41e10f['query']);_0x270408[_0x7a44('0x39')]=_[_0x7a44('0x2e')](_0x270408[_0x7a44('0x2f')],_0x270408[_0x7a44('0x2d')]);_0x4c5df7[_0x7a44('0x30')]=_[_0x7a44('0x2e')](_0x270408[_0x7a44('0x2f')],qs['fields'](_0x41e10f[_0x7a44('0x2d')][_0x7a44('0x31')]));_0x4c5df7['attributes']=_0x4c5df7[_0x7a44('0x30')][_0x7a44('0x32')]?_0x4c5df7[_0x7a44('0x30')]:_0x270408[_0x7a44('0x2f')];_0x4c5df7[_0x7a44('0x36')]=qs[_0x7a44('0x37')](_0x41e10f[_0x7a44('0x2d')]['sort']);_0x4c5df7[_0x7a44('0x38')]=qs[_0x7a44('0x39')](_['pick'](_0x41e10f[_0x7a44('0x2d')],_0x270408[_0x7a44('0x39')]));if(_0x41e10f['query'][_0x7a44('0x3b')]){_0x4c5df7[_0x7a44('0x38')]=_['merge'](_0x4c5df7['where'],{'$or':_[_0x7a44('0x27')](_0x4c5df7[_0x7a44('0x30')],function(_0x557254){var _0x4eaccf={};_0x4eaccf[_0x557254]={'$like':'%'+_0x41e10f['query'][_0x7a44('0x3b')]+'%'};return _0x4eaccf;})});}_0x4c5df7=_[_0x7a44('0x3c')]({},_0x4c5df7,_0x41e10f[_0x7a44('0x3d')]);return _0x28163f[_0x7a44('0x4f')](_0x4c5df7);}})[_0x7a44('0x23')](function(_0x1cc379){if(_0x1cc379){_0x23dfbf=_0x1cc379[_0x7a44('0x32')];if(!_0x41e10f[_0x7a44('0x2d')][_0x7a44('0x33')](_0x7a44('0x34'))){_0x4c5df7['limit']=qs[_0x7a44('0x35')](_0x41e10f[_0x7a44('0x2d')][_0x7a44('0x35')]);_0x4c5df7[_0x7a44('0x1b')]=qs[_0x7a44('0x1b')](_0x41e10f[_0x7a44('0x2d')][_0x7a44('0x1b')]);}return _0x28163f['getTags'](_0x4c5df7);}})[_0x7a44('0x23')](function(_0x44000e){if(_0x44000e){return _0x44000e?{'count':_0x23dfbf,'rows':_0x44000e}:null;}})[_0x7a44('0x23')](respondWithResult(_0x437cd4,null))[_0x7a44('0x45')](handleError(_0x437cd4,null));};exports[_0x7a44('0x51')]=function(_0x23af9f,_0x4a7a22,_0x2f9fbe){if(_0x23af9f[_0x7a44('0x47')]['id']){delete _0x23af9f['body']['id'];}return db[_0x7a44('0x28')][_0x7a44('0x4b')]({'where':{'id':_0x23af9f[_0x7a44('0x42')]['id']}})[_0x7a44('0x23')](handleEntityNotFound(_0x4a7a22,null))['then'](function(_0x300f31){if(_0x300f31){return _0x300f31[_0x7a44('0x51')](_0x23af9f[_0x7a44('0x47')]['ids']||[]);}return null;})[_0x7a44('0x23')](respondWithResult(_0x4a7a22,null))['catch'](handleError(_0x4a7a22,null));}; \ No newline at end of file +var _0x0b24=['setTags','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','destroy','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','then','includeAll','findAll','catch','show','params','intersection','length','include','find','create','body','update','getFields','FreshdeskField','getSubjects','findOne','getDescriptions','getTags'];(function(_0x54c10d,_0x2f2251){var _0x1fa703=function(_0x508eb4){while(--_0x508eb4){_0x54c10d['push'](_0x54c10d['shift']());}};_0x1fa703(++_0x2f2251);}(_0x0b24,0x197));var _0x40b2=function(_0x2376ac,_0xd82fd0){_0x2376ac=_0x2376ac-0x0;var _0x106daf=_0x0b24[_0x2376ac];return _0x106daf;};'use strict';var emlformat=require(_0x40b2('0x0'));var rimraf=require(_0x40b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x40b2('0x2'));var rp=require('request-promise');var moment=require(_0x40b2('0x3'));var BPromise=require(_0x40b2('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x40b2('0x5'));var sox=require(_0x40b2('0x6'));var csv=require(_0x40b2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40b2('0x8'));var _=require('lodash');var squel=require(_0x40b2('0x9'));var crypto=require(_0x40b2('0xa'));var jsforce=require(_0x40b2('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x40b2('0xc'));var Papa=require(_0x40b2('0xd'));var Redis=require(_0x40b2('0xe'));var authService=require(_0x40b2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x40b2('0x10'));var hardwareService=require(_0x40b2('0x11'));var logger=require(_0x40b2('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x40b2('0x13'));var db=require(_0x40b2('0x14'))['db'];function respondWithStatusCode(_0x431950,_0x50e928){_0x50e928=_0x50e928||0xcc;return function(_0x4a65d8){if(_0x4a65d8){return _0x431950[_0x40b2('0x15')](_0x50e928);}return _0x431950[_0x40b2('0x16')](_0x50e928)[_0x40b2('0x17')]();};}function respondWithResult(_0x1bbb70,_0x5ddfd9){_0x5ddfd9=_0x5ddfd9||0xc8;return function(_0x506185){if(_0x506185){return _0x1bbb70[_0x40b2('0x16')](_0x5ddfd9)[_0x40b2('0x18')](_0x506185);}};}function respondWithFilteredResult(_0x1b6489,_0x2ae5e0){return function(_0x5799e9){if(_0x5799e9){var _0x4ff4b3=typeof _0x2ae5e0['offset']===_0x40b2('0x19')&&typeof _0x2ae5e0['limit']===_0x40b2('0x19');var _0x4a8f14=_0x5799e9[_0x40b2('0x1a')];var _0xac980d=_0x4ff4b3?0x0:_0x2ae5e0[_0x40b2('0x1b')];var _0x46bec0=_0x4ff4b3?_0x5799e9[_0x40b2('0x1a')]:_0x2ae5e0['offset']+_0x2ae5e0[_0x40b2('0x1c')];var _0x342a45;if(_0x46bec0>=_0x4a8f14){_0x46bec0=_0x4a8f14;_0x342a45=0xc8;}else{_0x342a45=0xce;}_0x1b6489['status'](_0x342a45);return _0x1b6489[_0x40b2('0x1d')]('Content-Range',_0xac980d+'-'+_0x46bec0+'/'+_0x4a8f14)[_0x40b2('0x18')](_0x5799e9);}return null;};}function patchUpdates(_0x4c5fe3){return function(_0x550e7e){try{jsonpatch[_0x40b2('0x1e')](_0x550e7e,_0x4c5fe3,!![]);}catch(_0x4d50ae){return BPromise[_0x40b2('0x1f')](_0x4d50ae);}return _0x550e7e[_0x40b2('0x20')]();};}function saveUpdates(_0x282b7a,_0x58b1bc){return function(_0x26ee1d){if(_0x26ee1d){return _0x26ee1d['update'](_0x282b7a)['then'](function(_0x5eda36){return _0x5eda36;});}return null;};}function removeEntity(_0x2a31db,_0x1d45d8){return function(_0x22efe1){if(_0x22efe1){return _0x22efe1[_0x40b2('0x21')]()['then'](function(){_0x2a31db[_0x40b2('0x16')](0xcc)[_0x40b2('0x17')]();});}};}function handleEntityNotFound(_0x3377d8,_0x4e08d6){return function(_0x4510c9){if(!_0x4510c9){_0x3377d8[_0x40b2('0x15')](0x194);}return _0x4510c9;};}function handleError(_0xdc5e9a,_0x1311a1){_0x1311a1=_0x1311a1||0x1f4;return function(_0xed14c8){logger[_0x40b2('0x22')](_0xed14c8[_0x40b2('0x23')]);if(_0xed14c8[_0x40b2('0x24')]){delete _0xed14c8[_0x40b2('0x24')];}_0xdc5e9a[_0x40b2('0x16')](_0x1311a1)[_0x40b2('0x25')](_0xed14c8);};}exports['index']=function(_0x26a043,_0x47089d){var _0x437091={},_0x511583={},_0xbb26e5={'count':0x0,'rows':[]};var _0xcde9e=_[_0x40b2('0x26')](db[_0x40b2('0x27')][_0x40b2('0x28')],function(_0xe18936){return{'name':_0xe18936[_0x40b2('0x29')],'type':_0xe18936['type'][_0x40b2('0x2a')]};});_0x511583[_0x40b2('0x2b')]=_[_0x40b2('0x26')](_0xcde9e,_0x40b2('0x24'));_0x511583[_0x40b2('0x2c')]=_[_0x40b2('0x2d')](_0x26a043[_0x40b2('0x2c')]);_0x511583[_0x40b2('0x2e')]=_['intersection'](_0x511583[_0x40b2('0x2b')],_0x511583[_0x40b2('0x2c')]);_0x437091[_0x40b2('0x2f')]=_['intersection'](_0x511583[_0x40b2('0x2b')],qs[_0x40b2('0x30')](_0x26a043[_0x40b2('0x2c')][_0x40b2('0x30')]));_0x437091[_0x40b2('0x2f')]=_0x437091[_0x40b2('0x2f')]['length']?_0x437091[_0x40b2('0x2f')]:_0x511583[_0x40b2('0x2b')];if(!_0x26a043[_0x40b2('0x2c')][_0x40b2('0x31')](_0x40b2('0x32'))){_0x437091[_0x40b2('0x1c')]=qs[_0x40b2('0x1c')](_0x26a043['query']['limit']);_0x437091['offset']=qs[_0x40b2('0x1b')](_0x26a043[_0x40b2('0x2c')][_0x40b2('0x1b')]);}_0x437091[_0x40b2('0x33')]=qs[_0x40b2('0x34')](_0x26a043[_0x40b2('0x2c')][_0x40b2('0x34')]);_0x437091[_0x40b2('0x35')]=qs[_0x40b2('0x2e')](_[_0x40b2('0x36')](_0x26a043[_0x40b2('0x2c')],_0x511583['filters']),_0xcde9e);if(_0x26a043[_0x40b2('0x2c')][_0x40b2('0x37')]){_0x437091['where']=_['merge'](_0x437091[_0x40b2('0x35')],{'$or':_[_0x40b2('0x26')](_0xcde9e,function(_0x54dc46){if(_0x54dc46[_0x40b2('0x38')]!==_0x40b2('0x39')){var _0x4c60d0={};_0x4c60d0[_0x54dc46[_0x40b2('0x24')]]={'$like':'%'+_0x26a043[_0x40b2('0x2c')][_0x40b2('0x37')]+'%'};return _0x4c60d0;}})});}_0x437091=_[_0x40b2('0x3a')]({},_0x437091,_0x26a043[_0x40b2('0x3b')]);var _0x1fcc90={'where':_0x437091[_0x40b2('0x35')]};return db[_0x40b2('0x27')][_0x40b2('0x1a')](_0x1fcc90)[_0x40b2('0x3c')](function(_0x4b1216){_0xbb26e5['count']=_0x4b1216;if(_0x26a043[_0x40b2('0x2c')][_0x40b2('0x3d')]){_0x437091['include']=[{'all':!![]}];}return db[_0x40b2('0x27')][_0x40b2('0x3e')](_0x437091);})[_0x40b2('0x3c')](function(_0x1b38db){_0xbb26e5['rows']=_0x1b38db;return _0xbb26e5;})[_0x40b2('0x3c')](respondWithFilteredResult(_0x47089d,_0x437091))[_0x40b2('0x3f')](handleError(_0x47089d,null));};exports[_0x40b2('0x40')]=function(_0x46dd87,_0x5904be){var _0x15c7b9={'raw':![],'where':{'id':_0x46dd87[_0x40b2('0x41')]['id']}},_0xda28a7={};_0xda28a7[_0x40b2('0x2b')]=_[_0x40b2('0x2d')](db['FreshdeskConfiguration'][_0x40b2('0x28')]);_0xda28a7[_0x40b2('0x2c')]=_[_0x40b2('0x2d')](_0x46dd87['query']);_0xda28a7[_0x40b2('0x2e')]=_[_0x40b2('0x42')](_0xda28a7[_0x40b2('0x2b')],_0xda28a7[_0x40b2('0x2c')]);_0x15c7b9[_0x40b2('0x2f')]=_[_0x40b2('0x42')](_0xda28a7['model'],qs[_0x40b2('0x30')](_0x46dd87[_0x40b2('0x2c')]['fields']));_0x15c7b9[_0x40b2('0x2f')]=_0x15c7b9[_0x40b2('0x2f')][_0x40b2('0x43')]?_0x15c7b9['attributes']:_0xda28a7['model'];if(_0x46dd87[_0x40b2('0x2c')]['includeAll']){_0x15c7b9[_0x40b2('0x44')]=[{'all':!![]}];}_0x15c7b9=_[_0x40b2('0x3a')]({},_0x15c7b9,_0x46dd87[_0x40b2('0x3b')]);return db[_0x40b2('0x27')][_0x40b2('0x45')](_0x15c7b9)['then'](handleEntityNotFound(_0x5904be,null))[_0x40b2('0x3c')](respondWithResult(_0x5904be,null))['catch'](handleError(_0x5904be,null));};exports[_0x40b2('0x46')]=function(_0x88a601,_0x33a355){return db['FreshdeskConfiguration']['create'](_0x88a601[_0x40b2('0x47')],{})[_0x40b2('0x3c')](respondWithResult(_0x33a355,0xc9))['catch'](handleError(_0x33a355,null));};exports[_0x40b2('0x48')]=function(_0x1ce8e9,_0x1eaf51){if(_0x1ce8e9[_0x40b2('0x47')]['id']){delete _0x1ce8e9[_0x40b2('0x47')]['id'];}return db[_0x40b2('0x27')]['find']({'where':{'id':_0x1ce8e9[_0x40b2('0x41')]['id']}})['then'](handleEntityNotFound(_0x1eaf51,null))['then'](saveUpdates(_0x1ce8e9[_0x40b2('0x47')],null))[_0x40b2('0x3c')](respondWithResult(_0x1eaf51,null))[_0x40b2('0x3f')](handleError(_0x1eaf51,null));};exports[_0x40b2('0x21')]=function(_0xd2550d,_0x266d09){return db[_0x40b2('0x27')]['find']({'where':{'id':_0xd2550d[_0x40b2('0x41')]['id']}})[_0x40b2('0x3c')](handleEntityNotFound(_0x266d09,null))[_0x40b2('0x3c')](removeEntity(_0x266d09,null))[_0x40b2('0x3f')](handleError(_0x266d09,null));};exports[_0x40b2('0x49')]=function(_0x2cf57d,_0x276c35,_0x58ded8){var _0x392434={};var _0x19b399={};var _0x5538dd;var _0xacc4a7;return db[_0x40b2('0x27')]['findOne']({'where':{'id':_0x2cf57d[_0x40b2('0x41')]['id']}})[_0x40b2('0x3c')](handleEntityNotFound(_0x276c35,null))[_0x40b2('0x3c')](function(_0x3ceb4f){if(_0x3ceb4f){_0x5538dd=_0x3ceb4f;_0x19b399['model']=_['keys'](db[_0x40b2('0x4a')][_0x40b2('0x28')]);_0x19b399[_0x40b2('0x2c')]=_['keys'](_0x2cf57d[_0x40b2('0x2c')]);_0x19b399[_0x40b2('0x2e')]=_['intersection'](_0x19b399[_0x40b2('0x2b')],_0x19b399[_0x40b2('0x2c')]);_0x392434[_0x40b2('0x2f')]=_['intersection'](_0x19b399['model'],qs[_0x40b2('0x30')](_0x2cf57d[_0x40b2('0x2c')][_0x40b2('0x30')]));_0x392434[_0x40b2('0x2f')]=_0x392434['attributes'][_0x40b2('0x43')]?_0x392434[_0x40b2('0x2f')]:_0x19b399[_0x40b2('0x2b')];_0x392434[_0x40b2('0x33')]=qs['sort'](_0x2cf57d[_0x40b2('0x2c')]['sort']);_0x392434[_0x40b2('0x35')]=qs[_0x40b2('0x2e')](_[_0x40b2('0x36')](_0x2cf57d[_0x40b2('0x2c')],_0x19b399[_0x40b2('0x2e')]));if(_0x2cf57d[_0x40b2('0x2c')][_0x40b2('0x37')]){_0x392434[_0x40b2('0x35')]=_['merge'](_0x392434[_0x40b2('0x35')],{'$or':_[_0x40b2('0x26')](_0x392434[_0x40b2('0x2f')],function(_0x7c10ad){var _0x3223fb={};_0x3223fb[_0x7c10ad]={'$like':'%'+_0x2cf57d[_0x40b2('0x2c')][_0x40b2('0x37')]+'%'};return _0x3223fb;})});}_0x392434=_[_0x40b2('0x3a')]({},_0x392434,_0x2cf57d[_0x40b2('0x3b')]);return _0x5538dd[_0x40b2('0x49')](_0x392434);}})[_0x40b2('0x3c')](function(_0x5bedc8){if(_0x5bedc8){_0xacc4a7=_0x5bedc8[_0x40b2('0x43')];if(!_0x2cf57d['query']['hasOwnProperty']('nolimit')){_0x392434['limit']=qs[_0x40b2('0x1c')](_0x2cf57d[_0x40b2('0x2c')]['limit']);_0x392434['offset']=qs['offset'](_0x2cf57d[_0x40b2('0x2c')][_0x40b2('0x1b')]);}return _0x5538dd['getFields'](_0x392434);}})[_0x40b2('0x3c')](function(_0x42c137){if(_0x42c137){return _0x42c137?{'count':_0xacc4a7,'rows':_0x42c137}:null;}})[_0x40b2('0x3c')](respondWithResult(_0x276c35,null))[_0x40b2('0x3f')](handleError(_0x276c35,null));};exports[_0x40b2('0x4b')]=function(_0x23103e,_0x18c087,_0x39e023){var _0xd317b3={};var _0x40cbd9={};var _0x5f3961;var _0x97067e;return db[_0x40b2('0x27')][_0x40b2('0x4c')]({'where':{'id':_0x23103e[_0x40b2('0x41')]['id']}})[_0x40b2('0x3c')](handleEntityNotFound(_0x18c087,null))[_0x40b2('0x3c')](function(_0x1db842){if(_0x1db842){_0x5f3961=_0x1db842;_0x40cbd9['model']=_[_0x40b2('0x2d')](db['FreshdeskField'][_0x40b2('0x28')]);_0x40cbd9[_0x40b2('0x2c')]=_[_0x40b2('0x2d')](_0x23103e[_0x40b2('0x2c')]);_0x40cbd9[_0x40b2('0x2e')]=_[_0x40b2('0x42')](_0x40cbd9[_0x40b2('0x2b')],_0x40cbd9[_0x40b2('0x2c')]);_0xd317b3['attributes']=_['intersection'](_0x40cbd9['model'],qs[_0x40b2('0x30')](_0x23103e[_0x40b2('0x2c')][_0x40b2('0x30')]));_0xd317b3[_0x40b2('0x2f')]=_0xd317b3[_0x40b2('0x2f')][_0x40b2('0x43')]?_0xd317b3['attributes']:_0x40cbd9[_0x40b2('0x2b')];_0xd317b3[_0x40b2('0x33')]=qs[_0x40b2('0x34')](_0x23103e['query']['sort']);_0xd317b3[_0x40b2('0x35')]=qs['filters'](_[_0x40b2('0x36')](_0x23103e[_0x40b2('0x2c')],_0x40cbd9[_0x40b2('0x2e')]));if(_0x23103e[_0x40b2('0x2c')]['filter']){_0xd317b3['where']=_[_0x40b2('0x3a')](_0xd317b3[_0x40b2('0x35')],{'$or':_[_0x40b2('0x26')](_0xd317b3[_0x40b2('0x2f')],function(_0x296155){var _0x5163b2={};_0x5163b2[_0x296155]={'$like':'%'+_0x23103e[_0x40b2('0x2c')][_0x40b2('0x37')]+'%'};return _0x5163b2;})});}_0xd317b3=_['merge']({},_0xd317b3,_0x23103e[_0x40b2('0x3b')]);return _0x5f3961[_0x40b2('0x4b')](_0xd317b3);}})[_0x40b2('0x3c')](function(_0x3f3d2a){if(_0x3f3d2a){_0x97067e=_0x3f3d2a[_0x40b2('0x43')];if(!_0x23103e[_0x40b2('0x2c')][_0x40b2('0x31')](_0x40b2('0x32'))){_0xd317b3['limit']=qs[_0x40b2('0x1c')](_0x23103e[_0x40b2('0x2c')][_0x40b2('0x1c')]);_0xd317b3[_0x40b2('0x1b')]=qs[_0x40b2('0x1b')](_0x23103e[_0x40b2('0x2c')]['offset']);}return _0x5f3961[_0x40b2('0x4b')](_0xd317b3);}})[_0x40b2('0x3c')](function(_0x3bb320){if(_0x3bb320){return _0x3bb320?{'count':_0x97067e,'rows':_0x3bb320}:null;}})[_0x40b2('0x3c')](respondWithResult(_0x18c087,null))[_0x40b2('0x3f')](handleError(_0x18c087,null));};exports['getDescriptions']=function(_0x4aa147,_0x605ada,_0x49e7da){var _0x599166={};var _0x4dec51={};var _0x27e465;var _0x584356;return db[_0x40b2('0x27')][_0x40b2('0x4c')]({'where':{'id':_0x4aa147['params']['id']}})[_0x40b2('0x3c')](handleEntityNotFound(_0x605ada,null))[_0x40b2('0x3c')](function(_0xc77021){if(_0xc77021){_0x27e465=_0xc77021;_0x4dec51[_0x40b2('0x2b')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x4dec51[_0x40b2('0x2c')]=_[_0x40b2('0x2d')](_0x4aa147['query']);_0x4dec51[_0x40b2('0x2e')]=_['intersection'](_0x4dec51[_0x40b2('0x2b')],_0x4dec51[_0x40b2('0x2c')]);_0x599166[_0x40b2('0x2f')]=_['intersection'](_0x4dec51[_0x40b2('0x2b')],qs[_0x40b2('0x30')](_0x4aa147[_0x40b2('0x2c')]['fields']));_0x599166[_0x40b2('0x2f')]=_0x599166['attributes'][_0x40b2('0x43')]?_0x599166[_0x40b2('0x2f')]:_0x4dec51[_0x40b2('0x2b')];_0x599166[_0x40b2('0x33')]=qs[_0x40b2('0x34')](_0x4aa147['query']['sort']);_0x599166['where']=qs[_0x40b2('0x2e')](_[_0x40b2('0x36')](_0x4aa147[_0x40b2('0x2c')],_0x4dec51['filters']));if(_0x4aa147['query'][_0x40b2('0x37')]){_0x599166[_0x40b2('0x35')]=_[_0x40b2('0x3a')](_0x599166[_0x40b2('0x35')],{'$or':_['map'](_0x599166[_0x40b2('0x2f')],function(_0x51816e){var _0x24eb69={};_0x24eb69[_0x51816e]={'$like':'%'+_0x4aa147['query'][_0x40b2('0x37')]+'%'};return _0x24eb69;})});}_0x599166=_['merge']({},_0x599166,_0x4aa147[_0x40b2('0x3b')]);return _0x27e465['getDescriptions'](_0x599166);}})[_0x40b2('0x3c')](function(_0x38c118){if(_0x38c118){_0x584356=_0x38c118['length'];if(!_0x4aa147[_0x40b2('0x2c')][_0x40b2('0x31')]('nolimit')){_0x599166[_0x40b2('0x1c')]=qs['limit'](_0x4aa147[_0x40b2('0x2c')][_0x40b2('0x1c')]);_0x599166[_0x40b2('0x1b')]=qs['offset'](_0x4aa147[_0x40b2('0x2c')][_0x40b2('0x1b')]);}return _0x27e465[_0x40b2('0x4d')](_0x599166);}})[_0x40b2('0x3c')](function(_0x5c1d8a){if(_0x5c1d8a){return _0x5c1d8a?{'count':_0x584356,'rows':_0x5c1d8a}:null;}})['then'](respondWithResult(_0x605ada,null))['catch'](handleError(_0x605ada,null));};exports[_0x40b2('0x4e')]=function(_0x5bfd8b,_0x16e069,_0x4d3f3d){var _0x10e37b={};var _0x2ab1d3={};var _0x30088f;var _0x1df13b;return db[_0x40b2('0x27')][_0x40b2('0x4c')]({'where':{'id':_0x5bfd8b[_0x40b2('0x41')]['id']}})[_0x40b2('0x3c')](handleEntityNotFound(_0x16e069,null))[_0x40b2('0x3c')](function(_0xb3488c){if(_0xb3488c){_0x30088f=_0xb3488c;_0x2ab1d3[_0x40b2('0x2b')]=_['keys'](db['Tag'][_0x40b2('0x28')]);_0x2ab1d3['query']=_[_0x40b2('0x2d')](_0x5bfd8b[_0x40b2('0x2c')]);_0x2ab1d3[_0x40b2('0x2e')]=_[_0x40b2('0x42')](_0x2ab1d3['model'],_0x2ab1d3[_0x40b2('0x2c')]);_0x10e37b[_0x40b2('0x2f')]=_['intersection'](_0x2ab1d3[_0x40b2('0x2b')],qs[_0x40b2('0x30')](_0x5bfd8b[_0x40b2('0x2c')][_0x40b2('0x30')]));_0x10e37b['attributes']=_0x10e37b[_0x40b2('0x2f')][_0x40b2('0x43')]?_0x10e37b['attributes']:_0x2ab1d3['model'];_0x10e37b[_0x40b2('0x33')]=qs['sort'](_0x5bfd8b[_0x40b2('0x2c')][_0x40b2('0x34')]);_0x10e37b[_0x40b2('0x35')]=qs[_0x40b2('0x2e')](_['pick'](_0x5bfd8b[_0x40b2('0x2c')],_0x2ab1d3[_0x40b2('0x2e')]));if(_0x5bfd8b[_0x40b2('0x2c')][_0x40b2('0x37')]){_0x10e37b[_0x40b2('0x35')]=_[_0x40b2('0x3a')](_0x10e37b[_0x40b2('0x35')],{'$or':_[_0x40b2('0x26')](_0x10e37b[_0x40b2('0x2f')],function(_0x5e8e85){var _0x129368={};_0x129368[_0x5e8e85]={'$like':'%'+_0x5bfd8b[_0x40b2('0x2c')][_0x40b2('0x37')]+'%'};return _0x129368;})});}_0x10e37b=_[_0x40b2('0x3a')]({},_0x10e37b,_0x5bfd8b['options']);return _0x30088f['getTags'](_0x10e37b);}})['then'](function(_0x37bb52){if(_0x37bb52){_0x1df13b=_0x37bb52[_0x40b2('0x43')];if(!_0x5bfd8b[_0x40b2('0x2c')][_0x40b2('0x31')]('nolimit')){_0x10e37b['limit']=qs['limit'](_0x5bfd8b['query'][_0x40b2('0x1c')]);_0x10e37b['offset']=qs[_0x40b2('0x1b')](_0x5bfd8b['query']['offset']);}return _0x30088f[_0x40b2('0x4e')](_0x10e37b);}})[_0x40b2('0x3c')](function(_0x29ae8c){if(_0x29ae8c){return _0x29ae8c?{'count':_0x1df13b,'rows':_0x29ae8c}:null;}})[_0x40b2('0x3c')](respondWithResult(_0x16e069,null))[_0x40b2('0x3f')](handleError(_0x16e069,null));};exports['setTags']=function(_0x598d69,_0x1f30b3,_0xf9db57){if(_0x598d69[_0x40b2('0x47')]['id']){delete _0x598d69[_0x40b2('0x47')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x598d69[_0x40b2('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f30b3,null))[_0x40b2('0x3c')](function(_0x1bc44a){if(_0x1bc44a){return _0x1bc44a[_0x40b2('0x4f')](_0x598d69[_0x40b2('0x47')][_0x40b2('0x50')]||[]);}return null;})[_0x40b2('0x3c')](respondWithResult(_0x1f30b3,null))['catch'](handleError(_0x1f30b3,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2f4ae41..b09494a 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 _0x5e84=['util','api','moment','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0x5e84,0x1c1));var _0x45e8=function(_0x4e4988,_0x1ee102){_0x4e4988=_0x4e4988-0x0;var _0x59961d=_0x5e84[_0x4e4988];return _0x59961d;};'use strict';var _=require(_0x45e8('0x0'));var util=require(_0x45e8('0x1'));var logger=require('../../config/logger')(_0x45e8('0x2'));var moment=require(_0x45e8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x45e8('0x4'));var rimraf=require(_0x45e8('0x5'));var config=require('../../config/environment');var attributes=require(_0x45e8('0x6'));module[_0x45e8('0x7')]=function(_0x509835,_0x2d0919){return _0x509835[_0x45e8('0x8')](_0x45e8('0x9'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6760=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xe5194,_0xaa205c){var _0x3c06ae=function(_0x5620e4){while(--_0x5620e4){_0xe5194['push'](_0xe5194['shift']());}};_0x3c06ae(++_0xaa205c);}(_0x6760,0xd5));var _0x0676=function(_0x45ac34,_0x44db35){_0x45ac34=_0x45ac34-0x0;var _0x24db05=_0x6760[_0x45ac34];return _0x24db05;};'use strict';var _=require(_0x0676('0x0'));var util=require(_0x0676('0x1'));var logger=require(_0x0676('0x2'))(_0x0676('0x3'));var moment=require('moment');var BPromise=require(_0x0676('0x4'));var rp=require(_0x0676('0x5'));var fs=require('fs');var path=require(_0x0676('0x6'));var rimraf=require(_0x0676('0x7'));var config=require(_0x0676('0x8'));var attributes=require(_0x0676('0x9'));module[_0x0676('0xa')]=function(_0x2c134d,_0x15d922){return _0x2c134d[_0x0676('0xb')](_0x0676('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 65dca37..ec2a06b 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 _0xd834=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment'];(function(_0x2e1f14,_0x4bca84){var _0x5ef864=function(_0x413df6){while(--_0x413df6){_0x2e1f14['push'](_0x2e1f14['shift']());}};_0x5ef864(++_0x4bca84);}(_0xd834,0x18b));var _0x4d83=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xd834[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4d83('0x0'));var BPromise=require('bluebird');var rs=require(_0x4d83('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d83('0x2'))['db'];var utils=require(_0x4d83('0x3'));var logger=require(_0x4d83('0x4'))(_0x4d83('0x5'));var config=require(_0x4d83('0x6'));var jayson=require(_0x4d83('0x7'));var client=jayson[_0x4d83('0x8')][_0x4d83('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4262b1,_0x2bd3ea,_0xb04c2d){return new BPromise(function(_0x51123b,_0x2f5c16){return client[_0x4d83('0xa')](_0x4262b1,_0xb04c2d)[_0x4d83('0xb')](function(_0x5ae580){logger[_0x4d83('0xc')](_0x4d83('0xd'),_0x2bd3ea,_0x4d83('0xe'));logger[_0x4d83('0xf')](_0x4d83('0x10'),_0x2bd3ea,_0x4d83('0xe'),JSON[_0x4d83('0x11')](_0x5ae580));if(_0x5ae580[_0x4d83('0x12')]){if(_0x5ae580[_0x4d83('0x12')][_0x4d83('0x13')]===0x1f4){logger[_0x4d83('0x12')](_0x4d83('0xd'),_0x2bd3ea,_0x5ae580['error'][_0x4d83('0x14')]);return _0x2f5c16(_0x5ae580[_0x4d83('0x12')][_0x4d83('0x14')]);}logger[_0x4d83('0x12')](_0x4d83('0xd'),_0x2bd3ea,_0x5ae580[_0x4d83('0x12')][_0x4d83('0x14')]);return _0x51123b(_0x5ae580['error'][_0x4d83('0x14')]);}else{logger[_0x4d83('0xc')](_0x4d83('0xd'),_0x2bd3ea,_0x4d83('0xe'));_0x51123b(_0x5ae580[_0x4d83('0x15')]['message']);}})['catch'](function(_0x572b09){logger[_0x4d83('0x12')](_0x4d83('0xd'),_0x2bd3ea,_0x572b09);_0x2f5c16(_0x572b09);});});} \ No newline at end of file +var _0xcada=['../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x55de53,_0x5da3e7){var _0x362fbe=function(_0x3ed4fd){while(--_0x3ed4fd){_0x55de53['push'](_0x55de53['shift']());}};_0x362fbe(++_0x5da3e7);}(_0xcada,0x175));var _0xacad=function(_0x2830b0,_0x30d222){_0x2830b0=_0x2830b0-0x0;var _0x12fcab=_0xcada[_0x2830b0];return _0x12fcab;};'use strict';var _=require(_0xacad('0x0'));var util=require(_0xacad('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xacad('0x2'));var fs=require('fs');var Redis=require(_0xacad('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xacad('0x4'))('rpc');var config=require(_0xacad('0x5'));var jayson=require(_0xacad('0x6'));var client=jayson[_0xacad('0x7')][_0xacad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dbc9b,_0x4d401b,_0x392007){return new BPromise(function(_0xae4f8,_0x4e7329){return client[_0xacad('0x9')](_0x3dbc9b,_0x392007)[_0xacad('0xa')](function(_0x31d24f){logger[_0xacad('0xb')](_0xacad('0xc'),_0x4d401b,_0xacad('0xd'));logger[_0xacad('0xe')](_0xacad('0xf'),_0x4d401b,'request\x20sent',JSON[_0xacad('0x10')](_0x31d24f));if(_0x31d24f[_0xacad('0x11')]){if(_0x31d24f[_0xacad('0x11')]['code']===0x1f4){logger[_0xacad('0x11')](_0xacad('0xc'),_0x4d401b,_0x31d24f[_0xacad('0x11')][_0xacad('0x12')]);return _0x4e7329(_0x31d24f[_0xacad('0x11')]['message']);}logger['error'](_0xacad('0xc'),_0x4d401b,_0x31d24f[_0xacad('0x11')]['message']);return _0xae4f8(_0x31d24f[_0xacad('0x11')][_0xacad('0x12')]);}else{logger['info'](_0xacad('0xc'),_0x4d401b,_0xacad('0xd'));_0xae4f8(_0x31d24f[_0xacad('0x13')]['message']);}})[_0xacad('0x14')](function(_0x1809e4){logger['error'](_0xacad('0xc'),_0x4d401b,_0x1809e4);_0x4e7329(_0x1809e4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index aa03dac..27e0a13 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 _0x7fda=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x33bacd,_0x1c147d){var _0x1fdf64=function(_0xe7175){while(--_0xe7175){_0x33bacd['push'](_0x33bacd['shift']());}};_0x1fdf64(++_0x1c147d);}(_0x7fda,0xe3));var _0xa7fd=function(_0x44d31f,_0x3ad853){_0x44d31f=_0x44d31f-0x0;var _0x873349=_0x7fda[_0x44d31f];return _0x873349;};'use strict';var multer=require(_0xa7fd('0x0'));var util=require(_0xa7fd('0x1'));var path=require(_0xa7fd('0x2'));var timeout=require(_0xa7fd('0x3'));var express=require(_0xa7fd('0x4'));var router=express[_0xa7fd('0x5')]();var fs_extra=require(_0xa7fd('0x6'));var auth=require(_0xa7fd('0x7'));var interaction=require(_0xa7fd('0x8'));var config=require(_0xa7fd('0x9'));var controller=require('./intFreshdeskField.controller');router[_0xa7fd('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xa7fd('0xb')](),controller[_0xa7fd('0xc')]);router[_0xa7fd('0xd')]('/',auth[_0xa7fd('0xb')](),controller['create']);router['put']('/:id',auth[_0xa7fd('0xb')](),controller[_0xa7fd('0xe')]);router[_0xa7fd('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xa7fd('0x10')]);module[_0xa7fd('0x11')]=router; \ No newline at end of file +var _0x4cde=['../../config/environment','get','isAuthenticated','index','/:id','show','post','put','delete','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x45afec,_0x18bc92){var _0x5a841a=function(_0x47c272){while(--_0x47c272){_0x45afec['push'](_0x45afec['shift']());}};_0x5a841a(++_0x18bc92);}(_0x4cde,0x135));var _0xe4cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4cde[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe4cd('0x0'));var util=require(_0xe4cd('0x1'));var path=require(_0xe4cd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xe4cd('0x3'));var auth=require(_0xe4cd('0x4'));var interaction=require(_0xe4cd('0x5'));var config=require(_0xe4cd('0x6'));var controller=require('./intFreshdeskField.controller');router[_0xe4cd('0x7')]('/',auth[_0xe4cd('0x8')](),controller[_0xe4cd('0x9')]);router[_0xe4cd('0x7')](_0xe4cd('0xa'),auth[_0xe4cd('0x8')](),controller[_0xe4cd('0xb')]);router[_0xe4cd('0xc')]('/',auth[_0xe4cd('0x8')](),controller['create']);router[_0xe4cd('0xd')]('/:id',auth[_0xe4cd('0x8')](),controller['update']);router[_0xe4cd('0xe')](_0xe4cd('0xa'),auth[_0xe4cd('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 7b4e119..a94f4e9 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 _0x63e1=['keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x3897a7,_0x5e5179){var _0x4926ea=function(_0x1c0546){while(--_0x1c0546){_0x3897a7['push'](_0x3897a7['shift']());}};_0x4926ea(++_0x5e5179);}(_0x63e1,0x1e5));var _0x163e=function(_0x5ca97e,_0x2e0b7c){_0x5ca97e=_0x5ca97e-0x0;var _0x42d75e=_0x63e1[_0x5ca97e];return _0x42d75e;};'use strict';var Sequelize=require(_0x163e('0x0'));module[_0x163e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x163e('0x2'),_0x163e('0x3'),_0x163e('0x4'),_0x163e('0x5'),_0x163e('0x6')),'defaultValue':_0x163e('0x2')},'content':{'type':Sequelize[_0x163e('0x7')]},'key':{'type':Sequelize[_0x163e('0x7')]},'keyType':{'type':Sequelize[_0x163e('0x8')](_0x163e('0x2'),_0x163e('0x3'),_0x163e('0x4'))},'keyContent':{'type':Sequelize[_0x163e('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x163e('0x7')]},'customField':{'type':Sequelize[_0x163e('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x163e('0x7')]}}; \ No newline at end of file +var _0x0e9e=['ENUM','BOOLEAN','sequelize','exports','string','customVariable','keyValue','picklist','STRING'];(function(_0x310c90,_0x36f8a8){var _0x368e43=function(_0x21a217){while(--_0x21a217){_0x310c90['push'](_0x310c90['shift']());}};_0x368e43(++_0x36f8a8);}(_0x0e9e,0x17c));var _0xe0e9=function(_0x4728c8,_0x38c313){_0x4728c8=_0x4728c8-0x0;var _0xa4d56e=_0x0e9e[_0x4728c8];return _0xa4d56e;};'use strict';var Sequelize=require(_0xe0e9('0x0'));module[_0xe0e9('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe0e9('0x2'),'variable',_0xe0e9('0x3'),_0xe0e9('0x4'),_0xe0e9('0x5')),'defaultValue':_0xe0e9('0x2')},'content':{'type':Sequelize[_0xe0e9('0x6')]},'key':{'type':Sequelize[_0xe0e9('0x6')]},'keyType':{'type':Sequelize[_0xe0e9('0x7')](_0xe0e9('0x2'),'variable',_0xe0e9('0x3'))},'keyContent':{'type':Sequelize[_0xe0e9('0x6')]},'idField':{'type':Sequelize[_0xe0e9('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe0e9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0e9('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 2994e50..f8dee23 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 _0x0e9f=['merge','VIRTUAL','name','options','then','include','rows','catch','params','length','includeAll','find','create','body','eml-format','rimraf','request-promise','mustache','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','apply','reject','save','update','destroy','error','send','map','FreshdeskField','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','order','sort','where','filters','pick','filter'];(function(_0xe72527,_0x7125db){var _0x3b55d4=function(_0x1eb6ac){while(--_0x1eb6ac){_0xe72527['push'](_0xe72527['shift']());}};_0x3b55d4(++_0x7125db);}(_0x0e9f,0x116));var _0xf0e9=function(_0x1d8c1a,_0x20205a){_0x1d8c1a=_0x1d8c1a-0x0;var _0x483376=_0x0e9f[_0x1d8c1a];return _0x483376;};'use strict';var emlformat=require(_0xf0e9('0x0'));var rimraf=require(_0xf0e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf0e9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf0e9('0x3'));var util=require('util');var path=require('path');var sox=require(_0xf0e9('0x4'));var csv=require(_0xf0e9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0e9('0x6'));var _=require('lodash');var squel=require(_0xf0e9('0x7'));var crypto=require(_0xf0e9('0x8'));var jsforce=require(_0xf0e9('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf0e9('0xa'));var Papa=require(_0xf0e9('0xb'));var Redis=require(_0xf0e9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xf0e9('0xd'));var as=require(_0xf0e9('0xe'));var hardwareService=require(_0xf0e9('0xf'));var logger=require('../../config/logger')(_0xf0e9('0x10'));var utils=require(_0xf0e9('0x11'));var config=require(_0xf0e9('0x12'));var licenseUtil=require(_0xf0e9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa9d7e3,_0x541cd6){_0x541cd6=_0x541cd6||0xcc;return function(_0x1461af){if(_0x1461af){return _0xa9d7e3[_0xf0e9('0x14')](_0x541cd6);}return _0xa9d7e3['status'](_0x541cd6)[_0xf0e9('0x15')]();};}function respondWithResult(_0x34ebf1,_0x261100){_0x261100=_0x261100||0xc8;return function(_0x1b87cf){if(_0x1b87cf){return _0x34ebf1[_0xf0e9('0x16')](_0x261100)[_0xf0e9('0x17')](_0x1b87cf);}};}function respondWithFilteredResult(_0x5c7787,_0x933fea){return function(_0x1eb36f){if(_0x1eb36f){var _0x4f37b5=typeof _0x933fea[_0xf0e9('0x18')]===_0xf0e9('0x19')&&typeof _0x933fea[_0xf0e9('0x1a')]===_0xf0e9('0x19');var _0x5cf302=_0x1eb36f[_0xf0e9('0x1b')];var _0x2f4ee3=_0x4f37b5?0x0:_0x933fea[_0xf0e9('0x18')];var _0x2987a1=_0x4f37b5?_0x1eb36f['count']:_0x933fea['offset']+_0x933fea[_0xf0e9('0x1a')];var _0x98bb88;if(_0x2987a1>=_0x5cf302){_0x2987a1=_0x5cf302;_0x98bb88=0xc8;}else{_0x98bb88=0xce;}_0x5c7787[_0xf0e9('0x16')](_0x98bb88);return _0x5c7787['set']('Content-Range',_0x2f4ee3+'-'+_0x2987a1+'/'+_0x5cf302)[_0xf0e9('0x17')](_0x1eb36f);}return null;};}function patchUpdates(_0x1ac91f){return function(_0x4992c5){try{jsonpatch[_0xf0e9('0x1c')](_0x4992c5,_0x1ac91f,!![]);}catch(_0x51f313){return BPromise[_0xf0e9('0x1d')](_0x51f313);}return _0x4992c5[_0xf0e9('0x1e')]();};}function saveUpdates(_0x4afcff,_0x5dd652){return function(_0x186fa5){if(_0x186fa5){return _0x186fa5[_0xf0e9('0x1f')](_0x4afcff)['then'](function(_0x1cd143){return _0x1cd143;});}return null;};}function removeEntity(_0x257acb,_0x52612e){return function(_0x2f44ee){if(_0x2f44ee){return _0x2f44ee[_0xf0e9('0x20')]()['then'](function(){_0x257acb[_0xf0e9('0x16')](0xcc)[_0xf0e9('0x15')]();});}};}function handleEntityNotFound(_0x9acc21,_0x3a74fe){return function(_0x33048a){if(!_0x33048a){_0x9acc21[_0xf0e9('0x14')](0x194);}return _0x33048a;};}function handleError(_0x330080,_0x4d4bc8){_0x4d4bc8=_0x4d4bc8||0x1f4;return function(_0x5c5d96){logger[_0xf0e9('0x21')](_0x5c5d96['stack']);if(_0x5c5d96['name']){delete _0x5c5d96['name'];}_0x330080[_0xf0e9('0x16')](_0x4d4bc8)[_0xf0e9('0x22')](_0x5c5d96);};}exports['index']=function(_0x258927,_0xc4501a){var _0x453195={},_0x480b7d={},_0x2fa5e9={'count':0x0,'rows':[]};var _0x337a59=_[_0xf0e9('0x23')](db[_0xf0e9('0x24')][_0xf0e9('0x25')],function(_0xf90eea){return{'name':_0xf90eea[_0xf0e9('0x26')],'type':_0xf90eea[_0xf0e9('0x27')]['key']};});_0x480b7d[_0xf0e9('0x28')]=_[_0xf0e9('0x23')](_0x337a59,'name');_0x480b7d['query']=_[_0xf0e9('0x29')](_0x258927[_0xf0e9('0x2a')]);_0x480b7d['filters']=_[_0xf0e9('0x2b')](_0x480b7d[_0xf0e9('0x28')],_0x480b7d[_0xf0e9('0x2a')]);_0x453195[_0xf0e9('0x2c')]=_[_0xf0e9('0x2b')](_0x480b7d[_0xf0e9('0x28')],qs[_0xf0e9('0x2d')](_0x258927[_0xf0e9('0x2a')]['fields']));_0x453195[_0xf0e9('0x2c')]=_0x453195[_0xf0e9('0x2c')]['length']?_0x453195[_0xf0e9('0x2c')]:_0x480b7d['model'];if(!_0x258927[_0xf0e9('0x2a')]['hasOwnProperty']('nolimit')){_0x453195[_0xf0e9('0x1a')]=qs[_0xf0e9('0x1a')](_0x258927[_0xf0e9('0x2a')][_0xf0e9('0x1a')]);_0x453195[_0xf0e9('0x18')]=qs[_0xf0e9('0x18')](_0x258927['query'][_0xf0e9('0x18')]);}_0x453195[_0xf0e9('0x2e')]=qs[_0xf0e9('0x2f')](_0x258927['query'][_0xf0e9('0x2f')]);_0x453195[_0xf0e9('0x30')]=qs[_0xf0e9('0x31')](_[_0xf0e9('0x32')](_0x258927[_0xf0e9('0x2a')],_0x480b7d[_0xf0e9('0x31')]),_0x337a59);if(_0x258927[_0xf0e9('0x2a')][_0xf0e9('0x33')]){_0x453195[_0xf0e9('0x30')]=_[_0xf0e9('0x34')](_0x453195['where'],{'$or':_[_0xf0e9('0x23')](_0x337a59,function(_0x248a74){if(_0x248a74['type']!==_0xf0e9('0x35')){var _0x36c0e0={};_0x36c0e0[_0x248a74[_0xf0e9('0x36')]]={'$like':'%'+_0x258927[_0xf0e9('0x2a')][_0xf0e9('0x33')]+'%'};return _0x36c0e0;}})});}_0x453195=_['merge']({},_0x453195,_0x258927[_0xf0e9('0x37')]);var _0xd14889={'where':_0x453195['where']};return db[_0xf0e9('0x24')]['count'](_0xd14889)[_0xf0e9('0x38')](function(_0x58d9ab){_0x2fa5e9[_0xf0e9('0x1b')]=_0x58d9ab;if(_0x258927[_0xf0e9('0x2a')]['includeAll']){_0x453195[_0xf0e9('0x39')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x453195);})['then'](function(_0x3935d8){_0x2fa5e9[_0xf0e9('0x3a')]=_0x3935d8;return _0x2fa5e9;})[_0xf0e9('0x38')](respondWithFilteredResult(_0xc4501a,_0x453195))[_0xf0e9('0x3b')](handleError(_0xc4501a,null));};exports['show']=function(_0x11f4f1,_0x34d44d){var _0x50fc1b={'raw':!![],'where':{'id':_0x11f4f1[_0xf0e9('0x3c')]['id']}},_0x587259={};_0x587259[_0xf0e9('0x28')]=_[_0xf0e9('0x29')](db[_0xf0e9('0x24')][_0xf0e9('0x25')]);_0x587259['query']=_[_0xf0e9('0x29')](_0x11f4f1[_0xf0e9('0x2a')]);_0x587259[_0xf0e9('0x31')]=_[_0xf0e9('0x2b')](_0x587259[_0xf0e9('0x28')],_0x587259[_0xf0e9('0x2a')]);_0x50fc1b[_0xf0e9('0x2c')]=_['intersection'](_0x587259[_0xf0e9('0x28')],qs[_0xf0e9('0x2d')](_0x11f4f1[_0xf0e9('0x2a')][_0xf0e9('0x2d')]));_0x50fc1b['attributes']=_0x50fc1b[_0xf0e9('0x2c')][_0xf0e9('0x3d')]?_0x50fc1b[_0xf0e9('0x2c')]:_0x587259['model'];if(_0x11f4f1[_0xf0e9('0x2a')][_0xf0e9('0x3e')]){_0x50fc1b[_0xf0e9('0x39')]=[{'all':!![]}];}_0x50fc1b=_[_0xf0e9('0x34')]({},_0x50fc1b,_0x11f4f1[_0xf0e9('0x37')]);return db[_0xf0e9('0x24')][_0xf0e9('0x3f')](_0x50fc1b)[_0xf0e9('0x38')](handleEntityNotFound(_0x34d44d,null))[_0xf0e9('0x38')](respondWithResult(_0x34d44d,null))[_0xf0e9('0x3b')](handleError(_0x34d44d,null));};exports[_0xf0e9('0x40')]=function(_0x392a9a,_0x317419){return db[_0xf0e9('0x24')][_0xf0e9('0x40')](_0x392a9a[_0xf0e9('0x41')],{})[_0xf0e9('0x38')](respondWithResult(_0x317419,0xc9))[_0xf0e9('0x3b')](handleError(_0x317419,null));};exports[_0xf0e9('0x1f')]=function(_0x39def0,_0x3250d7){if(_0x39def0[_0xf0e9('0x41')]['id']){delete _0x39def0[_0xf0e9('0x41')]['id'];}return db[_0xf0e9('0x24')][_0xf0e9('0x3f')]({'where':{'id':_0x39def0[_0xf0e9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3250d7,null))[_0xf0e9('0x38')](saveUpdates(_0x39def0[_0xf0e9('0x41')],null))['then'](respondWithResult(_0x3250d7,null))[_0xf0e9('0x3b')](handleError(_0x3250d7,null));};exports[_0xf0e9('0x20')]=function(_0x26789c,_0x19419e){return db[_0xf0e9('0x24')]['find']({'where':{'id':_0x26789c[_0xf0e9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x19419e,null))[_0xf0e9('0x38')](removeEntity(_0x19419e,null))['catch'](handleError(_0x19419e,null));}; \ No newline at end of file +var _0x44a3=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','model','map','keys','query','filters','intersection','attributes','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x1422bd,_0x3dbde0){var _0x2f4558=function(_0x4dbfaf){while(--_0x4dbfaf){_0x1422bd['push'](_0x1422bd['shift']());}};_0x2f4558(++_0x3dbde0);}(_0x44a3,0x1a9));var _0x344a=function(_0x251e8c,_0x277c33){_0x251e8c=_0x251e8c-0x0;var _0x1e0c1d=_0x44a3[_0x251e8c];return _0x1e0c1d;};'use strict';var emlformat=require(_0x344a('0x0'));var rimraf=require(_0x344a('0x1'));var zipdir=require(_0x344a('0x2'));var jsonpatch=require(_0x344a('0x3'));var rp=require(_0x344a('0x4'));var moment=require(_0x344a('0x5'));var BPromise=require(_0x344a('0x6'));var Mustache=require(_0x344a('0x7'));var util=require('util');var path=require(_0x344a('0x8'));var sox=require(_0x344a('0x9'));var csv=require(_0x344a('0xa'));var ejs=require(_0x344a('0xb'));var fs=require('fs');var fs_extra=require(_0x344a('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xa'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x344a('0x15'));var db=require(_0x344a('0x16'))['db'];function respondWithStatusCode(_0x57e42e,_0x4a69ea){_0x4a69ea=_0x4a69ea||0xcc;return function(_0x304b70){if(_0x304b70){return _0x57e42e[_0x344a('0x17')](_0x4a69ea);}return _0x57e42e[_0x344a('0x18')](_0x4a69ea)[_0x344a('0x19')]();};}function respondWithResult(_0x5a0df6,_0x133ad4){_0x133ad4=_0x133ad4||0xc8;return function(_0x4ee562){if(_0x4ee562){return _0x5a0df6[_0x344a('0x18')](_0x133ad4)[_0x344a('0x1a')](_0x4ee562);}};}function respondWithFilteredResult(_0xce0f65,_0x6e1639){return function(_0x58c8cd){if(_0x58c8cd){var _0x54a643=typeof _0x6e1639[_0x344a('0x1b')]===_0x344a('0x1c')&&typeof _0x6e1639[_0x344a('0x1d')]===_0x344a('0x1c');var _0x48b3ab=_0x58c8cd[_0x344a('0x1e')];var _0x277c06=_0x54a643?0x0:_0x6e1639['offset'];var _0x9fe854=_0x54a643?_0x58c8cd[_0x344a('0x1e')]:_0x6e1639[_0x344a('0x1b')]+_0x6e1639[_0x344a('0x1d')];var _0x13b382;if(_0x9fe854>=_0x48b3ab){_0x9fe854=_0x48b3ab;_0x13b382=0xc8;}else{_0x13b382=0xce;}_0xce0f65[_0x344a('0x18')](_0x13b382);return _0xce0f65[_0x344a('0x1f')](_0x344a('0x20'),_0x277c06+'-'+_0x9fe854+'/'+_0x48b3ab)[_0x344a('0x1a')](_0x58c8cd);}return null;};}function patchUpdates(_0x450922){return function(_0x4b3552){try{jsonpatch[_0x344a('0x21')](_0x4b3552,_0x450922,!![]);}catch(_0x4232eb){return BPromise[_0x344a('0x22')](_0x4232eb);}return _0x4b3552[_0x344a('0x23')]();};}function saveUpdates(_0x240be3,_0x80ae12){return function(_0x185303){if(_0x185303){return _0x185303[_0x344a('0x24')](_0x240be3)[_0x344a('0x25')](function(_0x27f527){return _0x27f527;});}return null;};}function removeEntity(_0x90070c,_0x3b2ab9){return function(_0x5ce9da){if(_0x5ce9da){return _0x5ce9da[_0x344a('0x26')]()['then'](function(){_0x90070c[_0x344a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5e49,_0x484f97){return function(_0x36c920){if(!_0x36c920){_0x2a5e49[_0x344a('0x17')](0x194);}return _0x36c920;};}function handleError(_0x2ebae9,_0x16d404){_0x16d404=_0x16d404||0x1f4;return function(_0x26f059){logger[_0x344a('0x27')](_0x26f059[_0x344a('0x28')]);if(_0x26f059[_0x344a('0x29')]){delete _0x26f059['name'];}_0x2ebae9[_0x344a('0x18')](_0x16d404)[_0x344a('0x2a')](_0x26f059);};}exports[_0x344a('0x2b')]=function(_0xc02d6,_0x14bd54){var _0x2d72c9={},_0x5b877d={},_0x3d25fe={'count':0x0,'rows':[]};var _0x49bbf8=_['map'](db[_0x344a('0x2c')][_0x344a('0x2d')],function(_0x5a36bb){return{'name':_0x5a36bb['fieldName'],'type':_0x5a36bb['type']['key']};});_0x5b877d[_0x344a('0x2e')]=_[_0x344a('0x2f')](_0x49bbf8,_0x344a('0x29'));_0x5b877d['query']=_[_0x344a('0x30')](_0xc02d6[_0x344a('0x31')]);_0x5b877d[_0x344a('0x32')]=_[_0x344a('0x33')](_0x5b877d[_0x344a('0x2e')],_0x5b877d[_0x344a('0x31')]);_0x2d72c9[_0x344a('0x34')]=_['intersection'](_0x5b877d[_0x344a('0x2e')],qs['fields'](_0xc02d6['query']['fields']));_0x2d72c9[_0x344a('0x34')]=_0x2d72c9[_0x344a('0x34')][_0x344a('0x35')]?_0x2d72c9[_0x344a('0x34')]:_0x5b877d[_0x344a('0x2e')];if(!_0xc02d6[_0x344a('0x31')]['hasOwnProperty'](_0x344a('0x36'))){_0x2d72c9[_0x344a('0x1d')]=qs[_0x344a('0x1d')](_0xc02d6['query'][_0x344a('0x1d')]);_0x2d72c9[_0x344a('0x1b')]=qs[_0x344a('0x1b')](_0xc02d6[_0x344a('0x31')][_0x344a('0x1b')]);}_0x2d72c9['order']=qs[_0x344a('0x37')](_0xc02d6[_0x344a('0x31')][_0x344a('0x37')]);_0x2d72c9[_0x344a('0x38')]=qs[_0x344a('0x32')](_['pick'](_0xc02d6[_0x344a('0x31')],_0x5b877d[_0x344a('0x32')]),_0x49bbf8);if(_0xc02d6[_0x344a('0x31')][_0x344a('0x39')]){_0x2d72c9[_0x344a('0x38')]=_['merge'](_0x2d72c9[_0x344a('0x38')],{'$or':_[_0x344a('0x2f')](_0x49bbf8,function(_0x1f52dc){if(_0x1f52dc[_0x344a('0x3a')]!==_0x344a('0x3b')){var _0x27d2d5={};_0x27d2d5[_0x1f52dc[_0x344a('0x29')]]={'$like':'%'+_0xc02d6[_0x344a('0x31')]['filter']+'%'};return _0x27d2d5;}})});}_0x2d72c9=_[_0x344a('0x3c')]({},_0x2d72c9,_0xc02d6[_0x344a('0x3d')]);var _0x3d34c3={'where':_0x2d72c9[_0x344a('0x38')]};return db[_0x344a('0x2c')]['count'](_0x3d34c3)[_0x344a('0x25')](function(_0x2736e9){_0x3d25fe[_0x344a('0x1e')]=_0x2736e9;if(_0xc02d6[_0x344a('0x31')][_0x344a('0x3e')]){_0x2d72c9[_0x344a('0x3f')]=[{'all':!![]}];}return db[_0x344a('0x2c')][_0x344a('0x40')](_0x2d72c9);})[_0x344a('0x25')](function(_0x4b1bac){_0x3d25fe[_0x344a('0x41')]=_0x4b1bac;return _0x3d25fe;})[_0x344a('0x25')](respondWithFilteredResult(_0x14bd54,_0x2d72c9))[_0x344a('0x42')](handleError(_0x14bd54,null));};exports[_0x344a('0x43')]=function(_0x4f9dc2,_0x32bfa6){var _0x3069ca={'raw':!![],'where':{'id':_0x4f9dc2[_0x344a('0x44')]['id']}},_0x2b0ee9={};_0x2b0ee9[_0x344a('0x2e')]=_[_0x344a('0x30')](db[_0x344a('0x2c')][_0x344a('0x2d')]);_0x2b0ee9[_0x344a('0x31')]=_[_0x344a('0x30')](_0x4f9dc2[_0x344a('0x31')]);_0x2b0ee9['filters']=_[_0x344a('0x33')](_0x2b0ee9[_0x344a('0x2e')],_0x2b0ee9['query']);_0x3069ca[_0x344a('0x34')]=_[_0x344a('0x33')](_0x2b0ee9['model'],qs[_0x344a('0x45')](_0x4f9dc2[_0x344a('0x31')]['fields']));_0x3069ca[_0x344a('0x34')]=_0x3069ca[_0x344a('0x34')][_0x344a('0x35')]?_0x3069ca['attributes']:_0x2b0ee9[_0x344a('0x2e')];if(_0x4f9dc2['query'][_0x344a('0x3e')]){_0x3069ca[_0x344a('0x3f')]=[{'all':!![]}];}_0x3069ca=_[_0x344a('0x3c')]({},_0x3069ca,_0x4f9dc2[_0x344a('0x3d')]);return db['FreshdeskField']['find'](_0x3069ca)[_0x344a('0x25')](handleEntityNotFound(_0x32bfa6,null))[_0x344a('0x25')](respondWithResult(_0x32bfa6,null))[_0x344a('0x42')](handleError(_0x32bfa6,null));};exports[_0x344a('0x46')]=function(_0x300c9f,_0xa3c8f0){return db[_0x344a('0x2c')][_0x344a('0x46')](_0x300c9f[_0x344a('0x47')],{})[_0x344a('0x25')](respondWithResult(_0xa3c8f0,0xc9))['catch'](handleError(_0xa3c8f0,null));};exports[_0x344a('0x24')]=function(_0x2d9858,_0x6fad37){if(_0x2d9858[_0x344a('0x47')]['id']){delete _0x2d9858['body']['id'];}return db[_0x344a('0x2c')]['find']({'where':{'id':_0x2d9858['params']['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x6fad37,null))[_0x344a('0x25')](saveUpdates(_0x2d9858['body'],null))[_0x344a('0x25')](respondWithResult(_0x6fad37,null))[_0x344a('0x42')](handleError(_0x6fad37,null));};exports[_0x344a('0x26')]=function(_0x226f41,_0x51e411){return db[_0x344a('0x2c')][_0x344a('0x48')]({'where':{'id':_0x226f41[_0x344a('0x44')]['id']}})[_0x344a('0x25')](handleEntityNotFound(_0x51e411,null))[_0x344a('0x25')](removeEntity(_0x51e411,null))[_0x344a('0x42')](handleError(_0x51e411,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d766714..e395944 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 _0xe890=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','lodash'];(function(_0x24920,_0xbf239d){var _0x3b138e=function(_0x130048){while(--_0x130048){_0x24920['push'](_0x24920['shift']());}};_0x3b138e(++_0xbf239d);}(_0xe890,0x197));var _0x0e89=function(_0x4784b1,_0x1e1537){_0x4784b1=_0x4784b1-0x0;var _0x516487=_0xe890[_0x4784b1];return _0x516487;};'use strict';var _=require(_0x0e89('0x0'));var util=require('util');var logger=require(_0x0e89('0x1'))('api');var moment=require(_0x0e89('0x2'));var BPromise=require(_0x0e89('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0e89('0x4'));var config=require(_0x0e89('0x5'));var attributes=require(_0x0e89('0x6'));module[_0x0e89('0x7')]=function(_0x15a438,_0x5e1ac2){return _0x15a438[_0x0e89('0x8')](_0x0e89('0x9'),attributes,{'tableName':_0x0e89('0xa'),'paranoid':![],'indexes':[{'name':_0x0e89('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3fbd=['FreshdeskField','FieldId','lodash','../../config/logger','api','moment','path','./intFreshdeskField.attributes','define'];(function(_0x2d8b34,_0x56488c){var _0xf9a666=function(_0x5d7b01){while(--_0x5d7b01){_0x2d8b34['push'](_0x2d8b34['shift']());}};_0xf9a666(++_0x56488c);}(_0x3fbd,0x110));var _0xd3fb=function(_0x158954,_0x4b913a){_0x158954=_0x158954-0x0;var _0x57ed2b=_0x3fbd[_0x158954];return _0x57ed2b;};'use strict';var _=require(_0xd3fb('0x0'));var util=require('util');var logger=require(_0xd3fb('0x1'))(_0xd3fb('0x2'));var moment=require(_0xd3fb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3fb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3fb('0x5'));module['exports']=function(_0x2de1ed,_0x5879ab){return _0x2de1ed[_0xd3fb('0x6')](_0xd3fb('0x7'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xd3fb('0x8')],'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 9aa85bf..b903bfe 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 _0x0fb2=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result'];(function(_0x1a3dd2,_0x388bb3){var _0x4d9b2a=function(_0x146c5c){while(--_0x146c5c){_0x1a3dd2['push'](_0x1a3dd2['shift']());}};_0x4d9b2a(++_0x388bb3);}(_0x0fb2,0xab));var _0x20fb=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x0fb2[_0x1b3564];return _0x504069;};'use strict';var _=require('lodash');var util=require(_0x20fb('0x0'));var moment=require(_0x20fb('0x1'));var BPromise=require(_0x20fb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20fb('0x3'))['db'];var utils=require(_0x20fb('0x4'));var logger=require(_0x20fb('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x20fb('0x6'));var client=jayson[_0x20fb('0x7')][_0x20fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14501d,_0x4f772e,_0x28ac43){return new BPromise(function(_0x5b5f83,_0x111d5f){return client['request'](_0x14501d,_0x28ac43)[_0x20fb('0x9')](function(_0x18abcf){logger[_0x20fb('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x4f772e,_0x20fb('0xb'));logger[_0x20fb('0xc')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4f772e,'request\x20sent',JSON[_0x20fb('0xd')](_0x18abcf));if(_0x18abcf[_0x20fb('0xe')]){if(_0x18abcf[_0x20fb('0xe')][_0x20fb('0xf')]===0x1f4){logger['error'](_0x20fb('0x10'),_0x4f772e,_0x18abcf['error'][_0x20fb('0x11')]);return _0x111d5f(_0x18abcf[_0x20fb('0xe')][_0x20fb('0x11')]);}logger[_0x20fb('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x4f772e,_0x18abcf['error'][_0x20fb('0x11')]);return _0x5b5f83(_0x18abcf[_0x20fb('0xe')]['message']);}else{logger[_0x20fb('0xa')]('FreshdeskField,\x20%s,\x20%s',_0x4f772e,_0x20fb('0xb'));_0x5b5f83(_0x18abcf[_0x20fb('0x12')][_0x20fb('0x11')]);}})['catch'](function(_0x3c9462){logger[_0x20fb('0xe')]('FreshdeskField,\x20%s,\x20%s',_0x4f772e,_0x3c9462);_0x111d5f(_0x3c9462);});});} \ No newline at end of file +var _0xdccd=['../../config/environment','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdccd,0x12b));var _0xddcc=function(_0x157e73,_0x377bfc){_0x157e73=_0x157e73-0x0;var _0xf3ab66=_0xdccd[_0x157e73];return _0xf3ab66;};'use strict';var _=require(_0xddcc('0x0'));var util=require(_0xddcc('0x1'));var moment=require(_0xddcc('0x2'));var BPromise=require('bluebird');var rs=require(_0xddcc('0x3'));var fs=require('fs');var Redis=require(_0xddcc('0x4'));var db=require(_0xddcc('0x5'))['db'];var utils=require(_0xddcc('0x6'));var logger=require(_0xddcc('0x7'))(_0xddcc('0x8'));var config=require(_0xddcc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xddcc('0xa')][_0xddcc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f51d7,_0x3ce585,_0x251fd6){return new BPromise(function(_0x5db407,_0x216f8f){return client[_0xddcc('0xc')](_0x2f51d7,_0x251fd6)[_0xddcc('0xd')](function(_0x3fee2c){logger[_0xddcc('0xe')](_0xddcc('0xf'),_0x3ce585,_0xddcc('0x10'));logger['debug'](_0xddcc('0x11'),_0x3ce585,_0xddcc('0x10'),JSON['stringify'](_0x3fee2c));if(_0x3fee2c[_0xddcc('0x12')]){if(_0x3fee2c['error']['code']===0x1f4){logger[_0xddcc('0x12')](_0xddcc('0xf'),_0x3ce585,_0x3fee2c[_0xddcc('0x12')][_0xddcc('0x13')]);return _0x216f8f(_0x3fee2c[_0xddcc('0x12')]['message']);}logger['error'](_0xddcc('0xf'),_0x3ce585,_0x3fee2c[_0xddcc('0x12')]['message']);return _0x5db407(_0x3fee2c[_0xddcc('0x12')]['message']);}else{logger[_0xddcc('0xe')](_0xddcc('0xf'),_0x3ce585,_0xddcc('0x10'));_0x5db407(_0x3fee2c[_0xddcc('0x14')]['message']);}})[_0xddcc('0x15')](function(_0x259d24){logger[_0xddcc('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x3ce585,_0x259d24);_0x216f8f(_0x259d24);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 94ea8f2..779c48b 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 _0xeffd=['/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xeffd,0x6b));var _0xdeff=function(_0x4dd37d,_0xfa992f){_0x4dd37d=_0x4dd37d-0x0;var _0x59e3e4=_0xeffd[_0x4dd37d];return _0x59e3e4;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var fs_extra=require(_0xdeff('0x5'));var auth=require(_0xdeff('0x6'));var interaction=require(_0xdeff('0x7'));var config=require(_0xdeff('0x8'));var controller=require(_0xdeff('0x9'));router[_0xdeff('0xa')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0xc')]);router[_0xdeff('0xa')](_0xdeff('0xd'),auth[_0xdeff('0xb')](),controller[_0xdeff('0xe')]);router[_0xdeff('0xa')]('/:id/configurations',auth[_0xdeff('0xb')](),controller[_0xdeff('0xf')]);router[_0xdeff('0xa')]('/:id/fields',auth[_0xdeff('0xb')](),controller[_0xdeff('0x10')]);router[_0xdeff('0x11')]('/',auth[_0xdeff('0xb')](),controller[_0xdeff('0x12')]);router[_0xdeff('0x11')](_0xdeff('0x13'),auth[_0xdeff('0xb')](),controller['addConfiguration']);router[_0xdeff('0x14')](_0xdeff('0xd'),auth['isAuthenticated'](),controller[_0xdeff('0x15')]);router['delete']('/:id',auth[_0xdeff('0xb')](),controller[_0xdeff('0x16')]);module[_0xdeff('0x17')]=router; \ No newline at end of file +var _0xdb94=['isAuthenticated','getConfigurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshsalesAccount.controller','index','/:id','show','get','/:id/configurations'];(function(_0x121d95,_0x44eacb){var _0x3c95db=function(_0x5d2172){while(--_0x5d2172){_0x121d95['push'](_0x121d95['shift']());}};_0x3c95db(++_0x44eacb);}(_0xdb94,0xab));var _0x4db9=function(_0x9002e2,_0x5c49d8){_0x9002e2=_0x9002e2-0x0;var _0x71300f=_0xdb94[_0x9002e2];return _0x71300f;};'use strict';var multer=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var path=require(_0x4db9('0x2'));var timeout=require(_0x4db9('0x3'));var express=require(_0x4db9('0x4'));var router=express['Router']();var fs_extra=require(_0x4db9('0x5'));var auth=require(_0x4db9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4db9('0x8')]);router['get'](_0x4db9('0x9'),auth['isAuthenticated'](),controller[_0x4db9('0xa')]);router[_0x4db9('0xb')](_0x4db9('0xc'),auth[_0x4db9('0xd')](),controller[_0x4db9('0xe')]);router[_0x4db9('0xb')](_0x4db9('0xf'),auth[_0x4db9('0xd')](),controller[_0x4db9('0x10')]);router[_0x4db9('0x11')]('/',auth[_0x4db9('0xd')](),controller['create']);router[_0x4db9('0x11')](_0x4db9('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x4db9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4db9('0x13')]);router[_0x4db9('0x14')]('/:id',auth[_0x4db9('0xd')](),controller[_0x4db9('0x15')]);module[_0x4db9('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 3ada4b8..4c77e01 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 _0x5c3c=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3aff64,_0x55b017){var _0x1343d9=function(_0x7d5bd0){while(--_0x7d5bd0){_0x3aff64['push'](_0x3aff64['shift']());}};_0x1343d9(++_0x55b017);}(_0x5c3c,0x132));var _0xc5c3=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x5c3c[_0x9cd4c3];return _0x4c9025;};'use strict';var Sequelize=require(_0xc5c3('0x0'));module[_0xc5c3('0x1')]={'name':{'type':Sequelize[_0xc5c3('0x2')]},'description':{'type':Sequelize[_0xc5c3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xc5c3('0x3')},'apiKey':{'type':Sequelize[_0xc5c3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5c3('0x2')],'unique':_0xc5c3('0x4')},'serverUrl':{'type':Sequelize[_0xc5c3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6d11=['exports','STRING','sequelize'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x6d11,0xbf));var _0x16d1=function(_0x4ab7e2,_0x44faff){_0x4ab7e2=_0x4ab7e2-0x0;var _0xd10953=_0x6d11[_0x4ab7e2];return _0xd10953;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x16d1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x16d1('0x2')]},'remoteUri':{'type':Sequelize[_0x16d1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 07c621f..4e4b5d8 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 _0x75fd=['options','includeAll','catch','show','params','find','create','body','update','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','users','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','end','sendStatus','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge'];(function(_0x5aee1c,_0x1472a3){var _0x11a759=function(_0xc848af){while(--_0xc848af){_0x5aee1c['push'](_0x5aee1c['shift']());}};_0x11a759(++_0x1472a3);}(_0x75fd,0xdf));var _0xd75f=function(_0x4afd80,_0x5121f5){_0x4afd80=_0x4afd80-0x0;var _0x51cf0b=_0x75fd[_0x4afd80];return _0x51cf0b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd75f('0x0'));var zipdir=require(_0xd75f('0x1'));var jsonpatch=require(_0xd75f('0x2'));var rp=require(_0xd75f('0x3'));var moment=require(_0xd75f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd75f('0x5'));var util=require(_0xd75f('0x6'));var path=require(_0xd75f('0x7'));var sox=require(_0xd75f('0x8'));var csv=require(_0xd75f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd75f('0xa'));var _=require('lodash');var squel=require(_0xd75f('0xb'));var crypto=require('crypto');var jsforce=require(_0xd75f('0xc'));var deskjs=require(_0xd75f('0xd'));var toCsv=require(_0xd75f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd75f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd75f('0xf'));var hardwareService=require(_0xd75f('0x10'));var logger=require(_0xd75f('0x11'))('api');var utils=require(_0xd75f('0x12'));var config=require(_0xd75f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1241cd,_0x27f54c){_0x27f54c=_0x27f54c||0xcc;return function(_0x5d3b32){if(_0x5d3b32){return _0x1241cd['sendStatus'](_0x27f54c);}return _0x1241cd['status'](_0x27f54c)['end']();};}function respondWithResult(_0x11e377,_0x34b488){_0x34b488=_0x34b488||0xc8;return function(_0x233a87){if(_0x233a87){return _0x11e377[_0xd75f('0x14')](_0x34b488)[_0xd75f('0x15')](_0x233a87);}};}function respondWithFilteredResult(_0x1d35e3,_0x471b97){return function(_0x4e747d){if(_0x4e747d){var _0x17a038=typeof _0x471b97[_0xd75f('0x16')]===_0xd75f('0x17')&&typeof _0x471b97[_0xd75f('0x18')]==='undefined';var _0x2a7b50=_0x4e747d[_0xd75f('0x19')];var _0x211db8=_0x17a038?0x0:_0x471b97[_0xd75f('0x16')];var _0x3af683=_0x17a038?_0x4e747d[_0xd75f('0x19')]:_0x471b97[_0xd75f('0x16')]+_0x471b97[_0xd75f('0x18')];var _0x551097;if(_0x3af683>=_0x2a7b50){_0x3af683=_0x2a7b50;_0x551097=0xc8;}else{_0x551097=0xce;}_0x1d35e3[_0xd75f('0x14')](_0x551097);return _0x1d35e3[_0xd75f('0x1a')](_0xd75f('0x1b'),_0x211db8+'-'+_0x3af683+'/'+_0x2a7b50)[_0xd75f('0x15')](_0x4e747d);}return null;};}function patchUpdates(_0x36bb25){return function(_0x5a8aa0){try{jsonpatch[_0xd75f('0x1c')](_0x5a8aa0,_0x36bb25,!![]);}catch(_0xde12b0){return BPromise['reject'](_0xde12b0);}return _0x5a8aa0[_0xd75f('0x1d')]();};}function saveUpdates(_0x3228fe,_0x2f4369){return function(_0x231d26){if(_0x231d26){return _0x231d26['update'](_0x3228fe)[_0xd75f('0x1e')](function(_0xef514d){return _0xef514d;});}return null;};}function removeEntity(_0x454c6b,_0x5a21ea){return function(_0x5c15bc){if(_0x5c15bc){return _0x5c15bc[_0xd75f('0x1f')]()[_0xd75f('0x1e')](function(){_0x454c6b[_0xd75f('0x14')](0xcc)[_0xd75f('0x20')]();});}};}function handleEntityNotFound(_0x4e5945,_0x30cce3){return function(_0x451edc){if(!_0x451edc){_0x4e5945[_0xd75f('0x21')](0x194);}return _0x451edc;};}function handleError(_0x79ec92,_0x2450f2){_0x2450f2=_0x2450f2||0x1f4;return function(_0x2f9fca){logger['error'](_0x2f9fca['stack']);if(_0x2f9fca['name']){delete _0x2f9fca[_0xd75f('0x22')];}_0x79ec92['status'](_0x2450f2)[_0xd75f('0x23')](_0x2f9fca);};}exports[_0xd75f('0x24')]=function(_0x514f93,_0x50f052){var _0x5b66a5={},_0x28f014={},_0x24d72f={'count':0x0,'rows':[]};var _0x18dca3=_['map'](db[_0xd75f('0x25')][_0xd75f('0x26')],function(_0x173f88){return{'name':_0x173f88[_0xd75f('0x27')],'type':_0x173f88[_0xd75f('0x28')]['key']};});_0x28f014[_0xd75f('0x29')]=_['map'](_0x18dca3,'name');_0x28f014[_0xd75f('0x2a')]=_[_0xd75f('0x2b')](_0x514f93['query']);_0x28f014['filters']=_[_0xd75f('0x2c')](_0x28f014['model'],_0x28f014[_0xd75f('0x2a')]);_0x5b66a5[_0xd75f('0x2d')]=_[_0xd75f('0x2c')](_0x28f014['model'],qs[_0xd75f('0x2e')](_0x514f93['query'][_0xd75f('0x2e')]));_0x5b66a5['attributes']=_0x5b66a5['attributes'][_0xd75f('0x2f')]?_0x5b66a5['attributes']:_0x28f014[_0xd75f('0x29')];if(!_0x514f93[_0xd75f('0x2a')][_0xd75f('0x30')](_0xd75f('0x31'))){_0x5b66a5[_0xd75f('0x18')]=qs[_0xd75f('0x18')](_0x514f93[_0xd75f('0x2a')]['limit']);_0x5b66a5[_0xd75f('0x16')]=qs['offset'](_0x514f93[_0xd75f('0x2a')]['offset']);}_0x5b66a5[_0xd75f('0x32')]=qs['sort'](_0x514f93[_0xd75f('0x2a')][_0xd75f('0x33')]);_0x5b66a5[_0xd75f('0x34')]=qs[_0xd75f('0x35')](_[_0xd75f('0x36')](_0x514f93[_0xd75f('0x2a')],_0x28f014[_0xd75f('0x35')]),_0x18dca3);if(_0x514f93['query'][_0xd75f('0x37')]){_0x5b66a5['where']=_['merge'](_0x5b66a5[_0xd75f('0x34')],{'$or':_[_0xd75f('0x38')](_0x18dca3,function(_0x45f686){if(_0x45f686[_0xd75f('0x28')]!==_0xd75f('0x39')){var _0x16e1f9={};_0x16e1f9[_0x45f686[_0xd75f('0x22')]]={'$like':'%'+_0x514f93[_0xd75f('0x2a')]['filter']+'%'};return _0x16e1f9;}})});}_0x5b66a5=_[_0xd75f('0x3a')]({},_0x5b66a5,_0x514f93[_0xd75f('0x3b')]);var _0x5d6ccb={'where':_0x5b66a5[_0xd75f('0x34')]};return db[_0xd75f('0x25')][_0xd75f('0x19')](_0x5d6ccb)[_0xd75f('0x1e')](function(_0x48fccc){_0x24d72f[_0xd75f('0x19')]=_0x48fccc;if(_0x514f93[_0xd75f('0x2a')][_0xd75f('0x3c')]){_0x5b66a5['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x5b66a5);})[_0xd75f('0x1e')](function(_0x2d3f52){_0x24d72f['rows']=_0x2d3f52;return _0x24d72f;})['then'](respondWithFilteredResult(_0x50f052,_0x5b66a5))[_0xd75f('0x3d')](handleError(_0x50f052,null));};exports[_0xd75f('0x3e')]=function(_0x203622,_0x3a00df){var _0x5e5115={'raw':![],'where':{'id':_0x203622[_0xd75f('0x3f')]['id']}},_0x5f17ad={};_0x5f17ad['model']=_[_0xd75f('0x2b')](db['FreshsalesAccount'][_0xd75f('0x26')]);_0x5f17ad[_0xd75f('0x2a')]=_['keys'](_0x203622[_0xd75f('0x2a')]);_0x5f17ad[_0xd75f('0x35')]=_[_0xd75f('0x2c')](_0x5f17ad['model'],_0x5f17ad['query']);_0x5e5115[_0xd75f('0x2d')]=_[_0xd75f('0x2c')](_0x5f17ad[_0xd75f('0x29')],qs[_0xd75f('0x2e')](_0x203622['query']['fields']));_0x5e5115[_0xd75f('0x2d')]=_0x5e5115['attributes'][_0xd75f('0x2f')]?_0x5e5115[_0xd75f('0x2d')]:_0x5f17ad[_0xd75f('0x29')];if(_0x203622[_0xd75f('0x2a')][_0xd75f('0x3c')]){_0x5e5115['include']=[{'all':!![]}];}_0x5e5115=_[_0xd75f('0x3a')]({},_0x5e5115,_0x203622[_0xd75f('0x3b')]);return db['FreshsalesAccount'][_0xd75f('0x40')](_0x5e5115)['then'](handleEntityNotFound(_0x3a00df,null))[_0xd75f('0x1e')](respondWithResult(_0x3a00df,null))['catch'](handleError(_0x3a00df,null));};exports[_0xd75f('0x41')]=function(_0x18cc8c,_0x44199d){return db['FreshsalesAccount'][_0xd75f('0x41')](_0x18cc8c[_0xd75f('0x42')],{})[_0xd75f('0x1e')](respondWithResult(_0x44199d,0xc9))[_0xd75f('0x3d')](handleError(_0x44199d,null));};exports[_0xd75f('0x43')]=function(_0x2f606b,_0x42e278){if(_0x2f606b[_0xd75f('0x42')]['id']){delete _0x2f606b['body']['id'];}return db[_0xd75f('0x25')][_0xd75f('0x40')]({'where':{'id':_0x2f606b[_0xd75f('0x3f')]['id']}})[_0xd75f('0x1e')](handleEntityNotFound(_0x42e278,null))[_0xd75f('0x1e')](saveUpdates(_0x2f606b[_0xd75f('0x42')],null))[_0xd75f('0x1e')](respondWithResult(_0x42e278,null))[_0xd75f('0x3d')](handleError(_0x42e278,null));};exports['destroy']=function(_0x563000,_0xe532aa){return db[_0xd75f('0x25')]['find']({'where':{'id':_0x563000[_0xd75f('0x3f')]['id']}})[_0xd75f('0x1e')](handleEntityNotFound(_0xe532aa,null))[_0xd75f('0x1e')](removeEntity(_0xe532aa,null))[_0xd75f('0x3d')](handleError(_0xe532aa,null));};exports[_0xd75f('0x44')]=function(_0x17a30a,_0x15431c,_0xe1d7fb){var _0x73b4b5={};var _0x529c07={};var _0x422591;var _0x1a34f2;return db[_0xd75f('0x25')][_0xd75f('0x45')]({'where':{'id':_0x17a30a[_0xd75f('0x3f')]['id']}})[_0xd75f('0x1e')](handleEntityNotFound(_0x15431c,null))[_0xd75f('0x1e')](function(_0x1130de){if(_0x1130de){_0x422591=_0x1130de;_0x529c07[_0xd75f('0x29')]=_[_0xd75f('0x2b')](db['FreshsalesConfiguration'][_0xd75f('0x26')]);_0x529c07[_0xd75f('0x2a')]=_[_0xd75f('0x2b')](_0x17a30a[_0xd75f('0x2a')]);_0x529c07['filters']=_[_0xd75f('0x2c')](_0x529c07[_0xd75f('0x29')],_0x529c07[_0xd75f('0x2a')]);_0x73b4b5[_0xd75f('0x2d')]=_['intersection'](_0x529c07[_0xd75f('0x29')],qs['fields'](_0x17a30a[_0xd75f('0x2a')][_0xd75f('0x2e')]));_0x73b4b5[_0xd75f('0x2d')]=_0x73b4b5[_0xd75f('0x2d')][_0xd75f('0x2f')]?_0x73b4b5[_0xd75f('0x2d')]:_0x529c07[_0xd75f('0x29')];_0x73b4b5[_0xd75f('0x32')]=qs[_0xd75f('0x33')](_0x17a30a['query']['sort']);_0x73b4b5[_0xd75f('0x34')]=qs['filters'](_[_0xd75f('0x36')](_0x17a30a[_0xd75f('0x2a')],_0x529c07[_0xd75f('0x35')]));if(_0x17a30a['query'][_0xd75f('0x37')]){_0x73b4b5[_0xd75f('0x34')]=_[_0xd75f('0x3a')](_0x73b4b5[_0xd75f('0x34')],{'$or':_['map'](_0x73b4b5['attributes'],function(_0x5ea7a8){var _0x409cb9={};_0x409cb9[_0x5ea7a8]={'$like':'%'+_0x17a30a[_0xd75f('0x2a')][_0xd75f('0x37')]+'%'};return _0x409cb9;})});}_0x73b4b5=_[_0xd75f('0x3a')]({},_0x73b4b5,_0x17a30a[_0xd75f('0x3b')]);return _0x422591[_0xd75f('0x44')](_0x73b4b5);}})[_0xd75f('0x1e')](function(_0x9a3f5a){if(_0x9a3f5a){_0x1a34f2=_0x9a3f5a[_0xd75f('0x2f')];if(!_0x17a30a[_0xd75f('0x2a')][_0xd75f('0x30')](_0xd75f('0x31'))){_0x73b4b5[_0xd75f('0x18')]=qs[_0xd75f('0x18')](_0x17a30a[_0xd75f('0x2a')][_0xd75f('0x18')]);_0x73b4b5['offset']=qs[_0xd75f('0x16')](_0x17a30a['query'][_0xd75f('0x16')]);}return _0x422591[_0xd75f('0x44')](_0x73b4b5);}})[_0xd75f('0x1e')](function(_0x22432a){if(_0x22432a){return _0x22432a?{'count':_0x1a34f2,'rows':_0x22432a}:null;}})[_0xd75f('0x1e')](respondWithResult(_0x15431c,null))[_0xd75f('0x3d')](handleError(_0x15431c,null));};exports['addConfiguration']=function(_0x4d85d9,_0x4269c1,_0xc628b3){if(_0x4d85d9[_0xd75f('0x42')]['id']){delete _0x4d85d9[_0xd75f('0x42')]['id'];}return db[_0xd75f('0x25')][_0xd75f('0x45')]({'where':{'id':_0x4d85d9[_0xd75f('0x3f')]['id']}})[_0xd75f('0x1e')](handleEntityNotFound(_0x4269c1,null))[_0xd75f('0x1e')](function(_0x1c74be){if(_0x1c74be){_0x4d85d9['body'][_0xd75f('0x46')]=_0x1c74be['id'];_0x4d85d9[_0xd75f('0x42')][_0xd75f('0x47')]=integrations['getSubjects'](_0x4d85d9['body'][_0xd75f('0x48')],_0x4d85d9[_0xd75f('0x42')][_0xd75f('0x28')]);_0x4d85d9['body'][_0xd75f('0x49')]=integrations[_0xd75f('0x4a')](_0x4d85d9[_0xd75f('0x42')][_0xd75f('0x48')],_0x4d85d9[_0xd75f('0x42')][_0xd75f('0x28')]);return db[_0xd75f('0x4b')][_0xd75f('0x41')](_0x4d85d9[_0xd75f('0x42')],{'include':[{'model':db[_0xd75f('0x4c')],'as':_0xd75f('0x47')},{'model':db['FreshsalesField'],'as':_0xd75f('0x49')}]});}return null;})[_0xd75f('0x1e')](respondWithResult(_0x4269c1,null))[_0xd75f('0x3d')](handleError(_0x4269c1,null));};exports[_0xd75f('0x4d')]=function(_0x502186,_0x5211e6,_0x3c6add){var _0x2d2d4f='';var _0x1261a7='';return db[_0xd75f('0x25')][_0xd75f('0x45')]({'where':{'id':_0x502186['params']['id']},'attributes':['id','username',_0xd75f('0x4e'),_0xd75f('0x4f')]})[_0xd75f('0x1e')](handleEntityNotFound(_0x5211e6,null))[_0xd75f('0x1e')](function(_0x6cce8d){if(_0x6cce8d){_0x1261a7=_0x6cce8d['username'];_0x2d2d4f=_0x6cce8d[_0xd75f('0x4e')];var _0x1677a3=_0x6cce8d['remoteUri'][_0xd75f('0x50')](-0x1);if(_0x1677a3==='/'){_0x2d2d4f=_0x2d2d4f[_0xd75f('0x51')](0x0,_0x2d2d4f[_0xd75f('0x52')](_0x1677a3));}return rp({'method':_0xd75f('0x53'),'uri':util[_0xd75f('0x54')](_0xd75f('0x55'),_0x2d2d4f,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x6cce8d[_0xd75f('0x4f')]},'json':!![]});}})['then'](function(_0x3b0cac){if(_0x3b0cac){var _0x107199=_0x3b0cac[_0xd75f('0x56')];var _0x3a2187=![];var _0x5c66c6=null;for(_0x5c66c6=0x0;_0x5c66c6<_0x107199[_0xd75f('0x2f')];_0x5c66c6++){if(_0x107199[_0x5c66c6]['email']===_0x1261a7){_0x3a2187=!![];}}if(_0x3a2187){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd75f('0x57')});}}})[_0xd75f('0x1e')](respondWithResult(_0x5211e6,null))[_0xd75f('0x3d')](function(_0xf54811){var _0xbea7f5=_0x502186[_0xd75f('0x2a')][_0xd75f('0x58')]?0x1f4:_0xf54811[_0xd75f('0x59')]||0x1f4;logger[_0xd75f('0x5a')](_0xd75f('0x5b'),_0xd75f('0x4d'),_0xbea7f5,JSON[_0xd75f('0x5c')](_0xf54811));delete _0xf54811[_0xd75f('0x22')];if(_0xbea7f5===0x191){_0xbea7f5=0x190;}_0x5211e6[_0xd75f('0x14')](_0xbea7f5)['send'](_0x502186['query'][_0xd75f('0x58')]?{'message':_0xd75f('0x5d'),'statusCode':_0xf54811['statusCode']}:_0xf54811);});}; \ No newline at end of file +var _0x3ff7=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesAccount','include','findAll','catch','params','length','find','create','body','FreshsalesConfiguration','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getFields','remoteUri','apiKey','username','slice','substring','GET','format','%s%s','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x3491c3,_0x22f717){var _0x1f91aa=function(_0x3188b4){while(--_0x3188b4){_0x3491c3['push'](_0x3491c3['shift']());}};_0x1f91aa(++_0x22f717);}(_0x3ff7,0xf1));var _0x73ff=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0x3ff7[_0x3b3f4f];return _0x174dbe;};'use strict';var emlformat=require(_0x73ff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x73ff('0x1'));var rp=require(_0x73ff('0x2'));var moment=require(_0x73ff('0x3'));var BPromise=require(_0x73ff('0x4'));var Mustache=require(_0x73ff('0x5'));var util=require(_0x73ff('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x73ff('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x73ff('0x8'));var squel=require(_0x73ff('0x9'));var crypto=require(_0x73ff('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x73ff('0x7'));var querystring=require('querystring');var Papa=require(_0x73ff('0xb'));var Redis=require('ioredis');var authService=require(_0x73ff('0xc'));var qs=require(_0x73ff('0xd'));var as=require(_0x73ff('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73ff('0xf'))(_0x73ff('0x10'));var utils=require(_0x73ff('0x11'));var config=require(_0x73ff('0x12'));var licenseUtil=require(_0x73ff('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0x73ff('0x14'));function respondWithStatusCode(_0x56dee0,_0x1b5983){_0x1b5983=_0x1b5983||0xcc;return function(_0x191db6){if(_0x191db6){return _0x56dee0['sendStatus'](_0x1b5983);}return _0x56dee0[_0x73ff('0x15')](_0x1b5983)['end']();};}function respondWithResult(_0x76aec,_0xe2ee4f){_0xe2ee4f=_0xe2ee4f||0xc8;return function(_0xd505de){if(_0xd505de){return _0x76aec[_0x73ff('0x15')](_0xe2ee4f)['json'](_0xd505de);}};}function respondWithFilteredResult(_0x4d7db2,_0x3f1d42){return function(_0x2799a4){if(_0x2799a4){var _0xb3e98e=typeof _0x3f1d42['offset']===_0x73ff('0x16')&&typeof _0x3f1d42[_0x73ff('0x17')]==='undefined';var _0x3f3747=_0x2799a4[_0x73ff('0x18')];var _0x1e3d29=_0xb3e98e?0x0:_0x3f1d42[_0x73ff('0x19')];var _0x3f8267=_0xb3e98e?_0x2799a4[_0x73ff('0x18')]:_0x3f1d42[_0x73ff('0x19')]+_0x3f1d42[_0x73ff('0x17')];var _0x35794e;if(_0x3f8267>=_0x3f3747){_0x3f8267=_0x3f3747;_0x35794e=0xc8;}else{_0x35794e=0xce;}_0x4d7db2['status'](_0x35794e);return _0x4d7db2[_0x73ff('0x1a')](_0x73ff('0x1b'),_0x1e3d29+'-'+_0x3f8267+'/'+_0x3f3747)[_0x73ff('0x1c')](_0x2799a4);}return null;};}function patchUpdates(_0x318b70){return function(_0xfa5b10){try{jsonpatch[_0x73ff('0x1d')](_0xfa5b10,_0x318b70,!![]);}catch(_0x1ab7e3){return BPromise[_0x73ff('0x1e')](_0x1ab7e3);}return _0xfa5b10['save']();};}function saveUpdates(_0x29e8b1,_0x323cac){return function(_0x4a72e4){if(_0x4a72e4){return _0x4a72e4[_0x73ff('0x1f')](_0x29e8b1)[_0x73ff('0x20')](function(_0x1527d2){return _0x1527d2;});}return null;};}function removeEntity(_0x2b0d12,_0x53ca60){return function(_0x4100e2){if(_0x4100e2){return _0x4100e2[_0x73ff('0x21')]()[_0x73ff('0x20')](function(){_0x2b0d12[_0x73ff('0x15')](0xcc)[_0x73ff('0x22')]();});}};}function handleEntityNotFound(_0x4c67c3,_0x4c130c){return function(_0x2aaca3){if(!_0x2aaca3){_0x4c67c3['sendStatus'](0x194);}return _0x2aaca3;};}function handleError(_0x5b9835,_0x2d7d96){_0x2d7d96=_0x2d7d96||0x1f4;return function(_0x4758f4){logger[_0x73ff('0x23')](_0x4758f4[_0x73ff('0x24')]);if(_0x4758f4[_0x73ff('0x25')]){delete _0x4758f4[_0x73ff('0x25')];}_0x5b9835[_0x73ff('0x15')](_0x2d7d96)[_0x73ff('0x26')](_0x4758f4);};}exports[_0x73ff('0x27')]=function(_0x1ba5ca,_0xd53e35){var _0x119876={},_0x4e3b6c={},_0xee83ca={'count':0x0,'rows':[]};var _0x4e14f4=_[_0x73ff('0x28')](db['FreshsalesAccount'][_0x73ff('0x29')],function(_0x3b58ee){return{'name':_0x3b58ee[_0x73ff('0x2a')],'type':_0x3b58ee[_0x73ff('0x2b')][_0x73ff('0x2c')]};});_0x4e3b6c[_0x73ff('0x2d')]=_[_0x73ff('0x28')](_0x4e14f4,_0x73ff('0x25'));_0x4e3b6c[_0x73ff('0x2e')]=_[_0x73ff('0x2f')](_0x1ba5ca[_0x73ff('0x2e')]);_0x4e3b6c[_0x73ff('0x30')]=_[_0x73ff('0x31')](_0x4e3b6c[_0x73ff('0x2d')],_0x4e3b6c[_0x73ff('0x2e')]);_0x119876[_0x73ff('0x32')]=_[_0x73ff('0x31')](_0x4e3b6c['model'],qs[_0x73ff('0x33')](_0x1ba5ca[_0x73ff('0x2e')][_0x73ff('0x33')]));_0x119876[_0x73ff('0x32')]=_0x119876[_0x73ff('0x32')]['length']?_0x119876[_0x73ff('0x32')]:_0x4e3b6c[_0x73ff('0x2d')];if(!_0x1ba5ca[_0x73ff('0x2e')][_0x73ff('0x34')](_0x73ff('0x35'))){_0x119876['limit']=qs['limit'](_0x1ba5ca['query'][_0x73ff('0x17')]);_0x119876[_0x73ff('0x19')]=qs[_0x73ff('0x19')](_0x1ba5ca['query'][_0x73ff('0x19')]);}_0x119876[_0x73ff('0x36')]=qs['sort'](_0x1ba5ca[_0x73ff('0x2e')][_0x73ff('0x37')]);_0x119876[_0x73ff('0x38')]=qs[_0x73ff('0x30')](_[_0x73ff('0x39')](_0x1ba5ca[_0x73ff('0x2e')],_0x4e3b6c[_0x73ff('0x30')]),_0x4e14f4);if(_0x1ba5ca[_0x73ff('0x2e')][_0x73ff('0x3a')]){_0x119876['where']=_[_0x73ff('0x3b')](_0x119876[_0x73ff('0x38')],{'$or':_[_0x73ff('0x28')](_0x4e14f4,function(_0x44a150){if(_0x44a150['type']!==_0x73ff('0x3c')){var _0xd2880f={};_0xd2880f[_0x44a150['name']]={'$like':'%'+_0x1ba5ca[_0x73ff('0x2e')]['filter']+'%'};return _0xd2880f;}})});}_0x119876=_[_0x73ff('0x3b')]({},_0x119876,_0x1ba5ca[_0x73ff('0x3d')]);var _0x55cf41={'where':_0x119876[_0x73ff('0x38')]};return db[_0x73ff('0x3e')][_0x73ff('0x18')](_0x55cf41)[_0x73ff('0x20')](function(_0x44b8e8){_0xee83ca[_0x73ff('0x18')]=_0x44b8e8;if(_0x1ba5ca[_0x73ff('0x2e')]['includeAll']){_0x119876[_0x73ff('0x3f')]=[{'all':!![]}];}return db[_0x73ff('0x3e')][_0x73ff('0x40')](_0x119876);})[_0x73ff('0x20')](function(_0x828ac2){_0xee83ca['rows']=_0x828ac2;return _0xee83ca;})[_0x73ff('0x20')](respondWithFilteredResult(_0xd53e35,_0x119876))[_0x73ff('0x41')](handleError(_0xd53e35,null));};exports['show']=function(_0x399f3b,_0x1abcac){var _0x21365f={'raw':![],'where':{'id':_0x399f3b[_0x73ff('0x42')]['id']}},_0x2942df={};_0x2942df[_0x73ff('0x2d')]=_[_0x73ff('0x2f')](db[_0x73ff('0x3e')][_0x73ff('0x29')]);_0x2942df[_0x73ff('0x2e')]=_[_0x73ff('0x2f')](_0x399f3b[_0x73ff('0x2e')]);_0x2942df[_0x73ff('0x30')]=_['intersection'](_0x2942df[_0x73ff('0x2d')],_0x2942df[_0x73ff('0x2e')]);_0x21365f[_0x73ff('0x32')]=_[_0x73ff('0x31')](_0x2942df[_0x73ff('0x2d')],qs[_0x73ff('0x33')](_0x399f3b[_0x73ff('0x2e')]['fields']));_0x21365f[_0x73ff('0x32')]=_0x21365f[_0x73ff('0x32')][_0x73ff('0x43')]?_0x21365f[_0x73ff('0x32')]:_0x2942df[_0x73ff('0x2d')];if(_0x399f3b['query']['includeAll']){_0x21365f[_0x73ff('0x3f')]=[{'all':!![]}];}_0x21365f=_[_0x73ff('0x3b')]({},_0x21365f,_0x399f3b[_0x73ff('0x3d')]);return db[_0x73ff('0x3e')][_0x73ff('0x44')](_0x21365f)[_0x73ff('0x20')](handleEntityNotFound(_0x1abcac,null))[_0x73ff('0x20')](respondWithResult(_0x1abcac,null))[_0x73ff('0x41')](handleError(_0x1abcac,null));};exports[_0x73ff('0x45')]=function(_0x2d34ec,_0x37d32c){return db['FreshsalesAccount'][_0x73ff('0x45')](_0x2d34ec[_0x73ff('0x46')],{})[_0x73ff('0x20')](respondWithResult(_0x37d32c,0xc9))[_0x73ff('0x41')](handleError(_0x37d32c,null));};exports[_0x73ff('0x1f')]=function(_0x272b5c,_0x18243b){if(_0x272b5c[_0x73ff('0x46')]['id']){delete _0x272b5c[_0x73ff('0x46')]['id'];}return db['FreshsalesAccount'][_0x73ff('0x44')]({'where':{'id':_0x272b5c[_0x73ff('0x42')]['id']}})[_0x73ff('0x20')](handleEntityNotFound(_0x18243b,null))['then'](saveUpdates(_0x272b5c[_0x73ff('0x46')],null))[_0x73ff('0x20')](respondWithResult(_0x18243b,null))['catch'](handleError(_0x18243b,null));};exports[_0x73ff('0x21')]=function(_0x5559fe,_0x3fd065){return db[_0x73ff('0x3e')][_0x73ff('0x44')]({'where':{'id':_0x5559fe[_0x73ff('0x42')]['id']}})[_0x73ff('0x20')](handleEntityNotFound(_0x3fd065,null))[_0x73ff('0x20')](removeEntity(_0x3fd065,null))[_0x73ff('0x41')](handleError(_0x3fd065,null));};exports['getConfigurations']=function(_0x237cd5,_0x1ab572,_0x3a0bb3){var _0x3f4c64={};var _0x4f0d00={};var _0x14e74a;var _0x258920;return db[_0x73ff('0x3e')]['findOne']({'where':{'id':_0x237cd5[_0x73ff('0x42')]['id']}})[_0x73ff('0x20')](handleEntityNotFound(_0x1ab572,null))[_0x73ff('0x20')](function(_0x2f8fb1){if(_0x2f8fb1){_0x14e74a=_0x2f8fb1;_0x4f0d00['model']=_['keys'](db[_0x73ff('0x47')][_0x73ff('0x29')]);_0x4f0d00['query']=_[_0x73ff('0x2f')](_0x237cd5['query']);_0x4f0d00[_0x73ff('0x30')]=_['intersection'](_0x4f0d00[_0x73ff('0x2d')],_0x4f0d00[_0x73ff('0x2e')]);_0x3f4c64['attributes']=_[_0x73ff('0x31')](_0x4f0d00['model'],qs[_0x73ff('0x33')](_0x237cd5[_0x73ff('0x2e')][_0x73ff('0x33')]));_0x3f4c64['attributes']=_0x3f4c64[_0x73ff('0x32')][_0x73ff('0x43')]?_0x3f4c64['attributes']:_0x4f0d00[_0x73ff('0x2d')];_0x3f4c64[_0x73ff('0x36')]=qs[_0x73ff('0x37')](_0x237cd5[_0x73ff('0x2e')][_0x73ff('0x37')]);_0x3f4c64['where']=qs[_0x73ff('0x30')](_[_0x73ff('0x39')](_0x237cd5[_0x73ff('0x2e')],_0x4f0d00['filters']));if(_0x237cd5[_0x73ff('0x2e')][_0x73ff('0x3a')]){_0x3f4c64[_0x73ff('0x38')]=_[_0x73ff('0x3b')](_0x3f4c64[_0x73ff('0x38')],{'$or':_[_0x73ff('0x28')](_0x3f4c64[_0x73ff('0x32')],function(_0x122614){var _0xc3d378={};_0xc3d378[_0x122614]={'$like':'%'+_0x237cd5[_0x73ff('0x2e')]['filter']+'%'};return _0xc3d378;})});}_0x3f4c64=_[_0x73ff('0x3b')]({},_0x3f4c64,_0x237cd5[_0x73ff('0x3d')]);return _0x14e74a[_0x73ff('0x48')](_0x3f4c64);}})[_0x73ff('0x20')](function(_0x5e9a7e){if(_0x5e9a7e){_0x258920=_0x5e9a7e[_0x73ff('0x43')];if(!_0x237cd5[_0x73ff('0x2e')][_0x73ff('0x34')](_0x73ff('0x35'))){_0x3f4c64[_0x73ff('0x17')]=qs['limit'](_0x237cd5[_0x73ff('0x2e')][_0x73ff('0x17')]);_0x3f4c64[_0x73ff('0x19')]=qs[_0x73ff('0x19')](_0x237cd5[_0x73ff('0x2e')][_0x73ff('0x19')]);}return _0x14e74a[_0x73ff('0x48')](_0x3f4c64);}})['then'](function(_0x28c331){if(_0x28c331){return _0x28c331?{'count':_0x258920,'rows':_0x28c331}:null;}})[_0x73ff('0x20')](respondWithResult(_0x1ab572,null))[_0x73ff('0x41')](handleError(_0x1ab572,null));};exports[_0x73ff('0x49')]=function(_0x5a70eb,_0x55cc89,_0x5a1eac){if(_0x5a70eb['body']['id']){delete _0x5a70eb[_0x73ff('0x46')]['id'];}return db[_0x73ff('0x3e')][_0x73ff('0x4a')]({'where':{'id':_0x5a70eb[_0x73ff('0x42')]['id']}})[_0x73ff('0x20')](handleEntityNotFound(_0x55cc89,null))['then'](function(_0x2acc68){if(_0x2acc68){_0x5a70eb[_0x73ff('0x46')][_0x73ff('0x4b')]=_0x2acc68['id'];_0x5a70eb[_0x73ff('0x46')][_0x73ff('0x4c')]=integrations['getSubjects'](_0x5a70eb[_0x73ff('0x46')][_0x73ff('0x4d')],_0x5a70eb[_0x73ff('0x46')]['type']);_0x5a70eb['body'][_0x73ff('0x4e')]=integrations['getDescriptions'](_0x5a70eb[_0x73ff('0x46')][_0x73ff('0x4d')],_0x5a70eb['body'][_0x73ff('0x2b')]);return db['FreshsalesConfiguration']['create'](_0x5a70eb[_0x73ff('0x46')],{'include':[{'model':db['FreshsalesField'],'as':_0x73ff('0x4c')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x73ff('0x20')](respondWithResult(_0x55cc89,null))[_0x73ff('0x41')](handleError(_0x55cc89,null));};exports[_0x73ff('0x4f')]=function(_0x514e15,_0x504338,_0x18c4f8){var _0x3a1757='';var _0x8198de='';return db[_0x73ff('0x3e')][_0x73ff('0x4a')]({'where':{'id':_0x514e15[_0x73ff('0x42')]['id']},'attributes':['id','username',_0x73ff('0x50'),_0x73ff('0x51')]})[_0x73ff('0x20')](handleEntityNotFound(_0x504338,null))[_0x73ff('0x20')](function(_0x1f151b){if(_0x1f151b){_0x8198de=_0x1f151b[_0x73ff('0x52')];_0x3a1757=_0x1f151b[_0x73ff('0x50')];var _0x62a67f=_0x1f151b[_0x73ff('0x50')][_0x73ff('0x53')](-0x1);if(_0x62a67f==='/'){_0x3a1757=_0x3a1757[_0x73ff('0x54')](0x0,_0x3a1757['lastIndexOf'](_0x62a67f));}return rp({'method':_0x73ff('0x55'),'uri':util[_0x73ff('0x56')](_0x73ff('0x57'),_0x3a1757,'/api/selector/owners'),'headers':{'Authorization':_0x73ff('0x58')+_0x1f151b[_0x73ff('0x51')]},'json':!![]});}})[_0x73ff('0x20')](function(_0x4f3db6){if(_0x4f3db6){var _0xca8cc0=_0x4f3db6['users'];var _0x5e3f1a=![];var _0x4a9d51=null;for(_0x4a9d51=0x0;_0x4a9d51<_0xca8cc0[_0x73ff('0x43')];_0x4a9d51++){if(_0xca8cc0[_0x4a9d51][_0x73ff('0x59')]===_0x8198de){_0x5e3f1a=!![];}}if(_0x5e3f1a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x73ff('0x5a')});}}})[_0x73ff('0x20')](respondWithResult(_0x504338,null))[_0x73ff('0x41')](function(_0x5b9b86){var _0x52e02e=_0x514e15[_0x73ff('0x2e')][_0x73ff('0x5b')]?0x1f4:_0x5b9b86['statusCode']||0x1f4;logger['error'](_0x73ff('0x5c'),_0x73ff('0x4f'),_0x52e02e,JSON[_0x73ff('0x5d')](_0x5b9b86));delete _0x5b9b86['name'];if(_0x52e02e===0x191){_0x52e02e=0x190;}_0x504338[_0x73ff('0x15')](_0x52e02e)[_0x73ff('0x26')](_0x514e15[_0x73ff('0x2e')][_0x73ff('0x5b')]?{'message':_0x73ff('0x5e'),'statusCode':_0x5b9b86['statusCode']}:_0x5b9b86);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 947b317..8a76e02 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 _0xb016=['../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x39e8f2,_0x2d622d){var _0x49d132=function(_0x97aca4){while(--_0x97aca4){_0x39e8f2['push'](_0x39e8f2['shift']());}};_0x49d132(++_0x2d622d);}(_0xb016,0x159));var _0x6b01=function(_0x4e7887,_0x137435){_0x4e7887=_0x4e7887-0x0;var _0x5a3a30=_0xb016[_0x4e7887];return _0x5a3a30;};'use strict';var _=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6b01('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b01('0x3'));var fs=require('fs');var path=require(_0x6b01('0x4'));var rimraf=require(_0x6b01('0x5'));var config=require(_0x6b01('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x6b01('0x7'));module[_0x6b01('0x8')]=function(_0x192b2d,_0x5759a1){return _0x192b2d['define'](_0x6b01('0x9'),attributes,{'tableName':_0x6b01('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa456=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x140e69,_0x1e9ddb){var _0x2ac026=function(_0x1d6a4a){while(--_0x1d6a4a){_0x140e69['push'](_0x140e69['shift']());}};_0x2ac026(++_0x1e9ddb);}(_0xa456,0x142));var _0x6a45=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xa456[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var logger=require(_0x6a45('0x2'))(_0x6a45('0x3'));var moment=require('moment');var BPromise=require(_0x6a45('0x4'));var rp=require(_0x6a45('0x5'));var fs=require('fs');var path=require(_0x6a45('0x6'));var rimraf=require('rimraf');var config=require(_0x6a45('0x7'));var attributes=require(_0x6a45('0x8'));var integrations=require(_0x6a45('0x9'));module[_0x6a45('0xa')]=function(_0x4dfbfa,_0x25cf8d){return _0x4dfbfa[_0x6a45('0xb')](_0x6a45('0xc'),attributes,{'tableName':_0x6a45('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 5ebe738..9c9d2a3 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 _0x0598=['map','model','then','ShowFreshsalesAccount','find','where','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include'];(function(_0x2396a9,_0x179052){var _0x3e86fb=function(_0x496cf1){while(--_0x496cf1){_0x2396a9['push'](_0x2396a9['shift']());}};_0x3e86fb(++_0x179052);}(_0x0598,0x92));var _0x8059=function(_0x555ed2,_0x214f34){_0x555ed2=_0x555ed2-0x0;var _0x94f413=_0x0598[_0x555ed2];return _0x94f413;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5996d7,_0x248273,_0x347f1b){return new BPromise(function(_0x4610d2,_0x116946){return client['request'](_0x5996d7,_0x347f1b)['then'](function(_0x89dda1){logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,_0x8059('0x9'));logger[_0x8059('0xa')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x248273,'request\x20sent',JSON[_0x8059('0xb')](_0x89dda1));if(_0x89dda1[_0x8059('0xc')]){if(_0x89dda1['error']['code']===0x1f4){logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);return _0x116946(_0x89dda1[_0x8059('0xc')][_0x8059('0xd')]);}logger['error'](_0x8059('0x8'),_0x248273,_0x89dda1['error'][_0x8059('0xd')]);return _0x4610d2(_0x89dda1['error'][_0x8059('0xd')]);}else{logger[_0x8059('0x7')](_0x8059('0x8'),_0x248273,'request\x20sent');_0x4610d2(_0x89dda1['result']['message']);}})[_0x8059('0xe')](function(_0x239195){logger[_0x8059('0xc')](_0x8059('0x8'),_0x248273,_0x239195);_0x116946(_0x239195);});});}exports[_0x8059('0xf')]=function(_0x4b6d55){var _0x10ad98=this;return new Promise(function(_0x2bb670,_0x37e926){return db[_0x8059('0x10')]['findAll']({'raw':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x4b6d55['options']?_0x4b6d55[_0x8059('0x11')]['where']||null:null,'attributes':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x13')]||null:null,'limit':_0x4b6d55['options']?_0x4b6d55['options'][_0x8059('0x14')]||null:null,'include':_0x4b6d55[_0x8059('0x11')]?_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')]?_['map'](_0x4b6d55[_0x8059('0x11')][_0x8059('0x15')],function(_0x3da080){return{'model':db[_0x3da080['model']],'as':_0x3da080['as'],'attributes':_0x3da080[_0x8059('0x13')],'include':_0x3da080[_0x8059('0x15')]?_[_0x8059('0x16')](_0x3da080[_0x8059('0x15')],function(_0x59d3a6){return{'model':db[_0x59d3a6[_0x8059('0x17')]],'as':_0x59d3a6['as'],'attributes':_0x59d3a6[_0x8059('0x13')],'include':_0x59d3a6[_0x8059('0x15')]?_[_0x8059('0x16')](_0x59d3a6[_0x8059('0x15')],function(_0x54b88b){return{'model':db[_0x54b88b[_0x8059('0x17')]],'as':_0x54b88b['as'],'attributes':_0x54b88b[_0x8059('0x13')]};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x4a294f){logger['info']('GetFreshsalesAccount',_0x4b6d55);logger[_0x8059('0xa')](_0x8059('0xf'),_0x4b6d55,JSON[_0x8059('0xb')](_0x4a294f));_0x2bb670(_0x4a294f);})[_0x8059('0xe')](function(_0x59abe9){logger[_0x8059('0xc')]('GetFreshsalesAccount',_0x59abe9[_0x8059('0xd')],_0x4b6d55);_0x37e926(_0x10ad98[_0x8059('0xc')](0x1f4,_0x59abe9['message']));});});};exports[_0x8059('0x19')]=function(_0x1aead2){var _0x30aac2=this;return new Promise(function(_0x260ba8,_0x2799b7){return db[_0x8059('0x10')][_0x8059('0x1a')]({'raw':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x12')]===undefined?!![]:![]:!![],'where':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x1b')]||null:null,'attributes':_0x1aead2[_0x8059('0x11')]?_0x1aead2['options'][_0x8059('0x13')]||null:null,'include':_0x1aead2[_0x8059('0x11')]?_0x1aead2[_0x8059('0x11')][_0x8059('0x15')]?_[_0x8059('0x16')](_0x1aead2[_0x8059('0x11')][_0x8059('0x15')],function(_0x175d57){return{'model':db[_0x175d57[_0x8059('0x17')]],'as':_0x175d57['as'],'attributes':_0x175d57[_0x8059('0x13')],'include':_0x175d57['include']?_[_0x8059('0x16')](_0x175d57['include'],function(_0x24194d){return{'model':db[_0x24194d['model']],'as':_0x24194d['as'],'attributes':_0x24194d['attributes'],'include':_0x24194d[_0x8059('0x15')]?_['map'](_0x24194d[_0x8059('0x15')],function(_0x50c745){return{'model':db[_0x50c745[_0x8059('0x17')]],'as':_0x50c745['as'],'attributes':_0x50c745['attributes']};}):[]};}):[]};}):[]:[]})[_0x8059('0x18')](function(_0x5c4aa0){logger['info'](_0x8059('0x19'),_0x1aead2);logger[_0x8059('0xa')](_0x8059('0x19'),_0x1aead2,JSON['stringify'](_0x5c4aa0));_0x260ba8(_0x5c4aa0);})[_0x8059('0xe')](function(_0x4927c9){logger[_0x8059('0xc')]('ShowFreshsalesAccount',_0x4927c9[_0x8059('0xd')],_0x1aead2);_0x2799b7(_0x30aac2[_0x8059('0xc')](0x1f4,_0x4927c9[_0x8059('0xd')]));});});}; \ No newline at end of file +var _0x4325=['stringify','code','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','ShowFreshsalesAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x50f43d,_0x48b15c){var _0x402808=function(_0xb47a1c){while(--_0xb47a1c){_0x50f43d['push'](_0x50f43d['shift']());}};_0x402808(++_0x48b15c);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}exports[_0x5432('0x17')]=function(_0x32fe60){var _0x4221a8=this;return new Promise(function(_0x5f011f,_0x3f3873){return db[_0x5432('0x18')][_0x5432('0x19')]({'raw':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options'][_0x5432('0x1c')]||null:null,'attributes':_0x32fe60[_0x5432('0x1a')]?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'limit':_0x32fe60[_0x5432('0x1a')]?_0x32fe60['options']['limit']||null:null,'include':_0x32fe60['options']?_0x32fe60[_0x5432('0x1a')][_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x32fe60[_0x5432('0x1a')]['include'],function(_0x4af5f4){return{'model':db[_0x4af5f4[_0x5432('0x20')]],'as':_0x4af5f4['as'],'attributes':_0x4af5f4[_0x5432('0x1d')],'include':_0x4af5f4['include']?_[_0x5432('0x1f')](_0x4af5f4[_0x5432('0x1e')],function(_0x637582){return{'model':db[_0x637582['model']],'as':_0x637582['as'],'attributes':_0x637582[_0x5432('0x1d')],'include':_0x637582[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x637582['include'],function(_0x4ab09d){return{'model':db[_0x4ab09d[_0x5432('0x20')]],'as':_0x4ab09d['as'],'attributes':_0x4ab09d[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1abe73){logger[_0x5432('0x14')](_0x5432('0x17'),_0x32fe60);logger['debug'](_0x5432('0x17'),_0x32fe60,JSON['stringify'](_0x1abe73));_0x5f011f(_0x1abe73);})['catch'](function(_0x6fc7f5){logger['error'](_0x5432('0x17'),_0x6fc7f5['message'],_0x32fe60);_0x3f3873(_0x4221a8['error'](0x1f4,_0x6fc7f5[_0x5432('0x13')]));});});};exports[_0x5432('0x21')]=function(_0x345b51){var _0x4e92d5=this;return new Promise(function(_0x31490c,_0x1d436c){return db[_0x5432('0x18')][_0x5432('0x22')]({'raw':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1b')]===undefined?!![]:![]:!![],'where':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')]['where']||null:null,'attributes':_0x345b51['options']?_0x345b51[_0x5432('0x1a')][_0x5432('0x1d')]||null:null,'include':_0x345b51[_0x5432('0x1a')]?_0x345b51[_0x5432('0x1a')][_0x5432('0x1e')]?_['map'](_0x345b51[_0x5432('0x1a')]['include'],function(_0x2955e0){return{'model':db[_0x2955e0[_0x5432('0x20')]],'as':_0x2955e0['as'],'attributes':_0x2955e0[_0x5432('0x1d')],'include':_0x2955e0[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x2955e0[_0x5432('0x1e')],function(_0x5c3c77){return{'model':db[_0x5c3c77[_0x5432('0x20')]],'as':_0x5c3c77['as'],'attributes':_0x5c3c77[_0x5432('0x1d')],'include':_0x5c3c77[_0x5432('0x1e')]?_[_0x5432('0x1f')](_0x5c3c77['include'],function(_0xe01f4b){return{'model':db[_0xe01f4b[_0x5432('0x20')]],'as':_0xe01f4b['as'],'attributes':_0xe01f4b[_0x5432('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5432('0xb')](function(_0x3fb586){logger[_0x5432('0x14')](_0x5432('0x21'),_0x345b51);logger[_0x5432('0xd')](_0x5432('0x21'),_0x345b51,JSON[_0x5432('0x10')](_0x3fb586));_0x31490c(_0x3fb586);})[_0x5432('0x16')](function(_0x1f4679){logger[_0x5432('0x12')](_0x5432('0x21'),_0x1f4679['message'],_0x345b51);_0x1d436c(_0x4e92d5[_0x5432('0x12')](0x1f4,_0x1f4679['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index f3482dc..0446015 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 _0x7f16=['update','delete','destroy','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','post','create','/:id'];(function(_0x74763b,_0x3adad4){var _0x738f43=function(_0x136773){while(--_0x136773){_0x74763b['push'](_0x74763b['shift']());}};_0x738f43(++_0x3adad4);}(_0x7f16,0x1cb));var _0x67f1=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7f16[_0x4709c0];return _0x13348b;};'use strict';var multer=require(_0x67f1('0x0'));var util=require(_0x67f1('0x1'));var path=require('path');var timeout=require(_0x67f1('0x2'));var express=require('express');var router=express[_0x67f1('0x3')]();var fs_extra=require(_0x67f1('0x4'));var auth=require(_0x67f1('0x5'));var interaction=require(_0x67f1('0x6'));var config=require(_0x67f1('0x7'));var controller=require(_0x67f1('0x8'));router[_0x67f1('0x9')]('/',auth[_0x67f1('0xa')](),controller[_0x67f1('0xb')]);router[_0x67f1('0x9')]('/:id',auth[_0x67f1('0xa')](),controller[_0x67f1('0xc')]);router[_0x67f1('0x9')](_0x67f1('0xd'),auth[_0x67f1('0xa')](),controller[_0x67f1('0xe')]);router['get'](_0x67f1('0xf'),auth['isAuthenticated'](),controller[_0x67f1('0x10')]);router[_0x67f1('0x9')]('/:id/fields',auth[_0x67f1('0xa')](),controller[_0x67f1('0x11')]);router[_0x67f1('0x12')]('/',auth[_0x67f1('0xa')](),controller[_0x67f1('0x13')]);router['put'](_0x67f1('0x14'),auth[_0x67f1('0xa')](),controller[_0x67f1('0x15')]);router[_0x67f1('0x16')](_0x67f1('0x14'),auth['isAuthenticated'](),controller[_0x67f1('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7b59=['/:id/fields','getFields','create','update','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7b59,0x16e));var _0x97b5=function(_0x4b61ca,_0x50a46b){_0x4b61ca=_0x4b61ca-0x0;var _0x418948=_0x7b59[_0x4b61ca];return _0x418948;};'use strict';var multer=require(_0x97b5('0x0'));var util=require(_0x97b5('0x1'));var path=require(_0x97b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x97b5('0x3'));var router=express[_0x97b5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x97b5('0x5'));var config=require(_0x97b5('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x97b5('0x7')]('/',auth[_0x97b5('0x8')](),controller[_0x97b5('0x9')]);router['get'](_0x97b5('0xa'),auth[_0x97b5('0x8')](),controller[_0x97b5('0xb')]);router[_0x97b5('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x97b5('0xc')]);router[_0x97b5('0x7')](_0x97b5('0xd'),auth[_0x97b5('0x8')](),controller['getDescriptions']);router['get'](_0x97b5('0xe'),auth[_0x97b5('0x8')](),controller[_0x97b5('0xf')]);router['post']('/',auth[_0x97b5('0x8')](),controller[_0x97b5('0x10')]);router['put'](_0x97b5('0xa'),auth[_0x97b5('0x8')](),controller[_0x97b5('0x11')]);router['delete'](_0x97b5('0xa'),auth[_0x97b5('0x8')](),controller[_0x97b5('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index ecdd27d..558befc 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 _0x1238=['STRING'];(function(_0x2f4eed,_0x28636c){var _0x4c1b7b=function(_0x2e5662){while(--_0x2e5662){_0x2f4eed['push'](_0x2f4eed['shift']());}};_0x4c1b7b(++_0x28636c);}(_0x1238,0xcd));var _0x8123=function(_0x5c16ad,_0x24312a){_0x5c16ad=_0x5c16ad-0x0;var _0xf9d36e=_0x1238[_0x5c16ad];return _0xf9d36e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8123('0x0')]},'description':{'type':Sequelize[_0x8123('0x0')]}}; \ No newline at end of file +var _0xcdff=['STRING','sequelize','exports'];(function(_0x5e2e33,_0x3e7dfd){var _0x880428=function(_0x1ad276){while(--_0x1ad276){_0x5e2e33['push'](_0x5e2e33['shift']());}};_0x880428(++_0x3e7dfd);}(_0xcdff,0xc1));var _0xfcdf=function(_0x5f221e,_0x4b0232){_0x5f221e=_0x5f221e-0x0;var _0x355a68=_0xcdff[_0x5f221e];return _0x355a68;};'use strict';var Sequelize=require(_0xfcdf('0x0'));module[_0xfcdf('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfcdf('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index ccb4fda..20c68af 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 _0xd35c=['limit','count','Content-Range','save','update','then','destroy','end','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','FreshsalesConfiguration','rows','params','includeAll','include','merge','find','catch','body','FreshsalesField','getSubjects','getDescriptions','getFields','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x29f852,_0x51672f){var _0x768cf8=function(_0x5c3922){while(--_0x5c3922){_0x29f852['push'](_0x29f852['shift']());}};_0x768cf8(++_0x51672f);}(_0xd35c,0x1ae));var _0xcd35=function(_0x3136f4,_0x351900){_0x3136f4=_0x3136f4-0x0;var _0x587c40=_0xd35c[_0x3136f4];return _0x587c40;};'use strict';var emlformat=require(_0xcd35('0x0'));var rimraf=require(_0xcd35('0x1'));var zipdir=require(_0xcd35('0x2'));var jsonpatch=require(_0xcd35('0x3'));var rp=require(_0xcd35('0x4'));var moment=require(_0xcd35('0x5'));var BPromise=require(_0xcd35('0x6'));var Mustache=require(_0xcd35('0x7'));var util=require(_0xcd35('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcd35('0x9'));var ejs=require(_0xcd35('0xa'));var fs=require('fs');var fs_extra=require(_0xcd35('0xb'));var _=require(_0xcd35('0xc'));var squel=require(_0xcd35('0xd'));var crypto=require(_0xcd35('0xe'));var jsforce=require(_0xcd35('0xf'));var deskjs=require(_0xcd35('0x10'));var toCsv=require(_0xcd35('0x9'));var querystring=require(_0xcd35('0x11'));var Papa=require(_0xcd35('0x12'));var Redis=require(_0xcd35('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcd35('0x14'));var logger=require(_0xcd35('0x15'))(_0xcd35('0x16'));var utils=require(_0xcd35('0x17'));var config=require(_0xcd35('0x18'));var licenseUtil=require(_0xcd35('0x19'));var db=require(_0xcd35('0x1a'))['db'];function respondWithStatusCode(_0x47366c,_0x454469){_0x454469=_0x454469||0xcc;return function(_0x5cf846){if(_0x5cf846){return _0x47366c[_0xcd35('0x1b')](_0x454469);}return _0x47366c[_0xcd35('0x1c')](_0x454469)['end']();};}function respondWithResult(_0x467f07,_0x1699a7){_0x1699a7=_0x1699a7||0xc8;return function(_0x3fd028){if(_0x3fd028){return _0x467f07['status'](_0x1699a7)[_0xcd35('0x1d')](_0x3fd028);}};}function respondWithFilteredResult(_0x41b9ef,_0x4899bf){return function(_0x2f03ea){if(_0x2f03ea){var _0x22211e=typeof _0x4899bf[_0xcd35('0x1e')]===_0xcd35('0x1f')&&typeof _0x4899bf[_0xcd35('0x20')]===_0xcd35('0x1f');var _0x445407=_0x2f03ea[_0xcd35('0x21')];var _0x3337a2=_0x22211e?0x0:_0x4899bf['offset'];var _0xb8d3ac=_0x22211e?_0x2f03ea[_0xcd35('0x21')]:_0x4899bf[_0xcd35('0x1e')]+_0x4899bf[_0xcd35('0x20')];var _0x13c1e3;if(_0xb8d3ac>=_0x445407){_0xb8d3ac=_0x445407;_0x13c1e3=0xc8;}else{_0x13c1e3=0xce;}_0x41b9ef[_0xcd35('0x1c')](_0x13c1e3);return _0x41b9ef['set'](_0xcd35('0x22'),_0x3337a2+'-'+_0xb8d3ac+'/'+_0x445407)['json'](_0x2f03ea);}return null;};}function patchUpdates(_0x57c93b){return function(_0x313349){try{jsonpatch['apply'](_0x313349,_0x57c93b,!![]);}catch(_0x259640){return BPromise['reject'](_0x259640);}return _0x313349[_0xcd35('0x23')]();};}function saveUpdates(_0x412ab0,_0x33a924){return function(_0x3c835f){if(_0x3c835f){return _0x3c835f[_0xcd35('0x24')](_0x412ab0)[_0xcd35('0x25')](function(_0x586f16){return _0x586f16;});}return null;};}function removeEntity(_0x13494a,_0x5f3a67){return function(_0x1eb9db){if(_0x1eb9db){return _0x1eb9db[_0xcd35('0x26')]()['then'](function(){_0x13494a[_0xcd35('0x1c')](0xcc)[_0xcd35('0x27')]();});}};}function handleEntityNotFound(_0x54d6ad,_0x1ce375){return function(_0x22be92){if(!_0x22be92){_0x54d6ad[_0xcd35('0x1b')](0x194);}return _0x22be92;};}function handleError(_0x2002c6,_0x47def2){_0x47def2=_0x47def2||0x1f4;return function(_0xbe383){logger['error'](_0xbe383[_0xcd35('0x28')]);if(_0xbe383[_0xcd35('0x29')]){delete _0xbe383['name'];}_0x2002c6[_0xcd35('0x1c')](_0x47def2)['send'](_0xbe383);};}exports[_0xcd35('0x2a')]=function(_0x3d6b20,_0x4b0784){var _0x46ecf5={},_0xfc316f={},_0x982e59={'count':0x0,'rows':[]};var _0x1bb53b=_['map'](db['FreshsalesConfiguration'][_0xcd35('0x2b')],function(_0x437a2f){return{'name':_0x437a2f[_0xcd35('0x2c')],'type':_0x437a2f[_0xcd35('0x2d')]['key']};});_0xfc316f[_0xcd35('0x2e')]=_[_0xcd35('0x2f')](_0x1bb53b,'name');_0xfc316f[_0xcd35('0x30')]=_[_0xcd35('0x31')](_0x3d6b20[_0xcd35('0x30')]);_0xfc316f[_0xcd35('0x32')]=_[_0xcd35('0x33')](_0xfc316f[_0xcd35('0x2e')],_0xfc316f[_0xcd35('0x30')]);_0x46ecf5[_0xcd35('0x34')]=_[_0xcd35('0x33')](_0xfc316f['model'],qs[_0xcd35('0x35')](_0x3d6b20[_0xcd35('0x30')]['fields']));_0x46ecf5[_0xcd35('0x34')]=_0x46ecf5[_0xcd35('0x34')][_0xcd35('0x36')]?_0x46ecf5[_0xcd35('0x34')]:_0xfc316f[_0xcd35('0x2e')];if(!_0x3d6b20[_0xcd35('0x30')][_0xcd35('0x37')](_0xcd35('0x38'))){_0x46ecf5[_0xcd35('0x20')]=qs[_0xcd35('0x20')](_0x3d6b20['query'][_0xcd35('0x20')]);_0x46ecf5[_0xcd35('0x1e')]=qs[_0xcd35('0x1e')](_0x3d6b20[_0xcd35('0x30')][_0xcd35('0x1e')]);}_0x46ecf5[_0xcd35('0x39')]=qs[_0xcd35('0x3a')](_0x3d6b20[_0xcd35('0x30')]['sort']);_0x46ecf5[_0xcd35('0x3b')]=qs['filters'](_[_0xcd35('0x3c')](_0x3d6b20[_0xcd35('0x30')],_0xfc316f[_0xcd35('0x32')]),_0x1bb53b);if(_0x3d6b20[_0xcd35('0x30')]['filter']){_0x46ecf5[_0xcd35('0x3b')]=_['merge'](_0x46ecf5[_0xcd35('0x3b')],{'$or':_[_0xcd35('0x2f')](_0x1bb53b,function(_0x24d8b4){if(_0x24d8b4[_0xcd35('0x2d')]!=='VIRTUAL'){var _0x4373c3={};_0x4373c3[_0x24d8b4[_0xcd35('0x29')]]={'$like':'%'+_0x3d6b20[_0xcd35('0x30')][_0xcd35('0x3d')]+'%'};return _0x4373c3;}})});}_0x46ecf5=_['merge']({},_0x46ecf5,_0x3d6b20[_0xcd35('0x3e')]);var _0x21a09d={'where':_0x46ecf5[_0xcd35('0x3b')]};return db[_0xcd35('0x3f')][_0xcd35('0x21')](_0x21a09d)[_0xcd35('0x25')](function(_0x7d09d3){_0x982e59['count']=_0x7d09d3;if(_0x3d6b20[_0xcd35('0x30')]['includeAll']){_0x46ecf5['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x46ecf5);})[_0xcd35('0x25')](function(_0x2c1c64){_0x982e59[_0xcd35('0x40')]=_0x2c1c64;return _0x982e59;})['then'](respondWithFilteredResult(_0x4b0784,_0x46ecf5))['catch'](handleError(_0x4b0784,null));};exports['show']=function(_0xd4a7d4,_0x4af686){var _0x3d10d2={'raw':![],'where':{'id':_0xd4a7d4[_0xcd35('0x41')]['id']}},_0x41b373={};_0x41b373[_0xcd35('0x2e')]=_[_0xcd35('0x31')](db[_0xcd35('0x3f')][_0xcd35('0x2b')]);_0x41b373['query']=_[_0xcd35('0x31')](_0xd4a7d4[_0xcd35('0x30')]);_0x41b373[_0xcd35('0x32')]=_['intersection'](_0x41b373[_0xcd35('0x2e')],_0x41b373['query']);_0x3d10d2[_0xcd35('0x34')]=_[_0xcd35('0x33')](_0x41b373[_0xcd35('0x2e')],qs[_0xcd35('0x35')](_0xd4a7d4[_0xcd35('0x30')][_0xcd35('0x35')]));_0x3d10d2[_0xcd35('0x34')]=_0x3d10d2[_0xcd35('0x34')][_0xcd35('0x36')]?_0x3d10d2[_0xcd35('0x34')]:_0x41b373['model'];if(_0xd4a7d4[_0xcd35('0x30')][_0xcd35('0x42')]){_0x3d10d2[_0xcd35('0x43')]=[{'all':!![]}];}_0x3d10d2=_[_0xcd35('0x44')]({},_0x3d10d2,_0xd4a7d4[_0xcd35('0x3e')]);return db['FreshsalesConfiguration'][_0xcd35('0x45')](_0x3d10d2)['then'](handleEntityNotFound(_0x4af686,null))[_0xcd35('0x25')](respondWithResult(_0x4af686,null))[_0xcd35('0x46')](handleError(_0x4af686,null));};exports['create']=function(_0x44565e,_0x39c854){return db['FreshsalesConfiguration']['create'](_0x44565e[_0xcd35('0x47')],{})[_0xcd35('0x25')](respondWithResult(_0x39c854,0xc9))[_0xcd35('0x46')](handleError(_0x39c854,null));};exports[_0xcd35('0x24')]=function(_0x1238eb,_0x29ba53){if(_0x1238eb['body']['id']){delete _0x1238eb[_0xcd35('0x47')]['id'];}return db[_0xcd35('0x3f')][_0xcd35('0x45')]({'where':{'id':_0x1238eb['params']['id']}})['then'](handleEntityNotFound(_0x29ba53,null))[_0xcd35('0x25')](saveUpdates(_0x1238eb[_0xcd35('0x47')],null))[_0xcd35('0x25')](respondWithResult(_0x29ba53,null))[_0xcd35('0x46')](handleError(_0x29ba53,null));};exports[_0xcd35('0x26')]=function(_0x3e80d1,_0x1fc0a6){return db[_0xcd35('0x3f')][_0xcd35('0x45')]({'where':{'id':_0x3e80d1[_0xcd35('0x41')]['id']}})['then'](handleEntityNotFound(_0x1fc0a6,null))[_0xcd35('0x25')](removeEntity(_0x1fc0a6,null))[_0xcd35('0x46')](handleError(_0x1fc0a6,null));};exports['getSubjects']=function(_0x230092,_0x4c09ce,_0x1379f1){var _0x46c586={};var _0x4bc6cf={};var _0x38303b;var _0x4e14d9;return db[_0xcd35('0x3f')]['findOne']({'where':{'id':_0x230092[_0xcd35('0x41')]['id']}})[_0xcd35('0x25')](handleEntityNotFound(_0x4c09ce,null))[_0xcd35('0x25')](function(_0x12d8cb){if(_0x12d8cb){_0x38303b=_0x12d8cb;_0x4bc6cf[_0xcd35('0x2e')]=_[_0xcd35('0x31')](db[_0xcd35('0x48')][_0xcd35('0x2b')]);_0x4bc6cf['query']=_[_0xcd35('0x31')](_0x230092[_0xcd35('0x30')]);_0x4bc6cf[_0xcd35('0x32')]=_[_0xcd35('0x33')](_0x4bc6cf[_0xcd35('0x2e')],_0x4bc6cf['query']);_0x46c586[_0xcd35('0x34')]=_['intersection'](_0x4bc6cf[_0xcd35('0x2e')],qs[_0xcd35('0x35')](_0x230092[_0xcd35('0x30')][_0xcd35('0x35')]));_0x46c586[_0xcd35('0x34')]=_0x46c586[_0xcd35('0x34')]['length']?_0x46c586[_0xcd35('0x34')]:_0x4bc6cf[_0xcd35('0x2e')];_0x46c586[_0xcd35('0x39')]=qs[_0xcd35('0x3a')](_0x230092[_0xcd35('0x30')]['sort']);_0x46c586[_0xcd35('0x3b')]=qs[_0xcd35('0x32')](_[_0xcd35('0x3c')](_0x230092['query'],_0x4bc6cf[_0xcd35('0x32')]));if(_0x230092[_0xcd35('0x30')][_0xcd35('0x3d')]){_0x46c586[_0xcd35('0x3b')]=_['merge'](_0x46c586[_0xcd35('0x3b')],{'$or':_[_0xcd35('0x2f')](_0x46c586[_0xcd35('0x34')],function(_0x1d63d6){var _0x3d92e8={};_0x3d92e8[_0x1d63d6]={'$like':'%'+_0x230092[_0xcd35('0x30')][_0xcd35('0x3d')]+'%'};return _0x3d92e8;})});}_0x46c586=_['merge']({},_0x46c586,_0x230092[_0xcd35('0x3e')]);return _0x38303b[_0xcd35('0x49')](_0x46c586);}})[_0xcd35('0x25')](function(_0x48e6d8){if(_0x48e6d8){_0x4e14d9=_0x48e6d8['length'];if(!_0x230092[_0xcd35('0x30')][_0xcd35('0x37')](_0xcd35('0x38'))){_0x46c586['limit']=qs[_0xcd35('0x20')](_0x230092[_0xcd35('0x30')][_0xcd35('0x20')]);_0x46c586[_0xcd35('0x1e')]=qs[_0xcd35('0x1e')](_0x230092[_0xcd35('0x30')][_0xcd35('0x1e')]);}return _0x38303b[_0xcd35('0x49')](_0x46c586);}})['then'](function(_0x37d86f){if(_0x37d86f){return _0x37d86f?{'count':_0x4e14d9,'rows':_0x37d86f}:null;}})[_0xcd35('0x25')](respondWithResult(_0x4c09ce,null))[_0xcd35('0x46')](handleError(_0x4c09ce,null));};exports[_0xcd35('0x4a')]=function(_0x342084,_0x34e04e,_0x233b89){var _0x20cff8={};var _0x335453={};var _0x557a10;var _0x8af460;return db[_0xcd35('0x3f')]['findOne']({'where':{'id':_0x342084[_0xcd35('0x41')]['id']}})[_0xcd35('0x25')](handleEntityNotFound(_0x34e04e,null))[_0xcd35('0x25')](function(_0x397ba5){if(_0x397ba5){_0x557a10=_0x397ba5;_0x335453['model']=_[_0xcd35('0x31')](db[_0xcd35('0x48')]['rawAttributes']);_0x335453[_0xcd35('0x30')]=_['keys'](_0x342084[_0xcd35('0x30')]);_0x335453[_0xcd35('0x32')]=_[_0xcd35('0x33')](_0x335453[_0xcd35('0x2e')],_0x335453['query']);_0x20cff8[_0xcd35('0x34')]=_[_0xcd35('0x33')](_0x335453[_0xcd35('0x2e')],qs[_0xcd35('0x35')](_0x342084[_0xcd35('0x30')][_0xcd35('0x35')]));_0x20cff8['attributes']=_0x20cff8['attributes'][_0xcd35('0x36')]?_0x20cff8['attributes']:_0x335453[_0xcd35('0x2e')];_0x20cff8['order']=qs[_0xcd35('0x3a')](_0x342084[_0xcd35('0x30')][_0xcd35('0x3a')]);_0x20cff8[_0xcd35('0x3b')]=qs[_0xcd35('0x32')](_[_0xcd35('0x3c')](_0x342084[_0xcd35('0x30')],_0x335453[_0xcd35('0x32')]));if(_0x342084[_0xcd35('0x30')][_0xcd35('0x3d')]){_0x20cff8[_0xcd35('0x3b')]=_['merge'](_0x20cff8['where'],{'$or':_[_0xcd35('0x2f')](_0x20cff8[_0xcd35('0x34')],function(_0x537f1d){var _0xa6a977={};_0xa6a977[_0x537f1d]={'$like':'%'+_0x342084[_0xcd35('0x30')][_0xcd35('0x3d')]+'%'};return _0xa6a977;})});}_0x20cff8=_['merge']({},_0x20cff8,_0x342084[_0xcd35('0x3e')]);return _0x557a10[_0xcd35('0x4a')](_0x20cff8);}})['then'](function(_0x142414){if(_0x142414){_0x8af460=_0x142414[_0xcd35('0x36')];if(!_0x342084[_0xcd35('0x30')][_0xcd35('0x37')](_0xcd35('0x38'))){_0x20cff8['limit']=qs[_0xcd35('0x20')](_0x342084[_0xcd35('0x30')][_0xcd35('0x20')]);_0x20cff8['offset']=qs[_0xcd35('0x1e')](_0x342084['query']['offset']);}return _0x557a10[_0xcd35('0x4a')](_0x20cff8);}})[_0xcd35('0x25')](function(_0x1d53dc){if(_0x1d53dc){return _0x1d53dc?{'count':_0x8af460,'rows':_0x1d53dc}:null;}})['then'](respondWithResult(_0x34e04e,null))['catch'](handleError(_0x34e04e,null));};exports[_0xcd35('0x4b')]=function(_0x54cb4c,_0x405f70,_0x4eb42c){var _0x2be19f={};var _0x284bb7={};var _0x149a47;var _0x196075;return db[_0xcd35('0x3f')][_0xcd35('0x4c')]({'where':{'id':_0x54cb4c[_0xcd35('0x41')]['id']}})['then'](handleEntityNotFound(_0x405f70,null))[_0xcd35('0x25')](function(_0x3f036d){if(_0x3f036d){_0x149a47=_0x3f036d;_0x284bb7[_0xcd35('0x2e')]=_['keys'](db['FreshsalesField'][_0xcd35('0x2b')]);_0x284bb7[_0xcd35('0x30')]=_['keys'](_0x54cb4c['query']);_0x284bb7['filters']=_['intersection'](_0x284bb7[_0xcd35('0x2e')],_0x284bb7[_0xcd35('0x30')]);_0x2be19f['attributes']=_['intersection'](_0x284bb7['model'],qs[_0xcd35('0x35')](_0x54cb4c['query']['fields']));_0x2be19f[_0xcd35('0x34')]=_0x2be19f[_0xcd35('0x34')]['length']?_0x2be19f[_0xcd35('0x34')]:_0x284bb7[_0xcd35('0x2e')];_0x2be19f[_0xcd35('0x39')]=qs[_0xcd35('0x3a')](_0x54cb4c[_0xcd35('0x30')]['sort']);_0x2be19f[_0xcd35('0x3b')]=qs['filters'](_[_0xcd35('0x3c')](_0x54cb4c[_0xcd35('0x30')],_0x284bb7['filters']));if(_0x54cb4c['query'][_0xcd35('0x3d')]){_0x2be19f[_0xcd35('0x3b')]=_[_0xcd35('0x44')](_0x2be19f[_0xcd35('0x3b')],{'$or':_[_0xcd35('0x2f')](_0x2be19f['attributes'],function(_0x21eef5){var _0x426bac={};_0x426bac[_0x21eef5]={'$like':'%'+_0x54cb4c['query']['filter']+'%'};return _0x426bac;})});}_0x2be19f=_['merge']({},_0x2be19f,_0x54cb4c[_0xcd35('0x3e')]);return _0x149a47['getFields'](_0x2be19f);}})[_0xcd35('0x25')](function(_0x15eb89){if(_0x15eb89){_0x196075=_0x15eb89[_0xcd35('0x36')];if(!_0x54cb4c[_0xcd35('0x30')]['hasOwnProperty'](_0xcd35('0x38'))){_0x2be19f[_0xcd35('0x20')]=qs[_0xcd35('0x20')](_0x54cb4c[_0xcd35('0x30')][_0xcd35('0x20')]);_0x2be19f[_0xcd35('0x1e')]=qs[_0xcd35('0x1e')](_0x54cb4c[_0xcd35('0x30')]['offset']);}return _0x149a47[_0xcd35('0x4b')](_0x2be19f);}})['then'](function(_0x5c9e0a){if(_0x5c9e0a){return _0x5c9e0a?{'count':_0x196075,'rows':_0x5c9e0a}:null;}})[_0xcd35('0x25')](respondWithResult(_0x405f70,null))['catch'](handleError(_0x405f70,null));}; \ No newline at end of file +var _0xd647=['desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','body','getSubjects','findOne','FreshsalesField','sort','pick','getFields','nolimit','eml-format','rimraf','request-promise','bluebird','path','ejs','squel','crypto'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0xd647,0x8c));var _0x7d64=function(_0x31147e,_0x2ff5b9){_0x31147e=_0x31147e-0x0;var _0x395bf8=_0xd647[_0x31147e];return _0x395bf8;};'use strict';var emlformat=require(_0x7d64('0x0'));var rimraf=require(_0x7d64('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7d64('0x2'));var moment=require('moment');var BPromise=require(_0x7d64('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7d64('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7d64('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7d64('0x6'));var crypto=require(_0x7d64('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x7d64('0x8'));var toCsv=require('to-csv');var querystring=require(_0x7d64('0x9'));var Papa=require('papaparse');var Redis=require(_0x7d64('0xa'));var authService=require(_0x7d64('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d64('0xc'));var logger=require(_0x7d64('0xd'))(_0x7d64('0xe'));var utils=require(_0x7d64('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0x7d64('0x10'));var db=require(_0x7d64('0x11'))['db'];function respondWithStatusCode(_0x168ba0,_0x37ea5b){_0x37ea5b=_0x37ea5b||0xcc;return function(_0x4ec46a){if(_0x4ec46a){return _0x168ba0['sendStatus'](_0x37ea5b);}return _0x168ba0[_0x7d64('0x12')](_0x37ea5b)['end']();};}function respondWithResult(_0xdbae6d,_0x3262f3){_0x3262f3=_0x3262f3||0xc8;return function(_0x386891){if(_0x386891){return _0xdbae6d[_0x7d64('0x12')](_0x3262f3)[_0x7d64('0x13')](_0x386891);}};}function respondWithFilteredResult(_0x2dadd7,_0x30e9a9){return function(_0x2d43a8){if(_0x2d43a8){var _0x3d0ff1=typeof _0x30e9a9[_0x7d64('0x14')]===_0x7d64('0x15')&&typeof _0x30e9a9[_0x7d64('0x16')]===_0x7d64('0x15');var _0x1d2eeb=_0x2d43a8[_0x7d64('0x17')];var _0x10c6f9=_0x3d0ff1?0x0:_0x30e9a9['offset'];var _0x3cc2eb=_0x3d0ff1?_0x2d43a8[_0x7d64('0x17')]:_0x30e9a9[_0x7d64('0x14')]+_0x30e9a9[_0x7d64('0x16')];var _0x5a8492;if(_0x3cc2eb>=_0x1d2eeb){_0x3cc2eb=_0x1d2eeb;_0x5a8492=0xc8;}else{_0x5a8492=0xce;}_0x2dadd7[_0x7d64('0x12')](_0x5a8492);return _0x2dadd7[_0x7d64('0x18')](_0x7d64('0x19'),_0x10c6f9+'-'+_0x3cc2eb+'/'+_0x1d2eeb)['json'](_0x2d43a8);}return null;};}function patchUpdates(_0x456f44){return function(_0x5dafab){try{jsonpatch[_0x7d64('0x1a')](_0x5dafab,_0x456f44,!![]);}catch(_0x56e836){return BPromise[_0x7d64('0x1b')](_0x56e836);}return _0x5dafab[_0x7d64('0x1c')]();};}function saveUpdates(_0x5e14dd,_0x4cc571){return function(_0x5b5c4c){if(_0x5b5c4c){return _0x5b5c4c[_0x7d64('0x1d')](_0x5e14dd)[_0x7d64('0x1e')](function(_0x1bd897){return _0x1bd897;});}return null;};}function removeEntity(_0x275822,_0x3edb8e){return function(_0x57c1ff){if(_0x57c1ff){return _0x57c1ff[_0x7d64('0x1f')]()[_0x7d64('0x1e')](function(){_0x275822[_0x7d64('0x12')](0xcc)[_0x7d64('0x20')]();});}};}function handleEntityNotFound(_0x36680a,_0x2e2a68){return function(_0x2bfca3){if(!_0x2bfca3){_0x36680a[_0x7d64('0x21')](0x194);}return _0x2bfca3;};}function handleError(_0xed0ec3,_0x4b99d4){_0x4b99d4=_0x4b99d4||0x1f4;return function(_0x416898){logger[_0x7d64('0x22')](_0x416898[_0x7d64('0x23')]);if(_0x416898[_0x7d64('0x24')]){delete _0x416898['name'];}_0xed0ec3[_0x7d64('0x12')](_0x4b99d4)[_0x7d64('0x25')](_0x416898);};}exports[_0x7d64('0x26')]=function(_0x375dac,_0x56a606){var _0x4b867f={},_0x3e491d={},_0x1c768c={'count':0x0,'rows':[]};var _0x4bb823=_[_0x7d64('0x27')](db[_0x7d64('0x28')][_0x7d64('0x29')],function(_0x11c970){return{'name':_0x11c970[_0x7d64('0x2a')],'type':_0x11c970[_0x7d64('0x2b')][_0x7d64('0x2c')]};});_0x3e491d[_0x7d64('0x2d')]=_[_0x7d64('0x27')](_0x4bb823,_0x7d64('0x24'));_0x3e491d['query']=_['keys'](_0x375dac['query']);_0x3e491d['filters']=_[_0x7d64('0x2e')](_0x3e491d['model'],_0x3e491d[_0x7d64('0x2f')]);_0x4b867f[_0x7d64('0x30')]=_['intersection'](_0x3e491d[_0x7d64('0x2d')],qs['fields'](_0x375dac[_0x7d64('0x2f')][_0x7d64('0x31')]));_0x4b867f[_0x7d64('0x30')]=_0x4b867f[_0x7d64('0x30')][_0x7d64('0x32')]?_0x4b867f['attributes']:_0x3e491d[_0x7d64('0x2d')];if(!_0x375dac[_0x7d64('0x2f')][_0x7d64('0x33')]('nolimit')){_0x4b867f[_0x7d64('0x16')]=qs[_0x7d64('0x16')](_0x375dac[_0x7d64('0x2f')]['limit']);_0x4b867f[_0x7d64('0x14')]=qs[_0x7d64('0x14')](_0x375dac[_0x7d64('0x2f')][_0x7d64('0x14')]);}_0x4b867f[_0x7d64('0x34')]=qs['sort'](_0x375dac[_0x7d64('0x2f')]['sort']);_0x4b867f[_0x7d64('0x35')]=qs['filters'](_['pick'](_0x375dac[_0x7d64('0x2f')],_0x3e491d[_0x7d64('0x36')]),_0x4bb823);if(_0x375dac[_0x7d64('0x2f')][_0x7d64('0x37')]){_0x4b867f[_0x7d64('0x35')]=_[_0x7d64('0x38')](_0x4b867f['where'],{'$or':_[_0x7d64('0x27')](_0x4bb823,function(_0x58eb06){if(_0x58eb06[_0x7d64('0x2b')]!==_0x7d64('0x39')){var _0x45f0ff={};_0x45f0ff[_0x58eb06[_0x7d64('0x24')]]={'$like':'%'+_0x375dac[_0x7d64('0x2f')][_0x7d64('0x37')]+'%'};return _0x45f0ff;}})});}_0x4b867f=_[_0x7d64('0x38')]({},_0x4b867f,_0x375dac[_0x7d64('0x3a')]);var _0x5e6579={'where':_0x4b867f[_0x7d64('0x35')]};return db['FreshsalesConfiguration'][_0x7d64('0x17')](_0x5e6579)[_0x7d64('0x1e')](function(_0x1a04de){_0x1c768c[_0x7d64('0x17')]=_0x1a04de;if(_0x375dac[_0x7d64('0x2f')][_0x7d64('0x3b')]){_0x4b867f[_0x7d64('0x3c')]=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x4b867f);})[_0x7d64('0x1e')](function(_0x384c74){_0x1c768c[_0x7d64('0x3d')]=_0x384c74;return _0x1c768c;})[_0x7d64('0x1e')](respondWithFilteredResult(_0x56a606,_0x4b867f))[_0x7d64('0x3e')](handleError(_0x56a606,null));};exports['show']=function(_0x3aa1b3,_0xcc8837){var _0x54bd76={'raw':![],'where':{'id':_0x3aa1b3[_0x7d64('0x3f')]['id']}},_0x5e9e1e={};_0x5e9e1e[_0x7d64('0x2d')]=_[_0x7d64('0x40')](db[_0x7d64('0x28')]['rawAttributes']);_0x5e9e1e[_0x7d64('0x2f')]=_[_0x7d64('0x40')](_0x3aa1b3['query']);_0x5e9e1e[_0x7d64('0x36')]=_[_0x7d64('0x2e')](_0x5e9e1e['model'],_0x5e9e1e[_0x7d64('0x2f')]);_0x54bd76['attributes']=_['intersection'](_0x5e9e1e['model'],qs[_0x7d64('0x31')](_0x3aa1b3['query'][_0x7d64('0x31')]));_0x54bd76[_0x7d64('0x30')]=_0x54bd76[_0x7d64('0x30')][_0x7d64('0x32')]?_0x54bd76[_0x7d64('0x30')]:_0x5e9e1e['model'];if(_0x3aa1b3['query'][_0x7d64('0x3b')]){_0x54bd76[_0x7d64('0x3c')]=[{'all':!![]}];}_0x54bd76=_[_0x7d64('0x38')]({},_0x54bd76,_0x3aa1b3[_0x7d64('0x3a')]);return db[_0x7d64('0x28')][_0x7d64('0x41')](_0x54bd76)['then'](handleEntityNotFound(_0xcc8837,null))[_0x7d64('0x1e')](respondWithResult(_0xcc8837,null))[_0x7d64('0x3e')](handleError(_0xcc8837,null));};exports['create']=function(_0x288e7b,_0x3a7a50){return db[_0x7d64('0x28')]['create'](_0x288e7b[_0x7d64('0x42')],{})['then'](respondWithResult(_0x3a7a50,0xc9))['catch'](handleError(_0x3a7a50,null));};exports['update']=function(_0x3a0acc,_0x1ae64f){if(_0x3a0acc[_0x7d64('0x42')]['id']){delete _0x3a0acc['body']['id'];}return db[_0x7d64('0x28')][_0x7d64('0x41')]({'where':{'id':_0x3a0acc[_0x7d64('0x3f')]['id']}})[_0x7d64('0x1e')](handleEntityNotFound(_0x1ae64f,null))['then'](saveUpdates(_0x3a0acc[_0x7d64('0x42')],null))['then'](respondWithResult(_0x1ae64f,null))[_0x7d64('0x3e')](handleError(_0x1ae64f,null));};exports[_0x7d64('0x1f')]=function(_0x4fa1ef,_0x467d28){return db[_0x7d64('0x28')][_0x7d64('0x41')]({'where':{'id':_0x4fa1ef[_0x7d64('0x3f')]['id']}})[_0x7d64('0x1e')](handleEntityNotFound(_0x467d28,null))[_0x7d64('0x1e')](removeEntity(_0x467d28,null))[_0x7d64('0x3e')](handleError(_0x467d28,null));};exports[_0x7d64('0x43')]=function(_0x4303fb,_0x17248e,_0x5ec6bb){var _0x2e5b5f={};var _0x3b0cb8={};var _0x4a3d31;var _0xd1637b;return db[_0x7d64('0x28')][_0x7d64('0x44')]({'where':{'id':_0x4303fb['params']['id']}})[_0x7d64('0x1e')](handleEntityNotFound(_0x17248e,null))[_0x7d64('0x1e')](function(_0x161087){if(_0x161087){_0x4a3d31=_0x161087;_0x3b0cb8['model']=_[_0x7d64('0x40')](db[_0x7d64('0x45')][_0x7d64('0x29')]);_0x3b0cb8[_0x7d64('0x2f')]=_[_0x7d64('0x40')](_0x4303fb[_0x7d64('0x2f')]);_0x3b0cb8[_0x7d64('0x36')]=_[_0x7d64('0x2e')](_0x3b0cb8[_0x7d64('0x2d')],_0x3b0cb8[_0x7d64('0x2f')]);_0x2e5b5f[_0x7d64('0x30')]=_[_0x7d64('0x2e')](_0x3b0cb8[_0x7d64('0x2d')],qs[_0x7d64('0x31')](_0x4303fb[_0x7d64('0x2f')][_0x7d64('0x31')]));_0x2e5b5f[_0x7d64('0x30')]=_0x2e5b5f['attributes'][_0x7d64('0x32')]?_0x2e5b5f[_0x7d64('0x30')]:_0x3b0cb8['model'];_0x2e5b5f['order']=qs[_0x7d64('0x46')](_0x4303fb['query'][_0x7d64('0x46')]);_0x2e5b5f[_0x7d64('0x35')]=qs['filters'](_[_0x7d64('0x47')](_0x4303fb['query'],_0x3b0cb8[_0x7d64('0x36')]));if(_0x4303fb[_0x7d64('0x2f')][_0x7d64('0x37')]){_0x2e5b5f[_0x7d64('0x35')]=_['merge'](_0x2e5b5f[_0x7d64('0x35')],{'$or':_[_0x7d64('0x27')](_0x2e5b5f[_0x7d64('0x30')],function(_0x2ca5b5){var _0x16dbd9={};_0x16dbd9[_0x2ca5b5]={'$like':'%'+_0x4303fb['query'][_0x7d64('0x37')]+'%'};return _0x16dbd9;})});}_0x2e5b5f=_[_0x7d64('0x38')]({},_0x2e5b5f,_0x4303fb[_0x7d64('0x3a')]);return _0x4a3d31[_0x7d64('0x43')](_0x2e5b5f);}})[_0x7d64('0x1e')](function(_0x34a545){if(_0x34a545){_0xd1637b=_0x34a545[_0x7d64('0x32')];if(!_0x4303fb[_0x7d64('0x2f')][_0x7d64('0x33')]('nolimit')){_0x2e5b5f[_0x7d64('0x16')]=qs[_0x7d64('0x16')](_0x4303fb[_0x7d64('0x2f')][_0x7d64('0x16')]);_0x2e5b5f['offset']=qs[_0x7d64('0x14')](_0x4303fb[_0x7d64('0x2f')][_0x7d64('0x14')]);}return _0x4a3d31['getSubjects'](_0x2e5b5f);}})[_0x7d64('0x1e')](function(_0x2d4d88){if(_0x2d4d88){return _0x2d4d88?{'count':_0xd1637b,'rows':_0x2d4d88}:null;}})[_0x7d64('0x1e')](respondWithResult(_0x17248e,null))[_0x7d64('0x3e')](handleError(_0x17248e,null));};exports['getDescriptions']=function(_0x5496a4,_0x1c242d,_0xe47bce){var _0x1560e2={};var _0x56695a={};var _0x299bc7;var _0x10380b;return db[_0x7d64('0x28')][_0x7d64('0x44')]({'where':{'id':_0x5496a4[_0x7d64('0x3f')]['id']}})[_0x7d64('0x1e')](handleEntityNotFound(_0x1c242d,null))[_0x7d64('0x1e')](function(_0x172ae8){if(_0x172ae8){_0x299bc7=_0x172ae8;_0x56695a[_0x7d64('0x2d')]=_['keys'](db[_0x7d64('0x45')][_0x7d64('0x29')]);_0x56695a[_0x7d64('0x2f')]=_[_0x7d64('0x40')](_0x5496a4['query']);_0x56695a[_0x7d64('0x36')]=_[_0x7d64('0x2e')](_0x56695a[_0x7d64('0x2d')],_0x56695a[_0x7d64('0x2f')]);_0x1560e2[_0x7d64('0x30')]=_[_0x7d64('0x2e')](_0x56695a[_0x7d64('0x2d')],qs[_0x7d64('0x31')](_0x5496a4[_0x7d64('0x2f')]['fields']));_0x1560e2[_0x7d64('0x30')]=_0x1560e2[_0x7d64('0x30')]['length']?_0x1560e2[_0x7d64('0x30')]:_0x56695a[_0x7d64('0x2d')];_0x1560e2[_0x7d64('0x34')]=qs[_0x7d64('0x46')](_0x5496a4[_0x7d64('0x2f')][_0x7d64('0x46')]);_0x1560e2[_0x7d64('0x35')]=qs['filters'](_['pick'](_0x5496a4[_0x7d64('0x2f')],_0x56695a[_0x7d64('0x36')]));if(_0x5496a4['query'][_0x7d64('0x37')]){_0x1560e2['where']=_[_0x7d64('0x38')](_0x1560e2[_0x7d64('0x35')],{'$or':_[_0x7d64('0x27')](_0x1560e2[_0x7d64('0x30')],function(_0xb9f3c4){var _0x386b28={};_0x386b28[_0xb9f3c4]={'$like':'%'+_0x5496a4[_0x7d64('0x2f')][_0x7d64('0x37')]+'%'};return _0x386b28;})});}_0x1560e2=_[_0x7d64('0x38')]({},_0x1560e2,_0x5496a4[_0x7d64('0x3a')]);return _0x299bc7['getDescriptions'](_0x1560e2);}})['then'](function(_0x4490fa){if(_0x4490fa){_0x10380b=_0x4490fa[_0x7d64('0x32')];if(!_0x5496a4[_0x7d64('0x2f')][_0x7d64('0x33')]('nolimit')){_0x1560e2[_0x7d64('0x16')]=qs[_0x7d64('0x16')](_0x5496a4[_0x7d64('0x2f')][_0x7d64('0x16')]);_0x1560e2[_0x7d64('0x14')]=qs[_0x7d64('0x14')](_0x5496a4[_0x7d64('0x2f')][_0x7d64('0x14')]);}return _0x299bc7['getDescriptions'](_0x1560e2);}})[_0x7d64('0x1e')](function(_0x4aa8d9){if(_0x4aa8d9){return _0x4aa8d9?{'count':_0x10380b,'rows':_0x4aa8d9}:null;}})[_0x7d64('0x1e')](respondWithResult(_0x1c242d,null))['catch'](handleError(_0x1c242d,null));};exports[_0x7d64('0x48')]=function(_0x242ed1,_0x45ff93,_0x485ced){var _0x68abeb={};var _0x3d8a80={};var _0x4258c1;var _0x494b04;return db[_0x7d64('0x28')][_0x7d64('0x44')]({'where':{'id':_0x242ed1[_0x7d64('0x3f')]['id']}})[_0x7d64('0x1e')](handleEntityNotFound(_0x45ff93,null))[_0x7d64('0x1e')](function(_0x1fa25d){if(_0x1fa25d){_0x4258c1=_0x1fa25d;_0x3d8a80[_0x7d64('0x2d')]=_['keys'](db[_0x7d64('0x45')][_0x7d64('0x29')]);_0x3d8a80[_0x7d64('0x2f')]=_[_0x7d64('0x40')](_0x242ed1['query']);_0x3d8a80[_0x7d64('0x36')]=_[_0x7d64('0x2e')](_0x3d8a80['model'],_0x3d8a80[_0x7d64('0x2f')]);_0x68abeb['attributes']=_['intersection'](_0x3d8a80[_0x7d64('0x2d')],qs[_0x7d64('0x31')](_0x242ed1[_0x7d64('0x2f')]['fields']));_0x68abeb[_0x7d64('0x30')]=_0x68abeb[_0x7d64('0x30')][_0x7d64('0x32')]?_0x68abeb[_0x7d64('0x30')]:_0x3d8a80[_0x7d64('0x2d')];_0x68abeb[_0x7d64('0x34')]=qs[_0x7d64('0x46')](_0x242ed1[_0x7d64('0x2f')]['sort']);_0x68abeb['where']=qs[_0x7d64('0x36')](_[_0x7d64('0x47')](_0x242ed1[_0x7d64('0x2f')],_0x3d8a80[_0x7d64('0x36')]));if(_0x242ed1['query'][_0x7d64('0x37')]){_0x68abeb[_0x7d64('0x35')]=_[_0x7d64('0x38')](_0x68abeb[_0x7d64('0x35')],{'$or':_[_0x7d64('0x27')](_0x68abeb['attributes'],function(_0x1040fe){var _0x5d8e16={};_0x5d8e16[_0x1040fe]={'$like':'%'+_0x242ed1[_0x7d64('0x2f')][_0x7d64('0x37')]+'%'};return _0x5d8e16;})});}_0x68abeb=_['merge']({},_0x68abeb,_0x242ed1['options']);return _0x4258c1['getFields'](_0x68abeb);}})[_0x7d64('0x1e')](function(_0x5548b6){if(_0x5548b6){_0x494b04=_0x5548b6[_0x7d64('0x32')];if(!_0x242ed1[_0x7d64('0x2f')][_0x7d64('0x33')](_0x7d64('0x49'))){_0x68abeb[_0x7d64('0x16')]=qs[_0x7d64('0x16')](_0x242ed1[_0x7d64('0x2f')][_0x7d64('0x16')]);_0x68abeb['offset']=qs[_0x7d64('0x14')](_0x242ed1[_0x7d64('0x2f')][_0x7d64('0x14')]);}return _0x4258c1['getFields'](_0x68abeb);}})[_0x7d64('0x1e')](function(_0x1a0adb){if(_0x1a0adb){return _0x1a0adb?{'count':_0x494b04,'rows':_0x1a0adb}:null;}})['then'](respondWithResult(_0x45ff93,null))[_0x7d64('0x3e')](handleError(_0x45ff93,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 9732bb7..3944993 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 _0x2b99=['int_freshsales_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','define','FreshsalesConfiguration'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0x2b99,0x18d));var _0x92b9=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x2b99[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x92b9('0x0'));var util=require(_0x92b9('0x1'));var logger=require(_0x92b9('0x2'))('api');var moment=require(_0x92b9('0x3'));var BPromise=require(_0x92b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92b9('0x5'));var rimraf=require(_0x92b9('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x92b9('0x7')]=function(_0xec7730,_0x63b25d){return _0xec7730[_0x92b9('0x8')](_0x92b9('0x9'),attributes,{'tableName':_0x92b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa12c=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa12c,0x9d));var _0xca12=function(_0x329f42,_0x2de7e7){_0x329f42=_0x329f42-0x0;var _0x3618f0=_0xa12c[_0x329f42];return _0x3618f0;};'use strict';var _=require(_0xca12('0x0'));var util=require(_0xca12('0x1'));var logger=require(_0xca12('0x2'))(_0xca12('0x3'));var moment=require(_0xca12('0x4'));var BPromise=require(_0xca12('0x5'));var rp=require(_0xca12('0x6'));var fs=require('fs');var path=require(_0xca12('0x7'));var rimraf=require(_0xca12('0x8'));var config=require(_0xca12('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xca12('0xa')]=function(_0x441fa0,_0x3b2549){return _0x441fa0['define']('FreshsalesConfiguration',attributes,{'tableName':_0xca12('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index ef88d1f..eebc33b 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 _0xe8ee=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment'];(function(_0x2277a1,_0x23ac17){var _0x19a480=function(_0xe2dcb0){while(--_0xe2dcb0){_0x2277a1['push'](_0x2277a1['shift']());}};_0x19a480(++_0x23ac17);}(_0xe8ee,0x174));var _0xee8e=function(_0x222bd3,_0x4c9a4f){_0x222bd3=_0x222bd3-0x0;var _0x4bed46=_0xe8ee[_0x222bd3];return _0x4bed46;};'use strict';var _=require(_0xee8e('0x0'));var util=require('util');var moment=require(_0xee8e('0x1'));var BPromise=require(_0xee8e('0x2'));var rs=require(_0xee8e('0x3'));var fs=require('fs');var Redis=require(_0xee8e('0x4'));var db=require(_0xee8e('0x5'))['db'];var utils=require(_0xee8e('0x6'));var logger=require(_0xee8e('0x7'))(_0xee8e('0x8'));var config=require('../../config/environment');var jayson=require(_0xee8e('0x9'));var client=jayson[_0xee8e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x441063,_0x593bc1,_0x4566eb){return new BPromise(function(_0x4e67e1,_0x3047d9){return client[_0xee8e('0xb')](_0x441063,_0x4566eb)['then'](function(_0x1317ab){logger['info'](_0xee8e('0xc'),_0x593bc1,_0xee8e('0xd'));logger[_0xee8e('0xe')](_0xee8e('0xf'),_0x593bc1,'request\x20sent',JSON[_0xee8e('0x10')](_0x1317ab));if(_0x1317ab['error']){if(_0x1317ab[_0xee8e('0x11')][_0xee8e('0x12')]===0x1f4){logger[_0xee8e('0x11')](_0xee8e('0xc'),_0x593bc1,_0x1317ab['error'][_0xee8e('0x13')]);return _0x3047d9(_0x1317ab[_0xee8e('0x11')][_0xee8e('0x13')]);}logger['error'](_0xee8e('0xc'),_0x593bc1,_0x1317ab[_0xee8e('0x11')]['message']);return _0x4e67e1(_0x1317ab[_0xee8e('0x11')][_0xee8e('0x13')]);}else{logger[_0xee8e('0x14')](_0xee8e('0xc'),_0x593bc1,'request\x20sent');_0x4e67e1(_0x1317ab[_0xee8e('0x15')][_0xee8e('0x13')]);}})['catch'](function(_0x415133){logger['error'](_0xee8e('0xc'),_0x593bc1,_0x415133);_0x3047d9(_0x415133);});});} \ No newline at end of file +var _0xe77f=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0xe77f,0x123));var _0xfe77=function(_0x52cbdd,_0x46bac8){_0x52cbdd=_0x52cbdd-0x0;var _0x1ebe67=_0xe77f[_0x52cbdd];return _0x1ebe67;};'use strict';var _=require(_0xfe77('0x0'));var util=require(_0xfe77('0x1'));var moment=require(_0xfe77('0x2'));var BPromise=require(_0xfe77('0x3'));var rs=require(_0xfe77('0x4'));var fs=require('fs');var Redis=require(_0xfe77('0x5'));var db=require(_0xfe77('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe77('0x7'))(_0xfe77('0x8'));var config=require('../../config/environment');var jayson=require(_0xfe77('0x9'));var client=jayson[_0xfe77('0xa')][_0xfe77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d3061,_0x511ed1,_0x4af97f){return new BPromise(function(_0x2bb66f,_0x2222ff){return client['request'](_0x2d3061,_0x4af97f)[_0xfe77('0xc')](function(_0x505ea3){logger[_0xfe77('0xd')](_0xfe77('0xe'),_0x511ed1,_0xfe77('0xf'));logger[_0xfe77('0x10')](_0xfe77('0x11'),_0x511ed1,_0xfe77('0xf'),JSON[_0xfe77('0x12')](_0x505ea3));if(_0x505ea3[_0xfe77('0x13')]){if(_0x505ea3[_0xfe77('0x13')][_0xfe77('0x14')]===0x1f4){logger[_0xfe77('0x13')](_0xfe77('0xe'),_0x511ed1,_0x505ea3[_0xfe77('0x13')][_0xfe77('0x15')]);return _0x2222ff(_0x505ea3[_0xfe77('0x13')][_0xfe77('0x15')]);}logger[_0xfe77('0x13')](_0xfe77('0xe'),_0x511ed1,_0x505ea3[_0xfe77('0x13')]['message']);return _0x2bb66f(_0x505ea3['error']['message']);}else{logger[_0xfe77('0xd')](_0xfe77('0xe'),_0x511ed1,_0xfe77('0xf'));_0x2bb66f(_0x505ea3[_0xfe77('0x16')][_0xfe77('0x15')]);}})[_0xfe77('0x17')](function(_0x1158c3){logger[_0xfe77('0x13')](_0xfe77('0xe'),_0x511ed1,_0x1158c3);_0x2222ff(_0x1158c3);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 172a269..5410d4b 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 _0x2b37=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0x2b37,0x12b));var _0x72b3=function(_0x3b5ccb,_0x3c7d78){_0x3b5ccb=_0x3b5ccb-0x0;var _0x2c6c10=_0x2b37[_0x3b5ccb];return _0x2c6c10;};'use strict';var multer=require(_0x72b3('0x0'));var util=require(_0x72b3('0x1'));var path=require(_0x72b3('0x2'));var timeout=require(_0x72b3('0x3'));var express=require(_0x72b3('0x4'));var router=express[_0x72b3('0x5')]();var fs_extra=require(_0x72b3('0x6'));var auth=require(_0x72b3('0x7'));var interaction=require(_0x72b3('0x8'));var config=require(_0x72b3('0x9'));var controller=require('./intFreshsalesField.controller');router[_0x72b3('0xa')]('/',auth[_0x72b3('0xb')](),controller['index']);router[_0x72b3('0xa')](_0x72b3('0xc'),auth[_0x72b3('0xb')](),controller['show']);router[_0x72b3('0xd')]('/',auth[_0x72b3('0xb')](),controller[_0x72b3('0xe')]);router['put'](_0x72b3('0xc'),auth[_0x72b3('0xb')](),controller[_0x72b3('0xf')]);router[_0x72b3('0x10')](_0x72b3('0xc'),auth[_0x72b3('0xb')](),controller[_0x72b3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8f37=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','post','put','/:id','update','delete','destroy'];(function(_0x55002a,_0x2c78a4){var _0x5044e5=function(_0x4bdadc){while(--_0x4bdadc){_0x55002a['push'](_0x55002a['shift']());}};_0x5044e5(++_0x2c78a4);}(_0x8f37,0x190));var _0x78f3=function(_0x2bf35e,_0x4b7226){_0x2bf35e=_0x2bf35e-0x0;var _0x3b06ae=_0x8f37[_0x2bf35e];return _0x3b06ae;};'use strict';var multer=require(_0x78f3('0x0'));var util=require(_0x78f3('0x1'));var path=require(_0x78f3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x78f3('0x3')]();var fs_extra=require(_0x78f3('0x4'));var auth=require(_0x78f3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x78f3('0x6'));var controller=require('./intFreshsalesField.controller');router[_0x78f3('0x7')]('/',auth['isAuthenticated'](),controller[_0x78f3('0x8')]);router[_0x78f3('0x7')]('/:id',auth[_0x78f3('0x9')](),controller['show']);router[_0x78f3('0xa')]('/',auth[_0x78f3('0x9')](),controller['create']);router[_0x78f3('0xb')](_0x78f3('0xc'),auth[_0x78f3('0x9')](),controller[_0x78f3('0xd')]);router[_0x78f3('0xe')]('/:id',auth[_0x78f3('0x9')](),controller[_0x78f3('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 366a183..fc0f03e 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 _0xd061=['exports','string','variable','customVariable','STRING','sequelize'];(function(_0x570016,_0x111cb9){var _0x3b4176=function(_0x147f5b){while(--_0x147f5b){_0x570016['push'](_0x570016['shift']());}};_0x3b4176(++_0x111cb9);}(_0xd061,0xd1));var _0x1d06=function(_0x3cb2cc,_0x1b03a4){_0x3cb2cc=_0x3cb2cc-0x0;var _0x4db92a=_0xd061[_0x3cb2cc];return _0x4db92a;};'use strict';var Sequelize=require(_0x1d06('0x0'));module[_0x1d06('0x1')]={'type':{'type':Sequelize['ENUM'](_0x1d06('0x2'),_0x1d06('0x3'),_0x1d06('0x4'),'keyValue','picklist'),'defaultValue':_0x1d06('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1d06('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x1d06('0x2'),_0x1d06('0x3'),_0x1d06('0x4'))},'keyContent':{'type':Sequelize[_0x1d06('0x5')]},'idField':{'type':Sequelize[_0x1d06('0x5')]},'nameField':{'type':Sequelize[_0x1d06('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1d06('0x5')]}}; \ No newline at end of file +var _0xaff6=['ENUM','exports','customVariable','keyValue','picklist','string','STRING'];(function(_0x4275d8,_0x89a1b5){var _0x25571b=function(_0x24aac9){while(--_0x24aac9){_0x4275d8['push'](_0x4275d8['shift']());}};_0x25571b(++_0x89a1b5);}(_0xaff6,0x16d));var _0x6aff=function(_0x3c0c9e,_0x3ecdee){_0x3c0c9e=_0x3c0c9e-0x0;var _0x5ba5fe=_0xaff6[_0x3c0c9e];return _0x5ba5fe;};'use strict';var Sequelize=require('sequelize');module[_0x6aff('0x0')]={'type':{'type':Sequelize['ENUM']('string','variable',_0x6aff('0x1'),_0x6aff('0x2'),_0x6aff('0x3')),'defaultValue':_0x6aff('0x4')},'content':{'type':Sequelize[_0x6aff('0x5')]},'key':{'type':Sequelize[_0x6aff('0x5')]},'keyType':{'type':Sequelize[_0x6aff('0x6')](_0x6aff('0x4'),'variable',_0x6aff('0x1'))},'keyContent':{'type':Sequelize[_0x6aff('0x5')]},'idField':{'type':Sequelize[_0x6aff('0x5')]},'nameField':{'type':Sequelize[_0x6aff('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6aff('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 4a1262e..a4c6991 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 _0x52d6=['end','sendStatus','error','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','include','findAll','rows','catch','params','keys','includeAll','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','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','api','../../config/utils','../../config/environment','../../config/license/util','json','offset','undefined','limit','count','set','save','destroy','then'];(function(_0x4613ca,_0x5a118b){var _0xc673ac=function(_0x3e49f4){while(--_0x3e49f4){_0x4613ca['push'](_0x4613ca['shift']());}};_0xc673ac(++_0x5a118b);}(_0x52d6,0x71));var _0x652d=function(_0x450487,_0x5a6f12){_0x450487=_0x450487-0x0;var _0x12ba39=_0x52d6[_0x450487];return _0x12ba39;};'use strict';var emlformat=require(_0x652d('0x0'));var rimraf=require(_0x652d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x652d('0x2'));var rp=require(_0x652d('0x3'));var moment=require(_0x652d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x652d('0x5'));var util=require('util');var path=require(_0x652d('0x6'));var sox=require(_0x652d('0x7'));var csv=require('to-csv');var ejs=require(_0x652d('0x8'));var fs=require('fs');var fs_extra=require(_0x652d('0x9'));var _=require('lodash');var squel=require(_0x652d('0xa'));var crypto=require(_0x652d('0xb'));var jsforce=require(_0x652d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x652d('0xd'));var querystring=require(_0x652d('0xe'));var Papa=require(_0x652d('0xf'));var Redis=require(_0x652d('0x10'));var authService=require(_0x652d('0x11'));var qs=require(_0x652d('0x12'));var as=require(_0x652d('0x13'));var hardwareService=require(_0x652d('0x14'));var logger=require(_0x652d('0x15'))(_0x652d('0x16'));var utils=require(_0x652d('0x17'));var config=require(_0x652d('0x18'));var licenseUtil=require(_0x652d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d849,_0x546fcd){_0x546fcd=_0x546fcd||0xcc;return function(_0x4d8541){if(_0x4d8541){return _0x13d849['sendStatus'](_0x546fcd);}return _0x13d849['status'](_0x546fcd)['end']();};}function respondWithResult(_0x1e8c10,_0x2dbb29){_0x2dbb29=_0x2dbb29||0xc8;return function(_0x4d89f1){if(_0x4d89f1){return _0x1e8c10['status'](_0x2dbb29)[_0x652d('0x1a')](_0x4d89f1);}};}function respondWithFilteredResult(_0x245517,_0x3bc130){return function(_0x312311){if(_0x312311){var _0x381f80=typeof _0x3bc130[_0x652d('0x1b')]===_0x652d('0x1c')&&typeof _0x3bc130[_0x652d('0x1d')]===_0x652d('0x1c');var _0x535060=_0x312311[_0x652d('0x1e')];var _0x14ada1=_0x381f80?0x0:_0x3bc130[_0x652d('0x1b')];var _0x2a38d9=_0x381f80?_0x312311[_0x652d('0x1e')]:_0x3bc130[_0x652d('0x1b')]+_0x3bc130['limit'];var _0x22da5a;if(_0x2a38d9>=_0x535060){_0x2a38d9=_0x535060;_0x22da5a=0xc8;}else{_0x22da5a=0xce;}_0x245517['status'](_0x22da5a);return _0x245517[_0x652d('0x1f')]('Content-Range',_0x14ada1+'-'+_0x2a38d9+'/'+_0x535060)[_0x652d('0x1a')](_0x312311);}return null;};}function patchUpdates(_0x18b024){return function(_0x12ac96){try{jsonpatch['apply'](_0x12ac96,_0x18b024,!![]);}catch(_0x2e47d8){return BPromise['reject'](_0x2e47d8);}return _0x12ac96[_0x652d('0x20')]();};}function saveUpdates(_0x41379d,_0x2e4edf){return function(_0x4532cb){if(_0x4532cb){return _0x4532cb['update'](_0x41379d)['then'](function(_0x16db90){return _0x16db90;});}return null;};}function removeEntity(_0x2d96d4,_0x42876d){return function(_0x59bac1){if(_0x59bac1){return _0x59bac1[_0x652d('0x21')]()[_0x652d('0x22')](function(){_0x2d96d4['status'](0xcc)[_0x652d('0x23')]();});}};}function handleEntityNotFound(_0x461f0e,_0x3482a8){return function(_0x42c178){if(!_0x42c178){_0x461f0e[_0x652d('0x24')](0x194);}return _0x42c178;};}function handleError(_0x4554fd,_0x357c11){_0x357c11=_0x357c11||0x1f4;return function(_0x2192d3){logger[_0x652d('0x25')](_0x2192d3[_0x652d('0x26')]);if(_0x2192d3[_0x652d('0x27')]){delete _0x2192d3[_0x652d('0x27')];}_0x4554fd['status'](_0x357c11)[_0x652d('0x28')](_0x2192d3);};}exports[_0x652d('0x29')]=function(_0x4bc102,_0x2b4b92){var _0x1b4b41={},_0x348904={},_0x49300a={'count':0x0,'rows':[]};var _0x14809d=_['map'](db[_0x652d('0x2a')][_0x652d('0x2b')],function(_0x18ef68){return{'name':_0x18ef68[_0x652d('0x2c')],'type':_0x18ef68['type']['key']};});_0x348904[_0x652d('0x2d')]=_[_0x652d('0x2e')](_0x14809d,_0x652d('0x27'));_0x348904[_0x652d('0x2f')]=_['keys'](_0x4bc102[_0x652d('0x2f')]);_0x348904[_0x652d('0x30')]=_['intersection'](_0x348904[_0x652d('0x2d')],_0x348904[_0x652d('0x2f')]);_0x1b4b41['attributes']=_[_0x652d('0x31')](_0x348904[_0x652d('0x2d')],qs[_0x652d('0x32')](_0x4bc102['query'][_0x652d('0x32')]));_0x1b4b41[_0x652d('0x33')]=_0x1b4b41[_0x652d('0x33')][_0x652d('0x34')]?_0x1b4b41[_0x652d('0x33')]:_0x348904['model'];if(!_0x4bc102[_0x652d('0x2f')][_0x652d('0x35')](_0x652d('0x36'))){_0x1b4b41[_0x652d('0x1d')]=qs[_0x652d('0x1d')](_0x4bc102['query']['limit']);_0x1b4b41[_0x652d('0x1b')]=qs[_0x652d('0x1b')](_0x4bc102['query']['offset']);}_0x1b4b41[_0x652d('0x37')]=qs[_0x652d('0x38')](_0x4bc102[_0x652d('0x2f')][_0x652d('0x38')]);_0x1b4b41[_0x652d('0x39')]=qs[_0x652d('0x30')](_['pick'](_0x4bc102[_0x652d('0x2f')],_0x348904['filters']),_0x14809d);if(_0x4bc102[_0x652d('0x2f')]['filter']){_0x1b4b41[_0x652d('0x39')]=_['merge'](_0x1b4b41['where'],{'$or':_[_0x652d('0x2e')](_0x14809d,function(_0x5729f9){if(_0x5729f9[_0x652d('0x3a')]!==_0x652d('0x3b')){var _0x3137af={};_0x3137af[_0x5729f9[_0x652d('0x27')]]={'$like':'%'+_0x4bc102[_0x652d('0x2f')][_0x652d('0x3c')]+'%'};return _0x3137af;}})});}_0x1b4b41=_[_0x652d('0x3d')]({},_0x1b4b41,_0x4bc102[_0x652d('0x3e')]);var _0xf178a4={'where':_0x1b4b41[_0x652d('0x39')]};return db[_0x652d('0x2a')]['count'](_0xf178a4)[_0x652d('0x22')](function(_0x4a2ced){_0x49300a[_0x652d('0x1e')]=_0x4a2ced;if(_0x4bc102[_0x652d('0x2f')]['includeAll']){_0x1b4b41[_0x652d('0x3f')]=[{'all':!![]}];}return db[_0x652d('0x2a')][_0x652d('0x40')](_0x1b4b41);})[_0x652d('0x22')](function(_0x4859b0){_0x49300a[_0x652d('0x41')]=_0x4859b0;return _0x49300a;})[_0x652d('0x22')](respondWithFilteredResult(_0x2b4b92,_0x1b4b41))[_0x652d('0x42')](handleError(_0x2b4b92,null));};exports['show']=function(_0x148a94,_0x425ae3){var _0x4f9839={'raw':!![],'where':{'id':_0x148a94[_0x652d('0x43')]['id']}},_0x13e7f2={};_0x13e7f2[_0x652d('0x2d')]=_[_0x652d('0x44')](db[_0x652d('0x2a')]['rawAttributes']);_0x13e7f2[_0x652d('0x2f')]=_[_0x652d('0x44')](_0x148a94[_0x652d('0x2f')]);_0x13e7f2[_0x652d('0x30')]=_['intersection'](_0x13e7f2['model'],_0x13e7f2[_0x652d('0x2f')]);_0x4f9839[_0x652d('0x33')]=_[_0x652d('0x31')](_0x13e7f2[_0x652d('0x2d')],qs[_0x652d('0x32')](_0x148a94[_0x652d('0x2f')]['fields']));_0x4f9839[_0x652d('0x33')]=_0x4f9839[_0x652d('0x33')][_0x652d('0x34')]?_0x4f9839[_0x652d('0x33')]:_0x13e7f2[_0x652d('0x2d')];if(_0x148a94['query'][_0x652d('0x45')]){_0x4f9839[_0x652d('0x3f')]=[{'all':!![]}];}_0x4f9839=_[_0x652d('0x3d')]({},_0x4f9839,_0x148a94['options']);return db[_0x652d('0x2a')]['find'](_0x4f9839)[_0x652d('0x22')](handleEntityNotFound(_0x425ae3,null))[_0x652d('0x22')](respondWithResult(_0x425ae3,null))[_0x652d('0x42')](handleError(_0x425ae3,null));};exports['create']=function(_0x3608de,_0x4865c2){return db[_0x652d('0x2a')][_0x652d('0x46')](_0x3608de[_0x652d('0x47')],{})[_0x652d('0x22')](respondWithResult(_0x4865c2,0xc9))[_0x652d('0x42')](handleError(_0x4865c2,null));};exports[_0x652d('0x48')]=function(_0x263b94,_0x4b0ab1){if(_0x263b94['body']['id']){delete _0x263b94[_0x652d('0x47')]['id'];}return db['FreshsalesField'][_0x652d('0x49')]({'where':{'id':_0x263b94[_0x652d('0x43')]['id']}})[_0x652d('0x22')](handleEntityNotFound(_0x4b0ab1,null))[_0x652d('0x22')](saveUpdates(_0x263b94[_0x652d('0x47')],null))[_0x652d('0x22')](respondWithResult(_0x4b0ab1,null))[_0x652d('0x42')](handleError(_0x4b0ab1,null));};exports[_0x652d('0x21')]=function(_0x666c49,_0x147e4c){return db[_0x652d('0x2a')][_0x652d('0x49')]({'where':{'id':_0x666c49['params']['id']}})[_0x652d('0x22')](handleEntityNotFound(_0x147e4c,null))[_0x652d('0x22')](removeEntity(_0x147e4c,null))['catch'](handleError(_0x147e4c,null));}; \ No newline at end of file +var _0x7b0d=['jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','FreshsalesField','rawAttributes','type','key','keys','query','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','include','findAll','rows','catch','params','filters','intersection','includeAll','find','create','body','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0xf2055e,_0x4efcc3){var _0x8ce5f1=function(_0x234594){while(--_0x234594){_0xf2055e['push'](_0xf2055e['shift']());}};_0x8ce5f1(++_0x4efcc3);}(_0x7b0d,0x152));var _0xd7b0=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x7b0d[_0x3c4737];return _0x2bb926;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd7b0('0x0'));var rp=require(_0xd7b0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd7b0('0x2'));var util=require(_0xd7b0('0x3'));var path=require(_0xd7b0('0x4'));var sox=require(_0xd7b0('0x5'));var csv=require(_0xd7b0('0x6'));var ejs=require(_0xd7b0('0x7'));var fs=require('fs');var fs_extra=require(_0xd7b0('0x8'));var _=require(_0xd7b0('0x9'));var squel=require(_0xd7b0('0xa'));var crypto=require(_0xd7b0('0xb'));var jsforce=require(_0xd7b0('0xc'));var deskjs=require(_0xd7b0('0xd'));var toCsv=require(_0xd7b0('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd7b0('0xe'));var as=require(_0xd7b0('0xf'));var hardwareService=require(_0xd7b0('0x10'));var logger=require(_0xd7b0('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd7b0('0x12'));var licenseUtil=require(_0xd7b0('0x13'));var db=require(_0xd7b0('0x14'))['db'];function respondWithStatusCode(_0x18b08f,_0x4048a7){_0x4048a7=_0x4048a7||0xcc;return function(_0x130ffd){if(_0x130ffd){return _0x18b08f[_0xd7b0('0x15')](_0x4048a7);}return _0x18b08f[_0xd7b0('0x16')](_0x4048a7)[_0xd7b0('0x17')]();};}function respondWithResult(_0x5d4932,_0x47266b){_0x47266b=_0x47266b||0xc8;return function(_0x30d516){if(_0x30d516){return _0x5d4932[_0xd7b0('0x16')](_0x47266b)[_0xd7b0('0x18')](_0x30d516);}};}function respondWithFilteredResult(_0x5f3b43,_0x2df3bc){return function(_0x465780){if(_0x465780){var _0x506857=typeof _0x2df3bc['offset']===_0xd7b0('0x19')&&typeof _0x2df3bc[_0xd7b0('0x1a')]===_0xd7b0('0x19');var _0x43aa25=_0x465780[_0xd7b0('0x1b')];var _0x476703=_0x506857?0x0:_0x2df3bc[_0xd7b0('0x1c')];var _0x58a3dc=_0x506857?_0x465780[_0xd7b0('0x1b')]:_0x2df3bc[_0xd7b0('0x1c')]+_0x2df3bc[_0xd7b0('0x1a')];var _0x21b61d;if(_0x58a3dc>=_0x43aa25){_0x58a3dc=_0x43aa25;_0x21b61d=0xc8;}else{_0x21b61d=0xce;}_0x5f3b43[_0xd7b0('0x16')](_0x21b61d);return _0x5f3b43[_0xd7b0('0x1d')]('Content-Range',_0x476703+'-'+_0x58a3dc+'/'+_0x43aa25)[_0xd7b0('0x18')](_0x465780);}return null;};}function patchUpdates(_0x1f6e0d){return function(_0xc3a77f){try{jsonpatch[_0xd7b0('0x1e')](_0xc3a77f,_0x1f6e0d,!![]);}catch(_0x7fbb89){return BPromise[_0xd7b0('0x1f')](_0x7fbb89);}return _0xc3a77f[_0xd7b0('0x20')]();};}function saveUpdates(_0x368ab6,_0x354e39){return function(_0x2502de){if(_0x2502de){return _0x2502de[_0xd7b0('0x21')](_0x368ab6)['then'](function(_0x3990a6){return _0x3990a6;});}return null;};}function removeEntity(_0x519d15,_0x4f1239){return function(_0x19a323){if(_0x19a323){return _0x19a323[_0xd7b0('0x22')]()[_0xd7b0('0x23')](function(){_0x519d15[_0xd7b0('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46d7be,_0xd3b563){return function(_0x2245d2){if(!_0x2245d2){_0x46d7be[_0xd7b0('0x15')](0x194);}return _0x2245d2;};}function handleError(_0xd0befe,_0x2e626b){_0x2e626b=_0x2e626b||0x1f4;return function(_0x168107){logger[_0xd7b0('0x24')](_0x168107[_0xd7b0('0x25')]);if(_0x168107[_0xd7b0('0x26')]){delete _0x168107[_0xd7b0('0x26')];}_0xd0befe['status'](_0x2e626b)[_0xd7b0('0x27')](_0x168107);};}exports[_0xd7b0('0x28')]=function(_0x415fec,_0x130536){var _0x12bd32={},_0x1756d2={},_0x2c36ff={'count':0x0,'rows':[]};var _0x3bd601=_['map'](db[_0xd7b0('0x29')][_0xd7b0('0x2a')],function(_0xf1ef38){return{'name':_0xf1ef38['fieldName'],'type':_0xf1ef38[_0xd7b0('0x2b')][_0xd7b0('0x2c')]};});_0x1756d2['model']=_['map'](_0x3bd601,'name');_0x1756d2['query']=_[_0xd7b0('0x2d')](_0x415fec[_0xd7b0('0x2e')]);_0x1756d2['filters']=_['intersection'](_0x1756d2[_0xd7b0('0x2f')],_0x1756d2[_0xd7b0('0x2e')]);_0x12bd32[_0xd7b0('0x30')]=_['intersection'](_0x1756d2[_0xd7b0('0x2f')],qs[_0xd7b0('0x31')](_0x415fec[_0xd7b0('0x2e')]['fields']));_0x12bd32[_0xd7b0('0x30')]=_0x12bd32[_0xd7b0('0x30')][_0xd7b0('0x32')]?_0x12bd32[_0xd7b0('0x30')]:_0x1756d2[_0xd7b0('0x2f')];if(!_0x415fec[_0xd7b0('0x2e')][_0xd7b0('0x33')]('nolimit')){_0x12bd32[_0xd7b0('0x1a')]=qs['limit'](_0x415fec[_0xd7b0('0x2e')][_0xd7b0('0x1a')]);_0x12bd32[_0xd7b0('0x1c')]=qs[_0xd7b0('0x1c')](_0x415fec['query'][_0xd7b0('0x1c')]);}_0x12bd32[_0xd7b0('0x34')]=qs[_0xd7b0('0x35')](_0x415fec[_0xd7b0('0x2e')]['sort']);_0x12bd32['where']=qs['filters'](_['pick'](_0x415fec[_0xd7b0('0x2e')],_0x1756d2['filters']),_0x3bd601);if(_0x415fec['query']['filter']){_0x12bd32[_0xd7b0('0x36')]=_[_0xd7b0('0x37')](_0x12bd32[_0xd7b0('0x36')],{'$or':_[_0xd7b0('0x38')](_0x3bd601,function(_0x40ed){if(_0x40ed['type']!==_0xd7b0('0x39')){var _0x298ee3={};_0x298ee3[_0x40ed['name']]={'$like':'%'+_0x415fec['query'][_0xd7b0('0x3a')]+'%'};return _0x298ee3;}})});}_0x12bd32=_[_0xd7b0('0x37')]({},_0x12bd32,_0x415fec['options']);var _0x3d58c5={'where':_0x12bd32[_0xd7b0('0x36')]};return db[_0xd7b0('0x29')][_0xd7b0('0x1b')](_0x3d58c5)['then'](function(_0xb4706d){_0x2c36ff[_0xd7b0('0x1b')]=_0xb4706d;if(_0x415fec[_0xd7b0('0x2e')]['includeAll']){_0x12bd32[_0xd7b0('0x3b')]=[{'all':!![]}];}return db[_0xd7b0('0x29')][_0xd7b0('0x3c')](_0x12bd32);})[_0xd7b0('0x23')](function(_0x192ccd){_0x2c36ff[_0xd7b0('0x3d')]=_0x192ccd;return _0x2c36ff;})['then'](respondWithFilteredResult(_0x130536,_0x12bd32))[_0xd7b0('0x3e')](handleError(_0x130536,null));};exports['show']=function(_0x51fc56,_0x815943){var _0x6d00d9={'raw':!![],'where':{'id':_0x51fc56[_0xd7b0('0x3f')]['id']}},_0x23c76c={};_0x23c76c[_0xd7b0('0x2f')]=_['keys'](db[_0xd7b0('0x29')][_0xd7b0('0x2a')]);_0x23c76c['query']=_[_0xd7b0('0x2d')](_0x51fc56[_0xd7b0('0x2e')]);_0x23c76c[_0xd7b0('0x40')]=_[_0xd7b0('0x41')](_0x23c76c[_0xd7b0('0x2f')],_0x23c76c[_0xd7b0('0x2e')]);_0x6d00d9[_0xd7b0('0x30')]=_[_0xd7b0('0x41')](_0x23c76c[_0xd7b0('0x2f')],qs[_0xd7b0('0x31')](_0x51fc56[_0xd7b0('0x2e')][_0xd7b0('0x31')]));_0x6d00d9[_0xd7b0('0x30')]=_0x6d00d9['attributes'][_0xd7b0('0x32')]?_0x6d00d9['attributes']:_0x23c76c[_0xd7b0('0x2f')];if(_0x51fc56['query'][_0xd7b0('0x42')]){_0x6d00d9[_0xd7b0('0x3b')]=[{'all':!![]}];}_0x6d00d9=_['merge']({},_0x6d00d9,_0x51fc56['options']);return db[_0xd7b0('0x29')][_0xd7b0('0x43')](_0x6d00d9)[_0xd7b0('0x23')](handleEntityNotFound(_0x815943,null))[_0xd7b0('0x23')](respondWithResult(_0x815943,null))[_0xd7b0('0x3e')](handleError(_0x815943,null));};exports['create']=function(_0x502714,_0x167c01){return db['FreshsalesField'][_0xd7b0('0x44')](_0x502714[_0xd7b0('0x45')],{})[_0xd7b0('0x23')](respondWithResult(_0x167c01,0xc9))[_0xd7b0('0x3e')](handleError(_0x167c01,null));};exports[_0xd7b0('0x21')]=function(_0x17b43c,_0x37675d){if(_0x17b43c[_0xd7b0('0x45')]['id']){delete _0x17b43c[_0xd7b0('0x45')]['id'];}return db[_0xd7b0('0x29')][_0xd7b0('0x43')]({'where':{'id':_0x17b43c[_0xd7b0('0x3f')]['id']}})[_0xd7b0('0x23')](handleEntityNotFound(_0x37675d,null))['then'](saveUpdates(_0x17b43c[_0xd7b0('0x45')],null))[_0xd7b0('0x23')](respondWithResult(_0x37675d,null))[_0xd7b0('0x3e')](handleError(_0x37675d,null));};exports[_0xd7b0('0x22')]=function(_0x499ba6,_0x1f7838){return db[_0xd7b0('0x29')][_0xd7b0('0x43')]({'where':{'id':_0x499ba6[_0xd7b0('0x3f')]['id']}})[_0xd7b0('0x23')](handleEntityNotFound(_0x1f7838,null))['then'](removeEntity(_0x1f7838,null))[_0xd7b0('0x3e')](handleError(_0x1f7838,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 5347825..eaee4cb 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 _0x5453=['./intFreshsalesField.attributes','define','freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x344911,_0x1e23f1){var _0x4a8540=function(_0x46ac55){while(--_0x46ac55){_0x344911['push'](_0x344911['shift']());}};_0x4a8540(++_0x1e23f1);}(_0x5453,0x18b));var _0x3545=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5453[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var logger=require(_0x3545('0x2'))(_0x3545('0x3'));var moment=require(_0x3545('0x4'));var BPromise=require(_0x3545('0x5'));var rp=require(_0x3545('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3545('0x7'));var attributes=require(_0x3545('0x8'));module['exports']=function(_0x22a172,_0x59ce7b){return _0x22a172[_0x3545('0x9')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x3545('0xa'),'fields':[_0x3545('0xb'),_0x3545('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaaee=['FieldId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','freshsales_unique_index','idField'];(function(_0x403bae,_0x223714){var _0x45254b=function(_0x2c1319){while(--_0x2c1319){_0x403bae['push'](_0x403bae['shift']());}};_0x45254b(++_0x223714);}(_0xaaee,0xa9));var _0xeaae=function(_0x5ef967,_0x9dddd6){_0x5ef967=_0x5ef967-0x0;var _0x18f77a=_0xaaee[_0x5ef967];return _0x18f77a;};'use strict';var _=require(_0xeaae('0x0'));var util=require('util');var logger=require(_0xeaae('0x1'))(_0xeaae('0x2'));var moment=require('moment');var BPromise=require(_0xeaae('0x3'));var rp=require(_0xeaae('0x4'));var fs=require('fs');var path=require(_0xeaae('0x5'));var rimraf=require(_0xeaae('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaae('0x7'));module[_0xeaae('0x8')]=function(_0x213422,_0x45c104){return _0x213422[_0xeaae('0x9')](_0xeaae('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xeaae('0xb'),'fields':[_0xeaae('0xc'),_0xeaae('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 c4c6da2..bf4cc8b 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 _0x814b=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x814b,0x1a2));var _0xb814=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0x814b[_0x788a54];return _0x8b73a4;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +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(_0x3c0111,_0x40c3e4){var _0x4f955d=function(_0x466746){while(--_0x466746){_0x3c0111['push'](_0x3c0111['shift']());}};_0x4f955d(++_0x40c3e4);}(_0x5d17,0x114));var _0x75d1=function(_0x5e80a1,_0x5558fa){_0x5e80a1=_0x5e80a1-0x0;var _0x2290fc=_0x5d17[_0x5e80a1];return _0x2290fc;};'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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 3e636bc..bcaef64 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(_0xe58fba,_0x48d288){var _0x1b4db5=function(_0x53c7e1){while(--_0x53c7e1){_0xe58fba['push'](_0xe58fba['shift']());}};_0x1b4db5(++_0x48d288);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x419d2f,_0x3e02c4){var _0x83078a=function(_0x58629c){while(--_0x58629c){_0x419d2f['push'](_0x419d2f['shift']());}};_0x83078a(++_0x3e02c4);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0bce135..65caa94 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 _0xb9c6=['exports','STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0x5da35f,_0x8e05a0){var _0x15a515=function(_0x275878){while(--_0x275878){_0x5da35f['push'](_0x5da35f['shift']());}};_0x15a515(++_0x8e05a0);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x503fce,_0x8a5b60){_0x503fce=_0x503fce-0x0;var _0x36bef5=_0xb9c6[_0x503fce];return _0x36bef5;};'use strict';var Sequelize=require(_0x6b9c('0x0'));module[_0x6b9c('0x1')]={'name':{'type':Sequelize[_0x6b9c('0x2')]},'description':{'type':Sequelize[_0x6b9c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6b9c('0x3')},'remoteUri':{'type':Sequelize[_0x6b9c('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x6b9c('0x2')]},'serverUrl':{'type':Sequelize[_0x6b9c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6b9c('0x4')]('integrationTab',_0x6b9c('0x5')),'defaultValue':_0x6b9c('0x6')}}; \ No newline at end of file +var _0x598a=['integrationTab','sequelize','exports','STRING','username','ENUM'];(function(_0x4f031d,_0x18c020){var _0x14ee1d=function(_0x573f6e){while(--_0x573f6e){_0x4f031d['push'](_0x4f031d['shift']());}};_0x14ee1d(++_0x18c020);}(_0x598a,0x1c9));var _0xa598=function(_0x1442f0,_0x327cfe){_0x1442f0=_0x1442f0-0x0;var _0x3f50f4=_0x598a[_0x1442f0];return _0x3f50f4;};'use strict';var Sequelize=require(_0xa598('0x0'));module[_0xa598('0x1')]={'name':{'type':Sequelize[_0xa598('0x2')]},'description':{'type':Sequelize[_0xa598('0x2')]},'username':{'type':Sequelize[_0xa598('0x2')],'unique':_0xa598('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa598('0x2')]},'clientId':{'type':Sequelize[_0xa598('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xa598('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa598('0x4')](_0xa598('0x5'),'newTab'),'defaultValue':_0xa598('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index af31bfc..b7b5bb3 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 _0xef4e=['model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','destroy','findOne','SalesforceConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','username','securityToken','slice','lastIndexOf','Connection','clientSecret','password','concat','isNil','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','phone','includes','custom','picklistValues','label','value','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key'];(function(_0x4af087,_0x1c595b){var _0x171e71=function(_0x48ef8e){while(--_0x48ef8e){_0x4af087['push'](_0x4af087['shift']());}};_0x171e71(++_0x1c595b);}(_0xef4e,0xc8));var _0xeef4=function(_0x203a88,_0x32521b){_0x203a88=_0x203a88-0x0;var _0x46e6ce=_0xef4e[_0x203a88];return _0x46e6ce;};'use strict';var emlformat=require(_0xeef4('0x0'));var rimraf=require(_0xeef4('0x1'));var zipdir=require(_0xeef4('0x2'));var jsonpatch=require(_0xeef4('0x3'));var rp=require(_0xeef4('0x4'));var moment=require(_0xeef4('0x5'));var BPromise=require(_0xeef4('0x6'));var Mustache=require('mustache');var util=require(_0xeef4('0x7'));var path=require(_0xeef4('0x8'));var sox=require(_0xeef4('0x9'));var csv=require(_0xeef4('0xa'));var ejs=require(_0xeef4('0xb'));var fs=require('fs');var fs_extra=require(_0xeef4('0xc'));var _=require(_0xeef4('0xd'));var squel=require(_0xeef4('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeef4('0xa'));var querystring=require(_0xeef4('0xf'));var Papa=require(_0xeef4('0x10'));var Redis=require(_0xeef4('0x11'));var authService=require(_0xeef4('0x12'));var qs=require(_0xeef4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeef4('0x14'))(_0xeef4('0x15'));var utils=require('../../config/utils');var config=require(_0xeef4('0x16'));var licenseUtil=require(_0xeef4('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xeef4('0x18'));function respondWithStatusCode(_0x11f7d1,_0x4a6dd2){_0x4a6dd2=_0x4a6dd2||0xcc;return function(_0x1573d1){if(_0x1573d1){return _0x11f7d1['sendStatus'](_0x4a6dd2);}return _0x11f7d1[_0xeef4('0x19')](_0x4a6dd2)[_0xeef4('0x1a')]();};}function respondWithResult(_0x3fff87,_0x5b6482){_0x5b6482=_0x5b6482||0xc8;return function(_0x14c03f){if(_0x14c03f){return _0x3fff87[_0xeef4('0x19')](_0x5b6482)[_0xeef4('0x1b')](_0x14c03f);}};}function respondWithFilteredResult(_0x36b58e,_0x1aba35){return function(_0x49240c){if(_0x49240c){var _0x3d6980=typeof _0x1aba35[_0xeef4('0x1c')]===_0xeef4('0x1d')&&typeof _0x1aba35[_0xeef4('0x1e')]===_0xeef4('0x1d');var _0x167620=_0x49240c[_0xeef4('0x1f')];var _0x396a0f=_0x3d6980?0x0:_0x1aba35[_0xeef4('0x1c')];var _0x21dae0=_0x3d6980?_0x49240c[_0xeef4('0x1f')]:_0x1aba35[_0xeef4('0x1c')]+_0x1aba35[_0xeef4('0x1e')];var _0x43330c;if(_0x21dae0>=_0x167620){_0x21dae0=_0x167620;_0x43330c=0xc8;}else{_0x43330c=0xce;}_0x36b58e[_0xeef4('0x19')](_0x43330c);return _0x36b58e[_0xeef4('0x20')](_0xeef4('0x21'),_0x396a0f+'-'+_0x21dae0+'/'+_0x167620)[_0xeef4('0x1b')](_0x49240c);}return null;};}function patchUpdates(_0x3f88a6){return function(_0x1d3e94){try{jsonpatch[_0xeef4('0x22')](_0x1d3e94,_0x3f88a6,!![]);}catch(_0x3943fb){return BPromise[_0xeef4('0x23')](_0x3943fb);}return _0x1d3e94[_0xeef4('0x24')]();};}function saveUpdates(_0x561cf1,_0x508c52){return function(_0x4ed61e){if(_0x4ed61e){return _0x4ed61e[_0xeef4('0x25')](_0x561cf1)[_0xeef4('0x26')](function(_0x5e745c){return _0x5e745c;});}return null;};}function removeEntity(_0x281f86,_0x566b28){return function(_0x1dceb0){if(_0x1dceb0){return _0x1dceb0['destroy']()['then'](function(){_0x281f86[_0xeef4('0x19')](0xcc)[_0xeef4('0x1a')]();});}};}function handleEntityNotFound(_0x5437d1,_0x382a6b){return function(_0x4e5780){if(!_0x4e5780){_0x5437d1['sendStatus'](0x194);}return _0x4e5780;};}function handleError(_0x4ee616,_0x11ebf5){_0x11ebf5=_0x11ebf5||0x1f4;return function(_0x5d1c86){logger[_0xeef4('0x27')](_0x5d1c86[_0xeef4('0x28')]);if(_0x5d1c86[_0xeef4('0x29')]){delete _0x5d1c86['name'];}_0x4ee616[_0xeef4('0x19')](_0x11ebf5)[_0xeef4('0x2a')](_0x5d1c86);};}exports[_0xeef4('0x2b')]=function(_0x532e50,_0x10f74d){var _0x5e7d77={},_0x540c52={},_0x27aa52={'count':0x0,'rows':[]};var _0x346a01=_[_0xeef4('0x2c')](db[_0xeef4('0x2d')][_0xeef4('0x2e')],function(_0x39b360){return{'name':_0x39b360[_0xeef4('0x2f')],'type':_0x39b360[_0xeef4('0x30')][_0xeef4('0x31')]};});_0x540c52[_0xeef4('0x32')]=_[_0xeef4('0x2c')](_0x346a01,_0xeef4('0x29'));_0x540c52[_0xeef4('0x33')]=_[_0xeef4('0x34')](_0x532e50[_0xeef4('0x33')]);_0x540c52['filters']=_[_0xeef4('0x35')](_0x540c52[_0xeef4('0x32')],_0x540c52[_0xeef4('0x33')]);_0x5e7d77[_0xeef4('0x36')]=_['intersection'](_0x540c52[_0xeef4('0x32')],qs[_0xeef4('0x37')](_0x532e50[_0xeef4('0x33')][_0xeef4('0x37')]));_0x5e7d77[_0xeef4('0x36')]=_0x5e7d77[_0xeef4('0x36')][_0xeef4('0x38')]?_0x5e7d77['attributes']:_0x540c52[_0xeef4('0x32')];if(!_0x532e50['query']['hasOwnProperty'](_0xeef4('0x39'))){_0x5e7d77[_0xeef4('0x1e')]=qs[_0xeef4('0x1e')](_0x532e50['query'][_0xeef4('0x1e')]);_0x5e7d77[_0xeef4('0x1c')]=qs[_0xeef4('0x1c')](_0x532e50[_0xeef4('0x33')][_0xeef4('0x1c')]);}_0x5e7d77[_0xeef4('0x3a')]=qs[_0xeef4('0x3b')](_0x532e50[_0xeef4('0x33')][_0xeef4('0x3b')]);_0x5e7d77[_0xeef4('0x3c')]=qs[_0xeef4('0x3d')](_[_0xeef4('0x3e')](_0x532e50[_0xeef4('0x33')],_0x540c52[_0xeef4('0x3d')]),_0x346a01);if(_0x532e50[_0xeef4('0x33')][_0xeef4('0x3f')]){_0x5e7d77[_0xeef4('0x3c')]=_[_0xeef4('0x40')](_0x5e7d77[_0xeef4('0x3c')],{'$or':_[_0xeef4('0x2c')](_0x346a01,function(_0x24c682){if(_0x24c682[_0xeef4('0x30')]!=='VIRTUAL'){var _0x308852={};_0x308852[_0x24c682['name']]={'$like':'%'+_0x532e50['query'][_0xeef4('0x3f')]+'%'};return _0x308852;}})});}_0x5e7d77=_[_0xeef4('0x40')]({},_0x5e7d77,_0x532e50[_0xeef4('0x41')]);var _0xefc85a={'where':_0x5e7d77[_0xeef4('0x3c')]};return db['SalesforceAccount']['count'](_0xefc85a)[_0xeef4('0x26')](function(_0x5656aa){_0x27aa52[_0xeef4('0x1f')]=_0x5656aa;if(_0x532e50[_0xeef4('0x33')][_0xeef4('0x42')]){_0x5e7d77[_0xeef4('0x43')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xeef4('0x44')](_0x5e7d77);})[_0xeef4('0x26')](function(_0x98e27b){_0x27aa52['rows']=_0x98e27b;return _0x27aa52;})[_0xeef4('0x26')](respondWithFilteredResult(_0x10f74d,_0x5e7d77))[_0xeef4('0x45')](handleError(_0x10f74d,null));};exports[_0xeef4('0x46')]=function(_0x2a3bc5,_0x41aed3){var _0x31229e={'raw':![],'where':{'id':_0x2a3bc5[_0xeef4('0x47')]['id']}},_0x2a4f2a={};_0x2a4f2a[_0xeef4('0x32')]=_[_0xeef4('0x34')](db[_0xeef4('0x2d')][_0xeef4('0x2e')]);_0x2a4f2a['query']=_[_0xeef4('0x34')](_0x2a3bc5[_0xeef4('0x33')]);_0x2a4f2a[_0xeef4('0x3d')]=_[_0xeef4('0x35')](_0x2a4f2a[_0xeef4('0x32')],_0x2a4f2a[_0xeef4('0x33')]);_0x31229e['attributes']=_['intersection'](_0x2a4f2a[_0xeef4('0x32')],qs[_0xeef4('0x37')](_0x2a3bc5[_0xeef4('0x33')][_0xeef4('0x37')]));_0x31229e[_0xeef4('0x36')]=_0x31229e['attributes'][_0xeef4('0x38')]?_0x31229e[_0xeef4('0x36')]:_0x2a4f2a[_0xeef4('0x32')];if(_0x2a3bc5[_0xeef4('0x33')][_0xeef4('0x42')]){_0x31229e[_0xeef4('0x43')]=[{'all':!![]}];}_0x31229e=_[_0xeef4('0x40')]({},_0x31229e,_0x2a3bc5[_0xeef4('0x41')]);return db['SalesforceAccount']['find'](_0x31229e)[_0xeef4('0x26')](handleEntityNotFound(_0x41aed3,null))[_0xeef4('0x26')](respondWithResult(_0x41aed3,null))[_0xeef4('0x45')](handleError(_0x41aed3,null));};exports[_0xeef4('0x48')]=function(_0x1c63ed,_0xe6c76a){return db[_0xeef4('0x2d')][_0xeef4('0x48')](_0x1c63ed[_0xeef4('0x49')],{})[_0xeef4('0x26')](respondWithResult(_0xe6c76a,0xc9))[_0xeef4('0x45')](handleError(_0xe6c76a,null));};exports[_0xeef4('0x25')]=function(_0x4056d5,_0x2365e6){if(_0x4056d5['body']['id']){delete _0x4056d5['body']['id'];}return db['SalesforceAccount'][_0xeef4('0x4a')]({'where':{'id':_0x4056d5[_0xeef4('0x47')]['id']}})[_0xeef4('0x26')](handleEntityNotFound(_0x2365e6,null))[_0xeef4('0x26')](saveUpdates(_0x4056d5[_0xeef4('0x49')],null))[_0xeef4('0x26')](respondWithResult(_0x2365e6,null))[_0xeef4('0x45')](handleError(_0x2365e6,null));};exports[_0xeef4('0x4b')]=function(_0x1ab2c6,_0x4ac647){return db[_0xeef4('0x2d')][_0xeef4('0x4a')]({'where':{'id':_0x1ab2c6[_0xeef4('0x47')]['id']}})[_0xeef4('0x26')](handleEntityNotFound(_0x4ac647,null))[_0xeef4('0x26')](removeEntity(_0x4ac647,null))['catch'](handleError(_0x4ac647,null));};exports['getConfigurations']=function(_0x589ba7,_0x345417,_0x54b66e){var _0x5458d7={};var _0x13201c={};var _0x40b98f;var _0x74406d;return db[_0xeef4('0x2d')][_0xeef4('0x4c')]({'where':{'id':_0x589ba7['params']['id']}})[_0xeef4('0x26')](handleEntityNotFound(_0x345417,null))['then'](function(_0x2e5d08){if(_0x2e5d08){_0x40b98f=_0x2e5d08;_0x13201c[_0xeef4('0x32')]=_[_0xeef4('0x34')](db[_0xeef4('0x4d')][_0xeef4('0x2e')]);_0x13201c[_0xeef4('0x33')]=_[_0xeef4('0x34')](_0x589ba7[_0xeef4('0x33')]);_0x13201c[_0xeef4('0x3d')]=_[_0xeef4('0x35')](_0x13201c[_0xeef4('0x32')],_0x13201c['query']);_0x5458d7['attributes']=_['intersection'](_0x13201c[_0xeef4('0x32')],qs['fields'](_0x589ba7['query']['fields']));_0x5458d7[_0xeef4('0x36')]=_0x5458d7[_0xeef4('0x36')]['length']?_0x5458d7[_0xeef4('0x36')]:_0x13201c[_0xeef4('0x32')];_0x5458d7['order']=qs[_0xeef4('0x3b')](_0x589ba7[_0xeef4('0x33')]['sort']);_0x5458d7[_0xeef4('0x3c')]=qs[_0xeef4('0x3d')](_[_0xeef4('0x3e')](_0x589ba7[_0xeef4('0x33')],_0x13201c[_0xeef4('0x3d')]));if(_0x589ba7['query'][_0xeef4('0x3f')]){_0x5458d7['where']=_['merge'](_0x5458d7['where'],{'$or':_['map'](_0x5458d7['attributes'],function(_0x16a1ff){var _0x186d28={};_0x186d28[_0x16a1ff]={'$like':'%'+_0x589ba7[_0xeef4('0x33')][_0xeef4('0x3f')]+'%'};return _0x186d28;})});}_0x5458d7=_[_0xeef4('0x40')]({},_0x5458d7,_0x589ba7['options']);return _0x40b98f[_0xeef4('0x4e')](_0x5458d7);}})[_0xeef4('0x26')](function(_0x490a38){if(_0x490a38){_0x74406d=_0x490a38[_0xeef4('0x38')];if(!_0x589ba7[_0xeef4('0x33')][_0xeef4('0x4f')](_0xeef4('0x39'))){_0x5458d7[_0xeef4('0x1e')]=qs[_0xeef4('0x1e')](_0x589ba7[_0xeef4('0x33')][_0xeef4('0x1e')]);_0x5458d7['offset']=qs[_0xeef4('0x1c')](_0x589ba7[_0xeef4('0x33')][_0xeef4('0x1c')]);}return _0x40b98f[_0xeef4('0x4e')](_0x5458d7);}})[_0xeef4('0x26')](function(_0x201db4){if(_0x201db4){return _0x201db4?{'count':_0x74406d,'rows':_0x201db4}:null;}})['then'](respondWithResult(_0x345417,null))[_0xeef4('0x45')](handleError(_0x345417,null));};exports[_0xeef4('0x50')]=function(_0xf1f7bc,_0x1fe12e,_0x42ea3f){if(_0xf1f7bc[_0xeef4('0x49')]['id']){delete _0xf1f7bc[_0xeef4('0x49')]['id'];}return db[_0xeef4('0x2d')][_0xeef4('0x4c')]({'where':{'id':_0xf1f7bc[_0xeef4('0x47')]['id']}})[_0xeef4('0x26')](handleEntityNotFound(_0x1fe12e,null))[_0xeef4('0x26')](function(_0x1c63ab){if(_0x1c63ab){_0xf1f7bc['body'][_0xeef4('0x51')]=_0x1c63ab['id'];_0xf1f7bc[_0xeef4('0x49')][_0xeef4('0x52')]=integrations['getSubjects'](_0xf1f7bc['body'][_0xeef4('0x53')],_0xf1f7bc[_0xeef4('0x49')]['type']);_0xf1f7bc[_0xeef4('0x49')][_0xeef4('0x54')]=integrations[_0xeef4('0x55')](_0xf1f7bc['body'][_0xeef4('0x53')],_0xf1f7bc[_0xeef4('0x49')][_0xeef4('0x30')]);return db[_0xeef4('0x4d')][_0xeef4('0x48')](_0xf1f7bc[_0xeef4('0x49')],{'include':[{'model':db[_0xeef4('0x56')],'as':'Subjects'},{'model':db[_0xeef4('0x56')],'as':_0xeef4('0x54')}]});}return null;})['then'](respondWithResult(_0x1fe12e,null))['catch'](handleError(_0x1fe12e,null));};exports[_0xeef4('0x57')]=function(_0xd83ec4,_0x599e65,_0x2d1002){var _0x5a17bb;var _0x13a826='';var _0x5c64ab='Task';return db[_0xeef4('0x2d')][_0xeef4('0x4c')]({'where':{'id':_0xd83ec4[_0xeef4('0x47')]['id']},'attributes':['id',_0xeef4('0x58'),_0xeef4('0x59'),'clientSecret',_0xeef4('0x5a'),'password',_0xeef4('0x5b')]})[_0xeef4('0x26')](handleEntityNotFound(_0x599e65,null))[_0xeef4('0x26')](function(_0x566794){if(_0x566794){_0x13a826=_0x566794['remoteUri'];var _0x456335=_0x13a826[_0xeef4('0x5c')](-0x1);if(_0x456335==='/'){_0x13a826=_0x13a826['substring'](0x0,_0x13a826[_0xeef4('0x5d')](_0x456335));}_0x5a17bb=new jsforce[(_0xeef4('0x5e'))]({'oauth2':{'loginUrl':_0x13a826,'clientId':_0x566794[_0xeef4('0x59')],'clientSecret':_0x566794[_0xeef4('0x5f')]}});return _0x5a17bb['login'](_0x566794['username'],_0x566794[_0xeef4('0x60')][_0xeef4('0x61')](_0x566794['securityToken']));}})[_0xeef4('0x26')](function(_0x1ad5c7){if(_0x1ad5c7){if(!_[_0xeef4('0x62')](_0xd83ec4['query']['ticketType'])){_0x5c64ab=_0xd83ec4[_0xeef4('0x33')]['ticketType'];}return _0x5a17bb[_0xeef4('0x63')](_0x5c64ab)[_0xeef4('0x64')]();}})['then'](function(_0x96d775){var _0x3db2da=[_0xeef4('0x65'),_0xeef4('0x66'),_0xeef4('0x67'),_0xeef4('0x68'),_0xeef4('0x69'),_0xeef4('0x6a')];var _0x50c600=[_0xeef4('0x6b'),_0xeef4('0x6c'),_0xeef4('0x6d'),_0xeef4('0x6e'),_0xeef4('0x6f'),_0xeef4('0x70'),_0xeef4('0x71')];if(_0x96d775){_['remove'](_0x96d775[_0xeef4('0x37')],function(_0x53ab8d){return _0x3db2da[_0xeef4('0x72')](_0x53ab8d[_0xeef4('0x29')])||!_0x50c600[_0xeef4('0x72')](_0x53ab8d[_0xeef4('0x30')]);});return{'count':_0x96d775[_0xeef4('0x37')][_0xeef4('0x38')],'rows':_[_0xeef4('0x2c')](_0x96d775[_0xeef4('0x37')],function(_0x7c921c){return{'id':_0x7c921c[_0xeef4('0x29')],'name':_0x7c921c['label'],'custom':_0x7c921c[_0xeef4('0x73')],'options':_0x7c921c[_0xeef4('0x74')][_0xeef4('0x38')]>0x0?_[_0xeef4('0x2c')](_0x7c921c[_0xeef4('0x74')],function(_0x563563){return{'name':_0x563563[_0xeef4('0x75')],'value':_0x563563[_0xeef4('0x76')]};}):_0x7c921c[_0xeef4('0x30')]==_0xeef4('0x6e')?[{'name':'True','value':_0xeef4('0x77')},{'name':_0xeef4('0x78'),'value':_0xeef4('0x79')}]:[]};})};}})[_0xeef4('0x26')](respondWithResult(_0x599e65,null))['catch'](function(_0x3fdde3){var _0x5d14c0=_0xd83ec4['query']['test']?0x1f4:_0x3fdde3[_0xeef4('0x7a')]||0x1f4;logger[_0xeef4('0x27')](_0xeef4('0x7b'),_0xeef4('0x57'),_0x5d14c0,JSON[_0xeef4('0x7c')](_0x3fdde3));delete _0x3fdde3[_0xeef4('0x29')];if(_0x5d14c0===0x191){_0x5d14c0=0x190;}_0x599e65[_0xeef4('0x19')](_0x5d14c0)[_0xeef4('0x2a')](_0xd83ec4[_0xeef4('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3fdde3[_0xeef4('0x7a')]}:_0x3fdde3);});}; \ No newline at end of file +var _0x1fe7=['zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','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','count','apply','reject','save','update','then','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','merge','options','find','create','body','destroy','params','SalesforceConfiguration','hasOwnProperty','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientSecret','username','slice','substring','Connection','password','concat','securityToken','isNil','ticketType','sobject','describe','ActivityDate','IsRecurrence','Subject','int','boolean','textarea','phone','remove','includes','label','picklistValues','value','True','true','False','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf'];(function(_0x7316d1,_0x506432){var _0x3f1601=function(_0x17fd59){while(--_0x17fd59){_0x7316d1['push'](_0x7316d1['shift']());}};_0x3f1601(++_0x506432);}(_0x1fe7,0xf6));var _0x71fe=function(_0x4a68e3,_0x491886){_0x4a68e3=_0x4a68e3-0x0;var _0x5c6893=_0x1fe7[_0x4a68e3];return _0x5c6893;};'use strict';var emlformat=require(_0x71fe('0x0'));var rimraf=require(_0x71fe('0x1'));var zipdir=require(_0x71fe('0x2'));var jsonpatch=require(_0x71fe('0x3'));var rp=require('request-promise');var moment=require(_0x71fe('0x4'));var BPromise=require(_0x71fe('0x5'));var Mustache=require(_0x71fe('0x6'));var util=require('util');var path=require(_0x71fe('0x7'));var sox=require(_0x71fe('0x8'));var csv=require(_0x71fe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x71fe('0xa'));var crypto=require(_0x71fe('0xb'));var jsforce=require(_0x71fe('0xc'));var deskjs=require(_0x71fe('0xd'));var toCsv=require(_0x71fe('0x9'));var querystring=require(_0x71fe('0xe'));var Papa=require(_0x71fe('0xf'));var Redis=require(_0x71fe('0x10'));var authService=require(_0x71fe('0x11'));var qs=require(_0x71fe('0x12'));var as=require(_0x71fe('0x13'));var hardwareService=require(_0x71fe('0x14'));var logger=require(_0x71fe('0x15'))(_0x71fe('0x16'));var utils=require(_0x71fe('0x17'));var config=require(_0x71fe('0x18'));var licenseUtil=require(_0x71fe('0x19'));var db=require(_0x71fe('0x1a'))['db'];var integrations=require(_0x71fe('0x1b'));function respondWithStatusCode(_0x4c945d,_0x147592){_0x147592=_0x147592||0xcc;return function(_0x230a3b){if(_0x230a3b){return _0x4c945d[_0x71fe('0x1c')](_0x147592);}return _0x4c945d[_0x71fe('0x1d')](_0x147592)[_0x71fe('0x1e')]();};}function respondWithResult(_0x45a009,_0x164154){_0x164154=_0x164154||0xc8;return function(_0x125377){if(_0x125377){return _0x45a009[_0x71fe('0x1d')](_0x164154)[_0x71fe('0x1f')](_0x125377);}};}function respondWithFilteredResult(_0x3542c2,_0x4c2062){return function(_0x48af49){if(_0x48af49){var _0x2ff5e5=typeof _0x4c2062[_0x71fe('0x20')]==='undefined'&&typeof _0x4c2062['limit']===_0x71fe('0x21');var _0xd16628=_0x48af49[_0x71fe('0x22')];var _0x123416=_0x2ff5e5?0x0:_0x4c2062[_0x71fe('0x20')];var _0x1b39ef=_0x2ff5e5?_0x48af49[_0x71fe('0x22')]:_0x4c2062[_0x71fe('0x20')]+_0x4c2062['limit'];var _0x2f35f9;if(_0x1b39ef>=_0xd16628){_0x1b39ef=_0xd16628;_0x2f35f9=0xc8;}else{_0x2f35f9=0xce;}_0x3542c2[_0x71fe('0x1d')](_0x2f35f9);return _0x3542c2['set']('Content-Range',_0x123416+'-'+_0x1b39ef+'/'+_0xd16628)['json'](_0x48af49);}return null;};}function patchUpdates(_0x17cad4){return function(_0xa9f04f){try{jsonpatch[_0x71fe('0x23')](_0xa9f04f,_0x17cad4,!![]);}catch(_0x299551){return BPromise[_0x71fe('0x24')](_0x299551);}return _0xa9f04f[_0x71fe('0x25')]();};}function saveUpdates(_0x2808ad,_0xf6dc2a){return function(_0x334ade){if(_0x334ade){return _0x334ade[_0x71fe('0x26')](_0x2808ad)[_0x71fe('0x27')](function(_0x3b7369){return _0x3b7369;});}return null;};}function removeEntity(_0x153c27,_0x1816ec){return function(_0x549365){if(_0x549365){return _0x549365['destroy']()['then'](function(){_0x153c27[_0x71fe('0x1d')](0xcc)[_0x71fe('0x1e')]();});}};}function handleEntityNotFound(_0x15ce8c,_0x5ad03a){return function(_0x3ee05b){if(!_0x3ee05b){_0x15ce8c[_0x71fe('0x1c')](0x194);}return _0x3ee05b;};}function handleError(_0x2de30b,_0x58e268){_0x58e268=_0x58e268||0x1f4;return function(_0x49730e){logger['error'](_0x49730e[_0x71fe('0x28')]);if(_0x49730e[_0x71fe('0x29')]){delete _0x49730e['name'];}_0x2de30b[_0x71fe('0x1d')](_0x58e268)[_0x71fe('0x2a')](_0x49730e);};}exports[_0x71fe('0x2b')]=function(_0x233546,_0x408871){var _0x2def09={},_0x1a4f9d={},_0x3d3be3={'count':0x0,'rows':[]};var _0x1367df=_[_0x71fe('0x2c')](db[_0x71fe('0x2d')][_0x71fe('0x2e')],function(_0x51734c){return{'name':_0x51734c[_0x71fe('0x2f')],'type':_0x51734c[_0x71fe('0x30')][_0x71fe('0x31')]};});_0x1a4f9d[_0x71fe('0x32')]=_[_0x71fe('0x2c')](_0x1367df,_0x71fe('0x29'));_0x1a4f9d[_0x71fe('0x33')]=_['keys'](_0x233546[_0x71fe('0x33')]);_0x1a4f9d[_0x71fe('0x34')]=_['intersection'](_0x1a4f9d[_0x71fe('0x32')],_0x1a4f9d[_0x71fe('0x33')]);_0x2def09[_0x71fe('0x35')]=_[_0x71fe('0x36')](_0x1a4f9d[_0x71fe('0x32')],qs['fields'](_0x233546[_0x71fe('0x33')][_0x71fe('0x37')]));_0x2def09[_0x71fe('0x35')]=_0x2def09[_0x71fe('0x35')][_0x71fe('0x38')]?_0x2def09[_0x71fe('0x35')]:_0x1a4f9d[_0x71fe('0x32')];if(!_0x233546[_0x71fe('0x33')]['hasOwnProperty'](_0x71fe('0x39'))){_0x2def09[_0x71fe('0x3a')]=qs[_0x71fe('0x3a')](_0x233546[_0x71fe('0x33')][_0x71fe('0x3a')]);_0x2def09[_0x71fe('0x20')]=qs[_0x71fe('0x20')](_0x233546['query']['offset']);}_0x2def09['order']=qs['sort'](_0x233546[_0x71fe('0x33')][_0x71fe('0x3b')]);_0x2def09['where']=qs[_0x71fe('0x34')](_[_0x71fe('0x3c')](_0x233546[_0x71fe('0x33')],_0x1a4f9d[_0x71fe('0x34')]),_0x1367df);if(_0x233546['query']['filter']){_0x2def09[_0x71fe('0x3d')]=_['merge'](_0x2def09['where'],{'$or':_[_0x71fe('0x2c')](_0x1367df,function(_0xc01035){if(_0xc01035[_0x71fe('0x30')]!==_0x71fe('0x3e')){var _0x98d23d={};_0x98d23d[_0xc01035['name']]={'$like':'%'+_0x233546[_0x71fe('0x33')][_0x71fe('0x3f')]+'%'};return _0x98d23d;}})});}_0x2def09=_['merge']({},_0x2def09,_0x233546['options']);var _0x11c378={'where':_0x2def09[_0x71fe('0x3d')]};return db[_0x71fe('0x2d')][_0x71fe('0x22')](_0x11c378)[_0x71fe('0x27')](function(_0x1a37f4){_0x3d3be3['count']=_0x1a37f4;if(_0x233546['query'][_0x71fe('0x40')]){_0x2def09[_0x71fe('0x41')]=[{'all':!![]}];}return db[_0x71fe('0x2d')][_0x71fe('0x42')](_0x2def09);})[_0x71fe('0x27')](function(_0x446d6a){_0x3d3be3[_0x71fe('0x43')]=_0x446d6a;return _0x3d3be3;})[_0x71fe('0x27')](respondWithFilteredResult(_0x408871,_0x2def09))[_0x71fe('0x44')](handleError(_0x408871,null));};exports[_0x71fe('0x45')]=function(_0x4f00db,_0x3e8709){var _0x3f9181={'raw':![],'where':{'id':_0x4f00db['params']['id']}},_0x5be198={};_0x5be198[_0x71fe('0x32')]=_[_0x71fe('0x46')](db['SalesforceAccount'][_0x71fe('0x2e')]);_0x5be198['query']=_['keys'](_0x4f00db[_0x71fe('0x33')]);_0x5be198[_0x71fe('0x34')]=_[_0x71fe('0x36')](_0x5be198['model'],_0x5be198[_0x71fe('0x33')]);_0x3f9181[_0x71fe('0x35')]=_[_0x71fe('0x36')](_0x5be198[_0x71fe('0x32')],qs[_0x71fe('0x37')](_0x4f00db['query'][_0x71fe('0x37')]));_0x3f9181[_0x71fe('0x35')]=_0x3f9181[_0x71fe('0x35')]['length']?_0x3f9181['attributes']:_0x5be198[_0x71fe('0x32')];if(_0x4f00db[_0x71fe('0x33')][_0x71fe('0x40')]){_0x3f9181['include']=[{'all':!![]}];}_0x3f9181=_[_0x71fe('0x47')]({},_0x3f9181,_0x4f00db[_0x71fe('0x48')]);return db[_0x71fe('0x2d')][_0x71fe('0x49')](_0x3f9181)['then'](handleEntityNotFound(_0x3e8709,null))[_0x71fe('0x27')](respondWithResult(_0x3e8709,null))[_0x71fe('0x44')](handleError(_0x3e8709,null));};exports[_0x71fe('0x4a')]=function(_0x5e6b56,_0x3f055b){return db['SalesforceAccount'][_0x71fe('0x4a')](_0x5e6b56[_0x71fe('0x4b')],{})[_0x71fe('0x27')](respondWithResult(_0x3f055b,0xc9))['catch'](handleError(_0x3f055b,null));};exports[_0x71fe('0x26')]=function(_0x2c083c,_0x45175e){if(_0x2c083c[_0x71fe('0x4b')]['id']){delete _0x2c083c['body']['id'];}return db[_0x71fe('0x2d')][_0x71fe('0x49')]({'where':{'id':_0x2c083c['params']['id']}})['then'](handleEntityNotFound(_0x45175e,null))[_0x71fe('0x27')](saveUpdates(_0x2c083c['body'],null))['then'](respondWithResult(_0x45175e,null))[_0x71fe('0x44')](handleError(_0x45175e,null));};exports[_0x71fe('0x4c')]=function(_0x459b5f,_0x4d738e){return db['SalesforceAccount'][_0x71fe('0x49')]({'where':{'id':_0x459b5f['params']['id']}})[_0x71fe('0x27')](handleEntityNotFound(_0x4d738e,null))['then'](removeEntity(_0x4d738e,null))[_0x71fe('0x44')](handleError(_0x4d738e,null));};exports['getConfigurations']=function(_0x4a8ab2,_0x51f7ef,_0x1db2d8){var _0x244f39={};var _0x12204f={};var _0x318209;var _0x1943e4;return db[_0x71fe('0x2d')]['findOne']({'where':{'id':_0x4a8ab2[_0x71fe('0x4d')]['id']}})[_0x71fe('0x27')](handleEntityNotFound(_0x51f7ef,null))['then'](function(_0x664d39){if(_0x664d39){_0x318209=_0x664d39;_0x12204f['model']=_[_0x71fe('0x46')](db[_0x71fe('0x4e')][_0x71fe('0x2e')]);_0x12204f['query']=_['keys'](_0x4a8ab2[_0x71fe('0x33')]);_0x12204f[_0x71fe('0x34')]=_['intersection'](_0x12204f[_0x71fe('0x32')],_0x12204f[_0x71fe('0x33')]);_0x244f39[_0x71fe('0x35')]=_[_0x71fe('0x36')](_0x12204f['model'],qs[_0x71fe('0x37')](_0x4a8ab2['query'][_0x71fe('0x37')]));_0x244f39[_0x71fe('0x35')]=_0x244f39[_0x71fe('0x35')][_0x71fe('0x38')]?_0x244f39[_0x71fe('0x35')]:_0x12204f['model'];_0x244f39['order']=qs[_0x71fe('0x3b')](_0x4a8ab2[_0x71fe('0x33')][_0x71fe('0x3b')]);_0x244f39[_0x71fe('0x3d')]=qs[_0x71fe('0x34')](_[_0x71fe('0x3c')](_0x4a8ab2[_0x71fe('0x33')],_0x12204f[_0x71fe('0x34')]));if(_0x4a8ab2['query'][_0x71fe('0x3f')]){_0x244f39['where']=_[_0x71fe('0x47')](_0x244f39[_0x71fe('0x3d')],{'$or':_['map'](_0x244f39['attributes'],function(_0x30cb91){var _0x352ee3={};_0x352ee3[_0x30cb91]={'$like':'%'+_0x4a8ab2[_0x71fe('0x33')][_0x71fe('0x3f')]+'%'};return _0x352ee3;})});}_0x244f39=_['merge']({},_0x244f39,_0x4a8ab2[_0x71fe('0x48')]);return _0x318209['getConfigurations'](_0x244f39);}})[_0x71fe('0x27')](function(_0x4caa7a){if(_0x4caa7a){_0x1943e4=_0x4caa7a[_0x71fe('0x38')];if(!_0x4a8ab2['query'][_0x71fe('0x4f')](_0x71fe('0x39'))){_0x244f39[_0x71fe('0x3a')]=qs[_0x71fe('0x3a')](_0x4a8ab2[_0x71fe('0x33')][_0x71fe('0x3a')]);_0x244f39['offset']=qs[_0x71fe('0x20')](_0x4a8ab2[_0x71fe('0x33')][_0x71fe('0x20')]);}return _0x318209[_0x71fe('0x50')](_0x244f39);}})[_0x71fe('0x27')](function(_0x10e068){if(_0x10e068){return _0x10e068?{'count':_0x1943e4,'rows':_0x10e068}:null;}})[_0x71fe('0x27')](respondWithResult(_0x51f7ef,null))[_0x71fe('0x44')](handleError(_0x51f7ef,null));};exports[_0x71fe('0x51')]=function(_0x494e4f,_0x1a423d,_0x5d35eb){if(_0x494e4f[_0x71fe('0x4b')]['id']){delete _0x494e4f['body']['id'];}return db[_0x71fe('0x2d')][_0x71fe('0x52')]({'where':{'id':_0x494e4f[_0x71fe('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1a423d,null))[_0x71fe('0x27')](function(_0x2d68ab){if(_0x2d68ab){_0x494e4f[_0x71fe('0x4b')][_0x71fe('0x53')]=_0x2d68ab['id'];_0x494e4f[_0x71fe('0x4b')][_0x71fe('0x54')]=integrations[_0x71fe('0x55')](_0x494e4f[_0x71fe('0x4b')][_0x71fe('0x56')],_0x494e4f[_0x71fe('0x4b')][_0x71fe('0x30')]);_0x494e4f[_0x71fe('0x4b')][_0x71fe('0x57')]=integrations[_0x71fe('0x58')](_0x494e4f[_0x71fe('0x4b')]['channel'],_0x494e4f[_0x71fe('0x4b')][_0x71fe('0x30')]);return db[_0x71fe('0x4e')][_0x71fe('0x4a')](_0x494e4f[_0x71fe('0x4b')],{'include':[{'model':db[_0x71fe('0x59')],'as':_0x71fe('0x54')},{'model':db[_0x71fe('0x59')],'as':_0x71fe('0x57')}]});}return null;})[_0x71fe('0x27')](respondWithResult(_0x1a423d,null))[_0x71fe('0x44')](handleError(_0x1a423d,null));};exports[_0x71fe('0x5a')]=function(_0x398406,_0x311186,_0x22d1f2){var _0x15dcf2;var _0x5e5cca='';var _0x22175a='Task';return db[_0x71fe('0x2d')][_0x71fe('0x52')]({'where':{'id':_0x398406['params']['id']},'attributes':['id',_0x71fe('0x5b'),'clientId',_0x71fe('0x5c'),_0x71fe('0x5d'),'password','securityToken']})[_0x71fe('0x27')](handleEntityNotFound(_0x311186,null))[_0x71fe('0x27')](function(_0x27795c){if(_0x27795c){_0x5e5cca=_0x27795c['remoteUri'];var _0x242486=_0x5e5cca[_0x71fe('0x5e')](-0x1);if(_0x242486==='/'){_0x5e5cca=_0x5e5cca[_0x71fe('0x5f')](0x0,_0x5e5cca['lastIndexOf'](_0x242486));}_0x15dcf2=new jsforce[(_0x71fe('0x60'))]({'oauth2':{'loginUrl':_0x5e5cca,'clientId':_0x27795c['clientId'],'clientSecret':_0x27795c[_0x71fe('0x5c')]}});return _0x15dcf2['login'](_0x27795c[_0x71fe('0x5d')],_0x27795c[_0x71fe('0x61')][_0x71fe('0x62')](_0x27795c[_0x71fe('0x63')]));}})[_0x71fe('0x27')](function(_0x296f67){if(_0x296f67){if(!_[_0x71fe('0x64')](_0x398406[_0x71fe('0x33')]['ticketType'])){_0x22175a=_0x398406[_0x71fe('0x33')][_0x71fe('0x65')];}return _0x15dcf2[_0x71fe('0x66')](_0x22175a)[_0x71fe('0x67')]();}})[_0x71fe('0x27')](function(_0x1bb575){var _0x34d878=['OwnerId',_0x71fe('0x68'),'IsReminderSet',_0x71fe('0x69'),_0x71fe('0x6a'),'Description'];var _0x3a74f6=['string',_0x71fe('0x6b'),'picklist',_0x71fe('0x6c'),'email',_0x71fe('0x6d'),_0x71fe('0x6e')];if(_0x1bb575){_[_0x71fe('0x6f')](_0x1bb575[_0x71fe('0x37')],function(_0x161453){return _0x34d878[_0x71fe('0x70')](_0x161453[_0x71fe('0x29')])||!_0x3a74f6[_0x71fe('0x70')](_0x161453[_0x71fe('0x30')]);});return{'count':_0x1bb575[_0x71fe('0x37')]['length'],'rows':_[_0x71fe('0x2c')](_0x1bb575[_0x71fe('0x37')],function(_0x2360ac){return{'id':_0x2360ac[_0x71fe('0x29')],'name':_0x2360ac[_0x71fe('0x71')],'custom':_0x2360ac['custom'],'options':_0x2360ac[_0x71fe('0x72')][_0x71fe('0x38')]>0x0?_['map'](_0x2360ac[_0x71fe('0x72')],function(_0x587997){return{'name':_0x587997[_0x71fe('0x71')],'value':_0x587997[_0x71fe('0x73')]};}):_0x2360ac[_0x71fe('0x30')]==_0x71fe('0x6c')?[{'name':_0x71fe('0x74'),'value':_0x71fe('0x75')},{'name':_0x71fe('0x76'),'value':'false'}]:[]};})};}})[_0x71fe('0x27')](respondWithResult(_0x311186,null))[_0x71fe('0x44')](function(_0x3da75e){var _0x22987c=_0x398406[_0x71fe('0x33')]['test']?0x1f4:_0x3da75e[_0x71fe('0x77')]||0x1f4;logger[_0x71fe('0x78')](_0x71fe('0x79'),_0x71fe('0x5a'),_0x22987c,JSON[_0x71fe('0x7a')](_0x3da75e));delete _0x3da75e[_0x71fe('0x29')];if(_0x22987c===0x191){_0x22987c=0x190;}_0x311186[_0x71fe('0x1d')](_0x22987c)['send'](_0x398406['query']['test']?{'message':_0x71fe('0x7b'),'statusCode':_0x3da75e[_0x71fe('0x77')]}:_0x3da75e);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 6549619..80d5a8e 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 _0x4d56=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4d56,0x16a));var _0x64d5=function(_0x5177ee,_0x4071b2){_0x5177ee=_0x5177ee-0x0;var _0x2ecbce=_0x4d56[_0x5177ee];return _0x2ecbce;};'use strict';var _=require(_0x64d5('0x0'));var util=require(_0x64d5('0x1'));var logger=require(_0x64d5('0x2'))('api');var moment=require(_0x64d5('0x3'));var BPromise=require(_0x64d5('0x4'));var rp=require(_0x64d5('0x5'));var fs=require('fs');var path=require(_0x64d5('0x6'));var rimraf=require(_0x64d5('0x7'));var config=require(_0x64d5('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x64d5('0x9'));module[_0x64d5('0xa')]=function(_0x32b468,_0x529322){return _0x32b468[_0x64d5('0xb')](_0x64d5('0xc'),attributes,{'tableName':_0x64d5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fc3=['rimraf','../../config/environment','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x3fc3,0x110));var _0x33fc=function(_0x28a81e,_0xc5298b){_0x28a81e=_0x28a81e-0x0;var _0x5ce4ff=_0x3fc3[_0x28a81e];return _0x5ce4ff;};'use strict';var _=require(_0x33fc('0x0'));var util=require(_0x33fc('0x1'));var logger=require(_0x33fc('0x2'))(_0x33fc('0x3'));var moment=require(_0x33fc('0x4'));var BPromise=require(_0x33fc('0x5'));var rp=require(_0x33fc('0x6'));var fs=require('fs');var path=require(_0x33fc('0x7'));var rimraf=require(_0x33fc('0x8'));var config=require(_0x33fc('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x33fc('0xa'));module['exports']=function(_0x5a4627,_0x5607df){return _0x5a4627[_0x33fc('0xb')](_0x33fc('0xc'),attributes,{'tableName':_0x33fc('0xd'),'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 f227257..0f5788b 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 _0xb6d4=['info','find','where','ShowSalesforceAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xb6d4,0x16c));var _0x4b6d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb6d4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x4b6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4b6d('0x1'));var rs=require(_0x4b6d('0x2'));var fs=require('fs');var Redis=require(_0x4b6d('0x3'));var db=require(_0x4b6d('0x4'))['db'];var utils=require(_0x4b6d('0x5'));var logger=require('../../config/logger')(_0x4b6d('0x6'));var config=require(_0x4b6d('0x7'));var jayson=require(_0x4b6d('0x8'));var client=jayson[_0x4b6d('0x9')][_0x4b6d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x286763,_0x1e7a81,_0x2ab494){return new BPromise(function(_0x1b0ce2,_0x1ffaca){return client[_0x4b6d('0xb')](_0x286763,_0x2ab494)[_0x4b6d('0xc')](function(_0x4a6b36){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x1e7a81,'request\x20sent');logger[_0x4b6d('0xd')](_0x4b6d('0xe'),_0x1e7a81,_0x4b6d('0xf'),JSON[_0x4b6d('0x10')](_0x4a6b36));if(_0x4a6b36[_0x4b6d('0x11')]){if(_0x4a6b36['error']['code']===0x1f4){logger[_0x4b6d('0x11')](_0x4b6d('0x12'),_0x1e7a81,_0x4a6b36['error']['message']);return _0x1ffaca(_0x4a6b36[_0x4b6d('0x11')][_0x4b6d('0x13')]);}logger[_0x4b6d('0x11')](_0x4b6d('0x12'),_0x1e7a81,_0x4a6b36[_0x4b6d('0x11')][_0x4b6d('0x13')]);return _0x1b0ce2(_0x4a6b36[_0x4b6d('0x11')]['message']);}else{logger['info'](_0x4b6d('0x12'),_0x1e7a81,_0x4b6d('0xf'));_0x1b0ce2(_0x4a6b36[_0x4b6d('0x14')][_0x4b6d('0x13')]);}})[_0x4b6d('0x15')](function(_0x5d5076){logger[_0x4b6d('0x11')](_0x4b6d('0x12'),_0x1e7a81,_0x5d5076);_0x1ffaca(_0x5d5076);});});}exports[_0x4b6d('0x16')]=function(_0x3e8079){var _0x688a6b=this;return new Promise(function(_0x4a0d36,_0x39ea0f){return db[_0x4b6d('0x17')][_0x4b6d('0x18')]({'raw':_0x3e8079[_0x4b6d('0x19')]?_0x3e8079['options'][_0x4b6d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e8079[_0x4b6d('0x19')]?_0x3e8079['options']['where']||null:null,'attributes':_0x3e8079[_0x4b6d('0x19')]?_0x3e8079['options'][_0x4b6d('0x1b')]||null:null,'limit':_0x3e8079[_0x4b6d('0x19')]?_0x3e8079[_0x4b6d('0x19')][_0x4b6d('0x1c')]||null:null,'include':_0x3e8079[_0x4b6d('0x19')]?_0x3e8079[_0x4b6d('0x19')][_0x4b6d('0x1d')]?_[_0x4b6d('0x1e')](_0x3e8079[_0x4b6d('0x19')][_0x4b6d('0x1d')],function(_0x4e9b1f){return{'model':db[_0x4e9b1f[_0x4b6d('0x1f')]],'as':_0x4e9b1f['as'],'attributes':_0x4e9b1f[_0x4b6d('0x1b')],'include':_0x4e9b1f[_0x4b6d('0x1d')]?_[_0x4b6d('0x1e')](_0x4e9b1f['include'],function(_0x1fcda1){return{'model':db[_0x1fcda1[_0x4b6d('0x1f')]],'as':_0x1fcda1['as'],'attributes':_0x1fcda1[_0x4b6d('0x1b')],'include':_0x1fcda1['include']?_['map'](_0x1fcda1['include'],function(_0x525ddd){return{'model':db[_0x525ddd[_0x4b6d('0x1f')]],'as':_0x525ddd['as'],'attributes':_0x525ddd['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b6d('0xc')](function(_0x2fd6f7){logger[_0x4b6d('0x20')](_0x4b6d('0x16'),_0x3e8079);logger[_0x4b6d('0xd')](_0x4b6d('0x16'),_0x3e8079,JSON[_0x4b6d('0x10')](_0x2fd6f7));_0x4a0d36(_0x2fd6f7);})[_0x4b6d('0x15')](function(_0x446e2a){logger[_0x4b6d('0x11')](_0x4b6d('0x16'),_0x446e2a['message'],_0x3e8079);_0x39ea0f(_0x688a6b['error'](0x1f4,_0x446e2a[_0x4b6d('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x1b0c03){var _0x52c9b5=this;return new Promise(function(_0x4709e9,_0x37b436){return db[_0x4b6d('0x17')][_0x4b6d('0x21')]({'raw':_0x1b0c03[_0x4b6d('0x19')]?_0x1b0c03[_0x4b6d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1b0c03[_0x4b6d('0x19')]?_0x1b0c03[_0x4b6d('0x19')][_0x4b6d('0x22')]||null:null,'attributes':_0x1b0c03[_0x4b6d('0x19')]?_0x1b0c03[_0x4b6d('0x19')][_0x4b6d('0x1b')]||null:null,'include':_0x1b0c03['options']?_0x1b0c03[_0x4b6d('0x19')][_0x4b6d('0x1d')]?_[_0x4b6d('0x1e')](_0x1b0c03[_0x4b6d('0x19')][_0x4b6d('0x1d')],function(_0x2bac47){return{'model':db[_0x2bac47['model']],'as':_0x2bac47['as'],'attributes':_0x2bac47['attributes'],'include':_0x2bac47[_0x4b6d('0x1d')]?_[_0x4b6d('0x1e')](_0x2bac47['include'],function(_0x357d6b){return{'model':db[_0x357d6b[_0x4b6d('0x1f')]],'as':_0x357d6b['as'],'attributes':_0x357d6b[_0x4b6d('0x1b')],'include':_0x357d6b[_0x4b6d('0x1d')]?_['map'](_0x357d6b[_0x4b6d('0x1d')],function(_0x11e55d){return{'model':db[_0x11e55d[_0x4b6d('0x1f')]],'as':_0x11e55d['as'],'attributes':_0x11e55d[_0x4b6d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d3b7b){logger[_0x4b6d('0x20')](_0x4b6d('0x23'),_0x1b0c03);logger[_0x4b6d('0xd')]('ShowSalesforceAccount',_0x1b0c03,JSON[_0x4b6d('0x10')](_0x2d3b7b));_0x4709e9(_0x2d3b7b);})['catch'](function(_0x5080d7){logger[_0x4b6d('0x11')](_0x4b6d('0x23'),_0x5080d7['message'],_0x1b0c03);_0x37b436(_0x52c9b5['error'](0x1f4,_0x5080d7[_0x4b6d('0x13')]));});});}; \ No newline at end of file +var _0xb7b4=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','model','attributes','then','find','raw','ShowSalesforceAccount','catch','lodash','util','moment'];(function(_0x3d3d7b,_0x5c0937){var _0x33e7c8=function(_0xe0ee81){while(--_0xe0ee81){_0x3d3d7b['push'](_0x3d3d7b['shift']());}};_0x33e7c8(++_0x5c0937);}(_0xb7b4,0x1ad));var _0x4b7b=function(_0x55c79c,_0x5a8d94){_0x55c79c=_0x55c79c-0x0;var _0x165213=_0xb7b4[_0x55c79c];return _0x165213;};'use strict';var _=require(_0x4b7b('0x0'));var util=require(_0x4b7b('0x1'));var moment=require(_0x4b7b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b7b('0x3'));var db=require(_0x4b7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b7b('0x5'))(_0x4b7b('0x6'));var config=require(_0x4b7b('0x7'));var jayson=require(_0x4b7b('0x8'));var client=jayson[_0x4b7b('0x9')][_0x4b7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36fbfa,_0x147c06,_0x41bfb0){return new BPromise(function(_0x37fcef,_0x2299a0){return client[_0x4b7b('0xb')](_0x36fbfa,_0x41bfb0)['then'](function(_0x355389){logger['info'](_0x4b7b('0xc'),_0x147c06,_0x4b7b('0xd'));logger[_0x4b7b('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x147c06,_0x4b7b('0xd'),JSON[_0x4b7b('0xf')](_0x355389));if(_0x355389[_0x4b7b('0x10')]){if(_0x355389[_0x4b7b('0x10')][_0x4b7b('0x11')]===0x1f4){logger[_0x4b7b('0x10')](_0x4b7b('0xc'),_0x147c06,_0x355389[_0x4b7b('0x10')][_0x4b7b('0x12')]);return _0x2299a0(_0x355389['error'][_0x4b7b('0x12')]);}logger[_0x4b7b('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x147c06,_0x355389[_0x4b7b('0x10')][_0x4b7b('0x12')]);return _0x37fcef(_0x355389[_0x4b7b('0x10')][_0x4b7b('0x12')]);}else{logger[_0x4b7b('0x13')](_0x4b7b('0xc'),_0x147c06,'request\x20sent');_0x37fcef(_0x355389[_0x4b7b('0x14')]['message']);}})['catch'](function(_0x19b294){logger[_0x4b7b('0x10')](_0x4b7b('0xc'),_0x147c06,_0x19b294);_0x2299a0(_0x19b294);});});}exports[_0x4b7b('0x15')]=function(_0x167171){var _0x80d054=this;return new Promise(function(_0x590f83,_0x209215){return db[_0x4b7b('0x16')][_0x4b7b('0x17')]({'raw':_0x167171[_0x4b7b('0x18')]?_0x167171[_0x4b7b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x167171[_0x4b7b('0x18')]?_0x167171[_0x4b7b('0x18')][_0x4b7b('0x19')]||null:null,'attributes':_0x167171[_0x4b7b('0x18')]?_0x167171[_0x4b7b('0x18')]['attributes']||null:null,'limit':_0x167171[_0x4b7b('0x18')]?_0x167171['options'][_0x4b7b('0x1a')]||null:null,'include':_0x167171[_0x4b7b('0x18')]?_0x167171['options'][_0x4b7b('0x1b')]?_[_0x4b7b('0x1c')](_0x167171[_0x4b7b('0x18')][_0x4b7b('0x1b')],function(_0x482386){return{'model':db[_0x482386[_0x4b7b('0x1d')]],'as':_0x482386['as'],'attributes':_0x482386[_0x4b7b('0x1e')],'include':_0x482386[_0x4b7b('0x1b')]?_[_0x4b7b('0x1c')](_0x482386[_0x4b7b('0x1b')],function(_0x308768){return{'model':db[_0x308768['model']],'as':_0x308768['as'],'attributes':_0x308768[_0x4b7b('0x1e')],'include':_0x308768[_0x4b7b('0x1b')]?_[_0x4b7b('0x1c')](_0x308768[_0x4b7b('0x1b')],function(_0x5effd2){return{'model':db[_0x5effd2['model']],'as':_0x5effd2['as'],'attributes':_0x5effd2[_0x4b7b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b7b('0x1f')](function(_0x4a22fa){logger['info'](_0x4b7b('0x15'),_0x167171);logger[_0x4b7b('0xe')](_0x4b7b('0x15'),_0x167171,JSON['stringify'](_0x4a22fa));_0x590f83(_0x4a22fa);})['catch'](function(_0x228e96){logger[_0x4b7b('0x10')](_0x4b7b('0x15'),_0x228e96['message'],_0x167171);_0x209215(_0x80d054[_0x4b7b('0x10')](0x1f4,_0x228e96[_0x4b7b('0x12')]));});});};exports['ShowSalesforceAccount']=function(_0x4a81ce){var _0x31640a=this;return new Promise(function(_0x293300,_0x1d703c){return db[_0x4b7b('0x16')][_0x4b7b('0x20')]({'raw':_0x4a81ce[_0x4b7b('0x18')]?_0x4a81ce[_0x4b7b('0x18')][_0x4b7b('0x21')]===undefined?!![]:![]:!![],'where':_0x4a81ce[_0x4b7b('0x18')]?_0x4a81ce[_0x4b7b('0x18')][_0x4b7b('0x19')]||null:null,'attributes':_0x4a81ce[_0x4b7b('0x18')]?_0x4a81ce[_0x4b7b('0x18')][_0x4b7b('0x1e')]||null:null,'include':_0x4a81ce['options']?_0x4a81ce['options'][_0x4b7b('0x1b')]?_[_0x4b7b('0x1c')](_0x4a81ce['options'][_0x4b7b('0x1b')],function(_0x1e14af){return{'model':db[_0x1e14af[_0x4b7b('0x1d')]],'as':_0x1e14af['as'],'attributes':_0x1e14af[_0x4b7b('0x1e')],'include':_0x1e14af[_0x4b7b('0x1b')]?_[_0x4b7b('0x1c')](_0x1e14af[_0x4b7b('0x1b')],function(_0x5ad2a3){return{'model':db[_0x5ad2a3['model']],'as':_0x5ad2a3['as'],'attributes':_0x5ad2a3[_0x4b7b('0x1e')],'include':_0x5ad2a3['include']?_['map'](_0x5ad2a3[_0x4b7b('0x1b')],function(_0x177936){return{'model':db[_0x177936[_0x4b7b('0x1d')]],'as':_0x177936['as'],'attributes':_0x177936[_0x4b7b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b7b('0x1f')](function(_0x1c1c63){logger[_0x4b7b('0x13')](_0x4b7b('0x22'),_0x4a81ce);logger[_0x4b7b('0xe')](_0x4b7b('0x22'),_0x4a81ce,JSON[_0x4b7b('0xf')](_0x1c1c63));_0x293300(_0x1c1c63);})[_0x4b7b('0x23')](function(_0x22bbbc){logger[_0x4b7b('0x10')](_0x4b7b('0x22'),_0x22bbbc[_0x4b7b('0x12')],_0x4a81ce);_0x1d703c(_0x31640a[_0x4b7b('0x10')](0x1f4,_0x22bbbc[_0x4b7b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index fd9006b..07000c7 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x36836a,_0x246186){var _0xf2b88f=function(_0x154657){while(--_0x154657){_0x36836a['push'](_0x36836a['shift']());}};_0xf2b88f(++_0x246186);}(_0xadb5,0xad));var _0x5adb=function(_0x20dbff,_0x2af5a7){_0x20dbff=_0x20dbff-0x0;var _0x19e5da=_0xadb5[_0x20dbff];return _0x19e5da;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x15667f,_0x2396df){var _0x4eea5d=function(_0x3715ad){while(--_0x3715ad){_0x15667f['push'](_0x15667f['shift']());}};_0x4eea5d(++_0x2396df);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 2889afd..fd00310 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 _0x6b15=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize'];(function(_0x14cadd,_0x18f999){var _0x1d63f9=function(_0x5cbc6c){while(--_0x5cbc6c){_0x14cadd['push'](_0x14cadd['shift']());}};_0x1d63f9(++_0x18f999);}(_0x6b15,0x167));var _0x56b1=function(_0x409f7a,_0x18d6f0){_0x409f7a=_0x409f7a-0x0;var _0x2a5afc=_0x6b15[_0x409f7a];return _0x2a5afc;};'use strict';var Sequelize=require(_0x56b1('0x0'));module[_0x56b1('0x1')]={'name':{'type':Sequelize[_0x56b1('0x2')]},'description':{'type':Sequelize[_0x56b1('0x2')]},'ticketType':{'type':Sequelize[_0x56b1('0x3')](_0x56b1('0x4'),_0x56b1('0x5')),'defaultValue':_0x56b1('0x4')},'moduleSearch':{'type':Sequelize[_0x56b1('0x3')](_0x56b1('0x6'),_0x56b1('0x7'),_0x56b1('0x8'),_0x56b1('0x9'),_0x56b1('0xa')),'defaultValue':_0x56b1('0x6')},'moduleCreate':{'type':Sequelize['ENUM'](_0x56b1('0xb'),_0x56b1('0x7'),_0x56b1('0x8'),_0x56b1('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x56b1('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x56b1('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x56b1('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6d93=['account_contact_lead','account','contact_lead','sequelize','STRING','ENUM','Task','contact','lead'];(function(_0x192312,_0xd59aa3){var _0x319623=function(_0x294292){while(--_0x294292){_0x192312['push'](_0x192312['shift']());}};_0x319623(++_0xd59aa3);}(_0x6d93,0x16b));var _0x36d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d93[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x36d9('0x0'));module['exports']={'name':{'type':Sequelize[_0x36d9('0x1')]},'description':{'type':Sequelize[_0x36d9('0x1')]},'ticketType':{'type':Sequelize[_0x36d9('0x2')](_0x36d9('0x3'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x36d9('0x4'),_0x36d9('0x5'),_0x36d9('0x6'),_0x36d9('0x7')),'defaultValue':_0x36d9('0x8')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x36d9('0x4'),_0x36d9('0x5'),_0x36d9('0x7')),'defaultValue':_0x36d9('0x5')},'leadId':{'type':Sequelize[_0x36d9('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x36d9('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x36d9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index e14fb1a..fcb7c67 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 _0x2f7e=['limit','count','set','apply','reject','save','then','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','getFields','findOne','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x1c4cc0,_0x310626){var _0x22e823=function(_0x4a258d){while(--_0x4a258d){_0x1c4cc0['push'](_0x1c4cc0['shift']());}};_0x22e823(++_0x310626);}(_0x2f7e,0x122));var _0xe2f7=function(_0x8dbefc,_0x17f8d9){_0x8dbefc=_0x8dbefc-0x0;var _0xa4a78d=_0x2f7e[_0x8dbefc];return _0xa4a78d;};'use strict';var emlformat=require(_0xe2f7('0x0'));var rimraf=require(_0xe2f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe2f7('0x2'));var rp=require(_0xe2f7('0x3'));var moment=require(_0xe2f7('0x4'));var BPromise=require(_0xe2f7('0x5'));var Mustache=require(_0xe2f7('0x6'));var util=require(_0xe2f7('0x7'));var path=require(_0xe2f7('0x8'));var sox=require(_0xe2f7('0x9'));var csv=require(_0xe2f7('0xa'));var ejs=require(_0xe2f7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe2f7('0xc'));var squel=require(_0xe2f7('0xd'));var crypto=require(_0xe2f7('0xe'));var jsforce=require(_0xe2f7('0xf'));var deskjs=require(_0xe2f7('0x10'));var toCsv=require(_0xe2f7('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe2f7('0x11'));var authService=require(_0xe2f7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe2f7('0x13'));var hardwareService=require(_0xe2f7('0x14'));var logger=require(_0xe2f7('0x15'))(_0xe2f7('0x16'));var utils=require(_0xe2f7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe2f7('0x18'))['db'];function respondWithStatusCode(_0x2da8ff,_0x5ad7da){_0x5ad7da=_0x5ad7da||0xcc;return function(_0xa24025){if(_0xa24025){return _0x2da8ff[_0xe2f7('0x19')](_0x5ad7da);}return _0x2da8ff[_0xe2f7('0x1a')](_0x5ad7da)['end']();};}function respondWithResult(_0x548d38,_0x3b9eb6){_0x3b9eb6=_0x3b9eb6||0xc8;return function(_0x1e96c5){if(_0x1e96c5){return _0x548d38[_0xe2f7('0x1a')](_0x3b9eb6)[_0xe2f7('0x1b')](_0x1e96c5);}};}function respondWithFilteredResult(_0xeee28a,_0x5b275f){return function(_0x428a55){if(_0x428a55){var _0x30e6a1=typeof _0x5b275f[_0xe2f7('0x1c')]===_0xe2f7('0x1d')&&typeof _0x5b275f[_0xe2f7('0x1e')]===_0xe2f7('0x1d');var _0x3e226f=_0x428a55['count'];var _0x41d96a=_0x30e6a1?0x0:_0x5b275f[_0xe2f7('0x1c')];var _0x3b6984=_0x30e6a1?_0x428a55[_0xe2f7('0x1f')]:_0x5b275f['offset']+_0x5b275f[_0xe2f7('0x1e')];var _0x2a9b8b;if(_0x3b6984>=_0x3e226f){_0x3b6984=_0x3e226f;_0x2a9b8b=0xc8;}else{_0x2a9b8b=0xce;}_0xeee28a[_0xe2f7('0x1a')](_0x2a9b8b);return _0xeee28a[_0xe2f7('0x20')]('Content-Range',_0x41d96a+'-'+_0x3b6984+'/'+_0x3e226f)[_0xe2f7('0x1b')](_0x428a55);}return null;};}function patchUpdates(_0x3affd7){return function(_0x2fbf0a){try{jsonpatch[_0xe2f7('0x21')](_0x2fbf0a,_0x3affd7,!![]);}catch(_0x2c71d7){return BPromise[_0xe2f7('0x22')](_0x2c71d7);}return _0x2fbf0a[_0xe2f7('0x23')]();};}function saveUpdates(_0x2f338f,_0x662fac){return function(_0x3b76bc){if(_0x3b76bc){return _0x3b76bc['update'](_0x2f338f)[_0xe2f7('0x24')](function(_0x1b67e9){return _0x1b67e9;});}return null;};}function removeEntity(_0x1058a9,_0x49e09a){return function(_0x1e47a4){if(_0x1e47a4){return _0x1e47a4['destroy']()['then'](function(){_0x1058a9[_0xe2f7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c29b3,_0x1b49d8){return function(_0x123ee6){if(!_0x123ee6){_0x2c29b3['sendStatus'](0x194);}return _0x123ee6;};}function handleError(_0x23dfe2,_0x52158f){_0x52158f=_0x52158f||0x1f4;return function(_0x4561e4){logger[_0xe2f7('0x25')](_0x4561e4[_0xe2f7('0x26')]);if(_0x4561e4[_0xe2f7('0x27')]){delete _0x4561e4[_0xe2f7('0x27')];}_0x23dfe2[_0xe2f7('0x1a')](_0x52158f)[_0xe2f7('0x28')](_0x4561e4);};}exports['index']=function(_0x345465,_0x377c61){var _0x365966={},_0x10baa3={},_0x5162c2={'count':0x0,'rows':[]};var _0x13ddb8=_[_0xe2f7('0x29')](db[_0xe2f7('0x2a')][_0xe2f7('0x2b')],function(_0x594159){return{'name':_0x594159[_0xe2f7('0x2c')],'type':_0x594159['type'][_0xe2f7('0x2d')]};});_0x10baa3['model']=_[_0xe2f7('0x29')](_0x13ddb8,_0xe2f7('0x27'));_0x10baa3[_0xe2f7('0x2e')]=_['keys'](_0x345465[_0xe2f7('0x2e')]);_0x10baa3['filters']=_['intersection'](_0x10baa3[_0xe2f7('0x2f')],_0x10baa3['query']);_0x365966[_0xe2f7('0x30')]=_[_0xe2f7('0x31')](_0x10baa3[_0xe2f7('0x2f')],qs[_0xe2f7('0x32')](_0x345465[_0xe2f7('0x2e')]['fields']));_0x365966[_0xe2f7('0x30')]=_0x365966[_0xe2f7('0x30')][_0xe2f7('0x33')]?_0x365966[_0xe2f7('0x30')]:_0x10baa3['model'];if(!_0x345465[_0xe2f7('0x2e')][_0xe2f7('0x34')](_0xe2f7('0x35'))){_0x365966['limit']=qs[_0xe2f7('0x1e')](_0x345465[_0xe2f7('0x2e')]['limit']);_0x365966[_0xe2f7('0x1c')]=qs[_0xe2f7('0x1c')](_0x345465[_0xe2f7('0x2e')][_0xe2f7('0x1c')]);}_0x365966[_0xe2f7('0x36')]=qs[_0xe2f7('0x37')](_0x345465[_0xe2f7('0x2e')][_0xe2f7('0x37')]);_0x365966['where']=qs['filters'](_[_0xe2f7('0x38')](_0x345465[_0xe2f7('0x2e')],_0x10baa3[_0xe2f7('0x39')]),_0x13ddb8);if(_0x345465[_0xe2f7('0x2e')]['filter']){_0x365966[_0xe2f7('0x3a')]=_['merge'](_0x365966[_0xe2f7('0x3a')],{'$or':_['map'](_0x13ddb8,function(_0x798768){if(_0x798768['type']!==_0xe2f7('0x3b')){var _0x5c3b07={};_0x5c3b07[_0x798768[_0xe2f7('0x27')]]={'$like':'%'+_0x345465[_0xe2f7('0x2e')][_0xe2f7('0x3c')]+'%'};return _0x5c3b07;}})});}_0x365966=_[_0xe2f7('0x3d')]({},_0x365966,_0x345465[_0xe2f7('0x3e')]);var _0x3e297c={'where':_0x365966[_0xe2f7('0x3a')]};return db[_0xe2f7('0x2a')]['count'](_0x3e297c)[_0xe2f7('0x24')](function(_0x4a0ae2){_0x5162c2[_0xe2f7('0x1f')]=_0x4a0ae2;if(_0x345465[_0xe2f7('0x2e')][_0xe2f7('0x3f')]){_0x365966[_0xe2f7('0x40')]=[{'all':!![]}];}return db[_0xe2f7('0x2a')][_0xe2f7('0x41')](_0x365966);})[_0xe2f7('0x24')](function(_0x1650ba){_0x5162c2[_0xe2f7('0x42')]=_0x1650ba;return _0x5162c2;})[_0xe2f7('0x24')](respondWithFilteredResult(_0x377c61,_0x365966))[_0xe2f7('0x43')](handleError(_0x377c61,null));};exports[_0xe2f7('0x44')]=function(_0x135c90,_0x1e1930){var _0x34a4f0={'raw':![],'where':{'id':_0x135c90[_0xe2f7('0x45')]['id']}},_0x4757a4={};_0x4757a4[_0xe2f7('0x2f')]=_['keys'](db[_0xe2f7('0x2a')][_0xe2f7('0x2b')]);_0x4757a4['query']=_[_0xe2f7('0x46')](_0x135c90[_0xe2f7('0x2e')]);_0x4757a4[_0xe2f7('0x39')]=_[_0xe2f7('0x31')](_0x4757a4[_0xe2f7('0x2f')],_0x4757a4[_0xe2f7('0x2e')]);_0x34a4f0[_0xe2f7('0x30')]=_['intersection'](_0x4757a4[_0xe2f7('0x2f')],qs['fields'](_0x135c90[_0xe2f7('0x2e')][_0xe2f7('0x32')]));_0x34a4f0[_0xe2f7('0x30')]=_0x34a4f0[_0xe2f7('0x30')]['length']?_0x34a4f0[_0xe2f7('0x30')]:_0x4757a4[_0xe2f7('0x2f')];if(_0x135c90[_0xe2f7('0x2e')][_0xe2f7('0x3f')]){_0x34a4f0[_0xe2f7('0x40')]=[{'all':!![]}];}_0x34a4f0=_['merge']({},_0x34a4f0,_0x135c90['options']);return db[_0xe2f7('0x2a')][_0xe2f7('0x47')](_0x34a4f0)['then'](handleEntityNotFound(_0x1e1930,null))[_0xe2f7('0x24')](respondWithResult(_0x1e1930,null))[_0xe2f7('0x43')](handleError(_0x1e1930,null));};exports[_0xe2f7('0x48')]=function(_0x403027,_0x97b57e){return db['SalesforceConfiguration'][_0xe2f7('0x48')](_0x403027['body'],{})[_0xe2f7('0x24')](respondWithResult(_0x97b57e,0xc9))[_0xe2f7('0x43')](handleError(_0x97b57e,null));};exports['update']=function(_0x4a0fdd,_0x6a8742){if(_0x4a0fdd[_0xe2f7('0x49')]['id']){delete _0x4a0fdd[_0xe2f7('0x49')]['id'];}return db[_0xe2f7('0x2a')][_0xe2f7('0x47')]({'where':{'id':_0x4a0fdd[_0xe2f7('0x45')]['id']}})[_0xe2f7('0x24')](handleEntityNotFound(_0x6a8742,null))[_0xe2f7('0x24')](saveUpdates(_0x4a0fdd[_0xe2f7('0x49')],null))[_0xe2f7('0x24')](respondWithResult(_0x6a8742,null))[_0xe2f7('0x43')](handleError(_0x6a8742,null));};exports[_0xe2f7('0x4a')]=function(_0x474616,_0x16d035){return db[_0xe2f7('0x2a')]['find']({'where':{'id':_0x474616['params']['id']}})[_0xe2f7('0x24')](handleEntityNotFound(_0x16d035,null))['then'](removeEntity(_0x16d035,null))['catch'](handleError(_0x16d035,null));};exports[_0xe2f7('0x4b')]=function(_0x5abb4d,_0x48aab6,_0x445ea4){var _0x25f2f3={};var _0x5903d6={};var _0x9e19ba;var _0x3bde75;return db[_0xe2f7('0x2a')][_0xe2f7('0x4c')]({'where':{'id':_0x5abb4d[_0xe2f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x48aab6,null))[_0xe2f7('0x24')](function(_0x59a416){if(_0x59a416){_0x9e19ba=_0x59a416;_0x5903d6[_0xe2f7('0x2f')]=_[_0xe2f7('0x46')](db['SalesforceField'][_0xe2f7('0x2b')]);_0x5903d6['query']=_['keys'](_0x5abb4d[_0xe2f7('0x2e')]);_0x5903d6[_0xe2f7('0x39')]=_['intersection'](_0x5903d6[_0xe2f7('0x2f')],_0x5903d6[_0xe2f7('0x2e')]);_0x25f2f3[_0xe2f7('0x30')]=_[_0xe2f7('0x31')](_0x5903d6[_0xe2f7('0x2f')],qs[_0xe2f7('0x32')](_0x5abb4d[_0xe2f7('0x2e')][_0xe2f7('0x32')]));_0x25f2f3['attributes']=_0x25f2f3[_0xe2f7('0x30')][_0xe2f7('0x33')]?_0x25f2f3['attributes']:_0x5903d6['model'];_0x25f2f3[_0xe2f7('0x36')]=qs[_0xe2f7('0x37')](_0x5abb4d['query'][_0xe2f7('0x37')]);_0x25f2f3[_0xe2f7('0x3a')]=qs[_0xe2f7('0x39')](_[_0xe2f7('0x38')](_0x5abb4d[_0xe2f7('0x2e')],_0x5903d6[_0xe2f7('0x39')]));if(_0x5abb4d[_0xe2f7('0x2e')][_0xe2f7('0x3c')]){_0x25f2f3[_0xe2f7('0x3a')]=_[_0xe2f7('0x3d')](_0x25f2f3[_0xe2f7('0x3a')],{'$or':_[_0xe2f7('0x29')](_0x25f2f3[_0xe2f7('0x30')],function(_0x48ae08){var _0x18ade5={};_0x18ade5[_0x48ae08]={'$like':'%'+_0x5abb4d[_0xe2f7('0x2e')][_0xe2f7('0x3c')]+'%'};return _0x18ade5;})});}_0x25f2f3=_[_0xe2f7('0x3d')]({},_0x25f2f3,_0x5abb4d['options']);return _0x9e19ba[_0xe2f7('0x4b')](_0x25f2f3);}})[_0xe2f7('0x24')](function(_0x300939){if(_0x300939){_0x3bde75=_0x300939['length'];if(!_0x5abb4d[_0xe2f7('0x2e')]['hasOwnProperty'](_0xe2f7('0x35'))){_0x25f2f3[_0xe2f7('0x1e')]=qs[_0xe2f7('0x1e')](_0x5abb4d[_0xe2f7('0x2e')][_0xe2f7('0x1e')]);_0x25f2f3[_0xe2f7('0x1c')]=qs[_0xe2f7('0x1c')](_0x5abb4d['query'][_0xe2f7('0x1c')]);}return _0x9e19ba[_0xe2f7('0x4b')](_0x25f2f3);}})[_0xe2f7('0x24')](function(_0x391550){if(_0x391550){return _0x391550?{'count':_0x3bde75,'rows':_0x391550}:null;}})[_0xe2f7('0x24')](respondWithResult(_0x48aab6,null))[_0xe2f7('0x43')](handleError(_0x48aab6,null));};exports[_0xe2f7('0x4d')]=function(_0x4bf841,_0x5d3e36,_0x1d3e16){var _0x14eaf3={};var _0x4fe325={};var _0xa66ca5;var _0xd1f24a;return db[_0xe2f7('0x2a')][_0xe2f7('0x4c')]({'where':{'id':_0x4bf841[_0xe2f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x5d3e36,null))[_0xe2f7('0x24')](function(_0xb9277){if(_0xb9277){_0xa66ca5=_0xb9277;_0x4fe325[_0xe2f7('0x2f')]=_['keys'](db[_0xe2f7('0x4e')]['rawAttributes']);_0x4fe325['query']=_[_0xe2f7('0x46')](_0x4bf841[_0xe2f7('0x2e')]);_0x4fe325[_0xe2f7('0x39')]=_[_0xe2f7('0x31')](_0x4fe325[_0xe2f7('0x2f')],_0x4fe325[_0xe2f7('0x2e')]);_0x14eaf3[_0xe2f7('0x30')]=_[_0xe2f7('0x31')](_0x4fe325[_0xe2f7('0x2f')],qs[_0xe2f7('0x32')](_0x4bf841[_0xe2f7('0x2e')][_0xe2f7('0x32')]));_0x14eaf3[_0xe2f7('0x30')]=_0x14eaf3['attributes']['length']?_0x14eaf3['attributes']:_0x4fe325[_0xe2f7('0x2f')];_0x14eaf3[_0xe2f7('0x36')]=qs[_0xe2f7('0x37')](_0x4bf841['query'][_0xe2f7('0x37')]);_0x14eaf3[_0xe2f7('0x3a')]=qs['filters'](_[_0xe2f7('0x38')](_0x4bf841['query'],_0x4fe325[_0xe2f7('0x39')]));if(_0x4bf841['query']['filter']){_0x14eaf3[_0xe2f7('0x3a')]=_[_0xe2f7('0x3d')](_0x14eaf3[_0xe2f7('0x3a')],{'$or':_['map'](_0x14eaf3[_0xe2f7('0x30')],function(_0x21a902){var _0x2a101f={};_0x2a101f[_0x21a902]={'$like':'%'+_0x4bf841[_0xe2f7('0x2e')][_0xe2f7('0x3c')]+'%'};return _0x2a101f;})});}_0x14eaf3=_['merge']({},_0x14eaf3,_0x4bf841[_0xe2f7('0x3e')]);return _0xa66ca5[_0xe2f7('0x4d')](_0x14eaf3);}})[_0xe2f7('0x24')](function(_0xeeb319){if(_0xeeb319){_0xd1f24a=_0xeeb319['length'];if(!_0x4bf841[_0xe2f7('0x2e')][_0xe2f7('0x34')](_0xe2f7('0x35'))){_0x14eaf3['limit']=qs[_0xe2f7('0x1e')](_0x4bf841[_0xe2f7('0x2e')][_0xe2f7('0x1e')]);_0x14eaf3['offset']=qs[_0xe2f7('0x1c')](_0x4bf841[_0xe2f7('0x2e')]['offset']);}return _0xa66ca5[_0xe2f7('0x4d')](_0x14eaf3);}})[_0xe2f7('0x24')](function(_0x3d9d9b){if(_0x3d9d9b){return _0x3d9d9b?{'count':_0xd1f24a,'rows':_0x3d9d9b}:null;}})[_0xe2f7('0x24')](respondWithResult(_0x5d3e36,null))['catch'](handleError(_0x5d3e36,null));};exports[_0xe2f7('0x4f')]=function(_0x4535d0,_0x5bef1d,_0x4d7e44){var _0x20b609={};var _0x2c4955={};var _0xb7294a;var _0x8011b5;return db[_0xe2f7('0x2a')]['findOne']({'where':{'id':_0x4535d0[_0xe2f7('0x45')]['id']}})[_0xe2f7('0x24')](handleEntityNotFound(_0x5bef1d,null))[_0xe2f7('0x24')](function(_0x15dd47){if(_0x15dd47){_0xb7294a=_0x15dd47;_0x2c4955[_0xe2f7('0x2f')]=_[_0xe2f7('0x46')](db['SalesforceField'][_0xe2f7('0x2b')]);_0x2c4955[_0xe2f7('0x2e')]=_[_0xe2f7('0x46')](_0x4535d0[_0xe2f7('0x2e')]);_0x2c4955[_0xe2f7('0x39')]=_['intersection'](_0x2c4955[_0xe2f7('0x2f')],_0x2c4955[_0xe2f7('0x2e')]);_0x20b609[_0xe2f7('0x30')]=_[_0xe2f7('0x31')](_0x2c4955[_0xe2f7('0x2f')],qs[_0xe2f7('0x32')](_0x4535d0[_0xe2f7('0x2e')][_0xe2f7('0x32')]));_0x20b609[_0xe2f7('0x30')]=_0x20b609[_0xe2f7('0x30')][_0xe2f7('0x33')]?_0x20b609[_0xe2f7('0x30')]:_0x2c4955[_0xe2f7('0x2f')];_0x20b609['order']=qs[_0xe2f7('0x37')](_0x4535d0['query']['sort']);_0x20b609[_0xe2f7('0x3a')]=qs[_0xe2f7('0x39')](_[_0xe2f7('0x38')](_0x4535d0[_0xe2f7('0x2e')],_0x2c4955[_0xe2f7('0x39')]));if(_0x4535d0[_0xe2f7('0x2e')][_0xe2f7('0x3c')]){_0x20b609[_0xe2f7('0x3a')]=_['merge'](_0x20b609[_0xe2f7('0x3a')],{'$or':_[_0xe2f7('0x29')](_0x20b609[_0xe2f7('0x30')],function(_0x13399d){var _0xb75c41={};_0xb75c41[_0x13399d]={'$like':'%'+_0x4535d0['query'][_0xe2f7('0x3c')]+'%'};return _0xb75c41;})});}_0x20b609=_[_0xe2f7('0x3d')]({},_0x20b609,_0x4535d0[_0xe2f7('0x3e')]);return _0xb7294a[_0xe2f7('0x4f')](_0x20b609);}})['then'](function(_0x429264){if(_0x429264){_0x8011b5=_0x429264[_0xe2f7('0x33')];if(!_0x4535d0[_0xe2f7('0x2e')][_0xe2f7('0x34')](_0xe2f7('0x35'))){_0x20b609[_0xe2f7('0x1e')]=qs[_0xe2f7('0x1e')](_0x4535d0[_0xe2f7('0x2e')][_0xe2f7('0x1e')]);_0x20b609['offset']=qs[_0xe2f7('0x1c')](_0x4535d0[_0xe2f7('0x2e')][_0xe2f7('0x1c')]);}return _0xb7294a[_0xe2f7('0x4f')](_0x20b609);}})[_0xe2f7('0x24')](function(_0x65df4f){if(_0x65df4f){return _0x65df4f?{'count':_0x8011b5,'rows':_0x65df4f}:null;}})['then'](respondWithResult(_0x5bef1d,null))['catch'](handleError(_0x5bef1d,null));}; \ No newline at end of file +var _0x3b75=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','SalesforceConfiguration','fieldName','type','key','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','show','params','find','create','body','catch','getFields','findOne','SalesforceField','rawAttributes','sort','getSubjects','nolimit','getDescriptions'];(function(_0x2dd570,_0x9547fe){var _0x503aea=function(_0x731fe0){while(--_0x731fe0){_0x2dd570['push'](_0x2dd570['shift']());}};_0x503aea(++_0x9547fe);}(_0x3b75,0x144));var _0x53b7=function(_0x503564,_0x55867e){_0x503564=_0x503564-0x0;var _0x4be9fd=_0x3b75[_0x503564];return _0x4be9fd;};'use strict';var emlformat=require(_0x53b7('0x0'));var rimraf=require(_0x53b7('0x1'));var zipdir=require(_0x53b7('0x2'));var jsonpatch=require(_0x53b7('0x3'));var rp=require(_0x53b7('0x4'));var moment=require(_0x53b7('0x5'));var BPromise=require(_0x53b7('0x6'));var Mustache=require(_0x53b7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x53b7('0x8'));var csv=require(_0x53b7('0x9'));var ejs=require(_0x53b7('0xa'));var fs=require('fs');var fs_extra=require(_0x53b7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x53b7('0xc'));var jsforce=require(_0x53b7('0xd'));var deskjs=require(_0x53b7('0xe'));var toCsv=require(_0x53b7('0x9'));var querystring=require(_0x53b7('0xf'));var Papa=require('papaparse');var Redis=require(_0x53b7('0x10'));var authService=require(_0x53b7('0x11'));var qs=require(_0x53b7('0x12'));var as=require(_0x53b7('0x13'));var hardwareService=require(_0x53b7('0x14'));var logger=require(_0x53b7('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x53b7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x53b7('0x17'))['db'];function respondWithStatusCode(_0x4b1649,_0x334af6){_0x334af6=_0x334af6||0xcc;return function(_0x15ef82){if(_0x15ef82){return _0x4b1649[_0x53b7('0x18')](_0x334af6);}return _0x4b1649['status'](_0x334af6)[_0x53b7('0x19')]();};}function respondWithResult(_0x5d70d2,_0x4a64f4){_0x4a64f4=_0x4a64f4||0xc8;return function(_0x514f62){if(_0x514f62){return _0x5d70d2[_0x53b7('0x1a')](_0x4a64f4)[_0x53b7('0x1b')](_0x514f62);}};}function respondWithFilteredResult(_0x3abf94,_0x298576){return function(_0xff1e11){if(_0xff1e11){var _0x54e605=typeof _0x298576[_0x53b7('0x1c')]===_0x53b7('0x1d')&&typeof _0x298576[_0x53b7('0x1e')]===_0x53b7('0x1d');var _0x13697c=_0xff1e11['count'];var _0x14f30f=_0x54e605?0x0:_0x298576['offset'];var _0x5de2f6=_0x54e605?_0xff1e11['count']:_0x298576[_0x53b7('0x1c')]+_0x298576[_0x53b7('0x1e')];var _0x10e7bd;if(_0x5de2f6>=_0x13697c){_0x5de2f6=_0x13697c;_0x10e7bd=0xc8;}else{_0x10e7bd=0xce;}_0x3abf94[_0x53b7('0x1a')](_0x10e7bd);return _0x3abf94[_0x53b7('0x1f')](_0x53b7('0x20'),_0x14f30f+'-'+_0x5de2f6+'/'+_0x13697c)[_0x53b7('0x1b')](_0xff1e11);}return null;};}function patchUpdates(_0x11d7e6){return function(_0x35a2d8){try{jsonpatch[_0x53b7('0x21')](_0x35a2d8,_0x11d7e6,!![]);}catch(_0x535f3b){return BPromise[_0x53b7('0x22')](_0x535f3b);}return _0x35a2d8[_0x53b7('0x23')]();};}function saveUpdates(_0x2e173a,_0x2e50a5){return function(_0x17a1a7){if(_0x17a1a7){return _0x17a1a7[_0x53b7('0x24')](_0x2e173a)[_0x53b7('0x25')](function(_0x2bcfa3){return _0x2bcfa3;});}return null;};}function removeEntity(_0x309a83,_0x42063f){return function(_0x44603f){if(_0x44603f){return _0x44603f[_0x53b7('0x26')]()['then'](function(){_0x309a83['status'](0xcc)[_0x53b7('0x19')]();});}};}function handleEntityNotFound(_0x3e70d8,_0x680dcb){return function(_0x15b3d0){if(!_0x15b3d0){_0x3e70d8[_0x53b7('0x18')](0x194);}return _0x15b3d0;};}function handleError(_0x552d52,_0xada944){_0xada944=_0xada944||0x1f4;return function(_0x10bede){logger[_0x53b7('0x27')](_0x10bede['stack']);if(_0x10bede[_0x53b7('0x28')]){delete _0x10bede[_0x53b7('0x28')];}_0x552d52['status'](_0xada944)[_0x53b7('0x29')](_0x10bede);};}exports['index']=function(_0x42127b,_0x2e5be0){var _0x31a498={},_0x13f5f6={},_0x5c447d={'count':0x0,'rows':[]};var _0x3cb798=_[_0x53b7('0x2a')](db[_0x53b7('0x2b')]['rawAttributes'],function(_0x527467){return{'name':_0x527467[_0x53b7('0x2c')],'type':_0x527467[_0x53b7('0x2d')][_0x53b7('0x2e')]};});_0x13f5f6['model']=_[_0x53b7('0x2a')](_0x3cb798,'name');_0x13f5f6['query']=_[_0x53b7('0x2f')](_0x42127b['query']);_0x13f5f6[_0x53b7('0x30')]=_[_0x53b7('0x31')](_0x13f5f6['model'],_0x13f5f6[_0x53b7('0x32')]);_0x31a498['attributes']=_['intersection'](_0x13f5f6[_0x53b7('0x33')],qs[_0x53b7('0x34')](_0x42127b[_0x53b7('0x32')][_0x53b7('0x34')]));_0x31a498['attributes']=_0x31a498[_0x53b7('0x35')][_0x53b7('0x36')]?_0x31a498[_0x53b7('0x35')]:_0x13f5f6[_0x53b7('0x33')];if(!_0x42127b[_0x53b7('0x32')][_0x53b7('0x37')]('nolimit')){_0x31a498[_0x53b7('0x1e')]=qs[_0x53b7('0x1e')](_0x42127b['query'][_0x53b7('0x1e')]);_0x31a498[_0x53b7('0x1c')]=qs[_0x53b7('0x1c')](_0x42127b[_0x53b7('0x32')][_0x53b7('0x1c')]);}_0x31a498[_0x53b7('0x38')]=qs['sort'](_0x42127b['query']['sort']);_0x31a498[_0x53b7('0x39')]=qs[_0x53b7('0x30')](_[_0x53b7('0x3a')](_0x42127b[_0x53b7('0x32')],_0x13f5f6[_0x53b7('0x30')]),_0x3cb798);if(_0x42127b['query']['filter']){_0x31a498['where']=_[_0x53b7('0x3b')](_0x31a498[_0x53b7('0x39')],{'$or':_[_0x53b7('0x2a')](_0x3cb798,function(_0x182263){if(_0x182263[_0x53b7('0x2d')]!==_0x53b7('0x3c')){var _0x174e3e={};_0x174e3e[_0x182263[_0x53b7('0x28')]]={'$like':'%'+_0x42127b[_0x53b7('0x32')][_0x53b7('0x3d')]+'%'};return _0x174e3e;}})});}_0x31a498=_[_0x53b7('0x3b')]({},_0x31a498,_0x42127b[_0x53b7('0x3e')]);var _0x557680={'where':_0x31a498[_0x53b7('0x39')]};return db['SalesforceConfiguration'][_0x53b7('0x3f')](_0x557680)['then'](function(_0xbffc10){_0x5c447d['count']=_0xbffc10;if(_0x42127b[_0x53b7('0x32')][_0x53b7('0x40')]){_0x31a498[_0x53b7('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x53b7('0x42')](_0x31a498);})[_0x53b7('0x25')](function(_0x25dddf){_0x5c447d['rows']=_0x25dddf;return _0x5c447d;})[_0x53b7('0x25')](respondWithFilteredResult(_0x2e5be0,_0x31a498))['catch'](handleError(_0x2e5be0,null));};exports[_0x53b7('0x43')]=function(_0x211129,_0x3d6f34){var _0x467ef8={'raw':![],'where':{'id':_0x211129[_0x53b7('0x44')]['id']}},_0x3c44cd={};_0x3c44cd[_0x53b7('0x33')]=_['keys'](db[_0x53b7('0x2b')]['rawAttributes']);_0x3c44cd[_0x53b7('0x32')]=_[_0x53b7('0x2f')](_0x211129[_0x53b7('0x32')]);_0x3c44cd[_0x53b7('0x30')]=_[_0x53b7('0x31')](_0x3c44cd[_0x53b7('0x33')],_0x3c44cd[_0x53b7('0x32')]);_0x467ef8['attributes']=_[_0x53b7('0x31')](_0x3c44cd['model'],qs[_0x53b7('0x34')](_0x211129['query'][_0x53b7('0x34')]));_0x467ef8[_0x53b7('0x35')]=_0x467ef8[_0x53b7('0x35')][_0x53b7('0x36')]?_0x467ef8[_0x53b7('0x35')]:_0x3c44cd[_0x53b7('0x33')];if(_0x211129['query'][_0x53b7('0x40')]){_0x467ef8[_0x53b7('0x41')]=[{'all':!![]}];}_0x467ef8=_[_0x53b7('0x3b')]({},_0x467ef8,_0x211129[_0x53b7('0x3e')]);return db[_0x53b7('0x2b')][_0x53b7('0x45')](_0x467ef8)[_0x53b7('0x25')](handleEntityNotFound(_0x3d6f34,null))[_0x53b7('0x25')](respondWithResult(_0x3d6f34,null))['catch'](handleError(_0x3d6f34,null));};exports['create']=function(_0x421e83,_0x2575be){return db[_0x53b7('0x2b')][_0x53b7('0x46')](_0x421e83[_0x53b7('0x47')],{})[_0x53b7('0x25')](respondWithResult(_0x2575be,0xc9))['catch'](handleError(_0x2575be,null));};exports['update']=function(_0x501c94,_0x5a7fa7){if(_0x501c94['body']['id']){delete _0x501c94[_0x53b7('0x47')]['id'];}return db[_0x53b7('0x2b')][_0x53b7('0x45')]({'where':{'id':_0x501c94[_0x53b7('0x44')]['id']}})[_0x53b7('0x25')](handleEntityNotFound(_0x5a7fa7,null))[_0x53b7('0x25')](saveUpdates(_0x501c94[_0x53b7('0x47')],null))['then'](respondWithResult(_0x5a7fa7,null))[_0x53b7('0x48')](handleError(_0x5a7fa7,null));};exports[_0x53b7('0x26')]=function(_0x38c107,_0x132a88){return db[_0x53b7('0x2b')][_0x53b7('0x45')]({'where':{'id':_0x38c107[_0x53b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x132a88,null))[_0x53b7('0x25')](removeEntity(_0x132a88,null))[_0x53b7('0x48')](handleError(_0x132a88,null));};exports[_0x53b7('0x49')]=function(_0x21988c,_0x2a2cb5,_0x11f896){var _0x4523bb={};var _0x72646a={};var _0x21390c;var _0x3a603d;return db[_0x53b7('0x2b')][_0x53b7('0x4a')]({'where':{'id':_0x21988c[_0x53b7('0x44')]['id']}})[_0x53b7('0x25')](handleEntityNotFound(_0x2a2cb5,null))['then'](function(_0x1b7b74){if(_0x1b7b74){_0x21390c=_0x1b7b74;_0x72646a[_0x53b7('0x33')]=_[_0x53b7('0x2f')](db[_0x53b7('0x4b')][_0x53b7('0x4c')]);_0x72646a[_0x53b7('0x32')]=_[_0x53b7('0x2f')](_0x21988c['query']);_0x72646a[_0x53b7('0x30')]=_[_0x53b7('0x31')](_0x72646a[_0x53b7('0x33')],_0x72646a[_0x53b7('0x32')]);_0x4523bb[_0x53b7('0x35')]=_['intersection'](_0x72646a[_0x53b7('0x33')],qs[_0x53b7('0x34')](_0x21988c[_0x53b7('0x32')][_0x53b7('0x34')]));_0x4523bb[_0x53b7('0x35')]=_0x4523bb[_0x53b7('0x35')][_0x53b7('0x36')]?_0x4523bb[_0x53b7('0x35')]:_0x72646a['model'];_0x4523bb['order']=qs['sort'](_0x21988c[_0x53b7('0x32')][_0x53b7('0x4d')]);_0x4523bb['where']=qs[_0x53b7('0x30')](_[_0x53b7('0x3a')](_0x21988c['query'],_0x72646a[_0x53b7('0x30')]));if(_0x21988c[_0x53b7('0x32')][_0x53b7('0x3d')]){_0x4523bb[_0x53b7('0x39')]=_[_0x53b7('0x3b')](_0x4523bb[_0x53b7('0x39')],{'$or':_['map'](_0x4523bb['attributes'],function(_0x138749){var _0x2456e3={};_0x2456e3[_0x138749]={'$like':'%'+_0x21988c[_0x53b7('0x32')]['filter']+'%'};return _0x2456e3;})});}_0x4523bb=_[_0x53b7('0x3b')]({},_0x4523bb,_0x21988c[_0x53b7('0x3e')]);return _0x21390c[_0x53b7('0x49')](_0x4523bb);}})[_0x53b7('0x25')](function(_0x22d6eb){if(_0x22d6eb){_0x3a603d=_0x22d6eb[_0x53b7('0x36')];if(!_0x21988c[_0x53b7('0x32')][_0x53b7('0x37')]('nolimit')){_0x4523bb[_0x53b7('0x1e')]=qs[_0x53b7('0x1e')](_0x21988c['query'][_0x53b7('0x1e')]);_0x4523bb[_0x53b7('0x1c')]=qs[_0x53b7('0x1c')](_0x21988c[_0x53b7('0x32')][_0x53b7('0x1c')]);}return _0x21390c[_0x53b7('0x49')](_0x4523bb);}})['then'](function(_0x266f50){if(_0x266f50){return _0x266f50?{'count':_0x3a603d,'rows':_0x266f50}:null;}})[_0x53b7('0x25')](respondWithResult(_0x2a2cb5,null))[_0x53b7('0x48')](handleError(_0x2a2cb5,null));};exports['getSubjects']=function(_0x5b2cd2,_0x4bbb27,_0x3d2d92){var _0x2c6543={};var _0xc6c42a={};var _0x8dfd3e;var _0x1952a1;return db[_0x53b7('0x2b')]['findOne']({'where':{'id':_0x5b2cd2['params']['id']}})[_0x53b7('0x25')](handleEntityNotFound(_0x4bbb27,null))[_0x53b7('0x25')](function(_0x3ff649){if(_0x3ff649){_0x8dfd3e=_0x3ff649;_0xc6c42a[_0x53b7('0x33')]=_[_0x53b7('0x2f')](db[_0x53b7('0x4b')][_0x53b7('0x4c')]);_0xc6c42a[_0x53b7('0x32')]=_[_0x53b7('0x2f')](_0x5b2cd2['query']);_0xc6c42a[_0x53b7('0x30')]=_[_0x53b7('0x31')](_0xc6c42a[_0x53b7('0x33')],_0xc6c42a[_0x53b7('0x32')]);_0x2c6543['attributes']=_[_0x53b7('0x31')](_0xc6c42a[_0x53b7('0x33')],qs[_0x53b7('0x34')](_0x5b2cd2[_0x53b7('0x32')]['fields']));_0x2c6543['attributes']=_0x2c6543[_0x53b7('0x35')]['length']?_0x2c6543[_0x53b7('0x35')]:_0xc6c42a[_0x53b7('0x33')];_0x2c6543[_0x53b7('0x38')]=qs[_0x53b7('0x4d')](_0x5b2cd2[_0x53b7('0x32')][_0x53b7('0x4d')]);_0x2c6543['where']=qs[_0x53b7('0x30')](_[_0x53b7('0x3a')](_0x5b2cd2[_0x53b7('0x32')],_0xc6c42a[_0x53b7('0x30')]));if(_0x5b2cd2[_0x53b7('0x32')][_0x53b7('0x3d')]){_0x2c6543[_0x53b7('0x39')]=_['merge'](_0x2c6543[_0x53b7('0x39')],{'$or':_['map'](_0x2c6543[_0x53b7('0x35')],function(_0x25e513){var _0x51f25d={};_0x51f25d[_0x25e513]={'$like':'%'+_0x5b2cd2[_0x53b7('0x32')][_0x53b7('0x3d')]+'%'};return _0x51f25d;})});}_0x2c6543=_[_0x53b7('0x3b')]({},_0x2c6543,_0x5b2cd2[_0x53b7('0x3e')]);return _0x8dfd3e[_0x53b7('0x4e')](_0x2c6543);}})[_0x53b7('0x25')](function(_0x48df8b){if(_0x48df8b){_0x1952a1=_0x48df8b[_0x53b7('0x36')];if(!_0x5b2cd2[_0x53b7('0x32')][_0x53b7('0x37')](_0x53b7('0x4f'))){_0x2c6543[_0x53b7('0x1e')]=qs['limit'](_0x5b2cd2[_0x53b7('0x32')][_0x53b7('0x1e')]);_0x2c6543[_0x53b7('0x1c')]=qs['offset'](_0x5b2cd2[_0x53b7('0x32')][_0x53b7('0x1c')]);}return _0x8dfd3e[_0x53b7('0x4e')](_0x2c6543);}})['then'](function(_0x32c773){if(_0x32c773){return _0x32c773?{'count':_0x1952a1,'rows':_0x32c773}:null;}})['then'](respondWithResult(_0x4bbb27,null))[_0x53b7('0x48')](handleError(_0x4bbb27,null));};exports[_0x53b7('0x50')]=function(_0x356c5b,_0x37ee3a,_0x3b0f25){var _0x162d9b={};var _0x3761c0={};var _0xd71d0;var _0x1107c1;return db['SalesforceConfiguration'][_0x53b7('0x4a')]({'where':{'id':_0x356c5b[_0x53b7('0x44')]['id']}})[_0x53b7('0x25')](handleEntityNotFound(_0x37ee3a,null))[_0x53b7('0x25')](function(_0x48cf30){if(_0x48cf30){_0xd71d0=_0x48cf30;_0x3761c0[_0x53b7('0x33')]=_[_0x53b7('0x2f')](db[_0x53b7('0x4b')]['rawAttributes']);_0x3761c0[_0x53b7('0x32')]=_[_0x53b7('0x2f')](_0x356c5b[_0x53b7('0x32')]);_0x3761c0['filters']=_[_0x53b7('0x31')](_0x3761c0[_0x53b7('0x33')],_0x3761c0[_0x53b7('0x32')]);_0x162d9b[_0x53b7('0x35')]=_[_0x53b7('0x31')](_0x3761c0[_0x53b7('0x33')],qs[_0x53b7('0x34')](_0x356c5b['query'][_0x53b7('0x34')]));_0x162d9b[_0x53b7('0x35')]=_0x162d9b['attributes'][_0x53b7('0x36')]?_0x162d9b[_0x53b7('0x35')]:_0x3761c0['model'];_0x162d9b[_0x53b7('0x38')]=qs['sort'](_0x356c5b[_0x53b7('0x32')]['sort']);_0x162d9b['where']=qs[_0x53b7('0x30')](_[_0x53b7('0x3a')](_0x356c5b['query'],_0x3761c0[_0x53b7('0x30')]));if(_0x356c5b[_0x53b7('0x32')]['filter']){_0x162d9b['where']=_[_0x53b7('0x3b')](_0x162d9b[_0x53b7('0x39')],{'$or':_[_0x53b7('0x2a')](_0x162d9b[_0x53b7('0x35')],function(_0x4ccf65){var _0x1412d7={};_0x1412d7[_0x4ccf65]={'$like':'%'+_0x356c5b[_0x53b7('0x32')][_0x53b7('0x3d')]+'%'};return _0x1412d7;})});}_0x162d9b=_[_0x53b7('0x3b')]({},_0x162d9b,_0x356c5b['options']);return _0xd71d0['getDescriptions'](_0x162d9b);}})[_0x53b7('0x25')](function(_0x1e5ad4){if(_0x1e5ad4){_0x1107c1=_0x1e5ad4[_0x53b7('0x36')];if(!_0x356c5b[_0x53b7('0x32')][_0x53b7('0x37')](_0x53b7('0x4f'))){_0x162d9b[_0x53b7('0x1e')]=qs['limit'](_0x356c5b[_0x53b7('0x32')]['limit']);_0x162d9b[_0x53b7('0x1c')]=qs[_0x53b7('0x1c')](_0x356c5b['query'][_0x53b7('0x1c')]);}return _0xd71d0[_0x53b7('0x50')](_0x162d9b);}})[_0x53b7('0x25')](function(_0x3a02e3){if(_0x3a02e3){return _0x3a02e3?{'count':_0x1107c1,'rows':_0x3a02e3}:null;}})[_0x53b7('0x25')](respondWithResult(_0x37ee3a,null))[_0x53b7('0x48')](handleError(_0x37ee3a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 97aa92c..239683e 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 _0xc85a=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports'];(function(_0x299505,_0x285c1d){var _0x4fb10f=function(_0x2694f9){while(--_0x2694f9){_0x299505['push'](_0x299505['shift']());}};_0x4fb10f(++_0x285c1d);}(_0xc85a,0x73));var _0xac85=function(_0x23d1f6,_0x3333c4){_0x23d1f6=_0x23d1f6-0x0;var _0x1c5cf3=_0xc85a[_0x23d1f6];return _0x1c5cf3;};'use strict';var _=require(_0xac85('0x0'));var util=require(_0xac85('0x1'));var logger=require(_0xac85('0x2'))(_0xac85('0x3'));var moment=require(_0xac85('0x4'));var BPromise=require(_0xac85('0x5'));var rp=require(_0xac85('0x6'));var fs=require('fs');var path=require(_0xac85('0x7'));var rimraf=require(_0xac85('0x8'));var config=require('../../config/environment');var attributes=require(_0xac85('0x9'));module[_0xac85('0xa')]=function(_0x1e5ff2,_0x3cfc9f){return _0x1e5ff2[_0xac85('0xb')](_0xac85('0xc'),attributes,{'tableName':_0xac85('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3580=['api','bluebird','request-promise','rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0x3580,0x1c0));var _0x0358=function(_0xce5632,_0x1f781b){_0xce5632=_0xce5632-0x0;var _0x31b279=_0x3580[_0xce5632];return _0x31b279;};'use strict';var _=require(_0x0358('0x0'));var util=require(_0x0358('0x1'));var logger=require('../../config/logger')(_0x0358('0x2'));var moment=require('moment');var BPromise=require(_0x0358('0x3'));var rp=require(_0x0358('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0358('0x5'));var config=require(_0x0358('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x285e85,_0x4dc099){return _0x285e85[_0x0358('0x7')](_0x0358('0x8'),attributes,{'tableName':_0x0358('0x9'),'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 3e42a58..1ea6ac6 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 _0x8907=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8c6bae,_0x4e3693){var _0x499566=function(_0x885e85){while(--_0x885e85){_0x8c6bae['push'](_0x8c6bae['shift']());}};_0x499566(++_0x4e3693);}(_0x8907,0x1e5));var _0x7890=function(_0x56893a,_0x57934b){_0x56893a=_0x56893a-0x0;var _0x234e33=_0x8907[_0x56893a];return _0x234e33;};'use strict';var _=require('lodash');var util=require(_0x7890('0x0'));var moment=require(_0x7890('0x1'));var BPromise=require(_0x7890('0x2'));var rs=require(_0x7890('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7890('0x4'))['db'];var utils=require(_0x7890('0x5'));var logger=require(_0x7890('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7890('0x7'));var client=jayson['client'][_0x7890('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x358eb9,_0x334056,_0x523374){return new BPromise(function(_0x231bea,_0x32438e){return client[_0x7890('0x9')](_0x358eb9,_0x523374)[_0x7890('0xa')](function(_0x2568b2){logger[_0x7890('0xb')](_0x7890('0xc'),_0x334056,_0x7890('0xd'));logger[_0x7890('0xe')](_0x7890('0xf'),_0x334056,_0x7890('0xd'),JSON['stringify'](_0x2568b2));if(_0x2568b2[_0x7890('0x10')]){if(_0x2568b2['error'][_0x7890('0x11')]===0x1f4){logger[_0x7890('0x10')](_0x7890('0xc'),_0x334056,_0x2568b2[_0x7890('0x10')][_0x7890('0x12')]);return _0x32438e(_0x2568b2[_0x7890('0x10')]['message']);}logger['error'](_0x7890('0xc'),_0x334056,_0x2568b2[_0x7890('0x10')][_0x7890('0x12')]);return _0x231bea(_0x2568b2[_0x7890('0x10')][_0x7890('0x12')]);}else{logger[_0x7890('0xb')](_0x7890('0xc'),_0x334056,_0x7890('0xd'));_0x231bea(_0x2568b2['result'][_0x7890('0x12')]);}})[_0x7890('0x13')](function(_0x4bd64c){logger[_0x7890('0x10')](_0x7890('0xc'),_0x334056,_0x4bd64c);_0x32438e(_0x4bd64c);});});} \ No newline at end of file +var _0x9e51=['catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x9e51,0x155));var _0x19e5=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x9e51[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x19e5('0x0'));var util=require(_0x19e5('0x1'));var moment=require('moment');var BPromise=require(_0x19e5('0x2'));var rs=require(_0x19e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19e5('0x4'))['db'];var utils=require(_0x19e5('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x19e5('0x6')][_0x19e5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11725f,_0x3e0e26,_0x4a44f5){return new BPromise(function(_0x4b8657,_0x861afb){return client[_0x19e5('0x8')](_0x11725f,_0x4a44f5)[_0x19e5('0x9')](function(_0x4c99ac){logger[_0x19e5('0xa')](_0x19e5('0xb'),_0x3e0e26,_0x19e5('0xc'));logger[_0x19e5('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x3e0e26,'request\x20sent',JSON[_0x19e5('0xe')](_0x4c99ac));if(_0x4c99ac['error']){if(_0x4c99ac[_0x19e5('0xf')][_0x19e5('0x10')]===0x1f4){logger[_0x19e5('0xf')](_0x19e5('0xb'),_0x3e0e26,_0x4c99ac[_0x19e5('0xf')]['message']);return _0x861afb(_0x4c99ac[_0x19e5('0xf')][_0x19e5('0x11')]);}logger['error'](_0x19e5('0xb'),_0x3e0e26,_0x4c99ac[_0x19e5('0xf')][_0x19e5('0x11')]);return _0x4b8657(_0x4c99ac[_0x19e5('0xf')][_0x19e5('0x11')]);}else{logger[_0x19e5('0xa')](_0x19e5('0xb'),_0x3e0e26,_0x19e5('0xc'));_0x4b8657(_0x4c99ac[_0x19e5('0x12')][_0x19e5('0x11')]);}})[_0x19e5('0x13')](function(_0x2a2e64){logger[_0x19e5('0xf')](_0x19e5('0xb'),_0x3e0e26,_0x2a2e64);_0x861afb(_0x2a2e64);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index cbcf1ad..f64a933 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 _0xc369=['show','post','isAuthenticated','create','put','update','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index'];(function(_0xf98d20,_0x39a333){var _0x496c3d=function(_0x30c2a8){while(--_0x30c2a8){_0xf98d20['push'](_0xf98d20['shift']());}};_0x496c3d(++_0x39a333);}(_0xc369,0xda));var _0x9c36=function(_0x45e534,_0x3b1f0f){_0x45e534=_0x45e534-0x0;var _0x13ea8e=_0xc369[_0x45e534];return _0x13ea8e;};'use strict';var multer=require('multer');var util=require(_0x9c36('0x0'));var path=require(_0x9c36('0x1'));var timeout=require(_0x9c36('0x2'));var express=require(_0x9c36('0x3'));var router=express[_0x9c36('0x4')]();var fs_extra=require(_0x9c36('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c36('0x6'));var config=require(_0x9c36('0x7'));var controller=require('./intSalesforceField.controller');router[_0x9c36('0x8')]('/',auth['isAuthenticated'](),controller[_0x9c36('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9c36('0xa')]);router[_0x9c36('0xb')]('/',auth[_0x9c36('0xc')](),controller[_0x9c36('0xd')]);router[_0x9c36('0xe')]('/:id',auth[_0x9c36('0xc')](),controller[_0x9c36('0xf')]);router['delete'](_0x9c36('0x10'),auth[_0x9c36('0xc')](),controller[_0x9c36('0x11')]);module[_0x9c36('0x12')]=router; \ No newline at end of file +var _0xfae9=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1616a5,_0x441ef6){var _0x2f48d9=function(_0x13405f){while(--_0x13405f){_0x1616a5['push'](_0x1616a5['shift']());}};_0x2f48d9(++_0x441ef6);}(_0xfae9,0x7f));var _0x9fae=function(_0x50e7a4,_0x35bfbf){_0x50e7a4=_0x50e7a4-0x0;var _0x35c692=_0xfae9[_0x50e7a4];return _0x35c692;};'use strict';var multer=require(_0x9fae('0x0'));var util=require(_0x9fae('0x1'));var path=require(_0x9fae('0x2'));var timeout=require(_0x9fae('0x3'));var express=require(_0x9fae('0x4'));var router=express[_0x9fae('0x5')]();var fs_extra=require(_0x9fae('0x6'));var auth=require(_0x9fae('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9fae('0x8'));var controller=require('./intSalesforceField.controller');router[_0x9fae('0x9')]('/',auth[_0x9fae('0xa')](),controller[_0x9fae('0xb')]);router[_0x9fae('0x9')](_0x9fae('0xc'),auth[_0x9fae('0xa')](),controller[_0x9fae('0xd')]);router[_0x9fae('0xe')]('/',auth[_0x9fae('0xa')](),controller[_0x9fae('0xf')]);router['put']('/:id',auth[_0x9fae('0xa')](),controller['update']);router[_0x9fae('0x10')]('/:id',auth[_0x9fae('0xa')](),controller[_0x9fae('0x11')]);module[_0x9fae('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b6de3bc..a5121d6 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 _0x5c45=['picklist','STRING','ENUM','sequelize','string','variable','customVariable','keyValue'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x5c45,0x19b));var _0x55c4=function(_0x4448de,_0x1ffe27){_0x4448de=_0x4448de-0x0;var _0x12411b=_0x5c45[_0x4448de];return _0x12411b;};'use strict';var Sequelize=require(_0x55c4('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x55c4('0x1'),_0x55c4('0x2'),_0x55c4('0x3'),_0x55c4('0x4'),_0x55c4('0x5')),'defaultValue':_0x55c4('0x1')},'content':{'type':Sequelize[_0x55c4('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x55c4('0x7')](_0x55c4('0x1'),_0x55c4('0x2'),_0x55c4('0x3'))},'keyContent':{'type':Sequelize[_0x55c4('0x6')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x55c4('0x6')]}}; \ No newline at end of file +var _0x7cb1=['picklist','STRING','ENUM','string','variable','customVariable'];(function(_0x15a8af,_0xa90d50){var _0x3da278=function(_0x36a265){while(--_0x36a265){_0x15a8af['push'](_0x15a8af['shift']());}};_0x3da278(++_0xa90d50);}(_0x7cb1,0x1e8));var _0x17cb=function(_0xd5d04b,_0xe02f0f){_0xd5d04b=_0xd5d04b-0x0;var _0xd1d25c=_0x7cb1[_0xd5d04b];return _0xd1d25c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x17cb('0x0')](_0x17cb('0x1'),_0x17cb('0x2'),_0x17cb('0x3'),'keyValue',_0x17cb('0x4')),'defaultValue':_0x17cb('0x1')},'content':{'type':Sequelize[_0x17cb('0x5')]},'key':{'type':Sequelize[_0x17cb('0x5')]},'keyType':{'type':Sequelize[_0x17cb('0x0')](_0x17cb('0x1'),_0x17cb('0x2'),_0x17cb('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x17cb('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index b6e5304..5cbbf2c 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 _0x2ff8=['error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filters','merge','where','VIRTUAL','filter','SalesforceField','findAll','show','params','includeAll','options','find','catch','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then'];(function(_0x213fe4,_0x130c13){var _0x3ac45f=function(_0x535d83){while(--_0x535d83){_0x213fe4['push'](_0x213fe4['shift']());}};_0x3ac45f(++_0x130c13);}(_0x2ff8,0x6a));var _0x82ff=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x2ff8[_0x3ce3c];return _0x55a2c9;};'use strict';var emlformat=require(_0x82ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x82ff('0x2'));var moment=require(_0x82ff('0x3'));var BPromise=require(_0x82ff('0x4'));var Mustache=require(_0x82ff('0x5'));var util=require(_0x82ff('0x6'));var path=require(_0x82ff('0x7'));var sox=require('sox');var csv=require(_0x82ff('0x8'));var ejs=require(_0x82ff('0x9'));var fs=require('fs');var fs_extra=require(_0x82ff('0xa'));var _=require(_0x82ff('0xb'));var squel=require(_0x82ff('0xc'));var crypto=require(_0x82ff('0xd'));var jsforce=require(_0x82ff('0xe'));var deskjs=require(_0x82ff('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x82ff('0x10'));var authService=require(_0x82ff('0x11'));var qs=require(_0x82ff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x82ff('0x13'));var utils=require(_0x82ff('0x14'));var config=require(_0x82ff('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x82ff('0x16'))['db'];function respondWithStatusCode(_0x34662c,_0x4fa043){_0x4fa043=_0x4fa043||0xcc;return function(_0x8ca5e3){if(_0x8ca5e3){return _0x34662c[_0x82ff('0x17')](_0x4fa043);}return _0x34662c['status'](_0x4fa043)[_0x82ff('0x18')]();};}function respondWithResult(_0x2ac9a3,_0x162c81){_0x162c81=_0x162c81||0xc8;return function(_0x3403f){if(_0x3403f){return _0x2ac9a3[_0x82ff('0x19')](_0x162c81)[_0x82ff('0x1a')](_0x3403f);}};}function respondWithFilteredResult(_0x406afd,_0x18b23a){return function(_0x2ef39b){if(_0x2ef39b){var _0x1cac90=typeof _0x18b23a['offset']===_0x82ff('0x1b')&&typeof _0x18b23a[_0x82ff('0x1c')]===_0x82ff('0x1b');var _0x5596cc=_0x2ef39b[_0x82ff('0x1d')];var _0x1525b1=_0x1cac90?0x0:_0x18b23a['offset'];var _0x20ba4b=_0x1cac90?_0x2ef39b[_0x82ff('0x1d')]:_0x18b23a[_0x82ff('0x1e')]+_0x18b23a[_0x82ff('0x1c')];var _0x431482;if(_0x20ba4b>=_0x5596cc){_0x20ba4b=_0x5596cc;_0x431482=0xc8;}else{_0x431482=0xce;}_0x406afd['status'](_0x431482);return _0x406afd[_0x82ff('0x1f')](_0x82ff('0x20'),_0x1525b1+'-'+_0x20ba4b+'/'+_0x5596cc)['json'](_0x2ef39b);}return null;};}function patchUpdates(_0x2b9451){return function(_0x5ae24e){try{jsonpatch[_0x82ff('0x21')](_0x5ae24e,_0x2b9451,!![]);}catch(_0x44220a){return BPromise[_0x82ff('0x22')](_0x44220a);}return _0x5ae24e[_0x82ff('0x23')]();};}function saveUpdates(_0x5c1674,_0x55dcdf){return function(_0xd81e69){if(_0xd81e69){return _0xd81e69[_0x82ff('0x24')](_0x5c1674)[_0x82ff('0x25')](function(_0x21c4b9){return _0x21c4b9;});}return null;};}function removeEntity(_0xd6e937,_0x18a993){return function(_0x27f9d1){if(_0x27f9d1){return _0x27f9d1['destroy']()[_0x82ff('0x25')](function(){_0xd6e937[_0x82ff('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ec76,_0x33c07a){return function(_0x3ed255){if(!_0x3ed255){_0x35ec76[_0x82ff('0x17')](0x194);}return _0x3ed255;};}function handleError(_0xde3ea4,_0x41797b){_0x41797b=_0x41797b||0x1f4;return function(_0x5cd77b){logger[_0x82ff('0x26')](_0x5cd77b['stack']);if(_0x5cd77b['name']){delete _0x5cd77b[_0x82ff('0x27')];}_0xde3ea4[_0x82ff('0x19')](_0x41797b)[_0x82ff('0x28')](_0x5cd77b);};}exports[_0x82ff('0x29')]=function(_0x295c31,_0x3b56e5){var _0x45de04={},_0x55dbfe={},_0x19acbc={'count':0x0,'rows':[]};var _0x14c96a=_[_0x82ff('0x2a')](db['SalesforceField'][_0x82ff('0x2b')],function(_0x39060a){return{'name':_0x39060a[_0x82ff('0x2c')],'type':_0x39060a[_0x82ff('0x2d')][_0x82ff('0x2e')]};});_0x55dbfe[_0x82ff('0x2f')]=_['map'](_0x14c96a,_0x82ff('0x27'));_0x55dbfe[_0x82ff('0x30')]=_[_0x82ff('0x31')](_0x295c31[_0x82ff('0x30')]);_0x55dbfe['filters']=_[_0x82ff('0x32')](_0x55dbfe[_0x82ff('0x2f')],_0x55dbfe['query']);_0x45de04['attributes']=_[_0x82ff('0x32')](_0x55dbfe[_0x82ff('0x2f')],qs[_0x82ff('0x33')](_0x295c31[_0x82ff('0x30')]['fields']));_0x45de04[_0x82ff('0x34')]=_0x45de04['attributes'][_0x82ff('0x35')]?_0x45de04[_0x82ff('0x34')]:_0x55dbfe[_0x82ff('0x2f')];if(!_0x295c31[_0x82ff('0x30')][_0x82ff('0x36')](_0x82ff('0x37'))){_0x45de04[_0x82ff('0x1c')]=qs['limit'](_0x295c31[_0x82ff('0x30')][_0x82ff('0x1c')]);_0x45de04[_0x82ff('0x1e')]=qs[_0x82ff('0x1e')](_0x295c31[_0x82ff('0x30')][_0x82ff('0x1e')]);}_0x45de04['order']=qs[_0x82ff('0x38')](_0x295c31['query']['sort']);_0x45de04['where']=qs['filters'](_[_0x82ff('0x39')](_0x295c31[_0x82ff('0x30')],_0x55dbfe[_0x82ff('0x3a')]),_0x14c96a);if(_0x295c31[_0x82ff('0x30')]['filter']){_0x45de04['where']=_[_0x82ff('0x3b')](_0x45de04[_0x82ff('0x3c')],{'$or':_[_0x82ff('0x2a')](_0x14c96a,function(_0xc71b00){if(_0xc71b00['type']!==_0x82ff('0x3d')){var _0x41e39b={};_0x41e39b[_0xc71b00['name']]={'$like':'%'+_0x295c31[_0x82ff('0x30')][_0x82ff('0x3e')]+'%'};return _0x41e39b;}})});}_0x45de04=_[_0x82ff('0x3b')]({},_0x45de04,_0x295c31['options']);var _0x3fb99a={'where':_0x45de04[_0x82ff('0x3c')]};return db[_0x82ff('0x3f')][_0x82ff('0x1d')](_0x3fb99a)[_0x82ff('0x25')](function(_0x3d40ce){_0x19acbc[_0x82ff('0x1d')]=_0x3d40ce;if(_0x295c31[_0x82ff('0x30')]['includeAll']){_0x45de04['include']=[{'all':!![]}];}return db[_0x82ff('0x3f')][_0x82ff('0x40')](_0x45de04);})[_0x82ff('0x25')](function(_0x33b58e){_0x19acbc['rows']=_0x33b58e;return _0x19acbc;})[_0x82ff('0x25')](respondWithFilteredResult(_0x3b56e5,_0x45de04))['catch'](handleError(_0x3b56e5,null));};exports[_0x82ff('0x41')]=function(_0x44f812,_0x43c0a3){var _0x1484dc={'raw':!![],'where':{'id':_0x44f812[_0x82ff('0x42')]['id']}},_0x551cc7={};_0x551cc7[_0x82ff('0x2f')]=_[_0x82ff('0x31')](db[_0x82ff('0x3f')]['rawAttributes']);_0x551cc7[_0x82ff('0x30')]=_[_0x82ff('0x31')](_0x44f812['query']);_0x551cc7['filters']=_['intersection'](_0x551cc7['model'],_0x551cc7['query']);_0x1484dc[_0x82ff('0x34')]=_[_0x82ff('0x32')](_0x551cc7[_0x82ff('0x2f')],qs[_0x82ff('0x33')](_0x44f812['query'][_0x82ff('0x33')]));_0x1484dc[_0x82ff('0x34')]=_0x1484dc[_0x82ff('0x34')][_0x82ff('0x35')]?_0x1484dc['attributes']:_0x551cc7[_0x82ff('0x2f')];if(_0x44f812['query'][_0x82ff('0x43')]){_0x1484dc['include']=[{'all':!![]}];}_0x1484dc=_[_0x82ff('0x3b')]({},_0x1484dc,_0x44f812[_0x82ff('0x44')]);return db[_0x82ff('0x3f')][_0x82ff('0x45')](_0x1484dc)[_0x82ff('0x25')](handleEntityNotFound(_0x43c0a3,null))[_0x82ff('0x25')](respondWithResult(_0x43c0a3,null))[_0x82ff('0x46')](handleError(_0x43c0a3,null));};exports['create']=function(_0x56d85f,_0x40d63){return db[_0x82ff('0x3f')]['create'](_0x56d85f[_0x82ff('0x47')],{})['then'](respondWithResult(_0x40d63,0xc9))[_0x82ff('0x46')](handleError(_0x40d63,null));};exports[_0x82ff('0x24')]=function(_0x53a2d4,_0x3d8712){if(_0x53a2d4[_0x82ff('0x47')]['id']){delete _0x53a2d4[_0x82ff('0x47')]['id'];}return db[_0x82ff('0x3f')]['find']({'where':{'id':_0x53a2d4[_0x82ff('0x42')]['id']}})[_0x82ff('0x25')](handleEntityNotFound(_0x3d8712,null))[_0x82ff('0x25')](saveUpdates(_0x53a2d4[_0x82ff('0x47')],null))[_0x82ff('0x25')](respondWithResult(_0x3d8712,null))['catch'](handleError(_0x3d8712,null));};exports['destroy']=function(_0x587571,_0x4c08a0){return db[_0x82ff('0x3f')]['find']({'where':{'id':_0x587571['params']['id']}})[_0x82ff('0x25')](handleEntityNotFound(_0x4c08a0,null))['then'](removeEntity(_0x4c08a0,null))[_0x82ff('0x46')](handleError(_0x4c08a0,null));}; \ No newline at end of file +var _0xb9b0=['status','send','index','map','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','options','SalesforceField','include','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','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','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','stack','name'];(function(_0x3f042d,_0x3d7653){var _0x2d91aa=function(_0x5bae37){while(--_0x5bae37){_0x3f042d['push'](_0x3f042d['shift']());}};_0x2d91aa(++_0x3d7653);}(_0xb9b0,0xb9));var _0x0b9b=function(_0x1abfb5,_0x5becb2){_0x1abfb5=_0x1abfb5-0x0;var _0x4ed45e=_0xb9b0[_0x1abfb5];return _0x4ed45e;};'use strict';var emlformat=require(_0x0b9b('0x0'));var rimraf=require(_0x0b9b('0x1'));var zipdir=require(_0x0b9b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b9b('0x3'));var moment=require(_0x0b9b('0x4'));var BPromise=require(_0x0b9b('0x5'));var Mustache=require(_0x0b9b('0x6'));var util=require(_0x0b9b('0x7'));var path=require(_0x0b9b('0x8'));var sox=require(_0x0b9b('0x9'));var csv=require('to-csv');var ejs=require(_0x0b9b('0xa'));var fs=require('fs');var fs_extra=require(_0x0b9b('0xb'));var _=require('lodash');var squel=require(_0x0b9b('0xc'));var crypto=require(_0x0b9b('0xd'));var jsforce=require(_0x0b9b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0b9b('0xf'));var querystring=require(_0x0b9b('0x10'));var Papa=require(_0x0b9b('0x11'));var Redis=require(_0x0b9b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0b9b('0x13'));var as=require(_0x0b9b('0x14'));var hardwareService=require(_0x0b9b('0x15'));var logger=require(_0x0b9b('0x16'))(_0x0b9b('0x17'));var utils=require(_0x0b9b('0x18'));var config=require(_0x0b9b('0x19'));var licenseUtil=require(_0x0b9b('0x1a'));var db=require(_0x0b9b('0x1b'))['db'];function respondWithStatusCode(_0x717f08,_0x19969e){_0x19969e=_0x19969e||0xcc;return function(_0x28e5f5){if(_0x28e5f5){return _0x717f08[_0x0b9b('0x1c')](_0x19969e);}return _0x717f08['status'](_0x19969e)[_0x0b9b('0x1d')]();};}function respondWithResult(_0x32ccca,_0x3ec2a9){_0x3ec2a9=_0x3ec2a9||0xc8;return function(_0x505f2f){if(_0x505f2f){return _0x32ccca['status'](_0x3ec2a9)[_0x0b9b('0x1e')](_0x505f2f);}};}function respondWithFilteredResult(_0x4f8dd4,_0x7bd7dc){return function(_0x531f02){if(_0x531f02){var _0x90be67=typeof _0x7bd7dc[_0x0b9b('0x1f')]==='undefined'&&typeof _0x7bd7dc[_0x0b9b('0x20')]===_0x0b9b('0x21');var _0x28717c=_0x531f02[_0x0b9b('0x22')];var _0x231d16=_0x90be67?0x0:_0x7bd7dc['offset'];var _0x245e9b=_0x90be67?_0x531f02[_0x0b9b('0x22')]:_0x7bd7dc[_0x0b9b('0x1f')]+_0x7bd7dc[_0x0b9b('0x20')];var _0x5b4ca5;if(_0x245e9b>=_0x28717c){_0x245e9b=_0x28717c;_0x5b4ca5=0xc8;}else{_0x5b4ca5=0xce;}_0x4f8dd4['status'](_0x5b4ca5);return _0x4f8dd4[_0x0b9b('0x23')]('Content-Range',_0x231d16+'-'+_0x245e9b+'/'+_0x28717c)['json'](_0x531f02);}return null;};}function patchUpdates(_0x3ff1d3){return function(_0x4b164d){try{jsonpatch[_0x0b9b('0x24')](_0x4b164d,_0x3ff1d3,!![]);}catch(_0x4e3f5c){return BPromise[_0x0b9b('0x25')](_0x4e3f5c);}return _0x4b164d['save']();};}function saveUpdates(_0x202c60,_0x1222de){return function(_0x273ad9){if(_0x273ad9){return _0x273ad9[_0x0b9b('0x26')](_0x202c60)[_0x0b9b('0x27')](function(_0x38a54f){return _0x38a54f;});}return null;};}function removeEntity(_0x4443bd,_0x3555e2){return function(_0x3bab9a){if(_0x3bab9a){return _0x3bab9a[_0x0b9b('0x28')]()['then'](function(){_0x4443bd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cfbe6,_0xb44646){return function(_0x1f77d1){if(!_0x1f77d1){_0x2cfbe6[_0x0b9b('0x1c')](0x194);}return _0x1f77d1;};}function handleError(_0x3124e4,_0x1794d7){_0x1794d7=_0x1794d7||0x1f4;return function(_0x4bda99){logger['error'](_0x4bda99[_0x0b9b('0x29')]);if(_0x4bda99['name']){delete _0x4bda99[_0x0b9b('0x2a')];}_0x3124e4[_0x0b9b('0x2b')](_0x1794d7)[_0x0b9b('0x2c')](_0x4bda99);};}exports[_0x0b9b('0x2d')]=function(_0x3b965b,_0x415a61){var _0x46ea24={},_0x64be06={},_0x10e7ae={'count':0x0,'rows':[]};var _0x57c98f=_[_0x0b9b('0x2e')](db['SalesforceField'][_0x0b9b('0x2f')],function(_0x8f6f91){return{'name':_0x8f6f91['fieldName'],'type':_0x8f6f91[_0x0b9b('0x30')][_0x0b9b('0x31')]};});_0x64be06['model']=_['map'](_0x57c98f,_0x0b9b('0x2a'));_0x64be06[_0x0b9b('0x32')]=_[_0x0b9b('0x33')](_0x3b965b[_0x0b9b('0x32')]);_0x64be06['filters']=_[_0x0b9b('0x34')](_0x64be06['model'],_0x64be06[_0x0b9b('0x32')]);_0x46ea24['attributes']=_[_0x0b9b('0x34')](_0x64be06[_0x0b9b('0x35')],qs['fields'](_0x3b965b[_0x0b9b('0x32')][_0x0b9b('0x36')]));_0x46ea24['attributes']=_0x46ea24[_0x0b9b('0x37')][_0x0b9b('0x38')]?_0x46ea24[_0x0b9b('0x37')]:_0x64be06[_0x0b9b('0x35')];if(!_0x3b965b[_0x0b9b('0x32')][_0x0b9b('0x39')](_0x0b9b('0x3a'))){_0x46ea24[_0x0b9b('0x20')]=qs[_0x0b9b('0x20')](_0x3b965b[_0x0b9b('0x32')][_0x0b9b('0x20')]);_0x46ea24[_0x0b9b('0x1f')]=qs[_0x0b9b('0x1f')](_0x3b965b[_0x0b9b('0x32')][_0x0b9b('0x1f')]);}_0x46ea24[_0x0b9b('0x3b')]=qs[_0x0b9b('0x3c')](_0x3b965b['query'][_0x0b9b('0x3c')]);_0x46ea24[_0x0b9b('0x3d')]=qs['filters'](_['pick'](_0x3b965b[_0x0b9b('0x32')],_0x64be06[_0x0b9b('0x3e')]),_0x57c98f);if(_0x3b965b[_0x0b9b('0x32')][_0x0b9b('0x3f')]){_0x46ea24[_0x0b9b('0x3d')]=_['merge'](_0x46ea24[_0x0b9b('0x3d')],{'$or':_[_0x0b9b('0x2e')](_0x57c98f,function(_0x5045f0){if(_0x5045f0[_0x0b9b('0x30')]!==_0x0b9b('0x40')){var _0x2bfd13={};_0x2bfd13[_0x5045f0[_0x0b9b('0x2a')]]={'$like':'%'+_0x3b965b[_0x0b9b('0x32')][_0x0b9b('0x3f')]+'%'};return _0x2bfd13;}})});}_0x46ea24=_['merge']({},_0x46ea24,_0x3b965b[_0x0b9b('0x41')]);var _0x2b1bce={'where':_0x46ea24['where']};return db[_0x0b9b('0x42')]['count'](_0x2b1bce)[_0x0b9b('0x27')](function(_0x34f15c){_0x10e7ae[_0x0b9b('0x22')]=_0x34f15c;if(_0x3b965b['query']['includeAll']){_0x46ea24[_0x0b9b('0x43')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x46ea24);})[_0x0b9b('0x27')](function(_0x5e3784){_0x10e7ae[_0x0b9b('0x44')]=_0x5e3784;return _0x10e7ae;})[_0x0b9b('0x27')](respondWithFilteredResult(_0x415a61,_0x46ea24))[_0x0b9b('0x45')](handleError(_0x415a61,null));};exports[_0x0b9b('0x46')]=function(_0x5e84d8,_0x112a6c){var _0x35d8f5={'raw':!![],'where':{'id':_0x5e84d8[_0x0b9b('0x47')]['id']}},_0x100d47={};_0x100d47[_0x0b9b('0x35')]=_['keys'](db[_0x0b9b('0x42')][_0x0b9b('0x2f')]);_0x100d47['query']=_[_0x0b9b('0x33')](_0x5e84d8['query']);_0x100d47['filters']=_[_0x0b9b('0x34')](_0x100d47['model'],_0x100d47[_0x0b9b('0x32')]);_0x35d8f5['attributes']=_['intersection'](_0x100d47[_0x0b9b('0x35')],qs[_0x0b9b('0x36')](_0x5e84d8[_0x0b9b('0x32')][_0x0b9b('0x36')]));_0x35d8f5[_0x0b9b('0x37')]=_0x35d8f5[_0x0b9b('0x37')][_0x0b9b('0x38')]?_0x35d8f5['attributes']:_0x100d47[_0x0b9b('0x35')];if(_0x5e84d8[_0x0b9b('0x32')][_0x0b9b('0x48')]){_0x35d8f5[_0x0b9b('0x43')]=[{'all':!![]}];}_0x35d8f5=_['merge']({},_0x35d8f5,_0x5e84d8[_0x0b9b('0x41')]);return db[_0x0b9b('0x42')][_0x0b9b('0x49')](_0x35d8f5)[_0x0b9b('0x27')](handleEntityNotFound(_0x112a6c,null))[_0x0b9b('0x27')](respondWithResult(_0x112a6c,null))[_0x0b9b('0x45')](handleError(_0x112a6c,null));};exports[_0x0b9b('0x4a')]=function(_0x33ef5f,_0x48c3c0){return db['SalesforceField'][_0x0b9b('0x4a')](_0x33ef5f[_0x0b9b('0x4b')],{})[_0x0b9b('0x27')](respondWithResult(_0x48c3c0,0xc9))['catch'](handleError(_0x48c3c0,null));};exports[_0x0b9b('0x26')]=function(_0x18887e,_0x3d060b){if(_0x18887e[_0x0b9b('0x4b')]['id']){delete _0x18887e[_0x0b9b('0x4b')]['id'];}return db[_0x0b9b('0x42')][_0x0b9b('0x49')]({'where':{'id':_0x18887e[_0x0b9b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3d060b,null))[_0x0b9b('0x27')](saveUpdates(_0x18887e[_0x0b9b('0x4b')],null))[_0x0b9b('0x27')](respondWithResult(_0x3d060b,null))[_0x0b9b('0x45')](handleError(_0x3d060b,null));};exports[_0x0b9b('0x28')]=function(_0x4d7719,_0x1e7920){return db[_0x0b9b('0x42')]['find']({'where':{'id':_0x4d7719[_0x0b9b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1e7920,null))['then'](removeEntity(_0x1e7920,null))[_0x0b9b('0x45')](handleError(_0x1e7920,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1b475d4..4259994 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 _0x2052=['int_salesforce_fields','idField','FieldId','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField'];(function(_0xe28845,_0x1829fc){var _0x6b0f8b=function(_0x3d93f8){while(--_0x3d93f8){_0xe28845['push'](_0xe28845['shift']());}};_0x6b0f8b(++_0x1829fc);}(_0x2052,0x1ed));var _0x2205=function(_0x541c4b,_0x22acbc){_0x541c4b=_0x541c4b-0x0;var _0x5c2780=_0x2052[_0x541c4b];return _0x5c2780;};'use strict';var _=require(_0x2205('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2205('0x1'));var BPromise=require(_0x2205('0x2'));var rp=require(_0x2205('0x3'));var fs=require('fs');var path=require(_0x2205('0x4'));var rimraf=require(_0x2205('0x5'));var config=require(_0x2205('0x6'));var attributes=require(_0x2205('0x7'));module[_0x2205('0x8')]=function(_0x291c57,_0x2d1949){return _0x291c57[_0x2205('0x9')](_0x2205('0xa'),attributes,{'tableName':_0x2205('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x2205('0xc'),_0x2205('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe93c=['define','SalesforceField','int_salesforce_fields','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x1bd420,_0x422a0a){var _0x51f444=function(_0x279af6){while(--_0x279af6){_0x1bd420['push'](_0x1bd420['shift']());}};_0x51f444(++_0x422a0a);}(_0xe93c,0x1c4));var _0xce93=function(_0x336b85,_0x418a5f){_0x336b85=_0x336b85-0x0;var _0x181ba7=_0xe93c[_0x336b85];return _0x181ba7;};'use strict';var _=require(_0xce93('0x0'));var util=require(_0xce93('0x1'));var logger=require('../../config/logger')(_0xce93('0x2'));var moment=require(_0xce93('0x3'));var BPromise=require(_0xce93('0x4'));var rp=require(_0xce93('0x5'));var fs=require('fs');var path=require(_0xce93('0x6'));var rimraf=require(_0xce93('0x7'));var config=require(_0xce93('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0xce93('0x9')]=function(_0x13ed66,_0x802277){return _0x13ed66[_0xce93('0xa')](_0xce93('0xb'),attributes,{'tableName':_0xce93('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xce93('0xd')],'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 d7eb3d6..56c4462 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 _0xf3d1=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0xf3d1,0x137));var _0x1f3d=function(_0x206498,_0x2fe953){_0x206498=_0x206498-0x0;var _0x54a0d0=_0xf3d1[_0x206498];return _0x54a0d0;};'use strict';var _=require(_0x1f3d('0x0'));var util=require(_0x1f3d('0x1'));var moment=require(_0x1f3d('0x2'));var BPromise=require(_0x1f3d('0x3'));var rs=require(_0x1f3d('0x4'));var fs=require('fs');var Redis=require(_0x1f3d('0x5'));var db=require(_0x1f3d('0x6'))['db'];var utils=require(_0x1f3d('0x7'));var logger=require(_0x1f3d('0x8'))(_0x1f3d('0x9'));var config=require('../../config/environment');var jayson=require(_0x1f3d('0xa'));var client=jayson['client'][_0x1f3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcef792,_0x518250,_0x33feb1){return new BPromise(function(_0x5deb7f,_0x2d334e){return client[_0x1f3d('0xc')](_0xcef792,_0x33feb1)[_0x1f3d('0xd')](function(_0x2cea05){logger[_0x1f3d('0xe')](_0x1f3d('0xf'),_0x518250,_0x1f3d('0x10'));logger[_0x1f3d('0x11')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x518250,'request\x20sent',JSON[_0x1f3d('0x12')](_0x2cea05));if(_0x2cea05['error']){if(_0x2cea05[_0x1f3d('0x13')]['code']===0x1f4){logger['error'](_0x1f3d('0xf'),_0x518250,_0x2cea05[_0x1f3d('0x13')][_0x1f3d('0x14')]);return _0x2d334e(_0x2cea05[_0x1f3d('0x13')][_0x1f3d('0x14')]);}logger['error'](_0x1f3d('0xf'),_0x518250,_0x2cea05[_0x1f3d('0x13')][_0x1f3d('0x14')]);return _0x5deb7f(_0x2cea05[_0x1f3d('0x13')][_0x1f3d('0x14')]);}else{logger[_0x1f3d('0xe')](_0x1f3d('0xf'),_0x518250,_0x1f3d('0x10'));_0x5deb7f(_0x2cea05[_0x1f3d('0x15')][_0x1f3d('0x14')]);}})['catch'](function(_0x264cdc){logger[_0x1f3d('0x13')]('SalesforceField,\x20%s,\x20%s',_0x518250,_0x264cdc);_0x2d334e(_0x264cdc);});});} \ No newline at end of file +var _0x8cee=['http','then','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2b0e72,_0x7bd6e7){var _0x355161=function(_0x17b749){while(--_0x17b749){_0x2b0e72['push'](_0x2b0e72['shift']());}};_0x355161(++_0x7bd6e7);}(_0x8cee,0xae));var _0xe8ce=function(_0x369f77,_0x1ed585){_0x369f77=_0x369f77-0x0;var _0x2b0a62=_0x8cee[_0x369f77];return _0x2b0a62;};'use strict';var _=require('lodash');var util=require(_0xe8ce('0x0'));var moment=require(_0xe8ce('0x1'));var BPromise=require(_0xe8ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8ce('0x3'));var db=require(_0xe8ce('0x4'))['db'];var utils=require(_0xe8ce('0x5'));var logger=require(_0xe8ce('0x6'))(_0xe8ce('0x7'));var config=require(_0xe8ce('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe8ce('0x9')][_0xe8ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x886d10,_0x21f387,_0x40eeee){return new BPromise(function(_0x41f6b7,_0x14327d){return client['request'](_0x886d10,_0x40eeee)[_0xe8ce('0xb')](function(_0x188b0b){logger['info'](_0xe8ce('0xc'),_0x21f387,'request\x20sent');logger[_0xe8ce('0xd')](_0xe8ce('0xe'),_0x21f387,_0xe8ce('0xf'),JSON[_0xe8ce('0x10')](_0x188b0b));if(_0x188b0b[_0xe8ce('0x11')]){if(_0x188b0b['error'][_0xe8ce('0x12')]===0x1f4){logger[_0xe8ce('0x11')](_0xe8ce('0xc'),_0x21f387,_0x188b0b[_0xe8ce('0x11')]['message']);return _0x14327d(_0x188b0b[_0xe8ce('0x11')][_0xe8ce('0x13')]);}logger[_0xe8ce('0x11')]('SalesforceField,\x20%s,\x20%s',_0x21f387,_0x188b0b[_0xe8ce('0x11')][_0xe8ce('0x13')]);return _0x41f6b7(_0x188b0b[_0xe8ce('0x11')][_0xe8ce('0x13')]);}else{logger[_0xe8ce('0x14')](_0xe8ce('0xc'),_0x21f387,_0xe8ce('0xf'));_0x41f6b7(_0x188b0b[_0xe8ce('0x15')][_0xe8ce('0x13')]);}})[_0xe8ce('0x16')](function(_0xeb7d75){logger[_0xe8ce('0x11')](_0xe8ce('0xc'),_0x21f387,_0xeb7d75);_0x14327d(_0xeb7d75);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 8300ef3..ccf8406 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 _0xf78d=['./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x26f74b,_0x4a5907){var _0x359896=function(_0x43e2a7){while(--_0x43e2a7){_0x26f74b['push'](_0x26f74b['shift']());}};_0x359896(++_0x4a5907);}(_0xf78d,0x1c7));var _0xdf78=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf78d[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xdf78('0x0'));var path=require(_0xdf78('0x1'));var timeout=require(_0xdf78('0x2'));var express=require(_0xdf78('0x3'));var router=express[_0xdf78('0x4')]();var fs_extra=require(_0xdf78('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdf78('0x6'));var controller=require(_0xdf78('0x7'));router[_0xdf78('0x8')]('/',auth[_0xdf78('0x9')](),controller[_0xdf78('0xa')]);router[_0xdf78('0x8')](_0xdf78('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdf78('0x8')](_0xdf78('0xc'),auth['isAuthenticated'](),controller[_0xdf78('0xd')]);router[_0xdf78('0x8')](_0xdf78('0xe'),auth[_0xdf78('0x9')](),controller[_0xdf78('0xf')]);router[_0xdf78('0x10')]('/',auth[_0xdf78('0x9')](),controller[_0xdf78('0x11')]);router[_0xdf78('0x10')](_0xdf78('0xc'),auth['isAuthenticated'](),controller[_0xdf78('0x12')]);router['put'](_0xdf78('0xb'),auth[_0xdf78('0x9')](),controller[_0xdf78('0x13')]);router[_0xdf78('0x14')](_0xdf78('0xb'),auth[_0xdf78('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8696=['get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x8696,0x143));var _0x6869=function(_0x184c3b,_0x3bc676){_0x184c3b=_0x184c3b-0x0;var _0x5300e6=_0x8696[_0x184c3b];return _0x5300e6;};'use strict';var multer=require(_0x6869('0x0'));var util=require(_0x6869('0x1'));var path=require('path');var timeout=require(_0x6869('0x2'));var express=require('express');var router=express[_0x6869('0x3')]();var fs_extra=require(_0x6869('0x4'));var auth=require(_0x6869('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6869('0x6'));var controller=require('./intServicenowAccount.controller');router[_0x6869('0x7')]('/',auth[_0x6869('0x8')](),controller['index']);router['get'](_0x6869('0x9'),auth[_0x6869('0x8')](),controller[_0x6869('0xa')]);router[_0x6869('0x7')](_0x6869('0xb'),auth[_0x6869('0x8')](),controller[_0x6869('0xc')]);router['get'](_0x6869('0xd'),auth[_0x6869('0x8')](),controller[_0x6869('0xe')]);router[_0x6869('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x6869('0xb'),auth[_0x6869('0x8')](),controller[_0x6869('0x10')]);router[_0x6869('0x11')](_0x6869('0x9'),auth['isAuthenticated'](),controller[_0x6869('0x12')]);router[_0x6869('0x13')]('/:id',auth[_0x6869('0x8')](),controller[_0x6869('0x14')]);module[_0x6869('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index d004065..0f2a466 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 _0x3491=['username','remoteUri','sequelize','STRING'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x3491,0x1b2));var _0x1349=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3491[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x1349('0x0'));module['exports']={'name':{'type':Sequelize[_0x1349('0x1')]},'description':{'type':Sequelize[_0x1349('0x1')]},'username':{'type':Sequelize[_0x1349('0x1')],'unique':_0x1349('0x2')},'password':{'type':Sequelize[_0x1349('0x1')]},'email':{'type':Sequelize[_0x1349('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1349('0x3')},'serverUrl':{'type':Sequelize[_0x1349('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xbe55=['STRING','remoteUri','sequelize','exports'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xbe55,0xaa));var _0x5be5=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xbe55[_0x257642];return _0x3d813b;};'use strict';var Sequelize=require(_0x5be5('0x0'));module[_0x5be5('0x1')]={'name':{'type':Sequelize[_0x5be5('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x5be5('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x5be5('0x2')]},'email':{'type':Sequelize[_0x5be5('0x2')]},'remoteUri':{'type':Sequelize[_0x5be5('0x2')],'unique':_0x5be5('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 66e92f9..f7547a4 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 _0x1b7f=['includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','result','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','ServicenowAccount','include','rows','catch','show','params','length','includeAll','find','create','body','destroy','getConfigurations','ServicenowConfiguration','pick','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','contact_type','urgency','reassignment_count','activity_due','assigned_to','severity','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','location','username','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','internalType','label','push','all','TCL:\x20_object'];(function(_0x498026,_0x317300){var _0x3363d2=function(_0x4206ea){while(--_0x4206ea){_0x498026['push'](_0x498026['shift']());}};_0x3363d2(++_0x317300);}(_0x1b7f,0xc6));var _0xf1b7=function(_0xe7c3c3,_0xee8300){_0xe7c3c3=_0xe7c3c3-0x0;var _0x306392=_0x1b7f[_0xe7c3c3];return _0x306392;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf1b7('0x0'));var zipdir=require(_0xf1b7('0x1'));var jsonpatch=require(_0xf1b7('0x2'));var rp=require(_0xf1b7('0x3'));var moment=require(_0xf1b7('0x4'));var BPromise=require(_0xf1b7('0x5'));var Mustache=require('mustache');var util=require(_0xf1b7('0x6'));var path=require(_0xf1b7('0x7'));var sox=require(_0xf1b7('0x8'));var csv=require('to-csv');var ejs=require(_0xf1b7('0x9'));var fs=require('fs');var fs_extra=require(_0xf1b7('0xa'));var _=require('lodash');var squel=require(_0xf1b7('0xb'));var crypto=require(_0xf1b7('0xc'));var jsforce=require(_0xf1b7('0xd'));var deskjs=require(_0xf1b7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf1b7('0xf'));var Papa=require(_0xf1b7('0x10'));var Redis=require(_0xf1b7('0x11'));var authService=require(_0xf1b7('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf1b7('0x13'));var hardwareService=require(_0xf1b7('0x14'));var logger=require('../../config/logger')(_0xf1b7('0x15'));var utils=require('../../config/utils');var config=require(_0xf1b7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1b7('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1be620,_0x1b83e0){_0x1b83e0=_0x1b83e0||0xcc;return function(_0x3ebd29){if(_0x3ebd29){return _0x1be620[_0xf1b7('0x18')](_0x1b83e0);}return _0x1be620[_0xf1b7('0x19')](_0x1b83e0)[_0xf1b7('0x1a')]();};}function respondWithResult(_0x4c8fcc,_0x2179c9){_0x2179c9=_0x2179c9||0xc8;return function(_0x29fc7b){if(_0x29fc7b){return _0x4c8fcc[_0xf1b7('0x19')](_0x2179c9)[_0xf1b7('0x1b')](_0x29fc7b);}};}function respondWithFilteredResult(_0x1fa7e4,_0x2a8275){return function(_0x1b94f9){if(_0x1b94f9){var _0x46a36c=typeof _0x2a8275[_0xf1b7('0x1c')]===_0xf1b7('0x1d')&&typeof _0x2a8275['limit']===_0xf1b7('0x1d');var _0x47ff27=_0x1b94f9['count'];var _0x36eec8=_0x46a36c?0x0:_0x2a8275[_0xf1b7('0x1c')];var _0x4309b8=_0x46a36c?_0x1b94f9[_0xf1b7('0x1e')]:_0x2a8275[_0xf1b7('0x1c')]+_0x2a8275[_0xf1b7('0x1f')];var _0x297825;if(_0x4309b8>=_0x47ff27){_0x4309b8=_0x47ff27;_0x297825=0xc8;}else{_0x297825=0xce;}_0x1fa7e4[_0xf1b7('0x19')](_0x297825);return _0x1fa7e4[_0xf1b7('0x20')](_0xf1b7('0x21'),_0x36eec8+'-'+_0x4309b8+'/'+_0x47ff27)[_0xf1b7('0x1b')](_0x1b94f9);}return null;};}function patchUpdates(_0x266f94){return function(_0x208003){try{jsonpatch['apply'](_0x208003,_0x266f94,!![]);}catch(_0x49c6d5){return BPromise[_0xf1b7('0x22')](_0x49c6d5);}return _0x208003['save']();};}function saveUpdates(_0x54eb6c,_0x48b84c){return function(_0x54f9af){if(_0x54f9af){return _0x54f9af[_0xf1b7('0x23')](_0x54eb6c)[_0xf1b7('0x24')](function(_0x57cd74){return _0x57cd74;});}return null;};}function removeEntity(_0x42757e,_0x10fb75){return function(_0x56dd98){if(_0x56dd98){return _0x56dd98['destroy']()[_0xf1b7('0x24')](function(){_0x42757e[_0xf1b7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bf4f1,_0x557eec){return function(_0x5b5692){if(!_0x5b5692){_0x5bf4f1[_0xf1b7('0x18')](0x194);}return _0x5b5692;};}function handleError(_0x2d5bb4,_0x5d6c71){_0x5d6c71=_0x5d6c71||0x1f4;return function(_0x5f0d31){logger[_0xf1b7('0x25')](_0x5f0d31[_0xf1b7('0x26')]);if(_0x5f0d31[_0xf1b7('0x27')]){delete _0x5f0d31[_0xf1b7('0x27')];}_0x2d5bb4['status'](_0x5d6c71)[_0xf1b7('0x28')](_0x5f0d31);};}exports[_0xf1b7('0x29')]=function(_0x340ef9,_0x1a2863){var _0x726a99={},_0x558cec={},_0x4cf2d4={'count':0x0,'rows':[]};var _0x31430e=_[_0xf1b7('0x2a')](db['ServicenowAccount'][_0xf1b7('0x2b')],function(_0x3ecdca){return{'name':_0x3ecdca['fieldName'],'type':_0x3ecdca[_0xf1b7('0x2c')]['key']};});_0x558cec[_0xf1b7('0x2d')]=_['map'](_0x31430e,_0xf1b7('0x27'));_0x558cec[_0xf1b7('0x2e')]=_[_0xf1b7('0x2f')](_0x340ef9[_0xf1b7('0x2e')]);_0x558cec[_0xf1b7('0x30')]=_[_0xf1b7('0x31')](_0x558cec[_0xf1b7('0x2d')],_0x558cec[_0xf1b7('0x2e')]);_0x726a99[_0xf1b7('0x32')]=_[_0xf1b7('0x31')](_0x558cec[_0xf1b7('0x2d')],qs[_0xf1b7('0x33')](_0x340ef9['query'][_0xf1b7('0x33')]));_0x726a99[_0xf1b7('0x32')]=_0x726a99[_0xf1b7('0x32')]['length']?_0x726a99[_0xf1b7('0x32')]:_0x558cec[_0xf1b7('0x2d')];if(!_0x340ef9[_0xf1b7('0x2e')][_0xf1b7('0x34')]('nolimit')){_0x726a99['limit']=qs[_0xf1b7('0x1f')](_0x340ef9['query']['limit']);_0x726a99[_0xf1b7('0x1c')]=qs[_0xf1b7('0x1c')](_0x340ef9['query'][_0xf1b7('0x1c')]);}_0x726a99[_0xf1b7('0x35')]=qs[_0xf1b7('0x36')](_0x340ef9['query'][_0xf1b7('0x36')]);_0x726a99[_0xf1b7('0x37')]=qs[_0xf1b7('0x30')](_['pick'](_0x340ef9['query'],_0x558cec[_0xf1b7('0x30')]),_0x31430e);if(_0x340ef9['query'][_0xf1b7('0x38')]){_0x726a99[_0xf1b7('0x37')]=_[_0xf1b7('0x39')](_0x726a99[_0xf1b7('0x37')],{'$or':_[_0xf1b7('0x2a')](_0x31430e,function(_0x3201b6){if(_0x3201b6['type']!==_0xf1b7('0x3a')){var _0xcf4e5d={};_0xcf4e5d[_0x3201b6[_0xf1b7('0x27')]]={'$like':'%'+_0x340ef9[_0xf1b7('0x2e')][_0xf1b7('0x38')]+'%'};return _0xcf4e5d;}})});}_0x726a99=_[_0xf1b7('0x39')]({},_0x726a99,_0x340ef9[_0xf1b7('0x3b')]);var _0x25583d={'where':_0x726a99[_0xf1b7('0x37')]};return db[_0xf1b7('0x3c')][_0xf1b7('0x1e')](_0x25583d)[_0xf1b7('0x24')](function(_0x54cf08){_0x4cf2d4[_0xf1b7('0x1e')]=_0x54cf08;if(_0x340ef9[_0xf1b7('0x2e')]['includeAll']){_0x726a99[_0xf1b7('0x3d')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x726a99);})[_0xf1b7('0x24')](function(_0x40ad7e){_0x4cf2d4[_0xf1b7('0x3e')]=_0x40ad7e;return _0x4cf2d4;})['then'](respondWithFilteredResult(_0x1a2863,_0x726a99))[_0xf1b7('0x3f')](handleError(_0x1a2863,null));};exports[_0xf1b7('0x40')]=function(_0x21c6be,_0x7aa449){var _0x32d5bb={'raw':![],'where':{'id':_0x21c6be[_0xf1b7('0x41')]['id']}},_0x1f3a8f={};_0x1f3a8f[_0xf1b7('0x2d')]=_[_0xf1b7('0x2f')](db[_0xf1b7('0x3c')]['rawAttributes']);_0x1f3a8f['query']=_[_0xf1b7('0x2f')](_0x21c6be[_0xf1b7('0x2e')]);_0x1f3a8f[_0xf1b7('0x30')]=_['intersection'](_0x1f3a8f[_0xf1b7('0x2d')],_0x1f3a8f[_0xf1b7('0x2e')]);_0x32d5bb['attributes']=_[_0xf1b7('0x31')](_0x1f3a8f[_0xf1b7('0x2d')],qs[_0xf1b7('0x33')](_0x21c6be['query'][_0xf1b7('0x33')]));_0x32d5bb[_0xf1b7('0x32')]=_0x32d5bb[_0xf1b7('0x32')][_0xf1b7('0x42')]?_0x32d5bb[_0xf1b7('0x32')]:_0x1f3a8f[_0xf1b7('0x2d')];if(_0x21c6be[_0xf1b7('0x2e')][_0xf1b7('0x43')]){_0x32d5bb['include']=[{'all':!![]}];}_0x32d5bb=_[_0xf1b7('0x39')]({},_0x32d5bb,_0x21c6be['options']);return db[_0xf1b7('0x3c')][_0xf1b7('0x44')](_0x32d5bb)[_0xf1b7('0x24')](handleEntityNotFound(_0x7aa449,null))[_0xf1b7('0x24')](respondWithResult(_0x7aa449,null))[_0xf1b7('0x3f')](handleError(_0x7aa449,null));};exports[_0xf1b7('0x45')]=function(_0x311aa9,_0x2b1047){return db[_0xf1b7('0x3c')]['create'](_0x311aa9[_0xf1b7('0x46')],{})[_0xf1b7('0x24')](respondWithResult(_0x2b1047,0xc9))['catch'](handleError(_0x2b1047,null));};exports['update']=function(_0x4672b2,_0x6cb491){if(_0x4672b2['body']['id']){delete _0x4672b2['body']['id'];}return db[_0xf1b7('0x3c')]['find']({'where':{'id':_0x4672b2[_0xf1b7('0x41')]['id']}})[_0xf1b7('0x24')](handleEntityNotFound(_0x6cb491,null))[_0xf1b7('0x24')](saveUpdates(_0x4672b2['body'],null))['then'](respondWithResult(_0x6cb491,null))[_0xf1b7('0x3f')](handleError(_0x6cb491,null));};exports[_0xf1b7('0x47')]=function(_0x412b5a,_0x505cdf){return db[_0xf1b7('0x3c')]['find']({'where':{'id':_0x412b5a['params']['id']}})['then'](handleEntityNotFound(_0x505cdf,null))[_0xf1b7('0x24')](removeEntity(_0x505cdf,null))[_0xf1b7('0x3f')](handleError(_0x505cdf,null));};exports[_0xf1b7('0x48')]=function(_0x49d690,_0x1fd88e,_0x356f21){var _0x2324af={};var _0x2da813={};var _0x3619a3;var _0x5ecaa4;return db[_0xf1b7('0x3c')]['findOne']({'where':{'id':_0x49d690['params']['id']}})[_0xf1b7('0x24')](handleEntityNotFound(_0x1fd88e,null))['then'](function(_0x514405){if(_0x514405){_0x3619a3=_0x514405;_0x2da813['model']=_['keys'](db[_0xf1b7('0x49')][_0xf1b7('0x2b')]);_0x2da813[_0xf1b7('0x2e')]=_[_0xf1b7('0x2f')](_0x49d690[_0xf1b7('0x2e')]);_0x2da813[_0xf1b7('0x30')]=_[_0xf1b7('0x31')](_0x2da813[_0xf1b7('0x2d')],_0x2da813[_0xf1b7('0x2e')]);_0x2324af[_0xf1b7('0x32')]=_[_0xf1b7('0x31')](_0x2da813[_0xf1b7('0x2d')],qs[_0xf1b7('0x33')](_0x49d690[_0xf1b7('0x2e')][_0xf1b7('0x33')]));_0x2324af[_0xf1b7('0x32')]=_0x2324af[_0xf1b7('0x32')][_0xf1b7('0x42')]?_0x2324af['attributes']:_0x2da813[_0xf1b7('0x2d')];_0x2324af[_0xf1b7('0x35')]=qs[_0xf1b7('0x36')](_0x49d690[_0xf1b7('0x2e')][_0xf1b7('0x36')]);_0x2324af[_0xf1b7('0x37')]=qs[_0xf1b7('0x30')](_[_0xf1b7('0x4a')](_0x49d690[_0xf1b7('0x2e')],_0x2da813[_0xf1b7('0x30')]));if(_0x49d690[_0xf1b7('0x2e')][_0xf1b7('0x38')]){_0x2324af[_0xf1b7('0x37')]=_['merge'](_0x2324af[_0xf1b7('0x37')],{'$or':_[_0xf1b7('0x2a')](_0x2324af['attributes'],function(_0x19d740){var _0x256b81={};_0x256b81[_0x19d740]={'$like':'%'+_0x49d690[_0xf1b7('0x2e')]['filter']+'%'};return _0x256b81;})});}_0x2324af=_[_0xf1b7('0x39')]({},_0x2324af,_0x49d690[_0xf1b7('0x3b')]);return _0x3619a3['getConfigurations'](_0x2324af);}})[_0xf1b7('0x24')](function(_0x331ec8){if(_0x331ec8){_0x5ecaa4=_0x331ec8[_0xf1b7('0x42')];if(!_0x49d690[_0xf1b7('0x2e')][_0xf1b7('0x34')]('nolimit')){_0x2324af[_0xf1b7('0x1f')]=qs[_0xf1b7('0x1f')](_0x49d690[_0xf1b7('0x2e')][_0xf1b7('0x1f')]);_0x2324af['offset']=qs['offset'](_0x49d690[_0xf1b7('0x2e')][_0xf1b7('0x1c')]);}return _0x3619a3[_0xf1b7('0x48')](_0x2324af);}})[_0xf1b7('0x24')](function(_0x49dba9){if(_0x49dba9){return _0x49dba9?{'count':_0x5ecaa4,'rows':_0x49dba9}:null;}})['then'](respondWithResult(_0x1fd88e,null))[_0xf1b7('0x3f')](handleError(_0x1fd88e,null));};exports['addConfiguration']=function(_0x145f07,_0x509765,_0x4c5e57){if(_0x145f07['body']['id']){delete _0x145f07[_0xf1b7('0x46')]['id'];}return db[_0xf1b7('0x3c')][_0xf1b7('0x4b')]({'where':{'id':_0x145f07['params']['id']}})[_0xf1b7('0x24')](handleEntityNotFound(_0x509765,null))[_0xf1b7('0x24')](function(_0x17457e){if(_0x17457e){_0x145f07[_0xf1b7('0x46')][_0xf1b7('0x4c')]=_0x17457e['id'];_0x145f07[_0xf1b7('0x46')][_0xf1b7('0x4d')]=integrations[_0xf1b7('0x4e')](_0x145f07['body'][_0xf1b7('0x4f')],_0x145f07[_0xf1b7('0x46')][_0xf1b7('0x2c')]);_0x145f07['body'][_0xf1b7('0x50')]=integrations[_0xf1b7('0x51')](_0x145f07[_0xf1b7('0x46')]['channel'],_0x145f07['body']['type']);return db[_0xf1b7('0x49')][_0xf1b7('0x45')](_0x145f07['body'],{'include':[{'model':db[_0xf1b7('0x52')],'as':_0xf1b7('0x4d')},{'model':db[_0xf1b7('0x52')],'as':'Descriptions'}]});}return null;})[_0xf1b7('0x24')](respondWithResult(_0x509765,null))[_0xf1b7('0x3f')](handleError(_0x509765,null));};exports[_0xf1b7('0x53')]=function(_0x1f1f4c,_0x41f4b9,_0x45ccc2){var _0x540be1=[_0xf1b7('0x54'),_0xf1b7('0x55'),_0xf1b7('0x56'),_0xf1b7('0x57'),_0xf1b7('0x58'),_0xf1b7('0x59'),'incident_state','severity','category'];var _0x20923c=[_0xf1b7('0x5a'),_0xf1b7('0x54'),_0xf1b7('0x5b'),_0xf1b7('0x5c'),'upon_reject',_0xf1b7('0x5d'),_0xf1b7('0x5e'),'hold_reason',_0xf1b7('0x5f'),_0xf1b7('0x60'),_0xf1b7('0x61'),'sys_updated_by',_0xf1b7('0x62'),_0xf1b7('0x63'),_0xf1b7('0x64'),_0xf1b7('0x65'),'state',_0xf1b7('0x66'),_0xf1b7('0x56'),'order',_0xf1b7('0x67'),_0xf1b7('0x68'),'cmdb_ci','delivery_plan',_0xf1b7('0x69'),'active',_0xf1b7('0x6a'),_0xf1b7('0x6b'),_0xf1b7('0x6c'),_0xf1b7('0x6d'),_0xf1b7('0x6e'),_0xf1b7('0x6f'),_0xf1b7('0x70'),_0xf1b7('0x71'),'business_duration',_0xf1b7('0x72'),_0xf1b7('0x73'),_0xf1b7('0x74'),_0xf1b7('0x75'),'caller_id',_0xf1b7('0x76'),'subcategory',_0xf1b7('0x77'),_0xf1b7('0x78'),_0xf1b7('0x58'),_0xf1b7('0x79'),_0xf1b7('0x7a'),_0xf1b7('0x7b'),'assignment_group',_0xf1b7('0x7c'),_0xf1b7('0x7d'),'description',_0xf1b7('0x7e'),_0xf1b7('0x59'),_0xf1b7('0x7f'),_0xf1b7('0x80'),_0xf1b7('0x81'),_0xf1b7('0x82'),_0xf1b7('0x83'),'sys_id',_0xf1b7('0x84'),'reopened_by','incident_state',_0xf1b7('0x85'),'problem_id','company',_0xf1b7('0x86'),_0xf1b7('0x87'),_0xf1b7('0x88'),_0xf1b7('0x89'),'comments',_0xf1b7('0x8a'),_0xf1b7('0x8b'),_0xf1b7('0x8c'),_0xf1b7('0x8d'),_0xf1b7('0x8e'),_0xf1b7('0x8f'),'sys_tags',_0xf1b7('0x90'),_0xf1b7('0x91'),'correlation_id',_0xf1b7('0x92'),'category'];var _0x43d41f='';var _0xaab14d='';var _0x491c63=[];var _0x424c9d='';var _0x380365='';var _0x5a8dac=[];var _0x1b0bbf='';var _0x217816='';var _0x198ac3={};var _0x50f503='';return db[_0xf1b7('0x3c')]['findOne']({'where':{'id':_0x1f1f4c[_0xf1b7('0x41')]['id']},'attributes':['id',_0xf1b7('0x93'),'password',_0xf1b7('0x94'),_0xf1b7('0x95'),'serverUrl']})['then'](handleEntityNotFound(_0x41f4b9,null))[_0xf1b7('0x24')](function(_0x128047){if(_0x128047){_0x50f503=_0x128047[_0xf1b7('0x95')];var _0x25ca61=_0x50f503[_0xf1b7('0x96')](-0x1);if(_0x25ca61==='/'){_0x50f503=_0x50f503[_0xf1b7('0x97')](0x0,_0x50f503[_0xf1b7('0x98')](_0x25ca61));}_0x217816=util[_0xf1b7('0x99')]('%s/api/now/doc/table/schema/',_0x50f503);_0x1b0bbf=util[_0xf1b7('0x99')](_0xf1b7('0x9a'),_0x50f503);_0x198ac3={'user':_0x128047[_0xf1b7('0x93')],'pass':_0x128047['password']};var _0x219a0c={'method':_0xf1b7('0x9b'),'uri':_0x217816+_0xf1b7('0x9c'),'auth':_0x198ac3,'json':!![]};return rp(_0x219a0c);}})[_0xf1b7('0x24')](function(_0x37d7fa){if(_0x37d7fa['result'][_0xf1b7('0x42')]>0x0){_0x43d41f=_0x37d7fa['result'];}console[_0xf1b7('0x9d')](_0xf1b7('0x9e'),_0x43d41f);_0x5a8dac=[];_0xaab14d=Object[_0xf1b7('0x9f')]([],_0x43d41f);_[_0xf1b7('0xa0')](_0xaab14d,function(_0x4226eb){return!_0x540be1['includes'](_0x4226eb['name']);});_0xaab14d['forEach'](function(_0x3f711c){var _0x6e00f3=createFieldObject(_0x1b0bbf,_0x198ac3,_0x3f711c[_0xf1b7('0xa1')],_0x3f711c[_0xf1b7('0x27')],_0x3f711c[_0xf1b7('0xa2')],![]);_0x5a8dac[_0xf1b7('0xa3')](_0x6e00f3);});return Promise[_0xf1b7('0xa4')](_0x5a8dac);})['then'](function(_0x21160b){_0x491c63=_0x21160b;_0x424c9d=Object[_0xf1b7('0x9f')]([],_0x43d41f);console[_0xf1b7('0x9d')](_0xf1b7('0xa5'),_0x43d41f);_[_0xf1b7('0xa0')](_0x424c9d,function(_0x2a22c3){return _0x20923c[_0xf1b7('0xa6')](_0x2a22c3[_0xf1b7('0x27')]);});console[_0xf1b7('0x9d')](_0xf1b7('0xa7'),_0x424c9d);_0x5a8dac=[];_0x424c9d[_0xf1b7('0xa8')](function(_0x4441f4){var _0x183d64=createFieldObject(_0x1b0bbf,_0x198ac3,_0x4441f4[_0xf1b7('0xa1')],_0x4441f4[_0xf1b7('0x27')],_0x4441f4[_0xf1b7('0xa2')],!![]);_0x5a8dac[_0xf1b7('0xa3')](_0x183d64);});return Promise[_0xf1b7('0xa4')](_0x5a8dac);})['then'](function(_0x192551){_0x380365=_0x192551;var _0x29ad33=_0x491c63[_0xf1b7('0xa9')](_0x380365);return{'count':_0x29ad33[_0xf1b7('0x42')],'rows':_0x29ad33};})[_0xf1b7('0x24')](respondWithResult(_0x41f4b9,null))[_0xf1b7('0x3f')](function(_0x805d56){console[_0xf1b7('0x9d')](_0xf1b7('0xaa')+_0x805d56);var _0x2ac4f5=_0x1f1f4c['query'][_0xf1b7('0xab')]?0x1f4:_0x805d56[_0xf1b7('0xac')]||0x1f4;logger[_0xf1b7('0x25')](_0x805d56['stack']);delete _0x805d56['name'];if(_0x2ac4f5===0x191){_0x2ac4f5=0x190;}_0x41f4b9['status'](_0x2ac4f5)[_0xf1b7('0x28')](_0x1f1f4c[_0xf1b7('0x2e')][_0xf1b7('0xab')]?{'message':_0xf1b7('0xad'),'statusCode':_0x805d56[_0xf1b7('0xac')]}:_0x805d56);});};function createFieldObject(_0x2925cf,_0x3b441a,_0x16422e,_0x5d7b3e,_0x2a4a53,_0x3a79a6){return new Promise(function(_0x52ffe1,_0x30646d){var _0x51f646={'id':_0x5d7b3e,'name':_0x2a4a53,'custom':_0x3a79a6};if(_0x16422e===_0xf1b7('0xae')){_0x51f646[_0xf1b7('0x3b')]=[{'name':_0xf1b7('0xaf'),'value':'true'},{'name':_0xf1b7('0xb0'),'value':_0xf1b7('0xb1')}];_0x52ffe1(_0x51f646);}else{var _0x480207={'method':_0xf1b7('0x9b'),'uri':_0x2925cf+_0xf1b7('0xb2')+_0x5d7b3e,'auth':_0x3b441a,'json':!![]};return rp(_0x480207)[_0xf1b7('0x24')](function(_0x5e64cb){var _0x161d3a=[];if(_0x5e64cb[_0xf1b7('0xb3')][_0xf1b7('0x42')]>0x0){_0x5e64cb[_0xf1b7('0xb3')][_0xf1b7('0xa8')](function(_0x519c93){if(_0x519c93[_0xf1b7('0xb4')]===_0xf1b7('0xb1')){var _0x56f474={'name':_0x519c93[_0xf1b7('0xa2')],'value':_0x519c93[_0xf1b7('0xb5')]};_0x161d3a[_0xf1b7('0xa3')](_0x56f474);}});}_0x51f646['options']=_0x161d3a;if(_0x51f646[_0xf1b7('0x3b')][_0xf1b7('0x42')]>0x0){_0x52ffe1(_0x51f646);}else{if(_0x3a79a6==![]){_0x52ffe1();}else{_0x52ffe1(_0x51f646);}}});}});} \ No newline at end of file +var _0x314d=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','getConfigurations','ServicenowConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','getFields','made_sla','hold_reason','subcategory','close_code','notify','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','opened_by','sys_created_on','sys_domain','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','work_notes_list','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','reassignment_count','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','remove','includes','forEach','internalType','all','assign','TCL:\x20_object','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','concat','ServiceNow\x20error:\x20','test','send','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','result','value','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel'];(function(_0x543f66,_0x117519){var _0x3ed15a=function(_0x51d7dd){while(--_0x51d7dd){_0x543f66['push'](_0x543f66['shift']());}};_0x3ed15a(++_0x117519);}(_0x314d,0x16f));var _0xd314=function(_0xd0fb01,_0x409bf2){_0xd0fb01=_0xd0fb01-0x0;var _0x350366=_0x314d[_0xd0fb01];return _0x350366;};'use strict';var emlformat=require(_0xd314('0x0'));var rimraf=require(_0xd314('0x1'));var zipdir=require(_0xd314('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd314('0x3'));var moment=require(_0xd314('0x4'));var BPromise=require(_0xd314('0x5'));var Mustache=require('mustache');var util=require(_0xd314('0x6'));var path=require(_0xd314('0x7'));var sox=require(_0xd314('0x8'));var csv=require(_0xd314('0x9'));var ejs=require(_0xd314('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd314('0xb'));var squel=require(_0xd314('0xc'));var crypto=require(_0xd314('0xd'));var jsforce=require(_0xd314('0xe'));var deskjs=require(_0xd314('0xf'));var toCsv=require(_0xd314('0x9'));var querystring=require(_0xd314('0x10'));var Papa=require(_0xd314('0x11'));var Redis=require(_0xd314('0x12'));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(_0xd314('0x13'))(_0xd314('0x14'));var utils=require(_0xd314('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd314('0x16'));var db=require(_0xd314('0x17'))['db'];var integrations=require(_0xd314('0x18'));function respondWithStatusCode(_0x10ff75,_0x33cd70){_0x33cd70=_0x33cd70||0xcc;return function(_0x3371f7){if(_0x3371f7){return _0x10ff75[_0xd314('0x19')](_0x33cd70);}return _0x10ff75[_0xd314('0x1a')](_0x33cd70)[_0xd314('0x1b')]();};}function respondWithResult(_0x24b40e,_0x23dd89){_0x23dd89=_0x23dd89||0xc8;return function(_0x5f4fd0){if(_0x5f4fd0){return _0x24b40e[_0xd314('0x1a')](_0x23dd89)[_0xd314('0x1c')](_0x5f4fd0);}};}function respondWithFilteredResult(_0x125d61,_0x4ba5a3){return function(_0x41f434){if(_0x41f434){var _0x31ef41=typeof _0x4ba5a3[_0xd314('0x1d')]===_0xd314('0x1e')&&typeof _0x4ba5a3['limit']===_0xd314('0x1e');var _0x3f536c=_0x41f434[_0xd314('0x1f')];var _0x12b1be=_0x31ef41?0x0:_0x4ba5a3[_0xd314('0x1d')];var _0x46b55c=_0x31ef41?_0x41f434[_0xd314('0x1f')]:_0x4ba5a3['offset']+_0x4ba5a3[_0xd314('0x20')];var _0x2ff373;if(_0x46b55c>=_0x3f536c){_0x46b55c=_0x3f536c;_0x2ff373=0xc8;}else{_0x2ff373=0xce;}_0x125d61[_0xd314('0x1a')](_0x2ff373);return _0x125d61[_0xd314('0x21')](_0xd314('0x22'),_0x12b1be+'-'+_0x46b55c+'/'+_0x3f536c)[_0xd314('0x1c')](_0x41f434);}return null;};}function patchUpdates(_0x300f2e){return function(_0x1e2d3a){try{jsonpatch['apply'](_0x1e2d3a,_0x300f2e,!![]);}catch(_0x130ebe){return BPromise[_0xd314('0x23')](_0x130ebe);}return _0x1e2d3a[_0xd314('0x24')]();};}function saveUpdates(_0x3fe375,_0x19b07c){return function(_0x1fe242){if(_0x1fe242){return _0x1fe242[_0xd314('0x25')](_0x3fe375)['then'](function(_0x237e2e){return _0x237e2e;});}return null;};}function removeEntity(_0x23abbf,_0xf35656){return function(_0x2c4ab5){if(_0x2c4ab5){return _0x2c4ab5[_0xd314('0x26')]()[_0xd314('0x27')](function(){_0x23abbf[_0xd314('0x1a')](0xcc)[_0xd314('0x1b')]();});}};}function handleEntityNotFound(_0x448a9f,_0x47f3f8){return function(_0x20628){if(!_0x20628){_0x448a9f[_0xd314('0x19')](0x194);}return _0x20628;};}function handleError(_0x3f3c82,_0x23cd4d){_0x23cd4d=_0x23cd4d||0x1f4;return function(_0x1bb6b9){logger[_0xd314('0x28')](_0x1bb6b9[_0xd314('0x29')]);if(_0x1bb6b9[_0xd314('0x2a')]){delete _0x1bb6b9[_0xd314('0x2a')];}_0x3f3c82[_0xd314('0x1a')](_0x23cd4d)['send'](_0x1bb6b9);};}exports[_0xd314('0x2b')]=function(_0x5f3ced,_0x280ee9){var _0x537150={},_0x5057ea={},_0x555911={'count':0x0,'rows':[]};var _0xac2b26=_[_0xd314('0x2c')](db[_0xd314('0x2d')][_0xd314('0x2e')],function(_0x5e43c3){return{'name':_0x5e43c3[_0xd314('0x2f')],'type':_0x5e43c3['type'][_0xd314('0x30')]};});_0x5057ea[_0xd314('0x31')]=_['map'](_0xac2b26,_0xd314('0x2a'));_0x5057ea[_0xd314('0x32')]=_['keys'](_0x5f3ced['query']);_0x5057ea[_0xd314('0x33')]=_[_0xd314('0x34')](_0x5057ea[_0xd314('0x31')],_0x5057ea[_0xd314('0x32')]);_0x537150['attributes']=_[_0xd314('0x34')](_0x5057ea[_0xd314('0x31')],qs[_0xd314('0x35')](_0x5f3ced[_0xd314('0x32')][_0xd314('0x35')]));_0x537150[_0xd314('0x36')]=_0x537150[_0xd314('0x36')][_0xd314('0x37')]?_0x537150[_0xd314('0x36')]:_0x5057ea[_0xd314('0x31')];if(!_0x5f3ced[_0xd314('0x32')][_0xd314('0x38')](_0xd314('0x39'))){_0x537150['limit']=qs[_0xd314('0x20')](_0x5f3ced[_0xd314('0x32')][_0xd314('0x20')]);_0x537150[_0xd314('0x1d')]=qs[_0xd314('0x1d')](_0x5f3ced[_0xd314('0x32')][_0xd314('0x1d')]);}_0x537150[_0xd314('0x3a')]=qs[_0xd314('0x3b')](_0x5f3ced['query'][_0xd314('0x3b')]);_0x537150['where']=qs[_0xd314('0x33')](_[_0xd314('0x3c')](_0x5f3ced[_0xd314('0x32')],_0x5057ea[_0xd314('0x33')]),_0xac2b26);if(_0x5f3ced[_0xd314('0x32')][_0xd314('0x3d')]){_0x537150[_0xd314('0x3e')]=_[_0xd314('0x3f')](_0x537150[_0xd314('0x3e')],{'$or':_['map'](_0xac2b26,function(_0xb14106){if(_0xb14106[_0xd314('0x40')]!==_0xd314('0x41')){var _0x3c2873={};_0x3c2873[_0xb14106[_0xd314('0x2a')]]={'$like':'%'+_0x5f3ced[_0xd314('0x32')]['filter']+'%'};return _0x3c2873;}})});}_0x537150=_['merge']({},_0x537150,_0x5f3ced[_0xd314('0x42')]);var _0x26ea51={'where':_0x537150[_0xd314('0x3e')]};return db[_0xd314('0x2d')][_0xd314('0x1f')](_0x26ea51)[_0xd314('0x27')](function(_0x32fb24){_0x555911[_0xd314('0x1f')]=_0x32fb24;if(_0x5f3ced[_0xd314('0x32')][_0xd314('0x43')]){_0x537150[_0xd314('0x44')]=[{'all':!![]}];}return db[_0xd314('0x2d')]['findAll'](_0x537150);})[_0xd314('0x27')](function(_0x51572b){_0x555911[_0xd314('0x45')]=_0x51572b;return _0x555911;})['then'](respondWithFilteredResult(_0x280ee9,_0x537150))[_0xd314('0x46')](handleError(_0x280ee9,null));};exports[_0xd314('0x47')]=function(_0x5bbf46,_0x263747){var _0x272a91={'raw':![],'where':{'id':_0x5bbf46[_0xd314('0x48')]['id']}},_0x232f20={};_0x232f20[_0xd314('0x31')]=_[_0xd314('0x49')](db['ServicenowAccount'][_0xd314('0x2e')]);_0x232f20[_0xd314('0x32')]=_['keys'](_0x5bbf46[_0xd314('0x32')]);_0x232f20[_0xd314('0x33')]=_[_0xd314('0x34')](_0x232f20[_0xd314('0x31')],_0x232f20[_0xd314('0x32')]);_0x272a91[_0xd314('0x36')]=_[_0xd314('0x34')](_0x232f20[_0xd314('0x31')],qs[_0xd314('0x35')](_0x5bbf46['query'][_0xd314('0x35')]));_0x272a91[_0xd314('0x36')]=_0x272a91[_0xd314('0x36')][_0xd314('0x37')]?_0x272a91[_0xd314('0x36')]:_0x232f20[_0xd314('0x31')];if(_0x5bbf46[_0xd314('0x32')][_0xd314('0x43')]){_0x272a91[_0xd314('0x44')]=[{'all':!![]}];}_0x272a91=_[_0xd314('0x3f')]({},_0x272a91,_0x5bbf46[_0xd314('0x42')]);return db[_0xd314('0x2d')][_0xd314('0x4a')](_0x272a91)['then'](handleEntityNotFound(_0x263747,null))[_0xd314('0x27')](respondWithResult(_0x263747,null))[_0xd314('0x46')](handleError(_0x263747,null));};exports['create']=function(_0x815964,_0x23fd2f){return db[_0xd314('0x2d')][_0xd314('0x4b')](_0x815964[_0xd314('0x4c')],{})[_0xd314('0x27')](respondWithResult(_0x23fd2f,0xc9))['catch'](handleError(_0x23fd2f,null));};exports[_0xd314('0x25')]=function(_0xcfe0f,_0x5f4c89){if(_0xcfe0f[_0xd314('0x4c')]['id']){delete _0xcfe0f['body']['id'];}return db[_0xd314('0x2d')][_0xd314('0x4a')]({'where':{'id':_0xcfe0f[_0xd314('0x48')]['id']}})[_0xd314('0x27')](handleEntityNotFound(_0x5f4c89,null))[_0xd314('0x27')](saveUpdates(_0xcfe0f[_0xd314('0x4c')],null))[_0xd314('0x27')](respondWithResult(_0x5f4c89,null))[_0xd314('0x46')](handleError(_0x5f4c89,null));};exports[_0xd314('0x26')]=function(_0x15efda,_0x29979e){return db[_0xd314('0x2d')]['find']({'where':{'id':_0x15efda[_0xd314('0x48')]['id']}})[_0xd314('0x27')](handleEntityNotFound(_0x29979e,null))[_0xd314('0x27')](removeEntity(_0x29979e,null))['catch'](handleError(_0x29979e,null));};exports[_0xd314('0x4d')]=function(_0x132b13,_0xbef7e6,_0x2ff8a8){var _0x4d46aa={};var _0xba92d8={};var _0x2b03bb;var _0x53702b;return db[_0xd314('0x2d')]['findOne']({'where':{'id':_0x132b13[_0xd314('0x48')]['id']}})[_0xd314('0x27')](handleEntityNotFound(_0xbef7e6,null))['then'](function(_0x480969){if(_0x480969){_0x2b03bb=_0x480969;_0xba92d8['model']=_[_0xd314('0x49')](db[_0xd314('0x4e')]['rawAttributes']);_0xba92d8[_0xd314('0x32')]=_[_0xd314('0x49')](_0x132b13[_0xd314('0x32')]);_0xba92d8[_0xd314('0x33')]=_[_0xd314('0x34')](_0xba92d8[_0xd314('0x31')],_0xba92d8['query']);_0x4d46aa['attributes']=_[_0xd314('0x34')](_0xba92d8[_0xd314('0x31')],qs['fields'](_0x132b13[_0xd314('0x32')][_0xd314('0x35')]));_0x4d46aa['attributes']=_0x4d46aa['attributes']['length']?_0x4d46aa[_0xd314('0x36')]:_0xba92d8[_0xd314('0x31')];_0x4d46aa[_0xd314('0x3a')]=qs['sort'](_0x132b13[_0xd314('0x32')][_0xd314('0x3b')]);_0x4d46aa[_0xd314('0x3e')]=qs[_0xd314('0x33')](_[_0xd314('0x3c')](_0x132b13[_0xd314('0x32')],_0xba92d8['filters']));if(_0x132b13[_0xd314('0x32')][_0xd314('0x3d')]){_0x4d46aa[_0xd314('0x3e')]=_[_0xd314('0x3f')](_0x4d46aa[_0xd314('0x3e')],{'$or':_[_0xd314('0x2c')](_0x4d46aa[_0xd314('0x36')],function(_0x1f74b3){var _0x3757b6={};_0x3757b6[_0x1f74b3]={'$like':'%'+_0x132b13['query'][_0xd314('0x3d')]+'%'};return _0x3757b6;})});}_0x4d46aa=_[_0xd314('0x3f')]({},_0x4d46aa,_0x132b13[_0xd314('0x42')]);return _0x2b03bb['getConfigurations'](_0x4d46aa);}})[_0xd314('0x27')](function(_0x1313f6){if(_0x1313f6){_0x53702b=_0x1313f6[_0xd314('0x37')];if(!_0x132b13[_0xd314('0x32')][_0xd314('0x38')]('nolimit')){_0x4d46aa[_0xd314('0x20')]=qs[_0xd314('0x20')](_0x132b13['query']['limit']);_0x4d46aa[_0xd314('0x1d')]=qs['offset'](_0x132b13[_0xd314('0x32')][_0xd314('0x1d')]);}return _0x2b03bb[_0xd314('0x4d')](_0x4d46aa);}})[_0xd314('0x27')](function(_0xa2ab2b){if(_0xa2ab2b){return _0xa2ab2b?{'count':_0x53702b,'rows':_0xa2ab2b}:null;}})[_0xd314('0x27')](respondWithResult(_0xbef7e6,null))[_0xd314('0x46')](handleError(_0xbef7e6,null));};exports[_0xd314('0x4f')]=function(_0x4379ad,_0x10b986,_0x566e9e){if(_0x4379ad[_0xd314('0x4c')]['id']){delete _0x4379ad['body']['id'];}return db[_0xd314('0x2d')][_0xd314('0x50')]({'where':{'id':_0x4379ad[_0xd314('0x48')]['id']}})[_0xd314('0x27')](handleEntityNotFound(_0x10b986,null))[_0xd314('0x27')](function(_0x27b669){if(_0x27b669){_0x4379ad[_0xd314('0x4c')]['AccountId']=_0x27b669['id'];_0x4379ad[_0xd314('0x4c')][_0xd314('0x51')]=integrations[_0xd314('0x52')](_0x4379ad['body'][_0xd314('0x53')],_0x4379ad[_0xd314('0x4c')]['type']);_0x4379ad[_0xd314('0x4c')]['Descriptions']=integrations[_0xd314('0x54')](_0x4379ad['body'][_0xd314('0x53')],_0x4379ad['body'][_0xd314('0x40')]);return db['ServicenowConfiguration']['create'](_0x4379ad[_0xd314('0x4c')],{'include':[{'model':db[_0xd314('0x55')],'as':'Subjects'},{'model':db[_0xd314('0x55')],'as':_0xd314('0x56')}]});}return null;})['then'](respondWithResult(_0x10b986,null))[_0xd314('0x46')](handleError(_0x10b986,null));};exports[_0xd314('0x57')]=function(_0x1907b1,_0x574a79,_0xa72401){var _0x37b4ac=[_0xd314('0x58'),_0xd314('0x59'),'knowledge',_0xd314('0x5a'),_0xd314('0x5b'),_0xd314('0x5c'),'incident_state','severity',_0xd314('0x5d')];var _0x339787=[_0xd314('0x5e'),'made_sla',_0xd314('0x5f'),_0xd314('0x60'),_0xd314('0x61'),'sys_updated_on',_0xd314('0x62'),_0xd314('0x59'),_0xd314('0x63'),_0xd314('0x64'),_0xd314('0x65'),'sys_updated_by',_0xd314('0x66'),'user_input',_0xd314('0x67'),_0xd314('0x68'),'state',_0xd314('0x69'),_0xd314('0x6a'),_0xd314('0x3a'),_0xd314('0x6b'),_0xd314('0x6c'),_0xd314('0x6d'),_0xd314('0x6e'),'impact',_0xd314('0x6f'),_0xd314('0x70'),'business_service','priority','sys_domain_path',_0xd314('0x71'),_0xd314('0x72'),_0xd314('0x73'),'opened_at',_0xd314('0x74'),_0xd314('0x75'),_0xd314('0x76'),_0xd314('0x77'),_0xd314('0x78'),_0xd314('0x79'),_0xd314('0x7a'),_0xd314('0x5a'),'work_notes',_0xd314('0x7b'),_0xd314('0x5b'),_0xd314('0x7c'),_0xd314('0x7d'),'work_start',_0xd314('0x7e'),_0xd314('0x7f'),_0xd314('0x80'),_0xd314('0x81'),_0xd314('0x82'),_0xd314('0x5c'),_0xd314('0x83'),_0xd314('0x84'),_0xd314('0x85'),_0xd314('0x86'),_0xd314('0x87'),_0xd314('0x88'),_0xd314('0x89'),_0xd314('0x8a'),_0xd314('0x8b'),_0xd314('0x8c'),_0xd314('0x8d'),'company',_0xd314('0x8e'),'activity_due','assigned_to',_0xd314('0x8f'),_0xd314('0x90'),_0xd314('0x91'),_0xd314('0x92'),_0xd314('0x93'),_0xd314('0x94'),_0xd314('0x95'),_0xd314('0x96'),_0xd314('0x97'),'escalation',_0xd314('0x98'),_0xd314('0x99'),_0xd314('0x9a'),_0xd314('0x5d')];var _0x381344='';var _0x3392c0='';var _0x2d618d=[];var _0xccc635='';var _0x274491='';var _0x4c399c=[];var _0x3d76fb='';var _0x1d1830='';var _0x5f5dd0={};var _0x491ac3='';return db[_0xd314('0x2d')][_0xd314('0x50')]({'where':{'id':_0x1907b1[_0xd314('0x48')]['id']},'attributes':['id',_0xd314('0x9b'),_0xd314('0x9c'),_0xd314('0x9d'),_0xd314('0x9e'),'serverUrl']})[_0xd314('0x27')](handleEntityNotFound(_0x574a79,null))[_0xd314('0x27')](function(_0x504bd1){if(_0x504bd1){_0x491ac3=_0x504bd1[_0xd314('0x9e')];var _0x1e7c9c=_0x491ac3[_0xd314('0x9f')](-0x1);if(_0x1e7c9c==='/'){_0x491ac3=_0x491ac3[_0xd314('0xa0')](0x0,_0x491ac3[_0xd314('0xa1')](_0x1e7c9c));}_0x1d1830=util[_0xd314('0xa2')](_0xd314('0xa3'),_0x491ac3);_0x3d76fb=util[_0xd314('0xa2')](_0xd314('0xa4'),_0x491ac3);_0x5f5dd0={'user':_0x504bd1[_0xd314('0x9b')],'pass':_0x504bd1[_0xd314('0x9c')]};var _0x44b13f={'method':_0xd314('0xa5'),'uri':_0x1d1830+_0xd314('0xa6'),'auth':_0x5f5dd0,'json':!![]};return rp(_0x44b13f);}})[_0xd314('0x27')](function(_0x129bc0){if(_0x129bc0['result']['length']>0x0){_0x381344=_0x129bc0['result'];}console['log']('incident\x20table\x20objects',_0x381344);_0x4c399c=[];_0x3392c0=Object['assign']([],_0x381344);_[_0xd314('0xa7')](_0x3392c0,function(_0x2d80ef){return!_0x37b4ac[_0xd314('0xa8')](_0x2d80ef[_0xd314('0x2a')]);});_0x3392c0[_0xd314('0xa9')](function(_0x3355ab){var _0x7f55bc=createFieldObject(_0x3d76fb,_0x5f5dd0,_0x3355ab[_0xd314('0xaa')],_0x3355ab['name'],_0x3355ab['label'],![]);_0x4c399c['push'](_0x7f55bc);});return Promise[_0xd314('0xab')](_0x4c399c);})['then'](function(_0x4e89a4){_0x2d618d=_0x4e89a4;_0xccc635=Object[_0xd314('0xac')]([],_0x381344);console['log'](_0xd314('0xad'),_0x381344);_[_0xd314('0xa7')](_0xccc635,function(_0x2db41b){return _0x339787['includes'](_0x2db41b['name']);});console[_0xd314('0xae')](_0xd314('0xaf'),_0xccc635);_0x4c399c=[];_0xccc635[_0xd314('0xa9')](function(_0x15d8ab){var _0x1aed44=createFieldObject(_0x3d76fb,_0x5f5dd0,_0x15d8ab['internalType'],_0x15d8ab[_0xd314('0x2a')],_0x15d8ab[_0xd314('0xb0')],!![]);_0x4c399c[_0xd314('0xb1')](_0x1aed44);});return Promise[_0xd314('0xab')](_0x4c399c);})['then'](function(_0x3d52dc){_0x274491=_0x3d52dc;var _0x55cc70=_0x2d618d[_0xd314('0xb2')](_0x274491);return{'count':_0x55cc70['length'],'rows':_0x55cc70};})[_0xd314('0x27')](respondWithResult(_0x574a79,null))['catch'](function(_0x90bb3e){console[_0xd314('0xae')](_0xd314('0xb3')+_0x90bb3e);var _0x55a4fb=_0x1907b1[_0xd314('0x32')][_0xd314('0xb4')]?0x1f4:_0x90bb3e['statusCode']||0x1f4;logger[_0xd314('0x28')](_0x90bb3e[_0xd314('0x29')]);delete _0x90bb3e[_0xd314('0x2a')];if(_0x55a4fb===0x191){_0x55a4fb=0x190;}_0x574a79[_0xd314('0x1a')](_0x55a4fb)[_0xd314('0xb5')](_0x1907b1[_0xd314('0x32')][_0xd314('0xb4')]?{'message':_0xd314('0xb6'),'statusCode':_0x90bb3e['statusCode']}:_0x90bb3e);});};function createFieldObject(_0x13053e,_0x1ee813,_0x324ec3,_0x2d3201,_0x591193,_0x5b9ef8){return new Promise(function(_0x589d27,_0x32849e){var _0x9b9862={'id':_0x2d3201,'name':_0x591193,'custom':_0x5b9ef8};if(_0x324ec3===_0xd314('0xb7')){_0x9b9862[_0xd314('0x42')]=[{'name':_0xd314('0xb8'),'value':'true'},{'name':_0xd314('0xb9'),'value':_0xd314('0xba')}];_0x589d27(_0x9b9862);}else{var _0x538422={'method':'GET','uri':_0x13053e+_0xd314('0xbb')+_0x2d3201,'auth':_0x1ee813,'json':!![]};return rp(_0x538422)[_0xd314('0x27')](function(_0x32302b){var _0x19e683=[];if(_0x32302b['result'][_0xd314('0x37')]>0x0){_0x32302b[_0xd314('0xbc')][_0xd314('0xa9')](function(_0x3827bb){if(_0x3827bb['inactive']===_0xd314('0xba')){var _0x381cbe={'name':_0x3827bb[_0xd314('0xb0')],'value':_0x3827bb[_0xd314('0xbd')]};_0x19e683[_0xd314('0xb1')](_0x381cbe);}});}_0x9b9862[_0xd314('0x42')]=_0x19e683;if(_0x9b9862[_0xd314('0x42')][_0xd314('0x37')]>0x0){_0x589d27(_0x9b9862);}else{if(_0x5b9ef8==![]){_0x589d27();}else{_0x589d27(_0x9b9862);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 38dcce4..39b5571 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','../../config/logger','api'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0x7fbe[_0xd299c3];return _0x376574;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));var integrations=require(_0xe7fb('0x9'));module[_0xe7fb('0xa')]=function(_0x12d1b0,_0x24cd67){return _0x12d1b0[_0xe7fb('0xb')]('ServicenowAccount',attributes,{'tableName':_0xe7fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','moment','bluebird'];(function(_0x4a4fb8,_0x1c8af){var _0x1d27c8=function(_0x56ae4f){while(--_0x56ae4f){_0x4a4fb8['push'](_0x4a4fb8['shift']());}};_0x1d27c8(++_0x1c8af);}(_0x2675,0x75));var _0x5267=function(_0x1935b1,_0x50e89a){_0x1935b1=_0x1935b1-0x0;var _0x40de71=_0x2675[_0x1935b1];return _0x40de71;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));var integrations=require(_0x5267('0x6'));module[_0x5267('0x7')]=function(_0x10f92c,_0x20f065){return _0x10f92c[_0x5267('0x8')]('ServicenowAccount',attributes,{'tableName':_0x5267('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 83a21a8..9a36146 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 _0x4067=['http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','ShowServicenowAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x4067,0x84));var _0x7406=function(_0x220025,_0x31a2c7){_0x220025=_0x220025-0x0;var _0x15b420=_0x4067[_0x220025];return _0x15b420;};'use strict';var _=require('lodash');var util=require(_0x7406('0x0'));var moment=require(_0x7406('0x1'));var BPromise=require(_0x7406('0x2'));var rs=require(_0x7406('0x3'));var fs=require('fs');var Redis=require(_0x7406('0x4'));var db=require(_0x7406('0x5'))['db'];var utils=require(_0x7406('0x6'));var logger=require(_0x7406('0x7'))(_0x7406('0x8'));var config=require(_0x7406('0x9'));var jayson=require(_0x7406('0xa'));var client=jayson[_0x7406('0xb')][_0x7406('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x650c1b,_0x5a6451,_0x2f55aa){return new BPromise(function(_0x266c24,_0x3be746){return client['request'](_0x650c1b,_0x2f55aa)[_0x7406('0xd')](function(_0x5c46b7){logger[_0x7406('0xe')](_0x7406('0xf'),_0x5a6451,_0x7406('0x10'));logger[_0x7406('0x11')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5a6451,_0x7406('0x10'),JSON[_0x7406('0x12')](_0x5c46b7));if(_0x5c46b7['error']){if(_0x5c46b7[_0x7406('0x13')][_0x7406('0x14')]===0x1f4){logger[_0x7406('0x13')](_0x7406('0xf'),_0x5a6451,_0x5c46b7[_0x7406('0x13')][_0x7406('0x15')]);return _0x3be746(_0x5c46b7[_0x7406('0x13')][_0x7406('0x15')]);}logger[_0x7406('0x13')]('ServicenowAccount,\x20%s,\x20%s',_0x5a6451,_0x5c46b7[_0x7406('0x13')]['message']);return _0x266c24(_0x5c46b7[_0x7406('0x13')]['message']);}else{logger['info'](_0x7406('0xf'),_0x5a6451,_0x7406('0x10'));_0x266c24(_0x5c46b7['result'][_0x7406('0x15')]);}})['catch'](function(_0x5a2c88){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5a6451,_0x5a2c88);_0x3be746(_0x5a2c88);});});}exports[_0x7406('0x16')]=function(_0x454775){var _0x496cec=this;return new Promise(function(_0xc4bee0,_0x1c877f){return db[_0x7406('0x17')][_0x7406('0x18')]({'raw':_0x454775[_0x7406('0x19')]?_0x454775[_0x7406('0x19')][_0x7406('0x1a')]===undefined?!![]:![]:!![],'where':_0x454775[_0x7406('0x19')]?_0x454775[_0x7406('0x19')][_0x7406('0x1b')]||null:null,'attributes':_0x454775[_0x7406('0x19')]?_0x454775[_0x7406('0x19')][_0x7406('0x1c')]||null:null,'limit':_0x454775[_0x7406('0x19')]?_0x454775[_0x7406('0x19')][_0x7406('0x1d')]||null:null,'include':_0x454775[_0x7406('0x19')]?_0x454775[_0x7406('0x19')][_0x7406('0x1e')]?_[_0x7406('0x1f')](_0x454775[_0x7406('0x19')][_0x7406('0x1e')],function(_0x186349){return{'model':db[_0x186349[_0x7406('0x20')]],'as':_0x186349['as'],'attributes':_0x186349[_0x7406('0x1c')],'include':_0x186349[_0x7406('0x1e')]?_['map'](_0x186349[_0x7406('0x1e')],function(_0xefda71){return{'model':db[_0xefda71[_0x7406('0x20')]],'as':_0xefda71['as'],'attributes':_0xefda71['attributes'],'include':_0xefda71['include']?_['map'](_0xefda71[_0x7406('0x1e')],function(_0x1744e2){return{'model':db[_0x1744e2[_0x7406('0x20')]],'as':_0x1744e2['as'],'attributes':_0x1744e2[_0x7406('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7406('0xd')](function(_0x5c6335){logger[_0x7406('0xe')](_0x7406('0x16'),_0x454775);logger['debug'](_0x7406('0x16'),_0x454775,JSON[_0x7406('0x12')](_0x5c6335));_0xc4bee0(_0x5c6335);})[_0x7406('0x21')](function(_0x250904){logger[_0x7406('0x13')](_0x7406('0x16'),_0x250904[_0x7406('0x15')],_0x454775);_0x1c877f(_0x496cec[_0x7406('0x13')](0x1f4,_0x250904[_0x7406('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x3bcd4b){var _0x301d3e=this;return new Promise(function(_0x275c91,_0x4632f5){return db[_0x7406('0x17')][_0x7406('0x22')]({'raw':_0x3bcd4b[_0x7406('0x19')]?_0x3bcd4b[_0x7406('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3bcd4b['options']?_0x3bcd4b[_0x7406('0x19')][_0x7406('0x1b')]||null:null,'attributes':_0x3bcd4b[_0x7406('0x19')]?_0x3bcd4b['options'][_0x7406('0x1c')]||null:null,'include':_0x3bcd4b[_0x7406('0x19')]?_0x3bcd4b[_0x7406('0x19')]['include']?_['map'](_0x3bcd4b[_0x7406('0x19')]['include'],function(_0x16ebeb){return{'model':db[_0x16ebeb[_0x7406('0x20')]],'as':_0x16ebeb['as'],'attributes':_0x16ebeb[_0x7406('0x1c')],'include':_0x16ebeb['include']?_['map'](_0x16ebeb[_0x7406('0x1e')],function(_0x1e47e5){return{'model':db[_0x1e47e5[_0x7406('0x20')]],'as':_0x1e47e5['as'],'attributes':_0x1e47e5[_0x7406('0x1c')],'include':_0x1e47e5[_0x7406('0x1e')]?_[_0x7406('0x1f')](_0x1e47e5['include'],function(_0x317576){return{'model':db[_0x317576[_0x7406('0x20')]],'as':_0x317576['as'],'attributes':_0x317576[_0x7406('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7406('0xd')](function(_0x226d66){logger['info'](_0x7406('0x23'),_0x3bcd4b);logger[_0x7406('0x11')](_0x7406('0x23'),_0x3bcd4b,JSON[_0x7406('0x12')](_0x226d66));_0x275c91(_0x226d66);})[_0x7406('0x21')](function(_0x2bb5ef){logger['error'](_0x7406('0x23'),_0x2bb5ef[_0x7406('0x15')],_0x3bcd4b);_0x4632f5(_0x301d3e[_0x7406('0x13')](0x1f4,_0x2bb5ef['message']));});});}; \ No newline at end of file +var _0xc54d=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','options','raw','where','limit','include','map','attributes','model','debug','ShowServicenowAccount','ServicenowAccount','find','lodash','util','bluebird','randomstring'];(function(_0x327da4,_0x558f0f){var _0xfdd883=function(_0x53bd7f){while(--_0x53bd7f){_0x327da4['push'](_0x327da4['shift']());}};_0xfdd883(++_0x558f0f);}(_0xc54d,0xa6));var _0xdc54=function(_0x161299,_0x4991c7){_0x161299=_0x161299-0x0;var _0x293d51=_0xc54d[_0x161299];return _0x293d51;};'use strict';var _=require(_0xdc54('0x0'));var util=require(_0xdc54('0x1'));var moment=require('moment');var BPromise=require(_0xdc54('0x2'));var rs=require(_0xdc54('0x3'));var fs=require('fs');var Redis=require(_0xdc54('0x4'));var db=require(_0xdc54('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdc54('0x6'))(_0xdc54('0x7'));var config=require('../../config/environment');var jayson=require(_0xdc54('0x8'));var client=jayson[_0xdc54('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58b189,_0x1c3503,_0x562e4b){return new BPromise(function(_0x431b66,_0x4684ae){return client[_0xdc54('0xa')](_0x58b189,_0x562e4b)[_0xdc54('0xb')](function(_0x461cfb){logger[_0xdc54('0xc')](_0xdc54('0xd'),_0x1c3503,_0xdc54('0xe'));logger['debug'](_0xdc54('0xf'),_0x1c3503,_0xdc54('0xe'),JSON[_0xdc54('0x10')](_0x461cfb));if(_0x461cfb[_0xdc54('0x11')]){if(_0x461cfb[_0xdc54('0x11')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1c3503,_0x461cfb[_0xdc54('0x11')][_0xdc54('0x12')]);return _0x4684ae(_0x461cfb[_0xdc54('0x11')][_0xdc54('0x12')]);}logger[_0xdc54('0x11')](_0xdc54('0xd'),_0x1c3503,_0x461cfb[_0xdc54('0x11')]['message']);return _0x431b66(_0x461cfb[_0xdc54('0x11')]['message']);}else{logger[_0xdc54('0xc')](_0xdc54('0xd'),_0x1c3503,_0xdc54('0xe'));_0x431b66(_0x461cfb[_0xdc54('0x13')]['message']);}})[_0xdc54('0x14')](function(_0x3cc888){logger[_0xdc54('0x11')](_0xdc54('0xd'),_0x1c3503,_0x3cc888);_0x4684ae(_0x3cc888);});});}exports[_0xdc54('0x15')]=function(_0x18b42c){var _0xa2987d=this;return new Promise(function(_0x57c5f5,_0x120f7d){return db['ServicenowAccount']['findAll']({'raw':_0x18b42c[_0xdc54('0x16')]?_0x18b42c[_0xdc54('0x16')][_0xdc54('0x17')]===undefined?!![]:![]:!![],'where':_0x18b42c['options']?_0x18b42c[_0xdc54('0x16')][_0xdc54('0x18')]||null:null,'attributes':_0x18b42c['options']?_0x18b42c[_0xdc54('0x16')]['attributes']||null:null,'limit':_0x18b42c['options']?_0x18b42c['options'][_0xdc54('0x19')]||null:null,'include':_0x18b42c[_0xdc54('0x16')]?_0x18b42c[_0xdc54('0x16')][_0xdc54('0x1a')]?_[_0xdc54('0x1b')](_0x18b42c[_0xdc54('0x16')][_0xdc54('0x1a')],function(_0x2d8388){return{'model':db[_0x2d8388['model']],'as':_0x2d8388['as'],'attributes':_0x2d8388[_0xdc54('0x1c')],'include':_0x2d8388[_0xdc54('0x1a')]?_[_0xdc54('0x1b')](_0x2d8388['include'],function(_0x25b986){return{'model':db[_0x25b986[_0xdc54('0x1d')]],'as':_0x25b986['as'],'attributes':_0x25b986[_0xdc54('0x1c')],'include':_0x25b986[_0xdc54('0x1a')]?_[_0xdc54('0x1b')](_0x25b986['include'],function(_0x5e6f09){return{'model':db[_0x5e6f09[_0xdc54('0x1d')]],'as':_0x5e6f09['as'],'attributes':_0x5e6f09[_0xdc54('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdc54('0xb')](function(_0x28459f){logger[_0xdc54('0xc')](_0xdc54('0x15'),_0x18b42c);logger[_0xdc54('0x1e')](_0xdc54('0x15'),_0x18b42c,JSON[_0xdc54('0x10')](_0x28459f));_0x57c5f5(_0x28459f);})[_0xdc54('0x14')](function(_0x263dff){logger['error'](_0xdc54('0x15'),_0x263dff[_0xdc54('0x12')],_0x18b42c);_0x120f7d(_0xa2987d[_0xdc54('0x11')](0x1f4,_0x263dff[_0xdc54('0x12')]));});});};exports[_0xdc54('0x1f')]=function(_0x111e02){var _0x11a779=this;return new Promise(function(_0x3bfde2,_0x42aa3){return db[_0xdc54('0x20')][_0xdc54('0x21')]({'raw':_0x111e02[_0xdc54('0x16')]?_0x111e02['options'][_0xdc54('0x17')]===undefined?!![]:![]:!![],'where':_0x111e02['options']?_0x111e02[_0xdc54('0x16')][_0xdc54('0x18')]||null:null,'attributes':_0x111e02[_0xdc54('0x16')]?_0x111e02['options']['attributes']||null:null,'include':_0x111e02[_0xdc54('0x16')]?_0x111e02[_0xdc54('0x16')][_0xdc54('0x1a')]?_[_0xdc54('0x1b')](_0x111e02[_0xdc54('0x16')][_0xdc54('0x1a')],function(_0x5cd513){return{'model':db[_0x5cd513[_0xdc54('0x1d')]],'as':_0x5cd513['as'],'attributes':_0x5cd513[_0xdc54('0x1c')],'include':_0x5cd513['include']?_[_0xdc54('0x1b')](_0x5cd513[_0xdc54('0x1a')],function(_0x1ac8f4){return{'model':db[_0x1ac8f4['model']],'as':_0x1ac8f4['as'],'attributes':_0x1ac8f4[_0xdc54('0x1c')],'include':_0x1ac8f4['include']?_[_0xdc54('0x1b')](_0x1ac8f4['include'],function(_0x41541a){return{'model':db[_0x41541a['model']],'as':_0x41541a['as'],'attributes':_0x41541a['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc54('0xb')](function(_0x4f7961){logger[_0xdc54('0xc')]('ShowServicenowAccount',_0x111e02);logger[_0xdc54('0x1e')]('ShowServicenowAccount',_0x111e02,JSON[_0xdc54('0x10')](_0x4f7961));_0x3bfde2(_0x4f7961);})[_0xdc54('0x14')](function(_0x3f0f3e){logger[_0xdc54('0x11')](_0xdc54('0x1f'),_0x3f0f3e[_0xdc54('0x12')],_0x111e02);_0x42aa3(_0x11a779[_0xdc54('0x11')](0x1f4,_0x3f0f3e[_0xdc54('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index c5ddd71..1010f12 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 _0xf564=['delete','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','get','/:id/fields','getDescriptions','post','create','put','update'];(function(_0x342b83,_0x499d7b){var _0x39762c=function(_0xe25c52){while(--_0xe25c52){_0x342b83['push'](_0x342b83['shift']());}};_0x39762c(++_0x499d7b);}(_0xf564,0xfd));var _0x4f56=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0xf564[_0x2067e9];return _0x280ce4;};'use strict';var multer=require(_0x4f56('0x0'));var util=require(_0x4f56('0x1'));var path=require(_0x4f56('0x2'));var timeout=require(_0x4f56('0x3'));var express=require(_0x4f56('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4f56('0x5'));var config=require(_0x4f56('0x6'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4f56('0x7')]);router['get'](_0x4f56('0x8'),auth[_0x4f56('0x9')](),controller['show']);router[_0x4f56('0xa')](_0x4f56('0xb'),auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0x4f56('0x9')](),controller['getSubjects']);router[_0x4f56('0xa')]('/:id/descriptions',auth[_0x4f56('0x9')](),controller[_0x4f56('0xc')]);router[_0x4f56('0xd')]('/',auth[_0x4f56('0x9')](),controller[_0x4f56('0xe')]);router[_0x4f56('0xf')](_0x4f56('0x8'),auth[_0x4f56('0x9')](),controller[_0x4f56('0x10')]);router[_0x4f56('0x11')](_0x4f56('0x8'),auth[_0x4f56('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x334e=['create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','index','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x38f530,_0xce8ca4){var _0x569092=function(_0x57fbce){while(--_0x57fbce){_0x38f530['push'](_0x38f530['shift']());}};_0x569092(++_0xce8ca4);}(_0x334e,0x157));var _0xe334=function(_0x46da3e,_0x239055){_0x46da3e=_0x46da3e-0x0;var _0x4e0b32=_0x334e[_0x46da3e];return _0x4e0b32;};'use strict';var multer=require(_0xe334('0x0'));var util=require(_0xe334('0x1'));var path=require(_0xe334('0x2'));var timeout=require('connect-timeout');var express=require(_0xe334('0x3'));var router=express[_0xe334('0x4')]();var fs_extra=require(_0xe334('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe334('0x6'));var controller=require(_0xe334('0x7'));router[_0xe334('0x8')]('/',auth['isAuthenticated'](),controller[_0xe334('0x9')]);router[_0xe334('0x8')]('/:id',auth[_0xe334('0xa')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xe334('0xb')]);router['get'](_0xe334('0xc'),auth[_0xe334('0xa')](),controller[_0xe334('0xd')]);router[_0xe334('0x8')](_0xe334('0xe'),auth['isAuthenticated'](),controller[_0xe334('0xf')]);router[_0xe334('0x10')]('/',auth[_0xe334('0xa')](),controller[_0xe334('0x11')]);router[_0xe334('0x12')](_0xe334('0x13'),auth[_0xe334('0xa')](),controller[_0xe334('0x14')]);router[_0xe334('0x15')](_0xe334('0x13'),auth[_0xe334('0xa')](),controller[_0xe334('0x16')]);module[_0xe334('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 1d71809..31f0340 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 _0x009d=['exports','STRING','sequelize'];(function(_0x5c1829,_0x5e5b18){var _0x45dd65=function(_0x2c08bf){while(--_0x2c08bf){_0x5c1829['push'](_0x5c1829['shift']());}};_0x45dd65(++_0x5e5b18);}(_0x009d,0x101));var _0xd009=function(_0x15741d,_0xf50e9e){_0x15741d=_0x15741d-0x0;var _0x202178=_0x009d[_0x15741d];return _0x202178;};'use strict';var Sequelize=require(_0xd009('0x0'));module[_0xd009('0x1')]={'name':{'type':Sequelize[_0xd009('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4cc3=['exports','STRING','sequelize'];(function(_0x2341c6,_0x3af092){var _0x54c34d=function(_0x3091f9){while(--_0x3091f9){_0x2341c6['push'](_0x2341c6['shift']());}};_0x54c34d(++_0x3af092);}(_0x4cc3,0x19d));var _0x34cc=function(_0xfc28a8,_0x298cef){_0xfc28a8=_0xfc28a8-0x0;var _0x308879=_0x4cc3[_0xfc28a8];return _0x308879;};'use strict';var Sequelize=require(_0x34cc('0x0'));module[_0x34cc('0x1')]={'name':{'type':Sequelize[_0x34cc('0x2')]},'description':{'type':Sequelize[_0x34cc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d7fe5c0..8c7ebe4 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 _0x00ad=['show','params','fields','create','body','catch','find','getFields','hasOwnProperty','nolimit','getSubjects','ServicenowField','getDescriptions','findOne','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows'];(function(_0x104993,_0x3f9a6b){var _0x105a96=function(_0x4ad1cb){while(--_0x4ad1cb){_0x104993['push'](_0x104993['shift']());}};_0x105a96(++_0x3f9a6b);}(_0x00ad,0x146));var _0xd00a=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x00ad[_0x43d11d];return _0x38cd08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd00a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd00a('0x1'));var rp=require(_0xd00a('0x2'));var moment=require(_0xd00a('0x3'));var BPromise=require(_0xd00a('0x4'));var Mustache=require(_0xd00a('0x5'));var util=require(_0xd00a('0x6'));var path=require(_0xd00a('0x7'));var sox=require(_0xd00a('0x8'));var csv=require('to-csv');var ejs=require(_0xd00a('0x9'));var fs=require('fs');var fs_extra=require(_0xd00a('0xa'));var _=require(_0xd00a('0xb'));var squel=require(_0xd00a('0xc'));var crypto=require(_0xd00a('0xd'));var jsforce=require(_0xd00a('0xe'));var deskjs=require(_0xd00a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd00a('0x10'));var Redis=require(_0xd00a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd00a('0x12'));var as=require(_0xd00a('0x13'));var hardwareService=require(_0xd00a('0x14'));var logger=require(_0xd00a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd00a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd00a('0x17'))['db'];function respondWithStatusCode(_0x3da23b,_0x33a131){_0x33a131=_0x33a131||0xcc;return function(_0xe5d844){if(_0xe5d844){return _0x3da23b['sendStatus'](_0x33a131);}return _0x3da23b[_0xd00a('0x18')](_0x33a131)[_0xd00a('0x19')]();};}function respondWithResult(_0x366244,_0x214d7f){_0x214d7f=_0x214d7f||0xc8;return function(_0xa50998){if(_0xa50998){return _0x366244[_0xd00a('0x18')](_0x214d7f)[_0xd00a('0x1a')](_0xa50998);}};}function respondWithFilteredResult(_0x1b6147,_0x54dad2){return function(_0x386d33){if(_0x386d33){var _0x5eac5e=typeof _0x54dad2[_0xd00a('0x1b')]===_0xd00a('0x1c')&&typeof _0x54dad2[_0xd00a('0x1d')]===_0xd00a('0x1c');var _0x168099=_0x386d33['count'];var _0x478277=_0x5eac5e?0x0:_0x54dad2[_0xd00a('0x1b')];var _0xce0b9e=_0x5eac5e?_0x386d33[_0xd00a('0x1e')]:_0x54dad2[_0xd00a('0x1b')]+_0x54dad2[_0xd00a('0x1d')];var _0x36ddc6;if(_0xce0b9e>=_0x168099){_0xce0b9e=_0x168099;_0x36ddc6=0xc8;}else{_0x36ddc6=0xce;}_0x1b6147[_0xd00a('0x18')](_0x36ddc6);return _0x1b6147['set']('Content-Range',_0x478277+'-'+_0xce0b9e+'/'+_0x168099)[_0xd00a('0x1a')](_0x386d33);}return null;};}function patchUpdates(_0x197a1f){return function(_0x1ef70d){try{jsonpatch[_0xd00a('0x1f')](_0x1ef70d,_0x197a1f,!![]);}catch(_0x559c23){return BPromise['reject'](_0x559c23);}return _0x1ef70d[_0xd00a('0x20')]();};}function saveUpdates(_0x82e2ec,_0x5098f1){return function(_0x39fb38){if(_0x39fb38){return _0x39fb38[_0xd00a('0x21')](_0x82e2ec)[_0xd00a('0x22')](function(_0x19476e){return _0x19476e;});}return null;};}function removeEntity(_0x4cae95,_0x4be9b5){return function(_0x34e5ad){if(_0x34e5ad){return _0x34e5ad[_0xd00a('0x23')]()[_0xd00a('0x22')](function(){_0x4cae95[_0xd00a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25a383,_0x3a16b0){return function(_0x4dbaac){if(!_0x4dbaac){_0x25a383['sendStatus'](0x194);}return _0x4dbaac;};}function handleError(_0x316ba4,_0x33211e){_0x33211e=_0x33211e||0x1f4;return function(_0x514e55){logger[_0xd00a('0x24')](_0x514e55[_0xd00a('0x25')]);if(_0x514e55['name']){delete _0x514e55[_0xd00a('0x26')];}_0x316ba4['status'](_0x33211e)['send'](_0x514e55);};}exports[_0xd00a('0x27')]=function(_0x5c54ae,_0x4559a6){var _0x379ae={},_0x41b5c4={},_0x1e27dc={'count':0x0,'rows':[]};var _0x3fb95a=_[_0xd00a('0x28')](db[_0xd00a('0x29')][_0xd00a('0x2a')],function(_0x49c7f8){return{'name':_0x49c7f8[_0xd00a('0x2b')],'type':_0x49c7f8[_0xd00a('0x2c')][_0xd00a('0x2d')]};});_0x41b5c4[_0xd00a('0x2e')]=_['map'](_0x3fb95a,_0xd00a('0x26'));_0x41b5c4[_0xd00a('0x2f')]=_[_0xd00a('0x30')](_0x5c54ae[_0xd00a('0x2f')]);_0x41b5c4['filters']=_[_0xd00a('0x31')](_0x41b5c4[_0xd00a('0x2e')],_0x41b5c4[_0xd00a('0x2f')]);_0x379ae[_0xd00a('0x32')]=_[_0xd00a('0x31')](_0x41b5c4[_0xd00a('0x2e')],qs['fields'](_0x5c54ae[_0xd00a('0x2f')]['fields']));_0x379ae[_0xd00a('0x32')]=_0x379ae[_0xd00a('0x32')][_0xd00a('0x33')]?_0x379ae['attributes']:_0x41b5c4[_0xd00a('0x2e')];if(!_0x5c54ae[_0xd00a('0x2f')]['hasOwnProperty']('nolimit')){_0x379ae['limit']=qs['limit'](_0x5c54ae[_0xd00a('0x2f')][_0xd00a('0x1d')]);_0x379ae[_0xd00a('0x1b')]=qs['offset'](_0x5c54ae[_0xd00a('0x2f')][_0xd00a('0x1b')]);}_0x379ae[_0xd00a('0x34')]=qs[_0xd00a('0x35')](_0x5c54ae[_0xd00a('0x2f')][_0xd00a('0x35')]);_0x379ae[_0xd00a('0x36')]=qs[_0xd00a('0x37')](_[_0xd00a('0x38')](_0x5c54ae[_0xd00a('0x2f')],_0x41b5c4[_0xd00a('0x37')]),_0x3fb95a);if(_0x5c54ae[_0xd00a('0x2f')][_0xd00a('0x39')]){_0x379ae[_0xd00a('0x36')]=_[_0xd00a('0x3a')](_0x379ae[_0xd00a('0x36')],{'$or':_['map'](_0x3fb95a,function(_0x3e30e8){if(_0x3e30e8['type']!==_0xd00a('0x3b')){var _0x3f0268={};_0x3f0268[_0x3e30e8['name']]={'$like':'%'+_0x5c54ae[_0xd00a('0x2f')][_0xd00a('0x39')]+'%'};return _0x3f0268;}})});}_0x379ae=_[_0xd00a('0x3a')]({},_0x379ae,_0x5c54ae[_0xd00a('0x3c')]);var _0x6aa3a2={'where':_0x379ae[_0xd00a('0x36')]};return db[_0xd00a('0x29')]['count'](_0x6aa3a2)['then'](function(_0x15da5b){_0x1e27dc[_0xd00a('0x1e')]=_0x15da5b;if(_0x5c54ae[_0xd00a('0x2f')][_0xd00a('0x3d')]){_0x379ae[_0xd00a('0x3e')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x379ae);})['then'](function(_0x4fd405){_0x1e27dc[_0xd00a('0x3f')]=_0x4fd405;return _0x1e27dc;})['then'](respondWithFilteredResult(_0x4559a6,_0x379ae))['catch'](handleError(_0x4559a6,null));};exports[_0xd00a('0x40')]=function(_0x518e33,_0x5dff65){var _0x651d11={'raw':![],'where':{'id':_0x518e33[_0xd00a('0x41')]['id']}},_0x1976ab={};_0x1976ab['model']=_[_0xd00a('0x30')](db[_0xd00a('0x29')]['rawAttributes']);_0x1976ab[_0xd00a('0x2f')]=_['keys'](_0x518e33['query']);_0x1976ab[_0xd00a('0x37')]=_['intersection'](_0x1976ab[_0xd00a('0x2e')],_0x1976ab[_0xd00a('0x2f')]);_0x651d11[_0xd00a('0x32')]=_[_0xd00a('0x31')](_0x1976ab[_0xd00a('0x2e')],qs[_0xd00a('0x42')](_0x518e33[_0xd00a('0x2f')]['fields']));_0x651d11['attributes']=_0x651d11[_0xd00a('0x32')][_0xd00a('0x33')]?_0x651d11[_0xd00a('0x32')]:_0x1976ab[_0xd00a('0x2e')];if(_0x518e33['query'][_0xd00a('0x3d')]){_0x651d11[_0xd00a('0x3e')]=[{'all':!![]}];}_0x651d11=_[_0xd00a('0x3a')]({},_0x651d11,_0x518e33[_0xd00a('0x3c')]);return db[_0xd00a('0x29')]['find'](_0x651d11)[_0xd00a('0x22')](handleEntityNotFound(_0x5dff65,null))[_0xd00a('0x22')](respondWithResult(_0x5dff65,null))['catch'](handleError(_0x5dff65,null));};exports[_0xd00a('0x43')]=function(_0x37271f,_0x218fbc){return db['ServicenowConfiguration']['create'](_0x37271f[_0xd00a('0x44')],{})[_0xd00a('0x22')](respondWithResult(_0x218fbc,0xc9))[_0xd00a('0x45')](handleError(_0x218fbc,null));};exports[_0xd00a('0x21')]=function(_0x24073a,_0xce5f98){if(_0x24073a['body']['id']){delete _0x24073a[_0xd00a('0x44')]['id'];}return db[_0xd00a('0x29')][_0xd00a('0x46')]({'where':{'id':_0x24073a[_0xd00a('0x41')]['id']}})[_0xd00a('0x22')](handleEntityNotFound(_0xce5f98,null))[_0xd00a('0x22')](saveUpdates(_0x24073a[_0xd00a('0x44')],null))['then'](respondWithResult(_0xce5f98,null))['catch'](handleError(_0xce5f98,null));};exports[_0xd00a('0x23')]=function(_0x22197e,_0x187653){return db[_0xd00a('0x29')][_0xd00a('0x46')]({'where':{'id':_0x22197e[_0xd00a('0x41')]['id']}})[_0xd00a('0x22')](handleEntityNotFound(_0x187653,null))[_0xd00a('0x22')](removeEntity(_0x187653,null))[_0xd00a('0x45')](handleError(_0x187653,null));};exports[_0xd00a('0x47')]=function(_0x259282,_0x2b76c6,_0xa17a0e){var _0x156577={};var _0x1d81ff={};var _0xbe8712;var _0x6fe9f;return db[_0xd00a('0x29')]['findOne']({'where':{'id':_0x259282['params']['id']}})[_0xd00a('0x22')](handleEntityNotFound(_0x2b76c6,null))['then'](function(_0x22782c){if(_0x22782c){_0xbe8712=_0x22782c;_0x1d81ff[_0xd00a('0x2e')]=_[_0xd00a('0x30')](db['ServicenowField'][_0xd00a('0x2a')]);_0x1d81ff[_0xd00a('0x2f')]=_[_0xd00a('0x30')](_0x259282[_0xd00a('0x2f')]);_0x1d81ff[_0xd00a('0x37')]=_[_0xd00a('0x31')](_0x1d81ff['model'],_0x1d81ff[_0xd00a('0x2f')]);_0x156577[_0xd00a('0x32')]=_[_0xd00a('0x31')](_0x1d81ff[_0xd00a('0x2e')],qs[_0xd00a('0x42')](_0x259282['query'][_0xd00a('0x42')]));_0x156577['attributes']=_0x156577[_0xd00a('0x32')][_0xd00a('0x33')]?_0x156577[_0xd00a('0x32')]:_0x1d81ff[_0xd00a('0x2e')];_0x156577[_0xd00a('0x34')]=qs[_0xd00a('0x35')](_0x259282[_0xd00a('0x2f')]['sort']);_0x156577[_0xd00a('0x36')]=qs[_0xd00a('0x37')](_[_0xd00a('0x38')](_0x259282[_0xd00a('0x2f')],_0x1d81ff[_0xd00a('0x37')]));if(_0x259282[_0xd00a('0x2f')][_0xd00a('0x39')]){_0x156577[_0xd00a('0x36')]=_[_0xd00a('0x3a')](_0x156577['where'],{'$or':_[_0xd00a('0x28')](_0x156577['attributes'],function(_0x168463){var _0x1d9f3e={};_0x1d9f3e[_0x168463]={'$like':'%'+_0x259282[_0xd00a('0x2f')][_0xd00a('0x39')]+'%'};return _0x1d9f3e;})});}_0x156577=_[_0xd00a('0x3a')]({},_0x156577,_0x259282[_0xd00a('0x3c')]);return _0xbe8712['getFields'](_0x156577);}})[_0xd00a('0x22')](function(_0x57b50e){if(_0x57b50e){_0x6fe9f=_0x57b50e['length'];if(!_0x259282[_0xd00a('0x2f')][_0xd00a('0x48')](_0xd00a('0x49'))){_0x156577[_0xd00a('0x1d')]=qs[_0xd00a('0x1d')](_0x259282[_0xd00a('0x2f')][_0xd00a('0x1d')]);_0x156577[_0xd00a('0x1b')]=qs[_0xd00a('0x1b')](_0x259282[_0xd00a('0x2f')][_0xd00a('0x1b')]);}return _0xbe8712['getFields'](_0x156577);}})['then'](function(_0x3a835d){if(_0x3a835d){return _0x3a835d?{'count':_0x6fe9f,'rows':_0x3a835d}:null;}})[_0xd00a('0x22')](respondWithResult(_0x2b76c6,null))[_0xd00a('0x45')](handleError(_0x2b76c6,null));};exports[_0xd00a('0x4a')]=function(_0x58711f,_0x3bb92e,_0x376ccb){var _0x40438b={};var _0x453618={};var _0x2dee2a;var _0x10c9e8;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x58711f[_0xd00a('0x41')]['id']}})[_0xd00a('0x22')](handleEntityNotFound(_0x3bb92e,null))['then'](function(_0x10af04){if(_0x10af04){_0x2dee2a=_0x10af04;_0x453618['model']=_[_0xd00a('0x30')](db[_0xd00a('0x4b')][_0xd00a('0x2a')]);_0x453618[_0xd00a('0x2f')]=_[_0xd00a('0x30')](_0x58711f[_0xd00a('0x2f')]);_0x453618[_0xd00a('0x37')]=_[_0xd00a('0x31')](_0x453618[_0xd00a('0x2e')],_0x453618[_0xd00a('0x2f')]);_0x40438b['attributes']=_[_0xd00a('0x31')](_0x453618[_0xd00a('0x2e')],qs['fields'](_0x58711f[_0xd00a('0x2f')][_0xd00a('0x42')]));_0x40438b[_0xd00a('0x32')]=_0x40438b[_0xd00a('0x32')]['length']?_0x40438b[_0xd00a('0x32')]:_0x453618[_0xd00a('0x2e')];_0x40438b[_0xd00a('0x34')]=qs[_0xd00a('0x35')](_0x58711f[_0xd00a('0x2f')][_0xd00a('0x35')]);_0x40438b[_0xd00a('0x36')]=qs[_0xd00a('0x37')](_[_0xd00a('0x38')](_0x58711f['query'],_0x453618[_0xd00a('0x37')]));if(_0x58711f[_0xd00a('0x2f')][_0xd00a('0x39')]){_0x40438b['where']=_['merge'](_0x40438b[_0xd00a('0x36')],{'$or':_[_0xd00a('0x28')](_0x40438b[_0xd00a('0x32')],function(_0x298280){var _0x49e9d1={};_0x49e9d1[_0x298280]={'$like':'%'+_0x58711f[_0xd00a('0x2f')][_0xd00a('0x39')]+'%'};return _0x49e9d1;})});}_0x40438b=_[_0xd00a('0x3a')]({},_0x40438b,_0x58711f[_0xd00a('0x3c')]);return _0x2dee2a[_0xd00a('0x4a')](_0x40438b);}})[_0xd00a('0x22')](function(_0x211e73){if(_0x211e73){_0x10c9e8=_0x211e73[_0xd00a('0x33')];if(!_0x58711f['query'][_0xd00a('0x48')](_0xd00a('0x49'))){_0x40438b[_0xd00a('0x1d')]=qs['limit'](_0x58711f['query'][_0xd00a('0x1d')]);_0x40438b[_0xd00a('0x1b')]=qs[_0xd00a('0x1b')](_0x58711f[_0xd00a('0x2f')][_0xd00a('0x1b')]);}return _0x2dee2a[_0xd00a('0x4a')](_0x40438b);}})[_0xd00a('0x22')](function(_0x1f5d50){if(_0x1f5d50){return _0x1f5d50?{'count':_0x10c9e8,'rows':_0x1f5d50}:null;}})[_0xd00a('0x22')](respondWithResult(_0x3bb92e,null))[_0xd00a('0x45')](handleError(_0x3bb92e,null));};exports[_0xd00a('0x4c')]=function(_0x1413d6,_0x504322,_0xa4578e){var _0x13d62={};var _0x23cc2d={};var _0x269cc6;var _0x2c522f;return db[_0xd00a('0x29')][_0xd00a('0x4d')]({'where':{'id':_0x1413d6[_0xd00a('0x41')]['id']}})['then'](handleEntityNotFound(_0x504322,null))[_0xd00a('0x22')](function(_0x2db3e4){if(_0x2db3e4){_0x269cc6=_0x2db3e4;_0x23cc2d[_0xd00a('0x2e')]=_[_0xd00a('0x30')](db[_0xd00a('0x4b')][_0xd00a('0x2a')]);_0x23cc2d[_0xd00a('0x2f')]=_[_0xd00a('0x30')](_0x1413d6['query']);_0x23cc2d[_0xd00a('0x37')]=_['intersection'](_0x23cc2d[_0xd00a('0x2e')],_0x23cc2d[_0xd00a('0x2f')]);_0x13d62[_0xd00a('0x32')]=_[_0xd00a('0x31')](_0x23cc2d[_0xd00a('0x2e')],qs[_0xd00a('0x42')](_0x1413d6[_0xd00a('0x2f')][_0xd00a('0x42')]));_0x13d62[_0xd00a('0x32')]=_0x13d62[_0xd00a('0x32')]['length']?_0x13d62[_0xd00a('0x32')]:_0x23cc2d['model'];_0x13d62[_0xd00a('0x34')]=qs[_0xd00a('0x35')](_0x1413d6[_0xd00a('0x2f')][_0xd00a('0x35')]);_0x13d62[_0xd00a('0x36')]=qs['filters'](_[_0xd00a('0x38')](_0x1413d6[_0xd00a('0x2f')],_0x23cc2d['filters']));if(_0x1413d6[_0xd00a('0x2f')][_0xd00a('0x39')]){_0x13d62[_0xd00a('0x36')]=_[_0xd00a('0x3a')](_0x13d62['where'],{'$or':_['map'](_0x13d62[_0xd00a('0x32')],function(_0x10ee1e){var _0x27fd89={};_0x27fd89[_0x10ee1e]={'$like':'%'+_0x1413d6['query']['filter']+'%'};return _0x27fd89;})});}_0x13d62=_[_0xd00a('0x3a')]({},_0x13d62,_0x1413d6[_0xd00a('0x3c')]);return _0x269cc6[_0xd00a('0x4c')](_0x13d62);}})['then'](function(_0x4394bd){if(_0x4394bd){_0x2c522f=_0x4394bd[_0xd00a('0x33')];if(!_0x1413d6['query'][_0xd00a('0x48')]('nolimit')){_0x13d62[_0xd00a('0x1d')]=qs[_0xd00a('0x1d')](_0x1413d6[_0xd00a('0x2f')][_0xd00a('0x1d')]);_0x13d62[_0xd00a('0x1b')]=qs[_0xd00a('0x1b')](_0x1413d6[_0xd00a('0x2f')][_0xd00a('0x1b')]);}return _0x269cc6[_0xd00a('0x4c')](_0x13d62);}})[_0xd00a('0x22')](function(_0x1a2c24){if(_0x1a2c24){return _0x1a2c24?{'count':_0x2c522f,'rows':_0x1a2c24}:null;}})[_0xd00a('0x22')](respondWithResult(_0x504322,null))[_0xd00a('0x45')](handleError(_0x504322,null));}; \ No newline at end of file +var _0x3fc0=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','end','error','stack','name','map','rawAttributes','fieldName','model','filters','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','ServicenowConfiguration','includeAll','findAll','rows','catch','show','keys','intersection','include','create','body','find','destroy','params','getFields','ServicenowField','fields','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1a0e46,_0x510f37){var _0x5dee50=function(_0x2537f1){while(--_0x2537f1){_0x1a0e46['push'](_0x1a0e46['shift']());}};_0x5dee50(++_0x510f37);}(_0x3fc0,0x94));var _0x03fc=function(_0x515afd,_0x1a1e91){_0x515afd=_0x515afd-0x0;var _0x536d53=_0x3fc0[_0x515afd];return _0x536d53;};'use strict';var emlformat=require(_0x03fc('0x0'));var rimraf=require(_0x03fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x03fc('0x2'));var moment=require(_0x03fc('0x3'));var BPromise=require(_0x03fc('0x4'));var Mustache=require('mustache');var util=require(_0x03fc('0x5'));var path=require(_0x03fc('0x6'));var sox=require(_0x03fc('0x7'));var csv=require(_0x03fc('0x8'));var ejs=require(_0x03fc('0x9'));var fs=require('fs');var fs_extra=require(_0x03fc('0xa'));var _=require(_0x03fc('0xb'));var squel=require(_0x03fc('0xc'));var crypto=require(_0x03fc('0xd'));var jsforce=require(_0x03fc('0xe'));var deskjs=require(_0x03fc('0xf'));var toCsv=require(_0x03fc('0x8'));var querystring=require(_0x03fc('0x10'));var Papa=require(_0x03fc('0x11'));var Redis=require(_0x03fc('0x12'));var authService=require(_0x03fc('0x13'));var qs=require(_0x03fc('0x14'));var as=require(_0x03fc('0x15'));var hardwareService=require(_0x03fc('0x16'));var logger=require(_0x03fc('0x17'))(_0x03fc('0x18'));var utils=require(_0x03fc('0x19'));var config=require(_0x03fc('0x1a'));var licenseUtil=require(_0x03fc('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4179da,_0x320b1e){_0x320b1e=_0x320b1e||0xcc;return function(_0x5e1b9f){if(_0x5e1b9f){return _0x4179da[_0x03fc('0x1c')](_0x320b1e);}return _0x4179da[_0x03fc('0x1d')](_0x320b1e)['end']();};}function respondWithResult(_0x3c413d,_0x53a95a){_0x53a95a=_0x53a95a||0xc8;return function(_0x3a85a5){if(_0x3a85a5){return _0x3c413d[_0x03fc('0x1d')](_0x53a95a)[_0x03fc('0x1e')](_0x3a85a5);}};}function respondWithFilteredResult(_0x228d9e,_0x179d56){return function(_0x38c550){if(_0x38c550){var _0x218888=typeof _0x179d56[_0x03fc('0x1f')]===_0x03fc('0x20')&&typeof _0x179d56[_0x03fc('0x21')]===_0x03fc('0x20');var _0x11a42b=_0x38c550[_0x03fc('0x22')];var _0x5df764=_0x218888?0x0:_0x179d56[_0x03fc('0x1f')];var _0x357389=_0x218888?_0x38c550[_0x03fc('0x22')]:_0x179d56[_0x03fc('0x1f')]+_0x179d56['limit'];var _0x5293fc;if(_0x357389>=_0x11a42b){_0x357389=_0x11a42b;_0x5293fc=0xc8;}else{_0x5293fc=0xce;}_0x228d9e[_0x03fc('0x1d')](_0x5293fc);return _0x228d9e['set'](_0x03fc('0x23'),_0x5df764+'-'+_0x357389+'/'+_0x11a42b)[_0x03fc('0x1e')](_0x38c550);}return null;};}function patchUpdates(_0x564b6f){return function(_0x32ddd9){try{jsonpatch[_0x03fc('0x24')](_0x32ddd9,_0x564b6f,!![]);}catch(_0x40e490){return BPromise['reject'](_0x40e490);}return _0x32ddd9[_0x03fc('0x25')]();};}function saveUpdates(_0x107e60,_0x35546d){return function(_0x233f69){if(_0x233f69){return _0x233f69[_0x03fc('0x26')](_0x107e60)[_0x03fc('0x27')](function(_0x3155b5){return _0x3155b5;});}return null;};}function removeEntity(_0x300b6d,_0x95038d){return function(_0x55423c){if(_0x55423c){return _0x55423c['destroy']()['then'](function(){_0x300b6d['status'](0xcc)[_0x03fc('0x28')]();});}};}function handleEntityNotFound(_0x5d6f54,_0x293446){return function(_0x1baba6){if(!_0x1baba6){_0x5d6f54[_0x03fc('0x1c')](0x194);}return _0x1baba6;};}function handleError(_0x37ae64,_0x1b8882){_0x1b8882=_0x1b8882||0x1f4;return function(_0x4153f5){logger[_0x03fc('0x29')](_0x4153f5[_0x03fc('0x2a')]);if(_0x4153f5[_0x03fc('0x2b')]){delete _0x4153f5[_0x03fc('0x2b')];}_0x37ae64['status'](_0x1b8882)['send'](_0x4153f5);};}exports['index']=function(_0x196d06,_0x1fb109){var _0x2b34f2={},_0x296cc4={},_0x1c9f29={'count':0x0,'rows':[]};var _0x49bbef=_[_0x03fc('0x2c')](db['ServicenowConfiguration'][_0x03fc('0x2d')],function(_0x290b48){return{'name':_0x290b48[_0x03fc('0x2e')],'type':_0x290b48['type']['key']};});_0x296cc4[_0x03fc('0x2f')]=_[_0x03fc('0x2c')](_0x49bbef,'name');_0x296cc4['query']=_['keys'](_0x196d06['query']);_0x296cc4[_0x03fc('0x30')]=_['intersection'](_0x296cc4[_0x03fc('0x2f')],_0x296cc4[_0x03fc('0x31')]);_0x2b34f2[_0x03fc('0x32')]=_['intersection'](_0x296cc4[_0x03fc('0x2f')],qs['fields'](_0x196d06['query']['fields']));_0x2b34f2[_0x03fc('0x32')]=_0x2b34f2['attributes'][_0x03fc('0x33')]?_0x2b34f2[_0x03fc('0x32')]:_0x296cc4[_0x03fc('0x2f')];if(!_0x196d06[_0x03fc('0x31')][_0x03fc('0x34')]('nolimit')){_0x2b34f2['limit']=qs['limit'](_0x196d06['query'][_0x03fc('0x21')]);_0x2b34f2[_0x03fc('0x1f')]=qs['offset'](_0x196d06[_0x03fc('0x31')]['offset']);}_0x2b34f2[_0x03fc('0x35')]=qs['sort'](_0x196d06[_0x03fc('0x31')][_0x03fc('0x36')]);_0x2b34f2[_0x03fc('0x37')]=qs[_0x03fc('0x30')](_[_0x03fc('0x38')](_0x196d06[_0x03fc('0x31')],_0x296cc4[_0x03fc('0x30')]),_0x49bbef);if(_0x196d06[_0x03fc('0x31')][_0x03fc('0x39')]){_0x2b34f2[_0x03fc('0x37')]=_[_0x03fc('0x3a')](_0x2b34f2[_0x03fc('0x37')],{'$or':_[_0x03fc('0x2c')](_0x49bbef,function(_0x5d0241){if(_0x5d0241['type']!=='VIRTUAL'){var _0xf7d75={};_0xf7d75[_0x5d0241[_0x03fc('0x2b')]]={'$like':'%'+_0x196d06[_0x03fc('0x31')]['filter']+'%'};return _0xf7d75;}})});}_0x2b34f2=_[_0x03fc('0x3a')]({},_0x2b34f2,_0x196d06[_0x03fc('0x3b')]);var _0x57c08e={'where':_0x2b34f2[_0x03fc('0x37')]};return db[_0x03fc('0x3c')][_0x03fc('0x22')](_0x57c08e)[_0x03fc('0x27')](function(_0x5b1687){_0x1c9f29['count']=_0x5b1687;if(_0x196d06[_0x03fc('0x31')][_0x03fc('0x3d')]){_0x2b34f2['include']=[{'all':!![]}];}return db[_0x03fc('0x3c')][_0x03fc('0x3e')](_0x2b34f2);})[_0x03fc('0x27')](function(_0x31ff61){_0x1c9f29[_0x03fc('0x3f')]=_0x31ff61;return _0x1c9f29;})[_0x03fc('0x27')](respondWithFilteredResult(_0x1fb109,_0x2b34f2))[_0x03fc('0x40')](handleError(_0x1fb109,null));};exports[_0x03fc('0x41')]=function(_0x484de9,_0x2e0e58){var _0x4ab4b2={'raw':![],'where':{'id':_0x484de9['params']['id']}},_0x4cab59={};_0x4cab59[_0x03fc('0x2f')]=_[_0x03fc('0x42')](db[_0x03fc('0x3c')][_0x03fc('0x2d')]);_0x4cab59['query']=_[_0x03fc('0x42')](_0x484de9[_0x03fc('0x31')]);_0x4cab59[_0x03fc('0x30')]=_[_0x03fc('0x43')](_0x4cab59[_0x03fc('0x2f')],_0x4cab59['query']);_0x4ab4b2['attributes']=_[_0x03fc('0x43')](_0x4cab59[_0x03fc('0x2f')],qs['fields'](_0x484de9[_0x03fc('0x31')]['fields']));_0x4ab4b2[_0x03fc('0x32')]=_0x4ab4b2[_0x03fc('0x32')][_0x03fc('0x33')]?_0x4ab4b2['attributes']:_0x4cab59[_0x03fc('0x2f')];if(_0x484de9[_0x03fc('0x31')][_0x03fc('0x3d')]){_0x4ab4b2[_0x03fc('0x44')]=[{'all':!![]}];}_0x4ab4b2=_[_0x03fc('0x3a')]({},_0x4ab4b2,_0x484de9[_0x03fc('0x3b')]);return db[_0x03fc('0x3c')]['find'](_0x4ab4b2)[_0x03fc('0x27')](handleEntityNotFound(_0x2e0e58,null))[_0x03fc('0x27')](respondWithResult(_0x2e0e58,null))[_0x03fc('0x40')](handleError(_0x2e0e58,null));};exports[_0x03fc('0x45')]=function(_0x2d6f76,_0x17d448){return db[_0x03fc('0x3c')][_0x03fc('0x45')](_0x2d6f76['body'],{})[_0x03fc('0x27')](respondWithResult(_0x17d448,0xc9))[_0x03fc('0x40')](handleError(_0x17d448,null));};exports[_0x03fc('0x26')]=function(_0x522bfb,_0x5ba65c){if(_0x522bfb[_0x03fc('0x46')]['id']){delete _0x522bfb[_0x03fc('0x46')]['id'];}return db[_0x03fc('0x3c')][_0x03fc('0x47')]({'where':{'id':_0x522bfb['params']['id']}})[_0x03fc('0x27')](handleEntityNotFound(_0x5ba65c,null))['then'](saveUpdates(_0x522bfb[_0x03fc('0x46')],null))[_0x03fc('0x27')](respondWithResult(_0x5ba65c,null))[_0x03fc('0x40')](handleError(_0x5ba65c,null));};exports[_0x03fc('0x48')]=function(_0x37288e,_0x5b5a04){return db[_0x03fc('0x3c')][_0x03fc('0x47')]({'where':{'id':_0x37288e[_0x03fc('0x49')]['id']}})[_0x03fc('0x27')](handleEntityNotFound(_0x5b5a04,null))['then'](removeEntity(_0x5b5a04,null))[_0x03fc('0x40')](handleError(_0x5b5a04,null));};exports[_0x03fc('0x4a')]=function(_0x518948,_0x344146,_0x54dd9b){var _0x4697eb={};var _0xecf7be={};var _0x297a1c;var _0x4083c6;return db[_0x03fc('0x3c')]['findOne']({'where':{'id':_0x518948[_0x03fc('0x49')]['id']}})[_0x03fc('0x27')](handleEntityNotFound(_0x344146,null))[_0x03fc('0x27')](function(_0x5c2836){if(_0x5c2836){_0x297a1c=_0x5c2836;_0xecf7be['model']=_[_0x03fc('0x42')](db[_0x03fc('0x4b')]['rawAttributes']);_0xecf7be[_0x03fc('0x31')]=_[_0x03fc('0x42')](_0x518948[_0x03fc('0x31')]);_0xecf7be[_0x03fc('0x30')]=_['intersection'](_0xecf7be[_0x03fc('0x2f')],_0xecf7be['query']);_0x4697eb[_0x03fc('0x32')]=_['intersection'](_0xecf7be['model'],qs[_0x03fc('0x4c')](_0x518948[_0x03fc('0x31')][_0x03fc('0x4c')]));_0x4697eb[_0x03fc('0x32')]=_0x4697eb[_0x03fc('0x32')][_0x03fc('0x33')]?_0x4697eb[_0x03fc('0x32')]:_0xecf7be[_0x03fc('0x2f')];_0x4697eb['order']=qs[_0x03fc('0x36')](_0x518948[_0x03fc('0x31')]['sort']);_0x4697eb[_0x03fc('0x37')]=qs[_0x03fc('0x30')](_['pick'](_0x518948['query'],_0xecf7be['filters']));if(_0x518948[_0x03fc('0x31')]['filter']){_0x4697eb[_0x03fc('0x37')]=_[_0x03fc('0x3a')](_0x4697eb[_0x03fc('0x37')],{'$or':_['map'](_0x4697eb[_0x03fc('0x32')],function(_0x4b7e5e){var _0xb0675e={};_0xb0675e[_0x4b7e5e]={'$like':'%'+_0x518948[_0x03fc('0x31')]['filter']+'%'};return _0xb0675e;})});}_0x4697eb=_[_0x03fc('0x3a')]({},_0x4697eb,_0x518948['options']);return _0x297a1c['getFields'](_0x4697eb);}})[_0x03fc('0x27')](function(_0x35a264){if(_0x35a264){_0x4083c6=_0x35a264[_0x03fc('0x33')];if(!_0x518948[_0x03fc('0x31')][_0x03fc('0x34')](_0x03fc('0x4d'))){_0x4697eb[_0x03fc('0x21')]=qs['limit'](_0x518948[_0x03fc('0x31')][_0x03fc('0x21')]);_0x4697eb[_0x03fc('0x1f')]=qs[_0x03fc('0x1f')](_0x518948['query'][_0x03fc('0x1f')]);}return _0x297a1c['getFields'](_0x4697eb);}})[_0x03fc('0x27')](function(_0x4e5e29){if(_0x4e5e29){return _0x4e5e29?{'count':_0x4083c6,'rows':_0x4e5e29}:null;}})[_0x03fc('0x27')](respondWithResult(_0x344146,null))[_0x03fc('0x40')](handleError(_0x344146,null));};exports[_0x03fc('0x4e')]=function(_0x38f215,_0x5addc4,_0x417fc){var _0x9bb6cb={};var _0x437451={};var _0x3d18ce;var _0x3d368e;return db['ServicenowConfiguration'][_0x03fc('0x4f')]({'where':{'id':_0x38f215[_0x03fc('0x49')]['id']}})[_0x03fc('0x27')](handleEntityNotFound(_0x5addc4,null))[_0x03fc('0x27')](function(_0x51ab35){if(_0x51ab35){_0x3d18ce=_0x51ab35;_0x437451[_0x03fc('0x2f')]=_[_0x03fc('0x42')](db['ServicenowField'][_0x03fc('0x2d')]);_0x437451[_0x03fc('0x31')]=_[_0x03fc('0x42')](_0x38f215[_0x03fc('0x31')]);_0x437451[_0x03fc('0x30')]=_['intersection'](_0x437451[_0x03fc('0x2f')],_0x437451[_0x03fc('0x31')]);_0x9bb6cb[_0x03fc('0x32')]=_[_0x03fc('0x43')](_0x437451[_0x03fc('0x2f')],qs['fields'](_0x38f215[_0x03fc('0x31')][_0x03fc('0x4c')]));_0x9bb6cb[_0x03fc('0x32')]=_0x9bb6cb[_0x03fc('0x32')][_0x03fc('0x33')]?_0x9bb6cb[_0x03fc('0x32')]:_0x437451[_0x03fc('0x2f')];_0x9bb6cb[_0x03fc('0x35')]=qs[_0x03fc('0x36')](_0x38f215[_0x03fc('0x31')][_0x03fc('0x36')]);_0x9bb6cb[_0x03fc('0x37')]=qs['filters'](_['pick'](_0x38f215[_0x03fc('0x31')],_0x437451[_0x03fc('0x30')]));if(_0x38f215[_0x03fc('0x31')][_0x03fc('0x39')]){_0x9bb6cb[_0x03fc('0x37')]=_['merge'](_0x9bb6cb[_0x03fc('0x37')],{'$or':_['map'](_0x9bb6cb[_0x03fc('0x32')],function(_0x42687e){var _0xe003a0={};_0xe003a0[_0x42687e]={'$like':'%'+_0x38f215[_0x03fc('0x31')][_0x03fc('0x39')]+'%'};return _0xe003a0;})});}_0x9bb6cb=_[_0x03fc('0x3a')]({},_0x9bb6cb,_0x38f215['options']);return _0x3d18ce[_0x03fc('0x4e')](_0x9bb6cb);}})[_0x03fc('0x27')](function(_0x1c8090){if(_0x1c8090){_0x3d368e=_0x1c8090[_0x03fc('0x33')];if(!_0x38f215[_0x03fc('0x31')][_0x03fc('0x34')](_0x03fc('0x4d'))){_0x9bb6cb[_0x03fc('0x21')]=qs[_0x03fc('0x21')](_0x38f215['query'][_0x03fc('0x21')]);_0x9bb6cb[_0x03fc('0x1f')]=qs['offset'](_0x38f215[_0x03fc('0x31')][_0x03fc('0x1f')]);}return _0x3d18ce[_0x03fc('0x4e')](_0x9bb6cb);}})[_0x03fc('0x27')](function(_0x16255a){if(_0x16255a){return _0x16255a?{'count':_0x3d368e,'rows':_0x16255a}:null;}})[_0x03fc('0x27')](respondWithResult(_0x5addc4,null))['catch'](handleError(_0x5addc4,null));};exports[_0x03fc('0x50')]=function(_0x2df03a,_0x28e889,_0xbbcd9d){var _0x290848={};var _0x2f4799={};var _0x4973c2;var _0xf2bd61;return db[_0x03fc('0x3c')][_0x03fc('0x4f')]({'where':{'id':_0x2df03a['params']['id']}})[_0x03fc('0x27')](handleEntityNotFound(_0x28e889,null))['then'](function(_0x15363e){if(_0x15363e){_0x4973c2=_0x15363e;_0x2f4799[_0x03fc('0x2f')]=_[_0x03fc('0x42')](db[_0x03fc('0x4b')][_0x03fc('0x2d')]);_0x2f4799[_0x03fc('0x31')]=_[_0x03fc('0x42')](_0x2df03a[_0x03fc('0x31')]);_0x2f4799[_0x03fc('0x30')]=_['intersection'](_0x2f4799['model'],_0x2f4799['query']);_0x290848[_0x03fc('0x32')]=_[_0x03fc('0x43')](_0x2f4799[_0x03fc('0x2f')],qs[_0x03fc('0x4c')](_0x2df03a['query'][_0x03fc('0x4c')]));_0x290848['attributes']=_0x290848[_0x03fc('0x32')][_0x03fc('0x33')]?_0x290848[_0x03fc('0x32')]:_0x2f4799['model'];_0x290848[_0x03fc('0x35')]=qs[_0x03fc('0x36')](_0x2df03a['query'][_0x03fc('0x36')]);_0x290848[_0x03fc('0x37')]=qs[_0x03fc('0x30')](_[_0x03fc('0x38')](_0x2df03a['query'],_0x2f4799[_0x03fc('0x30')]));if(_0x2df03a[_0x03fc('0x31')][_0x03fc('0x39')]){_0x290848[_0x03fc('0x37')]=_['merge'](_0x290848[_0x03fc('0x37')],{'$or':_[_0x03fc('0x2c')](_0x290848[_0x03fc('0x32')],function(_0x2c94bf){var _0x18f673={};_0x18f673[_0x2c94bf]={'$like':'%'+_0x2df03a[_0x03fc('0x31')]['filter']+'%'};return _0x18f673;})});}_0x290848=_[_0x03fc('0x3a')]({},_0x290848,_0x2df03a['options']);return _0x4973c2[_0x03fc('0x50')](_0x290848);}})['then'](function(_0x3924f0){if(_0x3924f0){_0xf2bd61=_0x3924f0[_0x03fc('0x33')];if(!_0x2df03a[_0x03fc('0x31')][_0x03fc('0x34')](_0x03fc('0x4d'))){_0x290848[_0x03fc('0x21')]=qs[_0x03fc('0x21')](_0x2df03a[_0x03fc('0x31')]['limit']);_0x290848[_0x03fc('0x1f')]=qs['offset'](_0x2df03a['query']['offset']);}return _0x4973c2[_0x03fc('0x50')](_0x290848);}})['then'](function(_0x17dcd5){if(_0x17dcd5){return _0x17dcd5?{'count':_0xf2bd61,'rows':_0x17dcd5}:null;}})[_0x03fc('0x27')](respondWithResult(_0x28e889,null))['catch'](handleError(_0x28e889,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 53fb40b..379ac3b 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 _0x39aa=['moment','bluebird','request-promise','path','rimraf','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','api'];(function(_0x506727,_0x19cd29){var _0x42123f=function(_0x5e9f38){while(--_0x5e9f38){_0x506727['push'](_0x506727['shift']());}};_0x42123f(++_0x19cd29);}(_0x39aa,0x11b));var _0xa39a=function(_0x2f09f7,_0x461707){_0x2f09f7=_0x2f09f7-0x0;var _0x1b266c=_0x39aa[_0x2f09f7];return _0x1b266c;};'use strict';var _=require(_0xa39a('0x0'));var util=require(_0xa39a('0x1'));var logger=require('../../config/logger')(_0xa39a('0x2'));var moment=require(_0xa39a('0x3'));var BPromise=require(_0xa39a('0x4'));var rp=require(_0xa39a('0x5'));var fs=require('fs');var path=require(_0xa39a('0x6'));var rimraf=require(_0xa39a('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x3dba2c,_0x911d67){return _0x3dba2c[_0xa39a('0x8')](_0xa39a('0x9'),attributes,{'tableName':_0xa39a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c1d=['./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x36a62c,_0xebd35e){var _0x1b04db=function(_0x3b2be8){while(--_0x3b2be8){_0x36a62c['push'](_0x36a62c['shift']());}};_0x1b04db(++_0xebd35e);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x2ea214,_0x5aa2f2){_0x2ea214=_0x2ea214-0x0;var _0x3fe974=_0x9c1d[_0x2ea214];return _0x3fe974;};'use strict';var _=require(_0xd9c1('0x0'));var util=require(_0xd9c1('0x1'));var logger=require(_0xd9c1('0x2'))('api');var moment=require(_0xd9c1('0x3'));var BPromise=require(_0xd9c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd9c1('0x5'));var rimraf=require(_0xd9c1('0x6'));var config=require('../../config/environment');var attributes=require(_0xd9c1('0x7'));module[_0xd9c1('0x8')]=function(_0x206639,_0x29840f){return _0x206639[_0xd9c1('0x9')](_0xd9c1('0xa'),attributes,{'tableName':_0xd9c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index a2a88b9..b121c2e 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 _0x7374=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1c4366,_0x2b299d){var _0x5837d4=function(_0xa89e33){while(--_0xa89e33){_0x1c4366['push'](_0x1c4366['shift']());}};_0x5837d4(++_0x2b299d);}(_0x7374,0x1b9));var _0x4737=function(_0x4323ef,_0x52b30){_0x4323ef=_0x4323ef-0x0;var _0x3de43a=_0x7374[_0x4323ef];return _0x3de43a;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var moment=require(_0x4737('0x2'));var BPromise=require(_0x4737('0x3'));var rs=require(_0x4737('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4737('0x5'))['db'];var utils=require(_0x4737('0x6'));var logger=require(_0x4737('0x7'))(_0x4737('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4737('0x9')][_0x4737('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x311410,_0x3d18dd,_0x4f9804){return new BPromise(function(_0x1595c6,_0x739dad){return client[_0x4737('0xb')](_0x311410,_0x4f9804)[_0x4737('0xc')](function(_0x46ddeb){logger['info'](_0x4737('0xd'),_0x3d18dd,_0x4737('0xe'));logger[_0x4737('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x3d18dd,'request\x20sent',JSON[_0x4737('0x10')](_0x46ddeb));if(_0x46ddeb[_0x4737('0x11')]){if(_0x46ddeb[_0x4737('0x11')][_0x4737('0x12')]===0x1f4){logger[_0x4737('0x11')](_0x4737('0xd'),_0x3d18dd,_0x46ddeb[_0x4737('0x11')][_0x4737('0x13')]);return _0x739dad(_0x46ddeb[_0x4737('0x11')]['message']);}logger[_0x4737('0x11')](_0x4737('0xd'),_0x3d18dd,_0x46ddeb[_0x4737('0x11')][_0x4737('0x13')]);return _0x1595c6(_0x46ddeb[_0x4737('0x11')]['message']);}else{logger['info'](_0x4737('0xd'),_0x3d18dd,'request\x20sent');_0x1595c6(_0x46ddeb[_0x4737('0x14')][_0x4737('0x13')]);}})['catch'](function(_0x3ed96f){logger[_0x4737('0x11')](_0x4737('0xd'),_0x3d18dd,_0x3ed96f);_0x739dad(_0x3ed96f);});});} \ No newline at end of file +var _0x711a=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug'];(function(_0x123235,_0x1cf6fa){var _0x3fd464=function(_0x548b8){while(--_0x548b8){_0x123235['push'](_0x123235['shift']());}};_0x3fd464(++_0x1cf6fa);}(_0x711a,0x14a));var _0xa711=function(_0x2753a6,_0x2d808c){_0x2753a6=_0x2753a6-0x0;var _0x401986=_0x711a[_0x2753a6];return _0x401986;};'use strict';var _=require(_0xa711('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa711('0x1'));var rs=require(_0xa711('0x2'));var fs=require('fs');var Redis=require(_0xa711('0x3'));var db=require(_0xa711('0x4'))['db'];var utils=require(_0xa711('0x5'));var logger=require(_0xa711('0x6'))(_0xa711('0x7'));var config=require(_0xa711('0x8'));var jayson=require(_0xa711('0x9'));var client=jayson[_0xa711('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a8ddc,_0x1232a3,_0x218614){return new BPromise(function(_0x29b84b,_0x318cca){return client[_0xa711('0xb')](_0x3a8ddc,_0x218614)[_0xa711('0xc')](function(_0x3fb0ef){logger[_0xa711('0xd')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1232a3,'request\x20sent');logger[_0xa711('0xe')](_0xa711('0xf'),_0x1232a3,_0xa711('0x10'),JSON[_0xa711('0x11')](_0x3fb0ef));if(_0x3fb0ef[_0xa711('0x12')]){if(_0x3fb0ef[_0xa711('0x12')][_0xa711('0x13')]===0x1f4){logger[_0xa711('0x12')](_0xa711('0x14'),_0x1232a3,_0x3fb0ef[_0xa711('0x12')][_0xa711('0x15')]);return _0x318cca(_0x3fb0ef[_0xa711('0x12')][_0xa711('0x15')]);}logger[_0xa711('0x12')](_0xa711('0x14'),_0x1232a3,_0x3fb0ef[_0xa711('0x12')][_0xa711('0x15')]);return _0x29b84b(_0x3fb0ef[_0xa711('0x12')]['message']);}else{logger[_0xa711('0xd')](_0xa711('0x14'),_0x1232a3,_0xa711('0x10'));_0x29b84b(_0x3fb0ef['result'][_0xa711('0x15')]);}})[_0xa711('0x16')](function(_0x168363){logger[_0xa711('0x12')](_0xa711('0x14'),_0x1232a3,_0x168363);_0x318cca(_0x168363);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index fcefbb2..11bffa0 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 _0x23d9=['update','destroy','exports','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','post','create','put'];(function(_0x48d03f,_0xb2fdca){var _0x3b26ba=function(_0x30df75){while(--_0x30df75){_0x48d03f['push'](_0x48d03f['shift']());}};_0x3b26ba(++_0xb2fdca);}(_0x23d9,0x133));var _0x923d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23d9[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x923d('0x0'));var path=require('path');var timeout=require(_0x923d('0x1'));var express=require(_0x923d('0x2'));var router=express['Router']();var fs_extra=require(_0x923d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x923d('0x4'));var config=require(_0x923d('0x5'));var controller=require(_0x923d('0x6'));router[_0x923d('0x7')]('/',auth[_0x923d('0x8')](),controller['index']);router[_0x923d('0x7')](_0x923d('0x9'),auth[_0x923d('0x8')](),controller['show']);router[_0x923d('0xa')]('/',auth[_0x923d('0x8')](),controller[_0x923d('0xb')]);router[_0x923d('0xc')]('/:id',auth[_0x923d('0x8')](),controller[_0x923d('0xd')]);router['delete'](_0x923d('0x9'),auth['isAuthenticated'](),controller[_0x923d('0xe')]);module[_0x923d('0xf')]=router; \ No newline at end of file +var _0xbbc8=['create','put','update','/:id','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get'];(function(_0x2d9bc8,_0x539d37){var _0x2b96ac=function(_0x3cb660){while(--_0x3cb660){_0x2d9bc8['push'](_0x2d9bc8['shift']());}};_0x2b96ac(++_0x539d37);}(_0xbbc8,0x113));var _0x8bbc=function(_0x219978,_0x3f717c){_0x219978=_0x219978-0x0;var _0x2f42fc=_0xbbc8[_0x219978];return _0x2f42fc;};'use strict';var multer=require(_0x8bbc('0x0'));var util=require(_0x8bbc('0x1'));var path=require(_0x8bbc('0x2'));var timeout=require('connect-timeout');var express=require(_0x8bbc('0x3'));var router=express['Router']();var fs_extra=require(_0x8bbc('0x4'));var auth=require(_0x8bbc('0x5'));var interaction=require(_0x8bbc('0x6'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x8bbc('0x7')](),controller[_0x8bbc('0x8')]);router[_0x8bbc('0x9')]('/:id',auth[_0x8bbc('0x7')](),controller['show']);router['post']('/',auth[_0x8bbc('0x7')](),controller[_0x8bbc('0xa')]);router[_0x8bbc('0xb')]('/:id',auth[_0x8bbc('0x7')](),controller[_0x8bbc('0xc')]);router['delete'](_0x8bbc('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x8bbc('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 4cd97c5..7f7b1fb 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 _0x3e05=['BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3e05,0xf1));var _0x53e0=function(_0x14586d,_0x3d5de3){_0x14586d=_0x14586d-0x0;var _0x5c9dce=_0x3e05[_0x14586d];return _0x5c9dce;};'use strict';var Sequelize=require(_0x53e0('0x0'));module[_0x53e0('0x1')]={'type':{'type':Sequelize['ENUM'](_0x53e0('0x2'),_0x53e0('0x3'),_0x53e0('0x4'),_0x53e0('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x53e0('0x6')]},'key':{'type':Sequelize[_0x53e0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x53e0('0x2'),_0x53e0('0x3'),_0x53e0('0x4'))},'keyContent':{'type':Sequelize[_0x53e0('0x6')]},'idField':{'type':Sequelize[_0x53e0('0x6')]},'nameField':{'type':Sequelize[_0x53e0('0x6')]},'customField':{'type':Sequelize[_0x53e0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x53e0('0x6')]}}; \ No newline at end of file +var _0x0c2b=['string','picklist','STRING','variable','customVariable','sequelize','ENUM'];(function(_0x1265a8,_0x2117e6){var _0x1a66e1=function(_0x51a2e3){while(--_0x51a2e3){_0x1265a8['push'](_0x1265a8['shift']());}};_0x1a66e1(++_0x2117e6);}(_0x0c2b,0x10f));var _0xb0c2=function(_0x4683af,_0x52d885){_0x4683af=_0x4683af-0x0;var _0x4a354b=_0x0c2b[_0x4683af];return _0x4a354b;};'use strict';var Sequelize=require(_0xb0c2('0x0'));module['exports']={'type':{'type':Sequelize[_0xb0c2('0x1')](_0xb0c2('0x2'),'variable','customVariable','keyValue',_0xb0c2('0x3')),'defaultValue':_0xb0c2('0x2')},'content':{'type':Sequelize[_0xb0c2('0x4')]},'key':{'type':Sequelize[_0xb0c2('0x4')]},'keyType':{'type':Sequelize[_0xb0c2('0x1')](_0xb0c2('0x2'),_0xb0c2('0x5'),_0xb0c2('0x6'))},'keyContent':{'type':Sequelize[_0xb0c2('0x4')]},'idField':{'type':Sequelize[_0xb0c2('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb0c2('0x4')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index ccf1f17..463b89a 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 _0xb845=['apply','reject','save','update','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x337796,_0x2edbc9){var _0x15c164=function(_0x2af239){while(--_0x2af239){_0x337796['push'](_0x337796['shift']());}};_0x15c164(++_0x2edbc9);}(_0xb845,0xf5));var _0x5b84=function(_0x501bcc,_0x2cc192){_0x501bcc=_0x501bcc-0x0;var _0x457da1=_0xb845[_0x501bcc];return _0x457da1;};'use strict';var emlformat=require(_0x5b84('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b84('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b84('0x2'));var moment=require(_0x5b84('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5b84('0x4'));var util=require('util');var path=require('path');var sox=require(_0x5b84('0x5'));var csv=require(_0x5b84('0x6'));var ejs=require(_0x5b84('0x7'));var fs=require('fs');var fs_extra=require(_0x5b84('0x8'));var _=require(_0x5b84('0x9'));var squel=require(_0x5b84('0xa'));var crypto=require(_0x5b84('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5b84('0x6'));var querystring=require(_0x5b84('0xc'));var Papa=require(_0x5b84('0xd'));var Redis=require(_0x5b84('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5b84('0xf'));var as=require(_0x5b84('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5b84('0x11'));var utils=require(_0x5b84('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5b84('0x13'));var db=require(_0x5b84('0x14'))['db'];function respondWithStatusCode(_0x3167af,_0xd7b026){_0xd7b026=_0xd7b026||0xcc;return function(_0x8b4e90){if(_0x8b4e90){return _0x3167af[_0x5b84('0x15')](_0xd7b026);}return _0x3167af[_0x5b84('0x16')](_0xd7b026)[_0x5b84('0x17')]();};}function respondWithResult(_0xfa528f,_0x5373f8){_0x5373f8=_0x5373f8||0xc8;return function(_0x24976e){if(_0x24976e){return _0xfa528f['status'](_0x5373f8)[_0x5b84('0x18')](_0x24976e);}};}function respondWithFilteredResult(_0x19c42d,_0xf8fb1){return function(_0x5f54eb){if(_0x5f54eb){var _0x369bd9=typeof _0xf8fb1[_0x5b84('0x19')]===_0x5b84('0x1a')&&typeof _0xf8fb1['limit']==='undefined';var _0x74bae8=_0x5f54eb[_0x5b84('0x1b')];var _0x2e7589=_0x369bd9?0x0:_0xf8fb1[_0x5b84('0x19')];var _0x4370f8=_0x369bd9?_0x5f54eb['count']:_0xf8fb1['offset']+_0xf8fb1[_0x5b84('0x1c')];var _0x2f2657;if(_0x4370f8>=_0x74bae8){_0x4370f8=_0x74bae8;_0x2f2657=0xc8;}else{_0x2f2657=0xce;}_0x19c42d['status'](_0x2f2657);return _0x19c42d[_0x5b84('0x1d')](_0x5b84('0x1e'),_0x2e7589+'-'+_0x4370f8+'/'+_0x74bae8)[_0x5b84('0x18')](_0x5f54eb);}return null;};}function patchUpdates(_0x4de17d){return function(_0x59942d){try{jsonpatch[_0x5b84('0x1f')](_0x59942d,_0x4de17d,!![]);}catch(_0x38261e){return BPromise[_0x5b84('0x20')](_0x38261e);}return _0x59942d[_0x5b84('0x21')]();};}function saveUpdates(_0x249633,_0x56b702){return function(_0x131bf2){if(_0x131bf2){return _0x131bf2[_0x5b84('0x22')](_0x249633)[_0x5b84('0x23')](function(_0x5a1aa5){return _0x5a1aa5;});}return null;};}function removeEntity(_0x566452,_0x132b2c){return function(_0x27130b){if(_0x27130b){return _0x27130b['destroy']()[_0x5b84('0x23')](function(){_0x566452['status'](0xcc)[_0x5b84('0x17')]();});}};}function handleEntityNotFound(_0x38031d,_0x27af22){return function(_0x268e23){if(!_0x268e23){_0x38031d[_0x5b84('0x15')](0x194);}return _0x268e23;};}function handleError(_0x3a4093,_0x57cb04){_0x57cb04=_0x57cb04||0x1f4;return function(_0x4f47db){logger[_0x5b84('0x24')](_0x4f47db[_0x5b84('0x25')]);if(_0x4f47db[_0x5b84('0x26')]){delete _0x4f47db[_0x5b84('0x26')];}_0x3a4093['status'](_0x57cb04)[_0x5b84('0x27')](_0x4f47db);};}exports[_0x5b84('0x28')]=function(_0x27acfd,_0x19e797){var _0x4cc997={},_0x5d9359={},_0x457854={'count':0x0,'rows':[]};var _0x49e21b=_[_0x5b84('0x29')](db[_0x5b84('0x2a')][_0x5b84('0x2b')],function(_0x16f64e){return{'name':_0x16f64e[_0x5b84('0x2c')],'type':_0x16f64e[_0x5b84('0x2d')]['key']};});_0x5d9359[_0x5b84('0x2e')]=_[_0x5b84('0x29')](_0x49e21b,_0x5b84('0x26'));_0x5d9359[_0x5b84('0x2f')]=_[_0x5b84('0x30')](_0x27acfd[_0x5b84('0x2f')]);_0x5d9359[_0x5b84('0x31')]=_['intersection'](_0x5d9359[_0x5b84('0x2e')],_0x5d9359[_0x5b84('0x2f')]);_0x4cc997['attributes']=_[_0x5b84('0x32')](_0x5d9359[_0x5b84('0x2e')],qs[_0x5b84('0x33')](_0x27acfd[_0x5b84('0x2f')][_0x5b84('0x33')]));_0x4cc997[_0x5b84('0x34')]=_0x4cc997[_0x5b84('0x34')][_0x5b84('0x35')]?_0x4cc997['attributes']:_0x5d9359['model'];if(!_0x27acfd['query']['hasOwnProperty']('nolimit')){_0x4cc997['limit']=qs['limit'](_0x27acfd[_0x5b84('0x2f')][_0x5b84('0x1c')]);_0x4cc997[_0x5b84('0x19')]=qs[_0x5b84('0x19')](_0x27acfd[_0x5b84('0x2f')]['offset']);}_0x4cc997[_0x5b84('0x36')]=qs[_0x5b84('0x37')](_0x27acfd[_0x5b84('0x2f')][_0x5b84('0x37')]);_0x4cc997[_0x5b84('0x38')]=qs['filters'](_['pick'](_0x27acfd[_0x5b84('0x2f')],_0x5d9359['filters']),_0x49e21b);if(_0x27acfd['query']['filter']){_0x4cc997[_0x5b84('0x38')]=_[_0x5b84('0x39')](_0x4cc997[_0x5b84('0x38')],{'$or':_['map'](_0x49e21b,function(_0x1ef49b){if(_0x1ef49b[_0x5b84('0x2d')]!==_0x5b84('0x3a')){var _0x2ead57={};_0x2ead57[_0x1ef49b['name']]={'$like':'%'+_0x27acfd[_0x5b84('0x2f')]['filter']+'%'};return _0x2ead57;}})});}_0x4cc997=_[_0x5b84('0x39')]({},_0x4cc997,_0x27acfd[_0x5b84('0x3b')]);var _0x2f1a75={'where':_0x4cc997[_0x5b84('0x38')]};return db[_0x5b84('0x2a')][_0x5b84('0x1b')](_0x2f1a75)['then'](function(_0x25d59a){_0x457854[_0x5b84('0x1b')]=_0x25d59a;if(_0x27acfd[_0x5b84('0x2f')][_0x5b84('0x3c')]){_0x4cc997[_0x5b84('0x3d')]=[{'all':!![]}];}return db[_0x5b84('0x2a')][_0x5b84('0x3e')](_0x4cc997);})[_0x5b84('0x23')](function(_0x56c840){_0x457854[_0x5b84('0x3f')]=_0x56c840;return _0x457854;})[_0x5b84('0x23')](respondWithFilteredResult(_0x19e797,_0x4cc997))[_0x5b84('0x40')](handleError(_0x19e797,null));};exports['show']=function(_0x54a9c0,_0x3fe2a3){var _0x2c743e={'raw':!![],'where':{'id':_0x54a9c0['params']['id']}},_0x3cd828={};_0x3cd828[_0x5b84('0x2e')]=_[_0x5b84('0x30')](db[_0x5b84('0x2a')][_0x5b84('0x2b')]);_0x3cd828[_0x5b84('0x2f')]=_[_0x5b84('0x30')](_0x54a9c0['query']);_0x3cd828[_0x5b84('0x31')]=_[_0x5b84('0x32')](_0x3cd828[_0x5b84('0x2e')],_0x3cd828['query']);_0x2c743e[_0x5b84('0x34')]=_['intersection'](_0x3cd828[_0x5b84('0x2e')],qs[_0x5b84('0x33')](_0x54a9c0['query']['fields']));_0x2c743e[_0x5b84('0x34')]=_0x2c743e[_0x5b84('0x34')][_0x5b84('0x35')]?_0x2c743e[_0x5b84('0x34')]:_0x3cd828[_0x5b84('0x2e')];if(_0x54a9c0[_0x5b84('0x2f')][_0x5b84('0x3c')]){_0x2c743e[_0x5b84('0x3d')]=[{'all':!![]}];}_0x2c743e=_[_0x5b84('0x39')]({},_0x2c743e,_0x54a9c0[_0x5b84('0x3b')]);return db[_0x5b84('0x2a')][_0x5b84('0x41')](_0x2c743e)[_0x5b84('0x23')](handleEntityNotFound(_0x3fe2a3,null))['then'](respondWithResult(_0x3fe2a3,null))[_0x5b84('0x40')](handleError(_0x3fe2a3,null));};exports[_0x5b84('0x42')]=function(_0x1064ea,_0x433dd1){return db[_0x5b84('0x2a')][_0x5b84('0x42')](_0x1064ea[_0x5b84('0x43')],{})[_0x5b84('0x23')](respondWithResult(_0x433dd1,0xc9))['catch'](handleError(_0x433dd1,null));};exports['update']=function(_0x27382a,_0x307750){if(_0x27382a[_0x5b84('0x43')]['id']){delete _0x27382a['body']['id'];}return db[_0x5b84('0x2a')]['find']({'where':{'id':_0x27382a[_0x5b84('0x44')]['id']}})[_0x5b84('0x23')](handleEntityNotFound(_0x307750,null))[_0x5b84('0x23')](saveUpdates(_0x27382a[_0x5b84('0x43')],null))[_0x5b84('0x23')](respondWithResult(_0x307750,null))[_0x5b84('0x40')](handleError(_0x307750,null));};exports['destroy']=function(_0x3e91d9,_0x540394){return db['ServicenowField']['find']({'where':{'id':_0x3e91d9[_0x5b84('0x44')]['id']}})[_0x5b84('0x23')](handleEntityNotFound(_0x540394,null))[_0x5b84('0x23')](removeEntity(_0x540394,null))[_0x5b84('0x40')](handleError(_0x540394,null));}; \ No newline at end of file +var _0x369a=['filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','options','then','includeAll','findAll','rows','catch','params','keys','include','merge','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','type','map'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x369a,0x1e1));var _0xa369=function(_0x1c59d0,_0x1585cb){_0x1c59d0=_0x1c59d0-0x0;var _0x5014e4=_0x369a[_0x1c59d0];return _0x5014e4;};'use strict';var emlformat=require(_0xa369('0x0'));var rimraf=require(_0xa369('0x1'));var zipdir=require(_0xa369('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa369('0x3'));var moment=require(_0xa369('0x4'));var BPromise=require(_0xa369('0x5'));var Mustache=require(_0xa369('0x6'));var util=require(_0xa369('0x7'));var path=require(_0xa369('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa369('0x9'));var fs=require('fs');var fs_extra=require(_0xa369('0xa'));var _=require(_0xa369('0xb'));var squel=require(_0xa369('0xc'));var crypto=require(_0xa369('0xd'));var jsforce=require(_0xa369('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa369('0xf'));var querystring=require(_0xa369('0x10'));var Papa=require(_0xa369('0x11'));var Redis=require('ioredis');var authService=require(_0xa369('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa369('0x13'));var hardwareService=require(_0xa369('0x14'));var logger=require(_0xa369('0x15'))(_0xa369('0x16'));var utils=require(_0xa369('0x17'));var config=require(_0xa369('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xa369('0x19'))['db'];function respondWithStatusCode(_0x4d963a,_0x564d84){_0x564d84=_0x564d84||0xcc;return function(_0x29e649){if(_0x29e649){return _0x4d963a[_0xa369('0x1a')](_0x564d84);}return _0x4d963a[_0xa369('0x1b')](_0x564d84)[_0xa369('0x1c')]();};}function respondWithResult(_0x483c6d,_0xa5995f){_0xa5995f=_0xa5995f||0xc8;return function(_0x5ae67a){if(_0x5ae67a){return _0x483c6d[_0xa369('0x1b')](_0xa5995f)[_0xa369('0x1d')](_0x5ae67a);}};}function respondWithFilteredResult(_0x53c735,_0x45be95){return function(_0x7090ff){if(_0x7090ff){var _0xff8452=typeof _0x45be95['offset']===_0xa369('0x1e')&&typeof _0x45be95['limit']===_0xa369('0x1e');var _0x44050b=_0x7090ff['count'];var _0x296b82=_0xff8452?0x0:_0x45be95[_0xa369('0x1f')];var _0x425486=_0xff8452?_0x7090ff[_0xa369('0x20')]:_0x45be95[_0xa369('0x1f')]+_0x45be95[_0xa369('0x21')];var _0x4d4b5a;if(_0x425486>=_0x44050b){_0x425486=_0x44050b;_0x4d4b5a=0xc8;}else{_0x4d4b5a=0xce;}_0x53c735['status'](_0x4d4b5a);return _0x53c735[_0xa369('0x22')](_0xa369('0x23'),_0x296b82+'-'+_0x425486+'/'+_0x44050b)[_0xa369('0x1d')](_0x7090ff);}return null;};}function patchUpdates(_0x1584cb){return function(_0xc88631){try{jsonpatch[_0xa369('0x24')](_0xc88631,_0x1584cb,!![]);}catch(_0x70b6c4){return BPromise[_0xa369('0x25')](_0x70b6c4);}return _0xc88631[_0xa369('0x26')]();};}function saveUpdates(_0x351f66,_0x5bb783){return function(_0x28a019){if(_0x28a019){return _0x28a019[_0xa369('0x27')](_0x351f66)['then'](function(_0x4e8988){return _0x4e8988;});}return null;};}function removeEntity(_0x949f61,_0x40a1db){return function(_0x5a64b2){if(_0x5a64b2){return _0x5a64b2[_0xa369('0x28')]()['then'](function(){_0x949f61[_0xa369('0x1b')](0xcc)[_0xa369('0x1c')]();});}};}function handleEntityNotFound(_0x595cc1,_0x7388b3){return function(_0x40a67a){if(!_0x40a67a){_0x595cc1[_0xa369('0x1a')](0x194);}return _0x40a67a;};}function handleError(_0x44807d,_0x4c9e0d){_0x4c9e0d=_0x4c9e0d||0x1f4;return function(_0x14365d){logger[_0xa369('0x29')](_0x14365d[_0xa369('0x2a')]);if(_0x14365d[_0xa369('0x2b')]){delete _0x14365d[_0xa369('0x2b')];}_0x44807d['status'](_0x4c9e0d)[_0xa369('0x2c')](_0x14365d);};}exports[_0xa369('0x2d')]=function(_0x3fa41c,_0x29db62){var _0x48eac5={},_0x4f551a={},_0x3d8f7f={'count':0x0,'rows':[]};var _0x4d4f78=_['map'](db[_0xa369('0x2e')][_0xa369('0x2f')],function(_0x46a859){return{'name':_0x46a859[_0xa369('0x30')],'type':_0x46a859[_0xa369('0x31')]['key']};});_0x4f551a['model']=_[_0xa369('0x32')](_0x4d4f78,'name');_0x4f551a['query']=_['keys'](_0x3fa41c['query']);_0x4f551a[_0xa369('0x33')]=_[_0xa369('0x34')](_0x4f551a[_0xa369('0x35')],_0x4f551a[_0xa369('0x36')]);_0x48eac5[_0xa369('0x37')]=_['intersection'](_0x4f551a[_0xa369('0x35')],qs['fields'](_0x3fa41c[_0xa369('0x36')][_0xa369('0x38')]));_0x48eac5[_0xa369('0x37')]=_0x48eac5[_0xa369('0x37')][_0xa369('0x39')]?_0x48eac5[_0xa369('0x37')]:_0x4f551a['model'];if(!_0x3fa41c[_0xa369('0x36')][_0xa369('0x3a')]('nolimit')){_0x48eac5[_0xa369('0x21')]=qs[_0xa369('0x21')](_0x3fa41c[_0xa369('0x36')]['limit']);_0x48eac5[_0xa369('0x1f')]=qs[_0xa369('0x1f')](_0x3fa41c[_0xa369('0x36')][_0xa369('0x1f')]);}_0x48eac5[_0xa369('0x3b')]=qs[_0xa369('0x3c')](_0x3fa41c[_0xa369('0x36')][_0xa369('0x3c')]);_0x48eac5[_0xa369('0x3d')]=qs['filters'](_['pick'](_0x3fa41c[_0xa369('0x36')],_0x4f551a['filters']),_0x4d4f78);if(_0x3fa41c[_0xa369('0x36')][_0xa369('0x3e')]){_0x48eac5['where']=_['merge'](_0x48eac5[_0xa369('0x3d')],{'$or':_[_0xa369('0x32')](_0x4d4f78,function(_0x54e709){if(_0x54e709[_0xa369('0x31')]!=='VIRTUAL'){var _0x1f7ca8={};_0x1f7ca8[_0x54e709['name']]={'$like':'%'+_0x3fa41c[_0xa369('0x36')][_0xa369('0x3e')]+'%'};return _0x1f7ca8;}})});}_0x48eac5=_['merge']({},_0x48eac5,_0x3fa41c[_0xa369('0x3f')]);var _0x535696={'where':_0x48eac5['where']};return db[_0xa369('0x2e')][_0xa369('0x20')](_0x535696)[_0xa369('0x40')](function(_0x20bcce){_0x3d8f7f[_0xa369('0x20')]=_0x20bcce;if(_0x3fa41c[_0xa369('0x36')][_0xa369('0x41')]){_0x48eac5['include']=[{'all':!![]}];}return db[_0xa369('0x2e')][_0xa369('0x42')](_0x48eac5);})[_0xa369('0x40')](function(_0xee8d03){_0x3d8f7f[_0xa369('0x43')]=_0xee8d03;return _0x3d8f7f;})[_0xa369('0x40')](respondWithFilteredResult(_0x29db62,_0x48eac5))[_0xa369('0x44')](handleError(_0x29db62,null));};exports['show']=function(_0x401166,_0x748382){var _0x325f8f={'raw':!![],'where':{'id':_0x401166[_0xa369('0x45')]['id']}},_0xe98cc7={};_0xe98cc7['model']=_[_0xa369('0x46')](db[_0xa369('0x2e')][_0xa369('0x2f')]);_0xe98cc7[_0xa369('0x36')]=_['keys'](_0x401166[_0xa369('0x36')]);_0xe98cc7[_0xa369('0x33')]=_['intersection'](_0xe98cc7[_0xa369('0x35')],_0xe98cc7[_0xa369('0x36')]);_0x325f8f[_0xa369('0x37')]=_[_0xa369('0x34')](_0xe98cc7[_0xa369('0x35')],qs[_0xa369('0x38')](_0x401166[_0xa369('0x36')][_0xa369('0x38')]));_0x325f8f[_0xa369('0x37')]=_0x325f8f[_0xa369('0x37')][_0xa369('0x39')]?_0x325f8f[_0xa369('0x37')]:_0xe98cc7[_0xa369('0x35')];if(_0x401166[_0xa369('0x36')]['includeAll']){_0x325f8f[_0xa369('0x47')]=[{'all':!![]}];}_0x325f8f=_[_0xa369('0x48')]({},_0x325f8f,_0x401166[_0xa369('0x3f')]);return db[_0xa369('0x2e')]['find'](_0x325f8f)['then'](handleEntityNotFound(_0x748382,null))[_0xa369('0x40')](respondWithResult(_0x748382,null))[_0xa369('0x44')](handleError(_0x748382,null));};exports[_0xa369('0x49')]=function(_0x1b957e,_0x20aad1){return db[_0xa369('0x2e')][_0xa369('0x49')](_0x1b957e[_0xa369('0x4a')],{})[_0xa369('0x40')](respondWithResult(_0x20aad1,0xc9))['catch'](handleError(_0x20aad1,null));};exports[_0xa369('0x27')]=function(_0x42bdf4,_0x45e11c){if(_0x42bdf4[_0xa369('0x4a')]['id']){delete _0x42bdf4['body']['id'];}return db['ServicenowField'][_0xa369('0x4b')]({'where':{'id':_0x42bdf4[_0xa369('0x45')]['id']}})[_0xa369('0x40')](handleEntityNotFound(_0x45e11c,null))[_0xa369('0x40')](saveUpdates(_0x42bdf4[_0xa369('0x4a')],null))[_0xa369('0x40')](respondWithResult(_0x45e11c,null))[_0xa369('0x44')](handleError(_0x45e11c,null));};exports[_0xa369('0x28')]=function(_0x2c7051,_0x58c415){return db[_0xa369('0x2e')][_0xa369('0x4b')]({'where':{'id':_0x2c7051[_0xa369('0x45')]['id']}})[_0xa369('0x40')](handleEntityNotFound(_0x58c415,null))['then'](removeEntity(_0x58c415,null))['catch'](handleError(_0x58c415,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 6370b21..5cce75c 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 _0xc3c5=['../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField','FieldId','util','../../config/logger','bluebird','request-promise'];(function(_0x55edf4,_0x33a21d){var _0x26e41f=function(_0x2680fb){while(--_0x2680fb){_0x55edf4['push'](_0x55edf4['shift']());}};_0x26e41f(++_0x33a21d);}(_0xc3c5,0x167));var _0x5c3c=function(_0x2a116a,_0x333592){_0x2a116a=_0x2a116a-0x0;var _0x21ae53=_0xc3c5[_0x2a116a];return _0x21ae53;};'use strict';var _=require('lodash');var util=require(_0x5c3c('0x0'));var logger=require(_0x5c3c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5c3c('0x2'));var rp=require(_0x5c3c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5c3c('0x4'));var attributes=require(_0x5c3c('0x5'));module[_0x5c3c('0x6')]=function(_0x444fde,_0x25ee1e){return _0x444fde[_0x5c3c('0x7')]('ServicenowField',attributes,{'tableName':_0x5c3c('0x8'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5c3c('0x9'),_0x5c3c('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x088d=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./intServicenowField.attributes','exports','ServicenowField','servicenow_unique_index','idField','lodash','util'];(function(_0x44ed41,_0x236bbd){var _0x1e7c8e=function(_0x42a5a8){while(--_0x42a5a8){_0x44ed41['push'](_0x44ed41['shift']());}};_0x1e7c8e(++_0x236bbd);}(_0x088d,0x1ab));var _0xd088=function(_0x1074c5,_0x2b2787){_0x1074c5=_0x1074c5-0x0;var _0x429cf6=_0x088d[_0x1074c5];return _0x429cf6;};'use strict';var _=require(_0xd088('0x0'));var util=require(_0xd088('0x1'));var logger=require(_0xd088('0x2'))(_0xd088('0x3'));var moment=require(_0xd088('0x4'));var BPromise=require(_0xd088('0x5'));var rp=require(_0xd088('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd088('0x7'));var config=require('../../config/environment');var attributes=require(_0xd088('0x8'));module[_0xd088('0x9')]=function(_0x39f07d,_0x487383){return _0x39f07d['define'](_0xd088('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xd088('0xb'),'fields':[_0xd088('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 910024c..cf7473a 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x513986,_0x31bc65){_0x513986=_0x513986-0x0;var _0x282e99=_0xbdb7[_0x513986];return _0x282e99;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xbaf0=['client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 2ea345c..4e6f8b4 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(_0x4b4a23,_0x1b96d7){var _0x1c61f7=function(_0x32ab7b){while(--_0x32ab7b){_0x4b4a23['push'](_0x4b4a23['shift']());}};_0x1c61f7(++_0x1b96d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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(_0x3d9958,_0x3993e8){var _0x44ea8a=function(_0xfe95ee){while(--_0xfe95ee){_0x3d9958['push'](_0x3d9958['shift']());}};_0x44ea8a(++_0x3993e8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 fa2a673..fdf4411 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(_0x4ec3da,_0x133b76){var _0x4a2886=function(_0x2cf331){while(--_0x2cf331){_0x4ec3da['push'](_0x4ec3da['shift']());}};_0x4a2886(++_0x133b76);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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(_0x2d441f,_0x26893e){var _0x4e17fb=function(_0x157ee4){while(--_0x157ee4){_0x2d441f['push'](_0x2d441f['shift']());}};_0x4e17fb(++_0x26893e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 3dcb684..ac79f39 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 _0xae5e=['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/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','end','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','destroy','getConfigurations','findOne','SugarcrmConfiguration','filter','Subjects','getSubjects','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','duration_hours','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','statusCode','eml-format','fast-json-patch','request-promise','moment','mustache','path'];(function(_0x280e70,_0x41a1ff){var _0x40974a=function(_0x52666a){while(--_0x52666a){_0x280e70['push'](_0x280e70['shift']());}};_0x40974a(++_0x41a1ff);}(_0xae5e,0x1d2));var _0xeae5=function(_0x1148e0,_0x211089){_0x1148e0=_0x1148e0-0x0;var _0x3317a1=_0xae5e[_0x1148e0];return _0x3317a1;};'use strict';var emlformat=require(_0xeae5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xeae5('0x1'));var rp=require(_0xeae5('0x2'));var moment=require(_0xeae5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xeae5('0x4'));var util=require('util');var path=require(_0xeae5('0x5'));var sox=require('sox');var csv=require(_0xeae5('0x6'));var ejs=require(_0xeae5('0x7'));var fs=require('fs');var fs_extra=require(_0xeae5('0x8'));var _=require(_0xeae5('0x9'));var squel=require(_0xeae5('0xa'));var crypto=require('crypto');var jsforce=require(_0xeae5('0xb'));var deskjs=require(_0xeae5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeae5('0xd'));var Papa=require(_0xeae5('0xe'));var Redis=require(_0xeae5('0xf'));var authService=require(_0xeae5('0x10'));var qs=require(_0xeae5('0x11'));var as=require(_0xeae5('0x12'));var hardwareService=require(_0xeae5('0x13'));var logger=require(_0xeae5('0x14'))(_0xeae5('0x15'));var utils=require(_0xeae5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeae5('0x17'));var db=require(_0xeae5('0x18'))['db'];var integrations=require(_0xeae5('0x19'));function respondWithStatusCode(_0x2dffa2,_0x2cdbc4){_0x2cdbc4=_0x2cdbc4||0xcc;return function(_0x4fe179){if(_0x4fe179){return _0x2dffa2[_0xeae5('0x1a')](_0x2cdbc4);}return _0x2dffa2[_0xeae5('0x1b')](_0x2cdbc4)['end']();};}function respondWithResult(_0x414cc6,_0x3eaae7){_0x3eaae7=_0x3eaae7||0xc8;return function(_0xa43e4f){if(_0xa43e4f){return _0x414cc6[_0xeae5('0x1b')](_0x3eaae7)[_0xeae5('0x1c')](_0xa43e4f);}};}function respondWithFilteredResult(_0xdff4d2,_0x734fc0){return function(_0x5ce650){if(_0x5ce650){var _0x55ac1c=typeof _0x734fc0[_0xeae5('0x1d')]===_0xeae5('0x1e')&&typeof _0x734fc0[_0xeae5('0x1f')]===_0xeae5('0x1e');var _0x33b9f4=_0x5ce650[_0xeae5('0x20')];var _0x1f2c3e=_0x55ac1c?0x0:_0x734fc0[_0xeae5('0x1d')];var _0x1de94e=_0x55ac1c?_0x5ce650['count']:_0x734fc0[_0xeae5('0x1d')]+_0x734fc0[_0xeae5('0x1f')];var _0x1a158e;if(_0x1de94e>=_0x33b9f4){_0x1de94e=_0x33b9f4;_0x1a158e=0xc8;}else{_0x1a158e=0xce;}_0xdff4d2[_0xeae5('0x1b')](_0x1a158e);return _0xdff4d2['set'](_0xeae5('0x21'),_0x1f2c3e+'-'+_0x1de94e+'/'+_0x33b9f4)[_0xeae5('0x1c')](_0x5ce650);}return null;};}function patchUpdates(_0x28a054){return function(_0x39b397){try{jsonpatch[_0xeae5('0x22')](_0x39b397,_0x28a054,!![]);}catch(_0x221305){return BPromise['reject'](_0x221305);}return _0x39b397[_0xeae5('0x23')]();};}function saveUpdates(_0x260759,_0x1bc19c){return function(_0x51aa07){if(_0x51aa07){return _0x51aa07['update'](_0x260759)[_0xeae5('0x24')](function(_0x276e50){return _0x276e50;});}return null;};}function removeEntity(_0x1dd9a6,_0x36878b){return function(_0x168d36){if(_0x168d36){return _0x168d36['destroy']()['then'](function(){_0x1dd9a6[_0xeae5('0x1b')](0xcc)[_0xeae5('0x25')]();});}};}function handleEntityNotFound(_0x182750,_0x309299){return function(_0x3aaf65){if(!_0x3aaf65){_0x182750[_0xeae5('0x1a')](0x194);}return _0x3aaf65;};}function handleError(_0x510e37,_0x2aa15c){_0x2aa15c=_0x2aa15c||0x1f4;return function(_0x43357b){logger[_0xeae5('0x26')](_0x43357b[_0xeae5('0x27')]);if(_0x43357b['name']){delete _0x43357b[_0xeae5('0x28')];}_0x510e37[_0xeae5('0x1b')](_0x2aa15c)[_0xeae5('0x29')](_0x43357b);};}exports[_0xeae5('0x2a')]=function(_0x28527c,_0x210463){var _0x4a417a={},_0x2386da={},_0xee2fb4={'count':0x0,'rows':[]};var _0xa82a94=_[_0xeae5('0x2b')](db[_0xeae5('0x2c')][_0xeae5('0x2d')],function(_0x60b3e1){return{'name':_0x60b3e1[_0xeae5('0x2e')],'type':_0x60b3e1['type'][_0xeae5('0x2f')]};});_0x2386da[_0xeae5('0x30')]=_['map'](_0xa82a94,_0xeae5('0x28'));_0x2386da[_0xeae5('0x31')]=_[_0xeae5('0x32')](_0x28527c['query']);_0x2386da[_0xeae5('0x33')]=_[_0xeae5('0x34')](_0x2386da[_0xeae5('0x30')],_0x2386da[_0xeae5('0x31')]);_0x4a417a[_0xeae5('0x35')]=_['intersection'](_0x2386da[_0xeae5('0x30')],qs[_0xeae5('0x36')](_0x28527c[_0xeae5('0x31')]['fields']));_0x4a417a[_0xeae5('0x35')]=_0x4a417a['attributes'][_0xeae5('0x37')]?_0x4a417a[_0xeae5('0x35')]:_0x2386da['model'];if(!_0x28527c[_0xeae5('0x31')][_0xeae5('0x38')](_0xeae5('0x39'))){_0x4a417a[_0xeae5('0x1f')]=qs[_0xeae5('0x1f')](_0x28527c[_0xeae5('0x31')][_0xeae5('0x1f')]);_0x4a417a['offset']=qs[_0xeae5('0x1d')](_0x28527c[_0xeae5('0x31')][_0xeae5('0x1d')]);}_0x4a417a['order']=qs[_0xeae5('0x3a')](_0x28527c[_0xeae5('0x31')][_0xeae5('0x3a')]);_0x4a417a[_0xeae5('0x3b')]=qs[_0xeae5('0x33')](_[_0xeae5('0x3c')](_0x28527c[_0xeae5('0x31')],_0x2386da[_0xeae5('0x33')]),_0xa82a94);if(_0x28527c[_0xeae5('0x31')]['filter']){_0x4a417a[_0xeae5('0x3b')]=_[_0xeae5('0x3d')](_0x4a417a['where'],{'$or':_[_0xeae5('0x2b')](_0xa82a94,function(_0x1d69a8){if(_0x1d69a8[_0xeae5('0x3e')]!==_0xeae5('0x3f')){var _0x1ebae5={};_0x1ebae5[_0x1d69a8[_0xeae5('0x28')]]={'$like':'%'+_0x28527c[_0xeae5('0x31')]['filter']+'%'};return _0x1ebae5;}})});}_0x4a417a=_['merge']({},_0x4a417a,_0x28527c[_0xeae5('0x40')]);var _0x538aa4={'where':_0x4a417a[_0xeae5('0x3b')]};return db[_0xeae5('0x2c')][_0xeae5('0x20')](_0x538aa4)[_0xeae5('0x24')](function(_0x460fb2){_0xee2fb4[_0xeae5('0x20')]=_0x460fb2;if(_0x28527c[_0xeae5('0x31')][_0xeae5('0x41')]){_0x4a417a['include']=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x4a417a);})[_0xeae5('0x24')](function(_0x2cbcdb){_0xee2fb4[_0xeae5('0x42')]=_0x2cbcdb;return _0xee2fb4;})['then'](respondWithFilteredResult(_0x210463,_0x4a417a))['catch'](handleError(_0x210463,null));};exports[_0xeae5('0x43')]=function(_0x1d6e84,_0x298893){var _0x26bb73={'raw':![],'where':{'id':_0x1d6e84[_0xeae5('0x44')]['id']}},_0x2c0698={};_0x2c0698[_0xeae5('0x30')]=_[_0xeae5('0x32')](db['SugarcrmAccount'][_0xeae5('0x2d')]);_0x2c0698[_0xeae5('0x31')]=_[_0xeae5('0x32')](_0x1d6e84[_0xeae5('0x31')]);_0x2c0698[_0xeae5('0x33')]=_['intersection'](_0x2c0698[_0xeae5('0x30')],_0x2c0698[_0xeae5('0x31')]);_0x26bb73[_0xeae5('0x35')]=_[_0xeae5('0x34')](_0x2c0698[_0xeae5('0x30')],qs[_0xeae5('0x36')](_0x1d6e84[_0xeae5('0x31')][_0xeae5('0x36')]));_0x26bb73['attributes']=_0x26bb73[_0xeae5('0x35')][_0xeae5('0x37')]?_0x26bb73[_0xeae5('0x35')]:_0x2c0698[_0xeae5('0x30')];if(_0x1d6e84[_0xeae5('0x31')]['includeAll']){_0x26bb73[_0xeae5('0x45')]=[{'all':!![]}];}_0x26bb73=_[_0xeae5('0x3d')]({},_0x26bb73,_0x1d6e84[_0xeae5('0x40')]);return db[_0xeae5('0x2c')][_0xeae5('0x46')](_0x26bb73)[_0xeae5('0x24')](handleEntityNotFound(_0x298893,null))[_0xeae5('0x24')](respondWithResult(_0x298893,null))[_0xeae5('0x47')](handleError(_0x298893,null));};exports[_0xeae5('0x48')]=function(_0x1d7517,_0xa615f7){return db[_0xeae5('0x2c')][_0xeae5('0x48')](_0x1d7517[_0xeae5('0x49')],{})[_0xeae5('0x24')](respondWithResult(_0xa615f7,0xc9))['catch'](handleError(_0xa615f7,null));};exports['update']=function(_0x2abfcd,_0x1275f0){if(_0x2abfcd['body']['id']){delete _0x2abfcd[_0xeae5('0x49')]['id'];}return db['SugarcrmAccount'][_0xeae5('0x46')]({'where':{'id':_0x2abfcd[_0xeae5('0x44')]['id']}})[_0xeae5('0x24')](handleEntityNotFound(_0x1275f0,null))['then'](saveUpdates(_0x2abfcd['body'],null))[_0xeae5('0x24')](respondWithResult(_0x1275f0,null))[_0xeae5('0x47')](handleError(_0x1275f0,null));};exports[_0xeae5('0x4a')]=function(_0x3f91a3,_0x1cbc19){return db[_0xeae5('0x2c')]['find']({'where':{'id':_0x3f91a3[_0xeae5('0x44')]['id']}})[_0xeae5('0x24')](handleEntityNotFound(_0x1cbc19,null))[_0xeae5('0x24')](removeEntity(_0x1cbc19,null))[_0xeae5('0x47')](handleError(_0x1cbc19,null));};exports[_0xeae5('0x4b')]=function(_0x5eac83,_0x28f6c7,_0x1ef5f7){var _0x10fd49={};var _0x2ca6ce={};var _0x58d4a1;var _0x31d486;return db['SugarcrmAccount'][_0xeae5('0x4c')]({'where':{'id':_0x5eac83[_0xeae5('0x44')]['id']}})[_0xeae5('0x24')](handleEntityNotFound(_0x28f6c7,null))[_0xeae5('0x24')](function(_0x5d9a74){if(_0x5d9a74){_0x58d4a1=_0x5d9a74;_0x2ca6ce['model']=_[_0xeae5('0x32')](db[_0xeae5('0x4d')][_0xeae5('0x2d')]);_0x2ca6ce[_0xeae5('0x31')]=_['keys'](_0x5eac83[_0xeae5('0x31')]);_0x2ca6ce[_0xeae5('0x33')]=_[_0xeae5('0x34')](_0x2ca6ce[_0xeae5('0x30')],_0x2ca6ce[_0xeae5('0x31')]);_0x10fd49[_0xeae5('0x35')]=_[_0xeae5('0x34')](_0x2ca6ce[_0xeae5('0x30')],qs['fields'](_0x5eac83[_0xeae5('0x31')][_0xeae5('0x36')]));_0x10fd49[_0xeae5('0x35')]=_0x10fd49[_0xeae5('0x35')]['length']?_0x10fd49[_0xeae5('0x35')]:_0x2ca6ce['model'];_0x10fd49['order']=qs[_0xeae5('0x3a')](_0x5eac83['query'][_0xeae5('0x3a')]);_0x10fd49[_0xeae5('0x3b')]=qs[_0xeae5('0x33')](_[_0xeae5('0x3c')](_0x5eac83[_0xeae5('0x31')],_0x2ca6ce['filters']));if(_0x5eac83[_0xeae5('0x31')][_0xeae5('0x4e')]){_0x10fd49['where']=_[_0xeae5('0x3d')](_0x10fd49[_0xeae5('0x3b')],{'$or':_[_0xeae5('0x2b')](_0x10fd49[_0xeae5('0x35')],function(_0x1dc4d2){var _0x1c3c17={};_0x1c3c17[_0x1dc4d2]={'$like':'%'+_0x5eac83[_0xeae5('0x31')][_0xeae5('0x4e')]+'%'};return _0x1c3c17;})});}_0x10fd49=_['merge']({},_0x10fd49,_0x5eac83[_0xeae5('0x40')]);return _0x58d4a1[_0xeae5('0x4b')](_0x10fd49);}})['then'](function(_0xc6b88d){if(_0xc6b88d){_0x31d486=_0xc6b88d[_0xeae5('0x37')];if(!_0x5eac83[_0xeae5('0x31')][_0xeae5('0x38')](_0xeae5('0x39'))){_0x10fd49[_0xeae5('0x1f')]=qs['limit'](_0x5eac83[_0xeae5('0x31')][_0xeae5('0x1f')]);_0x10fd49[_0xeae5('0x1d')]=qs[_0xeae5('0x1d')](_0x5eac83[_0xeae5('0x31')][_0xeae5('0x1d')]);}return _0x58d4a1[_0xeae5('0x4b')](_0x10fd49);}})['then'](function(_0x2bc1da){if(_0x2bc1da){return _0x2bc1da?{'count':_0x31d486,'rows':_0x2bc1da}:null;}})[_0xeae5('0x24')](respondWithResult(_0x28f6c7,null))[_0xeae5('0x47')](handleError(_0x28f6c7,null));};exports['addConfiguration']=function(_0x1a5416,_0x551e06,_0x2be836){if(_0x1a5416[_0xeae5('0x49')]['id']){delete _0x1a5416[_0xeae5('0x49')]['id'];}return db[_0xeae5('0x2c')][_0xeae5('0x4c')]({'where':{'id':_0x1a5416[_0xeae5('0x44')]['id']}})[_0xeae5('0x24')](handleEntityNotFound(_0x551e06,null))[_0xeae5('0x24')](function(_0x5449e7){if(_0x5449e7){_0x1a5416[_0xeae5('0x49')]['AccountId']=_0x5449e7['id'];_0x1a5416[_0xeae5('0x49')][_0xeae5('0x4f')]=integrations[_0xeae5('0x50')](_0x1a5416[_0xeae5('0x49')]['channel'],_0x1a5416['body'][_0xeae5('0x3e')]);_0x1a5416[_0xeae5('0x49')][_0xeae5('0x51')]=integrations['getDescriptions'](_0x1a5416[_0xeae5('0x49')]['channel'],_0x1a5416[_0xeae5('0x49')][_0xeae5('0x3e')]);return db[_0xeae5('0x4d')]['create'](_0x1a5416['body'],{'include':[{'model':db[_0xeae5('0x52')],'as':_0xeae5('0x4f')},{'model':db[_0xeae5('0x52')],'as':_0xeae5('0x51')}]});}return null;})[_0xeae5('0x24')](respondWithResult(_0x551e06,null))[_0xeae5('0x47')](handleError(_0x551e06,null));};exports[_0xeae5('0x53')]=function(_0xde5219,_0xe8251d,_0x9e48f7){var _0x26d653='';var _0x101298=['id',_0xeae5('0x28'),_0xeae5('0x54'),_0xeae5('0x55'),_0xeae5('0x56'),'date_start',_0xeae5('0x57'),'duration_minutes',_0xeae5('0x58'),_0xeae5('0x59'),_0xeae5('0x5a'),_0xeae5('0x5b')];return db[_0xeae5('0x2c')][_0xeae5('0x4c')]({'where':{'id':_0xde5219[_0xeae5('0x44')]['id']},'attributes':['id',_0xeae5('0x5c'),'password',_0xeae5('0x5d')]})[_0xeae5('0x24')](handleEntityNotFound(_0xe8251d,null))[_0xeae5('0x24')](function(_0x2cbe29){if(_0x2cbe29){_0x26d653=_0x2cbe29['remoteUri'];var _0x42de25=_0x26d653[_0xeae5('0x5e')](-0x1);if(_0x42de25==='/'){_0x26d653=_0x26d653[_0xeae5('0x5f')](0x0,_0x26d653[_0xeae5('0x60')](_0x42de25));}return rp({'method':_0xeae5('0x61'),'uri':util[_0xeae5('0x62')](_0xeae5('0x63'),_0x26d653,_0xeae5('0x64')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xeae5('0x65'),'rest_data':JSON[_0xeae5('0x66')]({'user_auth':{'user_name':_0x2cbe29['username'],'password':_0x2cbe29[_0xeae5('0x67')],'encryption':_0xeae5('0x68')},'application':_0xeae5('0x69')})}});}})['then'](function(_0x7697d7){if(_0x7697d7&&_0x7697d7[_0xeae5('0x28')]!==_0xeae5('0x6a')&&_0x7697d7[_0xeae5('0x28')]!==_0xeae5('0x6b')){return rp({'method':_0xeae5('0x61'),'uri':util['format'](_0xeae5('0x63'),_0x26d653,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xeae5('0x6c'),'input_type':_0xeae5('0x65'),'response_type':_0xeae5('0x65'),'rest_data':JSON['stringify']({'session':_0x7697d7['id'],'module_name':_0xeae5('0x6d')})}})[_0xeae5('0x24')](function(_0x5b0ec1){if(_0x5b0ec1){var _0x4ad34f=_[_0xeae5('0x6e')](_0x5b0ec1[_0xeae5('0x6f')]);_[_0xeae5('0x70')](_0x4ad34f,function(_0x341b5){return _0x101298[_0xeae5('0x71')](_0x341b5[_0xeae5('0x28')]);});return{'count':_0x4ad34f['length'],'rows':_[_0xeae5('0x2b')](_0x4ad34f,function(_0x341454){return{'id':_0x341454[_0xeae5('0x28')],'name':_0x341454[_0xeae5('0x72')],'custom':_[_0xeae5('0x73')](_0x341454[_0xeae5('0x28')],'_c')?!![]:![],'options':_0x341454[_0xeae5('0x40')]?_[_0xeae5('0x2b')](_['values'](_0x341454[_0xeae5('0x40')]),function(_0x3fbe83){return{'name':_0x3fbe83[_0xeae5('0x74')],'value':_0x3fbe83[_0xeae5('0x28')]};}):[]};})};}})['then'](respondWithResult(_0xe8251d,null))['catch'](function(_0x3810b3){var _0x5f3cc5=_0xde5219[_0xeae5('0x31')]['test']?0x1f4:_0x3810b3[_0xeae5('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xeae5('0x53'),_0x5f3cc5,JSON[_0xeae5('0x66')](_0x3810b3));delete _0x3810b3[_0xeae5('0x28')];if(_0x5f3cc5===0x191){_0x5f3cc5=0x190;}_0xe8251d[_0xeae5('0x1b')](_0x5f3cc5)[_0xeae5('0x29')](_0xde5219['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3810b3['statusCode']}:_0x3810b3);});}else{var _0x3f8db5=0x1f4;_0xe8251d[_0xeae5('0x1b')](_0x3f8db5)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x6c22=['rawAttributes','options','find','create','body','update','getConfigurations','findOne','order','nolimit','AccountId','channel','Descriptions','getDescriptions','SugarcrmConfiguration','Subjects','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','format','Calls','values','module_fields','remove','includes','label','endsWith','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','map','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filters','where','merge','VIRTUAL','filter','SugarcrmAccount','includeAll','include','findAll','catch','show','params'];(function(_0x2646f6,_0x287adf){var _0x577237=function(_0x4d2d6f){while(--_0x4d2d6f){_0x2646f6['push'](_0x2646f6['shift']());}};_0x577237(++_0x287adf);}(_0x6c22,0xb9));var _0x26c2=function(_0x221e0d,_0x384d06){_0x221e0d=_0x221e0d-0x0;var _0x41bcb7=_0x6c22[_0x221e0d];return _0x41bcb7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26c2('0x0'));var zipdir=require(_0x26c2('0x1'));var jsonpatch=require(_0x26c2('0x2'));var rp=require(_0x26c2('0x3'));var moment=require(_0x26c2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x26c2('0x5'));var util=require(_0x26c2('0x6'));var path=require(_0x26c2('0x7'));var sox=require(_0x26c2('0x8'));var csv=require('to-csv');var ejs=require(_0x26c2('0x9'));var fs=require('fs');var fs_extra=require(_0x26c2('0xa'));var _=require(_0x26c2('0xb'));var squel=require(_0x26c2('0xc'));var crypto=require(_0x26c2('0xd'));var jsforce=require(_0x26c2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x26c2('0xf'));var querystring=require(_0x26c2('0x10'));var Papa=require(_0x26c2('0x11'));var Redis=require(_0x26c2('0x12'));var authService=require(_0x26c2('0x13'));var qs=require(_0x26c2('0x14'));var as=require(_0x26c2('0x15'));var hardwareService=require(_0x26c2('0x16'));var logger=require(_0x26c2('0x17'))('api');var utils=require(_0x26c2('0x18'));var config=require(_0x26c2('0x19'));var licenseUtil=require(_0x26c2('0x1a'));var db=require(_0x26c2('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x1160f0,_0x46963b){_0x46963b=_0x46963b||0xcc;return function(_0x3949b6){if(_0x3949b6){return _0x1160f0[_0x26c2('0x1c')](_0x46963b);}return _0x1160f0[_0x26c2('0x1d')](_0x46963b)[_0x26c2('0x1e')]();};}function respondWithResult(_0x28de3b,_0x558d33){_0x558d33=_0x558d33||0xc8;return function(_0x444453){if(_0x444453){return _0x28de3b['status'](_0x558d33)['json'](_0x444453);}};}function respondWithFilteredResult(_0x5465ae,_0x926063){return function(_0x10e8c0){if(_0x10e8c0){var _0x52e80a=typeof _0x926063[_0x26c2('0x1f')]===_0x26c2('0x20')&&typeof _0x926063[_0x26c2('0x21')]===_0x26c2('0x20');var _0x32a08a=_0x10e8c0[_0x26c2('0x22')];var _0x9e94de=_0x52e80a?0x0:_0x926063['offset'];var _0x4a2e36=_0x52e80a?_0x10e8c0['count']:_0x926063[_0x26c2('0x1f')]+_0x926063[_0x26c2('0x21')];var _0xd07f78;if(_0x4a2e36>=_0x32a08a){_0x4a2e36=_0x32a08a;_0xd07f78=0xc8;}else{_0xd07f78=0xce;}_0x5465ae[_0x26c2('0x1d')](_0xd07f78);return _0x5465ae[_0x26c2('0x23')](_0x26c2('0x24'),_0x9e94de+'-'+_0x4a2e36+'/'+_0x32a08a)[_0x26c2('0x25')](_0x10e8c0);}return null;};}function patchUpdates(_0x512002){return function(_0x38a91a){try{jsonpatch[_0x26c2('0x26')](_0x38a91a,_0x512002,!![]);}catch(_0x414024){return BPromise[_0x26c2('0x27')](_0x414024);}return _0x38a91a[_0x26c2('0x28')]();};}function saveUpdates(_0x4be488,_0x5f1506){return function(_0x188818){if(_0x188818){return _0x188818['update'](_0x4be488)[_0x26c2('0x29')](function(_0x38378f){return _0x38378f;});}return null;};}function removeEntity(_0x9cf4bf,_0x12206b){return function(_0x24bf88){if(_0x24bf88){return _0x24bf88[_0x26c2('0x2a')]()[_0x26c2('0x29')](function(){_0x9cf4bf[_0x26c2('0x1d')](0xcc)[_0x26c2('0x1e')]();});}};}function handleEntityNotFound(_0x378d9e,_0x568740){return function(_0x491a58){if(!_0x491a58){_0x378d9e[_0x26c2('0x1c')](0x194);}return _0x491a58;};}function handleError(_0x39bb41,_0x56ab4c){_0x56ab4c=_0x56ab4c||0x1f4;return function(_0x576ff7){logger['error'](_0x576ff7[_0x26c2('0x2b')]);if(_0x576ff7[_0x26c2('0x2c')]){delete _0x576ff7[_0x26c2('0x2c')];}_0x39bb41[_0x26c2('0x1d')](_0x56ab4c)['send'](_0x576ff7);};}exports['index']=function(_0x2f4cbf,_0x57f09a){var _0x1b6da1={},_0x517189={},_0x404c99={'count':0x0,'rows':[]};var _0x43537e=_[_0x26c2('0x2d')](db['SugarcrmAccount']['rawAttributes'],function(_0x1946ac){return{'name':_0x1946ac[_0x26c2('0x2e')],'type':_0x1946ac[_0x26c2('0x2f')][_0x26c2('0x30')]};});_0x517189[_0x26c2('0x31')]=_[_0x26c2('0x2d')](_0x43537e,_0x26c2('0x2c'));_0x517189[_0x26c2('0x32')]=_[_0x26c2('0x33')](_0x2f4cbf['query']);_0x517189['filters']=_['intersection'](_0x517189[_0x26c2('0x31')],_0x517189[_0x26c2('0x32')]);_0x1b6da1[_0x26c2('0x34')]=_[_0x26c2('0x35')](_0x517189[_0x26c2('0x31')],qs[_0x26c2('0x36')](_0x2f4cbf[_0x26c2('0x32')][_0x26c2('0x36')]));_0x1b6da1[_0x26c2('0x34')]=_0x1b6da1['attributes'][_0x26c2('0x37')]?_0x1b6da1['attributes']:_0x517189[_0x26c2('0x31')];if(!_0x2f4cbf['query'][_0x26c2('0x38')]('nolimit')){_0x1b6da1[_0x26c2('0x21')]=qs[_0x26c2('0x21')](_0x2f4cbf['query'][_0x26c2('0x21')]);_0x1b6da1['offset']=qs['offset'](_0x2f4cbf[_0x26c2('0x32')][_0x26c2('0x1f')]);}_0x1b6da1['order']=qs[_0x26c2('0x39')](_0x2f4cbf['query']['sort']);_0x1b6da1['where']=qs['filters'](_[_0x26c2('0x3a')](_0x2f4cbf[_0x26c2('0x32')],_0x517189[_0x26c2('0x3b')]),_0x43537e);if(_0x2f4cbf[_0x26c2('0x32')]['filter']){_0x1b6da1[_0x26c2('0x3c')]=_[_0x26c2('0x3d')](_0x1b6da1[_0x26c2('0x3c')],{'$or':_[_0x26c2('0x2d')](_0x43537e,function(_0x50773c){if(_0x50773c[_0x26c2('0x2f')]!==_0x26c2('0x3e')){var _0x5c8a4e={};_0x5c8a4e[_0x50773c[_0x26c2('0x2c')]]={'$like':'%'+_0x2f4cbf[_0x26c2('0x32')][_0x26c2('0x3f')]+'%'};return _0x5c8a4e;}})});}_0x1b6da1=_[_0x26c2('0x3d')]({},_0x1b6da1,_0x2f4cbf['options']);var _0x5a0632={'where':_0x1b6da1[_0x26c2('0x3c')]};return db[_0x26c2('0x40')][_0x26c2('0x22')](_0x5a0632)[_0x26c2('0x29')](function(_0x436f3a){_0x404c99[_0x26c2('0x22')]=_0x436f3a;if(_0x2f4cbf[_0x26c2('0x32')][_0x26c2('0x41')]){_0x1b6da1[_0x26c2('0x42')]=[{'all':!![]}];}return db[_0x26c2('0x40')][_0x26c2('0x43')](_0x1b6da1);})[_0x26c2('0x29')](function(_0x3fbeb3){_0x404c99['rows']=_0x3fbeb3;return _0x404c99;})[_0x26c2('0x29')](respondWithFilteredResult(_0x57f09a,_0x1b6da1))[_0x26c2('0x44')](handleError(_0x57f09a,null));};exports[_0x26c2('0x45')]=function(_0x2cee4f,_0x46e687){var _0x381587={'raw':![],'where':{'id':_0x2cee4f[_0x26c2('0x46')]['id']}},_0x3f8dc0={};_0x3f8dc0['model']=_[_0x26c2('0x33')](db[_0x26c2('0x40')][_0x26c2('0x47')]);_0x3f8dc0[_0x26c2('0x32')]=_[_0x26c2('0x33')](_0x2cee4f[_0x26c2('0x32')]);_0x3f8dc0[_0x26c2('0x3b')]=_[_0x26c2('0x35')](_0x3f8dc0[_0x26c2('0x31')],_0x3f8dc0[_0x26c2('0x32')]);_0x381587['attributes']=_['intersection'](_0x3f8dc0['model'],qs[_0x26c2('0x36')](_0x2cee4f[_0x26c2('0x32')][_0x26c2('0x36')]));_0x381587[_0x26c2('0x34')]=_0x381587[_0x26c2('0x34')][_0x26c2('0x37')]?_0x381587[_0x26c2('0x34')]:_0x3f8dc0[_0x26c2('0x31')];if(_0x2cee4f[_0x26c2('0x32')][_0x26c2('0x41')]){_0x381587[_0x26c2('0x42')]=[{'all':!![]}];}_0x381587=_['merge']({},_0x381587,_0x2cee4f[_0x26c2('0x48')]);return db[_0x26c2('0x40')][_0x26c2('0x49')](_0x381587)[_0x26c2('0x29')](handleEntityNotFound(_0x46e687,null))[_0x26c2('0x29')](respondWithResult(_0x46e687,null))[_0x26c2('0x44')](handleError(_0x46e687,null));};exports[_0x26c2('0x4a')]=function(_0x332f3d,_0x50dc85){return db[_0x26c2('0x40')][_0x26c2('0x4a')](_0x332f3d[_0x26c2('0x4b')],{})['then'](respondWithResult(_0x50dc85,0xc9))['catch'](handleError(_0x50dc85,null));};exports[_0x26c2('0x4c')]=function(_0x35b4aa,_0x2a3630){if(_0x35b4aa[_0x26c2('0x4b')]['id']){delete _0x35b4aa[_0x26c2('0x4b')]['id'];}return db[_0x26c2('0x40')]['find']({'where':{'id':_0x35b4aa['params']['id']}})[_0x26c2('0x29')](handleEntityNotFound(_0x2a3630,null))['then'](saveUpdates(_0x35b4aa['body'],null))[_0x26c2('0x29')](respondWithResult(_0x2a3630,null))[_0x26c2('0x44')](handleError(_0x2a3630,null));};exports['destroy']=function(_0x399964,_0xea42){return db[_0x26c2('0x40')]['find']({'where':{'id':_0x399964[_0x26c2('0x46')]['id']}})['then'](handleEntityNotFound(_0xea42,null))[_0x26c2('0x29')](removeEntity(_0xea42,null))[_0x26c2('0x44')](handleError(_0xea42,null));};exports[_0x26c2('0x4d')]=function(_0x5a4615,_0x1fd47d,_0x5c620b){var _0x4bbdac={};var _0x774eb1={};var _0x111960;var _0x3310a2;return db[_0x26c2('0x40')][_0x26c2('0x4e')]({'where':{'id':_0x5a4615[_0x26c2('0x46')]['id']}})[_0x26c2('0x29')](handleEntityNotFound(_0x1fd47d,null))[_0x26c2('0x29')](function(_0x4664ad){if(_0x4664ad){_0x111960=_0x4664ad;_0x774eb1['model']=_[_0x26c2('0x33')](db['SugarcrmConfiguration'][_0x26c2('0x47')]);_0x774eb1[_0x26c2('0x32')]=_['keys'](_0x5a4615[_0x26c2('0x32')]);_0x774eb1[_0x26c2('0x3b')]=_[_0x26c2('0x35')](_0x774eb1['model'],_0x774eb1[_0x26c2('0x32')]);_0x4bbdac[_0x26c2('0x34')]=_[_0x26c2('0x35')](_0x774eb1[_0x26c2('0x31')],qs[_0x26c2('0x36')](_0x5a4615['query']['fields']));_0x4bbdac[_0x26c2('0x34')]=_0x4bbdac[_0x26c2('0x34')][_0x26c2('0x37')]?_0x4bbdac['attributes']:_0x774eb1[_0x26c2('0x31')];_0x4bbdac[_0x26c2('0x4f')]=qs[_0x26c2('0x39')](_0x5a4615['query'][_0x26c2('0x39')]);_0x4bbdac[_0x26c2('0x3c')]=qs['filters'](_[_0x26c2('0x3a')](_0x5a4615[_0x26c2('0x32')],_0x774eb1['filters']));if(_0x5a4615['query'][_0x26c2('0x3f')]){_0x4bbdac[_0x26c2('0x3c')]=_['merge'](_0x4bbdac[_0x26c2('0x3c')],{'$or':_[_0x26c2('0x2d')](_0x4bbdac['attributes'],function(_0x1cef3b){var _0x38f13d={};_0x38f13d[_0x1cef3b]={'$like':'%'+_0x5a4615[_0x26c2('0x32')]['filter']+'%'};return _0x38f13d;})});}_0x4bbdac=_[_0x26c2('0x3d')]({},_0x4bbdac,_0x5a4615[_0x26c2('0x48')]);return _0x111960[_0x26c2('0x4d')](_0x4bbdac);}})[_0x26c2('0x29')](function(_0x12bc3d){if(_0x12bc3d){_0x3310a2=_0x12bc3d['length'];if(!_0x5a4615[_0x26c2('0x32')]['hasOwnProperty'](_0x26c2('0x50'))){_0x4bbdac['limit']=qs['limit'](_0x5a4615[_0x26c2('0x32')][_0x26c2('0x21')]);_0x4bbdac[_0x26c2('0x1f')]=qs['offset'](_0x5a4615[_0x26c2('0x32')][_0x26c2('0x1f')]);}return _0x111960[_0x26c2('0x4d')](_0x4bbdac);}})[_0x26c2('0x29')](function(_0x33c0dc){if(_0x33c0dc){return _0x33c0dc?{'count':_0x3310a2,'rows':_0x33c0dc}:null;}})[_0x26c2('0x29')](respondWithResult(_0x1fd47d,null))[_0x26c2('0x44')](handleError(_0x1fd47d,null));};exports['addConfiguration']=function(_0x49326e,_0x379166,_0x1abbbe){if(_0x49326e[_0x26c2('0x4b')]['id']){delete _0x49326e[_0x26c2('0x4b')]['id'];}return db['SugarcrmAccount'][_0x26c2('0x4e')]({'where':{'id':_0x49326e[_0x26c2('0x46')]['id']}})[_0x26c2('0x29')](handleEntityNotFound(_0x379166,null))[_0x26c2('0x29')](function(_0x204568){if(_0x204568){_0x49326e['body'][_0x26c2('0x51')]=_0x204568['id'];_0x49326e[_0x26c2('0x4b')]['Subjects']=integrations['getSubjects'](_0x49326e['body'][_0x26c2('0x52')],_0x49326e[_0x26c2('0x4b')][_0x26c2('0x2f')]);_0x49326e[_0x26c2('0x4b')][_0x26c2('0x53')]=integrations[_0x26c2('0x54')](_0x49326e['body'][_0x26c2('0x52')],_0x49326e['body'][_0x26c2('0x2f')]);return db[_0x26c2('0x55')][_0x26c2('0x4a')](_0x49326e['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x26c2('0x56')},{'model':db[_0x26c2('0x57')],'as':_0x26c2('0x53')}]});}return null;})[_0x26c2('0x29')](respondWithResult(_0x379166,null))[_0x26c2('0x44')](handleError(_0x379166,null));};exports[_0x26c2('0x58')]=function(_0x2bc803,_0x6fcacc,_0x5208ef){var _0x34dc11='';var _0x46bbea=['id',_0x26c2('0x2c'),_0x26c2('0x59'),'created_by',_0x26c2('0x5a'),_0x26c2('0x5b'),_0x26c2('0x5c'),_0x26c2('0x5d'),_0x26c2('0x5e'),_0x26c2('0x5f'),_0x26c2('0x60'),_0x26c2('0x61')];return db['SugarcrmAccount'][_0x26c2('0x4e')]({'where':{'id':_0x2bc803[_0x26c2('0x46')]['id']},'attributes':['id',_0x26c2('0x62'),_0x26c2('0x63'),'remoteUri']})[_0x26c2('0x29')](handleEntityNotFound(_0x6fcacc,null))['then'](function(_0x50fa10){if(_0x50fa10){_0x34dc11=_0x50fa10[_0x26c2('0x64')];var _0x1ded77=_0x34dc11[_0x26c2('0x65')](-0x1);if(_0x1ded77==='/'){_0x34dc11=_0x34dc11[_0x26c2('0x66')](0x0,_0x34dc11[_0x26c2('0x67')](_0x1ded77));}return rp({'method':'POST','uri':util['format'](_0x26c2('0x68'),_0x34dc11,_0x26c2('0x69')),'json':!![],'form':{'method':_0x26c2('0x6a'),'input_type':_0x26c2('0x6b'),'response_type':'JSON','rest_data':JSON[_0x26c2('0x6c')]({'user_auth':{'user_name':_0x50fa10[_0x26c2('0x62')],'password':_0x50fa10['password'],'encryption':_0x26c2('0x6d')},'application':_0x26c2('0x6e')})}});}})[_0x26c2('0x29')](function(_0xd74bd1){if(_0xd74bd1&&_0xd74bd1[_0x26c2('0x2c')]!==_0x26c2('0x6f')&&_0xd74bd1[_0x26c2('0x2c')]!==_0x26c2('0x70')){return rp({'method':_0x26c2('0x71'),'uri':util[_0x26c2('0x72')](_0x26c2('0x68'),_0x34dc11,_0x26c2('0x69')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0x26c2('0x6b'),'rest_data':JSON[_0x26c2('0x6c')]({'session':_0xd74bd1['id'],'module_name':_0x26c2('0x73')})}})[_0x26c2('0x29')](function(_0x55ad3f){if(_0x55ad3f){var _0x472537=_[_0x26c2('0x74')](_0x55ad3f[_0x26c2('0x75')]);_[_0x26c2('0x76')](_0x472537,function(_0x3baa60){return _0x46bbea[_0x26c2('0x77')](_0x3baa60[_0x26c2('0x2c')]);});return{'count':_0x472537[_0x26c2('0x37')],'rows':_[_0x26c2('0x2d')](_0x472537,function(_0x5ddf91){return{'id':_0x5ddf91[_0x26c2('0x2c')],'name':_0x5ddf91[_0x26c2('0x78')],'custom':_[_0x26c2('0x79')](_0x5ddf91[_0x26c2('0x2c')],'_c')?!![]:![],'options':_0x5ddf91['options']?_[_0x26c2('0x2d')](_[_0x26c2('0x74')](_0x5ddf91[_0x26c2('0x48')]),function(_0x211b5b){return{'name':_0x211b5b['value'],'value':_0x211b5b[_0x26c2('0x2c')]};}):[]};})};}})[_0x26c2('0x29')](respondWithResult(_0x6fcacc,null))[_0x26c2('0x44')](function(_0x1f5a09){var _0x4d83ba=_0x2bc803[_0x26c2('0x32')][_0x26c2('0x7a')]?0x1f4:_0x1f5a09[_0x26c2('0x7b')]||0x1f4;logger[_0x26c2('0x7c')](_0x26c2('0x7d'),_0x26c2('0x58'),_0x4d83ba,JSON[_0x26c2('0x6c')](_0x1f5a09));delete _0x1f5a09['name'];if(_0x4d83ba===0x191){_0x4d83ba=0x190;}_0x6fcacc[_0x26c2('0x1d')](_0x4d83ba)[_0x26c2('0x7e')](_0x2bc803[_0x26c2('0x32')][_0x26c2('0x7a')]?{'message':_0x26c2('0x7f'),'statusCode':_0x1f5a09[_0x26c2('0x7b')]}:_0x1f5a09);});}else{var _0x1d1232=0x1f4;_0x6fcacc[_0x26c2('0x1d')](_0x1d1232)[_0x26c2('0x7e')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 04eddfe..e19b6e4 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 _0x733f=['SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x513cbe,_0x1b3152){var _0xc36e3d=function(_0x24b19c){while(--_0x24b19c){_0x513cbe['push'](_0x513cbe['shift']());}};_0xc36e3d(++_0x1b3152);}(_0x733f,0x120));var _0xf733=function(_0x1bcb4a,_0x4c6e6d){_0x1bcb4a=_0x1bcb4a-0x0;var _0x4655c6=_0x733f[_0x1bcb4a];return _0x4655c6;};'use strict';var _=require(_0xf733('0x0'));var util=require('util');var logger=require(_0xf733('0x1'))(_0xf733('0x2'));var moment=require(_0xf733('0x3'));var BPromise=require('bluebird');var rp=require(_0xf733('0x4'));var fs=require('fs');var path=require(_0xf733('0x5'));var rimraf=require(_0xf733('0x6'));var config=require(_0xf733('0x7'));var attributes=require(_0xf733('0x8'));var integrations=require(_0xf733('0x9'));module[_0xf733('0xa')]=function(_0x2bc2ab,_0x2390fc){return _0x2bc2ab['define'](_0xf733('0xb'),attributes,{'tableName':_0xf733('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x242f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x1ac053,_0x39267a){var _0x2d209a=function(_0x5106d2){while(--_0x5106d2){_0x1ac053['push'](_0x1ac053['shift']());}};_0x2d209a(++_0x39267a);}(_0x242f,0x129));var _0xf242=function(_0x4f526c,_0x6c4dbe){_0x4f526c=_0x4f526c-0x0;var _0x38a51e=_0x242f[_0x4f526c];return _0x38a51e;};'use strict';var _=require(_0xf242('0x0'));var util=require(_0xf242('0x1'));var logger=require(_0xf242('0x2'))('api');var moment=require(_0xf242('0x3'));var BPromise=require(_0xf242('0x4'));var rp=require(_0xf242('0x5'));var fs=require('fs');var path=require(_0xf242('0x6'));var rimraf=require(_0xf242('0x7'));var config=require(_0xf242('0x8'));var attributes=require(_0xf242('0x9'));var integrations=require(_0xf242('0xa'));module[_0xf242('0xb')]=function(_0x43a242,_0x2ccd51){return _0x43a242[_0xf242('0xc')](_0xf242('0xd'),attributes,{'tableName':_0xf242('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 098608b..68dfe3c 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 _0x0745=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','include','map','model','debug','ShowSugarcrmAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x2501e1,_0x555050){var _0x4af3a2=function(_0x262bfa){while(--_0x262bfa){_0x2501e1['push'](_0x2501e1['shift']());}};_0x4af3a2(++_0x555050);}(_0x0745,0x19b));var _0x5074=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x0745[_0x1da527];return _0x40fc7c;};'use strict';var _=require(_0x5074('0x0'));var util=require(_0x5074('0x1'));var moment=require(_0x5074('0x2'));var BPromise=require('bluebird');var rs=require(_0x5074('0x3'));var fs=require('fs');var Redis=require(_0x5074('0x4'));var db=require(_0x5074('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5074('0x6'))(_0x5074('0x7'));var config=require(_0x5074('0x8'));var jayson=require(_0x5074('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ebb79,_0x5c57cb,_0x244ca5){return new BPromise(function(_0x303eca,_0x4554e6){return client[_0x5074('0xa')](_0x3ebb79,_0x244ca5)[_0x5074('0xb')](function(_0x277f57){logger[_0x5074('0xc')](_0x5074('0xd'),_0x5c57cb,_0x5074('0xe'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x5c57cb,_0x5074('0xe'),JSON[_0x5074('0xf')](_0x277f57));if(_0x277f57[_0x5074('0x10')]){if(_0x277f57[_0x5074('0x10')]['code']===0x1f4){logger[_0x5074('0x10')](_0x5074('0xd'),_0x5c57cb,_0x277f57[_0x5074('0x10')][_0x5074('0x11')]);return _0x4554e6(_0x277f57[_0x5074('0x10')][_0x5074('0x11')]);}logger[_0x5074('0x10')](_0x5074('0xd'),_0x5c57cb,_0x277f57[_0x5074('0x10')][_0x5074('0x11')]);return _0x303eca(_0x277f57[_0x5074('0x10')][_0x5074('0x11')]);}else{logger[_0x5074('0xc')](_0x5074('0xd'),_0x5c57cb,_0x5074('0xe'));_0x303eca(_0x277f57[_0x5074('0x12')]['message']);}})[_0x5074('0x13')](function(_0x5023a3){logger['error'](_0x5074('0xd'),_0x5c57cb,_0x5023a3);_0x4554e6(_0x5023a3);});});}exports[_0x5074('0x14')]=function(_0x59f83d){var _0x4f8873=this;return new Promise(function(_0x45120b,_0x25e418){return db[_0x5074('0x15')][_0x5074('0x16')]({'raw':_0x59f83d['options']?_0x59f83d['options']['raw']===undefined?!![]:![]:!![],'where':_0x59f83d[_0x5074('0x17')]?_0x59f83d['options'][_0x5074('0x18')]||null:null,'attributes':_0x59f83d[_0x5074('0x17')]?_0x59f83d[_0x5074('0x17')][_0x5074('0x19')]||null:null,'limit':_0x59f83d[_0x5074('0x17')]?_0x59f83d['options']['limit']||null:null,'include':_0x59f83d[_0x5074('0x17')]?_0x59f83d['options'][_0x5074('0x1a')]?_[_0x5074('0x1b')](_0x59f83d[_0x5074('0x17')][_0x5074('0x1a')],function(_0x38481a){return{'model':db[_0x38481a[_0x5074('0x1c')]],'as':_0x38481a['as'],'attributes':_0x38481a['attributes'],'include':_0x38481a[_0x5074('0x1a')]?_[_0x5074('0x1b')](_0x38481a[_0x5074('0x1a')],function(_0x22cf9b){return{'model':db[_0x22cf9b[_0x5074('0x1c')]],'as':_0x22cf9b['as'],'attributes':_0x22cf9b[_0x5074('0x19')],'include':_0x22cf9b[_0x5074('0x1a')]?_[_0x5074('0x1b')](_0x22cf9b[_0x5074('0x1a')],function(_0x18dcfa){return{'model':db[_0x18dcfa[_0x5074('0x1c')]],'as':_0x18dcfa['as'],'attributes':_0x18dcfa[_0x5074('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5074('0xb')](function(_0x3da326){logger[_0x5074('0xc')](_0x5074('0x14'),_0x59f83d);logger[_0x5074('0x1d')](_0x5074('0x14'),_0x59f83d,JSON[_0x5074('0xf')](_0x3da326));_0x45120b(_0x3da326);})[_0x5074('0x13')](function(_0x50bcb5){logger['error'](_0x5074('0x14'),_0x50bcb5[_0x5074('0x11')],_0x59f83d);_0x25e418(_0x4f8873[_0x5074('0x10')](0x1f4,_0x50bcb5[_0x5074('0x11')]));});});};exports[_0x5074('0x1e')]=function(_0x51464a){var _0x93e8f=this;return new Promise(function(_0x5c0723,_0x523d45){return db[_0x5074('0x15')][_0x5074('0x1f')]({'raw':_0x51464a[_0x5074('0x17')]?_0x51464a[_0x5074('0x17')][_0x5074('0x20')]===undefined?!![]:![]:!![],'where':_0x51464a['options']?_0x51464a[_0x5074('0x17')][_0x5074('0x18')]||null:null,'attributes':_0x51464a[_0x5074('0x17')]?_0x51464a[_0x5074('0x17')]['attributes']||null:null,'include':_0x51464a[_0x5074('0x17')]?_0x51464a[_0x5074('0x17')][_0x5074('0x1a')]?_['map'](_0x51464a['options'][_0x5074('0x1a')],function(_0xaf87ec){return{'model':db[_0xaf87ec[_0x5074('0x1c')]],'as':_0xaf87ec['as'],'attributes':_0xaf87ec['attributes'],'include':_0xaf87ec['include']?_[_0x5074('0x1b')](_0xaf87ec[_0x5074('0x1a')],function(_0x2c14ae){return{'model':db[_0x2c14ae['model']],'as':_0x2c14ae['as'],'attributes':_0x2c14ae['attributes'],'include':_0x2c14ae[_0x5074('0x1a')]?_['map'](_0x2c14ae[_0x5074('0x1a')],function(_0x31ea13){return{'model':db[_0x31ea13[_0x5074('0x1c')]],'as':_0x31ea13['as'],'attributes':_0x31ea13[_0x5074('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5074('0xb')](function(_0x474f1c){logger[_0x5074('0xc')]('ShowSugarcrmAccount',_0x51464a);logger[_0x5074('0x1d')](_0x5074('0x1e'),_0x51464a,JSON[_0x5074('0xf')](_0x474f1c));_0x5c0723(_0x474f1c);})['catch'](function(_0x55a397){logger[_0x5074('0x10')](_0x5074('0x1e'),_0x55a397[_0x5074('0x11')],_0x51464a);_0x523d45(_0x93e8f['error'](0x1f4,_0x55a397['message']));});});}; \ No newline at end of file +var _0xd209=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','include','map','model','then','catch','ShowSugarcrmAccount','find','raw','lodash','moment'];(function(_0x2e78ec,_0x2d23a6){var _0x1bbe09=function(_0x5e9518){while(--_0x5e9518){_0x2e78ec['push'](_0x2e78ec['shift']());}};_0x1bbe09(++_0x2d23a6);}(_0xd209,0x106));var _0x9d20=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xd209[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x9d20('0x0'));var util=require('util');var moment=require(_0x9d20('0x1'));var BPromise=require('bluebird');var rs=require(_0x9d20('0x2'));var fs=require('fs');var Redis=require(_0x9d20('0x3'));var db=require(_0x9d20('0x4'))['db'];var utils=require(_0x9d20('0x5'));var logger=require(_0x9d20('0x6'))('rpc');var config=require(_0x9d20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d20('0x8')][_0x9d20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x101b2f,_0x204da7,_0x24e220){return new BPromise(function(_0x309247,_0x428a31){return client[_0x9d20('0xa')](_0x101b2f,_0x24e220)['then'](function(_0x3b9cec){logger[_0x9d20('0xb')](_0x9d20('0xc'),_0x204da7,_0x9d20('0xd'));logger[_0x9d20('0xe')](_0x9d20('0xf'),_0x204da7,_0x9d20('0xd'),JSON[_0x9d20('0x10')](_0x3b9cec));if(_0x3b9cec[_0x9d20('0x11')]){if(_0x3b9cec['error']['code']===0x1f4){logger['error'](_0x9d20('0xc'),_0x204da7,_0x3b9cec[_0x9d20('0x11')][_0x9d20('0x12')]);return _0x428a31(_0x3b9cec[_0x9d20('0x11')]['message']);}logger[_0x9d20('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x204da7,_0x3b9cec['error'][_0x9d20('0x12')]);return _0x309247(_0x3b9cec[_0x9d20('0x11')]['message']);}else{logger[_0x9d20('0xb')](_0x9d20('0xc'),_0x204da7,'request\x20sent');_0x309247(_0x3b9cec['result'][_0x9d20('0x12')]);}})['catch'](function(_0x28754f){logger['error'](_0x9d20('0xc'),_0x204da7,_0x28754f);_0x428a31(_0x28754f);});});}exports[_0x9d20('0x13')]=function(_0x115aaa){var _0x4b10c2=this;return new Promise(function(_0x5d8676,_0x41bd87){return db[_0x9d20('0x14')][_0x9d20('0x15')]({'raw':_0x115aaa[_0x9d20('0x16')]?_0x115aaa[_0x9d20('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x115aaa['options']?_0x115aaa[_0x9d20('0x16')][_0x9d20('0x17')]||null:null,'attributes':_0x115aaa[_0x9d20('0x16')]?_0x115aaa[_0x9d20('0x16')][_0x9d20('0x18')]||null:null,'limit':_0x115aaa[_0x9d20('0x16')]?_0x115aaa[_0x9d20('0x16')]['limit']||null:null,'include':_0x115aaa['options']?_0x115aaa[_0x9d20('0x16')][_0x9d20('0x19')]?_[_0x9d20('0x1a')](_0x115aaa[_0x9d20('0x16')]['include'],function(_0x26cfa2){return{'model':db[_0x26cfa2[_0x9d20('0x1b')]],'as':_0x26cfa2['as'],'attributes':_0x26cfa2[_0x9d20('0x18')],'include':_0x26cfa2[_0x9d20('0x19')]?_[_0x9d20('0x1a')](_0x26cfa2[_0x9d20('0x19')],function(_0x5d1233){return{'model':db[_0x5d1233['model']],'as':_0x5d1233['as'],'attributes':_0x5d1233[_0x9d20('0x18')],'include':_0x5d1233[_0x9d20('0x19')]?_[_0x9d20('0x1a')](_0x5d1233[_0x9d20('0x19')],function(_0x3f6022){return{'model':db[_0x3f6022[_0x9d20('0x1b')]],'as':_0x3f6022['as'],'attributes':_0x3f6022[_0x9d20('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9d20('0x1c')](function(_0x519c5c){logger[_0x9d20('0xb')](_0x9d20('0x13'),_0x115aaa);logger[_0x9d20('0xe')](_0x9d20('0x13'),_0x115aaa,JSON[_0x9d20('0x10')](_0x519c5c));_0x5d8676(_0x519c5c);})[_0x9d20('0x1d')](function(_0x2f9b6c){logger['error'](_0x9d20('0x13'),_0x2f9b6c[_0x9d20('0x12')],_0x115aaa);_0x41bd87(_0x4b10c2[_0x9d20('0x11')](0x1f4,_0x2f9b6c['message']));});});};exports[_0x9d20('0x1e')]=function(_0x4462b2){var _0x4a4f0c=this;return new Promise(function(_0x522533,_0x278cff){return db[_0x9d20('0x14')][_0x9d20('0x1f')]({'raw':_0x4462b2['options']?_0x4462b2[_0x9d20('0x16')][_0x9d20('0x20')]===undefined?!![]:![]:!![],'where':_0x4462b2[_0x9d20('0x16')]?_0x4462b2[_0x9d20('0x16')]['where']||null:null,'attributes':_0x4462b2[_0x9d20('0x16')]?_0x4462b2[_0x9d20('0x16')][_0x9d20('0x18')]||null:null,'include':_0x4462b2['options']?_0x4462b2[_0x9d20('0x16')][_0x9d20('0x19')]?_[_0x9d20('0x1a')](_0x4462b2[_0x9d20('0x16')]['include'],function(_0x40d043){return{'model':db[_0x40d043[_0x9d20('0x1b')]],'as':_0x40d043['as'],'attributes':_0x40d043['attributes'],'include':_0x40d043[_0x9d20('0x19')]?_[_0x9d20('0x1a')](_0x40d043[_0x9d20('0x19')],function(_0x3f23b7){return{'model':db[_0x3f23b7[_0x9d20('0x1b')]],'as':_0x3f23b7['as'],'attributes':_0x3f23b7[_0x9d20('0x18')],'include':_0x3f23b7['include']?_[_0x9d20('0x1a')](_0x3f23b7[_0x9d20('0x19')],function(_0x5b843d){return{'model':db[_0x5b843d[_0x9d20('0x1b')]],'as':_0x5b843d['as'],'attributes':_0x5b843d[_0x9d20('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9d20('0x1c')](function(_0x3a6b5f){logger[_0x9d20('0xb')]('ShowSugarcrmAccount',_0x4462b2);logger['debug'](_0x9d20('0x1e'),_0x4462b2,JSON[_0x9d20('0x10')](_0x3a6b5f));_0x522533(_0x3a6b5f);})['catch'](function(_0x5dde49){logger[_0x9d20('0x11')]('ShowSugarcrmAccount',_0x5dde49['message'],_0x4462b2);_0x278cff(_0x4a4f0c[_0x9d20('0x11')](0x1f4,_0x5dde49['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 3f95f3e..c778004 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 _0x3b7d=['exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy'];(function(_0x1e3d85,_0x141745){var _0xa19ba6=function(_0x1db583){while(--_0x1db583){_0x1e3d85['push'](_0x1e3d85['shift']());}};_0xa19ba6(++_0x141745);}(_0x3b7d,0x1e4));var _0xd3b7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3b7d[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd3b7('0x0'));var timeout=require(_0xd3b7('0x1'));var express=require('express');var router=express[_0xd3b7('0x2')]();var fs_extra=require(_0xd3b7('0x3'));var auth=require(_0xd3b7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd3b7('0x5'));var controller=require(_0xd3b7('0x6'));router['get']('/',auth[_0xd3b7('0x7')](),controller[_0xd3b7('0x8')]);router[_0xd3b7('0x9')](_0xd3b7('0xa'),auth[_0xd3b7('0x7')](),controller[_0xd3b7('0xb')]);router[_0xd3b7('0x9')]('/:id/fields',auth[_0xd3b7('0x7')](),controller[_0xd3b7('0xc')]);router[_0xd3b7('0x9')](_0xd3b7('0xd'),auth[_0xd3b7('0x7')](),controller['getSubjects']);router[_0xd3b7('0x9')](_0xd3b7('0xe'),auth['isAuthenticated'](),controller[_0xd3b7('0xf')]);router['post']('/',auth[_0xd3b7('0x7')](),controller['create']);router[_0xd3b7('0x10')]('/:id',auth[_0xd3b7('0x7')](),controller[_0xd3b7('0x11')]);router[_0xd3b7('0x12')](_0xd3b7('0xa'),auth[_0xd3b7('0x7')](),controller[_0xd3b7('0x13')]);module[_0xd3b7('0x14')]=router; \ No newline at end of file +var _0xad95=['/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index'];(function(_0x1ae591,_0x2d22b3){var _0x121515=function(_0x2a4138){while(--_0x2a4138){_0x1ae591['push'](_0x1ae591['shift']());}};_0x121515(++_0x2d22b3);}(_0xad95,0x13f));var _0x5ad9=function(_0x202316,_0xdd936d){_0x202316=_0x202316-0x0;var _0x100e7f=_0xad95[_0x202316];return _0x100e7f;};'use strict';var multer=require(_0x5ad9('0x0'));var util=require(_0x5ad9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5ad9('0x2'));var router=express[_0x5ad9('0x3')]();var fs_extra=require(_0x5ad9('0x4'));var auth=require(_0x5ad9('0x5'));var interaction=require(_0x5ad9('0x6'));var config=require('../../config/environment');var controller=require(_0x5ad9('0x7'));router[_0x5ad9('0x8')]('/',auth[_0x5ad9('0x9')](),controller[_0x5ad9('0xa')]);router['get'](_0x5ad9('0xb'),auth['isAuthenticated'](),controller[_0x5ad9('0xc')]);router[_0x5ad9('0x8')](_0x5ad9('0xd'),auth[_0x5ad9('0x9')](),controller[_0x5ad9('0xe')]);router[_0x5ad9('0x8')]('/:id/subjects',auth[_0x5ad9('0x9')](),controller[_0x5ad9('0xf')]);router['get'](_0x5ad9('0x10'),auth[_0x5ad9('0x9')](),controller['getDescriptions']);router[_0x5ad9('0x11')]('/',auth[_0x5ad9('0x9')](),controller['create']);router[_0x5ad9('0x12')]('/:id',auth[_0x5ad9('0x9')](),controller[_0x5ad9('0x13')]);router[_0x5ad9('0x14')](_0x5ad9('0xb'),auth['isAuthenticated'](),controller[_0x5ad9('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 80e8b7e..0c88ed8 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 _0xee70=['sequelize','exports','STRING'];(function(_0x276d69,_0x46cc68){var _0x2cba84=function(_0x5b8b88){while(--_0x5b8b88){_0x276d69['push'](_0x276d69['shift']());}};_0x2cba84(++_0x46cc68);}(_0xee70,0x147));var _0x0ee7=function(_0x213c4f,_0x3ee423){_0x213c4f=_0x213c4f-0x0;var _0x170c8c=_0xee70[_0x213c4f];return _0x170c8c;};'use strict';var Sequelize=require(_0x0ee7('0x0'));module[_0x0ee7('0x1')]={'name':{'type':Sequelize[_0x0ee7('0x2')]},'description':{'type':Sequelize[_0x0ee7('0x2')]}}; \ No newline at end of file +var _0x0837=['exports','STRING','sequelize'];(function(_0x33cc54,_0xcdad5f){var _0x161454=function(_0x1dbf7d){while(--_0x1dbf7d){_0x33cc54['push'](_0x33cc54['shift']());}};_0x161454(++_0xcdad5f);}(_0x0837,0x164));var _0x7083=function(_0xe6db4f,_0x52c4a3){_0xe6db4f=_0xe6db4f-0x0;var _0xacb3b6=_0x0837[_0xe6db4f];return _0xacb3b6;};'use strict';var Sequelize=require(_0x7083('0x0'));module[_0x7083('0x1')]={'name':{'type':Sequelize[_0x7083('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 272c7f5..ce85f45 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 _0x8f86=['key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','options','find','create','body','catch','getFields','findOne','sort','nolimit','getSubjects','SugarcrmField','getDescriptions','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','destroy','then','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type'];(function(_0x1fb4a0,_0x48a602){var _0x1094e7=function(_0x25fcd5){while(--_0x25fcd5){_0x1fb4a0['push'](_0x1fb4a0['shift']());}};_0x1094e7(++_0x48a602);}(_0x8f86,0x15e));var _0x68f8=function(_0x8336c0,_0x1e1849){_0x8336c0=_0x8336c0-0x0;var _0xf9f58=_0x8f86[_0x8336c0];return _0xf9f58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68f8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x68f8('0x1'));var moment=require(_0x68f8('0x2'));var BPromise=require(_0x68f8('0x3'));var Mustache=require(_0x68f8('0x4'));var util=require(_0x68f8('0x5'));var path=require(_0x68f8('0x6'));var sox=require(_0x68f8('0x7'));var csv=require(_0x68f8('0x8'));var ejs=require(_0x68f8('0x9'));var fs=require('fs');var fs_extra=require(_0x68f8('0xa'));var _=require('lodash');var squel=require(_0x68f8('0xb'));var crypto=require(_0x68f8('0xc'));var jsforce=require(_0x68f8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x68f8('0x8'));var querystring=require(_0x68f8('0xe'));var Papa=require(_0x68f8('0xf'));var Redis=require('ioredis');var authService=require(_0x68f8('0x10'));var qs=require(_0x68f8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x68f8('0x12'))(_0x68f8('0x13'));var utils=require(_0x68f8('0x14'));var config=require(_0x68f8('0x15'));var licenseUtil=require(_0x68f8('0x16'));var db=require(_0x68f8('0x17'))['db'];function respondWithStatusCode(_0x56e75f,_0x534df6){_0x534df6=_0x534df6||0xcc;return function(_0x1ee84f){if(_0x1ee84f){return _0x56e75f[_0x68f8('0x18')](_0x534df6);}return _0x56e75f[_0x68f8('0x19')](_0x534df6)[_0x68f8('0x1a')]();};}function respondWithResult(_0x30e452,_0x431b48){_0x431b48=_0x431b48||0xc8;return function(_0x45c5f2){if(_0x45c5f2){return _0x30e452[_0x68f8('0x19')](_0x431b48)[_0x68f8('0x1b')](_0x45c5f2);}};}function respondWithFilteredResult(_0x4451fe,_0x4e94fd){return function(_0x506d28){if(_0x506d28){var _0x5a79a3=typeof _0x4e94fd[_0x68f8('0x1c')]===_0x68f8('0x1d')&&typeof _0x4e94fd[_0x68f8('0x1e')]===_0x68f8('0x1d');var _0x2d590f=_0x506d28[_0x68f8('0x1f')];var _0x53f885=_0x5a79a3?0x0:_0x4e94fd[_0x68f8('0x1c')];var _0x4df315=_0x5a79a3?_0x506d28[_0x68f8('0x1f')]:_0x4e94fd['offset']+_0x4e94fd[_0x68f8('0x1e')];var _0x2cb5c6;if(_0x4df315>=_0x2d590f){_0x4df315=_0x2d590f;_0x2cb5c6=0xc8;}else{_0x2cb5c6=0xce;}_0x4451fe[_0x68f8('0x19')](_0x2cb5c6);return _0x4451fe['set'](_0x68f8('0x20'),_0x53f885+'-'+_0x4df315+'/'+_0x2d590f)[_0x68f8('0x1b')](_0x506d28);}return null;};}function patchUpdates(_0x5d958a){return function(_0x1f82e7){try{jsonpatch[_0x68f8('0x21')](_0x1f82e7,_0x5d958a,!![]);}catch(_0x1d5158){return BPromise['reject'](_0x1d5158);}return _0x1f82e7[_0x68f8('0x22')]();};}function saveUpdates(_0x1e653f,_0x4a72d5){return function(_0x3db904){if(_0x3db904){return _0x3db904['update'](_0x1e653f)['then'](function(_0x66f919){return _0x66f919;});}return null;};}function removeEntity(_0x16f7e8,_0x4cde8b){return function(_0x26a401){if(_0x26a401){return _0x26a401[_0x68f8('0x23')]()[_0x68f8('0x24')](function(){_0x16f7e8['status'](0xcc)[_0x68f8('0x1a')]();});}};}function handleEntityNotFound(_0xbb06cd,_0x43faa5){return function(_0x3a6661){if(!_0x3a6661){_0xbb06cd['sendStatus'](0x194);}return _0x3a6661;};}function handleError(_0x2f78bc,_0xc1a4ff){_0xc1a4ff=_0xc1a4ff||0x1f4;return function(_0xb92c3c){logger['error'](_0xb92c3c[_0x68f8('0x25')]);if(_0xb92c3c[_0x68f8('0x26')]){delete _0xb92c3c[_0x68f8('0x26')];}_0x2f78bc[_0x68f8('0x19')](_0xc1a4ff)[_0x68f8('0x27')](_0xb92c3c);};}exports[_0x68f8('0x28')]=function(_0x3ce0dc,_0x35eccb){var _0xd86fb9={},_0x440cc9={},_0x494f41={'count':0x0,'rows':[]};var _0x3e6991=_[_0x68f8('0x29')](db[_0x68f8('0x2a')]['rawAttributes'],function(_0x2f047f){return{'name':_0x2f047f[_0x68f8('0x2b')],'type':_0x2f047f[_0x68f8('0x2c')][_0x68f8('0x2d')]};});_0x440cc9[_0x68f8('0x2e')]=_[_0x68f8('0x29')](_0x3e6991,_0x68f8('0x26'));_0x440cc9[_0x68f8('0x2f')]=_[_0x68f8('0x30')](_0x3ce0dc['query']);_0x440cc9[_0x68f8('0x31')]=_[_0x68f8('0x32')](_0x440cc9[_0x68f8('0x2e')],_0x440cc9['query']);_0xd86fb9['attributes']=_[_0x68f8('0x32')](_0x440cc9[_0x68f8('0x2e')],qs[_0x68f8('0x33')](_0x3ce0dc['query'][_0x68f8('0x33')]));_0xd86fb9[_0x68f8('0x34')]=_0xd86fb9['attributes'][_0x68f8('0x35')]?_0xd86fb9[_0x68f8('0x34')]:_0x440cc9[_0x68f8('0x2e')];if(!_0x3ce0dc[_0x68f8('0x2f')][_0x68f8('0x36')]('nolimit')){_0xd86fb9[_0x68f8('0x1e')]=qs[_0x68f8('0x1e')](_0x3ce0dc[_0x68f8('0x2f')][_0x68f8('0x1e')]);_0xd86fb9[_0x68f8('0x1c')]=qs[_0x68f8('0x1c')](_0x3ce0dc['query'][_0x68f8('0x1c')]);}_0xd86fb9[_0x68f8('0x37')]=qs['sort'](_0x3ce0dc['query']['sort']);_0xd86fb9[_0x68f8('0x38')]=qs['filters'](_[_0x68f8('0x39')](_0x3ce0dc[_0x68f8('0x2f')],_0x440cc9['filters']),_0x3e6991);if(_0x3ce0dc[_0x68f8('0x2f')][_0x68f8('0x3a')]){_0xd86fb9['where']=_[_0x68f8('0x3b')](_0xd86fb9[_0x68f8('0x38')],{'$or':_[_0x68f8('0x29')](_0x3e6991,function(_0x1f9bb7){if(_0x1f9bb7[_0x68f8('0x2c')]!==_0x68f8('0x3c')){var _0x21c4d6={};_0x21c4d6[_0x1f9bb7[_0x68f8('0x26')]]={'$like':'%'+_0x3ce0dc[_0x68f8('0x2f')][_0x68f8('0x3a')]+'%'};return _0x21c4d6;}})});}_0xd86fb9=_[_0x68f8('0x3b')]({},_0xd86fb9,_0x3ce0dc['options']);var _0x263a51={'where':_0xd86fb9[_0x68f8('0x38')]};return db[_0x68f8('0x2a')][_0x68f8('0x1f')](_0x263a51)[_0x68f8('0x24')](function(_0x243b87){_0x494f41[_0x68f8('0x1f')]=_0x243b87;if(_0x3ce0dc[_0x68f8('0x2f')][_0x68f8('0x3d')]){_0xd86fb9[_0x68f8('0x3e')]=[{'all':!![]}];}return db[_0x68f8('0x2a')]['findAll'](_0xd86fb9);})[_0x68f8('0x24')](function(_0x5729a0){_0x494f41[_0x68f8('0x3f')]=_0x5729a0;return _0x494f41;})[_0x68f8('0x24')](respondWithFilteredResult(_0x35eccb,_0xd86fb9))['catch'](handleError(_0x35eccb,null));};exports[_0x68f8('0x40')]=function(_0x1e4c26,_0x34765d){var _0x460c44={'raw':![],'where':{'id':_0x1e4c26[_0x68f8('0x41')]['id']}},_0xc91a6d={};_0xc91a6d[_0x68f8('0x2e')]=_[_0x68f8('0x30')](db[_0x68f8('0x2a')][_0x68f8('0x42')]);_0xc91a6d[_0x68f8('0x2f')]=_[_0x68f8('0x30')](_0x1e4c26[_0x68f8('0x2f')]);_0xc91a6d[_0x68f8('0x31')]=_[_0x68f8('0x32')](_0xc91a6d[_0x68f8('0x2e')],_0xc91a6d[_0x68f8('0x2f')]);_0x460c44['attributes']=_[_0x68f8('0x32')](_0xc91a6d[_0x68f8('0x2e')],qs['fields'](_0x1e4c26[_0x68f8('0x2f')]['fields']));_0x460c44[_0x68f8('0x34')]=_0x460c44['attributes']['length']?_0x460c44[_0x68f8('0x34')]:_0xc91a6d[_0x68f8('0x2e')];if(_0x1e4c26[_0x68f8('0x2f')][_0x68f8('0x3d')]){_0x460c44[_0x68f8('0x3e')]=[{'all':!![]}];}_0x460c44=_['merge']({},_0x460c44,_0x1e4c26[_0x68f8('0x43')]);return db[_0x68f8('0x2a')][_0x68f8('0x44')](_0x460c44)['then'](handleEntityNotFound(_0x34765d,null))[_0x68f8('0x24')](respondWithResult(_0x34765d,null))['catch'](handleError(_0x34765d,null));};exports[_0x68f8('0x45')]=function(_0x114e3f,_0x17587f){return db[_0x68f8('0x2a')][_0x68f8('0x45')](_0x114e3f[_0x68f8('0x46')],{})['then'](respondWithResult(_0x17587f,0xc9))[_0x68f8('0x47')](handleError(_0x17587f,null));};exports['update']=function(_0x19c10a,_0x2c7b50){if(_0x19c10a[_0x68f8('0x46')]['id']){delete _0x19c10a[_0x68f8('0x46')]['id'];}return db[_0x68f8('0x2a')][_0x68f8('0x44')]({'where':{'id':_0x19c10a[_0x68f8('0x41')]['id']}})[_0x68f8('0x24')](handleEntityNotFound(_0x2c7b50,null))[_0x68f8('0x24')](saveUpdates(_0x19c10a[_0x68f8('0x46')],null))[_0x68f8('0x24')](respondWithResult(_0x2c7b50,null))[_0x68f8('0x47')](handleError(_0x2c7b50,null));};exports[_0x68f8('0x23')]=function(_0x5f30c1,_0x4feb59){return db[_0x68f8('0x2a')][_0x68f8('0x44')]({'where':{'id':_0x5f30c1['params']['id']}})['then'](handleEntityNotFound(_0x4feb59,null))[_0x68f8('0x24')](removeEntity(_0x4feb59,null))[_0x68f8('0x47')](handleError(_0x4feb59,null));};exports[_0x68f8('0x48')]=function(_0x455de9,_0x38affd,_0x4f8380){var _0xd08d54={};var _0x49a5cb={};var _0xe87652;var _0x38ef45;return db[_0x68f8('0x2a')][_0x68f8('0x49')]({'where':{'id':_0x455de9[_0x68f8('0x41')]['id']}})[_0x68f8('0x24')](handleEntityNotFound(_0x38affd,null))[_0x68f8('0x24')](function(_0x35e7c3){if(_0x35e7c3){_0xe87652=_0x35e7c3;_0x49a5cb['model']=_[_0x68f8('0x30')](db['SugarcrmField'][_0x68f8('0x42')]);_0x49a5cb[_0x68f8('0x2f')]=_[_0x68f8('0x30')](_0x455de9[_0x68f8('0x2f')]);_0x49a5cb['filters']=_[_0x68f8('0x32')](_0x49a5cb['model'],_0x49a5cb[_0x68f8('0x2f')]);_0xd08d54[_0x68f8('0x34')]=_['intersection'](_0x49a5cb[_0x68f8('0x2e')],qs[_0x68f8('0x33')](_0x455de9[_0x68f8('0x2f')][_0x68f8('0x33')]));_0xd08d54[_0x68f8('0x34')]=_0xd08d54['attributes'][_0x68f8('0x35')]?_0xd08d54[_0x68f8('0x34')]:_0x49a5cb['model'];_0xd08d54['order']=qs[_0x68f8('0x4a')](_0x455de9[_0x68f8('0x2f')][_0x68f8('0x4a')]);_0xd08d54[_0x68f8('0x38')]=qs[_0x68f8('0x31')](_[_0x68f8('0x39')](_0x455de9['query'],_0x49a5cb[_0x68f8('0x31')]));if(_0x455de9[_0x68f8('0x2f')][_0x68f8('0x3a')]){_0xd08d54[_0x68f8('0x38')]=_[_0x68f8('0x3b')](_0xd08d54[_0x68f8('0x38')],{'$or':_['map'](_0xd08d54[_0x68f8('0x34')],function(_0x3a77ce){var _0x2659a1={};_0x2659a1[_0x3a77ce]={'$like':'%'+_0x455de9['query'][_0x68f8('0x3a')]+'%'};return _0x2659a1;})});}_0xd08d54=_['merge']({},_0xd08d54,_0x455de9[_0x68f8('0x43')]);return _0xe87652[_0x68f8('0x48')](_0xd08d54);}})[_0x68f8('0x24')](function(_0x216edb){if(_0x216edb){_0x38ef45=_0x216edb[_0x68f8('0x35')];if(!_0x455de9[_0x68f8('0x2f')][_0x68f8('0x36')](_0x68f8('0x4b'))){_0xd08d54[_0x68f8('0x1e')]=qs['limit'](_0x455de9[_0x68f8('0x2f')][_0x68f8('0x1e')]);_0xd08d54[_0x68f8('0x1c')]=qs[_0x68f8('0x1c')](_0x455de9[_0x68f8('0x2f')][_0x68f8('0x1c')]);}return _0xe87652[_0x68f8('0x48')](_0xd08d54);}})['then'](function(_0x5e38a2){if(_0x5e38a2){return _0x5e38a2?{'count':_0x38ef45,'rows':_0x5e38a2}:null;}})['then'](respondWithResult(_0x38affd,null))[_0x68f8('0x47')](handleError(_0x38affd,null));};exports[_0x68f8('0x4c')]=function(_0x55378f,_0x13bc6f,_0x37f49f){var _0x11bdb2={};var _0x1d606c={};var _0x33a128;var _0x253702;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x55378f[_0x68f8('0x41')]['id']}})[_0x68f8('0x24')](handleEntityNotFound(_0x13bc6f,null))[_0x68f8('0x24')](function(_0x41be92){if(_0x41be92){_0x33a128=_0x41be92;_0x1d606c[_0x68f8('0x2e')]=_['keys'](db[_0x68f8('0x4d')]['rawAttributes']);_0x1d606c[_0x68f8('0x2f')]=_[_0x68f8('0x30')](_0x55378f[_0x68f8('0x2f')]);_0x1d606c[_0x68f8('0x31')]=_[_0x68f8('0x32')](_0x1d606c[_0x68f8('0x2e')],_0x1d606c[_0x68f8('0x2f')]);_0x11bdb2[_0x68f8('0x34')]=_['intersection'](_0x1d606c[_0x68f8('0x2e')],qs[_0x68f8('0x33')](_0x55378f[_0x68f8('0x2f')][_0x68f8('0x33')]));_0x11bdb2['attributes']=_0x11bdb2['attributes']['length']?_0x11bdb2[_0x68f8('0x34')]:_0x1d606c[_0x68f8('0x2e')];_0x11bdb2['order']=qs['sort'](_0x55378f['query'][_0x68f8('0x4a')]);_0x11bdb2[_0x68f8('0x38')]=qs[_0x68f8('0x31')](_[_0x68f8('0x39')](_0x55378f[_0x68f8('0x2f')],_0x1d606c[_0x68f8('0x31')]));if(_0x55378f[_0x68f8('0x2f')][_0x68f8('0x3a')]){_0x11bdb2[_0x68f8('0x38')]=_[_0x68f8('0x3b')](_0x11bdb2[_0x68f8('0x38')],{'$or':_[_0x68f8('0x29')](_0x11bdb2[_0x68f8('0x34')],function(_0xa00161){var _0x1ffc64={};_0x1ffc64[_0xa00161]={'$like':'%'+_0x55378f[_0x68f8('0x2f')]['filter']+'%'};return _0x1ffc64;})});}_0x11bdb2=_[_0x68f8('0x3b')]({},_0x11bdb2,_0x55378f[_0x68f8('0x43')]);return _0x33a128[_0x68f8('0x4c')](_0x11bdb2);}})[_0x68f8('0x24')](function(_0x561243){if(_0x561243){_0x253702=_0x561243[_0x68f8('0x35')];if(!_0x55378f['query']['hasOwnProperty'](_0x68f8('0x4b'))){_0x11bdb2['limit']=qs['limit'](_0x55378f[_0x68f8('0x2f')][_0x68f8('0x1e')]);_0x11bdb2[_0x68f8('0x1c')]=qs['offset'](_0x55378f[_0x68f8('0x2f')][_0x68f8('0x1c')]);}return _0x33a128[_0x68f8('0x4c')](_0x11bdb2);}})[_0x68f8('0x24')](function(_0x415835){if(_0x415835){return _0x415835?{'count':_0x253702,'rows':_0x415835}:null;}})[_0x68f8('0x24')](respondWithResult(_0x13bc6f,null))[_0x68f8('0x47')](handleError(_0x13bc6f,null));};exports[_0x68f8('0x4e')]=function(_0x1608be,_0x2fe748,_0x17773d){var _0x38129f={};var _0x4090f4={};var _0x4ac823;var _0x1e8856;return db['SugarcrmConfiguration'][_0x68f8('0x49')]({'where':{'id':_0x1608be['params']['id']}})['then'](handleEntityNotFound(_0x2fe748,null))[_0x68f8('0x24')](function(_0x389d53){if(_0x389d53){_0x4ac823=_0x389d53;_0x4090f4[_0x68f8('0x2e')]=_[_0x68f8('0x30')](db['SugarcrmField'][_0x68f8('0x42')]);_0x4090f4[_0x68f8('0x2f')]=_[_0x68f8('0x30')](_0x1608be[_0x68f8('0x2f')]);_0x4090f4[_0x68f8('0x31')]=_['intersection'](_0x4090f4[_0x68f8('0x2e')],_0x4090f4['query']);_0x38129f[_0x68f8('0x34')]=_[_0x68f8('0x32')](_0x4090f4[_0x68f8('0x2e')],qs[_0x68f8('0x33')](_0x1608be[_0x68f8('0x2f')][_0x68f8('0x33')]));_0x38129f[_0x68f8('0x34')]=_0x38129f['attributes'][_0x68f8('0x35')]?_0x38129f[_0x68f8('0x34')]:_0x4090f4['model'];_0x38129f[_0x68f8('0x37')]=qs[_0x68f8('0x4a')](_0x1608be[_0x68f8('0x2f')][_0x68f8('0x4a')]);_0x38129f[_0x68f8('0x38')]=qs['filters'](_[_0x68f8('0x39')](_0x1608be[_0x68f8('0x2f')],_0x4090f4[_0x68f8('0x31')]));if(_0x1608be[_0x68f8('0x2f')][_0x68f8('0x3a')]){_0x38129f[_0x68f8('0x38')]=_[_0x68f8('0x3b')](_0x38129f['where'],{'$or':_['map'](_0x38129f[_0x68f8('0x34')],function(_0x4618ac){var _0xfdaf7={};_0xfdaf7[_0x4618ac]={'$like':'%'+_0x1608be[_0x68f8('0x2f')][_0x68f8('0x3a')]+'%'};return _0xfdaf7;})});}_0x38129f=_[_0x68f8('0x3b')]({},_0x38129f,_0x1608be[_0x68f8('0x43')]);return _0x4ac823['getDescriptions'](_0x38129f);}})[_0x68f8('0x24')](function(_0x1798c4){if(_0x1798c4){_0x1e8856=_0x1798c4[_0x68f8('0x35')];if(!_0x1608be[_0x68f8('0x2f')][_0x68f8('0x36')]('nolimit')){_0x38129f[_0x68f8('0x1e')]=qs[_0x68f8('0x1e')](_0x1608be[_0x68f8('0x2f')][_0x68f8('0x1e')]);_0x38129f['offset']=qs['offset'](_0x1608be[_0x68f8('0x2f')]['offset']);}return _0x4ac823[_0x68f8('0x4e')](_0x38129f);}})[_0x68f8('0x24')](function(_0x46d7d7){if(_0x46d7d7){return _0x46d7d7?{'count':_0x1e8856,'rows':_0x46d7d7}:null;}})[_0x68f8('0x24')](respondWithResult(_0x2fe748,null))[_0x68f8('0x47')](handleError(_0x2fe748,null));}; \ No newline at end of file +var _0xfeda=['intersection','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','VIRTUAL','findAll','rows','catch','params','keys','rawAttributes','fields','length','include','options','find','create','body','destroy','findOne','SugarcrmField','getFields','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','apply','reject','update','then','error','name','index','SugarcrmConfiguration','fieldName','type','key','model','query','filters'];(function(_0x2ea357,_0x416216){var _0x48047b=function(_0xe2a590){while(--_0xe2a590){_0x2ea357['push'](_0x2ea357['shift']());}};_0x48047b(++_0x416216);}(_0xfeda,0xb9));var _0xafed=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xfeda[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafed('0x0'));var zipdir=require(_0xafed('0x1'));var jsonpatch=require(_0xafed('0x2'));var rp=require('request-promise');var moment=require(_0xafed('0x3'));var BPromise=require(_0xafed('0x4'));var Mustache=require('mustache');var util=require(_0xafed('0x5'));var path=require('path');var sox=require(_0xafed('0x6'));var csv=require(_0xafed('0x7'));var ejs=require(_0xafed('0x8'));var fs=require('fs');var fs_extra=require(_0xafed('0x9'));var _=require(_0xafed('0xa'));var squel=require(_0xafed('0xb'));var crypto=require('crypto');var jsforce=require(_0xafed('0xc'));var deskjs=require(_0xafed('0xd'));var toCsv=require(_0xafed('0x7'));var querystring=require(_0xafed('0xe'));var Papa=require('papaparse');var Redis=require(_0xafed('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xafed('0x10'));var as=require(_0xafed('0x11'));var hardwareService=require(_0xafed('0x12'));var logger=require(_0xafed('0x13'))(_0xafed('0x14'));var utils=require('../../config/utils');var config=require(_0xafed('0x15'));var licenseUtil=require(_0xafed('0x16'));var db=require(_0xafed('0x17'))['db'];function respondWithStatusCode(_0xab7b7d,_0x439fea){_0x439fea=_0x439fea||0xcc;return function(_0x72804a){if(_0x72804a){return _0xab7b7d[_0xafed('0x18')](_0x439fea);}return _0xab7b7d[_0xafed('0x19')](_0x439fea)[_0xafed('0x1a')]();};}function respondWithResult(_0x3fb258,_0x5f0c3f){_0x5f0c3f=_0x5f0c3f||0xc8;return function(_0x2397db){if(_0x2397db){return _0x3fb258[_0xafed('0x19')](_0x5f0c3f)[_0xafed('0x1b')](_0x2397db);}};}function respondWithFilteredResult(_0x545e29,_0x1eab75){return function(_0x2ea9aa){if(_0x2ea9aa){var _0xd53a2=typeof _0x1eab75['offset']==='undefined'&&typeof _0x1eab75[_0xafed('0x1c')]===_0xafed('0x1d');var _0x1b81b7=_0x2ea9aa[_0xafed('0x1e')];var _0x51bd7d=_0xd53a2?0x0:_0x1eab75[_0xafed('0x1f')];var _0x18af97=_0xd53a2?_0x2ea9aa[_0xafed('0x1e')]:_0x1eab75['offset']+_0x1eab75[_0xafed('0x1c')];var _0x2c430c;if(_0x18af97>=_0x1b81b7){_0x18af97=_0x1b81b7;_0x2c430c=0xc8;}else{_0x2c430c=0xce;}_0x545e29['status'](_0x2c430c);return _0x545e29['set']('Content-Range',_0x51bd7d+'-'+_0x18af97+'/'+_0x1b81b7)[_0xafed('0x1b')](_0x2ea9aa);}return null;};}function patchUpdates(_0x20a45e){return function(_0x39f5a0){try{jsonpatch[_0xafed('0x20')](_0x39f5a0,_0x20a45e,!![]);}catch(_0x3f8c60){return BPromise[_0xafed('0x21')](_0x3f8c60);}return _0x39f5a0['save']();};}function saveUpdates(_0x45b003,_0x2b2e0a){return function(_0x499b71){if(_0x499b71){return _0x499b71[_0xafed('0x22')](_0x45b003)[_0xafed('0x23')](function(_0x24a0da){return _0x24a0da;});}return null;};}function removeEntity(_0x339d8b,_0x2c618d){return function(_0x115592){if(_0x115592){return _0x115592['destroy']()[_0xafed('0x23')](function(){_0x339d8b[_0xafed('0x19')](0xcc)[_0xafed('0x1a')]();});}};}function handleEntityNotFound(_0x353cac,_0x54779a){return function(_0x1eb043){if(!_0x1eb043){_0x353cac[_0xafed('0x18')](0x194);}return _0x1eb043;};}function handleError(_0x4a803b,_0x55f0e7){_0x55f0e7=_0x55f0e7||0x1f4;return function(_0x240e9d){logger[_0xafed('0x24')](_0x240e9d['stack']);if(_0x240e9d['name']){delete _0x240e9d[_0xafed('0x25')];}_0x4a803b[_0xafed('0x19')](_0x55f0e7)['send'](_0x240e9d);};}exports[_0xafed('0x26')]=function(_0xdf4426,_0x3e0569){var _0x5aea34={},_0x1c9d68={},_0x338b06={'count':0x0,'rows':[]};var _0x47a321=_['map'](db[_0xafed('0x27')]['rawAttributes'],function(_0x38c8b9){return{'name':_0x38c8b9[_0xafed('0x28')],'type':_0x38c8b9[_0xafed('0x29')][_0xafed('0x2a')]};});_0x1c9d68[_0xafed('0x2b')]=_['map'](_0x47a321,_0xafed('0x25'));_0x1c9d68[_0xafed('0x2c')]=_['keys'](_0xdf4426[_0xafed('0x2c')]);_0x1c9d68[_0xafed('0x2d')]=_[_0xafed('0x2e')](_0x1c9d68[_0xafed('0x2b')],_0x1c9d68['query']);_0x5aea34[_0xafed('0x2f')]=_[_0xafed('0x2e')](_0x1c9d68[_0xafed('0x2b')],qs['fields'](_0xdf4426[_0xafed('0x2c')]['fields']));_0x5aea34['attributes']=_0x5aea34[_0xafed('0x2f')]['length']?_0x5aea34[_0xafed('0x2f')]:_0x1c9d68[_0xafed('0x2b')];if(!_0xdf4426[_0xafed('0x2c')][_0xafed('0x30')]('nolimit')){_0x5aea34[_0xafed('0x1c')]=qs[_0xafed('0x1c')](_0xdf4426[_0xafed('0x2c')][_0xafed('0x1c')]);_0x5aea34[_0xafed('0x1f')]=qs[_0xafed('0x1f')](_0xdf4426[_0xafed('0x2c')][_0xafed('0x1f')]);}_0x5aea34[_0xafed('0x31')]=qs[_0xafed('0x32')](_0xdf4426[_0xafed('0x2c')][_0xafed('0x32')]);_0x5aea34[_0xafed('0x33')]=qs[_0xafed('0x2d')](_[_0xafed('0x34')](_0xdf4426[_0xafed('0x2c')],_0x1c9d68[_0xafed('0x2d')]),_0x47a321);if(_0xdf4426[_0xafed('0x2c')][_0xafed('0x35')]){_0x5aea34[_0xafed('0x33')]=_[_0xafed('0x36')](_0x5aea34[_0xafed('0x33')],{'$or':_[_0xafed('0x37')](_0x47a321,function(_0x2d7a53){if(_0x2d7a53[_0xafed('0x29')]!==_0xafed('0x38')){var _0x3c11ea={};_0x3c11ea[_0x2d7a53[_0xafed('0x25')]]={'$like':'%'+_0xdf4426[_0xafed('0x2c')]['filter']+'%'};return _0x3c11ea;}})});}_0x5aea34=_['merge']({},_0x5aea34,_0xdf4426['options']);var _0x588f8f={'where':_0x5aea34[_0xafed('0x33')]};return db[_0xafed('0x27')][_0xafed('0x1e')](_0x588f8f)['then'](function(_0x33034f){_0x338b06[_0xafed('0x1e')]=_0x33034f;if(_0xdf4426[_0xafed('0x2c')]['includeAll']){_0x5aea34['include']=[{'all':!![]}];}return db[_0xafed('0x27')][_0xafed('0x39')](_0x5aea34);})['then'](function(_0x1707c8){_0x338b06[_0xafed('0x3a')]=_0x1707c8;return _0x338b06;})[_0xafed('0x23')](respondWithFilteredResult(_0x3e0569,_0x5aea34))[_0xafed('0x3b')](handleError(_0x3e0569,null));};exports['show']=function(_0x3efb94,_0x1a83aa){var _0x2d32c8={'raw':![],'where':{'id':_0x3efb94[_0xafed('0x3c')]['id']}},_0x29200b={};_0x29200b[_0xafed('0x2b')]=_[_0xafed('0x3d')](db[_0xafed('0x27')][_0xafed('0x3e')]);_0x29200b['query']=_[_0xafed('0x3d')](_0x3efb94[_0xafed('0x2c')]);_0x29200b[_0xafed('0x2d')]=_[_0xafed('0x2e')](_0x29200b[_0xafed('0x2b')],_0x29200b['query']);_0x2d32c8[_0xafed('0x2f')]=_[_0xafed('0x2e')](_0x29200b[_0xafed('0x2b')],qs[_0xafed('0x3f')](_0x3efb94[_0xafed('0x2c')][_0xafed('0x3f')]));_0x2d32c8[_0xafed('0x2f')]=_0x2d32c8[_0xafed('0x2f')][_0xafed('0x40')]?_0x2d32c8[_0xafed('0x2f')]:_0x29200b[_0xafed('0x2b')];if(_0x3efb94[_0xafed('0x2c')]['includeAll']){_0x2d32c8[_0xafed('0x41')]=[{'all':!![]}];}_0x2d32c8=_[_0xafed('0x36')]({},_0x2d32c8,_0x3efb94[_0xafed('0x42')]);return db['SugarcrmConfiguration'][_0xafed('0x43')](_0x2d32c8)[_0xafed('0x23')](handleEntityNotFound(_0x1a83aa,null))[_0xafed('0x23')](respondWithResult(_0x1a83aa,null))[_0xafed('0x3b')](handleError(_0x1a83aa,null));};exports['create']=function(_0x2ac2c9,_0x14e144){return db[_0xafed('0x27')][_0xafed('0x44')](_0x2ac2c9[_0xafed('0x45')],{})['then'](respondWithResult(_0x14e144,0xc9))[_0xafed('0x3b')](handleError(_0x14e144,null));};exports[_0xafed('0x22')]=function(_0x37ed08,_0x2723be){if(_0x37ed08[_0xafed('0x45')]['id']){delete _0x37ed08[_0xafed('0x45')]['id'];}return db[_0xafed('0x27')][_0xafed('0x43')]({'where':{'id':_0x37ed08[_0xafed('0x3c')]['id']}})[_0xafed('0x23')](handleEntityNotFound(_0x2723be,null))['then'](saveUpdates(_0x37ed08[_0xafed('0x45')],null))[_0xafed('0x23')](respondWithResult(_0x2723be,null))['catch'](handleError(_0x2723be,null));};exports[_0xafed('0x46')]=function(_0x33077f,_0x8181d9){return db[_0xafed('0x27')]['find']({'where':{'id':_0x33077f['params']['id']}})[_0xafed('0x23')](handleEntityNotFound(_0x8181d9,null))[_0xafed('0x23')](removeEntity(_0x8181d9,null))[_0xafed('0x3b')](handleError(_0x8181d9,null));};exports['getFields']=function(_0x12df43,_0x3308a3,_0x5d9a3a){var _0x85869c={};var _0x255b68={};var _0x3df2c5;var _0x184dac;return db[_0xafed('0x27')][_0xafed('0x47')]({'where':{'id':_0x12df43[_0xafed('0x3c')]['id']}})[_0xafed('0x23')](handleEntityNotFound(_0x3308a3,null))[_0xafed('0x23')](function(_0x111acf){if(_0x111acf){_0x3df2c5=_0x111acf;_0x255b68['model']=_[_0xafed('0x3d')](db[_0xafed('0x48')][_0xafed('0x3e')]);_0x255b68['query']=_[_0xafed('0x3d')](_0x12df43[_0xafed('0x2c')]);_0x255b68[_0xafed('0x2d')]=_[_0xafed('0x2e')](_0x255b68['model'],_0x255b68['query']);_0x85869c[_0xafed('0x2f')]=_[_0xafed('0x2e')](_0x255b68[_0xafed('0x2b')],qs['fields'](_0x12df43['query'][_0xafed('0x3f')]));_0x85869c['attributes']=_0x85869c[_0xafed('0x2f')][_0xafed('0x40')]?_0x85869c[_0xafed('0x2f')]:_0x255b68['model'];_0x85869c[_0xafed('0x31')]=qs['sort'](_0x12df43[_0xafed('0x2c')][_0xafed('0x32')]);_0x85869c['where']=qs[_0xafed('0x2d')](_['pick'](_0x12df43[_0xafed('0x2c')],_0x255b68['filters']));if(_0x12df43[_0xafed('0x2c')][_0xafed('0x35')]){_0x85869c['where']=_[_0xafed('0x36')](_0x85869c[_0xafed('0x33')],{'$or':_[_0xafed('0x37')](_0x85869c[_0xafed('0x2f')],function(_0x1d553c){var _0x6288bf={};_0x6288bf[_0x1d553c]={'$like':'%'+_0x12df43[_0xafed('0x2c')][_0xafed('0x35')]+'%'};return _0x6288bf;})});}_0x85869c=_[_0xafed('0x36')]({},_0x85869c,_0x12df43['options']);return _0x3df2c5[_0xafed('0x49')](_0x85869c);}})[_0xafed('0x23')](function(_0x3166b9){if(_0x3166b9){_0x184dac=_0x3166b9[_0xafed('0x40')];if(!_0x12df43[_0xafed('0x2c')][_0xafed('0x30')](_0xafed('0x4a'))){_0x85869c['limit']=qs[_0xafed('0x1c')](_0x12df43[_0xafed('0x2c')][_0xafed('0x1c')]);_0x85869c[_0xafed('0x1f')]=qs[_0xafed('0x1f')](_0x12df43[_0xafed('0x2c')]['offset']);}return _0x3df2c5[_0xafed('0x49')](_0x85869c);}})['then'](function(_0x4ddb6d){if(_0x4ddb6d){return _0x4ddb6d?{'count':_0x184dac,'rows':_0x4ddb6d}:null;}})[_0xafed('0x23')](respondWithResult(_0x3308a3,null))[_0xafed('0x3b')](handleError(_0x3308a3,null));};exports[_0xafed('0x4b')]=function(_0x11a2d1,_0x2ddb42,_0x26fdd1){var _0x1c60ec={};var _0x10ff06={};var _0x41a5bc;var _0x23ac72;return db[_0xafed('0x27')][_0xafed('0x47')]({'where':{'id':_0x11a2d1[_0xafed('0x3c')]['id']}})[_0xafed('0x23')](handleEntityNotFound(_0x2ddb42,null))['then'](function(_0x20cb71){if(_0x20cb71){_0x41a5bc=_0x20cb71;_0x10ff06[_0xafed('0x2b')]=_[_0xafed('0x3d')](db[_0xafed('0x48')][_0xafed('0x3e')]);_0x10ff06[_0xafed('0x2c')]=_[_0xafed('0x3d')](_0x11a2d1[_0xafed('0x2c')]);_0x10ff06[_0xafed('0x2d')]=_[_0xafed('0x2e')](_0x10ff06[_0xafed('0x2b')],_0x10ff06[_0xafed('0x2c')]);_0x1c60ec[_0xafed('0x2f')]=_['intersection'](_0x10ff06[_0xafed('0x2b')],qs[_0xafed('0x3f')](_0x11a2d1[_0xafed('0x2c')][_0xafed('0x3f')]));_0x1c60ec[_0xafed('0x2f')]=_0x1c60ec[_0xafed('0x2f')][_0xafed('0x40')]?_0x1c60ec[_0xafed('0x2f')]:_0x10ff06['model'];_0x1c60ec[_0xafed('0x31')]=qs[_0xafed('0x32')](_0x11a2d1['query']['sort']);_0x1c60ec[_0xafed('0x33')]=qs[_0xafed('0x2d')](_[_0xafed('0x34')](_0x11a2d1['query'],_0x10ff06[_0xafed('0x2d')]));if(_0x11a2d1['query']['filter']){_0x1c60ec['where']=_[_0xafed('0x36')](_0x1c60ec['where'],{'$or':_[_0xafed('0x37')](_0x1c60ec[_0xafed('0x2f')],function(_0x2fcea5){var _0x3fe015={};_0x3fe015[_0x2fcea5]={'$like':'%'+_0x11a2d1[_0xafed('0x2c')][_0xafed('0x35')]+'%'};return _0x3fe015;})});}_0x1c60ec=_[_0xafed('0x36')]({},_0x1c60ec,_0x11a2d1[_0xafed('0x42')]);return _0x41a5bc['getSubjects'](_0x1c60ec);}})['then'](function(_0x5bc2c0){if(_0x5bc2c0){_0x23ac72=_0x5bc2c0[_0xafed('0x40')];if(!_0x11a2d1['query']['hasOwnProperty'](_0xafed('0x4a'))){_0x1c60ec[_0xafed('0x1c')]=qs[_0xafed('0x1c')](_0x11a2d1[_0xafed('0x2c')][_0xafed('0x1c')]);_0x1c60ec['offset']=qs['offset'](_0x11a2d1[_0xafed('0x2c')]['offset']);}return _0x41a5bc[_0xafed('0x4b')](_0x1c60ec);}})[_0xafed('0x23')](function(_0x262055){if(_0x262055){return _0x262055?{'count':_0x23ac72,'rows':_0x262055}:null;}})[_0xafed('0x23')](respondWithResult(_0x2ddb42,null))[_0xafed('0x3b')](handleError(_0x2ddb42,null));};exports['getDescriptions']=function(_0x17f415,_0x22378f,_0x3ecd7d){var _0x3c0bea={};var _0xabb71d={};var _0x57e4fa;var _0x242dbf;return db[_0xafed('0x27')][_0xafed('0x47')]({'where':{'id':_0x17f415[_0xafed('0x3c')]['id']}})[_0xafed('0x23')](handleEntityNotFound(_0x22378f,null))[_0xafed('0x23')](function(_0x71bce9){if(_0x71bce9){_0x57e4fa=_0x71bce9;_0xabb71d['model']=_[_0xafed('0x3d')](db['SugarcrmField'][_0xafed('0x3e')]);_0xabb71d[_0xafed('0x2c')]=_[_0xafed('0x3d')](_0x17f415['query']);_0xabb71d[_0xafed('0x2d')]=_[_0xafed('0x2e')](_0xabb71d[_0xafed('0x2b')],_0xabb71d[_0xafed('0x2c')]);_0x3c0bea[_0xafed('0x2f')]=_[_0xafed('0x2e')](_0xabb71d[_0xafed('0x2b')],qs[_0xafed('0x3f')](_0x17f415['query'][_0xafed('0x3f')]));_0x3c0bea[_0xafed('0x2f')]=_0x3c0bea[_0xafed('0x2f')][_0xafed('0x40')]?_0x3c0bea['attributes']:_0xabb71d[_0xafed('0x2b')];_0x3c0bea[_0xafed('0x31')]=qs['sort'](_0x17f415[_0xafed('0x2c')]['sort']);_0x3c0bea[_0xafed('0x33')]=qs[_0xafed('0x2d')](_['pick'](_0x17f415[_0xafed('0x2c')],_0xabb71d[_0xafed('0x2d')]));if(_0x17f415[_0xafed('0x2c')][_0xafed('0x35')]){_0x3c0bea['where']=_['merge'](_0x3c0bea['where'],{'$or':_[_0xafed('0x37')](_0x3c0bea[_0xafed('0x2f')],function(_0x1adfdd){var _0x28377d={};_0x28377d[_0x1adfdd]={'$like':'%'+_0x17f415[_0xafed('0x2c')][_0xafed('0x35')]+'%'};return _0x28377d;})});}_0x3c0bea=_[_0xafed('0x36')]({},_0x3c0bea,_0x17f415[_0xafed('0x42')]);return _0x57e4fa[_0xafed('0x4c')](_0x3c0bea);}})[_0xafed('0x23')](function(_0x3c6a78){if(_0x3c6a78){_0x242dbf=_0x3c6a78['length'];if(!_0x17f415[_0xafed('0x2c')][_0xafed('0x30')](_0xafed('0x4a'))){_0x3c0bea[_0xafed('0x1c')]=qs[_0xafed('0x1c')](_0x17f415['query'][_0xafed('0x1c')]);_0x3c0bea[_0xafed('0x1f')]=qs[_0xafed('0x1f')](_0x17f415[_0xafed('0x2c')][_0xafed('0x1f')]);}return _0x57e4fa[_0xafed('0x4c')](_0x3c0bea);}})[_0xafed('0x23')](function(_0x41c8b0){if(_0x41c8b0){return _0x41c8b0?{'count':_0x242dbf,'rows':_0x41c8b0}:null;}})[_0xafed('0x23')](respondWithResult(_0x22378f,null))[_0xafed('0x3b')](handleError(_0x22378f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index fa42709..d66ccc3 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 _0xde10=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x580298,_0x496a88){var _0x255e7c=function(_0x4d28f0){while(--_0x4d28f0){_0x580298['push'](_0x580298['shift']());}};_0x255e7c(++_0x496a88);}(_0xde10,0x1e6));var _0x0de1=function(_0x4a674e,_0x5ca1d1){_0x4a674e=_0x4a674e-0x0;var _0x4a053a=_0xde10[_0x4a674e];return _0x4a053a;};'use strict';var _=require(_0x0de1('0x0'));var util=require(_0x0de1('0x1'));var logger=require(_0x0de1('0x2'))(_0x0de1('0x3'));var moment=require(_0x0de1('0x4'));var BPromise=require(_0x0de1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0de1('0x6'));var rimraf=require('rimraf');var config=require(_0x0de1('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x0de1('0x8')]=function(_0x18d4fd,_0x3c5fd2){return _0x18d4fd['define'](_0x0de1('0x9'),attributes,{'tableName':_0x0de1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa64c=['api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','../../config/logger'];(function(_0x5568ed,_0x61f3be){var _0x406c98=function(_0x3cc9a7){while(--_0x3cc9a7){_0x5568ed['push'](_0x5568ed['shift']());}};_0x406c98(++_0x61f3be);}(_0xa64c,0x1b7));var _0xca64=function(_0x3afc4b,_0x5273e3){_0x3afc4b=_0x3afc4b-0x0;var _0x36a6f8=_0xa64c[_0x3afc4b];return _0x36a6f8;};'use strict';var _=require(_0xca64('0x0'));var util=require(_0xca64('0x1'));var logger=require(_0xca64('0x2'))(_0xca64('0x3'));var moment=require(_0xca64('0x4'));var BPromise=require(_0xca64('0x5'));var rp=require(_0xca64('0x6'));var fs=require('fs');var path=require(_0xca64('0x7'));var rimraf=require(_0xca64('0x8'));var config=require('../../config/environment');var attributes=require(_0xca64('0x9'));module[_0xca64('0xa')]=function(_0x59f0e3,_0x3a4af1){return _0x59f0e3[_0xca64('0xb')](_0xca64('0xc'),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 0e63033..f128f4e 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 _0x991b=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x1658b8,_0x5adaad){var _0x28ef78=function(_0x48962f){while(--_0x48962f){_0x1658b8['push'](_0x1658b8['shift']());}};_0x28ef78(++_0x5adaad);}(_0x991b,0xe5));var _0xb991=function(_0x8b8e5d,_0x38b092){_0x8b8e5d=_0x8b8e5d-0x0;var _0x172372=_0x991b[_0x8b8e5d];return _0x172372;};'use strict';var _=require(_0xb991('0x0'));var util=require(_0xb991('0x1'));var moment=require('moment');var BPromise=require(_0xb991('0x2'));var rs=require(_0xb991('0x3'));var fs=require('fs');var Redis=require(_0xb991('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb991('0x5'));var logger=require(_0xb991('0x6'))(_0xb991('0x7'));var config=require(_0xb991('0x8'));var jayson=require(_0xb991('0x9'));var client=jayson[_0xb991('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfa1b03,_0x363479,_0x28c045){return new BPromise(function(_0x220590,_0x3b58fc){return client['request'](_0xfa1b03,_0x28c045)[_0xb991('0xb')](function(_0x4ac873){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x363479,_0xb991('0xc'));logger[_0xb991('0xd')](_0xb991('0xe'),_0x363479,'request\x20sent',JSON[_0xb991('0xf')](_0x4ac873));if(_0x4ac873[_0xb991('0x10')]){if(_0x4ac873[_0xb991('0x10')][_0xb991('0x11')]===0x1f4){logger[_0xb991('0x10')](_0xb991('0x12'),_0x363479,_0x4ac873[_0xb991('0x10')][_0xb991('0x13')]);return _0x3b58fc(_0x4ac873['error'][_0xb991('0x13')]);}logger[_0xb991('0x10')](_0xb991('0x12'),_0x363479,_0x4ac873['error'][_0xb991('0x13')]);return _0x220590(_0x4ac873[_0xb991('0x10')][_0xb991('0x13')]);}else{logger[_0xb991('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x363479,_0xb991('0xc'));_0x220590(_0x4ac873[_0xb991('0x15')][_0xb991('0x13')]);}})[_0xb991('0x16')](function(_0x1cd09e){logger[_0xb991('0x10')](_0xb991('0x12'),_0x363479,_0x1cd09e);_0x3b58fc(_0x1cd09e);});});} \ No newline at end of file +var _0xa505=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http','request','then','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x641945,_0x4ce559){var _0x50293e=function(_0xf3bacb){while(--_0xf3bacb){_0x641945['push'](_0x641945['shift']());}};_0x50293e(++_0x4ce559);}(_0xa505,0x160));var _0x5a50=function(_0x2de8b1,_0x298297){_0x2de8b1=_0x2de8b1-0x0;var _0x42b240=_0xa505[_0x2de8b1];return _0x42b240;};'use strict';var _=require(_0x5a50('0x0'));var util=require(_0x5a50('0x1'));var moment=require(_0x5a50('0x2'));var BPromise=require(_0x5a50('0x3'));var rs=require(_0x5a50('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a50('0x5'))['db'];var utils=require(_0x5a50('0x6'));var logger=require('../../config/logger')(_0x5a50('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a50('0x8')][_0x5a50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x63b1f4,_0x32e4b1,_0x34e5db){return new BPromise(function(_0x402ff9,_0x49d663){return client[_0x5a50('0xa')](_0x63b1f4,_0x34e5db)[_0x5a50('0xb')](function(_0x42c050){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x32e4b1,_0x5a50('0xc'));logger[_0x5a50('0xd')](_0x5a50('0xe'),_0x32e4b1,_0x5a50('0xc'),JSON[_0x5a50('0xf')](_0x42c050));if(_0x42c050[_0x5a50('0x10')]){if(_0x42c050[_0x5a50('0x10')][_0x5a50('0x11')]===0x1f4){logger[_0x5a50('0x10')](_0x5a50('0x12'),_0x32e4b1,_0x42c050[_0x5a50('0x10')][_0x5a50('0x13')]);return _0x49d663(_0x42c050['error'][_0x5a50('0x13')]);}logger['error'](_0x5a50('0x12'),_0x32e4b1,_0x42c050[_0x5a50('0x10')][_0x5a50('0x13')]);return _0x402ff9(_0x42c050[_0x5a50('0x10')][_0x5a50('0x13')]);}else{logger['info'](_0x5a50('0x12'),_0x32e4b1,_0x5a50('0xc'));_0x402ff9(_0x42c050[_0x5a50('0x14')][_0x5a50('0x13')]);}})[_0x5a50('0x15')](function(_0x390674){logger[_0x5a50('0x10')](_0x5a50('0x12'),_0x32e4b1,_0x390674);_0x49d663(_0x390674);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index dc84187..0a1ef97 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 _0xfeec=['Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x3fadaa,_0x5a6195){var _0x57df92=function(_0x29ee17){while(--_0x29ee17){_0x3fadaa['push'](_0x3fadaa['shift']());}};_0x57df92(++_0x5a6195);}(_0xfeec,0xf8));var _0xcfee=function(_0x41dc1c,_0x266e38){_0x41dc1c=_0x41dc1c-0x0;var _0x13d1e2=_0xfeec[_0x41dc1c];return _0x13d1e2;};'use strict';var multer=require(_0xcfee('0x0'));var util=require(_0xcfee('0x1'));var path=require(_0xcfee('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfee('0x3'));var router=express[_0xcfee('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcfee('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcfee('0x6'));var controller=require(_0xcfee('0x7'));router['get']('/',auth[_0xcfee('0x8')](),controller[_0xcfee('0x9')]);router['get'](_0xcfee('0xa'),auth[_0xcfee('0x8')](),controller[_0xcfee('0xb')]);router[_0xcfee('0xc')]('/',auth[_0xcfee('0x8')](),controller['create']);router[_0xcfee('0xd')](_0xcfee('0xa'),auth[_0xcfee('0x8')](),controller[_0xcfee('0xe')]);router[_0xcfee('0xf')](_0xcfee('0xa'),auth[_0xcfee('0x8')](),controller[_0xcfee('0x10')]);module[_0xcfee('0x11')]=router; \ No newline at end of file +var _0xfadd=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x2fbb3f,_0x4a357e){var _0x3d01b8=function(_0x2cbac6){while(--_0x2cbac6){_0x2fbb3f['push'](_0x2fbb3f['shift']());}};_0x3d01b8(++_0x4a357e);}(_0xfadd,0x19b));var _0xdfad=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfadd[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xdfad('0x0'));var util=require('util');var path=require(_0xdfad('0x1'));var timeout=require(_0xdfad('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xdfad('0x3'));var interaction=require(_0xdfad('0x4'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0xdfad('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdfad('0x5')](_0xdfad('0x6'),auth[_0xdfad('0x7')](),controller[_0xdfad('0x8')]);router[_0xdfad('0x9')]('/',auth['isAuthenticated'](),controller[_0xdfad('0xa')]);router[_0xdfad('0xb')]('/:id',auth[_0xdfad('0x7')](),controller[_0xdfad('0xc')]);router[_0xdfad('0xd')](_0xdfad('0x6'),auth[_0xdfad('0x7')](),controller[_0xdfad('0xe')]);module[_0xdfad('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 7fdb9c3..9cc0f5c 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 _0xce79=['customVariable','picklist','STRING','exports','ENUM','string','variable'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xce79,0x106));var _0x9ce7=function(_0x4b9dc9,_0x14b3a2){_0x4b9dc9=_0x4b9dc9-0x0;var _0x57b302=_0xce79[_0x4b9dc9];return _0x57b302;};'use strict';var Sequelize=require('sequelize');module[_0x9ce7('0x0')]={'type':{'type':Sequelize[_0x9ce7('0x1')](_0x9ce7('0x2'),_0x9ce7('0x3'),_0x9ce7('0x4'),'keyValue',_0x9ce7('0x5')),'defaultValue':_0x9ce7('0x2')},'content':{'type':Sequelize[_0x9ce7('0x6')]},'key':{'type':Sequelize[_0x9ce7('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x9ce7('0x2'),_0x9ce7('0x3'),_0x9ce7('0x4'))},'keyContent':{'type':Sequelize[_0x9ce7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9ce7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9ce7('0x6')]}}; \ No newline at end of file +var _0x4346=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x196a97,_0x48117d){var _0x3b009f=function(_0xca8892){while(--_0xca8892){_0x196a97['push'](_0x196a97['shift']());}};_0x3b009f(++_0x48117d);}(_0x4346,0x71));var _0x6434=function(_0x386cef,_0x112e10){_0x386cef=_0x386cef-0x0;var _0x2f866f=_0x4346[_0x386cef];return _0x2f866f;};'use strict';var Sequelize=require(_0x6434('0x0'));module[_0x6434('0x1')]={'type':{'type':Sequelize[_0x6434('0x2')](_0x6434('0x3'),_0x6434('0x4'),_0x6434('0x5'),_0x6434('0x6'),_0x6434('0x7')),'defaultValue':_0x6434('0x3')},'content':{'type':Sequelize[_0x6434('0x8')]},'key':{'type':Sequelize[_0x6434('0x8')]},'keyType':{'type':Sequelize[_0x6434('0x2')]('string',_0x6434('0x4'),_0x6434('0x5'))},'keyContent':{'type':Sequelize[_0x6434('0x8')]},'idField':{'type':Sequelize[_0x6434('0x8')]},'nameField':{'type':Sequelize[_0x6434('0x8')]},'customField':{'type':Sequelize[_0x6434('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6434('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 1c2c6ba..4414974 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 _0x94a0=['set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x1bb0fa,_0x4e69df){var _0x1ee385=function(_0x1b4900){while(--_0x1b4900){_0x1bb0fa['push'](_0x1bb0fa['shift']());}};_0x1ee385(++_0x4e69df);}(_0x94a0,0x77));var _0x094a=function(_0x3970c2,_0x2c2f1f){_0x3970c2=_0x3970c2-0x0;var _0x4a6f97=_0x94a0[_0x3970c2];return _0x4a6f97;};'use strict';var emlformat=require(_0x094a('0x0'));var rimraf=require(_0x094a('0x1'));var zipdir=require(_0x094a('0x2'));var jsonpatch=require(_0x094a('0x3'));var rp=require(_0x094a('0x4'));var moment=require(_0x094a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x094a('0x6'));var util=require(_0x094a('0x7'));var path=require(_0x094a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x094a('0x9'));var fs=require('fs');var fs_extra=require(_0x094a('0xa'));var _=require(_0x094a('0xb'));var squel=require(_0x094a('0xc'));var crypto=require('crypto');var jsforce=require(_0x094a('0xd'));var deskjs=require(_0x094a('0xe'));var toCsv=require(_0x094a('0xf'));var querystring=require(_0x094a('0x10'));var Papa=require(_0x094a('0x11'));var Redis=require(_0x094a('0x12'));var authService=require(_0x094a('0x13'));var qs=require(_0x094a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x094a('0x15'));var logger=require('../../config/logger')(_0x094a('0x16'));var utils=require('../../config/utils');var config=require(_0x094a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x094a('0x18'))['db'];function respondWithStatusCode(_0x1be0d9,_0x5f93cb){_0x5f93cb=_0x5f93cb||0xcc;return function(_0xae39f4){if(_0xae39f4){return _0x1be0d9[_0x094a('0x19')](_0x5f93cb);}return _0x1be0d9[_0x094a('0x1a')](_0x5f93cb)[_0x094a('0x1b')]();};}function respondWithResult(_0x639c6d,_0x1d2e9c){_0x1d2e9c=_0x1d2e9c||0xc8;return function(_0x30c565){if(_0x30c565){return _0x639c6d['status'](_0x1d2e9c)[_0x094a('0x1c')](_0x30c565);}};}function respondWithFilteredResult(_0x8caaad,_0x2c1202){return function(_0xf0d858){if(_0xf0d858){var _0x23b1c5=typeof _0x2c1202[_0x094a('0x1d')]===_0x094a('0x1e')&&typeof _0x2c1202['limit']===_0x094a('0x1e');var _0xaf5e21=_0xf0d858['count'];var _0x2fe521=_0x23b1c5?0x0:_0x2c1202[_0x094a('0x1d')];var _0x26cc60=_0x23b1c5?_0xf0d858[_0x094a('0x1f')]:_0x2c1202['offset']+_0x2c1202[_0x094a('0x20')];var _0x8ed135;if(_0x26cc60>=_0xaf5e21){_0x26cc60=_0xaf5e21;_0x8ed135=0xc8;}else{_0x8ed135=0xce;}_0x8caaad[_0x094a('0x1a')](_0x8ed135);return _0x8caaad[_0x094a('0x21')](_0x094a('0x22'),_0x2fe521+'-'+_0x26cc60+'/'+_0xaf5e21)['json'](_0xf0d858);}return null;};}function patchUpdates(_0x415a69){return function(_0x98aeb3){try{jsonpatch[_0x094a('0x23')](_0x98aeb3,_0x415a69,!![]);}catch(_0x51288d){return BPromise[_0x094a('0x24')](_0x51288d);}return _0x98aeb3[_0x094a('0x25')]();};}function saveUpdates(_0x53330e,_0x4c134d){return function(_0x53ff31){if(_0x53ff31){return _0x53ff31['update'](_0x53330e)[_0x094a('0x26')](function(_0x2f9fa2){return _0x2f9fa2;});}return null;};}function removeEntity(_0x1040e9,_0x4aced9){return function(_0x204da4){if(_0x204da4){return _0x204da4[_0x094a('0x27')]()['then'](function(){_0x1040e9['status'](0xcc)[_0x094a('0x1b')]();});}};}function handleEntityNotFound(_0x1e4370,_0x418670){return function(_0x1be14f){if(!_0x1be14f){_0x1e4370[_0x094a('0x19')](0x194);}return _0x1be14f;};}function handleError(_0x144844,_0x27d22e){_0x27d22e=_0x27d22e||0x1f4;return function(_0x3627a6){logger[_0x094a('0x28')](_0x3627a6[_0x094a('0x29')]);if(_0x3627a6[_0x094a('0x2a')]){delete _0x3627a6['name'];}_0x144844['status'](_0x27d22e)[_0x094a('0x2b')](_0x3627a6);};}exports[_0x094a('0x2c')]=function(_0xf2a6c8,_0x356d10){var _0x3401ba={},_0x4d16f4={},_0x3e8aa7={'count':0x0,'rows':[]};var _0x566d11=_[_0x094a('0x2d')](db[_0x094a('0x2e')][_0x094a('0x2f')],function(_0x500ee3){return{'name':_0x500ee3[_0x094a('0x30')],'type':_0x500ee3[_0x094a('0x31')][_0x094a('0x32')]};});_0x4d16f4[_0x094a('0x33')]=_[_0x094a('0x2d')](_0x566d11,_0x094a('0x2a'));_0x4d16f4['query']=_[_0x094a('0x34')](_0xf2a6c8['query']);_0x4d16f4[_0x094a('0x35')]=_[_0x094a('0x36')](_0x4d16f4[_0x094a('0x33')],_0x4d16f4[_0x094a('0x37')]);_0x3401ba[_0x094a('0x38')]=_[_0x094a('0x36')](_0x4d16f4[_0x094a('0x33')],qs['fields'](_0xf2a6c8[_0x094a('0x37')][_0x094a('0x39')]));_0x3401ba[_0x094a('0x38')]=_0x3401ba[_0x094a('0x38')][_0x094a('0x3a')]?_0x3401ba[_0x094a('0x38')]:_0x4d16f4['model'];if(!_0xf2a6c8['query'][_0x094a('0x3b')](_0x094a('0x3c'))){_0x3401ba[_0x094a('0x20')]=qs[_0x094a('0x20')](_0xf2a6c8[_0x094a('0x37')][_0x094a('0x20')]);_0x3401ba[_0x094a('0x1d')]=qs['offset'](_0xf2a6c8[_0x094a('0x37')][_0x094a('0x1d')]);}_0x3401ba[_0x094a('0x3d')]=qs[_0x094a('0x3e')](_0xf2a6c8[_0x094a('0x37')]['sort']);_0x3401ba[_0x094a('0x3f')]=qs[_0x094a('0x35')](_['pick'](_0xf2a6c8[_0x094a('0x37')],_0x4d16f4[_0x094a('0x35')]),_0x566d11);if(_0xf2a6c8['query'][_0x094a('0x40')]){_0x3401ba[_0x094a('0x3f')]=_[_0x094a('0x41')](_0x3401ba['where'],{'$or':_[_0x094a('0x2d')](_0x566d11,function(_0x256d75){if(_0x256d75[_0x094a('0x31')]!==_0x094a('0x42')){var _0x16e395={};_0x16e395[_0x256d75[_0x094a('0x2a')]]={'$like':'%'+_0xf2a6c8[_0x094a('0x37')][_0x094a('0x40')]+'%'};return _0x16e395;}})});}_0x3401ba=_[_0x094a('0x41')]({},_0x3401ba,_0xf2a6c8[_0x094a('0x43')]);var _0x4bfc58={'where':_0x3401ba['where']};return db[_0x094a('0x2e')][_0x094a('0x1f')](_0x4bfc58)[_0x094a('0x26')](function(_0x387d24){_0x3e8aa7[_0x094a('0x1f')]=_0x387d24;if(_0xf2a6c8[_0x094a('0x37')]['includeAll']){_0x3401ba[_0x094a('0x44')]=[{'all':!![]}];}return db[_0x094a('0x2e')][_0x094a('0x45')](_0x3401ba);})[_0x094a('0x26')](function(_0x4cb304){_0x3e8aa7[_0x094a('0x46')]=_0x4cb304;return _0x3e8aa7;})[_0x094a('0x26')](respondWithFilteredResult(_0x356d10,_0x3401ba))[_0x094a('0x47')](handleError(_0x356d10,null));};exports['show']=function(_0x26f805,_0x23b8b9){var _0x479567={'raw':!![],'where':{'id':_0x26f805['params']['id']}},_0x2fca68={};_0x2fca68[_0x094a('0x33')]=_['keys'](db[_0x094a('0x2e')][_0x094a('0x2f')]);_0x2fca68[_0x094a('0x37')]=_['keys'](_0x26f805['query']);_0x2fca68['filters']=_[_0x094a('0x36')](_0x2fca68[_0x094a('0x33')],_0x2fca68['query']);_0x479567[_0x094a('0x38')]=_[_0x094a('0x36')](_0x2fca68['model'],qs[_0x094a('0x39')](_0x26f805[_0x094a('0x37')][_0x094a('0x39')]));_0x479567[_0x094a('0x38')]=_0x479567['attributes'][_0x094a('0x3a')]?_0x479567[_0x094a('0x38')]:_0x2fca68[_0x094a('0x33')];if(_0x26f805[_0x094a('0x37')][_0x094a('0x48')]){_0x479567[_0x094a('0x44')]=[{'all':!![]}];}_0x479567=_[_0x094a('0x41')]({},_0x479567,_0x26f805['options']);return db[_0x094a('0x2e')]['find'](_0x479567)['then'](handleEntityNotFound(_0x23b8b9,null))[_0x094a('0x26')](respondWithResult(_0x23b8b9,null))[_0x094a('0x47')](handleError(_0x23b8b9,null));};exports[_0x094a('0x49')]=function(_0x189295,_0x5cf281){return db[_0x094a('0x2e')]['create'](_0x189295['body'],{})[_0x094a('0x26')](respondWithResult(_0x5cf281,0xc9))[_0x094a('0x47')](handleError(_0x5cf281,null));};exports['update']=function(_0x10e35b,_0x20b0a5){if(_0x10e35b[_0x094a('0x4a')]['id']){delete _0x10e35b[_0x094a('0x4a')]['id'];}return db[_0x094a('0x2e')]['find']({'where':{'id':_0x10e35b[_0x094a('0x4b')]['id']}})[_0x094a('0x26')](handleEntityNotFound(_0x20b0a5,null))[_0x094a('0x26')](saveUpdates(_0x10e35b[_0x094a('0x4a')],null))[_0x094a('0x26')](respondWithResult(_0x20b0a5,null))[_0x094a('0x47')](handleError(_0x20b0a5,null));};exports['destroy']=function(_0x39c74d,_0x1b27f6){return db[_0x094a('0x2e')]['find']({'where':{'id':_0x39c74d[_0x094a('0x4b')]['id']}})[_0x094a('0x26')](handleEntityNotFound(_0x1b27f6,null))[_0x094a('0x26')](removeEntity(_0x1b27f6,null))[_0x094a('0x47')](handleError(_0x1b27f6,null));}; \ No newline at end of file +var _0x855a=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','SugarcrmField','includeAll','findAll','rows','catch','params','rawAttributes','include','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x3d0463,_0x4f5e08){var _0x37f791=function(_0x1f525d){while(--_0x1f525d){_0x3d0463['push'](_0x3d0463['shift']());}};_0x37f791(++_0x4f5e08);}(_0x855a,0x1af));var _0xa855=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0x855a[_0x7abd7];return _0x3a2577;};'use strict';var emlformat=require(_0xa855('0x0'));var rimraf=require(_0xa855('0x1'));var zipdir=require(_0xa855('0x2'));var jsonpatch=require(_0xa855('0x3'));var rp=require(_0xa855('0x4'));var moment=require(_0xa855('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa855('0x6'));var util=require('util');var path=require(_0xa855('0x7'));var sox=require(_0xa855('0x8'));var csv=require('to-csv');var ejs=require(_0xa855('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa855('0xa'));var squel=require(_0xa855('0xb'));var crypto=require(_0xa855('0xc'));var jsforce=require(_0xa855('0xd'));var deskjs=require(_0xa855('0xe'));var toCsv=require(_0xa855('0xf'));var querystring=require(_0xa855('0x10'));var Papa=require(_0xa855('0x11'));var Redis=require(_0xa855('0x12'));var authService=require(_0xa855('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa855('0x14'));var logger=require(_0xa855('0x15'))(_0xa855('0x16'));var utils=require(_0xa855('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa855('0x18'));var db=require(_0xa855('0x19'))['db'];function respondWithStatusCode(_0x3c59f5,_0x4de9ba){_0x4de9ba=_0x4de9ba||0xcc;return function(_0x5dc6dc){if(_0x5dc6dc){return _0x3c59f5['sendStatus'](_0x4de9ba);}return _0x3c59f5[_0xa855('0x1a')](_0x4de9ba)[_0xa855('0x1b')]();};}function respondWithResult(_0x577ede,_0x500c5f){_0x500c5f=_0x500c5f||0xc8;return function(_0x53f725){if(_0x53f725){return _0x577ede[_0xa855('0x1a')](_0x500c5f)[_0xa855('0x1c')](_0x53f725);}};}function respondWithFilteredResult(_0x10e887,_0x244727){return function(_0x4cc855){if(_0x4cc855){var _0x580c47=typeof _0x244727[_0xa855('0x1d')]===_0xa855('0x1e')&&typeof _0x244727['limit']===_0xa855('0x1e');var _0x210f12=_0x4cc855[_0xa855('0x1f')];var _0x3e7a3c=_0x580c47?0x0:_0x244727['offset'];var _0x4172e4=_0x580c47?_0x4cc855[_0xa855('0x1f')]:_0x244727[_0xa855('0x1d')]+_0x244727['limit'];var _0x18c5d4;if(_0x4172e4>=_0x210f12){_0x4172e4=_0x210f12;_0x18c5d4=0xc8;}else{_0x18c5d4=0xce;}_0x10e887[_0xa855('0x1a')](_0x18c5d4);return _0x10e887[_0xa855('0x20')](_0xa855('0x21'),_0x3e7a3c+'-'+_0x4172e4+'/'+_0x210f12)['json'](_0x4cc855);}return null;};}function patchUpdates(_0x356208){return function(_0x2c0d61){try{jsonpatch['apply'](_0x2c0d61,_0x356208,!![]);}catch(_0x4e1abc){return BPromise[_0xa855('0x22')](_0x4e1abc);}return _0x2c0d61['save']();};}function saveUpdates(_0x5d30bb,_0xd91d79){return function(_0x45f392){if(_0x45f392){return _0x45f392['update'](_0x5d30bb)[_0xa855('0x23')](function(_0x536953){return _0x536953;});}return null;};}function removeEntity(_0x57fa62,_0xc983f0){return function(_0x2bb3bd){if(_0x2bb3bd){return _0x2bb3bd[_0xa855('0x24')]()[_0xa855('0x23')](function(){_0x57fa62[_0xa855('0x1a')](0xcc)[_0xa855('0x1b')]();});}};}function handleEntityNotFound(_0x1e0de3,_0x1c9174){return function(_0x5751c2){if(!_0x5751c2){_0x1e0de3[_0xa855('0x25')](0x194);}return _0x5751c2;};}function handleError(_0x26e156,_0x1369bd){_0x1369bd=_0x1369bd||0x1f4;return function(_0xd39f2b){logger[_0xa855('0x26')](_0xd39f2b[_0xa855('0x27')]);if(_0xd39f2b[_0xa855('0x28')]){delete _0xd39f2b[_0xa855('0x28')];}_0x26e156[_0xa855('0x1a')](_0x1369bd)[_0xa855('0x29')](_0xd39f2b);};}exports[_0xa855('0x2a')]=function(_0x4a2ff5,_0x3a9739){var _0x346030={},_0x5b8480={},_0x12772a={'count':0x0,'rows':[]};var _0x2cbf25=_['map'](db['SugarcrmField']['rawAttributes'],function(_0x56482a){return{'name':_0x56482a['fieldName'],'type':_0x56482a[_0xa855('0x2b')][_0xa855('0x2c')]};});_0x5b8480[_0xa855('0x2d')]=_[_0xa855('0x2e')](_0x2cbf25,_0xa855('0x28'));_0x5b8480[_0xa855('0x2f')]=_[_0xa855('0x30')](_0x4a2ff5[_0xa855('0x2f')]);_0x5b8480[_0xa855('0x31')]=_[_0xa855('0x32')](_0x5b8480[_0xa855('0x2d')],_0x5b8480[_0xa855('0x2f')]);_0x346030[_0xa855('0x33')]=_[_0xa855('0x32')](_0x5b8480[_0xa855('0x2d')],qs[_0xa855('0x34')](_0x4a2ff5['query']['fields']));_0x346030['attributes']=_0x346030[_0xa855('0x33')][_0xa855('0x35')]?_0x346030['attributes']:_0x5b8480[_0xa855('0x2d')];if(!_0x4a2ff5[_0xa855('0x2f')][_0xa855('0x36')]('nolimit')){_0x346030[_0xa855('0x37')]=qs[_0xa855('0x37')](_0x4a2ff5['query'][_0xa855('0x37')]);_0x346030[_0xa855('0x1d')]=qs[_0xa855('0x1d')](_0x4a2ff5[_0xa855('0x2f')][_0xa855('0x1d')]);}_0x346030['order']=qs[_0xa855('0x38')](_0x4a2ff5['query'][_0xa855('0x38')]);_0x346030[_0xa855('0x39')]=qs[_0xa855('0x31')](_[_0xa855('0x3a')](_0x4a2ff5[_0xa855('0x2f')],_0x5b8480[_0xa855('0x31')]),_0x2cbf25);if(_0x4a2ff5[_0xa855('0x2f')][_0xa855('0x3b')]){_0x346030[_0xa855('0x39')]=_['merge'](_0x346030[_0xa855('0x39')],{'$or':_[_0xa855('0x2e')](_0x2cbf25,function(_0x5323fc){if(_0x5323fc[_0xa855('0x2b')]!==_0xa855('0x3c')){var _0x15538b={};_0x15538b[_0x5323fc['name']]={'$like':'%'+_0x4a2ff5[_0xa855('0x2f')][_0xa855('0x3b')]+'%'};return _0x15538b;}})});}_0x346030=_[_0xa855('0x3d')]({},_0x346030,_0x4a2ff5['options']);var _0x4e81c8={'where':_0x346030[_0xa855('0x39')]};return db[_0xa855('0x3e')][_0xa855('0x1f')](_0x4e81c8)[_0xa855('0x23')](function(_0x3468df){_0x12772a[_0xa855('0x1f')]=_0x3468df;if(_0x4a2ff5[_0xa855('0x2f')][_0xa855('0x3f')]){_0x346030['include']=[{'all':!![]}];}return db[_0xa855('0x3e')][_0xa855('0x40')](_0x346030);})[_0xa855('0x23')](function(_0x4ab302){_0x12772a[_0xa855('0x41')]=_0x4ab302;return _0x12772a;})['then'](respondWithFilteredResult(_0x3a9739,_0x346030))[_0xa855('0x42')](handleError(_0x3a9739,null));};exports['show']=function(_0x4ea4c0,_0x2aecb5){var _0x1c0f4c={'raw':!![],'where':{'id':_0x4ea4c0[_0xa855('0x43')]['id']}},_0x1b264e={};_0x1b264e[_0xa855('0x2d')]=_[_0xa855('0x30')](db['SugarcrmField'][_0xa855('0x44')]);_0x1b264e[_0xa855('0x2f')]=_[_0xa855('0x30')](_0x4ea4c0[_0xa855('0x2f')]);_0x1b264e[_0xa855('0x31')]=_[_0xa855('0x32')](_0x1b264e[_0xa855('0x2d')],_0x1b264e[_0xa855('0x2f')]);_0x1c0f4c[_0xa855('0x33')]=_[_0xa855('0x32')](_0x1b264e[_0xa855('0x2d')],qs['fields'](_0x4ea4c0[_0xa855('0x2f')]['fields']));_0x1c0f4c['attributes']=_0x1c0f4c['attributes'][_0xa855('0x35')]?_0x1c0f4c[_0xa855('0x33')]:_0x1b264e['model'];if(_0x4ea4c0[_0xa855('0x2f')]['includeAll']){_0x1c0f4c[_0xa855('0x45')]=[{'all':!![]}];}_0x1c0f4c=_[_0xa855('0x3d')]({},_0x1c0f4c,_0x4ea4c0[_0xa855('0x46')]);return db[_0xa855('0x3e')][_0xa855('0x47')](_0x1c0f4c)[_0xa855('0x23')](handleEntityNotFound(_0x2aecb5,null))[_0xa855('0x23')](respondWithResult(_0x2aecb5,null))[_0xa855('0x42')](handleError(_0x2aecb5,null));};exports['create']=function(_0xc07536,_0x5f07f7){return db[_0xa855('0x3e')][_0xa855('0x48')](_0xc07536[_0xa855('0x49')],{})[_0xa855('0x23')](respondWithResult(_0x5f07f7,0xc9))['catch'](handleError(_0x5f07f7,null));};exports[_0xa855('0x4a')]=function(_0x3c32e8,_0x45ebe5){if(_0x3c32e8['body']['id']){delete _0x3c32e8[_0xa855('0x49')]['id'];}return db[_0xa855('0x3e')][_0xa855('0x47')]({'where':{'id':_0x3c32e8['params']['id']}})[_0xa855('0x23')](handleEntityNotFound(_0x45ebe5,null))[_0xa855('0x23')](saveUpdates(_0x3c32e8[_0xa855('0x49')],null))['then'](respondWithResult(_0x45ebe5,null))[_0xa855('0x42')](handleError(_0x45ebe5,null));};exports[_0xa855('0x24')]=function(_0x4d9655,_0x2d4343){return db[_0xa855('0x3e')][_0xa855('0x47')]({'where':{'id':_0x4d9655[_0xa855('0x43')]['id']}})[_0xa855('0x23')](handleEntityNotFound(_0x2d4343,null))[_0xa855('0x23')](removeEntity(_0x2d4343,null))[_0xa855('0x42')](handleError(_0x2d4343,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 96e7b8f..2e842c8 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 _0xae2e=['rimraf','./intSugarcrmField.attributes','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','api','moment','bluebird','path'];(function(_0x34ec15,_0x1ea4b8){var _0x415e7d=function(_0x567da2){while(--_0x567da2){_0x34ec15['push'](_0x34ec15['shift']());}};_0x415e7d(++_0x1ea4b8);}(_0xae2e,0x193));var _0xeae2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xae2e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xeae2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeae2('0x1'));var moment=require(_0xeae2('0x2'));var BPromise=require(_0xeae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeae2('0x4'));var rimraf=require(_0xeae2('0x5'));var config=require('../../config/environment');var attributes=require(_0xeae2('0x6'));module[_0xeae2('0x7')]=function(_0x9be509,_0x40874c){return _0x9be509['define'](_0xeae2('0x8'),attributes,{'tableName':_0xeae2('0x9'),'paranoid':![],'indexes':[{'name':_0xeae2('0xa'),'fields':[_0xeae2('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x55ff=['sugarcrm_unique_index','idField','FieldId','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields'];(function(_0x31fccd,_0x535827){var _0x47fa8b=function(_0x221c61){while(--_0x221c61){_0x31fccd['push'](_0x31fccd['shift']());}};_0x47fa8b(++_0x535827);}(_0x55ff,0xc7));var _0xf55f=function(_0x165cc3,_0x1b2d7d){_0x165cc3=_0x165cc3-0x0;var _0x2d5eea=_0x55ff[_0x165cc3];return _0x2d5eea;};'use strict';var _=require(_0xf55f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf55f('0x1'));var BPromise=require(_0xf55f('0x2'));var rp=require(_0xf55f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf55f('0x4'));var config=require(_0xf55f('0x5'));var attributes=require(_0xf55f('0x6'));module[_0xf55f('0x7')]=function(_0x106fe8,_0x2e76c2){return _0x106fe8[_0xf55f('0x8')](_0xf55f('0x9'),attributes,{'tableName':_0xf55f('0xa'),'paranoid':![],'indexes':[{'name':_0xf55f('0xb'),'fields':[_0xf55f('0xc'),_0xf55f('0xd')],'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 fa72349..f40200f 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 _0x36bd=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x36bd,0x141));var _0xd36b=function(_0x4a96aa,_0x58133e){_0x4a96aa=_0x4a96aa-0x0;var _0x30cc22=_0x36bd[_0x4a96aa];return _0x30cc22;};'use strict';var _=require(_0xd36b('0x0'));var util=require(_0xd36b('0x1'));var moment=require(_0xd36b('0x2'));var BPromise=require('bluebird');var rs=require(_0xd36b('0x3'));var fs=require('fs');var Redis=require(_0xd36b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd36b('0x5'));var logger=require(_0xd36b('0x6'))(_0xd36b('0x7'));var config=require(_0xd36b('0x8'));var jayson=require(_0xd36b('0x9'));var client=jayson[_0xd36b('0xa')][_0xd36b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3484fe,_0x5e0e86,_0x30f402){return new BPromise(function(_0xef07e8,_0xa6ba5f){return client[_0xd36b('0xc')](_0x3484fe,_0x30f402)['then'](function(_0x2c7cbb){logger['info'](_0xd36b('0xd'),_0x5e0e86,'request\x20sent');logger[_0xd36b('0xe')](_0xd36b('0xf'),_0x5e0e86,_0xd36b('0x10'),JSON['stringify'](_0x2c7cbb));if(_0x2c7cbb['error']){if(_0x2c7cbb['error']['code']===0x1f4){logger[_0xd36b('0x11')](_0xd36b('0xd'),_0x5e0e86,_0x2c7cbb[_0xd36b('0x11')]['message']);return _0xa6ba5f(_0x2c7cbb[_0xd36b('0x11')][_0xd36b('0x12')]);}logger[_0xd36b('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x5e0e86,_0x2c7cbb[_0xd36b('0x11')][_0xd36b('0x12')]);return _0xef07e8(_0x2c7cbb[_0xd36b('0x11')]['message']);}else{logger[_0xd36b('0x13')]('SugarcrmField,\x20%s,\x20%s',_0x5e0e86,'request\x20sent');_0xef07e8(_0x2c7cbb[_0xd36b('0x14')][_0xd36b('0x12')]);}})['catch'](function(_0x2fd156){logger[_0xd36b('0x11')](_0xd36b('0xd'),_0x5e0e86,_0x2fd156);_0xa6ba5f(_0x2fd156);});});} \ No newline at end of file +var _0xf8e9=['code','message','result','catch','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x18920a,_0x5c7896){var _0x5b48a2=function(_0x6e0bf5){while(--_0x6e0bf5){_0x18920a['push'](_0x18920a['shift']());}};_0x5b48a2(++_0x5c7896);}(_0xf8e9,0x15a));var _0x9f8e=function(_0x3471c3,_0x4fe83f){_0x3471c3=_0x3471c3-0x0;var _0x5445a5=_0xf8e9[_0x3471c3];return _0x5445a5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9f8e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9f8e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9f8e('0x2'))('rpc');var config=require(_0x9f8e('0x3'));var jayson=require(_0x9f8e('0x4'));var client=jayson[_0x9f8e('0x5')][_0x9f8e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x26f96a,_0x284a46,_0x76bcb7){return new BPromise(function(_0x10ef7f,_0x325b31){return client['request'](_0x26f96a,_0x76bcb7)[_0x9f8e('0x7')](function(_0x1fb57c){logger[_0x9f8e('0x8')](_0x9f8e('0x9'),_0x284a46,_0x9f8e('0xa'));logger[_0x9f8e('0xb')](_0x9f8e('0xc'),_0x284a46,_0x9f8e('0xa'),JSON[_0x9f8e('0xd')](_0x1fb57c));if(_0x1fb57c[_0x9f8e('0xe')]){if(_0x1fb57c[_0x9f8e('0xe')][_0x9f8e('0xf')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x284a46,_0x1fb57c['error'][_0x9f8e('0x10')]);return _0x325b31(_0x1fb57c[_0x9f8e('0xe')][_0x9f8e('0x10')]);}logger[_0x9f8e('0xe')](_0x9f8e('0x9'),_0x284a46,_0x1fb57c[_0x9f8e('0xe')][_0x9f8e('0x10')]);return _0x10ef7f(_0x1fb57c[_0x9f8e('0xe')][_0x9f8e('0x10')]);}else{logger[_0x9f8e('0x8')]('SugarcrmField,\x20%s,\x20%s',_0x284a46,_0x9f8e('0xa'));_0x10ef7f(_0x1fb57c[_0x9f8e('0x11')][_0x9f8e('0x10')]);}})[_0x9f8e('0x12')](function(_0x1be200){logger['error'](_0x9f8e('0x9'),_0x284a46,_0x1be200);_0x325b31(_0x1be200);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 1ca5b51..078761e 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 _0x86dd=['show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x1e80b7,_0x595030){var _0x67f6e4=function(_0x8f1cf6){while(--_0x8f1cf6){_0x1e80b7['push'](_0x1e80b7['shift']());}};_0x67f6e4(++_0x595030);}(_0x86dd,0x1ee));var _0xd86d=function(_0x446068,_0x986cdb){_0x446068=_0x446068-0x0;var _0x4f4a04=_0x86dd[_0x446068];return _0x4f4a04;};'use strict';var multer=require('multer');var util=require(_0xd86d('0x0'));var path=require('path');var timeout=require(_0xd86d('0x1'));var express=require(_0xd86d('0x2'));var router=express[_0xd86d('0x3')]();var fs_extra=require(_0xd86d('0x4'));var auth=require(_0xd86d('0x5'));var interaction=require(_0xd86d('0x6'));var config=require(_0xd86d('0x7'));var controller=require(_0xd86d('0x8'));router[_0xd86d('0x9')]('/',auth[_0xd86d('0xa')](),controller[_0xd86d('0xb')]);router[_0xd86d('0x9')]('/:id',auth[_0xd86d('0xa')](),controller[_0xd86d('0xc')]);router['get'](_0xd86d('0xd'),auth[_0xd86d('0xa')](),controller[_0xd86d('0xe')]);router[_0xd86d('0x9')]('/:id/fields',auth[_0xd86d('0xa')](),controller[_0xd86d('0xf')]);router[_0xd86d('0x10')]('/',auth[_0xd86d('0xa')](),controller['create']);router['post'](_0xd86d('0xd'),auth[_0xd86d('0xa')](),controller[_0xd86d('0x11')]);router[_0xd86d('0x12')](_0xd86d('0x13'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd86d('0x13'),auth[_0xd86d('0xa')](),controller[_0xd86d('0x14')]);module[_0xd86d('0x15')]=router; \ No newline at end of file +var _0xc997=['/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','getConfigurations'];(function(_0x4de3ae,_0x4c2d83){var _0x264e7c=function(_0x183150){while(--_0x183150){_0x4de3ae['push'](_0x4de3ae['shift']());}};_0x264e7c(++_0x4c2d83);}(_0xc997,0x1ac));var _0x7c99=function(_0x1edab8,_0x3e9cc9){_0x1edab8=_0x1edab8-0x0;var _0x370d90=_0xc997[_0x1edab8];return _0x370d90;};'use strict';var multer=require('multer');var util=require(_0x7c99('0x0'));var path=require(_0x7c99('0x1'));var timeout=require(_0x7c99('0x2'));var express=require(_0x7c99('0x3'));var router=express[_0x7c99('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c99('0x5'));var interaction=require(_0x7c99('0x6'));var config=require(_0x7c99('0x7'));var controller=require(_0x7c99('0x8'));router[_0x7c99('0x9')]('/',auth[_0x7c99('0xa')](),controller[_0x7c99('0xb')]);router[_0x7c99('0x9')]('/:id',auth[_0x7c99('0xa')](),controller[_0x7c99('0xc')]);router[_0x7c99('0x9')]('/:id/configurations',auth[_0x7c99('0xa')](),controller[_0x7c99('0xd')]);router['get'](_0x7c99('0xe'),auth['isAuthenticated'](),controller[_0x7c99('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7c99('0x10')]);router[_0x7c99('0x11')](_0x7c99('0x12'),auth[_0x7c99('0xa')](),controller[_0x7c99('0x13')]);router[_0x7c99('0x14')](_0x7c99('0x15'),auth[_0x7c99('0xa')](),controller[_0x7c99('0x16')]);router[_0x7c99('0x17')](_0x7c99('0x15'),auth[_0x7c99('0xa')](),controller[_0x7c99('0x18')]);module[_0x7c99('0x19')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 3035543..dd3d128 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 _0x8e95=['exports','STRING','sequelize'];(function(_0x42c1c7,_0x38f6e1){var _0x19c210=function(_0x44dc74){while(--_0x44dc74){_0x42c1c7['push'](_0x42c1c7['shift']());}};_0x19c210(++_0x38f6e1);}(_0x8e95,0x128));var _0x58e9=function(_0x18e308,_0x412eba){_0x18e308=_0x18e308-0x0;var _0x25767f=_0x8e95[_0x18e308];return _0x25767f;};'use strict';var Sequelize=require(_0x58e9('0x0'));module[_0x58e9('0x1')]={'name':{'type':Sequelize[_0x58e9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x58e9('0x2')]},'username':{'type':Sequelize[_0x58e9('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x58e9('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x58e9('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x58e9('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x58e9('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7810=['sequelize','exports','STRING'];(function(_0x5634d2,_0x40ec38){var _0x4150b5=function(_0x44ceef){while(--_0x44ceef){_0x5634d2['push'](_0x5634d2['shift']());}};_0x4150b5(++_0x40ec38);}(_0x7810,0x180));var _0x0781=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x7810[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x0781('0x0'));module[_0x0781('0x1')]={'name':{'type':Sequelize[_0x0781('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0781('0x2')]},'username':{'type':Sequelize[_0x0781('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0781('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x0781('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0781('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x0781('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 8f29f9a..4a26e42 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 _0xa3a6=['Subjects','getSubjects','channel','Descriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','accessKey','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','reference','remove','includes','editable','label','startsWith','cf_','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','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','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','sendStatus','error','stack','name','send','map','VtigerAccount','rawAttributes','keys','query','filters','attributes','model','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','intersection','find','create','body','destroy','findOne','order','addConfiguration'];(function(_0xf0bca9,_0x279a0d){var _0x3f45b8=function(_0x146500){while(--_0x146500){_0xf0bca9['push'](_0xf0bca9['shift']());}};_0x3f45b8(++_0x279a0d);}(_0xa3a6,0x186));var _0x6a3a=function(_0x573620,_0x3e2067){_0x573620=_0x573620-0x0;var _0x1b20e4=_0xa3a6[_0x573620];return _0x1b20e4;};'use strict';var emlformat=require(_0x6a3a('0x0'));var rimraf=require(_0x6a3a('0x1'));var zipdir=require(_0x6a3a('0x2'));var jsonpatch=require(_0x6a3a('0x3'));var rp=require(_0x6a3a('0x4'));var moment=require(_0x6a3a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6a3a('0x6'));var util=require(_0x6a3a('0x7'));var path=require('path');var sox=require(_0x6a3a('0x8'));var csv=require(_0x6a3a('0x9'));var ejs=require(_0x6a3a('0xa'));var fs=require('fs');var fs_extra=require(_0x6a3a('0xb'));var _=require('lodash');var squel=require(_0x6a3a('0xc'));var crypto=require('crypto');var jsforce=require(_0x6a3a('0xd'));var deskjs=require(_0x6a3a('0xe'));var toCsv=require(_0x6a3a('0x9'));var querystring=require('querystring');var Papa=require(_0x6a3a('0xf'));var Redis=require(_0x6a3a('0x10'));var authService=require(_0x6a3a('0x11'));var qs=require(_0x6a3a('0x12'));var as=require(_0x6a3a('0x13'));var hardwareService=require(_0x6a3a('0x14'));var logger=require(_0x6a3a('0x15'))('api');var utils=require(_0x6a3a('0x16'));var config=require(_0x6a3a('0x17'));var licenseUtil=require(_0x6a3a('0x18'));var db=require(_0x6a3a('0x19'))['db'];var integrations=require(_0x6a3a('0x1a'));function respondWithStatusCode(_0x47d430,_0x44fa0a){_0x44fa0a=_0x44fa0a||0xcc;return function(_0x47c18d){if(_0x47c18d){return _0x47d430['sendStatus'](_0x44fa0a);}return _0x47d430[_0x6a3a('0x1b')](_0x44fa0a)[_0x6a3a('0x1c')]();};}function respondWithResult(_0x88f5aa,_0x4781e5){_0x4781e5=_0x4781e5||0xc8;return function(_0x3a644e){if(_0x3a644e){return _0x88f5aa[_0x6a3a('0x1b')](_0x4781e5)[_0x6a3a('0x1d')](_0x3a644e);}};}function respondWithFilteredResult(_0x43fde1,_0x11b538){return function(_0xb29277){if(_0xb29277){var _0x253a31=typeof _0x11b538[_0x6a3a('0x1e')]===_0x6a3a('0x1f')&&typeof _0x11b538[_0x6a3a('0x20')]===_0x6a3a('0x1f');var _0x3c50e7=_0xb29277[_0x6a3a('0x21')];var _0x446e91=_0x253a31?0x0:_0x11b538['offset'];var _0x4f7c4a=_0x253a31?_0xb29277[_0x6a3a('0x21')]:_0x11b538['offset']+_0x11b538['limit'];var _0x4b869d;if(_0x4f7c4a>=_0x3c50e7){_0x4f7c4a=_0x3c50e7;_0x4b869d=0xc8;}else{_0x4b869d=0xce;}_0x43fde1[_0x6a3a('0x1b')](_0x4b869d);return _0x43fde1[_0x6a3a('0x22')]('Content-Range',_0x446e91+'-'+_0x4f7c4a+'/'+_0x3c50e7)['json'](_0xb29277);}return null;};}function patchUpdates(_0x22e438){return function(_0x3ebbb4){try{jsonpatch[_0x6a3a('0x23')](_0x3ebbb4,_0x22e438,!![]);}catch(_0x2a9217){return BPromise[_0x6a3a('0x24')](_0x2a9217);}return _0x3ebbb4[_0x6a3a('0x25')]();};}function saveUpdates(_0x4f23c7,_0x428f76){return function(_0x584f4b){if(_0x584f4b){return _0x584f4b[_0x6a3a('0x26')](_0x4f23c7)['then'](function(_0xd469bf){return _0xd469bf;});}return null;};}function removeEntity(_0x2e62bb,_0x14dfff){return function(_0x55c351){if(_0x55c351){return _0x55c351['destroy']()['then'](function(){_0x2e62bb[_0x6a3a('0x1b')](0xcc)[_0x6a3a('0x1c')]();});}};}function handleEntityNotFound(_0x160010,_0x4e7590){return function(_0x330caa){if(!_0x330caa){_0x160010[_0x6a3a('0x27')](0x194);}return _0x330caa;};}function handleError(_0x3fbca5,_0xa91154){_0xa91154=_0xa91154||0x1f4;return function(_0x37d8cf){logger[_0x6a3a('0x28')](_0x37d8cf[_0x6a3a('0x29')]);if(_0x37d8cf[_0x6a3a('0x2a')]){delete _0x37d8cf['name'];}_0x3fbca5[_0x6a3a('0x1b')](_0xa91154)[_0x6a3a('0x2b')](_0x37d8cf);};}exports['index']=function(_0x4846e9,_0xfb23c1){var _0x531b4b={},_0x3e8c1f={},_0x326203={'count':0x0,'rows':[]};var _0x3c3495=_[_0x6a3a('0x2c')](db[_0x6a3a('0x2d')][_0x6a3a('0x2e')],function(_0x8ea829){return{'name':_0x8ea829['fieldName'],'type':_0x8ea829['type']['key']};});_0x3e8c1f['model']=_[_0x6a3a('0x2c')](_0x3c3495,_0x6a3a('0x2a'));_0x3e8c1f['query']=_[_0x6a3a('0x2f')](_0x4846e9[_0x6a3a('0x30')]);_0x3e8c1f[_0x6a3a('0x31')]=_['intersection'](_0x3e8c1f['model'],_0x3e8c1f[_0x6a3a('0x30')]);_0x531b4b[_0x6a3a('0x32')]=_['intersection'](_0x3e8c1f[_0x6a3a('0x33')],qs[_0x6a3a('0x34')](_0x4846e9[_0x6a3a('0x30')][_0x6a3a('0x34')]));_0x531b4b[_0x6a3a('0x32')]=_0x531b4b[_0x6a3a('0x32')][_0x6a3a('0x35')]?_0x531b4b[_0x6a3a('0x32')]:_0x3e8c1f['model'];if(!_0x4846e9[_0x6a3a('0x30')]['hasOwnProperty'](_0x6a3a('0x36'))){_0x531b4b[_0x6a3a('0x20')]=qs['limit'](_0x4846e9[_0x6a3a('0x30')][_0x6a3a('0x20')]);_0x531b4b[_0x6a3a('0x1e')]=qs['offset'](_0x4846e9[_0x6a3a('0x30')][_0x6a3a('0x1e')]);}_0x531b4b['order']=qs[_0x6a3a('0x37')](_0x4846e9[_0x6a3a('0x30')][_0x6a3a('0x37')]);_0x531b4b[_0x6a3a('0x38')]=qs[_0x6a3a('0x31')](_[_0x6a3a('0x39')](_0x4846e9[_0x6a3a('0x30')],_0x3e8c1f[_0x6a3a('0x31')]),_0x3c3495);if(_0x4846e9[_0x6a3a('0x30')][_0x6a3a('0x3a')]){_0x531b4b[_0x6a3a('0x38')]=_[_0x6a3a('0x3b')](_0x531b4b[_0x6a3a('0x38')],{'$or':_['map'](_0x3c3495,function(_0x1994b3){if(_0x1994b3[_0x6a3a('0x3c')]!==_0x6a3a('0x3d')){var _0x13cfc5={};_0x13cfc5[_0x1994b3[_0x6a3a('0x2a')]]={'$like':'%'+_0x4846e9[_0x6a3a('0x30')][_0x6a3a('0x3a')]+'%'};return _0x13cfc5;}})});}_0x531b4b=_[_0x6a3a('0x3b')]({},_0x531b4b,_0x4846e9[_0x6a3a('0x3e')]);var _0x585aa9={'where':_0x531b4b[_0x6a3a('0x38')]};return db['VtigerAccount']['count'](_0x585aa9)[_0x6a3a('0x3f')](function(_0x55f2dc){_0x326203['count']=_0x55f2dc;if(_0x4846e9[_0x6a3a('0x30')][_0x6a3a('0x40')]){_0x531b4b[_0x6a3a('0x41')]=[{'all':!![]}];}return db[_0x6a3a('0x2d')][_0x6a3a('0x42')](_0x531b4b);})[_0x6a3a('0x3f')](function(_0x459017){_0x326203['rows']=_0x459017;return _0x326203;})['then'](respondWithFilteredResult(_0xfb23c1,_0x531b4b))[_0x6a3a('0x43')](handleError(_0xfb23c1,null));};exports[_0x6a3a('0x44')]=function(_0x14ffae,_0x38521e){var _0xf81897={'raw':![],'where':{'id':_0x14ffae[_0x6a3a('0x45')]['id']}},_0x4602db={};_0x4602db[_0x6a3a('0x33')]=_[_0x6a3a('0x2f')](db['VtigerAccount'][_0x6a3a('0x2e')]);_0x4602db['query']=_['keys'](_0x14ffae[_0x6a3a('0x30')]);_0x4602db['filters']=_[_0x6a3a('0x46')](_0x4602db['model'],_0x4602db[_0x6a3a('0x30')]);_0xf81897[_0x6a3a('0x32')]=_[_0x6a3a('0x46')](_0x4602db[_0x6a3a('0x33')],qs[_0x6a3a('0x34')](_0x14ffae[_0x6a3a('0x30')][_0x6a3a('0x34')]));_0xf81897[_0x6a3a('0x32')]=_0xf81897['attributes'][_0x6a3a('0x35')]?_0xf81897[_0x6a3a('0x32')]:_0x4602db[_0x6a3a('0x33')];if(_0x14ffae[_0x6a3a('0x30')][_0x6a3a('0x40')]){_0xf81897[_0x6a3a('0x41')]=[{'all':!![]}];}_0xf81897=_[_0x6a3a('0x3b')]({},_0xf81897,_0x14ffae[_0x6a3a('0x3e')]);return db['VtigerAccount'][_0x6a3a('0x47')](_0xf81897)[_0x6a3a('0x3f')](handleEntityNotFound(_0x38521e,null))[_0x6a3a('0x3f')](respondWithResult(_0x38521e,null))[_0x6a3a('0x43')](handleError(_0x38521e,null));};exports[_0x6a3a('0x48')]=function(_0xd7eb92,_0xd62158){return db['VtigerAccount'][_0x6a3a('0x48')](_0xd7eb92[_0x6a3a('0x49')],{})[_0x6a3a('0x3f')](respondWithResult(_0xd62158,0xc9))['catch'](handleError(_0xd62158,null));};exports['update']=function(_0x23de1f,_0x35bf3c){if(_0x23de1f[_0x6a3a('0x49')]['id']){delete _0x23de1f[_0x6a3a('0x49')]['id'];}return db[_0x6a3a('0x2d')][_0x6a3a('0x47')]({'where':{'id':_0x23de1f[_0x6a3a('0x45')]['id']}})[_0x6a3a('0x3f')](handleEntityNotFound(_0x35bf3c,null))[_0x6a3a('0x3f')](saveUpdates(_0x23de1f[_0x6a3a('0x49')],null))[_0x6a3a('0x3f')](respondWithResult(_0x35bf3c,null))[_0x6a3a('0x43')](handleError(_0x35bf3c,null));};exports[_0x6a3a('0x4a')]=function(_0x4c6dd4,_0x582f5d){return db[_0x6a3a('0x2d')]['find']({'where':{'id':_0x4c6dd4[_0x6a3a('0x45')]['id']}})[_0x6a3a('0x3f')](handleEntityNotFound(_0x582f5d,null))[_0x6a3a('0x3f')](removeEntity(_0x582f5d,null))[_0x6a3a('0x43')](handleError(_0x582f5d,null));};exports['getConfigurations']=function(_0x3d6457,_0x4daa33,_0x5524de){var _0x464df5={};var _0x4be6e1={};var _0x1a5391;var _0x103c8d;return db[_0x6a3a('0x2d')][_0x6a3a('0x4b')]({'where':{'id':_0x3d6457[_0x6a3a('0x45')]['id']}})[_0x6a3a('0x3f')](handleEntityNotFound(_0x4daa33,null))[_0x6a3a('0x3f')](function(_0x1ed5d0){if(_0x1ed5d0){_0x1a5391=_0x1ed5d0;_0x4be6e1['model']=_['keys'](db['VtigerConfiguration'][_0x6a3a('0x2e')]);_0x4be6e1['query']=_['keys'](_0x3d6457[_0x6a3a('0x30')]);_0x4be6e1['filters']=_[_0x6a3a('0x46')](_0x4be6e1['model'],_0x4be6e1[_0x6a3a('0x30')]);_0x464df5[_0x6a3a('0x32')]=_[_0x6a3a('0x46')](_0x4be6e1['model'],qs[_0x6a3a('0x34')](_0x3d6457[_0x6a3a('0x30')][_0x6a3a('0x34')]));_0x464df5['attributes']=_0x464df5[_0x6a3a('0x32')][_0x6a3a('0x35')]?_0x464df5['attributes']:_0x4be6e1['model'];_0x464df5[_0x6a3a('0x4c')]=qs[_0x6a3a('0x37')](_0x3d6457[_0x6a3a('0x30')]['sort']);_0x464df5[_0x6a3a('0x38')]=qs[_0x6a3a('0x31')](_[_0x6a3a('0x39')](_0x3d6457[_0x6a3a('0x30')],_0x4be6e1[_0x6a3a('0x31')]));if(_0x3d6457[_0x6a3a('0x30')][_0x6a3a('0x3a')]){_0x464df5[_0x6a3a('0x38')]=_[_0x6a3a('0x3b')](_0x464df5['where'],{'$or':_['map'](_0x464df5[_0x6a3a('0x32')],function(_0x5a5eb7){var _0xfb5469={};_0xfb5469[_0x5a5eb7]={'$like':'%'+_0x3d6457['query'][_0x6a3a('0x3a')]+'%'};return _0xfb5469;})});}_0x464df5=_['merge']({},_0x464df5,_0x3d6457['options']);return _0x1a5391['getConfigurations'](_0x464df5);}})[_0x6a3a('0x3f')](function(_0x474c80){if(_0x474c80){_0x103c8d=_0x474c80[_0x6a3a('0x35')];if(!_0x3d6457['query']['hasOwnProperty'](_0x6a3a('0x36'))){_0x464df5[_0x6a3a('0x20')]=qs[_0x6a3a('0x20')](_0x3d6457[_0x6a3a('0x30')]['limit']);_0x464df5[_0x6a3a('0x1e')]=qs[_0x6a3a('0x1e')](_0x3d6457['query'][_0x6a3a('0x1e')]);}return _0x1a5391['getConfigurations'](_0x464df5);}})['then'](function(_0x104590){if(_0x104590){return _0x104590?{'count':_0x103c8d,'rows':_0x104590}:null;}})[_0x6a3a('0x3f')](respondWithResult(_0x4daa33,null))[_0x6a3a('0x43')](handleError(_0x4daa33,null));};exports[_0x6a3a('0x4d')]=function(_0x1d2ce0,_0xd40e97,_0x88fb77){if(_0x1d2ce0[_0x6a3a('0x49')]['id']){delete _0x1d2ce0[_0x6a3a('0x49')]['id'];}return db[_0x6a3a('0x2d')]['findOne']({'where':{'id':_0x1d2ce0[_0x6a3a('0x45')]['id']}})[_0x6a3a('0x3f')](handleEntityNotFound(_0xd40e97,null))[_0x6a3a('0x3f')](function(_0xc713e0){if(_0xc713e0){_0x1d2ce0['body']['AccountId']=_0xc713e0['id'];_0x1d2ce0[_0x6a3a('0x49')][_0x6a3a('0x4e')]=integrations[_0x6a3a('0x4f')](_0x1d2ce0[_0x6a3a('0x49')][_0x6a3a('0x50')],_0x1d2ce0['body'][_0x6a3a('0x3c')]);_0x1d2ce0['body'][_0x6a3a('0x51')]=integrations['getDescriptions'](_0x1d2ce0[_0x6a3a('0x49')][_0x6a3a('0x50')],_0x1d2ce0[_0x6a3a('0x49')][_0x6a3a('0x3c')]);return db[_0x6a3a('0x52')][_0x6a3a('0x48')](_0x1d2ce0[_0x6a3a('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x6a3a('0x4e')},{'model':db[_0x6a3a('0x53')],'as':_0x6a3a('0x51')}]});}return null;})['then'](respondWithResult(_0xd40e97,null))['catch'](handleError(_0xd40e97,null));};var md5=require(_0x6a3a('0x54'));exports[_0x6a3a('0x55')]=function(_0x2b61e0,_0x36c8eb,_0x2a04de){var _0x2dd484=null;var _0x51a502=null;var _0x25b8d3=null;var _0x37e5c9=null;var _0x435246='';return db[_0x6a3a('0x2d')][_0x6a3a('0x4b')]({'where':{'id':_0x2b61e0[_0x6a3a('0x45')]['id']},'attributes':['id',_0x6a3a('0x2a'),_0x6a3a('0x56'),_0x6a3a('0x57'),_0x6a3a('0x58'),_0x6a3a('0x59'),'serverUrl','accessKey']})[_0x6a3a('0x3f')](handleEntityNotFound(_0x36c8eb,null))['then'](function(_0x4d402c){if(_0x4d402c){_0x2dd484=_0x4d402c['username'];_0x51a502=_0x4d402c[_0x6a3a('0x5a')];_0x25b8d3=_0x4d402c[_0x6a3a('0x58')];_0x435246=_0x4d402c[_0x6a3a('0x59')];var _0x2313e6=_0x435246[_0x6a3a('0x5b')](-0x1);if(_0x2313e6==='/'){_0x435246=_0x435246['substring'](0x0,_0x435246[_0x6a3a('0x5c')](_0x2313e6));}_0x37e5c9=util[_0x6a3a('0x5d')](_0x6a3a('0x5e'),_0x435246);var _0x254786={'method':_0x6a3a('0x5f'),'uri':_0x37e5c9,'qs':{'operation':_0x6a3a('0x60'),'username':_0x4d402c[_0x6a3a('0x56')]},'json':!![]};return rp(_0x254786);}})[_0x6a3a('0x3f')](function(_0x39fb90){if(_0x39fb90[_0x6a3a('0x61')]){var _0x48582b={'method':_0x6a3a('0x62'),'uri':_0x37e5c9,'form':{'operation':_0x6a3a('0x63'),'username':_0x2dd484,'accessKey':md5(_0x39fb90[_0x6a3a('0x64')][_0x6a3a('0x65')]+_0x51a502)},'json':!![]};return rp(_0x48582b);}})['then'](function(_0x5660d3){if(_0x5660d3[_0x6a3a('0x61')]){var _0x7ce8f7={'method':_0x6a3a('0x5f'),'uri':_0x37e5c9,'qs':{'operation':_0x6a3a('0x66'),'username':_0x2dd484,'sessionName':_0x5660d3['result']['sessionName'],'elementType':_0x25b8d3},'json':!![]};return rp(_0x7ce8f7);}})[_0x6a3a('0x3f')](function(_0x550725){if(_0x550725[_0x6a3a('0x61')]){var _0x5a2a41=['autogenerated',_0x6a3a('0x67'),'owner'];_[_0x6a3a('0x68')](_0x550725[_0x6a3a('0x64')]['fields'],function(_0xaba67e){return _0x5a2a41[_0x6a3a('0x69')](_0xaba67e['type'][_0x6a3a('0x2a')]);});_[_0x6a3a('0x68')](_0x550725[_0x6a3a('0x64')][_0x6a3a('0x34')],function(_0x4d30fe){return _0x4d30fe[_0x6a3a('0x6a')]==='false';});return{'count':_0x550725[_0x6a3a('0x64')]['fields'][_0x6a3a('0x35')],'rows':_[_0x6a3a('0x2c')](_0x550725[_0x6a3a('0x64')][_0x6a3a('0x34')],function(_0xb6c968){return{'id':_0xb6c968['name'],'name':_0xb6c968[_0x6a3a('0x6b')],'custom':_[_0x6a3a('0x6c')](_0xb6c968['name'],_0x6a3a('0x6d'))?!![]:![],'options':_0xb6c968['type']['name']==='picklist'&&_0xb6c968[_0x6a3a('0x3c')][_0x6a3a('0x6e')][_0x6a3a('0x35')]>0x0?_[_0x6a3a('0x2c')](_0xb6c968[_0x6a3a('0x3c')]['picklistValues'],function(_0x892ab4){return{'name':_0x892ab4[_0x6a3a('0x6b')],'value':_0x892ab4[_0x6a3a('0x6f')]};}):[]};})};}})[_0x6a3a('0x3f')](respondWithResult(_0x36c8eb,null))[_0x6a3a('0x43')](function(_0x7dcccf){console[_0x6a3a('0x70')](_0x6a3a('0x71')+_0x7dcccf);var _0x455863=_0x2b61e0[_0x6a3a('0x30')][_0x6a3a('0x72')]?0x1f4:_0x7dcccf[_0x6a3a('0x73')]||0x1f4;logger[_0x6a3a('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x6a3a('0x55'),_0x455863,JSON[_0x6a3a('0x74')](_0x7dcccf));delete _0x7dcccf[_0x6a3a('0x2a')];if(_0x455863===0x191){_0x455863=0x190;}_0x36c8eb['status'](_0x455863)[_0x6a3a('0x2b')](_0x2b61e0[_0x6a3a('0x30')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x7dcccf['statusCode']}:_0x7dcccf);});}; \ No newline at end of file +var _0x10b6=['description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','format','getchallenge','success','POST','login','result','GET','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','startsWith','cf_','picklist','picklistValues','test','statusCode','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','VtigerAccount','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','update','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','VtigerField','getFields','username'];(function(_0x3ba049,_0x1e2679){var _0x3b3280=function(_0x26fc38){while(--_0x26fc38){_0x3ba049['push'](_0x3ba049['shift']());}};_0x3b3280(++_0x1e2679);}(_0x10b6,0x94));var _0x610b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x10b6[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x610b('0x0'));var jsonpatch=require(_0x610b('0x1'));var rp=require(_0x610b('0x2'));var moment=require(_0x610b('0x3'));var BPromise=require(_0x610b('0x4'));var Mustache=require(_0x610b('0x5'));var util=require(_0x610b('0x6'));var path=require(_0x610b('0x7'));var sox=require(_0x610b('0x8'));var csv=require('to-csv');var ejs=require(_0x610b('0x9'));var fs=require('fs');var fs_extra=require(_0x610b('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x610b('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x610b('0xc'));var Papa=require('papaparse');var Redis=require(_0x610b('0xd'));var authService=require(_0x610b('0xe'));var qs=require(_0x610b('0xf'));var as=require(_0x610b('0x10'));var hardwareService=require(_0x610b('0x11'));var logger=require(_0x610b('0x12'))(_0x610b('0x13'));var utils=require('../../config/utils');var config=require(_0x610b('0x14'));var licenseUtil=require(_0x610b('0x15'));var db=require(_0x610b('0x16'))['db'];var integrations=require(_0x610b('0x17'));function respondWithStatusCode(_0x2514cf,_0x1df633){_0x1df633=_0x1df633||0xcc;return function(_0x32cce2){if(_0x32cce2){return _0x2514cf[_0x610b('0x18')](_0x1df633);}return _0x2514cf[_0x610b('0x19')](_0x1df633)[_0x610b('0x1a')]();};}function respondWithResult(_0x3130bf,_0x331bfa){_0x331bfa=_0x331bfa||0xc8;return function(_0x4fb5cd){if(_0x4fb5cd){return _0x3130bf[_0x610b('0x19')](_0x331bfa)[_0x610b('0x1b')](_0x4fb5cd);}};}function respondWithFilteredResult(_0x367cb3,_0x1eefdb){return function(_0x1c56aa){if(_0x1c56aa){var _0x24a1b9=typeof _0x1eefdb[_0x610b('0x1c')]===_0x610b('0x1d')&&typeof _0x1eefdb[_0x610b('0x1e')]===_0x610b('0x1d');var _0x151589=_0x1c56aa[_0x610b('0x1f')];var _0x52776c=_0x24a1b9?0x0:_0x1eefdb['offset'];var _0x50d339=_0x24a1b9?_0x1c56aa[_0x610b('0x1f')]:_0x1eefdb[_0x610b('0x1c')]+_0x1eefdb[_0x610b('0x1e')];var _0x1085ef;if(_0x50d339>=_0x151589){_0x50d339=_0x151589;_0x1085ef=0xc8;}else{_0x1085ef=0xce;}_0x367cb3['status'](_0x1085ef);return _0x367cb3[_0x610b('0x20')](_0x610b('0x21'),_0x52776c+'-'+_0x50d339+'/'+_0x151589)['json'](_0x1c56aa);}return null;};}function patchUpdates(_0x4d03d8){return function(_0x4e53b2){try{jsonpatch['apply'](_0x4e53b2,_0x4d03d8,!![]);}catch(_0x42e02b){return BPromise[_0x610b('0x22')](_0x42e02b);}return _0x4e53b2[_0x610b('0x23')]();};}function saveUpdates(_0x504542,_0x12b3af){return function(_0x1e3895){if(_0x1e3895){return _0x1e3895['update'](_0x504542)[_0x610b('0x24')](function(_0x302b70){return _0x302b70;});}return null;};}function removeEntity(_0x2e8d2a,_0x4d58b1){return function(_0x1a37b4){if(_0x1a37b4){return _0x1a37b4[_0x610b('0x25')]()[_0x610b('0x24')](function(){_0x2e8d2a[_0x610b('0x19')](0xcc)[_0x610b('0x1a')]();});}};}function handleEntityNotFound(_0x4ec619,_0x523be0){return function(_0x391d55){if(!_0x391d55){_0x4ec619['sendStatus'](0x194);}return _0x391d55;};}function handleError(_0x2846ae,_0x4aa167){_0x4aa167=_0x4aa167||0x1f4;return function(_0x564876){logger[_0x610b('0x26')](_0x564876[_0x610b('0x27')]);if(_0x564876[_0x610b('0x28')]){delete _0x564876[_0x610b('0x28')];}_0x2846ae['status'](_0x4aa167)[_0x610b('0x29')](_0x564876);};}exports['index']=function(_0x693399,_0x4b5577){var _0x5131f2={},_0xaeaf0b={},_0x2e33d8={'count':0x0,'rows':[]};var _0xb4668e=_[_0x610b('0x2a')](db[_0x610b('0x2b')]['rawAttributes'],function(_0x4dfd63){return{'name':_0x4dfd63['fieldName'],'type':_0x4dfd63['type'][_0x610b('0x2c')]};});_0xaeaf0b['model']=_[_0x610b('0x2a')](_0xb4668e,'name');_0xaeaf0b[_0x610b('0x2d')]=_[_0x610b('0x2e')](_0x693399[_0x610b('0x2d')]);_0xaeaf0b['filters']=_[_0x610b('0x2f')](_0xaeaf0b[_0x610b('0x30')],_0xaeaf0b[_0x610b('0x2d')]);_0x5131f2['attributes']=_[_0x610b('0x2f')](_0xaeaf0b[_0x610b('0x30')],qs[_0x610b('0x31')](_0x693399[_0x610b('0x2d')]['fields']));_0x5131f2['attributes']=_0x5131f2[_0x610b('0x32')][_0x610b('0x33')]?_0x5131f2[_0x610b('0x32')]:_0xaeaf0b[_0x610b('0x30')];if(!_0x693399[_0x610b('0x2d')]['hasOwnProperty'](_0x610b('0x34'))){_0x5131f2[_0x610b('0x1e')]=qs['limit'](_0x693399[_0x610b('0x2d')]['limit']);_0x5131f2[_0x610b('0x1c')]=qs['offset'](_0x693399[_0x610b('0x2d')][_0x610b('0x1c')]);}_0x5131f2[_0x610b('0x35')]=qs['sort'](_0x693399['query'][_0x610b('0x36')]);_0x5131f2[_0x610b('0x37')]=qs[_0x610b('0x38')](_[_0x610b('0x39')](_0x693399[_0x610b('0x2d')],_0xaeaf0b['filters']),_0xb4668e);if(_0x693399[_0x610b('0x2d')][_0x610b('0x3a')]){_0x5131f2[_0x610b('0x37')]=_[_0x610b('0x3b')](_0x5131f2[_0x610b('0x37')],{'$or':_[_0x610b('0x2a')](_0xb4668e,function(_0x4feb5d){if(_0x4feb5d[_0x610b('0x3c')]!==_0x610b('0x3d')){var _0x269073={};_0x269073[_0x4feb5d[_0x610b('0x28')]]={'$like':'%'+_0x693399['query'][_0x610b('0x3a')]+'%'};return _0x269073;}})});}_0x5131f2=_['merge']({},_0x5131f2,_0x693399[_0x610b('0x3e')]);var _0xcb0f4a={'where':_0x5131f2[_0x610b('0x37')]};return db[_0x610b('0x2b')]['count'](_0xcb0f4a)[_0x610b('0x24')](function(_0x4207d7){_0x2e33d8['count']=_0x4207d7;if(_0x693399[_0x610b('0x2d')][_0x610b('0x3f')]){_0x5131f2[_0x610b('0x40')]=[{'all':!![]}];}return db[_0x610b('0x2b')][_0x610b('0x41')](_0x5131f2);})['then'](function(_0x53780b){_0x2e33d8[_0x610b('0x42')]=_0x53780b;return _0x2e33d8;})[_0x610b('0x24')](respondWithFilteredResult(_0x4b5577,_0x5131f2))['catch'](handleError(_0x4b5577,null));};exports[_0x610b('0x43')]=function(_0x2c755a,_0xb72275){var _0x44736d={'raw':![],'where':{'id':_0x2c755a[_0x610b('0x44')]['id']}},_0x43edd1={};_0x43edd1[_0x610b('0x30')]=_[_0x610b('0x2e')](db[_0x610b('0x2b')][_0x610b('0x45')]);_0x43edd1['query']=_['keys'](_0x2c755a[_0x610b('0x2d')]);_0x43edd1['filters']=_[_0x610b('0x2f')](_0x43edd1[_0x610b('0x30')],_0x43edd1[_0x610b('0x2d')]);_0x44736d[_0x610b('0x32')]=_[_0x610b('0x2f')](_0x43edd1[_0x610b('0x30')],qs['fields'](_0x2c755a[_0x610b('0x2d')][_0x610b('0x31')]));_0x44736d['attributes']=_0x44736d[_0x610b('0x32')]['length']?_0x44736d[_0x610b('0x32')]:_0x43edd1[_0x610b('0x30')];if(_0x2c755a['query']['includeAll']){_0x44736d[_0x610b('0x40')]=[{'all':!![]}];}_0x44736d=_[_0x610b('0x3b')]({},_0x44736d,_0x2c755a[_0x610b('0x3e')]);return db[_0x610b('0x2b')][_0x610b('0x46')](_0x44736d)[_0x610b('0x24')](handleEntityNotFound(_0xb72275,null))[_0x610b('0x24')](respondWithResult(_0xb72275,null))[_0x610b('0x47')](handleError(_0xb72275,null));};exports[_0x610b('0x48')]=function(_0x495153,_0x184e8c){return db[_0x610b('0x2b')][_0x610b('0x48')](_0x495153[_0x610b('0x49')],{})[_0x610b('0x24')](respondWithResult(_0x184e8c,0xc9))[_0x610b('0x47')](handleError(_0x184e8c,null));};exports[_0x610b('0x4a')]=function(_0x1f1cf2,_0x230f1f){if(_0x1f1cf2[_0x610b('0x49')]['id']){delete _0x1f1cf2[_0x610b('0x49')]['id'];}return db['VtigerAccount'][_0x610b('0x46')]({'where':{'id':_0x1f1cf2[_0x610b('0x44')]['id']}})[_0x610b('0x24')](handleEntityNotFound(_0x230f1f,null))[_0x610b('0x24')](saveUpdates(_0x1f1cf2['body'],null))[_0x610b('0x24')](respondWithResult(_0x230f1f,null))[_0x610b('0x47')](handleError(_0x230f1f,null));};exports[_0x610b('0x25')]=function(_0x2da6e9,_0x4187ae){return db['VtigerAccount'][_0x610b('0x46')]({'where':{'id':_0x2da6e9[_0x610b('0x44')]['id']}})[_0x610b('0x24')](handleEntityNotFound(_0x4187ae,null))[_0x610b('0x24')](removeEntity(_0x4187ae,null))['catch'](handleError(_0x4187ae,null));};exports[_0x610b('0x4b')]=function(_0x24ddd2,_0x254c31,_0x38051a){var _0x28ee31={};var _0x4eb74a={};var _0x45a5cd;var _0x1b8452;return db[_0x610b('0x2b')][_0x610b('0x4c')]({'where':{'id':_0x24ddd2[_0x610b('0x44')]['id']}})[_0x610b('0x24')](handleEntityNotFound(_0x254c31,null))['then'](function(_0x1e2157){if(_0x1e2157){_0x45a5cd=_0x1e2157;_0x4eb74a[_0x610b('0x30')]=_['keys'](db[_0x610b('0x4d')][_0x610b('0x45')]);_0x4eb74a[_0x610b('0x2d')]=_['keys'](_0x24ddd2['query']);_0x4eb74a[_0x610b('0x38')]=_[_0x610b('0x2f')](_0x4eb74a[_0x610b('0x30')],_0x4eb74a['query']);_0x28ee31['attributes']=_[_0x610b('0x2f')](_0x4eb74a[_0x610b('0x30')],qs[_0x610b('0x31')](_0x24ddd2[_0x610b('0x2d')][_0x610b('0x31')]));_0x28ee31[_0x610b('0x32')]=_0x28ee31[_0x610b('0x32')]['length']?_0x28ee31[_0x610b('0x32')]:_0x4eb74a[_0x610b('0x30')];_0x28ee31[_0x610b('0x35')]=qs[_0x610b('0x36')](_0x24ddd2[_0x610b('0x2d')]['sort']);_0x28ee31[_0x610b('0x37')]=qs[_0x610b('0x38')](_[_0x610b('0x39')](_0x24ddd2['query'],_0x4eb74a[_0x610b('0x38')]));if(_0x24ddd2[_0x610b('0x2d')][_0x610b('0x3a')]){_0x28ee31[_0x610b('0x37')]=_[_0x610b('0x3b')](_0x28ee31['where'],{'$or':_[_0x610b('0x2a')](_0x28ee31[_0x610b('0x32')],function(_0x5bc0b1){var _0x4bc466={};_0x4bc466[_0x5bc0b1]={'$like':'%'+_0x24ddd2[_0x610b('0x2d')][_0x610b('0x3a')]+'%'};return _0x4bc466;})});}_0x28ee31=_['merge']({},_0x28ee31,_0x24ddd2[_0x610b('0x3e')]);return _0x45a5cd[_0x610b('0x4b')](_0x28ee31);}})[_0x610b('0x24')](function(_0x3eca9d){if(_0x3eca9d){_0x1b8452=_0x3eca9d[_0x610b('0x33')];if(!_0x24ddd2[_0x610b('0x2d')][_0x610b('0x4e')](_0x610b('0x34'))){_0x28ee31[_0x610b('0x1e')]=qs['limit'](_0x24ddd2[_0x610b('0x2d')][_0x610b('0x1e')]);_0x28ee31[_0x610b('0x1c')]=qs[_0x610b('0x1c')](_0x24ddd2[_0x610b('0x2d')][_0x610b('0x1c')]);}return _0x45a5cd[_0x610b('0x4b')](_0x28ee31);}})[_0x610b('0x24')](function(_0x28dade){if(_0x28dade){return _0x28dade?{'count':_0x1b8452,'rows':_0x28dade}:null;}})[_0x610b('0x24')](respondWithResult(_0x254c31,null))[_0x610b('0x47')](handleError(_0x254c31,null));};exports[_0x610b('0x4f')]=function(_0x18e736,_0x5bbc4a,_0x157c76){if(_0x18e736[_0x610b('0x49')]['id']){delete _0x18e736['body']['id'];}return db[_0x610b('0x2b')]['findOne']({'where':{'id':_0x18e736[_0x610b('0x44')]['id']}})[_0x610b('0x24')](handleEntityNotFound(_0x5bbc4a,null))[_0x610b('0x24')](function(_0x3901f7){if(_0x3901f7){_0x18e736[_0x610b('0x49')][_0x610b('0x50')]=_0x3901f7['id'];_0x18e736[_0x610b('0x49')]['Subjects']=integrations[_0x610b('0x51')](_0x18e736['body']['channel'],_0x18e736['body'][_0x610b('0x3c')]);_0x18e736[_0x610b('0x49')][_0x610b('0x52')]=integrations[_0x610b('0x53')](_0x18e736[_0x610b('0x49')][_0x610b('0x54')],_0x18e736['body']['type']);return db[_0x610b('0x4d')]['create'](_0x18e736[_0x610b('0x49')],{'include':[{'model':db[_0x610b('0x55')],'as':'Subjects'},{'model':db[_0x610b('0x55')],'as':_0x610b('0x52')}]});}return null;})['then'](respondWithResult(_0x5bbc4a,null))[_0x610b('0x47')](handleError(_0x5bbc4a,null));};var md5=require('md5');exports[_0x610b('0x56')]=function(_0x3b3a92,_0x14d7a6,_0x5114cf){var _0x1c8b50=null;var _0x3c8c88=null;var _0x225797=null;var _0x5afc44=null;var _0x873342='';return db['VtigerAccount'][_0x610b('0x4c')]({'where':{'id':_0x3b3a92['params']['id']},'attributes':['id',_0x610b('0x28'),_0x610b('0x57'),_0x610b('0x58'),_0x610b('0x59'),_0x610b('0x5a'),_0x610b('0x5b'),'accessKey']})['then'](handleEntityNotFound(_0x14d7a6,null))['then'](function(_0x4e99ba){if(_0x4e99ba){_0x1c8b50=_0x4e99ba[_0x610b('0x57')];_0x3c8c88=_0x4e99ba[_0x610b('0x5c')];_0x225797=_0x4e99ba[_0x610b('0x59')];_0x873342=_0x4e99ba[_0x610b('0x5a')];var _0x14bc2d=_0x873342[_0x610b('0x5d')](-0x1);if(_0x14bc2d==='/'){_0x873342=_0x873342['substring'](0x0,_0x873342[_0x610b('0x5e')](_0x14bc2d));}_0x5afc44=util[_0x610b('0x5f')]('%s/webservice.php',_0x873342);var _0x55b312={'method':'GET','uri':_0x5afc44,'qs':{'operation':_0x610b('0x60'),'username':_0x4e99ba[_0x610b('0x57')]},'json':!![]};return rp(_0x55b312);}})['then'](function(_0xc8e0d2){if(_0xc8e0d2[_0x610b('0x61')]){var _0x121ad6={'method':_0x610b('0x62'),'uri':_0x5afc44,'form':{'operation':_0x610b('0x63'),'username':_0x1c8b50,'accessKey':md5(_0xc8e0d2[_0x610b('0x64')]['token']+_0x3c8c88)},'json':!![]};return rp(_0x121ad6);}})['then'](function(_0x1d8c76){if(_0x1d8c76[_0x610b('0x61')]){var _0xf949cb={'method':_0x610b('0x65'),'uri':_0x5afc44,'qs':{'operation':_0x610b('0x66'),'username':_0x1c8b50,'sessionName':_0x1d8c76[_0x610b('0x64')][_0x610b('0x67')],'elementType':_0x225797},'json':!![]};return rp(_0xf949cb);}})['then'](function(_0x36c9ed){if(_0x36c9ed[_0x610b('0x61')]){var _0x207ad0=[_0x610b('0x68'),_0x610b('0x69'),_0x610b('0x6a')];_[_0x610b('0x6b')](_0x36c9ed['result'][_0x610b('0x31')],function(_0x5730a6){return _0x207ad0[_0x610b('0x6c')](_0x5730a6['type'][_0x610b('0x28')]);});_[_0x610b('0x6b')](_0x36c9ed[_0x610b('0x64')]['fields'],function(_0x55a3a9){return _0x55a3a9[_0x610b('0x6d')]==='false';});return{'count':_0x36c9ed[_0x610b('0x64')][_0x610b('0x31')][_0x610b('0x33')],'rows':_[_0x610b('0x2a')](_0x36c9ed['result']['fields'],function(_0xe0b603){return{'id':_0xe0b603[_0x610b('0x28')],'name':_0xe0b603['label'],'custom':_[_0x610b('0x6e')](_0xe0b603[_0x610b('0x28')],_0x610b('0x6f'))?!![]:![],'options':_0xe0b603[_0x610b('0x3c')][_0x610b('0x28')]===_0x610b('0x70')&&_0xe0b603['type']['picklistValues'][_0x610b('0x33')]>0x0?_[_0x610b('0x2a')](_0xe0b603[_0x610b('0x3c')][_0x610b('0x71')],function(_0x4aa7c0){return{'name':_0x4aa7c0['label'],'value':_0x4aa7c0['value']};}):[]};})};}})['then'](respondWithResult(_0x14d7a6,null))[_0x610b('0x47')](function(_0x12b533){console['log']('vTiger\x20error:\x20'+_0x12b533);var _0x42674b=_0x3b3a92[_0x610b('0x2d')][_0x610b('0x72')]?0x1f4:_0x12b533[_0x610b('0x73')]||0x1f4;logger[_0x610b('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x610b('0x56'),_0x42674b,JSON[_0x610b('0x74')](_0x12b533));delete _0x12b533['name'];if(_0x42674b===0x191){_0x42674b=0x190;}_0x14d7a6['status'](_0x42674b)[_0x610b('0x29')](_0x3b3a92[_0x610b('0x2d')]['test']?{'message':_0x610b('0x75'),'statusCode':_0x12b533['statusCode']}:_0x12b533);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index afbc375..5eac8de 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 _0xf094=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf094,0x67));var _0x4f09=function(_0x46a3ff,_0x470b9a){_0x46a3ff=_0x46a3ff-0x0;var _0x404bc2=_0xf094[_0x46a3ff];return _0x404bc2;};'use strict';var _=require(_0x4f09('0x0'));var util=require('util');var logger=require(_0x4f09('0x1'))('api');var moment=require(_0x4f09('0x2'));var BPromise=require(_0x4f09('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f09('0x4'));var rimraf=require(_0x4f09('0x5'));var config=require(_0x4f09('0x6'));var attributes=require(_0x4f09('0x7'));var integrations=require(_0x4f09('0x8'));module[_0x4f09('0x9')]=function(_0x22e68c,_0x28a033){return _0x22e68c[_0x4f09('0xa')](_0x4f09('0xb'),attributes,{'tableName':_0x4f09('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9852=['path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','moment','bluebird','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9852,0x133));var _0x2985=function(_0x1e399a,_0x351c59){_0x1e399a=_0x1e399a-0x0;var _0x539897=_0x9852[_0x1e399a];return _0x539897;};'use strict';var _=require(_0x2985('0x0'));var util=require(_0x2985('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2985('0x2'));var BPromise=require(_0x2985('0x3'));var rp=require(_0x2985('0x4'));var fs=require('fs');var path=require(_0x2985('0x5'));var rimraf=require(_0x2985('0x6'));var config=require('../../config/environment');var attributes=require(_0x2985('0x7'));var integrations=require(_0x2985('0x8'));module[_0x2985('0x9')]=function(_0xfd2a89,_0x32be8e){return _0xfd2a89[_0x2985('0xa')](_0x2985('0xb'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 1119c40..708815a 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 _0x34b7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','map','include','model','then','ShowVtigerAccount','find','moment','bluebird'];(function(_0x17577c,_0x5bc79a){var _0x551433=function(_0xcb4b47){while(--_0xcb4b47){_0x17577c['push'](_0x17577c['shift']());}};_0x551433(++_0x5bc79a);}(_0x34b7,0x196));var _0x734b=function(_0x26ed29,_0x2288f1){_0x26ed29=_0x26ed29-0x0;var _0x26182c=_0x34b7[_0x26ed29];return _0x26182c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var rs=require(_0x734b('0x2'));var fs=require('fs');var Redis=require(_0x734b('0x3'));var db=require(_0x734b('0x4'))['db'];var utils=require(_0x734b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x734b('0x6'));var jayson=require(_0x734b('0x7'));var client=jayson[_0x734b('0x8')][_0x734b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28918a,_0x35d685,_0x58e2f1){return new BPromise(function(_0x1eb803,_0x2e7932){return client['request'](_0x28918a,_0x58e2f1)['then'](function(_0x5f4b3a){logger[_0x734b('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x35d685,_0x734b('0xb'));logger[_0x734b('0xc')](_0x734b('0xd'),_0x35d685,_0x734b('0xb'),JSON[_0x734b('0xe')](_0x5f4b3a));if(_0x5f4b3a[_0x734b('0xf')]){if(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x10')]===0x1f4){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x2e7932(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}logger['error'](_0x734b('0x11'),_0x35d685,_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);return _0x1eb803(_0x5f4b3a[_0x734b('0xf')][_0x734b('0x12')]);}else{logger[_0x734b('0xa')](_0x734b('0x11'),_0x35d685,_0x734b('0xb'));_0x1eb803(_0x5f4b3a[_0x734b('0x13')][_0x734b('0x12')]);}})[_0x734b('0x14')](function(_0x4d2d23){logger[_0x734b('0xf')](_0x734b('0x11'),_0x35d685,_0x4d2d23);_0x2e7932(_0x4d2d23);});});}exports[_0x734b('0x15')]=function(_0x5edbe9){var _0x4d3b9c=this;return new Promise(function(_0x56a95c,_0xcd12a1){return db[_0x734b('0x16')][_0x734b('0x17')]({'raw':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'limit':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['limit']||null:null,'include':_0x5edbe9[_0x734b('0x18')]?_0x5edbe9[_0x734b('0x18')]['include']?_[_0x734b('0x1c')](_0x5edbe9[_0x734b('0x18')][_0x734b('0x1d')],function(_0x11fb8e){return{'model':db[_0x11fb8e[_0x734b('0x1e')]],'as':_0x11fb8e['as'],'attributes':_0x11fb8e[_0x734b('0x1b')],'include':_0x11fb8e[_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x11fb8e[_0x734b('0x1d')],function(_0x3abbe6){return{'model':db[_0x3abbe6[_0x734b('0x1e')]],'as':_0x3abbe6['as'],'attributes':_0x3abbe6[_0x734b('0x1b')],'include':_0x3abbe6[_0x734b('0x1d')]?_['map'](_0x3abbe6['include'],function(_0x13cc5a){return{'model':db[_0x13cc5a[_0x734b('0x1e')]],'as':_0x13cc5a['as'],'attributes':_0x13cc5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x734b('0x1f')](function(_0x2dd51a){logger[_0x734b('0xa')](_0x734b('0x15'),_0x5edbe9);logger[_0x734b('0xc')](_0x734b('0x15'),_0x5edbe9,JSON[_0x734b('0xe')](_0x2dd51a));_0x56a95c(_0x2dd51a);})['catch'](function(_0x1f3652){logger[_0x734b('0xf')](_0x734b('0x15'),_0x1f3652[_0x734b('0x12')],_0x5edbe9);_0xcd12a1(_0x4d3b9c[_0x734b('0xf')](0x1f4,_0x1f3652[_0x734b('0x12')]));});});};exports[_0x734b('0x20')]=function(_0x21ed3c){var _0x371ead=this;return new Promise(function(_0x3065b0,_0x5dcabf){return db[_0x734b('0x16')][_0x734b('0x21')]({'raw':_0x21ed3c['options']?_0x21ed3c[_0x734b('0x18')][_0x734b('0x19')]===undefined?!![]:![]:!![],'where':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1a')]||null:null,'attributes':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1b')]||null:null,'include':_0x21ed3c[_0x734b('0x18')]?_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')]?_[_0x734b('0x1c')](_0x21ed3c[_0x734b('0x18')][_0x734b('0x1d')],function(_0x4512fc){return{'model':db[_0x4512fc['model']],'as':_0x4512fc['as'],'attributes':_0x4512fc[_0x734b('0x1b')],'include':_0x4512fc['include']?_[_0x734b('0x1c')](_0x4512fc[_0x734b('0x1d')],function(_0x3413bf){return{'model':db[_0x3413bf[_0x734b('0x1e')]],'as':_0x3413bf['as'],'attributes':_0x3413bf[_0x734b('0x1b')],'include':_0x3413bf[_0x734b('0x1d')]?_['map'](_0x3413bf['include'],function(_0x3460a0){return{'model':db[_0x3460a0['model']],'as':_0x3460a0['as'],'attributes':_0x3460a0[_0x734b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2de959){logger['info'](_0x734b('0x20'),_0x21ed3c);logger['debug'](_0x734b('0x20'),_0x21ed3c,JSON[_0x734b('0xe')](_0x2de959));_0x3065b0(_0x2de959);})[_0x734b('0x14')](function(_0x34a504){logger[_0x734b('0xf')](_0x734b('0x20'),_0x34a504[_0x734b('0x12')],_0x21ed3c);_0x5dcabf(_0x371ead['error'](0x1f4,_0x34a504[_0x734b('0x12')]));});});}; \ No newline at end of file +var _0x0fd9=['../../config/environment','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','include','map','model','then','ShowVtigerAccount','find','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x0fd9,0xa3));var _0x90fd=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x0fd9[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require('lodash');var util=require(_0x90fd('0x0'));var moment=require(_0x90fd('0x1'));var BPromise=require(_0x90fd('0x2'));var rs=require(_0x90fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90fd('0x4'));var logger=require(_0x90fd('0x5'))(_0x90fd('0x6'));var config=require(_0x90fd('0x7'));var jayson=require(_0x90fd('0x8'));var client=jayson[_0x90fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff2d4,_0x128c17,_0x50c778){return new BPromise(function(_0x5a604a,_0x2acef7){return client[_0x90fd('0xa')](_0x4ff2d4,_0x50c778)['then'](function(_0x234ba9){logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));logger[_0x90fd('0xe')](_0x90fd('0xf'),_0x128c17,_0x90fd('0xd'),JSON[_0x90fd('0x10')](_0x234ba9));if(_0x234ba9[_0x90fd('0x11')]){if(_0x234ba9['error'][_0x90fd('0x12')]===0x1f4){logger[_0x90fd('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x2acef7(_0x234ba9[_0x90fd('0x11')]['message']);}logger[_0x90fd('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x5a604a(_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);}else{logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));_0x5a604a(_0x234ba9['result']['message']);}})[_0x90fd('0x14')](function(_0x43d804){logger['error'](_0x90fd('0xc'),_0x128c17,_0x43d804);_0x2acef7(_0x43d804);});});}exports[_0x90fd('0x15')]=function(_0x1fcc87){var _0x4d8f3b=this;return new Promise(function(_0x3f9c76,_0x16e9e3){return db[_0x90fd('0x16')][_0x90fd('0x17')]({'raw':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x19')]===undefined?!![]:![]:!![],'where':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1a')]||null:null,'attributes':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1b')]||null:null,'limit':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')]['limit']||null:null,'include':_0x1fcc87[_0x90fd('0x18')]?_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x1fcc87[_0x90fd('0x18')][_0x90fd('0x1c')],function(_0x30f67e){return{'model':db[_0x30f67e[_0x90fd('0x1e')]],'as':_0x30f67e['as'],'attributes':_0x30f67e['attributes'],'include':_0x30f67e[_0x90fd('0x1c')]?_['map'](_0x30f67e[_0x90fd('0x1c')],function(_0x18d5b3){return{'model':db[_0x18d5b3[_0x90fd('0x1e')]],'as':_0x18d5b3['as'],'attributes':_0x18d5b3[_0x90fd('0x1b')],'include':_0x18d5b3[_0x90fd('0x1c')]?_['map'](_0x18d5b3[_0x90fd('0x1c')],function(_0xe333f0){return{'model':db[_0xe333f0[_0x90fd('0x1e')]],'as':_0xe333f0['as'],'attributes':_0xe333f0[_0x90fd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x90fd('0x1f')](function(_0x428bc2){logger['info']('GetVtigerAccount',_0x1fcc87);logger[_0x90fd('0xe')](_0x90fd('0x15'),_0x1fcc87,JSON[_0x90fd('0x10')](_0x428bc2));_0x3f9c76(_0x428bc2);})[_0x90fd('0x14')](function(_0x397aaf){logger['error']('GetVtigerAccount',_0x397aaf[_0x90fd('0x13')],_0x1fcc87);_0x16e9e3(_0x4d8f3b[_0x90fd('0x11')](0x1f4,_0x397aaf[_0x90fd('0x13')]));});});};exports[_0x90fd('0x20')]=function(_0x4a3ae4){var _0x59aede=this;return new Promise(function(_0x12dea4,_0x21a9cf){return db[_0x90fd('0x16')][_0x90fd('0x21')]({'raw':_0x4a3ae4['options']?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x19')]===undefined?!![]:![]:!![],'where':_0x4a3ae4[_0x90fd('0x18')]?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1a')]||null:null,'attributes':_0x4a3ae4[_0x90fd('0x18')]?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1b')]||null:null,'include':_0x4a3ae4[_0x90fd('0x18')]?_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x4a3ae4[_0x90fd('0x18')][_0x90fd('0x1c')],function(_0x209e5c){return{'model':db[_0x209e5c[_0x90fd('0x1e')]],'as':_0x209e5c['as'],'attributes':_0x209e5c['attributes'],'include':_0x209e5c[_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x209e5c[_0x90fd('0x1c')],function(_0x3aee5){return{'model':db[_0x3aee5[_0x90fd('0x1e')]],'as':_0x3aee5['as'],'attributes':_0x3aee5[_0x90fd('0x1b')],'include':_0x3aee5[_0x90fd('0x1c')]?_[_0x90fd('0x1d')](_0x3aee5[_0x90fd('0x1c')],function(_0x186f4f){return{'model':db[_0x186f4f[_0x90fd('0x1e')]],'as':_0x186f4f['as'],'attributes':_0x186f4f[_0x90fd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x90fd('0x1f')](function(_0x4c20b0){logger[_0x90fd('0xb')](_0x90fd('0x20'),_0x4a3ae4);logger[_0x90fd('0xe')](_0x90fd('0x20'),_0x4a3ae4,JSON['stringify'](_0x4c20b0));_0x12dea4(_0x4c20b0);})[_0x90fd('0x14')](function(_0x2c4f37){logger[_0x90fd('0x11')]('ShowVtigerAccount',_0x2c4f37['message'],_0x4a3ae4);_0x21a9cf(_0x59aede[_0x90fd('0x11')](0x1f4,_0x2c4f37[_0x90fd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 6f3092e..cd69a4f 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 _0xfb58=['getSubjects','/:id/descriptions','post','/:id','update','delete','destroy','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x2ab346,_0x44470e){var _0x265324=function(_0x47fa11){while(--_0x47fa11){_0x2ab346['push'](_0x2ab346['shift']());}};_0x265324(++_0x44470e);}(_0xfb58,0x14a));var _0x8fb5=function(_0x51fa77,_0x399c57){_0x51fa77=_0x51fa77-0x0;var _0xaa7a14=_0xfb58[_0x51fa77];return _0xaa7a14;};'use strict';var multer=require('multer');var util=require(_0x8fb5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8fb5('0x1')]();var fs_extra=require(_0x8fb5('0x2'));var auth=require(_0x8fb5('0x3'));var interaction=require(_0x8fb5('0x4'));var config=require('../../config/environment');var controller=require(_0x8fb5('0x5'));router[_0x8fb5('0x6')]('/',auth[_0x8fb5('0x7')](),controller['index']);router[_0x8fb5('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x8fb5('0x8')]);router[_0x8fb5('0x6')](_0x8fb5('0x9'),auth['isAuthenticated'](),controller[_0x8fb5('0xa')]);router[_0x8fb5('0x6')](_0x8fb5('0xb'),auth[_0x8fb5('0x7')](),controller[_0x8fb5('0xc')]);router[_0x8fb5('0x6')](_0x8fb5('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x8fb5('0xe')]('/',auth[_0x8fb5('0x7')](),controller['create']);router['put'](_0x8fb5('0xf'),auth[_0x8fb5('0x7')](),controller[_0x8fb5('0x10')]);router[_0x8fb5('0x11')](_0x8fb5('0xf'),auth['isAuthenticated'](),controller[_0x8fb5('0x12')]);module['exports']=router; \ No newline at end of file +var _0x931f=['update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','index','/:id','show','isAuthenticated','getFields','getSubjects','/:id/descriptions','post','create','put'];(function(_0x40c6dd,_0x3ec665){var _0x2447a2=function(_0x31a146){while(--_0x31a146){_0x40c6dd['push'](_0x40c6dd['shift']());}};_0x2447a2(++_0x3ec665);}(_0x931f,0x15a));var _0xf931=function(_0x3077cb,_0x3af841){_0x3077cb=_0x3077cb-0x0;var _0x417717=_0x931f[_0x3077cb];return _0x417717;};'use strict';var multer=require(_0xf931('0x0'));var util=require(_0xf931('0x1'));var path=require(_0xf931('0x2'));var timeout=require(_0xf931('0x3'));var express=require(_0xf931('0x4'));var router=express[_0xf931('0x5')]();var fs_extra=require(_0xf931('0x6'));var auth=require(_0xf931('0x7'));var interaction=require(_0xf931('0x8'));var config=require(_0xf931('0x9'));var controller=require(_0xf931('0xa'));router[_0xf931('0xb')]('/',auth['isAuthenticated'](),controller[_0xf931('0xc')]);router['get'](_0xf931('0xd'),auth['isAuthenticated'](),controller[_0xf931('0xe')]);router[_0xf931('0xb')]('/:id/fields',auth[_0xf931('0xf')](),controller[_0xf931('0x10')]);router[_0xf931('0xb')]('/:id/subjects',auth[_0xf931('0xf')](),controller[_0xf931('0x11')]);router[_0xf931('0xb')](_0xf931('0x12'),auth[_0xf931('0xf')](),controller['getDescriptions']);router[_0xf931('0x13')]('/',auth[_0xf931('0xf')](),controller[_0xf931('0x14')]);router[_0xf931('0x15')](_0xf931('0xd'),auth[_0xf931('0xf')](),controller[_0xf931('0x16')]);router['delete'](_0xf931('0xd'),auth[_0xf931('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 34d6591..42d7730 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 _0xf3d7=['exports'];(function(_0x27bef0,_0x33cd9e){var _0x4ffd39=function(_0x100611){while(--_0x100611){_0x27bef0['push'](_0x27bef0['shift']());}};_0x4ffd39(++_0x33cd9e);}(_0xf3d7,0x8e));var _0x7f3d=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0xf3d7[_0x4e6eb2];return _0x4e0c1c;};'use strict';var Sequelize=require('sequelize');module[_0x7f3d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x896a=['STRING','sequelize','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x896a,0x1ed));var _0xa896=function(_0x3fe029,_0x13ea8c){_0x3fe029=_0x3fe029-0x0;var _0x5d2299=_0x896a[_0x3fe029];return _0x5d2299;};'use strict';var Sequelize=require(_0xa896('0x0'));module[_0xa896('0x1')]={'name':{'type':Sequelize[_0xa896('0x2')]},'description':{'type':Sequelize[_0xa896('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 77ac42d..2daa0f9 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 _0x4e60=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','VtigerConfiguration','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','getFields','findOne','getSubjects','VtigerField','getDescriptions','eml-format','rimraf'];(function(_0x2f4ea1,_0x19c0f5){var _0x171058=function(_0xd824f5){while(--_0xd824f5){_0x2f4ea1['push'](_0x2f4ea1['shift']());}};_0x171058(++_0x19c0f5);}(_0x4e60,0x1ea));var _0x04e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4e60[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x04e6('0x0'));var rimraf=require(_0x04e6('0x1'));var zipdir=require(_0x04e6('0x2'));var jsonpatch=require(_0x04e6('0x3'));var rp=require(_0x04e6('0x4'));var moment=require('moment');var BPromise=require(_0x04e6('0x5'));var Mustache=require(_0x04e6('0x6'));var util=require('util');var path=require(_0x04e6('0x7'));var sox=require(_0x04e6('0x8'));var csv=require(_0x04e6('0x9'));var ejs=require(_0x04e6('0xa'));var fs=require('fs');var fs_extra=require(_0x04e6('0xb'));var _=require(_0x04e6('0xc'));var squel=require(_0x04e6('0xd'));var crypto=require(_0x04e6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x04e6('0xf'));var toCsv=require(_0x04e6('0x9'));var querystring=require(_0x04e6('0x10'));var Papa=require(_0x04e6('0x11'));var Redis=require(_0x04e6('0x12'));var authService=require(_0x04e6('0x13'));var qs=require(_0x04e6('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04e6('0x15'));var logger=require(_0x04e6('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x04e6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x04e6('0x18'))['db'];function respondWithStatusCode(_0x1fe444,_0xc2697a){_0xc2697a=_0xc2697a||0xcc;return function(_0x8d9b16){if(_0x8d9b16){return _0x1fe444[_0x04e6('0x19')](_0xc2697a);}return _0x1fe444[_0x04e6('0x1a')](_0xc2697a)[_0x04e6('0x1b')]();};}function respondWithResult(_0x138c85,_0x3e66d3){_0x3e66d3=_0x3e66d3||0xc8;return function(_0x7aafd8){if(_0x7aafd8){return _0x138c85[_0x04e6('0x1a')](_0x3e66d3)['json'](_0x7aafd8);}};}function respondWithFilteredResult(_0x3bfbd7,_0x11aebd){return function(_0x38b8dd){if(_0x38b8dd){var _0x23ec6e=typeof _0x11aebd[_0x04e6('0x1c')]===_0x04e6('0x1d')&&typeof _0x11aebd['limit']===_0x04e6('0x1d');var _0x4ef8fc=_0x38b8dd[_0x04e6('0x1e')];var _0x2609f6=_0x23ec6e?0x0:_0x11aebd['offset'];var _0x77644d=_0x23ec6e?_0x38b8dd[_0x04e6('0x1e')]:_0x11aebd['offset']+_0x11aebd[_0x04e6('0x1f')];var _0x270582;if(_0x77644d>=_0x4ef8fc){_0x77644d=_0x4ef8fc;_0x270582=0xc8;}else{_0x270582=0xce;}_0x3bfbd7['status'](_0x270582);return _0x3bfbd7[_0x04e6('0x20')]('Content-Range',_0x2609f6+'-'+_0x77644d+'/'+_0x4ef8fc)['json'](_0x38b8dd);}return null;};}function patchUpdates(_0x5ce29c){return function(_0x19e3fc){try{jsonpatch[_0x04e6('0x21')](_0x19e3fc,_0x5ce29c,!![]);}catch(_0x56a1bd){return BPromise[_0x04e6('0x22')](_0x56a1bd);}return _0x19e3fc[_0x04e6('0x23')]();};}function saveUpdates(_0x3cbf3c,_0x11ac72){return function(_0x4f280f){if(_0x4f280f){return _0x4f280f[_0x04e6('0x24')](_0x3cbf3c)[_0x04e6('0x25')](function(_0xdba4a7){return _0xdba4a7;});}return null;};}function removeEntity(_0x2253f4,_0x11e6b2){return function(_0x43a5e7){if(_0x43a5e7){return _0x43a5e7[_0x04e6('0x26')]()[_0x04e6('0x25')](function(){_0x2253f4[_0x04e6('0x1a')](0xcc)[_0x04e6('0x1b')]();});}};}function handleEntityNotFound(_0x1eb292,_0x259332){return function(_0x1fef71){if(!_0x1fef71){_0x1eb292['sendStatus'](0x194);}return _0x1fef71;};}function handleError(_0x425858,_0x4845b8){_0x4845b8=_0x4845b8||0x1f4;return function(_0x230f4b){logger[_0x04e6('0x27')](_0x230f4b[_0x04e6('0x28')]);if(_0x230f4b['name']){delete _0x230f4b['name'];}_0x425858[_0x04e6('0x1a')](_0x4845b8)[_0x04e6('0x29')](_0x230f4b);};}exports[_0x04e6('0x2a')]=function(_0x30eadf,_0x3a9353){var _0x529ea3={},_0x27c623={},_0x16efd1={'count':0x0,'rows':[]};var _0x363121=_[_0x04e6('0x2b')](db['VtigerConfiguration']['rawAttributes'],function(_0x36e28d){return{'name':_0x36e28d[_0x04e6('0x2c')],'type':_0x36e28d[_0x04e6('0x2d')][_0x04e6('0x2e')]};});_0x27c623[_0x04e6('0x2f')]=_[_0x04e6('0x2b')](_0x363121,'name');_0x27c623[_0x04e6('0x30')]=_[_0x04e6('0x31')](_0x30eadf[_0x04e6('0x30')]);_0x27c623[_0x04e6('0x32')]=_[_0x04e6('0x33')](_0x27c623[_0x04e6('0x2f')],_0x27c623['query']);_0x529ea3[_0x04e6('0x34')]=_[_0x04e6('0x33')](_0x27c623[_0x04e6('0x2f')],qs[_0x04e6('0x35')](_0x30eadf['query'][_0x04e6('0x35')]));_0x529ea3[_0x04e6('0x34')]=_0x529ea3['attributes'][_0x04e6('0x36')]?_0x529ea3['attributes']:_0x27c623['model'];if(!_0x30eadf['query'][_0x04e6('0x37')](_0x04e6('0x38'))){_0x529ea3[_0x04e6('0x1f')]=qs[_0x04e6('0x1f')](_0x30eadf[_0x04e6('0x30')]['limit']);_0x529ea3[_0x04e6('0x1c')]=qs['offset'](_0x30eadf[_0x04e6('0x30')][_0x04e6('0x1c')]);}_0x529ea3[_0x04e6('0x39')]=qs['sort'](_0x30eadf[_0x04e6('0x30')][_0x04e6('0x3a')]);_0x529ea3['where']=qs[_0x04e6('0x32')](_[_0x04e6('0x3b')](_0x30eadf[_0x04e6('0x30')],_0x27c623[_0x04e6('0x32')]),_0x363121);if(_0x30eadf[_0x04e6('0x30')][_0x04e6('0x3c')]){_0x529ea3[_0x04e6('0x3d')]=_[_0x04e6('0x3e')](_0x529ea3['where'],{'$or':_['map'](_0x363121,function(_0x686565){if(_0x686565[_0x04e6('0x2d')]!==_0x04e6('0x3f')){var _0x5aef72={};_0x5aef72[_0x686565['name']]={'$like':'%'+_0x30eadf[_0x04e6('0x30')][_0x04e6('0x3c')]+'%'};return _0x5aef72;}})});}_0x529ea3=_['merge']({},_0x529ea3,_0x30eadf['options']);var _0x507596={'where':_0x529ea3[_0x04e6('0x3d')]};return db[_0x04e6('0x40')][_0x04e6('0x1e')](_0x507596)[_0x04e6('0x25')](function(_0x14f289){_0x16efd1[_0x04e6('0x1e')]=_0x14f289;if(_0x30eadf[_0x04e6('0x30')]['includeAll']){_0x529ea3[_0x04e6('0x41')]=[{'all':!![]}];}return db[_0x04e6('0x40')][_0x04e6('0x42')](_0x529ea3);})['then'](function(_0x3c1dc4){_0x16efd1[_0x04e6('0x43')]=_0x3c1dc4;return _0x16efd1;})[_0x04e6('0x25')](respondWithFilteredResult(_0x3a9353,_0x529ea3))[_0x04e6('0x44')](handleError(_0x3a9353,null));};exports[_0x04e6('0x45')]=function(_0x40d6ec,_0x1f4a3f){var _0x49326d={'raw':![],'where':{'id':_0x40d6ec[_0x04e6('0x46')]['id']}},_0x1630f4={};_0x1630f4[_0x04e6('0x2f')]=_[_0x04e6('0x31')](db[_0x04e6('0x40')][_0x04e6('0x47')]);_0x1630f4[_0x04e6('0x30')]=_[_0x04e6('0x31')](_0x40d6ec['query']);_0x1630f4[_0x04e6('0x32')]=_[_0x04e6('0x33')](_0x1630f4[_0x04e6('0x2f')],_0x1630f4[_0x04e6('0x30')]);_0x49326d[_0x04e6('0x34')]=_[_0x04e6('0x33')](_0x1630f4['model'],qs[_0x04e6('0x35')](_0x40d6ec[_0x04e6('0x30')][_0x04e6('0x35')]));_0x49326d[_0x04e6('0x34')]=_0x49326d[_0x04e6('0x34')][_0x04e6('0x36')]?_0x49326d[_0x04e6('0x34')]:_0x1630f4['model'];if(_0x40d6ec[_0x04e6('0x30')][_0x04e6('0x48')]){_0x49326d['include']=[{'all':!![]}];}_0x49326d=_['merge']({},_0x49326d,_0x40d6ec[_0x04e6('0x49')]);return db[_0x04e6('0x40')][_0x04e6('0x4a')](_0x49326d)[_0x04e6('0x25')](handleEntityNotFound(_0x1f4a3f,null))['then'](respondWithResult(_0x1f4a3f,null))['catch'](handleError(_0x1f4a3f,null));};exports['create']=function(_0x5cb57e,_0x5856db){return db[_0x04e6('0x40')][_0x04e6('0x4b')](_0x5cb57e[_0x04e6('0x4c')],{})[_0x04e6('0x25')](respondWithResult(_0x5856db,0xc9))[_0x04e6('0x44')](handleError(_0x5856db,null));};exports[_0x04e6('0x24')]=function(_0x3db07a,_0x139ebc){if(_0x3db07a[_0x04e6('0x4c')]['id']){delete _0x3db07a[_0x04e6('0x4c')]['id'];}return db[_0x04e6('0x40')][_0x04e6('0x4a')]({'where':{'id':_0x3db07a[_0x04e6('0x46')]['id']}})['then'](handleEntityNotFound(_0x139ebc,null))[_0x04e6('0x25')](saveUpdates(_0x3db07a['body'],null))[_0x04e6('0x25')](respondWithResult(_0x139ebc,null))['catch'](handleError(_0x139ebc,null));};exports[_0x04e6('0x26')]=function(_0x2c4d7d,_0x28e8bf){return db['VtigerConfiguration'][_0x04e6('0x4a')]({'where':{'id':_0x2c4d7d['params']['id']}})[_0x04e6('0x25')](handleEntityNotFound(_0x28e8bf,null))[_0x04e6('0x25')](removeEntity(_0x28e8bf,null))['catch'](handleError(_0x28e8bf,null));};exports[_0x04e6('0x4d')]=function(_0x430af9,_0x40c8de,_0x51c95c){var _0x36c10f={};var _0x4f7499={};var _0x1fe5ac;var _0x2d8eae;return db[_0x04e6('0x40')][_0x04e6('0x4e')]({'where':{'id':_0x430af9[_0x04e6('0x46')]['id']}})[_0x04e6('0x25')](handleEntityNotFound(_0x40c8de,null))['then'](function(_0x45f253){if(_0x45f253){_0x1fe5ac=_0x45f253;_0x4f7499[_0x04e6('0x2f')]=_['keys'](db['VtigerField'][_0x04e6('0x47')]);_0x4f7499[_0x04e6('0x30')]=_[_0x04e6('0x31')](_0x430af9[_0x04e6('0x30')]);_0x4f7499[_0x04e6('0x32')]=_[_0x04e6('0x33')](_0x4f7499[_0x04e6('0x2f')],_0x4f7499[_0x04e6('0x30')]);_0x36c10f['attributes']=_[_0x04e6('0x33')](_0x4f7499['model'],qs[_0x04e6('0x35')](_0x430af9['query'][_0x04e6('0x35')]));_0x36c10f['attributes']=_0x36c10f[_0x04e6('0x34')][_0x04e6('0x36')]?_0x36c10f[_0x04e6('0x34')]:_0x4f7499[_0x04e6('0x2f')];_0x36c10f[_0x04e6('0x39')]=qs[_0x04e6('0x3a')](_0x430af9[_0x04e6('0x30')][_0x04e6('0x3a')]);_0x36c10f[_0x04e6('0x3d')]=qs['filters'](_[_0x04e6('0x3b')](_0x430af9[_0x04e6('0x30')],_0x4f7499['filters']));if(_0x430af9[_0x04e6('0x30')][_0x04e6('0x3c')]){_0x36c10f['where']=_['merge'](_0x36c10f[_0x04e6('0x3d')],{'$or':_[_0x04e6('0x2b')](_0x36c10f[_0x04e6('0x34')],function(_0x26d607){var _0x3f3758={};_0x3f3758[_0x26d607]={'$like':'%'+_0x430af9[_0x04e6('0x30')][_0x04e6('0x3c')]+'%'};return _0x3f3758;})});}_0x36c10f=_[_0x04e6('0x3e')]({},_0x36c10f,_0x430af9[_0x04e6('0x49')]);return _0x1fe5ac['getFields'](_0x36c10f);}})[_0x04e6('0x25')](function(_0x5948c2){if(_0x5948c2){_0x2d8eae=_0x5948c2[_0x04e6('0x36')];if(!_0x430af9[_0x04e6('0x30')]['hasOwnProperty'](_0x04e6('0x38'))){_0x36c10f['limit']=qs['limit'](_0x430af9[_0x04e6('0x30')][_0x04e6('0x1f')]);_0x36c10f[_0x04e6('0x1c')]=qs[_0x04e6('0x1c')](_0x430af9[_0x04e6('0x30')][_0x04e6('0x1c')]);}return _0x1fe5ac[_0x04e6('0x4d')](_0x36c10f);}})[_0x04e6('0x25')](function(_0x2916ea){if(_0x2916ea){return _0x2916ea?{'count':_0x2d8eae,'rows':_0x2916ea}:null;}})[_0x04e6('0x25')](respondWithResult(_0x40c8de,null))[_0x04e6('0x44')](handleError(_0x40c8de,null));};exports[_0x04e6('0x4f')]=function(_0x16cfac,_0x44afde,_0x3d5868){var _0xb1a141={};var _0x56742f={};var _0x4ba5df;var _0xf0aec9;return db['VtigerConfiguration'][_0x04e6('0x4e')]({'where':{'id':_0x16cfac[_0x04e6('0x46')]['id']}})[_0x04e6('0x25')](handleEntityNotFound(_0x44afde,null))[_0x04e6('0x25')](function(_0x2e017d){if(_0x2e017d){_0x4ba5df=_0x2e017d;_0x56742f['model']=_[_0x04e6('0x31')](db['VtigerField'][_0x04e6('0x47')]);_0x56742f[_0x04e6('0x30')]=_['keys'](_0x16cfac['query']);_0x56742f['filters']=_['intersection'](_0x56742f[_0x04e6('0x2f')],_0x56742f['query']);_0xb1a141['attributes']=_[_0x04e6('0x33')](_0x56742f[_0x04e6('0x2f')],qs['fields'](_0x16cfac[_0x04e6('0x30')][_0x04e6('0x35')]));_0xb1a141[_0x04e6('0x34')]=_0xb1a141[_0x04e6('0x34')][_0x04e6('0x36')]?_0xb1a141[_0x04e6('0x34')]:_0x56742f[_0x04e6('0x2f')];_0xb1a141['order']=qs[_0x04e6('0x3a')](_0x16cfac[_0x04e6('0x30')][_0x04e6('0x3a')]);_0xb1a141[_0x04e6('0x3d')]=qs[_0x04e6('0x32')](_[_0x04e6('0x3b')](_0x16cfac[_0x04e6('0x30')],_0x56742f['filters']));if(_0x16cfac[_0x04e6('0x30')][_0x04e6('0x3c')]){_0xb1a141[_0x04e6('0x3d')]=_[_0x04e6('0x3e')](_0xb1a141[_0x04e6('0x3d')],{'$or':_[_0x04e6('0x2b')](_0xb1a141[_0x04e6('0x34')],function(_0x2e463a){var _0x373e22={};_0x373e22[_0x2e463a]={'$like':'%'+_0x16cfac[_0x04e6('0x30')]['filter']+'%'};return _0x373e22;})});}_0xb1a141=_[_0x04e6('0x3e')]({},_0xb1a141,_0x16cfac[_0x04e6('0x49')]);return _0x4ba5df[_0x04e6('0x4f')](_0xb1a141);}})[_0x04e6('0x25')](function(_0x1ce973){if(_0x1ce973){_0xf0aec9=_0x1ce973[_0x04e6('0x36')];if(!_0x16cfac[_0x04e6('0x30')]['hasOwnProperty'](_0x04e6('0x38'))){_0xb1a141['limit']=qs[_0x04e6('0x1f')](_0x16cfac[_0x04e6('0x30')]['limit']);_0xb1a141[_0x04e6('0x1c')]=qs[_0x04e6('0x1c')](_0x16cfac[_0x04e6('0x30')]['offset']);}return _0x4ba5df[_0x04e6('0x4f')](_0xb1a141);}})[_0x04e6('0x25')](function(_0x1c189f){if(_0x1c189f){return _0x1c189f?{'count':_0xf0aec9,'rows':_0x1c189f}:null;}})['then'](respondWithResult(_0x44afde,null))['catch'](handleError(_0x44afde,null));};exports['getDescriptions']=function(_0x5363ad,_0xb140b0,_0x51e1bb){var _0x5c1aaa={};var _0x212275={};var _0x56f81e;var _0x441260;return db[_0x04e6('0x40')][_0x04e6('0x4e')]({'where':{'id':_0x5363ad[_0x04e6('0x46')]['id']}})[_0x04e6('0x25')](handleEntityNotFound(_0xb140b0,null))[_0x04e6('0x25')](function(_0x1e6bf4){if(_0x1e6bf4){_0x56f81e=_0x1e6bf4;_0x212275[_0x04e6('0x2f')]=_[_0x04e6('0x31')](db[_0x04e6('0x50')]['rawAttributes']);_0x212275[_0x04e6('0x30')]=_['keys'](_0x5363ad[_0x04e6('0x30')]);_0x212275['filters']=_['intersection'](_0x212275[_0x04e6('0x2f')],_0x212275[_0x04e6('0x30')]);_0x5c1aaa[_0x04e6('0x34')]=_[_0x04e6('0x33')](_0x212275[_0x04e6('0x2f')],qs[_0x04e6('0x35')](_0x5363ad[_0x04e6('0x30')][_0x04e6('0x35')]));_0x5c1aaa[_0x04e6('0x34')]=_0x5c1aaa[_0x04e6('0x34')][_0x04e6('0x36')]?_0x5c1aaa[_0x04e6('0x34')]:_0x212275[_0x04e6('0x2f')];_0x5c1aaa[_0x04e6('0x39')]=qs['sort'](_0x5363ad[_0x04e6('0x30')][_0x04e6('0x3a')]);_0x5c1aaa[_0x04e6('0x3d')]=qs[_0x04e6('0x32')](_[_0x04e6('0x3b')](_0x5363ad[_0x04e6('0x30')],_0x212275[_0x04e6('0x32')]));if(_0x5363ad[_0x04e6('0x30')][_0x04e6('0x3c')]){_0x5c1aaa['where']=_[_0x04e6('0x3e')](_0x5c1aaa['where'],{'$or':_[_0x04e6('0x2b')](_0x5c1aaa['attributes'],function(_0x12c12b){var _0x2a9182={};_0x2a9182[_0x12c12b]={'$like':'%'+_0x5363ad[_0x04e6('0x30')][_0x04e6('0x3c')]+'%'};return _0x2a9182;})});}_0x5c1aaa=_['merge']({},_0x5c1aaa,_0x5363ad[_0x04e6('0x49')]);return _0x56f81e[_0x04e6('0x51')](_0x5c1aaa);}})[_0x04e6('0x25')](function(_0x586286){if(_0x586286){_0x441260=_0x586286['length'];if(!_0x5363ad[_0x04e6('0x30')][_0x04e6('0x37')](_0x04e6('0x38'))){_0x5c1aaa[_0x04e6('0x1f')]=qs['limit'](_0x5363ad[_0x04e6('0x30')][_0x04e6('0x1f')]);_0x5c1aaa[_0x04e6('0x1c')]=qs[_0x04e6('0x1c')](_0x5363ad[_0x04e6('0x30')][_0x04e6('0x1c')]);}return _0x56f81e[_0x04e6('0x51')](_0x5c1aaa);}})['then'](function(_0x39dbdc){if(_0x39dbdc){return _0x39dbdc?{'count':_0x441260,'rows':_0x39dbdc}:null;}})['then'](respondWithResult(_0xb140b0,null))[_0x04e6('0x44')](handleError(_0xb140b0,null));}; \ No newline at end of file +var _0xa25b=['fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','VtigerConfiguration','findAll','includeAll','options','find','catch','create','body','params','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','eml-format','rimraf'];(function(_0x251565,_0x2a1965){var _0x502a69=function(_0x30ed71){while(--_0x30ed71){_0x251565['push'](_0x251565['shift']());}};_0x502a69(++_0x2a1965);}(_0xa25b,0x170));var _0xba25=function(_0x70eb68,_0x326154){_0x70eb68=_0x70eb68-0x0;var _0x4024b3=_0xa25b[_0x70eb68];return _0x4024b3;};'use strict';var emlformat=require(_0xba25('0x0'));var rimraf=require(_0xba25('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xba25('0x2'));var rp=require('request-promise');var moment=require(_0xba25('0x3'));var BPromise=require(_0xba25('0x4'));var Mustache=require(_0xba25('0x5'));var util=require(_0xba25('0x6'));var path=require('path');var sox=require(_0xba25('0x7'));var csv=require(_0xba25('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xba25('0x9'));var _=require(_0xba25('0xa'));var squel=require(_0xba25('0xb'));var crypto=require(_0xba25('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xba25('0x8'));var querystring=require(_0xba25('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xba25('0xe'));var qs=require(_0xba25('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba25('0x10'));var logger=require(_0xba25('0x11'))(_0xba25('0x12'));var utils=require(_0xba25('0x13'));var config=require(_0xba25('0x14'));var licenseUtil=require(_0xba25('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb3edb4,_0x1b24e2){_0x1b24e2=_0x1b24e2||0xcc;return function(_0x7bb6c6){if(_0x7bb6c6){return _0xb3edb4[_0xba25('0x16')](_0x1b24e2);}return _0xb3edb4[_0xba25('0x17')](_0x1b24e2)[_0xba25('0x18')]();};}function respondWithResult(_0x177a1c,_0xb2b04b){_0xb2b04b=_0xb2b04b||0xc8;return function(_0xf018fa){if(_0xf018fa){return _0x177a1c[_0xba25('0x17')](_0xb2b04b)[_0xba25('0x19')](_0xf018fa);}};}function respondWithFilteredResult(_0x508e45,_0xe0d90f){return function(_0x4bb993){if(_0x4bb993){var _0x1b0a2e=typeof _0xe0d90f['offset']==='undefined'&&typeof _0xe0d90f[_0xba25('0x1a')]==='undefined';var _0x32fba5=_0x4bb993[_0xba25('0x1b')];var _0x12e841=_0x1b0a2e?0x0:_0xe0d90f[_0xba25('0x1c')];var _0x102c45=_0x1b0a2e?_0x4bb993[_0xba25('0x1b')]:_0xe0d90f[_0xba25('0x1c')]+_0xe0d90f[_0xba25('0x1a')];var _0x13503b;if(_0x102c45>=_0x32fba5){_0x102c45=_0x32fba5;_0x13503b=0xc8;}else{_0x13503b=0xce;}_0x508e45[_0xba25('0x17')](_0x13503b);return _0x508e45[_0xba25('0x1d')](_0xba25('0x1e'),_0x12e841+'-'+_0x102c45+'/'+_0x32fba5)[_0xba25('0x19')](_0x4bb993);}return null;};}function patchUpdates(_0x10ac9a){return function(_0x5281cd){try{jsonpatch['apply'](_0x5281cd,_0x10ac9a,!![]);}catch(_0x2df31c){return BPromise[_0xba25('0x1f')](_0x2df31c);}return _0x5281cd['save']();};}function saveUpdates(_0x4486f1,_0x1d511f){return function(_0x5061bf){if(_0x5061bf){return _0x5061bf[_0xba25('0x20')](_0x4486f1)[_0xba25('0x21')](function(_0xea430e){return _0xea430e;});}return null;};}function removeEntity(_0x3827d5,_0x4638b8){return function(_0x30e4a3){if(_0x30e4a3){return _0x30e4a3[_0xba25('0x22')]()[_0xba25('0x21')](function(){_0x3827d5[_0xba25('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x279669,_0x3394f4){return function(_0x136d97){if(!_0x136d97){_0x279669[_0xba25('0x16')](0x194);}return _0x136d97;};}function handleError(_0x374551,_0x3a454f){_0x3a454f=_0x3a454f||0x1f4;return function(_0x21e47a){logger[_0xba25('0x23')](_0x21e47a[_0xba25('0x24')]);if(_0x21e47a[_0xba25('0x25')]){delete _0x21e47a['name'];}_0x374551[_0xba25('0x17')](_0x3a454f)['send'](_0x21e47a);};}exports[_0xba25('0x26')]=function(_0x34137d,_0x4b0d23){var _0x4242cb={},_0x41737e={},_0x241ed3={'count':0x0,'rows':[]};var _0x2193df=_[_0xba25('0x27')](db['VtigerConfiguration'][_0xba25('0x28')],function(_0x52d19b){return{'name':_0x52d19b[_0xba25('0x29')],'type':_0x52d19b[_0xba25('0x2a')]['key']};});_0x41737e['model']=_['map'](_0x2193df,_0xba25('0x25'));_0x41737e['query']=_[_0xba25('0x2b')](_0x34137d[_0xba25('0x2c')]);_0x41737e[_0xba25('0x2d')]=_[_0xba25('0x2e')](_0x41737e['model'],_0x41737e['query']);_0x4242cb[_0xba25('0x2f')]=_[_0xba25('0x2e')](_0x41737e[_0xba25('0x30')],qs[_0xba25('0x31')](_0x34137d[_0xba25('0x2c')][_0xba25('0x31')]));_0x4242cb[_0xba25('0x2f')]=_0x4242cb[_0xba25('0x2f')][_0xba25('0x32')]?_0x4242cb[_0xba25('0x2f')]:_0x41737e[_0xba25('0x30')];if(!_0x34137d[_0xba25('0x2c')][_0xba25('0x33')](_0xba25('0x34'))){_0x4242cb[_0xba25('0x1a')]=qs['limit'](_0x34137d[_0xba25('0x2c')][_0xba25('0x1a')]);_0x4242cb[_0xba25('0x1c')]=qs[_0xba25('0x1c')](_0x34137d[_0xba25('0x2c')][_0xba25('0x1c')]);}_0x4242cb['order']=qs[_0xba25('0x35')](_0x34137d[_0xba25('0x2c')][_0xba25('0x35')]);_0x4242cb[_0xba25('0x36')]=qs['filters'](_[_0xba25('0x37')](_0x34137d['query'],_0x41737e['filters']),_0x2193df);if(_0x34137d[_0xba25('0x2c')][_0xba25('0x38')]){_0x4242cb[_0xba25('0x36')]=_[_0xba25('0x39')](_0x4242cb['where'],{'$or':_['map'](_0x2193df,function(_0x396a0f){if(_0x396a0f[_0xba25('0x2a')]!==_0xba25('0x3a')){var _0x2c5872={};_0x2c5872[_0x396a0f[_0xba25('0x25')]]={'$like':'%'+_0x34137d[_0xba25('0x2c')][_0xba25('0x38')]+'%'};return _0x2c5872;}})});}_0x4242cb=_['merge']({},_0x4242cb,_0x34137d['options']);var _0x215b46={'where':_0x4242cb[_0xba25('0x36')]};return db[_0xba25('0x3b')]['count'](_0x215b46)[_0xba25('0x21')](function(_0x293ce4){_0x241ed3[_0xba25('0x1b')]=_0x293ce4;if(_0x34137d[_0xba25('0x2c')]['includeAll']){_0x4242cb['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xba25('0x3c')](_0x4242cb);})['then'](function(_0x32d2ba){_0x241ed3['rows']=_0x32d2ba;return _0x241ed3;})[_0xba25('0x21')](respondWithFilteredResult(_0x4b0d23,_0x4242cb))['catch'](handleError(_0x4b0d23,null));};exports['show']=function(_0x1b04cf,_0x466007){var _0x39dd96={'raw':![],'where':{'id':_0x1b04cf['params']['id']}},_0x12d46c={};_0x12d46c[_0xba25('0x30')]=_[_0xba25('0x2b')](db[_0xba25('0x3b')][_0xba25('0x28')]);_0x12d46c[_0xba25('0x2c')]=_[_0xba25('0x2b')](_0x1b04cf[_0xba25('0x2c')]);_0x12d46c[_0xba25('0x2d')]=_[_0xba25('0x2e')](_0x12d46c[_0xba25('0x30')],_0x12d46c[_0xba25('0x2c')]);_0x39dd96[_0xba25('0x2f')]=_[_0xba25('0x2e')](_0x12d46c[_0xba25('0x30')],qs[_0xba25('0x31')](_0x1b04cf['query'][_0xba25('0x31')]));_0x39dd96['attributes']=_0x39dd96[_0xba25('0x2f')][_0xba25('0x32')]?_0x39dd96[_0xba25('0x2f')]:_0x12d46c[_0xba25('0x30')];if(_0x1b04cf[_0xba25('0x2c')][_0xba25('0x3d')]){_0x39dd96['include']=[{'all':!![]}];}_0x39dd96=_[_0xba25('0x39')]({},_0x39dd96,_0x1b04cf[_0xba25('0x3e')]);return db[_0xba25('0x3b')][_0xba25('0x3f')](_0x39dd96)['then'](handleEntityNotFound(_0x466007,null))[_0xba25('0x21')](respondWithResult(_0x466007,null))[_0xba25('0x40')](handleError(_0x466007,null));};exports[_0xba25('0x41')]=function(_0x1a1513,_0x51384d){return db[_0xba25('0x3b')][_0xba25('0x41')](_0x1a1513[_0xba25('0x42')],{})['then'](respondWithResult(_0x51384d,0xc9))[_0xba25('0x40')](handleError(_0x51384d,null));};exports['update']=function(_0x3b9c64,_0x43226c){if(_0x3b9c64[_0xba25('0x42')]['id']){delete _0x3b9c64['body']['id'];}return db[_0xba25('0x3b')][_0xba25('0x3f')]({'where':{'id':_0x3b9c64[_0xba25('0x43')]['id']}})[_0xba25('0x21')](handleEntityNotFound(_0x43226c,null))['then'](saveUpdates(_0x3b9c64['body'],null))[_0xba25('0x21')](respondWithResult(_0x43226c,null))['catch'](handleError(_0x43226c,null));};exports[_0xba25('0x22')]=function(_0x5600fe,_0x5226b6){return db[_0xba25('0x3b')][_0xba25('0x3f')]({'where':{'id':_0x5600fe[_0xba25('0x43')]['id']}})['then'](handleEntityNotFound(_0x5226b6,null))[_0xba25('0x21')](removeEntity(_0x5226b6,null))[_0xba25('0x40')](handleError(_0x5226b6,null));};exports[_0xba25('0x44')]=function(_0x2ed244,_0x556a91,_0x20a4a1){var _0x4169cd={};var _0x5d9909={};var _0x5f08f3;var _0x35659c;return db[_0xba25('0x3b')][_0xba25('0x45')]({'where':{'id':_0x2ed244[_0xba25('0x43')]['id']}})[_0xba25('0x21')](handleEntityNotFound(_0x556a91,null))['then'](function(_0x3a00d5){if(_0x3a00d5){_0x5f08f3=_0x3a00d5;_0x5d9909[_0xba25('0x30')]=_[_0xba25('0x2b')](db[_0xba25('0x46')]['rawAttributes']);_0x5d9909[_0xba25('0x2c')]=_[_0xba25('0x2b')](_0x2ed244[_0xba25('0x2c')]);_0x5d9909[_0xba25('0x2d')]=_[_0xba25('0x2e')](_0x5d9909[_0xba25('0x30')],_0x5d9909[_0xba25('0x2c')]);_0x4169cd[_0xba25('0x2f')]=_['intersection'](_0x5d9909['model'],qs[_0xba25('0x31')](_0x2ed244['query']['fields']));_0x4169cd['attributes']=_0x4169cd[_0xba25('0x2f')][_0xba25('0x32')]?_0x4169cd[_0xba25('0x2f')]:_0x5d9909[_0xba25('0x30')];_0x4169cd[_0xba25('0x47')]=qs[_0xba25('0x35')](_0x2ed244[_0xba25('0x2c')][_0xba25('0x35')]);_0x4169cd['where']=qs[_0xba25('0x2d')](_['pick'](_0x2ed244['query'],_0x5d9909[_0xba25('0x2d')]));if(_0x2ed244[_0xba25('0x2c')][_0xba25('0x38')]){_0x4169cd[_0xba25('0x36')]=_[_0xba25('0x39')](_0x4169cd['where'],{'$or':_[_0xba25('0x27')](_0x4169cd[_0xba25('0x2f')],function(_0x1b1f5d){var _0x3ca415={};_0x3ca415[_0x1b1f5d]={'$like':'%'+_0x2ed244['query']['filter']+'%'};return _0x3ca415;})});}_0x4169cd=_['merge']({},_0x4169cd,_0x2ed244[_0xba25('0x3e')]);return _0x5f08f3[_0xba25('0x44')](_0x4169cd);}})[_0xba25('0x21')](function(_0x7ed6a5){if(_0x7ed6a5){_0x35659c=_0x7ed6a5[_0xba25('0x32')];if(!_0x2ed244[_0xba25('0x2c')][_0xba25('0x33')](_0xba25('0x34'))){_0x4169cd[_0xba25('0x1a')]=qs['limit'](_0x2ed244[_0xba25('0x2c')][_0xba25('0x1a')]);_0x4169cd[_0xba25('0x1c')]=qs[_0xba25('0x1c')](_0x2ed244[_0xba25('0x2c')]['offset']);}return _0x5f08f3[_0xba25('0x44')](_0x4169cd);}})[_0xba25('0x21')](function(_0x40abc4){if(_0x40abc4){return _0x40abc4?{'count':_0x35659c,'rows':_0x40abc4}:null;}})[_0xba25('0x21')](respondWithResult(_0x556a91,null))[_0xba25('0x40')](handleError(_0x556a91,null));};exports[_0xba25('0x48')]=function(_0x40688b,_0x26ac6b,_0xd3e0e2){var _0x246ccd={};var _0x281ec3={};var _0x50a9d9;var _0x3c36fe;return db[_0xba25('0x3b')]['findOne']({'where':{'id':_0x40688b[_0xba25('0x43')]['id']}})[_0xba25('0x21')](handleEntityNotFound(_0x26ac6b,null))[_0xba25('0x21')](function(_0x9d8a4d){if(_0x9d8a4d){_0x50a9d9=_0x9d8a4d;_0x281ec3[_0xba25('0x30')]=_['keys'](db[_0xba25('0x46')]['rawAttributes']);_0x281ec3['query']=_[_0xba25('0x2b')](_0x40688b[_0xba25('0x2c')]);_0x281ec3['filters']=_[_0xba25('0x2e')](_0x281ec3['model'],_0x281ec3[_0xba25('0x2c')]);_0x246ccd['attributes']=_[_0xba25('0x2e')](_0x281ec3[_0xba25('0x30')],qs[_0xba25('0x31')](_0x40688b[_0xba25('0x2c')]['fields']));_0x246ccd[_0xba25('0x2f')]=_0x246ccd['attributes'][_0xba25('0x32')]?_0x246ccd[_0xba25('0x2f')]:_0x281ec3[_0xba25('0x30')];_0x246ccd[_0xba25('0x47')]=qs[_0xba25('0x35')](_0x40688b[_0xba25('0x2c')][_0xba25('0x35')]);_0x246ccd[_0xba25('0x36')]=qs[_0xba25('0x2d')](_['pick'](_0x40688b[_0xba25('0x2c')],_0x281ec3[_0xba25('0x2d')]));if(_0x40688b[_0xba25('0x2c')][_0xba25('0x38')]){_0x246ccd[_0xba25('0x36')]=_[_0xba25('0x39')](_0x246ccd[_0xba25('0x36')],{'$or':_[_0xba25('0x27')](_0x246ccd[_0xba25('0x2f')],function(_0x27fa58){var _0x9f9c01={};_0x9f9c01[_0x27fa58]={'$like':'%'+_0x40688b['query']['filter']+'%'};return _0x9f9c01;})});}_0x246ccd=_['merge']({},_0x246ccd,_0x40688b[_0xba25('0x3e')]);return _0x50a9d9[_0xba25('0x48')](_0x246ccd);}})[_0xba25('0x21')](function(_0x47a7d8){if(_0x47a7d8){_0x3c36fe=_0x47a7d8[_0xba25('0x32')];if(!_0x40688b[_0xba25('0x2c')]['hasOwnProperty'](_0xba25('0x34'))){_0x246ccd[_0xba25('0x1a')]=qs[_0xba25('0x1a')](_0x40688b[_0xba25('0x2c')][_0xba25('0x1a')]);_0x246ccd[_0xba25('0x1c')]=qs[_0xba25('0x1c')](_0x40688b['query'][_0xba25('0x1c')]);}return _0x50a9d9['getSubjects'](_0x246ccd);}})['then'](function(_0x465907){if(_0x465907){return _0x465907?{'count':_0x3c36fe,'rows':_0x465907}:null;}})[_0xba25('0x21')](respondWithResult(_0x26ac6b,null))[_0xba25('0x40')](handleError(_0x26ac6b,null));};exports[_0xba25('0x49')]=function(_0x2f71c8,_0x442512,_0xc9b453){var _0x236959={};var _0x173552={};var _0xb00aed;var _0x3f8052;return db[_0xba25('0x3b')][_0xba25('0x45')]({'where':{'id':_0x2f71c8[_0xba25('0x43')]['id']}})['then'](handleEntityNotFound(_0x442512,null))['then'](function(_0x44f1ab){if(_0x44f1ab){_0xb00aed=_0x44f1ab;_0x173552[_0xba25('0x30')]=_[_0xba25('0x2b')](db[_0xba25('0x46')][_0xba25('0x28')]);_0x173552[_0xba25('0x2c')]=_[_0xba25('0x2b')](_0x2f71c8[_0xba25('0x2c')]);_0x173552[_0xba25('0x2d')]=_[_0xba25('0x2e')](_0x173552[_0xba25('0x30')],_0x173552[_0xba25('0x2c')]);_0x236959[_0xba25('0x2f')]=_['intersection'](_0x173552[_0xba25('0x30')],qs['fields'](_0x2f71c8['query'][_0xba25('0x31')]));_0x236959[_0xba25('0x2f')]=_0x236959[_0xba25('0x2f')][_0xba25('0x32')]?_0x236959[_0xba25('0x2f')]:_0x173552[_0xba25('0x30')];_0x236959['order']=qs[_0xba25('0x35')](_0x2f71c8[_0xba25('0x2c')]['sort']);_0x236959[_0xba25('0x36')]=qs[_0xba25('0x2d')](_[_0xba25('0x37')](_0x2f71c8[_0xba25('0x2c')],_0x173552[_0xba25('0x2d')]));if(_0x2f71c8[_0xba25('0x2c')][_0xba25('0x38')]){_0x236959[_0xba25('0x36')]=_[_0xba25('0x39')](_0x236959[_0xba25('0x36')],{'$or':_[_0xba25('0x27')](_0x236959[_0xba25('0x2f')],function(_0x36caf3){var _0x560f17={};_0x560f17[_0x36caf3]={'$like':'%'+_0x2f71c8[_0xba25('0x2c')][_0xba25('0x38')]+'%'};return _0x560f17;})});}_0x236959=_[_0xba25('0x39')]({},_0x236959,_0x2f71c8[_0xba25('0x3e')]);return _0xb00aed['getDescriptions'](_0x236959);}})[_0xba25('0x21')](function(_0x553d70){if(_0x553d70){_0x3f8052=_0x553d70[_0xba25('0x32')];if(!_0x2f71c8['query'][_0xba25('0x33')](_0xba25('0x34'))){_0x236959[_0xba25('0x1a')]=qs[_0xba25('0x1a')](_0x2f71c8[_0xba25('0x2c')][_0xba25('0x1a')]);_0x236959[_0xba25('0x1c')]=qs[_0xba25('0x1c')](_0x2f71c8['query'][_0xba25('0x1c')]);}return _0xb00aed[_0xba25('0x49')](_0x236959);}})[_0xba25('0x21')](function(_0x31dae6){if(_0x31dae6){return _0x31dae6?{'count':_0x3f8052,'rows':_0x31dae6}:null;}})[_0xba25('0x21')](respondWithResult(_0x442512,null))[_0xba25('0x40')](handleError(_0x442512,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index d8900a6..1f16188 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 _0x7ebc=['./intVtigerConfiguration.attributes','exports','int_vtiger_configurations','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7ebc,0xe9));var _0xc7eb=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x7ebc[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xc7eb('0x0'));var util=require(_0xc7eb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc7eb('0x2'));var BPromise=require('bluebird');var rp=require(_0xc7eb('0x3'));var fs=require('fs');var path=require(_0xc7eb('0x4'));var rimraf=require(_0xc7eb('0x5'));var config=require(_0xc7eb('0x6'));var attributes=require(_0xc7eb('0x7'));module[_0xc7eb('0x8')]=function(_0x44b330,_0x1af795){return _0x44b330['define']('VtigerConfiguration',attributes,{'tableName':_0xc7eb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x229b=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash'];(function(_0x5773ed,_0x2270ce){var _0x4a75d9=function(_0x31a9a3){while(--_0x31a9a3){_0x5773ed['push'](_0x5773ed['shift']());}};_0x4a75d9(++_0x2270ce);}(_0x229b,0x9b));var _0xb229=function(_0x1319f8,_0x5499a3){_0x1319f8=_0x1319f8-0x0;var _0x868359=_0x229b[_0x1319f8];return _0x868359;};'use strict';var _=require(_0xb229('0x0'));var util=require(_0xb229('0x1'));var logger=require(_0xb229('0x2'))(_0xb229('0x3'));var moment=require(_0xb229('0x4'));var BPromise=require('bluebird');var rp=require(_0xb229('0x5'));var fs=require('fs');var path=require(_0xb229('0x6'));var rimraf=require(_0xb229('0x7'));var config=require(_0xb229('0x8'));var attributes=require(_0xb229('0x9'));module[_0xb229('0xa')]=function(_0x5c664f,_0x1aed8e){return _0x5c664f['define'](_0xb229('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index a25e30e..aef925b 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 _0x20ed=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5b05ae,_0x32b449){var _0x172ba5=function(_0x4073ca){while(--_0x4073ca){_0x5b05ae['push'](_0x5b05ae['shift']());}};_0x172ba5(++_0x32b449);}(_0x20ed,0xb2));var _0xd20e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x20ed[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require('lodash');var util=require(_0xd20e('0x0'));var moment=require('moment');var BPromise=require(_0xd20e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd20e('0x2'))['db'];var utils=require(_0xd20e('0x3'));var logger=require('../../config/logger')(_0xd20e('0x4'));var config=require(_0xd20e('0x5'));var jayson=require(_0xd20e('0x6'));var client=jayson[_0xd20e('0x7')][_0xd20e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d2aec,_0xa71586,_0x432798){return new BPromise(function(_0x316865,_0x4a33c9){return client[_0xd20e('0x9')](_0x5d2aec,_0x432798)[_0xd20e('0xa')](function(_0x595ad3){logger[_0xd20e('0xb')](_0xd20e('0xc'),_0xa71586,_0xd20e('0xd'));logger[_0xd20e('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xa71586,_0xd20e('0xd'),JSON[_0xd20e('0xf')](_0x595ad3));if(_0x595ad3['error']){if(_0x595ad3[_0xd20e('0x10')][_0xd20e('0x11')]===0x1f4){logger[_0xd20e('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0xa71586,_0x595ad3[_0xd20e('0x10')][_0xd20e('0x12')]);return _0x4a33c9(_0x595ad3[_0xd20e('0x10')][_0xd20e('0x12')]);}logger[_0xd20e('0x10')](_0xd20e('0xc'),_0xa71586,_0x595ad3['error'][_0xd20e('0x12')]);return _0x316865(_0x595ad3[_0xd20e('0x10')][_0xd20e('0x12')]);}else{logger[_0xd20e('0xb')](_0xd20e('0xc'),_0xa71586,_0xd20e('0xd'));_0x316865(_0x595ad3[_0xd20e('0x13')][_0xd20e('0x12')]);}})[_0xd20e('0x14')](function(_0x4ac682){logger[_0xd20e('0x10')](_0xd20e('0xc'),_0xa71586,_0x4ac682);_0x4a33c9(_0x4ac682);});});} \ No newline at end of file +var _0xd535=['lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch'];(function(_0x2205ab,_0x12a83f){var _0x2e3e9d=function(_0x579f4f){while(--_0x579f4f){_0x2205ab['push'](_0x2205ab['shift']());}};_0x2e3e9d(++_0x12a83f);}(_0xd535,0x1a2));var _0x5d53=function(_0x5cc56c,_0x1a8662){_0x5cc56c=_0x5cc56c-0x0;var _0x52edc9=_0xd535[_0x5cc56c];return _0x52edc9;};'use strict';var _=require(_0x5d53('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5d53('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d53('0x2'));var db=require(_0x5d53('0x3'))['db'];var utils=require(_0x5d53('0x4'));var logger=require(_0x5d53('0x5'))(_0x5d53('0x6'));var config=require(_0x5d53('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d53('0x8')][_0x5d53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d6171,_0x2e9248,_0x237569){return new BPromise(function(_0x2c5a9e,_0x1709ef){return client[_0x5d53('0xa')](_0x3d6171,_0x237569)[_0x5d53('0xb')](function(_0x23770d){logger[_0x5d53('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x2e9248,_0x5d53('0xd'));logger[_0x5d53('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x2e9248,_0x5d53('0xd'),JSON[_0x5d53('0xf')](_0x23770d));if(_0x23770d[_0x5d53('0x10')]){if(_0x23770d['error'][_0x5d53('0x11')]===0x1f4){logger[_0x5d53('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x2e9248,_0x23770d[_0x5d53('0x10')]['message']);return _0x1709ef(_0x23770d['error'][_0x5d53('0x12')]);}logger[_0x5d53('0x10')](_0x5d53('0x13'),_0x2e9248,_0x23770d[_0x5d53('0x10')][_0x5d53('0x12')]);return _0x2c5a9e(_0x23770d['error'][_0x5d53('0x12')]);}else{logger[_0x5d53('0xc')](_0x5d53('0x13'),_0x2e9248,'request\x20sent');_0x2c5a9e(_0x23770d[_0x5d53('0x14')][_0x5d53('0x12')]);}})[_0x5d53('0x15')](function(_0x47a629){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x2e9248,_0x47a629);_0x1709ef(_0x47a629);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index ef8e41a..968e724 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 _0xe32f=['delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','post','create','put'];(function(_0x22d8e6,_0x3dbf05){var _0x42eed5=function(_0x2afd03){while(--_0x2afd03){_0x22d8e6['push'](_0x22d8e6['shift']());}};_0x42eed5(++_0x3dbf05);}(_0xe32f,0xf1));var _0xfe32=function(_0x145e74,_0x487601){_0x145e74=_0x145e74-0x0;var _0x52405a=_0xe32f[_0x145e74];return _0x52405a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfe32('0x0'));var timeout=require(_0xfe32('0x1'));var express=require('express');var router=express[_0xfe32('0x2')]();var fs_extra=require(_0xfe32('0x3'));var auth=require(_0xfe32('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfe32('0x5'));var controller=require(_0xfe32('0x6'));router[_0xfe32('0x7')]('/',auth[_0xfe32('0x8')](),controller[_0xfe32('0x9')]);router[_0xfe32('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xfe32('0xa')]);router[_0xfe32('0xb')]('/',auth[_0xfe32('0x8')](),controller[_0xfe32('0xc')]);router[_0xfe32('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfe32('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xfe32('0xf')]);module[_0xfe32('0x10')]=router; \ No newline at end of file +var _0x6a08=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x6a08,0x77));var _0x86a0=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0x6a08[_0x2678d6];return _0x475503;};'use strict';var multer=require(_0x86a0('0x0'));var util=require('util');var path=require(_0x86a0('0x1'));var timeout=require(_0x86a0('0x2'));var express=require(_0x86a0('0x3'));var router=express[_0x86a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x86a0('0x5'));var interaction=require(_0x86a0('0x6'));var config=require(_0x86a0('0x7'));var controller=require(_0x86a0('0x8'));router[_0x86a0('0x9')]('/',auth['isAuthenticated'](),controller[_0x86a0('0xa')]);router['get'](_0x86a0('0xb'),auth[_0x86a0('0xc')](),controller[_0x86a0('0xd')]);router[_0x86a0('0xe')]('/',auth[_0x86a0('0xc')](),controller[_0x86a0('0xf')]);router[_0x86a0('0x10')](_0x86a0('0xb'),auth['isAuthenticated'](),controller[_0x86a0('0x11')]);router['delete'](_0x86a0('0xb'),auth['isAuthenticated'](),controller[_0x86a0('0x12')]);module[_0x86a0('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 312506c..95852ad 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 _0xf998=['ENUM','string','customVariable','picklist','variable','STRING','BOOLEAN','sequelize','exports'];(function(_0x22a2ce,_0x3e978a){var _0x5c599d=function(_0x4d3d57){while(--_0x4d3d57){_0x22a2ce['push'](_0x22a2ce['shift']());}};_0x5c599d(++_0x3e978a);}(_0xf998,0x16f));var _0x8f99=function(_0x45ce08,_0x59dcc7){_0x45ce08=_0x45ce08-0x0;var _0x23dff2=_0xf998[_0x45ce08];return _0x23dff2;};'use strict';var Sequelize=require(_0x8f99('0x0'));module[_0x8f99('0x1')]={'type':{'type':Sequelize[_0x8f99('0x2')](_0x8f99('0x3'),'variable',_0x8f99('0x4'),'keyValue',_0x8f99('0x5')),'defaultValue':_0x8f99('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8f99('0x2')](_0x8f99('0x3'),_0x8f99('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x8f99('0x7')]},'idField':{'type':Sequelize[_0x8f99('0x7')]},'nameField':{'type':Sequelize[_0x8f99('0x7')]},'customField':{'type':Sequelize[_0x8f99('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8f99('0x7')]}}; \ No newline at end of file +var _0xd1d5=['variable','keyValue','string','STRING','customVariable','sequelize','exports','ENUM'];(function(_0xbdf6ed,_0x228d90){var _0x27c53d=function(_0x4c6d90){while(--_0x4c6d90){_0xbdf6ed['push'](_0xbdf6ed['shift']());}};_0x27c53d(++_0x228d90);}(_0xd1d5,0x1ad));var _0x5d1d=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xd1d5[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require(_0x5d1d('0x0'));module[_0x5d1d('0x1')]={'type':{'type':Sequelize[_0x5d1d('0x2')]('string',_0x5d1d('0x3'),'customVariable',_0x5d1d('0x4'),'picklist'),'defaultValue':_0x5d1d('0x5')},'content':{'type':Sequelize[_0x5d1d('0x6')]},'key':{'type':Sequelize[_0x5d1d('0x6')]},'keyType':{'type':Sequelize[_0x5d1d('0x2')](_0x5d1d('0x5'),'variable',_0x5d1d('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5d1d('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5d1d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index f1f7988..e62e7db 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 _0xa70e=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','then','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','catch','show','params','include','find','create','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x5037ab,_0x43209e){var _0x512adb=function(_0x261783){while(--_0x261783){_0x5037ab['push'](_0x5037ab['shift']());}};_0x512adb(++_0x43209e);}(_0xa70e,0x107));var _0xea70=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa70e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xea70('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea70('0x1'));var rp=require(_0xea70('0x2'));var moment=require('moment');var BPromise=require(_0xea70('0x3'));var Mustache=require(_0xea70('0x4'));var util=require(_0xea70('0x5'));var path=require('path');var sox=require(_0xea70('0x6'));var csv=require('to-csv');var ejs=require(_0xea70('0x7'));var fs=require('fs');var fs_extra=require(_0xea70('0x8'));var _=require(_0xea70('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xea70('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xea70('0xb'));var querystring=require(_0xea70('0xc'));var Papa=require(_0xea70('0xd'));var Redis=require(_0xea70('0xe'));var authService=require(_0xea70('0xf'));var qs=require(_0xea70('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea70('0x11'))(_0xea70('0x12'));var utils=require(_0xea70('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xea70('0x14'));var db=require(_0xea70('0x15'))['db'];function respondWithStatusCode(_0x3b1006,_0x3e68e9){_0x3e68e9=_0x3e68e9||0xcc;return function(_0x40416c){if(_0x40416c){return _0x3b1006[_0xea70('0x16')](_0x3e68e9);}return _0x3b1006[_0xea70('0x17')](_0x3e68e9)[_0xea70('0x18')]();};}function respondWithResult(_0x47f213,_0x5af8ec){_0x5af8ec=_0x5af8ec||0xc8;return function(_0x3d367f){if(_0x3d367f){return _0x47f213[_0xea70('0x17')](_0x5af8ec)['json'](_0x3d367f);}};}function respondWithFilteredResult(_0x3af4f7,_0x13c6c0){return function(_0xc2d902){if(_0xc2d902){var _0x1b07f9=typeof _0x13c6c0[_0xea70('0x19')]===_0xea70('0x1a')&&typeof _0x13c6c0[_0xea70('0x1b')]==='undefined';var _0x6e499a=_0xc2d902['count'];var _0x203ac8=_0x1b07f9?0x0:_0x13c6c0[_0xea70('0x19')];var _0xb8b776=_0x1b07f9?_0xc2d902[_0xea70('0x1c')]:_0x13c6c0['offset']+_0x13c6c0[_0xea70('0x1b')];var _0x3a2553;if(_0xb8b776>=_0x6e499a){_0xb8b776=_0x6e499a;_0x3a2553=0xc8;}else{_0x3a2553=0xce;}_0x3af4f7['status'](_0x3a2553);return _0x3af4f7[_0xea70('0x1d')]('Content-Range',_0x203ac8+'-'+_0xb8b776+'/'+_0x6e499a)[_0xea70('0x1e')](_0xc2d902);}return null;};}function patchUpdates(_0x5bf81a){return function(_0x14640f){try{jsonpatch[_0xea70('0x1f')](_0x14640f,_0x5bf81a,!![]);}catch(_0x21d5c5){return BPromise[_0xea70('0x20')](_0x21d5c5);}return _0x14640f[_0xea70('0x21')]();};}function saveUpdates(_0xaa08d3,_0x3a256f){return function(_0x149f54){if(_0x149f54){return _0x149f54[_0xea70('0x22')](_0xaa08d3)['then'](function(_0x558ab6){return _0x558ab6;});}return null;};}function removeEntity(_0x171ebc,_0x456ba2){return function(_0x2e5906){if(_0x2e5906){return _0x2e5906[_0xea70('0x23')]()[_0xea70('0x24')](function(){_0x171ebc['status'](0xcc)[_0xea70('0x18')]();});}};}function handleEntityNotFound(_0xff0389,_0x140a5c){return function(_0x2320da){if(!_0x2320da){_0xff0389[_0xea70('0x16')](0x194);}return _0x2320da;};}function handleError(_0x2e4265,_0x3c9ce3){_0x3c9ce3=_0x3c9ce3||0x1f4;return function(_0x4a9683){logger['error'](_0x4a9683[_0xea70('0x25')]);if(_0x4a9683[_0xea70('0x26')]){delete _0x4a9683[_0xea70('0x26')];}_0x2e4265[_0xea70('0x17')](_0x3c9ce3)[_0xea70('0x27')](_0x4a9683);};}exports[_0xea70('0x28')]=function(_0x4f7ff1,_0x3fc32f){var _0x3301e9={},_0x80895c={},_0x5ba6bf={'count':0x0,'rows':[]};var _0xc7c50c=_[_0xea70('0x29')](db[_0xea70('0x2a')][_0xea70('0x2b')],function(_0x823410){return{'name':_0x823410[_0xea70('0x2c')],'type':_0x823410['type'][_0xea70('0x2d')]};});_0x80895c[_0xea70('0x2e')]=_['map'](_0xc7c50c,'name');_0x80895c['query']=_[_0xea70('0x2f')](_0x4f7ff1[_0xea70('0x30')]);_0x80895c[_0xea70('0x31')]=_[_0xea70('0x32')](_0x80895c[_0xea70('0x2e')],_0x80895c[_0xea70('0x30')]);_0x3301e9[_0xea70('0x33')]=_[_0xea70('0x32')](_0x80895c[_0xea70('0x2e')],qs['fields'](_0x4f7ff1[_0xea70('0x30')][_0xea70('0x34')]));_0x3301e9[_0xea70('0x33')]=_0x3301e9[_0xea70('0x33')][_0xea70('0x35')]?_0x3301e9[_0xea70('0x33')]:_0x80895c['model'];if(!_0x4f7ff1[_0xea70('0x30')][_0xea70('0x36')](_0xea70('0x37'))){_0x3301e9['limit']=qs[_0xea70('0x1b')](_0x4f7ff1[_0xea70('0x30')][_0xea70('0x1b')]);_0x3301e9[_0xea70('0x19')]=qs[_0xea70('0x19')](_0x4f7ff1[_0xea70('0x30')][_0xea70('0x19')]);}_0x3301e9['order']=qs[_0xea70('0x38')](_0x4f7ff1[_0xea70('0x30')][_0xea70('0x38')]);_0x3301e9[_0xea70('0x39')]=qs[_0xea70('0x31')](_['pick'](_0x4f7ff1[_0xea70('0x30')],_0x80895c[_0xea70('0x31')]),_0xc7c50c);if(_0x4f7ff1['query'][_0xea70('0x3a')]){_0x3301e9['where']=_['merge'](_0x3301e9[_0xea70('0x39')],{'$or':_[_0xea70('0x29')](_0xc7c50c,function(_0x1c4a39){if(_0x1c4a39[_0xea70('0x3b')]!==_0xea70('0x3c')){var _0x12ed80={};_0x12ed80[_0x1c4a39[_0xea70('0x26')]]={'$like':'%'+_0x4f7ff1[_0xea70('0x30')][_0xea70('0x3a')]+'%'};return _0x12ed80;}})});}_0x3301e9=_[_0xea70('0x3d')]({},_0x3301e9,_0x4f7ff1[_0xea70('0x3e')]);var _0x413e13={'where':_0x3301e9['where']};return db[_0xea70('0x2a')][_0xea70('0x1c')](_0x413e13)[_0xea70('0x24')](function(_0x180306){_0x5ba6bf[_0xea70('0x1c')]=_0x180306;if(_0x4f7ff1[_0xea70('0x30')][_0xea70('0x3f')]){_0x3301e9['include']=[{'all':!![]}];}return db[_0xea70('0x2a')]['findAll'](_0x3301e9);})['then'](function(_0xba54cc){_0x5ba6bf['rows']=_0xba54cc;return _0x5ba6bf;})['then'](respondWithFilteredResult(_0x3fc32f,_0x3301e9))[_0xea70('0x40')](handleError(_0x3fc32f,null));};exports[_0xea70('0x41')]=function(_0x30dba1,_0x2002be){var _0x243132={'raw':!![],'where':{'id':_0x30dba1[_0xea70('0x42')]['id']}},_0x2d6c5b={};_0x2d6c5b[_0xea70('0x2e')]=_[_0xea70('0x2f')](db[_0xea70('0x2a')][_0xea70('0x2b')]);_0x2d6c5b[_0xea70('0x30')]=_[_0xea70('0x2f')](_0x30dba1[_0xea70('0x30')]);_0x2d6c5b[_0xea70('0x31')]=_[_0xea70('0x32')](_0x2d6c5b[_0xea70('0x2e')],_0x2d6c5b[_0xea70('0x30')]);_0x243132['attributes']=_['intersection'](_0x2d6c5b[_0xea70('0x2e')],qs[_0xea70('0x34')](_0x30dba1['query']['fields']));_0x243132[_0xea70('0x33')]=_0x243132[_0xea70('0x33')][_0xea70('0x35')]?_0x243132['attributes']:_0x2d6c5b[_0xea70('0x2e')];if(_0x30dba1[_0xea70('0x30')]['includeAll']){_0x243132[_0xea70('0x43')]=[{'all':!![]}];}_0x243132=_[_0xea70('0x3d')]({},_0x243132,_0x30dba1[_0xea70('0x3e')]);return db[_0xea70('0x2a')][_0xea70('0x44')](_0x243132)[_0xea70('0x24')](handleEntityNotFound(_0x2002be,null))[_0xea70('0x24')](respondWithResult(_0x2002be,null))[_0xea70('0x40')](handleError(_0x2002be,null));};exports['create']=function(_0x13a2ca,_0x4407f1){return db[_0xea70('0x2a')][_0xea70('0x45')](_0x13a2ca[_0xea70('0x46')],{})[_0xea70('0x24')](respondWithResult(_0x4407f1,0xc9))['catch'](handleError(_0x4407f1,null));};exports['update']=function(_0x246e69,_0x225824){if(_0x246e69[_0xea70('0x46')]['id']){delete _0x246e69['body']['id'];}return db[_0xea70('0x2a')]['find']({'where':{'id':_0x246e69[_0xea70('0x42')]['id']}})['then'](handleEntityNotFound(_0x225824,null))[_0xea70('0x24')](saveUpdates(_0x246e69[_0xea70('0x46')],null))[_0xea70('0x24')](respondWithResult(_0x225824,null))['catch'](handleError(_0x225824,null));};exports[_0xea70('0x23')]=function(_0x433847,_0xf25602){return db[_0xea70('0x2a')][_0xea70('0x44')]({'where':{'id':_0x433847[_0xea70('0x42')]['id']}})[_0xea70('0x24')](handleEntityNotFound(_0xf25602,null))[_0xea70('0x24')](removeEntity(_0xf25602,null))['catch'](handleError(_0xf25602,null));}; \ No newline at end of file +var _0x09a5=['reject','save','update','then','destroy','error','stack','send','index','map','VtigerField','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x57a86f,_0x15d5c3){var _0xa57d80=function(_0x3d3d1d){while(--_0x3d3d1d){_0x57a86f['push'](_0x57a86f['shift']());}};_0xa57d80(++_0x15d5c3);}(_0x09a5,0x154));var _0x509a=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x09a5[_0x468b0f];return _0x3e74d9;};'use strict';var emlformat=require(_0x509a('0x0'));var rimraf=require(_0x509a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x509a('0x2'));var rp=require('request-promise');var moment=require(_0x509a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x509a('0x4'));var util=require(_0x509a('0x5'));var path=require(_0x509a('0x6'));var sox=require('sox');var csv=require(_0x509a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x509a('0x8'));var _=require(_0x509a('0x9'));var squel=require(_0x509a('0xa'));var crypto=require(_0x509a('0xb'));var jsforce=require(_0x509a('0xc'));var deskjs=require(_0x509a('0xd'));var toCsv=require(_0x509a('0x7'));var querystring=require(_0x509a('0xe'));var Papa=require(_0x509a('0xf'));var Redis=require('ioredis');var authService=require(_0x509a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x509a('0x11'));var hardwareService=require(_0x509a('0x12'));var logger=require(_0x509a('0x13'))(_0x509a('0x14'));var utils=require(_0x509a('0x15'));var config=require(_0x509a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x509a('0x17'))['db'];function respondWithStatusCode(_0x4b5a59,_0x2686d1){_0x2686d1=_0x2686d1||0xcc;return function(_0x58c028){if(_0x58c028){return _0x4b5a59['sendStatus'](_0x2686d1);}return _0x4b5a59[_0x509a('0x18')](_0x2686d1)[_0x509a('0x19')]();};}function respondWithResult(_0x5bd618,_0x50d7e7){_0x50d7e7=_0x50d7e7||0xc8;return function(_0x4717e3){if(_0x4717e3){return _0x5bd618[_0x509a('0x18')](_0x50d7e7)[_0x509a('0x1a')](_0x4717e3);}};}function respondWithFilteredResult(_0x76b128,_0x559981){return function(_0x177100){if(_0x177100){var _0x2e7aad=typeof _0x559981[_0x509a('0x1b')]===_0x509a('0x1c')&&typeof _0x559981[_0x509a('0x1d')]==='undefined';var _0x30fbcf=_0x177100['count'];var _0x35f54f=_0x2e7aad?0x0:_0x559981[_0x509a('0x1b')];var _0x348a5c=_0x2e7aad?_0x177100['count']:_0x559981['offset']+_0x559981[_0x509a('0x1d')];var _0x4fe5a4;if(_0x348a5c>=_0x30fbcf){_0x348a5c=_0x30fbcf;_0x4fe5a4=0xc8;}else{_0x4fe5a4=0xce;}_0x76b128[_0x509a('0x18')](_0x4fe5a4);return _0x76b128['set']('Content-Range',_0x35f54f+'-'+_0x348a5c+'/'+_0x30fbcf)[_0x509a('0x1a')](_0x177100);}return null;};}function patchUpdates(_0x24cf9d){return function(_0x50cd05){try{jsonpatch['apply'](_0x50cd05,_0x24cf9d,!![]);}catch(_0x51c915){return BPromise[_0x509a('0x1e')](_0x51c915);}return _0x50cd05[_0x509a('0x1f')]();};}function saveUpdates(_0x44bea1,_0x335c1f){return function(_0xcde5){if(_0xcde5){return _0xcde5[_0x509a('0x20')](_0x44bea1)[_0x509a('0x21')](function(_0x201c55){return _0x201c55;});}return null;};}function removeEntity(_0x1fcc08,_0xe81796){return function(_0x4ffc03){if(_0x4ffc03){return _0x4ffc03[_0x509a('0x22')]()[_0x509a('0x21')](function(){_0x1fcc08['status'](0xcc)[_0x509a('0x19')]();});}};}function handleEntityNotFound(_0x4c874d,_0x23cebd){return function(_0x3c5941){if(!_0x3c5941){_0x4c874d['sendStatus'](0x194);}return _0x3c5941;};}function handleError(_0x1e39f3,_0x14bdf3){_0x14bdf3=_0x14bdf3||0x1f4;return function(_0x5d50ee){logger[_0x509a('0x23')](_0x5d50ee[_0x509a('0x24')]);if(_0x5d50ee['name']){delete _0x5d50ee['name'];}_0x1e39f3[_0x509a('0x18')](_0x14bdf3)[_0x509a('0x25')](_0x5d50ee);};}exports[_0x509a('0x26')]=function(_0x39899a,_0x2fe790){var _0xba6c95={},_0x3a8743={},_0x560373={'count':0x0,'rows':[]};var _0x2ba4fc=_[_0x509a('0x27')](db[_0x509a('0x28')]['rawAttributes'],function(_0x3648dd){return{'name':_0x3648dd[_0x509a('0x29')],'type':_0x3648dd[_0x509a('0x2a')][_0x509a('0x2b')]};});_0x3a8743[_0x509a('0x2c')]=_[_0x509a('0x27')](_0x2ba4fc,_0x509a('0x2d'));_0x3a8743['query']=_[_0x509a('0x2e')](_0x39899a[_0x509a('0x2f')]);_0x3a8743[_0x509a('0x30')]=_[_0x509a('0x31')](_0x3a8743[_0x509a('0x2c')],_0x3a8743[_0x509a('0x2f')]);_0xba6c95[_0x509a('0x32')]=_[_0x509a('0x31')](_0x3a8743[_0x509a('0x2c')],qs[_0x509a('0x33')](_0x39899a[_0x509a('0x2f')][_0x509a('0x33')]));_0xba6c95['attributes']=_0xba6c95[_0x509a('0x32')][_0x509a('0x34')]?_0xba6c95['attributes']:_0x3a8743[_0x509a('0x2c')];if(!_0x39899a[_0x509a('0x2f')]['hasOwnProperty'](_0x509a('0x35'))){_0xba6c95[_0x509a('0x1d')]=qs[_0x509a('0x1d')](_0x39899a[_0x509a('0x2f')][_0x509a('0x1d')]);_0xba6c95['offset']=qs['offset'](_0x39899a[_0x509a('0x2f')][_0x509a('0x1b')]);}_0xba6c95[_0x509a('0x36')]=qs['sort'](_0x39899a[_0x509a('0x2f')][_0x509a('0x37')]);_0xba6c95[_0x509a('0x38')]=qs['filters'](_[_0x509a('0x39')](_0x39899a[_0x509a('0x2f')],_0x3a8743['filters']),_0x2ba4fc);if(_0x39899a[_0x509a('0x2f')][_0x509a('0x3a')]){_0xba6c95[_0x509a('0x38')]=_[_0x509a('0x3b')](_0xba6c95[_0x509a('0x38')],{'$or':_[_0x509a('0x27')](_0x2ba4fc,function(_0x5c5142){if(_0x5c5142[_0x509a('0x2a')]!==_0x509a('0x3c')){var _0x4b192d={};_0x4b192d[_0x5c5142[_0x509a('0x2d')]]={'$like':'%'+_0x39899a[_0x509a('0x2f')]['filter']+'%'};return _0x4b192d;}})});}_0xba6c95=_['merge']({},_0xba6c95,_0x39899a[_0x509a('0x3d')]);var _0x20062d={'where':_0xba6c95[_0x509a('0x38')]};return db[_0x509a('0x28')][_0x509a('0x3e')](_0x20062d)[_0x509a('0x21')](function(_0x4768e1){_0x560373[_0x509a('0x3e')]=_0x4768e1;if(_0x39899a[_0x509a('0x2f')][_0x509a('0x3f')]){_0xba6c95[_0x509a('0x40')]=[{'all':!![]}];}return db[_0x509a('0x28')][_0x509a('0x41')](_0xba6c95);})[_0x509a('0x21')](function(_0x22b1ef){_0x560373[_0x509a('0x42')]=_0x22b1ef;return _0x560373;})[_0x509a('0x21')](respondWithFilteredResult(_0x2fe790,_0xba6c95))[_0x509a('0x43')](handleError(_0x2fe790,null));};exports[_0x509a('0x44')]=function(_0x439cc9,_0x3b77b5){var _0x14ade1={'raw':!![],'where':{'id':_0x439cc9[_0x509a('0x45')]['id']}},_0x422bfd={};_0x422bfd[_0x509a('0x2c')]=_[_0x509a('0x2e')](db['VtigerField'][_0x509a('0x46')]);_0x422bfd['query']=_['keys'](_0x439cc9[_0x509a('0x2f')]);_0x422bfd[_0x509a('0x30')]=_[_0x509a('0x31')](_0x422bfd[_0x509a('0x2c')],_0x422bfd[_0x509a('0x2f')]);_0x14ade1[_0x509a('0x32')]=_['intersection'](_0x422bfd[_0x509a('0x2c')],qs[_0x509a('0x33')](_0x439cc9['query'][_0x509a('0x33')]));_0x14ade1[_0x509a('0x32')]=_0x14ade1['attributes'][_0x509a('0x34')]?_0x14ade1['attributes']:_0x422bfd[_0x509a('0x2c')];if(_0x439cc9['query'][_0x509a('0x3f')]){_0x14ade1[_0x509a('0x40')]=[{'all':!![]}];}_0x14ade1=_[_0x509a('0x3b')]({},_0x14ade1,_0x439cc9['options']);return db[_0x509a('0x28')]['find'](_0x14ade1)[_0x509a('0x21')](handleEntityNotFound(_0x3b77b5,null))[_0x509a('0x21')](respondWithResult(_0x3b77b5,null))[_0x509a('0x43')](handleError(_0x3b77b5,null));};exports[_0x509a('0x47')]=function(_0x431fdd,_0x395410){return db[_0x509a('0x28')]['create'](_0x431fdd[_0x509a('0x48')],{})[_0x509a('0x21')](respondWithResult(_0x395410,0xc9))[_0x509a('0x43')](handleError(_0x395410,null));};exports[_0x509a('0x20')]=function(_0x2cb5f7,_0x52147a){if(_0x2cb5f7[_0x509a('0x48')]['id']){delete _0x2cb5f7[_0x509a('0x48')]['id'];}return db[_0x509a('0x28')][_0x509a('0x49')]({'where':{'id':_0x2cb5f7['params']['id']}})[_0x509a('0x21')](handleEntityNotFound(_0x52147a,null))[_0x509a('0x21')](saveUpdates(_0x2cb5f7[_0x509a('0x48')],null))[_0x509a('0x21')](respondWithResult(_0x52147a,null))['catch'](handleError(_0x52147a,null));};exports['destroy']=function(_0x3657e2,_0x3914f7){return db['VtigerField'][_0x509a('0x49')]({'where':{'id':_0x3657e2[_0x509a('0x45')]['id']}})[_0x509a('0x21')](handleEntityNotFound(_0x3914f7,null))[_0x509a('0x21')](removeEntity(_0x3914f7,null))['catch'](handleError(_0x3914f7,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 23841e4..abfd089 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 _0x3e5f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intVtigerField.attributes','define','int_vtiger_fields','vtiger_unique_index','FieldId'];(function(_0x5c768b,_0x5e88a6){var _0x335af8=function(_0x39b04f){while(--_0x39b04f){_0x5c768b['push'](_0x5c768b['shift']());}};_0x335af8(++_0x5e88a6);}(_0x3e5f,0x8f));var _0xf3e5=function(_0x47d2bf,_0x1480a8){_0x47d2bf=_0x47d2bf-0x0;var _0x143b2b=_0x3e5f[_0x47d2bf];return _0x143b2b;};'use strict';var _=require(_0xf3e5('0x0'));var util=require(_0xf3e5('0x1'));var logger=require(_0xf3e5('0x2'))('api');var moment=require(_0xf3e5('0x3'));var BPromise=require(_0xf3e5('0x4'));var rp=require(_0xf3e5('0x5'));var fs=require('fs');var path=require(_0xf3e5('0x6'));var rimraf=require('rimraf');var config=require(_0xf3e5('0x7'));var attributes=require(_0xf3e5('0x8'));module['exports']=function(_0x1c0948,_0x20fc76){return _0x1c0948[_0xf3e5('0x9')]('VtigerField',attributes,{'tableName':_0xf3e5('0xa'),'paranoid':![],'indexes':[{'name':_0xf3e5('0xb'),'fields':['idField',_0xf3e5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91d6=['idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x43a444,_0x20435d){var _0x3714f7=function(_0x2ffa1b){while(--_0x2ffa1b){_0x43a444['push'](_0x43a444['shift']());}};_0x3714f7(++_0x20435d);}(_0x91d6,0xc5));var _0x691d=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x91d6[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x691d('0x0'));var util=require(_0x691d('0x1'));var logger=require('../../config/logger')(_0x691d('0x2'));var moment=require(_0x691d('0x3'));var BPromise=require(_0x691d('0x4'));var rp=require(_0x691d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x691d('0x6'));var config=require('../../config/environment');var attributes=require(_0x691d('0x7'));module[_0x691d('0x8')]=function(_0x208c26,_0x15f10d){return _0x208c26[_0x691d('0x9')](_0x691d('0xa'),attributes,{'tableName':_0x691d('0xb'),'paranoid':![],'indexes':[{'name':_0x691d('0xc'),'fields':[_0x691d('0xd'),_0x691d('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 6c5134a..3a7cad7 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 _0xe5f9=['message','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','result'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xe5f9,0x86));var _0x9e5f=function(_0x53865f,_0x21c41e){_0x53865f=_0x53865f-0x0;var _0x22a44c=_0xe5f9[_0x53865f];return _0x22a44c;};'use strict';var _=require('lodash');var util=require(_0x9e5f('0x0'));var moment=require('moment');var BPromise=require(_0x9e5f('0x1'));var rs=require(_0x9e5f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9e5f('0x3'))['db'];var utils=require(_0x9e5f('0x4'));var logger=require(_0x9e5f('0x5'))(_0x9e5f('0x6'));var config=require(_0x9e5f('0x7'));var jayson=require(_0x9e5f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x176d76,_0x3c7e19,_0x101a10){return new BPromise(function(_0x687e80,_0x23388c){return client['request'](_0x176d76,_0x101a10)[_0x9e5f('0x9')](function(_0x4a7ba5){logger[_0x9e5f('0xa')](_0x9e5f('0xb'),_0x3c7e19,_0x9e5f('0xc'));logger[_0x9e5f('0xd')](_0x9e5f('0xe'),_0x3c7e19,'request\x20sent',JSON['stringify'](_0x4a7ba5));if(_0x4a7ba5['error']){if(_0x4a7ba5[_0x9e5f('0xf')][_0x9e5f('0x10')]===0x1f4){logger[_0x9e5f('0xf')](_0x9e5f('0xb'),_0x3c7e19,_0x4a7ba5[_0x9e5f('0xf')]['message']);return _0x23388c(_0x4a7ba5['error']['message']);}logger['error'](_0x9e5f('0xb'),_0x3c7e19,_0x4a7ba5[_0x9e5f('0xf')]['message']);return _0x687e80(_0x4a7ba5['error']['message']);}else{logger['info'](_0x9e5f('0xb'),_0x3c7e19,_0x9e5f('0xc'));_0x687e80(_0x4a7ba5[_0x9e5f('0x11')][_0x9e5f('0x12')]);}})['catch'](function(_0x5bc2dd){logger[_0x9e5f('0xf')](_0x9e5f('0xb'),_0x3c7e19,_0x5bc2dd);_0x23388c(_0x5bc2dd);});});} \ No newline at end of file +var _0x15f9=['error','code','VtigerField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','request\x20sent','debug','stringify'];(function(_0x3ffe9d,_0x3bf76d){var _0x37eb59=function(_0x3fa9da){while(--_0x3fa9da){_0x3ffe9d['push'](_0x3ffe9d['shift']());}};_0x37eb59(++_0x3bf76d);}(_0x15f9,0x150));var _0x915f=function(_0x53d340,_0x811434){_0x53d340=_0x53d340-0x0;var _0x397f3d=_0x15f9[_0x53d340];return _0x397f3d;};'use strict';var _=require(_0x915f('0x0'));var util=require(_0x915f('0x1'));var moment=require(_0x915f('0x2'));var BPromise=require(_0x915f('0x3'));var rs=require(_0x915f('0x4'));var fs=require('fs');var Redis=require(_0x915f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x915f('0x6'));var logger=require(_0x915f('0x7'))(_0x915f('0x8'));var config=require('../../config/environment');var jayson=require(_0x915f('0x9'));var client=jayson['client'][_0x915f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32d69e,_0x70e73c,_0x31447e){return new BPromise(function(_0x409d1f,_0x17cdb6){return client['request'](_0x32d69e,_0x31447e)[_0x915f('0xb')](function(_0x18342a){logger[_0x915f('0xc')]('VtigerField,\x20%s,\x20%s',_0x70e73c,_0x915f('0xd'));logger[_0x915f('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x70e73c,_0x915f('0xd'),JSON[_0x915f('0xf')](_0x18342a));if(_0x18342a[_0x915f('0x10')]){if(_0x18342a[_0x915f('0x10')][_0x915f('0x11')]===0x1f4){logger[_0x915f('0x10')](_0x915f('0x12'),_0x70e73c,_0x18342a[_0x915f('0x10')][_0x915f('0x13')]);return _0x17cdb6(_0x18342a['error'][_0x915f('0x13')]);}logger[_0x915f('0x10')](_0x915f('0x12'),_0x70e73c,_0x18342a[_0x915f('0x10')][_0x915f('0x13')]);return _0x409d1f(_0x18342a['error'][_0x915f('0x13')]);}else{logger[_0x915f('0xc')](_0x915f('0x12'),_0x70e73c,_0x915f('0xd'));_0x409d1f(_0x18342a[_0x915f('0x14')]['message']);}})[_0x915f('0x15')](function(_0x57a0b5){logger[_0x915f('0x10')]('VtigerField,\x20%s,\x20%s',_0x70e73c,_0x57a0b5);_0x17cdb6(_0x57a0b5);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index d903ea9..f79f026 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 _0x2b69=['addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0x3b0265,_0x54c4b6){var _0x4d6215=function(_0x431a45){while(--_0x431a45){_0x3b0265['push'](_0x3b0265['shift']());}};_0x4d6215(++_0x54c4b6);}(_0x2b69,0x1ce));var _0x92b6=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x2b69[_0x1969a7];return _0x3d665f;};'use strict';var multer=require('multer');var util=require(_0x92b6('0x0'));var path=require(_0x92b6('0x1'));var timeout=require(_0x92b6('0x2'));var express=require(_0x92b6('0x3'));var router=express[_0x92b6('0x4')]();var fs_extra=require(_0x92b6('0x5'));var auth=require(_0x92b6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x92b6('0x7'));var controller=require(_0x92b6('0x8'));router[_0x92b6('0x9')]('/',auth[_0x92b6('0xa')](),controller['index']);router[_0x92b6('0x9')](_0x92b6('0xb'),auth[_0x92b6('0xa')](),controller[_0x92b6('0xc')]);router[_0x92b6('0x9')](_0x92b6('0xd'),auth[_0x92b6('0xa')](),controller[_0x92b6('0xe')]);router['get'](_0x92b6('0xf'),auth[_0x92b6('0xa')](),controller[_0x92b6('0x10')]);router[_0x92b6('0x11')]('/',auth[_0x92b6('0xa')](),controller['create']);router[_0x92b6('0x11')](_0x92b6('0xd'),auth[_0x92b6('0xa')](),controller[_0x92b6('0x12')]);router[_0x92b6('0x13')](_0x92b6('0xb'),auth[_0x92b6('0xa')](),controller[_0x92b6('0x14')]);router[_0x92b6('0x15')](_0x92b6('0xb'),auth[_0x92b6('0xa')](),controller[_0x92b6('0x16')]);module[_0x92b6('0x17')]=router; \ No newline at end of file +var _0x64fb=['create','/:id/configurations','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','show','isAuthenticated','/:id/fields','post'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x64fb,0x10e));var _0xb64f=function(_0x37c9aa,_0x3900ab){_0x37c9aa=_0x37c9aa-0x0;var _0x5b6f71=_0x64fb[_0x37c9aa];return _0x5b6f71;};'use strict';var multer=require('multer');var util=require(_0xb64f('0x0'));var path=require(_0xb64f('0x1'));var timeout=require(_0xb64f('0x2'));var express=require(_0xb64f('0x3'));var router=express[_0xb64f('0x4')]();var fs_extra=require(_0xb64f('0x5'));var auth=require(_0xb64f('0x6'));var interaction=require(_0xb64f('0x7'));var config=require(_0xb64f('0x8'));var controller=require(_0xb64f('0x9'));router[_0xb64f('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb64f('0xa')](_0xb64f('0xb'),auth['isAuthenticated'](),controller[_0xb64f('0xc')]);router[_0xb64f('0xa')]('/:id/configurations',auth[_0xb64f('0xd')](),controller['getConfigurations']);router['get'](_0xb64f('0xe'),auth[_0xb64f('0xd')](),controller['getFields']);router[_0xb64f('0xf')]('/',auth[_0xb64f('0xd')](),controller[_0xb64f('0x10')]);router[_0xb64f('0xf')](_0xb64f('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xb64f('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb64f('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb64f('0x14')]);module[_0xb64f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 3085688..800fcf2 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 _0x3024=['newTab','sequelize','exports','STRING','remoteUri','ENUM','token','password','integrationTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3024,0x64));var _0x4302=function(_0xd73a2d,_0x2c75d1){_0xd73a2d=_0xd73a2d-0x0;var _0x532597=_0x3024[_0xd73a2d];return _0x532597;};'use strict';var Sequelize=require(_0x4302('0x0'));module[_0x4302('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4302('0x2')]},'username':{'type':Sequelize[_0x4302('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x4302('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4302('0x3')},'authType':{'type':Sequelize[_0x4302('0x4')]('password',_0x4302('0x5')),'defaultValue':_0x4302('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4302('0x4')](_0x4302('0x7'),_0x4302('0x8')),'defaultValue':_0x4302('0x7')}}; \ No newline at end of file +var _0x0424=['password','token','integrationTab','STRING','username','ENUM'];(function(_0x2458cb,_0x36e318){var _0x2aa926=function(_0x3bec2a){while(--_0x3bec2a){_0x2458cb['push'](_0x2458cb['shift']());}};_0x2aa926(++_0x36e318);}(_0x0424,0x159));var _0x4042=function(_0x305b20,_0x5e57e9){_0x305b20=_0x305b20-0x0;var _0x26d64a=_0x0424[_0x305b20];return _0x26d64a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4042('0x0')]},'description':{'type':Sequelize[_0x4042('0x0')]},'username':{'type':Sequelize[_0x4042('0x0')],'unique':_0x4042('0x1')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x4042('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x4042('0x2')](_0x4042('0x3'),_0x4042('0x4')),'defaultValue':_0x4042('0x3')},'serverUrl':{'type':Sequelize[_0x4042('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x4042('0x2')](_0x4042('0x5'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 3fef666..1c4bcfc 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 _0x5423=['Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','ZendeskConfiguration','nolimit','findOne','AccountId','getSubjects','channel','type','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','ticket_fields','headers','Basic\x20%s','format','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0x5423,0xe3));var _0x3542=function(_0x44d71f,_0x1f8f25){_0x44d71f=_0x44d71f-0x0;var _0x57e28b=_0x5423[_0x44d71f];return _0x57e28b;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];var integrations=require(_0x3542('0x18'));function respondWithStatusCode(_0x43e977,_0x4ee86){_0x4ee86=_0x4ee86||0xcc;return function(_0x1a9062){if(_0x1a9062){return _0x43e977[_0x3542('0x19')](_0x4ee86);}return _0x43e977[_0x3542('0x1a')](_0x4ee86)[_0x3542('0x1b')]();};}function respondWithResult(_0x4bac5b,_0x14fe57){_0x14fe57=_0x14fe57||0xc8;return function(_0x4fb366){if(_0x4fb366){return _0x4bac5b[_0x3542('0x1a')](_0x14fe57)[_0x3542('0x1c')](_0x4fb366);}};}function respondWithFilteredResult(_0xc33d42,_0x546fbd){return function(_0x270312){if(_0x270312){var _0x177fb9=typeof _0x546fbd[_0x3542('0x1d')]==='undefined'&&typeof _0x546fbd[_0x3542('0x1e')]===_0x3542('0x1f');var _0x116859=_0x270312[_0x3542('0x20')];var _0x493d95=_0x177fb9?0x0:_0x546fbd[_0x3542('0x1d')];var _0x53d4aa=_0x177fb9?_0x270312[_0x3542('0x20')]:_0x546fbd[_0x3542('0x1d')]+_0x546fbd['limit'];var _0x1c6403;if(_0x53d4aa>=_0x116859){_0x53d4aa=_0x116859;_0x1c6403=0xc8;}else{_0x1c6403=0xce;}_0xc33d42[_0x3542('0x1a')](_0x1c6403);return _0xc33d42[_0x3542('0x21')](_0x3542('0x22'),_0x493d95+'-'+_0x53d4aa+'/'+_0x116859)[_0x3542('0x1c')](_0x270312);}return null;};}function patchUpdates(_0x4a7695){return function(_0x4a74b0){try{jsonpatch['apply'](_0x4a74b0,_0x4a7695,!![]);}catch(_0x17e3cf){return BPromise['reject'](_0x17e3cf);}return _0x4a74b0[_0x3542('0x23')]();};}function saveUpdates(_0x551645,_0x1d5f1e){return function(_0x55774d){if(_0x55774d){return _0x55774d['update'](_0x551645)[_0x3542('0x24')](function(_0xe3f983){return _0xe3f983;});}return null;};}function removeEntity(_0x5ae097,_0x5d05b2){return function(_0x3fc964){if(_0x3fc964){return _0x3fc964['destroy']()[_0x3542('0x24')](function(){_0x5ae097[_0x3542('0x1a')](0xcc)[_0x3542('0x1b')]();});}};}function handleEntityNotFound(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(!_0xf1f7d0){_0x2f2e63[_0x3542('0x19')](0x194);}return _0xf1f7d0;};}function handleError(_0x1e156e,_0x18dc6c){_0x18dc6c=_0x18dc6c||0x1f4;return function(_0x2841a1){logger[_0x3542('0x25')](_0x2841a1[_0x3542('0x26')]);if(_0x2841a1[_0x3542('0x27')]){delete _0x2841a1[_0x3542('0x27')];}_0x1e156e[_0x3542('0x1a')](_0x18dc6c)[_0x3542('0x28')](_0x2841a1);};}exports[_0x3542('0x29')]=function(_0x20eda1,_0x3bd666){var _0x5590a2={},_0x31ad47={},_0x35bbc9={'count':0x0,'rows':[]};var _0x2aec76=_['map'](db[_0x3542('0x2a')][_0x3542('0x2b')],function(_0x2e883a){return{'name':_0x2e883a[_0x3542('0x2c')],'type':_0x2e883a['type']['key']};});_0x31ad47[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x2aec76,_0x3542('0x27'));_0x31ad47[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x20eda1[_0x3542('0x2f')]);_0x31ad47[_0x3542('0x31')]=_['intersection'](_0x31ad47['model'],_0x31ad47[_0x3542('0x2f')]);_0x5590a2['attributes']=_['intersection'](_0x31ad47[_0x3542('0x2d')],qs['fields'](_0x20eda1['query'][_0x3542('0x32')]));_0x5590a2[_0x3542('0x33')]=_0x5590a2[_0x3542('0x33')]['length']?_0x5590a2[_0x3542('0x33')]:_0x31ad47['model'];if(!_0x20eda1[_0x3542('0x2f')][_0x3542('0x34')]('nolimit')){_0x5590a2[_0x3542('0x1e')]=qs['limit'](_0x20eda1[_0x3542('0x2f')][_0x3542('0x1e')]);_0x5590a2[_0x3542('0x1d')]=qs['offset'](_0x20eda1[_0x3542('0x2f')]['offset']);}_0x5590a2[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x20eda1[_0x3542('0x2f')][_0x3542('0x36')]);_0x5590a2[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x20eda1[_0x3542('0x2f')],_0x31ad47[_0x3542('0x31')]),_0x2aec76);if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]){_0x5590a2[_0x3542('0x37')]=_[_0x3542('0x3a')](_0x5590a2['where'],{'$or':_[_0x3542('0x2e')](_0x2aec76,function(_0x4a80ea){if(_0x4a80ea['type']!==_0x3542('0x3b')){var _0x3ffccc={};_0x3ffccc[_0x4a80ea[_0x3542('0x27')]]={'$like':'%'+_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x3ffccc;}})});}_0x5590a2=_[_0x3542('0x3a')]({},_0x5590a2,_0x20eda1[_0x3542('0x3c')]);var _0x42e87a={'where':_0x5590a2['where']};return db[_0x3542('0x2a')]['count'](_0x42e87a)[_0x3542('0x24')](function(_0x2baa01){_0x35bbc9['count']=_0x2baa01;if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x3d')]){_0x5590a2['include']=[{'all':!![]}];}return db[_0x3542('0x2a')][_0x3542('0x3e')](_0x5590a2);})['then'](function(_0x2682d0){_0x35bbc9[_0x3542('0x3f')]=_0x2682d0;return _0x35bbc9;})[_0x3542('0x24')](respondWithFilteredResult(_0x3bd666,_0x5590a2))[_0x3542('0x40')](handleError(_0x3bd666,null));};exports[_0x3542('0x41')]=function(_0xb12441,_0x2b54b9){var _0x4bf45a={'raw':![],'where':{'id':_0xb12441[_0x3542('0x42')]['id']}},_0x542e0c={};_0x542e0c[_0x3542('0x2d')]=_[_0x3542('0x30')](db[_0x3542('0x2a')][_0x3542('0x2b')]);_0x542e0c['query']=_[_0x3542('0x30')](_0xb12441['query']);_0x542e0c[_0x3542('0x31')]=_[_0x3542('0x43')](_0x542e0c[_0x3542('0x2d')],_0x542e0c['query']);_0x4bf45a[_0x3542('0x33')]=_[_0x3542('0x43')](_0x542e0c['model'],qs[_0x3542('0x32')](_0xb12441[_0x3542('0x2f')][_0x3542('0x32')]));_0x4bf45a[_0x3542('0x33')]=_0x4bf45a[_0x3542('0x33')][_0x3542('0x44')]?_0x4bf45a[_0x3542('0x33')]:_0x542e0c[_0x3542('0x2d')];if(_0xb12441['query']['includeAll']){_0x4bf45a['include']=[{'all':!![]}];}_0x4bf45a=_[_0x3542('0x3a')]({},_0x4bf45a,_0xb12441[_0x3542('0x3c')]);return db[_0x3542('0x2a')][_0x3542('0x45')](_0x4bf45a)[_0x3542('0x24')](handleEntityNotFound(_0x2b54b9,null))[_0x3542('0x24')](respondWithResult(_0x2b54b9,null))[_0x3542('0x40')](handleError(_0x2b54b9,null));};exports['create']=function(_0x157683,_0x14b960){return db[_0x3542('0x2a')][_0x3542('0x46')](_0x157683['body'],{})[_0x3542('0x24')](respondWithResult(_0x14b960,0xc9))[_0x3542('0x40')](handleError(_0x14b960,null));};exports['update']=function(_0x528f8c,_0x1fb253){if(_0x528f8c[_0x3542('0x47')]['id']){delete _0x528f8c[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x528f8c[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x1fb253,null))['then'](saveUpdates(_0x528f8c[_0x3542('0x47')],null))[_0x3542('0x24')](respondWithResult(_0x1fb253,null))[_0x3542('0x40')](handleError(_0x1fb253,null));};exports[_0x3542('0x48')]=function(_0x1ebc82,_0x28be34){return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x1ebc82[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x28be34,null))['then'](removeEntity(_0x28be34,null))[_0x3542('0x40')](handleError(_0x28be34,null));};exports['getConfigurations']=function(_0x5a798a,_0x572e7a,_0x286222){var _0xd5c5c3={};var _0x381885={};var _0x48cfc4;var _0x2db495;return db[_0x3542('0x2a')]['findOne']({'where':{'id':_0x5a798a[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x572e7a,null))[_0x3542('0x24')](function(_0x196c59){if(_0x196c59){_0x48cfc4=_0x196c59;_0x381885[_0x3542('0x2d')]=_['keys'](db[_0x3542('0x49')][_0x3542('0x2b')]);_0x381885[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5a798a[_0x3542('0x2f')]);_0x381885['filters']=_['intersection'](_0x381885[_0x3542('0x2d')],_0x381885[_0x3542('0x2f')]);_0xd5c5c3[_0x3542('0x33')]=_['intersection'](_0x381885[_0x3542('0x2d')],qs[_0x3542('0x32')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x32')]));_0xd5c5c3[_0x3542('0x33')]=_0xd5c5c3['attributes']['length']?_0xd5c5c3[_0x3542('0x33')]:_0x381885['model'];_0xd5c5c3[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x5a798a['query'][_0x3542('0x36')]);_0xd5c5c3[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x5a798a[_0x3542('0x2f')],_0x381885['filters']));if(_0x5a798a['query'][_0x3542('0x39')]){_0xd5c5c3['where']=_[_0x3542('0x3a')](_0xd5c5c3[_0x3542('0x37')],{'$or':_[_0x3542('0x2e')](_0xd5c5c3['attributes'],function(_0xd9c90c){var _0x1f8ddb={};_0x1f8ddb[_0xd9c90c]={'$like':'%'+_0x5a798a[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x1f8ddb;})});}_0xd5c5c3=_[_0x3542('0x3a')]({},_0xd5c5c3,_0x5a798a[_0x3542('0x3c')]);return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})[_0x3542('0x24')](function(_0x3ee446){if(_0x3ee446){_0x2db495=_0x3ee446[_0x3542('0x44')];if(!_0x5a798a[_0x3542('0x2f')][_0x3542('0x34')](_0x3542('0x4a'))){_0xd5c5c3['limit']=qs[_0x3542('0x1e')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1e')]);_0xd5c5c3[_0x3542('0x1d')]=qs['offset'](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1d')]);}return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})['then'](function(_0x2908e5){if(_0x2908e5){return _0x2908e5?{'count':_0x2db495,'rows':_0x2908e5}:null;}})['then'](respondWithResult(_0x572e7a,null))[_0x3542('0x40')](handleError(_0x572e7a,null));};exports['addConfiguration']=function(_0x484204,_0x42a34a,_0x471408){if(_0x484204[_0x3542('0x47')]['id']){delete _0x484204[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x4b')]({'where':{'id':_0x484204[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a34a,null))[_0x3542('0x24')](function(_0xf1cf57){if(_0xf1cf57){_0x484204[_0x3542('0x47')][_0x3542('0x4c')]=_0xf1cf57['id'];_0x484204[_0x3542('0x47')]['Subjects']=integrations[_0x3542('0x4d')](_0x484204[_0x3542('0x47')][_0x3542('0x4e')],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);_0x484204[_0x3542('0x47')][_0x3542('0x50')]=integrations['getDescriptions'](_0x484204[_0x3542('0x47')]['channel'],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);return db[_0x3542('0x49')][_0x3542('0x46')](_0x484204['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x3542('0x51')],'as':_0x3542('0x50')}]});}return null;})[_0x3542('0x24')](respondWithResult(_0x42a34a,null))[_0x3542('0x40')](handleError(_0x42a34a,null));};exports[_0x3542('0x52')]=function(_0x2afc71,_0x3c84fa,_0x77f0af){var _0x2b0de0='';return db['ZendeskAccount'][_0x3542('0x4b')]({'where':{'id':_0x2afc71[_0x3542('0x42')]['id']},'attributes':['id',_0x3542('0x53'),_0x3542('0x54'),_0x3542('0x55'),'authType','remoteUri']})[_0x3542('0x24')](handleEntityNotFound(_0x3c84fa,null))[_0x3542('0x24')](function(_0x52c26d){if(_0x52c26d){_0x2b0de0=_0x52c26d[_0x3542('0x56')];var _0x4b5327=_0x2b0de0[_0x3542('0x57')](-0x1);if(_0x4b5327==='/'){_0x2b0de0=_0x2b0de0['substring'](0x0,_0x2b0de0[_0x3542('0x58')](_0x4b5327));}var _0x153e1b={'method':'GET','uri':util['format']('%s/%s',_0x2b0de0,_0x3542('0x59')),'json':!![]};switch(_0x52c26d['authType']){case _0x3542('0x54'):_0x153e1b[_0x3542('0x5a')]={'Authorization':util['format'](_0x3542('0x5b'),new Buffer(util[_0x3542('0x5c')](_0x3542('0x5d'),_0x52c26d['username'],_0x52c26d[_0x3542('0x54')]))['toString'](_0x3542('0x5e')))};break;case'token':_0x153e1b[_0x3542('0x5a')]={'Authorization':util[_0x3542('0x5c')](_0x3542('0x5b'),new Buffer(util['format'](_0x3542('0x5f'),_0x52c26d[_0x3542('0x53')],_0x52c26d[_0x3542('0x55')]))[_0x3542('0x60')]('base64'))};break;default:throw new db['Sequelize'][(_0x3542('0x61'))](_0x3542('0x62'));}return rp(_0x153e1b);}})[_0x3542('0x24')](function(_0xaa97d5){if(_0xaa97d5){var _0x191fdd=[_0x3542('0x63'),_0x3542('0x64'),_0x3542('0x65'),_0x3542('0x66')];_[_0x3542('0x67')](_0xaa97d5[_0x3542('0x59')],function(_0x1c318c){return _0x191fdd[_0x3542('0x68')](_0x1c318c[_0x3542('0x4f')]);});return{'count':_0xaa97d5[_0x3542('0x59')][_0x3542('0x44')],'rows':_[_0x3542('0x2e')](_0xaa97d5[_0x3542('0x59')],function(_0x4e04b6){return{'id':_0x4e04b6['id'],'name':_0x4e04b6[_0x3542('0x69')]>0x7?_0x4e04b6[_0x3542('0x6a')]:_0x4e04b6['type'],'custom':_0x4e04b6['position']>0x7?!![]:![],'options':_0x4e04b6[_0x3542('0x6b')]?_0x4e04b6[_0x3542('0x6b')]:_0x4e04b6[_0x3542('0x6c')]?_0x4e04b6[_0x3542('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3c84fa,null))[_0x3542('0x40')](function(_0x2d17ce){var _0x54e723=_0x2afc71[_0x3542('0x2f')]['test']?0x1f4:_0x2d17ce[_0x3542('0x6d')]||0x1f4;logger['error'](_0x3542('0x6e'),_0x3542('0x52'),_0x54e723,JSON[_0x3542('0x6f')](_0x2d17ce));delete _0x2d17ce[_0x3542('0x27')];if(_0x54e723===0x191){_0x54e723=0x190;}_0x3c84fa[_0x3542('0x1a')](_0x54e723)[_0x3542('0x28')](_0x2afc71[_0x3542('0x2f')]['test']?{'message':_0x3542('0x70'),'statusCode':_0x2d17ce['statusCode']}:_0x2d17ce);});}; \ No newline at end of file +var _0xd914=['channel','ZendeskField','username','token','authType','remoteUri','substring','lastIndexOf','format','%s/%s','ticket_fields','password','headers','%s:%s','Basic\x20%s','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','group','position','title','system_field_options','custom_field_options','test','statusCode','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','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','getConfigurations','findOne','ZendeskConfiguration','order','pick','map','options','nolimit','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd914,0x17f));var _0x4d91=function(_0x8c8176,_0x5360a1){_0x8c8176=_0x8c8176-0x0;var _0x4dc47b=_0xd914[_0x8c8176];return _0x4dc47b;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];var integrations=require(_0x4d91('0x1b'));function respondWithStatusCode(_0x318e0c,_0x4ea591){_0x4ea591=_0x4ea591||0xcc;return function(_0x577a69){if(_0x577a69){return _0x318e0c[_0x4d91('0x1c')](_0x4ea591);}return _0x318e0c[_0x4d91('0x1d')](_0x4ea591)[_0x4d91('0x1e')]();};}function respondWithResult(_0x3c9fd6,_0x33fbd4){_0x33fbd4=_0x33fbd4||0xc8;return function(_0x25bafc){if(_0x25bafc){return _0x3c9fd6[_0x4d91('0x1d')](_0x33fbd4)['json'](_0x25bafc);}};}function respondWithFilteredResult(_0x3a8ec9,_0x42631a){return function(_0x1e2ef7){if(_0x1e2ef7){var _0xb92681=typeof _0x42631a[_0x4d91('0x1f')]==='undefined'&&typeof _0x42631a[_0x4d91('0x20')]===_0x4d91('0x21');var _0x241564=_0x1e2ef7[_0x4d91('0x22')];var _0x4cfa40=_0xb92681?0x0:_0x42631a[_0x4d91('0x1f')];var _0x3b579b=_0xb92681?_0x1e2ef7[_0x4d91('0x22')]:_0x42631a['offset']+_0x42631a[_0x4d91('0x20')];var _0x127911;if(_0x3b579b>=_0x241564){_0x3b579b=_0x241564;_0x127911=0xc8;}else{_0x127911=0xce;}_0x3a8ec9[_0x4d91('0x1d')](_0x127911);return _0x3a8ec9[_0x4d91('0x23')](_0x4d91('0x24'),_0x4cfa40+'-'+_0x3b579b+'/'+_0x241564)[_0x4d91('0x25')](_0x1e2ef7);}return null;};}function patchUpdates(_0xc1d44f){return function(_0x193ca9){try{jsonpatch[_0x4d91('0x26')](_0x193ca9,_0xc1d44f,!![]);}catch(_0x226d85){return BPromise['reject'](_0x226d85);}return _0x193ca9[_0x4d91('0x27')]();};}function saveUpdates(_0x5f5236,_0x57913e){return function(_0x74a697){if(_0x74a697){return _0x74a697[_0x4d91('0x28')](_0x5f5236)[_0x4d91('0x29')](function(_0x9cb864){return _0x9cb864;});}return null;};}function removeEntity(_0x7d8cbf,_0x12b722){return function(_0x100cd4){if(_0x100cd4){return _0x100cd4[_0x4d91('0x2a')]()['then'](function(){_0x7d8cbf['status'](0xcc)[_0x4d91('0x1e')]();});}};}function handleEntityNotFound(_0x112923,_0x3bed98){return function(_0x45fc91){if(!_0x45fc91){_0x112923[_0x4d91('0x1c')](0x194);}return _0x45fc91;};}function handleError(_0x2c7d7a,_0x14bdb4){_0x14bdb4=_0x14bdb4||0x1f4;return function(_0x560966){logger[_0x4d91('0x2b')](_0x560966[_0x4d91('0x2c')]);if(_0x560966[_0x4d91('0x2d')]){delete _0x560966['name'];}_0x2c7d7a['status'](_0x14bdb4)[_0x4d91('0x2e')](_0x560966);};}exports[_0x4d91('0x2f')]=function(_0x5ed948,_0x50fe76){var _0x42d5a0={},_0x2d6981={},_0x43371e={'count':0x0,'rows':[]};var _0x17c7bc=_['map'](db[_0x4d91('0x30')][_0x4d91('0x31')],function(_0x468e95){return{'name':_0x468e95[_0x4d91('0x32')],'type':_0x468e95[_0x4d91('0x33')][_0x4d91('0x34')]};});_0x2d6981[_0x4d91('0x35')]=_['map'](_0x17c7bc,_0x4d91('0x2d'));_0x2d6981['query']=_['keys'](_0x5ed948[_0x4d91('0x36')]);_0x2d6981[_0x4d91('0x37')]=_['intersection'](_0x2d6981[_0x4d91('0x35')],_0x2d6981[_0x4d91('0x36')]);_0x42d5a0[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x2d6981[_0x4d91('0x35')],qs['fields'](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x42d5a0[_0x4d91('0x38')]=_0x42d5a0[_0x4d91('0x38')][_0x4d91('0x3b')]?_0x42d5a0[_0x4d91('0x38')]:_0x2d6981['model'];if(!_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3c')]('nolimit')){_0x42d5a0[_0x4d91('0x20')]=qs[_0x4d91('0x20')](_0x5ed948[_0x4d91('0x36')]['limit']);_0x42d5a0[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x1f')]);}_0x42d5a0['order']=qs[_0x4d91('0x3d')](_0x5ed948[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x42d5a0[_0x4d91('0x3e')]=qs['filters'](_['pick'](_0x5ed948[_0x4d91('0x36')],_0x2d6981[_0x4d91('0x37')]),_0x17c7bc);if(_0x5ed948['query'][_0x4d91('0x3f')]){_0x42d5a0[_0x4d91('0x3e')]=_[_0x4d91('0x40')](_0x42d5a0[_0x4d91('0x3e')],{'$or':_['map'](_0x17c7bc,function(_0x2eb7c7){if(_0x2eb7c7[_0x4d91('0x33')]!=='VIRTUAL'){var _0x1ba6cd={};_0x1ba6cd[_0x2eb7c7['name']]={'$like':'%'+_0x5ed948[_0x4d91('0x36')]['filter']+'%'};return _0x1ba6cd;}})});}_0x42d5a0=_[_0x4d91('0x40')]({},_0x42d5a0,_0x5ed948['options']);var _0x24fc69={'where':_0x42d5a0[_0x4d91('0x3e')]};return db[_0x4d91('0x30')][_0x4d91('0x22')](_0x24fc69)['then'](function(_0x5bcc9b){_0x43371e[_0x4d91('0x22')]=_0x5bcc9b;if(_0x5ed948['query'][_0x4d91('0x41')]){_0x42d5a0[_0x4d91('0x42')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x4d91('0x43')](_0x42d5a0);})[_0x4d91('0x29')](function(_0x14db37){_0x43371e[_0x4d91('0x44')]=_0x14db37;return _0x43371e;})[_0x4d91('0x29')](respondWithFilteredResult(_0x50fe76,_0x42d5a0))[_0x4d91('0x45')](handleError(_0x50fe76,null));};exports[_0x4d91('0x46')]=function(_0x4f6254,_0x1e4c6d){var _0x4c70af={'raw':![],'where':{'id':_0x4f6254[_0x4d91('0x47')]['id']}},_0x41c06a={};_0x41c06a[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x30')][_0x4d91('0x31')]);_0x41c06a['query']=_['keys'](_0x4f6254[_0x4d91('0x36')]);_0x41c06a[_0x4d91('0x37')]=_['intersection'](_0x41c06a[_0x4d91('0x35')],_0x41c06a[_0x4d91('0x36')]);_0x4c70af[_0x4d91('0x38')]=_[_0x4d91('0x39')](_0x41c06a[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x4f6254[_0x4d91('0x36')][_0x4d91('0x3a')]));_0x4c70af[_0x4d91('0x38')]=_0x4c70af['attributes']['length']?_0x4c70af[_0x4d91('0x38')]:_0x41c06a['model'];if(_0x4f6254[_0x4d91('0x36')][_0x4d91('0x41')]){_0x4c70af[_0x4d91('0x42')]=[{'all':!![]}];}_0x4c70af=_[_0x4d91('0x40')]({},_0x4c70af,_0x4f6254['options']);return db[_0x4d91('0x30')]['find'](_0x4c70af)['then'](handleEntityNotFound(_0x1e4c6d,null))[_0x4d91('0x29')](respondWithResult(_0x1e4c6d,null))[_0x4d91('0x45')](handleError(_0x1e4c6d,null));};exports[_0x4d91('0x49')]=function(_0xa03d75,_0x1f91ec){return db[_0x4d91('0x30')]['create'](_0xa03d75[_0x4d91('0x4a')],{})[_0x4d91('0x29')](respondWithResult(_0x1f91ec,0xc9))[_0x4d91('0x45')](handleError(_0x1f91ec,null));};exports[_0x4d91('0x28')]=function(_0x106e5b,_0x44e9ec){if(_0x106e5b[_0x4d91('0x4a')]['id']){delete _0x106e5b[_0x4d91('0x4a')]['id'];}return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x106e5b[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x44e9ec,null))[_0x4d91('0x29')](saveUpdates(_0x106e5b['body'],null))[_0x4d91('0x29')](respondWithResult(_0x44e9ec,null))[_0x4d91('0x45')](handleError(_0x44e9ec,null));};exports[_0x4d91('0x2a')]=function(_0x386935,_0x436a3d){return db[_0x4d91('0x30')][_0x4d91('0x4b')]({'where':{'id':_0x386935[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x436a3d,null))[_0x4d91('0x29')](removeEntity(_0x436a3d,null))[_0x4d91('0x45')](handleError(_0x436a3d,null));};exports[_0x4d91('0x4c')]=function(_0x2bba43,_0x26ecd7,_0x19e57e){var _0x5765ce={};var _0x4aae23={};var _0x392cc3;var _0x2159e4;return db[_0x4d91('0x30')][_0x4d91('0x4d')]({'where':{'id':_0x2bba43[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x26ecd7,null))[_0x4d91('0x29')](function(_0x4138c5){if(_0x4138c5){_0x392cc3=_0x4138c5;_0x4aae23[_0x4d91('0x35')]=_[_0x4d91('0x48')](db[_0x4d91('0x4e')][_0x4d91('0x31')]);_0x4aae23[_0x4d91('0x36')]=_[_0x4d91('0x48')](_0x2bba43[_0x4d91('0x36')]);_0x4aae23[_0x4d91('0x37')]=_[_0x4d91('0x39')](_0x4aae23['model'],_0x4aae23['query']);_0x5765ce['attributes']=_[_0x4d91('0x39')](_0x4aae23[_0x4d91('0x35')],qs[_0x4d91('0x3a')](_0x2bba43['query'][_0x4d91('0x3a')]));_0x5765ce[_0x4d91('0x38')]=_0x5765ce[_0x4d91('0x38')]['length']?_0x5765ce['attributes']:_0x4aae23['model'];_0x5765ce[_0x4d91('0x4f')]=qs[_0x4d91('0x3d')](_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3d')]);_0x5765ce[_0x4d91('0x3e')]=qs['filters'](_[_0x4d91('0x50')](_0x2bba43[_0x4d91('0x36')],_0x4aae23['filters']));if(_0x2bba43['query'][_0x4d91('0x3f')]){_0x5765ce['where']=_[_0x4d91('0x40')](_0x5765ce[_0x4d91('0x3e')],{'$or':_[_0x4d91('0x51')](_0x5765ce['attributes'],function(_0x2e0bff){var _0x3d6c26={};_0x3d6c26[_0x2e0bff]={'$like':'%'+_0x2bba43[_0x4d91('0x36')][_0x4d91('0x3f')]+'%'};return _0x3d6c26;})});}_0x5765ce=_[_0x4d91('0x40')]({},_0x5765ce,_0x2bba43[_0x4d91('0x52')]);return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})['then'](function(_0x533572){if(_0x533572){_0x2159e4=_0x533572['length'];if(!_0x2bba43['query'][_0x4d91('0x3c')](_0x4d91('0x53'))){_0x5765ce[_0x4d91('0x20')]=qs['limit'](_0x2bba43[_0x4d91('0x36')]['limit']);_0x5765ce[_0x4d91('0x1f')]=qs[_0x4d91('0x1f')](_0x2bba43['query']['offset']);}return _0x392cc3[_0x4d91('0x4c')](_0x5765ce);}})[_0x4d91('0x29')](function(_0x31150f){if(_0x31150f){return _0x31150f?{'count':_0x2159e4,'rows':_0x31150f}:null;}})[_0x4d91('0x29')](respondWithResult(_0x26ecd7,null))[_0x4d91('0x45')](handleError(_0x26ecd7,null));};exports[_0x4d91('0x54')]=function(_0x7a94e2,_0x42e550,_0xd384a9){if(_0x7a94e2[_0x4d91('0x4a')]['id']){delete _0x7a94e2['body']['id'];}return db['ZendeskAccount'][_0x4d91('0x4d')]({'where':{'id':_0x7a94e2[_0x4d91('0x47')]['id']}})[_0x4d91('0x29')](handleEntityNotFound(_0x42e550,null))[_0x4d91('0x29')](function(_0x16ba26){if(_0x16ba26){_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x55')]=_0x16ba26['id'];_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x56')]=integrations['getSubjects'](_0x7a94e2['body']['channel'],_0x7a94e2['body'][_0x4d91('0x33')]);_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x57')]=integrations[_0x4d91('0x58')](_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x59')],_0x7a94e2[_0x4d91('0x4a')][_0x4d91('0x33')]);return db[_0x4d91('0x4e')][_0x4d91('0x49')](_0x7a94e2[_0x4d91('0x4a')],{'include':[{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x56')},{'model':db[_0x4d91('0x5a')],'as':_0x4d91('0x57')}]});}return null;})[_0x4d91('0x29')](respondWithResult(_0x42e550,null))[_0x4d91('0x45')](handleError(_0x42e550,null));};exports['getFields']=function(_0x4062c6,_0x1be4b1,_0xc4ef10){var _0x2e2105='';return db[_0x4d91('0x30')]['findOne']({'where':{'id':_0x4062c6[_0x4d91('0x47')]['id']},'attributes':['id',_0x4d91('0x5b'),'password',_0x4d91('0x5c'),_0x4d91('0x5d'),_0x4d91('0x5e')]})[_0x4d91('0x29')](handleEntityNotFound(_0x1be4b1,null))[_0x4d91('0x29')](function(_0x4bc5a0){if(_0x4bc5a0){_0x2e2105=_0x4bc5a0[_0x4d91('0x5e')];var _0x2a5bc0=_0x2e2105['slice'](-0x1);if(_0x2a5bc0==='/'){_0x2e2105=_0x2e2105[_0x4d91('0x5f')](0x0,_0x2e2105[_0x4d91('0x60')](_0x2a5bc0));}var _0xd94b29={'method':'GET','uri':util[_0x4d91('0x61')](_0x4d91('0x62'),_0x2e2105,_0x4d91('0x63')),'json':!![]};switch(_0x4bc5a0[_0x4d91('0x5d')]){case _0x4d91('0x64'):_0xd94b29[_0x4d91('0x65')]={'Authorization':util[_0x4d91('0x61')]('Basic\x20%s',new Buffer(util[_0x4d91('0x61')](_0x4d91('0x66'),_0x4bc5a0['username'],_0x4bc5a0[_0x4d91('0x64')]))['toString']('base64'))};break;case _0x4d91('0x5c'):_0xd94b29['headers']={'Authorization':util[_0x4d91('0x61')](_0x4d91('0x67'),new Buffer(util[_0x4d91('0x61')](_0x4d91('0x68'),_0x4bc5a0[_0x4d91('0x5b')],_0x4bc5a0[_0x4d91('0x5c')]))[_0x4d91('0x69')]('base64'))};break;default:throw new db['Sequelize'][(_0x4d91('0x6a'))](_0x4d91('0x6b'));}return rp(_0xd94b29);}})[_0x4d91('0x29')](function(_0x42164f){if(_0x42164f){var _0x1e3838=['subject','description',_0x4d91('0x6c'),'assignee'];_['remove'](_0x42164f[_0x4d91('0x63')],function(_0x54fea8){return _0x1e3838['includes'](_0x54fea8[_0x4d91('0x33')]);});return{'count':_0x42164f[_0x4d91('0x63')][_0x4d91('0x3b')],'rows':_['map'](_0x42164f['ticket_fields'],function(_0x52604d){return{'id':_0x52604d['id'],'name':_0x52604d[_0x4d91('0x6d')]>0x7?_0x52604d[_0x4d91('0x6e')]:_0x52604d[_0x4d91('0x33')],'custom':_0x52604d[_0x4d91('0x6d')]>0x7?!![]:![],'options':_0x52604d[_0x4d91('0x6f')]?_0x52604d[_0x4d91('0x6f')]:_0x52604d[_0x4d91('0x70')]?_0x52604d[_0x4d91('0x70')]:[]};})};}})[_0x4d91('0x29')](respondWithResult(_0x1be4b1,null))['catch'](function(_0xb9d1ff){var _0x579a9e=_0x4062c6['query'][_0x4d91('0x71')]?0x1f4:_0xb9d1ff[_0x4d91('0x72')]||0x1f4;logger[_0x4d91('0x2b')](_0x4d91('0x73'),'getFields',_0x579a9e,JSON[_0x4d91('0x74')](_0xb9d1ff));delete _0xb9d1ff[_0x4d91('0x2d')];if(_0x579a9e===0x191){_0x579a9e=0x190;}_0x1be4b1[_0x4d91('0x1d')](_0x579a9e)[_0x4d91('0x2e')](_0x4062c6[_0x4d91('0x36')][_0x4d91('0x71')]?{'message':_0x4d91('0x75'),'statusCode':_0xb9d1ff['statusCode']}:_0xb9d1ff);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 4d31524..ad31ec6 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 _0x241f=['ZendeskAccount','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x550631,_0x327b95){var _0x559201=function(_0x4e39c5){while(--_0x4e39c5){_0x550631['push'](_0x550631['shift']());}};_0x559201(++_0x327b95);}(_0x241f,0x169));var _0xf241=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x241f[_0x468a77];return _0x2d1c33;};'use strict';var _=require(_0xf241('0x0'));var util=require(_0xf241('0x1'));var logger=require(_0xf241('0x2'))(_0xf241('0x3'));var moment=require(_0xf241('0x4'));var BPromise=require('bluebird');var rp=require(_0xf241('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf241('0x6'));var config=require(_0xf241('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xf241('0x8'));module[_0xf241('0x9')]=function(_0x3f3fcd,_0x48b70c){return _0x3f3fcd[_0xf241('0xa')](_0xf241('0xb'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c69=['exports','define','ZendeskAccount','int_zendesk_accounts','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration'];(function(_0x434871,_0xb46761){var _0x51c79b=function(_0x14082d){while(--_0x14082d){_0x434871['push'](_0x434871['shift']());}};_0x51c79b(++_0xb46761);}(_0x8c69,0x163));var _0x98c6=function(_0x1e1597,_0x199ebe){_0x1e1597=_0x1e1597-0x0;var _0x252e7f=_0x8c69[_0x1e1597];return _0x252e7f;};'use strict';var _=require(_0x98c6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x98c6('0x1'));var moment=require(_0x98c6('0x2'));var BPromise=require(_0x98c6('0x3'));var rp=require(_0x98c6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x98c6('0x5'));var config=require(_0x98c6('0x6'));var attributes=require(_0x98c6('0x7'));var integrations=require(_0x98c6('0x8'));module[_0x98c6('0x9')]=function(_0x5554a1,_0x27ef9a){return _0x5554a1[_0x98c6('0xa')](_0x98c6('0xb'),attributes,{'tableName':_0x98c6('0xc'),'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 6502bcc..416da71 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 _0x58ed=['attributes','limit','include','model','map','debug','stringify','GetZendeskAccount','ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where'];(function(_0x234a23,_0xed4a93){var _0x1addf6=function(_0x392b67){while(--_0x392b67){_0x234a23['push'](_0x234a23['shift']());}};_0x1addf6(++_0xed4a93);}(_0x58ed,0xc4));var _0xd58e=function(_0x16b065,_0x516936){_0x16b065=_0x16b065-0x0;var _0x9cfcbe=_0x58ed[_0x16b065];return _0x9cfcbe;};'use strict';var _=require(_0xd58e('0x0'));var util=require(_0xd58e('0x1'));var moment=require(_0xd58e('0x2'));var BPromise=require('bluebird');var rs=require(_0xd58e('0x3'));var fs=require('fs');var Redis=require(_0xd58e('0x4'));var db=require(_0xd58e('0x5'))['db'];var utils=require(_0xd58e('0x6'));var logger=require(_0xd58e('0x7'))(_0xd58e('0x8'));var config=require(_0xd58e('0x9'));var jayson=require(_0xd58e('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x381607,_0x2be595,_0x6b9fad){return new BPromise(function(_0x1538b5,_0x324362){return client[_0xd58e('0xb')](_0x381607,_0x6b9fad)[_0xd58e('0xc')](function(_0x31bcec){logger[_0xd58e('0xd')](_0xd58e('0xe'),_0x2be595,_0xd58e('0xf'));logger['debug'](_0xd58e('0x10'),_0x2be595,_0xd58e('0xf'),JSON['stringify'](_0x31bcec));if(_0x31bcec[_0xd58e('0x11')]){if(_0x31bcec['error'][_0xd58e('0x12')]===0x1f4){logger[_0xd58e('0x11')](_0xd58e('0xe'),_0x2be595,_0x31bcec[_0xd58e('0x11')][_0xd58e('0x13')]);return _0x324362(_0x31bcec[_0xd58e('0x11')]['message']);}logger[_0xd58e('0x11')](_0xd58e('0xe'),_0x2be595,_0x31bcec['error'][_0xd58e('0x13')]);return _0x1538b5(_0x31bcec[_0xd58e('0x11')]['message']);}else{logger[_0xd58e('0xd')](_0xd58e('0xe'),_0x2be595,_0xd58e('0xf'));_0x1538b5(_0x31bcec[_0xd58e('0x14')][_0xd58e('0x13')]);}})[_0xd58e('0x15')](function(_0x75648){logger[_0xd58e('0x11')](_0xd58e('0xe'),_0x2be595,_0x75648);_0x324362(_0x75648);});});}exports['GetZendeskAccount']=function(_0x519751){var _0x224bed=this;return new Promise(function(_0x5d5dab,_0x1052d8){return db['ZendeskAccount'][_0xd58e('0x16')]({'raw':_0x519751[_0xd58e('0x17')]?_0x519751[_0xd58e('0x17')][_0xd58e('0x18')]===undefined?!![]:![]:!![],'where':_0x519751[_0xd58e('0x17')]?_0x519751[_0xd58e('0x17')][_0xd58e('0x19')]||null:null,'attributes':_0x519751[_0xd58e('0x17')]?_0x519751[_0xd58e('0x17')][_0xd58e('0x1a')]||null:null,'limit':_0x519751['options']?_0x519751[_0xd58e('0x17')][_0xd58e('0x1b')]||null:null,'include':_0x519751[_0xd58e('0x17')]?_0x519751[_0xd58e('0x17')]['include']?_['map'](_0x519751[_0xd58e('0x17')][_0xd58e('0x1c')],function(_0xf8702c){return{'model':db[_0xf8702c[_0xd58e('0x1d')]],'as':_0xf8702c['as'],'attributes':_0xf8702c['attributes'],'include':_0xf8702c['include']?_[_0xd58e('0x1e')](_0xf8702c[_0xd58e('0x1c')],function(_0x5175cb){return{'model':db[_0x5175cb[_0xd58e('0x1d')]],'as':_0x5175cb['as'],'attributes':_0x5175cb[_0xd58e('0x1a')],'include':_0x5175cb[_0xd58e('0x1c')]?_['map'](_0x5175cb[_0xd58e('0x1c')],function(_0x5b7367){return{'model':db[_0x5b7367[_0xd58e('0x1d')]],'as':_0x5b7367['as'],'attributes':_0x5b7367['attributes']};}):[]};}):[]};}):[]:[]})[_0xd58e('0xc')](function(_0x5522e7){logger[_0xd58e('0xd')]('GetZendeskAccount',_0x519751);logger[_0xd58e('0x1f')]('GetZendeskAccount',_0x519751,JSON[_0xd58e('0x20')](_0x5522e7));_0x5d5dab(_0x5522e7);})[_0xd58e('0x15')](function(_0x1d2688){logger['error'](_0xd58e('0x21'),_0x1d2688['message'],_0x519751);_0x1052d8(_0x224bed[_0xd58e('0x11')](0x1f4,_0x1d2688[_0xd58e('0x13')]));});});};exports[_0xd58e('0x22')]=function(_0x137d31){var _0x3f2ce9=this;return new Promise(function(_0x2ebcbd,_0x30dfdf){return db[_0xd58e('0x23')][_0xd58e('0x24')]({'raw':_0x137d31[_0xd58e('0x17')]?_0x137d31[_0xd58e('0x17')][_0xd58e('0x18')]===undefined?!![]:![]:!![],'where':_0x137d31[_0xd58e('0x17')]?_0x137d31[_0xd58e('0x17')][_0xd58e('0x19')]||null:null,'attributes':_0x137d31[_0xd58e('0x17')]?_0x137d31[_0xd58e('0x17')][_0xd58e('0x1a')]||null:null,'include':_0x137d31[_0xd58e('0x17')]?_0x137d31[_0xd58e('0x17')]['include']?_[_0xd58e('0x1e')](_0x137d31['options']['include'],function(_0x3541f9){return{'model':db[_0x3541f9['model']],'as':_0x3541f9['as'],'attributes':_0x3541f9[_0xd58e('0x1a')],'include':_0x3541f9[_0xd58e('0x1c')]?_[_0xd58e('0x1e')](_0x3541f9[_0xd58e('0x1c')],function(_0x2e867c){return{'model':db[_0x2e867c[_0xd58e('0x1d')]],'as':_0x2e867c['as'],'attributes':_0x2e867c[_0xd58e('0x1a')],'include':_0x2e867c[_0xd58e('0x1c')]?_[_0xd58e('0x1e')](_0x2e867c[_0xd58e('0x1c')],function(_0x44963f){return{'model':db[_0x44963f[_0xd58e('0x1d')]],'as':_0x44963f['as'],'attributes':_0x44963f[_0xd58e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd58e('0xc')](function(_0x4d0af6){logger['info'](_0xd58e('0x22'),_0x137d31);logger[_0xd58e('0x1f')](_0xd58e('0x22'),_0x137d31,JSON[_0xd58e('0x20')](_0x4d0af6));_0x2ebcbd(_0x4d0af6);})[_0xd58e('0x15')](function(_0x23b6a1){logger[_0xd58e('0x11')](_0xd58e('0x22'),_0x23b6a1[_0xd58e('0x13')],_0x137d31);_0x30dfdf(_0x3f2ce9[_0xd58e('0x11')](0x1f4,_0x23b6a1[_0xd58e('0x13')]));});});}; \ No newline at end of file +var _0x13ae=['where','attributes','limit','include','map','model','then','ZendeskAccount','raw','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','findAll','options'];(function(_0x3b0ea6,_0x391461){var _0x3b5d12=function(_0x37d5f3){while(--_0x37d5f3){_0x3b0ea6['push'](_0x3b0ea6['shift']());}};_0x3b5d12(++_0x391461);}(_0x13ae,0x1f4));var _0xe13a=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x13ae[_0x432682];return _0x463d05;};'use strict';var _=require(_0xe13a('0x0'));var util=require(_0xe13a('0x1'));var moment=require(_0xe13a('0x2'));var BPromise=require(_0xe13a('0x3'));var rs=require(_0xe13a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe13a('0x5'))['db'];var utils=require(_0xe13a('0x6'));var logger=require(_0xe13a('0x7'))(_0xe13a('0x8'));var config=require(_0xe13a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe13a('0xa')][_0xe13a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x274f26,_0x5044b5,_0x486411){return new BPromise(function(_0x56f656,_0x474377){return client[_0xe13a('0xc')](_0x274f26,_0x486411)['then'](function(_0x5150ba){logger[_0xe13a('0xd')](_0xe13a('0xe'),_0x5044b5,_0xe13a('0xf'));logger[_0xe13a('0x10')](_0xe13a('0x11'),_0x5044b5,_0xe13a('0xf'),JSON[_0xe13a('0x12')](_0x5150ba));if(_0x5150ba[_0xe13a('0x13')]){if(_0x5150ba[_0xe13a('0x13')]['code']===0x1f4){logger['error'](_0xe13a('0xe'),_0x5044b5,_0x5150ba[_0xe13a('0x13')]['message']);return _0x474377(_0x5150ba[_0xe13a('0x13')][_0xe13a('0x14')]);}logger[_0xe13a('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x5044b5,_0x5150ba['error'][_0xe13a('0x14')]);return _0x56f656(_0x5150ba[_0xe13a('0x13')]['message']);}else{logger[_0xe13a('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x5044b5,_0xe13a('0xf'));_0x56f656(_0x5150ba['result'][_0xe13a('0x14')]);}})[_0xe13a('0x15')](function(_0x5428e1){logger[_0xe13a('0x13')](_0xe13a('0xe'),_0x5044b5,_0x5428e1);_0x474377(_0x5428e1);});});}exports[_0xe13a('0x16')]=function(_0x3b7f7d){var _0x3fbbcb=this;return new Promise(function(_0x44cd22,_0x5a9906){return db['ZendeskAccount'][_0xe13a('0x17')]({'raw':_0x3b7f7d[_0xe13a('0x18')]?_0x3b7f7d['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b7f7d[_0xe13a('0x18')]?_0x3b7f7d['options'][_0xe13a('0x19')]||null:null,'attributes':_0x3b7f7d[_0xe13a('0x18')]?_0x3b7f7d[_0xe13a('0x18')][_0xe13a('0x1a')]||null:null,'limit':_0x3b7f7d[_0xe13a('0x18')]?_0x3b7f7d['options'][_0xe13a('0x1b')]||null:null,'include':_0x3b7f7d['options']?_0x3b7f7d[_0xe13a('0x18')][_0xe13a('0x1c')]?_[_0xe13a('0x1d')](_0x3b7f7d[_0xe13a('0x18')]['include'],function(_0x40008c){return{'model':db[_0x40008c[_0xe13a('0x1e')]],'as':_0x40008c['as'],'attributes':_0x40008c[_0xe13a('0x1a')],'include':_0x40008c[_0xe13a('0x1c')]?_['map'](_0x40008c[_0xe13a('0x1c')],function(_0x27ea42){return{'model':db[_0x27ea42['model']],'as':_0x27ea42['as'],'attributes':_0x27ea42[_0xe13a('0x1a')],'include':_0x27ea42[_0xe13a('0x1c')]?_['map'](_0x27ea42[_0xe13a('0x1c')],function(_0x49a017){return{'model':db[_0x49a017[_0xe13a('0x1e')]],'as':_0x49a017['as'],'attributes':_0x49a017[_0xe13a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe13a('0x1f')](function(_0x1f78f4){logger['info'](_0xe13a('0x16'),_0x3b7f7d);logger[_0xe13a('0x10')](_0xe13a('0x16'),_0x3b7f7d,JSON[_0xe13a('0x12')](_0x1f78f4));_0x44cd22(_0x1f78f4);})[_0xe13a('0x15')](function(_0x4f77b0){logger[_0xe13a('0x13')]('GetZendeskAccount',_0x4f77b0[_0xe13a('0x14')],_0x3b7f7d);_0x5a9906(_0x3fbbcb['error'](0x1f4,_0x4f77b0[_0xe13a('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x34bc86){var _0x16ce7a=this;return new Promise(function(_0x55ed98,_0xc8944a){return db[_0xe13a('0x20')]['find']({'raw':_0x34bc86['options']?_0x34bc86[_0xe13a('0x18')][_0xe13a('0x21')]===undefined?!![]:![]:!![],'where':_0x34bc86['options']?_0x34bc86[_0xe13a('0x18')]['where']||null:null,'attributes':_0x34bc86[_0xe13a('0x18')]?_0x34bc86[_0xe13a('0x18')][_0xe13a('0x1a')]||null:null,'include':_0x34bc86['options']?_0x34bc86['options']['include']?_[_0xe13a('0x1d')](_0x34bc86[_0xe13a('0x18')][_0xe13a('0x1c')],function(_0x415710){return{'model':db[_0x415710[_0xe13a('0x1e')]],'as':_0x415710['as'],'attributes':_0x415710[_0xe13a('0x1a')],'include':_0x415710['include']?_[_0xe13a('0x1d')](_0x415710[_0xe13a('0x1c')],function(_0x32dbf9){return{'model':db[_0x32dbf9[_0xe13a('0x1e')]],'as':_0x32dbf9['as'],'attributes':_0x32dbf9[_0xe13a('0x1a')],'include':_0x32dbf9[_0xe13a('0x1c')]?_[_0xe13a('0x1d')](_0x32dbf9['include'],function(_0x394229){return{'model':db[_0x394229[_0xe13a('0x1e')]],'as':_0x394229['as'],'attributes':_0x394229['attributes']};}):[]};}):[]};}):[]:[]})[_0xe13a('0x1f')](function(_0x1406e6){logger[_0xe13a('0xd')](_0xe13a('0x22'),_0x34bc86);logger[_0xe13a('0x10')]('ShowZendeskAccount',_0x34bc86,JSON['stringify'](_0x1406e6));_0x55ed98(_0x1406e6);})[_0xe13a('0x15')](function(_0x2becba){logger[_0xe13a('0x13')](_0xe13a('0x22'),_0x2becba[_0xe13a('0x14')],_0x34bc86);_0xc8944a(_0x16ce7a['error'](0x1f4,_0x2becba[_0xe13a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 8546c04..736a79b 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 _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0x5ece84,_0xc06c9f){var _0x2a12c4=function(_0x133bf3){while(--_0x133bf3){_0x5ece84['push'](_0x5ece84['shift']());}};_0x2a12c4(++_0xc06c9f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x12627d,_0x108eb3){_0x12627d=_0x12627d-0x0;var _0x11b620=_0x9ffd[_0x12627d];return _0x11b620;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router; \ No newline at end of file +var _0x7916=['getDescriptions','get','/:id/tags','getTags','post','create','setTags','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x1695a9,_0x4af4a3){var _0x1a6acc=function(_0xf83593){while(--_0xf83593){_0x1695a9['push'](_0x1695a9['shift']());}};_0x1a6acc(++_0x4af4a3);}(_0x7916,0x128));var _0x6791=function(_0x1cbb6a,_0xe9748a){_0x1cbb6a=_0x1cbb6a-0x0;var _0x359725=_0x7916[_0x1cbb6a];return _0x359725;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['get']('/:id/fields',auth[_0x6791('0x8')](),controller[_0x6791('0xc')]);router['get'](_0x6791('0xd'),auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router['get'](_0x6791('0xf'),auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);router[_0x6791('0x11')](_0x6791('0x12'),auth[_0x6791('0x8')](),controller[_0x6791('0x13')]);router[_0x6791('0x14')]('/',auth[_0x6791('0x8')](),controller[_0x6791('0x15')]);router[_0x6791('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6791('0x16')]);router['put'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0x17')]);router[_0x6791('0x18')]('/:id',auth[_0x6791('0x8')](),controller['destroy']);module[_0x6791('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 44941dc..bfe63c1 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 _0x8c9d=['exports','STRING','sequelize'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x8c9d,0xfb));var _0xd8c9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8c9d[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xd8c9('0x0'));module[_0xd8c9('0x1')]={'name':{'type':Sequelize[_0xd8c9('0x2')]},'description':{'type':Sequelize[_0xd8c9('0x2')]}}; \ No newline at end of file +var _0xa02a=['STRING','sequelize'];(function(_0x280438,_0x1a2b94){var _0x26c9d6=function(_0x1d369a){while(--_0x1d369a){_0x280438['push'](_0x280438['shift']());}};_0x26c9d6(++_0x1a2b94);}(_0xa02a,0x1d5));var _0xaa02=function(_0x40db6a,_0x3a0df8){_0x40db6a=_0x40db6a-0x0;var _0x51e5a5=_0xa02a[_0x40db6a];return _0x51e5a5;};'use strict';var Sequelize=require(_0xaa02('0x0'));module['exports']={'name':{'type':Sequelize[_0xaa02('0x1')]},'description':{'type':Sequelize[_0xaa02('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 89fa166..137a42e 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 _0x2877=['ZendeskField','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','catch','show','params','options','find','create','body','getFields','findOne'];(function(_0x4c00ea,_0x1cf606){var _0x2754b6=function(_0x2bf125){while(--_0x2bf125){_0x4c00ea['push'](_0x4c00ea['shift']());}};_0x2754b6(++_0x1cf606);}(_0x2877,0x101));var _0x7287=function(_0x209fb2,_0x4eeecf){_0x209fb2=_0x209fb2-0x0;var _0x2afc61=_0x2877[_0x209fb2];return _0x2afc61;};'use strict';var emlformat=require(_0x7287('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7287('0x1'));var jsonpatch=require(_0x7287('0x2'));var rp=require(_0x7287('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7287('0x4'));var path=require(_0x7287('0x5'));var sox=require(_0x7287('0x6'));var csv=require(_0x7287('0x7'));var ejs=require(_0x7287('0x8'));var fs=require('fs');var fs_extra=require(_0x7287('0x9'));var _=require(_0x7287('0xa'));var squel=require(_0x7287('0xb'));var crypto=require('crypto');var jsforce=require(_0x7287('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7287('0x7'));var querystring=require('querystring');var Papa=require(_0x7287('0xd'));var Redis=require(_0x7287('0xe'));var authService=require(_0x7287('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7287('0x10'));var logger=require(_0x7287('0x11'))('api');var utils=require(_0x7287('0x12'));var config=require(_0x7287('0x13'));var licenseUtil=require(_0x7287('0x14'));var db=require(_0x7287('0x15'))['db'];function respondWithStatusCode(_0x4f7c2b,_0x62efc8){_0x62efc8=_0x62efc8||0xcc;return function(_0x7e1dd1){if(_0x7e1dd1){return _0x4f7c2b[_0x7287('0x16')](_0x62efc8);}return _0x4f7c2b[_0x7287('0x17')](_0x62efc8)['end']();};}function respondWithResult(_0xa0c0c0,_0x4fb3bf){_0x4fb3bf=_0x4fb3bf||0xc8;return function(_0x4e7069){if(_0x4e7069){return _0xa0c0c0[_0x7287('0x17')](_0x4fb3bf)['json'](_0x4e7069);}};}function respondWithFilteredResult(_0x30ee12,_0x48af77){return function(_0x13caa5){if(_0x13caa5){var _0x18d058=typeof _0x48af77['offset']===_0x7287('0x18')&&typeof _0x48af77['limit']===_0x7287('0x18');var _0x4753b6=_0x13caa5['count'];var _0x13481e=_0x18d058?0x0:_0x48af77[_0x7287('0x19')];var _0x2e1035=_0x18d058?_0x13caa5['count']:_0x48af77[_0x7287('0x19')]+_0x48af77[_0x7287('0x1a')];var _0x110270;if(_0x2e1035>=_0x4753b6){_0x2e1035=_0x4753b6;_0x110270=0xc8;}else{_0x110270=0xce;}_0x30ee12['status'](_0x110270);return _0x30ee12[_0x7287('0x1b')](_0x7287('0x1c'),_0x13481e+'-'+_0x2e1035+'/'+_0x4753b6)[_0x7287('0x1d')](_0x13caa5);}return null;};}function patchUpdates(_0x5c6c22){return function(_0x357fb4){try{jsonpatch[_0x7287('0x1e')](_0x357fb4,_0x5c6c22,!![]);}catch(_0x3955b3){return BPromise[_0x7287('0x1f')](_0x3955b3);}return _0x357fb4[_0x7287('0x20')]();};}function saveUpdates(_0x53273e,_0xcb5fe2){return function(_0x311a26){if(_0x311a26){return _0x311a26[_0x7287('0x21')](_0x53273e)[_0x7287('0x22')](function(_0x58bfa8){return _0x58bfa8;});}return null;};}function removeEntity(_0x59bddb,_0x240196){return function(_0x5326a9){if(_0x5326a9){return _0x5326a9[_0x7287('0x23')]()[_0x7287('0x22')](function(){_0x59bddb['status'](0xcc)[_0x7287('0x24')]();});}};}function handleEntityNotFound(_0x16399d,_0x46e452){return function(_0xb4dc72){if(!_0xb4dc72){_0x16399d[_0x7287('0x16')](0x194);}return _0xb4dc72;};}function handleError(_0x54ffdf,_0x42c44e){_0x42c44e=_0x42c44e||0x1f4;return function(_0x22de2b){logger[_0x7287('0x25')](_0x22de2b['stack']);if(_0x22de2b[_0x7287('0x26')]){delete _0x22de2b[_0x7287('0x26')];}_0x54ffdf[_0x7287('0x17')](_0x42c44e)['send'](_0x22de2b);};}exports[_0x7287('0x27')]=function(_0x23a1ac,_0x3fe9ca){var _0x1e9c63={},_0x5e9ddc={},_0x409fca={'count':0x0,'rows':[]};var _0xe4dcc=_[_0x7287('0x28')](db[_0x7287('0x29')][_0x7287('0x2a')],function(_0x5df7ae){return{'name':_0x5df7ae[_0x7287('0x2b')],'type':_0x5df7ae[_0x7287('0x2c')][_0x7287('0x2d')]};});_0x5e9ddc[_0x7287('0x2e')]=_[_0x7287('0x28')](_0xe4dcc,_0x7287('0x26'));_0x5e9ddc['query']=_[_0x7287('0x2f')](_0x23a1ac[_0x7287('0x30')]);_0x5e9ddc[_0x7287('0x31')]=_[_0x7287('0x32')](_0x5e9ddc[_0x7287('0x2e')],_0x5e9ddc[_0x7287('0x30')]);_0x1e9c63[_0x7287('0x33')]=_[_0x7287('0x32')](_0x5e9ddc[_0x7287('0x2e')],qs[_0x7287('0x34')](_0x23a1ac[_0x7287('0x30')][_0x7287('0x34')]));_0x1e9c63[_0x7287('0x33')]=_0x1e9c63[_0x7287('0x33')][_0x7287('0x35')]?_0x1e9c63[_0x7287('0x33')]:_0x5e9ddc[_0x7287('0x2e')];if(!_0x23a1ac[_0x7287('0x30')]['hasOwnProperty'](_0x7287('0x36'))){_0x1e9c63[_0x7287('0x1a')]=qs[_0x7287('0x1a')](_0x23a1ac[_0x7287('0x30')][_0x7287('0x1a')]);_0x1e9c63['offset']=qs[_0x7287('0x19')](_0x23a1ac[_0x7287('0x30')][_0x7287('0x19')]);}_0x1e9c63[_0x7287('0x37')]=qs['sort'](_0x23a1ac[_0x7287('0x30')][_0x7287('0x38')]);_0x1e9c63[_0x7287('0x39')]=qs['filters'](_[_0x7287('0x3a')](_0x23a1ac[_0x7287('0x30')],_0x5e9ddc[_0x7287('0x31')]),_0xe4dcc);if(_0x23a1ac[_0x7287('0x30')][_0x7287('0x3b')]){_0x1e9c63[_0x7287('0x39')]=_[_0x7287('0x3c')](_0x1e9c63['where'],{'$or':_[_0x7287('0x28')](_0xe4dcc,function(_0x49490e){if(_0x49490e['type']!==_0x7287('0x3d')){var _0x4afc5f={};_0x4afc5f[_0x49490e['name']]={'$like':'%'+_0x23a1ac[_0x7287('0x30')][_0x7287('0x3b')]+'%'};return _0x4afc5f;}})});}_0x1e9c63=_['merge']({},_0x1e9c63,_0x23a1ac['options']);var _0x1c1305={'where':_0x1e9c63[_0x7287('0x39')]};return db['ZendeskConfiguration'][_0x7287('0x3e')](_0x1c1305)[_0x7287('0x22')](function(_0x369654){_0x409fca['count']=_0x369654;if(_0x23a1ac['query'][_0x7287('0x3f')]){_0x1e9c63[_0x7287('0x40')]=[{'all':!![]}];}return db[_0x7287('0x29')][_0x7287('0x41')](_0x1e9c63);})['then'](function(_0x19abb2){_0x409fca['rows']=_0x19abb2;return _0x409fca;})['then'](respondWithFilteredResult(_0x3fe9ca,_0x1e9c63))[_0x7287('0x42')](handleError(_0x3fe9ca,null));};exports[_0x7287('0x43')]=function(_0x48696a,_0x36689d){var _0x2e5668={'raw':![],'where':{'id':_0x48696a[_0x7287('0x44')]['id']}},_0x213555={};_0x213555[_0x7287('0x2e')]=_[_0x7287('0x2f')](db[_0x7287('0x29')][_0x7287('0x2a')]);_0x213555[_0x7287('0x30')]=_[_0x7287('0x2f')](_0x48696a[_0x7287('0x30')]);_0x213555[_0x7287('0x31')]=_[_0x7287('0x32')](_0x213555[_0x7287('0x2e')],_0x213555['query']);_0x2e5668['attributes']=_[_0x7287('0x32')](_0x213555[_0x7287('0x2e')],qs[_0x7287('0x34')](_0x48696a['query'][_0x7287('0x34')]));_0x2e5668['attributes']=_0x2e5668[_0x7287('0x33')][_0x7287('0x35')]?_0x2e5668[_0x7287('0x33')]:_0x213555[_0x7287('0x2e')];if(_0x48696a[_0x7287('0x30')][_0x7287('0x3f')]){_0x2e5668[_0x7287('0x40')]=[{'all':!![]}];}_0x2e5668=_['merge']({},_0x2e5668,_0x48696a[_0x7287('0x45')]);return db[_0x7287('0x29')][_0x7287('0x46')](_0x2e5668)[_0x7287('0x22')](handleEntityNotFound(_0x36689d,null))[_0x7287('0x22')](respondWithResult(_0x36689d,null))[_0x7287('0x42')](handleError(_0x36689d,null));};exports[_0x7287('0x47')]=function(_0x28fee7,_0xb7df9b){return db[_0x7287('0x29')][_0x7287('0x47')](_0x28fee7[_0x7287('0x48')],{})[_0x7287('0x22')](respondWithResult(_0xb7df9b,0xc9))[_0x7287('0x42')](handleError(_0xb7df9b,null));};exports[_0x7287('0x21')]=function(_0x515501,_0x2352ee){if(_0x515501[_0x7287('0x48')]['id']){delete _0x515501[_0x7287('0x48')]['id'];}return db[_0x7287('0x29')][_0x7287('0x46')]({'where':{'id':_0x515501['params']['id']}})['then'](handleEntityNotFound(_0x2352ee,null))['then'](saveUpdates(_0x515501['body'],null))[_0x7287('0x22')](respondWithResult(_0x2352ee,null))['catch'](handleError(_0x2352ee,null));};exports['destroy']=function(_0x44730f,_0x25b6ba){return db['ZendeskConfiguration']['find']({'where':{'id':_0x44730f[_0x7287('0x44')]['id']}})[_0x7287('0x22')](handleEntityNotFound(_0x25b6ba,null))[_0x7287('0x22')](removeEntity(_0x25b6ba,null))[_0x7287('0x42')](handleError(_0x25b6ba,null));};exports[_0x7287('0x49')]=function(_0x3773a2,_0x147e17,_0x17045a){var _0x56c449={};var _0x338c61={};var _0x40e003;var _0xba1454;return db[_0x7287('0x29')][_0x7287('0x4a')]({'where':{'id':_0x3773a2[_0x7287('0x44')]['id']}})[_0x7287('0x22')](handleEntityNotFound(_0x147e17,null))[_0x7287('0x22')](function(_0x42b5aa){if(_0x42b5aa){_0x40e003=_0x42b5aa;_0x338c61[_0x7287('0x2e')]=_[_0x7287('0x2f')](db[_0x7287('0x4b')][_0x7287('0x2a')]);_0x338c61[_0x7287('0x30')]=_['keys'](_0x3773a2[_0x7287('0x30')]);_0x338c61[_0x7287('0x31')]=_[_0x7287('0x32')](_0x338c61[_0x7287('0x2e')],_0x338c61[_0x7287('0x30')]);_0x56c449['attributes']=_['intersection'](_0x338c61['model'],qs[_0x7287('0x34')](_0x3773a2['query'][_0x7287('0x34')]));_0x56c449[_0x7287('0x33')]=_0x56c449[_0x7287('0x33')][_0x7287('0x35')]?_0x56c449[_0x7287('0x33')]:_0x338c61[_0x7287('0x2e')];_0x56c449[_0x7287('0x37')]=qs[_0x7287('0x38')](_0x3773a2[_0x7287('0x30')][_0x7287('0x38')]);_0x56c449[_0x7287('0x39')]=qs[_0x7287('0x31')](_['pick'](_0x3773a2['query'],_0x338c61['filters']));if(_0x3773a2[_0x7287('0x30')][_0x7287('0x3b')]){_0x56c449[_0x7287('0x39')]=_['merge'](_0x56c449['where'],{'$or':_[_0x7287('0x28')](_0x56c449['attributes'],function(_0xf5a69a){var _0x11fc01={};_0x11fc01[_0xf5a69a]={'$like':'%'+_0x3773a2[_0x7287('0x30')][_0x7287('0x3b')]+'%'};return _0x11fc01;})});}_0x56c449=_[_0x7287('0x3c')]({},_0x56c449,_0x3773a2[_0x7287('0x45')]);return _0x40e003['getFields'](_0x56c449);}})[_0x7287('0x22')](function(_0x2d5558){if(_0x2d5558){_0xba1454=_0x2d5558['length'];if(!_0x3773a2[_0x7287('0x30')][_0x7287('0x4c')](_0x7287('0x36'))){_0x56c449[_0x7287('0x1a')]=qs[_0x7287('0x1a')](_0x3773a2['query']['limit']);_0x56c449[_0x7287('0x19')]=qs[_0x7287('0x19')](_0x3773a2[_0x7287('0x30')][_0x7287('0x19')]);}return _0x40e003[_0x7287('0x49')](_0x56c449);}})[_0x7287('0x22')](function(_0x34b596){if(_0x34b596){return _0x34b596?{'count':_0xba1454,'rows':_0x34b596}:null;}})[_0x7287('0x22')](respondWithResult(_0x147e17,null))[_0x7287('0x42')](handleError(_0x147e17,null));};exports['getSubjects']=function(_0x125d16,_0x24f3bd,_0x596c17){var _0x3eb281={};var _0x192c74={};var _0x3cdb3a;var _0x2884df;return db[_0x7287('0x29')][_0x7287('0x4a')]({'where':{'id':_0x125d16['params']['id']}})[_0x7287('0x22')](handleEntityNotFound(_0x24f3bd,null))['then'](function(_0x50e32){if(_0x50e32){_0x3cdb3a=_0x50e32;_0x192c74['model']=_[_0x7287('0x2f')](db[_0x7287('0x4b')]['rawAttributes']);_0x192c74[_0x7287('0x30')]=_[_0x7287('0x2f')](_0x125d16[_0x7287('0x30')]);_0x192c74['filters']=_[_0x7287('0x32')](_0x192c74['model'],_0x192c74[_0x7287('0x30')]);_0x3eb281['attributes']=_[_0x7287('0x32')](_0x192c74['model'],qs[_0x7287('0x34')](_0x125d16[_0x7287('0x30')]['fields']));_0x3eb281[_0x7287('0x33')]=_0x3eb281[_0x7287('0x33')][_0x7287('0x35')]?_0x3eb281[_0x7287('0x33')]:_0x192c74[_0x7287('0x2e')];_0x3eb281[_0x7287('0x37')]=qs[_0x7287('0x38')](_0x125d16[_0x7287('0x30')][_0x7287('0x38')]);_0x3eb281['where']=qs[_0x7287('0x31')](_[_0x7287('0x3a')](_0x125d16[_0x7287('0x30')],_0x192c74['filters']));if(_0x125d16['query'][_0x7287('0x3b')]){_0x3eb281['where']=_['merge'](_0x3eb281[_0x7287('0x39')],{'$or':_[_0x7287('0x28')](_0x3eb281[_0x7287('0x33')],function(_0x95c7a1){var _0x4e03b0={};_0x4e03b0[_0x95c7a1]={'$like':'%'+_0x125d16[_0x7287('0x30')][_0x7287('0x3b')]+'%'};return _0x4e03b0;})});}_0x3eb281=_[_0x7287('0x3c')]({},_0x3eb281,_0x125d16['options']);return _0x3cdb3a[_0x7287('0x4d')](_0x3eb281);}})[_0x7287('0x22')](function(_0x10454f){if(_0x10454f){_0x2884df=_0x10454f['length'];if(!_0x125d16[_0x7287('0x30')][_0x7287('0x4c')](_0x7287('0x36'))){_0x3eb281[_0x7287('0x1a')]=qs['limit'](_0x125d16[_0x7287('0x30')][_0x7287('0x1a')]);_0x3eb281['offset']=qs[_0x7287('0x19')](_0x125d16[_0x7287('0x30')][_0x7287('0x19')]);}return _0x3cdb3a[_0x7287('0x4d')](_0x3eb281);}})[_0x7287('0x22')](function(_0x1c3dd7){if(_0x1c3dd7){return _0x1c3dd7?{'count':_0x2884df,'rows':_0x1c3dd7}:null;}})[_0x7287('0x22')](respondWithResult(_0x24f3bd,null))[_0x7287('0x42')](handleError(_0x24f3bd,null));};exports[_0x7287('0x4e')]=function(_0x5f2201,_0x3daaad,_0x323b1b){var _0x4e1d35={};var _0x133419={};var _0x3e6335;var _0x24fbed;return db['ZendeskConfiguration'][_0x7287('0x4a')]({'where':{'id':_0x5f2201[_0x7287('0x44')]['id']}})[_0x7287('0x22')](handleEntityNotFound(_0x3daaad,null))[_0x7287('0x22')](function(_0x4c22e4){if(_0x4c22e4){_0x3e6335=_0x4c22e4;_0x133419[_0x7287('0x2e')]=_[_0x7287('0x2f')](db[_0x7287('0x4b')][_0x7287('0x2a')]);_0x133419[_0x7287('0x30')]=_[_0x7287('0x2f')](_0x5f2201['query']);_0x133419['filters']=_[_0x7287('0x32')](_0x133419[_0x7287('0x2e')],_0x133419[_0x7287('0x30')]);_0x4e1d35[_0x7287('0x33')]=_[_0x7287('0x32')](_0x133419[_0x7287('0x2e')],qs['fields'](_0x5f2201[_0x7287('0x30')][_0x7287('0x34')]));_0x4e1d35[_0x7287('0x33')]=_0x4e1d35[_0x7287('0x33')][_0x7287('0x35')]?_0x4e1d35[_0x7287('0x33')]:_0x133419['model'];_0x4e1d35['order']=qs[_0x7287('0x38')](_0x5f2201['query'][_0x7287('0x38')]);_0x4e1d35[_0x7287('0x39')]=qs[_0x7287('0x31')](_[_0x7287('0x3a')](_0x5f2201[_0x7287('0x30')],_0x133419[_0x7287('0x31')]));if(_0x5f2201['query'][_0x7287('0x3b')]){_0x4e1d35[_0x7287('0x39')]=_[_0x7287('0x3c')](_0x4e1d35[_0x7287('0x39')],{'$or':_['map'](_0x4e1d35['attributes'],function(_0x2f5694){var _0x5cb721={};_0x5cb721[_0x2f5694]={'$like':'%'+_0x5f2201[_0x7287('0x30')]['filter']+'%'};return _0x5cb721;})});}_0x4e1d35=_[_0x7287('0x3c')]({},_0x4e1d35,_0x5f2201['options']);return _0x3e6335[_0x7287('0x4e')](_0x4e1d35);}})[_0x7287('0x22')](function(_0xec4d57){if(_0xec4d57){_0x24fbed=_0xec4d57[_0x7287('0x35')];if(!_0x5f2201[_0x7287('0x30')][_0x7287('0x4c')](_0x7287('0x36'))){_0x4e1d35['limit']=qs['limit'](_0x5f2201[_0x7287('0x30')][_0x7287('0x1a')]);_0x4e1d35[_0x7287('0x19')]=qs[_0x7287('0x19')](_0x5f2201['query'][_0x7287('0x19')]);}return _0x3e6335[_0x7287('0x4e')](_0x4e1d35);}})[_0x7287('0x22')](function(_0x36f548){if(_0x36f548){return _0x36f548?{'count':_0x24fbed,'rows':_0x36f548}:null;}})[_0x7287('0x22')](respondWithResult(_0x3daaad,null))[_0x7287('0x42')](handleError(_0x3daaad,null));};exports[_0x7287('0x4f')]=function(_0xc505f8,_0x5d7efc,_0x161280){var _0xef09e0={};var _0x168154={};var _0x3e7edd;var _0x205534;return db[_0x7287('0x29')][_0x7287('0x4a')]({'where':{'id':_0xc505f8[_0x7287('0x44')]['id']}})[_0x7287('0x22')](handleEntityNotFound(_0x5d7efc,null))[_0x7287('0x22')](function(_0x396928){if(_0x396928){_0x3e7edd=_0x396928;_0x168154[_0x7287('0x2e')]=_[_0x7287('0x2f')](db[_0x7287('0x50')][_0x7287('0x2a')]);_0x168154[_0x7287('0x30')]=_[_0x7287('0x2f')](_0xc505f8['query']);_0x168154[_0x7287('0x31')]=_['intersection'](_0x168154[_0x7287('0x2e')],_0x168154[_0x7287('0x30')]);_0xef09e0['attributes']=_[_0x7287('0x32')](_0x168154['model'],qs[_0x7287('0x34')](_0xc505f8[_0x7287('0x30')][_0x7287('0x34')]));_0xef09e0[_0x7287('0x33')]=_0xef09e0['attributes'][_0x7287('0x35')]?_0xef09e0[_0x7287('0x33')]:_0x168154[_0x7287('0x2e')];_0xef09e0[_0x7287('0x37')]=qs[_0x7287('0x38')](_0xc505f8['query'][_0x7287('0x38')]);_0xef09e0[_0x7287('0x39')]=qs[_0x7287('0x31')](_[_0x7287('0x3a')](_0xc505f8['query'],_0x168154[_0x7287('0x31')]));if(_0xc505f8[_0x7287('0x30')]['filter']){_0xef09e0['where']=_['merge'](_0xef09e0['where'],{'$or':_[_0x7287('0x28')](_0xef09e0[_0x7287('0x33')],function(_0x10bbf6){var _0x285e26={};_0x285e26[_0x10bbf6]={'$like':'%'+_0xc505f8[_0x7287('0x30')][_0x7287('0x3b')]+'%'};return _0x285e26;})});}_0xef09e0=_[_0x7287('0x3c')]({},_0xef09e0,_0xc505f8[_0x7287('0x45')]);return _0x3e7edd[_0x7287('0x4f')](_0xef09e0);}})[_0x7287('0x22')](function(_0x342ad7){if(_0x342ad7){_0x205534=_0x342ad7['length'];if(!_0xc505f8[_0x7287('0x30')]['hasOwnProperty'](_0x7287('0x36'))){_0xef09e0[_0x7287('0x1a')]=qs[_0x7287('0x1a')](_0xc505f8[_0x7287('0x30')][_0x7287('0x1a')]);_0xef09e0[_0x7287('0x19')]=qs[_0x7287('0x19')](_0xc505f8[_0x7287('0x30')]['offset']);}return _0x3e7edd[_0x7287('0x4f')](_0xef09e0);}})['then'](function(_0x179e4e){if(_0x179e4e){return _0x179e4e?{'count':_0x205534,'rows':_0x179e4e}:null;}})[_0x7287('0x22')](respondWithResult(_0x5d7efc,null))[_0x7287('0x42')](handleError(_0x5d7efc,null));};exports[_0x7287('0x51')]=function(_0x1c9d3c,_0x5670cb,_0x3d7e6c){if(_0x1c9d3c['body']['id']){delete _0x1c9d3c[_0x7287('0x48')]['id'];}return db[_0x7287('0x29')][_0x7287('0x4a')]({'where':{'id':_0x1c9d3c['params']['id']}})['then'](handleEntityNotFound(_0x5670cb,null))['then'](function(_0x1b57a7){if(_0x1b57a7){return _0x1b57a7[_0x7287('0x51')](_0x1c9d3c[_0x7287('0x48')][_0x7287('0x52')]||[]);}return null;})['then'](respondWithResult(_0x5670cb,null))[_0x7287('0x42')](handleError(_0x5670cb,null));}; \ No newline at end of file +var _0x1c6c=['update','then','error','stack','name','send','index','map','ZendeskConfiguration','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body','getFields','ZendeskField','order','pick','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','Content-Range','apply'];(function(_0x4fdd16,_0x3174cb){var _0x553370=function(_0x52b021){while(--_0x52b021){_0x4fdd16['push'](_0x4fdd16['shift']());}};_0x553370(++_0x3174cb);}(_0x1c6c,0x197));var _0xc1c6=function(_0x231bd6,_0x1f4178){_0x231bd6=_0x231bd6-0x0;var _0x2e8e31=_0x1c6c[_0x231bd6];return _0x2e8e31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1c6('0x0'));var zipdir=require(_0xc1c6('0x1'));var jsonpatch=require(_0xc1c6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc1c6('0x3'));var Mustache=require(_0xc1c6('0x4'));var util=require(_0xc1c6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc1c6('0x6'));var ejs=require(_0xc1c6('0x7'));var fs=require('fs');var fs_extra=require(_0xc1c6('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc1c6('0x9'));var jsforce=require(_0xc1c6('0xa'));var deskjs=require(_0xc1c6('0xb'));var toCsv=require(_0xc1c6('0x6'));var querystring=require(_0xc1c6('0xc'));var Papa=require(_0xc1c6('0xd'));var Redis=require(_0xc1c6('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc1c6('0xf'));var db=require(_0xc1c6('0x10'))['db'];function respondWithStatusCode(_0x424231,_0x456490){_0x456490=_0x456490||0xcc;return function(_0x4b19dd){if(_0x4b19dd){return _0x424231[_0xc1c6('0x11')](_0x456490);}return _0x424231[_0xc1c6('0x12')](_0x456490)[_0xc1c6('0x13')]();};}function respondWithResult(_0x5a3e78,_0x348bd0){_0x348bd0=_0x348bd0||0xc8;return function(_0x3dfc9b){if(_0x3dfc9b){return _0x5a3e78[_0xc1c6('0x12')](_0x348bd0)['json'](_0x3dfc9b);}};}function respondWithFilteredResult(_0x1665f2,_0x3e5bb1){return function(_0x49fda8){if(_0x49fda8){var _0x4306c4=typeof _0x3e5bb1[_0xc1c6('0x14')]==='undefined'&&typeof _0x3e5bb1[_0xc1c6('0x15')]==='undefined';var _0x1b42ff=_0x49fda8[_0xc1c6('0x16')];var _0x143fb8=_0x4306c4?0x0:_0x3e5bb1['offset'];var _0x4762ae=_0x4306c4?_0x49fda8['count']:_0x3e5bb1[_0xc1c6('0x14')]+_0x3e5bb1[_0xc1c6('0x15')];var _0x19e890;if(_0x4762ae>=_0x1b42ff){_0x4762ae=_0x1b42ff;_0x19e890=0xc8;}else{_0x19e890=0xce;}_0x1665f2[_0xc1c6('0x12')](_0x19e890);return _0x1665f2['set'](_0xc1c6('0x17'),_0x143fb8+'-'+_0x4762ae+'/'+_0x1b42ff)['json'](_0x49fda8);}return null;};}function patchUpdates(_0x515359){return function(_0x1ea9b7){try{jsonpatch[_0xc1c6('0x18')](_0x1ea9b7,_0x515359,!![]);}catch(_0x43941a){return BPromise['reject'](_0x43941a);}return _0x1ea9b7['save']();};}function saveUpdates(_0x468f11,_0x90f9e0){return function(_0x7513a){if(_0x7513a){return _0x7513a[_0xc1c6('0x19')](_0x468f11)[_0xc1c6('0x1a')](function(_0x2dfa8a){return _0x2dfa8a;});}return null;};}function removeEntity(_0x3363b1,_0x6d4c61){return function(_0x222cbb){if(_0x222cbb){return _0x222cbb['destroy']()[_0xc1c6('0x1a')](function(){_0x3363b1[_0xc1c6('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1dfe,_0x6b63ce){return function(_0x2ccae9){if(!_0x2ccae9){_0x5d1dfe[_0xc1c6('0x11')](0x194);}return _0x2ccae9;};}function handleError(_0x54ecfc,_0x3d75e4){_0x3d75e4=_0x3d75e4||0x1f4;return function(_0x12465e){logger[_0xc1c6('0x1b')](_0x12465e[_0xc1c6('0x1c')]);if(_0x12465e[_0xc1c6('0x1d')]){delete _0x12465e[_0xc1c6('0x1d')];}_0x54ecfc['status'](_0x3d75e4)[_0xc1c6('0x1e')](_0x12465e);};}exports[_0xc1c6('0x1f')]=function(_0x265b54,_0x51c04b){var _0x35f317={},_0x4ea96c={},_0x5de1be={'count':0x0,'rows':[]};var _0x2bef06=_[_0xc1c6('0x20')](db[_0xc1c6('0x21')]['rawAttributes'],function(_0xf78724){return{'name':_0xf78724['fieldName'],'type':_0xf78724['type'][_0xc1c6('0x22')]};});_0x4ea96c[_0xc1c6('0x23')]=_['map'](_0x2bef06,_0xc1c6('0x1d'));_0x4ea96c[_0xc1c6('0x24')]=_[_0xc1c6('0x25')](_0x265b54[_0xc1c6('0x24')]);_0x4ea96c[_0xc1c6('0x26')]=_[_0xc1c6('0x27')](_0x4ea96c[_0xc1c6('0x23')],_0x4ea96c[_0xc1c6('0x24')]);_0x35f317[_0xc1c6('0x28')]=_[_0xc1c6('0x27')](_0x4ea96c[_0xc1c6('0x23')],qs['fields'](_0x265b54[_0xc1c6('0x24')][_0xc1c6('0x29')]));_0x35f317[_0xc1c6('0x28')]=_0x35f317[_0xc1c6('0x28')][_0xc1c6('0x2a')]?_0x35f317[_0xc1c6('0x28')]:_0x4ea96c[_0xc1c6('0x23')];if(!_0x265b54[_0xc1c6('0x24')][_0xc1c6('0x2b')](_0xc1c6('0x2c'))){_0x35f317[_0xc1c6('0x15')]=qs[_0xc1c6('0x15')](_0x265b54[_0xc1c6('0x24')][_0xc1c6('0x15')]);_0x35f317[_0xc1c6('0x14')]=qs[_0xc1c6('0x14')](_0x265b54[_0xc1c6('0x24')][_0xc1c6('0x14')]);}_0x35f317['order']=qs[_0xc1c6('0x2d')](_0x265b54[_0xc1c6('0x24')][_0xc1c6('0x2d')]);_0x35f317[_0xc1c6('0x2e')]=qs[_0xc1c6('0x26')](_['pick'](_0x265b54[_0xc1c6('0x24')],_0x4ea96c['filters']),_0x2bef06);if(_0x265b54[_0xc1c6('0x24')][_0xc1c6('0x2f')]){_0x35f317[_0xc1c6('0x2e')]=_[_0xc1c6('0x30')](_0x35f317[_0xc1c6('0x2e')],{'$or':_['map'](_0x2bef06,function(_0x25ac2a){if(_0x25ac2a[_0xc1c6('0x31')]!==_0xc1c6('0x32')){var _0xb17242={};_0xb17242[_0x25ac2a[_0xc1c6('0x1d')]]={'$like':'%'+_0x265b54[_0xc1c6('0x24')][_0xc1c6('0x2f')]+'%'};return _0xb17242;}})});}_0x35f317=_['merge']({},_0x35f317,_0x265b54[_0xc1c6('0x33')]);var _0x5b7471={'where':_0x35f317[_0xc1c6('0x2e')]};return db[_0xc1c6('0x21')][_0xc1c6('0x16')](_0x5b7471)[_0xc1c6('0x1a')](function(_0x20ee1e){_0x5de1be[_0xc1c6('0x16')]=_0x20ee1e;if(_0x265b54['query']['includeAll']){_0x35f317[_0xc1c6('0x34')]=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x35f317);})[_0xc1c6('0x1a')](function(_0x1285c2){_0x5de1be[_0xc1c6('0x35')]=_0x1285c2;return _0x5de1be;})[_0xc1c6('0x1a')](respondWithFilteredResult(_0x51c04b,_0x35f317))[_0xc1c6('0x36')](handleError(_0x51c04b,null));};exports['show']=function(_0x9c4eee,_0x2c16a0){var _0x816fbb={'raw':![],'where':{'id':_0x9c4eee[_0xc1c6('0x37')]['id']}},_0x4a6f6c={};_0x4a6f6c[_0xc1c6('0x23')]=_[_0xc1c6('0x25')](db[_0xc1c6('0x21')][_0xc1c6('0x38')]);_0x4a6f6c[_0xc1c6('0x24')]=_[_0xc1c6('0x25')](_0x9c4eee[_0xc1c6('0x24')]);_0x4a6f6c[_0xc1c6('0x26')]=_['intersection'](_0x4a6f6c[_0xc1c6('0x23')],_0x4a6f6c[_0xc1c6('0x24')]);_0x816fbb['attributes']=_[_0xc1c6('0x27')](_0x4a6f6c[_0xc1c6('0x23')],qs[_0xc1c6('0x29')](_0x9c4eee['query'][_0xc1c6('0x29')]));_0x816fbb[_0xc1c6('0x28')]=_0x816fbb[_0xc1c6('0x28')][_0xc1c6('0x2a')]?_0x816fbb[_0xc1c6('0x28')]:_0x4a6f6c[_0xc1c6('0x23')];if(_0x9c4eee['query'][_0xc1c6('0x39')]){_0x816fbb[_0xc1c6('0x34')]=[{'all':!![]}];}_0x816fbb=_[_0xc1c6('0x30')]({},_0x816fbb,_0x9c4eee['options']);return db['ZendeskConfiguration'][_0xc1c6('0x3a')](_0x816fbb)['then'](handleEntityNotFound(_0x2c16a0,null))[_0xc1c6('0x1a')](respondWithResult(_0x2c16a0,null))['catch'](handleError(_0x2c16a0,null));};exports[_0xc1c6('0x3b')]=function(_0x196d14,_0x4fea91){return db[_0xc1c6('0x21')]['create'](_0x196d14[_0xc1c6('0x3c')],{})['then'](respondWithResult(_0x4fea91,0xc9))[_0xc1c6('0x36')](handleError(_0x4fea91,null));};exports[_0xc1c6('0x19')]=function(_0xb6acb9,_0x33a761){if(_0xb6acb9['body']['id']){delete _0xb6acb9[_0xc1c6('0x3c')]['id'];}return db['ZendeskConfiguration'][_0xc1c6('0x3a')]({'where':{'id':_0xb6acb9['params']['id']}})[_0xc1c6('0x1a')](handleEntityNotFound(_0x33a761,null))[_0xc1c6('0x1a')](saveUpdates(_0xb6acb9[_0xc1c6('0x3c')],null))['then'](respondWithResult(_0x33a761,null))[_0xc1c6('0x36')](handleError(_0x33a761,null));};exports['destroy']=function(_0x4566f5,_0x8c5ee8){return db[_0xc1c6('0x21')][_0xc1c6('0x3a')]({'where':{'id':_0x4566f5[_0xc1c6('0x37')]['id']}})['then'](handleEntityNotFound(_0x8c5ee8,null))['then'](removeEntity(_0x8c5ee8,null))[_0xc1c6('0x36')](handleError(_0x8c5ee8,null));};exports[_0xc1c6('0x3d')]=function(_0x3483e0,_0x391208,_0x5d127c){var _0x2ef5c7={};var _0x5eff5f={};var _0x5f0a98;var _0x1ef16c;return db[_0xc1c6('0x21')]['findOne']({'where':{'id':_0x3483e0[_0xc1c6('0x37')]['id']}})[_0xc1c6('0x1a')](handleEntityNotFound(_0x391208,null))[_0xc1c6('0x1a')](function(_0x12c7d9){if(_0x12c7d9){_0x5f0a98=_0x12c7d9;_0x5eff5f[_0xc1c6('0x23')]=_[_0xc1c6('0x25')](db[_0xc1c6('0x3e')][_0xc1c6('0x38')]);_0x5eff5f[_0xc1c6('0x24')]=_[_0xc1c6('0x25')](_0x3483e0[_0xc1c6('0x24')]);_0x5eff5f[_0xc1c6('0x26')]=_[_0xc1c6('0x27')](_0x5eff5f[_0xc1c6('0x23')],_0x5eff5f[_0xc1c6('0x24')]);_0x2ef5c7[_0xc1c6('0x28')]=_[_0xc1c6('0x27')](_0x5eff5f[_0xc1c6('0x23')],qs[_0xc1c6('0x29')](_0x3483e0[_0xc1c6('0x24')][_0xc1c6('0x29')]));_0x2ef5c7[_0xc1c6('0x28')]=_0x2ef5c7[_0xc1c6('0x28')]['length']?_0x2ef5c7[_0xc1c6('0x28')]:_0x5eff5f[_0xc1c6('0x23')];_0x2ef5c7[_0xc1c6('0x3f')]=qs['sort'](_0x3483e0[_0xc1c6('0x24')][_0xc1c6('0x2d')]);_0x2ef5c7[_0xc1c6('0x2e')]=qs[_0xc1c6('0x26')](_[_0xc1c6('0x40')](_0x3483e0[_0xc1c6('0x24')],_0x5eff5f[_0xc1c6('0x26')]));if(_0x3483e0[_0xc1c6('0x24')][_0xc1c6('0x2f')]){_0x2ef5c7[_0xc1c6('0x2e')]=_['merge'](_0x2ef5c7['where'],{'$or':_[_0xc1c6('0x20')](_0x2ef5c7[_0xc1c6('0x28')],function(_0xc1c494){var _0x1ff024={};_0x1ff024[_0xc1c494]={'$like':'%'+_0x3483e0[_0xc1c6('0x24')]['filter']+'%'};return _0x1ff024;})});}_0x2ef5c7=_[_0xc1c6('0x30')]({},_0x2ef5c7,_0x3483e0[_0xc1c6('0x33')]);return _0x5f0a98['getFields'](_0x2ef5c7);}})['then'](function(_0x5bdbfd){if(_0x5bdbfd){_0x1ef16c=_0x5bdbfd[_0xc1c6('0x2a')];if(!_0x3483e0[_0xc1c6('0x24')][_0xc1c6('0x2b')](_0xc1c6('0x2c'))){_0x2ef5c7[_0xc1c6('0x15')]=qs[_0xc1c6('0x15')](_0x3483e0['query'][_0xc1c6('0x15')]);_0x2ef5c7[_0xc1c6('0x14')]=qs['offset'](_0x3483e0[_0xc1c6('0x24')][_0xc1c6('0x14')]);}return _0x5f0a98[_0xc1c6('0x3d')](_0x2ef5c7);}})[_0xc1c6('0x1a')](function(_0x130954){if(_0x130954){return _0x130954?{'count':_0x1ef16c,'rows':_0x130954}:null;}})['then'](respondWithResult(_0x391208,null))[_0xc1c6('0x36')](handleError(_0x391208,null));};exports['getSubjects']=function(_0xe179cf,_0x1f6700,_0x340d49){var _0x2d34ba={};var _0x1c87ae={};var _0x315f46;var _0x23f7b9;return db[_0xc1c6('0x21')]['findOne']({'where':{'id':_0xe179cf['params']['id']}})['then'](handleEntityNotFound(_0x1f6700,null))[_0xc1c6('0x1a')](function(_0x4cda72){if(_0x4cda72){_0x315f46=_0x4cda72;_0x1c87ae['model']=_[_0xc1c6('0x25')](db[_0xc1c6('0x3e')][_0xc1c6('0x38')]);_0x1c87ae['query']=_['keys'](_0xe179cf[_0xc1c6('0x24')]);_0x1c87ae[_0xc1c6('0x26')]=_[_0xc1c6('0x27')](_0x1c87ae['model'],_0x1c87ae[_0xc1c6('0x24')]);_0x2d34ba[_0xc1c6('0x28')]=_[_0xc1c6('0x27')](_0x1c87ae[_0xc1c6('0x23')],qs['fields'](_0xe179cf[_0xc1c6('0x24')][_0xc1c6('0x29')]));_0x2d34ba[_0xc1c6('0x28')]=_0x2d34ba['attributes'][_0xc1c6('0x2a')]?_0x2d34ba[_0xc1c6('0x28')]:_0x1c87ae['model'];_0x2d34ba[_0xc1c6('0x3f')]=qs[_0xc1c6('0x2d')](_0xe179cf['query'][_0xc1c6('0x2d')]);_0x2d34ba[_0xc1c6('0x2e')]=qs[_0xc1c6('0x26')](_[_0xc1c6('0x40')](_0xe179cf[_0xc1c6('0x24')],_0x1c87ae[_0xc1c6('0x26')]));if(_0xe179cf[_0xc1c6('0x24')]['filter']){_0x2d34ba[_0xc1c6('0x2e')]=_[_0xc1c6('0x30')](_0x2d34ba[_0xc1c6('0x2e')],{'$or':_[_0xc1c6('0x20')](_0x2d34ba[_0xc1c6('0x28')],function(_0x22b73b){var _0x31b02f={};_0x31b02f[_0x22b73b]={'$like':'%'+_0xe179cf[_0xc1c6('0x24')]['filter']+'%'};return _0x31b02f;})});}_0x2d34ba=_[_0xc1c6('0x30')]({},_0x2d34ba,_0xe179cf[_0xc1c6('0x33')]);return _0x315f46[_0xc1c6('0x41')](_0x2d34ba);}})[_0xc1c6('0x1a')](function(_0x45e4cc){if(_0x45e4cc){_0x23f7b9=_0x45e4cc[_0xc1c6('0x2a')];if(!_0xe179cf[_0xc1c6('0x24')][_0xc1c6('0x2b')](_0xc1c6('0x2c'))){_0x2d34ba[_0xc1c6('0x15')]=qs['limit'](_0xe179cf[_0xc1c6('0x24')]['limit']);_0x2d34ba[_0xc1c6('0x14')]=qs['offset'](_0xe179cf[_0xc1c6('0x24')][_0xc1c6('0x14')]);}return _0x315f46[_0xc1c6('0x41')](_0x2d34ba);}})[_0xc1c6('0x1a')](function(_0x41fbaa){if(_0x41fbaa){return _0x41fbaa?{'count':_0x23f7b9,'rows':_0x41fbaa}:null;}})[_0xc1c6('0x1a')](respondWithResult(_0x1f6700,null))[_0xc1c6('0x36')](handleError(_0x1f6700,null));};exports[_0xc1c6('0x42')]=function(_0x547336,_0x5c4515,_0x3ea4df){var _0x13bd91={};var _0x3fc4fa={};var _0x31c5de;var _0x2f7be7;return db[_0xc1c6('0x21')][_0xc1c6('0x43')]({'where':{'id':_0x547336[_0xc1c6('0x37')]['id']}})[_0xc1c6('0x1a')](handleEntityNotFound(_0x5c4515,null))['then'](function(_0x4b8591){if(_0x4b8591){_0x31c5de=_0x4b8591;_0x3fc4fa[_0xc1c6('0x23')]=_['keys'](db[_0xc1c6('0x3e')][_0xc1c6('0x38')]);_0x3fc4fa['query']=_[_0xc1c6('0x25')](_0x547336[_0xc1c6('0x24')]);_0x3fc4fa[_0xc1c6('0x26')]=_[_0xc1c6('0x27')](_0x3fc4fa['model'],_0x3fc4fa[_0xc1c6('0x24')]);_0x13bd91[_0xc1c6('0x28')]=_[_0xc1c6('0x27')](_0x3fc4fa[_0xc1c6('0x23')],qs['fields'](_0x547336['query']['fields']));_0x13bd91[_0xc1c6('0x28')]=_0x13bd91[_0xc1c6('0x28')][_0xc1c6('0x2a')]?_0x13bd91[_0xc1c6('0x28')]:_0x3fc4fa[_0xc1c6('0x23')];_0x13bd91[_0xc1c6('0x3f')]=qs[_0xc1c6('0x2d')](_0x547336[_0xc1c6('0x24')][_0xc1c6('0x2d')]);_0x13bd91['where']=qs['filters'](_[_0xc1c6('0x40')](_0x547336[_0xc1c6('0x24')],_0x3fc4fa[_0xc1c6('0x26')]));if(_0x547336['query'][_0xc1c6('0x2f')]){_0x13bd91[_0xc1c6('0x2e')]=_[_0xc1c6('0x30')](_0x13bd91[_0xc1c6('0x2e')],{'$or':_['map'](_0x13bd91[_0xc1c6('0x28')],function(_0xa6f914){var _0x2d5096={};_0x2d5096[_0xa6f914]={'$like':'%'+_0x547336['query'][_0xc1c6('0x2f')]+'%'};return _0x2d5096;})});}_0x13bd91=_[_0xc1c6('0x30')]({},_0x13bd91,_0x547336[_0xc1c6('0x33')]);return _0x31c5de[_0xc1c6('0x42')](_0x13bd91);}})[_0xc1c6('0x1a')](function(_0x5381ac){if(_0x5381ac){_0x2f7be7=_0x5381ac['length'];if(!_0x547336[_0xc1c6('0x24')][_0xc1c6('0x2b')](_0xc1c6('0x2c'))){_0x13bd91['limit']=qs[_0xc1c6('0x15')](_0x547336[_0xc1c6('0x24')][_0xc1c6('0x15')]);_0x13bd91['offset']=qs['offset'](_0x547336[_0xc1c6('0x24')][_0xc1c6('0x14')]);}return _0x31c5de[_0xc1c6('0x42')](_0x13bd91);}})[_0xc1c6('0x1a')](function(_0x1c9280){if(_0x1c9280){return _0x1c9280?{'count':_0x2f7be7,'rows':_0x1c9280}:null;}})[_0xc1c6('0x1a')](respondWithResult(_0x5c4515,null))[_0xc1c6('0x36')](handleError(_0x5c4515,null));};exports[_0xc1c6('0x44')]=function(_0x5f47c8,_0x3c0fdf,_0x4c9b93){var _0x181af7={};var _0x51f2f2={};var _0x4324ef;var _0x5a3093;return db[_0xc1c6('0x21')][_0xc1c6('0x43')]({'where':{'id':_0x5f47c8[_0xc1c6('0x37')]['id']}})[_0xc1c6('0x1a')](handleEntityNotFound(_0x3c0fdf,null))[_0xc1c6('0x1a')](function(_0x2b0211){if(_0x2b0211){_0x4324ef=_0x2b0211;_0x51f2f2['model']=_[_0xc1c6('0x25')](db[_0xc1c6('0x45')][_0xc1c6('0x38')]);_0x51f2f2['query']=_['keys'](_0x5f47c8[_0xc1c6('0x24')]);_0x51f2f2[_0xc1c6('0x26')]=_[_0xc1c6('0x27')](_0x51f2f2['model'],_0x51f2f2[_0xc1c6('0x24')]);_0x181af7[_0xc1c6('0x28')]=_[_0xc1c6('0x27')](_0x51f2f2[_0xc1c6('0x23')],qs[_0xc1c6('0x29')](_0x5f47c8[_0xc1c6('0x24')][_0xc1c6('0x29')]));_0x181af7[_0xc1c6('0x28')]=_0x181af7[_0xc1c6('0x28')][_0xc1c6('0x2a')]?_0x181af7['attributes']:_0x51f2f2['model'];_0x181af7[_0xc1c6('0x3f')]=qs[_0xc1c6('0x2d')](_0x5f47c8['query']['sort']);_0x181af7['where']=qs[_0xc1c6('0x26')](_[_0xc1c6('0x40')](_0x5f47c8['query'],_0x51f2f2[_0xc1c6('0x26')]));if(_0x5f47c8['query']['filter']){_0x181af7[_0xc1c6('0x2e')]=_[_0xc1c6('0x30')](_0x181af7[_0xc1c6('0x2e')],{'$or':_[_0xc1c6('0x20')](_0x181af7['attributes'],function(_0x465710){var _0x4c9cde={};_0x4c9cde[_0x465710]={'$like':'%'+_0x5f47c8[_0xc1c6('0x24')]['filter']+'%'};return _0x4c9cde;})});}_0x181af7=_[_0xc1c6('0x30')]({},_0x181af7,_0x5f47c8[_0xc1c6('0x33')]);return _0x4324ef[_0xc1c6('0x44')](_0x181af7);}})[_0xc1c6('0x1a')](function(_0x16eaf4){if(_0x16eaf4){_0x5a3093=_0x16eaf4[_0xc1c6('0x2a')];if(!_0x5f47c8[_0xc1c6('0x24')][_0xc1c6('0x2b')](_0xc1c6('0x2c'))){_0x181af7[_0xc1c6('0x15')]=qs['limit'](_0x5f47c8[_0xc1c6('0x24')]['limit']);_0x181af7[_0xc1c6('0x14')]=qs[_0xc1c6('0x14')](_0x5f47c8[_0xc1c6('0x24')][_0xc1c6('0x14')]);}return _0x4324ef[_0xc1c6('0x44')](_0x181af7);}})[_0xc1c6('0x1a')](function(_0xcd151){if(_0xcd151){return _0xcd151?{'count':_0x5a3093,'rows':_0xcd151}:null;}})[_0xc1c6('0x1a')](respondWithResult(_0x3c0fdf,null))['catch'](handleError(_0x3c0fdf,null));};exports[_0xc1c6('0x46')]=function(_0x30b1f9,_0x20fde1,_0x22cbfa){if(_0x30b1f9[_0xc1c6('0x3c')]['id']){delete _0x30b1f9['body']['id'];}return db[_0xc1c6('0x21')][_0xc1c6('0x43')]({'where':{'id':_0x30b1f9[_0xc1c6('0x37')]['id']}})[_0xc1c6('0x1a')](handleEntityNotFound(_0x20fde1,null))['then'](function(_0x535785){if(_0x535785){return _0x535785[_0xc1c6('0x46')](_0x30b1f9['body'][_0xc1c6('0x47')]||[]);}return null;})[_0xc1c6('0x1a')](respondWithResult(_0x20fde1,null))[_0xc1c6('0x36')](handleError(_0x20fde1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 0fdc195..5a41c44 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 _0x7708=['../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','rimraf'];(function(_0x3de3de,_0x19f4ba){var _0x39112e=function(_0x5db5a3){while(--_0x5db5a3){_0x3de3de['push'](_0x3de3de['shift']());}};_0x39112e(++_0x19f4ba);}(_0x7708,0x188));var _0x8770=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7708[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb78e=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define'];(function(_0x18770a,_0x3354e1){var _0x532e12=function(_0x2ae958){while(--_0x2ae958){_0x18770a['push'](_0x18770a['shift']());}};_0x532e12(++_0x3354e1);}(_0xb78e,0x1c9));var _0xeb78=function(_0x42497c,_0x5f0ce3){_0x42497c=_0x42497c-0x0;var _0x2dcdb5=_0xb78e[_0x42497c];return _0x2dcdb5;};'use strict';var _=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var logger=require('../../config/logger')(_0xeb78('0x2'));var moment=require(_0xeb78('0x3'));var BPromise=require(_0xeb78('0x4'));var rp=require(_0xeb78('0x5'));var fs=require('fs');var path=require(_0xeb78('0x6'));var rimraf=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var attributes=require(_0xeb78('0x9'));module['exports']=function(_0x3c35e7,_0x17a736){return _0x3c35e7[_0xeb78('0xa')](_0xeb78('0xb'),attributes,{'tableName':_0xeb78('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 01b3e03..a071fca 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 _0x771f=['ZendeskConfiguration,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x207bbb,_0x144386){var _0x2765ce=function(_0x299a68){while(--_0x299a68){_0x207bbb['push'](_0x207bbb['shift']());}};_0x2765ce(++_0x144386);}(_0x771f,0x1cb));var _0xf771=function(_0x149de2,_0x5cbeec){_0x149de2=_0x149de2-0x0;var _0x59ffeb=_0x771f[_0x149de2];return _0x59ffeb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf771('0x0'));var BPromise=require(_0xf771('0x1'));var rs=require(_0xf771('0x2'));var fs=require('fs');var Redis=require(_0xf771('0x3'));var db=require(_0xf771('0x4'))['db'];var utils=require(_0xf771('0x5'));var logger=require(_0xf771('0x6'))(_0xf771('0x7'));var config=require('../../config/environment');var jayson=require(_0xf771('0x8'));var client=jayson['client'][_0xf771('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ad351,_0x3808e1,_0x566d8d){return new BPromise(function(_0x223201,_0x5279e8){return client[_0xf771('0xa')](_0x1ad351,_0x566d8d)['then'](function(_0x2e5d04){logger[_0xf771('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3808e1,_0xf771('0xc'));logger['debug'](_0xf771('0xd'),_0x3808e1,_0xf771('0xc'),JSON['stringify'](_0x2e5d04));if(_0x2e5d04[_0xf771('0xe')]){if(_0x2e5d04[_0xf771('0xe')][_0xf771('0xf')]===0x1f4){logger[_0xf771('0xe')](_0xf771('0x10'),_0x3808e1,_0x2e5d04[_0xf771('0xe')][_0xf771('0x11')]);return _0x5279e8(_0x2e5d04['error']['message']);}logger[_0xf771('0xe')](_0xf771('0x10'),_0x3808e1,_0x2e5d04[_0xf771('0xe')][_0xf771('0x11')]);return _0x223201(_0x2e5d04['error'][_0xf771('0x11')]);}else{logger['info'](_0xf771('0x10'),_0x3808e1,_0xf771('0xc'));_0x223201(_0x2e5d04[_0xf771('0x12')][_0xf771('0x11')]);}})['catch'](function(_0x27c8cf){logger[_0xf771('0xe')](_0xf771('0x10'),_0x3808e1,_0x27c8cf);_0x5279e8(_0x27c8cf);});});} \ No newline at end of file +var _0xf064=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird'];(function(_0x1e3d86,_0x241e96){var _0x14c3b9=function(_0x186f15){while(--_0x186f15){_0x1e3d86['push'](_0x1e3d86['shift']());}};_0x14c3b9(++_0x241e96);}(_0xf064,0x151));var _0x4f06=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0xf064[_0x2e4cbf];return _0x52840f;};'use strict';var _=require('lodash');var util=require(_0x4f06('0x0'));var moment=require(_0x4f06('0x1'));var BPromise=require(_0x4f06('0x2'));var rs=require(_0x4f06('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f06('0x4'));var logger=require(_0x4f06('0x5'))(_0x4f06('0x6'));var config=require('../../config/environment');var jayson=require(_0x4f06('0x7'));var client=jayson[_0x4f06('0x8')][_0x4f06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x673352,_0x1f9da8,_0x35ef32){return new BPromise(function(_0x1a88e4,_0x3f360b){return client[_0x4f06('0xa')](_0x673352,_0x35ef32)[_0x4f06('0xb')](function(_0x49c4c4){logger['info'](_0x4f06('0xc'),_0x1f9da8,_0x4f06('0xd'));logger[_0x4f06('0xe')](_0x4f06('0xf'),_0x1f9da8,_0x4f06('0xd'),JSON['stringify'](_0x49c4c4));if(_0x49c4c4[_0x4f06('0x10')]){if(_0x49c4c4[_0x4f06('0x10')]['code']===0x1f4){logger[_0x4f06('0x10')](_0x4f06('0xc'),_0x1f9da8,_0x49c4c4[_0x4f06('0x10')][_0x4f06('0x11')]);return _0x3f360b(_0x49c4c4[_0x4f06('0x10')][_0x4f06('0x11')]);}logger[_0x4f06('0x10')](_0x4f06('0xc'),_0x1f9da8,_0x49c4c4[_0x4f06('0x10')]['message']);return _0x1a88e4(_0x49c4c4[_0x4f06('0x10')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x1f9da8,'request\x20sent');_0x1a88e4(_0x49c4c4[_0x4f06('0x12')][_0x4f06('0x11')]);}})[_0x4f06('0x13')](function(_0x3e1c4e){logger['error'](_0x4f06('0xc'),_0x1f9da8,_0x3e1c4e);_0x3f360b(_0x3e1c4e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2a0a966..5949660 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 _0xabd0=['fs-extra','./intZendeskField.controller','get','index','isAuthenticated','show','put','update','delete','/:id','destroy','exports','util','path','express','Router'];(function(_0x33b213,_0x419d17){var _0x8c4e75=function(_0x255aa4){while(--_0x255aa4){_0x33b213['push'](_0x33b213['shift']());}};_0x8c4e75(++_0x419d17);}(_0xabd0,0xbc));var _0x0abd=function(_0x1c3753,_0x8387f){_0x1c3753=_0x1c3753-0x0;var _0x598fca=_0xabd0[_0x1c3753];return _0x598fca;};'use strict';var multer=require('multer');var util=require(_0x0abd('0x0'));var path=require(_0x0abd('0x1'));var timeout=require('connect-timeout');var express=require(_0x0abd('0x2'));var router=express[_0x0abd('0x3')]();var fs_extra=require(_0x0abd('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0abd('0x5'));router[_0x0abd('0x6')]('/',auth['isAuthenticated'](),controller[_0x0abd('0x7')]);router[_0x0abd('0x6')]('/:id',auth[_0x0abd('0x8')](),controller[_0x0abd('0x9')]);router['post']('/',auth[_0x0abd('0x8')](),controller['create']);router[_0x0abd('0xa')]('/:id',auth[_0x0abd('0x8')](),controller[_0x0abd('0xb')]);router[_0x0abd('0xc')](_0x0abd('0xd'),auth[_0x0abd('0x8')](),controller[_0x0abd('0xe')]);module[_0x0abd('0xf')]=router; \ No newline at end of file +var _0xbdb6=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','get','show','post','create','put','/:id','update','delete'];(function(_0x3d9a0e,_0x54d11b){var _0x3f0668=function(_0x1fe6b5){while(--_0x1fe6b5){_0x3d9a0e['push'](_0x3d9a0e['shift']());}};_0x3f0668(++_0x54d11b);}(_0xbdb6,0x11f));var _0x6bdb=function(_0x37496d,_0xf738a6){_0x37496d=_0x37496d-0x0;var _0x3fc0e9=_0xbdb6[_0x37496d];return _0x3fc0e9;};'use strict';var multer=require(_0x6bdb('0x0'));var util=require(_0x6bdb('0x1'));var path=require(_0x6bdb('0x2'));var timeout=require(_0x6bdb('0x3'));var express=require(_0x6bdb('0x4'));var router=express[_0x6bdb('0x5')]();var fs_extra=require(_0x6bdb('0x6'));var auth=require(_0x6bdb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router['get']('/',auth[_0x6bdb('0x8')](),controller['index']);router[_0x6bdb('0x9')]('/:id',auth[_0x6bdb('0x8')](),controller[_0x6bdb('0xa')]);router[_0x6bdb('0xb')]('/',auth['isAuthenticated'](),controller[_0x6bdb('0xc')]);router[_0x6bdb('0xd')](_0x6bdb('0xe'),auth[_0x6bdb('0x8')](),controller[_0x6bdb('0xf')]);router[_0x6bdb('0x10')](_0x6bdb('0xe'),auth[_0x6bdb('0x8')](),controller[_0x6bdb('0x11')]);module[_0x6bdb('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index b754e79..9fa475a 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 _0xa1ff=['variable','keyValue','picklist','STRING','customVariable','sequelize','exports','string'];(function(_0x1e44f6,_0x2defd4){var _0x1cb261=function(_0x256906){while(--_0x256906){_0x1e44f6['push'](_0x1e44f6['shift']());}};_0x1cb261(++_0x2defd4);}(_0xa1ff,0x6d));var _0xfa1f=function(_0x406957,_0x36fc08){_0x406957=_0x406957-0x0;var _0x803a57=_0xa1ff[_0x406957];return _0x803a57;};'use strict';var Sequelize=require(_0xfa1f('0x0'));module[_0xfa1f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfa1f('0x2'),_0xfa1f('0x3'),'customVariable',_0xfa1f('0x4'),_0xfa1f('0x5')),'defaultValue':_0xfa1f('0x2')},'content':{'type':Sequelize[_0xfa1f('0x6')]},'key':{'type':Sequelize[_0xfa1f('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xfa1f('0x2'),_0xfa1f('0x3'),_0xfa1f('0x7'))},'keyContent':{'type':Sequelize[_0xfa1f('0x6')]},'idField':{'type':Sequelize[_0xfa1f('0x6')]},'nameField':{'type':Sequelize[_0xfa1f('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfa1f('0x6')]}}; \ No newline at end of file +var _0x6347=['picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','string','variable'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x6347,0x14d));var _0x7634=function(_0x30cb6e,_0x42b8a3){_0x30cb6e=_0x30cb6e-0x0;var _0x29696e=_0x6347[_0x30cb6e];return _0x29696e;};'use strict';var Sequelize=require(_0x7634('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x7634('0x1'),_0x7634('0x2'),'customVariable','keyValue',_0x7634('0x3')),'defaultValue':_0x7634('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7634('0x4')]},'keyType':{'type':Sequelize[_0x7634('0x5')](_0x7634('0x1'),'variable',_0x7634('0x6'))},'keyContent':{'type':Sequelize[_0x7634('0x4')]},'idField':{'type':Sequelize[_0x7634('0x4')]},'nameField':{'type':Sequelize[_0x7634('0x4')]},'customField':{'type':Sequelize[_0x7634('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7634('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 6c8f6ce..f62d44a 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 _0xcdc9=['set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','name','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','rows','catch','show','params','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x4e2e70,_0x5a3d6f){var _0x30cf9c=function(_0x4939a){while(--_0x4939a){_0x4e2e70['push'](_0x4e2e70['shift']());}};_0x30cf9c(++_0x5a3d6f);}(_0xcdc9,0x1a9));var _0x9cdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcdc9[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x9cdc('0x0'));var rimraf=require(_0x9cdc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9cdc('0x2'));var rp=require(_0x9cdc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9cdc('0x4'));var util=require(_0x9cdc('0x5'));var path=require(_0x9cdc('0x6'));var sox=require('sox');var csv=require(_0x9cdc('0x7'));var ejs=require(_0x9cdc('0x8'));var fs=require('fs');var fs_extra=require(_0x9cdc('0x9'));var _=require(_0x9cdc('0xa'));var squel=require(_0x9cdc('0xb'));var crypto=require(_0x9cdc('0xc'));var jsforce=require(_0x9cdc('0xd'));var deskjs=require(_0x9cdc('0xe'));var toCsv=require(_0x9cdc('0x7'));var querystring=require(_0x9cdc('0xf'));var Papa=require(_0x9cdc('0x10'));var Redis=require(_0x9cdc('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9cdc('0x12'));var hardwareService=require(_0x9cdc('0x13'));var logger=require(_0x9cdc('0x14'))(_0x9cdc('0x15'));var utils=require(_0x9cdc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9cdc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cc3fa,_0x423cf2){_0x423cf2=_0x423cf2||0xcc;return function(_0x1b77d2){if(_0x1b77d2){return _0x3cc3fa[_0x9cdc('0x18')](_0x423cf2);}return _0x3cc3fa[_0x9cdc('0x19')](_0x423cf2)[_0x9cdc('0x1a')]();};}function respondWithResult(_0x3e8ead,_0x324402){_0x324402=_0x324402||0xc8;return function(_0x403a46){if(_0x403a46){return _0x3e8ead['status'](_0x324402)[_0x9cdc('0x1b')](_0x403a46);}};}function respondWithFilteredResult(_0x15da93,_0x374423){return function(_0x2b464f){if(_0x2b464f){var _0x51dfa2=typeof _0x374423[_0x9cdc('0x1c')]===_0x9cdc('0x1d')&&typeof _0x374423[_0x9cdc('0x1e')]===_0x9cdc('0x1d');var _0x314585=_0x2b464f['count'];var _0x18dcb6=_0x51dfa2?0x0:_0x374423['offset'];var _0x3e10f6=_0x51dfa2?_0x2b464f['count']:_0x374423[_0x9cdc('0x1c')]+_0x374423['limit'];var _0x5d7372;if(_0x3e10f6>=_0x314585){_0x3e10f6=_0x314585;_0x5d7372=0xc8;}else{_0x5d7372=0xce;}_0x15da93[_0x9cdc('0x19')](_0x5d7372);return _0x15da93[_0x9cdc('0x1f')](_0x9cdc('0x20'),_0x18dcb6+'-'+_0x3e10f6+'/'+_0x314585)[_0x9cdc('0x1b')](_0x2b464f);}return null;};}function patchUpdates(_0x3c4b4e){return function(_0x5c0c72){try{jsonpatch[_0x9cdc('0x21')](_0x5c0c72,_0x3c4b4e,!![]);}catch(_0x3aee12){return BPromise[_0x9cdc('0x22')](_0x3aee12);}return _0x5c0c72[_0x9cdc('0x23')]();};}function saveUpdates(_0x3a4528,_0x1dc0f6){return function(_0x3b8277){if(_0x3b8277){return _0x3b8277[_0x9cdc('0x24')](_0x3a4528)[_0x9cdc('0x25')](function(_0x166d31){return _0x166d31;});}return null;};}function removeEntity(_0x2218ab,_0xa5f2d3){return function(_0x1f61bd){if(_0x1f61bd){return _0x1f61bd[_0x9cdc('0x26')]()['then'](function(){_0x2218ab[_0x9cdc('0x19')](0xcc)[_0x9cdc('0x1a')]();});}};}function handleEntityNotFound(_0x22e2b7,_0x1805cf){return function(_0x56bf75){if(!_0x56bf75){_0x22e2b7[_0x9cdc('0x18')](0x194);}return _0x56bf75;};}function handleError(_0x5b1c45,_0x485cb5){_0x485cb5=_0x485cb5||0x1f4;return function(_0x13e27a){logger[_0x9cdc('0x27')](_0x13e27a['stack']);if(_0x13e27a['name']){delete _0x13e27a['name'];}_0x5b1c45['status'](_0x485cb5)[_0x9cdc('0x28')](_0x13e27a);};}exports[_0x9cdc('0x29')]=function(_0x54b2e0,_0x5abf13){var _0x5912f5={},_0x18a0a0={},_0x5714d7={'count':0x0,'rows':[]};var _0x28aa73=_['map'](db[_0x9cdc('0x2a')][_0x9cdc('0x2b')],function(_0x5e6076){return{'name':_0x5e6076[_0x9cdc('0x2c')],'type':_0x5e6076[_0x9cdc('0x2d')][_0x9cdc('0x2e')]};});_0x18a0a0[_0x9cdc('0x2f')]=_[_0x9cdc('0x30')](_0x28aa73,_0x9cdc('0x31'));_0x18a0a0['query']=_[_0x9cdc('0x32')](_0x54b2e0['query']);_0x18a0a0[_0x9cdc('0x33')]=_[_0x9cdc('0x34')](_0x18a0a0[_0x9cdc('0x2f')],_0x18a0a0[_0x9cdc('0x35')]);_0x5912f5['attributes']=_['intersection'](_0x18a0a0[_0x9cdc('0x2f')],qs[_0x9cdc('0x36')](_0x54b2e0[_0x9cdc('0x35')][_0x9cdc('0x36')]));_0x5912f5['attributes']=_0x5912f5[_0x9cdc('0x37')][_0x9cdc('0x38')]?_0x5912f5[_0x9cdc('0x37')]:_0x18a0a0[_0x9cdc('0x2f')];if(!_0x54b2e0[_0x9cdc('0x35')][_0x9cdc('0x39')](_0x9cdc('0x3a'))){_0x5912f5[_0x9cdc('0x1e')]=qs[_0x9cdc('0x1e')](_0x54b2e0[_0x9cdc('0x35')]['limit']);_0x5912f5[_0x9cdc('0x1c')]=qs['offset'](_0x54b2e0['query'][_0x9cdc('0x1c')]);}_0x5912f5['order']=qs[_0x9cdc('0x3b')](_0x54b2e0[_0x9cdc('0x35')][_0x9cdc('0x3b')]);_0x5912f5[_0x9cdc('0x3c')]=qs[_0x9cdc('0x33')](_[_0x9cdc('0x3d')](_0x54b2e0[_0x9cdc('0x35')],_0x18a0a0[_0x9cdc('0x33')]),_0x28aa73);if(_0x54b2e0[_0x9cdc('0x35')]['filter']){_0x5912f5['where']=_[_0x9cdc('0x3e')](_0x5912f5[_0x9cdc('0x3c')],{'$or':_['map'](_0x28aa73,function(_0xe79ca8){if(_0xe79ca8[_0x9cdc('0x2d')]!==_0x9cdc('0x3f')){var _0x8e64c3={};_0x8e64c3[_0xe79ca8[_0x9cdc('0x31')]]={'$like':'%'+_0x54b2e0[_0x9cdc('0x35')][_0x9cdc('0x40')]+'%'};return _0x8e64c3;}})});}_0x5912f5=_[_0x9cdc('0x3e')]({},_0x5912f5,_0x54b2e0[_0x9cdc('0x41')]);var _0x4b68ad={'where':_0x5912f5['where']};return db[_0x9cdc('0x2a')][_0x9cdc('0x42')](_0x4b68ad)[_0x9cdc('0x25')](function(_0x447029){_0x5714d7[_0x9cdc('0x42')]=_0x447029;if(_0x54b2e0[_0x9cdc('0x35')][_0x9cdc('0x43')]){_0x5912f5['include']=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x5912f5);})[_0x9cdc('0x25')](function(_0xa19bac){_0x5714d7[_0x9cdc('0x44')]=_0xa19bac;return _0x5714d7;})['then'](respondWithFilteredResult(_0x5abf13,_0x5912f5))[_0x9cdc('0x45')](handleError(_0x5abf13,null));};exports[_0x9cdc('0x46')]=function(_0x2b685f,_0x5935bc){var _0x3a670b={'raw':!![],'where':{'id':_0x2b685f[_0x9cdc('0x47')]['id']}},_0x3168aa={};_0x3168aa[_0x9cdc('0x2f')]=_[_0x9cdc('0x32')](db[_0x9cdc('0x2a')][_0x9cdc('0x2b')]);_0x3168aa['query']=_['keys'](_0x2b685f[_0x9cdc('0x35')]);_0x3168aa[_0x9cdc('0x33')]=_['intersection'](_0x3168aa['model'],_0x3168aa[_0x9cdc('0x35')]);_0x3a670b[_0x9cdc('0x37')]=_['intersection'](_0x3168aa[_0x9cdc('0x2f')],qs[_0x9cdc('0x36')](_0x2b685f[_0x9cdc('0x35')][_0x9cdc('0x36')]));_0x3a670b[_0x9cdc('0x37')]=_0x3a670b['attributes'][_0x9cdc('0x38')]?_0x3a670b[_0x9cdc('0x37')]:_0x3168aa[_0x9cdc('0x2f')];if(_0x2b685f[_0x9cdc('0x35')][_0x9cdc('0x43')]){_0x3a670b[_0x9cdc('0x48')]=[{'all':!![]}];}_0x3a670b=_[_0x9cdc('0x3e')]({},_0x3a670b,_0x2b685f[_0x9cdc('0x41')]);return db[_0x9cdc('0x2a')]['find'](_0x3a670b)[_0x9cdc('0x25')](handleEntityNotFound(_0x5935bc,null))[_0x9cdc('0x25')](respondWithResult(_0x5935bc,null))[_0x9cdc('0x45')](handleError(_0x5935bc,null));};exports[_0x9cdc('0x49')]=function(_0x5e25fa,_0x57e7d0){return db[_0x9cdc('0x2a')]['create'](_0x5e25fa[_0x9cdc('0x4a')],{})[_0x9cdc('0x25')](respondWithResult(_0x57e7d0,0xc9))[_0x9cdc('0x45')](handleError(_0x57e7d0,null));};exports[_0x9cdc('0x24')]=function(_0x1865ef,_0x2a8615){if(_0x1865ef[_0x9cdc('0x4a')]['id']){delete _0x1865ef['body']['id'];}return db['ZendeskField']['find']({'where':{'id':_0x1865ef[_0x9cdc('0x47')]['id']}})[_0x9cdc('0x25')](handleEntityNotFound(_0x2a8615,null))[_0x9cdc('0x25')](saveUpdates(_0x1865ef[_0x9cdc('0x4a')],null))[_0x9cdc('0x25')](respondWithResult(_0x2a8615,null))['catch'](handleError(_0x2a8615,null));};exports[_0x9cdc('0x26')]=function(_0x19aa76,_0x6e31be){return db['ZendeskField'][_0x9cdc('0x4b')]({'where':{'id':_0x19aa76['params']['id']}})['then'](handleEntityNotFound(_0x6e31be,null))[_0x9cdc('0x25')](removeEntity(_0x6e31be,null))['catch'](handleError(_0x6e31be,null));}; \ No newline at end of file +var _0xa2ab=['options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','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','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xa2ab,0xa7));var _0xba2a=function(_0x16fcf9,_0x5a7df9){_0x16fcf9=_0x16fcf9-0x0;var _0x34714b=_0xa2ab[_0x16fcf9];return _0x34714b;};'use strict';var emlformat=require(_0xba2a('0x0'));var rimraf=require(_0xba2a('0x1'));var zipdir=require(_0xba2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba2a('0x3'));var moment=require(_0xba2a('0x4'));var BPromise=require(_0xba2a('0x5'));var Mustache=require(_0xba2a('0x6'));var util=require(_0xba2a('0x7'));var path=require(_0xba2a('0x8'));var sox=require(_0xba2a('0x9'));var csv=require('to-csv');var ejs=require(_0xba2a('0xa'));var fs=require('fs');var fs_extra=require(_0xba2a('0xb'));var _=require(_0xba2a('0xc'));var squel=require('squel');var crypto=require(_0xba2a('0xd'));var jsforce=require(_0xba2a('0xe'));var deskjs=require(_0xba2a('0xf'));var toCsv=require(_0xba2a('0x10'));var querystring=require('querystring');var Papa=require(_0xba2a('0x11'));var Redis=require(_0xba2a('0x12'));var authService=require(_0xba2a('0x13'));var qs=require(_0xba2a('0x14'));var as=require(_0xba2a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xba2a('0x16'))(_0xba2a('0x17'));var utils=require(_0xba2a('0x18'));var config=require(_0xba2a('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xba2a('0x1a'))['db'];function respondWithStatusCode(_0x10bf76,_0x94b897){_0x94b897=_0x94b897||0xcc;return function(_0x2c850e){if(_0x2c850e){return _0x10bf76[_0xba2a('0x1b')](_0x94b897);}return _0x10bf76['status'](_0x94b897)[_0xba2a('0x1c')]();};}function respondWithResult(_0x44759c,_0xe2bbdb){_0xe2bbdb=_0xe2bbdb||0xc8;return function(_0x127c42){if(_0x127c42){return _0x44759c['status'](_0xe2bbdb)[_0xba2a('0x1d')](_0x127c42);}};}function respondWithFilteredResult(_0x1b3272,_0x261f90){return function(_0x4147a6){if(_0x4147a6){var _0x4b9f63=typeof _0x261f90[_0xba2a('0x1e')]===_0xba2a('0x1f')&&typeof _0x261f90['limit']===_0xba2a('0x1f');var _0x49c57e=_0x4147a6['count'];var _0x559c6e=_0x4b9f63?0x0:_0x261f90[_0xba2a('0x1e')];var _0xa56be8=_0x4b9f63?_0x4147a6[_0xba2a('0x20')]:_0x261f90[_0xba2a('0x1e')]+_0x261f90['limit'];var _0x437e4c;if(_0xa56be8>=_0x49c57e){_0xa56be8=_0x49c57e;_0x437e4c=0xc8;}else{_0x437e4c=0xce;}_0x1b3272[_0xba2a('0x21')](_0x437e4c);return _0x1b3272['set'](_0xba2a('0x22'),_0x559c6e+'-'+_0xa56be8+'/'+_0x49c57e)['json'](_0x4147a6);}return null;};}function patchUpdates(_0x3b3924){return function(_0x2ad68){try{jsonpatch[_0xba2a('0x23')](_0x2ad68,_0x3b3924,!![]);}catch(_0x1d4ba9){return BPromise[_0xba2a('0x24')](_0x1d4ba9);}return _0x2ad68[_0xba2a('0x25')]();};}function saveUpdates(_0x55565d,_0x2e0712){return function(_0x2cc3db){if(_0x2cc3db){return _0x2cc3db[_0xba2a('0x26')](_0x55565d)[_0xba2a('0x27')](function(_0x3bc8e1){return _0x3bc8e1;});}return null;};}function removeEntity(_0x56fa5e,_0xdfbf5c){return function(_0x4458cb){if(_0x4458cb){return _0x4458cb[_0xba2a('0x28')]()[_0xba2a('0x27')](function(){_0x56fa5e[_0xba2a('0x21')](0xcc)[_0xba2a('0x1c')]();});}};}function handleEntityNotFound(_0x24ee7d,_0x415dd7){return function(_0x4bba7a){if(!_0x4bba7a){_0x24ee7d[_0xba2a('0x1b')](0x194);}return _0x4bba7a;};}function handleError(_0x3d1a75,_0x1a0f21){_0x1a0f21=_0x1a0f21||0x1f4;return function(_0x2a001c){logger['error'](_0x2a001c[_0xba2a('0x29')]);if(_0x2a001c[_0xba2a('0x2a')]){delete _0x2a001c[_0xba2a('0x2a')];}_0x3d1a75['status'](_0x1a0f21)['send'](_0x2a001c);};}exports[_0xba2a('0x2b')]=function(_0x2f292b,_0x19c776){var _0x3bb5c3={},_0x3aa95a={},_0x403372={'count':0x0,'rows':[]};var _0x85d5a4=_[_0xba2a('0x2c')](db[_0xba2a('0x2d')][_0xba2a('0x2e')],function(_0x53f32d){return{'name':_0x53f32d[_0xba2a('0x2f')],'type':_0x53f32d[_0xba2a('0x30')][_0xba2a('0x31')]};});_0x3aa95a[_0xba2a('0x32')]=_['map'](_0x85d5a4,_0xba2a('0x2a'));_0x3aa95a[_0xba2a('0x33')]=_[_0xba2a('0x34')](_0x2f292b['query']);_0x3aa95a[_0xba2a('0x35')]=_[_0xba2a('0x36')](_0x3aa95a[_0xba2a('0x32')],_0x3aa95a[_0xba2a('0x33')]);_0x3bb5c3[_0xba2a('0x37')]=_[_0xba2a('0x36')](_0x3aa95a[_0xba2a('0x32')],qs[_0xba2a('0x38')](_0x2f292b['query'][_0xba2a('0x38')]));_0x3bb5c3[_0xba2a('0x37')]=_0x3bb5c3[_0xba2a('0x37')][_0xba2a('0x39')]?_0x3bb5c3[_0xba2a('0x37')]:_0x3aa95a['model'];if(!_0x2f292b[_0xba2a('0x33')][_0xba2a('0x3a')](_0xba2a('0x3b'))){_0x3bb5c3[_0xba2a('0x3c')]=qs['limit'](_0x2f292b[_0xba2a('0x33')][_0xba2a('0x3c')]);_0x3bb5c3[_0xba2a('0x1e')]=qs['offset'](_0x2f292b[_0xba2a('0x33')][_0xba2a('0x1e')]);}_0x3bb5c3[_0xba2a('0x3d')]=qs['sort'](_0x2f292b[_0xba2a('0x33')][_0xba2a('0x3e')]);_0x3bb5c3[_0xba2a('0x3f')]=qs[_0xba2a('0x35')](_[_0xba2a('0x40')](_0x2f292b[_0xba2a('0x33')],_0x3aa95a[_0xba2a('0x35')]),_0x85d5a4);if(_0x2f292b['query'][_0xba2a('0x41')]){_0x3bb5c3['where']=_[_0xba2a('0x42')](_0x3bb5c3[_0xba2a('0x3f')],{'$or':_['map'](_0x85d5a4,function(_0x5e4aa6){if(_0x5e4aa6['type']!=='VIRTUAL'){var _0x2402ff={};_0x2402ff[_0x5e4aa6['name']]={'$like':'%'+_0x2f292b[_0xba2a('0x33')][_0xba2a('0x41')]+'%'};return _0x2402ff;}})});}_0x3bb5c3=_['merge']({},_0x3bb5c3,_0x2f292b[_0xba2a('0x43')]);var _0x35a9c1={'where':_0x3bb5c3[_0xba2a('0x3f')]};return db['ZendeskField'][_0xba2a('0x20')](_0x35a9c1)['then'](function(_0x34fbfb){_0x403372[_0xba2a('0x20')]=_0x34fbfb;if(_0x2f292b[_0xba2a('0x33')]['includeAll']){_0x3bb5c3[_0xba2a('0x44')]=[{'all':!![]}];}return db[_0xba2a('0x2d')][_0xba2a('0x45')](_0x3bb5c3);})['then'](function(_0xc184a6){_0x403372[_0xba2a('0x46')]=_0xc184a6;return _0x403372;})['then'](respondWithFilteredResult(_0x19c776,_0x3bb5c3))[_0xba2a('0x47')](handleError(_0x19c776,null));};exports[_0xba2a('0x48')]=function(_0x22a674,_0xc180a6){var _0x38d98c={'raw':!![],'where':{'id':_0x22a674[_0xba2a('0x49')]['id']}},_0x3905d7={};_0x3905d7[_0xba2a('0x32')]=_[_0xba2a('0x34')](db['ZendeskField'][_0xba2a('0x2e')]);_0x3905d7[_0xba2a('0x33')]=_['keys'](_0x22a674[_0xba2a('0x33')]);_0x3905d7[_0xba2a('0x35')]=_[_0xba2a('0x36')](_0x3905d7[_0xba2a('0x32')],_0x3905d7['query']);_0x38d98c['attributes']=_['intersection'](_0x3905d7['model'],qs[_0xba2a('0x38')](_0x22a674[_0xba2a('0x33')]['fields']));_0x38d98c['attributes']=_0x38d98c['attributes'][_0xba2a('0x39')]?_0x38d98c[_0xba2a('0x37')]:_0x3905d7['model'];if(_0x22a674['query'][_0xba2a('0x4a')]){_0x38d98c[_0xba2a('0x44')]=[{'all':!![]}];}_0x38d98c=_['merge']({},_0x38d98c,_0x22a674[_0xba2a('0x43')]);return db[_0xba2a('0x2d')][_0xba2a('0x4b')](_0x38d98c)['then'](handleEntityNotFound(_0xc180a6,null))[_0xba2a('0x27')](respondWithResult(_0xc180a6,null))['catch'](handleError(_0xc180a6,null));};exports[_0xba2a('0x4c')]=function(_0x574075,_0x317bd8){return db[_0xba2a('0x2d')][_0xba2a('0x4c')](_0x574075[_0xba2a('0x4d')],{})[_0xba2a('0x27')](respondWithResult(_0x317bd8,0xc9))[_0xba2a('0x47')](handleError(_0x317bd8,null));};exports['update']=function(_0x46d4f8,_0x5e7dbc){if(_0x46d4f8[_0xba2a('0x4d')]['id']){delete _0x46d4f8['body']['id'];}return db[_0xba2a('0x2d')][_0xba2a('0x4b')]({'where':{'id':_0x46d4f8[_0xba2a('0x49')]['id']}})['then'](handleEntityNotFound(_0x5e7dbc,null))[_0xba2a('0x27')](saveUpdates(_0x46d4f8['body'],null))['then'](respondWithResult(_0x5e7dbc,null))[_0xba2a('0x47')](handleError(_0x5e7dbc,null));};exports['destroy']=function(_0x4f16c2,_0x236a31){return db[_0xba2a('0x2d')]['find']({'where':{'id':_0x4f16c2[_0xba2a('0x49')]['id']}})[_0xba2a('0x27')](handleEntityNotFound(_0x236a31,null))[_0xba2a('0x27')](removeEntity(_0x236a31,null))['catch'](handleError(_0x236a31,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 99535dd..6fcb299 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 _0x8b0a=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','util'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8b0a,0xed));var _0xa8b0=function(_0x47a328,_0xa75525){_0x47a328=_0x47a328-0x0;var _0x6c2a66=_0x8b0a[_0x47a328];return _0x6c2a66;};'use strict';var _=require('lodash');var util=require(_0xa8b0('0x0'));var logger=require(_0xa8b0('0x1'))('api');var moment=require(_0xa8b0('0x2'));var BPromise=require('bluebird');var rp=require(_0xa8b0('0x3'));var fs=require('fs');var path=require(_0xa8b0('0x4'));var rimraf=require(_0xa8b0('0x5'));var config=require(_0xa8b0('0x6'));var attributes=require(_0xa8b0('0x7'));module[_0xa8b0('0x8')]=function(_0x24b718,_0x3616a2){return _0x24b718['define'](_0xa8b0('0x9'),attributes,{'tableName':_0xa8b0('0xa'),'paranoid':![],'indexes':[{'name':_0xa8b0('0xb'),'fields':[_0xa8b0('0xc'),_0xa8b0('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x731f=['ZendeskField','int_zendesk_fields','zendesk_unique_index','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x59caeb,_0x73021e){var _0x3dbc19=function(_0x1826b8){while(--_0x1826b8){_0x59caeb['push'](_0x59caeb['shift']());}};_0x3dbc19(++_0x73021e);}(_0x731f,0x9d));var _0xf731=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x731f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf731('0x0'));var util=require(_0xf731('0x1'));var logger=require(_0xf731('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf731('0x3'));var rp=require(_0xf731('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf731('0x5'));var config=require(_0xf731('0x6'));var attributes=require(_0xf731('0x7'));module['exports']=function(_0x4fb509,_0x3ac12b){return _0x4fb509['define'](_0xf731('0x8'),attributes,{'tableName':_0xf731('0x9'),'paranoid':![],'indexes':[{'name':_0xf731('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index cc5e0e2..98852de 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 _0xd171=['stringify','error','code','ZendeskField,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x2be172,_0x347536){var _0x565508=function(_0x8f5192){while(--_0x8f5192){_0x2be172['push'](_0x2be172['shift']());}};_0x565508(++_0x347536);}(_0xd171,0x9e));var _0x1d17=function(_0x38ff2b,_0x3a0316){_0x38ff2b=_0x38ff2b-0x0;var _0x341f5e=_0xd171[_0x38ff2b];return _0x341f5e;};'use strict';var _=require(_0x1d17('0x0'));var util=require(_0x1d17('0x1'));var moment=require(_0x1d17('0x2'));var BPromise=require(_0x1d17('0x3'));var rs=require(_0x1d17('0x4'));var fs=require('fs');var Redis=require(_0x1d17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d17('0x6'));var logger=require('../../config/logger')(_0x1d17('0x7'));var config=require(_0x1d17('0x8'));var jayson=require(_0x1d17('0x9'));var client=jayson[_0x1d17('0xa')][_0x1d17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9a6c,_0x8f672,_0x3dfefd){return new BPromise(function(_0x54bf4b,_0x39893c){return client[_0x1d17('0xc')](_0x1c9a6c,_0x3dfefd)[_0x1d17('0xd')](function(_0xbd1694){logger['info']('ZendeskField,\x20%s,\x20%s',_0x8f672,_0x1d17('0xe'));logger[_0x1d17('0xf')](_0x1d17('0x10'),_0x8f672,'request\x20sent',JSON[_0x1d17('0x11')](_0xbd1694));if(_0xbd1694[_0x1d17('0x12')]){if(_0xbd1694[_0x1d17('0x12')][_0x1d17('0x13')]===0x1f4){logger['error'](_0x1d17('0x14'),_0x8f672,_0xbd1694[_0x1d17('0x12')][_0x1d17('0x15')]);return _0x39893c(_0xbd1694['error'][_0x1d17('0x15')]);}logger['error'](_0x1d17('0x14'),_0x8f672,_0xbd1694[_0x1d17('0x12')][_0x1d17('0x15')]);return _0x54bf4b(_0xbd1694[_0x1d17('0x12')][_0x1d17('0x15')]);}else{logger[_0x1d17('0x16')](_0x1d17('0x14'),_0x8f672,_0x1d17('0xe'));_0x54bf4b(_0xbd1694[_0x1d17('0x17')][_0x1d17('0x15')]);}})[_0x1d17('0x18')](function(_0x343e5e){logger[_0x1d17('0x12')]('ZendeskField,\x20%s,\x20%s',_0x8f672,_0x343e5e);_0x39893c(_0x343e5e);});});} \ No newline at end of file +var _0xf35b=['../../config/environment','jayson/promise','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x29604f,_0x436850){var _0x34f4df=function(_0x267cf0){while(--_0x267cf0){_0x29604f['push'](_0x29604f['shift']());}};_0x34f4df(++_0x436850);}(_0xf35b,0xc6));var _0xbf35=function(_0xbeb59c,_0x4725ce){_0xbeb59c=_0xbeb59c-0x0;var _0x6917b8=_0xf35b[_0xbeb59c];return _0x6917b8;};'use strict';var _=require(_0xbf35('0x0'));var util=require('util');var moment=require(_0xbf35('0x1'));var BPromise=require(_0xbf35('0x2'));var rs=require(_0xbf35('0x3'));var fs=require('fs');var Redis=require(_0xbf35('0x4'));var db=require(_0xbf35('0x5'))['db'];var utils=require(_0xbf35('0x6'));var logger=require(_0xbf35('0x7'))(_0xbf35('0x8'));var config=require(_0xbf35('0x9'));var jayson=require(_0xbf35('0xa'));var client=jayson['client'][_0xbf35('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47e86e,_0x4c6592,_0x5c21cf){return new BPromise(function(_0x50490a,_0x5979c9){return client[_0xbf35('0xc')](_0x47e86e,_0x5c21cf)[_0xbf35('0xd')](function(_0x2226a6){logger[_0xbf35('0xe')](_0xbf35('0xf'),_0x4c6592,_0xbf35('0x10'));logger['debug'](_0xbf35('0x11'),_0x4c6592,_0xbf35('0x10'),JSON['stringify'](_0x2226a6));if(_0x2226a6[_0xbf35('0x12')]){if(_0x2226a6[_0xbf35('0x12')][_0xbf35('0x13')]===0x1f4){logger['error'](_0xbf35('0xf'),_0x4c6592,_0x2226a6['error'][_0xbf35('0x14')]);return _0x5979c9(_0x2226a6['error'][_0xbf35('0x14')]);}logger['error'](_0xbf35('0xf'),_0x4c6592,_0x2226a6[_0xbf35('0x12')][_0xbf35('0x14')]);return _0x50490a(_0x2226a6[_0xbf35('0x12')][_0xbf35('0x14')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x4c6592,_0xbf35('0x10'));_0x50490a(_0x2226a6[_0xbf35('0x15')][_0xbf35('0x14')]);}})[_0xbf35('0x16')](function(_0x501145){logger[_0xbf35('0x12')](_0xbf35('0xf'),_0x4c6592,_0x501145);_0x5979c9(_0x501145);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 10ea7c9..c75a919 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 _0x65cc=['/:id/configurations','getConfigurations','create','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','index','/:id','isAuthenticated','show'];(function(_0x4ad19a,_0x5a0e6c){var _0x322183=function(_0x9b444e){while(--_0x9b444e){_0x4ad19a['push'](_0x4ad19a['shift']());}};_0x322183(++_0x5a0e6c);}(_0x65cc,0xfb));var _0xc65c=function(_0x27dc6f,_0x5dbea8){_0x27dc6f=_0x27dc6f-0x0;var _0x461137=_0x65cc[_0x27dc6f];return _0x461137;};'use strict';var multer=require('multer');var util=require(_0xc65c('0x0'));var path=require(_0xc65c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc65c('0x2'));var router=express[_0xc65c('0x3')]();var fs_extra=require(_0xc65c('0x4'));var auth=require(_0xc65c('0x5'));var interaction=require(_0xc65c('0x6'));var config=require('../../config/environment');var controller=require(_0xc65c('0x7'));router[_0xc65c('0x8')]('/',auth['isAuthenticated'](),controller[_0xc65c('0x9')]);router[_0xc65c('0x8')](_0xc65c('0xa'),auth[_0xc65c('0xb')](),controller[_0xc65c('0xc')]);router['get'](_0xc65c('0xd'),auth[_0xc65c('0xb')](),controller[_0xc65c('0xe')]);router[_0xc65c('0x8')]('/:id/fields',auth[_0xc65c('0xb')](),controller['getFields']);router['post']('/',auth[_0xc65c('0xb')](),controller[_0xc65c('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xc65c('0x10')]);router[_0xc65c('0x11')]('/:id',auth[_0xc65c('0xb')](),controller[_0xc65c('0x12')]);router[_0xc65c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xc65c('0x14')]);module[_0xc65c('0x15')]=router; \ No newline at end of file +var _0xcd31=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy'];(function(_0x4f93a0,_0x547e88){var _0x1be0ae=function(_0x36d6c7){while(--_0x36d6c7){_0x4f93a0['push'](_0x4f93a0['shift']());}};_0x1be0ae(++_0x547e88);}(_0xcd31,0x93));var _0x1cd3=function(_0xe48f36,_0x4cbfa9){_0xe48f36=_0xe48f36-0x0;var _0x5a78e9=_0xcd31[_0xe48f36];return _0x5a78e9;};'use strict';var multer=require(_0x1cd3('0x0'));var util=require('util');var path=require(_0x1cd3('0x1'));var timeout=require(_0x1cd3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cd3('0x3'));var interaction=require(_0x1cd3('0x4'));var config=require('../../config/environment');var controller=require(_0x1cd3('0x5'));router[_0x1cd3('0x6')]('/',auth[_0x1cd3('0x7')](),controller['index']);router[_0x1cd3('0x6')](_0x1cd3('0x8'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x9')]);router['get'](_0x1cd3('0xa'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0xb')]);router[_0x1cd3('0x6')](_0x1cd3('0xc'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0xd')]);router[_0x1cd3('0xe')]('/',auth[_0x1cd3('0x7')](),controller[_0x1cd3('0xf')]);router[_0x1cd3('0xe')](_0x1cd3('0xa'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x10')]);router[_0x1cd3('0x11')]('/:id',auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x12')]);router[_0x1cd3('0x13')](_0x1cd3('0x8'),auth[_0x1cd3('0x7')](),controller[_0x1cd3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index c788690..4cb17b7 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55e0=['STRING','sequelize','exports'];(function(_0x1e2f72,_0x4ecd3d){var _0x2f00a8=function(_0xf1ee63){while(--_0xf1ee63){_0x1e2f72['push'](_0x1e2f72['shift']());}};_0x2f00a8(++_0x4ecd3d);}(_0x55e0,0xdc));var _0x055e=function(_0x27c1f2,_0x3a3b9d){_0x27c1f2=_0x27c1f2-0x0;var _0x5ea234=_0x55e0[_0x27c1f2];return _0x5ea234;};'use strict';var Sequelize=require(_0x055e('0x0'));module[_0x055e('0x1')]={'name':{'type':Sequelize[_0x055e('0x2')]},'description':{'type':Sequelize[_0x055e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x055e('0x2')]},'clientSecret':{'type':Sequelize[_0x055e('0x2')]},'serverUrl':{'type':Sequelize[_0x055e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x055e('0x2')]},'refreshToken':{'type':Sequelize[_0x055e('0x2')]}}; \ No newline at end of file +var _0xb4e6=['sequelize','STRING'];(function(_0x1accbe,_0x500f6e){var _0x38b46f=function(_0xcb30bb){while(--_0xcb30bb){_0x1accbe['push'](_0x1accbe['shift']());}};_0x38b46f(++_0x500f6e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xb4e6[_0x11a220];return _0x20d8fe;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b4e('0x1')]},'description':{'type':Sequelize[_0x6b4e('0x1')]},'host':{'type':Sequelize[_0x6b4e('0x1')]},'zone':{'type':Sequelize[_0x6b4e('0x1')]},'clientId':{'type':Sequelize[_0x6b4e('0x1')]},'clientSecret':{'type':Sequelize[_0x6b4e('0x1')]},'serverUrl':{'type':Sequelize[_0x6b4e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x6b4e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index fef28d9..ac5659f 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 _0x1a9b=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','error','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','then','rows','show','params','keys','merge','options','catch','create','body','find','findOne','ZohoConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','serverUrl','code','host','zoho.eu','com','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x4f1afe,_0x29a790){var _0x552767=function(_0x89caf1){while(--_0x89caf1){_0x4f1afe['push'](_0x4f1afe['shift']());}};_0x552767(++_0x29a790);}(_0x1a9b,0xf6));var _0xb1a9=function(_0x54b17b,_0xcac443){_0x54b17b=_0x54b17b-0x0;var _0x587335=_0x1a9b[_0x54b17b];return _0x587335;};'use strict';var emlformat=require(_0xb1a9('0x0'));var rimraf=require(_0xb1a9('0x1'));var zipdir=require(_0xb1a9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1a9('0x3'));var moment=require(_0xb1a9('0x4'));var BPromise=require(_0xb1a9('0x5'));var Mustache=require(_0xb1a9('0x6'));var util=require(_0xb1a9('0x7'));var path=require(_0xb1a9('0x8'));var sox=require(_0xb1a9('0x9'));var csv=require(_0xb1a9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1a9('0xb'));var _=require(_0xb1a9('0xc'));var squel=require(_0xb1a9('0xd'));var crypto=require(_0xb1a9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb1a9('0xf'));var toCsv=require(_0xb1a9('0xa'));var querystring=require(_0xb1a9('0x10'));var Papa=require(_0xb1a9('0x11'));var Redis=require(_0xb1a9('0x12'));var authService=require(_0xb1a9('0x13'));var qs=require(_0xb1a9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb1a9('0x15'))(_0xb1a9('0x16'));var utils=require(_0xb1a9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb1a9('0x18'));var db=require(_0xb1a9('0x19'))['db'];var integrations=require(_0xb1a9('0x1a'));function respondWithStatusCode(_0x216637,_0x5918f3){_0x5918f3=_0x5918f3||0xcc;return function(_0x44fb4c){if(_0x44fb4c){return _0x216637[_0xb1a9('0x1b')](_0x5918f3);}return _0x216637[_0xb1a9('0x1c')](_0x5918f3)[_0xb1a9('0x1d')]();};}function respondWithResult(_0x3e1b9c,_0x46c24c){_0x46c24c=_0x46c24c||0xc8;return function(_0x3c0bd3){if(_0x3c0bd3){return _0x3e1b9c[_0xb1a9('0x1c')](_0x46c24c)['json'](_0x3c0bd3);}};}function respondWithFilteredResult(_0x1b053d,_0x6df313){return function(_0x42638c){if(_0x42638c){var _0x5d2586=typeof _0x6df313[_0xb1a9('0x1e')]===_0xb1a9('0x1f')&&typeof _0x6df313[_0xb1a9('0x20')]==='undefined';var _0x3e714d=_0x42638c[_0xb1a9('0x21')];var _0x206c46=_0x5d2586?0x0:_0x6df313[_0xb1a9('0x1e')];var _0x10bc74=_0x5d2586?_0x42638c['count']:_0x6df313['offset']+_0x6df313[_0xb1a9('0x20')];var _0x4cb89f;if(_0x10bc74>=_0x3e714d){_0x10bc74=_0x3e714d;_0x4cb89f=0xc8;}else{_0x4cb89f=0xce;}_0x1b053d[_0xb1a9('0x1c')](_0x4cb89f);return _0x1b053d['set'](_0xb1a9('0x22'),_0x206c46+'-'+_0x10bc74+'/'+_0x3e714d)[_0xb1a9('0x23')](_0x42638c);}return null;};}function patchUpdates(_0x3670f9){return function(_0x47d4df){try{jsonpatch[_0xb1a9('0x24')](_0x47d4df,_0x3670f9,!![]);}catch(_0x14db92){return BPromise[_0xb1a9('0x25')](_0x14db92);}return _0x47d4df['save']();};}function saveUpdates(_0x2d27ab,_0x1f296c){return function(_0x18f2d0){if(_0x18f2d0){return _0x18f2d0[_0xb1a9('0x26')](_0x2d27ab)['then'](function(_0x508d28){return _0x508d28;});}return null;};}function removeEntity(_0x19de4e,_0x1e4930){return function(_0x55dffc){if(_0x55dffc){return _0x55dffc[_0xb1a9('0x27')]()['then'](function(){_0x19de4e[_0xb1a9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a8b59,_0x3bf433){return function(_0x41530b){if(!_0x41530b){_0x5a8b59[_0xb1a9('0x1b')](0x194);}return _0x41530b;};}function handleError(_0xc0a766,_0x4c0a86){_0x4c0a86=_0x4c0a86||0x1f4;return function(_0x51e2bb){logger[_0xb1a9('0x28')](_0x51e2bb['stack']);if(_0x51e2bb[_0xb1a9('0x29')]){delete _0x51e2bb[_0xb1a9('0x29')];}_0xc0a766[_0xb1a9('0x1c')](_0x4c0a86)[_0xb1a9('0x2a')](_0x51e2bb);};}exports['index']=function(_0x4ffea8,_0x26d22d){var _0x567849={},_0x5d4b96={},_0x57b793={'count':0x0,'rows':[]};var _0x5346b1=_[_0xb1a9('0x2b')](db[_0xb1a9('0x2c')][_0xb1a9('0x2d')],function(_0x40be1b){return{'name':_0x40be1b[_0xb1a9('0x2e')],'type':_0x40be1b[_0xb1a9('0x2f')][_0xb1a9('0x30')]};});_0x5d4b96[_0xb1a9('0x31')]=_[_0xb1a9('0x2b')](_0x5346b1,_0xb1a9('0x29'));_0x5d4b96[_0xb1a9('0x32')]=_['keys'](_0x4ffea8[_0xb1a9('0x32')]);_0x5d4b96[_0xb1a9('0x33')]=_['intersection'](_0x5d4b96[_0xb1a9('0x31')],_0x5d4b96[_0xb1a9('0x32')]);_0x567849[_0xb1a9('0x34')]=_[_0xb1a9('0x35')](_0x5d4b96['model'],qs['fields'](_0x4ffea8[_0xb1a9('0x32')][_0xb1a9('0x36')]));_0x567849[_0xb1a9('0x34')]=_0x567849[_0xb1a9('0x34')][_0xb1a9('0x37')]?_0x567849[_0xb1a9('0x34')]:_0x5d4b96['model'];if(!_0x4ffea8[_0xb1a9('0x32')]['hasOwnProperty'](_0xb1a9('0x38'))){_0x567849['limit']=qs[_0xb1a9('0x20')](_0x4ffea8[_0xb1a9('0x32')][_0xb1a9('0x20')]);_0x567849[_0xb1a9('0x1e')]=qs[_0xb1a9('0x1e')](_0x4ffea8[_0xb1a9('0x32')][_0xb1a9('0x1e')]);}_0x567849['order']=qs[_0xb1a9('0x39')](_0x4ffea8[_0xb1a9('0x32')][_0xb1a9('0x39')]);_0x567849[_0xb1a9('0x3a')]=qs[_0xb1a9('0x33')](_[_0xb1a9('0x3b')](_0x4ffea8[_0xb1a9('0x32')],_0x5d4b96['filters']),_0x5346b1);if(_0x4ffea8[_0xb1a9('0x32')][_0xb1a9('0x3c')]){_0x567849['where']=_['merge'](_0x567849[_0xb1a9('0x3a')],{'$or':_[_0xb1a9('0x2b')](_0x5346b1,function(_0x58c657){if(_0x58c657[_0xb1a9('0x2f')]!==_0xb1a9('0x3d')){var _0x306ca6={};_0x306ca6[_0x58c657[_0xb1a9('0x29')]]={'$like':'%'+_0x4ffea8[_0xb1a9('0x32')][_0xb1a9('0x3c')]+'%'};return _0x306ca6;}})});}_0x567849=_['merge']({},_0x567849,_0x4ffea8['options']);var _0x58f90d={'where':_0x567849[_0xb1a9('0x3a')]};return db[_0xb1a9('0x2c')][_0xb1a9('0x21')](_0x58f90d)['then'](function(_0x55e097){_0x57b793[_0xb1a9('0x21')]=_0x55e097;if(_0x4ffea8[_0xb1a9('0x32')][_0xb1a9('0x3e')]){_0x567849[_0xb1a9('0x3f')]=[{'all':!![]}];}return db[_0xb1a9('0x2c')][_0xb1a9('0x40')](_0x567849);})[_0xb1a9('0x41')](function(_0x188303){_0x57b793[_0xb1a9('0x42')]=_0x188303;return _0x57b793;})[_0xb1a9('0x41')](respondWithFilteredResult(_0x26d22d,_0x567849))['catch'](handleError(_0x26d22d,null));};exports[_0xb1a9('0x43')]=function(_0x890988,_0x4069ff){var _0x1d989d={'raw':![],'where':{'id':_0x890988[_0xb1a9('0x44')]['id']}},_0x4a2ec7={};_0x4a2ec7[_0xb1a9('0x31')]=_[_0xb1a9('0x45')](db[_0xb1a9('0x2c')][_0xb1a9('0x2d')]);_0x4a2ec7[_0xb1a9('0x32')]=_[_0xb1a9('0x45')](_0x890988[_0xb1a9('0x32')]);_0x4a2ec7[_0xb1a9('0x33')]=_[_0xb1a9('0x35')](_0x4a2ec7[_0xb1a9('0x31')],_0x4a2ec7[_0xb1a9('0x32')]);_0x1d989d['attributes']=_['intersection'](_0x4a2ec7[_0xb1a9('0x31')],qs[_0xb1a9('0x36')](_0x890988[_0xb1a9('0x32')][_0xb1a9('0x36')]));_0x1d989d['attributes']=_0x1d989d['attributes'][_0xb1a9('0x37')]?_0x1d989d[_0xb1a9('0x34')]:_0x4a2ec7[_0xb1a9('0x31')];if(_0x890988[_0xb1a9('0x32')]['includeAll']){_0x1d989d[_0xb1a9('0x3f')]=[{'all':!![]}];}_0x1d989d=_[_0xb1a9('0x46')]({},_0x1d989d,_0x890988[_0xb1a9('0x47')]);return db['ZohoAccount']['find'](_0x1d989d)[_0xb1a9('0x41')](handleEntityNotFound(_0x4069ff,null))[_0xb1a9('0x41')](respondWithResult(_0x4069ff,null))[_0xb1a9('0x48')](handleError(_0x4069ff,null));};exports[_0xb1a9('0x49')]=function(_0x46f21e,_0x3009f){return db[_0xb1a9('0x2c')][_0xb1a9('0x49')](_0x46f21e[_0xb1a9('0x4a')],{})['then'](respondWithResult(_0x3009f,0xc9))['catch'](handleError(_0x3009f,null));};exports[_0xb1a9('0x26')]=function(_0x5d0656,_0x287302){if(_0x5d0656[_0xb1a9('0x4a')]['id']){delete _0x5d0656[_0xb1a9('0x4a')]['id'];}return db['ZohoAccount'][_0xb1a9('0x4b')]({'where':{'id':_0x5d0656[_0xb1a9('0x44')]['id']}})[_0xb1a9('0x41')](handleEntityNotFound(_0x287302,null))[_0xb1a9('0x41')](saveUpdates(_0x5d0656[_0xb1a9('0x4a')],null))['then'](respondWithResult(_0x287302,null))[_0xb1a9('0x48')](handleError(_0x287302,null));};exports[_0xb1a9('0x27')]=function(_0x12aa6e,_0x1642b9){return db['ZohoAccount']['find']({'where':{'id':_0x12aa6e[_0xb1a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x1642b9,null))[_0xb1a9('0x41')](removeEntity(_0x1642b9,null))['catch'](handleError(_0x1642b9,null));};exports['getConfigurations']=function(_0x3e8e9f,_0x3eb608,_0x4374ed){var _0x1af039={};var _0xffe496={};var _0x2c6aaa;var _0x17edc9;return db[_0xb1a9('0x2c')][_0xb1a9('0x4c')]({'where':{'id':_0x3e8e9f[_0xb1a9('0x44')]['id']}})[_0xb1a9('0x41')](handleEntityNotFound(_0x3eb608,null))[_0xb1a9('0x41')](function(_0x398d0a){if(_0x398d0a){_0x2c6aaa=_0x398d0a;_0xffe496[_0xb1a9('0x31')]=_[_0xb1a9('0x45')](db[_0xb1a9('0x4d')]['rawAttributes']);_0xffe496['query']=_[_0xb1a9('0x45')](_0x3e8e9f[_0xb1a9('0x32')]);_0xffe496[_0xb1a9('0x33')]=_[_0xb1a9('0x35')](_0xffe496[_0xb1a9('0x31')],_0xffe496[_0xb1a9('0x32')]);_0x1af039[_0xb1a9('0x34')]=_[_0xb1a9('0x35')](_0xffe496['model'],qs[_0xb1a9('0x36')](_0x3e8e9f[_0xb1a9('0x32')][_0xb1a9('0x36')]));_0x1af039[_0xb1a9('0x34')]=_0x1af039['attributes']['length']?_0x1af039[_0xb1a9('0x34')]:_0xffe496[_0xb1a9('0x31')];_0x1af039['order']=qs[_0xb1a9('0x39')](_0x3e8e9f[_0xb1a9('0x32')][_0xb1a9('0x39')]);_0x1af039[_0xb1a9('0x3a')]=qs[_0xb1a9('0x33')](_[_0xb1a9('0x3b')](_0x3e8e9f[_0xb1a9('0x32')],_0xffe496[_0xb1a9('0x33')]));if(_0x3e8e9f['query'][_0xb1a9('0x3c')]){_0x1af039[_0xb1a9('0x3a')]=_[_0xb1a9('0x46')](_0x1af039[_0xb1a9('0x3a')],{'$or':_[_0xb1a9('0x2b')](_0x1af039[_0xb1a9('0x34')],function(_0x243918){var _0x5b6583={};_0x5b6583[_0x243918]={'$like':'%'+_0x3e8e9f['query'][_0xb1a9('0x3c')]+'%'};return _0x5b6583;})});}_0x1af039=_[_0xb1a9('0x46')]({},_0x1af039,_0x3e8e9f[_0xb1a9('0x47')]);return _0x2c6aaa[_0xb1a9('0x4e')](_0x1af039);}})[_0xb1a9('0x41')](function(_0xe68a0c){if(_0xe68a0c){_0x17edc9=_0xe68a0c['length'];if(!_0x3e8e9f[_0xb1a9('0x32')][_0xb1a9('0x4f')](_0xb1a9('0x38'))){_0x1af039[_0xb1a9('0x20')]=qs[_0xb1a9('0x20')](_0x3e8e9f[_0xb1a9('0x32')][_0xb1a9('0x20')]);_0x1af039[_0xb1a9('0x1e')]=qs[_0xb1a9('0x1e')](_0x3e8e9f[_0xb1a9('0x32')][_0xb1a9('0x1e')]);}return _0x2c6aaa[_0xb1a9('0x4e')](_0x1af039);}})[_0xb1a9('0x41')](function(_0x33e177){if(_0x33e177){return _0x33e177?{'count':_0x17edc9,'rows':_0x33e177}:null;}})[_0xb1a9('0x41')](respondWithResult(_0x3eb608,null))[_0xb1a9('0x48')](handleError(_0x3eb608,null));};exports[_0xb1a9('0x50')]=function(_0xe5cf41,_0x28dffe,_0x5a201f){if(_0xe5cf41['body']['id']){delete _0xe5cf41[_0xb1a9('0x4a')]['id'];}return db[_0xb1a9('0x2c')]['findOne']({'where':{'id':_0xe5cf41[_0xb1a9('0x44')]['id']}})[_0xb1a9('0x41')](handleEntityNotFound(_0x28dffe,null))[_0xb1a9('0x41')](function(_0x114738){if(_0x114738){_0xe5cf41[_0xb1a9('0x4a')][_0xb1a9('0x51')]=_0x114738['id'];_0xe5cf41[_0xb1a9('0x4a')][_0xb1a9('0x52')]=integrations['getSubjects'](_0xe5cf41[_0xb1a9('0x4a')][_0xb1a9('0x53')],_0xe5cf41['body'][_0xb1a9('0x2f')]);_0xe5cf41[_0xb1a9('0x4a')][_0xb1a9('0x54')]=integrations[_0xb1a9('0x55')](_0xe5cf41[_0xb1a9('0x4a')][_0xb1a9('0x53')],_0xe5cf41[_0xb1a9('0x4a')][_0xb1a9('0x2f')]);return db[_0xb1a9('0x4d')][_0xb1a9('0x49')](_0xe5cf41[_0xb1a9('0x4a')],{'include':[{'model':db[_0xb1a9('0x56')],'as':_0xb1a9('0x52')},{'model':db[_0xb1a9('0x56')],'as':_0xb1a9('0x54')}]});}return null;})[_0xb1a9('0x41')](respondWithResult(_0x28dffe,null))[_0xb1a9('0x48')](handleError(_0x28dffe,null));};function getAccessToken(_0x1d925b){return new Promise(function(_0x169133,_0x3afc4c){var _0x576f44;switch(_0x1d925b[_0xb1a9('0x57')]){case'US':_0x576f44=_0xb1a9('0x58');break;case'AU':_0x576f44=_0xb1a9('0x59');break;case'EU':_0x576f44=_0xb1a9('0x5a');break;case'IN':_0x576f44=_0xb1a9('0x5b');break;case'CN':_0x576f44='https://accounts.zoho.com.cn';break;default:_0x576f44='https://accounts.zoho.eu';break;}var _0x17b476={'method':'POST','uri':_0x576f44+_0xb1a9('0x5c'),'qs':{'refresh_token':_0x1d925b[_0xb1a9('0x5d')],'client_id':_0x1d925b[_0xb1a9('0x5e')],'client_secret':_0x1d925b[_0xb1a9('0x5f')],'grant_type':_0xb1a9('0x60')},'json':!![]};return rp(_0x17b476)[_0xb1a9('0x41')](function(_0x4d6ebc){if(_0x4d6ebc[_0xb1a9('0x61')]){_0x169133(_0x4d6ebc['access_token']);}else{_0x3afc4c(_0xb1a9('0x62'));}})['catch'](function(_0x528c6e){_0x3afc4c(_0x528c6e);});});}exports['getFields']=function(_0x3a2e83,_0x2d75fd,_0x33b399){var _0x5cb783,_0x1766d5,_0x1db073,_0x5094ed,_0x8fc576;return db[_0xb1a9('0x2c')][_0xb1a9('0x4c')]({'where':{'id':_0x3a2e83[_0xb1a9('0x44')]['id']},'attributes':['id','host',_0xb1a9('0x57'),_0xb1a9('0x5e'),_0xb1a9('0x5f'),_0xb1a9('0x63'),_0xb1a9('0x64'),_0xb1a9('0x5d')]})[_0xb1a9('0x41')](handleEntityNotFound(_0x2d75fd,null))['then'](function(_0x227a89){_0x8fc576=_0x227a89;_0x5cb783=_0x8fc576[_0xb1a9('0x65')];_0x1766d5=_0x5cb783===_0xb1a9('0x66')?'eu':_0xb1a9('0x67');_0x1db073=_0x8fc576[_0xb1a9('0x63')];var _0x3c6bb7=_0x1db073['slice'](-0x1);if(_0x3c6bb7==='/'||_0x3c6bb7==='\x5c'||_0x3c6bb7===':'){_0x1db073=_0x1db073['substring'](0x0,_0x1db073['lastIndexOf'](_0x3c6bb7));}if(!_0x8fc576[_0xb1a9('0x5d')]){throw new Error(_0xb1a9('0x68'));}return getAccessToken(_0x8fc576);})[_0xb1a9('0x41')](function(_0x52d8ae){if(_0x52d8ae){return rp({'method':'GET','uri':util[_0xb1a9('0x69')](_0xb1a9('0x6a'),_0x1766d5),'qs':{'module':_0xb1a9('0x6b')},'headers':{'Authorization':_0xb1a9('0x6c')+_0x52d8ae},'json':!![]});}})[_0xb1a9('0x41')](function(_0x96b2b){if(_0x96b2b){if(_0x96b2b[_0xb1a9('0x6d')]&&_0x96b2b[_0xb1a9('0x6d')]['error']){throw new Error(_0x96b2b[_0xb1a9('0x6d')]['error'][_0xb1a9('0x6e')]);}var _0x294d5e=[];var _0x3e0308=[];var _0x2dab58=['Owner',_0xb1a9('0x6f'),'Description',_0xb1a9('0x70'),_0xb1a9('0x71'),_0xb1a9('0x72'),_0xb1a9('0x73'),_0xb1a9('0x74')];_0x3e0308=_[_0xb1a9('0x75')](_0x96b2b[_0xb1a9('0x36')],function(_0x4328d1){return _0x2dab58['includes'](_0x4328d1[_0xb1a9('0x76')]);});for(var _0x115b7b=0x0;_0x115b7b<_0x3e0308['length'];_0x115b7b++){if(_0x3e0308[_0x115b7b][_0xb1a9('0x77')]===![]){_0x294d5e[_0xb1a9('0x78')]({'id':_0x3e0308[_0x115b7b]['id'],'name':_0x3e0308[_0x115b7b][_0xb1a9('0x79')],'custom':_0x3e0308[_0x115b7b][_0xb1a9('0x7a')],'options':_0x3e0308[_0x115b7b][_0xb1a9('0x7b')]===_0xb1a9('0x7c')&&_0x3e0308[_0x115b7b][_0xb1a9('0x7d')][_0xb1a9('0x37')]>-0x1?_[_0xb1a9('0x2b')](_0x3e0308[_0x115b7b][_0xb1a9('0x7d')],function(_0x32ecee){return{'name':_0x32ecee,'value':_0x32ecee};}):[]});}}return{'count':_0x294d5e[_0xb1a9('0x37')],'rows':_0x294d5e};}else{return{'count':0x0,'rows':[]};}})[_0xb1a9('0x41')](respondWithResult(_0x2d75fd,null))[_0xb1a9('0x48')](function(_0x5c3146){var _0xf4053e=_0x3a2e83['query'][_0xb1a9('0x7e')]?0x1f4:_0x5c3146[_0xb1a9('0x7f')]||0x1f4;logger['error'](_0xb1a9('0x80'),_0xb1a9('0x81'),_0xf4053e,JSON[_0xb1a9('0x82')](_0x5c3146));delete _0x5c3146[_0xb1a9('0x29')];if(_0xf4053e===0x191){_0xf4053e=0x190;}_0x2d75fd[_0xb1a9('0x1c')](_0xf4053e)[_0xb1a9('0x2a')](_0x3a2e83[_0xb1a9('0x32')][_0xb1a9('0x7e')]?{'message':_0xb1a9('0x83'),'statusCode':_0x5c3146[_0xb1a9('0x7f')]}:_0x5c3146);});}; \ No newline at end of file +var _0xde67=['params','find','create','body','getConfigurations','findOne','ZohoConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','code','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','system_mandatory','custom_field','pick_list_values','test','statusCode','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','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','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','error','stack','name','index','map','ZohoAccount','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','include','rows','catch','show'];(function(_0x22a4d5,_0x1a4c70){var _0x542891=function(_0xb0a281){while(--_0xb0a281){_0x22a4d5['push'](_0x22a4d5['shift']());}};_0x542891(++_0x1a4c70);}(_0xde67,0x13c));var _0x7de6=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0xde67[_0xe51596];return _0x22c705;};'use strict';var emlformat=require(_0x7de6('0x0'));var rimraf=require(_0x7de6('0x1'));var zipdir=require(_0x7de6('0x2'));var jsonpatch=require(_0x7de6('0x3'));var rp=require(_0x7de6('0x4'));var moment=require(_0x7de6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7de6('0x6'));var sox=require(_0x7de6('0x7'));var csv=require(_0x7de6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7de6('0x9'));var _=require(_0x7de6('0xa'));var squel=require(_0x7de6('0xb'));var crypto=require(_0x7de6('0xc'));var jsforce=require(_0x7de6('0xd'));var deskjs=require(_0x7de6('0xe'));var toCsv=require(_0x7de6('0x8'));var querystring=require(_0x7de6('0xf'));var Papa=require('papaparse');var Redis=require(_0x7de6('0x10'));var authService=require(_0x7de6('0x11'));var qs=require(_0x7de6('0x12'));var as=require(_0x7de6('0x13'));var hardwareService=require(_0x7de6('0x14'));var logger=require(_0x7de6('0x15'))(_0x7de6('0x16'));var utils=require('../../config/utils');var config=require(_0x7de6('0x17'));var licenseUtil=require(_0x7de6('0x18'));var db=require(_0x7de6('0x19'))['db'];var integrations=require(_0x7de6('0x1a'));function respondWithStatusCode(_0x261716,_0x2d3a22){_0x2d3a22=_0x2d3a22||0xcc;return function(_0x2c41cc){if(_0x2c41cc){return _0x261716[_0x7de6('0x1b')](_0x2d3a22);}return _0x261716[_0x7de6('0x1c')](_0x2d3a22)[_0x7de6('0x1d')]();};}function respondWithResult(_0x189a3d,_0x46f8ff){_0x46f8ff=_0x46f8ff||0xc8;return function(_0x32d286){if(_0x32d286){return _0x189a3d[_0x7de6('0x1c')](_0x46f8ff)[_0x7de6('0x1e')](_0x32d286);}};}function respondWithFilteredResult(_0x588b0e,_0x5164b4){return function(_0x381046){if(_0x381046){var _0x5f49fa=typeof _0x5164b4[_0x7de6('0x1f')]===_0x7de6('0x20')&&typeof _0x5164b4[_0x7de6('0x21')]===_0x7de6('0x20');var _0x1bfc82=_0x381046[_0x7de6('0x22')];var _0x3fbabe=_0x5f49fa?0x0:_0x5164b4['offset'];var _0x410031=_0x5f49fa?_0x381046[_0x7de6('0x22')]:_0x5164b4['offset']+_0x5164b4[_0x7de6('0x21')];var _0x884256;if(_0x410031>=_0x1bfc82){_0x410031=_0x1bfc82;_0x884256=0xc8;}else{_0x884256=0xce;}_0x588b0e['status'](_0x884256);return _0x588b0e['set']('Content-Range',_0x3fbabe+'-'+_0x410031+'/'+_0x1bfc82)['json'](_0x381046);}return null;};}function patchUpdates(_0x5d5bd5){return function(_0x2ec4ba){try{jsonpatch['apply'](_0x2ec4ba,_0x5d5bd5,!![]);}catch(_0x115d75){return BPromise[_0x7de6('0x23')](_0x115d75);}return _0x2ec4ba[_0x7de6('0x24')]();};}function saveUpdates(_0x559ff0,_0x5f3900){return function(_0x24efae){if(_0x24efae){return _0x24efae[_0x7de6('0x25')](_0x559ff0)[_0x7de6('0x26')](function(_0x453981){return _0x453981;});}return null;};}function removeEntity(_0x21237e,_0x4e3b7d){return function(_0x363bea){if(_0x363bea){return _0x363bea['destroy']()[_0x7de6('0x26')](function(){_0x21237e['status'](0xcc)[_0x7de6('0x1d')]();});}};}function handleEntityNotFound(_0xc11e72,_0xfb57ff){return function(_0x131d78){if(!_0x131d78){_0xc11e72[_0x7de6('0x1b')](0x194);}return _0x131d78;};}function handleError(_0x3c5771,_0x3d9da1){_0x3d9da1=_0x3d9da1||0x1f4;return function(_0x4771aa){logger[_0x7de6('0x27')](_0x4771aa[_0x7de6('0x28')]);if(_0x4771aa[_0x7de6('0x29')]){delete _0x4771aa[_0x7de6('0x29')];}_0x3c5771[_0x7de6('0x1c')](_0x3d9da1)['send'](_0x4771aa);};}exports[_0x7de6('0x2a')]=function(_0x4d67a4,_0x63d280){var _0x4a27c6={},_0x46cf39={},_0x2b8c4a={'count':0x0,'rows':[]};var _0x382594=_[_0x7de6('0x2b')](db[_0x7de6('0x2c')][_0x7de6('0x2d')],function(_0x1b4505){return{'name':_0x1b4505['fieldName'],'type':_0x1b4505[_0x7de6('0x2e')]['key']};});_0x46cf39[_0x7de6('0x2f')]=_[_0x7de6('0x2b')](_0x382594,_0x7de6('0x29'));_0x46cf39[_0x7de6('0x30')]=_[_0x7de6('0x31')](_0x4d67a4['query']);_0x46cf39['filters']=_[_0x7de6('0x32')](_0x46cf39[_0x7de6('0x2f')],_0x46cf39['query']);_0x4a27c6[_0x7de6('0x33')]=_[_0x7de6('0x32')](_0x46cf39[_0x7de6('0x2f')],qs[_0x7de6('0x34')](_0x4d67a4[_0x7de6('0x30')][_0x7de6('0x34')]));_0x4a27c6[_0x7de6('0x33')]=_0x4a27c6[_0x7de6('0x33')][_0x7de6('0x35')]?_0x4a27c6['attributes']:_0x46cf39[_0x7de6('0x2f')];if(!_0x4d67a4['query']['hasOwnProperty'](_0x7de6('0x36'))){_0x4a27c6[_0x7de6('0x21')]=qs[_0x7de6('0x21')](_0x4d67a4[_0x7de6('0x30')]['limit']);_0x4a27c6[_0x7de6('0x1f')]=qs['offset'](_0x4d67a4[_0x7de6('0x30')]['offset']);}_0x4a27c6[_0x7de6('0x37')]=qs[_0x7de6('0x38')](_0x4d67a4['query'][_0x7de6('0x38')]);_0x4a27c6['where']=qs[_0x7de6('0x39')](_[_0x7de6('0x3a')](_0x4d67a4[_0x7de6('0x30')],_0x46cf39[_0x7de6('0x39')]),_0x382594);if(_0x4d67a4[_0x7de6('0x30')][_0x7de6('0x3b')]){_0x4a27c6['where']=_[_0x7de6('0x3c')](_0x4a27c6[_0x7de6('0x3d')],{'$or':_[_0x7de6('0x2b')](_0x382594,function(_0x3832b4){if(_0x3832b4['type']!==_0x7de6('0x3e')){var _0x379063={};_0x379063[_0x3832b4[_0x7de6('0x29')]]={'$like':'%'+_0x4d67a4['query'][_0x7de6('0x3b')]+'%'};return _0x379063;}})});}_0x4a27c6=_[_0x7de6('0x3c')]({},_0x4a27c6,_0x4d67a4[_0x7de6('0x3f')]);var _0x429592={'where':_0x4a27c6[_0x7de6('0x3d')]};return db[_0x7de6('0x2c')]['count'](_0x429592)[_0x7de6('0x26')](function(_0x110ba3){_0x2b8c4a[_0x7de6('0x22')]=_0x110ba3;if(_0x4d67a4[_0x7de6('0x30')]['includeAll']){_0x4a27c6[_0x7de6('0x40')]=[{'all':!![]}];}return db[_0x7de6('0x2c')]['findAll'](_0x4a27c6);})[_0x7de6('0x26')](function(_0x4999c8){_0x2b8c4a[_0x7de6('0x41')]=_0x4999c8;return _0x2b8c4a;})['then'](respondWithFilteredResult(_0x63d280,_0x4a27c6))[_0x7de6('0x42')](handleError(_0x63d280,null));};exports[_0x7de6('0x43')]=function(_0x4b6bf3,_0x313427){var _0x1d6bec={'raw':![],'where':{'id':_0x4b6bf3[_0x7de6('0x44')]['id']}},_0x47f3a3={};_0x47f3a3['model']=_[_0x7de6('0x31')](db[_0x7de6('0x2c')]['rawAttributes']);_0x47f3a3[_0x7de6('0x30')]=_[_0x7de6('0x31')](_0x4b6bf3[_0x7de6('0x30')]);_0x47f3a3[_0x7de6('0x39')]=_['intersection'](_0x47f3a3['model'],_0x47f3a3[_0x7de6('0x30')]);_0x1d6bec[_0x7de6('0x33')]=_[_0x7de6('0x32')](_0x47f3a3['model'],qs[_0x7de6('0x34')](_0x4b6bf3[_0x7de6('0x30')][_0x7de6('0x34')]));_0x1d6bec[_0x7de6('0x33')]=_0x1d6bec['attributes'][_0x7de6('0x35')]?_0x1d6bec[_0x7de6('0x33')]:_0x47f3a3[_0x7de6('0x2f')];if(_0x4b6bf3[_0x7de6('0x30')]['includeAll']){_0x1d6bec[_0x7de6('0x40')]=[{'all':!![]}];}_0x1d6bec=_[_0x7de6('0x3c')]({},_0x1d6bec,_0x4b6bf3['options']);return db[_0x7de6('0x2c')][_0x7de6('0x45')](_0x1d6bec)[_0x7de6('0x26')](handleEntityNotFound(_0x313427,null))[_0x7de6('0x26')](respondWithResult(_0x313427,null))['catch'](handleError(_0x313427,null));};exports[_0x7de6('0x46')]=function(_0x471635,_0x3600b8){return db[_0x7de6('0x2c')][_0x7de6('0x46')](_0x471635[_0x7de6('0x47')],{})[_0x7de6('0x26')](respondWithResult(_0x3600b8,0xc9))['catch'](handleError(_0x3600b8,null));};exports[_0x7de6('0x25')]=function(_0x388be1,_0x52722d){if(_0x388be1[_0x7de6('0x47')]['id']){delete _0x388be1[_0x7de6('0x47')]['id'];}return db[_0x7de6('0x2c')][_0x7de6('0x45')]({'where':{'id':_0x388be1[_0x7de6('0x44')]['id']}})[_0x7de6('0x26')](handleEntityNotFound(_0x52722d,null))[_0x7de6('0x26')](saveUpdates(_0x388be1[_0x7de6('0x47')],null))[_0x7de6('0x26')](respondWithResult(_0x52722d,null))[_0x7de6('0x42')](handleError(_0x52722d,null));};exports['destroy']=function(_0x23b8ac,_0x9ede1e){return db[_0x7de6('0x2c')][_0x7de6('0x45')]({'where':{'id':_0x23b8ac[_0x7de6('0x44')]['id']}})[_0x7de6('0x26')](handleEntityNotFound(_0x9ede1e,null))['then'](removeEntity(_0x9ede1e,null))['catch'](handleError(_0x9ede1e,null));};exports[_0x7de6('0x48')]=function(_0x2dac58,_0x3be1ab,_0x128d3c){var _0xbd7c7e={};var _0x122b6b={};var _0x1ba89c;var _0x2b576c;return db[_0x7de6('0x2c')][_0x7de6('0x49')]({'where':{'id':_0x2dac58[_0x7de6('0x44')]['id']}})[_0x7de6('0x26')](handleEntityNotFound(_0x3be1ab,null))[_0x7de6('0x26')](function(_0x240be2){if(_0x240be2){_0x1ba89c=_0x240be2;_0x122b6b['model']=_[_0x7de6('0x31')](db[_0x7de6('0x4a')][_0x7de6('0x2d')]);_0x122b6b[_0x7de6('0x30')]=_[_0x7de6('0x31')](_0x2dac58['query']);_0x122b6b[_0x7de6('0x39')]=_['intersection'](_0x122b6b['model'],_0x122b6b[_0x7de6('0x30')]);_0xbd7c7e[_0x7de6('0x33')]=_[_0x7de6('0x32')](_0x122b6b[_0x7de6('0x2f')],qs[_0x7de6('0x34')](_0x2dac58[_0x7de6('0x30')][_0x7de6('0x34')]));_0xbd7c7e[_0x7de6('0x33')]=_0xbd7c7e[_0x7de6('0x33')][_0x7de6('0x35')]?_0xbd7c7e[_0x7de6('0x33')]:_0x122b6b[_0x7de6('0x2f')];_0xbd7c7e[_0x7de6('0x37')]=qs[_0x7de6('0x38')](_0x2dac58[_0x7de6('0x30')][_0x7de6('0x38')]);_0xbd7c7e[_0x7de6('0x3d')]=qs[_0x7de6('0x39')](_[_0x7de6('0x3a')](_0x2dac58['query'],_0x122b6b[_0x7de6('0x39')]));if(_0x2dac58[_0x7de6('0x30')][_0x7de6('0x3b')]){_0xbd7c7e['where']=_[_0x7de6('0x3c')](_0xbd7c7e[_0x7de6('0x3d')],{'$or':_[_0x7de6('0x2b')](_0xbd7c7e[_0x7de6('0x33')],function(_0x50dba3){var _0x5e6e52={};_0x5e6e52[_0x50dba3]={'$like':'%'+_0x2dac58[_0x7de6('0x30')]['filter']+'%'};return _0x5e6e52;})});}_0xbd7c7e=_[_0x7de6('0x3c')]({},_0xbd7c7e,_0x2dac58[_0x7de6('0x3f')]);return _0x1ba89c[_0x7de6('0x48')](_0xbd7c7e);}})[_0x7de6('0x26')](function(_0x1522da){if(_0x1522da){_0x2b576c=_0x1522da['length'];if(!_0x2dac58['query'][_0x7de6('0x4b')](_0x7de6('0x36'))){_0xbd7c7e[_0x7de6('0x21')]=qs[_0x7de6('0x21')](_0x2dac58['query']['limit']);_0xbd7c7e[_0x7de6('0x1f')]=qs[_0x7de6('0x1f')](_0x2dac58[_0x7de6('0x30')][_0x7de6('0x1f')]);}return _0x1ba89c[_0x7de6('0x48')](_0xbd7c7e);}})['then'](function(_0x1edc30){if(_0x1edc30){return _0x1edc30?{'count':_0x2b576c,'rows':_0x1edc30}:null;}})[_0x7de6('0x26')](respondWithResult(_0x3be1ab,null))[_0x7de6('0x42')](handleError(_0x3be1ab,null));};exports[_0x7de6('0x4c')]=function(_0x3d1910,_0x4db9c6,_0x31a779){if(_0x3d1910['body']['id']){delete _0x3d1910['body']['id'];}return db[_0x7de6('0x2c')][_0x7de6('0x49')]({'where':{'id':_0x3d1910['params']['id']}})[_0x7de6('0x26')](handleEntityNotFound(_0x4db9c6,null))[_0x7de6('0x26')](function(_0x26d4cc){if(_0x26d4cc){_0x3d1910[_0x7de6('0x47')][_0x7de6('0x4d')]=_0x26d4cc['id'];_0x3d1910[_0x7de6('0x47')][_0x7de6('0x4e')]=integrations[_0x7de6('0x4f')](_0x3d1910['body'][_0x7de6('0x50')],_0x3d1910['body'][_0x7de6('0x2e')]);_0x3d1910['body']['Descriptions']=integrations[_0x7de6('0x51')](_0x3d1910[_0x7de6('0x47')][_0x7de6('0x50')],_0x3d1910[_0x7de6('0x47')][_0x7de6('0x2e')]);return db[_0x7de6('0x4a')][_0x7de6('0x46')](_0x3d1910[_0x7de6('0x47')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x7de6('0x52')],'as':'Descriptions'}]});}return null;})[_0x7de6('0x26')](respondWithResult(_0x4db9c6,null))['catch'](handleError(_0x4db9c6,null));};function getAccessToken(_0x493e9e){return new Promise(function(_0x138f52,_0x5e4dae){var _0x3dc98e;switch(_0x493e9e[_0x7de6('0x53')]){case'US':_0x3dc98e=_0x7de6('0x54');break;case'AU':_0x3dc98e=_0x7de6('0x55');break;case'EU':_0x3dc98e=_0x7de6('0x56');break;case'IN':_0x3dc98e=_0x7de6('0x57');break;case'CN':_0x3dc98e=_0x7de6('0x58');break;default:_0x3dc98e=_0x7de6('0x56');break;}var _0x5985c6={'method':_0x7de6('0x59'),'uri':_0x3dc98e+_0x7de6('0x5a'),'qs':{'refresh_token':_0x493e9e[_0x7de6('0x5b')],'client_id':_0x493e9e[_0x7de6('0x5c')],'client_secret':_0x493e9e[_0x7de6('0x5d')],'grant_type':_0x7de6('0x5e')},'json':!![]};return rp(_0x5985c6)[_0x7de6('0x26')](function(_0x39338e){if(_0x39338e[_0x7de6('0x5f')]){_0x138f52(_0x39338e['access_token']);}else{_0x5e4dae(_0x7de6('0x60'));}})[_0x7de6('0x42')](function(_0x39ac0a){_0x5e4dae(_0x39ac0a);});});}exports['getFields']=function(_0xcc1cd9,_0x12b00e,_0x409399){var _0x576ec9,_0x3ab14a,_0x561c40,_0x36bf7a,_0x5c44ca;return db[_0x7de6('0x2c')]['findOne']({'where':{'id':_0xcc1cd9[_0x7de6('0x44')]['id']},'attributes':['id',_0x7de6('0x61'),_0x7de6('0x53'),_0x7de6('0x5c'),_0x7de6('0x5d'),'serverUrl',_0x7de6('0x62'),_0x7de6('0x5b')]})[_0x7de6('0x26')](handleEntityNotFound(_0x12b00e,null))[_0x7de6('0x26')](function(_0x43af4a){_0x5c44ca=_0x43af4a;_0x576ec9=_0x5c44ca[_0x7de6('0x61')];_0x3ab14a=_0x576ec9===_0x7de6('0x63')?'eu':_0x7de6('0x64');_0x561c40=_0x5c44ca[_0x7de6('0x65')];var _0x58ef13=_0x561c40[_0x7de6('0x66')](-0x1);if(_0x58ef13==='/'||_0x58ef13==='\x5c'||_0x58ef13===':'){_0x561c40=_0x561c40[_0x7de6('0x67')](0x0,_0x561c40[_0x7de6('0x68')](_0x58ef13));}if(!_0x5c44ca['refreshToken']){throw new Error(_0x7de6('0x69'));}return getAccessToken(_0x5c44ca);})[_0x7de6('0x26')](function(_0x524ff5){if(_0x524ff5){return rp({'method':'GET','uri':util[_0x7de6('0x6a')](_0x7de6('0x6b'),_0x3ab14a),'qs':{'module':_0x7de6('0x6c')},'headers':{'Authorization':_0x7de6('0x6d')+_0x524ff5},'json':!![]});}})[_0x7de6('0x26')](function(_0x37683c){if(_0x37683c){if(_0x37683c[_0x7de6('0x6e')]&&_0x37683c['response']['error']){throw new Error(_0x37683c[_0x7de6('0x6e')][_0x7de6('0x27')][_0x7de6('0x6f')]);}var _0x4a0a5b=[];var _0xad196a=[];var _0xa700f9=[_0x7de6('0x70'),_0x7de6('0x71'),_0x7de6('0x72'),_0x7de6('0x73'),_0x7de6('0x74'),_0x7de6('0x75'),_0x7de6('0x76'),'Call_Type'];_0xad196a=_[_0x7de6('0x77')](_0x37683c[_0x7de6('0x34')],function(_0x4cabf2){return _0xa700f9[_0x7de6('0x78')](_0x4cabf2['api_name']);});for(var _0x5bdf6b=0x0;_0x5bdf6b<_0xad196a['length'];_0x5bdf6b++){if(_0xad196a[_0x5bdf6b][_0x7de6('0x79')]===![]){_0x4a0a5b['push']({'id':_0xad196a[_0x5bdf6b]['id'],'name':_0xad196a[_0x5bdf6b]['display_label'],'custom':_0xad196a[_0x5bdf6b][_0x7de6('0x7a')],'options':_0xad196a[_0x5bdf6b]['data_type']==='picklist'&&_0xad196a[_0x5bdf6b]['pick_list_values'][_0x7de6('0x35')]>-0x1?_['map'](_0xad196a[_0x5bdf6b][_0x7de6('0x7b')],function(_0x3946fa){return{'name':_0x3946fa,'value':_0x3946fa};}):[]});}}return{'count':_0x4a0a5b[_0x7de6('0x35')],'rows':_0x4a0a5b};}else{return{'count':0x0,'rows':[]};}})[_0x7de6('0x26')](respondWithResult(_0x12b00e,null))[_0x7de6('0x42')](function(_0x82afcb){var _0x433235=_0xcc1cd9[_0x7de6('0x30')][_0x7de6('0x7c')]?0x1f4:_0x82afcb[_0x7de6('0x7d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x7de6('0x7e'),_0x433235,JSON[_0x7de6('0x7f')](_0x82afcb));delete _0x82afcb[_0x7de6('0x29')];if(_0x433235===0x191){_0x433235=0x190;}_0x12b00e[_0x7de6('0x1c')](_0x433235)['send'](_0xcc1cd9[_0x7de6('0x30')][_0x7de6('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x82afcb[_0x7de6('0x7d')]}:_0x82afcb);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 6f01677..0f1f3e5 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 _0x5148=['zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com.au','POST','refresh_token','info','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5148,0x16e));var _0x8514=function(_0x1ebc56,_0x27e0ab){_0x1ebc56=_0x1ebc56-0x0;var _0x205431=_0x5148[_0x1ebc56];return _0x205431;};'use strict';var _=require(_0x8514('0x0'));var util=require('util');var logger=require(_0x8514('0x1'))(_0x8514('0x2'));var moment=require(_0x8514('0x3'));var BPromise=require(_0x8514('0x4'));var rp=require(_0x8514('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8514('0x6'));var config=require(_0x8514('0x7'));var attributes=require(_0x8514('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8514('0x9')]=function(_0x1c2589,_0x3f83c3){return _0x1c2589['define'](_0x8514('0xa'),attributes,{'tableName':_0x8514('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x52f2d3,_0x4eeb1b,_0x57b968){if(_0x52f2d3[_0x8514('0xc')]('zone')||_0x52f2d3['changed'](_0x8514('0xd'))||_0x52f2d3[_0x8514('0xc')](_0x8514('0xe'))||_0x52f2d3[_0x8514('0xc')](_0x8514('0xf'))||_0x52f2d3[_0x8514('0xc')](_0x8514('0x10'))||_0x52f2d3[_0x8514('0xc')](_0x8514('0x11'))){var _0x3e1984,_0x21297c;_0x3e1984=_0x52f2d3[_0x8514('0xd')];var _0x1b3fd6=_0x3e1984[_0x8514('0x12')](-0x1);if(_0x1b3fd6==='/'||_0x1b3fd6==='\x5c'||_0x1b3fd6===':'){_0x3e1984=_0x3e1984[_0x8514('0x13')](0x0,_0x3e1984[_0x8514('0x14')](_0x1b3fd6));}switch(_0x52f2d3[_0x8514('0x15')]){case'US':_0x21297c=_0x8514('0x16');break;case'AU':_0x21297c='https://accounts.zoho.com.au';break;case'IN':_0x21297c=_0x8514('0x17');break;case'CN':_0x21297c=_0x8514('0x18');break;default:_0x21297c=_0x8514('0x19');break;}var _0x2adcab={'method':'POST','uri':_0x21297c+_0x8514('0x1a'),'form':{'grant_type':_0x8514('0x1b'),'client_id':_0x52f2d3[_0x8514('0xe')],'client_secret':_0x52f2d3[_0x8514('0xf')],'redirect_uri':_0x52f2d3[_0x8514('0xd')],'code':_0x52f2d3[_0x8514('0x10')]},'headers':{'Content-Type':_0x8514('0x1c')}};return rp(_0x2adcab)[_0x8514('0x1d')](function(_0x3b3215){var _0xdc7c81=JSON[_0x8514('0x1e')](_0x3b3215);if(_0xdc7c81['refresh_token']){_0x52f2d3[_0x8514('0x1f')]=_0xdc7c81['refresh_token'];logger['info'](util[_0x8514('0x20')](_0x8514('0x21'),_0x52f2d3[_0x8514('0x22')],_0x52f2d3['id']));}else{logger[_0x8514('0x23')](util['format'](_0x8514('0x24'),_0x52f2d3[_0x8514('0x22')],_0x52f2d3['id']),util[_0x8514('0x25')](_0xdc7c81,{'showHidden':![],'depth':null}));}return _0x57b968(null,_0x4eeb1b);})[_0x8514('0x26')](function(_0x2afc91){logger[_0x8514('0x23')](util['format'](_0x8514('0x24'),_0x52f2d3[_0x8514('0x22')],_0x52f2d3['id']),util[_0x8514('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x57b968(_0x2afc91);});}else{return _0x57b968(null,_0x4eeb1b);}},'beforeUpdate':function(_0x599bc0,_0x1bea10,_0x13e0e4){if(_0x599bc0['changed'](_0x8514('0x15'))||_0x599bc0[_0x8514('0xc')]('serverUrl')||_0x599bc0[_0x8514('0xc')](_0x8514('0xe'))||_0x599bc0[_0x8514('0xc')](_0x8514('0xf'))||_0x599bc0[_0x8514('0xc')](_0x8514('0x10'))||_0x599bc0[_0x8514('0xc')](_0x8514('0x11'))){var _0x5a5d32,_0x23777a;_0x5a5d32=_0x599bc0[_0x8514('0xd')];var _0x1ee2ac=_0x5a5d32[_0x8514('0x12')](-0x1);if(_0x1ee2ac==='/'||_0x1ee2ac==='\x5c'||_0x1ee2ac===':'){_0x5a5d32=_0x5a5d32['substring'](0x0,_0x5a5d32[_0x8514('0x14')](_0x1ee2ac));}switch(_0x599bc0[_0x8514('0x15')]){case'US':_0x23777a=_0x8514('0x16');break;case'AU':_0x23777a=_0x8514('0x27');break;case'IN':_0x23777a=_0x8514('0x17');break;case'CN':_0x23777a='https://accounts.zoho.com.cn';break;default:_0x23777a=_0x8514('0x19');break;}var _0x15b089={'method':_0x8514('0x28'),'uri':_0x23777a+_0x8514('0x1a'),'form':{'grant_type':_0x8514('0x1b'),'client_id':_0x599bc0[_0x8514('0xe')],'client_secret':_0x599bc0['clientSecret'],'redirect_uri':_0x599bc0[_0x8514('0xd')],'code':_0x599bc0[_0x8514('0x10')]},'headers':{'Content-Type':_0x8514('0x1c')}};return rp(_0x15b089)[_0x8514('0x1d')](function(_0x1d6119){var _0x2dc80c=JSON[_0x8514('0x1e')](_0x1d6119);if(_0x2dc80c['refresh_token']){_0x599bc0['refreshToken']=_0x2dc80c[_0x8514('0x29')];logger[_0x8514('0x2a')](util[_0x8514('0x20')](_0x8514('0x21'),_0x599bc0[_0x8514('0x22')],_0x599bc0['id']));}else{logger[_0x8514('0x23')](util[_0x8514('0x20')](_0x8514('0x24'),_0x599bc0[_0x8514('0x22')],_0x599bc0['id']),util[_0x8514('0x25')](_0x2dc80c,{'showHidden':![],'depth':null}));}return _0x13e0e4(null,_0x1bea10);})[_0x8514('0x26')](function(_0x30b75e){logger['error'](util[_0x8514('0x20')](_0x8514('0x24'),_0x599bc0[_0x8514('0x22')],_0x599bc0['id']),util[_0x8514('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x13e0e4(_0x30b75e);});}else{return _0x13e0e4(null,_0x1bea10);}}}});}; \ No newline at end of file +var _0x5c90=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','https://accounts.zoho.com.cn','authorization_code','application/x-www-form-urlencoded','then','info','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','lodash'];(function(_0x48e4d6,_0x499fc4){var _0x381211=function(_0x4e2395){while(--_0x4e2395){_0x48e4d6['push'](_0x48e4d6['shift']());}};_0x381211(++_0x499fc4);}(_0x5c90,0x133));var _0x05c9=function(_0x444b46,_0x25fc41){_0x444b46=_0x444b46-0x0;var _0x32dc45=_0x5c90[_0x444b46];return _0x32dc45;};'use strict';var _=require(_0x05c9('0x0'));var util=require(_0x05c9('0x1'));var logger=require(_0x05c9('0x2'))(_0x05c9('0x3'));var moment=require(_0x05c9('0x4'));var BPromise=require(_0x05c9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x05c9('0x6'));var rimraf=require(_0x05c9('0x7'));var config=require(_0x05c9('0x8'));var attributes=require(_0x05c9('0x9'));var integrations=require(_0x05c9('0xa'));module[_0x05c9('0xb')]=function(_0x12b9b6,_0x5bb41f){return _0x12b9b6['define'](_0x05c9('0xc'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c3398,_0x5ed89e,_0xf88845){if(_0x5c3398[_0x05c9('0xd')](_0x05c9('0xe'))||_0x5c3398[_0x05c9('0xd')](_0x05c9('0xf'))||_0x5c3398[_0x05c9('0xd')](_0x05c9('0x10'))||_0x5c3398['changed'](_0x05c9('0x11'))||_0x5c3398['changed'](_0x05c9('0x12'))||_0x5c3398[_0x05c9('0xd')](_0x05c9('0x13'))){var _0x942b7f,_0x301c90;_0x942b7f=_0x5c3398[_0x05c9('0xf')];var _0x58e18b=_0x942b7f[_0x05c9('0x14')](-0x1);if(_0x58e18b==='/'||_0x58e18b==='\x5c'||_0x58e18b===':'){_0x942b7f=_0x942b7f[_0x05c9('0x15')](0x0,_0x942b7f[_0x05c9('0x16')](_0x58e18b));}switch(_0x5c3398[_0x05c9('0xe')]){case'US':_0x301c90=_0x05c9('0x17');break;case'AU':_0x301c90=_0x05c9('0x18');break;case'IN':_0x301c90=_0x05c9('0x19');break;case'CN':_0x301c90='https://accounts.zoho.com.cn';break;default:_0x301c90=_0x05c9('0x1a');break;}var _0x2f9a1d={'method':_0x05c9('0x1b'),'uri':_0x301c90+_0x05c9('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0x5c3398['clientId'],'client_secret':_0x5c3398['clientSecret'],'redirect_uri':_0x5c3398[_0x05c9('0xf')],'code':_0x5c3398[_0x05c9('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2f9a1d)['then'](function(_0x16f51f){var _0x33946d=JSON[_0x05c9('0x1d')](_0x16f51f);if(_0x33946d[_0x05c9('0x1e')]){_0x5c3398[_0x05c9('0x1f')]=_0x33946d['refresh_token'];logger['info'](util[_0x05c9('0x20')](_0x05c9('0x21'),_0x5c3398[_0x05c9('0x22')],_0x5c3398['id']));}else{logger[_0x05c9('0x23')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c3398[_0x05c9('0x22')],_0x5c3398['id']),util[_0x05c9('0x24')](_0x33946d,{'showHidden':![],'depth':null}));}return _0xf88845(null,_0x5ed89e);})[_0x05c9('0x25')](function(_0x1894ed){logger[_0x05c9('0x23')](util[_0x05c9('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c3398['name'],_0x5c3398['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0xf88845(_0x1894ed);});}else{return _0xf88845(null,_0x5ed89e);}},'beforeUpdate':function(_0x4ab1f8,_0x3c762b,_0x1808e0){if(_0x4ab1f8[_0x05c9('0xd')]('zone')||_0x4ab1f8[_0x05c9('0xd')]('serverUrl')||_0x4ab1f8['changed']('clientId')||_0x4ab1f8['changed'](_0x05c9('0x11'))||_0x4ab1f8[_0x05c9('0xd')](_0x05c9('0x12'))||_0x4ab1f8[_0x05c9('0xd')](_0x05c9('0x13'))){var _0x359e93,_0x356d96;_0x359e93=_0x4ab1f8[_0x05c9('0xf')];var _0x3ef31c=_0x359e93[_0x05c9('0x14')](-0x1);if(_0x3ef31c==='/'||_0x3ef31c==='\x5c'||_0x3ef31c===':'){_0x359e93=_0x359e93[_0x05c9('0x15')](0x0,_0x359e93[_0x05c9('0x16')](_0x3ef31c));}switch(_0x4ab1f8[_0x05c9('0xe')]){case'US':_0x356d96=_0x05c9('0x17');break;case'AU':_0x356d96=_0x05c9('0x18');break;case'IN':_0x356d96=_0x05c9('0x19');break;case'CN':_0x356d96=_0x05c9('0x26');break;default:_0x356d96=_0x05c9('0x1a');break;}var _0x527743={'method':_0x05c9('0x1b'),'uri':_0x356d96+_0x05c9('0x1c'),'form':{'grant_type':_0x05c9('0x27'),'client_id':_0x4ab1f8[_0x05c9('0x10')],'client_secret':_0x4ab1f8['clientSecret'],'redirect_uri':_0x4ab1f8[_0x05c9('0xf')],'code':_0x4ab1f8['code']},'headers':{'Content-Type':_0x05c9('0x28')}};return rp(_0x527743)[_0x05c9('0x29')](function(_0x1c93fe){var _0xe30533=JSON['parse'](_0x1c93fe);if(_0xe30533[_0x05c9('0x1e')]){_0x4ab1f8[_0x05c9('0x1f')]=_0xe30533['refresh_token'];logger[_0x05c9('0x2a')](util['format'](_0x05c9('0x21'),_0x4ab1f8[_0x05c9('0x22')],_0x4ab1f8['id']));}else{logger[_0x05c9('0x23')](util[_0x05c9('0x20')](_0x05c9('0x2b'),_0x4ab1f8[_0x05c9('0x22')],_0x4ab1f8['id']),util[_0x05c9('0x24')](_0xe30533,{'showHidden':![],'depth':null}));}return _0x1808e0(null,_0x3c762b);})[_0x05c9('0x25')](function(_0x6ce6d0){logger['error'](util['format'](_0x05c9('0x2b'),_0x4ab1f8[_0x05c9('0x22')],_0x4ab1f8['id']),util[_0x05c9('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x1808e0(_0x6ce6d0);});}else{return _0x1808e0(null,_0x3c762b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 07e3fa3..f85e7e9 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 _0xfb0b=['include','model','map','GetZohoAccount','stringify','ShowZohoAccount','find','raw','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','ZohoAccount','findAll','options','where','attributes'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xfb0b,0x94));var _0xbfb0=function(_0x4bd111,_0x49da9e){_0x4bd111=_0x4bd111-0x0;var _0x35777a=_0xfb0b[_0x4bd111];return _0x35777a;};'use strict';var _=require(_0xbfb0('0x0'));var util=require(_0xbfb0('0x1'));var moment=require(_0xbfb0('0x2'));var BPromise=require('bluebird');var rs=require(_0xbfb0('0x3'));var fs=require('fs');var Redis=require(_0xbfb0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbfb0('0x5'))('rpc');var config=require(_0xbfb0('0x6'));var jayson=require(_0xbfb0('0x7'));var client=jayson[_0xbfb0('0x8')][_0xbfb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b3840,_0x46166a,_0x52eba3){return new BPromise(function(_0x3491c7,_0x1afe32){return client[_0xbfb0('0xa')](_0x2b3840,_0x52eba3)[_0xbfb0('0xb')](function(_0x4c2cee){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x46166a,'request\x20sent');logger[_0xbfb0('0xc')](_0xbfb0('0xd'),_0x46166a,_0xbfb0('0xe'),JSON['stringify'](_0x4c2cee));if(_0x4c2cee[_0xbfb0('0xf')]){if(_0x4c2cee['error'][_0xbfb0('0x10')]===0x1f4){logger[_0xbfb0('0xf')](_0xbfb0('0x11'),_0x46166a,_0x4c2cee[_0xbfb0('0xf')][_0xbfb0('0x12')]);return _0x1afe32(_0x4c2cee[_0xbfb0('0xf')]['message']);}logger[_0xbfb0('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x46166a,_0x4c2cee['error']['message']);return _0x3491c7(_0x4c2cee[_0xbfb0('0xf')][_0xbfb0('0x12')]);}else{logger[_0xbfb0('0x13')](_0xbfb0('0x11'),_0x46166a,_0xbfb0('0xe'));_0x3491c7(_0x4c2cee[_0xbfb0('0x14')][_0xbfb0('0x12')]);}})[_0xbfb0('0x15')](function(_0x315b80){logger[_0xbfb0('0xf')](_0xbfb0('0x11'),_0x46166a,_0x315b80);_0x1afe32(_0x315b80);});});}exports['GetZohoAccount']=function(_0x5c8a1e){var _0x3319a1=this;return new Promise(function(_0x3b0a50,_0x51842c){return db[_0xbfb0('0x16')][_0xbfb0('0x17')]({'raw':_0x5c8a1e['options']?_0x5c8a1e[_0xbfb0('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c8a1e[_0xbfb0('0x18')]?_0x5c8a1e[_0xbfb0('0x18')][_0xbfb0('0x19')]||null:null,'attributes':_0x5c8a1e[_0xbfb0('0x18')]?_0x5c8a1e['options'][_0xbfb0('0x1a')]||null:null,'limit':_0x5c8a1e['options']?_0x5c8a1e[_0xbfb0('0x18')]['limit']||null:null,'include':_0x5c8a1e[_0xbfb0('0x18')]?_0x5c8a1e['options'][_0xbfb0('0x1b')]?_['map'](_0x5c8a1e[_0xbfb0('0x18')][_0xbfb0('0x1b')],function(_0x40bb06){return{'model':db[_0x40bb06[_0xbfb0('0x1c')]],'as':_0x40bb06['as'],'attributes':_0x40bb06['attributes'],'include':_0x40bb06[_0xbfb0('0x1b')]?_[_0xbfb0('0x1d')](_0x40bb06['include'],function(_0x4e86c8){return{'model':db[_0x4e86c8[_0xbfb0('0x1c')]],'as':_0x4e86c8['as'],'attributes':_0x4e86c8[_0xbfb0('0x1a')],'include':_0x4e86c8[_0xbfb0('0x1b')]?_['map'](_0x4e86c8[_0xbfb0('0x1b')],function(_0x4af626){return{'model':db[_0x4af626[_0xbfb0('0x1c')]],'as':_0x4af626['as'],'attributes':_0x4af626[_0xbfb0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbfb0('0xb')](function(_0x402db3){logger[_0xbfb0('0x13')](_0xbfb0('0x1e'),_0x5c8a1e);logger[_0xbfb0('0xc')]('GetZohoAccount',_0x5c8a1e,JSON[_0xbfb0('0x1f')](_0x402db3));_0x3b0a50(_0x402db3);})[_0xbfb0('0x15')](function(_0x25fea2){logger[_0xbfb0('0xf')]('GetZohoAccount',_0x25fea2[_0xbfb0('0x12')],_0x5c8a1e);_0x51842c(_0x3319a1[_0xbfb0('0xf')](0x1f4,_0x25fea2['message']));});});};exports[_0xbfb0('0x20')]=function(_0x6ba12c){var _0x41ad24=this;return new Promise(function(_0x1a5623,_0x4a720c){return db[_0xbfb0('0x16')][_0xbfb0('0x21')]({'raw':_0x6ba12c[_0xbfb0('0x18')]?_0x6ba12c[_0xbfb0('0x18')][_0xbfb0('0x22')]===undefined?!![]:![]:!![],'where':_0x6ba12c[_0xbfb0('0x18')]?_0x6ba12c[_0xbfb0('0x18')]['where']||null:null,'attributes':_0x6ba12c['options']?_0x6ba12c['options'][_0xbfb0('0x1a')]||null:null,'include':_0x6ba12c[_0xbfb0('0x18')]?_0x6ba12c[_0xbfb0('0x18')][_0xbfb0('0x1b')]?_[_0xbfb0('0x1d')](_0x6ba12c[_0xbfb0('0x18')][_0xbfb0('0x1b')],function(_0x3ddc06){return{'model':db[_0x3ddc06['model']],'as':_0x3ddc06['as'],'attributes':_0x3ddc06['attributes'],'include':_0x3ddc06['include']?_[_0xbfb0('0x1d')](_0x3ddc06[_0xbfb0('0x1b')],function(_0x6deeee){return{'model':db[_0x6deeee[_0xbfb0('0x1c')]],'as':_0x6deeee['as'],'attributes':_0x6deeee[_0xbfb0('0x1a')],'include':_0x6deeee['include']?_['map'](_0x6deeee[_0xbfb0('0x1b')],function(_0x3e18e5){return{'model':db[_0x3e18e5[_0xbfb0('0x1c')]],'as':_0x3e18e5['as'],'attributes':_0x3e18e5[_0xbfb0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xbfb0('0xb')](function(_0x6665a0){logger[_0xbfb0('0x13')](_0xbfb0('0x20'),_0x6ba12c);logger[_0xbfb0('0xc')](_0xbfb0('0x20'),_0x6ba12c,JSON['stringify'](_0x6665a0));_0x1a5623(_0x6665a0);})['catch'](function(_0x28ef7d){logger[_0xbfb0('0xf')]('ShowZohoAccount',_0x28ef7d[_0xbfb0('0x12')],_0x6ba12c);_0x4a720c(_0x41ad24['error'](0x1f4,_0x28ef7d[_0xbfb0('0x12')]));});});}; \ No newline at end of file +var _0x6691=['ZohoAccount','findAll','options','limit','map','include','model','attributes','ShowZohoAccount','find','raw','where','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','catch'];(function(_0x7bbb79,_0x4b5fc7){var _0x5d75be=function(_0xbf0e21){while(--_0xbf0e21){_0x7bbb79['push'](_0x7bbb79['shift']());}};_0x5d75be(++_0x4b5fc7);}(_0x6691,0x12d));var _0x1669=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6691[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x1669('0x0'));var util=require(_0x1669('0x1'));var moment=require(_0x1669('0x2'));var BPromise=require(_0x1669('0x3'));var rs=require(_0x1669('0x4'));var fs=require('fs');var Redis=require(_0x1669('0x5'));var db=require(_0x1669('0x6'))['db'];var utils=require(_0x1669('0x7'));var logger=require(_0x1669('0x8'))(_0x1669('0x9'));var config=require('../../config/environment');var jayson=require(_0x1669('0xa'));var client=jayson[_0x1669('0xb')][_0x1669('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x348683,_0x55393c,_0x5d23fd){return new BPromise(function(_0x59d1e5,_0x3420d5){return client['request'](_0x348683,_0x5d23fd)['then'](function(_0x51f7ef){logger[_0x1669('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x55393c,_0x1669('0xe'));logger[_0x1669('0xf')](_0x1669('0x10'),_0x55393c,_0x1669('0xe'),JSON[_0x1669('0x11')](_0x51f7ef));if(_0x51f7ef[_0x1669('0x12')]){if(_0x51f7ef[_0x1669('0x12')][_0x1669('0x13')]===0x1f4){logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);return _0x3420d5(_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);}logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);return _0x59d1e5(_0x51f7ef[_0x1669('0x12')][_0x1669('0x15')]);}else{logger[_0x1669('0xd')](_0x1669('0x14'),_0x55393c,_0x1669('0xe'));_0x59d1e5(_0x51f7ef['result'][_0x1669('0x15')]);}})[_0x1669('0x16')](function(_0x4281dc){logger[_0x1669('0x12')](_0x1669('0x14'),_0x55393c,_0x4281dc);_0x3420d5(_0x4281dc);});});}exports['GetZohoAccount']=function(_0x56e3d9){var _0x201c59=this;return new Promise(function(_0x31600f,_0x238785){return db[_0x1669('0x17')][_0x1669('0x18')]({'raw':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['where']||null:null,'attributes':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['attributes']||null:null,'limit':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')][_0x1669('0x1a')]||null:null,'include':_0x56e3d9[_0x1669('0x19')]?_0x56e3d9[_0x1669('0x19')]['include']?_[_0x1669('0x1b')](_0x56e3d9[_0x1669('0x19')][_0x1669('0x1c')],function(_0x5796f2){return{'model':db[_0x5796f2[_0x1669('0x1d')]],'as':_0x5796f2['as'],'attributes':_0x5796f2['attributes'],'include':_0x5796f2['include']?_[_0x1669('0x1b')](_0x5796f2['include'],function(_0x304b25){return{'model':db[_0x304b25[_0x1669('0x1d')]],'as':_0x304b25['as'],'attributes':_0x304b25[_0x1669('0x1e')],'include':_0x304b25[_0x1669('0x1c')]?_[_0x1669('0x1b')](_0x304b25[_0x1669('0x1c')],function(_0x5283da){return{'model':db[_0x5283da['model']],'as':_0x5283da['as'],'attributes':_0x5283da[_0x1669('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x207c9f){logger[_0x1669('0xd')]('GetZohoAccount',_0x56e3d9);logger[_0x1669('0xf')]('GetZohoAccount',_0x56e3d9,JSON[_0x1669('0x11')](_0x207c9f));_0x31600f(_0x207c9f);})[_0x1669('0x16')](function(_0x31f4f0){logger[_0x1669('0x12')]('GetZohoAccount',_0x31f4f0['message'],_0x56e3d9);_0x238785(_0x201c59['error'](0x1f4,_0x31f4f0[_0x1669('0x15')]));});});};exports[_0x1669('0x1f')]=function(_0x1cbaa7){var _0x1eaa0c=this;return new Promise(function(_0x3af755,_0x59bd31){return db[_0x1669('0x17')][_0x1669('0x20')]({'raw':_0x1cbaa7[_0x1669('0x19')]?_0x1cbaa7[_0x1669('0x19')][_0x1669('0x21')]===undefined?!![]:![]:!![],'where':_0x1cbaa7[_0x1669('0x19')]?_0x1cbaa7[_0x1669('0x19')][_0x1669('0x22')]||null:null,'attributes':_0x1cbaa7['options']?_0x1cbaa7[_0x1669('0x19')]['attributes']||null:null,'include':_0x1cbaa7[_0x1669('0x19')]?_0x1cbaa7['options']['include']?_[_0x1669('0x1b')](_0x1cbaa7[_0x1669('0x19')][_0x1669('0x1c')],function(_0x43c46a){return{'model':db[_0x43c46a[_0x1669('0x1d')]],'as':_0x43c46a['as'],'attributes':_0x43c46a[_0x1669('0x1e')],'include':_0x43c46a[_0x1669('0x1c')]?_[_0x1669('0x1b')](_0x43c46a[_0x1669('0x1c')],function(_0x5326c5){return{'model':db[_0x5326c5[_0x1669('0x1d')]],'as':_0x5326c5['as'],'attributes':_0x5326c5[_0x1669('0x1e')],'include':_0x5326c5[_0x1669('0x1c')]?_[_0x1669('0x1b')](_0x5326c5[_0x1669('0x1c')],function(_0x998010){return{'model':db[_0x998010[_0x1669('0x1d')]],'as':_0x998010['as'],'attributes':_0x998010['attributes']};}):[]};}):[]};}):[]:[]})[_0x1669('0x23')](function(_0x4533bc){logger[_0x1669('0xd')](_0x1669('0x1f'),_0x1cbaa7);logger[_0x1669('0xf')](_0x1669('0x1f'),_0x1cbaa7,JSON['stringify'](_0x4533bc));_0x3af755(_0x4533bc);})['catch'](function(_0x4d444e){logger[_0x1669('0x12')](_0x1669('0x1f'),_0x4d444e[_0x1669('0x15')],_0x1cbaa7);_0x59bd31(_0x1eaa0c[_0x1669('0x12')](0x1f4,_0x4d444e[_0x1669('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index a6afdbe..e429671 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 _0x0e64=['/:id/subjects','/:id/descriptions','getDescriptions','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields'];(function(_0x363593,_0x3b4415){var _0x439351=function(_0x268832){while(--_0x268832){_0x363593['push'](_0x363593['shift']());}};_0x439351(++_0x3b4415);}(_0x0e64,0x16c));var _0x40e6=function(_0x151234,_0x5a4d40){_0x151234=_0x151234-0x0;var _0x44e636=_0x0e64[_0x151234];return _0x44e636;};'use strict';var multer=require(_0x40e6('0x0'));var util=require('util');var path=require(_0x40e6('0x1'));var timeout=require(_0x40e6('0x2'));var express=require(_0x40e6('0x3'));var router=express[_0x40e6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x40e6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x40e6('0x6'));router[_0x40e6('0x7')]('/',auth[_0x40e6('0x8')](),controller[_0x40e6('0x9')]);router[_0x40e6('0x7')](_0x40e6('0xa'),auth[_0x40e6('0x8')](),controller[_0x40e6('0xb')]);router['get'](_0x40e6('0xc'),auth[_0x40e6('0x8')](),controller[_0x40e6('0xd')]);router[_0x40e6('0x7')](_0x40e6('0xe'),auth[_0x40e6('0x8')](),controller['getSubjects']);router[_0x40e6('0x7')](_0x40e6('0xf'),auth['isAuthenticated'](),controller[_0x40e6('0x10')]);router['post']('/',auth[_0x40e6('0x8')](),controller['create']);router[_0x40e6('0x11')](_0x40e6('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x40e6('0x12')](_0x40e6('0xa'),auth[_0x40e6('0x8')](),controller[_0x40e6('0x13')]);module[_0x40e6('0x14')]=router; \ No newline at end of file +var _0x39d7=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','isAuthenticated','index','get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','/:id','update','delete','exports','multer','util','path','express','Router'];(function(_0x9b993d,_0x16efcc){var _0x2c30fb=function(_0x4c9abf){while(--_0x4c9abf){_0x9b993d['push'](_0x9b993d['shift']());}};_0x2c30fb(++_0x16efcc);}(_0x39d7,0xb3));var _0x739d=function(_0x30b82b,_0x1db595){_0x30b82b=_0x30b82b-0x0;var _0xa694eb=_0x39d7[_0x30b82b];return _0xa694eb;};'use strict';var multer=require(_0x739d('0x0'));var util=require(_0x739d('0x1'));var path=require(_0x739d('0x2'));var timeout=require('connect-timeout');var express=require(_0x739d('0x3'));var router=express[_0x739d('0x4')]();var fs_extra=require(_0x739d('0x5'));var auth=require(_0x739d('0x6'));var interaction=require(_0x739d('0x7'));var config=require('../../config/environment');var controller=require(_0x739d('0x8'));router['get']('/',auth[_0x739d('0x9')](),controller[_0x739d('0xa')]);router['get']('/:id',auth[_0x739d('0x9')](),controller['show']);router[_0x739d('0xb')](_0x739d('0xc'),auth[_0x739d('0x9')](),controller['getFields']);router[_0x739d('0xb')](_0x739d('0xd'),auth[_0x739d('0x9')](),controller[_0x739d('0xe')]);router['get'](_0x739d('0xf'),auth[_0x739d('0x9')](),controller['getDescriptions']);router[_0x739d('0x10')]('/',auth[_0x739d('0x9')](),controller[_0x739d('0x11')]);router[_0x739d('0x12')](_0x739d('0x13'),auth['isAuthenticated'](),controller[_0x739d('0x14')]);router[_0x739d('0x15')]('/:id',auth[_0x739d('0x9')](),controller['destroy']);module[_0x739d('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index ca42c64..b7989e6 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 _0x4126=['lead','contact','nothing','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x5e929d,_0x4e6a51){var _0x4ff68e=function(_0xc3bc81){while(--_0xc3bc81){_0x5e929d['push'](_0x5e929d['shift']());}};_0x4ff68e(++_0x4e6a51);}(_0x4126,0x1a4));var _0x6412=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x4126[_0x3ef2d5];return _0x2fefb2;};'use strict';var Sequelize=require(_0x6412('0x0'));module[_0x6412('0x1')]={'name':{'type':Sequelize[_0x6412('0x2')]},'moduleCreate':{'type':Sequelize[_0x6412('0x3')](_0x6412('0x4'),_0x6412('0x5'),_0x6412('0x6')),'defaultValue':_0x6412('0x4')},'moduleSearch':{'type':Sequelize[_0x6412('0x3')]('contact_lead',_0x6412('0x5'),'lead'),'defaultValue':_0x6412('0x7')},'description':{'type':Sequelize[_0x6412('0x2')]}}; \ No newline at end of file +var _0x36f1=['ENUM','contact_lead','sequelize','exports','STRING','lead','contact'];(function(_0x54e28a,_0x254a2d){var _0x29cd54=function(_0x2e88be){while(--_0x2e88be){_0x54e28a['push'](_0x54e28a['shift']());}};_0x29cd54(++_0x254a2d);}(_0x36f1,0x19f));var _0x136f=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x36f1[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x136f('0x0'));module[_0x136f('0x1')]={'name':{'type':Sequelize[_0x136f('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x136f('0x3'),_0x136f('0x4'),'nothing'),'defaultValue':_0x136f('0x3')},'moduleSearch':{'type':Sequelize[_0x136f('0x5')](_0x136f('0x6'),_0x136f('0x4'),_0x136f('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x136f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index a6abdb3..25b3138 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 _0xd928=['keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','where','merge','VIRTUAL','options','include','ZohoConfiguration','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','getFields','findOne','ZohoField','filter','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','name','send','index','map','rawAttributes','type','model','query'];(function(_0x12922b,_0x23de1f){var _0x220a8f=function(_0x5b9267){while(--_0x5b9267){_0x12922b['push'](_0x12922b['shift']());}};_0x220a8f(++_0x23de1f);}(_0xd928,0x161));var _0x8d92=function(_0x49e68d,_0x63a764){_0x49e68d=_0x49e68d-0x0;var _0x2a0952=_0xd928[_0x49e68d];return _0x2a0952;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8d92('0x0'));var zipdir=require(_0x8d92('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8d92('0x2'));var Mustache=require(_0x8d92('0x3'));var util=require(_0x8d92('0x4'));var path=require(_0x8d92('0x5'));var sox=require(_0x8d92('0x6'));var csv=require('to-csv');var ejs=require(_0x8d92('0x7'));var fs=require('fs');var fs_extra=require(_0x8d92('0x8'));var _=require(_0x8d92('0x9'));var squel=require(_0x8d92('0xa'));var crypto=require('crypto');var jsforce=require(_0x8d92('0xb'));var deskjs=require(_0x8d92('0xc'));var toCsv=require(_0x8d92('0xd'));var querystring=require(_0x8d92('0xe'));var Papa=require(_0x8d92('0xf'));var Redis=require(_0x8d92('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8d92('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8d92('0x12'))(_0x8d92('0x13'));var utils=require(_0x8d92('0x14'));var config=require(_0x8d92('0x15'));var licenseUtil=require(_0x8d92('0x16'));var db=require(_0x8d92('0x17'))['db'];function respondWithStatusCode(_0x25587a,_0x1226b3){_0x1226b3=_0x1226b3||0xcc;return function(_0x312499){if(_0x312499){return _0x25587a['sendStatus'](_0x1226b3);}return _0x25587a[_0x8d92('0x18')](_0x1226b3)[_0x8d92('0x19')]();};}function respondWithResult(_0x202580,_0x221561){_0x221561=_0x221561||0xc8;return function(_0x3b2201){if(_0x3b2201){return _0x202580['status'](_0x221561)[_0x8d92('0x1a')](_0x3b2201);}};}function respondWithFilteredResult(_0x5e2495,_0x2befdb){return function(_0x472f55){if(_0x472f55){var _0x521db5=typeof _0x2befdb[_0x8d92('0x1b')]==='undefined'&&typeof _0x2befdb[_0x8d92('0x1c')]===_0x8d92('0x1d');var _0x1e3901=_0x472f55['count'];var _0x3dd803=_0x521db5?0x0:_0x2befdb['offset'];var _0x462f31=_0x521db5?_0x472f55[_0x8d92('0x1e')]:_0x2befdb[_0x8d92('0x1b')]+_0x2befdb[_0x8d92('0x1c')];var _0x5f30fb;if(_0x462f31>=_0x1e3901){_0x462f31=_0x1e3901;_0x5f30fb=0xc8;}else{_0x5f30fb=0xce;}_0x5e2495[_0x8d92('0x18')](_0x5f30fb);return _0x5e2495[_0x8d92('0x1f')](_0x8d92('0x20'),_0x3dd803+'-'+_0x462f31+'/'+_0x1e3901)[_0x8d92('0x1a')](_0x472f55);}return null;};}function patchUpdates(_0x1253f0){return function(_0x3ec3a1){try{jsonpatch[_0x8d92('0x21')](_0x3ec3a1,_0x1253f0,!![]);}catch(_0x40c0){return BPromise[_0x8d92('0x22')](_0x40c0);}return _0x3ec3a1['save']();};}function saveUpdates(_0x34e73,_0x4f32ad){return function(_0x1435fa){if(_0x1435fa){return _0x1435fa[_0x8d92('0x23')](_0x34e73)[_0x8d92('0x24')](function(_0x5ce24a){return _0x5ce24a;});}return null;};}function removeEntity(_0x3e37a0,_0x5520e9){return function(_0x234fcf){if(_0x234fcf){return _0x234fcf['destroy']()[_0x8d92('0x24')](function(){_0x3e37a0[_0x8d92('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ede1,_0x1a6555){return function(_0x215d02){if(!_0x215d02){_0x20ede1[_0x8d92('0x25')](0x194);}return _0x215d02;};}function handleError(_0x12234e,_0xf482d3){_0xf482d3=_0xf482d3||0x1f4;return function(_0x53faed){logger[_0x8d92('0x26')](_0x53faed['stack']);if(_0x53faed[_0x8d92('0x27')]){delete _0x53faed[_0x8d92('0x27')];}_0x12234e[_0x8d92('0x18')](_0xf482d3)[_0x8d92('0x28')](_0x53faed);};}exports[_0x8d92('0x29')]=function(_0x5aead9,_0x59a266){var _0xd7ddb5={},_0x2f1259={},_0x513735={'count':0x0,'rows':[]};var _0x5a9cc4=_[_0x8d92('0x2a')](db['ZohoConfiguration'][_0x8d92('0x2b')],function(_0xe64ddb){return{'name':_0xe64ddb['fieldName'],'type':_0xe64ddb[_0x8d92('0x2c')]['key']};});_0x2f1259[_0x8d92('0x2d')]=_['map'](_0x5a9cc4,'name');_0x2f1259[_0x8d92('0x2e')]=_[_0x8d92('0x2f')](_0x5aead9[_0x8d92('0x2e')]);_0x2f1259['filters']=_[_0x8d92('0x30')](_0x2f1259[_0x8d92('0x2d')],_0x2f1259[_0x8d92('0x2e')]);_0xd7ddb5[_0x8d92('0x31')]=_[_0x8d92('0x30')](_0x2f1259[_0x8d92('0x2d')],qs[_0x8d92('0x32')](_0x5aead9[_0x8d92('0x2e')][_0x8d92('0x32')]));_0xd7ddb5['attributes']=_0xd7ddb5[_0x8d92('0x31')][_0x8d92('0x33')]?_0xd7ddb5['attributes']:_0x2f1259['model'];if(!_0x5aead9[_0x8d92('0x2e')][_0x8d92('0x34')]('nolimit')){_0xd7ddb5[_0x8d92('0x1c')]=qs['limit'](_0x5aead9['query']['limit']);_0xd7ddb5[_0x8d92('0x1b')]=qs[_0x8d92('0x1b')](_0x5aead9[_0x8d92('0x2e')][_0x8d92('0x1b')]);}_0xd7ddb5[_0x8d92('0x35')]=qs['sort'](_0x5aead9['query'][_0x8d92('0x36')]);_0xd7ddb5['where']=qs['filters'](_[_0x8d92('0x37')](_0x5aead9[_0x8d92('0x2e')],_0x2f1259[_0x8d92('0x38')]),_0x5a9cc4);if(_0x5aead9[_0x8d92('0x2e')]['filter']){_0xd7ddb5[_0x8d92('0x39')]=_[_0x8d92('0x3a')](_0xd7ddb5[_0x8d92('0x39')],{'$or':_[_0x8d92('0x2a')](_0x5a9cc4,function(_0x44b11f){if(_0x44b11f['type']!==_0x8d92('0x3b')){var _0x57df26={};_0x57df26[_0x44b11f[_0x8d92('0x27')]]={'$like':'%'+_0x5aead9[_0x8d92('0x2e')]['filter']+'%'};return _0x57df26;}})});}_0xd7ddb5=_['merge']({},_0xd7ddb5,_0x5aead9[_0x8d92('0x3c')]);var _0x55d218={'where':_0xd7ddb5[_0x8d92('0x39')]};return db['ZohoConfiguration'][_0x8d92('0x1e')](_0x55d218)[_0x8d92('0x24')](function(_0x44eb37){_0x513735[_0x8d92('0x1e')]=_0x44eb37;if(_0x5aead9['query']['includeAll']){_0xd7ddb5[_0x8d92('0x3d')]=[{'all':!![]}];}return db[_0x8d92('0x3e')][_0x8d92('0x3f')](_0xd7ddb5);})[_0x8d92('0x24')](function(_0x290197){_0x513735[_0x8d92('0x40')]=_0x290197;return _0x513735;})[_0x8d92('0x24')](respondWithFilteredResult(_0x59a266,_0xd7ddb5))[_0x8d92('0x41')](handleError(_0x59a266,null));};exports[_0x8d92('0x42')]=function(_0x5767a8,_0x526868){var _0x4bd593={'raw':![],'where':{'id':_0x5767a8['params']['id']}},_0x32b847={};_0x32b847[_0x8d92('0x2d')]=_[_0x8d92('0x2f')](db[_0x8d92('0x3e')][_0x8d92('0x2b')]);_0x32b847[_0x8d92('0x2e')]=_[_0x8d92('0x2f')](_0x5767a8[_0x8d92('0x2e')]);_0x32b847['filters']=_[_0x8d92('0x30')](_0x32b847[_0x8d92('0x2d')],_0x32b847['query']);_0x4bd593[_0x8d92('0x31')]=_[_0x8d92('0x30')](_0x32b847[_0x8d92('0x2d')],qs[_0x8d92('0x32')](_0x5767a8[_0x8d92('0x2e')]['fields']));_0x4bd593['attributes']=_0x4bd593[_0x8d92('0x31')][_0x8d92('0x33')]?_0x4bd593[_0x8d92('0x31')]:_0x32b847['model'];if(_0x5767a8['query'][_0x8d92('0x43')]){_0x4bd593[_0x8d92('0x3d')]=[{'all':!![]}];}_0x4bd593=_[_0x8d92('0x3a')]({},_0x4bd593,_0x5767a8[_0x8d92('0x3c')]);return db[_0x8d92('0x3e')][_0x8d92('0x44')](_0x4bd593)[_0x8d92('0x24')](handleEntityNotFound(_0x526868,null))[_0x8d92('0x24')](respondWithResult(_0x526868,null))[_0x8d92('0x41')](handleError(_0x526868,null));};exports[_0x8d92('0x45')]=function(_0x48591b,_0x55cf1d){return db['ZohoConfiguration']['create'](_0x48591b[_0x8d92('0x46')],{})[_0x8d92('0x24')](respondWithResult(_0x55cf1d,0xc9))[_0x8d92('0x41')](handleError(_0x55cf1d,null));};exports[_0x8d92('0x23')]=function(_0x3a816a,_0x35b778){if(_0x3a816a[_0x8d92('0x46')]['id']){delete _0x3a816a[_0x8d92('0x46')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x3a816a[_0x8d92('0x47')]['id']}})[_0x8d92('0x24')](handleEntityNotFound(_0x35b778,null))[_0x8d92('0x24')](saveUpdates(_0x3a816a[_0x8d92('0x46')],null))[_0x8d92('0x24')](respondWithResult(_0x35b778,null))['catch'](handleError(_0x35b778,null));};exports[_0x8d92('0x48')]=function(_0xb2378b,_0x4ffd4c){return db[_0x8d92('0x3e')]['find']({'where':{'id':_0xb2378b[_0x8d92('0x47')]['id']}})[_0x8d92('0x24')](handleEntityNotFound(_0x4ffd4c,null))[_0x8d92('0x24')](removeEntity(_0x4ffd4c,null))[_0x8d92('0x41')](handleError(_0x4ffd4c,null));};exports[_0x8d92('0x49')]=function(_0x5a9df3,_0xe2cab3,_0x577898){var _0x3d9efa={};var _0x5b65e7={};var _0x1f7b8b;var _0x1c5942;return db[_0x8d92('0x3e')][_0x8d92('0x4a')]({'where':{'id':_0x5a9df3[_0x8d92('0x47')]['id']}})['then'](handleEntityNotFound(_0xe2cab3,null))[_0x8d92('0x24')](function(_0x382532){if(_0x382532){_0x1f7b8b=_0x382532;_0x5b65e7[_0x8d92('0x2d')]=_['keys'](db[_0x8d92('0x4b')]['rawAttributes']);_0x5b65e7[_0x8d92('0x2e')]=_[_0x8d92('0x2f')](_0x5a9df3['query']);_0x5b65e7[_0x8d92('0x38')]=_[_0x8d92('0x30')](_0x5b65e7[_0x8d92('0x2d')],_0x5b65e7[_0x8d92('0x2e')]);_0x3d9efa[_0x8d92('0x31')]=_[_0x8d92('0x30')](_0x5b65e7[_0x8d92('0x2d')],qs['fields'](_0x5a9df3[_0x8d92('0x2e')][_0x8d92('0x32')]));_0x3d9efa[_0x8d92('0x31')]=_0x3d9efa[_0x8d92('0x31')][_0x8d92('0x33')]?_0x3d9efa[_0x8d92('0x31')]:_0x5b65e7['model'];_0x3d9efa['order']=qs['sort'](_0x5a9df3[_0x8d92('0x2e')][_0x8d92('0x36')]);_0x3d9efa['where']=qs[_0x8d92('0x38')](_[_0x8d92('0x37')](_0x5a9df3['query'],_0x5b65e7[_0x8d92('0x38')]));if(_0x5a9df3[_0x8d92('0x2e')][_0x8d92('0x4c')]){_0x3d9efa[_0x8d92('0x39')]=_[_0x8d92('0x3a')](_0x3d9efa[_0x8d92('0x39')],{'$or':_[_0x8d92('0x2a')](_0x3d9efa['attributes'],function(_0x141c1f){var _0xe7a9d4={};_0xe7a9d4[_0x141c1f]={'$like':'%'+_0x5a9df3['query'][_0x8d92('0x4c')]+'%'};return _0xe7a9d4;})});}_0x3d9efa=_[_0x8d92('0x3a')]({},_0x3d9efa,_0x5a9df3[_0x8d92('0x3c')]);return _0x1f7b8b[_0x8d92('0x49')](_0x3d9efa);}})[_0x8d92('0x24')](function(_0x2bf702){if(_0x2bf702){_0x1c5942=_0x2bf702['length'];if(!_0x5a9df3[_0x8d92('0x2e')][_0x8d92('0x34')](_0x8d92('0x4d'))){_0x3d9efa[_0x8d92('0x1c')]=qs[_0x8d92('0x1c')](_0x5a9df3[_0x8d92('0x2e')][_0x8d92('0x1c')]);_0x3d9efa[_0x8d92('0x1b')]=qs['offset'](_0x5a9df3['query']['offset']);}return _0x1f7b8b[_0x8d92('0x49')](_0x3d9efa);}})[_0x8d92('0x24')](function(_0x535ee4){if(_0x535ee4){return _0x535ee4?{'count':_0x1c5942,'rows':_0x535ee4}:null;}})[_0x8d92('0x24')](respondWithResult(_0xe2cab3,null))['catch'](handleError(_0xe2cab3,null));};exports[_0x8d92('0x4e')]=function(_0x43ed37,_0x4b16d4,_0x45d4cf){var _0x16f83c={};var _0x5625a1={};var _0x54d9a5;var _0x63e12f;return db[_0x8d92('0x3e')][_0x8d92('0x4a')]({'where':{'id':_0x43ed37[_0x8d92('0x47')]['id']}})[_0x8d92('0x24')](handleEntityNotFound(_0x4b16d4,null))[_0x8d92('0x24')](function(_0x3b2b60){if(_0x3b2b60){_0x54d9a5=_0x3b2b60;_0x5625a1['model']=_['keys'](db['ZohoField'][_0x8d92('0x2b')]);_0x5625a1['query']=_['keys'](_0x43ed37[_0x8d92('0x2e')]);_0x5625a1['filters']=_['intersection'](_0x5625a1[_0x8d92('0x2d')],_0x5625a1[_0x8d92('0x2e')]);_0x16f83c[_0x8d92('0x31')]=_[_0x8d92('0x30')](_0x5625a1[_0x8d92('0x2d')],qs[_0x8d92('0x32')](_0x43ed37[_0x8d92('0x2e')]['fields']));_0x16f83c['attributes']=_0x16f83c[_0x8d92('0x31')]['length']?_0x16f83c['attributes']:_0x5625a1[_0x8d92('0x2d')];_0x16f83c[_0x8d92('0x35')]=qs[_0x8d92('0x36')](_0x43ed37[_0x8d92('0x2e')][_0x8d92('0x36')]);_0x16f83c[_0x8d92('0x39')]=qs['filters'](_[_0x8d92('0x37')](_0x43ed37['query'],_0x5625a1[_0x8d92('0x38')]));if(_0x43ed37['query'][_0x8d92('0x4c')]){_0x16f83c[_0x8d92('0x39')]=_[_0x8d92('0x3a')](_0x16f83c['where'],{'$or':_[_0x8d92('0x2a')](_0x16f83c[_0x8d92('0x31')],function(_0x2884eb){var _0x125a63={};_0x125a63[_0x2884eb]={'$like':'%'+_0x43ed37[_0x8d92('0x2e')][_0x8d92('0x4c')]+'%'};return _0x125a63;})});}_0x16f83c=_[_0x8d92('0x3a')]({},_0x16f83c,_0x43ed37[_0x8d92('0x3c')]);return _0x54d9a5['getSubjects'](_0x16f83c);}})['then'](function(_0x594943){if(_0x594943){_0x63e12f=_0x594943[_0x8d92('0x33')];if(!_0x43ed37['query'][_0x8d92('0x34')](_0x8d92('0x4d'))){_0x16f83c['limit']=qs[_0x8d92('0x1c')](_0x43ed37['query'][_0x8d92('0x1c')]);_0x16f83c[_0x8d92('0x1b')]=qs[_0x8d92('0x1b')](_0x43ed37[_0x8d92('0x2e')][_0x8d92('0x1b')]);}return _0x54d9a5[_0x8d92('0x4e')](_0x16f83c);}})[_0x8d92('0x24')](function(_0x3ab53c){if(_0x3ab53c){return _0x3ab53c?{'count':_0x63e12f,'rows':_0x3ab53c}:null;}})['then'](respondWithResult(_0x4b16d4,null))['catch'](handleError(_0x4b16d4,null));};exports[_0x8d92('0x4f')]=function(_0x52986d,_0x4e89e8,_0x3ecfc7){var _0x32c7a1={};var _0x3d0e3a={};var _0x405107;var _0xed6312;return db[_0x8d92('0x3e')]['findOne']({'where':{'id':_0x52986d[_0x8d92('0x47')]['id']}})[_0x8d92('0x24')](handleEntityNotFound(_0x4e89e8,null))[_0x8d92('0x24')](function(_0xfbbde9){if(_0xfbbde9){_0x405107=_0xfbbde9;_0x3d0e3a[_0x8d92('0x2d')]=_[_0x8d92('0x2f')](db[_0x8d92('0x4b')]['rawAttributes']);_0x3d0e3a[_0x8d92('0x2e')]=_[_0x8d92('0x2f')](_0x52986d[_0x8d92('0x2e')]);_0x3d0e3a[_0x8d92('0x38')]=_['intersection'](_0x3d0e3a['model'],_0x3d0e3a[_0x8d92('0x2e')]);_0x32c7a1['attributes']=_[_0x8d92('0x30')](_0x3d0e3a[_0x8d92('0x2d')],qs[_0x8d92('0x32')](_0x52986d[_0x8d92('0x2e')][_0x8d92('0x32')]));_0x32c7a1['attributes']=_0x32c7a1[_0x8d92('0x31')][_0x8d92('0x33')]?_0x32c7a1[_0x8d92('0x31')]:_0x3d0e3a['model'];_0x32c7a1[_0x8d92('0x35')]=qs[_0x8d92('0x36')](_0x52986d['query'][_0x8d92('0x36')]);_0x32c7a1[_0x8d92('0x39')]=qs[_0x8d92('0x38')](_[_0x8d92('0x37')](_0x52986d[_0x8d92('0x2e')],_0x3d0e3a['filters']));if(_0x52986d[_0x8d92('0x2e')][_0x8d92('0x4c')]){_0x32c7a1[_0x8d92('0x39')]=_[_0x8d92('0x3a')](_0x32c7a1['where'],{'$or':_['map'](_0x32c7a1['attributes'],function(_0x3998f5){var _0x27abd4={};_0x27abd4[_0x3998f5]={'$like':'%'+_0x52986d[_0x8d92('0x2e')]['filter']+'%'};return _0x27abd4;})});}_0x32c7a1=_[_0x8d92('0x3a')]({},_0x32c7a1,_0x52986d[_0x8d92('0x3c')]);return _0x405107['getDescriptions'](_0x32c7a1);}})['then'](function(_0xeac15f){if(_0xeac15f){_0xed6312=_0xeac15f[_0x8d92('0x33')];if(!_0x52986d['query'][_0x8d92('0x34')]('nolimit')){_0x32c7a1[_0x8d92('0x1c')]=qs[_0x8d92('0x1c')](_0x52986d[_0x8d92('0x2e')][_0x8d92('0x1c')]);_0x32c7a1[_0x8d92('0x1b')]=qs['offset'](_0x52986d[_0x8d92('0x2e')][_0x8d92('0x1b')]);}return _0x405107[_0x8d92('0x4f')](_0x32c7a1);}})[_0x8d92('0x24')](function(_0x984bb7){if(_0x984bb7){return _0x984bb7?{'count':_0xed6312,'rows':_0x984bb7}:null;}})[_0x8d92('0x24')](respondWithResult(_0x4e89e8,null))[_0x8d92('0x41')](handleError(_0x4e89e8,null));}; \ No newline at end of file +var _0x3457=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getFields','ZohoField','getSubjects','getDescriptions','findOne','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x553150,_0x589ff3){var _0x18193d=function(_0x3a5ae6){while(--_0x3a5ae6){_0x553150['push'](_0x553150['shift']());}};_0x18193d(++_0x589ff3);}(_0x3457,0x99));var _0x7345=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3457[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x7345('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7345('0x1'));var rp=require(_0x7345('0x2'));var moment=require(_0x7345('0x3'));var BPromise=require(_0x7345('0x4'));var Mustache=require(_0x7345('0x5'));var util=require('util');var path=require(_0x7345('0x6'));var sox=require(_0x7345('0x7'));var csv=require(_0x7345('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7345('0x9'));var squel=require(_0x7345('0xa'));var crypto=require('crypto');var jsforce=require(_0x7345('0xb'));var deskjs=require(_0x7345('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7345('0xd'));var Papa=require(_0x7345('0xe'));var Redis=require(_0x7345('0xf'));var authService=require(_0x7345('0x10'));var qs=require(_0x7345('0x11'));var as=require(_0x7345('0x12'));var hardwareService=require(_0x7345('0x13'));var logger=require(_0x7345('0x14'))(_0x7345('0x15'));var utils=require(_0x7345('0x16'));var config=require(_0x7345('0x17'));var licenseUtil=require(_0x7345('0x18'));var db=require(_0x7345('0x19'))['db'];function respondWithStatusCode(_0x4b03c0,_0x1e7b83){_0x1e7b83=_0x1e7b83||0xcc;return function(_0x2d4094){if(_0x2d4094){return _0x4b03c0['sendStatus'](_0x1e7b83);}return _0x4b03c0['status'](_0x1e7b83)[_0x7345('0x1a')]();};}function respondWithResult(_0x4fe585,_0x570f88){_0x570f88=_0x570f88||0xc8;return function(_0x185532){if(_0x185532){return _0x4fe585[_0x7345('0x1b')](_0x570f88)[_0x7345('0x1c')](_0x185532);}};}function respondWithFilteredResult(_0x3abaa4,_0x17f272){return function(_0x46bf85){if(_0x46bf85){var _0x53324c=typeof _0x17f272[_0x7345('0x1d')]===_0x7345('0x1e')&&typeof _0x17f272[_0x7345('0x1f')]==='undefined';var _0xbe80b1=_0x46bf85[_0x7345('0x20')];var _0x578af5=_0x53324c?0x0:_0x17f272['offset'];var _0x3a5607=_0x53324c?_0x46bf85[_0x7345('0x20')]:_0x17f272[_0x7345('0x1d')]+_0x17f272[_0x7345('0x1f')];var _0x154d32;if(_0x3a5607>=_0xbe80b1){_0x3a5607=_0xbe80b1;_0x154d32=0xc8;}else{_0x154d32=0xce;}_0x3abaa4[_0x7345('0x1b')](_0x154d32);return _0x3abaa4[_0x7345('0x21')](_0x7345('0x22'),_0x578af5+'-'+_0x3a5607+'/'+_0xbe80b1)[_0x7345('0x1c')](_0x46bf85);}return null;};}function patchUpdates(_0x1840b7){return function(_0x124135){try{jsonpatch[_0x7345('0x23')](_0x124135,_0x1840b7,!![]);}catch(_0x323a0c){return BPromise[_0x7345('0x24')](_0x323a0c);}return _0x124135[_0x7345('0x25')]();};}function saveUpdates(_0x2a4c9d,_0x42cd66){return function(_0x2379d9){if(_0x2379d9){return _0x2379d9[_0x7345('0x26')](_0x2a4c9d)[_0x7345('0x27')](function(_0x461400){return _0x461400;});}return null;};}function removeEntity(_0x5f2f3d,_0x28809a){return function(_0x5cccd2){if(_0x5cccd2){return _0x5cccd2['destroy']()['then'](function(){_0x5f2f3d['status'](0xcc)[_0x7345('0x1a')]();});}};}function handleEntityNotFound(_0x3a3a96,_0x176f4b){return function(_0x43047d){if(!_0x43047d){_0x3a3a96[_0x7345('0x28')](0x194);}return _0x43047d;};}function handleError(_0x3ecbdf,_0x494520){_0x494520=_0x494520||0x1f4;return function(_0x285a83){logger[_0x7345('0x29')](_0x285a83[_0x7345('0x2a')]);if(_0x285a83[_0x7345('0x2b')]){delete _0x285a83[_0x7345('0x2b')];}_0x3ecbdf[_0x7345('0x1b')](_0x494520)[_0x7345('0x2c')](_0x285a83);};}exports[_0x7345('0x2d')]=function(_0x420048,_0x450bf5){var _0x517fec={},_0x11c615={},_0x5c1272={'count':0x0,'rows':[]};var _0x592c07=_[_0x7345('0x2e')](db[_0x7345('0x2f')][_0x7345('0x30')],function(_0x12a09f){return{'name':_0x12a09f[_0x7345('0x31')],'type':_0x12a09f[_0x7345('0x32')][_0x7345('0x33')]};});_0x11c615[_0x7345('0x34')]=_[_0x7345('0x2e')](_0x592c07,_0x7345('0x2b'));_0x11c615[_0x7345('0x35')]=_[_0x7345('0x36')](_0x420048[_0x7345('0x35')]);_0x11c615['filters']=_[_0x7345('0x37')](_0x11c615[_0x7345('0x34')],_0x11c615[_0x7345('0x35')]);_0x517fec['attributes']=_[_0x7345('0x37')](_0x11c615[_0x7345('0x34')],qs[_0x7345('0x38')](_0x420048[_0x7345('0x35')][_0x7345('0x38')]));_0x517fec[_0x7345('0x39')]=_0x517fec['attributes'][_0x7345('0x3a')]?_0x517fec[_0x7345('0x39')]:_0x11c615[_0x7345('0x34')];if(!_0x420048[_0x7345('0x35')][_0x7345('0x3b')](_0x7345('0x3c'))){_0x517fec[_0x7345('0x1f')]=qs[_0x7345('0x1f')](_0x420048[_0x7345('0x35')][_0x7345('0x1f')]);_0x517fec[_0x7345('0x1d')]=qs['offset'](_0x420048[_0x7345('0x35')]['offset']);}_0x517fec[_0x7345('0x3d')]=qs[_0x7345('0x3e')](_0x420048[_0x7345('0x35')][_0x7345('0x3e')]);_0x517fec['where']=qs[_0x7345('0x3f')](_[_0x7345('0x40')](_0x420048[_0x7345('0x35')],_0x11c615[_0x7345('0x3f')]),_0x592c07);if(_0x420048[_0x7345('0x35')]['filter']){_0x517fec[_0x7345('0x41')]=_[_0x7345('0x42')](_0x517fec[_0x7345('0x41')],{'$or':_[_0x7345('0x2e')](_0x592c07,function(_0x5ea2f7){if(_0x5ea2f7[_0x7345('0x32')]!==_0x7345('0x43')){var _0x56ba2a={};_0x56ba2a[_0x5ea2f7[_0x7345('0x2b')]]={'$like':'%'+_0x420048['query'][_0x7345('0x44')]+'%'};return _0x56ba2a;}})});}_0x517fec=_[_0x7345('0x42')]({},_0x517fec,_0x420048['options']);var _0x13e8b2={'where':_0x517fec['where']};return db[_0x7345('0x2f')][_0x7345('0x20')](_0x13e8b2)[_0x7345('0x27')](function(_0x451acc){_0x5c1272[_0x7345('0x20')]=_0x451acc;if(_0x420048['query'][_0x7345('0x45')]){_0x517fec[_0x7345('0x46')]=[{'all':!![]}];}return db[_0x7345('0x2f')][_0x7345('0x47')](_0x517fec);})['then'](function(_0x2c855d){_0x5c1272[_0x7345('0x48')]=_0x2c855d;return _0x5c1272;})[_0x7345('0x27')](respondWithFilteredResult(_0x450bf5,_0x517fec))[_0x7345('0x49')](handleError(_0x450bf5,null));};exports[_0x7345('0x4a')]=function(_0x56dd3c,_0x1a919c){var _0xd100da={'raw':![],'where':{'id':_0x56dd3c[_0x7345('0x4b')]['id']}},_0x4703ba={};_0x4703ba[_0x7345('0x34')]=_[_0x7345('0x36')](db[_0x7345('0x2f')][_0x7345('0x30')]);_0x4703ba[_0x7345('0x35')]=_[_0x7345('0x36')](_0x56dd3c[_0x7345('0x35')]);_0x4703ba[_0x7345('0x3f')]=_[_0x7345('0x37')](_0x4703ba[_0x7345('0x34')],_0x4703ba[_0x7345('0x35')]);_0xd100da[_0x7345('0x39')]=_[_0x7345('0x37')](_0x4703ba['model'],qs[_0x7345('0x38')](_0x56dd3c[_0x7345('0x35')][_0x7345('0x38')]));_0xd100da[_0x7345('0x39')]=_0xd100da[_0x7345('0x39')][_0x7345('0x3a')]?_0xd100da[_0x7345('0x39')]:_0x4703ba[_0x7345('0x34')];if(_0x56dd3c[_0x7345('0x35')][_0x7345('0x45')]){_0xd100da['include']=[{'all':!![]}];}_0xd100da=_[_0x7345('0x42')]({},_0xd100da,_0x56dd3c[_0x7345('0x4c')]);return db[_0x7345('0x2f')][_0x7345('0x4d')](_0xd100da)[_0x7345('0x27')](handleEntityNotFound(_0x1a919c,null))[_0x7345('0x27')](respondWithResult(_0x1a919c,null))[_0x7345('0x49')](handleError(_0x1a919c,null));};exports[_0x7345('0x4e')]=function(_0x4a6538,_0x55c801){return db['ZohoConfiguration'][_0x7345('0x4e')](_0x4a6538[_0x7345('0x4f')],{})[_0x7345('0x27')](respondWithResult(_0x55c801,0xc9))[_0x7345('0x49')](handleError(_0x55c801,null));};exports[_0x7345('0x26')]=function(_0x3e415d,_0x52f97f){if(_0x3e415d['body']['id']){delete _0x3e415d[_0x7345('0x4f')]['id'];}return db[_0x7345('0x2f')][_0x7345('0x4d')]({'where':{'id':_0x3e415d[_0x7345('0x4b')]['id']}})[_0x7345('0x27')](handleEntityNotFound(_0x52f97f,null))['then'](saveUpdates(_0x3e415d[_0x7345('0x4f')],null))[_0x7345('0x27')](respondWithResult(_0x52f97f,null))[_0x7345('0x49')](handleError(_0x52f97f,null));};exports[_0x7345('0x50')]=function(_0x15b6b7,_0x5312b6){return db[_0x7345('0x2f')]['find']({'where':{'id':_0x15b6b7[_0x7345('0x4b')]['id']}})[_0x7345('0x27')](handleEntityNotFound(_0x5312b6,null))[_0x7345('0x27')](removeEntity(_0x5312b6,null))[_0x7345('0x49')](handleError(_0x5312b6,null));};exports[_0x7345('0x51')]=function(_0x2eee37,_0x359182,_0x420aef){var _0x5f3fae={};var _0x172192={};var _0x554cf4;var _0x1a34cd;return db[_0x7345('0x2f')]['findOne']({'where':{'id':_0x2eee37['params']['id']}})[_0x7345('0x27')](handleEntityNotFound(_0x359182,null))[_0x7345('0x27')](function(_0x5842fb){if(_0x5842fb){_0x554cf4=_0x5842fb;_0x172192['model']=_[_0x7345('0x36')](db[_0x7345('0x52')]['rawAttributes']);_0x172192['query']=_[_0x7345('0x36')](_0x2eee37[_0x7345('0x35')]);_0x172192['filters']=_[_0x7345('0x37')](_0x172192['model'],_0x172192[_0x7345('0x35')]);_0x5f3fae[_0x7345('0x39')]=_[_0x7345('0x37')](_0x172192[_0x7345('0x34')],qs[_0x7345('0x38')](_0x2eee37[_0x7345('0x35')]['fields']));_0x5f3fae[_0x7345('0x39')]=_0x5f3fae[_0x7345('0x39')][_0x7345('0x3a')]?_0x5f3fae[_0x7345('0x39')]:_0x172192[_0x7345('0x34')];_0x5f3fae[_0x7345('0x3d')]=qs[_0x7345('0x3e')](_0x2eee37['query'][_0x7345('0x3e')]);_0x5f3fae[_0x7345('0x41')]=qs[_0x7345('0x3f')](_[_0x7345('0x40')](_0x2eee37[_0x7345('0x35')],_0x172192[_0x7345('0x3f')]));if(_0x2eee37[_0x7345('0x35')][_0x7345('0x44')]){_0x5f3fae[_0x7345('0x41')]=_[_0x7345('0x42')](_0x5f3fae[_0x7345('0x41')],{'$or':_[_0x7345('0x2e')](_0x5f3fae[_0x7345('0x39')],function(_0x4ed76d){var _0x514d00={};_0x514d00[_0x4ed76d]={'$like':'%'+_0x2eee37['query'][_0x7345('0x44')]+'%'};return _0x514d00;})});}_0x5f3fae=_[_0x7345('0x42')]({},_0x5f3fae,_0x2eee37[_0x7345('0x4c')]);return _0x554cf4['getFields'](_0x5f3fae);}})[_0x7345('0x27')](function(_0x1adf78){if(_0x1adf78){_0x1a34cd=_0x1adf78['length'];if(!_0x2eee37[_0x7345('0x35')][_0x7345('0x3b')](_0x7345('0x3c'))){_0x5f3fae[_0x7345('0x1f')]=qs[_0x7345('0x1f')](_0x2eee37[_0x7345('0x35')][_0x7345('0x1f')]);_0x5f3fae['offset']=qs['offset'](_0x2eee37[_0x7345('0x35')]['offset']);}return _0x554cf4[_0x7345('0x51')](_0x5f3fae);}})['then'](function(_0x3b13fb){if(_0x3b13fb){return _0x3b13fb?{'count':_0x1a34cd,'rows':_0x3b13fb}:null;}})[_0x7345('0x27')](respondWithResult(_0x359182,null))[_0x7345('0x49')](handleError(_0x359182,null));};exports[_0x7345('0x53')]=function(_0x1461c5,_0x353803,_0x104685){var _0x2cdc12={};var _0xcbdfa2={};var _0x4c711c;var _0x1e2b83;return db[_0x7345('0x2f')]['findOne']({'where':{'id':_0x1461c5[_0x7345('0x4b')]['id']}})[_0x7345('0x27')](handleEntityNotFound(_0x353803,null))['then'](function(_0x46889d){if(_0x46889d){_0x4c711c=_0x46889d;_0xcbdfa2['model']=_[_0x7345('0x36')](db[_0x7345('0x52')]['rawAttributes']);_0xcbdfa2[_0x7345('0x35')]=_[_0x7345('0x36')](_0x1461c5[_0x7345('0x35')]);_0xcbdfa2[_0x7345('0x3f')]=_[_0x7345('0x37')](_0xcbdfa2[_0x7345('0x34')],_0xcbdfa2[_0x7345('0x35')]);_0x2cdc12['attributes']=_[_0x7345('0x37')](_0xcbdfa2[_0x7345('0x34')],qs[_0x7345('0x38')](_0x1461c5[_0x7345('0x35')]['fields']));_0x2cdc12[_0x7345('0x39')]=_0x2cdc12[_0x7345('0x39')]['length']?_0x2cdc12[_0x7345('0x39')]:_0xcbdfa2['model'];_0x2cdc12['order']=qs[_0x7345('0x3e')](_0x1461c5[_0x7345('0x35')]['sort']);_0x2cdc12['where']=qs[_0x7345('0x3f')](_[_0x7345('0x40')](_0x1461c5[_0x7345('0x35')],_0xcbdfa2[_0x7345('0x3f')]));if(_0x1461c5[_0x7345('0x35')][_0x7345('0x44')]){_0x2cdc12[_0x7345('0x41')]=_[_0x7345('0x42')](_0x2cdc12[_0x7345('0x41')],{'$or':_[_0x7345('0x2e')](_0x2cdc12[_0x7345('0x39')],function(_0x3ec5be){var _0x1c4cad={};_0x1c4cad[_0x3ec5be]={'$like':'%'+_0x1461c5[_0x7345('0x35')][_0x7345('0x44')]+'%'};return _0x1c4cad;})});}_0x2cdc12=_[_0x7345('0x42')]({},_0x2cdc12,_0x1461c5[_0x7345('0x4c')]);return _0x4c711c[_0x7345('0x53')](_0x2cdc12);}})[_0x7345('0x27')](function(_0x40dd79){if(_0x40dd79){_0x1e2b83=_0x40dd79['length'];if(!_0x1461c5[_0x7345('0x35')][_0x7345('0x3b')](_0x7345('0x3c'))){_0x2cdc12[_0x7345('0x1f')]=qs[_0x7345('0x1f')](_0x1461c5[_0x7345('0x35')][_0x7345('0x1f')]);_0x2cdc12[_0x7345('0x1d')]=qs[_0x7345('0x1d')](_0x1461c5[_0x7345('0x35')]['offset']);}return _0x4c711c['getSubjects'](_0x2cdc12);}})[_0x7345('0x27')](function(_0x134bc0){if(_0x134bc0){return _0x134bc0?{'count':_0x1e2b83,'rows':_0x134bc0}:null;}})[_0x7345('0x27')](respondWithResult(_0x353803,null))[_0x7345('0x49')](handleError(_0x353803,null));};exports[_0x7345('0x54')]=function(_0x32b213,_0x19fca8,_0x20ab7f){var _0x179776={};var _0x50dfb2={};var _0x417b67;var _0x35e263;return db['ZohoConfiguration'][_0x7345('0x55')]({'where':{'id':_0x32b213[_0x7345('0x4b')]['id']}})['then'](handleEntityNotFound(_0x19fca8,null))[_0x7345('0x27')](function(_0x515d72){if(_0x515d72){_0x417b67=_0x515d72;_0x50dfb2[_0x7345('0x34')]=_['keys'](db[_0x7345('0x52')]['rawAttributes']);_0x50dfb2[_0x7345('0x35')]=_['keys'](_0x32b213[_0x7345('0x35')]);_0x50dfb2['filters']=_[_0x7345('0x37')](_0x50dfb2['model'],_0x50dfb2[_0x7345('0x35')]);_0x179776[_0x7345('0x39')]=_[_0x7345('0x37')](_0x50dfb2['model'],qs['fields'](_0x32b213['query'][_0x7345('0x38')]));_0x179776[_0x7345('0x39')]=_0x179776[_0x7345('0x39')][_0x7345('0x3a')]?_0x179776['attributes']:_0x50dfb2[_0x7345('0x34')];_0x179776['order']=qs[_0x7345('0x3e')](_0x32b213[_0x7345('0x35')]['sort']);_0x179776[_0x7345('0x41')]=qs['filters'](_[_0x7345('0x40')](_0x32b213[_0x7345('0x35')],_0x50dfb2[_0x7345('0x3f')]));if(_0x32b213[_0x7345('0x35')]['filter']){_0x179776[_0x7345('0x41')]=_[_0x7345('0x42')](_0x179776[_0x7345('0x41')],{'$or':_['map'](_0x179776['attributes'],function(_0xeca494){var _0x3d7da4={};_0x3d7da4[_0xeca494]={'$like':'%'+_0x32b213[_0x7345('0x35')][_0x7345('0x44')]+'%'};return _0x3d7da4;})});}_0x179776=_[_0x7345('0x42')]({},_0x179776,_0x32b213[_0x7345('0x4c')]);return _0x417b67[_0x7345('0x54')](_0x179776);}})[_0x7345('0x27')](function(_0x3868eb){if(_0x3868eb){_0x35e263=_0x3868eb[_0x7345('0x3a')];if(!_0x32b213[_0x7345('0x35')][_0x7345('0x3b')](_0x7345('0x3c'))){_0x179776[_0x7345('0x1f')]=qs[_0x7345('0x1f')](_0x32b213[_0x7345('0x35')][_0x7345('0x1f')]);_0x179776[_0x7345('0x1d')]=qs['offset'](_0x32b213[_0x7345('0x35')]['offset']);}return _0x417b67[_0x7345('0x54')](_0x179776);}})[_0x7345('0x27')](function(_0x30b9b4){if(_0x30b9b4){return _0x30b9b4?{'count':_0x35e263,'rows':_0x30b9b4}:null;}})['then'](respondWithResult(_0x19fca8,null))[_0x7345('0x49')](handleError(_0x19fca8,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 37b1521..8ae6d88 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 _0xacac=['../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x521135,_0x32579e){var _0x54c1bf=function(_0x5a4aae){while(--_0x5a4aae){_0x521135['push'](_0x521135['shift']());}};_0x54c1bf(++_0x32579e);}(_0xacac,0x1b7));var _0xcaca=function(_0x1f6585,_0x3eb42a){_0x1f6585=_0x1f6585-0x0;var _0x247b50=_0xacac[_0x1f6585];return _0x247b50;};'use strict';var _=require(_0xcaca('0x0'));var util=require(_0xcaca('0x1'));var logger=require(_0xcaca('0x2'))(_0xcaca('0x3'));var moment=require(_0xcaca('0x4'));var BPromise=require(_0xcaca('0x5'));var rp=require(_0xcaca('0x6'));var fs=require('fs');var path=require(_0xcaca('0x7'));var rimraf=require(_0xcaca('0x8'));var config=require(_0xcaca('0x9'));var attributes=require(_0xcaca('0xa'));module[_0xcaca('0xb')]=function(_0x4ce4bf,_0x4bb574){return _0x4ce4bf['define'](_0xcaca('0xc'),attributes,{'tableName':_0xcaca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05ba=['ZohoConfiguration','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05ba,0xb1));var _0xa05b=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0x05ba[_0x441563];return _0x2369ec;};'use strict';var _=require(_0xa05b('0x0'));var util=require('util');var logger=require(_0xa05b('0x1'))(_0xa05b('0x2'));var moment=require('moment');var BPromise=require(_0xa05b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa05b('0x4'));var rimraf=require(_0xa05b('0x5'));var config=require(_0xa05b('0x6'));var attributes=require(_0xa05b('0x7'));module[_0xa05b('0x8')]=function(_0x362a31,_0x31d190){return _0x362a31[_0xa05b('0x9')](_0xa05b('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 1262cff..847e6d9 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 _0x2b2e=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','catch','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug'];(function(_0x195c1f,_0x55ab41){var _0x1c5d34=function(_0x563c12){while(--_0x563c12){_0x195c1f['push'](_0x195c1f['shift']());}};_0x1c5d34(++_0x55ab41);}(_0x2b2e,0xdf));var _0xe2b2=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x2b2e[_0x3635ce];return _0x97ecd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe2b2('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe2b2('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe2b2('0x2'))(_0xe2b2('0x3'));var config=require(_0xe2b2('0x4'));var jayson=require(_0xe2b2('0x5'));var client=jayson[_0xe2b2('0x6')][_0xe2b2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x398aac,_0x41d90b,_0x375f40){return new BPromise(function(_0x1e8a5e,_0x23be04){return client[_0xe2b2('0x8')](_0x398aac,_0x375f40)['then'](function(_0x3c0fde){logger[_0xe2b2('0x9')]('ZohoConfiguration,\x20%s,\x20%s',_0x41d90b,'request\x20sent');logger[_0xe2b2('0xa')](_0xe2b2('0xb'),_0x41d90b,_0xe2b2('0xc'),JSON[_0xe2b2('0xd')](_0x3c0fde));if(_0x3c0fde[_0xe2b2('0xe')]){if(_0x3c0fde[_0xe2b2('0xe')]['code']===0x1f4){logger[_0xe2b2('0xe')](_0xe2b2('0xf'),_0x41d90b,_0x3c0fde['error'][_0xe2b2('0x10')]);return _0x23be04(_0x3c0fde[_0xe2b2('0xe')][_0xe2b2('0x10')]);}logger[_0xe2b2('0xe')](_0xe2b2('0xf'),_0x41d90b,_0x3c0fde['error'][_0xe2b2('0x10')]);return _0x1e8a5e(_0x3c0fde['error'][_0xe2b2('0x10')]);}else{logger[_0xe2b2('0x9')](_0xe2b2('0xf'),_0x41d90b,'request\x20sent');_0x1e8a5e(_0x3c0fde['result'][_0xe2b2('0x10')]);}})[_0xe2b2('0x11')](function(_0x328487){logger[_0xe2b2('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x41d90b,_0x328487);_0x23be04(_0x328487);});});} \ No newline at end of file +var _0xbe78=['client','http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x2918fb,_0x1ac725){var _0xef01f8=function(_0xd97c6){while(--_0xd97c6){_0x2918fb['push'](_0x2918fb['shift']());}};_0xef01f8(++_0x1ac725);}(_0xbe78,0x1db));var _0x8be7=function(_0xd33d44,_0x398fa4){_0xd33d44=_0xd33d44-0x0;var _0x3c1655=_0xbe78[_0xd33d44];return _0x3c1655;};'use strict';var _=require(_0x8be7('0x0'));var util=require(_0x8be7('0x1'));var moment=require('moment');var BPromise=require(_0x8be7('0x2'));var rs=require(_0x8be7('0x3'));var fs=require('fs');var Redis=require(_0x8be7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8be7('0x5'));var logger=require('../../config/logger')(_0x8be7('0x6'));var config=require(_0x8be7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8be7('0x8')][_0x8be7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc373aa,_0x337d18,_0x228e91){return new BPromise(function(_0x47b719,_0x336c38){return client[_0x8be7('0xa')](_0xc373aa,_0x228e91)[_0x8be7('0xb')](function(_0x1b1806){logger[_0x8be7('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x337d18,'request\x20sent');logger[_0x8be7('0xd')](_0x8be7('0xe'),_0x337d18,_0x8be7('0xf'),JSON[_0x8be7('0x10')](_0x1b1806));if(_0x1b1806[_0x8be7('0x11')]){if(_0x1b1806[_0x8be7('0x11')][_0x8be7('0x12')]===0x1f4){logger[_0x8be7('0x11')](_0x8be7('0x13'),_0x337d18,_0x1b1806['error'][_0x8be7('0x14')]);return _0x336c38(_0x1b1806[_0x8be7('0x11')][_0x8be7('0x14')]);}logger[_0x8be7('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x337d18,_0x1b1806[_0x8be7('0x11')][_0x8be7('0x14')]);return _0x47b719(_0x1b1806[_0x8be7('0x11')][_0x8be7('0x14')]);}else{logger[_0x8be7('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x337d18,_0x8be7('0xf'));_0x47b719(_0x1b1806[_0x8be7('0x15')][_0x8be7('0x14')]);}})[_0x8be7('0x16')](function(_0x425e0c){logger['error'](_0x8be7('0x13'),_0x337d18,_0x425e0c);_0x336c38(_0x425e0c);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index dcf4270..4a6aa68 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 _0x84d8=['create','update','delete','/:id','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','show','post'];(function(_0x16e342,_0xdeb16f){var _0x27e5c3=function(_0x319524){while(--_0x319524){_0x16e342['push'](_0x16e342['shift']());}};_0x27e5c3(++_0xdeb16f);}(_0x84d8,0x8b));var _0x884d=function(_0x3cc91b,_0x250f20){_0x3cc91b=_0x3cc91b-0x0;var _0x1dafcc=_0x84d8[_0x3cc91b];return _0x1dafcc;};'use strict';var multer=require(_0x884d('0x0'));var util=require(_0x884d('0x1'));var path=require(_0x884d('0x2'));var timeout=require('connect-timeout');var express=require(_0x884d('0x3'));var router=express['Router']();var fs_extra=require(_0x884d('0x4'));var auth=require(_0x884d('0x5'));var interaction=require(_0x884d('0x6'));var config=require(_0x884d('0x7'));var controller=require(_0x884d('0x8'));router[_0x884d('0x9')]('/',auth[_0x884d('0xa')](),controller['index']);router['get']('/:id',auth[_0x884d('0xa')](),controller[_0x884d('0xb')]);router[_0x884d('0xc')]('/',auth['isAuthenticated'](),controller[_0x884d('0xd')]);router['put']('/:id',auth[_0x884d('0xa')](),controller[_0x884d('0xe')]);router[_0x884d('0xf')](_0x884d('0x10'),auth[_0x884d('0xa')](),controller[_0x884d('0x11')]);module[_0x884d('0x12')]=router; \ No newline at end of file +var _0x2b6a=['put','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','/:id','post','create'];(function(_0x4122d9,_0x231803){var _0x40bb5e=function(_0x34cc9e){while(--_0x34cc9e){_0x4122d9['push'](_0x4122d9['shift']());}};_0x40bb5e(++_0x231803);}(_0x2b6a,0x1c2));var _0xa2b6=function(_0x54a084,_0x3eccc5){_0x54a084=_0x54a084-0x0;var _0x5a7021=_0x2b6a[_0x54a084];return _0x5a7021;};'use strict';var multer=require('multer');var util=require(_0xa2b6('0x0'));var path=require(_0xa2b6('0x1'));var timeout=require(_0xa2b6('0x2'));var express=require(_0xa2b6('0x3'));var router=express['Router']();var fs_extra=require(_0xa2b6('0x4'));var auth=require(_0xa2b6('0x5'));var interaction=require(_0xa2b6('0x6'));var config=require(_0xa2b6('0x7'));var controller=require(_0xa2b6('0x8'));router['get']('/',auth[_0xa2b6('0x9')](),controller[_0xa2b6('0xa')]);router['get'](_0xa2b6('0xb'),auth[_0xa2b6('0x9')](),controller['show']);router[_0xa2b6('0xc')]('/',auth[_0xa2b6('0x9')](),controller[_0xa2b6('0xd')]);router[_0xa2b6('0xe')](_0xa2b6('0xb'),auth[_0xa2b6('0x9')](),controller['update']);router['delete'](_0xa2b6('0xb'),auth[_0xa2b6('0x9')](),controller[_0xa2b6('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7032139..145d130 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 _0xb29e=['string','customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x130e4d,_0x5ec58c){var _0x350557=function(_0x200dd6){while(--_0x200dd6){_0x130e4d['push'](_0x130e4d['shift']());}};_0x350557(++_0x5ec58c);}(_0xb29e,0x10c));var _0xeb29=function(_0x40a4c2,_0x5a72c6){_0x40a4c2=_0x40a4c2-0x0;var _0x4d0d44=_0xb29e[_0x40a4c2];return _0x4d0d44;};'use strict';var Sequelize=require(_0xeb29('0x0'));module[_0xeb29('0x1')]={'type':{'type':Sequelize['ENUM'](_0xeb29('0x2'),'variable',_0xeb29('0x3'),_0xeb29('0x4'),_0xeb29('0x5')),'defaultValue':_0xeb29('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xeb29('0x6')]},'keyType':{'type':Sequelize[_0xeb29('0x7')]('string',_0xeb29('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xeb29('0x6')]},'idField':{'type':Sequelize[_0xeb29('0x6')]},'nameField':{'type':Sequelize[_0xeb29('0x6')]},'customField':{'type':Sequelize[_0xeb29('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7933=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0x7933,0x81));var _0x3793=function(_0x26a503,_0x2ea813){_0x26a503=_0x26a503-0x0;var _0x262a17=_0x7933[_0x26a503];return _0x262a17;};'use strict';var Sequelize=require('sequelize');module[_0x3793('0x0')]={'type':{'type':Sequelize[_0x3793('0x1')](_0x3793('0x2'),_0x3793('0x3'),_0x3793('0x4'),_0x3793('0x5'),_0x3793('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3793('0x7')]},'key':{'type':Sequelize[_0x3793('0x7')]},'keyType':{'type':Sequelize[_0x3793('0x1')]('string',_0x3793('0x3'),_0x3793('0x4'))},'keyContent':{'type':Sequelize[_0x3793('0x7')]},'idField':{'type':Sequelize[_0x3793('0x7')]},'nameField':{'type':Sequelize[_0x3793('0x7')]},'customField':{'type':Sequelize[_0x3793('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3793('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 30ff0bd..dece277 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 _0xed48=['find','create','body','destroy','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','name','send','map','ZohoField','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys'];(function(_0xb61d3e,_0x45e05c){var _0x427de4=function(_0x56b295){while(--_0x56b295){_0xb61d3e['push'](_0xb61d3e['shift']());}};_0x427de4(++_0x45e05c);}(_0xed48,0x90));var _0x8ed4=function(_0x4498a2,_0x143689){_0x4498a2=_0x4498a2-0x0;var _0x411aa8=_0xed48[_0x4498a2];return _0x411aa8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8ed4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8ed4('0x2'));var Mustache=require(_0x8ed4('0x3'));var util=require(_0x8ed4('0x4'));var path=require(_0x8ed4('0x5'));var sox=require(_0x8ed4('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8ed4('0x7'));var squel=require(_0x8ed4('0x8'));var crypto=require(_0x8ed4('0x9'));var jsforce=require(_0x8ed4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x8ed4('0xb'));var querystring=require(_0x8ed4('0xc'));var Papa=require('papaparse');var Redis=require(_0x8ed4('0xd'));var authService=require(_0x8ed4('0xe'));var qs=require(_0x8ed4('0xf'));var as=require(_0x8ed4('0x10'));var hardwareService=require(_0x8ed4('0x11'));var logger=require(_0x8ed4('0x12'))(_0x8ed4('0x13'));var utils=require(_0x8ed4('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8ed4('0x15'))['db'];function respondWithStatusCode(_0x1ae348,_0x1d5c95){_0x1d5c95=_0x1d5c95||0xcc;return function(_0x146bd5){if(_0x146bd5){return _0x1ae348['sendStatus'](_0x1d5c95);}return _0x1ae348[_0x8ed4('0x16')](_0x1d5c95)[_0x8ed4('0x17')]();};}function respondWithResult(_0x49075c,_0x239544){_0x239544=_0x239544||0xc8;return function(_0x5cb364){if(_0x5cb364){return _0x49075c[_0x8ed4('0x16')](_0x239544)['json'](_0x5cb364);}};}function respondWithFilteredResult(_0x5385e3,_0x26d8e4){return function(_0x48a625){if(_0x48a625){var _0x377b2f=typeof _0x26d8e4['offset']===_0x8ed4('0x18')&&typeof _0x26d8e4[_0x8ed4('0x19')]===_0x8ed4('0x18');var _0x270b63=_0x48a625[_0x8ed4('0x1a')];var _0xbce5ce=_0x377b2f?0x0:_0x26d8e4[_0x8ed4('0x1b')];var _0xfffc6a=_0x377b2f?_0x48a625[_0x8ed4('0x1a')]:_0x26d8e4[_0x8ed4('0x1b')]+_0x26d8e4[_0x8ed4('0x19')];var _0x236cf8;if(_0xfffc6a>=_0x270b63){_0xfffc6a=_0x270b63;_0x236cf8=0xc8;}else{_0x236cf8=0xce;}_0x5385e3[_0x8ed4('0x16')](_0x236cf8);return _0x5385e3[_0x8ed4('0x1c')](_0x8ed4('0x1d'),_0xbce5ce+'-'+_0xfffc6a+'/'+_0x270b63)[_0x8ed4('0x1e')](_0x48a625);}return null;};}function patchUpdates(_0x27956f){return function(_0x32c917){try{jsonpatch[_0x8ed4('0x1f')](_0x32c917,_0x27956f,!![]);}catch(_0x57b128){return BPromise[_0x8ed4('0x20')](_0x57b128);}return _0x32c917[_0x8ed4('0x21')]();};}function saveUpdates(_0x297c2c,_0x116c2a){return function(_0x1c422e){if(_0x1c422e){return _0x1c422e[_0x8ed4('0x22')](_0x297c2c)['then'](function(_0x1a59f5){return _0x1a59f5;});}return null;};}function removeEntity(_0x72590d,_0x3c498b){return function(_0x14388e){if(_0x14388e){return _0x14388e['destroy']()[_0x8ed4('0x23')](function(){_0x72590d['status'](0xcc)[_0x8ed4('0x17')]();});}};}function handleEntityNotFound(_0x4243ed,_0x26643d){return function(_0x560e8f){if(!_0x560e8f){_0x4243ed[_0x8ed4('0x24')](0x194);}return _0x560e8f;};}function handleError(_0x5c2ae3,_0x57a939){_0x57a939=_0x57a939||0x1f4;return function(_0x445281){logger[_0x8ed4('0x25')](_0x445281['stack']);if(_0x445281[_0x8ed4('0x26')]){delete _0x445281[_0x8ed4('0x26')];}_0x5c2ae3[_0x8ed4('0x16')](_0x57a939)[_0x8ed4('0x27')](_0x445281);};}exports['index']=function(_0xd8d787,_0x259227){var _0x37264b={},_0x4b428b={},_0x502734={'count':0x0,'rows':[]};var _0x26d459=_[_0x8ed4('0x28')](db[_0x8ed4('0x29')][_0x8ed4('0x2a')],function(_0x4af3fc){return{'name':_0x4af3fc[_0x8ed4('0x2b')],'type':_0x4af3fc['type']['key']};});_0x4b428b[_0x8ed4('0x2c')]=_[_0x8ed4('0x28')](_0x26d459,_0x8ed4('0x26'));_0x4b428b[_0x8ed4('0x2d')]=_['keys'](_0xd8d787[_0x8ed4('0x2d')]);_0x4b428b[_0x8ed4('0x2e')]=_[_0x8ed4('0x2f')](_0x4b428b[_0x8ed4('0x2c')],_0x4b428b[_0x8ed4('0x2d')]);_0x37264b[_0x8ed4('0x30')]=_['intersection'](_0x4b428b[_0x8ed4('0x2c')],qs[_0x8ed4('0x31')](_0xd8d787[_0x8ed4('0x2d')]['fields']));_0x37264b[_0x8ed4('0x30')]=_0x37264b[_0x8ed4('0x30')][_0x8ed4('0x32')]?_0x37264b[_0x8ed4('0x30')]:_0x4b428b[_0x8ed4('0x2c')];if(!_0xd8d787[_0x8ed4('0x2d')]['hasOwnProperty'](_0x8ed4('0x33'))){_0x37264b['limit']=qs[_0x8ed4('0x19')](_0xd8d787[_0x8ed4('0x2d')][_0x8ed4('0x19')]);_0x37264b[_0x8ed4('0x1b')]=qs[_0x8ed4('0x1b')](_0xd8d787[_0x8ed4('0x2d')]['offset']);}_0x37264b[_0x8ed4('0x34')]=qs[_0x8ed4('0x35')](_0xd8d787[_0x8ed4('0x2d')]['sort']);_0x37264b[_0x8ed4('0x36')]=qs['filters'](_[_0x8ed4('0x37')](_0xd8d787['query'],_0x4b428b[_0x8ed4('0x2e')]),_0x26d459);if(_0xd8d787[_0x8ed4('0x2d')][_0x8ed4('0x38')]){_0x37264b[_0x8ed4('0x36')]=_['merge'](_0x37264b[_0x8ed4('0x36')],{'$or':_[_0x8ed4('0x28')](_0x26d459,function(_0x3a2f5e){if(_0x3a2f5e['type']!=='VIRTUAL'){var _0x2bc8e8={};_0x2bc8e8[_0x3a2f5e[_0x8ed4('0x26')]]={'$like':'%'+_0xd8d787[_0x8ed4('0x2d')][_0x8ed4('0x38')]+'%'};return _0x2bc8e8;}})});}_0x37264b=_[_0x8ed4('0x39')]({},_0x37264b,_0xd8d787[_0x8ed4('0x3a')]);var _0x179fc6={'where':_0x37264b[_0x8ed4('0x36')]};return db[_0x8ed4('0x29')][_0x8ed4('0x1a')](_0x179fc6)['then'](function(_0x15871e){_0x502734[_0x8ed4('0x1a')]=_0x15871e;if(_0xd8d787['query'][_0x8ed4('0x3b')]){_0x37264b[_0x8ed4('0x3c')]=[{'all':!![]}];}return db[_0x8ed4('0x29')][_0x8ed4('0x3d')](_0x37264b);})['then'](function(_0x1d5421){_0x502734['rows']=_0x1d5421;return _0x502734;})[_0x8ed4('0x23')](respondWithFilteredResult(_0x259227,_0x37264b))[_0x8ed4('0x3e')](handleError(_0x259227,null));};exports[_0x8ed4('0x3f')]=function(_0x2931f7,_0x5bfa81){var _0x45ce42={'raw':!![],'where':{'id':_0x2931f7[_0x8ed4('0x40')]['id']}},_0x253755={};_0x253755[_0x8ed4('0x2c')]=_[_0x8ed4('0x41')](db[_0x8ed4('0x29')][_0x8ed4('0x2a')]);_0x253755[_0x8ed4('0x2d')]=_[_0x8ed4('0x41')](_0x2931f7[_0x8ed4('0x2d')]);_0x253755[_0x8ed4('0x2e')]=_[_0x8ed4('0x2f')](_0x253755['model'],_0x253755['query']);_0x45ce42[_0x8ed4('0x30')]=_['intersection'](_0x253755['model'],qs['fields'](_0x2931f7[_0x8ed4('0x2d')][_0x8ed4('0x31')]));_0x45ce42[_0x8ed4('0x30')]=_0x45ce42[_0x8ed4('0x30')][_0x8ed4('0x32')]?_0x45ce42['attributes']:_0x253755[_0x8ed4('0x2c')];if(_0x2931f7[_0x8ed4('0x2d')][_0x8ed4('0x3b')]){_0x45ce42[_0x8ed4('0x3c')]=[{'all':!![]}];}_0x45ce42=_[_0x8ed4('0x39')]({},_0x45ce42,_0x2931f7[_0x8ed4('0x3a')]);return db[_0x8ed4('0x29')][_0x8ed4('0x42')](_0x45ce42)['then'](handleEntityNotFound(_0x5bfa81,null))[_0x8ed4('0x23')](respondWithResult(_0x5bfa81,null))[_0x8ed4('0x3e')](handleError(_0x5bfa81,null));};exports[_0x8ed4('0x43')]=function(_0x34447d,_0x2c72e0){return db[_0x8ed4('0x29')][_0x8ed4('0x43')](_0x34447d[_0x8ed4('0x44')],{})[_0x8ed4('0x23')](respondWithResult(_0x2c72e0,0xc9))[_0x8ed4('0x3e')](handleError(_0x2c72e0,null));};exports[_0x8ed4('0x22')]=function(_0x3eee09,_0x243214){if(_0x3eee09['body']['id']){delete _0x3eee09['body']['id'];}return db[_0x8ed4('0x29')][_0x8ed4('0x42')]({'where':{'id':_0x3eee09[_0x8ed4('0x40')]['id']}})['then'](handleEntityNotFound(_0x243214,null))['then'](saveUpdates(_0x3eee09[_0x8ed4('0x44')],null))['then'](respondWithResult(_0x243214,null))['catch'](handleError(_0x243214,null));};exports[_0x8ed4('0x45')]=function(_0x4776a4,_0x2df8d8){return db[_0x8ed4('0x29')][_0x8ed4('0x42')]({'where':{'id':_0x4776a4[_0x8ed4('0x40')]['id']}})[_0x8ed4('0x23')](handleEntityNotFound(_0x2df8d8,null))[_0x8ed4('0x23')](removeEntity(_0x2df8d8,null))['catch'](handleError(_0x2df8d8,null));}; \ No newline at end of file +var _0x9540=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','catch','show','params','length','includeAll','include','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x9540,0x7f));var _0x0954=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9540[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0954('0x0'));var rimraf=require(_0x0954('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0954('0x2'));var rp=require('request-promise');var moment=require(_0x0954('0x3'));var BPromise=require(_0x0954('0x4'));var Mustache=require(_0x0954('0x5'));var util=require(_0x0954('0x6'));var path=require('path');var sox=require(_0x0954('0x7'));var csv=require(_0x0954('0x8'));var ejs=require(_0x0954('0x9'));var fs=require('fs');var fs_extra=require(_0x0954('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0954('0xb'));var jsforce=require(_0x0954('0xc'));var deskjs=require(_0x0954('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0954('0xe'));var Papa=require(_0x0954('0xf'));var Redis=require(_0x0954('0x10'));var authService=require(_0x0954('0x11'));var qs=require(_0x0954('0x12'));var as=require(_0x0954('0x13'));var hardwareService=require(_0x0954('0x14'));var logger=require(_0x0954('0x15'))(_0x0954('0x16'));var utils=require(_0x0954('0x17'));var config=require(_0x0954('0x18'));var licenseUtil=require(_0x0954('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x575235,_0x583502){_0x583502=_0x583502||0xcc;return function(_0x44c955){if(_0x44c955){return _0x575235['sendStatus'](_0x583502);}return _0x575235[_0x0954('0x1a')](_0x583502)[_0x0954('0x1b')]();};}function respondWithResult(_0x45e11f,_0x29173d){_0x29173d=_0x29173d||0xc8;return function(_0x2aee2b){if(_0x2aee2b){return _0x45e11f[_0x0954('0x1a')](_0x29173d)[_0x0954('0x1c')](_0x2aee2b);}};}function respondWithFilteredResult(_0x7684e,_0x4fb64a){return function(_0x1fc361){if(_0x1fc361){var _0x193435=typeof _0x4fb64a[_0x0954('0x1d')]===_0x0954('0x1e')&&typeof _0x4fb64a[_0x0954('0x1f')]==='undefined';var _0x1cff9f=_0x1fc361['count'];var _0x4bdd9a=_0x193435?0x0:_0x4fb64a[_0x0954('0x1d')];var _0x2de4aa=_0x193435?_0x1fc361[_0x0954('0x20')]:_0x4fb64a[_0x0954('0x1d')]+_0x4fb64a['limit'];var _0x5203b4;if(_0x2de4aa>=_0x1cff9f){_0x2de4aa=_0x1cff9f;_0x5203b4=0xc8;}else{_0x5203b4=0xce;}_0x7684e[_0x0954('0x1a')](_0x5203b4);return _0x7684e[_0x0954('0x21')](_0x0954('0x22'),_0x4bdd9a+'-'+_0x2de4aa+'/'+_0x1cff9f)[_0x0954('0x1c')](_0x1fc361);}return null;};}function patchUpdates(_0x50d04c){return function(_0x358283){try{jsonpatch['apply'](_0x358283,_0x50d04c,!![]);}catch(_0x563fa2){return BPromise[_0x0954('0x23')](_0x563fa2);}return _0x358283[_0x0954('0x24')]();};}function saveUpdates(_0x71f1f4,_0x52d5e6){return function(_0x2bb830){if(_0x2bb830){return _0x2bb830[_0x0954('0x25')](_0x71f1f4)[_0x0954('0x26')](function(_0x5b2b92){return _0x5b2b92;});}return null;};}function removeEntity(_0x2d0a43,_0x203d7f){return function(_0x36c6c9){if(_0x36c6c9){return _0x36c6c9[_0x0954('0x27')]()[_0x0954('0x26')](function(){_0x2d0a43[_0x0954('0x1a')](0xcc)[_0x0954('0x1b')]();});}};}function handleEntityNotFound(_0x2d6a77,_0x36978f){return function(_0x162dff){if(!_0x162dff){_0x2d6a77[_0x0954('0x28')](0x194);}return _0x162dff;};}function handleError(_0x3e9472,_0x1193e5){_0x1193e5=_0x1193e5||0x1f4;return function(_0x32eb47){logger[_0x0954('0x29')](_0x32eb47[_0x0954('0x2a')]);if(_0x32eb47[_0x0954('0x2b')]){delete _0x32eb47[_0x0954('0x2b')];}_0x3e9472[_0x0954('0x1a')](_0x1193e5)['send'](_0x32eb47);};}exports[_0x0954('0x2c')]=function(_0x4fe78e,_0x4d98c9){var _0x5c91e9={},_0x4bf8ba={},_0x84c9a3={'count':0x0,'rows':[]};var _0xbc4517=_[_0x0954('0x2d')](db[_0x0954('0x2e')][_0x0954('0x2f')],function(_0x35041c){return{'name':_0x35041c[_0x0954('0x30')],'type':_0x35041c[_0x0954('0x31')][_0x0954('0x32')]};});_0x4bf8ba['model']=_[_0x0954('0x2d')](_0xbc4517,_0x0954('0x2b'));_0x4bf8ba[_0x0954('0x33')]=_[_0x0954('0x34')](_0x4fe78e[_0x0954('0x33')]);_0x4bf8ba[_0x0954('0x35')]=_['intersection'](_0x4bf8ba[_0x0954('0x36')],_0x4bf8ba[_0x0954('0x33')]);_0x5c91e9[_0x0954('0x37')]=_[_0x0954('0x38')](_0x4bf8ba[_0x0954('0x36')],qs[_0x0954('0x39')](_0x4fe78e[_0x0954('0x33')][_0x0954('0x39')]));_0x5c91e9[_0x0954('0x37')]=_0x5c91e9['attributes']['length']?_0x5c91e9[_0x0954('0x37')]:_0x4bf8ba[_0x0954('0x36')];if(!_0x4fe78e[_0x0954('0x33')][_0x0954('0x3a')](_0x0954('0x3b'))){_0x5c91e9[_0x0954('0x1f')]=qs['limit'](_0x4fe78e[_0x0954('0x33')][_0x0954('0x1f')]);_0x5c91e9[_0x0954('0x1d')]=qs[_0x0954('0x1d')](_0x4fe78e[_0x0954('0x33')][_0x0954('0x1d')]);}_0x5c91e9[_0x0954('0x3c')]=qs['sort'](_0x4fe78e[_0x0954('0x33')][_0x0954('0x3d')]);_0x5c91e9[_0x0954('0x3e')]=qs[_0x0954('0x35')](_[_0x0954('0x3f')](_0x4fe78e['query'],_0x4bf8ba[_0x0954('0x35')]),_0xbc4517);if(_0x4fe78e[_0x0954('0x33')][_0x0954('0x40')]){_0x5c91e9[_0x0954('0x3e')]=_[_0x0954('0x41')](_0x5c91e9[_0x0954('0x3e')],{'$or':_[_0x0954('0x2d')](_0xbc4517,function(_0x2a691f){if(_0x2a691f[_0x0954('0x31')]!=='VIRTUAL'){var _0x5b844e={};_0x5b844e[_0x2a691f[_0x0954('0x2b')]]={'$like':'%'+_0x4fe78e['query'][_0x0954('0x40')]+'%'};return _0x5b844e;}})});}_0x5c91e9=_[_0x0954('0x41')]({},_0x5c91e9,_0x4fe78e[_0x0954('0x42')]);var _0x381b03={'where':_0x5c91e9[_0x0954('0x3e')]};return db[_0x0954('0x2e')][_0x0954('0x20')](_0x381b03)['then'](function(_0x1ec190){_0x84c9a3[_0x0954('0x20')]=_0x1ec190;if(_0x4fe78e[_0x0954('0x33')]['includeAll']){_0x5c91e9['include']=[{'all':!![]}];}return db[_0x0954('0x2e')][_0x0954('0x43')](_0x5c91e9);})[_0x0954('0x26')](function(_0x289e15){_0x84c9a3['rows']=_0x289e15;return _0x84c9a3;})[_0x0954('0x26')](respondWithFilteredResult(_0x4d98c9,_0x5c91e9))[_0x0954('0x44')](handleError(_0x4d98c9,null));};exports[_0x0954('0x45')]=function(_0x5b346e,_0x5add3e){var _0x3c25b2={'raw':!![],'where':{'id':_0x5b346e[_0x0954('0x46')]['id']}},_0x2a5541={};_0x2a5541['model']=_[_0x0954('0x34')](db[_0x0954('0x2e')][_0x0954('0x2f')]);_0x2a5541[_0x0954('0x33')]=_[_0x0954('0x34')](_0x5b346e['query']);_0x2a5541['filters']=_[_0x0954('0x38')](_0x2a5541[_0x0954('0x36')],_0x2a5541[_0x0954('0x33')]);_0x3c25b2[_0x0954('0x37')]=_[_0x0954('0x38')](_0x2a5541[_0x0954('0x36')],qs[_0x0954('0x39')](_0x5b346e[_0x0954('0x33')]['fields']));_0x3c25b2[_0x0954('0x37')]=_0x3c25b2[_0x0954('0x37')][_0x0954('0x47')]?_0x3c25b2['attributes']:_0x2a5541[_0x0954('0x36')];if(_0x5b346e[_0x0954('0x33')][_0x0954('0x48')]){_0x3c25b2[_0x0954('0x49')]=[{'all':!![]}];}_0x3c25b2=_['merge']({},_0x3c25b2,_0x5b346e[_0x0954('0x42')]);return db['ZohoField'][_0x0954('0x4a')](_0x3c25b2)[_0x0954('0x26')](handleEntityNotFound(_0x5add3e,null))[_0x0954('0x26')](respondWithResult(_0x5add3e,null))['catch'](handleError(_0x5add3e,null));};exports[_0x0954('0x4b')]=function(_0x4ea193,_0x3512a9){return db['ZohoField'][_0x0954('0x4b')](_0x4ea193['body'],{})['then'](respondWithResult(_0x3512a9,0xc9))[_0x0954('0x44')](handleError(_0x3512a9,null));};exports[_0x0954('0x25')]=function(_0x567ab4,_0x5f32e8){if(_0x567ab4[_0x0954('0x4c')]['id']){delete _0x567ab4[_0x0954('0x4c')]['id'];}return db[_0x0954('0x2e')][_0x0954('0x4a')]({'where':{'id':_0x567ab4[_0x0954('0x46')]['id']}})[_0x0954('0x26')](handleEntityNotFound(_0x5f32e8,null))[_0x0954('0x26')](saveUpdates(_0x567ab4[_0x0954('0x4c')],null))[_0x0954('0x26')](respondWithResult(_0x5f32e8,null))[_0x0954('0x44')](handleError(_0x5f32e8,null));};exports['destroy']=function(_0x29afd1,_0x4e058b){return db['ZohoField'][_0x0954('0x4a')]({'where':{'id':_0x29afd1[_0x0954('0x46')]['id']}})[_0x0954('0x26')](handleEntityNotFound(_0x4e058b,null))[_0x0954('0x26')](removeEntity(_0x4e058b,null))[_0x0954('0x44')](handleError(_0x4e058b,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index af6ecb5..d9b507c 100644 --- a/server/api/intZohoField/intZohoField.model.js +++ b/server/api/intZohoField/intZohoField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4819=['request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird'];(function(_0x3b150c,_0x2f93f8){var _0x5cd414=function(_0x26305e){while(--_0x26305e){_0x3b150c['push'](_0x3b150c['shift']());}};_0x5cd414(++_0x2f93f8);}(_0x4819,0xcd));var _0x9481=function(_0xf33afd,_0x2363b6){_0xf33afd=_0xf33afd-0x0;var _0x5f432a=_0x4819[_0xf33afd];return _0x5f432a;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xd'),_0x9481('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','lodash','util','../../config/logger','api','request-promise','path'];(function(_0xbf96dc,_0x40ad4e){var _0x13c6ff=function(_0x6a199e){while(--_0x6a199e){_0xbf96dc['push'](_0xbf96dc['shift']());}};_0x13c6ff(++_0x40ad4e);}(_0x687b,0x14a));var _0xb687=function(_0x2deed4,_0x2793e8){_0x2deed4=_0x2deed4-0x0;var _0xfb91f4=_0x687b[_0x2deed4];return _0xfb91f4;};'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 8d3df44..7df756e 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 _0xf2ee=['then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf2ee,0x169));var _0xef2e=function(_0x1bdc9c,_0xcfb027){_0x1bdc9c=_0x1bdc9c-0x0;var _0x4b917c=_0xf2ee[_0x1bdc9c];return _0x4b917c;};'use strict';var _=require('lodash');var util=require(_0xef2e('0x0'));var moment=require(_0xef2e('0x1'));var BPromise=require(_0xef2e('0x2'));var rs=require(_0xef2e('0x3'));var fs=require('fs');var Redis=require(_0xef2e('0x4'));var db=require(_0xef2e('0x5'))['db'];var utils=require(_0xef2e('0x6'));var logger=require(_0xef2e('0x7'))(_0xef2e('0x8'));var config=require(_0xef2e('0x9'));var jayson=require(_0xef2e('0xa'));var client=jayson[_0xef2e('0xb')][_0xef2e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1fe8b9,_0x28a625,_0x22694b){return new BPromise(function(_0xb4ad38,_0x2939de){return client[_0xef2e('0xd')](_0x1fe8b9,_0x22694b)[_0xef2e('0xe')](function(_0x37c4c1){logger['info'](_0xef2e('0xf'),_0x28a625,_0xef2e('0x10'));logger[_0xef2e('0x11')](_0xef2e('0x12'),_0x28a625,'request\x20sent',JSON[_0xef2e('0x13')](_0x37c4c1));if(_0x37c4c1['error']){if(_0x37c4c1[_0xef2e('0x14')]['code']===0x1f4){logger[_0xef2e('0x14')](_0xef2e('0xf'),_0x28a625,_0x37c4c1['error']['message']);return _0x2939de(_0x37c4c1[_0xef2e('0x14')][_0xef2e('0x15')]);}logger[_0xef2e('0x14')](_0xef2e('0xf'),_0x28a625,_0x37c4c1[_0xef2e('0x14')]['message']);return _0xb4ad38(_0x37c4c1['error']['message']);}else{logger[_0xef2e('0x16')]('ZohoField,\x20%s,\x20%s',_0x28a625,_0xef2e('0x10'));_0xb4ad38(_0x37c4c1[_0xef2e('0x17')][_0xef2e('0x15')]);}})[_0xef2e('0x18')](function(_0x19faa0){logger['error'](_0xef2e('0xf'),_0x28a625,_0x19faa0);_0x2939de(_0x19faa0);});});} \ No newline at end of file +var _0x2894=['info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x5690c0,_0x4fdb27){var _0x21fc93=function(_0x2daee3){while(--_0x2daee3){_0x5690c0['push'](_0x5690c0['shift']());}};_0x21fc93(++_0x4fdb27);}(_0x2894,0x113));var _0x4289=function(_0x1ca65d,_0x53fbc3){_0x1ca65d=_0x1ca65d-0x0;var _0x31cc85=_0x2894[_0x1ca65d];return _0x31cc85;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4289('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4289('0x1'))['db'];var utils=require(_0x4289('0x2'));var logger=require(_0x4289('0x3'))(_0x4289('0x4'));var config=require(_0x4289('0x5'));var jayson=require(_0x4289('0x6'));var client=jayson['client'][_0x4289('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55a2cd,_0x2ed095,_0x4b9522){return new BPromise(function(_0x727b30,_0xfa4040){return client[_0x4289('0x8')](_0x55a2cd,_0x4b9522)[_0x4289('0x9')](function(_0x1d4233){logger[_0x4289('0xa')](_0x4289('0xb'),_0x2ed095,_0x4289('0xc'));logger[_0x4289('0xd')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x2ed095,_0x4289('0xc'),JSON[_0x4289('0xe')](_0x1d4233));if(_0x1d4233['error']){if(_0x1d4233[_0x4289('0xf')][_0x4289('0x10')]===0x1f4){logger[_0x4289('0xf')](_0x4289('0xb'),_0x2ed095,_0x1d4233[_0x4289('0xf')]['message']);return _0xfa4040(_0x1d4233[_0x4289('0xf')][_0x4289('0x11')]);}logger[_0x4289('0xf')](_0x4289('0xb'),_0x2ed095,_0x1d4233[_0x4289('0xf')][_0x4289('0x11')]);return _0x727b30(_0x1d4233[_0x4289('0xf')][_0x4289('0x11')]);}else{logger[_0x4289('0xa')](_0x4289('0xb'),_0x2ed095,_0x4289('0xc'));_0x727b30(_0x1d4233['result'][_0x4289('0x11')]);}})[_0x4289('0x12')](function(_0x760bcd){logger[_0x4289('0xf')](_0x4289('0xb'),_0x2ed095,_0x760bcd);_0xfa4040(_0x760bcd);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 25db263..37d116f 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xfdcda1,_0x47f39e){var _0x4fcfe1=function(_0x1cc68c){while(--_0x1cc68c){_0xfdcda1['push'](_0xfdcda1['shift']());}};_0x4fcfe1(++_0x47f39e);}(_0xe706,0xa3));var _0x6e70=function(_0xe14ee9,_0x4cd8e1){_0xe14ee9=_0xe14ee9-0x0;var _0x1dda60=_0xe706[_0xe14ee9];return _0x1dda60;};'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(_0x5ac4b6,_0x4d9360){var _0x29ced8=function(_0x4fdcb6){while(--_0x4fdcb6){_0x5ac4b6['push'](_0x5ac4b6['shift']());}};_0x29ced8(++_0x4d9360);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index dc6aec1..3c92095 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 _0xc0c7=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x33d291,_0x10ee95){var _0x6376be=function(_0x1ab2fe){while(--_0x1ab2fe){_0x33d291['push'](_0x33d291['shift']());}};_0x6376be(++_0x10ee95);}(_0xc0c7,0x115));var _0x7c0c=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc0c7[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x7c0c('0x0'));module[_0x7c0c('0x1')]={'name':{'type':Sequelize[_0x7c0c('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x7c0c('0x2')],'allowNull':![],'unique':_0x7c0c('0x3')},'main':{'type':Sequelize[_0x7c0c('0x2')],'defaultValue':_0x7c0c('0x4')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x7c0c('0x2')]},'type':{'type':Sequelize[_0x7c0c('0x2')]},'size':{'type':Sequelize[_0x7c0c('0x5')]},'active':{'type':Sequelize[_0x7c0c('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x7c0c('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x7c0c('0x2')],'unique':_0x7c0c('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x7c0c('0x2')]},'remoteUri':{'type':Sequelize[_0x7c0c('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x53f8=['unique_name_and_version','app.js','INTEGER','state','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x53f8,0x15a));var _0x853f=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x53f8[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require('sequelize');module[_0x853f('0x0')]={'name':{'type':Sequelize[_0x853f('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x853f('0x1')],'allowNull':![],'unique':_0x853f('0x2')},'main':{'type':Sequelize[_0x853f('0x1')],'defaultValue':_0x853f('0x3')},'filename':{'type':Sequelize[_0x853f('0x1')]},'path':{'type':Sequelize[_0x853f('0x1')]},'type':{'type':Sequelize[_0x853f('0x1')]},'size':{'type':Sequelize[_0x853f('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x853f('0x1')]},'logo':{'type':Sequelize[_0x853f('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x853f('0x5')},'description':{'type':Sequelize[_0x853f('0x1')]},'title':{'type':Sequelize[_0x853f('0x1')]},'remoteUri':{'type':Sequelize[_0x853f('0x1')]},'link':{'type':Sequelize[_0x853f('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 fc6a730..9fb90f5 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 _0x187d=['body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','create'];(function(_0x32b894,_0x14c458){var _0x1f4d76=function(_0x4737af){while(--_0x4737af){_0x32b894['push'](_0x32b894['shift']());}};_0x1f4d76(++_0x14c458);}(_0x187d,0x93));var _0xd187=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x187d[_0x28d18d];return _0x470640;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')](_0x3ce4a1[_0xd187('0x48')],{})['then'](respondWithResult(_0x3f5def,0xc9))[_0xd187('0x41')](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x4523c8,_0x1449d7){if(_0x4523c8[_0xd187('0x48')]['id']){delete _0x4523c8['body']['id'];}return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x4523c8['params']['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x1449d7,null))[_0xd187('0x3f')](saveUpdates(_0x4523c8['body'],null))['then'](respondWithResult(_0x1449d7,null))['catch'](handleError(_0x1449d7,null));};exports['destroy']=function(_0x473bef,_0x22f432){return db[_0xd187('0x2d')][_0xd187('0x46')]({'where':{'id':_0x473bef[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x22f432,null))[_0xd187('0x3f')](removeEntity(_0x22f432,null))['catch'](handleError(_0x22f432,null));}; \ No newline at end of file +var _0x4975=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','Integration','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2fe36e,_0x4def6f){var _0x4efae7=function(_0x32b329){while(--_0x32b329){_0x2fe36e['push'](_0x2fe36e['shift']());}};_0x4efae7(++_0x4def6f);}(_0x4975,0x86));var _0x5497=function(_0x23274d,_0x10c98d){_0x23274d=_0x23274d-0x0;var _0x465c6a=_0x4975[_0x23274d];return _0x465c6a;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['Integration']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['Integration'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index ce6eae7..6ca8236 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 _0x3ecf=['integrations','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x110380,_0x3f042a){var _0x33f263=function(_0x5d05ec){while(--_0x5d05ec){_0x110380['push'](_0x110380['shift']());}};_0x33f263(++_0x3f042a);}(_0x3ecf,0x14b));var _0xf3ec=function(_0x5f0d30,_0x35f7b9){_0x5f0d30=_0x5f0d30-0x0;var _0x3508ab=_0x3ecf[_0x5f0d30];return _0x3508ab;};'use strict';var _=require(_0xf3ec('0x0'));var util=require('util');var logger=require(_0xf3ec('0x1'))(_0xf3ec('0x2'));var moment=require(_0xf3ec('0x3'));var BPromise=require(_0xf3ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3ec('0x5'));var rimraf=require(_0xf3ec('0x6'));var config=require(_0xf3ec('0x7'));var attributes=require('./integration.attributes');module[_0xf3ec('0x8')]=function(_0x1c5aa5,_0x1a813f){return _0x1c5aa5[_0xf3ec('0x9')]('Integration',attributes,{'tableName':_0xf3ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15d8=['api','moment','bluebird','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger'];(function(_0x455071,_0x4333f8){var _0x240973=function(_0xfccebf){while(--_0xfccebf){_0x455071['push'](_0x455071['shift']());}};_0x240973(++_0x4333f8);}(_0x15d8,0x11b));var _0x815d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x815d('0x0'));var util=require(_0x815d('0x1'));var logger=require(_0x815d('0x2'))(_0x815d('0x3'));var moment=require(_0x815d('0x4'));var BPromise=require(_0x815d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x815d('0x6'));var config=require(_0x815d('0x7'));var attributes=require(_0x815d('0x8'));module[_0x815d('0x9')]=function(_0x475dd8,_0xd40133){return _0x475dd8[_0x815d('0xa')](_0x815d('0xb'),attributes,{'tableName':_0x815d('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 d108e1d..ab03f60 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 _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x518f49,_0x1ab09b){var _0x552258=function(_0x1dd0bc){while(--_0x1dd0bc){_0x518f49['push'](_0x518f49['shift']());}};_0x552258(++_0x1ab09b);}(_0x0295,0x1f0));var _0x5029=function(_0x1649af,_0x9522f8){_0x1649af=_0x1649af-0x0;var _0x28359a=_0x0295[_0x1649af];return _0x28359a;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('Integration,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5eb701,_0x43bf8b){var _0x2d03fa=function(_0x2c0b12){while(--_0x2c0b12){_0x5eb701['push'](_0x5eb701['shift']());}};_0x2d03fa(++_0x43bf8b);}(_0x7880,0x1f4));var _0x0788=function(_0x26658e,_0x1bb1a9){_0x26658e=_0x26658e-0x0;var _0x572802=_0x7880[_0x26658e];return _0x572802;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 3b18e02..fdc4f03 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 _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x15ed84,_0x589521){var _0x426d2b=function(_0x5d294a){while(--_0x5d294a){_0x15ed84['push'](_0x15ed84['shift']());}};_0x426d2b(++_0x589521);}(_0x4975,0x86));var _0x5497=function(_0x13118c,_0x197a84){_0x13118c=_0x13118c-0x0;var _0x2ad9b3=_0x4975[_0x13118c];return _0x2ad9b3;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router; \ No newline at end of file +var _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x31f952,_0x3fa5b8){var _0x114490=function(_0x2176f0){while(--_0x2176f0){_0x31f952['push'](_0x31f952['shift']());}};_0x114490(++_0x3fa5b8);}(_0x955f,0x1eb));var _0xf955=function(_0x573183,_0xedb544){_0x573183=_0x573183-0x0;var _0x25dee8=_0x955f[_0x573183];return _0x25dee8;};'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('./integrationReport.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('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);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 a99e5b2..d4489fc 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 _0x406c=['TEXT','SENT','RECEIVED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x1cd734,_0x192087){var _0x4b5456=function(_0x35883e){while(--_0x35883e){_0x1cd734['push'](_0x1cd734['shift']());}};_0x4b5456(++_0x192087);}(_0x406c,0xdb));var _0xc406=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x406c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc406('0x0'));module[_0xc406('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xc406('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xc406('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xc406('0x2')]},'uniqueid':{'type':Sequelize[_0xc406('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc406('0x2')]},'queue':{'type':Sequelize[_0xc406('0x2')]},'interface':{'type':Sequelize[_0xc406('0x2')]},'membername':{'type':Sequelize[_0xc406('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc406('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xc406('0x4')]},'agentcomplete':{'type':Sequelize[_0xc406('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc406('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xc406('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc406('0x4')]},'reason':{'type':Sequelize[_0xc406('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc406('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc406('0x3')]},'lastevent':{'type':Sequelize[_0xc406('0x2')]},'channel':{'type':Sequelize[_0xc406('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc406('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc406('0x2')]},'connectedlinename':{'type':Sequelize[_0xc406('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xc406('0x2')]},'context':{'type':Sequelize[_0xc406('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xc406('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc406('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xc406('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xc406('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xc406('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xc406('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xc406('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xc406('0x2')]},'to':{'type':Sequelize[_0xc406('0x2')]},'cc':{'type':Sequelize[_0xc406('0x2')]},'attachment':{'type':Sequelize[_0xc406('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM'](_0xc406('0x7'),'SENDING',_0xc406('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xc406('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xc406('0x4')]}}; \ No newline at end of file +var _0x73e4=['BOOLEAN','TEXT','ENUM','SENT','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x3a6d6e,_0x2f14fa){var _0x532860=function(_0x5ce529){while(--_0x5ce529){_0x3a6d6e['push'](_0x3a6d6e['shift']());}};_0x532860(++_0x2f14fa);}(_0x73e4,0x7d));var _0x473e=function(_0x381372,_0xf0a5a){_0x381372=_0x381372-0x0;var _0x4e959a=_0x73e4[_0x381372];return _0x4e959a;};'use strict';var Sequelize=require(_0x473e('0x0'));module[_0x473e('0x1')]={'integration':{'type':Sequelize[_0x473e('0x2')]},'eventChannel':{'type':Sequelize[_0x473e('0x2')]},'exitStatus':{'type':Sequelize[_0x473e('0x2')]},'ticketId':{'type':Sequelize[_0x473e('0x2')]},'integrationId':{'type':Sequelize[_0x473e('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x473e('0x2')]},'membername':{'type':Sequelize[_0x473e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x473e('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x473e('0x3')]},'agentcomplete':{'type':Sequelize[_0x473e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x473e('0x3')]},'agentacw':{'type':Sequelize[_0x473e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x473e('0x3')]},'reason':{'type':Sequelize[_0x473e('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x473e('0x4')]},'agentdump':{'type':Sequelize[_0x473e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x473e('0x4')]},'lastevent':{'type':Sequelize[_0x473e('0x2')]},'channel':{'type':Sequelize[_0x473e('0x2')]},'channelstate':{'type':Sequelize[_0x473e('0x3')]},'channelstatedesc':{'type':Sequelize[_0x473e('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x473e('0x2')]},'language':{'type':Sequelize[_0x473e('0x2')]},'accountcode':{'type':Sequelize[_0x473e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x473e('0x2')]},'priority':{'type':Sequelize[_0x473e('0x2')]},'destchannel':{'type':Sequelize[_0x473e('0x2')]},'destchannelstate':{'type':Sequelize[_0x473e('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x473e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x473e('0x2')]},'destcalleridname':{'type':Sequelize[_0x473e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x473e('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x473e('0x2')]},'destaccountcode':{'type':Sequelize[_0x473e('0x2')]},'destcontext':{'type':Sequelize[_0x473e('0x2')]},'destexten':{'type':Sequelize[_0x473e('0x2')]},'destpriority':{'type':Sequelize[_0x473e('0x2')]},'destuniqueid':{'type':Sequelize[_0x473e('0x2')]},'messageId':{'type':Sequelize[_0x473e('0x2')]},'inReplyTo':{'type':Sequelize[_0x473e('0x2')]},'subject':{'type':Sequelize[_0x473e('0x2')]},'from':{'type':Sequelize[_0x473e('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x473e('0x2')]},'attachment':{'type':Sequelize[_0x473e('0x6')]},'html':{'type':Sequelize[_0x473e('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x473e('0x7')](_0x473e('0x8'),'SENDING','RECEIVED',_0x473e('0x9'))},'url':{'type':Sequelize[_0x473e('0x2')]},'app':{'type':Sequelize[_0x473e('0x2')]},'appdata':{'type':Sequelize[_0x473e('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 58c4dc4..9bbfbe4 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 _0x1fb7=['IntegrationReport','rawAttributes','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x1494f9,_0x2220c3){var _0x53e955=function(_0x38ec2b){while(--_0x38ec2b){_0x1494f9['push'](_0x1494f9['shift']());}};_0x53e955(++_0x2220c3);}(_0x1fb7,0x155));var _0x71fb=function(_0x1b6c0c,_0x51ef20){_0x1b6c0c=_0x1b6c0c-0x0;var _0x178991=_0x1fb7[_0x1b6c0c];return _0x178991;};'use strict';var emlformat=require(_0x71fb('0x0'));var rimraf=require(_0x71fb('0x1'));var zipdir=require(_0x71fb('0x2'));var jsonpatch=require(_0x71fb('0x3'));var rp=require('request-promise');var moment=require(_0x71fb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x71fb('0x5'));var util=require(_0x71fb('0x6'));var path=require(_0x71fb('0x7'));var sox=require(_0x71fb('0x8'));var csv=require('to-csv');var ejs=require(_0x71fb('0x9'));var fs=require('fs');var fs_extra=require(_0x71fb('0xa'));var _=require('lodash');var squel=require(_0x71fb('0xb'));var crypto=require(_0x71fb('0xc'));var jsforce=require(_0x71fb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x71fb('0xe'));var Papa=require('papaparse');var Redis=require(_0x71fb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x71fb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x71fb('0x11'));var logger=require(_0x71fb('0x12'))(_0x71fb('0x13'));var utils=require(_0x71fb('0x14'));var config=require(_0x71fb('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x71fb('0x16'))['db'];function respondWithStatusCode(_0x38eb53,_0x1925f5){_0x1925f5=_0x1925f5||0xcc;return function(_0x350b24){if(_0x350b24){return _0x38eb53[_0x71fb('0x17')](_0x1925f5);}return _0x38eb53['status'](_0x1925f5)[_0x71fb('0x18')]();};}function respondWithResult(_0x3f104c,_0x27039f){_0x27039f=_0x27039f||0xc8;return function(_0x57b521){if(_0x57b521){return _0x3f104c[_0x71fb('0x19')](_0x27039f)[_0x71fb('0x1a')](_0x57b521);}};}function respondWithFilteredResult(_0x4d4eb1,_0x427979){return function(_0x260d32){if(_0x260d32){var _0x319513=typeof _0x427979[_0x71fb('0x1b')]==='undefined'&&typeof _0x427979[_0x71fb('0x1c')]===_0x71fb('0x1d');var _0x4c7018=_0x260d32[_0x71fb('0x1e')];var _0xbb4a91=_0x319513?0x0:_0x427979['offset'];var _0x548953=_0x319513?_0x260d32[_0x71fb('0x1e')]:_0x427979[_0x71fb('0x1b')]+_0x427979[_0x71fb('0x1c')];var _0x538c54;if(_0x548953>=_0x4c7018){_0x548953=_0x4c7018;_0x538c54=0xc8;}else{_0x538c54=0xce;}_0x4d4eb1[_0x71fb('0x19')](_0x538c54);return _0x4d4eb1[_0x71fb('0x1f')](_0x71fb('0x20'),_0xbb4a91+'-'+_0x548953+'/'+_0x4c7018)[_0x71fb('0x1a')](_0x260d32);}return null;};}function patchUpdates(_0x47b186){return function(_0x3935ae){try{jsonpatch[_0x71fb('0x21')](_0x3935ae,_0x47b186,!![]);}catch(_0x465c35){return BPromise[_0x71fb('0x22')](_0x465c35);}return _0x3935ae[_0x71fb('0x23')]();};}function saveUpdates(_0x4fe139,_0x1e5df3){return function(_0x5940cd){if(_0x5940cd){return _0x5940cd[_0x71fb('0x24')](_0x4fe139)[_0x71fb('0x25')](function(_0x8bbace){return _0x8bbace;});}return null;};}function removeEntity(_0x46b11b,_0x460879){return function(_0x23ba11){if(_0x23ba11){return _0x23ba11[_0x71fb('0x26')]()['then'](function(){_0x46b11b[_0x71fb('0x19')](0xcc)[_0x71fb('0x18')]();});}};}function handleEntityNotFound(_0x1578c0,_0x1a7fb0){return function(_0xf44552){if(!_0xf44552){_0x1578c0[_0x71fb('0x17')](0x194);}return _0xf44552;};}function handleError(_0x3a710b,_0x2cf672){_0x2cf672=_0x2cf672||0x1f4;return function(_0x278758){logger[_0x71fb('0x27')](_0x278758['stack']);if(_0x278758['name']){delete _0x278758[_0x71fb('0x28')];}_0x3a710b['status'](_0x2cf672)[_0x71fb('0x29')](_0x278758);};}exports[_0x71fb('0x2a')]=function(_0x1a3844,_0x1bc28d){var _0x1cbb82={},_0x3b682f={},_0x58e420={'count':0x0,'rows':[]};var _0x25f9e1=_[_0x71fb('0x2b')](db[_0x71fb('0x2c')][_0x71fb('0x2d')],function(_0x2377de){return{'name':_0x2377de['fieldName'],'type':_0x2377de['type'][_0x71fb('0x2e')]};});_0x3b682f['model']=_[_0x71fb('0x2b')](_0x25f9e1,'name');_0x3b682f['query']=_['keys'](_0x1a3844[_0x71fb('0x2f')]);_0x3b682f['filters']=_[_0x71fb('0x30')](_0x3b682f['model'],_0x3b682f['query']);_0x1cbb82[_0x71fb('0x31')]=_[_0x71fb('0x30')](_0x3b682f[_0x71fb('0x32')],qs[_0x71fb('0x33')](_0x1a3844[_0x71fb('0x2f')][_0x71fb('0x33')]));_0x1cbb82['attributes']=_0x1cbb82[_0x71fb('0x31')][_0x71fb('0x34')]?_0x1cbb82[_0x71fb('0x31')]:_0x3b682f[_0x71fb('0x32')];if(!_0x1a3844['query'][_0x71fb('0x35')](_0x71fb('0x36'))){_0x1cbb82[_0x71fb('0x1c')]=qs[_0x71fb('0x1c')](_0x1a3844['query'][_0x71fb('0x1c')]);_0x1cbb82[_0x71fb('0x1b')]=qs[_0x71fb('0x1b')](_0x1a3844[_0x71fb('0x2f')]['offset']);}_0x1cbb82[_0x71fb('0x37')]=qs[_0x71fb('0x38')](_0x1a3844['query'][_0x71fb('0x38')]);_0x1cbb82[_0x71fb('0x39')]=qs[_0x71fb('0x3a')](_[_0x71fb('0x3b')](_0x1a3844[_0x71fb('0x2f')],_0x3b682f[_0x71fb('0x3a')]),_0x25f9e1);if(_0x1a3844['query'][_0x71fb('0x3c')]){_0x1cbb82['where']=_[_0x71fb('0x3d')](_0x1cbb82[_0x71fb('0x39')],{'$or':_[_0x71fb('0x2b')](_0x25f9e1,function(_0x198bb6){if(_0x198bb6[_0x71fb('0x3e')]!==_0x71fb('0x3f')){var _0x2dacd6={};_0x2dacd6[_0x198bb6[_0x71fb('0x28')]]={'$like':'%'+_0x1a3844[_0x71fb('0x2f')]['filter']+'%'};return _0x2dacd6;}})});}_0x1cbb82=_[_0x71fb('0x3d')]({},_0x1cbb82,_0x1a3844[_0x71fb('0x40')]);var _0xa8252={'where':_0x1cbb82[_0x71fb('0x39')]};return db['IntegrationReport'][_0x71fb('0x1e')](_0xa8252)[_0x71fb('0x25')](function(_0x4edba4){_0x58e420[_0x71fb('0x1e')]=_0x4edba4;if(_0x1a3844[_0x71fb('0x2f')][_0x71fb('0x41')]){_0x1cbb82[_0x71fb('0x42')]=[{'all':!![]}];}return db[_0x71fb('0x2c')][_0x71fb('0x43')](_0x1cbb82);})[_0x71fb('0x25')](function(_0x42b675){_0x58e420[_0x71fb('0x44')]=_0x42b675;return _0x58e420;})['then'](respondWithFilteredResult(_0x1bc28d,_0x1cbb82))[_0x71fb('0x45')](handleError(_0x1bc28d,null));};exports[_0x71fb('0x46')]=function(_0x228e55,_0x4375dc){var _0xf3e819={'raw':![],'where':{'id':_0x228e55[_0x71fb('0x47')]['id']}},_0x202632={};_0x202632[_0x71fb('0x32')]=_['keys'](db['IntegrationReport'][_0x71fb('0x2d')]);_0x202632[_0x71fb('0x2f')]=_[_0x71fb('0x48')](_0x228e55['query']);_0x202632[_0x71fb('0x3a')]=_[_0x71fb('0x30')](_0x202632[_0x71fb('0x32')],_0x202632[_0x71fb('0x2f')]);_0xf3e819[_0x71fb('0x31')]=_[_0x71fb('0x30')](_0x202632[_0x71fb('0x32')],qs[_0x71fb('0x33')](_0x228e55[_0x71fb('0x2f')]['fields']));_0xf3e819[_0x71fb('0x31')]=_0xf3e819[_0x71fb('0x31')]['length']?_0xf3e819[_0x71fb('0x31')]:_0x202632['model'];if(_0x228e55[_0x71fb('0x2f')]['includeAll']){_0xf3e819[_0x71fb('0x42')]=[{'all':!![]}];}_0xf3e819=_['merge']({},_0xf3e819,_0x228e55[_0x71fb('0x40')]);return db['IntegrationReport'][_0x71fb('0x49')](_0xf3e819)['then'](handleEntityNotFound(_0x4375dc,null))[_0x71fb('0x25')](respondWithResult(_0x4375dc,null))[_0x71fb('0x45')](handleError(_0x4375dc,null));};exports['create']=function(_0x5f5a00,_0x3f2725){return db['IntegrationReport'][_0x71fb('0x4a')](_0x5f5a00['body'],{})[_0x71fb('0x25')](respondWithResult(_0x3f2725,0xc9))[_0x71fb('0x45')](handleError(_0x3f2725,null));};exports['update']=function(_0x1f9a75,_0x4e3cbb){if(_0x1f9a75['body']['id']){delete _0x1f9a75[_0x71fb('0x4b')]['id'];}return db[_0x71fb('0x2c')][_0x71fb('0x49')]({'where':{'id':_0x1f9a75[_0x71fb('0x47')]['id']}})['then'](handleEntityNotFound(_0x4e3cbb,null))[_0x71fb('0x25')](saveUpdates(_0x1f9a75['body'],null))['then'](respondWithResult(_0x4e3cbb,null))[_0x71fb('0x45')](handleError(_0x4e3cbb,null));};exports[_0x71fb('0x26')]=function(_0x399a2f,_0x3b57ac){return db[_0x71fb('0x2c')][_0x71fb('0x49')]({'where':{'id':_0x399a2f[_0x71fb('0x47')]['id']}})[_0x71fb('0x25')](handleEntityNotFound(_0x3b57ac,null))[_0x71fb('0x25')](removeEntity(_0x3b57ac,null))[_0x71fb('0x45')](handleError(_0x3b57ac,null));};exports[_0x71fb('0x4c')]=function(_0x4e22ac,_0x3f1dc2){return db[_0x71fb('0x2c')][_0x71fb('0x4c')]()[_0x71fb('0x25')](respondWithResult(_0x3f1dc2,null))['catch'](handleError(_0x3f1dc2,null));}; \ No newline at end of file +var _0x6614=['zip-dir','fast-json-patch','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','IntegrationReport','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','show','rawAttributes','include','find','catch','create','body','params','describe','eml-format','rimraf'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6614,0xe8));var _0x4661=function(_0x21d3d5,_0x38163c){_0x21d3d5=_0x21d3d5-0x0;var _0xf0057b=_0x6614[_0x21d3d5];return _0xf0057b;};'use strict';var emlformat=require(_0x4661('0x0'));var rimraf=require(_0x4661('0x1'));var zipdir=require(_0x4661('0x2'));var jsonpatch=require(_0x4661('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4661('0x4'));var util=require(_0x4661('0x5'));var path=require(_0x4661('0x6'));var sox=require(_0x4661('0x7'));var csv=require(_0x4661('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4661('0x9'));var _=require(_0x4661('0xa'));var squel=require(_0x4661('0xb'));var crypto=require(_0x4661('0xc'));var jsforce=require(_0x4661('0xd'));var deskjs=require(_0x4661('0xe'));var toCsv=require(_0x4661('0x8'));var querystring=require('querystring');var Papa=require(_0x4661('0xf'));var Redis=require(_0x4661('0x10'));var authService=require(_0x4661('0x11'));var qs=require(_0x4661('0x12'));var as=require(_0x4661('0x13'));var hardwareService=require(_0x4661('0x14'));var logger=require(_0x4661('0x15'))(_0x4661('0x16'));var utils=require(_0x4661('0x17'));var config=require(_0x4661('0x18'));var licenseUtil=require(_0x4661('0x19'));var db=require(_0x4661('0x1a'))['db'];function respondWithStatusCode(_0x2e2153,_0xef67b3){_0xef67b3=_0xef67b3||0xcc;return function(_0x2f885a){if(_0x2f885a){return _0x2e2153[_0x4661('0x1b')](_0xef67b3);}return _0x2e2153[_0x4661('0x1c')](_0xef67b3)['end']();};}function respondWithResult(_0x468109,_0x1889ec){_0x1889ec=_0x1889ec||0xc8;return function(_0x4df427){if(_0x4df427){return _0x468109[_0x4661('0x1c')](_0x1889ec)['json'](_0x4df427);}};}function respondWithFilteredResult(_0x4d6175,_0x356b15){return function(_0x38a981){if(_0x38a981){var _0x382232=typeof _0x356b15['offset']===_0x4661('0x1d')&&typeof _0x356b15['limit']===_0x4661('0x1d');var _0x4a5a0e=_0x38a981[_0x4661('0x1e')];var _0x7c9313=_0x382232?0x0:_0x356b15[_0x4661('0x1f')];var _0xfc394=_0x382232?_0x38a981[_0x4661('0x1e')]:_0x356b15[_0x4661('0x1f')]+_0x356b15['limit'];var _0x510442;if(_0xfc394>=_0x4a5a0e){_0xfc394=_0x4a5a0e;_0x510442=0xc8;}else{_0x510442=0xce;}_0x4d6175[_0x4661('0x1c')](_0x510442);return _0x4d6175['set'](_0x4661('0x20'),_0x7c9313+'-'+_0xfc394+'/'+_0x4a5a0e)[_0x4661('0x21')](_0x38a981);}return null;};}function patchUpdates(_0x15da8a){return function(_0x4b95b0){try{jsonpatch['apply'](_0x4b95b0,_0x15da8a,!![]);}catch(_0x52f780){return BPromise[_0x4661('0x22')](_0x52f780);}return _0x4b95b0[_0x4661('0x23')]();};}function saveUpdates(_0x2c8d51,_0x4092bb){return function(_0x5cbc42){if(_0x5cbc42){return _0x5cbc42[_0x4661('0x24')](_0x2c8d51)[_0x4661('0x25')](function(_0x18cd84){return _0x18cd84;});}return null;};}function removeEntity(_0x1c10f6,_0x2ac5d2){return function(_0x2811a1){if(_0x2811a1){return _0x2811a1[_0x4661('0x26')]()[_0x4661('0x25')](function(){_0x1c10f6['status'](0xcc)[_0x4661('0x27')]();});}};}function handleEntityNotFound(_0x1c1b3c,_0x2e7453){return function(_0x488ef9){if(!_0x488ef9){_0x1c1b3c[_0x4661('0x1b')](0x194);}return _0x488ef9;};}function handleError(_0x2178db,_0x3823c5){_0x3823c5=_0x3823c5||0x1f4;return function(_0x281c0d){logger[_0x4661('0x28')](_0x281c0d[_0x4661('0x29')]);if(_0x281c0d[_0x4661('0x2a')]){delete _0x281c0d[_0x4661('0x2a')];}_0x2178db[_0x4661('0x1c')](_0x3823c5)[_0x4661('0x2b')](_0x281c0d);};}exports[_0x4661('0x2c')]=function(_0xb82f79,_0x4a2d34){var _0x51f055={},_0x38749a={},_0x5c05f5={'count':0x0,'rows':[]};var _0x386010=_['map'](db[_0x4661('0x2d')]['rawAttributes'],function(_0x5943ae){return{'name':_0x5943ae[_0x4661('0x2e')],'type':_0x5943ae['type']['key']};});_0x38749a[_0x4661('0x2f')]=_[_0x4661('0x30')](_0x386010,_0x4661('0x2a'));_0x38749a[_0x4661('0x31')]=_[_0x4661('0x32')](_0xb82f79['query']);_0x38749a[_0x4661('0x33')]=_['intersection'](_0x38749a[_0x4661('0x2f')],_0x38749a[_0x4661('0x31')]);_0x51f055[_0x4661('0x34')]=_[_0x4661('0x35')](_0x38749a[_0x4661('0x2f')],qs[_0x4661('0x36')](_0xb82f79[_0x4661('0x31')][_0x4661('0x36')]));_0x51f055['attributes']=_0x51f055['attributes'][_0x4661('0x37')]?_0x51f055[_0x4661('0x34')]:_0x38749a[_0x4661('0x2f')];if(!_0xb82f79[_0x4661('0x31')][_0x4661('0x38')]('nolimit')){_0x51f055[_0x4661('0x39')]=qs[_0x4661('0x39')](_0xb82f79[_0x4661('0x31')]['limit']);_0x51f055['offset']=qs[_0x4661('0x1f')](_0xb82f79[_0x4661('0x31')][_0x4661('0x1f')]);}_0x51f055['order']=qs[_0x4661('0x3a')](_0xb82f79[_0x4661('0x31')][_0x4661('0x3a')]);_0x51f055[_0x4661('0x3b')]=qs[_0x4661('0x33')](_[_0x4661('0x3c')](_0xb82f79[_0x4661('0x31')],_0x38749a['filters']),_0x386010);if(_0xb82f79[_0x4661('0x31')]['filter']){_0x51f055[_0x4661('0x3b')]=_[_0x4661('0x3d')](_0x51f055[_0x4661('0x3b')],{'$or':_[_0x4661('0x30')](_0x386010,function(_0x4e5bce){if(_0x4e5bce[_0x4661('0x3e')]!==_0x4661('0x3f')){var _0x566d64={};_0x566d64[_0x4e5bce['name']]={'$like':'%'+_0xb82f79[_0x4661('0x31')][_0x4661('0x40')]+'%'};return _0x566d64;}})});}_0x51f055=_[_0x4661('0x3d')]({},_0x51f055,_0xb82f79[_0x4661('0x41')]);var _0x485b9b={'where':_0x51f055[_0x4661('0x3b')]};return db['IntegrationReport'][_0x4661('0x1e')](_0x485b9b)[_0x4661('0x25')](function(_0x480e4c){_0x5c05f5['count']=_0x480e4c;if(_0xb82f79[_0x4661('0x31')][_0x4661('0x42')]){_0x51f055['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x4661('0x43')](_0x51f055);})[_0x4661('0x25')](function(_0x2ec71d){_0x5c05f5[_0x4661('0x44')]=_0x2ec71d;return _0x5c05f5;})[_0x4661('0x25')](respondWithFilteredResult(_0x4a2d34,_0x51f055))['catch'](handleError(_0x4a2d34,null));};exports[_0x4661('0x45')]=function(_0x57d411,_0x1ac80f){var _0x35cb71={'raw':![],'where':{'id':_0x57d411['params']['id']}},_0x12577a={};_0x12577a[_0x4661('0x2f')]=_[_0x4661('0x32')](db[_0x4661('0x2d')][_0x4661('0x46')]);_0x12577a[_0x4661('0x31')]=_[_0x4661('0x32')](_0x57d411[_0x4661('0x31')]);_0x12577a[_0x4661('0x33')]=_[_0x4661('0x35')](_0x12577a[_0x4661('0x2f')],_0x12577a[_0x4661('0x31')]);_0x35cb71[_0x4661('0x34')]=_[_0x4661('0x35')](_0x12577a[_0x4661('0x2f')],qs[_0x4661('0x36')](_0x57d411[_0x4661('0x31')]['fields']));_0x35cb71[_0x4661('0x34')]=_0x35cb71[_0x4661('0x34')][_0x4661('0x37')]?_0x35cb71['attributes']:_0x12577a[_0x4661('0x2f')];if(_0x57d411[_0x4661('0x31')][_0x4661('0x42')]){_0x35cb71[_0x4661('0x47')]=[{'all':!![]}];}_0x35cb71=_['merge']({},_0x35cb71,_0x57d411['options']);return db['IntegrationReport'][_0x4661('0x48')](_0x35cb71)[_0x4661('0x25')](handleEntityNotFound(_0x1ac80f,null))['then'](respondWithResult(_0x1ac80f,null))[_0x4661('0x49')](handleError(_0x1ac80f,null));};exports[_0x4661('0x4a')]=function(_0x466712,_0x5dbc3b){return db[_0x4661('0x2d')][_0x4661('0x4a')](_0x466712[_0x4661('0x4b')],{})[_0x4661('0x25')](respondWithResult(_0x5dbc3b,0xc9))['catch'](handleError(_0x5dbc3b,null));};exports[_0x4661('0x24')]=function(_0x21cfef,_0x419c95){if(_0x21cfef[_0x4661('0x4b')]['id']){delete _0x21cfef[_0x4661('0x4b')]['id'];}return db[_0x4661('0x2d')][_0x4661('0x48')]({'where':{'id':_0x21cfef[_0x4661('0x4c')]['id']}})['then'](handleEntityNotFound(_0x419c95,null))['then'](saveUpdates(_0x21cfef[_0x4661('0x4b')],null))[_0x4661('0x25')](respondWithResult(_0x419c95,null))['catch'](handleError(_0x419c95,null));};exports[_0x4661('0x26')]=function(_0x5eb396,_0x3cfa92){return db[_0x4661('0x2d')][_0x4661('0x48')]({'where':{'id':_0x5eb396['params']['id']}})[_0x4661('0x25')](handleEntityNotFound(_0x3cfa92,null))[_0x4661('0x25')](removeEntity(_0x3cfa92,null))['catch'](handleError(_0x3cfa92,null));};exports[_0x4661('0x4d')]=function(_0x1d8226,_0x7eab9f){return db[_0x4661('0x2d')]['describe']()[_0x4661('0x25')](respondWithResult(_0x7eab9f,null))[_0x4661('0x49')](handleError(_0x7eab9f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 32e9529..ad1bccf 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 _0x2f11=['bluebird','request-promise','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','lodash','util','../../config/logger','api','moment'];(function(_0x9d1180,_0x2f71fb){var _0x155274=function(_0x1867c1){while(--_0x1867c1){_0x9d1180['push'](_0x9d1180['shift']());}};_0x155274(++_0x2f71fb);}(_0x2f11,0x1ab));var _0x12f1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2f11[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x12f1('0x0'));var util=require(_0x12f1('0x1'));var logger=require(_0x12f1('0x2'))(_0x12f1('0x3'));var moment=require(_0x12f1('0x4'));var BPromise=require(_0x12f1('0x5'));var rp=require(_0x12f1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12f1('0x7'));var config=require(_0x12f1('0x8'));var attributes=require(_0x12f1('0x9'));module[_0x12f1('0xa')]=function(_0x5ee632,_0x2d3e27){return _0x5ee632['define'](_0x12f1('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bb3=['../../config/environment','exports','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6bb3,0x1b2));var _0x36bb=function(_0x3a05a6,_0x5a2916){_0x3a05a6=_0x3a05a6-0x0;var _0x55a922=_0x6bb3[_0x3a05a6];return _0x55a922;};'use strict';var _=require('lodash');var util=require(_0x36bb('0x0'));var logger=require(_0x36bb('0x1'))(_0x36bb('0x2'));var moment=require(_0x36bb('0x3'));var BPromise=require(_0x36bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x36bb('0x5'));var config=require(_0x36bb('0x6'));var attributes=require('./integrationReport.attributes');module[_0x36bb('0x7')]=function(_0x48122d,_0x4c7b0a){return _0x48122d[_0x36bb('0x8')](_0x36bb('0x9'),attributes,{'tableName':_0x36bb('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 acfadc2..878797a 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 _0xda19=['error','message','info','result','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x26d8ca,_0x228feb){var _0xada136=function(_0x2f5c59){while(--_0x2f5c59){_0x26d8ca['push'](_0x26d8ca['shift']());}};_0xada136(++_0x228feb);}(_0xda19,0xd5));var _0x9da1=function(_0x5becc0,_0x5be6c3){_0x5becc0=_0x5becc0-0x0;var _0x46d254=_0xda19[_0x5becc0];return _0x46d254;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var moment=require(_0x9da1('0x1'));var BPromise=require('bluebird');var rs=require(_0x9da1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9da1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da1('0x4'))(_0x9da1('0x5'));var config=require(_0x9da1('0x6'));var jayson=require(_0x9da1('0x7'));var client=jayson[_0x9da1('0x8')][_0x9da1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23e4f7,_0x2c3cdd,_0x1c24e6){return new BPromise(function(_0x5e2d18,_0x47df89){return client['request'](_0x23e4f7,_0x1c24e6)['then'](function(_0x417312){logger['info'](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));logger[_0x9da1('0xc')](_0x9da1('0xd'),_0x2c3cdd,_0x9da1('0xb'),JSON[_0x9da1('0xe')](_0x417312));if(_0x417312[_0x9da1('0xf')]){if(_0x417312['error']['code']===0x1f4){logger[_0x9da1('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x2c3cdd,_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);return _0x47df89(_0x417312[_0x9da1('0xf')][_0x9da1('0x10')]);}logger['error'](_0x9da1('0xa'),_0x2c3cdd,_0x417312['error']['message']);return _0x5e2d18(_0x417312[_0x9da1('0xf')]['message']);}else{logger[_0x9da1('0x11')](_0x9da1('0xa'),_0x2c3cdd,_0x9da1('0xb'));_0x5e2d18(_0x417312[_0x9da1('0x12')][_0x9da1('0x10')]);}})['catch'](function(_0x16f75a){logger[_0x9da1('0xf')](_0x9da1('0xa'),_0x2c3cdd,_0x16f75a);_0x47df89(_0x16f75a);});});} \ No newline at end of file +var _0x7a54=['info','IntegrationReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x4c111e,_0x5bd967){_0x4c111e=_0x4c111e-0x0;var _0x3b9fad=_0x7a54[_0x4c111e];return _0x3b9fad;};'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')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 4d0ea41..dd418a4 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 _0x76c1=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','create','post','addIntervals','put','delete','destroy','exports','multer','util','path'];(function(_0x2513ce,_0xf33af6){var _0x19e1e7=function(_0x114ba1){while(--_0x114ba1){_0x2513ce['push'](_0x2513ce['shift']());}};_0x19e1e7(++_0xf33af6);}(_0x76c1,0x87));var _0x176c=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x76c1[_0x152fe3];return _0xc5bb39;};'use strict';var multer=require(_0x176c('0x0'));var util=require(_0x176c('0x1'));var path=require(_0x176c('0x2'));var timeout=require(_0x176c('0x3'));var express=require(_0x176c('0x4'));var router=express[_0x176c('0x5')]();var fs_extra=require(_0x176c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x176c('0x7'));var config=require(_0x176c('0x8'));var controller=require(_0x176c('0x9'));router[_0x176c('0xa')]('/',auth[_0x176c('0xb')](),controller['index']);router[_0x176c('0xa')](_0x176c('0xc'),auth['isAuthenticated'](),controller[_0x176c('0xd')]);router['get'](_0x176c('0xe'),auth['isAuthenticated'](),controller[_0x176c('0xf')]);router['post']('/',auth[_0x176c('0xb')](),controller[_0x176c('0x10')]);router[_0x176c('0x11')]('/:id/sub_intervals',auth[_0x176c('0xb')](),controller['addInterval']);router[_0x176c('0x11')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x176c('0x12')]);router[_0x176c('0x13')](_0x176c('0xc'),auth[_0x176c('0xb')](),controller['update']);router[_0x176c('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x176c('0x15')]);module[_0x176c('0x16')]=router; \ No newline at end of file +var _0xb453=['addIntervals','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many'];(function(_0x5808be,_0x500975){var _0x5c8c7c=function(_0x4e66a3){while(--_0x4e66a3){_0x5808be['push'](_0x5808be['shift']());}};_0x5c8c7c(++_0x500975);}(_0xb453,0x1e8));var _0x3b45=function(_0x17d861,_0x2e03b8){_0x17d861=_0x17d861-0x0;var _0x2e465f=_0xb453[_0x17d861];return _0x2e465f;};'use strict';var multer=require(_0x3b45('0x0'));var util=require(_0x3b45('0x1'));var path=require('path');var timeout=require(_0x3b45('0x2'));var express=require(_0x3b45('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3b45('0x4'));var interaction=require(_0x3b45('0x5'));var config=require(_0x3b45('0x6'));var controller=require(_0x3b45('0x7'));router[_0x3b45('0x8')]('/',auth[_0x3b45('0x9')](),controller[_0x3b45('0xa')]);router[_0x3b45('0x8')](_0x3b45('0xb'),auth[_0x3b45('0x9')](),controller['show']);router[_0x3b45('0x8')](_0x3b45('0xc'),auth[_0x3b45('0x9')](),controller[_0x3b45('0xd')]);router[_0x3b45('0xe')]('/',auth[_0x3b45('0x9')](),controller[_0x3b45('0xf')]);router['post'](_0x3b45('0xc'),auth['isAuthenticated'](),controller[_0x3b45('0x10')]);router[_0x3b45('0xe')](_0x3b45('0x11'),auth[_0x3b45('0x9')](),controller[_0x3b45('0x12')]);router['put']('/:id',auth[_0x3b45('0x9')](),controller[_0x3b45('0x13')]);router['delete'](_0x3b45('0xb'),auth[_0x3b45('0x9')](),controller[_0x3b45('0x14')]);module[_0x3b45('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index fc86128..666de45 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 _0xc307=['exports','STRING','sequelize'];(function(_0x2c1dd2,_0x276f59){var _0x3aa6ca=function(_0x20cdb5){while(--_0x20cdb5){_0x2c1dd2['push'](_0x2c1dd2['shift']());}};_0x3aa6ca(++_0x276f59);}(_0xc307,0x1ee));var _0x7c30=function(_0x5588e2,_0x2d3c94){_0x5588e2=_0x5588e2-0x0;var _0x5929e2=_0xc307[_0x5588e2];return _0x5929e2;};'use strict';var Sequelize=require(_0x7c30('0x0'));module[_0x7c30('0x1')]={'name':{'type':Sequelize[_0x7c30('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x7c30('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x14ef=['sequelize','exports','STRING'];(function(_0x33544e,_0x47092e){var _0x350ffe=function(_0x28f449){while(--_0x28f449){_0x33544e['push'](_0x33544e['shift']());}};_0x350ffe(++_0x47092e);}(_0x14ef,0xd8));var _0xf14e=function(_0x42b3aa,_0x223f53){_0x42b3aa=_0x42b3aa-0x0;var _0x319157=_0x14ef[_0x42b3aa];return _0x319157;};'use strict';var Sequelize=require(_0xf14e('0x0'));module[_0xf14e('0x1')]={'name':{'type':Sequelize[_0xf14e('0x2')]},'description':{'type':Sequelize[_0xf14e('0x2')]},'interval':{'type':Sequelize[_0xf14e('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 5c37aeb..2b4867f 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 _0xc9a2=['model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','body','getIntervals','options','findOne','sequelize','bulkCreate','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','reject','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key'];(function(_0x296c2e,_0x544ad4){var _0x38a0a9=function(_0x451efc){while(--_0x451efc){_0x296c2e['push'](_0x296c2e['shift']());}};_0x38a0a9(++_0x544ad4);}(_0xc9a2,0x7d));var _0x2c9a=function(_0x41cfb8,_0x5d5a8){_0x41cfb8=_0x41cfb8-0x0;var _0x472e1d=_0xc9a2[_0x41cfb8];return _0x472e1d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c9a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c9a('0x1'));var moment=require(_0x2c9a('0x2'));var BPromise=require(_0x2c9a('0x3'));var Mustache=require(_0x2c9a('0x4'));var util=require(_0x2c9a('0x5'));var path=require(_0x2c9a('0x6'));var sox=require(_0x2c9a('0x7'));var csv=require(_0x2c9a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c9a('0x9'));var _=require(_0x2c9a('0xa'));var squel=require(_0x2c9a('0xb'));var crypto=require(_0x2c9a('0xc'));var jsforce=require(_0x2c9a('0xd'));var deskjs=require(_0x2c9a('0xe'));var toCsv=require(_0x2c9a('0x8'));var querystring=require(_0x2c9a('0xf'));var Papa=require('papaparse');var Redis=require(_0x2c9a('0x10'));var authService=require(_0x2c9a('0x11'));var qs=require(_0x2c9a('0x12'));var as=require(_0x2c9a('0x13'));var hardwareService=require(_0x2c9a('0x14'));var logger=require(_0x2c9a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2c9a('0x16'));var licenseUtil=require(_0x2c9a('0x17'));var db=require(_0x2c9a('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x4f0a8c,_0x25567e){_0x25567e=_0x25567e||0xcc;return function(_0xffa866){if(_0xffa866){return _0x4f0a8c[_0x2c9a('0x19')](_0x25567e);}return _0x4f0a8c['status'](_0x25567e)[_0x2c9a('0x1a')]();};}function respondWithResult(_0x3fd575,_0x25de7d){_0x25de7d=_0x25de7d||0xc8;return function(_0x205063){if(_0x205063){return _0x3fd575[_0x2c9a('0x1b')](_0x25de7d)[_0x2c9a('0x1c')](_0x205063);}};}function respondWithFilteredResult(_0x4f7989,_0x3f4425){return function(_0x363593){if(_0x363593){var _0x4e4e32=typeof _0x3f4425[_0x2c9a('0x1d')]===_0x2c9a('0x1e')&&typeof _0x3f4425['limit']===_0x2c9a('0x1e');var _0x1a53e1=_0x363593[_0x2c9a('0x1f')];var _0x28d579=_0x4e4e32?0x0:_0x3f4425[_0x2c9a('0x1d')];var _0x333134=_0x4e4e32?_0x363593['count']:_0x3f4425['offset']+_0x3f4425[_0x2c9a('0x20')];var _0x248be9;if(_0x333134>=_0x1a53e1){_0x333134=_0x1a53e1;_0x248be9=0xc8;}else{_0x248be9=0xce;}_0x4f7989[_0x2c9a('0x1b')](_0x248be9);return _0x4f7989['set']('Content-Range',_0x28d579+'-'+_0x333134+'/'+_0x1a53e1)['json'](_0x363593);}return null;};}function patchUpdates(_0x54e94c){return function(_0x1f5884){try{jsonpatch['apply'](_0x1f5884,_0x54e94c,!![]);}catch(_0x2b08ba){return BPromise[_0x2c9a('0x21')](_0x2b08ba);}return _0x1f5884['save']();};}function saveUpdates(_0x1679b9,_0x6ee64a){return function(_0x8fe6e9){if(_0x8fe6e9){return _0x8fe6e9[_0x2c9a('0x22')](_0x1679b9)[_0x2c9a('0x23')](function(_0x5277a0){return _0x5277a0;});}return null;};}function removeEntity(_0x28229d,_0x253708){return function(_0x4bbc74){if(_0x4bbc74){return _0x4bbc74[_0x2c9a('0x24')]()[_0x2c9a('0x23')](function(){var _0x2fd50f=_0x4bbc74['get']({'plain':!![]});var _0x4256e3=_0x2c9a('0x25');return db[_0x2c9a('0x26')][_0x2c9a('0x24')]({'where':{'type':_0x4256e3,'resourceId':_0x2fd50f['id']}})[_0x2c9a('0x23')](function(){return _0x4bbc74;});})['then'](function(){_0x28229d[_0x2c9a('0x1b')](0xcc)[_0x2c9a('0x1a')]();});}};}function handleEntityNotFound(_0x438c41,_0x281bed){return function(_0x94399d){if(!_0x94399d){_0x438c41['sendStatus'](0x194);}return _0x94399d;};}function handleError(_0x283e6e,_0x58a777){_0x58a777=_0x58a777||0x1f4;return function(_0x15fa6a){logger[_0x2c9a('0x27')](_0x15fa6a[_0x2c9a('0x28')]);if(_0x15fa6a['name']){delete _0x15fa6a[_0x2c9a('0x29')];}_0x283e6e[_0x2c9a('0x1b')](_0x58a777)[_0x2c9a('0x2a')](_0x15fa6a);};}exports[_0x2c9a('0x2b')]=function(_0x32162a,_0x52eab0){var _0x441052={},_0x2ee4c7={},_0x79b815={'count':0x0,'rows':[]};var _0x11568c=_['map'](db[_0x2c9a('0x2c')][_0x2c9a('0x2d')],function(_0x3d730b){return{'name':_0x3d730b[_0x2c9a('0x2e')],'type':_0x3d730b[_0x2c9a('0x2f')][_0x2c9a('0x30')]};});_0x2ee4c7[_0x2c9a('0x31')]=_[_0x2c9a('0x32')](_0x11568c,_0x2c9a('0x29'));_0x2ee4c7[_0x2c9a('0x33')]=_['keys'](_0x32162a[_0x2c9a('0x33')]);_0x2ee4c7[_0x2c9a('0x34')]=_[_0x2c9a('0x35')](_0x2ee4c7['model'],_0x2ee4c7[_0x2c9a('0x33')]);_0x441052['attributes']=_[_0x2c9a('0x35')](_0x2ee4c7[_0x2c9a('0x31')],qs[_0x2c9a('0x36')](_0x32162a['query'][_0x2c9a('0x36')]));_0x441052[_0x2c9a('0x37')]=_0x441052['attributes']['length']?_0x441052[_0x2c9a('0x37')]:_0x2ee4c7[_0x2c9a('0x31')];if(!_0x32162a[_0x2c9a('0x33')][_0x2c9a('0x38')](_0x2c9a('0x39'))){_0x441052['limit']=qs[_0x2c9a('0x20')](_0x32162a[_0x2c9a('0x33')][_0x2c9a('0x20')]);_0x441052[_0x2c9a('0x1d')]=qs[_0x2c9a('0x1d')](_0x32162a['query']['offset']);}_0x441052[_0x2c9a('0x3a')]=qs['sort'](_0x32162a[_0x2c9a('0x33')][_0x2c9a('0x3b')]);_0x441052[_0x2c9a('0x3c')]=qs[_0x2c9a('0x34')](_[_0x2c9a('0x3d')](_0x32162a[_0x2c9a('0x33')],_0x2ee4c7[_0x2c9a('0x34')]),_0x11568c);if(_0x32162a['query']['filter']){_0x441052['where']=_[_0x2c9a('0x3e')](_0x441052[_0x2c9a('0x3c')],{'$or':_[_0x2c9a('0x32')](_0x11568c,function(_0x571f9c){if(_0x571f9c['type']!==_0x2c9a('0x3f')){var _0x5b6fdf={};_0x5b6fdf[_0x571f9c['name']]={'$like':'%'+_0x32162a['query'][_0x2c9a('0x40')]+'%'};return _0x5b6fdf;}})});}_0x441052=_[_0x2c9a('0x3e')]({},_0x441052,_0x32162a['options']);var _0x429fe7={'where':_0x441052[_0x2c9a('0x3c')]};return db['Interval']['count'](_0x429fe7)['then'](function(_0x59987f){_0x79b815['count']=_0x59987f;if(_0x32162a[_0x2c9a('0x33')]['includeAll']){_0x441052[_0x2c9a('0x41')]=[{'all':!![]}];}return db[_0x2c9a('0x2c')][_0x2c9a('0x42')](_0x441052);})[_0x2c9a('0x23')](function(_0x428772){_0x79b815[_0x2c9a('0x43')]=_0x428772;return _0x79b815;})[_0x2c9a('0x23')](respondWithFilteredResult(_0x52eab0,_0x441052))[_0x2c9a('0x44')](handleError(_0x52eab0,null));};exports[_0x2c9a('0x45')]=function(_0x2c64ac,_0x49ab1a){var _0x1c30a9={'raw':!![],'where':{'id':_0x2c64ac[_0x2c9a('0x46')]['id']}},_0x47fa61={};_0x47fa61['model']=_[_0x2c9a('0x47')](db[_0x2c9a('0x2c')][_0x2c9a('0x2d')]);_0x47fa61[_0x2c9a('0x33')]=_[_0x2c9a('0x47')](_0x2c64ac[_0x2c9a('0x33')]);_0x47fa61[_0x2c9a('0x34')]=_['intersection'](_0x47fa61[_0x2c9a('0x31')],_0x47fa61[_0x2c9a('0x33')]);_0x1c30a9['attributes']=_['intersection'](_0x47fa61[_0x2c9a('0x31')],qs[_0x2c9a('0x36')](_0x2c64ac[_0x2c9a('0x33')]['fields']));_0x1c30a9[_0x2c9a('0x37')]=_0x1c30a9[_0x2c9a('0x37')][_0x2c9a('0x48')]?_0x1c30a9[_0x2c9a('0x37')]:_0x47fa61['model'];if(_0x2c64ac[_0x2c9a('0x33')]['includeAll']){_0x1c30a9['include']=[{'all':!![]}];}_0x1c30a9=_[_0x2c9a('0x3e')]({},_0x1c30a9,_0x2c64ac['options']);return db[_0x2c9a('0x2c')]['find'](_0x1c30a9)[_0x2c9a('0x23')](handleEntityNotFound(_0x49ab1a,null))[_0x2c9a('0x23')](respondWithResult(_0x49ab1a,null))[_0x2c9a('0x44')](handleError(_0x49ab1a,null));};exports['create']=function(_0x4e50c7,_0x1ba9ac){return db['Interval'][_0x2c9a('0x49')](_0x4e50c7['body'],{})['then'](function(_0x4983d4){var _0xcf8adf=_0x4e50c7[_0x2c9a('0x4a')][_0x2c9a('0x4b')]({'plain':!![]});if(!_0xcf8adf)throw new Error(_0x2c9a('0x4c'));if(_0xcf8adf[_0x2c9a('0x4d')]===_0x2c9a('0x4a')){var _0x3bd5ac=_0x4983d4['get']({'plain':!![]});var _0x457867=_0x2c9a('0x25');return db[_0x2c9a('0x4e')][_0x2c9a('0x4f')]({'where':{'name':_0x457867,'userProfileId':_0xcf8adf[_0x2c9a('0x50')]},'raw':!![]})[_0x2c9a('0x23')](function(_0x246c93){if(_0x246c93&&_0x246c93['autoAssociation']===0x0){return db['UserProfileResource'][_0x2c9a('0x49')]({'name':_0x3bd5ac[_0x2c9a('0x29')],'resourceId':_0x3bd5ac['id'],'type':_0x246c93[_0x2c9a('0x29')],'sectionId':_0x246c93['id']},{})[_0x2c9a('0x23')](function(){return _0x4983d4;});}else{return _0x4983d4;}})[_0x2c9a('0x44')](function(_0x457aac){logger[_0x2c9a('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x457aac);throw _0x457aac;});}return _0x4983d4;})[_0x2c9a('0x23')](respondWithResult(_0x1ba9ac,0xc9))[_0x2c9a('0x44')](handleError(_0x1ba9ac,null));};exports['update']=function(_0x385f34,_0x36e7a1){if(_0x385f34[_0x2c9a('0x51')]['id']){delete _0x385f34[_0x2c9a('0x51')]['id'];}return db[_0x2c9a('0x2c')]['find']({'where':{'id':_0x385f34['params']['id']}})[_0x2c9a('0x23')](handleEntityNotFound(_0x36e7a1,null))[_0x2c9a('0x23')](saveUpdates(_0x385f34[_0x2c9a('0x51')],null))['then'](respondWithResult(_0x36e7a1,null))['catch'](handleError(_0x36e7a1,null));};exports[_0x2c9a('0x24')]=function(_0x22b30a,_0xb0cac){return db[_0x2c9a('0x2c')][_0x2c9a('0x4f')]({'where':{'id':_0x22b30a[_0x2c9a('0x46')]['id']}})[_0x2c9a('0x23')](handleEntityNotFound(_0xb0cac,null))[_0x2c9a('0x23')](removeEntity(_0xb0cac,null))[_0x2c9a('0x44')](handleError(_0xb0cac,null));};exports['addInterval']=function(_0x1dd05a,_0xa9a3b5,_0x4353ee){if(_0x1dd05a[_0x2c9a('0x51')]['id']){delete _0x1dd05a[_0x2c9a('0x51')]['id'];}return db[_0x2c9a('0x2c')][_0x2c9a('0x4f')]({'where':{'id':_0x1dd05a[_0x2c9a('0x46')]['id']}})[_0x2c9a('0x23')](handleEntityNotFound(_0xa9a3b5,null))[_0x2c9a('0x23')](function(_0x2d26fd){if(_0x2d26fd){_0x1dd05a[_0x2c9a('0x51')]['IntervalId']=_0x2d26fd['id'];return db[_0x2c9a('0x2c')][_0x2c9a('0x49')](_0x1dd05a['body']);}})['then'](respondWithResult(_0xa9a3b5,null))['catch'](handleError(_0xa9a3b5,null));};exports[_0x2c9a('0x52')]=function(_0x5a192d,_0x49e688,_0x2bbb9f){var _0x4866b7={};var _0x5db40f={};var _0x5b70c2;var _0x4ceb9f;return db[_0x2c9a('0x2c')]['findOne']({'where':{'id':_0x5a192d['params']['id']}})[_0x2c9a('0x23')](handleEntityNotFound(_0x49e688,null))['then'](function(_0x5a93c3){if(_0x5a93c3){_0x5b70c2=_0x5a93c3;_0x5db40f[_0x2c9a('0x31')]=_[_0x2c9a('0x47')](db[_0x2c9a('0x2c')][_0x2c9a('0x2d')]);_0x5db40f[_0x2c9a('0x33')]=_['keys'](_0x5a192d[_0x2c9a('0x33')]);_0x5db40f[_0x2c9a('0x34')]=_[_0x2c9a('0x35')](_0x5db40f[_0x2c9a('0x31')],_0x5db40f[_0x2c9a('0x33')]);_0x4866b7[_0x2c9a('0x37')]=_[_0x2c9a('0x35')](_0x5db40f[_0x2c9a('0x31')],qs[_0x2c9a('0x36')](_0x5a192d[_0x2c9a('0x33')][_0x2c9a('0x36')]));_0x4866b7[_0x2c9a('0x37')]=_0x4866b7[_0x2c9a('0x37')][_0x2c9a('0x48')]?_0x4866b7[_0x2c9a('0x37')]:_0x5db40f[_0x2c9a('0x31')];_0x4866b7[_0x2c9a('0x3a')]=qs[_0x2c9a('0x3b')](_0x5a192d[_0x2c9a('0x33')][_0x2c9a('0x3b')]);_0x4866b7[_0x2c9a('0x3c')]=qs['filters'](_[_0x2c9a('0x3d')](_0x5a192d[_0x2c9a('0x33')],_0x5db40f['filters']));if(_0x5a192d[_0x2c9a('0x33')][_0x2c9a('0x40')]){_0x4866b7[_0x2c9a('0x3c')]=_[_0x2c9a('0x3e')](_0x4866b7[_0x2c9a('0x3c')],{'$or':_[_0x2c9a('0x32')](_0x4866b7[_0x2c9a('0x37')],function(_0x2c0ea5){var _0x4c8570={};_0x4c8570[_0x2c0ea5]={'$like':'%'+_0x5a192d[_0x2c9a('0x33')]['filter']+'%'};return _0x4c8570;})});}_0x4866b7=_[_0x2c9a('0x3e')]({},_0x4866b7,_0x5a192d[_0x2c9a('0x53')]);return _0x5b70c2[_0x2c9a('0x52')](_0x4866b7);}})[_0x2c9a('0x23')](function(_0xec3a3d){if(_0xec3a3d){_0x4ceb9f=_0xec3a3d['length'];if(!_0x5a192d[_0x2c9a('0x33')][_0x2c9a('0x38')]('nolimit')){_0x4866b7[_0x2c9a('0x20')]=qs[_0x2c9a('0x20')](_0x5a192d[_0x2c9a('0x33')][_0x2c9a('0x20')]);_0x4866b7['offset']=qs[_0x2c9a('0x1d')](_0x5a192d['query'][_0x2c9a('0x1d')]);}return _0x5b70c2[_0x2c9a('0x52')](_0x4866b7);}})[_0x2c9a('0x23')](function(_0x588551){if(_0x588551){return _0x588551?{'count':_0x4ceb9f,'rows':_0x588551}:null;}})[_0x2c9a('0x23')](respondWithResult(_0x49e688,null))['catch'](handleError(_0x49e688,null));};exports['addIntervals']=function(_0x230621,_0x4c1b1b,_0x22f692){return db[_0x2c9a('0x2c')][_0x2c9a('0x54')]({'where':{'id':_0x230621[_0x2c9a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4c1b1b,null))[_0x2c9a('0x23')](function(_0x584751){if(_0x584751){return db[_0x2c9a('0x55')]['transaction'](function(_0x1d0dbc){return db[_0x2c9a('0x2c')][_0x2c9a('0x24')]({'where':{'IntervalId':_0x230621[_0x2c9a('0x46')]['id']},'transaction':_0x1d0dbc})[_0x2c9a('0x23')](function(_0x1a42ce){var _0x297ec4=_['map'](_0x230621['body'],function(_0x1073cd){delete _0x1073cd['id'];_0x1073cd['IntervalId']=_0x230621['params']['id'];return _0x1073cd;});return db[_0x2c9a('0x2c')][_0x2c9a('0x56')](_0x297ec4,{'transaction':_0x1d0dbc});});})[_0x2c9a('0x23')](function(){return db[_0x2c9a('0x2c')]['findAll']({'where':{'IntervalId':_0x230621[_0x2c9a('0x46')]['id']}});});}})[_0x2c9a('0x23')](respondWithResult(_0x4c1b1b,null))[_0x2c9a('0x44')](handleError(_0x4c1b1b,null));}; \ No newline at end of file +var _0x5cee=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','addInterval','IntervalId','findOne','pick','filter','getIntervals','addIntervals','sequelize','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','offset','limit','undefined','set','json','apply','save','update','then','get','Intervals','UserProfileResource','destroy','end','error','stack','send','index','map','Interval','type','name','query','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','count','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','fields','options','find','create'];(function(_0x21a02d,_0x3c0d21){var _0x5772e5=function(_0xc19541){while(--_0xc19541){_0x21a02d['push'](_0x21a02d['shift']());}};_0x5772e5(++_0x3c0d21);}(_0x5cee,0xc2));var _0xe5ce=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x5cee[_0x580647];return _0x5f0792;};'use strict';var emlformat=require(_0xe5ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5ce('0x1'));var jsonpatch=require(_0xe5ce('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe5ce('0x3'));var Mustache=require(_0xe5ce('0x4'));var util=require(_0xe5ce('0x5'));var path=require(_0xe5ce('0x6'));var sox=require('sox');var csv=require(_0xe5ce('0x7'));var ejs=require(_0xe5ce('0x8'));var fs=require('fs');var fs_extra=require(_0xe5ce('0x9'));var _=require(_0xe5ce('0xa'));var squel=require(_0xe5ce('0xb'));var crypto=require(_0xe5ce('0xc'));var jsforce=require(_0xe5ce('0xd'));var deskjs=require(_0xe5ce('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe5ce('0xf'));var Papa=require(_0xe5ce('0x10'));var Redis=require(_0xe5ce('0x11'));var authService=require(_0xe5ce('0x12'));var qs=require(_0xe5ce('0x13'));var as=require(_0xe5ce('0x14'));var hardwareService=require(_0xe5ce('0x15'));var logger=require(_0xe5ce('0x16'))(_0xe5ce('0x17'));var utils=require('../../config/utils');var config=require(_0xe5ce('0x18'));var licenseUtil=require(_0xe5ce('0x19'));var db=require('../../mysqldb')['db'];var extensions=require(_0xe5ce('0x1a'));function respondWithStatusCode(_0x1d285c,_0x40ea4a){_0x40ea4a=_0x40ea4a||0xcc;return function(_0x487b68){if(_0x487b68){return _0x1d285c[_0xe5ce('0x1b')](_0x40ea4a);}return _0x1d285c[_0xe5ce('0x1c')](_0x40ea4a)['end']();};}function respondWithResult(_0x1dc6eb,_0xca3e7f){_0xca3e7f=_0xca3e7f||0xc8;return function(_0x2c0a66){if(_0x2c0a66){return _0x1dc6eb['status'](_0xca3e7f)['json'](_0x2c0a66);}};}function respondWithFilteredResult(_0x122092,_0x254392){return function(_0x481258){if(_0x481258){var _0x57713a=typeof _0x254392[_0xe5ce('0x1d')]==='undefined'&&typeof _0x254392[_0xe5ce('0x1e')]===_0xe5ce('0x1f');var _0x20aae3=_0x481258['count'];var _0x15e7ec=_0x57713a?0x0:_0x254392[_0xe5ce('0x1d')];var _0x51738c=_0x57713a?_0x481258['count']:_0x254392[_0xe5ce('0x1d')]+_0x254392['limit'];var _0x582c01;if(_0x51738c>=_0x20aae3){_0x51738c=_0x20aae3;_0x582c01=0xc8;}else{_0x582c01=0xce;}_0x122092[_0xe5ce('0x1c')](_0x582c01);return _0x122092[_0xe5ce('0x20')]('Content-Range',_0x15e7ec+'-'+_0x51738c+'/'+_0x20aae3)[_0xe5ce('0x21')](_0x481258);}return null;};}function patchUpdates(_0x4bcb04){return function(_0x1bc525){try{jsonpatch[_0xe5ce('0x22')](_0x1bc525,_0x4bcb04,!![]);}catch(_0x5cd33e){return BPromise['reject'](_0x5cd33e);}return _0x1bc525[_0xe5ce('0x23')]();};}function saveUpdates(_0x49f7c6,_0xac84ab){return function(_0x39a078){if(_0x39a078){return _0x39a078[_0xe5ce('0x24')](_0x49f7c6)['then'](function(_0x2d9eaf){return _0x2d9eaf;});}return null;};}function removeEntity(_0x38ac4c,_0x4b0ef1){return function(_0x3e10c5){if(_0x3e10c5){return _0x3e10c5['destroy']()[_0xe5ce('0x25')](function(){var _0x4aa0ef=_0x3e10c5[_0xe5ce('0x26')]({'plain':!![]});var _0x2e4f2c=_0xe5ce('0x27');return db[_0xe5ce('0x28')][_0xe5ce('0x29')]({'where':{'type':_0x2e4f2c,'resourceId':_0x4aa0ef['id']}})[_0xe5ce('0x25')](function(){return _0x3e10c5;});})[_0xe5ce('0x25')](function(){_0x38ac4c[_0xe5ce('0x1c')](0xcc)[_0xe5ce('0x2a')]();});}};}function handleEntityNotFound(_0x4ccb43,_0x86a04){return function(_0x100e54){if(!_0x100e54){_0x4ccb43[_0xe5ce('0x1b')](0x194);}return _0x100e54;};}function handleError(_0x5a8d3b,_0x13161c){_0x13161c=_0x13161c||0x1f4;return function(_0x21d186){logger[_0xe5ce('0x2b')](_0x21d186[_0xe5ce('0x2c')]);if(_0x21d186['name']){delete _0x21d186['name'];}_0x5a8d3b[_0xe5ce('0x1c')](_0x13161c)[_0xe5ce('0x2d')](_0x21d186);};}exports[_0xe5ce('0x2e')]=function(_0x310029,_0x5215e2){var _0x5e739a={},_0x25a6e7={},_0x12b385={'count':0x0,'rows':[]};var _0x3529ca=_[_0xe5ce('0x2f')](db[_0xe5ce('0x30')]['rawAttributes'],function(_0x34a9a6){return{'name':_0x34a9a6['fieldName'],'type':_0x34a9a6[_0xe5ce('0x31')]['key']};});_0x25a6e7['model']=_[_0xe5ce('0x2f')](_0x3529ca,_0xe5ce('0x32'));_0x25a6e7['query']=_['keys'](_0x310029[_0xe5ce('0x33')]);_0x25a6e7['filters']=_[_0xe5ce('0x34')](_0x25a6e7['model'],_0x25a6e7[_0xe5ce('0x33')]);_0x5e739a[_0xe5ce('0x35')]=_[_0xe5ce('0x34')](_0x25a6e7[_0xe5ce('0x36')],qs['fields'](_0x310029[_0xe5ce('0x33')]['fields']));_0x5e739a[_0xe5ce('0x35')]=_0x5e739a[_0xe5ce('0x35')][_0xe5ce('0x37')]?_0x5e739a[_0xe5ce('0x35')]:_0x25a6e7[_0xe5ce('0x36')];if(!_0x310029[_0xe5ce('0x33')][_0xe5ce('0x38')](_0xe5ce('0x39'))){_0x5e739a[_0xe5ce('0x1e')]=qs['limit'](_0x310029[_0xe5ce('0x33')][_0xe5ce('0x1e')]);_0x5e739a[_0xe5ce('0x1d')]=qs[_0xe5ce('0x1d')](_0x310029['query'][_0xe5ce('0x1d')]);}_0x5e739a[_0xe5ce('0x3a')]=qs[_0xe5ce('0x3b')](_0x310029[_0xe5ce('0x33')][_0xe5ce('0x3b')]);_0x5e739a[_0xe5ce('0x3c')]=qs[_0xe5ce('0x3d')](_['pick'](_0x310029[_0xe5ce('0x33')],_0x25a6e7[_0xe5ce('0x3d')]),_0x3529ca);if(_0x310029[_0xe5ce('0x33')]['filter']){_0x5e739a[_0xe5ce('0x3c')]=_[_0xe5ce('0x3e')](_0x5e739a[_0xe5ce('0x3c')],{'$or':_[_0xe5ce('0x2f')](_0x3529ca,function(_0x4e8b63){if(_0x4e8b63[_0xe5ce('0x31')]!=='VIRTUAL'){var _0x208af5={};_0x208af5[_0x4e8b63[_0xe5ce('0x32')]]={'$like':'%'+_0x310029[_0xe5ce('0x33')]['filter']+'%'};return _0x208af5;}})});}_0x5e739a=_[_0xe5ce('0x3e')]({},_0x5e739a,_0x310029['options']);var _0x506cec={'where':_0x5e739a[_0xe5ce('0x3c')]};return db[_0xe5ce('0x30')][_0xe5ce('0x3f')](_0x506cec)[_0xe5ce('0x25')](function(_0x925093){_0x12b385['count']=_0x925093;if(_0x310029[_0xe5ce('0x33')][_0xe5ce('0x40')]){_0x5e739a[_0xe5ce('0x41')]=[{'all':!![]}];}return db['Interval'][_0xe5ce('0x42')](_0x5e739a);})[_0xe5ce('0x25')](function(_0x4ef25f){_0x12b385[_0xe5ce('0x43')]=_0x4ef25f;return _0x12b385;})[_0xe5ce('0x25')](respondWithFilteredResult(_0x5215e2,_0x5e739a))[_0xe5ce('0x44')](handleError(_0x5215e2,null));};exports['show']=function(_0x1676df,_0x1a2669){var _0x3de7ed={'raw':!![],'where':{'id':_0x1676df[_0xe5ce('0x45')]['id']}},_0xfb5c03={};_0xfb5c03[_0xe5ce('0x36')]=_['keys'](db['Interval'][_0xe5ce('0x46')]);_0xfb5c03[_0xe5ce('0x33')]=_[_0xe5ce('0x47')](_0x1676df['query']);_0xfb5c03[_0xe5ce('0x3d')]=_[_0xe5ce('0x34')](_0xfb5c03[_0xe5ce('0x36')],_0xfb5c03[_0xe5ce('0x33')]);_0x3de7ed[_0xe5ce('0x35')]=_[_0xe5ce('0x34')](_0xfb5c03['model'],qs[_0xe5ce('0x48')](_0x1676df['query']['fields']));_0x3de7ed[_0xe5ce('0x35')]=_0x3de7ed['attributes']['length']?_0x3de7ed['attributes']:_0xfb5c03['model'];if(_0x1676df[_0xe5ce('0x33')]['includeAll']){_0x3de7ed[_0xe5ce('0x41')]=[{'all':!![]}];}_0x3de7ed=_['merge']({},_0x3de7ed,_0x1676df[_0xe5ce('0x49')]);return db[_0xe5ce('0x30')][_0xe5ce('0x4a')](_0x3de7ed)[_0xe5ce('0x25')](handleEntityNotFound(_0x1a2669,null))['then'](respondWithResult(_0x1a2669,null))['catch'](handleError(_0x1a2669,null));};exports[_0xe5ce('0x4b')]=function(_0x55a12d,_0x255029){return db[_0xe5ce('0x30')][_0xe5ce('0x4b')](_0x55a12d[_0xe5ce('0x4c')],{})[_0xe5ce('0x25')](function(_0x2a68a1){var _0x230e48=_0x55a12d['user'][_0xe5ce('0x26')]({'plain':!![]});if(!_0x230e48)throw new Error(_0xe5ce('0x4d'));if(_0x230e48[_0xe5ce('0x4e')]===_0xe5ce('0x4f')){var _0x19afa8=_0x2a68a1[_0xe5ce('0x26')]({'plain':!![]});var _0x315947=_0xe5ce('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x315947,'userProfileId':_0x230e48[_0xe5ce('0x50')]},'raw':!![]})['then'](function(_0x4fe82b){if(_0x4fe82b&&_0x4fe82b[_0xe5ce('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x19afa8[_0xe5ce('0x32')],'resourceId':_0x19afa8['id'],'type':_0x4fe82b['name'],'sectionId':_0x4fe82b['id']},{})[_0xe5ce('0x25')](function(){return _0x2a68a1;});}else{return _0x2a68a1;}})[_0xe5ce('0x44')](function(_0x496332){logger[_0xe5ce('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x496332);throw _0x496332;});}return _0x2a68a1;})[_0xe5ce('0x25')](respondWithResult(_0x255029,0xc9))[_0xe5ce('0x44')](handleError(_0x255029,null));};exports[_0xe5ce('0x24')]=function(_0x2914f9,_0x41c8f6){if(_0x2914f9['body']['id']){delete _0x2914f9[_0xe5ce('0x4c')]['id'];}return db[_0xe5ce('0x30')]['find']({'where':{'id':_0x2914f9['params']['id']}})['then'](handleEntityNotFound(_0x41c8f6,null))[_0xe5ce('0x25')](saveUpdates(_0x2914f9[_0xe5ce('0x4c')],null))[_0xe5ce('0x25')](respondWithResult(_0x41c8f6,null))['catch'](handleError(_0x41c8f6,null));};exports[_0xe5ce('0x29')]=function(_0x3b399e,_0x176527){return db[_0xe5ce('0x30')]['find']({'where':{'id':_0x3b399e[_0xe5ce('0x45')]['id']}})[_0xe5ce('0x25')](handleEntityNotFound(_0x176527,null))[_0xe5ce('0x25')](removeEntity(_0x176527,null))[_0xe5ce('0x44')](handleError(_0x176527,null));};exports[_0xe5ce('0x52')]=function(_0x4f293a,_0x2153c5,_0x52567d){if(_0x4f293a[_0xe5ce('0x4c')]['id']){delete _0x4f293a[_0xe5ce('0x4c')]['id'];}return db[_0xe5ce('0x30')][_0xe5ce('0x4a')]({'where':{'id':_0x4f293a[_0xe5ce('0x45')]['id']}})['then'](handleEntityNotFound(_0x2153c5,null))['then'](function(_0x4eb1a6){if(_0x4eb1a6){_0x4f293a['body'][_0xe5ce('0x53')]=_0x4eb1a6['id'];return db['Interval'][_0xe5ce('0x4b')](_0x4f293a['body']);}})[_0xe5ce('0x25')](respondWithResult(_0x2153c5,null))['catch'](handleError(_0x2153c5,null));};exports['getIntervals']=function(_0x3f2d72,_0x312af2,_0x3016a1){var _0x56d5f6={};var _0x2b0a28={};var _0x56c12;var _0x1b90be;return db[_0xe5ce('0x30')][_0xe5ce('0x54')]({'where':{'id':_0x3f2d72[_0xe5ce('0x45')]['id']}})[_0xe5ce('0x25')](handleEntityNotFound(_0x312af2,null))[_0xe5ce('0x25')](function(_0x4cfe22){if(_0x4cfe22){_0x56c12=_0x4cfe22;_0x2b0a28[_0xe5ce('0x36')]=_[_0xe5ce('0x47')](db[_0xe5ce('0x30')][_0xe5ce('0x46')]);_0x2b0a28[_0xe5ce('0x33')]=_['keys'](_0x3f2d72[_0xe5ce('0x33')]);_0x2b0a28[_0xe5ce('0x3d')]=_[_0xe5ce('0x34')](_0x2b0a28[_0xe5ce('0x36')],_0x2b0a28['query']);_0x56d5f6[_0xe5ce('0x35')]=_[_0xe5ce('0x34')](_0x2b0a28[_0xe5ce('0x36')],qs[_0xe5ce('0x48')](_0x3f2d72['query'][_0xe5ce('0x48')]));_0x56d5f6['attributes']=_0x56d5f6[_0xe5ce('0x35')][_0xe5ce('0x37')]?_0x56d5f6[_0xe5ce('0x35')]:_0x2b0a28['model'];_0x56d5f6[_0xe5ce('0x3a')]=qs[_0xe5ce('0x3b')](_0x3f2d72[_0xe5ce('0x33')][_0xe5ce('0x3b')]);_0x56d5f6['where']=qs[_0xe5ce('0x3d')](_[_0xe5ce('0x55')](_0x3f2d72[_0xe5ce('0x33')],_0x2b0a28['filters']));if(_0x3f2d72[_0xe5ce('0x33')][_0xe5ce('0x56')]){_0x56d5f6[_0xe5ce('0x3c')]=_[_0xe5ce('0x3e')](_0x56d5f6[_0xe5ce('0x3c')],{'$or':_[_0xe5ce('0x2f')](_0x56d5f6[_0xe5ce('0x35')],function(_0x1b0a0e){var _0xbb1b14={};_0xbb1b14[_0x1b0a0e]={'$like':'%'+_0x3f2d72[_0xe5ce('0x33')][_0xe5ce('0x56')]+'%'};return _0xbb1b14;})});}_0x56d5f6=_[_0xe5ce('0x3e')]({},_0x56d5f6,_0x3f2d72[_0xe5ce('0x49')]);return _0x56c12[_0xe5ce('0x57')](_0x56d5f6);}})[_0xe5ce('0x25')](function(_0x20c05c){if(_0x20c05c){_0x1b90be=_0x20c05c[_0xe5ce('0x37')];if(!_0x3f2d72[_0xe5ce('0x33')][_0xe5ce('0x38')]('nolimit')){_0x56d5f6[_0xe5ce('0x1e')]=qs['limit'](_0x3f2d72[_0xe5ce('0x33')][_0xe5ce('0x1e')]);_0x56d5f6[_0xe5ce('0x1d')]=qs[_0xe5ce('0x1d')](_0x3f2d72[_0xe5ce('0x33')]['offset']);}return _0x56c12['getIntervals'](_0x56d5f6);}})[_0xe5ce('0x25')](function(_0xc56de){if(_0xc56de){return _0xc56de?{'count':_0x1b90be,'rows':_0xc56de}:null;}})[_0xe5ce('0x25')](respondWithResult(_0x312af2,null))[_0xe5ce('0x44')](handleError(_0x312af2,null));};exports[_0xe5ce('0x58')]=function(_0x21b1b1,_0x378556,_0x28a341){return db[_0xe5ce('0x30')]['findOne']({'where':{'id':_0x21b1b1[_0xe5ce('0x45')]['id']}})[_0xe5ce('0x25')](handleEntityNotFound(_0x378556,null))['then'](function(_0x13d4c0){if(_0x13d4c0){return db[_0xe5ce('0x59')]['transaction'](function(_0x1ae56b){return db[_0xe5ce('0x30')]['destroy']({'where':{'IntervalId':_0x21b1b1[_0xe5ce('0x45')]['id']},'transaction':_0x1ae56b})[_0xe5ce('0x25')](function(_0x4fa2b2){var _0x26ceb4=_[_0xe5ce('0x2f')](_0x21b1b1[_0xe5ce('0x4c')],function(_0x7443a3){delete _0x7443a3['id'];_0x7443a3['IntervalId']=_0x21b1b1[_0xe5ce('0x45')]['id'];return _0x7443a3;});return db[_0xe5ce('0x30')]['bulkCreate'](_0x26ceb4,{'transaction':_0x1ae56b});});})[_0xe5ce('0x25')](function(){return db[_0xe5ce('0x30')][_0xe5ce('0x42')]({'where':{'IntervalId':_0x21b1b1[_0xe5ce('0x45')]['id']}});});}})[_0xe5ce('0x25')](respondWithResult(_0x378556,null))['catch'](handleError(_0x378556,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index bb9821e..92ad9ab 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 _0x392c=['define','tools_intervals','rewrite','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0xa68dd2,_0x1eb5c5){var _0x4c33f9=function(_0x493a3c){while(--_0x493a3c){_0xa68dd2['push'](_0xa68dd2['shift']());}};_0x4c33f9(++_0x1eb5c5);}(_0x392c,0x162));var _0xc392=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x392c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xc392('0x0'));var logger=require(_0xc392('0x1'))('api');var moment=require(_0xc392('0x2'));var BPromise=require(_0xc392('0x3'));var rp=require(_0xc392('0x4'));var fs=require('fs');var path=require(_0xc392('0x5'));var rimraf=require('rimraf');var config=require(_0xc392('0x6'));var attributes=require(_0xc392('0x7'));var extensions=require(_0xc392('0x8'));module[_0xc392('0x9')]=function(_0x55f94b,_0x18df4a){return _0x55f94b[_0xc392('0xa')]('Interval',attributes,{'tableName':_0xc392('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f3bf7,_0x23bcf4){extensions[_0xc392('0xc')](_0x55f94b,_0x5f3bf7);},'afterBulkCreate':function(_0x5533d8,_0x5dbf7c,_0x58c3ea){_0x58c3ea();extensions[_0xc392('0xc')](_0x55f94b,_0x5533d8[0x0]);},'afterUpdate':function(_0x5e7be7,_0x2393ff){extensions[_0xc392('0xc')](_0x55f94b,_0x5e7be7);},'afterDestroy':function(_0x48dfd6,_0x25b1ca){extensions[_0xc392('0xc')](_0x55f94b,_0x48dfd6);}}});}; \ No newline at end of file +var _0xc891=['tools_intervals','rewrite','lodash','api','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x13ad15,_0x19d7eb){var _0x3de641=function(_0x4a3788){while(--_0x4a3788){_0x13ad15['push'](_0x13ad15['shift']());}};_0x3de641(++_0x19d7eb);}(_0xc891,0x152));var _0x1c89=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xc891[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require(_0x1c89('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1c89('0x1'));var moment=require('moment');var BPromise=require(_0x1c89('0x2'));var rp=require(_0x1c89('0x3'));var fs=require('fs');var path=require(_0x1c89('0x4'));var rimraf=require('rimraf');var config=require(_0x1c89('0x5'));var attributes=require(_0x1c89('0x6'));var extensions=require(_0x1c89('0x7'));module[_0x1c89('0x8')]=function(_0x5c9cb9,_0x14436b){return _0x5c9cb9[_0x1c89('0x9')]('Interval',attributes,{'tableName':_0x1c89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x300289,_0x4faab7){extensions[_0x1c89('0xb')](_0x5c9cb9,_0x300289);},'afterBulkCreate':function(_0x4e9b16,_0x21f69d,_0x4a9ffa){_0x4a9ffa();extensions['rewrite'](_0x5c9cb9,_0x4e9b16[0x0]);},'afterUpdate':function(_0x4c69e3,_0x478ca1){extensions[_0x1c89('0xb')](_0x5c9cb9,_0x4c69e3);},'afterDestroy':function(_0x59f701,_0x289f67){extensions[_0x1c89('0xb')](_0x5c9cb9,_0x59f701);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 578631f..da903c1 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(_0x4429e0,_0xee6f1f){var _0x51a5b3=function(_0x16eb11){while(--_0x16eb11){_0x4429e0['push'](_0x4429e0['shift']());}};_0x51a5b3(++_0xee6f1f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 f6dbca2..80488ed 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x0b0e[_0x5519a9];return _0x32f2cc;};'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 +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x105a12,_0x3eb620){var _0x4308ed=function(_0x7b3f6){while(--_0x7b3f6){_0x105a12['push'](_0x105a12['shift']());}};_0x4308ed(++_0x3eb620);}(_0xadb5,0xad));var _0x5adb=function(_0x487b17,_0x108d67){_0x487b17=_0x487b17-0x0;var _0x39c198=_0xadb5[_0x487b17];return _0x39c198;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index bfe6ac0..1d89d81 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 _0xaada=['name','reason','customfield_10102','track.xcallymotion.com','POST','application/json','toString','base64','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','openIssue','send','headers','connection','remoteAddress','body','api','key','MOTGUI','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503'];(function(_0x139ff6,_0xddca5){var _0x71b083=function(_0x4cf27a){while(--_0x4cf27a){_0x139ff6['push'](_0x139ff6['shift']());}};_0x71b083(++_0xddca5);}(_0xaada,0xc1));var _0xaaad=function(_0x8f8ff,_0x5198ad){_0x8f8ff=_0x8f8ff-0x0;var _0x590623=_0xaada[_0x8f8ff];return _0x590623;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')(_0xaaad('0x0'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x475db0,_0xa21622){var _0x5d259e={'fields':{'project':{'key':_0x475db0[_0xaaad('0x1')]||_0xaaad('0x2')},'summary':(_0x475db0[_0xaaad('0x3')]||'Report')+_0xaaad('0x4')+_0x475db0['ip'],'description':_0x475db0[_0xaaad('0x5')]||JSON[_0xaaad('0x6')](_0x475db0),'issuetype':{'name':_0x475db0[_0xaaad('0x7')]||_0xaaad('0x8')}}};_0x5d259e[_0xaaad('0x9')][_0xaaad('0xa')]=_0x475db0[_0xaaad('0xb')];_0x5d259e['fields'][_0xaaad('0xc')]=_0x475db0[_0xaaad('0xd')];_0x5d259e[_0xaaad('0x9')][_0xaaad('0xe')]=_0x475db0[_0xaaad('0xf')];_0x5d259e['fields'][_0xaaad('0x10')]=_0x475db0[_0xaaad('0x11')];_0x5d259e[_0xaaad('0x9')]['customfield_11504']=_0x475db0[_0xaaad('0x12')];_0x5d259e[_0xaaad('0x9')][_0xaaad('0x13')]=_0x475db0['ip'];var _0x4ee89b={'host':_0xaaad('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0xaaad('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xaaad('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xaaad('0x17')](_0xaaad('0x18'))}};var _0x39dcc9=JSON[_0xaaad('0x6')](_0x5d259e);var _0x4cf509=https['request'](_0x4ee89b,function(_0xb5f2bd){_0xb5f2bd[_0xaaad('0x19')](_0xaaad('0x1a'));var _0x14136c='';_0xb5f2bd['on'](_0xaaad('0x1b'),function(_0x556de4){_0x14136c+=_0x556de4;});_0xb5f2bd['on']('end',function(){if(_0xa21622){return _0xa21622[_0xaaad('0x1c')](_0xb5f2bd[_0xaaad('0x1d')])[_0xaaad('0x1e')](JSON[_0xaaad('0x1f')](_0x14136c));}});});_0x4cf509['on'](_0xaaad('0x20'),function(_0xa949ff){if(_0xa21622){return _0xa21622[_0xaaad('0x1c')](0x1f4)[_0xaaad('0x1e')]({'errors':[{'message':_0xaaad('0x21'),'type':_0xaaad('0x22')}]});}});_0x4cf509['write'](_0x39dcc9);_0x4cf509[_0xaaad('0x23')]();}exports[_0xaaad('0x24')]=openIssue;exports[_0xaaad('0x25')]=function(_0x5cdcc3,_0x38940a){_0x5cdcc3['body']['ip']=_0x5cdcc3[_0xaaad('0x26')]['x-forwarded-for']||_0x5cdcc3[_0xaaad('0x27')]['remoteAddress']||_0x5cdcc3['socket'][_0xaaad('0x28')]||_0x5cdcc3[_0xaaad('0x27')]['socket']['remoteAddress'];return openIssue(_0x5cdcc3[_0xaaad('0x29')],_0x38940a);}; \ No newline at end of file +var _0x3cc6=['summary','Report','stringify','issuetype','customfield_11500','fields','customfield_11501','oldToken','newToken','name','customfield_11504','track.xcallymotion.com','/rest/api/2/issue','application/json','toString','request','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI'];(function(_0x1918cb,_0x5b8fc0){var _0x5bf8e8=function(_0x3279eb){while(--_0x3279eb){_0x1918cb['push'](_0x1918cb['shift']());}};_0x5bf8e8(++_0x5b8fc0);}(_0x3cc6,0x146));var _0x63cc=function(_0x486112,_0x1c7f96){_0x486112=_0x486112-0x0;var _0x125e77=_0x3cc6[_0x486112];return _0x125e77;};'use strict';var BPromise=require(_0x63cc('0x0'));var https=require('https');var logger=require(_0x63cc('0x1'))(_0x63cc('0x2'));var USERNAME=_0x63cc('0x3');var PASSWORD=_0x63cc('0x4');function openIssue(_0x52c444,_0x3e1017){var _0x16074e={'fields':{'project':{'key':_0x52c444[_0x63cc('0x5')]||_0x63cc('0x6')},'summary':(_0x52c444[_0x63cc('0x7')]||_0x63cc('0x8'))+'\x20from\x20'+_0x52c444['ip'],'description':_0x52c444['description']||JSON[_0x63cc('0x9')](_0x52c444),'issuetype':{'name':_0x52c444[_0x63cc('0xa')]||'Bug'}}};_0x16074e['fields'][_0x63cc('0xb')]=_0x52c444['email'];_0x16074e[_0x63cc('0xc')][_0x63cc('0xd')]=_0x52c444[_0x63cc('0xe')];_0x16074e[_0x63cc('0xc')]['customfield_11502']=_0x52c444[_0x63cc('0xf')];_0x16074e[_0x63cc('0xc')]['customfield_11503']=_0x52c444[_0x63cc('0x10')];_0x16074e[_0x63cc('0xc')][_0x63cc('0x11')]=_0x52c444['reason'];_0x16074e[_0x63cc('0xc')]['customfield_10102']=_0x52c444['ip'];var _0x3709a5={'host':_0x63cc('0x12'),'port':0x1bb,'path':_0x63cc('0x13'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x63cc('0x14'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x63cc('0x15')]('base64')}};var _0x206ddc=JSON[_0x63cc('0x9')](_0x16074e);var _0x2b2b99=https[_0x63cc('0x16')](_0x3709a5,function(_0x43da8b){_0x43da8b['setEncoding']('utf8');var _0x31a8a6='';_0x43da8b['on']('data',function(_0x16cac0){_0x31a8a6+=_0x16cac0;});_0x43da8b['on'](_0x63cc('0x17'),function(){if(_0x3e1017){return _0x3e1017['status'](_0x43da8b[_0x63cc('0x18')])[_0x63cc('0x19')](JSON['parse'](_0x31a8a6));}});});_0x2b2b99['on']('error',function(_0x2b6c3c){if(_0x3e1017){return _0x3e1017[_0x63cc('0x1a')](0x1f4)['json']({'errors':[{'message':_0x63cc('0x1b'),'type':_0x63cc('0x1c')}]});}});_0x2b2b99[_0x63cc('0x1d')](_0x206ddc);_0x2b2b99['end']();}exports[_0x63cc('0x1e')]=openIssue;exports['send']=function(_0x538057,_0x502b4b){_0x538057[_0x63cc('0x1f')]['ip']=_0x538057[_0x63cc('0x20')][_0x63cc('0x21')]||_0x538057[_0x63cc('0x22')][_0x63cc('0x23')]||_0x538057[_0x63cc('0x24')][_0x63cc('0x23')]||_0x538057['connection'][_0x63cc('0x24')][_0x63cc('0x23')];return openIssue(_0x538057[_0x63cc('0x1f')],_0x502b4b);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index db02909..4151573 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 _0xb4e6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x4de4b9,_0x5c9cce){var _0x300310=function(_0x3f0388){while(--_0x3f0388){_0x4de4b9['push'](_0x4de4b9['shift']());}};_0x300310(++_0x5c9cce);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0xb4e6[_0x4fd109];return _0x30f0a6;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var fs_extra=require(_0x6b4e('0x5'));var auth=require(_0x6b4e('0x6'));var interaction=require(_0x6b4e('0x7'));var config=require('../../config/environment');var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6b4e('0xb')]);router['get']('/:id',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0xd')]('/',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xe')]);router[_0x6b4e('0xf')](_0x6b4e('0x10'),auth['isAuthenticated'](),controller[_0x6b4e('0x11')]);router[_0x6b4e('0x12')]('/:id',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x13')]);module[_0x6b4e('0x14')]=router; \ No newline at end of file +var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x1abaae,_0x3426b9){var _0x457248=function(_0x4126ca){while(--_0x4126ca){_0x1abaae['push'](_0x1abaae['shift']());}};_0x457248(++_0x3426b9);}(_0x91a7,0xe7));var _0x791a=function(_0x1f3977,_0x4dd46a){_0x1f3977=_0x1f3977-0x0;var _0x5f22ab=_0x91a7[_0x1f3977];return _0x5f22ab;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3960a68..8639a90 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(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x329a9f,_0x24e19b){_0x329a9f=_0x329a9f-0x0;var _0x12e47d=_0x7a54[_0x329a9f];return _0x12e47d;};'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(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7a54,0x106));var _0x47a5=function(_0x364c00,_0x12494e){_0x364c00=_0x364c00-0x0;var _0x67f429=_0x7a54[_0x364c00];return _0x67f429;};'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 53b978e..a8ab006 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 _0x56e7=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','keys','length','create','body','find','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x4c736f,_0x29ad4c){var _0x1e4af5=function(_0x589822){while(--_0x589822){_0x4c736f['push'](_0x4c736f['shift']());}};_0x1e4af5(++_0x29ad4c);}(_0x56e7,0x7b));var _0x756e=function(_0x2b0ab6,_0x545877){_0x2b0ab6=_0x2b0ab6-0x0;var _0x15e701=_0x56e7[_0x2b0ab6];return _0x15e701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x756e('0x0'));var zipdir=require(_0x756e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x756e('0x2'));var moment=require(_0x756e('0x3'));var BPromise=require(_0x756e('0x4'));var Mustache=require(_0x756e('0x5'));var util=require(_0x756e('0x6'));var path=require(_0x756e('0x7'));var sox=require(_0x756e('0x8'));var csv=require('to-csv');var ejs=require(_0x756e('0x9'));var fs=require('fs');var fs_extra=require(_0x756e('0xa'));var _=require(_0x756e('0xb'));var squel=require(_0x756e('0xc'));var crypto=require('crypto');var jsforce=require(_0x756e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x756e('0xe'));var querystring=require(_0x756e('0xf'));var Papa=require(_0x756e('0x10'));var Redis=require(_0x756e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x756e('0x12'));var hardwareService=require(_0x756e('0x13'));var logger=require(_0x756e('0x14'))('api');var utils=require(_0x756e('0x15'));var config=require(_0x756e('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b68ef,_0x569e8f){_0x569e8f=_0x569e8f||0xcc;return function(_0x459237){if(_0x459237){return _0x1b68ef[_0x756e('0x17')](_0x569e8f);}return _0x1b68ef[_0x756e('0x18')](_0x569e8f)[_0x756e('0x19')]();};}function respondWithResult(_0x252333,_0x4ae32a){_0x4ae32a=_0x4ae32a||0xc8;return function(_0x4b3660){if(_0x4b3660){return _0x252333[_0x756e('0x18')](_0x4ae32a)[_0x756e('0x1a')](_0x4b3660);}};}function respondWithFilteredResult(_0xccccd4,_0x59956f){return function(_0x530e36){if(_0x530e36){var _0x1f7161=typeof _0x59956f[_0x756e('0x1b')]===_0x756e('0x1c')&&typeof _0x59956f[_0x756e('0x1d')]===_0x756e('0x1c');var _0x285290=_0x530e36[_0x756e('0x1e')];var _0x1a8614=_0x1f7161?0x0:_0x59956f[_0x756e('0x1b')];var _0x4da91f=_0x1f7161?_0x530e36[_0x756e('0x1e')]:_0x59956f['offset']+_0x59956f['limit'];var _0x157be3;if(_0x4da91f>=_0x285290){_0x4da91f=_0x285290;_0x157be3=0xc8;}else{_0x157be3=0xce;}_0xccccd4[_0x756e('0x18')](_0x157be3);return _0xccccd4[_0x756e('0x1f')](_0x756e('0x20'),_0x1a8614+'-'+_0x4da91f+'/'+_0x285290)[_0x756e('0x1a')](_0x530e36);}return null;};}function patchUpdates(_0x4e99a2){return function(_0xb00195){try{jsonpatch[_0x756e('0x21')](_0xb00195,_0x4e99a2,!![]);}catch(_0x88787d){return BPromise[_0x756e('0x22')](_0x88787d);}return _0xb00195[_0x756e('0x23')]();};}function saveUpdates(_0x83cdb5,_0x42173f){return function(_0x24d4ad){if(_0x24d4ad){return _0x24d4ad[_0x756e('0x24')](_0x83cdb5)[_0x756e('0x25')](function(_0x4b3230){return _0x4b3230;});}return null;};}function removeEntity(_0x335523,_0x4b38b4){return function(_0x256dc1){if(_0x256dc1){return _0x256dc1[_0x756e('0x26')]()[_0x756e('0x25')](function(){_0x335523[_0x756e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ef5ef,_0x4cbd7){return function(_0x2f4db8){if(!_0x2f4db8){_0x3ef5ef['sendStatus'](0x194);}return _0x2f4db8;};}function handleError(_0x32815d,_0x44f8f9){_0x44f8f9=_0x44f8f9||0x1f4;return function(_0x29dffb){logger['error'](_0x29dffb[_0x756e('0x27')]);if(_0x29dffb[_0x756e('0x28')]){delete _0x29dffb['name'];}_0x32815d[_0x756e('0x18')](_0x44f8f9)[_0x756e('0x29')](_0x29dffb);};}exports[_0x756e('0x2a')]=function(_0x5a1cf0,_0x3c332e){var _0x308153={},_0x5c6949={},_0x20543c={'count':0x0,'rows':[]};var _0x2a7fdb=_['map'](db[_0x756e('0x2b')][_0x756e('0x2c')],function(_0x39acd7){return{'name':_0x39acd7[_0x756e('0x2d')],'type':_0x39acd7[_0x756e('0x2e')]['key']};});_0x5c6949[_0x756e('0x2f')]=_['map'](_0x2a7fdb,'name');_0x5c6949[_0x756e('0x30')]=_['keys'](_0x5a1cf0[_0x756e('0x30')]);_0x5c6949[_0x756e('0x31')]=_[_0x756e('0x32')](_0x5c6949[_0x756e('0x2f')],_0x5c6949[_0x756e('0x30')]);_0x308153[_0x756e('0x33')]=_[_0x756e('0x32')](_0x5c6949[_0x756e('0x2f')],qs[_0x756e('0x34')](_0x5a1cf0[_0x756e('0x30')][_0x756e('0x34')]));_0x308153[_0x756e('0x33')]=_0x308153['attributes']['length']?_0x308153[_0x756e('0x33')]:_0x5c6949[_0x756e('0x2f')];if(!_0x5a1cf0[_0x756e('0x30')][_0x756e('0x35')](_0x756e('0x36'))){_0x308153[_0x756e('0x1d')]=qs[_0x756e('0x1d')](_0x5a1cf0['query']['limit']);_0x308153['offset']=qs[_0x756e('0x1b')](_0x5a1cf0[_0x756e('0x30')][_0x756e('0x1b')]);}_0x308153['order']=qs[_0x756e('0x37')](_0x5a1cf0[_0x756e('0x30')]['sort']);_0x308153[_0x756e('0x38')]=qs[_0x756e('0x31')](_[_0x756e('0x39')](_0x5a1cf0[_0x756e('0x30')],_0x5c6949[_0x756e('0x31')]),_0x2a7fdb);if(_0x5a1cf0[_0x756e('0x30')][_0x756e('0x3a')]){_0x308153[_0x756e('0x38')]=_['merge'](_0x308153[_0x756e('0x38')],{'$or':_[_0x756e('0x3b')](_0x2a7fdb,function(_0x20f979){if(_0x20f979[_0x756e('0x2e')]!==_0x756e('0x3c')){var _0x3a66fe={};_0x3a66fe[_0x20f979[_0x756e('0x28')]]={'$like':'%'+_0x5a1cf0[_0x756e('0x30')][_0x756e('0x3a')]+'%'};return _0x3a66fe;}})});}_0x308153=_[_0x756e('0x3d')]({},_0x308153,_0x5a1cf0['options']);var _0x41a100={'where':_0x308153[_0x756e('0x38')]};return db['JscriptyAnswerReport'][_0x756e('0x1e')](_0x41a100)[_0x756e('0x25')](function(_0x2b4fc3){_0x20543c['count']=_0x2b4fc3;if(_0x5a1cf0[_0x756e('0x30')][_0x756e('0x3e')]){_0x308153[_0x756e('0x3f')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x756e('0x40')](_0x308153);})[_0x756e('0x25')](function(_0x5856f){_0x20543c[_0x756e('0x41')]=_0x5856f;return _0x20543c;})[_0x756e('0x25')](respondWithFilteredResult(_0x3c332e,_0x308153))[_0x756e('0x42')](handleError(_0x3c332e,null));};exports['show']=function(_0x9bedd3,_0x2b593d){var _0x5c471e={'raw':!![],'where':{'id':_0x9bedd3[_0x756e('0x43')]['id']}},_0xa031fb={};_0xa031fb[_0x756e('0x2f')]=_[_0x756e('0x44')](db[_0x756e('0x2b')][_0x756e('0x2c')]);_0xa031fb[_0x756e('0x30')]=_[_0x756e('0x44')](_0x9bedd3[_0x756e('0x30')]);_0xa031fb['filters']=_[_0x756e('0x32')](_0xa031fb['model'],_0xa031fb[_0x756e('0x30')]);_0x5c471e[_0x756e('0x33')]=_[_0x756e('0x32')](_0xa031fb['model'],qs[_0x756e('0x34')](_0x9bedd3[_0x756e('0x30')][_0x756e('0x34')]));_0x5c471e['attributes']=_0x5c471e['attributes'][_0x756e('0x45')]?_0x5c471e[_0x756e('0x33')]:_0xa031fb['model'];if(_0x9bedd3['query'][_0x756e('0x3e')]){_0x5c471e[_0x756e('0x3f')]=[{'all':!![]}];}_0x5c471e=_[_0x756e('0x3d')]({},_0x5c471e,_0x9bedd3['options']);return db[_0x756e('0x2b')]['find'](_0x5c471e)[_0x756e('0x25')](handleEntityNotFound(_0x2b593d,null))[_0x756e('0x25')](respondWithResult(_0x2b593d,null))[_0x756e('0x42')](handleError(_0x2b593d,null));};exports['create']=function(_0x31d076,_0x5224f2){return db['JscriptyAnswerReport'][_0x756e('0x46')](_0x31d076['body'],{})[_0x756e('0x25')](respondWithResult(_0x5224f2,0xc9))[_0x756e('0x42')](handleError(_0x5224f2,null));};exports[_0x756e('0x24')]=function(_0x2512d3,_0x95061c){if(_0x2512d3[_0x756e('0x47')]['id']){delete _0x2512d3['body']['id'];}return db[_0x756e('0x2b')]['find']({'where':{'id':_0x2512d3[_0x756e('0x43')]['id']}})['then'](handleEntityNotFound(_0x95061c,null))[_0x756e('0x25')](saveUpdates(_0x2512d3['body'],null))[_0x756e('0x25')](respondWithResult(_0x95061c,null))['catch'](handleError(_0x95061c,null));};exports[_0x756e('0x26')]=function(_0x37ddd0,_0x27a201){return db['JscriptyAnswerReport'][_0x756e('0x48')]({'where':{'id':_0x37ddd0[_0x756e('0x43')]['id']}})['then'](handleEntityNotFound(_0x27a201,null))['then'](removeEntity(_0x27a201,null))[_0x756e('0x42')](handleError(_0x27a201,null));};exports[_0x756e('0x49')]=function(_0x34a556,_0x2ef29e){return db[_0x756e('0x2b')][_0x756e('0x49')]()[_0x756e('0x25')](respondWithResult(_0x2ef29e,null))[_0x756e('0x42')](handleError(_0x2ef29e,null));}; \ No newline at end of file +var _0x126e=['../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','JscriptyAnswerReport','rawAttributes','type','model','map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','show','params','intersection','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x329201,_0x442da5){var _0x274c30=function(_0x28f98d){while(--_0x28f98d){_0x329201['push'](_0x329201['shift']());}};_0x274c30(++_0x442da5);}(_0x126e,0x108));var _0xe126=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x126e[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe126('0x0'));var zipdir=require(_0xe126('0x1'));var jsonpatch=require(_0xe126('0x2'));var rp=require(_0xe126('0x3'));var moment=require(_0xe126('0x4'));var BPromise=require(_0xe126('0x5'));var Mustache=require('mustache');var util=require(_0xe126('0x6'));var path=require(_0xe126('0x7'));var sox=require(_0xe126('0x8'));var csv=require(_0xe126('0x9'));var ejs=require(_0xe126('0xa'));var fs=require('fs');var fs_extra=require(_0xe126('0xb'));var _=require(_0xe126('0xc'));var squel=require('squel');var crypto=require(_0xe126('0xd'));var jsforce=require(_0xe126('0xe'));var deskjs=require(_0xe126('0xf'));var toCsv=require(_0xe126('0x9'));var querystring=require(_0xe126('0x10'));var Papa=require('papaparse');var Redis=require(_0xe126('0x11'));var authService=require(_0xe126('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe126('0x13'));var hardwareService=require(_0xe126('0x14'));var logger=require('../../config/logger')(_0xe126('0x15'));var utils=require('../../config/utils');var config=require(_0xe126('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe126('0x17'))['db'];function respondWithStatusCode(_0x34ae06,_0x23ff02){_0x23ff02=_0x23ff02||0xcc;return function(_0x38b8c3){if(_0x38b8c3){return _0x34ae06[_0xe126('0x18')](_0x23ff02);}return _0x34ae06[_0xe126('0x19')](_0x23ff02)[_0xe126('0x1a')]();};}function respondWithResult(_0x55f10a,_0xd55baf){_0xd55baf=_0xd55baf||0xc8;return function(_0x1c02c9){if(_0x1c02c9){return _0x55f10a['status'](_0xd55baf)[_0xe126('0x1b')](_0x1c02c9);}};}function respondWithFilteredResult(_0x28d7dd,_0x10bc24){return function(_0x38b0c0){if(_0x38b0c0){var _0x5e52d1=typeof _0x10bc24[_0xe126('0x1c')]===_0xe126('0x1d')&&typeof _0x10bc24[_0xe126('0x1e')]==='undefined';var _0x2b0baa=_0x38b0c0['count'];var _0x46c98a=_0x5e52d1?0x0:_0x10bc24[_0xe126('0x1c')];var _0x19b0a3=_0x5e52d1?_0x38b0c0[_0xe126('0x1f')]:_0x10bc24[_0xe126('0x1c')]+_0x10bc24[_0xe126('0x1e')];var _0x20874b;if(_0x19b0a3>=_0x2b0baa){_0x19b0a3=_0x2b0baa;_0x20874b=0xc8;}else{_0x20874b=0xce;}_0x28d7dd[_0xe126('0x19')](_0x20874b);return _0x28d7dd['set'](_0xe126('0x20'),_0x46c98a+'-'+_0x19b0a3+'/'+_0x2b0baa)[_0xe126('0x1b')](_0x38b0c0);}return null;};}function patchUpdates(_0x35ab64){return function(_0x2e5617){try{jsonpatch[_0xe126('0x21')](_0x2e5617,_0x35ab64,!![]);}catch(_0x24076e){return BPromise[_0xe126('0x22')](_0x24076e);}return _0x2e5617[_0xe126('0x23')]();};}function saveUpdates(_0x5257bc,_0x4a1a97){return function(_0xdb6544){if(_0xdb6544){return _0xdb6544[_0xe126('0x24')](_0x5257bc)[_0xe126('0x25')](function(_0x5f1ce1){return _0x5f1ce1;});}return null;};}function removeEntity(_0x5381e1,_0x47f179){return function(_0x4807d3){if(_0x4807d3){return _0x4807d3[_0xe126('0x26')]()['then'](function(){_0x5381e1[_0xe126('0x19')](0xcc)[_0xe126('0x1a')]();});}};}function handleEntityNotFound(_0x4157ed,_0x1674c9){return function(_0x532409){if(!_0x532409){_0x4157ed['sendStatus'](0x194);}return _0x532409;};}function handleError(_0x26482f,_0x4facea){_0x4facea=_0x4facea||0x1f4;return function(_0x3f5de5){logger[_0xe126('0x27')](_0x3f5de5[_0xe126('0x28')]);if(_0x3f5de5['name']){delete _0x3f5de5[_0xe126('0x29')];}_0x26482f[_0xe126('0x19')](_0x4facea)['send'](_0x3f5de5);};}exports[_0xe126('0x2a')]=function(_0x259059,_0x5a8b2a){var _0x9d9e28={},_0x1fb354={},_0x29dec4={'count':0x0,'rows':[]};var _0x181ccc=_['map'](db[_0xe126('0x2b')][_0xe126('0x2c')],function(_0x5e7bab){return{'name':_0x5e7bab['fieldName'],'type':_0x5e7bab[_0xe126('0x2d')]['key']};});_0x1fb354[_0xe126('0x2e')]=_[_0xe126('0x2f')](_0x181ccc,_0xe126('0x29'));_0x1fb354['query']=_[_0xe126('0x30')](_0x259059[_0xe126('0x31')]);_0x1fb354[_0xe126('0x32')]=_['intersection'](_0x1fb354[_0xe126('0x2e')],_0x1fb354[_0xe126('0x31')]);_0x9d9e28['attributes']=_['intersection'](_0x1fb354[_0xe126('0x2e')],qs[_0xe126('0x33')](_0x259059[_0xe126('0x31')][_0xe126('0x33')]));_0x9d9e28[_0xe126('0x34')]=_0x9d9e28[_0xe126('0x34')][_0xe126('0x35')]?_0x9d9e28[_0xe126('0x34')]:_0x1fb354['model'];if(!_0x259059[_0xe126('0x31')][_0xe126('0x36')](_0xe126('0x37'))){_0x9d9e28[_0xe126('0x1e')]=qs[_0xe126('0x1e')](_0x259059[_0xe126('0x31')]['limit']);_0x9d9e28[_0xe126('0x1c')]=qs[_0xe126('0x1c')](_0x259059[_0xe126('0x31')][_0xe126('0x1c')]);}_0x9d9e28[_0xe126('0x38')]=qs['sort'](_0x259059[_0xe126('0x31')][_0xe126('0x39')]);_0x9d9e28[_0xe126('0x3a')]=qs[_0xe126('0x32')](_['pick'](_0x259059[_0xe126('0x31')],_0x1fb354[_0xe126('0x32')]),_0x181ccc);if(_0x259059[_0xe126('0x31')][_0xe126('0x3b')]){_0x9d9e28[_0xe126('0x3a')]=_[_0xe126('0x3c')](_0x9d9e28['where'],{'$or':_[_0xe126('0x2f')](_0x181ccc,function(_0x1a8edf){if(_0x1a8edf[_0xe126('0x2d')]!=='VIRTUAL'){var _0x5073bc={};_0x5073bc[_0x1a8edf[_0xe126('0x29')]]={'$like':'%'+_0x259059[_0xe126('0x31')][_0xe126('0x3b')]+'%'};return _0x5073bc;}})});}_0x9d9e28=_[_0xe126('0x3c')]({},_0x9d9e28,_0x259059[_0xe126('0x3d')]);var _0x1c128d={'where':_0x9d9e28['where']};return db[_0xe126('0x2b')][_0xe126('0x1f')](_0x1c128d)['then'](function(_0x4eb3d7){_0x29dec4[_0xe126('0x1f')]=_0x4eb3d7;if(_0x259059[_0xe126('0x31')]['includeAll']){_0x9d9e28[_0xe126('0x3e')]=[{'all':!![]}];}return db[_0xe126('0x2b')]['findAll'](_0x9d9e28);})[_0xe126('0x25')](function(_0x366754){_0x29dec4['rows']=_0x366754;return _0x29dec4;})[_0xe126('0x25')](respondWithFilteredResult(_0x5a8b2a,_0x9d9e28))['catch'](handleError(_0x5a8b2a,null));};exports[_0xe126('0x3f')]=function(_0x23d1d8,_0x5d5111){var _0x3613de={'raw':!![],'where':{'id':_0x23d1d8[_0xe126('0x40')]['id']}},_0x149b84={};_0x149b84['model']=_[_0xe126('0x30')](db['JscriptyAnswerReport'][_0xe126('0x2c')]);_0x149b84[_0xe126('0x31')]=_[_0xe126('0x30')](_0x23d1d8[_0xe126('0x31')]);_0x149b84[_0xe126('0x32')]=_[_0xe126('0x41')](_0x149b84[_0xe126('0x2e')],_0x149b84[_0xe126('0x31')]);_0x3613de[_0xe126('0x34')]=_[_0xe126('0x41')](_0x149b84[_0xe126('0x2e')],qs['fields'](_0x23d1d8['query'][_0xe126('0x33')]));_0x3613de[_0xe126('0x34')]=_0x3613de['attributes'][_0xe126('0x35')]?_0x3613de[_0xe126('0x34')]:_0x149b84[_0xe126('0x2e')];if(_0x23d1d8[_0xe126('0x31')]['includeAll']){_0x3613de[_0xe126('0x3e')]=[{'all':!![]}];}_0x3613de=_[_0xe126('0x3c')]({},_0x3613de,_0x23d1d8[_0xe126('0x3d')]);return db[_0xe126('0x2b')][_0xe126('0x42')](_0x3613de)[_0xe126('0x25')](handleEntityNotFound(_0x5d5111,null))[_0xe126('0x25')](respondWithResult(_0x5d5111,null))[_0xe126('0x43')](handleError(_0x5d5111,null));};exports[_0xe126('0x44')]=function(_0xccc25d,_0x23007d){return db[_0xe126('0x2b')][_0xe126('0x44')](_0xccc25d['body'],{})['then'](respondWithResult(_0x23007d,0xc9))['catch'](handleError(_0x23007d,null));};exports['update']=function(_0xe642ae,_0x8d5abd){if(_0xe642ae[_0xe126('0x45')]['id']){delete _0xe642ae[_0xe126('0x45')]['id'];}return db[_0xe126('0x2b')][_0xe126('0x42')]({'where':{'id':_0xe642ae[_0xe126('0x40')]['id']}})['then'](handleEntityNotFound(_0x8d5abd,null))['then'](saveUpdates(_0xe642ae[_0xe126('0x45')],null))[_0xe126('0x25')](respondWithResult(_0x8d5abd,null))['catch'](handleError(_0x8d5abd,null));};exports[_0xe126('0x26')]=function(_0x209002,_0x518e43){return db[_0xe126('0x2b')][_0xe126('0x42')]({'where':{'id':_0x209002['params']['id']}})['then'](handleEntityNotFound(_0x518e43,null))[_0xe126('0x25')](removeEntity(_0x518e43,null))[_0xe126('0x43')](handleError(_0x518e43,null));};exports[_0xe126('0x46')]=function(_0x48fbed,_0x31e193){return db['JscriptyAnswerReport'][_0xe126('0x46')]()[_0xe126('0x25')](respondWithResult(_0x31e193,null))['catch'](handleError(_0x31e193,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 293cd15..b40ddb9 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 _0x8f32=['moment','bluebird','request-promise','path','define','report_jscripty_answers','lodash','../../config/logger','api'];(function(_0x2457eb,_0x7816e2){var _0x5c9204=function(_0x1212cd){while(--_0x1212cd){_0x2457eb['push'](_0x2457eb['shift']());}};_0x5c9204(++_0x7816e2);}(_0x8f32,0x14a));var _0x28f3=function(_0x1d58c2,_0x1d376b){_0x1d58c2=_0x1d58c2-0x0;var _0x373f9c=_0x8f32[_0x1d58c2];return _0x373f9c;};'use strict';var _=require(_0x28f3('0x0'));var util=require('util');var logger=require(_0x28f3('0x1'))(_0x28f3('0x2'));var moment=require(_0x28f3('0x3'));var BPromise=require(_0x28f3('0x4'));var rp=require(_0x28f3('0x5'));var fs=require('fs');var path=require(_0x28f3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x4b0b06,_0x3e37ef){return _0x4b0b06[_0x28f3('0x7')]('JscriptyAnswerReport',attributes,{'tableName':_0x28f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e19=['define','JscriptyAnswerReport','util','api','moment','bluebird','path','rimraf','./jscriptyAnswerReport.attributes','exports'];(function(_0x36a87c,_0x17d58c){var _0x6cd4e3=function(_0x109e88){while(--_0x109e88){_0x36a87c['push'](_0x36a87c['shift']());}};_0x6cd4e3(++_0x17d58c);}(_0x1e19,0x192));var _0x91e1=function(_0x2af94d,_0x4c2f0d){_0x2af94d=_0x2af94d-0x0;var _0x170d6f=_0x1e19[_0x2af94d];return _0x170d6f;};'use strict';var _=require('lodash');var util=require(_0x91e1('0x0'));var logger=require('../../config/logger')(_0x91e1('0x1'));var moment=require(_0x91e1('0x2'));var BPromise=require(_0x91e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91e1('0x4'));var rimraf=require(_0x91e1('0x5'));var config=require('../../config/environment');var attributes=require(_0x91e1('0x6'));module[_0x91e1('0x7')]=function(_0x4c42db,_0x92046){return _0x4c42db[_0x91e1('0x8')](_0x91e1('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 1eecdf6..b442d2f 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 _0xf05b=['request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1dc5b8,_0x12acec){var _0x5ba13b=function(_0x5381ef){while(--_0x5381ef){_0x1dc5b8['push'](_0x1dc5b8['shift']());}};_0x5ba13b(++_0x12acec);}(_0xf05b,0x1b6));var _0xbf05=function(_0x272796,_0x1a9025){_0x272796=_0x272796-0x0;var _0x2ea17c=_0xf05b[_0x272796];return _0x2ea17c;};'use strict';var _=require(_0xbf05('0x0'));var util=require('util');var moment=require(_0xbf05('0x1'));var BPromise=require(_0xbf05('0x2'));var rs=require(_0xbf05('0x3'));var fs=require('fs');var Redis=require(_0xbf05('0x4'));var db=require(_0xbf05('0x5'))['db'];var utils=require(_0xbf05('0x6'));var logger=require(_0xbf05('0x7'))(_0xbf05('0x8'));var config=require(_0xbf05('0x9'));var jayson=require(_0xbf05('0xa'));var client=jayson[_0xbf05('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f2f8e,_0x581563,_0x5a0fcc){return new BPromise(function(_0x4695ad,_0x4186cf){return client[_0xbf05('0xc')](_0x5f2f8e,_0x5a0fcc)[_0xbf05('0xd')](function(_0x5e1929){logger[_0xbf05('0xe')](_0xbf05('0xf'),_0x581563,_0xbf05('0x10'));logger[_0xbf05('0x11')](_0xbf05('0x12'),_0x581563,_0xbf05('0x10'),JSON[_0xbf05('0x13')](_0x5e1929));if(_0x5e1929['error']){if(_0x5e1929[_0xbf05('0x14')][_0xbf05('0x15')]===0x1f4){logger[_0xbf05('0x14')](_0xbf05('0xf'),_0x581563,_0x5e1929[_0xbf05('0x14')][_0xbf05('0x16')]);return _0x4186cf(_0x5e1929[_0xbf05('0x14')][_0xbf05('0x16')]);}logger[_0xbf05('0x14')](_0xbf05('0xf'),_0x581563,_0x5e1929[_0xbf05('0x14')]['message']);return _0x4695ad(_0x5e1929['error'][_0xbf05('0x16')]);}else{logger[_0xbf05('0xe')](_0xbf05('0xf'),_0x581563,_0xbf05('0x10'));_0x4695ad(_0x5e1929[_0xbf05('0x17')][_0xbf05('0x16')]);}})[_0xbf05('0x18')](function(_0x55ba3a){logger[_0xbf05('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x581563,_0x55ba3a);_0x4186cf(_0x55ba3a);});});} \ No newline at end of file +var _0x652d=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0x353fb7,_0x7c2a7){var _0x90874=function(_0x1f0627){while(--_0x1f0627){_0x353fb7['push'](_0x353fb7['shift']());}};_0x90874(++_0x7c2a7);}(_0x652d,0x1a0));var _0xd652=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x652d[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xd652('0x0'));var moment=require(_0xd652('0x1'));var BPromise=require(_0xd652('0x2'));var rs=require(_0xd652('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd652('0x4'))(_0xd652('0x5'));var config=require(_0xd652('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd652('0x7')][_0xd652('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x317874,_0x8f1b38,_0x4d7c91){return new BPromise(function(_0x142346,_0x4674fa){return client[_0xd652('0x9')](_0x317874,_0x4d7c91)[_0xd652('0xa')](function(_0x1cd2e8){logger[_0xd652('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x8f1b38,'request\x20sent');logger[_0xd652('0xc')](_0xd652('0xd'),_0x8f1b38,'request\x20sent',JSON[_0xd652('0xe')](_0x1cd2e8));if(_0x1cd2e8['error']){if(_0x1cd2e8[_0xd652('0xf')][_0xd652('0x10')]===0x1f4){logger['error'](_0xd652('0x11'),_0x8f1b38,_0x1cd2e8['error'][_0xd652('0x12')]);return _0x4674fa(_0x1cd2e8[_0xd652('0xf')][_0xd652('0x12')]);}logger['error'](_0xd652('0x11'),_0x8f1b38,_0x1cd2e8[_0xd652('0xf')][_0xd652('0x12')]);return _0x142346(_0x1cd2e8['error'][_0xd652('0x12')]);}else{logger['info'](_0xd652('0x11'),_0x8f1b38,_0xd652('0x13'));_0x142346(_0x1cd2e8[_0xd652('0x14')][_0xd652('0x12')]);}})[_0xd652('0x15')](function(_0x2c070f){logger['error'](_0xd652('0x11'),_0x8f1b38,_0x2c070f);_0x4674fa(_0x2c070f);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 35c5aa7..d5d23c2 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 _0x9933=['/:id/answers','/:id/summary','30s','getSummary','post','create','clone','put','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions'];(function(_0x16df4e,_0x5cc4e0){var _0x3f1692=function(_0x204ac1){while(--_0x204ac1){_0x16df4e['push'](_0x16df4e['shift']());}};_0x3f1692(++_0x5cc4e0);}(_0x9933,0xeb));var _0x3993=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9933[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x3993('0x0'));var util=require(_0x3993('0x1'));var path=require(_0x3993('0x2'));var timeout=require('connect-timeout');var express=require(_0x3993('0x3'));var router=express[_0x3993('0x4')]();var fs_extra=require(_0x3993('0x5'));var auth=require(_0x3993('0x6'));var interaction=require(_0x3993('0x7'));var config=require(_0x3993('0x8'));var controller=require(_0x3993('0x9'));router[_0x3993('0xa')]('/',auth[_0x3993('0xb')](),controller[_0x3993('0xc')]);router[_0x3993('0xa')](_0x3993('0xd'),auth['isAuthenticated'](),controller[_0x3993('0xe')]);router['get'](_0x3993('0xf'),auth[_0x3993('0xb')](),controller[_0x3993('0x10')]);router[_0x3993('0xa')](_0x3993('0x11'),auth[_0x3993('0xb')](),controller['getAnswers']);router[_0x3993('0xa')](_0x3993('0x12'),auth[_0x3993('0xb')](),timeout(_0x3993('0x13')),controller[_0x3993('0x14')]);router[_0x3993('0x15')]('/',auth['isAuthenticated'](),controller[_0x3993('0x16')]);router[_0x3993('0x15')]('/:id/clone',auth[_0x3993('0xb')](),controller[_0x3993('0x17')]);router[_0x3993('0x18')](_0x3993('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x3993('0x19')](_0x3993('0xd'),auth[_0x3993('0xb')](),controller[_0x3993('0x1a')]);module[_0x3993('0x1b')]=router; \ No newline at end of file +var _0xcb9f=['isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4a68c6,_0xf495c2){var _0x3bc0b6=function(_0x379e56){while(--_0x379e56){_0x4a68c6['push'](_0x4a68c6['shift']());}};_0x3bc0b6(++_0xf495c2);}(_0xcb9f,0xf4));var _0xfcb9=function(_0x54048c,_0x445192){_0x54048c=_0x54048c-0x0;var _0x10eac2=_0xcb9f[_0x54048c];return _0x10eac2;};'use strict';var multer=require('multer');var util=require(_0xfcb9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfcb9('0x1'));var router=express[_0xfcb9('0x2')]();var fs_extra=require(_0xfcb9('0x3'));var auth=require(_0xfcb9('0x4'));var interaction=require(_0xfcb9('0x5'));var config=require(_0xfcb9('0x6'));var controller=require('./jscriptyProject.controller');router[_0xfcb9('0x7')]('/',auth[_0xfcb9('0x8')](),controller[_0xfcb9('0x9')]);router['get'](_0xfcb9('0xa'),auth[_0xfcb9('0x8')](),controller[_0xfcb9('0xb')]);router[_0xfcb9('0x7')](_0xfcb9('0xc'),auth[_0xfcb9('0x8')](),controller[_0xfcb9('0xd')]);router[_0xfcb9('0x7')](_0xfcb9('0xe'),auth['isAuthenticated'](),controller[_0xfcb9('0xf')]);router[_0xfcb9('0x7')](_0xfcb9('0x10'),auth['isAuthenticated'](),timeout(_0xfcb9('0x11')),controller[_0xfcb9('0x12')]);router[_0xfcb9('0x13')]('/',auth[_0xfcb9('0x8')](),controller[_0xfcb9('0x14')]);router[_0xfcb9('0x13')](_0xfcb9('0x15'),auth[_0xfcb9('0x8')](),controller[_0xfcb9('0x16')]);router[_0xfcb9('0x17')](_0xfcb9('0xa'),auth[_0xfcb9('0x8')](),controller[_0xfcb9('0x18')]);router[_0xfcb9('0x19')](_0xfcb9('0xa'),auth[_0xfcb9('0x8')](),controller[_0xfcb9('0x1a')]);module[_0xfcb9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b4c9573..8d197cd 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 _0x9a75=['BOOLEAN','sequelize','lodash','util','STRING','name','long','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','description'];(function(_0x5744d0,_0x281507){var _0x7f5a59=function(_0x28f67a){while(--_0x28f67a){_0x5744d0['push'](_0x5744d0['shift']());}};_0x7f5a59(++_0x281507);}(_0x9a75,0x79));var _0x59a7=function(_0x3b240a,_0x543ef3){_0x3b240a=_0x3b240a-0x0;var _0x359759=_0x9a75[_0x3b240a];return _0x359759;};'use strict';var Sequelize=require(_0x59a7('0x0'));var _=require(_0x59a7('0x1'));var util=require(_0x59a7('0x2'));module['exports']={'name':{'type':Sequelize[_0x59a7('0x3')],'unique':_0x59a7('0x4')},'description':{'type':Sequelize[_0x59a7('0x3')]},'formData':{'type':Sequelize['TEXT'](_0x59a7('0x5')),'set':function(_0x350ffa){if(_['isObjectLike'](_0x350ffa)){this[_0x59a7('0x6')]('formData',JSON['stringify'](_0x350ffa));}else if(_['isString'](_0x350ffa)){this[_0x59a7('0x6')](_0x59a7('0x7'),_0x350ffa);}else{this[_0x59a7('0x6')](_0x59a7('0x7'),util[_0x59a7('0x8')](_0x59a7('0x9'),this['getDataValue'](_0x59a7('0x4'))||'',this['getDataValue'](_0x59a7('0xa'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x59a7('0xb')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x59a7('0xb')],'defaultValue':![]}}; \ No newline at end of file +var _0x0c35=['BOOLEAN','util','name','STRING','TEXT','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x13405d,_0xe260e2){var _0x486569=function(_0x29457a){while(--_0x29457a){_0x13405d['push'](_0x13405d['shift']());}};_0x486569(++_0xe260e2);}(_0x0c35,0x143));var _0x50c3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0c35[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x50c3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x50c3('0x1')},'description':{'type':Sequelize[_0x50c3('0x2')]},'formData':{'type':Sequelize[_0x50c3('0x3')]('long'),'set':function(_0x40a7e3){if(_[_0x50c3('0x4')](_0x40a7e3)){this[_0x50c3('0x5')](_0x50c3('0x6'),JSON[_0x50c3('0x7')](_0x40a7e3));}else if(_[_0x50c3('0x8')](_0x40a7e3)){this[_0x50c3('0x5')](_0x50c3('0x6'),_0x40a7e3);}else{this['setDataValue'](_0x50c3('0x6'),util[_0x50c3('0x9')](_0x50c3('0xa'),this[_0x50c3('0xb')](_0x50c3('0x1'))||'',this[_0x50c3('0xb')](_0x50c3('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x50c3('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x50c3('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 7884896..e007c3c 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 _0x5433=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','UserProfileSection','userProfileId','getSessions','JscriptySessionReport','ProjectId','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','answer','push','now','writeFileSync','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','/tmp/Jscripty_Project_%d_Summary_%s.csv','sendStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Projects','UserProfileResource','error','name','send','map','JscriptyProject','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user'];(function(_0x51e107,_0x37a4e4){var _0x54b659=function(_0x38c08f){while(--_0x38c08f){_0x51e107['push'](_0x51e107['shift']());}};_0x54b659(++_0x37a4e4);}(_0x5433,0x9f));var _0x3543=function(_0x3e19c9,_0x41f5ad){_0x3e19c9=_0x3e19c9-0x0;var _0xc0d6f=_0x5433[_0x3e19c9];return _0xc0d6f;};'use strict';var emlformat=require(_0x3543('0x0'));var rimraf=require(_0x3543('0x1'));var zipdir=require(_0x3543('0x2'));var jsonpatch=require(_0x3543('0x3'));var rp=require(_0x3543('0x4'));var moment=require(_0x3543('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3543('0x6'));var util=require(_0x3543('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3543('0x8'));var ejs=require(_0x3543('0x9'));var fs=require('fs');var fs_extra=require(_0x3543('0xa'));var _=require(_0x3543('0xb'));var squel=require('squel');var crypto=require(_0x3543('0xc'));var jsforce=require(_0x3543('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3543('0x8'));var querystring=require(_0x3543('0xe'));var Papa=require(_0x3543('0xf'));var Redis=require(_0x3543('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3543('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3543('0x12'));var logger=require(_0x3543('0x13'))(_0x3543('0x14'));var utils=require(_0x3543('0x15'));var config=require(_0x3543('0x16'));var licenseUtil=require(_0x3543('0x17'));var db=require(_0x3543('0x18'))['db'];function respondWithStatusCode(_0x567b95,_0x519093){_0x519093=_0x519093||0xcc;return function(_0x435b1f){if(_0x435b1f){return _0x567b95['sendStatus'](_0x519093);}return _0x567b95[_0x3543('0x19')](_0x519093)[_0x3543('0x1a')]();};}function respondWithResult(_0x2b981b,_0x589823){_0x589823=_0x589823||0xc8;return function(_0x1e9c66){if(_0x1e9c66){return _0x2b981b['status'](_0x589823)[_0x3543('0x1b')](_0x1e9c66);}};}function respondWithFilteredResult(_0x3312a0,_0xc9c970){return function(_0x1a1f7d){if(_0x1a1f7d){var _0x4eccfb=typeof _0xc9c970['offset']===_0x3543('0x1c')&&typeof _0xc9c970[_0x3543('0x1d')]==='undefined';var _0x1fc1bc=_0x1a1f7d[_0x3543('0x1e')];var _0x1f0464=_0x4eccfb?0x0:_0xc9c970[_0x3543('0x1f')];var _0x5eafb7=_0x4eccfb?_0x1a1f7d[_0x3543('0x1e')]:_0xc9c970['offset']+_0xc9c970[_0x3543('0x1d')];var _0x12eb8b;if(_0x5eafb7>=_0x1fc1bc){_0x5eafb7=_0x1fc1bc;_0x12eb8b=0xc8;}else{_0x12eb8b=0xce;}_0x3312a0['status'](_0x12eb8b);return _0x3312a0[_0x3543('0x20')](_0x3543('0x21'),_0x1f0464+'-'+_0x5eafb7+'/'+_0x1fc1bc)[_0x3543('0x1b')](_0x1a1f7d);}return null;};}function patchUpdates(_0x68a303){return function(_0x44a97f){try{jsonpatch[_0x3543('0x22')](_0x44a97f,_0x68a303,!![]);}catch(_0x2befaa){return BPromise[_0x3543('0x23')](_0x2befaa);}return _0x44a97f['save']();};}function saveUpdates(_0x3933c1,_0x2ce501){return function(_0x5af7ca){if(_0x5af7ca){return _0x5af7ca[_0x3543('0x24')](_0x3933c1)[_0x3543('0x25')](function(_0x46a6f6){return _0x46a6f6;});}return null;};}function removeEntity(_0x460f01,_0x3202c4){return function(_0x542c77){if(_0x542c77){return _0x542c77[_0x3543('0x26')]()[_0x3543('0x25')](function(){var _0x9d6ff5=_0x542c77[_0x3543('0x27')]({'plain':!![]});var _0x4e3e49=_0x3543('0x28');return db[_0x3543('0x29')][_0x3543('0x26')]({'where':{'type':_0x4e3e49,'resourceId':_0x9d6ff5['id']}})[_0x3543('0x25')](function(){return _0x542c77;});})[_0x3543('0x25')](function(){_0x460f01['status'](0xcc)[_0x3543('0x1a')]();});}};}function handleEntityNotFound(_0x170fe8,_0x37c1ba){return function(_0x19c4c6){if(!_0x19c4c6){_0x170fe8['sendStatus'](0x194);}return _0x19c4c6;};}function handleError(_0x4a7ca6,_0x4b9a75){_0x4b9a75=_0x4b9a75||0x1f4;return function(_0x564ff3){logger[_0x3543('0x2a')](_0x564ff3['stack']);if(_0x564ff3['name']){delete _0x564ff3[_0x3543('0x2b')];}_0x4a7ca6[_0x3543('0x19')](_0x4b9a75)[_0x3543('0x2c')](_0x564ff3);};}exports['index']=function(_0x1a0e80,_0x109fb6){var _0x41548={},_0x201fac={},_0x37231c={'count':0x0,'rows':[]};var _0x1d5a4b=_[_0x3543('0x2d')](db[_0x3543('0x2e')][_0x3543('0x2f')],function(_0x4b5dc3){return{'name':_0x4b5dc3['fieldName'],'type':_0x4b5dc3[_0x3543('0x30')][_0x3543('0x31')]};});_0x201fac[_0x3543('0x32')]=_[_0x3543('0x2d')](_0x1d5a4b,_0x3543('0x2b'));_0x201fac[_0x3543('0x33')]=_[_0x3543('0x34')](_0x1a0e80[_0x3543('0x33')]);_0x201fac[_0x3543('0x35')]=_[_0x3543('0x36')](_0x201fac[_0x3543('0x32')],_0x201fac[_0x3543('0x33')]);_0x41548[_0x3543('0x37')]=_[_0x3543('0x36')](_0x201fac[_0x3543('0x32')],qs[_0x3543('0x38')](_0x1a0e80[_0x3543('0x33')][_0x3543('0x38')]));_0x41548['attributes']=_0x41548[_0x3543('0x37')]['length']?_0x41548[_0x3543('0x37')]:_0x201fac[_0x3543('0x32')];if(!_0x1a0e80[_0x3543('0x33')][_0x3543('0x39')](_0x3543('0x3a'))){_0x41548['limit']=qs[_0x3543('0x1d')](_0x1a0e80['query'][_0x3543('0x1d')]);_0x41548[_0x3543('0x1f')]=qs[_0x3543('0x1f')](_0x1a0e80['query'][_0x3543('0x1f')]);}_0x41548[_0x3543('0x3b')]=qs[_0x3543('0x3c')](_0x1a0e80[_0x3543('0x33')]['sort']);_0x41548[_0x3543('0x3d')]=qs['filters'](_[_0x3543('0x3e')](_0x1a0e80['query'],_0x201fac['filters']),_0x1d5a4b);if(_0x1a0e80['query'][_0x3543('0x3f')]){_0x41548[_0x3543('0x3d')]=_['merge'](_0x41548[_0x3543('0x3d')],{'$or':_[_0x3543('0x2d')](_0x1d5a4b,function(_0x58fd20){if(_0x58fd20['type']!=='VIRTUAL'){var _0x391fa4={};_0x391fa4[_0x58fd20[_0x3543('0x2b')]]={'$like':'%'+_0x1a0e80['query']['filter']+'%'};return _0x391fa4;}})});}_0x41548=_[_0x3543('0x40')]({},_0x41548,_0x1a0e80[_0x3543('0x41')]);var _0x58be7c={'where':_0x41548['where']};return db[_0x3543('0x2e')][_0x3543('0x1e')](_0x58be7c)[_0x3543('0x25')](function(_0xda6c3){_0x37231c['count']=_0xda6c3;if(_0x1a0e80['query']['includeAll']){_0x41548[_0x3543('0x42')]=[{'all':!![]}];}return db[_0x3543('0x2e')][_0x3543('0x43')](_0x41548);})['then'](function(_0x4d84b0){_0x37231c[_0x3543('0x44')]=_0x4d84b0;return _0x37231c;})[_0x3543('0x25')](respondWithFilteredResult(_0x109fb6,_0x41548))[_0x3543('0x45')](handleError(_0x109fb6,null));};exports[_0x3543('0x46')]=function(_0xe254a9,_0x2f0afc){var _0x1cb86d={'raw':![],'where':{'id':_0xe254a9[_0x3543('0x47')]['id']}},_0x149f97={};_0x149f97[_0x3543('0x32')]=_[_0x3543('0x34')](db['JscriptyProject'][_0x3543('0x2f')]);_0x149f97[_0x3543('0x33')]=_[_0x3543('0x34')](_0xe254a9[_0x3543('0x33')]);_0x149f97[_0x3543('0x35')]=_[_0x3543('0x36')](_0x149f97[_0x3543('0x32')],_0x149f97[_0x3543('0x33')]);_0x1cb86d['attributes']=_[_0x3543('0x36')](_0x149f97[_0x3543('0x32')],qs['fields'](_0xe254a9['query']['fields']));_0x1cb86d[_0x3543('0x37')]=_0x1cb86d['attributes']['length']?_0x1cb86d[_0x3543('0x37')]:_0x149f97[_0x3543('0x32')];if(_0xe254a9[_0x3543('0x33')][_0x3543('0x48')]){_0x1cb86d[_0x3543('0x42')]=[{'all':!![]}];}_0x1cb86d=_['merge']({},_0x1cb86d,_0xe254a9['options']);return db['JscriptyProject'][_0x3543('0x49')](_0x1cb86d)[_0x3543('0x25')](handleEntityNotFound(_0x2f0afc,null))[_0x3543('0x25')](respondWithResult(_0x2f0afc,null))[_0x3543('0x45')](handleError(_0x2f0afc,null));};exports[_0x3543('0x4a')]=function(_0x2debd1,_0x5ae094){return db[_0x3543('0x2e')]['create'](_0x2debd1[_0x3543('0x4b')],{})['then'](function(_0x32f293){var _0x1f2e0a=_0x2debd1[_0x3543('0x4c')][_0x3543('0x27')]({'plain':!![]});if(!_0x1f2e0a)throw new Error(_0x3543('0x4d'));if(_0x1f2e0a[_0x3543('0x4e')]===_0x3543('0x4c')){var _0xded4fe=_0x32f293[_0x3543('0x27')]({'plain':!![]});var _0x47d63e=_0x3543('0x28');return db['UserProfileSection'][_0x3543('0x49')]({'where':{'name':_0x47d63e,'userProfileId':_0x1f2e0a['userProfileId']},'raw':!![]})['then'](function(_0x5920f9){if(_0x5920f9&&_0x5920f9[_0x3543('0x4f')]===0x0){return db[_0x3543('0x29')][_0x3543('0x4a')]({'name':_0xded4fe[_0x3543('0x2b')],'resourceId':_0xded4fe['id'],'type':_0x5920f9[_0x3543('0x2b')],'sectionId':_0x5920f9['id']},{})[_0x3543('0x25')](function(){return _0x32f293;});}else{return _0x32f293;}})[_0x3543('0x45')](function(_0x26f0b8){logger[_0x3543('0x2a')](_0x3543('0x50'),_0x26f0b8);throw _0x26f0b8;});}return _0x32f293;})['then'](respondWithResult(_0x5ae094,0xc9))[_0x3543('0x45')](handleError(_0x5ae094,null));};exports['clone']=function(_0x241f43,_0x1b7b6c){var _0x266daa={'where':{'id':_0x241f43[_0x3543('0x47')]['id']}},_0x3482a6={};_0x3482a6['model']=_[_0x3543('0x34')](db[_0x3543('0x2e')]['rawAttributes']);_0x266daa[_0x3543('0x37')]=_['intersection'](_0x3482a6['model'],qs[_0x3543('0x38')](_0x241f43[_0x3543('0x33')][_0x3543('0x38')]));_0x266daa[_0x3543('0x37')]=_0x266daa[_0x3543('0x37')][_0x3543('0x51')]?_0x266daa[_0x3543('0x37')]:_0x3482a6['model'];if(_0x241f43['query'][_0x3543('0x48')]){_0x266daa[_0x3543('0x42')]=[{'all':!![]}];}_0x266daa=_['merge']({},_0x266daa,_0x241f43['options']);return db[_0x3543('0x2e')]['find'](_0x266daa)['then'](handleEntityNotFound(_0x1b7b6c,null))[_0x3543('0x25')](function(_0x3fd0b6){if(_0x3fd0b6){var _0x4f9887=_0x3fd0b6['get']({'plain':!![]});_0x4f9887=qs[_0x3543('0x52')](_0x4f9887,['id',_0x3543('0x53'),'updatedAt']);_0x241f43[_0x3543('0x4b')]=_[_0x3543('0x52')](_0x241f43[_0x3543('0x4b')],['id','createdAt','updatedAt']);return db[_0x3543('0x2e')][_0x3543('0x4a')](_['merge'](_0x4f9887,_0x241f43[_0x3543('0x4b')]),{'include':_0x241f43[_0x3543('0x33')][_0x3543('0x48')]?[{'all':!![]}]:undefined})[_0x3543('0x25')](function(_0x383b02){var _0x5d5bf9=_0x241f43[_0x3543('0x4c')]['get']({'plain':!![]});if(!_0x5d5bf9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d5bf9[_0x3543('0x4e')]===_0x3543('0x4c')){var _0xc2840f=_0x383b02[_0x3543('0x27')]({'plain':!![]});var _0x55ffe6=_0x3543('0x28');return db[_0x3543('0x54')][_0x3543('0x49')]({'where':{'name':_0x55ffe6,'userProfileId':_0x5d5bf9[_0x3543('0x55')]},'raw':!![]})[_0x3543('0x25')](function(_0x5e760f){if(_0x5e760f&&_0x5e760f[_0x3543('0x4f')]===0x0){return db[_0x3543('0x29')][_0x3543('0x4a')]({'name':_0xc2840f[_0x3543('0x2b')],'resourceId':_0xc2840f['id'],'type':_0x5e760f[_0x3543('0x2b')],'sectionId':_0x5e760f['id']},{})['then'](function(){return _0x383b02;});}else{return _0x383b02;}})['catch'](function(_0x844aea){logger[_0x3543('0x2a')](_0x3543('0x50'),_0x844aea);throw _0x844aea;});}return _0x383b02;});}})[_0x3543('0x25')](respondWithResult(_0x1b7b6c,0xc9))['catch'](handleError(_0x1b7b6c,null));};exports[_0x3543('0x24')]=function(_0x529e2c,_0x2c6581){if(_0x529e2c[_0x3543('0x4b')]['id']){delete _0x529e2c[_0x3543('0x4b')]['id'];}return db[_0x3543('0x2e')][_0x3543('0x49')]({'where':{'id':_0x529e2c[_0x3543('0x47')]['id']}})[_0x3543('0x25')](handleEntityNotFound(_0x2c6581,null))[_0x3543('0x25')](saveUpdates(_0x529e2c['body'],null))[_0x3543('0x25')](respondWithResult(_0x2c6581,null))[_0x3543('0x45')](handleError(_0x2c6581,null));};exports[_0x3543('0x26')]=function(_0x3ff9d0,_0x25b188){return db[_0x3543('0x2e')]['find']({'where':{'id':_0x3ff9d0[_0x3543('0x47')]['id']}})['then'](handleEntityNotFound(_0x25b188,null))[_0x3543('0x25')](removeEntity(_0x25b188,null))[_0x3543('0x45')](handleError(_0x25b188,null));};exports[_0x3543('0x56')]=function(_0xfbb93e,_0x3b60a6,_0x32396a){var _0x43ae2e={'raw':!![],'where':{}};var _0x11fb35={};var _0x6aac1={'count':0x0,'rows':[]};return db[_0x3543('0x2e')]['findOne']({'where':{'id':_0xfbb93e[_0x3543('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b60a6,null))[_0x3543('0x25')](function(_0x587b73){if(_0x587b73){_0x11fb35[_0x3543('0x32')]=_[_0x3543('0x34')](db[_0x3543('0x57')]['rawAttributes']);_0x11fb35[_0x3543('0x33')]=_[_0x3543('0x34')](_0xfbb93e['query']);_0x11fb35[_0x3543('0x35')]=_[_0x3543('0x36')](_0x11fb35[_0x3543('0x32')],_0x11fb35[_0x3543('0x33')]);_0x43ae2e[_0x3543('0x37')]=_[_0x3543('0x36')](_0x11fb35['model'],qs[_0x3543('0x38')](_0xfbb93e[_0x3543('0x33')]['fields']));_0x43ae2e[_0x3543('0x37')]=_0x43ae2e[_0x3543('0x37')][_0x3543('0x51')]?_0x43ae2e[_0x3543('0x37')]:_0x11fb35[_0x3543('0x32')];if(!_0xfbb93e['query'][_0x3543('0x39')](_0x3543('0x3a'))){_0x43ae2e[_0x3543('0x1d')]=qs[_0x3543('0x1d')](_0xfbb93e['query'][_0x3543('0x1d')]);_0x43ae2e[_0x3543('0x1f')]=qs[_0x3543('0x1f')](_0xfbb93e[_0x3543('0x33')][_0x3543('0x1f')]);}_0x43ae2e['order']=qs[_0x3543('0x3c')](_0xfbb93e[_0x3543('0x33')]['sort']);_0x43ae2e[_0x3543('0x3d')]=qs[_0x3543('0x35')](_[_0x3543('0x3e')](_0xfbb93e[_0x3543('0x33')],_0x11fb35[_0x3543('0x35')]));_0x43ae2e[_0x3543('0x3d')][_0x3543('0x58')]=_0x587b73['id'];if(_0xfbb93e[_0x3543('0x33')]['filter']){_0x43ae2e[_0x3543('0x3d')]=_['merge'](_0x43ae2e['where'],{'$or':_[_0x3543('0x2d')](_0x43ae2e[_0x3543('0x37')],function(_0x566375){var _0x16f43b={};_0x16f43b[_0x566375]={'$like':'%'+_0xfbb93e['query'][_0x3543('0x3f')]+'%'};return _0x16f43b;})});}_0x43ae2e=_[_0x3543('0x40')]({},_0x43ae2e,_0xfbb93e['options']);return db['JscriptySessionReport']['count']({'where':_0x43ae2e['where']})[_0x3543('0x25')](function(_0x576c38){_0x6aac1[_0x3543('0x1e')]=_0x576c38;if(_0xfbb93e[_0x3543('0x33')][_0x3543('0x48')]){_0x43ae2e[_0x3543('0x42')]=[{'all':!![]}];}return db[_0x3543('0x57')][_0x3543('0x43')](_0x43ae2e);})['then'](function(_0x30763f){_0x6aac1[_0x3543('0x44')]=_0x30763f;return _0x6aac1;});}})[_0x3543('0x25')](respondWithFilteredResult(_0x3b60a6,_0x43ae2e))['catch'](handleError(_0x3b60a6,null));};exports['getAnswers']=function(_0xc1f308,_0x3d605d,_0x368fb8){var _0x366076={'raw':!![],'where':{}};var _0x2caa07={};var _0x13d230={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x3543('0x59')]({'where':{'id':_0xc1f308[_0x3543('0x47')]['id']}})[_0x3543('0x25')](handleEntityNotFound(_0x3d605d,null))[_0x3543('0x25')](function(_0x1fb05d){if(_0x1fb05d){_0x2caa07[_0x3543('0x32')]=_[_0x3543('0x34')](db[_0x3543('0x5a')][_0x3543('0x2f')]);_0x2caa07['query']=_[_0x3543('0x34')](_0xc1f308[_0x3543('0x33')]);_0x2caa07['filters']=_[_0x3543('0x36')](_0x2caa07[_0x3543('0x32')],_0x2caa07['query']);_0x366076[_0x3543('0x37')]=_[_0x3543('0x36')](_0x2caa07['model'],qs['fields'](_0xc1f308[_0x3543('0x33')][_0x3543('0x38')]));_0x366076[_0x3543('0x37')]=_0x366076[_0x3543('0x37')][_0x3543('0x51')]?_0x366076[_0x3543('0x37')]:_0x2caa07[_0x3543('0x32')];if(!_0xc1f308[_0x3543('0x33')]['hasOwnProperty'](_0x3543('0x3a'))){_0x366076['limit']=qs[_0x3543('0x1d')](_0xc1f308[_0x3543('0x33')][_0x3543('0x1d')]);_0x366076['offset']=qs[_0x3543('0x1f')](_0xc1f308[_0x3543('0x33')]['offset']);}_0x366076['order']=qs['sort'](_0xc1f308[_0x3543('0x33')][_0x3543('0x3c')]);_0x366076[_0x3543('0x3d')]=qs['filters'](_['pick'](_0xc1f308[_0x3543('0x33')],_0x2caa07[_0x3543('0x35')]));_0x366076['where']['ProjectId']=_0x1fb05d['id'];if(_0xc1f308['query'][_0x3543('0x3f')]){_0x366076[_0x3543('0x3d')]=_[_0x3543('0x40')](_0x366076[_0x3543('0x3d')],{'$or':_['map'](_0x366076[_0x3543('0x37')],function(_0x26cae6){var _0x338cb1={};_0x338cb1[_0x26cae6]={'$like':'%'+_0xc1f308[_0x3543('0x33')][_0x3543('0x3f')]+'%'};return _0x338cb1;})});}_0x366076=_['merge']({},_0x366076,_0xc1f308['options']);return db[_0x3543('0x5a')][_0x3543('0x1e')]({'where':_0x366076['where']})[_0x3543('0x25')](function(_0xbc603a){_0x13d230[_0x3543('0x1e')]=_0xbc603a;if(_0xc1f308[_0x3543('0x33')][_0x3543('0x48')]){_0x366076['include']=[{'all':!![]}];}return db[_0x3543('0x5a')][_0x3543('0x43')](_0x366076);})[_0x3543('0x25')](function(_0x272885){_0x13d230[_0x3543('0x44')]=_0x272885;return _0x13d230;});}})[_0x3543('0x25')](respondWithFilteredResult(_0x3d605d,_0x366076))[_0x3543('0x45')](handleError(_0x3d605d,null));};function char(_0x4c15df){return _0x3543('0x5b')===typeof _0x4c15df?String[_0x3543('0x5c')][_0x3543('0x22')](null,arguments):_0x4c15df;}function needsEncapsulation(_0x162ba0){return!!_0x162ba0&&(_0x162ba0[_0x3543('0x5d')]()[_0x3543('0x5e')](char(0xd))>=0x0||_0x162ba0[_0x3543('0x5d')]()[_0x3543('0x5e')](char(0xa))>=0x0||_0x162ba0['toString']()[_0x3543('0x5e')](char(0x2c))>=0x0||_0x162ba0[_0x3543('0x5d')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4ab228){var _0x45704e=char(0x22),_0x16b30a='\x5c'+char(0x22),_0x2dc88=_0x4ab228[_0x3543('0x5d')]()[_0x3543('0x5f')](new RegExp(_0x45704e,'g'),_0x16b30a);return _0x45704e+_0x2dc88+_0x45704e;}exports[_0x3543('0x60')]=function(_0x5ca968,_0x3fe65c,_0x4f4fcb){var _0x1a5bc4,_0x6afb20;var _0x3881ff={'where':{'ProjectId':_0x5ca968[_0x3543('0x47')]['id']}};if(_0x5ca968[_0x3543('0x33')][_0x3543('0x61')]){_0x3881ff[_0x3543('0x3d')]['starttime']=JSON[_0x3543('0x62')](_0x5ca968['query'][_0x3543('0x61')]);}return db[_0x3543('0x57')][_0x3543('0x43')](_0x3881ff)[_0x3543('0x25')](handleEntityNotFound(_0x3fe65c,null))['then'](function(_0x30f63a){if(_0x30f63a){_0x1a5bc4=_0x30f63a;return db[_0x3543('0x63')]['findAll']({'where':{'SessionId':{'$in':_[_0x3543('0x2d')](_0x1a5bc4,'id')},'ProjectId':_0x5ca968['params']['id']},'order':_0x3543('0x64')});}})['then'](handleEntityNotFound(_0x3fe65c,null))['then'](function(_0x140808){if(_0x140808){_0x6afb20=_0x140808;var _0x103c54={};for(var _0x254e66=0x0,_0x1c6c97=_0x6afb20[_0x3543('0x51')];_0x254e66<_0x1c6c97;_0x254e66++){if(!_0x103c54[_0x3543('0x39')](_0x6afb20[_0x254e66][_0x3543('0x65')])){_0x103c54[_0x6afb20[_0x254e66][_0x3543('0x65')]]=needsEncapsulation(_0x6afb20[_0x254e66][_0x3543('0x66')])?encapsulate(_0x6afb20[_0x254e66][_0x3543('0x66')]):_0x6afb20[_0x254e66]['question'];}}var _0x54f112=[],_0x40672c={};for(var _0x2712b6=0x0,_0xed25e4=_0x1a5bc4['length'];_0x2712b6<_0xed25e4;_0x2712b6++){_0x40672c={'ProjectId':_0x5ca968[_0x3543('0x47')]['id'],'SessionId':_0x1a5bc4[_0x2712b6]['id'],'StartTime':moment(_0x1a5bc4[_0x2712b6][_0x3543('0x67')])[_0x3543('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x539c79=0x0,_0x2e7693=_0x6afb20[_0x3543('0x51')];_0x539c79<_0x2e7693;_0x539c79++){if(_0x6afb20[_0x539c79][_0x3543('0x69')]==_0x1a5bc4[_0x2712b6]['id']&&_0x103c54['hasOwnProperty'](_0x6afb20[_0x539c79][_0x3543('0x65')])){_0x40672c[_0x103c54[_0x6afb20[_0x539c79][_0x3543('0x65')]]]=_0x6afb20[_0x539c79][_0x3543('0x6a')];}}for(var _0x129e0c in _0x103c54){if(!_0x40672c['hasOwnProperty'](_0x103c54[_0x129e0c])){_0x40672c[_0x103c54[_0x129e0c]]=null;}}_0x54f112[_0x3543('0x6b')](_0x40672c);}return _0x54f112;}})['then'](function(_0x5f285a){if(!_['isEmpty'](_0x5f285a)){var _0x4f6a52=toCsv(_0x5f285a);var _0x122858=Date[_0x3543('0x6c')]();fs[_0x3543('0x6d')](util[_0x3543('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5ca968['params']['id'],_0x122858),_0x4f6a52);_0x3fe65c['setHeader'](_0x3543('0x6e'),_0x3543('0x6f')+util[_0x3543('0x68')](_0x3543('0x70'),_0x5ca968[_0x3543('0x47')]['id'],_0x122858));_0x3fe65c[_0x3543('0x71')](_0x3543('0x72'),_0x3543('0x73'));return _0x3fe65c['download'](util['format'](_0x3543('0x74'),_0x5ca968[_0x3543('0x47')]['id'],_0x122858));}else{return _0x3fe65c[_0x3543('0x75')](0xcc);}})['catch'](handleError(_0x3fe65c,null));}; \ No newline at end of file +var _0x6554=['replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','Projects','UserProfileResource','error','stack','name','JscriptyProject','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','rawAttributes','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','clone','omit','createdAt','updatedAt','userProfileId','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf'];(function(_0x10a19d,_0x13b133){var _0x4af422=function(_0x5519ef){while(--_0x5519ef){_0x10a19d['push'](_0x10a19d['shift']());}};_0x4af422(++_0x13b133);}(_0x6554,0x181));var _0x4655=function(_0x1990b5,_0x3f7205){_0x1990b5=_0x1990b5-0x0;var _0x5717ae=_0x6554[_0x1990b5];return _0x5717ae;};'use strict';var emlformat=require(_0x4655('0x0'));var rimraf=require(_0x4655('0x1'));var zipdir=require(_0x4655('0x2'));var jsonpatch=require(_0x4655('0x3'));var rp=require(_0x4655('0x4'));var moment=require(_0x4655('0x5'));var BPromise=require(_0x4655('0x6'));var Mustache=require(_0x4655('0x7'));var util=require(_0x4655('0x8'));var path=require(_0x4655('0x9'));var sox=require(_0x4655('0xa'));var csv=require(_0x4655('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4655('0xc'));var _=require(_0x4655('0xd'));var squel=require(_0x4655('0xe'));var crypto=require(_0x4655('0xf'));var jsforce=require(_0x4655('0x10'));var deskjs=require(_0x4655('0x11'));var toCsv=require(_0x4655('0xb'));var querystring=require(_0x4655('0x12'));var Papa=require(_0x4655('0x13'));var Redis=require('ioredis');var authService=require(_0x4655('0x14'));var qs=require(_0x4655('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4655('0x16'));var utils=require(_0x4655('0x17'));var config=require(_0x4655('0x18'));var licenseUtil=require(_0x4655('0x19'));var db=require(_0x4655('0x1a'))['db'];function respondWithStatusCode(_0x17b5ec,_0x593a3d){_0x593a3d=_0x593a3d||0xcc;return function(_0x58254b){if(_0x58254b){return _0x17b5ec[_0x4655('0x1b')](_0x593a3d);}return _0x17b5ec[_0x4655('0x1c')](_0x593a3d)[_0x4655('0x1d')]();};}function respondWithResult(_0x1a0bd3,_0x3414b1){_0x3414b1=_0x3414b1||0xc8;return function(_0x3dc6f4){if(_0x3dc6f4){return _0x1a0bd3[_0x4655('0x1c')](_0x3414b1)[_0x4655('0x1e')](_0x3dc6f4);}};}function respondWithFilteredResult(_0x155345,_0x5bd152){return function(_0x12baa3){if(_0x12baa3){var _0x600fc5=typeof _0x5bd152['offset']===_0x4655('0x1f')&&typeof _0x5bd152[_0x4655('0x20')]==='undefined';var _0x5f50f0=_0x12baa3['count'];var _0x313688=_0x600fc5?0x0:_0x5bd152['offset'];var _0x3dcc5d=_0x600fc5?_0x12baa3['count']:_0x5bd152['offset']+_0x5bd152['limit'];var _0x2c700a;if(_0x3dcc5d>=_0x5f50f0){_0x3dcc5d=_0x5f50f0;_0x2c700a=0xc8;}else{_0x2c700a=0xce;}_0x155345[_0x4655('0x1c')](_0x2c700a);return _0x155345[_0x4655('0x21')](_0x4655('0x22'),_0x313688+'-'+_0x3dcc5d+'/'+_0x5f50f0)['json'](_0x12baa3);}return null;};}function patchUpdates(_0x4013f2){return function(_0x3cd8af){try{jsonpatch[_0x4655('0x23')](_0x3cd8af,_0x4013f2,!![]);}catch(_0x5a2869){return BPromise[_0x4655('0x24')](_0x5a2869);}return _0x3cd8af[_0x4655('0x25')]();};}function saveUpdates(_0x7fdd6e,_0x3ec4b6){return function(_0x27b5ec){if(_0x27b5ec){return _0x27b5ec[_0x4655('0x26')](_0x7fdd6e)[_0x4655('0x27')](function(_0x4af6b6){return _0x4af6b6;});}return null;};}function removeEntity(_0x156ab5,_0x4a8843){return function(_0x49d35e){if(_0x49d35e){return _0x49d35e[_0x4655('0x28')]()[_0x4655('0x27')](function(){var _0x3602d6=_0x49d35e['get']({'plain':!![]});var _0x38fb70=_0x4655('0x29');return db[_0x4655('0x2a')][_0x4655('0x28')]({'where':{'type':_0x38fb70,'resourceId':_0x3602d6['id']}})[_0x4655('0x27')](function(){return _0x49d35e;});})[_0x4655('0x27')](function(){_0x156ab5[_0x4655('0x1c')](0xcc)[_0x4655('0x1d')]();});}};}function handleEntityNotFound(_0x5ad27b,_0x23c91a){return function(_0x31574a){if(!_0x31574a){_0x5ad27b[_0x4655('0x1b')](0x194);}return _0x31574a;};}function handleError(_0x1c858f,_0x266f8c){_0x266f8c=_0x266f8c||0x1f4;return function(_0x2bcc5a){logger[_0x4655('0x2b')](_0x2bcc5a[_0x4655('0x2c')]);if(_0x2bcc5a[_0x4655('0x2d')]){delete _0x2bcc5a[_0x4655('0x2d')];}_0x1c858f[_0x4655('0x1c')](_0x266f8c)['send'](_0x2bcc5a);};}exports['index']=function(_0x353de8,_0x2e6c6b){var _0x1fff08={},_0x409d1d={},_0x430fde={'count':0x0,'rows':[]};var _0x10de7b=_['map'](db[_0x4655('0x2e')]['rawAttributes'],function(_0x1331c5){return{'name':_0x1331c5[_0x4655('0x2f')],'type':_0x1331c5[_0x4655('0x30')][_0x4655('0x31')]};});_0x409d1d[_0x4655('0x32')]=_[_0x4655('0x33')](_0x10de7b,_0x4655('0x2d'));_0x409d1d[_0x4655('0x34')]=_['keys'](_0x353de8[_0x4655('0x34')]);_0x409d1d[_0x4655('0x35')]=_[_0x4655('0x36')](_0x409d1d[_0x4655('0x32')],_0x409d1d[_0x4655('0x34')]);_0x1fff08['attributes']=_[_0x4655('0x36')](_0x409d1d[_0x4655('0x32')],qs[_0x4655('0x37')](_0x353de8[_0x4655('0x34')][_0x4655('0x37')]));_0x1fff08['attributes']=_0x1fff08[_0x4655('0x38')][_0x4655('0x39')]?_0x1fff08[_0x4655('0x38')]:_0x409d1d['model'];if(!_0x353de8[_0x4655('0x34')][_0x4655('0x3a')](_0x4655('0x3b'))){_0x1fff08[_0x4655('0x20')]=qs[_0x4655('0x20')](_0x353de8[_0x4655('0x34')][_0x4655('0x20')]);_0x1fff08[_0x4655('0x3c')]=qs[_0x4655('0x3c')](_0x353de8['query'][_0x4655('0x3c')]);}_0x1fff08[_0x4655('0x3d')]=qs['sort'](_0x353de8['query'][_0x4655('0x3e')]);_0x1fff08[_0x4655('0x3f')]=qs[_0x4655('0x35')](_[_0x4655('0x40')](_0x353de8['query'],_0x409d1d[_0x4655('0x35')]),_0x10de7b);if(_0x353de8['query'][_0x4655('0x41')]){_0x1fff08[_0x4655('0x3f')]=_['merge'](_0x1fff08[_0x4655('0x3f')],{'$or':_[_0x4655('0x33')](_0x10de7b,function(_0x141173){if(_0x141173['type']!==_0x4655('0x42')){var _0x403656={};_0x403656[_0x141173[_0x4655('0x2d')]]={'$like':'%'+_0x353de8[_0x4655('0x34')][_0x4655('0x41')]+'%'};return _0x403656;}})});}_0x1fff08=_['merge']({},_0x1fff08,_0x353de8[_0x4655('0x43')]);var _0x1d5474={'where':_0x1fff08['where']};return db[_0x4655('0x2e')][_0x4655('0x44')](_0x1d5474)[_0x4655('0x27')](function(_0x2a1be5){_0x430fde['count']=_0x2a1be5;if(_0x353de8['query'][_0x4655('0x45')]){_0x1fff08[_0x4655('0x46')]=[{'all':!![]}];}return db['JscriptyProject'][_0x4655('0x47')](_0x1fff08);})[_0x4655('0x27')](function(_0x98c1e1){_0x430fde[_0x4655('0x48')]=_0x98c1e1;return _0x430fde;})['then'](respondWithFilteredResult(_0x2e6c6b,_0x1fff08))['catch'](handleError(_0x2e6c6b,null));};exports[_0x4655('0x49')]=function(_0x4857ae,_0x4b380e){var _0x8a77a0={'raw':![],'where':{'id':_0x4857ae[_0x4655('0x4a')]['id']}},_0x3ef6f6={};_0x3ef6f6[_0x4655('0x32')]=_[_0x4655('0x4b')](db[_0x4655('0x2e')][_0x4655('0x4c')]);_0x3ef6f6[_0x4655('0x34')]=_[_0x4655('0x4b')](_0x4857ae[_0x4655('0x34')]);_0x3ef6f6[_0x4655('0x35')]=_[_0x4655('0x36')](_0x3ef6f6[_0x4655('0x32')],_0x3ef6f6[_0x4655('0x34')]);_0x8a77a0[_0x4655('0x38')]=_['intersection'](_0x3ef6f6[_0x4655('0x32')],qs[_0x4655('0x37')](_0x4857ae[_0x4655('0x34')][_0x4655('0x37')]));_0x8a77a0['attributes']=_0x8a77a0[_0x4655('0x38')][_0x4655('0x39')]?_0x8a77a0[_0x4655('0x38')]:_0x3ef6f6['model'];if(_0x4857ae[_0x4655('0x34')][_0x4655('0x45')]){_0x8a77a0[_0x4655('0x46')]=[{'all':!![]}];}_0x8a77a0=_[_0x4655('0x4d')]({},_0x8a77a0,_0x4857ae['options']);return db[_0x4655('0x2e')][_0x4655('0x4e')](_0x8a77a0)[_0x4655('0x27')](handleEntityNotFound(_0x4b380e,null))[_0x4655('0x27')](respondWithResult(_0x4b380e,null))[_0x4655('0x4f')](handleError(_0x4b380e,null));};exports[_0x4655('0x50')]=function(_0x3d65fb,_0x13057c){return db['JscriptyProject'][_0x4655('0x50')](_0x3d65fb[_0x4655('0x51')],{})[_0x4655('0x27')](function(_0x253043){var _0x51b726=_0x3d65fb[_0x4655('0x52')]['get']({'plain':!![]});if(!_0x51b726)throw new Error(_0x4655('0x53'));if(_0x51b726[_0x4655('0x54')]==='user'){var _0x7c20cc=_0x253043[_0x4655('0x55')]({'plain':!![]});var _0x1d3e2b=_0x4655('0x29');return db[_0x4655('0x56')][_0x4655('0x4e')]({'where':{'name':_0x1d3e2b,'userProfileId':_0x51b726['userProfileId']},'raw':!![]})[_0x4655('0x27')](function(_0x22bcce){if(_0x22bcce&&_0x22bcce[_0x4655('0x57')]===0x0){return db[_0x4655('0x2a')][_0x4655('0x50')]({'name':_0x7c20cc[_0x4655('0x2d')],'resourceId':_0x7c20cc['id'],'type':_0x22bcce[_0x4655('0x2d')],'sectionId':_0x22bcce['id']},{})['then'](function(){return _0x253043;});}else{return _0x253043;}})['catch'](function(_0xdec203){logger[_0x4655('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdec203);throw _0xdec203;});}return _0x253043;})[_0x4655('0x27')](respondWithResult(_0x13057c,0xc9))[_0x4655('0x4f')](handleError(_0x13057c,null));};exports[_0x4655('0x58')]=function(_0x1e91f9,_0x4a46e4){var _0x37e53c={'where':{'id':_0x1e91f9[_0x4655('0x4a')]['id']}},_0x426e11={};_0x426e11['model']=_[_0x4655('0x4b')](db[_0x4655('0x2e')][_0x4655('0x4c')]);_0x37e53c[_0x4655('0x38')]=_[_0x4655('0x36')](_0x426e11['model'],qs[_0x4655('0x37')](_0x1e91f9[_0x4655('0x34')][_0x4655('0x37')]));_0x37e53c[_0x4655('0x38')]=_0x37e53c['attributes'][_0x4655('0x39')]?_0x37e53c[_0x4655('0x38')]:_0x426e11[_0x4655('0x32')];if(_0x1e91f9[_0x4655('0x34')][_0x4655('0x45')]){_0x37e53c[_0x4655('0x46')]=[{'all':!![]}];}_0x37e53c=_['merge']({},_0x37e53c,_0x1e91f9['options']);return db['JscriptyProject'][_0x4655('0x4e')](_0x37e53c)[_0x4655('0x27')](handleEntityNotFound(_0x4a46e4,null))[_0x4655('0x27')](function(_0x720d89){if(_0x720d89){var _0xf8970d=_0x720d89['get']({'plain':!![]});_0xf8970d=qs[_0x4655('0x59')](_0xf8970d,['id',_0x4655('0x5a'),_0x4655('0x5b')]);_0x1e91f9['body']=_['omit'](_0x1e91f9[_0x4655('0x51')],['id','createdAt',_0x4655('0x5b')]);return db[_0x4655('0x2e')]['create'](_[_0x4655('0x4d')](_0xf8970d,_0x1e91f9[_0x4655('0x51')]),{'include':_0x1e91f9[_0x4655('0x34')][_0x4655('0x45')]?[{'all':!![]}]:undefined})[_0x4655('0x27')](function(_0xf3c497){var _0x3daf98=_0x1e91f9[_0x4655('0x52')][_0x4655('0x55')]({'plain':!![]});if(!_0x3daf98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3daf98[_0x4655('0x54')]===_0x4655('0x52')){var _0x1e9044=_0xf3c497['get']({'plain':!![]});var _0x3654a3=_0x4655('0x29');return db['UserProfileSection'][_0x4655('0x4e')]({'where':{'name':_0x3654a3,'userProfileId':_0x3daf98[_0x4655('0x5c')]},'raw':!![]})[_0x4655('0x27')](function(_0x33f1e6){if(_0x33f1e6&&_0x33f1e6[_0x4655('0x57')]===0x0){return db['UserProfileResource'][_0x4655('0x50')]({'name':_0x1e9044['name'],'resourceId':_0x1e9044['id'],'type':_0x33f1e6[_0x4655('0x2d')],'sectionId':_0x33f1e6['id']},{})[_0x4655('0x27')](function(){return _0xf3c497;});}else{return _0xf3c497;}})['catch'](function(_0x30a23b){logger[_0x4655('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30a23b);throw _0x30a23b;});}return _0xf3c497;});}})[_0x4655('0x27')](respondWithResult(_0x4a46e4,0xc9))[_0x4655('0x4f')](handleError(_0x4a46e4,null));};exports[_0x4655('0x26')]=function(_0x45a1e8,_0x4370cd){if(_0x45a1e8['body']['id']){delete _0x45a1e8[_0x4655('0x51')]['id'];}return db[_0x4655('0x2e')][_0x4655('0x4e')]({'where':{'id':_0x45a1e8['params']['id']}})['then'](handleEntityNotFound(_0x4370cd,null))['then'](saveUpdates(_0x45a1e8['body'],null))[_0x4655('0x27')](respondWithResult(_0x4370cd,null))[_0x4655('0x4f')](handleError(_0x4370cd,null));};exports[_0x4655('0x28')]=function(_0x1abe96,_0x23e0df){return db[_0x4655('0x2e')][_0x4655('0x4e')]({'where':{'id':_0x1abe96[_0x4655('0x4a')]['id']}})['then'](handleEntityNotFound(_0x23e0df,null))[_0x4655('0x27')](removeEntity(_0x23e0df,null))['catch'](handleError(_0x23e0df,null));};exports[_0x4655('0x5d')]=function(_0x2273fe,_0x35b8f5,_0x1aa975){var _0x9fe979={'raw':!![],'where':{}};var _0x931606={};var _0x41eb32={'count':0x0,'rows':[]};return db[_0x4655('0x2e')][_0x4655('0x5e')]({'where':{'id':_0x2273fe[_0x4655('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35b8f5,null))[_0x4655('0x27')](function(_0x33511f){if(_0x33511f){_0x931606[_0x4655('0x32')]=_['keys'](db[_0x4655('0x5f')][_0x4655('0x4c')]);_0x931606[_0x4655('0x34')]=_[_0x4655('0x4b')](_0x2273fe[_0x4655('0x34')]);_0x931606['filters']=_[_0x4655('0x36')](_0x931606['model'],_0x931606[_0x4655('0x34')]);_0x9fe979['attributes']=_[_0x4655('0x36')](_0x931606[_0x4655('0x32')],qs[_0x4655('0x37')](_0x2273fe[_0x4655('0x34')][_0x4655('0x37')]));_0x9fe979[_0x4655('0x38')]=_0x9fe979[_0x4655('0x38')][_0x4655('0x39')]?_0x9fe979[_0x4655('0x38')]:_0x931606[_0x4655('0x32')];if(!_0x2273fe[_0x4655('0x34')][_0x4655('0x3a')](_0x4655('0x3b'))){_0x9fe979['limit']=qs['limit'](_0x2273fe['query']['limit']);_0x9fe979['offset']=qs['offset'](_0x2273fe[_0x4655('0x34')]['offset']);}_0x9fe979[_0x4655('0x3d')]=qs[_0x4655('0x3e')](_0x2273fe[_0x4655('0x34')]['sort']);_0x9fe979['where']=qs[_0x4655('0x35')](_[_0x4655('0x40')](_0x2273fe[_0x4655('0x34')],_0x931606[_0x4655('0x35')]));_0x9fe979[_0x4655('0x3f')][_0x4655('0x60')]=_0x33511f['id'];if(_0x2273fe['query'][_0x4655('0x41')]){_0x9fe979['where']=_['merge'](_0x9fe979[_0x4655('0x3f')],{'$or':_[_0x4655('0x33')](_0x9fe979['attributes'],function(_0x28e92f){var _0x3f625d={};_0x3f625d[_0x28e92f]={'$like':'%'+_0x2273fe[_0x4655('0x34')][_0x4655('0x41')]+'%'};return _0x3f625d;})});}_0x9fe979=_[_0x4655('0x4d')]({},_0x9fe979,_0x2273fe[_0x4655('0x43')]);return db[_0x4655('0x5f')][_0x4655('0x44')]({'where':_0x9fe979[_0x4655('0x3f')]})[_0x4655('0x27')](function(_0x1dc1ee){_0x41eb32[_0x4655('0x44')]=_0x1dc1ee;if(_0x2273fe['query'][_0x4655('0x45')]){_0x9fe979[_0x4655('0x46')]=[{'all':!![]}];}return db[_0x4655('0x5f')][_0x4655('0x47')](_0x9fe979);})['then'](function(_0x32f55c){_0x41eb32[_0x4655('0x48')]=_0x32f55c;return _0x41eb32;});}})[_0x4655('0x27')](respondWithFilteredResult(_0x35b8f5,_0x9fe979))[_0x4655('0x4f')](handleError(_0x35b8f5,null));};exports[_0x4655('0x61')]=function(_0x282218,_0x34c337,_0x37632b){var _0x3c1411={'raw':!![],'where':{}};var _0x9aaedd={};var _0x14cb7f={'count':0x0,'rows':[]};return db[_0x4655('0x2e')][_0x4655('0x5e')]({'where':{'id':_0x282218[_0x4655('0x4a')]['id']}})[_0x4655('0x27')](handleEntityNotFound(_0x34c337,null))['then'](function(_0x565959){if(_0x565959){_0x9aaedd[_0x4655('0x32')]=_[_0x4655('0x4b')](db['JscriptyAnswerReport'][_0x4655('0x4c')]);_0x9aaedd[_0x4655('0x34')]=_['keys'](_0x282218[_0x4655('0x34')]);_0x9aaedd[_0x4655('0x35')]=_[_0x4655('0x36')](_0x9aaedd[_0x4655('0x32')],_0x9aaedd[_0x4655('0x34')]);_0x3c1411['attributes']=_[_0x4655('0x36')](_0x9aaedd[_0x4655('0x32')],qs['fields'](_0x282218[_0x4655('0x34')]['fields']));_0x3c1411[_0x4655('0x38')]=_0x3c1411[_0x4655('0x38')][_0x4655('0x39')]?_0x3c1411[_0x4655('0x38')]:_0x9aaedd[_0x4655('0x32')];if(!_0x282218[_0x4655('0x34')]['hasOwnProperty'](_0x4655('0x3b'))){_0x3c1411[_0x4655('0x20')]=qs['limit'](_0x282218[_0x4655('0x34')][_0x4655('0x20')]);_0x3c1411[_0x4655('0x3c')]=qs[_0x4655('0x3c')](_0x282218[_0x4655('0x34')][_0x4655('0x3c')]);}_0x3c1411[_0x4655('0x3d')]=qs[_0x4655('0x3e')](_0x282218[_0x4655('0x34')][_0x4655('0x3e')]);_0x3c1411['where']=qs[_0x4655('0x35')](_[_0x4655('0x40')](_0x282218[_0x4655('0x34')],_0x9aaedd[_0x4655('0x35')]));_0x3c1411[_0x4655('0x3f')][_0x4655('0x60')]=_0x565959['id'];if(_0x282218['query']['filter']){_0x3c1411[_0x4655('0x3f')]=_[_0x4655('0x4d')](_0x3c1411[_0x4655('0x3f')],{'$or':_[_0x4655('0x33')](_0x3c1411[_0x4655('0x38')],function(_0x1d2c61){var _0xa23271={};_0xa23271[_0x1d2c61]={'$like':'%'+_0x282218['query'][_0x4655('0x41')]+'%'};return _0xa23271;})});}_0x3c1411=_[_0x4655('0x4d')]({},_0x3c1411,_0x282218[_0x4655('0x43')]);return db[_0x4655('0x62')][_0x4655('0x44')]({'where':_0x3c1411[_0x4655('0x3f')]})['then'](function(_0x41b60e){_0x14cb7f[_0x4655('0x44')]=_0x41b60e;if(_0x282218[_0x4655('0x34')]['includeAll']){_0x3c1411[_0x4655('0x46')]=[{'all':!![]}];}return db[_0x4655('0x62')]['findAll'](_0x3c1411);})['then'](function(_0x1edf67){_0x14cb7f['rows']=_0x1edf67;return _0x14cb7f;});}})[_0x4655('0x27')](respondWithFilteredResult(_0x34c337,_0x3c1411))[_0x4655('0x4f')](handleError(_0x34c337,null));};function char(_0x77acf1){return _0x4655('0x63')===typeof _0x77acf1?String[_0x4655('0x64')][_0x4655('0x23')](null,arguments):_0x77acf1;}function needsEncapsulation(_0x406acc){return!!_0x406acc&&(_0x406acc[_0x4655('0x65')]()['indexOf'](char(0xd))>=0x0||_0x406acc[_0x4655('0x65')]()[_0x4655('0x66')](char(0xa))>=0x0||_0x406acc['toString']()[_0x4655('0x66')](char(0x2c))>=0x0||_0x406acc['toString']()[_0x4655('0x66')](char(0x22))>=0x0);}function encapsulate(_0x30df4b){var _0x567322=char(0x22),_0x41a53d='\x5c'+char(0x22),_0x25ecd4=_0x30df4b[_0x4655('0x65')]()[_0x4655('0x67')](new RegExp(_0x567322,'g'),_0x41a53d);return _0x567322+_0x25ecd4+_0x567322;}exports[_0x4655('0x68')]=function(_0x4e5026,_0x5a90dc,_0x57a29a){var _0x47dd8a,_0x48573f;var _0x257512={'where':{'ProjectId':_0x4e5026[_0x4655('0x4a')]['id']}};if(_0x4e5026['query'][_0x4655('0x69')]){_0x257512[_0x4655('0x3f')]['starttime']=JSON['parse'](_0x4e5026[_0x4655('0x34')]['startTime']);}return db['JscriptySessionReport'][_0x4655('0x47')](_0x257512)['then'](handleEntityNotFound(_0x5a90dc,null))[_0x4655('0x27')](function(_0xaf35f3){if(_0xaf35f3){_0x47dd8a=_0xaf35f3;return db[_0x4655('0x6a')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x47dd8a,'id')},'ProjectId':_0x4e5026[_0x4655('0x4a')]['id']},'order':_0x4655('0x6b')});}})[_0x4655('0x27')](handleEntityNotFound(_0x5a90dc,null))[_0x4655('0x27')](function(_0x1c89b5){if(_0x1c89b5){_0x48573f=_0x1c89b5;var _0x26ba6b={};for(var _0xc1a1db=0x0,_0x4a41ad=_0x48573f[_0x4655('0x39')];_0xc1a1db<_0x4a41ad;_0xc1a1db++){if(!_0x26ba6b[_0x4655('0x3a')](_0x48573f[_0xc1a1db][_0x4655('0x6c')])){_0x26ba6b[_0x48573f[_0xc1a1db][_0x4655('0x6c')]]=needsEncapsulation(_0x48573f[_0xc1a1db]['question'])?encapsulate(_0x48573f[_0xc1a1db][_0x4655('0x6d')]):_0x48573f[_0xc1a1db][_0x4655('0x6d')];}}var _0x4c39af=[],_0x58efe8={};for(var _0x4222b9=0x0,_0x547c5a=_0x47dd8a[_0x4655('0x39')];_0x4222b9<_0x547c5a;_0x4222b9++){_0x58efe8={'ProjectId':_0x4e5026['params']['id'],'SessionId':_0x47dd8a[_0x4222b9]['id'],'StartTime':moment(_0x47dd8a[_0x4222b9][_0x4655('0x6e')])[_0x4655('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x708164=0x0,_0x5688d9=_0x48573f[_0x4655('0x39')];_0x708164<_0x5688d9;_0x708164++){if(_0x48573f[_0x708164][_0x4655('0x70')]==_0x47dd8a[_0x4222b9]['id']&&_0x26ba6b['hasOwnProperty'](_0x48573f[_0x708164][_0x4655('0x6c')])){_0x58efe8[_0x26ba6b[_0x48573f[_0x708164]['questionId']]]=_0x48573f[_0x708164][_0x4655('0x71')];}}for(var _0x17c6e6 in _0x26ba6b){if(!_0x58efe8[_0x4655('0x3a')](_0x26ba6b[_0x17c6e6])){_0x58efe8[_0x26ba6b[_0x17c6e6]]=null;}}_0x4c39af['push'](_0x58efe8);}return _0x4c39af;}})[_0x4655('0x27')](function(_0x5bcc42){if(!_[_0x4655('0x72')](_0x5bcc42)){var _0x403ec3=toCsv(_0x5bcc42);var _0x4e8d7a=Date[_0x4655('0x73')]();fs[_0x4655('0x74')](util[_0x4655('0x6f')](_0x4655('0x75'),_0x4e5026[_0x4655('0x4a')]['id'],_0x4e8d7a),_0x403ec3);_0x5a90dc[_0x4655('0x76')]('Content-disposition',_0x4655('0x77')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x4e5026[_0x4655('0x4a')]['id'],_0x4e8d7a));_0x5a90dc[_0x4655('0x76')]('Content-type',_0x4655('0x78'));return _0x5a90dc[_0x4655('0x79')](util['format'](_0x4655('0x75'),_0x4e5026[_0x4655('0x4a')]['id'],_0x4e8d7a));}else{return _0x5a90dc[_0x4655('0x1b')](0xcc);}})[_0x4655('0x4f')](handleError(_0x5a90dc,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2083428..a5d1814 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 _0x7edb=['define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','./jscriptyProject.attributes','exports'];(function(_0x2a91c9,_0x1f7712){var _0xa50100=function(_0x2a6a7c){while(--_0x2a6a7c){_0x2a91c9['push'](_0x2a91c9['shift']());}};_0xa50100(++_0x1f7712);}(_0x7edb,0x158));var _0xb7ed=function(_0x463066,_0x2f6be3){_0x463066=_0x463066-0x0;var _0x51e70e=_0x7edb[_0x463066];return _0x51e70e;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var moment=require(_0xb7ed('0x3'));var BPromise=require(_0xb7ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7ed('0x6'));module[_0xb7ed('0x7')]=function(_0x2aa67d,_0x246cfa){return _0x2aa67d[_0xb7ed('0x8')](_0xb7ed('0x9'),attributes,{'tableName':_0xb7ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xff16=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','util','api'];(function(_0x5e55fb,_0x5e6988){var _0x596b88=function(_0x3f5d83){while(--_0x3f5d83){_0x5e55fb['push'](_0x5e55fb['shift']());}};_0x596b88(++_0x5e6988);}(_0xff16,0x7f));var _0x6ff1=function(_0x284871,_0x349390){_0x284871=_0x284871-0x0;var _0x1cceec=_0xff16[_0x284871];return _0x1cceec;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var logger=require('../../config/logger')(_0x6ff1('0x2'));var moment=require(_0x6ff1('0x3'));var BPromise=require(_0x6ff1('0x4'));var rp=require(_0x6ff1('0x5'));var fs=require('fs');var path=require(_0x6ff1('0x6'));var rimraf=require(_0x6ff1('0x7'));var config=require(_0x6ff1('0x8'));var attributes=require(_0x6ff1('0x9'));module['exports']=function(_0x153a91,_0x4f8f24){return _0x153a91[_0x6ff1('0xa')](_0x6ff1('0xb'),attributes,{'tableName':_0x6ff1('0xc'),'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 b8e0488..b269519 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(_0x4b204c,_0x426ffc){var _0x55e23b=function(_0x1d4808){while(--_0x1d4808){_0x4b204c['push'](_0x4b204c['shift']());}};_0x55e23b(++_0x426ffc);}(_0xe706,0xa3));var _0x6e70=function(_0x47137a,_0x5322a7){_0x47137a=_0x47137a-0x0;var _0x573b0a=_0xe706[_0x47137a];return _0x573b0a;};'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 _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x20a30e,_0x3d8ee2){var _0x50d46b=function(_0x20b6c4){while(--_0x20b6c4){_0x20a30e['push'](_0x20a30e['shift']());}};_0x50d46b(++_0x3d8ee2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 20f34e0..e3691d8 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 _0xfe7c=['isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe'];(function(_0x390ef6,_0x1d401c){var _0x2fdaac=function(_0x692ab7){while(--_0x692ab7){_0x390ef6['push'](_0x390ef6['shift']());}};_0x2fdaac(++_0x1d401c);}(_0xfe7c,0x164));var _0xcfe7=function(_0x2893c6,_0x1246dc){_0x2893c6=_0x2893c6-0x0;var _0x239d77=_0xfe7c[_0x2893c6];return _0x239d77;};'use strict';var multer=require(_0xcfe7('0x0'));var util=require(_0xcfe7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcfe7('0x2'));var router=express[_0xcfe7('0x3')]();var fs_extra=require(_0xcfe7('0x4'));var auth=require(_0xcfe7('0x5'));var interaction=require(_0xcfe7('0x6'));var config=require(_0xcfe7('0x7'));var controller=require(_0xcfe7('0x8'));router[_0xcfe7('0x9')]('/',auth['isAuthenticated'](),controller[_0xcfe7('0xa')]);router[_0xcfe7('0x9')](_0xcfe7('0xb'),auth[_0xcfe7('0xc')](),controller[_0xcfe7('0xd')]);router['get']('/:id',auth[_0xcfe7('0xc')](),controller[_0xcfe7('0xe')]);router[_0xcfe7('0xf')]('/',auth[_0xcfe7('0xc')](),controller[_0xcfe7('0x10')]);router[_0xcfe7('0x11')](_0xcfe7('0x12'),auth['isAuthenticated'](),controller[_0xcfe7('0x13')]);router[_0xcfe7('0x14')](_0xcfe7('0x12'),auth[_0xcfe7('0xc')](),controller[_0xcfe7('0x15')]);module[_0xcfe7('0x16')]=router; \ No newline at end of file +var _0x6021=['multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','show','create','put','/:id','destroy','exports'];(function(_0xed01f9,_0x147c66){var _0x13456e=function(_0x57d7de){while(--_0x57d7de){_0xed01f9['push'](_0xed01f9['shift']());}};_0x13456e(++_0x147c66);}(_0x6021,0x132));var _0x1602=function(_0x3f9636,_0x58e973){_0x3f9636=_0x3f9636-0x0;var _0x1fc2cf=_0x6021[_0x3f9636];return _0x1fc2cf;};'use strict';var multer=require(_0x1602('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1602('0x1'));var express=require('express');var router=express[_0x1602('0x2')]();var fs_extra=require(_0x1602('0x3'));var auth=require(_0x1602('0x4'));var interaction=require(_0x1602('0x5'));var config=require('../../config/environment');var controller=require(_0x1602('0x6'));router['get']('/',auth[_0x1602('0x7')](),controller[_0x1602('0x8')]);router[_0x1602('0x9')]('/describe',auth[_0x1602('0x7')](),controller[_0x1602('0xa')]);router['get']('/:id',auth[_0x1602('0x7')](),controller[_0x1602('0xb')]);router['post']('/',auth[_0x1602('0x7')](),controller[_0x1602('0xc')]);router[_0x1602('0xd')]('/:id',auth[_0x1602('0x7')](),controller['update']);router['delete'](_0x1602('0xe'),auth[_0x1602('0x7')](),controller[_0x1602('0xf')]);module[_0x1602('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index cd87a4a..a39fedd 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7a54,0x106));var _0x47a5=function(_0x3d7981,_0x4c67d7){_0x3d7981=_0x3d7981-0x0;var _0x52b00d=_0x7a54[_0x3d7981];return _0x52b00d;};'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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7a54,0x106));var _0x47a5=function(_0x386850,_0xe3a1bf){_0x386850=_0x386850-0x0;var _0x4ec977=_0x7a54[_0x386850];return _0x4ec977;};'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 5b0bfbc..fde33eb 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 _0x4171=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','merge','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware'];(function(_0x2111ac,_0x35382a){var _0x6288c4=function(_0x57f45e){while(--_0x57f45e){_0x2111ac['push'](_0x2111ac['shift']());}};_0x6288c4(++_0x35382a);}(_0x4171,0xcf));var _0x1417=function(_0x54f382,_0x4fba49){_0x54f382=_0x54f382-0x0;var _0x1176e1=_0x4171[_0x54f382];return _0x1176e1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1417('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1417('0x1'));var moment=require(_0x1417('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1417('0x3'));var util=require(_0x1417('0x4'));var path=require(_0x1417('0x5'));var sox=require(_0x1417('0x6'));var csv=require(_0x1417('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1417('0x8'));var squel=require(_0x1417('0x9'));var crypto=require(_0x1417('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1417('0xb'));var toCsv=require(_0x1417('0x7'));var querystring=require('querystring');var Papa=require(_0x1417('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1417('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1417('0xe'));var logger=require(_0x1417('0xf'))(_0x1417('0x10'));var utils=require(_0x1417('0x11'));var config=require(_0x1417('0x12'));var licenseUtil=require(_0x1417('0x13'));var db=require(_0x1417('0x14'))['db'];function respondWithStatusCode(_0x4fd99b,_0x4a8205){_0x4a8205=_0x4a8205||0xcc;return function(_0x27a778){if(_0x27a778){return _0x4fd99b[_0x1417('0x15')](_0x4a8205);}return _0x4fd99b[_0x1417('0x16')](_0x4a8205)[_0x1417('0x17')]();};}function respondWithResult(_0x4a8ba1,_0x5ad419){_0x5ad419=_0x5ad419||0xc8;return function(_0x527631){if(_0x527631){return _0x4a8ba1[_0x1417('0x16')](_0x5ad419)[_0x1417('0x18')](_0x527631);}};}function respondWithFilteredResult(_0x1ab9a8,_0x3ae551){return function(_0x32963f){if(_0x32963f){var _0x4487a4=typeof _0x3ae551[_0x1417('0x19')]===_0x1417('0x1a')&&typeof _0x3ae551['limit']===_0x1417('0x1a');var _0x101cbc=_0x32963f['count'];var _0x324747=_0x4487a4?0x0:_0x3ae551[_0x1417('0x19')];var _0x346920=_0x4487a4?_0x32963f[_0x1417('0x1b')]:_0x3ae551[_0x1417('0x19')]+_0x3ae551[_0x1417('0x1c')];var _0x32ee54;if(_0x346920>=_0x101cbc){_0x346920=_0x101cbc;_0x32ee54=0xc8;}else{_0x32ee54=0xce;}_0x1ab9a8[_0x1417('0x16')](_0x32ee54);return _0x1ab9a8['set'](_0x1417('0x1d'),_0x324747+'-'+_0x346920+'/'+_0x101cbc)[_0x1417('0x18')](_0x32963f);}return null;};}function patchUpdates(_0x442dc8){return function(_0xe09e9e){try{jsonpatch['apply'](_0xe09e9e,_0x442dc8,!![]);}catch(_0x47ff08){return BPromise[_0x1417('0x1e')](_0x47ff08);}return _0xe09e9e[_0x1417('0x1f')]();};}function saveUpdates(_0x2bed35,_0x1dc0cd){return function(_0x17789a){if(_0x17789a){return _0x17789a[_0x1417('0x20')](_0x2bed35)[_0x1417('0x21')](function(_0xc23d93){return _0xc23d93;});}return null;};}function removeEntity(_0x4ff1fb,_0x4c0fb8){return function(_0x3d8271){if(_0x3d8271){return _0x3d8271[_0x1417('0x22')]()['then'](function(){_0x4ff1fb[_0x1417('0x16')](0xcc)[_0x1417('0x17')]();});}};}function handleEntityNotFound(_0x423bc5,_0x4cf805){return function(_0x283994){if(!_0x283994){_0x423bc5['sendStatus'](0x194);}return _0x283994;};}function handleError(_0x1b904f,_0x1b7e7b){_0x1b7e7b=_0x1b7e7b||0x1f4;return function(_0x580d0d){logger[_0x1417('0x23')](_0x580d0d[_0x1417('0x24')]);if(_0x580d0d['name']){delete _0x580d0d[_0x1417('0x25')];}_0x1b904f[_0x1417('0x16')](_0x1b7e7b)[_0x1417('0x26')](_0x580d0d);};}exports[_0x1417('0x27')]=function(_0x1de6ca,_0x2018ec){var _0xf1cc3f={},_0x25d9f4={},_0x2aaf13={'count':0x0,'rows':[]};var _0x4b560e=_[_0x1417('0x28')](db[_0x1417('0x29')][_0x1417('0x2a')],function(_0x1f387f){return{'name':_0x1f387f[_0x1417('0x2b')],'type':_0x1f387f['type'][_0x1417('0x2c')]};});_0x25d9f4['model']=_[_0x1417('0x28')](_0x4b560e,_0x1417('0x25'));_0x25d9f4['query']=_[_0x1417('0x2d')](_0x1de6ca[_0x1417('0x2e')]);_0x25d9f4['filters']=_[_0x1417('0x2f')](_0x25d9f4[_0x1417('0x30')],_0x25d9f4[_0x1417('0x2e')]);_0xf1cc3f[_0x1417('0x31')]=_[_0x1417('0x2f')](_0x25d9f4[_0x1417('0x30')],qs['fields'](_0x1de6ca[_0x1417('0x2e')][_0x1417('0x32')]));_0xf1cc3f[_0x1417('0x31')]=_0xf1cc3f['attributes']['length']?_0xf1cc3f[_0x1417('0x31')]:_0x25d9f4[_0x1417('0x30')];if(!_0x1de6ca[_0x1417('0x2e')][_0x1417('0x33')](_0x1417('0x34'))){_0xf1cc3f['limit']=qs[_0x1417('0x1c')](_0x1de6ca[_0x1417('0x2e')][_0x1417('0x1c')]);_0xf1cc3f[_0x1417('0x19')]=qs[_0x1417('0x19')](_0x1de6ca[_0x1417('0x2e')][_0x1417('0x19')]);}_0xf1cc3f[_0x1417('0x35')]=qs[_0x1417('0x36')](_0x1de6ca['query'][_0x1417('0x36')]);_0xf1cc3f['where']=qs['filters'](_[_0x1417('0x37')](_0x1de6ca[_0x1417('0x2e')],_0x25d9f4[_0x1417('0x38')]),_0x4b560e);if(_0x1de6ca['query']['filter']){_0xf1cc3f['where']=_[_0x1417('0x39')](_0xf1cc3f[_0x1417('0x3a')],{'$or':_[_0x1417('0x28')](_0x4b560e,function(_0x2b8504){if(_0x2b8504[_0x1417('0x3b')]!==_0x1417('0x3c')){var _0x51e940={};_0x51e940[_0x2b8504[_0x1417('0x25')]]={'$like':'%'+_0x1de6ca[_0x1417('0x2e')][_0x1417('0x3d')]+'%'};return _0x51e940;}})});}_0xf1cc3f=_[_0x1417('0x39')]({},_0xf1cc3f,_0x1de6ca[_0x1417('0x3e')]);var _0x40eec0={'where':_0xf1cc3f[_0x1417('0x3a')]};return db[_0x1417('0x29')]['count'](_0x40eec0)[_0x1417('0x21')](function(_0x18f65e){_0x2aaf13[_0x1417('0x1b')]=_0x18f65e;if(_0x1de6ca['query'][_0x1417('0x3f')]){_0xf1cc3f[_0x1417('0x40')]=[{'all':!![]}];}return db[_0x1417('0x29')][_0x1417('0x41')](_0xf1cc3f);})[_0x1417('0x21')](function(_0x42c908){_0x2aaf13[_0x1417('0x42')]=_0x42c908;return _0x2aaf13;})['then'](respondWithFilteredResult(_0x2018ec,_0xf1cc3f))['catch'](handleError(_0x2018ec,null));};exports[_0x1417('0x43')]=function(_0x3ca8cf,_0x56dfa5){var _0x1f78e2={'raw':!![],'where':{'id':_0x3ca8cf[_0x1417('0x44')]['id']}},_0x2f8ad1={};_0x2f8ad1['model']=_[_0x1417('0x2d')](db[_0x1417('0x29')]['rawAttributes']);_0x2f8ad1['query']=_[_0x1417('0x2d')](_0x3ca8cf['query']);_0x2f8ad1[_0x1417('0x38')]=_[_0x1417('0x2f')](_0x2f8ad1[_0x1417('0x30')],_0x2f8ad1[_0x1417('0x2e')]);_0x1f78e2[_0x1417('0x31')]=_[_0x1417('0x2f')](_0x2f8ad1[_0x1417('0x30')],qs['fields'](_0x3ca8cf[_0x1417('0x2e')]['fields']));_0x1f78e2[_0x1417('0x31')]=_0x1f78e2[_0x1417('0x31')]['length']?_0x1f78e2[_0x1417('0x31')]:_0x2f8ad1[_0x1417('0x30')];if(_0x3ca8cf[_0x1417('0x2e')][_0x1417('0x3f')]){_0x1f78e2[_0x1417('0x40')]=[{'all':!![]}];}_0x1f78e2=_[_0x1417('0x39')]({},_0x1f78e2,_0x3ca8cf['options']);return db['JscriptyQuestionReport'][_0x1417('0x45')](_0x1f78e2)[_0x1417('0x21')](handleEntityNotFound(_0x56dfa5,null))[_0x1417('0x21')](respondWithResult(_0x56dfa5,null))[_0x1417('0x46')](handleError(_0x56dfa5,null));};exports[_0x1417('0x47')]=function(_0x87a19c,_0x134a32){return db[_0x1417('0x29')][_0x1417('0x47')](_0x87a19c[_0x1417('0x48')],{})[_0x1417('0x21')](respondWithResult(_0x134a32,0xc9))['catch'](handleError(_0x134a32,null));};exports[_0x1417('0x20')]=function(_0x25d9a6,_0x1b5e98){if(_0x25d9a6[_0x1417('0x48')]['id']){delete _0x25d9a6[_0x1417('0x48')]['id'];}return db['JscriptyQuestionReport'][_0x1417('0x45')]({'where':{'id':_0x25d9a6[_0x1417('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b5e98,null))[_0x1417('0x21')](saveUpdates(_0x25d9a6[_0x1417('0x48')],null))['then'](respondWithResult(_0x1b5e98,null))[_0x1417('0x46')](handleError(_0x1b5e98,null));};exports['destroy']=function(_0x44e14d,_0x1d6f8f){return db[_0x1417('0x29')]['find']({'where':{'id':_0x44e14d[_0x1417('0x44')]['id']}})[_0x1417('0x21')](handleEntityNotFound(_0x1d6f8f,null))[_0x1417('0x21')](removeEntity(_0x1d6f8f,null))[_0x1417('0x46')](handleError(_0x1d6f8f,null));};exports[_0x1417('0x49')]=function(_0xdadc9a,_0x2910ed){return db[_0x1417('0x29')][_0x1417('0x49')]()[_0x1417('0x21')](respondWithResult(_0x2910ed,null))[_0x1417('0x46')](handleError(_0x2910ed,null));}; \ No newline at end of file +var _0xd4bd=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','ioredis','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','rawAttributes','find','create','body','params','catch','describe','eml-format'];(function(_0x524a0d,_0x379b4a){var _0xf44f1c=function(_0x36e0a8){while(--_0x36e0a8){_0x524a0d['push'](_0x524a0d['shift']());}};_0xf44f1c(++_0x379b4a);}(_0xd4bd,0x19d));var _0xdd4b=function(_0x2b7ec2,_0x2e2688){_0x2b7ec2=_0x2b7ec2-0x0;var _0xb6d9d1=_0xd4bd[_0x2b7ec2];return _0xb6d9d1;};'use strict';var emlformat=require(_0xdd4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdd4b('0x1'));var jsonpatch=require(_0xdd4b('0x2'));var rp=require(_0xdd4b('0x3'));var moment=require('moment');var BPromise=require(_0xdd4b('0x4'));var Mustache=require(_0xdd4b('0x5'));var util=require(_0xdd4b('0x6'));var path=require(_0xdd4b('0x7'));var sox=require(_0xdd4b('0x8'));var csv=require('to-csv');var ejs=require(_0xdd4b('0x9'));var fs=require('fs');var fs_extra=require(_0xdd4b('0xa'));var _=require('lodash');var squel=require(_0xdd4b('0xb'));var crypto=require('crypto');var jsforce=require(_0xdd4b('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdd4b('0xd'));var querystring=require(_0xdd4b('0xe'));var Papa=require('papaparse');var Redis=require(_0xdd4b('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd4b('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xdd4b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xdd4b('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x515963,_0x17f4b8){_0x17f4b8=_0x17f4b8||0xcc;return function(_0x44b51c){if(_0x44b51c){return _0x515963[_0xdd4b('0x13')](_0x17f4b8);}return _0x515963[_0xdd4b('0x14')](_0x17f4b8)[_0xdd4b('0x15')]();};}function respondWithResult(_0x1d7636,_0xf9282c){_0xf9282c=_0xf9282c||0xc8;return function(_0xbbfb53){if(_0xbbfb53){return _0x1d7636[_0xdd4b('0x14')](_0xf9282c)[_0xdd4b('0x16')](_0xbbfb53);}};}function respondWithFilteredResult(_0x4f5c0e,_0x2337de){return function(_0x44e586){if(_0x44e586){var _0x26b716=typeof _0x2337de[_0xdd4b('0x17')]===_0xdd4b('0x18')&&typeof _0x2337de[_0xdd4b('0x19')]===_0xdd4b('0x18');var _0x462b0f=_0x44e586[_0xdd4b('0x1a')];var _0x2f2add=_0x26b716?0x0:_0x2337de[_0xdd4b('0x17')];var _0x2bd288=_0x26b716?_0x44e586[_0xdd4b('0x1a')]:_0x2337de[_0xdd4b('0x17')]+_0x2337de[_0xdd4b('0x19')];var _0x1fa9e3;if(_0x2bd288>=_0x462b0f){_0x2bd288=_0x462b0f;_0x1fa9e3=0xc8;}else{_0x1fa9e3=0xce;}_0x4f5c0e[_0xdd4b('0x14')](_0x1fa9e3);return _0x4f5c0e[_0xdd4b('0x1b')]('Content-Range',_0x2f2add+'-'+_0x2bd288+'/'+_0x462b0f)[_0xdd4b('0x16')](_0x44e586);}return null;};}function patchUpdates(_0x59d676){return function(_0x3faf2f){try{jsonpatch[_0xdd4b('0x1c')](_0x3faf2f,_0x59d676,!![]);}catch(_0x521002){return BPromise['reject'](_0x521002);}return _0x3faf2f[_0xdd4b('0x1d')]();};}function saveUpdates(_0x4e92b2,_0x2c043e){return function(_0x545a5b){if(_0x545a5b){return _0x545a5b[_0xdd4b('0x1e')](_0x4e92b2)[_0xdd4b('0x1f')](function(_0x23fcc2){return _0x23fcc2;});}return null;};}function removeEntity(_0x217344,_0x13add9){return function(_0x24ccf7){if(_0x24ccf7){return _0x24ccf7[_0xdd4b('0x20')]()[_0xdd4b('0x1f')](function(){_0x217344[_0xdd4b('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x581992,_0x43acea){return function(_0x181361){if(!_0x181361){_0x581992[_0xdd4b('0x13')](0x194);}return _0x181361;};}function handleError(_0x53fae8,_0x5119bc){_0x5119bc=_0x5119bc||0x1f4;return function(_0x2075d0){logger[_0xdd4b('0x21')](_0x2075d0[_0xdd4b('0x22')]);if(_0x2075d0[_0xdd4b('0x23')]){delete _0x2075d0[_0xdd4b('0x23')];}_0x53fae8['status'](_0x5119bc)['send'](_0x2075d0);};}exports[_0xdd4b('0x24')]=function(_0x2dc168,_0x28652c){var _0x5cebc8={},_0x50d9b1={},_0x18f55e={'count':0x0,'rows':[]};var _0x2dac48=_[_0xdd4b('0x25')](db[_0xdd4b('0x26')]['rawAttributes'],function(_0x1770c5){return{'name':_0x1770c5[_0xdd4b('0x27')],'type':_0x1770c5[_0xdd4b('0x28')][_0xdd4b('0x29')]};});_0x50d9b1['model']=_[_0xdd4b('0x25')](_0x2dac48,_0xdd4b('0x23'));_0x50d9b1['query']=_[_0xdd4b('0x2a')](_0x2dc168[_0xdd4b('0x2b')]);_0x50d9b1['filters']=_[_0xdd4b('0x2c')](_0x50d9b1[_0xdd4b('0x2d')],_0x50d9b1[_0xdd4b('0x2b')]);_0x5cebc8[_0xdd4b('0x2e')]=_[_0xdd4b('0x2c')](_0x50d9b1[_0xdd4b('0x2d')],qs[_0xdd4b('0x2f')](_0x2dc168['query'][_0xdd4b('0x2f')]));_0x5cebc8['attributes']=_0x5cebc8['attributes'][_0xdd4b('0x30')]?_0x5cebc8['attributes']:_0x50d9b1[_0xdd4b('0x2d')];if(!_0x2dc168['query']['hasOwnProperty'](_0xdd4b('0x31'))){_0x5cebc8[_0xdd4b('0x19')]=qs[_0xdd4b('0x19')](_0x2dc168[_0xdd4b('0x2b')]['limit']);_0x5cebc8[_0xdd4b('0x17')]=qs[_0xdd4b('0x17')](_0x2dc168[_0xdd4b('0x2b')][_0xdd4b('0x17')]);}_0x5cebc8[_0xdd4b('0x32')]=qs['sort'](_0x2dc168[_0xdd4b('0x2b')][_0xdd4b('0x33')]);_0x5cebc8[_0xdd4b('0x34')]=qs[_0xdd4b('0x35')](_['pick'](_0x2dc168['query'],_0x50d9b1[_0xdd4b('0x35')]),_0x2dac48);if(_0x2dc168['query'][_0xdd4b('0x36')]){_0x5cebc8[_0xdd4b('0x34')]=_[_0xdd4b('0x37')](_0x5cebc8[_0xdd4b('0x34')],{'$or':_[_0xdd4b('0x25')](_0x2dac48,function(_0xd1b1a2){if(_0xd1b1a2[_0xdd4b('0x28')]!==_0xdd4b('0x38')){var _0x183301={};_0x183301[_0xd1b1a2[_0xdd4b('0x23')]]={'$like':'%'+_0x2dc168[_0xdd4b('0x2b')][_0xdd4b('0x36')]+'%'};return _0x183301;}})});}_0x5cebc8=_['merge']({},_0x5cebc8,_0x2dc168[_0xdd4b('0x39')]);var _0x580e26={'where':_0x5cebc8[_0xdd4b('0x34')]};return db[_0xdd4b('0x26')][_0xdd4b('0x1a')](_0x580e26)[_0xdd4b('0x1f')](function(_0x14c2ac){_0x18f55e[_0xdd4b('0x1a')]=_0x14c2ac;if(_0x2dc168[_0xdd4b('0x2b')]['includeAll']){_0x5cebc8[_0xdd4b('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xdd4b('0x3b')](_0x5cebc8);})['then'](function(_0x4859e5){_0x18f55e[_0xdd4b('0x3c')]=_0x4859e5;return _0x18f55e;})['then'](respondWithFilteredResult(_0x28652c,_0x5cebc8))['catch'](handleError(_0x28652c,null));};exports[_0xdd4b('0x3d')]=function(_0x2ca09b,_0x5f1ce9){var _0x343212={'raw':!![],'where':{'id':_0x2ca09b['params']['id']}},_0x17e444={};_0x17e444[_0xdd4b('0x2d')]=_[_0xdd4b('0x2a')](db[_0xdd4b('0x26')][_0xdd4b('0x3e')]);_0x17e444[_0xdd4b('0x2b')]=_['keys'](_0x2ca09b[_0xdd4b('0x2b')]);_0x17e444[_0xdd4b('0x35')]=_[_0xdd4b('0x2c')](_0x17e444[_0xdd4b('0x2d')],_0x17e444[_0xdd4b('0x2b')]);_0x343212[_0xdd4b('0x2e')]=_[_0xdd4b('0x2c')](_0x17e444[_0xdd4b('0x2d')],qs[_0xdd4b('0x2f')](_0x2ca09b[_0xdd4b('0x2b')][_0xdd4b('0x2f')]));_0x343212[_0xdd4b('0x2e')]=_0x343212['attributes'][_0xdd4b('0x30')]?_0x343212['attributes']:_0x17e444[_0xdd4b('0x2d')];if(_0x2ca09b[_0xdd4b('0x2b')]['includeAll']){_0x343212[_0xdd4b('0x3a')]=[{'all':!![]}];}_0x343212=_[_0xdd4b('0x37')]({},_0x343212,_0x2ca09b[_0xdd4b('0x39')]);return db[_0xdd4b('0x26')][_0xdd4b('0x3f')](_0x343212)[_0xdd4b('0x1f')](handleEntityNotFound(_0x5f1ce9,null))['then'](respondWithResult(_0x5f1ce9,null))['catch'](handleError(_0x5f1ce9,null));};exports['create']=function(_0x506f41,_0x3d95dd){return db[_0xdd4b('0x26')][_0xdd4b('0x40')](_0x506f41['body'],{})[_0xdd4b('0x1f')](respondWithResult(_0x3d95dd,0xc9))['catch'](handleError(_0x3d95dd,null));};exports[_0xdd4b('0x1e')]=function(_0x2f08c9,_0x1bef63){if(_0x2f08c9[_0xdd4b('0x41')]['id']){delete _0x2f08c9[_0xdd4b('0x41')]['id'];}return db[_0xdd4b('0x26')][_0xdd4b('0x3f')]({'where':{'id':_0x2f08c9['params']['id']}})[_0xdd4b('0x1f')](handleEntityNotFound(_0x1bef63,null))[_0xdd4b('0x1f')](saveUpdates(_0x2f08c9[_0xdd4b('0x41')],null))[_0xdd4b('0x1f')](respondWithResult(_0x1bef63,null))['catch'](handleError(_0x1bef63,null));};exports[_0xdd4b('0x20')]=function(_0x34e2a7,_0x153955){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x34e2a7[_0xdd4b('0x42')]['id']}})['then'](handleEntityNotFound(_0x153955,null))['then'](removeEntity(_0x153955,null))[_0xdd4b('0x43')](handleError(_0x153955,null));};exports[_0xdd4b('0x44')]=function(_0x2b29de,_0xc52304){return db['JscriptyQuestionReport'][_0xdd4b('0x44')]()['then'](respondWithResult(_0xc52304,null))[_0xdd4b('0x43')](handleError(_0xc52304,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index aba3d9d..a6917c2 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 _0x6ab7=['JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyQuestionReport.attributes'];(function(_0x1b4b50,_0x113caa){var _0x59bf4c=function(_0x2b0959){while(--_0x2b0959){_0x1b4b50['push'](_0x1b4b50['shift']());}};_0x59bf4c(++_0x113caa);}(_0x6ab7,0x199));var _0x76ab=function(_0x5a8847,_0x34481d){_0x5a8847=_0x5a8847-0x0;var _0x297fb9=_0x6ab7[_0x5a8847];return _0x297fb9;};'use strict';var _=require(_0x76ab('0x0'));var util=require(_0x76ab('0x1'));var logger=require(_0x76ab('0x2'))(_0x76ab('0x3'));var moment=require(_0x76ab('0x4'));var BPromise=require(_0x76ab('0x5'));var rp=require(_0x76ab('0x6'));var fs=require('fs');var path=require(_0x76ab('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x76ab('0x8'));module['exports']=function(_0x40e4e1,_0x3d4cf0){return _0x40e4e1['define'](_0x76ab('0x9'),attributes,{'tableName':_0x76ab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b53=['define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x166ef8,_0x4d1b45){var _0x26feab=function(_0x2bcba4){while(--_0x2bcba4){_0x166ef8['push'](_0x166ef8['shift']());}};_0x26feab(++_0x4d1b45);}(_0x2b53,0x1ed));var _0x32b5=function(_0x1f1158,_0x3ff189){_0x1f1158=_0x1f1158-0x0;var _0x539a9d=_0x2b53[_0x1f1158];return _0x539a9d;};'use strict';var _=require(_0x32b5('0x0'));var util=require(_0x32b5('0x1'));var logger=require(_0x32b5('0x2'))(_0x32b5('0x3'));var moment=require('moment');var BPromise=require(_0x32b5('0x4'));var rp=require(_0x32b5('0x5'));var fs=require('fs');var path=require(_0x32b5('0x6'));var rimraf=require(_0x32b5('0x7'));var config=require(_0x32b5('0x8'));var attributes=require(_0x32b5('0x9'));module[_0x32b5('0xa')]=function(_0x5e4d99,_0x1be5d6){return _0x5e4d99[_0x32b5('0xb')](_0x32b5('0xc'),attributes,{'tableName':_0x32b5('0xd'),'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 be20673..eff5808 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 _0x74a4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x74a4,0x66));var _0x474a=function(_0x4ec7b4,_0xecdb1){_0x4ec7b4=_0x4ec7b4-0x0;var _0x5244f6=_0x74a4[_0x4ec7b4];return _0x5244f6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x474a('0x0'));var BPromise=require(_0x474a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x474a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x474a('0x3'))(_0x474a('0x4'));var config=require(_0x474a('0x5'));var jayson=require(_0x474a('0x6'));var client=jayson[_0x474a('0x7')][_0x474a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x230b30,_0x3f281e,_0xe25069){return new BPromise(function(_0x4e676d,_0xfc3535){return client[_0x474a('0x9')](_0x230b30,_0xe25069)['then'](function(_0x1d2935){logger[_0x474a('0xa')](_0x474a('0xb'),_0x3f281e,_0x474a('0xc'));logger[_0x474a('0xd')](_0x474a('0xe'),_0x3f281e,_0x474a('0xc'),JSON[_0x474a('0xf')](_0x1d2935));if(_0x1d2935[_0x474a('0x10')]){if(_0x1d2935['error'][_0x474a('0x11')]===0x1f4){logger['error'](_0x474a('0xb'),_0x3f281e,_0x1d2935[_0x474a('0x10')][_0x474a('0x12')]);return _0xfc3535(_0x1d2935[_0x474a('0x10')]['message']);}logger[_0x474a('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3f281e,_0x1d2935[_0x474a('0x10')][_0x474a('0x12')]);return _0x4e676d(_0x1d2935[_0x474a('0x10')][_0x474a('0x12')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x3f281e,_0x474a('0xc'));_0x4e676d(_0x1d2935[_0x474a('0x13')][_0x474a('0x12')]);}})[_0x474a('0x14')](function(_0x4e417d){logger[_0x474a('0x10')](_0x474a('0xb'),_0x3f281e,_0x4e417d);_0xfc3535(_0x4e417d);});});} \ No newline at end of file +var _0x5f5f=['client','request','then','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ae96c,_0x3c63d2){var _0x3707af=function(_0x37dc05){while(--_0x37dc05){_0x2ae96c['push'](_0x2ae96c['shift']());}};_0x3707af(++_0x3c63d2);}(_0x5f5f,0xc4));var _0xf5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf5f5('0x0'));var util=require(_0xf5f5('0x1'));var moment=require(_0xf5f5('0x2'));var BPromise=require(_0xf5f5('0x3'));var rs=require(_0xf5f5('0x4'));var fs=require('fs');var Redis=require(_0xf5f5('0x5'));var db=require(_0xf5f5('0x6'))['db'];var utils=require(_0xf5f5('0x7'));var logger=require(_0xf5f5('0x8'))(_0xf5f5('0x9'));var config=require(_0xf5f5('0xa'));var jayson=require(_0xf5f5('0xb'));var client=jayson[_0xf5f5('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b639b,_0x1b48b8,_0x55116e){return new BPromise(function(_0x95a862,_0x67e49){return client[_0xf5f5('0xd')](_0x1b639b,_0x55116e)[_0xf5f5('0xe')](function(_0x3f3b2d){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1b48b8,_0xf5f5('0xf'));logger[_0xf5f5('0x10')](_0xf5f5('0x11'),_0x1b48b8,_0xf5f5('0xf'),JSON[_0xf5f5('0x12')](_0x3f3b2d));if(_0x3f3b2d[_0xf5f5('0x13')]){if(_0x3f3b2d['error'][_0xf5f5('0x14')]===0x1f4){logger['error'](_0xf5f5('0x15'),_0x1b48b8,_0x3f3b2d[_0xf5f5('0x13')][_0xf5f5('0x16')]);return _0x67e49(_0x3f3b2d[_0xf5f5('0x13')][_0xf5f5('0x16')]);}logger[_0xf5f5('0x13')](_0xf5f5('0x15'),_0x1b48b8,_0x3f3b2d[_0xf5f5('0x13')]['message']);return _0x95a862(_0x3f3b2d[_0xf5f5('0x13')][_0xf5f5('0x16')]);}else{logger[_0xf5f5('0x17')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1b48b8,_0xf5f5('0xf'));_0x95a862(_0x3f3b2d[_0xf5f5('0x18')]['message']);}})[_0xf5f5('0x19')](function(_0x33de64){logger[_0xf5f5('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1b48b8,_0x33de64);_0x67e49(_0x33de64);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a3beb83..dbef1bd 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 _0x0f43=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','getQuestions','post','create','update','delete','destroy','exports','multer','util','path'];(function(_0x16ad95,_0x4333a8){var _0x25f2be=function(_0x5bbefd){while(--_0x5bbefd){_0x16ad95['push'](_0x16ad95['shift']());}};_0x25f2be(++_0x4333a8);}(_0x0f43,0x81));var _0x30f4=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x0f43[_0x4b7895];return _0x264180;};'use strict';var multer=require(_0x30f4('0x0'));var util=require(_0x30f4('0x1'));var path=require(_0x30f4('0x2'));var timeout=require(_0x30f4('0x3'));var express=require('express');var router=express[_0x30f4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x30f4('0x5'));var interaction=require(_0x30f4('0x6'));var config=require(_0x30f4('0x7'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth[_0x30f4('0x8')](),controller[_0x30f4('0x9')]);router[_0x30f4('0xa')](_0x30f4('0xb'),auth[_0x30f4('0x8')](),controller[_0x30f4('0xc')]);router[_0x30f4('0xa')](_0x30f4('0xd'),auth[_0x30f4('0x8')](),controller[_0x30f4('0xe')]);router['get']('/:id/questions',auth[_0x30f4('0x8')](),controller[_0x30f4('0xf')]);router[_0x30f4('0x10')]('/',auth[_0x30f4('0x8')](),controller[_0x30f4('0x11')]);router['put'](_0x30f4('0xd'),auth[_0x30f4('0x8')](),controller[_0x30f4('0x12')]);router[_0x30f4('0x13')](_0x30f4('0xd'),auth['isAuthenticated'](),controller[_0x30f4('0x14')]);module[_0x30f4('0x15')]=router; \ No newline at end of file +var _0xf8d8=['index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x2ecdbe,_0x114206){var _0x44d6d4=function(_0x2e592a){while(--_0x2e592a){_0x2ecdbe['push'](_0x2ecdbe['shift']());}};_0x44d6d4(++_0x114206);}(_0xf8d8,0xe9));var _0x8f8d=function(_0x2316b9,_0x87059b){_0x2316b9=_0x2316b9-0x0;var _0x4405a9=_0xf8d8[_0x2316b9];return _0x4405a9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8f8d('0x0'));var express=require(_0x8f8d('0x1'));var router=express[_0x8f8d('0x2')]();var fs_extra=require(_0x8f8d('0x3'));var auth=require(_0x8f8d('0x4'));var interaction=require(_0x8f8d('0x5'));var config=require('../../config/environment');var controller=require(_0x8f8d('0x6'));router[_0x8f8d('0x7')]('/',auth[_0x8f8d('0x8')](),controller[_0x8f8d('0x9')]);router[_0x8f8d('0x7')](_0x8f8d('0xa'),auth[_0x8f8d('0x8')](),controller[_0x8f8d('0xb')]);router[_0x8f8d('0x7')](_0x8f8d('0xc'),auth[_0x8f8d('0x8')](),controller[_0x8f8d('0xd')]);router[_0x8f8d('0x7')](_0x8f8d('0xe'),auth[_0x8f8d('0x8')](),controller[_0x8f8d('0xf')]);router[_0x8f8d('0x10')]('/',auth['isAuthenticated'](),controller[_0x8f8d('0x11')]);router[_0x8f8d('0x12')](_0x8f8d('0xc'),auth[_0x8f8d('0x8')](),controller[_0x8f8d('0x13')]);router[_0x8f8d('0x14')](_0x8f8d('0xc'),auth[_0x8f8d('0x8')](),controller[_0x8f8d('0x15')]);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 ae73cb5..d0c4cfd 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 _0x0bee=['moment','sequelize','exports','DATE','setDataValue','starttime','format','STRING','BOOLEAN'];(function(_0x351752,_0x28b65c){var _0x22dcee=function(_0x1e1f60){while(--_0x1e1f60){_0x351752['push'](_0x351752['shift']());}};_0x22dcee(++_0x28b65c);}(_0x0bee,0x117));var _0xe0be=function(_0x1367b4,_0x2f7954){_0x1367b4=_0x1367b4-0x0;var _0xaec684=_0x0bee[_0x1367b4];return _0xaec684;};'use strict';var moment=require(_0xe0be('0x0'));var Sequelize=require(_0xe0be('0x1'));module[_0xe0be('0x2')]={'starttime':{'type':Sequelize[_0xe0be('0x3')],'set':function(_0x3fe890){this[_0xe0be('0x4')](_0xe0be('0x5'),_0x3fe890);this[_0xe0be('0x4')]('endtime',moment()[_0xe0be('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xe0be('0x3')]},'membername':{'type':Sequelize[_0xe0be('0x7')]},'projectname':{'type':Sequelize[_0xe0be('0x7')]},'queue':{'type':Sequelize[_0xe0be('0x7')]},'uniqueid':{'type':Sequelize[_0xe0be('0x7')]},'calleridname':{'type':Sequelize[_0xe0be('0x7')]},'calleridnum':{'type':Sequelize[_0xe0be('0x7')]},'completed':{'type':Sequelize[_0xe0be('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x0d84=['DATE','setDataValue','format','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x310b31,_0x13d69c){var _0x4d8540=function(_0x343579){while(--_0x343579){_0x310b31['push'](_0x310b31['shift']());}};_0x4d8540(++_0x13d69c);}(_0x0d84,0x115));var _0x40d8=function(_0x443720,_0x1bf7df){_0x443720=_0x443720-0x0;var _0x8e6db4=_0x0d84[_0x443720];return _0x8e6db4;};'use strict';var moment=require(_0x40d8('0x0'));var Sequelize=require(_0x40d8('0x1'));module[_0x40d8('0x2')]={'starttime':{'type':Sequelize[_0x40d8('0x3')],'set':function(_0x1bdcbf){this[_0x40d8('0x4')]('starttime',_0x1bdcbf);this['setDataValue']('endtime',moment()[_0x40d8('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x40d8('0x6')]},'projectname':{'type':Sequelize[_0x40d8('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x40d8('0x6')]},'calleridname':{'type':Sequelize[_0x40d8('0x6')]},'calleridnum':{'type':Sequelize[_0x40d8('0x6')]},'completed':{'type':Sequelize[_0x40d8('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a84e15f..52bead9 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 _0x6df6=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','filter','where','merge','includeAll','catch','show','params','include','options','find','create','body','describe','JscriptyQuestionReport','length','pick','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3228ee,_0x36e61e){var _0x237456=function(_0x18106a){while(--_0x18106a){_0x3228ee['push'](_0x3228ee['shift']());}};_0x237456(++_0x36e61e);}(_0x6df6,0x8a));var _0x66df=function(_0x27031e,_0x1eb8cd){_0x27031e=_0x27031e-0x0;var _0xfd46b3=_0x6df6[_0x27031e];return _0xfd46b3;};'use strict';var emlformat=require(_0x66df('0x0'));var rimraf=require(_0x66df('0x1'));var zipdir=require(_0x66df('0x2'));var jsonpatch=require(_0x66df('0x3'));var rp=require('request-promise');var moment=require(_0x66df('0x4'));var BPromise=require(_0x66df('0x5'));var Mustache=require(_0x66df('0x6'));var util=require(_0x66df('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x66df('0x8'));var ejs=require(_0x66df('0x9'));var fs=require('fs');var fs_extra=require(_0x66df('0xa'));var _=require(_0x66df('0xb'));var squel=require(_0x66df('0xc'));var crypto=require('crypto');var jsforce=require(_0x66df('0xd'));var deskjs=require(_0x66df('0xe'));var toCsv=require(_0x66df('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x66df('0xf'));var authService=require(_0x66df('0x10'));var qs=require(_0x66df('0x11'));var as=require(_0x66df('0x12'));var hardwareService=require(_0x66df('0x13'));var logger=require('../../config/logger')(_0x66df('0x14'));var utils=require(_0x66df('0x15'));var config=require(_0x66df('0x16'));var licenseUtil=require(_0x66df('0x17'));var db=require(_0x66df('0x18'))['db'];function respondWithStatusCode(_0x431aef,_0xd6712){_0xd6712=_0xd6712||0xcc;return function(_0x19eeec){if(_0x19eeec){return _0x431aef['sendStatus'](_0xd6712);}return _0x431aef[_0x66df('0x19')](_0xd6712)['end']();};}function respondWithResult(_0x109296,_0x19ae31){_0x19ae31=_0x19ae31||0xc8;return function(_0x12c1ca){if(_0x12c1ca){return _0x109296[_0x66df('0x19')](_0x19ae31)['json'](_0x12c1ca);}};}function respondWithFilteredResult(_0x53a75b,_0x1802c0){return function(_0xc91b7a){if(_0xc91b7a){var _0x5387f7=typeof _0x1802c0[_0x66df('0x1a')]===_0x66df('0x1b')&&typeof _0x1802c0[_0x66df('0x1c')]==='undefined';var _0x39c2c2=_0xc91b7a[_0x66df('0x1d')];var _0x44439e=_0x5387f7?0x0:_0x1802c0[_0x66df('0x1a')];var _0x5a378a=_0x5387f7?_0xc91b7a['count']:_0x1802c0['offset']+_0x1802c0[_0x66df('0x1c')];var _0x2e03b4;if(_0x5a378a>=_0x39c2c2){_0x5a378a=_0x39c2c2;_0x2e03b4=0xc8;}else{_0x2e03b4=0xce;}_0x53a75b[_0x66df('0x19')](_0x2e03b4);return _0x53a75b[_0x66df('0x1e')](_0x66df('0x1f'),_0x44439e+'-'+_0x5a378a+'/'+_0x39c2c2)[_0x66df('0x20')](_0xc91b7a);}return null;};}function patchUpdates(_0x4d918b){return function(_0x32a8e2){try{jsonpatch[_0x66df('0x21')](_0x32a8e2,_0x4d918b,!![]);}catch(_0x259990){return BPromise[_0x66df('0x22')](_0x259990);}return _0x32a8e2['save']();};}function saveUpdates(_0x2c9982,_0x18a72a){return function(_0x200bf6){if(_0x200bf6){return _0x200bf6[_0x66df('0x23')](_0x2c9982)[_0x66df('0x24')](function(_0x31e7ce){return _0x31e7ce;});}return null;};}function removeEntity(_0x35c7ac,_0x404a6f){return function(_0x30bcf5){if(_0x30bcf5){return _0x30bcf5[_0x66df('0x25')]()[_0x66df('0x24')](function(){_0x35c7ac[_0x66df('0x19')](0xcc)[_0x66df('0x26')]();});}};}function handleEntityNotFound(_0x23c2a1,_0x377970){return function(_0x5ba0f8){if(!_0x5ba0f8){_0x23c2a1[_0x66df('0x27')](0x194);}return _0x5ba0f8;};}function handleError(_0x640c64,_0xbf23c8){_0xbf23c8=_0xbf23c8||0x1f4;return function(_0x5e195e){logger[_0x66df('0x28')](_0x5e195e[_0x66df('0x29')]);if(_0x5e195e[_0x66df('0x2a')]){delete _0x5e195e[_0x66df('0x2a')];}_0x640c64[_0x66df('0x19')](_0xbf23c8)[_0x66df('0x2b')](_0x5e195e);};}exports[_0x66df('0x2c')]=function(_0x255c90,_0x4246d8){var _0x3cda63={},_0x1c93d0={},_0x19ccb4={'count':0x0,'rows':[]};var _0x18ae06=_[_0x66df('0x2d')](db[_0x66df('0x2e')][_0x66df('0x2f')],function(_0x5bfbd4){return{'name':_0x5bfbd4[_0x66df('0x30')],'type':_0x5bfbd4[_0x66df('0x31')][_0x66df('0x32')]};});_0x1c93d0[_0x66df('0x33')]=_[_0x66df('0x2d')](_0x18ae06,_0x66df('0x2a'));_0x1c93d0['query']=_[_0x66df('0x34')](_0x255c90[_0x66df('0x35')]);_0x1c93d0[_0x66df('0x36')]=_[_0x66df('0x37')](_0x1c93d0[_0x66df('0x33')],_0x1c93d0[_0x66df('0x35')]);_0x3cda63['attributes']=_[_0x66df('0x37')](_0x1c93d0[_0x66df('0x33')],qs[_0x66df('0x38')](_0x255c90[_0x66df('0x35')][_0x66df('0x38')]));_0x3cda63['attributes']=_0x3cda63[_0x66df('0x39')]['length']?_0x3cda63['attributes']:_0x1c93d0[_0x66df('0x33')];if(!_0x255c90['query']['hasOwnProperty'](_0x66df('0x3a'))){_0x3cda63[_0x66df('0x1c')]=qs[_0x66df('0x1c')](_0x255c90[_0x66df('0x35')][_0x66df('0x1c')]);_0x3cda63[_0x66df('0x1a')]=qs[_0x66df('0x1a')](_0x255c90[_0x66df('0x35')][_0x66df('0x1a')]);}_0x3cda63[_0x66df('0x3b')]=qs[_0x66df('0x3c')](_0x255c90[_0x66df('0x35')][_0x66df('0x3c')]);_0x3cda63['where']=qs[_0x66df('0x36')](_['pick'](_0x255c90[_0x66df('0x35')],_0x1c93d0[_0x66df('0x36')]),_0x18ae06);if(_0x255c90[_0x66df('0x35')][_0x66df('0x3d')]){_0x3cda63[_0x66df('0x3e')]=_[_0x66df('0x3f')](_0x3cda63[_0x66df('0x3e')],{'$or':_[_0x66df('0x2d')](_0x18ae06,function(_0x402149){if(_0x402149[_0x66df('0x31')]!=='VIRTUAL'){var _0x142d55={};_0x142d55[_0x402149[_0x66df('0x2a')]]={'$like':'%'+_0x255c90[_0x66df('0x35')]['filter']+'%'};return _0x142d55;}})});}_0x3cda63=_[_0x66df('0x3f')]({},_0x3cda63,_0x255c90['options']);var _0x248359={'where':_0x3cda63[_0x66df('0x3e')]};return db[_0x66df('0x2e')][_0x66df('0x1d')](_0x248359)[_0x66df('0x24')](function(_0x7e199f){_0x19ccb4['count']=_0x7e199f;if(_0x255c90['query'][_0x66df('0x40')]){_0x3cda63['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x3cda63);})[_0x66df('0x24')](function(_0x208ff4){_0x19ccb4['rows']=_0x208ff4;return _0x19ccb4;})[_0x66df('0x24')](respondWithFilteredResult(_0x4246d8,_0x3cda63))[_0x66df('0x41')](handleError(_0x4246d8,null));};exports[_0x66df('0x42')]=function(_0x5aae6c,_0x120d5a){var _0x3eaaa3={'raw':!![],'where':{'id':_0x5aae6c[_0x66df('0x43')]['id']}},_0x1af12={};_0x1af12[_0x66df('0x33')]=_[_0x66df('0x34')](db[_0x66df('0x2e')][_0x66df('0x2f')]);_0x1af12[_0x66df('0x35')]=_[_0x66df('0x34')](_0x5aae6c[_0x66df('0x35')]);_0x1af12['filters']=_[_0x66df('0x37')](_0x1af12['model'],_0x1af12[_0x66df('0x35')]);_0x3eaaa3['attributes']=_[_0x66df('0x37')](_0x1af12[_0x66df('0x33')],qs[_0x66df('0x38')](_0x5aae6c[_0x66df('0x35')][_0x66df('0x38')]));_0x3eaaa3[_0x66df('0x39')]=_0x3eaaa3[_0x66df('0x39')]['length']?_0x3eaaa3[_0x66df('0x39')]:_0x1af12[_0x66df('0x33')];if(_0x5aae6c[_0x66df('0x35')]['includeAll']){_0x3eaaa3[_0x66df('0x44')]=[{'all':!![]}];}_0x3eaaa3=_['merge']({},_0x3eaaa3,_0x5aae6c[_0x66df('0x45')]);return db[_0x66df('0x2e')][_0x66df('0x46')](_0x3eaaa3)[_0x66df('0x24')](handleEntityNotFound(_0x120d5a,null))['then'](respondWithResult(_0x120d5a,null))['catch'](handleError(_0x120d5a,null));};exports['create']=function(_0x399c08,_0x36c31c){return db[_0x66df('0x2e')][_0x66df('0x47')](_0x399c08[_0x66df('0x48')],{})['then'](respondWithResult(_0x36c31c,0xc9))[_0x66df('0x41')](handleError(_0x36c31c,null));};exports['update']=function(_0x255ada,_0x1d9d66){if(_0x255ada[_0x66df('0x48')]['id']){delete _0x255ada['body']['id'];}return db[_0x66df('0x2e')][_0x66df('0x46')]({'where':{'id':_0x255ada[_0x66df('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d9d66,null))[_0x66df('0x24')](saveUpdates(_0x255ada[_0x66df('0x48')],null))[_0x66df('0x24')](respondWithResult(_0x1d9d66,null))[_0x66df('0x41')](handleError(_0x1d9d66,null));};exports[_0x66df('0x25')]=function(_0x3b1e36,_0x1b6178){return db['JscriptySessionReport'][_0x66df('0x46')]({'where':{'id':_0x3b1e36[_0x66df('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b6178,null))['then'](removeEntity(_0x1b6178,null))[_0x66df('0x41')](handleError(_0x1b6178,null));};exports[_0x66df('0x49')]=function(_0x193f01,_0x38a3ec){return db[_0x66df('0x2e')][_0x66df('0x49')]()[_0x66df('0x24')](respondWithResult(_0x38a3ec,null))[_0x66df('0x41')](handleError(_0x38a3ec,null));};exports['getQuestions']=function(_0x3f27fb,_0xe71211,_0x75b65f){var _0x9e9a5d={'raw':!![],'where':{}};var _0x11e138={};var _0x87e1a0={'count':0x0,'rows':[]};return db[_0x66df('0x2e')]['findOne']({'where':{'id':_0x3f27fb[_0x66df('0x43')]['id']}})[_0x66df('0x24')](handleEntityNotFound(_0xe71211,null))['then'](function(_0x5741a8){if(_0x5741a8){_0x11e138['model']=_[_0x66df('0x34')](db[_0x66df('0x4a')][_0x66df('0x2f')]);_0x11e138[_0x66df('0x35')]=_['keys'](_0x3f27fb[_0x66df('0x35')]);_0x11e138[_0x66df('0x36')]=_[_0x66df('0x37')](_0x11e138[_0x66df('0x33')],_0x11e138[_0x66df('0x35')]);_0x9e9a5d[_0x66df('0x39')]=_[_0x66df('0x37')](_0x11e138[_0x66df('0x33')],qs[_0x66df('0x38')](_0x3f27fb[_0x66df('0x35')]['fields']));_0x9e9a5d[_0x66df('0x39')]=_0x9e9a5d[_0x66df('0x39')][_0x66df('0x4b')]?_0x9e9a5d[_0x66df('0x39')]:_0x11e138[_0x66df('0x33')];if(!_0x3f27fb[_0x66df('0x35')]['hasOwnProperty'](_0x66df('0x3a'))){_0x9e9a5d[_0x66df('0x1c')]=qs[_0x66df('0x1c')](_0x3f27fb['query']['limit']);_0x9e9a5d[_0x66df('0x1a')]=qs['offset'](_0x3f27fb[_0x66df('0x35')][_0x66df('0x1a')]);}_0x9e9a5d[_0x66df('0x3b')]=qs[_0x66df('0x3c')](_0x3f27fb[_0x66df('0x35')][_0x66df('0x3c')]);_0x9e9a5d[_0x66df('0x3e')]=qs['filters'](_[_0x66df('0x4c')](_0x3f27fb[_0x66df('0x35')],_0x11e138['filters']));_0x9e9a5d['where']['SessionId']=_0x5741a8['id'];if(_0x3f27fb[_0x66df('0x35')][_0x66df('0x3d')]){_0x9e9a5d[_0x66df('0x3e')]=_[_0x66df('0x3f')](_0x9e9a5d[_0x66df('0x3e')],{'$or':_[_0x66df('0x2d')](_0x9e9a5d[_0x66df('0x39')],function(_0x57120a){var _0x58f2ad={};_0x58f2ad[_0x57120a]={'$like':'%'+_0x3f27fb[_0x66df('0x35')]['filter']+'%'};return _0x58f2ad;})});}_0x9e9a5d=_['merge']({},_0x9e9a5d,_0x3f27fb[_0x66df('0x45')]);return db[_0x66df('0x4a')]['count']({'where':_0x9e9a5d[_0x66df('0x3e')]})[_0x66df('0x24')](function(_0x1b712a){_0x87e1a0['count']=_0x1b712a;if(_0x3f27fb[_0x66df('0x35')][_0x66df('0x40')]){_0x9e9a5d[_0x66df('0x44')]=[{'all':!![]}];}return db[_0x66df('0x4a')][_0x66df('0x4d')](_0x9e9a5d);})[_0x66df('0x24')](function(_0x3b4b70){_0x87e1a0[_0x66df('0x4e')]=_0x3b4b70;return _0x87e1a0;});}})['then'](respondWithFilteredResult(_0xe71211,_0x9e9a5d))[_0x66df('0x41')](handleError(_0xe71211,null));}; \ No newline at end of file +var _0x146d=['count','set','Content-Range','apply','save','update','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','type','VIRTUAL','filter','JscriptySessionReport','then','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','create','body','destroy','describe','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','eml-format','zip-dir','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3f10c5,_0x18607c){var _0x98dfa3=function(_0x343904){while(--_0x343904){_0x3f10c5['push'](_0x3f10c5['shift']());}};_0x98dfa3(++_0x18607c);}(_0x146d,0xca));var _0xd146=function(_0xf74e1f,_0x5e83c8){_0xf74e1f=_0xf74e1f-0x0;var _0x463bca=_0x146d[_0xf74e1f];return _0x463bca;};'use strict';var emlformat=require(_0xd146('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd146('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd146('0x2'));var Mustache=require('mustache');var util=require(_0xd146('0x3'));var path=require(_0xd146('0x4'));var sox=require(_0xd146('0x5'));var csv=require(_0xd146('0x6'));var ejs=require(_0xd146('0x7'));var fs=require('fs');var fs_extra=require(_0xd146('0x8'));var _=require(_0xd146('0x9'));var squel=require(_0xd146('0xa'));var crypto=require(_0xd146('0xb'));var jsforce=require(_0xd146('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd146('0x6'));var querystring=require(_0xd146('0xd'));var Papa=require('papaparse');var Redis=require(_0xd146('0xe'));var authService=require(_0xd146('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd146('0x10'))(_0xd146('0x11'));var utils=require(_0xd146('0x12'));var config=require(_0xd146('0x13'));var licenseUtil=require(_0xd146('0x14'));var db=require(_0xd146('0x15'))['db'];function respondWithStatusCode(_0x46668a,_0x209250){_0x209250=_0x209250||0xcc;return function(_0x1727dc){if(_0x1727dc){return _0x46668a[_0xd146('0x16')](_0x209250);}return _0x46668a[_0xd146('0x17')](_0x209250)[_0xd146('0x18')]();};}function respondWithResult(_0x4c30de,_0x3674fc){_0x3674fc=_0x3674fc||0xc8;return function(_0xce6c3a){if(_0xce6c3a){return _0x4c30de[_0xd146('0x17')](_0x3674fc)[_0xd146('0x19')](_0xce6c3a);}};}function respondWithFilteredResult(_0x3eabc7,_0x422da2){return function(_0x3348aa){if(_0x3348aa){var _0x20492f=typeof _0x422da2[_0xd146('0x1a')]===_0xd146('0x1b')&&typeof _0x422da2[_0xd146('0x1c')]===_0xd146('0x1b');var _0x1f8c4d=_0x3348aa[_0xd146('0x1d')];var _0x2b8132=_0x20492f?0x0:_0x422da2[_0xd146('0x1a')];var _0x2e50d7=_0x20492f?_0x3348aa['count']:_0x422da2[_0xd146('0x1a')]+_0x422da2[_0xd146('0x1c')];var _0x24bd37;if(_0x2e50d7>=_0x1f8c4d){_0x2e50d7=_0x1f8c4d;_0x24bd37=0xc8;}else{_0x24bd37=0xce;}_0x3eabc7[_0xd146('0x17')](_0x24bd37);return _0x3eabc7[_0xd146('0x1e')](_0xd146('0x1f'),_0x2b8132+'-'+_0x2e50d7+'/'+_0x1f8c4d)['json'](_0x3348aa);}return null;};}function patchUpdates(_0x463e39){return function(_0x443b00){try{jsonpatch[_0xd146('0x20')](_0x443b00,_0x463e39,!![]);}catch(_0x24d97d){return BPromise['reject'](_0x24d97d);}return _0x443b00[_0xd146('0x21')]();};}function saveUpdates(_0x45f81a,_0x1d327f){return function(_0x4c4dfa){if(_0x4c4dfa){return _0x4c4dfa[_0xd146('0x22')](_0x45f81a)['then'](function(_0x37fe65){return _0x37fe65;});}return null;};}function removeEntity(_0x1c9b3c,_0x3927be){return function(_0xa3ad7a){if(_0xa3ad7a){return _0xa3ad7a['destroy']()['then'](function(){_0x1c9b3c[_0xd146('0x17')](0xcc)[_0xd146('0x18')]();});}};}function handleEntityNotFound(_0x576a01,_0x1288ce){return function(_0x4af4af){if(!_0x4af4af){_0x576a01[_0xd146('0x16')](0x194);}return _0x4af4af;};}function handleError(_0x3322df,_0x5bc20f){_0x5bc20f=_0x5bc20f||0x1f4;return function(_0x429753){logger[_0xd146('0x23')](_0x429753[_0xd146('0x24')]);if(_0x429753[_0xd146('0x25')]){delete _0x429753[_0xd146('0x25')];}_0x3322df[_0xd146('0x17')](_0x5bc20f)[_0xd146('0x26')](_0x429753);};}exports[_0xd146('0x27')]=function(_0x2dfd76,_0x398fbd){var _0x6316a7={},_0x381ec0={},_0x2361ee={'count':0x0,'rows':[]};var _0x31643d=_[_0xd146('0x28')](db['JscriptySessionReport']['rawAttributes'],function(_0xd5635d){return{'name':_0xd5635d['fieldName'],'type':_0xd5635d['type'][_0xd146('0x29')]};});_0x381ec0[_0xd146('0x2a')]=_[_0xd146('0x28')](_0x31643d,_0xd146('0x25'));_0x381ec0[_0xd146('0x2b')]=_[_0xd146('0x2c')](_0x2dfd76['query']);_0x381ec0[_0xd146('0x2d')]=_[_0xd146('0x2e')](_0x381ec0[_0xd146('0x2a')],_0x381ec0[_0xd146('0x2b')]);_0x6316a7[_0xd146('0x2f')]=_['intersection'](_0x381ec0['model'],qs['fields'](_0x2dfd76['query'][_0xd146('0x30')]));_0x6316a7['attributes']=_0x6316a7[_0xd146('0x2f')][_0xd146('0x31')]?_0x6316a7['attributes']:_0x381ec0[_0xd146('0x2a')];if(!_0x2dfd76['query']['hasOwnProperty']('nolimit')){_0x6316a7['limit']=qs[_0xd146('0x1c')](_0x2dfd76['query']['limit']);_0x6316a7['offset']=qs[_0xd146('0x1a')](_0x2dfd76[_0xd146('0x2b')][_0xd146('0x1a')]);}_0x6316a7['order']=qs[_0xd146('0x32')](_0x2dfd76[_0xd146('0x2b')]['sort']);_0x6316a7[_0xd146('0x33')]=qs[_0xd146('0x2d')](_[_0xd146('0x34')](_0x2dfd76[_0xd146('0x2b')],_0x381ec0[_0xd146('0x2d')]),_0x31643d);if(_0x2dfd76[_0xd146('0x2b')]['filter']){_0x6316a7[_0xd146('0x33')]=_[_0xd146('0x35')](_0x6316a7[_0xd146('0x33')],{'$or':_[_0xd146('0x28')](_0x31643d,function(_0x4b2d6f){if(_0x4b2d6f[_0xd146('0x36')]!==_0xd146('0x37')){var _0x98e46c={};_0x98e46c[_0x4b2d6f[_0xd146('0x25')]]={'$like':'%'+_0x2dfd76['query'][_0xd146('0x38')]+'%'};return _0x98e46c;}})});}_0x6316a7=_[_0xd146('0x35')]({},_0x6316a7,_0x2dfd76['options']);var _0x5a3527={'where':_0x6316a7[_0xd146('0x33')]};return db[_0xd146('0x39')][_0xd146('0x1d')](_0x5a3527)[_0xd146('0x3a')](function(_0x4576d3){_0x2361ee['count']=_0x4576d3;if(_0x2dfd76[_0xd146('0x2b')][_0xd146('0x3b')]){_0x6316a7[_0xd146('0x3c')]=[{'all':!![]}];}return db[_0xd146('0x39')][_0xd146('0x3d')](_0x6316a7);})[_0xd146('0x3a')](function(_0x571d1c){_0x2361ee[_0xd146('0x3e')]=_0x571d1c;return _0x2361ee;})['then'](respondWithFilteredResult(_0x398fbd,_0x6316a7))['catch'](handleError(_0x398fbd,null));};exports[_0xd146('0x3f')]=function(_0x30c670,_0x15c3fb){var _0xfca034={'raw':!![],'where':{'id':_0x30c670[_0xd146('0x40')]['id']}},_0x9b35ec={};_0x9b35ec['model']=_['keys'](db[_0xd146('0x39')][_0xd146('0x41')]);_0x9b35ec[_0xd146('0x2b')]=_[_0xd146('0x2c')](_0x30c670[_0xd146('0x2b')]);_0x9b35ec[_0xd146('0x2d')]=_[_0xd146('0x2e')](_0x9b35ec['model'],_0x9b35ec[_0xd146('0x2b')]);_0xfca034[_0xd146('0x2f')]=_['intersection'](_0x9b35ec[_0xd146('0x2a')],qs[_0xd146('0x30')](_0x30c670[_0xd146('0x2b')]['fields']));_0xfca034['attributes']=_0xfca034['attributes'][_0xd146('0x31')]?_0xfca034[_0xd146('0x2f')]:_0x9b35ec[_0xd146('0x2a')];if(_0x30c670['query'][_0xd146('0x3b')]){_0xfca034[_0xd146('0x3c')]=[{'all':!![]}];}_0xfca034=_[_0xd146('0x35')]({},_0xfca034,_0x30c670[_0xd146('0x42')]);return db[_0xd146('0x39')][_0xd146('0x43')](_0xfca034)['then'](handleEntityNotFound(_0x15c3fb,null))[_0xd146('0x3a')](respondWithResult(_0x15c3fb,null))[_0xd146('0x44')](handleError(_0x15c3fb,null));};exports[_0xd146('0x45')]=function(_0x4a41e5,_0x187c2e){return db[_0xd146('0x39')][_0xd146('0x45')](_0x4a41e5[_0xd146('0x46')],{})[_0xd146('0x3a')](respondWithResult(_0x187c2e,0xc9))[_0xd146('0x44')](handleError(_0x187c2e,null));};exports[_0xd146('0x22')]=function(_0x34f7a7,_0x5db9f2){if(_0x34f7a7[_0xd146('0x46')]['id']){delete _0x34f7a7[_0xd146('0x46')]['id'];}return db['JscriptySessionReport'][_0xd146('0x43')]({'where':{'id':_0x34f7a7[_0xd146('0x40')]['id']}})['then'](handleEntityNotFound(_0x5db9f2,null))[_0xd146('0x3a')](saveUpdates(_0x34f7a7['body'],null))[_0xd146('0x3a')](respondWithResult(_0x5db9f2,null))['catch'](handleError(_0x5db9f2,null));};exports[_0xd146('0x47')]=function(_0x4664c9,_0x2684f4){return db[_0xd146('0x39')][_0xd146('0x43')]({'where':{'id':_0x4664c9[_0xd146('0x40')]['id']}})['then'](handleEntityNotFound(_0x2684f4,null))[_0xd146('0x3a')](removeEntity(_0x2684f4,null))[_0xd146('0x44')](handleError(_0x2684f4,null));};exports[_0xd146('0x48')]=function(_0x4c68eb,_0x277132){return db[_0xd146('0x39')]['describe']()[_0xd146('0x3a')](respondWithResult(_0x277132,null))[_0xd146('0x44')](handleError(_0x277132,null));};exports['getQuestions']=function(_0x11243f,_0x59697d,_0xafc001){var _0x5859be={'raw':!![],'where':{}};var _0x13e908={};var _0x89c4c2={'count':0x0,'rows':[]};return db[_0xd146('0x39')][_0xd146('0x49')]({'where':{'id':_0x11243f[_0xd146('0x40')]['id']}})[_0xd146('0x3a')](handleEntityNotFound(_0x59697d,null))[_0xd146('0x3a')](function(_0x20d209){if(_0x20d209){_0x13e908[_0xd146('0x2a')]=_[_0xd146('0x2c')](db[_0xd146('0x4a')]['rawAttributes']);_0x13e908[_0xd146('0x2b')]=_[_0xd146('0x2c')](_0x11243f['query']);_0x13e908[_0xd146('0x2d')]=_[_0xd146('0x2e')](_0x13e908['model'],_0x13e908[_0xd146('0x2b')]);_0x5859be['attributes']=_[_0xd146('0x2e')](_0x13e908['model'],qs[_0xd146('0x30')](_0x11243f[_0xd146('0x2b')]['fields']));_0x5859be[_0xd146('0x2f')]=_0x5859be[_0xd146('0x2f')][_0xd146('0x31')]?_0x5859be['attributes']:_0x13e908[_0xd146('0x2a')];if(!_0x11243f[_0xd146('0x2b')][_0xd146('0x4b')](_0xd146('0x4c'))){_0x5859be[_0xd146('0x1c')]=qs[_0xd146('0x1c')](_0x11243f[_0xd146('0x2b')][_0xd146('0x1c')]);_0x5859be['offset']=qs[_0xd146('0x1a')](_0x11243f[_0xd146('0x2b')]['offset']);}_0x5859be['order']=qs[_0xd146('0x32')](_0x11243f[_0xd146('0x2b')][_0xd146('0x32')]);_0x5859be['where']=qs[_0xd146('0x2d')](_[_0xd146('0x34')](_0x11243f[_0xd146('0x2b')],_0x13e908[_0xd146('0x2d')]));_0x5859be[_0xd146('0x33')]['SessionId']=_0x20d209['id'];if(_0x11243f[_0xd146('0x2b')][_0xd146('0x38')]){_0x5859be['where']=_[_0xd146('0x35')](_0x5859be[_0xd146('0x33')],{'$or':_[_0xd146('0x28')](_0x5859be[_0xd146('0x2f')],function(_0xe7f563){var _0x5e3a83={};_0x5e3a83[_0xe7f563]={'$like':'%'+_0x11243f['query'][_0xd146('0x38')]+'%'};return _0x5e3a83;})});}_0x5859be=_['merge']({},_0x5859be,_0x11243f[_0xd146('0x42')]);return db['JscriptyQuestionReport'][_0xd146('0x1d')]({'where':_0x5859be['where']})[_0xd146('0x3a')](function(_0x4006cd){_0x89c4c2[_0xd146('0x1d')]=_0x4006cd;if(_0x11243f[_0xd146('0x2b')][_0xd146('0x3b')]){_0x5859be[_0xd146('0x3c')]=[{'all':!![]}];}return db[_0xd146('0x4a')]['findAll'](_0x5859be);})[_0xd146('0x3a')](function(_0x39ba88){_0x89c4c2[_0xd146('0x3e')]=_0x39ba88;return _0x89c4c2;});}})[_0xd146('0x3a')](respondWithFilteredResult(_0x59697d,_0x5859be))[_0xd146('0x44')](handleError(_0x59697d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 082ced0..0389517 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 _0x277c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_jscripty_sessions','lodash','../../config/logger'];(function(_0x2a8d32,_0x49e77c){var _0x28c519=function(_0x5342ce){while(--_0x5342ce){_0x2a8d32['push'](_0x2a8d32['shift']());}};_0x28c519(++_0x49e77c);}(_0x277c,0x153));var _0xc277=function(_0x4640a4,_0x457caf){_0x4640a4=_0x4640a4-0x0;var _0x213e96=_0x277c[_0x4640a4];return _0x213e96;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var logger=require(_0xc277('0x1'))(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var BPromise=require(_0xc277('0x4'));var rp=require(_0xc277('0x5'));var fs=require('fs');var path=require(_0xc277('0x6'));var rimraf=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x1a6582,_0x5a4f03){return _0x1a6582[_0xc277('0x9')]('JscriptySessionReport',attributes,{'tableName':_0xc277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1623=['lodash','api','moment','bluebird','request-promise','path','./jscriptySessionReport.attributes','JscriptySessionReport','report_jscripty_sessions'];(function(_0x166f1d,_0x24f4f1){var _0x4c549f=function(_0x2373d2){while(--_0x2373d2){_0x166f1d['push'](_0x166f1d['shift']());}};_0x4c549f(++_0x24f4f1);}(_0x1623,0xab));var _0x3162=function(_0x118c1f,_0x419d2b){_0x118c1f=_0x118c1f-0x0;var _0x528513=_0x1623[_0x118c1f];return _0x528513;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 78f40ff..905cfdf 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 _0xa6b0=['client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c1b32,_0x1352a0){var _0x96ca3f=function(_0x1db7c1){while(--_0x1db7c1){_0x5c1b32['push'](_0x5c1b32['shift']());}};_0x96ca3f(++_0x1352a0);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x14b3fa,_0x352261){_0x14b3fa=_0x14b3fa-0x0;var _0x418da0=_0xa6b0[_0x14b3fa];return _0x418da0;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a6b('0x2'));var fs=require('fs');var Redis=require(_0x0a6b('0x3'));var db=require(_0x0a6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a6b('0x5'))(_0x0a6b('0x6'));var config=require(_0x0a6b('0x7'));var jayson=require(_0x0a6b('0x8'));var client=jayson[_0x0a6b('0x9')][_0x0a6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b5fb5,_0xa908dd,_0x26f761){return new BPromise(function(_0x340a33,_0x8e89f){return client[_0x0a6b('0xb')](_0x1b5fb5,_0x26f761)['then'](function(_0x493948){logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));logger[_0x0a6b('0xf')](_0x0a6b('0x10'),_0xa908dd,_0x0a6b('0xe'),JSON[_0x0a6b('0x11')](_0x493948));if(_0x493948[_0x0a6b('0x12')]){if(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x13')]===0x1f4){logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x8e89f(_0x493948['error']['message']);}logger[_0x0a6b('0x12')](_0x0a6b('0xd'),_0xa908dd,_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);return _0x340a33(_0x493948[_0x0a6b('0x12')][_0x0a6b('0x14')]);}else{logger[_0x0a6b('0xc')](_0x0a6b('0xd'),_0xa908dd,_0x0a6b('0xe'));_0x340a33(_0x493948[_0x0a6b('0x15')]['message']);}})[_0x0a6b('0x16')](function(_0x1538f4){logger['error'](_0x0a6b('0xd'),_0xa908dd,_0x1538f4);_0x8e89f(_0x1538f4);});});} \ No newline at end of file +var _0x323f=['then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x89b7f9,_0x1c6bc4){var _0x5b34d4=function(_0x5ed600){while(--_0x5ed600){_0x89b7f9['push'](_0x89b7f9['shift']());}};_0x5b34d4(++_0x1c6bc4);}(_0x323f,0x1ee));var _0xf323=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x323f[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 2da5070..0e7b6c6 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 _0x85fe=['path','Router','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','isAuthenticated','update','downloadLogFile','exports','multer','util'];(function(_0x4c1a53,_0x1ff473){var _0x1b025b=function(_0xd637ad){while(--_0xd637ad){_0x4c1a53['push'](_0x4c1a53['shift']());}};_0x1b025b(++_0x1ff473);}(_0x85fe,0x11b));var _0xe85f=function(_0x2b891b,_0x1499a3){_0x2b891b=_0x2b891b-0x0;var _0x51c760=_0x85fe[_0x2b891b];return _0x51c760;};'use strict';var multer=require(_0xe85f('0x0'));var util=require(_0xe85f('0x1'));var path=require(_0xe85f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe85f('0x3')]();var fs_extra=require(_0xe85f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe85f('0x5'));var config=require(_0xe85f('0x6'));var controller=require(_0xe85f('0x7'));router[_0xe85f('0x8')]('/',controller[_0xe85f('0x9')]);router[_0xe85f('0xa')]('/:id',auth[_0xe85f('0xb')](),controller[_0xe85f('0xc')]);router[_0xe85f('0x8')]('/download_log_file',auth[_0xe85f('0xb')](),controller[_0xe85f('0xd')]);module[_0xe85f('0xe')]=router; \ No newline at end of file +var _0x0dab=['/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','/:id','isAuthenticated','update'];(function(_0x32a4c0,_0x5e42fe){var _0x510ea6=function(_0x112a40){while(--_0x112a40){_0x32a4c0['push'](_0x32a4c0['shift']());}};_0x510ea6(++_0x5e42fe);}(_0x0dab,0x124));var _0xb0da=function(_0x7fb4fb,_0x6cafc6){_0x7fb4fb=_0x7fb4fb-0x0;var _0x397183=_0x0dab[_0x7fb4fb];return _0x397183;};'use strict';var multer=require('multer');var util=require(_0xb0da('0x0'));var path=require(_0xb0da('0x1'));var timeout=require(_0xb0da('0x2'));var express=require(_0xb0da('0x3'));var router=express[_0xb0da('0x4')]();var fs_extra=require(_0xb0da('0x5'));var auth=require(_0xb0da('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb0da('0x7'));var controller=require(_0xb0da('0x8'));router[_0xb0da('0x9')]('/',controller[_0xb0da('0xa')]);router['put'](_0xb0da('0xb'),auth[_0xb0da('0xc')](),controller[_0xb0da('0xd')]);router[_0xb0da('0x9')](_0xb0da('0xe'),auth[_0xb0da('0xc')](),controller[_0xb0da('0xf')]);module[_0xb0da('0x10')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 9207b08..1439d59 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 _0xb4b8=['exports','STRING','sequelize'];(function(_0x40e964,_0x399ccc){var _0x46cc65=function(_0x32b185){while(--_0x32b185){_0x40e964['push'](_0x40e964['shift']());}};_0x46cc65(++_0x399ccc);}(_0xb4b8,0x1ac));var _0x8b4b=function(_0xb6439b,_0x54fce4){_0xb6439b=_0xb6439b-0x0;var _0x575cdb=_0xb4b8[_0xb6439b];return _0x575cdb;};'use strict';var Sequelize=require(_0x8b4b('0x0'));module[_0x8b4b('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x8b4b('0x2')]},'data2':{'type':Sequelize[_0x8b4b('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf5cc=['INTEGER','exports','STRING'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xf5cc,0x1f0));var _0xcf5c=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xf5cc[_0x3ba924];return _0x4cc1df;};'use strict';var Sequelize=require('sequelize');module[_0xcf5c('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xcf5c('0x1')]},'data2':{'type':Sequelize[_0xcf5c('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xcf5c('0x2')],'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 6a60bae..731c32e 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 _0x3008=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../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','send','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','catch','body','find','params','get','checkLicense','key','demo','license-info.log','/var','log','xcally','setHeader','Content-disposition','Content-Type','text/plain','download','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv'];(function(_0x526462,_0x4c6269){var _0x4df3ce=function(_0x1ffb51){while(--_0x1ffb51){_0x526462['push'](_0x526462['shift']());}};_0x4df3ce(++_0x4c6269);}(_0x3008,0x150));var _0x8300=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x3008[_0x3c8e9a];return _0x2d4c57;};'use strict';var emlformat=require(_0x8300('0x0'));var rimraf=require(_0x8300('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8300('0x2'));var BPromise=require(_0x8300('0x3'));var Mustache=require(_0x8300('0x4'));var util=require(_0x8300('0x5'));var path=require(_0x8300('0x6'));var sox=require(_0x8300('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8300('0x8'));var _=require(_0x8300('0x9'));var squel=require(_0x8300('0xa'));var crypto=require('crypto');var jsforce=require(_0x8300('0xb'));var deskjs=require(_0x8300('0xc'));var toCsv=require(_0x8300('0xd'));var querystring=require(_0x8300('0xe'));var Papa=require(_0x8300('0xf'));var Redis=require(_0x8300('0x10'));var authService=require(_0x8300('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8300('0x12'));var logger=require('../../config/logger')(_0x8300('0x13'));var utils=require('../../config/utils');var config=require(_0x8300('0x14'));var licenseUtil=require(_0x8300('0x15'));var db=require(_0x8300('0x16'))['db'];function respondWithStatusCode(_0x15f79a,_0x38e281){_0x38e281=_0x38e281||0xcc;return function(_0x4e2eb1){if(_0x4e2eb1){return _0x15f79a[_0x8300('0x17')](_0x38e281);}return _0x15f79a[_0x8300('0x18')](_0x38e281)[_0x8300('0x19')]();};}function respondWithResult(_0x32c8e2,_0x342d87){_0x342d87=_0x342d87||0xc8;return function(_0x2ac293){if(_0x2ac293){return _0x32c8e2[_0x8300('0x18')](_0x342d87)[_0x8300('0x1a')](_0x2ac293);}};}function respondWithFilteredResult(_0x3f302f,_0x52a3c0){return function(_0x1fcba7){if(_0x1fcba7){var _0x3ff5af=typeof _0x52a3c0[_0x8300('0x1b')]==='undefined'&&typeof _0x52a3c0[_0x8300('0x1c')]===_0x8300('0x1d');var _0xaa5df7=_0x1fcba7[_0x8300('0x1e')];var _0x1065ef=_0x3ff5af?0x0:_0x52a3c0['offset'];var _0x28883a=_0x3ff5af?_0x1fcba7['count']:_0x52a3c0[_0x8300('0x1b')]+_0x52a3c0[_0x8300('0x1c')];var _0x2680f7;if(_0x28883a>=_0xaa5df7){_0x28883a=_0xaa5df7;_0x2680f7=0xc8;}else{_0x2680f7=0xce;}_0x3f302f[_0x8300('0x18')](_0x2680f7);return _0x3f302f[_0x8300('0x1f')](_0x8300('0x20'),_0x1065ef+'-'+_0x28883a+'/'+_0xaa5df7)[_0x8300('0x1a')](_0x1fcba7);}return null;};}function patchUpdates(_0x48d98b){return function(_0x1614f4){try{jsonpatch[_0x8300('0x21')](_0x1614f4,_0x48d98b,!![]);}catch(_0x528f6f){return BPromise[_0x8300('0x22')](_0x528f6f);}return _0x1614f4[_0x8300('0x23')]();};}function saveUpdates(_0x427e1a,_0xac2db){return function(_0x40d3b8){if(_0x40d3b8){return _0x40d3b8[_0x8300('0x24')](_0x427e1a)[_0x8300('0x25')](function(_0x16826f){return _0x16826f;});}return null;};}function removeEntity(_0x3fce86,_0x497240){return function(_0x5de4b6){if(_0x5de4b6){return _0x5de4b6[_0x8300('0x26')]()['then'](function(){_0x3fce86[_0x8300('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x320038,_0x3a240c){return function(_0x2c7494){if(!_0x2c7494){_0x320038[_0x8300('0x17')](0x194);}return _0x2c7494;};}function handleError(_0x36f503,_0x4e83a4){_0x4e83a4=_0x4e83a4||0x1f4;return function(_0x5183dc){logger[_0x8300('0x27')](_0x5183dc['stack']);if(_0x5183dc['name']){delete _0x5183dc[_0x8300('0x28')];}_0x36f503['status'](_0x4e83a4)[_0x8300('0x29')](_0x5183dc);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x7f8f25,_0x5d1492){var _0x3446d3={'raw':!![],'where':{'id':0x1}},_0x19e2e2={};_0x19e2e2[_0x8300('0x2a')]=_[_0x8300('0x2b')](db[_0x8300('0x2c')][_0x8300('0x2d')]);_0x19e2e2[_0x8300('0x2e')]=_[_0x8300('0x2b')](_0x7f8f25[_0x8300('0x2e')]);_0x19e2e2[_0x8300('0x2f')]=_[_0x8300('0x30')](_0x19e2e2[_0x8300('0x2a')],_0x19e2e2['query']);_0x3446d3[_0x8300('0x31')]=_['intersection'](_0x19e2e2['model'],qs[_0x8300('0x32')](_0x7f8f25[_0x8300('0x2e')][_0x8300('0x32')]));_0x3446d3['attributes']=_0x3446d3['attributes'][_0x8300('0x33')]?_0x3446d3[_0x8300('0x31')]:_0x19e2e2['model'];_0x3446d3=_[_0x8300('0x34')]({},_0x3446d3,_0x7f8f25['options']);return utilLicense['getLicense'](_0x3446d3)[_0x8300('0x25')](respondWithResult(_0x5d1492,null))[_0x8300('0x35')](handleError(_0x5d1492,null));};exports['update']=function(_0x215634,_0x13ce05){if(_0x215634[_0x8300('0x36')]['id']){delete _0x215634[_0x8300('0x36')]['id'];}return db[_0x8300('0x2c')][_0x8300('0x37')]({'where':{'id':_0x215634[_0x8300('0x38')]['id']}})[_0x8300('0x25')](handleEntityNotFound(_0x13ce05,null))[_0x8300('0x25')](function(_0x5f5b30){var _0x44fe92=_0x5f5b30[_0x8300('0x39')]({'plain':!![]});return utilLicense[_0x8300('0x3a')](_0x44fe92,_0x215634['body'][_0x8300('0x3b')]);})[_0x8300('0x25')](function(_0x567605){if(!_0x567605[_0x8300('0x3c')]){return saveUpdates(_0x215634[_0x8300('0x36')],null);}return _0x567605;})['then'](respondWithResult(_0x13ce05,null))[_0x8300('0x35')](handleError(_0x13ce05,null));};exports['downloadLogFile']=function(_0x3a7303,_0x43aeb7){var _0x40e8d1=_0x8300('0x3d');var _0x291737=path['join'](_0x8300('0x3e'),_0x8300('0x3f'),_0x8300('0x40'),_0x40e8d1);_0x43aeb7[_0x8300('0x41')](_0x8300('0x42'),'attachment;\x20filename='+_0x40e8d1);_0x43aeb7[_0x8300('0x1f')](_0x8300('0x43'),_0x8300('0x44'));_0x43aeb7[_0x8300('0x45')](_0x291737);}; \ No newline at end of file +var _0x1af3=['../../config/license/util','sendStatus','status','json','undefined','count','offset','set','apply','reject','update','then','destroy','end','send','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','body','find','get','checkLicense','key','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','text/plain','download','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x44fc7b,_0x3e0aee){var _0x20c4a3=function(_0x4e2fef){while(--_0x4e2fef){_0x44fc7b['push'](_0x44fc7b['shift']());}};_0x20c4a3(++_0x3e0aee);}(_0x1af3,0x1f1));var _0x31af=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0x1af3[_0x5a187b];return _0x14d601;};'use strict';var emlformat=require(_0x31af('0x0'));var rimraf=require(_0x31af('0x1'));var zipdir=require(_0x31af('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x31af('0x3'));var BPromise=require(_0x31af('0x4'));var Mustache=require(_0x31af('0x5'));var util=require(_0x31af('0x6'));var path=require(_0x31af('0x7'));var sox=require(_0x31af('0x8'));var csv=require(_0x31af('0x9'));var ejs=require(_0x31af('0xa'));var fs=require('fs');var fs_extra=require(_0x31af('0xb'));var _=require('lodash');var squel=require(_0x31af('0xc'));var crypto=require(_0x31af('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x31af('0xe'));var toCsv=require('to-csv');var querystring=require(_0x31af('0xf'));var Papa=require('papaparse');var Redis=require(_0x31af('0x10'));var authService=require(_0x31af('0x11'));var qs=require(_0x31af('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x31af('0x13'));var logger=require(_0x31af('0x14'))(_0x31af('0x15'));var utils=require('../../config/utils');var config=require(_0x31af('0x16'));var licenseUtil=require(_0x31af('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dcf77,_0x8cc12b){_0x8cc12b=_0x8cc12b||0xcc;return function(_0x1dd854){if(_0x1dd854){return _0x4dcf77[_0x31af('0x18')](_0x8cc12b);}return _0x4dcf77[_0x31af('0x19')](_0x8cc12b)['end']();};}function respondWithResult(_0x561656,_0x4be7bb){_0x4be7bb=_0x4be7bb||0xc8;return function(_0x2dc9af){if(_0x2dc9af){return _0x561656[_0x31af('0x19')](_0x4be7bb)[_0x31af('0x1a')](_0x2dc9af);}};}function respondWithFilteredResult(_0x274327,_0x4da803){return function(_0x4a5eaa){if(_0x4a5eaa){var _0x5902d5=typeof _0x4da803['offset']===_0x31af('0x1b')&&typeof _0x4da803['limit']===_0x31af('0x1b');var _0x4aa9e0=_0x4a5eaa[_0x31af('0x1c')];var _0xb7ea0f=_0x5902d5?0x0:_0x4da803[_0x31af('0x1d')];var _0x1a4de1=_0x5902d5?_0x4a5eaa[_0x31af('0x1c')]:_0x4da803[_0x31af('0x1d')]+_0x4da803['limit'];var _0x45f57b;if(_0x1a4de1>=_0x4aa9e0){_0x1a4de1=_0x4aa9e0;_0x45f57b=0xc8;}else{_0x45f57b=0xce;}_0x274327[_0x31af('0x19')](_0x45f57b);return _0x274327[_0x31af('0x1e')]('Content-Range',_0xb7ea0f+'-'+_0x1a4de1+'/'+_0x4aa9e0)['json'](_0x4a5eaa);}return null;};}function patchUpdates(_0x69535){return function(_0x48427c){try{jsonpatch[_0x31af('0x1f')](_0x48427c,_0x69535,!![]);}catch(_0x552cf6){return BPromise[_0x31af('0x20')](_0x552cf6);}return _0x48427c['save']();};}function saveUpdates(_0x20ea05,_0x313228){return function(_0x2d7592){if(_0x2d7592){return _0x2d7592[_0x31af('0x21')](_0x20ea05)[_0x31af('0x22')](function(_0x100169){return _0x100169;});}return null;};}function removeEntity(_0xdf01c7,_0x5cfe05){return function(_0x5dd19a){if(_0x5dd19a){return _0x5dd19a[_0x31af('0x23')]()[_0x31af('0x22')](function(){_0xdf01c7['status'](0xcc)[_0x31af('0x24')]();});}};}function handleEntityNotFound(_0x508d07,_0x4d1ad6){return function(_0x66df32){if(!_0x66df32){_0x508d07[_0x31af('0x18')](0x194);}return _0x66df32;};}function handleError(_0x558c0e,_0x5c9cb9){_0x5c9cb9=_0x5c9cb9||0x1f4;return function(_0x4451f2){logger['error'](_0x4451f2['stack']);if(_0x4451f2['name']){delete _0x4451f2['name'];}_0x558c0e[_0x31af('0x19')](_0x5c9cb9)[_0x31af('0x25')](_0x4451f2);};}var utilLicense=require(_0x31af('0x17'));exports[_0x31af('0x26')]=function(_0x2699bc,_0x1e8f32){var _0x5d4f83={'raw':!![],'where':{'id':0x1}},_0x44aee0={};_0x44aee0[_0x31af('0x27')]=_[_0x31af('0x28')](db[_0x31af('0x29')][_0x31af('0x2a')]);_0x44aee0[_0x31af('0x2b')]=_[_0x31af('0x28')](_0x2699bc[_0x31af('0x2b')]);_0x44aee0['filters']=_[_0x31af('0x2c')](_0x44aee0[_0x31af('0x27')],_0x44aee0[_0x31af('0x2b')]);_0x5d4f83[_0x31af('0x2d')]=_[_0x31af('0x2c')](_0x44aee0[_0x31af('0x27')],qs[_0x31af('0x2e')](_0x2699bc[_0x31af('0x2b')][_0x31af('0x2e')]));_0x5d4f83['attributes']=_0x5d4f83[_0x31af('0x2d')]['length']?_0x5d4f83[_0x31af('0x2d')]:_0x44aee0[_0x31af('0x27')];_0x5d4f83=_[_0x31af('0x2f')]({},_0x5d4f83,_0x2699bc['options']);return utilLicense[_0x31af('0x30')](_0x5d4f83)[_0x31af('0x22')](respondWithResult(_0x1e8f32,null))[_0x31af('0x31')](handleError(_0x1e8f32,null));};exports[_0x31af('0x21')]=function(_0x34c6f9,_0xb13b5){if(_0x34c6f9[_0x31af('0x32')]['id']){delete _0x34c6f9[_0x31af('0x32')]['id'];}return db['License'][_0x31af('0x33')]({'where':{'id':_0x34c6f9['params']['id']}})[_0x31af('0x22')](handleEntityNotFound(_0xb13b5,null))[_0x31af('0x22')](function(_0x5684cc){var _0x21f28c=_0x5684cc[_0x31af('0x34')]({'plain':!![]});return utilLicense[_0x31af('0x35')](_0x21f28c,_0x34c6f9[_0x31af('0x32')][_0x31af('0x36')]);})[_0x31af('0x22')](function(_0x39bb6f){if(!_0x39bb6f['demo']){return saveUpdates(_0x34c6f9[_0x31af('0x32')],null);}return _0x39bb6f;})[_0x31af('0x22')](respondWithResult(_0xb13b5,null))[_0x31af('0x31')](handleError(_0xb13b5,null));};exports[_0x31af('0x37')]=function(_0x3c7069,_0x48e079){var _0x16f768=_0x31af('0x38');var _0x80740b=path[_0x31af('0x39')](_0x31af('0x3a'),_0x31af('0x3b'),_0x31af('0x3c'),_0x16f768);_0x48e079[_0x31af('0x3d')](_0x31af('0x3e'),'attachment;\x20filename='+_0x16f768);_0x48e079[_0x31af('0x1e')]('Content-Type',_0x31af('0x3f'));_0x48e079[_0x31af('0x40')](_0x80740b);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 40540f1..2b1814e 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 _0xab86=['path','rimraf','../../config/environment','exports','license','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x413178,_0x3d3af9){var _0x559e34=function(_0x544d78){while(--_0x544d78){_0x413178['push'](_0x413178['shift']());}};_0x559e34(++_0x3d3af9);}(_0xab86,0xec));var _0x6ab8=function(_0x454d79,_0x453dd1){_0x454d79=_0x454d79-0x0;var _0x8937b=_0xab86[_0x454d79];return _0x8937b;};'use strict';var _=require(_0x6ab8('0x0'));var util=require(_0x6ab8('0x1'));var logger=require(_0x6ab8('0x2'))('api');var moment=require(_0x6ab8('0x3'));var BPromise=require(_0x6ab8('0x4'));var rp=require(_0x6ab8('0x5'));var fs=require('fs');var path=require(_0x6ab8('0x6'));var rimraf=require(_0x6ab8('0x7'));var config=require(_0x6ab8('0x8'));var attributes=require('./license.attributes');module[_0x6ab8('0x9')]=function(_0x1ad214,_0x2fc403){return _0x1ad214['define']('License',attributes,{'tableName':_0x6ab8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x44cd=['bluebird','request-promise','path','rimraf','./license.attributes','define','License','lodash','util','../../config/logger','api','moment'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x44cd,0xd3));var _0xd44c=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x44cd[_0x4907de];return _0x482054;};'use strict';var _=require(_0xd44c('0x0'));var util=require(_0xd44c('0x1'));var logger=require(_0xd44c('0x2'))(_0xd44c('0x3'));var moment=require(_0xd44c('0x4'));var BPromise=require(_0xd44c('0x5'));var rp=require(_0xd44c('0x6'));var fs=require('fs');var path=require(_0xd44c('0x7'));var rimraf=require(_0xd44c('0x8'));var config=require('../../config/environment');var attributes=require(_0xd44c('0x9'));module['exports']=function(_0x4bfbfa,_0x2419b9){return _0x4bfbfa[_0xd44c('0xa')](_0xd44c('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 4c07254..fdd0926 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 _0x579d=['debug','License,\x20%s,\x20%s,\x20%s','error','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','License,\x20%s,\x20%s','request\x20sent'];(function(_0x25a839,_0x269e1f){var _0x29c728=function(_0x255b44){while(--_0x255b44){_0x25a839['push'](_0x25a839['shift']());}};_0x29c728(++_0x269e1f);}(_0x579d,0x16f));var _0xd579=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x579d[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xd579('0x0'));var moment=require(_0xd579('0x1'));var BPromise=require(_0xd579('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd579('0x3'));var db=require(_0xd579('0x4'))['db'];var utils=require(_0xd579('0x5'));var logger=require(_0xd579('0x6'))(_0xd579('0x7'));var config=require(_0xd579('0x8'));var jayson=require(_0xd579('0x9'));var client=jayson[_0xd579('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d3422,_0x552442,_0x24bac5){return new BPromise(function(_0x129e17,_0x25f5c3){return client['request'](_0x3d3422,_0x24bac5)['then'](function(_0x2375c8){logger['info'](_0xd579('0xb'),_0x552442,_0xd579('0xc'));logger[_0xd579('0xd')](_0xd579('0xe'),_0x552442,_0xd579('0xc'),JSON['stringify'](_0x2375c8));if(_0x2375c8[_0xd579('0xf')]){if(_0x2375c8[_0xd579('0xf')]['code']===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x552442,_0x2375c8[_0xd579('0xf')][_0xd579('0x10')]);return _0x25f5c3(_0x2375c8[_0xd579('0xf')][_0xd579('0x10')]);}logger[_0xd579('0xf')](_0xd579('0xb'),_0x552442,_0x2375c8[_0xd579('0xf')]['message']);return _0x129e17(_0x2375c8[_0xd579('0xf')]['message']);}else{logger[_0xd579('0x11')](_0xd579('0xb'),_0x552442,_0xd579('0xc'));_0x129e17(_0x2375c8['result'][_0xd579('0x10')]);}})[_0xd579('0x12')](function(_0x13a9ae){logger[_0xd579('0xf')](_0xd579('0xb'),_0x552442,_0x13a9ae);_0x25f5c3(_0x13a9ae);});});} \ No newline at end of file +var _0x0195=['client','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise'];(function(_0x4cefa8,_0x2be28d){var _0x300246=function(_0x29bd0b){while(--_0x29bd0b){_0x4cefa8['push'](_0x4cefa8['shift']());}};_0x300246(++_0x2be28d);}(_0x0195,0x13b));var _0x5019=function(_0x278b86,_0x4786e0){_0x278b86=_0x278b86-0x0;var _0xa2839c=_0x0195[_0x278b86];return _0xa2839c;};'use strict';var _=require(_0x5019('0x0'));var util=require(_0x5019('0x1'));var moment=require(_0x5019('0x2'));var BPromise=require(_0x5019('0x3'));var rs=require(_0x5019('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5019('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5019('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5019('0x7'));var client=jayson[_0x5019('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae72e,_0x361542,_0xb93ba2){return new BPromise(function(_0x3a8d3c,_0xd80af7){return client[_0x5019('0x9')](_0x3ae72e,_0xb93ba2)['then'](function(_0x44ba55){logger[_0x5019('0xa')](_0x5019('0xb'),_0x361542,_0x5019('0xc'));logger[_0x5019('0xd')](_0x5019('0xe'),_0x361542,_0x5019('0xc'),JSON[_0x5019('0xf')](_0x44ba55));if(_0x44ba55[_0x5019('0x10')]){if(_0x44ba55[_0x5019('0x10')]['code']===0x1f4){logger[_0x5019('0x10')](_0x5019('0xb'),_0x361542,_0x44ba55[_0x5019('0x10')]['message']);return _0xd80af7(_0x44ba55[_0x5019('0x10')]['message']);}logger[_0x5019('0x10')]('License,\x20%s,\x20%s',_0x361542,_0x44ba55['error'][_0x5019('0x11')]);return _0x3a8d3c(_0x44ba55[_0x5019('0x10')][_0x5019('0x11')]);}else{logger[_0x5019('0xa')](_0x5019('0xb'),_0x361542,_0x5019('0xc'));_0x3a8d3c(_0x44ba55[_0x5019('0x12')][_0x5019('0x11')]);}})['catch'](function(_0x3b8b24){logger[_0x5019('0x10')](_0x5019('0xb'),_0x361542,_0x3b8b24);_0xd80af7(_0x3b8b24);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index c02c449..024555e 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 _0xeb45=['./mailAccount.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/dispositions','/:id/canned_answers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeAnswers','removeSmtp','destroy','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x32cca1,_0x46f1c6){var _0x16441a=function(_0x126b57){while(--_0x126b57){_0x32cca1['push'](_0x32cca1['shift']());}};_0x16441a(++_0x46f1c6);}(_0xeb45,0x196));var _0x5eb4=function(_0x203d73,_0x534d4a){_0x203d73=_0x203d73-0x0;var _0x5f1f5a=_0xeb45[_0x203d73];return _0x5f1f5a;};'use strict';var multer=require(_0x5eb4('0x0'));var util=require('util');var path=require(_0x5eb4('0x1'));var timeout=require(_0x5eb4('0x2'));var express=require(_0x5eb4('0x3'));var router=express[_0x5eb4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5eb4('0x5'));var interaction=require(_0x5eb4('0x6'));var config=require(_0x5eb4('0x7'));var controller=require(_0x5eb4('0x8'));router['get']('/',auth[_0x5eb4('0x9')](),controller['index']);router['get'](_0x5eb4('0xa'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0xb')]);router[_0x5eb4('0xc')](_0x5eb4('0xd'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0xe')]);router[_0x5eb4('0xc')](_0x5eb4('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x5eb4('0xc')](_0x5eb4('0x10'),auth[_0x5eb4('0x9')](),controller['getAnswers']);router[_0x5eb4('0xc')]('/:id/in_servers',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x11')]);router[_0x5eb4('0xc')](_0x5eb4('0x12'),auth['isAuthenticated'](),controller[_0x5eb4('0x13')]);router['get'](_0x5eb4('0x14'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x15')]);router[_0x5eb4('0xc')]('/:id/applications',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x16')]);router[_0x5eb4('0xc')](_0x5eb4('0x17'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x18')]);router[_0x5eb4('0xc')]('/:id/verify',auth['isAuthenticated'](),controller[_0x5eb4('0x19')]);router[_0x5eb4('0xc')](_0x5eb4('0x1a'),auth[_0x5eb4('0x9')](),controller['getAgents']);router[_0x5eb4('0x1b')](_0x5eb4('0xf'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x1c')]);router[_0x5eb4('0x1b')](_0x5eb4('0x10'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x1d')]);router[_0x5eb4('0x1b')]('/',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x1e')]);router[_0x5eb4('0x1b')](_0x5eb4('0x1f'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x20')]);router[_0x5eb4('0x1b')]('/:id/out_servers',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x21')]);router[_0x5eb4('0x1b')]('/:id/interactions',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x22')]);router[_0x5eb4('0x1b')]('/:id/applications',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x23')]);router[_0x5eb4('0x1b')](_0x5eb4('0x24'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x25')]);router[_0x5eb4('0x1b')](_0x5eb4('0x1a'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x26')]);router[_0x5eb4('0x27')]('/:id',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x28')]);router[_0x5eb4('0x29')](_0x5eb4('0xf'),auth[_0x5eb4('0x9')](),controller['removeDispositions']);router[_0x5eb4('0x29')]('/:id/canned_answers',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x2a')]);router['delete'](_0x5eb4('0x1f'),auth[_0x5eb4('0x9')](),controller['removeImap']);router[_0x5eb4('0x29')](_0x5eb4('0x12'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x2b')]);router[_0x5eb4('0x29')](_0x5eb4('0xd'),auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x2c')]);router[_0x5eb4('0x29')]('/:id/users',auth[_0x5eb4('0x9')](),controller[_0x5eb4('0x2d')]);module['exports']=router; \ No newline at end of file +var _0x8c55=['getMessages','/:id/verify','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','create','/:id/in_servers','/:id/out_servers','addInteraction','/:id/send','/:id/users','addAgents','put','update','delete','removeAnswers','removeSmtp','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','/:id','getDispositions','getAnswers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x2e4e5b,_0xa29afe){var _0x5d563e=function(_0x21f357){while(--_0x21f357){_0x2e4e5b['push'](_0x2e4e5b['shift']());}};_0x5d563e(++_0xa29afe);}(_0x8c55,0x159));var _0x58c5=function(_0x52e693,_0x3541bc){_0x52e693=_0x52e693-0x0;var _0x13c032=_0x8c55[_0x52e693];return _0x13c032;};'use strict';var multer=require(_0x58c5('0x0'));var util=require(_0x58c5('0x1'));var path=require('path');var timeout=require(_0x58c5('0x2'));var express=require(_0x58c5('0x3'));var router=express[_0x58c5('0x4')]();var fs_extra=require(_0x58c5('0x5'));var auth=require(_0x58c5('0x6'));var interaction=require(_0x58c5('0x7'));var config=require(_0x58c5('0x8'));var controller=require(_0x58c5('0x9'));router[_0x58c5('0xa')]('/',auth[_0x58c5('0xb')](),controller[_0x58c5('0xc')]);router[_0x58c5('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x58c5('0xd')]);router[_0x58c5('0xa')](_0x58c5('0xe'),auth[_0x58c5('0xb')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x58c5('0xf')]);router[_0x58c5('0xa')]('/:id/canned_answers',auth[_0x58c5('0xb')](),controller[_0x58c5('0x10')]);router['get']('/:id/in_servers',auth[_0x58c5('0xb')](),controller[_0x58c5('0x11')]);router[_0x58c5('0xa')]('/:id/out_servers',auth[_0x58c5('0xb')](),controller[_0x58c5('0x12')]);router[_0x58c5('0xa')](_0x58c5('0x13'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x14')]);router['get'](_0x58c5('0x15'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x16')]);router[_0x58c5('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x58c5('0x17')]);router[_0x58c5('0xa')](_0x58c5('0x18'),auth[_0x58c5('0xb')](),controller['verifySmtp']);router[_0x58c5('0xa')]('/:id/users',auth[_0x58c5('0xb')](),controller[_0x58c5('0x19')]);router[_0x58c5('0x1a')](_0x58c5('0x1b'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x1c')]);router[_0x58c5('0x1a')](_0x58c5('0x1d'),auth['isAuthenticated'](),controller[_0x58c5('0x1e')]);router[_0x58c5('0x1a')]('/',auth[_0x58c5('0xb')](),controller[_0x58c5('0x1f')]);router[_0x58c5('0x1a')](_0x58c5('0x20'),auth[_0x58c5('0xb')](),controller['addImap']);router[_0x58c5('0x1a')](_0x58c5('0x21'),auth[_0x58c5('0xb')](),controller['addSmtp']);router['post']('/:id/interactions',auth[_0x58c5('0xb')](),controller[_0x58c5('0x22')]);router['post']('/:id/applications',auth[_0x58c5('0xb')](),controller['addApplications']);router[_0x58c5('0x1a')](_0x58c5('0x23'),auth[_0x58c5('0xb')](),controller['send']);router['post'](_0x58c5('0x24'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x25')]);router[_0x58c5('0x26')](_0x58c5('0xe'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x27')]);router[_0x58c5('0x28')]('/:id/dispositions',auth[_0x58c5('0xb')](),controller['removeDispositions']);router[_0x58c5('0x28')](_0x58c5('0x1d'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x29')]);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller['removeImap']);router[_0x58c5('0x28')](_0x58c5('0x21'),auth['isAuthenticated'](),controller[_0x58c5('0x2a')]);router[_0x58c5('0x28')](_0x58c5('0xe'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x2b')]);router[_0x58c5('0x28')](_0x58c5('0x24'),auth[_0x58c5('0xb')](),controller[_0x58c5('0x2c')]);module[_0x58c5('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index bfb0164..fcf0e4f 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 _0x59aa=['mandatoryDisposition','ENUM','gmail','hotmail','yahoo','outlook365','provider','setDataValue','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x48a81d,_0x2b3d9e){var _0x19699a=function(_0x117ebf){while(--_0x117ebf){_0x48a81d['push'](_0x48a81d['shift']());}};_0x19699a(++_0x2b3d9e);}(_0x59aa,0xc6));var _0xa59a=function(_0xafedf,_0x432b82){_0xafedf=_0xafedf-0x0;var _0x3d369a=_0x59aa[_0xafedf];return _0x3d369a;};'use strict';var Sequelize=require(_0xa59a('0x0'));module[_0xa59a('0x1')]={'description':{'type':Sequelize[_0xa59a('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa59a('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa59a('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xa59a('0x4')]},'markAsUnread':{'type':Sequelize[_0xa59a('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa59a('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa59a('0x4')],'defaultValue':function(){return _0xa59a('0x6');}},'notificationSound':{'type':Sequelize[_0xa59a('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa59a('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa59a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa59a('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa59a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa59a('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa59a('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa59a('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xa59a('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xa59a('0x3')],'defaultValue':![],'comment':_0xa59a('0x9'),'set':function(_0x439c5f){if(!_0x439c5f)this['setDataValue'](_0xa59a('0xa'),null);this['setDataValue'](_0xa59a('0xb'),_0x439c5f);}},'provider':{'type':Sequelize[_0xa59a('0xc')](_0xa59a('0xd'),_0xa59a('0xe'),_0xa59a('0xf'),_0xa59a('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return'custom';return this['getDataValue'](_0xa59a('0x11'));},'set':function(_0x1cd962){if(_0x1cd962==='custom')_0x1cd962=null;return this[_0xa59a('0x12')]('provider',_0x1cd962);}}}; \ No newline at end of file +var _0x0dfd=['custom','sequelize','exports','STRING','BOOLEAN','INTEGER','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider'];(function(_0x286892,_0xe74dd9){var _0x318e28=function(_0x23f50b){while(--_0x23f50b){_0x286892['push'](_0x286892['shift']());}};_0x318e28(++_0xe74dd9);}(_0x0dfd,0x1ee));var _0xd0df=function(_0x123bc8,_0x13d582){_0x123bc8=_0x123bc8-0x0;var _0x58483e=_0x0dfd[_0x123bc8];return _0x58483e;};'use strict';var Sequelize=require(_0xd0df('0x0'));module[_0xd0df('0x1')]={'description':{'type':Sequelize[_0xd0df('0x2')]},'name':{'type':Sequelize[_0xd0df('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xd0df('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xd0df('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xd0df('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xd0df('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xd0df('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xd0df('0x5')],'defaultValue':function(){return _0xd0df('0x6');}},'notificationSound':{'type':Sequelize[_0xd0df('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd0df('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd0df('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd0df('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd0df('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd0df('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd0df('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd0df('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x7bf026){if(!_0x7bf026)this[_0xd0df('0x7')](_0xd0df('0x8'),null);this['setDataValue'](_0xd0df('0x9'),_0x7bf026);}},'provider':{'type':Sequelize[_0xd0df('0xa')](_0xd0df('0xb'),_0xd0df('0xc'),'yahoo',_0xd0df('0xd')),'defaultValue':null,'get':function(){if(!this[_0xd0df('0xe')]('provider'))return'custom';return this[_0xd0df('0xe')](_0xd0df('0xf'));},'set':function(_0x5e6501){if(_0x5e6501===_0xd0df('0x10'))_0x5e6501=null;return this[_0xd0df('0x7')](_0xd0df('0xf'),_0x5e6501);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 6aac836..56cf402 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 _0xb968=['split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','List','Contacts','updatedAt','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','CloudProvider','data5','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','update','get','UserProfileResource','destroy','name','send','MailServerIn','Smtp','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','MailAccount','count','includeAll','include','findAll','show','params','Imap','MailServerOut','find','body','CloudProviderId','describe','MailAccountId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','provider','email','ListId','isNil','active','description','user','password','modernAuthentication','pass','service','host','port','authentication','username','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','ids','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','findAndCountAll','priority','stack','getApplications','getMessages','$gte'];(function(_0x2d66fd,_0x3c9415){var _0x322f24=function(_0x3aa4cc){while(--_0x3aa4cc){_0x2d66fd['push'](_0x2d66fd['shift']());}};_0x322f24(++_0x3c9415);}(_0xb968,0xdc));var _0x8b96=function(_0x39c223,_0x439d18){_0x39c223=_0x39c223-0x0;var _0x45eb76=_0xb968[_0x39c223];return _0x45eb76;};'use strict';var moment=require(_0x8b96('0x0'));var BPromise=require(_0x8b96('0x1'));var util=require(_0x8b96('0x2'));var path=require(_0x8b96('0x3'));var _=require(_0x8b96('0x4'));var juice=require('juice');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x8b96('0x5'))(_0x8b96('0x6'));var config=require(_0x8b96('0x7'));var db=require(_0x8b96('0x8'))['db'];config[_0x8b96('0x9')]=_[_0x8b96('0xa')](config[_0x8b96('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b96('0x9')]));require('./mailAccount.socket')[_0x8b96('0xb')](socket);var jayson=require(_0x8b96('0xc'));var client=jayson[_0x8b96('0xd')][_0x8b96('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x45f1ea,_0x423502,_0xfb2041,_0x38c0dc){return new BPromise(function(_0x1bb6fd,_0x44774a){var _0x1fd07b=_0x38c0dc||client;return _0x1fd07b[_0x8b96('0xf')](_0x45f1ea,_0xfb2041)[_0x8b96('0x10')](function(_0x227666){logger[_0x8b96('0x11')](_0x8b96('0x12'),_0x423502,_0x8b96('0x13'));logger['debug'](_0x8b96('0x14'),_0x423502,_0x8b96('0x13'),JSON[_0x8b96('0x15')](_0x227666));if(_0x227666[_0x8b96('0x16')]){if(_0x227666[_0x8b96('0x16')]['code']===0x1f4){logger['error'](_0x8b96('0x12'),_0x423502,_0x227666['error'][_0x8b96('0x17')]);return _0x44774a(_0x227666[_0x8b96('0x16')][_0x8b96('0x17')]);}logger[_0x8b96('0x16')](_0x8b96('0x12'),_0x423502,_0x227666[_0x8b96('0x16')]['message']);return _0x1bb6fd(_0x227666['error'][_0x8b96('0x17')]);}else{logger[_0x8b96('0x11')](_0x8b96('0x12'),_0x423502,_0x8b96('0x13'));_0x1bb6fd(_0x227666[_0x8b96('0x18')][_0x8b96('0x17')]);}})[_0x8b96('0x19')](function(_0x4042b6){logger[_0x8b96('0x16')](_0x8b96('0x12'),_0x423502,_0x4042b6);_0x44774a(_0x4042b6);});});}function respondWithStatusCode(_0x53bbce,_0x1452af){_0x1452af=_0x1452af||0xcc;return function(_0x47bf5f){if(_0x47bf5f){return _0x53bbce[_0x8b96('0x1a')](_0x1452af);}return _0x53bbce[_0x8b96('0x1b')](_0x1452af)[_0x8b96('0x1c')]();};}function respondWithResult(_0x45af33,_0x2de469){_0x2de469=_0x2de469||0xc8;return function(_0x91f76f){if(_0x91f76f){return _0x45af33[_0x8b96('0x1b')](_0x2de469)['json'](_0x91f76f);}};}function respondWithFilteredResult(_0x4a061c,_0x3cc5d6){return function(_0x536487){if(_0x536487){var _0x3b8338=typeof _0x3cc5d6[_0x8b96('0x1d')]===_0x8b96('0x1e')&&typeof _0x3cc5d6[_0x8b96('0x1f')]==='undefined';var _0x338edb=_0x536487['count'];var _0x50fd88=_0x3b8338?0x0:_0x3cc5d6[_0x8b96('0x1d')];var _0x190ad0=_0x3b8338?_0x536487['count']:_0x3cc5d6[_0x8b96('0x1d')]+_0x3cc5d6[_0x8b96('0x1f')];var _0x52ce3e;if(_0x190ad0>=_0x338edb){_0x190ad0=_0x338edb;_0x52ce3e=0xc8;}else{_0x52ce3e=0xce;}_0x4a061c['status'](_0x52ce3e);return _0x4a061c[_0x8b96('0x20')](_0x8b96('0x21'),_0x50fd88+'-'+_0x190ad0+'/'+_0x338edb)[_0x8b96('0x22')](_0x536487);}return null;};}function saveUpdates(_0x1e406c){return function(_0x3728f8){if(_0x3728f8){return _0x3728f8[_0x8b96('0x23')](_0x1e406c)[_0x8b96('0x10')](function(_0x4ea256){return _0x4ea256;});}return null;};}function removeEntity(_0x59d295){return function(_0xa4192e){if(_0xa4192e){return _0xa4192e['destroy']()[_0x8b96('0x10')](function(){var _0x421383=_0xa4192e[_0x8b96('0x24')]({'plain':!![]});var _0x484b55='MailAccounts';return db[_0x8b96('0x25')][_0x8b96('0x26')]({'where':{'type':_0x484b55,'resourceId':_0x421383['id']}})[_0x8b96('0x10')](function(){return _0xa4192e;});})['then'](function(){_0x59d295[_0x8b96('0x1b')](0xcc)[_0x8b96('0x1c')]();});}};}function handleEntityNotFound(_0x2bcdc1){return function(_0x170613){if(!_0x170613){_0x2bcdc1['sendStatus'](0x194);}return _0x170613;};}function handleError(_0xbf27c1,_0x5011a2){_0x5011a2=_0x5011a2||0x1f4;return function(_0x2bc244){logger['error'](_0x2bc244['stack']);if(_0x2bc244[_0x8b96('0x27')]){delete _0x2bc244['name'];}_0xbf27c1['status'](_0x5011a2)[_0x8b96('0x28')](_0x2bc244);};}exports['index']=function(_0xb25851,_0x213126){var _0xd6a00e={'include':[{'model':db[_0x8b96('0x29')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x8b96('0x2a')},{'model':db[_0x8b96('0x2b')],'as':_0x8b96('0x2c')}]},_0x3dadd0={},_0x4d2383={'count':0x0,'rows':[]};var _0x1ec1d7=_['map'](db['MailAccount'][_0x8b96('0x2d')],function(_0x46a338){return{'name':_0x46a338[_0x8b96('0x2e')],'type':_0x46a338[_0x8b96('0x2f')][_0x8b96('0x30')]};});_0x3dadd0[_0x8b96('0x31')]=_[_0x8b96('0x32')](_0x1ec1d7,'name');_0x3dadd0['query']=_[_0x8b96('0x33')](_0xb25851['query']);_0x3dadd0[_0x8b96('0x34')]=_[_0x8b96('0x35')](_0x3dadd0[_0x8b96('0x31')],_0x3dadd0[_0x8b96('0x36')]);_0xd6a00e[_0x8b96('0x37')]=_[_0x8b96('0x35')](_0x3dadd0[_0x8b96('0x31')],qs['fields'](_0xb25851[_0x8b96('0x36')][_0x8b96('0x38')]));_0xd6a00e['attributes']=_0xd6a00e[_0x8b96('0x37')][_0x8b96('0x39')]?_0xd6a00e[_0x8b96('0x37')]:_0x3dadd0[_0x8b96('0x31')];if(!_0xb25851[_0x8b96('0x36')]['hasOwnProperty'](_0x8b96('0x3a'))){_0xd6a00e[_0x8b96('0x1f')]=qs[_0x8b96('0x1f')](_0xb25851['query'][_0x8b96('0x1f')]);_0xd6a00e[_0x8b96('0x1d')]=qs[_0x8b96('0x1d')](_0xb25851[_0x8b96('0x36')][_0x8b96('0x1d')]);}_0xd6a00e[_0x8b96('0x3b')]=qs[_0x8b96('0x3c')](_0xb25851['query'][_0x8b96('0x3c')]);_0xd6a00e[_0x8b96('0x3d')]=qs[_0x8b96('0x34')](_[_0x8b96('0x3e')](_0xb25851[_0x8b96('0x36')],_0x3dadd0[_0x8b96('0x34')]),_0x1ec1d7);if(_0xb25851['query'][_0x8b96('0x3f')]){_0xd6a00e['where']=_['merge'](_0xd6a00e['where'],{'$or':_[_0x8b96('0x32')](_0x1ec1d7,function(_0x17f57f){if(_0x17f57f[_0x8b96('0x2f')]!=='VIRTUAL'){var _0x2326f7={};_0x2326f7[_0x17f57f[_0x8b96('0x27')]]={'$like':'%'+_0xb25851[_0x8b96('0x36')][_0x8b96('0x3f')]+'%'};return _0x2326f7;}})});}_0xd6a00e=_[_0x8b96('0x40')]({},_0xd6a00e,_0xb25851[_0x8b96('0x41')]);var _0x57d9d9={'where':_0xd6a00e[_0x8b96('0x3d')]};return db[_0x8b96('0x42')]['count'](_0x57d9d9)[_0x8b96('0x10')](function(_0x52d4a8){_0x4d2383[_0x8b96('0x43')]=_0x52d4a8;if(_0xb25851[_0x8b96('0x36')][_0x8b96('0x44')]){_0xd6a00e[_0x8b96('0x45')]=[{'all':!![]}];}return db['MailAccount'][_0x8b96('0x46')](_0xd6a00e);})[_0x8b96('0x10')](function(_0xc7882c){_0x4d2383['rows']=_0xc7882c;return _0x4d2383;})['then'](respondWithFilteredResult(_0x213126,_0xd6a00e))['catch'](handleError(_0x213126,null));};exports[_0x8b96('0x47')]=function(_0x2f73a1,_0x3f36d9){var _0x40cbf1={'raw':![],'where':{'id':_0x2f73a1[_0x8b96('0x48')]['id']},'include':[{'model':db[_0x8b96('0x29')],'as':_0x8b96('0x49')},{'model':db[_0x8b96('0x4a')],'as':_0x8b96('0x2a')},{'model':db['Pause'],'as':_0x8b96('0x2c')}]},_0x44cd1d={};_0x44cd1d[_0x8b96('0x31')]=_[_0x8b96('0x33')](db['MailAccount']['rawAttributes']);_0x44cd1d[_0x8b96('0x36')]=_['keys'](_0x2f73a1[_0x8b96('0x36')]);_0x44cd1d[_0x8b96('0x34')]=_[_0x8b96('0x35')](_0x44cd1d[_0x8b96('0x31')],_0x44cd1d[_0x8b96('0x36')]);_0x40cbf1[_0x8b96('0x37')]=_[_0x8b96('0x35')](_0x44cd1d['model'],qs['fields'](_0x2f73a1[_0x8b96('0x36')]['fields']));_0x40cbf1[_0x8b96('0x37')]=_0x40cbf1['attributes'][_0x8b96('0x39')]?_0x40cbf1[_0x8b96('0x37')]:_0x44cd1d[_0x8b96('0x31')];if(_0x2f73a1[_0x8b96('0x36')][_0x8b96('0x44')]){_0x40cbf1[_0x8b96('0x45')]=[{'all':!![]}];}_0x40cbf1=_[_0x8b96('0x40')]({},_0x40cbf1,_0x2f73a1['options']);return db[_0x8b96('0x42')][_0x8b96('0x4b')](_0x40cbf1)[_0x8b96('0x10')](handleEntityNotFound(_0x3f36d9,null))['then'](respondWithResult(_0x3f36d9,null))['catch'](handleError(_0x3f36d9,null));};exports[_0x8b96('0x23')]=function(_0x52ed63,_0x592c6d){if(_0x52ed63[_0x8b96('0x4c')]['id']){delete _0x52ed63[_0x8b96('0x4c')]['id'];}if(_0x52ed63[_0x8b96('0x4c')][_0x8b96('0x49')]){if(!_0x52ed63[_0x8b96('0x4c')][_0x8b96('0x49')]['modernAuthentication']){_0x52ed63['body'][_0x8b96('0x49')]['CloudProviderId']=null;}}if(_0x52ed63['body'][_0x8b96('0x2a')]){if(!_0x52ed63['body'][_0x8b96('0x2a')]['modernAuthentication']){_0x52ed63['body'][_0x8b96('0x2a')][_0x8b96('0x4d')]=null;}}return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x52ed63[_0x8b96('0x48')]['id']},'include':[{'model':db[_0x8b96('0x29')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x8b96('0x2a')},{'model':db[_0x8b96('0x2b')],'as':'mandatoryDispositionPause'}]})[_0x8b96('0x10')](handleEntityNotFound(_0x592c6d,null))[_0x8b96('0x10')](saveUpdates(_0x52ed63[_0x8b96('0x4c')],null))[_0x8b96('0x10')](function(_0x452bd4){if(_0x452bd4&&_0x52ed63['body'][_0x8b96('0x49')]){return db[_0x8b96('0x29')][_0x8b96('0x23')](_0x52ed63['body'][_0x8b96('0x49')],{'where':{'MailAccountId':_0x452bd4['id']}})['then'](function(){return _0x452bd4;});}return _0x452bd4;})[_0x8b96('0x10')](function(_0x4da7cd){if(_0x4da7cd&&_0x52ed63[_0x8b96('0x4c')][_0x8b96('0x2a')]){return db[_0x8b96('0x4a')][_0x8b96('0x23')](_0x52ed63[_0x8b96('0x4c')][_0x8b96('0x2a')],{'where':{'MailAccountId':_0x4da7cd['id']}})[_0x8b96('0x10')](function(){return _0x4da7cd;});}return _0x4da7cd;})[_0x8b96('0x10')](respondWithResult(_0x592c6d,null))[_0x8b96('0x19')](handleError(_0x592c6d,null));};exports[_0x8b96('0x4e')]=function(_0x1f707b,_0xf09ba6){return db[_0x8b96('0x42')][_0x8b96('0x4e')]()[_0x8b96('0x10')](respondWithResult(_0xf09ba6,null))[_0x8b96('0x19')](handleError(_0xf09ba6,null));};exports['addDisposition']=function(_0x183b20,_0x4f5ee9){if(_0x183b20[_0x8b96('0x4c')]['id']){delete _0x183b20[_0x8b96('0x4c')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x183b20['params']['id']}})['then'](handleEntityNotFound(_0x4f5ee9,null))[_0x8b96('0x10')](function(_0x263f7a){if(_0x263f7a){_0x183b20['body'][_0x8b96('0x4f')]=_0x263f7a['id'];return db[_0x8b96('0x50')]['create'](_0x183b20['body']);}})[_0x8b96('0x10')](respondWithResult(_0x4f5ee9,null))[_0x8b96('0x19')](handleError(_0x4f5ee9,null));};exports[_0x8b96('0x51')]=function(_0x36d733,_0x38a198){var _0x174796={'raw':![],'where':{}};var _0xe7ce4={};var _0x2ca98c={'count':0x0,'rows':[]};return db['MailAccount'][_0x8b96('0x52')]({'where':{'id':_0x36d733[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x38a198,null))['then'](function(_0x4c9c54){if(_0x4c9c54){_0xe7ce4[_0x8b96('0x31')]=_[_0x8b96('0x33')](db[_0x8b96('0x50')][_0x8b96('0x2d')]);_0xe7ce4[_0x8b96('0x36')]=_[_0x8b96('0x33')](_0x36d733[_0x8b96('0x36')]);_0xe7ce4[_0x8b96('0x34')]=_[_0x8b96('0x35')](_0xe7ce4[_0x8b96('0x31')],_0xe7ce4['query']);_0x174796[_0x8b96('0x37')]=_['intersection'](_0xe7ce4['model'],qs[_0x8b96('0x38')](_0x36d733[_0x8b96('0x36')]['fields']));_0x174796[_0x8b96('0x37')]=_0x174796[_0x8b96('0x37')][_0x8b96('0x39')]?_0x174796[_0x8b96('0x37')]:_0xe7ce4[_0x8b96('0x31')];if(!_0x36d733[_0x8b96('0x36')][_0x8b96('0x53')](_0x8b96('0x3a'))){_0x174796[_0x8b96('0x1f')]=qs[_0x8b96('0x1f')](_0x36d733[_0x8b96('0x36')]['limit']);_0x174796[_0x8b96('0x1d')]=qs[_0x8b96('0x1d')](_0x36d733[_0x8b96('0x36')][_0x8b96('0x1d')]);}_0x174796[_0x8b96('0x3b')]=qs['sort'](_0x36d733[_0x8b96('0x36')][_0x8b96('0x3c')]);_0x174796[_0x8b96('0x3d')]=qs[_0x8b96('0x34')](_[_0x8b96('0x3e')](_0x36d733[_0x8b96('0x36')],_0xe7ce4[_0x8b96('0x34')]));_0x174796[_0x8b96('0x3d')][_0x8b96('0x4f')]=_0x4c9c54['id'];if(_0x36d733[_0x8b96('0x36')][_0x8b96('0x3f')]){_0x174796[_0x8b96('0x3d')]=_[_0x8b96('0x40')](_0x174796[_0x8b96('0x3d')],{'$or':_[_0x8b96('0x32')](_0x174796[_0x8b96('0x37')],function(_0x18fa2d){var _0x42f62c={};_0x42f62c[_0x18fa2d]={'$like':'%'+_0x36d733[_0x8b96('0x36')]['filter']+'%'};return _0x42f62c;})});}_0x174796=_['merge']({},_0x174796,_0x36d733[_0x8b96('0x41')]);return db[_0x8b96('0x50')][_0x8b96('0x43')]({'where':_0x174796[_0x8b96('0x3d')]})[_0x8b96('0x10')](function(_0x2b531d){_0x2ca98c[_0x8b96('0x43')]=_0x2b531d;if(_0x36d733[_0x8b96('0x36')][_0x8b96('0x44')]){_0x174796['include']=[{'all':!![]}];}return db[_0x8b96('0x50')]['findAll'](_0x174796);})[_0x8b96('0x10')](function(_0x2b8759){_0x2ca98c[_0x8b96('0x54')]=_0x2b8759;return _0x2ca98c;});}})[_0x8b96('0x10')](respondWithFilteredResult(_0x38a198,_0x174796))[_0x8b96('0x19')](handleError(_0x38a198,null));};exports[_0x8b96('0x55')]=function(_0x28fadd,_0x235587){return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x28fadd['params']['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x235587,null))[_0x8b96('0x10')](function(_0xa1f9e9){if(_0xa1f9e9){return _0xa1f9e9[_0x8b96('0x55')](_0x28fadd[_0x8b96('0x36')]['ids']);}})[_0x8b96('0x10')](respondWithStatusCode(_0x235587,null))['catch'](handleError(_0x235587,null));};exports[_0x8b96('0x56')]=function(_0x162342,_0x2716a2){if(_0x162342[_0x8b96('0x4c')]['id']){delete _0x162342[_0x8b96('0x4c')]['id'];}return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x162342[_0x8b96('0x48')]['id']}})['then'](handleEntityNotFound(_0x2716a2,null))['then'](function(_0x4b0516){if(_0x4b0516){_0x162342[_0x8b96('0x4c')][_0x8b96('0x4f')]=_0x4b0516['id'];return db[_0x8b96('0x57')][_0x8b96('0x58')](_0x162342['body']);}})[_0x8b96('0x10')](respondWithResult(_0x2716a2,null))[_0x8b96('0x19')](handleError(_0x2716a2,null));};exports[_0x8b96('0x59')]=function(_0xf187da,_0x4cf64d){var _0x58258a={'raw':![],'where':{}};var _0x3e8ed6={};var _0xc0f9b3={'count':0x0,'rows':[]};return db[_0x8b96('0x42')]['findOne']({'where':{'id':_0xf187da[_0x8b96('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cf64d,null))['then'](function(_0x345593){if(_0x345593){_0x3e8ed6['model']=_[_0x8b96('0x33')](db[_0x8b96('0x57')][_0x8b96('0x2d')]);_0x3e8ed6['query']=_['keys'](_0xf187da[_0x8b96('0x36')]);_0x3e8ed6[_0x8b96('0x34')]=_[_0x8b96('0x35')](_0x3e8ed6['model'],_0x3e8ed6[_0x8b96('0x36')]);_0x58258a[_0x8b96('0x37')]=_[_0x8b96('0x35')](_0x3e8ed6['model'],qs[_0x8b96('0x38')](_0xf187da[_0x8b96('0x36')][_0x8b96('0x38')]));_0x58258a[_0x8b96('0x37')]=_0x58258a['attributes'][_0x8b96('0x39')]?_0x58258a[_0x8b96('0x37')]:_0x3e8ed6[_0x8b96('0x31')];if(!_0xf187da['query'][_0x8b96('0x53')]('nolimit')){_0x58258a['limit']=qs['limit'](_0xf187da[_0x8b96('0x36')][_0x8b96('0x1f')]);_0x58258a[_0x8b96('0x1d')]=qs['offset'](_0xf187da[_0x8b96('0x36')][_0x8b96('0x1d')]);}_0x58258a['order']=qs[_0x8b96('0x3c')](_0xf187da[_0x8b96('0x36')][_0x8b96('0x3c')]);_0x58258a[_0x8b96('0x3d')]=qs[_0x8b96('0x34')](_[_0x8b96('0x3e')](_0xf187da[_0x8b96('0x36')],_0x3e8ed6[_0x8b96('0x34')]));_0x58258a['where'][_0x8b96('0x4f')]=_0x345593['id'];if(_0xf187da[_0x8b96('0x36')]['filter']){_0x58258a[_0x8b96('0x3d')]=_[_0x8b96('0x40')](_0x58258a[_0x8b96('0x3d')],{'$or':_[_0x8b96('0x32')](_0x58258a[_0x8b96('0x37')],function(_0xf041c2){var _0x2c411c={};_0x2c411c[_0xf041c2]={'$like':'%'+_0xf187da[_0x8b96('0x36')]['filter']+'%'};return _0x2c411c;})});}_0x58258a=_[_0x8b96('0x40')]({},_0x58258a,_0xf187da[_0x8b96('0x41')]);return db[_0x8b96('0x57')][_0x8b96('0x43')]({'where':_0x58258a[_0x8b96('0x3d')]})['then'](function(_0x164201){_0xc0f9b3[_0x8b96('0x43')]=_0x164201;if(_0xf187da[_0x8b96('0x36')]['includeAll']){_0x58258a[_0x8b96('0x45')]=[{'all':!![]}];}return db[_0x8b96('0x57')][_0x8b96('0x46')](_0x58258a);})[_0x8b96('0x10')](function(_0x1521d6){_0xc0f9b3[_0x8b96('0x54')]=_0x1521d6;return _0xc0f9b3;});}})[_0x8b96('0x10')](respondWithFilteredResult(_0x4cf64d,_0x58258a))[_0x8b96('0x19')](handleError(_0x4cf64d,null));};exports[_0x8b96('0x5a')]=function(_0x3f5411,_0x3c278f){return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x3f5411[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x3c278f,null))['then'](function(_0x1a82e3){if(_0x1a82e3){return _0x1a82e3[_0x8b96('0x5a')](_0x3f5411['query']['ids']);}})['then'](respondWithStatusCode(_0x3c278f,null))[_0x8b96('0x19')](handleError(_0x3c278f,null));};exports[_0x8b96('0x58')]=function(_0x1db1fa,_0x3f7d6e){var _0x266a3a={'name':_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x27')],'key':_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x30')],'provider':_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x5b')]==='custom'?null:_0x1db1fa[_0x8b96('0x4c')]['provider'],'email':_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x5c')],'ListId':_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x5d')],'active':!_[_0x8b96('0x5e')](_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x5f')])?_0x1db1fa['body']['active']:!![],'description':_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x60')]||null,'Imap':{},'Smtp':{}};if(_0x266a3a[_0x8b96('0x5b')]){_0x266a3a['Imap'][_0x8b96('0x61')]=_0x266a3a[_0x8b96('0x2a')]['user']=_0x1db1fa[_0x8b96('0x4c')]['username'];_0x266a3a['Imap'][_0x8b96('0x62')]=_0x266a3a['Smtp']['pass']=_0x1db1fa['body'][_0x8b96('0x62')];if(_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x63')]){_0x266a3a[_0x8b96('0x49')][_0x8b96('0x63')]=_0x266a3a['Smtp'][_0x8b96('0x63')]=!![];_0x266a3a[_0x8b96('0x49')]['CloudProviderId']=_0x266a3a[_0x8b96('0x2a')]['CloudProviderId']=_0x1db1fa[_0x8b96('0x4c')]['CloudProviderId'];_0x266a3a['Imap']['password']=_0x266a3a[_0x8b96('0x2a')][_0x8b96('0x64')]=null;}else{_0x266a3a[_0x8b96('0x49')][_0x8b96('0x4d')]=_0x266a3a[_0x8b96('0x2a')]['CloudProviderId']=null;}_0x266a3a[_0x8b96('0x49')][_0x8b96('0x65')]=_0x266a3a[_0x8b96('0x2a')]['service']=null;_0x266a3a['Imap']['host']=_0x266a3a[_0x8b96('0x2a')][_0x8b96('0x66')]=null;_0x266a3a[_0x8b96('0x49')]['port']=_0x266a3a[_0x8b96('0x2a')][_0x8b96('0x67')]=null;}else{if(_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x68')]){_0x266a3a['Imap'][_0x8b96('0x61')]=_0x266a3a['Smtp'][_0x8b96('0x61')]=_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x69')];_0x266a3a['Imap'][_0x8b96('0x62')]=_0x266a3a['Smtp']['pass']=_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x62')];}else{_0x266a3a[_0x8b96('0x49')]['authentication']=_0x266a3a[_0x8b96('0x2a')][_0x8b96('0x68')]=![];_0x266a3a['Imap'][_0x8b96('0x61')]=_0x266a3a[_0x8b96('0x2a')]['user']=null;_0x266a3a[_0x8b96('0x49')][_0x8b96('0x62')]=_0x266a3a[_0x8b96('0x2a')]['pass']=null;}_0x266a3a[_0x8b96('0x49')][_0x8b96('0x66')]=_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x49')][_0x8b96('0x66')];_0x266a3a[_0x8b96('0x49')][_0x8b96('0x67')]=_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x49')][_0x8b96('0x67')];_0x266a3a[_0x8b96('0x2a')][_0x8b96('0x66')]=_0x1db1fa[_0x8b96('0x4c')][_0x8b96('0x2a')][_0x8b96('0x66')];_0x266a3a[_0x8b96('0x2a')]['port']=_0x1db1fa['body'][_0x8b96('0x2a')]['port'];}return db[_0x8b96('0x42')][_0x8b96('0x58')](_0x266a3a,{'include':[{'model':db[_0x8b96('0x4a')],'as':_0x8b96('0x2a')},{'model':db[_0x8b96('0x29')],'as':_0x8b96('0x49')}]})[_0x8b96('0x10')](function(_0x5a550b){var _0x47531d=_0x1db1fa[_0x8b96('0x61')][_0x8b96('0x24')]({'plain':!![]});if(!_0x47531d)throw new Error(_0x8b96('0x6a'));if(_0x47531d['role']===_0x8b96('0x61')){var _0x236979=_0x5a550b[_0x8b96('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x8b96('0x4b')]({'where':{'name':'MailAccounts','userProfileId':_0x47531d['userProfileId']},'raw':!![]})[_0x8b96('0x10')](function(_0x141c58){if(_0x141c58&&_0x141c58[_0x8b96('0x6b')]===0x0){return db[_0x8b96('0x25')][_0x8b96('0x58')]({'name':_0x236979[_0x8b96('0x27')],'resourceId':_0x236979['id'],'type':_0x141c58[_0x8b96('0x27')],'sectionId':_0x141c58['id']},{})[_0x8b96('0x10')](function(){return _0x5a550b;});}else{return _0x5a550b;}})['catch'](function(_0x5778b3){logger['error'](_0x8b96('0x6c'),_0x5778b3);throw _0x5778b3;});}return _0x5a550b;})[_0x8b96('0x10')](respondWithResult(_0x3f7d6e,0xc9))[_0x8b96('0x19')](handleError(_0x3f7d6e,null));};exports[_0x8b96('0x6d')]=function(_0x4e0202,_0x3edf2f){return db[_0x8b96('0x42')][_0x8b96('0x52')]({'where':{'id':_0x4e0202[_0x8b96('0x48')]['id']}})['then'](handleEntityNotFound(_0x3edf2f,null))[_0x8b96('0x10')](function(_0x1c35db){if(_0x1c35db){return _0x1c35db[_0x8b96('0x6d')]();}return null;})[_0x8b96('0x10')](respondWithResult(_0x3edf2f,null))['catch'](handleError(_0x3edf2f,null));};exports['addImap']=function(_0x1a784b,_0x2891c5){if(_0x1a784b[_0x8b96('0x4c')]['id']){delete _0x1a784b[_0x8b96('0x4c')]['id'];}return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x1a784b[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x2891c5,null))[_0x8b96('0x10')](function(_0x329568){if(_0x329568){_0x1a784b[_0x8b96('0x4c')]['MailAccountId']=_0x329568['id'];return db['MailServerIn']['create'](_0x1a784b[_0x8b96('0x4c')]);}})[_0x8b96('0x10')](respondWithResult(_0x2891c5,null))[_0x8b96('0x19')](handleError(_0x2891c5,null));};exports[_0x8b96('0x6e')]=function(_0x2350e4,_0x23343e){return db[_0x8b96('0x42')][_0x8b96('0x52')]({'where':{'id':_0x2350e4[_0x8b96('0x48')]['id']}})['then'](handleEntityNotFound(_0x23343e,null))[_0x8b96('0x10')](function(_0x39aeae){if(_0x39aeae){return _0x39aeae[_0x8b96('0x6f')](null);}return null;})[_0x8b96('0x10')](respondWithStatusCode(_0x23343e,null))['catch'](handleError(_0x23343e,null));};exports[_0x8b96('0x70')]=function(_0x1215d7,_0x133e4d){return db[_0x8b96('0x42')][_0x8b96('0x52')]({'where':{'id':_0x1215d7[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x133e4d,null))['then'](function(_0x184aa6){if(_0x184aa6){return _0x184aa6['getSmtp']();}return null;})[_0x8b96('0x10')](respondWithResult(_0x133e4d,null))['catch'](handleError(_0x133e4d,null));};exports[_0x8b96('0x71')]=function(_0x3cb92e,_0x5b3ea7){if(_0x3cb92e[_0x8b96('0x4c')]['id']){delete _0x3cb92e[_0x8b96('0x4c')]['id'];}return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x3cb92e['params']['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x5b3ea7,null))[_0x8b96('0x10')](function(_0x129a14){if(_0x129a14){_0x3cb92e[_0x8b96('0x4c')]['MailAccountId']=_0x129a14['id'];return db[_0x8b96('0x4a')][_0x8b96('0x58')](_0x3cb92e[_0x8b96('0x4c')]);}})[_0x8b96('0x10')](respondWithResult(_0x5b3ea7,null))[_0x8b96('0x19')](handleError(_0x5b3ea7,null));};exports[_0x8b96('0x72')]=function(_0x35f362,_0x120ad3){return db[_0x8b96('0x42')][_0x8b96('0x52')]({'where':{'id':_0x35f362[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x120ad3,null))[_0x8b96('0x10')](function(_0x335b5e){if(_0x335b5e){return _0x335b5e[_0x8b96('0x73')](null);}return null;})[_0x8b96('0x10')](respondWithStatusCode(_0x120ad3,null))['catch'](handleError(_0x120ad3,null));};exports[_0x8b96('0x74')]=function(_0xb0d8d5,_0x33c89a){return db[_0x8b96('0x75')][_0x8b96('0x4b')]({'where':{'id':_0xb0d8d5[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x33c89a,null))[_0x8b96('0x10')](function(_0x172a40){if(_0x172a40){return _0x172a40[_0x8b96('0x74')](_0xb0d8d5['body']['ids'],_[_0x8b96('0x76')](_0xb0d8d5['body'],[_0x8b96('0x77'),'id'])||{});}})[_0x8b96('0x10')](respondWithResult(_0x33c89a,null))['catch'](handleError(_0x33c89a,null));};exports[_0x8b96('0x78')]=function(_0x294359,_0x2fed14){var _0x2d37ab={'raw':![],'where':{}};var _0xab4d87={};var _0x245959={'count':0x0,'rows':[]};return db[_0x8b96('0x42')][_0x8b96('0x52')]({'where':{'id':_0x294359[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x2fed14,null))['then'](function(_0x5061a9){if(_0x5061a9){_0xab4d87['model']=_[_0x8b96('0x33')](db[_0x8b96('0x75')]['rawAttributes']);_0xab4d87['query']=_['keys'](_0x294359['query']);_0xab4d87[_0x8b96('0x34')]=_[_0x8b96('0x35')](_0xab4d87[_0x8b96('0x31')],_0xab4d87[_0x8b96('0x36')]);_0x2d37ab[_0x8b96('0x37')]=_[_0x8b96('0x35')](_0xab4d87['model'],qs[_0x8b96('0x38')](_0x294359[_0x8b96('0x36')][_0x8b96('0x38')]));_0x2d37ab['attributes']=_0x2d37ab[_0x8b96('0x37')][_0x8b96('0x39')]?_0x2d37ab[_0x8b96('0x37')]:_0xab4d87[_0x8b96('0x31')];if(!_0x294359[_0x8b96('0x36')][_0x8b96('0x53')]('nolimit')){_0x2d37ab[_0x8b96('0x1f')]=qs['limit'](_0x294359['query'][_0x8b96('0x1f')]);_0x2d37ab[_0x8b96('0x1d')]=qs[_0x8b96('0x1d')](_0x294359[_0x8b96('0x36')][_0x8b96('0x1d')]);}_0x2d37ab[_0x8b96('0x3b')]=qs[_0x8b96('0x3c')](_0x294359[_0x8b96('0x36')]['sort']);_0x2d37ab[_0x8b96('0x3d')]=qs['filters'](_[_0x8b96('0x3e')](_0x294359[_0x8b96('0x36')],_0xab4d87[_0x8b96('0x34')]));_0x2d37ab[_0x8b96('0x3d')][_0x8b96('0x4f')]=_0x5061a9['id'];if(_0x294359[_0x8b96('0x36')]['filter']){_0x2d37ab[_0x8b96('0x3d')]=_[_0x8b96('0x40')](_0x2d37ab[_0x8b96('0x3d')],{'$or':_[_0x8b96('0x32')](_0x2d37ab[_0x8b96('0x37')],function(_0x5413b9){var _0x462f41={};_0x462f41[_0x5413b9]={'$like':'%'+_0x294359[_0x8b96('0x36')][_0x8b96('0x3f')]+'%'};return _0x462f41;})});}_0x2d37ab=_[_0x8b96('0x40')]({},_0x2d37ab,_0x294359['options']);return db['MailInteraction'][_0x8b96('0x43')]({'where':_0x2d37ab['where']})['then'](function(_0x5c7a20){_0x245959[_0x8b96('0x43')]=_0x5c7a20;if(_0x294359[_0x8b96('0x36')][_0x8b96('0x44')]){_0x2d37ab[_0x8b96('0x45')]=[{'model':db[_0x8b96('0x79')],'as':_0x8b96('0x7a'),'required':![]},{'model':db[_0x8b96('0x7b')],'as':_0x8b96('0x7c'),'attributes':[_0x8b96('0x27'),_0x8b96('0x7d'),_0x8b96('0x7e')],'required':![]},{'model':db[_0x8b96('0x7f')],'as':_0x8b96('0x80'),'attributes':['id',_0x8b96('0x27'),_0x8b96('0x81')],'where':_0x294359[_0x8b96('0x36')][_0x8b96('0x82')]?{'id':_0x294359[_0x8b96('0x36')][_0x8b96('0x82')]}:undefined,'required':_0x294359[_0x8b96('0x36')][_0x8b96('0x82')]?!![]:![]}];}return db['MailInteraction'][_0x8b96('0x46')](_0x2d37ab);})['then'](function(_0x4c2cc6){_0x245959['rows']=_0x4c2cc6;return _0x245959;});}})[_0x8b96('0x10')](respondWithFilteredResult(_0x2fed14,_0x2d37ab))[_0x8b96('0x19')](handleError(_0x2fed14,null));};exports['addApplications']=function addApplications(_0x52927c,_0x4a9f28){var _0x27be29=_0x52927c[_0x8b96('0x48')]['id'];var _0x1fa577=_0x52927c[_0x8b96('0x4c')];var _0x3c4f2f=0xc8;var _0x4b304f=null;return db[_0x8b96('0x83')][_0x8b96('0x84')]({'isolationLevel':db[_0x8b96('0x83')]['Transaction'][_0x8b96('0x85')][_0x8b96('0x86')]},function(_0x5b3984){return db[_0x8b96('0x42')]['findOne']({'where':{'id':_0x27be29},'transaction':_0x5b3984})[_0x8b96('0x10')](function(_0x2d3056){if(_0x2d3056){return db[_0x8b96('0x87')]['destroy']({'where':{'MailAccountId':_0x27be29},'transaction':_0x5b3984})['then'](function(){var _0x54bc0d=_[_0x8b96('0x32')](_0x1fa577,function(_0xcaf269){_0xcaf269[_0x8b96('0x4f')]=_0x27be29;return _0xcaf269;});return db['MailApplication']['bulkCreate'](_0x54bc0d,{'transaction':_0x5b3984});});}else{_0x3c4f2f=0x194;_0x4b304f=[];}});})[_0x8b96('0x10')](function(){if(_0x3c4f2f!==0x194){return db[_0x8b96('0x87')][_0x8b96('0x88')]({'where':{'MailAccountId':_0x27be29},'order':_0x8b96('0x89')})[_0x8b96('0x10')](function(_0x38f259){_0x4b304f=_0x38f259;});}})['catch'](function(_0x335961){_0x3c4f2f=0x1f4;logger[_0x8b96('0x16')](_0x335961[_0x8b96('0x8a')]);if(_0x335961[_0x8b96('0x27')]){delete _0x335961[_0x8b96('0x27')];}_0x4b304f=_0x335961;})['finally'](function(){if(_0x4b304f===null){_0x4a9f28['sendStatus'](_0x3c4f2f);}else{if(_0x3c4f2f===0x1f4){_0x4a9f28[_0x8b96('0x1b')](_0x3c4f2f)[_0x8b96('0x28')](_0x4b304f);}else{_0x4a9f28['status'](_0x3c4f2f)[_0x8b96('0x22')](_0x4b304f);}}});};exports['getApplications']=function(_0xcbe6a8,_0x54d437){var _0x30581e={};var _0x45fe9b={};var _0x62a1d3;var _0x325fc3;return db['MailAccount']['findOne']({'where':{'id':_0xcbe6a8['params']['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x54d437,null))[_0x8b96('0x10')](function(_0x1485a1){if(_0x1485a1){_0x62a1d3=_0x1485a1;_0x45fe9b[_0x8b96('0x31')]=_[_0x8b96('0x33')](db['MailApplication'][_0x8b96('0x2d')]);_0x45fe9b[_0x8b96('0x36')]=_[_0x8b96('0x33')](_0xcbe6a8[_0x8b96('0x36')]);_0x45fe9b[_0x8b96('0x34')]=_['intersection'](_0x45fe9b[_0x8b96('0x31')],_0x45fe9b[_0x8b96('0x36')]);_0x30581e['attributes']=_[_0x8b96('0x35')](_0x45fe9b[_0x8b96('0x31')],qs[_0x8b96('0x38')](_0xcbe6a8[_0x8b96('0x36')][_0x8b96('0x38')]));_0x30581e[_0x8b96('0x37')]=_0x30581e[_0x8b96('0x37')]['length']?_0x30581e[_0x8b96('0x37')]:_0x45fe9b['model'];_0x30581e[_0x8b96('0x3b')]=qs[_0x8b96('0x3c')](_0xcbe6a8[_0x8b96('0x36')][_0x8b96('0x3c')]);_0x30581e[_0x8b96('0x3d')]=qs[_0x8b96('0x34')](_[_0x8b96('0x3e')](_0xcbe6a8[_0x8b96('0x36')],_0x45fe9b[_0x8b96('0x34')]));if(_0xcbe6a8[_0x8b96('0x36')][_0x8b96('0x3f')]){_0x30581e['where']=_[_0x8b96('0x40')](_0x30581e[_0x8b96('0x3d')],{'$or':_[_0x8b96('0x32')](_0x30581e[_0x8b96('0x37')],function(_0x30b366){var _0xd3aa97={};_0xd3aa97[_0x30b366]={'$like':'%'+_0xcbe6a8[_0x8b96('0x36')][_0x8b96('0x3f')]+'%'};return _0xd3aa97;})});}_0x30581e=_['merge']({},_0x30581e,_0xcbe6a8[_0x8b96('0x41')]);return _0x62a1d3['getApplications'](_0x30581e);}})[_0x8b96('0x10')](function(_0x319b18){if(_0x319b18){_0x325fc3=_0x319b18[_0x8b96('0x39')];if(!_0xcbe6a8[_0x8b96('0x36')][_0x8b96('0x53')](_0x8b96('0x3a'))){_0x30581e[_0x8b96('0x1f')]=qs[_0x8b96('0x1f')](_0xcbe6a8[_0x8b96('0x36')][_0x8b96('0x1f')]);_0x30581e['offset']=qs[_0x8b96('0x1d')](_0xcbe6a8[_0x8b96('0x36')]['offset']);}return _0x62a1d3[_0x8b96('0x8b')](_0x30581e);}})[_0x8b96('0x10')](function(_0x57faba){if(_0x57faba){return _0x57faba?{'count':_0x325fc3,'rows':_0x57faba}:null;}})['then'](respondWithResult(_0x54d437,null))['catch'](handleError(_0x54d437,null));};exports[_0x8b96('0x8c')]=function(_0x207d64,_0x59c352){var _0x40c588={'raw':!![],'where':{}};var _0x417950={};var _0x461d79={'count':0x0,'rows':[]};return db[_0x8b96('0x42')][_0x8b96('0x52')]({'where':{'id':_0x207d64[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x59c352,null))[_0x8b96('0x10')](function(_0x5227fc){if(_0x5227fc){_0x417950[_0x8b96('0x31')]=_[_0x8b96('0x33')](db['MailMessage'][_0x8b96('0x2d')]);_0x417950[_0x8b96('0x36')]=_[_0x8b96('0x33')](_0x207d64[_0x8b96('0x36')]);_0x417950[_0x8b96('0x34')]=_[_0x8b96('0x35')](_0x417950[_0x8b96('0x31')],_0x417950[_0x8b96('0x36')]);_0x40c588[_0x8b96('0x37')]=_[_0x8b96('0x35')](_0x417950[_0x8b96('0x31')],qs[_0x8b96('0x38')](_0x207d64['query'][_0x8b96('0x38')]));_0x40c588[_0x8b96('0x37')]=_0x40c588[_0x8b96('0x37')][_0x8b96('0x39')]?_0x40c588[_0x8b96('0x37')]:_0x417950[_0x8b96('0x31')];if(!_0x207d64['query'][_0x8b96('0x53')](_0x8b96('0x3a'))){_0x40c588[_0x8b96('0x1f')]=qs['limit'](_0x207d64[_0x8b96('0x36')][_0x8b96('0x1f')]);_0x40c588[_0x8b96('0x1d')]=qs[_0x8b96('0x1d')](_0x207d64[_0x8b96('0x36')][_0x8b96('0x1d')]);}_0x40c588[_0x8b96('0x3b')]=qs[_0x8b96('0x3c')](_0x207d64['query'][_0x8b96('0x3c')]);_0x40c588['where']=qs[_0x8b96('0x34')](_[_0x8b96('0x3e')](_0x207d64[_0x8b96('0x36')],_0x417950['filters']));_0x40c588[_0x8b96('0x3d')][_0x8b96('0x4f')]=_0x5227fc['id'];if(_0x207d64[_0x8b96('0x36')][_0x8b96('0x3f')]){_0x40c588[_0x8b96('0x3d')]=_[_0x8b96('0x40')](_0x40c588[_0x8b96('0x3d')],{'$or':_[_0x8b96('0x32')](_0x40c588[_0x8b96('0x37')],function(_0x3cc5bd){var _0x1767c1={};_0x1767c1[_0x3cc5bd]={'$like':'%'+_0x207d64[_0x8b96('0x36')][_0x8b96('0x3f')]+'%'};return _0x1767c1;})});}if(_0x207d64[_0x8b96('0x36')][_0x8b96('0x8d')]){var _0x2c4fa2=_0x207d64[_0x8b96('0x36')]['$gte'][_0x8b96('0x8e')](',');var _0x194618={};_0x194618[_0x2c4fa2[0x0]]={'$gte':moment(_0x2c4fa2[0x1])[_0x8b96('0x8f')](_0x8b96('0x90'))};_0x40c588[_0x8b96('0x3d')]=_[_0x8b96('0x40')](_0x40c588[_0x8b96('0x3d')],_0x194618);}_0x40c588=_['merge']({},_0x40c588,_0x207d64[_0x8b96('0x41')]);return db[_0x8b96('0x91')][_0x8b96('0x43')]({'where':_0x40c588['where']})[_0x8b96('0x10')](function(_0x1b5e61){_0x461d79[_0x8b96('0x43')]=_0x1b5e61;if(_0x207d64[_0x8b96('0x36')][_0x8b96('0x44')]){_0x40c588[_0x8b96('0x45')]=[{'all':!![]}];}return db['MailMessage'][_0x8b96('0x46')](_0x40c588);})['then'](function(_0xc5985c){if(_0x207d64['query'][_0x8b96('0x92')]===_0x8b96('0x93')){for(var _0x1e65bf=0x0;_0x1e65bf<_0xc5985c[_0x8b96('0x39')];_0x1e65bf++){_0xc5985c[_0x1e65bf][_0x8b96('0x4c')]=juice(_0xc5985c[_0x1e65bf][_0x8b96('0x4c')]);}}_0x461d79[_0x8b96('0x54')]=_0xc5985c;return _0x461d79;});}})['then'](respondWithFilteredResult(_0x59c352,_0x40c588))['catch'](handleError(_0x59c352,null));};exports[_0x8b96('0x28')]=function(_0x5a5a84,_0x4845a5){var _0x2c5088,_0x32e16e={},_0x3961c9;if(_0x5a5a84[_0x8b96('0x4c')]['to']){_0x3961c9=_0x5a5a84[_0x8b96('0x4c')]['to'][_0x8b96('0x8e')](',')[0x0];}return db['MailAccount'][_0x8b96('0x4b')]({'where':{'id':_0x5a5a84['params']['id']},'include':[{'model':db[_0x8b96('0x94')],'as':_0x8b96('0x95'),'include':[{'model':db[_0x8b96('0x79')],'as':_0x8b96('0x96'),'where':{'email':_0x3961c9},'limit':0x1,'order':[[_0x8b96('0x97'),'DESC']]}]},{'model':db[_0x8b96('0x4a')],'as':_0x8b96('0x2a'),'raw':!![]}]})['then'](handleEntityNotFound(_0x4845a5,null))['then'](function(_0x1386d3){if(_0x1386d3){_0x2c5088=_0x1386d3;if(_0x1386d3['Smtp']){if(_['isNil'](_0x5a5a84['body'][_0x8b96('0x98')])){_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0x98')]=util[_0x8b96('0x8f')](_0x8b96('0x99'),_0x1386d3[_0x8b96('0x27')],_0x1386d3[_0x8b96('0x5c')]||_0x1386d3[_0x8b96('0x2a')][_0x8b96('0x61')]);}if(_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0x9a')]&&_0x5a5a84[_0x8b96('0x4c')]['attachments']['length']){for(var _0x3eeb3d=0x0;_0x3eeb3d<_0x5a5a84[_0x8b96('0x4c')]['attachments'][_0x8b96('0x39')];_0x3eeb3d+=0x1){_0x5a5a84[_0x8b96('0x4c')]['attachments'][_0x3eeb3d]={'filename':_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0x9a')][_0x3eeb3d]['name'],'path':path[_0x8b96('0x9b')](config['root'],_0x8b96('0x9c'),_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0x9a')][_0x3eeb3d][_0x8b96('0x9d')])};}}var _0x494c79={'tls':{'rejectUnauthorized':![]}};if(_[_0x8b96('0x5e')](_0x1386d3[_0x8b96('0x2a')][_0x8b96('0x65')])){if(_0x1386d3[_0x8b96('0x2a')][_0x8b96('0x68')]){_0x494c79[_0x8b96('0x9e')]={'user':_0x1386d3[_0x8b96('0x2a')]['user'],'pass':_0x1386d3[_0x8b96('0x2a')]['pass']};}_0x494c79[_0x8b96('0x66')]=_0x1386d3[_0x8b96('0x2a')]['host'];_0x494c79[_0x8b96('0x67')]=_0x1386d3[_0x8b96('0x2a')][_0x8b96('0x67')];_0x494c79[_0x8b96('0x9f')]=_0x1386d3['Smtp'][_0x8b96('0x9f')];}else{_0x494c79[_0x8b96('0x65')]=_0x1386d3['Smtp'][_0x8b96('0x65')];_0x494c79['auth']={'user':_0x1386d3[_0x8b96('0x2a')][_0x8b96('0x61')],'pass':_0x1386d3[_0x8b96('0x2a')][_0x8b96('0x64')]};}return respondWithRpcPromise('SendMail',_0x8b96('0xa0'),{'account':_0x494c79,'message':_0x5a5a84[_0x8b96('0x4c')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x17516f){if(_0x17516f){_0x32e16e=_0x17516f;if(_0x2c5088['List']){if(_0x2c5088[_0x8b96('0x95')][_0x8b96('0x96')]['length']){return _0x2c5088[_0x8b96('0x95')]['Contacts'][0x0];}else{return db['CmContact'][_0x8b96('0x58')](_[_0x8b96('0xa')](_0x5a5a84[_0x8b96('0x4c')],{'firstName':_0x5a5a84['body']['to'],'email':_0x5a5a84[_0x8b96('0x4c')]['to'],'phone':_0x5a5a84[_0x8b96('0x4c')]['to'],'ListId':_0x2c5088[_0x8b96('0x5d')]}));}}else{throw new Error(_0x8b96('0xa1'));}}})[_0x8b96('0x10')](function(_0xcf8a8e){if(_0xcf8a8e){var _0x1a151b={'UserId':_0x5a5a84[_0x8b96('0x61')]['id'],'ContactId':_0xcf8a8e['id'],'MailAccountId':_0x2c5088['id'],'inReplyTo':_0x32e16e[_0x8b96('0xa2')],'to':_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0x98')],'cc':_0x5a5a84[_0x8b96('0x4c')]['cc'],'subject':_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0xa3')],'attach':_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0xa4')],'firstMsgDirection':_0x8b96('0xa5'),'lastMsgAt':moment()[_0x8b96('0x8f')](_0x8b96('0x90')),'lastMsgDirection':_0x8b96('0xa5'),'Messages':[_['merge'](_0x5a5a84[_0x8b96('0x4c')],{'messageId':_0x32e16e[_0x8b96('0xa2')],'sentAt':moment()[_0x8b96('0x8f')](_0x8b96('0x90')),'read':!![],'MailAccountId':_0x2c5088['id'],'UserId':_0x5a5a84[_0x8b96('0x61')]['id'],'ContactId':_0xcf8a8e['id']})]};if(_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0xa6')]){_0x1a151b=_['merge'](_0x1a151b,_0x5a5a84[_0x8b96('0x4c')][_0x8b96('0xa6')]);}return db[_0x8b96('0x75')][_0x8b96('0x58')](_0x1a151b,{'include':[{'model':db[_0x8b96('0x91')],'as':_0x8b96('0xa7')}]});}})[_0x8b96('0x10')](respondWithResult(_0x4845a5,null))[_0x8b96('0x19')](handleError(_0x4845a5,null));};exports[_0x8b96('0xa8')]=function(_0x3e224f,_0x199f12){return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x3e224f[_0x8b96('0x48')]['id']},'include':[{'model':db[_0x8b96('0x4a')],'as':_0x8b96('0x2a'),'raw':!![],'include':[{'model':db[_0x8b96('0xa9')],'as':_0x8b96('0xa9'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x199f12,null))[_0x8b96('0x10')](function(_0x47535d){if(!_0x47535d[_0x8b96('0x2a')])return;var _0x305426={'id':_0x47535d['id'],'tls':{'rejectUnauthorized':![]}};if(_0x47535d[_0x8b96('0x5b')]!=='custom'){_0x305426['service']=_0x47535d[_0x8b96('0x5b')];}else{_0x305426[_0x8b96('0x66')]=_0x47535d[_0x8b96('0x2a')][_0x8b96('0x66')];_0x305426[_0x8b96('0x67')]=_0x47535d[_0x8b96('0x2a')]['port'];_0x305426[_0x8b96('0x9f')]=_0x47535d[_0x8b96('0x2a')][_0x8b96('0x9f')];}if(_0x47535d[_0x8b96('0x2a')]['authentication']){if(_0x47535d['Smtp'][_0x8b96('0x63')]){_0x305426[_0x8b96('0x9e')]={'type':'OAuth2','user':_0x47535d['Smtp'][_0x8b96('0x61')],'accessToken':_0x47535d[_0x8b96('0x2a')]['CloudProvider'][_0x8b96('0xaa')]};}else{_0x305426['auth']={'user':_0x47535d['Smtp'][_0x8b96('0x61')],'pass':_0x47535d['Smtp'][_0x8b96('0x64')]};}}return respondWithRpcPromise(_0x8b96('0xab'),_0x8b96('0xa8'),{'account':_0x305426});})[_0x8b96('0x10')](respondWithResult(_0x199f12,null))['catch'](handleError(_0x199f12,null));};exports['destroy']=function(_0x4f3f69,_0x31f089){return db[_0x8b96('0x42')][_0x8b96('0x4b')]({'where':{'id':_0x4f3f69[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x31f089,null))[_0x8b96('0x10')](function(_0x514775){if(_0x514775&&_0x514775[_0x8b96('0x65')]){throw new db[(_0x8b96('0xac'))][(_0x8b96('0xad'))](_0x8b96('0xae'));}return _0x514775;})[_0x8b96('0x10')](removeEntity(_0x31f089,null))[_0x8b96('0x19')](handleError(_0x31f089,null));};exports['addAgents']=function(_0xe7021f,_0x4b5a7b){return db['MailAccount'][_0x8b96('0x4b')]({'where':{'id':_0xe7021f[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x4b5a7b,null))[_0x8b96('0x10')](function(_0x370802){if(_0x370802){return _0x370802['addAgents'](_0xe7021f['body'][_0x8b96('0x77')],_[_0x8b96('0x76')](_0xe7021f[_0x8b96('0x4c')],['ids','id'])||{})[_0x8b96('0xaf')](function(_0x143841){for(var _0x3bb074=0x0;_0x3bb074<_0xe7021f[_0x8b96('0x4c')]['ids'][_0x8b96('0x39')];_0x3bb074+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0xe7021f[_0x8b96('0x4c')][_0x8b96('0x77')][_0x3bb074]),'MailAccountId':Number(_0xe7021f[_0x8b96('0x48')]['id'])});}return _0x143841;});}})[_0x8b96('0x10')](respondWithResult(_0x4b5a7b,null))[_0x8b96('0x19')](handleError(_0x4b5a7b,null));};exports['removeAgents']=function(_0x501fec,_0x416dbd){return db[_0x8b96('0x42')]['find']({'where':{'id':_0x501fec[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x416dbd,null))['then'](function(_0x24caae){if(_0x24caae){return _0x24caae[_0x8b96('0xb0')](_0x501fec['query']['ids'])['then'](function(){if(_[_0x8b96('0xb1')](_0x501fec[_0x8b96('0x36')][_0x8b96('0x77')])){for(var _0x2db71a=0x0;_0x2db71a<_0x501fec['query'][_0x8b96('0x77')]['length'];_0x2db71a+=0x1){socket[_0x8b96('0xb2')](_0x8b96('0xb3'),{'UserId':Number(_0x501fec[_0x8b96('0x36')][_0x8b96('0x77')][_0x2db71a]),'MailAccountId':Number(_0x501fec[_0x8b96('0x48')]['id'])});}}else{socket[_0x8b96('0xb2')](_0x8b96('0xb3'),{'UserId':Number(_0x501fec['query'][_0x8b96('0x77')]),'MailAccountId':Number(_0x501fec[_0x8b96('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x416dbd,null))[_0x8b96('0x19')](handleError(_0x416dbd,null));};exports[_0x8b96('0xb4')]=function(_0x376b08,_0x21ef08){var _0x1333a5={};var _0x382405={};var _0x501e24;var _0x179829;return db[_0x8b96('0x42')]['findOne']({'where':{'id':_0x376b08[_0x8b96('0x48')]['id']}})[_0x8b96('0x10')](handleEntityNotFound(_0x21ef08,null))[_0x8b96('0x10')](function(_0x39d911){if(_0x39d911){_0x501e24=_0x39d911;_0x382405[_0x8b96('0x31')]=_[_0x8b96('0x33')](db['User'][_0x8b96('0x2d')]);_0x382405['query']=_[_0x8b96('0x33')](_0x376b08[_0x8b96('0x36')]);_0x382405[_0x8b96('0x34')]=_[_0x8b96('0x35')](_0x382405[_0x8b96('0x31')],_0x382405[_0x8b96('0x36')]);_0x1333a5[_0x8b96('0x37')]=_[_0x8b96('0x35')](_0x382405['model'],qs[_0x8b96('0x38')](_0x376b08['query'][_0x8b96('0x38')]));_0x1333a5[_0x8b96('0x37')]=_0x1333a5[_0x8b96('0x37')][_0x8b96('0x39')]?_0x1333a5[_0x8b96('0x37')]:_0x382405[_0x8b96('0x31')];_0x1333a5['order']=qs[_0x8b96('0x3c')](_0x376b08[_0x8b96('0x36')][_0x8b96('0x3c')]);_0x1333a5['where']=qs[_0x8b96('0x34')](_[_0x8b96('0x3e')](_0x376b08[_0x8b96('0x36')],_0x382405[_0x8b96('0x34')]));if(_0x376b08[_0x8b96('0x36')]['filter']){_0x1333a5[_0x8b96('0x3d')]=_[_0x8b96('0x40')](_0x1333a5[_0x8b96('0x3d')],{'$or':_[_0x8b96('0x32')](_0x1333a5[_0x8b96('0x37')],function(_0x3145fe){var _0x375e44={};_0x375e44[_0x3145fe]={'$like':'%'+_0x376b08[_0x8b96('0x36')][_0x8b96('0x3f')]+'%'};return _0x375e44;})});}_0x1333a5=_['merge']({},_0x1333a5,_0x376b08[_0x8b96('0x41')]);return _0x501e24[_0x8b96('0xb4')](_0x1333a5);}})[_0x8b96('0x10')](function(_0x49c9d9){if(_0x49c9d9){_0x179829=_0x49c9d9[_0x8b96('0x39')];if(!_0x376b08[_0x8b96('0x36')][_0x8b96('0x53')](_0x8b96('0x3a'))){_0x1333a5[_0x8b96('0x1f')]=qs['limit'](_0x376b08['query'][_0x8b96('0x1f')]);_0x1333a5[_0x8b96('0x1d')]=qs[_0x8b96('0x1d')](_0x376b08[_0x8b96('0x36')]['offset']);}return _0x501e24[_0x8b96('0xb4')](_0x1333a5);}})['then'](function(_0x1d94bf){if(_0x1d94bf){return _0x1d94bf?{'count':_0x179829,'rows':_0x1d94bf}:null;}})['then'](respondWithResult(_0x21ef08,null))['catch'](handleError(_0x21ef08,null));}; \ No newline at end of file +var _0x45bc=['setImap','getSmtp','addSmtp','setSmtp','addInteraction','MailInteraction','ids','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tags','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','hasOwnProperty','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','inlineCss','split','List','Contacts','DESC','from','format','attachments','join','root','basename','auth','secure','sendMail','defaults','ListId','List\x20not\x20found','attach','out','messageId','Interaction','Messages','verifySmtp','CloudProvider','provider','OAuth2','data5','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','http','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailAccount,\x20%s,\x20%s','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','name','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Smtp','rawAttributes','find','body','modernAuthentication','CloudProviderId','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','filter','addAnswer','CannedAnswer','getAnswers','removeAnswers','custom','email','isNil','active','user','password','pass','service','host','port','authentication','username','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap'];(function(_0x415e4f,_0x2481e8){var _0x586477=function(_0x5f45ae){while(--_0x5f45ae){_0x415e4f['push'](_0x415e4f['shift']());}};_0x586477(++_0x2481e8);}(_0x45bc,0xfe));var _0xc45b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x45bc[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xc45b('0x0'));var BPromise=require(_0xc45b('0x1'));var util=require('util');var path=require(_0xc45b('0x2'));var _=require(_0xc45b('0x3'));var juice=require(_0xc45b('0x4'));var Redis=require(_0xc45b('0x5'));var qs=require(_0xc45b('0x6'));var logger=require('../../config/logger')(_0xc45b('0x7'));var config=require(_0xc45b('0x8'));var db=require(_0xc45b('0x9'))['db'];config[_0xc45b('0xa')]=_['defaults'](config[_0xc45b('0xa')],{'host':_0xc45b('0xb'),'port':0x18eb});var socket=require(_0xc45b('0xc'))(new Redis(config[_0xc45b('0xa')]));require(_0xc45b('0xd'))['register'](socket);var jayson=require(_0xc45b('0xe'));var client=jayson['client'][_0xc45b('0xf')]({'port':0x232b});function respondWithRpcPromise(_0x375c7b,_0xc2206f,_0x4fa4c5,_0x42edc0){return new BPromise(function(_0x1cfe43,_0x211104){var _0x3acbe3=_0x42edc0||client;return _0x3acbe3[_0xc45b('0x10')](_0x375c7b,_0x4fa4c5)[_0xc45b('0x11')](function(_0xab3251){logger[_0xc45b('0x12')]('MailAccount,\x20%s,\x20%s',_0xc2206f,_0xc45b('0x13'));logger['debug'](_0xc45b('0x14'),_0xc2206f,'request\x20sent',JSON[_0xc45b('0x15')](_0xab3251));if(_0xab3251[_0xc45b('0x16')]){if(_0xab3251['error'][_0xc45b('0x17')]===0x1f4){logger[_0xc45b('0x16')]('MailAccount,\x20%s,\x20%s',_0xc2206f,_0xab3251[_0xc45b('0x16')][_0xc45b('0x18')]);return _0x211104(_0xab3251[_0xc45b('0x16')][_0xc45b('0x18')]);}logger[_0xc45b('0x16')](_0xc45b('0x19'),_0xc2206f,_0xab3251['error']['message']);return _0x1cfe43(_0xab3251[_0xc45b('0x16')][_0xc45b('0x18')]);}else{logger[_0xc45b('0x12')](_0xc45b('0x19'),_0xc2206f,_0xc45b('0x13'));_0x1cfe43(_0xab3251['result'][_0xc45b('0x18')]);}})[_0xc45b('0x1a')](function(_0x4b6a95){logger[_0xc45b('0x16')](_0xc45b('0x19'),_0xc2206f,_0x4b6a95);_0x211104(_0x4b6a95);});});}function respondWithStatusCode(_0x5734f0,_0x2dac75){_0x2dac75=_0x2dac75||0xcc;return function(_0x2d6212){if(_0x2d6212){return _0x5734f0['sendStatus'](_0x2dac75);}return _0x5734f0[_0xc45b('0x1b')](_0x2dac75)[_0xc45b('0x1c')]();};}function respondWithResult(_0x54252c,_0x3f44b5){_0x3f44b5=_0x3f44b5||0xc8;return function(_0xb3e59c){if(_0xb3e59c){return _0x54252c['status'](_0x3f44b5)[_0xc45b('0x1d')](_0xb3e59c);}};}function respondWithFilteredResult(_0x309843,_0x3662dc){return function(_0xc7f573){if(_0xc7f573){var _0x450154=typeof _0x3662dc['offset']===_0xc45b('0x1e')&&typeof _0x3662dc[_0xc45b('0x1f')]===_0xc45b('0x1e');var _0x5578b6=_0xc7f573[_0xc45b('0x20')];var _0x12a03b=_0x450154?0x0:_0x3662dc['offset'];var _0x182af1=_0x450154?_0xc7f573[_0xc45b('0x20')]:_0x3662dc[_0xc45b('0x21')]+_0x3662dc[_0xc45b('0x1f')];var _0x336adf;if(_0x182af1>=_0x5578b6){_0x182af1=_0x5578b6;_0x336adf=0xc8;}else{_0x336adf=0xce;}_0x309843[_0xc45b('0x1b')](_0x336adf);return _0x309843[_0xc45b('0x22')](_0xc45b('0x23'),_0x12a03b+'-'+_0x182af1+'/'+_0x5578b6)[_0xc45b('0x1d')](_0xc7f573);}return null;};}function saveUpdates(_0x10fcb2){return function(_0x2a9a05){if(_0x2a9a05){return _0x2a9a05[_0xc45b('0x24')](_0x10fcb2)[_0xc45b('0x11')](function(_0x181f02){return _0x181f02;});}return null;};}function removeEntity(_0x4a31d6){return function(_0x446d6b){if(_0x446d6b){return _0x446d6b[_0xc45b('0x25')]()[_0xc45b('0x11')](function(){var _0x141378=_0x446d6b[_0xc45b('0x26')]({'plain':!![]});var _0x26552b=_0xc45b('0x27');return db[_0xc45b('0x28')][_0xc45b('0x25')]({'where':{'type':_0x26552b,'resourceId':_0x141378['id']}})[_0xc45b('0x11')](function(){return _0x446d6b;});})['then'](function(){_0x4a31d6[_0xc45b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x459d9e){return function(_0xc7ceae){if(!_0xc7ceae){_0x459d9e[_0xc45b('0x29')](0x194);}return _0xc7ceae;};}function handleError(_0x146cb0,_0x3fc761){_0x3fc761=_0x3fc761||0x1f4;return function(_0x1909d9){logger[_0xc45b('0x16')](_0x1909d9['stack']);if(_0x1909d9[_0xc45b('0x2a')]){delete _0x1909d9[_0xc45b('0x2a')];}_0x146cb0['status'](_0x3fc761)[_0xc45b('0x2b')](_0x1909d9);};}exports[_0xc45b('0x2c')]=function(_0xe8c333,_0x741eb5){var _0x96c0d0={'include':[{'model':db[_0xc45b('0x2d')],'as':_0xc45b('0x2e')},{'model':db[_0xc45b('0x2f')],'as':'Smtp'},{'model':db[_0xc45b('0x30')],'as':_0xc45b('0x31')}]},_0x3d89f6={},_0x5b9667={'count':0x0,'rows':[]};var _0x932273=_[_0xc45b('0x32')](db[_0xc45b('0x33')]['rawAttributes'],function(_0x349442){return{'name':_0x349442[_0xc45b('0x34')],'type':_0x349442['type'][_0xc45b('0x35')]};});_0x3d89f6[_0xc45b('0x36')]=_[_0xc45b('0x32')](_0x932273,_0xc45b('0x2a'));_0x3d89f6[_0xc45b('0x37')]=_[_0xc45b('0x38')](_0xe8c333[_0xc45b('0x37')]);_0x3d89f6[_0xc45b('0x39')]=_[_0xc45b('0x3a')](_0x3d89f6[_0xc45b('0x36')],_0x3d89f6[_0xc45b('0x37')]);_0x96c0d0[_0xc45b('0x3b')]=_['intersection'](_0x3d89f6[_0xc45b('0x36')],qs[_0xc45b('0x3c')](_0xe8c333['query']['fields']));_0x96c0d0['attributes']=_0x96c0d0[_0xc45b('0x3b')][_0xc45b('0x3d')]?_0x96c0d0[_0xc45b('0x3b')]:_0x3d89f6[_0xc45b('0x36')];if(!_0xe8c333[_0xc45b('0x37')]['hasOwnProperty'](_0xc45b('0x3e'))){_0x96c0d0[_0xc45b('0x1f')]=qs[_0xc45b('0x1f')](_0xe8c333[_0xc45b('0x37')]['limit']);_0x96c0d0[_0xc45b('0x21')]=qs['offset'](_0xe8c333['query'][_0xc45b('0x21')]);}_0x96c0d0[_0xc45b('0x3f')]=qs[_0xc45b('0x40')](_0xe8c333[_0xc45b('0x37')][_0xc45b('0x40')]);_0x96c0d0[_0xc45b('0x41')]=qs['filters'](_[_0xc45b('0x42')](_0xe8c333[_0xc45b('0x37')],_0x3d89f6[_0xc45b('0x39')]),_0x932273);if(_0xe8c333[_0xc45b('0x37')]['filter']){_0x96c0d0['where']=_[_0xc45b('0x43')](_0x96c0d0[_0xc45b('0x41')],{'$or':_['map'](_0x932273,function(_0x371167){if(_0x371167[_0xc45b('0x44')]!==_0xc45b('0x45')){var _0x2c125c={};_0x2c125c[_0x371167[_0xc45b('0x2a')]]={'$like':'%'+_0xe8c333[_0xc45b('0x37')]['filter']+'%'};return _0x2c125c;}})});}_0x96c0d0=_[_0xc45b('0x43')]({},_0x96c0d0,_0xe8c333[_0xc45b('0x46')]);var _0x428180={'where':_0x96c0d0['where']};return db[_0xc45b('0x33')][_0xc45b('0x20')](_0x428180)[_0xc45b('0x11')](function(_0x410c57){_0x5b9667[_0xc45b('0x20')]=_0x410c57;if(_0xe8c333[_0xc45b('0x37')][_0xc45b('0x47')]){_0x96c0d0[_0xc45b('0x48')]=[{'all':!![]}];}return db[_0xc45b('0x33')][_0xc45b('0x49')](_0x96c0d0);})[_0xc45b('0x11')](function(_0x45f301){_0x5b9667[_0xc45b('0x4a')]=_0x45f301;return _0x5b9667;})[_0xc45b('0x11')](respondWithFilteredResult(_0x741eb5,_0x96c0d0))[_0xc45b('0x1a')](handleError(_0x741eb5,null));};exports[_0xc45b('0x4b')]=function(_0x32e042,_0x1b1660){var _0x23a031={'raw':![],'where':{'id':_0x32e042[_0xc45b('0x4c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xc45b('0x2e')},{'model':db[_0xc45b('0x2f')],'as':_0xc45b('0x4d')},{'model':db['Pause'],'as':_0xc45b('0x31')}]},_0x210f98={};_0x210f98['model']=_[_0xc45b('0x38')](db['MailAccount'][_0xc45b('0x4e')]);_0x210f98[_0xc45b('0x37')]=_[_0xc45b('0x38')](_0x32e042[_0xc45b('0x37')]);_0x210f98['filters']=_[_0xc45b('0x3a')](_0x210f98[_0xc45b('0x36')],_0x210f98[_0xc45b('0x37')]);_0x23a031['attributes']=_[_0xc45b('0x3a')](_0x210f98[_0xc45b('0x36')],qs['fields'](_0x32e042[_0xc45b('0x37')][_0xc45b('0x3c')]));_0x23a031['attributes']=_0x23a031[_0xc45b('0x3b')][_0xc45b('0x3d')]?_0x23a031['attributes']:_0x210f98[_0xc45b('0x36')];if(_0x32e042[_0xc45b('0x37')][_0xc45b('0x47')]){_0x23a031['include']=[{'all':!![]}];}_0x23a031=_[_0xc45b('0x43')]({},_0x23a031,_0x32e042[_0xc45b('0x46')]);return db[_0xc45b('0x33')][_0xc45b('0x4f')](_0x23a031)[_0xc45b('0x11')](handleEntityNotFound(_0x1b1660,null))[_0xc45b('0x11')](respondWithResult(_0x1b1660,null))[_0xc45b('0x1a')](handleError(_0x1b1660,null));};exports['update']=function(_0xe044db,_0x25ac42){if(_0xe044db['body']['id']){delete _0xe044db['body']['id'];}if(_0xe044db['body'][_0xc45b('0x2e')]){if(!_0xe044db[_0xc45b('0x50')][_0xc45b('0x2e')][_0xc45b('0x51')]){_0xe044db['body'][_0xc45b('0x2e')]['CloudProviderId']=null;}}if(_0xe044db['body']['Smtp']){if(!_0xe044db[_0xc45b('0x50')]['Smtp'][_0xc45b('0x51')]){_0xe044db['body'][_0xc45b('0x4d')][_0xc45b('0x52')]=null;}}return db['MailAccount'][_0xc45b('0x4f')]({'where':{'id':_0xe044db[_0xc45b('0x4c')]['id']},'include':[{'model':db[_0xc45b('0x2d')],'as':_0xc45b('0x2e')},{'model':db[_0xc45b('0x2f')],'as':_0xc45b('0x4d')},{'model':db[_0xc45b('0x30')],'as':'mandatoryDispositionPause'}]})[_0xc45b('0x11')](handleEntityNotFound(_0x25ac42,null))['then'](saveUpdates(_0xe044db[_0xc45b('0x50')],null))[_0xc45b('0x11')](function(_0x2b9466){if(_0x2b9466&&_0xe044db[_0xc45b('0x50')][_0xc45b('0x2e')]){return db[_0xc45b('0x2d')]['update'](_0xe044db[_0xc45b('0x50')][_0xc45b('0x2e')],{'where':{'MailAccountId':_0x2b9466['id']}})[_0xc45b('0x11')](function(){return _0x2b9466;});}return _0x2b9466;})[_0xc45b('0x11')](function(_0x515fc7){if(_0x515fc7&&_0xe044db[_0xc45b('0x50')][_0xc45b('0x4d')]){return db['MailServerOut'][_0xc45b('0x24')](_0xe044db[_0xc45b('0x50')][_0xc45b('0x4d')],{'where':{'MailAccountId':_0x515fc7['id']}})[_0xc45b('0x11')](function(){return _0x515fc7;});}return _0x515fc7;})[_0xc45b('0x11')](respondWithResult(_0x25ac42,null))[_0xc45b('0x1a')](handleError(_0x25ac42,null));};exports['describe']=function(_0x3c18a9,_0x68b51){return db[_0xc45b('0x33')]['describe']()['then'](respondWithResult(_0x68b51,null))['catch'](handleError(_0x68b51,null));};exports[_0xc45b('0x53')]=function(_0x94926f,_0x3b746b){if(_0x94926f['body']['id']){delete _0x94926f[_0xc45b('0x50')]['id'];}return db[_0xc45b('0x33')]['find']({'where':{'id':_0x94926f[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x3b746b,null))['then'](function(_0x104a05){if(_0x104a05){_0x94926f['body'][_0xc45b('0x54')]=_0x104a05['id'];return db[_0xc45b('0x55')][_0xc45b('0x56')](_0x94926f[_0xc45b('0x50')]);}})[_0xc45b('0x11')](respondWithResult(_0x3b746b,null))[_0xc45b('0x1a')](handleError(_0x3b746b,null));};exports[_0xc45b('0x57')]=function(_0x5865ff,_0x4b116c){var _0x514beb={'raw':![],'where':{}};var _0x4aca56={};var _0xcc2ccf={'count':0x0,'rows':[]};return db['MailAccount'][_0xc45b('0x58')]({'where':{'id':_0x5865ff[_0xc45b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b116c,null))['then'](function(_0x32d37c){if(_0x32d37c){_0x4aca56[_0xc45b('0x36')]=_[_0xc45b('0x38')](db[_0xc45b('0x55')][_0xc45b('0x4e')]);_0x4aca56['query']=_[_0xc45b('0x38')](_0x5865ff[_0xc45b('0x37')]);_0x4aca56[_0xc45b('0x39')]=_['intersection'](_0x4aca56['model'],_0x4aca56[_0xc45b('0x37')]);_0x514beb[_0xc45b('0x3b')]=_[_0xc45b('0x3a')](_0x4aca56[_0xc45b('0x36')],qs['fields'](_0x5865ff['query'][_0xc45b('0x3c')]));_0x514beb['attributes']=_0x514beb[_0xc45b('0x3b')][_0xc45b('0x3d')]?_0x514beb['attributes']:_0x4aca56[_0xc45b('0x36')];if(!_0x5865ff['query']['hasOwnProperty'](_0xc45b('0x3e'))){_0x514beb[_0xc45b('0x1f')]=qs[_0xc45b('0x1f')](_0x5865ff[_0xc45b('0x37')][_0xc45b('0x1f')]);_0x514beb[_0xc45b('0x21')]=qs[_0xc45b('0x21')](_0x5865ff[_0xc45b('0x37')][_0xc45b('0x21')]);}_0x514beb[_0xc45b('0x3f')]=qs[_0xc45b('0x40')](_0x5865ff[_0xc45b('0x37')][_0xc45b('0x40')]);_0x514beb[_0xc45b('0x41')]=qs[_0xc45b('0x39')](_[_0xc45b('0x42')](_0x5865ff[_0xc45b('0x37')],_0x4aca56[_0xc45b('0x39')]));_0x514beb[_0xc45b('0x41')][_0xc45b('0x54')]=_0x32d37c['id'];if(_0x5865ff[_0xc45b('0x37')][_0xc45b('0x59')]){_0x514beb[_0xc45b('0x41')]=_[_0xc45b('0x43')](_0x514beb['where'],{'$or':_[_0xc45b('0x32')](_0x514beb[_0xc45b('0x3b')],function(_0x41b46f){var _0x9ca319={};_0x9ca319[_0x41b46f]={'$like':'%'+_0x5865ff['query'][_0xc45b('0x59')]+'%'};return _0x9ca319;})});}_0x514beb=_[_0xc45b('0x43')]({},_0x514beb,_0x5865ff[_0xc45b('0x46')]);return db[_0xc45b('0x55')]['count']({'where':_0x514beb[_0xc45b('0x41')]})[_0xc45b('0x11')](function(_0x15361b){_0xcc2ccf[_0xc45b('0x20')]=_0x15361b;if(_0x5865ff[_0xc45b('0x37')][_0xc45b('0x47')]){_0x514beb['include']=[{'all':!![]}];}return db[_0xc45b('0x55')]['findAll'](_0x514beb);})[_0xc45b('0x11')](function(_0x428c92){_0xcc2ccf[_0xc45b('0x4a')]=_0x428c92;return _0xcc2ccf;});}})[_0xc45b('0x11')](respondWithFilteredResult(_0x4b116c,_0x514beb))[_0xc45b('0x1a')](handleError(_0x4b116c,null));};exports['removeDispositions']=function(_0x19f40b,_0x541a9a){return db['MailAccount'][_0xc45b('0x4f')]({'where':{'id':_0x19f40b[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x541a9a,null))[_0xc45b('0x11')](function(_0x512813){if(_0x512813){return _0x512813['removeDispositions'](_0x19f40b[_0xc45b('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x541a9a,null))[_0xc45b('0x1a')](handleError(_0x541a9a,null));};exports[_0xc45b('0x5a')]=function(_0x519099,_0x3e2536){if(_0x519099['body']['id']){delete _0x519099[_0xc45b('0x50')]['id'];}return db['MailAccount'][_0xc45b('0x4f')]({'where':{'id':_0x519099[_0xc45b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e2536,null))[_0xc45b('0x11')](function(_0x427224){if(_0x427224){_0x519099[_0xc45b('0x50')]['MailAccountId']=_0x427224['id'];return db[_0xc45b('0x5b')][_0xc45b('0x56')](_0x519099[_0xc45b('0x50')]);}})[_0xc45b('0x11')](respondWithResult(_0x3e2536,null))[_0xc45b('0x1a')](handleError(_0x3e2536,null));};exports[_0xc45b('0x5c')]=function(_0x443f1b,_0x56c8f5){var _0x3dc991={'raw':![],'where':{}};var _0x4df7aa={};var _0x38f317={'count':0x0,'rows':[]};return db[_0xc45b('0x33')][_0xc45b('0x58')]({'where':{'id':_0x443f1b[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x56c8f5,null))[_0xc45b('0x11')](function(_0x40af81){if(_0x40af81){_0x4df7aa[_0xc45b('0x36')]=_[_0xc45b('0x38')](db['CannedAnswer'][_0xc45b('0x4e')]);_0x4df7aa['query']=_[_0xc45b('0x38')](_0x443f1b['query']);_0x4df7aa['filters']=_[_0xc45b('0x3a')](_0x4df7aa['model'],_0x4df7aa['query']);_0x3dc991['attributes']=_[_0xc45b('0x3a')](_0x4df7aa[_0xc45b('0x36')],qs[_0xc45b('0x3c')](_0x443f1b[_0xc45b('0x37')][_0xc45b('0x3c')]));_0x3dc991[_0xc45b('0x3b')]=_0x3dc991['attributes'][_0xc45b('0x3d')]?_0x3dc991[_0xc45b('0x3b')]:_0x4df7aa['model'];if(!_0x443f1b[_0xc45b('0x37')]['hasOwnProperty'](_0xc45b('0x3e'))){_0x3dc991['limit']=qs['limit'](_0x443f1b[_0xc45b('0x37')][_0xc45b('0x1f')]);_0x3dc991[_0xc45b('0x21')]=qs[_0xc45b('0x21')](_0x443f1b[_0xc45b('0x37')]['offset']);}_0x3dc991[_0xc45b('0x3f')]=qs[_0xc45b('0x40')](_0x443f1b[_0xc45b('0x37')][_0xc45b('0x40')]);_0x3dc991[_0xc45b('0x41')]=qs[_0xc45b('0x39')](_['pick'](_0x443f1b[_0xc45b('0x37')],_0x4df7aa[_0xc45b('0x39')]));_0x3dc991[_0xc45b('0x41')][_0xc45b('0x54')]=_0x40af81['id'];if(_0x443f1b['query']['filter']){_0x3dc991['where']=_[_0xc45b('0x43')](_0x3dc991[_0xc45b('0x41')],{'$or':_[_0xc45b('0x32')](_0x3dc991[_0xc45b('0x3b')],function(_0x3f6d2a){var _0xda8592={};_0xda8592[_0x3f6d2a]={'$like':'%'+_0x443f1b[_0xc45b('0x37')][_0xc45b('0x59')]+'%'};return _0xda8592;})});}_0x3dc991=_[_0xc45b('0x43')]({},_0x3dc991,_0x443f1b[_0xc45b('0x46')]);return db[_0xc45b('0x5b')]['count']({'where':_0x3dc991[_0xc45b('0x41')]})['then'](function(_0x5a6b1d){_0x38f317[_0xc45b('0x20')]=_0x5a6b1d;if(_0x443f1b[_0xc45b('0x37')][_0xc45b('0x47')]){_0x3dc991[_0xc45b('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc45b('0x49')](_0x3dc991);})[_0xc45b('0x11')](function(_0x540355){_0x38f317[_0xc45b('0x4a')]=_0x540355;return _0x38f317;});}})[_0xc45b('0x11')](respondWithFilteredResult(_0x56c8f5,_0x3dc991))['catch'](handleError(_0x56c8f5,null));};exports[_0xc45b('0x5d')]=function(_0x4d704c,_0x18972a){return db['MailAccount'][_0xc45b('0x4f')]({'where':{'id':_0x4d704c['params']['id']}})['then'](handleEntityNotFound(_0x18972a,null))[_0xc45b('0x11')](function(_0x3a1b3b){if(_0x3a1b3b){return _0x3a1b3b[_0xc45b('0x5d')](_0x4d704c[_0xc45b('0x37')]['ids']);}})['then'](respondWithStatusCode(_0x18972a,null))[_0xc45b('0x1a')](handleError(_0x18972a,null));};exports[_0xc45b('0x56')]=function(_0x48b4d6,_0x2676bf){var _0x5d15aa={'name':_0x48b4d6['body'][_0xc45b('0x2a')],'key':_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x35')],'provider':_0x48b4d6[_0xc45b('0x50')]['provider']===_0xc45b('0x5e')?null:_0x48b4d6[_0xc45b('0x50')]['provider'],'email':_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x5f')],'ListId':_0x48b4d6['body']['ListId'],'active':!_[_0xc45b('0x60')](_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x61')])?_0x48b4d6[_0xc45b('0x50')]['active']:!![],'description':_0x48b4d6['body']['description']||null,'Imap':{},'Smtp':{}};if(_0x5d15aa['provider']){_0x5d15aa[_0xc45b('0x2e')]['user']=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x62')]=_0x48b4d6[_0xc45b('0x50')]['username'];_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x63')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x64')]=_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x63')];if(_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x51')]){_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x51')]=_0x5d15aa['Smtp'][_0xc45b('0x51')]=!![];_0x5d15aa[_0xc45b('0x2e')]['CloudProviderId']=_0x5d15aa['Smtp'][_0xc45b('0x52')]=_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x52')];_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x63')]=_0x5d15aa['Smtp'][_0xc45b('0x64')]=null;}else{_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x52')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x52')]=null;}_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x65')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x65')]=null;_0x5d15aa['Imap'][_0xc45b('0x66')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x66')]=null;_0x5d15aa['Imap'][_0xc45b('0x67')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x67')]=null;}else{if(_0x48b4d6['body'][_0xc45b('0x68')]){_0x5d15aa['Imap'][_0xc45b('0x62')]=_0x5d15aa[_0xc45b('0x4d')]['user']=_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x69')];_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x63')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x64')]=_0x48b4d6['body']['password'];}else{_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x68')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x68')]=![];_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x62')]=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x62')]=null;_0x5d15aa[_0xc45b('0x2e')]['password']=_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x64')]=null;}_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x66')]=_0x48b4d6[_0xc45b('0x50')][_0xc45b('0x2e')]['host'];_0x5d15aa[_0xc45b('0x2e')][_0xc45b('0x67')]=_0x48b4d6['body'][_0xc45b('0x2e')][_0xc45b('0x67')];_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x66')]=_0x48b4d6['body'][_0xc45b('0x4d')][_0xc45b('0x66')];_0x5d15aa[_0xc45b('0x4d')][_0xc45b('0x67')]=_0x48b4d6[_0xc45b('0x50')]['Smtp'][_0xc45b('0x67')];}return db[_0xc45b('0x33')][_0xc45b('0x56')](_0x5d15aa,{'include':[{'model':db[_0xc45b('0x2f')],'as':_0xc45b('0x4d')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xc45b('0x11')](function(_0x18e235){var _0x5c8904=_0x48b4d6[_0xc45b('0x62')][_0xc45b('0x26')]({'plain':!![]});if(!_0x5c8904)throw new Error(_0xc45b('0x6a'));if(_0x5c8904['role']===_0xc45b('0x62')){var _0x48d8cf=_0x18e235[_0xc45b('0x26')]({'plain':!![]});return db[_0xc45b('0x6b')][_0xc45b('0x4f')]({'where':{'name':_0xc45b('0x27'),'userProfileId':_0x5c8904[_0xc45b('0x6c')]},'raw':!![]})[_0xc45b('0x11')](function(_0x1afc4e){if(_0x1afc4e&&_0x1afc4e[_0xc45b('0x6d')]===0x0){return db['UserProfileResource'][_0xc45b('0x56')]({'name':_0x48d8cf[_0xc45b('0x2a')],'resourceId':_0x48d8cf['id'],'type':_0x1afc4e[_0xc45b('0x2a')],'sectionId':_0x1afc4e['id']},{})['then'](function(){return _0x18e235;});}else{return _0x18e235;}})[_0xc45b('0x1a')](function(_0x3fdf33){logger[_0xc45b('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fdf33);throw _0x3fdf33;});}return _0x18e235;})[_0xc45b('0x11')](respondWithResult(_0x2676bf,0xc9))[_0xc45b('0x1a')](handleError(_0x2676bf,null));};exports['getImap']=function(_0x3aaf96,_0x258a81){return db['MailAccount'][_0xc45b('0x58')]({'where':{'id':_0x3aaf96[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x258a81,null))['then'](function(_0x4fd359){if(_0x4fd359){return _0x4fd359[_0xc45b('0x6e')]();}return null;})[_0xc45b('0x11')](respondWithResult(_0x258a81,null))['catch'](handleError(_0x258a81,null));};exports['addImap']=function(_0x287039,_0x4aeb72){if(_0x287039[_0xc45b('0x50')]['id']){delete _0x287039[_0xc45b('0x50')]['id'];}return db[_0xc45b('0x33')][_0xc45b('0x4f')]({'where':{'id':_0x287039[_0xc45b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4aeb72,null))[_0xc45b('0x11')](function(_0x26bdd4){if(_0x26bdd4){_0x287039[_0xc45b('0x50')][_0xc45b('0x54')]=_0x26bdd4['id'];return db[_0xc45b('0x2d')][_0xc45b('0x56')](_0x287039[_0xc45b('0x50')]);}})[_0xc45b('0x11')](respondWithResult(_0x4aeb72,null))[_0xc45b('0x1a')](handleError(_0x4aeb72,null));};exports[_0xc45b('0x6f')]=function(_0xafea0b,_0x380d90){return db['MailAccount'][_0xc45b('0x58')]({'where':{'id':_0xafea0b[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x380d90,null))['then'](function(_0x4168f4){if(_0x4168f4){return _0x4168f4[_0xc45b('0x70')](null);}return null;})['then'](respondWithStatusCode(_0x380d90,null))[_0xc45b('0x1a')](handleError(_0x380d90,null));};exports[_0xc45b('0x71')]=function(_0x1420ad,_0x5dc918){return db[_0xc45b('0x33')][_0xc45b('0x58')]({'where':{'id':_0x1420ad['params']['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x5dc918,null))[_0xc45b('0x11')](function(_0x353288){if(_0x353288){return _0x353288['getSmtp']();}return null;})[_0xc45b('0x11')](respondWithResult(_0x5dc918,null))['catch'](handleError(_0x5dc918,null));};exports[_0xc45b('0x72')]=function(_0x4c2e50,_0x95424b){if(_0x4c2e50[_0xc45b('0x50')]['id']){delete _0x4c2e50[_0xc45b('0x50')]['id'];}return db[_0xc45b('0x33')][_0xc45b('0x4f')]({'where':{'id':_0x4c2e50[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x95424b,null))['then'](function(_0x371cba){if(_0x371cba){_0x4c2e50[_0xc45b('0x50')][_0xc45b('0x54')]=_0x371cba['id'];return db[_0xc45b('0x2f')][_0xc45b('0x56')](_0x4c2e50['body']);}})[_0xc45b('0x11')](respondWithResult(_0x95424b,null))[_0xc45b('0x1a')](handleError(_0x95424b,null));};exports['removeSmtp']=function(_0x588453,_0xe43999){return db[_0xc45b('0x33')]['findOne']({'where':{'id':_0x588453[_0xc45b('0x4c')]['id']}})['then'](handleEntityNotFound(_0xe43999,null))[_0xc45b('0x11')](function(_0x2f782a){if(_0x2f782a){return _0x2f782a[_0xc45b('0x73')](null);}return null;})['then'](respondWithStatusCode(_0xe43999,null))[_0xc45b('0x1a')](handleError(_0xe43999,null));};exports[_0xc45b('0x74')]=function(_0x5c3b00,_0x3752ce){return db[_0xc45b('0x75')][_0xc45b('0x4f')]({'where':{'id':_0x5c3b00['params']['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x3752ce,null))[_0xc45b('0x11')](function(_0x19425b){if(_0x19425b){return _0x19425b['addInteraction'](_0x5c3b00[_0xc45b('0x50')][_0xc45b('0x76')],_[_0xc45b('0x77')](_0x5c3b00[_0xc45b('0x50')],[_0xc45b('0x76'),'id'])||{});}})[_0xc45b('0x11')](respondWithResult(_0x3752ce,null))[_0xc45b('0x1a')](handleError(_0x3752ce,null));};exports[_0xc45b('0x78')]=function(_0x2efdc5,_0x4a3784){var _0x2638c4={'raw':![],'where':{}};var _0x1305e7={};var _0x2a82d6={'count':0x0,'rows':[]};return db[_0xc45b('0x33')]['findOne']({'where':{'id':_0x2efdc5[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x4a3784,null))['then'](function(_0x161b92){if(_0x161b92){_0x1305e7[_0xc45b('0x36')]=_['keys'](db['MailInteraction'][_0xc45b('0x4e')]);_0x1305e7['query']=_[_0xc45b('0x38')](_0x2efdc5[_0xc45b('0x37')]);_0x1305e7[_0xc45b('0x39')]=_['intersection'](_0x1305e7[_0xc45b('0x36')],_0x1305e7[_0xc45b('0x37')]);_0x2638c4[_0xc45b('0x3b')]=_[_0xc45b('0x3a')](_0x1305e7['model'],qs[_0xc45b('0x3c')](_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x3c')]));_0x2638c4[_0xc45b('0x3b')]=_0x2638c4['attributes']['length']?_0x2638c4['attributes']:_0x1305e7[_0xc45b('0x36')];if(!_0x2efdc5[_0xc45b('0x37')]['hasOwnProperty'](_0xc45b('0x3e'))){_0x2638c4[_0xc45b('0x1f')]=qs['limit'](_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x1f')]);_0x2638c4[_0xc45b('0x21')]=qs['offset'](_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x21')]);}_0x2638c4[_0xc45b('0x3f')]=qs['sort'](_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x40')]);_0x2638c4[_0xc45b('0x41')]=qs[_0xc45b('0x39')](_[_0xc45b('0x42')](_0x2efdc5[_0xc45b('0x37')],_0x1305e7['filters']));_0x2638c4[_0xc45b('0x41')][_0xc45b('0x54')]=_0x161b92['id'];if(_0x2efdc5[_0xc45b('0x37')]['filter']){_0x2638c4[_0xc45b('0x41')]=_['merge'](_0x2638c4[_0xc45b('0x41')],{'$or':_[_0xc45b('0x32')](_0x2638c4[_0xc45b('0x3b')],function(_0x3caed5){var _0x421fc0={};_0x421fc0[_0x3caed5]={'$like':'%'+_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x59')]+'%'};return _0x421fc0;})});}_0x2638c4=_[_0xc45b('0x43')]({},_0x2638c4,_0x2efdc5[_0xc45b('0x46')]);return db['MailInteraction']['count']({'where':_0x2638c4[_0xc45b('0x41')]})[_0xc45b('0x11')](function(_0x86139a){_0x2a82d6[_0xc45b('0x20')]=_0x86139a;if(_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x47')]){_0x2638c4['include']=[{'model':db[_0xc45b('0x79')],'as':_0xc45b('0x7a'),'required':![]},{'model':db['User'],'as':_0xc45b('0x7b'),'attributes':['name',_0xc45b('0x7c'),_0xc45b('0x7d')],'required':![]},{'model':db['Tag'],'as':_0xc45b('0x7e'),'attributes':['id','name',_0xc45b('0x7f')],'where':_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x80')]?{'id':_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x80')]}:undefined,'required':_0x2efdc5[_0xc45b('0x37')][_0xc45b('0x80')]?!![]:![]}];}return db[_0xc45b('0x75')][_0xc45b('0x49')](_0x2638c4);})[_0xc45b('0x11')](function(_0x30c090){_0x2a82d6[_0xc45b('0x4a')]=_0x30c090;return _0x2a82d6;});}})[_0xc45b('0x11')](respondWithFilteredResult(_0x4a3784,_0x2638c4))[_0xc45b('0x1a')](handleError(_0x4a3784,null));};exports[_0xc45b('0x81')]=function addApplications(_0x55459f,_0x420027){var _0xbd49e1=_0x55459f[_0xc45b('0x4c')]['id'];var _0x51902f=_0x55459f['body'];var _0x83024a=0xc8;var _0x1f182f=null;return db[_0xc45b('0x82')][_0xc45b('0x83')]({'isolationLevel':db[_0xc45b('0x82')]['Transaction'][_0xc45b('0x84')][_0xc45b('0x85')]},function(_0x3f22f2){return db[_0xc45b('0x33')]['findOne']({'where':{'id':_0xbd49e1},'transaction':_0x3f22f2})[_0xc45b('0x11')](function(_0x5e00e7){if(_0x5e00e7){return db[_0xc45b('0x86')]['destroy']({'where':{'MailAccountId':_0xbd49e1},'transaction':_0x3f22f2})[_0xc45b('0x11')](function(){var _0x392044=_[_0xc45b('0x32')](_0x51902f,function(_0x5a87d6){_0x5a87d6[_0xc45b('0x54')]=_0xbd49e1;return _0x5a87d6;});return db[_0xc45b('0x86')][_0xc45b('0x87')](_0x392044,{'transaction':_0x3f22f2});});}else{_0x83024a=0x194;_0x1f182f=[];}});})[_0xc45b('0x11')](function(){if(_0x83024a!==0x194){return db[_0xc45b('0x86')][_0xc45b('0x88')]({'where':{'MailAccountId':_0xbd49e1},'order':_0xc45b('0x89')})[_0xc45b('0x11')](function(_0x1c6331){_0x1f182f=_0x1c6331;});}})[_0xc45b('0x1a')](function(_0x106fd3){_0x83024a=0x1f4;logger[_0xc45b('0x16')](_0x106fd3[_0xc45b('0x8a')]);if(_0x106fd3[_0xc45b('0x2a')]){delete _0x106fd3[_0xc45b('0x2a')];}_0x1f182f=_0x106fd3;})[_0xc45b('0x8b')](function(){if(_0x1f182f===null){_0x420027[_0xc45b('0x29')](_0x83024a);}else{if(_0x83024a===0x1f4){_0x420027[_0xc45b('0x1b')](_0x83024a)[_0xc45b('0x2b')](_0x1f182f);}else{_0x420027[_0xc45b('0x1b')](_0x83024a)['json'](_0x1f182f);}}});};exports[_0xc45b('0x8c')]=function(_0x15ba1b,_0x94298f){var _0x697560={};var _0x1488f3={};var _0x54df9b;var _0x210d2d;return db[_0xc45b('0x33')][_0xc45b('0x58')]({'where':{'id':_0x15ba1b['params']['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x94298f,null))[_0xc45b('0x11')](function(_0xbea279){if(_0xbea279){_0x54df9b=_0xbea279;_0x1488f3[_0xc45b('0x36')]=_[_0xc45b('0x38')](db[_0xc45b('0x86')][_0xc45b('0x4e')]);_0x1488f3[_0xc45b('0x37')]=_[_0xc45b('0x38')](_0x15ba1b['query']);_0x1488f3[_0xc45b('0x39')]=_[_0xc45b('0x3a')](_0x1488f3[_0xc45b('0x36')],_0x1488f3[_0xc45b('0x37')]);_0x697560['attributes']=_['intersection'](_0x1488f3[_0xc45b('0x36')],qs['fields'](_0x15ba1b[_0xc45b('0x37')][_0xc45b('0x3c')]));_0x697560[_0xc45b('0x3b')]=_0x697560[_0xc45b('0x3b')]['length']?_0x697560[_0xc45b('0x3b')]:_0x1488f3['model'];_0x697560['order']=qs[_0xc45b('0x40')](_0x15ba1b[_0xc45b('0x37')][_0xc45b('0x40')]);_0x697560[_0xc45b('0x41')]=qs[_0xc45b('0x39')](_[_0xc45b('0x42')](_0x15ba1b[_0xc45b('0x37')],_0x1488f3[_0xc45b('0x39')]));if(_0x15ba1b['query'][_0xc45b('0x59')]){_0x697560[_0xc45b('0x41')]=_[_0xc45b('0x43')](_0x697560[_0xc45b('0x41')],{'$or':_[_0xc45b('0x32')](_0x697560[_0xc45b('0x3b')],function(_0x294e33){var _0x2d2844={};_0x2d2844[_0x294e33]={'$like':'%'+_0x15ba1b[_0xc45b('0x37')][_0xc45b('0x59')]+'%'};return _0x2d2844;})});}_0x697560=_[_0xc45b('0x43')]({},_0x697560,_0x15ba1b[_0xc45b('0x46')]);return _0x54df9b[_0xc45b('0x8c')](_0x697560);}})[_0xc45b('0x11')](function(_0x383973){if(_0x383973){_0x210d2d=_0x383973[_0xc45b('0x3d')];if(!_0x15ba1b[_0xc45b('0x37')][_0xc45b('0x8d')](_0xc45b('0x3e'))){_0x697560[_0xc45b('0x1f')]=qs[_0xc45b('0x1f')](_0x15ba1b[_0xc45b('0x37')][_0xc45b('0x1f')]);_0x697560[_0xc45b('0x21')]=qs['offset'](_0x15ba1b[_0xc45b('0x37')]['offset']);}return _0x54df9b[_0xc45b('0x8c')](_0x697560);}})[_0xc45b('0x11')](function(_0x45b26e){if(_0x45b26e){return _0x45b26e?{'count':_0x210d2d,'rows':_0x45b26e}:null;}})[_0xc45b('0x11')](respondWithResult(_0x94298f,null))['catch'](handleError(_0x94298f,null));};exports[_0xc45b('0x8e')]=function(_0xf31d11,_0x5b32d1){var _0x5c8ef8={'raw':!![],'where':{}};var _0x2e8da8={};var _0x5486b7={'count':0x0,'rows':[]};return db[_0xc45b('0x33')][_0xc45b('0x58')]({'where':{'id':_0xf31d11['params']['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x5b32d1,null))[_0xc45b('0x11')](function(_0xe727eb){if(_0xe727eb){_0x2e8da8[_0xc45b('0x36')]=_[_0xc45b('0x38')](db[_0xc45b('0x8f')][_0xc45b('0x4e')]);_0x2e8da8[_0xc45b('0x37')]=_[_0xc45b('0x38')](_0xf31d11[_0xc45b('0x37')]);_0x2e8da8['filters']=_[_0xc45b('0x3a')](_0x2e8da8['model'],_0x2e8da8[_0xc45b('0x37')]);_0x5c8ef8[_0xc45b('0x3b')]=_['intersection'](_0x2e8da8[_0xc45b('0x36')],qs[_0xc45b('0x3c')](_0xf31d11[_0xc45b('0x37')][_0xc45b('0x3c')]));_0x5c8ef8['attributes']=_0x5c8ef8[_0xc45b('0x3b')][_0xc45b('0x3d')]?_0x5c8ef8[_0xc45b('0x3b')]:_0x2e8da8[_0xc45b('0x36')];if(!_0xf31d11['query']['hasOwnProperty'](_0xc45b('0x3e'))){_0x5c8ef8['limit']=qs[_0xc45b('0x1f')](_0xf31d11[_0xc45b('0x37')][_0xc45b('0x1f')]);_0x5c8ef8[_0xc45b('0x21')]=qs[_0xc45b('0x21')](_0xf31d11[_0xc45b('0x37')]['offset']);}_0x5c8ef8[_0xc45b('0x3f')]=qs[_0xc45b('0x40')](_0xf31d11[_0xc45b('0x37')]['sort']);_0x5c8ef8[_0xc45b('0x41')]=qs[_0xc45b('0x39')](_[_0xc45b('0x42')](_0xf31d11[_0xc45b('0x37')],_0x2e8da8['filters']));_0x5c8ef8['where'][_0xc45b('0x54')]=_0xe727eb['id'];if(_0xf31d11['query']['filter']){_0x5c8ef8[_0xc45b('0x41')]=_[_0xc45b('0x43')](_0x5c8ef8[_0xc45b('0x41')],{'$or':_[_0xc45b('0x32')](_0x5c8ef8[_0xc45b('0x3b')],function(_0x470023){var _0xfc864e={};_0xfc864e[_0x470023]={'$like':'%'+_0xf31d11[_0xc45b('0x37')][_0xc45b('0x59')]+'%'};return _0xfc864e;})});}if(_0xf31d11[_0xc45b('0x37')][_0xc45b('0x90')]){var _0x2f439f=_0xf31d11['query'][_0xc45b('0x90')]['split'](',');var _0x4bb45f={};_0x4bb45f[_0x2f439f[0x0]]={'$gte':moment(_0x2f439f[0x1])['format'](_0xc45b('0x91'))};_0x5c8ef8[_0xc45b('0x41')]=_[_0xc45b('0x43')](_0x5c8ef8[_0xc45b('0x41')],_0x4bb45f);}_0x5c8ef8=_[_0xc45b('0x43')]({},_0x5c8ef8,_0xf31d11['options']);return db[_0xc45b('0x8f')][_0xc45b('0x20')]({'where':_0x5c8ef8[_0xc45b('0x41')]})[_0xc45b('0x11')](function(_0x1249a6){_0x5486b7[_0xc45b('0x20')]=_0x1249a6;if(_0xf31d11[_0xc45b('0x37')][_0xc45b('0x47')]){_0x5c8ef8[_0xc45b('0x48')]=[{'all':!![]}];}return db[_0xc45b('0x8f')][_0xc45b('0x49')](_0x5c8ef8);})[_0xc45b('0x11')](function(_0x18384c){if(_0xf31d11['query'][_0xc45b('0x92')]==='true'){for(var _0x4e4647=0x0;_0x4e4647<_0x18384c[_0xc45b('0x3d')];_0x4e4647++){_0x18384c[_0x4e4647]['body']=juice(_0x18384c[_0x4e4647][_0xc45b('0x50')]);}}_0x5486b7[_0xc45b('0x4a')]=_0x18384c;return _0x5486b7;});}})[_0xc45b('0x11')](respondWithFilteredResult(_0x5b32d1,_0x5c8ef8))['catch'](handleError(_0x5b32d1,null));};exports[_0xc45b('0x2b')]=function(_0x594d43,_0x230186){var _0x1eb0f7,_0x523422={},_0x13e743;if(_0x594d43[_0xc45b('0x50')]['to']){_0x13e743=_0x594d43[_0xc45b('0x50')]['to'][_0xc45b('0x93')](',')[0x0];}return db[_0xc45b('0x33')][_0xc45b('0x4f')]({'where':{'id':_0x594d43[_0xc45b('0x4c')]['id']},'include':[{'model':db['CmList'],'as':_0xc45b('0x94'),'include':[{'model':db[_0xc45b('0x79')],'as':_0xc45b('0x95'),'where':{'email':_0x13e743},'limit':0x1,'order':[['updatedAt',_0xc45b('0x96')]]}]},{'model':db[_0xc45b('0x2f')],'as':'Smtp','raw':!![]}]})[_0xc45b('0x11')](handleEntityNotFound(_0x230186,null))[_0xc45b('0x11')](function(_0x9ad66b){if(_0x9ad66b){_0x1eb0f7=_0x9ad66b;if(_0x9ad66b[_0xc45b('0x4d')]){if(_[_0xc45b('0x60')](_0x594d43['body'][_0xc45b('0x97')])){_0x594d43[_0xc45b('0x50')][_0xc45b('0x97')]=util[_0xc45b('0x98')]('%s\x20<%s>',_0x9ad66b['name'],_0x9ad66b['email']||_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x62')]);}if(_0x594d43[_0xc45b('0x50')]['attachments']&&_0x594d43[_0xc45b('0x50')]['attachments'][_0xc45b('0x3d')]){for(var _0x2990ac=0x0;_0x2990ac<_0x594d43[_0xc45b('0x50')][_0xc45b('0x99')]['length'];_0x2990ac+=0x1){_0x594d43['body'][_0xc45b('0x99')][_0x2990ac]={'filename':_0x594d43[_0xc45b('0x50')][_0xc45b('0x99')][_0x2990ac][_0xc45b('0x2a')],'path':path[_0xc45b('0x9a')](config[_0xc45b('0x9b')],'server/files/attachments',_0x594d43[_0xc45b('0x50')][_0xc45b('0x99')][_0x2990ac][_0xc45b('0x9c')])};}}var _0x5c8787={'tls':{'rejectUnauthorized':![]}};if(_[_0xc45b('0x60')](_0x9ad66b['Smtp']['service'])){if(_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x68')]){_0x5c8787[_0xc45b('0x9d')]={'user':_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x62')],'pass':_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x64')]};}_0x5c8787[_0xc45b('0x66')]=_0x9ad66b['Smtp']['host'];_0x5c8787[_0xc45b('0x67')]=_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x67')];_0x5c8787[_0xc45b('0x9e')]=_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x9e')];}else{_0x5c8787['service']=_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x65')];_0x5c8787[_0xc45b('0x9d')]={'user':_0x9ad66b['Smtp'][_0xc45b('0x62')],'pass':_0x9ad66b[_0xc45b('0x4d')][_0xc45b('0x64')]};}return respondWithRpcPromise('SendMail',_0xc45b('0x9f'),{'account':_0x5c8787,'message':_0x594d43[_0xc45b('0x50')]});}else{throw new Error('List\x20not\x20found');}}})[_0xc45b('0x11')](function(_0x8ce5e3){if(_0x8ce5e3){_0x523422=_0x8ce5e3;if(_0x1eb0f7[_0xc45b('0x94')]){if(_0x1eb0f7[_0xc45b('0x94')][_0xc45b('0x95')]['length']){return _0x1eb0f7[_0xc45b('0x94')][_0xc45b('0x95')][0x0];}else{return db[_0xc45b('0x79')][_0xc45b('0x56')](_[_0xc45b('0xa0')](_0x594d43[_0xc45b('0x50')],{'firstName':_0x594d43[_0xc45b('0x50')]['to'],'email':_0x594d43[_0xc45b('0x50')]['to'],'phone':_0x594d43[_0xc45b('0x50')]['to'],'ListId':_0x1eb0f7[_0xc45b('0xa1')]}));}}else{throw new Error(_0xc45b('0xa2'));}}})[_0xc45b('0x11')](function(_0x42d4a9){if(_0x42d4a9){var _0x384fdf={'UserId':_0x594d43[_0xc45b('0x62')]['id'],'ContactId':_0x42d4a9['id'],'MailAccountId':_0x1eb0f7['id'],'inReplyTo':_0x523422['messageId'],'to':_0x594d43[_0xc45b('0x50')][_0xc45b('0x97')],'cc':_0x594d43[_0xc45b('0x50')]['cc'],'subject':_0x594d43['body']['subject'],'attach':_0x594d43['body'][_0xc45b('0xa3')],'firstMsgDirection':_0xc45b('0xa4'),'lastMsgAt':moment()[_0xc45b('0x98')](_0xc45b('0x91')),'lastMsgDirection':_0xc45b('0xa4'),'Messages':[_[_0xc45b('0x43')](_0x594d43['body'],{'messageId':_0x523422[_0xc45b('0xa5')],'sentAt':moment()['format'](_0xc45b('0x91')),'read':!![],'MailAccountId':_0x1eb0f7['id'],'UserId':_0x594d43[_0xc45b('0x62')]['id'],'ContactId':_0x42d4a9['id']})]};if(_0x594d43[_0xc45b('0x50')][_0xc45b('0xa6')]){_0x384fdf=_[_0xc45b('0x43')](_0x384fdf,_0x594d43[_0xc45b('0x50')][_0xc45b('0xa6')]);}return db[_0xc45b('0x75')][_0xc45b('0x56')](_0x384fdf,{'include':[{'model':db['MailMessage'],'as':_0xc45b('0xa7')}]});}})[_0xc45b('0x11')](respondWithResult(_0x230186,null))[_0xc45b('0x1a')](handleError(_0x230186,null));};exports[_0xc45b('0xa8')]=function(_0x3cc5e5,_0x3aaa70){return db[_0xc45b('0x33')]['find']({'where':{'id':_0x3cc5e5[_0xc45b('0x4c')]['id']},'include':[{'model':db[_0xc45b('0x2f')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc45b('0xa9')],'as':_0xc45b('0xa9'),'raw':!![]}]}]})[_0xc45b('0x11')](handleEntityNotFound(_0x3aaa70,null))[_0xc45b('0x11')](function(_0x55908f){if(!_0x55908f['Smtp'])return;var _0x13e960={'id':_0x55908f['id'],'tls':{'rejectUnauthorized':![]}};if(_0x55908f['provider']!==_0xc45b('0x5e')){_0x13e960[_0xc45b('0x65')]=_0x55908f[_0xc45b('0xaa')];}else{_0x13e960['host']=_0x55908f[_0xc45b('0x4d')][_0xc45b('0x66')];_0x13e960['port']=_0x55908f['Smtp'][_0xc45b('0x67')];_0x13e960[_0xc45b('0x9e')]=_0x55908f[_0xc45b('0x4d')][_0xc45b('0x9e')];}if(_0x55908f[_0xc45b('0x4d')][_0xc45b('0x68')]){if(_0x55908f[_0xc45b('0x4d')][_0xc45b('0x51')]){_0x13e960[_0xc45b('0x9d')]={'type':_0xc45b('0xab'),'user':_0x55908f[_0xc45b('0x4d')]['user'],'accessToken':_0x55908f[_0xc45b('0x4d')][_0xc45b('0xa9')][_0xc45b('0xac')]};}else{_0x13e960['auth']={'user':_0x55908f[_0xc45b('0x4d')][_0xc45b('0x62')],'pass':_0x55908f['Smtp'][_0xc45b('0x64')]};}}return respondWithRpcPromise(_0xc45b('0xad'),'verifySmtp',{'account':_0x13e960});})[_0xc45b('0x11')](respondWithResult(_0x3aaa70,null))[_0xc45b('0x1a')](handleError(_0x3aaa70,null));};exports[_0xc45b('0x25')]=function(_0x1c6c48,_0x4a8bc8){return db[_0xc45b('0x33')][_0xc45b('0x4f')]({'where':{'id':_0x1c6c48[_0xc45b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a8bc8,null))['then'](function(_0x2d9880){if(_0x2d9880&&_0x2d9880[_0xc45b('0x65')]){throw new db[(_0xc45b('0xae'))]['ValidationError'](_0xc45b('0xaf'));}return _0x2d9880;})[_0xc45b('0x11')](removeEntity(_0x4a8bc8,null))[_0xc45b('0x1a')](handleError(_0x4a8bc8,null));};exports[_0xc45b('0xb0')]=function(_0x178057,_0x2a7704){return db[_0xc45b('0x33')][_0xc45b('0x4f')]({'where':{'id':_0x178057[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x2a7704,null))[_0xc45b('0x11')](function(_0x3393e5){if(_0x3393e5){return _0x3393e5['addAgents'](_0x178057[_0xc45b('0x50')][_0xc45b('0x76')],_[_0xc45b('0x77')](_0x178057[_0xc45b('0x50')],['ids','id'])||{})['spread'](function(_0x59c314){for(var _0x1e0ed0=0x0;_0x1e0ed0<_0x178057[_0xc45b('0x50')][_0xc45b('0x76')]['length'];_0x1e0ed0+=0x1){socket[_0xc45b('0xb1')]('userMailAccount:save',{'UserId':Number(_0x178057[_0xc45b('0x50')]['ids'][_0x1e0ed0]),'MailAccountId':Number(_0x178057[_0xc45b('0x4c')]['id'])});}return _0x59c314;});}})[_0xc45b('0x11')](respondWithResult(_0x2a7704,null))[_0xc45b('0x1a')](handleError(_0x2a7704,null));};exports[_0xc45b('0xb2')]=function(_0x14db44,_0x24f7f7){return db['MailAccount'][_0xc45b('0x4f')]({'where':{'id':_0x14db44[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x24f7f7,null))['then'](function(_0x35bb76){if(_0x35bb76){return _0x35bb76['removeAgents'](_0x14db44[_0xc45b('0x37')][_0xc45b('0x76')])[_0xc45b('0x11')](function(){if(_[_0xc45b('0xb3')](_0x14db44[_0xc45b('0x37')][_0xc45b('0x76')])){for(var _0xaab1c1=0x0;_0xaab1c1<_0x14db44[_0xc45b('0x37')][_0xc45b('0x76')][_0xc45b('0x3d')];_0xaab1c1+=0x1){socket[_0xc45b('0xb1')](_0xc45b('0xb4'),{'UserId':Number(_0x14db44[_0xc45b('0x37')][_0xc45b('0x76')][_0xaab1c1]),'MailAccountId':Number(_0x14db44[_0xc45b('0x4c')]['id'])});}}else{socket[_0xc45b('0xb1')]('userMailAccount:remove',{'UserId':Number(_0x14db44[_0xc45b('0x37')][_0xc45b('0x76')]),'MailAccountId':Number(_0x14db44[_0xc45b('0x4c')]['id'])});}});}})[_0xc45b('0x11')](respondWithStatusCode(_0x24f7f7,null))['catch'](handleError(_0x24f7f7,null));};exports['getAgents']=function(_0x509ee3,_0x7094f9){var _0x20b6f0={};var _0x39c8ab={};var _0x2cdd41;var _0x5928f7;return db['MailAccount'][_0xc45b('0x58')]({'where':{'id':_0x509ee3[_0xc45b('0x4c')]['id']}})[_0xc45b('0x11')](handleEntityNotFound(_0x7094f9,null))['then'](function(_0x1dce79){if(_0x1dce79){_0x2cdd41=_0x1dce79;_0x39c8ab['model']=_[_0xc45b('0x38')](db[_0xc45b('0xb5')][_0xc45b('0x4e')]);_0x39c8ab[_0xc45b('0x37')]=_[_0xc45b('0x38')](_0x509ee3[_0xc45b('0x37')]);_0x39c8ab[_0xc45b('0x39')]=_[_0xc45b('0x3a')](_0x39c8ab['model'],_0x39c8ab['query']);_0x20b6f0[_0xc45b('0x3b')]=_[_0xc45b('0x3a')](_0x39c8ab['model'],qs[_0xc45b('0x3c')](_0x509ee3['query']['fields']));_0x20b6f0['attributes']=_0x20b6f0['attributes']['length']?_0x20b6f0[_0xc45b('0x3b')]:_0x39c8ab[_0xc45b('0x36')];_0x20b6f0[_0xc45b('0x3f')]=qs[_0xc45b('0x40')](_0x509ee3[_0xc45b('0x37')]['sort']);_0x20b6f0['where']=qs[_0xc45b('0x39')](_[_0xc45b('0x42')](_0x509ee3[_0xc45b('0x37')],_0x39c8ab[_0xc45b('0x39')]));if(_0x509ee3[_0xc45b('0x37')][_0xc45b('0x59')]){_0x20b6f0[_0xc45b('0x41')]=_[_0xc45b('0x43')](_0x20b6f0[_0xc45b('0x41')],{'$or':_[_0xc45b('0x32')](_0x20b6f0[_0xc45b('0x3b')],function(_0x32fd0e){var _0x3b0dda={};_0x3b0dda[_0x32fd0e]={'$like':'%'+_0x509ee3[_0xc45b('0x37')][_0xc45b('0x59')]+'%'};return _0x3b0dda;})});}_0x20b6f0=_[_0xc45b('0x43')]({},_0x20b6f0,_0x509ee3[_0xc45b('0x46')]);return _0x2cdd41[_0xc45b('0xb6')](_0x20b6f0);}})[_0xc45b('0x11')](function(_0xfcde5f){if(_0xfcde5f){_0x5928f7=_0xfcde5f[_0xc45b('0x3d')];if(!_0x509ee3[_0xc45b('0x37')][_0xc45b('0x8d')](_0xc45b('0x3e'))){_0x20b6f0[_0xc45b('0x1f')]=qs[_0xc45b('0x1f')](_0x509ee3[_0xc45b('0x37')][_0xc45b('0x1f')]);_0x20b6f0['offset']=qs[_0xc45b('0x21')](_0x509ee3[_0xc45b('0x37')][_0xc45b('0x21')]);}return _0x2cdd41[_0xc45b('0xb6')](_0x20b6f0);}})['then'](function(_0x5a9cb6){if(_0x5a9cb6){return _0x5a9cb6?{'count':_0x5928f7,'rows':_0x5a9cb6}:null;}})['then'](respondWithResult(_0x7094f9,null))[_0xc45b('0x1a')](handleError(_0x7094f9,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index cad58a3..5183bb8 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 _0xdc6f=['../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1846fc,_0x2b99b4){var _0x48be4e=function(_0xedf487){while(--_0xedf487){_0x1846fc['push'](_0x1846fc['shift']());}};_0x48be4e(++_0x2b99b4);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x20a618,_0x3d1a7b){_0x20a618=_0x20a618-0x0;var _0x3be658=_0xdc6f[_0x20a618];return _0x3be658;};'use strict';var EventEmitter=require(_0xfdc6('0x0'));var MailAccount=require(_0xfdc6('0x1'))['db'][_0xfdc6('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xfdc6('0x3')](0x0);var events={'afterCreate':_0xfdc6('0x4'),'afterUpdate':_0xfdc6('0x5'),'afterDestroy':_0xfdc6('0x6')};function emitEvent(_0x4a79a1){return function(_0x51bdef,_0x384a66,_0x56fee7){MailAccountEvents['emit'](_0x4a79a1+':'+_0x51bdef['id'],_0x51bdef);MailAccountEvents[_0xfdc6('0x7')](_0x4a79a1,_0x51bdef);_0x56fee7(null);};}for(var e in events){if(events[_0xfdc6('0x8')](e)){var event=events[e];MailAccount[_0xfdc6('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x7e02=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit'];(function(_0x3af319,_0x3bfea7){var _0x5cd131=function(_0x4db558){while(--_0x4db558){_0x3af319['push'](_0x3af319['shift']());}};_0x5cd131(++_0x3bfea7);}(_0x7e02,0x71));var _0x27e0=function(_0x4ec72d,_0x499852){_0x4ec72d=_0x4ec72d-0x0;var _0x3fc7c4=_0x7e02[_0x4ec72d];return _0x3fc7c4;};'use strict';var EventEmitter=require(_0x27e0('0x0'));var MailAccount=require(_0x27e0('0x1'))['db'][_0x27e0('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x27e0('0x3')](0x0);var events={'afterCreate':_0x27e0('0x4'),'afterUpdate':_0x27e0('0x5'),'afterDestroy':_0x27e0('0x6')};function emitEvent(_0x57d7fb){return function(_0x4fa613,_0x3d4f41,_0x5abeff){MailAccountEvents[_0x27e0('0x7')](_0x57d7fb+':'+_0x4fa613['id'],_0x4fa613);MailAccountEvents[_0x27e0('0x7')](_0x57d7fb,_0x4fa613);_0x5abeff(null);};}for(var e in events){if(events[_0x27e0('0x8')](e)){var event=events[e];MailAccount[_0x27e0('0x9')](e,emitEvent(event));}}module[_0x27e0('0xa')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index d54bd3d..4bb57d0 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 _0x824a=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x1ed66f,_0x5c5ef2){var _0x5748a9=function(_0x5ebb69){while(--_0x5ebb69){_0x1ed66f['push'](_0x1ed66f['shift']());}};_0x5748a9(++_0x5c5ef2);}(_0x824a,0x131));var _0xa824=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x824a[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xa824('0x0'));var util=require(_0xa824('0x1'));var logger=require('../../config/logger')(_0xa824('0x2'));var moment=require(_0xa824('0x3'));var BPromise=require(_0xa824('0x4'));var rp=require(_0xa824('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa824('0x6'));var config=require('../../config/environment');var attributes=require(_0xa824('0x7'));module[_0xa824('0x8')]=function(_0x23cf9e,_0x57d28b){return _0x23cf9e[_0xa824('0x9')](_0xa824('0xa'),attributes,{'tableName':_0xa824('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x49b8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x49b8,0x1c0));var _0x849b=function(_0x561f42,_0x44d837){_0x561f42=_0x561f42-0x0;var _0x5d66c7=_0x49b8[_0x561f42];return _0x5d66c7;};'use strict';var _=require(_0x849b('0x0'));var util=require(_0x849b('0x1'));var logger=require(_0x849b('0x2'))(_0x849b('0x3'));var moment=require(_0x849b('0x4'));var BPromise=require(_0x849b('0x5'));var rp=require(_0x849b('0x6'));var fs=require('fs');var path=require(_0x849b('0x7'));var rimraf=require(_0x849b('0x8'));var config=require(_0x849b('0x9'));var attributes=require(_0x849b('0xa'));module[_0x849b('0xb')]=function(_0x114815,_0x1c9213){return _0x114815[_0x849b('0xc')](_0x849b('0xd'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 954c6f0..6deebb2 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 _0x5ee6=['NotifyMailAccount','mail','difference','keys','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','account','CmContact','Contacts','DESC','MailApplication','Applications','MailServerOut','List','get','omit','list','applications','priority','asc','autoclose','close','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','interaction','MailMessage','attachments','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','attributes','model','debug','ShowMailAccount'];(function(_0x4c77f3,_0x2ece5f){var _0x2c5022=function(_0x44f6fa){while(--_0x44f6fa){_0x4c77f3['push'](_0x4c77f3['shift']());}};_0x2c5022(++_0x2ece5f);}(_0x5ee6,0x10e));var _0x65ee=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5ee6[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x65ee('0x0'));var util=require(_0x65ee('0x1'));var moment=require(_0x65ee('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ee('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x65ee('0x4'));var logger=require(_0x65ee('0x5'))(_0x65ee('0x6'));var config=require(_0x65ee('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x65ee('0x8')][_0x65ee('0x9')]({'port':0x232c});config[_0x65ee('0xa')]=_[_0x65ee('0xb')](config[_0x65ee('0xa')],{'host':_0x65ee('0xc'),'port':0x18eb});var socket=require(_0x65ee('0xd'))(new Redis(config['redis']));require(_0x65ee('0xe'))[_0x65ee('0xf')](socket);function respondWithRpcPromise(_0xa8ca42,_0x17c95c,_0x126312){return new BPromise(function(_0x1f9edf,_0xc96c94){return client['request'](_0xa8ca42,_0x126312)[_0x65ee('0x10')](function(_0x110559){logger[_0x65ee('0x11')]('MailAccount,\x20%s,\x20%s',_0x17c95c,'request\x20sent');logger['debug'](_0x65ee('0x12'),_0x17c95c,_0x65ee('0x13'),JSON[_0x65ee('0x14')](_0x110559));if(_0x110559[_0x65ee('0x15')]){if(_0x110559[_0x65ee('0x15')][_0x65ee('0x16')]===0x1f4){logger['error'](_0x65ee('0x17'),_0x17c95c,_0x110559['error']['message']);return _0xc96c94(_0x110559[_0x65ee('0x15')][_0x65ee('0x18')]);}logger[_0x65ee('0x15')]('MailAccount,\x20%s,\x20%s',_0x17c95c,_0x110559[_0x65ee('0x15')][_0x65ee('0x18')]);return _0x1f9edf(_0x110559[_0x65ee('0x15')]['message']);}else{logger[_0x65ee('0x11')](_0x65ee('0x17'),_0x17c95c,'request\x20sent');_0x1f9edf(_0x110559['result']['message']);}})[_0x65ee('0x19')](function(_0x30e0d8){logger[_0x65ee('0x15')](_0x65ee('0x17'),_0x17c95c,_0x30e0d8);_0xc96c94(_0x30e0d8);});});}exports[_0x65ee('0x1a')]=function(_0x3c1386){var _0x1163aa=this;return new Promise(function(_0x1686eb,_0x43c0bf){return db[_0x65ee('0x1b')][_0x65ee('0x1c')]({'raw':_0x3c1386[_0x65ee('0x1d')]?_0x3c1386[_0x65ee('0x1d')][_0x65ee('0x1e')]===undefined?!![]:![]:!![],'where':_0x3c1386[_0x65ee('0x1d')]?_0x3c1386[_0x65ee('0x1d')][_0x65ee('0x1f')]||null:null,'attributes':_0x3c1386[_0x65ee('0x1d')]?_0x3c1386[_0x65ee('0x1d')]['attributes']||null:null,'limit':_0x3c1386[_0x65ee('0x1d')]?_0x3c1386[_0x65ee('0x1d')][_0x65ee('0x20')]||null:null,'include':_0x3c1386[_0x65ee('0x1d')]?_0x3c1386[_0x65ee('0x1d')][_0x65ee('0x21')]?_[_0x65ee('0x22')](_0x3c1386[_0x65ee('0x1d')][_0x65ee('0x21')],function(_0x1ac658){return{'model':db[_0x1ac658['model']],'as':_0x1ac658['as'],'attributes':_0x1ac658[_0x65ee('0x23')],'include':_0x1ac658[_0x65ee('0x21')]?_[_0x65ee('0x22')](_0x1ac658['include'],function(_0xf6a126){return{'model':db[_0xf6a126[_0x65ee('0x24')]],'as':_0xf6a126['as'],'attributes':_0xf6a126[_0x65ee('0x23')],'include':_0xf6a126[_0x65ee('0x21')]?_['map'](_0xf6a126[_0x65ee('0x21')],function(_0x4c4d8b){return{'model':db[_0x4c4d8b[_0x65ee('0x24')]],'as':_0x4c4d8b['as'],'attributes':_0x4c4d8b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x335cef){logger[_0x65ee('0x11')](_0x65ee('0x1a'),_0x3c1386);logger[_0x65ee('0x25')](_0x65ee('0x1a'),_0x3c1386,JSON[_0x65ee('0x14')](_0x335cef));_0x1686eb(_0x335cef);})['catch'](function(_0x3b9e99){logger[_0x65ee('0x15')]('GetMailAccount',_0x3b9e99[_0x65ee('0x18')],_0x3c1386);_0x43c0bf(_0x1163aa[_0x65ee('0x15')](0x1f4,_0x3b9e99[_0x65ee('0x18')]));});});};exports[_0x65ee('0x26')]=function(_0x1d80eb){var _0x3c27d3=this;return new Promise(function(_0x590b07,_0x3993b9){return db[_0x65ee('0x1b')]['find']({'raw':_0x1d80eb[_0x65ee('0x1d')]?_0x1d80eb[_0x65ee('0x1d')][_0x65ee('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d80eb[_0x65ee('0x1d')]?_0x1d80eb[_0x65ee('0x1d')][_0x65ee('0x1f')]||null:null,'attributes':_0x1d80eb['options']?_0x1d80eb[_0x65ee('0x1d')][_0x65ee('0x23')]||null:null,'include':_0x1d80eb[_0x65ee('0x1d')]?_0x1d80eb['options'][_0x65ee('0x21')]?_[_0x65ee('0x22')](_0x1d80eb[_0x65ee('0x1d')][_0x65ee('0x21')],function(_0x50ac76){return{'model':db[_0x50ac76['model']],'as':_0x50ac76['as'],'attributes':_0x50ac76[_0x65ee('0x23')],'include':_0x50ac76[_0x65ee('0x21')]?_[_0x65ee('0x22')](_0x50ac76[_0x65ee('0x21')],function(_0x3d8220){return{'model':db[_0x3d8220[_0x65ee('0x24')]],'as':_0x3d8220['as'],'attributes':_0x3d8220[_0x65ee('0x23')],'include':_0x3d8220[_0x65ee('0x21')]?_[_0x65ee('0x22')](_0x3d8220[_0x65ee('0x21')],function(_0x13e01d){return{'model':db[_0x13e01d[_0x65ee('0x24')]],'as':_0x13e01d['as'],'attributes':_0x13e01d[_0x65ee('0x23')]};}):[]};}):[]};}):[]:[]})[_0x65ee('0x10')](function(_0x2ef37d){logger[_0x65ee('0x11')](_0x65ee('0x26'),_0x1d80eb);logger[_0x65ee('0x25')]('ShowMailAccount',_0x1d80eb,JSON[_0x65ee('0x14')](_0x2ef37d));_0x590b07(_0x2ef37d);})['catch'](function(_0x42cb2f){logger[_0x65ee('0x15')](_0x65ee('0x26'),_0x42cb2f['message'],_0x1d80eb);_0x3993b9(_0x3c27d3[_0x65ee('0x15')](0x1f4,_0x42cb2f[_0x65ee('0x18')]));});});};exports[_0x65ee('0x27')]=function(_0x94b080){var _0x3b983e=this;return new Promise(function(_0x42bed0,_0x259ab8){var _0x20d32e={'body':_0x94b080['body'],'channel':_0x65ee('0x28')};var _0x36176f=_[_0x65ee('0x29')](_[_0x65ee('0x2a')](db['CmContact']['rawAttributes']),['createdAt','updatedAt',_0x65ee('0x2b'),_0x65ee('0x2c')]);var _0x1dc256=![];if(_0x94b080[_0x65ee('0x2d')]['id']){delete _0x94b080[_0x65ee('0x2d')]['id'];}if(_[_0x65ee('0x2e')](_0x94b080[_0x65ee('0x2d')][_0x65ee('0x2f')])){return _0x259ab8(_0x3b983e[_0x65ee('0x15')](0x1f4,_0x65ee('0x30')));}if(_[_0x65ee('0x2e')](_0x94b080['body'][_0x65ee('0x2d')])||_0x94b080['body'][_0x65ee('0x2d')]===''){return _0x259ab8(_0x3b983e['error'](0x1f4,_0x65ee('0x31')));}if(_[_0x65ee('0x2e')](_0x94b080['body']['mapKey'])){return _0x259ab8(_0x3b983e[_0x65ee('0x15')](0x1f4,_0x65ee('0x32')+_0x36176f));}if(!_['includes'](_0x36176f,_0x94b080[_0x65ee('0x2d')]['mapKey'])){return _0x259ab8(_0x3b983e['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x36176f));}var _0x9804f2={};_0x9804f2[_0x94b080['body'][_0x65ee('0x33')]]=_0x94b080[_0x65ee('0x2d')][_0x65ee('0x2f')];return db[_0x65ee('0x1b')][_0x65ee('0x34')]({'where':{'id':_0x94b080[_0x65ee('0x35')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x65ee('0x36')],'as':_0x65ee('0x37'),'where':_0x9804f2,'limit':0x1,'order':[['updatedAt',_0x65ee('0x38')]]}]},{'model':db[_0x65ee('0x39')],'as':_0x65ee('0x3a')},{'model':db[_0x65ee('0x3b')],'as':'Smtp'}]})[_0x65ee('0x10')](function(_0x2b576c){if(_0x2b576c&&_0x2b576c[_0x65ee('0x3c')]){var _0x3f507d=_0x2b576c[_0x65ee('0x3d')]({'plain':!![]});_0x20d32e[_0x65ee('0x35')]=_[_0x65ee('0x3e')](_0x3f507d,[_0x65ee('0x3a'),_0x65ee('0x3c')]);_0x20d32e['applications']=_0x3f507d[_0x65ee('0x3a')];_0x20d32e[_0x65ee('0x3f')]=_0x3f507d['List'];_0x20d32e[_0x65ee('0x40')]=_['orderBy'](_0x20d32e['applications'],[_0x65ee('0x41')],[_0x65ee('0x42')]);if(_0x20d32e['account']&&_0x20d32e[_0x65ee('0x35')][_0x65ee('0x43')]){_0x20d32e[_0x65ee('0x40')]['push']({'id':0x0,'priority':_0x20d32e[_0x65ee('0x40')]['length']+0x1,'app':_0x65ee('0x44'),'appdata':_0x65ee('0x43'),'interval':_0x65ee('0x45')});}if(_0x20d32e[_0x65ee('0x35')]['Applications']){delete _0x20d32e[_0x65ee('0x35')][_0x65ee('0x3a')];}if(_0x20d32e[_0x65ee('0x35')][_0x65ee('0x3c')]){delete _0x20d32e['account']['List'];}if(_0x3f507d['List'][_0x65ee('0x37')][_0x65ee('0x46')]){return _0x3f507d['List'][_0x65ee('0x37')][0x0];}var _0x51afff=_['defaults'](_0x94b080[_0x65ee('0x2d')],{'firstName':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x2f')],'ListId':_0x3f507d['ListId']});_0x51afff[_0x94b080['body'][_0x65ee('0x33')]]=_0x94b080['body']['from'];return db[_0x65ee('0x36')][_0x65ee('0x47')](_0x51afff);}else{throw new Error(_0x65ee('0x48'));}})[_0x65ee('0x10')](function(_0x5b2867){_0x20d32e[_0x65ee('0x49')]=_0x5b2867;if(_0x5b2867){if(!_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')][_0x65ee('0x4a')]){_0x94b080['body'][_0x65ee('0x18')][_0x65ee('0x4a')]=rs[_0x65ee('0x4b')]()+'\x20'+_0x94b080[_0x65ee('0x2d')]['message'][_0x65ee('0x2f')];}var _0x491581={'ContactId':_0x5b2867['id'],'MailAccountId':_0x94b080[_0x65ee('0x35')]['id'],'inReplyTo':_0x94b080[_0x65ee('0x2d')]['message'][_0x65ee('0x4a')],'to':_0x94b080['body'][_0x65ee('0x18')][_0x65ee('0x2f')],'cc':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')]['cc'],'subject':_0x94b080['body'][_0x65ee('0x18')][_0x65ee('0x4c')],'attach':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')]['attach'],'lastMsgAt':moment()[_0x65ee('0x4d')](_0x65ee('0x4e')),'lastMsgDirection':'in'};return db[_0x65ee('0x4f')]['find']({'where':{'closed':![],'MailAccountId':_0x94b080['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x65ee('0x50'),'attributes':[_0x65ee('0x4a')],'where':{'messageId':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')][_0x65ee('0x51')]}}]})[_0x65ee('0x10')](function(_0x10bf62){if(_0x10bf62){return[_0x10bf62,![]];}return db[_0x65ee('0x4f')][_0x65ee('0x47')](_0x491581)[_0x65ee('0x10')](function(_0x18a1f3){return[_0x18a1f3,!![]];});});}else{throw new Error(_0x65ee('0x52'));}})[_0x65ee('0x53')](function(_0x59533d,_0x1883d0){if(_0x59533d){_0x1dc256=_0x1883d0;if(!_0x1883d0){return _0x59533d[_0x65ee('0x54')]({'inReplyTo':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')]['messageId'],'to':_0x94b080['body'][_0x65ee('0x18')][_0x65ee('0x2f')],'cc':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')]['cc'],'subject':_0x94b080[_0x65ee('0x2d')]['message']['subject'],'attach':_0x59533d[_0x65ee('0x55')]?_0x59533d[_0x65ee('0x55')]:_0x94b080[_0x65ee('0x2d')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x65ee('0x4d')](_0x65ee('0x4e')),'lastMsgAt':moment()[_0x65ee('0x4d')](_0x65ee('0x4e')),'lastMsgDirection':'in'});}else{return _0x59533d;}}})['then'](function(_0x4fcff0){_0x20d32e[_0x65ee('0x56')]=_0x4fcff0[_0x65ee('0x3d')]({'plain':!![]});_0x20d32e[_0x65ee('0x56')]['created']=_0x1dc256;return db[_0x65ee('0x57')][_0x65ee('0x47')]({'body':_0x94b080['body']['body'],'MailAccountId':_0x94b080['account']['id'],'MailInteractionId':_0x4fcff0['id'],'direction':'in','ContactId':_0x20d32e[_0x65ee('0x49')]['id'],'messageId':_0x94b080['body'][_0x65ee('0x18')][_0x65ee('0x4a')],'from':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')]['from'],'to':_0x94b080['body'][_0x65ee('0x18')]['to'],'cc':_0x94b080['body'][_0x65ee('0x18')]['cc'],'subject':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')][_0x65ee('0x4c')],'attach':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')]['attach'],'Attachments':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')][_0x65ee('0x58')],'originTo':_0x94b080['body'][_0x65ee('0x18')][_0x65ee('0x59')],'originCc':_0x94b080['body'][_0x65ee('0x18')][_0x65ee('0x5a')],'bcc':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')][_0x65ee('0x5b')],'ChatWebsiteId':_0x94b080['body']['message']['ChatWebsiteId']||null,'originChannel':_0x94b080[_0x65ee('0x2d')]['message'][_0x65ee('0x5c')]||'Email','ChatOfflineMessageId':_0x94b080[_0x65ee('0x2d')][_0x65ee('0x18')][_0x65ee('0x5d')]||null},{'include':[{'model':db[_0x65ee('0x5e')],'as':_0x65ee('0x5f')}]});})[_0x65ee('0x10')](function(_0x101ab2){_0x20d32e[_0x65ee('0x18')]=_0x101ab2;if(_0x20d32e['interaction'][_0x65ee('0x60')]){return db[_0x65ee('0x61')][_0x65ee('0x34')]({'attributes':['id',_0x65ee('0x62')],'where':{'id':_0x20d32e[_0x65ee('0x56')][_0x65ee('0x60')]}})['then'](function(_0x451d3a){if(_0x451d3a){_0x20d32e['applications'][_0x65ee('0x63')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x451d3a[_0x65ee('0x62')]+','+(_0x20d32e[_0x65ee('0x35')][_0x65ee('0x64')]||0xa),'interval':_0x65ee('0x45')});}return respondWithRpcPromise(_0x65ee('0x65'),_0x65ee('0x66'),_0x20d32e);});}return respondWithRpcPromise(_0x65ee('0x65'),_0x65ee('0x66'),_0x20d32e);})['then'](function(_0x31f5f1){_0x42bed0(_0x31f5f1);})[_0x65ee('0x19')](function(_0x242789){_0x259ab8(_0x3b983e['error'](0x1f4,_0x242789[_0x65ee('0x18')]));});});}; \ No newline at end of file +var _0x99d1=['findAll','raw','where','options','attributes','limit','include','map','model','GetMailAccount','debug','catch','ShowMailAccount','MailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','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','account','CmList','List','Applications','MailServerOut','get','omit','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','List\x20not\x20found','contact','messageId','generate','subject','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','update','attach','format','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','ChatOfflineMessageId','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1b7ca4,_0x5b41f1){var _0x13f456=function(_0x3d74b0){while(--_0x3d74b0){_0x1b7ca4['push'](_0x1b7ca4['shift']());}};_0x13f456(++_0x5b41f1);}(_0x99d1,0x197));var _0x199d=function(_0x150548,_0x1edc27){_0x150548=_0x150548-0x0;var _0x1ae3a2=_0x99d1[_0x150548];return _0x1ae3a2;};'use strict';var _=require(_0x199d('0x0'));var util=require(_0x199d('0x1'));var moment=require(_0x199d('0x2'));var BPromise=require(_0x199d('0x3'));var rs=require(_0x199d('0x4'));var fs=require('fs');var Redis=require(_0x199d('0x5'));var db=require(_0x199d('0x6'))['db'];var utils=require(_0x199d('0x7'));var logger=require(_0x199d('0x8'))(_0x199d('0x9'));var config=require(_0x199d('0xa'));var jayson=require(_0x199d('0xb'));var client=jayson[_0x199d('0xc')][_0x199d('0xd')]({'port':0x232c});config['redis']=_[_0x199d('0xe')](config[_0x199d('0xf')],{'host':_0x199d('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x199d('0xf')]));require(_0x199d('0x11'))[_0x199d('0x12')](socket);function respondWithRpcPromise(_0x2b31f3,_0x17db21,_0x3f4c17){return new BPromise(function(_0x594428,_0x4dd1f8){return client['request'](_0x2b31f3,_0x3f4c17)[_0x199d('0x13')](function(_0x56e077){logger[_0x199d('0x14')](_0x199d('0x15'),_0x17db21,_0x199d('0x16'));logger['debug'](_0x199d('0x17'),_0x17db21,'request\x20sent',JSON[_0x199d('0x18')](_0x56e077));if(_0x56e077['error']){if(_0x56e077[_0x199d('0x19')][_0x199d('0x1a')]===0x1f4){logger[_0x199d('0x19')]('MailAccount,\x20%s,\x20%s',_0x17db21,_0x56e077[_0x199d('0x19')][_0x199d('0x1b')]);return _0x4dd1f8(_0x56e077[_0x199d('0x19')][_0x199d('0x1b')]);}logger[_0x199d('0x19')]('MailAccount,\x20%s,\x20%s',_0x17db21,_0x56e077[_0x199d('0x19')][_0x199d('0x1b')]);return _0x594428(_0x56e077[_0x199d('0x19')][_0x199d('0x1b')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x17db21,'request\x20sent');_0x594428(_0x56e077[_0x199d('0x1c')][_0x199d('0x1b')]);}})['catch'](function(_0x3cce1b){logger['error'](_0x199d('0x15'),_0x17db21,_0x3cce1b);_0x4dd1f8(_0x3cce1b);});});}exports['GetMailAccount']=function(_0x24a0c6){var _0x327d80=this;return new Promise(function(_0x41421e,_0x26bd39){return db['MailAccount'][_0x199d('0x1d')]({'raw':_0x24a0c6['options']?_0x24a0c6['options'][_0x199d('0x1e')]===undefined?!![]:![]:!![],'where':_0x24a0c6['options']?_0x24a0c6['options'][_0x199d('0x1f')]||null:null,'attributes':_0x24a0c6[_0x199d('0x20')]?_0x24a0c6['options'][_0x199d('0x21')]||null:null,'limit':_0x24a0c6[_0x199d('0x20')]?_0x24a0c6['options'][_0x199d('0x22')]||null:null,'include':_0x24a0c6[_0x199d('0x20')]?_0x24a0c6['options'][_0x199d('0x23')]?_[_0x199d('0x24')](_0x24a0c6[_0x199d('0x20')][_0x199d('0x23')],function(_0x8fc865){return{'model':db[_0x8fc865[_0x199d('0x25')]],'as':_0x8fc865['as'],'attributes':_0x8fc865[_0x199d('0x21')],'include':_0x8fc865[_0x199d('0x23')]?_[_0x199d('0x24')](_0x8fc865[_0x199d('0x23')],function(_0x3d3b55){return{'model':db[_0x3d3b55[_0x199d('0x25')]],'as':_0x3d3b55['as'],'attributes':_0x3d3b55[_0x199d('0x21')],'include':_0x3d3b55[_0x199d('0x23')]?_[_0x199d('0x24')](_0x3d3b55['include'],function(_0x121397){return{'model':db[_0x121397['model']],'as':_0x121397['as'],'attributes':_0x121397[_0x199d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x199d('0x13')](function(_0x18b91e){logger[_0x199d('0x14')](_0x199d('0x26'),_0x24a0c6);logger[_0x199d('0x27')](_0x199d('0x26'),_0x24a0c6,JSON[_0x199d('0x18')](_0x18b91e));_0x41421e(_0x18b91e);})[_0x199d('0x28')](function(_0x1b7a52){logger[_0x199d('0x19')](_0x199d('0x26'),_0x1b7a52[_0x199d('0x1b')],_0x24a0c6);_0x26bd39(_0x327d80[_0x199d('0x19')](0x1f4,_0x1b7a52['message']));});});};exports[_0x199d('0x29')]=function(_0x1f19ae){var _0x286cd5=this;return new Promise(function(_0x6435db,_0x4e2dbb){return db[_0x199d('0x2a')][_0x199d('0x2b')]({'raw':_0x1f19ae[_0x199d('0x20')]?_0x1f19ae['options']['raw']===undefined?!![]:![]:!![],'where':_0x1f19ae['options']?_0x1f19ae[_0x199d('0x20')]['where']||null:null,'attributes':_0x1f19ae['options']?_0x1f19ae[_0x199d('0x20')][_0x199d('0x21')]||null:null,'include':_0x1f19ae['options']?_0x1f19ae[_0x199d('0x20')][_0x199d('0x23')]?_['map'](_0x1f19ae[_0x199d('0x20')][_0x199d('0x23')],function(_0x2cd314){return{'model':db[_0x2cd314[_0x199d('0x25')]],'as':_0x2cd314['as'],'attributes':_0x2cd314[_0x199d('0x21')],'include':_0x2cd314[_0x199d('0x23')]?_[_0x199d('0x24')](_0x2cd314[_0x199d('0x23')],function(_0x42f838){return{'model':db[_0x42f838['model']],'as':_0x42f838['as'],'attributes':_0x42f838[_0x199d('0x21')],'include':_0x42f838[_0x199d('0x23')]?_[_0x199d('0x24')](_0x42f838['include'],function(_0x2e7874){return{'model':db[_0x2e7874['model']],'as':_0x2e7874['as'],'attributes':_0x2e7874[_0x199d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x199d('0x13')](function(_0x243caa){logger['info'](_0x199d('0x29'),_0x1f19ae);logger[_0x199d('0x27')]('ShowMailAccount',_0x1f19ae,JSON['stringify'](_0x243caa));_0x6435db(_0x243caa);})[_0x199d('0x28')](function(_0x3a72f9){logger[_0x199d('0x19')](_0x199d('0x29'),_0x3a72f9[_0x199d('0x1b')],_0x1f19ae);_0x4e2dbb(_0x286cd5[_0x199d('0x19')](0x1f4,_0x3a72f9['message']));});});};exports[_0x199d('0x2c')]=function(_0xf8ec8d){var _0x2d5951=this;return new Promise(function(_0x3fc976,_0x5c449f){var _0x333e0b={'body':_0xf8ec8d[_0x199d('0x2d')],'channel':_0x199d('0x2e')};var _0xd6beda=_[_0x199d('0x2f')](_[_0x199d('0x30')](db[_0x199d('0x31')][_0x199d('0x32')]),[_0x199d('0x33'),_0x199d('0x34'),'CompanyId',_0x199d('0x35')]);var _0x59c9b3=![];if(_0xf8ec8d[_0x199d('0x2d')]['id']){delete _0xf8ec8d[_0x199d('0x2d')]['id'];}if(_[_0x199d('0x36')](_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x37')])){return _0x5c449f(_0x2d5951[_0x199d('0x19')](0x1f4,_0x199d('0x38')));}if(_['isNil'](_0xf8ec8d['body'][_0x199d('0x2d')])||_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x2d')]===''){return _0x5c449f(_0x2d5951[_0x199d('0x19')](0x1f4,_0x199d('0x39')));}if(_['isNil'](_0xf8ec8d['body'][_0x199d('0x3a')])){return _0x5c449f(_0x2d5951[_0x199d('0x19')](0x1f4,_0x199d('0x3b')+_0xd6beda));}if(!_['includes'](_0xd6beda,_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x3a')])){return _0x5c449f(_0x2d5951['error'](0x1f4,_0x199d('0x3c')+_0xd6beda));}var _0x4bbeac={};_0x4bbeac[_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x3a')]]=_0xf8ec8d[_0x199d('0x2d')]['from'];return db[_0x199d('0x2a')][_0x199d('0x2b')]({'where':{'id':_0xf8ec8d[_0x199d('0x3d')]['id']},'include':[{'model':db[_0x199d('0x3e')],'as':_0x199d('0x3f'),'include':[{'model':db[_0x199d('0x31')],'as':'Contacts','where':_0x4bbeac,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['MailApplication'],'as':_0x199d('0x40')},{'model':db[_0x199d('0x41')],'as':'Smtp'}]})[_0x199d('0x13')](function(_0x5f2a61){if(_0x5f2a61&&_0x5f2a61[_0x199d('0x3f')]){var _0x12b450=_0x5f2a61[_0x199d('0x42')]({'plain':!![]});_0x333e0b[_0x199d('0x3d')]=_[_0x199d('0x43')](_0x12b450,[_0x199d('0x40'),_0x199d('0x3f')]);_0x333e0b[_0x199d('0x44')]=_0x12b450[_0x199d('0x40')];_0x333e0b['list']=_0x12b450['List'];_0x333e0b['applications']=_[_0x199d('0x45')](_0x333e0b[_0x199d('0x44')],[_0x199d('0x46')],[_0x199d('0x47')]);if(_0x333e0b['account']&&_0x333e0b[_0x199d('0x3d')][_0x199d('0x48')]){_0x333e0b[_0x199d('0x44')][_0x199d('0x49')]({'id':0x0,'priority':_0x333e0b[_0x199d('0x44')][_0x199d('0x4a')]+0x1,'app':_0x199d('0x4b'),'appdata':_0x199d('0x48'),'interval':_0x199d('0x4c')});}if(_0x333e0b[_0x199d('0x3d')][_0x199d('0x40')]){delete _0x333e0b['account'][_0x199d('0x40')];}if(_0x333e0b['account'][_0x199d('0x3f')]){delete _0x333e0b[_0x199d('0x3d')]['List'];}if(_0x12b450[_0x199d('0x3f')][_0x199d('0x4d')][_0x199d('0x4a')]){return _0x12b450[_0x199d('0x3f')]['Contacts'][0x0];}var _0x15b96c=_[_0x199d('0xe')](_0xf8ec8d[_0x199d('0x2d')],{'firstName':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x37')],'ListId':_0x12b450[_0x199d('0x35')]});_0x15b96c[_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x3a')]]=_0xf8ec8d['body'][_0x199d('0x37')];return db[_0x199d('0x31')][_0x199d('0x4e')](_0x15b96c);}else{throw new Error(_0x199d('0x4f'));}})[_0x199d('0x13')](function(_0x6310bf){_0x333e0b[_0x199d('0x50')]=_0x6310bf;if(_0x6310bf){if(!_0xf8ec8d[_0x199d('0x2d')]['message']['messageId']){_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x51')]=rs[_0x199d('0x52')]()+'\x20'+_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x37')];}var _0xc81679={'ContactId':_0x6310bf['id'],'MailAccountId':_0xf8ec8d[_0x199d('0x3d')]['id'],'inReplyTo':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')]['messageId'],'to':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')]['from'],'cc':_0xf8ec8d[_0x199d('0x2d')]['message']['cc'],'subject':_0xf8ec8d['body']['message'][_0x199d('0x53')],'attach':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')]['attach'],'lastMsgAt':moment()['format'](_0x199d('0x54')),'lastMsgDirection':'in'};return db[_0x199d('0x55')]['find']({'where':{'closed':![],'MailAccountId':_0xf8ec8d[_0x199d('0x3d')]['id']},'include':[{'model':db[_0x199d('0x56')],'as':_0x199d('0x57'),'attributes':['messageId'],'where':{'messageId':_0xf8ec8d['body'][_0x199d('0x1b')][_0x199d('0x58')]}}]})[_0x199d('0x13')](function(_0x3da378){if(_0x3da378){return[_0x3da378,![]];}return db['MailInteraction'][_0x199d('0x4e')](_0xc81679)['then'](function(_0x578206){return[_0x578206,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x5933a8,_0x3b3645){if(_0x5933a8){_0x59c9b3=_0x3b3645;if(!_0x3b3645){return _0x5933a8[_0x199d('0x59')]({'inReplyTo':_0xf8ec8d['body'][_0x199d('0x1b')][_0x199d('0x51')],'to':_0xf8ec8d['body'][_0x199d('0x1b')]['from'],'cc':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')]['cc'],'subject':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x53')],'attach':_0x5933a8[_0x199d('0x5a')]?_0x5933a8[_0x199d('0x5a')]:_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x5a')],'substatus':null,'substatusAt':moment()[_0x199d('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x199d('0x5b')](_0x199d('0x54')),'lastMsgDirection':'in'});}else{return _0x5933a8;}}})['then'](function(_0x4f3dc8){_0x333e0b[_0x199d('0x5c')]=_0x4f3dc8['get']({'plain':!![]});_0x333e0b['interaction'][_0x199d('0x5d')]=_0x59c9b3;return db[_0x199d('0x56')][_0x199d('0x4e')]({'body':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x2d')],'MailAccountId':_0xf8ec8d['account']['id'],'MailInteractionId':_0x4f3dc8['id'],'direction':'in','ContactId':_0x333e0b[_0x199d('0x50')]['id'],'messageId':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x51')],'from':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x37')],'to':_0xf8ec8d['body'][_0x199d('0x1b')]['to'],'cc':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')]['cc'],'subject':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x53')],'attach':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x5a')],'Attachments':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x5e')],'originTo':_0xf8ec8d[_0x199d('0x2d')]['message'][_0x199d('0x5f')],'originCc':_0xf8ec8d['body']['message'][_0x199d('0x60')],'bcc':_0xf8ec8d['body'][_0x199d('0x1b')][_0x199d('0x61')],'ChatWebsiteId':_0xf8ec8d['body']['message'][_0x199d('0x62')]||null,'originChannel':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')]['originChannel']||'Email','ChatOfflineMessageId':_0xf8ec8d[_0x199d('0x2d')][_0x199d('0x1b')][_0x199d('0x63')]||null},{'include':[{'model':db['Attachment'],'as':_0x199d('0x64')}]});})[_0x199d('0x13')](function(_0x15d7f2){_0x333e0b[_0x199d('0x1b')]=_0x15d7f2;if(_0x333e0b[_0x199d('0x5c')][_0x199d('0x65')]){return db[_0x199d('0x66')][_0x199d('0x2b')]({'attributes':['id',_0x199d('0x67')],'where':{'id':_0x333e0b[_0x199d('0x5c')][_0x199d('0x65')]}})[_0x199d('0x13')](function(_0x436e7c){if(_0x436e7c){_0x333e0b[_0x199d('0x44')][_0x199d('0x68')]({'id':0x0,'priority':0x0,'app':_0x199d('0x69'),'appdata':_0x436e7c[_0x199d('0x67')]+','+(_0x333e0b[_0x199d('0x3d')][_0x199d('0x6a')]||0xa),'interval':_0x199d('0x4c')});}return respondWithRpcPromise('Start',_0x199d('0x6b'),_0x333e0b);});}return respondWithRpcPromise(_0x199d('0x6c'),'startRouting',_0x333e0b);})['then'](function(_0x172d93){_0x3fc976(_0x172d93);})[_0x199d('0x28')](function(_0x1241ef){_0x5c449f(_0x2d5951[_0x199d('0x19')](0x1f4,_0x1241ef['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 8e253ca..40f6ca2 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 _0x17b1=['register','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x17b1,0x7a));var _0x117b=function(_0x227cfb,_0x4f42cf){_0x227cfb=_0x227cfb-0x0;var _0x131407=_0x17b1[_0x227cfb];return _0x131407;};'use strict';var MailAccountEvents=require(_0x117b('0x0'));var events=[_0x117b('0x1'),_0x117b('0x2'),_0x117b('0x3')];function createListener(_0x2d60a1,_0x476c19){return function(_0x1185a3){_0x476c19[_0x117b('0x4')](_0x2d60a1,_0x1185a3);};}function removeListener(_0x54b119,_0xcd802e){return function(){MailAccountEvents[_0x117b('0x5')](_0x54b119,_0xcd802e);};}exports[_0x117b('0x6')]=function(_0x10e9fa){for(var _0x245c96=0x0,_0x2dd4f0=events['length'];_0x245c96<_0x2dd4f0;_0x245c96++){var _0x54edd9=events[_0x245c96];var _0x2e8c3f=createListener(_0x117b('0x7')+_0x54edd9,_0x10e9fa);MailAccountEvents['on'](_0x54edd9,_0x2e8c3f);}}; \ No newline at end of file +var _0x0c0a=['mailAccount:','./mailAccount.events','save','remove','update','emit','length'];(function(_0x5105f4,_0x10ec2d){var _0x3d4eb2=function(_0x5c6cd7){while(--_0x5c6cd7){_0x5105f4['push'](_0x5105f4['shift']());}};_0x3d4eb2(++_0x10ec2d);}(_0x0c0a,0x19e));var _0xa0c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c0a[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0xa0c0('0x0'));var events=[_0xa0c0('0x1'),_0xa0c0('0x2'),_0xa0c0('0x3')];function createListener(_0x2839f7,_0x1b7082){return function(_0x34b089){_0x1b7082[_0xa0c0('0x4')](_0x2839f7,_0x34b089);};}function removeListener(_0x1a197b,_0x394403){return function(){MailAccountEvents['removeListener'](_0x1a197b,_0x394403);};}exports['register']=function(_0x2ee7b1){for(var _0xaf7cda=0x0,_0x1af95b=events[_0xa0c0('0x5')];_0xaf7cda<_0x1af95b;_0xaf7cda++){var _0x1bc2f1=events[_0xaf7cda];var _0x119ce6=createListener(_0xa0c0('0x6')+_0x1bc2f1,_0x2ee7b1);MailAccountEvents['on'](_0x1bc2f1,_0x119ce6);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index cd3a7a0..8264711 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 _0x7aa8=['fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','delete','destroy','multer','path','connect-timeout','Router'];(function(_0x28ec0c,_0x263f61){var _0x5c7c2b=function(_0x4040b2){while(--_0x4040b2){_0x28ec0c['push'](_0x28ec0c['shift']());}};_0x5c7c2b(++_0x263f61);}(_0x7aa8,0x146));var _0x87aa=function(_0x146355,_0x1ba0d7){_0x146355=_0x146355-0x0;var _0x48d2eb=_0x7aa8[_0x146355];return _0x48d2eb;};'use strict';var multer=require(_0x87aa('0x0'));var util=require('util');var path=require(_0x87aa('0x1'));var timeout=require(_0x87aa('0x2'));var express=require('express');var router=express[_0x87aa('0x3')]();var fs_extra=require(_0x87aa('0x4'));var auth=require(_0x87aa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x87aa('0x6'));var controller=require(_0x87aa('0x7'));router[_0x87aa('0x8')](_0x87aa('0x9'),auth[_0x87aa('0xa')](),controller[_0x87aa('0xb')]);router[_0x87aa('0xc')](_0x87aa('0x9'),auth[_0x87aa('0xa')](),controller['update']);router[_0x87aa('0xd')](_0x87aa('0x9'),auth[_0x87aa('0xa')](),controller[_0x87aa('0xe')]);module['exports']=router; \ No newline at end of file +var _0xb1c6=['util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','multer'];(function(_0x15c47b,_0x3278d9){var _0x175969=function(_0x1bf2f6){while(--_0x1bf2f6){_0x15c47b['push'](_0x15c47b['shift']());}};_0x175969(++_0x3278d9);}(_0xb1c6,0x131));var _0x6b1c=function(_0x1b78fc,_0x3d392e){_0x1b78fc=_0x1b78fc-0x0;var _0x5b2f71=_0xb1c6[_0x1b78fc];return _0x5b2f71;};'use strict';var multer=require(_0x6b1c('0x0'));var util=require(_0x6b1c('0x1'));var path=require(_0x6b1c('0x2'));var timeout=require(_0x6b1c('0x3'));var express=require(_0x6b1c('0x4'));var router=express['Router']();var fs_extra=require(_0x6b1c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6b1c('0x6'));var config=require(_0x6b1c('0x7'));var controller=require(_0x6b1c('0x8'));router[_0x6b1c('0x9')](_0x6b1c('0xa'),auth[_0x6b1c('0xb')](),controller[_0x6b1c('0xc')]);router[_0x6b1c('0xd')]('/:id',auth[_0x6b1c('0xb')](),controller[_0x6b1c('0xe')]);router[_0x6b1c('0xf')](_0x6b1c('0xa'),auth[_0x6b1c('0xb')](),controller[_0x6b1c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6ef7ed7..b56b2b8 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 _0x607e=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x607e,0x1c4));var _0xe607=function(_0x5c2c72,_0x22cf09){_0x5c2c72=_0x5c2c72-0x0;var _0x11c44c=_0x607e[_0x5c2c72];return _0x11c44c;};'use strict';var Sequelize=require(_0xe607('0x0'));module[_0xe607('0x1')]={'priority':{'type':Sequelize[_0xe607('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe607('0x3')],'allowNull':![],'defaultValue':_0xe607('0x4')},'appdata':{'type':Sequelize[_0xe607('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe607('0x3')],'defaultValue':_0xe607('0x6')}}; \ No newline at end of file +var _0x662c=['INTEGER','STRING','noop','TEXT','exports'];(function(_0xfa679,_0x37976b){var _0x273afd=function(_0x3812c1){while(--_0x3812c1){_0xfa679['push'](_0xfa679['shift']());}};_0x273afd(++_0x37976b);}(_0x662c,0x1e4));var _0xc662=function(_0x203655,_0x5ab658){_0x203655=_0x203655-0x0;var _0x48a762=_0x662c[_0x203655];return _0x48a762;};'use strict';var Sequelize=require('sequelize');module[_0xc662('0x0')]={'priority':{'type':Sequelize[_0xc662('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc662('0x2')],'allowNull':![],'defaultValue':_0xc662('0x3')},'appdata':{'type':Sequelize[_0xc662('0x4')]()},'description':{'type':Sequelize[_0xc662('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index bd96e2b..7aa4bc4 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x27738a,_0x3b9ff1){var _0x1499e4=function(_0x4d986e){while(--_0x4d986e){_0x27738a['push'](_0x27738a['shift']());}};_0x1499e4(++_0x3b9ff1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file +var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xaa88[_0x2f1762];return _0x8ab21;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 36ba7d7..3498dc9 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 _0x50c9=['exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','../../config/environment','./mailApplication.attributes'];(function(_0x4db7e0,_0x2daee0){var _0x46f087=function(_0x1fc3a7){while(--_0x1fc3a7){_0x4db7e0['push'](_0x4db7e0['shift']());}};_0x46f087(++_0x2daee0);}(_0x50c9,0x10e));var _0x950c=function(_0x416434,_0x183e7a){_0x416434=_0x416434-0x0;var _0x813788=_0x50c9[_0x416434];return _0x813788;};'use strict';var _=require('lodash');var util=require(_0x950c('0x0'));var logger=require(_0x950c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x950c('0x2'));var rp=require(_0x950c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x950c('0x4'));var attributes=require(_0x950c('0x5'));module[_0x950c('0x6')]=function(_0x581bd1,_0x95ff09){return _0x581bd1[_0x950c('0x7')](_0x950c('0x8'),attributes,{'tableName':_0x950c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x950c('0xa'),'collate':_0x950c('0xb')});}; \ No newline at end of file +var _0xaa71=['moment','bluebird','request-promise','path','rimraf','./mailApplication.attributes','exports','MailApplication','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaa71,0x1b6));var _0x1aa7=function(_0x5f2685,_0x87639f){_0x5f2685=_0x5f2685-0x0;var _0x5078f7=_0xaa71[_0x5f2685];return _0x5078f7;};'use strict';var _=require(_0x1aa7('0x0'));var util=require(_0x1aa7('0x1'));var logger=require(_0x1aa7('0x2'))(_0x1aa7('0x3'));var moment=require(_0x1aa7('0x4'));var BPromise=require(_0x1aa7('0x5'));var rp=require(_0x1aa7('0x6'));var fs=require('fs');var path=require(_0x1aa7('0x7'));var rimraf=require(_0x1aa7('0x8'));var config=require('../../config/environment');var attributes=require(_0x1aa7('0x9'));module[_0x1aa7('0xa')]=function(_0x1395e2,_0x3a32a4){return _0x1395e2['define'](_0x1aa7('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1aa7('0xc'),'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 a688e72..07ab53f 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 _0xa962=['MailApplication,\x20%s,\x20%s','result','UpdateMailApplication','MailApplication','update','options','raw','where','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','message'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xa962,0xea));var _0x2a96=function(_0x1e0203,_0x568b28){_0x1e0203=_0x1e0203-0x0;var _0x25ff8c=_0xa962[_0x1e0203];return _0x25ff8c;};'use strict';var _=require(_0x2a96('0x0'));var util=require(_0x2a96('0x1'));var moment=require('moment');var BPromise=require(_0x2a96('0x2'));var rs=require(_0x2a96('0x3'));var fs=require('fs');var Redis=require(_0x2a96('0x4'));var db=require(_0x2a96('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a96('0x6'))(_0x2a96('0x7'));var config=require(_0x2a96('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2a96('0x9')][_0x2a96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dcf0c,_0x60e02,_0x2d3300){return new BPromise(function(_0x5499d6,_0x438363){return client[_0x2a96('0xb')](_0x2dcf0c,_0x2d3300)[_0x2a96('0xc')](function(_0x4d8e6a){logger[_0x2a96('0xd')]('MailApplication,\x20%s,\x20%s',_0x60e02,_0x2a96('0xe'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x60e02,_0x2a96('0xe'),JSON[_0x2a96('0xf')](_0x4d8e6a));if(_0x4d8e6a['error']){if(_0x4d8e6a[_0x2a96('0x10')]['code']===0x1f4){logger[_0x2a96('0x10')]('MailApplication,\x20%s,\x20%s',_0x60e02,_0x4d8e6a[_0x2a96('0x10')][_0x2a96('0x11')]);return _0x438363(_0x4d8e6a[_0x2a96('0x10')]['message']);}logger['error'](_0x2a96('0x12'),_0x60e02,_0x4d8e6a['error'][_0x2a96('0x11')]);return _0x5499d6(_0x4d8e6a[_0x2a96('0x10')]['message']);}else{logger['info'](_0x2a96('0x12'),_0x60e02,'request\x20sent');_0x5499d6(_0x4d8e6a[_0x2a96('0x13')][_0x2a96('0x11')]);}})['catch'](function(_0x3238ad){logger[_0x2a96('0x10')](_0x2a96('0x12'),_0x60e02,_0x3238ad);_0x438363(_0x3238ad);});});}exports[_0x2a96('0x14')]=function(_0x452fee){var _0x59cbe3=this;return new Promise(function(_0x4e07c1,_0x459db5){return db[_0x2a96('0x15')][_0x2a96('0x16')](_0x452fee['body'],{'raw':_0x452fee[_0x2a96('0x17')]?_0x452fee[_0x2a96('0x17')][_0x2a96('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x452fee[_0x2a96('0x17')]?_0x452fee[_0x2a96('0x17')][_0x2a96('0x19')]||null:null,'attributes':_0x452fee['options']?_0x452fee['options']['attributes']||null:null,'limit':_0x452fee[_0x2a96('0x17')]?_0x452fee['options'][_0x2a96('0x1a')]||null:null})[_0x2a96('0xc')](function(_0x2654ab){logger[_0x2a96('0xd')]('UpdateMailApplication',_0x452fee);logger['debug'](_0x2a96('0x14'),_0x452fee,JSON[_0x2a96('0xf')](_0x2654ab));_0x4e07c1(_0x2654ab);})[_0x2a96('0x1b')](function(_0x274b9d){logger[_0x2a96('0x10')](_0x2a96('0x14'),_0x274b9d['message'],_0x452fee);_0x459db5(_0x59cbe3[_0x2a96('0x10')](0x1f4,_0x274b9d[_0x2a96('0x11')]));});});}; \ No newline at end of file +var _0x724e=['MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','MailApplication','body','options','raw','where','attributes','limit','UpdateMailApplication','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailApplication,\x20%s,\x20%s','debug'];(function(_0x32cdf4,_0x22f0c9){var _0x13caa4=function(_0x27b303){while(--_0x27b303){_0x32cdf4['push'](_0x32cdf4['shift']());}};_0x13caa4(++_0x22f0c9);}(_0x724e,0x8c));var _0xe724=function(_0x1ade78,_0x78e6af){_0x1ade78=_0x1ade78-0x0;var _0x3b598a=_0x724e[_0x1ade78];return _0x3b598a;};'use strict';var _=require(_0xe724('0x0'));var util=require('util');var moment=require(_0xe724('0x1'));var BPromise=require(_0xe724('0x2'));var rs=require(_0xe724('0x3'));var fs=require('fs');var Redis=require(_0xe724('0x4'));var db=require(_0xe724('0x5'))['db'];var utils=require(_0xe724('0x6'));var logger=require(_0xe724('0x7'))(_0xe724('0x8'));var config=require(_0xe724('0x9'));var jayson=require(_0xe724('0xa'));var client=jayson[_0xe724('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58bc2e,_0x3e6a00,_0x32a8ef){return new BPromise(function(_0x196ec0,_0x3602d9){return client['request'](_0x58bc2e,_0x32a8ef)['then'](function(_0x1b3cc0){logger[_0xe724('0xc')](_0xe724('0xd'),_0x3e6a00,'request\x20sent');logger[_0xe724('0xe')](_0xe724('0xf'),_0x3e6a00,'request\x20sent',JSON['stringify'](_0x1b3cc0));if(_0x1b3cc0['error']){if(_0x1b3cc0[_0xe724('0x10')][_0xe724('0x11')]===0x1f4){logger[_0xe724('0x10')](_0xe724('0xd'),_0x3e6a00,_0x1b3cc0[_0xe724('0x10')][_0xe724('0x12')]);return _0x3602d9(_0x1b3cc0[_0xe724('0x10')][_0xe724('0x12')]);}logger[_0xe724('0x10')](_0xe724('0xd'),_0x3e6a00,_0x1b3cc0[_0xe724('0x10')]['message']);return _0x196ec0(_0x1b3cc0[_0xe724('0x10')][_0xe724('0x12')]);}else{logger['info'](_0xe724('0xd'),_0x3e6a00,_0xe724('0x13'));_0x196ec0(_0x1b3cc0[_0xe724('0x14')][_0xe724('0x12')]);}})[_0xe724('0x15')](function(_0x46b70b){logger[_0xe724('0x10')](_0xe724('0xd'),_0x3e6a00,_0x46b70b);_0x3602d9(_0x46b70b);});});}exports['UpdateMailApplication']=function(_0x279391){var _0x1cf35e=this;return new Promise(function(_0x45bdaa,_0x52ec85){return db[_0xe724('0x16')]['update'](_0x279391[_0xe724('0x17')],{'raw':_0x279391[_0xe724('0x18')]?_0x279391[_0xe724('0x18')][_0xe724('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x279391[_0xe724('0x18')]?_0x279391['options'][_0xe724('0x1a')]||null:null,'attributes':_0x279391[_0xe724('0x18')]?_0x279391[_0xe724('0x18')][_0xe724('0x1b')]||null:null,'limit':_0x279391['options']?_0x279391['options'][_0xe724('0x1c')]||null:null})['then'](function(_0x552e42){logger[_0xe724('0xc')](_0xe724('0x1d'),_0x279391);logger['debug']('UpdateMailApplication',_0x279391,JSON[_0xe724('0x1e')](_0x552e42));_0x45bdaa(_0x552e42);})['catch'](function(_0x13b406){logger[_0xe724('0x10')](_0xe724('0x1d'),_0x13b406['message'],_0x279391);_0x52ec85(_0x1cf35e[_0xe724('0x10')](0x1f4,_0x13b406[_0xe724('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 9eaf174..caad323 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 _0x637e=['/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x7e557a,_0x3e41ab){var _0x3aba18=function(_0x591db6){while(--_0x591db6){_0x7e557a['push'](_0x7e557a['shift']());}};_0x3aba18(++_0x3e41ab);}(_0x637e,0x136));var _0xe637=function(_0x15bfad,_0x2c44e0){_0x15bfad=_0x15bfad-0x0;var _0x4ab4fa=_0x637e[_0x15bfad];return _0x4ab4fa;};'use strict';var express=require(_0xe637('0x0'));var router=express[_0xe637('0x1')]();var auth=require(_0xe637('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xe637('0x3'));router[_0xe637('0x4')]('/',auth[_0xe637('0x5')](),controller[_0xe637('0x6')]);router[_0xe637('0x4')](_0xe637('0x7'),auth[_0xe637('0x5')](),controller[_0xe637('0x8')]);router[_0xe637('0x4')](_0xe637('0x9'),auth[_0xe637('0x5')](),controller[_0xe637('0xa')]);router[_0xe637('0x4')](_0xe637('0xb'),auth[_0xe637('0x5')](),controller[_0xe637('0xc')]);router[_0xe637('0x4')](_0xe637('0xd'),auth[_0xe637('0x5')](),controller[_0xe637('0xe')]);router[_0xe637('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe637('0xf')](_0xe637('0xb'),auth[_0xe637('0x5')](),controller[_0xe637('0x10')]);router['post'](_0xe637('0x11'),auth['isAuthenticated'](),interaction[_0xe637('0x12')]('mail',_0xe637('0x13')),controller['addTags']);router[_0xe637('0x14')](_0xe637('0x9'),auth[_0xe637('0x5')](),interaction[_0xe637('0x12')](_0xe637('0x15'),_0xe637('0x16')),controller[_0xe637('0x17')]);router[_0xe637('0x18')](_0xe637('0x9'),auth['isAuthenticated'](),interaction[_0xe637('0x12')]('mail',_0xe637('0x19')),controller[_0xe637('0x1a')]);router['delete'](_0xe637('0x11'),auth[_0xe637('0x5')](),controller[_0xe637('0x1b')]);module[_0xe637('0x1c')]=router; \ No newline at end of file +var _0x98e2=['put','tracked','mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags'];(function(_0x54d197,_0x5c5884){var _0x5aa343=function(_0x3a63ed){while(--_0x3a63ed){_0x54d197['push'](_0x54d197['shift']());}};_0x5aa343(++_0x5c5884);}(_0x98e2,0x1b8));var _0x298e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x98e2[_0x321bb2];return _0x9c12ed;};'use strict';var express=require('express');var router=express[_0x298e('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x298e('0x1'));var controller=require(_0x298e('0x2'));router[_0x298e('0x3')]('/',auth[_0x298e('0x4')](),controller[_0x298e('0x5')]);router[_0x298e('0x3')]('/describe',auth['isAuthenticated'](),controller[_0x298e('0x6')]);router[_0x298e('0x3')](_0x298e('0x7'),auth[_0x298e('0x4')](),controller[_0x298e('0x8')]);router[_0x298e('0x3')]('/:id/messages',auth['isAuthenticated'](),controller[_0x298e('0x9')]);router[_0x298e('0x3')]('/:id/download',auth[_0x298e('0x4')](),controller[_0x298e('0xa')]);router[_0x298e('0xb')]('/',auth[_0x298e('0x4')](),controller[_0x298e('0xc')]);router[_0x298e('0xb')](_0x298e('0xd'),auth[_0x298e('0x4')](),controller[_0x298e('0xe')]);router['post'](_0x298e('0xf'),auth[_0x298e('0x4')](),interaction['tracked'](_0x298e('0x10'),_0x298e('0x11')),controller[_0x298e('0x12')]);router[_0x298e('0x13')](_0x298e('0x7'),auth[_0x298e('0x4')](),interaction[_0x298e('0x14')](_0x298e('0x10'),_0x298e('0x15')),controller['update']);router[_0x298e('0x16')](_0x298e('0x7'),auth[_0x298e('0x4')](),interaction['tracked'](_0x298e('0x10'),_0x298e('0x17')),controller[_0x298e('0x18')]);router[_0x298e('0x16')]('/:id/tags',auth['isAuthenticated'](),controller[_0x298e('0x19')]);module[_0x298e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 454af61..cbadbfc 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 _0xf0b1=['BOOLEAN','DATE','STRING','long','TEXT','out','ENUM','sequelize','iconv','exports'];(function(_0x1073d5,_0x1e1cee){var _0x2752e0=function(_0x3ea796){while(--_0x3ea796){_0x1073d5['push'](_0x1073d5['shift']());}};_0x2752e0(++_0x1e1cee);}(_0xf0b1,0xcf));var _0x1f0b=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf0b1[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0x1f0b('0x0'));var iconv=require(_0x1f0b('0x1'));module[_0x1f0b('0x2')]={'closed':{'type':Sequelize[_0x1f0b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1f0b('0x4')]},'disposition':{'type':Sequelize[_0x1f0b('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1f0b('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x1f0b('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x1f0b('0x6'))},'subject':{'type':Sequelize[_0x1f0b('0x7')]()},'attach':{'type':Sequelize[_0x1f0b('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x1f0b('0x4')]},'substatus':{'type':Sequelize[_0x1f0b('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x1f0b('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1f0b('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1f0b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x1f0b('0x9')]('in',_0x1f0b('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa4e8=['long','out','ENUM','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0xa81117,_0x356201){var _0x4df5b5=function(_0x86e567){while(--_0x86e567){_0xa81117['push'](_0xa81117['shift']());}};_0x4df5b5(++_0x356201);}(_0xa4e8,0xfd));var _0x8a4e=function(_0x4b575e,_0x73b44d){_0x4b575e=_0x4b575e-0x0;var _0x3099a6=_0xa4e8[_0x4b575e];return _0x3099a6;};'use strict';var Sequelize=require(_0x8a4e('0x0'));var iconv=require(_0x8a4e('0x1'));module[_0x8a4e('0x2')]={'closed':{'type':Sequelize[_0x8a4e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8a4e('0x4')]},'disposition':{'type':Sequelize[_0x8a4e('0x5')]},'secondDisposition':{'type':Sequelize[_0x8a4e('0x5')]},'thirdDisposition':{'type':Sequelize[_0x8a4e('0x5')]},'note':{'type':Sequelize[_0x8a4e('0x5')]},'inReplyTo':{'type':Sequelize[_0x8a4e('0x5')](0x1fe)},'to':{'type':Sequelize[_0x8a4e('0x5')]},'cc':{'type':Sequelize[_0x8a4e('0x6')](_0x8a4e('0x7'))},'subject':{'type':Sequelize[_0x8a4e('0x6')]()},'attach':{'type':Sequelize[_0x8a4e('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8a4e('0x4')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x8a4e('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8a4e('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8a4e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x8a4e('0x9')]('in',_0x8a4e('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8a4e('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 7837fec..16a6267 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 _0x5bc1=['total','index','MailInteraction','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.ContactId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','all','rows','show','params','rawAttributes','include','merge','options','create','body','destroy','describe','addMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','inlineCss','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','root','server','join','files','attachments','transcript-%d-%s.zip','Attachments','Messages','subject','get','mkdirSync','decode','bcc','headers','existsSync','readFileSync','build','writeFileSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','trimStart','catch','waiting','talking','answered','unmanaged','closed','UserId'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x5bc1,0xb5));var _0x15bc=function(_0x484fae,_0x37c7ed){_0x484fae=_0x484fae-0x0;var _0x2df2a7=_0x5bc1[_0x484fae];return _0x2df2a7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15bc('0x0'));var zipdir=require(_0x15bc('0x1'));var moment=require(_0x15bc('0x2'));var BPromise=require(_0x15bc('0x3'));var util=require(_0x15bc('0x4'));var path=require(_0x15bc('0x5'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var juice=require(_0x15bc('0x6'));var Redis=require(_0x15bc('0x7'));var qs=require(_0x15bc('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x15bc('0x9'))('api');var config=require(_0x15bc('0xa'));var db=require(_0x15bc('0xb'))['db'];var htmlEntities=require(_0x15bc('0xc'));config[_0x15bc('0xd')]=_[_0x15bc('0xe')](config[_0x15bc('0xd')],{'host':_0x15bc('0xf'),'port':0x18eb});var socket=require(_0x15bc('0x10'))(new Redis(config[_0x15bc('0xd')]));require(_0x15bc('0x11'))['register'](socket);function respondWithStatusCode(_0x18b502,_0xa70bc9){_0xa70bc9=_0xa70bc9||0xcc;return function(_0xa048f5){if(_0xa048f5){return _0x18b502['sendStatus'](_0xa70bc9);}return _0x18b502[_0x15bc('0x12')](_0xa70bc9)[_0x15bc('0x13')]();};}function respondWithResult(_0x37ab83,_0xba239f){_0xba239f=_0xba239f||0xc8;return function(_0x561881){if(_0x561881){return _0x37ab83[_0x15bc('0x12')](_0xba239f)[_0x15bc('0x14')](_0x561881);}};}function respondWithFilteredResult(_0x2a42c6,_0x2aa855){return function(_0x3cfbe6){if(_0x3cfbe6){var _0x3f546b=typeof _0x2aa855[_0x15bc('0x15')]===_0x15bc('0x16')&&typeof _0x2aa855[_0x15bc('0x17')]===_0x15bc('0x16');var _0x41484d=_0x3cfbe6[_0x15bc('0x18')];var _0x947132=_0x3f546b?0x0:_0x2aa855[_0x15bc('0x15')];var _0x5599a2=_0x3f546b?_0x3cfbe6[_0x15bc('0x18')]:_0x2aa855[_0x15bc('0x15')]+_0x2aa855[_0x15bc('0x17')];var _0xc067ee;if(_0x5599a2>=_0x41484d){_0x5599a2=_0x41484d;_0xc067ee=0xc8;}else{_0xc067ee=0xce;}_0x2a42c6[_0x15bc('0x12')](_0xc067ee);return _0x2a42c6[_0x15bc('0x19')](_0x15bc('0x1a'),_0x947132+'-'+_0x5599a2+'/'+_0x41484d)[_0x15bc('0x14')](_0x3cfbe6);}return null;};}function saveUpdates(_0x2cab32){return function(_0x39baaf){if(_0x39baaf){return _0x39baaf[_0x15bc('0x1b')](_0x2cab32)['then'](function(_0x3c6bb8){return _0x3c6bb8;});}return null;};}function removeEntity(_0x5524d9){return function(_0x11c5d8){if(_0x11c5d8){return _0x11c5d8['destroy']()[_0x15bc('0x1c')](function(){_0x5524d9[_0x15bc('0x12')](0xcc)[_0x15bc('0x13')]();});}};}function handleEntityNotFound(_0x4b29f0){return function(_0x367736){if(!_0x367736){_0x4b29f0['sendStatus'](0x194);}return _0x367736;};}function handleError(_0x31ed06,_0x2bebcc){_0x2bebcc=_0x2bebcc||0x1f4;return function(_0x27c83e){logger[_0x15bc('0x1d')](_0x27c83e[_0x15bc('0x1e')]);if(_0x27c83e[_0x15bc('0x1f')]){delete _0x27c83e[_0x15bc('0x1f')];}_0x31ed06[_0x15bc('0x12')](_0x2bebcc)['send'](_0x27c83e);};}function getInteractionUsers(_0x34be92,_0x1cbb03){return new BPromise(function(_0x229aee,_0xbacc26){try{if(_0x1cbb03[_0x34be92['id']]){_0x34be92['Users']=_[_0x15bc('0x20')](_0x1cbb03[_0x34be92['id']],function(_0x23a3d9){return{'id':_0x23a3d9['id'],'fullname':_0x23a3d9[_0x15bc('0x21')]};});}}catch(_0x1c91b7){_0xbacc26(_0x1c91b7);}_0x229aee(_0x34be92);});}function getInteractionTags(_0x4d0608,_0x55c431){return new BPromise(function(_0x423622,_0x5f3985){try{if(_0x4d0608[_0x15bc('0x22')]){_0x4d0608[_0x15bc('0x23')]=[];_0x4d0608[_0x15bc('0x22')][_0x15bc('0x24')](',')[_0x15bc('0x25')](function(_0x85fc9e){_0x4d0608[_0x15bc('0x23')][_0x15bc('0x26')](_0x55c431[_0x85fc9e]);});}delete _0x4d0608['TagIds'];}catch(_0x4146ab){_0x5f3985(_0x4146ab);}_0x423622(_0x4d0608);});}function getLastMessageText(_0x3cddec){return new BPromise(function(_0x4405ea,_0x2d3d3f){return db[_0x15bc('0x27')][_0x15bc('0x28')]({'where':{'$and':[{'MailInteractionId':_0x3cddec['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x15bc('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x15bc('0x2a')],'order':_0x15bc('0x2b'),'raw':!![]})[_0x15bc('0x1c')](function(_0x497590){if(_0x497590&&_0x497590[_0x15bc('0x2a')]){_0x3cddec['lastMsgText']=_[_0x15bc('0x2c')](_0x497590[_0x15bc('0x2a')]);}_0x4405ea(_0x3cddec);})['catch'](function(_0x4e78f3){_0x2d3d3f(_0x4e78f3);});});}function updateMailInteraction(_0x2645d5,_0x39369b,_0x567dab,_0x524360){return new BPromise(function(_0x72447c,_0x1a88e8){return getInteractionUsers(_0x2645d5,_0x567dab)[_0x15bc('0x1c')](function(_0x398cd8){return getInteractionTags(_0x398cd8,_0x39369b);})['then'](function(_0x32705f){return getStateInteraction(_0x32705f);})[_0x15bc('0x1c')](function(_0x5c1c8a){if(_0x524360){_0x72447c(getLastMessageText(_0x5c1c8a));}else{_0x72447c(_0x5c1c8a);}})[_0x15bc('0x2d')](function(_0x37f6bc){_0x1a88e8(_0x37f6bc);});});}function getStateInteraction(_0x197b06){return new BPromise(function(_0x469cbe){_0x197b06[_0x15bc('0x2e')]=0x0;_0x197b06[_0x15bc('0x2f')]=0x0;_0x197b06[_0x15bc('0x30')]=0x0;_0x197b06[_0x15bc('0x31')]=0x0;_0x197b06['total']=0x0;if(!_0x197b06[_0x15bc('0x32')]&&!_0x197b06[_0x15bc('0x33')]){_0x197b06[_0x15bc('0x2e')]+=0x1;}if(!_0x197b06[_0x15bc('0x32')]&&_0x197b06['UserId']){_0x197b06['talking']+=0x1;if(_0x197b06[_0x15bc('0x2e')]){_0x197b06['waiting']-=0x1;}}if(_0x197b06[_0x15bc('0x32')]&&_0x197b06[_0x15bc('0x33')]){_0x197b06[_0x15bc('0x30')]+=0x1;if(_0x197b06[_0x15bc('0x2f')]){_0x197b06['talking']-=0x1;}}if(_0x197b06[_0x15bc('0x32')]&&!_0x197b06[_0x15bc('0x33')]){_0x197b06[_0x15bc('0x31')]+=0x1;if(_0x197b06[_0x15bc('0x2e')]){_0x197b06[_0x15bc('0x2e')]-=0x1;}}_0x197b06[_0x15bc('0x34')]+=0x1;_0x469cbe(_0x197b06);});}exports[_0x15bc('0x35')]=function(_0x5aa74d,_0x59abcd){var _0x4aff84={},_0x15711b={},_0x5f2ac2={'count':0x0,'rows':[]};var _0x21d3e7=_['map'](db[_0x15bc('0x36')]['rawAttributes'],function(_0xfca4e5){return{'name':_0xfca4e5['fieldName'],'type':_0xfca4e5[_0x15bc('0x37')][_0x15bc('0x38')]};});_0x15711b[_0x15bc('0x39')]=_[_0x15bc('0x20')](_0x21d3e7,'name');_0x15711b[_0x15bc('0x3a')]=_[_0x15bc('0x3b')](_0x5aa74d[_0x15bc('0x3a')]);_0x15711b['filters']=_[_0x15bc('0x3c')](_0x15711b[_0x15bc('0x39')],_0x15711b[_0x15bc('0x3a')]);_0x4aff84['attributes']=_[_0x15bc('0x3c')](_0x15711b[_0x15bc('0x39')],qs[_0x15bc('0x3d')](_0x5aa74d['query']['fields']));_0x4aff84[_0x15bc('0x3e')]=_0x4aff84[_0x15bc('0x3e')][_0x15bc('0x3f')]?_0x4aff84[_0x15bc('0x3e')]:_0x15711b['model'];if(!_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x40')](_0x15bc('0x41'))){_0x4aff84[_0x15bc('0x17')]=qs[_0x15bc('0x17')](_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x17')]);_0x4aff84[_0x15bc('0x15')]=qs[_0x15bc('0x15')](_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x15')]);}_0x4aff84['order']=qs[_0x15bc('0x42')](_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x42')]);_0x4aff84[_0x15bc('0x43')]=qs[_0x15bc('0x44')](_['pick'](_0x5aa74d[_0x15bc('0x3a')],_0x15711b[_0x15bc('0x44')]),_0x21d3e7);var _0x15651b=[];var _0x51cc41=squel[_0x15bc('0x45')]()[_0x15bc('0x46')]('id')['field']('name')[_0x15bc('0x46')](_0x15bc('0x47'))[_0x15bc('0x48')](_0x15bc('0x49'));var _0x30bed2=squel[_0x15bc('0x45')]()[_0x15bc('0x46')](_0x15bc('0x4a'))[_0x15bc('0x46')](_0x15bc('0x4b'))[_0x15bc('0x46')](_0x15bc('0x4c'))['from'](_0x15bc('0x4d'),'ui')[_0x15bc('0x4e')](_0x15bc('0x4f'),'u',_0x15bc('0x50'));var _0x302e5a=squel[_0x15bc('0x45')]()[_0x15bc('0x48')]('mail_interactions','i')[_0x15bc('0x4e')](_0x15bc('0x51'),'c',_0x15bc('0x52'))[_0x15bc('0x4e')](_0x15bc('0x4f'),'o',_0x15bc('0x53'))[_0x15bc('0x4e')]('mail_accounts','a',_0x15bc('0x54'))['left_join'](_0x15bc('0x55'),'me',_0x15bc('0x56'))[_0x15bc('0x4e')](_0x15bc('0x57'),'it',_0x15bc('0x58'))[_0x15bc('0x4e')](_0x15bc('0x49'),'t',_0x15bc('0x59'));var _0x26bb42=squel[_0x15bc('0x5a')]();var _0x342267=[];var _0x31b930=squel[_0x15bc('0x5a')]();var _0x489291;if(_0x5aa74d['query'][_0x15bc('0x5b')]){_0x489291=as[_0x15bc('0x5c')](_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x5b')]);var _0x149e63=_0x489291['sqlOperator'];for(var _0x285e33=0x0;_0x285e33<_0x489291[_0x15bc('0x5d')]['length'];_0x285e33++){var _0x5d9a7e=_0x489291[_0x15bc('0x5d')][_0x285e33];var _0x283e49='i';var _0x5c0a9c=_[_0x15bc('0x5e')](_0x21d3e7,[_0x15bc('0x1f'),_0x5d9a7e[_0x15bc('0x46')]]);if(!_0x5c0a9c){switch(_0x5d9a7e[_0x15bc('0x46')]){case _0x15bc('0x5f'):if(_0x5d9a7e['value']==0x1){_0x302e5a['having']('`'+_0x5d9a7e['field']+_0x15bc('0x60'));}else{_0x302e5a[_0x15bc('0x61')]('`'+_0x5d9a7e['field']+'`\x20>\x200');}break;case _0x15bc('0x62'):if(_0x5d9a7e[_0x15bc('0x63')]==='$substring'){if(_0x5d9a7e[_0x15bc('0x64')][_0x15bc('0x24')]('\x20')[_0x15bc('0x3f')]>0x1){_0x26bb42[_0x149e63]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x15bc('0x65')](_0x5d9a7e[_0x15bc('0x64')]),null);}else{var _0x3df9b2='%'+_0x5d9a7e[_0x15bc('0x64')]+'%';_0x26bb42[_0x149e63](_0x15bc('0x66'),_0x3df9b2,_0x3df9b2,_0x3df9b2);}}else{_0x5c0a9c=_[_0x15bc('0x5e')](_0x21d3e7,[_0x15bc('0x1f'),_0x15bc('0x67')]);_0x5d9a7e['field']=_0x15bc('0x67');_0x5b5d3f=as[_0x15bc('0x68')](_0x283e49,_0x5c0a9c['type'],_0x5d9a7e);_0x26bb42[_0x149e63](_0x5b5d3f[_0x15bc('0x69')],_0x5b5d3f[_0x15bc('0x64')][_0x15bc('0x6a')],_0x5b5d3f['value'][_0x15bc('0x13')]);}break;case _0x15bc('0x6b'):var _0x379e57=_0x5d9a7e[_0x15bc('0x64')]['split'](',')[_0x15bc('0x20')](function(_0x4324b8){return Number(_0x4324b8);});_0x379e57['forEach'](function(_0xdbb002){_0x31b930['or'](_0x15bc('0x6c'),'%,'+_0xdbb002+',%');});_0x342267=_[_0x15bc('0x6d')](_0x342267,_0x379e57);break;case _0x15bc('0x6e'):if(_0x5d9a7e[_0x15bc('0x63')]==='$substring'){_0x26bb42[_0x149e63](_0x15bc('0x6f'),'%'+_0x5d9a7e[_0x15bc('0x64')]+'%',null);}else{_0x5c0a9c=_[_0x15bc('0x5e')](_0x21d3e7,[_0x15bc('0x1f'),'UserId']);_0x5d9a7e[_0x15bc('0x46')]='UserId';_0x5b5d3f=as['buildExpression'](_0x283e49,_0x5c0a9c[_0x15bc('0x37')],_0x5d9a7e);_0x26bb42[_0x149e63](_0x5b5d3f[_0x15bc('0x69')],_0x5b5d3f[_0x15bc('0x64')][_0x15bc('0x6a')],_0x5b5d3f[_0x15bc('0x64')][_0x15bc('0x13')]);}break;case _0x15bc('0x2a'):_0x5b5d3f=as[_0x15bc('0x68')]('me',null,_0x5d9a7e);_0x26bb42[_0x149e63](_0x5b5d3f[_0x15bc('0x69')],_0x5b5d3f['value'][_0x15bc('0x6a')],_0x5b5d3f[_0x15bc('0x64')]['end']);break;}}else{var _0x5b5d3f=as['buildExpression'](_0x283e49,_0x5c0a9c[_0x15bc('0x37')],_0x5d9a7e);_0x26bb42[_0x149e63](_0x5b5d3f[_0x15bc('0x69')],_0x5b5d3f[_0x15bc('0x64')][_0x15bc('0x6a')],_0x5b5d3f[_0x15bc('0x64')]['end']);}}}else{var _0xdd1855=_(_0x5aa74d[_0x15bc('0x3a')])['keys']()[_0x15bc('0x20')](function(_0x15121a){return _[_0x15bc('0x70')](_0x21d3e7,[_0x15bc('0x1f'),_0x15121a])?_0x15121a:undefined;})['compact']()['value']();if(!_[_0x15bc('0x71')](_0xdd1855)){_0xdd1855[_0x15bc('0x25')](function(_0x26956c){if(_0x26956c===_0x15bc('0x72')){_0x302e5a[_0x15bc('0x43')](_0x15bc('0x73'),[][_0x15bc('0x74')](_0x5aa74d['query'][_0x26956c]));}else if(_0x26956c===_0x15bc('0x75')){var _0x32db89=JSON[_0x15bc('0x76')](_0x5aa74d['query'][_0x26956c])[_0x15bc('0x77')];var _0x592c7a=JSON['parse'](_0x5aa74d[_0x15bc('0x3a')][_0x26956c])[_0x15bc('0x78')];_0x302e5a[_0x15bc('0x43')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x32db89,_0x592c7a);}else{if(_0x5aa74d[_0x15bc('0x3a')][_0x26956c]===_0x15bc('0x79')){_0x302e5a[_0x15bc('0x43')]('i.'+_0x26956c+_0x15bc('0x7a'));}else{_0x302e5a[_0x15bc('0x43')]('i.'+_0x26956c+_0x15bc('0x7b'),_0x5aa74d[_0x15bc('0x3a')][_0x26956c]);}}});}if(_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x7c')]){if(_0x5aa74d['query'][_0x15bc('0x7c')]==0x1){_0x302e5a[_0x15bc('0x61')]('`unreadMessages`\x20=\x200');}else{_0x302e5a[_0x15bc('0x61')](_0x15bc('0x7d'));}}if(_0x5aa74d['query'][_0x15bc('0x7e')]){_0x342267=_['isArray'](_0x5aa74d[_0x15bc('0x3a')]['tag'])?_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x7e')]:new Array(_0x5aa74d['query'][_0x15bc('0x7e')]);_0x342267[_0x15bc('0x25')](function(_0x5eb48b){_0x31b930['or'](_0x15bc('0x6c'),'%,'+_0x5eb48b+',%');});}if(_0x5aa74d[_0x15bc('0x3a')]['filter']){var _0x360aef=_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x7f')][_0x15bc('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x15bc('0x81')](_0x360aef)){_0x26bb42['or']('i.id\x20LIKE\x20?',_0x360aef+'%');}else if(qs['isEmail'](_0x360aef)){_0x26bb42['or'](_0x15bc('0x82'),_0x360aef+'%');}else{_0x26bb42['or'](_0x15bc('0x83'),qs['getFullTextValue'](_0x360aef))['or'](_0x15bc('0x84'),qs[_0x15bc('0x65')](_0x360aef));}}}_0x302e5a[_0x15bc('0x43')](_0x26bb42);_0x302e5a[_0x15bc('0x85')](_0x15bc('0x86'));var _0x81ed21={'type':db[_0x15bc('0x87')]['QueryTypes'][_0x15bc('0x88')],'raw':!![]};var _0x1e4a98=_0x302e5a[_0x15bc('0x89')]();_0x1e4a98[_0x15bc('0x46')](_0x15bc('0x86'));_0x1e4a98[_0x15bc('0x46')](_0x15bc('0x8a'),_0x15bc('0x5f'));if(_0x4aff84[_0x15bc('0x8b')]){_0x4aff84[_0x15bc('0x8b')][_0x15bc('0x25')](function(_0x4aa27e){var _0x48a78a=_0x4aa27e[0x0]==='contactName'?_0x4aa27e[0x0]:'i.'+_0x4aa27e[0x0];_0x302e5a['order'](_0x48a78a,_0x4aa27e[0x1]===_0x15bc('0x8c')?![]:!![]);});}if(!_[_0x15bc('0x71')](_0x342267)){_0x302e5a[_0x15bc('0x61')](_0x31b930);_0x1e4a98[_0x15bc('0x43')](_0x15bc('0x8d'),_0x342267);}BPromise[_0x15bc('0x8e')]()[_0x15bc('0x1c')](function(){if(!_0x489291){if(_0x5aa74d['query']['MailAccountId'])return;_0x1e4a98['where'](_0x15bc('0x8f'));_0x302e5a[_0x15bc('0x43')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5aa74d[_0x15bc('0x90')][_0x15bc('0x91')]!==_0x15bc('0x92'))return;return _0x5aa74d[_0x15bc('0x90')][_0x15bc('0x93')]({'attributes':['id'],'raw':!![]})[_0x15bc('0x1c')](function(_0x31b77b){if(_[_0x15bc('0x71')](_0x31b77b)){_0x1e4a98['where'](_0x15bc('0x94'));_0x302e5a[_0x15bc('0x43')](_0x15bc('0x94'));}else{_0x1e4a98[_0x15bc('0x43')]('i.MailAccountId\x20IN\x20?',_[_0x15bc('0x20')](_0x31b77b,'id'));_0x302e5a[_0x15bc('0x43')](_0x15bc('0x73'),_[_0x15bc('0x20')](_0x31b77b,'id'));}});})[_0x15bc('0x1c')](function(){if(_0x5aa74d[_0x15bc('0x90')][_0x15bc('0x91')]===_0x15bc('0x92')&&!_0x489291&&!_0x5aa74d['query'][_0x15bc('0x72')])return[];return db[_0x15bc('0x95')][_0x15bc('0x3a')](_0x1e4a98['toString'](),_0x81ed21);})[_0x15bc('0x1c')](function(_0x52f657){_0x5f2ac2[_0x15bc('0x18')]=_0x52f657['length'];if(_0x5f2ac2[_0x15bc('0x18')]===0x0)return[];return db[_0x15bc('0x95')]['query'](_0x51cc41[_0x15bc('0x96')](),_0x81ed21)[_0x15bc('0x1c')](function(_0x200f16){_0x15651b=_[_0x15bc('0x97')](_0x200f16,'id');_0x81ed21=_['merge'](_0x81ed21,{'model':db[_0x15bc('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5aa74d[_0x15bc('0x3a')][_0x15bc('0x3d')]){_0x4aff84[_0x15bc('0x3e')][_0x15bc('0x25')](function(_0x18b6e5){_0x302e5a[_0x15bc('0x46')]('i.'+_0x18b6e5);});}else{_0x302e5a[_0x15bc('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x15bc('0x5f'));_0x302e5a['field']('a.key',_0x15bc('0x98'));_0x302e5a[_0x15bc('0x46')]('a.mandatoryDisposition',_0x15bc('0x99'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0x9a'),'contactName');_0x302e5a['field']('i.id');_0x302e5a[_0x15bc('0x46')](_0x15bc('0x9b'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0x9c'));_0x302e5a['field'](_0x15bc('0x9d'));_0x302e5a['field']('i.closedAt');_0x302e5a[_0x15bc('0x46')]('i.attach');_0x302e5a[_0x15bc('0x46')]('i.lastMsgAt');_0x302e5a[_0x15bc('0x46')](_0x15bc('0x9e'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0x9f'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0xa0'));_0x302e5a['field'](_0x15bc('0xa1'));_0x302e5a[_0x15bc('0x46')]('i.thirdDisposition');_0x302e5a[_0x15bc('0x46')](_0x15bc('0xa2'));_0x302e5a['field'](_0x15bc('0xa3'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0xa4'));_0x302e5a[_0x15bc('0x46')]('i.MailAccountId');_0x302e5a[_0x15bc('0x46')]('i.UserId');_0x302e5a['field'](_0x15bc('0xa5'),_0x15bc('0xa6'));_0x302e5a['field'](_0x15bc('0xa7'),_0x15bc('0xa8'));_0x302e5a['field'](_0x15bc('0xa9'),_0x15bc('0xaa'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0xab'),'Contact.phone');_0x302e5a[_0x15bc('0x46')](_0x15bc('0xac'),_0x15bc('0xad'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0xae'),_0x15bc('0xaf'));_0x302e5a['field'](_0x15bc('0xb0'),_0x15bc('0xb1'));_0x302e5a['field'](_0x15bc('0xb2'),_0x15bc('0xb3'));_0x302e5a[_0x15bc('0x46')](_0x15bc('0xb4'),_0x15bc('0x22'));}if(_0x4aff84['limit'])_0x302e5a[_0x15bc('0x17')](_0x4aff84[_0x15bc('0x17')]);if(_0x4aff84[_0x15bc('0x15')])_0x302e5a['offset'](_0x4aff84['offset']);return db[_0x15bc('0x95')][_0x15bc('0x3a')](_0x302e5a['toString'](),_0x81ed21);})['then'](function(_0x6fbad2){if(_0x6fbad2[_0x15bc('0x3f')]>0x0)_0x30bed2[_0x15bc('0x43')](_0x15bc('0xb5'),_['map'](_0x6fbad2,'id'));return db[_0x15bc('0x95')]['query'](_0x30bed2[_0x15bc('0x96')](),_0x81ed21)[_0x15bc('0x1c')](function(_0x273d34){var _0x575ffd=_[_0x15bc('0xb6')](_0x273d34,'MailInteractionId');var _0x146612=[];return db[_0x15bc('0xb7')][_0x15bc('0x28')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x15bc('0x1c')](function(_0x5a2513){var _0x1d2355=_0x5a2513[_0x15bc('0xb8')];_0x6fbad2[_0x15bc('0x25')](function(_0x2337f5){_0x146612[_0x15bc('0x26')](updateMailInteraction(_0x2337f5,_0x15651b,_0x575ffd,_0x1d2355));});return BPromise[_0x15bc('0xb9')](_0x146612);});});});})[_0x15bc('0x1c')](function(_0x32c836){_0x5f2ac2[_0x15bc('0xba')]=_0x32c836;return _0x5f2ac2;})[_0x15bc('0x1c')](respondWithFilteredResult(_0x59abcd,_0x4aff84))[_0x15bc('0x2d')](handleError(_0x59abcd,null));};exports[_0x15bc('0xbb')]=function(_0x3a8276,_0x425bb7){var _0x26c012={'raw':![],'where':{'id':_0x3a8276[_0x15bc('0xbc')]['id']}},_0x5cf6e4={};_0x5cf6e4[_0x15bc('0x39')]=_['keys'](db[_0x15bc('0x36')][_0x15bc('0xbd')]);_0x5cf6e4['query']=_[_0x15bc('0x3b')](_0x3a8276['query']);_0x5cf6e4[_0x15bc('0x44')]=_[_0x15bc('0x3c')](_0x5cf6e4[_0x15bc('0x39')],_0x5cf6e4['query']);_0x26c012[_0x15bc('0x3e')]=_[_0x15bc('0x3c')](_0x5cf6e4[_0x15bc('0x39')],qs['fields'](_0x3a8276[_0x15bc('0x3a')][_0x15bc('0x3d')]));_0x26c012['attributes']=_0x26c012[_0x15bc('0x3e')][_0x15bc('0x3f')]?_0x26c012['attributes']:_0x5cf6e4[_0x15bc('0x39')];if(_0x3a8276[_0x15bc('0x3a')]['includeAll']){_0x26c012[_0x15bc('0xbe')]=[{'all':!![]}];}_0x26c012=_[_0x15bc('0xbf')]({},_0x26c012,_0x3a8276[_0x15bc('0xc0')]);return db[_0x15bc('0x36')]['find'](_0x26c012)['then'](handleEntityNotFound(_0x425bb7,null))[_0x15bc('0x1c')](respondWithResult(_0x425bb7,null))['catch'](handleError(_0x425bb7,null));};exports[_0x15bc('0xc1')]=function(_0x53f29d,_0x3f446f){return db[_0x15bc('0x36')]['create'](_0x53f29d[_0x15bc('0xc2')],{})[_0x15bc('0x1c')](respondWithResult(_0x3f446f,0xc9))['catch'](handleError(_0x3f446f,null));};exports[_0x15bc('0x1b')]=function(_0x2584b8,_0x5b8736){if(_0x2584b8[_0x15bc('0xc2')]['id']){delete _0x2584b8['body']['id'];}return db['MailInteraction'][_0x15bc('0x5e')]({'where':{'id':_0x2584b8[_0x15bc('0xbc')]['id']}})[_0x15bc('0x1c')](handleEntityNotFound(_0x5b8736,null))[_0x15bc('0x1c')](saveUpdates(_0x2584b8[_0x15bc('0xc2')],null))[_0x15bc('0x1c')](respondWithResult(_0x5b8736,null))[_0x15bc('0x2d')](handleError(_0x5b8736,null));};exports[_0x15bc('0xc3')]=function(_0x56c883,_0x4311db){return db[_0x15bc('0x36')][_0x15bc('0x5e')]({'where':{'id':_0x56c883[_0x15bc('0xbc')]['id']}})['then'](handleEntityNotFound(_0x4311db,null))[_0x15bc('0x1c')](removeEntity(_0x4311db,null))[_0x15bc('0x2d')](handleError(_0x4311db,null));};exports['describe']=function(_0x37dc2a,_0x5d2c50){return db[_0x15bc('0x36')][_0x15bc('0xc4')]()[_0x15bc('0x1c')](respondWithResult(_0x5d2c50,null))['catch'](handleError(_0x5d2c50,null));};exports[_0x15bc('0xc5')]=function(_0x4b1208,_0x5601c8){return db[_0x15bc('0x27')]['find']({'where':{'id':_0x4b1208[_0x15bc('0xbc')]['id']}})[_0x15bc('0x1c')](handleEntityNotFound(_0x5601c8,null))[_0x15bc('0x1c')](function(_0x27519c){if(_0x27519c){return _0x27519c[_0x15bc('0xc5')](_0x4b1208[_0x15bc('0xc2')][_0x15bc('0xc6')],_[_0x15bc('0xc7')](_0x4b1208[_0x15bc('0xc2')],[_0x15bc('0xc6'),'id'])||{});}})[_0x15bc('0x1c')](respondWithResult(_0x5601c8,null))[_0x15bc('0x2d')](handleError(_0x5601c8,null));};exports[_0x15bc('0xc8')]=function(_0x3a73bc,_0x5d27cd){var _0x36a828={'raw':![],'where':{}};var _0x38c1c3={};var _0x56285c={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x3a73bc[_0x15bc('0xbc')]['id']}})[_0x15bc('0x1c')](handleEntityNotFound(_0x5d27cd,null))[_0x15bc('0x1c')](function(_0x3f91f0){if(_0x3f91f0){_0x38c1c3[_0x15bc('0x39')]=_[_0x15bc('0x3b')](db[_0x15bc('0x27')]['rawAttributes']);_0x38c1c3[_0x15bc('0x3a')]=_[_0x15bc('0x3b')](_0x3a73bc[_0x15bc('0x3a')]);_0x38c1c3[_0x15bc('0x44')]=_[_0x15bc('0x3c')](_0x38c1c3['model'],_0x38c1c3['query']);_0x36a828[_0x15bc('0x3e')]=_['intersection'](_0x38c1c3[_0x15bc('0x39')],qs[_0x15bc('0x3d')](_0x3a73bc[_0x15bc('0x3a')][_0x15bc('0x3d')]));_0x36a828['attributes']=_0x36a828[_0x15bc('0x3e')][_0x15bc('0x3f')]?_0x36a828[_0x15bc('0x3e')]:_0x38c1c3[_0x15bc('0x39')];if(!_0x3a73bc[_0x15bc('0x3a')][_0x15bc('0x40')]('nolimit')){_0x36a828[_0x15bc('0x17')]=qs['limit'](_0x3a73bc['query']['limit']);_0x36a828[_0x15bc('0x15')]=qs[_0x15bc('0x15')](_0x3a73bc[_0x15bc('0x3a')][_0x15bc('0x15')]);}_0x36a828[_0x15bc('0x8b')]=qs[_0x15bc('0x42')](_0x3a73bc['query'][_0x15bc('0x42')]);_0x36a828[_0x15bc('0x43')]=qs[_0x15bc('0x44')](_[_0x15bc('0xc9')](_0x3a73bc[_0x15bc('0x3a')],_0x38c1c3[_0x15bc('0x44')]));_0x36a828[_0x15bc('0x43')]['MailInteractionId']=_0x3f91f0['id'];if(_0x3a73bc['query']['filter']){_0x36a828[_0x15bc('0x43')]=_[_0x15bc('0xbf')](_0x36a828[_0x15bc('0x43')],{'$or':_[_0x15bc('0x20')](_0x36a828[_0x15bc('0x3e')],function(_0x466003){var _0x41839b={};_0x41839b[_0x466003]={'$like':'%'+_0x3a73bc[_0x15bc('0x3a')][_0x15bc('0x7f')]+'%'};return _0x41839b;})});}if(_0x3a73bc[_0x15bc('0x3a')]['$gte']){var _0x2f7ac0=_0x3a73bc[_0x15bc('0x3a')]['$gte'][_0x15bc('0x24')](',');var _0x4361c8={};_0x4361c8[_0x2f7ac0[0x0]]={'$gte':moment(_0x2f7ac0[0x1])[_0x15bc('0xca')](_0x15bc('0xcb'))};_0x36a828['where']=_['merge'](_0x36a828[_0x15bc('0x43')],_0x4361c8);}_0x36a828=_[_0x15bc('0xbf')]({},_0x36a828,_0x3a73bc[_0x15bc('0xc0')]);return db['MailMessage'][_0x15bc('0x18')]({'where':_0x36a828[_0x15bc('0x43')]})[_0x15bc('0x1c')](function(_0x41b6a7){_0x56285c['count']=_0x41b6a7;if(_0x3a73bc['query'][_0x15bc('0xcc')]){_0x36a828['include']=[{'all':!![]}];}return db['MailMessage'][_0x15bc('0xcd')](_0x36a828);})['then'](function(_0x44d9b5){if(_0x3a73bc['query'][_0x15bc('0xce')]==='true'){for(var _0x2c67ca=0x0;_0x2c67ca<_0x44d9b5[_0x15bc('0x3f')];_0x2c67ca++){_0x44d9b5[_0x2c67ca][_0x15bc('0xc2')]=juice(_0x44d9b5[_0x2c67ca]['body']);}}_0x56285c[_0x15bc('0xba')]=_0x44d9b5;return _0x56285c;});}})[_0x15bc('0x1c')](respondWithFilteredResult(_0x5d27cd,_0x36a828))[_0x15bc('0x2d')](handleError(_0x5d27cd,null));};exports['addTags']=function(_0xd45e95,_0x269371){return db['MailInteraction']['find']({'where':{'id':_0xd45e95[_0x15bc('0xbc')]['id']}})[_0x15bc('0x1c')](handleEntityNotFound(_0x269371,null))['then'](function(_0x10fa25){if(_0x10fa25){return _0x10fa25[_0x15bc('0xcf')](_0xd45e95[_0x15bc('0xc2')][_0x15bc('0xc6')],_[_0x15bc('0xc7')](_0xd45e95[_0x15bc('0xc2')],['ids','id'])||{})[_0x15bc('0xd0')](function(){return db[_0x15bc('0x6b')][_0x15bc('0xcd')]({'attributes':['id',_0x15bc('0x1f'),_0x15bc('0x47')],'where':{'id':_0xd45e95[_0x15bc('0xc2')]['ids']}});})['then'](function(_0xf8f203){socket[_0x15bc('0xd1')](_0x15bc('0xd2'),{'id':Number(_0xd45e95[_0x15bc('0xbc')]['id']),'tags':_0xf8f203||[]});return{'id':Number(_0xd45e95['params']['id']),'tags':_0xf8f203||[]};});}})['then'](respondWithResult(_0x269371,null))[_0x15bc('0x2d')](handleError(_0x269371,null));};exports[_0x15bc('0xd3')]=function(_0x3b5c77,_0x1a4dfb){return db[_0x15bc('0x36')][_0x15bc('0x5e')]({'where':{'id':_0x3b5c77[_0x15bc('0xbc')]['id']}})['then'](handleEntityNotFound(_0x1a4dfb,null))[_0x15bc('0x1c')](function(_0x4e0dc4){if(_0x4e0dc4){return _0x4e0dc4[_0x15bc('0xd3')](_0x3b5c77[_0x15bc('0x3a')][_0x15bc('0xc6')]);}})[_0x15bc('0x1c')](respondWithStatusCode(_0x1a4dfb,null))[_0x15bc('0x2d')](handleError(_0x1a4dfb,null));};exports[_0x15bc('0xd4')]=function(_0x490d3e,_0x1884e7){var _0x4616d6=moment()[_0x15bc('0xd5')]()['toString']();var _0x3e5915=path['join'](config[_0x15bc('0xd6')],_0x15bc('0xd7'),'files','tmp');var _0x3eebec=path[_0x15bc('0xd8')](config[_0x15bc('0xd6')],_0x15bc('0xd7'),_0x15bc('0xd9'),_0x15bc('0xda'));var _0x2e5df3=path[_0x15bc('0xd8')](_0x3e5915,_0x4616d6);var _0x33c50a=util[_0x15bc('0xca')](_0x15bc('0xdb'),_0x490d3e[_0x15bc('0xbc')]['id'],_0x4616d6);var _0xe84a7b=path[_0x15bc('0xd8')](_0x3e5915,_0x33c50a);var _0x3c454f=[];if(_0x490d3e['query'][_0x15bc('0xda')]){_0x3c454f[_0x15bc('0x26')]({'model':db['Attachment'],'as':_0x15bc('0xdc'),'raw':!![]});}var _0x58748c=[{'model':db[_0x15bc('0x27')],'as':_0x15bc('0xdd'),'attributes':['id','body',_0x15bc('0x48'),'to','cc','bcc',_0x15bc('0xde'),_0x15bc('0x75')],'where':{'secret':![]},'order':qs[_0x15bc('0x42')]('id'),'include':_0x3c454f}];return db[_0x15bc('0x36')]['find']({'where':{'id':_0x490d3e['params']['id']},'include':_0x58748c})['then'](handleEntityNotFound(_0x1884e7,null))['then'](function(_0x48dc7a){if(_0x48dc7a&&_0x48dc7a[_0x15bc('0xdd')]){var _0x148f08=_0x48dc7a[_0x15bc('0xdf')]({'plain':!![]});fs[_0x15bc('0xe0')](_0x2e5df3);return BPromise['each'](_0x148f08[_0x15bc('0xdd')],function(_0x4d677d,_0xe39789){var _0x22d5f8={'from':_0x4d677d[_0x15bc('0x48')],'to':_0x4d677d['to'],'subject':_0x4d677d[_0x15bc('0xde')],'html':htmlEntities[_0x15bc('0xe1')](_0x4d677d[_0x15bc('0xc2')]),'headers':{'Date':moment(_0x4d677d[_0x15bc('0x75')])[_0x15bc('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x4d677d['cc']){_0x22d5f8['headers']['Cc']=_0x4d677d['cc'];}if(_0x4d677d[_0x15bc('0xe2')]){_0x22d5f8[_0x15bc('0xe3')]['Bcc']=_0x4d677d[_0x15bc('0xe2')];}return new BPromise(function(_0x1d8a16,_0x30eab0){if(_0x4d677d[_0x15bc('0xdc')]){for(var _0x1317d8=0x0;_0x1317d8<_0x4d677d[_0x15bc('0xdc')][_0x15bc('0x3f')];_0x1317d8++){var _0x30514a=_0x4d677d['Attachments'][_0x1317d8];var _0x41473d=path['join'](_0x3eebec,_0x30514a['basename']);if(fs[_0x15bc('0xe4')](_0x41473d)){_0x22d5f8[_0x15bc('0xda')][_0x15bc('0x26')]({'name':_0x30514a[_0x15bc('0x1f')],'contentType':_0x30514a[_0x15bc('0x37')],'data':fs[_0x15bc('0xe5')](_0x41473d)});}}}emlformat[_0x15bc('0xe6')](_0x22d5f8,function(_0x7db814,_0x4c4031){if(_0x7db814)return _0x30eab0(_0x7db814);fs[_0x15bc('0xe7')](path['join'](_0x2e5df3,util[_0x15bc('0xca')]('message%d.eml',_0xe39789)),_0x4c4031);return _0x1d8a16(_0x4c4031);});});})[_0x15bc('0x1c')](function(){return new BPromise(function(_0x2d717c,_0x20a727){zipdir(_0x2e5df3,{'saveTo':_0xe84a7b},function(_0x35b4a9,_0x390e93){if(_0x35b4a9)return _0x20a727(_0x35b4a9);return _0x2d717c(_0x390e93);});})[_0x15bc('0x1c')](function(){return new BPromise(function(_0x3e3d34,_0x4e4dba){rimraf(_0x2e5df3,function(_0x553fe9){if(_0x553fe9)_0x4e4dba(_0x553fe9);return _0x3e3d34();});});})['then'](function(){return _0x1884e7[_0x15bc('0xd4')](_0xe84a7b,_0x33c50a,function(_0x7f2892){if(!_0x7f2892)fs['unlinkSync'](_0xe84a7b);});});});}else{return _0x1884e7[_0x15bc('0xe8')](0xc8);}})[_0x15bc('0x2d')](handleError(_0x1884e7,null));}; \ No newline at end of file +var _0x7a54=['findAll','emit','download','unix','join','server','files','tmp','root','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','name','send','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','-id','plainBody','catch','waiting','unmanaged','closed','UserId','talking','answered','index','MailInteraction','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','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','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','`\x20=\x200','`\x20>\x200','operator','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','union','User','text','start','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','having','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','Sequelize','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','sequelize','keyBy','merge','a.key','Account.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.updatedAt','i.closed','i.attach','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.MailAccountId','i.UserId','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.MailInteractionId\x20IN\x20?','groupBy','Setting','enableEmailPreview','rows','show','params','rawAttributes','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','inlineCss','addTags','setTags'];(function(_0x3ac2a9,_0x2106f8){var _0x23fad6=function(_0x1da5fa){while(--_0x1da5fa){_0x3ac2a9['push'](_0x3ac2a9['shift']());}};_0x23fad6(++_0x2106f8);}(_0x7a54,0x106));var _0x47a5=function(_0x44eb3a,_0x5afdd3){_0x44eb3a=_0x44eb3a-0x0;var _0x273d05=_0x7a54[_0x44eb3a];return _0x273d05;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var moment=require('moment');var BPromise=require(_0x47a5('0x3'));var util=require(_0x47a5('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x47a5('0x5'));var squel=require(_0x47a5('0x6'));var juice=require(_0x47a5('0x7'));var Redis=require(_0x47a5('0x8'));var qs=require(_0x47a5('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x47a5('0xa'))('api');var config=require(_0x47a5('0xb'));var db=require(_0x47a5('0xc'))['db'];var htmlEntities=require('html-entities');config[_0x47a5('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xe'))(new Redis(config[_0x47a5('0xd')]));require('./mailInteraction.socket')[_0x47a5('0xf')](socket);function respondWithStatusCode(_0x49e844,_0x5de6d7){_0x5de6d7=_0x5de6d7||0xcc;return function(_0x1f47f4){if(_0x1f47f4){return _0x49e844[_0x47a5('0x10')](_0x5de6d7);}return _0x49e844[_0x47a5('0x11')](_0x5de6d7)[_0x47a5('0x12')]();};}function respondWithResult(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xc8;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['status'](_0xd308b8)[_0x47a5('0x13')](_0x1eae59);}};}function respondWithFilteredResult(_0x221b54,_0x1cf309){return function(_0x711793){if(_0x711793){var _0x139f25=typeof _0x1cf309[_0x47a5('0x14')]===_0x47a5('0x15')&&typeof _0x1cf309[_0x47a5('0x16')]==='undefined';var _0x362359=_0x711793[_0x47a5('0x17')];var _0x3b001e=_0x139f25?0x0:_0x1cf309[_0x47a5('0x14')];var _0x1ef44c=_0x139f25?_0x711793['count']:_0x1cf309['offset']+_0x1cf309[_0x47a5('0x16')];var _0x4b966e;if(_0x1ef44c>=_0x362359){_0x1ef44c=_0x362359;_0x4b966e=0xc8;}else{_0x4b966e=0xce;}_0x221b54['status'](_0x4b966e);return _0x221b54[_0x47a5('0x18')](_0x47a5('0x19'),_0x3b001e+'-'+_0x1ef44c+'/'+_0x362359)[_0x47a5('0x13')](_0x711793);}return null;};}function saveUpdates(_0x1ef371){return function(_0x477b1d){if(_0x477b1d){return _0x477b1d[_0x47a5('0x1a')](_0x1ef371)[_0x47a5('0x1b')](function(_0xe3c618){return _0xe3c618;});}return null;};}function removeEntity(_0x3aed38){return function(_0x4a9fcb){if(_0x4a9fcb){return _0x4a9fcb[_0x47a5('0x1c')]()[_0x47a5('0x1b')](function(){_0x3aed38['status'](0xcc)[_0x47a5('0x12')]();});}};}function handleEntityNotFound(_0x1f03f7){return function(_0x36874d){if(!_0x36874d){_0x1f03f7['sendStatus'](0x194);}return _0x36874d;};}function handleError(_0xb8ae6c,_0x2f142b){_0x2f142b=_0x2f142b||0x1f4;return function(_0x23db32){logger[_0x47a5('0x1d')](_0x23db32['stack']);if(_0x23db32[_0x47a5('0x1e')]){delete _0x23db32[_0x47a5('0x1e')];}_0xb8ae6c['status'](_0x2f142b)[_0x47a5('0x1f')](_0x23db32);};}function getInteractionUsers(_0xc4cd63,_0x4437f1){return new BPromise(function(_0x129ce5,_0x3abd6a){try{if(_0x4437f1[_0xc4cd63['id']]){_0xc4cd63['Users']=_['map'](_0x4437f1[_0xc4cd63['id']],function(_0x136745){return{'id':_0x136745['id'],'fullname':_0x136745['fullname']};});}}catch(_0x1ea9c8){_0x3abd6a(_0x1ea9c8);}_0x129ce5(_0xc4cd63);});}function getInteractionTags(_0x5b6c4e,_0x23cb77){return new BPromise(function(_0x378208,_0x36ad34){try{if(_0x5b6c4e[_0x47a5('0x20')]){_0x5b6c4e[_0x47a5('0x21')]=[];_0x5b6c4e[_0x47a5('0x20')][_0x47a5('0x22')](',')[_0x47a5('0x23')](function(_0x16631f){_0x5b6c4e[_0x47a5('0x21')][_0x47a5('0x24')](_0x23cb77[_0x16631f]);});}delete _0x5b6c4e[_0x47a5('0x20')];}catch(_0x3ad507){_0x36ad34(_0x3ad507);}_0x378208(_0x5b6c4e);});}function getLastMessageText(_0x528582){return new BPromise(function(_0x243210,_0x51833b){return db[_0x47a5('0x25')][_0x47a5('0x26')]({'where':{'$and':[{'MailInteractionId':_0x528582['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x47a5('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x47a5('0x28'),'raw':!![]})[_0x47a5('0x1b')](function(_0x39b50b){if(_0x39b50b&&_0x39b50b[_0x47a5('0x29')]){_0x528582['lastMsgText']=_['trimStart'](_0x39b50b[_0x47a5('0x29')]);}_0x243210(_0x528582);})[_0x47a5('0x2a')](function(_0x5bd7eb){_0x51833b(_0x5bd7eb);});});}function updateMailInteraction(_0x4e1006,_0x836303,_0x51544e,_0x57bff6){return new BPromise(function(_0x42f70c,_0x53119b){return getInteractionUsers(_0x4e1006,_0x51544e)[_0x47a5('0x1b')](function(_0xd972c){return getInteractionTags(_0xd972c,_0x836303);})['then'](function(_0x4843c0){return getStateInteraction(_0x4843c0);})[_0x47a5('0x1b')](function(_0x5910bb){if(_0x57bff6){_0x42f70c(getLastMessageText(_0x5910bb));}else{_0x42f70c(_0x5910bb);}})[_0x47a5('0x2a')](function(_0x87e4c9){_0x53119b(_0x87e4c9);});});}function getStateInteraction(_0xf269a8){return new BPromise(function(_0x52749b){_0xf269a8[_0x47a5('0x2b')]=0x0;_0xf269a8['talking']=0x0;_0xf269a8['answered']=0x0;_0xf269a8[_0x47a5('0x2c')]=0x0;_0xf269a8['total']=0x0;if(!_0xf269a8[_0x47a5('0x2d')]&&!_0xf269a8['UserId']){_0xf269a8[_0x47a5('0x2b')]+=0x1;}if(!_0xf269a8[_0x47a5('0x2d')]&&_0xf269a8[_0x47a5('0x2e')]){_0xf269a8[_0x47a5('0x2f')]+=0x1;if(_0xf269a8[_0x47a5('0x2b')]){_0xf269a8[_0x47a5('0x2b')]-=0x1;}}if(_0xf269a8[_0x47a5('0x2d')]&&_0xf269a8[_0x47a5('0x2e')]){_0xf269a8[_0x47a5('0x30')]+=0x1;if(_0xf269a8['talking']){_0xf269a8[_0x47a5('0x2f')]-=0x1;}}if(_0xf269a8[_0x47a5('0x2d')]&&!_0xf269a8['UserId']){_0xf269a8[_0x47a5('0x2c')]+=0x1;if(_0xf269a8[_0x47a5('0x2b')]){_0xf269a8[_0x47a5('0x2b')]-=0x1;}}_0xf269a8['total']+=0x1;_0x52749b(_0xf269a8);});}exports[_0x47a5('0x31')]=function(_0x10f660,_0x596097){var _0x2ebba0={},_0x19218a={},_0x54ae35={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x32')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x33')],'type':_0x9b5eaf[_0x47a5('0x34')][_0x47a5('0x35')]};});_0x19218a[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x55c5eb,_0x47a5('0x1e'));_0x19218a[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x10f660[_0x47a5('0x38')]);_0x19218a[_0x47a5('0x3a')]=_[_0x47a5('0x3b')](_0x19218a[_0x47a5('0x36')],_0x19218a['query']);_0x2ebba0[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x19218a[_0x47a5('0x36')],qs[_0x47a5('0x3d')](_0x10f660['query'][_0x47a5('0x3d')]));_0x2ebba0['attributes']=_0x2ebba0['attributes']['length']?_0x2ebba0['attributes']:_0x19218a[_0x47a5('0x36')];if(!_0x10f660['query'][_0x47a5('0x3e')](_0x47a5('0x3f'))){_0x2ebba0[_0x47a5('0x16')]=qs['limit'](_0x10f660[_0x47a5('0x38')][_0x47a5('0x16')]);_0x2ebba0['offset']=qs['offset'](_0x10f660[_0x47a5('0x38')]['offset']);}_0x2ebba0[_0x47a5('0x40')]=qs[_0x47a5('0x41')](_0x10f660[_0x47a5('0x38')][_0x47a5('0x41')]);_0x2ebba0[_0x47a5('0x42')]=qs[_0x47a5('0x3a')](_[_0x47a5('0x43')](_0x10f660[_0x47a5('0x38')],_0x19218a[_0x47a5('0x3a')]),_0x55c5eb);var _0x162fa0=[];var _0x24ecb1=squel[_0x47a5('0x44')]()[_0x47a5('0x45')]('id')[_0x47a5('0x45')](_0x47a5('0x1e'))[_0x47a5('0x45')]('color')[_0x47a5('0x46')](_0x47a5('0x47'));var _0x49eab1=squel['select']()[_0x47a5('0x45')]('u.id')[_0x47a5('0x45')](_0x47a5('0x48'))['field']('ui.MailInteractionId')[_0x47a5('0x46')]('user_has_mail_interactions','ui')[_0x47a5('0x49')](_0x47a5('0x4a'),'u',_0x47a5('0x4b'));var _0x3e12a7=squel[_0x47a5('0x44')]()[_0x47a5('0x46')](_0x47a5('0x4c'),'i')['left_join']('cm_contacts','c',_0x47a5('0x4d'))[_0x47a5('0x49')](_0x47a5('0x4a'),'o',_0x47a5('0x4e'))[_0x47a5('0x49')](_0x47a5('0x4f'),'a',_0x47a5('0x50'))['left_join'](_0x47a5('0x51'),'me',_0x47a5('0x52'))[_0x47a5('0x49')]('mail_interaction_has_tags','it',_0x47a5('0x53'))['left_join'](_0x47a5('0x47'),'t',_0x47a5('0x54'));var _0x46e90b=squel[_0x47a5('0x55')]();var _0x588551=[];var _0x3adf14=squel[_0x47a5('0x55')]();var _0x2f66e9;if(_0x10f660[_0x47a5('0x38')][_0x47a5('0x56')]){_0x2f66e9=as[_0x47a5('0x57')](_0x10f660[_0x47a5('0x38')]['search']);var _0x2a0aa2=_0x2f66e9[_0x47a5('0x58')];for(var _0x187d7e=0x0;_0x187d7e<_0x2f66e9[_0x47a5('0x59')][_0x47a5('0x5a')];_0x187d7e++){var _0x1ab0bf=_0x2f66e9['conditions'][_0x187d7e];var _0x1ad6a9='i';var _0x245a15=_[_0x47a5('0x5b')](_0x55c5eb,['name',_0x1ab0bf[_0x47a5('0x45')]]);if(!_0x245a15){switch(_0x1ab0bf[_0x47a5('0x45')]){case _0x47a5('0x5c'):if(_0x1ab0bf['value']==0x1){_0x3e12a7['having']('`'+_0x1ab0bf[_0x47a5('0x45')]+_0x47a5('0x5d'));}else{_0x3e12a7['having']('`'+_0x1ab0bf['field']+_0x47a5('0x5e'));}break;case'Contact':if(_0x1ab0bf[_0x47a5('0x5f')]==='$substring'){if(_0x1ab0bf['value'][_0x47a5('0x22')]('\x20')[_0x47a5('0x5a')]>0x1){_0x46e90b[_0x2a0aa2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x47a5('0x60')](_0x1ab0bf[_0x47a5('0x61')]),null);}else{var _0x4b706a='%'+_0x1ab0bf['value']+'%';_0x46e90b[_0x2a0aa2](_0x47a5('0x62'),_0x4b706a,_0x4b706a,_0x4b706a);}}else{_0x245a15=_[_0x47a5('0x5b')](_0x55c5eb,[_0x47a5('0x1e'),_0x47a5('0x63')]);_0x1ab0bf['field']=_0x47a5('0x63');_0x2dcc3b=as[_0x47a5('0x64')](_0x1ad6a9,_0x245a15[_0x47a5('0x34')],_0x1ab0bf);_0x46e90b[_0x2a0aa2](_0x2dcc3b['text'],_0x2dcc3b[_0x47a5('0x61')]['start'],_0x2dcc3b[_0x47a5('0x61')][_0x47a5('0x12')]);}break;case _0x47a5('0x65'):var _0x1c485b=_0x1ab0bf[_0x47a5('0x61')]['split'](',')[_0x47a5('0x37')](function(_0x5d1550){return Number(_0x5d1550);});_0x1c485b['forEach'](function(_0x5eb150){_0x3adf14['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5eb150+',%');});_0x588551=_[_0x47a5('0x66')](_0x588551,_0x1c485b);break;case _0x47a5('0x67'):if(_0x1ab0bf[_0x47a5('0x5f')]==='$substring'){_0x46e90b[_0x2a0aa2]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1ab0bf[_0x47a5('0x61')]+'%',null);}else{_0x245a15=_[_0x47a5('0x5b')](_0x55c5eb,[_0x47a5('0x1e'),_0x47a5('0x2e')]);_0x1ab0bf[_0x47a5('0x45')]='UserId';_0x2dcc3b=as[_0x47a5('0x64')](_0x1ad6a9,_0x245a15['type'],_0x1ab0bf);_0x46e90b[_0x2a0aa2](_0x2dcc3b[_0x47a5('0x68')],_0x2dcc3b[_0x47a5('0x61')]['start'],_0x2dcc3b[_0x47a5('0x61')][_0x47a5('0x12')]);}break;case _0x47a5('0x29'):_0x2dcc3b=as[_0x47a5('0x64')]('me',null,_0x1ab0bf);_0x46e90b[_0x2a0aa2](_0x2dcc3b[_0x47a5('0x68')],_0x2dcc3b[_0x47a5('0x61')][_0x47a5('0x69')],_0x2dcc3b[_0x47a5('0x61')]['end']);break;}}else{var _0x2dcc3b=as[_0x47a5('0x64')](_0x1ad6a9,_0x245a15[_0x47a5('0x34')],_0x1ab0bf);_0x46e90b[_0x2a0aa2](_0x2dcc3b[_0x47a5('0x68')],_0x2dcc3b[_0x47a5('0x61')]['start'],_0x2dcc3b[_0x47a5('0x61')][_0x47a5('0x12')]);}}}else{var _0x1224bc=_(_0x10f660[_0x47a5('0x38')])[_0x47a5('0x39')]()[_0x47a5('0x37')](function(_0x453191){return _[_0x47a5('0x6a')](_0x55c5eb,[_0x47a5('0x1e'),_0x453191])?_0x453191:undefined;})[_0x47a5('0x6b')]()[_0x47a5('0x61')]();if(!_[_0x47a5('0x6c')](_0x1224bc)){_0x1224bc[_0x47a5('0x23')](function(_0x1cdadc){if(_0x1cdadc===_0x47a5('0x6d')){_0x3e12a7['where'](_0x47a5('0x6e'),[][_0x47a5('0x6f')](_0x10f660[_0x47a5('0x38')][_0x1cdadc]));}else if(_0x1cdadc==='createdAt'){var _0x37ac59=JSON[_0x47a5('0x70')](_0x10f660[_0x47a5('0x38')][_0x1cdadc])[_0x47a5('0x71')];var _0x5d9822=JSON[_0x47a5('0x70')](_0x10f660['query'][_0x1cdadc])[_0x47a5('0x72')];_0x3e12a7['where'](_0x47a5('0x73'),_0x37ac59,_0x5d9822);}else{if(_0x10f660['query'][_0x1cdadc]===_0x47a5('0x74')){_0x3e12a7[_0x47a5('0x42')]('i.'+_0x1cdadc+_0x47a5('0x75'));}else{_0x3e12a7['where']('i.'+_0x1cdadc+'\x20=\x20?',_0x10f660['query'][_0x1cdadc]);}}});}if(_0x10f660[_0x47a5('0x38')][_0x47a5('0x76')]){if(_0x10f660[_0x47a5('0x38')][_0x47a5('0x76')]==0x1){_0x3e12a7['having'](_0x47a5('0x77'));}else{_0x3e12a7[_0x47a5('0x78')](_0x47a5('0x79'));}}if(_0x10f660[_0x47a5('0x38')][_0x47a5('0x7a')]){_0x588551=_[_0x47a5('0x7b')](_0x10f660[_0x47a5('0x38')][_0x47a5('0x7a')])?_0x10f660[_0x47a5('0x38')][_0x47a5('0x7a')]:new Array(_0x10f660[_0x47a5('0x38')][_0x47a5('0x7a')]);_0x588551['forEach'](function(_0x1e3212){_0x3adf14['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1e3212+',%');});}if(_0x10f660[_0x47a5('0x38')][_0x47a5('0x7c')]){var _0x281e5f=_0x10f660[_0x47a5('0x38')][_0x47a5('0x7c')][_0x47a5('0x7d')]('\x5c','\x5c\x5c')[_0x47a5('0x7d')](/'/g,'\x27\x27');if(qs[_0x47a5('0x7e')](_0x281e5f)){_0x46e90b['or'](_0x47a5('0x7f'),_0x281e5f+'%');}else if(qs[_0x47a5('0x80')](_0x281e5f)){_0x46e90b['or'](_0x47a5('0x81'),_0x281e5f+'%');}else{_0x46e90b['or'](_0x47a5('0x82'),qs[_0x47a5('0x60')](_0x281e5f))['or'](_0x47a5('0x83'),qs[_0x47a5('0x60')](_0x281e5f));}}}_0x3e12a7['where'](_0x46e90b);_0x3e12a7['group']('i.id');var _0x4d09a4={'type':db[_0x47a5('0x84')][_0x47a5('0x85')]['SELECT'],'raw':!![]};var _0x732e00=_0x3e12a7[_0x47a5('0x86')]();_0x732e00[_0x47a5('0x45')](_0x47a5('0x87'));_0x732e00[_0x47a5('0x45')](_0x47a5('0x88'),_0x47a5('0x5c'));if(_0x2ebba0[_0x47a5('0x40')]){_0x2ebba0[_0x47a5('0x40')][_0x47a5('0x23')](function(_0x24a6c1){var _0x5e5f16=_0x24a6c1[0x0]===_0x47a5('0x89')?_0x24a6c1[0x0]:'i.'+_0x24a6c1[0x0];_0x3e12a7[_0x47a5('0x40')](_0x5e5f16,_0x24a6c1[0x1]===_0x47a5('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x588551)){_0x3e12a7[_0x47a5('0x78')](_0x3adf14);_0x732e00[_0x47a5('0x42')](_0x47a5('0x8b'),_0x588551);}BPromise['resolve']()[_0x47a5('0x1b')](function(){if(!_0x2f66e9){if(_0x10f660['query']['MailAccountId'])return;_0x732e00[_0x47a5('0x42')](_0x47a5('0x8c'));_0x3e12a7[_0x47a5('0x42')](_0x47a5('0x8c'));return;}if(_0x10f660[_0x47a5('0x8d')][_0x47a5('0x8e')]!=='agent')return;return _0x10f660['user'][_0x47a5('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x24dbee){if(_[_0x47a5('0x6c')](_0x24dbee)){_0x732e00[_0x47a5('0x42')](_0x47a5('0x90'));_0x3e12a7['where'](_0x47a5('0x90'));}else{_0x732e00['where']('i.MailAccountId\x20IN\x20?',_[_0x47a5('0x37')](_0x24dbee,'id'));_0x3e12a7[_0x47a5('0x42')]('i.MailAccountId\x20IN\x20?',_[_0x47a5('0x37')](_0x24dbee,'id'));}});})[_0x47a5('0x1b')](function(){if(_0x10f660[_0x47a5('0x8d')]['role']===_0x47a5('0x91')&&!_0x2f66e9&&!_0x10f660['query'][_0x47a5('0x6d')])return[];return db[_0x47a5('0x92')][_0x47a5('0x38')](_0x732e00['toString'](),_0x4d09a4);})[_0x47a5('0x1b')](function(_0x196600){_0x54ae35[_0x47a5('0x17')]=_0x196600['length'];if(_0x54ae35[_0x47a5('0x17')]===0x0)return[];return db['sequelize'][_0x47a5('0x38')](_0x24ecb1['toString'](),_0x4d09a4)[_0x47a5('0x1b')](function(_0x20d8bd){_0x162fa0=_[_0x47a5('0x93')](_0x20d8bd,'id');_0x4d09a4=_[_0x47a5('0x94')](_0x4d09a4,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x10f660[_0x47a5('0x38')][_0x47a5('0x3d')]){_0x2ebba0[_0x47a5('0x3c')][_0x47a5('0x23')](function(_0x22d84a){_0x3e12a7['field']('i.'+_0x22d84a);});}else{_0x3e12a7['field'](_0x47a5('0x88'),'unreadMessages');_0x3e12a7[_0x47a5('0x45')](_0x47a5('0x95'),_0x47a5('0x96'));_0x3e12a7['field'](_0x47a5('0x97'),_0x47a5('0x98'));_0x3e12a7['field'](_0x47a5('0x99'),_0x47a5('0x89'));_0x3e12a7[_0x47a5('0x45')](_0x47a5('0x87'));_0x3e12a7['field']('i.createdAt');_0x3e12a7[_0x47a5('0x45')](_0x47a5('0x9a'));_0x3e12a7['field'](_0x47a5('0x9b'));_0x3e12a7[_0x47a5('0x45')]('i.closedAt');_0x3e12a7[_0x47a5('0x45')](_0x47a5('0x9c'));_0x3e12a7[_0x47a5('0x45')]('i.lastMsgAt');_0x3e12a7[_0x47a5('0x45')]('i.lastMsgDirection');_0x3e12a7[_0x47a5('0x45')]('i.subject');_0x3e12a7[_0x47a5('0x45')](_0x47a5('0x9d'));_0x3e12a7['field'](_0x47a5('0x9e'));_0x3e12a7['field'](_0x47a5('0x9f'));_0x3e12a7[_0x47a5('0x45')](_0x47a5('0xa0'));_0x3e12a7[_0x47a5('0x45')]('i.to');_0x3e12a7[_0x47a5('0x45')]('i.ContactId');_0x3e12a7['field'](_0x47a5('0xa1'));_0x3e12a7[_0x47a5('0x45')](_0x47a5('0xa2'));_0x3e12a7[_0x47a5('0x45')](_0x47a5('0xa3'),'Contact.firstName');_0x3e12a7[_0x47a5('0x45')](_0x47a5('0xa4'),_0x47a5('0xa5'));_0x3e12a7[_0x47a5('0x45')]('c.email',_0x47a5('0xa6'));_0x3e12a7['field'](_0x47a5('0xa7'),_0x47a5('0xa8'));_0x3e12a7[_0x47a5('0x45')](_0x47a5('0xa9'),_0x47a5('0xaa'));_0x3e12a7[_0x47a5('0x45')](_0x47a5('0xab'),_0x47a5('0xac'));_0x3e12a7[_0x47a5('0x45')]('o.fullname',_0x47a5('0xad'));_0x3e12a7[_0x47a5('0x45')]('o.internal',_0x47a5('0xae'));_0x3e12a7[_0x47a5('0x45')](_0x47a5('0xaf'),'TagIds');}if(_0x2ebba0['limit'])_0x3e12a7[_0x47a5('0x16')](_0x2ebba0[_0x47a5('0x16')]);if(_0x2ebba0['offset'])_0x3e12a7['offset'](_0x2ebba0[_0x47a5('0x14')]);return db[_0x47a5('0x92')]['query'](_0x3e12a7[_0x47a5('0xb0')](),_0x4d09a4);})[_0x47a5('0x1b')](function(_0x4c9e6a){if(_0x4c9e6a[_0x47a5('0x5a')]>0x0)_0x49eab1[_0x47a5('0x42')](_0x47a5('0xb1'),_[_0x47a5('0x37')](_0x4c9e6a,'id'));return db[_0x47a5('0x92')][_0x47a5('0x38')](_0x49eab1['toString'](),_0x4d09a4)['then'](function(_0x5bd86e){var _0x133b7a=_[_0x47a5('0xb2')](_0x5bd86e,'MailInteractionId');var _0x2006cb=[];return db[_0x47a5('0xb3')][_0x47a5('0x26')]({'attributes':[_0x47a5('0xb4')],'raw':!![]})[_0x47a5('0x1b')](function(_0x5084d6){var _0x3e7750=_0x5084d6['enableEmailPreview'];_0x4c9e6a['forEach'](function(_0x5db0ed){_0x2006cb[_0x47a5('0x24')](updateMailInteraction(_0x5db0ed,_0x162fa0,_0x133b7a,_0x3e7750));});return BPromise['all'](_0x2006cb);});});});})[_0x47a5('0x1b')](function(_0xf3edc8){_0x54ae35[_0x47a5('0xb5')]=_0xf3edc8;return _0x54ae35;})['then'](respondWithFilteredResult(_0x596097,_0x2ebba0))[_0x47a5('0x2a')](handleError(_0x596097,null));};exports[_0x47a5('0xb6')]=function(_0x35bf37,_0x121750){var _0x392ad7={'raw':![],'where':{'id':_0x35bf37[_0x47a5('0xb7')]['id']}},_0x581a87={};_0x581a87[_0x47a5('0x36')]=_['keys'](db[_0x47a5('0x32')][_0x47a5('0xb8')]);_0x581a87[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x35bf37[_0x47a5('0x38')]);_0x581a87[_0x47a5('0x3a')]=_['intersection'](_0x581a87[_0x47a5('0x36')],_0x581a87[_0x47a5('0x38')]);_0x392ad7['attributes']=_[_0x47a5('0x3b')](_0x581a87[_0x47a5('0x36')],qs[_0x47a5('0x3d')](_0x35bf37[_0x47a5('0x38')]['fields']));_0x392ad7['attributes']=_0x392ad7['attributes']['length']?_0x392ad7[_0x47a5('0x3c')]:_0x581a87[_0x47a5('0x36')];if(_0x35bf37[_0x47a5('0x38')][_0x47a5('0xb9')]){_0x392ad7[_0x47a5('0xba')]=[{'all':!![]}];}_0x392ad7=_[_0x47a5('0x94')]({},_0x392ad7,_0x35bf37[_0x47a5('0xbb')]);return db[_0x47a5('0x32')]['find'](_0x392ad7)[_0x47a5('0x1b')](handleEntityNotFound(_0x121750,null))[_0x47a5('0x1b')](respondWithResult(_0x121750,null))[_0x47a5('0x2a')](handleError(_0x121750,null));};exports[_0x47a5('0xbc')]=function(_0x47be87,_0x5ef411){return db[_0x47a5('0x32')]['create'](_0x47be87['body'],{})[_0x47a5('0x1b')](respondWithResult(_0x5ef411,0xc9))[_0x47a5('0x2a')](handleError(_0x5ef411,null));};exports['update']=function(_0x148742,_0x476991){if(_0x148742[_0x47a5('0xbd')]['id']){delete _0x148742['body']['id'];}return db[_0x47a5('0x32')][_0x47a5('0x5b')]({'where':{'id':_0x148742['params']['id']}})[_0x47a5('0x1b')](handleEntityNotFound(_0x476991,null))[_0x47a5('0x1b')](saveUpdates(_0x148742[_0x47a5('0xbd')],null))[_0x47a5('0x1b')](respondWithResult(_0x476991,null))[_0x47a5('0x2a')](handleError(_0x476991,null));};exports[_0x47a5('0x1c')]=function(_0x482c87,_0x3fee67){return db['MailInteraction'][_0x47a5('0x5b')]({'where':{'id':_0x482c87[_0x47a5('0xb7')]['id']}})[_0x47a5('0x1b')](handleEntityNotFound(_0x3fee67,null))[_0x47a5('0x1b')](removeEntity(_0x3fee67,null))['catch'](handleError(_0x3fee67,null));};exports[_0x47a5('0xbe')]=function(_0x281674,_0x151540){return db[_0x47a5('0x32')][_0x47a5('0xbe')]()[_0x47a5('0x1b')](respondWithResult(_0x151540,null))[_0x47a5('0x2a')](handleError(_0x151540,null));};exports[_0x47a5('0xbf')]=function(_0x1b3e82,_0xa2045c){return db[_0x47a5('0x25')][_0x47a5('0x5b')]({'where':{'id':_0x1b3e82['params']['id']}})[_0x47a5('0x1b')](handleEntityNotFound(_0xa2045c,null))[_0x47a5('0x1b')](function(_0x591bde){if(_0x591bde){return _0x591bde[_0x47a5('0xbf')](_0x1b3e82[_0x47a5('0xbd')][_0x47a5('0xc0')],_[_0x47a5('0xc1')](_0x1b3e82[_0x47a5('0xbd')],['ids','id'])||{});}})[_0x47a5('0x1b')](respondWithResult(_0xa2045c,null))[_0x47a5('0x2a')](handleError(_0xa2045c,null));};exports[_0x47a5('0xc2')]=function(_0x266a2f,_0x343214){var _0x363077={'raw':![],'where':{}};var _0x29c205={};var _0x5e4387={'count':0x0,'rows':[]};return db['MailInteraction'][_0x47a5('0x26')]({'where':{'id':_0x266a2f['params']['id']}})[_0x47a5('0x1b')](handleEntityNotFound(_0x343214,null))['then'](function(_0x12572f){if(_0x12572f){_0x29c205[_0x47a5('0x36')]=_[_0x47a5('0x39')](db[_0x47a5('0x25')]['rawAttributes']);_0x29c205[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x266a2f[_0x47a5('0x38')]);_0x29c205['filters']=_['intersection'](_0x29c205[_0x47a5('0x36')],_0x29c205[_0x47a5('0x38')]);_0x363077[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x29c205[_0x47a5('0x36')],qs[_0x47a5('0x3d')](_0x266a2f[_0x47a5('0x38')][_0x47a5('0x3d')]));_0x363077['attributes']=_0x363077[_0x47a5('0x3c')]['length']?_0x363077[_0x47a5('0x3c')]:_0x29c205[_0x47a5('0x36')];if(!_0x266a2f['query']['hasOwnProperty'](_0x47a5('0x3f'))){_0x363077[_0x47a5('0x16')]=qs['limit'](_0x266a2f[_0x47a5('0x38')][_0x47a5('0x16')]);_0x363077[_0x47a5('0x14')]=qs[_0x47a5('0x14')](_0x266a2f['query'][_0x47a5('0x14')]);}_0x363077['order']=qs['sort'](_0x266a2f['query'][_0x47a5('0x41')]);_0x363077['where']=qs[_0x47a5('0x3a')](_[_0x47a5('0x43')](_0x266a2f[_0x47a5('0x38')],_0x29c205[_0x47a5('0x3a')]));_0x363077[_0x47a5('0x42')][_0x47a5('0xc3')]=_0x12572f['id'];if(_0x266a2f[_0x47a5('0x38')][_0x47a5('0x7c')]){_0x363077[_0x47a5('0x42')]=_[_0x47a5('0x94')](_0x363077[_0x47a5('0x42')],{'$or':_[_0x47a5('0x37')](_0x363077[_0x47a5('0x3c')],function(_0x1bfa3b){var _0xff64fb={};_0xff64fb[_0x1bfa3b]={'$like':'%'+_0x266a2f['query'][_0x47a5('0x7c')]+'%'};return _0xff64fb;})});}if(_0x266a2f[_0x47a5('0x38')][_0x47a5('0x71')]){var _0x2fa5e3=_0x266a2f['query'][_0x47a5('0x71')]['split'](',');var _0x4476b5={};_0x4476b5[_0x2fa5e3[0x0]]={'$gte':moment(_0x2fa5e3[0x1])['format'](_0x47a5('0xc4'))};_0x363077[_0x47a5('0x42')]=_[_0x47a5('0x94')](_0x363077['where'],_0x4476b5);}_0x363077=_[_0x47a5('0x94')]({},_0x363077,_0x266a2f[_0x47a5('0xbb')]);return db[_0x47a5('0x25')]['count']({'where':_0x363077['where']})[_0x47a5('0x1b')](function(_0x1a5e07){_0x5e4387[_0x47a5('0x17')]=_0x1a5e07;if(_0x266a2f[_0x47a5('0x38')][_0x47a5('0xb9')]){_0x363077['include']=[{'all':!![]}];}return db[_0x47a5('0x25')]['findAll'](_0x363077);})[_0x47a5('0x1b')](function(_0xdeaf4e){if(_0x266a2f[_0x47a5('0x38')][_0x47a5('0xc5')]==='true'){for(var _0x4dc67c=0x0;_0x4dc67c<_0xdeaf4e[_0x47a5('0x5a')];_0x4dc67c++){_0xdeaf4e[_0x4dc67c][_0x47a5('0xbd')]=juice(_0xdeaf4e[_0x4dc67c][_0x47a5('0xbd')]);}}_0x5e4387[_0x47a5('0xb5')]=_0xdeaf4e;return _0x5e4387;});}})[_0x47a5('0x1b')](respondWithFilteredResult(_0x343214,_0x363077))[_0x47a5('0x2a')](handleError(_0x343214,null));};exports[_0x47a5('0xc6')]=function(_0x3ae5b5,_0x2c2245){return db['MailInteraction']['find']({'where':{'id':_0x3ae5b5[_0x47a5('0xb7')]['id']}})['then'](handleEntityNotFound(_0x2c2245,null))[_0x47a5('0x1b')](function(_0x2d0b67){if(_0x2d0b67){return _0x2d0b67[_0x47a5('0xc7')](_0x3ae5b5['body'][_0x47a5('0xc0')],_[_0x47a5('0xc1')](_0x3ae5b5['body'],[_0x47a5('0xc0'),'id'])||{})['spread'](function(){return db[_0x47a5('0x65')][_0x47a5('0xc8')]({'attributes':['id',_0x47a5('0x1e'),'color'],'where':{'id':_0x3ae5b5['body']['ids']}});})['then'](function(_0x5075a6){socket[_0x47a5('0xc9')]('mailInteractionTags:save',{'id':Number(_0x3ae5b5[_0x47a5('0xb7')]['id']),'tags':_0x5075a6||[]});return{'id':Number(_0x3ae5b5[_0x47a5('0xb7')]['id']),'tags':_0x5075a6||[]};});}})['then'](respondWithResult(_0x2c2245,null))['catch'](handleError(_0x2c2245,null));};exports['removeTags']=function(_0x2a6dca,_0x4e0dfa){return db['MailInteraction']['find']({'where':{'id':_0x2a6dca[_0x47a5('0xb7')]['id']}})[_0x47a5('0x1b')](handleEntityNotFound(_0x4e0dfa,null))[_0x47a5('0x1b')](function(_0xdb9128){if(_0xdb9128){return _0xdb9128['removeTags'](_0x2a6dca[_0x47a5('0x38')]['ids']);}})[_0x47a5('0x1b')](respondWithStatusCode(_0x4e0dfa,null))['catch'](handleError(_0x4e0dfa,null));};exports[_0x47a5('0xca')]=function(_0x1b4491,_0x10f3ae){var _0x4f8171=moment()[_0x47a5('0xcb')]()[_0x47a5('0xb0')]();var _0xc1c968=path[_0x47a5('0xcc')](config['root'],_0x47a5('0xcd'),_0x47a5('0xce'),_0x47a5('0xcf'));var _0x435326=path[_0x47a5('0xcc')](config[_0x47a5('0xd0')],'server',_0x47a5('0xce'),_0x47a5('0xd1'));var _0x871006=path[_0x47a5('0xcc')](_0xc1c968,_0x4f8171);var _0x226b87=util[_0x47a5('0xd2')](_0x47a5('0xd3'),_0x1b4491[_0x47a5('0xb7')]['id'],_0x4f8171);var _0x408887=path[_0x47a5('0xcc')](_0xc1c968,_0x226b87);var _0x406875=[];if(_0x1b4491[_0x47a5('0x38')][_0x47a5('0xd1')]){_0x406875[_0x47a5('0x24')]({'model':db[_0x47a5('0xd4')],'as':_0x47a5('0xd5'),'raw':!![]});}var _0x40505e=[{'model':db['MailMessage'],'as':_0x47a5('0xd6'),'attributes':['id','body','from','to','cc',_0x47a5('0xd7'),_0x47a5('0xd8'),_0x47a5('0xd9')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x406875}];return db[_0x47a5('0x32')][_0x47a5('0x5b')]({'where':{'id':_0x1b4491[_0x47a5('0xb7')]['id']},'include':_0x40505e})[_0x47a5('0x1b')](handleEntityNotFound(_0x10f3ae,null))[_0x47a5('0x1b')](function(_0x28ba38){if(_0x28ba38&&_0x28ba38[_0x47a5('0xd6')]){var _0x46cb3a=_0x28ba38[_0x47a5('0xda')]({'plain':!![]});fs[_0x47a5('0xdb')](_0x871006);return BPromise[_0x47a5('0xdc')](_0x46cb3a[_0x47a5('0xd6')],function(_0x203bc9,_0x4d7fd4){var _0x4aad5f={'from':_0x203bc9[_0x47a5('0x46')],'to':_0x203bc9['to'],'subject':_0x203bc9['subject'],'html':htmlEntities[_0x47a5('0xdd')](_0x203bc9[_0x47a5('0xbd')]),'headers':{'Date':moment(_0x203bc9[_0x47a5('0xd9')])[_0x47a5('0xd2')](_0x47a5('0xde'))},'attachments':[]};if(_0x203bc9['cc']){_0x4aad5f[_0x47a5('0xdf')]['Cc']=_0x203bc9['cc'];}if(_0x203bc9['bcc']){_0x4aad5f[_0x47a5('0xdf')][_0x47a5('0xe0')]=_0x203bc9[_0x47a5('0xd7')];}return new BPromise(function(_0x5ca5bc,_0x19c94a){if(_0x203bc9[_0x47a5('0xd5')]){for(var _0x3ecc41=0x0;_0x3ecc41<_0x203bc9[_0x47a5('0xd5')][_0x47a5('0x5a')];_0x3ecc41++){var _0x23e649=_0x203bc9[_0x47a5('0xd5')][_0x3ecc41];var _0x46615a=path[_0x47a5('0xcc')](_0x435326,_0x23e649[_0x47a5('0xe1')]);if(fs[_0x47a5('0xe2')](_0x46615a)){_0x4aad5f[_0x47a5('0xd1')][_0x47a5('0x24')]({'name':_0x23e649[_0x47a5('0x1e')],'contentType':_0x23e649[_0x47a5('0x34')],'data':fs[_0x47a5('0xe3')](_0x46615a)});}}}emlformat[_0x47a5('0xe4')](_0x4aad5f,function(_0x150cff,_0x2ee27c){if(_0x150cff)return _0x19c94a(_0x150cff);fs[_0x47a5('0xe5')](path[_0x47a5('0xcc')](_0x871006,util[_0x47a5('0xd2')]('message%d.eml',_0x4d7fd4)),_0x2ee27c);return _0x5ca5bc(_0x2ee27c);});});})[_0x47a5('0x1b')](function(){return new BPromise(function(_0x55972a,_0x1240fd){zipdir(_0x871006,{'saveTo':_0x408887},function(_0xf465a8,_0x1247b4){if(_0xf465a8)return _0x1240fd(_0xf465a8);return _0x55972a(_0x1247b4);});})[_0x47a5('0x1b')](function(){return new BPromise(function(_0x3804f2,_0x9c376a){rimraf(_0x871006,function(_0x2dac7d){if(_0x2dac7d)_0x9c376a(_0x2dac7d);return _0x3804f2();});});})[_0x47a5('0x1b')](function(){return _0x10f3ae['download'](_0x408887,_0x226b87,function(_0x25fdca){if(!_0x25fdca)fs[_0x47a5('0xe6')](_0x408887);});});});}else{return _0x10f3ae[_0x47a5('0x10')](0xc8);}})['catch'](handleError(_0x10f3ae,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 7d563e8..5f3d61e 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 _0x8a7e=['setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','MailMessage','setMaxListeners','save','remove'];(function(_0x1e77c7,_0x3afb17){var _0x3f170e=function(_0x511934){while(--_0x511934){_0x1e77c7['push'](_0x1e77c7['shift']());}};_0x3f170e(++_0x3afb17);}(_0x8a7e,0x120));var _0xe8a7=function(_0x29b551,_0x3b3d76){_0x29b551=_0x29b551-0x0;var _0x3ec4e6=_0x8a7e[_0x29b551];return _0x3ec4e6;};'use strict';var EventEmitter=require(_0xe8a7('0x0'));var MailInteraction=require(_0xe8a7('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xe8a7('0x1'))['db'][_0xe8a7('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xe8a7('0x3')](0x0);var events={'afterCreate':_0xe8a7('0x4'),'afterUpdate':'update','afterDestroy':_0xe8a7('0x5')};function emitEvent(_0x3a59bf){return function(_0x508c41,_0x9ca528,_0x137561){_0x508c41['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x4c6fe6){_0x508c41[_0xe8a7('0x6')](_0xe8a7('0x7'),_0x4c6fe6[_0xe8a7('0x8')](function(_0x1998c1){return{'id':_0x1998c1['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x508c41['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x7aecc0){_0x508c41[_0xe8a7('0x6')](_0xe8a7('0x9'),_0x7aecc0[_0xe8a7('0xa')]);MailInteractionEvents[_0xe8a7('0xb')](_0x3a59bf+':'+_0x508c41['id'],_0x508c41);MailInteractionEvents[_0xe8a7('0xb')](_0x3a59bf,_0x508c41);_0x137561(null);})[_0xe8a7('0xc')](_0x137561(null));};}for(var e in events){if(events[_0xe8a7('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x8f09=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','map','findAll','then','setDataValue','unreadMessages','length'];(function(_0x4bc688,_0x47cbb1){var _0x453ac6=function(_0x5dbf73){while(--_0x5dbf73){_0x4bc688['push'](_0x4bc688['shift']());}};_0x453ac6(++_0x47cbb1);}(_0x8f09,0xa7));var _0x98f0=function(_0x51c7ef,_0x306a5a){_0x51c7ef=_0x51c7ef-0x0;var _0x3c836d=_0x8f09[_0x51c7ef];return _0x3c836d;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x98f0('0x0'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x98f0('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x98f0('0x2')](0x0);var events={'afterCreate':_0x98f0('0x3'),'afterUpdate':_0x98f0('0x4'),'afterDestroy':_0x98f0('0x5')};function emitEvent(_0x241cf0){return function(_0x1d43e8,_0x47a37e,_0x5526ca){_0x1d43e8[_0x98f0('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x150162){_0x1d43e8['setDataValue']('Users',_0x150162[_0x98f0('0x7')](function(_0x4c1588){return{'id':_0x4c1588['id']};}));return MailMessage[_0x98f0('0x8')]({'where':{'MailInteractionId':_0x1d43e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x98f0('0x9')](function(_0x303a21){_0x1d43e8[_0x98f0('0xa')](_0x98f0('0xb'),_0x303a21[_0x98f0('0xc')]);MailInteractionEvents[_0x98f0('0xd')](_0x241cf0+':'+_0x1d43e8['id'],_0x1d43e8);MailInteractionEvents['emit'](_0x241cf0,_0x1d43e8);_0x5526ca(null);})[_0x98f0('0xe')](_0x5526ca(null));};}for(var e in events){if(events[_0x98f0('0xf')](e)){var event=events[e];MailInteraction[_0x98f0('0x10')](e,emitEvent(event));}}module[_0x98f0('0x11')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index cfad4ab..ad17851 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 _0xf56c=['define','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','changed','format','closedAt','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports'];(function(_0x2bba58,_0x28cf61){var _0x366f2b=function(_0x1cb322){while(--_0x1cb322){_0x2bba58['push'](_0x2bba58['shift']());}};_0x366f2b(++_0x28cf61);}(_0xf56c,0x69));var _0xcf56=function(_0x38b7bb,_0x21fd02){_0x38b7bb=_0x38b7bb-0x0;var _0x183069=_0xf56c[_0x38b7bb];return _0x183069;};'use strict';var _=require('lodash');var util=require(_0xcf56('0x0'));var logger=require(_0xcf56('0x1'))(_0xcf56('0x2'));var moment=require(_0xcf56('0x3'));var BPromise=require(_0xcf56('0x4'));var rp=require(_0xcf56('0x5'));var fs=require('fs');var path=require(_0xcf56('0x6'));var rimraf=require(_0xcf56('0x7'));var config=require(_0xcf56('0x8'));var attributes=require(_0xcf56('0x9'));module[_0xcf56('0xa')]=function(_0x353da4,_0x5e371a){return _0x353da4[_0xcf56('0xb')]('MailInteraction',attributes,{'tableName':_0xcf56('0xc'),'paranoid':![],'indexes':[{'name':_0xcf56('0xd'),'fields':[_0xcf56('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5592e4,_0x24db5a,_0x5b1999){if(_0x5592e4[_0xcf56('0xf')]){_0x5592e4[_0xcf56('0x10')]=moment()['format'](_0xcf56('0x11'));}if(_0x5592e4[_0xcf56('0x12')]){_0x5592e4['closedAt']=moment()['format'](_0xcf56('0x11'));}_0x5b1999(null,_0x24db5a);},'beforeUpdate':function(_0x25f01c,_0x4182c5,_0x1958ab){if(_0x25f01c[_0xcf56('0x13')]('substatus')){_0x25f01c[_0xcf56('0x10')]=_0x25f01c['substatus']?moment()[_0xcf56('0x14')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x25f01c[_0xcf56('0x13')](_0xcf56('0x12'))){_0x25f01c[_0xcf56('0x15')]=moment()[_0xcf56('0x14')](_0xcf56('0x11'));_0x25f01c[_0xcf56('0xf')]=null;_0x25f01c['substatusAt']=null;}_0x1958ab(null,_0x25f01c);},'afterUpdate':function(_0x56b249,_0x5af129,_0x428516){var _0x3d5b78=_0x353da4[_0xcf56('0x16')];var _0x4f7f45=_0x56b249[_0xcf56('0x17')]({'plain':!![]});if(_0x4f7f45[_0xcf56('0x12')]){return _0x3d5b78[_0xcf56('0x18')][_0xcf56('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x4f7f45['id']}})['then'](function(){_0x428516();})[_0xcf56('0x1a')](function(_0x532f05){_0x428516(_0x532f05);});}else{_0x428516();}}},'charset':_0xcf56('0x1b'),'collate':_0xcf56('0x1c')});}; \ No newline at end of file +var _0xdbc9=['MailMessage','update','then','util','api','moment','bluebird','request-promise','exports','MailInteraction','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','format','models'];(function(_0x55f2c3,_0x38aab3){var _0x5ae790=function(_0x2625e5){while(--_0x2625e5){_0x55f2c3['push'](_0x55f2c3['shift']());}};_0x5ae790(++_0x38aab3);}(_0xdbc9,0x8f));var _0x9dbc=function(_0x26c317,_0x41c0dd){_0x26c317=_0x26c317-0x0;var _0x2d8726=_0xdbc9[_0x26c317];return _0x2d8726;};'use strict';var _=require('lodash');var util=require(_0x9dbc('0x0'));var logger=require('../../config/logger')(_0x9dbc('0x1'));var moment=require(_0x9dbc('0x2'));var BPromise=require(_0x9dbc('0x3'));var rp=require(_0x9dbc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x9dbc('0x5')]=function(_0x572a3c,_0x31eba2){return _0x572a3c['define'](_0x9dbc('0x6'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x9dbc('0x7'),'to'],'type':_0x9dbc('0x8')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x237bbb,_0x31006f,_0x1a0ccb){if(_0x237bbb[_0x9dbc('0x9')]){_0x237bbb['substatusAt']=moment()['format'](_0x9dbc('0xa'));}if(_0x237bbb[_0x9dbc('0xb')]){_0x237bbb[_0x9dbc('0xc')]=moment()['format'](_0x9dbc('0xa'));}_0x1a0ccb(null,_0x31006f);},'beforeUpdate':function(_0x5e473f,_0x317d23,_0x486daa){if(_0x5e473f[_0x9dbc('0xd')]('substatus')){_0x5e473f[_0x9dbc('0xe')]=_0x5e473f[_0x9dbc('0x9')]?moment()[_0x9dbc('0xf')](_0x9dbc('0xa')):null;}if(_0x5e473f[_0x9dbc('0xd')](_0x9dbc('0xb'))){_0x5e473f[_0x9dbc('0xc')]=moment()[_0x9dbc('0xf')](_0x9dbc('0xa'));_0x5e473f['substatus']=null;_0x5e473f[_0x9dbc('0xe')]=null;}_0x486daa(null,_0x5e473f);},'afterUpdate':function(_0x15c2b9,_0x231b5f,_0x2da8b3){var _0x1705ef=_0x572a3c[_0x9dbc('0x10')];var _0xa0758b=_0x15c2b9['get']({'plain':!![]});if(_0xa0758b['closed']){return _0x1705ef[_0x9dbc('0x11')][_0x9dbc('0x12')]({'read':!![]},{'where':{'MailInteractionId':_0xa0758b['id']}})[_0x9dbc('0x13')](function(){_0x2da8b3();})['catch'](function(_0x4b78a5){_0x2da8b3(_0x4b78a5);});}else{_0x2da8b3();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index dbd930b..fa1919d 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 _0x99e0=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','UpdateMailInteraction','MailInteraction','update','body','options','attributes','catch','AddTagsToMailInteraction','find','where','ids','omit','spread','AddTags','lodash','util'];(function(_0x15ce61,_0x10541d){var _0x50771d=function(_0x3d780d){while(--_0x3d780d){_0x15ce61['push'](_0x15ce61['shift']());}};_0x50771d(++_0x10541d);}(_0x99e0,0xd0));var _0x099e=function(_0x273d58,_0x2f7787){_0x273d58=_0x273d58-0x0;var _0xbbe6b4=_0x99e0[_0x273d58];return _0xbbe6b4;};'use strict';var _=require(_0x099e('0x0'));var util=require(_0x099e('0x1'));var moment=require(_0x099e('0x2'));var BPromise=require(_0x099e('0x3'));var rs=require(_0x099e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x099e('0x5'))['db'];var utils=require(_0x099e('0x6'));var logger=require(_0x099e('0x7'))(_0x099e('0x8'));var config=require(_0x099e('0x9'));var jayson=require(_0x099e('0xa'));var client=jayson['client'][_0x099e('0xb')]({'port':0x232a});config[_0x099e('0xc')]=_[_0x099e('0xd')](config['redis'],{'host':_0x099e('0xe'),'port':0x18eb});var socket=require(_0x099e('0xf'))(new Redis(config[_0x099e('0xc')]));require(_0x099e('0x10'))['register'](socket);function respondWithRpcPromise(_0x5506bb,_0x359188,_0x1bb8f4){return new BPromise(function(_0x1bb0e2,_0x290a06){return client[_0x099e('0x11')](_0x5506bb,_0x1bb8f4)[_0x099e('0x12')](function(_0x1e97c0){logger[_0x099e('0x13')]('MailInteraction,\x20%s,\x20%s',_0x359188,_0x099e('0x14'));logger[_0x099e('0x15')](_0x099e('0x16'),_0x359188,_0x099e('0x14'),JSON[_0x099e('0x17')](_0x1e97c0));if(_0x1e97c0[_0x099e('0x18')]){if(_0x1e97c0[_0x099e('0x18')][_0x099e('0x19')]===0x1f4){logger[_0x099e('0x18')](_0x099e('0x1a'),_0x359188,_0x1e97c0[_0x099e('0x18')][_0x099e('0x1b')]);return _0x290a06(_0x1e97c0[_0x099e('0x18')]['message']);}logger[_0x099e('0x18')](_0x099e('0x1a'),_0x359188,_0x1e97c0[_0x099e('0x18')][_0x099e('0x1b')]);return _0x1bb0e2(_0x1e97c0[_0x099e('0x18')][_0x099e('0x1b')]);}else{logger[_0x099e('0x13')](_0x099e('0x1a'),_0x359188,_0x099e('0x14'));_0x1bb0e2(_0x1e97c0['result'][_0x099e('0x1b')]);}})['catch'](function(_0x3602df){logger[_0x099e('0x18')](_0x099e('0x1a'),_0x359188,_0x3602df);_0x290a06(_0x3602df);});});}exports[_0x099e('0x1c')]=function(_0x37e0ba){var _0x16648c=this;return new Promise(function(_0xeab23d,_0x4be7d2){return db[_0x099e('0x1d')][_0x099e('0x1e')](_0x37e0ba[_0x099e('0x1f')],{'raw':_0x37e0ba[_0x099e('0x20')]?_0x37e0ba[_0x099e('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37e0ba[_0x099e('0x20')]?_0x37e0ba['options']['where']||null:null,'attributes':_0x37e0ba[_0x099e('0x20')]?_0x37e0ba[_0x099e('0x20')][_0x099e('0x21')]||null:null,'limit':_0x37e0ba['options']?_0x37e0ba['options']['limit']||null:null})['then'](function(_0x6941f4){logger['info'](_0x099e('0x1c'),_0x37e0ba);logger['debug'](_0x099e('0x1c'),_0x37e0ba,JSON[_0x099e('0x17')](_0x6941f4));_0xeab23d(_0x6941f4);})[_0x099e('0x22')](function(_0x2e1428){logger['error']('UpdateMailInteraction',_0x2e1428[_0x099e('0x1b')],_0x37e0ba);_0x4be7d2(_0x16648c[_0x099e('0x18')](0x1f4,_0x2e1428[_0x099e('0x1b')]));});});};exports[_0x099e('0x23')]=function(_0x4611ff){return new Promise(function(_0xa355da,_0x1379f1){return db['MailInteraction'][_0x099e('0x24')]({'where':_0x4611ff[_0x099e('0x20')]?_0x4611ff[_0x099e('0x20')][_0x099e('0x25')]||null:null})[_0x099e('0x12')](function(_0x20ba6a){if(_0x20ba6a){return _0x20ba6a['addTags'](_0x4611ff[_0x099e('0x1f')][_0x099e('0x26')],_[_0x099e('0x27')](_0x4611ff[_0x099e('0x1f')],[_0x099e('0x26'),'id'])||{});}})[_0x099e('0x28')](function(_0x26a36c){logger['info'](_0x099e('0x29'),_0x4611ff);logger[_0x099e('0x15')](_0x099e('0x29'),_0x4611ff,JSON['stringify'](_0x26a36c));_0xa355da(_0x26a36c);})[_0x099e('0x22')](function(_0x529e41){logger[_0x099e('0x18')](_0x099e('0x29'),_0x529e41[_0x099e('0x1b')],_0x4611ff);_0x1379f1(_this['error'](0x1f4,_0x529e41['message']));});});}; \ No newline at end of file +var _0x0496=['spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','info','UpdateMailInteraction','MailInteraction','body','raw','options','where','attributes','catch','find','then','omit'];(function(_0x38e8b0,_0x5b8cb5){var _0x139697=function(_0x2042dd){while(--_0x2042dd){_0x38e8b0['push'](_0x38e8b0['shift']());}};_0x139697(++_0x5b8cb5);}(_0x0496,0x199));var _0x6049=function(_0x4acf02,_0x35daf9){_0x4acf02=_0x4acf02-0x0;var _0x5f3be6=_0x0496[_0x4acf02];return _0x5f3be6;};'use strict';var _=require(_0x6049('0x0'));var util=require('util');var moment=require(_0x6049('0x1'));var BPromise=require(_0x6049('0x2'));var rs=require(_0x6049('0x3'));var fs=require('fs');var Redis=require(_0x6049('0x4'));var db=require(_0x6049('0x5'))['db'];var utils=require(_0x6049('0x6'));var logger=require('../../config/logger')(_0x6049('0x7'));var config=require(_0x6049('0x8'));var jayson=require(_0x6049('0x9'));var client=jayson[_0x6049('0xa')][_0x6049('0xb')]({'port':0x232a});config[_0x6049('0xc')]=_[_0x6049('0xd')](config[_0x6049('0xc')],{'host':_0x6049('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6049('0xc')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x6e70d5,_0x154b59,_0x48955e){return new BPromise(function(_0x22fbdb,_0x4df14b){return client[_0x6049('0xf')](_0x6e70d5,_0x48955e)['then'](function(_0x4429e3){logger['info']('MailInteraction,\x20%s,\x20%s',_0x154b59,_0x6049('0x10'));logger[_0x6049('0x11')](_0x6049('0x12'),_0x154b59,'request\x20sent',JSON[_0x6049('0x13')](_0x4429e3));if(_0x4429e3[_0x6049('0x14')]){if(_0x4429e3[_0x6049('0x14')]['code']===0x1f4){logger[_0x6049('0x14')](_0x6049('0x15'),_0x154b59,_0x4429e3[_0x6049('0x14')][_0x6049('0x16')]);return _0x4df14b(_0x4429e3[_0x6049('0x14')]['message']);}logger[_0x6049('0x14')](_0x6049('0x15'),_0x154b59,_0x4429e3[_0x6049('0x14')][_0x6049('0x16')]);return _0x22fbdb(_0x4429e3['error'][_0x6049('0x16')]);}else{logger[_0x6049('0x17')](_0x6049('0x15'),_0x154b59,_0x6049('0x10'));_0x22fbdb(_0x4429e3['result'][_0x6049('0x16')]);}})['catch'](function(_0x1fd624){logger['error'](_0x6049('0x15'),_0x154b59,_0x1fd624);_0x4df14b(_0x1fd624);});});}exports[_0x6049('0x18')]=function(_0x53e71a){var _0x4c82df=this;return new Promise(function(_0x4af4dd,_0x5519eb){return db[_0x6049('0x19')]['update'](_0x53e71a[_0x6049('0x1a')],{'raw':_0x53e71a['options']?_0x53e71a['options'][_0x6049('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53e71a[_0x6049('0x1c')]?_0x53e71a['options'][_0x6049('0x1d')]||null:null,'attributes':_0x53e71a[_0x6049('0x1c')]?_0x53e71a[_0x6049('0x1c')][_0x6049('0x1e')]||null:null,'limit':_0x53e71a[_0x6049('0x1c')]?_0x53e71a[_0x6049('0x1c')]['limit']||null:null})['then'](function(_0xaa0fde){logger[_0x6049('0x17')](_0x6049('0x18'),_0x53e71a);logger[_0x6049('0x11')](_0x6049('0x18'),_0x53e71a,JSON[_0x6049('0x13')](_0xaa0fde));_0x4af4dd(_0xaa0fde);})[_0x6049('0x1f')](function(_0xe754fd){logger[_0x6049('0x14')](_0x6049('0x18'),_0xe754fd[_0x6049('0x16')],_0x53e71a);_0x5519eb(_0x4c82df[_0x6049('0x14')](0x1f4,_0xe754fd[_0x6049('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x4fbc30){return new Promise(function(_0x321f39,_0x3d32b8){return db[_0x6049('0x19')][_0x6049('0x20')]({'where':_0x4fbc30['options']?_0x4fbc30[_0x6049('0x1c')][_0x6049('0x1d')]||null:null})[_0x6049('0x21')](function(_0x12a4e6){if(_0x12a4e6){return _0x12a4e6['addTags'](_0x4fbc30['body']['ids'],_[_0x6049('0x22')](_0x4fbc30[_0x6049('0x1a')],['ids','id'])||{});}})[_0x6049('0x23')](function(_0x1f0136){logger[_0x6049('0x17')](_0x6049('0x24'),_0x4fbc30);logger['debug'](_0x6049('0x24'),_0x4fbc30,JSON[_0x6049('0x13')](_0x1f0136));_0x321f39(_0x1f0136);})[_0x6049('0x1f')](function(_0x54aabe){logger['error']('AddTags',_0x54aabe[_0x6049('0x16')],_0x4fbc30);_0x3d32b8(_this[_0x6049('0x14')](0x1f4,_0x54aabe[_0x6049('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index b96175c..7365e7c 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 _0x4d6f=['mailInteraction:','./mailInteraction.events','save','update','removeListener','register','length'];(function(_0x3ec07f,_0x47f269){var _0x338bf6=function(_0x531236){while(--_0x531236){_0x3ec07f['push'](_0x3ec07f['shift']());}};_0x338bf6(++_0x47f269);}(_0x4d6f,0x16d));var _0xf4d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d6f[_0x321bb2];return _0x9c12ed;};'use strict';var MailInteractionEvents=require(_0xf4d6('0x0'));var events=[_0xf4d6('0x1'),'remove',_0xf4d6('0x2')];function createListener(_0x1ff4cf,_0x12255d){return function(_0x3271f1){_0x12255d['emit'](_0x1ff4cf,_0x3271f1);};}function removeListener(_0x474d84,_0x56c17c){return function(){MailInteractionEvents[_0xf4d6('0x3')](_0x474d84,_0x56c17c);};}exports[_0xf4d6('0x4')]=function(_0x448236){for(var _0x37247b=0x0,_0x3d901c=events[_0xf4d6('0x5')];_0x37247b<_0x3d901c;_0x37247b++){var _0x4bec81=events[_0x37247b];var _0x173138=createListener(_0xf4d6('0x6')+_0x4bec81,_0x448236);MailInteractionEvents['on'](_0x4bec81,_0x173138);}}; \ No newline at end of file +var _0x75fa=['remove','emit','removeListener','mailInteraction:','save'];(function(_0x20397a,_0x55b29c){var _0x27e55a=function(_0x328b1e){while(--_0x328b1e){_0x20397a['push'](_0x20397a['shift']());}};_0x27e55a(++_0x55b29c);}(_0x75fa,0x199));var _0xa75f=function(_0x252949,_0x2959dd){_0x252949=_0x252949-0x0;var _0xab0a7d=_0x75fa[_0x252949];return _0xab0a7d;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xa75f('0x0'),_0xa75f('0x1'),'update'];function createListener(_0x157f81,_0x11db9c){return function(_0x52f905){_0x11db9c[_0xa75f('0x2')](_0x157f81,_0x52f905);};}function removeListener(_0x3e60ce,_0x375bc0){return function(){MailInteractionEvents[_0xa75f('0x3')](_0x3e60ce,_0x375bc0);};}exports['register']=function(_0x38a1e6){for(var _0x360f77=0x0,_0xa94131=events['length'];_0x360f77<_0xa94131;_0x360f77++){var _0x2d17d9=events[_0x360f77];var _0x130230=createListener(_0xa75f('0x4')+_0x2d17d9,_0x38a1e6);MailInteractionEvents['on'](_0x2d17d9,_0x130230);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 24cd051..de8f0ab 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 _0x188e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','show','/:id/download','download','post','tracked','mail','mailmessage:create','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path'];(function(_0x51d7bb,_0x5b6a74){var _0x220b75=function(_0x53fa50){while(--_0x53fa50){_0x51d7bb['push'](_0x51d7bb['shift']());}};_0x220b75(++_0x5b6a74);}(_0x188e,0x1cf));var _0xe188=function(_0x58bf9b,_0x53ed81){_0x58bf9b=_0x58bf9b-0x0;var _0x550b79=_0x188e[_0x58bf9b];return _0x550b79;};'use strict';var multer=require('multer');var util=require(_0xe188('0x0'));var path=require(_0xe188('0x1'));var timeout=require('connect-timeout');var express=require(_0xe188('0x2'));var router=express[_0xe188('0x3')]();var fs_extra=require(_0xe188('0x4'));var auth=require(_0xe188('0x5'));var interaction=require(_0xe188('0x6'));var config=require(_0xe188('0x7'));var controller=require(_0xe188('0x8'));router['get']('/',auth[_0xe188('0x9')](),controller[_0xe188('0xa')]);router[_0xe188('0xb')](_0xe188('0xc'),auth[_0xe188('0x9')](),controller[_0xe188('0xd')]);router[_0xe188('0xb')]('/:id',auth[_0xe188('0x9')](),controller[_0xe188('0xe')]);router[_0xe188('0xb')](_0xe188('0xf'),auth[_0xe188('0x9')](),controller[_0xe188('0x10')]);router[_0xe188('0x11')]('/',auth['isAuthenticated'](),interaction[_0xe188('0x12')](_0xe188('0x13'),_0xe188('0x14')),controller['create']);router[_0xe188('0x15')](_0xe188('0x16'),auth[_0xe188('0x9')](),controller[_0xe188('0x17')]);router[_0xe188('0x15')](_0xe188('0x18'),auth['isAuthenticated'](),controller[_0xe188('0x19')]);router[_0xe188('0x15')](_0xe188('0x1a'),auth[_0xe188('0x9')](),controller[_0xe188('0x1b')]);router[_0xe188('0x1c')]('/:id',auth[_0xe188('0x9')](),controller[_0xe188('0x1d')]);module[_0xe188('0x1e')]=router; \ No newline at end of file +var _0x68f9=['../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','update','/:id/accept','accept','put','/:id/reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x19df6c,_0x2b9be1){var _0x5e84c5=function(_0x3a58d1){while(--_0x3a58d1){_0x19df6c['push'](_0x19df6c['shift']());}};_0x5e84c5(++_0x2b9be1);}(_0x68f9,0xca));var _0x968f=function(_0x57a486,_0x361617){_0x57a486=_0x57a486-0x0;var _0x10b12b=_0x68f9[_0x57a486];return _0x10b12b;};'use strict';var multer=require(_0x968f('0x0'));var util=require(_0x968f('0x1'));var path=require(_0x968f('0x2'));var timeout=require(_0x968f('0x3'));var express=require(_0x968f('0x4'));var router=express[_0x968f('0x5')]();var fs_extra=require(_0x968f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x968f('0x7'));var config=require(_0x968f('0x8'));var controller=require(_0x968f('0x9'));router[_0x968f('0xa')]('/',auth[_0x968f('0xb')](),controller[_0x968f('0xc')]);router['get'](_0x968f('0xd'),auth['isAuthenticated'](),controller[_0x968f('0xe')]);router[_0x968f('0xa')](_0x968f('0xf'),auth['isAuthenticated'](),controller[_0x968f('0x10')]);router[_0x968f('0xa')](_0x968f('0x11'),auth[_0x968f('0xb')](),controller[_0x968f('0x12')]);router[_0x968f('0x13')]('/',auth[_0x968f('0xb')](),interaction['tracked'](_0x968f('0x14'),_0x968f('0x15')),controller[_0x968f('0x16')]);router['put'](_0x968f('0xf'),auth[_0x968f('0xb')](),controller[_0x968f('0x17')]);router['put'](_0x968f('0x18'),auth[_0x968f('0xb')](),controller[_0x968f('0x19')]);router[_0x968f('0x1a')](_0x968f('0x1b'),auth[_0x968f('0xb')](),controller['reject']);router[_0x968f('0x1c')](_0x968f('0xf'),auth[_0x968f('0xb')](),controller[_0x968f('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index bfb7989..a29e7e0 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 _0x9a28=['Email','Chat','sequelize','lodash','long','TEXT','BOOLEAN','ENUM','out','STRING','INTEGER','DATE'];(function(_0x598a60,_0x45b37b){var _0x353ca0=function(_0x35168a){while(--_0x35168a){_0x598a60['push'](_0x598a60['shift']());}};_0x353ca0(++_0x45b37b);}(_0x9a28,0x16a));var _0x89a2=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x9a28[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0x89a2('0x0'));var _=require(_0x89a2('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x89a2('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x89a2('0x3')]('medium')},'read':{'type':Sequelize[_0x89a2('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x89a2('0x5')]('in',_0x89a2('0x6')),'defaultValue':_0x89a2('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x89a2('0x7')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x89a2('0x3')]('long')},'bcc':{'type':Sequelize[_0x89a2('0x3')]('long')},'subject':{'type':Sequelize[_0x89a2('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x89a2('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x89a2('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x89a2('0x9')]},'originTo':{'type':Sequelize[_0x89a2('0x3')]('long')},'originCc':{'type':Sequelize[_0x89a2('0x3')](_0x89a2('0x2'))},'originChannel':{'type':Sequelize[_0x89a2('0x5')](_0x89a2('0xa'),_0x89a2('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x72f1=['medium','BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','lodash','TEXT','long'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x72f1,0x17e));var _0x172f=function(_0x410f9b,_0x17f565){_0x410f9b=_0x410f9b-0x0;var _0x36031a=_0x72f1[_0x410f9b];return _0x36031a;};'use strict';var Sequelize=require('sequelize');var _=require(_0x172f('0x0'));module['exports']={'body':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x3'))},'read':{'type':Sequelize[_0x172f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x172f('0x5')]('in',_0x172f('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x172f('0x7')](0x1fe)},'from':{'type':Sequelize[_0x172f('0x7')]},'to':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2'))},'cc':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x172f('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x172f('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x172f('0x8')]},'originTo':{'type':Sequelize[_0x172f('0x1')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x172f('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0x172f('0x9'),_0x172f('0xa')),'defaultValue':_0x172f('0x9'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index cbdde9a..5620c5c 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 _0x648a=['unlinkSync','eml-format','util','path','lodash','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','message','MailMessage,\x20%s,\x20%s','result','json','offset','limit','undefined','count','set','Content-Range','destroy','status','sendStatus','name','index','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','MailMessage','includeAll','findAll','rows','catch','show','params','keys','include','find','update','body','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','DESC','Smtp','service','host','port','secure','auth','pass','user','attachments','join','root','server/files/attachments','Contacts','ListId','SendMail','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','mail','read','readAt','UserId','get','MailInteraction','isNil','format','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','agent','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','Sequelize','User','fullname','fromString','download','toString','server','files','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','build','writeFileSync'];(function(_0x321cf6,_0x1d5d9c){var _0x1185d9=function(_0x35f9b5){while(--_0x35f9b5){_0x321cf6['push'](_0x321cf6['shift']());}};_0x1185d9(++_0x1d5d9c);}(_0x648a,0x13f));var _0xa648=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x648a[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0xa648('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xa648('0x1'));var path=require(_0xa648('0x2'));var fs=require('fs');var _=require(_0xa648('0x3'));var Redis=require('ioredis');var htmlToText=require(_0xa648('0x4'));var qs=require(_0xa648('0x5'));var logger=require(_0xa648('0x6'))(_0xa648('0x7'));var interaction_log=require(_0xa648('0x6'))('mail-interactions');var config=require(_0xa648('0x8'));var db=require('../../mysqldb')['db'];config[_0xa648('0x9')]=_[_0xa648('0xa')](config[_0xa648('0x9')],{'host':_0xa648('0xb'),'port':0x18eb});var socket=require(_0xa648('0xc'))(new Redis(config[_0xa648('0x9')]));var htmlEntities=require(_0xa648('0xd'));require(_0xa648('0xe'))[_0xa648('0xf')](socket);var jayson=require(_0xa648('0x10'));var client=jayson[_0xa648('0x11')][_0xa648('0x12')]({'port':0x232c});var client9003=jayson[_0xa648('0x11')][_0xa648('0x12')]({'port':0x232b});var client9002=jayson[_0xa648('0x11')][_0xa648('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x3fe43b,_0x270380,_0x227725,_0x556b4c){return new BPromise(function(_0x474dd0,_0x2fcedd){var _0x18d9e1=_0x556b4c||client;return _0x18d9e1['request'](_0x3fe43b,_0x227725)[_0xa648('0x13')](function(_0x249eb9){logger[_0xa648('0x14')]('MailMessage,\x20%s,\x20%s',_0x270380,_0xa648('0x15'));logger[_0xa648('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x270380,_0xa648('0x15'),JSON['stringify'](_0x249eb9));if(_0x249eb9[_0xa648('0x17')]){if(_0x249eb9[_0xa648('0x17')][_0xa648('0x18')]===0x1f4){logger[_0xa648('0x17')]('MailMessage,\x20%s,\x20%s',_0x270380,_0x249eb9[_0xa648('0x17')]['message']);return _0x2fcedd(_0x249eb9[_0xa648('0x17')][_0xa648('0x19')]);}logger[_0xa648('0x17')](_0xa648('0x1a'),_0x270380,_0x249eb9[_0xa648('0x17')]['message']);return _0x474dd0(_0x249eb9[_0xa648('0x17')][_0xa648('0x19')]);}else{logger[_0xa648('0x14')]('MailMessage,\x20%s,\x20%s',_0x270380,'request\x20sent');_0x474dd0(_0x249eb9[_0xa648('0x1b')]['message']);}})['catch'](function(_0x12a719){logger[_0xa648('0x17')]('MailMessage,\x20%s,\x20%s',_0x270380,_0x12a719);_0x2fcedd(_0x12a719);});});}function respondWithResult(_0xa5f5ff,_0x4195a9){_0x4195a9=_0x4195a9||0xc8;return function(_0x3b8b1e){if(_0x3b8b1e){return _0xa5f5ff['status'](_0x4195a9)[_0xa648('0x1c')](_0x3b8b1e);}};}function respondWithFilteredResult(_0x1943b2,_0x202429){return function(_0x44470f){if(_0x44470f){var _0x2c62b3=typeof _0x202429[_0xa648('0x1d')]==='undefined'&&typeof _0x202429[_0xa648('0x1e')]===_0xa648('0x1f');var _0xee5524=_0x44470f[_0xa648('0x20')];var _0x47ba85=_0x2c62b3?0x0:_0x202429[_0xa648('0x1d')];var _0x56b2ab=_0x2c62b3?_0x44470f['count']:_0x202429['offset']+_0x202429[_0xa648('0x1e')];var _0x2b8d43;if(_0x56b2ab>=_0xee5524){_0x56b2ab=_0xee5524;_0x2b8d43=0xc8;}else{_0x2b8d43=0xce;}_0x1943b2['status'](_0x2b8d43);return _0x1943b2[_0xa648('0x21')](_0xa648('0x22'),_0x47ba85+'-'+_0x56b2ab+'/'+_0xee5524)['json'](_0x44470f);}return null;};}function saveUpdates(_0x3d4cb6){return function(_0xb4f87b){if(_0xb4f87b){return _0xb4f87b['update'](_0x3d4cb6)['then'](function(_0x42c0d6){return _0x42c0d6;});}return null;};}function removeEntity(_0x2113b2){return function(_0x46e131){if(_0x46e131){return _0x46e131[_0xa648('0x23')]()[_0xa648('0x13')](function(){_0x2113b2[_0xa648('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2aaaa9){return function(_0x5b3f25){if(!_0x5b3f25){_0x2aaaa9[_0xa648('0x25')](0x194);}return _0x5b3f25;};}function handleError(_0x54f3c3,_0x2267b3){_0x2267b3=_0x2267b3||0x1f4;return function(_0x4a0d65){logger[_0xa648('0x17')](_0x4a0d65['stack']);if(_0x4a0d65[_0xa648('0x26')]){delete _0x4a0d65[_0xa648('0x26')];}_0x54f3c3[_0xa648('0x24')](_0x2267b3)['send'](_0x4a0d65);};}exports[_0xa648('0x27')]=function(_0x2abe62,_0x96bf3b){var _0x3af2e7={},_0x56a404={},_0x4c19b7={'count':0x0,'rows':[]};var _0x2512c1=_['map'](db['MailMessage'][_0xa648('0x28')],function(_0x4dce7c){return{'name':_0x4dce7c[_0xa648('0x29')],'type':_0x4dce7c['type'][_0xa648('0x2a')]};});_0x56a404[_0xa648('0x2b')]=_[_0xa648('0x2c')](_0x2512c1,'name');_0x56a404[_0xa648('0x2d')]=_['keys'](_0x2abe62[_0xa648('0x2d')]);_0x56a404[_0xa648('0x2e')]=_['intersection'](_0x56a404['model'],_0x56a404['query']);_0x3af2e7[_0xa648('0x2f')]=_[_0xa648('0x30')](_0x56a404[_0xa648('0x2b')],qs[_0xa648('0x31')](_0x2abe62['query'][_0xa648('0x31')]));_0x3af2e7[_0xa648('0x2f')]=_0x3af2e7[_0xa648('0x2f')][_0xa648('0x32')]?_0x3af2e7[_0xa648('0x2f')]:_0x56a404['model'];if(!_0x2abe62[_0xa648('0x2d')][_0xa648('0x33')](_0xa648('0x34'))){_0x3af2e7['limit']=qs[_0xa648('0x1e')](_0x2abe62[_0xa648('0x2d')][_0xa648('0x1e')]);_0x3af2e7[_0xa648('0x1d')]=qs[_0xa648('0x1d')](_0x2abe62[_0xa648('0x2d')][_0xa648('0x1d')]);}_0x3af2e7[_0xa648('0x35')]=qs[_0xa648('0x36')](_0x2abe62['query']['sort']);_0x3af2e7[_0xa648('0x37')]=qs['filters'](_[_0xa648('0x38')](_0x2abe62[_0xa648('0x2d')],_0x56a404[_0xa648('0x2e')]),_0x2512c1);if(_0x2abe62[_0xa648('0x2d')]['filter']){_0x3af2e7[_0xa648('0x37')]=_['merge'](_0x3af2e7['where'],{'$or':_[_0xa648('0x2c')](_0x2512c1,function(_0x590b4d){if(_0x590b4d[_0xa648('0x39')]!==_0xa648('0x3a')){var _0x5d7d77={};_0x5d7d77[_0x590b4d[_0xa648('0x26')]]={'$like':'%'+_0x2abe62[_0xa648('0x2d')][_0xa648('0x3b')]+'%'};return _0x5d7d77;}})});}_0x3af2e7=_[_0xa648('0x3c')]({},_0x3af2e7,_0x2abe62[_0xa648('0x3d')]);var _0x5c7c4f={'where':_0x3af2e7[_0xa648('0x37')]};return db[_0xa648('0x3e')][_0xa648('0x20')](_0x5c7c4f)['then'](function(_0x151c64){_0x4c19b7['count']=_0x151c64;if(_0x2abe62[_0xa648('0x2d')][_0xa648('0x3f')]){_0x3af2e7['include']=[{'all':!![]}];}return db[_0xa648('0x3e')][_0xa648('0x40')](_0x3af2e7);})[_0xa648('0x13')](function(_0x18f4d3){_0x4c19b7[_0xa648('0x41')]=_0x18f4d3;return _0x4c19b7;})[_0xa648('0x13')](respondWithFilteredResult(_0x96bf3b,_0x3af2e7))[_0xa648('0x42')](handleError(_0x96bf3b,null));};exports[_0xa648('0x43')]=function(_0x566df0,_0x483756){var _0x204d36={'raw':!![],'where':{'id':_0x566df0[_0xa648('0x44')]['id']}},_0x18cbf0={};_0x18cbf0[_0xa648('0x2b')]=_[_0xa648('0x45')](db[_0xa648('0x3e')][_0xa648('0x28')]);_0x18cbf0[_0xa648('0x2d')]=_['keys'](_0x566df0[_0xa648('0x2d')]);_0x18cbf0[_0xa648('0x2e')]=_['intersection'](_0x18cbf0['model'],_0x18cbf0['query']);_0x204d36[_0xa648('0x2f')]=_[_0xa648('0x30')](_0x18cbf0[_0xa648('0x2b')],qs[_0xa648('0x31')](_0x566df0[_0xa648('0x2d')][_0xa648('0x31')]));_0x204d36[_0xa648('0x2f')]=_0x204d36[_0xa648('0x2f')]['length']?_0x204d36['attributes']:_0x18cbf0[_0xa648('0x2b')];if(_0x566df0[_0xa648('0x2d')][_0xa648('0x3f')]){_0x204d36[_0xa648('0x46')]=[{'all':!![]}];}_0x204d36=_['merge']({},_0x204d36,_0x566df0[_0xa648('0x3d')]);return db[_0xa648('0x3e')][_0xa648('0x47')](_0x204d36)[_0xa648('0x13')](handleEntityNotFound(_0x483756,null))['then'](respondWithResult(_0x483756,null))[_0xa648('0x42')](handleError(_0x483756,null));};exports[_0xa648('0x48')]=function(_0x3c9974,_0x19bd9a){if(_0x3c9974[_0xa648('0x49')]['id']){delete _0x3c9974['body']['id'];}return db[_0xa648('0x3e')][_0xa648('0x47')]({'where':{'id':_0x3c9974[_0xa648('0x44')]['id']}})['then'](handleEntityNotFound(_0x19bd9a,null))['then'](saveUpdates(_0x3c9974[_0xa648('0x49')],null))[_0xa648('0x13')](respondWithResult(_0x19bd9a,null))[_0xa648('0x42')](handleError(_0x19bd9a,null));};exports[_0xa648('0x23')]=function(_0x3fbc83,_0x33f380){return db[_0xa648('0x3e')]['find']({'where':{'id':_0x3fbc83[_0xa648('0x44')]['id']}})[_0xa648('0x13')](handleEntityNotFound(_0x33f380,null))[_0xa648('0x13')](removeEntity(_0x33f380,null))[_0xa648('0x42')](handleError(_0x33f380,null));};exports[_0xa648('0x4a')]=function(_0x5a87fb,_0x433f6d){return db[_0xa648('0x3e')][_0xa648('0x4a')]()['then'](respondWithResult(_0x433f6d,null))[_0xa648('0x42')](handleError(_0x433f6d,null));};exports[_0xa648('0x4b')]=function(_0x1b9e11,_0x55c482){return db['MailMessage'][_0xa648('0x4b')](_0x1b9e11[_0xa648('0x49')])[_0xa648('0x13')](function(_0x423205){if(_0x423205){if(_0x423205[_0xa648('0x4c')]===_0xa648('0x4d')&&!_0x423205[_0xa648('0x4e')]){var _0x3c3f4f,_0x30eae3,_0x39d571;if(_0x1b9e11['body']['to']){_0x30eae3=_0x1b9e11[_0xa648('0x49')]['to'][_0xa648('0x4f')](',')[0x0];}return db['MailAccount'][_0xa648('0x50')]({'where':{'id':_0x423205[_0xa648('0x51')]},'include':[{'model':db[_0xa648('0x52')],'as':_0xa648('0x53'),'include':[{'model':db[_0xa648('0x54')],'as':'Contacts','where':{'email':_0x30eae3},'limit':0x1,'order':[['updatedAt',_0xa648('0x55')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xa648('0x13')](function(_0x5d1ff8){_0x3c3f4f=_0x5d1ff8;if(_0x3c3f4f&&_0x3c3f4f[_0xa648('0x56')]){var _0xca07be={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x3c3f4f[_0xa648('0x56')][_0xa648('0x57')])){_0xca07be[_0xa648('0x58')]=_0x3c3f4f[_0xa648('0x56')][_0xa648('0x58')];_0xca07be[_0xa648('0x59')]=_0x3c3f4f[_0xa648('0x56')][_0xa648('0x59')];_0xca07be[_0xa648('0x5a')]=_0x3c3f4f[_0xa648('0x56')][_0xa648('0x5a')];if(_0x3c3f4f[_0xa648('0x56')]['authentication']){_0xca07be[_0xa648('0x5b')]={'user':_0x3c3f4f[_0xa648('0x56')]['user'],'pass':_0x3c3f4f['Smtp'][_0xa648('0x5c')]};}}else{_0xca07be[_0xa648('0x57')]=_0x3c3f4f['Smtp'][_0xa648('0x57')];_0xca07be[_0xa648('0x5b')]={'user':_0x3c3f4f['Smtp'][_0xa648('0x5d')],'pass':_0x3c3f4f[_0xa648('0x56')]['pass']};_0xca07be[_0xa648('0x5a')]=_0x3c3f4f[_0xa648('0x56')][_0xa648('0x5a')];}if(_0x1b9e11[_0xa648('0x49')][_0xa648('0x5e')]&&_0x1b9e11['body'][_0xa648('0x5e')]['length']){for(var _0x56006d=0x0;_0x56006d<_0x1b9e11[_0xa648('0x49')][_0xa648('0x5e')][_0xa648('0x32')];_0x56006d+=0x1){_0x1b9e11['body'][_0xa648('0x5e')][_0x56006d]={'filename':_0x1b9e11['body']['attachments'][_0x56006d][_0xa648('0x26')],'path':path[_0xa648('0x5f')](config[_0xa648('0x60')],_0xa648('0x61'),_0x1b9e11['body'][_0xa648('0x5e')][_0x56006d]['basename'])};}}_0x39d571={'account':_0xca07be,'message':_0x1b9e11[_0xa648('0x49')]};return;}})[_0xa648('0x13')](function(){if(_0x3c3f4f[_0xa648('0x53')]){if(_0x3c3f4f[_0xa648('0x53')][_0xa648('0x62')][_0xa648('0x32')]){return _0x3c3f4f[_0xa648('0x53')][_0xa648('0x62')][0x0];}else{return db['CmContact'][_0xa648('0x4b')](_[_0xa648('0xa')](_0x1b9e11[_0xa648('0x49')],{'firstName':_0x1b9e11[_0xa648('0x49')]['to'],'email':_0x1b9e11[_0xa648('0x49')]['to'],'phone':_0x1b9e11[_0xa648('0x49')]['to'],'ListId':_0x3c3f4f[_0xa648('0x63')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xa648('0x13')](function(){if(_0x39d571){return respondWithRpcPromise(_0xa648('0x64'),'sendMail',_0x39d571,client9003)[_0xa648('0x13')](function(_0xe6f7c8){return _0x423205[_0xa648('0x48')]({'read':!![],'messageId':_0xe6f7c8['messageId'],'sentAt':moment()['format'](_0xa648('0x65'))});})[_0xa648('0x42')](function(_0x47b3b6){logger['error']('%s',JSON[_0xa648('0x66')](_0x47b3b6));return _0x423205;});}return _0x423205;});}return _0x423205;}})['then'](respondWithResult(_0x55c482,0xc9))[_0xa648('0x42')](handleError(_0x55c482,null));};exports[_0xa648('0x67')]=function(_0xebb6b0,_0x212f33){var _0x973a87={'agent':{},'channel':_0xa648('0x68')};if(_0xebb6b0[_0xa648('0x49')]['id']){delete _0xebb6b0[_0xa648('0x49')]['id'];}_0xebb6b0['body'][_0xa648('0x69')]=!![];_0xebb6b0[_0xa648('0x49')][_0xa648('0x6a')]=moment()['format'](_0xa648('0x65'));_0xebb6b0[_0xa648('0x49')]['UserId']=_0xebb6b0['body'][_0xa648('0x6b')]||_0xebb6b0[_0xa648('0x5d')]['id'];_0x973a87['agent']['id']=_0xebb6b0[_0xa648('0x49')][_0xa648('0x6b')];return db[_0xa648('0x3e')][_0xa648('0x47')]({'where':{'id':_0xebb6b0[_0xa648('0x44')]['id'],'UserId':null}})[_0xa648('0x13')](handleEntityNotFound(_0x212f33,null))[_0xa648('0x13')](saveUpdates(_0xebb6b0[_0xa648('0x49')],null))[_0xa648('0x13')](function(_0x215eae){if(_0x215eae){_0x973a87[_0xa648('0x19')]=_0x215eae[_0xa648('0x6c')]({'plain':!![]});return db[_0xa648('0x6d')][_0xa648('0x47')]({'where':{'id':_0x215eae['MailInteractionId']}});}return null;})[_0xa648('0x13')](handleEntityNotFound(_0x212f33,null))[_0xa648('0x13')](function(_0x318550){if(_0x318550){return _0x318550[_0xa648('0x48')]({'UserId':_0xebb6b0[_0xa648('0x49')][_0xa648('0x6b')],'read1stAt':_[_0xa648('0x6e')](_0x318550['read1stAt'])?moment()[_0xa648('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5bc65d){if(_0x5bc65d){_0x973a87['interaction']=_0x5bc65d[_0xa648('0x6c')]({'plain':!![]});interaction_log[_0xa648('0x14')](_0xa648('0x70'),_0xebb6b0[_0xa648('0x5d')]['id'],_0xebb6b0[_0xa648('0x5d')][_0xa648('0x26')],_0xebb6b0['user'][_0xa648('0x71')],_0x973a87[_0xa648('0x72')]['id'],_0xebb6b0[_0xa648('0x49')]?JSON[_0xa648('0x66')](_0xebb6b0[_0xa648('0x49')]):_0xa648('0x73'));return respondWithRpcPromise(_0xa648('0x74'),_0xa648('0x75'),_0x973a87);}return null;})[_0xa648('0x13')](function(_0x427f5d){var _0xbedc6c=_0xa648('0x76')+_0x427f5d['message']['ContactId'];return db['sequelize'][_0xa648('0x2d')](_0xbedc6c,{'type':db['Sequelize'][_0xa648('0x77')][_0xa648('0x78')],'raw':!![]})[_0xa648('0x13')](function(_0x1f44a5){return _0x1f44a5;});})[_0xa648('0x13')](function(_0x1caded){if(_0x1caded){_0x973a87[_0xa648('0x19')][_0xa648('0x79')]=_0x1caded[0x0];if(!_0xebb6b0['body'][_0xa648('0x6b')])return;return db['User']['find']({'where':{'id':_0xebb6b0[_0xa648('0x49')][_0xa648('0x6b')],'role':_0xa648('0x7a')},'attributes':['id',_0xa648('0x26'),'fullname',_0xa648('0x7b'),_0xa648('0x7c')],'raw':!![]});}return null;})[_0xa648('0x13')](function(_0x4c46c5){if(!_0x4c46c5)return null;_0x973a87['message'][_0xa648('0x7a')]=_0x4c46c5;return _0x973a87;})[_0xa648('0x13')](function(_0x22ae73){if(_0x22ae73){if(_0xebb6b0[_0xa648('0x49')]['manual']){_0x973a87['message'][_0xa648('0x7d')]=util['format'](_0xa648('0x7e'),_0xebb6b0['user'][_0xa648('0x26')]);_0x973a87[_0xa648('0x19')][_0xa648('0x7f')]=_0x973a87[_0xa648('0x7f')];_0x973a87['message'][_0xa648('0x80')]=_0x973a87[_0xa648('0x7f')];_0x973a87[_0xa648('0x19')][_0xa648('0x81')]=_0xa648('0x67');_0x973a87[_0xa648('0x19')][_0xa648('0x49')]=htmlToText['fromString'](_0x973a87[_0xa648('0x19')]['body']);return respondWithRpcPromise(_0xa648('0x82'),_0xa648('0x82'),{'event':_0xa648('0x83'),'message':_0x973a87['message']},client9002)[_0xa648('0x13')](function(){return _0x973a87;});}return _0x973a87;}return null;})[_0xa648('0x13')](respondWithResult(_0x212f33,null))[_0xa648('0x42')](handleError(_0x212f33,null));};exports['reject']=function(_0x102519,_0x3f3c13){var _0x4f9bfb={'agent':{},'channel':_0xa648('0x68')};if(_0x102519[_0xa648('0x49')]['id']){delete _0x102519['body']['id'];}_0x102519[_0xa648('0x49')][_0xa648('0x6b')]=_0x102519[_0xa648('0x49')][_0xa648('0x6b')]||_0x102519['user']['id'];_0x4f9bfb[_0xa648('0x7a')]['id']=_0x102519[_0xa648('0x49')]['UserId'];return db[_0xa648('0x3e')][_0xa648('0x47')]({'where':{'id':_0x102519['params']['id'],'UserId':null}})[_0xa648('0x13')](handleEntityNotFound(_0x3f3c13,null))['then'](function(_0x1b2b77){if(_0x1b2b77){_0x4f9bfb[_0xa648('0x19')]=_0x1b2b77[_0xa648('0x6c')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x1b2b77['MailInteractionId']}});}return null;})[_0xa648('0x13')](handleEntityNotFound(_0x3f3c13,null))[_0xa648('0x13')](function(_0x384be2){if(_0x384be2){_0x4f9bfb['interaction']=_0x384be2['get']({'plain':!![]});interaction_log[_0xa648('0x14')](_0xa648('0x84'),_0x102519['user']['id'],_0x102519['user'][_0xa648('0x26')],_0x102519[_0xa648('0x5d')][_0xa648('0x71')],_0x4f9bfb[_0xa648('0x72')]['id'],_0x102519[_0xa648('0x49')]?JSON[_0xa648('0x66')](_0x102519[_0xa648('0x49')]):'null');return respondWithRpcPromise(_0xa648('0x85'),'rejectMessage',_0x4f9bfb);}return null;})['then'](function(_0x59d64f){var _0x344677=_0xa648('0x76')+_0x59d64f['message'][_0xa648('0x86')];return db['sequelize']['query'](_0x344677,{'type':db[_0xa648('0x87')][_0xa648('0x77')][_0xa648('0x78')],'raw':!![]})[_0xa648('0x13')](function(_0x488b56){return _0x488b56;});})[_0xa648('0x13')](function(_0x52bd1b){if(_0x52bd1b){_0x4f9bfb[_0xa648('0x19')][_0xa648('0x79')]=_0x52bd1b[0x0];if(!_0x102519[_0xa648('0x49')][_0xa648('0x6b')])return;return db[_0xa648('0x88')][_0xa648('0x47')]({'where':{'id':_0x102519[_0xa648('0x49')][_0xa648('0x6b')],'role':_0xa648('0x7a')},'attributes':['id','name',_0xa648('0x89'),_0xa648('0x7b'),'internal'],'raw':!![]});}return null;})[_0xa648('0x13')](function(_0xfe331b){if(!_0xfe331b)return null;_0x4f9bfb['message']['agent']=_0xfe331b;return _0x4f9bfb;})[_0xa648('0x13')](function(_0x5e9a71){if(_0x5e9a71){_0x5e9a71[_0xa648('0x19')][_0xa648('0x7d')]=util[_0xa648('0x6f')](_0xa648('0x7e'),_0x102519[_0xa648('0x5d')][_0xa648('0x26')]);_0x5e9a71['message'][_0xa648('0x7f')]=_0x4f9bfb[_0xa648('0x7f')];_0x5e9a71[_0xa648('0x19')][_0xa648('0x80')]=_0x4f9bfb[_0xa648('0x7f')];_0x5e9a71['message'][_0xa648('0x81')]='reject';_0x5e9a71[_0xa648('0x19')]['body']=htmlToText[_0xa648('0x8a')](_0x4f9bfb[_0xa648('0x19')]['body']);respondWithRpcPromise(_0xa648('0x82'),_0xa648('0x82'),{'event':'rejectmessage','message':_0x5e9a71['message']},client9002);return _0x4f9bfb;}return null;})[_0xa648('0x13')](respondWithResult(_0x3f3c13,null))[_0xa648('0x42')](handleError(_0x3f3c13,null));};exports[_0xa648('0x8b')]=function(_0x21ed45,_0xa588c3){var _0x434504=moment()['unix']()[_0xa648('0x8c')]();var _0x22f0da=path['join'](config['root'],_0xa648('0x8d'),_0xa648('0x8e'),'tmp');var _0x24a896=path[_0xa648('0x5f')](config[_0xa648('0x60')],'server',_0xa648('0x8e'),'attachments');var _0x1cdbcb=util[_0xa648('0x6f')](_0xa648('0x8f'),_0x434504);return db[_0xa648('0x3e')][_0xa648('0x47')]({'where':{'id':_0x21ed45[_0xa648('0x44')]['id']},'attributes':['id','body',_0xa648('0x90'),'to','cc',_0xa648('0x91'),'subject',_0xa648('0x92')],'include':_0x21ed45[_0xa648('0x2d')]['attachments']?[{'model':db[_0xa648('0x93')],'as':_0xa648('0x94')}]:undefined})[_0xa648('0x13')](handleEntityNotFound(_0xa588c3,null))[_0xa648('0x13')](function(_0x17898f){if(_0x17898f){var _0x547dcd=_0x17898f;var _0x21b306={'from':_0x547dcd[_0xa648('0x90')],'to':_0x547dcd['to'],'subject':_0x547dcd['subject'],'html':htmlEntities[_0xa648('0x95')](_0x547dcd[_0xa648('0x49')]),'headers':{'Date':moment(_0x547dcd['createdAt'])['format'](_0xa648('0x96'))},'attachments':[]};if(_0x17898f['cc']){_0x21b306[_0xa648('0x97')]['Cc']=_0x17898f['cc'];}if(_0x17898f['bcc']){_0x21b306['headers'][_0xa648('0x98')]=_0x17898f['bcc'];}return new BPromise(function(_0x1ac9c,_0x169df9){if(_0x17898f[_0xa648('0x94')]){for(var _0x510e8e=0x0;_0x510e8e<_0x17898f[_0xa648('0x94')][_0xa648('0x32')];_0x510e8e++){var _0x3f0838=_0x17898f[_0xa648('0x94')][_0x510e8e];var _0x41d967=path[_0xa648('0x5f')](_0x24a896,_0x3f0838[_0xa648('0x99')]);if(fs[_0xa648('0x9a')](_0x41d967)){_0x21b306[_0xa648('0x5e')][_0xa648('0x9b')]({'name':_0x3f0838[_0xa648('0x26')],'contentType':_0x3f0838[_0xa648('0x39')],'data':fs['readFileSync'](_0x41d967)});}}}emlformat[_0xa648('0x9c')](_0x21b306,function(_0x13245a,_0x5ace93){if(_0x13245a)return _0x169df9(_0x13245a);fs[_0xa648('0x9d')](path['join'](_0x22f0da,_0x1cdbcb),_0x5ace93);return _0x1ac9c(_0x5ace93);});});}})[_0xa648('0x13')](function(_0x24951f){if(_0x24951f){return _0xa588c3[_0xa648('0x8b')](path[_0xa648('0x5f')](_0x22f0da,_0x1cdbcb),_0x1cdbcb,function(_0x5b771d){if(!_0x5b771d)fs[_0xa648('0x9e')](path['join'](_0x22f0da,_0x1cdbcb));});}})[_0xa648('0x42')](handleError(_0xa588c3,null));}; \ No newline at end of file +var _0xa12c=['Smtp','isNil','service','host','port','secure','authentication','user','attachments','root','basename','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','agent','UserId','get','MailInteractionId','interaction','info','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','User','manual','interface','channel','event','fromString','EventManager','acceptmessage','reject','role','RejectMessage','rejectMessage','Sequelize','QueryTypes','email','internal','SIP/%s','motionChannel','rejectmessage','unix','toString','files','tmp','join','server','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','path','lodash','html-to-text','../../components/parsers/qs','api','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','end','stack','name','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','MailMessage','includeAll','include','findAll','rows','show','params','length','update','body','find','destroy','describe','create','direction','out','secret','split','MailAccount','findOne','List','CmContact','Contacts','DESC','MailServerOut'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0xa12c,0xe5));var _0xca12=function(_0x3a5e0c,_0x2f82fe){_0x3a5e0c=_0x3a5e0c-0x0;var _0x5d8a14=_0xa12c[_0x3a5e0c];return _0x5d8a14;};'use strict';var emlformat=require(_0xca12('0x0'));var moment=require(_0xca12('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require(_0xca12('0x2'));var fs=require('fs');var _=require(_0xca12('0x3'));var Redis=require('ioredis');var htmlToText=require(_0xca12('0x4'));var qs=require(_0xca12('0x5'));var logger=require('../../config/logger')(_0xca12('0x6'));var interaction_log=require(_0xca12('0x7'))('mail-interactions');var config=require(_0xca12('0x8'));var db=require(_0xca12('0x9'))['db'];config[_0xca12('0xa')]=_[_0xca12('0xb')](config[_0xca12('0xa')],{'host':_0xca12('0xc'),'port':0x18eb});var socket=require(_0xca12('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0xca12('0xe'));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xca12('0xf'));var client=jayson[_0xca12('0x10')][_0xca12('0x11')]({'port':0x232c});var client9003=jayson[_0xca12('0x10')][_0xca12('0x11')]({'port':0x232b});var client9002=jayson['client'][_0xca12('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x296ab9,_0x124dc7,_0x553f77,_0x3b541b){return new BPromise(function(_0x3946d6,_0x41a939){var _0x3c1e7f=_0x3b541b||client;return _0x3c1e7f[_0xca12('0x12')](_0x296ab9,_0x553f77)[_0xca12('0x13')](function(_0x39700c){logger['info'](_0xca12('0x14'),_0x124dc7,_0xca12('0x15'));logger[_0xca12('0x16')](_0xca12('0x17'),_0x124dc7,'request\x20sent',JSON[_0xca12('0x18')](_0x39700c));if(_0x39700c['error']){if(_0x39700c[_0xca12('0x19')][_0xca12('0x1a')]===0x1f4){logger[_0xca12('0x19')](_0xca12('0x14'),_0x124dc7,_0x39700c['error'][_0xca12('0x1b')]);return _0x41a939(_0x39700c['error'][_0xca12('0x1b')]);}logger[_0xca12('0x19')](_0xca12('0x14'),_0x124dc7,_0x39700c[_0xca12('0x19')][_0xca12('0x1b')]);return _0x3946d6(_0x39700c[_0xca12('0x19')][_0xca12('0x1b')]);}else{logger['info'](_0xca12('0x14'),_0x124dc7,'request\x20sent');_0x3946d6(_0x39700c[_0xca12('0x1c')][_0xca12('0x1b')]);}})[_0xca12('0x1d')](function(_0x392ff7){logger[_0xca12('0x19')]('MailMessage,\x20%s,\x20%s',_0x124dc7,_0x392ff7);_0x41a939(_0x392ff7);});});}function respondWithResult(_0x22cf2b,_0x28007e){_0x28007e=_0x28007e||0xc8;return function(_0x5caa51){if(_0x5caa51){return _0x22cf2b['status'](_0x28007e)[_0xca12('0x1e')](_0x5caa51);}};}function respondWithFilteredResult(_0x178603,_0x166296){return function(_0x3809fe){if(_0x3809fe){var _0x2b63f3=typeof _0x166296[_0xca12('0x1f')]===_0xca12('0x20')&&typeof _0x166296[_0xca12('0x21')]===_0xca12('0x20');var _0x1c75e0=_0x3809fe[_0xca12('0x22')];var _0x1ea518=_0x2b63f3?0x0:_0x166296['offset'];var _0x5e348a=_0x2b63f3?_0x3809fe[_0xca12('0x22')]:_0x166296[_0xca12('0x1f')]+_0x166296[_0xca12('0x21')];var _0xb9c35f;if(_0x5e348a>=_0x1c75e0){_0x5e348a=_0x1c75e0;_0xb9c35f=0xc8;}else{_0xb9c35f=0xce;}_0x178603[_0xca12('0x23')](_0xb9c35f);return _0x178603[_0xca12('0x24')](_0xca12('0x25'),_0x1ea518+'-'+_0x5e348a+'/'+_0x1c75e0)['json'](_0x3809fe);}return null;};}function saveUpdates(_0x4d1902){return function(_0x494753){if(_0x494753){return _0x494753['update'](_0x4d1902)[_0xca12('0x13')](function(_0x366eec){return _0x366eec;});}return null;};}function removeEntity(_0x4d2ae1){return function(_0x31a90a){if(_0x31a90a){return _0x31a90a['destroy']()['then'](function(){_0x4d2ae1[_0xca12('0x23')](0xcc)[_0xca12('0x26')]();});}};}function handleEntityNotFound(_0xd10627){return function(_0x4393cb){if(!_0x4393cb){_0xd10627['sendStatus'](0x194);}return _0x4393cb;};}function handleError(_0x1bc2cb,_0xcc643f){_0xcc643f=_0xcc643f||0x1f4;return function(_0x127d31){logger[_0xca12('0x19')](_0x127d31[_0xca12('0x27')]);if(_0x127d31[_0xca12('0x28')]){delete _0x127d31[_0xca12('0x28')];}_0x1bc2cb[_0xca12('0x23')](_0xcc643f)['send'](_0x127d31);};}exports['index']=function(_0x4db40a,_0x4bc572){var _0x51ad41={},_0x105775={},_0x5e8f2={'count':0x0,'rows':[]};var _0x1726a4=_[_0xca12('0x29')](db['MailMessage'][_0xca12('0x2a')],function(_0x17f39d){return{'name':_0x17f39d[_0xca12('0x2b')],'type':_0x17f39d[_0xca12('0x2c')]['key']};});_0x105775[_0xca12('0x2d')]=_['map'](_0x1726a4,_0xca12('0x28'));_0x105775[_0xca12('0x2e')]=_[_0xca12('0x2f')](_0x4db40a[_0xca12('0x2e')]);_0x105775['filters']=_['intersection'](_0x105775[_0xca12('0x2d')],_0x105775[_0xca12('0x2e')]);_0x51ad41[_0xca12('0x30')]=_[_0xca12('0x31')](_0x105775[_0xca12('0x2d')],qs[_0xca12('0x32')](_0x4db40a[_0xca12('0x2e')]['fields']));_0x51ad41[_0xca12('0x30')]=_0x51ad41[_0xca12('0x30')]['length']?_0x51ad41[_0xca12('0x30')]:_0x105775[_0xca12('0x2d')];if(!_0x4db40a['query'][_0xca12('0x33')](_0xca12('0x34'))){_0x51ad41[_0xca12('0x21')]=qs[_0xca12('0x21')](_0x4db40a[_0xca12('0x2e')]['limit']);_0x51ad41[_0xca12('0x1f')]=qs[_0xca12('0x1f')](_0x4db40a[_0xca12('0x2e')][_0xca12('0x1f')]);}_0x51ad41[_0xca12('0x35')]=qs[_0xca12('0x36')](_0x4db40a[_0xca12('0x2e')][_0xca12('0x36')]);_0x51ad41['where']=qs[_0xca12('0x37')](_[_0xca12('0x38')](_0x4db40a[_0xca12('0x2e')],_0x105775[_0xca12('0x37')]),_0x1726a4);if(_0x4db40a['query'][_0xca12('0x39')]){_0x51ad41['where']=_[_0xca12('0x3a')](_0x51ad41[_0xca12('0x3b')],{'$or':_['map'](_0x1726a4,function(_0x4adb4d){if(_0x4adb4d['type']!==_0xca12('0x3c')){var _0x2622f0={};_0x2622f0[_0x4adb4d[_0xca12('0x28')]]={'$like':'%'+_0x4db40a[_0xca12('0x2e')][_0xca12('0x39')]+'%'};return _0x2622f0;}})});}_0x51ad41=_['merge']({},_0x51ad41,_0x4db40a[_0xca12('0x3d')]);var _0x172fbd={'where':_0x51ad41[_0xca12('0x3b')]};return db[_0xca12('0x3e')][_0xca12('0x22')](_0x172fbd)['then'](function(_0x22d4f9){_0x5e8f2['count']=_0x22d4f9;if(_0x4db40a[_0xca12('0x2e')][_0xca12('0x3f')]){_0x51ad41[_0xca12('0x40')]=[{'all':!![]}];}return db['MailMessage'][_0xca12('0x41')](_0x51ad41);})[_0xca12('0x13')](function(_0x3b74e6){_0x5e8f2[_0xca12('0x42')]=_0x3b74e6;return _0x5e8f2;})[_0xca12('0x13')](respondWithFilteredResult(_0x4bc572,_0x51ad41))[_0xca12('0x1d')](handleError(_0x4bc572,null));};exports[_0xca12('0x43')]=function(_0x429f90,_0x3f6514){var _0x31d62a={'raw':!![],'where':{'id':_0x429f90[_0xca12('0x44')]['id']}},_0x337cef={};_0x337cef['model']=_[_0xca12('0x2f')](db['MailMessage'][_0xca12('0x2a')]);_0x337cef[_0xca12('0x2e')]=_[_0xca12('0x2f')](_0x429f90[_0xca12('0x2e')]);_0x337cef[_0xca12('0x37')]=_[_0xca12('0x31')](_0x337cef[_0xca12('0x2d')],_0x337cef[_0xca12('0x2e')]);_0x31d62a[_0xca12('0x30')]=_[_0xca12('0x31')](_0x337cef[_0xca12('0x2d')],qs[_0xca12('0x32')](_0x429f90[_0xca12('0x2e')][_0xca12('0x32')]));_0x31d62a[_0xca12('0x30')]=_0x31d62a[_0xca12('0x30')][_0xca12('0x45')]?_0x31d62a['attributes']:_0x337cef[_0xca12('0x2d')];if(_0x429f90[_0xca12('0x2e')][_0xca12('0x3f')]){_0x31d62a[_0xca12('0x40')]=[{'all':!![]}];}_0x31d62a=_[_0xca12('0x3a')]({},_0x31d62a,_0x429f90[_0xca12('0x3d')]);return db['MailMessage']['find'](_0x31d62a)['then'](handleEntityNotFound(_0x3f6514,null))[_0xca12('0x13')](respondWithResult(_0x3f6514,null))['catch'](handleError(_0x3f6514,null));};exports[_0xca12('0x46')]=function(_0x178a0f,_0x277981){if(_0x178a0f['body']['id']){delete _0x178a0f[_0xca12('0x47')]['id'];}return db[_0xca12('0x3e')][_0xca12('0x48')]({'where':{'id':_0x178a0f[_0xca12('0x44')]['id']}})[_0xca12('0x13')](handleEntityNotFound(_0x277981,null))['then'](saveUpdates(_0x178a0f[_0xca12('0x47')],null))['then'](respondWithResult(_0x277981,null))[_0xca12('0x1d')](handleError(_0x277981,null));};exports[_0xca12('0x49')]=function(_0x1b427e,_0xbd85de){return db[_0xca12('0x3e')][_0xca12('0x48')]({'where':{'id':_0x1b427e[_0xca12('0x44')]['id']}})['then'](handleEntityNotFound(_0xbd85de,null))[_0xca12('0x13')](removeEntity(_0xbd85de,null))[_0xca12('0x1d')](handleError(_0xbd85de,null));};exports[_0xca12('0x4a')]=function(_0x11a0e5,_0x2161ef){return db['MailMessage']['describe']()['then'](respondWithResult(_0x2161ef,null))[_0xca12('0x1d')](handleError(_0x2161ef,null));};exports[_0xca12('0x4b')]=function(_0x56c99e,_0x1b8c2d){return db[_0xca12('0x3e')][_0xca12('0x4b')](_0x56c99e[_0xca12('0x47')])['then'](function(_0x13684b){if(_0x13684b){if(_0x13684b[_0xca12('0x4c')]===_0xca12('0x4d')&&!_0x13684b[_0xca12('0x4e')]){var _0x4dd507,_0x398ca1,_0xc19bb1;if(_0x56c99e[_0xca12('0x47')]['to']){_0x398ca1=_0x56c99e[_0xca12('0x47')]['to'][_0xca12('0x4f')](',')[0x0];}return db[_0xca12('0x50')][_0xca12('0x51')]({'where':{'id':_0x13684b['MailAccountId']},'include':[{'model':db['CmList'],'as':_0xca12('0x52'),'include':[{'model':db[_0xca12('0x53')],'as':_0xca12('0x54'),'where':{'email':_0x398ca1},'limit':0x1,'order':[['updatedAt',_0xca12('0x55')]]}]},{'model':db[_0xca12('0x56')],'as':_0xca12('0x57'),'raw':!![]}]})['then'](function(_0x2d7b1e){_0x4dd507=_0x2d7b1e;if(_0x4dd507&&_0x4dd507[_0xca12('0x57')]){var _0x1062b1={'tls':{'rejectUnauthorized':![]}};if(_[_0xca12('0x58')](_0x4dd507[_0xca12('0x57')][_0xca12('0x59')])){_0x1062b1[_0xca12('0x5a')]=_0x4dd507[_0xca12('0x57')][_0xca12('0x5a')];_0x1062b1[_0xca12('0x5b')]=_0x4dd507[_0xca12('0x57')][_0xca12('0x5b')];_0x1062b1[_0xca12('0x5c')]=_0x4dd507[_0xca12('0x57')]['secure'];if(_0x4dd507[_0xca12('0x57')][_0xca12('0x5d')]){_0x1062b1['auth']={'user':_0x4dd507[_0xca12('0x57')][_0xca12('0x5e')],'pass':_0x4dd507[_0xca12('0x57')]['pass']};}}else{_0x1062b1[_0xca12('0x59')]=_0x4dd507['Smtp']['service'];_0x1062b1['auth']={'user':_0x4dd507[_0xca12('0x57')][_0xca12('0x5e')],'pass':_0x4dd507[_0xca12('0x57')]['pass']};_0x1062b1[_0xca12('0x5c')]=_0x4dd507[_0xca12('0x57')][_0xca12('0x5c')];}if(_0x56c99e[_0xca12('0x47')][_0xca12('0x5f')]&&_0x56c99e[_0xca12('0x47')][_0xca12('0x5f')][_0xca12('0x45')]){for(var _0x15a150=0x0;_0x15a150<_0x56c99e[_0xca12('0x47')][_0xca12('0x5f')]['length'];_0x15a150+=0x1){_0x56c99e[_0xca12('0x47')][_0xca12('0x5f')][_0x15a150]={'filename':_0x56c99e[_0xca12('0x47')][_0xca12('0x5f')][_0x15a150][_0xca12('0x28')],'path':path['join'](config[_0xca12('0x60')],'server/files/attachments',_0x56c99e[_0xca12('0x47')][_0xca12('0x5f')][_0x15a150][_0xca12('0x61')])};}}_0xc19bb1={'account':_0x1062b1,'message':_0x56c99e[_0xca12('0x47')]};return;}})[_0xca12('0x13')](function(){if(_0x4dd507[_0xca12('0x52')]){if(_0x4dd507[_0xca12('0x52')][_0xca12('0x54')][_0xca12('0x45')]){return _0x4dd507['List'][_0xca12('0x54')][0x0];}else{return db['CmContact'][_0xca12('0x4b')](_['defaults'](_0x56c99e['body'],{'firstName':_0x56c99e[_0xca12('0x47')]['to'],'email':_0x56c99e[_0xca12('0x47')]['to'],'phone':_0x56c99e[_0xca12('0x47')]['to'],'ListId':_0x4dd507['ListId']}));}}else{throw new Error(_0xca12('0x62'));}})[_0xca12('0x13')](function(){if(_0xc19bb1){return respondWithRpcPromise(_0xca12('0x63'),_0xca12('0x64'),_0xc19bb1,client9003)[_0xca12('0x13')](function(_0x21b66f){return _0x13684b[_0xca12('0x46')]({'read':!![],'messageId':_0x21b66f[_0xca12('0x65')],'sentAt':moment()[_0xca12('0x66')](_0xca12('0x67'))});})[_0xca12('0x1d')](function(_0x537e5e){logger['error']('%s',JSON[_0xca12('0x18')](_0x537e5e));return _0x13684b;});}return _0x13684b;});}return _0x13684b;}})[_0xca12('0x13')](respondWithResult(_0x1b8c2d,0xc9))[_0xca12('0x1d')](handleError(_0x1b8c2d,null));};exports[_0xca12('0x68')]=function(_0x1ccd6d,_0x5da8a3){var _0xd30b95={'agent':{},'channel':_0xca12('0x69')};if(_0x1ccd6d['body']['id']){delete _0x1ccd6d[_0xca12('0x47')]['id'];}_0x1ccd6d['body']['read']=!![];_0x1ccd6d['body'][_0xca12('0x6a')]=moment()['format'](_0xca12('0x67'));_0x1ccd6d[_0xca12('0x47')]['UserId']=_0x1ccd6d[_0xca12('0x47')]['UserId']||_0x1ccd6d[_0xca12('0x5e')]['id'];_0xd30b95[_0xca12('0x6b')]['id']=_0x1ccd6d['body'][_0xca12('0x6c')];return db[_0xca12('0x3e')][_0xca12('0x48')]({'where':{'id':_0x1ccd6d[_0xca12('0x44')]['id'],'UserId':null}})[_0xca12('0x13')](handleEntityNotFound(_0x5da8a3,null))[_0xca12('0x13')](saveUpdates(_0x1ccd6d[_0xca12('0x47')],null))[_0xca12('0x13')](function(_0xea8555){if(_0xea8555){_0xd30b95[_0xca12('0x1b')]=_0xea8555[_0xca12('0x6d')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0xea8555[_0xca12('0x6e')]}});}return null;})['then'](handleEntityNotFound(_0x5da8a3,null))[_0xca12('0x13')](function(_0x45fe71){if(_0x45fe71){return _0x45fe71[_0xca12('0x46')]({'UserId':_0x1ccd6d[_0xca12('0x47')][_0xca12('0x6c')],'read1stAt':_[_0xca12('0x58')](_0x45fe71['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xca12('0x13')](function(_0x5b6081){if(_0x5b6081){_0xd30b95[_0xca12('0x6f')]=_0x5b6081['get']({'plain':!![]});interaction_log[_0xca12('0x70')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1ccd6d['user']['id'],_0x1ccd6d['user']['name'],_0x1ccd6d[_0xca12('0x5e')]['role'],_0xd30b95[_0xca12('0x6f')]['id'],_0x1ccd6d[_0xca12('0x47')]?JSON[_0xca12('0x18')](_0x1ccd6d[_0xca12('0x47')]):_0xca12('0x71'));return respondWithRpcPromise(_0xca12('0x72'),_0xca12('0x73'),_0xd30b95);}return null;})[_0xca12('0x13')](function(_0x2a5c37){var _0x389c5b=_0xca12('0x74')+_0x2a5c37[_0xca12('0x1b')][_0xca12('0x75')];return db[_0xca12('0x76')][_0xca12('0x2e')](_0x389c5b,{'type':db['Sequelize']['QueryTypes'][_0xca12('0x77')],'raw':!![]})['then'](function(_0x2abaa6){return _0x2abaa6;});})[_0xca12('0x13')](function(_0x51df09){if(_0x51df09){_0xd30b95[_0xca12('0x1b')]['contact']=_0x51df09[0x0];if(!_0x1ccd6d['body'][_0xca12('0x6c')])return;return db[_0xca12('0x78')]['find']({'where':{'id':_0x1ccd6d[_0xca12('0x47')][_0xca12('0x6c')],'role':'agent'},'attributes':['id',_0xca12('0x28'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xca12('0x13')](function(_0x24680a){if(!_0x24680a)return null;_0xd30b95[_0xca12('0x1b')][_0xca12('0x6b')]=_0x24680a;return _0xd30b95;})[_0xca12('0x13')](function(_0x543845){if(_0x543845){if(_0x1ccd6d[_0xca12('0x47')][_0xca12('0x79')]){_0xd30b95[_0xca12('0x1b')][_0xca12('0x7a')]=util[_0xca12('0x66')]('SIP/%s',_0x1ccd6d[_0xca12('0x5e')][_0xca12('0x28')]);_0xd30b95[_0xca12('0x1b')][_0xca12('0x7b')]=_0xd30b95[_0xca12('0x7b')];_0xd30b95[_0xca12('0x1b')]['motionChannel']=_0xd30b95[_0xca12('0x7b')];_0xd30b95[_0xca12('0x1b')][_0xca12('0x7c')]=_0xca12('0x68');_0xd30b95[_0xca12('0x1b')]['body']=htmlToText[_0xca12('0x7d')](_0xd30b95[_0xca12('0x1b')][_0xca12('0x47')]);return respondWithRpcPromise(_0xca12('0x7e'),_0xca12('0x7e'),{'event':_0xca12('0x7f'),'message':_0xd30b95[_0xca12('0x1b')]},client9002)['then'](function(){return _0xd30b95;});}return _0xd30b95;}return null;})[_0xca12('0x13')](respondWithResult(_0x5da8a3,null))[_0xca12('0x1d')](handleError(_0x5da8a3,null));};exports[_0xca12('0x80')]=function(_0x9e9c79,_0x4f1d24){var _0x1b8254={'agent':{},'channel':_0xca12('0x69')};if(_0x9e9c79['body']['id']){delete _0x9e9c79['body']['id'];}_0x9e9c79[_0xca12('0x47')][_0xca12('0x6c')]=_0x9e9c79[_0xca12('0x47')][_0xca12('0x6c')]||_0x9e9c79[_0xca12('0x5e')]['id'];_0x1b8254[_0xca12('0x6b')]['id']=_0x9e9c79[_0xca12('0x47')][_0xca12('0x6c')];return db['MailMessage'][_0xca12('0x48')]({'where':{'id':_0x9e9c79['params']['id'],'UserId':null}})[_0xca12('0x13')](handleEntityNotFound(_0x4f1d24,null))[_0xca12('0x13')](function(_0x46a3ff){if(_0x46a3ff){_0x1b8254[_0xca12('0x1b')]=_0x46a3ff[_0xca12('0x6d')]({'plain':!![]});return db['MailInteraction'][_0xca12('0x48')]({'where':{'id':_0x46a3ff[_0xca12('0x6e')]}});}return null;})['then'](handleEntityNotFound(_0x4f1d24,null))['then'](function(_0x12212c){if(_0x12212c){_0x1b8254[_0xca12('0x6f')]=_0x12212c['get']({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x9e9c79[_0xca12('0x5e')]['id'],_0x9e9c79[_0xca12('0x5e')][_0xca12('0x28')],_0x9e9c79[_0xca12('0x5e')][_0xca12('0x81')],_0x1b8254[_0xca12('0x6f')]['id'],_0x9e9c79[_0xca12('0x47')]?JSON[_0xca12('0x18')](_0x9e9c79[_0xca12('0x47')]):'null');return respondWithRpcPromise(_0xca12('0x82'),_0xca12('0x83'),_0x1b8254);}return null;})[_0xca12('0x13')](function(_0x3af6e7){var _0x51e2b8=_0xca12('0x74')+_0x3af6e7[_0xca12('0x1b')][_0xca12('0x75')];return db[_0xca12('0x76')]['query'](_0x51e2b8,{'type':db[_0xca12('0x84')][_0xca12('0x85')][_0xca12('0x77')],'raw':!![]})['then'](function(_0x15d3a0){return _0x15d3a0;});})[_0xca12('0x13')](function(_0xdce880){if(_0xdce880){_0x1b8254[_0xca12('0x1b')]['contact']=_0xdce880[0x0];if(!_0x9e9c79[_0xca12('0x47')]['UserId'])return;return db[_0xca12('0x78')][_0xca12('0x48')]({'where':{'id':_0x9e9c79['body']['UserId'],'role':'agent'},'attributes':['id',_0xca12('0x28'),'fullname',_0xca12('0x86'),_0xca12('0x87')],'raw':!![]});}return null;})['then'](function(_0x58451a){if(!_0x58451a)return null;_0x1b8254[_0xca12('0x1b')][_0xca12('0x6b')]=_0x58451a;return _0x1b8254;})[_0xca12('0x13')](function(_0x3c2e46){if(_0x3c2e46){_0x3c2e46[_0xca12('0x1b')][_0xca12('0x7a')]=util['format'](_0xca12('0x88'),_0x9e9c79[_0xca12('0x5e')][_0xca12('0x28')]);_0x3c2e46[_0xca12('0x1b')][_0xca12('0x7b')]=_0x1b8254['channel'];_0x3c2e46[_0xca12('0x1b')][_0xca12('0x89')]=_0x1b8254['channel'];_0x3c2e46[_0xca12('0x1b')][_0xca12('0x7c')]=_0xca12('0x80');_0x3c2e46[_0xca12('0x1b')]['body']=htmlToText['fromString'](_0x1b8254[_0xca12('0x1b')][_0xca12('0x47')]);respondWithRpcPromise(_0xca12('0x7e'),_0xca12('0x7e'),{'event':_0xca12('0x8a'),'message':_0x3c2e46[_0xca12('0x1b')]},client9002);return _0x1b8254;}return null;})[_0xca12('0x13')](respondWithResult(_0x4f1d24,null))[_0xca12('0x1d')](handleError(_0x4f1d24,null));};exports['download']=function(_0x17a3b2,_0x5157f7){var _0x244793=moment()[_0xca12('0x8b')]()[_0xca12('0x8c')]();var _0x329ddd=path['join'](config['root'],'server',_0xca12('0x8d'),_0xca12('0x8e'));var _0x5de4fc=path[_0xca12('0x8f')](config['root'],_0xca12('0x90'),_0xca12('0x8d'),'attachments');var _0x135b64=util[_0xca12('0x66')]('message-%s.eml',_0x244793);return db['MailMessage']['find']({'where':{'id':_0x17a3b2[_0xca12('0x44')]['id']},'attributes':['id',_0xca12('0x47'),_0xca12('0x91'),'to','cc',_0xca12('0x92'),_0xca12('0x93'),_0xca12('0x94')],'include':_0x17a3b2[_0xca12('0x2e')]['attachments']?[{'model':db[_0xca12('0x95')],'as':_0xca12('0x96')}]:undefined})[_0xca12('0x13')](handleEntityNotFound(_0x5157f7,null))[_0xca12('0x13')](function(_0x6e1ca9){if(_0x6e1ca9){var _0x27dd30=_0x6e1ca9;var _0x1274b3={'from':_0x27dd30[_0xca12('0x91')],'to':_0x27dd30['to'],'subject':_0x27dd30['subject'],'html':htmlEntities['decode'](_0x27dd30[_0xca12('0x47')]),'headers':{'Date':moment(_0x27dd30[_0xca12('0x94')])['format'](_0xca12('0x97'))},'attachments':[]};if(_0x6e1ca9['cc']){_0x1274b3['headers']['Cc']=_0x6e1ca9['cc'];}if(_0x6e1ca9[_0xca12('0x92')]){_0x1274b3['headers'][_0xca12('0x98')]=_0x6e1ca9['bcc'];}return new BPromise(function(_0x5e643c,_0x3cdc40){if(_0x6e1ca9[_0xca12('0x96')]){for(var _0x46bd14=0x0;_0x46bd14<_0x6e1ca9[_0xca12('0x96')][_0xca12('0x45')];_0x46bd14++){var _0x3ee8e3=_0x6e1ca9[_0xca12('0x96')][_0x46bd14];var _0x32a731=path[_0xca12('0x8f')](_0x5de4fc,_0x3ee8e3[_0xca12('0x61')]);if(fs['existsSync'](_0x32a731)){_0x1274b3[_0xca12('0x5f')][_0xca12('0x99')]({'name':_0x3ee8e3[_0xca12('0x28')],'contentType':_0x3ee8e3[_0xca12('0x2c')],'data':fs[_0xca12('0x9a')](_0x32a731)});}}}emlformat[_0xca12('0x9b')](_0x1274b3,function(_0x19919c,_0x43fe13){if(_0x19919c)return _0x3cdc40(_0x19919c);fs[_0xca12('0x9c')](path[_0xca12('0x8f')](_0x329ddd,_0x135b64),_0x43fe13);return _0x5e643c(_0x43fe13);});});}})[_0xca12('0x13')](function(_0x12acb6){if(_0x12acb6){return _0x5157f7['download'](path['join'](_0x329ddd,_0x135b64),_0x135b64,function(_0x3db78a){if(!_0x3db78a)fs[_0xca12('0x9d')](path[_0xca12('0x8f')](_0x329ddd,_0x135b64));});}})[_0xca12('0x1d')](handleError(_0x5157f7,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 75beb30..bc39835 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 _0xfedd=['../../mysqldb','MailMessage','setMaxListeners','save','update','hasOwnProperty','hook','exports','events'];(function(_0x53f740,_0x1c689c){var _0x50636a=function(_0x304fbc){while(--_0x304fbc){_0x53f740['push'](_0x53f740['shift']());}};_0x50636a(++_0x1c689c);}(_0xfedd,0xf2));var _0xdfed=function(_0x360c70,_0x1c2aa2){_0x360c70=_0x360c70-0x0;var _0x1db534=_0xfedd[_0x360c70];return _0x1db534;};'use strict';var EventEmitter=require(_0xdfed('0x0'));var MailMessage=require(_0xdfed('0x1'))['db'][_0xdfed('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xdfed('0x3')](0x0);var events={'afterCreate':_0xdfed('0x4'),'afterUpdate':_0xdfed('0x5'),'afterDestroy':'remove'};function emitEvent(_0x154b2e){return function(_0x1ffa9d,_0xce803c,_0x5a97a8){MailMessageEvents['emit'](_0x154b2e+':'+_0x1ffa9d['id'],_0x1ffa9d);MailMessageEvents['emit'](_0x154b2e,_0x1ffa9d);_0x5a97a8(null);};}for(var e in events){if(events[_0xdfed('0x6')](e)){var event=events[e];MailMessage[_0xdfed('0x7')](e,emitEvent(event));}}module[_0xdfed('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x3ffb=['emit','hasOwnProperty','hook','exports','MailMessage','setMaxListeners','save','update','remove'];(function(_0x51c726,_0x332b95){var _0x23fe86=function(_0x3145c8){while(--_0x3145c8){_0x51c726['push'](_0x51c726['shift']());}};_0x23fe86(++_0x332b95);}(_0x3ffb,0x79));var _0xb3ff=function(_0x2c7d91,_0x24c096){_0x2c7d91=_0x2c7d91-0x0;var _0x24ff3f=_0x3ffb[_0x2c7d91];return _0x24ff3f;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0xb3ff('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb3ff('0x1')](0x0);var events={'afterCreate':_0xb3ff('0x2'),'afterUpdate':_0xb3ff('0x3'),'afterDestroy':_0xb3ff('0x4')};function emitEvent(_0x4939c4){return function(_0x56bd4d,_0x8190a,_0xae1b43){MailMessageEvents[_0xb3ff('0x5')](_0x4939c4+':'+_0x56bd4d['id'],_0x56bd4d);MailMessageEvents['emit'](_0x4939c4,_0x56bd4d);_0xae1b43(null);};}for(var e in events){if(events[_0xb3ff('0x6')](e)){var event=events[e];MailMessage[_0xb3ff('0x7')](e,emitEvent(event));}}module[_0xb3ff('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index b08e6ed..c820dcd 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 _0x2bad=['toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','exports','messageId','fti_mail_messages','subject','FULLTEXT','body','fromString','models','get','direction'];(function(_0x43b956,_0xdb23d9){var _0x54aa7d=function(_0x58159c){while(--_0x58159c){_0x43b956['push'](_0x43b956['shift']());}};_0x54aa7d(++_0xdb23d9);}(_0x2bad,0x6d));var _0xd2ba=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0x2bad[_0x234ae1];return _0x227ba0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd2ba('0x0'))(_0xd2ba('0x1'));var moment=require(_0xd2ba('0x2'));var BPromise=require(_0xd2ba('0x3'));var rp=require(_0xd2ba('0x4'));var htmlToText=require(_0xd2ba('0x5'));var fs=require('fs');var path=require(_0xd2ba('0x6'));var rimraf=require(_0xd2ba('0x7'));var config=require(_0xd2ba('0x8'));var attributes=require('./mailMessage.attributes');module[_0xd2ba('0x9')]=function(_0x107735,_0x518bb2){return _0x107735['define']('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xd2ba('0xa'),'fields':[_0xd2ba('0xa')]},{'name':_0xd2ba('0xb'),'fields':['plainBody',_0xd2ba('0xc')],'type':_0xd2ba('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x29cc8a,_0x4ff476,_0x4caf9a){if(_0x29cc8a[_0xd2ba('0xe')]){_0x29cc8a['plainBody']=htmlToText[_0xd2ba('0xf')](_0x29cc8a['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4caf9a(null,_0x4ff476);},'afterCreate':function(_0x59b1db,_0x5f588b,_0x1b76cd){var _0x3834a9=_0x107735[_0xd2ba('0x10')];var _0xff2b04=_0x59b1db[_0xd2ba('0x11')]({'plain':!![]});if(_0xff2b04[_0xd2ba('0x12')][_0xd2ba('0x13')]()==='in'||_0xff2b04['direction'][_0xd2ba('0x13')]()===_0xd2ba('0x14')&&!_0xff2b04[_0xd2ba('0x15')]&&!_[_0xd2ba('0x16')](_0xff2b04[_0xd2ba('0x17')])){_0x3834a9[_0xd2ba('0x18')][_0xd2ba('0x19')]({'where':{'id':_0xff2b04['MailInteractionId']}})[_0xd2ba('0x1a')](function(_0x56fb12){if(_0x56fb12){_0x56fb12['update']({'lastMsgAt':_0xff2b04[_0xd2ba('0x1b')],'lastMsgDirection':_0xff2b04[_0xd2ba('0x12')][_0xd2ba('0x13')]()});}})[_0xd2ba('0x1c')](function(_0x25c8b2){console[_0xd2ba('0x1d')](_0x25c8b2);});}_0x1b76cd();}},'charset':_0xd2ba('0x1e'),'collate':_0xd2ba('0x1f')});}; \ No newline at end of file +var _0x51c7=['toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','body','fromString','get','direction'];(function(_0x4b3f3e,_0x47dfcc){var _0x921fc3=function(_0x3e4b3b){while(--_0x3e4b3b){_0x4b3f3e['push'](_0x4b3f3e['shift']());}};_0x921fc3(++_0x47dfcc);}(_0x51c7,0x1dc));var _0x751c=function(_0x5459b0,_0x4d2ef8){_0x5459b0=_0x5459b0-0x0;var _0x675a35=_0x51c7[_0x5459b0];return _0x675a35;};'use strict';var _=require(_0x751c('0x0'));var util=require('util');var logger=require(_0x751c('0x1'))('api');var moment=require(_0x751c('0x2'));var BPromise=require('bluebird');var rp=require(_0x751c('0x3'));var htmlToText=require(_0x751c('0x4'));var fs=require('fs');var path=require(_0x751c('0x5'));var rimraf=require(_0x751c('0x6'));var config=require(_0x751c('0x7'));var attributes=require('./mailMessage.attributes');module[_0x751c('0x8')]=function(_0x33785b,_0x4bb237){return _0x33785b[_0x751c('0x9')](_0x751c('0xa'),attributes,{'tableName':_0x751c('0xb'),'paranoid':![],'indexes':[{'name':_0x751c('0xc'),'fields':[_0x751c('0xc')]},{'name':_0x751c('0xd'),'fields':[_0x751c('0xe'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x43cf1d,_0x490396,_0x34bb5f){if(_0x43cf1d[_0x751c('0xf')]){_0x43cf1d[_0x751c('0xe')]=htmlToText[_0x751c('0x10')](_0x43cf1d['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x34bb5f(null,_0x490396);},'afterCreate':function(_0x587975,_0x12b821,_0x40bfcf){var _0x3a13b4=_0x33785b['models'];var _0xa5d2d5=_0x587975[_0x751c('0x11')]({'plain':!![]});if(_0xa5d2d5[_0x751c('0x12')][_0x751c('0x13')]()==='in'||_0xa5d2d5[_0x751c('0x12')][_0x751c('0x13')]()===_0x751c('0x14')&&!_0xa5d2d5[_0x751c('0x15')]&&!_[_0x751c('0x16')](_0xa5d2d5[_0x751c('0x17')])){_0x3a13b4[_0x751c('0x18')][_0x751c('0x19')]({'where':{'id':_0xa5d2d5[_0x751c('0x1a')]}})['then'](function(_0x3ab0c0){if(_0x3ab0c0){_0x3ab0c0[_0x751c('0x1b')]({'lastMsgAt':_0xa5d2d5[_0x751c('0x1c')],'lastMsgDirection':_0xa5d2d5[_0x751c('0x12')][_0x751c('0x13')]()});}})[_0x751c('0x1d')](function(_0x261be7){console[_0x751c('0x1e')](_0x261be7);});}_0x40bfcf();}},'charset':_0x751c('0x1f'),'collate':_0x751c('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 089698f..fc59059 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 _0x5464=['localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','message','catch','CreateMailMessage','MailMessage','body','options','raw','then','debug','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x5464,0x15d));var _0x4546=function(_0x18a5b2,_0x492ecc){_0x18a5b2=_0x18a5b2-0x0;var _0x195fef=_0x5464[_0x18a5b2];return _0x195fef;};'use strict';var _=require(_0x4546('0x0'));var util=require(_0x4546('0x1'));var moment=require(_0x4546('0x2'));var BPromise=require('bluebird');var rs=require(_0x4546('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4546('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4546('0x5'))(_0x4546('0x6'));var config=require(_0x4546('0x7'));var jayson=require(_0x4546('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x4546('0x9')](config[_0x4546('0xa')],{'host':_0x4546('0xb'),'port':0x18eb});var socket=require(_0x4546('0xc'))(new Redis(config[_0x4546('0xa')]));require(_0x4546('0xd'))[_0x4546('0xe')](socket);function respondWithRpcPromise(_0x430b2e,_0x383bf2,_0x4ac723){return new BPromise(function(_0x1dd3f5,_0x8a15e2){return client[_0x4546('0xf')](_0x430b2e,_0x4ac723)['then'](function(_0x1f82c9){logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,_0x4546('0x12'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x383bf2,_0x4546('0x12'),JSON['stringify'](_0x1f82c9));if(_0x1f82c9['error']){if(_0x1f82c9['error']['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')]['message']);return _0x8a15e2(_0x1f82c9[_0x4546('0x13')]['message']);}logger[_0x4546('0x13')]('MailMessage,\x20%s,\x20%s',_0x383bf2,_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);return _0x1dd3f5(_0x1f82c9[_0x4546('0x13')][_0x4546('0x14')]);}else{logger[_0x4546('0x10')](_0x4546('0x11'),_0x383bf2,'request\x20sent');_0x1dd3f5(_0x1f82c9['result']['message']);}})[_0x4546('0x15')](function(_0x39f552){logger[_0x4546('0x13')](_0x4546('0x11'),_0x383bf2,_0x39f552);_0x8a15e2(_0x39f552);});});}exports[_0x4546('0x16')]=function(_0x337a44){var _0x3ec009=this;return new Promise(function(_0x2f6329,_0x4034a5){return db[_0x4546('0x17')]['create'](_0x337a44[_0x4546('0x18')],{'raw':_0x337a44[_0x4546('0x19')]?_0x337a44['options'][_0x4546('0x1a')]===undefined?!![]:![]:!![]})[_0x4546('0x1b')](function(_0x1a1984){logger[_0x4546('0x10')](_0x4546('0x16'),_0x337a44);logger[_0x4546('0x1c')]('CreateMailMessage',_0x337a44,JSON[_0x4546('0x1d')](_0x1a1984));_0x2f6329(_0x1a1984);})[_0x4546('0x15')](function(_0x4f9fcf){logger[_0x4546('0x13')](_0x4546('0x16'),_0x4f9fcf[_0x4546('0x14')],_0x337a44);_0x4034a5(_0x3ec009[_0x4546('0x13')](0x1f4,_0x4f9fcf[_0x4546('0x14')]));});});}; \ No newline at end of file +var _0xd4f4=['CreateMailMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x39d86a,_0x17a132){var _0x48883c=function(_0x403ddf){while(--_0x403ddf){_0x39d86a['push'](_0x39d86a['shift']());}};_0x48883c(++_0x17a132);}(_0xd4f4,0x8b));var _0x4d4f=function(_0xea4513,_0xf57ac){_0xea4513=_0xea4513-0x0;var _0x54989b=_0xd4f4[_0xea4513];return _0x54989b;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4d4f('0xb')]=_[_0x4d4f('0xc')](config[_0x4d4f('0xb')],{'host':_0x4d4f('0xd'),'port':0x18eb});var socket=require(_0x4d4f('0xe'))(new Redis(config[_0x4d4f('0xb')]));require(_0x4d4f('0xf'))[_0x4d4f('0x10')](socket);function respondWithRpcPromise(_0x385597,_0xba5200,_0x20db50){return new BPromise(function(_0x88b592,_0x128d39){return client[_0x4d4f('0x11')](_0x385597,_0x20db50)[_0x4d4f('0x12')](function(_0x28fb3e){logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xba5200,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x28fb3e));if(_0x28fb3e['error']){if(_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x128d39(_0x28fb3e[_0x4d4f('0x17')]['message']);}logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x88b592(_0x28fb3e[_0x4d4f('0x17')]['message']);}else{logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');_0x88b592(_0x28fb3e['result']['message']);}})['catch'](function(_0x5eebec){logger[_0x4d4f('0x17')](_0x4d4f('0x14'),_0xba5200,_0x5eebec);_0x128d39(_0x5eebec);});});}exports[_0x4d4f('0x1a')]=function(_0x3566a5){var _0x5d7b1f=this;return new Promise(function(_0x5b2863,_0x1e1ae2){return db['MailMessage'][_0x4d4f('0x1b')](_0x3566a5[_0x4d4f('0x1c')],{'raw':_0x3566a5[_0x4d4f('0x1d')]?_0x3566a5[_0x4d4f('0x1d')][_0x4d4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x570520){logger[_0x4d4f('0x13')]('CreateMailMessage',_0x3566a5);logger[_0x4d4f('0x1f')](_0x4d4f('0x1a'),_0x3566a5,JSON[_0x4d4f('0x16')](_0x570520));_0x5b2863(_0x570520);})[_0x4d4f('0x20')](function(_0xf3f7a4){logger['error'](_0x4d4f('0x1a'),_0xf3f7a4[_0x4d4f('0x19')],_0x3566a5);_0x1e1ae2(_0x5d7b1f[_0x4d4f('0x17')](0x1f4,_0xf3f7a4[_0x4d4f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index c51f798..ea1f184 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 _0x360e=['mailMessage:','./mailMessage.events','save','remove','update','removeListener','register'];(function(_0x124458,_0x453fa9){var _0x3510ca=function(_0x108b81){while(--_0x108b81){_0x124458['push'](_0x124458['shift']());}};_0x3510ca(++_0x453fa9);}(_0x360e,0xf6));var _0xe360=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0x360e[_0x42d2af];return _0x1d6d63;};'use strict';var MailMessageEvents=require(_0xe360('0x0'));var events=[_0xe360('0x1'),_0xe360('0x2'),_0xe360('0x3')];function createListener(_0x2226e8,_0x5ba07b){return function(_0x82d8d3){_0x5ba07b['emit'](_0x2226e8,_0x82d8d3);};}function removeListener(_0x5224c0,_0x4e51d5){return function(){MailMessageEvents[_0xe360('0x4')](_0x5224c0,_0x4e51d5);};}exports[_0xe360('0x5')]=function(_0x4dca6d){for(var _0x256ff3=0x0,_0x1b72e9=events['length'];_0x256ff3<_0x1b72e9;_0x256ff3++){var _0x2e208c=events[_0x256ff3];var _0x1aeacb=createListener(_0xe360('0x6')+_0x2e208c,_0x4dca6d);MailMessageEvents['on'](_0x2e208c,_0x1aeacb);}}; \ No newline at end of file +var _0xb9bb=['register','length','mailMessage:','remove','update','emit','removeListener'];(function(_0x14af1e,_0x140cdf){var _0x889ac1=function(_0x536247){while(--_0x536247){_0x14af1e['push'](_0x14af1e['shift']());}};_0x889ac1(++_0x140cdf);}(_0xb9bb,0xa4));var _0xbb9b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb9bb[_0x167cc1];return _0x10bc4b;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0xbb9b('0x0'),_0xbb9b('0x1')];function createListener(_0x5c85d5,_0x589f0d){return function(_0x59f2af){_0x589f0d[_0xbb9b('0x2')](_0x5c85d5,_0x59f2af);};}function removeListener(_0x55b412,_0x48b180){return function(){MailMessageEvents[_0xbb9b('0x3')](_0x55b412,_0x48b180);};}exports[_0xbb9b('0x4')]=function(_0x1afa70){for(var _0x224710=0x0,_0x5d961d=events[_0xbb9b('0x5')];_0x224710<_0x5d961d;_0x224710++){var _0x4eddf5=events[_0x224710];var _0x3025cf=createListener(_0xbb9b('0x6')+_0x4eddf5,_0x1afa70);MailMessageEvents['on'](_0x4eddf5,_0x3025cf);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 64a730d..25a9526 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 _0xe54c=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','delete','destroy','removeTeams','removeAgents','multer','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe54c,0x186));var _0xce54=function(_0x44be9a,_0x5ce1a6){_0x44be9a=_0x44be9a-0x0;var _0x3dbb78=_0xe54c[_0x44be9a];return _0x3dbb78;};'use strict';var multer=require(_0xce54('0x0'));var util=require(_0xce54('0x1'));var path=require(_0xce54('0x2'));var timeout=require('connect-timeout');var express=require(_0xce54('0x3'));var router=express['Router']();var fs_extra=require(_0xce54('0x4'));var auth=require(_0xce54('0x5'));var interaction=require(_0xce54('0x6'));var config=require(_0xce54('0x7'));var controller=require(_0xce54('0x8'));router['get']('/',auth[_0xce54('0x9')](),controller[_0xce54('0xa')]);router[_0xce54('0xb')]('/describe',auth[_0xce54('0x9')](),controller[_0xce54('0xc')]);router['get'](_0xce54('0xd'),auth[_0xce54('0x9')](),controller[_0xce54('0xe')]);router['get'](_0xce54('0xf'),auth[_0xce54('0x9')](),controller[_0xce54('0x10')]);router['get'](_0xce54('0x11'),auth[_0xce54('0x9')](),controller[_0xce54('0x12')]);router[_0xce54('0xb')](_0xce54('0x13'),auth[_0xce54('0x9')](),controller[_0xce54('0x14')]);router['post']('/',auth[_0xce54('0x9')](),controller['create']);router[_0xce54('0x15')](_0xce54('0x11'),auth['isAuthenticated'](),controller[_0xce54('0x16')]);router[_0xce54('0x15')](_0xce54('0x13'),auth[_0xce54('0x9')](),controller['addAgents']);router[_0xce54('0x17')](_0xce54('0xd'),auth[_0xce54('0x9')](),controller['update']);router[_0xce54('0x18')](_0xce54('0xd'),auth[_0xce54('0x9')](),controller[_0xce54('0x19')]);router[_0xce54('0x18')]('/:id/teams',auth[_0xce54('0x9')](),controller[_0xce54('0x1a')]);router[_0xce54('0x18')](_0xce54('0x13'),auth[_0xce54('0x9')](),controller[_0xce54('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xea93=['./mailQueue.controller','get','isAuthenticated','index','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0xf2a377,_0x68a10a){var _0x263678=function(_0x177235){while(--_0x177235){_0xf2a377['push'](_0xf2a377['shift']());}};_0x263678(++_0x68a10a);}(_0xea93,0x18f));var _0x3ea9=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0xea93[_0xbb14db];return _0x36bed7;};'use strict';var multer=require(_0x3ea9('0x0'));var util=require('util');var path=require(_0x3ea9('0x1'));var timeout=require(_0x3ea9('0x2'));var express=require(_0x3ea9('0x3'));var router=express[_0x3ea9('0x4')]();var fs_extra=require(_0x3ea9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ea9('0x6'));var controller=require(_0x3ea9('0x7'));router[_0x3ea9('0x8')]('/',auth[_0x3ea9('0x9')](),controller[_0x3ea9('0xa')]);router['get']('/describe',auth[_0x3ea9('0x9')](),controller['describe']);router['get'](_0x3ea9('0xb'),auth['isAuthenticated'](),controller[_0x3ea9('0xc')]);router['get'](_0x3ea9('0xd'),auth[_0x3ea9('0x9')](),controller[_0x3ea9('0xe')]);router[_0x3ea9('0x8')]('/:id/teams',auth[_0x3ea9('0x9')](),controller[_0x3ea9('0xf')]);router[_0x3ea9('0x8')](_0x3ea9('0x10'),auth['isAuthenticated'](),controller[_0x3ea9('0x11')]);router['post']('/',auth[_0x3ea9('0x9')](),controller[_0x3ea9('0x12')]);router[_0x3ea9('0x13')](_0x3ea9('0x14'),auth[_0x3ea9('0x9')](),controller[_0x3ea9('0x15')]);router[_0x3ea9('0x13')](_0x3ea9('0x10'),auth[_0x3ea9('0x9')](),controller['addAgents']);router[_0x3ea9('0x16')](_0x3ea9('0xb'),auth['isAuthenticated'](),controller[_0x3ea9('0x17')]);router[_0x3ea9('0x18')](_0x3ea9('0xb'),auth['isAuthenticated'](),controller[_0x3ea9('0x19')]);router[_0x3ea9('0x18')](_0x3ea9('0x14'),auth[_0x3ea9('0x9')](),controller[_0x3ea9('0x1a')]);router['delete'](_0x3ea9('0x10'),auth['isAuthenticated'](),controller[_0x3ea9('0x1b')]);module[_0x3ea9('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 5afc70f..0b73d60 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 _0xeb39=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xeb39,0x1c7));var _0x9eb3=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xeb39[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0x9eb3('0x0'));module[_0x9eb3('0x1')]={'name':{'type':Sequelize[_0x9eb3('0x2')],'unique':_0x9eb3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9eb3('0x2')]},'timeout':{'type':Sequelize[_0x9eb3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9eb3('0x5')](_0x9eb3('0x6'),'beepall',_0x9eb3('0x7'))}}; \ No newline at end of file +var _0x33c6=['STRING','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33c6,0x11e));var _0x633c=function(_0x218e71,_0x35f0f7){_0x218e71=_0x218e71-0x0;var _0x4a644f=_0x33c6[_0x218e71];return _0x4a644f;};'use strict';var Sequelize=require(_0x633c('0x0'));module[_0x633c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x633c('0x2')]},'timeout':{'type':Sequelize[_0x633c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x633c('0x4')](_0x633c('0x5'),'beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 671a08a..4f7a25d 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 _0xe13a=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','includeAll','include','rows','catch','show','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','describe','getMembers','findOne','UserMailQueue','MailQueueId','filter','findAll','User','findAndCountAll','agent','mailPause','createdAt','format','%s/%s','updatedAt','getTeams','Team','ids','Agents','voicePause','flatMap','get','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','sendStatus','status','end','json','offset','undefined','limit','count','set','save','destroy','MailQueues','then','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x487728,_0x311735){var _0x21112c=function(_0x4afb96){while(--_0x4afb96){_0x487728['push'](_0x487728['shift']());}};_0x21112c(++_0x311735);}(_0xe13a,0x178));var _0xae13=function(_0x4b6378,_0x4da483){_0x4b6378=_0x4b6378-0x0;var _0x2ee3a5=_0xe13a[_0x4b6378];return _0x2ee3a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xae13('0x0'));var zipdir=require(_0xae13('0x1'));var jsonpatch=require(_0xae13('0x2'));var rp=require(_0xae13('0x3'));var moment=require('moment');var BPromise=require(_0xae13('0x4'));var Mustache=require(_0xae13('0x5'));var util=require(_0xae13('0x6'));var path=require(_0xae13('0x7'));var sox=require(_0xae13('0x8'));var csv=require(_0xae13('0x9'));var ejs=require(_0xae13('0xa'));var fs=require('fs');var fs_extra=require(_0xae13('0xb'));var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0x9'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae13('0x15'));var logger=require(_0xae13('0x16'))(_0xae13('0x17'));var utils=require(_0xae13('0x18'));var config=require(_0xae13('0x19'));var licenseUtil=require(_0xae13('0x1a'));var db=require(_0xae13('0x1b'))['db'];config['redis']=_[_0xae13('0x1c')](config[_0xae13('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x26ff3e,_0x148186){_0x148186=_0x148186||0xcc;return function(_0x44e141){if(_0x44e141){return _0x26ff3e[_0xae13('0x1e')](_0x148186);}return _0x26ff3e[_0xae13('0x1f')](_0x148186)[_0xae13('0x20')]();};}function respondWithResult(_0x5c25a4,_0x3c488f){_0x3c488f=_0x3c488f||0xc8;return function(_0x5e46bc){if(_0x5e46bc){return _0x5c25a4[_0xae13('0x1f')](_0x3c488f)[_0xae13('0x21')](_0x5e46bc);}};}function respondWithFilteredResult(_0x207363,_0x118e52){return function(_0x1a9c07){if(_0x1a9c07){var _0x1b33b7=typeof _0x118e52[_0xae13('0x22')]===_0xae13('0x23')&&typeof _0x118e52[_0xae13('0x24')]==='undefined';var _0x4462a5=_0x1a9c07['count'];var _0x17a8c6=_0x1b33b7?0x0:_0x118e52[_0xae13('0x22')];var _0x49c7d5=_0x1b33b7?_0x1a9c07[_0xae13('0x25')]:_0x118e52[_0xae13('0x22')]+_0x118e52[_0xae13('0x24')];var _0x240802;if(_0x49c7d5>=_0x4462a5){_0x49c7d5=_0x4462a5;_0x240802=0xc8;}else{_0x240802=0xce;}_0x207363[_0xae13('0x1f')](_0x240802);return _0x207363[_0xae13('0x26')]('Content-Range',_0x17a8c6+'-'+_0x49c7d5+'/'+_0x4462a5)['json'](_0x1a9c07);}return null;};}function patchUpdates(_0x149eda){return function(_0x290fb9){try{jsonpatch['apply'](_0x290fb9,_0x149eda,!![]);}catch(_0x168b92){return BPromise['reject'](_0x168b92);}return _0x290fb9[_0xae13('0x27')]();};}function saveUpdates(_0x194437,_0x3f12b0){return function(_0x4b47d1){if(_0x4b47d1){return _0x4b47d1['update'](_0x194437)['then'](function(_0x4edb8c){return _0x4edb8c;});}return null;};}function removeEntity(_0xc5e6a7,_0x17ce58){return function(_0x55a39b){if(_0x55a39b){return _0x55a39b[_0xae13('0x28')]()['then'](function(){var _0x3d0d60=_0x55a39b['get']({'plain':!![]});var _0xbeda8d=_0xae13('0x29');return db['UserProfileResource'][_0xae13('0x28')]({'where':{'type':_0xbeda8d,'resourceId':_0x3d0d60['id']}})[_0xae13('0x2a')](function(){return _0x55a39b;});})[_0xae13('0x2a')](function(){_0xc5e6a7[_0xae13('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ceb7,_0x27b737){return function(_0x1d7152){if(!_0x1d7152){_0x41ceb7[_0xae13('0x1e')](0x194);}return _0x1d7152;};}function handleError(_0x742759,_0x27bcf3){_0x27bcf3=_0x27bcf3||0x1f4;return function(_0x277b69){logger['error'](_0x277b69[_0xae13('0x2b')]);if(_0x277b69['name']){delete _0x277b69[_0xae13('0x2c')];}_0x742759[_0xae13('0x1f')](_0x27bcf3)[_0xae13('0x2d')](_0x277b69);};}exports[_0xae13('0x2e')]=function(_0x352aec,_0x39718f){var _0x11c2ba={},_0x48f0f6={},_0x4a3deb={'count':0x0,'rows':[]};var _0x30d2c0=_[_0xae13('0x2f')](db[_0xae13('0x30')][_0xae13('0x31')],function(_0x3d4ffd){return{'name':_0x3d4ffd[_0xae13('0x32')],'type':_0x3d4ffd[_0xae13('0x33')][_0xae13('0x34')]};});_0x48f0f6[_0xae13('0x35')]=_[_0xae13('0x2f')](_0x30d2c0,'name');_0x48f0f6[_0xae13('0x36')]=_[_0xae13('0x37')](_0x352aec[_0xae13('0x36')]);_0x48f0f6['filters']=_['intersection'](_0x48f0f6['model'],_0x48f0f6['query']);_0x11c2ba['attributes']=_['intersection'](_0x48f0f6[_0xae13('0x35')],qs[_0xae13('0x38')](_0x352aec[_0xae13('0x36')]['fields']));_0x11c2ba[_0xae13('0x39')]=_0x11c2ba[_0xae13('0x39')][_0xae13('0x3a')]?_0x11c2ba[_0xae13('0x39')]:_0x48f0f6[_0xae13('0x35')];if(!_0x352aec['query'][_0xae13('0x3b')](_0xae13('0x3c'))){_0x11c2ba[_0xae13('0x24')]=qs['limit'](_0x352aec['query'][_0xae13('0x24')]);_0x11c2ba[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x352aec[_0xae13('0x36')]['offset']);}_0x11c2ba[_0xae13('0x3d')]=qs[_0xae13('0x3e')](_0x352aec['query'][_0xae13('0x3e')]);_0x11c2ba[_0xae13('0x3f')]=qs['filters'](_[_0xae13('0x40')](_0x352aec[_0xae13('0x36')],_0x48f0f6[_0xae13('0x41')]),_0x30d2c0);if(_0x352aec[_0xae13('0x36')]['filter']){_0x11c2ba[_0xae13('0x3f')]=_[_0xae13('0x42')](_0x11c2ba[_0xae13('0x3f')],{'$or':_[_0xae13('0x2f')](_0x30d2c0,function(_0x4ed070){if(_0x4ed070[_0xae13('0x33')]!==_0xae13('0x43')){var _0x4487b8={};_0x4487b8[_0x4ed070[_0xae13('0x2c')]]={'$like':'%'+_0x352aec['query']['filter']+'%'};return _0x4487b8;}})});}_0x11c2ba=_[_0xae13('0x42')]({},_0x11c2ba,_0x352aec[_0xae13('0x44')]);var _0x4bff9d={'where':_0x11c2ba[_0xae13('0x3f')]};return db['MailQueue'][_0xae13('0x25')](_0x4bff9d)[_0xae13('0x2a')](function(_0x3fca0a){_0x4a3deb['count']=_0x3fca0a;if(_0x352aec[_0xae13('0x36')][_0xae13('0x45')]){_0x11c2ba[_0xae13('0x46')]=[{'all':!![]}];}return db[_0xae13('0x30')]['findAll'](_0x11c2ba);})[_0xae13('0x2a')](function(_0x36a3c4){_0x4a3deb[_0xae13('0x47')]=_0x36a3c4;return _0x4a3deb;})[_0xae13('0x2a')](respondWithFilteredResult(_0x39718f,_0x11c2ba))[_0xae13('0x48')](handleError(_0x39718f,null));};exports[_0xae13('0x49')]=function(_0x3fa166,_0x349b30){var _0x548c11={'raw':!![],'where':{'id':_0x3fa166['params']['id']}},_0x2fa94d={};_0x2fa94d[_0xae13('0x35')]=_[_0xae13('0x37')](db[_0xae13('0x30')][_0xae13('0x31')]);_0x2fa94d['query']=_[_0xae13('0x37')](_0x3fa166['query']);_0x2fa94d[_0xae13('0x41')]=_[_0xae13('0x4a')](_0x2fa94d['model'],_0x2fa94d[_0xae13('0x36')]);_0x548c11[_0xae13('0x39')]=_[_0xae13('0x4a')](_0x2fa94d[_0xae13('0x35')],qs[_0xae13('0x38')](_0x3fa166[_0xae13('0x36')]['fields']));_0x548c11[_0xae13('0x39')]=_0x548c11[_0xae13('0x39')][_0xae13('0x3a')]?_0x548c11[_0xae13('0x39')]:_0x2fa94d[_0xae13('0x35')];if(_0x3fa166['query'][_0xae13('0x45')]){_0x548c11[_0xae13('0x46')]=[{'all':!![]}];}_0x548c11=_[_0xae13('0x42')]({},_0x548c11,_0x3fa166['options']);return db['MailQueue']['find'](_0x548c11)['then'](handleEntityNotFound(_0x349b30,null))[_0xae13('0x2a')](respondWithResult(_0x349b30,null))['catch'](handleError(_0x349b30,null));};exports[_0xae13('0x4b')]=function(_0x5554a6,_0x1e609d){return db[_0xae13('0x30')][_0xae13('0x4b')](_0x5554a6[_0xae13('0x4c')],{})[_0xae13('0x2a')](function(_0x53d341){var _0x10d730=_0x5554a6[_0xae13('0x4d')]['get']({'plain':!![]});if(!_0x10d730)throw new Error(_0xae13('0x4e'));if(_0x10d730[_0xae13('0x4f')]==='user'){var _0x50610f=_0x53d341['get']({'plain':!![]});var _0x47ab74=_0xae13('0x29');return db[_0xae13('0x50')]['find']({'where':{'name':_0x47ab74,'userProfileId':_0x10d730[_0xae13('0x51')]},'raw':!![]})[_0xae13('0x2a')](function(_0x53680c){if(_0x53680c&&_0x53680c[_0xae13('0x52')]===0x0){return db[_0xae13('0x53')][_0xae13('0x4b')]({'name':_0x50610f[_0xae13('0x2c')],'resourceId':_0x50610f['id'],'type':_0x53680c[_0xae13('0x2c')],'sectionId':_0x53680c['id']},{})[_0xae13('0x2a')](function(){return _0x53d341;});}else{return _0x53d341;}})[_0xae13('0x48')](function(_0x3d86ad){logger[_0xae13('0x54')](_0xae13('0x55'),_0x3d86ad);throw _0x3d86ad;});}return _0x53d341;})['then'](respondWithResult(_0x1e609d,0xc9))[_0xae13('0x48')](handleError(_0x1e609d,null));};exports[_0xae13('0x56')]=function(_0x3c6b7e,_0x481c30){if(_0x3c6b7e[_0xae13('0x4c')]['id']){delete _0x3c6b7e['body']['id'];}return db[_0xae13('0x30')][_0xae13('0x57')]({'where':{'id':_0x3c6b7e[_0xae13('0x58')]['id']}})['then'](handleEntityNotFound(_0x481c30,null))['then'](saveUpdates(_0x3c6b7e[_0xae13('0x4c')],null))[_0xae13('0x2a')](respondWithResult(_0x481c30,null))[_0xae13('0x48')](handleError(_0x481c30,null));};exports[_0xae13('0x28')]=function(_0x22989a,_0x175ee2){return db[_0xae13('0x30')]['find']({'where':{'id':_0x22989a[_0xae13('0x58')]['id']}})[_0xae13('0x2a')](handleEntityNotFound(_0x175ee2,null))[_0xae13('0x2a')](removeEntity(_0x175ee2,null))[_0xae13('0x48')](handleError(_0x175ee2,null));};exports[_0xae13('0x59')]=function(_0x67e5d3,_0x14f543){return db['MailQueue'][_0xae13('0x59')]()[_0xae13('0x2a')](respondWithResult(_0x14f543,null))['catch'](handleError(_0x14f543,null));};exports[_0xae13('0x5a')]=function(_0x40b1ed,_0xe6b279,_0x538e2a){var _0x17a55f={'raw':!![],'where':{}},_0x7fa6c5={},_0x50166a;return db[_0xae13('0x30')][_0xae13('0x5b')]({'where':{'id':_0x40b1ed[_0xae13('0x58')]['id']}})[_0xae13('0x2a')](handleEntityNotFound(_0xe6b279,null))[_0xae13('0x2a')](function(_0x1f9a21){if(_0x1f9a21){_0x50166a=_0x1f9a21['get']({'plain':!![]});_0x7fa6c5['model']=_[_0xae13('0x37')](db[_0xae13('0x5c')][_0xae13('0x31')]);_0x7fa6c5[_0xae13('0x36')]=_[_0xae13('0x37')](_0x40b1ed[_0xae13('0x36')]);_0x7fa6c5['filters']=_[_0xae13('0x4a')](_0x7fa6c5[_0xae13('0x35')],_0x7fa6c5['query']);_0x17a55f['attributes']=_['intersection'](_0x7fa6c5[_0xae13('0x35')],qs[_0xae13('0x38')](_0x40b1ed[_0xae13('0x36')][_0xae13('0x38')]));_0x17a55f[_0xae13('0x39')]=_0x17a55f[_0xae13('0x39')][_0xae13('0x3a')]?_0x17a55f[_0xae13('0x39')]:_0x7fa6c5[_0xae13('0x35')];if(!_0x40b1ed[_0xae13('0x36')][_0xae13('0x3b')](_0xae13('0x3c'))){_0x17a55f[_0xae13('0x24')]=qs[_0xae13('0x24')](_0x40b1ed[_0xae13('0x36')]['limit']);_0x17a55f[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x40b1ed['query'][_0xae13('0x22')]);}_0x17a55f['order']=qs['sort'](_0x40b1ed[_0xae13('0x36')][_0xae13('0x3e')]);_0x17a55f[_0xae13('0x3f')]=qs[_0xae13('0x41')](_[_0xae13('0x40')](_0x40b1ed[_0xae13('0x36')],_0x7fa6c5['filters']));_0x17a55f['where'][_0xae13('0x5d')]=_0x1f9a21['id'];if(_0x40b1ed[_0xae13('0x36')][_0xae13('0x5e')]){_0x17a55f['where']=_[_0xae13('0x42')](_0x17a55f['where'],{'$or':_[_0xae13('0x2f')](_0x17a55f[_0xae13('0x39')],function(_0x3bc286){var _0x25ac79={};_0x25ac79[_0x3bc286]={'$like':'%'+_0x40b1ed[_0xae13('0x36')]['filter']+'%'};return _0x25ac79;})});}_0x17a55f=_[_0xae13('0x42')]({},_0x17a55f,_0x40b1ed[_0xae13('0x44')]);return db['UserMailQueue'][_0xae13('0x5f')](_0x17a55f);}})[_0xae13('0x2a')](function(_0x1f641c){if(_0x1f641c){return db[_0xae13('0x60')][_0xae13('0x61')]({'where':{'id':_[_0xae13('0x2f')](_0x1f641c,'UserId'),'role':_0xae13('0x62')},'attributes':['id','name',_0xae13('0x63'),'updatedAt',_0xae13('0x64')]});}})[_0xae13('0x2a')](function(_0x5b1880){if(_0x5b1880){return{'count':_0x5b1880[_0xae13('0x25')],'rows':_[_0xae13('0x2f')](_0x5b1880[_0xae13('0x47')],function(_0xb00dd6){return{'membername':_0xb00dd6[_0xae13('0x2c')],'UserId':_0xb00dd6['id'],'queue_name':_0x50166a[_0xae13('0x2c')],'MailQueueId':_0x50166a['id'],'interface':util[_0xae13('0x65')](_0xae13('0x66'),'SIP',_0xb00dd6[_0xae13('0x2c')]),'penalty':0x0,'paused':_0xb00dd6[_0xae13('0x63')],'createdAt':_0xb00dd6[_0xae13('0x64')],'updatedAt':_0xb00dd6[_0xae13('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xae13('0x2a')](respondWithFilteredResult(_0xe6b279,_0x17a55f))[_0xae13('0x48')](handleError(_0xe6b279,null));};exports[_0xae13('0x68')]=function(_0x30dd50,_0x197e88,_0x471f64){var _0x491f7f={};var _0x40844e={};var _0x490754;var _0x4b51f4;return db[_0xae13('0x30')][_0xae13('0x5b')]({'where':{'id':_0x30dd50[_0xae13('0x58')]['id']}})['then'](handleEntityNotFound(_0x197e88,null))[_0xae13('0x2a')](function(_0x5d1b1c){if(_0x5d1b1c){_0x490754=_0x5d1b1c;_0x40844e[_0xae13('0x35')]=_['keys'](db[_0xae13('0x69')][_0xae13('0x31')]);_0x40844e['query']=_[_0xae13('0x37')](_0x30dd50[_0xae13('0x36')]);_0x40844e['filters']=_['intersection'](_0x40844e[_0xae13('0x35')],_0x40844e['query']);_0x491f7f['attributes']=_[_0xae13('0x4a')](_0x40844e['model'],qs[_0xae13('0x38')](_0x30dd50['query'][_0xae13('0x38')]));_0x491f7f[_0xae13('0x39')]=_0x491f7f[_0xae13('0x39')][_0xae13('0x3a')]?_0x491f7f[_0xae13('0x39')]:_0x40844e[_0xae13('0x35')];_0x491f7f['order']=qs[_0xae13('0x3e')](_0x30dd50[_0xae13('0x36')]['sort']);_0x491f7f['where']=qs['filters'](_[_0xae13('0x40')](_0x30dd50['query'],_0x40844e[_0xae13('0x41')]));if(_0x30dd50['query']['filter']){_0x491f7f[_0xae13('0x3f')]=_[_0xae13('0x42')](_0x491f7f[_0xae13('0x3f')],{'$or':_[_0xae13('0x2f')](_0x491f7f[_0xae13('0x39')],function(_0x317ca7){var _0x5c3f58={};_0x5c3f58[_0x317ca7]={'$like':'%'+_0x30dd50[_0xae13('0x36')][_0xae13('0x5e')]+'%'};return _0x5c3f58;})});}_0x491f7f=_[_0xae13('0x42')]({},_0x491f7f,_0x30dd50[_0xae13('0x44')]);return _0x490754['getTeams'](_0x491f7f);}})[_0xae13('0x2a')](function(_0x1ef79f){if(_0x1ef79f){_0x4b51f4=_0x1ef79f[_0xae13('0x3a')];if(!_0x30dd50['query']['hasOwnProperty'](_0xae13('0x3c'))){_0x491f7f[_0xae13('0x24')]=qs[_0xae13('0x24')](_0x30dd50[_0xae13('0x36')][_0xae13('0x24')]);_0x491f7f[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x30dd50[_0xae13('0x36')]['offset']);}return _0x490754[_0xae13('0x68')](_0x491f7f);}})[_0xae13('0x2a')](function(_0x5704df){if(_0x5704df){return _0x5704df?{'count':_0x4b51f4,'rows':_0x5704df}:null;}})[_0xae13('0x2a')](respondWithResult(_0x197e88,null))[_0xae13('0x48')](handleError(_0x197e88,null));};exports['addTeams']=function(_0x447960,_0x2e6612,_0x5412ba){var _0x1c259d=_0x447960[_0xae13('0x4c')][_0xae13('0x6a')];return db['Team']['findAll']({'where':{'id':_0x1c259d},'attributes':['id'],'include':[{'model':db[_0xae13('0x60')],'as':_0xae13('0x6b'),'attributes':['id',_0xae13('0x2c'),'online',_0xae13('0x6c'),'interface'],'raw':!![]}]})[_0xae13('0x2a')](function(_0x36a151){if(_0x36a151){var _0x274fc9=_[_0xae13('0x6d')](_0x36a151,function(_0x23b9aa){var _0x28d731=_0x23b9aa[_0xae13('0x6e')]({'plain':!![]});return _0x28d731[_0xae13('0x6b')];});return db[_0xae13('0x30')][_0xae13('0x57')]({'where':{'id':_0x447960['params']['id']}})[_0xae13('0x2a')](function(_0x47cf7b){return db[_0xae13('0x6f')][_0xae13('0x70')](function(_0x1d7aed){return _0x47cf7b[_0xae13('0x71')](_0x1c259d,{'transaction':_0x1d7aed})[_0xae13('0x2a')](function(){return BPromise[_0xae13('0x72')](_0x274fc9,function(_0x3c00a4){return db[_0xae13('0x5c')][_0xae13('0x73')]({'where':{'UserId':_0x3c00a4['id'],'MailQueueId':_0x447960[_0xae13('0x58')]['id']},'transaction':_0x1d7aed});});})['then'](function(){_0x274fc9[_0xae13('0x74')](function(_0x1b6b06){socket[_0xae13('0x75')](_0xae13('0x76'),{'UserId':_0x1b6b06['id'],'MailQueueId':_0x47cf7b['id']});});});});});}})[_0xae13('0x2a')](respondWithStatusCode(_0x2e6612,null))[_0xae13('0x48')](handleError(_0x2e6612,null));};exports[_0xae13('0x77')]=function(_0x360b1a,_0x544f6d,_0x934583){return db[_0xae13('0x69')][_0xae13('0x5f')]({'where':{'id':_0x360b1a[_0xae13('0x36')][_0xae13('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xae13('0x60')],'as':_0xae13('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x544f6d,null))[_0xae13('0x2a')](function(_0x254e9b){var _0xdc464=_[_0xae13('0x2f')](_0x254e9b,'id');var _0x46090b=[];var _0x2ced73=[];var _0x4a5551=squel[_0xae13('0x78')]();_0x4a5551[_0xae13('0x79')](_0xae13('0x7a'))[_0xae13('0x7b')](_0xae13('0x7c'),'tq')[_0xae13('0x7d')](_0xae13('0x7e'),'ut',_0xae13('0x7f'))[_0xae13('0x3f')](_0xae13('0x80'),_0x360b1a[_0xae13('0x58')]['id']);for(var _0x4a96ac=0x0;_0x4a96ac<_0x254e9b[_0xae13('0x3a')];_0x4a96ac+=0x1){let _0x419e7a=_0x254e9b[_0x4a96ac];for(var _0xeb37e4=0x0;_0xeb37e4<_0x419e7a[_0xae13('0x6b')][_0xae13('0x3a')];_0xeb37e4+=0x1){let _0x28589b=_0x419e7a['Agents'][_0xeb37e4];var _0x5f1743=_0x4a5551[_0xae13('0x81')]();_0x5f1743['where'](_0xae13('0x82'),_0x28589b['id']);_0x2ced73[_0xae13('0x83')](db[_0xae13('0x6f')][_0xae13('0x36')](_0x5f1743['toString'](),{'type':db['sequelize'][_0xae13('0x84')][_0xae13('0x85')]})[_0xae13('0x2a')](function(_0x4e5555){if(_0x4e5555['length']===0x1){return _0x28589b['id'];}else{var _0x17d368=_[_0xae13('0x86')](_[_0xae13('0x2f')](_0x4e5555,_0xae13('0x87')),function(_0x34276a){return _[_0xae13('0x88')](_0xdc464,_0x34276a);});if(_0x17d368){return _0x28589b['id'];}}}));}}return BPromise['all'](_0x2ced73)[_0xae13('0x2a')](function(_0x296009){_0x46090b=_(_0x46090b)[_0xae13('0x89')](_0x296009)['compact']()['value']();return db[_0xae13('0x30')][_0xae13('0x57')]({'where':{'id':_0x360b1a[_0xae13('0x58')]['id']}})[_0xae13('0x2a')](function(_0x234305){return db[_0xae13('0x6f')][_0xae13('0x70')](function(_0x588b4c){return _0x234305[_0xae13('0x77')](_0x360b1a[_0xae13('0x36')][_0xae13('0x6a')],{'transaction':_0x588b4c})[_0xae13('0x2a')](function(){if(!_['isEmpty'](_0x46090b)){return _0x234305[_0xae13('0x8a')](_0x46090b,{'transaction':_0x588b4c});}})[_0xae13('0x2a')](function(){_0x46090b[_0xae13('0x74')](function(_0x3b9d34){socket[_0xae13('0x75')](_0xae13('0x8b'),{'UserId':_0x3b9d34,'MailQueueId':_0x234305['id']});});});});});});})[_0xae13('0x2a')](respondWithStatusCode(_0x544f6d,null))[_0xae13('0x48')](handleError(_0x544f6d,null));};exports['addAgents']=function(_0xbf1893,_0x25c201,_0x2136cf){return db[_0xae13('0x30')][_0xae13('0x57')]({'where':{'id':_0xbf1893['params']['id']}})['then'](handleEntityNotFound(_0x25c201,null))[_0xae13('0x2a')](function(_0x1954fb){if(_0x1954fb){return _0x1954fb[_0xae13('0x8c')](_0xbf1893[_0xae13('0x4c')][_0xae13('0x6a')],_[_0xae13('0x8d')](_0xbf1893[_0xae13('0x4c')],[_0xae13('0x6a'),'id'])||{})['spread'](function(_0x57b5c3){for(var _0x551e88=0x0;_0x551e88<_0xbf1893['body']['ids'][_0xae13('0x3a')];_0x551e88+=0x1){socket[_0xae13('0x75')]('userMailQueue:save',{'UserId':Number(_0xbf1893[_0xae13('0x4c')][_0xae13('0x6a')][_0x551e88]),'MailQueueId':Number(_0xbf1893['params']['id'])});}return _0x57b5c3;});}})['then'](respondWithResult(_0x25c201,null))[_0xae13('0x48')](handleError(_0x25c201,null));};exports['removeAgents']=function(_0x25ac7d,_0x4a3d71,_0x365f4b){return db[_0xae13('0x30')][_0xae13('0x57')]({'where':{'id':_0x25ac7d[_0xae13('0x58')]['id']}})['then'](handleEntityNotFound(_0x4a3d71,null))['then'](function(_0x27cc8c){if(_0x27cc8c){return _0x27cc8c['removeAgents'](_0x25ac7d[_0xae13('0x36')][_0xae13('0x6a')])['then'](function(){if(_[_0xae13('0x8e')](_0x25ac7d[_0xae13('0x36')][_0xae13('0x6a')])){for(var _0x1ba8a0=0x0;_0x1ba8a0<_0x25ac7d['query'][_0xae13('0x6a')]['length'];_0x1ba8a0+=0x1){socket[_0xae13('0x75')](_0xae13('0x8b'),{'UserId':Number(_0x25ac7d[_0xae13('0x36')][_0xae13('0x6a')][_0x1ba8a0]),'MailQueueId':Number(_0x25ac7d['params']['id'])});}}else{socket['emit'](_0xae13('0x8b'),{'UserId':Number(_0x25ac7d[_0xae13('0x36')]['ids']),'MailQueueId':Number(_0x25ac7d[_0xae13('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x4a3d71,null))[_0xae13('0x48')](handleError(_0x4a3d71,null));};exports['getAgents']=function(_0x148b79,_0x1c4b23,_0x5c576d){var _0x2c5289={};var _0x5d60cb={};var _0x5681e6;var _0x290c15;return db[_0xae13('0x30')][_0xae13('0x5b')]({'where':{'id':_0x148b79[_0xae13('0x58')]['id']}})[_0xae13('0x2a')](handleEntityNotFound(_0x1c4b23,null))[_0xae13('0x2a')](function(_0x1a41b2){if(_0x1a41b2){_0x5681e6=_0x1a41b2;_0x5d60cb['model']=_[_0xae13('0x37')](db[_0xae13('0x60')][_0xae13('0x31')]);_0x5d60cb[_0xae13('0x36')]=_[_0xae13('0x37')](_0x148b79[_0xae13('0x36')]);_0x5d60cb[_0xae13('0x41')]=_[_0xae13('0x4a')](_0x5d60cb[_0xae13('0x35')],_0x5d60cb[_0xae13('0x36')]);_0x2c5289[_0xae13('0x39')]=_['intersection'](_0x5d60cb['model'],qs['fields'](_0x148b79[_0xae13('0x36')][_0xae13('0x38')]));_0x2c5289[_0xae13('0x39')]=_0x2c5289[_0xae13('0x39')][_0xae13('0x3a')]?_0x2c5289[_0xae13('0x39')]:_0x5d60cb['model'];_0x2c5289[_0xae13('0x3d')]=qs[_0xae13('0x3e')](_0x148b79['query']['sort']);_0x2c5289[_0xae13('0x3f')]=qs['filters'](_[_0xae13('0x40')](_0x148b79[_0xae13('0x36')],_0x5d60cb[_0xae13('0x41')]));if(_0x148b79[_0xae13('0x36')]['filter']){_0x2c5289[_0xae13('0x3f')]=_['merge'](_0x2c5289['where'],{'$or':_['map'](_0x2c5289[_0xae13('0x39')],function(_0x23c278){var _0x12c231={};_0x12c231[_0x23c278]={'$like':'%'+_0x148b79[_0xae13('0x36')][_0xae13('0x5e')]+'%'};return _0x12c231;})});}_0x2c5289=_[_0xae13('0x42')]({},_0x2c5289,_0x148b79[_0xae13('0x44')]);return _0x5681e6[_0xae13('0x8f')](_0x2c5289);}})[_0xae13('0x2a')](function(_0x599adf){if(_0x599adf){_0x290c15=_0x599adf[_0xae13('0x3a')];if(!_0x148b79[_0xae13('0x36')][_0xae13('0x3b')](_0xae13('0x3c'))){_0x2c5289[_0xae13('0x24')]=qs[_0xae13('0x24')](_0x148b79[_0xae13('0x36')][_0xae13('0x24')]);_0x2c5289[_0xae13('0x22')]=qs[_0xae13('0x22')](_0x148b79[_0xae13('0x36')]['offset']);}return _0x5681e6[_0xae13('0x8f')](_0x2c5289);}})[_0xae13('0x2a')](function(_0x2a00bd){if(_0x2a00bd){return _0x2a00bd?{'count':_0x290c15,'rows':_0x2a00bd}:null;}})[_0xae13('0x2a')](respondWithResult(_0x1c4b23,null))[_0xae13('0x48')](handleError(_0x1c4b23,null));}; \ No newline at end of file +var _0xd6ce=['TeamId','includes','all','union','compact','ids','isEmpty','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','MailQueue','find','create','body','user','role','userProfileId','destroy','describe','getMembers','findOne','UserMailQueue','User','UserId','mailPause','updatedAt','%s/%s','SIP','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every'];(function(_0x49dee5,_0x8234b7){var _0x299c43=function(_0x4cb640){while(--_0x4cb640){_0x49dee5['push'](_0x49dee5['shift']());}};_0x299c43(++_0x8234b7);}(_0xd6ce,0x127));var _0xed6c=function(_0x332e49,_0x5e0386){_0x332e49=_0x332e49-0x0;var _0x3909be=_0xd6ce[_0x332e49];return _0x3909be;};'use strict';var emlformat=require(_0xed6c('0x0'));var rimraf=require(_0xed6c('0x1'));var zipdir=require(_0xed6c('0x2'));var jsonpatch=require(_0xed6c('0x3'));var rp=require(_0xed6c('0x4'));var moment=require(_0xed6c('0x5'));var BPromise=require(_0xed6c('0x6'));var Mustache=require(_0xed6c('0x7'));var util=require('util');var path=require('path');var sox=require(_0xed6c('0x8'));var csv=require(_0xed6c('0x9'));var ejs=require(_0xed6c('0xa'));var fs=require('fs');var fs_extra=require(_0xed6c('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xed6c('0xc'));var jsforce=require(_0xed6c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed6c('0xe'));var Papa=require(_0xed6c('0xf'));var Redis=require(_0xed6c('0x10'));var authService=require(_0xed6c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed6c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed6c('0x13'));var db=require(_0xed6c('0x14'))['db'];config['redis']=_[_0xed6c('0x15')](config['redis'],{'host':_0xed6c('0x16'),'port':0x18eb});var socket=require(_0xed6c('0x17'))(new Redis(config['redis']));require(_0xed6c('0x18'))[_0xed6c('0x19')](socket);function respondWithStatusCode(_0x46d807,_0x342c82){_0x342c82=_0x342c82||0xcc;return function(_0x4b0ad3){if(_0x4b0ad3){return _0x46d807['sendStatus'](_0x342c82);}return _0x46d807[_0xed6c('0x1a')](_0x342c82)[_0xed6c('0x1b')]();};}function respondWithResult(_0x156e84,_0x4fbdb5){_0x4fbdb5=_0x4fbdb5||0xc8;return function(_0x13c503){if(_0x13c503){return _0x156e84['status'](_0x4fbdb5)[_0xed6c('0x1c')](_0x13c503);}};}function respondWithFilteredResult(_0x326350,_0x32dac0){return function(_0x1fe8c0){if(_0x1fe8c0){var _0x4a920e=typeof _0x32dac0[_0xed6c('0x1d')]===_0xed6c('0x1e')&&typeof _0x32dac0[_0xed6c('0x1f')]==='undefined';var _0x3f32a3=_0x1fe8c0[_0xed6c('0x20')];var _0x1810c4=_0x4a920e?0x0:_0x32dac0[_0xed6c('0x1d')];var _0x314aeb=_0x4a920e?_0x1fe8c0['count']:_0x32dac0[_0xed6c('0x1d')]+_0x32dac0['limit'];var _0x4a3fae;if(_0x314aeb>=_0x3f32a3){_0x314aeb=_0x3f32a3;_0x4a3fae=0xc8;}else{_0x4a3fae=0xce;}_0x326350[_0xed6c('0x1a')](_0x4a3fae);return _0x326350[_0xed6c('0x21')](_0xed6c('0x22'),_0x1810c4+'-'+_0x314aeb+'/'+_0x3f32a3)['json'](_0x1fe8c0);}return null;};}function patchUpdates(_0x2fd94b){return function(_0x4e1870){try{jsonpatch[_0xed6c('0x23')](_0x4e1870,_0x2fd94b,!![]);}catch(_0x5ea6f4){return BPromise[_0xed6c('0x24')](_0x5ea6f4);}return _0x4e1870[_0xed6c('0x25')]();};}function saveUpdates(_0x51876b,_0x28ccfd){return function(_0x391970){if(_0x391970){return _0x391970[_0xed6c('0x26')](_0x51876b)[_0xed6c('0x27')](function(_0x27fb6c){return _0x27fb6c;});}return null;};}function removeEntity(_0x328af2,_0x2bb6fc){return function(_0xd7f45d){if(_0xd7f45d){return _0xd7f45d['destroy']()[_0xed6c('0x27')](function(){var _0x27484c=_0xd7f45d[_0xed6c('0x28')]({'plain':!![]});var _0x21d91e=_0xed6c('0x29');return db[_0xed6c('0x2a')]['destroy']({'where':{'type':_0x21d91e,'resourceId':_0x27484c['id']}})[_0xed6c('0x27')](function(){return _0xd7f45d;});})[_0xed6c('0x27')](function(){_0x328af2[_0xed6c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e4373,_0x531cd0){return function(_0x5172b2){if(!_0x5172b2){_0x4e4373[_0xed6c('0x2b')](0x194);}return _0x5172b2;};}function handleError(_0x57e099,_0x3199bd){_0x3199bd=_0x3199bd||0x1f4;return function(_0x4d4feb){logger[_0xed6c('0x2c')](_0x4d4feb[_0xed6c('0x2d')]);if(_0x4d4feb['name']){delete _0x4d4feb[_0xed6c('0x2e')];}_0x57e099[_0xed6c('0x1a')](_0x3199bd)[_0xed6c('0x2f')](_0x4d4feb);};}exports[_0xed6c('0x30')]=function(_0x1174ef,_0x10e1e2){var _0x50ae2a={},_0x1b90d8={},_0x265574={'count':0x0,'rows':[]};var _0x5a4230=_[_0xed6c('0x31')](db['MailQueue'][_0xed6c('0x32')],function(_0x2571f4){return{'name':_0x2571f4[_0xed6c('0x33')],'type':_0x2571f4[_0xed6c('0x34')][_0xed6c('0x35')]};});_0x1b90d8[_0xed6c('0x36')]=_['map'](_0x5a4230,'name');_0x1b90d8['query']=_[_0xed6c('0x37')](_0x1174ef[_0xed6c('0x38')]);_0x1b90d8[_0xed6c('0x39')]=_['intersection'](_0x1b90d8[_0xed6c('0x36')],_0x1b90d8[_0xed6c('0x38')]);_0x50ae2a[_0xed6c('0x3a')]=_[_0xed6c('0x3b')](_0x1b90d8[_0xed6c('0x36')],qs[_0xed6c('0x3c')](_0x1174ef[_0xed6c('0x38')][_0xed6c('0x3c')]));_0x50ae2a[_0xed6c('0x3a')]=_0x50ae2a[_0xed6c('0x3a')][_0xed6c('0x3d')]?_0x50ae2a[_0xed6c('0x3a')]:_0x1b90d8['model'];if(!_0x1174ef[_0xed6c('0x38')][_0xed6c('0x3e')](_0xed6c('0x3f'))){_0x50ae2a[_0xed6c('0x1f')]=qs['limit'](_0x1174ef[_0xed6c('0x38')][_0xed6c('0x1f')]);_0x50ae2a[_0xed6c('0x1d')]=qs['offset'](_0x1174ef[_0xed6c('0x38')]['offset']);}_0x50ae2a[_0xed6c('0x40')]=qs[_0xed6c('0x41')](_0x1174ef[_0xed6c('0x38')]['sort']);_0x50ae2a[_0xed6c('0x42')]=qs[_0xed6c('0x39')](_[_0xed6c('0x43')](_0x1174ef[_0xed6c('0x38')],_0x1b90d8[_0xed6c('0x39')]),_0x5a4230);if(_0x1174ef[_0xed6c('0x38')][_0xed6c('0x44')]){_0x50ae2a[_0xed6c('0x42')]=_[_0xed6c('0x45')](_0x50ae2a[_0xed6c('0x42')],{'$or':_[_0xed6c('0x31')](_0x5a4230,function(_0x1d375f){if(_0x1d375f[_0xed6c('0x34')]!==_0xed6c('0x46')){var _0x2bb8eb={};_0x2bb8eb[_0x1d375f[_0xed6c('0x2e')]]={'$like':'%'+_0x1174ef['query'][_0xed6c('0x44')]+'%'};return _0x2bb8eb;}})});}_0x50ae2a=_[_0xed6c('0x45')]({},_0x50ae2a,_0x1174ef['options']);var _0x141ea3={'where':_0x50ae2a[_0xed6c('0x42')]};return db['MailQueue']['count'](_0x141ea3)[_0xed6c('0x27')](function(_0x177544){_0x265574['count']=_0x177544;if(_0x1174ef[_0xed6c('0x38')][_0xed6c('0x47')]){_0x50ae2a['include']=[{'all':!![]}];}return db['MailQueue'][_0xed6c('0x48')](_0x50ae2a);})[_0xed6c('0x27')](function(_0x3a9d5d){_0x265574[_0xed6c('0x49')]=_0x3a9d5d;return _0x265574;})['then'](respondWithFilteredResult(_0x10e1e2,_0x50ae2a))[_0xed6c('0x4a')](handleError(_0x10e1e2,null));};exports[_0xed6c('0x4b')]=function(_0x490967,_0x24ad9a){var _0xf61fd={'raw':!![],'where':{'id':_0x490967[_0xed6c('0x4c')]['id']}},_0x23bb34={};_0x23bb34[_0xed6c('0x36')]=_[_0xed6c('0x37')](db['MailQueue'][_0xed6c('0x32')]);_0x23bb34['query']=_[_0xed6c('0x37')](_0x490967[_0xed6c('0x38')]);_0x23bb34[_0xed6c('0x39')]=_[_0xed6c('0x3b')](_0x23bb34['model'],_0x23bb34[_0xed6c('0x38')]);_0xf61fd['attributes']=_[_0xed6c('0x3b')](_0x23bb34[_0xed6c('0x36')],qs[_0xed6c('0x3c')](_0x490967[_0xed6c('0x38')]['fields']));_0xf61fd[_0xed6c('0x3a')]=_0xf61fd[_0xed6c('0x3a')][_0xed6c('0x3d')]?_0xf61fd[_0xed6c('0x3a')]:_0x23bb34[_0xed6c('0x36')];if(_0x490967[_0xed6c('0x38')][_0xed6c('0x47')]){_0xf61fd[_0xed6c('0x4d')]=[{'all':!![]}];}_0xf61fd=_[_0xed6c('0x45')]({},_0xf61fd,_0x490967[_0xed6c('0x4e')]);return db[_0xed6c('0x4f')][_0xed6c('0x50')](_0xf61fd)[_0xed6c('0x27')](handleEntityNotFound(_0x24ad9a,null))[_0xed6c('0x27')](respondWithResult(_0x24ad9a,null))[_0xed6c('0x4a')](handleError(_0x24ad9a,null));};exports[_0xed6c('0x51')]=function(_0x466a20,_0x4cbc97){return db[_0xed6c('0x4f')][_0xed6c('0x51')](_0x466a20[_0xed6c('0x52')],{})[_0xed6c('0x27')](function(_0x2301fd){var _0x200a7a=_0x466a20[_0xed6c('0x53')][_0xed6c('0x28')]({'plain':!![]});if(!_0x200a7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x200a7a[_0xed6c('0x54')]===_0xed6c('0x53')){var _0x42d2ec=_0x2301fd[_0xed6c('0x28')]({'plain':!![]});var _0x2438aa=_0xed6c('0x29');return db['UserProfileSection'][_0xed6c('0x50')]({'where':{'name':_0x2438aa,'userProfileId':_0x200a7a[_0xed6c('0x55')]},'raw':!![]})[_0xed6c('0x27')](function(_0x3808b1){if(_0x3808b1&&_0x3808b1['autoAssociation']===0x0){return db[_0xed6c('0x2a')][_0xed6c('0x51')]({'name':_0x42d2ec[_0xed6c('0x2e')],'resourceId':_0x42d2ec['id'],'type':_0x3808b1[_0xed6c('0x2e')],'sectionId':_0x3808b1['id']},{})[_0xed6c('0x27')](function(){return _0x2301fd;});}else{return _0x2301fd;}})['catch'](function(_0x29243e){logger[_0xed6c('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29243e);throw _0x29243e;});}return _0x2301fd;})[_0xed6c('0x27')](respondWithResult(_0x4cbc97,0xc9))[_0xed6c('0x4a')](handleError(_0x4cbc97,null));};exports['update']=function(_0x26513b,_0x2bdfea){if(_0x26513b[_0xed6c('0x52')]['id']){delete _0x26513b[_0xed6c('0x52')]['id'];}return db['MailQueue'][_0xed6c('0x50')]({'where':{'id':_0x26513b['params']['id']}})[_0xed6c('0x27')](handleEntityNotFound(_0x2bdfea,null))[_0xed6c('0x27')](saveUpdates(_0x26513b[_0xed6c('0x52')],null))[_0xed6c('0x27')](respondWithResult(_0x2bdfea,null))[_0xed6c('0x4a')](handleError(_0x2bdfea,null));};exports[_0xed6c('0x56')]=function(_0x1a2f4c,_0x27146f){return db['MailQueue'][_0xed6c('0x50')]({'where':{'id':_0x1a2f4c[_0xed6c('0x4c')]['id']}})[_0xed6c('0x27')](handleEntityNotFound(_0x27146f,null))[_0xed6c('0x27')](removeEntity(_0x27146f,null))[_0xed6c('0x4a')](handleError(_0x27146f,null));};exports[_0xed6c('0x57')]=function(_0xafbbc5,_0x2ef035){return db[_0xed6c('0x4f')][_0xed6c('0x57')]()[_0xed6c('0x27')](respondWithResult(_0x2ef035,null))['catch'](handleError(_0x2ef035,null));};exports[_0xed6c('0x58')]=function(_0x174083,_0x3392d,_0x5d3a0f){var _0x2bec11={'raw':!![],'where':{}},_0x5efd38={},_0x4fe11d;return db[_0xed6c('0x4f')][_0xed6c('0x59')]({'where':{'id':_0x174083['params']['id']}})[_0xed6c('0x27')](handleEntityNotFound(_0x3392d,null))[_0xed6c('0x27')](function(_0x37d82f){if(_0x37d82f){_0x4fe11d=_0x37d82f[_0xed6c('0x28')]({'plain':!![]});_0x5efd38['model']=_[_0xed6c('0x37')](db['UserMailQueue'][_0xed6c('0x32')]);_0x5efd38['query']=_[_0xed6c('0x37')](_0x174083[_0xed6c('0x38')]);_0x5efd38[_0xed6c('0x39')]=_['intersection'](_0x5efd38['model'],_0x5efd38[_0xed6c('0x38')]);_0x2bec11[_0xed6c('0x3a')]=_['intersection'](_0x5efd38[_0xed6c('0x36')],qs[_0xed6c('0x3c')](_0x174083[_0xed6c('0x38')][_0xed6c('0x3c')]));_0x2bec11[_0xed6c('0x3a')]=_0x2bec11['attributes']['length']?_0x2bec11[_0xed6c('0x3a')]:_0x5efd38[_0xed6c('0x36')];if(!_0x174083[_0xed6c('0x38')][_0xed6c('0x3e')](_0xed6c('0x3f'))){_0x2bec11[_0xed6c('0x1f')]=qs['limit'](_0x174083['query'][_0xed6c('0x1f')]);_0x2bec11[_0xed6c('0x1d')]=qs[_0xed6c('0x1d')](_0x174083[_0xed6c('0x38')][_0xed6c('0x1d')]);}_0x2bec11[_0xed6c('0x40')]=qs[_0xed6c('0x41')](_0x174083['query'][_0xed6c('0x41')]);_0x2bec11['where']=qs[_0xed6c('0x39')](_[_0xed6c('0x43')](_0x174083[_0xed6c('0x38')],_0x5efd38['filters']));_0x2bec11[_0xed6c('0x42')]['MailQueueId']=_0x37d82f['id'];if(_0x174083[_0xed6c('0x38')]['filter']){_0x2bec11[_0xed6c('0x42')]=_['merge'](_0x2bec11[_0xed6c('0x42')],{'$or':_['map'](_0x2bec11[_0xed6c('0x3a')],function(_0x39385c){var _0x401d1a={};_0x401d1a[_0x39385c]={'$like':'%'+_0x174083['query'][_0xed6c('0x44')]+'%'};return _0x401d1a;})});}_0x2bec11=_['merge']({},_0x2bec11,_0x174083[_0xed6c('0x4e')]);return db[_0xed6c('0x5a')][_0xed6c('0x48')](_0x2bec11);}})[_0xed6c('0x27')](function(_0x1dc9ed){if(_0x1dc9ed){return db[_0xed6c('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x1dc9ed,_0xed6c('0x5c')),'role':'agent'},'attributes':['id',_0xed6c('0x2e'),_0xed6c('0x5d'),_0xed6c('0x5e'),'createdAt']});}})[_0xed6c('0x27')](function(_0x5f552b){if(_0x5f552b){return{'count':_0x5f552b[_0xed6c('0x20')],'rows':_['map'](_0x5f552b[_0xed6c('0x49')],function(_0x3c095f){return{'membername':_0x3c095f[_0xed6c('0x2e')],'UserId':_0x3c095f['id'],'queue_name':_0x4fe11d[_0xed6c('0x2e')],'MailQueueId':_0x4fe11d['id'],'interface':util['format'](_0xed6c('0x5f'),_0xed6c('0x60'),_0x3c095f[_0xed6c('0x2e')]),'penalty':0x0,'paused':_0x3c095f[_0xed6c('0x5d')],'createdAt':_0x3c095f['createdAt'],'updatedAt':_0x3c095f[_0xed6c('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed6c('0x27')](respondWithFilteredResult(_0x3392d,_0x2bec11))['catch'](handleError(_0x3392d,null));};exports['getTeams']=function(_0x3f987d,_0x37b9fd,_0x50488b){var _0x502528={};var _0x45a48f={};var _0x16e1a0;var _0x3c063e;return db[_0xed6c('0x4f')][_0xed6c('0x59')]({'where':{'id':_0x3f987d[_0xed6c('0x4c')]['id']}})[_0xed6c('0x27')](handleEntityNotFound(_0x37b9fd,null))[_0xed6c('0x27')](function(_0x10d5ac){if(_0x10d5ac){_0x16e1a0=_0x10d5ac;_0x45a48f[_0xed6c('0x36')]=_[_0xed6c('0x37')](db[_0xed6c('0x61')][_0xed6c('0x32')]);_0x45a48f[_0xed6c('0x38')]=_[_0xed6c('0x37')](_0x3f987d[_0xed6c('0x38')]);_0x45a48f['filters']=_[_0xed6c('0x3b')](_0x45a48f[_0xed6c('0x36')],_0x45a48f[_0xed6c('0x38')]);_0x502528[_0xed6c('0x3a')]=_[_0xed6c('0x3b')](_0x45a48f['model'],qs['fields'](_0x3f987d[_0xed6c('0x38')]['fields']));_0x502528['attributes']=_0x502528[_0xed6c('0x3a')][_0xed6c('0x3d')]?_0x502528[_0xed6c('0x3a')]:_0x45a48f['model'];_0x502528['order']=qs[_0xed6c('0x41')](_0x3f987d[_0xed6c('0x38')][_0xed6c('0x41')]);_0x502528[_0xed6c('0x42')]=qs[_0xed6c('0x39')](_[_0xed6c('0x43')](_0x3f987d['query'],_0x45a48f[_0xed6c('0x39')]));if(_0x3f987d[_0xed6c('0x38')]['filter']){_0x502528[_0xed6c('0x42')]=_[_0xed6c('0x45')](_0x502528['where'],{'$or':_[_0xed6c('0x31')](_0x502528[_0xed6c('0x3a')],function(_0xf05f66){var _0x4c28a8={};_0x4c28a8[_0xf05f66]={'$like':'%'+_0x3f987d[_0xed6c('0x38')][_0xed6c('0x44')]+'%'};return _0x4c28a8;})});}_0x502528=_['merge']({},_0x502528,_0x3f987d['options']);return _0x16e1a0['getTeams'](_0x502528);}})[_0xed6c('0x27')](function(_0x16f49e){if(_0x16f49e){_0x3c063e=_0x16f49e['length'];if(!_0x3f987d[_0xed6c('0x38')][_0xed6c('0x3e')]('nolimit')){_0x502528[_0xed6c('0x1f')]=qs[_0xed6c('0x1f')](_0x3f987d[_0xed6c('0x38')][_0xed6c('0x1f')]);_0x502528['offset']=qs['offset'](_0x3f987d[_0xed6c('0x38')][_0xed6c('0x1d')]);}return _0x16e1a0[_0xed6c('0x62')](_0x502528);}})[_0xed6c('0x27')](function(_0x4e62f6){if(_0x4e62f6){return _0x4e62f6?{'count':_0x3c063e,'rows':_0x4e62f6}:null;}})[_0xed6c('0x27')](respondWithResult(_0x37b9fd,null))[_0xed6c('0x4a')](handleError(_0x37b9fd,null));};exports[_0xed6c('0x63')]=function(_0x5a5dd4,_0x127f21,_0x55f111){var _0x5017be=_0x5a5dd4[_0xed6c('0x52')]['ids'];return db[_0xed6c('0x61')]['findAll']({'where':{'id':_0x5017be},'attributes':['id'],'include':[{'model':db['User'],'as':_0xed6c('0x64'),'attributes':['id','name',_0xed6c('0x65'),_0xed6c('0x66'),_0xed6c('0x67')],'raw':!![]}]})[_0xed6c('0x27')](function(_0x27cc0b){if(_0x27cc0b){var _0x2f9616=_[_0xed6c('0x68')](_0x27cc0b,function(_0x5280ae){var _0x52b56c=_0x5280ae[_0xed6c('0x28')]({'plain':!![]});return _0x52b56c['Agents'];});return db[_0xed6c('0x4f')][_0xed6c('0x50')]({'where':{'id':_0x5a5dd4[_0xed6c('0x4c')]['id']}})['then'](function(_0x1dd99e){return db[_0xed6c('0x69')][_0xed6c('0x6a')](function(_0x3a6fd4){return _0x1dd99e[_0xed6c('0x63')](_0x5017be,{'transaction':_0x3a6fd4})[_0xed6c('0x27')](function(){return BPromise[_0xed6c('0x6b')](_0x2f9616,function(_0x51cc20){return db['UserMailQueue'][_0xed6c('0x6c')]({'where':{'UserId':_0x51cc20['id'],'MailQueueId':_0x5a5dd4['params']['id']},'transaction':_0x3a6fd4});});})['then'](function(){_0x2f9616[_0xed6c('0x6d')](function(_0x4d8e53){socket[_0xed6c('0x6e')]('userMailQueue:save',{'UserId':_0x4d8e53['id'],'MailQueueId':_0x1dd99e['id']});});});});});}})[_0xed6c('0x27')](respondWithStatusCode(_0x127f21,null))['catch'](handleError(_0x127f21,null));};exports[_0xed6c('0x6f')]=function(_0x5a2134,_0x1e973f,_0x48bd0f){return db[_0xed6c('0x61')][_0xed6c('0x48')]({'where':{'id':_0x5a2134[_0xed6c('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xed6c('0x5b')],'as':_0xed6c('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1e973f,null))[_0xed6c('0x27')](function(_0x39a93a){var _0x1d999b=_[_0xed6c('0x31')](_0x39a93a,'id');var _0x3f0872=[];var _0x12d29c=[];var _0x341219=squel[_0xed6c('0x70')]();_0x341219['field']('tq.TeamId')[_0xed6c('0x71')](_0xed6c('0x72'),'tq')[_0xed6c('0x73')](_0xed6c('0x74'),'ut',_0xed6c('0x75'))[_0xed6c('0x42')](_0xed6c('0x76'),_0x5a2134['params']['id']);for(var _0x5b39d3=0x0;_0x5b39d3<_0x39a93a[_0xed6c('0x3d')];_0x5b39d3+=0x1){let _0x1c26b3=_0x39a93a[_0x5b39d3];for(var _0x5c242a=0x0;_0x5c242a<_0x1c26b3['Agents'][_0xed6c('0x3d')];_0x5c242a+=0x1){let _0x228fa5=_0x1c26b3[_0xed6c('0x64')][_0x5c242a];var _0x85c2c9=_0x341219[_0xed6c('0x77')]();_0x85c2c9[_0xed6c('0x42')](_0xed6c('0x78'),_0x228fa5['id']);_0x12d29c[_0xed6c('0x79')](db[_0xed6c('0x69')][_0xed6c('0x38')](_0x85c2c9[_0xed6c('0x7a')](),{'type':db[_0xed6c('0x69')][_0xed6c('0x7b')]['SELECT']})[_0xed6c('0x27')](function(_0x17b182){if(_0x17b182[_0xed6c('0x3d')]===0x1){return _0x228fa5['id'];}else{var _0x1d2375=_[_0xed6c('0x7c')](_[_0xed6c('0x31')](_0x17b182,_0xed6c('0x7d')),function(_0x40000b){return _[_0xed6c('0x7e')](_0x1d999b,_0x40000b);});if(_0x1d2375){return _0x228fa5['id'];}}}));}}return BPromise[_0xed6c('0x7f')](_0x12d29c)[_0xed6c('0x27')](function(_0x347ccf){_0x3f0872=_(_0x3f0872)[_0xed6c('0x80')](_0x347ccf)[_0xed6c('0x81')]()['value']();return db[_0xed6c('0x4f')][_0xed6c('0x50')]({'where':{'id':_0x5a2134[_0xed6c('0x4c')]['id']}})['then'](function(_0x4e3d0e){return db[_0xed6c('0x69')][_0xed6c('0x6a')](function(_0x44f4a0){return _0x4e3d0e[_0xed6c('0x6f')](_0x5a2134[_0xed6c('0x38')][_0xed6c('0x82')],{'transaction':_0x44f4a0})[_0xed6c('0x27')](function(){if(!_[_0xed6c('0x83')](_0x3f0872)){return _0x4e3d0e['removeAgents'](_0x3f0872,{'transaction':_0x44f4a0});}})[_0xed6c('0x27')](function(){_0x3f0872['forEach'](function(_0x2590cb){socket[_0xed6c('0x6e')](_0xed6c('0x84'),{'UserId':_0x2590cb,'MailQueueId':_0x4e3d0e['id']});});});});});});})[_0xed6c('0x27')](respondWithStatusCode(_0x1e973f,null))[_0xed6c('0x4a')](handleError(_0x1e973f,null));};exports[_0xed6c('0x85')]=function(_0x15263e,_0x47dff8,_0x610fe1){return db[_0xed6c('0x4f')][_0xed6c('0x50')]({'where':{'id':_0x15263e[_0xed6c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x47dff8,null))[_0xed6c('0x27')](function(_0x1d0a28){if(_0x1d0a28){return _0x1d0a28[_0xed6c('0x85')](_0x15263e['body'][_0xed6c('0x82')],_[_0xed6c('0x86')](_0x15263e[_0xed6c('0x52')],[_0xed6c('0x82'),'id'])||{})[_0xed6c('0x87')](function(_0xd1a6e5){for(var _0x9d8bf6=0x0;_0x9d8bf6<_0x15263e[_0xed6c('0x52')][_0xed6c('0x82')]['length'];_0x9d8bf6+=0x1){socket[_0xed6c('0x6e')](_0xed6c('0x88'),{'UserId':Number(_0x15263e['body'][_0xed6c('0x82')][_0x9d8bf6]),'MailQueueId':Number(_0x15263e['params']['id'])});}return _0xd1a6e5;});}})[_0xed6c('0x27')](respondWithResult(_0x47dff8,null))[_0xed6c('0x4a')](handleError(_0x47dff8,null));};exports[_0xed6c('0x89')]=function(_0x2aed02,_0x26f30b,_0x1cfb4a){return db['MailQueue']['find']({'where':{'id':_0x2aed02['params']['id']}})[_0xed6c('0x27')](handleEntityNotFound(_0x26f30b,null))['then'](function(_0x5ea5a1){if(_0x5ea5a1){return _0x5ea5a1[_0xed6c('0x89')](_0x2aed02['query']['ids'])['then'](function(){if(_[_0xed6c('0x8a')](_0x2aed02[_0xed6c('0x38')][_0xed6c('0x82')])){for(var _0x28ead1=0x0;_0x28ead1<_0x2aed02[_0xed6c('0x38')]['ids'][_0xed6c('0x3d')];_0x28ead1+=0x1){socket['emit'](_0xed6c('0x84'),{'UserId':Number(_0x2aed02[_0xed6c('0x38')][_0xed6c('0x82')][_0x28ead1]),'MailQueueId':Number(_0x2aed02[_0xed6c('0x4c')]['id'])});}}else{socket[_0xed6c('0x6e')](_0xed6c('0x84'),{'UserId':Number(_0x2aed02[_0xed6c('0x38')]['ids']),'MailQueueId':Number(_0x2aed02[_0xed6c('0x4c')]['id'])});}});}})[_0xed6c('0x27')](respondWithStatusCode(_0x26f30b,null))[_0xed6c('0x4a')](handleError(_0x26f30b,null));};exports[_0xed6c('0x8b')]=function(_0x4ee32b,_0x2ff4cc,_0x43a4d4){var _0x358fff={};var _0x1c6bf6={};var _0x2073e8;var _0x24c1b3;return db[_0xed6c('0x4f')]['findOne']({'where':{'id':_0x4ee32b['params']['id']}})[_0xed6c('0x27')](handleEntityNotFound(_0x2ff4cc,null))[_0xed6c('0x27')](function(_0x28d0d3){if(_0x28d0d3){_0x2073e8=_0x28d0d3;_0x1c6bf6[_0xed6c('0x36')]=_[_0xed6c('0x37')](db[_0xed6c('0x5b')][_0xed6c('0x32')]);_0x1c6bf6['query']=_[_0xed6c('0x37')](_0x4ee32b['query']);_0x1c6bf6['filters']=_[_0xed6c('0x3b')](_0x1c6bf6[_0xed6c('0x36')],_0x1c6bf6[_0xed6c('0x38')]);_0x358fff['attributes']=_[_0xed6c('0x3b')](_0x1c6bf6[_0xed6c('0x36')],qs[_0xed6c('0x3c')](_0x4ee32b[_0xed6c('0x38')]['fields']));_0x358fff[_0xed6c('0x3a')]=_0x358fff['attributes'][_0xed6c('0x3d')]?_0x358fff[_0xed6c('0x3a')]:_0x1c6bf6[_0xed6c('0x36')];_0x358fff[_0xed6c('0x40')]=qs[_0xed6c('0x41')](_0x4ee32b['query'][_0xed6c('0x41')]);_0x358fff[_0xed6c('0x42')]=qs[_0xed6c('0x39')](_[_0xed6c('0x43')](_0x4ee32b[_0xed6c('0x38')],_0x1c6bf6[_0xed6c('0x39')]));if(_0x4ee32b[_0xed6c('0x38')][_0xed6c('0x44')]){_0x358fff[_0xed6c('0x42')]=_[_0xed6c('0x45')](_0x358fff['where'],{'$or':_[_0xed6c('0x31')](_0x358fff[_0xed6c('0x3a')],function(_0x3b94f7){var _0x23acff={};_0x23acff[_0x3b94f7]={'$like':'%'+_0x4ee32b[_0xed6c('0x38')][_0xed6c('0x44')]+'%'};return _0x23acff;})});}_0x358fff=_['merge']({},_0x358fff,_0x4ee32b[_0xed6c('0x4e')]);return _0x2073e8['getAgents'](_0x358fff);}})[_0xed6c('0x27')](function(_0x548a83){if(_0x548a83){_0x24c1b3=_0x548a83['length'];if(!_0x4ee32b[_0xed6c('0x38')][_0xed6c('0x3e')](_0xed6c('0x3f'))){_0x358fff[_0xed6c('0x1f')]=qs['limit'](_0x4ee32b[_0xed6c('0x38')]['limit']);_0x358fff[_0xed6c('0x1d')]=qs[_0xed6c('0x1d')](_0x4ee32b[_0xed6c('0x38')][_0xed6c('0x1d')]);}return _0x2073e8['getAgents'](_0x358fff);}})['then'](function(_0x3bb4b9){if(_0x3bb4b9){return _0x3bb4b9?{'count':_0x24c1b3,'rows':_0x3bb4b9}:null;}})[_0xed6c('0x27')](respondWithResult(_0x2ff4cc,null))[_0xed6c('0x4a')](handleError(_0x2ff4cc,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 4e12496..387f2e4 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 _0x2967=['events','MailQueue','setMaxListeners','save','update','remove','emit'];(function(_0x5c6b85,_0xb093bb){var _0x3b5486=function(_0x21c165){while(--_0x21c165){_0x5c6b85['push'](_0x5c6b85['shift']());}};_0x3b5486(++_0xb093bb);}(_0x2967,0x181));var _0x7296=function(_0x3d90b4,_0x1e2fc6){_0x3d90b4=_0x3d90b4-0x0;var _0x4c65d3=_0x2967[_0x3d90b4];return _0x4c65d3;};'use strict';var EventEmitter=require(_0x7296('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x7296('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7296('0x2')](0x0);var events={'afterCreate':_0x7296('0x3'),'afterUpdate':_0x7296('0x4'),'afterDestroy':_0x7296('0x5')};function emitEvent(_0x5e537e){return function(_0x4a9d24,_0x33dc82,_0x40f488){MailQueueEvents[_0x7296('0x6')](_0x5e537e+':'+_0x4a9d24['id'],_0x4a9d24);MailQueueEvents['emit'](_0x5e537e,_0x4a9d24);_0x40f488(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xd9e5=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x16b829,_0x1ef180){var _0x188b64=function(_0xc3573f){while(--_0xc3573f){_0x16b829['push'](_0x16b829['shift']());}};_0x188b64(++_0x1ef180);}(_0xd9e5,0x113));var _0x5d9e=function(_0x2f2902,_0x534eaa){_0x2f2902=_0x2f2902-0x0;var _0x487579=_0xd9e5[_0x2f2902];return _0x487579;};'use strict';var EventEmitter=require(_0x5d9e('0x0'));var MailQueue=require(_0x5d9e('0x1'))['db'][_0x5d9e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5d9e('0x3')](0x0);var events={'afterCreate':_0x5d9e('0x4'),'afterUpdate':_0x5d9e('0x5'),'afterDestroy':_0x5d9e('0x6')};function emitEvent(_0x5813e8){return function(_0x1cc1c2,_0x4b0f0b,_0x1a368d){MailQueueEvents[_0x5d9e('0x7')](_0x5813e8+':'+_0x1cc1c2['id'],_0x1cc1c2);MailQueueEvents[_0x5d9e('0x7')](_0x5813e8,_0x1cc1c2);_0x1a368d(null);};}for(var e in events){if(events[_0x5d9e('0x8')](e)){var event=events[e];MailQueue[_0x5d9e('0x9')](e,emitEvent(event));}}module[_0x5d9e('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index ed8c331..eabbade 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 _0x55e6=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','lodash','../../config/logger'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x55e6,0x1c6));var _0x655e=function(_0x10e861,_0x2a5b28){_0x10e861=_0x10e861-0x0;var _0x5bfd7a=_0x55e6[_0x10e861];return _0x5bfd7a;};'use strict';var _=require(_0x655e('0x0'));var util=require('util');var logger=require(_0x655e('0x1'))(_0x655e('0x2'));var moment=require(_0x655e('0x3'));var BPromise=require(_0x655e('0x4'));var rp=require(_0x655e('0x5'));var fs=require('fs');var path=require(_0x655e('0x6'));var rimraf=require(_0x655e('0x7'));var config=require(_0x655e('0x8'));var attributes=require(_0x655e('0x9'));module[_0x655e('0xa')]=function(_0x19e295,_0x543a4b){return _0x19e295[_0x655e('0xb')]('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaebf=['bluebird','request-promise','rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','util','../../config/logger','api','moment'];(function(_0x31cfdf,_0x6302de){var _0x158057=function(_0x47668b){while(--_0x47668b){_0x31cfdf['push'](_0x31cfdf['shift']());}};_0x158057(++_0x6302de);}(_0xaebf,0x110));var _0xfaeb=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0xaebf[_0x2b9b7f];return _0x4ed19a;};'use strict';var _=require('lodash');var util=require(_0xfaeb('0x0'));var logger=require(_0xfaeb('0x1'))(_0xfaeb('0x2'));var moment=require(_0xfaeb('0x3'));var BPromise=require(_0xfaeb('0x4'));var rp=require(_0xfaeb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfaeb('0x6'));var config=require('../../config/environment');var attributes=require(_0xfaeb('0x7'));module[_0xfaeb('0x8')]=function(_0x48e75d,_0x3a7911){return _0x48e75d[_0xfaeb('0x9')](_0xfaeb('0xa'),attributes,{'tableName':_0xfaeb('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 abd6895..ed4df25 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 _0x006b=['where','attributes','limit','include','map','model','ShowMailQueue','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMailQueue','MailQueue','findAll','raw','options'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x006b,0x83));var _0xb006=function(_0x1f8261,_0x33f5e0){_0x1f8261=_0x1f8261-0x0;var _0x3ed5c1=_0x006b[_0x1f8261];return _0x3ed5c1;};'use strict';var _=require(_0xb006('0x0'));var util=require(_0xb006('0x1'));var moment=require(_0xb006('0x2'));var BPromise=require('bluebird');var rs=require(_0xb006('0x3'));var fs=require('fs');var Redis=require(_0xb006('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb006('0x5'));var logger=require(_0xb006('0x6'))(_0xb006('0x7'));var config=require(_0xb006('0x8'));var jayson=require(_0xb006('0x9'));var client=jayson[_0xb006('0xa')][_0xb006('0xb')]({'port':0x232a});config[_0xb006('0xc')]=_[_0xb006('0xd')](config[_0xb006('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb006('0xe'))[_0xb006('0xf')](socket);function respondWithRpcPromise(_0x1ae3e3,_0x715894,_0x11f1b8){return new BPromise(function(_0x182103,_0x3c1de8){return client[_0xb006('0x10')](_0x1ae3e3,_0x11f1b8)[_0xb006('0x11')](function(_0x23d64f){logger['info'](_0xb006('0x12'),_0x715894,_0xb006('0x13'));logger[_0xb006('0x14')](_0xb006('0x15'),_0x715894,_0xb006('0x13'),JSON[_0xb006('0x16')](_0x23d64f));if(_0x23d64f['error']){if(_0x23d64f[_0xb006('0x17')][_0xb006('0x18')]===0x1f4){logger[_0xb006('0x17')]('MailQueue,\x20%s,\x20%s',_0x715894,_0x23d64f[_0xb006('0x17')][_0xb006('0x19')]);return _0x3c1de8(_0x23d64f[_0xb006('0x17')][_0xb006('0x19')]);}logger[_0xb006('0x17')](_0xb006('0x12'),_0x715894,_0x23d64f[_0xb006('0x17')][_0xb006('0x19')]);return _0x182103(_0x23d64f[_0xb006('0x17')][_0xb006('0x19')]);}else{logger[_0xb006('0x1a')](_0xb006('0x12'),_0x715894,'request\x20sent');_0x182103(_0x23d64f[_0xb006('0x1b')][_0xb006('0x19')]);}})['catch'](function(_0x3e9b6b){logger[_0xb006('0x17')](_0xb006('0x12'),_0x715894,_0x3e9b6b);_0x3c1de8(_0x3e9b6b);});});}exports[_0xb006('0x1c')]=function(_0x4fb2a3){var _0x3f956f=this;return new Promise(function(_0x254b41,_0x1fe14f){return db[_0xb006('0x1d')][_0xb006('0x1e')]({'raw':_0x4fb2a3['options']?_0x4fb2a3['options'][_0xb006('0x1f')]===undefined?!![]:![]:!![],'where':_0x4fb2a3[_0xb006('0x20')]?_0x4fb2a3[_0xb006('0x20')][_0xb006('0x21')]||null:null,'attributes':_0x4fb2a3[_0xb006('0x20')]?_0x4fb2a3[_0xb006('0x20')][_0xb006('0x22')]||null:null,'limit':_0x4fb2a3[_0xb006('0x20')]?_0x4fb2a3[_0xb006('0x20')][_0xb006('0x23')]||null:null,'include':_0x4fb2a3[_0xb006('0x20')]?_0x4fb2a3[_0xb006('0x20')][_0xb006('0x24')]?_[_0xb006('0x25')](_0x4fb2a3[_0xb006('0x20')][_0xb006('0x24')],function(_0xf9a6e9){return{'model':db[_0xf9a6e9[_0xb006('0x26')]],'as':_0xf9a6e9['as'],'attributes':_0xf9a6e9[_0xb006('0x22')],'include':_0xf9a6e9['include']?_[_0xb006('0x25')](_0xf9a6e9[_0xb006('0x24')],function(_0x2cbadf){return{'model':db[_0x2cbadf[_0xb006('0x26')]],'as':_0x2cbadf['as'],'attributes':_0x2cbadf['attributes'],'include':_0x2cbadf[_0xb006('0x24')]?_[_0xb006('0x25')](_0x2cbadf['include'],function(_0x128878){return{'model':db[_0x128878['model']],'as':_0x128878['as'],'attributes':_0x128878[_0xb006('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb006('0x11')](function(_0x9cc519){logger[_0xb006('0x1a')](_0xb006('0x1c'),_0x4fb2a3);logger[_0xb006('0x14')](_0xb006('0x1c'),_0x4fb2a3,JSON[_0xb006('0x16')](_0x9cc519));_0x254b41(_0x9cc519);})['catch'](function(_0xb06e8f){logger['error'](_0xb006('0x1c'),_0xb06e8f[_0xb006('0x19')],_0x4fb2a3);_0x1fe14f(_0x3f956f[_0xb006('0x17')](0x1f4,_0xb06e8f['message']));});});};exports['ShowMailQueue']=function(_0x4beea3){var _0x21cfe7=this;return new Promise(function(_0x3df1bc,_0x44c7f0){return db[_0xb006('0x1d')]['find']({'raw':_0x4beea3[_0xb006('0x20')]?_0x4beea3['options'][_0xb006('0x1f')]===undefined?!![]:![]:!![],'where':_0x4beea3[_0xb006('0x20')]?_0x4beea3[_0xb006('0x20')]['where']||null:null,'attributes':_0x4beea3[_0xb006('0x20')]?_0x4beea3[_0xb006('0x20')]['attributes']||null:null,'include':_0x4beea3[_0xb006('0x20')]?_0x4beea3[_0xb006('0x20')][_0xb006('0x24')]?_[_0xb006('0x25')](_0x4beea3[_0xb006('0x20')][_0xb006('0x24')],function(_0x23b51a){return{'model':db[_0x23b51a['model']],'as':_0x23b51a['as'],'attributes':_0x23b51a['attributes'],'include':_0x23b51a[_0xb006('0x24')]?_[_0xb006('0x25')](_0x23b51a[_0xb006('0x24')],function(_0x10a496){return{'model':db[_0x10a496[_0xb006('0x26')]],'as':_0x10a496['as'],'attributes':_0x10a496[_0xb006('0x22')],'include':_0x10a496[_0xb006('0x24')]?_[_0xb006('0x25')](_0x10a496[_0xb006('0x24')],function(_0x4ccbc5){return{'model':db[_0x4ccbc5['model']],'as':_0x4ccbc5['as'],'attributes':_0x4ccbc5[_0xb006('0x22')]};}):[]};}):[]};}):[]:[]})[_0xb006('0x11')](function(_0x236f3c){logger[_0xb006('0x1a')](_0xb006('0x27'),_0x4beea3);logger[_0xb006('0x14')](_0xb006('0x27'),_0x4beea3,JSON['stringify'](_0x236f3c));_0x3df1bc(_0x236f3c);})[_0xb006('0x28')](function(_0x2ad5ca){logger[_0xb006('0x17')](_0xb006('0x27'),_0x2ad5ca[_0xb006('0x19')],_0x4beea3);_0x44c7f0(_0x21cfe7[_0xb006('0x17')](0x1f4,_0x2ad5ca[_0xb006('0x19')]));});});}; \ No newline at end of file +var _0x7f9a=['GetMailQueue','findAll','options','raw','where','attributes','limit','include','map','model','MailQueue','find','ShowMailQueue','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailQueue.socket','register','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch'];(function(_0x27dfa,_0x18d67a){var _0x15b363=function(_0x52aefd){while(--_0x52aefd){_0x27dfa['push'](_0x27dfa['shift']());}};_0x15b363(++_0x18d67a);}(_0x7f9a,0x1d5));var _0xa7f9=function(_0x14a1ba,_0x34d604){_0x14a1ba=_0x14a1ba-0x0;var _0x341d0e=_0x7f9a[_0x14a1ba];return _0x341d0e;};'use strict';var _=require('lodash');var util=require(_0xa7f9('0x0'));var moment=require('moment');var BPromise=require(_0xa7f9('0x1'));var rs=require(_0xa7f9('0x2'));var fs=require('fs');var Redis=require(_0xa7f9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa7f9('0x4'));var logger=require(_0xa7f9('0x5'))(_0xa7f9('0x6'));var config=require(_0xa7f9('0x7'));var jayson=require(_0xa7f9('0x8'));var client=jayson[_0xa7f9('0x9')]['http']({'port':0x232a});config[_0xa7f9('0xa')]=_['defaults'](config['redis'],{'host':_0xa7f9('0xb'),'port':0x18eb});var socket=require(_0xa7f9('0xc'))(new Redis(config[_0xa7f9('0xa')]));require(_0xa7f9('0xd'))[_0xa7f9('0xe')](socket);function respondWithRpcPromise(_0x4f27ad,_0x593a2f,_0x392519){return new BPromise(function(_0x46a552,_0x532364){return client['request'](_0x4f27ad,_0x392519)[_0xa7f9('0xf')](function(_0x39dbd2){logger['info'](_0xa7f9('0x10'),_0x593a2f,_0xa7f9('0x11'));logger[_0xa7f9('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x593a2f,_0xa7f9('0x11'),JSON[_0xa7f9('0x13')](_0x39dbd2));if(_0x39dbd2[_0xa7f9('0x14')]){if(_0x39dbd2[_0xa7f9('0x14')]['code']===0x1f4){logger[_0xa7f9('0x14')]('MailQueue,\x20%s,\x20%s',_0x593a2f,_0x39dbd2['error'][_0xa7f9('0x15')]);return _0x532364(_0x39dbd2['error']['message']);}logger['error'](_0xa7f9('0x10'),_0x593a2f,_0x39dbd2[_0xa7f9('0x14')][_0xa7f9('0x15')]);return _0x46a552(_0x39dbd2[_0xa7f9('0x14')][_0xa7f9('0x15')]);}else{logger[_0xa7f9('0x16')](_0xa7f9('0x10'),_0x593a2f,_0xa7f9('0x11'));_0x46a552(_0x39dbd2[_0xa7f9('0x17')][_0xa7f9('0x15')]);}})[_0xa7f9('0x18')](function(_0x5987b0){logger['error'](_0xa7f9('0x10'),_0x593a2f,_0x5987b0);_0x532364(_0x5987b0);});});}exports[_0xa7f9('0x19')]=function(_0x46acd3){var _0x1779dc=this;return new Promise(function(_0x38e85d,_0x1190eb){return db['MailQueue'][_0xa7f9('0x1a')]({'raw':_0x46acd3[_0xa7f9('0x1b')]?_0x46acd3[_0xa7f9('0x1b')][_0xa7f9('0x1c')]===undefined?!![]:![]:!![],'where':_0x46acd3['options']?_0x46acd3[_0xa7f9('0x1b')][_0xa7f9('0x1d')]||null:null,'attributes':_0x46acd3[_0xa7f9('0x1b')]?_0x46acd3['options'][_0xa7f9('0x1e')]||null:null,'limit':_0x46acd3[_0xa7f9('0x1b')]?_0x46acd3[_0xa7f9('0x1b')][_0xa7f9('0x1f')]||null:null,'include':_0x46acd3[_0xa7f9('0x1b')]?_0x46acd3[_0xa7f9('0x1b')][_0xa7f9('0x20')]?_[_0xa7f9('0x21')](_0x46acd3[_0xa7f9('0x1b')]['include'],function(_0x29de33){return{'model':db[_0x29de33[_0xa7f9('0x22')]],'as':_0x29de33['as'],'attributes':_0x29de33[_0xa7f9('0x1e')],'include':_0x29de33[_0xa7f9('0x20')]?_[_0xa7f9('0x21')](_0x29de33[_0xa7f9('0x20')],function(_0x258d06){return{'model':db[_0x258d06[_0xa7f9('0x22')]],'as':_0x258d06['as'],'attributes':_0x258d06[_0xa7f9('0x1e')],'include':_0x258d06['include']?_[_0xa7f9('0x21')](_0x258d06[_0xa7f9('0x20')],function(_0x314abc){return{'model':db[_0x314abc['model']],'as':_0x314abc['as'],'attributes':_0x314abc[_0xa7f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa7f9('0xf')](function(_0xdf7f11){logger['info'](_0xa7f9('0x19'),_0x46acd3);logger[_0xa7f9('0x12')](_0xa7f9('0x19'),_0x46acd3,JSON[_0xa7f9('0x13')](_0xdf7f11));_0x38e85d(_0xdf7f11);})['catch'](function(_0x1faa27){logger['error'](_0xa7f9('0x19'),_0x1faa27[_0xa7f9('0x15')],_0x46acd3);_0x1190eb(_0x1779dc[_0xa7f9('0x14')](0x1f4,_0x1faa27[_0xa7f9('0x15')]));});});};exports['ShowMailQueue']=function(_0x2f5b41){var _0x538ece=this;return new Promise(function(_0x392d80,_0x19fb6a){return db[_0xa7f9('0x23')][_0xa7f9('0x24')]({'raw':_0x2f5b41[_0xa7f9('0x1b')]?_0x2f5b41[_0xa7f9('0x1b')][_0xa7f9('0x1c')]===undefined?!![]:![]:!![],'where':_0x2f5b41[_0xa7f9('0x1b')]?_0x2f5b41[_0xa7f9('0x1b')]['where']||null:null,'attributes':_0x2f5b41[_0xa7f9('0x1b')]?_0x2f5b41['options'][_0xa7f9('0x1e')]||null:null,'include':_0x2f5b41['options']?_0x2f5b41[_0xa7f9('0x1b')][_0xa7f9('0x20')]?_[_0xa7f9('0x21')](_0x2f5b41[_0xa7f9('0x1b')][_0xa7f9('0x20')],function(_0x237de1){return{'model':db[_0x237de1[_0xa7f9('0x22')]],'as':_0x237de1['as'],'attributes':_0x237de1[_0xa7f9('0x1e')],'include':_0x237de1[_0xa7f9('0x20')]?_['map'](_0x237de1[_0xa7f9('0x20')],function(_0x218a05){return{'model':db[_0x218a05[_0xa7f9('0x22')]],'as':_0x218a05['as'],'attributes':_0x218a05[_0xa7f9('0x1e')],'include':_0x218a05[_0xa7f9('0x20')]?_[_0xa7f9('0x21')](_0x218a05[_0xa7f9('0x20')],function(_0x44764b){return{'model':db[_0x44764b[_0xa7f9('0x22')]],'as':_0x44764b['as'],'attributes':_0x44764b[_0xa7f9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f3747){logger[_0xa7f9('0x16')](_0xa7f9('0x25'),_0x2f5b41);logger['debug'](_0xa7f9('0x25'),_0x2f5b41,JSON[_0xa7f9('0x13')](_0x4f3747));_0x392d80(_0x4f3747);})[_0xa7f9('0x18')](function(_0x4970de){logger[_0xa7f9('0x14')](_0xa7f9('0x25'),_0x4970de[_0xa7f9('0x15')],_0x2f5b41);_0x19fb6a(_0x538ece[_0xa7f9('0x14')](0x1f4,_0x4970de[_0xa7f9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index f8f6260..c6ff83e 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 _0x47a0=['length','mailQueue:','./mailQueue.events','remove','update','emit','removeListener','register'];(function(_0xb44c04,_0x41b40f){var _0x472326=function(_0x5a8c26){while(--_0x5a8c26){_0xb44c04['push'](_0xb44c04['shift']());}};_0x472326(++_0x41b40f);}(_0x47a0,0x15a));var _0x047a=function(_0x46c667,_0x12f02f){_0x46c667=_0x46c667-0x0;var _0x5677c8=_0x47a0[_0x46c667];return _0x5677c8;};'use strict';var MailQueueEvents=require(_0x047a('0x0'));var events=['save',_0x047a('0x1'),_0x047a('0x2')];function createListener(_0x449dc5,_0x4e76e9){return function(_0xc38132){_0x4e76e9[_0x047a('0x3')](_0x449dc5,_0xc38132);};}function removeListener(_0x5ceee8,_0x4c9941){return function(){MailQueueEvents[_0x047a('0x4')](_0x5ceee8,_0x4c9941);};}exports[_0x047a('0x5')]=function(_0x1d60e1){for(var _0x56908d=0x0,_0x176f33=events[_0x047a('0x6')];_0x56908d<_0x176f33;_0x56908d++){var _0x2967b9=events[_0x56908d];var _0x138c00=createListener(_0x047a('0x7')+_0x2967b9,_0x1d60e1);MailQueueEvents['on'](_0x2967b9,_0x138c00);}}; \ No newline at end of file +var _0x3145=['mailQueue:','save','remove','update','emit','removeListener'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x3145,0xc7));var _0x5314=function(_0x168ae2,_0x49e961){_0x168ae2=_0x168ae2-0x0;var _0x44fc61=_0x3145[_0x168ae2];return _0x44fc61;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x5314('0x0'),_0x5314('0x1'),_0x5314('0x2')];function createListener(_0x1442c5,_0x2fed92){return function(_0x466af1){_0x2fed92[_0x5314('0x3')](_0x1442c5,_0x466af1);};}function removeListener(_0x4431a5,_0x53f77a){return function(){MailQueueEvents[_0x5314('0x4')](_0x4431a5,_0x53f77a);};}exports['register']=function(_0x3b794d){for(var _0x1cc098=0x0,_0x274757=events['length'];_0x1cc098<_0x274757;_0x1cc098++){var _0x2183f9=events[_0x1cc098];var _0x20330e=createListener(_0x5314('0x5')+_0x2183f9,_0x3b794d);MailQueueEvents['on'](_0x2183f9,_0x20330e);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 7f7444e..02d7864 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 _0xfde5=['show','post','create','put','/:id','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xfde5,0x1aa));var _0x5fde=function(_0x17fa8e,_0xb5988){_0x17fa8e=_0x17fa8e-0x0;var _0x2feee6=_0xfde5[_0x17fa8e];return _0x2feee6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5fde('0x0'));var timeout=require(_0x5fde('0x1'));var express=require(_0x5fde('0x2'));var router=express[_0x5fde('0x3')]();var fs_extra=require(_0x5fde('0x4'));var auth=require(_0x5fde('0x5'));var interaction=require(_0x5fde('0x6'));var config=require(_0x5fde('0x7'));var controller=require(_0x5fde('0x8'));router[_0x5fde('0x9')]('/',auth['isAuthenticated'](),controller[_0x5fde('0xa')]);router[_0x5fde('0x9')](_0x5fde('0xb'),auth[_0x5fde('0xc')](),controller[_0x5fde('0xd')]);router['get']('/:id',auth[_0x5fde('0xc')](),controller[_0x5fde('0xe')]);router[_0x5fde('0xf')]('/',auth[_0x5fde('0xc')](),controller[_0x5fde('0x10')]);router[_0x5fde('0x11')](_0x5fde('0x12'),auth[_0x5fde('0xc')](),controller[_0x5fde('0x13')]);router[_0x5fde('0x14')]('/:id',auth[_0x5fde('0xc')](),controller['destroy']);module[_0x5fde('0x15')]=router; \ No newline at end of file +var _0xe616=['delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','/describe','describe','get','/:id','show','post','put','update'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0xe616,0x193));var _0x6e61=function(_0x15253b,_0x275b10){_0x15253b=_0x15253b-0x0;var _0xa92106=_0xe616[_0x15253b];return _0xa92106;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6e61('0x0'));var timeout=require(_0x6e61('0x1'));var express=require(_0x6e61('0x2'));var router=express[_0x6e61('0x3')]();var fs_extra=require(_0x6e61('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6e61('0x5'));var config=require(_0x6e61('0x6'));var controller=require(_0x6e61('0x7'));router['get']('/',auth[_0x6e61('0x8')](),controller['index']);router['get'](_0x6e61('0x9'),auth[_0x6e61('0x8')](),controller[_0x6e61('0xa')]);router[_0x6e61('0xb')](_0x6e61('0xc'),auth[_0x6e61('0x8')](),controller[_0x6e61('0xd')]);router[_0x6e61('0xe')]('/',auth[_0x6e61('0x8')](),controller['create']);router[_0x6e61('0xf')]('/:id',auth[_0x6e61('0x8')](),controller[_0x6e61('0x10')]);router[_0x6e61('0x11')](_0x6e61('0xc'),auth[_0x6e61('0x8')](),controller[_0x6e61('0x12')]);module[_0x6e61('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 6d03fb7..8506436 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 _0xe166=['sequelize','exports','STRING','DATE','moment'];(function(_0x2f691f,_0xef9ef3){var _0x4231a1=function(_0x50cfc4){while(--_0x50cfc4){_0x2f691f['push'](_0x2f691f['shift']());}};_0x4231a1(++_0xef9ef3);}(_0xe166,0x12b));var _0x6e16=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xe166[_0x4243a3];return _0x1b2a33;};'use strict';var moment=require(_0x6e16('0x0'));var Sequelize=require(_0x6e16('0x1'));module[_0x6e16('0x2')]={'uniqueid':{'type':Sequelize[_0x6e16('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6e16('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7b93=['moment','sequelize','exports','STRING','DATE'];(function(_0x1e94c6,_0x2b84b9){var _0xbc8eb6=function(_0x1612a7){while(--_0x1612a7){_0x1e94c6['push'](_0x1e94c6['shift']());}};_0xbc8eb6(++_0x2b84b9);}(_0x7b93,0x1bd));var _0x37b9=function(_0x5ac188,_0x163bcf){_0x5ac188=_0x5ac188-0x0;var _0x32fa2f=_0x7b93[_0x5ac188];return _0x32fa2f;};'use strict';var moment=require(_0x37b9('0x0'));var Sequelize=require(_0x37b9('0x1'));module[_0x37b9('0x2')]={'uniqueid':{'type':Sequelize[_0x37b9('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x37b9('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x37b9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index bcff82d..412d424 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 _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','MailQueueReport','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x173e7c,_0x328213){var _0x5bdbb7=function(_0x32930f){while(--_0x32930f){_0x173e7c['push'](_0x173e7c['shift']());}};_0x5bdbb7(++_0x328213);}(_0x4975,0x86));var _0x5497=function(_0xa7b0d7,_0x1eb938){_0xa7b0d7=_0xa7b0d7-0x0;var _0x3275b6=_0x4975[_0xa7b0d7];return _0x3275b6;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['MailQueueReport'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['MailQueueReport'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file +var _0x90b1=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','MailQueueReport','includeAll','rows','include','find','catch','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters'];(function(_0x4318de,_0x340f75){var _0x5091d8=function(_0x2e5606){while(--_0x2e5606){_0x4318de['push'](_0x4318de['shift']());}};_0x5091d8(++_0x340f75);}(_0x90b1,0x1bb));var _0x190b=function(_0x4d1cc6,_0x26bebe){_0x4d1cc6=_0x4d1cc6-0x0;var _0x1a6fee=_0x90b1[_0x4d1cc6];return _0x1a6fee;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['MailQueueReport'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['create']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['create'](_0x1f2262[_0x190b('0x43')],{})[_0x190b('0x22')](respondWithResult(_0xadc789,0xc9))[_0x190b('0x42')](handleError(_0xadc789,null));};exports['update']=function(_0x4cb561,_0x14958e){if(_0x4cb561[_0x190b('0x43')]['id']){delete _0x4cb561[_0x190b('0x43')]['id'];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'id':_0x4cb561[_0x190b('0x44')]['id']}})['then'](handleEntityNotFound(_0x14958e,null))[_0x190b('0x22')](saveUpdates(_0x4cb561[_0x190b('0x43')],null))[_0x190b('0x22')](respondWithResult(_0x14958e,null))['catch'](handleError(_0x14958e,null));};exports[_0x190b('0x23')]=function(_0x38c135,_0x215ab6){return db['MailQueueReport'][_0x190b('0x41')]({'where':{'id':_0x38c135[_0x190b('0x44')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x215ab6,null))[_0x190b('0x22')](removeEntity(_0x215ab6,null))[_0x190b('0x42')](handleError(_0x215ab6,null));};exports[_0x190b('0x45')]=function(_0x33cc78,_0x2ea1c8){return db[_0x190b('0x3d')][_0x190b('0x45')]()[_0x190b('0x22')](respondWithResult(_0x2ea1c8,null))['catch'](handleError(_0x2ea1c8,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index dcdc5e1..e66b24d 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 _0x048f=['util','api','bluebird','request-promise','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x4c3233,_0x32de5c){var _0x346a19=function(_0x2d5e75){while(--_0x2d5e75){_0x4c3233['push'](_0x4c3233['shift']());}};_0x346a19(++_0x32de5c);}(_0x048f,0x1c7));var _0xf048=function(_0x1079dc,_0x821226){_0x1079dc=_0x1079dc-0x0;var _0x1c7ef7=_0x048f[_0x1079dc];return _0x1c7ef7;};'use strict';var _=require(_0xf048('0x0'));var util=require(_0xf048('0x1'));var logger=require('../../config/logger')(_0xf048('0x2'));var moment=require('moment');var BPromise=require(_0xf048('0x3'));var rp=require(_0xf048('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf048('0x5'));var config=require('../../config/environment');var attributes=require(_0xf048('0x6'));module[_0xf048('0x7')]=function(_0x1e40d6,_0x1d354e){return _0x1e40d6[_0xf048('0x8')](_0xf048('0x9'),attributes,{'tableName':_0xf048('0xa'),'paranoid':![],'indexes':[{'name':_0xf048('0xb'),'fields':[_0xf048('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8c3d=['rimraf','../../config/environment','exports','define','MailQueueReport','report_mail_queue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x29d49f,_0x27753d){var _0x5e146d=function(_0x2d10a4){while(--_0x2d10a4){_0x29d49f['push'](_0x29d49f['shift']());}};_0x5e146d(++_0x27753d);}(_0x8c3d,0x1f0));var _0xd8c3=function(_0x594163,_0xf3583c){_0x594163=_0x594163-0x0;var _0x18c749=_0x8c3d[_0x594163];return _0x18c749;};'use strict';var _=require(_0xd8c3('0x0'));var util=require(_0xd8c3('0x1'));var logger=require(_0xd8c3('0x2'))(_0xd8c3('0x3'));var moment=require(_0xd8c3('0x4'));var BPromise=require(_0xd8c3('0x5'));var rp=require(_0xd8c3('0x6'));var fs=require('fs');var path=require(_0xd8c3('0x7'));var rimraf=require(_0xd8c3('0x8'));var config=require(_0xd8c3('0x9'));var attributes=require('./mailQueueReport.attributes');module[_0xd8c3('0xa')]=function(_0x4e60a2,_0xaaed95){return _0x4e60a2[_0xd8c3('0xb')](_0xd8c3('0xc'),attributes,{'tableName':_0xd8c3('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 14edbf3..50b8e6b 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x5c0aca,_0x4e5584){var _0x403480=function(_0x2679ca){while(--_0x2679ca){_0x5c0aca['push'](_0x5c0aca['shift']());}};_0x403480(++_0x4e5584);}(_0x2ef3,0xba));var _0x32ef=function(_0xd8583d,_0x2efc8a){_0xd8583d=_0xd8583d-0x0;var _0x464888=_0x2ef3[_0xd8583d];return _0x464888;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x2967e0,_0x395979){var _0x5a5ba6=function(_0x2fd530){while(--_0x2fd530){_0x2967e0['push'](_0x2967e0['shift']());}};_0x5a5ba6(++_0x395979);}(_0x7a54,0x106));var _0x47a5=function(_0x21a9bd,_0x383fcd){_0x21a9bd=_0x21a9bd-0x0;var _0x5a0930=_0x7a54[_0x21a9bd];return _0x5a0930;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 225f4e4..74a918e 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x102c67,_0x5af95b){var _0x5e0b22=function(_0x528746){while(--_0x528746){_0x102c67['push'](_0x102c67['shift']());}};_0x5e0b22(++_0x5af95b);}(_0xe706,0xa3));var _0x6e70=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0xe706[_0x10d34b];return _0x92b0bf;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3eebec,_0x16bed1){var _0x4ebdb7=function(_0x584bd2){while(--_0x584bd2){_0x3eebec['push'](_0x3eebec['shift']());}};_0x4ebdb7(++_0x16bed1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index ee8865c..d8e5d33 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 _0x6263=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x2928c3,_0x4cf8f5){var _0x3b9ab9=function(_0x19d45c){while(--_0x19d45c){_0x2928c3['push'](_0x2928c3['shift']());}};_0x3b9ab9(++_0x4cf8f5);}(_0x6263,0x1ab));var _0x3626=function(_0x5cdc52,_0x33ce72){_0x5cdc52=_0x5cdc52-0x0;var _0x455283=_0x6263[_0x5cdc52];return _0x455283;};'use strict';var Sequelize=require(_0x3626('0x0'));module[_0x3626('0x1')]={'description':{'type':Sequelize[_0x3626('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3626('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3626('0x2')]},'password':{'type':Sequelize[_0x3626('0x2')]},'port':{'type':Sequelize[_0x3626('0x4')]},'tls':{'type':Sequelize[_0x3626('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3626('0x2')],'defaultValue':_0x3626('0x5')},'connTimeout':{'type':Sequelize[_0x3626('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x3626('0x2')]},'modernAuthentication':{'type':Sequelize[_0x3626('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb491=['sequelize','exports','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xb491,0x18c));var _0x1b49=function(_0x466247,_0x5d69e3){_0x466247=_0x466247-0x0;var _0x4b352e=_0xb491[_0x466247];return _0x4b352e;};'use strict';var Sequelize=require(_0x1b49('0x0'));module[_0x1b49('0x1')]={'description':{'type':Sequelize[_0x1b49('0x2')]},'host':{'type':Sequelize[_0x1b49('0x2')]},'authentication':{'type':Sequelize[_0x1b49('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1b49('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x1b49('0x4')]},'tls':{'type':Sequelize[_0x1b49('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x1b49('0x5')},'connTimeout':{'type':Sequelize[_0x1b49('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1b49('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x1b49('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 66209e6..2b4d32a 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 _0xa061=['../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x1cfbe5,_0x2fd9bf){var _0x48afaf=function(_0x4139aa){while(--_0x4139aa){_0x1cfbe5['push'](_0x1cfbe5['shift']());}};_0x48afaf(++_0x2fd9bf);}(_0xa061,0xd1));var _0x1a06=function(_0x550ac4,_0x1f0436){_0x550ac4=_0x550ac4-0x0;var _0x3b1091=_0xa061[_0x550ac4];return _0x3b1091;};'use strict';var _=require(_0x1a06('0x0'));var util=require(_0x1a06('0x1'));var logger=require(_0x1a06('0x2'))('api');var moment=require(_0x1a06('0x3'));var BPromise=require(_0x1a06('0x4'));var rp=require(_0x1a06('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a06('0x6'));var config=require(_0x1a06('0x7'));var attributes=require(_0x1a06('0x8'));module[_0x1a06('0x9')]=function(_0x3030b0,_0x483fa1){return _0x3030b0['define'](_0x1a06('0xa'),attributes,{'tableName':_0x1a06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb76=['mail_servers_in','lodash','util','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','define','MailServerIn'];(function(_0xed26aa,_0x3cdc4b){var _0x133247=function(_0x29d9aa){while(--_0x29d9aa){_0xed26aa['push'](_0xed26aa['shift']());}};_0x133247(++_0x3cdc4b);}(_0xeb76,0x1c9));var _0x6eb7=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xeb76[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0x6eb7('0x0'));var util=require(_0x6eb7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6eb7('0x2'));var BPromise=require(_0x6eb7('0x3'));var rp=require(_0x6eb7('0x4'));var fs=require('fs');var path=require(_0x6eb7('0x5'));var rimraf=require(_0x6eb7('0x6'));var config=require('../../config/environment');var attributes=require(_0x6eb7('0x7'));module[_0x6eb7('0x8')]=function(_0x431b1d,_0x121d39){return _0x431b1d[_0x6eb7('0x9')](_0x6eb7('0xa'),attributes,{'tableName':_0x6eb7('0xb'),'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 8ba3aca..bfae75e 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 _0x8aae=['jayson/promise','client','http','info','MailServerIn,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','model','map','then','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x31e802,_0x3134e1){var _0x12b17a=function(_0x242849){while(--_0x242849){_0x31e802['push'](_0x31e802['shift']());}};_0x12b17a(++_0x3134e1);}(_0x8aae,0x138));var _0xe8aa=function(_0xeb1929,_0x2af862){_0xeb1929=_0xeb1929-0x0;var _0x14d241=_0x8aae[_0xeb1929];return _0x14d241;};'use strict';var _=require(_0xe8aa('0x0'));var util=require(_0xe8aa('0x1'));var moment=require(_0xe8aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xe8aa('0x3'));var fs=require('fs');var Redis=require(_0xe8aa('0x4'));var db=require(_0xe8aa('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe8aa('0x6'));var config=require(_0xe8aa('0x7'));var jayson=require(_0xe8aa('0x8'));var client=jayson[_0xe8aa('0x9')][_0xe8aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c9d3a,_0x5cccd6,_0x50ac0f){return new BPromise(function(_0x14ba4b,_0x328ce1){return client['request'](_0x2c9d3a,_0x50ac0f)['then'](function(_0x3c7fd9){logger[_0xe8aa('0xb')](_0xe8aa('0xc'),_0x5cccd6,'request\x20sent');logger[_0xe8aa('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x5cccd6,'request\x20sent',JSON['stringify'](_0x3c7fd9));if(_0x3c7fd9[_0xe8aa('0xe')]){if(_0x3c7fd9[_0xe8aa('0xe')][_0xe8aa('0xf')]===0x1f4){logger[_0xe8aa('0xe')]('MailServerIn,\x20%s,\x20%s',_0x5cccd6,_0x3c7fd9[_0xe8aa('0xe')]['message']);return _0x328ce1(_0x3c7fd9[_0xe8aa('0xe')]['message']);}logger[_0xe8aa('0xe')](_0xe8aa('0xc'),_0x5cccd6,_0x3c7fd9[_0xe8aa('0xe')][_0xe8aa('0x10')]);return _0x14ba4b(_0x3c7fd9['error'][_0xe8aa('0x10')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x5cccd6,_0xe8aa('0x11'));_0x14ba4b(_0x3c7fd9[_0xe8aa('0x12')][_0xe8aa('0x10')]);}})[_0xe8aa('0x13')](function(_0x38f79f){logger[_0xe8aa('0xe')]('MailServerIn,\x20%s,\x20%s',_0x5cccd6,_0x38f79f);_0x328ce1(_0x38f79f);});});}exports[_0xe8aa('0x14')]=function(_0x1223a1){var _0xd328f=this;return new Promise(function(_0x47f6ba,_0x2f8f53){return db[_0xe8aa('0x15')][_0xe8aa('0x16')]({'raw':_0x1223a1[_0xe8aa('0x17')]?_0x1223a1[_0xe8aa('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1223a1[_0xe8aa('0x17')]?_0x1223a1[_0xe8aa('0x17')][_0xe8aa('0x18')]||null:null,'attributes':_0x1223a1[_0xe8aa('0x17')]?_0x1223a1[_0xe8aa('0x17')][_0xe8aa('0x19')]||null:null,'limit':_0x1223a1[_0xe8aa('0x17')]?_0x1223a1['options'][_0xe8aa('0x1a')]||null:null,'include':_0x1223a1[_0xe8aa('0x17')]?_0x1223a1['options']['include']?_['map'](_0x1223a1[_0xe8aa('0x17')][_0xe8aa('0x1b')],function(_0x233a68){return{'model':db[_0x233a68[_0xe8aa('0x1c')]],'as':_0x233a68['as'],'attributes':_0x233a68[_0xe8aa('0x19')],'include':_0x233a68[_0xe8aa('0x1b')]?_[_0xe8aa('0x1d')](_0x233a68[_0xe8aa('0x1b')],function(_0x43c824){return{'model':db[_0x43c824[_0xe8aa('0x1c')]],'as':_0x43c824['as'],'attributes':_0x43c824[_0xe8aa('0x19')],'include':_0x43c824[_0xe8aa('0x1b')]?_[_0xe8aa('0x1d')](_0x43c824[_0xe8aa('0x1b')],function(_0x5d32c4){return{'model':db[_0x5d32c4['model']],'as':_0x5d32c4['as'],'attributes':_0x5d32c4[_0xe8aa('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe8aa('0x1e')](function(_0x148b73){logger['info']('GetMailServerIn',_0x1223a1);logger[_0xe8aa('0xd')](_0xe8aa('0x14'),_0x1223a1,JSON[_0xe8aa('0x1f')](_0x148b73));_0x47f6ba(_0x148b73);})[_0xe8aa('0x13')](function(_0x5b70fd){logger[_0xe8aa('0xe')](_0xe8aa('0x14'),_0x5b70fd[_0xe8aa('0x10')],_0x1223a1);_0x2f8f53(_0xd328f[_0xe8aa('0xe')](0x1f4,_0x5b70fd[_0xe8aa('0x10')]));});});}; \ No newline at end of file +var _0x575f=['GetMailServerIn','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x26fea5,_0x3dd985){var _0x8e2493=function(_0x5933d0){while(--_0x5933d0){_0x26fea5['push'](_0x26fea5['shift']());}};_0x8e2493(++_0x3dd985);}(_0x575f,0xb1));var _0xf575=function(_0x389ac4,_0x26addc){_0x389ac4=_0x389ac4-0x0;var _0x566ce8=_0x575f[_0x389ac4];return _0x566ce8;};'use strict';var _=require('lodash');var util=require(_0xf575('0x0'));var moment=require(_0xf575('0x1'));var BPromise=require(_0xf575('0x2'));var rs=require(_0xf575('0x3'));var fs=require('fs');var Redis=require(_0xf575('0x4'));var db=require(_0xf575('0x5'))['db'];var utils=require(_0xf575('0x6'));var logger=require('../../config/logger')(_0xf575('0x7'));var config=require(_0xf575('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf575('0x9')][_0xf575('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26c00e,_0x5999f1,_0x14231d){return new BPromise(function(_0x39255f,_0x39f102){return client[_0xf575('0xb')](_0x26c00e,_0x14231d)[_0xf575('0xc')](function(_0x2e4ab8){logger[_0xf575('0xd')](_0xf575('0xe'),_0x5999f1,_0xf575('0xf'));logger[_0xf575('0x10')](_0xf575('0x11'),_0x5999f1,'request\x20sent',JSON['stringify'](_0x2e4ab8));if(_0x2e4ab8['error']){if(_0x2e4ab8[_0xf575('0x12')][_0xf575('0x13')]===0x1f4){logger[_0xf575('0x12')](_0xf575('0xe'),_0x5999f1,_0x2e4ab8[_0xf575('0x12')][_0xf575('0x14')]);return _0x39f102(_0x2e4ab8['error'][_0xf575('0x14')]);}logger[_0xf575('0x12')]('MailServerIn,\x20%s,\x20%s',_0x5999f1,_0x2e4ab8[_0xf575('0x12')][_0xf575('0x14')]);return _0x39255f(_0x2e4ab8[_0xf575('0x12')][_0xf575('0x14')]);}else{logger[_0xf575('0xd')](_0xf575('0xe'),_0x5999f1,_0xf575('0xf'));_0x39255f(_0x2e4ab8[_0xf575('0x15')][_0xf575('0x14')]);}})[_0xf575('0x16')](function(_0x2b18aa){logger[_0xf575('0x12')](_0xf575('0xe'),_0x5999f1,_0x2b18aa);_0x39f102(_0x2b18aa);});});}exports['GetMailServerIn']=function(_0x150286){var _0x24d5ea=this;return new Promise(function(_0x424695,_0x24dbd9){return db[_0xf575('0x17')][_0xf575('0x18')]({'raw':_0x150286[_0xf575('0x19')]?_0x150286[_0xf575('0x19')][_0xf575('0x1a')]===undefined?!![]:![]:!![],'where':_0x150286['options']?_0x150286['options'][_0xf575('0x1b')]||null:null,'attributes':_0x150286[_0xf575('0x19')]?_0x150286[_0xf575('0x19')][_0xf575('0x1c')]||null:null,'limit':_0x150286['options']?_0x150286[_0xf575('0x19')][_0xf575('0x1d')]||null:null,'include':_0x150286[_0xf575('0x19')]?_0x150286['options'][_0xf575('0x1e')]?_[_0xf575('0x1f')](_0x150286[_0xf575('0x19')][_0xf575('0x1e')],function(_0x2acbba){return{'model':db[_0x2acbba['model']],'as':_0x2acbba['as'],'attributes':_0x2acbba[_0xf575('0x1c')],'include':_0x2acbba[_0xf575('0x1e')]?_['map'](_0x2acbba[_0xf575('0x1e')],function(_0x115321){return{'model':db[_0x115321[_0xf575('0x20')]],'as':_0x115321['as'],'attributes':_0x115321[_0xf575('0x1c')],'include':_0x115321[_0xf575('0x1e')]?_[_0xf575('0x1f')](_0x115321[_0xf575('0x1e')],function(_0xdadb80){return{'model':db[_0xdadb80[_0xf575('0x20')]],'as':_0xdadb80['as'],'attributes':_0xdadb80['attributes']};}):[]};}):[]};}):[]:[]})[_0xf575('0xc')](function(_0x534841){logger[_0xf575('0xd')](_0xf575('0x21'),_0x150286);logger[_0xf575('0x10')]('GetMailServerIn',_0x150286,JSON[_0xf575('0x22')](_0x534841));_0x424695(_0x534841);})['catch'](function(_0x28ad1a){logger[_0xf575('0x12')]('GetMailServerIn',_0x28ad1a[_0xf575('0x14')],_0x150286);_0x24dbd9(_0x24d5ea['error'](0x1f4,_0x28ad1a[_0xf575('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index e65334a..c3678ae 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x7a54,0x106));var _0x47a5=function(_0x45d1d6,_0xbcbe78){_0x45d1d6=_0x45d1d6-0x0;var _0x4d14ad=_0x7a54[_0x45d1d6];return _0x4d14ad;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_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('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 7a91f5c..d5400c9 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 _0x7916=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x30b58,_0x48df3b){var _0x9d210d=function(_0x46fffd){while(--_0x46fffd){_0x30b58['push'](_0x30b58['shift']());}};_0x9d210d(++_0x48df3b);}(_0x7916,0x128));var _0x6791=function(_0x40dd56,_0x726ca5){_0x40dd56=_0x40dd56-0x0;var _0x4f850f=_0x7916[_0x40dd56];return _0x4f850f;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'description':{'type':Sequelize[_0x6791('0x1')]},'host':{'type':Sequelize[_0x6791('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x6791('0x1')]},'port':{'type':Sequelize[_0x6791('0x2')]},'secure':{'type':Sequelize[_0x6791('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x6791('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x6791('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0565=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x1ad0d9,_0x2be374){var _0x4be8d7=function(_0x5ab910){while(--_0x5ab910){_0x1ad0d9['push'](_0x1ad0d9['shift']());}};_0x4be8d7(++_0x2be374);}(_0x0565,0xf2));var _0x5056=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x0565[_0x1477ef];return _0x164acd;};'use strict';var Sequelize=require(_0x5056('0x0'));module[_0x5056('0x1')]={'description':{'type':Sequelize[_0x5056('0x2')]},'host':{'type':Sequelize[_0x5056('0x2')]},'user':{'type':Sequelize[_0x5056('0x2')]},'pass':{'type':Sequelize[_0x5056('0x2')]},'port':{'type':Sequelize[_0x5056('0x3')]},'secure':{'type':Sequelize[_0x5056('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x5056('0x2')]},'authentication':{'type':Sequelize[_0x5056('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index ca09032..d6d0049 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 _0xc02f=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xc02f,0x183));var _0xfc02=function(_0x21254d,_0x49138e){_0x21254d=_0x21254d-0x0;var _0x5ab5e8=_0xc02f[_0x21254d];return _0x5ab5e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc02('0x0'));var zipdir=require(_0xfc02('0x1'));var jsonpatch=require(_0xfc02('0x2'));var rp=require(_0xfc02('0x3'));var moment=require(_0xfc02('0x4'));var BPromise=require(_0xfc02('0x5'));var Mustache=require(_0xfc02('0x6'));var util=require(_0xfc02('0x7'));var path=require(_0xfc02('0x8'));var sox=require(_0xfc02('0x9'));var csv=require(_0xfc02('0xa'));var ejs=require(_0xfc02('0xb'));var fs=require('fs');var fs_extra=require(_0xfc02('0xc'));var _=require(_0xfc02('0xd'));var squel=require('squel');var crypto=require(_0xfc02('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfc02('0xf'));var toCsv=require(_0xfc02('0xa'));var querystring=require('querystring');var Papa=require(_0xfc02('0x10'));var Redis=require(_0xfc02('0x11'));var authService=require(_0xfc02('0x12'));var qs=require(_0xfc02('0x13'));var as=require(_0xfc02('0x14'));var hardwareService=require(_0xfc02('0x15'));var logger=require(_0xfc02('0x16'))(_0xfc02('0x17'));var utils=require(_0xfc02('0x18'));var config=require(_0xfc02('0x19'));var licenseUtil=require(_0xfc02('0x1a'));var db=require(_0xfc02('0x1b'))['db'];function respondWithStatusCode(_0x31346a,_0x3d7094){_0x3d7094=_0x3d7094||0xcc;return function(_0x2309bc){if(_0x2309bc){return _0x31346a[_0xfc02('0x1c')](_0x3d7094);}return _0x31346a['status'](_0x3d7094)[_0xfc02('0x1d')]();};}function respondWithResult(_0x50b3bc,_0x5d279c){_0x5d279c=_0x5d279c||0xc8;return function(_0x136bea){if(_0x136bea){return _0x50b3bc['status'](_0x5d279c)[_0xfc02('0x1e')](_0x136bea);}};}function respondWithFilteredResult(_0x763a1f,_0x4f5c34){return function(_0x2cc7dc){if(_0x2cc7dc){var _0x27f86f=typeof _0x4f5c34[_0xfc02('0x1f')]===_0xfc02('0x20')&&typeof _0x4f5c34[_0xfc02('0x21')]==='undefined';var _0x523970=_0x2cc7dc[_0xfc02('0x22')];var _0x10e637=_0x27f86f?0x0:_0x4f5c34['offset'];var _0x5ef438=_0x27f86f?_0x2cc7dc[_0xfc02('0x22')]:_0x4f5c34[_0xfc02('0x1f')]+_0x4f5c34[_0xfc02('0x21')];var _0x11d56c;if(_0x5ef438>=_0x523970){_0x5ef438=_0x523970;_0x11d56c=0xc8;}else{_0x11d56c=0xce;}_0x763a1f[_0xfc02('0x23')](_0x11d56c);return _0x763a1f[_0xfc02('0x24')]('Content-Range',_0x10e637+'-'+_0x5ef438+'/'+_0x523970)['json'](_0x2cc7dc);}return null;};}function patchUpdates(_0x1de8d7){return function(_0x54a70b){try{jsonpatch[_0xfc02('0x25')](_0x54a70b,_0x1de8d7,!![]);}catch(_0x38dc18){return BPromise[_0xfc02('0x26')](_0x38dc18);}return _0x54a70b[_0xfc02('0x27')]();};}function saveUpdates(_0x477468,_0x419acd){return function(_0x564a4a){if(_0x564a4a){return _0x564a4a[_0xfc02('0x28')](_0x477468)['then'](function(_0x51d980){return _0x51d980;});}return null;};}function removeEntity(_0x1aa167,_0x2414f3){return function(_0x218ff4){if(_0x218ff4){return _0x218ff4['destroy']()['then'](function(){_0x1aa167['status'](0xcc)[_0xfc02('0x1d')]();});}};}function handleEntityNotFound(_0x5d9f01,_0x1fb5eb){return function(_0x1153ad){if(!_0x1153ad){_0x5d9f01[_0xfc02('0x1c')](0x194);}return _0x1153ad;};}function handleError(_0x45e529,_0xce2edf){_0xce2edf=_0xce2edf||0x1f4;return function(_0x5141e4){logger[_0xfc02('0x29')](_0x5141e4['stack']);if(_0x5141e4[_0xfc02('0x2a')]){delete _0x5141e4[_0xfc02('0x2a')];}_0x45e529[_0xfc02('0x23')](_0xce2edf)[_0xfc02('0x2b')](_0x5141e4);};}exports[_0xfc02('0x2c')]=function(_0xe6979c,_0x203ed7){var _0x60c197={},_0x417b82={},_0xe20d1={'count':0x0,'rows':[]};var _0x347739=_[_0xfc02('0x2d')](db[_0xfc02('0x2e')][_0xfc02('0x2f')],function(_0x5d0741){return{'name':_0x5d0741[_0xfc02('0x30')],'type':_0x5d0741[_0xfc02('0x31')][_0xfc02('0x32')]};});_0x417b82[_0xfc02('0x33')]=_[_0xfc02('0x2d')](_0x347739,'name');_0x417b82[_0xfc02('0x34')]=_[_0xfc02('0x35')](_0xe6979c[_0xfc02('0x34')]);_0x417b82[_0xfc02('0x36')]=_['intersection'](_0x417b82['model'],_0x417b82[_0xfc02('0x34')]);_0x60c197[_0xfc02('0x37')]=_[_0xfc02('0x38')](_0x417b82[_0xfc02('0x33')],qs[_0xfc02('0x39')](_0xe6979c[_0xfc02('0x34')][_0xfc02('0x39')]));_0x60c197['attributes']=_0x60c197[_0xfc02('0x37')][_0xfc02('0x3a')]?_0x60c197[_0xfc02('0x37')]:_0x417b82['model'];if(!_0xe6979c[_0xfc02('0x34')][_0xfc02('0x3b')]('nolimit')){_0x60c197['limit']=qs['limit'](_0xe6979c[_0xfc02('0x34')][_0xfc02('0x21')]);_0x60c197[_0xfc02('0x1f')]=qs[_0xfc02('0x1f')](_0xe6979c['query']['offset']);}_0x60c197[_0xfc02('0x3c')]=qs[_0xfc02('0x3d')](_0xe6979c[_0xfc02('0x34')][_0xfc02('0x3d')]);_0x60c197[_0xfc02('0x3e')]=qs[_0xfc02('0x36')](_[_0xfc02('0x3f')](_0xe6979c[_0xfc02('0x34')],_0x417b82['filters']),_0x347739);if(_0xe6979c[_0xfc02('0x34')][_0xfc02('0x40')]){_0x60c197[_0xfc02('0x3e')]=_[_0xfc02('0x41')](_0x60c197['where'],{'$or':_[_0xfc02('0x2d')](_0x347739,function(_0x37eefd){if(_0x37eefd[_0xfc02('0x31')]!=='VIRTUAL'){var _0x4fcf38={};_0x4fcf38[_0x37eefd[_0xfc02('0x2a')]]={'$like':'%'+_0xe6979c[_0xfc02('0x34')][_0xfc02('0x40')]+'%'};return _0x4fcf38;}})});}_0x60c197=_[_0xfc02('0x41')]({},_0x60c197,_0xe6979c[_0xfc02('0x42')]);var _0x301a8b={'where':_0x60c197[_0xfc02('0x3e')]};return db[_0xfc02('0x2e')][_0xfc02('0x22')](_0x301a8b)[_0xfc02('0x43')](function(_0x4cf3c1){_0xe20d1[_0xfc02('0x22')]=_0x4cf3c1;if(_0xe6979c['query'][_0xfc02('0x44')]){_0x60c197[_0xfc02('0x45')]=[{'all':!![]}];}return db[_0xfc02('0x2e')][_0xfc02('0x46')](_0x60c197);})['then'](function(_0xfadaa0){_0xe20d1[_0xfc02('0x47')]=_0xfadaa0;return _0xe20d1;})[_0xfc02('0x43')](respondWithFilteredResult(_0x203ed7,_0x60c197))[_0xfc02('0x48')](handleError(_0x203ed7,null));};exports[_0xfc02('0x49')]=function(_0x23451c,_0x253a18){var _0x39b4eb={'raw':!![],'where':{'id':_0x23451c[_0xfc02('0x4a')]['id']}},_0x5a47fb={};_0x5a47fb[_0xfc02('0x33')]=_[_0xfc02('0x35')](db[_0xfc02('0x2e')][_0xfc02('0x2f')]);_0x5a47fb['query']=_[_0xfc02('0x35')](_0x23451c[_0xfc02('0x34')]);_0x5a47fb[_0xfc02('0x36')]=_['intersection'](_0x5a47fb[_0xfc02('0x33')],_0x5a47fb[_0xfc02('0x34')]);_0x39b4eb[_0xfc02('0x37')]=_[_0xfc02('0x38')](_0x5a47fb[_0xfc02('0x33')],qs[_0xfc02('0x39')](_0x23451c[_0xfc02('0x34')][_0xfc02('0x39')]));_0x39b4eb['attributes']=_0x39b4eb[_0xfc02('0x37')]['length']?_0x39b4eb[_0xfc02('0x37')]:_0x5a47fb['model'];if(_0x23451c['query'][_0xfc02('0x44')]){_0x39b4eb[_0xfc02('0x45')]=[{'all':!![]}];}_0x39b4eb=_[_0xfc02('0x41')]({},_0x39b4eb,_0x23451c[_0xfc02('0x42')]);return db[_0xfc02('0x2e')][_0xfc02('0x4b')](_0x39b4eb)[_0xfc02('0x43')](handleEntityNotFound(_0x253a18,null))['then'](respondWithResult(_0x253a18,null))['catch'](handleError(_0x253a18,null));};exports[_0xfc02('0x4c')]=function(_0x1c64f0,_0x49e9e7){return db[_0xfc02('0x2e')][_0xfc02('0x4c')](_0x1c64f0[_0xfc02('0x4d')],{})[_0xfc02('0x43')](respondWithResult(_0x49e9e7,0xc9))['catch'](handleError(_0x49e9e7,null));};exports[_0xfc02('0x28')]=function(_0x29a1bf,_0x1648f2){if(_0x29a1bf[_0xfc02('0x4d')]['id']){delete _0x29a1bf[_0xfc02('0x4d')]['id'];}return db['MailServerOut'][_0xfc02('0x4b')]({'where':{'id':_0x29a1bf[_0xfc02('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1648f2,null))[_0xfc02('0x43')](saveUpdates(_0x29a1bf[_0xfc02('0x4d')],null))[_0xfc02('0x43')](respondWithResult(_0x1648f2,null))[_0xfc02('0x48')](handleError(_0x1648f2,null));};exports[_0xfc02('0x4e')]=function(_0x39dfd0,_0x39fbe){return db[_0xfc02('0x2e')]['find']({'where':{'id':_0x39dfd0[_0xfc02('0x4a')]['id']}})[_0xfc02('0x43')](handleEntityNotFound(_0x39fbe,null))[_0xfc02('0x43')](removeEntity(_0x39fbe,null))[_0xfc02('0x48')](handleError(_0x39fbe,null));}; \ No newline at end of file +var _0x2212=['merge','type','includeAll','include','MailServerOut','findAll','catch','show','params','keys','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter'];(function(_0xc3e61d,_0x5c2b75){var _0x346f1c=function(_0x20fa3a){while(--_0x20fa3a){_0xc3e61d['push'](_0xc3e61d['shift']());}};_0x346f1c(++_0x5c2b75);}(_0x2212,0x13b));var _0x2221=function(_0xfd751b,_0x24a81c){_0xfd751b=_0xfd751b-0x0;var _0x14f873=_0x2212[_0xfd751b];return _0x14f873;};'use strict';var emlformat=require(_0x2221('0x0'));var rimraf=require(_0x2221('0x1'));var zipdir=require(_0x2221('0x2'));var jsonpatch=require(_0x2221('0x3'));var rp=require(_0x2221('0x4'));var moment=require('moment');var BPromise=require(_0x2221('0x5'));var Mustache=require(_0x2221('0x6'));var util=require('util');var path=require(_0x2221('0x7'));var sox=require('sox');var csv=require(_0x2221('0x8'));var ejs=require(_0x2221('0x9'));var fs=require('fs');var fs_extra=require(_0x2221('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2221('0xb'));var jsforce=require(_0x2221('0xc'));var deskjs=require(_0x2221('0xd'));var toCsv=require(_0x2221('0x8'));var querystring=require(_0x2221('0xe'));var Papa=require(_0x2221('0xf'));var Redis=require('ioredis');var authService=require(_0x2221('0x10'));var qs=require(_0x2221('0x11'));var as=require(_0x2221('0x12'));var hardwareService=require(_0x2221('0x13'));var logger=require(_0x2221('0x14'))('api');var utils=require(_0x2221('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2221('0x16'));var db=require(_0x2221('0x17'))['db'];function respondWithStatusCode(_0x43004f,_0x28c838){_0x28c838=_0x28c838||0xcc;return function(_0x4812a9){if(_0x4812a9){return _0x43004f[_0x2221('0x18')](_0x28c838);}return _0x43004f[_0x2221('0x19')](_0x28c838)[_0x2221('0x1a')]();};}function respondWithResult(_0xaf6c95,_0x1a1123){_0x1a1123=_0x1a1123||0xc8;return function(_0x453fe2){if(_0x453fe2){return _0xaf6c95['status'](_0x1a1123)[_0x2221('0x1b')](_0x453fe2);}};}function respondWithFilteredResult(_0x169615,_0x38f42f){return function(_0x261e33){if(_0x261e33){var _0x519dbd=typeof _0x38f42f[_0x2221('0x1c')]===_0x2221('0x1d')&&typeof _0x38f42f[_0x2221('0x1e')]===_0x2221('0x1d');var _0x5b2034=_0x261e33[_0x2221('0x1f')];var _0x5882d0=_0x519dbd?0x0:_0x38f42f[_0x2221('0x1c')];var _0x476bb0=_0x519dbd?_0x261e33[_0x2221('0x1f')]:_0x38f42f[_0x2221('0x1c')]+_0x38f42f[_0x2221('0x1e')];var _0x1a45d7;if(_0x476bb0>=_0x5b2034){_0x476bb0=_0x5b2034;_0x1a45d7=0xc8;}else{_0x1a45d7=0xce;}_0x169615[_0x2221('0x19')](_0x1a45d7);return _0x169615[_0x2221('0x20')](_0x2221('0x21'),_0x5882d0+'-'+_0x476bb0+'/'+_0x5b2034)[_0x2221('0x1b')](_0x261e33);}return null;};}function patchUpdates(_0x4e4421){return function(_0x20e3f9){try{jsonpatch[_0x2221('0x22')](_0x20e3f9,_0x4e4421,!![]);}catch(_0x3961f1){return BPromise[_0x2221('0x23')](_0x3961f1);}return _0x20e3f9['save']();};}function saveUpdates(_0x4ca4cc,_0x372276){return function(_0x32998c){if(_0x32998c){return _0x32998c[_0x2221('0x24')](_0x4ca4cc)[_0x2221('0x25')](function(_0x5688b3){return _0x5688b3;});}return null;};}function removeEntity(_0xee1598,_0x56ad3a){return function(_0x363fe0){if(_0x363fe0){return _0x363fe0[_0x2221('0x26')]()[_0x2221('0x25')](function(){_0xee1598[_0x2221('0x19')](0xcc)[_0x2221('0x1a')]();});}};}function handleEntityNotFound(_0x2f4eca,_0x223aaf){return function(_0xe45e6f){if(!_0xe45e6f){_0x2f4eca['sendStatus'](0x194);}return _0xe45e6f;};}function handleError(_0x3ea7d8,_0x1a9966){_0x1a9966=_0x1a9966||0x1f4;return function(_0x551f22){logger[_0x2221('0x27')](_0x551f22[_0x2221('0x28')]);if(_0x551f22[_0x2221('0x29')]){delete _0x551f22[_0x2221('0x29')];}_0x3ea7d8[_0x2221('0x19')](_0x1a9966)[_0x2221('0x2a')](_0x551f22);};}exports[_0x2221('0x2b')]=function(_0x493fa4,_0x4575f5){var _0xcdd55={},_0x12e80f={},_0x12833a={'count':0x0,'rows':[]};var _0x2da613=_[_0x2221('0x2c')](db['MailServerOut'][_0x2221('0x2d')],function(_0x2aee7f){return{'name':_0x2aee7f['fieldName'],'type':_0x2aee7f['type'][_0x2221('0x2e')]};});_0x12e80f['model']=_[_0x2221('0x2c')](_0x2da613,_0x2221('0x29'));_0x12e80f['query']=_['keys'](_0x493fa4[_0x2221('0x2f')]);_0x12e80f['filters']=_[_0x2221('0x30')](_0x12e80f[_0x2221('0x31')],_0x12e80f[_0x2221('0x2f')]);_0xcdd55[_0x2221('0x32')]=_[_0x2221('0x30')](_0x12e80f[_0x2221('0x31')],qs[_0x2221('0x33')](_0x493fa4[_0x2221('0x2f')][_0x2221('0x33')]));_0xcdd55[_0x2221('0x32')]=_0xcdd55[_0x2221('0x32')]['length']?_0xcdd55[_0x2221('0x32')]:_0x12e80f[_0x2221('0x31')];if(!_0x493fa4[_0x2221('0x2f')][_0x2221('0x34')](_0x2221('0x35'))){_0xcdd55[_0x2221('0x1e')]=qs[_0x2221('0x1e')](_0x493fa4['query'][_0x2221('0x1e')]);_0xcdd55['offset']=qs['offset'](_0x493fa4[_0x2221('0x2f')]['offset']);}_0xcdd55[_0x2221('0x36')]=qs[_0x2221('0x37')](_0x493fa4[_0x2221('0x2f')][_0x2221('0x37')]);_0xcdd55[_0x2221('0x38')]=qs[_0x2221('0x39')](_[_0x2221('0x3a')](_0x493fa4[_0x2221('0x2f')],_0x12e80f[_0x2221('0x39')]),_0x2da613);if(_0x493fa4[_0x2221('0x2f')][_0x2221('0x3b')]){_0xcdd55[_0x2221('0x38')]=_[_0x2221('0x3c')](_0xcdd55[_0x2221('0x38')],{'$or':_[_0x2221('0x2c')](_0x2da613,function(_0x44b1d4){if(_0x44b1d4[_0x2221('0x3d')]!=='VIRTUAL'){var _0x3738f4={};_0x3738f4[_0x44b1d4[_0x2221('0x29')]]={'$like':'%'+_0x493fa4[_0x2221('0x2f')]['filter']+'%'};return _0x3738f4;}})});}_0xcdd55=_[_0x2221('0x3c')]({},_0xcdd55,_0x493fa4['options']);var _0x3eb2f1={'where':_0xcdd55[_0x2221('0x38')]};return db['MailServerOut'][_0x2221('0x1f')](_0x3eb2f1)[_0x2221('0x25')](function(_0x2b486a){_0x12833a[_0x2221('0x1f')]=_0x2b486a;if(_0x493fa4[_0x2221('0x2f')][_0x2221('0x3e')]){_0xcdd55[_0x2221('0x3f')]=[{'all':!![]}];}return db[_0x2221('0x40')][_0x2221('0x41')](_0xcdd55);})[_0x2221('0x25')](function(_0x81e578){_0x12833a['rows']=_0x81e578;return _0x12833a;})['then'](respondWithFilteredResult(_0x4575f5,_0xcdd55))[_0x2221('0x42')](handleError(_0x4575f5,null));};exports[_0x2221('0x43')]=function(_0xa705f5,_0x1ab6d2){var _0x5bd14e={'raw':!![],'where':{'id':_0xa705f5[_0x2221('0x44')]['id']}},_0x10fbde={};_0x10fbde[_0x2221('0x31')]=_[_0x2221('0x45')](db['MailServerOut'][_0x2221('0x2d')]);_0x10fbde[_0x2221('0x2f')]=_[_0x2221('0x45')](_0xa705f5[_0x2221('0x2f')]);_0x10fbde['filters']=_[_0x2221('0x30')](_0x10fbde['model'],_0x10fbde[_0x2221('0x2f')]);_0x5bd14e[_0x2221('0x32')]=_['intersection'](_0x10fbde[_0x2221('0x31')],qs['fields'](_0xa705f5['query'][_0x2221('0x33')]));_0x5bd14e[_0x2221('0x32')]=_0x5bd14e[_0x2221('0x32')][_0x2221('0x46')]?_0x5bd14e[_0x2221('0x32')]:_0x10fbde[_0x2221('0x31')];if(_0xa705f5['query'][_0x2221('0x3e')]){_0x5bd14e['include']=[{'all':!![]}];}_0x5bd14e=_[_0x2221('0x3c')]({},_0x5bd14e,_0xa705f5[_0x2221('0x47')]);return db[_0x2221('0x40')][_0x2221('0x48')](_0x5bd14e)[_0x2221('0x25')](handleEntityNotFound(_0x1ab6d2,null))[_0x2221('0x25')](respondWithResult(_0x1ab6d2,null))['catch'](handleError(_0x1ab6d2,null));};exports['create']=function(_0xc3f726,_0x2ae2a6){return db['MailServerOut'][_0x2221('0x49')](_0xc3f726[_0x2221('0x4a')],{})[_0x2221('0x25')](respondWithResult(_0x2ae2a6,0xc9))[_0x2221('0x42')](handleError(_0x2ae2a6,null));};exports[_0x2221('0x24')]=function(_0x326243,_0x24681f){if(_0x326243['body']['id']){delete _0x326243[_0x2221('0x4a')]['id'];}return db[_0x2221('0x40')][_0x2221('0x48')]({'where':{'id':_0x326243['params']['id']}})[_0x2221('0x25')](handleEntityNotFound(_0x24681f,null))['then'](saveUpdates(_0x326243[_0x2221('0x4a')],null))[_0x2221('0x25')](respondWithResult(_0x24681f,null))[_0x2221('0x42')](handleError(_0x24681f,null));};exports[_0x2221('0x26')]=function(_0x283f2e,_0x3e8fd6){return db['MailServerOut'][_0x2221('0x48')]({'where':{'id':_0x283f2e[_0x2221('0x44')]['id']}})[_0x2221('0x25')](handleEntityNotFound(_0x3e8fd6,null))['then'](removeEntity(_0x3e8fd6,null))['catch'](handleError(_0x3e8fd6,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 7202950..bb66393 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 _0x6518=['../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x5c2fac,_0x35bbc2){var _0x3a9fee=function(_0x1a1d4e){while(--_0x1a1d4e){_0x5c2fac['push'](_0x5c2fac['shift']());}};_0x3a9fee(++_0x35bbc2);}(_0x6518,0x171));var _0x8651=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0x6518[_0x513047];return _0x15b779;};'use strict';var _=require(_0x8651('0x0'));var util=require(_0x8651('0x1'));var logger=require(_0x8651('0x2'))(_0x8651('0x3'));var moment=require(_0x8651('0x4'));var BPromise=require('bluebird');var rp=require(_0x8651('0x5'));var fs=require('fs');var path=require(_0x8651('0x6'));var rimraf=require(_0x8651('0x7'));var config=require(_0x8651('0x8'));var attributes=require(_0x8651('0x9'));module[_0x8651('0xa')]=function(_0x1edc11,_0x1547b9){return _0x1edc11['define'](_0x8651('0xb'),attributes,{'tableName':_0x8651('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7929=['moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','api'];(function(_0x57fdc2,_0x440bc3){var _0x31e878=function(_0x322004){while(--_0x322004){_0x57fdc2['push'](_0x57fdc2['shift']());}};_0x31e878(++_0x440bc3);}(_0x7929,0x1de));var _0x9792=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x7929[_0x104e21];return _0x605b37;};'use strict';var _=require(_0x9792('0x0'));var util=require(_0x9792('0x1'));var logger=require('../../config/logger')(_0x9792('0x2'));var moment=require(_0x9792('0x3'));var BPromise=require(_0x9792('0x4'));var rp=require(_0x9792('0x5'));var fs=require('fs');var path=require(_0x9792('0x6'));var rimraf=require('rimraf');var config=require(_0x9792('0x7'));var attributes=require(_0x9792('0x8'));module[_0x9792('0x9')]=function(_0x377856,_0x3be5bf){return _0x377856[_0x9792('0xa')](_0x9792('0xb'),attributes,{'tableName':_0x9792('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 77773bf..10cd979 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0xf5b47,_0x2b2a79){var _0x54818c=function(_0x4fea52){while(--_0x4fea52){_0xf5b47['push'](_0xf5b47['shift']());}};_0x54818c(++_0x2b2a79);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1e5755,_0x5e0d48){var _0x38975b=function(_0x1ec4a2){while(--_0x1ec4a2){_0x1e5755['push'](_0x1e5755['shift']());}};_0x38975b(++_0x5e0d48);}(_0xadb5,0xad));var _0x5adb=function(_0x3266c3,_0x34e570){_0x3266c3=_0x3266c3-0x0;var _0x19d8cc=_0xadb5[_0x3266c3];return _0x19d8cc;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 719a309..97a8a94 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 _0x86c2=['isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe'];(function(_0x3526ab,_0x347e8c){var _0x387cde=function(_0x50d23f){while(--_0x50d23f){_0x3526ab['push'](_0x3526ab['shift']());}};_0x387cde(++_0x347e8c);}(_0x86c2,0x144));var _0x286c=function(_0x5ece7e,_0xa77516){_0x5ece7e=_0x5ece7e-0x0;var _0x20336b=_0x86c2[_0x5ece7e];return _0x20336b;};'use strict';var multer=require(_0x286c('0x0'));var util=require('util');var path=require(_0x286c('0x1'));var timeout=require(_0x286c('0x2'));var express=require(_0x286c('0x3'));var router=express[_0x286c('0x4')]();var fs_extra=require(_0x286c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x286c('0x6'));var config=require(_0x286c('0x7'));var controller=require(_0x286c('0x8'));router[_0x286c('0x9')]('/',auth['isAuthenticated'](),controller[_0x286c('0xa')]);router[_0x286c('0x9')](_0x286c('0xb'),auth[_0x286c('0xc')](),controller['describe']);router['get'](_0x286c('0xd'),auth[_0x286c('0xc')](),controller[_0x286c('0xe')]);router[_0x286c('0xf')]('/',auth[_0x286c('0xc')](),controller['create']);router[_0x286c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x286c('0x11')]);router[_0x286c('0x12')]('/:id',auth[_0x286c('0xc')](),controller[_0x286c('0x13')]);module[_0x286c('0x14')]=router; \ No newline at end of file +var _0x525a=['index','get','/describe','describe','/:id','show','create','put','delete','destroy','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','isAuthenticated'];(function(_0x10a5e6,_0x16f8a6){var _0x365a9e=function(_0x3c8d54){while(--_0x3c8d54){_0x10a5e6['push'](_0x10a5e6['shift']());}};_0x365a9e(++_0x16f8a6);}(_0x525a,0xbe));var _0xa525=function(_0x3b711c,_0x4b22dc){_0x3b711c=_0x3b711c-0x0;var _0x2685f0=_0x525a[_0x3b711c];return _0x2685f0;};'use strict';var multer=require('multer');var util=require(_0xa525('0x0'));var path=require(_0xa525('0x1'));var timeout=require(_0xa525('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa525('0x3'));var auth=require(_0xa525('0x4'));var interaction=require(_0xa525('0x5'));var config=require('../../config/environment');var controller=require(_0xa525('0x6'));router['get']('/',auth[_0xa525('0x7')](),controller[_0xa525('0x8')]);router[_0xa525('0x9')](_0xa525('0xa'),auth[_0xa525('0x7')](),controller[_0xa525('0xb')]);router[_0xa525('0x9')](_0xa525('0xc'),auth['isAuthenticated'](),controller[_0xa525('0xd')]);router['post']('/',auth[_0xa525('0x7')](),controller[_0xa525('0xe')]);router[_0xa525('0xf')](_0xa525('0xc'),auth[_0xa525('0x7')](),controller['update']);router[_0xa525('0x10')](_0xa525('0xc'),auth[_0xa525('0x7')](),controller[_0xa525('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index f432d65..0c312e4 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 _0x938d=['name','STRING','sequelize','exports'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd938('0x0'));module[_0xd938('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd938('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd938('0x3')]}}; \ No newline at end of file +var _0x5e0e=['STRING','sequelize','exports','name'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5e0e,0x89));var _0xe5e0=function(_0x1bb11e,_0x58fd78){_0x1bb11e=_0x1bb11e-0x0;var _0x422492=_0x5e0e[_0x1bb11e];return _0x422492;};'use strict';var Sequelize=require(_0xe5e0('0x0'));module[_0xe5e0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe5e0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe5e0('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 40ca614..070eb5b 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 _0x43f8=['reject','save','update','sendStatus','error','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','count','then','includeAll','include','rows','catch','show','params','keys','rawAttributes','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','offset','limit','set','Content-Range','apply'];(function(_0x39d6c6,_0x5a3f11){var _0x399cf4=function(_0x6eba2a){while(--_0x6eba2a){_0x39d6c6['push'](_0x39d6c6['shift']());}};_0x399cf4(++_0x5a3f11);}(_0x43f8,0x76));var _0x843f=function(_0x4ba952,_0x5f33de){_0x4ba952=_0x4ba952-0x0;var _0x51ee21=_0x43f8[_0x4ba952];return _0x51ee21;};'use strict';var emlformat=require(_0x843f('0x0'));var rimraf=require(_0x843f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x843f('0x2'));var rp=require(_0x843f('0x3'));var moment=require(_0x843f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x843f('0x5'));var path=require(_0x843f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x843f('0x7'));var fs=require('fs');var fs_extra=require(_0x843f('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x843f('0x9'));var jsforce=require(_0x843f('0xa'));var deskjs=require(_0x843f('0xb'));var toCsv=require(_0x843f('0xc'));var querystring=require(_0x843f('0xd'));var Papa=require(_0x843f('0xe'));var Redis=require(_0x843f('0xf'));var authService=require(_0x843f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x843f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x843f('0x12'))(_0x843f('0x13'));var utils=require('../../config/utils');var config=require(_0x843f('0x14'));var licenseUtil=require(_0x843f('0x15'));var db=require(_0x843f('0x16'))['db'];function respondWithStatusCode(_0x5bc714,_0x8c0f7d){_0x8c0f7d=_0x8c0f7d||0xcc;return function(_0x4676cf){if(_0x4676cf){return _0x5bc714['sendStatus'](_0x8c0f7d);}return _0x5bc714['status'](_0x8c0f7d)[_0x843f('0x17')]();};}function respondWithResult(_0x1e3c73,_0x322aaf){_0x322aaf=_0x322aaf||0xc8;return function(_0x3b0db8){if(_0x3b0db8){return _0x1e3c73[_0x843f('0x18')](_0x322aaf)[_0x843f('0x19')](_0x3b0db8);}};}function respondWithFilteredResult(_0x2f3a7e,_0x5757d2){return function(_0x308981){if(_0x308981){var _0x104fd3=typeof _0x5757d2['offset']===_0x843f('0x1a')&&typeof _0x5757d2['limit']===_0x843f('0x1a');var _0x20f7ad=_0x308981['count'];var _0x125493=_0x104fd3?0x0:_0x5757d2[_0x843f('0x1b')];var _0x56678f=_0x104fd3?_0x308981['count']:_0x5757d2['offset']+_0x5757d2[_0x843f('0x1c')];var _0x4bedcb;if(_0x56678f>=_0x20f7ad){_0x56678f=_0x20f7ad;_0x4bedcb=0xc8;}else{_0x4bedcb=0xce;}_0x2f3a7e['status'](_0x4bedcb);return _0x2f3a7e[_0x843f('0x1d')](_0x843f('0x1e'),_0x125493+'-'+_0x56678f+'/'+_0x20f7ad)['json'](_0x308981);}return null;};}function patchUpdates(_0x40f3c8){return function(_0x5802ac){try{jsonpatch[_0x843f('0x1f')](_0x5802ac,_0x40f3c8,!![]);}catch(_0x2bb461){return BPromise[_0x843f('0x20')](_0x2bb461);}return _0x5802ac[_0x843f('0x21')]();};}function saveUpdates(_0x5f0cfe,_0x3f06dd){return function(_0xe8b6d1){if(_0xe8b6d1){return _0xe8b6d1[_0x843f('0x22')](_0x5f0cfe)['then'](function(_0xd690dd){return _0xd690dd;});}return null;};}function removeEntity(_0x43c895,_0x2cf158){return function(_0x59a4eb){if(_0x59a4eb){return _0x59a4eb['destroy']()['then'](function(){_0x43c895['status'](0xcc)[_0x843f('0x17')]();});}};}function handleEntityNotFound(_0x21a8b2,_0x3ed973){return function(_0x57f7c2){if(!_0x57f7c2){_0x21a8b2[_0x843f('0x23')](0x194);}return _0x57f7c2;};}function handleError(_0x165d35,_0x3cff1e){_0x3cff1e=_0x3cff1e||0x1f4;return function(_0x473ec6){logger[_0x843f('0x24')](_0x473ec6['stack']);if(_0x473ec6[_0x843f('0x25')]){delete _0x473ec6[_0x843f('0x25')];}_0x165d35['status'](_0x3cff1e)[_0x843f('0x26')](_0x473ec6);};}exports[_0x843f('0x27')]=function(_0x2fc515,_0x406edc){var _0x1c08b1={},_0x10c245={},_0x51661a={'count':0x0,'rows':[]};var _0x47426d=_[_0x843f('0x28')](db[_0x843f('0x29')]['rawAttributes'],function(_0x283db9){return{'name':_0x283db9[_0x843f('0x2a')],'type':_0x283db9[_0x843f('0x2b')][_0x843f('0x2c')]};});_0x10c245[_0x843f('0x2d')]=_['map'](_0x47426d,'name');_0x10c245[_0x843f('0x2e')]=_['keys'](_0x2fc515[_0x843f('0x2e')]);_0x10c245[_0x843f('0x2f')]=_[_0x843f('0x30')](_0x10c245['model'],_0x10c245[_0x843f('0x2e')]);_0x1c08b1[_0x843f('0x31')]=_[_0x843f('0x30')](_0x10c245['model'],qs[_0x843f('0x32')](_0x2fc515[_0x843f('0x2e')][_0x843f('0x32')]));_0x1c08b1[_0x843f('0x31')]=_0x1c08b1[_0x843f('0x31')][_0x843f('0x33')]?_0x1c08b1[_0x843f('0x31')]:_0x10c245[_0x843f('0x2d')];if(!_0x2fc515[_0x843f('0x2e')][_0x843f('0x34')](_0x843f('0x35'))){_0x1c08b1[_0x843f('0x1c')]=qs[_0x843f('0x1c')](_0x2fc515[_0x843f('0x2e')][_0x843f('0x1c')]);_0x1c08b1[_0x843f('0x1b')]=qs[_0x843f('0x1b')](_0x2fc515[_0x843f('0x2e')]['offset']);}_0x1c08b1['order']=qs[_0x843f('0x36')](_0x2fc515[_0x843f('0x2e')][_0x843f('0x36')]);_0x1c08b1[_0x843f('0x37')]=qs[_0x843f('0x2f')](_[_0x843f('0x38')](_0x2fc515[_0x843f('0x2e')],_0x10c245[_0x843f('0x2f')]),_0x47426d);if(_0x2fc515[_0x843f('0x2e')][_0x843f('0x39')]){_0x1c08b1[_0x843f('0x37')]=_[_0x843f('0x3a')](_0x1c08b1[_0x843f('0x37')],{'$or':_['map'](_0x47426d,function(_0x2e188d){if(_0x2e188d['type']!==_0x843f('0x3b')){var _0x1db818={};_0x1db818[_0x2e188d[_0x843f('0x25')]]={'$like':'%'+_0x2fc515['query']['filter']+'%'};return _0x1db818;}})});}_0x1c08b1=_['merge']({},_0x1c08b1,_0x2fc515['options']);var _0x43c25d={'where':_0x1c08b1[_0x843f('0x37')]};return db['MailSubstatus'][_0x843f('0x3c')](_0x43c25d)[_0x843f('0x3d')](function(_0x7cfde2){_0x51661a['count']=_0x7cfde2;if(_0x2fc515[_0x843f('0x2e')][_0x843f('0x3e')]){_0x1c08b1[_0x843f('0x3f')]=[{'all':!![]}];}return db[_0x843f('0x29')]['findAll'](_0x1c08b1);})['then'](function(_0x4ccb12){_0x51661a[_0x843f('0x40')]=_0x4ccb12;return _0x51661a;})[_0x843f('0x3d')](respondWithFilteredResult(_0x406edc,_0x1c08b1))[_0x843f('0x41')](handleError(_0x406edc,null));};exports[_0x843f('0x42')]=function(_0x3f896d,_0x8ae2de){var _0x36fa8d={'raw':!![],'where':{'id':_0x3f896d[_0x843f('0x43')]['id']}},_0x2cbecb={};_0x2cbecb['model']=_[_0x843f('0x44')](db[_0x843f('0x29')][_0x843f('0x45')]);_0x2cbecb[_0x843f('0x2e')]=_[_0x843f('0x44')](_0x3f896d[_0x843f('0x2e')]);_0x2cbecb[_0x843f('0x2f')]=_[_0x843f('0x30')](_0x2cbecb[_0x843f('0x2d')],_0x2cbecb[_0x843f('0x2e')]);_0x36fa8d[_0x843f('0x31')]=_[_0x843f('0x30')](_0x2cbecb['model'],qs['fields'](_0x3f896d[_0x843f('0x2e')][_0x843f('0x32')]));_0x36fa8d[_0x843f('0x31')]=_0x36fa8d[_0x843f('0x31')][_0x843f('0x33')]?_0x36fa8d[_0x843f('0x31')]:_0x2cbecb['model'];if(_0x3f896d[_0x843f('0x2e')]['includeAll']){_0x36fa8d[_0x843f('0x3f')]=[{'all':!![]}];}_0x36fa8d=_[_0x843f('0x3a')]({},_0x36fa8d,_0x3f896d[_0x843f('0x46')]);return db[_0x843f('0x29')]['find'](_0x36fa8d)['then'](handleEntityNotFound(_0x8ae2de,null))[_0x843f('0x3d')](respondWithResult(_0x8ae2de,null))[_0x843f('0x41')](handleError(_0x8ae2de,null));};exports[_0x843f('0x47')]=function(_0x418da6,_0x3276f9){return db[_0x843f('0x29')][_0x843f('0x47')](_0x418da6[_0x843f('0x48')],{})[_0x843f('0x3d')](respondWithResult(_0x3276f9,0xc9))[_0x843f('0x41')](handleError(_0x3276f9,null));};exports[_0x843f('0x22')]=function(_0x1c22f3,_0x40cc1b){if(_0x1c22f3['body']['id']){delete _0x1c22f3[_0x843f('0x48')]['id'];}return db[_0x843f('0x29')][_0x843f('0x49')]({'where':{'id':_0x1c22f3[_0x843f('0x43')]['id']}})[_0x843f('0x3d')](handleEntityNotFound(_0x40cc1b,null))[_0x843f('0x3d')](saveUpdates(_0x1c22f3[_0x843f('0x48')],null))['then'](respondWithResult(_0x40cc1b,null))[_0x843f('0x41')](handleError(_0x40cc1b,null));};exports['destroy']=function(_0x41c942,_0xb9438b){return db[_0x843f('0x29')]['find']({'where':{'id':_0x41c942[_0x843f('0x43')]['id']}})['then'](handleEntityNotFound(_0xb9438b,null))['then'](removeEntity(_0xb9438b,null))[_0x843f('0x41')](handleError(_0xb9438b,null));};exports[_0x843f('0x4a')]=function(_0x2892f5,_0x5ecbdf){return db[_0x843f('0x29')][_0x843f('0x4a')]()[_0x843f('0x3d')](respondWithResult(_0x5ecbdf,null))[_0x843f('0x41')](handleError(_0x5ecbdf,null));}; \ No newline at end of file +var _0xaff4=['index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','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','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x3465ff,_0x3de250){var _0x4ef355=function(_0x1b2c57){while(--_0x1b2c57){_0x3465ff['push'](_0x3465ff['shift']());}};_0x4ef355(++_0x3de250);}(_0xaff4,0x14f));var _0x4aff=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0xaff4[_0x5678b5];return _0x4c09a5;};'use strict';var emlformat=require(_0x4aff('0x0'));var rimraf=require(_0x4aff('0x1'));var zipdir=require(_0x4aff('0x2'));var jsonpatch=require(_0x4aff('0x3'));var rp=require(_0x4aff('0x4'));var moment=require('moment');var BPromise=require(_0x4aff('0x5'));var Mustache=require(_0x4aff('0x6'));var util=require(_0x4aff('0x7'));var path=require(_0x4aff('0x8'));var sox=require(_0x4aff('0x9'));var csv=require(_0x4aff('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4aff('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4aff('0xa'));var querystring=require(_0x4aff('0xc'));var Papa=require(_0x4aff('0xd'));var Redis=require(_0x4aff('0xe'));var authService=require(_0x4aff('0xf'));var qs=require(_0x4aff('0x10'));var as=require(_0x4aff('0x11'));var hardwareService=require(_0x4aff('0x12'));var logger=require(_0x4aff('0x13'))(_0x4aff('0x14'));var utils=require(_0x4aff('0x15'));var config=require(_0x4aff('0x16'));var licenseUtil=require(_0x4aff('0x17'));var db=require(_0x4aff('0x18'))['db'];function respondWithStatusCode(_0x20cb76,_0x13fb74){_0x13fb74=_0x13fb74||0xcc;return function(_0x2da5d7){if(_0x2da5d7){return _0x20cb76[_0x4aff('0x19')](_0x13fb74);}return _0x20cb76['status'](_0x13fb74)['end']();};}function respondWithResult(_0xdd2129,_0x30d948){_0x30d948=_0x30d948||0xc8;return function(_0x230e24){if(_0x230e24){return _0xdd2129[_0x4aff('0x1a')](_0x30d948)[_0x4aff('0x1b')](_0x230e24);}};}function respondWithFilteredResult(_0x5c3eac,_0x3cbc86){return function(_0xa1d91f){if(_0xa1d91f){var _0x460a9f=typeof _0x3cbc86[_0x4aff('0x1c')]==='undefined'&&typeof _0x3cbc86[_0x4aff('0x1d')]===_0x4aff('0x1e');var _0x30b0c8=_0xa1d91f[_0x4aff('0x1f')];var _0x3870d0=_0x460a9f?0x0:_0x3cbc86[_0x4aff('0x1c')];var _0xd4d17b=_0x460a9f?_0xa1d91f[_0x4aff('0x1f')]:_0x3cbc86['offset']+_0x3cbc86[_0x4aff('0x1d')];var _0xc07315;if(_0xd4d17b>=_0x30b0c8){_0xd4d17b=_0x30b0c8;_0xc07315=0xc8;}else{_0xc07315=0xce;}_0x5c3eac[_0x4aff('0x1a')](_0xc07315);return _0x5c3eac[_0x4aff('0x20')](_0x4aff('0x21'),_0x3870d0+'-'+_0xd4d17b+'/'+_0x30b0c8)[_0x4aff('0x1b')](_0xa1d91f);}return null;};}function patchUpdates(_0x1552da){return function(_0x59445a){try{jsonpatch[_0x4aff('0x22')](_0x59445a,_0x1552da,!![]);}catch(_0x14d698){return BPromise[_0x4aff('0x23')](_0x14d698);}return _0x59445a[_0x4aff('0x24')]();};}function saveUpdates(_0x93728b,_0x380f87){return function(_0x11907b){if(_0x11907b){return _0x11907b[_0x4aff('0x25')](_0x93728b)[_0x4aff('0x26')](function(_0x4107b4){return _0x4107b4;});}return null;};}function removeEntity(_0x425e05,_0x1d0728){return function(_0x5a1524){if(_0x5a1524){return _0x5a1524[_0x4aff('0x27')]()[_0x4aff('0x26')](function(){_0x425e05[_0x4aff('0x1a')](0xcc)[_0x4aff('0x28')]();});}};}function handleEntityNotFound(_0x50fcf0,_0x3e3f14){return function(_0x2e5e32){if(!_0x2e5e32){_0x50fcf0[_0x4aff('0x19')](0x194);}return _0x2e5e32;};}function handleError(_0x5c0ee2,_0x53d487){_0x53d487=_0x53d487||0x1f4;return function(_0x38a11f){logger[_0x4aff('0x29')](_0x38a11f[_0x4aff('0x2a')]);if(_0x38a11f[_0x4aff('0x2b')]){delete _0x38a11f[_0x4aff('0x2b')];}_0x5c0ee2[_0x4aff('0x1a')](_0x53d487)[_0x4aff('0x2c')](_0x38a11f);};}exports[_0x4aff('0x2d')]=function(_0x5bd75a,_0x1086b1){var _0x13e62d={},_0x1bd368={},_0x4c72f5={'count':0x0,'rows':[]};var _0x143cf2=_[_0x4aff('0x2e')](db[_0x4aff('0x2f')][_0x4aff('0x30')],function(_0x1acd57){return{'name':_0x1acd57[_0x4aff('0x31')],'type':_0x1acd57[_0x4aff('0x32')][_0x4aff('0x33')]};});_0x1bd368[_0x4aff('0x34')]=_[_0x4aff('0x2e')](_0x143cf2,_0x4aff('0x2b'));_0x1bd368[_0x4aff('0x35')]=_[_0x4aff('0x36')](_0x5bd75a[_0x4aff('0x35')]);_0x1bd368['filters']=_['intersection'](_0x1bd368[_0x4aff('0x34')],_0x1bd368[_0x4aff('0x35')]);_0x13e62d[_0x4aff('0x37')]=_[_0x4aff('0x38')](_0x1bd368[_0x4aff('0x34')],qs[_0x4aff('0x39')](_0x5bd75a[_0x4aff('0x35')]['fields']));_0x13e62d[_0x4aff('0x37')]=_0x13e62d[_0x4aff('0x37')][_0x4aff('0x3a')]?_0x13e62d[_0x4aff('0x37')]:_0x1bd368[_0x4aff('0x34')];if(!_0x5bd75a[_0x4aff('0x35')]['hasOwnProperty']('nolimit')){_0x13e62d[_0x4aff('0x1d')]=qs[_0x4aff('0x1d')](_0x5bd75a[_0x4aff('0x35')][_0x4aff('0x1d')]);_0x13e62d[_0x4aff('0x1c')]=qs[_0x4aff('0x1c')](_0x5bd75a[_0x4aff('0x35')][_0x4aff('0x1c')]);}_0x13e62d['order']=qs[_0x4aff('0x3b')](_0x5bd75a[_0x4aff('0x35')]['sort']);_0x13e62d[_0x4aff('0x3c')]=qs[_0x4aff('0x3d')](_['pick'](_0x5bd75a['query'],_0x1bd368[_0x4aff('0x3d')]),_0x143cf2);if(_0x5bd75a[_0x4aff('0x35')][_0x4aff('0x3e')]){_0x13e62d[_0x4aff('0x3c')]=_[_0x4aff('0x3f')](_0x13e62d[_0x4aff('0x3c')],{'$or':_[_0x4aff('0x2e')](_0x143cf2,function(_0x28e786){if(_0x28e786[_0x4aff('0x32')]!==_0x4aff('0x40')){var _0x5dd733={};_0x5dd733[_0x28e786[_0x4aff('0x2b')]]={'$like':'%'+_0x5bd75a[_0x4aff('0x35')][_0x4aff('0x3e')]+'%'};return _0x5dd733;}})});}_0x13e62d=_[_0x4aff('0x3f')]({},_0x13e62d,_0x5bd75a[_0x4aff('0x41')]);var _0xf0458c={'where':_0x13e62d[_0x4aff('0x3c')]};return db[_0x4aff('0x2f')][_0x4aff('0x1f')](_0xf0458c)[_0x4aff('0x26')](function(_0x5b7530){_0x4c72f5[_0x4aff('0x1f')]=_0x5b7530;if(_0x5bd75a[_0x4aff('0x35')][_0x4aff('0x42')]){_0x13e62d[_0x4aff('0x43')]=[{'all':!![]}];}return db[_0x4aff('0x2f')][_0x4aff('0x44')](_0x13e62d);})[_0x4aff('0x26')](function(_0x48d3da){_0x4c72f5[_0x4aff('0x45')]=_0x48d3da;return _0x4c72f5;})[_0x4aff('0x26')](respondWithFilteredResult(_0x1086b1,_0x13e62d))[_0x4aff('0x46')](handleError(_0x1086b1,null));};exports[_0x4aff('0x47')]=function(_0x53b6f4,_0x4abca3){var _0x590d16={'raw':!![],'where':{'id':_0x53b6f4[_0x4aff('0x48')]['id']}},_0x82a7e1={};_0x82a7e1[_0x4aff('0x34')]=_[_0x4aff('0x36')](db['MailSubstatus'][_0x4aff('0x30')]);_0x82a7e1[_0x4aff('0x35')]=_['keys'](_0x53b6f4[_0x4aff('0x35')]);_0x82a7e1[_0x4aff('0x3d')]=_['intersection'](_0x82a7e1[_0x4aff('0x34')],_0x82a7e1[_0x4aff('0x35')]);_0x590d16[_0x4aff('0x37')]=_[_0x4aff('0x38')](_0x82a7e1[_0x4aff('0x34')],qs[_0x4aff('0x39')](_0x53b6f4[_0x4aff('0x35')][_0x4aff('0x39')]));_0x590d16[_0x4aff('0x37')]=_0x590d16[_0x4aff('0x37')][_0x4aff('0x3a')]?_0x590d16[_0x4aff('0x37')]:_0x82a7e1[_0x4aff('0x34')];if(_0x53b6f4[_0x4aff('0x35')][_0x4aff('0x42')]){_0x590d16['include']=[{'all':!![]}];}_0x590d16=_[_0x4aff('0x3f')]({},_0x590d16,_0x53b6f4[_0x4aff('0x41')]);return db[_0x4aff('0x2f')][_0x4aff('0x49')](_0x590d16)['then'](handleEntityNotFound(_0x4abca3,null))[_0x4aff('0x26')](respondWithResult(_0x4abca3,null))[_0x4aff('0x46')](handleError(_0x4abca3,null));};exports['create']=function(_0x8d4c26,_0x336b9a){return db[_0x4aff('0x2f')]['create'](_0x8d4c26['body'],{})[_0x4aff('0x26')](respondWithResult(_0x336b9a,0xc9))[_0x4aff('0x46')](handleError(_0x336b9a,null));};exports[_0x4aff('0x25')]=function(_0x4c637c,_0x4cdf9d){if(_0x4c637c[_0x4aff('0x4a')]['id']){delete _0x4c637c['body']['id'];}return db[_0x4aff('0x2f')][_0x4aff('0x49')]({'where':{'id':_0x4c637c['params']['id']}})[_0x4aff('0x26')](handleEntityNotFound(_0x4cdf9d,null))[_0x4aff('0x26')](saveUpdates(_0x4c637c['body'],null))[_0x4aff('0x26')](respondWithResult(_0x4cdf9d,null))[_0x4aff('0x46')](handleError(_0x4cdf9d,null));};exports[_0x4aff('0x27')]=function(_0x14a557,_0x25024f){return db['MailSubstatus']['find']({'where':{'id':_0x14a557[_0x4aff('0x48')]['id']}})[_0x4aff('0x26')](handleEntityNotFound(_0x25024f,null))['then'](removeEntity(_0x25024f,null))[_0x4aff('0x46')](handleError(_0x25024f,null));};exports[_0x4aff('0x4b')]=function(_0x45c6c5,_0x28fff5){return db[_0x4aff('0x2f')][_0x4aff('0x4b')]()[_0x4aff('0x26')](respondWithResult(_0x28fff5,null))[_0x4aff('0x46')](handleError(_0x28fff5,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index d3cdaf1..141ec20 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 _0x95a1=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x2842b8,_0x414851){var _0x378ecb=function(_0x2c6319){while(--_0x2c6319){_0x2842b8['push'](_0x2842b8['shift']());}};_0x378ecb(++_0x414851);}(_0x95a1,0xcf));var _0x195a=function(_0x630f9b,_0x2e8d97){_0x630f9b=_0x630f9b-0x0;var _0x1d8b96=_0x95a1[_0x630f9b];return _0x1d8b96;};'use strict';var EventEmitter=require(_0x195a('0x0'));var MailSubstatus=require(_0x195a('0x1'))['db'][_0x195a('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x195a('0x3')](0x0);var events={'afterUpdate':_0x195a('0x4')};function emitEvent(_0x91e53){return function(_0x59c54f,_0x1ab491,_0x165d6a){MailSubstatusEvents['emit'](_0x91e53+':'+_0x59c54f['id'],_0x59c54f);MailSubstatusEvents[_0x195a('0x5')](_0x91e53,_0x59c54f);_0x165d6a(null);};}for(var e in events){if(events[_0x195a('0x6')](e)){var event=events[e];MailSubstatus[_0x195a('0x7')](e,emitEvent(event));}}module[_0x195a('0x8')]=MailSubstatusEvents; \ No newline at end of file +var _0xa80c=['emit','events','../../mysqldb','MailSubstatus','setMaxListeners','update'];(function(_0x1829c6,_0x4d98fd){var _0x19a7a0=function(_0x1292d5){while(--_0x1292d5){_0x1829c6['push'](_0x1829c6['shift']());}};_0x19a7a0(++_0x4d98fd);}(_0xa80c,0x1db));var _0xca80=function(_0x5c1de9,_0x16b37a){_0x5c1de9=_0x5c1de9-0x0;var _0x452529=_0xa80c[_0x5c1de9];return _0x452529;};'use strict';var EventEmitter=require(_0xca80('0x0'));var MailSubstatus=require(_0xca80('0x1'))['db'][_0xca80('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xca80('0x3')](0x0);var events={'afterUpdate':_0xca80('0x4')};function emitEvent(_0x563afb){return function(_0x36ada3,_0x3e3683,_0x30f9b3){MailSubstatusEvents[_0xca80('0x5')](_0x563afb+':'+_0x36ada3['id'],_0x36ada3);MailSubstatusEvents[_0xca80('0x5')](_0x563afb,_0x36ada3);_0x30f9b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index e7ee842..02b9d13 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 _0xce43=['./mailSubstatus.attributes','models','define','MailSubstatus','Condition','name','then','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce43,0x1e0));var _0x3ce4=function(_0xa2e2ea,_0x2ba4b0){_0xa2e2ea=_0xa2e2ea-0x0;var _0x4e5be3=_0xce43[_0xa2e2ea];return _0x4e5be3;};'use strict';var attributes=require(_0x3ce4('0x0'));module['exports']=function(_0x77868f){var _0x5b0943=_0x77868f[_0x3ce4('0x1')];return _0x77868f[_0x3ce4('0x2')](_0x3ce4('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1e2cfa,_0xfc8742,_0x59c69e){return _0x5b0943[_0x3ce4('0x4')]['update']({'value':_0x1e2cfa[_0x3ce4('0x5')]},{'where':{'field':'mailSubstatus','value':_0x1e2cfa['_previousDataValues']['name']}})[_0x3ce4('0x6')](function(){_0x59c69e();})[_0x3ce4('0x7')](function(_0xc8e48e){_0x59c69e(_0xc8e48e);});}}});}; \ No newline at end of file +var _0x85ee=['exports','define','MailSubstatus','mail_substatuses','Condition','update','name','then','catch'];(function(_0x2175e0,_0xcaf324){var _0x3d3572=function(_0x51d3e7){while(--_0x51d3e7){_0x2175e0['push'](_0x2175e0['shift']());}};_0x3d3572(++_0xcaf324);}(_0x85ee,0x18c));var _0xe85e=function(_0x3d208a,_0x3d24d4){_0x3d208a=_0x3d208a-0x0;var _0x4136aa=_0x85ee[_0x3d208a];return _0x4136aa;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xe85e('0x0')]=function(_0x2359c0){var _0x5e3d2e=_0x2359c0['models'];return _0x2359c0[_0xe85e('0x1')](_0xe85e('0x2'),attributes,{'tableName':_0xe85e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x34f71e,_0x5c27b8,_0x26df68){return _0x5e3d2e[_0xe85e('0x4')][_0xe85e('0x5')]({'value':_0x34f71e[_0xe85e('0x6')]},{'where':{'field':'mailSubstatus','value':_0x34f71e['_previousDataValues']['name']}})[_0xe85e('0x7')](function(){_0x26df68();})[_0xe85e('0x8')](function(_0xb86769){_0x26df68(_0xb86769);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1bd6842..8e1135f 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 _0x46aa=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x4ab67b,_0xced375){var _0x3a1e07=function(_0x55e442){while(--_0x55e442){_0x4ab67b['push'](_0x4ab67b['shift']());}};_0x3a1e07(++_0xced375);}(_0x46aa,0xcb));var _0xa46a=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x46aa[_0x2080a3];return _0x8d7d17;};'use strict';var _=require('lodash');var util=require(_0xa46a('0x0'));var moment=require('moment');var BPromise=require(_0xa46a('0x1'));var rs=require(_0xa46a('0x2'));var fs=require('fs');var Redis=require(_0xa46a('0x3'));var db=require(_0xa46a('0x4'))['db'];var utils=require(_0xa46a('0x5'));var logger=require(_0xa46a('0x6'))(_0xa46a('0x7'));var config=require(_0xa46a('0x8'));var jayson=require(_0xa46a('0x9'));var client=jayson[_0xa46a('0xa')][_0xa46a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3017db,_0x55b3b2,_0x425603){return new BPromise(function(_0x3385ff,_0x4f2bbf){return client[_0xa46a('0xc')](_0x3017db,_0x425603)['then'](function(_0x3413d1){logger[_0xa46a('0xd')](_0xa46a('0xe'),_0x55b3b2,_0xa46a('0xf'));logger[_0xa46a('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x55b3b2,_0xa46a('0xf'),JSON[_0xa46a('0x11')](_0x3413d1));if(_0x3413d1['error']){if(_0x3413d1[_0xa46a('0x12')][_0xa46a('0x13')]===0x1f4){logger[_0xa46a('0x12')](_0xa46a('0xe'),_0x55b3b2,_0x3413d1[_0xa46a('0x12')][_0xa46a('0x14')]);return _0x4f2bbf(_0x3413d1[_0xa46a('0x12')][_0xa46a('0x14')]);}logger[_0xa46a('0x12')](_0xa46a('0xe'),_0x55b3b2,_0x3413d1[_0xa46a('0x12')][_0xa46a('0x14')]);return _0x3385ff(_0x3413d1[_0xa46a('0x12')][_0xa46a('0x14')]);}else{logger[_0xa46a('0xd')](_0xa46a('0xe'),_0x55b3b2,_0xa46a('0xf'));_0x3385ff(_0x3413d1[_0xa46a('0x15')][_0xa46a('0x14')]);}})[_0xa46a('0x16')](function(_0x35c92c){logger[_0xa46a('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x55b3b2,_0x35c92c);_0x4f2bbf(_0x35c92c);});});} \ No newline at end of file +var _0x14b6=['stringify','error','code','message','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','request','then','info','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x294cb8,_0x4476c0){var _0x39f262=function(_0x51da2d){while(--_0x51da2d){_0x294cb8['push'](_0x294cb8['shift']());}};_0x39f262(++_0x4476c0);}(_0x14b6,0xbf));var _0x614b=function(_0x2272c4,_0x27d5ea){_0x2272c4=_0x2272c4-0x0;var _0x1f20e3=_0x14b6[_0x2272c4];return _0x1f20e3;};'use strict';var _=require(_0x614b('0x0'));var util=require(_0x614b('0x1'));var moment=require('moment');var BPromise=require(_0x614b('0x2'));var rs=require(_0x614b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x614b('0x4'))(_0x614b('0x5'));var config=require('../../config/environment');var jayson=require(_0x614b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x81d901,_0x546d43,_0x5d30db){return new BPromise(function(_0x3853eb,_0x52785a){return client[_0x614b('0x7')](_0x81d901,_0x5d30db)[_0x614b('0x8')](function(_0xa1f58e){logger[_0x614b('0x9')](_0x614b('0xa'),_0x546d43,'request\x20sent');logger['debug'](_0x614b('0xb'),_0x546d43,_0x614b('0xc'),JSON[_0x614b('0xd')](_0xa1f58e));if(_0xa1f58e['error']){if(_0xa1f58e[_0x614b('0xe')][_0x614b('0xf')]===0x1f4){logger[_0x614b('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x546d43,_0xa1f58e[_0x614b('0xe')][_0x614b('0x10')]);return _0x52785a(_0xa1f58e[_0x614b('0xe')]['message']);}logger['error'](_0x614b('0xa'),_0x546d43,_0xa1f58e[_0x614b('0xe')][_0x614b('0x10')]);return _0x3853eb(_0xa1f58e[_0x614b('0xe')][_0x614b('0x10')]);}else{logger[_0x614b('0x9')](_0x614b('0xa'),_0x546d43,_0x614b('0xc'));_0x3853eb(_0xa1f58e['result'][_0x614b('0x10')]);}})['catch'](function(_0x3739b3){logger[_0x614b('0xe')](_0x614b('0xa'),_0x546d43,_0x3739b3);_0x52785a(_0x3739b3);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index cc694fe..94ffe94 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 _0x0699=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/:id','show','put','update','delete'];(function(_0x222d1e,_0x1f1f52){var _0x5291d2=function(_0x159b9c){while(--_0x159b9c){_0x222d1e['push'](_0x222d1e['shift']());}};_0x5291d2(++_0x1f1f52);}(_0x0699,0x19a));var _0x9069=function(_0x32e13b,_0x7cf1e3){_0x32e13b=_0x32e13b-0x0;var _0xdd5fec=_0x0699[_0x32e13b];return _0xdd5fec;};'use strict';var multer=require(_0x9069('0x0'));var util=require(_0x9069('0x1'));var path=require(_0x9069('0x2'));var timeout=require(_0x9069('0x3'));var express=require(_0x9069('0x4'));var router=express[_0x9069('0x5')]();var fs_extra=require(_0x9069('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9069('0x7'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0x9069('0x8')]('/',auth[_0x9069('0x9')](),controller['index']);router[_0x9069('0x8')]('/describe',auth[_0x9069('0x9')](),controller['describe']);router[_0x9069('0x8')](_0x9069('0xa'),auth[_0x9069('0x9')](),controller[_0x9069('0xb')]);router['post']('/',auth[_0x9069('0x9')](),controller['create']);router[_0x9069('0xc')](_0x9069('0xa'),auth[_0x9069('0x9')](),controller[_0x9069('0xd')]);router[_0x9069('0xe')](_0x9069('0xa'),auth[_0x9069('0x9')](),controller[_0x9069('0xf')]);module[_0x9069('0x10')]=router; \ No newline at end of file +var _0xef2a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','exports','multer','util'];(function(_0x279eaa,_0x27deac){var _0x35278a=function(_0x48a82e){while(--_0x48a82e){_0x279eaa['push'](_0x279eaa['shift']());}};_0x35278a(++_0x27deac);}(_0xef2a,0x141));var _0xaef2=function(_0x1aabb4,_0x5543c1){_0x1aabb4=_0x1aabb4-0x0;var _0x44fe85=_0xef2a[_0x1aabb4];return _0x44fe85;};'use strict';var multer=require(_0xaef2('0x0'));var util=require(_0xaef2('0x1'));var path=require('path');var timeout=require(_0xaef2('0x2'));var express=require('express');var router=express[_0xaef2('0x3')]();var fs_extra=require(_0xaef2('0x4'));var auth=require(_0xaef2('0x5'));var interaction=require(_0xaef2('0x6'));var config=require(_0xaef2('0x7'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0xaef2('0x8')](),controller[_0xaef2('0x9')]);router[_0xaef2('0xa')](_0xaef2('0xb'),auth['isAuthenticated'](),controller[_0xaef2('0xc')]);router[_0xaef2('0xa')](_0xaef2('0xd'),auth[_0xaef2('0x8')](),controller['show']);router[_0xaef2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xaef2('0xf')](_0xaef2('0xd'),auth[_0xaef2('0x8')](),controller[_0xaef2('0x10')]);router[_0xaef2('0x11')](_0xaef2('0xd'),auth[_0xaef2('0x8')](),controller['destroy']);module[_0xaef2('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 5c3312c..126d646 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x46b3c4,_0x42fde4){var _0x3053cd=function(_0x581bfe){while(--_0x581bfe){_0x46b3c4['push'](_0x46b3c4['shift']());}};_0x3053cd(++_0x42fde4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3a33a1,_0x355f03){_0x3a33a1=_0x3a33a1-0x0;var _0x131086=_0xf4eb[_0x3a33a1];return _0x131086;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1fc4da,_0x41579e){var _0x4fd106=function(_0x2bea14){while(--_0x2bea14){_0x1fc4da['push'](_0x1fc4da['shift']());}};_0x4fd106(++_0x41579e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0xf3cd[_0x4b4277];return _0x1ff405;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 46f754e..2267675 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 _0x43ab=['then','sendStatus','error','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x2134b7,_0x1eb5e2){var _0x6c5914=function(_0x1da201){while(--_0x1da201){_0x2134b7['push'](_0x2134b7['shift']());}};_0x6c5914(++_0x1eb5e2);}(_0x43ab,0x77));var _0xb43a=function(_0x32ccea,_0x264f1a){_0x32ccea=_0x32ccea-0x0;var _0x18a8ed=_0x43ab[_0x32ccea];return _0x18a8ed;};'use strict';var emlformat=require(_0xb43a('0x0'));var rimraf=require(_0xb43a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb43a('0x2'));var rp=require('request-promise');var moment=require(_0xb43a('0x3'));var BPromise=require(_0xb43a('0x4'));var Mustache=require(_0xb43a('0x5'));var util=require(_0xb43a('0x6'));var path=require(_0xb43a('0x7'));var sox=require(_0xb43a('0x8'));var csv=require(_0xb43a('0x9'));var ejs=require(_0xb43a('0xa'));var fs=require('fs');var fs_extra=require(_0xb43a('0xb'));var _=require(_0xb43a('0xc'));var squel=require(_0xb43a('0xd'));var crypto=require(_0xb43a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb43a('0xf'));var toCsv=require(_0xb43a('0x9'));var querystring=require(_0xb43a('0x10'));var Papa=require(_0xb43a('0x11'));var Redis=require(_0xb43a('0x12'));var authService=require(_0xb43a('0x13'));var qs=require(_0xb43a('0x14'));var as=require(_0xb43a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb43a('0x16'))('api');var utils=require(_0xb43a('0x17'));var config=require(_0xb43a('0x18'));var licenseUtil=require(_0xb43a('0x19'));var db=require(_0xb43a('0x1a'))['db'];function respondWithStatusCode(_0x470f48,_0x5bd4f1){_0x5bd4f1=_0x5bd4f1||0xcc;return function(_0x27fc6d){if(_0x27fc6d){return _0x470f48['sendStatus'](_0x5bd4f1);}return _0x470f48[_0xb43a('0x1b')](_0x5bd4f1)[_0xb43a('0x1c')]();};}function respondWithResult(_0x27a25b,_0x193a2f){_0x193a2f=_0x193a2f||0xc8;return function(_0x8b40f1){if(_0x8b40f1){return _0x27a25b['status'](_0x193a2f)[_0xb43a('0x1d')](_0x8b40f1);}};}function respondWithFilteredResult(_0x2dc575,_0x1847f7){return function(_0x34bcc0){if(_0x34bcc0){var _0x29d8e9=typeof _0x1847f7['offset']===_0xb43a('0x1e')&&typeof _0x1847f7[_0xb43a('0x1f')]===_0xb43a('0x1e');var _0x105ebe=_0x34bcc0[_0xb43a('0x20')];var _0xf40a9=_0x29d8e9?0x0:_0x1847f7[_0xb43a('0x21')];var _0xab8e01=_0x29d8e9?_0x34bcc0['count']:_0x1847f7[_0xb43a('0x21')]+_0x1847f7[_0xb43a('0x1f')];var _0x33fd81;if(_0xab8e01>=_0x105ebe){_0xab8e01=_0x105ebe;_0x33fd81=0xc8;}else{_0x33fd81=0xce;}_0x2dc575[_0xb43a('0x1b')](_0x33fd81);return _0x2dc575[_0xb43a('0x22')](_0xb43a('0x23'),_0xf40a9+'-'+_0xab8e01+'/'+_0x105ebe)[_0xb43a('0x1d')](_0x34bcc0);}return null;};}function patchUpdates(_0x2267b4){return function(_0x372c3b){try{jsonpatch[_0xb43a('0x24')](_0x372c3b,_0x2267b4,!![]);}catch(_0x179de8){return BPromise[_0xb43a('0x25')](_0x179de8);}return _0x372c3b[_0xb43a('0x26')]();};}function saveUpdates(_0x20ed4b,_0x15c866){return function(_0x4a9bbc){if(_0x4a9bbc){return _0x4a9bbc[_0xb43a('0x27')](_0x20ed4b)['then'](function(_0x37d9cf){return _0x37d9cf;});}return null;};}function removeEntity(_0xbcd25,_0x5f3a9f){return function(_0xfcede8){if(_0xfcede8){return _0xfcede8[_0xb43a('0x28')]()[_0xb43a('0x29')](function(){_0xbcd25[_0xb43a('0x1b')](0xcc)[_0xb43a('0x1c')]();});}};}function handleEntityNotFound(_0x455943,_0x63ec8d){return function(_0x546d31){if(!_0x546d31){_0x455943[_0xb43a('0x2a')](0x194);}return _0x546d31;};}function handleError(_0x2fec87,_0x1f5587){_0x1f5587=_0x1f5587||0x1f4;return function(_0x241682){logger[_0xb43a('0x2b')](_0x241682['stack']);if(_0x241682[_0xb43a('0x2c')]){delete _0x241682[_0xb43a('0x2c')];}_0x2fec87[_0xb43a('0x1b')](_0x1f5587)[_0xb43a('0x2d')](_0x241682);};}exports[_0xb43a('0x2e')]=function(_0x24b464,_0x3f7c8c){var _0x17c99c={},_0x5daffb={},_0x53182c={'count':0x0,'rows':[]};var _0x3a648a=_[_0xb43a('0x2f')](db[_0xb43a('0x30')][_0xb43a('0x31')],function(_0x11d2d9){return{'name':_0x11d2d9[_0xb43a('0x32')],'type':_0x11d2d9[_0xb43a('0x33')][_0xb43a('0x34')]};});_0x5daffb[_0xb43a('0x35')]=_[_0xb43a('0x2f')](_0x3a648a,_0xb43a('0x2c'));_0x5daffb['query']=_[_0xb43a('0x36')](_0x24b464[_0xb43a('0x37')]);_0x5daffb[_0xb43a('0x38')]=_[_0xb43a('0x39')](_0x5daffb[_0xb43a('0x35')],_0x5daffb['query']);_0x17c99c[_0xb43a('0x3a')]=_[_0xb43a('0x39')](_0x5daffb[_0xb43a('0x35')],qs[_0xb43a('0x3b')](_0x24b464[_0xb43a('0x37')][_0xb43a('0x3b')]));_0x17c99c[_0xb43a('0x3a')]=_0x17c99c[_0xb43a('0x3a')][_0xb43a('0x3c')]?_0x17c99c[_0xb43a('0x3a')]:_0x5daffb[_0xb43a('0x35')];if(!_0x24b464[_0xb43a('0x37')][_0xb43a('0x3d')]('nolimit')){_0x17c99c['limit']=qs[_0xb43a('0x1f')](_0x24b464[_0xb43a('0x37')][_0xb43a('0x1f')]);_0x17c99c['offset']=qs[_0xb43a('0x21')](_0x24b464[_0xb43a('0x37')][_0xb43a('0x21')]);}_0x17c99c[_0xb43a('0x3e')]=qs['sort'](_0x24b464[_0xb43a('0x37')][_0xb43a('0x3f')]);_0x17c99c['where']=qs[_0xb43a('0x38')](_[_0xb43a('0x40')](_0x24b464[_0xb43a('0x37')],_0x5daffb[_0xb43a('0x38')]),_0x3a648a);if(_0x24b464[_0xb43a('0x37')][_0xb43a('0x41')]){_0x17c99c[_0xb43a('0x42')]=_['merge'](_0x17c99c[_0xb43a('0x42')],{'$or':_[_0xb43a('0x2f')](_0x3a648a,function(_0x1bc87d){if(_0x1bc87d[_0xb43a('0x33')]!==_0xb43a('0x43')){var _0x187aef={};_0x187aef[_0x1bc87d[_0xb43a('0x2c')]]={'$like':'%'+_0x24b464[_0xb43a('0x37')]['filter']+'%'};return _0x187aef;}})});}_0x17c99c=_[_0xb43a('0x44')]({},_0x17c99c,_0x24b464[_0xb43a('0x45')]);var _0x349019={'where':_0x17c99c['where']};return db[_0xb43a('0x30')][_0xb43a('0x20')](_0x349019)[_0xb43a('0x29')](function(_0x2087f3){_0x53182c[_0xb43a('0x20')]=_0x2087f3;if(_0x24b464[_0xb43a('0x37')]['includeAll']){_0x17c99c[_0xb43a('0x46')]=[{'all':!![]}];}return db[_0xb43a('0x30')][_0xb43a('0x47')](_0x17c99c);})['then'](function(_0x314918){_0x53182c[_0xb43a('0x48')]=_0x314918;return _0x53182c;})[_0xb43a('0x29')](respondWithFilteredResult(_0x3f7c8c,_0x17c99c))[_0xb43a('0x49')](handleError(_0x3f7c8c,null));};exports['show']=function(_0xbca35c,_0x3f0d76){var _0x520802={'raw':!![],'where':{'id':_0xbca35c[_0xb43a('0x4a')]['id']}},_0x5033b0={};_0x5033b0[_0xb43a('0x35')]=_['keys'](db[_0xb43a('0x30')][_0xb43a('0x31')]);_0x5033b0[_0xb43a('0x37')]=_[_0xb43a('0x36')](_0xbca35c[_0xb43a('0x37')]);_0x5033b0['filters']=_[_0xb43a('0x39')](_0x5033b0[_0xb43a('0x35')],_0x5033b0['query']);_0x520802[_0xb43a('0x3a')]=_[_0xb43a('0x39')](_0x5033b0[_0xb43a('0x35')],qs[_0xb43a('0x3b')](_0xbca35c[_0xb43a('0x37')][_0xb43a('0x3b')]));_0x520802[_0xb43a('0x3a')]=_0x520802[_0xb43a('0x3a')][_0xb43a('0x3c')]?_0x520802['attributes']:_0x5033b0[_0xb43a('0x35')];if(_0xbca35c[_0xb43a('0x37')][_0xb43a('0x4b')]){_0x520802[_0xb43a('0x46')]=[{'all':!![]}];}_0x520802=_[_0xb43a('0x44')]({},_0x520802,_0xbca35c[_0xb43a('0x45')]);return db[_0xb43a('0x30')][_0xb43a('0x4c')](_0x520802)[_0xb43a('0x29')](handleEntityNotFound(_0x3f0d76,null))[_0xb43a('0x29')](respondWithResult(_0x3f0d76,null))[_0xb43a('0x49')](handleError(_0x3f0d76,null));};exports[_0xb43a('0x4d')]=function(_0x3aa4be,_0x3119b8){return db[_0xb43a('0x30')][_0xb43a('0x4d')](_0x3aa4be[_0xb43a('0x4e')],{})['then'](respondWithResult(_0x3119b8,0xc9))[_0xb43a('0x49')](handleError(_0x3119b8,null));};exports[_0xb43a('0x27')]=function(_0x4345cc,_0x1d625c){if(_0x4345cc['body']['id']){delete _0x4345cc[_0xb43a('0x4e')]['id'];}return db[_0xb43a('0x30')][_0xb43a('0x4c')]({'where':{'id':_0x4345cc['params']['id']}})[_0xb43a('0x29')](handleEntityNotFound(_0x1d625c,null))[_0xb43a('0x29')](saveUpdates(_0x4345cc[_0xb43a('0x4e')],null))[_0xb43a('0x29')](respondWithResult(_0x1d625c,null))[_0xb43a('0x49')](handleError(_0x1d625c,null));};exports[_0xb43a('0x28')]=function(_0x324f50,_0x4b7767){return db[_0xb43a('0x30')][_0xb43a('0x4c')]({'where':{'id':_0x324f50['params']['id']}})[_0xb43a('0x29')](handleEntityNotFound(_0x4b7767,null))[_0xb43a('0x29')](removeEntity(_0x4b7767,null))[_0xb43a('0x49')](handleError(_0x4b7767,null));};exports[_0xb43a('0x4f')]=function(_0x262979,_0x4eeaac){return db['MailTransferReport'][_0xb43a('0x4f')]()[_0xb43a('0x29')](respondWithResult(_0x4eeaac,null))[_0xb43a('0x49')](handleError(_0x4eeaac,null));}; \ No newline at end of file +var _0xb4a3=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','error','stack','name','send','index','map','MailTransferReport','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','then','includeAll','include','findAll','show','find','catch','create','body','destroy','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0xa1e3c4,_0x1c4888){var _0x27ebb4=function(_0x3460ce){while(--_0x3460ce){_0xa1e3c4['push'](_0xa1e3c4['shift']());}};_0x27ebb4(++_0x1c4888);}(_0xb4a3,0x85));var _0x3b4a=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0xb4a3[_0x81f000];return _0x337aa2;};'use strict';var emlformat=require(_0x3b4a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b4a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3b4a('0x2'));var moment=require(_0x3b4a('0x3'));var BPromise=require(_0x3b4a('0x4'));var Mustache=require(_0x3b4a('0x5'));var util=require(_0x3b4a('0x6'));var path=require(_0x3b4a('0x7'));var sox=require('sox');var csv=require(_0x3b4a('0x8'));var ejs=require(_0x3b4a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b4a('0xa'));var squel=require(_0x3b4a('0xb'));var crypto=require(_0x3b4a('0xc'));var jsforce=require(_0x3b4a('0xd'));var deskjs=require(_0x3b4a('0xe'));var toCsv=require(_0x3b4a('0x8'));var querystring=require(_0x3b4a('0xf'));var Papa=require(_0x3b4a('0x10'));var Redis=require(_0x3b4a('0x11'));var authService=require(_0x3b4a('0x12'));var qs=require(_0x3b4a('0x13'));var as=require(_0x3b4a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b4a('0x15'))(_0x3b4a('0x16'));var utils=require('../../config/utils');var config=require(_0x3b4a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b4a('0x18'))['db'];function respondWithStatusCode(_0x18e2d2,_0x3be2c1){_0x3be2c1=_0x3be2c1||0xcc;return function(_0xebf15f){if(_0xebf15f){return _0x18e2d2[_0x3b4a('0x19')](_0x3be2c1);}return _0x18e2d2[_0x3b4a('0x1a')](_0x3be2c1)[_0x3b4a('0x1b')]();};}function respondWithResult(_0xd6d1ab,_0x3ccdf4){_0x3ccdf4=_0x3ccdf4||0xc8;return function(_0x5d0838){if(_0x5d0838){return _0xd6d1ab[_0x3b4a('0x1a')](_0x3ccdf4)['json'](_0x5d0838);}};}function respondWithFilteredResult(_0x7c052e,_0x474bc5){return function(_0x57fbe2){if(_0x57fbe2){var _0x17119f=typeof _0x474bc5['offset']===_0x3b4a('0x1c')&&typeof _0x474bc5[_0x3b4a('0x1d')]===_0x3b4a('0x1c');var _0x6678a7=_0x57fbe2['count'];var _0x30c191=_0x17119f?0x0:_0x474bc5['offset'];var _0xf4085=_0x17119f?_0x57fbe2[_0x3b4a('0x1e')]:_0x474bc5[_0x3b4a('0x1f')]+_0x474bc5[_0x3b4a('0x1d')];var _0x595ff7;if(_0xf4085>=_0x6678a7){_0xf4085=_0x6678a7;_0x595ff7=0xc8;}else{_0x595ff7=0xce;}_0x7c052e[_0x3b4a('0x1a')](_0x595ff7);return _0x7c052e[_0x3b4a('0x20')]('Content-Range',_0x30c191+'-'+_0xf4085+'/'+_0x6678a7)[_0x3b4a('0x21')](_0x57fbe2);}return null;};}function patchUpdates(_0x25709e){return function(_0x109ed7){try{jsonpatch[_0x3b4a('0x22')](_0x109ed7,_0x25709e,!![]);}catch(_0x2f005c){return BPromise[_0x3b4a('0x23')](_0x2f005c);}return _0x109ed7[_0x3b4a('0x24')]();};}function saveUpdates(_0x4e477b,_0x5dff72){return function(_0x5dfad2){if(_0x5dfad2){return _0x5dfad2[_0x3b4a('0x25')](_0x4e477b)['then'](function(_0x299263){return _0x299263;});}return null;};}function removeEntity(_0x12e020,_0x3aadb9){return function(_0x41f4d1){if(_0x41f4d1){return _0x41f4d1['destroy']()['then'](function(){_0x12e020[_0x3b4a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ae88a,_0x379709){return function(_0x221832){if(!_0x221832){_0x3ae88a[_0x3b4a('0x19')](0x194);}return _0x221832;};}function handleError(_0x5a6486,_0x56befb){_0x56befb=_0x56befb||0x1f4;return function(_0x28c21f){logger[_0x3b4a('0x26')](_0x28c21f[_0x3b4a('0x27')]);if(_0x28c21f[_0x3b4a('0x28')]){delete _0x28c21f['name'];}_0x5a6486[_0x3b4a('0x1a')](_0x56befb)[_0x3b4a('0x29')](_0x28c21f);};}exports[_0x3b4a('0x2a')]=function(_0x51a7d8,_0x34beb5){var _0x12c153={},_0xe4518d={},_0x249b0d={'count':0x0,'rows':[]};var _0x2f31ac=_[_0x3b4a('0x2b')](db[_0x3b4a('0x2c')]['rawAttributes'],function(_0x3831ae){return{'name':_0x3831ae['fieldName'],'type':_0x3831ae[_0x3b4a('0x2d')][_0x3b4a('0x2e')]};});_0xe4518d[_0x3b4a('0x2f')]=_['map'](_0x2f31ac,'name');_0xe4518d[_0x3b4a('0x30')]=_[_0x3b4a('0x31')](_0x51a7d8[_0x3b4a('0x30')]);_0xe4518d['filters']=_[_0x3b4a('0x32')](_0xe4518d['model'],_0xe4518d[_0x3b4a('0x30')]);_0x12c153[_0x3b4a('0x33')]=_[_0x3b4a('0x32')](_0xe4518d[_0x3b4a('0x2f')],qs['fields'](_0x51a7d8['query'][_0x3b4a('0x34')]));_0x12c153[_0x3b4a('0x33')]=_0x12c153['attributes'][_0x3b4a('0x35')]?_0x12c153['attributes']:_0xe4518d[_0x3b4a('0x2f')];if(!_0x51a7d8[_0x3b4a('0x30')][_0x3b4a('0x36')](_0x3b4a('0x37'))){_0x12c153[_0x3b4a('0x1d')]=qs[_0x3b4a('0x1d')](_0x51a7d8[_0x3b4a('0x30')]['limit']);_0x12c153[_0x3b4a('0x1f')]=qs[_0x3b4a('0x1f')](_0x51a7d8[_0x3b4a('0x30')][_0x3b4a('0x1f')]);}_0x12c153['order']=qs[_0x3b4a('0x38')](_0x51a7d8[_0x3b4a('0x30')]['sort']);_0x12c153[_0x3b4a('0x39')]=qs['filters'](_[_0x3b4a('0x3a')](_0x51a7d8['query'],_0xe4518d[_0x3b4a('0x3b')]),_0x2f31ac);if(_0x51a7d8[_0x3b4a('0x30')][_0x3b4a('0x3c')]){_0x12c153['where']=_['merge'](_0x12c153[_0x3b4a('0x39')],{'$or':_[_0x3b4a('0x2b')](_0x2f31ac,function(_0xfc5cfc){if(_0xfc5cfc[_0x3b4a('0x2d')]!=='VIRTUAL'){var _0x1287f6={};_0x1287f6[_0xfc5cfc['name']]={'$like':'%'+_0x51a7d8[_0x3b4a('0x30')][_0x3b4a('0x3c')]+'%'};return _0x1287f6;}})});}_0x12c153=_[_0x3b4a('0x3d')]({},_0x12c153,_0x51a7d8[_0x3b4a('0x3e')]);var _0x2b4519={'where':_0x12c153['where']};return db[_0x3b4a('0x2c')][_0x3b4a('0x1e')](_0x2b4519)[_0x3b4a('0x3f')](function(_0x447f42){_0x249b0d['count']=_0x447f42;if(_0x51a7d8[_0x3b4a('0x30')][_0x3b4a('0x40')]){_0x12c153[_0x3b4a('0x41')]=[{'all':!![]}];}return db[_0x3b4a('0x2c')][_0x3b4a('0x42')](_0x12c153);})['then'](function(_0x5982fe){_0x249b0d['rows']=_0x5982fe;return _0x249b0d;})[_0x3b4a('0x3f')](respondWithFilteredResult(_0x34beb5,_0x12c153))['catch'](handleError(_0x34beb5,null));};exports[_0x3b4a('0x43')]=function(_0x21f28b,_0x309016){var _0x1878d8={'raw':!![],'where':{'id':_0x21f28b['params']['id']}},_0x2d1708={};_0x2d1708[_0x3b4a('0x2f')]=_[_0x3b4a('0x31')](db[_0x3b4a('0x2c')]['rawAttributes']);_0x2d1708[_0x3b4a('0x30')]=_[_0x3b4a('0x31')](_0x21f28b[_0x3b4a('0x30')]);_0x2d1708[_0x3b4a('0x3b')]=_['intersection'](_0x2d1708[_0x3b4a('0x2f')],_0x2d1708[_0x3b4a('0x30')]);_0x1878d8[_0x3b4a('0x33')]=_[_0x3b4a('0x32')](_0x2d1708[_0x3b4a('0x2f')],qs['fields'](_0x21f28b[_0x3b4a('0x30')][_0x3b4a('0x34')]));_0x1878d8['attributes']=_0x1878d8[_0x3b4a('0x33')][_0x3b4a('0x35')]?_0x1878d8[_0x3b4a('0x33')]:_0x2d1708[_0x3b4a('0x2f')];if(_0x21f28b['query'][_0x3b4a('0x40')]){_0x1878d8['include']=[{'all':!![]}];}_0x1878d8=_[_0x3b4a('0x3d')]({},_0x1878d8,_0x21f28b['options']);return db[_0x3b4a('0x2c')][_0x3b4a('0x44')](_0x1878d8)['then'](handleEntityNotFound(_0x309016,null))[_0x3b4a('0x3f')](respondWithResult(_0x309016,null))[_0x3b4a('0x45')](handleError(_0x309016,null));};exports[_0x3b4a('0x46')]=function(_0x5deffe,_0x41a75e){return db['MailTransferReport'][_0x3b4a('0x46')](_0x5deffe['body'],{})[_0x3b4a('0x3f')](respondWithResult(_0x41a75e,0xc9))[_0x3b4a('0x45')](handleError(_0x41a75e,null));};exports['update']=function(_0xaefb74,_0x5ddbc2){if(_0xaefb74['body']['id']){delete _0xaefb74[_0x3b4a('0x47')]['id'];}return db[_0x3b4a('0x2c')][_0x3b4a('0x44')]({'where':{'id':_0xaefb74['params']['id']}})[_0x3b4a('0x3f')](handleEntityNotFound(_0x5ddbc2,null))[_0x3b4a('0x3f')](saveUpdates(_0xaefb74[_0x3b4a('0x47')],null))[_0x3b4a('0x3f')](respondWithResult(_0x5ddbc2,null))[_0x3b4a('0x45')](handleError(_0x5ddbc2,null));};exports[_0x3b4a('0x48')]=function(_0x2d6fe9,_0x382897){return db[_0x3b4a('0x2c')]['find']({'where':{'id':_0x2d6fe9[_0x3b4a('0x49')]['id']}})[_0x3b4a('0x3f')](handleEntityNotFound(_0x382897,null))[_0x3b4a('0x3f')](removeEntity(_0x382897,null))[_0x3b4a('0x45')](handleError(_0x382897,null));};exports['describe']=function(_0x33b9c8,_0x3a180e){return db[_0x3b4a('0x2c')][_0x3b4a('0x4a')]()[_0x3b4a('0x3f')](respondWithResult(_0x3a180e,null))['catch'](handleError(_0x3a180e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index a36a4ae..0fbe8d9 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 _0x77d9=['MailTransferReport','report_mail_transfer','uniqueid','moment','bluebird','path','rimraf','./mailTransferReport.attributes','exports'];(function(_0x5b3c8f,_0x1f2910){var _0x104176=function(_0x454b78){while(--_0x454b78){_0x5b3c8f['push'](_0x5b3c8f['shift']());}};_0x104176(++_0x1f2910);}(_0x77d9,0x159));var _0x977d=function(_0x45b5bd,_0x1b2655){_0x45b5bd=_0x45b5bd-0x0;var _0x1af8bb=_0x77d9[_0x45b5bd];return _0x1af8bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x977d('0x0'));var BPromise=require(_0x977d('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x977d('0x2'));var rimraf=require(_0x977d('0x3'));var config=require('../../config/environment');var attributes=require(_0x977d('0x4'));module[_0x977d('0x5')]=function(_0x4852b4,_0x35a1bd){return _0x4852b4['define'](_0x977d('0x6'),attributes,{'tableName':_0x977d('0x7'),'paranoid':![],'indexes':[{'name':_0x977d('0x8'),'fields':[_0x977d('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x44f6=['request-promise','path','rimraf','../../config/environment','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x192959,_0x27f6bf){var _0x1ae5b0=function(_0x26e33f){while(--_0x26e33f){_0x192959['push'](_0x192959['shift']());}};_0x1ae5b0(++_0x27f6bf);}(_0x44f6,0xa4));var _0x644f=function(_0x402731,_0x43c115){_0x402731=_0x402731-0x0;var _0x111736=_0x44f6[_0x402731];return _0x111736;};'use strict';var _=require(_0x644f('0x0'));var util=require(_0x644f('0x1'));var logger=require(_0x644f('0x2'))(_0x644f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x644f('0x4'));var fs=require('fs');var path=require(_0x644f('0x5'));var rimraf=require(_0x644f('0x6'));var config=require(_0x644f('0x7'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x1839b8,_0xb6b9b5){return _0x1839b8[_0x644f('0x8')](_0x644f('0x9'),attributes,{'tableName':_0x644f('0xa'),'paranoid':![],'indexes':[{'name':_0x644f('0xb'),'fields':[_0x644f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 5a3c634..c14735e 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 _0x7890=['http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x568298,_0x2380c7){var _0xfec669=function(_0x2f7e4d){while(--_0x2f7e4d){_0x568298['push'](_0x568298['shift']());}};_0xfec669(++_0x2380c7);}(_0x7890,0x1d7));var _0x0789=function(_0x27c12c,_0x2d10b6){_0x27c12c=_0x27c12c-0x0;var _0x27e2f5=_0x7890[_0x27c12c];return _0x27e2f5;};'use strict';var _=require(_0x0789('0x0'));var util=require(_0x0789('0x1'));var moment=require('moment');var BPromise=require(_0x0789('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0789('0x3'));var db=require(_0x0789('0x4'))['db'];var utils=require(_0x0789('0x5'));var logger=require(_0x0789('0x6'))(_0x0789('0x7'));var config=require('../../config/environment');var jayson=require(_0x0789('0x8'));var client=jayson['client'][_0x0789('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2882be,_0x17f78a,_0x4b25ab){return new BPromise(function(_0x53329d,_0x31fdf9){return client[_0x0789('0xa')](_0x2882be,_0x4b25ab)['then'](function(_0x430f30){logger[_0x0789('0xb')](_0x0789('0xc'),_0x17f78a,_0x0789('0xd'));logger[_0x0789('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x17f78a,_0x0789('0xd'),JSON[_0x0789('0xf')](_0x430f30));if(_0x430f30['error']){if(_0x430f30[_0x0789('0x10')][_0x0789('0x11')]===0x1f4){logger[_0x0789('0x10')](_0x0789('0xc'),_0x17f78a,_0x430f30['error'][_0x0789('0x12')]);return _0x31fdf9(_0x430f30[_0x0789('0x10')][_0x0789('0x12')]);}logger[_0x0789('0x10')](_0x0789('0xc'),_0x17f78a,_0x430f30[_0x0789('0x10')][_0x0789('0x12')]);return _0x53329d(_0x430f30[_0x0789('0x10')][_0x0789('0x12')]);}else{logger[_0x0789('0xb')](_0x0789('0xc'),_0x17f78a,_0x0789('0xd'));_0x53329d(_0x430f30[_0x0789('0x13')]['message']);}})['catch'](function(_0x395a4d){logger[_0x0789('0x10')](_0x0789('0xc'),_0x17f78a,_0x395a4d);_0x31fdf9(_0x395a4d);});});} \ No newline at end of file +var _0xd331=['randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd331,0x14e));var _0x1d33=function(_0x2a51b7,_0x98a72e){_0x2a51b7=_0x2a51b7-0x0;var _0x43b0e7=_0xd331[_0x2a51b7];return _0x43b0e7;};'use strict';var _=require('lodash');var util=require(_0x1d33('0x0'));var moment=require('moment');var BPromise=require(_0x1d33('0x1'));var rs=require(_0x1d33('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d33('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1d33('0x4'));var config=require(_0x1d33('0x5'));var jayson=require(_0x1d33('0x6'));var client=jayson[_0x1d33('0x7')][_0x1d33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53c5d8,_0x6fa9b7,_0x9c2353){return new BPromise(function(_0x55051b,_0x4df192){return client['request'](_0x53c5d8,_0x9c2353)[_0x1d33('0x9')](function(_0x3ae292){logger['info'](_0x1d33('0xa'),_0x6fa9b7,_0x1d33('0xb'));logger[_0x1d33('0xc')](_0x1d33('0xd'),_0x6fa9b7,'request\x20sent',JSON[_0x1d33('0xe')](_0x3ae292));if(_0x3ae292[_0x1d33('0xf')]){if(_0x3ae292[_0x1d33('0xf')][_0x1d33('0x10')]===0x1f4){logger[_0x1d33('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x6fa9b7,_0x3ae292[_0x1d33('0xf')]['message']);return _0x4df192(_0x3ae292[_0x1d33('0xf')]['message']);}logger[_0x1d33('0xf')](_0x1d33('0xa'),_0x6fa9b7,_0x3ae292['error']['message']);return _0x55051b(_0x3ae292[_0x1d33('0xf')][_0x1d33('0x11')]);}else{logger[_0x1d33('0x12')](_0x1d33('0xa'),_0x6fa9b7,_0x1d33('0xb'));_0x55051b(_0x3ae292[_0x1d33('0x13')][_0x1d33('0x11')]);}})[_0x1d33('0x14')](function(_0x58006b){logger[_0x1d33('0xf')](_0x1d33('0xa'),_0x6fa9b7,_0x58006b);_0x4df192(_0x58006b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index cdb2d57..e1ddcf3 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 _0xde99=['describe','/:id','create','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','index','get','/describe','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xde99,0xd2));var _0x9de9=function(_0xae405e,_0x5b05d8){_0xae405e=_0xae405e-0x0;var _0x31ac9d=_0xde99[_0xae405e];return _0x31ac9d;};'use strict';var multer=require(_0x9de9('0x0'));var util=require(_0x9de9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9de9('0x2')]();var fs_extra=require(_0x9de9('0x3'));var auth=require(_0x9de9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9de9('0x5'));var controller=require(_0x9de9('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9de9('0x7')]);router[_0x9de9('0x8')](_0x9de9('0x9'),auth[_0x9de9('0xa')](),controller[_0x9de9('0xb')]);router[_0x9de9('0x8')](_0x9de9('0xc'),auth[_0x9de9('0xa')](),controller['show']);router['post']('/',auth[_0x9de9('0xa')](),controller[_0x9de9('0xd')]);router['put'](_0x9de9('0xc'),auth[_0x9de9('0xa')](),controller[_0x9de9('0xe')]);router['delete']('/:id',auth[_0x9de9('0xa')](),controller[_0x9de9('0xf')]);module[_0x9de9('0x10')]=router; \ No newline at end of file +var _0xf6b9=['express','Router','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','update','delete','destroy','exports','multer','path'];(function(_0x4330d0,_0x21b683){var _0x173338=function(_0x59bd21){while(--_0x59bd21){_0x4330d0['push'](_0x4330d0['shift']());}};_0x173338(++_0x21b683);}(_0xf6b9,0x116));var _0x9f6b=function(_0x296b07,_0x4e89c3){_0x296b07=_0x296b07-0x0;var _0x5dfc2d=_0xf6b9[_0x296b07];return _0x5dfc2d;};'use strict';var multer=require(_0x9f6b('0x0'));var util=require('util');var path=require(_0x9f6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f6b('0x2'));var router=express[_0x9f6b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9f6b('0x4'));var config=require(_0x9f6b('0x5'));var controller=require(_0x9f6b('0x6'));router['get']('/',auth[_0x9f6b('0x7')](),controller[_0x9f6b('0x8')]);router['get'](_0x9f6b('0x9'),auth['isAuthenticated'](),controller[_0x9f6b('0xa')]);router[_0x9f6b('0xb')](_0x9f6b('0xc'),auth[_0x9f6b('0x7')](),controller[_0x9f6b('0xd')]);router[_0x9f6b('0xe')]('/',auth['isAuthenticated'](),controller[_0x9f6b('0xf')]);router['put'](_0x9f6b('0xc'),auth['isAuthenticated'](),controller[_0x9f6b('0x10')]);router[_0x9f6b('0x11')]('/:id',auth[_0x9f6b('0x7')](),controller[_0x9f6b('0x12')]);module[_0x9f6b('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index b79e4eb..ecb37de 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 _0xa6f8=['moment','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','sequelize'];(function(_0x455ed1,_0x22bcd6){var _0x4e6145=function(_0x561519){while(--_0x561519){_0x455ed1['push'](_0x455ed1['shift']());}};_0x4e6145(++_0x22bcd6);}(_0xa6f8,0xfe));var _0x8a6f=function(_0x2aef75,_0x13edab){_0x2aef75=_0x2aef75-0x0;var _0x26e106=_0xa6f8[_0x2aef75];return _0x26e106;};'use strict';var Sequelize=require(_0x8a6f('0x0'));var moment=require(_0x8a6f('0x1'));module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8a6f('0x2')]},'interface':{'type':Sequelize[_0x8a6f('0x2')]},'type':{'type':Sequelize[_0x8a6f('0x2')],'defaultValue':_0x8a6f('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x8a6f('0x4')]},'enterAt':{'type':Sequelize[_0x8a6f('0x5')]},'exitAt':{'type':Sequelize[_0x8a6f('0x5')],'set':function(_0x188a04){var _0x3a0b86=moment(_0x188a04);var _0x19a89c=moment(this['getDataValue'](_0x8a6f('0x6')));var _0x2e0d63=_0x3a0b86[_0x8a6f('0x7')](_0x19a89c,_0x8a6f('0x8'));this[_0x8a6f('0x9')](_0x8a6f('0xa'),_0x188a04);this[_0x8a6f('0x9')](_0x8a6f('0xb'),_0x2e0d63>=0x0?_0x2e0d63:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x8a6f('0xc')},'data2':{'type':Sequelize[_0x8a6f('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x8a6f('0x2')],'comment':_0x8a6f('0xd')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x8a6f('0x2')],'comment':_0x8a6f('0xe')},'role':{'type':Sequelize[_0x8a6f('0x2')]},'internal':{'type':Sequelize[_0x8a6f('0x4')]},'uniqueid':{'type':Sequelize[_0x8a6f('0x2')]}}; \ No newline at end of file +var _0x5890=['DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x4e70f1,_0xdcebef){var _0x9d6d65=function(_0xcd7e10){while(--_0xcd7e10){_0x4e70f1['push'](_0x4e70f1['shift']());}};_0x9d6d65(++_0xdcebef);}(_0x5890,0x175));var _0x0589=function(_0x42740a,_0x174fba){_0x42740a=_0x42740a-0x0;var _0x482fd2=_0x5890[_0x42740a];return _0x482fd2;};'use strict';var Sequelize=require(_0x0589('0x0'));var moment=require(_0x0589('0x1'));module[_0x0589('0x2')]={'channel':{'type':Sequelize[_0x0589('0x3')]},'membername':{'type':Sequelize[_0x0589('0x3')]},'interface':{'type':Sequelize[_0x0589('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x0589('0x4'),'comment':_0x0589('0x5')},'duration':{'type':Sequelize[_0x0589('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0589('0x7')],'set':function(_0xbf4be0){var _0x292440=moment(_0xbf4be0);var _0x2c30cf=moment(this[_0x0589('0x8')](_0x0589('0x9')));var _0x161e85=_0x292440['diff'](_0x2c30cf,_0x0589('0xa'));this[_0x0589('0xb')](_0x0589('0xc'),_0xbf4be0);this['setDataValue'](_0x0589('0xd'),_0x161e85>=0x0?_0x161e85:null);}},'data1':{'type':Sequelize[_0x0589('0x3')],'comment':_0x0589('0xe')},'data2':{'type':Sequelize[_0x0589('0x3')],'comment':_0x0589('0xf')},'data3':{'type':Sequelize[_0x0589('0x3')],'comment':_0x0589('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0x0589('0x11')},'data5':{'type':Sequelize[_0x0589('0x3')],'comment':_0x0589('0x12')},'role':{'type':Sequelize[_0x0589('0x3')]},'internal':{'type':Sequelize[_0x0589('0x6')]},'uniqueid':{'type':Sequelize[_0x0589('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 011fbdf..47a7f18 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(_0x54abca,_0x105466){var _0x83d195=function(_0x58030e){while(--_0x58030e){_0x54abca['push'](_0x54abca['shift']());}};_0x83d195(++_0x105466);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['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 _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(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index b760fbe..97cf9d8 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 _0xad1a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad1a,0xff));var _0xaad1=function(_0x53599c,_0x4db58f){_0x53599c=_0x53599c-0x0;var _0x4aef5b=_0xad1a[_0x53599c];return _0x4aef5b;};'use strict';var _=require(_0xaad1('0x0'));var util=require(_0xaad1('0x1'));var logger=require(_0xaad1('0x2'))(_0xaad1('0x3'));var moment=require(_0xaad1('0x4'));var BPromise=require(_0xaad1('0x5'));var rp=require(_0xaad1('0x6'));var fs=require('fs');var path=require(_0xaad1('0x7'));var rimraf=require(_0xaad1('0x8'));var config=require(_0xaad1('0x9'));var attributes=require(_0xaad1('0xa'));module[_0xaad1('0xb')]=function(_0x441674,_0x3ca469){return _0x441674['define'](_0xaad1('0xc'),attributes,{'tableName':_0xaad1('0xd'),'paranoid':![],'indexes':[{'name':_0xaad1('0xe'),'fields':[_0xaad1('0xf'),_0xaad1('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1ecb=['membername','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface'];(function(_0x609988,_0x507944){var _0x159984=function(_0x39d9ce){while(--_0x39d9ce){_0x609988['push'](_0x609988['shift']());}};_0x159984(++_0x507944);}(_0x1ecb,0xb5));var _0xb1ec=function(_0x2f1ac4,_0x175bb4){_0x2f1ac4=_0x2f1ac4-0x0;var _0x201194=_0x1ecb[_0x2f1ac4];return _0x201194;};'use strict';var _=require(_0xb1ec('0x0'));var util=require(_0xb1ec('0x1'));var logger=require(_0xb1ec('0x2'))(_0xb1ec('0x3'));var moment=require(_0xb1ec('0x4'));var BPromise=require(_0xb1ec('0x5'));var rp=require(_0xb1ec('0x6'));var fs=require('fs');var path=require(_0xb1ec('0x7'));var rimraf=require('rimraf');var config=require(_0xb1ec('0x8'));var attributes=require(_0xb1ec('0x9'));module['exports']=function(_0x93af7b,_0x34770e){return _0x93af7b[_0xb1ec('0xa')](_0xb1ec('0xb'),attributes,{'tableName':_0xb1ec('0xc'),'paranoid':![],'indexes':[{'name':_0xb1ec('0xd'),'fields':[_0xb1ec('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index efcf992..9b9297d 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 _0x7ee1=['UpdateMemberReport','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','MemberReport','findAll','options','raw','attributes','limit','include','map','model','info','CreateMemberReport','create','body','debug'];(function(_0x4a206b,_0x465355){var _0x421e75=function(_0x21202e){while(--_0x21202e){_0x4a206b['push'](_0x4a206b['shift']());}};_0x421e75(++_0x465355);}(_0x7ee1,0x8d));var _0x17ee=function(_0x274260,_0x450d4d){_0x274260=_0x274260-0x0;var _0x1bfd09=_0x7ee1[_0x274260];return _0x1bfd09;};'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']('MemberReport,\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']('MemberReport,\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);});});}exports[_0x17ee('0x13')]=function(_0x63d27f){var _0x587ca7=this;return new Promise(function(_0x44fe58,_0x1118a3){return db[_0x17ee('0x14')][_0x17ee('0x15')]({'raw':_0x63d27f[_0x17ee('0x16')]?_0x63d27f['options'][_0x17ee('0x17')]===undefined?!![]:![]:!![],'where':_0x63d27f['options']?_0x63d27f[_0x17ee('0x16')]['where']||null:null,'attributes':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x18')]||null:null,'limit':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x19')]||null:null,'include':_0x63d27f[_0x17ee('0x16')]?_0x63d27f[_0x17ee('0x16')][_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x63d27f[_0x17ee('0x16')]['include'],function(_0x4b7bfe){return{'model':db[_0x4b7bfe[_0x17ee('0x1c')]],'as':_0x4b7bfe['as'],'attributes':_0x4b7bfe[_0x17ee('0x18')],'include':_0x4b7bfe[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0x4b7bfe[_0x17ee('0x1a')],function(_0xea358f){return{'model':db[_0xea358f[_0x17ee('0x1c')]],'as':_0xea358f['as'],'attributes':_0xea358f[_0x17ee('0x18')],'include':_0xea358f[_0x17ee('0x1a')]?_[_0x17ee('0x1b')](_0xea358f[_0x17ee('0x1a')],function(_0x2a332f){return{'model':db[_0x2a332f['model']],'as':_0x2a332f['as'],'attributes':_0x2a332f[_0x17ee('0x18')]};}):[]};}):[]};}):[]:[]})[_0x17ee('0xa')](function(_0x11ce7e){logger[_0x17ee('0x1d')](_0x17ee('0x13'),_0x63d27f);logger['debug'](_0x17ee('0x13'),_0x63d27f,JSON[_0x17ee('0xd')](_0x11ce7e));_0x44fe58(_0x11ce7e);})[_0x17ee('0x12')](function(_0x4c461b){logger[_0x17ee('0xe')](_0x17ee('0x13'),_0x4c461b['message'],_0x63d27f);_0x1118a3(_0x587ca7[_0x17ee('0xe')](0x1f4,_0x4c461b['message']));});});};exports[_0x17ee('0x1e')]=function(_0x5a44c4){var _0x141ac9=this;return new Promise(function(_0x23ca2e,_0x373c20){return db['MemberReport'][_0x17ee('0x1f')](_0x5a44c4[_0x17ee('0x20')],{'raw':_0x5a44c4['options']?_0x5a44c4[_0x17ee('0x16')][_0x17ee('0x17')]===undefined?!![]:![]:!![]})[_0x17ee('0xa')](function(_0x4bb5cb){logger['info'](_0x17ee('0x1e'),_0x5a44c4);logger[_0x17ee('0x21')](_0x17ee('0x1e'),_0x5a44c4,JSON[_0x17ee('0xd')](_0x4bb5cb));_0x23ca2e(_0x4bb5cb);})['catch'](function(_0x59bc6f){logger[_0x17ee('0xe')](_0x17ee('0x1e'),_0x59bc6f[_0x17ee('0x11')],_0x5a44c4);_0x373c20(_0x141ac9[_0x17ee('0xe')](0x1f4,_0x59bc6f[_0x17ee('0x11')]));});});};exports[_0x17ee('0x22')]=function(_0x150e99){var _0x54fbd6=this;return new Promise(function(_0x4a6bc9,_0x55330a){return db[_0x17ee('0x14')]['update'](_0x150e99[_0x17ee('0x20')],{'raw':_0x150e99[_0x17ee('0x16')]?_0x150e99[_0x17ee('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x150e99[_0x17ee('0x16')]?_0x150e99[_0x17ee('0x16')]['where']||null:null,'attributes':_0x150e99['options']?_0x150e99[_0x17ee('0x16')][_0x17ee('0x18')]||null:null,'limit':_0x150e99[_0x17ee('0x16')]?_0x150e99[_0x17ee('0x16')][_0x17ee('0x19')]||null:null})['then'](function(_0x52215a){logger[_0x17ee('0x1d')](_0x17ee('0x22'),_0x150e99);logger[_0x17ee('0x21')](_0x17ee('0x22'),_0x150e99,JSON[_0x17ee('0xd')](_0x52215a));_0x4a6bc9(_0x52215a);})[_0x17ee('0x12')](function(_0x4bb35b){logger['error'](_0x17ee('0x22'),_0x4bb35b[_0x17ee('0x11')],_0x150e99);_0x55330a(_0x54fbd6[_0x17ee('0xe')](0x1f4,_0x4bb35b[_0x17ee('0x11')]));});});}; \ No newline at end of file +var _0x2bae=['debug','stringify','error','code','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','then','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','info','MemberReport,\x20%s,\x20%s','request\x20sent'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2ba('0x0'));var util=require(_0xe2ba('0x1'));var moment=require(_0xe2ba('0x2'));var BPromise=require(_0xe2ba('0x3'));var rs=require(_0xe2ba('0x4'));var fs=require('fs');var Redis=require(_0xe2ba('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe2ba('0x6'));var logger=require('../../config/logger')(_0xe2ba('0x7'));var config=require('../../config/environment');var jayson=require(_0xe2ba('0x8'));var client=jayson[_0xe2ba('0x9')][_0xe2ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4933a0,_0x23a917,_0x21076b){return new BPromise(function(_0x12be92,_0x3d5a86){return client['request'](_0x4933a0,_0x21076b)['then'](function(_0xe703bc){logger[_0xe2ba('0xb')](_0xe2ba('0xc'),_0x23a917,_0xe2ba('0xd'));logger[_0xe2ba('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x23a917,_0xe2ba('0xd'),JSON[_0xe2ba('0xf')](_0xe703bc));if(_0xe703bc[_0xe2ba('0x10')]){if(_0xe703bc[_0xe2ba('0x10')][_0xe2ba('0x11')]===0x1f4){logger[_0xe2ba('0x10')](_0xe2ba('0xc'),_0x23a917,_0xe703bc[_0xe2ba('0x10')][_0xe2ba('0x12')]);return _0x3d5a86(_0xe703bc[_0xe2ba('0x10')][_0xe2ba('0x12')]);}logger['error'](_0xe2ba('0xc'),_0x23a917,_0xe703bc[_0xe2ba('0x10')][_0xe2ba('0x12')]);return _0x12be92(_0xe703bc[_0xe2ba('0x10')][_0xe2ba('0x12')]);}else{logger[_0xe2ba('0xb')](_0xe2ba('0xc'),_0x23a917,_0xe2ba('0xd'));_0x12be92(_0xe703bc['result'][_0xe2ba('0x12')]);}})[_0xe2ba('0x13')](function(_0x3bf78c){logger['error'](_0xe2ba('0xc'),_0x23a917,_0x3bf78c);_0x3d5a86(_0x3bf78c);});});}exports[_0xe2ba('0x14')]=function(_0x3108fd){var _0x21fb60=this;return new Promise(function(_0x10825d,_0x4282aa){return db[_0xe2ba('0x15')][_0xe2ba('0x16')]({'raw':_0x3108fd[_0xe2ba('0x17')]?_0x3108fd[_0xe2ba('0x17')][_0xe2ba('0x18')]===undefined?!![]:![]:!![],'where':_0x3108fd['options']?_0x3108fd[_0xe2ba('0x17')][_0xe2ba('0x19')]||null:null,'attributes':_0x3108fd['options']?_0x3108fd[_0xe2ba('0x17')]['attributes']||null:null,'limit':_0x3108fd[_0xe2ba('0x17')]?_0x3108fd[_0xe2ba('0x17')][_0xe2ba('0x1a')]||null:null,'include':_0x3108fd['options']?_0x3108fd['options'][_0xe2ba('0x1b')]?_[_0xe2ba('0x1c')](_0x3108fd['options']['include'],function(_0x5dcfa5){return{'model':db[_0x5dcfa5[_0xe2ba('0x1d')]],'as':_0x5dcfa5['as'],'attributes':_0x5dcfa5[_0xe2ba('0x1e')],'include':_0x5dcfa5[_0xe2ba('0x1b')]?_[_0xe2ba('0x1c')](_0x5dcfa5['include'],function(_0x40d9b4){return{'model':db[_0x40d9b4[_0xe2ba('0x1d')]],'as':_0x40d9b4['as'],'attributes':_0x40d9b4['attributes'],'include':_0x40d9b4[_0xe2ba('0x1b')]?_[_0xe2ba('0x1c')](_0x40d9b4[_0xe2ba('0x1b')],function(_0x38db6d){return{'model':db[_0x38db6d[_0xe2ba('0x1d')]],'as':_0x38db6d['as'],'attributes':_0x38db6d[_0xe2ba('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe2ba('0x1f')](function(_0x256f9a){logger['info'](_0xe2ba('0x14'),_0x3108fd);logger['debug'](_0xe2ba('0x14'),_0x3108fd,JSON['stringify'](_0x256f9a));_0x10825d(_0x256f9a);})[_0xe2ba('0x13')](function(_0x1c8882){logger[_0xe2ba('0x10')]('GetMemberReport',_0x1c8882['message'],_0x3108fd);_0x4282aa(_0x21fb60[_0xe2ba('0x10')](0x1f4,_0x1c8882[_0xe2ba('0x12')]));});});};exports[_0xe2ba('0x20')]=function(_0x4997e9){var _0x4253a2=this;return new Promise(function(_0x7311fc,_0xc7a61){return db[_0xe2ba('0x15')][_0xe2ba('0x21')](_0x4997e9[_0xe2ba('0x22')],{'raw':_0x4997e9[_0xe2ba('0x17')]?_0x4997e9['options'][_0xe2ba('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3e0c4e){logger[_0xe2ba('0xb')]('CreateMemberReport',_0x4997e9);logger['debug'](_0xe2ba('0x20'),_0x4997e9,JSON['stringify'](_0x3e0c4e));_0x7311fc(_0x3e0c4e);})[_0xe2ba('0x13')](function(_0x108573){logger[_0xe2ba('0x10')](_0xe2ba('0x20'),_0x108573[_0xe2ba('0x12')],_0x4997e9);_0xc7a61(_0x4253a2[_0xe2ba('0x10')](0x1f4,_0x108573[_0xe2ba('0x12')]));});});};exports[_0xe2ba('0x23')]=function(_0x12c518){var _0x211471=this;return new Promise(function(_0x10ed91,_0x31d4ab){return db[_0xe2ba('0x15')][_0xe2ba('0x24')](_0x12c518['body'],{'raw':_0x12c518[_0xe2ba('0x17')]?_0x12c518[_0xe2ba('0x17')][_0xe2ba('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12c518[_0xe2ba('0x17')]?_0x12c518[_0xe2ba('0x17')][_0xe2ba('0x19')]||null:null,'attributes':_0x12c518[_0xe2ba('0x17')]?_0x12c518[_0xe2ba('0x17')]['attributes']||null:null,'limit':_0x12c518[_0xe2ba('0x17')]?_0x12c518[_0xe2ba('0x17')][_0xe2ba('0x1a')]||null:null})[_0xe2ba('0x1f')](function(_0x46385a){logger[_0xe2ba('0xb')](_0xe2ba('0x23'),_0x12c518);logger['debug'](_0xe2ba('0x23'),_0x12c518,JSON[_0xe2ba('0xf')](_0x46385a));_0x10ed91(_0x46385a);})[_0xe2ba('0x13')](function(_0x29e87e){logger[_0xe2ba('0x10')](_0xe2ba('0x23'),_0x29e87e[_0xe2ba('0x12')],_0x12c518);_0x31d4ab(_0x211471[_0xe2ba('0x10')](0x1f4,_0x29e87e[_0xe2ba('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index cf44e5a..44b8615 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 _0xcf3b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','index','util','path','connect-timeout'];(function(_0x2550ce,_0x45209b){var _0x25748d=function(_0x806ad5){while(--_0x806ad5){_0x2550ce['push'](_0x2550ce['shift']());}};_0x25748d(++_0x45209b);}(_0xcf3b,0x7f));var _0xbcf3=function(_0x217730,_0x21c9e3){_0x217730=_0x217730-0x0;var _0x2a9ea1=_0xcf3b[_0x217730];return _0x2a9ea1;};'use strict';var multer=require('multer');var util=require(_0xbcf3('0x0'));var path=require(_0xbcf3('0x1'));var timeout=require(_0xbcf3('0x2'));var express=require(_0xbcf3('0x3'));var router=express['Router']();var fs_extra=require(_0xbcf3('0x4'));var auth=require(_0xbcf3('0x5'));var interaction=require(_0xbcf3('0x6'));var config=require(_0xbcf3('0x7'));var controller=require(_0xbcf3('0x8'));router['get']('/',controller[_0xbcf3('0x9')]);module['exports']=router; \ No newline at end of file +var _0x5080=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5d0975,_0x54ee7d){var _0x30cb4d=function(_0x1880f8){while(--_0x1880f8){_0x5d0975['push'](_0x5d0975['shift']());}};_0x30cb4d(++_0x54ee7d);}(_0x5080,0x66));var _0x0508=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x5080[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x0508('0x0'));var path=require('path');var timeout=require(_0x0508('0x1'));var express=require('express');var router=express[_0x0508('0x2')]();var fs_extra=require(_0x0508('0x3'));var auth=require(_0x0508('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0508('0x5'));var controller=require('./migration.controller');router['get']('/',controller['index']);module['exports']=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 443d5ac..c220b39 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 _0x675a=['version','sequelize'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x675a,0x147));var _0xa675=function(_0x26a810,_0x247776){_0x26a810=_0x26a810-0x0;var _0x4758a3=_0x675a[_0x26a810];return _0x4758a3;};'use strict';var Sequelize=require(_0xa675('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xa675('0x1')}}; \ No newline at end of file +var _0x739a=['version','sequelize','exports','STRING'];(function(_0x97e4e7,_0xafa0dc){var _0x25a025=function(_0x2207d1){while(--_0x2207d1){_0x97e4e7['push'](_0x97e4e7['shift']());}};_0x25a025(++_0xafa0dc);}(_0x739a,0x89));var _0xa739=function(_0x2ac87c,_0x1b07b4){_0x2ac87c=_0x2ac87c-0x0;var _0x41a0b5=_0x739a[_0x2ac87c];return _0x41a0b5;};'use strict';var Sequelize=require(_0xa739('0x0'));module[_0xa739('0x1')]={'version':{'type':Sequelize[_0xa739('0x2')],'unique':_0xa739('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 673cf56..3ae6a53 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 _0x1613=['json','apply','save','update','then','destroy','sendStatus','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','Migration','includeAll','include','rows','catch','eml-format','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x4c3b83,_0x49f403){var _0x5c5419=function(_0x1dd550){while(--_0x1dd550){_0x4c3b83['push'](_0x4c3b83['shift']());}};_0x5c5419(++_0x49f403);}(_0x1613,0xe1));var _0x3161=function(_0x4410dd,_0x5e5cc0){_0x4410dd=_0x4410dd-0x0;var _0x30285d=_0x1613[_0x4410dd];return _0x30285d;};'use strict';var emlformat=require(_0x3161('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3161('0x1'));var path=require('path');var sox=require('sox');var csv=require(_0x3161('0x2'));var ejs=require(_0x3161('0x3'));var fs=require('fs');var fs_extra=require(_0x3161('0x4'));var _=require(_0x3161('0x5'));var squel=require(_0x3161('0x6'));var crypto=require(_0x3161('0x7'));var jsforce=require(_0x3161('0x8'));var deskjs=require(_0x3161('0x9'));var toCsv=require(_0x3161('0x2'));var querystring=require(_0x3161('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3161('0xb'));var qs=require(_0x3161('0xc'));var as=require(_0x3161('0xd'));var hardwareService=require(_0x3161('0xe'));var logger=require('../../config/logger')(_0x3161('0xf'));var utils=require('../../config/utils');var config=require(_0x3161('0x10'));var licenseUtil=require(_0x3161('0x11'));var db=require(_0x3161('0x12'))['db'];function respondWithStatusCode(_0x14032b,_0x107ba7){_0x107ba7=_0x107ba7||0xcc;return function(_0x10be40){if(_0x10be40){return _0x14032b['sendStatus'](_0x107ba7);}return _0x14032b[_0x3161('0x13')](_0x107ba7)[_0x3161('0x14')]();};}function respondWithResult(_0x41646d,_0xbbd353){_0xbbd353=_0xbbd353||0xc8;return function(_0x7a4daf){if(_0x7a4daf){return _0x41646d['status'](_0xbbd353)['json'](_0x7a4daf);}};}function respondWithFilteredResult(_0x572b9,_0x4f37d7){return function(_0x19d9b1){if(_0x19d9b1){var _0x17e957=typeof _0x4f37d7[_0x3161('0x15')]===_0x3161('0x16')&&typeof _0x4f37d7[_0x3161('0x17')]==='undefined';var _0x39753c=_0x19d9b1['count'];var _0x2add2e=_0x17e957?0x0:_0x4f37d7[_0x3161('0x15')];var _0x43d857=_0x17e957?_0x19d9b1[_0x3161('0x18')]:_0x4f37d7[_0x3161('0x15')]+_0x4f37d7[_0x3161('0x17')];var _0x35ac56;if(_0x43d857>=_0x39753c){_0x43d857=_0x39753c;_0x35ac56=0xc8;}else{_0x35ac56=0xce;}_0x572b9['status'](_0x35ac56);return _0x572b9[_0x3161('0x19')](_0x3161('0x1a'),_0x2add2e+'-'+_0x43d857+'/'+_0x39753c)[_0x3161('0x1b')](_0x19d9b1);}return null;};}function patchUpdates(_0x309cf1){return function(_0x205ba0){try{jsonpatch[_0x3161('0x1c')](_0x205ba0,_0x309cf1,!![]);}catch(_0x49daa5){return BPromise['reject'](_0x49daa5);}return _0x205ba0[_0x3161('0x1d')]();};}function saveUpdates(_0x2af39c,_0x399e9d){return function(_0x339179){if(_0x339179){return _0x339179[_0x3161('0x1e')](_0x2af39c)[_0x3161('0x1f')](function(_0x5cb7cf){return _0x5cb7cf;});}return null;};}function removeEntity(_0x311392,_0x31f588){return function(_0x303654){if(_0x303654){return _0x303654[_0x3161('0x20')]()[_0x3161('0x1f')](function(){_0x311392[_0x3161('0x13')](0xcc)[_0x3161('0x14')]();});}};}function handleEntityNotFound(_0xbe4bed,_0x2e7f08){return function(_0x67ba13){if(!_0x67ba13){_0xbe4bed[_0x3161('0x21')](0x194);}return _0x67ba13;};}function handleError(_0x15b87d,_0x3d9c27){_0x3d9c27=_0x3d9c27||0x1f4;return function(_0x55124e){logger[_0x3161('0x22')](_0x55124e['stack']);if(_0x55124e[_0x3161('0x23')]){delete _0x55124e['name'];}_0x15b87d[_0x3161('0x13')](_0x3d9c27)[_0x3161('0x24')](_0x55124e);};}exports[_0x3161('0x25')]=function(_0x118d2e,_0x5a5d22){var _0xadd549={},_0x1df164={},_0x4ee8e1={'count':0x0,'rows':[]};var _0x2e40ee=_['map'](db['Migration']['rawAttributes'],function(_0x2fc2c5){return{'name':_0x2fc2c5[_0x3161('0x26')],'type':_0x2fc2c5[_0x3161('0x27')][_0x3161('0x28')]};});_0x1df164[_0x3161('0x29')]=_[_0x3161('0x2a')](_0x2e40ee,_0x3161('0x23'));_0x1df164[_0x3161('0x2b')]=_[_0x3161('0x2c')](_0x118d2e[_0x3161('0x2b')]);_0x1df164[_0x3161('0x2d')]=_['intersection'](_0x1df164[_0x3161('0x29')],_0x1df164[_0x3161('0x2b')]);_0xadd549[_0x3161('0x2e')]=_[_0x3161('0x2f')](_0x1df164[_0x3161('0x29')],qs[_0x3161('0x30')](_0x118d2e['query'][_0x3161('0x30')]));_0xadd549['attributes']=_0xadd549[_0x3161('0x2e')][_0x3161('0x31')]?_0xadd549['attributes']:_0x1df164[_0x3161('0x29')];if(!_0x118d2e[_0x3161('0x2b')][_0x3161('0x32')](_0x3161('0x33'))){_0xadd549[_0x3161('0x17')]=qs[_0x3161('0x17')](_0x118d2e[_0x3161('0x2b')][_0x3161('0x17')]);_0xadd549[_0x3161('0x15')]=qs[_0x3161('0x15')](_0x118d2e[_0x3161('0x2b')][_0x3161('0x15')]);}_0xadd549[_0x3161('0x34')]=qs[_0x3161('0x35')](_0x118d2e[_0x3161('0x2b')][_0x3161('0x35')]);_0xadd549[_0x3161('0x36')]=qs['filters'](_[_0x3161('0x37')](_0x118d2e[_0x3161('0x2b')],_0x1df164[_0x3161('0x2d')]),_0x2e40ee);if(_0x118d2e[_0x3161('0x2b')]['filter']){_0xadd549[_0x3161('0x36')]=_[_0x3161('0x38')](_0xadd549[_0x3161('0x36')],{'$or':_['map'](_0x2e40ee,function(_0x59312f){if(_0x59312f[_0x3161('0x27')]!=='VIRTUAL'){var _0x549746={};_0x549746[_0x59312f[_0x3161('0x23')]]={'$like':'%'+_0x118d2e[_0x3161('0x2b')][_0x3161('0x39')]+'%'};return _0x549746;}})});}_0xadd549=_[_0x3161('0x38')]({},_0xadd549,_0x118d2e['options']);var _0x7b7ac0={'where':_0xadd549[_0x3161('0x36')]};return db[_0x3161('0x3a')][_0x3161('0x18')](_0x7b7ac0)[_0x3161('0x1f')](function(_0x9a5da1){_0x4ee8e1[_0x3161('0x18')]=_0x9a5da1;if(_0x118d2e[_0x3161('0x2b')][_0x3161('0x3b')]){_0xadd549[_0x3161('0x3c')]=[{'all':!![]}];}return db[_0x3161('0x3a')]['findAll'](_0xadd549);})[_0x3161('0x1f')](function(_0x394d7c){_0x4ee8e1[_0x3161('0x3d')]=_0x394d7c;return _0x4ee8e1;})['then'](respondWithFilteredResult(_0x5a5d22,_0xadd549))[_0x3161('0x3e')](handleError(_0x5a5d22,null));}; \ No newline at end of file +var _0xb873=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','fs-extra','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where'];(function(_0x1727e2,_0xb28014){var _0x24c4a0=function(_0x5c7881){while(--_0x5c7881){_0x1727e2['push'](_0x1727e2['shift']());}};_0x24c4a0(++_0xb28014);}(_0xb873,0x114));var _0x3b87=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xb873[_0x1477ef];return _0x164acd;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3b87('0x0'));var jsonpatch=require(_0x3b87('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3b87('0x2'));var Mustache=require(_0x3b87('0x3'));var util=require('util');var path=require(_0x3b87('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3b87('0x5'));var fs=require('fs');var fs_extra=require(_0x3b87('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b87('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x3b87('0x8'));var toCsv=require(_0x3b87('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3b87('0xa'));var authService=require(_0x3b87('0xb'));var qs=require(_0x3b87('0xc'));var as=require(_0x3b87('0xd'));var hardwareService=require(_0x3b87('0xe'));var logger=require(_0x3b87('0xf'))('api');var utils=require('../../config/utils');var config=require(_0x3b87('0x10'));var licenseUtil=require(_0x3b87('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28a38d,_0x5b801d){_0x5b801d=_0x5b801d||0xcc;return function(_0x2d01e5){if(_0x2d01e5){return _0x28a38d[_0x3b87('0x12')](_0x5b801d);}return _0x28a38d[_0x3b87('0x13')](_0x5b801d)[_0x3b87('0x14')]();};}function respondWithResult(_0x49f56b,_0xd6931b){_0xd6931b=_0xd6931b||0xc8;return function(_0x248b21){if(_0x248b21){return _0x49f56b[_0x3b87('0x13')](_0xd6931b)[_0x3b87('0x15')](_0x248b21);}};}function respondWithFilteredResult(_0x5199c4,_0x3dbcda){return function(_0x4bce7d){if(_0x4bce7d){var _0x38ecff=typeof _0x3dbcda[_0x3b87('0x16')]==='undefined'&&typeof _0x3dbcda['limit']===_0x3b87('0x17');var _0x36d088=_0x4bce7d[_0x3b87('0x18')];var _0x351b17=_0x38ecff?0x0:_0x3dbcda[_0x3b87('0x16')];var _0x56c3f0=_0x38ecff?_0x4bce7d[_0x3b87('0x18')]:_0x3dbcda[_0x3b87('0x16')]+_0x3dbcda[_0x3b87('0x19')];var _0x3f86ab;if(_0x56c3f0>=_0x36d088){_0x56c3f0=_0x36d088;_0x3f86ab=0xc8;}else{_0x3f86ab=0xce;}_0x5199c4['status'](_0x3f86ab);return _0x5199c4[_0x3b87('0x1a')](_0x3b87('0x1b'),_0x351b17+'-'+_0x56c3f0+'/'+_0x36d088)[_0x3b87('0x15')](_0x4bce7d);}return null;};}function patchUpdates(_0x4d15a2){return function(_0x298040){try{jsonpatch[_0x3b87('0x1c')](_0x298040,_0x4d15a2,!![]);}catch(_0x3d3c85){return BPromise[_0x3b87('0x1d')](_0x3d3c85);}return _0x298040[_0x3b87('0x1e')]();};}function saveUpdates(_0x4bfb29,_0x30355d){return function(_0x27c087){if(_0x27c087){return _0x27c087[_0x3b87('0x1f')](_0x4bfb29)['then'](function(_0x388b25){return _0x388b25;});}return null;};}function removeEntity(_0x2fadbb,_0x23c7cb){return function(_0x580545){if(_0x580545){return _0x580545[_0x3b87('0x20')]()[_0x3b87('0x21')](function(){_0x2fadbb['status'](0xcc)[_0x3b87('0x14')]();});}};}function handleEntityNotFound(_0x456935,_0x51420a){return function(_0x3e5d9f){if(!_0x3e5d9f){_0x456935[_0x3b87('0x12')](0x194);}return _0x3e5d9f;};}function handleError(_0x4c7f9f,_0x5018d7){_0x5018d7=_0x5018d7||0x1f4;return function(_0x49c2c1){logger[_0x3b87('0x22')](_0x49c2c1[_0x3b87('0x23')]);if(_0x49c2c1[_0x3b87('0x24')]){delete _0x49c2c1[_0x3b87('0x24')];}_0x4c7f9f[_0x3b87('0x13')](_0x5018d7)[_0x3b87('0x25')](_0x49c2c1);};}exports[_0x3b87('0x26')]=function(_0x4420f9,_0x3d1784){var _0x6d8a37={},_0x4bef03={},_0x4be19c={'count':0x0,'rows':[]};var _0xa66973=_[_0x3b87('0x27')](db[_0x3b87('0x28')][_0x3b87('0x29')],function(_0x5e59d0){return{'name':_0x5e59d0[_0x3b87('0x2a')],'type':_0x5e59d0[_0x3b87('0x2b')][_0x3b87('0x2c')]};});_0x4bef03['model']=_[_0x3b87('0x27')](_0xa66973,'name');_0x4bef03[_0x3b87('0x2d')]=_['keys'](_0x4420f9[_0x3b87('0x2d')]);_0x4bef03['filters']=_[_0x3b87('0x2e')](_0x4bef03[_0x3b87('0x2f')],_0x4bef03[_0x3b87('0x2d')]);_0x6d8a37[_0x3b87('0x30')]=_[_0x3b87('0x2e')](_0x4bef03[_0x3b87('0x2f')],qs[_0x3b87('0x31')](_0x4420f9[_0x3b87('0x2d')][_0x3b87('0x31')]));_0x6d8a37['attributes']=_0x6d8a37[_0x3b87('0x30')][_0x3b87('0x32')]?_0x6d8a37[_0x3b87('0x30')]:_0x4bef03[_0x3b87('0x2f')];if(!_0x4420f9[_0x3b87('0x2d')][_0x3b87('0x33')](_0x3b87('0x34'))){_0x6d8a37[_0x3b87('0x19')]=qs[_0x3b87('0x19')](_0x4420f9['query'][_0x3b87('0x19')]);_0x6d8a37['offset']=qs['offset'](_0x4420f9[_0x3b87('0x2d')][_0x3b87('0x16')]);}_0x6d8a37[_0x3b87('0x35')]=qs[_0x3b87('0x36')](_0x4420f9[_0x3b87('0x2d')][_0x3b87('0x36')]);_0x6d8a37['where']=qs['filters'](_[_0x3b87('0x37')](_0x4420f9[_0x3b87('0x2d')],_0x4bef03[_0x3b87('0x38')]),_0xa66973);if(_0x4420f9[_0x3b87('0x2d')][_0x3b87('0x39')]){_0x6d8a37[_0x3b87('0x3a')]=_[_0x3b87('0x3b')](_0x6d8a37[_0x3b87('0x3a')],{'$or':_[_0x3b87('0x27')](_0xa66973,function(_0x256457){if(_0x256457[_0x3b87('0x2b')]!==_0x3b87('0x3c')){var _0x520126={};_0x520126[_0x256457['name']]={'$like':'%'+_0x4420f9['query'][_0x3b87('0x39')]+'%'};return _0x520126;}})});}_0x6d8a37=_['merge']({},_0x6d8a37,_0x4420f9[_0x3b87('0x3d')]);var _0x15ddb7={'where':_0x6d8a37['where']};return db[_0x3b87('0x28')]['count'](_0x15ddb7)[_0x3b87('0x21')](function(_0x67e0bc){_0x4be19c['count']=_0x67e0bc;if(_0x4420f9[_0x3b87('0x2d')][_0x3b87('0x3e')]){_0x6d8a37[_0x3b87('0x3f')]=[{'all':!![]}];}return db['Migration'][_0x3b87('0x40')](_0x6d8a37);})['then'](function(_0x395f80){_0x4be19c[_0x3b87('0x41')]=_0x395f80;return _0x4be19c;})[_0x3b87('0x21')](respondWithFilteredResult(_0x3d1784,_0x6d8a37))[_0x3b87('0x42')](handleError(_0x3d1784,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 8945b7b..e424a8a 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 _0xcb8c=['exports','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x11b763,_0x3b4fb9){var _0x1408f7=function(_0xf906ec){while(--_0xf906ec){_0x11b763['push'](_0x11b763['shift']());}};_0x1408f7(++_0x3b4fb9);}(_0xcb8c,0x1e3));var _0xccb8=function(_0x37548d,_0x19adea){_0x37548d=_0x37548d-0x0;var _0x573d93=_0xcb8c[_0x37548d];return _0x573d93;};'use strict';var _=require(_0xccb8('0x0'));var util=require(_0xccb8('0x1'));var logger=require(_0xccb8('0x2'))(_0xccb8('0x3'));var moment=require(_0xccb8('0x4'));var BPromise=require(_0xccb8('0x5'));var rp=require(_0xccb8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xccb8('0x7'));var config=require(_0xccb8('0x8'));var attributes=require('./migration.attributes');module[_0xccb8('0x9')]=function(_0x4cfef1,_0x5a011c){return _0x4cfef1['define'](_0xccb8('0xa'),attributes,{'tableName':_0xccb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a39=['api','bluebird','path','rimraf','exports','define','Migration','migrations','util','../../config/logger'];(function(_0x24a654,_0x2ca441){var _0x458651=function(_0x1ecda1){while(--_0x1ecda1){_0x24a654['push'](_0x24a654['shift']());}};_0x458651(++_0x2ca441);}(_0x6a39,0x10c));var _0x96a3=function(_0x2eb828,_0x5b4396){_0x2eb828=_0x2eb828-0x0;var _0xdb47b7=_0x6a39[_0x2eb828];return _0xdb47b7;};'use strict';var _=require('lodash');var util=require(_0x96a3('0x0'));var logger=require(_0x96a3('0x1'))(_0x96a3('0x2'));var moment=require('moment');var BPromise=require(_0x96a3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x96a3('0x4'));var rimraf=require(_0x96a3('0x5'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x96a3('0x6')]=function(_0x15e588,_0x22206e){return _0x15e588[_0x96a3('0x7')](_0x96a3('0x8'),attributes,{'tableName':_0x96a3('0x9'),'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 5a8fcbd..92a4c76 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 _0x5088=['rpc','jayson/promise','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5088,0xa9));var _0x8508=function(_0x585723,_0x25250e){_0x585723=_0x585723-0x0;var _0x54edcf=_0x5088[_0x585723];return _0x54edcf;};'use strict';var _=require('lodash');var util=require(_0x8508('0x0'));var moment=require(_0x8508('0x1'));var BPromise=require(_0x8508('0x2'));var rs=require(_0x8508('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8508('0x4'))['db'];var utils=require(_0x8508('0x5'));var logger=require(_0x8508('0x6'))(_0x8508('0x7'));var config=require('../../config/environment');var jayson=require(_0x8508('0x8'));var client=jayson['client'][_0x8508('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x250828,_0x49dcdd,_0x3d724f){return new BPromise(function(_0x2f498b,_0x4f81b5){return client[_0x8508('0xa')](_0x250828,_0x3d724f)[_0x8508('0xb')](function(_0x3c990b){logger[_0x8508('0xc')](_0x8508('0xd'),_0x49dcdd,_0x8508('0xe'));logger[_0x8508('0xf')](_0x8508('0x10'),_0x49dcdd,_0x8508('0xe'),JSON['stringify'](_0x3c990b));if(_0x3c990b[_0x8508('0x11')]){if(_0x3c990b[_0x8508('0x11')][_0x8508('0x12')]===0x1f4){logger[_0x8508('0x11')](_0x8508('0xd'),_0x49dcdd,_0x3c990b[_0x8508('0x11')][_0x8508('0x13')]);return _0x4f81b5(_0x3c990b['error'][_0x8508('0x13')]);}logger[_0x8508('0x11')](_0x8508('0xd'),_0x49dcdd,_0x3c990b[_0x8508('0x11')]['message']);return _0x2f498b(_0x3c990b[_0x8508('0x11')][_0x8508('0x13')]);}else{logger['info'](_0x8508('0xd'),_0x49dcdd,'request\x20sent');_0x2f498b(_0x3c990b[_0x8508('0x14')][_0x8508('0x13')]);}})[_0x8508('0x15')](function(_0x34893f){logger[_0x8508('0x11')]('Migration,\x20%s,\x20%s',_0x49dcdd,_0x34893f);_0x4f81b5(_0x34893f);});});} \ No newline at end of file +var _0x3013=['../../config/logger','rpc','../../config/environment','client','then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0x3013,0xea));var _0x3301=function(_0x1278a4,_0x49b6ea){_0x1278a4=_0x1278a4-0x0;var _0x2fe297=_0x3013[_0x1278a4];return _0x2fe297;};'use strict';var _=require(_0x3301('0x0'));var util=require(_0x3301('0x1'));var moment=require(_0x3301('0x2'));var BPromise=require(_0x3301('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3301('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3301('0x5'));var logger=require(_0x3301('0x6'))(_0x3301('0x7'));var config=require(_0x3301('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3301('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41dd5b,_0x3d7e08,_0x4299f9){return new BPromise(function(_0x1b1d66,_0x224cea){return client['request'](_0x41dd5b,_0x4299f9)[_0x3301('0xa')](function(_0x744189){logger[_0x3301('0xb')](_0x3301('0xc'),_0x3d7e08,_0x3301('0xd'));logger['debug'](_0x3301('0xe'),_0x3d7e08,_0x3301('0xd'),JSON[_0x3301('0xf')](_0x744189));if(_0x744189[_0x3301('0x10')]){if(_0x744189[_0x3301('0x10')][_0x3301('0x11')]===0x1f4){logger[_0x3301('0x10')](_0x3301('0xc'),_0x3d7e08,_0x744189[_0x3301('0x10')][_0x3301('0x12')]);return _0x224cea(_0x744189[_0x3301('0x10')][_0x3301('0x12')]);}logger[_0x3301('0x10')](_0x3301('0xc'),_0x3d7e08,_0x744189['error'][_0x3301('0x12')]);return _0x1b1d66(_0x744189[_0x3301('0x10')]['message']);}else{logger['info'](_0x3301('0xc'),_0x3d7e08,_0x3301('0xd'));_0x1b1d66(_0x744189['result'][_0x3301('0x12')]);}})[_0x3301('0x13')](function(_0x4a3915){logger[_0x3301('0x10')](_0x3301('0xc'),_0x3d7e08,_0x4a3915);_0x224cea(_0x4a3915);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3fd892f..38eaf5a 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 _0x804d=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x351056,_0x2617ba){var _0xad54c5=function(_0x17ff70){while(--_0x17ff70){_0x351056['push'](_0x351056['shift']());}};_0xad54c5(++_0x2617ba);}(_0x804d,0x116));var _0xd804=function(_0x2d2153,_0x4509d6){_0x2d2153=_0x2d2153-0x0;var _0x20299e=_0x804d[_0x2d2153];return _0x20299e;};'use strict';var multer=require(_0xd804('0x0'));var util=require(_0xd804('0x1'));var path=require(_0xd804('0x2'));var timeout=require(_0xd804('0x3'));var express=require(_0xd804('0x4'));var router=express[_0xd804('0x5')]();var fs_extra=require(_0xd804('0x6'));var auth=require(_0xd804('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd804('0x8'));var controller=require(_0xd804('0x9'));router[_0xd804('0xa')]('/',auth[_0xd804('0xb')](),controller[_0xd804('0xc')]);router[_0xd804('0xa')](_0xd804('0xd'),auth[_0xd804('0xb')](),controller[_0xd804('0xe')]);router[_0xd804('0xf')]('/',auth[_0xd804('0xb')](),controller[_0xd804('0x10')]);router['put'](_0xd804('0xd'),auth[_0xd804('0xb')](),controller[_0xd804('0x11')]);router[_0xd804('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd804('0x13')]);module[_0xd804('0x14')]=router; \ No newline at end of file +var _0xea21=['get','index','/:id','isAuthenticated','post','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x1e0dd6,_0x43fbb6){var _0x1a5c82=function(_0x2b4be0){while(--_0x2b4be0){_0x1e0dd6['push'](_0x1e0dd6['shift']());}};_0x1a5c82(++_0x43fbb6);}(_0xea21,0x80));var _0x1ea2=function(_0x154b2c,_0x29f043){_0x154b2c=_0x154b2c-0x0;var _0x28f532=_0xea21[_0x154b2c];return _0x28f532;};'use strict';var multer=require(_0x1ea2('0x0'));var util=require('util');var path=require(_0x1ea2('0x1'));var timeout=require(_0x1ea2('0x2'));var express=require(_0x1ea2('0x3'));var router=express['Router']();var fs_extra=require(_0x1ea2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1ea2('0x5'));var config=require(_0x1ea2('0x6'));var controller=require(_0x1ea2('0x7'));router[_0x1ea2('0x8')]('/',auth['isAuthenticated'](),controller[_0x1ea2('0x9')]);router[_0x1ea2('0x8')](_0x1ea2('0xa'),auth[_0x1ea2('0xb')](),controller['show']);router[_0x1ea2('0xc')]('/',auth[_0x1ea2('0xb')](),controller['create']);router[_0x1ea2('0xd')](_0x1ea2('0xa'),auth[_0x1ea2('0xb')](),controller[_0x1ea2('0xe')]);router[_0x1ea2('0xf')](_0x1ea2('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1ea2('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 6ab4a3f..e370784 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 _0x24d5=['ENUM','localnet','externip','turn','STRING','sequelize','exports'];(function(_0x12306d,_0x2b8f14){var _0x16804f=function(_0x2a6dee){while(--_0x2a6dee){_0x12306d['push'](_0x12306d['shift']());}};_0x16804f(++_0x2b8f14);}(_0x24d5,0x10f));var _0x524d=function(_0x4be1c6,_0x28475c){_0x4be1c6=_0x4be1c6-0x0;var _0x482130=_0x24d5[_0x4be1c6];return _0x482130;};'use strict';var Sequelize=require(_0x524d('0x0'));module[_0x524d('0x1')]={'type':{'type':Sequelize[_0x524d('0x2')](_0x524d('0x3'),_0x524d('0x4'),'stun',_0x524d('0x5'))},'value':{'type':Sequelize[_0x524d('0x6')]},'username':{'type':Sequelize[_0x524d('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x95f2=['localnet','externip','stun','turn','STRING','sequelize','ENUM'];(function(_0x390733,_0x1e3d32){var _0x33beb9=function(_0x4491a3){while(--_0x4491a3){_0x390733['push'](_0x390733['shift']());}};_0x33beb9(++_0x1e3d32);}(_0x95f2,0x1c5));var _0x295f=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x95f2[_0xf73c09];return _0xa8923c;};'use strict';var Sequelize=require(_0x295f('0x0'));module['exports']={'type':{'type':Sequelize[_0x295f('0x1')](_0x295f('0x2'),_0x295f('0x3'),_0x295f('0x4'),_0x295f('0x5'))},'value':{'type':Sequelize[_0x295f('0x6')]},'username':{'type':Sequelize[_0x295f('0x6')]},'password':{'type':Sequelize[_0x295f('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 46f2f3a..b898840 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 _0x9ed1=['model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','Network','includeAll','include','findAll','rows','catch','show','params','find','create','sequelize','transaction','body','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','join','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','toLowerCase','TURN','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','undefined','limit','count','json','apply','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x798dc3,_0x10d250){var _0x43710a=function(_0x3f2db0){while(--_0x3f2db0){_0x798dc3['push'](_0x798dc3['shift']());}};_0x43710a(++_0x10d250);}(_0x9ed1,0x107));var _0x19ed=function(_0x2682c3,_0x31fe75){_0x2682c3=_0x2682c3-0x0;var _0x38538b=_0x9ed1[_0x2682c3];return _0x38538b;};'use strict';var emlformat=require(_0x19ed('0x0'));var rimraf=require(_0x19ed('0x1'));var zipdir=require(_0x19ed('0x2'));var jsonpatch=require(_0x19ed('0x3'));var rp=require(_0x19ed('0x4'));var moment=require('moment');var BPromise=require(_0x19ed('0x5'));var Mustache=require('mustache');var util=require(_0x19ed('0x6'));var path=require('path');var sox=require(_0x19ed('0x7'));var csv=require('to-csv');var ejs=require(_0x19ed('0x8'));var fs=require('fs');var fs_extra=require(_0x19ed('0x9'));var _=require(_0x19ed('0xa'));var squel=require(_0x19ed('0xb'));var crypto=require(_0x19ed('0xc'));var jsforce=require(_0x19ed('0xd'));var deskjs=require(_0x19ed('0xe'));var toCsv=require(_0x19ed('0xf'));var querystring=require(_0x19ed('0x10'));var Papa=require(_0x19ed('0x11'));var Redis=require(_0x19ed('0x12'));var authService=require(_0x19ed('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x19ed('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x19ed('0x15'));var utils=require(_0x19ed('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x19ed('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x19ed('0x18'));var client=jayson[_0x19ed('0x19')][_0x19ed('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1d36e6,_0x6c519f,_0x14b0f6,_0x3158fd){return new BPromise(function(_0x392874,_0x24b09b){var _0x187c9b=_0x3158fd||client;return _0x187c9b[_0x19ed('0x1b')](_0x1d36e6,_0x14b0f6)[_0x19ed('0x1c')](function(_0x5d0a37){logger[_0x19ed('0x1d')](_0x19ed('0x1e'),_0x6c519f,_0x19ed('0x1f'));logger[_0x19ed('0x20')](_0x19ed('0x21'),_0x6c519f,'request\x20sent',JSON[_0x19ed('0x22')](_0x5d0a37));if(_0x5d0a37[_0x19ed('0x23')]){if(_0x5d0a37[_0x19ed('0x23')][_0x19ed('0x24')]===0x1f4){logger[_0x19ed('0x23')](_0x19ed('0x1e'),_0x6c519f,_0x5d0a37[_0x19ed('0x23')][_0x19ed('0x25')]);return _0x24b09b(_0x5d0a37['error'][_0x19ed('0x25')]);}logger[_0x19ed('0x23')]('Network,\x20%s,\x20%s',_0x6c519f,_0x5d0a37[_0x19ed('0x23')][_0x19ed('0x25')]);return _0x392874(_0x5d0a37[_0x19ed('0x23')][_0x19ed('0x25')]);}else{logger['info'](_0x19ed('0x1e'),_0x6c519f,_0x19ed('0x1f'));_0x392874(_0x5d0a37['result'][_0x19ed('0x25')]);}})['catch'](function(_0xc61ee3){logger[_0x19ed('0x23')](_0x19ed('0x1e'),_0x6c519f,_0xc61ee3);_0x24b09b(_0xc61ee3);});});}function respondWithStatusCode(_0x4db603,_0x525cfe){_0x525cfe=_0x525cfe||0xcc;return function(_0x5108e4){if(_0x5108e4){return _0x4db603[_0x19ed('0x26')](_0x525cfe);}return _0x4db603[_0x19ed('0x27')](_0x525cfe)[_0x19ed('0x28')]();};}function respondWithResult(_0x450909,_0x323a61){_0x323a61=_0x323a61||0xc8;return function(_0x2da033){if(_0x2da033){return _0x450909[_0x19ed('0x27')](_0x323a61)['json'](_0x2da033);}};}function respondWithFilteredResult(_0x376809,_0x5902a0){return function(_0x5f5dd0){if(_0x5f5dd0){var _0x55af30=typeof _0x5902a0[_0x19ed('0x29')]===_0x19ed('0x2a')&&typeof _0x5902a0[_0x19ed('0x2b')]===_0x19ed('0x2a');var _0x2cccf4=_0x5f5dd0[_0x19ed('0x2c')];var _0x3a1b16=_0x55af30?0x0:_0x5902a0[_0x19ed('0x29')];var _0x51cdd3=_0x55af30?_0x5f5dd0[_0x19ed('0x2c')]:_0x5902a0[_0x19ed('0x29')]+_0x5902a0[_0x19ed('0x2b')];var _0x447e8b;if(_0x51cdd3>=_0x2cccf4){_0x51cdd3=_0x2cccf4;_0x447e8b=0xc8;}else{_0x447e8b=0xce;}_0x376809[_0x19ed('0x27')](_0x447e8b);return _0x376809['set']('Content-Range',_0x3a1b16+'-'+_0x51cdd3+'/'+_0x2cccf4)[_0x19ed('0x2d')](_0x5f5dd0);}return null;};}function patchUpdates(_0xb8b4f5){return function(_0x45146d){try{jsonpatch[_0x19ed('0x2e')](_0x45146d,_0xb8b4f5,!![]);}catch(_0x109fc7){return BPromise['reject'](_0x109fc7);}return _0x45146d['save']();};}function saveUpdates(_0xd53a26,_0x141abd){return function(_0x4e3cfa){if(_0x4e3cfa){return _0x4e3cfa[_0x19ed('0x2f')](_0xd53a26)[_0x19ed('0x1c')](function(_0x5dd7bd){return _0x5dd7bd;});}return null;};}function removeEntity(_0x442b07,_0x159854){return function(_0x5c102c){if(_0x5c102c){return _0x5c102c[_0x19ed('0x30')]()[_0x19ed('0x1c')](function(){_0x442b07['status'](0xcc)[_0x19ed('0x28')]();});}};}function handleEntityNotFound(_0x86d62a,_0x28ef56){return function(_0x348191){if(!_0x348191){_0x86d62a[_0x19ed('0x26')](0x194);}return _0x348191;};}function handleError(_0x16745e,_0x12b0c1){_0x12b0c1=_0x12b0c1||0x1f4;return function(_0x73e619){logger[_0x19ed('0x23')](_0x73e619[_0x19ed('0x31')]);if(_0x73e619[_0x19ed('0x32')]){delete _0x73e619[_0x19ed('0x32')];}_0x16745e[_0x19ed('0x27')](_0x12b0c1)[_0x19ed('0x33')](_0x73e619);};}exports[_0x19ed('0x34')]=function(_0x37e1db,_0x46384f){var _0x111e63={},_0x15d080={},_0x3a1227={'count':0x0,'rows':[]};var _0x6d30ab=_[_0x19ed('0x35')](db['Network'][_0x19ed('0x36')],function(_0x11639a){return{'name':_0x11639a[_0x19ed('0x37')],'type':_0x11639a[_0x19ed('0x38')][_0x19ed('0x39')]};});_0x15d080[_0x19ed('0x3a')]=_[_0x19ed('0x35')](_0x6d30ab,'name');_0x15d080[_0x19ed('0x3b')]=_[_0x19ed('0x3c')](_0x37e1db[_0x19ed('0x3b')]);_0x15d080[_0x19ed('0x3d')]=_[_0x19ed('0x3e')](_0x15d080[_0x19ed('0x3a')],_0x15d080[_0x19ed('0x3b')]);_0x111e63[_0x19ed('0x3f')]=_[_0x19ed('0x3e')](_0x15d080[_0x19ed('0x3a')],qs[_0x19ed('0x40')](_0x37e1db[_0x19ed('0x3b')][_0x19ed('0x40')]));_0x111e63[_0x19ed('0x3f')]=_0x111e63[_0x19ed('0x3f')][_0x19ed('0x41')]?_0x111e63['attributes']:_0x15d080[_0x19ed('0x3a')];if(!_0x37e1db['query']['hasOwnProperty'](_0x19ed('0x42'))){_0x111e63['limit']=qs[_0x19ed('0x2b')](_0x37e1db[_0x19ed('0x3b')][_0x19ed('0x2b')]);_0x111e63[_0x19ed('0x29')]=qs['offset'](_0x37e1db[_0x19ed('0x3b')][_0x19ed('0x29')]);}_0x111e63['order']=qs[_0x19ed('0x43')](_0x37e1db[_0x19ed('0x3b')][_0x19ed('0x43')]);_0x111e63[_0x19ed('0x44')]=qs[_0x19ed('0x3d')](_[_0x19ed('0x45')](_0x37e1db[_0x19ed('0x3b')],_0x15d080[_0x19ed('0x3d')]),_0x6d30ab);if(_0x37e1db[_0x19ed('0x3b')][_0x19ed('0x46')]){_0x111e63[_0x19ed('0x44')]=_[_0x19ed('0x47')](_0x111e63[_0x19ed('0x44')],{'$or':_[_0x19ed('0x35')](_0x6d30ab,function(_0x5822b2){if(_0x5822b2[_0x19ed('0x38')]!==_0x19ed('0x48')){var _0x4e9a3d={};_0x4e9a3d[_0x5822b2['name']]={'$like':'%'+_0x37e1db['query'][_0x19ed('0x46')]+'%'};return _0x4e9a3d;}})});}_0x111e63=_['merge']({},_0x111e63,_0x37e1db[_0x19ed('0x49')]);var _0x4062c4={'where':_0x111e63[_0x19ed('0x44')]};return db[_0x19ed('0x4a')][_0x19ed('0x2c')](_0x4062c4)[_0x19ed('0x1c')](function(_0x197c4e){_0x3a1227['count']=_0x197c4e;if(_0x37e1db[_0x19ed('0x3b')][_0x19ed('0x4b')]){_0x111e63[_0x19ed('0x4c')]=[{'all':!![]}];}return db[_0x19ed('0x4a')][_0x19ed('0x4d')](_0x111e63);})[_0x19ed('0x1c')](function(_0x125c96){_0x3a1227[_0x19ed('0x4e')]=_0x125c96;return _0x3a1227;})[_0x19ed('0x1c')](respondWithFilteredResult(_0x46384f,_0x111e63))[_0x19ed('0x4f')](handleError(_0x46384f,null));};exports[_0x19ed('0x50')]=function(_0x5a63d0,_0x1fb4ad){var _0x52a047={'raw':!![],'where':{'id':_0x5a63d0[_0x19ed('0x51')]['id']}},_0x197292={};_0x197292[_0x19ed('0x3a')]=_[_0x19ed('0x3c')](db['Network'][_0x19ed('0x36')]);_0x197292[_0x19ed('0x3b')]=_[_0x19ed('0x3c')](_0x5a63d0[_0x19ed('0x3b')]);_0x197292[_0x19ed('0x3d')]=_[_0x19ed('0x3e')](_0x197292['model'],_0x197292[_0x19ed('0x3b')]);_0x52a047[_0x19ed('0x3f')]=_[_0x19ed('0x3e')](_0x197292['model'],qs[_0x19ed('0x40')](_0x5a63d0[_0x19ed('0x3b')][_0x19ed('0x40')]));_0x52a047[_0x19ed('0x3f')]=_0x52a047['attributes'][_0x19ed('0x41')]?_0x52a047[_0x19ed('0x3f')]:_0x197292[_0x19ed('0x3a')];if(_0x5a63d0[_0x19ed('0x3b')][_0x19ed('0x4b')]){_0x52a047[_0x19ed('0x4c')]=[{'all':!![]}];}_0x52a047=_[_0x19ed('0x47')]({},_0x52a047,_0x5a63d0[_0x19ed('0x49')]);return db['Network'][_0x19ed('0x52')](_0x52a047)[_0x19ed('0x1c')](handleEntityNotFound(_0x1fb4ad,null))['then'](respondWithResult(_0x1fb4ad,null))['catch'](handleError(_0x1fb4ad,null));};exports[_0x19ed('0x53')]=function(_0x4c1dca,_0x462553,_0x93ad07){var _0x45a027;return db[_0x19ed('0x54')][_0x19ed('0x55')](function(_0x35ff4b){return db[_0x19ed('0x4a')]['create'](_0x4c1dca[_0x19ed('0x56')],{'raw':!![]})[_0x19ed('0x1c')](function(_0x36201f){_0x45a027=_0x36201f;return db[_0x19ed('0x4a')][_0x19ed('0x4d')]({'where':{'type':_0x4c1dca[_0x19ed('0x56')][_0x19ed('0x38')]},'raw':!![]});})[_0x19ed('0x1c')](function(_0xb0b73b){if(_0x45a027[_0x19ed('0x38')]['toUpperCase']()==_0x19ed('0x57')){var _0x24448d=fs[_0x19ed('0x58')](path['join'](config[_0x19ed('0x59')],_0x19ed('0x5a')),'utf8');var _0x3e4b17=ejs[_0x19ed('0x5b')](_0x24448d,{'networks':_0xb0b73b||[]});fs[_0x19ed('0x5c')](_0x19ed('0x5d'),_0x3e4b17);return respondWithRpcPromise(_0x19ed('0x5e'),_0x19ed('0x53'),{'module':_0x19ed('0x5f')});}else if(_0x45a027['type'][_0x19ed('0x60')]()=='TURN'){var _0x4060b9=fs[_0x19ed('0x58')](path[_0x19ed('0x61')](config[_0x19ed('0x59')],_0x19ed('0x62')),_0x19ed('0x63'));var _0x601592=ejs[_0x19ed('0x5b')](_0x4060b9,{'networks':_0xb0b73b||[]});fs[_0x19ed('0x5c')](_0x19ed('0x64'),_0x601592);return respondWithRpcPromise(_0x19ed('0x5e'),_0x19ed('0x53'),{'module':_0x19ed('0x5f')});}else{var _0x37a3f6=fs[_0x19ed('0x58')](path[_0x19ed('0x61')](config[_0x19ed('0x59')],_0x19ed('0x65')),_0x19ed('0x63'));var _0x4cb87d=ejs[_0x19ed('0x5b')](_0x37a3f6,{'networks':_0xb0b73b||[]});fs[_0x19ed('0x5c')](util[_0x19ed('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x4c1dca['body']['type'][_0x19ed('0x67')]()),_0x4cb87d);return respondWithRpcPromise('Reload',_0x19ed('0x53'),{'module':'chan_sip.so'});}return null;})[_0x19ed('0x1c')](function(){return _0x45a027;});})['then'](respondWithResult(_0x462553,0xc9))[_0x19ed('0x4f')](handleError(_0x462553,null));};exports[_0x19ed('0x2f')]=function(_0x1b4e3b,_0x41b03b,_0x4792f5){var _0x2e3340;return db[_0x19ed('0x54')][_0x19ed('0x55')](function(_0x48db1f){return db[_0x19ed('0x4a')][_0x19ed('0x52')]({'where':{'id':_0x1b4e3b[_0x19ed('0x51')]['id']}})[_0x19ed('0x1c')](handleEntityNotFound(_0x41b03b,null))['then'](saveUpdates(_0x1b4e3b[_0x19ed('0x56')],null))[_0x19ed('0x1c')](function(_0x2c92a6){if(_0x2c92a6){_0x2e3340=_0x2c92a6;return db[_0x19ed('0x4a')]['findAll']({'where':{'type':_0x2e3340['type']},'raw':!![]});}return null;})[_0x19ed('0x1c')](function(_0x50a878){if(_0x2e3340['type'][_0x19ed('0x60')]()==_0x19ed('0x57')){var _0x523e41=fs[_0x19ed('0x58')](path['join'](config[_0x19ed('0x59')],_0x19ed('0x5a')),'utf8');var _0x57da34=ejs[_0x19ed('0x5b')](_0x523e41,{'networks':_0x50a878||[]});fs[_0x19ed('0x5c')](_0x19ed('0x5d'),_0x57da34);return respondWithRpcPromise(_0x19ed('0x5e'),_0x19ed('0x2f'),{'module':'res_stun_monitor.so'});}else if(_0x2e3340[_0x19ed('0x38')]['toUpperCase']()==_0x19ed('0x68')){var _0x556f88=fs[_0x19ed('0x58')](path[_0x19ed('0x61')](config[_0x19ed('0x59')],_0x19ed('0x62')),_0x19ed('0x63'));var _0x151ada=ejs[_0x19ed('0x5b')](_0x556f88,{'networks':_0x50a878||[]});fs[_0x19ed('0x5c')](_0x19ed('0x64'),_0x151ada);return respondWithRpcPromise('Reload',_0x19ed('0x2f'),{'module':_0x19ed('0x5f')});}else{var _0x2d992c=fs[_0x19ed('0x58')](path[_0x19ed('0x61')](config['root'],_0x19ed('0x65')),_0x19ed('0x63'));var _0x2164da=ejs['render'](_0x2d992c,{'networks':_0x50a878||[]});fs['writeFileSync'](util[_0x19ed('0x66')](_0x19ed('0x69'),_0x1b4e3b[_0x19ed('0x56')][_0x19ed('0x38')][_0x19ed('0x67')]()),_0x2164da);return respondWithRpcPromise(_0x19ed('0x5e'),_0x19ed('0x2f'),{'module':_0x19ed('0x6a')});}return null;})[_0x19ed('0x1c')](function(_0x550475){if(_0x550475){return _0x2e3340;}return null;});})['then'](respondWithResult(_0x41b03b,null))[_0x19ed('0x4f')](handleError(_0x41b03b,null));};exports[_0x19ed('0x30')]=function(_0x5bd9d9,_0x1227e0,_0x37e8be){var _0x4598ed;return db['Network'][_0x19ed('0x52')]({'where':{'id':_0x5bd9d9[_0x19ed('0x51')]['id']}})[_0x19ed('0x1c')](function(_0x1e0d0e){_0x4598ed=_0x1e0d0e;return _0x1e0d0e;})[_0x19ed('0x1c')](handleEntityNotFound(_0x1227e0,null))[_0x19ed('0x1c')](removeEntity(_0x1227e0,null))['then'](function(){if(_0x4598ed){return db[_0x19ed('0x4a')][_0x19ed('0x4d')]({'where':{'type':_0x4598ed[_0x19ed('0x38')]},'raw':!![]});}})['then'](function(_0x2c460f){if(_0x4598ed['type']['toUpperCase']()==_0x19ed('0x57')){var _0x4b68c1=fs[_0x19ed('0x58')](path[_0x19ed('0x61')](config[_0x19ed('0x59')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x48e4c1=ejs[_0x19ed('0x5b')](_0x4b68c1,{'networks':_0x2c460f||[]});fs[_0x19ed('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x48e4c1);return respondWithRpcPromise(_0x19ed('0x5e'),_0x19ed('0x30'),{'module':'res_stun_monitor.so'});}else if(_0x4598ed[_0x19ed('0x38')][_0x19ed('0x60')]()==_0x19ed('0x68')){var _0x360454=fs[_0x19ed('0x58')](path['join'](config['root'],'server/files/templates/turn_multiple.ejs'),_0x19ed('0x63'));var _0x381053=ejs[_0x19ed('0x5b')](_0x360454,{'networks':_0x2c460f||[]});fs[_0x19ed('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x381053);return respondWithRpcPromise('Reload','destroy',{'module':_0x19ed('0x5f')});}else{var _0x481c96=fs['readFileSync'](path[_0x19ed('0x61')](config['root'],'server/files/templates/network.ejs'),_0x19ed('0x63'));var _0x54529b=ejs['render'](_0x481c96,{'networks':_0x2c460f||[]});fs['writeFileSync'](util[_0x19ed('0x66')](_0x19ed('0x69'),_0x5bd9d9[_0x19ed('0x56')][_0x19ed('0x38')]['toLowerCase']()),_0x54529b);return respondWithRpcPromise(_0x19ed('0x5e'),_0x19ed('0x30'),{'module':_0x19ed('0x6a')});}return null;})[_0x19ed('0x4f')](handleError(_0x1227e0,null));}; \ No newline at end of file +var _0xbd35=['type','options','includeAll','include','findAll','params','length','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','chan_sip.so','find','server/files/templates/stun_multiple.ejs','TURN','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','destroy','eml-format','rimraf','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','error','code','message','Network,\x20%s,\x20%s','catch','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','status','sendStatus','name','send','map','Network','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge'];(function(_0x137d1d,_0x35c663){var _0x485108=function(_0x108a2a){while(--_0x108a2a){_0x137d1d['push'](_0x137d1d['shift']());}};_0x485108(++_0x35c663);}(_0xbd35,0x153));var _0x5bd3=function(_0x50ec05,_0x57baa1){_0x50ec05=_0x50ec05-0x0;var _0x9174bc=_0xbd35[_0x50ec05];return _0x9174bc;};'use strict';var emlformat=require(_0x5bd3('0x0'));var rimraf=require(_0x5bd3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5bd3('0x2'));var moment=require('moment');var BPromise=require(_0x5bd3('0x3'));var Mustache=require('mustache');var util=require(_0x5bd3('0x4'));var path=require(_0x5bd3('0x5'));var sox=require(_0x5bd3('0x6'));var csv=require('to-csv');var ejs=require(_0x5bd3('0x7'));var fs=require('fs');var fs_extra=require(_0x5bd3('0x8'));var _=require(_0x5bd3('0x9'));var squel=require('squel');var crypto=require(_0x5bd3('0xa'));var jsforce=require(_0x5bd3('0xb'));var deskjs=require(_0x5bd3('0xc'));var toCsv=require(_0x5bd3('0xd'));var querystring=require(_0x5bd3('0xe'));var Papa=require(_0x5bd3('0xf'));var Redis=require(_0x5bd3('0x10'));var authService=require(_0x5bd3('0x11'));var qs=require(_0x5bd3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bd3('0x13'));var logger=require('../../config/logger')(_0x5bd3('0x14'));var utils=require(_0x5bd3('0x15'));var config=require(_0x5bd3('0x16'));var licenseUtil=require(_0x5bd3('0x17'));var db=require(_0x5bd3('0x18'))['db'];var jayson=require(_0x5bd3('0x19'));var client=jayson['client'][_0x5bd3('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x59af25,_0x5d8336,_0x40f096,_0x86df1c){return new BPromise(function(_0x18a467,_0x259d5e){var _0x5eac1c=_0x86df1c||client;return _0x5eac1c[_0x5bd3('0x1b')](_0x59af25,_0x40f096)[_0x5bd3('0x1c')](function(_0xad263a){logger[_0x5bd3('0x1d')]('Network,\x20%s,\x20%s',_0x5d8336,_0x5bd3('0x1e'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x5d8336,_0x5bd3('0x1e'),JSON['stringify'](_0xad263a));if(_0xad263a[_0x5bd3('0x1f')]){if(_0xad263a[_0x5bd3('0x1f')][_0x5bd3('0x20')]===0x1f4){logger[_0x5bd3('0x1f')]('Network,\x20%s,\x20%s',_0x5d8336,_0xad263a[_0x5bd3('0x1f')][_0x5bd3('0x21')]);return _0x259d5e(_0xad263a[_0x5bd3('0x1f')][_0x5bd3('0x21')]);}logger[_0x5bd3('0x1f')](_0x5bd3('0x22'),_0x5d8336,_0xad263a[_0x5bd3('0x1f')]['message']);return _0x18a467(_0xad263a[_0x5bd3('0x1f')][_0x5bd3('0x21')]);}else{logger['info'](_0x5bd3('0x22'),_0x5d8336,'request\x20sent');_0x18a467(_0xad263a['result']['message']);}})[_0x5bd3('0x23')](function(_0x4ae8ac){logger[_0x5bd3('0x1f')]('Network,\x20%s,\x20%s',_0x5d8336,_0x4ae8ac);_0x259d5e(_0x4ae8ac);});});}function respondWithStatusCode(_0x1580d1,_0x59c369){_0x59c369=_0x59c369||0xcc;return function(_0xe219f5){if(_0xe219f5){return _0x1580d1['sendStatus'](_0x59c369);}return _0x1580d1['status'](_0x59c369)[_0x5bd3('0x24')]();};}function respondWithResult(_0x46a8fb,_0x16dc54){_0x16dc54=_0x16dc54||0xc8;return function(_0x30c147){if(_0x30c147){return _0x46a8fb['status'](_0x16dc54)[_0x5bd3('0x25')](_0x30c147);}};}function respondWithFilteredResult(_0x2714a0,_0x7351ad){return function(_0x2a69af){if(_0x2a69af){var _0x1a9fbd=typeof _0x7351ad[_0x5bd3('0x26')]===_0x5bd3('0x27')&&typeof _0x7351ad[_0x5bd3('0x28')]===_0x5bd3('0x27');var _0x4473b5=_0x2a69af[_0x5bd3('0x29')];var _0x256e7e=_0x1a9fbd?0x0:_0x7351ad[_0x5bd3('0x26')];var _0x2fc773=_0x1a9fbd?_0x2a69af[_0x5bd3('0x29')]:_0x7351ad[_0x5bd3('0x26')]+_0x7351ad['limit'];var _0x5abdf0;if(_0x2fc773>=_0x4473b5){_0x2fc773=_0x4473b5;_0x5abdf0=0xc8;}else{_0x5abdf0=0xce;}_0x2714a0['status'](_0x5abdf0);return _0x2714a0['set'](_0x5bd3('0x2a'),_0x256e7e+'-'+_0x2fc773+'/'+_0x4473b5)['json'](_0x2a69af);}return null;};}function patchUpdates(_0x28f66d){return function(_0x3b00f0){try{jsonpatch[_0x5bd3('0x2b')](_0x3b00f0,_0x28f66d,!![]);}catch(_0x1f6a29){return BPromise[_0x5bd3('0x2c')](_0x1f6a29);}return _0x3b00f0[_0x5bd3('0x2d')]();};}function saveUpdates(_0x2d5743,_0x5dd5ee){return function(_0x2788c4){if(_0x2788c4){return _0x2788c4[_0x5bd3('0x2e')](_0x2d5743)[_0x5bd3('0x1c')](function(_0x436122){return _0x436122;});}return null;};}function removeEntity(_0x18ecad,_0x5825af){return function(_0x578a95){if(_0x578a95){return _0x578a95['destroy']()[_0x5bd3('0x1c')](function(){_0x18ecad[_0x5bd3('0x2f')](0xcc)[_0x5bd3('0x24')]();});}};}function handleEntityNotFound(_0x57defb,_0x432fc5){return function(_0x22493e){if(!_0x22493e){_0x57defb[_0x5bd3('0x30')](0x194);}return _0x22493e;};}function handleError(_0x34e992,_0x395620){_0x395620=_0x395620||0x1f4;return function(_0x47d793){logger[_0x5bd3('0x1f')](_0x47d793['stack']);if(_0x47d793[_0x5bd3('0x31')]){delete _0x47d793[_0x5bd3('0x31')];}_0x34e992[_0x5bd3('0x2f')](_0x395620)[_0x5bd3('0x32')](_0x47d793);};}exports['index']=function(_0x5d1808,_0x3cb84a){var _0x4295ec={},_0x56483f={},_0x123245={'count':0x0,'rows':[]};var _0x324b7f=_[_0x5bd3('0x33')](db[_0x5bd3('0x34')][_0x5bd3('0x35')],function(_0x4bd75d){return{'name':_0x4bd75d[_0x5bd3('0x36')],'type':_0x4bd75d['type']['key']};});_0x56483f['model']=_[_0x5bd3('0x33')](_0x324b7f,'name');_0x56483f[_0x5bd3('0x37')]=_[_0x5bd3('0x38')](_0x5d1808['query']);_0x56483f[_0x5bd3('0x39')]=_[_0x5bd3('0x3a')](_0x56483f[_0x5bd3('0x3b')],_0x56483f[_0x5bd3('0x37')]);_0x4295ec[_0x5bd3('0x3c')]=_[_0x5bd3('0x3a')](_0x56483f[_0x5bd3('0x3b')],qs[_0x5bd3('0x3d')](_0x5d1808[_0x5bd3('0x37')][_0x5bd3('0x3d')]));_0x4295ec[_0x5bd3('0x3c')]=_0x4295ec['attributes']['length']?_0x4295ec['attributes']:_0x56483f[_0x5bd3('0x3b')];if(!_0x5d1808[_0x5bd3('0x37')]['hasOwnProperty'](_0x5bd3('0x3e'))){_0x4295ec[_0x5bd3('0x28')]=qs['limit'](_0x5d1808[_0x5bd3('0x37')][_0x5bd3('0x28')]);_0x4295ec[_0x5bd3('0x26')]=qs[_0x5bd3('0x26')](_0x5d1808[_0x5bd3('0x37')][_0x5bd3('0x26')]);}_0x4295ec[_0x5bd3('0x3f')]=qs[_0x5bd3('0x40')](_0x5d1808[_0x5bd3('0x37')][_0x5bd3('0x40')]);_0x4295ec[_0x5bd3('0x41')]=qs[_0x5bd3('0x39')](_[_0x5bd3('0x42')](_0x5d1808[_0x5bd3('0x37')],_0x56483f['filters']),_0x324b7f);if(_0x5d1808[_0x5bd3('0x37')][_0x5bd3('0x43')]){_0x4295ec[_0x5bd3('0x41')]=_[_0x5bd3('0x44')](_0x4295ec['where'],{'$or':_['map'](_0x324b7f,function(_0x277dc9){if(_0x277dc9[_0x5bd3('0x45')]!=='VIRTUAL'){var _0x3761d1={};_0x3761d1[_0x277dc9[_0x5bd3('0x31')]]={'$like':'%'+_0x5d1808[_0x5bd3('0x37')]['filter']+'%'};return _0x3761d1;}})});}_0x4295ec=_['merge']({},_0x4295ec,_0x5d1808[_0x5bd3('0x46')]);var _0x98a8ce={'where':_0x4295ec[_0x5bd3('0x41')]};return db[_0x5bd3('0x34')][_0x5bd3('0x29')](_0x98a8ce)[_0x5bd3('0x1c')](function(_0x59b170){_0x123245[_0x5bd3('0x29')]=_0x59b170;if(_0x5d1808[_0x5bd3('0x37')][_0x5bd3('0x47')]){_0x4295ec[_0x5bd3('0x48')]=[{'all':!![]}];}return db['Network'][_0x5bd3('0x49')](_0x4295ec);})[_0x5bd3('0x1c')](function(_0x2152e9){_0x123245['rows']=_0x2152e9;return _0x123245;})['then'](respondWithFilteredResult(_0x3cb84a,_0x4295ec))[_0x5bd3('0x23')](handleError(_0x3cb84a,null));};exports['show']=function(_0xa506d6,_0x5ec945){var _0x2759b5={'raw':!![],'where':{'id':_0xa506d6[_0x5bd3('0x4a')]['id']}},_0x45f649={};_0x45f649[_0x5bd3('0x3b')]=_[_0x5bd3('0x38')](db[_0x5bd3('0x34')][_0x5bd3('0x35')]);_0x45f649[_0x5bd3('0x37')]=_[_0x5bd3('0x38')](_0xa506d6[_0x5bd3('0x37')]);_0x45f649[_0x5bd3('0x39')]=_[_0x5bd3('0x3a')](_0x45f649[_0x5bd3('0x3b')],_0x45f649[_0x5bd3('0x37')]);_0x2759b5['attributes']=_[_0x5bd3('0x3a')](_0x45f649[_0x5bd3('0x3b')],qs[_0x5bd3('0x3d')](_0xa506d6[_0x5bd3('0x37')][_0x5bd3('0x3d')]));_0x2759b5[_0x5bd3('0x3c')]=_0x2759b5[_0x5bd3('0x3c')][_0x5bd3('0x4b')]?_0x2759b5[_0x5bd3('0x3c')]:_0x45f649[_0x5bd3('0x3b')];if(_0xa506d6['query']['includeAll']){_0x2759b5['include']=[{'all':!![]}];}_0x2759b5=_['merge']({},_0x2759b5,_0xa506d6[_0x5bd3('0x46')]);return db[_0x5bd3('0x34')]['find'](_0x2759b5)[_0x5bd3('0x1c')](handleEntityNotFound(_0x5ec945,null))[_0x5bd3('0x1c')](respondWithResult(_0x5ec945,null))[_0x5bd3('0x23')](handleError(_0x5ec945,null));};exports[_0x5bd3('0x4c')]=function(_0x2cb438,_0x51672f,_0x3e430a){var _0x1b4227;return db[_0x5bd3('0x4d')][_0x5bd3('0x4e')](function(_0x2f975a){return db['Network'][_0x5bd3('0x4c')](_0x2cb438[_0x5bd3('0x4f')],{'raw':!![]})[_0x5bd3('0x1c')](function(_0x5d62ac){_0x1b4227=_0x5d62ac;return db['Network']['findAll']({'where':{'type':_0x2cb438[_0x5bd3('0x4f')]['type']},'raw':!![]});})[_0x5bd3('0x1c')](function(_0x127f69){if(_0x1b4227['type'][_0x5bd3('0x50')]()==_0x5bd3('0x51')){var _0x5c64e3=fs[_0x5bd3('0x52')](path[_0x5bd3('0x53')](config[_0x5bd3('0x54')],'server/files/templates/stun_multiple.ejs'),_0x5bd3('0x55'));var _0x3a9234=ejs[_0x5bd3('0x56')](_0x5c64e3,{'networks':_0x127f69||[]});fs[_0x5bd3('0x57')](_0x5bd3('0x58'),_0x3a9234);return respondWithRpcPromise(_0x5bd3('0x59'),_0x5bd3('0x4c'),{'module':'res_stun_monitor.so'});}else if(_0x1b4227[_0x5bd3('0x45')]['toUpperCase']()=='TURN'){var _0x4c8bd0=fs['readFileSync'](path[_0x5bd3('0x53')](config['root'],_0x5bd3('0x5a')),_0x5bd3('0x55'));var _0x179b76=ejs[_0x5bd3('0x56')](_0x4c8bd0,{'networks':_0x127f69||[]});fs[_0x5bd3('0x57')](_0x5bd3('0x5b'),_0x179b76);return respondWithRpcPromise(_0x5bd3('0x59'),_0x5bd3('0x4c'),{'module':_0x5bd3('0x5c')});}else{var _0x510c20=fs['readFileSync'](path[_0x5bd3('0x53')](config[_0x5bd3('0x54')],_0x5bd3('0x5d')),'utf8');var _0x5ad340=ejs[_0x5bd3('0x56')](_0x510c20,{'networks':_0x127f69||[]});fs[_0x5bd3('0x57')](util[_0x5bd3('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0x2cb438[_0x5bd3('0x4f')][_0x5bd3('0x45')]['toLowerCase']()),_0x5ad340);return respondWithRpcPromise(_0x5bd3('0x59'),_0x5bd3('0x4c'),{'module':_0x5bd3('0x5f')});}return null;})['then'](function(){return _0x1b4227;});})[_0x5bd3('0x1c')](respondWithResult(_0x51672f,0xc9))[_0x5bd3('0x23')](handleError(_0x51672f,null));};exports[_0x5bd3('0x2e')]=function(_0x3bc2ba,_0xf0af7f,_0x26b751){var _0x65785e;return db[_0x5bd3('0x4d')][_0x5bd3('0x4e')](function(_0x13fe13){return db[_0x5bd3('0x34')][_0x5bd3('0x60')]({'where':{'id':_0x3bc2ba[_0x5bd3('0x4a')]['id']}})['then'](handleEntityNotFound(_0xf0af7f,null))[_0x5bd3('0x1c')](saveUpdates(_0x3bc2ba[_0x5bd3('0x4f')],null))[_0x5bd3('0x1c')](function(_0x417fad){if(_0x417fad){_0x65785e=_0x417fad;return db['Network'][_0x5bd3('0x49')]({'where':{'type':_0x65785e[_0x5bd3('0x45')]},'raw':!![]});}return null;})[_0x5bd3('0x1c')](function(_0x3bc6c4){if(_0x65785e['type'][_0x5bd3('0x50')]()=='STUN'){var _0x428d90=fs[_0x5bd3('0x52')](path[_0x5bd3('0x53')](config['root'],_0x5bd3('0x61')),_0x5bd3('0x55'));var _0x3dd70e=ejs['render'](_0x428d90,{'networks':_0x3bc6c4||[]});fs[_0x5bd3('0x57')](_0x5bd3('0x58'),_0x3dd70e);return respondWithRpcPromise(_0x5bd3('0x59'),_0x5bd3('0x2e'),{'module':_0x5bd3('0x5c')});}else if(_0x65785e[_0x5bd3('0x45')]['toUpperCase']()==_0x5bd3('0x62')){var _0x161845=fs[_0x5bd3('0x52')](path[_0x5bd3('0x53')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x5bd3('0x55'));var _0x4c03f0=ejs[_0x5bd3('0x56')](_0x161845,{'networks':_0x3bc6c4||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x4c03f0);return respondWithRpcPromise(_0x5bd3('0x59'),'update',{'module':_0x5bd3('0x5c')});}else{var _0x7cb1b0=fs['readFileSync'](path['join'](config[_0x5bd3('0x54')],_0x5bd3('0x5d')),_0x5bd3('0x55'));var _0x13b1f6=ejs['render'](_0x7cb1b0,{'networks':_0x3bc6c4||[]});fs[_0x5bd3('0x57')](util[_0x5bd3('0x5e')](_0x5bd3('0x63'),_0x3bc2ba['body'][_0x5bd3('0x45')][_0x5bd3('0x64')]()),_0x13b1f6);return respondWithRpcPromise(_0x5bd3('0x59'),_0x5bd3('0x2e'),{'module':_0x5bd3('0x5f')});}return null;})[_0x5bd3('0x1c')](function(_0x3cc592){if(_0x3cc592){return _0x65785e;}return null;});})[_0x5bd3('0x1c')](respondWithResult(_0xf0af7f,null))[_0x5bd3('0x23')](handleError(_0xf0af7f,null));};exports[_0x5bd3('0x65')]=function(_0x261bec,_0x5f3b36,_0x2051ee){var _0x58ac53;return db['Network'][_0x5bd3('0x60')]({'where':{'id':_0x261bec[_0x5bd3('0x4a')]['id']}})[_0x5bd3('0x1c')](function(_0x3bd78e){_0x58ac53=_0x3bd78e;return _0x3bd78e;})[_0x5bd3('0x1c')](handleEntityNotFound(_0x5f3b36,null))['then'](removeEntity(_0x5f3b36,null))[_0x5bd3('0x1c')](function(){if(_0x58ac53){return db[_0x5bd3('0x34')][_0x5bd3('0x49')]({'where':{'type':_0x58ac53['type']},'raw':!![]});}})[_0x5bd3('0x1c')](function(_0x40231f){if(_0x58ac53[_0x5bd3('0x45')][_0x5bd3('0x50')]()==_0x5bd3('0x51')){var _0x328547=fs[_0x5bd3('0x52')](path[_0x5bd3('0x53')](config[_0x5bd3('0x54')],'server/files/templates/stun_multiple.ejs'),_0x5bd3('0x55'));var _0x37fa4e=ejs[_0x5bd3('0x56')](_0x328547,{'networks':_0x40231f||[]});fs[_0x5bd3('0x57')](_0x5bd3('0x58'),_0x37fa4e);return respondWithRpcPromise('Reload',_0x5bd3('0x65'),{'module':'res_stun_monitor.so'});}else if(_0x58ac53[_0x5bd3('0x45')][_0x5bd3('0x50')]()==_0x5bd3('0x62')){var _0x9a4bb0=fs[_0x5bd3('0x52')](path['join'](config[_0x5bd3('0x54')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x4ccf9d=ejs[_0x5bd3('0x56')](_0x9a4bb0,{'networks':_0x40231f||[]});fs[_0x5bd3('0x57')](_0x5bd3('0x5b'),_0x4ccf9d);return respondWithRpcPromise('Reload',_0x5bd3('0x65'),{'module':_0x5bd3('0x5c')});}else{var _0xad3a32=fs['readFileSync'](path[_0x5bd3('0x53')](config[_0x5bd3('0x54')],'server/files/templates/network.ejs'),_0x5bd3('0x55'));var _0x27c51a=ejs[_0x5bd3('0x56')](_0xad3a32,{'networks':_0x40231f||[]});fs[_0x5bd3('0x57')](util[_0x5bd3('0x5e')](_0x5bd3('0x63'),_0x261bec[_0x5bd3('0x4f')][_0x5bd3('0x45')]['toLowerCase']()),_0x27c51a);return respondWithRpcPromise(_0x5bd3('0x59'),_0x5bd3('0x65'),{'module':_0x5bd3('0x5f')});}return null;})[_0x5bd3('0x23')](handleError(_0x5f3b36,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 89cbf5b..31c66c8 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 _0xb248=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./network.attributes','exports','define','network'];(function(_0x33d502,_0x502d64){var _0x57a5e2=function(_0xf9864f){while(--_0xf9864f){_0x33d502['push'](_0x33d502['shift']());}};_0x57a5e2(++_0x502d64);}(_0xb248,0xc6));var _0x8b24=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb248[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0x8b24('0x0'));var util=require('util');var logger=require(_0x8b24('0x1'))(_0x8b24('0x2'));var moment=require(_0x8b24('0x3'));var BPromise=require(_0x8b24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b24('0x5'));var rimraf=require(_0x8b24('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b24('0x7'));module[_0x8b24('0x8')]=function(_0x4cc3c4,_0x6da5b7){return _0x4cc3c4[_0x8b24('0x9')]('Network',attributes,{'tableName':_0x8b24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96cc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network'];(function(_0x3f43d6,_0x2efc89){var _0x1c693f=function(_0x3da47c){while(--_0x3da47c){_0x3f43d6['push'](_0x3f43d6['shift']());}};_0x1c693f(++_0x2efc89);}(_0x96cc,0x16c));var _0xc96c=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x96cc[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var logger=require(_0xc96c('0x1'))('api');var moment=require(_0xc96c('0x2'));var BPromise=require(_0xc96c('0x3'));var rp=require(_0xc96c('0x4'));var fs=require('fs');var path=require(_0xc96c('0x5'));var rimraf=require(_0xc96c('0x6'));var config=require(_0xc96c('0x7'));var attributes=require(_0xc96c('0x8'));module[_0xc96c('0x9')]=function(_0x3b7f45,_0x5142cd){return _0x3b7f45[_0xc96c('0xa')](_0xc96c('0xb'),attributes,{'tableName':_0xc96c('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 528daea..69b9ae8 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x44dfd4,_0x3ab061){_0x44dfd4=_0x44dfd4-0x0;var _0x41853c=_0x7a54[_0x44dfd4];return _0x41853c;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x479077,_0x244c1f){_0x479077=_0x479077-0x0;var _0x1fad83=_0x7a54[_0x479077];return _0x1fad83;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 83f8b94..6ab4ab0 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 _0xad10=['getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','send','put','update','destroy','delete','removeDispositions','removeAgents','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/:id','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad10,0x72));var _0x0ad1=function(_0xf89396,_0x283850){_0xf89396=_0xf89396-0x0;var _0x4787b9=_0xad10[_0xf89396];return _0x4787b9;};'use strict';var multer=require(_0x0ad1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0ad1('0x1'));var router=express[_0x0ad1('0x2')]();var fs_extra=require(_0x0ad1('0x3'));var auth=require(_0x0ad1('0x4'));var interaction=require(_0x0ad1('0x5'));var config=require(_0x0ad1('0x6'));var controller=require(_0x0ad1('0x7'));router[_0x0ad1('0x8')]('/',auth[_0x0ad1('0x9')](),controller['index']);router['get']('/describe',auth[_0x0ad1('0x9')](),controller['describe']);router[_0x0ad1('0x8')](_0x0ad1('0xa'),auth[_0x0ad1('0x9')](),controller['show']);router[_0x0ad1('0x8')](_0x0ad1('0xb'),auth[_0x0ad1('0x9')](),controller[_0x0ad1('0xc')]);router['get'](_0x0ad1('0xd'),auth[_0x0ad1('0x9')](),controller[_0x0ad1('0xe')]);router['get'](_0x0ad1('0xf'),auth['isAuthenticated'](),controller[_0x0ad1('0x10')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller[_0x0ad1('0x11')]);router['get'](_0x0ad1('0x12'),auth[_0x0ad1('0x9')](),controller[_0x0ad1('0x13')]);router[_0x0ad1('0x14')]('/',auth['isAuthenticated'](),controller[_0x0ad1('0x15')]);router[_0x0ad1('0x14')](_0x0ad1('0xb'),auth[_0x0ad1('0x9')](),controller['addDisposition']);router[_0x0ad1('0x14')](_0x0ad1('0xd'),auth[_0x0ad1('0x9')](),controller[_0x0ad1('0x16')]);router[_0x0ad1('0x14')](_0x0ad1('0x17'),controller[_0x0ad1('0x18')]);router[_0x0ad1('0x14')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x0ad1('0x14')](_0x0ad1('0x12'),auth[_0x0ad1('0x9')](),controller['addAgents']);router[_0x0ad1('0x14')]('/:id/send',auth[_0x0ad1('0x9')](),controller[_0x0ad1('0x19')]);router[_0x0ad1('0x1a')](_0x0ad1('0xa'),auth[_0x0ad1('0x9')](),controller[_0x0ad1('0x1b')]);router['delete'](_0x0ad1('0xa'),auth['isAuthenticated'](),controller[_0x0ad1('0x1c')]);router[_0x0ad1('0x1d')](_0x0ad1('0xb'),auth['isAuthenticated'](),controller[_0x0ad1('0x1e')]);router[_0x0ad1('0x1d')](_0x0ad1('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x0ad1('0x12'),auth[_0x0ad1('0x9')](),controller[_0x0ad1('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x1ced=['addDisposition','/:id/notify','addApplications','/:id/users','addAgents','put','update','delete','destroy','removeAnswers','exports','multer','util','path','Router','fs-extra','../../config/environment','./openchannelAccount.controller','index','/describe','isAuthenticated','get','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','post','create'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x1ced,0x1eb));var _0xd1ce=function(_0x234318,_0xf22f31){_0x234318=_0x234318-0x0;var _0x1ab719=_0x1ced[_0x234318];return _0x1ab719;};'use strict';var multer=require(_0xd1ce('0x0'));var util=require(_0xd1ce('0x1'));var path=require(_0xd1ce('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd1ce('0x3')]();var fs_extra=require(_0xd1ce('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1ce('0x5'));var controller=require(_0xd1ce('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xd1ce('0x7')]);router['get'](_0xd1ce('0x8'),auth[_0xd1ce('0x9')](),controller['describe']);router[_0xd1ce('0xa')](_0xd1ce('0xb'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0xc')]);router[_0xd1ce('0xa')](_0xd1ce('0xd'),auth[_0xd1ce('0x9')](),controller['getDispositions']);router[_0xd1ce('0xa')](_0xd1ce('0xe'),auth[_0xd1ce('0x9')](),controller['getAnswers']);router['get'](_0xd1ce('0xf'),auth['isAuthenticated'](),controller[_0xd1ce('0x10')]);router[_0xd1ce('0xa')](_0xd1ce('0x11'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x12')]);router[_0xd1ce('0xa')]('/:id/users',auth[_0xd1ce('0x9')](),controller['getAgents']);router[_0xd1ce('0x13')]('/',auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x14')]);router['post'](_0xd1ce('0xd'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x15')]);router[_0xd1ce('0x13')](_0xd1ce('0xe'),auth[_0xd1ce('0x9')](),controller['addAnswer']);router['post'](_0xd1ce('0x16'),controller['notify']);router[_0xd1ce('0x13')](_0xd1ce('0xf'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x17')]);router[_0xd1ce('0x13')](_0xd1ce('0x18'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x19')]);router[_0xd1ce('0x13')]('/:id/send',auth[_0xd1ce('0x9')](),controller['send']);router[_0xd1ce('0x1a')](_0xd1ce('0xb'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x1b')]);router[_0xd1ce('0x1c')](_0xd1ce('0xb'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x1d')]);router['delete'](_0xd1ce('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xd1ce('0x1c')](_0xd1ce('0xe'),auth[_0xd1ce('0x9')](),controller[_0xd1ce('0x1e')]);router[_0xd1ce('0x1c')](_0xd1ce('0x18'),auth[_0xd1ce('0x9')](),controller['removeAgents']);module[_0xd1ce('0x1f')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index f0863c8..75c26ce 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 _0x6af5=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x5d9e33,_0x5860de){var _0x3ac443=function(_0x4b6f8f){while(--_0x4b6f8f){_0x5d9e33['push'](_0x5d9e33['shift']());}};_0x3ac443(++_0x5860de);}(_0x6af5,0x173));var _0x56af=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x6af5[_0x47fd36];return _0x21a0fc;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x56af('0x0'));module[_0x56af('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x56af('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x56af('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x56af('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x56af('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x56af('0x4')],'defaultValue':function(){return _0x56af('0x5');}},'notificationSound':{'type':Sequelize[_0x56af('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x56af('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x56af('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x56af('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x56af('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x56af('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x56af('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x56af('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x56af('0x6')],'defaultValue':![],'comment':_0x56af('0x9'),'set':function(_0x82d6c4){if(!_0x82d6c4)this[_0x56af('0xa')](_0x56af('0xb'),null);this[_0x56af('0xa')](_0x56af('0xc'),_0x82d6c4);}}}; \ No newline at end of file +var _0x7fdb=['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','generate'];(function(_0x4c8416,_0x855e19){var _0x1b6d4=function(_0x291975){while(--_0x291975){_0x4c8416['push'](_0x4c8416['shift']());}};_0x1b6d4(++_0x855e19);}(_0x7fdb,0x134));var _0xb7fd=function(_0xe09d0,_0x1e55d0){_0xe09d0=_0xe09d0-0x0;var _0x44ad05=_0x7fdb[_0xe09d0];return _0x44ad05;};'use strict';var Sequelize=require(_0xb7fd('0x0'));var rs=require('randomstring');module[_0xb7fd('0x1')]={'name':{'type':Sequelize[_0xb7fd('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb7fd('0x2')]},'token':{'type':Sequelize[_0xb7fd('0x2')],'defaultValue':function(){return rs[_0xb7fd('0x3')]();}},'replyUri':{'type':Sequelize[_0xb7fd('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb7fd('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb7fd('0x4')],'defaultValue':function(){return _0xb7fd('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb7fd('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb7fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb7fd('0x2')]},'queueTransfer':{'type':Sequelize[_0xb7fd('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb7fd('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb7fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb7fd('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb7fd('0x6')],'defaultValue':![],'comment':_0xb7fd('0x9'),'set':function(_0x3075e3){if(!_0x3075e3)this[_0xb7fd('0xa')](_0xb7fd('0xb'),null);this[_0xb7fd('0xa')](_0xb7fd('0xc'),_0x3075e3);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 0a0dd58..403c4bf 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 _0x3003=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','List','DESC','account','list','applications','priority','asc','Applications','Contacts','defaults','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','created','interaction','push','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','OpenchannelApplication','finally','send','getApplications','pick','getInteractions','Contact','Tag','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','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','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','json','offset','undefined','count','limit','status','Content-Range','reject','update','get','UserProfileResource','destroy','end','stack','name','Pause','OpenchannelAccount','fieldName','type','key','model','map','query'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0x3003,0x138));var _0x3300=function(_0x524cfa,_0x2a553a){_0x524cfa=_0x524cfa-0x0;var _0x289484=_0x3003[_0x524cfa];return _0x289484;};'use strict';var emlformat=require(_0x3300('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3300('0x1'));var jsonpatch=require(_0x3300('0x2'));var rp=require(_0x3300('0x3'));var moment=require(_0x3300('0x4'));var BPromise=require(_0x3300('0x5'));var Mustache=require(_0x3300('0x6'));var util=require('util');var path=require(_0x3300('0x7'));var sox=require(_0x3300('0x8'));var csv=require(_0x3300('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3300('0xa'));var _=require('lodash');var squel=require(_0x3300('0xb'));var crypto=require('crypto');var jsforce=require(_0x3300('0xc'));var deskjs=require(_0x3300('0xd'));var toCsv=require(_0x3300('0x9'));var querystring=require(_0x3300('0xe'));var Papa=require(_0x3300('0xf'));var Redis=require(_0x3300('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3300('0x11'));var as=require(_0x3300('0x12'));var hardwareService=require(_0x3300('0x13'));var logger=require(_0x3300('0x14'))(_0x3300('0x15'));var utils=require(_0x3300('0x16'));var config=require(_0x3300('0x17'));var licenseUtil=require(_0x3300('0x18'));var db=require(_0x3300('0x19'))['db'];config['redis']=_['defaults'](config[_0x3300('0x1a')],{'host':_0x3300('0x1b'),'port':0x18eb});var socket=require(_0x3300('0x1c'))(new Redis(config[_0x3300('0x1a')]));require(_0x3300('0x1d'))[_0x3300('0x1e')](socket);var jayson=require(_0x3300('0x1f'));var client=jayson[_0x3300('0x20')][_0x3300('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x3300('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5ba4d3,_0x25e78d,_0x2ce492,_0x31ab6e){return new BPromise(function(_0x5293a0,_0x2e8030){var _0x294fc2=_0x31ab6e||client;return _0x294fc2[_0x3300('0x22')](_0x5ba4d3,_0x2ce492)[_0x3300('0x23')](function(_0x503297){logger[_0x3300('0x24')](_0x3300('0x25'),_0x25e78d,_0x3300('0x26'));logger[_0x3300('0x27')](_0x3300('0x28'),_0x25e78d,'request\x20sent',JSON[_0x3300('0x29')](_0x503297));if(_0x503297[_0x3300('0x2a')]){if(_0x503297[_0x3300('0x2a')][_0x3300('0x2b')]===0x1f4){logger['error'](_0x3300('0x25'),_0x25e78d,_0x503297[_0x3300('0x2a')][_0x3300('0x2c')]);return _0x2e8030(_0x503297[_0x3300('0x2a')][_0x3300('0x2c')]);}logger[_0x3300('0x2a')](_0x3300('0x25'),_0x25e78d,_0x503297[_0x3300('0x2a')][_0x3300('0x2c')]);return _0x5293a0(_0x503297['error']['message']);}else{logger[_0x3300('0x24')](_0x3300('0x25'),_0x25e78d,_0x3300('0x26'));_0x5293a0(_0x503297['result'][_0x3300('0x2c')]);}})[_0x3300('0x2d')](function(_0x4b28a3){logger[_0x3300('0x2a')](_0x3300('0x25'),_0x25e78d,_0x4b28a3);_0x2e8030(_0x4b28a3);});});}function respondWithStatusCode(_0x4c4c96,_0x24bdf0){_0x24bdf0=_0x24bdf0||0xcc;return function(_0x11f3be){if(_0x11f3be){return _0x4c4c96[_0x3300('0x2e')](_0x24bdf0);}return _0x4c4c96['status'](_0x24bdf0)['end']();};}function respondWithResult(_0x39741e,_0x1fe356){_0x1fe356=_0x1fe356||0xc8;return function(_0x1813eb){if(_0x1813eb){return _0x39741e['status'](_0x1fe356)[_0x3300('0x2f')](_0x1813eb);}};}function respondWithFilteredResult(_0x3692a0,_0x535703){return function(_0x57bc7d){if(_0x57bc7d){var _0x191571=typeof _0x535703[_0x3300('0x30')]===_0x3300('0x31')&&typeof _0x535703['limit']===_0x3300('0x31');var _0x1a99d4=_0x57bc7d['count'];var _0x52a00d=_0x191571?0x0:_0x535703[_0x3300('0x30')];var _0x26338b=_0x191571?_0x57bc7d[_0x3300('0x32')]:_0x535703['offset']+_0x535703[_0x3300('0x33')];var _0x47bb1c;if(_0x26338b>=_0x1a99d4){_0x26338b=_0x1a99d4;_0x47bb1c=0xc8;}else{_0x47bb1c=0xce;}_0x3692a0[_0x3300('0x34')](_0x47bb1c);return _0x3692a0['set'](_0x3300('0x35'),_0x52a00d+'-'+_0x26338b+'/'+_0x1a99d4)[_0x3300('0x2f')](_0x57bc7d);}return null;};}function patchUpdates(_0xd26be9){return function(_0x55aee0){try{jsonpatch['apply'](_0x55aee0,_0xd26be9,!![]);}catch(_0x544751){return BPromise[_0x3300('0x36')](_0x544751);}return _0x55aee0['save']();};}function saveUpdates(_0x1d165c,_0x3d0fa8){return function(_0x1e63d0){if(_0x1e63d0){return _0x1e63d0[_0x3300('0x37')](_0x1d165c)[_0x3300('0x23')](function(_0xd5036b){return _0xd5036b;});}return null;};}function removeEntity(_0x378f11,_0xc095c6){return function(_0x55e3de){if(_0x55e3de){return _0x55e3de['destroy']()[_0x3300('0x23')](function(){var _0x14ed2a=_0x55e3de[_0x3300('0x38')]({'plain':!![]});var _0x1b2b4a='OpenchannelAccounts';return db[_0x3300('0x39')][_0x3300('0x3a')]({'where':{'type':_0x1b2b4a,'resourceId':_0x14ed2a['id']}})[_0x3300('0x23')](function(){return _0x55e3de;});})[_0x3300('0x23')](function(){_0x378f11[_0x3300('0x34')](0xcc)[_0x3300('0x3b')]();});}};}function handleEntityNotFound(_0x194476,_0x347f5b){return function(_0x314e78){if(!_0x314e78){_0x194476[_0x3300('0x2e')](0x194);}return _0x314e78;};}function handleError(_0x346894,_0x1dcb38){_0x1dcb38=_0x1dcb38||0x1f4;return function(_0x534c04){logger[_0x3300('0x2a')](_0x534c04[_0x3300('0x3c')]);if(_0x534c04[_0x3300('0x3d')]){delete _0x534c04[_0x3300('0x3d')];}_0x346894['status'](_0x1dcb38)['send'](_0x534c04);};}exports['index']=function(_0x512fa1,_0x5bd362){var _0x3c2dc1={'include':[{'model':db[_0x3300('0x3e')],'as':'mandatoryDispositionPause'}]},_0x212b26={},_0x550649={'count':0x0,'rows':[]};var _0x58bb43=_['map'](db[_0x3300('0x3f')]['rawAttributes'],function(_0x118cca){return{'name':_0x118cca[_0x3300('0x40')],'type':_0x118cca[_0x3300('0x41')][_0x3300('0x42')]};});_0x212b26[_0x3300('0x43')]=_[_0x3300('0x44')](_0x58bb43,'name');_0x212b26[_0x3300('0x45')]=_[_0x3300('0x46')](_0x512fa1[_0x3300('0x45')]);_0x212b26[_0x3300('0x47')]=_[_0x3300('0x48')](_0x212b26[_0x3300('0x43')],_0x212b26[_0x3300('0x45')]);_0x3c2dc1[_0x3300('0x49')]=_[_0x3300('0x48')](_0x212b26[_0x3300('0x43')],qs[_0x3300('0x4a')](_0x512fa1[_0x3300('0x45')][_0x3300('0x4a')]));_0x3c2dc1[_0x3300('0x49')]=_0x3c2dc1['attributes'][_0x3300('0x4b')]?_0x3c2dc1[_0x3300('0x49')]:_0x212b26[_0x3300('0x43')];if(!_0x512fa1[_0x3300('0x45')][_0x3300('0x4c')]('nolimit')){_0x3c2dc1[_0x3300('0x33')]=qs[_0x3300('0x33')](_0x512fa1[_0x3300('0x45')][_0x3300('0x33')]);_0x3c2dc1[_0x3300('0x30')]=qs['offset'](_0x512fa1[_0x3300('0x45')][_0x3300('0x30')]);}_0x3c2dc1[_0x3300('0x4d')]=qs[_0x3300('0x4e')](_0x512fa1['query'][_0x3300('0x4e')]);_0x3c2dc1[_0x3300('0x4f')]=qs[_0x3300('0x47')](_['pick'](_0x512fa1['query'],_0x212b26[_0x3300('0x47')]),_0x58bb43);if(_0x512fa1[_0x3300('0x45')][_0x3300('0x50')]){_0x3c2dc1[_0x3300('0x4f')]=_['merge'](_0x3c2dc1['where'],{'$or':_['map'](_0x58bb43,function(_0x330804){if(_0x330804[_0x3300('0x41')]!==_0x3300('0x51')){var _0x3d497d={};_0x3d497d[_0x330804[_0x3300('0x3d')]]={'$like':'%'+_0x512fa1[_0x3300('0x45')][_0x3300('0x50')]+'%'};return _0x3d497d;}})});}_0x3c2dc1=_[_0x3300('0x52')]({},_0x3c2dc1,_0x512fa1[_0x3300('0x53')]);var _0xf9fb88={'where':_0x3c2dc1['where']};return db[_0x3300('0x3f')][_0x3300('0x32')](_0xf9fb88)[_0x3300('0x23')](function(_0x68ef40){_0x550649['count']=_0x68ef40;if(_0x512fa1[_0x3300('0x45')][_0x3300('0x54')]){_0x3c2dc1[_0x3300('0x55')]=[{'all':!![]}];}return db[_0x3300('0x3f')][_0x3300('0x56')](_0x3c2dc1);})[_0x3300('0x23')](function(_0xaed615){_0x550649[_0x3300('0x57')]=_0xaed615;return _0x550649;})['then'](respondWithFilteredResult(_0x5bd362,_0x3c2dc1))[_0x3300('0x2d')](handleError(_0x5bd362,null));};exports[_0x3300('0x58')]=function(_0x27a6b5,_0x2cb42f){var _0x2a35d4={'raw':![],'where':{'id':_0x27a6b5[_0x3300('0x59')]['id']},'include':[{'model':db[_0x3300('0x3e')],'as':_0x3300('0x5a')}]},_0x42bca5={};_0x42bca5[_0x3300('0x43')]=_[_0x3300('0x46')](db[_0x3300('0x3f')][_0x3300('0x5b')]);_0x42bca5[_0x3300('0x45')]=_[_0x3300('0x46')](_0x27a6b5[_0x3300('0x45')]);_0x42bca5[_0x3300('0x47')]=_[_0x3300('0x48')](_0x42bca5['model'],_0x42bca5[_0x3300('0x45')]);_0x2a35d4[_0x3300('0x49')]=_['intersection'](_0x42bca5[_0x3300('0x43')],qs['fields'](_0x27a6b5[_0x3300('0x45')]['fields']));_0x2a35d4[_0x3300('0x49')]=_0x2a35d4['attributes'][_0x3300('0x4b')]?_0x2a35d4['attributes']:_0x42bca5[_0x3300('0x43')];if(_0x27a6b5[_0x3300('0x45')][_0x3300('0x54')]){_0x2a35d4['include']=[{'all':!![]}];}_0x2a35d4=_[_0x3300('0x52')]({},_0x2a35d4,_0x27a6b5[_0x3300('0x53')]);return db['OpenchannelAccount'][_0x3300('0x5c')](_0x2a35d4)['then'](handleEntityNotFound(_0x2cb42f,null))[_0x3300('0x23')](respondWithResult(_0x2cb42f,null))['catch'](handleError(_0x2cb42f,null));};exports[_0x3300('0x5d')]=function(_0x14d134,_0x476db7){return db[_0x3300('0x3f')]['create'](_0x14d134[_0x3300('0x5e')],{})[_0x3300('0x23')](function(_0x2991f6){var _0x33aa59=_0x14d134[_0x3300('0x5f')][_0x3300('0x38')]({'plain':!![]});if(!_0x33aa59)throw new Error(_0x3300('0x60'));if(_0x33aa59[_0x3300('0x61')]===_0x3300('0x5f')){var _0x55e5ca=_0x2991f6[_0x3300('0x38')]({'plain':!![]});var _0x4a7e35='OpenchannelAccounts';return db[_0x3300('0x62')][_0x3300('0x5c')]({'where':{'name':_0x4a7e35,'userProfileId':_0x33aa59[_0x3300('0x63')]},'raw':!![]})[_0x3300('0x23')](function(_0x3efa8e){if(_0x3efa8e&&_0x3efa8e[_0x3300('0x64')]===0x0){return db['UserProfileResource'][_0x3300('0x5d')]({'name':_0x55e5ca[_0x3300('0x3d')],'resourceId':_0x55e5ca['id'],'type':_0x3efa8e[_0x3300('0x3d')],'sectionId':_0x3efa8e['id']},{})[_0x3300('0x23')](function(){return _0x2991f6;});}else{return _0x2991f6;}})[_0x3300('0x2d')](function(_0x4bc6b9){logger[_0x3300('0x2a')](_0x3300('0x65'),_0x4bc6b9);throw _0x4bc6b9;});}return _0x2991f6;})[_0x3300('0x23')](respondWithResult(_0x476db7,0xc9))[_0x3300('0x2d')](handleError(_0x476db7,null));};exports[_0x3300('0x37')]=function(_0x53671e,_0x1e7bb4){if(_0x53671e[_0x3300('0x5e')]['id']){delete _0x53671e[_0x3300('0x5e')]['id'];}return db[_0x3300('0x3f')][_0x3300('0x5c')]({'where':{'id':_0x53671e['params']['id']},'include':[{'model':db[_0x3300('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x1e7bb4,null))[_0x3300('0x23')](saveUpdates(_0x53671e['body'],null))[_0x3300('0x23')](respondWithResult(_0x1e7bb4,null))[_0x3300('0x2d')](handleError(_0x1e7bb4,null));};exports['destroy']=function(_0x5a8b8d,_0x544a18){return db[_0x3300('0x3f')]['find']({'where':{'id':_0x5a8b8d[_0x3300('0x59')]['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x544a18,null))[_0x3300('0x23')](removeEntity(_0x544a18,null))['catch'](handleError(_0x544a18,null));};exports[_0x3300('0x66')]=function(_0xf17b03,_0x3af447){return db[_0x3300('0x3f')][_0x3300('0x66')]()['then'](respondWithResult(_0x3af447,null))[_0x3300('0x2d')](handleError(_0x3af447,null));};exports[_0x3300('0x67')]=function(_0x58f7fd,_0x21081c,_0x4a1c33){if(_0x58f7fd[_0x3300('0x5e')]['id']){delete _0x58f7fd[_0x3300('0x5e')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x58f7fd[_0x3300('0x59')]['id']}})['then'](handleEntityNotFound(_0x21081c,null))[_0x3300('0x23')](function(_0x46592e){if(_0x46592e){_0x58f7fd['body']['OpenchannelAccountId']=_0x46592e['id'];return db[_0x3300('0x68')][_0x3300('0x5d')](_0x58f7fd[_0x3300('0x5e')]);}})[_0x3300('0x23')](respondWithResult(_0x21081c,null))[_0x3300('0x2d')](handleError(_0x21081c,null));};exports[_0x3300('0x69')]=function(_0x31cd31,_0x20995d,_0x58a196){var _0x56f5db={'raw':![],'where':{}};var _0x5b7257={};var _0x35e4b9={'count':0x0,'rows':[]};return db[_0x3300('0x3f')][_0x3300('0x6a')]({'where':{'id':_0x31cd31['params']['id']}})['then'](handleEntityNotFound(_0x20995d,null))[_0x3300('0x23')](function(_0x525fc1){if(_0x525fc1){_0x5b7257[_0x3300('0x43')]=_[_0x3300('0x46')](db['Disposition'][_0x3300('0x5b')]);_0x5b7257[_0x3300('0x45')]=_[_0x3300('0x46')](_0x31cd31[_0x3300('0x45')]);_0x5b7257[_0x3300('0x47')]=_[_0x3300('0x48')](_0x5b7257[_0x3300('0x43')],_0x5b7257[_0x3300('0x45')]);_0x56f5db[_0x3300('0x49')]=_[_0x3300('0x48')](_0x5b7257[_0x3300('0x43')],qs[_0x3300('0x4a')](_0x31cd31[_0x3300('0x45')][_0x3300('0x4a')]));_0x56f5db[_0x3300('0x49')]=_0x56f5db[_0x3300('0x49')][_0x3300('0x4b')]?_0x56f5db[_0x3300('0x49')]:_0x5b7257[_0x3300('0x43')];if(!_0x31cd31[_0x3300('0x45')]['hasOwnProperty'](_0x3300('0x6b'))){_0x56f5db[_0x3300('0x33')]=qs[_0x3300('0x33')](_0x31cd31[_0x3300('0x45')][_0x3300('0x33')]);_0x56f5db[_0x3300('0x30')]=qs[_0x3300('0x30')](_0x31cd31[_0x3300('0x45')]['offset']);}_0x56f5db['order']=qs[_0x3300('0x4e')](_0x31cd31['query'][_0x3300('0x4e')]);_0x56f5db[_0x3300('0x4f')]=qs['filters'](_['pick'](_0x31cd31[_0x3300('0x45')],_0x5b7257['filters']));_0x56f5db[_0x3300('0x4f')][_0x3300('0x6c')]=_0x525fc1['id'];if(_0x31cd31['query']['filter']){_0x56f5db[_0x3300('0x4f')]=_[_0x3300('0x52')](_0x56f5db[_0x3300('0x4f')],{'$or':_[_0x3300('0x44')](_0x56f5db[_0x3300('0x49')],function(_0x4f0014){var _0x335a58={};_0x335a58[_0x4f0014]={'$like':'%'+_0x31cd31[_0x3300('0x45')][_0x3300('0x50')]+'%'};return _0x335a58;})});}_0x56f5db=_[_0x3300('0x52')]({},_0x56f5db,_0x31cd31[_0x3300('0x53')]);return db['Disposition'][_0x3300('0x32')]({'where':_0x56f5db['where']})[_0x3300('0x23')](function(_0x4d18f3){_0x35e4b9['count']=_0x4d18f3;if(_0x31cd31[_0x3300('0x45')][_0x3300('0x54')]){_0x56f5db[_0x3300('0x55')]=[{'all':!![]}];}return db[_0x3300('0x68')]['findAll'](_0x56f5db);})[_0x3300('0x23')](function(_0x8db50c){_0x35e4b9[_0x3300('0x57')]=_0x8db50c;return _0x35e4b9;});}})[_0x3300('0x23')](respondWithFilteredResult(_0x20995d,_0x56f5db))[_0x3300('0x2d')](handleError(_0x20995d,null));};exports[_0x3300('0x6d')]=function(_0x351331,_0x5b8d05,_0x36d47e){return db['OpenchannelAccount'][_0x3300('0x5c')]({'where':{'id':_0x351331[_0x3300('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b8d05,null))[_0x3300('0x23')](function(_0x1df155){if(_0x1df155){return _0x1df155['removeDispositions'](_0x351331[_0x3300('0x45')][_0x3300('0x6e')]);}})[_0x3300('0x23')](respondWithStatusCode(_0x5b8d05,null))[_0x3300('0x2d')](handleError(_0x5b8d05,null));};exports[_0x3300('0x6f')]=function(_0x363e44,_0x4faf84,_0x37d44b){if(_0x363e44['body']['id']){delete _0x363e44[_0x3300('0x5e')]['id'];}return db[_0x3300('0x3f')][_0x3300('0x5c')]({'where':{'id':_0x363e44[_0x3300('0x59')]['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x4faf84,null))[_0x3300('0x23')](function(_0x56ee87){if(_0x56ee87){_0x363e44['body']['OpenchannelAccountId']=_0x56ee87['id'];return db[_0x3300('0x70')][_0x3300('0x5d')](_0x363e44[_0x3300('0x5e')]);}})[_0x3300('0x23')](respondWithResult(_0x4faf84,null))['catch'](handleError(_0x4faf84,null));};exports[_0x3300('0x71')]=function(_0x29169d,_0x4910d6,_0x5389d0){var _0x20f2e2={'raw':![],'where':{}};var _0x3eb968={};var _0x1c10f9={'count':0x0,'rows':[]};return db[_0x3300('0x3f')][_0x3300('0x6a')]({'where':{'id':_0x29169d['params']['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x4910d6,null))[_0x3300('0x23')](function(_0x20d93d){if(_0x20d93d){_0x3eb968[_0x3300('0x43')]=_[_0x3300('0x46')](db[_0x3300('0x70')][_0x3300('0x5b')]);_0x3eb968['query']=_[_0x3300('0x46')](_0x29169d[_0x3300('0x45')]);_0x3eb968[_0x3300('0x47')]=_['intersection'](_0x3eb968[_0x3300('0x43')],_0x3eb968[_0x3300('0x45')]);_0x20f2e2[_0x3300('0x49')]=_['intersection'](_0x3eb968[_0x3300('0x43')],qs[_0x3300('0x4a')](_0x29169d[_0x3300('0x45')]['fields']));_0x20f2e2[_0x3300('0x49')]=_0x20f2e2[_0x3300('0x49')]['length']?_0x20f2e2[_0x3300('0x49')]:_0x3eb968[_0x3300('0x43')];if(!_0x29169d[_0x3300('0x45')][_0x3300('0x4c')](_0x3300('0x6b'))){_0x20f2e2[_0x3300('0x33')]=qs[_0x3300('0x33')](_0x29169d['query'][_0x3300('0x33')]);_0x20f2e2['offset']=qs[_0x3300('0x30')](_0x29169d[_0x3300('0x45')][_0x3300('0x30')]);}_0x20f2e2['order']=qs['sort'](_0x29169d[_0x3300('0x45')]['sort']);_0x20f2e2[_0x3300('0x4f')]=qs[_0x3300('0x47')](_['pick'](_0x29169d[_0x3300('0x45')],_0x3eb968[_0x3300('0x47')]));_0x20f2e2['where']['OpenchannelAccountId']=_0x20d93d['id'];if(_0x29169d['query'][_0x3300('0x50')]){_0x20f2e2[_0x3300('0x4f')]=_['merge'](_0x20f2e2[_0x3300('0x4f')],{'$or':_['map'](_0x20f2e2[_0x3300('0x49')],function(_0x4ddec1){var _0x575c97={};_0x575c97[_0x4ddec1]={'$like':'%'+_0x29169d['query']['filter']+'%'};return _0x575c97;})});}_0x20f2e2=_[_0x3300('0x52')]({},_0x20f2e2,_0x29169d[_0x3300('0x53')]);return db['CannedAnswer'][_0x3300('0x32')]({'where':_0x20f2e2[_0x3300('0x4f')]})['then'](function(_0x1a2f81){_0x1c10f9[_0x3300('0x32')]=_0x1a2f81;if(_0x29169d[_0x3300('0x45')][_0x3300('0x54')]){_0x20f2e2[_0x3300('0x55')]=[{'all':!![]}];}return db[_0x3300('0x70')][_0x3300('0x56')](_0x20f2e2);})[_0x3300('0x23')](function(_0xd655be){_0x1c10f9['rows']=_0xd655be;return _0x1c10f9;});}})['then'](respondWithFilteredResult(_0x4910d6,_0x20f2e2))[_0x3300('0x2d')](handleError(_0x4910d6,null));};exports['removeAnswers']=function(_0x3f64ee,_0x4e29d9,_0x54246e){return db[_0x3300('0x3f')][_0x3300('0x5c')]({'where':{'id':_0x3f64ee['params']['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x4e29d9,null))['then'](function(_0x484bf7){if(_0x484bf7){return _0x484bf7[_0x3300('0x72')](_0x3f64ee[_0x3300('0x45')][_0x3300('0x6e')]);}})[_0x3300('0x23')](respondWithStatusCode(_0x4e29d9,null))[_0x3300('0x2d')](handleError(_0x4e29d9,null));};exports[_0x3300('0x73')]=function(_0x57775b,_0x1400dd,_0x53da23){var _0x20e98b={'body':_0x57775b['body'],'channel':_0x3300('0x74')};var _0x3e3dbd=[];var _0x5d3424=[];var _0x431987={};var _0x4080bc=![];return db[_0x3300('0x75')][_0x3300('0x66')]()[_0x3300('0x23')](function(_0x13a8e6){if(!_0x13a8e6){throw new db[(_0x3300('0x76'))]['ValidationError'](_0x3300('0x77'));}_0x3e3dbd=_[_0x3300('0x78')](_[_0x3300('0x46')](_0x13a8e6),['createdAt',_0x3300('0x79')]);_0x5d3424=_[_0x3300('0x78')](_[_0x3300('0x46')](_0x13a8e6),[_0x3300('0x7a'),_0x3300('0x79'),_0x3300('0x7b'),_0x3300('0x7c')]);if(_0x57775b[_0x3300('0x5e')]['id']){delete _0x57775b[_0x3300('0x5e')]['id'];}if(_[_0x3300('0x7d')](_0x57775b[_0x3300('0x5e')][_0x3300('0x7e')])){throw new db[(_0x3300('0x76'))][(_0x3300('0x7f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x57775b['body'][_0x3300('0x5e')])||_0x57775b[_0x3300('0x5e')][_0x3300('0x5e')]===''){throw new db[(_0x3300('0x76'))][(_0x3300('0x7f'))](_0x3300('0x80'));}if(_[_0x3300('0x7d')](_0x57775b[_0x3300('0x5e')]['mapKey'])){throw new db[(_0x3300('0x76'))][(_0x3300('0x7f'))](_0x3300('0x81')+_0x5d3424);}if(!_[_0x3300('0x82')](_0x5d3424,_0x57775b[_0x3300('0x5e')][_0x3300('0x83')])){throw new db[(_0x3300('0x76'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d3424);}_0x431987[_0x57775b[_0x3300('0x5e')][_0x3300('0x83')]]=_0x57775b[_0x3300('0x5e')][_0x3300('0x7e')];})[_0x3300('0x23')](function(){return db[_0x3300('0x3f')][_0x3300('0x5c')]({'where':{'id':_0x57775b[_0x3300('0x59')]['id']},'include':[{'model':db[_0x3300('0x84')],'as':_0x3300('0x85'),'include':[{'model':db[_0x3300('0x75')],'as':'Contacts','where':_0x431987,'limit':0x1,'order':[[_0x3300('0x79'),_0x3300('0x86')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x3300('0x23')](handleEntityNotFound(_0x1400dd,null))[_0x3300('0x23')](function(_0x422314){if(_0x422314&&_0x422314[_0x3300('0x85')]){_0x20e98b[_0x3300('0x87')]=_0x422314;_0x20e98b['applications']=_0x422314['Applications'];_0x20e98b[_0x3300('0x88')]=_0x422314[_0x3300('0x85')];_0x20e98b['applications']=_['orderBy'](_0x20e98b[_0x3300('0x89')],[_0x3300('0x8a')],[_0x3300('0x8b')]);if(_0x20e98b['account'][_0x3300('0x8c')]){delete _0x20e98b[_0x3300('0x87')][_0x3300('0x8c')];}if(_0x20e98b['account'][_0x3300('0x85')]&&_0x20e98b[_0x3300('0x87')][_0x3300('0x85')][_0x3300('0x8d')][_0x3300('0x4b')]){return _0x20e98b[_0x3300('0x87')]['List'][_0x3300('0x8d')][0x0];}var _0x3c02d0=_[_0x3300('0x8e')](_0x57775b[_0x3300('0x5e')],{'firstName':_0x57775b[_0x3300('0x5e')][_0x3300('0x7e')],'ListId':_0x422314[_0x3300('0x7c')]});_0x3c02d0[_0x57775b[_0x3300('0x5e')][_0x3300('0x83')]]=_0x57775b[_0x3300('0x5e')][_0x3300('0x7e')];return db['CmContact'][_0x3300('0x5d')](_0x3c02d0,{'fields':_0x3e3dbd,'raw':!![]});}})[_0x3300('0x23')](handleEntityNotFound(_0x1400dd,null))['then'](function(_0x40b910){_0x20e98b[_0x3300('0x8f')]=_0x40b910;if(_0x40b910){var _0xace99e={'ContactId':_0x40b910['id'],'OpenchannelAccountId':_0x57775b['params']['id'],'from':(_0x40b910[_0x3300('0x90')]||'')+'\x20'+(_0x40b910[_0x3300('0x91')]||'')};var _0x434464={'OpenchannelAccountId':_0x57775b[_0x3300('0x59')]['id'],'closed':![]};if(_0x57775b[_0x3300('0x5e')][_0x3300('0x92')]){_0x434464[_0x3300('0x92')]=_0x57775b['body'][_0x3300('0x92')];return db[_0x3300('0x93')][_0x3300('0x5c')]({'where':_0x434464})[_0x3300('0x23')](function(_0x11ea36){if(_0x11ea36){return[_0x11ea36,![]];}_0xace99e['threadId']=_0x57775b[_0x3300('0x5e')][_0x3300('0x92')];_0xace99e['externalUrl']=_0x57775b[_0x3300('0x5e')][_0x3300('0x94')];return db['OpenchannelInteraction'][_0x3300('0x5d')](_0xace99e)['then'](function(_0x3aeeb9){return[_0x3aeeb9,!![]];});});}else{_0x434464['threadId']=null;}_0x434464[_0x3300('0x95')]=_0x40b910['id'];return db[_0x3300('0x93')][_0x3300('0x5c')]({'where':_0x434464})[_0x3300('0x23')](function(_0x53494d){if(_0x53494d){return[_0x53494d,![]];}return db[_0x3300('0x93')][_0x3300('0x5d')](_0xace99e)[_0x3300('0x23')](function(_0xa200ee){return[_0xa200ee,!![]];});});}})[_0x3300('0x96')](function(_0x4854e8,_0x42c0de){if(_0x4854e8){_0x4080bc=_0x42c0de;if(!_0x42c0de){var _0x123a25={'from':(_0x20e98b['contact'][_0x3300('0x90')]||'')+'\x20'+(_0x20e98b['contact'][_0x3300('0x91')]||'')};if(_0x57775b[_0x3300('0x5e')][_0x3300('0x92')]&&_0x57775b['body'][_0x3300('0x97')]&&_0x57775b[_0x3300('0x5e')]['threadId']!=_0x57775b[_0x3300('0x5e')]['messageId']){_0x123a25['threadId']=_0x57775b[_0x3300('0x5e')]['messageId'];}return _0x4854e8[_0x3300('0x37')](_0x123a25);}else{return _0x4854e8;}}})[_0x3300('0x23')](function(_0x121e2c){_0x20e98b['interaction']=_0x121e2c[_0x3300('0x38')]({'plain':!![]});_0x20e98b['interaction'][_0x3300('0x98')]=_0x4080bc;if(_0x20e98b[_0x3300('0x99')][_0x3300('0x98')]){if(_0x20e98b[_0x3300('0x87')]['autoclose']){_0x20e98b[_0x3300('0x89')][_0x3300('0x9a')]({'id':0x0,'priority':_0x20e98b[_0x3300('0x89')][_0x3300('0x4b')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x3300('0x9b')});}}return db[_0x3300('0x9c')][_0x3300('0x5d')]({'body':_0x57775b[_0x3300('0x5e')][_0x3300('0x5e')],'OpenchannelAccountId':_0x57775b[_0x3300('0x59')]['id'],'OpenchannelInteractionId':_0x121e2c['id'],'direction':'in','ContactId':_0x20e98b[_0x3300('0x8f')]['id'],'AttachmentId':_0x57775b[_0x3300('0x5e')][_0x3300('0x9d')]});})[_0x3300('0x23')](function(_0x41ea53){_0x20e98b['message']=_0x41ea53;if(_0x20e98b[_0x3300('0x99')][_0x3300('0x9e')]){return db[_0x3300('0x9f')][_0x3300('0x5c')]({'attributes':['id',_0x3300('0x3d')],'where':{'id':_0x20e98b[_0x3300('0x99')][_0x3300('0x9e')]}})[_0x3300('0x23')](function(_0x275729){if(_0x275729){_0x20e98b['applications'][_0x3300('0xa0')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x275729[_0x3300('0x3d')]+','+(_0x20e98b[_0x3300('0x87')][_0x3300('0xa1')]||0xa),'interval':_0x3300('0x9b')});_0x20e98b[_0x3300('0xa2')]=![];}return respondWithRpcPromise('Start',_0x3300('0xa3'),_0x20e98b);});}return respondWithRpcPromise(_0x3300('0xa4'),_0x3300('0xa3'),_0x20e98b);})['then'](function(_0x2aa449){respondWithRpcPromise(_0x3300('0xa5'),_0x3300('0xa5'),{'event':_0x3300('0x73'),'message':_0x2aa449},client9002);return _0x2aa449;})[_0x3300('0x23')](respondWithResult(_0x1400dd,null))[_0x3300('0x2d')](handleError(_0x1400dd,null));};exports[_0x3300('0xa6')]=function(_0x37c96b,_0x44bf93){var _0x497166=_0x37c96b[_0x3300('0x59')]['id'];var _0x405b70=_0x37c96b[_0x3300('0x5e')];var _0x37a9c2=0xc8;var _0x38f935=null;return db[_0x3300('0xa7')][_0x3300('0xa8')]({'isolationLevel':db['sequelize'][_0x3300('0xa9')]['ISOLATION_LEVELS'][_0x3300('0xaa')]},function(_0x1ab25f){return db[_0x3300('0x3f')][_0x3300('0x6a')]({'where':{'id':_0x497166},'transaction':_0x1ab25f})[_0x3300('0x23')](function(_0x3a9a60){if(_0x3a9a60){return db['OpenchannelApplication'][_0x3300('0x3a')]({'where':{'OpenchannelAccountId':_0x497166},'transaction':_0x1ab25f})[_0x3300('0x23')](function(){var _0x23bbc6=_[_0x3300('0x44')](_0x405b70,function(_0x1e5095){_0x1e5095[_0x3300('0x6c')]=_0x497166;return _0x1e5095;});return db[_0x3300('0xab')]['bulkCreate'](_0x23bbc6,{'transaction':_0x1ab25f});});}else{_0x37a9c2=0x194;_0x38f935=[];}});})['then'](function(){if(_0x37a9c2!==0x194){return db[_0x3300('0xab')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x497166},'order':'priority'})[_0x3300('0x23')](function(_0x2f88c2){_0x38f935=_0x2f88c2;});}})[_0x3300('0x2d')](function(_0x4a5c27){_0x37a9c2=0x1f4;logger[_0x3300('0x2a')](_0x4a5c27[_0x3300('0x3c')]);if(_0x4a5c27['name']){delete _0x4a5c27['name'];}_0x38f935=_0x4a5c27;})[_0x3300('0xac')](function(){if(_0x38f935===null){_0x44bf93['sendStatus'](_0x37a9c2);}else{if(_0x37a9c2===0x1f4){_0x44bf93['status'](_0x37a9c2)[_0x3300('0xad')](_0x38f935);}else{_0x44bf93[_0x3300('0x34')](_0x37a9c2)[_0x3300('0x2f')](_0x38f935);}}});};exports[_0x3300('0xae')]=function(_0x5f0095,_0x5319be,_0x5dcea0){var _0x2df664={};var _0x4ac027={};var _0x50fcc0;var _0x58febc;return db[_0x3300('0x3f')][_0x3300('0x6a')]({'where':{'id':_0x5f0095[_0x3300('0x59')]['id']}})['then'](handleEntityNotFound(_0x5319be,null))['then'](function(_0x21c6f1){if(_0x21c6f1){_0x50fcc0=_0x21c6f1;_0x4ac027[_0x3300('0x43')]=_['keys'](db['OpenchannelApplication'][_0x3300('0x5b')]);_0x4ac027[_0x3300('0x45')]=_[_0x3300('0x46')](_0x5f0095['query']);_0x4ac027['filters']=_[_0x3300('0x48')](_0x4ac027[_0x3300('0x43')],_0x4ac027[_0x3300('0x45')]);_0x2df664[_0x3300('0x49')]=_[_0x3300('0x48')](_0x4ac027[_0x3300('0x43')],qs['fields'](_0x5f0095['query']['fields']));_0x2df664['attributes']=_0x2df664[_0x3300('0x49')]['length']?_0x2df664[_0x3300('0x49')]:_0x4ac027[_0x3300('0x43')];_0x2df664[_0x3300('0x4d')]=qs['sort'](_0x5f0095['query']['sort']);_0x2df664[_0x3300('0x4f')]=qs[_0x3300('0x47')](_[_0x3300('0xaf')](_0x5f0095[_0x3300('0x45')],_0x4ac027[_0x3300('0x47')]));if(_0x5f0095[_0x3300('0x45')][_0x3300('0x50')]){_0x2df664['where']=_[_0x3300('0x52')](_0x2df664[_0x3300('0x4f')],{'$or':_[_0x3300('0x44')](_0x2df664[_0x3300('0x49')],function(_0x14567a){var _0x59778f={};_0x59778f[_0x14567a]={'$like':'%'+_0x5f0095['query'][_0x3300('0x50')]+'%'};return _0x59778f;})});}_0x2df664=_[_0x3300('0x52')]({},_0x2df664,_0x5f0095[_0x3300('0x53')]);return _0x50fcc0['getApplications'](_0x2df664);}})[_0x3300('0x23')](function(_0x37f85a){if(_0x37f85a){_0x58febc=_0x37f85a[_0x3300('0x4b')];if(!_0x5f0095['query']['hasOwnProperty'](_0x3300('0x6b'))){_0x2df664[_0x3300('0x33')]=qs[_0x3300('0x33')](_0x5f0095[_0x3300('0x45')]['limit']);_0x2df664['offset']=qs['offset'](_0x5f0095['query'][_0x3300('0x30')]);}return _0x50fcc0[_0x3300('0xae')](_0x2df664);}})[_0x3300('0x23')](function(_0x5d1c33){if(_0x5d1c33){return _0x5d1c33?{'count':_0x58febc,'rows':_0x5d1c33}:null;}})[_0x3300('0x23')](respondWithResult(_0x5319be,null))[_0x3300('0x2d')](handleError(_0x5319be,null));};exports[_0x3300('0xb0')]=function(_0x270378,_0x429a4f,_0x30273f){var _0x5ec017={'raw':![],'where':{}};var _0x4817fa={};var _0x3215b5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3300('0x6a')]({'where':{'id':_0x270378[_0x3300('0x59')]['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x429a4f,null))[_0x3300('0x23')](function(_0x56fffa){if(_0x56fffa){_0x4817fa[_0x3300('0x43')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x4817fa[_0x3300('0x45')]=_[_0x3300('0x46')](_0x270378[_0x3300('0x45')]);_0x4817fa[_0x3300('0x47')]=_[_0x3300('0x48')](_0x4817fa[_0x3300('0x43')],_0x4817fa[_0x3300('0x45')]);_0x5ec017[_0x3300('0x49')]=_[_0x3300('0x48')](_0x4817fa['model'],qs[_0x3300('0x4a')](_0x270378[_0x3300('0x45')][_0x3300('0x4a')]));_0x5ec017[_0x3300('0x49')]=_0x5ec017[_0x3300('0x49')]['length']?_0x5ec017[_0x3300('0x49')]:_0x4817fa[_0x3300('0x43')];if(!_0x270378[_0x3300('0x45')][_0x3300('0x4c')](_0x3300('0x6b'))){_0x5ec017[_0x3300('0x33')]=qs['limit'](_0x270378[_0x3300('0x45')]['limit']);_0x5ec017[_0x3300('0x30')]=qs[_0x3300('0x30')](_0x270378[_0x3300('0x45')][_0x3300('0x30')]);}_0x5ec017[_0x3300('0x4d')]=qs['sort'](_0x270378[_0x3300('0x45')]['sort']);_0x5ec017[_0x3300('0x4f')]=qs[_0x3300('0x47')](_['pick'](_0x270378[_0x3300('0x45')],_0x4817fa[_0x3300('0x47')]));_0x5ec017['where'][_0x3300('0x6c')]=_0x56fffa['id'];if(_0x270378[_0x3300('0x45')]['filter']){_0x5ec017['where']=_[_0x3300('0x52')](_0x5ec017[_0x3300('0x4f')],{'$or':_[_0x3300('0x44')](_0x5ec017[_0x3300('0x49')],function(_0x4e0794){var _0x116e09={};_0x116e09[_0x4e0794]={'$like':'%'+_0x270378[_0x3300('0x45')][_0x3300('0x50')]+'%'};return _0x116e09;})});}_0x5ec017=_['merge']({},_0x5ec017,_0x270378[_0x3300('0x53')]);return db[_0x3300('0x93')][_0x3300('0x32')]({'where':_0x5ec017[_0x3300('0x4f')]})[_0x3300('0x23')](function(_0x15fac6){_0x3215b5['count']=_0x15fac6;if(_0x270378[_0x3300('0x45')][_0x3300('0x54')]){_0x5ec017['include']=[{'model':db[_0x3300('0x75')],'as':_0x3300('0xb1'),'required':![]},{'model':db[_0x3300('0x9f')],'as':'Owner','attributes':[_0x3300('0x3d'),'fullname','internal'],'required':![]},{'model':db[_0x3300('0xb2')],'as':'Tags','attributes':['id',_0x3300('0x3d'),'color'],'where':_0x270378[_0x3300('0x45')][_0x3300('0xb3')]?{'id':_0x270378[_0x3300('0x45')][_0x3300('0xb3')]}:undefined,'required':_0x270378[_0x3300('0x45')][_0x3300('0xb3')]?!![]:![]}];}return db[_0x3300('0x93')][_0x3300('0x56')](_0x5ec017);})['then'](function(_0x4a98ad){_0x3215b5[_0x3300('0x57')]=_0x4a98ad;return _0x3215b5;});}})[_0x3300('0x23')](respondWithFilteredResult(_0x429a4f,_0x5ec017))[_0x3300('0x2d')](handleError(_0x429a4f,null));};exports[_0x3300('0xb4')]=function(_0x447540,_0x3f836c,_0x49dd15){return db[_0x3300('0x3f')][_0x3300('0x5c')]({'where':{'id':_0x447540['params']['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x3f836c,null))[_0x3300('0x23')](function(_0xd8242e){if(_0xd8242e){return _0xd8242e[_0x3300('0xb4')](_0x447540[_0x3300('0x5e')][_0x3300('0x6e')],_[_0x3300('0xb5')](_0x447540[_0x3300('0x5e')],[_0x3300('0x6e'),'id'])||{})['spread'](function(_0x2bca68){for(var _0x44f191=0x0;_0x44f191<_0x447540[_0x3300('0x5e')][_0x3300('0x6e')][_0x3300('0x4b')];_0x44f191+=0x1){socket[_0x3300('0xb6')](_0x3300('0xb7'),{'UserId':Number(_0x447540[_0x3300('0x5e')][_0x3300('0x6e')][_0x44f191]),'OpenchannelAccountId':Number(_0x447540['params']['id'])});}return _0x2bca68;});}})[_0x3300('0x23')](respondWithResult(_0x3f836c,null))[_0x3300('0x2d')](handleError(_0x3f836c,null));};exports[_0x3300('0xb8')]=function(_0x5eb1cf,_0x5a666e,_0x4c50b7){return db[_0x3300('0x3f')][_0x3300('0x5c')]({'where':{'id':_0x5eb1cf[_0x3300('0x59')]['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x5a666e,null))['then'](function(_0x67be9c){if(_0x67be9c){return _0x67be9c[_0x3300('0xb8')](_0x5eb1cf[_0x3300('0x45')][_0x3300('0x6e')])[_0x3300('0x23')](function(){if(_[_0x3300('0xb9')](_0x5eb1cf[_0x3300('0x45')][_0x3300('0x6e')])){for(var _0x5c95aa=0x0;_0x5c95aa<_0x5eb1cf[_0x3300('0x45')][_0x3300('0x6e')][_0x3300('0x4b')];_0x5c95aa+=0x1){socket['emit'](_0x3300('0xba'),{'UserId':Number(_0x5eb1cf[_0x3300('0x45')][_0x3300('0x6e')][_0x5c95aa]),'OpenchannelAccountId':Number(_0x5eb1cf[_0x3300('0x59')]['id'])});}}else{socket[_0x3300('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5eb1cf[_0x3300('0x45')][_0x3300('0x6e')]),'OpenchannelAccountId':Number(_0x5eb1cf['params']['id'])});}});}})[_0x3300('0x23')](respondWithStatusCode(_0x5a666e,null))['catch'](handleError(_0x5a666e,null));};exports[_0x3300('0xbb')]=function(_0x2b1187,_0x3be433,_0x19852a){var _0x4d023c={};var _0x4fbe00={};var _0x2e9308;var _0x51fc14;return db[_0x3300('0x3f')][_0x3300('0x6a')]({'where':{'id':_0x2b1187[_0x3300('0x59')]['id']}})[_0x3300('0x23')](handleEntityNotFound(_0x3be433,null))[_0x3300('0x23')](function(_0x4f2271){if(_0x4f2271){_0x2e9308=_0x4f2271;_0x4fbe00[_0x3300('0x43')]=_['keys'](db[_0x3300('0x9f')]['rawAttributes']);_0x4fbe00[_0x3300('0x45')]=_[_0x3300('0x46')](_0x2b1187[_0x3300('0x45')]);_0x4fbe00['filters']=_[_0x3300('0x48')](_0x4fbe00['model'],_0x4fbe00[_0x3300('0x45')]);_0x4d023c[_0x3300('0x49')]=_[_0x3300('0x48')](_0x4fbe00[_0x3300('0x43')],qs[_0x3300('0x4a')](_0x2b1187[_0x3300('0x45')]['fields']));_0x4d023c[_0x3300('0x49')]=_0x4d023c['attributes'][_0x3300('0x4b')]?_0x4d023c[_0x3300('0x49')]:_0x4fbe00[_0x3300('0x43')];_0x4d023c['order']=qs[_0x3300('0x4e')](_0x2b1187[_0x3300('0x45')][_0x3300('0x4e')]);_0x4d023c[_0x3300('0x4f')]=qs[_0x3300('0x47')](_['pick'](_0x2b1187[_0x3300('0x45')],_0x4fbe00[_0x3300('0x47')]));if(_0x2b1187[_0x3300('0x45')][_0x3300('0x50')]){_0x4d023c[_0x3300('0x4f')]=_['merge'](_0x4d023c[_0x3300('0x4f')],{'$or':_[_0x3300('0x44')](_0x4d023c['attributes'],function(_0x51abe0){var _0x397eb3={};_0x397eb3[_0x51abe0]={'$like':'%'+_0x2b1187['query'][_0x3300('0x50')]+'%'};return _0x397eb3;})});}_0x4d023c=_[_0x3300('0x52')]({},_0x4d023c,_0x2b1187['options']);return _0x2e9308['getAgents'](_0x4d023c);}})['then'](function(_0x32b282){if(_0x32b282){_0x51fc14=_0x32b282[_0x3300('0x4b')];if(!_0x2b1187[_0x3300('0x45')]['hasOwnProperty']('nolimit')){_0x4d023c[_0x3300('0x33')]=qs[_0x3300('0x33')](_0x2b1187[_0x3300('0x45')]['limit']);_0x4d023c['offset']=qs['offset'](_0x2b1187[_0x3300('0x45')]['offset']);}return _0x2e9308[_0x3300('0xbb')](_0x4d023c);}})[_0x3300('0x23')](function(_0x250387){if(_0x250387){return _0x250387?{'count':_0x51fc14,'rows':_0x250387}:null;}})['then'](respondWithResult(_0x3be433,null))[_0x3300('0x2d')](handleError(_0x3be433,null));};exports[_0x3300('0xad')]=function(_0xd55241,_0xbe88e2,_0x150186){var _0x2b93c5,_0x5adcf3,_0x41679e;if(_['isNil'](_0xd55241['body']['body'])||_0xd55241['body'][_0x3300('0x5e')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0xd55241[_0x3300('0x5e')]['to'])){}_0x2b93c5=_0xd55241[_0x3300('0x5e')]['to'];return db[_0x3300('0x3f')][_0x3300('0x6a')]({'where':{'id':_0xd55241[_0x3300('0x59')]['id']}})['then'](handleEntityNotFound(_0xbe88e2,null))[_0x3300('0x23')](function(_0x12c588){if(_0x12c588){return db[_0x3300('0x3f')][_0x3300('0x5c')]({'where':{'id':_0x12c588['id']},'include':[{'model':db[_0x3300('0x84')],'as':_0x3300('0x85'),'include':[{'model':db[_0x3300('0x75')],'as':_0x3300('0x8d'),'where':{[_0x12c588[_0x3300('0x83')]]:_0x2b93c5},'limit':0x1,'order':[[_0x3300('0x79'),_0x3300('0x86')]]}]}]})[_0x3300('0x23')](handleEntityNotFound(_0xbe88e2,null))[_0x3300('0x23')](function(_0x36b55c){if(_0x36b55c&&_0x36b55c[_0x3300('0x85')]){_0x5adcf3=_0x36b55c[_0x3300('0x38')]({'plain':!![]});if(_0x5adcf3[_0x3300('0x85')]&&_0x5adcf3[_0x3300('0x85')][_0x3300('0x8d')][_0x3300('0x4b')]){return _0x5adcf3[_0x3300('0x85')][_0x3300('0x8d')][0x0];}return db[_0x3300('0x75')][_0x3300('0x5d')](_[_0x3300('0x8e')](_0xd55241['body'],{'firstName':_0x2b93c5,[_0x36b55c['mapKey']]:_0x2b93c5,'phone':_0x2b93c5,'ListId':_0x5adcf3['ListId']}));}})[_0x3300('0x23')](handleEntityNotFound(_0xbe88e2,null))[_0x3300('0x23')](function(_0x341813){if(_0x341813){_0x41679e=_0x341813;return db[_0x3300('0x93')][_0x3300('0x5c')]({'where':{'ContactId':_0x41679e['id'],'closed':![],'OpenchannelAccountId':_0x5adcf3['id']}})['then'](function(_0xff7bfa){if(_0xff7bfa){return[_0xff7bfa,![]];}return db[_0x3300('0x93')][_0x3300('0x5d')]({'UserId':_0xd55241[_0x3300('0x5f')]['id'],'ContactId':_0x41679e['id'],'OpenchannelAccountId':_0x5adcf3['id'],'lastMsgDirection':_0x3300('0xbc'),'Messages':[_[_0x3300('0x52')](_0xd55241['body'],{'read':![],'body':_0xd55241['body']['body'],'OpenchannelAccountId':_0x5adcf3['id'],'UserId':_0xd55241[_0x3300('0x5f')]['id'],'ContactId':_0x41679e['id']})]},{'include':[{'model':db[_0x3300('0x9c')],'as':'Messages'}]})['then'](function(_0x1c41c4){return[_0x1c41c4,!![]];});});}})[_0x3300('0x96')](function(_0x3b8c06,_0x3dea71){if(_0x3dea71){return _0x3b8c06;}return db[_0x3300('0x9c')]['create'](_[_0x3300('0x52')](_0xd55241[_0x3300('0x5e')],{'read':![],'body':_0xd55241['body'][_0x3300('0x5e')],'OpenchannelAccountId':_0x5adcf3['id'],'OpenchannelInteractionId':_0x3b8c06['id'],'UserId':_0xd55241[_0x3300('0x5f')]['id'],'ContactId':_0x41679e['id']}))[_0x3300('0x23')](function(_0x2248cc){_0x3b8c06[_0x3300('0xbd')]['Messages']=[];_0x3b8c06['dataValues'][_0x3300('0xbe')][_0x3300('0x9a')](_0x2248cc['dataValues']);return _0x3b8c06;});});}})[_0x3300('0x23')](respondWithResult(_0xbe88e2,null))[_0x3300('0x2d')](handleError(_0xbe88e2,null));}; \ No newline at end of file +var _0xef1c=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','contact','firstName','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','lastName','messageId','interaction','created','autoclose','push','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','EventManager','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','sendStatus','status','end','json','offset','undefined','count','limit','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelAccount','includeAll','findAll','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Disposition','getDispositions','hasOwnProperty','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','OpenchannelAccountId','removeAnswers','notify','openchannel','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey'];(function(_0x5cb751,_0x23d1d9){var _0x39b16c=function(_0x31c0d5){while(--_0x31c0d5){_0x5cb751['push'](_0x5cb751['shift']());}};_0x39b16c(++_0x23d1d9);}(_0xef1c,0xfc));var _0xcef1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xef1c[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcef1('0x0'));var zipdir=require(_0xcef1('0x1'));var jsonpatch=require(_0xcef1('0x2'));var rp=require(_0xcef1('0x3'));var moment=require(_0xcef1('0x4'));var BPromise=require(_0xcef1('0x5'));var Mustache=require('mustache');var util=require(_0xcef1('0x6'));var path=require(_0xcef1('0x7'));var sox=require(_0xcef1('0x8'));var csv=require(_0xcef1('0x9'));var ejs=require(_0xcef1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcef1('0xb'));var squel=require('squel');var crypto=require(_0xcef1('0xc'));var jsforce=require(_0xcef1('0xd'));var deskjs=require(_0xcef1('0xe'));var toCsv=require(_0xcef1('0x9'));var querystring=require(_0xcef1('0xf'));var Papa=require(_0xcef1('0x10'));var Redis=require(_0xcef1('0x11'));var authService=require(_0xcef1('0x12'));var qs=require(_0xcef1('0x13'));var as=require(_0xcef1('0x14'));var hardwareService=require(_0xcef1('0x15'));var logger=require(_0xcef1('0x16'))(_0xcef1('0x17'));var utils=require(_0xcef1('0x18'));var config=require(_0xcef1('0x19'));var licenseUtil=require(_0xcef1('0x1a'));var db=require(_0xcef1('0x1b'))['db'];config['redis']=_[_0xcef1('0x1c')](config[_0xcef1('0x1d')],{'host':_0xcef1('0x1e'),'port':0x18eb});var socket=require(_0xcef1('0x1f'))(new Redis(config[_0xcef1('0x1d')]));require(_0xcef1('0x20'))['register'](socket);var jayson=require(_0xcef1('0x21'));var client=jayson[_0xcef1('0x22')][_0xcef1('0x23')]({'port':0x232c});var client9002=jayson[_0xcef1('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0ca5,_0x150358,_0x12b538,_0x1f626d){return new BPromise(function(_0x49ea67,_0x2bdee9){var _0x18b47b=_0x1f626d||client;return _0x18b47b[_0xcef1('0x24')](_0x4e0ca5,_0x12b538)[_0xcef1('0x25')](function(_0x40d824){logger[_0xcef1('0x26')](_0xcef1('0x27'),_0x150358,'request\x20sent');logger[_0xcef1('0x28')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x150358,_0xcef1('0x29'),JSON['stringify'](_0x40d824));if(_0x40d824[_0xcef1('0x2a')]){if(_0x40d824[_0xcef1('0x2a')]['code']===0x1f4){logger[_0xcef1('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x150358,_0x40d824[_0xcef1('0x2a')]['message']);return _0x2bdee9(_0x40d824['error'][_0xcef1('0x2b')]);}logger[_0xcef1('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x150358,_0x40d824[_0xcef1('0x2a')][_0xcef1('0x2b')]);return _0x49ea67(_0x40d824['error'][_0xcef1('0x2b')]);}else{logger[_0xcef1('0x26')](_0xcef1('0x27'),_0x150358,'request\x20sent');_0x49ea67(_0x40d824['result'][_0xcef1('0x2b')]);}})['catch'](function(_0x3a0c48){logger[_0xcef1('0x2a')](_0xcef1('0x27'),_0x150358,_0x3a0c48);_0x2bdee9(_0x3a0c48);});});}function respondWithStatusCode(_0x2eed82,_0x30526){_0x30526=_0x30526||0xcc;return function(_0x5e4843){if(_0x5e4843){return _0x2eed82[_0xcef1('0x2c')](_0x30526);}return _0x2eed82[_0xcef1('0x2d')](_0x30526)[_0xcef1('0x2e')]();};}function respondWithResult(_0x2c98f3,_0x47b6c8){_0x47b6c8=_0x47b6c8||0xc8;return function(_0x1143e8){if(_0x1143e8){return _0x2c98f3[_0xcef1('0x2d')](_0x47b6c8)[_0xcef1('0x2f')](_0x1143e8);}};}function respondWithFilteredResult(_0x184ee3,_0x5d967a){return function(_0x57893e){if(_0x57893e){var _0x9cc931=typeof _0x5d967a[_0xcef1('0x30')]===_0xcef1('0x31')&&typeof _0x5d967a['limit']===_0xcef1('0x31');var _0x3796e4=_0x57893e[_0xcef1('0x32')];var _0x583cc6=_0x9cc931?0x0:_0x5d967a[_0xcef1('0x30')];var _0x22ab46=_0x9cc931?_0x57893e[_0xcef1('0x32')]:_0x5d967a['offset']+_0x5d967a[_0xcef1('0x33')];var _0xa93d11;if(_0x22ab46>=_0x3796e4){_0x22ab46=_0x3796e4;_0xa93d11=0xc8;}else{_0xa93d11=0xce;}_0x184ee3['status'](_0xa93d11);return _0x184ee3['set']('Content-Range',_0x583cc6+'-'+_0x22ab46+'/'+_0x3796e4)[_0xcef1('0x2f')](_0x57893e);}return null;};}function patchUpdates(_0xffd333){return function(_0x581b77){try{jsonpatch['apply'](_0x581b77,_0xffd333,!![]);}catch(_0x20ed74){return BPromise['reject'](_0x20ed74);}return _0x581b77['save']();};}function saveUpdates(_0x343c24,_0x436d15){return function(_0x19a96f){if(_0x19a96f){return _0x19a96f['update'](_0x343c24)[_0xcef1('0x25')](function(_0x464214){return _0x464214;});}return null;};}function removeEntity(_0x4f772f,_0x154291){return function(_0x2c9988){if(_0x2c9988){return _0x2c9988[_0xcef1('0x34')]()[_0xcef1('0x25')](function(){var _0x155ee2=_0x2c9988[_0xcef1('0x35')]({'plain':!![]});var _0xa44eed=_0xcef1('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0xa44eed,'resourceId':_0x155ee2['id']}})[_0xcef1('0x25')](function(){return _0x2c9988;});})[_0xcef1('0x25')](function(){_0x4f772f['status'](0xcc)[_0xcef1('0x2e')]();});}};}function handleEntityNotFound(_0x12a78d,_0x38847e){return function(_0x3de528){if(!_0x3de528){_0x12a78d[_0xcef1('0x2c')](0x194);}return _0x3de528;};}function handleError(_0x24b97c,_0x329d6d){_0x329d6d=_0x329d6d||0x1f4;return function(_0x47bb31){logger[_0xcef1('0x2a')](_0x47bb31[_0xcef1('0x37')]);if(_0x47bb31['name']){delete _0x47bb31[_0xcef1('0x38')];}_0x24b97c[_0xcef1('0x2d')](_0x329d6d)[_0xcef1('0x39')](_0x47bb31);};}exports[_0xcef1('0x3a')]=function(_0x53a9f5,_0x29b65c){var _0x5c629e={'include':[{'model':db[_0xcef1('0x3b')],'as':_0xcef1('0x3c')}]},_0x483930={},_0x38ac98={'count':0x0,'rows':[]};var _0x329d82=_['map'](db['OpenchannelAccount'][_0xcef1('0x3d')],function(_0x5177ef){return{'name':_0x5177ef[_0xcef1('0x3e')],'type':_0x5177ef['type'][_0xcef1('0x3f')]};});_0x483930[_0xcef1('0x40')]=_[_0xcef1('0x41')](_0x329d82,'name');_0x483930[_0xcef1('0x42')]=_[_0xcef1('0x43')](_0x53a9f5[_0xcef1('0x42')]);_0x483930[_0xcef1('0x44')]=_['intersection'](_0x483930[_0xcef1('0x40')],_0x483930[_0xcef1('0x42')]);_0x5c629e[_0xcef1('0x45')]=_[_0xcef1('0x46')](_0x483930[_0xcef1('0x40')],qs[_0xcef1('0x47')](_0x53a9f5[_0xcef1('0x42')][_0xcef1('0x47')]));_0x5c629e[_0xcef1('0x45')]=_0x5c629e[_0xcef1('0x45')][_0xcef1('0x48')]?_0x5c629e[_0xcef1('0x45')]:_0x483930[_0xcef1('0x40')];if(!_0x53a9f5['query']['hasOwnProperty']('nolimit')){_0x5c629e[_0xcef1('0x33')]=qs['limit'](_0x53a9f5[_0xcef1('0x42')][_0xcef1('0x33')]);_0x5c629e[_0xcef1('0x30')]=qs[_0xcef1('0x30')](_0x53a9f5[_0xcef1('0x42')]['offset']);}_0x5c629e[_0xcef1('0x49')]=qs[_0xcef1('0x4a')](_0x53a9f5[_0xcef1('0x42')][_0xcef1('0x4a')]);_0x5c629e[_0xcef1('0x4b')]=qs['filters'](_[_0xcef1('0x4c')](_0x53a9f5[_0xcef1('0x42')],_0x483930[_0xcef1('0x44')]),_0x329d82);if(_0x53a9f5['query'][_0xcef1('0x4d')]){_0x5c629e['where']=_[_0xcef1('0x4e')](_0x5c629e[_0xcef1('0x4b')],{'$or':_[_0xcef1('0x41')](_0x329d82,function(_0x4323aa){if(_0x4323aa[_0xcef1('0x4f')]!==_0xcef1('0x50')){var _0x3eeb75={};_0x3eeb75[_0x4323aa[_0xcef1('0x38')]]={'$like':'%'+_0x53a9f5[_0xcef1('0x42')][_0xcef1('0x4d')]+'%'};return _0x3eeb75;}})});}_0x5c629e=_['merge']({},_0x5c629e,_0x53a9f5[_0xcef1('0x51')]);var _0x20b862={'where':_0x5c629e[_0xcef1('0x4b')]};return db[_0xcef1('0x52')][_0xcef1('0x32')](_0x20b862)[_0xcef1('0x25')](function(_0x5ea319){_0x38ac98[_0xcef1('0x32')]=_0x5ea319;if(_0x53a9f5[_0xcef1('0x42')][_0xcef1('0x53')]){_0x5c629e['include']=[{'all':!![]}];}return db[_0xcef1('0x52')][_0xcef1('0x54')](_0x5c629e);})[_0xcef1('0x25')](function(_0x52d3c1){_0x38ac98['rows']=_0x52d3c1;return _0x38ac98;})[_0xcef1('0x25')](respondWithFilteredResult(_0x29b65c,_0x5c629e))[_0xcef1('0x55')](handleError(_0x29b65c,null));};exports[_0xcef1('0x56')]=function(_0x46dd2b,_0x2faa55){var _0x54e656={'raw':![],'where':{'id':_0x46dd2b[_0xcef1('0x57')]['id']},'include':[{'model':db[_0xcef1('0x3b')],'as':'mandatoryDispositionPause'}]},_0x15ffe8={};_0x15ffe8[_0xcef1('0x40')]=_[_0xcef1('0x43')](db[_0xcef1('0x52')][_0xcef1('0x3d')]);_0x15ffe8[_0xcef1('0x42')]=_[_0xcef1('0x43')](_0x46dd2b[_0xcef1('0x42')]);_0x15ffe8[_0xcef1('0x44')]=_[_0xcef1('0x46')](_0x15ffe8[_0xcef1('0x40')],_0x15ffe8[_0xcef1('0x42')]);_0x54e656[_0xcef1('0x45')]=_[_0xcef1('0x46')](_0x15ffe8[_0xcef1('0x40')],qs[_0xcef1('0x47')](_0x46dd2b[_0xcef1('0x42')][_0xcef1('0x47')]));_0x54e656[_0xcef1('0x45')]=_0x54e656['attributes'][_0xcef1('0x48')]?_0x54e656['attributes']:_0x15ffe8[_0xcef1('0x40')];if(_0x46dd2b[_0xcef1('0x42')][_0xcef1('0x53')]){_0x54e656[_0xcef1('0x58')]=[{'all':!![]}];}_0x54e656=_[_0xcef1('0x4e')]({},_0x54e656,_0x46dd2b[_0xcef1('0x51')]);return db[_0xcef1('0x52')][_0xcef1('0x59')](_0x54e656)[_0xcef1('0x25')](handleEntityNotFound(_0x2faa55,null))['then'](respondWithResult(_0x2faa55,null))[_0xcef1('0x55')](handleError(_0x2faa55,null));};exports['create']=function(_0x39c7a3,_0x23c2d9){return db[_0xcef1('0x52')][_0xcef1('0x5a')](_0x39c7a3[_0xcef1('0x5b')],{})['then'](function(_0x1ff78f){var _0x1b96d=_0x39c7a3['user'][_0xcef1('0x35')]({'plain':!![]});if(!_0x1b96d)throw new Error(_0xcef1('0x5c'));if(_0x1b96d[_0xcef1('0x5d')]===_0xcef1('0x5e')){var _0x4253cd=_0x1ff78f['get']({'plain':!![]});var _0xd84932=_0xcef1('0x36');return db[_0xcef1('0x5f')][_0xcef1('0x59')]({'where':{'name':_0xd84932,'userProfileId':_0x1b96d['userProfileId']},'raw':!![]})['then'](function(_0x54d8db){if(_0x54d8db&&_0x54d8db['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4253cd['name'],'resourceId':_0x4253cd['id'],'type':_0x54d8db[_0xcef1('0x38')],'sectionId':_0x54d8db['id']},{})['then'](function(){return _0x1ff78f;});}else{return _0x1ff78f;}})['catch'](function(_0x187727){logger['error'](_0xcef1('0x60'),_0x187727);throw _0x187727;});}return _0x1ff78f;})[_0xcef1('0x25')](respondWithResult(_0x23c2d9,0xc9))[_0xcef1('0x55')](handleError(_0x23c2d9,null));};exports['update']=function(_0x3c280a,_0x247771){if(_0x3c280a[_0xcef1('0x5b')]['id']){delete _0x3c280a['body']['id'];}return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0x3c280a[_0xcef1('0x57')]['id']},'include':[{'model':db[_0xcef1('0x3b')],'as':_0xcef1('0x3c')}]})[_0xcef1('0x25')](handleEntityNotFound(_0x247771,null))[_0xcef1('0x25')](saveUpdates(_0x3c280a[_0xcef1('0x5b')],null))[_0xcef1('0x25')](respondWithResult(_0x247771,null))[_0xcef1('0x55')](handleError(_0x247771,null));};exports[_0xcef1('0x34')]=function(_0x542b86,_0x2d8260){return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0x542b86[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x2d8260,null))['then'](removeEntity(_0x2d8260,null))[_0xcef1('0x55')](handleError(_0x2d8260,null));};exports['describe']=function(_0x561fe4,_0x4aae0f){return db[_0xcef1('0x52')]['describe']()[_0xcef1('0x25')](respondWithResult(_0x4aae0f,null))[_0xcef1('0x55')](handleError(_0x4aae0f,null));};exports['addDisposition']=function(_0x4a343e,_0x18b62b,_0x565615){if(_0x4a343e[_0xcef1('0x5b')]['id']){delete _0x4a343e['body']['id'];}return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0x4a343e[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x18b62b,null))[_0xcef1('0x25')](function(_0x4b1f5c){if(_0x4b1f5c){_0x4a343e[_0xcef1('0x5b')]['OpenchannelAccountId']=_0x4b1f5c['id'];return db[_0xcef1('0x61')][_0xcef1('0x5a')](_0x4a343e[_0xcef1('0x5b')]);}})[_0xcef1('0x25')](respondWithResult(_0x18b62b,null))[_0xcef1('0x55')](handleError(_0x18b62b,null));};exports[_0xcef1('0x62')]=function(_0x49c374,_0x3ff866,_0x2e0824){var _0x4713cd={'raw':![],'where':{}};var _0x111a9d={};var _0x38df9d={'count':0x0,'rows':[]};return db[_0xcef1('0x52')]['findOne']({'where':{'id':_0x49c374[_0xcef1('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ff866,null))[_0xcef1('0x25')](function(_0x564403){if(_0x564403){_0x111a9d[_0xcef1('0x40')]=_[_0xcef1('0x43')](db[_0xcef1('0x61')][_0xcef1('0x3d')]);_0x111a9d['query']=_['keys'](_0x49c374['query']);_0x111a9d[_0xcef1('0x44')]=_[_0xcef1('0x46')](_0x111a9d[_0xcef1('0x40')],_0x111a9d['query']);_0x4713cd[_0xcef1('0x45')]=_['intersection'](_0x111a9d['model'],qs[_0xcef1('0x47')](_0x49c374[_0xcef1('0x42')][_0xcef1('0x47')]));_0x4713cd[_0xcef1('0x45')]=_0x4713cd[_0xcef1('0x45')][_0xcef1('0x48')]?_0x4713cd['attributes']:_0x111a9d['model'];if(!_0x49c374[_0xcef1('0x42')][_0xcef1('0x63')](_0xcef1('0x64'))){_0x4713cd[_0xcef1('0x33')]=qs['limit'](_0x49c374['query'][_0xcef1('0x33')]);_0x4713cd['offset']=qs[_0xcef1('0x30')](_0x49c374[_0xcef1('0x42')]['offset']);}_0x4713cd[_0xcef1('0x49')]=qs[_0xcef1('0x4a')](_0x49c374['query'][_0xcef1('0x4a')]);_0x4713cd[_0xcef1('0x4b')]=qs[_0xcef1('0x44')](_[_0xcef1('0x4c')](_0x49c374[_0xcef1('0x42')],_0x111a9d[_0xcef1('0x44')]));_0x4713cd['where']['OpenchannelAccountId']=_0x564403['id'];if(_0x49c374['query'][_0xcef1('0x4d')]){_0x4713cd['where']=_[_0xcef1('0x4e')](_0x4713cd[_0xcef1('0x4b')],{'$or':_[_0xcef1('0x41')](_0x4713cd[_0xcef1('0x45')],function(_0x3cfc0f){var _0x19d6c7={};_0x19d6c7[_0x3cfc0f]={'$like':'%'+_0x49c374['query'][_0xcef1('0x4d')]+'%'};return _0x19d6c7;})});}_0x4713cd=_[_0xcef1('0x4e')]({},_0x4713cd,_0x49c374['options']);return db[_0xcef1('0x61')][_0xcef1('0x32')]({'where':_0x4713cd[_0xcef1('0x4b')]})[_0xcef1('0x25')](function(_0x52b8a0){_0x38df9d[_0xcef1('0x32')]=_0x52b8a0;if(_0x49c374[_0xcef1('0x42')]['includeAll']){_0x4713cd[_0xcef1('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xcef1('0x54')](_0x4713cd);})[_0xcef1('0x25')](function(_0x1c0b83){_0x38df9d[_0xcef1('0x65')]=_0x1c0b83;return _0x38df9d;});}})['then'](respondWithFilteredResult(_0x3ff866,_0x4713cd))['catch'](handleError(_0x3ff866,null));};exports[_0xcef1('0x66')]=function(_0xb1b61f,_0xb3c5dc,_0x5ec438){return db['OpenchannelAccount']['find']({'where':{'id':_0xb1b61f[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0xb3c5dc,null))['then'](function(_0x54c5e6){if(_0x54c5e6){return _0x54c5e6[_0xcef1('0x66')](_0xb1b61f['query'][_0xcef1('0x67')]);}})[_0xcef1('0x25')](respondWithStatusCode(_0xb3c5dc,null))['catch'](handleError(_0xb3c5dc,null));};exports[_0xcef1('0x68')]=function(_0xbd3454,_0x271fca,_0x1cc2bc){if(_0xbd3454[_0xcef1('0x5b')]['id']){delete _0xbd3454[_0xcef1('0x5b')]['id'];}return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0xbd3454[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x271fca,null))[_0xcef1('0x25')](function(_0x49b3b2){if(_0x49b3b2){_0xbd3454[_0xcef1('0x5b')]['OpenchannelAccountId']=_0x49b3b2['id'];return db[_0xcef1('0x69')]['create'](_0xbd3454[_0xcef1('0x5b')]);}})[_0xcef1('0x25')](respondWithResult(_0x271fca,null))[_0xcef1('0x55')](handleError(_0x271fca,null));};exports[_0xcef1('0x6a')]=function(_0x2aec40,_0x230dd4,_0x1442d0){var _0xbefb69={'raw':![],'where':{}};var _0x47511c={};var _0x3dfec4={'count':0x0,'rows':[]};return db[_0xcef1('0x52')][_0xcef1('0x6b')]({'where':{'id':_0x2aec40['params']['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x230dd4,null))[_0xcef1('0x25')](function(_0x494c57){if(_0x494c57){_0x47511c[_0xcef1('0x40')]=_[_0xcef1('0x43')](db[_0xcef1('0x69')]['rawAttributes']);_0x47511c[_0xcef1('0x42')]=_['keys'](_0x2aec40[_0xcef1('0x42')]);_0x47511c[_0xcef1('0x44')]=_['intersection'](_0x47511c[_0xcef1('0x40')],_0x47511c[_0xcef1('0x42')]);_0xbefb69[_0xcef1('0x45')]=_[_0xcef1('0x46')](_0x47511c['model'],qs['fields'](_0x2aec40['query'][_0xcef1('0x47')]));_0xbefb69[_0xcef1('0x45')]=_0xbefb69[_0xcef1('0x45')][_0xcef1('0x48')]?_0xbefb69[_0xcef1('0x45')]:_0x47511c[_0xcef1('0x40')];if(!_0x2aec40[_0xcef1('0x42')][_0xcef1('0x63')](_0xcef1('0x64'))){_0xbefb69['limit']=qs[_0xcef1('0x33')](_0x2aec40[_0xcef1('0x42')][_0xcef1('0x33')]);_0xbefb69[_0xcef1('0x30')]=qs[_0xcef1('0x30')](_0x2aec40[_0xcef1('0x42')][_0xcef1('0x30')]);}_0xbefb69[_0xcef1('0x49')]=qs[_0xcef1('0x4a')](_0x2aec40[_0xcef1('0x42')]['sort']);_0xbefb69[_0xcef1('0x4b')]=qs[_0xcef1('0x44')](_[_0xcef1('0x4c')](_0x2aec40[_0xcef1('0x42')],_0x47511c[_0xcef1('0x44')]));_0xbefb69['where'][_0xcef1('0x6c')]=_0x494c57['id'];if(_0x2aec40[_0xcef1('0x42')]['filter']){_0xbefb69[_0xcef1('0x4b')]=_['merge'](_0xbefb69['where'],{'$or':_[_0xcef1('0x41')](_0xbefb69[_0xcef1('0x45')],function(_0x52c25e){var _0x52d529={};_0x52d529[_0x52c25e]={'$like':'%'+_0x2aec40[_0xcef1('0x42')][_0xcef1('0x4d')]+'%'};return _0x52d529;})});}_0xbefb69=_[_0xcef1('0x4e')]({},_0xbefb69,_0x2aec40[_0xcef1('0x51')]);return db['CannedAnswer'][_0xcef1('0x32')]({'where':_0xbefb69[_0xcef1('0x4b')]})[_0xcef1('0x25')](function(_0x11d9ef){_0x3dfec4[_0xcef1('0x32')]=_0x11d9ef;if(_0x2aec40['query'][_0xcef1('0x53')]){_0xbefb69[_0xcef1('0x58')]=[{'all':!![]}];}return db[_0xcef1('0x69')][_0xcef1('0x54')](_0xbefb69);})['then'](function(_0x150002){_0x3dfec4['rows']=_0x150002;return _0x3dfec4;});}})[_0xcef1('0x25')](respondWithFilteredResult(_0x230dd4,_0xbefb69))[_0xcef1('0x55')](handleError(_0x230dd4,null));};exports[_0xcef1('0x6d')]=function(_0x14ffd6,_0x5c3d9c,_0x277e4d){return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0x14ffd6[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x5c3d9c,null))[_0xcef1('0x25')](function(_0x594723){if(_0x594723){return _0x594723[_0xcef1('0x6d')](_0x14ffd6[_0xcef1('0x42')][_0xcef1('0x67')]);}})[_0xcef1('0x25')](respondWithStatusCode(_0x5c3d9c,null))[_0xcef1('0x55')](handleError(_0x5c3d9c,null));};exports[_0xcef1('0x6e')]=function(_0x43153f,_0x31227e,_0x37bc92){var _0x31d409={'body':_0x43153f['body'],'channel':_0xcef1('0x6f')};var _0x4edb06=[];var _0x5ce553=[];var _0x354c7e={};var _0xa624a4=![];return db[_0xcef1('0x70')][_0xcef1('0x71')]()[_0xcef1('0x25')](function(_0x10d426){if(!_0x10d426){throw new db[(_0xcef1('0x72'))]['ValidationError'](_0xcef1('0x73'));}_0x4edb06=_[_0xcef1('0x74')](_[_0xcef1('0x43')](_0x10d426),[_0xcef1('0x75'),_0xcef1('0x76')]);_0x5ce553=_['difference'](_[_0xcef1('0x43')](_0x10d426),[_0xcef1('0x75'),_0xcef1('0x76'),_0xcef1('0x77'),_0xcef1('0x78')]);if(_0x43153f['body']['id']){delete _0x43153f[_0xcef1('0x5b')]['id'];}if(_[_0xcef1('0x79')](_0x43153f['body'][_0xcef1('0x7a')])){throw new db[(_0xcef1('0x72'))][(_0xcef1('0x7b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x43153f[_0xcef1('0x5b')][_0xcef1('0x5b')])||_0x43153f[_0xcef1('0x5b')][_0xcef1('0x5b')]===''){throw new db[(_0xcef1('0x72'))][(_0xcef1('0x7b'))](_0xcef1('0x7c'));}if(_[_0xcef1('0x79')](_0x43153f['body'][_0xcef1('0x7d')])){throw new db[(_0xcef1('0x72'))][(_0xcef1('0x7b'))](_0xcef1('0x7e')+_0x5ce553);}if(!_[_0xcef1('0x7f')](_0x5ce553,_0x43153f[_0xcef1('0x5b')][_0xcef1('0x7d')])){throw new db[(_0xcef1('0x72'))][(_0xcef1('0x7b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ce553);}_0x354c7e[_0x43153f['body']['mapKey']]=_0x43153f['body'][_0xcef1('0x7a')];})[_0xcef1('0x25')](function(){return db['OpenchannelAccount'][_0xcef1('0x59')]({'where':{'id':_0x43153f['params']['id']},'include':[{'model':db[_0xcef1('0x80')],'as':_0xcef1('0x81'),'include':[{'model':db[_0xcef1('0x70')],'as':_0xcef1('0x82'),'where':_0x354c7e,'limit':0x1,'order':[['updatedAt',_0xcef1('0x83')]]}]},{'model':db[_0xcef1('0x84')],'as':_0xcef1('0x85')}]});})[_0xcef1('0x25')](handleEntityNotFound(_0x31227e,null))[_0xcef1('0x25')](function(_0x18758f){if(_0x18758f&&_0x18758f[_0xcef1('0x81')]){_0x31d409[_0xcef1('0x86')]=_0x18758f;_0x31d409['applications']=_0x18758f[_0xcef1('0x85')];_0x31d409[_0xcef1('0x87')]=_0x18758f[_0xcef1('0x81')];_0x31d409[_0xcef1('0x88')]=_[_0xcef1('0x89')](_0x31d409[_0xcef1('0x88')],[_0xcef1('0x8a')],[_0xcef1('0x8b')]);if(_0x31d409[_0xcef1('0x86')][_0xcef1('0x85')]){delete _0x31d409[_0xcef1('0x86')][_0xcef1('0x85')];}if(_0x31d409['account'][_0xcef1('0x81')]&&_0x31d409[_0xcef1('0x86')][_0xcef1('0x81')][_0xcef1('0x82')][_0xcef1('0x48')]){return _0x31d409[_0xcef1('0x86')][_0xcef1('0x81')][_0xcef1('0x82')][0x0];}var _0x3dc149=_[_0xcef1('0x1c')](_0x43153f[_0xcef1('0x5b')],{'firstName':_0x43153f['body'][_0xcef1('0x7a')],'ListId':_0x18758f[_0xcef1('0x78')]});_0x3dc149[_0x43153f[_0xcef1('0x5b')][_0xcef1('0x7d')]]=_0x43153f['body'][_0xcef1('0x7a')];return db[_0xcef1('0x70')][_0xcef1('0x5a')](_0x3dc149,{'fields':_0x4edb06,'raw':!![]});}})[_0xcef1('0x25')](handleEntityNotFound(_0x31227e,null))['then'](function(_0x5681fb){_0x31d409[_0xcef1('0x8c')]=_0x5681fb;if(_0x5681fb){var _0x14a35d={'ContactId':_0x5681fb['id'],'OpenchannelAccountId':_0x43153f[_0xcef1('0x57')]['id'],'from':(_0x5681fb[_0xcef1('0x8d')]||'')+'\x20'+(_0x5681fb['lastName']||'')};var _0x1acd3d={'OpenchannelAccountId':_0x43153f['params']['id'],'closed':![]};if(_0x43153f[_0xcef1('0x5b')][_0xcef1('0x8e')]){_0x1acd3d[_0xcef1('0x8e')]=_0x43153f[_0xcef1('0x5b')][_0xcef1('0x8e')];return db['OpenchannelInteraction'][_0xcef1('0x59')]({'where':_0x1acd3d})[_0xcef1('0x25')](function(_0x286001){if(_0x286001){return[_0x286001,![]];}_0x14a35d[_0xcef1('0x8e')]=_0x43153f[_0xcef1('0x5b')][_0xcef1('0x8e')];_0x14a35d[_0xcef1('0x8f')]=_0x43153f[_0xcef1('0x5b')][_0xcef1('0x8f')];return db['OpenchannelInteraction']['create'](_0x14a35d)[_0xcef1('0x25')](function(_0x4f4336){return[_0x4f4336,!![]];});});}else{_0x1acd3d[_0xcef1('0x8e')]=null;}_0x1acd3d[_0xcef1('0x90')]=_0x5681fb['id'];return db[_0xcef1('0x91')][_0xcef1('0x59')]({'where':_0x1acd3d})[_0xcef1('0x25')](function(_0x281eac){if(_0x281eac){return[_0x281eac,![]];}return db[_0xcef1('0x91')][_0xcef1('0x5a')](_0x14a35d)[_0xcef1('0x25')](function(_0x343204){return[_0x343204,!![]];});});}})[_0xcef1('0x92')](function(_0x51926b,_0x412d92){if(_0x51926b){_0xa624a4=_0x412d92;if(!_0x412d92){var _0x543f0d={'from':(_0x31d409[_0xcef1('0x8c')]['firstName']||'')+'\x20'+(_0x31d409['contact'][_0xcef1('0x93')]||'')};if(_0x43153f['body'][_0xcef1('0x8e')]&&_0x43153f['body'][_0xcef1('0x94')]&&_0x43153f[_0xcef1('0x5b')][_0xcef1('0x8e')]!=_0x43153f['body']['messageId']){_0x543f0d[_0xcef1('0x8e')]=_0x43153f[_0xcef1('0x5b')][_0xcef1('0x94')];}return _0x51926b['update'](_0x543f0d);}else{return _0x51926b;}}})[_0xcef1('0x25')](function(_0x4881bb){_0x31d409[_0xcef1('0x95')]=_0x4881bb[_0xcef1('0x35')]({'plain':!![]});_0x31d409[_0xcef1('0x95')][_0xcef1('0x96')]=_0xa624a4;if(_0x31d409[_0xcef1('0x95')][_0xcef1('0x96')]){if(_0x31d409[_0xcef1('0x86')][_0xcef1('0x97')]){_0x31d409[_0xcef1('0x88')][_0xcef1('0x98')]({'id':0x0,'priority':_0x31d409[_0xcef1('0x88')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':_0xcef1('0x99')});}}return db[_0xcef1('0x9a')][_0xcef1('0x5a')]({'body':_0x43153f[_0xcef1('0x5b')][_0xcef1('0x5b')],'OpenchannelAccountId':_0x43153f[_0xcef1('0x57')]['id'],'OpenchannelInteractionId':_0x4881bb['id'],'direction':'in','ContactId':_0x31d409[_0xcef1('0x8c')]['id'],'AttachmentId':_0x43153f[_0xcef1('0x5b')][_0xcef1('0x9b')]});})[_0xcef1('0x25')](function(_0x51a05f){_0x31d409[_0xcef1('0x2b')]=_0x51a05f;if(_0x31d409['interaction'][_0xcef1('0x9c')]){return db['User']['find']({'attributes':['id',_0xcef1('0x38')],'where':{'id':_0x31d409[_0xcef1('0x95')]['UserId']}})['then'](function(_0x3fd4d5){if(_0x3fd4d5){_0x31d409[_0xcef1('0x88')][_0xcef1('0x9d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3fd4d5[_0xcef1('0x38')]+','+(_0x31d409[_0xcef1('0x86')][_0xcef1('0x9e')]||0xa),'interval':'*,*,*,*'});_0x31d409[_0xcef1('0x9f')]=![];}return respondWithRpcPromise(_0xcef1('0xa0'),'startRouting',_0x31d409);});}return respondWithRpcPromise(_0xcef1('0xa0'),'startRouting',_0x31d409);})[_0xcef1('0x25')](function(_0x41a9bb){respondWithRpcPromise(_0xcef1('0xa1'),_0xcef1('0xa1'),{'event':_0xcef1('0x6e'),'message':_0x41a9bb},client9002);return _0x41a9bb;})[_0xcef1('0x25')](respondWithResult(_0x31227e,null))['catch'](handleError(_0x31227e,null));};exports['addApplications']=function(_0x3bc1a7,_0x201479){var _0x4a5338=_0x3bc1a7['params']['id'];var _0x1326a1=_0x3bc1a7[_0xcef1('0x5b')];var _0x1f2f5b=0xc8;var _0x40896e=null;return db[_0xcef1('0xa2')][_0xcef1('0xa3')]({'isolationLevel':db['sequelize'][_0xcef1('0xa4')]['ISOLATION_LEVELS'][_0xcef1('0xa5')]},function(_0x48c6dd){return db[_0xcef1('0x52')][_0xcef1('0x6b')]({'where':{'id':_0x4a5338},'transaction':_0x48c6dd})[_0xcef1('0x25')](function(_0x4bb88b){if(_0x4bb88b){return db[_0xcef1('0x84')][_0xcef1('0x34')]({'where':{'OpenchannelAccountId':_0x4a5338},'transaction':_0x48c6dd})[_0xcef1('0x25')](function(){var _0x373e42=_['map'](_0x1326a1,function(_0x5ca915){_0x5ca915['OpenchannelAccountId']=_0x4a5338;return _0x5ca915;});return db[_0xcef1('0x84')][_0xcef1('0xa6')](_0x373e42,{'transaction':_0x48c6dd});});}else{_0x1f2f5b=0x194;_0x40896e=[];}});})[_0xcef1('0x25')](function(){if(_0x1f2f5b!==0x194){return db[_0xcef1('0x84')][_0xcef1('0xa7')]({'where':{'OpenchannelAccountId':_0x4a5338},'order':_0xcef1('0x8a')})[_0xcef1('0x25')](function(_0x2ec73e){_0x40896e=_0x2ec73e;});}})['catch'](function(_0x1ba6c2){_0x1f2f5b=0x1f4;logger[_0xcef1('0x2a')](_0x1ba6c2['stack']);if(_0x1ba6c2['name']){delete _0x1ba6c2[_0xcef1('0x38')];}_0x40896e=_0x1ba6c2;})[_0xcef1('0xa8')](function(){if(_0x40896e===null){_0x201479[_0xcef1('0x2c')](_0x1f2f5b);}else{if(_0x1f2f5b===0x1f4){_0x201479[_0xcef1('0x2d')](_0x1f2f5b)['send'](_0x40896e);}else{_0x201479[_0xcef1('0x2d')](_0x1f2f5b)[_0xcef1('0x2f')](_0x40896e);}}});};exports['getApplications']=function(_0x34e2d0,_0x4ea8d2,_0x139b87){var _0x5e0d81={};var _0x58547f={};var _0x2b6520;var _0x137a3b;return db[_0xcef1('0x52')][_0xcef1('0x6b')]({'where':{'id':_0x34e2d0[_0xcef1('0x57')]['id']}})['then'](handleEntityNotFound(_0x4ea8d2,null))['then'](function(_0x2a2fa9){if(_0x2a2fa9){_0x2b6520=_0x2a2fa9;_0x58547f[_0xcef1('0x40')]=_[_0xcef1('0x43')](db[_0xcef1('0x84')]['rawAttributes']);_0x58547f[_0xcef1('0x42')]=_[_0xcef1('0x43')](_0x34e2d0[_0xcef1('0x42')]);_0x58547f['filters']=_[_0xcef1('0x46')](_0x58547f[_0xcef1('0x40')],_0x58547f[_0xcef1('0x42')]);_0x5e0d81[_0xcef1('0x45')]=_[_0xcef1('0x46')](_0x58547f[_0xcef1('0x40')],qs['fields'](_0x34e2d0[_0xcef1('0x42')][_0xcef1('0x47')]));_0x5e0d81[_0xcef1('0x45')]=_0x5e0d81[_0xcef1('0x45')]['length']?_0x5e0d81[_0xcef1('0x45')]:_0x58547f[_0xcef1('0x40')];_0x5e0d81['order']=qs['sort'](_0x34e2d0[_0xcef1('0x42')]['sort']);_0x5e0d81[_0xcef1('0x4b')]=qs[_0xcef1('0x44')](_['pick'](_0x34e2d0[_0xcef1('0x42')],_0x58547f['filters']));if(_0x34e2d0[_0xcef1('0x42')][_0xcef1('0x4d')]){_0x5e0d81['where']=_[_0xcef1('0x4e')](_0x5e0d81['where'],{'$or':_[_0xcef1('0x41')](_0x5e0d81[_0xcef1('0x45')],function(_0xb5d04b){var _0x1f6674={};_0x1f6674[_0xb5d04b]={'$like':'%'+_0x34e2d0[_0xcef1('0x42')][_0xcef1('0x4d')]+'%'};return _0x1f6674;})});}_0x5e0d81=_[_0xcef1('0x4e')]({},_0x5e0d81,_0x34e2d0[_0xcef1('0x51')]);return _0x2b6520['getApplications'](_0x5e0d81);}})[_0xcef1('0x25')](function(_0x3b660e){if(_0x3b660e){_0x137a3b=_0x3b660e[_0xcef1('0x48')];if(!_0x34e2d0[_0xcef1('0x42')][_0xcef1('0x63')](_0xcef1('0x64'))){_0x5e0d81[_0xcef1('0x33')]=qs['limit'](_0x34e2d0[_0xcef1('0x42')]['limit']);_0x5e0d81[_0xcef1('0x30')]=qs['offset'](_0x34e2d0[_0xcef1('0x42')][_0xcef1('0x30')]);}return _0x2b6520[_0xcef1('0xa9')](_0x5e0d81);}})[_0xcef1('0x25')](function(_0x6c18f5){if(_0x6c18f5){return _0x6c18f5?{'count':_0x137a3b,'rows':_0x6c18f5}:null;}})['then'](respondWithResult(_0x4ea8d2,null))[_0xcef1('0x55')](handleError(_0x4ea8d2,null));};exports[_0xcef1('0xaa')]=function(_0x2c5440,_0x41b78c,_0x303c27){var _0x2b3143={'raw':![],'where':{}};var _0x45237f={};var _0x134b26={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xcef1('0x6b')]({'where':{'id':_0x2c5440[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x41b78c,null))[_0xcef1('0x25')](function(_0x2b81d8){if(_0x2b81d8){_0x45237f[_0xcef1('0x40')]=_[_0xcef1('0x43')](db[_0xcef1('0x91')][_0xcef1('0x3d')]);_0x45237f[_0xcef1('0x42')]=_['keys'](_0x2c5440[_0xcef1('0x42')]);_0x45237f['filters']=_['intersection'](_0x45237f[_0xcef1('0x40')],_0x45237f['query']);_0x2b3143[_0xcef1('0x45')]=_[_0xcef1('0x46')](_0x45237f[_0xcef1('0x40')],qs['fields'](_0x2c5440[_0xcef1('0x42')][_0xcef1('0x47')]));_0x2b3143['attributes']=_0x2b3143['attributes'][_0xcef1('0x48')]?_0x2b3143[_0xcef1('0x45')]:_0x45237f['model'];if(!_0x2c5440[_0xcef1('0x42')]['hasOwnProperty']('nolimit')){_0x2b3143[_0xcef1('0x33')]=qs[_0xcef1('0x33')](_0x2c5440[_0xcef1('0x42')][_0xcef1('0x33')]);_0x2b3143['offset']=qs[_0xcef1('0x30')](_0x2c5440['query'][_0xcef1('0x30')]);}_0x2b3143[_0xcef1('0x49')]=qs[_0xcef1('0x4a')](_0x2c5440[_0xcef1('0x42')][_0xcef1('0x4a')]);_0x2b3143[_0xcef1('0x4b')]=qs[_0xcef1('0x44')](_[_0xcef1('0x4c')](_0x2c5440['query'],_0x45237f[_0xcef1('0x44')]));_0x2b3143[_0xcef1('0x4b')][_0xcef1('0x6c')]=_0x2b81d8['id'];if(_0x2c5440['query'][_0xcef1('0x4d')]){_0x2b3143[_0xcef1('0x4b')]=_[_0xcef1('0x4e')](_0x2b3143[_0xcef1('0x4b')],{'$or':_[_0xcef1('0x41')](_0x2b3143[_0xcef1('0x45')],function(_0x19f6eb){var _0x2daef4={};_0x2daef4[_0x19f6eb]={'$like':'%'+_0x2c5440['query'][_0xcef1('0x4d')]+'%'};return _0x2daef4;})});}_0x2b3143=_[_0xcef1('0x4e')]({},_0x2b3143,_0x2c5440[_0xcef1('0x51')]);return db[_0xcef1('0x91')][_0xcef1('0x32')]({'where':_0x2b3143[_0xcef1('0x4b')]})[_0xcef1('0x25')](function(_0x49d844){_0x134b26[_0xcef1('0x32')]=_0x49d844;if(_0x2c5440[_0xcef1('0x42')][_0xcef1('0x53')]){_0x2b3143[_0xcef1('0x58')]=[{'model':db['CmContact'],'as':_0xcef1('0xab'),'required':![]},{'model':db[_0xcef1('0xac')],'as':_0xcef1('0xad'),'attributes':[_0xcef1('0x38'),_0xcef1('0xae'),_0xcef1('0xaf')],'required':![]},{'model':db[_0xcef1('0xb0')],'as':_0xcef1('0xb1'),'attributes':['id',_0xcef1('0x38'),'color'],'where':_0x2c5440[_0xcef1('0x42')][_0xcef1('0xb2')]?{'id':_0x2c5440[_0xcef1('0x42')][_0xcef1('0xb2')]}:undefined,'required':_0x2c5440[_0xcef1('0x42')][_0xcef1('0xb2')]?!![]:![]}];}return db[_0xcef1('0x91')][_0xcef1('0x54')](_0x2b3143);})['then'](function(_0xf7b186){_0x134b26['rows']=_0xf7b186;return _0x134b26;});}})[_0xcef1('0x25')](respondWithFilteredResult(_0x41b78c,_0x2b3143))['catch'](handleError(_0x41b78c,null));};exports[_0xcef1('0xb3')]=function(_0x567149,_0x11df2e,_0x2bae6f){return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0x567149[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x11df2e,null))[_0xcef1('0x25')](function(_0x3484ef){if(_0x3484ef){return _0x3484ef[_0xcef1('0xb3')](_0x567149[_0xcef1('0x5b')]['ids'],_[_0xcef1('0xb4')](_0x567149[_0xcef1('0x5b')],[_0xcef1('0x67'),'id'])||{})['spread'](function(_0x3fc3fd){for(var _0x1c4967=0x0;_0x1c4967<_0x567149[_0xcef1('0x5b')][_0xcef1('0x67')][_0xcef1('0x48')];_0x1c4967+=0x1){socket[_0xcef1('0xb5')]('userOpenchannelAccount:save',{'UserId':Number(_0x567149[_0xcef1('0x5b')][_0xcef1('0x67')][_0x1c4967]),'OpenchannelAccountId':Number(_0x567149[_0xcef1('0x57')]['id'])});}return _0x3fc3fd;});}})['then'](respondWithResult(_0x11df2e,null))[_0xcef1('0x55')](handleError(_0x11df2e,null));};exports[_0xcef1('0xb6')]=function(_0x5956cf,_0x447bfc,_0x2e20f1){return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0x5956cf['params']['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x447bfc,null))[_0xcef1('0x25')](function(_0x37be0a){if(_0x37be0a){return _0x37be0a[_0xcef1('0xb6')](_0x5956cf['query'][_0xcef1('0x67')])[_0xcef1('0x25')](function(){if(_[_0xcef1('0xb7')](_0x5956cf[_0xcef1('0x42')]['ids'])){for(var _0x1ba305=0x0;_0x1ba305<_0x5956cf['query'][_0xcef1('0x67')][_0xcef1('0x48')];_0x1ba305+=0x1){socket['emit'](_0xcef1('0xb8'),{'UserId':Number(_0x5956cf[_0xcef1('0x42')]['ids'][_0x1ba305]),'OpenchannelAccountId':Number(_0x5956cf[_0xcef1('0x57')]['id'])});}}else{socket[_0xcef1('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5956cf[_0xcef1('0x42')]['ids']),'OpenchannelAccountId':Number(_0x5956cf[_0xcef1('0x57')]['id'])});}});}})[_0xcef1('0x25')](respondWithStatusCode(_0x447bfc,null))['catch'](handleError(_0x447bfc,null));};exports['getAgents']=function(_0x28f0d8,_0x4ffb4f,_0x2866f4){var _0x16cf0d={};var _0x2d6fc3={};var _0x4f066c;var _0x4ee31d;return db['OpenchannelAccount'][_0xcef1('0x6b')]({'where':{'id':_0x28f0d8[_0xcef1('0x57')]['id']}})['then'](handleEntityNotFound(_0x4ffb4f,null))[_0xcef1('0x25')](function(_0x3caaf2){if(_0x3caaf2){_0x4f066c=_0x3caaf2;_0x2d6fc3[_0xcef1('0x40')]=_[_0xcef1('0x43')](db[_0xcef1('0xac')]['rawAttributes']);_0x2d6fc3[_0xcef1('0x42')]=_['keys'](_0x28f0d8['query']);_0x2d6fc3['filters']=_[_0xcef1('0x46')](_0x2d6fc3[_0xcef1('0x40')],_0x2d6fc3[_0xcef1('0x42')]);_0x16cf0d[_0xcef1('0x45')]=_[_0xcef1('0x46')](_0x2d6fc3[_0xcef1('0x40')],qs['fields'](_0x28f0d8['query'][_0xcef1('0x47')]));_0x16cf0d['attributes']=_0x16cf0d[_0xcef1('0x45')][_0xcef1('0x48')]?_0x16cf0d['attributes']:_0x2d6fc3['model'];_0x16cf0d[_0xcef1('0x49')]=qs[_0xcef1('0x4a')](_0x28f0d8['query'][_0xcef1('0x4a')]);_0x16cf0d[_0xcef1('0x4b')]=qs[_0xcef1('0x44')](_[_0xcef1('0x4c')](_0x28f0d8['query'],_0x2d6fc3[_0xcef1('0x44')]));if(_0x28f0d8[_0xcef1('0x42')][_0xcef1('0x4d')]){_0x16cf0d[_0xcef1('0x4b')]=_[_0xcef1('0x4e')](_0x16cf0d[_0xcef1('0x4b')],{'$or':_[_0xcef1('0x41')](_0x16cf0d[_0xcef1('0x45')],function(_0x224aa1){var _0x568c54={};_0x568c54[_0x224aa1]={'$like':'%'+_0x28f0d8[_0xcef1('0x42')]['filter']+'%'};return _0x568c54;})});}_0x16cf0d=_['merge']({},_0x16cf0d,_0x28f0d8[_0xcef1('0x51')]);return _0x4f066c[_0xcef1('0xb9')](_0x16cf0d);}})['then'](function(_0x4baba9){if(_0x4baba9){_0x4ee31d=_0x4baba9[_0xcef1('0x48')];if(!_0x28f0d8[_0xcef1('0x42')][_0xcef1('0x63')](_0xcef1('0x64'))){_0x16cf0d[_0xcef1('0x33')]=qs[_0xcef1('0x33')](_0x28f0d8[_0xcef1('0x42')][_0xcef1('0x33')]);_0x16cf0d['offset']=qs['offset'](_0x28f0d8[_0xcef1('0x42')][_0xcef1('0x30')]);}return _0x4f066c[_0xcef1('0xb9')](_0x16cf0d);}})[_0xcef1('0x25')](function(_0x52b683){if(_0x52b683){return _0x52b683?{'count':_0x4ee31d,'rows':_0x52b683}:null;}})[_0xcef1('0x25')](respondWithResult(_0x4ffb4f,null))[_0xcef1('0x55')](handleError(_0x4ffb4f,null));};exports[_0xcef1('0x39')]=function(_0x46c37a,_0x2389ed,_0x4b8851){var _0xac7b4b,_0x4f6617,_0x1436d4;if(_[_0xcef1('0x79')](_0x46c37a[_0xcef1('0x5b')][_0xcef1('0x5b')])||_0x46c37a[_0xcef1('0x5b')][_0xcef1('0x5b')]===''){throw new db[(_0xcef1('0x72'))][(_0xcef1('0x7b'))](_0xcef1('0x7c'));}if(_['isNil'](_0x46c37a[_0xcef1('0x5b')]['to'])){}_0xac7b4b=_0x46c37a[_0xcef1('0x5b')]['to'];return db[_0xcef1('0x52')][_0xcef1('0x6b')]({'where':{'id':_0x46c37a[_0xcef1('0x57')]['id']}})[_0xcef1('0x25')](handleEntityNotFound(_0x2389ed,null))['then'](function(_0x13948c){if(_0x13948c){return db[_0xcef1('0x52')][_0xcef1('0x59')]({'where':{'id':_0x13948c['id']},'include':[{'model':db[_0xcef1('0x80')],'as':'List','include':[{'model':db[_0xcef1('0x70')],'as':_0xcef1('0x82'),'where':{[_0x13948c['mapKey']]:_0xac7b4b},'limit':0x1,'order':[[_0xcef1('0x76'),_0xcef1('0x83')]]}]}]})['then'](handleEntityNotFound(_0x2389ed,null))[_0xcef1('0x25')](function(_0x4b9db5){if(_0x4b9db5&&_0x4b9db5['List']){_0x4f6617=_0x4b9db5[_0xcef1('0x35')]({'plain':!![]});if(_0x4f6617[_0xcef1('0x81')]&&_0x4f6617['List']['Contacts'][_0xcef1('0x48')]){return _0x4f6617['List'][_0xcef1('0x82')][0x0];}return db[_0xcef1('0x70')][_0xcef1('0x5a')](_[_0xcef1('0x1c')](_0x46c37a[_0xcef1('0x5b')],{'firstName':_0xac7b4b,[_0x4b9db5[_0xcef1('0x7d')]]:_0xac7b4b,'phone':_0xac7b4b,'ListId':_0x4f6617['ListId']}));}})[_0xcef1('0x25')](handleEntityNotFound(_0x2389ed,null))['then'](function(_0xcc96da){if(_0xcc96da){_0x1436d4=_0xcc96da;return db[_0xcef1('0x91')][_0xcef1('0x59')]({'where':{'ContactId':_0x1436d4['id'],'closed':![],'OpenchannelAccountId':_0x4f6617['id']}})[_0xcef1('0x25')](function(_0x4d727b){if(_0x4d727b){return[_0x4d727b,![]];}return db[_0xcef1('0x91')][_0xcef1('0x5a')]({'UserId':_0x46c37a[_0xcef1('0x5e')]['id'],'ContactId':_0x1436d4['id'],'OpenchannelAccountId':_0x4f6617['id'],'lastMsgDirection':_0xcef1('0xba'),'Messages':[_[_0xcef1('0x4e')](_0x46c37a[_0xcef1('0x5b')],{'read':![],'body':_0x46c37a[_0xcef1('0x5b')][_0xcef1('0x5b')],'OpenchannelAccountId':_0x4f6617['id'],'UserId':_0x46c37a[_0xcef1('0x5e')]['id'],'ContactId':_0x1436d4['id']})]},{'include':[{'model':db[_0xcef1('0x9a')],'as':_0xcef1('0xbb')}]})['then'](function(_0x1d530c){return[_0x1d530c,!![]];});});}})[_0xcef1('0x92')](function(_0x1a8694,_0x29a811){if(_0x29a811){return _0x1a8694;}return db[_0xcef1('0x9a')][_0xcef1('0x5a')](_[_0xcef1('0x4e')](_0x46c37a[_0xcef1('0x5b')],{'read':![],'body':_0x46c37a[_0xcef1('0x5b')][_0xcef1('0x5b')],'OpenchannelAccountId':_0x4f6617['id'],'OpenchannelInteractionId':_0x1a8694['id'],'UserId':_0x46c37a[_0xcef1('0x5e')]['id'],'ContactId':_0x1436d4['id']}))[_0xcef1('0x25')](function(_0x4283cc){_0x1a8694[_0xcef1('0xbc')]['Messages']=[];_0x1a8694[_0xcef1('0xbc')][_0xcef1('0xbb')]['push'](_0x4283cc[_0xcef1('0xbc')]);return _0x1a8694;});});}})['then'](respondWithResult(_0x2389ed,null))[_0xcef1('0x55')](handleError(_0x2389ed,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 926361f..1d1cf09 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x22fb=['hook','exports','OpenchannelAccount','save','update','remove','emit','hasOwnProperty'];(function(_0x246f0c,_0x39f734){var _0x30fe50=function(_0x9a975c){while(--_0x9a975c){_0x246f0c['push'](_0x246f0c['shift']());}};_0x30fe50(++_0x39f734);}(_0x22fb,0x192));var _0xb22f=function(_0x112804,_0x129cd4){_0x112804=_0x112804-0x0;var _0x25e5de=_0x22fb[_0x112804];return _0x25e5de;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xb22f('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb22f('0x1'),'afterUpdate':_0xb22f('0x2'),'afterDestroy':_0xb22f('0x3')};function emitEvent(_0x10d2c4){return function(_0x201512,_0x50cdab,_0x44717d){OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4+':'+_0x201512['id'],_0x201512);OpenchannelAccountEvents[_0xb22f('0x4')](_0x10d2c4,_0x201512);_0x44717d(null);};}for(var e in events){if(events[_0xb22f('0x5')](e)){var event=events[e];OpenchannelAccount[_0xb22f('0x6')](e,emitEvent(event));}}module[_0xb22f('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xa75b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1d7a57,_0x4793e3){var _0x3a05b0=function(_0xe87a10){while(--_0xe87a10){_0x1d7a57['push'](_0x1d7a57['shift']());}};_0x3a05b0(++_0x4793e3);}(_0xa75b,0x170));var _0xba75=function(_0x3f3d7c,_0xcac968){_0x3f3d7c=_0x3f3d7c-0x0;var _0x2a4840=_0xa75b[_0x3f3d7c];return _0x2a4840;};'use strict';var EventEmitter=require(_0xba75('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xba75('0x1')](0x0);var events={'afterCreate':_0xba75('0x2'),'afterUpdate':_0xba75('0x3'),'afterDestroy':_0xba75('0x4')};function emitEvent(_0x1760c0){return function(_0x336606,_0x152269,_0x398bd5){OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0+':'+_0x336606['id'],_0x336606);OpenchannelAccountEvents[_0xba75('0x5')](_0x1760c0,_0x336606);_0x398bd5(null);};}for(var e in events){if(events[_0xba75('0x6')](e)){var event=events[e];OpenchannelAccount[_0xba75('0x7')](e,emitEvent(event));}}module[_0xba75('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index ae56706..becf16b 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(_0xdb639,_0x2d4880){var _0x4bf085=function(_0xe63ad1){while(--_0xe63ad1){_0xdb639['push'](_0xdb639['shift']());}};_0x4bf085(++_0x2d4880);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x2359a9,_0xaeece2){var _0x17c911=function(_0x275cee){while(--_0x275cee){_0x2359a9['push'](_0x2359a9['shift']());}};_0x17c911(++_0xaeece2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 f1be25f..12a573b 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 _0x0647=['jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x0647,0xd0));var _0x7064=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x0647[_0x16771d];return _0x386f11;};'use strict';var _=require(_0x7064('0x0'));var util=require('util');var moment=require(_0x7064('0x1'));var BPromise=require(_0x7064('0x2'));var rs=require(_0x7064('0x3'));var fs=require('fs');var Redis=require(_0x7064('0x4'));var db=require(_0x7064('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7064('0x6'));var config=require(_0x7064('0x7'));var jayson=require(_0x7064('0x8'));var client=jayson[_0x7064('0x9')][_0x7064('0xa')]({'port':0x232a});config[_0x7064('0xb')]=_['defaults'](config['redis'],{'host':_0x7064('0xc'),'port':0x18eb});var socket=require(_0x7064('0xd'))(new Redis(config[_0x7064('0xb')]));require('./openchannelAccount.socket')[_0x7064('0xe')](socket);function respondWithRpcPromise(_0x3f3bdd,_0x5f4ba5,_0xd2aec9){return new BPromise(function(_0x1465bd,_0x3fc84f){return client['request'](_0x3f3bdd,_0xd2aec9)[_0x7064('0xf')](function(_0x17a558){logger[_0x7064('0x10')](_0x7064('0x11'),_0x5f4ba5,'request\x20sent');logger[_0x7064('0x12')](_0x7064('0x13'),_0x5f4ba5,_0x7064('0x14'),JSON[_0x7064('0x15')](_0x17a558));if(_0x17a558[_0x7064('0x16')]){if(_0x17a558[_0x7064('0x16')][_0x7064('0x17')]===0x1f4){logger[_0x7064('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5f4ba5,_0x17a558['error']['message']);return _0x3fc84f(_0x17a558[_0x7064('0x16')][_0x7064('0x18')]);}logger[_0x7064('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x5f4ba5,_0x17a558[_0x7064('0x16')][_0x7064('0x18')]);return _0x1465bd(_0x17a558['error'][_0x7064('0x18')]);}else{logger[_0x7064('0x10')](_0x7064('0x11'),_0x5f4ba5,_0x7064('0x14'));_0x1465bd(_0x17a558[_0x7064('0x19')][_0x7064('0x18')]);}})[_0x7064('0x1a')](function(_0x3e8d73){logger[_0x7064('0x16')](_0x7064('0x11'),_0x5f4ba5,_0x3e8d73);_0x3fc84f(_0x3e8d73);});});} \ No newline at end of file +var _0xb688=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xd2e2ab,_0x2440cf){var _0x1703a2=function(_0x23deba){while(--_0x23deba){_0xd2e2ab['push'](_0xd2e2ab['shift']());}};_0x1703a2(++_0x2440cf);}(_0xb688,0xcf));var _0x8b68=function(_0x355508,_0x3ea9d4){_0x355508=_0x355508-0x0;var _0x5e4187=_0xb688[_0x355508];return _0x5e4187;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var moment=require(_0x8b68('0x1'));var BPromise=require(_0x8b68('0x2'));var rs=require(_0x8b68('0x3'));var fs=require('fs');var Redis=require(_0x8b68('0x4'));var db=require(_0x8b68('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b68('0x6'))(_0x8b68('0x7'));var config=require(_0x8b68('0x8'));var jayson=require(_0x8b68('0x9'));var client=jayson['client'][_0x8b68('0xa')]({'port':0x232a});config['redis']=_[_0x8b68('0xb')](config[_0x8b68('0xc')],{'host':_0x8b68('0xd'),'port':0x18eb});var socket=require(_0x8b68('0xe'))(new Redis(config[_0x8b68('0xc')]));require(_0x8b68('0xf'))[_0x8b68('0x10')](socket);function respondWithRpcPromise(_0x21d944,_0x24e0b0,_0x2f2e3c){return new BPromise(function(_0x418775,_0x317d01){return client[_0x8b68('0x11')](_0x21d944,_0x2f2e3c)['then'](function(_0x2c0f3b){logger[_0x8b68('0x12')](_0x8b68('0x13'),_0x24e0b0,_0x8b68('0x14'));logger[_0x8b68('0x15')](_0x8b68('0x16'),_0x24e0b0,_0x8b68('0x14'),JSON[_0x8b68('0x17')](_0x2c0f3b));if(_0x2c0f3b[_0x8b68('0x18')]){if(_0x2c0f3b['error'][_0x8b68('0x19')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x24e0b0,_0x2c0f3b[_0x8b68('0x18')][_0x8b68('0x1a')]);return _0x317d01(_0x2c0f3b[_0x8b68('0x18')]['message']);}logger['error'](_0x8b68('0x13'),_0x24e0b0,_0x2c0f3b['error'][_0x8b68('0x1a')]);return _0x418775(_0x2c0f3b[_0x8b68('0x18')][_0x8b68('0x1a')]);}else{logger[_0x8b68('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x24e0b0,_0x8b68('0x14'));_0x418775(_0x2c0f3b[_0x8b68('0x1b')]['message']);}})[_0x8b68('0x1c')](function(_0x3c7e5a){logger[_0x8b68('0x18')](_0x8b68('0x13'),_0x24e0b0,_0x3c7e5a);_0x317d01(_0x3c7e5a);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index f780c4b..05b9091 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 _0x5ebe=['removeListener','register','length','save','remove','update'];(function(_0x112c56,_0x4bf06c){var _0x5234bd=function(_0x488bf5){while(--_0x488bf5){_0x112c56['push'](_0x112c56['shift']());}};_0x5234bd(++_0x4bf06c);}(_0x5ebe,0x69));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xe5eb('0x0'),_0xe5eb('0x1'),_0xe5eb('0x2')];function createListener(_0x351ab2,_0x1f85f8){return function(_0x3912d6){_0x1f85f8['emit'](_0x351ab2,_0x3912d6);};}function removeListener(_0x56ef37,_0x465c4e){return function(){OpenchannelAccountEvents[_0xe5eb('0x3')](_0x56ef37,_0x465c4e);};}exports[_0xe5eb('0x4')]=function(_0x1f7414){for(var _0x3055ba=0x0,_0x3ae8d2=events[_0xe5eb('0x5')];_0x3055ba<_0x3ae8d2;_0x3055ba++){var _0x1acd9d=events[_0x3055ba];var _0x5158f0=createListener('openchannelAccount:'+_0x1acd9d,_0x1f7414);OpenchannelAccountEvents['on'](_0x1acd9d,_0x5158f0);}}; \ No newline at end of file +var _0x5106=['removeListener','register','./openchannelAccount.events','remove'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5106,0x116));var _0x6510=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5106[_0x59ee6f];return _0x4c0979;};'use strict';var OpenchannelAccountEvents=require(_0x6510('0x0'));var events=['save',_0x6510('0x1'),'update'];function createListener(_0x183717,_0x4b0419){return function(_0x579fe8){_0x4b0419['emit'](_0x183717,_0x579fe8);};}function removeListener(_0x25620c,_0x4465c2){return function(){OpenchannelAccountEvents[_0x6510('0x2')](_0x25620c,_0x4465c2);};}exports[_0x6510('0x3')]=function(_0x28cb6e){for(var _0x2f5cb3=0x0,_0x485cfa=events['length'];_0x2f5cb3<_0x485cfa;_0x2f5cb3++){var _0x57164e=events[_0x2f5cb3];var _0x226e1a=createListener('openchannelAccount:'+_0x57164e,_0x28cb6e);OpenchannelAccountEvents['on'](_0x57164e,_0x226e1a);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c3452fa..32e0354 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 _0x8739=['post','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8739,0xa8));var _0x9873=function(_0x3f56a3,_0x27e628){_0x3f56a3=_0x3f56a3-0x0;var _0x27001a=_0x8739[_0x3f56a3];return _0x27001a;};'use strict';var multer=require(_0x9873('0x0'));var util=require(_0x9873('0x1'));var path=require(_0x9873('0x2'));var timeout=require('connect-timeout');var express=require(_0x9873('0x3'));var router=express['Router']();var fs_extra=require(_0x9873('0x4'));var auth=require(_0x9873('0x5'));var interaction=require(_0x9873('0x6'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x9873('0x7')]('/',auth['isAuthenticated'](),controller[_0x9873('0x8')]);router[_0x9873('0x7')](_0x9873('0x9'),auth[_0x9873('0xa')](),controller[_0x9873('0xb')]);router[_0x9873('0xc')]('/',auth[_0x9873('0xa')](),controller['create']);router[_0x9873('0xd')](_0x9873('0x9'),auth[_0x9873('0xa')](),controller[_0x9873('0xe')]);router[_0x9873('0xf')](_0x9873('0x9'),auth[_0x9873('0xa')](),controller[_0x9873('0x10')]);module[_0x9873('0x11')]=router; \ No newline at end of file +var _0xe867=['isAuthenticated','index','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0x48e80b,_0x1e3ff6){var _0xce688f=function(_0xfe457a){while(--_0xfe457a){_0x48e80b['push'](_0x48e80b['shift']());}};_0xce688f(++_0x1e3ff6);}(_0xe867,0xb3));var _0x7e86=function(_0x142857,_0x35c5cd){_0x142857=_0x142857-0x0;var _0x33a557=_0xe867[_0x142857];return _0x33a557;};'use strict';var multer=require(_0x7e86('0x0'));var util=require(_0x7e86('0x1'));var path=require(_0x7e86('0x2'));var timeout=require(_0x7e86('0x3'));var express=require(_0x7e86('0x4'));var router=express[_0x7e86('0x5')]();var fs_extra=require(_0x7e86('0x6'));var auth=require(_0x7e86('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7e86('0x8'));var controller=require(_0x7e86('0x9'));router[_0x7e86('0xa')]('/',auth[_0x7e86('0xb')](),controller[_0x7e86('0xc')]);router[_0x7e86('0xa')](_0x7e86('0xd'),auth[_0x7e86('0xb')](),controller[_0x7e86('0xe')]);router['post']('/',auth[_0x7e86('0xb')](),controller[_0x7e86('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7e86('0x10')]);router[_0x7e86('0x11')]('/:id',auth[_0x7e86('0xb')](),controller['destroy']);module[_0x7e86('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 4265213..241333c 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 _0x769e=['*,*,*,*','exports','INTEGER','STRING','TEXT'];(function(_0x46db5e,_0x479d7e){var _0x47a6fa=function(_0xa13b91){while(--_0xa13b91){_0x46db5e['push'](_0x46db5e['shift']());}};_0x47a6fa(++_0x479d7e);}(_0x769e,0x1b9));var _0xe769=function(_0x19a2ed,_0x36493c){_0x19a2ed=_0x19a2ed-0x0;var _0x21bf45=_0x769e[_0x19a2ed];return _0x21bf45;};'use strict';var Sequelize=require('sequelize');module[_0xe769('0x0')]={'priority':{'type':Sequelize[_0xe769('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe769('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe769('0x3')]()},'description':{'type':Sequelize[_0xe769('0x2')]},'interval':{'type':Sequelize[_0xe769('0x2')],'defaultValue':_0xe769('0x4')}}; \ No newline at end of file +var _0x4133=['sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x6092e6,_0x4cf825){var _0x46def9=function(_0xfac934){while(--_0xfac934){_0x6092e6['push'](_0x6092e6['shift']());}};_0x46def9(++_0x4cf825);}(_0x4133,0x10e));var _0x3413=function(_0x2f252d,_0x37e132){_0x2f252d=_0x2f252d-0x0;var _0x31600e=_0x4133[_0x2f252d];return _0x31600e;};'use strict';var Sequelize=require(_0x3413('0x0'));module[_0x3413('0x1')]={'priority':{'type':Sequelize[_0x3413('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3413('0x3')},'appdata':{'type':Sequelize[_0x3413('0x4')]()},'description':{'type':Sequelize[_0x3413('0x5')]},'interval':{'type':Sequelize[_0x3413('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 648b706..4ccad79 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 _0xd811=['query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','key','model'];(function(_0x2a1441,_0x2f183a){var _0x4cd6d8=function(_0x20fbcc){while(--_0x20fbcc){_0x2a1441['push'](_0x2a1441['shift']());}};_0x4cd6d8(++_0x2f183a);}(_0xd811,0x1a6));var _0x1d81=function(_0x2dc81b,_0x2063ae){_0x2dc81b=_0x2dc81b-0x0;var _0x3a2946=_0xd811[_0x2dc81b];return _0x3a2946;};'use strict';var emlformat=require(_0x1d81('0x0'));var rimraf=require(_0x1d81('0x1'));var zipdir=require(_0x1d81('0x2'));var jsonpatch=require(_0x1d81('0x3'));var rp=require('request-promise');var moment=require(_0x1d81('0x4'));var BPromise=require(_0x1d81('0x5'));var Mustache=require(_0x1d81('0x6'));var util=require('util');var path=require(_0x1d81('0x7'));var sox=require(_0x1d81('0x8'));var csv=require(_0x1d81('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d81('0xa'));var _=require(_0x1d81('0xb'));var squel=require('squel');var crypto=require(_0x1d81('0xc'));var jsforce=require(_0x1d81('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d81('0xe'));var Papa=require(_0x1d81('0xf'));var Redis=require(_0x1d81('0x10'));var authService=require(_0x1d81('0x11'));var qs=require(_0x1d81('0x12'));var as=require(_0x1d81('0x13'));var hardwareService=require(_0x1d81('0x14'));var logger=require('../../config/logger')(_0x1d81('0x15'));var utils=require(_0x1d81('0x16'));var config=require(_0x1d81('0x17'));var licenseUtil=require(_0x1d81('0x18'));var db=require(_0x1d81('0x19'))['db'];function respondWithStatusCode(_0x1b3131,_0x4a1f61){_0x4a1f61=_0x4a1f61||0xcc;return function(_0x16d0bc){if(_0x16d0bc){return _0x1b3131['sendStatus'](_0x4a1f61);}return _0x1b3131[_0x1d81('0x1a')](_0x4a1f61)[_0x1d81('0x1b')]();};}function respondWithResult(_0x1512e6,_0x3a13cd){_0x3a13cd=_0x3a13cd||0xc8;return function(_0x57395c){if(_0x57395c){return _0x1512e6['status'](_0x3a13cd)[_0x1d81('0x1c')](_0x57395c);}};}function respondWithFilteredResult(_0x459dd0,_0x1152b3){return function(_0x3ff48e){if(_0x3ff48e){var _0x4af737=typeof _0x1152b3['offset']===_0x1d81('0x1d')&&typeof _0x1152b3[_0x1d81('0x1e')]===_0x1d81('0x1d');var _0x31bd12=_0x3ff48e[_0x1d81('0x1f')];var _0x4b0401=_0x4af737?0x0:_0x1152b3[_0x1d81('0x20')];var _0x491f03=_0x4af737?_0x3ff48e[_0x1d81('0x1f')]:_0x1152b3[_0x1d81('0x20')]+_0x1152b3[_0x1d81('0x1e')];var _0x4f3665;if(_0x491f03>=_0x31bd12){_0x491f03=_0x31bd12;_0x4f3665=0xc8;}else{_0x4f3665=0xce;}_0x459dd0[_0x1d81('0x1a')](_0x4f3665);return _0x459dd0[_0x1d81('0x21')](_0x1d81('0x22'),_0x4b0401+'-'+_0x491f03+'/'+_0x31bd12)[_0x1d81('0x1c')](_0x3ff48e);}return null;};}function patchUpdates(_0x1f131b){return function(_0x4f35f9){try{jsonpatch[_0x1d81('0x23')](_0x4f35f9,_0x1f131b,!![]);}catch(_0x360774){return BPromise[_0x1d81('0x24')](_0x360774);}return _0x4f35f9[_0x1d81('0x25')]();};}function saveUpdates(_0x54b548,_0xf78d6){return function(_0x158880){if(_0x158880){return _0x158880[_0x1d81('0x26')](_0x54b548)[_0x1d81('0x27')](function(_0x29e54a){return _0x29e54a;});}return null;};}function removeEntity(_0x27bd57,_0x262acc){return function(_0x287b2c){if(_0x287b2c){return _0x287b2c[_0x1d81('0x28')]()['then'](function(){_0x27bd57[_0x1d81('0x1a')](0xcc)[_0x1d81('0x1b')]();});}};}function handleEntityNotFound(_0x326f77,_0x599741){return function(_0x1f5fb5){if(!_0x1f5fb5){_0x326f77[_0x1d81('0x29')](0x194);}return _0x1f5fb5;};}function handleError(_0x2a7d4b,_0x36bba4){_0x36bba4=_0x36bba4||0x1f4;return function(_0x1aa9ca){logger[_0x1d81('0x2a')](_0x1aa9ca[_0x1d81('0x2b')]);if(_0x1aa9ca['name']){delete _0x1aa9ca[_0x1d81('0x2c')];}_0x2a7d4b[_0x1d81('0x1a')](_0x36bba4)[_0x1d81('0x2d')](_0x1aa9ca);};}exports[_0x1d81('0x2e')]=function(_0x39b919,_0x427494){var _0x5785b0={},_0x1f0394={},_0x3094f1={'count':0x0,'rows':[]};var _0x1b9853=_[_0x1d81('0x2f')](db[_0x1d81('0x30')][_0x1d81('0x31')],function(_0x4000cf){return{'name':_0x4000cf['fieldName'],'type':_0x4000cf['type'][_0x1d81('0x32')]};});_0x1f0394[_0x1d81('0x33')]=_[_0x1d81('0x2f')](_0x1b9853,'name');_0x1f0394[_0x1d81('0x34')]=_[_0x1d81('0x35')](_0x39b919['query']);_0x1f0394[_0x1d81('0x36')]=_[_0x1d81('0x37')](_0x1f0394[_0x1d81('0x33')],_0x1f0394[_0x1d81('0x34')]);_0x5785b0['attributes']=_[_0x1d81('0x37')](_0x1f0394['model'],qs[_0x1d81('0x38')](_0x39b919['query'][_0x1d81('0x38')]));_0x5785b0[_0x1d81('0x39')]=_0x5785b0['attributes'][_0x1d81('0x3a')]?_0x5785b0['attributes']:_0x1f0394[_0x1d81('0x33')];if(!_0x39b919[_0x1d81('0x34')][_0x1d81('0x3b')](_0x1d81('0x3c'))){_0x5785b0[_0x1d81('0x1e')]=qs[_0x1d81('0x1e')](_0x39b919[_0x1d81('0x34')][_0x1d81('0x1e')]);_0x5785b0[_0x1d81('0x20')]=qs['offset'](_0x39b919['query'][_0x1d81('0x20')]);}_0x5785b0['order']=qs[_0x1d81('0x3d')](_0x39b919['query'][_0x1d81('0x3d')]);_0x5785b0[_0x1d81('0x3e')]=qs[_0x1d81('0x36')](_[_0x1d81('0x3f')](_0x39b919[_0x1d81('0x34')],_0x1f0394[_0x1d81('0x36')]),_0x1b9853);if(_0x39b919[_0x1d81('0x34')][_0x1d81('0x40')]){_0x5785b0[_0x1d81('0x3e')]=_[_0x1d81('0x41')](_0x5785b0['where'],{'$or':_['map'](_0x1b9853,function(_0x302f72){if(_0x302f72[_0x1d81('0x42')]!==_0x1d81('0x43')){var _0x21a777={};_0x21a777[_0x302f72['name']]={'$like':'%'+_0x39b919[_0x1d81('0x34')]['filter']+'%'};return _0x21a777;}})});}_0x5785b0=_[_0x1d81('0x41')]({},_0x5785b0,_0x39b919[_0x1d81('0x44')]);var _0x1e59be={'where':_0x5785b0['where']};return db['OpenchannelApplication'][_0x1d81('0x1f')](_0x1e59be)[_0x1d81('0x27')](function(_0x5eed97){_0x3094f1[_0x1d81('0x1f')]=_0x5eed97;if(_0x39b919[_0x1d81('0x34')][_0x1d81('0x45')]){_0x5785b0[_0x1d81('0x46')]=[{'all':!![]}];}return db[_0x1d81('0x30')][_0x1d81('0x47')](_0x5785b0);})['then'](function(_0x5faf9a){_0x3094f1[_0x1d81('0x48')]=_0x5faf9a;return _0x3094f1;})[_0x1d81('0x27')](respondWithFilteredResult(_0x427494,_0x5785b0))[_0x1d81('0x49')](handleError(_0x427494,null));};exports[_0x1d81('0x4a')]=function(_0x3dfb83,_0x372089){var _0x2e6ba0={'raw':!![],'where':{'id':_0x3dfb83[_0x1d81('0x4b')]['id']}},_0x48377f={};_0x48377f['model']=_['keys'](db[_0x1d81('0x30')][_0x1d81('0x31')]);_0x48377f[_0x1d81('0x34')]=_[_0x1d81('0x35')](_0x3dfb83['query']);_0x48377f['filters']=_[_0x1d81('0x37')](_0x48377f['model'],_0x48377f[_0x1d81('0x34')]);_0x2e6ba0['attributes']=_[_0x1d81('0x37')](_0x48377f[_0x1d81('0x33')],qs[_0x1d81('0x38')](_0x3dfb83[_0x1d81('0x34')][_0x1d81('0x38')]));_0x2e6ba0['attributes']=_0x2e6ba0['attributes']['length']?_0x2e6ba0['attributes']:_0x48377f[_0x1d81('0x33')];if(_0x3dfb83[_0x1d81('0x34')][_0x1d81('0x45')]){_0x2e6ba0['include']=[{'all':!![]}];}_0x2e6ba0=_[_0x1d81('0x41')]({},_0x2e6ba0,_0x3dfb83[_0x1d81('0x44')]);return db[_0x1d81('0x30')]['find'](_0x2e6ba0)[_0x1d81('0x27')](handleEntityNotFound(_0x372089,null))['then'](respondWithResult(_0x372089,null))[_0x1d81('0x49')](handleError(_0x372089,null));};exports[_0x1d81('0x4c')]=function(_0x2fdd2d,_0x12204d){return db[_0x1d81('0x30')][_0x1d81('0x4c')](_0x2fdd2d[_0x1d81('0x4d')],{})[_0x1d81('0x27')](respondWithResult(_0x12204d,0xc9))[_0x1d81('0x49')](handleError(_0x12204d,null));};exports[_0x1d81('0x26')]=function(_0xaee833,_0x261255){if(_0xaee833['body']['id']){delete _0xaee833['body']['id'];}return db[_0x1d81('0x30')][_0x1d81('0x4e')]({'where':{'id':_0xaee833['params']['id']}})[_0x1d81('0x27')](handleEntityNotFound(_0x261255,null))[_0x1d81('0x27')](saveUpdates(_0xaee833[_0x1d81('0x4d')],null))[_0x1d81('0x27')](respondWithResult(_0x261255,null))[_0x1d81('0x49')](handleError(_0x261255,null));};exports[_0x1d81('0x28')]=function(_0x323d7e,_0x43444a){return db[_0x1d81('0x30')]['find']({'where':{'id':_0x323d7e[_0x1d81('0x4b')]['id']}})[_0x1d81('0x27')](handleEntityNotFound(_0x43444a,null))[_0x1d81('0x27')](removeEntity(_0x43444a,null))['catch'](handleError(_0x43444a,null));}; \ No newline at end of file +var _0x6b8c=['where','pick','filter','VIRTUAL','merge','options','includeAll','include','OpenchannelApplication','findAll','rows','show','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort'];(function(_0x2e1205,_0xb6ef57){var _0x48bdce=function(_0x2948c8){while(--_0x2948c8){_0x2e1205['push'](_0x2e1205['shift']());}};_0x48bdce(++_0xb6ef57);}(_0x6b8c,0x1d9));var _0xc6b8=function(_0x26d5f0,_0x5ab13e){_0x26d5f0=_0x26d5f0-0x0;var _0x144cf1=_0x6b8c[_0x26d5f0];return _0x144cf1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6b8('0x0'));var zipdir=require(_0xc6b8('0x1'));var jsonpatch=require(_0xc6b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6b8('0x3'));var util=require(_0xc6b8('0x4'));var path=require(_0xc6b8('0x5'));var sox=require(_0xc6b8('0x6'));var csv=require(_0xc6b8('0x7'));var ejs=require(_0xc6b8('0x8'));var fs=require('fs');var fs_extra=require(_0xc6b8('0x9'));var _=require(_0xc6b8('0xa'));var squel=require(_0xc6b8('0xb'));var crypto=require(_0xc6b8('0xc'));var jsforce=require(_0xc6b8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc6b8('0x7'));var querystring=require(_0xc6b8('0xe'));var Papa=require(_0xc6b8('0xf'));var Redis=require(_0xc6b8('0x10'));var authService=require(_0xc6b8('0x11'));var qs=require(_0xc6b8('0x12'));var as=require(_0xc6b8('0x13'));var hardwareService=require(_0xc6b8('0x14'));var logger=require(_0xc6b8('0x15'))(_0xc6b8('0x16'));var utils=require(_0xc6b8('0x17'));var config=require(_0xc6b8('0x18'));var licenseUtil=require(_0xc6b8('0x19'));var db=require(_0xc6b8('0x1a'))['db'];function respondWithStatusCode(_0x1629b6,_0x35d4b4){_0x35d4b4=_0x35d4b4||0xcc;return function(_0x3fcd69){if(_0x3fcd69){return _0x1629b6[_0xc6b8('0x1b')](_0x35d4b4);}return _0x1629b6[_0xc6b8('0x1c')](_0x35d4b4)[_0xc6b8('0x1d')]();};}function respondWithResult(_0x19cf19,_0x5546cc){_0x5546cc=_0x5546cc||0xc8;return function(_0x20d474){if(_0x20d474){return _0x19cf19[_0xc6b8('0x1c')](_0x5546cc)['json'](_0x20d474);}};}function respondWithFilteredResult(_0x39572f,_0x1fc939){return function(_0x1defa3){if(_0x1defa3){var _0x30b785=typeof _0x1fc939[_0xc6b8('0x1e')]===_0xc6b8('0x1f')&&typeof _0x1fc939[_0xc6b8('0x20')]===_0xc6b8('0x1f');var _0x417d9d=_0x1defa3[_0xc6b8('0x21')];var _0x11d263=_0x30b785?0x0:_0x1fc939['offset'];var _0x218aca=_0x30b785?_0x1defa3[_0xc6b8('0x21')]:_0x1fc939[_0xc6b8('0x1e')]+_0x1fc939[_0xc6b8('0x20')];var _0x5876ab;if(_0x218aca>=_0x417d9d){_0x218aca=_0x417d9d;_0x5876ab=0xc8;}else{_0x5876ab=0xce;}_0x39572f[_0xc6b8('0x1c')](_0x5876ab);return _0x39572f[_0xc6b8('0x22')](_0xc6b8('0x23'),_0x11d263+'-'+_0x218aca+'/'+_0x417d9d)[_0xc6b8('0x24')](_0x1defa3);}return null;};}function patchUpdates(_0x3f6f3a){return function(_0x192f51){try{jsonpatch['apply'](_0x192f51,_0x3f6f3a,!![]);}catch(_0x12fdc7){return BPromise['reject'](_0x12fdc7);}return _0x192f51[_0xc6b8('0x25')]();};}function saveUpdates(_0x1ddeac,_0x366c49){return function(_0x315e0d){if(_0x315e0d){return _0x315e0d[_0xc6b8('0x26')](_0x1ddeac)[_0xc6b8('0x27')](function(_0x5820af){return _0x5820af;});}return null;};}function removeEntity(_0x2cac43,_0xae141e){return function(_0x136c1c){if(_0x136c1c){return _0x136c1c[_0xc6b8('0x28')]()[_0xc6b8('0x27')](function(){_0x2cac43[_0xc6b8('0x1c')](0xcc)[_0xc6b8('0x1d')]();});}};}function handleEntityNotFound(_0x11208f,_0x57a4fe){return function(_0x2a2c5d){if(!_0x2a2c5d){_0x11208f[_0xc6b8('0x1b')](0x194);}return _0x2a2c5d;};}function handleError(_0x10c6f5,_0x35a2df){_0x35a2df=_0x35a2df||0x1f4;return function(_0x4aa308){logger[_0xc6b8('0x29')](_0x4aa308[_0xc6b8('0x2a')]);if(_0x4aa308[_0xc6b8('0x2b')]){delete _0x4aa308[_0xc6b8('0x2b')];}_0x10c6f5[_0xc6b8('0x1c')](_0x35a2df)['send'](_0x4aa308);};}exports[_0xc6b8('0x2c')]=function(_0x276042,_0x3479c1){var _0xc90bb2={},_0x2281d3={},_0x4c715d={'count':0x0,'rows':[]};var _0x5e4264=_['map'](db['OpenchannelApplication'][_0xc6b8('0x2d')],function(_0x5b28cd){return{'name':_0x5b28cd['fieldName'],'type':_0x5b28cd[_0xc6b8('0x2e')][_0xc6b8('0x2f')]};});_0x2281d3[_0xc6b8('0x30')]=_[_0xc6b8('0x31')](_0x5e4264,_0xc6b8('0x2b'));_0x2281d3[_0xc6b8('0x32')]=_[_0xc6b8('0x33')](_0x276042[_0xc6b8('0x32')]);_0x2281d3[_0xc6b8('0x34')]=_[_0xc6b8('0x35')](_0x2281d3[_0xc6b8('0x30')],_0x2281d3[_0xc6b8('0x32')]);_0xc90bb2['attributes']=_['intersection'](_0x2281d3[_0xc6b8('0x30')],qs[_0xc6b8('0x36')](_0x276042['query'][_0xc6b8('0x36')]));_0xc90bb2[_0xc6b8('0x37')]=_0xc90bb2['attributes'][_0xc6b8('0x38')]?_0xc90bb2[_0xc6b8('0x37')]:_0x2281d3[_0xc6b8('0x30')];if(!_0x276042[_0xc6b8('0x32')]['hasOwnProperty'](_0xc6b8('0x39'))){_0xc90bb2[_0xc6b8('0x20')]=qs['limit'](_0x276042['query'][_0xc6b8('0x20')]);_0xc90bb2[_0xc6b8('0x1e')]=qs[_0xc6b8('0x1e')](_0x276042[_0xc6b8('0x32')][_0xc6b8('0x1e')]);}_0xc90bb2['order']=qs[_0xc6b8('0x3a')](_0x276042[_0xc6b8('0x32')]['sort']);_0xc90bb2[_0xc6b8('0x3b')]=qs[_0xc6b8('0x34')](_[_0xc6b8('0x3c')](_0x276042[_0xc6b8('0x32')],_0x2281d3[_0xc6b8('0x34')]),_0x5e4264);if(_0x276042[_0xc6b8('0x32')][_0xc6b8('0x3d')]){_0xc90bb2[_0xc6b8('0x3b')]=_['merge'](_0xc90bb2['where'],{'$or':_[_0xc6b8('0x31')](_0x5e4264,function(_0x3b8193){if(_0x3b8193[_0xc6b8('0x2e')]!==_0xc6b8('0x3e')){var _0x565245={};_0x565245[_0x3b8193['name']]={'$like':'%'+_0x276042[_0xc6b8('0x32')][_0xc6b8('0x3d')]+'%'};return _0x565245;}})});}_0xc90bb2=_[_0xc6b8('0x3f')]({},_0xc90bb2,_0x276042[_0xc6b8('0x40')]);var _0x1440c5={'where':_0xc90bb2[_0xc6b8('0x3b')]};return db['OpenchannelApplication'][_0xc6b8('0x21')](_0x1440c5)['then'](function(_0x43538b){_0x4c715d[_0xc6b8('0x21')]=_0x43538b;if(_0x276042[_0xc6b8('0x32')][_0xc6b8('0x41')]){_0xc90bb2[_0xc6b8('0x42')]=[{'all':!![]}];}return db[_0xc6b8('0x43')][_0xc6b8('0x44')](_0xc90bb2);})['then'](function(_0x51a98a){_0x4c715d[_0xc6b8('0x45')]=_0x51a98a;return _0x4c715d;})[_0xc6b8('0x27')](respondWithFilteredResult(_0x3479c1,_0xc90bb2))['catch'](handleError(_0x3479c1,null));};exports[_0xc6b8('0x46')]=function(_0x12fc80,_0x24ec8f){var _0x149036={'raw':!![],'where':{'id':_0x12fc80['params']['id']}},_0x19247f={};_0x19247f[_0xc6b8('0x30')]=_[_0xc6b8('0x33')](db[_0xc6b8('0x43')][_0xc6b8('0x2d')]);_0x19247f[_0xc6b8('0x32')]=_[_0xc6b8('0x33')](_0x12fc80[_0xc6b8('0x32')]);_0x19247f['filters']=_[_0xc6b8('0x35')](_0x19247f[_0xc6b8('0x30')],_0x19247f[_0xc6b8('0x32')]);_0x149036[_0xc6b8('0x37')]=_[_0xc6b8('0x35')](_0x19247f[_0xc6b8('0x30')],qs[_0xc6b8('0x36')](_0x12fc80[_0xc6b8('0x32')][_0xc6b8('0x36')]));_0x149036[_0xc6b8('0x37')]=_0x149036[_0xc6b8('0x37')][_0xc6b8('0x38')]?_0x149036[_0xc6b8('0x37')]:_0x19247f[_0xc6b8('0x30')];if(_0x12fc80[_0xc6b8('0x32')][_0xc6b8('0x41')]){_0x149036[_0xc6b8('0x42')]=[{'all':!![]}];}_0x149036=_[_0xc6b8('0x3f')]({},_0x149036,_0x12fc80['options']);return db[_0xc6b8('0x43')][_0xc6b8('0x47')](_0x149036)['then'](handleEntityNotFound(_0x24ec8f,null))[_0xc6b8('0x27')](respondWithResult(_0x24ec8f,null))[_0xc6b8('0x48')](handleError(_0x24ec8f,null));};exports[_0xc6b8('0x49')]=function(_0x30b30d,_0x56abe1){return db['OpenchannelApplication'][_0xc6b8('0x49')](_0x30b30d[_0xc6b8('0x4a')],{})[_0xc6b8('0x27')](respondWithResult(_0x56abe1,0xc9))['catch'](handleError(_0x56abe1,null));};exports['update']=function(_0x270d2f,_0x156d17){if(_0x270d2f[_0xc6b8('0x4a')]['id']){delete _0x270d2f[_0xc6b8('0x4a')]['id'];}return db['OpenchannelApplication'][_0xc6b8('0x47')]({'where':{'id':_0x270d2f[_0xc6b8('0x4b')]['id']}})[_0xc6b8('0x27')](handleEntityNotFound(_0x156d17,null))[_0xc6b8('0x27')](saveUpdates(_0x270d2f[_0xc6b8('0x4a')],null))['then'](respondWithResult(_0x156d17,null))[_0xc6b8('0x48')](handleError(_0x156d17,null));};exports['destroy']=function(_0x522caa,_0x556312){return db[_0xc6b8('0x43')][_0xc6b8('0x47')]({'where':{'id':_0x522caa[_0xc6b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x556312,null))[_0xc6b8('0x27')](removeEntity(_0x556312,null))[_0xc6b8('0x48')](handleError(_0x556312,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index fedf1a5..5a77c79 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 _0x810b=['rimraf','../../config/environment','./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1f6e71,_0x19360b){var _0x2271aa=function(_0x2f0431){while(--_0x2f0431){_0x1f6e71['push'](_0x1f6e71['shift']());}};_0x2271aa(++_0x19360b);}(_0x810b,0xc6));var _0xb810=function(_0x140c3a,_0x534e1f){_0x140c3a=_0x140c3a-0x0;var _0xeb8026=_0x810b[_0x140c3a];return _0xeb8026;};'use strict';var _=require('lodash');var util=require(_0xb810('0x0'));var logger=require(_0xb810('0x1'))('api');var moment=require(_0xb810('0x2'));var BPromise=require(_0xb810('0x3'));var rp=require(_0xb810('0x4'));var fs=require('fs');var path=require(_0xb810('0x5'));var rimraf=require(_0xb810('0x6'));var config=require(_0xb810('0x7'));var attributes=require(_0xb810('0x8'));module[_0xb810('0x9')]=function(_0x45645f,_0x399029){return _0x45645f['define']('OpenchannelApplication',attributes,{'tableName':_0xb810('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb810('0xb')});}; \ No newline at end of file +var _0xf625=['../../config/environment','./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0xf625,0x1b3));var _0x5f62=function(_0x168466,_0x5f37e5){_0x168466=_0x168466-0x0;var _0xcf8a4=_0xf625[_0x168466];return _0xcf8a4;};'use strict';var _=require(_0x5f62('0x0'));var util=require('util');var logger=require(_0x5f62('0x1'))(_0x5f62('0x2'));var moment=require(_0x5f62('0x3'));var BPromise=require('bluebird');var rp=require(_0x5f62('0x4'));var fs=require('fs');var path=require(_0x5f62('0x5'));var rimraf=require(_0x5f62('0x6'));var config=require(_0x5f62('0x7'));var attributes=require(_0x5f62('0x8'));module[_0x5f62('0x9')]=function(_0x3008da,_0x3b12f0){return _0x3008da['define']('OpenchannelApplication',attributes,{'tableName':_0x5f62('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5f62('0xb'),'collate':_0x5f62('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 4a33cee..aea232d 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 _0x22fb=['code','message','info','result','catch','UpdateOpenchannelApplication','body','options','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13af7e,_0x4a7fb2){var _0x40d3cb=function(_0x8b1bbc){while(--_0x8b1bbc){_0x13af7e['push'](_0x13af7e['shift']());}};_0x40d3cb(++_0x4a7fb2);}(_0x22fb,0x141));var _0xb22f=function(_0x8d7cb7,_0x179a2c){_0x8d7cb7=_0x8d7cb7-0x0;var _0x34bc56=_0x22fb[_0x8d7cb7];return _0x34bc56;};'use strict';var _=require('lodash');var util=require(_0xb22f('0x0'));var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rs=require(_0xb22f('0x3'));var fs=require('fs');var Redis=require(_0xb22f('0x4'));var db=require(_0xb22f('0x5'))['db'];var utils=require(_0xb22f('0x6'));var logger=require(_0xb22f('0x7'))(_0xb22f('0x8'));var config=require(_0xb22f('0x9'));var jayson=require(_0xb22f('0xa'));var client=jayson[_0xb22f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x345945,_0x3c3a86,_0x19182c){return new BPromise(function(_0x3aa7de,_0x4270b7){return client[_0xb22f('0xc')](_0x345945,_0x19182c)[_0xb22f('0xd')](function(_0x5a6fa9){logger['info'](_0xb22f('0xe'),_0x3c3a86,_0xb22f('0xf'));logger[_0xb22f('0x10')](_0xb22f('0x11'),_0x3c3a86,_0xb22f('0xf'),JSON[_0xb22f('0x12')](_0x5a6fa9));if(_0x5a6fa9[_0xb22f('0x13')]){if(_0x5a6fa9[_0xb22f('0x13')][_0xb22f('0x14')]===0x1f4){logger[_0xb22f('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x3c3a86,_0x5a6fa9[_0xb22f('0x13')][_0xb22f('0x15')]);return _0x4270b7(_0x5a6fa9[_0xb22f('0x13')][_0xb22f('0x15')]);}logger['error'](_0xb22f('0xe'),_0x3c3a86,_0x5a6fa9[_0xb22f('0x13')][_0xb22f('0x15')]);return _0x3aa7de(_0x5a6fa9[_0xb22f('0x13')][_0xb22f('0x15')]);}else{logger[_0xb22f('0x16')](_0xb22f('0xe'),_0x3c3a86,_0xb22f('0xf'));_0x3aa7de(_0x5a6fa9[_0xb22f('0x17')][_0xb22f('0x15')]);}})[_0xb22f('0x18')](function(_0x5388f8){logger[_0xb22f('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x3c3a86,_0x5388f8);_0x4270b7(_0x5388f8);});});}exports[_0xb22f('0x19')]=function(_0x1fdfed){var _0x4b65ff=this;return new Promise(function(_0x3ac7dc,_0x5c7b85){return db['OpenchannelApplication']['update'](_0x1fdfed[_0xb22f('0x1a')],{'raw':_0x1fdfed['options']?_0x1fdfed[_0xb22f('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fdfed[_0xb22f('0x1b')]?_0x1fdfed[_0xb22f('0x1b')][_0xb22f('0x1c')]||null:null,'attributes':_0x1fdfed[_0xb22f('0x1b')]?_0x1fdfed[_0xb22f('0x1b')][_0xb22f('0x1d')]||null:null,'limit':_0x1fdfed[_0xb22f('0x1b')]?_0x1fdfed[_0xb22f('0x1b')][_0xb22f('0x1e')]||null:null})[_0xb22f('0xd')](function(_0x107c24){logger[_0xb22f('0x16')](_0xb22f('0x19'),_0x1fdfed);logger[_0xb22f('0x10')]('UpdateOpenchannelApplication',_0x1fdfed,JSON[_0xb22f('0x12')](_0x107c24));_0x3ac7dc(_0x107c24);})['catch'](function(_0xb3c5c0){logger[_0xb22f('0x13')](_0xb22f('0x19'),_0xb3c5c0[_0xb22f('0x15')],_0x1fdfed);_0x5c7b85(_0x4b65ff[_0xb22f('0x13')](0x1f4,_0xb3c5c0[_0xb22f('0x15')]));});});}; \ No newline at end of file +var _0x30df=['util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x30df,0x1df));var _0xf30d=function(_0x486e08,_0x4743b8){_0x486e08=_0x486e08-0x0;var _0x4fbb15=_0x30df[_0x486e08];return _0x4fbb15;};'use strict';var _=require(_0xf30d('0x0'));var util=require(_0xf30d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf30d('0x2'));var fs=require('fs');var Redis=require(_0xf30d('0x3'));var db=require(_0xf30d('0x4'))['db'];var utils=require(_0xf30d('0x5'));var logger=require('../../config/logger')(_0xf30d('0x6'));var config=require(_0xf30d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf30d('0x8')][_0xf30d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x327245,_0x890ec0,_0x19e663){return new BPromise(function(_0x39beff,_0x552343){return client[_0xf30d('0xa')](_0x327245,_0x19e663)[_0xf30d('0xb')](function(_0x361ad1){logger[_0xf30d('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x890ec0,_0xf30d('0xd'));logger[_0xf30d('0xe')](_0xf30d('0xf'),_0x890ec0,'request\x20sent',JSON[_0xf30d('0x10')](_0x361ad1));if(_0x361ad1['error']){if(_0x361ad1[_0xf30d('0x11')][_0xf30d('0x12')]===0x1f4){logger[_0xf30d('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x890ec0,_0x361ad1[_0xf30d('0x11')]['message']);return _0x552343(_0x361ad1[_0xf30d('0x11')][_0xf30d('0x13')]);}logger[_0xf30d('0x11')](_0xf30d('0x14'),_0x890ec0,_0x361ad1[_0xf30d('0x11')][_0xf30d('0x13')]);return _0x39beff(_0x361ad1[_0xf30d('0x11')][_0xf30d('0x13')]);}else{logger[_0xf30d('0xc')](_0xf30d('0x14'),_0x890ec0,_0xf30d('0xd'));_0x39beff(_0x361ad1[_0xf30d('0x15')]['message']);}})[_0xf30d('0x16')](function(_0xed0ff2){logger[_0xf30d('0x11')](_0xf30d('0x14'),_0x890ec0,_0xed0ff2);_0x552343(_0xed0ff2);});});}exports[_0xf30d('0x17')]=function(_0x3af959){var _0x3136fb=this;return new Promise(function(_0x363164,_0x2996fb){return db[_0xf30d('0x18')][_0xf30d('0x19')](_0x3af959[_0xf30d('0x1a')],{'raw':_0x3af959[_0xf30d('0x1b')]?_0x3af959[_0xf30d('0x1b')][_0xf30d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3af959['options']?_0x3af959[_0xf30d('0x1b')][_0xf30d('0x1d')]||null:null,'attributes':_0x3af959[_0xf30d('0x1b')]?_0x3af959['options'][_0xf30d('0x1e')]||null:null,'limit':_0x3af959['options']?_0x3af959[_0xf30d('0x1b')][_0xf30d('0x1f')]||null:null})[_0xf30d('0xb')](function(_0x505163){logger[_0xf30d('0xc')](_0xf30d('0x17'),_0x3af959);logger[_0xf30d('0xe')](_0xf30d('0x17'),_0x3af959,JSON[_0xf30d('0x10')](_0x505163));_0x363164(_0x505163);})[_0xf30d('0x16')](function(_0x4e3b8c){logger['error'](_0xf30d('0x17'),_0x4e3b8c['message'],_0x3af959);_0x2996fb(_0x3136fb[_0xf30d('0x11')](0x1f4,_0x4e3b8c[_0xf30d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index a1d8a6d..b3ee181 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 _0x3f89=['isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get'];(function(_0x5d4370,_0x1e03c2){var _0x210bdd=function(_0x288a15){while(--_0x288a15){_0x5d4370['push'](_0x5d4370['shift']());}};_0x210bdd(++_0x1e03c2);}(_0x3f89,0x1e4));var _0x93f8=function(_0x88f4ce,_0x832077){_0x88f4ce=_0x88f4ce-0x0;var _0x2ee396=_0x3f89[_0x88f4ce];return _0x2ee396;};'use strict';var multer=require(_0x93f8('0x0'));var util=require(_0x93f8('0x1'));var path=require(_0x93f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x93f8('0x3'));var router=express[_0x93f8('0x4')]();var fs_extra=require(_0x93f8('0x5'));var auth=require(_0x93f8('0x6'));var interaction=require(_0x93f8('0x7'));var config=require(_0x93f8('0x8'));var controller=require(_0x93f8('0x9'));router[_0x93f8('0xa')]('/',auth[_0x93f8('0xb')](),controller[_0x93f8('0xc')]);router[_0x93f8('0xa')](_0x93f8('0xd'),auth[_0x93f8('0xb')](),controller['describe']);router['get'](_0x93f8('0xe'),auth[_0x93f8('0xb')](),controller[_0x93f8('0xf')]);router[_0x93f8('0xa')](_0x93f8('0x10'),auth[_0x93f8('0xb')](),controller['getMessages']);router[_0x93f8('0xa')](_0x93f8('0x11'),auth[_0x93f8('0xb')](),controller[_0x93f8('0x12')]);router[_0x93f8('0x13')]('/',auth['isAuthenticated'](),controller[_0x93f8('0x14')]);router[_0x93f8('0x13')](_0x93f8('0x10'),auth[_0x93f8('0xb')](),controller['addMessage']);router[_0x93f8('0x13')](_0x93f8('0x15'),auth[_0x93f8('0xb')](),interaction[_0x93f8('0x16')](_0x93f8('0x17'),_0x93f8('0x18')),controller[_0x93f8('0x19')]);router[_0x93f8('0x1a')]('/:id',auth[_0x93f8('0xb')](),interaction[_0x93f8('0x16')](_0x93f8('0x17'),_0x93f8('0x1b')),controller[_0x93f8('0x1c')]);router[_0x93f8('0x1d')](_0x93f8('0xe'),auth[_0x93f8('0xb')](),interaction[_0x93f8('0x16')]('openchannel',_0x93f8('0x1e')),controller[_0x93f8('0x1f')]);router[_0x93f8('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module[_0x93f8('0x20')]=router; \ No newline at end of file +var _0x7d0e=['removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','update','delete','destroy'];(function(_0x393709,_0x1339b1){var _0x1a07b1=function(_0x1a36d9){while(--_0x1a36d9){_0x393709['push'](_0x393709['shift']());}};_0x1a07b1(++_0x1339b1);}(_0x7d0e,0x1f1));var _0xe7d0=function(_0x2d6e42,_0x2a9782){_0x2d6e42=_0x2d6e42-0x0;var _0x4083a9=_0x7d0e[_0x2d6e42];return _0x4083a9;};'use strict';var multer=require(_0xe7d0('0x0'));var util=require(_0xe7d0('0x1'));var path=require(_0xe7d0('0x2'));var timeout=require(_0xe7d0('0x3'));var express=require(_0xe7d0('0x4'));var router=express[_0xe7d0('0x5')]();var fs_extra=require(_0xe7d0('0x6'));var auth=require(_0xe7d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe7d0('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xe7d0('0x9')]('/',auth[_0xe7d0('0xa')](),controller[_0xe7d0('0xb')]);router[_0xe7d0('0x9')](_0xe7d0('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xe7d0('0x9')](_0xe7d0('0xd'),auth[_0xe7d0('0xa')](),controller[_0xe7d0('0xe')]);router[_0xe7d0('0x9')](_0xe7d0('0xf'),auth[_0xe7d0('0xa')](),controller[_0xe7d0('0x10')]);router[_0xe7d0('0x9')](_0xe7d0('0x11'),auth[_0xe7d0('0xa')](),controller[_0xe7d0('0x12')]);router[_0xe7d0('0x13')]('/',auth[_0xe7d0('0xa')](),controller[_0xe7d0('0x14')]);router['post'](_0xe7d0('0xf'),auth['isAuthenticated'](),controller[_0xe7d0('0x15')]);router[_0xe7d0('0x13')](_0xe7d0('0x16'),auth[_0xe7d0('0xa')](),interaction[_0xe7d0('0x17')](_0xe7d0('0x18'),'openchannelinteraction:addtags'),controller[_0xe7d0('0x19')]);router[_0xe7d0('0x1a')](_0xe7d0('0xd'),auth['isAuthenticated'](),interaction[_0xe7d0('0x17')](_0xe7d0('0x18'),_0xe7d0('0x1b')),controller[_0xe7d0('0x1c')]);router[_0xe7d0('0x1d')]('/:id',auth[_0xe7d0('0xa')](),interaction[_0xe7d0('0x17')](_0xe7d0('0x18'),'openchannelinteraction:destroy'),controller[_0xe7d0('0x1e')]);router[_0xe7d0('0x1d')](_0xe7d0('0x16'),auth[_0xe7d0('0xa')](),controller[_0xe7d0('0x1f')]);module[_0xe7d0('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index f2afce2..3cbc5d4 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 _0x5697=['STRING','sequelize','BOOLEAN','DATE'];(function(_0x405ef1,_0xe6ef5b){var _0x49460f=function(_0x18a330){while(--_0x18a330){_0x405ef1['push'](_0x405ef1['shift']());}};_0x49460f(++_0xe6ef5b);}(_0x5697,0x1b5));var _0x7569=function(_0xf61586,_0x56b0c4){_0xf61586=_0xf61586-0x0;var _0x2b6eb3=_0x5697[_0xf61586];return _0x2b6eb3;};'use strict';var Sequelize=require(_0x7569('0x0'));module['exports']={'closed':{'type':Sequelize[_0x7569('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7569('0x2')]},'disposition':{'type':Sequelize[_0x7569('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x7569('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7569('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x7569('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x46fc=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x408ee1,_0x406b6f){var _0xe16c92=function(_0x30380b){while(--_0x30380b){_0x408ee1['push'](_0x408ee1['shift']());}};_0xe16c92(++_0x406b6f);}(_0x46fc,0x103));var _0xc46f=function(_0x392a61,_0x148151){_0x392a61=_0x392a61-0x0;var _0x5333e8=_0x46fc[_0x392a61];return _0x5333e8;};'use strict';var Sequelize=require(_0xc46f('0x0'));module[_0xc46f('0x1')]={'closed':{'type':Sequelize[_0xc46f('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc46f('0x3')]},'disposition':{'type':Sequelize[_0xc46f('0x4')]},'secondDisposition':{'type':Sequelize[_0xc46f('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc46f('0x4')]},'note':{'type':Sequelize[_0xc46f('0x4')]},'read1stAt':{'type':Sequelize[_0xc46f('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xc46f('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc46f('0x5')]('in',_0xc46f('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc46f('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xc46f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index dd64225..79d71f4 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 _0x1ce2=['find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','contactName','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','ui.OpenchannelInteractionId\x20IN\x20?','all','show','params','OpenchannelInteraction','includeAll','include','merge','create','update','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','format','CmContact','firstName','lastName','Attachment','Messages','createdAt','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closedAt','disposition','threadId','Public','existsSync','pipe','createWriteStream','basename','direction','out','System','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','./openchannelInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','closed','UserId','total','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?'];(function(_0x40248c,_0x31bac7){var _0x2a4a3d=function(_0x299457){while(--_0x299457){_0x40248c['push'](_0x40248c['shift']());}};_0x2a4a3d(++_0x31bac7);}(_0x1ce2,0x86));var _0x21ce=function(_0x35ef4c,_0x561012){_0x35ef4c=_0x35ef4c-0x0;var _0x46998b=_0x1ce2[_0x35ef4c];return _0x46998b;};'use strict';var emlformat=require(_0x21ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x21ce('0x1'));var jsonpatch=require(_0x21ce('0x2'));var rp=require(_0x21ce('0x3'));var moment=require(_0x21ce('0x4'));var BPromise=require(_0x21ce('0x5'));var Mustache=require(_0x21ce('0x6'));var util=require('util');var path=require(_0x21ce('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x21ce('0x8'));var fs=require('fs');var fs_extra=require(_0x21ce('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x21ce('0xa'));var jsforce=require(_0x21ce('0xb'));var deskjs=require(_0x21ce('0xc'));var toCsv=require(_0x21ce('0xd'));var querystring=require(_0x21ce('0xe'));var Papa=require('papaparse');var Redis=require(_0x21ce('0xf'));var authService=require(_0x21ce('0x10'));var qs=require(_0x21ce('0x11'));var as=require(_0x21ce('0x12'));var pdf=require(_0x21ce('0x13'));var hardwareService=require(_0x21ce('0x14'));var logger=require(_0x21ce('0x15'))('api');var utils=require(_0x21ce('0x16'));var config=require(_0x21ce('0x17'));var licenseUtil=require(_0x21ce('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x21ce('0x19')](config[_0x21ce('0x1a')],{'host':_0x21ce('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21ce('0x1a')]));require(_0x21ce('0x1c'))[_0x21ce('0x1d')](socket);function respondWithStatusCode(_0x5482d7,_0x58bab1){_0x58bab1=_0x58bab1||0xcc;return function(_0x1da154){if(_0x1da154){return _0x5482d7[_0x21ce('0x1e')](_0x58bab1);}return _0x5482d7['status'](_0x58bab1)[_0x21ce('0x1f')]();};}function respondWithResult(_0x227ad8,_0x5c8efd){_0x5c8efd=_0x5c8efd||0xc8;return function(_0x167667){if(_0x167667){return _0x227ad8[_0x21ce('0x20')](_0x5c8efd)[_0x21ce('0x21')](_0x167667);}};}function respondWithFilteredResult(_0x74e3e1,_0x40c47f){return function(_0x38ab00){if(_0x38ab00){var _0x37c2a7=typeof _0x40c47f[_0x21ce('0x22')]===_0x21ce('0x23')&&typeof _0x40c47f[_0x21ce('0x24')]==='undefined';var _0x370a3f=_0x38ab00['count'];var _0x1917e5=_0x37c2a7?0x0:_0x40c47f['offset'];var _0x203874=_0x37c2a7?_0x38ab00[_0x21ce('0x25')]:_0x40c47f['offset']+_0x40c47f[_0x21ce('0x24')];var _0x2bda51;if(_0x203874>=_0x370a3f){_0x203874=_0x370a3f;_0x2bda51=0xc8;}else{_0x2bda51=0xce;}_0x74e3e1['status'](_0x2bda51);return _0x74e3e1[_0x21ce('0x26')](_0x21ce('0x27'),_0x1917e5+'-'+_0x203874+'/'+_0x370a3f)[_0x21ce('0x21')](_0x38ab00);}return null;};}function patchUpdates(_0x51dd6b){return function(_0x56856f){try{jsonpatch['apply'](_0x56856f,_0x51dd6b,!![]);}catch(_0x467b00){return BPromise['reject'](_0x467b00);}return _0x56856f[_0x21ce('0x28')]();};}function saveUpdates(_0x17bc38,_0x4d5006){return function(_0x1f076e){if(_0x1f076e){return _0x1f076e['update'](_0x17bc38)[_0x21ce('0x29')](function(_0x111b7b){return _0x111b7b;});}return null;};}function removeEntity(_0x5a0dae,_0x4c6382){return function(_0x59f818){if(_0x59f818){return _0x59f818[_0x21ce('0x2a')]()[_0x21ce('0x29')](function(){_0x5a0dae[_0x21ce('0x20')](0xcc)[_0x21ce('0x1f')]();});}};}function handleEntityNotFound(_0x26f6af,_0x1216f0){return function(_0x4a47a8){if(!_0x4a47a8){_0x26f6af['sendStatus'](0x194);}return _0x4a47a8;};}function handleError(_0x2de543,_0xb2d8eb){_0xb2d8eb=_0xb2d8eb||0x1f4;return function(_0x17fc88){logger['error'](_0x17fc88[_0x21ce('0x2b')]);if(_0x17fc88[_0x21ce('0x2c')]){delete _0x17fc88[_0x21ce('0x2c')];}_0x2de543[_0x21ce('0x20')](_0xb2d8eb)[_0x21ce('0x2d')](_0x17fc88);};}function getInteractionUsers(_0x436f3d,_0x58cf9a){return new BPromise(function(_0x17f877,_0x565909){try{if(_0x58cf9a[_0x436f3d['id']]){_0x436f3d[_0x21ce('0x2e')]=_[_0x21ce('0x2f')](_0x58cf9a[_0x436f3d['id']],function(_0x5d35c7){return{'id':_0x5d35c7['id'],'fullname':_0x5d35c7[_0x21ce('0x30')]};});}}catch(_0x246754){_0x565909(_0x246754);}_0x17f877(_0x436f3d);});}function getInteractionTags(_0xc8d0a6,_0x289224){return new BPromise(function(_0x147119,_0x1f0a37){try{if(_0xc8d0a6[_0x21ce('0x31')]){_0xc8d0a6[_0x21ce('0x32')]=[];_0xc8d0a6[_0x21ce('0x31')][_0x21ce('0x33')](',')[_0x21ce('0x34')](function(_0x4e574f){_0xc8d0a6[_0x21ce('0x32')][_0x21ce('0x35')](_0x289224[_0x4e574f]);});}delete _0xc8d0a6[_0x21ce('0x31')];}catch(_0x4e6312){_0x1f0a37(_0x4e6312);}_0x147119(_0xc8d0a6);});}function updateOpenchannelInteraction(_0x3ccaae,_0x2428d1,_0xa23cf9){return new BPromise(function(_0x2bcea9,_0xae1fd0){return getInteractionUsers(_0x3ccaae,_0xa23cf9)['then'](function(_0x258342){return getInteractionTags(_0x258342,_0x2428d1);})['then'](function(_0x34562a){return getStateInteraction(_0x34562a);})[_0x21ce('0x29')](function(_0x2ee0d0){_0x2bcea9(_0x2ee0d0);})[_0x21ce('0x36')](function(_0x4f8d95){_0xae1fd0(_0x4f8d95);});});}function getStateInteraction(_0x50e071){return new BPromise(function(_0x58ed18){_0x50e071[_0x21ce('0x37')]=0x0;_0x50e071[_0x21ce('0x38')]=0x0;_0x50e071[_0x21ce('0x39')]=0x0;_0x50e071[_0x21ce('0x3a')]=0x0;_0x50e071['total']=0x0;if(!_0x50e071[_0x21ce('0x3b')]&&!_0x50e071[_0x21ce('0x3c')]){_0x50e071[_0x21ce('0x37')]+=0x1;}if(!_0x50e071['closed']&&_0x50e071[_0x21ce('0x3c')]){_0x50e071[_0x21ce('0x38')]+=0x1;if(_0x50e071[_0x21ce('0x37')]){_0x50e071[_0x21ce('0x37')]-=0x1;}}if(_0x50e071[_0x21ce('0x3b')]&&_0x50e071[_0x21ce('0x3c')]){_0x50e071[_0x21ce('0x39')]+=0x1;if(_0x50e071[_0x21ce('0x38')]){_0x50e071[_0x21ce('0x38')]-=0x1;}}if(_0x50e071['closed']&&!_0x50e071[_0x21ce('0x3c')]){_0x50e071['unmanaged']+=0x1;if(_0x50e071[_0x21ce('0x37')]){_0x50e071[_0x21ce('0x37')]-=0x1;}}_0x50e071[_0x21ce('0x3d')]+=0x1;_0x58ed18(_0x50e071);});}exports[_0x21ce('0x3e')]=function(_0x283f12,_0x2b431e){var _0xeb88d8={},_0x521081={},_0x50a711={'count':0x0,'rows':[]};var _0x36d8ae=_['map'](db['OpenchannelInteraction'][_0x21ce('0x3f')],function(_0x2d29fe){return{'name':_0x2d29fe[_0x21ce('0x40')],'type':_0x2d29fe[_0x21ce('0x41')]['key']};});_0x521081['model']=_[_0x21ce('0x2f')](_0x36d8ae,_0x21ce('0x2c'));_0x521081[_0x21ce('0x42')]=_[_0x21ce('0x43')](_0x283f12['query']);_0x521081[_0x21ce('0x44')]=_[_0x21ce('0x45')](_0x521081[_0x21ce('0x46')],_0x521081['query']);_0xeb88d8[_0x21ce('0x47')]=_[_0x21ce('0x45')](_0x521081[_0x21ce('0x46')],qs[_0x21ce('0x48')](_0x283f12[_0x21ce('0x42')][_0x21ce('0x48')]));_0xeb88d8[_0x21ce('0x47')]=_0xeb88d8['attributes'][_0x21ce('0x49')]?_0xeb88d8[_0x21ce('0x47')]:_0x521081[_0x21ce('0x46')];if(!_0x283f12[_0x21ce('0x42')][_0x21ce('0x4a')](_0x21ce('0x4b'))){_0xeb88d8[_0x21ce('0x24')]=qs['limit'](_0x283f12[_0x21ce('0x42')][_0x21ce('0x24')]);_0xeb88d8[_0x21ce('0x22')]=qs[_0x21ce('0x22')](_0x283f12['query'][_0x21ce('0x22')]);}_0xeb88d8[_0x21ce('0x4c')]=qs[_0x21ce('0x4d')](_0x283f12[_0x21ce('0x42')][_0x21ce('0x4d')]);_0xeb88d8[_0x21ce('0x4e')]=qs[_0x21ce('0x44')](_[_0x21ce('0x4f')](_0x283f12[_0x21ce('0x42')],_0x521081['filters']),_0x36d8ae);var _0x386d57=[];var _0x1585a5=squel[_0x21ce('0x50')]()[_0x21ce('0x51')]('id')['field']('name')['field'](_0x21ce('0x52'))[_0x21ce('0x53')]('tools_tags');var _0x38e250=squel['select']()['field'](_0x21ce('0x54'))[_0x21ce('0x51')](_0x21ce('0x55'))[_0x21ce('0x51')](_0x21ce('0x56'))[_0x21ce('0x53')](_0x21ce('0x57'),'ui')[_0x21ce('0x58')]('users','u','u.id\x20=\x20ui.UserId');var _0x2f6b58=squel[_0x21ce('0x50')]()['from'](_0x21ce('0x59'),'i')['left_join'](_0x21ce('0x5a'),'c',_0x21ce('0x5b'))[_0x21ce('0x58')]('users','o',_0x21ce('0x5c'))[_0x21ce('0x58')](_0x21ce('0x5d'),'a',_0x21ce('0x5e'))[_0x21ce('0x58')]('openchannel_messages','me',_0x21ce('0x5f'))[_0x21ce('0x58')](_0x21ce('0x60'),'it',_0x21ce('0x61'))[_0x21ce('0x58')](_0x21ce('0x62'),'t','t.id\x20=\x20it.TagId');var _0x3c3820=squel[_0x21ce('0x63')]();var _0x4004cd=[];var _0x6a56c9=squel[_0x21ce('0x63')]();var _0x1309b6;if(_0x283f12['query']['search']){_0x1309b6=as['parseSearch'](_0x283f12[_0x21ce('0x42')][_0x21ce('0x64')]);var _0x855529=_0x1309b6[_0x21ce('0x65')];for(var _0x1adfda=0x0;_0x1adfda<_0x1309b6[_0x21ce('0x66')][_0x21ce('0x49')];_0x1adfda++){var _0x6990d1=_0x1309b6[_0x21ce('0x66')][_0x1adfda];var _0x5e7f3d='i';var _0x50c7f7=_['find'](_0x36d8ae,[_0x21ce('0x2c'),_0x6990d1[_0x21ce('0x51')]]);if(!_0x50c7f7){switch(_0x6990d1[_0x21ce('0x51')]){case'unreadMessages':if(_0x6990d1['value']==0x1){_0x2f6b58[_0x21ce('0x67')]('`'+_0x6990d1[_0x21ce('0x51')]+_0x21ce('0x68'));}else{_0x2f6b58[_0x21ce('0x67')]('`'+_0x6990d1['field']+_0x21ce('0x69'));}break;case _0x21ce('0x6a'):if(_0x6990d1[_0x21ce('0x6b')]===_0x21ce('0x6c')){if(_0x6990d1[_0x21ce('0x6d')][_0x21ce('0x33')]('\x20')[_0x21ce('0x49')]>0x1){_0x3c3820[_0x855529](_0x21ce('0x6e'),qs['getFullTextValue'](_0x6990d1[_0x21ce('0x6d')]),null);}else{var _0x5c4f04='%'+_0x6990d1[_0x21ce('0x6d')]+'%';_0x3c3820[_0x855529](_0x21ce('0x6f'),_0x5c4f04,_0x5c4f04,_0x5c4f04);}}else{_0x50c7f7=_[_0x21ce('0x70')](_0x36d8ae,[_0x21ce('0x2c'),_0x21ce('0x71')]);_0x6990d1['field']=_0x21ce('0x71');_0x5aa920=as[_0x21ce('0x72')](_0x5e7f3d,_0x50c7f7['type'],_0x6990d1);_0x3c3820[_0x855529](_0x5aa920[_0x21ce('0x73')],_0x5aa920[_0x21ce('0x6d')][_0x21ce('0x74')],_0x5aa920[_0x21ce('0x6d')]['end']);}break;case _0x21ce('0x75'):var _0x379553=_0x6990d1['value']['split'](',')['map'](function(_0x159fdb){return Number(_0x159fdb);});_0x379553[_0x21ce('0x34')](function(_0xe09096){_0x6a56c9['or'](_0x21ce('0x76'),'%,'+_0xe09096+',%');});_0x4004cd=_[_0x21ce('0x77')](_0x4004cd,_0x379553);break;case _0x21ce('0x78'):if(_0x6990d1['operator']===_0x21ce('0x6c')){_0x3c3820[_0x855529](_0x21ce('0x79'),'%'+_0x6990d1[_0x21ce('0x6d')]+'%',null);}else{_0x50c7f7=_[_0x21ce('0x70')](_0x36d8ae,[_0x21ce('0x2c'),_0x21ce('0x3c')]);_0x6990d1[_0x21ce('0x51')]='UserId';_0x5aa920=as[_0x21ce('0x72')](_0x5e7f3d,_0x50c7f7['type'],_0x6990d1);_0x3c3820[_0x855529](_0x5aa920['text'],_0x5aa920['value'][_0x21ce('0x74')],_0x5aa920[_0x21ce('0x6d')][_0x21ce('0x1f')]);}break;case _0x21ce('0x7a'):_0x5aa920=as['buildExpression']('me',null,_0x6990d1);_0x3c3820[_0x855529](_0x5aa920[_0x21ce('0x73')],_0x5aa920[_0x21ce('0x6d')]['start'],_0x5aa920[_0x21ce('0x6d')]['end']);break;}}else{var _0x5aa920=as[_0x21ce('0x72')](_0x5e7f3d,_0x50c7f7[_0x21ce('0x41')],_0x6990d1);_0x3c3820[_0x855529](_0x5aa920[_0x21ce('0x73')],_0x5aa920[_0x21ce('0x6d')]['start'],_0x5aa920[_0x21ce('0x6d')][_0x21ce('0x1f')]);}}}else{var _0x80a856=_(_0x283f12[_0x21ce('0x42')])[_0x21ce('0x43')]()[_0x21ce('0x2f')](function(_0x49ace8){return _[_0x21ce('0x7b')](_0x36d8ae,['name',_0x49ace8])?_0x49ace8:undefined;})[_0x21ce('0x7c')]()[_0x21ce('0x6d')]();if(!_[_0x21ce('0x7d')](_0x80a856)){_0x80a856[_0x21ce('0x34')](function(_0x3cc9cb){if(_0x3cc9cb==='OpenchannelAccountId'){_0x2f6b58[_0x21ce('0x4e')](_0x21ce('0x7e'),[][_0x21ce('0x7f')](_0x283f12['query'][_0x3cc9cb]));}else if(_0x3cc9cb==='createdAt'){var _0x150c5f=JSON[_0x21ce('0x80')](_0x283f12[_0x21ce('0x42')][_0x3cc9cb])[_0x21ce('0x81')];var _0x1346d5=JSON[_0x21ce('0x80')](_0x283f12[_0x21ce('0x42')][_0x3cc9cb])['$lte'];_0x2f6b58[_0x21ce('0x4e')](_0x21ce('0x82'),_0x150c5f,_0x1346d5);}else{if(_0x283f12['query'][_0x3cc9cb]===_0x21ce('0x83')){_0x2f6b58['where']('i.'+_0x3cc9cb+_0x21ce('0x84'));}else{_0x2f6b58['where']('i.'+_0x3cc9cb+_0x21ce('0x85'),_0x283f12[_0x21ce('0x42')][_0x3cc9cb]);}}});}if(_0x283f12[_0x21ce('0x42')][_0x21ce('0x86')]){if(_0x283f12[_0x21ce('0x42')][_0x21ce('0x86')]==0x1){_0x2f6b58[_0x21ce('0x67')]('`unreadMessages`\x20=\x200');}else{_0x2f6b58[_0x21ce('0x67')](_0x21ce('0x87'));}}if(_0x283f12[_0x21ce('0x42')][_0x21ce('0x88')]){_0x4004cd=_[_0x21ce('0x89')](_0x283f12[_0x21ce('0x42')]['tag'])?_0x283f12['query'][_0x21ce('0x88')]:new Array(_0x283f12['query'][_0x21ce('0x88')]);_0x4004cd[_0x21ce('0x34')](function(_0x4008d3){_0x6a56c9['or'](_0x21ce('0x76'),'%,'+_0x4008d3+',%');});}if(_0x283f12[_0x21ce('0x42')][_0x21ce('0x8a')]){var _0x298079=_0x283f12[_0x21ce('0x42')][_0x21ce('0x8a')][_0x21ce('0x8b')]('\x5c','\x5c\x5c')[_0x21ce('0x8b')](/'/g,'\x27\x27');if(qs[_0x21ce('0x8c')](_0x298079)){_0x3c3820['or'](_0x21ce('0x8d'),_0x298079+'%');}else{_0x3c3820['or'](_0x21ce('0x8e'),qs[_0x21ce('0x8f')](_0x298079))['or'](_0x21ce('0x90'),_0x298079+'%')['or'](_0x21ce('0x91'),_0x298079+'%');}}}_0x2f6b58[_0x21ce('0x4e')](_0x3c3820);_0x2f6b58[_0x21ce('0x92')](_0x21ce('0x93'));var _0x49334a={'type':db[_0x21ce('0x94')][_0x21ce('0x95')]['SELECT'],'raw':!![]};var _0x4a79e1=_0x2f6b58[_0x21ce('0x96')]();_0x4a79e1[_0x21ce('0x51')](_0x21ce('0x93'));_0x4a79e1[_0x21ce('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0xeb88d8[_0x21ce('0x4c')]){_0xeb88d8[_0x21ce('0x4c')]['forEach'](function(_0xb62e5e){var _0x57eb45=_0xb62e5e[0x0]===_0x21ce('0x97')?_0xb62e5e[0x0]:'i.'+_0xb62e5e[0x0];_0x2f6b58['order'](_0x57eb45,_0xb62e5e[0x1]==='DESC'?![]:!![]);});}if(!_[_0x21ce('0x7d')](_0x4004cd)){_0x2f6b58['having'](_0x6a56c9);_0x4a79e1[_0x21ce('0x4e')](_0x21ce('0x98'),_0x4004cd);}BPromise[_0x21ce('0x99')]()[_0x21ce('0x29')](function(){if(!_0x1309b6){if(_0x283f12[_0x21ce('0x42')][_0x21ce('0x9a')])return;_0x4a79e1[_0x21ce('0x4e')](_0x21ce('0x9b'));_0x2f6b58['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x283f12[_0x21ce('0x9c')][_0x21ce('0x9d')]!==_0x21ce('0x9e'))return;return _0x283f12[_0x21ce('0x9c')][_0x21ce('0x9f')]({'attributes':['id'],'raw':!![]})[_0x21ce('0x29')](function(_0x1325c1){if(_[_0x21ce('0x7d')](_0x1325c1)){_0x4a79e1[_0x21ce('0x4e')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x2f6b58[_0x21ce('0x4e')](_0x21ce('0xa0'));}else{_0x4a79e1[_0x21ce('0x4e')](_0x21ce('0x7e'),_[_0x21ce('0x2f')](_0x1325c1,'id'));_0x2f6b58[_0x21ce('0x4e')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x21ce('0x2f')](_0x1325c1,'id'));}});})[_0x21ce('0x29')](function(){if(_0x283f12[_0x21ce('0x9c')][_0x21ce('0x9d')]===_0x21ce('0x9e')&&!_0x1309b6&&!_0x283f12[_0x21ce('0x42')][_0x21ce('0x9a')])return[];return db[_0x21ce('0xa1')][_0x21ce('0x42')](_0x4a79e1[_0x21ce('0xa2')](),_0x49334a);})['then'](function(_0x41d712){_0x50a711[_0x21ce('0x25')]=_0x41d712[_0x21ce('0x49')];if(_0x50a711['count']===0x0)return[];return db[_0x21ce('0xa1')][_0x21ce('0x42')](_0x1585a5['toString'](),_0x49334a)[_0x21ce('0x29')](function(_0x383fb2){_0x386d57=_[_0x21ce('0xa3')](_0x383fb2,'id');_0x49334a=_['merge'](_0x49334a,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x283f12[_0x21ce('0x42')][_0x21ce('0x48')]){_0xeb88d8['attributes'][_0x21ce('0x34')](function(_0x339236){_0x2f6b58[_0x21ce('0x51')]('i.'+_0x339236);});}else{_0x2f6b58[_0x21ce('0x51')](_0x21ce('0xa4'),_0x21ce('0xa5'));_0x2f6b58['field'](_0x21ce('0xa6'),_0x21ce('0xa7'));_0x2f6b58[_0x21ce('0x51')](_0x21ce('0xa8'),'Account.mandatoryDisposition');_0x2f6b58[_0x21ce('0x51')]('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',_0x21ce('0x97'));_0x2f6b58['field'](_0x21ce('0xa9'));_0x2f6b58[_0x21ce('0x51')](_0x21ce('0xaa'),_0x21ce('0xab'));_0x2f6b58[_0x21ce('0x51')]('c.lastName','Contact.lastName');_0x2f6b58[_0x21ce('0x51')](_0x21ce('0xac'),_0x21ce('0xad'));_0x2f6b58['field']('c.phone',_0x21ce('0xae'));_0x2f6b58[_0x21ce('0x51')](_0x21ce('0xaf'),_0x21ce('0xb0'));_0x2f6b58[_0x21ce('0x51')](_0x21ce('0xb1'),_0x21ce('0xb2'));_0x2f6b58[_0x21ce('0x51')](_0x21ce('0xb3'),_0x21ce('0xb4'));_0x2f6b58['field']('o.internal','Owner.internal');_0x2f6b58[_0x21ce('0x51')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x21ce('0x31'));}if(_0xeb88d8[_0x21ce('0x24')])_0x2f6b58['limit'](_0xeb88d8[_0x21ce('0x24')]);if(_0xeb88d8[_0x21ce('0x22')])_0x2f6b58[_0x21ce('0x22')](_0xeb88d8[_0x21ce('0x22')]);return db[_0x21ce('0xa1')][_0x21ce('0x42')](_0x2f6b58[_0x21ce('0xa2')](),_0x49334a);})['then'](function(_0x377bd8){if(_0x377bd8['length']>0x0)_0x38e250[_0x21ce('0x4e')](_0x21ce('0xb5'),_[_0x21ce('0x2f')](_0x377bd8,'id'));return db['sequelize'][_0x21ce('0x42')](_0x38e250[_0x21ce('0xa2')](),_0x49334a)[_0x21ce('0x29')](function(_0x1cfa15){var _0x442b97=_['groupBy'](_0x1cfa15,'OpenchannelInteractionId');var _0x52ce10=[];_0x377bd8[_0x21ce('0x34')](function(_0x17edf0){_0x52ce10[_0x21ce('0x35')](updateOpenchannelInteraction(_0x17edf0,_0x386d57,_0x442b97));});return BPromise[_0x21ce('0xb6')](_0x52ce10);});});})[_0x21ce('0x29')](function(_0x1e106b){_0x50a711['rows']=_0x1e106b;return _0x50a711;})['then'](respondWithFilteredResult(_0x2b431e,_0xeb88d8))['catch'](handleError(_0x2b431e,null));};exports[_0x21ce('0xb7')]=function(_0x1f2234,_0x2e08ae){var _0x73dabd={};if(_0x1f2234[_0x21ce('0x42')][_0x21ce('0x41')]&&_0x1f2234[_0x21ce('0x42')][_0x21ce('0x41')]===_0x21ce('0x53')){_0x73dabd[_0x21ce('0x53')]=_0x1f2234['params']['id'];}else{_0x73dabd['id']=_0x1f2234[_0x21ce('0xb8')]['id'];}var _0x5c36e6={'raw':![],'where':_0x73dabd},_0x32175e={};_0x32175e[_0x21ce('0x46')]=_[_0x21ce('0x43')](db[_0x21ce('0xb9')][_0x21ce('0x3f')]);_0x32175e[_0x21ce('0x42')]=_[_0x21ce('0x43')](_0x1f2234[_0x21ce('0x42')]);_0x32175e[_0x21ce('0x44')]=_['intersection'](_0x32175e[_0x21ce('0x46')],_0x32175e[_0x21ce('0x42')]);_0x5c36e6[_0x21ce('0x47')]=_[_0x21ce('0x45')](_0x32175e['model'],qs[_0x21ce('0x48')](_0x1f2234[_0x21ce('0x42')]['fields']));_0x5c36e6[_0x21ce('0x47')]=_0x5c36e6['attributes']['length']?_0x5c36e6[_0x21ce('0x47')]:_0x32175e[_0x21ce('0x46')];if(_0x1f2234[_0x21ce('0x42')][_0x21ce('0xba')]){_0x5c36e6[_0x21ce('0xbb')]=[{'all':!![]}];}_0x5c36e6=_[_0x21ce('0xbc')]({},_0x5c36e6,_0x1f2234['options']);return db[_0x21ce('0xb9')]['find'](_0x5c36e6)[_0x21ce('0x29')](handleEntityNotFound(_0x2e08ae,null))[_0x21ce('0x29')](respondWithResult(_0x2e08ae,null))[_0x21ce('0x36')](handleError(_0x2e08ae,null));};exports[_0x21ce('0xbd')]=function(_0x31f307,_0x30bf30){return db['OpenchannelInteraction'][_0x21ce('0xbd')](_0x31f307[_0x21ce('0x7a')],{})[_0x21ce('0x29')](respondWithResult(_0x30bf30,0xc9))[_0x21ce('0x36')](handleError(_0x30bf30,null));};exports[_0x21ce('0xbe')]=function(_0x4a1c39,_0x603310){if(_0x4a1c39[_0x21ce('0x7a')]['id']){delete _0x4a1c39[_0x21ce('0x7a')]['id'];}return db[_0x21ce('0xb9')][_0x21ce('0x70')]({'where':{'id':_0x4a1c39[_0x21ce('0xb8')]['id']}})['then'](handleEntityNotFound(_0x603310,null))[_0x21ce('0x29')](saveUpdates(_0x4a1c39[_0x21ce('0x7a')],null))[_0x21ce('0x29')](respondWithResult(_0x603310,null))[_0x21ce('0x36')](handleError(_0x603310,null));};exports[_0x21ce('0x2a')]=function(_0x6410be,_0x5b63b8){return db['OpenchannelInteraction'][_0x21ce('0x70')]({'where':{'id':_0x6410be[_0x21ce('0xb8')]['id']}})[_0x21ce('0x29')](handleEntityNotFound(_0x5b63b8,null))['then'](removeEntity(_0x5b63b8,null))['catch'](handleError(_0x5b63b8,null));};exports[_0x21ce('0xbf')]=function(_0x594b49,_0x1f12ab){return db[_0x21ce('0xb9')][_0x21ce('0xbf')]()[_0x21ce('0x29')](respondWithResult(_0x1f12ab,null))[_0x21ce('0x36')](handleError(_0x1f12ab,null));};exports[_0x21ce('0xc0')]=function(_0x22dc74,_0x33b112,_0x19a6d4){return db[_0x21ce('0xc1')]['find']({'where':{'id':_0x22dc74['params']['id']}})[_0x21ce('0x29')](handleEntityNotFound(_0x33b112,null))[_0x21ce('0x29')](function(_0x23742b){if(_0x23742b){return _0x23742b[_0x21ce('0xc0')](_0x22dc74[_0x21ce('0x7a')][_0x21ce('0xc2')],_[_0x21ce('0xc3')](_0x22dc74[_0x21ce('0x7a')],['ids','id'])||{});}})['then'](respondWithResult(_0x33b112,null))['catch'](handleError(_0x33b112,null));};exports[_0x21ce('0xc4')]=function(_0x36eeef,_0x7eda9c,_0x490398){var _0x530955={'raw':![],'where':{}};var _0x25385b={};var _0x24a8ea={'count':0x0,'rows':[]};return db[_0x21ce('0xb9')][_0x21ce('0xc5')]({'where':{'id':_0x36eeef[_0x21ce('0xb8')]['id']}})[_0x21ce('0x29')](handleEntityNotFound(_0x7eda9c,null))[_0x21ce('0x29')](function(_0x62d86e){if(_0x62d86e){_0x25385b[_0x21ce('0x46')]=_[_0x21ce('0x43')](db['OpenchannelMessage'][_0x21ce('0x3f')]);_0x25385b['query']=_[_0x21ce('0x43')](_0x36eeef[_0x21ce('0x42')]);_0x25385b[_0x21ce('0x44')]=_[_0x21ce('0x45')](_0x25385b['model'],_0x25385b[_0x21ce('0x42')]);_0x530955['attributes']=_['intersection'](_0x25385b[_0x21ce('0x46')],qs['fields'](_0x36eeef[_0x21ce('0x42')][_0x21ce('0x48')]));_0x530955[_0x21ce('0x47')]=_0x530955[_0x21ce('0x47')]['length']?_0x530955[_0x21ce('0x47')]:_0x25385b['model'];if(!_0x36eeef[_0x21ce('0x42')][_0x21ce('0x4a')](_0x21ce('0x4b'))){_0x530955[_0x21ce('0x24')]=qs[_0x21ce('0x24')](_0x36eeef['query'][_0x21ce('0x24')]);_0x530955['offset']=qs[_0x21ce('0x22')](_0x36eeef[_0x21ce('0x42')]['offset']);}_0x530955[_0x21ce('0x4c')]=qs[_0x21ce('0x4d')](_0x36eeef[_0x21ce('0x42')]['sort']);_0x530955[_0x21ce('0x4e')]=qs[_0x21ce('0x44')](_[_0x21ce('0x4f')](_0x36eeef[_0x21ce('0x42')],_0x25385b[_0x21ce('0x44')]));_0x530955['where']['OpenchannelInteractionId']=_0x62d86e['id'];if(_0x36eeef[_0x21ce('0x42')]['filter']){_0x530955['where']=_[_0x21ce('0xbc')](_0x530955[_0x21ce('0x4e')],{'$or':_[_0x21ce('0x2f')](_0x530955['attributes'],function(_0x514258){var _0x1254b8={};_0x1254b8[_0x514258]={'$like':'%'+_0x36eeef[_0x21ce('0x42')][_0x21ce('0x8a')]+'%'};return _0x1254b8;})});}if(_0x36eeef[_0x21ce('0x42')][_0x21ce('0x81')]){var _0x376cd9=_0x36eeef['query'][_0x21ce('0x81')]['split'](',');var _0x3f3093={};_0x3f3093[_0x376cd9[0x0]]={'$gte':moment(_0x376cd9[0x1])['format'](_0x21ce('0xc6'))};_0x530955[_0x21ce('0x4e')]=_[_0x21ce('0xbc')](_0x530955[_0x21ce('0x4e')],_0x3f3093);}_0x530955=_[_0x21ce('0xbc')]({},_0x530955,_0x36eeef[_0x21ce('0xc7')]);return db[_0x21ce('0xc1')][_0x21ce('0x25')]({'where':_0x530955[_0x21ce('0x4e')]})[_0x21ce('0x29')](function(_0x2ae5d5){_0x24a8ea['count']=_0x2ae5d5;if(_0x36eeef[_0x21ce('0x42')][_0x21ce('0xba')]){_0x530955['include']=[{'all':!![]}];}return db[_0x21ce('0xc1')][_0x21ce('0xc8')](_0x530955);})[_0x21ce('0x29')](function(_0x364ac5){_0x24a8ea['rows']=_0x364ac5;return _0x24a8ea;});}})[_0x21ce('0x29')](respondWithFilteredResult(_0x7eda9c,_0x530955))[_0x21ce('0x36')](handleError(_0x7eda9c,null));};exports[_0x21ce('0xc9')]=function(_0x561a2f,_0x37cd16,_0x602a35){return db[_0x21ce('0xb9')][_0x21ce('0x70')]({'where':{'id':_0x561a2f['params']['id']}})[_0x21ce('0x29')](handleEntityNotFound(_0x37cd16,null))['then'](function(_0x5b934d){if(_0x5b934d){return _0x5b934d[_0x21ce('0xca')](_0x561a2f[_0x21ce('0x7a')][_0x21ce('0xc2')],_['omit'](_0x561a2f['body'],[_0x21ce('0xc2'),'id'])||{})['spread'](function(){return db[_0x21ce('0x75')]['findAll']({'attributes':['id',_0x21ce('0x2c'),_0x21ce('0x52')],'where':{'id':_0x561a2f[_0x21ce('0x7a')][_0x21ce('0xc2')]}});})[_0x21ce('0x29')](function(_0xfb772){socket[_0x21ce('0xcb')]('openchannelInteractionTags:save',{'id':Number(_0x561a2f[_0x21ce('0xb8')]['id']),'tags':_0xfb772||[]});return{'id':Number(_0x561a2f[_0x21ce('0xb8')]['id']),'tags':_0xfb772||[]};});}})[_0x21ce('0x29')](respondWithResult(_0x37cd16,null))[_0x21ce('0x36')](handleError(_0x37cd16,null));};exports[_0x21ce('0xcc')]=function(_0x2d772b,_0x154872,_0x195efb){return db[_0x21ce('0xb9')][_0x21ce('0x70')]({'where':{'id':_0x2d772b['params']['id']}})['then'](handleEntityNotFound(_0x154872,null))[_0x21ce('0x29')](function(_0x389ecd){if(_0x389ecd){return _0x389ecd[_0x21ce('0xcc')](_0x2d772b['query']['ids']);}})[_0x21ce('0x29')](respondWithStatusCode(_0x154872,null))[_0x21ce('0x36')](handleError(_0x154872,null));};exports[_0x21ce('0xcd')]=function(_0xacfe58,_0x5a8df0){var _0x1f595c=moment()[_0x21ce('0xce')]()[_0x21ce('0xa2')]();var _0x3a53fe=path['join'](config[_0x21ce('0xcf')],_0x21ce('0xd0'),_0x21ce('0xd1'),_0x21ce('0xd2'));var _0x2113b9=path[_0x21ce('0xd3')](config[_0x21ce('0xcf')],'server',_0x21ce('0xd1'),_0x21ce('0xd4'));var _0x3da850=path['join'](_0x3a53fe,_0x1f595c);var _0x1a80bd=util[_0x21ce('0xd5')]('transcript-%d-%s.zip',_0xacfe58[_0x21ce('0xb8')]['id'],_0x1f595c);var _0xb4fca5=path['join'](_0x3a53fe,_0x1a80bd);var _0x2ac9ab=[];_0x2ac9ab[_0x21ce('0x35')]({'model':db['User'],'as':_0x21ce('0x78'),'attributes':['id','fullname'],'raw':!![]});_0x2ac9ab[_0x21ce('0x35')]({'model':db[_0x21ce('0xd6')],'as':_0x21ce('0x6a'),'attributes':['id',_0x21ce('0xd7'),_0x21ce('0xd8')],'raw':!![]});if(_0xacfe58[_0x21ce('0x42')][_0x21ce('0xd4')]){_0x2ac9ab[_0x21ce('0x35')]({'model':db['Attachment'],'as':_0x21ce('0xd9'),'raw':!![]});}var _0x18258c=[{'model':db['OpenchannelMessage'],'as':_0x21ce('0xda'),'attributes':['id',_0x21ce('0x7a'),_0x21ce('0xdb'),'direction',_0x21ce('0xdc'),_0x21ce('0x86')],'include':_0x2ac9ab}];_0x18258c[_0x21ce('0x35')]({'model':db[_0x21ce('0xdd')],'as':_0x21ce('0xde'),'attributes':['id',_0x21ce('0x2c')]});_0x18258c[_0x21ce('0x35')]({'model':db['User'],'as':_0x21ce('0xdf'),'attributes':['id','fullname']});return db[_0x21ce('0xb9')][_0x21ce('0x70')]({'where':{'id':_0xacfe58[_0x21ce('0xb8')]['id']},'include':_0x18258c})['then'](handleEntityNotFound(_0x5a8df0,null))['then'](function(_0x1d5bfc){if(_0x1d5bfc){var _0x11cf3e=_0x1d5bfc[_0x21ce('0xe0')]({'plain':!![]});fs[_0x21ce('0xe1')](_0x3da850);var _0x2c2c39={'channel':_0x21ce('0xe2'),'account':_0x11cf3e[_0x21ce('0xde')]['name'],'agent':_0x11cf3e[_0x21ce('0xdf')]?_0x11cf3e[_0x21ce('0xdf')][_0x21ce('0x30')]:_0x21ce('0xe3'),'createdAt':moment(_0x11cf3e[_0x21ce('0xdb')])[_0x21ce('0xd5')](_0x21ce('0xc6'))[_0x21ce('0xa2')](),'closedAt':_0x11cf3e['closed']?moment(_0x11cf3e[_0x21ce('0xe4')])[_0x21ce('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x21ce('0xa2')]():'','disposition':_0x11cf3e[_0x21ce('0xe5')],'visibility':_0x11cf3e[_0x21ce('0xe6')]?_0x21ce('0xe7'):'Private','messages':_(_0x11cf3e[_0x21ce('0xda')])['filter']({'secret':![]})[_0x21ce('0x2f')](function(_0xbaed9a){if(_0xbaed9a[_0x21ce('0xd9')]){var _0x4f5cc4=path[_0x21ce('0xd3')](_0x2113b9,_0xbaed9a['Attachment']['basename']);if(fs[_0x21ce('0xe8')](_0x4f5cc4)){fs['createReadStream'](_0x4f5cc4)[_0x21ce('0xe9')](fs[_0x21ce('0xea')](path['join'](_0x3da850,_0xbaed9a[_0x21ce('0xd9')][_0x21ce('0xeb')])));}}return{'date':moment(_0xbaed9a[_0x21ce('0xdb')])[_0x21ce('0xd5')]('YYYY-MM-DD\x20HH:mm:ss')[_0x21ce('0xa2')](),'sender':_0xbaed9a[_0x21ce('0xec')]===_0x21ce('0xed')?_0xbaed9a['User']?_0xbaed9a[_0x21ce('0x78')][_0x21ce('0x30')]:_0x21ce('0xee'):_0xbaed9a[_0x21ce('0x6a')]['firstName']+(_0xbaed9a[_0x21ce('0x6a')][_0x21ce('0xd8')]?'\x20'+_0xbaed9a[_0x21ce('0x6a')][_0x21ce('0xd8')]:''),'body':_0xbaed9a[_0x21ce('0xd9')]?_0xbaed9a['Attachment'][_0x21ce('0xeb')]:_0xbaed9a[_0x21ce('0x7a')],'direction':_0xbaed9a[_0x21ce('0xec')]===_0x21ce('0xed')?'A':'C','secret':_0xbaed9a[_0x21ce('0xdc')],'read':_0xbaed9a[_0x21ce('0x86')],'attachment':_0xbaed9a[_0x21ce('0xd9')]};})['value']()};return ejs['renderFile'](path[_0x21ce('0xd3')](config[_0x21ce('0xcf')],_0x21ce('0xd0'),_0x21ce('0xef'),'downloadInteraction.ejs'),{'interaction':_0x2c2c39})[_0x21ce('0x29')](function(_0xe7d554){var _0x18879a=path['join'](_0x3da850,_0x21ce('0xf0')+_0x11cf3e['id']+'-'+_0x1f595c+_0x21ce('0xf1'));var _0x4dbb48={'path':_0x18879a,'channel':'Openchannel','interactionId':_0x11cf3e['id']};return pdf[_0x21ce('0xf2')](_0xe7d554,_0x4dbb48);})[_0x21ce('0x29')](function(){return new BPromise(function(_0xfc063f,_0x535bfe){zipdir(_0x3da850,{'saveTo':_0xb4fca5},function(_0x3e6536,_0xe69883){if(_0x3e6536)return _0x535bfe(_0x3e6536);return _0xfc063f(_0xe69883);});})['then'](function(){return new BPromise(function(_0x5e55ce,_0x10f53c){rimraf(_0x3da850,function(_0x4124b6){if(_0x4124b6)_0x10f53c(_0x4124b6);return _0x5e55ce();});});})[_0x21ce('0x29')](function(){return _0x5a8df0['download'](_0xb4fca5,_0x1a80bd,function(_0x2ee9d4){if(_0x2ee9d4){console[_0x21ce('0xf3')](_0x21ce('0xf4'),_0x2ee9d4);}else{fs[_0x21ce('0xf5')](_0xb4fca5);}});});});}else{return _0x5a8df0[_0x21ce('0x1e')](0xc8);}})['catch'](handleError(_0x5a8df0,null));}; \ No newline at end of file +var _0xeb4c=['Tags','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','OpenchannelInteraction','fieldName','key','model','name','keys','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','select','field','from','tools_tags','u.id','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','length','having','`\x20=\x200','operator','$substring','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','isEmpty','where','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','i.OpenchannelAccountId\x20IS\x20NULL','role','OpenchannelAccountId','sequelize','toString','keyBy','merge','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','contactName','i.*','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','show','includeAll','include','options','create','params','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','rawAttributes','hasOwnProperty','OpenchannelInteractionId','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','findAll','emit','removeTags','unix','join','root','server','tmp','files','transcript-%d-%s.zip','Contact','firstName','lastName','Attachment','Messages','direction','secret','Owner','get','mkdirSync','Account','format','closedAt','disposition','threadId','Public','Private','basename','existsSync','pipe','createWriteStream','createdAt','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','send','Users','map','fullname'];(function(_0x571f94,_0x15403a){var _0x184a8f=function(_0xc99b5b){while(--_0xc99b5b){_0x571f94['push'](_0x571f94['shift']());}};_0x184a8f(++_0x15403a);}(_0xeb4c,0x1ac));var _0xceb4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xeb4c[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xceb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xceb4('0x1'));var jsonpatch=require(_0xceb4('0x2'));var rp=require(_0xceb4('0x3'));var moment=require(_0xceb4('0x4'));var BPromise=require(_0xceb4('0x5'));var Mustache=require(_0xceb4('0x6'));var util=require(_0xceb4('0x7'));var path=require(_0xceb4('0x8'));var sox=require(_0xceb4('0x9'));var csv=require(_0xceb4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xceb4('0xb'));var _=require(_0xceb4('0xc'));var squel=require(_0xceb4('0xd'));var crypto=require(_0xceb4('0xe'));var jsforce=require(_0xceb4('0xf'));var deskjs=require(_0xceb4('0x10'));var toCsv=require(_0xceb4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xceb4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xceb4('0x12'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xceb4('0x13'));var hardwareService=require(_0xceb4('0x14'));var logger=require(_0xceb4('0x15'))(_0xceb4('0x16'));var utils=require(_0xceb4('0x17'));var config=require(_0xceb4('0x18'));var licenseUtil=require(_0xceb4('0x19'));var db=require(_0xceb4('0x1a'))['db'];config['redis']=_[_0xceb4('0x1b')](config[_0xceb4('0x1c')],{'host':_0xceb4('0x1d'),'port':0x18eb});var socket=require(_0xceb4('0x1e'))(new Redis(config['redis']));require(_0xceb4('0x1f'))['register'](socket);function respondWithStatusCode(_0x3ed662,_0x53a5d4){_0x53a5d4=_0x53a5d4||0xcc;return function(_0xe9dcad){if(_0xe9dcad){return _0x3ed662['sendStatus'](_0x53a5d4);}return _0x3ed662[_0xceb4('0x20')](_0x53a5d4)[_0xceb4('0x21')]();};}function respondWithResult(_0x33b524,_0x4f3a30){_0x4f3a30=_0x4f3a30||0xc8;return function(_0x3b2405){if(_0x3b2405){return _0x33b524[_0xceb4('0x20')](_0x4f3a30)['json'](_0x3b2405);}};}function respondWithFilteredResult(_0x419d01,_0x31003f){return function(_0x4b46e2){if(_0x4b46e2){var _0x5379d7=typeof _0x31003f['offset']===_0xceb4('0x22')&&typeof _0x31003f['limit']===_0xceb4('0x22');var _0xd72c94=_0x4b46e2[_0xceb4('0x23')];var _0x15b000=_0x5379d7?0x0:_0x31003f['offset'];var _0x20f903=_0x5379d7?_0x4b46e2[_0xceb4('0x23')]:_0x31003f[_0xceb4('0x24')]+_0x31003f[_0xceb4('0x25')];var _0x16817e;if(_0x20f903>=_0xd72c94){_0x20f903=_0xd72c94;_0x16817e=0xc8;}else{_0x16817e=0xce;}_0x419d01['status'](_0x16817e);return _0x419d01[_0xceb4('0x26')](_0xceb4('0x27'),_0x15b000+'-'+_0x20f903+'/'+_0xd72c94)[_0xceb4('0x28')](_0x4b46e2);}return null;};}function patchUpdates(_0x472bb5){return function(_0x8876f2){try{jsonpatch[_0xceb4('0x29')](_0x8876f2,_0x472bb5,!![]);}catch(_0x353496){return BPromise[_0xceb4('0x2a')](_0x353496);}return _0x8876f2[_0xceb4('0x2b')]();};}function saveUpdates(_0x510dc5,_0x449bff){return function(_0x3147b4){if(_0x3147b4){return _0x3147b4[_0xceb4('0x2c')](_0x510dc5)['then'](function(_0x4abaf7){return _0x4abaf7;});}return null;};}function removeEntity(_0x3828e3,_0x5b2310){return function(_0x4754e1){if(_0x4754e1){return _0x4754e1[_0xceb4('0x2d')]()[_0xceb4('0x2e')](function(){_0x3828e3[_0xceb4('0x20')](0xcc)[_0xceb4('0x21')]();});}};}function handleEntityNotFound(_0x240132,_0x483289){return function(_0x15701f){if(!_0x15701f){_0x240132[_0xceb4('0x2f')](0x194);}return _0x15701f;};}function handleError(_0x2b2b45,_0x4934ef){_0x4934ef=_0x4934ef||0x1f4;return function(_0xf58c84){logger[_0xceb4('0x30')](_0xf58c84[_0xceb4('0x31')]);if(_0xf58c84['name']){delete _0xf58c84['name'];}_0x2b2b45['status'](_0x4934ef)[_0xceb4('0x32')](_0xf58c84);};}function getInteractionUsers(_0x239de3,_0x39678e){return new BPromise(function(_0x1a38cd,_0x397bd3){try{if(_0x39678e[_0x239de3['id']]){_0x239de3[_0xceb4('0x33')]=_[_0xceb4('0x34')](_0x39678e[_0x239de3['id']],function(_0x2f0323){return{'id':_0x2f0323['id'],'fullname':_0x2f0323[_0xceb4('0x35')]};});}}catch(_0x2cca13){_0x397bd3(_0x2cca13);}_0x1a38cd(_0x239de3);});}function getInteractionTags(_0x3e7861,_0x4bacc2){return new BPromise(function(_0x305bdd,_0x2a4246){try{if(_0x3e7861['TagIds']){_0x3e7861[_0xceb4('0x36')]=[];_0x3e7861[_0xceb4('0x37')][_0xceb4('0x38')](',')[_0xceb4('0x39')](function(_0x17ddc3){_0x3e7861[_0xceb4('0x36')][_0xceb4('0x3a')](_0x4bacc2[_0x17ddc3]);});}delete _0x3e7861[_0xceb4('0x37')];}catch(_0x7e9d94){_0x2a4246(_0x7e9d94);}_0x305bdd(_0x3e7861);});}function updateOpenchannelInteraction(_0x3445d0,_0xa121b8,_0x1aa609){return new BPromise(function(_0x3f6d96,_0x2a02d9){return getInteractionUsers(_0x3445d0,_0x1aa609)['then'](function(_0x54c62b){return getInteractionTags(_0x54c62b,_0xa121b8);})['then'](function(_0x3a1c64){return getStateInteraction(_0x3a1c64);})[_0xceb4('0x2e')](function(_0x178900){_0x3f6d96(_0x178900);})[_0xceb4('0x3b')](function(_0x3901cd){_0x2a02d9(_0x3901cd);});});}function getStateInteraction(_0x3f9beb){return new BPromise(function(_0x3c27fa){_0x3f9beb[_0xceb4('0x3c')]=0x0;_0x3f9beb[_0xceb4('0x3d')]=0x0;_0x3f9beb[_0xceb4('0x3e')]=0x0;_0x3f9beb[_0xceb4('0x3f')]=0x0;_0x3f9beb[_0xceb4('0x40')]=0x0;if(!_0x3f9beb[_0xceb4('0x41')]&&!_0x3f9beb[_0xceb4('0x42')]){_0x3f9beb[_0xceb4('0x3c')]+=0x1;}if(!_0x3f9beb['closed']&&_0x3f9beb[_0xceb4('0x42')]){_0x3f9beb[_0xceb4('0x3d')]+=0x1;if(_0x3f9beb[_0xceb4('0x3c')]){_0x3f9beb[_0xceb4('0x3c')]-=0x1;}}if(_0x3f9beb['closed']&&_0x3f9beb[_0xceb4('0x42')]){_0x3f9beb[_0xceb4('0x3e')]+=0x1;if(_0x3f9beb[_0xceb4('0x3d')]){_0x3f9beb[_0xceb4('0x3d')]-=0x1;}}if(_0x3f9beb['closed']&&!_0x3f9beb['UserId']){_0x3f9beb[_0xceb4('0x3f')]+=0x1;if(_0x3f9beb[_0xceb4('0x3c')]){_0x3f9beb['waiting']-=0x1;}}_0x3f9beb[_0xceb4('0x40')]+=0x1;_0x3c27fa(_0x3f9beb);});}exports['index']=function(_0x255ad7,_0x47a244){var _0x30335e={},_0x37d4c1={},_0x3e3cb7={'count':0x0,'rows':[]};var _0x5b99bc=_[_0xceb4('0x34')](db[_0xceb4('0x43')]['rawAttributes'],function(_0x41bd29){return{'name':_0x41bd29[_0xceb4('0x44')],'type':_0x41bd29['type'][_0xceb4('0x45')]};});_0x37d4c1[_0xceb4('0x46')]=_[_0xceb4('0x34')](_0x5b99bc,_0xceb4('0x47'));_0x37d4c1['query']=_[_0xceb4('0x48')](_0x255ad7[_0xceb4('0x49')]);_0x37d4c1['filters']=_[_0xceb4('0x4a')](_0x37d4c1[_0xceb4('0x46')],_0x37d4c1[_0xceb4('0x49')]);_0x30335e[_0xceb4('0x4b')]=_[_0xceb4('0x4a')](_0x37d4c1[_0xceb4('0x46')],qs[_0xceb4('0x4c')](_0x255ad7[_0xceb4('0x49')][_0xceb4('0x4c')]));_0x30335e[_0xceb4('0x4b')]=_0x30335e['attributes']['length']?_0x30335e['attributes']:_0x37d4c1[_0xceb4('0x46')];if(!_0x255ad7['query']['hasOwnProperty'](_0xceb4('0x4d'))){_0x30335e[_0xceb4('0x25')]=qs[_0xceb4('0x25')](_0x255ad7[_0xceb4('0x49')][_0xceb4('0x25')]);_0x30335e[_0xceb4('0x24')]=qs['offset'](_0x255ad7[_0xceb4('0x49')]['offset']);}_0x30335e[_0xceb4('0x4e')]=qs[_0xceb4('0x4f')](_0x255ad7[_0xceb4('0x49')][_0xceb4('0x4f')]);_0x30335e['where']=qs[_0xceb4('0x50')](_[_0xceb4('0x51')](_0x255ad7[_0xceb4('0x49')],_0x37d4c1[_0xceb4('0x50')]),_0x5b99bc);var _0x1d834a=[];var _0x3c649d=squel[_0xceb4('0x52')]()[_0xceb4('0x53')]('id')[_0xceb4('0x53')](_0xceb4('0x47'))['field']('color')[_0xceb4('0x54')](_0xceb4('0x55'));var _0x322f12=squel['select']()[_0xceb4('0x53')](_0xceb4('0x56'))[_0xceb4('0x53')]('u.fullname')[_0xceb4('0x53')](_0xceb4('0x57'))['from']('user_has_openchannel_interactions','ui')[_0xceb4('0x58')](_0xceb4('0x59'),'u',_0xceb4('0x5a'));var _0x135f5c=squel[_0xceb4('0x52')]()[_0xceb4('0x54')]('openchannel_interactions','i')[_0xceb4('0x58')](_0xceb4('0x5b'),'c',_0xceb4('0x5c'))[_0xceb4('0x58')]('users','o','o.id\x20=\x20i.UserId')[_0xceb4('0x58')]('openchannel_accounts','a',_0xceb4('0x5d'))['left_join'](_0xceb4('0x5e'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xceb4('0x5f'),'it',_0xceb4('0x60'))[_0xceb4('0x58')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x1a12b4=squel['expr']();var _0x9e436b=[];var _0x536403=squel[_0xceb4('0x61')]();var _0x18ad77;if(_0x255ad7[_0xceb4('0x49')][_0xceb4('0x62')]){_0x18ad77=as[_0xceb4('0x63')](_0x255ad7['query']['search']);var _0x47f3ef=_0x18ad77[_0xceb4('0x64')];for(var _0x408db2=0x0;_0x408db2<_0x18ad77[_0xceb4('0x65')][_0xceb4('0x66')];_0x408db2++){var _0x469df7=_0x18ad77[_0xceb4('0x65')][_0x408db2];var _0x39139b='i';var _0x12a8c2=_['find'](_0x5b99bc,[_0xceb4('0x47'),_0x469df7['field']]);if(!_0x12a8c2){switch(_0x469df7[_0xceb4('0x53')]){case'unreadMessages':if(_0x469df7['value']==0x1){_0x135f5c[_0xceb4('0x67')]('`'+_0x469df7[_0xceb4('0x53')]+_0xceb4('0x68'));}else{_0x135f5c[_0xceb4('0x67')]('`'+_0x469df7[_0xceb4('0x53')]+'`\x20>\x200');}break;case'Contact':if(_0x469df7[_0xceb4('0x69')]===_0xceb4('0x6a')){if(_0x469df7['value'][_0xceb4('0x38')]('\x20')['length']>0x1){_0x1a12b4[_0x47f3ef]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xceb4('0x6b')](_0x469df7[_0xceb4('0x6c')]),null);}else{var _0x2760e9='%'+_0x469df7[_0xceb4('0x6c')]+'%';_0x1a12b4[_0x47f3ef](_0xceb4('0x6d'),_0x2760e9,_0x2760e9,_0x2760e9);}}else{_0x12a8c2=_[_0xceb4('0x6e')](_0x5b99bc,[_0xceb4('0x47'),_0xceb4('0x6f')]);_0x469df7[_0xceb4('0x53')]=_0xceb4('0x6f');_0x128b6d=as[_0xceb4('0x70')](_0x39139b,_0x12a8c2[_0xceb4('0x71')],_0x469df7);_0x1a12b4[_0x47f3ef](_0x128b6d[_0xceb4('0x72')],_0x128b6d[_0xceb4('0x6c')]['start'],_0x128b6d[_0xceb4('0x6c')][_0xceb4('0x21')]);}break;case _0xceb4('0x73'):var _0x98fee0=_0x469df7['value'][_0xceb4('0x38')](',')[_0xceb4('0x34')](function(_0x47e63b){return Number(_0x47e63b);});_0x98fee0[_0xceb4('0x39')](function(_0xfd2699){_0x536403['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xfd2699+',%');});_0x9e436b=_[_0xceb4('0x74')](_0x9e436b,_0x98fee0);break;case _0xceb4('0x75'):if(_0x469df7[_0xceb4('0x69')]===_0xceb4('0x6a')){_0x1a12b4[_0x47f3ef](_0xceb4('0x76'),'%'+_0x469df7[_0xceb4('0x6c')]+'%',null);}else{_0x12a8c2=_['find'](_0x5b99bc,['name','UserId']);_0x469df7['field']=_0xceb4('0x42');_0x128b6d=as[_0xceb4('0x70')](_0x39139b,_0x12a8c2[_0xceb4('0x71')],_0x469df7);_0x1a12b4[_0x47f3ef](_0x128b6d['text'],_0x128b6d[_0xceb4('0x6c')][_0xceb4('0x77')],_0x128b6d[_0xceb4('0x6c')][_0xceb4('0x21')]);}break;case _0xceb4('0x78'):_0x128b6d=as[_0xceb4('0x70')]('me',null,_0x469df7);_0x1a12b4[_0x47f3ef](_0x128b6d[_0xceb4('0x72')],_0x128b6d[_0xceb4('0x6c')]['start'],_0x128b6d[_0xceb4('0x6c')][_0xceb4('0x21')]);break;}}else{var _0x128b6d=as['buildExpression'](_0x39139b,_0x12a8c2[_0xceb4('0x71')],_0x469df7);_0x1a12b4[_0x47f3ef](_0x128b6d[_0xceb4('0x72')],_0x128b6d[_0xceb4('0x6c')][_0xceb4('0x77')],_0x128b6d[_0xceb4('0x6c')][_0xceb4('0x21')]);}}}else{var _0x483c2f=_(_0x255ad7[_0xceb4('0x49')])[_0xceb4('0x48')]()[_0xceb4('0x34')](function(_0x22a645){return _['some'](_0x5b99bc,[_0xceb4('0x47'),_0x22a645])?_0x22a645:undefined;})['compact']()['value']();if(!_[_0xceb4('0x79')](_0x483c2f)){_0x483c2f[_0xceb4('0x39')](function(_0x1b6922){if(_0x1b6922==='OpenchannelAccountId'){_0x135f5c[_0xceb4('0x7a')](_0xceb4('0x7b'),[][_0xceb4('0x7c')](_0x255ad7[_0xceb4('0x49')][_0x1b6922]));}else if(_0x1b6922==='createdAt'){var _0x455b38=JSON[_0xceb4('0x7d')](_0x255ad7['query'][_0x1b6922])[_0xceb4('0x7e')];var _0x9bfb9a=JSON[_0xceb4('0x7d')](_0x255ad7[_0xceb4('0x49')][_0x1b6922])[_0xceb4('0x7f')];_0x135f5c[_0xceb4('0x7a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x455b38,_0x9bfb9a);}else{if(_0x255ad7[_0xceb4('0x49')][_0x1b6922]===_0xceb4('0x80')){_0x135f5c['where']('i.'+_0x1b6922+'\x20IS\x20NULL');}else{_0x135f5c[_0xceb4('0x7a')]('i.'+_0x1b6922+_0xceb4('0x81'),_0x255ad7['query'][_0x1b6922]);}}});}if(_0x255ad7['query'][_0xceb4('0x82')]){if(_0x255ad7[_0xceb4('0x49')][_0xceb4('0x82')]==0x1){_0x135f5c[_0xceb4('0x67')](_0xceb4('0x83'));}else{_0x135f5c['having']('`unreadMessages`\x20>\x200');}}if(_0x255ad7[_0xceb4('0x49')][_0xceb4('0x84')]){_0x9e436b=_[_0xceb4('0x85')](_0x255ad7['query'][_0xceb4('0x84')])?_0x255ad7[_0xceb4('0x49')][_0xceb4('0x84')]:new Array(_0x255ad7[_0xceb4('0x49')][_0xceb4('0x84')]);_0x9e436b[_0xceb4('0x39')](function(_0x3ed5ac){_0x536403['or'](_0xceb4('0x86'),'%,'+_0x3ed5ac+',%');});}if(_0x255ad7[_0xceb4('0x49')][_0xceb4('0x87')]){var _0x465a63=_0x255ad7[_0xceb4('0x49')][_0xceb4('0x87')][_0xceb4('0x88')]('\x5c','\x5c\x5c')[_0xceb4('0x88')](/'/g,'\x27\x27');if(qs[_0xceb4('0x89')](_0x465a63)){_0x1a12b4['or']('i.id\x20LIKE\x20?',_0x465a63+'%');}else{_0x1a12b4['or'](_0xceb4('0x8a'),qs['getFullTextValue'](_0x465a63))['or'](_0xceb4('0x8b'),_0x465a63+'%')['or'](_0xceb4('0x8c'),_0x465a63+'%');}}}_0x135f5c['where'](_0x1a12b4);_0x135f5c[_0xceb4('0x8d')]('i.id');var _0x4c2ca6={'type':db[_0xceb4('0x8e')][_0xceb4('0x8f')][_0xceb4('0x90')],'raw':!![]};var _0xfdc377=_0x135f5c['clone']();_0xfdc377[_0xceb4('0x53')]('i.id');_0xfdc377[_0xceb4('0x53')](_0xceb4('0x91'),'unreadMessages');if(_0x30335e[_0xceb4('0x4e')]){_0x30335e[_0xceb4('0x4e')][_0xceb4('0x39')](function(_0x3287f5){var _0xbda1a6=_0x3287f5[0x0]==='contactName'?_0x3287f5[0x0]:'i.'+_0x3287f5[0x0];_0x135f5c['order'](_0xbda1a6,_0x3287f5[0x1]===_0xceb4('0x92')?![]:!![]);});}if(!_[_0xceb4('0x79')](_0x9e436b)){_0x135f5c[_0xceb4('0x67')](_0x536403);_0xfdc377['where']('t.id\x20IN\x20?',_0x9e436b);}BPromise[_0xceb4('0x93')]()['then'](function(){if(!_0x18ad77){if(_0x255ad7[_0xceb4('0x49')]['OpenchannelAccountId'])return;_0xfdc377[_0xceb4('0x7a')](_0xceb4('0x94'));_0x135f5c['where'](_0xceb4('0x94'));return;}if(_0x255ad7[_0xceb4('0x95')]['role']!==_0xceb4('0x96'))return;return _0x255ad7['user']['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0xceb4('0x2e')](function(_0x1f3fda){if(_[_0xceb4('0x79')](_0x1f3fda)){_0xfdc377[_0xceb4('0x7a')](_0xceb4('0x97'));_0x135f5c[_0xceb4('0x7a')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0xfdc377['where']('i.OpenchannelAccountId\x20IN\x20?',_[_0xceb4('0x34')](_0x1f3fda,'id'));_0x135f5c[_0xceb4('0x7a')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xceb4('0x34')](_0x1f3fda,'id'));}});})[_0xceb4('0x2e')](function(){if(_0x255ad7['user'][_0xceb4('0x98')]===_0xceb4('0x96')&&!_0x18ad77&&!_0x255ad7['query'][_0xceb4('0x99')])return[];return db['sequelize']['query'](_0xfdc377['toString'](),_0x4c2ca6);})[_0xceb4('0x2e')](function(_0x58f245){_0x3e3cb7[_0xceb4('0x23')]=_0x58f245[_0xceb4('0x66')];if(_0x3e3cb7[_0xceb4('0x23')]===0x0)return[];return db[_0xceb4('0x9a')][_0xceb4('0x49')](_0x3c649d[_0xceb4('0x9b')](),_0x4c2ca6)[_0xceb4('0x2e')](function(_0x35ef74){_0x1d834a=_[_0xceb4('0x9c')](_0x35ef74,'id');_0x4c2ca6=_[_0xceb4('0x9d')](_0x4c2ca6,{'model':db[_0xceb4('0x43')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x255ad7[_0xceb4('0x49')][_0xceb4('0x4c')]){_0x30335e['attributes'][_0xceb4('0x39')](function(_0x3eaec7){_0x135f5c[_0xceb4('0x53')]('i.'+_0x3eaec7);});}else{_0x135f5c[_0xceb4('0x53')](_0xceb4('0x91'),'unreadMessages');_0x135f5c['field'](_0xceb4('0x9e'),_0xceb4('0x9f'));_0x135f5c[_0xceb4('0x53')](_0xceb4('0xa0'),_0xceb4('0xa1'));_0x135f5c[_0xceb4('0x53')](_0xceb4('0xa2'),_0xceb4('0xa3'));_0x135f5c[_0xceb4('0x53')](_0xceb4('0xa4'));_0x135f5c['field']('c.firstName',_0xceb4('0xa5'));_0x135f5c[_0xceb4('0x53')](_0xceb4('0xa6'),'Contact.lastName');_0x135f5c['field'](_0xceb4('0xa7'),_0xceb4('0xa8'));_0x135f5c[_0xceb4('0x53')]('c.phone',_0xceb4('0xa9'));_0x135f5c[_0xceb4('0x53')](_0xceb4('0xaa'),_0xceb4('0xab'));_0x135f5c[_0xceb4('0x53')]('c.fax',_0xceb4('0xac'));_0x135f5c[_0xceb4('0x53')]('o.fullname','Owner.fullname');_0x135f5c[_0xceb4('0x53')](_0xceb4('0xad'),_0xceb4('0xae'));_0x135f5c[_0xceb4('0x53')](_0xceb4('0xaf'),_0xceb4('0x37'));}if(_0x30335e[_0xceb4('0x25')])_0x135f5c['limit'](_0x30335e['limit']);if(_0x30335e[_0xceb4('0x24')])_0x135f5c['offset'](_0x30335e[_0xceb4('0x24')]);return db['sequelize'][_0xceb4('0x49')](_0x135f5c['toString'](),_0x4c2ca6);})['then'](function(_0x36c160){if(_0x36c160[_0xceb4('0x66')]>0x0)_0x322f12[_0xceb4('0x7a')](_0xceb4('0xb0'),_[_0xceb4('0x34')](_0x36c160,'id'));return db[_0xceb4('0x9a')][_0xceb4('0x49')](_0x322f12[_0xceb4('0x9b')](),_0x4c2ca6)['then'](function(_0xb406be){var _0x309a10=_[_0xceb4('0xb1')](_0xb406be,'OpenchannelInteractionId');var _0x4c2159=[];_0x36c160[_0xceb4('0x39')](function(_0x2be5a1){_0x4c2159[_0xceb4('0x3a')](updateOpenchannelInteraction(_0x2be5a1,_0x1d834a,_0x309a10));});return BPromise['all'](_0x4c2159);});});})[_0xceb4('0x2e')](function(_0x44a005){_0x3e3cb7['rows']=_0x44a005;return _0x3e3cb7;})['then'](respondWithFilteredResult(_0x47a244,_0x30335e))['catch'](handleError(_0x47a244,null));};exports[_0xceb4('0xb2')]=function(_0x3ecce2,_0x275272){var _0x3a1488={};if(_0x3ecce2[_0xceb4('0x49')][_0xceb4('0x71')]&&_0x3ecce2['query'][_0xceb4('0x71')]===_0xceb4('0x54')){_0x3a1488['from']=_0x3ecce2['params']['id'];}else{_0x3a1488['id']=_0x3ecce2['params']['id'];}var _0x51deb2={'raw':![],'where':_0x3a1488},_0x527d3d={};_0x527d3d[_0xceb4('0x46')]=_[_0xceb4('0x48')](db[_0xceb4('0x43')]['rawAttributes']);_0x527d3d[_0xceb4('0x49')]=_[_0xceb4('0x48')](_0x3ecce2[_0xceb4('0x49')]);_0x527d3d[_0xceb4('0x50')]=_[_0xceb4('0x4a')](_0x527d3d[_0xceb4('0x46')],_0x527d3d['query']);_0x51deb2['attributes']=_[_0xceb4('0x4a')](_0x527d3d[_0xceb4('0x46')],qs[_0xceb4('0x4c')](_0x3ecce2[_0xceb4('0x49')][_0xceb4('0x4c')]));_0x51deb2['attributes']=_0x51deb2[_0xceb4('0x4b')][_0xceb4('0x66')]?_0x51deb2['attributes']:_0x527d3d[_0xceb4('0x46')];if(_0x3ecce2[_0xceb4('0x49')][_0xceb4('0xb3')]){_0x51deb2[_0xceb4('0xb4')]=[{'all':!![]}];}_0x51deb2=_['merge']({},_0x51deb2,_0x3ecce2[_0xceb4('0xb5')]);return db[_0xceb4('0x43')]['find'](_0x51deb2)[_0xceb4('0x2e')](handleEntityNotFound(_0x275272,null))[_0xceb4('0x2e')](respondWithResult(_0x275272,null))[_0xceb4('0x3b')](handleError(_0x275272,null));};exports[_0xceb4('0xb6')]=function(_0x2240bb,_0x366a24){return db[_0xceb4('0x43')]['create'](_0x2240bb[_0xceb4('0x78')],{})[_0xceb4('0x2e')](respondWithResult(_0x366a24,0xc9))['catch'](handleError(_0x366a24,null));};exports[_0xceb4('0x2c')]=function(_0x299369,_0x3ee9ac){if(_0x299369['body']['id']){delete _0x299369[_0xceb4('0x78')]['id'];}return db[_0xceb4('0x43')][_0xceb4('0x6e')]({'where':{'id':_0x299369[_0xceb4('0xb7')]['id']}})[_0xceb4('0x2e')](handleEntityNotFound(_0x3ee9ac,null))['then'](saveUpdates(_0x299369[_0xceb4('0x78')],null))[_0xceb4('0x2e')](respondWithResult(_0x3ee9ac,null))[_0xceb4('0x3b')](handleError(_0x3ee9ac,null));};exports[_0xceb4('0x2d')]=function(_0x481278,_0x458d71){return db[_0xceb4('0x43')][_0xceb4('0x6e')]({'where':{'id':_0x481278['params']['id']}})[_0xceb4('0x2e')](handleEntityNotFound(_0x458d71,null))[_0xceb4('0x2e')](removeEntity(_0x458d71,null))[_0xceb4('0x3b')](handleError(_0x458d71,null));};exports[_0xceb4('0xb8')]=function(_0x1a7559,_0x570281){return db[_0xceb4('0x43')][_0xceb4('0xb8')]()[_0xceb4('0x2e')](respondWithResult(_0x570281,null))[_0xceb4('0x3b')](handleError(_0x570281,null));};exports[_0xceb4('0xb9')]=function(_0x30f39e,_0xa4ada6,_0x407dec){return db[_0xceb4('0xba')][_0xceb4('0x6e')]({'where':{'id':_0x30f39e[_0xceb4('0xb7')]['id']}})[_0xceb4('0x2e')](handleEntityNotFound(_0xa4ada6,null))[_0xceb4('0x2e')](function(_0x450d9e){if(_0x450d9e){return _0x450d9e[_0xceb4('0xb9')](_0x30f39e[_0xceb4('0x78')]['ids'],_[_0xceb4('0xbb')](_0x30f39e[_0xceb4('0x78')],[_0xceb4('0xbc'),'id'])||{});}})[_0xceb4('0x2e')](respondWithResult(_0xa4ada6,null))[_0xceb4('0x3b')](handleError(_0xa4ada6,null));};exports[_0xceb4('0xbd')]=function(_0x410b06,_0x3ad3a7,_0x18ff71){var _0x4b56e7={'raw':![],'where':{}};var _0x3ba546={};var _0xf19431={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xceb4('0xbe')]({'where':{'id':_0x410b06[_0xceb4('0xb7')]['id']}})[_0xceb4('0x2e')](handleEntityNotFound(_0x3ad3a7,null))['then'](function(_0xd6c7dc){if(_0xd6c7dc){_0x3ba546[_0xceb4('0x46')]=_[_0xceb4('0x48')](db[_0xceb4('0xba')][_0xceb4('0xbf')]);_0x3ba546[_0xceb4('0x49')]=_[_0xceb4('0x48')](_0x410b06[_0xceb4('0x49')]);_0x3ba546[_0xceb4('0x50')]=_[_0xceb4('0x4a')](_0x3ba546[_0xceb4('0x46')],_0x3ba546[_0xceb4('0x49')]);_0x4b56e7[_0xceb4('0x4b')]=_[_0xceb4('0x4a')](_0x3ba546['model'],qs[_0xceb4('0x4c')](_0x410b06[_0xceb4('0x49')]['fields']));_0x4b56e7[_0xceb4('0x4b')]=_0x4b56e7['attributes'][_0xceb4('0x66')]?_0x4b56e7[_0xceb4('0x4b')]:_0x3ba546[_0xceb4('0x46')];if(!_0x410b06[_0xceb4('0x49')][_0xceb4('0xc0')](_0xceb4('0x4d'))){_0x4b56e7[_0xceb4('0x25')]=qs['limit'](_0x410b06['query'][_0xceb4('0x25')]);_0x4b56e7[_0xceb4('0x24')]=qs[_0xceb4('0x24')](_0x410b06[_0xceb4('0x49')][_0xceb4('0x24')]);}_0x4b56e7[_0xceb4('0x4e')]=qs['sort'](_0x410b06['query'][_0xceb4('0x4f')]);_0x4b56e7[_0xceb4('0x7a')]=qs[_0xceb4('0x50')](_[_0xceb4('0x51')](_0x410b06[_0xceb4('0x49')],_0x3ba546[_0xceb4('0x50')]));_0x4b56e7[_0xceb4('0x7a')][_0xceb4('0xc1')]=_0xd6c7dc['id'];if(_0x410b06[_0xceb4('0x49')][_0xceb4('0x87')]){_0x4b56e7[_0xceb4('0x7a')]=_[_0xceb4('0x9d')](_0x4b56e7['where'],{'$or':_[_0xceb4('0x34')](_0x4b56e7[_0xceb4('0x4b')],function(_0x174e5a){var _0x4f46b0={};_0x4f46b0[_0x174e5a]={'$like':'%'+_0x410b06[_0xceb4('0x49')][_0xceb4('0x87')]+'%'};return _0x4f46b0;})});}if(_0x410b06[_0xceb4('0x49')][_0xceb4('0x7e')]){var _0x412b8e=_0x410b06[_0xceb4('0x49')][_0xceb4('0x7e')][_0xceb4('0x38')](',');var _0x1d97bf={};_0x1d97bf[_0x412b8e[0x0]]={'$gte':moment(_0x412b8e[0x1])['format'](_0xceb4('0xc2'))};_0x4b56e7[_0xceb4('0x7a')]=_['merge'](_0x4b56e7['where'],_0x1d97bf);}_0x4b56e7=_[_0xceb4('0x9d')]({},_0x4b56e7,_0x410b06['options']);return db['OpenchannelMessage'][_0xceb4('0x23')]({'where':_0x4b56e7['where']})[_0xceb4('0x2e')](function(_0x37faa9){_0xf19431[_0xceb4('0x23')]=_0x37faa9;if(_0x410b06['query'][_0xceb4('0xb3')]){_0x4b56e7[_0xceb4('0xb4')]=[{'all':!![]}];}return db[_0xceb4('0xba')]['findAll'](_0x4b56e7);})[_0xceb4('0x2e')](function(_0x56000d){_0xf19431[_0xceb4('0xc3')]=_0x56000d;return _0xf19431;});}})[_0xceb4('0x2e')](respondWithFilteredResult(_0x3ad3a7,_0x4b56e7))['catch'](handleError(_0x3ad3a7,null));};exports[_0xceb4('0xc4')]=function(_0x30220d,_0x370ebb,_0x540605){return db[_0xceb4('0x43')][_0xceb4('0x6e')]({'where':{'id':_0x30220d[_0xceb4('0xb7')]['id']}})[_0xceb4('0x2e')](handleEntityNotFound(_0x370ebb,null))[_0xceb4('0x2e')](function(_0x1d5317){if(_0x1d5317){return _0x1d5317[_0xceb4('0xc5')](_0x30220d['body']['ids'],_[_0xceb4('0xbb')](_0x30220d['body'],[_0xceb4('0xbc'),'id'])||{})['spread'](function(){return db[_0xceb4('0x73')][_0xceb4('0xc6')]({'attributes':['id','name','color'],'where':{'id':_0x30220d['body'][_0xceb4('0xbc')]}});})[_0xceb4('0x2e')](function(_0x107086){socket[_0xceb4('0xc7')]('openchannelInteractionTags:save',{'id':Number(_0x30220d[_0xceb4('0xb7')]['id']),'tags':_0x107086||[]});return{'id':Number(_0x30220d[_0xceb4('0xb7')]['id']),'tags':_0x107086||[]};});}})[_0xceb4('0x2e')](respondWithResult(_0x370ebb,null))['catch'](handleError(_0x370ebb,null));};exports[_0xceb4('0xc8')]=function(_0x34295b,_0x2afc59,_0x2685e0){return db[_0xceb4('0x43')][_0xceb4('0x6e')]({'where':{'id':_0x34295b[_0xceb4('0xb7')]['id']}})[_0xceb4('0x2e')](handleEntityNotFound(_0x2afc59,null))['then'](function(_0x5f8af0){if(_0x5f8af0){return _0x5f8af0[_0xceb4('0xc8')](_0x34295b[_0xceb4('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x2afc59,null))['catch'](handleError(_0x2afc59,null));};exports['download']=function(_0x561dee,_0x49ad86){var _0x11feff=moment()[_0xceb4('0xc9')]()['toString']();var _0x40b04c=path[_0xceb4('0xca')](config[_0xceb4('0xcb')],_0xceb4('0xcc'),'files',_0xceb4('0xcd'));var _0x2dff8c=path[_0xceb4('0xca')](config[_0xceb4('0xcb')],_0xceb4('0xcc'),_0xceb4('0xce'),'attachments');var _0x4680d5=path[_0xceb4('0xca')](_0x40b04c,_0x11feff);var _0x5084c9=util['format'](_0xceb4('0xcf'),_0x561dee['params']['id'],_0x11feff);var _0x1ab059=path[_0xceb4('0xca')](_0x40b04c,_0x5084c9);var _0x33288d=[];_0x33288d[_0xceb4('0x3a')]({'model':db[_0xceb4('0x75')],'as':_0xceb4('0x75'),'attributes':['id',_0xceb4('0x35')],'raw':!![]});_0x33288d[_0xceb4('0x3a')]({'model':db['CmContact'],'as':_0xceb4('0xd0'),'attributes':['id',_0xceb4('0xd1'),_0xceb4('0xd2')],'raw':!![]});if(_0x561dee[_0xceb4('0x49')]['attachments']){_0x33288d[_0xceb4('0x3a')]({'model':db[_0xceb4('0xd3')],'as':_0xceb4('0xd3'),'raw':!![]});}var _0x2d2526=[{'model':db['OpenchannelMessage'],'as':_0xceb4('0xd4'),'attributes':['id',_0xceb4('0x78'),'createdAt',_0xceb4('0xd5'),_0xceb4('0xd6'),'read'],'include':_0x33288d}];_0x2d2526[_0xceb4('0x3a')]({'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xceb4('0x47')]});_0x2d2526[_0xceb4('0x3a')]({'model':db[_0xceb4('0x75')],'as':_0xceb4('0xd7'),'attributes':['id','fullname']});return db[_0xceb4('0x43')][_0xceb4('0x6e')]({'where':{'id':_0x561dee['params']['id']},'include':_0x2d2526})['then'](handleEntityNotFound(_0x49ad86,null))[_0xceb4('0x2e')](function(_0x5c6595){if(_0x5c6595){var _0x334730=_0x5c6595[_0xceb4('0xd8')]({'plain':!![]});fs[_0xceb4('0xd9')](_0x4680d5);var _0x559f53={'channel':'Openchannel','account':_0x334730[_0xceb4('0xda')]['name'],'agent':_0x334730[_0xceb4('0xd7')]?_0x334730['Owner'][_0xceb4('0x35')]:'N.A.','createdAt':moment(_0x334730['createdAt'])[_0xceb4('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xceb4('0x9b')](),'closedAt':_0x334730[_0xceb4('0x41')]?moment(_0x334730[_0xceb4('0xdc')])[_0xceb4('0xdb')](_0xceb4('0xc2'))['toString']():'','disposition':_0x334730[_0xceb4('0xdd')],'visibility':_0x334730[_0xceb4('0xde')]?_0xceb4('0xdf'):_0xceb4('0xe0'),'messages':_(_0x334730[_0xceb4('0xd4')])['filter']({'secret':![]})['map'](function(_0x31495b){if(_0x31495b[_0xceb4('0xd3')]){var _0x268616=path['join'](_0x2dff8c,_0x31495b[_0xceb4('0xd3')][_0xceb4('0xe1')]);if(fs[_0xceb4('0xe2')](_0x268616)){fs['createReadStream'](_0x268616)[_0xceb4('0xe3')](fs[_0xceb4('0xe4')](path[_0xceb4('0xca')](_0x4680d5,_0x31495b['Attachment'][_0xceb4('0xe1')])));}}return{'date':moment(_0x31495b[_0xceb4('0xe5')])[_0xceb4('0xdb')](_0xceb4('0xc2'))[_0xceb4('0x9b')](),'sender':_0x31495b[_0xceb4('0xd5')]===_0xceb4('0xe6')?_0x31495b['User']?_0x31495b[_0xceb4('0x75')]['fullname']:_0xceb4('0xe7'):_0x31495b[_0xceb4('0xd0')]['firstName']+(_0x31495b[_0xceb4('0xd0')][_0xceb4('0xd2')]?'\x20'+_0x31495b[_0xceb4('0xd0')][_0xceb4('0xd2')]:''),'body':_0x31495b[_0xceb4('0xd3')]?_0x31495b['Attachment'][_0xceb4('0xe1')]:_0x31495b[_0xceb4('0x78')],'direction':_0x31495b[_0xceb4('0xd5')]==='out'?'A':'C','secret':_0x31495b[_0xceb4('0xd6')],'read':_0x31495b[_0xceb4('0x82')],'attachment':_0x31495b[_0xceb4('0xd3')]};})['value']()};return ejs[_0xceb4('0xe8')](path['join'](config[_0xceb4('0xcb')],_0xceb4('0xcc'),_0xceb4('0xe9'),_0xceb4('0xea')),{'interaction':_0x559f53})[_0xceb4('0x2e')](function(_0x59362c){var _0x56734f=path[_0xceb4('0xca')](_0x4680d5,_0xceb4('0xeb')+_0x334730['id']+'-'+_0x11feff+_0xceb4('0xec'));var _0x516074={'path':_0x56734f,'channel':'Openchannel','interactionId':_0x334730['id']};return pdf[_0xceb4('0xed')](_0x59362c,_0x516074);})[_0xceb4('0x2e')](function(){return new BPromise(function(_0x31b944,_0xac4db6){zipdir(_0x4680d5,{'saveTo':_0x1ab059},function(_0x4ed8b9,_0xf85605){if(_0x4ed8b9)return _0xac4db6(_0x4ed8b9);return _0x31b944(_0xf85605);});})[_0xceb4('0x2e')](function(){return new BPromise(function(_0x19cba7,_0x243f05){rimraf(_0x4680d5,function(_0x5c9936){if(_0x5c9936)_0x243f05(_0x5c9936);return _0x19cba7();});});})[_0xceb4('0x2e')](function(){return _0x49ad86[_0xceb4('0xee')](_0x1ab059,_0x5084c9,function(_0x557e57){if(_0x557e57){console[_0xceb4('0xef')]('err',_0x557e57);}else{fs[_0xceb4('0xf0')](_0x1ab059);}});});});}else{return _0x49ad86[_0xceb4('0x2f')](0xc8);}})['catch'](handleError(_0x49ad86,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 35d6a7c..e47108b 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 _0x9f3c=['hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x552473,_0x107522){var _0x4fc37a=function(_0x147262){while(--_0x147262){_0x552473['push'](_0x552473['shift']());}};_0x4fc37a(++_0x107522);}(_0x9f3c,0x122));var _0xc9f3=function(_0x49d0ca,_0x413b5f){_0x49d0ca=_0x49d0ca-0x0;var _0x3dbe53=_0x9f3c[_0x49d0ca];return _0x3dbe53;};'use strict';var EventEmitter=require(_0xc9f3('0x0'));var OpenchannelInteraction=require(_0xc9f3('0x1'))['db'][_0xc9f3('0x2')];var OpenchannelMessage=require(_0xc9f3('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xc9f3('0x3')](0x0);var events={'afterCreate':_0xc9f3('0x4'),'afterUpdate':_0xc9f3('0x5'),'afterDestroy':_0xc9f3('0x6')};function emitEvent(_0x584b0a){return function(_0x56ea18,_0x5be126,_0x3b6585){_0x56ea18[_0xc9f3('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1f7da0){_0x56ea18[_0xc9f3('0x8')](_0xc9f3('0x9'),_0x1f7da0[_0xc9f3('0xa')](function(_0xc2e0a0){return{'id':_0xc2e0a0['id']};}));return OpenchannelMessage[_0xc9f3('0xb')]({'where':{'OpenchannelInteractionId':_0x56ea18['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc9f3('0xc')](function(_0x545761){_0x56ea18[_0xc9f3('0x8')](_0xc9f3('0xd'),_0x545761[_0xc9f3('0xe')]);OpenchannelInteractionEvents[_0xc9f3('0xf')](_0x584b0a+':'+_0x56ea18['id'],_0x56ea18);OpenchannelInteractionEvents[_0xc9f3('0xf')](_0x584b0a,_0x56ea18);_0x3b6585(null);})['catch'](_0x3b6585(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xc9f3('0x10')](e,emitEvent(event));}}module[_0xc9f3('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xb2c1=['map','findAll','unreadMessages','length','emit','catch','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x21941e,_0x345231){var _0x11de3b=function(_0x83cd9d){while(--_0x83cd9d){_0x21941e['push'](_0x21941e['shift']());}};_0x11de3b(++_0x345231);}(_0xb2c1,0x66));var _0x1b2c=function(_0x3b22e9,_0x354406){_0x3b22e9=_0x3b22e9-0x0;var _0x230314=_0xb2c1[_0x3b22e9];return _0x230314;};'use strict';var EventEmitter=require(_0x1b2c('0x0'));var OpenchannelInteraction=require(_0x1b2c('0x1'))['db'][_0x1b2c('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x1b2c('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1b2c('0x4')](0x0);var events={'afterCreate':_0x1b2c('0x5'),'afterUpdate':_0x1b2c('0x6'),'afterDestroy':_0x1b2c('0x7')};function emitEvent(_0x553915){return function(_0x5dd1f8,_0xa13e0,_0x448f83){_0x5dd1f8[_0x1b2c('0x8')]({'attributes':['id'],'raw':!![]})[_0x1b2c('0x9')](function(_0x36e289){_0x5dd1f8[_0x1b2c('0xa')](_0x1b2c('0xb'),_0x36e289[_0x1b2c('0xc')](function(_0x12fde1){return{'id':_0x12fde1['id']};}));return OpenchannelMessage[_0x1b2c('0xd')]({'where':{'OpenchannelInteractionId':_0x5dd1f8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1b2c('0x9')](function(_0x2ac02d){_0x5dd1f8['setDataValue'](_0x1b2c('0xe'),_0x2ac02d[_0x1b2c('0xf')]);OpenchannelInteractionEvents[_0x1b2c('0x10')](_0x553915+':'+_0x5dd1f8['id'],_0x5dd1f8);OpenchannelInteractionEvents[_0x1b2c('0x10')](_0x553915,_0x5dd1f8);_0x448f83(null);})[_0x1b2c('0x11')](_0x448f83(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x1b2c('0x12')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 2d1ed19..ede5895 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 _0x607c=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5d0725,_0x1ae8ad){var _0x157c30=function(_0x19c1ad){while(--_0x19c1ad){_0x5d0725['push'](_0x5d0725['shift']());}};_0x157c30(++_0x1ae8ad);}(_0x607c,0x1dc));var _0xc607=function(_0x593567,_0x1321a4){_0x593567=_0x593567-0x0;var _0x5a1915=_0x607c[_0x593567];return _0x5a1915;};'use strict';var _=require('lodash');var util=require(_0xc607('0x0'));var logger=require(_0xc607('0x1'))('api');var moment=require(_0xc607('0x2'));var BPromise=require(_0xc607('0x3'));var rp=require(_0xc607('0x4'));var fs=require('fs');var path=require(_0xc607('0x5'));var rimraf=require(_0xc607('0x6'));var config=require('../../config/environment');var attributes=require(_0xc607('0x7'));module[_0xc607('0x8')]=function(_0x4debe7,_0x4a6b33){return _0x4debe7[_0xc607('0x9')](_0xc607('0xa'),attributes,{'tableName':_0xc607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc607('0xc'),'hooks':{'beforeUpdate':function(_0x59f666,_0x598ec7,_0x4d147a){if(_0x59f666['changed'](_0xc607('0xd'))){_0x59f666[_0xc607('0xe')]=moment()[_0xc607('0xf')](_0xc607('0x10'));}_0x4d147a(null,_0x59f666);}}});}; \ No newline at end of file +var _0x41d0=['OpenchannelInteraction','utf8mb4','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x16ee48,_0x4e660d){var _0x23f7bf=function(_0x31464e){while(--_0x31464e){_0x16ee48['push'](_0x16ee48['shift']());}};_0x23f7bf(++_0x4e660d);}(_0x41d0,0x1c6));var _0x041d=function(_0x1ed40e,_0x2aedc6){_0x1ed40e=_0x1ed40e-0x0;var _0x5ec065=_0x41d0[_0x1ed40e];return _0x5ec065;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var logger=require(_0x041d('0x2'))(_0x041d('0x3'));var moment=require('moment');var BPromise=require(_0x041d('0x4'));var rp=require(_0x041d('0x5'));var fs=require('fs');var path=require(_0x041d('0x6'));var rimraf=require(_0x041d('0x7'));var config=require(_0x041d('0x8'));var attributes=require(_0x041d('0x9'));module[_0x041d('0xa')]=function(_0x14907f,_0x196419){return _0x14907f['define'](_0x041d('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x041d('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0xd7e3b6,_0x965a31,_0x556017){if(_0xd7e3b6['changed']('closed')){_0xd7e3b6[_0x041d('0xd')]=moment()['format'](_0x041d('0xe'));}_0x556017(null,_0xd7e3b6);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 64cf261..f6837bf 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 _0x5b73=['find','addTags','ids','omit','body','AddTags','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','info','OpenchannelInteraction','update','options','where','attributes','limit','then','UpdateOpenchannelInteraction','stringify','catch','AddTagsToOpenchannelInteraction'];(function(_0x48cbfa,_0x80864){var _0x1cea43=function(_0x59a25f){while(--_0x59a25f){_0x48cbfa['push'](_0x48cbfa['shift']());}};_0x1cea43(++_0x80864);}(_0x5b73,0x1cd));var _0x35b7=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x5b73[_0xd63e3a];return _0x19c178;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x35b7('0x0'));var BPromise=require('bluebird');var rs=require(_0x35b7('0x1'));var fs=require('fs');var Redis=require(_0x35b7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x35b7('0x3'));var logger=require('../../config/logger')(_0x35b7('0x4'));var config=require('../../config/environment');var jayson=require(_0x35b7('0x5'));var client=jayson[_0x35b7('0x6')]['http']({'port':0x232a});config[_0x35b7('0x7')]=_[_0x35b7('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x35b7('0x9'))(new Redis(config['redis']));require(_0x35b7('0xa'))['register'](socket);function respondWithRpcPromise(_0x535239,_0x1e6a0d,_0x1feebc){return new BPromise(function(_0x5e87b9,_0x118df9){return client[_0x35b7('0xb')](_0x535239,_0x1feebc)['then'](function(_0x36a22f){logger['info'](_0x35b7('0xc'),_0x1e6a0d,_0x35b7('0xd'));logger[_0x35b7('0xe')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1e6a0d,_0x35b7('0xd'),JSON['stringify'](_0x36a22f));if(_0x36a22f['error']){if(_0x36a22f[_0x35b7('0xf')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1e6a0d,_0x36a22f[_0x35b7('0xf')][_0x35b7('0x10')]);return _0x118df9(_0x36a22f[_0x35b7('0xf')]['message']);}logger[_0x35b7('0xf')](_0x35b7('0xc'),_0x1e6a0d,_0x36a22f['error'][_0x35b7('0x10')]);return _0x5e87b9(_0x36a22f[_0x35b7('0xf')][_0x35b7('0x10')]);}else{logger[_0x35b7('0x11')](_0x35b7('0xc'),_0x1e6a0d,'request\x20sent');_0x5e87b9(_0x36a22f['result'][_0x35b7('0x10')]);}})['catch'](function(_0x296a33){logger['error'](_0x35b7('0xc'),_0x1e6a0d,_0x296a33);_0x118df9(_0x296a33);});});}exports['UpdateOpenchannelInteraction']=function(_0x5cbda6){var _0x573ae2=this;return new Promise(function(_0x48e96f,_0x467804){return db[_0x35b7('0x12')][_0x35b7('0x13')](_0x5cbda6['body'],{'raw':_0x5cbda6[_0x35b7('0x14')]?_0x5cbda6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cbda6[_0x35b7('0x14')]?_0x5cbda6['options'][_0x35b7('0x15')]||null:null,'attributes':_0x5cbda6[_0x35b7('0x14')]?_0x5cbda6['options'][_0x35b7('0x16')]||null:null,'limit':_0x5cbda6[_0x35b7('0x14')]?_0x5cbda6[_0x35b7('0x14')][_0x35b7('0x17')]||null:null})[_0x35b7('0x18')](function(_0x461e59){logger[_0x35b7('0x11')](_0x35b7('0x19'),_0x5cbda6);logger['debug'](_0x35b7('0x19'),_0x5cbda6,JSON[_0x35b7('0x1a')](_0x461e59));_0x48e96f(_0x461e59);})[_0x35b7('0x1b')](function(_0x2ea6c4){logger['error']('UpdateOpenchannelInteraction',_0x2ea6c4[_0x35b7('0x10')],_0x5cbda6);_0x467804(_0x573ae2['error'](0x1f4,_0x2ea6c4['message']));});});};exports[_0x35b7('0x1c')]=function(_0x3cbc3e){return new Promise(function(_0x602088,_0xe705d2){return db[_0x35b7('0x12')][_0x35b7('0x1d')]({'where':_0x3cbc3e[_0x35b7('0x14')]?_0x3cbc3e['options']['where']||null:null})[_0x35b7('0x18')](function(_0x179375){if(_0x179375){return _0x179375[_0x35b7('0x1e')](_0x3cbc3e['body'][_0x35b7('0x1f')],_[_0x35b7('0x20')](_0x3cbc3e[_0x35b7('0x21')],['ids','id'])||{});}})['spread'](function(_0x5de6e2){logger['info'](_0x35b7('0x22'),_0x3cbc3e);logger['debug']('AddTags',_0x3cbc3e,JSON[_0x35b7('0x1a')](_0x5de6e2));_0x602088(_0x5de6e2);})[_0x35b7('0x1b')](function(_0x533793){logger[_0x35b7('0xf')](_0x35b7('0x22'),_0x533793[_0x35b7('0x10')],_0x3cbc3e);_0xe705d2(_this['error'](0x1f4,_0x533793[_0x35b7('0x10')]));});});}; \ No newline at end of file +var _0x7fa5=['defaults','localhost','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','debug','stringify','OpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis'];(function(_0x41ec96,_0x39a862){var _0x5e1f39=function(_0x404a16){while(--_0x404a16){_0x41ec96['push'](_0x41ec96['shift']());}};_0x5e1f39(++_0x39a862);}(_0x7fa5,0xbc));var _0x57fa=function(_0x48b34e,_0x421293){_0x48b34e=_0x48b34e-0x0;var _0x3d4ed1=_0x7fa5[_0x48b34e];return _0x3d4ed1;};'use strict';var _=require(_0x57fa('0x0'));var util=require(_0x57fa('0x1'));var moment=require('moment');var BPromise=require(_0x57fa('0x2'));var rs=require(_0x57fa('0x3'));var fs=require('fs');var Redis=require(_0x57fa('0x4'));var db=require(_0x57fa('0x5'))['db'];var utils=require(_0x57fa('0x6'));var logger=require(_0x57fa('0x7'))(_0x57fa('0x8'));var config=require('../../config/environment');var jayson=require(_0x57fa('0x9'));var client=jayson[_0x57fa('0xa')]['http']({'port':0x232a});config[_0x57fa('0xb')]=_[_0x57fa('0xc')](config['redis'],{'host':_0x57fa('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x57fa('0xb')]));require('./openchannelInteraction.socket')[_0x57fa('0xe')](socket);function respondWithRpcPromise(_0x30ffbe,_0x75a8d0,_0xb87f23){return new BPromise(function(_0x354492,_0x1436b6){return client[_0x57fa('0xf')](_0x30ffbe,_0xb87f23)[_0x57fa('0x10')](function(_0x165948){logger[_0x57fa('0x11')](_0x57fa('0x12'),_0x75a8d0,'request\x20sent');logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x75a8d0,_0x57fa('0x13'),JSON['stringify'](_0x165948));if(_0x165948[_0x57fa('0x14')]){if(_0x165948[_0x57fa('0x14')][_0x57fa('0x15')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x75a8d0,_0x165948['error'][_0x57fa('0x16')]);return _0x1436b6(_0x165948[_0x57fa('0x14')]['message']);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x75a8d0,_0x165948[_0x57fa('0x14')][_0x57fa('0x16')]);return _0x354492(_0x165948['error'][_0x57fa('0x16')]);}else{logger[_0x57fa('0x11')](_0x57fa('0x12'),_0x75a8d0,'request\x20sent');_0x354492(_0x165948[_0x57fa('0x17')]['message']);}})[_0x57fa('0x18')](function(_0x167041){logger['error'](_0x57fa('0x12'),_0x75a8d0,_0x167041);_0x1436b6(_0x167041);});});}exports[_0x57fa('0x19')]=function(_0x511102){var _0x66872=this;return new Promise(function(_0x5a26af,_0x1d8ff3){return db['OpenchannelInteraction'][_0x57fa('0x1a')](_0x511102[_0x57fa('0x1b')],{'raw':_0x511102[_0x57fa('0x1c')]?_0x511102[_0x57fa('0x1c')][_0x57fa('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x511102[_0x57fa('0x1c')]?_0x511102[_0x57fa('0x1c')][_0x57fa('0x1e')]||null:null,'attributes':_0x511102[_0x57fa('0x1c')]?_0x511102[_0x57fa('0x1c')][_0x57fa('0x1f')]||null:null,'limit':_0x511102[_0x57fa('0x1c')]?_0x511102['options']['limit']||null:null})['then'](function(_0x3ea26d){logger[_0x57fa('0x11')](_0x57fa('0x19'),_0x511102);logger[_0x57fa('0x20')](_0x57fa('0x19'),_0x511102,JSON[_0x57fa('0x21')](_0x3ea26d));_0x5a26af(_0x3ea26d);})[_0x57fa('0x18')](function(_0x520904){logger[_0x57fa('0x14')](_0x57fa('0x19'),_0x520904[_0x57fa('0x16')],_0x511102);_0x1d8ff3(_0x66872[_0x57fa('0x14')](0x1f4,_0x520904[_0x57fa('0x16')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x216022){return new Promise(function(_0x5eb31c,_0x4a19f1){return db[_0x57fa('0x22')][_0x57fa('0x23')]({'where':_0x216022['options']?_0x216022['options'][_0x57fa('0x1e')]||null:null})[_0x57fa('0x10')](function(_0x30d4e0){if(_0x30d4e0){return _0x30d4e0['addTags'](_0x216022[_0x57fa('0x1b')][_0x57fa('0x24')],_[_0x57fa('0x25')](_0x216022[_0x57fa('0x1b')],[_0x57fa('0x24'),'id'])||{});}})[_0x57fa('0x26')](function(_0x4744f5){logger[_0x57fa('0x11')](_0x57fa('0x27'),_0x216022);logger[_0x57fa('0x20')](_0x57fa('0x27'),_0x216022,JSON[_0x57fa('0x21')](_0x4744f5));_0x5eb31c(_0x4744f5);})[_0x57fa('0x18')](function(_0x4040b2){logger[_0x57fa('0x14')](_0x57fa('0x27'),_0x4040b2[_0x57fa('0x16')],_0x216022);_0x4a19f1(_this[_0x57fa('0x14')](0x1f4,_0x4040b2[_0x57fa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index bdf0f3d..6e399a8 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 _0x2dc2=['./openchannelInteraction.events','removeListener','openchannelInteraction:'];(function(_0x52b523,_0x2df7f5){var _0x5c0566=function(_0x1b5aef){while(--_0x1b5aef){_0x52b523['push'](_0x52b523['shift']());}};_0x5c0566(++_0x2df7f5);}(_0x2dc2,0x1e6));var _0x22dc=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x2dc2[_0x54d4fe];return _0x1ab5bb;};'use strict';var OpenchannelInteractionEvents=require(_0x22dc('0x0'));var events=['save','remove','update'];function createListener(_0x86fa2d,_0x1540cb){return function(_0x452038){_0x1540cb['emit'](_0x86fa2d,_0x452038);};}function removeListener(_0x4c2323,_0x20c928){return function(){OpenchannelInteractionEvents[_0x22dc('0x1')](_0x4c2323,_0x20c928);};}exports['register']=function(_0x17db65){for(var _0x127f9d=0x0,_0x1bf1f3=events['length'];_0x127f9d<_0x1bf1f3;_0x127f9d++){var _0x341433=events[_0x127f9d];var _0x165e9c=createListener(_0x22dc('0x2')+_0x341433,_0x17db65);OpenchannelInteractionEvents['on'](_0x341433,_0x165e9c);}}; \ No newline at end of file +var _0xbbb5=['removeListener','register','save','remove','update'];(function(_0x415f7e,_0x4630b6){var _0x311ff4=function(_0x19c19d){while(--_0x19c19d){_0x415f7e['push'](_0x415f7e['shift']());}};_0x311ff4(++_0x4630b6);}(_0xbbb5,0xbb));var _0x5bbb=function(_0x1dda31,_0xf332cc){_0x1dda31=_0x1dda31-0x0;var _0x3f9c41=_0xbbb5[_0x1dda31];return _0x3f9c41;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x5bbb('0x0'),_0x5bbb('0x1'),_0x5bbb('0x2')];function createListener(_0x4b467,_0x2722ba){return function(_0x51d15f){_0x2722ba['emit'](_0x4b467,_0x51d15f);};}function removeListener(_0x3bc69f,_0x1cf08a){return function(){OpenchannelInteractionEvents[_0x5bbb('0x3')](_0x3bc69f,_0x1cf08a);};}exports[_0x5bbb('0x4')]=function(_0x3e7702){for(var _0x137f4e=0x0,_0x50f254=events['length'];_0x137f4e<_0x50f254;_0x137f4e++){var _0x18a910=events[_0x137f4e];var _0x2e914d=createListener('openchannelInteraction:'+_0x18a910,_0x3e7702);OpenchannelInteractionEvents['on'](_0x18a910,_0x2e914d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 14f914d..003ddc1 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 _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(_0x12dfb8,_0x50d25a){var _0x2e161a=function(_0x3d634c){while(--_0x3d634c){_0x12dfb8['push'](_0x12dfb8['shift']());}};_0x2e161a(++_0x50d25a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./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 +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x5a3aee,_0x54346d){_0x5a3aee=_0x5a3aee-0x0;var _0x514315=_0x70e0[_0x5a3aee];return _0x514315;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 68096c9..7d8eac1 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 _0x174b=['medium','BOOLEAN','ENUM','out','TEXT','sequelize'];(function(_0x20d6ee,_0x22ca72){var _0x220b36=function(_0x44ffc9){while(--_0x44ffc9){_0x20d6ee['push'](_0x20d6ee['shift']());}};_0x220b36(++_0x22ca72);}(_0x174b,0x19d));var _0xb174=function(_0xc73480,_0x5daa99){_0xc73480=_0xc73480-0x0;var _0x50eeaf=_0x174b[_0xc73480];return _0x50eeaf;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb174('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb174('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb174('0x3')]('in',_0xb174('0x4')),'defaultValue':_0xb174('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xb174('0x5')]}}; \ No newline at end of file +var _0x33d2=['STRING','sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x29fefa,_0x3c9ba0){var _0x530b05=function(_0xc21842){while(--_0xc21842){_0x29fefa['push'](_0x29fefa['shift']());}};_0x530b05(++_0x3c9ba0);}(_0x33d2,0x7f));var _0x233d=function(_0x483ba6,_0x70851b){_0x483ba6=_0x483ba6-0x0;var _0x45b9f3=_0x33d2[_0x483ba6];return _0x45b9f3;};'use strict';var Sequelize=require(_0x233d('0x0'));module[_0x233d('0x1')]={'body':{'type':Sequelize[_0x233d('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x233d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x233d('0x4')),'defaultValue':_0x233d('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x233d('0x5')]},'providerName':{'type':Sequelize[_0x233d('0x6')]},'providerResponse':{'type':Sequelize[_0x233d('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 4b32e62..1d764c1 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 _0x1c9c=['openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','read1stAt','user','interaction','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','role','null','RejectMessage','rejectMessage','sequelize','contact','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','create','body','find','describe'];(function(_0x218f90,_0x128f28){var _0x5b5a15=function(_0x1cb898){while(--_0x1cb898){_0x218f90['push'](_0x218f90['shift']());}};_0x5b5a15(++_0x128f28);}(_0x1c9c,0xa7));var _0xc1c9=function(_0x2583b2,_0x45a743){_0x2583b2=_0x2583b2-0x0;var _0xc1b07c=_0x1c9c[_0x2583b2];return _0xc1b07c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1c9('0x0'));var zipdir=require(_0xc1c9('0x1'));var jsonpatch=require(_0xc1c9('0x2'));var rp=require(_0xc1c9('0x3'));var moment=require('moment');var BPromise=require(_0xc1c9('0x4'));var Mustache=require(_0xc1c9('0x5'));var util=require(_0xc1c9('0x6'));var path=require(_0xc1c9('0x7'));var sox=require(_0xc1c9('0x8'));var csv=require(_0xc1c9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1c9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc1c9('0xb'));var jsforce=require(_0xc1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1c9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc1c9('0xd'));var authService=require(_0xc1c9('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1c9('0xf'));var logger=require(_0xc1c9('0x10'))(_0xc1c9('0x11'));var utils=require(_0xc1c9('0x12'));var config=require(_0xc1c9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c9('0x14'))['db'];config['redis']=_[_0xc1c9('0x15')](config[_0xc1c9('0x16')],{'host':_0xc1c9('0x17'),'port':0x18eb});var socket=require(_0xc1c9('0x18'))(new Redis(config[_0xc1c9('0x16')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0xc1c9('0x19'));var client=jayson[_0xc1c9('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0xc1c9('0x1a')][_0xc1c9('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1abd7a,_0x3a0947,_0x35a90a,_0x12f51a){return new BPromise(function(_0x3bc28c,_0x507ea4){var _0xe29a5a=_0x12f51a||client;return _0xe29a5a[_0xc1c9('0x1c')](_0x1abd7a,_0x35a90a)[_0xc1c9('0x1d')](function(_0x504351){logger[_0xc1c9('0x1e')](_0xc1c9('0x1f'),_0x3a0947,_0xc1c9('0x20'));logger[_0xc1c9('0x21')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3a0947,_0xc1c9('0x20'),JSON[_0xc1c9('0x22')](_0x504351));if(_0x504351[_0xc1c9('0x23')]){if(_0x504351[_0xc1c9('0x23')][_0xc1c9('0x24')]===0x1f4){logger[_0xc1c9('0x23')](_0xc1c9('0x1f'),_0x3a0947,_0x504351['error'][_0xc1c9('0x25')]);return _0x507ea4(_0x504351[_0xc1c9('0x23')]['message']);}logger[_0xc1c9('0x23')](_0xc1c9('0x1f'),_0x3a0947,_0x504351[_0xc1c9('0x23')][_0xc1c9('0x25')]);return _0x3bc28c(_0x504351[_0xc1c9('0x23')][_0xc1c9('0x25')]);}else{logger[_0xc1c9('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x3a0947,'request\x20sent');_0x3bc28c(_0x504351['result'][_0xc1c9('0x25')]);}})[_0xc1c9('0x26')](function(_0x517381){logger[_0xc1c9('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x3a0947,_0x517381);_0x507ea4(_0x517381);});});}function respondWithStatusCode(_0x1571e4,_0x3fbc2c){_0x3fbc2c=_0x3fbc2c||0xcc;return function(_0x5622b2){if(_0x5622b2){return _0x1571e4[_0xc1c9('0x27')](_0x3fbc2c);}return _0x1571e4['status'](_0x3fbc2c)[_0xc1c9('0x28')]();};}function respondWithResult(_0x2bf744,_0x460e1c){_0x460e1c=_0x460e1c||0xc8;return function(_0x357671){if(_0x357671){return _0x2bf744[_0xc1c9('0x29')](_0x460e1c)[_0xc1c9('0x2a')](_0x357671);}};}function respondWithFilteredResult(_0x367559,_0x39e875){return function(_0x472a5b){if(_0x472a5b){var _0x1c261b=typeof _0x39e875[_0xc1c9('0x2b')]===_0xc1c9('0x2c')&&typeof _0x39e875[_0xc1c9('0x2d')]==='undefined';var _0x46b6b7=_0x472a5b[_0xc1c9('0x2e')];var _0x31a2d9=_0x1c261b?0x0:_0x39e875['offset'];var _0x2d6b20=_0x1c261b?_0x472a5b[_0xc1c9('0x2e')]:_0x39e875[_0xc1c9('0x2b')]+_0x39e875['limit'];var _0x5335c3;if(_0x2d6b20>=_0x46b6b7){_0x2d6b20=_0x46b6b7;_0x5335c3=0xc8;}else{_0x5335c3=0xce;}_0x367559['status'](_0x5335c3);return _0x367559['set'](_0xc1c9('0x2f'),_0x31a2d9+'-'+_0x2d6b20+'/'+_0x46b6b7)[_0xc1c9('0x2a')](_0x472a5b);}return null;};}function patchUpdates(_0x5d70bf){return function(_0x47b3b5){try{jsonpatch[_0xc1c9('0x30')](_0x47b3b5,_0x5d70bf,!![]);}catch(_0x34424d){return BPromise['reject'](_0x34424d);}return _0x47b3b5[_0xc1c9('0x31')]();};}function saveUpdates(_0x38bcfe,_0x4d70cd){return function(_0x484449){if(_0x484449){return _0x484449[_0xc1c9('0x32')](_0x38bcfe)['then'](function(_0xa75f02){return _0xa75f02;});}return null;};}function removeEntity(_0x2252b9,_0x5e6c78){return function(_0x4efe3d){if(_0x4efe3d){return _0x4efe3d[_0xc1c9('0x33')]()['then'](function(){_0x2252b9[_0xc1c9('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4622cc,_0x35b1c7){return function(_0x28e960){if(!_0x28e960){_0x4622cc[_0xc1c9('0x27')](0x194);}return _0x28e960;};}function handleError(_0x52f39e,_0x2322e3){_0x2322e3=_0x2322e3||0x1f4;return function(_0x7ca0e3){logger[_0xc1c9('0x23')](_0x7ca0e3[_0xc1c9('0x34')]);if(_0x7ca0e3[_0xc1c9('0x35')]){delete _0x7ca0e3['name'];}_0x52f39e['status'](_0x2322e3)[_0xc1c9('0x36')](_0x7ca0e3);};}exports[_0xc1c9('0x37')]=function(_0x592ca6,_0x3a8537){var _0x1652a7={},_0xadb97e={},_0x2a522e={'count':0x0,'rows':[]};var _0x2d9627=_[_0xc1c9('0x38')](db[_0xc1c9('0x39')]['rawAttributes'],function(_0x142cb8){return{'name':_0x142cb8[_0xc1c9('0x3a')],'type':_0x142cb8[_0xc1c9('0x3b')][_0xc1c9('0x3c')]};});_0xadb97e['model']=_['map'](_0x2d9627,_0xc1c9('0x35'));_0xadb97e[_0xc1c9('0x3d')]=_[_0xc1c9('0x3e')](_0x592ca6[_0xc1c9('0x3d')]);_0xadb97e['filters']=_[_0xc1c9('0x3f')](_0xadb97e[_0xc1c9('0x40')],_0xadb97e[_0xc1c9('0x3d')]);_0x1652a7['attributes']=_['intersection'](_0xadb97e['model'],qs['fields'](_0x592ca6[_0xc1c9('0x3d')][_0xc1c9('0x41')]));_0x1652a7[_0xc1c9('0x42')]=_0x1652a7['attributes'][_0xc1c9('0x43')]?_0x1652a7[_0xc1c9('0x42')]:_0xadb97e[_0xc1c9('0x40')];if(!_0x592ca6[_0xc1c9('0x3d')][_0xc1c9('0x44')](_0xc1c9('0x45'))){_0x1652a7[_0xc1c9('0x2d')]=qs['limit'](_0x592ca6[_0xc1c9('0x3d')][_0xc1c9('0x2d')]);_0x1652a7[_0xc1c9('0x2b')]=qs[_0xc1c9('0x2b')](_0x592ca6[_0xc1c9('0x3d')]['offset']);}_0x1652a7[_0xc1c9('0x46')]=qs['sort'](_0x592ca6[_0xc1c9('0x3d')][_0xc1c9('0x47')]);_0x1652a7[_0xc1c9('0x48')]=qs[_0xc1c9('0x49')](_[_0xc1c9('0x4a')](_0x592ca6[_0xc1c9('0x3d')],_0xadb97e[_0xc1c9('0x49')]),_0x2d9627);if(_0x592ca6[_0xc1c9('0x3d')]['filter']){_0x1652a7[_0xc1c9('0x48')]=_['merge'](_0x1652a7[_0xc1c9('0x48')],{'$or':_[_0xc1c9('0x38')](_0x2d9627,function(_0x3d9539){if(_0x3d9539['type']!==_0xc1c9('0x4b')){var _0x1a7970={};_0x1a7970[_0x3d9539['name']]={'$like':'%'+_0x592ca6[_0xc1c9('0x3d')][_0xc1c9('0x4c')]+'%'};return _0x1a7970;}})});}_0x1652a7=_[_0xc1c9('0x4d')]({},_0x1652a7,_0x592ca6[_0xc1c9('0x4e')]);var _0x2a5deb={'where':_0x1652a7[_0xc1c9('0x48')]};return db[_0xc1c9('0x39')][_0xc1c9('0x2e')](_0x2a5deb)[_0xc1c9('0x1d')](function(_0x24cd50){_0x2a522e[_0xc1c9('0x2e')]=_0x24cd50;if(_0x592ca6[_0xc1c9('0x3d')][_0xc1c9('0x4f')]){_0x1652a7[_0xc1c9('0x50')]=[{'all':!![]}];}return db[_0xc1c9('0x39')][_0xc1c9('0x51')](_0x1652a7);})[_0xc1c9('0x1d')](function(_0x589b3e){_0x2a522e[_0xc1c9('0x52')]=_0x589b3e;return _0x2a522e;})[_0xc1c9('0x1d')](respondWithFilteredResult(_0x3a8537,_0x1652a7))['catch'](handleError(_0x3a8537,null));};exports['show']=function(_0x44ce26,_0x503202){var _0x185e26={'raw':!![],'where':{'id':_0x44ce26[_0xc1c9('0x53')]['id']}},_0x3dbd55={};_0x3dbd55['model']=_[_0xc1c9('0x3e')](db[_0xc1c9('0x39')][_0xc1c9('0x54')]);_0x3dbd55['query']=_[_0xc1c9('0x3e')](_0x44ce26[_0xc1c9('0x3d')]);_0x3dbd55[_0xc1c9('0x49')]=_['intersection'](_0x3dbd55[_0xc1c9('0x40')],_0x3dbd55['query']);_0x185e26[_0xc1c9('0x42')]=_['intersection'](_0x3dbd55[_0xc1c9('0x40')],qs[_0xc1c9('0x41')](_0x44ce26[_0xc1c9('0x3d')][_0xc1c9('0x41')]));_0x185e26[_0xc1c9('0x42')]=_0x185e26[_0xc1c9('0x42')][_0xc1c9('0x43')]?_0x185e26[_0xc1c9('0x42')]:_0x3dbd55['model'];if(_0x44ce26[_0xc1c9('0x3d')][_0xc1c9('0x4f')]){_0x185e26[_0xc1c9('0x50')]=[{'all':!![]}];}_0x185e26=_[_0xc1c9('0x4d')]({},_0x185e26,_0x44ce26[_0xc1c9('0x4e')]);return db[_0xc1c9('0x39')]['find'](_0x185e26)[_0xc1c9('0x1d')](handleEntityNotFound(_0x503202,null))['then'](respondWithResult(_0x503202,null))['catch'](handleError(_0x503202,null));};exports[_0xc1c9('0x55')]=function(_0x465553,_0x41a605){return db[_0xc1c9('0x39')]['create'](_0x465553[_0xc1c9('0x56')],{})[_0xc1c9('0x1d')](respondWithResult(_0x41a605,0xc9))[_0xc1c9('0x26')](handleError(_0x41a605,null));};exports[_0xc1c9('0x32')]=function(_0x158b4e,_0x500d92){if(_0x158b4e[_0xc1c9('0x56')]['id']){delete _0x158b4e['body']['id'];}return db[_0xc1c9('0x39')][_0xc1c9('0x57')]({'where':{'id':_0x158b4e[_0xc1c9('0x53')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x500d92,null))[_0xc1c9('0x1d')](saveUpdates(_0x158b4e['body'],null))[_0xc1c9('0x1d')](respondWithResult(_0x500d92,null))['catch'](handleError(_0x500d92,null));};exports['destroy']=function(_0x3687cc,_0xd9c56f){return db[_0xc1c9('0x39')][_0xc1c9('0x57')]({'where':{'id':_0x3687cc[_0xc1c9('0x53')]['id']}})[_0xc1c9('0x1d')](handleEntityNotFound(_0xd9c56f,null))['then'](removeEntity(_0xd9c56f,null))[_0xc1c9('0x26')](handleError(_0xd9c56f,null));};exports[_0xc1c9('0x58')]=function(_0xf40951,_0x2fd1cd){return db[_0xc1c9('0x39')][_0xc1c9('0x58')]()['then'](respondWithResult(_0x2fd1cd,null))[_0xc1c9('0x26')](handleError(_0x2fd1cd,null));};var interaction_log=require(_0xc1c9('0x10'))(_0xc1c9('0x59'));exports[_0xc1c9('0x5a')]=function(_0x57eaae,_0x4329d4,_0x58255b){var _0x3fced9={'agent':{},'channel':_0xc1c9('0x5b')};if(_0x57eaae[_0xc1c9('0x56')]['id']){delete _0x57eaae['body']['id'];}_0x57eaae[_0xc1c9('0x56')][_0xc1c9('0x5c')]=!![];_0x57eaae['body']['readAt']=moment()[_0xc1c9('0x5d')](_0xc1c9('0x5e'));_0x57eaae[_0xc1c9('0x56')]['UserId']=_0x57eaae[_0xc1c9('0x56')][_0xc1c9('0x5f')]||_0x57eaae['user']['id'];_0x3fced9[_0xc1c9('0x60')]['id']=_0x57eaae['body'][_0xc1c9('0x5f')];return db['OpenchannelMessage'][_0xc1c9('0x57')]({'where':{'id':_0x57eaae[_0xc1c9('0x53')]['id'],'UserId':null}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x4329d4,null))[_0xc1c9('0x1d')](saveUpdates(_0x57eaae[_0xc1c9('0x56')],null))[_0xc1c9('0x1d')](function(_0x1439e6){if(_0x1439e6){_0x3fced9['message']=_0x1439e6[_0xc1c9('0x61')]({'plain':!![]});return db[_0xc1c9('0x62')][_0xc1c9('0x57')]({'where':{'id':_0x1439e6['OpenchannelInteractionId']}});}return null;})[_0xc1c9('0x1d')](handleEntityNotFound(_0x4329d4,null))[_0xc1c9('0x1d')](function(_0x313dbb){if(_0x313dbb){return _0x313dbb[_0xc1c9('0x32')]({'UserId':_0x57eaae[_0xc1c9('0x56')][_0xc1c9('0x5f')],'read1stAt':_['isNil'](_0x313dbb[_0xc1c9('0x63')])?moment()[_0xc1c9('0x5d')](_0xc1c9('0x5e')):undefined});}return null;})[_0xc1c9('0x1d')](function(_0x258f4f){if(_0x258f4f){_0x3fced9['interaction']=_0x258f4f[_0xc1c9('0x61')]({'plain':!![]});interaction_log[_0xc1c9('0x1e')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x57eaae[_0xc1c9('0x64')]['id'],_0x57eaae[_0xc1c9('0x64')][_0xc1c9('0x35')],_0x57eaae['user']['role'],_0x3fced9[_0xc1c9('0x65')]['id'],_0x57eaae[_0xc1c9('0x56')]?JSON[_0xc1c9('0x22')](_0x57eaae[_0xc1c9('0x56')]):'null');return respondWithRpcPromise('AcceptMessage',_0xc1c9('0x66'),_0x3fced9);}return null;})[_0xc1c9('0x1d')](function(_0x2388e8){var _0x2fd02b=_0xc1c9('0x67')+_0x2388e8[_0xc1c9('0x25')][_0xc1c9('0x68')];return db['sequelize'][_0xc1c9('0x3d')](_0x2fd02b,{'type':db[_0xc1c9('0x69')][_0xc1c9('0x6a')][_0xc1c9('0x6b')],'raw':!![]})[_0xc1c9('0x1d')](function(_0x434620){return _0x434620;});})[_0xc1c9('0x1d')](function(_0x4fb8b1){if(_0x4fb8b1){_0x3fced9[_0xc1c9('0x25')]['contact']=_0x4fb8b1[0x0];if(!_0x57eaae['body'][_0xc1c9('0x5f')])return;return db[_0xc1c9('0x6c')][_0xc1c9('0x57')]({'where':{'id':_0x57eaae[_0xc1c9('0x56')]['UserId'],'role':_0xc1c9('0x60')},'attributes':['id',_0xc1c9('0x35'),_0xc1c9('0x6d'),_0xc1c9('0x6e'),_0xc1c9('0x6f')],'raw':!![]});}return null;})[_0xc1c9('0x1d')](function(_0x582c79){if(!_0x582c79)return null;_0x3fced9['message'][_0xc1c9('0x60')]=_0x582c79;return _0x3fced9;})['then'](function(_0x490f11){if(_0x490f11){if(_0x57eaae[_0xc1c9('0x56')][_0xc1c9('0x70')]){_0x3fced9[_0xc1c9('0x25')][_0xc1c9('0x71')]=util[_0xc1c9('0x5d')](_0xc1c9('0x72'),_0x57eaae[_0xc1c9('0x64')]['name']);_0x3fced9[_0xc1c9('0x25')]['channel']=_0x3fced9[_0xc1c9('0x73')];_0x3fced9[_0xc1c9('0x25')][_0xc1c9('0x74')]=_0x3fced9[_0xc1c9('0x73')];_0x3fced9[_0xc1c9('0x25')][_0xc1c9('0x75')]=_0xc1c9('0x5a');return respondWithRpcPromise(_0xc1c9('0x76'),_0xc1c9('0x76'),{'event':_0xc1c9('0x77'),'message':_0x3fced9[_0xc1c9('0x25')]},client9002)[_0xc1c9('0x1d')](function(){return _0x3fced9;});}return _0x3fced9;}return null;})[_0xc1c9('0x1d')](respondWithResult(_0x4329d4,null))[_0xc1c9('0x26')](handleError(_0x4329d4,null));};var interaction_log=require(_0xc1c9('0x10'))(_0xc1c9('0x59'));exports['reject']=function(_0x462c3b,_0x4d8d17,_0xbdc146){var _0x81d888={'agent':{},'channel':'openchannel'};if(_0x462c3b[_0xc1c9('0x56')]['id']){delete _0x462c3b[_0xc1c9('0x56')]['id'];}_0x462c3b[_0xc1c9('0x56')][_0xc1c9('0x5f')]=_0x462c3b[_0xc1c9('0x56')][_0xc1c9('0x5f')]||_0x462c3b[_0xc1c9('0x64')]['id'];_0x81d888[_0xc1c9('0x60')]['id']=_0x462c3b['body'][_0xc1c9('0x5f')];return db[_0xc1c9('0x39')][_0xc1c9('0x57')]({'where':{'id':_0x462c3b[_0xc1c9('0x53')]['id'],'UserId':null}})[_0xc1c9('0x1d')](handleEntityNotFound(_0x4d8d17,null))[_0xc1c9('0x1d')](function(_0x4dea82){if(_0x4dea82){_0x81d888[_0xc1c9('0x25')]=_0x4dea82[_0xc1c9('0x61')]({'plain':!![]});return db[_0xc1c9('0x62')]['find']({'where':{'id':_0x4dea82[_0xc1c9('0x78')]}});}return null;})[_0xc1c9('0x1d')](handleEntityNotFound(_0x4d8d17,null))[_0xc1c9('0x1d')](function(_0x1fac23){if(_0x1fac23){_0x81d888[_0xc1c9('0x65')]=_0x1fac23[_0xc1c9('0x61')]({'plain':!![]});interaction_log[_0xc1c9('0x1e')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x462c3b['user']['id'],_0x462c3b[_0xc1c9('0x64')][_0xc1c9('0x35')],_0x462c3b['user'][_0xc1c9('0x79')],_0x81d888[_0xc1c9('0x65')]['id'],_0x462c3b['body']?JSON[_0xc1c9('0x22')](_0x462c3b[_0xc1c9('0x56')]):_0xc1c9('0x7a'));return respondWithRpcPromise(_0xc1c9('0x7b'),_0xc1c9('0x7c'),_0x81d888);}return null;})['then'](function(_0x124328){var _0x536fd7=_0xc1c9('0x67')+_0x124328[_0xc1c9('0x25')][_0xc1c9('0x68')];return db[_0xc1c9('0x7d')]['query'](_0x536fd7,{'type':db[_0xc1c9('0x69')][_0xc1c9('0x6a')][_0xc1c9('0x6b')],'raw':!![]})[_0xc1c9('0x1d')](function(_0x2f29ee){return _0x2f29ee;});})[_0xc1c9('0x1d')](function(_0x2766e4){if(_0x2766e4){_0x81d888[_0xc1c9('0x25')][_0xc1c9('0x7e')]=_0x2766e4[0x0];if(!_0x462c3b[_0xc1c9('0x56')]['UserId'])return;return db[_0xc1c9('0x6c')][_0xc1c9('0x57')]({'where':{'id':_0x462c3b[_0xc1c9('0x56')][_0xc1c9('0x5f')],'role':_0xc1c9('0x60')},'attributes':['id','name',_0xc1c9('0x6d'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x228b9){if(!_0x228b9)return null;_0x81d888[_0xc1c9('0x25')][_0xc1c9('0x60')]=_0x228b9;return _0x81d888;})[_0xc1c9('0x1d')](function(_0x582f83){if(_0x582f83){_0x582f83[_0xc1c9('0x25')][_0xc1c9('0x71')]=util['format'](_0xc1c9('0x72'),_0x462c3b[_0xc1c9('0x64')]['name']);_0x582f83[_0xc1c9('0x25')]['channel']=_0x81d888[_0xc1c9('0x73')];_0x582f83[_0xc1c9('0x25')][_0xc1c9('0x74')]=_0x81d888['channel'];_0x582f83['message'][_0xc1c9('0x75')]='reject';respondWithRpcPromise(_0xc1c9('0x76'),_0xc1c9('0x76'),{'event':_0xc1c9('0x7f'),'message':_0x582f83[_0xc1c9('0x25')]},client9002);return _0x81d888;}return null;})['then'](respondWithResult(_0x4d8d17,null))[_0xc1c9('0x26')](handleError(_0x4d8d17,null));}; \ No newline at end of file +var _0xcbe7=['OpenchannelMessage','rawAttributes','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','filter','merge','type','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteractionId','isNil','read1stAt','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','User','motionChannel','event','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','index','map'];(function(_0x20259c,_0xe43fb2){var _0x4d988e=function(_0x2097b9){while(--_0x2097b9){_0x20259c['push'](_0x20259c['shift']());}};_0x4d988e(++_0xe43fb2);}(_0xcbe7,0x152));var _0x7cbe=function(_0xd8a448,_0x25c7a2){_0xd8a448=_0xd8a448-0x0;var _0x4771df=_0xcbe7[_0xd8a448];return _0x4771df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7cbe('0x0'));var zipdir=require(_0x7cbe('0x1'));var jsonpatch=require(_0x7cbe('0x2'));var rp=require(_0x7cbe('0x3'));var moment=require(_0x7cbe('0x4'));var BPromise=require(_0x7cbe('0x5'));var Mustache=require(_0x7cbe('0x6'));var util=require('util');var path=require(_0x7cbe('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7cbe('0x8'));var fs=require('fs');var fs_extra=require(_0x7cbe('0x9'));var _=require(_0x7cbe('0xa'));var squel=require(_0x7cbe('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7cbe('0xc'));var toCsv=require(_0x7cbe('0xd'));var querystring=require(_0x7cbe('0xe'));var Papa=require(_0x7cbe('0xf'));var Redis=require(_0x7cbe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7cbe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7cbe('0x12'));var logger=require(_0x7cbe('0x13'))(_0x7cbe('0x14'));var utils=require('../../config/utils');var config=require(_0x7cbe('0x15'));var licenseUtil=require(_0x7cbe('0x16'));var db=require(_0x7cbe('0x17'))['db'];config[_0x7cbe('0x18')]=_[_0x7cbe('0x19')](config[_0x7cbe('0x18')],{'host':_0x7cbe('0x1a'),'port':0x18eb});var socket=require(_0x7cbe('0x1b'))(new Redis(config['redis']));require(_0x7cbe('0x1c'))[_0x7cbe('0x1d')](socket);var jayson=require(_0x7cbe('0x1e'));var client=jayson[_0x7cbe('0x1f')][_0x7cbe('0x20')]({'port':0x232c});var client9002=jayson[_0x7cbe('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e4982,_0x30776a,_0x1f743f,_0x140d8f){return new BPromise(function(_0x3e1c92,_0x323a93){var _0x2d7e48=_0x140d8f||client;return _0x2d7e48[_0x7cbe('0x21')](_0x2e4982,_0x1f743f)[_0x7cbe('0x22')](function(_0x3020cd){logger[_0x7cbe('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x30776a,'request\x20sent');logger[_0x7cbe('0x24')](_0x7cbe('0x25'),_0x30776a,_0x7cbe('0x26'),JSON[_0x7cbe('0x27')](_0x3020cd));if(_0x3020cd[_0x7cbe('0x28')]){if(_0x3020cd['error'][_0x7cbe('0x29')]===0x1f4){logger[_0x7cbe('0x28')](_0x7cbe('0x2a'),_0x30776a,_0x3020cd[_0x7cbe('0x28')][_0x7cbe('0x2b')]);return _0x323a93(_0x3020cd[_0x7cbe('0x28')][_0x7cbe('0x2b')]);}logger['error'](_0x7cbe('0x2a'),_0x30776a,_0x3020cd['error'][_0x7cbe('0x2b')]);return _0x3e1c92(_0x3020cd[_0x7cbe('0x28')][_0x7cbe('0x2b')]);}else{logger[_0x7cbe('0x23')](_0x7cbe('0x2a'),_0x30776a,'request\x20sent');_0x3e1c92(_0x3020cd[_0x7cbe('0x2c')][_0x7cbe('0x2b')]);}})[_0x7cbe('0x2d')](function(_0xdf861e){logger[_0x7cbe('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x30776a,_0xdf861e);_0x323a93(_0xdf861e);});});}function respondWithStatusCode(_0xacc421,_0x34acb4){_0x34acb4=_0x34acb4||0xcc;return function(_0x177d71){if(_0x177d71){return _0xacc421[_0x7cbe('0x2e')](_0x34acb4);}return _0xacc421[_0x7cbe('0x2f')](_0x34acb4)[_0x7cbe('0x30')]();};}function respondWithResult(_0x1daa8f,_0x54f9b9){_0x54f9b9=_0x54f9b9||0xc8;return function(_0x5abcbf){if(_0x5abcbf){return _0x1daa8f[_0x7cbe('0x2f')](_0x54f9b9)[_0x7cbe('0x31')](_0x5abcbf);}};}function respondWithFilteredResult(_0x26e1f8,_0x20bdb9){return function(_0xd181){if(_0xd181){var _0x2a0324=typeof _0x20bdb9[_0x7cbe('0x32')]===_0x7cbe('0x33')&&typeof _0x20bdb9[_0x7cbe('0x34')]===_0x7cbe('0x33');var _0x2796f7=_0xd181['count'];var _0x4dafeb=_0x2a0324?0x0:_0x20bdb9[_0x7cbe('0x32')];var _0x43b4d7=_0x2a0324?_0xd181[_0x7cbe('0x35')]:_0x20bdb9['offset']+_0x20bdb9[_0x7cbe('0x34')];var _0x3e331d;if(_0x43b4d7>=_0x2796f7){_0x43b4d7=_0x2796f7;_0x3e331d=0xc8;}else{_0x3e331d=0xce;}_0x26e1f8[_0x7cbe('0x2f')](_0x3e331d);return _0x26e1f8[_0x7cbe('0x36')](_0x7cbe('0x37'),_0x4dafeb+'-'+_0x43b4d7+'/'+_0x2796f7)[_0x7cbe('0x31')](_0xd181);}return null;};}function patchUpdates(_0x5805ec){return function(_0xfaedfa){try{jsonpatch['apply'](_0xfaedfa,_0x5805ec,!![]);}catch(_0x1c71b2){return BPromise[_0x7cbe('0x38')](_0x1c71b2);}return _0xfaedfa[_0x7cbe('0x39')]();};}function saveUpdates(_0x346ad6,_0x142aed){return function(_0x594b76){if(_0x594b76){return _0x594b76[_0x7cbe('0x3a')](_0x346ad6)[_0x7cbe('0x22')](function(_0x39cb31){return _0x39cb31;});}return null;};}function removeEntity(_0x2259b5,_0x26c252){return function(_0x52d918){if(_0x52d918){return _0x52d918[_0x7cbe('0x3b')]()[_0x7cbe('0x22')](function(){_0x2259b5['status'](0xcc)[_0x7cbe('0x30')]();});}};}function handleEntityNotFound(_0x1baf65,_0x27a193){return function(_0xf56f2){if(!_0xf56f2){_0x1baf65[_0x7cbe('0x2e')](0x194);}return _0xf56f2;};}function handleError(_0xe412b7,_0x53e7d8){_0x53e7d8=_0x53e7d8||0x1f4;return function(_0x20db4b){logger[_0x7cbe('0x28')](_0x20db4b[_0x7cbe('0x3c')]);if(_0x20db4b[_0x7cbe('0x3d')]){delete _0x20db4b[_0x7cbe('0x3d')];}_0xe412b7[_0x7cbe('0x2f')](_0x53e7d8)['send'](_0x20db4b);};}exports[_0x7cbe('0x3e')]=function(_0x6f482c,_0x2f3b76){var _0x1341fb={},_0x5ed7b1={},_0x23341b={'count':0x0,'rows':[]};var _0x34bf70=_[_0x7cbe('0x3f')](db[_0x7cbe('0x40')][_0x7cbe('0x41')],function(_0x62371e){return{'name':_0x62371e[_0x7cbe('0x42')],'type':_0x62371e['type']['key']};});_0x5ed7b1[_0x7cbe('0x43')]=_[_0x7cbe('0x3f')](_0x34bf70,'name');_0x5ed7b1[_0x7cbe('0x44')]=_['keys'](_0x6f482c[_0x7cbe('0x44')]);_0x5ed7b1[_0x7cbe('0x45')]=_['intersection'](_0x5ed7b1['model'],_0x5ed7b1[_0x7cbe('0x44')]);_0x1341fb[_0x7cbe('0x46')]=_[_0x7cbe('0x47')](_0x5ed7b1[_0x7cbe('0x43')],qs['fields'](_0x6f482c[_0x7cbe('0x44')][_0x7cbe('0x48')]));_0x1341fb[_0x7cbe('0x46')]=_0x1341fb[_0x7cbe('0x46')][_0x7cbe('0x49')]?_0x1341fb[_0x7cbe('0x46')]:_0x5ed7b1['model'];if(!_0x6f482c['query'][_0x7cbe('0x4a')]('nolimit')){_0x1341fb[_0x7cbe('0x34')]=qs[_0x7cbe('0x34')](_0x6f482c['query'][_0x7cbe('0x34')]);_0x1341fb[_0x7cbe('0x32')]=qs['offset'](_0x6f482c[_0x7cbe('0x44')][_0x7cbe('0x32')]);}_0x1341fb['order']=qs[_0x7cbe('0x4b')](_0x6f482c[_0x7cbe('0x44')][_0x7cbe('0x4b')]);_0x1341fb['where']=qs[_0x7cbe('0x45')](_['pick'](_0x6f482c[_0x7cbe('0x44')],_0x5ed7b1[_0x7cbe('0x45')]),_0x34bf70);if(_0x6f482c['query'][_0x7cbe('0x4c')]){_0x1341fb['where']=_[_0x7cbe('0x4d')](_0x1341fb['where'],{'$or':_[_0x7cbe('0x3f')](_0x34bf70,function(_0x20427c){if(_0x20427c[_0x7cbe('0x4e')]!==_0x7cbe('0x4f')){var _0x135bf0={};_0x135bf0[_0x20427c[_0x7cbe('0x3d')]]={'$like':'%'+_0x6f482c[_0x7cbe('0x44')][_0x7cbe('0x4c')]+'%'};return _0x135bf0;}})});}_0x1341fb=_[_0x7cbe('0x4d')]({},_0x1341fb,_0x6f482c[_0x7cbe('0x50')]);var _0x1516fc={'where':_0x1341fb[_0x7cbe('0x51')]};return db[_0x7cbe('0x40')][_0x7cbe('0x35')](_0x1516fc)['then'](function(_0x3fefab){_0x23341b[_0x7cbe('0x35')]=_0x3fefab;if(_0x6f482c[_0x7cbe('0x44')][_0x7cbe('0x52')]){_0x1341fb[_0x7cbe('0x53')]=[{'all':!![]}];}return db[_0x7cbe('0x40')][_0x7cbe('0x54')](_0x1341fb);})[_0x7cbe('0x22')](function(_0x1053fc){_0x23341b[_0x7cbe('0x55')]=_0x1053fc;return _0x23341b;})[_0x7cbe('0x22')](respondWithFilteredResult(_0x2f3b76,_0x1341fb))[_0x7cbe('0x2d')](handleError(_0x2f3b76,null));};exports[_0x7cbe('0x56')]=function(_0x355d51,_0x3af550){var _0x282c35={'raw':!![],'where':{'id':_0x355d51[_0x7cbe('0x57')]['id']}},_0x2f359c={};_0x2f359c['model']=_[_0x7cbe('0x58')](db[_0x7cbe('0x40')][_0x7cbe('0x41')]);_0x2f359c[_0x7cbe('0x44')]=_['keys'](_0x355d51[_0x7cbe('0x44')]);_0x2f359c[_0x7cbe('0x45')]=_[_0x7cbe('0x47')](_0x2f359c['model'],_0x2f359c[_0x7cbe('0x44')]);_0x282c35[_0x7cbe('0x46')]=_[_0x7cbe('0x47')](_0x2f359c[_0x7cbe('0x43')],qs['fields'](_0x355d51[_0x7cbe('0x44')][_0x7cbe('0x48')]));_0x282c35[_0x7cbe('0x46')]=_0x282c35[_0x7cbe('0x46')][_0x7cbe('0x49')]?_0x282c35['attributes']:_0x2f359c[_0x7cbe('0x43')];if(_0x355d51[_0x7cbe('0x44')][_0x7cbe('0x52')]){_0x282c35['include']=[{'all':!![]}];}_0x282c35=_['merge']({},_0x282c35,_0x355d51['options']);return db['OpenchannelMessage'][_0x7cbe('0x59')](_0x282c35)[_0x7cbe('0x22')](handleEntityNotFound(_0x3af550,null))[_0x7cbe('0x22')](respondWithResult(_0x3af550,null))[_0x7cbe('0x2d')](handleError(_0x3af550,null));};exports[_0x7cbe('0x5a')]=function(_0x25450f,_0x396831){return db[_0x7cbe('0x40')][_0x7cbe('0x5a')](_0x25450f[_0x7cbe('0x5b')],{})[_0x7cbe('0x22')](respondWithResult(_0x396831,0xc9))[_0x7cbe('0x2d')](handleError(_0x396831,null));};exports[_0x7cbe('0x3a')]=function(_0x157d32,_0x17e0ad){if(_0x157d32['body']['id']){delete _0x157d32[_0x7cbe('0x5b')]['id'];}return db['OpenchannelMessage'][_0x7cbe('0x59')]({'where':{'id':_0x157d32[_0x7cbe('0x57')]['id']}})[_0x7cbe('0x22')](handleEntityNotFound(_0x17e0ad,null))['then'](saveUpdates(_0x157d32[_0x7cbe('0x5b')],null))['then'](respondWithResult(_0x17e0ad,null))['catch'](handleError(_0x17e0ad,null));};exports[_0x7cbe('0x3b')]=function(_0x5ac557,_0x2c2305){return db[_0x7cbe('0x40')][_0x7cbe('0x59')]({'where':{'id':_0x5ac557[_0x7cbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x2c2305,null))[_0x7cbe('0x22')](removeEntity(_0x2c2305,null))[_0x7cbe('0x2d')](handleError(_0x2c2305,null));};exports[_0x7cbe('0x5c')]=function(_0x2e6bff,_0x46fd51){return db[_0x7cbe('0x40')][_0x7cbe('0x5c')]()[_0x7cbe('0x22')](respondWithResult(_0x46fd51,null))[_0x7cbe('0x2d')](handleError(_0x46fd51,null));};var interaction_log=require(_0x7cbe('0x13'))(_0x7cbe('0x5d'));exports[_0x7cbe('0x5e')]=function(_0x204946,_0x2c068a,_0x488252){var _0x40a478={'agent':{},'channel':_0x7cbe('0x5f')};if(_0x204946['body']['id']){delete _0x204946[_0x7cbe('0x5b')]['id'];}_0x204946['body'][_0x7cbe('0x60')]=!![];_0x204946[_0x7cbe('0x5b')]['readAt']=moment()[_0x7cbe('0x61')](_0x7cbe('0x62'));_0x204946[_0x7cbe('0x5b')]['UserId']=_0x204946[_0x7cbe('0x5b')][_0x7cbe('0x63')]||_0x204946['user']['id'];_0x40a478[_0x7cbe('0x64')]['id']=_0x204946[_0x7cbe('0x5b')]['UserId'];return db['OpenchannelMessage'][_0x7cbe('0x59')]({'where':{'id':_0x204946[_0x7cbe('0x57')]['id'],'UserId':null}})[_0x7cbe('0x22')](handleEntityNotFound(_0x2c068a,null))['then'](saveUpdates(_0x204946[_0x7cbe('0x5b')],null))[_0x7cbe('0x22')](function(_0x29b7f1){if(_0x29b7f1){_0x40a478[_0x7cbe('0x2b')]=_0x29b7f1[_0x7cbe('0x65')]({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x29b7f1[_0x7cbe('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x2c068a,null))['then'](function(_0x432126){if(_0x432126){return _0x432126['update']({'UserId':_0x204946[_0x7cbe('0x5b')]['UserId'],'read1stAt':_[_0x7cbe('0x67')](_0x432126[_0x7cbe('0x68')])?moment()[_0x7cbe('0x61')](_0x7cbe('0x62')):undefined});}return null;})[_0x7cbe('0x22')](function(_0x48b524){if(_0x48b524){_0x40a478[_0x7cbe('0x69')]=_0x48b524[_0x7cbe('0x65')]({'plain':!![]});interaction_log[_0x7cbe('0x23')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x204946[_0x7cbe('0x6a')]['id'],_0x204946[_0x7cbe('0x6a')][_0x7cbe('0x3d')],_0x204946['user'][_0x7cbe('0x6b')],_0x40a478[_0x7cbe('0x69')]['id'],_0x204946[_0x7cbe('0x5b')]?JSON['stringify'](_0x204946['body']):_0x7cbe('0x6c'));return respondWithRpcPromise(_0x7cbe('0x6d'),_0x7cbe('0x6e'),_0x40a478);}return null;})['then'](function(_0x44a92c){var _0x48e23a=_0x7cbe('0x6f')+_0x44a92c[_0x7cbe('0x2b')][_0x7cbe('0x70')];return db[_0x7cbe('0x71')]['query'](_0x48e23a,{'type':db[_0x7cbe('0x72')][_0x7cbe('0x73')]['SELECT'],'raw':!![]})[_0x7cbe('0x22')](function(_0x26daa1){return _0x26daa1;});})[_0x7cbe('0x22')](function(_0x41caf2){if(_0x41caf2){_0x40a478[_0x7cbe('0x2b')][_0x7cbe('0x74')]=_0x41caf2[0x0];if(!_0x204946[_0x7cbe('0x5b')][_0x7cbe('0x63')])return;return db['User'][_0x7cbe('0x59')]({'where':{'id':_0x204946[_0x7cbe('0x5b')][_0x7cbe('0x63')],'role':_0x7cbe('0x64')},'attributes':['id',_0x7cbe('0x3d'),_0x7cbe('0x75'),_0x7cbe('0x76'),_0x7cbe('0x77')],'raw':!![]});}return null;})[_0x7cbe('0x22')](function(_0x292b41){if(!_0x292b41)return null;_0x40a478[_0x7cbe('0x2b')][_0x7cbe('0x64')]=_0x292b41;return _0x40a478;})[_0x7cbe('0x22')](function(_0x408927){if(_0x408927){if(_0x204946[_0x7cbe('0x5b')]['manual']){_0x40a478[_0x7cbe('0x2b')][_0x7cbe('0x78')]=util['format'](_0x7cbe('0x79'),_0x204946[_0x7cbe('0x6a')][_0x7cbe('0x3d')]);_0x40a478[_0x7cbe('0x2b')][_0x7cbe('0x7a')]=_0x40a478[_0x7cbe('0x7a')];_0x40a478['message']['motionChannel']=_0x40a478[_0x7cbe('0x7a')];_0x40a478[_0x7cbe('0x2b')]['event']=_0x7cbe('0x5e');return respondWithRpcPromise(_0x7cbe('0x7b'),_0x7cbe('0x7b'),{'event':_0x7cbe('0x7c'),'message':_0x40a478[_0x7cbe('0x2b')]},client9002)[_0x7cbe('0x22')](function(){return _0x40a478;});}return _0x40a478;}return null;})['then'](respondWithResult(_0x2c068a,null))['catch'](handleError(_0x2c068a,null));};var interaction_log=require(_0x7cbe('0x13'))('openchannel-interactions');exports['reject']=function(_0x3d8b38,_0xe66a48,_0x5b4a4c){var _0x2a3955={'agent':{},'channel':'openchannel'};if(_0x3d8b38[_0x7cbe('0x5b')]['id']){delete _0x3d8b38['body']['id'];}_0x3d8b38['body'][_0x7cbe('0x63')]=_0x3d8b38[_0x7cbe('0x5b')][_0x7cbe('0x63')]||_0x3d8b38['user']['id'];_0x2a3955[_0x7cbe('0x64')]['id']=_0x3d8b38['body']['UserId'];return db['OpenchannelMessage'][_0x7cbe('0x59')]({'where':{'id':_0x3d8b38['params']['id'],'UserId':null}})[_0x7cbe('0x22')](handleEntityNotFound(_0xe66a48,null))['then'](function(_0x41408a){if(_0x41408a){_0x2a3955[_0x7cbe('0x2b')]=_0x41408a[_0x7cbe('0x65')]({'plain':!![]});return db[_0x7cbe('0x7d')]['find']({'where':{'id':_0x41408a[_0x7cbe('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xe66a48,null))[_0x7cbe('0x22')](function(_0x477305){if(_0x477305){_0x2a3955[_0x7cbe('0x69')]=_0x477305[_0x7cbe('0x65')]({'plain':!![]});interaction_log[_0x7cbe('0x23')](_0x7cbe('0x7e'),_0x3d8b38['user']['id'],_0x3d8b38[_0x7cbe('0x6a')][_0x7cbe('0x3d')],_0x3d8b38[_0x7cbe('0x6a')][_0x7cbe('0x6b')],_0x2a3955[_0x7cbe('0x69')]['id'],_0x3d8b38['body']?JSON[_0x7cbe('0x27')](_0x3d8b38[_0x7cbe('0x5b')]):_0x7cbe('0x6c'));return respondWithRpcPromise(_0x7cbe('0x7f'),_0x7cbe('0x80'),_0x2a3955);}return null;})[_0x7cbe('0x22')](function(_0x3dda1e){var _0x261c5c=_0x7cbe('0x6f')+_0x3dda1e['message'][_0x7cbe('0x70')];return db[_0x7cbe('0x71')]['query'](_0x261c5c,{'type':db['Sequelize'][_0x7cbe('0x73')][_0x7cbe('0x81')],'raw':!![]})[_0x7cbe('0x22')](function(_0x28b7b2){return _0x28b7b2;});})['then'](function(_0x3d2f75){if(_0x3d2f75){_0x2a3955['message'][_0x7cbe('0x74')]=_0x3d2f75[0x0];if(!_0x3d8b38[_0x7cbe('0x5b')]['UserId'])return;return db[_0x7cbe('0x82')][_0x7cbe('0x59')]({'where':{'id':_0x3d8b38[_0x7cbe('0x5b')][_0x7cbe('0x63')],'role':_0x7cbe('0x64')},'attributes':['id','name',_0x7cbe('0x75'),_0x7cbe('0x76'),_0x7cbe('0x77')],'raw':!![]});}return null;})[_0x7cbe('0x22')](function(_0x33e160){if(!_0x33e160)return null;_0x2a3955[_0x7cbe('0x2b')][_0x7cbe('0x64')]=_0x33e160;return _0x2a3955;})['then'](function(_0x450160){if(_0x450160){_0x450160['message'][_0x7cbe('0x78')]=util[_0x7cbe('0x61')]('SIP/%s',_0x3d8b38[_0x7cbe('0x6a')][_0x7cbe('0x3d')]);_0x450160[_0x7cbe('0x2b')][_0x7cbe('0x7a')]=_0x2a3955[_0x7cbe('0x7a')];_0x450160[_0x7cbe('0x2b')][_0x7cbe('0x83')]=_0x2a3955[_0x7cbe('0x7a')];_0x450160[_0x7cbe('0x2b')][_0x7cbe('0x84')]=_0x7cbe('0x38');respondWithRpcPromise(_0x7cbe('0x7b'),_0x7cbe('0x7b'),{'event':_0x7cbe('0x85'),'message':_0x450160[_0x7cbe('0x2b')]},client9002);return _0x2a3955;}return null;})[_0x7cbe('0x22')](respondWithResult(_0xe66a48,null))['catch'](handleError(_0xe66a48,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 30b3ff4..dd92ada 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 _0xda3b=['update','remove','emit','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0xcb1a1,_0x2e2085){var _0x414b53=function(_0x54a0c2){while(--_0x54a0c2){_0xcb1a1['push'](_0xcb1a1['shift']());}};_0x414b53(++_0x2e2085);}(_0xda3b,0x1be));var _0xbda3=function(_0x822939,_0x34bc67){_0x822939=_0x822939-0x0;var _0x476773=_0xda3b[_0x822939];return _0x476773;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xbda3('0x0'))['db'][_0xbda3('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xbda3('0x2')](0x0);var events={'afterCreate':_0xbda3('0x3'),'afterUpdate':_0xbda3('0x4'),'afterDestroy':_0xbda3('0x5')};function emitEvent(_0x453f29){return function(_0x321d57,_0x1ae349,_0x1575e6){OpenchannelMessageEvents[_0xbda3('0x6')](_0x453f29+':'+_0x321d57['id'],_0x321d57);OpenchannelMessageEvents[_0xbda3('0x6')](_0x453f29,_0x321d57);_0x1575e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xbda3('0x7')](e,emitEvent(event));}}module[_0xbda3('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7c4d=['exports','events','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x7c4d,0x1e9));var _0xd7c4=function(_0x5ce723,_0x1ca090){_0x5ce723=_0x5ce723-0x0;var _0x5f2606=_0x7c4d[_0x5ce723];return _0x5f2606;};'use strict';var EventEmitter=require(_0xd7c4('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd7c4('0x1')](0x0);var events={'afterCreate':_0xd7c4('0x2'),'afterUpdate':_0xd7c4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13351d){return function(_0x1a2348,_0x590d33,_0x58136f){OpenchannelMessageEvents[_0xd7c4('0x4')](_0x13351d+':'+_0x1a2348['id'],_0x1a2348);OpenchannelMessageEvents[_0xd7c4('0x4')](_0x13351d,_0x1a2348);_0x58136f(null);};}for(var e in events){if(events[_0xd7c4('0x5')](e)){var event=events[e];OpenchannelMessage[_0xd7c4('0x6')](e,emitEvent(event));}}module[_0xd7c4('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 7f673b6..f9d557a 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 _0x1eba=['format','Interaction','omit','POST','replyUri','method','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','toLowerCase','direction','secret','isNil','OpenchannelInteraction','then','update','createdAt','catch','error','out','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','OpenchannelInteractionId','CmContact','Contact','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate'];(function(_0x4eff18,_0x5d7e11){var _0x32735f=function(_0x139ee0){while(--_0x139ee0){_0x4eff18['push'](_0x4eff18['shift']());}};_0x32735f(++_0x5d7e11);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x26bf51,_0x5e261a){_0x26bf51=_0x26bf51-0x0;var _0x503415=_0x1eba[_0x26bf51];return _0x503415;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':![],'indexes':[{'name':_0xa1eb('0xd'),'fields':[_0xa1eb('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ecd20,_0x4d4aaf,_0x219802){var _0x54cdad=_0x2933d0[_0xa1eb('0xf')];var _0x5d7101=_0x1ecd20[_0xa1eb('0x10')]({'plain':!![]});if(_0x5d7101['direction'][_0xa1eb('0x11')]()==='in'||_0x5d7101[_0xa1eb('0x12')][_0xa1eb('0x11')]()==='out'&&!_0x5d7101[_0xa1eb('0x13')]&&!_[_0xa1eb('0x14')](_0x5d7101['UserId'])){_0x54cdad[_0xa1eb('0x15')]['findOne']({'where':{'id':_0x5d7101['OpenchannelInteractionId']}})[_0xa1eb('0x16')](function(_0x4c7983){if(_0x4c7983){_0x4c7983[_0xa1eb('0x17')]({'lastMsgAt':_0x5d7101[_0xa1eb('0x18')],'lastMsgDirection':_0x5d7101[_0xa1eb('0x12')][_0xa1eb('0x11')]()});}})[_0xa1eb('0x19')](function(_0x44f37d){console[_0xa1eb('0x1a')](_0x44f37d);});}if(_0x5d7101[_0xa1eb('0x12')]===_0xa1eb('0x1b')&&!_0x5d7101['secret']){var _0xbd6a6b;_0x54cdad['CmContact'][_0xa1eb('0x1c')]()[_0xa1eb('0x16')](function(_0x33c4e3){return _0x54cdad[_0xa1eb('0x1d')]['find']({'where':{'id':_0x5d7101[_0xa1eb('0x1e')]},'include':[{'model':_0x54cdad[_0xa1eb('0x15')],'as':_0xa1eb('0x1f'),'where':{'id':_0x5d7101[_0xa1eb('0x20')]},'limit':0x1,'include':[{'model':_0x54cdad[_0xa1eb('0x21')],'as':_0xa1eb('0x22'),'attributes':_[_0xa1eb('0x23')](_0x33c4e3)}]}]});})[_0xa1eb('0x16')](function(_0x4fc14a){_0xbd6a6b=_0x4fc14a[_0xa1eb('0x10')]({'plain':!![]});if(_0xbd6a6b&&_0xbd6a6b['replyUri']){logger[_0xa1eb('0x24')](_0xa1eb('0x25'),_0xa1eb('0x26'),util[_0xa1eb('0x27')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x5d7101['id'],_0xbd6a6b['replyUri']));if(_0xbd6a6b[_0xa1eb('0x1f')]&&_0xbd6a6b[_0xa1eb('0x1f')]['length']){_0x5d7101[_0xa1eb('0x28')]=_[_0xa1eb('0x29')](_0xbd6a6b[_0xa1eb('0x1f')][0x0],_0xa1eb('0x22'));_0x5d7101[_0xa1eb('0x22')]=_0xbd6a6b[_0xa1eb('0x1f')][0x0][_0xa1eb('0x22')];}var _0x4d4aaf={'method':_0xa1eb('0x2a'),'uri':encodeURI(_0xbd6a6b[_0xa1eb('0x2b')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d4aaf[_0xa1eb('0x2c')]){case _0xa1eb('0x2d'):_0x4d4aaf['qs']=_0x5d7101;break;case'POST':_0x4d4aaf[_0xa1eb('0xe')]=_0x5d7101;break;}return rp(_0x4d4aaf)[_0xa1eb('0x16')](function(_0x491f37){logger[_0xa1eb('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xa1eb('0x26'),util[_0xa1eb('0x27')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5d7101['id'],_0xbd6a6b[_0xa1eb('0x2b')]));if(_0x491f37[_0xa1eb('0xe')][_0xa1eb('0x2e')]&&_0x491f37['body'][_0xa1eb('0x2e')]!=_0x5d7101[_0xa1eb('0x28')]['threadId']){return _0x54cdad[_0xa1eb('0x15')][_0xa1eb('0x17')]({'threadId':_0x491f37[_0xa1eb('0xe')][_0xa1eb('0x2e')]},{'logging':!![],'where':{'id':_0x5d7101[_0xa1eb('0x28')]['id']}});}else{return;}})['then'](function(){return _0x1ecd20[_0xa1eb('0x17')]({'read':!![]});})[_0xa1eb('0x19')](function(_0x198fdb){logger[_0xa1eb('0x1a')](_0xa1eb('0x25'),_0xa1eb('0x26'),util[_0xa1eb('0x2f')](_0x198fdb,{'showHidden':![],'depth':null}));_0x219802();});}else{_0x219802();}})[_0xa1eb('0x30')](function(){_0x219802();});}else{_0x219802();}}},'charset':_0xa1eb('0x31'),'collate':_0xa1eb('0x32')});}; \ No newline at end of file +var _0x7708=['update','createdAt','catch','error','describe','OpenchannelAccount','Interactions','CmContact','Contact','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelMessage,\x20%s,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','api','rimraf','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then'];(function(_0x9bf53,_0x478f6a){var _0x389a4e=function(_0x3ad6ec){while(--_0x3ad6ec){_0x9bf53['push'](_0x9bf53['shift']());}};_0x389a4e(++_0x478f6a);}(_0x7708,0x188));var _0x8770=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x7708[_0x4347ec];return _0x4c8314;};'use strict';var _=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var logger=require('../../config/logger')(_0x8770('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var attributes=require('./openchannelMessage.attributes');module[_0x8770('0x5')]=function(_0x50bab7,_0x31390d){return _0x50bab7[_0x8770('0x6')](_0x8770('0x7'),attributes,{'tableName':_0x8770('0x8'),'paranoid':![],'indexes':[{'name':_0x8770('0x9'),'fields':[_0x8770('0xa')],'type':_0x8770('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4fc512,_0x396322,_0x2ca830){var _0x3f357a=_0x50bab7['models'];var _0x390af0=_0x4fc512[_0x8770('0xc')]({'plain':!![]});if(_0x390af0[_0x8770('0xd')][_0x8770('0xe')]()==='in'||_0x390af0['direction'][_0x8770('0xe')]()===_0x8770('0xf')&&!_0x390af0[_0x8770('0x10')]&&!_['isNil'](_0x390af0[_0x8770('0x11')])){_0x3f357a[_0x8770('0x12')][_0x8770('0x13')]({'where':{'id':_0x390af0[_0x8770('0x14')]}})[_0x8770('0x15')](function(_0x12a06f){if(_0x12a06f){_0x12a06f[_0x8770('0x16')]({'lastMsgAt':_0x390af0[_0x8770('0x17')],'lastMsgDirection':_0x390af0['direction'][_0x8770('0xe')]()});}})[_0x8770('0x18')](function(_0x5dd4e7){console[_0x8770('0x19')](_0x5dd4e7);});}if(_0x390af0['direction']===_0x8770('0xf')&&!_0x390af0['secret']){var _0x5b4716;_0x3f357a['CmContact'][_0x8770('0x1a')]()[_0x8770('0x15')](function(_0x17b634){return _0x3f357a[_0x8770('0x1b')]['find']({'where':{'id':_0x390af0['OpenchannelAccountId']},'include':[{'model':_0x3f357a[_0x8770('0x12')],'as':_0x8770('0x1c'),'where':{'id':_0x390af0[_0x8770('0x14')]},'limit':0x1,'include':[{'model':_0x3f357a[_0x8770('0x1d')],'as':_0x8770('0x1e'),'attributes':_['keys'](_0x17b634)}]}]});})[_0x8770('0x15')](function(_0x1234dd){_0x5b4716=_0x1234dd[_0x8770('0xc')]({'plain':!![]});if(_0x5b4716&&_0x5b4716[_0x8770('0x1f')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x22'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0x5b4716[_0x8770('0x1c')]&&_0x5b4716[_0x8770('0x1c')]['length']){_0x390af0[_0x8770('0x23')]=_[_0x8770('0x24')](_0x5b4716[_0x8770('0x1c')][0x0],_0x8770('0x1e'));_0x390af0['Contact']=_0x5b4716[_0x8770('0x1c')][0x0]['Contact'];}var _0x396322={'method':_0x8770('0x25'),'uri':encodeURI(_0x5b4716[_0x8770('0x1f')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x396322[_0x8770('0x26')]){case _0x8770('0x27'):_0x396322['qs']=_0x390af0;break;case _0x8770('0x25'):_0x396322[_0x8770('0xa')]=_0x390af0;break;}return rp(_0x396322)[_0x8770('0x15')](function(_0xb3f4aa){logger[_0x8770('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x8770('0x20'),util[_0x8770('0x21')](_0x8770('0x29'),_0x390af0['id'],_0x5b4716[_0x8770('0x1f')]));if(_0xb3f4aa[_0x8770('0xa')][_0x8770('0x2a')]&&_0xb3f4aa['body']['threadId']!=_0x390af0[_0x8770('0x23')][_0x8770('0x2a')]){return _0x3f357a[_0x8770('0x12')][_0x8770('0x16')]({'threadId':_0xb3f4aa[_0x8770('0xa')]['threadId']},{'logging':!![],'where':{'id':_0x390af0['Interaction']['id']}});}else{return;}})[_0x8770('0x15')](function(){return _0x4fc512[_0x8770('0x16')]({'read':!![]});})[_0x8770('0x18')](function(_0x2c2c77){logger['error'](_0x8770('0x2b'),'afterCreate',util['inspect'](_0x2c2c77,{'showHidden':![],'depth':null}));_0x2ca830();});}else{_0x2ca830();}})[_0x8770('0x2c')](function(){_0x2ca830();});}else{_0x2ca830();}}},'charset':'utf8mb4','collate':_0x8770('0x2d')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 2e19034..0be86bd 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(_0x25d0fc,_0x2daf9a){var _0x150496=function(_0x3485b4){while(--_0x3485b4){_0x25d0fc['push'](_0x25d0fc['shift']());}};_0x150496(++_0x2daf9a);}(_0xadb5,0xad));var _0x5adb=function(_0x3fdd9a,_0x3bdc9d){_0x3fdd9a=_0x3fdd9a-0x0;var _0x36d36f=_0xadb5[_0x3fdd9a];return _0x36d36f;};'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 _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4088e2,_0x1f826a){var _0x352dda=function(_0x3d65e6){while(--_0x3d65e6){_0x4088e2['push'](_0x4088e2['shift']());}};_0x352dda(++_0x1f826a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x18df57,_0x34f6de){_0x18df57=_0x18df57-0x0;var _0x1ad594=_0x5f2f[_0x18df57];return _0x1ad594;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 8feba44..1ba1e8b 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 _0x04f2=['remove','update','removeListener','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x04f2,0x8f));var _0x204f=function(_0x4f3185,_0x27b3fc){_0x4f3185=_0x4f3185-0x0;var _0x3c60d1=_0x04f2[_0x4f3185];return _0x3c60d1;};'use strict';var OpenchannelMessageEvents=require(_0x204f('0x0'));var events=['save',_0x204f('0x1'),_0x204f('0x2')];function createListener(_0x1ec839,_0x1ebbce){return function(_0x875932){_0x1ebbce['emit'](_0x1ec839,_0x875932);};}function removeListener(_0x11dab1,_0x134d64){return function(){OpenchannelMessageEvents[_0x204f('0x3')](_0x11dab1,_0x134d64);};}exports['register']=function(_0x104edd){for(var _0x254bfa=0x0,_0x43399a=events[_0x204f('0x4')];_0x254bfa<_0x43399a;_0x254bfa++){var _0x330607=events[_0x254bfa];var _0x19fd98=createListener(_0x204f('0x5')+_0x330607,_0x104edd);OpenchannelMessageEvents['on'](_0x330607,_0x19fd98);}}; \ No newline at end of file +var _0x0e76=['emit','register','length','openchannelMessage:','./openchannelMessage.events','update'];(function(_0x21c068,_0x369d6a){var _0x5cf199=function(_0x2c0159){while(--_0x2c0159){_0x21c068['push'](_0x21c068['shift']());}};_0x5cf199(++_0x369d6a);}(_0x0e76,0xc4));var _0x60e7=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0x0e76[_0x513f27];return _0xa316b7;};'use strict';var OpenchannelMessageEvents=require(_0x60e7('0x0'));var events=['save','remove',_0x60e7('0x1')];function createListener(_0x4d71bb,_0x21402c){return function(_0x6f8f6e){_0x21402c[_0x60e7('0x2')](_0x4d71bb,_0x6f8f6e);};}function removeListener(_0xd3886,_0x2f1ad1){return function(){OpenchannelMessageEvents['removeListener'](_0xd3886,_0x2f1ad1);};}exports[_0x60e7('0x3')]=function(_0x35b628){for(var _0x1fb45c=0x0,_0xba29ef=events[_0x60e7('0x4')];_0x1fb45c<_0xba29ef;_0x1fb45c++){var _0x194535=events[_0x1fb45c];var _0x4a15f2=createListener(_0x60e7('0x5')+_0x194535,_0x35b628);OpenchannelMessageEvents['on'](_0x194535,_0x4a15f2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 9b232f4..107117e 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 _0x0b2d=['destroy','removeTeams','removeAgents','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','delete'];(function(_0x452249,_0x364117){var _0x40f787=function(_0x4fab31){while(--_0x4fab31){_0x452249['push'](_0x452249['shift']());}};_0x40f787(++_0x364117);}(_0x0b2d,0x1e3));var _0xd0b2=function(_0x1a8260,_0x3acfc2){_0x1a8260=_0x1a8260-0x0;var _0x210285=_0x0b2d[_0x1a8260];return _0x210285;};'use strict';var multer=require('multer');var util=require(_0xd0b2('0x0'));var path=require(_0xd0b2('0x1'));var timeout=require(_0xd0b2('0x2'));var express=require(_0xd0b2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd0b2('0x4'));var interaction=require(_0xd0b2('0x5'));var config=require(_0xd0b2('0x6'));var controller=require('./openchannelQueue.controller');router[_0xd0b2('0x7')]('/',auth['isAuthenticated'](),controller[_0xd0b2('0x8')]);router[_0xd0b2('0x7')](_0xd0b2('0x9'),auth[_0xd0b2('0xa')](),controller['describe']);router[_0xd0b2('0x7')](_0xd0b2('0xb'),auth['isAuthenticated'](),controller[_0xd0b2('0xc')]);router[_0xd0b2('0x7')]('/:id/members',auth[_0xd0b2('0xa')](),controller['getMembers']);router[_0xd0b2('0x7')](_0xd0b2('0xd'),auth[_0xd0b2('0xa')](),controller[_0xd0b2('0xe')]);router['get'](_0xd0b2('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0xd0b2('0x10')]('/',auth[_0xd0b2('0xa')](),controller[_0xd0b2('0x11')]);router[_0xd0b2('0x10')]('/:id/teams',auth[_0xd0b2('0xa')](),controller[_0xd0b2('0x12')]);router['post'](_0xd0b2('0xf'),auth['isAuthenticated'](),controller[_0xd0b2('0x13')]);router['put'](_0xd0b2('0xb'),auth[_0xd0b2('0xa')](),controller['update']);router[_0xd0b2('0x14')](_0xd0b2('0xb'),auth[_0xd0b2('0xa')](),controller[_0xd0b2('0x15')]);router[_0xd0b2('0x14')](_0xd0b2('0xd'),auth[_0xd0b2('0xa')](),controller[_0xd0b2('0x16')]);router['delete'](_0xd0b2('0xf'),auth['isAuthenticated'](),controller[_0xd0b2('0x17')]);module['exports']=router; \ No newline at end of file +var _0x5bda=['removeTeams','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','index','get','/:id','show','/:id/members','getMembers','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','delete','destroy','/:id/teams'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0x5bda,0xce));var _0xa5bd=function(_0x45ff3e,_0x2d5827){_0x45ff3e=_0x45ff3e-0x0;var _0x5166bd=_0x5bda[_0x45ff3e];return _0x5166bd;};'use strict';var multer=require(_0xa5bd('0x0'));var util=require(_0xa5bd('0x1'));var path=require(_0xa5bd('0x2'));var timeout=require('connect-timeout');var express=require(_0xa5bd('0x3'));var router=express[_0xa5bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa5bd('0x5'));var interaction=require(_0xa5bd('0x6'));var config=require('../../config/environment');var controller=require(_0xa5bd('0x7'));router['get']('/',auth[_0xa5bd('0x8')](),controller[_0xa5bd('0x9')]);router[_0xa5bd('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa5bd('0xa')](_0xa5bd('0xb'),auth[_0xa5bd('0x8')](),controller[_0xa5bd('0xc')]);router[_0xa5bd('0xa')](_0xa5bd('0xd'),auth['isAuthenticated'](),controller[_0xa5bd('0xe')]);router['get']('/:id/teams',auth[_0xa5bd('0x8')](),controller[_0xa5bd('0xf')]);router[_0xa5bd('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0xa5bd('0x10')]);router[_0xa5bd('0x11')]('/',auth[_0xa5bd('0x8')](),controller[_0xa5bd('0x12')]);router[_0xa5bd('0x11')]('/:id/teams',auth[_0xa5bd('0x8')](),controller[_0xa5bd('0x13')]);router[_0xa5bd('0x11')](_0xa5bd('0x14'),auth[_0xa5bd('0x8')](),controller[_0xa5bd('0x15')]);router[_0xa5bd('0x16')](_0xa5bd('0xb'),auth[_0xa5bd('0x8')](),controller['update']);router[_0xa5bd('0x17')](_0xa5bd('0xb'),auth[_0xa5bd('0x8')](),controller[_0xa5bd('0x18')]);router[_0xa5bd('0x17')](_0xa5bd('0x19'),auth[_0xa5bd('0x8')](),controller[_0xa5bd('0x1a')]);router[_0xa5bd('0x17')](_0xa5bd('0x14'),auth[_0xa5bd('0x8')](),controller[_0xa5bd('0x1b')]);module[_0xa5bd('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 69c2160..7a5be11 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 _0x1557=['sequelize','exports','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x5862d3,_0x4d94ef){var _0x2521a8=function(_0x2632df){while(--_0x2632df){_0x5862d3['push'](_0x5862d3['shift']());}};_0x2521a8(++_0x4d94ef);}(_0x1557,0x98));var _0x7155=function(_0x2627cc,_0x30d7aa){_0x2627cc=_0x2627cc-0x0;var _0x2b9117=_0x1557[_0x2627cc];return _0x2b9117;};'use strict';var Sequelize=require(_0x7155('0x0'));module[_0x7155('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7155('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7155('0x3')]},'timeout':{'type':Sequelize[_0x7155('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7155('0x5'),_0x7155('0x6'),_0x7155('0x7'))}}; \ No newline at end of file +var _0x23f5=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0xbf1132,_0x176b34){var _0xe63ce4=function(_0x52d8ed){while(--_0x52d8ed){_0xbf1132['push'](_0xbf1132['shift']());}};_0xe63ce4(++_0x176b34);}(_0x23f5,0x19d));var _0x523f=function(_0x57408b,_0xb7cbc5){_0x57408b=_0x57408b-0x0;var _0x31a897=_0x23f5[_0x57408b];return _0x31a897;};'use strict';var Sequelize=require(_0x523f('0x0'));module[_0x523f('0x1')]={'name':{'type':Sequelize[_0x523f('0x2')],'unique':_0x523f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x523f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x523f('0x5')](_0x523f('0x6'),_0x523f('0x7'),_0x523f('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 4e67824..e8fb71c 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 _0xba80=['clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','OpenchannelQueues','destroy','error','stack','name','send','map','OpenchannelQueue','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','keys','rawAttributes','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','rows','SIP','updatedAt','getTeams','ids','Team','online','voicePause','flatMap','Agents','sequelize','transaction','addTeams','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?'];(function(_0x3bfd25,_0x36c09f){var _0x34d12f=function(_0xf64932){while(--_0xf64932){_0x3bfd25['push'](_0x3bfd25['shift']());}};_0x34d12f(++_0x36c09f);}(_0xba80,0xa5));var _0x0ba8=function(_0x50615c,_0x3ef51e){_0x50615c=_0x50615c-0x0;var _0x5d44e=_0xba80[_0x50615c];return _0x5d44e;};'use strict';var emlformat=require(_0x0ba8('0x0'));var rimraf=require(_0x0ba8('0x1'));var zipdir=require(_0x0ba8('0x2'));var jsonpatch=require(_0x0ba8('0x3'));var rp=require(_0x0ba8('0x4'));var moment=require(_0x0ba8('0x5'));var BPromise=require(_0x0ba8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0ba8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ba8('0x8'));var fs=require('fs');var fs_extra=require(_0x0ba8('0x9'));var _=require(_0x0ba8('0xa'));var squel=require(_0x0ba8('0xb'));var crypto=require(_0x0ba8('0xc'));var jsforce=require(_0x0ba8('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0ba8('0xe'));var querystring=require(_0x0ba8('0xf'));var Papa=require(_0x0ba8('0x10'));var Redis=require(_0x0ba8('0x11'));var authService=require(_0x0ba8('0x12'));var qs=require(_0x0ba8('0x13'));var as=require(_0x0ba8('0x14'));var hardwareService=require(_0x0ba8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x0ba8('0x16'));var config=require(_0x0ba8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ba8('0x18'))['db'];config[_0x0ba8('0x19')]=_['defaults'](config[_0x0ba8('0x19')],{'host':_0x0ba8('0x1a'),'port':0x18eb});var socket=require(_0x0ba8('0x1b'))(new Redis(config[_0x0ba8('0x19')]));require('./openchannelQueue.socket')[_0x0ba8('0x1c')](socket);function respondWithStatusCode(_0x303b97,_0x3e5e41){_0x3e5e41=_0x3e5e41||0xcc;return function(_0x195476){if(_0x195476){return _0x303b97[_0x0ba8('0x1d')](_0x3e5e41);}return _0x303b97[_0x0ba8('0x1e')](_0x3e5e41)[_0x0ba8('0x1f')]();};}function respondWithResult(_0x35abdc,_0x5aef83){_0x5aef83=_0x5aef83||0xc8;return function(_0x437e0d){if(_0x437e0d){return _0x35abdc[_0x0ba8('0x1e')](_0x5aef83)[_0x0ba8('0x20')](_0x437e0d);}};}function respondWithFilteredResult(_0x51d113,_0x343449){return function(_0x428984){if(_0x428984){var _0x4820b2=typeof _0x343449[_0x0ba8('0x21')]===_0x0ba8('0x22')&&typeof _0x343449[_0x0ba8('0x23')]==='undefined';var _0x265284=_0x428984[_0x0ba8('0x24')];var _0x26f6b2=_0x4820b2?0x0:_0x343449['offset'];var _0x5b8c8e=_0x4820b2?_0x428984['count']:_0x343449['offset']+_0x343449['limit'];var _0x7cd6c3;if(_0x5b8c8e>=_0x265284){_0x5b8c8e=_0x265284;_0x7cd6c3=0xc8;}else{_0x7cd6c3=0xce;}_0x51d113[_0x0ba8('0x1e')](_0x7cd6c3);return _0x51d113[_0x0ba8('0x25')](_0x0ba8('0x26'),_0x26f6b2+'-'+_0x5b8c8e+'/'+_0x265284)[_0x0ba8('0x20')](_0x428984);}return null;};}function patchUpdates(_0x34015e){return function(_0x34bffa){try{jsonpatch[_0x0ba8('0x27')](_0x34bffa,_0x34015e,!![]);}catch(_0x5f4a90){return BPromise['reject'](_0x5f4a90);}return _0x34bffa[_0x0ba8('0x28')]();};}function saveUpdates(_0x35fa16,_0x265f50){return function(_0x491fc8){if(_0x491fc8){return _0x491fc8[_0x0ba8('0x29')](_0x35fa16)[_0x0ba8('0x2a')](function(_0x46134b){return _0x46134b;});}return null;};}function removeEntity(_0x499fa8,_0x5ae708){return function(_0x52f864){if(_0x52f864){return _0x52f864['destroy']()[_0x0ba8('0x2a')](function(){var _0x2c7cf3=_0x52f864['get']({'plain':!![]});var _0x3d4aa0=_0x0ba8('0x2b');return db['UserProfileResource'][_0x0ba8('0x2c')]({'where':{'type':_0x3d4aa0,'resourceId':_0x2c7cf3['id']}})[_0x0ba8('0x2a')](function(){return _0x52f864;});})[_0x0ba8('0x2a')](function(){_0x499fa8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xe777fa,_0x3aae17){return function(_0x50dda4){if(!_0x50dda4){_0xe777fa[_0x0ba8('0x1d')](0x194);}return _0x50dda4;};}function handleError(_0x46a3e7,_0xbdbab0){_0xbdbab0=_0xbdbab0||0x1f4;return function(_0x2d81ee){logger[_0x0ba8('0x2d')](_0x2d81ee[_0x0ba8('0x2e')]);if(_0x2d81ee['name']){delete _0x2d81ee[_0x0ba8('0x2f')];}_0x46a3e7['status'](_0xbdbab0)[_0x0ba8('0x30')](_0x2d81ee);};}exports['index']=function(_0x945ff6,_0x4c2e4f){var _0x1a1684={},_0x4bcd5b={},_0x58dd2c={'count':0x0,'rows':[]};var _0x17abbe=_[_0x0ba8('0x31')](db[_0x0ba8('0x32')]['rawAttributes'],function(_0x15042d){return{'name':_0x15042d['fieldName'],'type':_0x15042d['type']['key']};});_0x4bcd5b['model']=_[_0x0ba8('0x31')](_0x17abbe,'name');_0x4bcd5b[_0x0ba8('0x33')]=_['keys'](_0x945ff6[_0x0ba8('0x33')]);_0x4bcd5b[_0x0ba8('0x34')]=_[_0x0ba8('0x35')](_0x4bcd5b[_0x0ba8('0x36')],_0x4bcd5b['query']);_0x1a1684[_0x0ba8('0x37')]=_['intersection'](_0x4bcd5b[_0x0ba8('0x36')],qs[_0x0ba8('0x38')](_0x945ff6[_0x0ba8('0x33')][_0x0ba8('0x38')]));_0x1a1684[_0x0ba8('0x37')]=_0x1a1684['attributes'][_0x0ba8('0x39')]?_0x1a1684['attributes']:_0x4bcd5b[_0x0ba8('0x36')];if(!_0x945ff6[_0x0ba8('0x33')][_0x0ba8('0x3a')](_0x0ba8('0x3b'))){_0x1a1684[_0x0ba8('0x23')]=qs[_0x0ba8('0x23')](_0x945ff6['query'][_0x0ba8('0x23')]);_0x1a1684[_0x0ba8('0x21')]=qs['offset'](_0x945ff6[_0x0ba8('0x33')]['offset']);}_0x1a1684[_0x0ba8('0x3c')]=qs[_0x0ba8('0x3d')](_0x945ff6[_0x0ba8('0x33')][_0x0ba8('0x3d')]);_0x1a1684[_0x0ba8('0x3e')]=qs[_0x0ba8('0x34')](_[_0x0ba8('0x3f')](_0x945ff6[_0x0ba8('0x33')],_0x4bcd5b['filters']),_0x17abbe);if(_0x945ff6[_0x0ba8('0x33')][_0x0ba8('0x40')]){_0x1a1684[_0x0ba8('0x3e')]=_[_0x0ba8('0x41')](_0x1a1684[_0x0ba8('0x3e')],{'$or':_[_0x0ba8('0x31')](_0x17abbe,function(_0xffc96f){if(_0xffc96f['type']!==_0x0ba8('0x42')){var _0x12fb5e={};_0x12fb5e[_0xffc96f[_0x0ba8('0x2f')]]={'$like':'%'+_0x945ff6[_0x0ba8('0x33')][_0x0ba8('0x40')]+'%'};return _0x12fb5e;}})});}_0x1a1684=_[_0x0ba8('0x41')]({},_0x1a1684,_0x945ff6[_0x0ba8('0x43')]);var _0x5f097b={'where':_0x1a1684[_0x0ba8('0x3e')]};return db[_0x0ba8('0x32')]['count'](_0x5f097b)[_0x0ba8('0x2a')](function(_0x346643){_0x58dd2c[_0x0ba8('0x24')]=_0x346643;if(_0x945ff6[_0x0ba8('0x33')][_0x0ba8('0x44')]){_0x1a1684['include']=[{'all':!![]}];}return db[_0x0ba8('0x32')]['findAll'](_0x1a1684);})['then'](function(_0x4d9bac){_0x58dd2c['rows']=_0x4d9bac;return _0x58dd2c;})[_0x0ba8('0x2a')](respondWithFilteredResult(_0x4c2e4f,_0x1a1684))[_0x0ba8('0x45')](handleError(_0x4c2e4f,null));};exports[_0x0ba8('0x46')]=function(_0x24f284,_0x853917){var _0xcdfba6={'raw':!![],'where':{'id':_0x24f284[_0x0ba8('0x47')]['id']}},_0x5d3ace={};_0x5d3ace[_0x0ba8('0x36')]=_[_0x0ba8('0x48')](db['OpenchannelQueue'][_0x0ba8('0x49')]);_0x5d3ace[_0x0ba8('0x33')]=_[_0x0ba8('0x48')](_0x24f284[_0x0ba8('0x33')]);_0x5d3ace[_0x0ba8('0x34')]=_[_0x0ba8('0x35')](_0x5d3ace['model'],_0x5d3ace[_0x0ba8('0x33')]);_0xcdfba6[_0x0ba8('0x37')]=_[_0x0ba8('0x35')](_0x5d3ace[_0x0ba8('0x36')],qs[_0x0ba8('0x38')](_0x24f284[_0x0ba8('0x33')][_0x0ba8('0x38')]));_0xcdfba6[_0x0ba8('0x37')]=_0xcdfba6[_0x0ba8('0x37')][_0x0ba8('0x39')]?_0xcdfba6[_0x0ba8('0x37')]:_0x5d3ace['model'];if(_0x24f284['query'][_0x0ba8('0x44')]){_0xcdfba6['include']=[{'all':!![]}];}_0xcdfba6=_[_0x0ba8('0x41')]({},_0xcdfba6,_0x24f284[_0x0ba8('0x43')]);return db[_0x0ba8('0x32')]['find'](_0xcdfba6)['then'](handleEntityNotFound(_0x853917,null))[_0x0ba8('0x2a')](respondWithResult(_0x853917,null))[_0x0ba8('0x45')](handleError(_0x853917,null));};exports[_0x0ba8('0x4a')]=function(_0x58be8f,_0xd42e51){return db['OpenchannelQueue'][_0x0ba8('0x4a')](_0x58be8f['body'],{})[_0x0ba8('0x2a')](function(_0x166da8){var _0xdd0012=_0x58be8f['user'][_0x0ba8('0x4b')]({'plain':!![]});if(!_0xdd0012)throw new Error(_0x0ba8('0x4c'));if(_0xdd0012[_0x0ba8('0x4d')]===_0x0ba8('0x4e')){var _0x5487a1=_0x166da8[_0x0ba8('0x4b')]({'plain':!![]});var _0x200d72='OpenchannelQueues';return db[_0x0ba8('0x4f')][_0x0ba8('0x50')]({'where':{'name':_0x200d72,'userProfileId':_0xdd0012[_0x0ba8('0x51')]},'raw':!![]})[_0x0ba8('0x2a')](function(_0x14913c){if(_0x14913c&&_0x14913c[_0x0ba8('0x52')]===0x0){return db[_0x0ba8('0x53')][_0x0ba8('0x4a')]({'name':_0x5487a1[_0x0ba8('0x2f')],'resourceId':_0x5487a1['id'],'type':_0x14913c[_0x0ba8('0x2f')],'sectionId':_0x14913c['id']},{})[_0x0ba8('0x2a')](function(){return _0x166da8;});}else{return _0x166da8;}})[_0x0ba8('0x45')](function(_0x5c11f3){logger[_0x0ba8('0x2d')](_0x0ba8('0x54'),_0x5c11f3);throw _0x5c11f3;});}return _0x166da8;})[_0x0ba8('0x2a')](respondWithResult(_0xd42e51,0xc9))['catch'](handleError(_0xd42e51,null));};exports[_0x0ba8('0x29')]=function(_0x324e9b,_0x5296dc){if(_0x324e9b[_0x0ba8('0x55')]['id']){delete _0x324e9b[_0x0ba8('0x55')]['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x324e9b[_0x0ba8('0x47')]['id']}})[_0x0ba8('0x2a')](handleEntityNotFound(_0x5296dc,null))['then'](saveUpdates(_0x324e9b[_0x0ba8('0x55')],null))[_0x0ba8('0x2a')](respondWithResult(_0x5296dc,null))[_0x0ba8('0x45')](handleError(_0x5296dc,null));};exports[_0x0ba8('0x2c')]=function(_0x44c618,_0x4da49b){return db[_0x0ba8('0x32')][_0x0ba8('0x50')]({'where':{'id':_0x44c618[_0x0ba8('0x47')]['id']}})['then'](handleEntityNotFound(_0x4da49b,null))[_0x0ba8('0x2a')](removeEntity(_0x4da49b,null))[_0x0ba8('0x45')](handleError(_0x4da49b,null));};exports[_0x0ba8('0x56')]=function(_0x3cd7b7,_0x3f2382){return db['OpenchannelQueue'][_0x0ba8('0x56')]()[_0x0ba8('0x2a')](respondWithResult(_0x3f2382,null))[_0x0ba8('0x45')](handleError(_0x3f2382,null));};exports[_0x0ba8('0x57')]=function(_0x7d827e,_0x318bfe,_0x473587){var _0x18cc8f={'raw':!![],'where':{}},_0x54f68b={},_0x538a57;return db[_0x0ba8('0x32')][_0x0ba8('0x58')]({'where':{'id':_0x7d827e['params']['id']}})[_0x0ba8('0x2a')](handleEntityNotFound(_0x318bfe,null))[_0x0ba8('0x2a')](function(_0x23b7b4){if(_0x23b7b4){_0x538a57=_0x23b7b4[_0x0ba8('0x4b')]({'plain':!![]});_0x54f68b[_0x0ba8('0x36')]=_[_0x0ba8('0x48')](db[_0x0ba8('0x59')][_0x0ba8('0x49')]);_0x54f68b['query']=_[_0x0ba8('0x48')](_0x7d827e['query']);_0x54f68b['filters']=_[_0x0ba8('0x35')](_0x54f68b[_0x0ba8('0x36')],_0x54f68b['query']);_0x18cc8f['attributes']=_['intersection'](_0x54f68b[_0x0ba8('0x36')],qs[_0x0ba8('0x38')](_0x7d827e[_0x0ba8('0x33')][_0x0ba8('0x38')]));_0x18cc8f[_0x0ba8('0x37')]=_0x18cc8f[_0x0ba8('0x37')][_0x0ba8('0x39')]?_0x18cc8f[_0x0ba8('0x37')]:_0x54f68b[_0x0ba8('0x36')];if(!_0x7d827e['query'][_0x0ba8('0x3a')]('nolimit')){_0x18cc8f[_0x0ba8('0x23')]=qs[_0x0ba8('0x23')](_0x7d827e['query'][_0x0ba8('0x23')]);_0x18cc8f[_0x0ba8('0x21')]=qs[_0x0ba8('0x21')](_0x7d827e[_0x0ba8('0x33')][_0x0ba8('0x21')]);}_0x18cc8f[_0x0ba8('0x3c')]=qs[_0x0ba8('0x3d')](_0x7d827e[_0x0ba8('0x33')][_0x0ba8('0x3d')]);_0x18cc8f[_0x0ba8('0x3e')]=qs[_0x0ba8('0x34')](_[_0x0ba8('0x3f')](_0x7d827e[_0x0ba8('0x33')],_0x54f68b[_0x0ba8('0x34')]));_0x18cc8f[_0x0ba8('0x3e')][_0x0ba8('0x5a')]=_0x23b7b4['id'];if(_0x7d827e[_0x0ba8('0x33')][_0x0ba8('0x40')]){_0x18cc8f[_0x0ba8('0x3e')]=_[_0x0ba8('0x41')](_0x18cc8f[_0x0ba8('0x3e')],{'$or':_['map'](_0x18cc8f[_0x0ba8('0x37')],function(_0x3fb396){var _0x355bfb={};_0x355bfb[_0x3fb396]={'$like':'%'+_0x7d827e['query'][_0x0ba8('0x40')]+'%'};return _0x355bfb;})});}_0x18cc8f=_[_0x0ba8('0x41')]({},_0x18cc8f,_0x7d827e[_0x0ba8('0x43')]);return db['UserOpenchannelQueue'][_0x0ba8('0x5b')](_0x18cc8f);}})[_0x0ba8('0x2a')](function(_0x377660){if(_0x377660){return db[_0x0ba8('0x5c')][_0x0ba8('0x5d')]({'where':{'id':_[_0x0ba8('0x31')](_0x377660,_0x0ba8('0x5e')),'role':_0x0ba8('0x5f')},'attributes':['id',_0x0ba8('0x2f'),_0x0ba8('0x60'),'updatedAt',_0x0ba8('0x61')]});}})[_0x0ba8('0x2a')](function(_0x482750){if(_0x482750){return{'count':_0x482750[_0x0ba8('0x24')],'rows':_[_0x0ba8('0x31')](_0x482750[_0x0ba8('0x62')],function(_0x3e22fd){return{'membername':_0x3e22fd['name'],'UserId':_0x3e22fd['id'],'queue_name':_0x538a57[_0x0ba8('0x2f')],'OpenchannelQueueId':_0x538a57['id'],'interface':util['format']('%s/%s',_0x0ba8('0x63'),_0x3e22fd[_0x0ba8('0x2f')]),'penalty':0x0,'paused':_0x3e22fd['openchannelPause'],'createdAt':_0x3e22fd[_0x0ba8('0x61')],'updatedAt':_0x3e22fd[_0x0ba8('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0ba8('0x2a')](respondWithFilteredResult(_0x318bfe,_0x18cc8f))['catch'](handleError(_0x318bfe,null));};exports[_0x0ba8('0x65')]=function(_0x534cac,_0x153abb,_0x28aa56){var _0x4146e0={};var _0x4820dd={};var _0x17fb14;var _0x30b3ae;return db['OpenchannelQueue'][_0x0ba8('0x58')]({'where':{'id':_0x534cac[_0x0ba8('0x47')]['id']}})[_0x0ba8('0x2a')](handleEntityNotFound(_0x153abb,null))[_0x0ba8('0x2a')](function(_0x39234c){if(_0x39234c){_0x17fb14=_0x39234c;_0x4820dd[_0x0ba8('0x36')]=_[_0x0ba8('0x48')](db['Team']['rawAttributes']);_0x4820dd[_0x0ba8('0x33')]=_[_0x0ba8('0x48')](_0x534cac['query']);_0x4820dd['filters']=_[_0x0ba8('0x35')](_0x4820dd[_0x0ba8('0x36')],_0x4820dd['query']);_0x4146e0[_0x0ba8('0x37')]=_[_0x0ba8('0x35')](_0x4820dd[_0x0ba8('0x36')],qs['fields'](_0x534cac[_0x0ba8('0x33')][_0x0ba8('0x38')]));_0x4146e0[_0x0ba8('0x37')]=_0x4146e0[_0x0ba8('0x37')][_0x0ba8('0x39')]?_0x4146e0[_0x0ba8('0x37')]:_0x4820dd['model'];_0x4146e0[_0x0ba8('0x3c')]=qs[_0x0ba8('0x3d')](_0x534cac[_0x0ba8('0x33')][_0x0ba8('0x3d')]);_0x4146e0['where']=qs[_0x0ba8('0x34')](_[_0x0ba8('0x3f')](_0x534cac[_0x0ba8('0x33')],_0x4820dd[_0x0ba8('0x34')]));if(_0x534cac[_0x0ba8('0x33')][_0x0ba8('0x40')]){_0x4146e0[_0x0ba8('0x3e')]=_['merge'](_0x4146e0[_0x0ba8('0x3e')],{'$or':_[_0x0ba8('0x31')](_0x4146e0['attributes'],function(_0x5cadf9){var _0x3a74c4={};_0x3a74c4[_0x5cadf9]={'$like':'%'+_0x534cac['query'][_0x0ba8('0x40')]+'%'};return _0x3a74c4;})});}_0x4146e0=_[_0x0ba8('0x41')]({},_0x4146e0,_0x534cac[_0x0ba8('0x43')]);return _0x17fb14[_0x0ba8('0x65')](_0x4146e0);}})[_0x0ba8('0x2a')](function(_0x573b52){if(_0x573b52){_0x30b3ae=_0x573b52['length'];if(!_0x534cac[_0x0ba8('0x33')]['hasOwnProperty']('nolimit')){_0x4146e0[_0x0ba8('0x23')]=qs[_0x0ba8('0x23')](_0x534cac[_0x0ba8('0x33')][_0x0ba8('0x23')]);_0x4146e0['offset']=qs[_0x0ba8('0x21')](_0x534cac[_0x0ba8('0x33')][_0x0ba8('0x21')]);}return _0x17fb14[_0x0ba8('0x65')](_0x4146e0);}})['then'](function(_0x5147d9){if(_0x5147d9){return _0x5147d9?{'count':_0x30b3ae,'rows':_0x5147d9}:null;}})[_0x0ba8('0x2a')](respondWithResult(_0x153abb,null))['catch'](handleError(_0x153abb,null));};exports['addTeams']=function(_0x3b2470,_0x17a738,_0x46895a){var _0x3e79de=_0x3b2470[_0x0ba8('0x55')][_0x0ba8('0x66')];return db[_0x0ba8('0x67')][_0x0ba8('0x5b')]({'where':{'id':_0x3e79de},'attributes':['id'],'include':[{'model':db[_0x0ba8('0x5c')],'as':'Agents','attributes':['id',_0x0ba8('0x2f'),_0x0ba8('0x68'),_0x0ba8('0x69'),'interface'],'raw':!![]}]})[_0x0ba8('0x2a')](function(_0x140480){if(_0x140480){var _0x1afc45=_[_0x0ba8('0x6a')](_0x140480,function(_0x3a40a3){var _0x30fe09=_0x3a40a3[_0x0ba8('0x4b')]({'plain':!![]});return _0x30fe09[_0x0ba8('0x6b')];});return db[_0x0ba8('0x32')][_0x0ba8('0x50')]({'where':{'id':_0x3b2470['params']['id']}})[_0x0ba8('0x2a')](function(_0x29b537){return db[_0x0ba8('0x6c')][_0x0ba8('0x6d')](function(_0x13fc5f){return _0x29b537[_0x0ba8('0x6e')](_0x3e79de,{'transaction':_0x13fc5f})[_0x0ba8('0x2a')](function(){return BPromise[_0x0ba8('0x6f')](_0x1afc45,function(_0x30b115){return db[_0x0ba8('0x59')][_0x0ba8('0x70')]({'where':{'UserId':_0x30b115['id'],'OpenchannelQueueId':_0x3b2470['params']['id']},'transaction':_0x13fc5f});});})[_0x0ba8('0x2a')](function(){_0x1afc45['forEach'](function(_0x2c851c){socket[_0x0ba8('0x71')](_0x0ba8('0x72'),{'UserId':_0x2c851c['id'],'OpenchannelQueueId':_0x29b537['id']});});});});});}})['then'](respondWithStatusCode(_0x17a738,null))[_0x0ba8('0x45')](handleError(_0x17a738,null));};exports[_0x0ba8('0x73')]=function(_0x16d3f7,_0x3a174b,_0x320167){return db[_0x0ba8('0x67')][_0x0ba8('0x5b')]({'where':{'id':_0x16d3f7[_0x0ba8('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0ba8('0x5c')],'as':_0x0ba8('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x0ba8('0x2a')](handleEntityNotFound(_0x3a174b,null))[_0x0ba8('0x2a')](function(_0x164c28){var _0xe5a375=_['map'](_0x164c28,'id');var _0x25d322=[];var _0x447c18=[];var _0x535b6c=squel['select']();_0x535b6c[_0x0ba8('0x74')](_0x0ba8('0x75'))[_0x0ba8('0x76')](_0x0ba8('0x77'),'tq')['join'](_0x0ba8('0x78'),'ut',_0x0ba8('0x79'))[_0x0ba8('0x3e')](_0x0ba8('0x7a'),_0x16d3f7[_0x0ba8('0x47')]['id']);for(var _0xf620ee=0x0;_0xf620ee<_0x164c28[_0x0ba8('0x39')];_0xf620ee+=0x1){let _0x2dfbef=_0x164c28[_0xf620ee];for(var _0x3f8fc6=0x0;_0x3f8fc6<_0x2dfbef[_0x0ba8('0x6b')][_0x0ba8('0x39')];_0x3f8fc6+=0x1){let _0x3bd2ea=_0x2dfbef['Agents'][_0x3f8fc6];var _0x4f6d64=_0x535b6c[_0x0ba8('0x7b')]();_0x4f6d64[_0x0ba8('0x3e')](_0x0ba8('0x7c'),_0x3bd2ea['id']);_0x447c18[_0x0ba8('0x7d')](db[_0x0ba8('0x6c')][_0x0ba8('0x33')](_0x4f6d64[_0x0ba8('0x7e')](),{'type':db['sequelize'][_0x0ba8('0x7f')][_0x0ba8('0x80')]})[_0x0ba8('0x2a')](function(_0x14f59b){if(_0x14f59b[_0x0ba8('0x39')]===0x1){return _0x3bd2ea['id'];}else{var _0x1498de=_[_0x0ba8('0x81')](_[_0x0ba8('0x31')](_0x14f59b,_0x0ba8('0x82')),function(_0x1483b9){return _[_0x0ba8('0x83')](_0xe5a375,_0x1483b9);});if(_0x1498de){return _0x3bd2ea['id'];}}}));}}return BPromise[_0x0ba8('0x84')](_0x447c18)[_0x0ba8('0x2a')](function(_0x37f4e6){_0x25d322=_(_0x25d322)[_0x0ba8('0x85')](_0x37f4e6)[_0x0ba8('0x86')]()[_0x0ba8('0x87')]();return db[_0x0ba8('0x32')][_0x0ba8('0x50')]({'where':{'id':_0x16d3f7[_0x0ba8('0x47')]['id']}})['then'](function(_0x31dd63){return db[_0x0ba8('0x6c')][_0x0ba8('0x6d')](function(_0x5c6aa0){return _0x31dd63[_0x0ba8('0x73')](_0x16d3f7[_0x0ba8('0x33')][_0x0ba8('0x66')],{'transaction':_0x5c6aa0})[_0x0ba8('0x2a')](function(){if(!_[_0x0ba8('0x88')](_0x25d322)){return _0x31dd63[_0x0ba8('0x89')](_0x25d322,{'transaction':_0x5c6aa0});}})[_0x0ba8('0x2a')](function(){_0x25d322[_0x0ba8('0x8a')](function(_0x7134a1){socket[_0x0ba8('0x71')](_0x0ba8('0x8b'),{'UserId':_0x7134a1,'OpenchannelQueueId':_0x31dd63['id']});});});});});});})['then'](respondWithStatusCode(_0x3a174b,null))[_0x0ba8('0x45')](handleError(_0x3a174b,null));};exports[_0x0ba8('0x8c')]=function(_0xe3e4b4,_0x51ca42,_0x4f8a87){return db['OpenchannelQueue'][_0x0ba8('0x50')]({'where':{'id':_0xe3e4b4[_0x0ba8('0x47')]['id']}})[_0x0ba8('0x2a')](handleEntityNotFound(_0x51ca42,null))['then'](function(_0x5605bd){if(_0x5605bd){return _0x5605bd[_0x0ba8('0x8c')](_0xe3e4b4['body'][_0x0ba8('0x66')],_['omit'](_0xe3e4b4[_0x0ba8('0x55')],[_0x0ba8('0x66'),'id'])||{})[_0x0ba8('0x8d')](function(_0xe29ae3){for(var _0x2e686e=0x0;_0x2e686e<_0xe3e4b4['body']['ids'][_0x0ba8('0x39')];_0x2e686e+=0x1){socket[_0x0ba8('0x71')](_0x0ba8('0x72'),{'UserId':Number(_0xe3e4b4[_0x0ba8('0x55')][_0x0ba8('0x66')][_0x2e686e]),'OpenchannelQueueId':Number(_0xe3e4b4['params']['id'])});}return _0xe29ae3;});}})['then'](respondWithResult(_0x51ca42,null))[_0x0ba8('0x45')](handleError(_0x51ca42,null));};exports['removeAgents']=function(_0x3cf94b,_0x4bdb4d,_0x7dabb3){return db[_0x0ba8('0x32')]['find']({'where':{'id':_0x3cf94b[_0x0ba8('0x47')]['id']}})['then'](handleEntityNotFound(_0x4bdb4d,null))[_0x0ba8('0x2a')](function(_0x44f4c0){if(_0x44f4c0){return _0x44f4c0[_0x0ba8('0x89')](_0x3cf94b[_0x0ba8('0x33')]['ids'])[_0x0ba8('0x2a')](function(){if(_[_0x0ba8('0x8e')](_0x3cf94b['query'][_0x0ba8('0x66')])){for(var _0x2a2f4=0x0;_0x2a2f4<_0x3cf94b[_0x0ba8('0x33')]['ids'][_0x0ba8('0x39')];_0x2a2f4+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x3cf94b[_0x0ba8('0x33')][_0x0ba8('0x66')][_0x2a2f4]),'OpenchannelQueueId':Number(_0x3cf94b[_0x0ba8('0x47')]['id'])});}}else{socket['emit'](_0x0ba8('0x8b'),{'UserId':Number(_0x3cf94b[_0x0ba8('0x33')][_0x0ba8('0x66')]),'OpenchannelQueueId':Number(_0x3cf94b[_0x0ba8('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x4bdb4d,null))[_0x0ba8('0x45')](handleError(_0x4bdb4d,null));};exports['getAgents']=function(_0x646839,_0xac52de,_0x21f440){var _0x34b708={};var _0x4f77b2={};var _0x45ab7c;var _0x26b0c1;return db[_0x0ba8('0x32')][_0x0ba8('0x58')]({'where':{'id':_0x646839[_0x0ba8('0x47')]['id']}})[_0x0ba8('0x2a')](handleEntityNotFound(_0xac52de,null))[_0x0ba8('0x2a')](function(_0x57bed9){if(_0x57bed9){_0x45ab7c=_0x57bed9;_0x4f77b2[_0x0ba8('0x36')]=_['keys'](db[_0x0ba8('0x5c')]['rawAttributes']);_0x4f77b2[_0x0ba8('0x33')]=_[_0x0ba8('0x48')](_0x646839['query']);_0x4f77b2['filters']=_[_0x0ba8('0x35')](_0x4f77b2[_0x0ba8('0x36')],_0x4f77b2[_0x0ba8('0x33')]);_0x34b708['attributes']=_['intersection'](_0x4f77b2[_0x0ba8('0x36')],qs[_0x0ba8('0x38')](_0x646839['query'][_0x0ba8('0x38')]));_0x34b708[_0x0ba8('0x37')]=_0x34b708[_0x0ba8('0x37')][_0x0ba8('0x39')]?_0x34b708[_0x0ba8('0x37')]:_0x4f77b2[_0x0ba8('0x36')];_0x34b708[_0x0ba8('0x3c')]=qs['sort'](_0x646839[_0x0ba8('0x33')][_0x0ba8('0x3d')]);_0x34b708[_0x0ba8('0x3e')]=qs[_0x0ba8('0x34')](_[_0x0ba8('0x3f')](_0x646839['query'],_0x4f77b2['filters']));if(_0x646839[_0x0ba8('0x33')][_0x0ba8('0x40')]){_0x34b708['where']=_[_0x0ba8('0x41')](_0x34b708[_0x0ba8('0x3e')],{'$or':_[_0x0ba8('0x31')](_0x34b708[_0x0ba8('0x37')],function(_0x12a80e){var _0xaf1ec0={};_0xaf1ec0[_0x12a80e]={'$like':'%'+_0x646839[_0x0ba8('0x33')]['filter']+'%'};return _0xaf1ec0;})});}_0x34b708=_[_0x0ba8('0x41')]({},_0x34b708,_0x646839[_0x0ba8('0x43')]);return _0x45ab7c[_0x0ba8('0x8f')](_0x34b708);}})['then'](function(_0x2bab0c){if(_0x2bab0c){_0x26b0c1=_0x2bab0c[_0x0ba8('0x39')];if(!_0x646839[_0x0ba8('0x33')][_0x0ba8('0x3a')]('nolimit')){_0x34b708[_0x0ba8('0x23')]=qs[_0x0ba8('0x23')](_0x646839[_0x0ba8('0x33')][_0x0ba8('0x23')]);_0x34b708['offset']=qs[_0x0ba8('0x21')](_0x646839[_0x0ba8('0x33')][_0x0ba8('0x21')]);}return _0x45ab7c['getAgents'](_0x34b708);}})[_0x0ba8('0x2a')](function(_0x4e8fce){if(_0x4e8fce){return _0x4e8fce?{'count':_0x26b0c1,'rows':_0x4e8fce}:null;}})[_0x0ba8('0x2a')](respondWithResult(_0xac52de,null))[_0x0ba8('0x45')](handleError(_0xac52de,null));}; \ No newline at end of file +var _0x9a4a=['%s/%s','SIP','getTeams','hasOwnProperty','addTeams','ids','online','voicePause','flatMap','Agents','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','TeamId','includes','all','compact','transaction','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','order','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','keys','UserOpenchannelQueue','nolimit','sort','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9a4a,0xb7));var _0xa9a4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9a4a[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9a4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9a4('0x1'));var rp=require(_0xa9a4('0x2'));var moment=require(_0xa9a4('0x3'));var BPromise=require(_0xa9a4('0x4'));var Mustache=require('mustache');var util=require(_0xa9a4('0x5'));var path=require(_0xa9a4('0x6'));var sox=require(_0xa9a4('0x7'));var csv=require(_0xa9a4('0x8'));var ejs=require(_0xa9a4('0x9'));var fs=require('fs');var fs_extra=require(_0xa9a4('0xa'));var _=require(_0xa9a4('0xb'));var squel=require(_0xa9a4('0xc'));var crypto=require(_0xa9a4('0xd'));var jsforce=require(_0xa9a4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa9a4('0x8'));var querystring=require('querystring');var Papa=require(_0xa9a4('0xf'));var Redis=require(_0xa9a4('0x10'));var authService=require(_0xa9a4('0x11'));var qs=require(_0xa9a4('0x12'));var as=require(_0xa9a4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9a4('0x14'))(_0xa9a4('0x15'));var utils=require(_0xa9a4('0x16'));var config=require(_0xa9a4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa9a4('0x18')]=_[_0xa9a4('0x19')](config[_0xa9a4('0x18')],{'host':_0xa9a4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa9a4('0x18')]));require('./openchannelQueue.socket')[_0xa9a4('0x1b')](socket);function respondWithStatusCode(_0x37d8b5,_0x4e8a51){_0x4e8a51=_0x4e8a51||0xcc;return function(_0x1c7fdc){if(_0x1c7fdc){return _0x37d8b5[_0xa9a4('0x1c')](_0x4e8a51);}return _0x37d8b5['status'](_0x4e8a51)[_0xa9a4('0x1d')]();};}function respondWithResult(_0x52d8,_0x197c01){_0x197c01=_0x197c01||0xc8;return function(_0x32afd5){if(_0x32afd5){return _0x52d8[_0xa9a4('0x1e')](_0x197c01)[_0xa9a4('0x1f')](_0x32afd5);}};}function respondWithFilteredResult(_0x5b4ca5,_0x992c43){return function(_0xf608bc){if(_0xf608bc){var _0x3f4cf1=typeof _0x992c43[_0xa9a4('0x20')]===_0xa9a4('0x21')&&typeof _0x992c43['limit']===_0xa9a4('0x21');var _0xb48506=_0xf608bc[_0xa9a4('0x22')];var _0xb82e78=_0x3f4cf1?0x0:_0x992c43[_0xa9a4('0x20')];var _0x4379fe=_0x3f4cf1?_0xf608bc[_0xa9a4('0x22')]:_0x992c43[_0xa9a4('0x20')]+_0x992c43[_0xa9a4('0x23')];var _0x1cc934;if(_0x4379fe>=_0xb48506){_0x4379fe=_0xb48506;_0x1cc934=0xc8;}else{_0x1cc934=0xce;}_0x5b4ca5[_0xa9a4('0x1e')](_0x1cc934);return _0x5b4ca5[_0xa9a4('0x24')](_0xa9a4('0x25'),_0xb82e78+'-'+_0x4379fe+'/'+_0xb48506)['json'](_0xf608bc);}return null;};}function patchUpdates(_0x26c8fc){return function(_0x32c4cb){try{jsonpatch[_0xa9a4('0x26')](_0x32c4cb,_0x26c8fc,!![]);}catch(_0x3f0ef0){return BPromise['reject'](_0x3f0ef0);}return _0x32c4cb[_0xa9a4('0x27')]();};}function saveUpdates(_0x2a5008,_0x8ec443){return function(_0x2c18c4){if(_0x2c18c4){return _0x2c18c4[_0xa9a4('0x28')](_0x2a5008)['then'](function(_0x3b2e92){return _0x3b2e92;});}return null;};}function removeEntity(_0x5a70ed,_0x38d530){return function(_0x1acf62){if(_0x1acf62){return _0x1acf62[_0xa9a4('0x29')]()[_0xa9a4('0x2a')](function(){var _0x4c3547=_0x1acf62[_0xa9a4('0x2b')]({'plain':!![]});var _0x150b3c=_0xa9a4('0x2c');return db[_0xa9a4('0x2d')][_0xa9a4('0x29')]({'where':{'type':_0x150b3c,'resourceId':_0x4c3547['id']}})['then'](function(){return _0x1acf62;});})['then'](function(){_0x5a70ed[_0xa9a4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55d0bd,_0x32c40a){return function(_0x467d83){if(!_0x467d83){_0x55d0bd[_0xa9a4('0x1c')](0x194);}return _0x467d83;};}function handleError(_0x1f5b09,_0x3c01d4){_0x3c01d4=_0x3c01d4||0x1f4;return function(_0x510f8b){logger[_0xa9a4('0x2e')](_0x510f8b[_0xa9a4('0x2f')]);if(_0x510f8b[_0xa9a4('0x30')]){delete _0x510f8b[_0xa9a4('0x30')];}_0x1f5b09['status'](_0x3c01d4)[_0xa9a4('0x31')](_0x510f8b);};}exports[_0xa9a4('0x32')]=function(_0x12d4c9,_0x3f6af3){var _0x3203fe={},_0x29edb4={},_0x2d6b70={'count':0x0,'rows':[]};var _0x2065f7=_[_0xa9a4('0x33')](db[_0xa9a4('0x34')][_0xa9a4('0x35')],function(_0x41b95b){return{'name':_0x41b95b['fieldName'],'type':_0x41b95b[_0xa9a4('0x36')][_0xa9a4('0x37')]};});_0x29edb4[_0xa9a4('0x38')]=_['map'](_0x2065f7,_0xa9a4('0x30'));_0x29edb4[_0xa9a4('0x39')]=_['keys'](_0x12d4c9[_0xa9a4('0x39')]);_0x29edb4[_0xa9a4('0x3a')]=_[_0xa9a4('0x3b')](_0x29edb4['model'],_0x29edb4[_0xa9a4('0x39')]);_0x3203fe[_0xa9a4('0x3c')]=_[_0xa9a4('0x3b')](_0x29edb4[_0xa9a4('0x38')],qs[_0xa9a4('0x3d')](_0x12d4c9[_0xa9a4('0x39')][_0xa9a4('0x3d')]));_0x3203fe['attributes']=_0x3203fe[_0xa9a4('0x3c')][_0xa9a4('0x3e')]?_0x3203fe[_0xa9a4('0x3c')]:_0x29edb4[_0xa9a4('0x38')];if(!_0x12d4c9[_0xa9a4('0x39')]['hasOwnProperty']('nolimit')){_0x3203fe[_0xa9a4('0x23')]=qs[_0xa9a4('0x23')](_0x12d4c9[_0xa9a4('0x39')]['limit']);_0x3203fe[_0xa9a4('0x20')]=qs['offset'](_0x12d4c9['query'][_0xa9a4('0x20')]);}_0x3203fe[_0xa9a4('0x3f')]=qs['sort'](_0x12d4c9[_0xa9a4('0x39')]['sort']);_0x3203fe[_0xa9a4('0x40')]=qs[_0xa9a4('0x3a')](_[_0xa9a4('0x41')](_0x12d4c9[_0xa9a4('0x39')],_0x29edb4['filters']),_0x2065f7);if(_0x12d4c9[_0xa9a4('0x39')][_0xa9a4('0x42')]){_0x3203fe[_0xa9a4('0x40')]=_[_0xa9a4('0x43')](_0x3203fe[_0xa9a4('0x40')],{'$or':_[_0xa9a4('0x33')](_0x2065f7,function(_0x3b17ab){if(_0x3b17ab[_0xa9a4('0x36')]!=='VIRTUAL'){var _0x42d6f2={};_0x42d6f2[_0x3b17ab[_0xa9a4('0x30')]]={'$like':'%'+_0x12d4c9[_0xa9a4('0x39')]['filter']+'%'};return _0x42d6f2;}})});}_0x3203fe=_[_0xa9a4('0x43')]({},_0x3203fe,_0x12d4c9[_0xa9a4('0x44')]);var _0x446b3f={'where':_0x3203fe[_0xa9a4('0x40')]};return db[_0xa9a4('0x34')][_0xa9a4('0x22')](_0x446b3f)[_0xa9a4('0x2a')](function(_0x269132){_0x2d6b70[_0xa9a4('0x22')]=_0x269132;if(_0x12d4c9[_0xa9a4('0x39')][_0xa9a4('0x45')]){_0x3203fe[_0xa9a4('0x46')]=[{'all':!![]}];}return db[_0xa9a4('0x34')][_0xa9a4('0x47')](_0x3203fe);})['then'](function(_0x4218be){_0x2d6b70['rows']=_0x4218be;return _0x2d6b70;})['then'](respondWithFilteredResult(_0x3f6af3,_0x3203fe))[_0xa9a4('0x48')](handleError(_0x3f6af3,null));};exports[_0xa9a4('0x49')]=function(_0x5e8a62,_0x57adcf){var _0x688626={'raw':!![],'where':{'id':_0x5e8a62[_0xa9a4('0x4a')]['id']}},_0x3401f0={};_0x3401f0[_0xa9a4('0x38')]=_['keys'](db[_0xa9a4('0x34')]['rawAttributes']);_0x3401f0['query']=_['keys'](_0x5e8a62['query']);_0x3401f0[_0xa9a4('0x3a')]=_[_0xa9a4('0x3b')](_0x3401f0[_0xa9a4('0x38')],_0x3401f0['query']);_0x688626[_0xa9a4('0x3c')]=_[_0xa9a4('0x3b')](_0x3401f0[_0xa9a4('0x38')],qs['fields'](_0x5e8a62['query'][_0xa9a4('0x3d')]));_0x688626[_0xa9a4('0x3c')]=_0x688626['attributes'][_0xa9a4('0x3e')]?_0x688626['attributes']:_0x3401f0[_0xa9a4('0x38')];if(_0x5e8a62[_0xa9a4('0x39')][_0xa9a4('0x45')]){_0x688626[_0xa9a4('0x46')]=[{'all':!![]}];}_0x688626=_['merge']({},_0x688626,_0x5e8a62[_0xa9a4('0x44')]);return db['OpenchannelQueue']['find'](_0x688626)['then'](handleEntityNotFound(_0x57adcf,null))[_0xa9a4('0x2a')](respondWithResult(_0x57adcf,null))[_0xa9a4('0x48')](handleError(_0x57adcf,null));};exports['create']=function(_0xc3044a,_0x18844f){return db['OpenchannelQueue'][_0xa9a4('0x4b')](_0xc3044a[_0xa9a4('0x4c')],{})[_0xa9a4('0x2a')](function(_0x2cd004){var _0x5e853d=_0xc3044a['user'][_0xa9a4('0x2b')]({'plain':!![]});if(!_0x5e853d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e853d[_0xa9a4('0x4d')]===_0xa9a4('0x4e')){var _0x404847=_0x2cd004['get']({'plain':!![]});var _0x1f91a8='OpenchannelQueues';return db[_0xa9a4('0x4f')]['find']({'where':{'name':_0x1f91a8,'userProfileId':_0x5e853d[_0xa9a4('0x50')]},'raw':!![]})[_0xa9a4('0x2a')](function(_0x23a2e0){if(_0x23a2e0&&_0x23a2e0[_0xa9a4('0x51')]===0x0){return db['UserProfileResource'][_0xa9a4('0x4b')]({'name':_0x404847['name'],'resourceId':_0x404847['id'],'type':_0x23a2e0[_0xa9a4('0x30')],'sectionId':_0x23a2e0['id']},{})[_0xa9a4('0x2a')](function(){return _0x2cd004;});}else{return _0x2cd004;}})[_0xa9a4('0x48')](function(_0x5828a6){logger['error'](_0xa9a4('0x52'),_0x5828a6);throw _0x5828a6;});}return _0x2cd004;})[_0xa9a4('0x2a')](respondWithResult(_0x18844f,0xc9))[_0xa9a4('0x48')](handleError(_0x18844f,null));};exports[_0xa9a4('0x28')]=function(_0x3f28c5,_0x4b8ba7){if(_0x3f28c5[_0xa9a4('0x4c')]['id']){delete _0x3f28c5[_0xa9a4('0x4c')]['id'];}return db[_0xa9a4('0x34')][_0xa9a4('0x53')]({'where':{'id':_0x3f28c5[_0xa9a4('0x4a')]['id']}})[_0xa9a4('0x2a')](handleEntityNotFound(_0x4b8ba7,null))[_0xa9a4('0x2a')](saveUpdates(_0x3f28c5[_0xa9a4('0x4c')],null))[_0xa9a4('0x2a')](respondWithResult(_0x4b8ba7,null))[_0xa9a4('0x48')](handleError(_0x4b8ba7,null));};exports['destroy']=function(_0x13f0b9,_0x465f8f){return db[_0xa9a4('0x34')][_0xa9a4('0x53')]({'where':{'id':_0x13f0b9[_0xa9a4('0x4a')]['id']}})[_0xa9a4('0x2a')](handleEntityNotFound(_0x465f8f,null))[_0xa9a4('0x2a')](removeEntity(_0x465f8f,null))[_0xa9a4('0x48')](handleError(_0x465f8f,null));};exports[_0xa9a4('0x54')]=function(_0x3462e9,_0x4a4ec7){return db[_0xa9a4('0x34')]['describe']()[_0xa9a4('0x2a')](respondWithResult(_0x4a4ec7,null))['catch'](handleError(_0x4a4ec7,null));};exports[_0xa9a4('0x55')]=function(_0x21df14,_0x5610ab,_0x10383c){var _0x4a03a9={'raw':!![],'where':{}},_0x56377c={},_0x19278a;return db['OpenchannelQueue'][_0xa9a4('0x56')]({'where':{'id':_0x21df14['params']['id']}})[_0xa9a4('0x2a')](handleEntityNotFound(_0x5610ab,null))[_0xa9a4('0x2a')](function(_0x2e688e){if(_0x2e688e){_0x19278a=_0x2e688e['get']({'plain':!![]});_0x56377c['model']=_[_0xa9a4('0x57')](db[_0xa9a4('0x58')][_0xa9a4('0x35')]);_0x56377c[_0xa9a4('0x39')]=_[_0xa9a4('0x57')](_0x21df14['query']);_0x56377c['filters']=_[_0xa9a4('0x3b')](_0x56377c[_0xa9a4('0x38')],_0x56377c[_0xa9a4('0x39')]);_0x4a03a9['attributes']=_[_0xa9a4('0x3b')](_0x56377c[_0xa9a4('0x38')],qs[_0xa9a4('0x3d')](_0x21df14['query'][_0xa9a4('0x3d')]));_0x4a03a9['attributes']=_0x4a03a9[_0xa9a4('0x3c')]['length']?_0x4a03a9[_0xa9a4('0x3c')]:_0x56377c['model'];if(!_0x21df14[_0xa9a4('0x39')]['hasOwnProperty'](_0xa9a4('0x59'))){_0x4a03a9[_0xa9a4('0x23')]=qs['limit'](_0x21df14['query'][_0xa9a4('0x23')]);_0x4a03a9[_0xa9a4('0x20')]=qs[_0xa9a4('0x20')](_0x21df14[_0xa9a4('0x39')][_0xa9a4('0x20')]);}_0x4a03a9[_0xa9a4('0x3f')]=qs['sort'](_0x21df14['query'][_0xa9a4('0x5a')]);_0x4a03a9[_0xa9a4('0x40')]=qs[_0xa9a4('0x3a')](_[_0xa9a4('0x41')](_0x21df14['query'],_0x56377c[_0xa9a4('0x3a')]));_0x4a03a9[_0xa9a4('0x40')][_0xa9a4('0x5b')]=_0x2e688e['id'];if(_0x21df14['query'][_0xa9a4('0x42')]){_0x4a03a9['where']=_[_0xa9a4('0x43')](_0x4a03a9[_0xa9a4('0x40')],{'$or':_[_0xa9a4('0x33')](_0x4a03a9[_0xa9a4('0x3c')],function(_0x325b2c){var _0x52c2d7={};_0x52c2d7[_0x325b2c]={'$like':'%'+_0x21df14[_0xa9a4('0x39')][_0xa9a4('0x42')]+'%'};return _0x52c2d7;})});}_0x4a03a9=_[_0xa9a4('0x43')]({},_0x4a03a9,_0x21df14['options']);return db[_0xa9a4('0x58')][_0xa9a4('0x47')](_0x4a03a9);}})[_0xa9a4('0x2a')](function(_0x55f9d6){if(_0x55f9d6){return db[_0xa9a4('0x5c')][_0xa9a4('0x5d')]({'where':{'id':_[_0xa9a4('0x33')](_0x55f9d6,_0xa9a4('0x5e')),'role':'agent'},'attributes':['id',_0xa9a4('0x30'),_0xa9a4('0x5f'),_0xa9a4('0x60'),_0xa9a4('0x61')]});}})[_0xa9a4('0x2a')](function(_0x40259b){if(_0x40259b){return{'count':_0x40259b['count'],'rows':_[_0xa9a4('0x33')](_0x40259b['rows'],function(_0xd986d8){return{'membername':_0xd986d8[_0xa9a4('0x30')],'UserId':_0xd986d8['id'],'queue_name':_0x19278a[_0xa9a4('0x30')],'OpenchannelQueueId':_0x19278a['id'],'interface':util[_0xa9a4('0x62')](_0xa9a4('0x63'),_0xa9a4('0x64'),_0xd986d8[_0xa9a4('0x30')]),'penalty':0x0,'paused':_0xd986d8[_0xa9a4('0x5f')],'createdAt':_0xd986d8[_0xa9a4('0x61')],'updatedAt':_0xd986d8[_0xa9a4('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa9a4('0x2a')](respondWithFilteredResult(_0x5610ab,_0x4a03a9))['catch'](handleError(_0x5610ab,null));};exports[_0xa9a4('0x65')]=function(_0xc6bc78,_0x43edec,_0x4ffba7){var _0x4b1ad6={};var _0x52d62c={};var _0x27ee81;var _0x410496;return db['OpenchannelQueue']['findOne']({'where':{'id':_0xc6bc78[_0xa9a4('0x4a')]['id']}})[_0xa9a4('0x2a')](handleEntityNotFound(_0x43edec,null))['then'](function(_0x17e18d){if(_0x17e18d){_0x27ee81=_0x17e18d;_0x52d62c['model']=_['keys'](db['Team'][_0xa9a4('0x35')]);_0x52d62c[_0xa9a4('0x39')]=_[_0xa9a4('0x57')](_0xc6bc78[_0xa9a4('0x39')]);_0x52d62c[_0xa9a4('0x3a')]=_['intersection'](_0x52d62c[_0xa9a4('0x38')],_0x52d62c[_0xa9a4('0x39')]);_0x4b1ad6[_0xa9a4('0x3c')]=_[_0xa9a4('0x3b')](_0x52d62c[_0xa9a4('0x38')],qs[_0xa9a4('0x3d')](_0xc6bc78['query'][_0xa9a4('0x3d')]));_0x4b1ad6[_0xa9a4('0x3c')]=_0x4b1ad6[_0xa9a4('0x3c')][_0xa9a4('0x3e')]?_0x4b1ad6['attributes']:_0x52d62c[_0xa9a4('0x38')];_0x4b1ad6[_0xa9a4('0x3f')]=qs[_0xa9a4('0x5a')](_0xc6bc78[_0xa9a4('0x39')]['sort']);_0x4b1ad6['where']=qs[_0xa9a4('0x3a')](_[_0xa9a4('0x41')](_0xc6bc78[_0xa9a4('0x39')],_0x52d62c[_0xa9a4('0x3a')]));if(_0xc6bc78[_0xa9a4('0x39')][_0xa9a4('0x42')]){_0x4b1ad6['where']=_[_0xa9a4('0x43')](_0x4b1ad6[_0xa9a4('0x40')],{'$or':_[_0xa9a4('0x33')](_0x4b1ad6[_0xa9a4('0x3c')],function(_0x3332e9){var _0x48f302={};_0x48f302[_0x3332e9]={'$like':'%'+_0xc6bc78[_0xa9a4('0x39')]['filter']+'%'};return _0x48f302;})});}_0x4b1ad6=_[_0xa9a4('0x43')]({},_0x4b1ad6,_0xc6bc78[_0xa9a4('0x44')]);return _0x27ee81[_0xa9a4('0x65')](_0x4b1ad6);}})[_0xa9a4('0x2a')](function(_0x1611f9){if(_0x1611f9){_0x410496=_0x1611f9[_0xa9a4('0x3e')];if(!_0xc6bc78[_0xa9a4('0x39')][_0xa9a4('0x66')](_0xa9a4('0x59'))){_0x4b1ad6['limit']=qs[_0xa9a4('0x23')](_0xc6bc78[_0xa9a4('0x39')][_0xa9a4('0x23')]);_0x4b1ad6[_0xa9a4('0x20')]=qs[_0xa9a4('0x20')](_0xc6bc78[_0xa9a4('0x39')][_0xa9a4('0x20')]);}return _0x27ee81[_0xa9a4('0x65')](_0x4b1ad6);}})[_0xa9a4('0x2a')](function(_0x3bcc03){if(_0x3bcc03){return _0x3bcc03?{'count':_0x410496,'rows':_0x3bcc03}:null;}})[_0xa9a4('0x2a')](respondWithResult(_0x43edec,null))[_0xa9a4('0x48')](handleError(_0x43edec,null));};exports[_0xa9a4('0x67')]=function(_0x4822eb,_0xa43a27,_0x3caaac){var _0x43c616=_0x4822eb[_0xa9a4('0x4c')][_0xa9a4('0x68')];return db['Team'][_0xa9a4('0x47')]({'where':{'id':_0x43c616},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa9a4('0x30'),_0xa9a4('0x69'),_0xa9a4('0x6a'),'interface'],'raw':!![]}]})['then'](function(_0x564b94){if(_0x564b94){var _0x3cd13f=_[_0xa9a4('0x6b')](_0x564b94,function(_0x408fa8){var _0x2db5df=_0x408fa8[_0xa9a4('0x2b')]({'plain':!![]});return _0x2db5df[_0xa9a4('0x6c')];});return db[_0xa9a4('0x34')][_0xa9a4('0x53')]({'where':{'id':_0x4822eb[_0xa9a4('0x4a')]['id']}})['then'](function(_0x374054){return db[_0xa9a4('0x6d')]['transaction'](function(_0x123acb){return _0x374054[_0xa9a4('0x67')](_0x43c616,{'transaction':_0x123acb})[_0xa9a4('0x2a')](function(){return BPromise[_0xa9a4('0x6e')](_0x3cd13f,function(_0x3f3dd6){return db['UserOpenchannelQueue'][_0xa9a4('0x6f')]({'where':{'UserId':_0x3f3dd6['id'],'OpenchannelQueueId':_0x4822eb[_0xa9a4('0x4a')]['id']},'transaction':_0x123acb});});})[_0xa9a4('0x2a')](function(){_0x3cd13f[_0xa9a4('0x70')](function(_0x62d8f8){socket[_0xa9a4('0x71')](_0xa9a4('0x72'),{'UserId':_0x62d8f8['id'],'OpenchannelQueueId':_0x374054['id']});});});});});}})['then'](respondWithStatusCode(_0xa43a27,null))[_0xa9a4('0x48')](handleError(_0xa43a27,null));};exports[_0xa9a4('0x73')]=function(_0x31bfbc,_0x25501d,_0xbdf280){return db[_0xa9a4('0x74')]['findAll']({'where':{'id':_0x31bfbc[_0xa9a4('0x39')][_0xa9a4('0x68')]},'attributes':['id'],'include':[{'model':db[_0xa9a4('0x5c')],'as':_0xa9a4('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x25501d,null))[_0xa9a4('0x2a')](function(_0x3af2f5){var _0x46f6b8=_['map'](_0x3af2f5,'id');var _0x8c649e=[];var _0x3afafa=[];var _0x34bc48=squel[_0xa9a4('0x75')]();_0x34bc48[_0xa9a4('0x76')](_0xa9a4('0x77'))['from'](_0xa9a4('0x78'),'tq')[_0xa9a4('0x79')](_0xa9a4('0x7a'),'ut',_0xa9a4('0x7b'))[_0xa9a4('0x40')](_0xa9a4('0x7c'),_0x31bfbc['params']['id']);for(var _0x147115=0x0;_0x147115<_0x3af2f5[_0xa9a4('0x3e')];_0x147115+=0x1){let _0x1dc05a=_0x3af2f5[_0x147115];for(var _0x5ea01d=0x0;_0x5ea01d<_0x1dc05a[_0xa9a4('0x6c')][_0xa9a4('0x3e')];_0x5ea01d+=0x1){let _0x5214e3=_0x1dc05a[_0xa9a4('0x6c')][_0x5ea01d];var _0x2d2ca4=_0x34bc48[_0xa9a4('0x7d')]();_0x2d2ca4[_0xa9a4('0x40')](_0xa9a4('0x7e'),_0x5214e3['id']);_0x3afafa['push'](db[_0xa9a4('0x6d')]['query'](_0x2d2ca4[_0xa9a4('0x7f')](),{'type':db[_0xa9a4('0x6d')]['QueryTypes'][_0xa9a4('0x80')]})[_0xa9a4('0x2a')](function(_0x4f5036){if(_0x4f5036[_0xa9a4('0x3e')]===0x1){return _0x5214e3['id'];}else{var _0x2baafa=_['every'](_[_0xa9a4('0x33')](_0x4f5036,_0xa9a4('0x81')),function(_0x48db19){return _[_0xa9a4('0x82')](_0x46f6b8,_0x48db19);});if(_0x2baafa){return _0x5214e3['id'];}}}));}}return BPromise[_0xa9a4('0x83')](_0x3afafa)[_0xa9a4('0x2a')](function(_0x27344c){_0x8c649e=_(_0x8c649e)['union'](_0x27344c)[_0xa9a4('0x84')]()['value']();return db[_0xa9a4('0x34')][_0xa9a4('0x53')]({'where':{'id':_0x31bfbc['params']['id']}})[_0xa9a4('0x2a')](function(_0x1a6ee9){return db[_0xa9a4('0x6d')][_0xa9a4('0x85')](function(_0x1d1a44){return _0x1a6ee9[_0xa9a4('0x73')](_0x31bfbc[_0xa9a4('0x39')][_0xa9a4('0x68')],{'transaction':_0x1d1a44})[_0xa9a4('0x2a')](function(){if(!_['isEmpty'](_0x8c649e)){return _0x1a6ee9[_0xa9a4('0x86')](_0x8c649e,{'transaction':_0x1d1a44});}})[_0xa9a4('0x2a')](function(){_0x8c649e[_0xa9a4('0x70')](function(_0x7400b2){socket[_0xa9a4('0x71')]('userOpenchannelQueue:remove',{'UserId':_0x7400b2,'OpenchannelQueueId':_0x1a6ee9['id']});});});});});});})[_0xa9a4('0x2a')](respondWithStatusCode(_0x25501d,null))[_0xa9a4('0x48')](handleError(_0x25501d,null));};exports[_0xa9a4('0x87')]=function(_0x5744b8,_0xd8a5e9,_0x249630){return db['OpenchannelQueue'][_0xa9a4('0x53')]({'where':{'id':_0x5744b8['params']['id']}})[_0xa9a4('0x2a')](handleEntityNotFound(_0xd8a5e9,null))[_0xa9a4('0x2a')](function(_0x37f622){if(_0x37f622){return _0x37f622[_0xa9a4('0x87')](_0x5744b8[_0xa9a4('0x4c')][_0xa9a4('0x68')],_[_0xa9a4('0x88')](_0x5744b8[_0xa9a4('0x4c')],[_0xa9a4('0x68'),'id'])||{})[_0xa9a4('0x89')](function(_0x20083a){for(var _0x56b9df=0x0;_0x56b9df<_0x5744b8['body'][_0xa9a4('0x68')][_0xa9a4('0x3e')];_0x56b9df+=0x1){socket[_0xa9a4('0x71')](_0xa9a4('0x72'),{'UserId':Number(_0x5744b8[_0xa9a4('0x4c')][_0xa9a4('0x68')][_0x56b9df]),'OpenchannelQueueId':Number(_0x5744b8[_0xa9a4('0x4a')]['id'])});}return _0x20083a;});}})[_0xa9a4('0x2a')](respondWithResult(_0xd8a5e9,null))['catch'](handleError(_0xd8a5e9,null));};exports[_0xa9a4('0x86')]=function(_0x58981c,_0x31ba40,_0x23d170){return db[_0xa9a4('0x34')][_0xa9a4('0x53')]({'where':{'id':_0x58981c['params']['id']}})[_0xa9a4('0x2a')](handleEntityNotFound(_0x31ba40,null))['then'](function(_0x263558){if(_0x263558){return _0x263558[_0xa9a4('0x86')](_0x58981c[_0xa9a4('0x39')][_0xa9a4('0x68')])['then'](function(){if(_[_0xa9a4('0x8a')](_0x58981c[_0xa9a4('0x39')]['ids'])){for(var _0x4c93ef=0x0;_0x4c93ef<_0x58981c[_0xa9a4('0x39')]['ids'][_0xa9a4('0x3e')];_0x4c93ef+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x58981c['query']['ids'][_0x4c93ef]),'OpenchannelQueueId':Number(_0x58981c['params']['id'])});}}else{socket[_0xa9a4('0x71')](_0xa9a4('0x8b'),{'UserId':Number(_0x58981c[_0xa9a4('0x39')][_0xa9a4('0x68')]),'OpenchannelQueueId':Number(_0x58981c[_0xa9a4('0x4a')]['id'])});}});}})[_0xa9a4('0x2a')](respondWithStatusCode(_0x31ba40,null))[_0xa9a4('0x48')](handleError(_0x31ba40,null));};exports[_0xa9a4('0x8c')]=function(_0x5ed2c5,_0x452c01,_0x32ac18){var _0x43ec6e={};var _0x9d4057={};var _0x1b905b;var _0x3252a0;return db['OpenchannelQueue'][_0xa9a4('0x56')]({'where':{'id':_0x5ed2c5[_0xa9a4('0x4a')]['id']}})[_0xa9a4('0x2a')](handleEntityNotFound(_0x452c01,null))[_0xa9a4('0x2a')](function(_0x73e449){if(_0x73e449){_0x1b905b=_0x73e449;_0x9d4057['model']=_[_0xa9a4('0x57')](db[_0xa9a4('0x5c')][_0xa9a4('0x35')]);_0x9d4057[_0xa9a4('0x39')]=_[_0xa9a4('0x57')](_0x5ed2c5[_0xa9a4('0x39')]);_0x9d4057['filters']=_['intersection'](_0x9d4057[_0xa9a4('0x38')],_0x9d4057['query']);_0x43ec6e[_0xa9a4('0x3c')]=_[_0xa9a4('0x3b')](_0x9d4057[_0xa9a4('0x38')],qs[_0xa9a4('0x3d')](_0x5ed2c5['query'][_0xa9a4('0x3d')]));_0x43ec6e[_0xa9a4('0x3c')]=_0x43ec6e[_0xa9a4('0x3c')]['length']?_0x43ec6e['attributes']:_0x9d4057[_0xa9a4('0x38')];_0x43ec6e[_0xa9a4('0x3f')]=qs['sort'](_0x5ed2c5[_0xa9a4('0x39')]['sort']);_0x43ec6e['where']=qs[_0xa9a4('0x3a')](_[_0xa9a4('0x41')](_0x5ed2c5['query'],_0x9d4057['filters']));if(_0x5ed2c5[_0xa9a4('0x39')]['filter']){_0x43ec6e[_0xa9a4('0x40')]=_['merge'](_0x43ec6e[_0xa9a4('0x40')],{'$or':_[_0xa9a4('0x33')](_0x43ec6e[_0xa9a4('0x3c')],function(_0x25ef65){var _0x54b020={};_0x54b020[_0x25ef65]={'$like':'%'+_0x5ed2c5[_0xa9a4('0x39')][_0xa9a4('0x42')]+'%'};return _0x54b020;})});}_0x43ec6e=_[_0xa9a4('0x43')]({},_0x43ec6e,_0x5ed2c5[_0xa9a4('0x44')]);return _0x1b905b[_0xa9a4('0x8c')](_0x43ec6e);}})['then'](function(_0x4d240b){if(_0x4d240b){_0x3252a0=_0x4d240b['length'];if(!_0x5ed2c5[_0xa9a4('0x39')][_0xa9a4('0x66')]('nolimit')){_0x43ec6e['limit']=qs[_0xa9a4('0x23')](_0x5ed2c5[_0xa9a4('0x39')]['limit']);_0x43ec6e[_0xa9a4('0x20')]=qs[_0xa9a4('0x20')](_0x5ed2c5['query'][_0xa9a4('0x20')]);}return _0x1b905b[_0xa9a4('0x8c')](_0x43ec6e);}})[_0xa9a4('0x2a')](function(_0x29cb65){if(_0x29cb65){return _0x29cb65?{'count':_0x3252a0,'rows':_0x29cb65}:null;}})[_0xa9a4('0x2a')](respondWithResult(_0x452c01,null))['catch'](handleError(_0x452c01,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 16275df..d5d69fd 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 _0xf026=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x3ab687,_0x2f3a18){var _0x512596=function(_0x981ef2){while(--_0x981ef2){_0x3ab687['push'](_0x3ab687['shift']());}};_0x512596(++_0x2f3a18);}(_0xf026,0x134));var _0x6f02=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xf026[_0x2aea9e];return _0x430b92;};'use strict';var EventEmitter=require(_0x6f02('0x0'));var OpenchannelQueue=require(_0x6f02('0x1'))['db'][_0x6f02('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x6f02('0x3')](0x0);var events={'afterCreate':_0x6f02('0x4'),'afterUpdate':_0x6f02('0x5'),'afterDestroy':_0x6f02('0x6')};function emitEvent(_0xcd79f1){return function(_0x5e631c,_0x123c29,_0xd638ba){OpenchannelQueueEvents[_0x6f02('0x7')](_0xcd79f1+':'+_0x5e631c['id'],_0x5e631c);OpenchannelQueueEvents['emit'](_0xcd79f1,_0x5e631c);_0xd638ba(null);};}for(var e in events){if(events[_0x6f02('0x8')](e)){var event=events[e];OpenchannelQueue[_0x6f02('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x950e=['OpenchannelQueue','save','update','emit','hook','exports','../../mysqldb'];(function(_0x5d6eaf,_0x5e8c49){var _0x8ab44b=function(_0x1f98c1){while(--_0x1f98c1){_0x5d6eaf['push'](_0x5d6eaf['shift']());}};_0x8ab44b(++_0x5e8c49);}(_0x950e,0x6f));var _0xe950=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0x950e[_0x4cee4b];return _0x4d891d;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0xe950('0x0'))['db'][_0xe950('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe950('0x2'),'afterUpdate':_0xe950('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38d744){return function(_0x2f3e8f,_0x2fc9ba,_0x3e963d){OpenchannelQueueEvents['emit'](_0x38d744+':'+_0x2f3e8f['id'],_0x2f3e8f);OpenchannelQueueEvents[_0xe950('0x4')](_0x38d744,_0x2f3e8f);_0x3e963d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xe950('0x5')](e,emitEvent(event));}}module[_0xe950('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index a4d5f7f..f429905 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 _0x8a46=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','api','bluebird','request-promise'];(function(_0x31a94f,_0x101da3){var _0x404eaf=function(_0x495c22){while(--_0x495c22){_0x31a94f['push'](_0x31a94f['shift']());}};_0x404eaf(++_0x101da3);}(_0x8a46,0xa3));var _0x68a4=function(_0x2629f3,_0x1ba0a3){_0x2629f3=_0x2629f3-0x0;var _0x133fdd=_0x8a46[_0x2629f3];return _0x133fdd;};'use strict';var _=require(_0x68a4('0x0'));var util=require(_0x68a4('0x1'));var logger=require('../../config/logger')(_0x68a4('0x2'));var moment=require('moment');var BPromise=require(_0x68a4('0x3'));var rp=require(_0x68a4('0x4'));var fs=require('fs');var path=require(_0x68a4('0x5'));var rimraf=require(_0x68a4('0x6'));var config=require(_0x68a4('0x7'));var attributes=require(_0x68a4('0x8'));module[_0x68a4('0x9')]=function(_0x3622fc,_0x560468){return _0x3622fc[_0x68a4('0xa')]('OpenchannelQueue',attributes,{'tableName':_0x68a4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe239=['rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','../../config/logger','moment','request-promise'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe239,0x73));var _0x9e23=function(_0x5720ff,_0x3a5de0){_0x5720ff=_0x5720ff-0x0;var _0x4004e1=_0xe239[_0x5720ff];return _0x4004e1;};'use strict';var _=require(_0x9e23('0x0'));var util=require(_0x9e23('0x1'));var logger=require(_0x9e23('0x2'))('api');var moment=require(_0x9e23('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e23('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e23('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e23('0x6'));module[_0x9e23('0x7')]=function(_0x34bddb,_0xfd3eb3){return _0x34bddb[_0x9e23('0x8')](_0x9e23('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 eec83ba..5a6eca4 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 _0x596d=['util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','findAll','options','raw','where','attributes','include','map','model','GetOpenchannelQueue','stringify','catch','ShowOpenchannelQueue','OpenchannelQueue','find','lodash'];(function(_0x586764,_0x5ae41f){var _0x3e4079=function(_0x26558f){while(--_0x26558f){_0x586764['push'](_0x586764['shift']());}};_0x3e4079(++_0x5ae41f);}(_0x596d,0x9f));var _0xd596=function(_0x47719c,_0x48da05){_0x47719c=_0x47719c-0x0;var _0x4c92c4=_0x596d[_0x47719c];return _0x4c92c4;};'use strict';var _=require(_0xd596('0x0'));var util=require(_0xd596('0x1'));var moment=require(_0xd596('0x2'));var BPromise=require(_0xd596('0x3'));var rs=require(_0xd596('0x4'));var fs=require('fs');var Redis=require(_0xd596('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd596('0x6'))('rpc');var config=require(_0xd596('0x7'));var jayson=require(_0xd596('0x8'));var client=jayson[_0xd596('0x9')][_0xd596('0xa')]({'port':0x232a});config['redis']=_[_0xd596('0xb')](config[_0xd596('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd596('0xd'))(new Redis(config[_0xd596('0xc')]));require(_0xd596('0xe'))[_0xd596('0xf')](socket);function respondWithRpcPromise(_0x434a51,_0x3b5d40,_0x366fad){return new BPromise(function(_0x534336,_0x40c94b){return client[_0xd596('0x10')](_0x434a51,_0x366fad)[_0xd596('0x11')](function(_0x5432ed){logger[_0xd596('0x12')](_0xd596('0x13'),_0x3b5d40,_0xd596('0x14'));logger[_0xd596('0x15')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x3b5d40,'request\x20sent',JSON['stringify'](_0x5432ed));if(_0x5432ed[_0xd596('0x16')]){if(_0x5432ed[_0xd596('0x16')][_0xd596('0x17')]===0x1f4){logger[_0xd596('0x16')](_0xd596('0x13'),_0x3b5d40,_0x5432ed[_0xd596('0x16')][_0xd596('0x18')]);return _0x40c94b(_0x5432ed[_0xd596('0x16')][_0xd596('0x18')]);}logger[_0xd596('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x3b5d40,_0x5432ed['error']['message']);return _0x534336(_0x5432ed[_0xd596('0x16')][_0xd596('0x18')]);}else{logger[_0xd596('0x12')](_0xd596('0x13'),_0x3b5d40,_0xd596('0x14'));_0x534336(_0x5432ed[_0xd596('0x19')][_0xd596('0x18')]);}})['catch'](function(_0x4ea5f7){logger[_0xd596('0x16')](_0xd596('0x13'),_0x3b5d40,_0x4ea5f7);_0x40c94b(_0x4ea5f7);});});}exports['GetOpenchannelQueue']=function(_0x1e4cda){var _0x332b18=this;return new Promise(function(_0x44f8d0,_0x1710cc){return db['OpenchannelQueue'][_0xd596('0x1a')]({'raw':_0x1e4cda[_0xd596('0x1b')]?_0x1e4cda[_0xd596('0x1b')][_0xd596('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e4cda['options']?_0x1e4cda[_0xd596('0x1b')][_0xd596('0x1d')]||null:null,'attributes':_0x1e4cda['options']?_0x1e4cda[_0xd596('0x1b')][_0xd596('0x1e')]||null:null,'limit':_0x1e4cda[_0xd596('0x1b')]?_0x1e4cda[_0xd596('0x1b')]['limit']||null:null,'include':_0x1e4cda[_0xd596('0x1b')]?_0x1e4cda[_0xd596('0x1b')][_0xd596('0x1f')]?_[_0xd596('0x20')](_0x1e4cda[_0xd596('0x1b')][_0xd596('0x1f')],function(_0x2e36f4){return{'model':db[_0x2e36f4[_0xd596('0x21')]],'as':_0x2e36f4['as'],'attributes':_0x2e36f4[_0xd596('0x1e')],'include':_0x2e36f4[_0xd596('0x1f')]?_[_0xd596('0x20')](_0x2e36f4['include'],function(_0x471822){return{'model':db[_0x471822[_0xd596('0x21')]],'as':_0x471822['as'],'attributes':_0x471822[_0xd596('0x1e')],'include':_0x471822['include']?_[_0xd596('0x20')](_0x471822['include'],function(_0x46ad3a){return{'model':db[_0x46ad3a[_0xd596('0x21')]],'as':_0x46ad3a['as'],'attributes':_0x46ad3a[_0xd596('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd596('0x11')](function(_0x457594){logger[_0xd596('0x12')]('GetOpenchannelQueue',_0x1e4cda);logger[_0xd596('0x15')](_0xd596('0x22'),_0x1e4cda,JSON[_0xd596('0x23')](_0x457594));_0x44f8d0(_0x457594);})[_0xd596('0x24')](function(_0x26029a){logger[_0xd596('0x16')](_0xd596('0x22'),_0x26029a['message'],_0x1e4cda);_0x1710cc(_0x332b18[_0xd596('0x16')](0x1f4,_0x26029a[_0xd596('0x18')]));});});};exports[_0xd596('0x25')]=function(_0x5aeeba){var _0x326bfa=this;return new Promise(function(_0x13dd5b,_0x2285a0){return db[_0xd596('0x26')][_0xd596('0x27')]({'raw':_0x5aeeba[_0xd596('0x1b')]?_0x5aeeba[_0xd596('0x1b')][_0xd596('0x1c')]===undefined?!![]:![]:!![],'where':_0x5aeeba[_0xd596('0x1b')]?_0x5aeeba['options'][_0xd596('0x1d')]||null:null,'attributes':_0x5aeeba[_0xd596('0x1b')]?_0x5aeeba[_0xd596('0x1b')][_0xd596('0x1e')]||null:null,'include':_0x5aeeba['options']?_0x5aeeba['options'][_0xd596('0x1f')]?_[_0xd596('0x20')](_0x5aeeba[_0xd596('0x1b')][_0xd596('0x1f')],function(_0x3ebf0a){return{'model':db[_0x3ebf0a[_0xd596('0x21')]],'as':_0x3ebf0a['as'],'attributes':_0x3ebf0a['attributes'],'include':_0x3ebf0a[_0xd596('0x1f')]?_[_0xd596('0x20')](_0x3ebf0a[_0xd596('0x1f')],function(_0x1bb6d5){return{'model':db[_0x1bb6d5[_0xd596('0x21')]],'as':_0x1bb6d5['as'],'attributes':_0x1bb6d5[_0xd596('0x1e')],'include':_0x1bb6d5[_0xd596('0x1f')]?_['map'](_0x1bb6d5[_0xd596('0x1f')],function(_0x2e3efe){return{'model':db[_0x2e3efe[_0xd596('0x21')]],'as':_0x2e3efe['as'],'attributes':_0x2e3efe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x11bdc2){logger[_0xd596('0x12')]('ShowOpenchannelQueue',_0x5aeeba);logger[_0xd596('0x15')](_0xd596('0x25'),_0x5aeeba,JSON['stringify'](_0x11bdc2));_0x13dd5b(_0x11bdc2);})[_0xd596('0x24')](function(_0x2a7dc6){logger[_0xd596('0x16')]('ShowOpenchannelQueue',_0x2a7dc6[_0xd596('0x18')],_0x5aeeba);_0x2285a0(_0x326bfa[_0xd596('0x16')](0x1f4,_0x2a7dc6['message']));});});}; \ No newline at end of file +var _0x7e2b=['ShowOpenchannelQueue','find','lodash','util','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','GetOpenchannelQueue','debug','stringify','catch'];(function(_0xb5759f,_0x1d1c53){var _0x1ac92f=function(_0x9e6695){while(--_0x9e6695){_0xb5759f['push'](_0xb5759f['shift']());}};_0x1ac92f(++_0x1d1c53);}(_0x7e2b,0xda));var _0xb7e2=function(_0x24a2cc,_0x455e1f){_0x24a2cc=_0x24a2cc-0x0;var _0x1cf0ad=_0x7e2b[_0x24a2cc];return _0x1cf0ad;};'use strict';var _=require(_0xb7e2('0x0'));var util=require(_0xb7e2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb7e2('0x2'))(_0xb7e2('0x3'));var config=require(_0xb7e2('0x4'));var jayson=require(_0xb7e2('0x5'));var client=jayson[_0xb7e2('0x6')][_0xb7e2('0x7')]({'port':0x232a});config[_0xb7e2('0x8')]=_['defaults'](config['redis'],{'host':_0xb7e2('0x9'),'port':0x18eb});var socket=require(_0xb7e2('0xa'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xb7e2('0xb')](socket);function respondWithRpcPromise(_0x57f5e7,_0x17478b,_0x525d99){return new BPromise(function(_0x436c51,_0x446263){return client[_0xb7e2('0xc')](_0x57f5e7,_0x525d99)[_0xb7e2('0xd')](function(_0x482b8d){logger[_0xb7e2('0xe')](_0xb7e2('0xf'),_0x17478b,'request\x20sent');logger['debug'](_0xb7e2('0x10'),_0x17478b,_0xb7e2('0x11'),JSON['stringify'](_0x482b8d));if(_0x482b8d[_0xb7e2('0x12')]){if(_0x482b8d[_0xb7e2('0x12')][_0xb7e2('0x13')]===0x1f4){logger['error'](_0xb7e2('0xf'),_0x17478b,_0x482b8d[_0xb7e2('0x12')]['message']);return _0x446263(_0x482b8d[_0xb7e2('0x12')][_0xb7e2('0x14')]);}logger[_0xb7e2('0x12')](_0xb7e2('0xf'),_0x17478b,_0x482b8d[_0xb7e2('0x12')][_0xb7e2('0x14')]);return _0x436c51(_0x482b8d['error']['message']);}else{logger[_0xb7e2('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x17478b,_0xb7e2('0x11'));_0x436c51(_0x482b8d['result'][_0xb7e2('0x14')]);}})['catch'](function(_0x490f30){logger[_0xb7e2('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x17478b,_0x490f30);_0x446263(_0x490f30);});});}exports['GetOpenchannelQueue']=function(_0x2abc61){var _0x271640=this;return new Promise(function(_0x5bbbe8,_0x43d201){return db[_0xb7e2('0x15')][_0xb7e2('0x16')]({'raw':_0x2abc61[_0xb7e2('0x17')]?_0x2abc61[_0xb7e2('0x17')][_0xb7e2('0x18')]===undefined?!![]:![]:!![],'where':_0x2abc61[_0xb7e2('0x17')]?_0x2abc61[_0xb7e2('0x17')][_0xb7e2('0x19')]||null:null,'attributes':_0x2abc61[_0xb7e2('0x17')]?_0x2abc61['options'][_0xb7e2('0x1a')]||null:null,'limit':_0x2abc61[_0xb7e2('0x17')]?_0x2abc61[_0xb7e2('0x17')]['limit']||null:null,'include':_0x2abc61[_0xb7e2('0x17')]?_0x2abc61['options'][_0xb7e2('0x1b')]?_[_0xb7e2('0x1c')](_0x2abc61[_0xb7e2('0x17')]['include'],function(_0x505837){return{'model':db[_0x505837['model']],'as':_0x505837['as'],'attributes':_0x505837['attributes'],'include':_0x505837[_0xb7e2('0x1b')]?_['map'](_0x505837['include'],function(_0x35090a){return{'model':db[_0x35090a[_0xb7e2('0x1d')]],'as':_0x35090a['as'],'attributes':_0x35090a['attributes'],'include':_0x35090a[_0xb7e2('0x1b')]?_[_0xb7e2('0x1c')](_0x35090a[_0xb7e2('0x1b')],function(_0x5740dd){return{'model':db[_0x5740dd['model']],'as':_0x5740dd['as'],'attributes':_0x5740dd[_0xb7e2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb7e2('0xd')](function(_0x567a0c){logger[_0xb7e2('0xe')](_0xb7e2('0x1e'),_0x2abc61);logger[_0xb7e2('0x1f')](_0xb7e2('0x1e'),_0x2abc61,JSON[_0xb7e2('0x20')](_0x567a0c));_0x5bbbe8(_0x567a0c);})[_0xb7e2('0x21')](function(_0x5853b3){logger[_0xb7e2('0x12')](_0xb7e2('0x1e'),_0x5853b3[_0xb7e2('0x14')],_0x2abc61);_0x43d201(_0x271640[_0xb7e2('0x12')](0x1f4,_0x5853b3[_0xb7e2('0x14')]));});});};exports[_0xb7e2('0x22')]=function(_0x301e5f){var _0x530ad1=this;return new Promise(function(_0x2b8646,_0x2d02fe){return db[_0xb7e2('0x15')][_0xb7e2('0x23')]({'raw':_0x301e5f['options']?_0x301e5f[_0xb7e2('0x17')][_0xb7e2('0x18')]===undefined?!![]:![]:!![],'where':_0x301e5f[_0xb7e2('0x17')]?_0x301e5f[_0xb7e2('0x17')][_0xb7e2('0x19')]||null:null,'attributes':_0x301e5f[_0xb7e2('0x17')]?_0x301e5f[_0xb7e2('0x17')][_0xb7e2('0x1a')]||null:null,'include':_0x301e5f['options']?_0x301e5f[_0xb7e2('0x17')][_0xb7e2('0x1b')]?_['map'](_0x301e5f[_0xb7e2('0x17')][_0xb7e2('0x1b')],function(_0x20b0a8){return{'model':db[_0x20b0a8[_0xb7e2('0x1d')]],'as':_0x20b0a8['as'],'attributes':_0x20b0a8[_0xb7e2('0x1a')],'include':_0x20b0a8[_0xb7e2('0x1b')]?_[_0xb7e2('0x1c')](_0x20b0a8['include'],function(_0x397d06){return{'model':db[_0x397d06[_0xb7e2('0x1d')]],'as':_0x397d06['as'],'attributes':_0x397d06['attributes'],'include':_0x397d06[_0xb7e2('0x1b')]?_['map'](_0x397d06[_0xb7e2('0x1b')],function(_0x5436ee){return{'model':db[_0x5436ee[_0xb7e2('0x1d')]],'as':_0x5436ee['as'],'attributes':_0x5436ee[_0xb7e2('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d0182){logger[_0xb7e2('0xe')](_0xb7e2('0x22'),_0x301e5f);logger[_0xb7e2('0x1f')](_0xb7e2('0x22'),_0x301e5f,JSON[_0xb7e2('0x20')](_0x4d0182));_0x2b8646(_0x4d0182);})['catch'](function(_0x47ebb3){logger[_0xb7e2('0x12')](_0xb7e2('0x22'),_0x47ebb3['message'],_0x301e5f);_0x2d02fe(_0x530ad1[_0xb7e2('0x12')](0x1f4,_0x47ebb3[_0xb7e2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index a468da2..249410b 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 _0xf54a=['save','remove','emit','removeListener','openchannelQueue:','./openchannelQueue.events'];(function(_0x50e638,_0x538fc2){var _0x16cb0b=function(_0x28186e){while(--_0x28186e){_0x50e638['push'](_0x50e638['shift']());}};_0x16cb0b(++_0x538fc2);}(_0xf54a,0xe9));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require(_0xaf54('0x0'));var events=[_0xaf54('0x1'),_0xaf54('0x2'),'update'];function createListener(_0x43ad02,_0x15424b){return function(_0x5df2ec){_0x15424b[_0xaf54('0x3')](_0x43ad02,_0x5df2ec);};}function removeListener(_0x4fac96,_0x57b0a0){return function(){OpenchannelQueueEvents[_0xaf54('0x4')](_0x4fac96,_0x57b0a0);};}exports['register']=function(_0x3b788e){for(var _0x46cdc0=0x0,_0xa3837d=events['length'];_0x46cdc0<_0xa3837d;_0x46cdc0++){var _0x227898=events[_0x46cdc0];var _0x364653=createListener(_0xaf54('0x5')+_0x227898,_0x3b788e);OpenchannelQueueEvents['on'](_0x227898,_0x364653);}}; \ No newline at end of file +var _0x5cd0=['emit','removeListener','register','length','openchannelQueue:','save','remove','update'];(function(_0x93076a,_0x1656b4){var _0x2eefb2=function(_0x4af937){while(--_0x4af937){_0x93076a['push'](_0x93076a['shift']());}};_0x2eefb2(++_0x1656b4);}(_0x5cd0,0x75));var _0x05cd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5cd0[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x05cd('0x0'),_0x05cd('0x1'),_0x05cd('0x2')];function createListener(_0x3c3120,_0x1a002a){return function(_0x4601bf){_0x1a002a[_0x05cd('0x3')](_0x3c3120,_0x4601bf);};}function removeListener(_0x516e44,_0x2b039b){return function(){OpenchannelQueueEvents[_0x05cd('0x4')](_0x516e44,_0x2b039b);};}exports[_0x05cd('0x5')]=function(_0x160a70){for(var _0x1ed9b2=0x0,_0xcb2338=events[_0x05cd('0x6')];_0x1ed9b2<_0xcb2338;_0x1ed9b2++){var _0x10648c=events[_0x1ed9b2];var _0x3754af=createListener(_0x05cd('0x7')+_0x10648c,_0x160a70);OpenchannelQueueEvents['on'](_0x10648c,_0x3754af);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a537c4f..53ebdbb 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 _0x2199=['isAuthenticated','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','get','/:id','show','post'];(function(_0x203b6a,_0x231cf1){var _0x13e7cf=function(_0x304a58){while(--_0x304a58){_0x203b6a['push'](_0x203b6a['shift']());}};_0x13e7cf(++_0x231cf1);}(_0x2199,0x16d));var _0x9219=function(_0x41bdbe,_0x16a0e9){_0x41bdbe=_0x41bdbe-0x0;var _0x1eed30=_0x2199[_0x41bdbe];return _0x1eed30;};'use strict';var multer=require('multer');var util=require(_0x9219('0x0'));var path=require('path');var timeout=require(_0x9219('0x1'));var express=require(_0x9219('0x2'));var router=express[_0x9219('0x3')]();var fs_extra=require(_0x9219('0x4'));var auth=require(_0x9219('0x5'));var interaction=require(_0x9219('0x6'));var config=require(_0x9219('0x7'));var controller=require('./openchannelQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9219('0x8')]);router['get'](_0x9219('0x9'),auth['isAuthenticated'](),controller[_0x9219('0xa')]);router[_0x9219('0xb')](_0x9219('0xc'),auth['isAuthenticated'](),controller[_0x9219('0xd')]);router[_0x9219('0xe')]('/',auth[_0x9219('0xf')](),controller['create']);router['put']('/:id',auth[_0x9219('0xf')](),controller[_0x9219('0x10')]);router[_0x9219('0x11')](_0x9219('0xc'),auth[_0x9219('0xf')](),controller[_0x9219('0x12')]);module[_0x9219('0x13')]=router; \ No newline at end of file +var _0xa1ab=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','exports','multer'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xa1ab,0x1b7));var _0xba1a=function(_0x4e8e68,_0x52a7b8){_0x4e8e68=_0x4e8e68-0x0;var _0x3c1398=_0xa1ab[_0x4e8e68];return _0x3c1398;};'use strict';var multer=require(_0xba1a('0x0'));var util=require(_0xba1a('0x1'));var path=require(_0xba1a('0x2'));var timeout=require(_0xba1a('0x3'));var express=require('express');var router=express[_0xba1a('0x4')]();var fs_extra=require(_0xba1a('0x5'));var auth=require(_0xba1a('0x6'));var interaction=require(_0xba1a('0x7'));var config=require(_0xba1a('0x8'));var controller=require(_0xba1a('0x9'));router['get']('/',auth[_0xba1a('0xa')](),controller[_0xba1a('0xb')]);router[_0xba1a('0xc')](_0xba1a('0xd'),auth[_0xba1a('0xa')](),controller[_0xba1a('0xe')]);router['get'](_0xba1a('0xf'),auth[_0xba1a('0xa')](),controller['show']);router['post']('/',auth[_0xba1a('0xa')](),controller[_0xba1a('0x10')]);router[_0xba1a('0x11')](_0xba1a('0xf'),auth[_0xba1a('0xa')](),controller[_0xba1a('0x12')]);router['delete'](_0xba1a('0xf'),auth[_0xba1a('0xa')](),controller['destroy']);module[_0xba1a('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index fa12ff0..c0644bf 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 _0x6038=['moment','sequelize','exports','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6038,0x12c));var _0x8603=function(_0x3c8806,_0x14eb7f){_0x3c8806=_0x3c8806-0x0;var _0x3a6209=_0x6038[_0x3c8806];return _0x3a6209;};'use strict';var moment=require(_0x8603('0x0'));var Sequelize=require(_0x8603('0x1'));module[_0x8603('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8603('0x3')]},'joinAt':{'type':Sequelize[_0x8603('0x4')]},'leaveAt':{'type':Sequelize[_0x8603('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8603('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x239e=['STRING','DATE','sequelize'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x239e,0x179));var _0xe239=function(_0x4c3070,_0xc2fb4c){_0x4c3070=_0x4c3070-0x0;var _0x536a44=_0x239e[_0x4c3070];return _0x536a44;};'use strict';var moment=require('moment');var Sequelize=require(_0xe239('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe239('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe239('0x1')]},'joinAt':{'type':Sequelize[_0xe239('0x2')]},'leaveAt':{'type':Sequelize[_0xe239('0x2')]},'acceptAt':{'type':Sequelize[_0xe239('0x2')]},'exitAt':{'type':Sequelize[_0xe239('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 9750fc1..0f7d649 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 _0x861d=['fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','set','apply','reject','update','destroy','then','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes'];(function(_0x43f949,_0x4d467f){var _0x2fa68e=function(_0x58b364){while(--_0x58b364){_0x43f949['push'](_0x43f949['shift']());}};_0x2fa68e(++_0x4d467f);}(_0x861d,0x1c7));var _0xd861=function(_0x3fb150,_0x5e32ed){_0x3fb150=_0x3fb150-0x0;var _0x56f4a8=_0x861d[_0x3fb150];return _0x56f4a8;};'use strict';var emlformat=require(_0xd861('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd861('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd861('0x2'));var moment=require(_0xd861('0x3'));var BPromise=require(_0xd861('0x4'));var Mustache=require(_0xd861('0x5'));var util=require('util');var path=require(_0xd861('0x6'));var sox=require(_0xd861('0x7'));var csv=require(_0xd861('0x8'));var ejs=require(_0xd861('0x9'));var fs=require('fs');var fs_extra=require(_0xd861('0xa'));var _=require(_0xd861('0xb'));var squel=require('squel');var crypto=require(_0xd861('0xc'));var jsforce=require(_0xd861('0xd'));var deskjs=require(_0xd861('0xe'));var toCsv=require(_0xd861('0x8'));var querystring=require(_0xd861('0xf'));var Papa=require('papaparse');var Redis=require(_0xd861('0x10'));var authService=require(_0xd861('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd861('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd861('0x13'));var utils=require('../../config/utils');var config=require(_0xd861('0x14'));var licenseUtil=require(_0xd861('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe3a830,_0x3bcf75){_0x3bcf75=_0x3bcf75||0xcc;return function(_0x226f2c){if(_0x226f2c){return _0xe3a830['sendStatus'](_0x3bcf75);}return _0xe3a830['status'](_0x3bcf75)[_0xd861('0x16')]();};}function respondWithResult(_0x4f8a8e,_0x8717ef){_0x8717ef=_0x8717ef||0xc8;return function(_0x300f21){if(_0x300f21){return _0x4f8a8e[_0xd861('0x17')](_0x8717ef)[_0xd861('0x18')](_0x300f21);}};}function respondWithFilteredResult(_0x428dd3,_0x4ffcb2){return function(_0x4dc501){if(_0x4dc501){var _0x1fbabc=typeof _0x4ffcb2[_0xd861('0x19')]==='undefined'&&typeof _0x4ffcb2[_0xd861('0x1a')]===_0xd861('0x1b');var _0x58bf30=_0x4dc501[_0xd861('0x1c')];var _0x55ebe9=_0x1fbabc?0x0:_0x4ffcb2['offset'];var _0xf34f90=_0x1fbabc?_0x4dc501['count']:_0x4ffcb2[_0xd861('0x19')]+_0x4ffcb2['limit'];var _0x15b2df;if(_0xf34f90>=_0x58bf30){_0xf34f90=_0x58bf30;_0x15b2df=0xc8;}else{_0x15b2df=0xce;}_0x428dd3[_0xd861('0x17')](_0x15b2df);return _0x428dd3[_0xd861('0x1d')]('Content-Range',_0x55ebe9+'-'+_0xf34f90+'/'+_0x58bf30)[_0xd861('0x18')](_0x4dc501);}return null;};}function patchUpdates(_0x2f2a89){return function(_0x5998fc){try{jsonpatch[_0xd861('0x1e')](_0x5998fc,_0x2f2a89,!![]);}catch(_0x4830cc){return BPromise[_0xd861('0x1f')](_0x4830cc);}return _0x5998fc['save']();};}function saveUpdates(_0x538232,_0x2fb446){return function(_0x172079){if(_0x172079){return _0x172079[_0xd861('0x20')](_0x538232)['then'](function(_0x9c9d39){return _0x9c9d39;});}return null;};}function removeEntity(_0x2a1822,_0x50dd7b){return function(_0x213430){if(_0x213430){return _0x213430[_0xd861('0x21')]()[_0xd861('0x22')](function(){_0x2a1822['status'](0xcc)[_0xd861('0x16')]();});}};}function handleEntityNotFound(_0x4fd174,_0x36165f){return function(_0xa234c6){if(!_0xa234c6){_0x4fd174['sendStatus'](0x194);}return _0xa234c6;};}function handleError(_0x5edff2,_0x46d7ae){_0x46d7ae=_0x46d7ae||0x1f4;return function(_0x1649bc){logger[_0xd861('0x23')](_0x1649bc[_0xd861('0x24')]);if(_0x1649bc[_0xd861('0x25')]){delete _0x1649bc[_0xd861('0x25')];}_0x5edff2[_0xd861('0x17')](_0x46d7ae)[_0xd861('0x26')](_0x1649bc);};}exports['index']=function(_0x28de00,_0x54d892){var _0x424712={},_0x44df7b={},_0x2a5886={'count':0x0,'rows':[]};var _0x30c164=_[_0xd861('0x27')](db[_0xd861('0x28')][_0xd861('0x29')],function(_0x2f9347){return{'name':_0x2f9347[_0xd861('0x2a')],'type':_0x2f9347['type']['key']};});_0x44df7b[_0xd861('0x2b')]=_[_0xd861('0x27')](_0x30c164,_0xd861('0x25'));_0x44df7b[_0xd861('0x2c')]=_[_0xd861('0x2d')](_0x28de00[_0xd861('0x2c')]);_0x44df7b[_0xd861('0x2e')]=_[_0xd861('0x2f')](_0x44df7b[_0xd861('0x2b')],_0x44df7b[_0xd861('0x2c')]);_0x424712[_0xd861('0x30')]=_['intersection'](_0x44df7b['model'],qs[_0xd861('0x31')](_0x28de00['query']['fields']));_0x424712[_0xd861('0x30')]=_0x424712[_0xd861('0x30')]['length']?_0x424712[_0xd861('0x30')]:_0x44df7b[_0xd861('0x2b')];if(!_0x28de00[_0xd861('0x2c')][_0xd861('0x32')]('nolimit')){_0x424712[_0xd861('0x1a')]=qs[_0xd861('0x1a')](_0x28de00[_0xd861('0x2c')][_0xd861('0x1a')]);_0x424712[_0xd861('0x19')]=qs[_0xd861('0x19')](_0x28de00['query']['offset']);}_0x424712[_0xd861('0x33')]=qs[_0xd861('0x34')](_0x28de00[_0xd861('0x2c')][_0xd861('0x34')]);_0x424712['where']=qs[_0xd861('0x2e')](_[_0xd861('0x35')](_0x28de00[_0xd861('0x2c')],_0x44df7b[_0xd861('0x2e')]),_0x30c164);if(_0x28de00[_0xd861('0x2c')][_0xd861('0x36')]){_0x424712['where']=_[_0xd861('0x37')](_0x424712['where'],{'$or':_[_0xd861('0x27')](_0x30c164,function(_0x1f05db){if(_0x1f05db['type']!==_0xd861('0x38')){var _0x55aed6={};_0x55aed6[_0x1f05db['name']]={'$like':'%'+_0x28de00[_0xd861('0x2c')][_0xd861('0x36')]+'%'};return _0x55aed6;}})});}_0x424712=_[_0xd861('0x37')]({},_0x424712,_0x28de00[_0xd861('0x39')]);var _0xe727a7={'where':_0x424712[_0xd861('0x3a')]};return db['OpenchannelQueueReport']['count'](_0xe727a7)[_0xd861('0x22')](function(_0x41b99c){_0x2a5886[_0xd861('0x1c')]=_0x41b99c;if(_0x28de00['query'][_0xd861('0x3b')]){_0x424712[_0xd861('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xd861('0x3d')](_0x424712);})[_0xd861('0x22')](function(_0x20c0c5){_0x2a5886[_0xd861('0x3e')]=_0x20c0c5;return _0x2a5886;})['then'](respondWithFilteredResult(_0x54d892,_0x424712))[_0xd861('0x3f')](handleError(_0x54d892,null));};exports[_0xd861('0x40')]=function(_0x39f61d,_0x2596ad){var _0x10c379={'raw':!![],'where':{'id':_0x39f61d['params']['id']}},_0x1b2575={};_0x1b2575['model']=_[_0xd861('0x2d')](db[_0xd861('0x28')][_0xd861('0x29')]);_0x1b2575[_0xd861('0x2c')]=_[_0xd861('0x2d')](_0x39f61d[_0xd861('0x2c')]);_0x1b2575[_0xd861('0x2e')]=_[_0xd861('0x2f')](_0x1b2575[_0xd861('0x2b')],_0x1b2575[_0xd861('0x2c')]);_0x10c379[_0xd861('0x30')]=_['intersection'](_0x1b2575['model'],qs[_0xd861('0x31')](_0x39f61d[_0xd861('0x2c')][_0xd861('0x31')]));_0x10c379[_0xd861('0x30')]=_0x10c379[_0xd861('0x30')][_0xd861('0x41')]?_0x10c379['attributes']:_0x1b2575[_0xd861('0x2b')];if(_0x39f61d[_0xd861('0x2c')]['includeAll']){_0x10c379[_0xd861('0x3c')]=[{'all':!![]}];}_0x10c379=_[_0xd861('0x37')]({},_0x10c379,_0x39f61d[_0xd861('0x39')]);return db[_0xd861('0x28')][_0xd861('0x42')](_0x10c379)[_0xd861('0x22')](handleEntityNotFound(_0x2596ad,null))[_0xd861('0x22')](respondWithResult(_0x2596ad,null))[_0xd861('0x3f')](handleError(_0x2596ad,null));};exports['create']=function(_0x31c0b1,_0x32c86a){return db[_0xd861('0x28')][_0xd861('0x43')](_0x31c0b1[_0xd861('0x44')],{})[_0xd861('0x22')](respondWithResult(_0x32c86a,0xc9))[_0xd861('0x3f')](handleError(_0x32c86a,null));};exports[_0xd861('0x20')]=function(_0x4a96e5,_0x355d7b){if(_0x4a96e5[_0xd861('0x44')]['id']){delete _0x4a96e5['body']['id'];}return db[_0xd861('0x28')][_0xd861('0x42')]({'where':{'id':_0x4a96e5[_0xd861('0x45')]['id']}})[_0xd861('0x22')](handleEntityNotFound(_0x355d7b,null))[_0xd861('0x22')](saveUpdates(_0x4a96e5[_0xd861('0x44')],null))[_0xd861('0x22')](respondWithResult(_0x355d7b,null))[_0xd861('0x3f')](handleError(_0x355d7b,null));};exports['destroy']=function(_0x4f2b61,_0x27232e){return db[_0xd861('0x28')][_0xd861('0x42')]({'where':{'id':_0x4f2b61[_0xd861('0x45')]['id']}})[_0xd861('0x22')](handleEntityNotFound(_0x27232e,null))[_0xd861('0x22')](removeEntity(_0x27232e,null))[_0xd861('0x3f')](handleError(_0x27232e,null));};exports[_0xd861('0x46')]=function(_0x46bcd3,_0x409de3){return db['OpenchannelQueueReport'][_0xd861('0x46')]()['then'](respondWithResult(_0x409de3,null))[_0xd861('0x3f')](handleError(_0x409de3,null));}; \ No newline at end of file +var _0x5e6a=['status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','OpenchannelQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0xf8c769,_0xda8e8b){var _0x310d41=function(_0x1ee462){while(--_0x1ee462){_0xf8c769['push'](_0xf8c769['shift']());}};_0x310d41(++_0xda8e8b);}(_0x5e6a,0x110));var _0xa5e6=function(_0x16f125,_0x359f0e){_0x16f125=_0x16f125-0x0;var _0x4f5dde=_0x5e6a[_0x16f125];return _0x4f5dde;};'use strict';var emlformat=require(_0xa5e6('0x0'));var rimraf=require(_0xa5e6('0x1'));var zipdir=require(_0xa5e6('0x2'));var jsonpatch=require(_0xa5e6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa5e6('0x4'));var sox=require(_0xa5e6('0x5'));var csv=require(_0xa5e6('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5e6('0x7'));var _=require(_0xa5e6('0x8'));var squel=require('squel');var crypto=require(_0xa5e6('0x9'));var jsforce=require(_0xa5e6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa5e6('0x6'));var querystring=require(_0xa5e6('0xb'));var Papa=require(_0xa5e6('0xc'));var Redis=require('ioredis');var authService=require(_0xa5e6('0xd'));var qs=require(_0xa5e6('0xe'));var as=require(_0xa5e6('0xf'));var hardwareService=require(_0xa5e6('0x10'));var logger=require(_0xa5e6('0x11'))(_0xa5e6('0x12'));var utils=require(_0xa5e6('0x13'));var config=require(_0xa5e6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa5e6('0x15'))['db'];function respondWithStatusCode(_0x377dbb,_0x5a0864){_0x5a0864=_0x5a0864||0xcc;return function(_0x4e0518){if(_0x4e0518){return _0x377dbb[_0xa5e6('0x16')](_0x5a0864);}return _0x377dbb['status'](_0x5a0864)[_0xa5e6('0x17')]();};}function respondWithResult(_0x1f8dba,_0x525692){_0x525692=_0x525692||0xc8;return function(_0x5efec6){if(_0x5efec6){return _0x1f8dba[_0xa5e6('0x18')](_0x525692)[_0xa5e6('0x19')](_0x5efec6);}};}function respondWithFilteredResult(_0x49fbbc,_0x1a9a04){return function(_0x23957f){if(_0x23957f){var _0x1445a5=typeof _0x1a9a04[_0xa5e6('0x1a')]===_0xa5e6('0x1b')&&typeof _0x1a9a04[_0xa5e6('0x1c')]===_0xa5e6('0x1b');var _0x24d061=_0x23957f['count'];var _0x4a3998=_0x1445a5?0x0:_0x1a9a04[_0xa5e6('0x1a')];var _0x1d06d2=_0x1445a5?_0x23957f[_0xa5e6('0x1d')]:_0x1a9a04[_0xa5e6('0x1a')]+_0x1a9a04[_0xa5e6('0x1c')];var _0x7b8666;if(_0x1d06d2>=_0x24d061){_0x1d06d2=_0x24d061;_0x7b8666=0xc8;}else{_0x7b8666=0xce;}_0x49fbbc[_0xa5e6('0x18')](_0x7b8666);return _0x49fbbc[_0xa5e6('0x1e')](_0xa5e6('0x1f'),_0x4a3998+'-'+_0x1d06d2+'/'+_0x24d061)[_0xa5e6('0x19')](_0x23957f);}return null;};}function patchUpdates(_0x12f5bf){return function(_0x33ecd9){try{jsonpatch['apply'](_0x33ecd9,_0x12f5bf,!![]);}catch(_0x1434d1){return BPromise[_0xa5e6('0x20')](_0x1434d1);}return _0x33ecd9[_0xa5e6('0x21')]();};}function saveUpdates(_0x406220,_0x42a0f8){return function(_0x216629){if(_0x216629){return _0x216629[_0xa5e6('0x22')](_0x406220)[_0xa5e6('0x23')](function(_0x5ade94){return _0x5ade94;});}return null;};}function removeEntity(_0x1cb200,_0x403402){return function(_0x57cc85){if(_0x57cc85){return _0x57cc85[_0xa5e6('0x24')]()[_0xa5e6('0x23')](function(){_0x1cb200['status'](0xcc)[_0xa5e6('0x17')]();});}};}function handleEntityNotFound(_0x401731,_0x50aedb){return function(_0x3bad1a){if(!_0x3bad1a){_0x401731[_0xa5e6('0x16')](0x194);}return _0x3bad1a;};}function handleError(_0x201ea1,_0x14d90d){_0x14d90d=_0x14d90d||0x1f4;return function(_0x5c2d9c){logger[_0xa5e6('0x25')](_0x5c2d9c[_0xa5e6('0x26')]);if(_0x5c2d9c[_0xa5e6('0x27')]){delete _0x5c2d9c[_0xa5e6('0x27')];}_0x201ea1[_0xa5e6('0x18')](_0x14d90d)['send'](_0x5c2d9c);};}exports['index']=function(_0x483da0,_0x164ac7){var _0x14cf5a={},_0x3ade6b={},_0x205d34={'count':0x0,'rows':[]};var _0x5a5af4=_['map'](db[_0xa5e6('0x28')][_0xa5e6('0x29')],function(_0x5c10f5){return{'name':_0x5c10f5[_0xa5e6('0x2a')],'type':_0x5c10f5['type'][_0xa5e6('0x2b')]};});_0x3ade6b[_0xa5e6('0x2c')]=_[_0xa5e6('0x2d')](_0x5a5af4,_0xa5e6('0x27'));_0x3ade6b[_0xa5e6('0x2e')]=_[_0xa5e6('0x2f')](_0x483da0['query']);_0x3ade6b[_0xa5e6('0x30')]=_['intersection'](_0x3ade6b[_0xa5e6('0x2c')],_0x3ade6b[_0xa5e6('0x2e')]);_0x14cf5a[_0xa5e6('0x31')]=_[_0xa5e6('0x32')](_0x3ade6b[_0xa5e6('0x2c')],qs['fields'](_0x483da0[_0xa5e6('0x2e')][_0xa5e6('0x33')]));_0x14cf5a[_0xa5e6('0x31')]=_0x14cf5a[_0xa5e6('0x31')][_0xa5e6('0x34')]?_0x14cf5a[_0xa5e6('0x31')]:_0x3ade6b[_0xa5e6('0x2c')];if(!_0x483da0['query'][_0xa5e6('0x35')](_0xa5e6('0x36'))){_0x14cf5a[_0xa5e6('0x1c')]=qs[_0xa5e6('0x1c')](_0x483da0[_0xa5e6('0x2e')]['limit']);_0x14cf5a[_0xa5e6('0x1a')]=qs[_0xa5e6('0x1a')](_0x483da0[_0xa5e6('0x2e')][_0xa5e6('0x1a')]);}_0x14cf5a[_0xa5e6('0x37')]=qs[_0xa5e6('0x38')](_0x483da0[_0xa5e6('0x2e')][_0xa5e6('0x38')]);_0x14cf5a[_0xa5e6('0x39')]=qs['filters'](_[_0xa5e6('0x3a')](_0x483da0[_0xa5e6('0x2e')],_0x3ade6b[_0xa5e6('0x30')]),_0x5a5af4);if(_0x483da0[_0xa5e6('0x2e')]['filter']){_0x14cf5a[_0xa5e6('0x39')]=_[_0xa5e6('0x3b')](_0x14cf5a['where'],{'$or':_[_0xa5e6('0x2d')](_0x5a5af4,function(_0x1f3dee){if(_0x1f3dee[_0xa5e6('0x3c')]!==_0xa5e6('0x3d')){var _0x20a47e={};_0x20a47e[_0x1f3dee[_0xa5e6('0x27')]]={'$like':'%'+_0x483da0[_0xa5e6('0x2e')][_0xa5e6('0x3e')]+'%'};return _0x20a47e;}})});}_0x14cf5a=_['merge']({},_0x14cf5a,_0x483da0['options']);var _0x5a2b99={'where':_0x14cf5a[_0xa5e6('0x39')]};return db[_0xa5e6('0x28')][_0xa5e6('0x1d')](_0x5a2b99)[_0xa5e6('0x23')](function(_0x261609){_0x205d34[_0xa5e6('0x1d')]=_0x261609;if(_0x483da0[_0xa5e6('0x2e')][_0xa5e6('0x3f')]){_0x14cf5a[_0xa5e6('0x40')]=[{'all':!![]}];}return db[_0xa5e6('0x28')][_0xa5e6('0x41')](_0x14cf5a);})[_0xa5e6('0x23')](function(_0x518132){_0x205d34[_0xa5e6('0x42')]=_0x518132;return _0x205d34;})[_0xa5e6('0x23')](respondWithFilteredResult(_0x164ac7,_0x14cf5a))[_0xa5e6('0x43')](handleError(_0x164ac7,null));};exports['show']=function(_0x199fe5,_0x257523){var _0x1d01da={'raw':!![],'where':{'id':_0x199fe5[_0xa5e6('0x44')]['id']}},_0x3cde80={};_0x3cde80['model']=_[_0xa5e6('0x2f')](db['OpenchannelQueueReport'][_0xa5e6('0x29')]);_0x3cde80[_0xa5e6('0x2e')]=_[_0xa5e6('0x2f')](_0x199fe5['query']);_0x3cde80[_0xa5e6('0x30')]=_[_0xa5e6('0x32')](_0x3cde80['model'],_0x3cde80[_0xa5e6('0x2e')]);_0x1d01da[_0xa5e6('0x31')]=_[_0xa5e6('0x32')](_0x3cde80[_0xa5e6('0x2c')],qs['fields'](_0x199fe5['query']['fields']));_0x1d01da[_0xa5e6('0x31')]=_0x1d01da['attributes'][_0xa5e6('0x34')]?_0x1d01da[_0xa5e6('0x31')]:_0x3cde80[_0xa5e6('0x2c')];if(_0x199fe5[_0xa5e6('0x2e')][_0xa5e6('0x3f')]){_0x1d01da['include']=[{'all':!![]}];}_0x1d01da=_[_0xa5e6('0x3b')]({},_0x1d01da,_0x199fe5[_0xa5e6('0x45')]);return db['OpenchannelQueueReport'][_0xa5e6('0x46')](_0x1d01da)[_0xa5e6('0x23')](handleEntityNotFound(_0x257523,null))[_0xa5e6('0x23')](respondWithResult(_0x257523,null))['catch'](handleError(_0x257523,null));};exports[_0xa5e6('0x47')]=function(_0x268d27,_0x1d12c6){return db[_0xa5e6('0x28')]['create'](_0x268d27[_0xa5e6('0x48')],{})[_0xa5e6('0x23')](respondWithResult(_0x1d12c6,0xc9))[_0xa5e6('0x43')](handleError(_0x1d12c6,null));};exports['update']=function(_0x4f5931,_0xd7cf5f){if(_0x4f5931[_0xa5e6('0x48')]['id']){delete _0x4f5931[_0xa5e6('0x48')]['id'];}return db[_0xa5e6('0x28')][_0xa5e6('0x46')]({'where':{'id':_0x4f5931[_0xa5e6('0x44')]['id']}})[_0xa5e6('0x23')](handleEntityNotFound(_0xd7cf5f,null))[_0xa5e6('0x23')](saveUpdates(_0x4f5931[_0xa5e6('0x48')],null))[_0xa5e6('0x23')](respondWithResult(_0xd7cf5f,null))[_0xa5e6('0x43')](handleError(_0xd7cf5f,null));};exports[_0xa5e6('0x24')]=function(_0x1c1f6a,_0x70b00b){return db['OpenchannelQueueReport'][_0xa5e6('0x46')]({'where':{'id':_0x1c1f6a[_0xa5e6('0x44')]['id']}})[_0xa5e6('0x23')](handleEntityNotFound(_0x70b00b,null))[_0xa5e6('0x23')](removeEntity(_0x70b00b,null))[_0xa5e6('0x43')](handleError(_0x70b00b,null));};exports[_0xa5e6('0x49')]=function(_0x1c43b6,_0x3aa677){return db['OpenchannelQueueReport']['describe']()[_0xa5e6('0x23')](respondWithResult(_0x3aa677,null))['catch'](handleError(_0x3aa677,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ce059a4..8918b44 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 _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x2543a9,_0x4cf8e4){var _0x314790=function(_0x6be8f5){while(--_0x6be8f5){_0x2543a9['push'](_0x2543a9['shift']());}};_0x314790(++_0x4cf8e4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x36df73,_0x1ff1d9){var _0x1eb16b=function(_0x10d33f){while(--_0x10d33f){_0x36df73['push'](_0x36df73['shift']());}};_0x1eb16b(++_0x1ff1d9);}(_0x7a54,0x106));var _0x47a5=function(_0x12531d,_0x17ff19){_0x12531d=_0x12531d-0x0;var _0x24ce88=_0x7a54[_0x12531d];return _0x24ce88;};'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 78fadba..4b5503b 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 _0x49db=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','where','attributes','lodash'];(function(_0x3eef0d,_0x38a38b){var _0x2c78fc=function(_0x1a9da2){while(--_0x1a9da2){_0x3eef0d['push'](_0x3eef0d['shift']());}};_0x2c78fc(++_0x38a38b);}(_0x49db,0xc5));var _0xb49d=function(_0x502d24,_0x3442f1){_0x502d24=_0x502d24-0x0;var _0x9dabdd=_0x49db[_0x502d24];return _0x9dabdd;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var moment=require(_0xb49d('0x2'));var BPromise=require(_0xb49d('0x3'));var rs=require(_0xb49d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb49d('0x5'))['db'];var utils=require(_0xb49d('0x6'));var logger=require(_0xb49d('0x7'))('rpc');var config=require(_0xb49d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb49d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4180c8,_0x15f52f,_0x572ee4){return new BPromise(function(_0x12e114,_0x128caa){return client[_0xb49d('0xa')](_0x4180c8,_0x572ee4)[_0xb49d('0xb')](function(_0x3d4825){logger[_0xb49d('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x15f52f,'request\x20sent');logger[_0xb49d('0xd')](_0xb49d('0xe'),_0x15f52f,_0xb49d('0xf'),JSON[_0xb49d('0x10')](_0x3d4825));if(_0x3d4825[_0xb49d('0x11')]){if(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x12')]===0x1f4){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x3d4825['error'][_0xb49d('0x14')]);return _0x128caa(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);}logger[_0xb49d('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x15f52f,_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);return _0x12e114(_0x3d4825['error'][_0xb49d('0x14')]);}else{logger[_0xb49d('0xc')](_0xb49d('0x13'),_0x15f52f,_0xb49d('0xf'));_0x12e114(_0x3d4825[_0xb49d('0x15')][_0xb49d('0x14')]);}})[_0xb49d('0x16')](function(_0x584ade){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x584ade);_0x128caa(_0x584ade);});});}exports[_0xb49d('0x17')]=function(_0xf0bdff){var _0x4abce4=this;return new Promise(function(_0x4f3988,_0xfd7a95){return db[_0xb49d('0x18')][_0xb49d('0x19')](_0xf0bdff[_0xb49d('0x1a')],{'raw':_0xf0bdff[_0xb49d('0x1b')]?_0xf0bdff['options'][_0xb49d('0x1c')]===undefined?!![]:![]:!![]})[_0xb49d('0xb')](function(_0x3bf7a2){logger[_0xb49d('0xc')](_0xb49d('0x17'),_0xf0bdff);logger[_0xb49d('0xd')](_0xb49d('0x17'),_0xf0bdff,JSON[_0xb49d('0x10')](_0x3bf7a2));_0x4f3988(_0x3bf7a2);})[_0xb49d('0x16')](function(_0x38be04){logger[_0xb49d('0x11')](_0xb49d('0x17'),_0x38be04[_0xb49d('0x14')],_0xf0bdff);_0xfd7a95(_0x4abce4[_0xb49d('0x11')](0x1f4,_0x38be04[_0xb49d('0x14')]));});});};exports[_0xb49d('0x1d')]=function(_0x26db55){var _0x21c0e1=this;return new Promise(function(_0x165ec2,_0x1ae086){return db[_0xb49d('0x18')][_0xb49d('0x1e')](_0x26db55['body'],{'raw':_0x26db55[_0xb49d('0x1b')]?_0x26db55['options'][_0xb49d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26db55[_0xb49d('0x1b')]?_0x26db55['options'][_0xb49d('0x1f')]||null:null,'attributes':_0x26db55[_0xb49d('0x1b')]?_0x26db55[_0xb49d('0x1b')][_0xb49d('0x20')]||null:null,'limit':_0x26db55[_0xb49d('0x1b')]?_0x26db55[_0xb49d('0x1b')]['limit']||null:null})[_0xb49d('0xb')](function(_0xf734e1){logger[_0xb49d('0xc')](_0xb49d('0x1d'),_0x26db55);logger[_0xb49d('0xd')](_0xb49d('0x1d'),_0x26db55,JSON[_0xb49d('0x10')](_0xf734e1));_0x165ec2(_0xf734e1);})['catch'](function(_0x3f1796){logger['error'](_0xb49d('0x1d'),_0x3f1796[_0xb49d('0x14')],_0x26db55);_0x1ae086(_0x21c0e1[_0xb49d('0x11')](0x1f4,_0x3f1796[_0xb49d('0x14')]));});});}; \ No newline at end of file +var _0x0abf=['debug','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelQueueReport,\x20%s,\x20%s','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','then','UpdateOpenchannelQueueReport','where','attributes','limit'];(function(_0x1e9b82,_0x149177){var _0x4afca3=function(_0x489636){while(--_0x489636){_0x1e9b82['push'](_0x1e9b82['shift']());}};_0x4afca3(++_0x149177);}(_0x0abf,0xe8));var _0xf0ab=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0abf[_0x501510];return _0x1e6ee5;};'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});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')](_0x1803f0[_0xf0ab('0x18')],{'raw':_0x1803f0[_0xf0ab('0x19')]?_0x1803f0[_0xf0ab('0x19')][_0xf0ab('0x1a')]===undefined?!![]:![]:!![]})[_0xf0ab('0x1b')](function(_0x22a205){logger[_0xf0ab('0xb')](_0xf0ab('0x15'),_0x1803f0);logger['debug'](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x22a205));_0x776619(_0x22a205);})[_0xf0ab('0x14')](function(_0x11ab3a){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x11ab3a[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x11ab3a[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x1c')]=function(_0x43119f){var _0x5645b2=this;return new Promise(function(_0x585841,_0x4eee21){return db[_0xf0ab('0x16')]['update'](_0x43119f[_0xf0ab('0x18')],{'raw':_0x43119f[_0xf0ab('0x19')]?_0x43119f['options'][_0xf0ab('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43119f[_0xf0ab('0x19')]?_0x43119f[_0xf0ab('0x19')][_0xf0ab('0x1d')]||null:null,'attributes':_0x43119f[_0xf0ab('0x19')]?_0x43119f['options'][_0xf0ab('0x1e')]||null:null,'limit':_0x43119f['options']?_0x43119f['options'][_0xf0ab('0x1f')]||null:null})[_0xf0ab('0x1b')](function(_0x1b223d){logger[_0xf0ab('0xb')](_0xf0ab('0x1c'),_0x43119f);logger[_0xf0ab('0x20')](_0xf0ab('0x1c'),_0x43119f,JSON[_0xf0ab('0xe')](_0x1b223d));_0x585841(_0x1b223d);})[_0xf0ab('0x14')](function(_0x2f0fcd){logger[_0xf0ab('0xf')](_0xf0ab('0x1c'),_0x2f0fcd['message'],_0x43119f);_0x4eee21(_0x5645b2[_0xf0ab('0xf')](0x1f4,_0x2f0fcd[_0xf0ab('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 81bd4d0..93213bb 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 _0x539c=['fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','express'];(function(_0x27c024,_0x2b950d){var _0x26c1d3=function(_0x12b2be){while(--_0x12b2be){_0x27c024['push'](_0x27c024['shift']());}};_0x26c1d3(++_0x2b950d);}(_0x539c,0x18c));var _0xc539=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x539c[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xc539('0x0'));var util=require(_0xc539('0x1'));var path=require(_0xc539('0x2'));var timeout=require('connect-timeout');var express=require(_0xc539('0x3'));var router=express['Router']();var fs_extra=require(_0xc539('0x4'));var auth=require(_0xc539('0x5'));var interaction=require(_0xc539('0x6'));var config=require('../../config/environment');var controller=require(_0xc539('0x7'));router['get']('/',auth[_0xc539('0x8')](),controller[_0xc539('0x9')]);router[_0xc539('0xa')](_0xc539('0xb'),auth[_0xc539('0x8')](),controller[_0xc539('0xc')]);router['get'](_0xc539('0xd'),auth[_0xc539('0x8')](),controller[_0xc539('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc539('0xf')]);router[_0xc539('0x10')]('/:id',auth[_0xc539('0x8')](),controller[_0xc539('0x11')]);router[_0xc539('0x12')](_0xc539('0xd'),auth[_0xc539('0x8')](),controller['destroy']);module[_0xc539('0x13')]=router; \ No newline at end of file +var _0x85f7=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x2f6a85,_0x1825f2){var _0x1a8700=function(_0x2686d7){while(--_0x2686d7){_0x2f6a85['push'](_0x2f6a85['shift']());}};_0x1a8700(++_0x1825f2);}(_0x85f7,0x69));var _0x785f=function(_0x4f46a8,_0x5a3109){_0x4f46a8=_0x4f46a8-0x0;var _0x5d4759=_0x85f7[_0x4f46a8];return _0x5d4759;};'use strict';var multer=require(_0x785f('0x0'));var util=require(_0x785f('0x1'));var path=require(_0x785f('0x2'));var timeout=require(_0x785f('0x3'));var express=require(_0x785f('0x4'));var router=express[_0x785f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x785f('0x6'));var interaction=require(_0x785f('0x7'));var config=require(_0x785f('0x8'));var controller=require(_0x785f('0x9'));router[_0x785f('0xa')]('/',auth['isAuthenticated'](),controller[_0x785f('0xb')]);router['get'](_0x785f('0xc'),auth['isAuthenticated'](),controller[_0x785f('0xd')]);router[_0x785f('0xa')](_0x785f('0xe'),auth[_0x785f('0xf')](),controller[_0x785f('0x10')]);router[_0x785f('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x785f('0x12')](_0x785f('0xe'),auth[_0x785f('0xf')](),controller[_0x785f('0x13')]);router[_0x785f('0x14')](_0x785f('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x785f('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index a27076d..bf7b29b 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x44f4d7,_0x483d85){var _0x3fc48e=function(_0x568172){while(--_0x568172){_0x44f4d7['push'](_0x44f4d7['shift']());}};_0x3fc48e(++_0x483d85);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5c520b,_0x491b40){_0x5c520b=_0x5c520b-0x0;var _0x195d43=_0xf4eb[_0x5c520b];return _0x195d43;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3a3758,_0x4dd8cf){var _0x1a9234=function(_0x3dda22){while(--_0x3dda22){_0x3a3758['push'](_0x3a3758['shift']());}};_0x1a9234(++_0x4dd8cf);}(_0x34e8,0x12c));var _0x834e=function(_0x13b477,_0x30a84f){_0x13b477=_0x13b477-0x0;var _0x229182=_0x34e8[_0x13b477];return _0x229182;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d750ef4..c718998 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 _0xd80e=['find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','keys','length'];(function(_0x2b3dbf,_0xa664b){var _0x5c21e6=function(_0xdf3d94){while(--_0xdf3d94){_0x2b3dbf['push'](_0x2b3dbf['shift']());}};_0x5c21e6(++_0xa664b);}(_0xd80e,0x13a));var _0xed80=function(_0x4d8b38,_0x1d9854){_0x4d8b38=_0x4d8b38-0x0;var _0x3b74db=_0xd80e[_0x4d8b38];return _0x3b74db;};'use strict';var emlformat=require(_0xed80('0x0'));var rimraf=require(_0xed80('0x1'));var zipdir=require(_0xed80('0x2'));var jsonpatch=require(_0xed80('0x3'));var rp=require(_0xed80('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xed80('0x5'));var path=require(_0xed80('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xed80('0x7'));var fs=require('fs');var fs_extra=require(_0xed80('0x8'));var _=require(_0xed80('0x9'));var squel=require(_0xed80('0xa'));var crypto=require(_0xed80('0xb'));var jsforce=require(_0xed80('0xc'));var deskjs=require(_0xed80('0xd'));var toCsv=require(_0xed80('0xe'));var querystring=require(_0xed80('0xf'));var Papa=require(_0xed80('0x10'));var Redis=require(_0xed80('0x11'));var authService=require(_0xed80('0x12'));var qs=require(_0xed80('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xed80('0x14'));var logger=require(_0xed80('0x15'))(_0xed80('0x16'));var utils=require(_0xed80('0x17'));var config=require(_0xed80('0x18'));var licenseUtil=require(_0xed80('0x19'));var db=require(_0xed80('0x1a'))['db'];function respondWithStatusCode(_0x41cb5b,_0x3aff59){_0x3aff59=_0x3aff59||0xcc;return function(_0x1289b4){if(_0x1289b4){return _0x41cb5b[_0xed80('0x1b')](_0x3aff59);}return _0x41cb5b[_0xed80('0x1c')](_0x3aff59)[_0xed80('0x1d')]();};}function respondWithResult(_0x1f48d9,_0x58e736){_0x58e736=_0x58e736||0xc8;return function(_0x170aba){if(_0x170aba){return _0x1f48d9[_0xed80('0x1c')](_0x58e736)['json'](_0x170aba);}};}function respondWithFilteredResult(_0x39294c,_0x522940){return function(_0x187357){if(_0x187357){var _0x3fca9b=typeof _0x522940[_0xed80('0x1e')]===_0xed80('0x1f')&&typeof _0x522940[_0xed80('0x20')]===_0xed80('0x1f');var _0x4f2b5f=_0x187357[_0xed80('0x21')];var _0x3d3539=_0x3fca9b?0x0:_0x522940[_0xed80('0x1e')];var _0xe5690d=_0x3fca9b?_0x187357[_0xed80('0x21')]:_0x522940[_0xed80('0x1e')]+_0x522940['limit'];var _0x3494ce;if(_0xe5690d>=_0x4f2b5f){_0xe5690d=_0x4f2b5f;_0x3494ce=0xc8;}else{_0x3494ce=0xce;}_0x39294c[_0xed80('0x1c')](_0x3494ce);return _0x39294c[_0xed80('0x22')](_0xed80('0x23'),_0x3d3539+'-'+_0xe5690d+'/'+_0x4f2b5f)[_0xed80('0x24')](_0x187357);}return null;};}function patchUpdates(_0x59958d){return function(_0xc2a8dd){try{jsonpatch['apply'](_0xc2a8dd,_0x59958d,!![]);}catch(_0x409755){return BPromise[_0xed80('0x25')](_0x409755);}return _0xc2a8dd['save']();};}function saveUpdates(_0xe1f778,_0x2ecded){return function(_0xf03b86){if(_0xf03b86){return _0xf03b86[_0xed80('0x26')](_0xe1f778)[_0xed80('0x27')](function(_0x210851){return _0x210851;});}return null;};}function removeEntity(_0xfb9a03,_0x113d4d){return function(_0x240c70){if(_0x240c70){return _0x240c70[_0xed80('0x28')]()[_0xed80('0x27')](function(){_0xfb9a03[_0xed80('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34ad8b,_0x35eb62){return function(_0x29dbba){if(!_0x29dbba){_0x34ad8b[_0xed80('0x1b')](0x194);}return _0x29dbba;};}function handleError(_0x5ead03,_0x4540f9){_0x4540f9=_0x4540f9||0x1f4;return function(_0x428f45){logger['error'](_0x428f45['stack']);if(_0x428f45[_0xed80('0x29')]){delete _0x428f45[_0xed80('0x29')];}_0x5ead03['status'](_0x4540f9)[_0xed80('0x2a')](_0x428f45);};}exports[_0xed80('0x2b')]=function(_0x3df761,_0x2d67fd){var _0x44f402={},_0x28a459={},_0x8107bb={'count':0x0,'rows':[]};var _0x252dc5=_[_0xed80('0x2c')](db[_0xed80('0x2d')][_0xed80('0x2e')],function(_0x51d1f0){return{'name':_0x51d1f0[_0xed80('0x2f')],'type':_0x51d1f0['type'][_0xed80('0x30')]};});_0x28a459[_0xed80('0x31')]=_[_0xed80('0x2c')](_0x252dc5,'name');_0x28a459[_0xed80('0x32')]=_['keys'](_0x3df761[_0xed80('0x32')]);_0x28a459[_0xed80('0x33')]=_[_0xed80('0x34')](_0x28a459[_0xed80('0x31')],_0x28a459[_0xed80('0x32')]);_0x44f402[_0xed80('0x35')]=_[_0xed80('0x34')](_0x28a459['model'],qs[_0xed80('0x36')](_0x3df761[_0xed80('0x32')]['fields']));_0x44f402[_0xed80('0x35')]=_0x44f402[_0xed80('0x35')]['length']?_0x44f402[_0xed80('0x35')]:_0x28a459['model'];if(!_0x3df761['query'][_0xed80('0x37')](_0xed80('0x38'))){_0x44f402[_0xed80('0x20')]=qs['limit'](_0x3df761[_0xed80('0x32')]['limit']);_0x44f402[_0xed80('0x1e')]=qs[_0xed80('0x1e')](_0x3df761['query'][_0xed80('0x1e')]);}_0x44f402[_0xed80('0x39')]=qs[_0xed80('0x3a')](_0x3df761['query'][_0xed80('0x3a')]);_0x44f402[_0xed80('0x3b')]=qs[_0xed80('0x33')](_['pick'](_0x3df761[_0xed80('0x32')],_0x28a459[_0xed80('0x33')]),_0x252dc5);if(_0x3df761[_0xed80('0x32')][_0xed80('0x3c')]){_0x44f402['where']=_[_0xed80('0x3d')](_0x44f402[_0xed80('0x3b')],{'$or':_[_0xed80('0x2c')](_0x252dc5,function(_0xb46a49){if(_0xb46a49[_0xed80('0x3e')]!==_0xed80('0x3f')){var _0x2c1400={};_0x2c1400[_0xb46a49[_0xed80('0x29')]]={'$like':'%'+_0x3df761[_0xed80('0x32')][_0xed80('0x3c')]+'%'};return _0x2c1400;}})});}_0x44f402=_[_0xed80('0x3d')]({},_0x44f402,_0x3df761[_0xed80('0x40')]);var _0x463df1={'where':_0x44f402[_0xed80('0x3b')]};return db[_0xed80('0x2d')]['count'](_0x463df1)['then'](function(_0x3e22a5){_0x8107bb[_0xed80('0x21')]=_0x3e22a5;if(_0x3df761[_0xed80('0x32')]['includeAll']){_0x44f402[_0xed80('0x41')]=[{'all':!![]}];}return db[_0xed80('0x2d')][_0xed80('0x42')](_0x44f402);})[_0xed80('0x27')](function(_0x43d474){_0x8107bb[_0xed80('0x43')]=_0x43d474;return _0x8107bb;})['then'](respondWithFilteredResult(_0x2d67fd,_0x44f402))['catch'](handleError(_0x2d67fd,null));};exports[_0xed80('0x44')]=function(_0x36ac1a,_0x76536a){var _0x23e356={'raw':!![],'where':{'id':_0x36ac1a['params']['id']}},_0x5cd7ca={};_0x5cd7ca[_0xed80('0x31')]=_[_0xed80('0x45')](db[_0xed80('0x2d')]['rawAttributes']);_0x5cd7ca[_0xed80('0x32')]=_[_0xed80('0x45')](_0x36ac1a[_0xed80('0x32')]);_0x5cd7ca[_0xed80('0x33')]=_['intersection'](_0x5cd7ca['model'],_0x5cd7ca[_0xed80('0x32')]);_0x23e356[_0xed80('0x35')]=_[_0xed80('0x34')](_0x5cd7ca[_0xed80('0x31')],qs[_0xed80('0x36')](_0x36ac1a[_0xed80('0x32')][_0xed80('0x36')]));_0x23e356[_0xed80('0x35')]=_0x23e356['attributes'][_0xed80('0x46')]?_0x23e356['attributes']:_0x5cd7ca[_0xed80('0x31')];if(_0x36ac1a[_0xed80('0x32')]['includeAll']){_0x23e356[_0xed80('0x41')]=[{'all':!![]}];}_0x23e356=_[_0xed80('0x3d')]({},_0x23e356,_0x36ac1a[_0xed80('0x40')]);return db[_0xed80('0x2d')][_0xed80('0x47')](_0x23e356)['then'](handleEntityNotFound(_0x76536a,null))[_0xed80('0x27')](respondWithResult(_0x76536a,null))[_0xed80('0x48')](handleError(_0x76536a,null));};exports[_0xed80('0x49')]=function(_0x32f143,_0x514f78){return db['OpenchannelTransferReport']['create'](_0x32f143[_0xed80('0x4a')],{})['then'](respondWithResult(_0x514f78,0xc9))['catch'](handleError(_0x514f78,null));};exports['update']=function(_0x283f65,_0x2d31ef){if(_0x283f65[_0xed80('0x4a')]['id']){delete _0x283f65[_0xed80('0x4a')]['id'];}return db['OpenchannelTransferReport'][_0xed80('0x47')]({'where':{'id':_0x283f65['params']['id']}})['then'](handleEntityNotFound(_0x2d31ef,null))[_0xed80('0x27')](saveUpdates(_0x283f65[_0xed80('0x4a')],null))['then'](respondWithResult(_0x2d31ef,null))[_0xed80('0x48')](handleError(_0x2d31ef,null));};exports['destroy']=function(_0x44a971,_0x4b21ad){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x44a971[_0xed80('0x4b')]['id']}})[_0xed80('0x27')](handleEntityNotFound(_0x4b21ad,null))[_0xed80('0x27')](removeEntity(_0x4b21ad,null))[_0xed80('0x48')](handleError(_0x4b21ad,null));};exports['describe']=function(_0x225c76,_0x24465f){return db['OpenchannelTransferReport'][_0xed80('0x4c')]()[_0xed80('0x27')](respondWithResult(_0x24465f,null))[_0xed80('0x48')](handleError(_0x24465f,null));}; \ No newline at end of file +var _0xe9d5=['stack','name','map','fieldName','key','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','type','options','OpenchannelTransferReport','include','findAll','keys','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0xe9d5,0x191));var _0x5e9d=function(_0x18847a,_0xd6898e){_0x18847a=_0x18847a-0x0;var _0x5b68ca=_0xe9d5[_0x18847a];return _0x5b68ca;};'use strict';var emlformat=require(_0x5e9d('0x0'));var rimraf=require(_0x5e9d('0x1'));var zipdir=require(_0x5e9d('0x2'));var jsonpatch=require(_0x5e9d('0x3'));var rp=require(_0x5e9d('0x4'));var moment=require('moment');var BPromise=require(_0x5e9d('0x5'));var Mustache=require(_0x5e9d('0x6'));var util=require(_0x5e9d('0x7'));var path=require(_0x5e9d('0x8'));var sox=require(_0x5e9d('0x9'));var csv=require(_0x5e9d('0xa'));var ejs=require(_0x5e9d('0xb'));var fs=require('fs');var fs_extra=require(_0x5e9d('0xc'));var _=require(_0x5e9d('0xd'));var squel=require(_0x5e9d('0xe'));var crypto=require(_0x5e9d('0xf'));var jsforce=require(_0x5e9d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5e9d('0xa'));var querystring=require(_0x5e9d('0x11'));var Papa=require(_0x5e9d('0x12'));var Redis=require(_0x5e9d('0x13'));var authService=require(_0x5e9d('0x14'));var qs=require(_0x5e9d('0x15'));var as=require(_0x5e9d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e9d('0x17'))(_0x5e9d('0x18'));var utils=require('../../config/utils');var config=require(_0x5e9d('0x19'));var licenseUtil=require(_0x5e9d('0x1a'));var db=require(_0x5e9d('0x1b'))['db'];function respondWithStatusCode(_0x148803,_0x2052a9){_0x2052a9=_0x2052a9||0xcc;return function(_0x2a8d73){if(_0x2a8d73){return _0x148803[_0x5e9d('0x1c')](_0x2052a9);}return _0x148803[_0x5e9d('0x1d')](_0x2052a9)[_0x5e9d('0x1e')]();};}function respondWithResult(_0x224167,_0x572dcd){_0x572dcd=_0x572dcd||0xc8;return function(_0x494d48){if(_0x494d48){return _0x224167[_0x5e9d('0x1d')](_0x572dcd)[_0x5e9d('0x1f')](_0x494d48);}};}function respondWithFilteredResult(_0x1b751b,_0x564037){return function(_0x552c36){if(_0x552c36){var _0x53a3f2=typeof _0x564037[_0x5e9d('0x20')]===_0x5e9d('0x21')&&typeof _0x564037[_0x5e9d('0x22')]==='undefined';var _0x43b47a=_0x552c36[_0x5e9d('0x23')];var _0x4e87ae=_0x53a3f2?0x0:_0x564037[_0x5e9d('0x20')];var _0x275d86=_0x53a3f2?_0x552c36['count']:_0x564037['offset']+_0x564037['limit'];var _0x49b8c3;if(_0x275d86>=_0x43b47a){_0x275d86=_0x43b47a;_0x49b8c3=0xc8;}else{_0x49b8c3=0xce;}_0x1b751b[_0x5e9d('0x1d')](_0x49b8c3);return _0x1b751b[_0x5e9d('0x24')](_0x5e9d('0x25'),_0x4e87ae+'-'+_0x275d86+'/'+_0x43b47a)[_0x5e9d('0x1f')](_0x552c36);}return null;};}function patchUpdates(_0x36293d){return function(_0x528af8){try{jsonpatch[_0x5e9d('0x26')](_0x528af8,_0x36293d,!![]);}catch(_0x5006ff){return BPromise[_0x5e9d('0x27')](_0x5006ff);}return _0x528af8['save']();};}function saveUpdates(_0x5be633,_0x248bf6){return function(_0x567ee1){if(_0x567ee1){return _0x567ee1[_0x5e9d('0x28')](_0x5be633)[_0x5e9d('0x29')](function(_0x3a9f65){return _0x3a9f65;});}return null;};}function removeEntity(_0x225570,_0x26ece7){return function(_0x597501){if(_0x597501){return _0x597501[_0x5e9d('0x2a')]()[_0x5e9d('0x29')](function(){_0x225570[_0x5e9d('0x1d')](0xcc)[_0x5e9d('0x1e')]();});}};}function handleEntityNotFound(_0x68d127,_0x310eb9){return function(_0x318469){if(!_0x318469){_0x68d127[_0x5e9d('0x1c')](0x194);}return _0x318469;};}function handleError(_0x4e267d,_0x273039){_0x273039=_0x273039||0x1f4;return function(_0x232116){logger['error'](_0x232116[_0x5e9d('0x2b')]);if(_0x232116[_0x5e9d('0x2c')]){delete _0x232116['name'];}_0x4e267d[_0x5e9d('0x1d')](_0x273039)['send'](_0x232116);};}exports['index']=function(_0x2083a3,_0x63f9d1){var _0x2822cb={},_0x434296={},_0x20177c={'count':0x0,'rows':[]};var _0x287d4d=_[_0x5e9d('0x2d')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x3b256a){return{'name':_0x3b256a[_0x5e9d('0x2e')],'type':_0x3b256a['type'][_0x5e9d('0x2f')]};});_0x434296['model']=_['map'](_0x287d4d,_0x5e9d('0x2c'));_0x434296[_0x5e9d('0x30')]=_['keys'](_0x2083a3[_0x5e9d('0x30')]);_0x434296[_0x5e9d('0x31')]=_['intersection'](_0x434296[_0x5e9d('0x32')],_0x434296[_0x5e9d('0x30')]);_0x2822cb['attributes']=_[_0x5e9d('0x33')](_0x434296[_0x5e9d('0x32')],qs[_0x5e9d('0x34')](_0x2083a3[_0x5e9d('0x30')]['fields']));_0x2822cb[_0x5e9d('0x35')]=_0x2822cb[_0x5e9d('0x35')][_0x5e9d('0x36')]?_0x2822cb[_0x5e9d('0x35')]:_0x434296[_0x5e9d('0x32')];if(!_0x2083a3['query'][_0x5e9d('0x37')](_0x5e9d('0x38'))){_0x2822cb[_0x5e9d('0x22')]=qs[_0x5e9d('0x22')](_0x2083a3[_0x5e9d('0x30')][_0x5e9d('0x22')]);_0x2822cb[_0x5e9d('0x20')]=qs['offset'](_0x2083a3['query'][_0x5e9d('0x20')]);}_0x2822cb[_0x5e9d('0x39')]=qs['sort'](_0x2083a3[_0x5e9d('0x30')]['sort']);_0x2822cb[_0x5e9d('0x3a')]=qs[_0x5e9d('0x31')](_[_0x5e9d('0x3b')](_0x2083a3[_0x5e9d('0x30')],_0x434296[_0x5e9d('0x31')]),_0x287d4d);if(_0x2083a3['query']['filter']){_0x2822cb[_0x5e9d('0x3a')]=_[_0x5e9d('0x3c')](_0x2822cb[_0x5e9d('0x3a')],{'$or':_['map'](_0x287d4d,function(_0x2bca51){if(_0x2bca51[_0x5e9d('0x3d')]!=='VIRTUAL'){var _0x22a994={};_0x22a994[_0x2bca51[_0x5e9d('0x2c')]]={'$like':'%'+_0x2083a3['query']['filter']+'%'};return _0x22a994;}})});}_0x2822cb=_['merge']({},_0x2822cb,_0x2083a3[_0x5e9d('0x3e')]);var _0x4f22f2={'where':_0x2822cb[_0x5e9d('0x3a')]};return db[_0x5e9d('0x3f')][_0x5e9d('0x23')](_0x4f22f2)[_0x5e9d('0x29')](function(_0x43b34f){_0x20177c[_0x5e9d('0x23')]=_0x43b34f;if(_0x2083a3[_0x5e9d('0x30')]['includeAll']){_0x2822cb[_0x5e9d('0x40')]=[{'all':!![]}];}return db[_0x5e9d('0x3f')][_0x5e9d('0x41')](_0x2822cb);})[_0x5e9d('0x29')](function(_0x3b1f34){_0x20177c['rows']=_0x3b1f34;return _0x20177c;})[_0x5e9d('0x29')](respondWithFilteredResult(_0x63f9d1,_0x2822cb))['catch'](handleError(_0x63f9d1,null));};exports['show']=function(_0x2b2a46,_0x50be26){var _0x154c5e={'raw':!![],'where':{'id':_0x2b2a46['params']['id']}},_0x2aab46={};_0x2aab46[_0x5e9d('0x32')]=_[_0x5e9d('0x42')](db['OpenchannelTransferReport']['rawAttributes']);_0x2aab46[_0x5e9d('0x30')]=_[_0x5e9d('0x42')](_0x2b2a46[_0x5e9d('0x30')]);_0x2aab46[_0x5e9d('0x31')]=_[_0x5e9d('0x33')](_0x2aab46[_0x5e9d('0x32')],_0x2aab46[_0x5e9d('0x30')]);_0x154c5e[_0x5e9d('0x35')]=_[_0x5e9d('0x33')](_0x2aab46[_0x5e9d('0x32')],qs[_0x5e9d('0x34')](_0x2b2a46[_0x5e9d('0x30')][_0x5e9d('0x34')]));_0x154c5e['attributes']=_0x154c5e['attributes'][_0x5e9d('0x36')]?_0x154c5e['attributes']:_0x2aab46['model'];if(_0x2b2a46[_0x5e9d('0x30')][_0x5e9d('0x43')]){_0x154c5e[_0x5e9d('0x40')]=[{'all':!![]}];}_0x154c5e=_['merge']({},_0x154c5e,_0x2b2a46['options']);return db[_0x5e9d('0x3f')][_0x5e9d('0x44')](_0x154c5e)[_0x5e9d('0x29')](handleEntityNotFound(_0x50be26,null))[_0x5e9d('0x29')](respondWithResult(_0x50be26,null))[_0x5e9d('0x45')](handleError(_0x50be26,null));};exports[_0x5e9d('0x46')]=function(_0x161bcf,_0x5226b7){return db[_0x5e9d('0x3f')][_0x5e9d('0x46')](_0x161bcf['body'],{})[_0x5e9d('0x29')](respondWithResult(_0x5226b7,0xc9))['catch'](handleError(_0x5226b7,null));};exports[_0x5e9d('0x28')]=function(_0x537481,_0x28e833){if(_0x537481[_0x5e9d('0x47')]['id']){delete _0x537481[_0x5e9d('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x5e9d('0x44')]({'where':{'id':_0x537481[_0x5e9d('0x48')]['id']}})[_0x5e9d('0x29')](handleEntityNotFound(_0x28e833,null))[_0x5e9d('0x29')](saveUpdates(_0x537481[_0x5e9d('0x47')],null))[_0x5e9d('0x29')](respondWithResult(_0x28e833,null))['catch'](handleError(_0x28e833,null));};exports[_0x5e9d('0x2a')]=function(_0x1801fa,_0x1992a4){return db[_0x5e9d('0x3f')]['find']({'where':{'id':_0x1801fa[_0x5e9d('0x48')]['id']}})['then'](handleEntityNotFound(_0x1992a4,null))[_0x5e9d('0x29')](removeEntity(_0x1992a4,null))[_0x5e9d('0x45')](handleError(_0x1992a4,null));};exports['describe']=function(_0x7fe05e,_0x361112){return db[_0x5e9d('0x3f')][_0x5e9d('0x49')]()[_0x5e9d('0x29')](respondWithResult(_0x361112,null))[_0x5e9d('0x45')](handleError(_0x361112,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index cf3a160..83f3448 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 _0x98b8=['util','api','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x98b8,0x83));var _0x898b=function(_0x17a610,_0x32a8f6){_0x17a610=_0x17a610-0x0;var _0xdabd1f=_0x98b8[_0x17a610];return _0xdabd1f;};'use strict';var _=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var logger=require('../../config/logger')(_0x898b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x898b('0x3'));var fs=require('fs');var path=require(_0x898b('0x4'));var rimraf=require(_0x898b('0x5'));var config=require(_0x898b('0x6'));var attributes=require(_0x898b('0x7'));module[_0x898b('0x8')]=function(_0x2c97ec,_0x1e4a8c){return _0x2c97ec[_0x898b('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x898b('0xa'),'paranoid':![],'indexes':[{'name':_0x898b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8d43=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x8d43,0x1df));var _0x38d4=function(_0x2f82e3,_0x40d4ba){_0x2f82e3=_0x2f82e3-0x0;var _0x2eff94=_0x8d43[_0x2f82e3];return _0x2eff94;};'use strict';var _=require(_0x38d4('0x0'));var util=require(_0x38d4('0x1'));var logger=require('../../config/logger')(_0x38d4('0x2'));var moment=require(_0x38d4('0x3'));var BPromise=require(_0x38d4('0x4'));var rp=require(_0x38d4('0x5'));var fs=require('fs');var path=require(_0x38d4('0x6'));var rimraf=require(_0x38d4('0x7'));var config=require(_0x38d4('0x8'));var attributes=require(_0x38d4('0x9'));module['exports']=function(_0x43f695,_0xcc0e51){return _0x43f695[_0x38d4('0xa')](_0x38d4('0xb'),attributes,{'tableName':_0x38d4('0xc'),'paranoid':![],'indexes':[{'name':_0x38d4('0xd'),'fields':[_0x38d4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 1cff34a..8b5d732 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 _0x2f2e=['message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2f2e,0x146));var _0xe2f2=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x2f2e[_0x3d34da];return _0xcf6af8;};'use strict';var _=require('lodash');var util=require(_0xe2f2('0x0'));var moment=require(_0xe2f2('0x1'));var BPromise=require('bluebird');var rs=require(_0xe2f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2f2('0x3'))['db'];var utils=require(_0xe2f2('0x4'));var logger=require(_0xe2f2('0x5'))(_0xe2f2('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe2f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23f7a8,_0x2bdfe5,_0xc44c89){return new BPromise(function(_0x48111c,_0x514125){return client['request'](_0x23f7a8,_0xc44c89)[_0xe2f2('0x8')](function(_0x48ee72){logger[_0xe2f2('0x9')](_0xe2f2('0xa'),_0x2bdfe5,_0xe2f2('0xb'));logger[_0xe2f2('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2bdfe5,_0xe2f2('0xb'),JSON[_0xe2f2('0xd')](_0x48ee72));if(_0x48ee72['error']){if(_0x48ee72[_0xe2f2('0xe')][_0xe2f2('0xf')]===0x1f4){logger[_0xe2f2('0xe')](_0xe2f2('0xa'),_0x2bdfe5,_0x48ee72[_0xe2f2('0xe')][_0xe2f2('0x10')]);return _0x514125(_0x48ee72[_0xe2f2('0xe')][_0xe2f2('0x10')]);}logger[_0xe2f2('0xe')](_0xe2f2('0xa'),_0x2bdfe5,_0x48ee72['error'][_0xe2f2('0x10')]);return _0x48111c(_0x48ee72[_0xe2f2('0xe')][_0xe2f2('0x10')]);}else{logger[_0xe2f2('0x9')](_0xe2f2('0xa'),_0x2bdfe5,'request\x20sent');_0x48111c(_0x48ee72['result'][_0xe2f2('0x10')]);}})[_0xe2f2('0x11')](function(_0x37f965){logger['error'](_0xe2f2('0xa'),_0x2bdfe5,_0x37f965);_0x514125(_0x37f965);});});} \ No newline at end of file +var _0x3c17=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','randomstring'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x3c17,0x1a1));var _0x73c1=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x3c17[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var moment=require(_0x73c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x73c1('0x2'));var fs=require('fs');var Redis=require(_0x73c1('0x3'));var db=require(_0x73c1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x73c1('0x5'))(_0x73c1('0x6'));var config=require(_0x73c1('0x7'));var jayson=require(_0x73c1('0x8'));var client=jayson['client'][_0x73c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58151c,_0x4433e0,_0x42ca06){return new BPromise(function(_0x422176,_0x5155aa){return client['request'](_0x58151c,_0x42ca06)[_0x73c1('0xa')](function(_0x2eb6fe){logger[_0x73c1('0xb')](_0x73c1('0xc'),_0x4433e0,_0x73c1('0xd'));logger[_0x73c1('0xe')](_0x73c1('0xf'),_0x4433e0,'request\x20sent',JSON['stringify'](_0x2eb6fe));if(_0x2eb6fe[_0x73c1('0x10')]){if(_0x2eb6fe[_0x73c1('0x10')][_0x73c1('0x11')]===0x1f4){logger[_0x73c1('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4433e0,_0x2eb6fe[_0x73c1('0x10')]['message']);return _0x5155aa(_0x2eb6fe[_0x73c1('0x10')]['message']);}logger[_0x73c1('0x10')](_0x73c1('0xc'),_0x4433e0,_0x2eb6fe['error']['message']);return _0x422176(_0x2eb6fe[_0x73c1('0x10')]['message']);}else{logger[_0x73c1('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4433e0,_0x73c1('0xd'));_0x422176(_0x2eb6fe['result'][_0x73c1('0x12')]);}})[_0x73c1('0x13')](function(_0x39256e){logger[_0x73c1('0x10')](_0x73c1('0xc'),_0x4433e0,_0x39256e);_0x5155aa(_0x39256e);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 7f68174..b13d475 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 _0x5ce1=['/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index'];(function(_0x506486,_0x486f4c){var _0x573872=function(_0x1d9123){while(--_0x1d9123){_0x506486['push'](_0x506486['shift']());}};_0x573872(++_0x486f4c);}(_0x5ce1,0x1e7));var _0x15ce=function(_0x3e6393,_0x4ffe6a){_0x3e6393=_0x3e6393-0x0;var _0x50c40a=_0x5ce1[_0x3e6393];return _0x50c40a;};'use strict';var multer=require(_0x15ce('0x0'));var util=require(_0x15ce('0x1'));var path=require(_0x15ce('0x2'));var timeout=require(_0x15ce('0x3'));var express=require(_0x15ce('0x4'));var router=express[_0x15ce('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x15ce('0x6'));var interaction=require(_0x15ce('0x7'));var config=require(_0x15ce('0x8'));var controller=require(_0x15ce('0x9'));router[_0x15ce('0xa')]('/',auth[_0x15ce('0xb')](),controller[_0x15ce('0xc')]);router[_0x15ce('0xa')](_0x15ce('0xd'),auth['isAuthenticated'](),controller[_0x15ce('0xe')]);router[_0x15ce('0xf')]('/',auth['isAuthenticated'](),controller[_0x15ce('0x10')]);router['put']('/:id',auth[_0x15ce('0xb')](),controller[_0x15ce('0x11')]);router['delete'](_0x15ce('0xd'),auth[_0x15ce('0xb')](),controller[_0x15ce('0x12')]);module[_0x15ce('0x13')]=router; \ No newline at end of file +var _0x0125=['get','/:id','isAuthenticated','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x283000,_0x1c641e){var _0x395169=function(_0x513108){while(--_0x513108){_0x283000['push'](_0x283000['shift']());}};_0x395169(++_0x1c641e);}(_0x0125,0x182));var _0x5012=function(_0x5de214,_0x107e9d){_0x5de214=_0x5de214-0x0;var _0x4df627=_0x0125[_0x5de214];return _0x4df627;};'use strict';var multer=require(_0x5012('0x0'));var util=require(_0x5012('0x1'));var path=require(_0x5012('0x2'));var timeout=require(_0x5012('0x3'));var express=require(_0x5012('0x4'));var router=express[_0x5012('0x5')]();var fs_extra=require(_0x5012('0x6'));var auth=require(_0x5012('0x7'));var interaction=require(_0x5012('0x8'));var config=require(_0x5012('0x9'));var controller=require('./pause.controller');router[_0x5012('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5012('0xa')](_0x5012('0xb'),auth[_0x5012('0xc')](),controller[_0x5012('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5012('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x5012('0xf')]);router['delete'](_0x5012('0xb'),auth[_0x5012('0xc')](),controller[_0x5012('0x10')]);module[_0x5012('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index f13e4d3..3896af3 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 _0x7027=['sequelize','exports','STRING'];(function(_0x26e2ed,_0x1928b1){var _0x1b6916=function(_0x34301e){while(--_0x34301e){_0x26e2ed['push'](_0x26e2ed['shift']());}};_0x1b6916(++_0x1928b1);}(_0x7027,0x15f));var _0x7702=function(_0x56c4e7,_0x4b63ba){_0x56c4e7=_0x56c4e7-0x0;var _0x26c42a=_0x7027[_0x56c4e7];return _0x26c42a;};'use strict';var Sequelize=require(_0x7702('0x0'));module[_0x7702('0x1')]={'name':{'type':Sequelize[_0x7702('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1283=['sequelize','exports','STRING','name'];(function(_0x46c7cb,_0x50b0a8){var _0x503fdc=function(_0x5f57f5){while(--_0x5f57f5){_0x46c7cb['push'](_0x46c7cb['shift']());}};_0x503fdc(++_0x50b0a8);}(_0x1283,0x1bc));var _0x3128=function(_0x2a53ad,_0x234135){_0x2a53ad=_0x2a53ad-0x0;var _0x31b3b6=_0x1283[_0x2a53ad];return _0x31b3b6;};'use strict';var Sequelize=require(_0x3128('0x0'));module[_0x3128('0x1')]={'name':{'type':Sequelize[_0x3128('0x2')],'unique':_0x3128('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3128('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 59449fb..f6f6333 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 _0x1d47=['filter','options','include','Pause','findAll','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','Content-Range','apply','reject','save','update','destroy','then','get','Pauses','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL'];(function(_0x53ddf1,_0x52e358){var _0x5c21ae=function(_0x76a80d){while(--_0x76a80d){_0x53ddf1['push'](_0x53ddf1['shift']());}};_0x5c21ae(++_0x52e358);}(_0x1d47,0x1a8));var _0x71d4=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x1d47[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0x71d4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x71d4('0x1'));var rp=require(_0x71d4('0x2'));var moment=require('moment');var BPromise=require(_0x71d4('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x71d4('0x4'));var sox=require(_0x71d4('0x5'));var csv=require('to-csv');var ejs=require(_0x71d4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x71d4('0x7'));var squel=require(_0x71d4('0x8'));var crypto=require(_0x71d4('0x9'));var jsforce=require(_0x71d4('0xa'));var deskjs=require(_0x71d4('0xb'));var toCsv=require(_0x71d4('0xc'));var querystring=require(_0x71d4('0xd'));var Papa=require('papaparse');var Redis=require(_0x71d4('0xe'));var authService=require(_0x71d4('0xf'));var qs=require(_0x71d4('0x10'));var as=require(_0x71d4('0x11'));var hardwareService=require(_0x71d4('0x12'));var logger=require(_0x71d4('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x71d4('0x14'));var db=require(_0x71d4('0x15'))['db'];function respondWithStatusCode(_0x424cba,_0x425792){_0x425792=_0x425792||0xcc;return function(_0x516879){if(_0x516879){return _0x424cba[_0x71d4('0x16')](_0x425792);}return _0x424cba[_0x71d4('0x17')](_0x425792)[_0x71d4('0x18')]();};}function respondWithResult(_0x7277e9,_0x2d1fa4){_0x2d1fa4=_0x2d1fa4||0xc8;return function(_0x4ed1fc){if(_0x4ed1fc){return _0x7277e9[_0x71d4('0x17')](_0x2d1fa4)[_0x71d4('0x19')](_0x4ed1fc);}};}function respondWithFilteredResult(_0x37c741,_0x1a71c9){return function(_0x102333){if(_0x102333){var _0x2dca66=typeof _0x1a71c9['offset']==='undefined'&&typeof _0x1a71c9[_0x71d4('0x1a')]===_0x71d4('0x1b');var _0x430577=_0x102333['count'];var _0x4c72d7=_0x2dca66?0x0:_0x1a71c9[_0x71d4('0x1c')];var _0xd0862f=_0x2dca66?_0x102333[_0x71d4('0x1d')]:_0x1a71c9[_0x71d4('0x1c')]+_0x1a71c9[_0x71d4('0x1a')];var _0x458162;if(_0xd0862f>=_0x430577){_0xd0862f=_0x430577;_0x458162=0xc8;}else{_0x458162=0xce;}_0x37c741[_0x71d4('0x17')](_0x458162);return _0x37c741['set'](_0x71d4('0x1e'),_0x4c72d7+'-'+_0xd0862f+'/'+_0x430577)['json'](_0x102333);}return null;};}function patchUpdates(_0x5160cb){return function(_0x589444){try{jsonpatch[_0x71d4('0x1f')](_0x589444,_0x5160cb,!![]);}catch(_0x137c07){return BPromise[_0x71d4('0x20')](_0x137c07);}return _0x589444[_0x71d4('0x21')]();};}function saveUpdates(_0x174765,_0x32bc07){return function(_0x2dd763){if(_0x2dd763){return _0x2dd763[_0x71d4('0x22')](_0x174765)['then'](function(_0x51581c){return _0x51581c;});}return null;};}function removeEntity(_0x498608,_0x2d3391){return function(_0x21a44a){if(_0x21a44a){return _0x21a44a[_0x71d4('0x23')]()[_0x71d4('0x24')](function(){var _0x489cc5=_0x21a44a[_0x71d4('0x25')]({'plain':!![]});var _0x469508=_0x71d4('0x26');return db['UserProfileResource'][_0x71d4('0x23')]({'where':{'type':_0x469508,'resourceId':_0x489cc5['id']}})[_0x71d4('0x24')](function(){return _0x21a44a;});})[_0x71d4('0x24')](function(){_0x498608[_0x71d4('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13a33e,_0x39a77f){return function(_0x838787){if(!_0x838787){_0x13a33e[_0x71d4('0x16')](0x194);}return _0x838787;};}function handleError(_0x2e4e6e,_0x3b05f6){_0x3b05f6=_0x3b05f6||0x1f4;return function(_0x2b3340){logger[_0x71d4('0x27')](_0x2b3340['stack']);if(_0x2b3340['name']){delete _0x2b3340[_0x71d4('0x28')];}_0x2e4e6e[_0x71d4('0x17')](_0x3b05f6)[_0x71d4('0x29')](_0x2b3340);};}exports[_0x71d4('0x2a')]=function(_0x1e4d9d,_0x5144ea){var _0x426a6c={},_0x4edf14={},_0x101486={'count':0x0,'rows':[]};var _0x40420e=_[_0x71d4('0x2b')](db['Pause'][_0x71d4('0x2c')],function(_0x1c0105){return{'name':_0x1c0105[_0x71d4('0x2d')],'type':_0x1c0105[_0x71d4('0x2e')][_0x71d4('0x2f')]};});_0x4edf14[_0x71d4('0x30')]=_[_0x71d4('0x2b')](_0x40420e,_0x71d4('0x28'));_0x4edf14['query']=_[_0x71d4('0x31')](_0x1e4d9d['query']);_0x4edf14[_0x71d4('0x32')]=_[_0x71d4('0x33')](_0x4edf14[_0x71d4('0x30')],_0x4edf14[_0x71d4('0x34')]);_0x426a6c[_0x71d4('0x35')]=_['intersection'](_0x4edf14[_0x71d4('0x30')],qs['fields'](_0x1e4d9d[_0x71d4('0x34')][_0x71d4('0x36')]));_0x426a6c[_0x71d4('0x35')]=_0x426a6c['attributes'][_0x71d4('0x37')]?_0x426a6c[_0x71d4('0x35')]:_0x4edf14[_0x71d4('0x30')];if(!_0x1e4d9d[_0x71d4('0x34')][_0x71d4('0x38')]('nolimit')){_0x426a6c['limit']=qs[_0x71d4('0x1a')](_0x1e4d9d[_0x71d4('0x34')][_0x71d4('0x1a')]);_0x426a6c[_0x71d4('0x1c')]=qs[_0x71d4('0x1c')](_0x1e4d9d['query']['offset']);}_0x426a6c[_0x71d4('0x39')]=qs[_0x71d4('0x3a')](_0x1e4d9d[_0x71d4('0x34')][_0x71d4('0x3a')]);_0x426a6c[_0x71d4('0x3b')]=qs[_0x71d4('0x32')](_['pick'](_0x1e4d9d[_0x71d4('0x34')],_0x4edf14['filters']),_0x40420e);if(_0x1e4d9d['query']['filter']){_0x426a6c[_0x71d4('0x3b')]=_[_0x71d4('0x3c')](_0x426a6c[_0x71d4('0x3b')],{'$or':_[_0x71d4('0x2b')](_0x40420e,function(_0x4c1e55){if(_0x4c1e55[_0x71d4('0x2e')]!==_0x71d4('0x3d')){var _0x2b2a9b={};_0x2b2a9b[_0x4c1e55[_0x71d4('0x28')]]={'$like':'%'+_0x1e4d9d[_0x71d4('0x34')][_0x71d4('0x3e')]+'%'};return _0x2b2a9b;}})});}_0x426a6c=_[_0x71d4('0x3c')]({},_0x426a6c,_0x1e4d9d[_0x71d4('0x3f')]);var _0x1fb9a9={'where':_0x426a6c[_0x71d4('0x3b')]};return db['Pause']['count'](_0x1fb9a9)[_0x71d4('0x24')](function(_0x2c22b2){_0x101486[_0x71d4('0x1d')]=_0x2c22b2;if(_0x1e4d9d[_0x71d4('0x34')]['includeAll']){_0x426a6c[_0x71d4('0x40')]=[{'all':!![]}];}return db[_0x71d4('0x41')][_0x71d4('0x42')](_0x426a6c);})[_0x71d4('0x24')](function(_0x51d5de){_0x101486[_0x71d4('0x43')]=_0x51d5de;return _0x101486;})[_0x71d4('0x24')](respondWithFilteredResult(_0x5144ea,_0x426a6c))[_0x71d4('0x44')](handleError(_0x5144ea,null));};exports[_0x71d4('0x45')]=function(_0x22957b,_0x271a37){var _0x20ec1b={'raw':!![],'where':{'id':_0x22957b['params']['id']}},_0x1fdb2c={};_0x1fdb2c[_0x71d4('0x30')]=_[_0x71d4('0x31')](db['Pause']['rawAttributes']);_0x1fdb2c[_0x71d4('0x34')]=_['keys'](_0x22957b[_0x71d4('0x34')]);_0x1fdb2c[_0x71d4('0x32')]=_[_0x71d4('0x33')](_0x1fdb2c[_0x71d4('0x30')],_0x1fdb2c[_0x71d4('0x34')]);_0x20ec1b[_0x71d4('0x35')]=_[_0x71d4('0x33')](_0x1fdb2c[_0x71d4('0x30')],qs[_0x71d4('0x36')](_0x22957b['query']['fields']));_0x20ec1b['attributes']=_0x20ec1b['attributes'][_0x71d4('0x37')]?_0x20ec1b[_0x71d4('0x35')]:_0x1fdb2c[_0x71d4('0x30')];if(_0x22957b[_0x71d4('0x34')][_0x71d4('0x46')]){_0x20ec1b['include']=[{'all':!![]}];}_0x20ec1b=_[_0x71d4('0x3c')]({},_0x20ec1b,_0x22957b[_0x71d4('0x3f')]);return db[_0x71d4('0x41')][_0x71d4('0x47')](_0x20ec1b)[_0x71d4('0x24')](handleEntityNotFound(_0x271a37,null))['then'](respondWithResult(_0x271a37,null))[_0x71d4('0x44')](handleError(_0x271a37,null));};exports[_0x71d4('0x48')]=function(_0x23def6,_0x1a43b8){return db[_0x71d4('0x41')][_0x71d4('0x48')](_0x23def6[_0x71d4('0x49')],{})['then'](function(_0x1cf754){var _0xc790fe=_0x23def6[_0x71d4('0x4a')][_0x71d4('0x25')]({'plain':!![]});if(!_0xc790fe)throw new Error(_0x71d4('0x4b'));if(_0xc790fe['role']===_0x71d4('0x4a')){var _0x513a7c=_0x1cf754[_0x71d4('0x25')]({'plain':!![]});var _0x22b660=_0x71d4('0x26');return db[_0x71d4('0x4c')][_0x71d4('0x47')]({'where':{'name':_0x22b660,'userProfileId':_0xc790fe[_0x71d4('0x4d')]},'raw':!![]})[_0x71d4('0x24')](function(_0x5ee06c){if(_0x5ee06c&&_0x5ee06c[_0x71d4('0x4e')]===0x0){return db[_0x71d4('0x4f')][_0x71d4('0x48')]({'name':_0x513a7c[_0x71d4('0x28')],'resourceId':_0x513a7c['id'],'type':_0x5ee06c[_0x71d4('0x28')],'sectionId':_0x5ee06c['id']},{})[_0x71d4('0x24')](function(){return _0x1cf754;});}else{return _0x1cf754;}})[_0x71d4('0x44')](function(_0x4eae08){logger[_0x71d4('0x27')](_0x71d4('0x50'),_0x4eae08);throw _0x4eae08;});}return _0x1cf754;})['then'](respondWithResult(_0x1a43b8,0xc9))[_0x71d4('0x44')](handleError(_0x1a43b8,null));};exports['update']=function(_0x248656,_0x169ec9){if(_0x248656[_0x71d4('0x49')]['id']){delete _0x248656[_0x71d4('0x49')]['id'];}return db[_0x71d4('0x41')][_0x71d4('0x47')]({'where':{'id':_0x248656['params']['id']}})[_0x71d4('0x24')](handleEntityNotFound(_0x169ec9,null))[_0x71d4('0x24')](saveUpdates(_0x248656[_0x71d4('0x49')],null))[_0x71d4('0x24')](respondWithResult(_0x169ec9,null))[_0x71d4('0x44')](handleError(_0x169ec9,null));};exports[_0x71d4('0x23')]=function(_0x5da6d7,_0x530ff3){return db['Pause'][_0x71d4('0x47')]({'where':{'id':_0x5da6d7['params']['id']}})[_0x71d4('0x24')](handleEntityNotFound(_0x530ff3,null))[_0x71d4('0x24')](removeEntity(_0x530ff3,null))[_0x71d4('0x44')](handleError(_0x530ff3,null));}; \ No newline at end of file +var _0x273a=['map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','UserProfileResource','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','sendStatus','error','stack','name','send'];(function(_0x2d2845,_0x477ae4){var _0x4e5ca8=function(_0x43daee){while(--_0x43daee){_0x2d2845['push'](_0x2d2845['shift']());}};_0x4e5ca8(++_0x477ae4);}(_0x273a,0x79));var _0xa273=function(_0x4181df,_0x3d78a3){_0x4181df=_0x4181df-0x0;var _0x55d165=_0x273a[_0x4181df];return _0x55d165;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa273('0x0'));var zipdir=require(_0xa273('0x1'));var jsonpatch=require(_0xa273('0x2'));var rp=require(_0xa273('0x3'));var moment=require('moment');var BPromise=require(_0xa273('0x4'));var Mustache=require(_0xa273('0x5'));var util=require(_0xa273('0x6'));var path=require(_0xa273('0x7'));var sox=require(_0xa273('0x8'));var csv=require(_0xa273('0x9'));var ejs=require(_0xa273('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa273('0xb'));var squel=require(_0xa273('0xc'));var crypto=require(_0xa273('0xd'));var jsforce=require(_0xa273('0xe'));var deskjs=require(_0xa273('0xf'));var toCsv=require(_0xa273('0x9'));var querystring=require(_0xa273('0x10'));var Papa=require('papaparse');var Redis=require(_0xa273('0x11'));var authService=require(_0xa273('0x12'));var qs=require(_0xa273('0x13'));var as=require(_0xa273('0x14'));var hardwareService=require(_0xa273('0x15'));var logger=require('../../config/logger')(_0xa273('0x16'));var utils=require(_0xa273('0x17'));var config=require(_0xa273('0x18'));var licenseUtil=require(_0xa273('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aa9ad,_0x162aea){_0x162aea=_0x162aea||0xcc;return function(_0x1d8880){if(_0x1d8880){return _0x2aa9ad['sendStatus'](_0x162aea);}return _0x2aa9ad[_0xa273('0x1a')](_0x162aea)[_0xa273('0x1b')]();};}function respondWithResult(_0x44affb,_0x31098d){_0x31098d=_0x31098d||0xc8;return function(_0x48f51e){if(_0x48f51e){return _0x44affb[_0xa273('0x1a')](_0x31098d)[_0xa273('0x1c')](_0x48f51e);}};}function respondWithFilteredResult(_0x4dd93d,_0x438a4c){return function(_0x48b943){if(_0x48b943){var _0x299ddf=typeof _0x438a4c[_0xa273('0x1d')]===_0xa273('0x1e')&&typeof _0x438a4c[_0xa273('0x1f')]==='undefined';var _0x5957af=_0x48b943[_0xa273('0x20')];var _0x36b0d1=_0x299ddf?0x0:_0x438a4c[_0xa273('0x1d')];var _0x5ef717=_0x299ddf?_0x48b943[_0xa273('0x20')]:_0x438a4c[_0xa273('0x1d')]+_0x438a4c['limit'];var _0x2316f1;if(_0x5ef717>=_0x5957af){_0x5ef717=_0x5957af;_0x2316f1=0xc8;}else{_0x2316f1=0xce;}_0x4dd93d['status'](_0x2316f1);return _0x4dd93d['set'](_0xa273('0x21'),_0x36b0d1+'-'+_0x5ef717+'/'+_0x5957af)[_0xa273('0x1c')](_0x48b943);}return null;};}function patchUpdates(_0x3cc70c){return function(_0x3ad44d){try{jsonpatch['apply'](_0x3ad44d,_0x3cc70c,!![]);}catch(_0x161905){return BPromise['reject'](_0x161905);}return _0x3ad44d['save']();};}function saveUpdates(_0xcc502e,_0x94160b){return function(_0x5bb08c){if(_0x5bb08c){return _0x5bb08c[_0xa273('0x22')](_0xcc502e)[_0xa273('0x23')](function(_0x1bd232){return _0x1bd232;});}return null;};}function removeEntity(_0x573d7e,_0x5f375c){return function(_0x4ba254){if(_0x4ba254){return _0x4ba254[_0xa273('0x24')]()[_0xa273('0x23')](function(){var _0xef6abd=_0x4ba254[_0xa273('0x25')]({'plain':!![]});var _0x50c1c1='Pauses';return db['UserProfileResource'][_0xa273('0x24')]({'where':{'type':_0x50c1c1,'resourceId':_0xef6abd['id']}})[_0xa273('0x23')](function(){return _0x4ba254;});})[_0xa273('0x23')](function(){_0x573d7e[_0xa273('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d591a,_0x5ed928){return function(_0x8a1bbd){if(!_0x8a1bbd){_0x2d591a[_0xa273('0x26')](0x194);}return _0x8a1bbd;};}function handleError(_0x42b115,_0x2fa18e){_0x2fa18e=_0x2fa18e||0x1f4;return function(_0x492532){logger[_0xa273('0x27')](_0x492532[_0xa273('0x28')]);if(_0x492532[_0xa273('0x29')]){delete _0x492532['name'];}_0x42b115[_0xa273('0x1a')](_0x2fa18e)[_0xa273('0x2a')](_0x492532);};}exports['index']=function(_0x4f4a95,_0xcf9fe6){var _0x2118a6={},_0x2a4e70={},_0x376719={'count':0x0,'rows':[]};var _0x588f6f=_[_0xa273('0x2b')](db[_0xa273('0x2c')][_0xa273('0x2d')],function(_0x5de19a){return{'name':_0x5de19a[_0xa273('0x2e')],'type':_0x5de19a[_0xa273('0x2f')][_0xa273('0x30')]};});_0x2a4e70[_0xa273('0x31')]=_[_0xa273('0x2b')](_0x588f6f,'name');_0x2a4e70[_0xa273('0x32')]=_[_0xa273('0x33')](_0x4f4a95['query']);_0x2a4e70[_0xa273('0x34')]=_[_0xa273('0x35')](_0x2a4e70[_0xa273('0x31')],_0x2a4e70[_0xa273('0x32')]);_0x2118a6[_0xa273('0x36')]=_[_0xa273('0x35')](_0x2a4e70[_0xa273('0x31')],qs['fields'](_0x4f4a95[_0xa273('0x32')]['fields']));_0x2118a6[_0xa273('0x36')]=_0x2118a6['attributes'][_0xa273('0x37')]?_0x2118a6[_0xa273('0x36')]:_0x2a4e70[_0xa273('0x31')];if(!_0x4f4a95[_0xa273('0x32')][_0xa273('0x38')](_0xa273('0x39'))){_0x2118a6[_0xa273('0x1f')]=qs[_0xa273('0x1f')](_0x4f4a95['query'][_0xa273('0x1f')]);_0x2118a6[_0xa273('0x1d')]=qs[_0xa273('0x1d')](_0x4f4a95[_0xa273('0x32')][_0xa273('0x1d')]);}_0x2118a6['order']=qs[_0xa273('0x3a')](_0x4f4a95[_0xa273('0x32')][_0xa273('0x3a')]);_0x2118a6[_0xa273('0x3b')]=qs['filters'](_[_0xa273('0x3c')](_0x4f4a95['query'],_0x2a4e70['filters']),_0x588f6f);if(_0x4f4a95[_0xa273('0x32')]['filter']){_0x2118a6[_0xa273('0x3b')]=_[_0xa273('0x3d')](_0x2118a6['where'],{'$or':_['map'](_0x588f6f,function(_0x1c2201){if(_0x1c2201[_0xa273('0x2f')]!==_0xa273('0x3e')){var _0x397d55={};_0x397d55[_0x1c2201['name']]={'$like':'%'+_0x4f4a95[_0xa273('0x32')]['filter']+'%'};return _0x397d55;}})});}_0x2118a6=_['merge']({},_0x2118a6,_0x4f4a95[_0xa273('0x3f')]);var _0xd36b44={'where':_0x2118a6[_0xa273('0x3b')]};return db[_0xa273('0x2c')]['count'](_0xd36b44)[_0xa273('0x23')](function(_0x289b91){_0x376719['count']=_0x289b91;if(_0x4f4a95[_0xa273('0x32')][_0xa273('0x40')]){_0x2118a6['include']=[{'all':!![]}];}return db[_0xa273('0x2c')][_0xa273('0x41')](_0x2118a6);})[_0xa273('0x23')](function(_0x3eea50){_0x376719[_0xa273('0x42')]=_0x3eea50;return _0x376719;})[_0xa273('0x23')](respondWithFilteredResult(_0xcf9fe6,_0x2118a6))[_0xa273('0x43')](handleError(_0xcf9fe6,null));};exports[_0xa273('0x44')]=function(_0x13fddb,_0x3e56e7){var _0x130608={'raw':!![],'where':{'id':_0x13fddb[_0xa273('0x45')]['id']}},_0x57e169={};_0x57e169['model']=_[_0xa273('0x33')](db[_0xa273('0x2c')][_0xa273('0x2d')]);_0x57e169[_0xa273('0x32')]=_[_0xa273('0x33')](_0x13fddb[_0xa273('0x32')]);_0x57e169[_0xa273('0x34')]=_[_0xa273('0x35')](_0x57e169[_0xa273('0x31')],_0x57e169[_0xa273('0x32')]);_0x130608[_0xa273('0x36')]=_[_0xa273('0x35')](_0x57e169[_0xa273('0x31')],qs[_0xa273('0x46')](_0x13fddb[_0xa273('0x32')][_0xa273('0x46')]));_0x130608[_0xa273('0x36')]=_0x130608[_0xa273('0x36')][_0xa273('0x37')]?_0x130608[_0xa273('0x36')]:_0x57e169[_0xa273('0x31')];if(_0x13fddb[_0xa273('0x32')][_0xa273('0x40')]){_0x130608[_0xa273('0x47')]=[{'all':!![]}];}_0x130608=_['merge']({},_0x130608,_0x13fddb['options']);return db[_0xa273('0x2c')][_0xa273('0x48')](_0x130608)[_0xa273('0x23')](handleEntityNotFound(_0x3e56e7,null))['then'](respondWithResult(_0x3e56e7,null))[_0xa273('0x43')](handleError(_0x3e56e7,null));};exports[_0xa273('0x49')]=function(_0x425e68,_0x538c22){return db[_0xa273('0x2c')][_0xa273('0x49')](_0x425e68[_0xa273('0x4a')],{})['then'](function(_0x31eff1){var _0x147282=_0x425e68[_0xa273('0x4b')][_0xa273('0x25')]({'plain':!![]});if(!_0x147282)throw new Error(_0xa273('0x4c'));if(_0x147282[_0xa273('0x4d')]===_0xa273('0x4b')){var _0x1cff95=_0x31eff1[_0xa273('0x25')]({'plain':!![]});var _0x82737d=_0xa273('0x4e');return db[_0xa273('0x4f')][_0xa273('0x48')]({'where':{'name':_0x82737d,'userProfileId':_0x147282[_0xa273('0x50')]},'raw':!![]})[_0xa273('0x23')](function(_0x3e6c84){if(_0x3e6c84&&_0x3e6c84['autoAssociation']===0x0){return db[_0xa273('0x51')][_0xa273('0x49')]({'name':_0x1cff95[_0xa273('0x29')],'resourceId':_0x1cff95['id'],'type':_0x3e6c84[_0xa273('0x29')],'sectionId':_0x3e6c84['id']},{})[_0xa273('0x23')](function(){return _0x31eff1;});}else{return _0x31eff1;}})[_0xa273('0x43')](function(_0x42b818){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42b818);throw _0x42b818;});}return _0x31eff1;})['then'](respondWithResult(_0x538c22,0xc9))['catch'](handleError(_0x538c22,null));};exports[_0xa273('0x22')]=function(_0x2e0656,_0x1dd3b7){if(_0x2e0656[_0xa273('0x4a')]['id']){delete _0x2e0656[_0xa273('0x4a')]['id'];}return db['Pause'][_0xa273('0x48')]({'where':{'id':_0x2e0656[_0xa273('0x45')]['id']}})['then'](handleEntityNotFound(_0x1dd3b7,null))[_0xa273('0x23')](saveUpdates(_0x2e0656[_0xa273('0x4a')],null))[_0xa273('0x23')](respondWithResult(_0x1dd3b7,null))[_0xa273('0x43')](handleError(_0x1dd3b7,null));};exports[_0xa273('0x24')]=function(_0x153436,_0x2502fa){return db['Pause'][_0xa273('0x48')]({'where':{'id':_0x153436['params']['id']}})['then'](handleEntityNotFound(_0x2502fa,null))['then'](removeEntity(_0x2502fa,null))[_0xa273('0x43')](handleError(_0x2502fa,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 39a6879..6c02c13 100644 --- a/server/api/pause/pause.model.js +++ b/server/api/pause/pause.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6aa7,0x178));var _0x76aa=function(_0x5d8246,_0x39c257){_0x5d8246=_0x5d8246-0x0;var _0x45d0d5=_0x6aa7[_0x5d8246];return _0x45d0d5;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var logger=require(_0x76aa('0x1'))(_0x76aa('0x2'));var moment=require(_0x76aa('0x3'));var BPromise=require(_0x76aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76aa('0x5'));var rimraf=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1aceaa,_0x4d53f6){return _0x1aceaa[_0x76aa('0x8')](_0x76aa('0x9'),attributes,{'tableName':_0x76aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xc4aa[_0x565ed7];return _0x183ad7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index e7422a2..4abc4f3 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x384342,_0x163561){var _0x5326bd=function(_0x2c3ae6){while(--_0x2c3ae6){_0x384342['push'](_0x384342['shift']());}};_0x5326bd(++_0x163561);}(_0xb10b,0x12a));var _0xbb10=function(_0x1179f3,_0x100df5){_0x1179f3=_0x1179f3-0x0;var _0x8a9a2b=_0xb10b[_0x1179f3];return _0x8a9a2b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x29e0f6,_0x2f151c){var _0xe93a52=function(_0x2741bd){while(--_0x2741bd){_0x29e0f6['push'](_0x29e0f6['shift']());}};_0xe93a52(++_0x2f151c);}(_0x7a54,0x106));var _0x47a5=function(_0x2566ce,_0x1f8983){_0x2566ce=_0x2566ce-0x0;var _0x26a30a=_0x7a54[_0x2566ce];return _0x26a30a;};'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 e397eb0..0d1c936 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 _0x9a19=['index','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated'];(function(_0x58d97b,_0x39f5e9){var _0x2c5276=function(_0x13c57b){while(--_0x13c57b){_0x58d97b['push'](_0x58d97b['shift']());}};_0x2c5276(++_0x39f5e9);}(_0x9a19,0x114));var _0x99a1=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x9a19[_0x213518];return _0x1baf75;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/webhook',controller['webhookGet']);router['get'](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller['show']);router['get'](_0x99a1('0xe'),auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);var upload=multer({'storage':multer[_0x99a1('0x10')]({'destination':function(_0x1551a1,_0x537032,_0x28ee99){_0x28ee99(null,path[_0x99a1('0x11')](config[_0x99a1('0x12')],_0x99a1('0x13')));},'filename':function(_0x2c68dd,_0x1bc7aa,_0x2ff655){_0x1bc7aa[_0x99a1('0x14')]=_0x1bc7aa[_0x99a1('0x14')][_0x99a1('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ff655(null,util[_0x99a1('0x16')](_0x99a1('0x17'),path[_0x99a1('0x18')](_0x1bc7aa[_0x99a1('0x14')],path[_0x99a1('0x19')](_0x1bc7aa['originalname'])),Date[_0x99a1('0x1a')](),path[_0x99a1('0x19')](_0x1bc7aa[_0x99a1('0x14')])));}})});router[_0x99a1('0x1b')]('/',upload[_0x99a1('0x1c')](_0x99a1('0x1d')),controller[_0x99a1('0x1e')]);router['post']('/webhook',controller[_0x99a1('0x1f')]);router[_0x99a1('0x20')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x21')]);router[_0x99a1('0x22')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x22')]);module[_0x99a1('0x23')]=router; \ No newline at end of file +var _0x68fc=['webhookPost','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','upload','/webhook'];(function(_0x575875,_0x10a79b){var _0x106f09=function(_0x16f3c9){while(--_0x16f3c9){_0x575875['push'](_0x575875['shift']());}};_0x106f09(++_0x10a79b);}(_0x68fc,0xa5));var _0xc68f=function(_0x1bbc0e,_0x846fc0){_0x1bbc0e=_0x1bbc0e-0x0;var _0x18b4ba=_0x68fc[_0x1bbc0e];return _0x18b4ba;};'use strict';var multer=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var path=require(_0xc68f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc68f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc68f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc68f('0x5'));router[_0xc68f('0x6')]('/',auth[_0xc68f('0x7')](),controller[_0xc68f('0x8')]);router['get']('/webhook',controller[_0xc68f('0x9')]);router[_0xc68f('0x6')](_0xc68f('0xa'),auth[_0xc68f('0x7')](),controller[_0xc68f('0xb')]);router[_0xc68f('0x6')](_0xc68f('0xc'),auth[_0xc68f('0x7')](),controller[_0xc68f('0xd')]);var upload=multer({'storage':multer[_0xc68f('0xe')]({'destination':function(_0x5777f9,_0x3b1a43,_0x29f1fe){_0x29f1fe(null,path[_0xc68f('0xf')](config[_0xc68f('0x10')],_0xc68f('0x11')));},'filename':function(_0x2a0a52,_0x3ccebe,_0x41aeb8){_0x3ccebe[_0xc68f('0x12')]=_0x3ccebe[_0xc68f('0x12')][_0xc68f('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41aeb8(null,util['format'](_0xc68f('0x14'),path[_0xc68f('0x15')](_0x3ccebe[_0xc68f('0x12')],path[_0xc68f('0x16')](_0x3ccebe[_0xc68f('0x12')])),Date[_0xc68f('0x17')](),path[_0xc68f('0x16')](_0x3ccebe[_0xc68f('0x12')])));}})});router[_0xc68f('0x18')]('/',upload['single']('file'),controller[_0xc68f('0x19')]);router[_0xc68f('0x18')](_0xc68f('0x1a'),controller[_0xc68f('0x1b')]);router[_0xc68f('0x1c')](_0xc68f('0xa'),auth['isAuthenticated'](),controller[_0xc68f('0x1d')]);router[_0xc68f('0x1e')](_0xc68f('0xa'),auth[_0xc68f('0x7')](),controller[_0xc68f('0x1e')]);module[_0xc68f('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 91f5c69..c5f4eaf 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 _0x039b=['STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0x039b,0x15d));var _0xb039=function(_0x111a05,_0x40a79a){_0x111a05=_0x111a05-0x0;var _0x5d05c2=_0x039b[_0x111a05];return _0x5d05c2;};'use strict';var Sequelize=require(_0xb039('0x0'));module[_0xb039('0x1')]={'name':{'type':Sequelize[_0xb039('0x2')]},'type':{'type':Sequelize[_0xb039('0x3')](_0xb039('0x4'),'script')},'description':{'type':Sequelize[_0xb039('0x5')]},'version':{'type':Sequelize[_0xb039('0x5')]},'path':{'type':Sequelize[_0xb039('0x2')],'comment':_0xb039('0x6')},'active':{'type':Sequelize[_0xb039('0x7')],'defaultValue':0x0,'comment':_0xb039('0x8')},'sidebar':{'type':Sequelize[_0xb039('0x3')](_0xb039('0x9'),'agentOnly',_0xb039('0xa'),_0xb039('0xb')),'defaultValue':'always','comment':_0xb039('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xb039('0x2')]},'scriptName':{'type':Sequelize[_0xb039('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1abd=['never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always'];(function(_0x38dd61,_0x30faf7){var _0x127b42=function(_0x46619a){while(--_0x46619a){_0x38dd61['push'](_0x38dd61['shift']());}};_0x127b42(++_0x30faf7);}(_0x1abd,0x1d0));var _0xd1ab=function(_0xcb6d2b,_0x1a56ac){_0xcb6d2b=_0xcb6d2b-0x0;var _0x2c3687=_0x1abd[_0xcb6d2b];return _0x2c3687;};'use strict';var Sequelize=require(_0xd1ab('0x0'));module[_0xd1ab('0x1')]={'name':{'type':Sequelize[_0xd1ab('0x2')]},'type':{'type':Sequelize[_0xd1ab('0x3')](_0xd1ab('0x4'),_0xd1ab('0x5'))},'description':{'type':Sequelize[_0xd1ab('0x6')]},'version':{'type':Sequelize[_0xd1ab('0x6')]},'path':{'type':Sequelize['STRING'],'comment':_0xd1ab('0x7')},'active':{'type':Sequelize[_0xd1ab('0x8')],'defaultValue':0x0,'comment':_0xd1ab('0x9')},'sidebar':{'type':Sequelize[_0xd1ab('0x3')](_0xd1ab('0xa'),'agentOnly',_0xd1ab('0xb'),_0xd1ab('0xc')),'defaultValue':'always','comment':_0xd1ab('0xd')},'icon':{'type':Sequelize[_0xd1ab('0x2')]},'adminUrl':{'type':Sequelize[_0xd1ab('0x2')]},'agentUrl':{'type':Sequelize[_0xd1ab('0x2')]},'scriptName':{'type':Sequelize[_0xd1ab('0x2')]},'scriptPath':{'type':Sequelize[_0xd1ab('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index c8453af..8b4b11c 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 _0xc837=['plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','json','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','desk.js','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Plugins','UserProfileResource','then','error','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','Plugin','includeAll','findAll','rows','catch','include','find','download','params','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','join','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','icon','icon-apps','test'];(function(_0x9386a,_0x5aa473){var _0x6d30f4=function(_0x2e3386){while(--_0x2e3386){_0x9386a['push'](_0x9386a['shift']());}};_0x6d30f4(++_0x5aa473);}(_0xc837,0xc9));var _0x7c83=function(_0x347932,_0x2618cc){_0x347932=_0x347932-0x0;var _0x7a730c=_0xc837[_0x347932];return _0x7a730c;};'use strict';var emlformat=require(_0x7c83('0x0'));var rimraf=require(_0x7c83('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c83('0x2'));var rp=require(_0x7c83('0x3'));var moment=require(_0x7c83('0x4'));var BPromise=require(_0x7c83('0x5'));var Mustache=require('mustache');var util=require(_0x7c83('0x6'));var path=require(_0x7c83('0x7'));var sox=require(_0x7c83('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7c83('0x9'));var _=require(_0x7c83('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c83('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var extract=require(_0x7c83('0xc'));var rimraf=require(_0x7c83('0x1'));var archiver=require(_0x7c83('0xd'));var Redis=require(_0x7c83('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7c83('0xf'));var as=require(_0x7c83('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c83('0x11'))(_0x7c83('0x12'));var utils=require(_0x7c83('0x13'));var config=require(_0x7c83('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c83('0x15'))['db'];config['redis']=_[_0x7c83('0x16')](config[_0x7c83('0x17')],{'host':_0x7c83('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./plugin.socket')[_0x7c83('0x19')](socket);function respondWithStatusCode(_0x29cd0a,_0x4c8357){_0x4c8357=_0x4c8357||0xcc;return function(_0x47a054){if(_0x47a054){return _0x29cd0a[_0x7c83('0x1a')](_0x4c8357);}return _0x29cd0a[_0x7c83('0x1b')](_0x4c8357)[_0x7c83('0x1c')]();};}function respondWithResult(_0x674f31,_0x3c7fc3){_0x3c7fc3=_0x3c7fc3||0xc8;return function(_0x5ab632){if(_0x5ab632){return _0x674f31['status'](_0x3c7fc3)['json'](_0x5ab632);}};}function respondWithFilteredResult(_0xb5665e,_0x533766){return function(_0x23294b){if(_0x23294b){var _0x183397=typeof _0x533766[_0x7c83('0x1d')]===_0x7c83('0x1e')&&typeof _0x533766[_0x7c83('0x1f')]===_0x7c83('0x1e');var _0x19b326=_0x23294b['count'];var _0x4a1da9=_0x183397?0x0:_0x533766[_0x7c83('0x1d')];var _0x2d078b=_0x183397?_0x23294b[_0x7c83('0x20')]:_0x533766[_0x7c83('0x1d')]+_0x533766[_0x7c83('0x1f')];var _0x2cc7da;if(_0x2d078b>=_0x19b326){_0x2d078b=_0x19b326;_0x2cc7da=0xc8;}else{_0x2cc7da=0xce;}_0xb5665e['status'](_0x2cc7da);return _0xb5665e[_0x7c83('0x21')](_0x7c83('0x22'),_0x4a1da9+'-'+_0x2d078b+'/'+_0x19b326)['json'](_0x23294b);}return null;};}function patchUpdates(_0x2adf33){return function(_0x323f0b){try{jsonpatch[_0x7c83('0x23')](_0x323f0b,_0x2adf33,!![]);}catch(_0x11d2b6){return BPromise[_0x7c83('0x24')](_0x11d2b6);}return _0x323f0b[_0x7c83('0x25')]();};}function saveUpdates(_0x56c6a2,_0x15ec01){return function(_0x51ebc2){if(_0x51ebc2){return _0x51ebc2[_0x7c83('0x26')](_0x56c6a2)['then'](function(_0x2e4cf2){return _0x2e4cf2;});}return null;};}function removeEntity(_0x33170f,_0x3679c7){return function(_0x12697d){if(_0x12697d){return _0x12697d[_0x7c83('0x27')]()['then'](function(){var _0x34b717=_0x12697d[_0x7c83('0x28')]({'plain':!![]});var _0x17cb8d=_0x7c83('0x29');return db[_0x7c83('0x2a')]['destroy']({'where':{'type':_0x17cb8d,'resourceId':_0x34b717['id']}})[_0x7c83('0x2b')](function(){return _0x12697d;});})[_0x7c83('0x2b')](function(){_0x33170f[_0x7c83('0x1b')](0xcc)[_0x7c83('0x1c')]();});}};}function handleEntityNotFound(_0xc64871,_0x108e67){return function(_0x41fd8b){if(!_0x41fd8b){_0xc64871['sendStatus'](0x194);}return _0x41fd8b;};}function handleError(_0x503785,_0xca44a0){_0xca44a0=_0xca44a0||0x1f4;return function(_0x3e8fbe){logger[_0x7c83('0x2c')](_0x3e8fbe['stack']);if(_0x3e8fbe[_0x7c83('0x2d')]){delete _0x3e8fbe[_0x7c83('0x2d')];}_0x503785[_0x7c83('0x1b')](_0xca44a0)['send'](_0x3e8fbe);};}exports[_0x7c83('0x2e')]=function(_0x4cc6d3,_0x10d503){var _0x1c7288={},_0x1de93b={},_0x3411bc={'count':0x0,'rows':[]};var _0x4d1ec8=_[_0x7c83('0x2f')](db['Plugin']['rawAttributes'],function(_0x429598){return{'name':_0x429598[_0x7c83('0x30')],'type':_0x429598[_0x7c83('0x31')][_0x7c83('0x32')]};});_0x1de93b[_0x7c83('0x33')]=_['map'](_0x4d1ec8,_0x7c83('0x2d'));_0x1de93b[_0x7c83('0x34')]=_[_0x7c83('0x35')](_0x4cc6d3[_0x7c83('0x34')]);_0x1de93b[_0x7c83('0x36')]=_['intersection'](_0x1de93b[_0x7c83('0x33')],_0x1de93b['query']);_0x1c7288[_0x7c83('0x37')]=_[_0x7c83('0x38')](_0x1de93b['model'],qs[_0x7c83('0x39')](_0x4cc6d3[_0x7c83('0x34')][_0x7c83('0x39')]));_0x1c7288['attributes']=_0x1c7288[_0x7c83('0x37')][_0x7c83('0x3a')]?_0x1c7288[_0x7c83('0x37')]:_0x1de93b[_0x7c83('0x33')];if(!_0x4cc6d3[_0x7c83('0x34')]['hasOwnProperty'](_0x7c83('0x3b'))){_0x1c7288[_0x7c83('0x1f')]=qs[_0x7c83('0x1f')](_0x4cc6d3['query'][_0x7c83('0x1f')]);_0x1c7288[_0x7c83('0x1d')]=qs[_0x7c83('0x1d')](_0x4cc6d3['query']['offset']);}_0x1c7288['order']=qs[_0x7c83('0x3c')](_0x4cc6d3[_0x7c83('0x34')][_0x7c83('0x3c')]);_0x1c7288['where']=qs[_0x7c83('0x36')](_['pick'](_0x4cc6d3['query'],_0x1de93b[_0x7c83('0x36')]),_0x4d1ec8);if(_0x4cc6d3['query'][_0x7c83('0x3d')]){_0x1c7288[_0x7c83('0x3e')]=_[_0x7c83('0x3f')](_0x1c7288['where'],{'$or':_[_0x7c83('0x2f')](_0x4d1ec8,function(_0x7d18d9){if(_0x7d18d9[_0x7c83('0x31')]!==_0x7c83('0x40')){var _0x42e0d4={};_0x42e0d4[_0x7d18d9[_0x7c83('0x2d')]]={'$like':'%'+_0x4cc6d3[_0x7c83('0x34')]['filter']+'%'};return _0x42e0d4;}})});}_0x1c7288=_['merge']({},_0x1c7288,_0x4cc6d3[_0x7c83('0x41')]);var _0x13f0b4={'where':_0x1c7288[_0x7c83('0x3e')]};return db[_0x7c83('0x42')][_0x7c83('0x20')](_0x13f0b4)[_0x7c83('0x2b')](function(_0x2ef80d){_0x3411bc[_0x7c83('0x20')]=_0x2ef80d;if(_0x4cc6d3[_0x7c83('0x34')][_0x7c83('0x43')]){_0x1c7288['include']=[{'all':!![]}];}return db[_0x7c83('0x42')][_0x7c83('0x44')](_0x1c7288);})[_0x7c83('0x2b')](function(_0x5dd5cc){_0x3411bc[_0x7c83('0x45')]=_0x5dd5cc;return _0x3411bc;})['then'](respondWithFilteredResult(_0x10d503,_0x1c7288))[_0x7c83('0x46')](handleError(_0x10d503,null));};exports['show']=function(_0x292810,_0x2897e1){var _0x57b0fc={'raw':!![],'where':{'id':_0x292810['params']['id']}},_0xc8f40b={};_0xc8f40b[_0x7c83('0x33')]=_[_0x7c83('0x35')](db[_0x7c83('0x42')]['rawAttributes']);_0xc8f40b[_0x7c83('0x34')]=_[_0x7c83('0x35')](_0x292810['query']);_0xc8f40b[_0x7c83('0x36')]=_[_0x7c83('0x38')](_0xc8f40b['model'],_0xc8f40b['query']);_0x57b0fc['attributes']=_['intersection'](_0xc8f40b[_0x7c83('0x33')],qs[_0x7c83('0x39')](_0x292810['query'][_0x7c83('0x39')]));_0x57b0fc[_0x7c83('0x37')]=_0x57b0fc[_0x7c83('0x37')][_0x7c83('0x3a')]?_0x57b0fc[_0x7c83('0x37')]:_0xc8f40b['model'];if(_0x292810[_0x7c83('0x34')]['includeAll']){_0x57b0fc[_0x7c83('0x47')]=[{'all':!![]}];}_0x57b0fc=_[_0x7c83('0x3f')]({},_0x57b0fc,_0x292810[_0x7c83('0x41')]);return db[_0x7c83('0x42')][_0x7c83('0x48')](_0x57b0fc)['then'](handleEntityNotFound(_0x2897e1,null))[_0x7c83('0x2b')](respondWithResult(_0x2897e1,null))[_0x7c83('0x46')](handleError(_0x2897e1,null));};exports[_0x7c83('0x49')]=function(_0x81fc10,_0x497030,_0x550928){return db[_0x7c83('0x42')]['find']({'where':{'id':_0x81fc10[_0x7c83('0x4a')]['id']},'attributes':[_0x7c83('0x2d'),_0x7c83('0x7')],'raw':!![]})[_0x7c83('0x2b')](handleEntityNotFound(_0x497030,null))['then'](function(_0x4bd887){if(_0x4bd887){var _0x3fb4e3=path['join'](config[_0x7c83('0x4b')],_0x7c83('0x4c'),util[_0x7c83('0x4d')](_0x7c83('0x4e'),path['basename'](_0x4bd887[_0x7c83('0x7')])));var _0x5cc41b=fs[_0x7c83('0x4f')](_0x3fb4e3);var _0x3c1ea8=archiver(_0x7c83('0x50'),{'zlib':{'level':0x9}});_0x3c1ea8['on'](_0x7c83('0x51'),function(_0xc9a9b9){if(_0xc9a9b9[_0x7c83('0x52')]===_0x7c83('0x53')){logger[_0x7c83('0x2c')](_0xc9a9b9);}else{throw new db['Sequelize'][(_0x7c83('0x54'))](_0x7c83('0x55'));}});_0x3c1ea8['on'](_0x7c83('0x2c'),function(_0x5f090d){throw new db[(_0x7c83('0x56'))]['Error'](_0x7c83('0x55'));});_0x3c1ea8[_0x7c83('0x57')](_0x5cc41b);_0x3c1ea8[_0x7c83('0x58')](_0x7c83('0x59'),{'cwd':path[_0x7c83('0x5a')](config[_0x7c83('0x4b')],'server/files/plugins',path[_0x7c83('0x5b')](_0x4bd887[_0x7c83('0x7')])),'ignore':[path[_0x7c83('0x5a')](path[_0x7c83('0x5c')](_0x4bd887[_0x7c83('0x7')]),_0x7c83('0x5d')),path['join'](path[_0x7c83('0x5c')](_0x4bd887[_0x7c83('0x7')]),_0x7c83('0x5e'))],'nodir':!![]})[_0x7c83('0x5f')]();_0x5cc41b['on'](_0x7c83('0x60'),function(){if(!fs[_0x7c83('0x61')](_0x3fb4e3)){throw new db[(_0x7c83('0x56'))][(_0x7c83('0x54'))](_0x7c83('0x62'));}return _0x497030[_0x7c83('0x49')](_0x3fb4e3,util[_0x7c83('0x4d')](_0x7c83('0x4e'),path[_0x7c83('0x5c')](_0x4bd887[_0x7c83('0x7')])),function(_0x5efabc){if(_0x5efabc){throw new db[(_0x7c83('0x56'))][(_0x7c83('0x54'))](_0x7c83('0x63'));}fs[_0x7c83('0x64')](_0x3fb4e3);logger[_0x7c83('0x65')](_0x7c83('0x66'));logger['info'](_0x7c83('0x67'));});});}return null;})[_0x7c83('0x46')](handleError(_0x497030,null));};exports[_0x7c83('0x68')]=function(_0x122a3c,_0x2f9f2b,_0x5b4f63){var _0x1c592c=path[_0x7c83('0x5c')](_0x122a3c[_0x7c83('0x69')][_0x7c83('0x6a')],path[_0x7c83('0x6b')](_0x122a3c[_0x7c83('0x69')][_0x7c83('0x6a')]));var _0x41a5ee=path[_0x7c83('0x5a')](config['root'],_0x7c83('0x4c'),_0x122a3c['file'][_0x7c83('0x6a')]);var _0x3f8477=path['join'](config[_0x7c83('0x4b')],_0x7c83('0x4c'),_0x1c592c);logger[_0x7c83('0x65')]('Plugin\x20upload\x20filepath:\x20%s',_0x41a5ee);logger[_0x7c83('0x65')](_0x7c83('0x6c'),_0x3f8477);try{fs[_0x7c83('0x6d')](_0x41a5ee,parseInt(_0x7c83('0x6e'),0x8));extract(_0x41a5ee,{'dir':_0x3f8477},function(_0x1e0163){if(_0x1e0163){logger['error'](_0x1e0163);handleError(_0x1e0163,!![]);};var _0x46e150=fs[_0x7c83('0x6f')](_0x3f8477);if(_0x46e150[_0x7c83('0x3a')]>0x1){removeReferences(_0x41a5ee,_0x3f8477);logger['error']('Invalid\x20plugin\x20structure');return _0x5b4f63(new Error(_0x7c83('0x70')));}var _0x5d1555=fs[_0x7c83('0x71')](path[_0x7c83('0x5a')](_0x3f8477,_0x46e150[0x0]));if(_0x5d1555[_0x7c83('0x72')]()){removeReferences(_0x41a5ee,_0x3f8477);logger[_0x7c83('0x2c')](_0x7c83('0x70'));return _0x5b4f63(new Error('Invalid\x20plugin\x20structure'));}if(_0x5d1555[_0x7c83('0x73')]()){var _0x4e54e6=fs[_0x7c83('0x6f')](path[_0x7c83('0x5a')](_0x3f8477,_0x46e150[0x0]));if(_0x4e54e6[_0x7c83('0x3a')]===0x0){removeReferences(_0x41a5ee,_0x3f8477);logger['error'](_0x7c83('0x70'));return _0x5b4f63(new Error('Invalid\x20plugin\x20structure'));}var _0x4ef151=_0x4e54e6['some'](function(_0x21be87){return _0x21be87==='manifest.json';});if(!_0x4ef151){return _0x5b4f63(new Error('Plugin\x20manifest\x20missing'));}var _0x44cb14=fs[_0x7c83('0x74')](path[_0x7c83('0x5a')](_0x3f8477,_0x46e150[0x0],_0x7c83('0x75')));var _0x2433d5=JSON[_0x7c83('0x76')](_0x44cb14);if(_0x7c83('0x1e')==typeof _0x2433d5['name']){return _0x5b4f63(new Error(_0x7c83('0x77')));}if(_0x7c83('0x1e')==typeof _0x2433d5[_0x7c83('0x31')]){return _0x5b4f63(new Error(_0x7c83('0x78')));}if(_0x7c83('0x1e')==typeof _0x2433d5[_0x7c83('0x79')]){return _0x5b4f63(new Error(_0x7c83('0x7a')));}if('undefined'==typeof _0x2433d5['parameters']){return _0x5b4f63(new Error(_0x7c83('0x7b')));}if(_0x2433d5[_0x7c83('0x31')]===_0x7c83('0x7c')){if(_0x7c83('0x1e')==typeof _0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')]){return _0x5b4f63(new Error(_0x7c83('0x7f')));}if(_0x7c83('0x1e')==typeof _0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')][_0x7c83('0x80')]&&_0x7c83('0x1e')==typeof _0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')][_0x7c83('0x81')]){return _0x5b4f63(new Error(_0x7c83('0x82')));}}else if(_0x2433d5['type']==='script'){if(_0x7c83('0x1e')==typeof _0x2433d5['parameters'][_0x7c83('0x83')]){return _0x5b4f63(new Error(_0x7c83('0x84')));}if(_0x7c83('0x1e')==typeof _0x2433d5[_0x7c83('0x7d')][_0x7c83('0x85')]){return _0x5b4f63(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5b4f63(new Error(_0x7c83('0x86')));}var _0x19c681=_0x2433d5['name'];var _0x2b7d79=_0x2433d5['description'];var _0x67356c=_0x2433d5[_0x7c83('0x31')];var _0xd19153=_0x2433d5[_0x7c83('0x87')]?_0x2433d5[_0x7c83('0x87')]:'always';var _0x37652d=_0x2433d5[_0x7c83('0x88')]?_0x2433d5[_0x7c83('0x88')]:_0x7c83('0x89');var _0x127e84='';var _0x33833a='';var _0x5e3df2='';var _0x4ca583='';var _0x68c778=_0x2433d5[_0x7c83('0x79')];if(_0x67356c===_0x7c83('0x7c')){if(_0x7c83('0x1e')!=typeof _0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')][_0x7c83('0x80')]){var _0x423119=_0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7c83('0x8a')](_0x423119)){_0x127e84=path['join'](_0x7c83('0x8b'),_0x1c592c,_0x46e150[0x0],_0x423119);}else{_0x127e84=_0x423119;}}else{logger[_0x7c83('0x65')](_0x7c83('0x8c'));}if(_0x7c83('0x1e')!=typeof _0x2433d5['parameters'][_0x7c83('0x7e')][_0x7c83('0x81')]){var _0x5972ee=_0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')][_0x7c83('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x7c83('0x8a')](_0x5972ee)){_0x33833a=path[_0x7c83('0x5a')](_0x7c83('0x8b'),_0x1c592c,_0x46e150[0x0],_0x5972ee);}else{_0x33833a=_0x5972ee;}}else{logger['info'](_0x7c83('0x8d'));}}else if(_0x67356c===_0x7c83('0x8e')){_0x5e3df2=_0x2433d5[_0x7c83('0x7d')]['scriptName'];_0x4ca583=_0x2433d5[_0x7c83('0x7d')][_0x7c83('0x85')];if('undefined'!=typeof _0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')]){if(_0x7c83('0x1e')!=typeof _0x2433d5['parameters']['views']['admin']){var _0x423119=_0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')][_0x7c83('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x7c83('0x8a')](_0x423119)){_0x127e84=path[_0x7c83('0x5a')](_0x7c83('0x8b'),_0x1c592c,_0x46e150[0x0],_0x423119);}else{_0x127e84=_0x423119;}}if(_0x7c83('0x1e')!=typeof _0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')][_0x7c83('0x81')]){var _0x5972ee=_0x2433d5[_0x7c83('0x7d')][_0x7c83('0x7e')][_0x7c83('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x7c83('0x8a')](_0x5972ee)){_0x33833a=path[_0x7c83('0x5a')]('plugins',_0x1c592c,_0x46e150[0x0],_0x5972ee);}else{_0x33833a=_0x5972ee;}}}}var _0x13e36a={'name':_0x19c681,'description':_0x2b7d79,'path':path[_0x7c83('0x5a')](_0x1c592c,_0x46e150[0x0]),'type':_0x67356c,'sidebar':_0xd19153,'icon':_0x37652d,'adminUrl':_0x127e84,'agentUrl':_0x33833a,'scriptName':_0x5e3df2,'scriptPath':_0x4ca583,'version':_0x68c778};removeReferences(_0x41a5ee,null);return db[_0x7c83('0x42')][_0x7c83('0x8f')](_0x13e36a)[_0x7c83('0x2b')](function(_0x18a7e6){var _0x3fef87={'role':_0x122a3c['body']['role'],'userProfileId':_0x122a3c[_0x7c83('0x90')][_0x7c83('0x91')]};if(!_0x3fef87)throw new Error(_0x7c83('0x92'));if(_0x3fef87[_0x7c83('0x93')]===_0x7c83('0x94')){var _0x4817b4=_0x18a7e6[_0x7c83('0x28')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Plugins','userProfileId':_0x3fef87['userProfileId']},'raw':!![]})[_0x7c83('0x2b')](function(_0x36a887){if(_0x36a887&&_0x36a887[_0x7c83('0x95')]===0x0){return db[_0x7c83('0x2a')][_0x7c83('0x8f')]({'name':_0x4817b4[_0x7c83('0x2d')],'resourceId':_0x4817b4['id'],'type':_0x36a887[_0x7c83('0x2d')],'sectionId':_0x36a887['id']},{})[_0x7c83('0x2b')](function(){return _0x18a7e6;});}else{return _0x18a7e6;}})[_0x7c83('0x46')](function(_0x515d72){logger[_0x7c83('0x2c')](_0x7c83('0x96'),_0x515d72);throw _0x515d72;});}return _0x18a7e6;})[_0x7c83('0x2b')](respondWithResult(_0x2f9f2b,null))[_0x7c83('0x46')](handleError(_0x2f9f2b,null));}});}catch(_0x2b2a6){_0x2f9f2b['status'](0x1f4)[_0x7c83('0x97')](_0x2b2a6);}};function removeReferences(_0x12f140,_0x4d8c9f){try{if(_0x12f140){fs[_0x7c83('0x64')](_0x12f140);logger[_0x7c83('0x65')](_0x7c83('0x98'));}if(_0x4d8c9f){rimraf(_0x4d8c9f,function(){});logger['info'](_0x7c83('0x99'));}}catch(_0x5a9caf){logger['error'](_0x5a9caf);}}exports[_0x7c83('0x26')]=function(_0x172ffb,_0x271322,_0x50522){return db[_0x7c83('0x42')]['find']({'where':{'id':_0x172ffb[_0x7c83('0x4a')]['id']}})[_0x7c83('0x2b')](handleEntityNotFound(_0x271322,null))['then'](saveUpdates(_0x172ffb['body'],null))['then'](respondWithResult(_0x271322,null))['catch'](handleError(_0x271322,null));};exports[_0x7c83('0x9a')]=function(_0x421c56,_0x2dcd67,_0x1f615a){return db[_0x7c83('0x42')]['find']({'where':{'id':_0x421c56[_0x7c83('0x4a')]['id']}})[_0x7c83('0x2b')](function(_0xd7d8d2){if(_0xd7d8d2){return _0xd7d8d2['destroy']();}})[_0x7c83('0x2b')](function(_0x461f39){rimraf(path[_0x7c83('0x5a')](config['root'],'server/files/plugins',path[_0x7c83('0x5b')](_0x461f39[_0x7c83('0x7')])),function(){});return _0x461f39;})[_0x7c83('0x2b')](handleEntityNotFound(_0x2dcd67,null))[_0x7c83('0x2b')](respondWithStatusCode(_0x2dcd67,null))[_0x7c83('0x46')](handleError(_0x2dcd67,null));};exports[_0x7c83('0x9b')]=function(_0x5a2e29,_0x2b31c4,_0x436e87){return BPromise[_0x7c83('0x9c')]()['then'](function(){if(!_0x5a2e29[_0x7c83('0x34')][_0x7c83('0x7')]){throw new Error(_0x7c83('0x9d'));}if(!_0x5a2e29[_0x7c83('0x34')][_0x7c83('0x9e')]){throw new Error(_0x7c83('0x9f'));}var _0x2712d4=_0x5a2e29[_0x7c83('0x34')][_0x7c83('0xa0')]?_0x5a2e29[_0x7c83('0x34')][_0x7c83('0xa0')]+':'+_0x5a2e29[_0x7c83('0x34')]['port']:_0x7c83('0xa1')+_0x5a2e29[_0x7c83('0x34')][_0x7c83('0x9e')];var _0x132181=_0x5a2e29[_0x7c83('0x34')][_0x7c83('0xa2')]?_0x5a2e29[_0x7c83('0x34')][_0x7c83('0xa2')]:!![];var _0xce7d4e=_0x5a2e29[_0x7c83('0x34')][_0x7c83('0xa3')]?_0x5a2e29[_0x7c83('0x34')][_0x7c83('0xa3')]:null;var _0x4ae8bd={'method':_0x5a2e29['method'],'uri':util['format'](_0x7c83('0xa4'),_0x2712d4,_0x5a2e29[_0x7c83('0x34')]['path']),'json':_0x132181,'resolveWithFullResponse':!![],'encoding':_0xce7d4e,'qs':_0x5a2e29[_0x7c83('0x34')]};if(_0x5a2e29['headers']){_0x4ae8bd['headers']=_0x5a2e29['headers'];if(_0x4ae8bd[_0x7c83('0xa5')][_0x7c83('0xa6')]){delete _0x4ae8bd[_0x7c83('0xa5')][_0x7c83('0xa6')];}}if(_0x4ae8bd[_0x7c83('0xa5')][_0x7c83('0xa7')]){delete _0x4ae8bd[_0x7c83('0xa5')][_0x7c83('0xa7')];}return rp(_0x4ae8bd);})[_0x7c83('0x2b')](function(_0x413d25){if(_0x413d25){_0x2b31c4['set'](_0x413d25[_0x7c83('0xa5')]);logger['info'](_0x413d25['body']);if(_[_0x7c83('0xa8')](_0x5a2e29[_0x7c83('0x34')][_0x7c83('0x7')],_0x7c83('0x49'))&&_0x413d25['statusCode']==0x1f4){return _0x2b31c4[_0x7c83('0x1a')](_0x413d25['statusCode']);}else{return _0x2b31c4[_0x7c83('0x1b')](_0x413d25[_0x7c83('0xa9')])[_0x7c83('0x97')](_0x413d25['body']);}}else{return _0x2b31c4[_0x7c83('0x1a')](0xc8);}})[_0x7c83('0x46')](handleError(_0x2b31c4,null));};exports['webhookPost']=function(_0x10caae,_0x1983ec,_0x3eef77){return BPromise[_0x7c83('0x9c')]()['then'](function(){if(!_0x10caae['query'][_0x7c83('0x7')]){throw new Error(_0x7c83('0x9d'));}if(!_0x10caae[_0x7c83('0x34')][_0x7c83('0x9e')]){throw new Error(_0x7c83('0x9f'));}var _0x217797=_0x10caae[_0x7c83('0x34')][_0x7c83('0xa0')]?_0x10caae[_0x7c83('0x34')][_0x7c83('0xa0')]+':'+_0x10caae[_0x7c83('0x34')]['port']:'http://localhost:'+_0x10caae[_0x7c83('0x34')]['port'];var _0x49a2cb=_0x10caae[_0x7c83('0x34')][_0x7c83('0xa2')]?_0x10caae[_0x7c83('0x34')][_0x7c83('0xa2')]:!![];var _0x36e26f=_0x10caae[_0x7c83('0x34')][_0x7c83('0xa3')]?_0x10caae[_0x7c83('0x34')][_0x7c83('0xa3')]:null;var _0x276230={'method':_0x10caae['method'],'uri':util['format'](_0x7c83('0xa4'),_0x217797,_0x10caae[_0x7c83('0x34')][_0x7c83('0x7')]),'json':_0x49a2cb,'resolveWithFullResponse':!![],'encoding':_0x36e26f,'body':_0x10caae[_0x7c83('0x90')]};if(_0x10caae['headers']){_0x276230[_0x7c83('0xa5')]=_0x10caae[_0x7c83('0xa5')];if(_0x276230['headers'][_0x7c83('0xa6')]){delete _0x276230[_0x7c83('0xa5')][_0x7c83('0xa6')];}}if(_0x276230[_0x7c83('0xa5')][_0x7c83('0xa7')]){delete _0x276230[_0x7c83('0xa5')]['content-type'];}return rp(_0x276230);})[_0x7c83('0x2b')](function(_0xb3e45a){if(_0xb3e45a){_0x1983ec[_0x7c83('0x21')](_0xb3e45a['headers']);logger['info'](_0xb3e45a[_0x7c83('0x90')]);return _0x1983ec[_0x7c83('0x1b')](_0xb3e45a[_0x7c83('0xa9')])[_0x7c83('0x97')](_0xb3e45a['body']);}else{return _0x1983ec[_0x7c83('0x1a')](0xc8);}})[_0x7c83('0x46')](handleError(_0x1983ec,null));}; \ No newline at end of file +var _0xf29c=['hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','model','length','find','download','params','join','root','format','basename','zip','warning','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','**/*','dirname','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','filename','extname','file','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','parameters','agent','script','scriptName','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','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','headers','content-length','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','method','%s%s','content-type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','Plugins','UserProfileResource','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields'];(function(_0x1f200c,_0x3c7a30){var _0x56547d=function(_0xebc8a9){while(--_0xebc8a9){_0x1f200c['push'](_0x1f200c['shift']());}};_0x56547d(++_0x3c7a30);}(_0xf29c,0x114));var _0xcf29=function(_0x5d67f2,_0x27c35a){_0x5d67f2=_0x5d67f2-0x0;var _0x5a5c8e=_0xf29c[_0x5d67f2];return _0x5a5c8e;};'use strict';var emlformat=require(_0xcf29('0x0'));var rimraf=require(_0xcf29('0x1'));var zipdir=require(_0xcf29('0x2'));var jsonpatch=require(_0xcf29('0x3'));var rp=require(_0xcf29('0x4'));var moment=require('moment');var BPromise=require(_0xcf29('0x5'));var Mustache=require(_0xcf29('0x6'));var util=require(_0xcf29('0x7'));var path=require(_0xcf29('0x8'));var sox=require(_0xcf29('0x9'));var csv=require(_0xcf29('0xa'));var ejs=require(_0xcf29('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf29('0xc'));var squel=require('squel');var crypto=require(_0xcf29('0xd'));var jsforce=require(_0xcf29('0xe'));var deskjs=require(_0xcf29('0xf'));var toCsv=require(_0xcf29('0xa'));var querystring=require(_0xcf29('0x10'));var Papa=require(_0xcf29('0x11'));var extract=require(_0xcf29('0x12'));var rimraf=require(_0xcf29('0x1'));var archiver=require(_0xcf29('0x13'));var Redis=require(_0xcf29('0x14'));var authService=require(_0xcf29('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xcf29('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcf29('0x17'));var utils=require(_0xcf29('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xcf29('0x19'));var db=require(_0xcf29('0x1a'))['db'];config[_0xcf29('0x1b')]=_['defaults'](config[_0xcf29('0x1b')],{'host':_0xcf29('0x1c'),'port':0x18eb});var socket=require(_0xcf29('0x1d'))(new Redis(config[_0xcf29('0x1b')]));require('./plugin.socket')[_0xcf29('0x1e')](socket);function respondWithStatusCode(_0x4cc102,_0x52f801){_0x52f801=_0x52f801||0xcc;return function(_0x3d27ad){if(_0x3d27ad){return _0x4cc102[_0xcf29('0x1f')](_0x52f801);}return _0x4cc102[_0xcf29('0x20')](_0x52f801)[_0xcf29('0x21')]();};}function respondWithResult(_0x426f59,_0x10b148){_0x10b148=_0x10b148||0xc8;return function(_0x332f3e){if(_0x332f3e){return _0x426f59[_0xcf29('0x20')](_0x10b148)[_0xcf29('0x22')](_0x332f3e);}};}function respondWithFilteredResult(_0x38ff11,_0x271997){return function(_0x500cbc){if(_0x500cbc){var _0x59a734=typeof _0x271997[_0xcf29('0x23')]==='undefined'&&typeof _0x271997[_0xcf29('0x24')]===_0xcf29('0x25');var _0x2db7ca=_0x500cbc['count'];var _0x382049=_0x59a734?0x0:_0x271997[_0xcf29('0x23')];var _0x5f3bf5=_0x59a734?_0x500cbc[_0xcf29('0x26')]:_0x271997['offset']+_0x271997[_0xcf29('0x24')];var _0xf3fa48;if(_0x5f3bf5>=_0x2db7ca){_0x5f3bf5=_0x2db7ca;_0xf3fa48=0xc8;}else{_0xf3fa48=0xce;}_0x38ff11[_0xcf29('0x20')](_0xf3fa48);return _0x38ff11[_0xcf29('0x27')](_0xcf29('0x28'),_0x382049+'-'+_0x5f3bf5+'/'+_0x2db7ca)[_0xcf29('0x22')](_0x500cbc);}return null;};}function patchUpdates(_0xdc6b87){return function(_0x2767e1){try{jsonpatch[_0xcf29('0x29')](_0x2767e1,_0xdc6b87,!![]);}catch(_0x5795ca){return BPromise[_0xcf29('0x2a')](_0x5795ca);}return _0x2767e1[_0xcf29('0x2b')]();};}function saveUpdates(_0x39e228,_0x1d5b57){return function(_0x3a262b){if(_0x3a262b){return _0x3a262b['update'](_0x39e228)[_0xcf29('0x2c')](function(_0x45bbe9){return _0x45bbe9;});}return null;};}function removeEntity(_0x2e8be5,_0x403360){return function(_0x26a8eb){if(_0x26a8eb){return _0x26a8eb[_0xcf29('0x2d')]()['then'](function(){var _0x3223c7=_0x26a8eb[_0xcf29('0x2e')]({'plain':!![]});var _0x4226e5=_0xcf29('0x2f');return db[_0xcf29('0x30')]['destroy']({'where':{'type':_0x4226e5,'resourceId':_0x3223c7['id']}})['then'](function(){return _0x26a8eb;});})[_0xcf29('0x2c')](function(){_0x2e8be5[_0xcf29('0x20')](0xcc)[_0xcf29('0x21')]();});}};}function handleEntityNotFound(_0x3588ed,_0x568d20){return function(_0x5df04b){if(!_0x5df04b){_0x3588ed[_0xcf29('0x1f')](0x194);}return _0x5df04b;};}function handleError(_0x5a8e60,_0x1bfce5){_0x1bfce5=_0x1bfce5||0x1f4;return function(_0x3ea733){logger[_0xcf29('0x31')](_0x3ea733[_0xcf29('0x32')]);if(_0x3ea733[_0xcf29('0x33')]){delete _0x3ea733['name'];}_0x5a8e60['status'](_0x1bfce5)['send'](_0x3ea733);};}exports[_0xcf29('0x34')]=function(_0x2068ec,_0x71516f){var _0x21e44f={},_0x201895={},_0x57fe99={'count':0x0,'rows':[]};var _0x445074=_[_0xcf29('0x35')](db[_0xcf29('0x36')][_0xcf29('0x37')],function(_0x449f7e){return{'name':_0x449f7e[_0xcf29('0x38')],'type':_0x449f7e[_0xcf29('0x39')]['key']};});_0x201895['model']=_[_0xcf29('0x35')](_0x445074,_0xcf29('0x33'));_0x201895[_0xcf29('0x3a')]=_[_0xcf29('0x3b')](_0x2068ec[_0xcf29('0x3a')]);_0x201895[_0xcf29('0x3c')]=_[_0xcf29('0x3d')](_0x201895['model'],_0x201895['query']);_0x21e44f[_0xcf29('0x3e')]=_[_0xcf29('0x3d')](_0x201895['model'],qs[_0xcf29('0x3f')](_0x2068ec[_0xcf29('0x3a')][_0xcf29('0x3f')]));_0x21e44f[_0xcf29('0x3e')]=_0x21e44f['attributes']['length']?_0x21e44f['attributes']:_0x201895['model'];if(!_0x2068ec['query'][_0xcf29('0x40')](_0xcf29('0x41'))){_0x21e44f[_0xcf29('0x24')]=qs[_0xcf29('0x24')](_0x2068ec['query']['limit']);_0x21e44f[_0xcf29('0x23')]=qs['offset'](_0x2068ec[_0xcf29('0x3a')][_0xcf29('0x23')]);}_0x21e44f[_0xcf29('0x42')]=qs[_0xcf29('0x43')](_0x2068ec[_0xcf29('0x3a')][_0xcf29('0x43')]);_0x21e44f[_0xcf29('0x44')]=qs[_0xcf29('0x3c')](_[_0xcf29('0x45')](_0x2068ec['query'],_0x201895['filters']),_0x445074);if(_0x2068ec['query']['filter']){_0x21e44f[_0xcf29('0x44')]=_['merge'](_0x21e44f['where'],{'$or':_[_0xcf29('0x35')](_0x445074,function(_0x454570){if(_0x454570[_0xcf29('0x39')]!==_0xcf29('0x46')){var _0x401fbd={};_0x401fbd[_0x454570[_0xcf29('0x33')]]={'$like':'%'+_0x2068ec['query']['filter']+'%'};return _0x401fbd;}})});}_0x21e44f=_[_0xcf29('0x47')]({},_0x21e44f,_0x2068ec[_0xcf29('0x48')]);var _0x3c7c80={'where':_0x21e44f[_0xcf29('0x44')]};return db[_0xcf29('0x36')][_0xcf29('0x26')](_0x3c7c80)[_0xcf29('0x2c')](function(_0x13ba15){_0x57fe99[_0xcf29('0x26')]=_0x13ba15;if(_0x2068ec['query'][_0xcf29('0x49')]){_0x21e44f[_0xcf29('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0xcf29('0x4b')](_0x21e44f);})[_0xcf29('0x2c')](function(_0x329687){_0x57fe99[_0xcf29('0x4c')]=_0x329687;return _0x57fe99;})['then'](respondWithFilteredResult(_0x71516f,_0x21e44f))[_0xcf29('0x4d')](handleError(_0x71516f,null));};exports[_0xcf29('0x4e')]=function(_0x47862f,_0xcf40dc){var _0x390899={'raw':!![],'where':{'id':_0x47862f['params']['id']}},_0x283c0b={};_0x283c0b[_0xcf29('0x4f')]=_['keys'](db[_0xcf29('0x36')]['rawAttributes']);_0x283c0b[_0xcf29('0x3a')]=_[_0xcf29('0x3b')](_0x47862f[_0xcf29('0x3a')]);_0x283c0b[_0xcf29('0x3c')]=_[_0xcf29('0x3d')](_0x283c0b[_0xcf29('0x4f')],_0x283c0b[_0xcf29('0x3a')]);_0x390899[_0xcf29('0x3e')]=_[_0xcf29('0x3d')](_0x283c0b[_0xcf29('0x4f')],qs[_0xcf29('0x3f')](_0x47862f[_0xcf29('0x3a')]['fields']));_0x390899[_0xcf29('0x3e')]=_0x390899['attributes'][_0xcf29('0x50')]?_0x390899[_0xcf29('0x3e')]:_0x283c0b[_0xcf29('0x4f')];if(_0x47862f['query']['includeAll']){_0x390899[_0xcf29('0x4a')]=[{'all':!![]}];}_0x390899=_[_0xcf29('0x47')]({},_0x390899,_0x47862f['options']);return db[_0xcf29('0x36')][_0xcf29('0x51')](_0x390899)[_0xcf29('0x2c')](handleEntityNotFound(_0xcf40dc,null))[_0xcf29('0x2c')](respondWithResult(_0xcf40dc,null))[_0xcf29('0x4d')](handleError(_0xcf40dc,null));};exports[_0xcf29('0x52')]=function(_0x474527,_0x43ad6a,_0x5448ba){return db[_0xcf29('0x36')]['find']({'where':{'id':_0x474527[_0xcf29('0x53')]['id']},'attributes':[_0xcf29('0x33'),_0xcf29('0x8')],'raw':!![]})[_0xcf29('0x2c')](handleEntityNotFound(_0x43ad6a,null))[_0xcf29('0x2c')](function(_0x1d582f){if(_0x1d582f){var _0x568493=path[_0xcf29('0x54')](config[_0xcf29('0x55')],'server/files/plugins',util[_0xcf29('0x56')]('%s.zip',path[_0xcf29('0x57')](_0x1d582f[_0xcf29('0x8')])));var _0x5c7e2b=fs['createWriteStream'](_0x568493);var _0x58caa7=archiver(_0xcf29('0x58'),{'zlib':{'level':0x9}});_0x58caa7['on'](_0xcf29('0x59'),function(_0x44d5c6){if(_0x44d5c6['code']==='ENOENT'){logger['error'](_0x44d5c6);}else{throw new db[(_0xcf29('0x5a'))]['Error'](_0xcf29('0x5b'));}});_0x58caa7['on'](_0xcf29('0x31'),function(_0x3acaea){throw new db[(_0xcf29('0x5a'))][(_0xcf29('0x5c'))](_0xcf29('0x5b'));});_0x58caa7[_0xcf29('0x5d')](_0x5c7e2b);_0x58caa7['glob'](_0xcf29('0x5e'),{'cwd':path[_0xcf29('0x54')](config[_0xcf29('0x55')],'server/files/plugins',path[_0xcf29('0x5f')](_0x1d582f[_0xcf29('0x8')])),'ignore':[path[_0xcf29('0x54')](path[_0xcf29('0x57')](_0x1d582f[_0xcf29('0x8')]),'node_modules/**/*'),path[_0xcf29('0x54')](path[_0xcf29('0x57')](_0x1d582f[_0xcf29('0x8')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x5c7e2b['on']('close',function(){if(!fs[_0xcf29('0x60')](_0x568493)){throw new db['Sequelize']['Error'](_0xcf29('0x61'));}return _0x43ad6a['download'](_0x568493,util[_0xcf29('0x56')]('%s.zip',path[_0xcf29('0x57')](_0x1d582f[_0xcf29('0x8')])),function(_0x3f035a){if(_0x3f035a){throw new db[(_0xcf29('0x5a'))]['Error'](_0xcf29('0x62'));}fs[_0xcf29('0x63')](_0x568493);logger['info'](_0xcf29('0x64'));logger[_0xcf29('0x65')](_0xcf29('0x66'));});});}return null;})[_0xcf29('0x4d')](handleError(_0x43ad6a,null));};exports['upload']=function(_0x3f9fcc,_0x50d3ed,_0x58edbe){var _0x598ccb=path[_0xcf29('0x57')](_0x3f9fcc['file'][_0xcf29('0x67')],path[_0xcf29('0x68')](_0x3f9fcc[_0xcf29('0x69')]['filename']));var _0xbbf17a=path[_0xcf29('0x54')](config[_0xcf29('0x55')],_0xcf29('0x6a'),_0x3f9fcc[_0xcf29('0x69')][_0xcf29('0x67')]);var _0x4d27b9=path[_0xcf29('0x54')](config[_0xcf29('0x55')],_0xcf29('0x6a'),_0x598ccb);logger['info'](_0xcf29('0x6b'),_0xbbf17a);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x4d27b9);try{fs[_0xcf29('0x6c')](_0xbbf17a,parseInt(_0xcf29('0x6d'),0x8));extract(_0xbbf17a,{'dir':_0x4d27b9},function(_0x50cb32){if(_0x50cb32){logger[_0xcf29('0x31')](_0x50cb32);handleError(_0x50cb32,!![]);};var _0x121884=fs[_0xcf29('0x6e')](_0x4d27b9);if(_0x121884[_0xcf29('0x50')]>0x1){removeReferences(_0xbbf17a,_0x4d27b9);logger[_0xcf29('0x31')](_0xcf29('0x6f'));return _0x58edbe(new Error(_0xcf29('0x6f')));}var _0x38fad5=fs[_0xcf29('0x70')](path[_0xcf29('0x54')](_0x4d27b9,_0x121884[0x0]));if(_0x38fad5['isFile']()){removeReferences(_0xbbf17a,_0x4d27b9);logger[_0xcf29('0x31')](_0xcf29('0x6f'));return _0x58edbe(new Error('Invalid\x20plugin\x20structure'));}if(_0x38fad5['isDirectory']()){var _0xaf9e63=fs['readdirSync'](path[_0xcf29('0x54')](_0x4d27b9,_0x121884[0x0]));if(_0xaf9e63[_0xcf29('0x50')]===0x0){removeReferences(_0xbbf17a,_0x4d27b9);logger[_0xcf29('0x31')](_0xcf29('0x6f'));return _0x58edbe(new Error(_0xcf29('0x6f')));}var _0xe16d2f=_0xaf9e63[_0xcf29('0x71')](function(_0x287830){return _0x287830===_0xcf29('0x72');});if(!_0xe16d2f){return _0x58edbe(new Error(_0xcf29('0x73')));}var _0x1df8f6=fs[_0xcf29('0x74')](path[_0xcf29('0x54')](_0x4d27b9,_0x121884[0x0],_0xcf29('0x72')));var _0x2c6e37=JSON[_0xcf29('0x75')](_0x1df8f6);if(_0xcf29('0x25')==typeof _0x2c6e37[_0xcf29('0x33')]){return _0x58edbe(new Error(_0xcf29('0x76')));}if('undefined'==typeof _0x2c6e37['type']){return _0x58edbe(new Error(_0xcf29('0x77')));}if('undefined'==typeof _0x2c6e37[_0xcf29('0x78')]){return _0x58edbe(new Error(_0xcf29('0x79')));}if(_0xcf29('0x25')==typeof _0x2c6e37['parameters']){return _0x58edbe(new Error(_0xcf29('0x7a')));}if(_0x2c6e37['type']===_0xcf29('0x7b')){if(_0xcf29('0x25')==typeof _0x2c6e37['parameters'][_0xcf29('0x7c')]){return _0x58edbe(new Error(_0xcf29('0x7d')));}if(_0xcf29('0x25')==typeof _0x2c6e37['parameters'][_0xcf29('0x7c')][_0xcf29('0x7e')]&&'undefined'==typeof _0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x80')]){return _0x58edbe(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x2c6e37[_0xcf29('0x39')]===_0xcf29('0x81')){if('undefined'==typeof _0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x82')]){return _0x58edbe(new Error(_0xcf29('0x83')));}if(_0xcf29('0x25')==typeof _0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x84')]){return _0x58edbe(new Error(_0xcf29('0x85')));}}else{return _0x58edbe(new Error(_0xcf29('0x86')));}var _0x28184b=_0x2c6e37[_0xcf29('0x33')];var _0x37b24a=_0x2c6e37[_0xcf29('0x87')];var _0x49b353=_0x2c6e37[_0xcf29('0x39')];var _0x2b2929=_0x2c6e37[_0xcf29('0x88')]?_0x2c6e37['sidebar']:_0xcf29('0x89');var _0x4623af=_0x2c6e37[_0xcf29('0x8a')]?_0x2c6e37['icon']:'icon-apps';var _0x3ff8d5='';var _0x224354='';var _0xd48001='';var _0x2acee7='';var _0x3df93a=_0x2c6e37[_0xcf29('0x78')];if(_0x49b353==='html'){if('undefined'!=typeof _0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x7e')]){var _0x2fb9ad=_0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xcf29('0x8b')](_0x2fb9ad)){_0x3ff8d5=path[_0xcf29('0x54')](_0xcf29('0x8c'),_0x598ccb,_0x121884[0x0],_0x2fb9ad);}else{_0x3ff8d5=_0x2fb9ad;}}else{logger['info'](_0xcf29('0x8d'));}if(_0xcf29('0x25')!=typeof _0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x80')]){var _0x3b63e1=_0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x80')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3b63e1)){_0x224354=path[_0xcf29('0x54')](_0xcf29('0x8c'),_0x598ccb,_0x121884[0x0],_0x3b63e1);}else{_0x224354=_0x3b63e1;}}else{logger['info'](_0xcf29('0x8e'));}}else if(_0x49b353===_0xcf29('0x81')){_0xd48001=_0x2c6e37[_0xcf29('0x7f')]['scriptName'];_0x2acee7=_0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x84')];if(_0xcf29('0x25')!=typeof _0x2c6e37['parameters']['views']){if(_0xcf29('0x25')!=typeof _0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x7e')]){var _0x2fb9ad=_0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xcf29('0x8b')](_0x2fb9ad)){_0x3ff8d5=path[_0xcf29('0x54')](_0xcf29('0x8c'),_0x598ccb,_0x121884[0x0],_0x2fb9ad);}else{_0x3ff8d5=_0x2fb9ad;}}if(_0xcf29('0x25')!=typeof _0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x80')]){var _0x3b63e1=_0x2c6e37[_0xcf29('0x7f')][_0xcf29('0x7c')][_0xcf29('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xcf29('0x8b')](_0x3b63e1)){_0x224354=path[_0xcf29('0x54')](_0xcf29('0x8c'),_0x598ccb,_0x121884[0x0],_0x3b63e1);}else{_0x224354=_0x3b63e1;}}}}var _0x403cc7={'name':_0x28184b,'description':_0x37b24a,'path':path[_0xcf29('0x54')](_0x598ccb,_0x121884[0x0]),'type':_0x49b353,'sidebar':_0x2b2929,'icon':_0x4623af,'adminUrl':_0x3ff8d5,'agentUrl':_0x224354,'scriptName':_0xd48001,'scriptPath':_0x2acee7,'version':_0x3df93a};removeReferences(_0xbbf17a,null);return db['Plugin'][_0xcf29('0x8f')](_0x403cc7)[_0xcf29('0x2c')](function(_0x54f8cd){var _0x5715e5={'role':_0x3f9fcc[_0xcf29('0x90')][_0xcf29('0x91')],'userProfileId':_0x3f9fcc[_0xcf29('0x90')]['userProfileId']};if(!_0x5715e5)throw new Error(_0xcf29('0x92'));if(_0x5715e5['role']==='user'){var _0x4cf2fc=_0x54f8cd[_0xcf29('0x2e')]({'plain':!![]});return db[_0xcf29('0x93')][_0xcf29('0x51')]({'where':{'name':_0xcf29('0x2f'),'userProfileId':_0x5715e5['userProfileId']},'raw':!![]})[_0xcf29('0x2c')](function(_0x3f9f2d){if(_0x3f9f2d&&_0x3f9f2d[_0xcf29('0x94')]===0x0){return db[_0xcf29('0x30')][_0xcf29('0x8f')]({'name':_0x4cf2fc[_0xcf29('0x33')],'resourceId':_0x4cf2fc['id'],'type':_0x3f9f2d[_0xcf29('0x33')],'sectionId':_0x3f9f2d['id']},{})[_0xcf29('0x2c')](function(){return _0x54f8cd;});}else{return _0x54f8cd;}})[_0xcf29('0x4d')](function(_0x424cce){logger[_0xcf29('0x31')](_0xcf29('0x95'),_0x424cce);throw _0x424cce;});}return _0x54f8cd;})[_0xcf29('0x2c')](respondWithResult(_0x50d3ed,null))[_0xcf29('0x4d')](handleError(_0x50d3ed,null));}});}catch(_0x420fd5){_0x50d3ed[_0xcf29('0x20')](0x1f4)[_0xcf29('0x96')](_0x420fd5);}};function removeReferences(_0x4db5d4,_0x24c7c3){try{if(_0x4db5d4){fs[_0xcf29('0x63')](_0x4db5d4);logger[_0xcf29('0x65')](_0xcf29('0x97'));}if(_0x24c7c3){rimraf(_0x24c7c3,function(){});logger[_0xcf29('0x65')](_0xcf29('0x98'));}}catch(_0x196128){logger[_0xcf29('0x31')](_0x196128);}}exports[_0xcf29('0x99')]=function(_0xfc88c0,_0x27649b,_0x26d6e1){return db[_0xcf29('0x36')][_0xcf29('0x51')]({'where':{'id':_0xfc88c0['params']['id']}})[_0xcf29('0x2c')](handleEntityNotFound(_0x27649b,null))[_0xcf29('0x2c')](saveUpdates(_0xfc88c0[_0xcf29('0x90')],null))[_0xcf29('0x2c')](respondWithResult(_0x27649b,null))[_0xcf29('0x4d')](handleError(_0x27649b,null));};exports[_0xcf29('0x9a')]=function(_0x132cc4,_0x3d62dd,_0x4f6767){return db[_0xcf29('0x36')]['find']({'where':{'id':_0x132cc4['params']['id']}})[_0xcf29('0x2c')](function(_0x35a351){if(_0x35a351){return _0x35a351[_0xcf29('0x2d')]();}})[_0xcf29('0x2c')](function(_0x23016e){rimraf(path[_0xcf29('0x54')](config[_0xcf29('0x55')],_0xcf29('0x6a'),path[_0xcf29('0x5f')](_0x23016e[_0xcf29('0x8')])),function(){});return _0x23016e;})[_0xcf29('0x2c')](handleEntityNotFound(_0x3d62dd,null))[_0xcf29('0x2c')](respondWithStatusCode(_0x3d62dd,null))['catch'](handleError(_0x3d62dd,null));};exports[_0xcf29('0x9b')]=function(_0x45e8e8,_0x39ed42,_0x1410d4){return BPromise['resolve']()['then'](function(){if(!_0x45e8e8[_0xcf29('0x3a')][_0xcf29('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x45e8e8['query'][_0xcf29('0x9c')]){throw new Error(_0xcf29('0x9d'));}var _0x1d87e5=_0x45e8e8['query'][_0xcf29('0x9e')]?_0x45e8e8[_0xcf29('0x3a')]['hostname']+':'+_0x45e8e8[_0xcf29('0x3a')][_0xcf29('0x9c')]:'http://localhost:'+_0x45e8e8['query']['port'];var _0x41f315=_0x45e8e8[_0xcf29('0x3a')][_0xcf29('0x22')]?_0x45e8e8[_0xcf29('0x3a')]['json']:!![];var _0x3578e4=_0x45e8e8[_0xcf29('0x3a')][_0xcf29('0x9f')]?_0x45e8e8[_0xcf29('0x3a')][_0xcf29('0x9f')]:null;var _0x18f95c={'method':_0x45e8e8['method'],'uri':util[_0xcf29('0x56')]('%s%s',_0x1d87e5,_0x45e8e8['query'][_0xcf29('0x8')]),'json':_0x41f315,'resolveWithFullResponse':!![],'encoding':_0x3578e4,'qs':_0x45e8e8[_0xcf29('0x3a')]};if(_0x45e8e8[_0xcf29('0xa0')]){_0x18f95c[_0xcf29('0xa0')]=_0x45e8e8[_0xcf29('0xa0')];if(_0x18f95c[_0xcf29('0xa0')][_0xcf29('0xa1')]){delete _0x18f95c[_0xcf29('0xa0')][_0xcf29('0xa1')];}}if(_0x18f95c[_0xcf29('0xa0')]['content-type']){delete _0x18f95c['headers']['content-type'];}return rp(_0x18f95c);})[_0xcf29('0x2c')](function(_0x5ab0ae){if(_0x5ab0ae){_0x39ed42[_0xcf29('0x27')](_0x5ab0ae[_0xcf29('0xa0')]);logger[_0xcf29('0x65')](_0x5ab0ae[_0xcf29('0x90')]);if(_[_0xcf29('0xa2')](_0x45e8e8[_0xcf29('0x3a')][_0xcf29('0x8')],'download')&&_0x5ab0ae[_0xcf29('0xa3')]==0x1f4){return _0x39ed42[_0xcf29('0x1f')](_0x5ab0ae[_0xcf29('0xa3')]);}else{return _0x39ed42[_0xcf29('0x20')](_0x5ab0ae['statusCode'])['send'](_0x5ab0ae[_0xcf29('0x90')]);}}else{return _0x39ed42[_0xcf29('0x1f')](0xc8);}})[_0xcf29('0x4d')](handleError(_0x39ed42,null));};exports[_0xcf29('0xa4')]=function(_0x288b19,_0x53a466,_0x44d1bf){return BPromise['resolve']()[_0xcf29('0x2c')](function(){if(!_0x288b19[_0xcf29('0x3a')][_0xcf29('0x8')]){throw new Error(_0xcf29('0xa5'));}if(!_0x288b19[_0xcf29('0x3a')][_0xcf29('0x9c')]){throw new Error(_0xcf29('0x9d'));}var _0x40afbc=_0x288b19[_0xcf29('0x3a')][_0xcf29('0x9e')]?_0x288b19[_0xcf29('0x3a')]['hostname']+':'+_0x288b19['query'][_0xcf29('0x9c')]:_0xcf29('0xa6')+_0x288b19[_0xcf29('0x3a')][_0xcf29('0x9c')];var _0x55f9a3=_0x288b19[_0xcf29('0x3a')]['json']?_0x288b19[_0xcf29('0x3a')]['json']:!![];var _0x1504a0=_0x288b19['query'][_0xcf29('0x9f')]?_0x288b19[_0xcf29('0x3a')]['encoding']:null;var _0x1f50bf={'method':_0x288b19[_0xcf29('0xa7')],'uri':util[_0xcf29('0x56')](_0xcf29('0xa8'),_0x40afbc,_0x288b19['query'][_0xcf29('0x8')]),'json':_0x55f9a3,'resolveWithFullResponse':!![],'encoding':_0x1504a0,'body':_0x288b19[_0xcf29('0x90')]};if(_0x288b19['headers']){_0x1f50bf[_0xcf29('0xa0')]=_0x288b19[_0xcf29('0xa0')];if(_0x1f50bf[_0xcf29('0xa0')][_0xcf29('0xa1')]){delete _0x1f50bf[_0xcf29('0xa0')][_0xcf29('0xa1')];}}if(_0x1f50bf[_0xcf29('0xa0')][_0xcf29('0xa9')]){delete _0x1f50bf[_0xcf29('0xa0')][_0xcf29('0xa9')];}return rp(_0x1f50bf);})[_0xcf29('0x2c')](function(_0x4e3347){if(_0x4e3347){_0x53a466[_0xcf29('0x27')](_0x4e3347[_0xcf29('0xa0')]);logger[_0xcf29('0x65')](_0x4e3347['body']);return _0x53a466['status'](_0x4e3347[_0xcf29('0xa3')])[_0xcf29('0x96')](_0x4e3347['body']);}else{return _0x53a466[_0xcf29('0x1f')](0xc8);}})['catch'](handleError(_0x53a466,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 8039274..8d65138 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 _0x195f=['emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove'];(function(_0x3f84f5,_0xd0c488){var _0x5d8a33=function(_0x3faf73){while(--_0x3faf73){_0x3f84f5['push'](_0x3f84f5['shift']());}};_0x5d8a33(++_0xd0c488);}(_0x195f,0x113));var _0xf195=function(_0xc69530,_0x57c174){_0xc69530=_0xc69530-0x0;var _0x148a92=_0x195f[_0xc69530];return _0x148a92;};'use strict';var EventEmitter=require(_0xf195('0x0'));var Plugin=require(_0xf195('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xf195('0x2')](0x0);var events={'afterCreate':_0xf195('0x3'),'afterUpdate':'update','afterDestroy':_0xf195('0x4')};function emitEvent(_0x52cf31){return function(_0x127a41,_0x349605,_0x189127){PluginEvents[_0xf195('0x5')](_0x52cf31+':'+_0x127a41['id'],_0x127a41);PluginEvents[_0xf195('0x5')](_0x52cf31,_0x127a41);_0x189127(null);};}for(var e in events){if(events[_0xf195('0x6')](e)){var event=events[e];Plugin[_0xf195('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xba0d=['setMaxListeners','save','remove','emit','hook','exports','events','Plugin'];(function(_0x2455bc,_0x54fd9e){var _0x3ded8b=function(_0x57ad36){while(--_0x57ad36){_0x2455bc['push'](_0x2455bc['shift']());}};_0x3ded8b(++_0x54fd9e);}(_0xba0d,0x8e));var _0xdba0=function(_0x547fd3,_0x427556){_0x547fd3=_0x547fd3-0x0;var _0x3ebe23=_0xba0d[_0x547fd3];return _0x3ebe23;};'use strict';var EventEmitter=require(_0xdba0('0x0'));var Plugin=require('../../mysqldb')['db'][_0xdba0('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xdba0('0x2')](0x0);var events={'afterCreate':_0xdba0('0x3'),'afterUpdate':'update','afterDestroy':_0xdba0('0x4')};function emitEvent(_0x50eadf){return function(_0xebb600,_0x426cac,_0x6a96ad){PluginEvents[_0xdba0('0x5')](_0x50eadf+':'+_0xebb600['id'],_0xebb600);PluginEvents['emit'](_0x50eadf,_0xebb600);_0x6a96ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xdba0('0x6')](e,emitEvent(event));}}module[_0xdba0('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 580542e..6e70f17 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 _0xb5e9=['rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2d48a2,_0x34ffa6){var _0x2ba1cb=function(_0x35ab7f){while(--_0x35ab7f){_0x2d48a2['push'](_0x2d48a2['shift']());}};_0x2ba1cb(++_0x34ffa6);}(_0xb5e9,0x1c7));var _0x9b5e=function(_0x37a902,_0x50579a){_0x37a902=_0x37a902-0x0;var _0x566d4f=_0xb5e9[_0x37a902];return _0x566d4f;};'use strict';var _=require(_0x9b5e('0x0'));var util=require(_0x9b5e('0x1'));var logger=require('../../config/logger')(_0x9b5e('0x2'));var moment=require(_0x9b5e('0x3'));var BPromise=require(_0x9b5e('0x4'));var rp=require(_0x9b5e('0x5'));var fs=require('fs');var path=require(_0x9b5e('0x6'));var rimraf=require(_0x9b5e('0x7'));var config=require(_0x9b5e('0x8'));var attributes=require(_0x9b5e('0x9'));module[_0x9b5e('0xa')]=function(_0x157058,_0x483bcf){return _0x157058[_0x9b5e('0xb')](_0x9b5e('0xc'),attributes,{'tableName':_0x9b5e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x973b=['./plugin.attributes','Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x405f1a,_0x47d14d){var _0x501ae7=function(_0xffbcce){while(--_0xffbcce){_0x405f1a['push'](_0x405f1a['shift']());}};_0x501ae7(++_0x47d14d);}(_0x973b,0x6e));var _0xb973=function(_0x2b4b7,_0x49cadc){_0x2b4b7=_0x2b4b7-0x0;var _0x1fa523=_0x973b[_0x2b4b7];return _0x1fa523;};'use strict';var _=require(_0xb973('0x0'));var util=require(_0xb973('0x1'));var logger=require(_0xb973('0x2'))(_0xb973('0x3'));var moment=require(_0xb973('0x4'));var BPromise=require(_0xb973('0x5'));var rp=require(_0xb973('0x6'));var fs=require('fs');var path=require(_0xb973('0x7'));var rimraf=require(_0xb973('0x8'));var config=require(_0xb973('0x9'));var attributes=require(_0xb973('0xa'));module['exports']=function(_0xa48248,_0x1ccbdb){return _0xa48248['define'](_0xb973('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index de8d904..61b555a 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 _0xdc7e=['../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin','body','options','raw','then','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x8f5eaf,_0x39fdbf){var _0x15ab2b=function(_0x2b1c39){while(--_0x2b1c39){_0x8f5eaf['push'](_0x8f5eaf['shift']());}};_0x15ab2b(++_0x39fdbf);}(_0xdc7e,0x1e9));var _0xedc7=function(_0x31cff4,_0x1cb435){_0x31cff4=_0x31cff4-0x0;var _0x276684=_0xdc7e[_0x31cff4];return _0x276684;};'use strict';var _=require(_0xedc7('0x0'));var util=require(_0xedc7('0x1'));var moment=require('moment');var BPromise=require(_0xedc7('0x2'));var rs=require(_0xedc7('0x3'));var fs=require('fs');var Redis=require(_0xedc7('0x4'));var db=require(_0xedc7('0x5'))['db'];var utils=require(_0xedc7('0x6'));var logger=require('../../config/logger')(_0xedc7('0x7'));var config=require('../../config/environment');var jayson=require(_0xedc7('0x8'));var client=jayson['client'][_0xedc7('0x9')]({'port':0x232a});config[_0xedc7('0xa')]=_[_0xedc7('0xb')](config['redis'],{'host':_0xedc7('0xc'),'port':0x18eb});var socket=require(_0xedc7('0xd'))(new Redis(config[_0xedc7('0xa')]));require(_0xedc7('0xe'))[_0xedc7('0xf')](socket);function respondWithRpcPromise(_0x2f6f06,_0x12a705,_0x2b67e2){return new BPromise(function(_0xf8f244,_0x32aae0){return client[_0xedc7('0x10')](_0x2f6f06,_0x2b67e2)['then'](function(_0x2c91f3){logger['info'](_0xedc7('0x11'),_0x12a705,_0xedc7('0x12'));logger[_0xedc7('0x13')](_0xedc7('0x14'),_0x12a705,'request\x20sent',JSON['stringify'](_0x2c91f3));if(_0x2c91f3[_0xedc7('0x15')]){if(_0x2c91f3['error'][_0xedc7('0x16')]===0x1f4){logger[_0xedc7('0x15')](_0xedc7('0x11'),_0x12a705,_0x2c91f3[_0xedc7('0x15')][_0xedc7('0x17')]);return _0x32aae0(_0x2c91f3['error'][_0xedc7('0x17')]);}logger[_0xedc7('0x15')](_0xedc7('0x11'),_0x12a705,_0x2c91f3[_0xedc7('0x15')][_0xedc7('0x17')]);return _0xf8f244(_0x2c91f3[_0xedc7('0x15')][_0xedc7('0x17')]);}else{logger['info'](_0xedc7('0x11'),_0x12a705,_0xedc7('0x12'));_0xf8f244(_0x2c91f3[_0xedc7('0x18')]['message']);}})[_0xedc7('0x19')](function(_0x1d52d6){logger[_0xedc7('0x15')](_0xedc7('0x11'),_0x12a705,_0x1d52d6);_0x32aae0(_0x1d52d6);});});}exports[_0xedc7('0x1a')]=function(_0xc78561){var _0x296063=this;return new Promise(function(_0x2cbb99,_0x1d43dc){return db[_0xedc7('0x1b')]['create'](_0xc78561[_0xedc7('0x1c')],{'raw':_0xc78561['options']?_0xc78561[_0xedc7('0x1d')][_0xedc7('0x1e')]===undefined?!![]:![]:!![]})[_0xedc7('0x1f')](function(_0x493736){logger['info']('CreatePlugin',_0xc78561);logger[_0xedc7('0x13')](_0xedc7('0x1a'),_0xc78561,JSON[_0xedc7('0x20')](_0x493736));_0x2cbb99(_0x493736);})[_0xedc7('0x19')](function(_0x1efd9d){logger[_0xedc7('0x15')](_0xedc7('0x1a'),_0x1efd9d[_0xedc7('0x17')],_0xc78561);_0x1d43dc(_0x296063['error'](0x1f4,_0x1efd9d[_0xedc7('0x17')]));});});}; \ No newline at end of file +var _0x3c01=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','Plugin','create','body','options','raw','CreatePlugin','stringify','lodash','util','randomstring'];(function(_0x4edd60,_0x3911ad){var _0x163cfc=function(_0x3e4902){while(--_0x3e4902){_0x4edd60['push'](_0x4edd60['shift']());}};_0x163cfc(++_0x3911ad);}(_0x3c01,0x79));var _0x13c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3c01[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x13c0('0x0'));var util=require(_0x13c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x13c0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13c0('0x3'))['db'];var utils=require(_0x13c0('0x4'));var logger=require('../../config/logger')(_0x13c0('0x5'));var config=require(_0x13c0('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x13c0('0x7')]['http']({'port':0x232a});config[_0x13c0('0x8')]=_[_0x13c0('0x9')](config['redis'],{'host':_0x13c0('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x13c0('0x8')]));require(_0x13c0('0xb'))[_0x13c0('0xc')](socket);function respondWithRpcPromise(_0x3e077f,_0x113fa9,_0x15eaa4){return new BPromise(function(_0x46d586,_0x555bed){return client[_0x13c0('0xd')](_0x3e077f,_0x15eaa4)[_0x13c0('0xe')](function(_0x53506b){logger['info'](_0x13c0('0xf'),_0x113fa9,_0x13c0('0x10'));logger[_0x13c0('0x11')]('Plugin,\x20%s,\x20%s,\x20%s',_0x113fa9,_0x13c0('0x10'),JSON['stringify'](_0x53506b));if(_0x53506b[_0x13c0('0x12')]){if(_0x53506b['error'][_0x13c0('0x13')]===0x1f4){logger[_0x13c0('0x12')](_0x13c0('0xf'),_0x113fa9,_0x53506b[_0x13c0('0x12')][_0x13c0('0x14')]);return _0x555bed(_0x53506b[_0x13c0('0x12')]['message']);}logger[_0x13c0('0x12')](_0x13c0('0xf'),_0x113fa9,_0x53506b['error']['message']);return _0x46d586(_0x53506b[_0x13c0('0x12')][_0x13c0('0x14')]);}else{logger[_0x13c0('0x15')](_0x13c0('0xf'),_0x113fa9,_0x13c0('0x10'));_0x46d586(_0x53506b[_0x13c0('0x16')][_0x13c0('0x14')]);}})[_0x13c0('0x17')](function(_0x404c6e){logger[_0x13c0('0x12')]('Plugin,\x20%s,\x20%s',_0x113fa9,_0x404c6e);_0x555bed(_0x404c6e);});});}exports['CreatePlugin']=function(_0x24b86f){var _0x18aa18=this;return new Promise(function(_0x251a49,_0xcb5090){return db[_0x13c0('0x18')][_0x13c0('0x19')](_0x24b86f[_0x13c0('0x1a')],{'raw':_0x24b86f[_0x13c0('0x1b')]?_0x24b86f[_0x13c0('0x1b')][_0x13c0('0x1c')]===undefined?!![]:![]:!![]})[_0x13c0('0xe')](function(_0xaec239){logger[_0x13c0('0x15')]('CreatePlugin',_0x24b86f);logger[_0x13c0('0x11')](_0x13c0('0x1d'),_0x24b86f,JSON[_0x13c0('0x1e')](_0xaec239));_0x251a49(_0xaec239);})[_0x13c0('0x17')](function(_0x49fafc){logger['error'](_0x13c0('0x1d'),_0x49fafc[_0x13c0('0x14')],_0x24b86f);_0xcb5090(_0x18aa18[_0x13c0('0x12')](0x1f4,_0x49fafc[_0x13c0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 668cecc..cb3fc79 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 _0x9662=['plugin:','save','remove','update','emit','register','length'];(function(_0x25e95a,_0x2efe4a){var _0x2b35e8=function(_0x1cd36a){while(--_0x1cd36a){_0x25e95a['push'](_0x25e95a['shift']());}};_0x2b35e8(++_0x2efe4a);}(_0x9662,0x135));var _0x2966=function(_0x5f4178,_0x1f628a){_0x5f4178=_0x5f4178-0x0;var _0x5e18cb=_0x9662[_0x5f4178];return _0x5e18cb;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x2966('0x0'),_0x2966('0x1'),_0x2966('0x2')];function createListener(_0x23d9b8,_0x328799){return function(_0x18b5e3){_0x328799[_0x2966('0x3')](_0x23d9b8,_0x18b5e3);};}function removeListener(_0x14992e,_0x37d0f5){return function(){PluginEvents['removeListener'](_0x14992e,_0x37d0f5);};}exports[_0x2966('0x4')]=function(_0x4126ff){for(var _0x5f30f2=0x0,_0x46f682=events[_0x2966('0x5')];_0x5f30f2<_0x46f682;_0x5f30f2++){var _0x5e5b16=events[_0x5f30f2];var _0x4ad91a=createListener(_0x2966('0x6')+_0x5e5b16,_0x4126ff);PluginEvents['on'](_0x5e5b16,_0x4ad91a);}}; \ No newline at end of file +var _0x8e3c=['remove','update','emit','removeListener','register','length','./plugin.events','save'];(function(_0x1d7c86,_0x501690){var _0x280bfd=function(_0x1825a7){while(--_0x1825a7){_0x1d7c86['push'](_0x1d7c86['shift']());}};_0x280bfd(++_0x501690);}(_0x8e3c,0x14e));var _0xc8e3=function(_0x474594,_0xc9f989){_0x474594=_0x474594-0x0;var _0x19564c=_0x8e3c[_0x474594];return _0x19564c;};'use strict';var PluginEvents=require(_0xc8e3('0x0'));var events=[_0xc8e3('0x1'),_0xc8e3('0x2'),_0xc8e3('0x3')];function createListener(_0x5a3378,_0x3c0c98){return function(_0x2575ca){_0x3c0c98[_0xc8e3('0x4')](_0x5a3378,_0x2575ca);};}function removeListener(_0x309bf0,_0x3184c4){return function(){PluginEvents[_0xc8e3('0x5')](_0x309bf0,_0x3184c4);};}exports[_0xc8e3('0x6')]=function(_0x3ded1f){for(var _0x28fcf6=0x0,_0x1aee6c=events[_0xc8e3('0x7')];_0x28fcf6<_0x1aee6c;_0x28fcf6++){var _0x4cee22=events[_0x28fcf6];var _0x8681bb=createListener('plugin:'+_0x4cee22,_0x3ded1f);PluginEvents['on'](_0x4cee22,_0x8681bb);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index c345d93..d381d0f 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(_0x4deff3,_0xfee13f){var _0x1a00ef=function(_0xc32eee){while(--_0xc32eee){_0x4deff3['push'](_0x4deff3['shift']());}};_0x1a00ef(++_0xfee13f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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(_0x37154c,_0x1765c3){var _0x216e0a=function(_0x183ef2){while(--_0x183ef2){_0x37154c['push'](_0x37154c['shift']());}};_0x216e0a(++_0x1765c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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 08e8e6d..1332e30 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 _0xd64b=['dump','send','Missing\x20name\x20and/or\x20path','update','stop','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/logger','path','child_process','exec','bluebird','status','json','name','npm\x20install','info','error','index','list','then','express','motion2','show','describe','params','catch','body','script','join','../../files/plugins','cwd','chdir','dirname','start'];(function(_0x36d281,_0x3e379b){var _0x5e8fae=function(_0x31a582){while(--_0x31a582){_0x36d281['push'](_0x36d281['shift']());}};_0x5e8fae(++_0x3e379b);}(_0xd64b,0xc1));var _0xbd64=function(_0x1338a1,_0x48c226){_0x1338a1=_0x1338a1-0x0;var _0x39b9e6=_0xd64b[_0x1338a1];return _0x39b9e6;};'use strict';var _=require(_0xbd64('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xbd64('0x1'))('api');var path=require(_0xbd64('0x2'));var exec=require(_0xbd64('0x3'))[_0xbd64('0x4')];var BPromise=require(_0xbd64('0x5'));function handleEntityNotFound(_0x30fe29,_0x5458d8){return function(_0x5446e4){if(!_0x5446e4){_0x30fe29['sendStatus'](0x194);;}return _0x5446e4;};}function respondWithResult(_0x51e87d,_0x58e9e7){_0x58e9e7=_0x58e9e7||0xc8;return function(_0x32995f){if(_0x32995f){return _0x51e87d[_0xbd64('0x6')](_0x58e9e7)[_0xbd64('0x7')](_0x32995f);}return null;};}function handleError(_0x3f1f17,_0x2b8543){_0x2b8543=_0x2b8543||0x1f4;return function(_0x197a84){logger['error'](_0x197a84['stack']);if(_0x197a84[_0xbd64('0x8')]){delete _0x197a84[_0xbd64('0x8')];}_0x3f1f17[_0xbd64('0x6')](_0x2b8543)['send'](_0x197a84);};}function execChildProcess(){return new BPromise(function(_0xc80599,_0x3f908a){exec(_0xbd64('0x9'),function(_0x18bde8,_0x593c79,_0x431b29){logger['info'](_0x593c79);logger[_0xbd64('0xa')](_0x431b29);if(_0x18bde8){logger[_0xbd64('0xb')](_0x18bde8);return _0x3f908a(_0x18bde8);}return _0xc80599(_0x593c79);});});}exports[_0xbd64('0xc')]=function(_0x2183e2,_0x367824){return pm2[_0xbd64('0xd')]()[_0xbd64('0xe')](function(_0x269e2f){if(_0x269e2f){var _0x2b5808=_['reject'](_0x269e2f,function(_0x2d1159){return _0x2d1159[_0xbd64('0x8')]===_0xbd64('0xf')||_0x2d1159[_0xbd64('0x8')]===_0xbd64('0x10');});return{'rows':_0x2b5808,'count':_0x2b5808['length']};}return null;})[_0xbd64('0xe')](respondWithResult(_0x367824,null))['catch'](handleError(_0x367824,null));};exports[_0xbd64('0x11')]=function(_0x1432a6,_0x3aef70){return pm2[_0xbd64('0x12')](_0x1432a6[_0xbd64('0x13')]['id'])[_0xbd64('0xe')](respondWithResult(_0x3aef70,null))[_0xbd64('0xe')](handleEntityNotFound(_0x3aef70,null))[_0xbd64('0x14')](handleError(_0x3aef70,null));};exports['create']=function(_0x305545,_0x1f618b){if(_0x305545['body']['name']&&_0x305545[_0xbd64('0x15')][_0xbd64('0x16')]){var _0x196d21=path[_0xbd64('0x17')](__dirname,_0xbd64('0x18'),_0x305545[_0xbd64('0x15')]['script']);var _0x4d4a16=process[_0xbd64('0x19')]();process[_0xbd64('0x1a')](path[_0xbd64('0x1b')](_0x196d21));return execChildProcess()[_0xbd64('0xe')](function(_0x55e74c){process['chdir'](_0x4d4a16);return pm2[_0xbd64('0x1c')]({'name':_0x305545['body'][_0xbd64('0x8')],'script':_0x196d21});})['then'](function(_0x33452d){pm2[_0xbd64('0x1d')]();return _0x33452d[0x0];})[_0xbd64('0xe')](respondWithResult(_0x1f618b,0xc9))[_0xbd64('0x14')](handleError(_0x1f618b,null));}else{return _0x1f618b['status'](0x1f4)[_0xbd64('0x1e')]({'message':_0xbd64('0x1f')});}};exports[_0xbd64('0x20')]=function(_0x2a44d0,_0x4d1563){if(_0x2a44d0['body']['id']){delete _0x2a44d0[_0xbd64('0x15')]['id'];}var _0x49eac5={'online':'restart','stopped':_0xbd64('0x21')};if(_0x49eac5['hasOwnProperty'](_0x2a44d0[_0xbd64('0x15')]['status'])){return pm2[_0x49eac5[_0x2a44d0[_0xbd64('0x15')]['status']]](_0x2a44d0[_0xbd64('0x13')]['id'])[_0xbd64('0xe')](respondWithResult(_0x4d1563,0xc8))[_0xbd64('0x14')](handleError(_0x4d1563,null));}else{return _0x4d1563[_0xbd64('0x6')](0x1f4)[_0xbd64('0x1e')]({'message':_0xbd64('0x22')});}};exports['destroy']=function(_0x35bdd5,_0xe876c9){if(_0x35bdd5[_0xbd64('0x15')]['id']){delete _0x35bdd5[_0xbd64('0x15')]['id'];}if(_0x35bdd5[_0xbd64('0x13')]['id']){return pm2[_0xbd64('0x23')](_0x35bdd5['params']['id'])['then'](function(_0x1e4593){pm2['dump']();return _0x1e4593[0x0];})[_0xbd64('0xe')](respondWithResult(_0xe876c9,null))[_0xbd64('0x14')](handleError(_0xe876c9,null));}else{return _0xe876c9['status'](0x1f4)['send']({'message':_0xbd64('0x24')});}}; \ No newline at end of file +var _0x0565=['script','../../files/plugins','cwd','chdir','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','npm\x20install','index','list','then','reject','express','length','catch','show','describe','body'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0565,0xf2));var _0x5056=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x0565[_0x556927];return _0x5f1235;};'use strict';var _=require(_0x5056('0x0'));var pm2=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var path=require(_0x5056('0x4'));var exec=require(_0x5056('0x5'))[_0x5056('0x6')];var BPromise=require(_0x5056('0x7'));function handleEntityNotFound(_0x3657a8,_0x2b0883){return function(_0x554040){if(!_0x554040){_0x3657a8[_0x5056('0x8')](0x194);;}return _0x554040;};}function respondWithResult(_0x105ea8,_0x1143df){_0x1143df=_0x1143df||0xc8;return function(_0x22afb7){if(_0x22afb7){return _0x105ea8['status'](_0x1143df)['json'](_0x22afb7);}return null;};}function handleError(_0x38f74,_0x223c92){_0x223c92=_0x223c92||0x1f4;return function(_0x417065){logger[_0x5056('0x9')](_0x417065[_0x5056('0xa')]);if(_0x417065[_0x5056('0xb')]){delete _0x417065[_0x5056('0xb')];}_0x38f74[_0x5056('0xc')](_0x223c92)['send'](_0x417065);};}function execChildProcess(){return new BPromise(function(_0x78f7e4,_0xf04ea3){exec(_0x5056('0xd'),function(_0x5ab4b2,_0x4c0255,_0x17f43e){logger['info'](_0x4c0255);logger['info'](_0x17f43e);if(_0x5ab4b2){logger['error'](_0x5ab4b2);return _0xf04ea3(_0x5ab4b2);}return _0x78f7e4(_0x4c0255);});});}exports[_0x5056('0xe')]=function(_0x4b183a,_0x3e523b){return pm2[_0x5056('0xf')]()[_0x5056('0x10')](function(_0x543cee){if(_0x543cee){var _0x1e8b64=_[_0x5056('0x11')](_0x543cee,function(_0x15f52d){return _0x15f52d[_0x5056('0xb')]===_0x5056('0x12')||_0x15f52d[_0x5056('0xb')]==='motion2';});return{'rows':_0x1e8b64,'count':_0x1e8b64[_0x5056('0x13')]};}return null;})['then'](respondWithResult(_0x3e523b,null))[_0x5056('0x14')](handleError(_0x3e523b,null));};exports[_0x5056('0x15')]=function(_0x1c0ee9,_0x1f2ac6){return pm2[_0x5056('0x16')](_0x1c0ee9['params']['id'])[_0x5056('0x10')](respondWithResult(_0x1f2ac6,null))[_0x5056('0x10')](handleEntityNotFound(_0x1f2ac6,null))['catch'](handleError(_0x1f2ac6,null));};exports['create']=function(_0x20776c,_0x517bf3){if(_0x20776c[_0x5056('0x17')][_0x5056('0xb')]&&_0x20776c[_0x5056('0x17')][_0x5056('0x18')]){var _0x33035c=path['join'](__dirname,_0x5056('0x19'),_0x20776c[_0x5056('0x17')]['script']);var _0x271efc=process[_0x5056('0x1a')]();process[_0x5056('0x1b')](path['dirname'](_0x33035c));return execChildProcess()[_0x5056('0x10')](function(_0x26a3c2){process['chdir'](_0x271efc);return pm2['start']({'name':_0x20776c[_0x5056('0x17')][_0x5056('0xb')],'script':_0x33035c});})[_0x5056('0x10')](function(_0x37f7b5){pm2['dump']();return _0x37f7b5[0x0];})[_0x5056('0x10')](respondWithResult(_0x517bf3,0xc9))[_0x5056('0x14')](handleError(_0x517bf3,null));}else{return _0x517bf3['status'](0x1f4)[_0x5056('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5056('0x1d')]=function(_0x39d539,_0x1106e5){if(_0x39d539[_0x5056('0x17')]['id']){delete _0x39d539[_0x5056('0x17')]['id'];}var _0x50f2a8={'online':_0x5056('0x1e'),'stopped':_0x5056('0x1f')};if(_0x50f2a8[_0x5056('0x20')](_0x39d539[_0x5056('0x17')]['status'])){return pm2[_0x50f2a8[_0x39d539[_0x5056('0x17')]['status']]](_0x39d539[_0x5056('0x21')]['id'])['then'](respondWithResult(_0x1106e5,0xc8))['catch'](handleError(_0x1106e5,null));}else{return _0x1106e5['status'](0x1f4)[_0x5056('0x1c')]({'message':_0x5056('0x22')});}};exports['destroy']=function(_0x27f4be,_0x2c5728){if(_0x27f4be[_0x5056('0x17')]['id']){delete _0x27f4be[_0x5056('0x17')]['id'];}if(_0x27f4be[_0x5056('0x21')]['id']){return pm2[_0x5056('0x23')](_0x27f4be[_0x5056('0x21')]['id'])[_0x5056('0x10')](function(_0xd1aa24){pm2[_0x5056('0x24')]();return _0xd1aa24[0x0];})[_0x5056('0x10')](respondWithResult(_0x2c5728,null))['catch'](handleError(_0x2c5728,null));}else{return _0x2c5728['status'](0x1f4)[_0x5056('0x1c')]({'message':_0x5056('0x25')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index e1ed4b1..46cbb28 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 _0x7976=['isAuthenticated','getAgents','/queues','getQueues','express','Router','get','/agents'];(function(_0x231438,_0x431b0e){var _0x3c8759=function(_0x4ff40c){while(--_0x4ff40c){_0x231438['push'](_0x231438['shift']());}};_0x3c8759(++_0x431b0e);}(_0x7976,0x18c));var _0x6797=function(_0x3732b8,_0x1c4edd){_0x3732b8=_0x3732b8-0x0;var _0x5f510a=_0x7976[_0x3732b8];return _0x5f510a;};'use strict';var express=require(_0x6797('0x0'));var router=express[_0x6797('0x1')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x6797('0x2')](_0x6797('0x3'),auth[_0x6797('0x4')](),controller[_0x6797('0x5')]);router[_0x6797('0x2')](_0x6797('0x6'),auth[_0x6797('0x4')](),controller[_0x6797('0x7')]);module['exports']=router; \ No newline at end of file +var _0x05b2=['/queues','getQueues','exports','express','../../components/auth/service','/agents','isAuthenticated','getAgents','get'];(function(_0x528961,_0x4097d3){var _0x684bb7=function(_0x313e3c){while(--_0x313e3c){_0x528961['push'](_0x528961['shift']());}};_0x684bb7(++_0x4097d3);}(_0x05b2,0x1f2));var _0x205b=function(_0x178583,_0x4f6434){_0x178583=_0x178583-0x0;var _0x1a258e=_0x05b2[_0x178583];return _0x1a258e;};'use strict';var express=require(_0x205b('0x0'));var router=express['Router']();var auth=require(_0x205b('0x1'));var controller=require('./realtime.controller');router['get'](_0x205b('0x2'),auth[_0x205b('0x3')](),controller[_0x205b('0x4')]);router[_0x205b('0x5')](_0x205b('0x6'),auth[_0x205b('0x3')](),controller[_0x205b('0x7')]);module[_0x205b('0x8')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 10f806b..25eb765 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 _0xba34=['Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','outbound','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','waiting','busy','pTalking','pick','queue','length','some','connectedlinenum','toString','find','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','Pause','idle','unknown','unavailable','isNil','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','every','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','pause','*pause','getAgents','userpic','lastPauseAt','pauseType','internal','address','chatPause','mailPause','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','routealias','resolve','fieldName','key','query','role','getOptions','raw','user','userProfileId','agent','nolimit','sort','filter','UserProfile','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','sms','openchannel','channel','includes','toLowerCase','Invalid\x20channel','rawAttributes','type','QueueCampaigns','getResources','all','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','http','client','undefined','limit','count','offset','status','set','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','voice','startCase'];(function(_0x365460,_0x2e26d7){var _0x1e2a23=function(_0x23b093){while(--_0x23b093){_0x365460['push'](_0x365460['shift']());}};_0x1e2a23(++_0x2e26d7);}(_0xba34,0x119));var _0x4ba3=function(_0x184812,_0x1384a5){_0x184812=_0x184812-0x0;var _0x221cdb=_0xba34[_0x184812];return _0x221cdb;};'use strict';var util=require(_0x4ba3('0x0'));var _=require(_0x4ba3('0x1'));var jayson=require(_0x4ba3('0x2'));var qs=require(_0x4ba3('0x3'));var logger=require(_0x4ba3('0x4'))('api');var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x4ba3('0x5')]({'port':0x232a});var routingClient=jayson[_0x4ba3('0x6')][_0x4ba3('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x1011ec,_0x3590a1){return function(_0xb88621){if(_0xb88621){var _0xe5f99a=typeof _0x3590a1['offset']===_0x4ba3('0x7')&&typeof _0x3590a1[_0x4ba3('0x8')]===_0x4ba3('0x7');var _0x18e332=_0xb88621[_0x4ba3('0x9')];var _0xcf1ec3=_0xe5f99a?0x0:_0x3590a1[_0x4ba3('0xa')];var _0x3f653c=_0xe5f99a?_0xb88621[_0x4ba3('0x9')]:_0x3590a1[_0x4ba3('0xa')]+_0x3590a1[_0x4ba3('0x8')];var _0x51edab;if(_0x3f653c>=_0x18e332){_0x3f653c=_0x18e332;_0x51edab=0xc8;}else{_0x51edab=0xce;}_0x1011ec[_0x4ba3('0xb')](_0x51edab);return _0x1011ec[_0x4ba3('0xc')]('Content-Range',_0xcf1ec3+'-'+_0x3f653c+'/'+_0x18e332)[_0x4ba3('0xd')](_0xb88621);}return null;};}function handleError(_0x567709,_0x1073d4){_0x1073d4=_0x1073d4||0x1f4;return function(_0x52f55c){logger[_0x4ba3('0xe')](_0x52f55c[_0x4ba3('0xf')]);if(_0x52f55c[_0x4ba3('0x10')]){delete _0x52f55c[_0x4ba3('0x10')];}_0x567709[_0x4ba3('0xb')](_0x1073d4)[_0x4ba3('0x11')](_0x52f55c);};}function getRealtimeAgents(){return new Promise(function(_0x3a74f7,_0x12ac90){return amiClient[_0x4ba3('0x12')](_0x4ba3('0x13'),{})[_0x4ba3('0x14')](function(_0x301359){if(_0x301359[_0x4ba3('0xe')])throw new Error(_0x4ba3('0x15'));var _0x40e75b=_0x301359[_0x4ba3('0x16')];return routingClient['request'](_0x4ba3('0x13'),{})[_0x4ba3('0x14')](function(_0x5ff7ce){if(_0x5ff7ce[_0x4ba3('0xe')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');var _0x2519bb=_0x5ff7ce[_0x4ba3('0x16')];return _0x3a74f7(_[_0x4ba3('0x17')]({},_0x40e75b,_0x2519bb));});})[_0x4ba3('0x18')](function(_0x184332){_0x12ac90(_0x184332);});});}function getRealtimeQueues(_0x125944,_0x4b2791){return new Promise(function(_0x57de6a,_0x2278b0){var _0x579d9f=_0x4b2791===_0x4ba3('0x19')?amiClient:routingClient;return _0x579d9f[_0x4ba3('0x12')](_[_0x4ba3('0x1a')](_0x4b2791)+_0x4ba3('0x1b'),_0x125944)[_0x4ba3('0x14')](function(_0x278a23){if(_0x278a23['error'])throw new Error(util[_0x4ba3('0x1c')](_0x4ba3('0x1d'),_0x4b2791));return _0x57de6a(_0x278a23['result']);})[_0x4ba3('0x18')](function(_0x4ffe39){_0x2278b0(_0x4ffe39);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1ae4de,_0x18abb3){return amiClient[_0x4ba3('0x12')](_0x4ba3('0x1e'),{})[_0x4ba3('0x14')](function(_0xe29a49){if(_0xe29a49[_0x4ba3('0xe')])throw new Error(_0x4ba3('0x1f'));return _0x1ae4de(_0xe29a49[_0x4ba3('0x16')]);})[_0x4ba3('0x18')](function(_0x50c729){_0x18abb3(_0x50c729);});});}function initializeQueues(_0x252f37,_0x13c353,_0x2311ed,_0x5adaab){var _0x10537e=[_0x4ba3('0x20'),_0x4ba3('0x21'),'waiting',_0x4ba3('0x22'),_0x4ba3('0x23')];if(_0x2311ed===_0x4ba3('0x19')&&_0x5adaab===_0x4ba3('0x24')){_0x10537e['push']('pTalking',_0x4ba3('0x25'),_0x4ba3('0x26'),_0x4ba3('0x27'),_0x4ba3('0x28'),_0x4ba3('0x29'),_0x4ba3('0x2a'),'startProgressive',_0x4ba3('0x2b'),_0x4ba3('0x2c'),_0x4ba3('0x2d'),_0x4ba3('0x2e'),_0x4ba3('0x2f'),_0x4ba3('0x30'),_0x4ba3('0x31'),_0x4ba3('0x32'),_0x4ba3('0x33'),_0x4ba3('0x34'),'predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x4ba3('0x35'));}return _0x252f37[_0x4ba3('0x36')](function(_0x41b4eb){var _0x4372cb=_0x41b4eb[_0x4ba3('0x37')]({'plain':!![]});_0x4372cb[_0x4ba3('0x38')]=[];_0x4372cb[_0x4ba3('0x23')]=0x0;_0x4372cb[_0x4ba3('0x39')]=0x0;_0x4372cb[_0x4ba3('0x20')]=0x0;_0x4372cb[_0x4ba3('0x21')]=0x0;_0x4372cb[_0x4ba3('0x3a')]=0x0;if(_0x2311ed===_0x4ba3('0x19')){_0x4372cb['talking']=0x0;_0x4372cb[_0x4ba3('0x3b')]=0x0;if(_0x5adaab===_0x4ba3('0x24')){_0x4372cb[_0x4ba3('0x3c')]=0x0;_0x4372cb['originated']=0x0;}}var _0x188f8c=_['find'](_0x13c353,['id',_0x4372cb['id']]);if(_0x188f8c)_[_0x4ba3('0x17')](_0x4372cb,_[_0x4ba3('0x3d')](_0x188f8c,_0x10537e));return _0x4372cb;});}function updateAgentVoiceStatus(_0x426e11,_0x2b213b,_0xf892e1){var _0x3d977c=_['filter'](_0xf892e1,[_0x4ba3('0x3e'),_0x2b213b[_0x4ba3('0x10')]]);if(_0x3d977c[_0x4ba3('0x3f')]===0x0)return _0x426e11['busy']=!![];if(_[_0x4ba3('0x40')](_0x3d977c,[_0x4ba3('0x41'),_0x426e11['internal'][_0x4ba3('0x42')]()]))return _0x426e11['talking']=!![];if(!_0x426e11['talking'])return _0x426e11[_0x4ba3('0x3b')]=!![];}function getVoiceQueueAgents(_0x1acc74,_0x38b64d,_0x2b14e1,_0x20ac88){var _0x59d535=_[_0x4ba3('0x43')](_0x38b64d,['id',_0x1acc74['id']]);if(!_0x59d535)return _0x1acc74;return _0x59d535[_0x4ba3('0x44')]({'raw':!![]})[_0x4ba3('0x14')](function(_0x6f96b4){for(var _0xab7983=0x0;_0xab7983<_0x6f96b4[_0x4ba3('0x3f')];_0xab7983++){var _0x349af4=_[_0x4ba3('0x43')](_0x2b14e1,['id',_0x6f96b4[_0xab7983]['UserId']]);if(!_0x349af4){_0x349af4={'id':_0x6f96b4[_0xab7983][_0x4ba3('0x45')],'name':_0x6f96b4[_0xab7983][_0x4ba3('0x45')],'accountcode':'','online':![]};}var _0x3cb07f={'id':_0x349af4['id'],'name':_0x349af4[_0x4ba3('0x10')],'internal':_0x349af4[_0x4ba3('0x46')],'online':Boolean(_0x349af4[_0x4ba3('0x47')]),'paused':Boolean(_0x6f96b4[_0xab7983][_0x4ba3('0x23')])};if(_0x349af4[_0x4ba3('0x48')]===_0x4ba3('0x22'))updateAgentVoiceStatus(_0x3cb07f,_0x1acc74,_0x20ac88);if(_0x3cb07f[_0x4ba3('0x47')])_0x1acc74[_0x4ba3('0x39')]++;if(_0x3cb07f[_0x4ba3('0x3b')])_0x1acc74[_0x4ba3('0x3b')]++;if(_0x3cb07f[_0x4ba3('0x23')]&&!_0x3cb07f['busy']&&!_0x3cb07f['talking'])_0x1acc74['paused']++;_0x1acc74['agents']['push'](_0x3cb07f);}return _0x1acc74;});}function getQueueAgents(_0x1df753,_0x5c4659,_0x29e74d){var _0x5567c7=_0x4ba3('0x49')+_[_0x4ba3('0x1a')](_0x29e74d)+_0x4ba3('0x4a');var _0x29090b=_0x29e74d+_0x4ba3('0x4b');return db[_0x5567c7]['findAll']({'where':{[_[_0x4ba3('0x1a')](_0x29e74d)+'QueueId']:_0x1df753['id']},'raw':!![]})[_0x4ba3('0x14')](function(_0x50f27a){for(var _0x21dbbd=0x0;_0x21dbbd<_0x50f27a[_0x4ba3('0x3f')];_0x21dbbd++){var _0x3392a4=_[_0x4ba3('0x43')](_0x5c4659,['id',_0x50f27a[_0x21dbbd][_0x4ba3('0x45')]]);if(!_0x3392a4){_0x3392a4={'id':_0x50f27a[_0x21dbbd][_0x4ba3('0x45')],'name':_0x50f27a[_0x21dbbd][_0x4ba3('0x45')],'online':![],['pauseField']:![]};}var _0x5d5714={'id':_0x3392a4['id'],'name':_0x3392a4[_0x4ba3('0x10')],'online':Boolean(_0x3392a4[_0x4ba3('0x47')]),'paused':Boolean(_0x3392a4[_0x29090b])};if(_0x5d5714[_0x4ba3('0x47')])_0x1df753[_0x4ba3('0x39')]++;_0x1df753[_0x4ba3('0x38')]['push'](_0x5d5714);}return _0x1df753;});}function isIdle(_0x56b55d){return _0x56b55d===_0x4ba3('0x4c')||_0x56b55d===_0x4ba3('0x4d')||_0x56b55d===_0x4ba3('0x4e')||_0x56b55d==='ringing'||_[_0x4ba3('0x4f')](_0x56b55d);}function isAgentPaused(_0xfd30a0,_0x1220f4){var _0x58648d=[_0xfd30a0['chatPause'],_0xfd30a0[_0x4ba3('0x50')],_0xfd30a0['mailPause'],_0xfd30a0[_0x4ba3('0x51')],_0xfd30a0[_0x4ba3('0x52')],_0xfd30a0[_0x4ba3('0x53')],_0xfd30a0[_0x4ba3('0x54')]];if(!_0x1220f4)return _[_0x4ba3('0x55')](_0x58648d);var _0x213eb0=_['filter'](_0x58648d);return _0x213eb0[_0x4ba3('0x3f')]>0x0&&_0x213eb0[_0x4ba3('0x3f')]<_0x58648d['length']?!![]:![];}function isAgentIdle(_0x325475){if(_0x325475[_0x4ba3('0x48')]!==_0x4ba3('0x4c')&&_0x325475[_0x4ba3('0x53')]){_0x325475[_0x4ba3('0x48')]='pause';return![];}return _[_0x4ba3('0x55')]([_0x325475[_0x4ba3('0x56')],_0x325475['faxStatus'],_0x325475[_0x4ba3('0x57')],_0x325475[_0x4ba3('0x58')],_0x325475[_0x4ba3('0x59')],_0x325475[_0x4ba3('0x48')],_0x325475[_0x4ba3('0x5a')]],isIdle);}function getAgentStatus(_0x42a87a){var _0x45dae5=_0x4ba3('0x4d');if(isAgentPaused(_0x42a87a))_0x45dae5=_0x4ba3('0x5b');else if(isAgentPaused(_0x42a87a,!![]))_0x45dae5=_0x4ba3('0x5c');else if(isAgentIdle(_0x42a87a))_0x45dae5=_0x4ba3('0x4c');else _0x45dae5=_0x4ba3('0x3b');return _0x45dae5;}exports[_0x4ba3('0x5d')]=function(_0x22890a,_0x2795df){var _0x48a3d4={'count':0x0,'rows':[]},_0x5e7ed5={},_0x589d82,_0x14c014,_0x1b7ad1=[_0x4ba3('0x5e'),_0x4ba3('0x47'),'lastLoginAt',_0x4ba3('0x5f'),_0x4ba3('0x60'),_0x4ba3('0x5f'),_0x4ba3('0x61'),_0x4ba3('0x62'),_0x4ba3('0x63'),_0x4ba3('0x51'),_0x4ba3('0x64'),_0x4ba3('0x52'),_0x4ba3('0x54'),_0x4ba3('0x50'),_0x4ba3('0x53'),_0x4ba3('0x65'),_0x4ba3('0x66'),'mailCapacity',_0x4ba3('0x67'),_0x4ba3('0x68'),_0x4ba3('0x69'),_0x4ba3('0x6a'),_0x4ba3('0x6b'),_0x4ba3('0x6c'),_0x4ba3('0x6d'),_0x4ba3('0x6e'),'faxCurrentCapacity',_0x4ba3('0x56'),_0x4ba3('0x58'),_0x4ba3('0x57'),'smsStatus',_0x4ba3('0x5a'),'faxStatus',_0x4ba3('0x48'),_0x4ba3('0x6f'),_0x4ba3('0x70'),_0x4ba3('0x71'),_0x4ba3('0x72'),'whatsappStatusTime',_0x4ba3('0x73'),_0x4ba3('0x74'),_0x4ba3('0x3e'),_0x4ba3('0x75'),_0x4ba3('0x76'),'phoneBarEnableScreenRecordingByAgent',_0x4ba3('0x77'),_0x4ba3('0x78')],_0xf0fa9e=[_0x4ba3('0x63'),_0x4ba3('0x51'),_0x4ba3('0x64'),_0x4ba3('0x52'),_0x4ba3('0x54'),_0x4ba3('0x50'),_0x4ba3('0x53'),_0x4ba3('0x47')];Promise[_0x4ba3('0x79')]()['then'](function(){var _0x359bcc=_[_0x4ba3('0x36')](db['User']['rawAttributes'],function(_0x3a6386){return{'name':_0x3a6386[_0x4ba3('0x7a')],'type':_0x3a6386['type'][_0x4ba3('0x7b')]};});_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x7d')]='agent';_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x47')]=!![];_0x5e7ed5=qs[_0x4ba3('0x7e')](_0x359bcc,_0x22890a);_0x5e7ed5[_0x4ba3('0x7f')]=!![];if(_0x22890a[_0x4ba3('0x80')][_0x4ba3('0x7d')]==='user'){var _0x3a1fad={'params':{'id':_0x22890a[_0x4ba3('0x80')][_0x4ba3('0x81')]},'query':{'section':'Agents','role':_0x4ba3('0x82'),'online':!![],'nolimit':_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x83')],'sort':_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x84')],'filter':_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x85')],'raw':!![]}};return db[_0x4ba3('0x86')]['getResources'](_0x3a1fad);}return db['User'][_0x4ba3('0x87')](_0x5e7ed5);})['then'](function(_0x13ee2c){_0x48a3d4[_0x4ba3('0x9')]=_0x13ee2c[_0x4ba3('0x9')];_0x589d82=_0x13ee2c['rows'];return getRealtimeAgents();})[_0x4ba3('0x14')](function(_0x1679f3){_0x14c014=_0x1679f3[_0x4ba3('0x88')];return _0x589d82['map'](function(_0x36dca0){var _0x55b660=_[_0x4ba3('0x43')](_0x14c014,['id',_0x36dca0['id']]);if(_0x55b660)_[_0x4ba3('0x17')](_0x36dca0,_['pick'](_[_0x4ba3('0x89')](_0x55b660,_0xf0fa9e),_0x1b7ad1));_0x36dca0[_0x4ba3('0x8a')]=getAgentStatus(_0x36dca0);return _0x36dca0;});})[_0x4ba3('0x14')](function(_0x1f4d92){if(_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x8b')]){var _0x2f71b9=_[_0x4ba3('0x85')](_0x1f4d92,[_0x4ba3('0x8a'),_0x22890a['query'][_0x4ba3('0x8b')]]);if(_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x8c')]){_0x2f71b9=_[_0x4ba3('0x85')](_0x2f71b9,[_0x4ba3('0x60'),_0x22890a[_0x4ba3('0x7c')][_0x4ba3('0x8c')]]);}}_0x48a3d4[_0x4ba3('0x88')]=_0x2f71b9||_0x1f4d92;return _0x48a3d4;})[_0x4ba3('0x14')](respondWithFilteredResult(_0x2795df,_0x5e7ed5))[_0x4ba3('0x18')](handleError(_0x2795df,null));};exports[_0x4ba3('0x8d')]=function(_0x3ab4bd,_0x4e46af){var _0x3c1503=[_0x4ba3('0x8e'),'chat',_0x4ba3('0x8f'),_0x4ba3('0x90'),'fax','whatsapp',_0x4ba3('0x19')];var _0x14a6d9={'count':0x0,'rows':[]},_0x1c5b2d={},_0x1be0ed,_0x37b966,_0x2d68da,_0x2a6bb9,_0x1246bc;Promise['resolve']()[_0x4ba3('0x14')](function(){if(_0x3ab4bd['query'][_0x4ba3('0x91')]){if(!_[_0x4ba3('0x92')](_0x3c1503,_0x3ab4bd[_0x4ba3('0x7c')][_0x4ba3('0x91')][_0x4ba3('0x93')]()))throw new Error(_0x4ba3('0x94'));_0x1be0ed=_0x3ab4bd[_0x4ba3('0x7c')][_0x4ba3('0x91')]['toLowerCase']();}var _0x21907d=_[_0x4ba3('0x1a')](_0x1be0ed)+_0x4ba3('0x4a');var _0x5a1872=_[_0x4ba3('0x36')](db[_0x21907d][_0x4ba3('0x95')],function(_0x1d1ce8){return{'name':_0x1d1ce8[_0x4ba3('0x7a')],'type':_0x1d1ce8[_0x4ba3('0x96')][_0x4ba3('0x7b')]};});_0x1c5b2d=qs[_0x4ba3('0x7e')](_0x5a1872,_0x3ab4bd);if(_0x3ab4bd['user']['role']===_0x4ba3('0x80')){var _0x5106a8={'params':{'id':_0x3ab4bd[_0x4ba3('0x80')][_0x4ba3('0x81')]},'query':{'section':_0x1be0ed===_0x4ba3('0x19')&&_0x3ab4bd[_0x4ba3('0x7c')]['type']==='outbound'?_0x4ba3('0x97'):_[_0x4ba3('0x1a')](_0x1be0ed)+'Queues','type':_0x3ab4bd[_0x4ba3('0x7c')][_0x4ba3('0x96')],'nolimit':!![],'sort':_0x4ba3('0x10'),'filter':_0x3ab4bd[_0x4ba3('0x7c')][_0x4ba3('0x85')]}};return db[_0x4ba3('0x86')][_0x4ba3('0x98')](_0x5106a8);}return db[_0x21907d]['findAndCountAll'](_0x1c5b2d);})[_0x4ba3('0x14')](function(_0x1a45e3){_0x14a6d9[_0x4ba3('0x9')]=_0x1a45e3['count'];_0x37b966=_0x1a45e3[_0x4ba3('0x88')];return getRealtimeQueues(_0x3ab4bd,_0x1be0ed);})[_0x4ba3('0x14')](function(_0x4e334c){_0x2a6bb9=_0x4e334c[_0x4ba3('0x88')];return getRealtimeAgents();})[_0x4ba3('0x14')](function(_0x50dc70){_0x2d68da=_0x50dc70['rows'];if(_0x1be0ed!='voice')return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x206e93){_0x1246bc=_0x206e93?_0x206e93[_0x4ba3('0x88')]:[];return initializeQueues(_0x37b966,_0x2a6bb9,_0x1be0ed,_0x3ab4bd[_0x4ba3('0x7c')][_0x4ba3('0x96')]);})[_0x4ba3('0x14')](function(_0x333a97){var _0x30d7a9=_0x333a97['map'](function(_0x1604d3){if(_0x1be0ed==='voice')return getVoiceQueueAgents(_0x1604d3,_0x37b966,_0x2d68da,_0x1246bc);else return getQueueAgents(_0x1604d3,_0x2d68da,_0x1be0ed);});return Promise[_0x4ba3('0x99')](_0x30d7a9);})['then'](function(_0x27298f){_0x14a6d9[_0x4ba3('0x88')]=_0x27298f;return _0x14a6d9;})[_0x4ba3('0x14')](respondWithFilteredResult(_0x4e46af,_0x1c5b2d))[_0x4ba3('0x18')](handleError(_0x4e46af,null));}; \ No newline at end of file +var _0xdc97=['mailCurrentCapacity','smsCurrentCapacity','smsStatus','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','rawAttributes','type','key','query','getOptions','raw','user','role','agent','sort','UserProfile','findAndCountAll','rows','pick','globalStatusFilter','globalStatus','pauseTypeFilter','chat','fax','whatsapp','toLowerCase','Invalid\x20channel','channel','QueueCampaigns','Queues','getResources','all','util','lodash','jayson/promise','../../config/logger','../../mysqldb','client','http','limit','undefined','count','offset','status','set','error','name','send','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','map','get','agents','loggedInDb','busy','find','queue','length','some','connectedlinenum','internal','toString','UserId','accountcode','voiceStatus','User','startCase','Queue','Pause','findAll','online','idle','unknown','unavailable','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','pause','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','chatCurrentCapacity','openchannelCurrentCapacity'];(function(_0x4ec9f3,_0x3c50ea){var _0x13c735=function(_0x55512d){while(--_0x55512d){_0x4ec9f3['push'](_0x4ec9f3['shift']());}};_0x13c735(++_0x3c50ea);}(_0xdc97,0x13b));var _0x7dc9=function(_0x47492e,_0x29f2a2){_0x47492e=_0x47492e-0x0;var _0x41de48=_0xdc97[_0x47492e];return _0x41de48;};'use strict';var util=require(_0x7dc9('0x0'));var _=require(_0x7dc9('0x1'));var jayson=require(_0x7dc9('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x7dc9('0x3'))('api');var db=require(_0x7dc9('0x4'))['db'];var amiClient=jayson[_0x7dc9('0x5')]['http']({'port':0x232a});var routingClient=jayson[_0x7dc9('0x5')][_0x7dc9('0x6')]({'port':0x232c});function respondWithFilteredResult(_0xb15a0b,_0x3ba3ca){return function(_0x589f02){if(_0x589f02){var _0x2636ef=typeof _0x3ba3ca['offset']==='undefined'&&typeof _0x3ba3ca[_0x7dc9('0x7')]===_0x7dc9('0x8');var _0x3318ea=_0x589f02[_0x7dc9('0x9')];var _0x3dd07e=_0x2636ef?0x0:_0x3ba3ca['offset'];var _0xb2fa2a=_0x2636ef?_0x589f02[_0x7dc9('0x9')]:_0x3ba3ca[_0x7dc9('0xa')]+_0x3ba3ca[_0x7dc9('0x7')];var _0x359c88;if(_0xb2fa2a>=_0x3318ea){_0xb2fa2a=_0x3318ea;_0x359c88=0xc8;}else{_0x359c88=0xce;}_0xb15a0b[_0x7dc9('0xb')](_0x359c88);return _0xb15a0b[_0x7dc9('0xc')]('Content-Range',_0x3dd07e+'-'+_0xb2fa2a+'/'+_0x3318ea)['json'](_0x589f02);}return null;};}function handleError(_0x4be1c8,_0x599ef1){_0x599ef1=_0x599ef1||0x1f4;return function(_0x94c75a){logger[_0x7dc9('0xd')](_0x94c75a['stack']);if(_0x94c75a[_0x7dc9('0xe')]){delete _0x94c75a[_0x7dc9('0xe')];}_0x4be1c8[_0x7dc9('0xb')](_0x599ef1)[_0x7dc9('0xf')](_0x94c75a);};}function getRealtimeAgents(){return new Promise(function(_0x31d43d,_0x11af93){return amiClient['request'](_0x7dc9('0x10'),{})[_0x7dc9('0x11')](function(_0x1b0aa1){if(_0x1b0aa1[_0x7dc9('0xd')])throw new Error(_0x7dc9('0x12'));var _0xbe0437=_0x1b0aa1[_0x7dc9('0x13')];return routingClient[_0x7dc9('0x14')](_0x7dc9('0x10'),{})['then'](function(_0x22577e){if(_0x22577e['error'])throw new Error(_0x7dc9('0x15'));var _0x1cc237=_0x22577e['result'];return _0x31d43d(_[_0x7dc9('0x16')]({},_0xbe0437,_0x1cc237));});})[_0x7dc9('0x17')](function(_0x12f08d){_0x11af93(_0x12f08d);});});}function getRealtimeQueues(_0x4b2703,_0x43ec33){return new Promise(function(_0x184bfd,_0x2dad65){var _0x2895f5=_0x43ec33===_0x7dc9('0x18')?amiClient:routingClient;return _0x2895f5[_0x7dc9('0x14')](_['startCase'](_0x43ec33)+'Queues',_0x4b2703)[_0x7dc9('0x11')](function(_0x5981e2){if(_0x5981e2['error'])throw new Error(util[_0x7dc9('0x19')](_0x7dc9('0x1a'),_0x43ec33));return _0x184bfd(_0x5981e2['result']);})[_0x7dc9('0x17')](function(_0x43d31f){_0x2dad65(_0x43d31f);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x41110a,_0x4906b1){return amiClient[_0x7dc9('0x14')](_0x7dc9('0x1b'),{})[_0x7dc9('0x11')](function(_0x55a482){if(_0x55a482['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x41110a(_0x55a482[_0x7dc9('0x13')]);})[_0x7dc9('0x17')](function(_0x5843bf){_0x4906b1(_0x5843bf);});});}function initializeQueues(_0x585eef,_0x47771b,_0x5afb7d,_0x2d22eb){var _0x1c690b=[_0x7dc9('0x1c'),_0x7dc9('0x1d'),_0x7dc9('0x1e'),_0x7dc9('0x1f'),_0x7dc9('0x20')];if(_0x5afb7d===_0x7dc9('0x18')&&_0x2d22eb===_0x7dc9('0x21')){_0x1c690b[_0x7dc9('0x22')](_0x7dc9('0x23'),_0x7dc9('0x24'),'message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond',_0x7dc9('0x25'),_0x7dc9('0x26'),_0x7dc9('0x27'),_0x7dc9('0x28'),_0x7dc9('0x29'),_0x7dc9('0x2a'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x7dc9('0x2b'),'predictiveIntervalAvgHoldtime',_0x7dc9('0x2c'));}return _0x585eef[_0x7dc9('0x2d')](function(_0x1298f9){var _0x213066=_0x1298f9[_0x7dc9('0x2e')]({'plain':!![]});_0x213066[_0x7dc9('0x2f')]=[];_0x213066[_0x7dc9('0x20')]=0x0;_0x213066[_0x7dc9('0x30')]=0x0;_0x213066['loggedIn']=0x0;_0x213066[_0x7dc9('0x1d')]=0x0;_0x213066['waiting']=0x0;if(_0x5afb7d===_0x7dc9('0x18')){_0x213066[_0x7dc9('0x1f')]=0x0;_0x213066[_0x7dc9('0x31')]=0x0;if(_0x2d22eb===_0x7dc9('0x21')){_0x213066['pTalking']=0x0;_0x213066[_0x7dc9('0x24')]=0x0;}}var _0x47fb58=_[_0x7dc9('0x32')](_0x47771b,['id',_0x213066['id']]);if(_0x47fb58)_['merge'](_0x213066,_['pick'](_0x47fb58,_0x1c690b));return _0x213066;});}function updateAgentVoiceStatus(_0x265a5f,_0x45fd54,_0x21e036){var _0x30bb6d=_['filter'](_0x21e036,[_0x7dc9('0x33'),_0x45fd54[_0x7dc9('0xe')]]);if(_0x30bb6d[_0x7dc9('0x34')]===0x0)return _0x265a5f[_0x7dc9('0x31')]=!![];if(_[_0x7dc9('0x35')](_0x30bb6d,[_0x7dc9('0x36'),_0x265a5f[_0x7dc9('0x37')][_0x7dc9('0x38')]()]))return _0x265a5f[_0x7dc9('0x1f')]=!![];if(!_0x265a5f[_0x7dc9('0x1f')])return _0x265a5f[_0x7dc9('0x31')]=!![];}function getVoiceQueueAgents(_0x3a8d80,_0x5a94b5,_0x34b5c9,_0x7cdd8d){var _0x466b02=_[_0x7dc9('0x32')](_0x5a94b5,['id',_0x3a8d80['id']]);if(!_0x466b02)return _0x3a8d80;return _0x466b02['getMembers']({'raw':!![]})[_0x7dc9('0x11')](function(_0x89db0e){for(var _0x255801=0x0;_0x255801<_0x89db0e[_0x7dc9('0x34')];_0x255801++){var _0x295853=_[_0x7dc9('0x32')](_0x34b5c9,['id',_0x89db0e[_0x255801]['UserId']]);if(!_0x295853){_0x295853={'id':_0x89db0e[_0x255801]['UserId'],'name':_0x89db0e[_0x255801][_0x7dc9('0x39')],'accountcode':'','online':![]};}var _0x36a965={'id':_0x295853['id'],'name':_0x295853['name'],'internal':_0x295853[_0x7dc9('0x3a')],'online':Boolean(_0x295853['online']),'paused':Boolean(_0x89db0e[_0x255801][_0x7dc9('0x20')])};if(_0x295853[_0x7dc9('0x3b')]===_0x7dc9('0x1f'))updateAgentVoiceStatus(_0x36a965,_0x3a8d80,_0x7cdd8d);if(_0x36a965['online'])_0x3a8d80[_0x7dc9('0x30')]++;if(_0x36a965[_0x7dc9('0x31')])_0x3a8d80[_0x7dc9('0x31')]++;if(_0x36a965[_0x7dc9('0x20')]&&!_0x36a965[_0x7dc9('0x31')]&&!_0x36a965[_0x7dc9('0x1f')])_0x3a8d80[_0x7dc9('0x20')]++;_0x3a8d80['agents'][_0x7dc9('0x22')](_0x36a965);}return _0x3a8d80;});}function getQueueAgents(_0x4f29b2,_0x52d883,_0xcced6c){var _0x294276=_0x7dc9('0x3c')+_[_0x7dc9('0x3d')](_0xcced6c)+_0x7dc9('0x3e');var _0x1bd3a7=_0xcced6c+_0x7dc9('0x3f');return db[_0x294276][_0x7dc9('0x40')]({'where':{[_[_0x7dc9('0x3d')](_0xcced6c)+'QueueId']:_0x4f29b2['id']},'raw':!![]})[_0x7dc9('0x11')](function(_0x1971c7){for(var _0x3c4d4c=0x0;_0x3c4d4c<_0x1971c7[_0x7dc9('0x34')];_0x3c4d4c++){var _0xda202e=_[_0x7dc9('0x32')](_0x52d883,['id',_0x1971c7[_0x3c4d4c]['UserId']]);if(!_0xda202e){_0xda202e={'id':_0x1971c7[_0x3c4d4c][_0x7dc9('0x39')],'name':_0x1971c7[_0x3c4d4c][_0x7dc9('0x39')],'online':![],['pauseField']:![]};}var _0x49bffe={'id':_0xda202e['id'],'name':_0xda202e[_0x7dc9('0xe')],'online':Boolean(_0xda202e[_0x7dc9('0x41')]),'paused':Boolean(_0xda202e[_0x1bd3a7])};if(_0x49bffe[_0x7dc9('0x41')])_0x4f29b2['loggedInDb']++;_0x4f29b2[_0x7dc9('0x2f')]['push'](_0x49bffe);}return _0x4f29b2;});}function isIdle(_0x55826d){return _0x55826d===_0x7dc9('0x42')||_0x55826d===_0x7dc9('0x43')||_0x55826d===_0x7dc9('0x44')||_0x55826d==='ringing'||_['isNil'](_0x55826d);}function isAgentPaused(_0x415ebd,_0x5a817a){var _0xad7278=[_0x415ebd[_0x7dc9('0x45')],_0x415ebd['faxPause'],_0x415ebd[_0x7dc9('0x46')],_0x415ebd[_0x7dc9('0x47')],_0x415ebd[_0x7dc9('0x48')],_0x415ebd[_0x7dc9('0x49')],_0x415ebd[_0x7dc9('0x4a')]];if(!_0x5a817a)return _[_0x7dc9('0x4b')](_0xad7278);var _0x86739f=_[_0x7dc9('0x4c')](_0xad7278);return _0x86739f[_0x7dc9('0x34')]>0x0&&_0x86739f[_0x7dc9('0x34')]<_0xad7278[_0x7dc9('0x34')]?!![]:![];}function isAgentIdle(_0x13580b){if(_0x13580b[_0x7dc9('0x3b')]!=='idle'&&_0x13580b[_0x7dc9('0x49')]){_0x13580b['voiceStatus']='pause';return![];}return _[_0x7dc9('0x4b')]([_0x13580b[_0x7dc9('0x4d')],_0x13580b[_0x7dc9('0x4e')],_0x13580b[_0x7dc9('0x4f')],_0x13580b[_0x7dc9('0x50')],_0x13580b['smsStatus'],_0x13580b[_0x7dc9('0x3b')],_0x13580b[_0x7dc9('0x51')]],isIdle);}function getAgentStatus(_0x34f7b1){var _0x4a9b75=_0x7dc9('0x43');if(isAgentPaused(_0x34f7b1))_0x4a9b75=_0x7dc9('0x52');else if(isAgentPaused(_0x34f7b1,!![]))_0x4a9b75=_0x7dc9('0x53');else if(isAgentIdle(_0x34f7b1))_0x4a9b75=_0x7dc9('0x42');else _0x4a9b75=_0x7dc9('0x31');return _0x4a9b75;}exports[_0x7dc9('0x54')]=function(_0x593132,_0x366b8b){var _0x2ecc80={'count':0x0,'rows':[]},_0x2b0941={},_0x4139e6,_0x877a67,_0x1d252e=[_0x7dc9('0x55'),_0x7dc9('0x41'),_0x7dc9('0x56'),_0x7dc9('0x57'),_0x7dc9('0x58'),'lastPauseAt',_0x7dc9('0x37'),_0x7dc9('0x59'),_0x7dc9('0x45'),_0x7dc9('0x47'),_0x7dc9('0x46'),'smsPause',_0x7dc9('0x4a'),_0x7dc9('0x5a'),_0x7dc9('0x49'),_0x7dc9('0x5b'),_0x7dc9('0x5c'),_0x7dc9('0x5d'),'smsCapacity','whatsappCapacity','faxCapacity',_0x7dc9('0x5e'),_0x7dc9('0x5f'),_0x7dc9('0x60'),_0x7dc9('0x61'),'whatsappCurrentCapacity','faxCurrentCapacity',_0x7dc9('0x4d'),_0x7dc9('0x50'),_0x7dc9('0x4f'),_0x7dc9('0x62'),_0x7dc9('0x51'),_0x7dc9('0x4e'),_0x7dc9('0x3b'),'chatStatusTime',_0x7dc9('0x63'),_0x7dc9('0x64'),_0x7dc9('0x65'),_0x7dc9('0x66'),_0x7dc9('0x67'),'voiceStatusTime',_0x7dc9('0x33'),_0x7dc9('0x68'),_0x7dc9('0x69'),_0x7dc9('0x6a'),_0x7dc9('0x6b'),_0x7dc9('0x6c')],_0x31baf1=[_0x7dc9('0x45'),_0x7dc9('0x47'),_0x7dc9('0x46'),_0x7dc9('0x48'),_0x7dc9('0x4a'),_0x7dc9('0x5a'),_0x7dc9('0x49'),'online'];Promise[_0x7dc9('0x6d')]()['then'](function(){var _0xad5a69=_[_0x7dc9('0x2d')](db['User'][_0x7dc9('0x6e')],function(_0x24d2c7){return{'name':_0x24d2c7['fieldName'],'type':_0x24d2c7[_0x7dc9('0x6f')][_0x7dc9('0x70')]};});_0x593132[_0x7dc9('0x71')]['role']='agent';_0x593132[_0x7dc9('0x71')][_0x7dc9('0x41')]=!![];_0x2b0941=qs[_0x7dc9('0x72')](_0xad5a69,_0x593132);_0x2b0941[_0x7dc9('0x73')]=!![];if(_0x593132[_0x7dc9('0x74')][_0x7dc9('0x75')]===_0x7dc9('0x74')){var _0x3e5e86={'params':{'id':_0x593132[_0x7dc9('0x74')]['userProfileId']},'query':{'section':_0x7dc9('0x10'),'role':_0x7dc9('0x76'),'online':!![],'nolimit':_0x593132[_0x7dc9('0x71')]['nolimit'],'sort':_0x593132['query'][_0x7dc9('0x77')],'filter':_0x593132[_0x7dc9('0x71')][_0x7dc9('0x4c')],'raw':!![]}};return db[_0x7dc9('0x78')]['getResources'](_0x3e5e86);}return db['User'][_0x7dc9('0x79')](_0x2b0941);})[_0x7dc9('0x11')](function(_0x25f8b3){_0x2ecc80[_0x7dc9('0x9')]=_0x25f8b3['count'];_0x4139e6=_0x25f8b3[_0x7dc9('0x7a')];return getRealtimeAgents();})[_0x7dc9('0x11')](function(_0x436b0d){_0x877a67=_0x436b0d[_0x7dc9('0x7a')];return _0x4139e6[_0x7dc9('0x2d')](function(_0x3aa148){var _0x43e96e=_['find'](_0x877a67,['id',_0x3aa148['id']]);if(_0x43e96e)_[_0x7dc9('0x16')](_0x3aa148,_[_0x7dc9('0x7b')](_['omit'](_0x43e96e,_0x31baf1),_0x1d252e));_0x3aa148['globalStatus']=getAgentStatus(_0x3aa148);return _0x3aa148;});})[_0x7dc9('0x11')](function(_0x5e456e){if(_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7c')]){var _0xd99a2=_[_0x7dc9('0x4c')](_0x5e456e,[_0x7dc9('0x7d'),_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7c')]]);if(_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7e')]){_0xd99a2=_[_0x7dc9('0x4c')](_0xd99a2,['pauseType',_0x593132[_0x7dc9('0x71')][_0x7dc9('0x7e')]]);}}_0x2ecc80[_0x7dc9('0x7a')]=_0xd99a2||_0x5e456e;return _0x2ecc80;})['then'](respondWithFilteredResult(_0x366b8b,_0x2b0941))[_0x7dc9('0x17')](handleError(_0x366b8b,null));};exports['getQueues']=function(_0x5904c6,_0x4202ce){var _0x34f6c1=['mail',_0x7dc9('0x7f'),'sms','openchannel',_0x7dc9('0x80'),_0x7dc9('0x81'),_0x7dc9('0x18')];var _0xb8be9={'count':0x0,'rows':[]},_0x56f757={},_0xf9a553,_0xe944a4,_0x222370,_0x38f037,_0xe0071;Promise[_0x7dc9('0x6d')]()[_0x7dc9('0x11')](function(){if(_0x5904c6[_0x7dc9('0x71')]['channel']){if(!_['includes'](_0x34f6c1,_0x5904c6[_0x7dc9('0x71')]['channel'][_0x7dc9('0x82')]()))throw new Error(_0x7dc9('0x83'));_0xf9a553=_0x5904c6[_0x7dc9('0x71')][_0x7dc9('0x84')]['toLowerCase']();}var _0x192b5e=_[_0x7dc9('0x3d')](_0xf9a553)+'Queue';var _0x1b811d=_[_0x7dc9('0x2d')](db[_0x192b5e][_0x7dc9('0x6e')],function(_0x398dfc){return{'name':_0x398dfc['fieldName'],'type':_0x398dfc[_0x7dc9('0x6f')][_0x7dc9('0x70')]};});_0x56f757=qs['getOptions'](_0x1b811d,_0x5904c6);if(_0x5904c6['user'][_0x7dc9('0x75')]===_0x7dc9('0x74')){var _0x49d7ef={'params':{'id':_0x5904c6[_0x7dc9('0x74')]['userProfileId']},'query':{'section':_0xf9a553===_0x7dc9('0x18')&&_0x5904c6[_0x7dc9('0x71')][_0x7dc9('0x6f')]==='outbound'?_0x7dc9('0x85'):_[_0x7dc9('0x3d')](_0xf9a553)+_0x7dc9('0x86'),'type':_0x5904c6['query'][_0x7dc9('0x6f')],'nolimit':!![],'sort':'name','filter':_0x5904c6['query'][_0x7dc9('0x4c')]}};return db[_0x7dc9('0x78')][_0x7dc9('0x87')](_0x49d7ef);}return db[_0x192b5e][_0x7dc9('0x79')](_0x56f757);})[_0x7dc9('0x11')](function(_0x56a00d){_0xb8be9[_0x7dc9('0x9')]=_0x56a00d[_0x7dc9('0x9')];_0xe944a4=_0x56a00d[_0x7dc9('0x7a')];return getRealtimeQueues(_0x5904c6,_0xf9a553);})[_0x7dc9('0x11')](function(_0x33fd00){_0x38f037=_0x33fd00['rows'];return getRealtimeAgents();})[_0x7dc9('0x11')](function(_0x3631c3){_0x222370=_0x3631c3[_0x7dc9('0x7a')];if(_0xf9a553!=_0x7dc9('0x18'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2247ce){_0xe0071=_0x2247ce?_0x2247ce['rows']:[];return initializeQueues(_0xe944a4,_0x38f037,_0xf9a553,_0x5904c6['query'][_0x7dc9('0x6f')]);})['then'](function(_0x21da79){var _0x476a24=_0x21da79[_0x7dc9('0x2d')](function(_0xcf3a6f){if(_0xf9a553===_0x7dc9('0x18'))return getVoiceQueueAgents(_0xcf3a6f,_0xe944a4,_0x222370,_0xe0071);else return getQueueAgents(_0xcf3a6f,_0x222370,_0xf9a553);});return Promise[_0x7dc9('0x88')](_0x476a24);})['then'](function(_0x42d4cc){_0xb8be9[_0x7dc9('0x7a')]=_0x42d4cc;return _0xb8be9;})[_0x7dc9('0x11')](respondWithFilteredResult(_0x4202ce,_0x56f757))[_0x7dc9('0x17')](handleError(_0x4202ce,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 17226d8..2ebcb7f 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x318cc4,_0xca449c){var _0x442ef8=function(_0x5aec19){while(--_0x5aec19){_0x318cc4['push'](_0x318cc4['shift']());}};_0x442ef8(++_0xca449c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2eb828,_0x5b4396){var _0xdb47b7=function(_0x5797cb){while(--_0x5797cb){_0x2eb828['push'](_0x2eb828['shift']());}};_0xdb47b7(++_0x5b4396);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 52978d0..b82c321 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 _0x2d2c=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x4254e7,_0x4fc342){_0x4254e7=_0x4254e7-0x0;var _0x5e0844=_0x2d2c[_0x4254e7];return _0x5e0844;};'use strict';var Sequelize=require(_0xc2d2('0x0'));module[_0xc2d2('0x1')]={'state':{'type':Sequelize[_0xc2d2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc2d2('0x3')]},'scheduledat':{'type':Sequelize[_0xc2d2('0x4')]},'uniqueid':{'type':Sequelize[_0xc2d2('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xc2d2('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc2d2('0x3')]},'campaigntype':{'type':Sequelize[_0xc2d2('0x3')]},'membername':{'type':Sequelize[_0xc2d2('0x3')]}}; \ No newline at end of file +var _0xd7ce=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x2bf7f5,_0x257a76){var _0xd789e0=function(_0x2a314a){while(--_0x2a314a){_0x2bf7f5['push'](_0x2bf7f5['shift']());}};_0xd789e0(++_0x257a76);}(_0xd7ce,0x16b));var _0xed7c=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0xd7ce[_0x1c9c24];return _0x349c69;};'use strict';var Sequelize=require(_0xed7c('0x0'));module[_0xed7c('0x1')]={'state':{'type':Sequelize[_0xed7c('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xed7c('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xed7c('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xed7c('0x3')]},'membername':{'type':Sequelize[_0xed7c('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 77e7e65..51f7700 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 _0x2549=['define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3682a9,_0x26074d){var _0x3796c3=function(_0x2076a5){while(--_0x2076a5){_0x3682a9['push'](_0x3682a9['shift']());}};_0x3796c3(++_0x26074d);}(_0x2549,0x162));var _0x9254=function(_0x19dd1d,_0x4dde81){_0x19dd1d=_0x19dd1d-0x0;var _0x15e732=_0x2549[_0x19dd1d];return _0x15e732;};'use strict';var _=require(_0x9254('0x0'));var util=require(_0x9254('0x1'));var logger=require(_0x9254('0x2'))(_0x9254('0x3'));var moment=require(_0x9254('0x4'));var BPromise=require('bluebird');var rp=require(_0x9254('0x5'));var fs=require('fs');var path=require(_0x9254('0x6'));var rimraf=require(_0x9254('0x7'));var config=require(_0x9254('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x9254('0x9')]=function(_0x3df848,_0x20a9b5){return _0x3df848[_0x9254('0xa')](_0x9254('0xb'),attributes,{'tableName':_0x9254('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcae=['bluebird','request-promise','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x420e43,_0xe54579){var _0x2e9cce=function(_0x107bd1){while(--_0x107bd1){_0x420e43['push'](_0x420e43['shift']());}};_0x2e9cce(++_0xe54579);}(_0xfcae,0x155));var _0xefca=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xfcae[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xefca('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xefca('0x1'));var rp=require(_0xefca('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefca('0x3'));var config=require('../../config/environment');var attributes=require(_0xefca('0x4'));module[_0xefca('0x5')]=function(_0x5b65ea,_0x557ea2){return _0x5b65ea[_0xefca('0x6')](_0xefca('0x7'),attributes,{'tableName':_0xefca('0x8'),'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 b3d5b07..e866481 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 _0x3be8=['stringify','error','message','info','result','catch','CreateReportAgentPreview','ReportAgentPreview','body','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s'];(function(_0x33bbea,_0x4337c5){var _0x516ac2=function(_0x123bbc){while(--_0x123bbc){_0x33bbea['push'](_0x33bbea['shift']());}};_0x516ac2(++_0x4337c5);}(_0x3be8,0x1b9));var _0x83be=function(_0x5d8a70,_0x5d6228){_0x5d8a70=_0x5d8a70-0x0;var _0x4c56a5=_0x3be8[_0x5d8a70];return _0x4c56a5;};'use strict';var _=require(_0x83be('0x0'));var util=require(_0x83be('0x1'));var moment=require(_0x83be('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x83be('0x3'));var db=require(_0x83be('0x4'))['db'];var utils=require(_0x83be('0x5'));var logger=require(_0x83be('0x6'))(_0x83be('0x7'));var config=require(_0x83be('0x8'));var jayson=require(_0x83be('0x9'));var client=jayson[_0x83be('0xa')][_0x83be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14ef0a,_0x511fed,_0x1d23c4){return new BPromise(function(_0x581bef,_0x2f6cd9){return client[_0x83be('0xc')](_0x14ef0a,_0x1d23c4)[_0x83be('0xd')](function(_0x522aaa){logger['info'](_0x83be('0xe'),_0x511fed,_0x83be('0xf'));logger[_0x83be('0x10')](_0x83be('0x11'),_0x511fed,_0x83be('0xf'),JSON[_0x83be('0x12')](_0x522aaa));if(_0x522aaa[_0x83be('0x13')]){if(_0x522aaa['error']['code']===0x1f4){logger['error'](_0x83be('0xe'),_0x511fed,_0x522aaa[_0x83be('0x13')][_0x83be('0x14')]);return _0x2f6cd9(_0x522aaa[_0x83be('0x13')][_0x83be('0x14')]);}logger[_0x83be('0x13')](_0x83be('0xe'),_0x511fed,_0x522aaa[_0x83be('0x13')]['message']);return _0x581bef(_0x522aaa[_0x83be('0x13')][_0x83be('0x14')]);}else{logger[_0x83be('0x15')](_0x83be('0xe'),_0x511fed,_0x83be('0xf'));_0x581bef(_0x522aaa[_0x83be('0x16')]['message']);}})[_0x83be('0x17')](function(_0x5ba20a){logger[_0x83be('0x13')](_0x83be('0xe'),_0x511fed,_0x5ba20a);_0x2f6cd9(_0x5ba20a);});});}exports[_0x83be('0x18')]=function(_0x5d9b8e){var _0x4e98ff=this;return new Promise(function(_0x290064,_0x9351d0){return db[_0x83be('0x19')]['create'](_0x5d9b8e[_0x83be('0x1a')],{'raw':_0x5d9b8e['options']?_0x5d9b8e['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x58f884){logger[_0x83be('0x15')](_0x83be('0x18'),_0x5d9b8e);logger['debug'](_0x83be('0x18'),_0x5d9b8e,JSON[_0x83be('0x12')](_0x58f884));_0x290064(_0x58f884);})[_0x83be('0x17')](function(_0x593d69){logger['error'](_0x83be('0x18'),_0x593d69[_0x83be('0x14')],_0x5d9b8e);_0x9351d0(_0x4e98ff['error'](0x1f4,_0x593d69[_0x83be('0x14')]));});});}; \ No newline at end of file +var _0xcfd4=['ReportAgentPreview','body','CreateReportAgentPreview','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x564d22,_0x5db59b){var _0x23d8c0=function(_0x5cc980){while(--_0x5cc980){_0x564d22['push'](_0x564d22['shift']());}};_0x23d8c0(++_0x5db59b);}(_0xcfd4,0x1b3));var _0x4cfd=function(_0x24c60f,_0x250fae){_0x24c60f=_0x24c60f-0x0;var _0x54ef37=_0xcfd4[_0x24c60f];return _0x54ef37;};'use strict';var _=require(_0x4cfd('0x0'));var util=require(_0x4cfd('0x1'));var moment=require(_0x4cfd('0x2'));var BPromise=require(_0x4cfd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cfd('0x4'));var db=require(_0x4cfd('0x5'))['db'];var utils=require(_0x4cfd('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x4cfd('0x7'));var jayson=require(_0x4cfd('0x8'));var client=jayson[_0x4cfd('0x9')][_0x4cfd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1cab96,_0x63afe4,_0x167daa){return new BPromise(function(_0x2491f4,_0x4dc0b5){return client[_0x4cfd('0xb')](_0x1cab96,_0x167daa)[_0x4cfd('0xc')](function(_0xc0a076){logger[_0x4cfd('0xd')](_0x4cfd('0xe'),_0x63afe4,_0x4cfd('0xf'));logger[_0x4cfd('0x10')](_0x4cfd('0x11'),_0x63afe4,_0x4cfd('0xf'),JSON[_0x4cfd('0x12')](_0xc0a076));if(_0xc0a076[_0x4cfd('0x13')]){if(_0xc0a076[_0x4cfd('0x13')][_0x4cfd('0x14')]===0x1f4){logger[_0x4cfd('0x13')](_0x4cfd('0xe'),_0x63afe4,_0xc0a076[_0x4cfd('0x13')][_0x4cfd('0x15')]);return _0x4dc0b5(_0xc0a076['error'][_0x4cfd('0x15')]);}logger['error'](_0x4cfd('0xe'),_0x63afe4,_0xc0a076[_0x4cfd('0x13')][_0x4cfd('0x15')]);return _0x2491f4(_0xc0a076[_0x4cfd('0x13')][_0x4cfd('0x15')]);}else{logger[_0x4cfd('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x63afe4,_0x4cfd('0xf'));_0x2491f4(_0xc0a076[_0x4cfd('0x16')][_0x4cfd('0x15')]);}})[_0x4cfd('0x17')](function(_0x465758){logger[_0x4cfd('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x63afe4,_0x465758);_0x4dc0b5(_0x465758);});});}exports['CreateReportAgentPreview']=function(_0x5efe3c){var _0x4f6457=this;return new Promise(function(_0x27156a,_0xf8fedd){return db[_0x4cfd('0x18')]['create'](_0x5efe3c[_0x4cfd('0x19')],{'raw':_0x5efe3c['options']?_0x5efe3c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x103bf2){logger[_0x4cfd('0xd')](_0x4cfd('0x1a'),_0x5efe3c);logger[_0x4cfd('0x10')]('CreateReportAgentPreview',_0x5efe3c,JSON[_0x4cfd('0x12')](_0x103bf2));_0x27156a(_0x103bf2);})['catch'](function(_0xdde7cc){logger['error']('CreateReportAgentPreview',_0xdde7cc[_0x4cfd('0x15')],_0x5efe3c);_0xf8fedd(_0x4f6457['error'](0x1f4,_0xdde7cc[_0x4cfd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index a42382e..3305515 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 _0x39b9=['/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','get','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','/agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','/campaigns','campaigns','faxAccounts','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0x39b9,0x14d));var _0x939b=function(_0x1a92a6,_0x37d0a8){_0x1a92a6=_0x1a92a6-0x0;var _0x7870e4=_0x39b9[_0x1a92a6];return _0x7870e4;};'use strict';var multer=require(_0x939b('0x0'));var util=require('util');var path=require(_0x939b('0x1'));var express=require(_0x939b('0x2'));var router=express[_0x939b('0x3')]();var auth=require(_0x939b('0x4'));var controller=require(_0x939b('0x5'));router['get'](_0x939b('0x6'),auth[_0x939b('0x7')](),controller[_0x939b('0x8')]);router['get'](_0x939b('0x9'),auth[_0x939b('0x7')](),controller['voiceChannelMixMonitor']);router[_0x939b('0xa')](_0x939b('0xb'),auth[_0x939b('0x7')](),controller[_0x939b('0xc')]);router[_0x939b('0xa')](_0x939b('0xd'),auth['isAuthenticated'](),controller[_0x939b('0xe')]);router[_0x939b('0xa')]('/chat/queues',auth[_0x939b('0x7')](),controller['chatQueues']);router[_0x939b('0xa')](_0x939b('0xf'),auth[_0x939b('0x7')](),controller['mailQueues']);router['get'](_0x939b('0x10'),auth[_0x939b('0x7')](),controller[_0x939b('0x11')]);router[_0x939b('0xa')](_0x939b('0x12'),auth['isAuthenticated'](),controller[_0x939b('0x13')]);router[_0x939b('0xa')](_0x939b('0x14'),auth[_0x939b('0x7')](),controller[_0x939b('0x15')]);router['get'](_0x939b('0x16'),auth[_0x939b('0x7')](),controller[_0x939b('0x17')]);router[_0x939b('0xa')](_0x939b('0x18'),auth[_0x939b('0x7')](),controller[_0x939b('0x19')]);router[_0x939b('0xa')](_0x939b('0x1a'),auth[_0x939b('0x7')](),controller[_0x939b('0x1b')]);router[_0x939b('0xa')](_0x939b('0x1c'),auth['isAuthenticated'](),controller[_0x939b('0x1d')]);router[_0x939b('0xa')](_0x939b('0x1e'),auth[_0x939b('0x7')](),controller['voiceQueuesChannel']);router[_0x939b('0xa')](_0x939b('0x1f'),auth[_0x939b('0x7')](),controller[_0x939b('0x20')]);router['get'](_0x939b('0x21'),auth[_0x939b('0x7')](),controller[_0x939b('0x22')]);router[_0x939b('0xa')](_0x939b('0x23'),auth[_0x939b('0x7')](),controller[_0x939b('0x24')]);router['put'](_0x939b('0x23'),auth[_0x939b('0x7')](),controller[_0x939b('0x25')]);router[_0x939b('0xa')]('/outbound',auth['isAuthenticated'](),controller[_0x939b('0x26')]);router['get'](_0x939b('0x27'),auth[_0x939b('0x7')](),controller['outboundChannels']);router[_0x939b('0xa')](_0x939b('0x28'),auth[_0x939b('0x7')](),controller['agents']);router[_0x939b('0x29')](_0x939b('0x2a'),auth['isAuthenticated'](),controller[_0x939b('0x2b')]);router[_0x939b('0xa')]('/telephones',auth[_0x939b('0x7')](),controller[_0x939b('0x2c')]);router[_0x939b('0xa')](_0x939b('0x2d'),auth[_0x939b('0x7')](),controller['trunks']);router[_0x939b('0xa')](_0x939b('0x2e'),auth[_0x939b('0x7')](),controller[_0x939b('0x2f')]);router[_0x939b('0xa')]('/fax/accounts',auth[_0x939b('0x7')](),controller[_0x939b('0x30')]);router['get']('/chat/queues/waitinginteractions',auth[_0x939b('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0x939b('0xa')](_0x939b('0x31'),auth[_0x939b('0x7')](),controller[_0x939b('0x32')]);router[_0x939b('0xa')](_0x939b('0x33'),auth[_0x939b('0x7')](),controller[_0x939b('0x34')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0x939b('0x7')](),controller[_0x939b('0x35')]);router[_0x939b('0xa')](_0x939b('0x36'),auth[_0x939b('0x7')](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth[_0x939b('0x7')](),controller[_0x939b('0x37')]);router[_0x939b('0xa')](_0x939b('0x38'),auth[_0x939b('0x7')](),controller[_0x939b('0x39')]);router[_0x939b('0x3a')](_0x939b('0x3b'),auth[_0x939b('0x7')](),controller[_0x939b('0x3c')](_0x939b('0x3d')));router[_0x939b('0xa')](_0x939b('0x3e'),auth[_0x939b('0x7')](),controller[_0x939b('0x3f')]);router[_0x939b('0x3a')](_0x939b('0x40'),auth[_0x939b('0x7')](),controller['queueNotify'](_0x939b('0x41')));router[_0x939b('0xa')](_0x939b('0x42'),auth['isAuthenticated'](),controller[_0x939b('0x43')]);router[_0x939b('0x3a')]('/fax/queues/:id/notify',auth[_0x939b('0x7')](),controller['queueNotify'](_0x939b('0x44')));router['get']('/fax/queues/:id',auth['isAuthenticated'](),controller[_0x939b('0x45')]);router[_0x939b('0x3a')](_0x939b('0x46'),auth['isAuthenticated'](),controller['queueNotify'](_0x939b('0x47')));router[_0x939b('0xa')](_0x939b('0x48'),auth['isAuthenticated'](),controller[_0x939b('0x49')]);router[_0x939b('0x3a')]('/sms/queues/:id/notify',auth[_0x939b('0x7')](),controller[_0x939b('0x3c')](_0x939b('0x4a')));router[_0x939b('0x3a')](_0x939b('0x4b'),auth[_0x939b('0x7')](),controller[_0x939b('0x3c')](_0x939b('0x4c')));router[_0x939b('0xa')]('/sms/queues/:id',auth[_0x939b('0x7')](),controller[_0x939b('0x4d')]);router[_0x939b('0xa')](_0x939b('0x4e'),auth[_0x939b('0x7')](),controller['showWhatsappQueues']);router[_0x939b('0x3a')]('/agents/:id/notify',auth[_0x939b('0x7')](),controller[_0x939b('0x4f')]);module[_0x939b('0x50')]=router; \ No newline at end of file +var _0xe079=['/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','/outbound','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/sms/queues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xe079,0xca));var _0x9e07=function(_0x4a8bdf,_0x481b42){_0x4a8bdf=_0x4a8bdf-0x0;var _0x456ce3=_0xe079[_0x4a8bdf];return _0x456ce3;};'use strict';var multer=require(_0x9e07('0x0'));var util=require(_0x9e07('0x1'));var path=require(_0x9e07('0x2'));var express=require('express');var router=express[_0x9e07('0x3')]();var auth=require(_0x9e07('0x4'));var controller=require(_0x9e07('0x5'));router[_0x9e07('0x6')]('/voice/channels',auth[_0x9e07('0x7')](),controller[_0x9e07('0x8')]);router[_0x9e07('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x9e07('0x7')](),controller[_0x9e07('0x9')]);router[_0x9e07('0x6')](_0x9e07('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x9e07('0x6')]('/voice/queues',auth[_0x9e07('0x7')](),controller[_0x9e07('0xb')]);router[_0x9e07('0x6')](_0x9e07('0xc'),auth[_0x9e07('0x7')](),controller[_0x9e07('0xd')]);router['get'](_0x9e07('0xe'),auth['isAuthenticated'](),controller[_0x9e07('0xf')]);router[_0x9e07('0x6')]('/mail/accounts',auth[_0x9e07('0x7')](),controller[_0x9e07('0x10')]);router['get']('/openchannel/queues',auth[_0x9e07('0x7')](),controller['openchannelQueues']);router['get'](_0x9e07('0x11'),auth[_0x9e07('0x7')](),controller['smsQueues']);router[_0x9e07('0x6')](_0x9e07('0x12'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x13')]);router[_0x9e07('0x6')]('/fax/queues',auth[_0x9e07('0x7')](),controller[_0x9e07('0x14')]);router[_0x9e07('0x6')](_0x9e07('0x15'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x16')]);router['get'](_0x9e07('0x17'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x18')]);router['get'](_0x9e07('0x19'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x1a')]);router[_0x9e07('0x6')](_0x9e07('0x1b'),auth['isAuthenticated'](),controller[_0x9e07('0x1c')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x9e07('0x7')](),controller[_0x9e07('0x1d')]);router[_0x9e07('0x6')]('/voice/queues/:id',auth['isAuthenticated'](),controller['showVoiceQueues']);router['put'](_0x9e07('0x1e'),auth[_0x9e07('0x7')](),controller['updateVoiceQueue']);router['get'](_0x9e07('0x1f'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x20')]);router[_0x9e07('0x6')]('/outbound/channels',auth[_0x9e07('0x7')](),controller[_0x9e07('0x21')]);router[_0x9e07('0x6')](_0x9e07('0x22'),auth['isAuthenticated'](),controller[_0x9e07('0x23')]);router[_0x9e07('0x24')](_0x9e07('0x25'),auth[_0x9e07('0x7')](),controller['agentCapacity']);router[_0x9e07('0x6')]('/telephones',auth[_0x9e07('0x7')](),controller['telephones']);router['get'](_0x9e07('0x26'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x27')]);router[_0x9e07('0x6')](_0x9e07('0x28'),auth[_0x9e07('0x7')](),controller['campaigns']);router[_0x9e07('0x6')](_0x9e07('0x29'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x2a')]);router['get'](_0x9e07('0x2b'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x2c')]);router[_0x9e07('0x6')]('/mail/queues/waitinginteractions',auth[_0x9e07('0x7')](),controller[_0x9e07('0x2d')]);router[_0x9e07('0x6')](_0x9e07('0x2e'),auth['isAuthenticated'](),controller[_0x9e07('0x2f')]);router[_0x9e07('0x6')](_0x9e07('0x30'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x31')]);router[_0x9e07('0x6')](_0x9e07('0x32'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x33')]);router[_0x9e07('0x6')](_0x9e07('0x34'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x35')]);router[_0x9e07('0x6')](_0x9e07('0x36'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x37')]);router[_0x9e07('0x38')](_0x9e07('0x39'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x3a')]('mail'));router[_0x9e07('0x6')](_0x9e07('0x3b'),auth[_0x9e07('0x7')](),controller['showMailQueues']);router[_0x9e07('0x38')]('/chat/queues/:id/notify',auth[_0x9e07('0x7')](),controller[_0x9e07('0x3a')](_0x9e07('0x3c')));router[_0x9e07('0x6')](_0x9e07('0x3d'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x3e')]);router[_0x9e07('0x38')]('/fax/queues/:id/notify',auth[_0x9e07('0x7')](),controller[_0x9e07('0x3a')]('fax'));router[_0x9e07('0x6')](_0x9e07('0x3f'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x40')]);router['post'](_0x9e07('0x41'),auth[_0x9e07('0x7')](),controller['queueNotify']('openchannel'));router[_0x9e07('0x6')](_0x9e07('0x42'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0x9e07('0x38')]('/sms/queues/:id/notify',auth[_0x9e07('0x7')](),controller['queueNotify'](_0x9e07('0x43')));router[_0x9e07('0x38')](_0x9e07('0x44'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x3a')](_0x9e07('0x45')));router['get'](_0x9e07('0x46'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x47')]);router['get']('/whatsapp/queues/:id',auth[_0x9e07('0x7')](),controller['showWhatsappQueues']);router['post'](_0x9e07('0x48'),auth[_0x9e07('0x7')](),controller[_0x9e07('0x49')]);module[_0x9e07('0x4a')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 58e7954..989bbbb 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 _0x425d=['http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','isNil','rows','find','query','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','length','format','updateAttributes','findOrCreate','INTERACTION','interface','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','Telephones','trunks','campaigns','Campaigns','ChatQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','TransferReport','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','update','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client'];(function(_0x1e43e8,_0x533eab){var _0x59cc5b=function(_0x5f4b90){while(--_0x5f4b90){_0x1e43e8['push'](_0x1e43e8['shift']());}};_0x59cc5b(++_0x533eab);}(_0x425d,0x1e0));var _0xd425=function(_0x3c73d1,_0x2c5b98){_0x3c73d1=_0x3c73d1-0x0;var _0x200bba=_0x425d[_0x3c73d1];return _0x200bba;};'use strict';var BPromise=require(_0xd425('0x0'));var moment=require('moment');var _=require(_0xd425('0x1'));var util=require(_0xd425('0x2'));var db=require(_0xd425('0x3'))['db'];var logger=require(_0xd425('0x4'))(_0xd425('0x5'));var jayson=require(_0xd425('0x6'));var amiClient=jayson[_0xd425('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232b});var routingClient=jayson[_0xd425('0x7')][_0xd425('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1d97d9,_0x1d2ed0,_0x50b061){return new BPromise(function(_0xb6ba8e,_0x374c3d){var _0x262b02=_0x50b061?_0x50b061:amiClient;return _0x262b02[_0xd425('0x9')](_0x1d97d9,_0x1d2ed0)[_0xd425('0xa')](function(_0x2beb20){if(_0x2beb20[_0xd425('0xb')]){if(_0x2beb20[_0xd425('0xb')][_0xd425('0xc')]===0x1f4){return _0x374c3d(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}return _0xb6ba8e(_0x2beb20[_0xd425('0xb')][_0xd425('0xd')]);}else{_0xb6ba8e(_0x2beb20[_0xd425('0xe')]);}})[_0xd425('0xf')](function(_0x2385a5){_0x374c3d(_0x2385a5);});});}function respondWithResult(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xc8;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x10')](_0x3cacf7)['json'](_0x3b5de8);}return _0x9bb611[_0xd425('0x11')](0x194);};}function handleError(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0x1f4;return function(_0x5d3d60){logger[_0xd425('0xb')](_0x5d3d60[_0xd425('0x12')]);if(_0x5d3d60[_0xd425('0x13')]){delete _0x5d3d60[_0xd425('0x13')];}_0x17a498[_0xd425('0x10')](_0x336dc3)['send'](_0x5d3d60);};}function findById(_0x278626){return function(_0x471267){if(!_[_0xd425('0x14')](_0x278626)&&!_[_0xd425('0x14')](_0x471267)&&!_['isNil'](_0x471267[_0xd425('0x15')])){return _[_0xd425('0x16')](_0x471267[_0xd425('0x15')],function(_0x1155bc){return _0x1155bc['id']==_0x278626;});}return null;};}exports['voiceChannels']=function(_0x58a0c1,_0x5debc3){return respondWithRpcPromise('VoiceChannels',_0x58a0c1[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x5debc3,null))[_0xd425('0xf')](handleError(_0x5debc3,null));};exports['voiceChannelMixMonitor']=function(_0x355af0,_0x7e982e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xd425('0x18')](_0x355af0[_0xd425('0x17')],_0x355af0[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x7e982e,null))[_0xd425('0xf')](handleError(_0x7e982e,null));};exports[_0xd425('0x1a')]=function(_0x2480a0,_0x3500bb){return respondWithRpcPromise(_0xd425('0x1b'),_[_0xd425('0x18')](_0x2480a0[_0xd425('0x17')],_0x2480a0[_0xd425('0x19')]))['then'](respondWithResult(_0x3500bb,null))[_0xd425('0xf')](handleError(_0x3500bb,null));};exports[_0xd425('0x1c')]=function(_0x398985,_0x1908a5){return respondWithRpcPromise(_0xd425('0x1d'),_0x398985[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x1908a5,null))['catch'](handleError(_0x1908a5,null));};exports[_0xd425('0x1e')]=function(_0x177de2,_0x1d8861){return respondWithRpcPromise('VoiceQueues',_0x177de2[_0xd425('0x17')])[_0xd425('0xa')](findById(_0x177de2[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x1d8861,null))[_0xd425('0xf')](handleError(_0x1d8861,null));};exports[_0xd425('0x1f')]=function(_0x2fd17a,_0x37b63c){return respondWithRpcPromise(_0xd425('0x20'),_[_0xd425('0x18')](_0x2fd17a['body'],_0x2fd17a[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x37b63c,null))[_0xd425('0xf')](handleError(_0x37b63c,null));};exports[_0xd425('0x21')]=function(_0x3275b1,_0x1abf33){return respondWithRpcPromise(_0xd425('0x22'),_[_0xd425('0x18')](_0x3275b1[_0xd425('0x17')],_0x3275b1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x1abf33,null))['catch'](handleError(_0x1abf33,null));};exports[_0xd425('0x23')]=function(_0x2a2a9b,_0x3120a4){return respondWithRpcPromise(_0xd425('0x24'),_0x2a2a9b[_0xd425('0x17')])['then'](respondWithResult(_0x3120a4,null))[_0xd425('0xf')](handleError(_0x3120a4,null));};exports[_0xd425('0x25')]=function(_0x4cfcd1,_0x574962){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xd425('0x18')](_0x4cfcd1[_0xd425('0x17')],_0x4cfcd1[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x574962,null))['catch'](handleError(_0x574962,null));};exports[_0xd425('0x26')]=function(_0x1d4414,_0x30a9dc){return respondWithRpcPromise(_0xd425('0x27'),_[_0xd425('0x18')](_0x1d4414[_0xd425('0x17')],_0x1d4414[_0xd425('0x19')]))['then'](respondWithResult(_0x30a9dc,null))[_0xd425('0xf')](handleError(_0x30a9dc,null));};exports['voiceQueuesChannelRedirect']=function(_0x22df81,_0x29cca9){return respondWithRpcPromise(_0xd425('0x28'),_['merge'](_0x22df81[_0xd425('0x17')],_0x22df81[_0xd425('0x19')]))[_0xd425('0xa')](respondWithResult(_0x29cca9,null))[_0xd425('0xf')](handleError(_0x29cca9,null));};exports['outbound']=function(_0x1d38fa,_0x3cf540){return respondWithRpcPromise('Outbound',_0x1d38fa['query'])['then'](respondWithResult(_0x3cf540,null))[_0xd425('0xf')](handleError(_0x3cf540,null));};exports[_0xd425('0x29')]=function(_0x1f30c1,_0x588688){return respondWithRpcPromise('OutboundChannels',_0x1f30c1['query'])[_0xd425('0xa')](respondWithResult(_0x588688,null))[_0xd425('0xf')](handleError(_0x588688,null));};exports[_0xd425('0x2a')]=function(_0x1d5017,_0xa9fd7c){var _0x14f3be;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'])[_0xd425('0xa')](function(_0x3c88a8){_0x14f3be=_0x3c88a8;return respondWithRpcPromise(_0xd425('0x2b'),_0x1d5017['query'],routingClient);})[_0xd425('0xa')](function(_0x2dffc7){return _[_0xd425('0x18')]({},_0x2dffc7,_0x14f3be);})['then'](respondWithResult(_0xa9fd7c,null))[_0xd425('0xf')](handleError(_0xa9fd7c,null));};exports[_0xd425('0x2c')]=function(_0x1c5ba6,_0x2d7a2f){if(_0x1c5ba6['body']&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]&&_0x1c5ba6[_0xd425('0x2f')]&&_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]){for(var _0x2f6bf7 in _0x1c5ba6[_0xd425('0x2d')]['interaction']){if(_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')]['hasOwnProperty'](_0x2f6bf7)){db[_0xd425('0x30')]['findAll']({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6['user'][_0xd425('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1c5ba6[_0xd425('0x2d')]['interaction'][_0x2f6bf7]&&_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')]?{'$notIn':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7]}:{'$ne':null}}})['then'](function(_0x2e4b21){var _0x5f3cfd=moment()[_0xd425('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x78ed9b=0x0,_0x16f61c=_0x2e4b21[_0xd425('0x31')];_0x78ed9b<_0x16f61c;_0x78ed9b+=0x1){_0x2e4b21[_0x78ed9b][_0xd425('0x33')]({'exitAt':_0x5f3cfd});}});for(var _0x624543=0x0;_0x624543<_0x1c5ba6['body'][_0xd425('0x2e')][_0x2f6bf7][_0xd425('0x31')];_0x624543+=0x1){db[_0xd425('0x30')][_0xd425('0x34')]({'where':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')]['name'],'type':_0xd425('0x35'),'uniqueid':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x2e')][_0x2f6bf7][_0x624543],'exitAt':null},'defaults':{'channel':_0x2f6bf7,'membername':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')],'interface':_[_0xd425('0x14')](_0x1c5ba6['user'][_0xd425('0x36')])?util[_0xd425('0x32')]('SIP/%s',_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x13')]):_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x36')],'type':'INTERACTION','enterAt':moment()[_0xd425('0x32')](_0xd425('0x37')),'role':_0xd425('0x38'),'internal':_0x1c5ba6[_0xd425('0x2f')][_0xd425('0x39')],'uniqueid':_0x1c5ba6['body']['interaction'][_0x2f6bf7][_0x624543]}});}}}}return respondWithRpcPromise(_0xd425('0x3a'),{'id':_0x1c5ba6['params']['id'],'capacity':_0x1c5ba6[_0xd425('0x2d')][_0xd425('0x3b')]},routingClient)['then'](respondWithResult(_0x2d7a2f,null))[_0xd425('0xf')](handleError(_0x2d7a2f,null));};exports['telephones']=function(_0x48d5b8,_0x39f588){return respondWithRpcPromise(_0xd425('0x3c'),_0x48d5b8[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x39f588,null))[_0xd425('0xf')](handleError(_0x39f588,null));};exports[_0xd425('0x3d')]=function(_0xeb3586,_0x4118fe){return respondWithRpcPromise('Trunks',_0xeb3586[_0xd425('0x17')])[_0xd425('0xa')](respondWithResult(_0x4118fe,null))[_0xd425('0xf')](handleError(_0x4118fe,null));};exports[_0xd425('0x3e')]=function(_0x7b1080,_0x1c80c2){return respondWithRpcPromise(_0xd425('0x3f'),_0x7b1080[_0xd425('0x17')])['then'](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['chatQueues']=function(_0x145e76,_0x2c5d01){return respondWithRpcPromise(_0xd425('0x40'),_0x145e76[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x2c5d01,null))['catch'](handleError(_0x2c5d01,null));};exports['showChatQueues']=function(_0x5e1294,_0x254b8b){return respondWithRpcPromise(_0xd425('0x40'),_0x5e1294['query'],routingClient)[_0xd425('0xa')](findById(_0x5e1294[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x254b8b,null))['catch'](handleError(_0x254b8b,null));};exports['mailQueues']=function(_0x599cb5,_0x49d75e){return respondWithRpcPromise('MailQueues',_0x599cb5['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x49d75e,null))[_0xd425('0xf')](handleError(_0x49d75e,null));};exports[_0xd425('0x41')]=function(_0x5b2323,_0x3395d8){return respondWithRpcPromise('MailQueues',_0x5b2323[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5b2323[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x3395d8,null))[_0xd425('0xf')](handleError(_0x3395d8,null));};exports[_0xd425('0x42')]=function(_0xa21f7c,_0x3ca6a6){return respondWithRpcPromise(_0xd425('0x43'),_0xa21f7c['query'],mailClient)[_0xd425('0xa')](respondWithResult(_0x3ca6a6,null))[_0xd425('0xf')](handleError(_0x3ca6a6,null));};exports[_0xd425('0x44')]=function(_0xf22906,_0x5c4df8){return respondWithRpcPromise('OpenchannelQueues',_0xf22906[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5c4df8,null))[_0xd425('0xf')](handleError(_0x5c4df8,null));};exports[_0xd425('0x45')]=function(_0x464ed1,_0x2e0f00){return respondWithRpcPromise(_0xd425('0x46'),_0x464ed1[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x464ed1[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x2e0f00,null))[_0xd425('0xf')](handleError(_0x2e0f00,null));};exports[_0xd425('0x47')]=function(_0x28979e,_0x5e72db){return respondWithRpcPromise(_0xd425('0x48'),_0x28979e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5e72db,null))['catch'](handleError(_0x5e72db,null));};exports['showSmsQueues']=function(_0x5ade1a,_0x403cb3){return respondWithRpcPromise(_0xd425('0x48'),_0x5ade1a[_0xd425('0x17')],routingClient)['then'](findById(_0x5ade1a[_0xd425('0x19')]['id']))['then'](respondWithResult(_0x403cb3,null))[_0xd425('0xf')](handleError(_0x403cb3,null));};exports[_0xd425('0x49')]=function(_0x21d26e,_0x5113fc){return respondWithRpcPromise(_0xd425('0x4a'),_0x21d26e[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5113fc,null))[_0xd425('0xf')](handleError(_0x5113fc,null));};exports[_0xd425('0x4b')]=function(_0x43b1a9,_0x38a762){return respondWithRpcPromise(_0xd425('0x4a'),_0x43b1a9[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x43b1a9[_0xd425('0x19')]['id']))[_0xd425('0xa')](respondWithResult(_0x38a762,null))[_0xd425('0xf')](handleError(_0x38a762,null));};exports[_0xd425('0x4c')]=function(_0x445f98,_0x443126){return respondWithRpcPromise(_0xd425('0x4d'),_0x445f98[_0xd425('0x17')],routingClient)['then'](respondWithResult(_0x443126,null))['catch'](handleError(_0x443126,null));};exports[_0xd425('0x4e')]=function(_0x5c333a,_0x135048){return respondWithRpcPromise(_0xd425('0x4d'),_0x5c333a[_0xd425('0x17')],routingClient)[_0xd425('0xa')](findById(_0x5c333a['params']['id']))[_0xd425('0xa')](respondWithResult(_0x135048,null))[_0xd425('0xf')](handleError(_0x135048,null));};exports[_0xd425('0x4f')]=function(_0x689332,_0x2536bd){return respondWithRpcPromise(_0xd425('0x50'),_0x689332['query'])['then'](respondWithResult(_0x2536bd,null))[_0xd425('0xf')](handleError(_0x2536bd,null));};exports[_0xd425('0x51')]=function(_0x5e76f5,_0x174081){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5e76f5[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x174081,null))[_0xd425('0xf')](handleError(_0x174081,null));};exports[_0xd425('0x52')]=function(_0x376134,_0x2514fa){return respondWithRpcPromise(_0xd425('0x53'),_0x376134['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x2514fa,null))[_0xd425('0xf')](handleError(_0x2514fa,null));};exports[_0xd425('0x54')]=function(_0x233efa,_0xfcba08){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x233efa[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0xfcba08,null))['catch'](handleError(_0xfcba08,null));};exports[_0xd425('0x55')]=function(_0x4599b0,_0x48bed3){return respondWithRpcPromise(_0xd425('0x56'),_0x4599b0[_0xd425('0x17')],routingClient)[_0xd425('0xa')](function(_0xd923bb){if(_0x4599b0[_0xd425('0x17')]['type']!==undefined){var _0x454cce=_(_0xd923bb['rows'])[_0xd425('0x57')]([_0x4599b0[_0xd425('0x17')]['type'],_0x4599b0[_0xd425('0x19')]['id']])[_0xd425('0x58')](_0xd425('0x59'))[_0xd425('0x5a')]()['value']();return _0xd923bb['rows'][_0xd425('0x57')](function(_0x2312c1){return _0x454cce[_0xd425('0x5b')](_0x2312c1['queue_id'])>-0x1;});}else{return _0xd923bb[_0xd425('0x15')][_0xd425('0x57')](function(_0x5b932c){return _0x5b932c[_0xd425('0x59')]===parseInt(_0x4599b0['params']['id']);});}})[_0xd425('0xa')](respondWithResult(_0x48bed3,null))[_0xd425('0xf')](handleError(_0x48bed3,null));};exports[_0xd425('0x5c')]=function(_0x2493e7,_0x5750dc){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2493e7[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x5750dc,null))['catch'](handleError(_0x5750dc,null));};exports[_0xd425('0x5d')]=function(_0x389099,_0x51c9ad){return respondWithRpcPromise(_0xd425('0x5e'),_0x389099[_0xd425('0x17')],routingClient)[_0xd425('0xa')](respondWithResult(_0x51c9ad,null))[_0xd425('0xf')](handleError(_0x51c9ad,null));};exports[_0xd425('0x5f')]=function(_0xf251e6,_0x302066){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0xf251e6['query'],routingClient)[_0xd425('0xa')](respondWithResult(_0x302066,null))['catch'](handleError(_0x302066,null));};exports[_0xd425('0x60')]=function(_0x236030){return function(_0x58cad5,_0x244789){var _0x1c1c77,_0x5dac05;var _0x592c40=_[_0xd425('0x61')](_0x236030);var _0x242ed8=_0x236030===_0xd425('0x62')?_0xd425('0x63'):_0xd425('0x64');return db[_0x592c40+_0xd425('0x65')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x58cad5[_0xd425('0x19')]['id']}})['then'](function(_0x2cff42){if(_[_0xd425('0x14')](_0x2cff42)){throw new Error(_0x592c40+'\x20Queue\x20not\x20found');}_0x1c1c77=_0x2cff42;return db[_0x592c40+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x58cad5[_0xd425('0x2d')][_0xd425('0x68')]},'include':[{'model':db[_0x592c40+_0xd425('0x69')],'as':_0xd425('0x69')},{'model':db[_0x592c40+_0x242ed8],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0x334062){if(_[_0xd425('0x14')](_0x334062)){throw new Error(_0x592c40+_0xd425('0x6a'));}_0x5dac05=_0x334062;return _0x334062['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd425('0xa')](function(){var _0x498e81={'uniqueid':_0x236030+'.'+_0x5dac05['id']+'.'+_0x5dac05['Interaction']['id'],'FromUserId':_0x58cad5[_0xd425('0x2f')]['id'],'type':'queue'};_0x498e81[_0x592c40+_0xd425('0x6b')]=_0x5dac05['id'];_0x498e81[_0x592c40+_0xd425('0x6c')]=_0x5dac05[_0xd425('0x69')]['id'];_0x498e81[_0xd425('0x6d')+_0x592c40+_0x242ed8+'Id']=_0x5dac05[_0xd425('0x64')]['id'];_0x498e81['To'+_0x592c40+_0xd425('0x6e')]=_0x1c1c77['id'];return db[_0x592c40+_0xd425('0x6f')]['create'](_0x498e81);})[_0xd425('0xa')](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x236030,'interaction':_0x5dac05[_0xd425('0x69')],'message':_0x5dac05,'account':_0x5dac05[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x71'),'appdata':_0x1c1c77['name']+','+(_0x5dac05[_0xd425('0x64')][_0xd425('0x72')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})[_0xd425('0xa')](respondWithResult(_0x244789,null))[_0xd425('0xf')](handleError(_0x244789,null));};};exports[_0xd425('0x74')]=function(_0x409612,_0x4147eb){var _0x433e5d,_0x334226;if(_[_0xd425('0x14')](_0x409612[_0xd425('0x2d')]['channel'])){throw new Error(_0xd425('0x75'));}var _0x5d8a47=_0x409612[_0xd425('0x2d')][_0xd425('0x76')];var _0x1c03d6=_[_0xd425('0x61')](_0x5d8a47);var _0xf06395=_0x5d8a47==='chat'?_0xd425('0x63'):_0xd425('0x64');return db[_0xd425('0x77')][_0xd425('0x66')]({'raw':!![],'where':{'id':_0x409612[_0xd425('0x19')]['id'],'role':_0xd425('0x38')}})[_0xd425('0xa')](function(_0x568a83){if(_[_0xd425('0x14')](_0x568a83)){throw new Error('Agent\x20not\x20found');}_0x433e5d=_0x568a83;return db[_0x1c03d6+_0xd425('0x67')][_0xd425('0x66')]({'where':{'id':_0x409612['body'][_0xd425('0x68')]},'include':[{'model':db[_0x1c03d6+_0xd425('0x69')],'as':'Interaction'},{'model':db[_0x1c03d6+_0xf06395],'as':_0xd425('0x64')}]});})[_0xd425('0xa')](function(_0xca2955){if(_[_0xd425('0x14')](_0xca2955)){throw new Error(_0x1c03d6+_0xd425('0x6a'));}_0x334226=_0xca2955;return _0xca2955[_0xd425('0x78')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3f1a48={'uniqueid':_0x5d8a47+'.'+_0x334226['id']+'.'+_0x334226['Interaction']['id'],'FromUserId':_0x409612[_0xd425('0x2f')]['id'],'type':'queue','ToUserId':_0x433e5d['id']};_0x3f1a48[_0x1c03d6+_0xd425('0x6b')]=_0x334226['id'];_0x3f1a48[_0x1c03d6+_0xd425('0x6c')]=_0x334226[_0xd425('0x69')]['id'];_0x3f1a48[_0xd425('0x6d')+_0x1c03d6+_0xf06395+'Id']=_0x334226['Account']['id'];return db[_0x1c03d6+'TransferReport']['create'](_0x3f1a48);})['then'](function(){return respondWithRpcPromise(_0xd425('0x70'),{'channel':_0x5d8a47,'interaction':_0x334226['Interaction'],'message':_0x334226,'account':_0x334226[_0xd425('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd425('0x38'),'appdata':_0x433e5d[_0xd425('0x13')]+','+(_0x334226[_0xd425('0x64')][_0xd425('0x79')]||0x12c),'interval':_0xd425('0x73')}]},routingClient);})['then'](respondWithResult(_0x4147eb,null))[_0xd425('0xf')](handleError(_0x4147eb,null));}; \ No newline at end of file +var _0x7da7=['value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','isNil','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','TransferReport','create','Start','Account','queue','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','bluebird','moment','lodash','../../config/logger','api','client','http','request','error','message','catch','status','json','name','send','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','then','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agentCapacity','interaction','user','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','SIP/%s','INTERACTION','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showWhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x7da7,0x10d));var _0x77da=function(_0x56c70f,_0x4e4493){_0x56c70f=_0x56c70f-0x0;var _0x3812ed=_0x7da7[_0x56c70f];return _0x3812ed;};'use strict';var BPromise=require(_0x77da('0x0'));var moment=require(_0x77da('0x1'));var _=require(_0x77da('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x77da('0x3'))(_0x77da('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x77da('0x5')][_0x77da('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x77da('0x6')]({'port':0x232b});var routingClient=jayson[_0x77da('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){var _0x910e5b=_0x1191de?_0x1191de:amiClient;return _0x910e5b[_0x77da('0x7')](_0x30afe0,_0x47cf1d)['then'](function(_0x40c86e){if(_0x40c86e[_0x77da('0x8')]){if(_0x40c86e[_0x77da('0x8')]['code']===0x1f4){return _0x37c5ab(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}return _0x13992e(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}else{_0x13992e(_0x40c86e['result']);}})[_0x77da('0xa')](function(_0x3bcea0){_0x37c5ab(_0x3bcea0);});});}function respondWithResult(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xc8;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0xb')](_0x5d6e2f)[_0x77da('0xc')](_0x4a7748);}return _0x2acc65['sendStatus'](0x194);};}function handleError(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0x1f4;return function(_0x355719){logger[_0x77da('0x8')](_0x355719['stack']);if(_0x355719[_0x77da('0xd')]){delete _0x355719['name'];}_0x3b0ff2[_0x77da('0xb')](_0x369df0)[_0x77da('0xe')](_0x355719);};}function findById(_0x1b0e17){return function(_0x4500c4){if(!_['isNil'](_0x1b0e17)&&!_['isNil'](_0x4500c4)&&!_['isNil'](_0x4500c4['rows'])){return _[_0x77da('0xf')](_0x4500c4[_0x77da('0x10')],function(_0x289887){return _0x289887['id']==_0x1b0e17;});}return null;};}exports[_0x77da('0x11')]=function(_0x19a00c,_0x12d2b1){return respondWithRpcPromise(_0x77da('0x12'),_0x19a00c[_0x77da('0x13')])['then'](respondWithResult(_0x12d2b1,null))['catch'](handleError(_0x12d2b1,null));};exports[_0x77da('0x14')]=function(_0x4d1512,_0x507979){return respondWithRpcPromise(_0x77da('0x15'),_[_0x77da('0x16')](_0x4d1512[_0x77da('0x13')],_0x4d1512['params']))['then'](respondWithResult(_0x507979,null))[_0x77da('0xa')](handleError(_0x507979,null));};exports['voiceChannelStopMixMonitor']=function(_0x175ac4,_0x1c27aa){return respondWithRpcPromise(_0x77da('0x17'),_[_0x77da('0x16')](_0x175ac4[_0x77da('0x13')],_0x175ac4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x1c27aa,null))['catch'](handleError(_0x1c27aa,null));};exports['voiceQueues']=function(_0xfd160,_0x2d009f){return respondWithRpcPromise(_0x77da('0x1a'),_0xfd160[_0x77da('0x13')])['then'](respondWithResult(_0x2d009f,null))[_0x77da('0xa')](handleError(_0x2d009f,null));};exports[_0x77da('0x1b')]=function(_0x470c9f,_0x36115b){return respondWithRpcPromise(_0x77da('0x1a'),_0x470c9f['query'])[_0x77da('0x19')](findById(_0x470c9f[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x36115b,null))[_0x77da('0xa')](handleError(_0x36115b,null));};exports['updateVoiceQueue']=function(_0x5b4638,_0x4d395a){return respondWithRpcPromise(_0x77da('0x1c'),_[_0x77da('0x16')](_0x5b4638[_0x77da('0x1d')],_0x5b4638[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x4d395a,null))['catch'](handleError(_0x4d395a,null));};exports[_0x77da('0x1e')]=function(_0x26f5a0,_0x356bfb){return respondWithRpcPromise(_0x77da('0x1f'),_[_0x77da('0x16')](_0x26f5a0[_0x77da('0x13')],_0x26f5a0['params']))[_0x77da('0x19')](respondWithResult(_0x356bfb,null))[_0x77da('0xa')](handleError(_0x356bfb,null));};exports[_0x77da('0x20')]=function(_0x38643a,_0x3c3c64){return respondWithRpcPromise(_0x77da('0x21'),_0x38643a[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x3c3c64,null))['catch'](handleError(_0x3c3c64,null));};exports['voiceQueuesChannel']=function(_0x1366b4,_0x8e6181){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x77da('0x16')](_0x1366b4[_0x77da('0x13')],_0x1366b4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x8e6181,null))[_0x77da('0xa')](handleError(_0x8e6181,null));};exports[_0x77da('0x22')]=function(_0x20d1cc,_0x5c4a03){return respondWithRpcPromise(_0x77da('0x23'),_['merge'](_0x20d1cc['query'],_0x20d1cc['params']))[_0x77da('0x19')](respondWithResult(_0x5c4a03,null))['catch'](handleError(_0x5c4a03,null));};exports[_0x77da('0x24')]=function(_0xdac1a4,_0xce9df2){return respondWithRpcPromise(_0x77da('0x25'),_[_0x77da('0x16')](_0xdac1a4[_0x77da('0x13')],_0xdac1a4[_0x77da('0x18')]))['then'](respondWithResult(_0xce9df2,null))[_0x77da('0xa')](handleError(_0xce9df2,null));};exports[_0x77da('0x26')]=function(_0x1ca53a,_0x32785f){return respondWithRpcPromise(_0x77da('0x27'),_0x1ca53a[_0x77da('0x13')])['then'](respondWithResult(_0x32785f,null))[_0x77da('0xa')](handleError(_0x32785f,null));};exports[_0x77da('0x28')]=function(_0x2cd190,_0x4d04cd){return respondWithRpcPromise(_0x77da('0x29'),_0x2cd190['query'])['then'](respondWithResult(_0x4d04cd,null))['catch'](handleError(_0x4d04cd,null));};exports['agents']=function(_0x19f9f7,_0x1adba5){var _0xebdea1;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')])['then'](function(_0xf79c20){_0xebdea1=_0xf79c20;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')],routingClient);})[_0x77da('0x19')](function(_0x290667){return _[_0x77da('0x16')]({},_0x290667,_0xebdea1);})[_0x77da('0x19')](respondWithResult(_0x1adba5,null))['catch'](handleError(_0x1adba5,null));};exports[_0x77da('0x2a')]=function(_0x1f48bd,_0x44717a){if(_0x1f48bd[_0x77da('0x1d')]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]&&_0x1f48bd['user']&&_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]){for(var _0x21de41 in _0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]){if(_0x1f48bd[_0x77da('0x1d')]['interaction'][_0x77da('0x2d')](_0x21de41)){db['MemberReport'][_0x77da('0x2e')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')]?{'$notIn':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]}:{'$ne':null}}})[_0x77da('0x19')](function(_0x1bb77c){var _0x5964da=moment()[_0x77da('0x30')](_0x77da('0x31'));for(var _0x46f289=0x0,_0x287cf0=_0x1bb77c[_0x77da('0x2f')];_0x46f289<_0x287cf0;_0x46f289+=0x1){_0x1bb77c[_0x46f289][_0x77da('0x32')]({'exitAt':_0x5964da});}});for(var _0x558023=0x0;_0x558023<_0x1f48bd['body'][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')];_0x558023+=0x1){db[_0x77da('0x33')][_0x77da('0x34')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023],'exitAt':null},'defaults':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'interface':_['isNil'](_0x1f48bd[_0x77da('0x2c')]['interface'])?util['format'](_0x77da('0x35'),_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]):_0x1f48bd[_0x77da('0x2c')]['interface'],'type':_0x77da('0x36'),'enterAt':moment()[_0x77da('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x77da('0x37'),'internal':_0x1f48bd[_0x77da('0x2c')]['internal'],'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023]}});}}}}return respondWithRpcPromise(_0x77da('0x38'),{'id':_0x1f48bd[_0x77da('0x18')]['id'],'capacity':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x39')]},routingClient)[_0x77da('0x19')](respondWithResult(_0x44717a,null))[_0x77da('0xa')](handleError(_0x44717a,null));};exports[_0x77da('0x3a')]=function(_0x3a34a8,_0x52aa0a){return respondWithRpcPromise(_0x77da('0x3b'),_0x3a34a8['query'])[_0x77da('0x19')](respondWithResult(_0x52aa0a,null))[_0x77da('0xa')](handleError(_0x52aa0a,null));};exports[_0x77da('0x3c')]=function(_0x2eca67,_0x374179){return respondWithRpcPromise(_0x77da('0x3d'),_0x2eca67[_0x77da('0x13')])['then'](respondWithResult(_0x374179,null))[_0x77da('0xa')](handleError(_0x374179,null));};exports[_0x77da('0x3e')]=function(_0x1a7115,_0x353be9){return respondWithRpcPromise('Campaigns',_0x1a7115[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x353be9,null))[_0x77da('0xa')](handleError(_0x353be9,null));};exports['chatQueues']=function(_0x5a7ba7,_0x332763){return respondWithRpcPromise(_0x77da('0x3f'),_0x5a7ba7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x332763,null))[_0x77da('0xa')](handleError(_0x332763,null));};exports['showChatQueues']=function(_0x50437b,_0x365e91){return respondWithRpcPromise(_0x77da('0x3f'),_0x50437b['query'],routingClient)[_0x77da('0x19')](findById(_0x50437b[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x365e91,null))['catch'](handleError(_0x365e91,null));};exports[_0x77da('0x40')]=function(_0x111260,_0x5a5309){return respondWithRpcPromise(_0x77da('0x41'),_0x111260[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x5a5309,null))[_0x77da('0xa')](handleError(_0x5a5309,null));};exports[_0x77da('0x42')]=function(_0x99ac27,_0x1dc4ab){return respondWithRpcPromise(_0x77da('0x41'),_0x99ac27[_0x77da('0x13')],routingClient)['then'](findById(_0x99ac27[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1dc4ab,null))[_0x77da('0xa')](handleError(_0x1dc4ab,null));};exports[_0x77da('0x43')]=function(_0x329c6b,_0x3a0160){return respondWithRpcPromise('MailAccounts',_0x329c6b[_0x77da('0x13')],mailClient)[_0x77da('0x19')](respondWithResult(_0x3a0160,null))[_0x77da('0xa')](handleError(_0x3a0160,null));};exports['openchannelQueues']=function(_0x3e5dd9,_0x2f7cd8){return respondWithRpcPromise(_0x77da('0x44'),_0x3e5dd9[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2f7cd8,null))[_0x77da('0xa')](handleError(_0x2f7cd8,null));};exports[_0x77da('0x45')]=function(_0x53a9ee,_0x100094){return respondWithRpcPromise('OpenchannelQueues',_0x53a9ee[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x53a9ee[_0x77da('0x18')]['id']))['then'](respondWithResult(_0x100094,null))[_0x77da('0xa')](handleError(_0x100094,null));};exports[_0x77da('0x46')]=function(_0x282481,_0x30ea29){return respondWithRpcPromise('SmsQueues',_0x282481['query'],routingClient)['then'](respondWithResult(_0x30ea29,null))[_0x77da('0xa')](handleError(_0x30ea29,null));};exports[_0x77da('0x47')]=function(_0x2c4d7c,_0x2c7c8e){return respondWithRpcPromise(_0x77da('0x48'),_0x2c4d7c[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x2c4d7c[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x2c7c8e,null))[_0x77da('0xa')](handleError(_0x2c7c8e,null));};exports['whatsappQueues']=function(_0x3028ca,_0x6dd79f){return respondWithRpcPromise('WhatsappQueues',_0x3028ca['query'],routingClient)[_0x77da('0x19')](respondWithResult(_0x6dd79f,null))['catch'](handleError(_0x6dd79f,null));};exports[_0x77da('0x49')]=function(_0x1adab0,_0x1ff554){return respondWithRpcPromise('WhatsappQueues',_0x1adab0[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x1adab0[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1ff554,null))[_0x77da('0xa')](handleError(_0x1ff554,null));};exports['faxQueues']=function(_0x1f4c49,_0x20a636){return respondWithRpcPromise('FaxQueues',_0x1f4c49[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x20a636,null))[_0x77da('0xa')](handleError(_0x20a636,null));};exports[_0x77da('0x4a')]=function(_0x14496e,_0xdf9393){return respondWithRpcPromise(_0x77da('0x4b'),_0x14496e['query'],routingClient)[_0x77da('0x19')](findById(_0x14496e['params']['id']))[_0x77da('0x19')](respondWithResult(_0xdf9393,null))[_0x77da('0xa')](handleError(_0xdf9393,null));};exports[_0x77da('0x4c')]=function(_0x19b514,_0x470619){return respondWithRpcPromise(_0x77da('0x4d'),_0x19b514[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x470619,null))[_0x77da('0xa')](handleError(_0x470619,null));};exports[_0x77da('0x4e')]=function(_0x3c9ca7,_0x19065e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3c9ca7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x19065e,null))[_0x77da('0xa')](handleError(_0x19065e,null));};exports[_0x77da('0x4f')]=function(_0x57b710,_0x293b5c){return respondWithRpcPromise(_0x77da('0x50'),_0x57b710[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x293b5c,null))[_0x77da('0xa')](handleError(_0x293b5c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x579314,_0x2a4f85){return respondWithRpcPromise(_0x77da('0x51'),_0x579314[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2a4f85,null))[_0x77da('0xa')](handleError(_0x2a4f85,null));};exports[_0x77da('0x52')]=function(_0x14dec8,_0xf95d48){return respondWithRpcPromise(_0x77da('0x51'),_0x14dec8['query'],routingClient)[_0x77da('0x19')](function(_0xfcf09c){if(_0x14dec8[_0x77da('0x13')][_0x77da('0x53')]!==undefined){var _0x17175=_(_0xfcf09c['rows'])[_0x77da('0x54')]([_0x14dec8[_0x77da('0x13')][_0x77da('0x53')],_0x14dec8[_0x77da('0x18')]['id']])[_0x77da('0x55')](_0x77da('0x56'))[_0x77da('0x57')]()[_0x77da('0x58')]();return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x4df868){return _0x17175['indexOf'](_0x4df868['queue_id'])>-0x1;});}else{return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x41fb81){return _0x41fb81['queue_id']===parseInt(_0x14dec8['params']['id']);});}})[_0x77da('0x19')](respondWithResult(_0xf95d48,null))[_0x77da('0xa')](handleError(_0xf95d48,null));};exports[_0x77da('0x59')]=function(_0x3a42e5,_0x1a92fd){return respondWithRpcPromise(_0x77da('0x5a'),_0x3a42e5[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x1a92fd,null))[_0x77da('0xa')](handleError(_0x1a92fd,null));};exports[_0x77da('0x5b')]=function(_0x27a462,_0x4cbd40){return respondWithRpcPromise(_0x77da('0x5c'),_0x27a462['query'],routingClient)['then'](respondWithResult(_0x4cbd40,null))[_0x77da('0xa')](handleError(_0x4cbd40,null));};exports['faxQueuesWaitingInteractions']=function(_0x4f9121,_0x22de60){return respondWithRpcPromise(_0x77da('0x5d'),_0x4f9121[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x22de60,null))['catch'](handleError(_0x22de60,null));};exports[_0x77da('0x5e')]=function(_0x4f1ae0){return function(_0x278f20,_0x1b85aa){var _0x554c44,_0x31834a;var _0x505520=_[_0x77da('0x5f')](_0x4f1ae0);var _0x45b0a5=_0x4f1ae0===_0x77da('0x60')?_0x77da('0x61'):'Account';return db[_0x505520+_0x77da('0x62')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x278f20[_0x77da('0x18')]['id']}})[_0x77da('0x19')](function(_0x3fd7c8){if(_[_0x77da('0x64')](_0x3fd7c8)){throw new Error(_0x505520+_0x77da('0x65'));}_0x554c44=_0x3fd7c8;return db[_0x505520+'Message']['findOne']({'where':{'id':_0x278f20[_0x77da('0x1d')][_0x77da('0x66')]},'include':[{'model':db[_0x505520+_0x77da('0x67')],'as':'Interaction'},{'model':db[_0x505520+_0x45b0a5],'as':'Account'}]});})['then'](function(_0x5aaafb){if(_[_0x77da('0x64')](_0x5aaafb)){throw new Error(_0x505520+_0x77da('0x68'));}_0x31834a=_0x5aaafb;return _0x5aaafb[_0x77da('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1636d6={'uniqueid':_0x4f1ae0+'.'+_0x31834a['id']+'.'+_0x31834a['Interaction']['id'],'FromUserId':_0x278f20[_0x77da('0x2c')]['id'],'type':'queue'};_0x1636d6[_0x505520+_0x77da('0x6a')]=_0x31834a['id'];_0x1636d6[_0x505520+'InteractionId']=_0x31834a[_0x77da('0x67')]['id'];_0x1636d6[_0x77da('0x6b')+_0x505520+_0x45b0a5+'Id']=_0x31834a['Account']['id'];_0x1636d6['To'+_0x505520+_0x77da('0x6c')]=_0x554c44['id'];return db[_0x505520+_0x77da('0x6d')][_0x77da('0x6e')](_0x1636d6);})[_0x77da('0x19')](function(){return respondWithRpcPromise(_0x77da('0x6f'),{'channel':_0x4f1ae0,'interaction':_0x31834a[_0x77da('0x67')],'message':_0x31834a,'account':_0x31834a[_0x77da('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x71'),'appdata':_0x554c44[_0x77da('0xd')]+','+(_0x31834a['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x1b85aa,null))[_0x77da('0xa')](handleError(_0x1b85aa,null));};};exports[_0x77da('0x72')]=function(_0x56efcf,_0x186d22){var _0x52638b,_0x5e93b1;if(_[_0x77da('0x64')](_0x56efcf[_0x77da('0x1d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x3c0cde=_0x56efcf[_0x77da('0x1d')][_0x77da('0x73')];var _0x5d9750=_[_0x77da('0x5f')](_0x3c0cde);var _0x5384d2=_0x3c0cde===_0x77da('0x60')?_0x77da('0x61'):_0x77da('0x70');return db[_0x77da('0x74')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x56efcf[_0x77da('0x18')]['id'],'role':'agent'}})[_0x77da('0x19')](function(_0x2410ae){if(_[_0x77da('0x64')](_0x2410ae)){throw new Error(_0x77da('0x75'));}_0x52638b=_0x2410ae;return db[_0x5d9750+'Message'][_0x77da('0x63')]({'where':{'id':_0x56efcf['body'][_0x77da('0x66')]},'include':[{'model':db[_0x5d9750+_0x77da('0x67')],'as':_0x77da('0x67')},{'model':db[_0x5d9750+_0x5384d2],'as':_0x77da('0x70')}]});})[_0x77da('0x19')](function(_0x2c3bcc){if(_[_0x77da('0x64')](_0x2c3bcc)){throw new Error(_0x5d9750+_0x77da('0x68'));}_0x5e93b1=_0x2c3bcc;return _0x2c3bcc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x77da('0x19')](function(){var _0x3132f0={'uniqueid':_0x3c0cde+'.'+_0x5e93b1['id']+'.'+_0x5e93b1[_0x77da('0x67')]['id'],'FromUserId':_0x56efcf[_0x77da('0x2c')]['id'],'type':_0x77da('0x71'),'ToUserId':_0x52638b['id']};_0x3132f0[_0x5d9750+_0x77da('0x6a')]=_0x5e93b1['id'];_0x3132f0[_0x5d9750+_0x77da('0x76')]=_0x5e93b1[_0x77da('0x67')]['id'];_0x3132f0['From'+_0x5d9750+_0x5384d2+'Id']=_0x5e93b1['Account']['id'];return db[_0x5d9750+_0x77da('0x6d')][_0x77da('0x6e')](_0x3132f0);})[_0x77da('0x19')](function(){return respondWithRpcPromise('Start',{'channel':_0x3c0cde,'interaction':_0x5e93b1[_0x77da('0x67')],'message':_0x5e93b1,'account':_0x5e93b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x37'),'appdata':_0x52638b[_0x77da('0xd')]+','+(_0x5e93b1[_0x77da('0x70')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x186d22,null))['catch'](handleError(_0x186d22,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7c676f5..7fea5e6 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 _0x42bf=['post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','/:id','isAuthenticated','show','get','/:id/run'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42bf,0x1e1));var _0xf42b=function(_0x32aa11,_0x54ba4f){_0x32aa11=_0x32aa11-0x0;var _0x569e1a=_0x42bf[_0x32aa11];return _0x569e1a;};'use strict';var multer=require(_0xf42b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf42b('0x1'));var express=require(_0xf42b('0x2'));var router=express[_0xf42b('0x3')]();var fs_extra=require(_0xf42b('0x4'));var auth=require(_0xf42b('0x5'));var interaction=require(_0xf42b('0x6'));var config=require('../../config/environment');var controller=require(_0xf42b('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf42b('0x8'),auth[_0xf42b('0x9')](),controller[_0xf42b('0xa')]);router[_0xf42b('0xb')](_0xf42b('0xc'),auth[_0xf42b('0x9')](),controller['run']);router[_0xf42b('0xd')]('/',auth['isAuthenticated'](),controller[_0xf42b('0xe')]);router[_0xf42b('0xf')](_0xf42b('0x8'),auth[_0xf42b('0x9')](),controller['update']);router[_0xf42b('0x10')](_0xf42b('0x8'),auth['isAuthenticated'](),controller[_0xf42b('0x11')]);module[_0xf42b('0x12')]=router; \ No newline at end of file +var _0xe291=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe291,0x1a1));var _0x1e29=function(_0x3b3995,_0x334bac){_0x3b3995=_0x3b3995-0x0;var _0x572610=_0xe291[_0x3b3995];return _0x572610;};'use strict';var multer=require('multer');var util=require(_0x1e29('0x0'));var path=require(_0x1e29('0x1'));var timeout=require(_0x1e29('0x2'));var express=require(_0x1e29('0x3'));var router=express[_0x1e29('0x4')]();var fs_extra=require(_0x1e29('0x5'));var auth=require(_0x1e29('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1e29('0x7'));var controller=require('./schedule.controller');router[_0x1e29('0x8')]('/',auth[_0x1e29('0x9')](),controller[_0x1e29('0xa')]);router[_0x1e29('0x8')](_0x1e29('0xb'),auth['isAuthenticated'](),controller[_0x1e29('0xc')]);router[_0x1e29('0x8')](_0x1e29('0xd'),auth[_0x1e29('0x9')](),controller[_0x1e29('0xe')]);router[_0x1e29('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e29('0x10')]);router[_0x1e29('0x11')](_0x1e29('0xb'),auth[_0x1e29('0x9')](),controller[_0x1e29('0x12')]);router['delete'](_0x1e29('0xb'),auth['isAuthenticated'](),controller[_0x1e29('0x13')]);module[_0x1e29('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 1965a71..089c44e 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 _0x4d52=['BOOLEAN','TEXT','sequelize','STRING','DATE','INTEGER','ENUM','years','quarters','weeks','days','hours','csv','custom','default'];(function(_0x2a89fc,_0x129858){var _0x402fdb=function(_0x200096){while(--_0x200096){_0x2a89fc['push'](_0x2a89fc['shift']());}};_0x402fdb(++_0x129858);}(_0x4d52,0x110));var _0x24d5=function(_0x4d159a,_0x2c5331){_0x4d159a=_0x4d159a-0x0;var _0x2d66cf=_0x4d52[_0x4d159a];return _0x2d66cf;};'use strict';var Sequelize=require(_0x24d5('0x0'));module['exports']={'name':{'type':Sequelize[_0x24d5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x24d5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x24d5('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x24d5('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x24d5('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x24d5('0x4')](_0x24d5('0x5'),_0x24d5('0x6'),'months',_0x24d5('0x7'),_0x24d5('0x8'),_0x24d5('0x9'),'minutes'),'allowNull':![],'defaultValue':_0x24d5('0x8')},'output':{'type':Sequelize['ENUM']('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x24d5('0xa')},'type':{'type':Sequelize[_0x24d5('0x4')](_0x24d5('0xb'),_0x24d5('0xc')),'allowNull':![],'defaultValue':_0x24d5('0xb')},'sendMail':{'type':Sequelize[_0x24d5('0xd')],'defaultValue':![]},'email':{'type':Sequelize[_0x24d5('0x1')]},'cc':{'type':Sequelize[_0x24d5('0xe')]},'bcc':{'type':Sequelize[_0x24d5('0xe')]},'sendIfEmpty':{'type':Sequelize[_0x24d5('0xd')],'defaultValue':!![]}}; \ No newline at end of file +var _0x9264=['years','weeks','minutes','days','csv','pdf','default','custom','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM'];(function(_0x4f093a,_0x38326){var _0x579380=function(_0xe455c3){while(--_0xe455c3){_0x4f093a['push'](_0x4f093a['shift']());}};_0x579380(++_0x38326);}(_0x9264,0x126));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4926('0x0'));module[_0x4926('0x1')]={'name':{'type':Sequelize[_0x4926('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4926('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4926('0x3')},'startAt':{'type':Sequelize[_0x4926('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4926('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4926('0x5')](_0x4926('0x6'),'quarters','months',_0x4926('0x7'),'days','hours',_0x4926('0x8')),'allowNull':![],'defaultValue':_0x4926('0x9')},'output':{'type':Sequelize[_0x4926('0x5')](_0x4926('0xa'),_0x4926('0xb'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x4926('0x5')]('custom',_0x4926('0xc')),'allowNull':![],'defaultValue':_0x4926('0xd')},'sendMail':{'type':Sequelize[_0x4926('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x4926('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'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 e393105..6558c3d 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 _0x056f=['keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','fields','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','stack','name','send','index','Schedule','rawAttributes','fieldName','key','model','map'];(function(_0x50f4c8,_0x2d9636){var _0xc6aea1=function(_0x1d55d7){while(--_0x1d55d7){_0x50f4c8['push'](_0x50f4c8['shift']());}};_0xc6aea1(++_0x2d9636);}(_0x056f,0x190));var _0xf056=function(_0x160b2f,_0x4b60e7){_0x160b2f=_0x160b2f-0x0;var _0x2ca351=_0x056f[_0x160b2f];return _0x2ca351;};'use strict';var emlformat=require(_0xf056('0x0'));var rimraf=require(_0xf056('0x1'));var zipdir=require(_0xf056('0x2'));var jsonpatch=require(_0xf056('0x3'));var rp=require('request-promise');var moment=require(_0xf056('0x4'));var BPromise=require(_0xf056('0x5'));var Mustache=require(_0xf056('0x6'));var util=require(_0xf056('0x7'));var path=require('path');var sox=require(_0xf056('0x8'));var csv=require(_0xf056('0x9'));var ejs=require(_0xf056('0xa'));var fs=require('fs');var fs_extra=require(_0xf056('0xb'));var _=require(_0xf056('0xc'));var squel=require(_0xf056('0xd'));var crypto=require(_0xf056('0xe'));var jsforce=require(_0xf056('0xf'));var deskjs=require(_0xf056('0x10'));var toCsv=require(_0xf056('0x9'));var querystring=require(_0xf056('0x11'));var Papa=require('papaparse');var Redis=require(_0xf056('0x12'));var authService=require(_0xf056('0x13'));var qs=require(_0xf056('0x14'));var as=require(_0xf056('0x15'));var hardwareService=require(_0xf056('0x16'));var logger=require(_0xf056('0x17'))(_0xf056('0x18'));var utils=require('../../config/utils');var config=require(_0xf056('0x19'));var licenseUtil=require(_0xf056('0x1a'));var db=require(_0xf056('0x1b'))['db'];function respondWithStatusCode(_0x47041b,_0x2c1681){_0x2c1681=_0x2c1681||0xcc;return function(_0x1cd76a){if(_0x1cd76a){return _0x47041b[_0xf056('0x1c')](_0x2c1681);}return _0x47041b['status'](_0x2c1681)['end']();};}function respondWithResult(_0x1215f6,_0xb4f4d5){_0xb4f4d5=_0xb4f4d5||0xc8;return function(_0x3b3be1){if(_0x3b3be1){return _0x1215f6[_0xf056('0x1d')](_0xb4f4d5)[_0xf056('0x1e')](_0x3b3be1);}};}function respondWithFilteredResult(_0xab1ed4,_0x5ac88d){return function(_0x25e94e){if(_0x25e94e){var _0x4b9868=typeof _0x5ac88d[_0xf056('0x1f')]===_0xf056('0x20')&&typeof _0x5ac88d[_0xf056('0x21')]===_0xf056('0x20');var _0x401b80=_0x25e94e[_0xf056('0x22')];var _0x550434=_0x4b9868?0x0:_0x5ac88d[_0xf056('0x1f')];var _0x5573d0=_0x4b9868?_0x25e94e[_0xf056('0x22')]:_0x5ac88d[_0xf056('0x1f')]+_0x5ac88d[_0xf056('0x21')];var _0x41fab2;if(_0x5573d0>=_0x401b80){_0x5573d0=_0x401b80;_0x41fab2=0xc8;}else{_0x41fab2=0xce;}_0xab1ed4[_0xf056('0x1d')](_0x41fab2);return _0xab1ed4[_0xf056('0x23')](_0xf056('0x24'),_0x550434+'-'+_0x5573d0+'/'+_0x401b80)[_0xf056('0x1e')](_0x25e94e);}return null;};}function patchUpdates(_0x524d14){return function(_0xdc362c){try{jsonpatch[_0xf056('0x25')](_0xdc362c,_0x524d14,!![]);}catch(_0x4dda53){return BPromise['reject'](_0x4dda53);}return _0xdc362c[_0xf056('0x26')]();};}function saveUpdates(_0x2d6fbf,_0x292bc5){return function(_0x24c444){if(_0x24c444){return _0x24c444[_0xf056('0x27')](_0x2d6fbf)[_0xf056('0x28')](function(_0x28626b){return _0x28626b;});}return null;};}function removeEntity(_0x34e3a1,_0x21a680){return function(_0x212d83){if(_0x212d83){return _0x212d83[_0xf056('0x29')]()[_0xf056('0x28')](function(){var _0x56822a=_0x212d83[_0xf056('0x2a')]({'plain':!![]});var _0x19e9a8=_0xf056('0x2b');return db[_0xf056('0x2c')][_0xf056('0x29')]({'where':{'type':_0x19e9a8,'resourceId':_0x56822a['id']}})[_0xf056('0x28')](function(){return _0x212d83;});})[_0xf056('0x28')](function(){_0x34e3a1[_0xf056('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x637aed,_0x31c048){return function(_0x591964){if(!_0x591964){_0x637aed[_0xf056('0x1c')](0x194);}return _0x591964;};}function handleError(_0x2192d9,_0x2a5a93){_0x2a5a93=_0x2a5a93||0x1f4;return function(_0x53e1e4){logger['error'](_0x53e1e4[_0xf056('0x2d')]);if(_0x53e1e4['name']){delete _0x53e1e4[_0xf056('0x2e')];}_0x2192d9[_0xf056('0x1d')](_0x2a5a93)[_0xf056('0x2f')](_0x53e1e4);};}exports[_0xf056('0x30')]=function(_0xf67046,_0xd64258){var _0x51393b={},_0x235dc2={},_0x244e0c={'count':0x0,'rows':[]};var _0x4be350=_['map'](db[_0xf056('0x31')][_0xf056('0x32')],function(_0x7eb3f8){return{'name':_0x7eb3f8[_0xf056('0x33')],'type':_0x7eb3f8['type'][_0xf056('0x34')]};});_0x235dc2[_0xf056('0x35')]=_[_0xf056('0x36')](_0x4be350,'name');_0x235dc2['query']=_[_0xf056('0x37')](_0xf67046[_0xf056('0x38')]);_0x235dc2[_0xf056('0x39')]=_[_0xf056('0x3a')](_0x235dc2[_0xf056('0x35')],_0x235dc2[_0xf056('0x38')]);_0x51393b[_0xf056('0x3b')]=_[_0xf056('0x3a')](_0x235dc2[_0xf056('0x35')],qs['fields'](_0xf67046[_0xf056('0x38')]['fields']));_0x51393b[_0xf056('0x3b')]=_0x51393b[_0xf056('0x3b')][_0xf056('0x3c')]?_0x51393b[_0xf056('0x3b')]:_0x235dc2[_0xf056('0x35')];if(!_0xf67046['query'][_0xf056('0x3d')](_0xf056('0x3e'))){_0x51393b[_0xf056('0x21')]=qs[_0xf056('0x21')](_0xf67046[_0xf056('0x38')][_0xf056('0x21')]);_0x51393b['offset']=qs[_0xf056('0x1f')](_0xf67046['query'][_0xf056('0x1f')]);}_0x51393b[_0xf056('0x3f')]=qs[_0xf056('0x40')](_0xf67046[_0xf056('0x38')][_0xf056('0x40')]);_0x51393b['where']=qs['filters'](_[_0xf056('0x41')](_0xf67046['query'],_0x235dc2[_0xf056('0x39')]),_0x4be350);if(_0xf67046[_0xf056('0x38')]['filter']){_0x51393b[_0xf056('0x42')]=_['merge'](_0x51393b[_0xf056('0x42')],{'$or':_[_0xf056('0x36')](_0x4be350,function(_0x35c09e){if(_0x35c09e[_0xf056('0x43')]!==_0xf056('0x44')){var _0x50ff60={};_0x50ff60[_0x35c09e[_0xf056('0x2e')]]={'$like':'%'+_0xf67046[_0xf056('0x38')][_0xf056('0x45')]+'%'};return _0x50ff60;}})});}_0x51393b=_['merge']({},_0x51393b,_0xf67046[_0xf056('0x46')]);var _0xde0f5f={'where':_0x51393b[_0xf056('0x42')]};return db[_0xf056('0x31')]['count'](_0xde0f5f)['then'](function(_0x4b9f72){_0x244e0c[_0xf056('0x22')]=_0x4b9f72;if(_0xf67046['query'][_0xf056('0x47')]){_0x51393b[_0xf056('0x48')]=[{'all':!![]}];}return db['Schedule'][_0xf056('0x49')](_0x51393b);})[_0xf056('0x28')](function(_0x66def7){_0x244e0c[_0xf056('0x4a')]=_0x66def7;return _0x244e0c;})[_0xf056('0x28')](respondWithFilteredResult(_0xd64258,_0x51393b))[_0xf056('0x4b')](handleError(_0xd64258,null));};exports['show']=function(_0x176bf5,_0x2c75b2){var _0x13b48a={'raw':![],'where':{'id':_0x176bf5[_0xf056('0x4c')]['id']}},_0xe9dcd8={};_0xe9dcd8['model']=_[_0xf056('0x37')](db[_0xf056('0x31')][_0xf056('0x32')]);_0xe9dcd8['query']=_[_0xf056('0x37')](_0x176bf5[_0xf056('0x38')]);_0xe9dcd8[_0xf056('0x39')]=_[_0xf056('0x3a')](_0xe9dcd8[_0xf056('0x35')],_0xe9dcd8['query']);_0x13b48a[_0xf056('0x3b')]=_[_0xf056('0x3a')](_0xe9dcd8['model'],qs[_0xf056('0x4d')](_0x176bf5['query'][_0xf056('0x4d')]));_0x13b48a[_0xf056('0x3b')]=_0x13b48a[_0xf056('0x3b')]['length']?_0x13b48a[_0xf056('0x3b')]:_0xe9dcd8[_0xf056('0x35')];if(_0x176bf5['query']['includeAll']){_0x13b48a[_0xf056('0x48')]=[{'all':!![]}];}_0x13b48a=_[_0xf056('0x4e')]({},_0x13b48a,_0x176bf5[_0xf056('0x46')]);return db[_0xf056('0x31')][_0xf056('0x4f')](_0x13b48a)[_0xf056('0x28')](handleEntityNotFound(_0x2c75b2,null))[_0xf056('0x28')](respondWithResult(_0x2c75b2,null))[_0xf056('0x4b')](handleError(_0x2c75b2,null));};exports[_0xf056('0x50')]=function(_0x1ca35b,_0xd12e84){return db[_0xf056('0x31')][_0xf056('0x50')](_0x1ca35b[_0xf056('0x51')],{})[_0xf056('0x28')](function(_0x4868ed){var _0x3ca151=_0x1ca35b[_0xf056('0x52')]['get']({'plain':!![]});if(!_0x3ca151)throw new Error(_0xf056('0x53'));if(_0x3ca151[_0xf056('0x54')]===_0xf056('0x52')){var _0x77b6bf=_0x4868ed['get']({'plain':!![]});var _0x3f3150='Scheduler';return db['UserProfileSection'][_0xf056('0x4f')]({'where':{'name':_0x3f3150,'userProfileId':_0x3ca151[_0xf056('0x55')]},'raw':!![]})[_0xf056('0x28')](function(_0x18a9c8){if(_0x18a9c8&&_0x18a9c8[_0xf056('0x56')]===0x0){return db[_0xf056('0x2c')]['create']({'name':_0x77b6bf[_0xf056('0x2e')],'resourceId':_0x77b6bf['id'],'type':_0x18a9c8[_0xf056('0x2e')],'sectionId':_0x18a9c8['id']},{})[_0xf056('0x28')](function(){return _0x4868ed;});}else{return _0x4868ed;}})['catch'](function(_0x5bf837){logger[_0xf056('0x57')](_0xf056('0x58'),_0x5bf837);throw _0x5bf837;});}return _0x4868ed;})[_0xf056('0x28')](respondWithResult(_0xd12e84,0xc9))[_0xf056('0x4b')](handleError(_0xd12e84,null));};exports[_0xf056('0x27')]=function(_0x12ff0f,_0x47b441){if(_0x12ff0f[_0xf056('0x51')]['id']){delete _0x12ff0f[_0xf056('0x51')]['id'];}return db[_0xf056('0x31')][_0xf056('0x4f')]({'where':{'id':_0x12ff0f[_0xf056('0x4c')]['id']}})[_0xf056('0x28')](handleEntityNotFound(_0x47b441,null))['then'](saveUpdates(_0x12ff0f[_0xf056('0x51')],null))[_0xf056('0x28')](respondWithResult(_0x47b441,null))['catch'](handleError(_0x47b441,null));};exports['destroy']=function(_0xc7339e,_0x518670){return db[_0xf056('0x31')]['find']({'where':{'id':_0xc7339e[_0xf056('0x4c')]['id']}})['then'](handleEntityNotFound(_0x518670,null))[_0xf056('0x28')](removeEntity(_0x518670,null))['catch'](handleError(_0x518670,null));};exports[_0xf056('0x59')]=function(_0x1aea16,_0x7a8f3d,_0x23b8bc){var _0x56c831=require(_0xf056('0x5a'));return db[_0xf056('0x31')][_0xf056('0x4f')]({'where':{'id':_0x1aea16['params']['id']},'raw':!![]})[_0xf056('0x28')](handleEntityNotFound(_0x7a8f3d,null))[_0xf056('0x28')](function(){_0x56c831['run'](_0x1aea16[_0xf056('0x4c')]['id']);})[_0xf056('0x28')](respondWithStatusCode(_0x7a8f3d,null))[_0xf056('0x4b')](handleError(_0x7a8f3d,null));}; \ No newline at end of file +var _0x632b=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Schedule','includeAll','findAll','show','keys','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x632b,0x98));var _0xb632=function(_0x33bcad,_0x83d264){_0x33bcad=_0x33bcad-0x0;var _0x5bfb06=_0x632b[_0x33bcad];return _0x5bfb06;};'use strict';var emlformat=require(_0xb632('0x0'));var rimraf=require(_0xb632('0x1'));var zipdir=require(_0xb632('0x2'));var jsonpatch=require(_0xb632('0x3'));var rp=require('request-promise');var moment=require(_0xb632('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb632('0x5'));var util=require(_0xb632('0x6'));var path=require(_0xb632('0x7'));var sox=require(_0xb632('0x8'));var csv=require(_0xb632('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb632('0xa'));var _=require('lodash');var squel=require(_0xb632('0xb'));var crypto=require(_0xb632('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb632('0xd'));var toCsv=require(_0xb632('0x9'));var querystring=require(_0xb632('0xe'));var Papa=require(_0xb632('0xf'));var Redis=require('ioredis');var authService=require(_0xb632('0x10'));var qs=require(_0xb632('0x11'));var as=require(_0xb632('0x12'));var hardwareService=require(_0xb632('0x13'));var logger=require('../../config/logger')(_0xb632('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb632('0x15'));var db=require(_0xb632('0x16'))['db'];function respondWithStatusCode(_0x395ae2,_0x4dc0ab){_0x4dc0ab=_0x4dc0ab||0xcc;return function(_0x271d86){if(_0x271d86){return _0x395ae2['sendStatus'](_0x4dc0ab);}return _0x395ae2[_0xb632('0x17')](_0x4dc0ab)[_0xb632('0x18')]();};}function respondWithResult(_0x3cad01,_0x174941){_0x174941=_0x174941||0xc8;return function(_0x457261){if(_0x457261){return _0x3cad01[_0xb632('0x17')](_0x174941)[_0xb632('0x19')](_0x457261);}};}function respondWithFilteredResult(_0x5c2e1f,_0x579a30){return function(_0x1f51a9){if(_0x1f51a9){var _0x5ec8d7=typeof _0x579a30[_0xb632('0x1a')]==='undefined'&&typeof _0x579a30[_0xb632('0x1b')]===_0xb632('0x1c');var _0x20f9b2=_0x1f51a9[_0xb632('0x1d')];var _0xea1333=_0x5ec8d7?0x0:_0x579a30['offset'];var _0x560147=_0x5ec8d7?_0x1f51a9[_0xb632('0x1d')]:_0x579a30['offset']+_0x579a30[_0xb632('0x1b')];var _0xf5263;if(_0x560147>=_0x20f9b2){_0x560147=_0x20f9b2;_0xf5263=0xc8;}else{_0xf5263=0xce;}_0x5c2e1f[_0xb632('0x17')](_0xf5263);return _0x5c2e1f[_0xb632('0x1e')](_0xb632('0x1f'),_0xea1333+'-'+_0x560147+'/'+_0x20f9b2)[_0xb632('0x19')](_0x1f51a9);}return null;};}function patchUpdates(_0x3a32bb){return function(_0x302b54){try{jsonpatch['apply'](_0x302b54,_0x3a32bb,!![]);}catch(_0x554d8b){return BPromise['reject'](_0x554d8b);}return _0x302b54[_0xb632('0x20')]();};}function saveUpdates(_0x493b0b,_0x20f35e){return function(_0x114efc){if(_0x114efc){return _0x114efc[_0xb632('0x21')](_0x493b0b)[_0xb632('0x22')](function(_0x7a6ced){return _0x7a6ced;});}return null;};}function removeEntity(_0x3fa82e,_0xe8230f){return function(_0x9512ef){if(_0x9512ef){return _0x9512ef[_0xb632('0x23')]()[_0xb632('0x22')](function(){var _0x27614c=_0x9512ef[_0xb632('0x24')]({'plain':!![]});var _0x5d281b=_0xb632('0x25');return db[_0xb632('0x26')]['destroy']({'where':{'type':_0x5d281b,'resourceId':_0x27614c['id']}})[_0xb632('0x22')](function(){return _0x9512ef;});})['then'](function(){_0x3fa82e['status'](0xcc)[_0xb632('0x18')]();});}};}function handleEntityNotFound(_0xbd22f9,_0x647466){return function(_0x599dc8){if(!_0x599dc8){_0xbd22f9[_0xb632('0x27')](0x194);}return _0x599dc8;};}function handleError(_0x1f4cec,_0x2c2b79){_0x2c2b79=_0x2c2b79||0x1f4;return function(_0x2bd0c4){logger[_0xb632('0x28')](_0x2bd0c4[_0xb632('0x29')]);if(_0x2bd0c4[_0xb632('0x2a')]){delete _0x2bd0c4['name'];}_0x1f4cec[_0xb632('0x17')](_0x2c2b79)[_0xb632('0x2b')](_0x2bd0c4);};}exports[_0xb632('0x2c')]=function(_0x5c13ce,_0x67e2b9){var _0x296b2c={},_0x5ca750={},_0x355215={'count':0x0,'rows':[]};var _0x9a6a37=_['map'](db['Schedule'][_0xb632('0x2d')],function(_0x4dae33){return{'name':_0x4dae33[_0xb632('0x2e')],'type':_0x4dae33[_0xb632('0x2f')][_0xb632('0x30')]};});_0x5ca750['model']=_[_0xb632('0x31')](_0x9a6a37,_0xb632('0x2a'));_0x5ca750[_0xb632('0x32')]=_['keys'](_0x5c13ce[_0xb632('0x32')]);_0x5ca750[_0xb632('0x33')]=_[_0xb632('0x34')](_0x5ca750[_0xb632('0x35')],_0x5ca750[_0xb632('0x32')]);_0x296b2c[_0xb632('0x36')]=_[_0xb632('0x34')](_0x5ca750[_0xb632('0x35')],qs['fields'](_0x5c13ce[_0xb632('0x32')][_0xb632('0x37')]));_0x296b2c[_0xb632('0x36')]=_0x296b2c['attributes'][_0xb632('0x38')]?_0x296b2c[_0xb632('0x36')]:_0x5ca750[_0xb632('0x35')];if(!_0x5c13ce['query'][_0xb632('0x39')](_0xb632('0x3a'))){_0x296b2c['limit']=qs['limit'](_0x5c13ce[_0xb632('0x32')]['limit']);_0x296b2c[_0xb632('0x1a')]=qs[_0xb632('0x1a')](_0x5c13ce['query'][_0xb632('0x1a')]);}_0x296b2c[_0xb632('0x3b')]=qs[_0xb632('0x3c')](_0x5c13ce[_0xb632('0x32')][_0xb632('0x3c')]);_0x296b2c[_0xb632('0x3d')]=qs[_0xb632('0x33')](_[_0xb632('0x3e')](_0x5c13ce[_0xb632('0x32')],_0x5ca750[_0xb632('0x33')]),_0x9a6a37);if(_0x5c13ce['query'][_0xb632('0x3f')]){_0x296b2c[_0xb632('0x3d')]=_[_0xb632('0x40')](_0x296b2c['where'],{'$or':_['map'](_0x9a6a37,function(_0x4c8b08){if(_0x4c8b08[_0xb632('0x2f')]!==_0xb632('0x41')){var _0x874009={};_0x874009[_0x4c8b08['name']]={'$like':'%'+_0x5c13ce[_0xb632('0x32')]['filter']+'%'};return _0x874009;}})});}_0x296b2c=_[_0xb632('0x40')]({},_0x296b2c,_0x5c13ce[_0xb632('0x42')]);var _0x3d5316={'where':_0x296b2c[_0xb632('0x3d')]};return db[_0xb632('0x43')]['count'](_0x3d5316)['then'](function(_0xcae1ef){_0x355215[_0xb632('0x1d')]=_0xcae1ef;if(_0x5c13ce[_0xb632('0x32')][_0xb632('0x44')]){_0x296b2c['include']=[{'all':!![]}];}return db['Schedule'][_0xb632('0x45')](_0x296b2c);})[_0xb632('0x22')](function(_0x2b87a8){_0x355215['rows']=_0x2b87a8;return _0x355215;})['then'](respondWithFilteredResult(_0x67e2b9,_0x296b2c))['catch'](handleError(_0x67e2b9,null));};exports[_0xb632('0x46')]=function(_0x5b668c,_0x24a6ef){var _0x301204={'raw':![],'where':{'id':_0x5b668c['params']['id']}},_0x3a1084={};_0x3a1084[_0xb632('0x35')]=_['keys'](db[_0xb632('0x43')][_0xb632('0x2d')]);_0x3a1084[_0xb632('0x32')]=_[_0xb632('0x47')](_0x5b668c[_0xb632('0x32')]);_0x3a1084[_0xb632('0x33')]=_[_0xb632('0x34')](_0x3a1084[_0xb632('0x35')],_0x3a1084[_0xb632('0x32')]);_0x301204[_0xb632('0x36')]=_['intersection'](_0x3a1084[_0xb632('0x35')],qs[_0xb632('0x37')](_0x5b668c[_0xb632('0x32')][_0xb632('0x37')]));_0x301204[_0xb632('0x36')]=_0x301204[_0xb632('0x36')][_0xb632('0x38')]?_0x301204[_0xb632('0x36')]:_0x3a1084[_0xb632('0x35')];if(_0x5b668c[_0xb632('0x32')]['includeAll']){_0x301204[_0xb632('0x48')]=[{'all':!![]}];}_0x301204=_[_0xb632('0x40')]({},_0x301204,_0x5b668c[_0xb632('0x42')]);return db[_0xb632('0x43')][_0xb632('0x49')](_0x301204)['then'](handleEntityNotFound(_0x24a6ef,null))[_0xb632('0x22')](respondWithResult(_0x24a6ef,null))[_0xb632('0x4a')](handleError(_0x24a6ef,null));};exports[_0xb632('0x4b')]=function(_0x121aa3,_0x1a3cd4){return db['Schedule'][_0xb632('0x4b')](_0x121aa3[_0xb632('0x4c')],{})[_0xb632('0x22')](function(_0x3b954f){var _0x3d9a9b=_0x121aa3['user'][_0xb632('0x24')]({'plain':!![]});if(!_0x3d9a9b)throw new Error(_0xb632('0x4d'));if(_0x3d9a9b['role']==='user'){var _0x3a6900=_0x3b954f[_0xb632('0x24')]({'plain':!![]});var _0x148536=_0xb632('0x25');return db[_0xb632('0x4e')][_0xb632('0x49')]({'where':{'name':_0x148536,'userProfileId':_0x3d9a9b[_0xb632('0x4f')]},'raw':!![]})[_0xb632('0x22')](function(_0x4dfd76){if(_0x4dfd76&&_0x4dfd76[_0xb632('0x50')]===0x0){return db[_0xb632('0x26')][_0xb632('0x4b')]({'name':_0x3a6900[_0xb632('0x2a')],'resourceId':_0x3a6900['id'],'type':_0x4dfd76[_0xb632('0x2a')],'sectionId':_0x4dfd76['id']},{})['then'](function(){return _0x3b954f;});}else{return _0x3b954f;}})['catch'](function(_0x291e17){logger['error'](_0xb632('0x51'),_0x291e17);throw _0x291e17;});}return _0x3b954f;})[_0xb632('0x22')](respondWithResult(_0x1a3cd4,0xc9))[_0xb632('0x4a')](handleError(_0x1a3cd4,null));};exports['update']=function(_0xfb0be2,_0x194ba8){if(_0xfb0be2['body']['id']){delete _0xfb0be2[_0xb632('0x4c')]['id'];}return db[_0xb632('0x43')][_0xb632('0x49')]({'where':{'id':_0xfb0be2[_0xb632('0x52')]['id']}})[_0xb632('0x22')](handleEntityNotFound(_0x194ba8,null))[_0xb632('0x22')](saveUpdates(_0xfb0be2['body'],null))[_0xb632('0x22')](respondWithResult(_0x194ba8,null))[_0xb632('0x4a')](handleError(_0x194ba8,null));};exports[_0xb632('0x23')]=function(_0x4f6606,_0x3602b6){return db[_0xb632('0x43')][_0xb632('0x49')]({'where':{'id':_0x4f6606[_0xb632('0x52')]['id']}})[_0xb632('0x22')](handleEntityNotFound(_0x3602b6,null))[_0xb632('0x22')](removeEntity(_0x3602b6,null))[_0xb632('0x4a')](handleError(_0x3602b6,null));};exports[_0xb632('0x53')]=function(_0x17d3df,_0x37a9f2,_0x417ae6){var _0x26694d=require(_0xb632('0x54'));return db[_0xb632('0x43')][_0xb632('0x49')]({'where':{'id':_0x17d3df[_0xb632('0x52')]['id']},'raw':!![]})[_0xb632('0x22')](handleEntityNotFound(_0x37a9f2,null))[_0xb632('0x22')](function(){_0x26694d[_0xb632('0x53')](_0x17d3df[_0xb632('0x52')]['id']);})['then'](respondWithStatusCode(_0x37a9f2,null))[_0xb632('0x4a')](handleError(_0x37a9f2,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index d1f5256..0c5752a 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 _0x3733=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger','moment','bluebird'];(function(_0x790b80,_0x346e85){var _0x384082=function(_0x5a8fe0){while(--_0x5a8fe0){_0x790b80['push'](_0x790b80['shift']());}};_0x384082(++_0x346e85);}(_0x3733,0x10c));var _0x3373=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3733[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3373('0x0'));var util=require(_0x3373('0x1'));var logger=require(_0x3373('0x2'))('api');var moment=require(_0x3373('0x3'));var BPromise=require(_0x3373('0x4'));var rp=require(_0x3373('0x5'));var fs=require('fs');var path=require(_0x3373('0x6'));var rimraf=require(_0x3373('0x7'));var config=require(_0x3373('0x8'));var attributes=require(_0x3373('0x9'));module[_0x3373('0xa')]=function(_0x4db54c,_0x4b133d){return _0x4db54c['define'](_0x3373('0xb'),attributes,{'tableName':_0x3373('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c6f=['Schedule','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x736eb,_0x345088){var _0x30ea13=function(_0xbdab7c){while(--_0xbdab7c){_0x736eb['push'](_0x736eb['shift']());}};_0x30ea13(++_0x345088);}(_0x9c6f,0x105));var _0xf9c6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf9c6('0x0'));var util=require('util');var logger=require(_0xf9c6('0x1'))(_0xf9c6('0x2'));var moment=require(_0xf9c6('0x3'));var BPromise=require(_0xf9c6('0x4'));var rp=require(_0xf9c6('0x5'));var fs=require('fs');var path=require(_0xf9c6('0x6'));var rimraf=require(_0xf9c6('0x7'));var config=require(_0xf9c6('0x8'));var attributes=require(_0xf9c6('0x9'));module[_0xf9c6('0xa')]=function(_0x53d730,_0x2811db){return _0x53d730[_0xf9c6('0xb')](_0xf9c6('0xc'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8112342..3142acf 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 _0xc120=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x2786ea,_0x16c3c3){var _0x5c38e5=function(_0x5a53c5){while(--_0x5a53c5){_0x2786ea['push'](_0x2786ea['shift']());}};_0x5c38e5(++_0x16c3c3);}(_0xc120,0x12b));var _0x0c12=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc120[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0c12('0x0'));var util=require(_0x0c12('0x1'));var moment=require('moment');var BPromise=require(_0x0c12('0x2'));var rs=require(_0x0c12('0x3'));var fs=require('fs');var Redis=require(_0x0c12('0x4'));var db=require(_0x0c12('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c12('0x6'))(_0x0c12('0x7'));var config=require('../../config/environment');var jayson=require(_0x0c12('0x8'));var client=jayson['client'][_0x0c12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e1e1,_0x1a3f55,_0x583900){return new BPromise(function(_0x3d96bc,_0x5cc332){return client[_0x0c12('0xa')](_0x22e1e1,_0x583900)['then'](function(_0x225424){logger[_0x0c12('0xb')](_0x0c12('0xc'),_0x1a3f55,_0x0c12('0xd'));logger[_0x0c12('0xe')](_0x0c12('0xf'),_0x1a3f55,_0x0c12('0xd'),JSON[_0x0c12('0x10')](_0x225424));if(_0x225424[_0x0c12('0x11')]){if(_0x225424[_0x0c12('0x11')][_0x0c12('0x12')]===0x1f4){logger['error'](_0x0c12('0xc'),_0x1a3f55,_0x225424['error'][_0x0c12('0x13')]);return _0x5cc332(_0x225424[_0x0c12('0x11')][_0x0c12('0x13')]);}logger[_0x0c12('0x11')]('Schedule,\x20%s,\x20%s',_0x1a3f55,_0x225424[_0x0c12('0x11')][_0x0c12('0x13')]);return _0x3d96bc(_0x225424[_0x0c12('0x11')][_0x0c12('0x13')]);}else{logger[_0x0c12('0xb')]('Schedule,\x20%s,\x20%s',_0x1a3f55,_0x0c12('0xd'));_0x3d96bc(_0x225424['result'][_0x0c12('0x13')]);}})[_0x0c12('0x14')](function(_0x42655e){logger[_0x0c12('0x11')](_0x0c12('0xc'),_0x1a3f55,_0x42655e);_0x5cc332(_0x42655e);});});} \ No newline at end of file +var _0x42fb=['error','code','message','Schedule,\x20%s,\x20%s','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x219e7c,_0x23250c){var _0x1f2167=function(_0x52a16b){while(--_0x52a16b){_0x219e7c['push'](_0x219e7c['shift']());}};_0x1f2167(++_0x23250c);}(_0x42fb,0x1cf));var _0xb42f=function(_0x4c1eeb,_0x14909d){_0x4c1eeb=_0x4c1eeb-0x0;var _0x8be7e5=_0x42fb[_0x4c1eeb];return _0x8be7e5;};'use strict';var _=require(_0xb42f('0x0'));var util=require(_0xb42f('0x1'));var moment=require(_0xb42f('0x2'));var BPromise=require('bluebird');var rs=require(_0xb42f('0x3'));var fs=require('fs');var Redis=require(_0xb42f('0x4'));var db=require(_0xb42f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb42f('0x6'))(_0xb42f('0x7'));var config=require(_0xb42f('0x8'));var jayson=require(_0xb42f('0x9'));var client=jayson[_0xb42f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x157f31,_0x3fb8ed,_0x38de9b){return new BPromise(function(_0x51b45e,_0x1f4b80){return client[_0xb42f('0xb')](_0x157f31,_0x38de9b)[_0xb42f('0xc')](function(_0x5dea96){logger['info']('Schedule,\x20%s,\x20%s',_0x3fb8ed,_0xb42f('0xd'));logger[_0xb42f('0xe')](_0xb42f('0xf'),_0x3fb8ed,_0xb42f('0xd'),JSON[_0xb42f('0x10')](_0x5dea96));if(_0x5dea96[_0xb42f('0x11')]){if(_0x5dea96[_0xb42f('0x11')][_0xb42f('0x12')]===0x1f4){logger[_0xb42f('0x11')]('Schedule,\x20%s,\x20%s',_0x3fb8ed,_0x5dea96['error']['message']);return _0x1f4b80(_0x5dea96[_0xb42f('0x11')][_0xb42f('0x13')]);}logger[_0xb42f('0x11')](_0xb42f('0x14'),_0x3fb8ed,_0x5dea96['error']['message']);return _0x51b45e(_0x5dea96[_0xb42f('0x11')][_0xb42f('0x13')]);}else{logger[_0xb42f('0x15')](_0xb42f('0x14'),_0x3fb8ed,_0xb42f('0xd'));_0x51b45e(_0x5dea96[_0xb42f('0x16')][_0xb42f('0x13')]);}})[_0xb42f('0x17')](function(_0xe1ae33){logger[_0xb42f('0x11')](_0xb42f('0x14'),_0x3fb8ed,_0xe1ae33);_0x1f4b80(_0xe1ae33);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 240569c..6b369c9 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 _0x0c5d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','describe','show','/:id/download','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x1e761e,_0x5e5eb6){var _0xe0ddfd=function(_0x43dd88){while(--_0x43dd88){_0x1e761e['push'](_0x1e761e['shift']());}};_0xe0ddfd(++_0x5e5eb6);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x222e02,_0x5b12da){_0x222e02=_0x222e02-0x0;var _0x25b911=_0x0c5d[_0x222e02];return _0x25b911;};'use strict';var multer=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var path=require('path');var timeout=require(_0xd0c5('0x2'));var express=require('express');var router=express[_0xd0c5('0x3')]();var fs_extra=require(_0xd0c5('0x4'));var auth=require(_0xd0c5('0x5'));var interaction=require(_0xd0c5('0x6'));var config=require(_0xd0c5('0x7'));var controller=require(_0xd0c5('0x8'));router[_0xd0c5('0x9')]('/',auth[_0xd0c5('0xa')](),controller['index']);router[_0xd0c5('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xd0c5('0xb')]);router['get']('/:id',auth[_0xd0c5('0xa')](),controller[_0xd0c5('0xc')]);router['get'](_0xd0c5('0xd'),auth[_0xd0c5('0xa')](),controller['download']);router[_0xd0c5('0xe')]('/',auth[_0xd0c5('0xa')](),controller[_0xd0c5('0xf')]);router[_0xd0c5('0x10')](_0xd0c5('0x11'),auth[_0xd0c5('0xa')](),controller[_0xd0c5('0x12')]);router[_0xd0c5('0x13')](_0xd0c5('0x11'),auth[_0xd0c5('0xa')](),controller[_0xd0c5('0x14')]);module[_0xd0c5('0x15')]=router; \ No newline at end of file +var _0x369d=['../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id/download','download','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x421725,_0x318a04){var _0x51b322=function(_0xe58018){while(--_0xe58018){_0x421725['push'](_0x421725['shift']());}};_0x51b322(++_0x318a04);}(_0x369d,0x1de));var _0xd369=function(_0x1be0a3,_0x1932b9){_0x1be0a3=_0x1be0a3-0x0;var _0x141e18=_0x369d[_0x1be0a3];return _0x141e18;};'use strict';var multer=require(_0xd369('0x0'));var util=require(_0xd369('0x1'));var path=require(_0xd369('0x2'));var timeout=require('connect-timeout');var express=require(_0xd369('0x3'));var router=express[_0xd369('0x4')]();var fs_extra=require(_0xd369('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd369('0x6'));var config=require(_0xd369('0x7'));var controller=require(_0xd369('0x8'));router[_0xd369('0x9')]('/',auth[_0xd369('0xa')](),controller[_0xd369('0xb')]);router[_0xd369('0x9')]('/describe',auth[_0xd369('0xa')](),controller[_0xd369('0xc')]);router['get']('/:id',auth[_0xd369('0xa')](),controller['show']);router['get'](_0xd369('0xd'),auth[_0xd369('0xa')](),controller[_0xd369('0xe')]);router[_0xd369('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd369('0x10')](_0xd369('0x11'),auth[_0xd369('0xa')](),controller[_0xd369('0x12')]);router[_0xd369('0x13')](_0xd369('0x11'),auth[_0xd369('0xa')](),controller[_0xd369('0x14')]);module[_0xd369('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index f28a4ab..c23b689 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 _0xaac4=['extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','value'];(function(_0x210674,_0x551a65){var _0x14c9b5=function(_0x1164d8){while(--_0x1164d8){_0x210674['push'](_0x210674['shift']());}};_0x14c9b5(++_0x551a65);}(_0xaac4,0x6c));var _0x4aac=function(_0x55d70d,_0x32fa55){_0x55d70d=_0x55d70d-0x0;var _0x41dbc4=_0xaac4[_0x55d70d];return _0x41dbc4;};'use strict';var Sequelize=require(_0x4aac('0x0'));var moment=require(_0x4aac('0x1'));var path=require('path');var config=require(_0x4aac('0x2'));module[_0x4aac('0x3')]={'format':{'type':Sequelize[_0x4aac('0x4')],'get':function(){return this['getDataValue'](_0x4aac('0x5'))?path[_0x4aac('0x6')](this[_0x4aac('0x7')](_0x4aac('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x4aac('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x4aac('0x8')],'set':function(_0x688327){var _0x625c38=_0x688327['replace'](/\\/g,'/');this[_0x4aac('0x9')]('value',_0x625c38);}},'rating':{'type':Sequelize[_0x4aac('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4aac('0xa')],'set':function(_0x239771){this[_0x4aac('0x9')](_0x4aac('0xb'),moment()['subtract'](_0x239771,'ms'));this[_0x4aac('0x9')](_0x4aac('0xc'),moment());this[_0x4aac('0x9')](_0x4aac('0xd'),_0x239771);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4aac('0x7')](_0x4aac('0xb')))[_0x4aac('0xe')](_0x4aac('0xf'))[_0x4aac('0x10')]();}},'closedAt':{'type':Sequelize[_0x4aac('0x11')],'get':function(){return moment(this[_0x4aac('0x7')]('closedAt'))[_0x4aac('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x4aac('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4aac('0x7')]('createdAt'))[_0x4aac('0xe')](_0x4aac('0xf'))[_0x4aac('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4aac('0x7')](_0x4aac('0x12')))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0xa467=['value','extname','STRING','setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','format','toString','createdAt','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0xa467,0x143));var _0x7a46=function(_0xae1a87,_0x14083d){_0xae1a87=_0xae1a87-0x0;var _0x1068e7=_0xa467[_0xae1a87];return _0x1068e7;};'use strict';var Sequelize=require(_0x7a46('0x0'));var moment=require(_0x7a46('0x1'));var path=require(_0x7a46('0x2'));var config=require(_0x7a46('0x3'));module[_0x7a46('0x4')]={'format':{'type':Sequelize[_0x7a46('0x5')],'get':function(){return this[_0x7a46('0x6')](_0x7a46('0x7'))?path[_0x7a46('0x8')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x7a46('0x9')]},'channel':{'type':Sequelize[_0x7a46('0x9')]},'value':{'type':Sequelize[_0x7a46('0x9')],'set':function(_0x463cdf){var _0x6d8fce=_0x463cdf['replace'](/\\/g,'/');this[_0x7a46('0xa')](_0x7a46('0x7'),_0x6d8fce);}},'rating':{'type':Sequelize[_0x7a46('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x7a46('0xb')],'set':function(_0x382b56){this[_0x7a46('0xa')]('startedAt',moment()[_0x7a46('0xc')](_0x382b56,'ms'));this['setDataValue'](_0x7a46('0xd'),moment());this['setDataValue'](_0x7a46('0xe'),_0x382b56);}},'startedAt':{'type':Sequelize[_0x7a46('0xf')],'get':function(){return moment(this[_0x7a46('0x6')](_0x7a46('0x10')))[_0x7a46('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x7a46('0x12')]();}},'closedAt':{'type':Sequelize[_0x7a46('0xf')],'get':function(){return moment(this[_0x7a46('0x6')](_0x7a46('0xd')))[_0x7a46('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x7a46('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x7a46('0x13')))[_0x7a46('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x7a46('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7a46('0x6')](_0x7a46('0x14')))['format'](_0x7a46('0x15'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 6627723..23bd0bd 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 _0xb458=['differenceBy','format','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','filter','options','ScreenRecording','includeAll','rows','catch','show','params','include','create','body','createdAt','closedAt','find','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x725d65,_0x192bc0){var _0x437f1c=function(_0x4e899a){while(--_0x4e899a){_0x725d65['push'](_0x725d65['shift']());}};_0x437f1c(++_0x192bc0);}(_0xb458,0x103));var _0x8b45=function(_0x220606,_0x4b6630){_0x220606=_0x220606-0x0;var _0x1308ff=_0xb458[_0x220606];return _0x1308ff;};'use strict';var emlformat=require(_0x8b45('0x0'));var rimraf=require(_0x8b45('0x1'));var zipdir=require(_0x8b45('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8b45('0x3'));var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require('path');var sox=require(_0x8b45('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b45('0x8'));var _=require(_0x8b45('0x9'));var squel=require(_0x8b45('0xa'));var crypto=require(_0x8b45('0xb'));var jsforce=require(_0x8b45('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8b45('0xd'));var querystring=require(_0x8b45('0xe'));var Papa=require(_0x8b45('0xf'));var Redis=require(_0x8b45('0x10'));var authService=require(_0x8b45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8b45('0x14'));var db=require(_0x8b45('0x15'))['db'];function respondWithStatusCode(_0x37c220,_0x52c4db){_0x52c4db=_0x52c4db||0xcc;return function(_0x30d38c){if(_0x30d38c){return _0x37c220[_0x8b45('0x16')](_0x52c4db);}return _0x37c220[_0x8b45('0x17')](_0x52c4db)[_0x8b45('0x18')]();};}function respondWithResult(_0x32babc,_0x2ad2ae){_0x2ad2ae=_0x2ad2ae||0xc8;return function(_0x5f0b20){if(_0x5f0b20){return _0x32babc['status'](_0x2ad2ae)[_0x8b45('0x19')](_0x5f0b20);}};}function respondWithFilteredResult(_0x23f1dd,_0x445170){return function(_0x39c1d1){if(_0x39c1d1){var _0x4781d7=typeof _0x445170[_0x8b45('0x1a')]===_0x8b45('0x1b')&&typeof _0x445170[_0x8b45('0x1c')]===_0x8b45('0x1b');var _0x391d1e=_0x39c1d1[_0x8b45('0x1d')];var _0x21d5b2=_0x4781d7?0x0:_0x445170[_0x8b45('0x1a')];var _0x43ffb7=_0x4781d7?_0x39c1d1[_0x8b45('0x1d')]:_0x445170[_0x8b45('0x1a')]+_0x445170[_0x8b45('0x1c')];var _0x309e23;if(_0x43ffb7>=_0x391d1e){_0x43ffb7=_0x391d1e;_0x309e23=0xc8;}else{_0x309e23=0xce;}_0x23f1dd['status'](_0x309e23);return _0x23f1dd[_0x8b45('0x1e')](_0x8b45('0x1f'),_0x21d5b2+'-'+_0x43ffb7+'/'+_0x391d1e)[_0x8b45('0x19')](_0x39c1d1);}return null;};}function patchUpdates(_0x46e21a){return function(_0x3e1438){try{jsonpatch[_0x8b45('0x20')](_0x3e1438,_0x46e21a,!![]);}catch(_0x2f4f1c){return BPromise[_0x8b45('0x21')](_0x2f4f1c);}return _0x3e1438['save']();};}function saveUpdates(_0x52f93f,_0x41154a){return function(_0x580e17){if(_0x580e17){return _0x580e17[_0x8b45('0x22')](_0x52f93f)[_0x8b45('0x23')](function(_0x30f405){return _0x30f405;});}return null;};}function removeEntity(_0x45e2db,_0x165570){return function(_0x2b8526){if(_0x2b8526){return _0x2b8526[_0x8b45('0x24')]()['then'](function(){_0x45e2db['status'](0xcc)[_0x8b45('0x18')]();});}};}function handleEntityNotFound(_0x2c2c06,_0x500044){return function(_0x5723a2){if(!_0x5723a2){_0x2c2c06[_0x8b45('0x16')](0x194);}return _0x5723a2;};}function handleError(_0x32f6f0,_0x2ca2d9){_0x2ca2d9=_0x2ca2d9||0x1f4;return function(_0x2f37bc){logger['error'](_0x2f37bc[_0x8b45('0x25')]);if(_0x2f37bc[_0x8b45('0x26')]){delete _0x2f37bc[_0x8b45('0x26')];}_0x32f6f0[_0x8b45('0x17')](_0x2ca2d9)[_0x8b45('0x27')](_0x2f37bc);};}exports[_0x8b45('0x28')]=function(_0x461017,_0x234f62){var _0x1733a7={},_0xf21bd1={},_0x339c73={'count':0x0,'rows':[]};var _0x1ba2d4=_[_0x8b45('0x29')](db['ScreenRecording'][_0x8b45('0x2a')],function(_0x36db96){return{'name':_0x36db96[_0x8b45('0x2b')],'type':_0x36db96[_0x8b45('0x2c')][_0x8b45('0x2d')]};});_0xf21bd1[_0x8b45('0x2e')]=_[_0x8b45('0x2f')](_[_0x8b45('0x29')](_0x1ba2d4,'name'),[_0x8b45('0x30')]);_0xf21bd1[_0x8b45('0x31')]=_[_0x8b45('0x32')](_0x461017[_0x8b45('0x31')]);_0xf21bd1[_0x8b45('0x33')]=_['intersection'](_0xf21bd1[_0x8b45('0x2e')],_0xf21bd1['query']);_0x1733a7['attributes']=_[_0x8b45('0x34')](_0xf21bd1[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x461017[_0x8b45('0x31')][_0x8b45('0x35')]));_0x1733a7[_0x8b45('0x36')]=_0x1733a7['attributes'][_0x8b45('0x37')]?_0x1733a7[_0x8b45('0x36')]:_0xf21bd1[_0x8b45('0x2e')];if(!_0x461017[_0x8b45('0x31')]['hasOwnProperty'](_0x8b45('0x38'))){_0x1733a7[_0x8b45('0x1c')]=qs[_0x8b45('0x1c')](_0x461017['query'][_0x8b45('0x1c')]);_0x1733a7[_0x8b45('0x1a')]=qs[_0x8b45('0x1a')](_0x461017['query'][_0x8b45('0x1a')]);}_0x1733a7[_0x8b45('0x39')]=qs[_0x8b45('0x3a')](_0x461017[_0x8b45('0x31')]['sort']);_0x1733a7[_0x8b45('0x3b')]=qs[_0x8b45('0x33')](_[_0x8b45('0x3c')](_0x461017[_0x8b45('0x31')],_0xf21bd1[_0x8b45('0x33')]),_0x1ba2d4);if(_0x461017[_0x8b45('0x31')]['filter']){_0x1733a7['where']=_[_0x8b45('0x3d')](_0x1733a7[_0x8b45('0x3b')],{'$or':_[_0x8b45('0x29')](_0x1ba2d4,function(_0x12d4b2){if(_0x12d4b2[_0x8b45('0x2c')]!=='VIRTUAL'){var _0x120068={};_0x120068[_0x12d4b2['name']]={'$like':'%'+_0x461017[_0x8b45('0x31')][_0x8b45('0x3e')]+'%'};return _0x120068;}})});}_0x1733a7=_[_0x8b45('0x3d')]({},_0x1733a7,_0x461017[_0x8b45('0x3f')]);var _0x254f17={'where':_0x1733a7[_0x8b45('0x3b')]};return db[_0x8b45('0x40')][_0x8b45('0x1d')](_0x254f17)[_0x8b45('0x23')](function(_0x2ca00e){_0x339c73[_0x8b45('0x1d')]=_0x2ca00e;if(_0x461017['query'][_0x8b45('0x41')]){_0x1733a7['include']=[{'all':!![]}];}return db[_0x8b45('0x40')]['findAll'](_0x1733a7);})[_0x8b45('0x23')](function(_0x224c45){_0x339c73[_0x8b45('0x42')]=_0x224c45;return _0x339c73;})[_0x8b45('0x23')](respondWithFilteredResult(_0x234f62,_0x1733a7))[_0x8b45('0x43')](handleError(_0x234f62,null));};exports[_0x8b45('0x44')]=function(_0x58e663,_0x6fbca4){var _0x5916c7={'raw':![],'where':{'id':_0x58e663[_0x8b45('0x45')]['id']}},_0x4c56c8={};_0x4c56c8[_0x8b45('0x2e')]=_[_0x8b45('0x32')](db['ScreenRecording'][_0x8b45('0x2a')]);_0x4c56c8['query']=_[_0x8b45('0x32')](_0x58e663[_0x8b45('0x31')]);_0x4c56c8[_0x8b45('0x33')]=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],_0x4c56c8[_0x8b45('0x31')]);_0x5916c7['attributes']=_[_0x8b45('0x34')](_0x4c56c8[_0x8b45('0x2e')],qs[_0x8b45('0x35')](_0x58e663[_0x8b45('0x31')][_0x8b45('0x35')]));_0x5916c7[_0x8b45('0x36')]=_0x5916c7[_0x8b45('0x36')][_0x8b45('0x37')]?_0x5916c7[_0x8b45('0x36')]:_0x4c56c8[_0x8b45('0x2e')];if(_0x58e663[_0x8b45('0x31')][_0x8b45('0x41')]){_0x5916c7[_0x8b45('0x46')]=[{'all':!![]}];}_0x5916c7=_[_0x8b45('0x3d')]({},_0x5916c7,_0x58e663[_0x8b45('0x3f')]);return db[_0x8b45('0x40')]['find'](_0x5916c7)['then'](handleEntityNotFound(_0x6fbca4,null))['then'](respondWithResult(_0x6fbca4,null))[_0x8b45('0x43')](handleError(_0x6fbca4,null));};exports[_0x8b45('0x47')]=function(_0x3a1621,_0x473530){return db[_0x8b45('0x40')][_0x8b45('0x47')](_0x3a1621[_0x8b45('0x48')],{})[_0x8b45('0x23')](respondWithResult(_0x473530,0xc9))['catch'](handleError(_0x473530,null));};exports[_0x8b45('0x22')]=function(_0x5d5be2,_0x23b5c6){if(_0x5d5be2[_0x8b45('0x48')]['id']){delete _0x5d5be2[_0x8b45('0x48')]['id'];}delete _0x5d5be2[_0x8b45('0x48')]['duration'];delete _0x5d5be2[_0x8b45('0x48')][_0x8b45('0x49')];delete _0x5d5be2['body'][_0x8b45('0x4a')];delete _0x5d5be2[_0x8b45('0x48')]['value'];return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':{'id':_0x5d5be2[_0x8b45('0x45')]['id']}})[_0x8b45('0x23')](handleEntityNotFound(_0x23b5c6,null))[_0x8b45('0x23')](saveUpdates(_0x5d5be2[_0x8b45('0x48')],null))['then'](respondWithResult(_0x23b5c6,null))['catch'](handleError(_0x23b5c6,null));};exports[_0x8b45('0x4c')]=function(_0x2a2e59,_0x2d5b31){return db['ScreenRecording'][_0x8b45('0x4c')]()[_0x8b45('0x23')](respondWithResult(_0x2d5b31,null))[_0x8b45('0x43')](handleError(_0x2d5b31,null));};exports[_0x8b45('0x4d')]=function(_0x2d6b66,_0x597402,_0x34c05d){var _0xa92a05=require('../../components/encryptor');var _0x422da0=![];var _0x4c3f38={};if(_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]&&_0x2d6b66[_0x8b45('0x31')][_0x8b45('0x2c')]==='uniqueid'){_0x4c3f38[_0x8b45('0x4e')]=_0x2d6b66[_0x8b45('0x45')]['id'];}else{_0x4c3f38['id']=_0x2d6b66[_0x8b45('0x45')]['id'];}return db[_0x8b45('0x40')][_0x8b45('0x4b')]({'where':_0x4c3f38,'attributes':['id',_0x8b45('0x4f')],'raw':!![]})[_0x8b45('0x23')](handleEntityNotFound(_0x597402,null))[_0x8b45('0x23')](function(_0x446fe5){if(_0x446fe5){var _0x5ba878=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x446fe5[_0x8b45('0x4f')]);var _0x1851c2=util['format'](_0x8b45('0x53'),_0x5ba878);if(fs[_0x8b45('0x54')](_0x1851c2)){_0x422da0=!![];return _0xa92a05[_0x8b45('0x55')](_0x1851c2,_0x5ba878,config['secrets'][_0x8b45('0x56')])[_0x8b45('0x23')](function(){return _0x446fe5;});}return _0x446fe5;}})[_0x8b45('0x23')](function(_0x9eacc1){if(_0x9eacc1){var _0x5795ca=path[_0x8b45('0x50')](config[_0x8b45('0x51')],_0x8b45('0x52'),_0x9eacc1[_0x8b45('0x4f')]);if(!fs['existsSync'](_0x5795ca)){throw new db[(_0x8b45('0x57'))][(_0x8b45('0x58'))](_0x8b45('0x59'));}if(_0x9eacc1[_0x8b45('0x5a')]){return _0x597402[_0x8b45('0x4d')](_0x5795ca,_0x9eacc1['filename']+path[_0x8b45('0x5b')](_0x5795ca),function(){if(_0x422da0){fs['unlink'](_0x5795ca);}});}else{return _0x597402[_0x8b45('0x4d')](_0x5795ca,function(_0x2f7ab0){if(_0x422da0){fs[_0x8b45('0x5c')](_0x5795ca);}});}}})[_0x8b45('0x43')](function(_0x6a77bd){if(_0x6a77bd[_0x8b45('0x5d')]==='ScreenRecording\x20not\x20found'){_0x597402['status'](0x194)[_0x8b45('0x27')](_0x8b45('0x5e'));}else{return handleError(_0x597402,null);}});};exports['destroy']=function(_0x461c83,_0x239330){return db[_0x8b45('0x40')]['find']({'where':{'id':_0x461c83['params']['id']}})[_0x8b45('0x23')](function(_0x8e5a41){if(_['isNil'](_0x8e5a41)){throw new ReferenceError(_0x8b45('0x5f'));}return _0x8e5a41;})['then'](function(_0xf1ab37){var _0x560c51=path['join'](config[_0x8b45('0x51')],_0x8b45('0x52'),_0xf1ab37['value']);logger[_0x8b45('0x60')](_0x8b45('0x61'),_0x560c51);if(!_[_0x8b45('0x62')](_0xf1ab37[_0x8b45('0x4f')])&&fs[_0x8b45('0x54')](_0x560c51)){logger['info'](_0x8b45('0x63')+_0x560c51+_0x8b45('0x64'));fs[_0x8b45('0x65')](_0x560c51);}_0x560c51=_0x560c51+'.cypher';if(!_['isNil'](_0xf1ab37[_0x8b45('0x4f')])&&fs['existsSync'](_0x560c51)){logger[_0x8b45('0x60')]('File:\x20\x22'+_0x560c51+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x560c51);}return _0xf1ab37;})[_0x8b45('0x23')](function(_0x4df581){if(!_0x4df581)throw new InternalError();return _0x4df581[_0x8b45('0x24')]();})[_0x8b45('0x23')](function(){_0x239330['status'](0xcc)[_0x8b45('0x18')]();})[_0x8b45('0x43')](handleError(_0x239330,null));}; \ No newline at end of file +var _0x3eea=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','body','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','format','existsSync','decryptFile','secrets','recording','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','download','filename','extname','Not\x20found','isNil','root','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys'];(function(_0x2d2f7d,_0x8db637){var _0x317806=function(_0x13e1c0){while(--_0x13e1c0){_0x2d2f7d['push'](_0x2d2f7d['shift']());}};_0x317806(++_0x8db637);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x4e4551,_0x518e6c){_0x4e4551=_0x4e4551-0x0;var _0xc545e1=_0x3eea[_0x4e4551];return _0xc545e1;};'use strict';var emlformat=require(_0xa3ee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3ee('0x1'));var jsonpatch=require(_0xa3ee('0x2'));var rp=require(_0xa3ee('0x3'));var moment=require(_0xa3ee('0x4'));var BPromise=require(_0xa3ee('0x5'));var Mustache=require(_0xa3ee('0x6'));var util=require(_0xa3ee('0x7'));var path=require(_0xa3ee('0x8'));var sox=require(_0xa3ee('0x9'));var csv=require(_0xa3ee('0xa'));var ejs=require(_0xa3ee('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3ee('0xc'));var crypto=require('crypto');var jsforce=require(_0xa3ee('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa3ee('0xa'));var querystring=require('querystring');var Papa=require(_0xa3ee('0xe'));var Redis=require('ioredis');var authService=require(_0xa3ee('0xf'));var qs=require(_0xa3ee('0x10'));var as=require(_0xa3ee('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa3ee('0x12'))(_0xa3ee('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa3ee('0x14'));var db=require(_0xa3ee('0x15'))['db'];function respondWithStatusCode(_0x403518,_0x4363d1){_0x4363d1=_0x4363d1||0xcc;return function(_0x594c88){if(_0x594c88){return _0x403518[_0xa3ee('0x16')](_0x4363d1);}return _0x403518['status'](_0x4363d1)[_0xa3ee('0x17')]();};}function respondWithResult(_0x20535f,_0x2c34cf){_0x2c34cf=_0x2c34cf||0xc8;return function(_0x150e20){if(_0x150e20){return _0x20535f['status'](_0x2c34cf)[_0xa3ee('0x18')](_0x150e20);}};}function respondWithFilteredResult(_0x23df7d,_0x5da681){return function(_0x5358aa){if(_0x5358aa){var _0x4b2c66=typeof _0x5da681[_0xa3ee('0x19')]===_0xa3ee('0x1a')&&typeof _0x5da681[_0xa3ee('0x1b')]===_0xa3ee('0x1a');var _0x4cc8bb=_0x5358aa[_0xa3ee('0x1c')];var _0x40ffdb=_0x4b2c66?0x0:_0x5da681[_0xa3ee('0x19')];var _0x299b1e=_0x4b2c66?_0x5358aa[_0xa3ee('0x1c')]:_0x5da681['offset']+_0x5da681[_0xa3ee('0x1b')];var _0x18b738;if(_0x299b1e>=_0x4cc8bb){_0x299b1e=_0x4cc8bb;_0x18b738=0xc8;}else{_0x18b738=0xce;}_0x23df7d[_0xa3ee('0x1d')](_0x18b738);return _0x23df7d[_0xa3ee('0x1e')](_0xa3ee('0x1f'),_0x40ffdb+'-'+_0x299b1e+'/'+_0x4cc8bb)[_0xa3ee('0x18')](_0x5358aa);}return null;};}function patchUpdates(_0x4f8c56){return function(_0x3f5d70){try{jsonpatch[_0xa3ee('0x20')](_0x3f5d70,_0x4f8c56,!![]);}catch(_0x4b8445){return BPromise[_0xa3ee('0x21')](_0x4b8445);}return _0x3f5d70['save']();};}function saveUpdates(_0x2fab5,_0x29df43){return function(_0x1d3022){if(_0x1d3022){return _0x1d3022[_0xa3ee('0x22')](_0x2fab5)[_0xa3ee('0x23')](function(_0x47108f){return _0x47108f;});}return null;};}function removeEntity(_0x3ce61b,_0x12108e){return function(_0x5ae0a1){if(_0x5ae0a1){return _0x5ae0a1[_0xa3ee('0x24')]()['then'](function(){_0x3ce61b[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();});}};}function handleEntityNotFound(_0x157071,_0x1fe4b4){return function(_0x2c48db){if(!_0x2c48db){_0x157071['sendStatus'](0x194);}return _0x2c48db;};}function handleError(_0x3c68f9,_0x1b766e){_0x1b766e=_0x1b766e||0x1f4;return function(_0x146493){logger[_0xa3ee('0x25')](_0x146493[_0xa3ee('0x26')]);if(_0x146493[_0xa3ee('0x27')]){delete _0x146493[_0xa3ee('0x27')];}_0x3c68f9[_0xa3ee('0x1d')](_0x1b766e)[_0xa3ee('0x28')](_0x146493);};}exports[_0xa3ee('0x29')]=function(_0x59c6f9,_0x5ba571){var _0x4abf49={},_0x78e581={},_0x481358={'count':0x0,'rows':[]};var _0x3fa094=_[_0xa3ee('0x2a')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')],function(_0x26b222){return{'name':_0x26b222[_0xa3ee('0x2d')],'type':_0x26b222[_0xa3ee('0x2e')][_0xa3ee('0x2f')]};});_0x78e581[_0xa3ee('0x30')]=_[_0xa3ee('0x31')](_['map'](_0x3fa094,_0xa3ee('0x27')),['format']);_0x78e581[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x59c6f9['query']);_0x78e581[_0xa3ee('0x34')]=_['intersection'](_0x78e581[_0xa3ee('0x30')],_0x78e581['query']);_0x4abf49[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x78e581[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x59c6f9[_0xa3ee('0x32')]['fields']));_0x4abf49[_0xa3ee('0x35')]=_0x4abf49[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x4abf49['attributes']:_0x78e581[_0xa3ee('0x30')];if(!_0x59c6f9['query'][_0xa3ee('0x39')]('nolimit')){_0x4abf49[_0xa3ee('0x1b')]=qs['limit'](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x1b')]);_0x4abf49[_0xa3ee('0x19')]=qs[_0xa3ee('0x19')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x19')]);}_0x4abf49[_0xa3ee('0x3a')]=qs[_0xa3ee('0x3b')](_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3b')]);_0x4abf49[_0xa3ee('0x3c')]=qs[_0xa3ee('0x34')](_[_0xa3ee('0x3d')](_0x59c6f9['query'],_0x78e581[_0xa3ee('0x34')]),_0x3fa094);if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]){_0x4abf49[_0xa3ee('0x3c')]=_['merge'](_0x4abf49[_0xa3ee('0x3c')],{'$or':_[_0xa3ee('0x2a')](_0x3fa094,function(_0x1a9b63){if(_0x1a9b63['type']!==_0xa3ee('0x3f')){var _0x3554eb={};_0x3554eb[_0x1a9b63['name']]={'$like':'%'+_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x3e')]+'%'};return _0x3554eb;}})});}_0x4abf49=_['merge']({},_0x4abf49,_0x59c6f9[_0xa3ee('0x40')]);var _0x6dd235={'where':_0x4abf49[_0xa3ee('0x3c')]};return db[_0xa3ee('0x2b')][_0xa3ee('0x1c')](_0x6dd235)[_0xa3ee('0x23')](function(_0x2ca04f){_0x481358[_0xa3ee('0x1c')]=_0x2ca04f;if(_0x59c6f9[_0xa3ee('0x32')][_0xa3ee('0x41')]){_0x4abf49[_0xa3ee('0x42')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x4abf49);})['then'](function(_0x45aeec){_0x481358[_0xa3ee('0x43')]=_0x45aeec;return _0x481358;})['then'](respondWithFilteredResult(_0x5ba571,_0x4abf49))[_0xa3ee('0x44')](handleError(_0x5ba571,null));};exports[_0xa3ee('0x45')]=function(_0x279834,_0x55f47f){var _0x1af10b={'raw':![],'where':{'id':_0x279834[_0xa3ee('0x46')]['id']}},_0x559cc1={};_0x559cc1[_0xa3ee('0x30')]=_[_0xa3ee('0x33')](db[_0xa3ee('0x2b')][_0xa3ee('0x2c')]);_0x559cc1[_0xa3ee('0x32')]=_[_0xa3ee('0x33')](_0x279834[_0xa3ee('0x32')]);_0x559cc1[_0xa3ee('0x34')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],_0x559cc1[_0xa3ee('0x32')]);_0x1af10b[_0xa3ee('0x35')]=_[_0xa3ee('0x36')](_0x559cc1[_0xa3ee('0x30')],qs[_0xa3ee('0x37')](_0x279834[_0xa3ee('0x32')][_0xa3ee('0x37')]));_0x1af10b['attributes']=_0x1af10b[_0xa3ee('0x35')][_0xa3ee('0x38')]?_0x1af10b[_0xa3ee('0x35')]:_0x559cc1[_0xa3ee('0x30')];if(_0x279834['query'][_0xa3ee('0x41')]){_0x1af10b['include']=[{'all':!![]}];}_0x1af10b=_[_0xa3ee('0x47')]({},_0x1af10b,_0x279834[_0xa3ee('0x40')]);return db[_0xa3ee('0x2b')][_0xa3ee('0x48')](_0x1af10b)[_0xa3ee('0x23')](handleEntityNotFound(_0x55f47f,null))[_0xa3ee('0x23')](respondWithResult(_0x55f47f,null))[_0xa3ee('0x44')](handleError(_0x55f47f,null));};exports[_0xa3ee('0x49')]=function(_0x3c3677,_0xd6160e){return db['ScreenRecording'][_0xa3ee('0x49')](_0x3c3677['body'],{})['then'](respondWithResult(_0xd6160e,0xc9))[_0xa3ee('0x44')](handleError(_0xd6160e,null));};exports[_0xa3ee('0x22')]=function(_0x45029f,_0x1ec479){if(_0x45029f[_0xa3ee('0x4a')]['id']){delete _0x45029f[_0xa3ee('0x4a')]['id'];}delete _0x45029f[_0xa3ee('0x4a')]['duration'];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4b')];delete _0x45029f['body'][_0xa3ee('0x4c')];delete _0x45029f[_0xa3ee('0x4a')][_0xa3ee('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x45029f[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](handleEntityNotFound(_0x1ec479,null))[_0xa3ee('0x23')](saveUpdates(_0x45029f[_0xa3ee('0x4a')],null))[_0xa3ee('0x23')](respondWithResult(_0x1ec479,null))['catch'](handleError(_0x1ec479,null));};exports['describe']=function(_0x15b55e,_0x441b23){return db['ScreenRecording'][_0xa3ee('0x4e')]()[_0xa3ee('0x23')](respondWithResult(_0x441b23,null))[_0xa3ee('0x44')](handleError(_0x441b23,null));};exports['download']=function(_0x505444,_0x2388f7,_0x49057c){var _0x172a73=require(_0xa3ee('0x4f'));var _0x5b8e79=![];var _0x4232e0={};if(_0x505444[_0xa3ee('0x32')][_0xa3ee('0x2e')]&&_0x505444['query'][_0xa3ee('0x2e')]===_0xa3ee('0x50')){_0x4232e0['uniqueid']=_0x505444[_0xa3ee('0x46')]['id'];}else{_0x4232e0['id']=_0x505444[_0xa3ee('0x46')]['id'];}return db[_0xa3ee('0x2b')]['find']({'where':_0x4232e0,'attributes':['id','value'],'raw':!![]})[_0xa3ee('0x23')](handleEntityNotFound(_0x2388f7,null))[_0xa3ee('0x23')](function(_0x4a1a2f){if(_0x4a1a2f){var _0x1f9913=path[_0xa3ee('0x51')](config['root'],'server/files/screen_recordings',_0x4a1a2f[_0xa3ee('0x4d')]);var _0x659491=util[_0xa3ee('0x52')]('%s.cypher',_0x1f9913);if(fs[_0xa3ee('0x53')](_0x659491)){_0x5b8e79=!![];return _0x172a73[_0xa3ee('0x54')](_0x659491,_0x1f9913,config[_0xa3ee('0x55')][_0xa3ee('0x56')])[_0xa3ee('0x23')](function(){return _0x4a1a2f;});}return _0x4a1a2f;}})[_0xa3ee('0x23')](function(_0x497be4){if(_0x497be4){var _0x10f508=path[_0xa3ee('0x51')](config['root'],_0xa3ee('0x57'),_0x497be4[_0xa3ee('0x4d')]);if(!fs[_0xa3ee('0x53')](_0x10f508)){throw new db[(_0xa3ee('0x58'))][(_0xa3ee('0x59'))](_0xa3ee('0x5a'));}if(_0x497be4['filename']){return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,_0x497be4[_0xa3ee('0x5c')]+path[_0xa3ee('0x5d')](_0x10f508),function(){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}else{return _0x2388f7[_0xa3ee('0x5b')](_0x10f508,function(_0x13b81b){if(_0x5b8e79){fs['unlink'](_0x10f508);}});}}})['catch'](function(_0x4df186){if(_0x4df186['message']===_0xa3ee('0x5a')){_0x2388f7[_0xa3ee('0x1d')](0x194)[_0xa3ee('0x28')](_0xa3ee('0x5e'));}else{return handleError(_0x2388f7,null);}});};exports[_0xa3ee('0x24')]=function(_0x18a164,_0x4000ee){return db['ScreenRecording'][_0xa3ee('0x48')]({'where':{'id':_0x18a164[_0xa3ee('0x46')]['id']}})[_0xa3ee('0x23')](function(_0xaff641){if(_[_0xa3ee('0x5f')](_0xaff641)){throw new ReferenceError('Entity\x20not\x20found');}return _0xaff641;})['then'](function(_0x7b1e97){var _0x303b71=path[_0xa3ee('0x51')](config[_0xa3ee('0x60')],_0xa3ee('0x57'),_0x7b1e97[_0xa3ee('0x4d')]);logger[_0xa3ee('0x61')](_0xa3ee('0x62'),_0x303b71);if(!_[_0xa3ee('0x5f')](_0x7b1e97[_0xa3ee('0x4d')])&&fs[_0xa3ee('0x53')](_0x303b71)){logger[_0xa3ee('0x61')](_0xa3ee('0x63')+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}_0x303b71=_0x303b71+'.cypher';if(!_[_0xa3ee('0x5f')](_0x7b1e97['value'])&&fs['existsSync'](_0x303b71)){logger[_0xa3ee('0x61')]('File:\x20\x22'+_0x303b71+_0xa3ee('0x64'));fs[_0xa3ee('0x65')](_0x303b71);}return _0x7b1e97;})[_0xa3ee('0x23')](function(_0x221deb){if(!_0x221deb)throw new InternalError();return _0x221deb['destroy']();})[_0xa3ee('0x23')](function(){_0x4000ee[_0xa3ee('0x1d')](0xcc)[_0xa3ee('0x17')]();})[_0xa3ee('0x44')](handleError(_0x4000ee,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 4cfe3b9..6f721b9 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 _0xb0e3=['request-promise','path','rimraf','../../config/environment','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb0e3,0x1b5));var _0x3b0e=function(_0x4cc72d,_0x1302e4){_0x4cc72d=_0x4cc72d-0x0;var _0x5cc9ee=_0xb0e3[_0x4cc72d];return _0x5cc9ee;};'use strict';var _=require(_0x3b0e('0x0'));var util=require(_0x3b0e('0x1'));var logger=require(_0x3b0e('0x2'))(_0x3b0e('0x3'));var moment=require('moment');var BPromise=require(_0x3b0e('0x4'));var rp=require(_0x3b0e('0x5'));var fs=require('fs');var path=require(_0x3b0e('0x6'));var rimraf=require(_0x3b0e('0x7'));var config=require(_0x3b0e('0x8'));var attributes=require('./screenRecording.attributes');module[_0x3b0e('0x9')]=function(_0x550528,_0x51063b){return _0x550528['define'](_0x3b0e('0xa'),attributes,{'tableName':_0x3b0e('0xb'),'paranoid':![],'indexes':[{'name':_0x3b0e('0xc'),'fields':[_0x3b0e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4817=['define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x3c7cda,_0x39ae67){var _0x4bae36=function(_0x23752d){while(--_0x23752d){_0x3c7cda['push'](_0x3c7cda['shift']());}};_0x4bae36(++_0x39ae67);}(_0x4817,0x12f));var _0x7481=function(_0x5ede37,_0x554304){_0x5ede37=_0x5ede37-0x0;var _0xbada92=_0x4817[_0x5ede37];return _0xbada92;};'use strict';var _=require('lodash');var util=require(_0x7481('0x0'));var logger=require(_0x7481('0x1'))(_0x7481('0x2'));var moment=require(_0x7481('0x3'));var BPromise=require('bluebird');var rp=require(_0x7481('0x4'));var fs=require('fs');var path=require(_0x7481('0x5'));var rimraf=require(_0x7481('0x6'));var config=require(_0x7481('0x7'));var attributes=require(_0x7481('0x8'));module['exports']=function(_0x47e811,_0x273d4c){return _0x47e811[_0x7481('0x9')](_0x7481('0xa'),attributes,{'tableName':_0x7481('0xb'),'paranoid':![],'indexes':[{'name':_0x7481('0xc'),'fields':[_0x7481('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 206f258..0fc51d8 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 _0xc2e3=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x4b7b69,_0x3ab075){var _0x173b4c=function(_0x234d5f){while(--_0x234d5f){_0x4b7b69['push'](_0x4b7b69['shift']());}};_0x173b4c(++_0x3ab075);}(_0xc2e3,0x109));var _0x3c2e=function(_0x59ef46,_0x4fc077){_0x59ef46=_0x59ef46-0x0;var _0x201c93=_0xc2e3[_0x59ef46];return _0x201c93;};'use strict';var _=require(_0x3c2e('0x0'));var util=require(_0x3c2e('0x1'));var moment=require(_0x3c2e('0x2'));var BPromise=require(_0x3c2e('0x3'));var rs=require(_0x3c2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c2e('0x5'))['db'];var utils=require(_0x3c2e('0x6'));var logger=require('../../config/logger')(_0x3c2e('0x7'));var config=require(_0x3c2e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3c2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa22728,_0x26c6ef,_0x4b3d7a){return new BPromise(function(_0x1f0cb5,_0xeab932){return client[_0x3c2e('0xa')](_0xa22728,_0x4b3d7a)[_0x3c2e('0xb')](function(_0x30eab2){logger[_0x3c2e('0xc')](_0x3c2e('0xd'),_0x26c6ef,_0x3c2e('0xe'));logger[_0x3c2e('0xf')](_0x3c2e('0x10'),_0x26c6ef,_0x3c2e('0xe'),JSON[_0x3c2e('0x11')](_0x30eab2));if(_0x30eab2['error']){if(_0x30eab2[_0x3c2e('0x12')]['code']===0x1f4){logger[_0x3c2e('0x12')](_0x3c2e('0xd'),_0x26c6ef,_0x30eab2[_0x3c2e('0x12')][_0x3c2e('0x13')]);return _0xeab932(_0x30eab2[_0x3c2e('0x12')][_0x3c2e('0x13')]);}logger['error'](_0x3c2e('0xd'),_0x26c6ef,_0x30eab2[_0x3c2e('0x12')]['message']);return _0x1f0cb5(_0x30eab2[_0x3c2e('0x12')][_0x3c2e('0x13')]);}else{logger[_0x3c2e('0xc')](_0x3c2e('0xd'),_0x26c6ef,_0x3c2e('0xe'));_0x1f0cb5(_0x30eab2[_0x3c2e('0x14')][_0x3c2e('0x13')]);}})[_0x3c2e('0x15')](function(_0x26dfb4){logger['error'](_0x3c2e('0xd'),_0x26c6ef,_0x26dfb4);_0xeab932(_0x26dfb4);});});} \ No newline at end of file +var _0x0682=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1d7ea2,_0x106227){var _0x3f8433=function(_0x224242){while(--_0x224242){_0x1d7ea2['push'](_0x1d7ea2['shift']());}};_0x3f8433(++_0x106227);}(_0x0682,0x1ee));var _0x2068=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0682[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2068('0x0'));var util=require(_0x2068('0x1'));var moment=require(_0x2068('0x2'));var BPromise=require(_0x2068('0x3'));var rs=require(_0x2068('0x4'));var fs=require('fs');var Redis=require(_0x2068('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2068('0x6'));var logger=require(_0x2068('0x7'))(_0x2068('0x8'));var config=require(_0x2068('0x9'));var jayson=require(_0x2068('0xa'));var client=jayson[_0x2068('0xb')][_0x2068('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dd858,_0x2086d3,_0x4d348a){return new BPromise(function(_0x380cf8,_0x54741a){return client['request'](_0x1dd858,_0x4d348a)[_0x2068('0xd')](function(_0x132a85){logger[_0x2068('0xe')](_0x2068('0xf'),_0x2086d3,_0x2068('0x10'));logger[_0x2068('0x11')](_0x2068('0x12'),_0x2086d3,_0x2068('0x10'),JSON[_0x2068('0x13')](_0x132a85));if(_0x132a85[_0x2068('0x14')]){if(_0x132a85[_0x2068('0x14')][_0x2068('0x15')]===0x1f4){logger[_0x2068('0x14')](_0x2068('0xf'),_0x2086d3,_0x132a85[_0x2068('0x14')]['message']);return _0x54741a(_0x132a85[_0x2068('0x14')][_0x2068('0x16')]);}logger[_0x2068('0x14')]('ScreenRecording,\x20%s,\x20%s',_0x2086d3,_0x132a85[_0x2068('0x14')]['message']);return _0x380cf8(_0x132a85[_0x2068('0x14')]['message']);}else{logger[_0x2068('0xe')](_0x2068('0xf'),_0x2086d3,_0x2068('0x10'));_0x380cf8(_0x132a85[_0x2068('0x17')][_0x2068('0x16')]);}})[_0x2068('0x18')](function(_0x1cb596){logger['error'](_0x2068('0xf'),_0x2086d3,_0x1cb596);_0x54741a(_0x1cb596);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 2c3084a..dac4d28 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 _0xe286=['post','file','addLogo','logologin','single','addLogoLogin','format','preferred','addPreferred','/:id','isAuthenticated','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','index','get','getDate','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','extname','originalname'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0xe286,0xdf));var _0x6e28=function(_0x3ecc6a,_0x4267c0){_0x3ecc6a=_0x3ecc6a-0x0;var _0x533f5e=_0xe286[_0x3ecc6a];return _0x533f5e;};'use strict';var multer=require('multer');var util=require(_0x6e28('0x0'));var path=require(_0x6e28('0x1'));var timeout=require(_0x6e28('0x2'));var express=require(_0x6e28('0x3'));var router=express[_0x6e28('0x4')]();var fs_extra=require(_0x6e28('0x5'));var auth=require(_0x6e28('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6e28('0x7'));var controller=require(_0x6e28('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6e28('0x9')]);router[_0x6e28('0xa')]('/now',controller[_0x6e28('0xb')]);router[_0x6e28('0xa')]('/:id',controller[_0x6e28('0xc')]);router[_0x6e28('0xa')]('/:id/logo',controller[_0x6e28('0xd')]);router[_0x6e28('0xa')](_0x6e28('0xe'),controller[_0x6e28('0xf')]);router['get'](_0x6e28('0x10'),controller[_0x6e28('0x11')]);router[_0x6e28('0xa')](_0x6e28('0x12'),controller[_0x6e28('0x13')]);router[_0x6e28('0xa')](_0x6e28('0x14'),controller[_0x6e28('0x15')]);var upload=multer({'storage':multer[_0x6e28('0x16')]({'destination':function(_0x11e805,_0x4eb2f2,_0x4b5561){_0x4b5561(null,path[_0x6e28('0x17')](config[_0x6e28('0x18')],_0x6e28('0x19')));},'filename':function(_0x1854ea,_0x29eb45,_0x3ccbe0){_0x3ccbe0(null,util['format'](_0x6e28('0x1a'),'logo',path[_0x6e28('0x1b')](_0x29eb45[_0x6e28('0x1c')])));}})});router[_0x6e28('0x1d')]('/:id/logo',upload['single'](_0x6e28('0x1e')),controller[_0x6e28('0x1f')]);var upload=multer({'storage':multer[_0x6e28('0x16')]({'destination':function(_0x1d83b9,_0x1bfe29,_0x3062c9){_0x3062c9(null,path[_0x6e28('0x17')](config[_0x6e28('0x18')],_0x6e28('0x19')));},'filename':function(_0x63b189,_0x4435c9,_0x937eb){_0x937eb(null,util['format'](_0x6e28('0x1a'),_0x6e28('0x20'),path[_0x6e28('0x1b')](_0x4435c9[_0x6e28('0x1c')])));}})});router[_0x6e28('0x1d')](_0x6e28('0xe'),upload[_0x6e28('0x21')](_0x6e28('0x1e')),controller[_0x6e28('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x227721,_0x351fd1,_0x1e85f0){_0x1e85f0(null,path[_0x6e28('0x17')](config['root'],_0x6e28('0x19')));},'filename':function(_0x232075,_0x5c35f6,_0x385547){_0x385547(null,util[_0x6e28('0x23')](_0x6e28('0x1a'),_0x6e28('0x24'),path[_0x6e28('0x1b')](_0x5c35f6[_0x6e28('0x1c')])));}})});router[_0x6e28('0x1d')](_0x6e28('0x12'),upload[_0x6e28('0x21')](_0x6e28('0x1e')),controller[_0x6e28('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e5f6f,_0x356b3b,_0x157afc){_0x157afc(null,path[_0x6e28('0x17')](config[_0x6e28('0x18')],'server/files/images/logos/'));},'filename':function(_0x2a56cd,_0x278ed7,_0x59a15c){_0x59a15c(null,util[_0x6e28('0x23')](_0x6e28('0x1a'),'favicon',path[_0x6e28('0x1b')](_0x278ed7[_0x6e28('0x1c')])));}})});router[_0x6e28('0x1d')](_0x6e28('0x14'),upload[_0x6e28('0x21')]('file'),controller['addFavicon']);router['put'](_0x6e28('0x26'),auth[_0x6e28('0x27')](),controller[_0x6e28('0x28')]);module[_0x6e28('0x29')]=router; \ No newline at end of file +var _0x0c0d=['getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','getPreferred','getFavicon','diskStorage','join','root','server/files/images/logos/','logo','extname','single','file','format','%s%s','originalname','post','addLogoLogin','favicon','/:id/favicon','addFavicon','put','isAuthenticated','update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','/now','/:id','/:id/logo'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x0c0d,0x104));var _0xd0c0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0c0d[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xd0c0('0x0'));var util=require(_0xd0c0('0x1'));var path=require(_0xd0c0('0x2'));var timeout=require('connect-timeout');var express=require(_0xd0c0('0x3'));var router=express[_0xd0c0('0x4')]();var fs_extra=require(_0xd0c0('0x5'));var auth=require(_0xd0c0('0x6'));var interaction=require(_0xd0c0('0x7'));var config=require('../../config/environment');var controller=require(_0xd0c0('0x8'));router[_0xd0c0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd0c0('0x9')](_0xd0c0('0xa'),controller['getDate']);router[_0xd0c0('0x9')](_0xd0c0('0xb'),controller['show']);router['get'](_0xd0c0('0xc'),controller[_0xd0c0('0xd')]);router[_0xd0c0('0x9')](_0xd0c0('0xe'),controller[_0xd0c0('0xf')]);router[_0xd0c0('0x9')]('/:id/gdpr',controller[_0xd0c0('0x10')]);router[_0xd0c0('0x9')](_0xd0c0('0x11'),controller[_0xd0c0('0x12')]);router[_0xd0c0('0x9')]('/:id/favicon',controller[_0xd0c0('0x13')]);var upload=multer({'storage':multer[_0xd0c0('0x14')]({'destination':function(_0x401bf5,_0x46a703,_0x1215dd){_0x1215dd(null,path[_0xd0c0('0x15')](config[_0xd0c0('0x16')],_0xd0c0('0x17')));},'filename':function(_0x4b815f,_0x211786,_0x2cd91a){_0x2cd91a(null,util['format']('%s%s',_0xd0c0('0x18'),path[_0xd0c0('0x19')](_0x211786['originalname'])));}})});router['post']('/:id/logo',upload[_0xd0c0('0x1a')](_0xd0c0('0x1b')),controller['addLogo']);var upload=multer({'storage':multer[_0xd0c0('0x14')]({'destination':function(_0x17e22b,_0x5571ac,_0x200550){_0x200550(null,path['join'](config[_0xd0c0('0x16')],_0xd0c0('0x17')));},'filename':function(_0x5ac916,_0x15b876,_0x54cb8e){_0x54cb8e(null,util[_0xd0c0('0x1c')](_0xd0c0('0x1d'),'logologin',path[_0xd0c0('0x19')](_0x15b876[_0xd0c0('0x1e')])));}})});router[_0xd0c0('0x1f')](_0xd0c0('0xe'),upload[_0xd0c0('0x1a')](_0xd0c0('0x1b')),controller[_0xd0c0('0x20')]);var upload=multer({'storage':multer[_0xd0c0('0x14')]({'destination':function(_0x2e3a72,_0xb8c931,_0x4ad44b){_0x4ad44b(null,path['join'](config[_0xd0c0('0x16')],_0xd0c0('0x17')));},'filename':function(_0x16dea4,_0x1de732,_0x2ae632){_0x2ae632(null,util[_0xd0c0('0x1c')](_0xd0c0('0x1d'),'preferred',path['extname'](_0x1de732['originalname'])));}})});router[_0xd0c0('0x1f')](_0xd0c0('0x11'),upload[_0xd0c0('0x1a')](_0xd0c0('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer[_0xd0c0('0x14')]({'destination':function(_0x31b697,_0x4ecb08,_0x19009e){_0x19009e(null,path[_0xd0c0('0x15')](config[_0xd0c0('0x16')],_0xd0c0('0x17')));},'filename':function(_0x5767f,_0x23e4a9,_0x157342){_0x157342(null,util[_0xd0c0('0x1c')](_0xd0c0('0x1d'),_0xd0c0('0x21'),path[_0xd0c0('0x19')](_0x23e4a9[_0xd0c0('0x1e')])));}})});router[_0xd0c0('0x1f')](_0xd0c0('0x22'),upload[_0xd0c0('0x1a')]('file'),controller[_0xd0c0('0x23')]);router[_0xd0c0('0x24')]('/:id',auth[_0xd0c0('0x25')](),controller[_0xd0c0('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 8c38c14..4aaee53 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 _0x839b=['UNSIGNED','sequelize','exports','min_internal','INTEGER','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0x839b,0x1d5));var _0xb839=function(_0x15ed8f,_0x560c29){_0x15ed8f=_0x15ed8f-0x0;var _0x524357=_0x839b[_0x15ed8f];return _0x524357;};'use strict';var Sequelize=require(_0xb839('0x0'));module[_0xb839('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xb839('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb839('0x3')](0xb),'unique':_0xb839('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb839('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xb839('0x5')]},'defaultLogo':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb839('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xb839('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xb839('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xb839('0x5')]},'pageTitle':{'type':Sequelize[_0xb839('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb839('0x5')],'defaultValue':_0xb839('0x7')},'enableEmailPreview':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb839('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb839('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb839('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb839('0x5')]},'defaultFavicon':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xb839('0x3')]},'transcribeRegion':{'type':Sequelize[_0xb839('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb839('0x5')]},'bucket':{'type':Sequelize[_0xb839('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xb839('0x3')](0x2)[_0xb839('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xb839('0x3')](0x2)[_0xb839('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xb839('0x3')](0x2)[_0xb839('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xb839('0x3')](0x2)[_0xb839('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xb839('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xb839('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xb839('0x3')],'defaultValue':0x14}}; \ No newline at end of file +var _0xcabe=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted'];(function(_0x259d11,_0x222597){var _0x34f70c=function(_0x5b6321){while(--_0x5b6321){_0x259d11['push'](_0x259d11['shift']());}};_0x34f70c(++_0x222597);}(_0xcabe,0x1ef));var _0xecab=function(_0x569a52,_0x4e97a8){_0x569a52=_0x569a52-0x0;var _0x37f0d3=_0xcabe[_0x569a52];return _0x37f0d3;};'use strict';var Sequelize=require(_0xecab('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xecab('0x1')](0xb),'unique':_0xecab('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xecab('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xecab('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xecab('0x4')},'logo':{'type':Sequelize[_0xecab('0x5')]},'defaultLogo':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xecab('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xecab('0x5')]},'turnaddr':{'type':Sequelize[_0xecab('0x5')]},'turnusername':{'type':Sequelize[_0xecab('0x5')]},'turnpassword':{'type':Sequelize[_0xecab('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xecab('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xecab('0x5')],'defaultValue':_0xecab('0x7')},'enableEmailPreview':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xecab('0x5')],'defaultValue':_0xecab('0x8')},'chatTimeout':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xecab('0x5')]},'defaultPreferred':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xecab('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xecab('0x5')]},'defaultFavicon':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xecab('0x1')]},'transcribeRegion':{'type':Sequelize[_0xecab('0x5')]},'sentiment':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xecab('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xecab('0x5')]},'bucket':{'type':Sequelize[_0xecab('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xecab('0x1')](0x2)[_0xecab('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xecab('0x1')](0x2)[_0xecab('0x9')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0xecab('0x9')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xecab('0x1')](0x2)[_0xecab('0x9')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xecab('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x5},'disabledCookie':{'type':Sequelize[_0xecab('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xecab('0x1')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 366401e..1970ca8 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 _0xf82e=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Setting','includeAll','include','findAll','rows','show','params','find','update','body','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','Sequelize','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','now','utcOffset','format','send','eml-format','rimraf'];(function(_0x56f2a3,_0x3d3a98){var _0x5bc392=function(_0x57d207){while(--_0x57d207){_0x56f2a3['push'](_0x56f2a3['shift']());}};_0x5bc392(++_0x3d3a98);}(_0xf82e,0x172));var _0xef82=function(_0x13a25d,_0x291e00){_0x13a25d=_0x13a25d-0x0;var _0xd18cc7=_0xf82e[_0x13a25d];return _0xd18cc7;};'use strict';var emlformat=require(_0xef82('0x0'));var rimraf=require(_0xef82('0x1'));var zipdir=require(_0xef82('0x2'));var jsonpatch=require(_0xef82('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xef82('0x4'));var Mustache=require(_0xef82('0x5'));var util=require(_0xef82('0x6'));var path=require(_0xef82('0x7'));var sox=require(_0xef82('0x8'));var csv=require(_0xef82('0x9'));var ejs=require(_0xef82('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xef82('0xb'));var crypto=require(_0xef82('0xc'));var jsforce=require(_0xef82('0xd'));var deskjs=require(_0xef82('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xef82('0xf'));var authService=require(_0xef82('0x10'));var qs=require(_0xef82('0x11'));var as=require(_0xef82('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef82('0x13'))(_0xef82('0x14'));var utils=require(_0xef82('0x15'));var config=require(_0xef82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xef82('0x17'))['db'];var jayson=require(_0xef82('0x18'));var client=jayson[_0xef82('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b856a,_0x4257f2,_0x5ea809,_0x4d340e){return new BPromise(function(_0x1fdffd,_0x1672d5){var _0x3b0cfe=_0x4d340e||client;return _0x3b0cfe['request'](_0x2b856a,_0x5ea809)['then'](function(_0x1df086){logger[_0xef82('0x1a')](_0xef82('0x1b'),_0x4257f2,'request\x20sent');logger['debug'](_0xef82('0x1c'),_0x4257f2,_0xef82('0x1d'),JSON['stringify'](_0x1df086));if(_0x1df086[_0xef82('0x1e')]){if(_0x1df086['error'][_0xef82('0x1f')]===0x1f4){logger[_0xef82('0x1e')](_0xef82('0x1b'),_0x4257f2,_0x1df086['error'][_0xef82('0x20')]);return _0x1672d5(_0x1df086[_0xef82('0x1e')][_0xef82('0x20')]);}logger['error'](_0xef82('0x1b'),_0x4257f2,_0x1df086['error']['message']);return _0x1fdffd(_0x1df086['error'][_0xef82('0x20')]);}else{logger[_0xef82('0x1a')]('Setting,\x20%s,\x20%s',_0x4257f2,'request\x20sent');_0x1fdffd(_0x1df086[_0xef82('0x21')][_0xef82('0x20')]);}})[_0xef82('0x22')](function(_0x1a775c){logger[_0xef82('0x1e')](_0xef82('0x1b'),_0x4257f2,_0x1a775c);_0x1672d5(_0x1a775c);});});}function respondWithStatusCode(_0x55570d,_0x285e1){_0x285e1=_0x285e1||0xcc;return function(_0x330417){if(_0x330417){return _0x55570d[_0xef82('0x23')](_0x285e1);}return _0x55570d[_0xef82('0x24')](_0x285e1)[_0xef82('0x25')]();};}function respondWithResult(_0x3c8428,_0x105526){_0x105526=_0x105526||0xc8;return function(_0x5d0af3){if(_0x5d0af3){return _0x3c8428[_0xef82('0x24')](_0x105526)[_0xef82('0x26')](_0x5d0af3);}};}function respondWithFilteredResult(_0x54674e,_0x2ecda5){return function(_0x55d897){if(_0x55d897){var _0x21a073=typeof _0x2ecda5['offset']===_0xef82('0x27')&&typeof _0x2ecda5[_0xef82('0x28')]==='undefined';var _0x2151f7=_0x55d897['count'];var _0x4355f9=_0x21a073?0x0:_0x2ecda5[_0xef82('0x29')];var _0x4d5619=_0x21a073?_0x55d897[_0xef82('0x2a')]:_0x2ecda5[_0xef82('0x29')]+_0x2ecda5[_0xef82('0x28')];var _0x584925;if(_0x4d5619>=_0x2151f7){_0x4d5619=_0x2151f7;_0x584925=0xc8;}else{_0x584925=0xce;}_0x54674e[_0xef82('0x24')](_0x584925);return _0x54674e[_0xef82('0x2b')](_0xef82('0x2c'),_0x4355f9+'-'+_0x4d5619+'/'+_0x2151f7)[_0xef82('0x26')](_0x55d897);}return null;};}function patchUpdates(_0xc08abe){return function(_0x3cccd1){try{jsonpatch[_0xef82('0x2d')](_0x3cccd1,_0xc08abe,!![]);}catch(_0x21a383){return BPromise[_0xef82('0x2e')](_0x21a383);}return _0x3cccd1[_0xef82('0x2f')]();};}function saveUpdates(_0x4184ac,_0x9ad753){return function(_0x469335){if(_0x469335){return _0x469335['update'](_0x4184ac)[_0xef82('0x30')](function(_0x4ce60e){return _0x4ce60e;});}return null;};}function removeEntity(_0x33cfcf,_0x1c0e3e){return function(_0x343f1b){if(_0x343f1b){return _0x343f1b[_0xef82('0x31')]()[_0xef82('0x30')](function(){_0x33cfcf[_0xef82('0x24')](0xcc)[_0xef82('0x25')]();});}};}function handleEntityNotFound(_0x4af00c,_0x1eaa55){return function(_0x3404cb){if(!_0x3404cb){_0x4af00c['sendStatus'](0x194);}return _0x3404cb;};}function handleError(_0x785c20,_0x2d7185){_0x2d7185=_0x2d7185||0x1f4;return function(_0x529060){logger['error'](_0x529060[_0xef82('0x32')]);if(_0x529060[_0xef82('0x33')]){delete _0x529060[_0xef82('0x33')];}_0x785c20[_0xef82('0x24')](_0x2d7185)['send'](_0x529060);};}exports['index']=function(_0xed69a7,_0x3ae65b){var _0x389eeb={},_0xf54484={},_0x3cb385={'count':0x0,'rows':[]};var _0x2c8593=_[_0xef82('0x34')](db['Setting'][_0xef82('0x35')],function(_0x24dd75){return{'name':_0x24dd75[_0xef82('0x36')],'type':_0x24dd75[_0xef82('0x37')][_0xef82('0x38')]};});_0xf54484[_0xef82('0x39')]=_[_0xef82('0x34')](_0x2c8593,_0xef82('0x33'));_0xf54484[_0xef82('0x3a')]=_[_0xef82('0x3b')](_0xed69a7[_0xef82('0x3a')]);_0xf54484[_0xef82('0x3c')]=_['intersection'](_0xf54484[_0xef82('0x39')],_0xf54484[_0xef82('0x3a')]);_0x389eeb['attributes']=_[_0xef82('0x3d')](_0xf54484['model'],qs[_0xef82('0x3e')](_0xed69a7[_0xef82('0x3a')][_0xef82('0x3e')]));_0x389eeb[_0xef82('0x3f')]=_0x389eeb[_0xef82('0x3f')][_0xef82('0x40')]?_0x389eeb[_0xef82('0x3f')]:_0xf54484['model'];if(!_0xed69a7['query']['hasOwnProperty'](_0xef82('0x41'))){_0x389eeb['limit']=qs[_0xef82('0x28')](_0xed69a7['query']['limit']);_0x389eeb[_0xef82('0x29')]=qs[_0xef82('0x29')](_0xed69a7[_0xef82('0x3a')][_0xef82('0x29')]);}_0x389eeb[_0xef82('0x42')]=qs[_0xef82('0x43')](_0xed69a7[_0xef82('0x3a')][_0xef82('0x43')]);_0x389eeb[_0xef82('0x44')]=qs[_0xef82('0x3c')](_[_0xef82('0x45')](_0xed69a7[_0xef82('0x3a')],_0xf54484[_0xef82('0x3c')]),_0x2c8593);if(_0xed69a7['query'][_0xef82('0x46')]){_0x389eeb['where']=_[_0xef82('0x47')](_0x389eeb[_0xef82('0x44')],{'$or':_[_0xef82('0x34')](_0x2c8593,function(_0x2de34a){if(_0x2de34a['type']!==_0xef82('0x48')){var _0xeb1e94={};_0xeb1e94[_0x2de34a['name']]={'$like':'%'+_0xed69a7[_0xef82('0x3a')][_0xef82('0x46')]+'%'};return _0xeb1e94;}})});}_0x389eeb=_[_0xef82('0x47')]({},_0x389eeb,_0xed69a7[_0xef82('0x49')]);var _0x104e97={'where':_0x389eeb[_0xef82('0x44')]};return db[_0xef82('0x4a')][_0xef82('0x2a')](_0x104e97)[_0xef82('0x30')](function(_0x59bb67){_0x3cb385[_0xef82('0x2a')]=_0x59bb67;if(_0xed69a7[_0xef82('0x3a')][_0xef82('0x4b')]){_0x389eeb[_0xef82('0x4c')]=[{'all':!![]}];}return db[_0xef82('0x4a')][_0xef82('0x4d')](_0x389eeb);})[_0xef82('0x30')](function(_0x51a8bb){_0x3cb385[_0xef82('0x4e')]=_0x51a8bb;return _0x3cb385;})[_0xef82('0x30')](respondWithFilteredResult(_0x3ae65b,_0x389eeb))['catch'](handleError(_0x3ae65b,null));};exports[_0xef82('0x4f')]=function(_0x442640,_0x26b243){var _0x5e5df6={'raw':![],'where':{'id':_0x442640[_0xef82('0x50')]['id']}},_0x51d736={};_0x51d736[_0xef82('0x39')]=_[_0xef82('0x3b')](db['Setting'][_0xef82('0x35')]);_0x51d736[_0xef82('0x3a')]=_[_0xef82('0x3b')](_0x442640['query']);_0x51d736[_0xef82('0x3c')]=_[_0xef82('0x3d')](_0x51d736[_0xef82('0x39')],_0x51d736[_0xef82('0x3a')]);_0x5e5df6['attributes']=_['intersection'](_0x51d736[_0xef82('0x39')],qs[_0xef82('0x3e')](_0x442640[_0xef82('0x3a')][_0xef82('0x3e')]));_0x5e5df6[_0xef82('0x3f')]=_0x5e5df6['attributes'][_0xef82('0x40')]?_0x5e5df6[_0xef82('0x3f')]:_0x51d736[_0xef82('0x39')];if(_0x442640[_0xef82('0x3a')]['includeAll']){_0x5e5df6[_0xef82('0x4c')]=[{'all':!![]}];}_0x5e5df6=_[_0xef82('0x47')]({},_0x5e5df6,_0x442640[_0xef82('0x49')]);return db[_0xef82('0x4a')][_0xef82('0x51')](_0x5e5df6)[_0xef82('0x30')](handleEntityNotFound(_0x26b243,null))[_0xef82('0x30')](respondWithResult(_0x26b243,null))[_0xef82('0x22')](handleError(_0x26b243,null));};exports[_0xef82('0x52')]=function(_0x2e71c4,_0x45df21){if(_0x2e71c4[_0xef82('0x53')]['id']){delete _0x2e71c4[_0xef82('0x53')]['id'];}return db[_0xef82('0x4a')][_0xef82('0x51')]({'where':{'id':_0x2e71c4[_0xef82('0x50')]['id']}})[_0xef82('0x30')](handleEntityNotFound(_0x45df21,null))[_0xef82('0x30')](saveUpdates(_0x2e71c4[_0xef82('0x53')],null))[_0xef82('0x30')](respondWithResult(_0x45df21,null))['catch'](handleError(_0x45df21,null));};exports['addLogo']=function(_0x59865e,_0x1d8ef9,_0x57d278){if(_0x59865e[_0xef82('0x54')]&&_0x59865e[_0xef82('0x54')]['filename']){_0x59865e[_0xef82('0x53')][_0xef82('0x55')]=_0x59865e[_0xef82('0x54')][_0xef82('0x56')];}return db[_0xef82('0x4a')][_0xef82('0x51')]({'where':{'id':_0x59865e['params']['id']}})['then'](handleEntityNotFound(_0x1d8ef9,null))[_0xef82('0x30')](saveUpdates(_0x59865e[_0xef82('0x53')],null))['then'](respondWithResult(_0x1d8ef9,null))['catch'](handleError(_0x1d8ef9,null));};exports[_0xef82('0x57')]=function(_0x4f666b,_0x497be9,_0xe11f03){if(_0x4f666b['file']&&_0x4f666b[_0xef82('0x54')][_0xef82('0x56')]){_0x4f666b[_0xef82('0x53')][_0xef82('0x58')]=_0x4f666b[_0xef82('0x54')][_0xef82('0x56')];}return db['Setting'][_0xef82('0x51')]({'where':{'id':_0x4f666b[_0xef82('0x50')]['id']}})[_0xef82('0x30')](handleEntityNotFound(_0x497be9,null))['then'](saveUpdates(_0x4f666b[_0xef82('0x53')],null))[_0xef82('0x30')](respondWithResult(_0x497be9,null))[_0xef82('0x22')](handleError(_0x497be9,null));};var utilLicense=require(_0xef82('0x59'));exports[_0xef82('0x5a')]=function(_0x1bd87d,_0x2a4215,_0x2e43f9){var _0x581f39='server/files/images/logos';var _0x7ebb9d={'custom':![]};return utilLicense[_0xef82('0x5b')]()['then'](function(_0x424b04){if(_0x424b04){_0x7ebb9d=_0x424b04;}return db[_0xef82('0x4a')][_0xef82('0x51')]({'where':{'id':_0x1bd87d[_0xef82('0x50')]['id']},'attributes':[_0xef82('0x55'),_0xef82('0x58'),_0xef82('0x5c'),_0xef82('0x5d'),_0xef82('0x5e'),_0xef82('0x5f'),_0xef82('0x60'),_0xef82('0x61')],'raw':!![]});})[_0xef82('0x30')](handleEntityNotFound(_0x2a4215,null))[_0xef82('0x30')](function(_0x3fe26b){if(_0x3fe26b){var _0x3465e4=_0x3fe26b['logo']&&fs[_0xef82('0x62')](path[_0xef82('0x63')](config[_0xef82('0x64')],_0x581f39,_[_0xef82('0x65')](_0x3fe26b[_0xef82('0x55')])))?path[_0xef82('0x63')](config['root'],_0x581f39,_[_0xef82('0x65')](_0x3fe26b[_0xef82('0x55')])):path[_0xef82('0x63')](config[_0xef82('0x64')],_0x581f39,_[_0xef82('0x65')]('default_logo.svg'));var _0x12dcae=_0xef82('0x66')+_[_0xef82('0x67')](_0xef82('0x55'));if(_0x3fe26b[_0x12dcae]||!_0x7ebb9d[_0xef82('0x68')]){_0x3465e4=path[_0xef82('0x63')](config[_0xef82('0x64')],_0x581f39,_[_0xef82('0x65')]('default_logo.svg'));}if(!fs[_0xef82('0x62')](_0x3465e4)){throw new db['Sequelize'][(_0xef82('0x69'))](_[_0xef82('0x67')](_0xef82('0x55'))+_0xef82('0x6a'));}return _0x2a4215[_0xef82('0x6b')](_0x3465e4);}})[_0xef82('0x22')](handleError(_0x2a4215,null));};var utilLicense=require(_0xef82('0x59'));exports[_0xef82('0x6c')]=function(_0x3a38ee,_0x4c37ec,_0x5c876c){var _0x3b3e95=_0xef82('0x6d');var _0x2b5bc3={'custom':![]};return utilLicense[_0xef82('0x5b')]()[_0xef82('0x30')](function(_0x589be1){if(_0x589be1){_0x2b5bc3=_0x589be1;}return db[_0xef82('0x4a')]['find']({'where':{'id':_0x3a38ee[_0xef82('0x50')]['id']},'attributes':[_0xef82('0x55'),_0xef82('0x58'),_0xef82('0x5c'),_0xef82('0x5d'),_0xef82('0x5e'),_0xef82('0x5f'),_0xef82('0x60'),_0xef82('0x61')],'raw':!![]});})[_0xef82('0x30')](handleEntityNotFound(_0x4c37ec,null))['then'](function(_0x20869f){if(_0x20869f){var _0xbb864e=_0x20869f['loginLogo']&&fs[_0xef82('0x62')](path[_0xef82('0x63')](config[_0xef82('0x64')],_0x3b3e95,_[_0xef82('0x65')](_0x20869f[_0xef82('0x58')])))?path[_0xef82('0x63')](config[_0xef82('0x64')],_0x3b3e95,_['toLower'](_0x20869f[_0xef82('0x58')])):path[_0xef82('0x63')](config[_0xef82('0x64')],_0x3b3e95,_['toLower'](_0xef82('0x6e')));var _0x5eb260=_0xef82('0x66')+_[_0xef82('0x67')](_0xef82('0x58'));if(_0x20869f[_0x5eb260]||!_0x2b5bc3[_0xef82('0x68')]){_0xbb864e=path['join'](config[_0xef82('0x64')],_0x3b3e95,_[_0xef82('0x65')](_0xef82('0x6e')));}if(!fs[_0xef82('0x62')](_0xbb864e)){throw new db[(_0xef82('0x6f'))][(_0xef82('0x69'))](_[_0xef82('0x67')]('loginLogo')+'\x20not\x20found');}return _0x4c37ec['download'](_0xbb864e);}})[_0xef82('0x22')](handleError(_0x4c37ec,null));};exports[_0xef82('0x70')]=function(_0x37fe88,_0x5b6a16){return db[_0xef82('0x4a')][_0xef82('0x51')]({'where':{'id':_0x37fe88[_0xef82('0x50')]['id']},'attributes':[_0xef82('0x71')]})[_0xef82('0x30')](respondWithResult(_0x5b6a16,null))[_0xef82('0x22')](handleError(_0x5b6a16,null));};exports[_0xef82('0x72')]=function(_0xa6805b,_0x339286,_0x386457){if(_0xa6805b[_0xef82('0x54')]&&_0xa6805b[_0xef82('0x54')][_0xef82('0x56')]){_0xa6805b[_0xef82('0x53')][_0xef82('0x5c')]=_0xa6805b['file'][_0xef82('0x56')];}return db['Setting']['find']({'where':{'id':_0xa6805b[_0xef82('0x50')]['id']}})[_0xef82('0x30')](handleEntityNotFound(_0x339286,null))['then'](saveUpdates(_0xa6805b['body'],null))[_0xef82('0x30')](respondWithResult(_0x339286,null))[_0xef82('0x22')](handleError(_0x339286,null));};var utilLicense=require(_0xef82('0x59'));exports[_0xef82('0x73')]=function(_0x4a1352,_0xe4e91c,_0xa6bd96){var _0x4245ca=_0xef82('0x6d');var _0x11161b={'custom':![]};return utilLicense[_0xef82('0x5b')]()['then'](function(_0xada35a){if(_0xada35a){_0x11161b=_0xada35a;}return db[_0xef82('0x4a')][_0xef82('0x51')]({'where':{'id':_0x4a1352[_0xef82('0x50')]['id']},'attributes':[_0xef82('0x55'),_0xef82('0x58'),_0xef82('0x5c'),_0xef82('0x5d'),_0xef82('0x5e'),_0xef82('0x5f'),'defaultPreferred',_0xef82('0x61')],'raw':!![]});})[_0xef82('0x30')](handleEntityNotFound(_0xe4e91c,null))[_0xef82('0x30')](function(_0x5deaf9){if(_0x5deaf9){var _0x32cc5b=_0x5deaf9[_0xef82('0x5c')]&&fs[_0xef82('0x62')](path[_0xef82('0x63')](config[_0xef82('0x64')],_0x4245ca,_[_0xef82('0x65')](_0x5deaf9[_0xef82('0x5c')])))?path['join'](config['root'],_0x4245ca,_['toLower'](_0x5deaf9[_0xef82('0x5c')])):path[_0xef82('0x63')](config['root'],_0x4245ca,_[_0xef82('0x65')](_0xef82('0x74')));var _0x16be84=_0xef82('0x66')+_[_0xef82('0x67')](_0xef82('0x5c'));if(_0x5deaf9[_0x16be84]||!_0x11161b[_0xef82('0x68')]||!_0x11161b[_0xef82('0x5c')]){_0x32cc5b=path[_0xef82('0x63')](config['root'],_0x4245ca,_[_0xef82('0x65')](_0xef82('0x74')));}if(!fs['existsSync'](_0x32cc5b)){throw new db['Sequelize'][(_0xef82('0x69'))](_['upperFirst'](_0xef82('0x5c'))+_0xef82('0x6a'));}return _0xe4e91c['download'](_0x32cc5b);}})['catch'](handleError(_0xe4e91c,null));};exports[_0xef82('0x75')]=function(_0x2f5370,_0x4aa8ce,_0x518e3b){if(_0x2f5370[_0xef82('0x54')]&&_0x2f5370['file'][_0xef82('0x56')]){_0x2f5370[_0xef82('0x53')][_0xef82('0x5d')]=_0x2f5370[_0xef82('0x54')][_0xef82('0x56')];}return db['Setting'][_0xef82('0x51')]({'where':{'id':_0x2f5370[_0xef82('0x50')]['id']}})[_0xef82('0x30')](handleEntityNotFound(_0x4aa8ce,null))[_0xef82('0x30')](saveUpdates(_0x2f5370[_0xef82('0x53')],null))['then'](respondWithResult(_0x4aa8ce,null))[_0xef82('0x22')](handleError(_0x4aa8ce,null));};var utilLicense=require(_0xef82('0x59'));exports['getFavicon']=function(_0xc99a5,_0x4a5722,_0x128ac7){var _0x43d62c=_0xef82('0x6d');var _0x4a358d={'custom':![]};return utilLicense[_0xef82('0x5b')]()['then'](function(_0x23addd){if(_0x23addd){_0x4a358d=_0x23addd;}return db[_0xef82('0x4a')][_0xef82('0x51')]({'where':{'id':_0xc99a5[_0xef82('0x50')]['id']},'attributes':[_0xef82('0x55'),_0xef82('0x58'),'preferred',_0xef82('0x5d'),'defaultLogo',_0xef82('0x5f'),'defaultPreferred',_0xef82('0x61')],'raw':!![]});})[_0xef82('0x30')](handleEntityNotFound(_0x4a5722,null))[_0xef82('0x30')](function(_0x2734d3){if(_0x2734d3){var _0x4e2cb3=_0x2734d3[_0xef82('0x5d')]&&fs[_0xef82('0x62')](path['join'](config[_0xef82('0x64')],_0x43d62c,_[_0xef82('0x65')](_0x2734d3[_0xef82('0x5d')])))?path[_0xef82('0x63')](config[_0xef82('0x64')],_0x43d62c,_[_0xef82('0x65')](_0x2734d3[_0xef82('0x5d')])):path[_0xef82('0x63')](config[_0xef82('0x64')],_0x43d62c,_['toLower'](_0xef82('0x76')));var _0x1f396e=_0xef82('0x66')+_[_0xef82('0x67')](_0xef82('0x5d'));if(_0x2734d3[_0x1f396e]||!_0x4a358d[_0xef82('0x68')]){_0x4e2cb3=path['join'](config[_0xef82('0x64')],_0x43d62c,_[_0xef82('0x65')](_0xef82('0x76')));}if(!fs[_0xef82('0x62')](_0x4e2cb3)){throw new db[(_0xef82('0x6f'))][(_0xef82('0x69'))](_['upperFirst'](_0xef82('0x5d'))+_0xef82('0x6a'));}return _0x4a5722[_0xef82('0x6b')](_0x4e2cb3);}})[_0xef82('0x22')](handleError(_0x4a5722,null));};exports[_0xef82('0x77')]=function(_0x86a754,_0xc96c72){var _0x366e59={'offset':moment()['utcOffset']()};_0x366e59[_0xef82('0x78')]=moment()[_0xef82('0x79')](_0x366e59[_0xef82('0x29')])[_0xef82('0x7a')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0xc96c72['status'](0xc8)[_0xef82('0x7b')](_0x366e59);}; \ No newline at end of file +var _0x6a88=['pick','filters','filter','where','Setting','includeAll','findAll','rows','show','params','fields','include','find','update','body','addLogo','file','logo','filename','loginLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','getLicense','defaultPreferred','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','destroy','end','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x6a88,0xa9));var _0x86a8=function(_0x1c8c2f,_0x1d99fe){_0x1c8c2f=_0x1c8c2f-0x0;var _0x24fa67=_0x6a88[_0x1c8c2f];return _0x24fa67;};'use strict';var emlformat=require(_0x86a8('0x0'));var rimraf=require(_0x86a8('0x1'));var zipdir=require(_0x86a8('0x2'));var jsonpatch=require(_0x86a8('0x3'));var rp=require(_0x86a8('0x4'));var moment=require(_0x86a8('0x5'));var BPromise=require(_0x86a8('0x6'));var Mustache=require('mustache');var util=require(_0x86a8('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x86a8('0x8'));var ejs=require(_0x86a8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86a8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x86a8('0xb'));var deskjs=require(_0x86a8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x86a8('0xd'));var Papa=require(_0x86a8('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86a8('0xf'));var as=require(_0x86a8('0x10'));var hardwareService=require(_0x86a8('0x11'));var logger=require(_0x86a8('0x12'))(_0x86a8('0x13'));var utils=require(_0x86a8('0x14'));var config=require(_0x86a8('0x15'));var licenseUtil=require(_0x86a8('0x16'));var db=require(_0x86a8('0x17'))['db'];var jayson=require(_0x86a8('0x18'));var client=jayson['client'][_0x86a8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4f1887,_0x54194f,_0x430729,_0x29a430){return new BPromise(function(_0x5d5b9d,_0x520697){var _0x4f8076=_0x29a430||client;return _0x4f8076[_0x86a8('0x1a')](_0x4f1887,_0x430729)[_0x86a8('0x1b')](function(_0x507fef){logger[_0x86a8('0x1c')](_0x86a8('0x1d'),_0x54194f,_0x86a8('0x1e'));logger[_0x86a8('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0x54194f,_0x86a8('0x1e'),JSON['stringify'](_0x507fef));if(_0x507fef[_0x86a8('0x20')]){if(_0x507fef[_0x86a8('0x20')][_0x86a8('0x21')]===0x1f4){logger[_0x86a8('0x20')](_0x86a8('0x1d'),_0x54194f,_0x507fef[_0x86a8('0x20')][_0x86a8('0x22')]);return _0x520697(_0x507fef[_0x86a8('0x20')][_0x86a8('0x22')]);}logger['error'](_0x86a8('0x1d'),_0x54194f,_0x507fef[_0x86a8('0x20')][_0x86a8('0x22')]);return _0x5d5b9d(_0x507fef[_0x86a8('0x20')]['message']);}else{logger['info'](_0x86a8('0x1d'),_0x54194f,_0x86a8('0x1e'));_0x5d5b9d(_0x507fef['result'][_0x86a8('0x22')]);}})[_0x86a8('0x23')](function(_0x4b0abf){logger[_0x86a8('0x20')](_0x86a8('0x1d'),_0x54194f,_0x4b0abf);_0x520697(_0x4b0abf);});});}function respondWithStatusCode(_0x5eb4df,_0x42a7f2){_0x42a7f2=_0x42a7f2||0xcc;return function(_0x34578a){if(_0x34578a){return _0x5eb4df[_0x86a8('0x24')](_0x42a7f2);}return _0x5eb4df[_0x86a8('0x25')](_0x42a7f2)['end']();};}function respondWithResult(_0x325fc8,_0x2dfde7){_0x2dfde7=_0x2dfde7||0xc8;return function(_0x2b6c1d){if(_0x2b6c1d){return _0x325fc8[_0x86a8('0x25')](_0x2dfde7)[_0x86a8('0x26')](_0x2b6c1d);}};}function respondWithFilteredResult(_0x3891bc,_0x1991fe){return function(_0x503613){if(_0x503613){var _0x5d3924=typeof _0x1991fe[_0x86a8('0x27')]==='undefined'&&typeof _0x1991fe['limit']===_0x86a8('0x28');var _0x146757=_0x503613[_0x86a8('0x29')];var _0x1059fc=_0x5d3924?0x0:_0x1991fe[_0x86a8('0x27')];var _0x35147b=_0x5d3924?_0x503613[_0x86a8('0x29')]:_0x1991fe['offset']+_0x1991fe[_0x86a8('0x2a')];var _0x3ddded;if(_0x35147b>=_0x146757){_0x35147b=_0x146757;_0x3ddded=0xc8;}else{_0x3ddded=0xce;}_0x3891bc[_0x86a8('0x25')](_0x3ddded);return _0x3891bc['set'](_0x86a8('0x2b'),_0x1059fc+'-'+_0x35147b+'/'+_0x146757)[_0x86a8('0x26')](_0x503613);}return null;};}function patchUpdates(_0x29e81e){return function(_0x39052e){try{jsonpatch[_0x86a8('0x2c')](_0x39052e,_0x29e81e,!![]);}catch(_0x4287ae){return BPromise[_0x86a8('0x2d')](_0x4287ae);}return _0x39052e[_0x86a8('0x2e')]();};}function saveUpdates(_0x3d1ce9,_0x34c364){return function(_0x407e4e){if(_0x407e4e){return _0x407e4e['update'](_0x3d1ce9)['then'](function(_0x5e2883){return _0x5e2883;});}return null;};}function removeEntity(_0x17fcc2,_0x2a2fb6){return function(_0x4326f5){if(_0x4326f5){return _0x4326f5[_0x86a8('0x2f')]()[_0x86a8('0x1b')](function(){_0x17fcc2[_0x86a8('0x25')](0xcc)[_0x86a8('0x30')]();});}};}function handleEntityNotFound(_0x39ea18,_0x43558f){return function(_0x519c52){if(!_0x519c52){_0x39ea18[_0x86a8('0x24')](0x194);}return _0x519c52;};}function handleError(_0x34bc3c,_0x4a881d){_0x4a881d=_0x4a881d||0x1f4;return function(_0x421d69){logger[_0x86a8('0x20')](_0x421d69['stack']);if(_0x421d69[_0x86a8('0x31')]){delete _0x421d69[_0x86a8('0x31')];}_0x34bc3c['status'](_0x4a881d)[_0x86a8('0x32')](_0x421d69);};}exports[_0x86a8('0x33')]=function(_0x231b7c,_0x497286){var _0x2b5813={},_0x47181d={},_0x240004={'count':0x0,'rows':[]};var _0x55712a=_[_0x86a8('0x34')](db['Setting']['rawAttributes'],function(_0x39c609){return{'name':_0x39c609[_0x86a8('0x35')],'type':_0x39c609[_0x86a8('0x36')][_0x86a8('0x37')]};});_0x47181d[_0x86a8('0x38')]=_['map'](_0x55712a,_0x86a8('0x31'));_0x47181d[_0x86a8('0x39')]=_[_0x86a8('0x3a')](_0x231b7c['query']);_0x47181d['filters']=_[_0x86a8('0x3b')](_0x47181d['model'],_0x47181d[_0x86a8('0x39')]);_0x2b5813[_0x86a8('0x3c')]=_['intersection'](_0x47181d['model'],qs['fields'](_0x231b7c[_0x86a8('0x39')]['fields']));_0x2b5813['attributes']=_0x2b5813[_0x86a8('0x3c')][_0x86a8('0x3d')]?_0x2b5813[_0x86a8('0x3c')]:_0x47181d['model'];if(!_0x231b7c[_0x86a8('0x39')]['hasOwnProperty'](_0x86a8('0x3e'))){_0x2b5813[_0x86a8('0x2a')]=qs[_0x86a8('0x2a')](_0x231b7c[_0x86a8('0x39')][_0x86a8('0x2a')]);_0x2b5813['offset']=qs[_0x86a8('0x27')](_0x231b7c[_0x86a8('0x39')][_0x86a8('0x27')]);}_0x2b5813[_0x86a8('0x3f')]=qs[_0x86a8('0x40')](_0x231b7c[_0x86a8('0x39')][_0x86a8('0x40')]);_0x2b5813['where']=qs['filters'](_[_0x86a8('0x41')](_0x231b7c[_0x86a8('0x39')],_0x47181d[_0x86a8('0x42')]),_0x55712a);if(_0x231b7c[_0x86a8('0x39')][_0x86a8('0x43')]){_0x2b5813[_0x86a8('0x44')]=_['merge'](_0x2b5813['where'],{'$or':_['map'](_0x55712a,function(_0x1b4340){if(_0x1b4340[_0x86a8('0x36')]!=='VIRTUAL'){var _0x4f1bce={};_0x4f1bce[_0x1b4340[_0x86a8('0x31')]]={'$like':'%'+_0x231b7c['query'][_0x86a8('0x43')]+'%'};return _0x4f1bce;}})});}_0x2b5813=_['merge']({},_0x2b5813,_0x231b7c['options']);var _0x35c5e9={'where':_0x2b5813[_0x86a8('0x44')]};return db[_0x86a8('0x45')][_0x86a8('0x29')](_0x35c5e9)[_0x86a8('0x1b')](function(_0x32b453){_0x240004['count']=_0x32b453;if(_0x231b7c[_0x86a8('0x39')][_0x86a8('0x46')]){_0x2b5813['include']=[{'all':!![]}];}return db[_0x86a8('0x45')][_0x86a8('0x47')](_0x2b5813);})[_0x86a8('0x1b')](function(_0x5cc9d7){_0x240004[_0x86a8('0x48')]=_0x5cc9d7;return _0x240004;})['then'](respondWithFilteredResult(_0x497286,_0x2b5813))[_0x86a8('0x23')](handleError(_0x497286,null));};exports[_0x86a8('0x49')]=function(_0x4479d9,_0x4964f0){var _0x1b042c={'raw':![],'where':{'id':_0x4479d9[_0x86a8('0x4a')]['id']}},_0x257f39={};_0x257f39['model']=_[_0x86a8('0x3a')](db['Setting']['rawAttributes']);_0x257f39[_0x86a8('0x39')]=_[_0x86a8('0x3a')](_0x4479d9[_0x86a8('0x39')]);_0x257f39['filters']=_[_0x86a8('0x3b')](_0x257f39[_0x86a8('0x38')],_0x257f39[_0x86a8('0x39')]);_0x1b042c[_0x86a8('0x3c')]=_[_0x86a8('0x3b')](_0x257f39['model'],qs[_0x86a8('0x4b')](_0x4479d9['query'][_0x86a8('0x4b')]));_0x1b042c['attributes']=_0x1b042c[_0x86a8('0x3c')][_0x86a8('0x3d')]?_0x1b042c[_0x86a8('0x3c')]:_0x257f39[_0x86a8('0x38')];if(_0x4479d9[_0x86a8('0x39')][_0x86a8('0x46')]){_0x1b042c[_0x86a8('0x4c')]=[{'all':!![]}];}_0x1b042c=_['merge']({},_0x1b042c,_0x4479d9['options']);return db[_0x86a8('0x45')][_0x86a8('0x4d')](_0x1b042c)['then'](handleEntityNotFound(_0x4964f0,null))[_0x86a8('0x1b')](respondWithResult(_0x4964f0,null))[_0x86a8('0x23')](handleError(_0x4964f0,null));};exports[_0x86a8('0x4e')]=function(_0x40228e,_0x2c0d29){if(_0x40228e[_0x86a8('0x4f')]['id']){delete _0x40228e[_0x86a8('0x4f')]['id'];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x40228e[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x2c0d29,null))[_0x86a8('0x1b')](saveUpdates(_0x40228e[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x2c0d29,null))[_0x86a8('0x23')](handleError(_0x2c0d29,null));};exports[_0x86a8('0x50')]=function(_0x206fb7,_0x482283,_0x48656a){if(_0x206fb7[_0x86a8('0x51')]&&_0x206fb7[_0x86a8('0x51')]['filename']){_0x206fb7[_0x86a8('0x4f')][_0x86a8('0x52')]=_0x206fb7[_0x86a8('0x51')][_0x86a8('0x53')];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x206fb7[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x482283,null))[_0x86a8('0x1b')](saveUpdates(_0x206fb7[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x482283,null))['catch'](handleError(_0x482283,null));};exports['addLogoLogin']=function(_0x409045,_0x2ba2f8,_0x2f4519){if(_0x409045[_0x86a8('0x51')]&&_0x409045[_0x86a8('0x51')][_0x86a8('0x53')]){_0x409045[_0x86a8('0x4f')][_0x86a8('0x54')]=_0x409045[_0x86a8('0x51')][_0x86a8('0x53')];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x409045[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x2ba2f8,null))[_0x86a8('0x1b')](saveUpdates(_0x409045['body'],null))[_0x86a8('0x1b')](respondWithResult(_0x2ba2f8,null))['catch'](handleError(_0x2ba2f8,null));};var utilLicense=require(_0x86a8('0x16'));exports['getLogo']=function(_0x483d69,_0x390f27,_0x4dd432){var _0x314e61=_0x86a8('0x55');var _0x38447d={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xcd0db4){if(_0xcd0db4){_0x38447d=_0xcd0db4;}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x483d69['params']['id']},'attributes':[_0x86a8('0x52'),'loginLogo',_0x86a8('0x56'),_0x86a8('0x57'),_0x86a8('0x58'),_0x86a8('0x59'),'defaultPreferred',_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x390f27,null))[_0x86a8('0x1b')](function(_0x5bd882){if(_0x5bd882){var _0x4c1717=_0x5bd882[_0x86a8('0x52')]&&fs[_0x86a8('0x5b')](path['join'](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x5bd882[_0x86a8('0x52')])))?path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x5bd882['logo'])):path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x86a8('0x5f')));var _0x276141=_0x86a8('0x60')+_[_0x86a8('0x61')](_0x86a8('0x52'));if(_0x5bd882[_0x276141]||!_0x38447d[_0x86a8('0x62')]){_0x4c1717=path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x314e61,_[_0x86a8('0x5d')](_0x86a8('0x5f')));}if(!fs[_0x86a8('0x5b')](_0x4c1717)){throw new db[(_0x86a8('0x63'))]['ValidationError'](_[_0x86a8('0x61')](_0x86a8('0x52'))+_0x86a8('0x64'));}return _0x390f27[_0x86a8('0x65')](_0x4c1717);}})[_0x86a8('0x23')](handleError(_0x390f27,null));};var utilLicense=require(_0x86a8('0x16'));exports[_0x86a8('0x66')]=function(_0x3d7c4a,_0x4e09ec,_0x32b4c7){var _0x281347=_0x86a8('0x55');var _0x5d5e={'custom':![]};return utilLicense[_0x86a8('0x67')]()[_0x86a8('0x1b')](function(_0x13b554){if(_0x13b554){_0x5d5e=_0x13b554;}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x3d7c4a[_0x86a8('0x4a')]['id']},'attributes':[_0x86a8('0x52'),_0x86a8('0x54'),'preferred',_0x86a8('0x57'),_0x86a8('0x58'),_0x86a8('0x59'),_0x86a8('0x68'),_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x4e09ec,null))[_0x86a8('0x1b')](function(_0xc24b1d){if(_0xc24b1d){var _0x287d06=_0xc24b1d[_0x86a8('0x54')]&&fs[_0x86a8('0x5b')](path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x281347,_[_0x86a8('0x5d')](_0xc24b1d[_0x86a8('0x54')])))?path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x281347,_[_0x86a8('0x5d')](_0xc24b1d[_0x86a8('0x54')])):path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x281347,_[_0x86a8('0x5d')](_0x86a8('0x69')));var _0x11701d=_0x86a8('0x60')+_[_0x86a8('0x61')](_0x86a8('0x54'));if(_0xc24b1d[_0x11701d]||!_0x5d5e[_0x86a8('0x62')]){_0x287d06=path['join'](config[_0x86a8('0x5c')],_0x281347,_['toLower'](_0x86a8('0x69')));}if(!fs[_0x86a8('0x5b')](_0x287d06)){throw new db['Sequelize'][(_0x86a8('0x6a'))](_['upperFirst']('loginLogo')+_0x86a8('0x64'));}return _0x4e09ec[_0x86a8('0x65')](_0x287d06);}})['catch'](handleError(_0x4e09ec,null));};exports[_0x86a8('0x6b')]=function(_0x15ce58,_0x19aaf9){return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x15ce58[_0x86a8('0x4a')]['id']},'attributes':[_0x86a8('0x6c')]})[_0x86a8('0x1b')](respondWithResult(_0x19aaf9,null))['catch'](handleError(_0x19aaf9,null));};exports[_0x86a8('0x6d')]=function(_0x440f43,_0x4917e1,_0x1502c0){if(_0x440f43[_0x86a8('0x51')]&&_0x440f43['file'][_0x86a8('0x53')]){_0x440f43[_0x86a8('0x4f')][_0x86a8('0x56')]=_0x440f43['file'][_0x86a8('0x53')];}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x440f43[_0x86a8('0x4a')]['id']}})[_0x86a8('0x1b')](handleEntityNotFound(_0x4917e1,null))[_0x86a8('0x1b')](saveUpdates(_0x440f43[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x4917e1,null))[_0x86a8('0x23')](handleError(_0x4917e1,null));};var utilLicense=require('../../config/license/util');exports[_0x86a8('0x6e')]=function(_0x1fbcc0,_0x2313cc,_0x110ce8){var _0x507607=_0x86a8('0x55');var _0x54d4c9={'custom':![]};return utilLicense['getLicense']()[_0x86a8('0x1b')](function(_0xc0c8bf){if(_0xc0c8bf){_0x54d4c9=_0xc0c8bf;}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x1fbcc0[_0x86a8('0x4a')]['id']},'attributes':[_0x86a8('0x52'),'loginLogo',_0x86a8('0x56'),_0x86a8('0x57'),'defaultLogo',_0x86a8('0x59'),_0x86a8('0x68'),_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x2313cc,null))['then'](function(_0xe6876d){if(_0xe6876d){var _0x1ed8dd=_0xe6876d[_0x86a8('0x56')]&&fs['existsSync'](path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x507607,_[_0x86a8('0x5d')](_0xe6876d[_0x86a8('0x56')])))?path['join'](config[_0x86a8('0x5c')],_0x507607,_[_0x86a8('0x5d')](_0xe6876d[_0x86a8('0x56')])):path[_0x86a8('0x5e')](config['root'],_0x507607,_[_0x86a8('0x5d')]('default_preferred.png'));var _0x306f38='default'+_[_0x86a8('0x61')](_0x86a8('0x56'));if(_0xe6876d[_0x306f38]||!_0x54d4c9[_0x86a8('0x62')]||!_0x54d4c9[_0x86a8('0x56')]){_0x1ed8dd=path['join'](config[_0x86a8('0x5c')],_0x507607,_['toLower'](_0x86a8('0x6f')));}if(!fs[_0x86a8('0x5b')](_0x1ed8dd)){throw new db[(_0x86a8('0x63'))][(_0x86a8('0x6a'))](_['upperFirst'](_0x86a8('0x56'))+'\x20not\x20found');}return _0x2313cc[_0x86a8('0x65')](_0x1ed8dd);}})[_0x86a8('0x23')](handleError(_0x2313cc,null));};exports[_0x86a8('0x70')]=function(_0x212c42,_0x897c7e,_0x41835c){if(_0x212c42[_0x86a8('0x51')]&&_0x212c42[_0x86a8('0x51')][_0x86a8('0x53')]){_0x212c42[_0x86a8('0x4f')]['favicon']=_0x212c42[_0x86a8('0x51')][_0x86a8('0x53')];}return db[_0x86a8('0x45')][_0x86a8('0x4d')]({'where':{'id':_0x212c42['params']['id']}})['then'](handleEntityNotFound(_0x897c7e,null))[_0x86a8('0x1b')](saveUpdates(_0x212c42[_0x86a8('0x4f')],null))[_0x86a8('0x1b')](respondWithResult(_0x897c7e,null))[_0x86a8('0x23')](handleError(_0x897c7e,null));};var utilLicense=require('../../config/license/util');exports[_0x86a8('0x71')]=function(_0x13c502,_0x4a4225,_0x53fbc8){var _0x3c89fa=_0x86a8('0x55');var _0x1bf333={'custom':![]};return utilLicense[_0x86a8('0x67')]()['then'](function(_0x172ab6){if(_0x172ab6){_0x1bf333=_0x172ab6;}return db[_0x86a8('0x45')]['find']({'where':{'id':_0x13c502['params']['id']},'attributes':['logo','loginLogo',_0x86a8('0x56'),'favicon','defaultLogo',_0x86a8('0x59'),_0x86a8('0x68'),_0x86a8('0x5a')],'raw':!![]});})[_0x86a8('0x1b')](handleEntityNotFound(_0x4a4225,null))[_0x86a8('0x1b')](function(_0x4e4329){if(_0x4e4329){var _0x15b707=_0x4e4329[_0x86a8('0x57')]&&fs[_0x86a8('0x5b')](path['join'](config[_0x86a8('0x5c')],_0x3c89fa,_['toLower'](_0x4e4329[_0x86a8('0x57')])))?path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x3c89fa,_[_0x86a8('0x5d')](_0x4e4329[_0x86a8('0x57')])):path[_0x86a8('0x5e')](config['root'],_0x3c89fa,_[_0x86a8('0x5d')](_0x86a8('0x72')));var _0x137e85=_0x86a8('0x60')+_['upperFirst']('favicon');if(_0x4e4329[_0x137e85]||!_0x1bf333['custom']){_0x15b707=path[_0x86a8('0x5e')](config[_0x86a8('0x5c')],_0x3c89fa,_[_0x86a8('0x5d')](_0x86a8('0x72')));}if(!fs[_0x86a8('0x5b')](_0x15b707)){throw new db['Sequelize'][(_0x86a8('0x6a'))](_[_0x86a8('0x61')]('favicon')+_0x86a8('0x64'));}return _0x4a4225[_0x86a8('0x65')](_0x15b707);}})[_0x86a8('0x23')](handleError(_0x4a4225,null));};exports['getDate']=function(_0x4aabae,_0x322811){var _0x5891c5={'offset':moment()[_0x86a8('0x73')]()};_0x5891c5[_0x86a8('0x74')]=moment()[_0x86a8('0x73')](_0x5891c5[_0x86a8('0x27')])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x322811[_0x86a8('0x25')](0xc8)['send'](_0x5891c5);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 1227650..1c2e279 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 _0xe14b=['bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash','util','moment'];(function(_0x25e2ce,_0xb6b767){var _0x4c427d=function(_0x5bf1d9){while(--_0x5bf1d9){_0x25e2ce['push'](_0x25e2ce['shift']());}};_0x4c427d(++_0xb6b767);}(_0xe14b,0x93));var _0xbe14=function(_0x3e4f8c,_0x525195){_0x3e4f8c=_0x3e4f8c-0x0;var _0xb2baa8=_0xe14b[_0x3e4f8c];return _0xb2baa8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'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(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x55ca,0x126));var _0xa55c=function(_0x148316,_0x6c9dc){_0x148316=_0x148316-0x0;var _0xdbe95d=_0x55ca[_0x148316];return _0xdbe95d;};'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 b2b02fd..b8893a8 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 _0xa70d=['attributes','include','map','model','ShowSetting','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','options'];(function(_0x4d35f3,_0x19ba66){var _0x382fea=function(_0x2c2390){while(--_0x2c2390){_0x4d35f3['push'](_0x4d35f3['shift']());}};_0x382fea(++_0x19ba66);}(_0xa70d,0x1e6));var _0xda70=function(_0x32f98e,_0x572741){_0x32f98e=_0x32f98e-0x0;var _0x40ce0c=_0xa70d[_0x32f98e];return _0x40ce0c;};'use strict';var _=require(_0xda70('0x0'));var util=require(_0xda70('0x1'));var moment=require(_0xda70('0x2'));var BPromise=require(_0xda70('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda70('0x4'));var db=require(_0xda70('0x5'))['db'];var utils=require(_0xda70('0x6'));var logger=require(_0xda70('0x7'))(_0xda70('0x8'));var config=require(_0xda70('0x9'));var jayson=require(_0xda70('0xa'));var client=jayson['client'][_0xda70('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x494d50,_0x362878,_0x2a8a57){return new BPromise(function(_0x2a8090,_0x173e40){return client['request'](_0x494d50,_0x2a8a57)[_0xda70('0xc')](function(_0x4d101b){logger[_0xda70('0xd')]('Setting,\x20%s,\x20%s',_0x362878,_0xda70('0xe'));logger['debug'](_0xda70('0xf'),_0x362878,_0xda70('0xe'),JSON[_0xda70('0x10')](_0x4d101b));if(_0x4d101b['error']){if(_0x4d101b[_0xda70('0x11')][_0xda70('0x12')]===0x1f4){logger[_0xda70('0x11')](_0xda70('0x13'),_0x362878,_0x4d101b[_0xda70('0x11')][_0xda70('0x14')]);return _0x173e40(_0x4d101b[_0xda70('0x11')][_0xda70('0x14')]);}logger[_0xda70('0x11')](_0xda70('0x13'),_0x362878,_0x4d101b[_0xda70('0x11')]['message']);return _0x2a8090(_0x4d101b[_0xda70('0x11')][_0xda70('0x14')]);}else{logger[_0xda70('0xd')](_0xda70('0x13'),_0x362878,_0xda70('0xe'));_0x2a8090(_0x4d101b[_0xda70('0x15')][_0xda70('0x14')]);}})[_0xda70('0x16')](function(_0x4acb43){logger['error'](_0xda70('0x13'),_0x362878,_0x4acb43);_0x173e40(_0x4acb43);});});}exports['ShowSetting']=function(_0x4dc265){var _0x21bc38=this;return new Promise(function(_0x573bc0,_0x4912a9){return db['Setting']['find']({'raw':_0x4dc265['options']?_0x4dc265[_0xda70('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4dc265['options']?_0x4dc265[_0xda70('0x17')]['where']||null:null,'attributes':_0x4dc265[_0xda70('0x17')]?_0x4dc265['options'][_0xda70('0x18')]||null:null,'include':_0x4dc265[_0xda70('0x17')]?_0x4dc265[_0xda70('0x17')][_0xda70('0x19')]?_[_0xda70('0x1a')](_0x4dc265[_0xda70('0x17')][_0xda70('0x19')],function(_0x108ee5){return{'model':db[_0x108ee5[_0xda70('0x1b')]],'as':_0x108ee5['as'],'attributes':_0x108ee5[_0xda70('0x18')],'include':_0x108ee5[_0xda70('0x19')]?_['map'](_0x108ee5[_0xda70('0x19')],function(_0x2542e4){return{'model':db[_0x2542e4['model']],'as':_0x2542e4['as'],'attributes':_0x2542e4[_0xda70('0x18')],'include':_0x2542e4[_0xda70('0x19')]?_[_0xda70('0x1a')](_0x2542e4[_0xda70('0x19')],function(_0xf6e392){return{'model':db[_0xf6e392[_0xda70('0x1b')]],'as':_0xf6e392['as'],'attributes':_0xf6e392[_0xda70('0x18')]};}):[]};}):[]};}):[]:[]})[_0xda70('0xc')](function(_0x27f237){logger[_0xda70('0xd')](_0xda70('0x1c'),_0x4dc265);logger[_0xda70('0x1d')]('ShowSetting',_0x4dc265,JSON[_0xda70('0x10')](_0x27f237));_0x573bc0(_0x27f237);})[_0xda70('0x16')](function(_0x3e3945){logger[_0xda70('0x11')]('ShowSetting',_0x3e3945[_0xda70('0x14')],_0x4dc265);_0x4912a9(_0x21bc38['error'](0x1f4,_0x3e3945['message']));});});}; \ No newline at end of file +var _0xf977=['options','raw','where','attributes','include','map','model','ShowSetting','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Setting','find'];(function(_0x291b8c,_0x6b7ed8){var _0x22ba34=function(_0x250020){while(--_0x250020){_0x291b8c['push'](_0x291b8c['shift']());}};_0x22ba34(++_0x6b7ed8);}(_0xf977,0x153));var _0x7f97=function(_0x915e8a,_0x40cc0c){_0x915e8a=_0x915e8a-0x0;var _0x40e00f=_0xf977[_0x915e8a];return _0x40e00f;};'use strict';var _=require(_0x7f97('0x0'));var util=require(_0x7f97('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7f97('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7f97('0x3'))['db'];var utils=require(_0x7f97('0x4'));var logger=require('../../config/logger')(_0x7f97('0x5'));var config=require(_0x7f97('0x6'));var jayson=require(_0x7f97('0x7'));var client=jayson[_0x7f97('0x8')][_0x7f97('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xefa25,_0x460277,_0x2bd88a){return new BPromise(function(_0x61f16b,_0x20b019){return client[_0x7f97('0xa')](_0xefa25,_0x2bd88a)[_0x7f97('0xb')](function(_0x73a5cf){logger[_0x7f97('0xc')](_0x7f97('0xd'),_0x460277,_0x7f97('0xe'));logger[_0x7f97('0xf')](_0x7f97('0x10'),_0x460277,'request\x20sent',JSON[_0x7f97('0x11')](_0x73a5cf));if(_0x73a5cf[_0x7f97('0x12')]){if(_0x73a5cf[_0x7f97('0x12')][_0x7f97('0x13')]===0x1f4){logger[_0x7f97('0x12')](_0x7f97('0xd'),_0x460277,_0x73a5cf['error']['message']);return _0x20b019(_0x73a5cf[_0x7f97('0x12')][_0x7f97('0x14')]);}logger[_0x7f97('0x12')](_0x7f97('0xd'),_0x460277,_0x73a5cf[_0x7f97('0x12')][_0x7f97('0x14')]);return _0x61f16b(_0x73a5cf[_0x7f97('0x12')]['message']);}else{logger['info'](_0x7f97('0xd'),_0x460277,'request\x20sent');_0x61f16b(_0x73a5cf[_0x7f97('0x15')][_0x7f97('0x14')]);}})['catch'](function(_0x484aaa){logger[_0x7f97('0x12')]('Setting,\x20%s,\x20%s',_0x460277,_0x484aaa);_0x20b019(_0x484aaa);});});}exports['ShowSetting']=function(_0x5a7d93){var _0x31d798=this;return new Promise(function(_0x41792b,_0x4dbce4){return db[_0x7f97('0x16')][_0x7f97('0x17')]({'raw':_0x5a7d93[_0x7f97('0x18')]?_0x5a7d93['options'][_0x7f97('0x19')]===undefined?!![]:![]:!![],'where':_0x5a7d93['options']?_0x5a7d93['options'][_0x7f97('0x1a')]||null:null,'attributes':_0x5a7d93[_0x7f97('0x18')]?_0x5a7d93[_0x7f97('0x18')][_0x7f97('0x1b')]||null:null,'include':_0x5a7d93['options']?_0x5a7d93[_0x7f97('0x18')][_0x7f97('0x1c')]?_[_0x7f97('0x1d')](_0x5a7d93['options']['include'],function(_0x5a3435){return{'model':db[_0x5a3435[_0x7f97('0x1e')]],'as':_0x5a3435['as'],'attributes':_0x5a3435[_0x7f97('0x1b')],'include':_0x5a3435[_0x7f97('0x1c')]?_['map'](_0x5a3435['include'],function(_0x3fcf87){return{'model':db[_0x3fcf87['model']],'as':_0x3fcf87['as'],'attributes':_0x3fcf87[_0x7f97('0x1b')],'include':_0x3fcf87[_0x7f97('0x1c')]?_[_0x7f97('0x1d')](_0x3fcf87[_0x7f97('0x1c')],function(_0x568179){return{'model':db[_0x568179['model']],'as':_0x568179['as'],'attributes':_0x568179['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f97('0xb')](function(_0xc88031){logger[_0x7f97('0xc')](_0x7f97('0x1f'),_0x5a7d93);logger[_0x7f97('0xf')](_0x7f97('0x1f'),_0x5a7d93,JSON[_0x7f97('0x11')](_0xc88031));_0x41792b(_0xc88031);})[_0x7f97('0x20')](function(_0x102e19){logger[_0x7f97('0x12')]('ShowSetting',_0x102e19[_0x7f97('0x14')],_0x5a7d93);_0x4dbce4(_0x31d798[_0x7f97('0x12')](0x1f4,_0x102e19[_0x7f97('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 94c04ed..eea7a8b 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 _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x1d1f49,_0x26b1a4){var _0x1036ae=function(_0x5a4e1c){while(--_0x5a4e1c){_0x1d1f49['push'](_0x1d1f49['shift']());}};_0x1036ae(++_0x26b1a4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x35d914,_0x2ccfcf){_0x35d914=_0x35d914-0x0;var _0x48caa8=_0x8ef6[_0x35d914];return _0x48caa8;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file +var _0xe14b=['./smsAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','/:id','destroy','removeDispositions','delete','/:id/users','removeAgents','multer','util','express','Router','../../components/auth/service'];(function(_0x5b1d80,_0x4230ba){var _0x4f344c=function(_0x50d40b){while(--_0x50d40b){_0x5b1d80['push'](_0x5b1d80['shift']());}};_0x4f344c(++_0x4230ba);}(_0xe14b,0x93));var _0xbe14=function(_0x276b18,_0x3c1feb){_0x276b18=_0x276b18-0x0;var _0x13e121=_0xe14b[_0x276b18];return _0x13e121;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x6')](_0xbe14('0x10'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x6')](_0xbe14('0x12'),controller[_0xbe14('0x13')]);router[_0xbe14('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x14')]);router[_0xbe14('0x15')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x16')]);router['post'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x15')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);router['post'](_0xbe14('0x19'),controller[_0xbe14('0x1a')]);router[_0xbe14('0x15')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1b')]);router['post'](_0xbe14('0x1c'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x1d')]);router[_0xbe14('0x15')](_0xbe14('0x12'),controller['status']);router[_0xbe14('0x15')]('/:id/users',auth[_0xbe14('0x7')](),controller['addAgents']);router[_0xbe14('0x1e')]('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0x1f')]);router['delete'](_0xbe14('0x20'),auth['isAuthenticated'](),controller[_0xbe14('0x21')]);router['delete'](_0xbe14('0xb'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x22')]);router[_0xbe14('0x23')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeAnswers']);router[_0xbe14('0x23')](_0xbe14('0x24'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index e1bd6ce..230d96c 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 _0x48ba=['exports','name','STRING','generate','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','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','mandatoryDisposition','sequelize','randomstring'];(function(_0x550a25,_0x181b47){var _0x38a6de=function(_0x5547f9){while(--_0x5547f9){_0x550a25['push'](_0x550a25['shift']());}};_0x38a6de(++_0x181b47);}(_0x48ba,0x18d));var _0xa48b=function(_0x29fe6d,_0x1b3802){_0x29fe6d=_0x29fe6d-0x0;var _0x28a9e6=_0x48ba[_0x29fe6d];return _0x28a9e6;};'use strict';var Sequelize=require(_0xa48b('0x0'));var rs=require(_0xa48b('0x1'));module[_0xa48b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa48b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa48b('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xa48b('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0xa48b('0x4')],'defaultValue':function(){return rs[_0xa48b('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio',_0xa48b('0x6'),_0xa48b('0x7'),'clicksend',_0xa48b('0x8'),_0xa48b('0x9'),_0xa48b('0xa'),_0xa48b('0xb'),_0xa48b('0xc'),_0xa48b('0xd'))},'accountSid':{'type':Sequelize[_0xa48b('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xa48b('0x4')]},'smsMethod':{'type':Sequelize[_0xa48b('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa48b('0x4')]},'password':{'type':Sequelize[_0xa48b('0x4')]},'apiKey':{'type':Sequelize[_0xa48b('0x4')]},'applicationId':{'type':Sequelize[_0xa48b('0x4')]},'accountId':{'type':Sequelize[_0xa48b('0x4')]},'senderString':{'type':Sequelize[_0xa48b('0x4')]},'deliveryReport':{'type':Sequelize[_0xa48b('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xa48b('0x4')]},'notificationTemplate':{'type':Sequelize[_0xa48b('0x10')],'defaultValue':function(){return _0xa48b('0x11');}},'notificationSound':{'type':Sequelize[_0xa48b('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa48b('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa48b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa48b('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa48b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa48b('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa48b('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa48b('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa48b('0xf')],'defaultValue':![],'comment':_0xa48b('0x13'),'set':function(_0x3bbd28){if(!_0x3bbd28)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa48b('0x14'),_0x3bbd28);}}}; \ No newline at end of file +var _0xa311=['connectel','plivo','bandwidth','csc','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','ENUM'];(function(_0xc76be4,_0xb792d0){var _0x4388bf=function(_0x354bca){while(--_0x354bca){_0xc76be4['push'](_0xc76be4['shift']());}};_0x4388bf(++_0xb792d0);}(_0xa311,0x187));var _0x1a31=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa311[_0x29b609];return _0x54c952;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1a31('0x0'));module['exports']={'name':{'type':Sequelize[_0x1a31('0x1')],'unique':_0x1a31('0x2'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x1a31('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x1a31('0x1')],'defaultValue':function(){return rs[_0x1a31('0x3')]();}},'phone':{'type':Sequelize[_0x1a31('0x1')]},'type':{'type':Sequelize[_0x1a31('0x4')]('twilio','skebby',_0x1a31('0x5'),'clicksend',_0x1a31('0x6'),'clickatell',_0x1a31('0x7'),_0x1a31('0x8'),'infobip',_0x1a31('0x9'))},'accountSid':{'type':Sequelize[_0x1a31('0x1')]},'authId':{'type':Sequelize[_0x1a31('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x1a31('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x1a31('0x1')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x1a31('0x1')]},'accountId':{'type':Sequelize[_0x1a31('0x1')]},'senderString':{'type':Sequelize[_0x1a31('0x1')]},'deliveryReport':{'type':Sequelize[_0x1a31('0xa')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1a31('0xb');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1a31('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1a31('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1a31('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1a31('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1a31('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x1a31('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a31('0xc')],'comment':_0x1a31('0xd')},'mandatoryDisposition':{'type':Sequelize[_0x1a31('0xa')],'defaultValue':![],'comment':_0x1a31('0xe'),'set':function(_0x2863b6){if(!_0x2863b6)this[_0x1a31('0xf')](_0x1a31('0x10'),null);this[_0x1a31('0xf')](_0x1a31('0x11'),_0x2863b6);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 8f6b86e..4fbd643 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 _0xa33e=['util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','update','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','query','keys','intersection','attributes','fields','length','model','nolimit','sort','where','pick','filters','merge','filter','includeAll','include','SmsAccount','findAll','params','rawAttributes','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','findOne','Disposition','hasOwnProperty','order','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','notify','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','clicksend','MessageUUID','results','text','csc','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','defaults','SmsInteraction','interaction','autoclose','unmanaged','*,*,*,*','created','ContactId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','sequelize','transaction','Transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Owner','Tags','color','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','spread','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','message_id','status_code','groupName','DELIVERED','clickatell','redif','infobip','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','debug','message-id','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','bluebird','mustache'];(function(_0x2f2d45,_0x338762){var _0x1fc082=function(_0x532d8a){while(--_0x532d8a){_0x2f2d45['push'](_0x2f2d45['shift']());}};_0x1fc082(++_0x338762);}(_0xa33e,0x1a4));var _0xea33=function(_0x15e2ed,_0x8ae30){_0x15e2ed=_0x15e2ed-0x0;var _0x29f38c=_0xa33e[_0x15e2ed];return _0x29f38c;};'use strict';var emlformat=require(_0xea33('0x0'));var rimraf=require(_0xea33('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xea33('0x2'));var Mustache=require(_0xea33('0x3'));var util=require(_0xea33('0x4'));var path=require('path');var sox=require(_0xea33('0x5'));var csv=require(_0xea33('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea33('0x7'));var squel=require(_0xea33('0x8'));var crypto=require('crypto');var jsforce=require(_0xea33('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea33('0xa'));var Papa=require(_0xea33('0xb'));var Redis=require(_0xea33('0xc'));var authService=require(_0xea33('0xd'));var qs=require(_0xea33('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xea33('0xf'))(_0xea33('0x10'));var utils=require(_0xea33('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xea33('0x12'));var db=require(_0xea33('0x13'))['db'];config['redis']=_['defaults'](config[_0xea33('0x14')],{'host':_0xea33('0x15'),'port':0x18eb});var socket=require(_0xea33('0x16'))(new Redis(config[_0xea33('0x14')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0xea33('0x17'));var client=jayson['client'][_0xea33('0x18')]({'port':0x232c});function respondWithRpcPromise(_0xe00512,_0x846da,_0x434fa8,_0x76fe5a){return new BPromise(function(_0x544a17,_0x2a006a){var _0x216b60=_0x76fe5a||client;return _0x216b60[_0xea33('0x19')](_0xe00512,_0x434fa8)[_0xea33('0x1a')](function(_0x48d453){logger[_0xea33('0x1b')](_0xea33('0x1c'),_0x846da,_0xea33('0x1d'));logger['debug'](_0xea33('0x1e'),_0x846da,_0xea33('0x1d'),JSON[_0xea33('0x1f')](_0x48d453));if(_0x48d453['error']){if(_0x48d453[_0xea33('0x20')]['code']===0x1f4){logger[_0xea33('0x20')](_0xea33('0x1c'),_0x846da,_0x48d453[_0xea33('0x20')][_0xea33('0x21')]);return _0x2a006a(_0x48d453[_0xea33('0x20')]['message']);}logger[_0xea33('0x20')]('SmsAccount,\x20%s,\x20%s',_0x846da,_0x48d453[_0xea33('0x20')][_0xea33('0x21')]);return _0x544a17(_0x48d453[_0xea33('0x20')][_0xea33('0x21')]);}else{logger[_0xea33('0x1b')](_0xea33('0x1c'),_0x846da,_0xea33('0x1d'));_0x544a17(_0x48d453[_0xea33('0x22')][_0xea33('0x21')]);}})[_0xea33('0x23')](function(_0xae5ac2){logger[_0xea33('0x20')](_0xea33('0x1c'),_0x846da,_0xae5ac2);_0x2a006a(_0xae5ac2);});});}function respondWithStatusCode(_0x2549d9,_0x528232){_0x528232=_0x528232||0xcc;return function(_0x1a53d3){if(_0x1a53d3){return _0x2549d9[_0xea33('0x24')](_0x528232);}return _0x2549d9['status'](_0x528232)[_0xea33('0x25')]();};}function respondWithResult(_0xb2094a,_0x5310f7){_0x5310f7=_0x5310f7||0xc8;return function(_0x13f98c){if(_0x13f98c){return _0xb2094a[_0xea33('0x26')](_0x5310f7)[_0xea33('0x27')](_0x13f98c);}};}function respondWithFilteredResult(_0x4a1a25,_0x4952f9){return function(_0x34d086){if(_0x34d086){var _0x4a9bff=typeof _0x4952f9['offset']==='undefined'&&typeof _0x4952f9['limit']===_0xea33('0x28');var _0x193d4e=_0x34d086['count'];var _0x1ab315=_0x4a9bff?0x0:_0x4952f9[_0xea33('0x29')];var _0x39c6e6=_0x4a9bff?_0x34d086[_0xea33('0x2a')]:_0x4952f9[_0xea33('0x29')]+_0x4952f9[_0xea33('0x2b')];var _0x270da9;if(_0x39c6e6>=_0x193d4e){_0x39c6e6=_0x193d4e;_0x270da9=0xc8;}else{_0x270da9=0xce;}_0x4a1a25[_0xea33('0x26')](_0x270da9);return _0x4a1a25[_0xea33('0x2c')](_0xea33('0x2d'),_0x1ab315+'-'+_0x39c6e6+'/'+_0x193d4e)['json'](_0x34d086);}return null;};}function patchUpdates(_0x4a0366){return function(_0x513169){try{jsonpatch[_0xea33('0x2e')](_0x513169,_0x4a0366,!![]);}catch(_0x167aa1){return BPromise['reject'](_0x167aa1);}return _0x513169['save']();};}function saveUpdates(_0xb9b315,_0x24379e){return function(_0x2334b0){if(_0x2334b0){return _0x2334b0[_0xea33('0x2f')](_0xb9b315)[_0xea33('0x1a')](function(_0x34afaa){return _0x34afaa;});}return null;};}function removeEntity(_0x349d10,_0xde90fc){return function(_0x5be655){if(_0x5be655){return _0x5be655[_0xea33('0x30')]()[_0xea33('0x1a')](function(){var _0xa1e3a1=_0x5be655[_0xea33('0x31')]({'plain':!![]});var _0x582a1f=_0xea33('0x32');return db['UserProfileResource'][_0xea33('0x30')]({'where':{'type':_0x582a1f,'resourceId':_0xa1e3a1['id']}})[_0xea33('0x1a')](function(){return _0x5be655;});})[_0xea33('0x1a')](function(){_0x349d10['status'](0xcc)[_0xea33('0x25')]();});}};}function handleEntityNotFound(_0x9d40f0,_0x95b771){return function(_0x355689){if(!_0x355689){_0x9d40f0[_0xea33('0x24')](0x194);}return _0x355689;};}function handleError(_0xeffeba,_0x2464aa){_0x2464aa=_0x2464aa||0x1f4;return function(_0x3a7063){logger[_0xea33('0x20')](_0x3a7063[_0xea33('0x33')]);if(_0x3a7063[_0xea33('0x34')]){delete _0x3a7063[_0xea33('0x34')];}_0xeffeba[_0xea33('0x26')](_0x2464aa)[_0xea33('0x35')](_0x3a7063);};}exports[_0xea33('0x36')]=function(_0x4f8276,_0x45fe96){var _0x296e27={'include':[{'model':db[_0xea33('0x37')],'as':_0xea33('0x38')}]},_0x4a5c0d={},_0xd0fa36={'count':0x0,'rows':[]};var _0x292ab0=_[_0xea33('0x39')](db['SmsAccount']['rawAttributes'],function(_0x1cc57e){return{'name':_0x1cc57e[_0xea33('0x3a')],'type':_0x1cc57e[_0xea33('0x3b')][_0xea33('0x3c')]};});_0x4a5c0d['model']=_[_0xea33('0x39')](_0x292ab0,_0xea33('0x34'));_0x4a5c0d[_0xea33('0x3d')]=_[_0xea33('0x3e')](_0x4f8276[_0xea33('0x3d')]);_0x4a5c0d['filters']=_[_0xea33('0x3f')](_0x4a5c0d['model'],_0x4a5c0d[_0xea33('0x3d')]);_0x296e27[_0xea33('0x40')]=_[_0xea33('0x3f')](_0x4a5c0d['model'],qs[_0xea33('0x41')](_0x4f8276['query'][_0xea33('0x41')]));_0x296e27[_0xea33('0x40')]=_0x296e27['attributes'][_0xea33('0x42')]?_0x296e27[_0xea33('0x40')]:_0x4a5c0d[_0xea33('0x43')];if(!_0x4f8276[_0xea33('0x3d')]['hasOwnProperty'](_0xea33('0x44'))){_0x296e27[_0xea33('0x2b')]=qs[_0xea33('0x2b')](_0x4f8276['query'][_0xea33('0x2b')]);_0x296e27[_0xea33('0x29')]=qs['offset'](_0x4f8276[_0xea33('0x3d')]['offset']);}_0x296e27['order']=qs[_0xea33('0x45')](_0x4f8276[_0xea33('0x3d')]['sort']);_0x296e27[_0xea33('0x46')]=qs['filters'](_[_0xea33('0x47')](_0x4f8276[_0xea33('0x3d')],_0x4a5c0d[_0xea33('0x48')]),_0x292ab0);if(_0x4f8276[_0xea33('0x3d')]['filter']){_0x296e27['where']=_[_0xea33('0x49')](_0x296e27['where'],{'$or':_[_0xea33('0x39')](_0x292ab0,function(_0x3e60c6){if(_0x3e60c6[_0xea33('0x3b')]!=='VIRTUAL'){var _0x4077a7={};_0x4077a7[_0x3e60c6['name']]={'$like':'%'+_0x4f8276[_0xea33('0x3d')][_0xea33('0x4a')]+'%'};return _0x4077a7;}})});}_0x296e27=_[_0xea33('0x49')]({},_0x296e27,_0x4f8276['options']);var _0x4f0157={'where':_0x296e27[_0xea33('0x46')]};return db['SmsAccount'][_0xea33('0x2a')](_0x4f0157)[_0xea33('0x1a')](function(_0x3f0585){_0xd0fa36[_0xea33('0x2a')]=_0x3f0585;if(_0x4f8276[_0xea33('0x3d')][_0xea33('0x4b')]){_0x296e27[_0xea33('0x4c')]=[{'all':!![]}];}return db[_0xea33('0x4d')][_0xea33('0x4e')](_0x296e27);})[_0xea33('0x1a')](function(_0x412a45){_0xd0fa36['rows']=_0x412a45;return _0xd0fa36;})[_0xea33('0x1a')](respondWithFilteredResult(_0x45fe96,_0x296e27))[_0xea33('0x23')](handleError(_0x45fe96,null));};exports['show']=function(_0x32be08,_0x47c572){var _0x3d147e={'raw':![],'where':{'id':_0x32be08[_0xea33('0x4f')]['id']},'include':[{'model':db[_0xea33('0x37')],'as':_0xea33('0x38')}]},_0x23afc4={};_0x23afc4[_0xea33('0x43')]=_[_0xea33('0x3e')](db[_0xea33('0x4d')][_0xea33('0x50')]);_0x23afc4[_0xea33('0x3d')]=_[_0xea33('0x3e')](_0x32be08[_0xea33('0x3d')]);_0x23afc4[_0xea33('0x48')]=_[_0xea33('0x3f')](_0x23afc4[_0xea33('0x43')],_0x23afc4['query']);_0x3d147e[_0xea33('0x40')]=_['intersection'](_0x23afc4[_0xea33('0x43')],qs[_0xea33('0x41')](_0x32be08[_0xea33('0x3d')][_0xea33('0x41')]));_0x3d147e[_0xea33('0x40')]=_0x3d147e[_0xea33('0x40')]['length']?_0x3d147e[_0xea33('0x40')]:_0x23afc4['model'];if(_0x32be08['query']['includeAll']){_0x3d147e['include']=[{'all':!![]}];}_0x3d147e=_['merge']({},_0x3d147e,_0x32be08[_0xea33('0x51')]);return db['SmsAccount'][_0xea33('0x52')](_0x3d147e)[_0xea33('0x1a')](handleEntityNotFound(_0x47c572,null))[_0xea33('0x1a')](respondWithResult(_0x47c572,null))[_0xea33('0x23')](handleError(_0x47c572,null));};exports[_0xea33('0x53')]=function(_0x48c553,_0x24018f){return db['SmsAccount'][_0xea33('0x53')](_0x48c553['body'],{})['then'](function(_0x57bba7){var _0x45b05e=_0x48c553[_0xea33('0x54')][_0xea33('0x31')]({'plain':!![]});if(!_0x45b05e)throw new Error(_0xea33('0x55'));if(_0x45b05e[_0xea33('0x56')]===_0xea33('0x54')){var _0x24fb37=_0x57bba7[_0xea33('0x31')]({'plain':!![]});var _0x6932f7=_0xea33('0x32');return db['UserProfileSection'][_0xea33('0x52')]({'where':{'name':_0x6932f7,'userProfileId':_0x45b05e['userProfileId']},'raw':!![]})[_0xea33('0x1a')](function(_0x459abd){if(_0x459abd&&_0x459abd['autoAssociation']===0x0){return db[_0xea33('0x57')][_0xea33('0x53')]({'name':_0x24fb37[_0xea33('0x34')],'resourceId':_0x24fb37['id'],'type':_0x459abd['name'],'sectionId':_0x459abd['id']},{})[_0xea33('0x1a')](function(){return _0x57bba7;});}else{return _0x57bba7;}})[_0xea33('0x23')](function(_0x36043e){logger[_0xea33('0x20')](_0xea33('0x58'),_0x36043e);throw _0x36043e;});}return _0x57bba7;})[_0xea33('0x1a')](respondWithResult(_0x24018f,0xc9))[_0xea33('0x23')](handleError(_0x24018f,null));};exports['update']=function(_0x37fcfe,_0x5ed76e){if(_0x37fcfe['body']['id']){delete _0x37fcfe[_0xea33('0x59')]['id'];}return db[_0xea33('0x4d')][_0xea33('0x52')]({'where':{'id':_0x37fcfe[_0xea33('0x4f')]['id']},'include':[{'model':db[_0xea33('0x37')],'as':'mandatoryDispositionPause'}]})[_0xea33('0x1a')](handleEntityNotFound(_0x5ed76e,null))['then'](saveUpdates(_0x37fcfe['body'],null))[_0xea33('0x1a')](respondWithResult(_0x5ed76e,null))[_0xea33('0x23')](handleError(_0x5ed76e,null));};exports[_0xea33('0x30')]=function(_0x2e2f02,_0x5c5613){return db['SmsAccount'][_0xea33('0x52')]({'where':{'id':_0x2e2f02[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x5c5613,null))['then'](removeEntity(_0x5c5613,null))[_0xea33('0x23')](handleError(_0x5c5613,null));};exports[_0xea33('0x5a')]=function(_0x486233,_0x32bfa9){return db[_0xea33('0x4d')][_0xea33('0x5a')]()[_0xea33('0x1a')](respondWithResult(_0x32bfa9,null))[_0xea33('0x23')](handleError(_0x32bfa9,null));};exports[_0xea33('0x5b')]=function(_0x44191f,_0x2292fd,_0x5447b9){if(_0x44191f[_0xea33('0x59')]['id']){delete _0x44191f[_0xea33('0x59')]['id'];}return db[_0xea33('0x4d')][_0xea33('0x52')]({'where':{'id':_0x44191f[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x2292fd,null))[_0xea33('0x1a')](function(_0x468a2c){if(_0x468a2c){_0x44191f[_0xea33('0x59')][_0xea33('0x5c')]=_0x468a2c['id'];return db['Disposition']['create'](_0x44191f[_0xea33('0x59')]);}})[_0xea33('0x1a')](respondWithResult(_0x2292fd,null))[_0xea33('0x23')](handleError(_0x2292fd,null));};exports['getDispositions']=function(_0x4701e1,_0x340687,_0x126191){var _0xb10057={'raw':![],'where':{}};var _0x10eb9d={};var _0x3f0e07={'count':0x0,'rows':[]};return db[_0xea33('0x4d')][_0xea33('0x5d')]({'where':{'id':_0x4701e1[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x340687,null))[_0xea33('0x1a')](function(_0x1ab032){if(_0x1ab032){_0x10eb9d['model']=_[_0xea33('0x3e')](db[_0xea33('0x5e')][_0xea33('0x50')]);_0x10eb9d[_0xea33('0x3d')]=_[_0xea33('0x3e')](_0x4701e1[_0xea33('0x3d')]);_0x10eb9d[_0xea33('0x48')]=_[_0xea33('0x3f')](_0x10eb9d[_0xea33('0x43')],_0x10eb9d[_0xea33('0x3d')]);_0xb10057[_0xea33('0x40')]=_[_0xea33('0x3f')](_0x10eb9d['model'],qs[_0xea33('0x41')](_0x4701e1[_0xea33('0x3d')][_0xea33('0x41')]));_0xb10057[_0xea33('0x40')]=_0xb10057[_0xea33('0x40')][_0xea33('0x42')]?_0xb10057[_0xea33('0x40')]:_0x10eb9d[_0xea33('0x43')];if(!_0x4701e1[_0xea33('0x3d')][_0xea33('0x5f')](_0xea33('0x44'))){_0xb10057['limit']=qs[_0xea33('0x2b')](_0x4701e1[_0xea33('0x3d')]['limit']);_0xb10057[_0xea33('0x29')]=qs[_0xea33('0x29')](_0x4701e1['query'][_0xea33('0x29')]);}_0xb10057[_0xea33('0x60')]=qs[_0xea33('0x45')](_0x4701e1[_0xea33('0x3d')][_0xea33('0x45')]);_0xb10057[_0xea33('0x46')]=qs[_0xea33('0x48')](_[_0xea33('0x47')](_0x4701e1['query'],_0x10eb9d[_0xea33('0x48')]));_0xb10057[_0xea33('0x46')][_0xea33('0x5c')]=_0x1ab032['id'];if(_0x4701e1[_0xea33('0x3d')][_0xea33('0x4a')]){_0xb10057[_0xea33('0x46')]=_['merge'](_0xb10057['where'],{'$or':_['map'](_0xb10057[_0xea33('0x40')],function(_0x3f9fb2){var _0x1b4e75={};_0x1b4e75[_0x3f9fb2]={'$like':'%'+_0x4701e1[_0xea33('0x3d')][_0xea33('0x4a')]+'%'};return _0x1b4e75;})});}_0xb10057=_[_0xea33('0x49')]({},_0xb10057,_0x4701e1[_0xea33('0x51')]);return db[_0xea33('0x5e')][_0xea33('0x2a')]({'where':_0xb10057['where']})[_0xea33('0x1a')](function(_0x403932){_0x3f0e07[_0xea33('0x2a')]=_0x403932;if(_0x4701e1['query'][_0xea33('0x4b')]){_0xb10057[_0xea33('0x4c')]=[{'all':!![]}];}return db[_0xea33('0x5e')]['findAll'](_0xb10057);})[_0xea33('0x1a')](function(_0x106d53){_0x3f0e07[_0xea33('0x61')]=_0x106d53;return _0x3f0e07;});}})[_0xea33('0x1a')](respondWithFilteredResult(_0x340687,_0xb10057))[_0xea33('0x23')](handleError(_0x340687,null));};exports[_0xea33('0x62')]=function(_0x19e8ac,_0x2c0374,_0x25e10a){return db[_0xea33('0x4d')][_0xea33('0x52')]({'where':{'id':_0x19e8ac[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x2c0374,null))[_0xea33('0x1a')](function(_0x37f5f1){if(_0x37f5f1){return _0x37f5f1[_0xea33('0x62')](_0x19e8ac['query'][_0xea33('0x63')]);}})[_0xea33('0x1a')](respondWithStatusCode(_0x2c0374,null))[_0xea33('0x23')](handleError(_0x2c0374,null));};exports[_0xea33('0x64')]=function(_0xc12e78,_0xa47de4,_0x3eb284){if(_0xc12e78[_0xea33('0x59')]['id']){delete _0xc12e78['body']['id'];}return db[_0xea33('0x4d')][_0xea33('0x52')]({'where':{'id':_0xc12e78[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0xa47de4,null))[_0xea33('0x1a')](function(_0x37ad90){if(_0x37ad90){_0xc12e78['body']['SmsAccountId']=_0x37ad90['id'];return db['CannedAnswer'][_0xea33('0x53')](_0xc12e78['body']);}})[_0xea33('0x1a')](respondWithResult(_0xa47de4,null))[_0xea33('0x23')](handleError(_0xa47de4,null));};exports[_0xea33('0x65')]=function(_0x1c9feb,_0x3454af,_0x5e1e9b){var _0x195a54={'raw':![],'where':{}};var _0xa30946={};var _0x12eb43={'count':0x0,'rows':[]};return db[_0xea33('0x4d')][_0xea33('0x5d')]({'where':{'id':_0x1c9feb[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x3454af,null))['then'](function(_0x2eb5e8){if(_0x2eb5e8){_0xa30946[_0xea33('0x43')]=_[_0xea33('0x3e')](db[_0xea33('0x66')][_0xea33('0x50')]);_0xa30946[_0xea33('0x3d')]=_[_0xea33('0x3e')](_0x1c9feb[_0xea33('0x3d')]);_0xa30946[_0xea33('0x48')]=_['intersection'](_0xa30946['model'],_0xa30946['query']);_0x195a54[_0xea33('0x40')]=_[_0xea33('0x3f')](_0xa30946[_0xea33('0x43')],qs[_0xea33('0x41')](_0x1c9feb['query'][_0xea33('0x41')]));_0x195a54[_0xea33('0x40')]=_0x195a54[_0xea33('0x40')][_0xea33('0x42')]?_0x195a54[_0xea33('0x40')]:_0xa30946[_0xea33('0x43')];if(!_0x1c9feb[_0xea33('0x3d')][_0xea33('0x5f')](_0xea33('0x44'))){_0x195a54[_0xea33('0x2b')]=qs['limit'](_0x1c9feb[_0xea33('0x3d')][_0xea33('0x2b')]);_0x195a54[_0xea33('0x29')]=qs[_0xea33('0x29')](_0x1c9feb[_0xea33('0x3d')]['offset']);}_0x195a54[_0xea33('0x60')]=qs[_0xea33('0x45')](_0x1c9feb[_0xea33('0x3d')][_0xea33('0x45')]);_0x195a54['where']=qs[_0xea33('0x48')](_['pick'](_0x1c9feb[_0xea33('0x3d')],_0xa30946[_0xea33('0x48')]));_0x195a54[_0xea33('0x46')][_0xea33('0x5c')]=_0x2eb5e8['id'];if(_0x1c9feb[_0xea33('0x3d')][_0xea33('0x4a')]){_0x195a54[_0xea33('0x46')]=_[_0xea33('0x49')](_0x195a54[_0xea33('0x46')],{'$or':_[_0xea33('0x39')](_0x195a54['attributes'],function(_0x3533a7){var _0x272c7d={};_0x272c7d[_0x3533a7]={'$like':'%'+_0x1c9feb[_0xea33('0x3d')][_0xea33('0x4a')]+'%'};return _0x272c7d;})});}_0x195a54=_['merge']({},_0x195a54,_0x1c9feb[_0xea33('0x51')]);return db[_0xea33('0x66')][_0xea33('0x2a')]({'where':_0x195a54[_0xea33('0x46')]})['then'](function(_0x571ed8){_0x12eb43[_0xea33('0x2a')]=_0x571ed8;if(_0x1c9feb[_0xea33('0x3d')][_0xea33('0x4b')]){_0x195a54[_0xea33('0x4c')]=[{'all':!![]}];}return db[_0xea33('0x66')][_0xea33('0x4e')](_0x195a54);})[_0xea33('0x1a')](function(_0x3398d5){_0x12eb43[_0xea33('0x61')]=_0x3398d5;return _0x12eb43;});}})['then'](respondWithFilteredResult(_0x3454af,_0x195a54))[_0xea33('0x23')](handleError(_0x3454af,null));};exports['removeAnswers']=function(_0xe471c3,_0x1d93f3,_0x105639){return db['SmsAccount']['find']({'where':{'id':_0xe471c3['params']['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x1d93f3,null))[_0xea33('0x1a')](function(_0x1ef7f6){if(_0x1ef7f6){return _0x1ef7f6['removeAnswers'](_0xe471c3[_0xea33('0x3d')]['ids']);}})[_0xea33('0x1a')](respondWithStatusCode(_0x1d93f3,null))['catch'](handleError(_0x1d93f3,null));};exports[_0xea33('0x67')]=function(_0x3d7576,_0xe2832c,_0x5c1b5f){var _0x2ee259={'channel':'sms'};var _0x2dbe56=[];var _0x25e741=[];var _0x2fe3b4={};return db['SmsAccount'][_0xea33('0x52')]({'where':{'id':_0x3d7576['params']['id']},'include':[{'model':db[_0xea33('0x68')],'as':_0xea33('0x69')}]})[_0xea33('0x1a')](handleEntityNotFound(_0xe2832c,null))[_0xea33('0x1a')](function(_0x30b8ba){_0x2ee259[_0xea33('0x6a')]=_0x30b8ba;_0x2ee259[_0xea33('0x6b')]=_[_0xea33('0x6c')](_0x30b8ba[_0xea33('0x69')],[_0xea33('0x6d')],[_0xea33('0x6e')]);if(_0x2ee259[_0xea33('0x6a')][_0xea33('0x69')]){delete _0x2ee259[_0xea33('0x6a')][_0xea33('0x69')];}return db['CmContact']['describe']();})[_0xea33('0x1a')](function(_0x1b1228){if(!_0x1b1228){throw new db[(_0xea33('0x6f'))][(_0xea33('0x70'))](_0xea33('0x71'));}_0x2dbe56=_[_0xea33('0x72')](_[_0xea33('0x3e')](_0x1b1228),[_0xea33('0x73'),_0xea33('0x74')]);_0x25e741=_[_0xea33('0x72')](_['keys'](_0x1b1228),['createdAt',_0xea33('0x74'),_0xea33('0x75'),_0xea33('0x76')]);_0x2ee259[_0xea33('0x59')]={'mapKey':_0xea33('0x77')};if(_0x2ee259[_0xea33('0x6a')][_0xea33('0x3b')]){switch(_0x2ee259[_0xea33('0x6a')][_0xea33('0x3b')]){case _0xea33('0x78'):_0x2ee259[_0xea33('0x59')][_0xea33('0x79')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x7a')];_0x2ee259['body']['body']=_0x3d7576['body']['Body'];_0x2ee259[_0xea33('0x59')][_0xea33('0x7b')]=_0x3d7576['body'][_0xea33('0x7c')];break;case _0xea33('0x7d'):_0x2ee259[_0xea33('0x59')]['from']='+'+_0x3d7576[_0xea33('0x59')][_0xea33('0x7e')];_0x2ee259['body'][_0xea33('0x59')]=_0x3d7576[_0xea33('0x59')]['text'];break;case'connectel':_0x2ee259['body'][_0xea33('0x79')]=_0x3d7576['body'][_0xea33('0x79')];_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]=_0x3d7576['body'][_0xea33('0x21')];break;case _0xea33('0x7f'):_0x2ee259['body'][_0xea33('0x79')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x79')];_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x59')];_0x2ee259['body'][_0xea33('0x7b')]=_0x3d7576[_0xea33('0x59')]['message_id'];break;case'plivo':_0x2ee259[_0xea33('0x59')][_0xea33('0x79')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x7a')];_0x2ee259['body'][_0xea33('0x59')]=_0x3d7576[_0xea33('0x59')]['Text'];_0x2ee259['body']['messageId']=_0x3d7576[_0xea33('0x59')][_0xea33('0x80')];break;case'infobip':_0x2ee259['body']['from']='+'+_0x3d7576[_0xea33('0x59')]['results'][0x0][_0xea33('0x79')];_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x81')][0x0][_0xea33('0x82')];_0x2ee259[_0xea33('0x59')][_0xea33('0x7b')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x81')][0x0][_0xea33('0x7b')];break;case _0xea33('0x83'):_0x2ee259['body']['from']=_0x3d7576[_0xea33('0x59')][_0xea33('0x84')];_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x85')][_0xea33('0x21')];break;case'clickatell':_0x2ee259['body']['from']=_0x3d7576['body']['fromNumber'];_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x82')];_0x2ee259[_0xea33('0x59')][_0xea33('0x7b')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x86')];break;case _0xea33('0x87'):_0x2ee259[_0xea33('0x59')]['messageId']=_0x3d7576['body'][0x0][_0xea33('0x21')]['id'];_0x2ee259[_0xea33('0x59')][_0xea33('0x79')]=_0x3d7576[_0xea33('0x59')][0x0][_0xea33('0x21')][_0xea33('0x79')];_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]=_0x3d7576[_0xea33('0x59')][0x0]['message']['text'];break;case _0xea33('0x88'):_0x2ee259[_0xea33('0x59')][_0xea33('0x79')]=_0x3d7576[_0xea33('0x59')][_0xea33('0x79')];_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]=_0x3d7576['body']['message'];_0x2ee259['body'][_0xea33('0x7b')]=_0x3d7576[_0xea33('0x59')]['refid'];break;}}if(_0x2ee259[_0xea33('0x59')]['id']){delete _0x2ee259[_0xea33('0x59')]['id'];}if(_[_0xea33('0x89')](_0x2ee259[_0xea33('0x59')][_0xea33('0x79')])){throw new db['Sequelize'][(_0xea33('0x70'))](_0xea33('0x8a'));}if(_[_0xea33('0x89')](_0x2ee259[_0xea33('0x59')][_0xea33('0x59')])||_0x2ee259[_0xea33('0x59')][_0xea33('0x59')]===''){throw new db[(_0xea33('0x6f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xea33('0x89')](_0x2ee259['body'][_0xea33('0x8b')])){throw new db['Sequelize'][(_0xea33('0x70'))](_0xea33('0x8c')+_0x25e741);}if(!_[_0xea33('0x8d')](_0x25e741,_0x2ee259['body']['mapKey'])){throw new db[(_0xea33('0x6f'))][(_0xea33('0x70'))](_0xea33('0x8e')+_0x25e741);}_0x2fe3b4[_0x2ee259[_0xea33('0x59')]['mapKey']]=_0x2ee259['body'][_0xea33('0x79')];return db[_0xea33('0x8f')][_0xea33('0x52')]({'where':{'id':_0x2ee259[_0xea33('0x6a')][_0xea33('0x76')]},'include':[{'model':db[_0xea33('0x90')],'as':_0xea33('0x91'),'where':_0x2fe3b4,'limit':0x1,'order':[[_0xea33('0x74'),_0xea33('0x92')]]}]});})[_0xea33('0x1a')](handleEntityNotFound(_0xe2832c,null))['then'](function(_0x16e642){if(_0x16e642){_0x2ee259[_0xea33('0x93')]=_['omit'](_0x16e642,[_0xea33('0x91')]);if(_0x16e642[_0xea33('0x91')][_0xea33('0x42')]){return _0x16e642[_0xea33('0x91')][0x0];}var _0x5ba01b=_[_0xea33('0x94')](_0x2ee259[_0xea33('0x59')],{'firstName':_0x2ee259[_0xea33('0x59')][_0xea33('0x79')],'ListId':_0x16e642['id']});_0x5ba01b[_0x2ee259[_0xea33('0x59')][_0xea33('0x8b')]]=_0x2ee259[_0xea33('0x59')]['from'];return db[_0xea33('0x90')][_0xea33('0x53')](_0x5ba01b,{'fields':_0x2dbe56,'raw':!![]});}})['then'](handleEntityNotFound(_0xe2832c,null))[_0xea33('0x1a')](function(_0x5ce326){if(_0x5ce326){_0x2ee259['contact']=_0x5ce326;var _0x28e8e2={'ContactId':_0x5ce326['id'],'phone':_0x2ee259[_0xea33('0x59')]['from'],'SmsAccountId':_0x3d7576[_0xea33('0x4f')]['id']};var _0x59a23f={'ContactId':_0x5ce326['id'],'SmsAccountId':_0x3d7576[_0xea33('0x4f')]['id'],'closed':![]};return db[_0xea33('0x95')][_0xea33('0x52')]({'where':_0x59a23f})[_0xea33('0x1a')](function(_0x21e510){if(_0x21e510){return[_0x21e510,![]];}return db[_0xea33('0x95')][_0xea33('0x53')](_0x28e8e2)[_0xea33('0x1a')](function(_0x345e0a){return[_0x345e0a,!![]];});});}})['spread'](function(_0xe24f93,_0x5d4705){_0x2ee259[_0xea33('0x96')]=_0xe24f93['get']({'plain':!![]});_0x2ee259[_0xea33('0x96')]['created']=![];if(_0x5d4705){if(_0x2ee259[_0xea33('0x6a')][_0xea33('0x97')]){_0x2ee259[_0xea33('0x6b')]['push']({'id':0x0,'priority':_0x2ee259[_0xea33('0x6b')][_0xea33('0x42')]+0x1,'app':'close','appdata':_0xea33('0x98'),'interval':_0xea33('0x99')});}_0x2ee259[_0xea33('0x96')][_0xea33('0x9a')]=!![];}return db['SmsMessage'][_0xea33('0x53')]({'phone':_0x2ee259['body'][_0xea33('0x79')],'messageId':_0x2ee259[_0xea33('0x59')][_0xea33('0x7b')],'body':_0x2ee259[_0xea33('0x59')][_0xea33('0x59')],'SmsAccountId':_0x3d7576[_0xea33('0x4f')]['id'],'SmsInteractionId':_0xe24f93['id'],'direction':'in','ContactId':_0xe24f93[_0xea33('0x9b')],'AttachmentId':_0x2ee259[_0xea33('0x59')]['AttachmentId']});})[_0xea33('0x1a')](function(_0x5ce664){_0x2ee259[_0xea33('0x21')]=_0x5ce664;if(_0x2ee259['interaction'][_0xea33('0x9c')]){return db[_0xea33('0x9d')][_0xea33('0x52')]({'attributes':['id','name'],'where':{'id':_0x2ee259[_0xea33('0x96')][_0xea33('0x9c')]}})[_0xea33('0x1a')](function(_0x23b227){if(_0x23b227){_0x2ee259[_0xea33('0x6b')]['unshift']({'id':0x0,'priority':0x0,'app':_0xea33('0x9e'),'appdata':_0x23b227['name']+','+(_0x2ee259['account'][_0xea33('0x9f')]||0xa),'interval':_0xea33('0x99')});}return respondWithRpcPromise(_0xea33('0xa0'),_0xea33('0xa1'),_0x2ee259);});}return respondWithRpcPromise(_0xea33('0xa0'),'startRouting',_0x2ee259);})[_0xea33('0x1a')](function(_0x260e3a){if(_0x260e3a){var _0x574356=0xc8;var _0x557b8b=_0xea33('0xa2');logger[_0xea33('0x1b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x557b8b,_0x574356,'entity\x20found');logger['debug'](_0xea33('0xa3'),_0x557b8b,_0x574356,'entity\x20found',JSON[_0xea33('0x1f')](_0x260e3a));if(_0x2ee259[_0xea33('0x6a')][_0xea33('0x3b')]==='twilio'){return _0xe2832c[_0xea33('0x26')](_0x574356)[_0xea33('0x2c')](_0xea33('0xa4'),_0xea33('0xa5'))[_0xea33('0x35')](_0xea33('0xa6'));}else{return _0xe2832c[_0xea33('0x26')](_0x574356)[_0xea33('0x27')](_0x260e3a);}}})[_0xea33('0x23')](handleError(_0xe2832c,null));};exports['addApplications']=function(_0x5d48d1,_0x3930d3){var _0x48c372=_0x5d48d1[_0xea33('0x4f')]['id'];var _0x22ec5a=_0x5d48d1[_0xea33('0x59')];var _0x530802=0xc8;var _0x5ec166=null;return db[_0xea33('0xa7')][_0xea33('0xa8')]({'isolationLevel':db[_0xea33('0xa7')][_0xea33('0xa9')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x2b50ea){return db['SmsAccount'][_0xea33('0x5d')]({'where':{'id':_0x48c372},'transaction':_0x2b50ea})['then'](function(_0x156a29){if(_0x156a29){return db[_0xea33('0x68')][_0xea33('0x30')]({'where':{'SmsAccountId':_0x48c372},'transaction':_0x2b50ea})[_0xea33('0x1a')](function(){var _0x34ff92=_['map'](_0x22ec5a,function(_0x445bc4){_0x445bc4[_0xea33('0x5c')]=_0x48c372;return _0x445bc4;});return db[_0xea33('0x68')][_0xea33('0xaa')](_0x34ff92,{'transaction':_0x2b50ea});});}else{_0x530802=0x194;_0x5ec166=[];}});})[_0xea33('0x1a')](function(){if(_0x530802!==0x194){return db[_0xea33('0x68')][_0xea33('0xab')]({'where':{'SmsAccountId':_0x48c372},'order':_0xea33('0x6d')})[_0xea33('0x1a')](function(_0xc1aca0){_0x5ec166=_0xc1aca0;});}})[_0xea33('0x23')](function(_0x887512){_0x530802=0x1f4;logger[_0xea33('0x20')](_0x887512[_0xea33('0x33')]);if(_0x887512[_0xea33('0x34')]){delete _0x887512['name'];}_0x5ec166=_0x887512;})['finally'](function(){if(_0x5ec166===null){_0x3930d3[_0xea33('0x24')](_0x530802);}else{if(_0x530802===0x1f4){_0x3930d3['status'](_0x530802)[_0xea33('0x35')](_0x5ec166);}else{_0x3930d3[_0xea33('0x26')](_0x530802)['json'](_0x5ec166);}}});};exports[_0xea33('0xac')]=function(_0x35fe5b,_0x37ecc5,_0x577771){var _0x2184f4={};var _0x1d8905={};var _0x1c2658;var _0x384c5f;return db['SmsAccount'][_0xea33('0x5d')]({'where':{'id':_0x35fe5b[_0xea33('0x4f')]['id']}})['then'](handleEntityNotFound(_0x37ecc5,null))[_0xea33('0x1a')](function(_0x469ad4){if(_0x469ad4){_0x1c2658=_0x469ad4;_0x1d8905[_0xea33('0x43')]=_[_0xea33('0x3e')](db[_0xea33('0x68')][_0xea33('0x50')]);_0x1d8905[_0xea33('0x3d')]=_[_0xea33('0x3e')](_0x35fe5b['query']);_0x1d8905[_0xea33('0x48')]=_[_0xea33('0x3f')](_0x1d8905['model'],_0x1d8905[_0xea33('0x3d')]);_0x2184f4['attributes']=_['intersection'](_0x1d8905['model'],qs[_0xea33('0x41')](_0x35fe5b[_0xea33('0x3d')]['fields']));_0x2184f4[_0xea33('0x40')]=_0x2184f4[_0xea33('0x40')][_0xea33('0x42')]?_0x2184f4['attributes']:_0x1d8905[_0xea33('0x43')];_0x2184f4[_0xea33('0x60')]=qs[_0xea33('0x45')](_0x35fe5b[_0xea33('0x3d')][_0xea33('0x45')]);_0x2184f4[_0xea33('0x46')]=qs['filters'](_['pick'](_0x35fe5b[_0xea33('0x3d')],_0x1d8905[_0xea33('0x48')]));if(_0x35fe5b[_0xea33('0x3d')][_0xea33('0x4a')]){_0x2184f4[_0xea33('0x46')]=_[_0xea33('0x49')](_0x2184f4['where'],{'$or':_[_0xea33('0x39')](_0x2184f4[_0xea33('0x40')],function(_0x3ec302){var _0x1fe8ca={};_0x1fe8ca[_0x3ec302]={'$like':'%'+_0x35fe5b[_0xea33('0x3d')][_0xea33('0x4a')]+'%'};return _0x1fe8ca;})});}_0x2184f4=_[_0xea33('0x49')]({},_0x2184f4,_0x35fe5b[_0xea33('0x51')]);return _0x1c2658[_0xea33('0xac')](_0x2184f4);}})['then'](function(_0x2b5d95){if(_0x2b5d95){_0x384c5f=_0x2b5d95[_0xea33('0x42')];if(!_0x35fe5b[_0xea33('0x3d')]['hasOwnProperty'](_0xea33('0x44'))){_0x2184f4[_0xea33('0x2b')]=qs['limit'](_0x35fe5b[_0xea33('0x3d')][_0xea33('0x2b')]);_0x2184f4[_0xea33('0x29')]=qs[_0xea33('0x29')](_0x35fe5b[_0xea33('0x3d')][_0xea33('0x29')]);}return _0x1c2658['getApplications'](_0x2184f4);}})[_0xea33('0x1a')](function(_0x2a9bd7){if(_0x2a9bd7){return _0x2a9bd7?{'count':_0x384c5f,'rows':_0x2a9bd7}:null;}})[_0xea33('0x1a')](respondWithResult(_0x37ecc5,null))['catch'](handleError(_0x37ecc5,null));};exports[_0xea33('0xad')]=function(_0x355071,_0x3bb248,_0x15695d){var _0x4fc403={'raw':![],'where':{}};var _0x113e75={};var _0x49b64b={'count':0x0,'rows':[]};return db[_0xea33('0x4d')][_0xea33('0x5d')]({'where':{'id':_0x355071['params']['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x3bb248,null))['then'](function(_0x40552c){if(_0x40552c){_0x113e75['model']=_[_0xea33('0x3e')](db[_0xea33('0x95')][_0xea33('0x50')]);_0x113e75[_0xea33('0x3d')]=_[_0xea33('0x3e')](_0x355071['query']);_0x113e75[_0xea33('0x48')]=_['intersection'](_0x113e75[_0xea33('0x43')],_0x113e75['query']);_0x4fc403[_0xea33('0x40')]=_['intersection'](_0x113e75['model'],qs[_0xea33('0x41')](_0x355071['query']['fields']));_0x4fc403['attributes']=_0x4fc403['attributes'][_0xea33('0x42')]?_0x4fc403['attributes']:_0x113e75[_0xea33('0x43')];if(!_0x355071[_0xea33('0x3d')][_0xea33('0x5f')]('nolimit')){_0x4fc403[_0xea33('0x2b')]=qs[_0xea33('0x2b')](_0x355071['query'][_0xea33('0x2b')]);_0x4fc403[_0xea33('0x29')]=qs['offset'](_0x355071[_0xea33('0x3d')][_0xea33('0x29')]);}_0x4fc403['order']=qs[_0xea33('0x45')](_0x355071[_0xea33('0x3d')][_0xea33('0x45')]);_0x4fc403[_0xea33('0x46')]=qs['filters'](_['pick'](_0x355071[_0xea33('0x3d')],_0x113e75[_0xea33('0x48')]));_0x4fc403[_0xea33('0x46')][_0xea33('0x5c')]=_0x40552c['id'];if(_0x355071['query'][_0xea33('0x4a')]){_0x4fc403[_0xea33('0x46')]=_[_0xea33('0x49')](_0x4fc403[_0xea33('0x46')],{'$or':_[_0xea33('0x39')](_0x4fc403[_0xea33('0x40')],function(_0x493026){var _0x49cf95={};_0x49cf95[_0x493026]={'$like':'%'+_0x355071[_0xea33('0x3d')][_0xea33('0x4a')]+'%'};return _0x49cf95;})});}_0x4fc403=_[_0xea33('0x49')]({},_0x4fc403,_0x355071[_0xea33('0x51')]);return db[_0xea33('0x95')][_0xea33('0x2a')]({'where':_0x4fc403['where']})[_0xea33('0x1a')](function(_0x5cbffa){_0x49b64b[_0xea33('0x2a')]=_0x5cbffa;if(_0x355071[_0xea33('0x3d')][_0xea33('0x4b')]){_0x4fc403[_0xea33('0x4c')]=[{'model':db[_0xea33('0x90')],'as':'Contact','required':![]},{'model':db[_0xea33('0x9d')],'as':_0xea33('0xae'),'attributes':[_0xea33('0x34'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xea33('0xaf'),'attributes':['id',_0xea33('0x34'),_0xea33('0xb0')],'where':_0x355071['query']['tag']?{'id':_0x355071['query'][_0xea33('0xb1')]}:undefined,'required':_0x355071['query'][_0xea33('0xb1')]?!![]:![]}];}return db[_0xea33('0x95')][_0xea33('0x4e')](_0x4fc403);})[_0xea33('0x1a')](function(_0x244567){_0x49b64b[_0xea33('0x61')]=_0x244567;return _0x49b64b;});}})['then'](respondWithFilteredResult(_0x3bb248,_0x4fc403))[_0xea33('0x23')](handleError(_0x3bb248,null));};exports['send']=function(_0x28674a,_0x41ff96,_0xef9f9c){var _0x5c9e4a,_0x1053df,_0xbc2ac5;if(_[_0xea33('0x89')](_0x28674a['body']['body'])||_0x28674a['body'][_0xea33('0x59')]===''){throw new db[(_0xea33('0x6f'))][(_0xea33('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xea33('0x89')](_0x28674a['body']['to'])){throw new db[(_0xea33('0x6f'))]['ValidationError'](_0xea33('0xb2'));}_0x5c9e4a=_0x28674a[_0xea33('0x59')]['to'];return db[_0xea33('0x4d')][_0xea33('0x52')]({'where':{'id':_0x28674a[_0xea33('0x4f')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xea33('0x90')],'as':'Contacts','where':{'mobile':_0x5c9e4a},'limit':0x1,'order':[[_0xea33('0x74'),_0xea33('0x92')]]}]}]})[_0xea33('0x1a')](handleEntityNotFound(_0x41ff96,null))['then'](function(_0x3c141d){if(_0x3c141d&&_0x3c141d[_0xea33('0xb3')]){_0x1053df=_0x3c141d[_0xea33('0x31')]({'plain':!![]});if(_0x1053df[_0xea33('0xb3')]&&_0x1053df[_0xea33('0xb3')][_0xea33('0x91')][_0xea33('0x42')]){return _0x1053df[_0xea33('0xb3')][_0xea33('0x91')][0x0];}return db[_0xea33('0x90')]['create'](_[_0xea33('0x94')](_0x28674a['body'],{'firstName':_0x5c9e4a,'mobile':_0x5c9e4a,'phone':_0x5c9e4a,'ListId':_0x1053df['ListId']}));}})[_0xea33('0x1a')](handleEntityNotFound(_0x41ff96,null))[_0xea33('0x1a')](function(_0x270485){if(_0x270485){_0xbc2ac5=_0x270485;return db[_0xea33('0x95')][_0xea33('0x52')]({'where':{'ContactId':_0xbc2ac5['id'],'closed':![],'SmsAccountId':_0x1053df['id']}})['then'](function(_0x493379){if(_0x493379){return[_0x493379,![]];}return db['SmsInteraction']['create']({'UserId':_0x28674a[_0xea33('0x54')]['id'],'ContactId':_0xbc2ac5['id'],'SmsAccountId':_0x1053df['id'],'phone':_0x5c9e4a,'firstMsgDirection':'out','Messages':[_[_0xea33('0x49')](_0x28674a[_0xea33('0x59')],{'read':![],'body':_0x28674a[_0xea33('0x59')][_0xea33('0x59')],'phone':_0x5c9e4a,'SmsAccountId':_0x1053df['id'],'UserId':_0x28674a[_0xea33('0x54')]['id'],'ContactId':_0xbc2ac5['id']})]},{'include':[{'model':db[_0xea33('0xb4')],'as':_0xea33('0xb5')}]})[_0xea33('0x1a')](function(_0x55a5dc){return[_0x55a5dc,!![]];});});}})[_0xea33('0xb6')](function(_0x4cafcb,_0x493f21){if(_0x493f21){return _0x4cafcb;}return db['SmsMessage'][_0xea33('0x53')](_[_0xea33('0x49')](_0x28674a[_0xea33('0x59')],{'read':![],'body':_0x28674a['body'][_0xea33('0x59')],'phone':_0x5c9e4a,'SmsAccountId':_0x1053df['id'],'SmsInteractionId':_0x4cafcb['id'],'UserId':_0x28674a[_0xea33('0x54')]['id'],'ContactId':_0xbc2ac5['id']}))[_0xea33('0x1a')](function(_0x57764d){_0x4cafcb[_0xea33('0xb7')][_0xea33('0xb5')]=[];_0x4cafcb[_0xea33('0xb7')][_0xea33('0xb5')][_0xea33('0xb8')](_0x57764d[_0xea33('0xb7')]);return _0x4cafcb;});})[_0xea33('0x1a')](respondWithResult(_0x41ff96,null))[_0xea33('0x23')](handleError(_0x41ff96,null));};exports[_0xea33('0x26')]=function(_0x15c76f,_0x2d6781,_0x595759){if(_0x15c76f[_0xea33('0x59')]['id']){delete _0x15c76f[_0xea33('0x59')]['id'];}var _0x1c962d,_0x246049,_0x171363;return db['SmsAccount'][_0xea33('0x52')]({'where':{'id':_0x15c76f[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x2d6781,null))[_0xea33('0x1a')](function(_0x330057){if(_0x330057){_0x171363=_0x330057;logger['debug'](_0xea33('0x1e'),'status',_0xea33('0xb9'),_0x330057[_0xea33('0x3b')],util[_0xea33('0xba')](_0x15c76f['body'],{'showHidden':![],'depth':null}));switch(_0x330057['type']){case _0xea33('0x7d'):if(_0x15c76f[_0xea33('0x59')][_0xea33('0xbb')]&&_0x15c76f[_0xea33('0x59')][_0xea33('0x26')]){_0x246049=_0x15c76f['body']['status'];return db['SmsMessage'][_0xea33('0x52')]({'where':{'messageId':_0x15c76f['body']['skebby_dispatch_id']}});}break;case _0xea33('0xbc'):if(_0x15c76f['body'][_0xea33('0xbd')]&&_0x15c76f['body'][_0xea33('0xbe')]){_0x246049=_0x15c76f['body']['statusInt'];return db[_0xea33('0xb4')]['find']({'where':{'messageId':_0x15c76f[_0xea33('0x59')]['requestid']}});}break;case _0xea33('0x7f'):if(_0x15c76f[_0xea33('0x59')][_0xea33('0xbf')]&&_0x15c76f[_0xea33('0x59')]['status_code']){_0x246049=_0x15c76f[_0xea33('0x59')][_0xea33('0xc0')];return db['SmsMessage'][_0xea33('0x52')]({'where':{'messageId':_0x15c76f[_0xea33('0x59')][_0xea33('0xbf')]}});}break;case'infobip':var _0xaeee0b=_0x15c76f[_0xea33('0x59')][_0xea33('0x81')][0x0];if(_0xaeee0b[_0xea33('0x7b')]&&_0xaeee0b[_0xea33('0x26')][_0xea33('0xc1')]===_0xea33('0xc2')){_0x246049=_0xaeee0b[_0xea33('0x26')][_0xea33('0xc1')];return db['SmsMessage'][_0xea33('0x52')]({'where':{'messageId':_0xaeee0b['messageId']}});}break;case _0xea33('0xc3'):if(_0x15c76f['body'][_0xea33('0x7b')]&&_0x15c76f['body'][_0xea33('0x26')]){_0x246049=_0x15c76f['body'][_0xea33('0x26')];return db[_0xea33('0xb4')]['find']({'where':{'messageId':_0x15c76f['body'][_0xea33('0x7b')]}});}break;case _0xea33('0x87'):if(_0x15c76f[_0xea33('0x59')][0x0][_0xea33('0x21')]['id']){_0x246049=_0x15c76f[_0xea33('0x59')][0x0]['type'];return db[_0xea33('0xb4')][_0xea33('0x52')]({'where':{'messageId':_0x15c76f['body'][0x0][_0xea33('0x21')]['id']}});}break;case'intelepeer':if(_0x15c76f[_0xea33('0x59')][_0xea33('0xc4')]&&_0x15c76f[_0xea33('0x59')][_0xea33('0x26')]){_0x246049=_0x15c76f[_0xea33('0x59')][_0xea33('0x26')];return db[_0xea33('0xb4')]['find']({'where':{'messageId':_0x15c76f[_0xea33('0x59')][_0xea33('0xc4')]}});}break;}}})[_0xea33('0x1a')](handleEntityNotFound(_0x2d6781,null))[_0xea33('0x1a')](function(_0x33c6f7){if(_0x33c6f7){_0x1c962d=_0x33c6f7;switch(_0x171363[_0xea33('0x3b')]){case _0xea33('0x7d'):if(_0x246049===_0xea33('0xc2')){return _0x1c962d['update']({'read':!![]});}else{logger['error'](_0xea33('0x1e'),'status','skebby',util[_0xea33('0xba')](_0x15c76f[_0xea33('0x59')],{'showHidden':![],'depth':null}));}break;case _0xea33('0xbc'):if(_0x246049==='1'){return _0x1c962d['update']({'read':!![]});}else{logger[_0xea33('0x20')](_0xea33('0x1e'),_0xea33('0x26'),_0xea33('0x7d'),util[_0xea33('0xba')](_0x15c76f[_0xea33('0x59')],{'showHidden':![],'depth':null}));}break;case _0xea33('0x7f'):if(!_0x15c76f['body']['error_code']&&_0x246049>=0xc8&&_0x246049<=0xce){return _0x1c962d[_0xea33('0x2f')]({'read':!![]});}else{logger[_0xea33('0x20')](_0xea33('0x1e'),_0xea33('0x26'),_0xea33('0x7f'),util['inspect'](_0x15c76f[_0xea33('0x59')],{'showHidden':![],'depth':null}));}break;case _0xea33('0xc5'):var _0x120a0c=_0x15c76f[_0xea33('0x59')]['results'][0x0];if(_0x120a0c['status']['groupName']===_0xea33('0xc2')){return _0x1c962d[_0xea33('0x2f')]({'read':!![]});}else{logger[_0xea33('0x20')](_0xea33('0x1e'),'status',_0xea33('0xc5'),util[_0xea33('0xba')](_0x15c76f[_0xea33('0x59')],{'showHidden':![],'depth':null}));}break;case _0xea33('0xc3'):if(_0x246049=='DELIVERED_TO_GATEWAY'||_0x246049==_0xea33('0xc6')){return _0x1c962d[_0xea33('0x2f')]({'read':!![]});}else{logger[_0xea33('0x20')](_0xea33('0x1e'),_0xea33('0x26'),_0xea33('0xc3'),util[_0xea33('0xba')](_0x15c76f['body'],{'showHidden':![],'depth':null}));}break;case _0xea33('0x87'):if(_0x246049=='message-delivered'){return _0x1c962d[_0xea33('0x2f')]({'read':!![]});}else{logger['error'](_0xea33('0x1e'),_0xea33('0x26'),'bandwidth',util[_0xea33('0xba')](_0x15c76f[_0xea33('0x59')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x246049===_0xea33('0xc7')||_0x246049===_0xea33('0xc8')){return _0x1c962d[_0xea33('0x2f')]({'read':!![]});}else{logger[_0xea33('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xea33('0x26'),_0xea33('0x88'),util[_0xea33('0xba')](_0x15c76f['body'],{'showHidden':![],'depth':null}));}break;}return _0x1c962d;}})[_0xea33('0x1a')](respondWithResult(_0x2d6781,null))[_0xea33('0x23')](handleError(_0x2d6781,null));};exports[_0xea33('0xc9')]=function(_0x3b91da,_0x54186f,_0x29f037){var _0x4a7ab0,_0x4586c1,_0x3dd5fc;return db[_0xea33('0x4d')][_0xea33('0x52')]({'where':{'id':_0x3b91da[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x54186f,null))[_0xea33('0x1a')](function(_0x178507){if(_0x178507){_0x3dd5fc=_0x178507;logger[_0xea33('0xca')](_0xea33('0x1e'),_0xea33('0x26'),_0xea33('0xb9'),_0x178507['type'],util[_0xea33('0xba')](_0x3b91da['query'],{'showHidden':![],'depth':null}));switch(_0x178507[_0xea33('0x3b')]){case'csc':if(_0x3b91da['query'][_0xea33('0xcb')]&&_0x3b91da[_0xea33('0x3d')]['state']){_0x4586c1=_0x3b91da[_0xea33('0x3d')]['state'];return db[_0xea33('0xb4')]['find']({'where':{'messageId':_0x3b91da[_0xea33('0x3d')][_0xea33('0xcb')]}});}break;}}})[_0xea33('0x1a')](handleEntityNotFound(_0x54186f,null))['then'](function(_0x24bac1){if(_0x24bac1){_0x4a7ab0=_0x24bac1;switch(_0x3dd5fc[_0xea33('0x3b')]){case _0xea33('0x83'):if(_0x4586c1==='2'||_0x4586c1==='6'){return _0x4a7ab0[_0xea33('0x2f')]({'read':!![]});}else{logger['error'](_0xea33('0x1e'),_0xea33('0x26'),_0xea33('0x83'),util['inspect'](_0x3b91da[_0xea33('0x3d')],{'showHidden':![],'depth':null}));};break;}return _0x4a7ab0;}})[_0xea33('0x1a')](respondWithResult(_0x54186f,null))[_0xea33('0x23')](handleError(_0x54186f,null));};exports[_0xea33('0xcc')]=function(_0x154c6c,_0x385cf3,_0x40515b){return db['SmsAccount'][_0xea33('0x52')]({'where':{'id':_0x154c6c[_0xea33('0x4f')]['id']}})[_0xea33('0x1a')](handleEntityNotFound(_0x385cf3,null))[_0xea33('0x1a')](function(_0x46631e){if(_0x46631e){return _0x46631e[_0xea33('0xcc')](_0x154c6c[_0xea33('0x59')][_0xea33('0x63')],_[_0xea33('0xcd')](_0x154c6c[_0xea33('0x59')],['ids','id'])||{})['spread'](function(_0x5056cc){for(var _0x4d323a=0x0;_0x4d323a<_0x154c6c['body'][_0xea33('0x63')]['length'];_0x4d323a+=0x1){socket[_0xea33('0xce')](_0xea33('0xcf'),{'UserId':Number(_0x154c6c['body'][_0xea33('0x63')][_0x4d323a]),'SmsAccountId':Number(_0x154c6c[_0xea33('0x4f')]['id'])});}return _0x5056cc;});}})[_0xea33('0x1a')](respondWithResult(_0x385cf3,null))[_0xea33('0x23')](handleError(_0x385cf3,null));};exports['removeAgents']=function(_0x3111d3,_0x32c742,_0x380f22){return db[_0xea33('0x4d')][_0xea33('0x52')]({'where':{'id':_0x3111d3[_0xea33('0x4f')]['id']}})['then'](handleEntityNotFound(_0x32c742,null))[_0xea33('0x1a')](function(_0x1e7259){if(_0x1e7259){return _0x1e7259[_0xea33('0xd0')](_0x3111d3[_0xea33('0x3d')]['ids'])[_0xea33('0x1a')](function(){if(_[_0xea33('0xd1')](_0x3111d3[_0xea33('0x3d')][_0xea33('0x63')])){for(var _0x3ba5e3=0x0;_0x3ba5e3<_0x3111d3[_0xea33('0x3d')][_0xea33('0x63')]['length'];_0x3ba5e3+=0x1){socket['emit'](_0xea33('0xd2'),{'UserId':Number(_0x3111d3[_0xea33('0x3d')][_0xea33('0x63')][_0x3ba5e3]),'SmsAccountId':Number(_0x3111d3[_0xea33('0x4f')]['id'])});}}else{socket[_0xea33('0xce')](_0xea33('0xd2'),{'UserId':Number(_0x3111d3[_0xea33('0x3d')][_0xea33('0x63')]),'SmsAccountId':Number(_0x3111d3[_0xea33('0x4f')]['id'])});}});}})[_0xea33('0x1a')](respondWithStatusCode(_0x32c742,null))['catch'](handleError(_0x32c742,null));};exports[_0xea33('0xd3')]=function(_0x54e8d1,_0x2311a5,_0x4c4115){var _0x63bbec={};var _0x345b9c={};var _0x2c32ec;var _0x4c5019;return db['SmsAccount']['findOne']({'where':{'id':_0x54e8d1[_0xea33('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2311a5,null))[_0xea33('0x1a')](function(_0x170260){if(_0x170260){_0x2c32ec=_0x170260;_0x345b9c['model']=_[_0xea33('0x3e')](db[_0xea33('0x9d')][_0xea33('0x50')]);_0x345b9c[_0xea33('0x3d')]=_[_0xea33('0x3e')](_0x54e8d1['query']);_0x345b9c[_0xea33('0x48')]=_['intersection'](_0x345b9c['model'],_0x345b9c[_0xea33('0x3d')]);_0x63bbec[_0xea33('0x40')]=_[_0xea33('0x3f')](_0x345b9c[_0xea33('0x43')],qs[_0xea33('0x41')](_0x54e8d1[_0xea33('0x3d')][_0xea33('0x41')]));_0x63bbec[_0xea33('0x40')]=_0x63bbec[_0xea33('0x40')]['length']?_0x63bbec[_0xea33('0x40')]:_0x345b9c['model'];_0x63bbec[_0xea33('0x60')]=qs[_0xea33('0x45')](_0x54e8d1[_0xea33('0x3d')][_0xea33('0x45')]);_0x63bbec[_0xea33('0x46')]=qs[_0xea33('0x48')](_['pick'](_0x54e8d1['query'],_0x345b9c[_0xea33('0x48')]));if(_0x54e8d1[_0xea33('0x3d')][_0xea33('0x4a')]){_0x63bbec[_0xea33('0x46')]=_[_0xea33('0x49')](_0x63bbec['where'],{'$or':_[_0xea33('0x39')](_0x63bbec[_0xea33('0x40')],function(_0x3f6bdd){var _0x4d5f45={};_0x4d5f45[_0x3f6bdd]={'$like':'%'+_0x54e8d1[_0xea33('0x3d')][_0xea33('0x4a')]+'%'};return _0x4d5f45;})});}_0x63bbec=_['merge']({},_0x63bbec,_0x54e8d1['options']);return _0x2c32ec[_0xea33('0xd3')](_0x63bbec);}})[_0xea33('0x1a')](function(_0x4e4b59){if(_0x4e4b59){_0x4c5019=_0x4e4b59[_0xea33('0x42')];if(!_0x54e8d1[_0xea33('0x3d')][_0xea33('0x5f')](_0xea33('0x44'))){_0x63bbec['limit']=qs[_0xea33('0x2b')](_0x54e8d1[_0xea33('0x3d')][_0xea33('0x2b')]);_0x63bbec[_0xea33('0x29')]=qs[_0xea33('0x29')](_0x54e8d1[_0xea33('0x3d')]['offset']);}return _0x2c32ec[_0xea33('0xd3')](_0x63bbec);}})[_0xea33('0x1a')](function(_0x4deaa7){if(_0x4deaa7){return _0x4deaa7?{'count':_0x4c5019,'rows':_0x4deaa7}:null;}})[_0xea33('0x1a')](respondWithResult(_0x2311a5,null))[_0xea33('0x23')](handleError(_0x2311a5,null));}; \ No newline at end of file +var _0x9274=['connectel','requestid','statusInt','status_code','infobip','groupName','redif','error_code','DELIVERED','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','Disposition','hasOwnProperty','order','pick','include','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','SmsApplication','Applications','account','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','clicksend','plivo','Text','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','unmanaged','SmsMessage','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','entity\x20found','text/xml','\x0a','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','defaults','out','dataValues','Messages','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id'];(function(_0x32e865,_0x317078){var _0x850461=function(_0x37417f){while(--_0x37417f){_0x32e865['push'](_0x32e865['shift']());}};_0x850461(++_0x317078);}(_0x9274,0x1de));var _0x4927=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9274[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0x4927('0x0'));var rimraf=require(_0x4927('0x1'));var zipdir=require(_0x4927('0x2'));var jsonpatch=require(_0x4927('0x3'));var rp=require(_0x4927('0x4'));var moment=require(_0x4927('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4927('0x6'));var path=require(_0x4927('0x7'));var sox=require('sox');var csv=require(_0x4927('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4927('0x9'));var _=require('lodash');var squel=require(_0x4927('0xa'));var crypto=require(_0x4927('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4927('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4927('0xd'));var Papa=require(_0x4927('0xe'));var Redis=require(_0x4927('0xf'));var authService=require(_0x4927('0x10'));var qs=require(_0x4927('0x11'));var as=require(_0x4927('0x12'));var hardwareService=require(_0x4927('0x13'));var logger=require('../../config/logger')(_0x4927('0x14'));var utils=require(_0x4927('0x15'));var config=require(_0x4927('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x4927('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x4927('0x18'))(new Redis(config[_0x4927('0x17')]));require(_0x4927('0x19'))[_0x4927('0x1a')](socket);var jayson=require(_0x4927('0x1b'));var client=jayson[_0x4927('0x1c')][_0x4927('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x399b21,_0x34a6af,_0x47b31b,_0x162f58){return new BPromise(function(_0x4991fc,_0x53a641){var _0x4cb4e3=_0x162f58||client;return _0x4cb4e3[_0x4927('0x1e')](_0x399b21,_0x47b31b)[_0x4927('0x1f')](function(_0x28c41f){logger[_0x4927('0x20')](_0x4927('0x21'),_0x34a6af,'request\x20sent');logger[_0x4927('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x34a6af,_0x4927('0x23'),JSON[_0x4927('0x24')](_0x28c41f));if(_0x28c41f[_0x4927('0x25')]){if(_0x28c41f['error'][_0x4927('0x26')]===0x1f4){logger['error'](_0x4927('0x21'),_0x34a6af,_0x28c41f[_0x4927('0x25')][_0x4927('0x27')]);return _0x53a641(_0x28c41f[_0x4927('0x25')][_0x4927('0x27')]);}logger[_0x4927('0x25')]('SmsAccount,\x20%s,\x20%s',_0x34a6af,_0x28c41f['error']['message']);return _0x4991fc(_0x28c41f[_0x4927('0x25')]['message']);}else{logger[_0x4927('0x20')](_0x4927('0x21'),_0x34a6af,_0x4927('0x23'));_0x4991fc(_0x28c41f['result']['message']);}})['catch'](function(_0x30a964){logger[_0x4927('0x25')](_0x4927('0x21'),_0x34a6af,_0x30a964);_0x53a641(_0x30a964);});});}function respondWithStatusCode(_0x11dae5,_0xac7c28){_0xac7c28=_0xac7c28||0xcc;return function(_0x24b843){if(_0x24b843){return _0x11dae5[_0x4927('0x28')](_0xac7c28);}return _0x11dae5[_0x4927('0x29')](_0xac7c28)[_0x4927('0x2a')]();};}function respondWithResult(_0x4fc319,_0xd8cf37){_0xd8cf37=_0xd8cf37||0xc8;return function(_0x56eb60){if(_0x56eb60){return _0x4fc319[_0x4927('0x29')](_0xd8cf37)[_0x4927('0x2b')](_0x56eb60);}};}function respondWithFilteredResult(_0x181d5a,_0x157863){return function(_0x424d42){if(_0x424d42){var _0x53b20e=typeof _0x157863[_0x4927('0x2c')]===_0x4927('0x2d')&&typeof _0x157863[_0x4927('0x2e')]==='undefined';var _0x29a2a1=_0x424d42[_0x4927('0x2f')];var _0x39918d=_0x53b20e?0x0:_0x157863[_0x4927('0x2c')];var _0x1035db=_0x53b20e?_0x424d42['count']:_0x157863['offset']+_0x157863[_0x4927('0x2e')];var _0x1dbc78;if(_0x1035db>=_0x29a2a1){_0x1035db=_0x29a2a1;_0x1dbc78=0xc8;}else{_0x1dbc78=0xce;}_0x181d5a[_0x4927('0x29')](_0x1dbc78);return _0x181d5a[_0x4927('0x30')]('Content-Range',_0x39918d+'-'+_0x1035db+'/'+_0x29a2a1)[_0x4927('0x2b')](_0x424d42);}return null;};}function patchUpdates(_0x56a950){return function(_0x33ed4a){try{jsonpatch[_0x4927('0x31')](_0x33ed4a,_0x56a950,!![]);}catch(_0x3ceb5b){return BPromise[_0x4927('0x32')](_0x3ceb5b);}return _0x33ed4a[_0x4927('0x33')]();};}function saveUpdates(_0x4dcf37,_0x456974){return function(_0x4f12cf){if(_0x4f12cf){return _0x4f12cf[_0x4927('0x34')](_0x4dcf37)[_0x4927('0x1f')](function(_0x10eed6){return _0x10eed6;});}return null;};}function removeEntity(_0x4f7081,_0x155b56){return function(_0x3779eb){if(_0x3779eb){return _0x3779eb[_0x4927('0x35')]()[_0x4927('0x1f')](function(){var _0x7f7a4e=_0x3779eb['get']({'plain':!![]});var _0x59c5bc=_0x4927('0x36');return db['UserProfileResource'][_0x4927('0x35')]({'where':{'type':_0x59c5bc,'resourceId':_0x7f7a4e['id']}})[_0x4927('0x1f')](function(){return _0x3779eb;});})[_0x4927('0x1f')](function(){_0x4f7081[_0x4927('0x29')](0xcc)[_0x4927('0x2a')]();});}};}function handleEntityNotFound(_0x1d6d1e,_0x304895){return function(_0x1d6fd9){if(!_0x1d6fd9){_0x1d6d1e['sendStatus'](0x194);}return _0x1d6fd9;};}function handleError(_0x31ace6,_0x47d4c4){_0x47d4c4=_0x47d4c4||0x1f4;return function(_0x1ce80e){logger[_0x4927('0x25')](_0x1ce80e[_0x4927('0x37')]);if(_0x1ce80e['name']){delete _0x1ce80e[_0x4927('0x38')];}_0x31ace6[_0x4927('0x29')](_0x47d4c4)[_0x4927('0x39')](_0x1ce80e);};}exports[_0x4927('0x3a')]=function(_0x5ac75a,_0x3f4424){var _0x130b31={'include':[{'model':db[_0x4927('0x3b')],'as':_0x4927('0x3c')}]},_0x16f39b={},_0x2bc0c4={'count':0x0,'rows':[]};var _0xa99820=_[_0x4927('0x3d')](db[_0x4927('0x3e')][_0x4927('0x3f')],function(_0xa089a7){return{'name':_0xa089a7[_0x4927('0x40')],'type':_0xa089a7[_0x4927('0x41')][_0x4927('0x42')]};});_0x16f39b[_0x4927('0x43')]=_[_0x4927('0x3d')](_0xa99820,_0x4927('0x38'));_0x16f39b['query']=_[_0x4927('0x44')](_0x5ac75a[_0x4927('0x45')]);_0x16f39b[_0x4927('0x46')]=_[_0x4927('0x47')](_0x16f39b[_0x4927('0x43')],_0x16f39b[_0x4927('0x45')]);_0x130b31['attributes']=_[_0x4927('0x47')](_0x16f39b[_0x4927('0x43')],qs['fields'](_0x5ac75a[_0x4927('0x45')][_0x4927('0x48')]));_0x130b31[_0x4927('0x49')]=_0x130b31[_0x4927('0x49')]['length']?_0x130b31[_0x4927('0x49')]:_0x16f39b[_0x4927('0x43')];if(!_0x5ac75a[_0x4927('0x45')]['hasOwnProperty'](_0x4927('0x4a'))){_0x130b31[_0x4927('0x2e')]=qs[_0x4927('0x2e')](_0x5ac75a['query']['limit']);_0x130b31[_0x4927('0x2c')]=qs[_0x4927('0x2c')](_0x5ac75a[_0x4927('0x45')][_0x4927('0x2c')]);}_0x130b31['order']=qs['sort'](_0x5ac75a[_0x4927('0x45')][_0x4927('0x4b')]);_0x130b31[_0x4927('0x4c')]=qs[_0x4927('0x46')](_['pick'](_0x5ac75a[_0x4927('0x45')],_0x16f39b[_0x4927('0x46')]),_0xa99820);if(_0x5ac75a[_0x4927('0x45')][_0x4927('0x4d')]){_0x130b31[_0x4927('0x4c')]=_[_0x4927('0x4e')](_0x130b31[_0x4927('0x4c')],{'$or':_[_0x4927('0x3d')](_0xa99820,function(_0x2f759d){if(_0x2f759d['type']!==_0x4927('0x4f')){var _0x3270a8={};_0x3270a8[_0x2f759d[_0x4927('0x38')]]={'$like':'%'+_0x5ac75a[_0x4927('0x45')][_0x4927('0x4d')]+'%'};return _0x3270a8;}})});}_0x130b31=_[_0x4927('0x4e')]({},_0x130b31,_0x5ac75a[_0x4927('0x50')]);var _0x33dcdb={'where':_0x130b31['where']};return db[_0x4927('0x3e')][_0x4927('0x2f')](_0x33dcdb)[_0x4927('0x1f')](function(_0x4ebddb){_0x2bc0c4[_0x4927('0x2f')]=_0x4ebddb;if(_0x5ac75a[_0x4927('0x45')][_0x4927('0x51')]){_0x130b31['include']=[{'all':!![]}];}return db['SmsAccount'][_0x4927('0x52')](_0x130b31);})[_0x4927('0x1f')](function(_0x4161f8){_0x2bc0c4[_0x4927('0x53')]=_0x4161f8;return _0x2bc0c4;})[_0x4927('0x1f')](respondWithFilteredResult(_0x3f4424,_0x130b31))[_0x4927('0x54')](handleError(_0x3f4424,null));};exports[_0x4927('0x55')]=function(_0x1af0bc,_0x4b7d41){var _0x441454={'raw':![],'where':{'id':_0x1af0bc[_0x4927('0x56')]['id']},'include':[{'model':db[_0x4927('0x3b')],'as':_0x4927('0x3c')}]},_0x2bff5d={};_0x2bff5d[_0x4927('0x43')]=_[_0x4927('0x44')](db[_0x4927('0x3e')][_0x4927('0x3f')]);_0x2bff5d['query']=_[_0x4927('0x44')](_0x1af0bc['query']);_0x2bff5d[_0x4927('0x46')]=_[_0x4927('0x47')](_0x2bff5d[_0x4927('0x43')],_0x2bff5d['query']);_0x441454[_0x4927('0x49')]=_['intersection'](_0x2bff5d[_0x4927('0x43')],qs[_0x4927('0x48')](_0x1af0bc[_0x4927('0x45')][_0x4927('0x48')]));_0x441454[_0x4927('0x49')]=_0x441454['attributes'][_0x4927('0x57')]?_0x441454['attributes']:_0x2bff5d['model'];if(_0x1af0bc[_0x4927('0x45')][_0x4927('0x51')]){_0x441454['include']=[{'all':!![]}];}_0x441454=_[_0x4927('0x4e')]({},_0x441454,_0x1af0bc[_0x4927('0x50')]);return db[_0x4927('0x3e')][_0x4927('0x58')](_0x441454)[_0x4927('0x1f')](handleEntityNotFound(_0x4b7d41,null))[_0x4927('0x1f')](respondWithResult(_0x4b7d41,null))[_0x4927('0x54')](handleError(_0x4b7d41,null));};exports['create']=function(_0x2ba5b,_0x379fc9){return db[_0x4927('0x3e')][_0x4927('0x59')](_0x2ba5b[_0x4927('0x5a')],{})[_0x4927('0x1f')](function(_0x5dee22){var _0x45bce8=_0x2ba5b[_0x4927('0x5b')]['get']({'plain':!![]});if(!_0x45bce8)throw new Error(_0x4927('0x5c'));if(_0x45bce8[_0x4927('0x5d')]==='user'){var _0x4625b1=_0x5dee22[_0x4927('0x5e')]({'plain':!![]});var _0x8f88e9='SmsAccounts';return db[_0x4927('0x5f')]['find']({'where':{'name':_0x8f88e9,'userProfileId':_0x45bce8[_0x4927('0x60')]},'raw':!![]})[_0x4927('0x1f')](function(_0x3db5f8){if(_0x3db5f8&&_0x3db5f8[_0x4927('0x61')]===0x0){return db['UserProfileResource'][_0x4927('0x59')]({'name':_0x4625b1[_0x4927('0x38')],'resourceId':_0x4625b1['id'],'type':_0x3db5f8[_0x4927('0x38')],'sectionId':_0x3db5f8['id']},{})[_0x4927('0x1f')](function(){return _0x5dee22;});}else{return _0x5dee22;}})['catch'](function(_0x87f90d){logger[_0x4927('0x25')](_0x4927('0x62'),_0x87f90d);throw _0x87f90d;});}return _0x5dee22;})['then'](respondWithResult(_0x379fc9,0xc9))[_0x4927('0x54')](handleError(_0x379fc9,null));};exports[_0x4927('0x34')]=function(_0x5282ab,_0x3e6edc){if(_0x5282ab[_0x4927('0x5a')]['id']){delete _0x5282ab[_0x4927('0x5a')]['id'];}return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0x5282ab['params']['id']},'include':[{'model':db[_0x4927('0x3b')],'as':_0x4927('0x3c')}]})[_0x4927('0x1f')](handleEntityNotFound(_0x3e6edc,null))[_0x4927('0x1f')](saveUpdates(_0x5282ab[_0x4927('0x5a')],null))[_0x4927('0x1f')](respondWithResult(_0x3e6edc,null))[_0x4927('0x54')](handleError(_0x3e6edc,null));};exports[_0x4927('0x35')]=function(_0x3a2b59,_0x14baf9){return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0x3a2b59[_0x4927('0x56')]['id']}})['then'](handleEntityNotFound(_0x14baf9,null))[_0x4927('0x1f')](removeEntity(_0x14baf9,null))[_0x4927('0x54')](handleError(_0x14baf9,null));};exports[_0x4927('0x63')]=function(_0x4f6194,_0x1d5e5f){return db[_0x4927('0x3e')][_0x4927('0x63')]()['then'](respondWithResult(_0x1d5e5f,null))['catch'](handleError(_0x1d5e5f,null));};exports[_0x4927('0x64')]=function(_0x64b5fc,_0x564db6,_0x9395ac){if(_0x64b5fc['body']['id']){delete _0x64b5fc[_0x4927('0x5a')]['id'];}return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0x64b5fc['params']['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x564db6,null))[_0x4927('0x1f')](function(_0x56703e){if(_0x56703e){_0x64b5fc[_0x4927('0x5a')][_0x4927('0x65')]=_0x56703e['id'];return db['Disposition'][_0x4927('0x59')](_0x64b5fc[_0x4927('0x5a')]);}})['then'](respondWithResult(_0x564db6,null))['catch'](handleError(_0x564db6,null));};exports[_0x4927('0x66')]=function(_0x1f3095,_0xd2da26,_0x2f1719){var _0x5612c8={'raw':![],'where':{}};var _0x6afbb5={};var _0x3a5a1b={'count':0x0,'rows':[]};return db[_0x4927('0x3e')]['findOne']({'where':{'id':_0x1f3095[_0x4927('0x56')]['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0xd2da26,null))[_0x4927('0x1f')](function(_0x5b0810){if(_0x5b0810){_0x6afbb5[_0x4927('0x43')]=_[_0x4927('0x44')](db[_0x4927('0x67')][_0x4927('0x3f')]);_0x6afbb5['query']=_['keys'](_0x1f3095['query']);_0x6afbb5[_0x4927('0x46')]=_['intersection'](_0x6afbb5[_0x4927('0x43')],_0x6afbb5[_0x4927('0x45')]);_0x5612c8['attributes']=_['intersection'](_0x6afbb5[_0x4927('0x43')],qs[_0x4927('0x48')](_0x1f3095[_0x4927('0x45')][_0x4927('0x48')]));_0x5612c8[_0x4927('0x49')]=_0x5612c8[_0x4927('0x49')][_0x4927('0x57')]?_0x5612c8[_0x4927('0x49')]:_0x6afbb5[_0x4927('0x43')];if(!_0x1f3095[_0x4927('0x45')][_0x4927('0x68')]('nolimit')){_0x5612c8['limit']=qs[_0x4927('0x2e')](_0x1f3095['query']['limit']);_0x5612c8[_0x4927('0x2c')]=qs[_0x4927('0x2c')](_0x1f3095[_0x4927('0x45')][_0x4927('0x2c')]);}_0x5612c8[_0x4927('0x69')]=qs[_0x4927('0x4b')](_0x1f3095[_0x4927('0x45')][_0x4927('0x4b')]);_0x5612c8[_0x4927('0x4c')]=qs['filters'](_[_0x4927('0x6a')](_0x1f3095[_0x4927('0x45')],_0x6afbb5[_0x4927('0x46')]));_0x5612c8[_0x4927('0x4c')][_0x4927('0x65')]=_0x5b0810['id'];if(_0x1f3095[_0x4927('0x45')]['filter']){_0x5612c8[_0x4927('0x4c')]=_[_0x4927('0x4e')](_0x5612c8[_0x4927('0x4c')],{'$or':_[_0x4927('0x3d')](_0x5612c8['attributes'],function(_0x670e2c){var _0x424700={};_0x424700[_0x670e2c]={'$like':'%'+_0x1f3095[_0x4927('0x45')]['filter']+'%'};return _0x424700;})});}_0x5612c8=_['merge']({},_0x5612c8,_0x1f3095[_0x4927('0x50')]);return db[_0x4927('0x67')][_0x4927('0x2f')]({'where':_0x5612c8[_0x4927('0x4c')]})[_0x4927('0x1f')](function(_0x2758dc){_0x3a5a1b[_0x4927('0x2f')]=_0x2758dc;if(_0x1f3095['query'][_0x4927('0x51')]){_0x5612c8[_0x4927('0x6b')]=[{'all':!![]}];}return db[_0x4927('0x67')]['findAll'](_0x5612c8);})['then'](function(_0x4730c0){_0x3a5a1b['rows']=_0x4730c0;return _0x3a5a1b;});}})[_0x4927('0x1f')](respondWithFilteredResult(_0xd2da26,_0x5612c8))['catch'](handleError(_0xd2da26,null));};exports[_0x4927('0x6c')]=function(_0x5eccf6,_0x47ad43,_0x129d20){return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0x5eccf6[_0x4927('0x56')]['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x47ad43,null))[_0x4927('0x1f')](function(_0x875221){if(_0x875221){return _0x875221['removeDispositions'](_0x5eccf6[_0x4927('0x45')][_0x4927('0x6d')]);}})[_0x4927('0x1f')](respondWithStatusCode(_0x47ad43,null))[_0x4927('0x54')](handleError(_0x47ad43,null));};exports[_0x4927('0x6e')]=function(_0xcd9dec,_0x2b4474,_0xfe70f5){if(_0xcd9dec[_0x4927('0x5a')]['id']){delete _0xcd9dec['body']['id'];}return db['SmsAccount'][_0x4927('0x58')]({'where':{'id':_0xcd9dec['params']['id']}})['then'](handleEntityNotFound(_0x2b4474,null))[_0x4927('0x1f')](function(_0x5be18d){if(_0x5be18d){_0xcd9dec[_0x4927('0x5a')][_0x4927('0x65')]=_0x5be18d['id'];return db[_0x4927('0x6f')][_0x4927('0x59')](_0xcd9dec['body']);}})[_0x4927('0x1f')](respondWithResult(_0x2b4474,null))[_0x4927('0x54')](handleError(_0x2b4474,null));};exports['getAnswers']=function(_0x417525,_0x3f4194,_0x3ff97b){var _0x55d423={'raw':![],'where':{}};var _0x383efe={};var _0xbf7c6={'count':0x0,'rows':[]};return db[_0x4927('0x3e')][_0x4927('0x70')]({'where':{'id':_0x417525[_0x4927('0x56')]['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x3f4194,null))[_0x4927('0x1f')](function(_0x2853a8){if(_0x2853a8){_0x383efe['model']=_[_0x4927('0x44')](db[_0x4927('0x6f')][_0x4927('0x3f')]);_0x383efe[_0x4927('0x45')]=_[_0x4927('0x44')](_0x417525[_0x4927('0x45')]);_0x383efe['filters']=_[_0x4927('0x47')](_0x383efe['model'],_0x383efe['query']);_0x55d423[_0x4927('0x49')]=_[_0x4927('0x47')](_0x383efe[_0x4927('0x43')],qs[_0x4927('0x48')](_0x417525['query'][_0x4927('0x48')]));_0x55d423[_0x4927('0x49')]=_0x55d423['attributes'][_0x4927('0x57')]?_0x55d423[_0x4927('0x49')]:_0x383efe[_0x4927('0x43')];if(!_0x417525['query'][_0x4927('0x68')](_0x4927('0x4a'))){_0x55d423[_0x4927('0x2e')]=qs[_0x4927('0x2e')](_0x417525[_0x4927('0x45')]['limit']);_0x55d423[_0x4927('0x2c')]=qs[_0x4927('0x2c')](_0x417525['query'][_0x4927('0x2c')]);}_0x55d423[_0x4927('0x69')]=qs[_0x4927('0x4b')](_0x417525[_0x4927('0x45')][_0x4927('0x4b')]);_0x55d423[_0x4927('0x4c')]=qs[_0x4927('0x46')](_[_0x4927('0x6a')](_0x417525['query'],_0x383efe[_0x4927('0x46')]));_0x55d423[_0x4927('0x4c')]['SmsAccountId']=_0x2853a8['id'];if(_0x417525['query'][_0x4927('0x4d')]){_0x55d423[_0x4927('0x4c')]=_[_0x4927('0x4e')](_0x55d423[_0x4927('0x4c')],{'$or':_[_0x4927('0x3d')](_0x55d423['attributes'],function(_0x5c598b){var _0x28287a={};_0x28287a[_0x5c598b]={'$like':'%'+_0x417525[_0x4927('0x45')][_0x4927('0x4d')]+'%'};return _0x28287a;})});}_0x55d423=_[_0x4927('0x4e')]({},_0x55d423,_0x417525[_0x4927('0x50')]);return db[_0x4927('0x6f')][_0x4927('0x2f')]({'where':_0x55d423[_0x4927('0x4c')]})[_0x4927('0x1f')](function(_0x821287){_0xbf7c6[_0x4927('0x2f')]=_0x821287;if(_0x417525['query'][_0x4927('0x51')]){_0x55d423[_0x4927('0x6b')]=[{'all':!![]}];}return db[_0x4927('0x6f')][_0x4927('0x52')](_0x55d423);})[_0x4927('0x1f')](function(_0x37f2d5){_0xbf7c6['rows']=_0x37f2d5;return _0xbf7c6;});}})[_0x4927('0x1f')](respondWithFilteredResult(_0x3f4194,_0x55d423))[_0x4927('0x54')](handleError(_0x3f4194,null));};exports['removeAnswers']=function(_0x3876c2,_0x1a0d39,_0x3f216c){return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0x3876c2[_0x4927('0x56')]['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x1a0d39,null))['then'](function(_0xed24dc){if(_0xed24dc){return _0xed24dc[_0x4927('0x71')](_0x3876c2[_0x4927('0x45')][_0x4927('0x6d')]);}})[_0x4927('0x1f')](respondWithStatusCode(_0x1a0d39,null))['catch'](handleError(_0x1a0d39,null));};exports['notify']=function(_0xaf47b8,_0x501c1c,_0x39351c){var _0x2e956e={'channel':'sms'};var _0x2a23eb=[];var _0x3c22d2=[];var _0x596fa2={};return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0xaf47b8[_0x4927('0x56')]['id']},'include':[{'model':db[_0x4927('0x72')],'as':_0x4927('0x73')}]})[_0x4927('0x1f')](handleEntityNotFound(_0x501c1c,null))[_0x4927('0x1f')](function(_0x1035e3){_0x2e956e[_0x4927('0x74')]=_0x1035e3;_0x2e956e['applications']=_['orderBy'](_0x1035e3[_0x4927('0x73')],[_0x4927('0x75')],[_0x4927('0x76')]);if(_0x2e956e[_0x4927('0x74')][_0x4927('0x73')]){delete _0x2e956e[_0x4927('0x74')][_0x4927('0x73')];}return db[_0x4927('0x77')][_0x4927('0x63')]();})[_0x4927('0x1f')](function(_0x5d89b1){if(!_0x5d89b1){throw new db[(_0x4927('0x78'))][(_0x4927('0x79'))](_0x4927('0x7a'));}_0x2a23eb=_[_0x4927('0x7b')](_[_0x4927('0x44')](_0x5d89b1),[_0x4927('0x7c'),_0x4927('0x7d')]);_0x3c22d2=_[_0x4927('0x7b')](_['keys'](_0x5d89b1),['createdAt',_0x4927('0x7d'),'CompanyId',_0x4927('0x7e')]);_0x2e956e[_0x4927('0x5a')]={'mapKey':_0x4927('0x7f')};if(_0x2e956e['account'][_0x4927('0x41')]){switch(_0x2e956e[_0x4927('0x74')][_0x4927('0x41')]){case _0x4927('0x80'):_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x82')];_0x2e956e[_0x4927('0x5a')][_0x4927('0x5a')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x83')];_0x2e956e[_0x4927('0x5a')][_0x4927('0x84')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x85')];break;case _0x4927('0x86'):_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')]='+'+_0xaf47b8[_0x4927('0x5a')][_0x4927('0x87')];_0x2e956e[_0x4927('0x5a')]['body']=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x88')];break;case'connectel':_0x2e956e['body'][_0x4927('0x81')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x81')];_0x2e956e['body'][_0x4927('0x5a')]=_0xaf47b8['body'][_0x4927('0x27')];break;case _0x4927('0x89'):_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')]=_0xaf47b8['body'][_0x4927('0x81')];_0x2e956e[_0x4927('0x5a')]['body']=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x5a')];_0x2e956e[_0x4927('0x5a')][_0x4927('0x84')]=_0xaf47b8['body']['message_id'];break;case _0x4927('0x8a'):_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x82')];_0x2e956e[_0x4927('0x5a')]['body']=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x8b')];_0x2e956e[_0x4927('0x5a')][_0x4927('0x84')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x8c')];break;case'infobip':_0x2e956e[_0x4927('0x5a')]['from']='+'+_0xaf47b8['body'][_0x4927('0x8d')][0x0][_0x4927('0x81')];_0x2e956e[_0x4927('0x5a')][_0x4927('0x5a')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x8d')][0x0][_0x4927('0x88')];_0x2e956e[_0x4927('0x5a')][_0x4927('0x84')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x8d')][0x0][_0x4927('0x84')];break;case _0x4927('0x8e'):_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')]=_0xaf47b8['body'][_0x4927('0x8f')];_0x2e956e[_0x4927('0x5a')]['body']=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x90')][_0x4927('0x27')];break;case _0x4927('0x91'):_0x2e956e['body'][_0x4927('0x81')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x92')];_0x2e956e[_0x4927('0x5a')][_0x4927('0x5a')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x88')];_0x2e956e['body'][_0x4927('0x84')]=_0xaf47b8['body'][_0x4927('0x93')];break;case _0x4927('0x94'):_0x2e956e['body'][_0x4927('0x84')]=_0xaf47b8['body'][0x0][_0x4927('0x27')]['id'];_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')]=_0xaf47b8[_0x4927('0x5a')][0x0]['message'][_0x4927('0x81')];_0x2e956e['body']['body']=_0xaf47b8[_0x4927('0x5a')][0x0]['message'][_0x4927('0x88')];break;case _0x4927('0x95'):_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')]=_0xaf47b8['body']['from'];_0x2e956e['body'][_0x4927('0x5a')]=_0xaf47b8[_0x4927('0x5a')]['message'];_0x2e956e[_0x4927('0x5a')][_0x4927('0x84')]=_0xaf47b8[_0x4927('0x5a')][_0x4927('0x96')];break;}}if(_0x2e956e['body']['id']){delete _0x2e956e[_0x4927('0x5a')]['id'];}if(_[_0x4927('0x97')](_0x2e956e['body']['from'])){throw new db[(_0x4927('0x78'))][(_0x4927('0x79'))](_0x4927('0x98'));}if(_[_0x4927('0x97')](_0x2e956e[_0x4927('0x5a')]['body'])||_0x2e956e[_0x4927('0x5a')][_0x4927('0x5a')]===''){throw new db[(_0x4927('0x78'))][(_0x4927('0x79'))](_0x4927('0x99'));}if(_[_0x4927('0x97')](_0x2e956e[_0x4927('0x5a')][_0x4927('0x9a')])){throw new db[(_0x4927('0x78'))][(_0x4927('0x79'))](_0x4927('0x9b')+_0x3c22d2);}if(!_[_0x4927('0x9c')](_0x3c22d2,_0x2e956e['body']['mapKey'])){throw new db[(_0x4927('0x78'))][(_0x4927('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c22d2);}_0x596fa2[_0x2e956e[_0x4927('0x5a')][_0x4927('0x9a')]]=_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')];return db[_0x4927('0x9d')][_0x4927('0x58')]({'where':{'id':_0x2e956e[_0x4927('0x74')][_0x4927('0x7e')]},'include':[{'model':db[_0x4927('0x77')],'as':_0x4927('0x9e'),'where':_0x596fa2,'limit':0x1,'order':[[_0x4927('0x7d'),_0x4927('0x9f')]]}]});})[_0x4927('0x1f')](handleEntityNotFound(_0x501c1c,null))[_0x4927('0x1f')](function(_0x30f232){if(_0x30f232){_0x2e956e[_0x4927('0xa0')]=_[_0x4927('0xa1')](_0x30f232,[_0x4927('0x9e')]);if(_0x30f232['Contacts'][_0x4927('0x57')]){return _0x30f232[_0x4927('0x9e')][0x0];}var _0x23c6b3=_['defaults'](_0x2e956e[_0x4927('0x5a')],{'firstName':_0x2e956e[_0x4927('0x5a')][_0x4927('0x81')],'ListId':_0x30f232['id']});_0x23c6b3[_0x2e956e[_0x4927('0x5a')][_0x4927('0x9a')]]=_0x2e956e['body'][_0x4927('0x81')];return db['CmContact']['create'](_0x23c6b3,{'fields':_0x2a23eb,'raw':!![]});}})[_0x4927('0x1f')](handleEntityNotFound(_0x501c1c,null))['then'](function(_0x2fc22f){if(_0x2fc22f){_0x2e956e[_0x4927('0xa2')]=_0x2fc22f;var _0x3b6fe3={'ContactId':_0x2fc22f['id'],'phone':_0x2e956e['body'][_0x4927('0x81')],'SmsAccountId':_0xaf47b8[_0x4927('0x56')]['id']};var _0x501f15={'ContactId':_0x2fc22f['id'],'SmsAccountId':_0xaf47b8['params']['id'],'closed':![]};return db[_0x4927('0xa3')][_0x4927('0x58')]({'where':_0x501f15})[_0x4927('0x1f')](function(_0x795a6){if(_0x795a6){return[_0x795a6,![]];}return db[_0x4927('0xa3')][_0x4927('0x59')](_0x3b6fe3)['then'](function(_0x5df97){return[_0x5df97,!![]];});});}})[_0x4927('0xa4')](function(_0x54bd61,_0x5173ad){_0x2e956e[_0x4927('0xa5')]=_0x54bd61['get']({'plain':!![]});_0x2e956e[_0x4927('0xa5')][_0x4927('0xa6')]=![];if(_0x5173ad){if(_0x2e956e[_0x4927('0x74')][_0x4927('0xa7')]){_0x2e956e[_0x4927('0xa8')]['push']({'id':0x0,'priority':_0x2e956e[_0x4927('0xa8')][_0x4927('0x57')]+0x1,'app':_0x4927('0xa9'),'appdata':_0x4927('0xaa'),'interval':'*,*,*,*'});}_0x2e956e[_0x4927('0xa5')][_0x4927('0xa6')]=!![];}return db[_0x4927('0xab')]['create']({'phone':_0x2e956e[_0x4927('0x5a')]['from'],'messageId':_0x2e956e[_0x4927('0x5a')][_0x4927('0x84')],'body':_0x2e956e[_0x4927('0x5a')][_0x4927('0x5a')],'SmsAccountId':_0xaf47b8[_0x4927('0x56')]['id'],'SmsInteractionId':_0x54bd61['id'],'direction':'in','ContactId':_0x54bd61['ContactId'],'AttachmentId':_0x2e956e[_0x4927('0x5a')]['AttachmentId']});})[_0x4927('0x1f')](function(_0x572cbd){_0x2e956e[_0x4927('0x27')]=_0x572cbd;if(_0x2e956e[_0x4927('0xa5')][_0x4927('0xac')]){return db[_0x4927('0xad')][_0x4927('0x58')]({'attributes':['id','name'],'where':{'id':_0x2e956e[_0x4927('0xa5')][_0x4927('0xac')]}})['then'](function(_0x43ab85){if(_0x43ab85){_0x2e956e[_0x4927('0xa8')][_0x4927('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43ab85[_0x4927('0x38')]+','+(_0x2e956e['account'][_0x4927('0xaf')]||0xa),'interval':_0x4927('0xb0')});}return respondWithRpcPromise('Start',_0x4927('0xb1'),_0x2e956e);});}return respondWithRpcPromise(_0x4927('0xb2'),_0x4927('0xb1'),_0x2e956e);})[_0x4927('0x1f')](function(_0x2b7a84){if(_0x2b7a84){var _0x39d85b=0xc8;var _0xfb6124='receiveMessage';logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfb6124,_0x39d85b,_0x4927('0xb3'));logger[_0x4927('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xfb6124,_0x39d85b,_0x4927('0xb3'),JSON['stringify'](_0x2b7a84));if(_0x2e956e[_0x4927('0x74')][_0x4927('0x41')]===_0x4927('0x80')){return _0x501c1c[_0x4927('0x29')](_0x39d85b)['set']('Content-Type',_0x4927('0xb4'))['send'](_0x4927('0xb5'));}else{return _0x501c1c[_0x4927('0x29')](_0x39d85b)[_0x4927('0x2b')](_0x2b7a84);}}})[_0x4927('0x54')](handleError(_0x501c1c,null));};exports['addApplications']=function(_0x78668d,_0x13786b){var _0x6c09a8=_0x78668d['params']['id'];var _0x479044=_0x78668d[_0x4927('0x5a')];var _0x24f7f2=0xc8;var _0x1abb91=null;return db[_0x4927('0xb6')][_0x4927('0xb7')]({'isolationLevel':db[_0x4927('0xb6')]['Transaction'][_0x4927('0xb8')][_0x4927('0xb9')]},function(_0x395ef5){return db[_0x4927('0x3e')][_0x4927('0x70')]({'where':{'id':_0x6c09a8},'transaction':_0x395ef5})[_0x4927('0x1f')](function(_0x5ad327){if(_0x5ad327){return db['SmsApplication'][_0x4927('0x35')]({'where':{'SmsAccountId':_0x6c09a8},'transaction':_0x395ef5})[_0x4927('0x1f')](function(){var _0xff8fcc=_[_0x4927('0x3d')](_0x479044,function(_0x38e263){_0x38e263[_0x4927('0x65')]=_0x6c09a8;return _0x38e263;});return db[_0x4927('0x72')][_0x4927('0xba')](_0xff8fcc,{'transaction':_0x395ef5});});}else{_0x24f7f2=0x194;_0x1abb91=[];}});})[_0x4927('0x1f')](function(){if(_0x24f7f2!==0x194){return db[_0x4927('0x72')][_0x4927('0xbb')]({'where':{'SmsAccountId':_0x6c09a8},'order':_0x4927('0x75')})[_0x4927('0x1f')](function(_0x136aba){_0x1abb91=_0x136aba;});}})[_0x4927('0x54')](function(_0x823ccc){_0x24f7f2=0x1f4;logger[_0x4927('0x25')](_0x823ccc[_0x4927('0x37')]);if(_0x823ccc['name']){delete _0x823ccc[_0x4927('0x38')];}_0x1abb91=_0x823ccc;})[_0x4927('0xbc')](function(){if(_0x1abb91===null){_0x13786b[_0x4927('0x28')](_0x24f7f2);}else{if(_0x24f7f2===0x1f4){_0x13786b[_0x4927('0x29')](_0x24f7f2)[_0x4927('0x39')](_0x1abb91);}else{_0x13786b['status'](_0x24f7f2)['json'](_0x1abb91);}}});};exports[_0x4927('0xbd')]=function(_0x22b914,_0x2c8e0f,_0x43a272){var _0x41605c={};var _0x1d109c={};var _0x3e9545;var _0x157cec;return db[_0x4927('0x3e')]['findOne']({'where':{'id':_0x22b914['params']['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x2c8e0f,null))['then'](function(_0x32b3f8){if(_0x32b3f8){_0x3e9545=_0x32b3f8;_0x1d109c[_0x4927('0x43')]=_[_0x4927('0x44')](db['SmsApplication'][_0x4927('0x3f')]);_0x1d109c[_0x4927('0x45')]=_['keys'](_0x22b914[_0x4927('0x45')]);_0x1d109c[_0x4927('0x46')]=_[_0x4927('0x47')](_0x1d109c[_0x4927('0x43')],_0x1d109c[_0x4927('0x45')]);_0x41605c[_0x4927('0x49')]=_[_0x4927('0x47')](_0x1d109c[_0x4927('0x43')],qs['fields'](_0x22b914[_0x4927('0x45')][_0x4927('0x48')]));_0x41605c[_0x4927('0x49')]=_0x41605c['attributes'][_0x4927('0x57')]?_0x41605c[_0x4927('0x49')]:_0x1d109c[_0x4927('0x43')];_0x41605c[_0x4927('0x69')]=qs[_0x4927('0x4b')](_0x22b914[_0x4927('0x45')]['sort']);_0x41605c[_0x4927('0x4c')]=qs[_0x4927('0x46')](_[_0x4927('0x6a')](_0x22b914[_0x4927('0x45')],_0x1d109c[_0x4927('0x46')]));if(_0x22b914[_0x4927('0x45')]['filter']){_0x41605c[_0x4927('0x4c')]=_[_0x4927('0x4e')](_0x41605c[_0x4927('0x4c')],{'$or':_['map'](_0x41605c['attributes'],function(_0x11ef7c){var _0x4e1b21={};_0x4e1b21[_0x11ef7c]={'$like':'%'+_0x22b914[_0x4927('0x45')][_0x4927('0x4d')]+'%'};return _0x4e1b21;})});}_0x41605c=_['merge']({},_0x41605c,_0x22b914['options']);return _0x3e9545['getApplications'](_0x41605c);}})[_0x4927('0x1f')](function(_0x5f3892){if(_0x5f3892){_0x157cec=_0x5f3892[_0x4927('0x57')];if(!_0x22b914['query']['hasOwnProperty'](_0x4927('0x4a'))){_0x41605c[_0x4927('0x2e')]=qs[_0x4927('0x2e')](_0x22b914[_0x4927('0x45')][_0x4927('0x2e')]);_0x41605c[_0x4927('0x2c')]=qs[_0x4927('0x2c')](_0x22b914[_0x4927('0x45')][_0x4927('0x2c')]);}return _0x3e9545[_0x4927('0xbd')](_0x41605c);}})[_0x4927('0x1f')](function(_0x26da41){if(_0x26da41){return _0x26da41?{'count':_0x157cec,'rows':_0x26da41}:null;}})['then'](respondWithResult(_0x2c8e0f,null))['catch'](handleError(_0x2c8e0f,null));};exports[_0x4927('0xbe')]=function(_0x460475,_0x26c119,_0x52c89a){var _0x23ffb2={'raw':![],'where':{}};var _0x11e318={};var _0x4899c9={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4927('0x70')]({'where':{'id':_0x460475['params']['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x26c119,null))[_0x4927('0x1f')](function(_0x429b9c){if(_0x429b9c){_0x11e318[_0x4927('0x43')]=_[_0x4927('0x44')](db[_0x4927('0xa3')][_0x4927('0x3f')]);_0x11e318[_0x4927('0x45')]=_[_0x4927('0x44')](_0x460475['query']);_0x11e318[_0x4927('0x46')]=_[_0x4927('0x47')](_0x11e318[_0x4927('0x43')],_0x11e318[_0x4927('0x45')]);_0x23ffb2['attributes']=_[_0x4927('0x47')](_0x11e318['model'],qs['fields'](_0x460475[_0x4927('0x45')][_0x4927('0x48')]));_0x23ffb2[_0x4927('0x49')]=_0x23ffb2[_0x4927('0x49')]['length']?_0x23ffb2[_0x4927('0x49')]:_0x11e318[_0x4927('0x43')];if(!_0x460475[_0x4927('0x45')]['hasOwnProperty'](_0x4927('0x4a'))){_0x23ffb2[_0x4927('0x2e')]=qs[_0x4927('0x2e')](_0x460475[_0x4927('0x45')][_0x4927('0x2e')]);_0x23ffb2[_0x4927('0x2c')]=qs[_0x4927('0x2c')](_0x460475[_0x4927('0x45')][_0x4927('0x2c')]);}_0x23ffb2[_0x4927('0x69')]=qs['sort'](_0x460475[_0x4927('0x45')][_0x4927('0x4b')]);_0x23ffb2['where']=qs[_0x4927('0x46')](_[_0x4927('0x6a')](_0x460475[_0x4927('0x45')],_0x11e318[_0x4927('0x46')]));_0x23ffb2[_0x4927('0x4c')]['SmsAccountId']=_0x429b9c['id'];if(_0x460475[_0x4927('0x45')]['filter']){_0x23ffb2[_0x4927('0x4c')]=_[_0x4927('0x4e')](_0x23ffb2[_0x4927('0x4c')],{'$or':_[_0x4927('0x3d')](_0x23ffb2['attributes'],function(_0x23c230){var _0x2b44ad={};_0x2b44ad[_0x23c230]={'$like':'%'+_0x460475[_0x4927('0x45')][_0x4927('0x4d')]+'%'};return _0x2b44ad;})});}_0x23ffb2=_['merge']({},_0x23ffb2,_0x460475['options']);return db[_0x4927('0xa3')]['count']({'where':_0x23ffb2[_0x4927('0x4c')]})[_0x4927('0x1f')](function(_0x6c5dc8){_0x4899c9[_0x4927('0x2f')]=_0x6c5dc8;if(_0x460475[_0x4927('0x45')][_0x4927('0x51')]){_0x23ffb2[_0x4927('0x6b')]=[{'model':db['CmContact'],'as':_0x4927('0xbf'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x4927('0x38'),'fullname',_0x4927('0xc0')],'required':![]},{'model':db[_0x4927('0xc1')],'as':_0x4927('0xc2'),'attributes':['id','name','color'],'where':_0x460475[_0x4927('0x45')][_0x4927('0xc3')]?{'id':_0x460475[_0x4927('0x45')][_0x4927('0xc3')]}:undefined,'required':_0x460475[_0x4927('0x45')][_0x4927('0xc3')]?!![]:![]}];}return db[_0x4927('0xa3')]['findAll'](_0x23ffb2);})[_0x4927('0x1f')](function(_0x107ff5){_0x4899c9[_0x4927('0x53')]=_0x107ff5;return _0x4899c9;});}})['then'](respondWithFilteredResult(_0x26c119,_0x23ffb2))[_0x4927('0x54')](handleError(_0x26c119,null));};exports['send']=function(_0x27e44b,_0xb32de6,_0x6a9e3f){var _0x27e1e2,_0xb5e574,_0x578341;if(_[_0x4927('0x97')](_0x27e44b[_0x4927('0x5a')]['body'])||_0x27e44b[_0x4927('0x5a')][_0x4927('0x5a')]===''){throw new db[(_0x4927('0x78'))][(_0x4927('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x27e44b[_0x4927('0x5a')]['to'])){throw new db[(_0x4927('0x78'))][(_0x4927('0x79'))](_0x4927('0xc4'));}_0x27e1e2=_0x27e44b[_0x4927('0x5a')]['to'];return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0x27e44b['params']['id']},'include':[{'model':db[_0x4927('0x9d')],'as':_0x4927('0xc5'),'include':[{'model':db[_0x4927('0x77')],'as':_0x4927('0x9e'),'where':{'mobile':_0x27e1e2},'limit':0x1,'order':[[_0x4927('0x7d'),_0x4927('0x9f')]]}]}]})['then'](handleEntityNotFound(_0xb32de6,null))[_0x4927('0x1f')](function(_0x5df589){if(_0x5df589&&_0x5df589['List']){_0xb5e574=_0x5df589[_0x4927('0x5e')]({'plain':!![]});if(_0xb5e574[_0x4927('0xc5')]&&_0xb5e574[_0x4927('0xc5')]['Contacts']['length']){return _0xb5e574[_0x4927('0xc5')]['Contacts'][0x0];}return db[_0x4927('0x77')][_0x4927('0x59')](_[_0x4927('0xc6')](_0x27e44b[_0x4927('0x5a')],{'firstName':_0x27e1e2,'mobile':_0x27e1e2,'phone':_0x27e1e2,'ListId':_0xb5e574['ListId']}));}})['then'](handleEntityNotFound(_0xb32de6,null))[_0x4927('0x1f')](function(_0x3d511d){if(_0x3d511d){_0x578341=_0x3d511d;return db[_0x4927('0xa3')]['find']({'where':{'ContactId':_0x578341['id'],'closed':![],'SmsAccountId':_0xb5e574['id']}})[_0x4927('0x1f')](function(_0x5ab538){if(_0x5ab538){return[_0x5ab538,![]];}return db[_0x4927('0xa3')][_0x4927('0x59')]({'UserId':_0x27e44b[_0x4927('0x5b')]['id'],'ContactId':_0x578341['id'],'SmsAccountId':_0xb5e574['id'],'phone':_0x27e1e2,'firstMsgDirection':_0x4927('0xc7'),'Messages':[_[_0x4927('0x4e')](_0x27e44b['body'],{'read':![],'body':_0x27e44b[_0x4927('0x5a')][_0x4927('0x5a')],'phone':_0x27e1e2,'SmsAccountId':_0xb5e574['id'],'UserId':_0x27e44b[_0x4927('0x5b')]['id'],'ContactId':_0x578341['id']})]},{'include':[{'model':db[_0x4927('0xab')],'as':'Messages'}]})[_0x4927('0x1f')](function(_0x53dac6){return[_0x53dac6,!![]];});});}})[_0x4927('0xa4')](function(_0x302342,_0x5a14f5){if(_0x5a14f5){return _0x302342;}return db[_0x4927('0xab')][_0x4927('0x59')](_[_0x4927('0x4e')](_0x27e44b[_0x4927('0x5a')],{'read':![],'body':_0x27e44b[_0x4927('0x5a')][_0x4927('0x5a')],'phone':_0x27e1e2,'SmsAccountId':_0xb5e574['id'],'SmsInteractionId':_0x302342['id'],'UserId':_0x27e44b[_0x4927('0x5b')]['id'],'ContactId':_0x578341['id']}))[_0x4927('0x1f')](function(_0x509f37){_0x302342[_0x4927('0xc8')][_0x4927('0xc9')]=[];_0x302342['dataValues'][_0x4927('0xc9')]['push'](_0x509f37['dataValues']);return _0x302342;});})[_0x4927('0x1f')](respondWithResult(_0xb32de6,null))[_0x4927('0x54')](handleError(_0xb32de6,null));};exports[_0x4927('0x29')]=function(_0x2b8549,_0x33b592,_0x3b2be2){if(_0x2b8549[_0x4927('0x5a')]['id']){delete _0x2b8549[_0x4927('0x5a')]['id'];}var _0x49dc4a,_0x3aecb3,_0x5053e5;return db[_0x4927('0x3e')]['find']({'where':{'id':_0x2b8549['params']['id']}})['then'](handleEntityNotFound(_0x33b592,null))[_0x4927('0x1f')](function(_0x2868be){if(_0x2868be){_0x5053e5=_0x2868be;logger['debug'](_0x4927('0xca'),'status',_0x4927('0xcb'),_0x2868be[_0x4927('0x41')],util[_0x4927('0xcc')](_0x2b8549[_0x4927('0x5a')],{'showHidden':![],'depth':null}));switch(_0x2868be[_0x4927('0x41')]){case _0x4927('0x86'):if(_0x2b8549['body'][_0x4927('0xcd')]&&_0x2b8549[_0x4927('0x5a')]['status']){_0x3aecb3=_0x2b8549['body'][_0x4927('0x29')];return db[_0x4927('0xab')][_0x4927('0x58')]({'where':{'messageId':_0x2b8549[_0x4927('0x5a')]['skebby_dispatch_id']}});}break;case _0x4927('0xce'):if(_0x2b8549['body'][_0x4927('0xcf')]&&_0x2b8549[_0x4927('0x5a')][_0x4927('0xd0')]){_0x3aecb3=_0x2b8549[_0x4927('0x5a')][_0x4927('0xd0')];return db[_0x4927('0xab')][_0x4927('0x58')]({'where':{'messageId':_0x2b8549['body'][_0x4927('0xcf')]}});}break;case _0x4927('0x89'):if(_0x2b8549[_0x4927('0x5a')]['message_id']&&_0x2b8549['body'][_0x4927('0xd1')]){_0x3aecb3=_0x2b8549[_0x4927('0x5a')]['status_code'];return db['SmsMessage'][_0x4927('0x58')]({'where':{'messageId':_0x2b8549[_0x4927('0x5a')]['message_id']}});}break;case _0x4927('0xd2'):var _0x48d7b2=_0x2b8549[_0x4927('0x5a')][_0x4927('0x8d')][0x0];if(_0x48d7b2[_0x4927('0x84')]&&_0x48d7b2[_0x4927('0x29')][_0x4927('0xd3')]==='DELIVERED'){_0x3aecb3=_0x48d7b2['status'][_0x4927('0xd3')];return db[_0x4927('0xab')][_0x4927('0x58')]({'where':{'messageId':_0x48d7b2[_0x4927('0x84')]}});}break;case _0x4927('0x91'):if(_0x2b8549['body'][_0x4927('0x84')]&&_0x2b8549[_0x4927('0x5a')]['status']){_0x3aecb3=_0x2b8549[_0x4927('0x5a')]['status'];return db[_0x4927('0xab')][_0x4927('0x58')]({'where':{'messageId':_0x2b8549[_0x4927('0x5a')]['messageId']}});}break;case _0x4927('0x94'):if(_0x2b8549['body'][0x0][_0x4927('0x27')]['id']){_0x3aecb3=_0x2b8549[_0x4927('0x5a')][0x0][_0x4927('0x41')];return db[_0x4927('0xab')][_0x4927('0x58')]({'where':{'messageId':_0x2b8549[_0x4927('0x5a')][0x0][_0x4927('0x27')]['id']}});}break;case _0x4927('0x95'):if(_0x2b8549[_0x4927('0x5a')]['redif']&&_0x2b8549[_0x4927('0x5a')][_0x4927('0x29')]){_0x3aecb3=_0x2b8549['body'][_0x4927('0x29')];return db[_0x4927('0xab')][_0x4927('0x58')]({'where':{'messageId':_0x2b8549[_0x4927('0x5a')][_0x4927('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x33b592,null))[_0x4927('0x1f')](function(_0x2e2ff0){if(_0x2e2ff0){_0x49dc4a=_0x2e2ff0;switch(_0x5053e5[_0x4927('0x41')]){case _0x4927('0x86'):if(_0x3aecb3==='DELIVERED'){return _0x49dc4a[_0x4927('0x34')]({'read':!![]});}else{logger['error'](_0x4927('0xca'),_0x4927('0x29'),_0x4927('0x86'),util[_0x4927('0xcc')](_0x2b8549[_0x4927('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x4927('0xce'):if(_0x3aecb3==='1'){return _0x49dc4a['update']({'read':!![]});}else{logger[_0x4927('0x25')](_0x4927('0xca'),_0x4927('0x29'),_0x4927('0x86'),util[_0x4927('0xcc')](_0x2b8549[_0x4927('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2b8549['body'][_0x4927('0xd5')]&&_0x3aecb3>=0xc8&&_0x3aecb3<=0xce){return _0x49dc4a[_0x4927('0x34')]({'read':!![]});}else{logger[_0x4927('0x25')](_0x4927('0xca'),_0x4927('0x29'),_0x4927('0x89'),util[_0x4927('0xcc')](_0x2b8549['body'],{'showHidden':![],'depth':null}));}break;case _0x4927('0xd2'):var _0x5eeb13=_0x2b8549['body'][_0x4927('0x8d')][0x0];if(_0x5eeb13[_0x4927('0x29')][_0x4927('0xd3')]===_0x4927('0xd6')){return _0x49dc4a['update']({'read':!![]});}else{logger[_0x4927('0x25')](_0x4927('0xca'),_0x4927('0x29'),_0x4927('0xd2'),util[_0x4927('0xcc')](_0x2b8549[_0x4927('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3aecb3=='DELIVERED_TO_GATEWAY'||_0x3aecb3==_0x4927('0xd7')){return _0x49dc4a['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4927('0x29'),_0x4927('0x91'),util[_0x4927('0xcc')](_0x2b8549[_0x4927('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x4927('0x94'):if(_0x3aecb3=='message-delivered'){return _0x49dc4a[_0x4927('0x34')]({'read':!![]});}else{logger[_0x4927('0x25')](_0x4927('0xca'),_0x4927('0x29'),_0x4927('0x94'),util[_0x4927('0xcc')](_0x2b8549[_0x4927('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x4927('0x95'):if(_0x3aecb3===_0x4927('0xd8')||_0x3aecb3===_0x4927('0xd9')){return _0x49dc4a[_0x4927('0x34')]({'read':!![]});}else{logger[_0x4927('0x25')](_0x4927('0xca'),_0x4927('0x29'),_0x4927('0x95'),util['inspect'](_0x2b8549['body'],{'showHidden':![],'depth':null}));}break;}return _0x49dc4a;}})[_0x4927('0x1f')](respondWithResult(_0x33b592,null))[_0x4927('0x54')](handleError(_0x33b592,null));};exports[_0x4927('0xda')]=function(_0x12c4ce,_0x245e6f,_0xeca361){var _0x4605c4,_0x1a0f38,_0x2823a6;return db[_0x4927('0x3e')]['find']({'where':{'id':_0x12c4ce['params']['id']}})['then'](handleEntityNotFound(_0x245e6f,null))['then'](function(_0x30a1e0){if(_0x30a1e0){_0x2823a6=_0x30a1e0;logger[_0x4927('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4927('0xcb'),_0x30a1e0[_0x4927('0x41')],util['inspect'](_0x12c4ce[_0x4927('0x45')],{'showHidden':![],'depth':null}));switch(_0x30a1e0[_0x4927('0x41')]){case _0x4927('0x8e'):if(_0x12c4ce[_0x4927('0x45')]['message-id']&&_0x12c4ce[_0x4927('0x45')][_0x4927('0xdb')]){_0x1a0f38=_0x12c4ce['query'][_0x4927('0xdb')];return db[_0x4927('0xab')]['find']({'where':{'messageId':_0x12c4ce['query'][_0x4927('0xdc')]}});}break;}}})['then'](handleEntityNotFound(_0x245e6f,null))['then'](function(_0x3f2f76){if(_0x3f2f76){_0x4605c4=_0x3f2f76;switch(_0x2823a6[_0x4927('0x41')]){case _0x4927('0x8e'):if(_0x1a0f38==='2'||_0x1a0f38==='6'){return _0x4605c4[_0x4927('0x34')]({'read':!![]});}else{logger[_0x4927('0x25')](_0x4927('0xca'),'status',_0x4927('0x8e'),util[_0x4927('0xcc')](_0x12c4ce[_0x4927('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x4605c4;}})[_0x4927('0x1f')](respondWithResult(_0x245e6f,null))[_0x4927('0x54')](handleError(_0x245e6f,null));};exports[_0x4927('0xdd')]=function(_0x27bd62,_0x34972a,_0x1f40dc){return db['SmsAccount'][_0x4927('0x58')]({'where':{'id':_0x27bd62[_0x4927('0x56')]['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x34972a,null))[_0x4927('0x1f')](function(_0x28f4fa){if(_0x28f4fa){return _0x28f4fa[_0x4927('0xdd')](_0x27bd62[_0x4927('0x5a')][_0x4927('0x6d')],_[_0x4927('0xa1')](_0x27bd62[_0x4927('0x5a')],[_0x4927('0x6d'),'id'])||{})[_0x4927('0xa4')](function(_0x52a16d){for(var _0xaa819d=0x0;_0xaa819d<_0x27bd62[_0x4927('0x5a')][_0x4927('0x6d')][_0x4927('0x57')];_0xaa819d+=0x1){socket[_0x4927('0xde')](_0x4927('0xdf'),{'UserId':Number(_0x27bd62['body'][_0x4927('0x6d')][_0xaa819d]),'SmsAccountId':Number(_0x27bd62[_0x4927('0x56')]['id'])});}return _0x52a16d;});}})[_0x4927('0x1f')](respondWithResult(_0x34972a,null))[_0x4927('0x54')](handleError(_0x34972a,null));};exports[_0x4927('0xe0')]=function(_0x316d09,_0x3ae7a0,_0x698c9e){return db[_0x4927('0x3e')][_0x4927('0x58')]({'where':{'id':_0x316d09[_0x4927('0x56')]['id']}})['then'](handleEntityNotFound(_0x3ae7a0,null))[_0x4927('0x1f')](function(_0x47add0){if(_0x47add0){return _0x47add0[_0x4927('0xe0')](_0x316d09[_0x4927('0x45')][_0x4927('0x6d')])[_0x4927('0x1f')](function(){if(_[_0x4927('0xe1')](_0x316d09[_0x4927('0x45')][_0x4927('0x6d')])){for(var _0x53698a=0x0;_0x53698a<_0x316d09[_0x4927('0x45')][_0x4927('0x6d')]['length'];_0x53698a+=0x1){socket['emit'](_0x4927('0xe2'),{'UserId':Number(_0x316d09['query'][_0x4927('0x6d')][_0x53698a]),'SmsAccountId':Number(_0x316d09[_0x4927('0x56')]['id'])});}}else{socket[_0x4927('0xde')](_0x4927('0xe2'),{'UserId':Number(_0x316d09['query'][_0x4927('0x6d')]),'SmsAccountId':Number(_0x316d09['params']['id'])});}});}})[_0x4927('0x1f')](respondWithStatusCode(_0x3ae7a0,null))[_0x4927('0x54')](handleError(_0x3ae7a0,null));};exports[_0x4927('0xe3')]=function(_0x5871bb,_0x1b5d2d,_0x56d3dd){var _0x121e9b={};var _0x579336={};var _0x87229;var _0x1a71f1;return db[_0x4927('0x3e')][_0x4927('0x70')]({'where':{'id':_0x5871bb['params']['id']}})[_0x4927('0x1f')](handleEntityNotFound(_0x1b5d2d,null))[_0x4927('0x1f')](function(_0x2f4c8d){if(_0x2f4c8d){_0x87229=_0x2f4c8d;_0x579336[_0x4927('0x43')]=_[_0x4927('0x44')](db[_0x4927('0xad')][_0x4927('0x3f')]);_0x579336[_0x4927('0x45')]=_['keys'](_0x5871bb[_0x4927('0x45')]);_0x579336[_0x4927('0x46')]=_[_0x4927('0x47')](_0x579336[_0x4927('0x43')],_0x579336[_0x4927('0x45')]);_0x121e9b['attributes']=_[_0x4927('0x47')](_0x579336[_0x4927('0x43')],qs[_0x4927('0x48')](_0x5871bb[_0x4927('0x45')][_0x4927('0x48')]));_0x121e9b[_0x4927('0x49')]=_0x121e9b[_0x4927('0x49')][_0x4927('0x57')]?_0x121e9b[_0x4927('0x49')]:_0x579336['model'];_0x121e9b[_0x4927('0x69')]=qs[_0x4927('0x4b')](_0x5871bb[_0x4927('0x45')][_0x4927('0x4b')]);_0x121e9b[_0x4927('0x4c')]=qs[_0x4927('0x46')](_[_0x4927('0x6a')](_0x5871bb['query'],_0x579336[_0x4927('0x46')]));if(_0x5871bb[_0x4927('0x45')][_0x4927('0x4d')]){_0x121e9b[_0x4927('0x4c')]=_[_0x4927('0x4e')](_0x121e9b[_0x4927('0x4c')],{'$or':_[_0x4927('0x3d')](_0x121e9b[_0x4927('0x49')],function(_0x1a140d){var _0xca68cf={};_0xca68cf[_0x1a140d]={'$like':'%'+_0x5871bb[_0x4927('0x45')][_0x4927('0x4d')]+'%'};return _0xca68cf;})});}_0x121e9b=_[_0x4927('0x4e')]({},_0x121e9b,_0x5871bb[_0x4927('0x50')]);return _0x87229['getAgents'](_0x121e9b);}})[_0x4927('0x1f')](function(_0x51a67f){if(_0x51a67f){_0x1a71f1=_0x51a67f[_0x4927('0x57')];if(!_0x5871bb[_0x4927('0x45')][_0x4927('0x68')](_0x4927('0x4a'))){_0x121e9b[_0x4927('0x2e')]=qs[_0x4927('0x2e')](_0x5871bb[_0x4927('0x45')][_0x4927('0x2e')]);_0x121e9b[_0x4927('0x2c')]=qs['offset'](_0x5871bb[_0x4927('0x45')][_0x4927('0x2c')]);}return _0x87229[_0x4927('0xe3')](_0x121e9b);}})[_0x4927('0x1f')](function(_0xba428a){if(_0xba428a){return _0xba428a?{'count':_0x1a71f1,'rows':_0xba428a}:null;}})[_0x4927('0x1f')](respondWithResult(_0x1b5d2d,null))[_0x4927('0x54')](handleError(_0x1b5d2d,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 10c311e..eb4afa1 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 _0xc88e=['update','remove','emit','hasOwnProperty','hook','exports','events','SmsAccount','setMaxListeners','save'];(function(_0x8ba3c,_0x51ab1d){var _0x3a87e0=function(_0x463fdf){while(--_0x463fdf){_0x8ba3c['push'](_0x8ba3c['shift']());}};_0x3a87e0(++_0x51ab1d);}(_0xc88e,0xe2));var _0xec88=function(_0x1c0e91,_0xd8625e){_0x1c0e91=_0x1c0e91-0x0;var _0x34322c=_0xc88e[_0x1c0e91];return _0x34322c;};'use strict';var EventEmitter=require(_0xec88('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xec88('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xec88('0x2')](0x0);var events={'afterCreate':_0xec88('0x3'),'afterUpdate':_0xec88('0x4'),'afterDestroy':_0xec88('0x5')};function emitEvent(_0x545548){return function(_0x103d5b,_0x2c42f6,_0x33d784){SmsAccountEvents[_0xec88('0x6')](_0x545548+':'+_0x103d5b['id'],_0x103d5b);SmsAccountEvents['emit'](_0x545548,_0x103d5b);_0x33d784(null);};}for(var e in events){if(events[_0xec88('0x7')](e)){var event=events[e];SmsAccount[_0xec88('0x8')](e,emitEvent(event));}}module[_0xec88('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0xc5bf=['exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x3c0694,_0x482281){var _0xf72691=function(_0x352382){while(--_0x352382){_0x3c0694['push'](_0x3c0694['shift']());}};_0xf72691(++_0x482281);}(_0xc5bf,0x141));var _0xfc5b=function(_0x1bf658,_0xedf44b){_0x1bf658=_0x1bf658-0x0;var _0x39ae8f=_0xc5bf[_0x1bf658];return _0x39ae8f;};'use strict';var EventEmitter=require(_0xfc5b('0x0'));var SmsAccount=require(_0xfc5b('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xfc5b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfc5b('0x3'),'afterDestroy':_0xfc5b('0x4')};function emitEvent(_0x2be29d){return function(_0x45b656,_0x394213,_0x4c1a42){SmsAccountEvents[_0xfc5b('0x5')](_0x2be29d+':'+_0x45b656['id'],_0x45b656);SmsAccountEvents[_0xfc5b('0x5')](_0x2be29d,_0x45b656);_0x4c1a42(null);};}for(var e in events){if(events[_0xfc5b('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xfc5b('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5731589..b2cb959 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 _0x817f=['bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','SmsAccount','lodash','util','../../config/logger','moment'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0x817f,0x11a));var _0xf817=function(_0x545dd8,_0x404f75){_0x545dd8=_0x545dd8-0x0;var _0x44cd80=_0x817f[_0x545dd8];return _0x44cd80;};'use strict';var _=require(_0xf817('0x0'));var util=require(_0xf817('0x1'));var logger=require(_0xf817('0x2'))('api');var moment=require(_0xf817('0x3'));var BPromise=require(_0xf817('0x4'));var rp=require(_0xf817('0x5'));var fs=require('fs');var path=require(_0xf817('0x6'));var rimraf=require(_0xf817('0x7'));var config=require(_0xf817('0x8'));var attributes=require(_0xf817('0x9'));module['exports']=function(_0x90c9e3,_0x3299a4){return _0x90c9e3['define'](_0xf817('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x174c=['api','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x174c,0x82));var _0xc174=function(_0x52a4d8,_0x307d98){_0x52a4d8=_0x52a4d8-0x0;var _0x2e66a6=_0x174c[_0x52a4d8];return _0x2e66a6;};'use strict';var _=require(_0xc174('0x0'));var util=require(_0xc174('0x1'));var logger=require('../../config/logger')(_0xc174('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc174('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc174('0x4'));var config=require(_0xc174('0x5'));var attributes=require(_0xc174('0x6'));module[_0xc174('0x7')]=function(_0x2d3fdf,_0x33b408){return _0x2d3fdf[_0xc174('0x8')](_0xc174('0x9'),attributes,{'tableName':_0xc174('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 aeaead1..4a133f7 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 _0x5b10=['error','SmsAccount,\x20%s,\x20%s','message','result','ShowSmsAccount','options','raw','where','attributes','include','map','model','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4bb6ac,_0x34323b){var _0x4eaf13=function(_0x27b238){while(--_0x27b238){_0x4bb6ac['push'](_0x4bb6ac['shift']());}};_0x4eaf13(++_0x34323b);}(_0x5b10,0x1b2));var _0x05b1=function(_0x5400c7,_0x4906ec){_0x5400c7=_0x5400c7-0x0;var _0x7b9700=_0x5b10[_0x5400c7];return _0x7b9700;};'use strict';var _=require(_0x05b1('0x0'));var util=require(_0x05b1('0x1'));var moment=require(_0x05b1('0x2'));var BPromise=require(_0x05b1('0x3'));var rs=require(_0x05b1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05b1('0x5'))['db'];var utils=require(_0x05b1('0x6'));var logger=require(_0x05b1('0x7'))('rpc');var config=require(_0x05b1('0x8'));var jayson=require(_0x05b1('0x9'));var client=jayson[_0x05b1('0xa')]['http']({'port':0x232a});config[_0x05b1('0xb')]=_[_0x05b1('0xc')](config[_0x05b1('0xb')],{'host':_0x05b1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05b1('0xb')]));require('./smsAccount.socket')[_0x05b1('0xe')](socket);function respondWithRpcPromise(_0x19da57,_0x1e9900,_0x26f7d4){return new BPromise(function(_0x46193e,_0x4f6454){return client[_0x05b1('0xf')](_0x19da57,_0x26f7d4)[_0x05b1('0x10')](function(_0x401fed){logger[_0x05b1('0x11')]('SmsAccount,\x20%s,\x20%s',_0x1e9900,'request\x20sent');logger[_0x05b1('0x12')](_0x05b1('0x13'),_0x1e9900,_0x05b1('0x14'),JSON['stringify'](_0x401fed));if(_0x401fed['error']){if(_0x401fed[_0x05b1('0x15')]['code']===0x1f4){logger[_0x05b1('0x15')](_0x05b1('0x16'),_0x1e9900,_0x401fed[_0x05b1('0x15')][_0x05b1('0x17')]);return _0x4f6454(_0x401fed['error']['message']);}logger[_0x05b1('0x15')](_0x05b1('0x16'),_0x1e9900,_0x401fed[_0x05b1('0x15')][_0x05b1('0x17')]);return _0x46193e(_0x401fed['error'][_0x05b1('0x17')]);}else{logger[_0x05b1('0x11')]('SmsAccount,\x20%s,\x20%s',_0x1e9900,_0x05b1('0x14'));_0x46193e(_0x401fed[_0x05b1('0x18')][_0x05b1('0x17')]);}})['catch'](function(_0x108153){logger[_0x05b1('0x15')]('SmsAccount,\x20%s,\x20%s',_0x1e9900,_0x108153);_0x4f6454(_0x108153);});});}exports[_0x05b1('0x19')]=function(_0x2e41a0){var _0x150c36=this;return new Promise(function(_0x2adf64,_0x5553b7){return db['SmsAccount']['find']({'raw':_0x2e41a0[_0x05b1('0x1a')]?_0x2e41a0['options'][_0x05b1('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e41a0[_0x05b1('0x1a')]?_0x2e41a0[_0x05b1('0x1a')][_0x05b1('0x1c')]||null:null,'attributes':_0x2e41a0['options']?_0x2e41a0[_0x05b1('0x1a')][_0x05b1('0x1d')]||null:null,'include':_0x2e41a0[_0x05b1('0x1a')]?_0x2e41a0[_0x05b1('0x1a')][_0x05b1('0x1e')]?_[_0x05b1('0x1f')](_0x2e41a0['options'][_0x05b1('0x1e')],function(_0x2e4284){return{'model':db[_0x2e4284[_0x05b1('0x20')]],'as':_0x2e4284['as'],'attributes':_0x2e4284[_0x05b1('0x1d')],'include':_0x2e4284[_0x05b1('0x1e')]?_[_0x05b1('0x1f')](_0x2e4284[_0x05b1('0x1e')],function(_0x5cf0de){return{'model':db[_0x5cf0de[_0x05b1('0x20')]],'as':_0x5cf0de['as'],'attributes':_0x5cf0de[_0x05b1('0x1d')],'include':_0x5cf0de[_0x05b1('0x1e')]?_['map'](_0x5cf0de[_0x05b1('0x1e')],function(_0x3aba58){return{'model':db[_0x3aba58['model']],'as':_0x3aba58['as'],'attributes':_0x3aba58[_0x05b1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x05b1('0x10')](function(_0x43e41b){logger['info']('ShowSmsAccount',_0x2e41a0);logger[_0x05b1('0x12')](_0x05b1('0x19'),_0x2e41a0,JSON[_0x05b1('0x21')](_0x43e41b));_0x2adf64(_0x43e41b);})[_0x05b1('0x22')](function(_0x542d44){logger[_0x05b1('0x15')](_0x05b1('0x19'),_0x542d44[_0x05b1('0x17')],_0x2e41a0);_0x5553b7(_0x150c36[_0x05b1('0x15')](0x1f4,_0x542d44['message']));});});}; \ No newline at end of file +var _0xa136=['message','SmsAccount,\x20%s,\x20%s','result','catch','SmsAccount','find','options','where','attributes','map','include','model','ShowSmsAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x3e0d42,_0x2d92d8){var _0x3e0abf=function(_0x2f3572){while(--_0x2f3572){_0x3e0d42['push'](_0x3e0d42['shift']());}};_0x3e0abf(++_0x2d92d8);}(_0xa136,0x1c9));var _0x6a13=function(_0x35741f,_0x1bfb4f){_0x35741f=_0x35741f-0x0;var _0x2cd2b7=_0xa136[_0x35741f];return _0x2cd2b7;};'use strict';var _=require(_0x6a13('0x0'));var util=require(_0x6a13('0x1'));var moment=require(_0x6a13('0x2'));var BPromise=require(_0x6a13('0x3'));var rs=require(_0x6a13('0x4'));var fs=require('fs');var Redis=require(_0x6a13('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6a13('0x6'));var logger=require('../../config/logger')(_0x6a13('0x7'));var config=require(_0x6a13('0x8'));var jayson=require(_0x6a13('0x9'));var client=jayson[_0x6a13('0xa')][_0x6a13('0xb')]({'port':0x232a});config[_0x6a13('0xc')]=_['defaults'](config[_0x6a13('0xc')],{'host':_0x6a13('0xd'),'port':0x18eb});var socket=require(_0x6a13('0xe'))(new Redis(config['redis']));require(_0x6a13('0xf'))['register'](socket);function respondWithRpcPromise(_0x365226,_0x68fd62,_0x1a9e50){return new BPromise(function(_0x1d1632,_0x22d9a4){return client[_0x6a13('0x10')](_0x365226,_0x1a9e50)[_0x6a13('0x11')](function(_0x26ff49){logger[_0x6a13('0x12')]('SmsAccount,\x20%s,\x20%s',_0x68fd62,_0x6a13('0x13'));logger[_0x6a13('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x68fd62,'request\x20sent',JSON[_0x6a13('0x15')](_0x26ff49));if(_0x26ff49['error']){if(_0x26ff49[_0x6a13('0x16')][_0x6a13('0x17')]===0x1f4){logger[_0x6a13('0x16')]('SmsAccount,\x20%s,\x20%s',_0x68fd62,_0x26ff49['error'][_0x6a13('0x18')]);return _0x22d9a4(_0x26ff49['error'][_0x6a13('0x18')]);}logger[_0x6a13('0x16')](_0x6a13('0x19'),_0x68fd62,_0x26ff49[_0x6a13('0x16')][_0x6a13('0x18')]);return _0x1d1632(_0x26ff49['error'][_0x6a13('0x18')]);}else{logger[_0x6a13('0x12')](_0x6a13('0x19'),_0x68fd62,_0x6a13('0x13'));_0x1d1632(_0x26ff49[_0x6a13('0x1a')][_0x6a13('0x18')]);}})[_0x6a13('0x1b')](function(_0x3d8782){logger[_0x6a13('0x16')](_0x6a13('0x19'),_0x68fd62,_0x3d8782);_0x22d9a4(_0x3d8782);});});}exports['ShowSmsAccount']=function(_0x5bb352){var _0x7109a5=this;return new Promise(function(_0x44c95e,_0x267a35){return db[_0x6a13('0x1c')][_0x6a13('0x1d')]({'raw':_0x5bb352[_0x6a13('0x1e')]?_0x5bb352[_0x6a13('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5bb352[_0x6a13('0x1e')]?_0x5bb352['options'][_0x6a13('0x1f')]||null:null,'attributes':_0x5bb352[_0x6a13('0x1e')]?_0x5bb352[_0x6a13('0x1e')][_0x6a13('0x20')]||null:null,'include':_0x5bb352[_0x6a13('0x1e')]?_0x5bb352['options']['include']?_[_0x6a13('0x21')](_0x5bb352[_0x6a13('0x1e')]['include'],function(_0x429c47){return{'model':db[_0x429c47['model']],'as':_0x429c47['as'],'attributes':_0x429c47[_0x6a13('0x20')],'include':_0x429c47['include']?_[_0x6a13('0x21')](_0x429c47[_0x6a13('0x22')],function(_0x2e4e20){return{'model':db[_0x2e4e20[_0x6a13('0x23')]],'as':_0x2e4e20['as'],'attributes':_0x2e4e20[_0x6a13('0x20')],'include':_0x2e4e20[_0x6a13('0x22')]?_[_0x6a13('0x21')](_0x2e4e20['include'],function(_0x165901){return{'model':db[_0x165901['model']],'as':_0x165901['as'],'attributes':_0x165901[_0x6a13('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6a13('0x11')](function(_0x2a872d){logger['info'](_0x6a13('0x24'),_0x5bb352);logger[_0x6a13('0x14')](_0x6a13('0x24'),_0x5bb352,JSON['stringify'](_0x2a872d));_0x44c95e(_0x2a872d);})[_0x6a13('0x1b')](function(_0x5dea90){logger[_0x6a13('0x16')]('ShowSmsAccount',_0x5dea90['message'],_0x5bb352);_0x267a35(_0x7109a5['error'](0x1f4,_0x5dea90[_0x6a13('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8ff23b7..801feed 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 fe096af..c2e2682 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(_0x53a2dd,_0x1c3372){var _0xeaf680=function(_0x2ab8ab){while(--_0x2ab8ab){_0x53a2dd['push'](_0x53a2dd['shift']());}};_0xeaf680(++_0x1c3372);}(_0xedd9,0xfc));var _0x9edd=function(_0x429b64,_0x2c9204){_0x429b64=_0x429b64-0x0;var _0x2a42be=_0xedd9[_0x429b64];return _0x2a42be;};'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(_0x2f3fd7,_0x5aeb1b){var _0x44bbb9=function(_0x1fec9d){while(--_0x1fec9d){_0x2f3fd7['push'](_0x2f3fd7['shift']());}};_0x44bbb9(++_0x5aeb1b);}(_0xedd9,0xfc));var _0x9edd=function(_0x52eb38,_0x5c3490){_0x52eb38=_0x52eb38-0x0;var _0x299551=_0xedd9[_0x52eb38];return _0x299551;};'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 90e7d0e..691b458 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 _0x3a23=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x28fb7c,_0x29bbd3){var _0x9f13a4=function(_0x490174){while(--_0x490174){_0x28fb7c['push'](_0x28fb7c['shift']());}};_0x9f13a4(++_0x29bbd3);}(_0x3a23,0xc4));var _0x33a2=function(_0x50db75,_0x339936){_0x50db75=_0x50db75-0x0;var _0x32017b=_0x3a23[_0x50db75];return _0x32017b;};'use strict';var Sequelize=require(_0x33a2('0x0'));module[_0x33a2('0x1')]={'priority':{'type':Sequelize[_0x33a2('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x33a2('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x33a2('0x4')],'defaultValue':_0x33a2('0x5')}}; \ No newline at end of file +var _0x9ddf=['*,*,*,*','exports','INTEGER','noop','TEXT','STRING'];(function(_0x420f45,_0x82ba43){var _0x115f02=function(_0x1f2638){while(--_0x1f2638){_0x420f45['push'](_0x420f45['shift']());}};_0x115f02(++_0x82ba43);}(_0x9ddf,0x1b7));var _0xf9dd=function(_0x50e0c5,_0x49351f){_0x50e0c5=_0x50e0c5-0x0;var _0x11d623=_0x9ddf[_0x50e0c5];return _0x11d623;};'use strict';var Sequelize=require('sequelize');module[_0xf9dd('0x0')]={'priority':{'type':Sequelize[_0xf9dd('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf9dd('0x2')},'appdata':{'type':Sequelize[_0xf9dd('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf9dd('0x4')],'defaultValue':_0xf9dd('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9d25ec4..000971f 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 _0x071c=['limit','count','Content-Range','reject','update','then','status','sendStatus','error','stack','name','send','index','map','SmsApplication','fieldName','type','key','model','keys','filters','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','include','findAll','rows','catch','show','params','intersection','includeAll','merge','options','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','end','json','offset','undefined'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0x071c,0x199));var _0xc071=function(_0xa2ef00,_0x5132bf){_0xa2ef00=_0xa2ef00-0x0;var _0x2d8b96=_0x071c[_0xa2ef00];return _0x2d8b96;};'use strict';var emlformat=require(_0xc071('0x0'));var rimraf=require(_0xc071('0x1'));var zipdir=require(_0xc071('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc071('0x3'));var moment=require(_0xc071('0x4'));var BPromise=require(_0xc071('0x5'));var Mustache=require(_0xc071('0x6'));var util=require(_0xc071('0x7'));var path=require(_0xc071('0x8'));var sox=require(_0xc071('0x9'));var csv=require(_0xc071('0xa'));var ejs=require(_0xc071('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc071('0xc'));var squel=require(_0xc071('0xd'));var crypto=require(_0xc071('0xe'));var jsforce=require(_0xc071('0xf'));var deskjs=require(_0xc071('0x10'));var toCsv=require(_0xc071('0xa'));var querystring=require(_0xc071('0x11'));var Papa=require('papaparse');var Redis=require(_0xc071('0x12'));var authService=require(_0xc071('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc071('0x14'));var logger=require(_0xc071('0x15'))(_0xc071('0x16'));var utils=require('../../config/utils');var config=require(_0xc071('0x17'));var licenseUtil=require(_0xc071('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x510db2,_0x2293ea){_0x2293ea=_0x2293ea||0xcc;return function(_0x28b8d4){if(_0x28b8d4){return _0x510db2['sendStatus'](_0x2293ea);}return _0x510db2['status'](_0x2293ea)[_0xc071('0x19')]();};}function respondWithResult(_0x9f68e8,_0x2d31ea){_0x2d31ea=_0x2d31ea||0xc8;return function(_0x24fbbc){if(_0x24fbbc){return _0x9f68e8['status'](_0x2d31ea)[_0xc071('0x1a')](_0x24fbbc);}};}function respondWithFilteredResult(_0xa857ab,_0x1bdeb6){return function(_0x4a09ff){if(_0x4a09ff){var _0x39a268=typeof _0x1bdeb6[_0xc071('0x1b')]===_0xc071('0x1c')&&typeof _0x1bdeb6[_0xc071('0x1d')]===_0xc071('0x1c');var _0x1478ab=_0x4a09ff[_0xc071('0x1e')];var _0x5e3f6f=_0x39a268?0x0:_0x1bdeb6[_0xc071('0x1b')];var _0x51f14b=_0x39a268?_0x4a09ff['count']:_0x1bdeb6[_0xc071('0x1b')]+_0x1bdeb6[_0xc071('0x1d')];var _0x5b5723;if(_0x51f14b>=_0x1478ab){_0x51f14b=_0x1478ab;_0x5b5723=0xc8;}else{_0x5b5723=0xce;}_0xa857ab['status'](_0x5b5723);return _0xa857ab['set'](_0xc071('0x1f'),_0x5e3f6f+'-'+_0x51f14b+'/'+_0x1478ab)[_0xc071('0x1a')](_0x4a09ff);}return null;};}function patchUpdates(_0x2fae38){return function(_0x3650c8){try{jsonpatch['apply'](_0x3650c8,_0x2fae38,!![]);}catch(_0x13e73b){return BPromise[_0xc071('0x20')](_0x13e73b);}return _0x3650c8['save']();};}function saveUpdates(_0x60fd13,_0x57e5d6){return function(_0x365b71){if(_0x365b71){return _0x365b71[_0xc071('0x21')](_0x60fd13)[_0xc071('0x22')](function(_0x11d0b5){return _0x11d0b5;});}return null;};}function removeEntity(_0x115bd2,_0x203431){return function(_0x1e2583){if(_0x1e2583){return _0x1e2583['destroy']()[_0xc071('0x22')](function(){_0x115bd2[_0xc071('0x23')](0xcc)[_0xc071('0x19')]();});}};}function handleEntityNotFound(_0x22f323,_0x3b796b){return function(_0x2e20cc){if(!_0x2e20cc){_0x22f323[_0xc071('0x24')](0x194);}return _0x2e20cc;};}function handleError(_0x24e2ec,_0x3be2c5){_0x3be2c5=_0x3be2c5||0x1f4;return function(_0x56ce8e){logger[_0xc071('0x25')](_0x56ce8e[_0xc071('0x26')]);if(_0x56ce8e[_0xc071('0x27')]){delete _0x56ce8e[_0xc071('0x27')];}_0x24e2ec[_0xc071('0x23')](_0x3be2c5)[_0xc071('0x28')](_0x56ce8e);};}exports[_0xc071('0x29')]=function(_0xed9d8e,_0x2ab678){var _0x3b5c50={},_0x33d6a3={},_0x437129={'count':0x0,'rows':[]};var _0x16745d=_[_0xc071('0x2a')](db[_0xc071('0x2b')]['rawAttributes'],function(_0x4fb6be){return{'name':_0x4fb6be[_0xc071('0x2c')],'type':_0x4fb6be[_0xc071('0x2d')][_0xc071('0x2e')]};});_0x33d6a3[_0xc071('0x2f')]=_[_0xc071('0x2a')](_0x16745d,_0xc071('0x27'));_0x33d6a3['query']=_[_0xc071('0x30')](_0xed9d8e['query']);_0x33d6a3[_0xc071('0x31')]=_['intersection'](_0x33d6a3[_0xc071('0x2f')],_0x33d6a3[_0xc071('0x32')]);_0x3b5c50[_0xc071('0x33')]=_['intersection'](_0x33d6a3[_0xc071('0x2f')],qs[_0xc071('0x34')](_0xed9d8e['query']['fields']));_0x3b5c50[_0xc071('0x33')]=_0x3b5c50[_0xc071('0x33')]['length']?_0x3b5c50[_0xc071('0x33')]:_0x33d6a3[_0xc071('0x2f')];if(!_0xed9d8e[_0xc071('0x32')][_0xc071('0x35')](_0xc071('0x36'))){_0x3b5c50['limit']=qs[_0xc071('0x1d')](_0xed9d8e['query']['limit']);_0x3b5c50[_0xc071('0x1b')]=qs[_0xc071('0x1b')](_0xed9d8e[_0xc071('0x32')][_0xc071('0x1b')]);}_0x3b5c50[_0xc071('0x37')]=qs['sort'](_0xed9d8e['query'][_0xc071('0x38')]);_0x3b5c50['where']=qs[_0xc071('0x31')](_['pick'](_0xed9d8e['query'],_0x33d6a3[_0xc071('0x31')]),_0x16745d);if(_0xed9d8e[_0xc071('0x32')][_0xc071('0x39')]){_0x3b5c50[_0xc071('0x3a')]=_['merge'](_0x3b5c50[_0xc071('0x3a')],{'$or':_[_0xc071('0x2a')](_0x16745d,function(_0x3cb16b){if(_0x3cb16b[_0xc071('0x2d')]!=='VIRTUAL'){var _0xa9a7ce={};_0xa9a7ce[_0x3cb16b[_0xc071('0x27')]]={'$like':'%'+_0xed9d8e[_0xc071('0x32')][_0xc071('0x39')]+'%'};return _0xa9a7ce;}})});}_0x3b5c50=_['merge']({},_0x3b5c50,_0xed9d8e['options']);var _0x2d7d88={'where':_0x3b5c50[_0xc071('0x3a')]};return db['SmsApplication'][_0xc071('0x1e')](_0x2d7d88)[_0xc071('0x22')](function(_0xcfc10e){_0x437129[_0xc071('0x1e')]=_0xcfc10e;if(_0xed9d8e[_0xc071('0x32')]['includeAll']){_0x3b5c50[_0xc071('0x3b')]=[{'all':!![]}];}return db[_0xc071('0x2b')][_0xc071('0x3c')](_0x3b5c50);})['then'](function(_0x3ead97){_0x437129[_0xc071('0x3d')]=_0x3ead97;return _0x437129;})['then'](respondWithFilteredResult(_0x2ab678,_0x3b5c50))[_0xc071('0x3e')](handleError(_0x2ab678,null));};exports[_0xc071('0x3f')]=function(_0x43d2aa,_0xf88466){var _0x450e58={'raw':!![],'where':{'id':_0x43d2aa[_0xc071('0x40')]['id']}},_0x23156d={};_0x23156d['model']=_[_0xc071('0x30')](db[_0xc071('0x2b')]['rawAttributes']);_0x23156d['query']=_[_0xc071('0x30')](_0x43d2aa[_0xc071('0x32')]);_0x23156d[_0xc071('0x31')]=_[_0xc071('0x41')](_0x23156d[_0xc071('0x2f')],_0x23156d[_0xc071('0x32')]);_0x450e58[_0xc071('0x33')]=_[_0xc071('0x41')](_0x23156d[_0xc071('0x2f')],qs[_0xc071('0x34')](_0x43d2aa['query'][_0xc071('0x34')]));_0x450e58[_0xc071('0x33')]=_0x450e58[_0xc071('0x33')]['length']?_0x450e58[_0xc071('0x33')]:_0x23156d['model'];if(_0x43d2aa['query'][_0xc071('0x42')]){_0x450e58[_0xc071('0x3b')]=[{'all':!![]}];}_0x450e58=_[_0xc071('0x43')]({},_0x450e58,_0x43d2aa[_0xc071('0x44')]);return db['SmsApplication'][_0xc071('0x45')](_0x450e58)[_0xc071('0x22')](handleEntityNotFound(_0xf88466,null))['then'](respondWithResult(_0xf88466,null))[_0xc071('0x3e')](handleError(_0xf88466,null));};exports[_0xc071('0x46')]=function(_0x6b468d,_0x26a11a){return db[_0xc071('0x2b')][_0xc071('0x46')](_0x6b468d[_0xc071('0x47')],{})[_0xc071('0x22')](respondWithResult(_0x26a11a,0xc9))[_0xc071('0x3e')](handleError(_0x26a11a,null));};exports[_0xc071('0x21')]=function(_0xdc7882,_0x2690de){if(_0xdc7882[_0xc071('0x47')]['id']){delete _0xdc7882[_0xc071('0x47')]['id'];}return db['SmsApplication'][_0xc071('0x45')]({'where':{'id':_0xdc7882[_0xc071('0x40')]['id']}})[_0xc071('0x22')](handleEntityNotFound(_0x2690de,null))[_0xc071('0x22')](saveUpdates(_0xdc7882['body'],null))[_0xc071('0x22')](respondWithResult(_0x2690de,null))[_0xc071('0x3e')](handleError(_0x2690de,null));};exports[_0xc071('0x48')]=function(_0x3e48e2,_0x5b92f2){return db['SmsApplication'][_0xc071('0x45')]({'where':{'id':_0x3e48e2['params']['id']}})[_0xc071('0x22')](handleEntityNotFound(_0x5b92f2,null))[_0xc071('0x22')](removeEntity(_0x5b92f2,null))[_0xc071('0x3e')](handleError(_0x5b92f2,null));}; \ No newline at end of file +var _0x16b7=['fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsApplication','include','rows','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x540f3c,_0xc117d8){var _0x2c3ad3=function(_0x25e815){while(--_0x25e815){_0x540f3c['push'](_0x540f3c['shift']());}};_0x2c3ad3(++_0xc117d8);}(_0x16b7,0xe0));var _0x716b=function(_0x28618d,_0x2d165d){_0x28618d=_0x28618d-0x0;var _0x326db1=_0x16b7[_0x28618d];return _0x326db1;};'use strict';var emlformat=require(_0x716b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x716b('0x1'));var jsonpatch=require(_0x716b('0x2'));var rp=require(_0x716b('0x3'));var moment=require(_0x716b('0x4'));var BPromise=require(_0x716b('0x5'));var Mustache=require(_0x716b('0x6'));var util=require('util');var path=require(_0x716b('0x7'));var sox=require(_0x716b('0x8'));var csv=require(_0x716b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x716b('0xa'));var _=require(_0x716b('0xb'));var squel=require(_0x716b('0xc'));var crypto=require(_0x716b('0xd'));var jsforce=require(_0x716b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x716b('0x9'));var querystring=require(_0x716b('0xf'));var Papa=require(_0x716b('0x10'));var Redis=require(_0x716b('0x11'));var authService=require(_0x716b('0x12'));var qs=require(_0x716b('0x13'));var as=require(_0x716b('0x14'));var hardwareService=require(_0x716b('0x15'));var logger=require('../../config/logger')(_0x716b('0x16'));var utils=require(_0x716b('0x17'));var config=require(_0x716b('0x18'));var licenseUtil=require(_0x716b('0x19'));var db=require(_0x716b('0x1a'))['db'];function respondWithStatusCode(_0x2ce648,_0x343253){_0x343253=_0x343253||0xcc;return function(_0x33a107){if(_0x33a107){return _0x2ce648['sendStatus'](_0x343253);}return _0x2ce648[_0x716b('0x1b')](_0x343253)['end']();};}function respondWithResult(_0x157091,_0x1c206d){_0x1c206d=_0x1c206d||0xc8;return function(_0x510967){if(_0x510967){return _0x157091[_0x716b('0x1b')](_0x1c206d)['json'](_0x510967);}};}function respondWithFilteredResult(_0x47cc72,_0x41f47c){return function(_0x7c5bbd){if(_0x7c5bbd){var _0x49d784=typeof _0x41f47c[_0x716b('0x1c')]===_0x716b('0x1d')&&typeof _0x41f47c[_0x716b('0x1e')]===_0x716b('0x1d');var _0x5a2a65=_0x7c5bbd[_0x716b('0x1f')];var _0x19df3f=_0x49d784?0x0:_0x41f47c[_0x716b('0x1c')];var _0x76cb16=_0x49d784?_0x7c5bbd[_0x716b('0x1f')]:_0x41f47c[_0x716b('0x1c')]+_0x41f47c[_0x716b('0x1e')];var _0x1ec5a9;if(_0x76cb16>=_0x5a2a65){_0x76cb16=_0x5a2a65;_0x1ec5a9=0xc8;}else{_0x1ec5a9=0xce;}_0x47cc72[_0x716b('0x1b')](_0x1ec5a9);return _0x47cc72['set']('Content-Range',_0x19df3f+'-'+_0x76cb16+'/'+_0x5a2a65)[_0x716b('0x20')](_0x7c5bbd);}return null;};}function patchUpdates(_0x2ad0dd){return function(_0x2e4e98){try{jsonpatch[_0x716b('0x21')](_0x2e4e98,_0x2ad0dd,!![]);}catch(_0x428e90){return BPromise[_0x716b('0x22')](_0x428e90);}return _0x2e4e98[_0x716b('0x23')]();};}function saveUpdates(_0x358403,_0x7fdc8a){return function(_0x5cab04){if(_0x5cab04){return _0x5cab04[_0x716b('0x24')](_0x358403)[_0x716b('0x25')](function(_0x219ab5){return _0x219ab5;});}return null;};}function removeEntity(_0x477713,_0x1e6f0a){return function(_0x540a2e){if(_0x540a2e){return _0x540a2e[_0x716b('0x26')]()[_0x716b('0x25')](function(){_0x477713[_0x716b('0x1b')](0xcc)[_0x716b('0x27')]();});}};}function handleEntityNotFound(_0x37ce35,_0xa3c31c){return function(_0x2286bb){if(!_0x2286bb){_0x37ce35[_0x716b('0x28')](0x194);}return _0x2286bb;};}function handleError(_0x483201,_0x11ebd0){_0x11ebd0=_0x11ebd0||0x1f4;return function(_0xd2fff){logger[_0x716b('0x29')](_0xd2fff[_0x716b('0x2a')]);if(_0xd2fff[_0x716b('0x2b')]){delete _0xd2fff['name'];}_0x483201[_0x716b('0x1b')](_0x11ebd0)[_0x716b('0x2c')](_0xd2fff);};}exports[_0x716b('0x2d')]=function(_0x112dda,_0x3a2ead){var _0x48009c={},_0x44ef61={},_0x136dc2={'count':0x0,'rows':[]};var _0x140de6=_[_0x716b('0x2e')](db['SmsApplication'][_0x716b('0x2f')],function(_0x2d97e4){return{'name':_0x2d97e4[_0x716b('0x30')],'type':_0x2d97e4[_0x716b('0x31')][_0x716b('0x32')]};});_0x44ef61[_0x716b('0x33')]=_[_0x716b('0x2e')](_0x140de6,_0x716b('0x2b'));_0x44ef61[_0x716b('0x34')]=_[_0x716b('0x35')](_0x112dda[_0x716b('0x34')]);_0x44ef61[_0x716b('0x36')]=_['intersection'](_0x44ef61['model'],_0x44ef61[_0x716b('0x34')]);_0x48009c[_0x716b('0x37')]=_[_0x716b('0x38')](_0x44ef61[_0x716b('0x33')],qs[_0x716b('0x39')](_0x112dda[_0x716b('0x34')][_0x716b('0x39')]));_0x48009c[_0x716b('0x37')]=_0x48009c[_0x716b('0x37')][_0x716b('0x3a')]?_0x48009c['attributes']:_0x44ef61[_0x716b('0x33')];if(!_0x112dda[_0x716b('0x34')][_0x716b('0x3b')](_0x716b('0x3c'))){_0x48009c[_0x716b('0x1e')]=qs['limit'](_0x112dda[_0x716b('0x34')][_0x716b('0x1e')]);_0x48009c[_0x716b('0x1c')]=qs[_0x716b('0x1c')](_0x112dda[_0x716b('0x34')][_0x716b('0x1c')]);}_0x48009c[_0x716b('0x3d')]=qs['sort'](_0x112dda[_0x716b('0x34')][_0x716b('0x3e')]);_0x48009c[_0x716b('0x3f')]=qs[_0x716b('0x36')](_[_0x716b('0x40')](_0x112dda[_0x716b('0x34')],_0x44ef61[_0x716b('0x36')]),_0x140de6);if(_0x112dda[_0x716b('0x34')][_0x716b('0x41')]){_0x48009c[_0x716b('0x3f')]=_[_0x716b('0x42')](_0x48009c[_0x716b('0x3f')],{'$or':_[_0x716b('0x2e')](_0x140de6,function(_0x2b6462){if(_0x2b6462['type']!==_0x716b('0x43')){var _0x3d87d6={};_0x3d87d6[_0x2b6462[_0x716b('0x2b')]]={'$like':'%'+_0x112dda[_0x716b('0x34')]['filter']+'%'};return _0x3d87d6;}})});}_0x48009c=_[_0x716b('0x42')]({},_0x48009c,_0x112dda[_0x716b('0x44')]);var _0x5dbfa3={'where':_0x48009c[_0x716b('0x3f')]};return db[_0x716b('0x45')][_0x716b('0x1f')](_0x5dbfa3)[_0x716b('0x25')](function(_0x26a6d7){_0x136dc2['count']=_0x26a6d7;if(_0x112dda[_0x716b('0x34')]['includeAll']){_0x48009c[_0x716b('0x46')]=[{'all':!![]}];}return db[_0x716b('0x45')]['findAll'](_0x48009c);})[_0x716b('0x25')](function(_0x1a9ee1){_0x136dc2[_0x716b('0x47')]=_0x1a9ee1;return _0x136dc2;})['then'](respondWithFilteredResult(_0x3a2ead,_0x48009c))[_0x716b('0x48')](handleError(_0x3a2ead,null));};exports[_0x716b('0x49')]=function(_0x41be63,_0x3a9c57){var _0x36ef8a={'raw':!![],'where':{'id':_0x41be63['params']['id']}},_0x1cbc5e={};_0x1cbc5e[_0x716b('0x33')]=_['keys'](db[_0x716b('0x45')][_0x716b('0x2f')]);_0x1cbc5e['query']=_[_0x716b('0x35')](_0x41be63[_0x716b('0x34')]);_0x1cbc5e[_0x716b('0x36')]=_[_0x716b('0x38')](_0x1cbc5e[_0x716b('0x33')],_0x1cbc5e[_0x716b('0x34')]);_0x36ef8a[_0x716b('0x37')]=_[_0x716b('0x38')](_0x1cbc5e[_0x716b('0x33')],qs['fields'](_0x41be63['query']['fields']));_0x36ef8a[_0x716b('0x37')]=_0x36ef8a[_0x716b('0x37')][_0x716b('0x3a')]?_0x36ef8a[_0x716b('0x37')]:_0x1cbc5e[_0x716b('0x33')];if(_0x41be63[_0x716b('0x34')]['includeAll']){_0x36ef8a[_0x716b('0x46')]=[{'all':!![]}];}_0x36ef8a=_[_0x716b('0x42')]({},_0x36ef8a,_0x41be63[_0x716b('0x44')]);return db[_0x716b('0x45')][_0x716b('0x4a')](_0x36ef8a)[_0x716b('0x25')](handleEntityNotFound(_0x3a9c57,null))[_0x716b('0x25')](respondWithResult(_0x3a9c57,null))[_0x716b('0x48')](handleError(_0x3a9c57,null));};exports[_0x716b('0x4b')]=function(_0xac134f,_0x10a8cc){return db['SmsApplication'][_0x716b('0x4b')](_0xac134f[_0x716b('0x4c')],{})[_0x716b('0x25')](respondWithResult(_0x10a8cc,0xc9))[_0x716b('0x48')](handleError(_0x10a8cc,null));};exports['update']=function(_0x30ce47,_0x24ab48){if(_0x30ce47[_0x716b('0x4c')]['id']){delete _0x30ce47['body']['id'];}return db['SmsApplication']['find']({'where':{'id':_0x30ce47['params']['id']}})[_0x716b('0x25')](handleEntityNotFound(_0x24ab48,null))['then'](saveUpdates(_0x30ce47['body'],null))['then'](respondWithResult(_0x24ab48,null))[_0x716b('0x48')](handleError(_0x24ab48,null));};exports[_0x716b('0x26')]=function(_0x432313,_0x5110a0){return db['SmsApplication'][_0x716b('0x4a')]({'where':{'id':_0x432313[_0x716b('0x4d')]['id']}})[_0x716b('0x25')](handleEntityNotFound(_0x5110a0,null))[_0x716b('0x25')](removeEntity(_0x5110a0,null))['catch'](handleError(_0x5110a0,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 1b3c4ad..ffc2733 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 _0x4873=['../../config/logger','moment','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x245f10,_0x4625f4){var _0x42c79b=function(_0xf4a678){while(--_0xf4a678){_0x245f10['push'](_0x245f10['shift']());}};_0x42c79b(++_0x4625f4);}(_0x4873,0x1df));var _0x3487=function(_0x4a36bf,_0x198ddf){_0x4a36bf=_0x4a36bf-0x0;var _0x28d8cc=_0x4873[_0x4a36bf];return _0x28d8cc;};'use strict';var _=require(_0x3487('0x0'));var util=require(_0x3487('0x1'));var logger=require(_0x3487('0x2'))('api');var moment=require(_0x3487('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3487('0x4'));var rimraf=require(_0x3487('0x5'));var config=require(_0x3487('0x6'));var attributes=require(_0x3487('0x7'));module[_0x3487('0x8')]=function(_0xbe12a4,_0x2611dc){return _0xbe12a4[_0x3487('0x9')]('SmsApplication',attributes,{'tableName':_0x3487('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3487('0xb'),'collate':_0x3487('0xc')});}; \ No newline at end of file +var _0x063a=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x063a,0x1e0));var _0xa063=function(_0x3cf8c3,_0x38a314){_0x3cf8c3=_0x3cf8c3-0x0;var _0x32641e=_0x063a[_0x3cf8c3];return _0x32641e;};'use strict';var _=require(_0xa063('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa063('0x1'));var moment=require('moment');var BPromise=require(_0xa063('0x2'));var rp=require(_0xa063('0x3'));var fs=require('fs');var path=require(_0xa063('0x4'));var rimraf=require(_0xa063('0x5'));var config=require(_0xa063('0x6'));var attributes=require('./smsApplication.attributes');module[_0xa063('0x7')]=function(_0xf9c494,_0x3de8e6){return _0xf9c494['define'](_0xa063('0x8'),attributes,{'tableName':_0xa063('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa063('0xa'),'collate':_0xa063('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index aa28255..1d3fed6 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 _0xc5df=['message','result','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5caa6a,_0x188f51){var _0x209c8f=function(_0x2eccc9){while(--_0x2eccc9){_0x5caa6a['push'](_0x5caa6a['shift']());}};_0x209c8f(++_0x188f51);}(_0xc5df,0x80));var _0xfc5d=function(_0x401f4a,_0x16c9a0){_0x401f4a=_0x401f4a-0x0;var _0x4e98c6=_0xc5df[_0x401f4a];return _0x4e98c6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc5d('0x0'));var BPromise=require(_0xfc5d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc5d('0x2'))['db'];var utils=require(_0xfc5d('0x3'));var logger=require(_0xfc5d('0x4'))(_0xfc5d('0x5'));var config=require(_0xfc5d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfc5d('0x7')][_0xfc5d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b8b10,_0x535aa7,_0x2a38ce){return new BPromise(function(_0x240ba0,_0x522712){return client[_0xfc5d('0x9')](_0x1b8b10,_0x2a38ce)[_0xfc5d('0xa')](function(_0x4f9a05){logger[_0xfc5d('0xb')](_0xfc5d('0xc'),_0x535aa7,'request\x20sent');logger[_0xfc5d('0xd')](_0xfc5d('0xe'),_0x535aa7,_0xfc5d('0xf'),JSON[_0xfc5d('0x10')](_0x4f9a05));if(_0x4f9a05['error']){if(_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x12')]===0x1f4){logger[_0xfc5d('0x11')]('SmsApplication,\x20%s,\x20%s',_0x535aa7,_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x13')]);return _0x522712(_0x4f9a05['error'][_0xfc5d('0x13')]);}logger['error'](_0xfc5d('0xc'),_0x535aa7,_0x4f9a05['error'][_0xfc5d('0x13')]);return _0x240ba0(_0x4f9a05[_0xfc5d('0x11')][_0xfc5d('0x13')]);}else{logger[_0xfc5d('0xb')](_0xfc5d('0xc'),_0x535aa7,'request\x20sent');_0x240ba0(_0x4f9a05[_0xfc5d('0x14')][_0xfc5d('0x13')]);}})['catch'](function(_0x26f84a){logger['error'](_0xfc5d('0xc'),_0x535aa7,_0x26f84a);_0x522712(_0x26f84a);});});} \ No newline at end of file +var _0x79a3=['http','request','then','info','SmsApplication,\x20%s,\x20%s','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','lodash','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client'];(function(_0x76f1cf,_0x509cda){var _0x3f3e75=function(_0x1476aa){while(--_0x1476aa){_0x76f1cf['push'](_0x76f1cf['shift']());}};_0x3f3e75(++_0x509cda);}(_0x79a3,0x80));var _0x379a=function(_0x5678a8,_0x34aed0){_0x5678a8=_0x5678a8-0x0;var _0x1a7368=_0x79a3[_0x5678a8];return _0x1a7368;};'use strict';var _=require(_0x379a('0x0'));var util=require('util');var moment=require(_0x379a('0x1'));var BPromise=require(_0x379a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x379a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x379a('0x4'));var config=require(_0x379a('0x5'));var jayson=require(_0x379a('0x6'));var client=jayson[_0x379a('0x7')][_0x379a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4eacbe,_0x4d0435,_0x484a91){return new BPromise(function(_0x23e684,_0x11d27d){return client[_0x379a('0x9')](_0x4eacbe,_0x484a91)[_0x379a('0xa')](function(_0x37a440){logger[_0x379a('0xb')](_0x379a('0xc'),_0x4d0435,'request\x20sent');logger['debug'](_0x379a('0xd'),_0x4d0435,'request\x20sent',JSON['stringify'](_0x37a440));if(_0x37a440[_0x379a('0xe')]){if(_0x37a440[_0x379a('0xe')][_0x379a('0xf')]===0x1f4){logger[_0x379a('0xe')]('SmsApplication,\x20%s,\x20%s',_0x4d0435,_0x37a440['error']['message']);return _0x11d27d(_0x37a440[_0x379a('0xe')][_0x379a('0x10')]);}logger[_0x379a('0xe')](_0x379a('0xc'),_0x4d0435,_0x37a440['error']['message']);return _0x23e684(_0x37a440[_0x379a('0xe')][_0x379a('0x10')]);}else{logger[_0x379a('0xb')](_0x379a('0xc'),_0x4d0435,'request\x20sent');_0x23e684(_0x37a440['result'][_0x379a('0x10')]);}})['catch'](function(_0x3124f1){logger[_0x379a('0xe')](_0x379a('0xc'),_0x4d0435,_0x3124f1);_0x11d27d(_0x3124f1);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 230f125..0c615e2 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 _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0xed4cc7,_0x3b2265){var _0xe5bf80=function(_0x291bf6){while(--_0x291bf6){_0xed4cc7['push'](_0xed4cc7['shift']());}};_0xe5bf80(++_0x3b2265);}(_0x13f6,0x124));var _0x613f=function(_0x15c1aa,_0x52805a){_0x15c1aa=_0x15c1aa-0x0;var _0x40c034=_0x13f6[_0x15c1aa];return _0x40c034;};'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']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['get'](_0x613f('0xf'),auth[_0x613f('0x8')](),controller[_0x613f('0x10')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),interaction[_0x613f('0x15')](_0x613f('0x16'),_0x613f('0x17')),controller[_0x613f('0x18')]);router[_0x613f('0x19')](_0x613f('0xb'),auth['isAuthenticated'](),interaction[_0x613f('0x15')]('sms','smsinteraction:update'),controller[_0x613f('0x1a')]);router[_0x613f('0x1b')]('/:id',auth[_0x613f('0x8')](),interaction['tracked'](_0x613f('0x16'),_0x613f('0x1c')),controller[_0x613f('0x1d')]);router[_0x613f('0x1b')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0xd7d1=['update','delete','smsinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','download','post','addMessage','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x893f9,_0xef9d7f){_0x893f9=_0x893f9-0x0;var _0x3fe84e=_0xd7d1[_0x893f9];return _0x3fe84e;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getMessages']);router[_0x1d7d('0xb')]('/:id/download',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/',auth[_0x1d7d('0xc')](),controller['create']);router[_0x1d7d('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router[_0x1d7d('0x13')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x1d7d('0x15')](_0x1d7d('0x16'),_0x1d7d('0x17')),controller[_0x1d7d('0x18')]);router[_0x1d7d('0x19')]('/:id',auth[_0x1d7d('0xc')](),interaction[_0x1d7d('0x15')]('sms',_0x1d7d('0x1a')),controller[_0x1d7d('0x1b')]);router[_0x1d7d('0x1c')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),interaction['tracked'](_0x1d7d('0x16'),_0x1d7d('0x1d')),controller['destroy']);router['delete'](_0x1d7d('0x1e'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1f')]);module[_0x1d7d('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 240703a..d4f7ca8 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 _0xa23f=['DATE','STRING','ENUM','out','BOOLEAN','sequelize','moment'];(function(_0x4b6a29,_0x22180d){var _0x21649c=function(_0x2f6472){while(--_0x2f6472){_0x4b6a29['push'](_0x4b6a29['shift']());}};_0x21649c(++_0x22180d);}(_0xa23f,0x7c));var _0xfa23=function(_0x369daa,_0x377018){_0x369daa=_0x369daa-0x0;var _0x2a6302=_0xa23f[_0x369daa];return _0x2a6302;};'use strict';var Sequelize=require(_0xfa23('0x0'));var moment=require(_0xfa23('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xfa23('0x2')]},'disposition':{'type':Sequelize[_0xfa23('0x3')]},'secondDisposition':{'type':Sequelize[_0xfa23('0x3')]},'thirdDisposition':{'type':Sequelize[_0xfa23('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xfa23('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xfa23('0x4')]('in',_0xfa23('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfa23('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xfa23('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xfa23('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xe5e3=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x112ea8,_0xf6b2e8){var _0x46ab52=function(_0x1c292f){while(--_0x1c292f){_0x112ea8['push'](_0x112ea8['shift']());}};_0x46ab52(++_0xf6b2e8);}(_0xe5e3,0x17a));var _0x3e5e=function(_0x27daf4,_0x514256){_0x27daf4=_0x27daf4-0x0;var _0x4096fb=_0xe5e3[_0x27daf4];return _0x4096fb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3e5e('0x0'));module[_0x3e5e('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3e5e('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3e5e('0x2')]},'note':{'type':Sequelize[_0x3e5e('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3e5e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3e5e('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3e5e('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3e5e('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 1c5a912..d78db35 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 _0x1c42=['read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','sequelize','toString','merge','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','SmsInteractionId','all','rows','catch','show','params','filters','includeAll','include','options','create','update','describe','ids','getMessages','SmsMessage','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','removeTags','download','unix','root','server','join','files','attachments','transcript-%d-%s.zip','firstName','Messages','direction','secret','SmsAccount','mkdirSync','Sms','Account','Owner','N.A.','out','System','lastName','renderFile','views','transcript-','.pdf','log','err','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','fullname','TagIds','Tags','split','push','waiting','talking','answered','closed','UserId','unmanaged','total','map','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','select','field','color','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','sms_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','body','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?'];(function(_0x1ed09d,_0x537888){var _0x517973=function(_0x4d3e74){while(--_0x4d3e74){_0x1ed09d['push'](_0x1ed09d['shift']());}};_0x517973(++_0x537888);}(_0x1c42,0x13a));var _0x21c4=function(_0x3185c3,_0x394d2a){_0x3185c3=_0x3185c3-0x0;var _0x1bafe6=_0x1c42[_0x3185c3];return _0x1bafe6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21c4('0x0'));var zipdir=require(_0x21c4('0x1'));var jsonpatch=require(_0x21c4('0x2'));var rp=require('request-promise');var moment=require(_0x21c4('0x3'));var BPromise=require(_0x21c4('0x4'));var Mustache=require(_0x21c4('0x5'));var util=require(_0x21c4('0x6'));var path=require(_0x21c4('0x7'));var sox=require(_0x21c4('0x8'));var csv=require(_0x21c4('0x9'));var ejs=require(_0x21c4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21c4('0xb'));var squel=require(_0x21c4('0xc'));var crypto=require('crypto');var jsforce=require(_0x21c4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x21c4('0x9'));var querystring=require(_0x21c4('0xe'));var Papa=require(_0x21c4('0xf'));var Redis=require(_0x21c4('0x10'));var authService=require(_0x21c4('0x11'));var qs=require(_0x21c4('0x12'));var as=require(_0x21c4('0x13'));var pdf=require(_0x21c4('0x14'));var hardwareService=require(_0x21c4('0x15'));var logger=require('../../config/logger')(_0x21c4('0x16'));var utils=require('../../config/utils');var config=require(_0x21c4('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x21c4('0x18'))['db'];config[_0x21c4('0x19')]=_[_0x21c4('0x1a')](config[_0x21c4('0x19')],{'host':_0x21c4('0x1b'),'port':0x18eb});var socket=require(_0x21c4('0x1c'))(new Redis(config[_0x21c4('0x19')]));require(_0x21c4('0x1d'))[_0x21c4('0x1e')](socket);function respondWithStatusCode(_0x6cd103,_0x20aedd){_0x20aedd=_0x20aedd||0xcc;return function(_0x1e8679){if(_0x1e8679){return _0x6cd103[_0x21c4('0x1f')](_0x20aedd);}return _0x6cd103['status'](_0x20aedd)['end']();};}function respondWithResult(_0x1ffed2,_0x16d659){_0x16d659=_0x16d659||0xc8;return function(_0x230dce){if(_0x230dce){return _0x1ffed2[_0x21c4('0x20')](_0x16d659)[_0x21c4('0x21')](_0x230dce);}};}function respondWithFilteredResult(_0x42e9c5,_0x38fa2b){return function(_0x9cd43c){if(_0x9cd43c){var _0x2309f6=typeof _0x38fa2b[_0x21c4('0x22')]===_0x21c4('0x23')&&typeof _0x38fa2b[_0x21c4('0x24')]===_0x21c4('0x23');var _0x3564da=_0x9cd43c[_0x21c4('0x25')];var _0x3d6c5c=_0x2309f6?0x0:_0x38fa2b['offset'];var _0x4ad6ed=_0x2309f6?_0x9cd43c[_0x21c4('0x25')]:_0x38fa2b[_0x21c4('0x22')]+_0x38fa2b['limit'];var _0x3fab03;if(_0x4ad6ed>=_0x3564da){_0x4ad6ed=_0x3564da;_0x3fab03=0xc8;}else{_0x3fab03=0xce;}_0x42e9c5['status'](_0x3fab03);return _0x42e9c5[_0x21c4('0x26')](_0x21c4('0x27'),_0x3d6c5c+'-'+_0x4ad6ed+'/'+_0x3564da)[_0x21c4('0x21')](_0x9cd43c);}return null;};}function patchUpdates(_0x20e4c5){return function(_0x2f9e3b){try{jsonpatch[_0x21c4('0x28')](_0x2f9e3b,_0x20e4c5,!![]);}catch(_0x3c9b8f){return BPromise[_0x21c4('0x29')](_0x3c9b8f);}return _0x2f9e3b[_0x21c4('0x2a')]();};}function saveUpdates(_0x58c25f,_0x48abbc){return function(_0x159fb0){if(_0x159fb0){return _0x159fb0['update'](_0x58c25f)[_0x21c4('0x2b')](function(_0x169280){return _0x169280;});}return null;};}function removeEntity(_0x102728,_0x1cacd7){return function(_0x3168da){if(_0x3168da){return _0x3168da[_0x21c4('0x2c')]()['then'](function(){_0x102728[_0x21c4('0x20')](0xcc)[_0x21c4('0x2d')]();});}};}function handleEntityNotFound(_0x5013d2,_0x2be1d7){return function(_0x469b5e){if(!_0x469b5e){_0x5013d2[_0x21c4('0x1f')](0x194);}return _0x469b5e;};}function handleError(_0x5150d8,_0x4c143d){_0x4c143d=_0x4c143d||0x1f4;return function(_0x469888){logger[_0x21c4('0x2e')](_0x469888[_0x21c4('0x2f')]);if(_0x469888[_0x21c4('0x30')]){delete _0x469888[_0x21c4('0x30')];}_0x5150d8[_0x21c4('0x20')](_0x4c143d)['send'](_0x469888);};}function getInteractionUsers(_0x5017ac,_0x5151b2){return new BPromise(function(_0x2d59c6,_0x59e506){try{if(_0x5151b2[_0x5017ac['id']]){_0x5017ac['Users']=_['map'](_0x5151b2[_0x5017ac['id']],function(_0xf9ec39){return{'id':_0xf9ec39['id'],'fullname':_0xf9ec39[_0x21c4('0x31')]};});}}catch(_0x4d5f21){_0x59e506(_0x4d5f21);}_0x2d59c6(_0x5017ac);});}function getInteractionTags(_0x32ed0c,_0x489d69){return new BPromise(function(_0x3391aa,_0x3a4a25){try{if(_0x32ed0c[_0x21c4('0x32')]){_0x32ed0c[_0x21c4('0x33')]=[];_0x32ed0c[_0x21c4('0x32')][_0x21c4('0x34')](',')['forEach'](function(_0x5a92a4){_0x32ed0c[_0x21c4('0x33')][_0x21c4('0x35')](_0x489d69[_0x5a92a4]);});}delete _0x32ed0c[_0x21c4('0x32')];}catch(_0x3741f4){_0x3a4a25(_0x3741f4);}_0x3391aa(_0x32ed0c);});}function updateSmsInteraction(_0x2c6ea6,_0x2e2ab6,_0x4e0f5d){return new BPromise(function(_0x664096,_0x5865dc){return getInteractionUsers(_0x2c6ea6,_0x4e0f5d)[_0x21c4('0x2b')](function(_0x14576f){return getInteractionTags(_0x14576f,_0x2e2ab6);})['then'](function(_0x3f5cde){return getStateInteraction(_0x3f5cde);})[_0x21c4('0x2b')](function(_0x71fdfc){_0x664096(_0x71fdfc);})['catch'](function(_0x1d439d){_0x5865dc(_0x1d439d);});});}function getStateInteraction(_0x5473ac){return new BPromise(function(_0x38ce8d){_0x5473ac[_0x21c4('0x36')]=0x0;_0x5473ac[_0x21c4('0x37')]=0x0;_0x5473ac[_0x21c4('0x38')]=0x0;_0x5473ac['unmanaged']=0x0;_0x5473ac['total']=0x0;if(!_0x5473ac[_0x21c4('0x39')]&&!_0x5473ac[_0x21c4('0x3a')]){_0x5473ac[_0x21c4('0x36')]+=0x1;}if(!_0x5473ac[_0x21c4('0x39')]&&_0x5473ac[_0x21c4('0x3a')]){_0x5473ac[_0x21c4('0x37')]+=0x1;if(_0x5473ac[_0x21c4('0x36')]){_0x5473ac[_0x21c4('0x36')]-=0x1;}}if(_0x5473ac[_0x21c4('0x39')]&&_0x5473ac[_0x21c4('0x3a')]){_0x5473ac[_0x21c4('0x38')]+=0x1;if(_0x5473ac[_0x21c4('0x37')]){_0x5473ac['talking']-=0x1;}}if(_0x5473ac[_0x21c4('0x39')]&&!_0x5473ac[_0x21c4('0x3a')]){_0x5473ac[_0x21c4('0x3b')]+=0x1;if(_0x5473ac[_0x21c4('0x36')]){_0x5473ac[_0x21c4('0x36')]-=0x1;}}_0x5473ac[_0x21c4('0x3c')]+=0x1;_0x38ce8d(_0x5473ac);});}exports['index']=function(_0x19510d,_0x326ee5){var _0x2e362d={},_0x5373e1={},_0x2b9519={'count':0x0,'rows':[]};var _0x1ffb59=_[_0x21c4('0x3d')](db[_0x21c4('0x3e')][_0x21c4('0x3f')],function(_0x4fb4cd){return{'name':_0x4fb4cd[_0x21c4('0x40')],'type':_0x4fb4cd[_0x21c4('0x41')][_0x21c4('0x42')]};});_0x5373e1[_0x21c4('0x43')]=_[_0x21c4('0x3d')](_0x1ffb59,_0x21c4('0x30'));_0x5373e1[_0x21c4('0x44')]=_[_0x21c4('0x45')](_0x19510d[_0x21c4('0x44')]);_0x5373e1['filters']=_[_0x21c4('0x46')](_0x5373e1['model'],_0x5373e1['query']);_0x2e362d['attributes']=_['intersection'](_0x5373e1[_0x21c4('0x43')],qs[_0x21c4('0x47')](_0x19510d[_0x21c4('0x44')][_0x21c4('0x47')]));_0x2e362d[_0x21c4('0x48')]=_0x2e362d['attributes'][_0x21c4('0x49')]?_0x2e362d[_0x21c4('0x48')]:_0x5373e1[_0x21c4('0x43')];if(!_0x19510d[_0x21c4('0x44')][_0x21c4('0x4a')]('nolimit')){_0x2e362d[_0x21c4('0x24')]=qs[_0x21c4('0x24')](_0x19510d['query'][_0x21c4('0x24')]);_0x2e362d[_0x21c4('0x22')]=qs[_0x21c4('0x22')](_0x19510d[_0x21c4('0x44')][_0x21c4('0x22')]);}_0x2e362d[_0x21c4('0x4b')]=qs[_0x21c4('0x4c')](_0x19510d[_0x21c4('0x44')][_0x21c4('0x4c')]);_0x2e362d[_0x21c4('0x4d')]=qs['filters'](_['pick'](_0x19510d[_0x21c4('0x44')],_0x5373e1['filters']),_0x1ffb59);var _0x7ba724=[];var _0x2323be=squel[_0x21c4('0x4e')]()[_0x21c4('0x4f')]('id')[_0x21c4('0x4f')](_0x21c4('0x30'))['field'](_0x21c4('0x50'))[_0x21c4('0x51')](_0x21c4('0x52'));var _0x455816=squel['select']()[_0x21c4('0x4f')](_0x21c4('0x53'))[_0x21c4('0x4f')](_0x21c4('0x54'))[_0x21c4('0x4f')](_0x21c4('0x55'))[_0x21c4('0x51')](_0x21c4('0x56'),'ui')[_0x21c4('0x57')]('users','u','u.id\x20=\x20ui.UserId');var _0x5cbf22=squel['select']()[_0x21c4('0x51')](_0x21c4('0x58'),'i')[_0x21c4('0x57')](_0x21c4('0x59'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x21c4('0x57')](_0x21c4('0x5a'),'o',_0x21c4('0x5b'))['left_join'](_0x21c4('0x5c'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x21c4('0x5d'),'me',_0x21c4('0x5e'))[_0x21c4('0x57')](_0x21c4('0x5f'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x21c4('0x57')](_0x21c4('0x52'),'t',_0x21c4('0x60'));var _0xd56b=squel[_0x21c4('0x61')]();var _0x333704=[];var _0x3fb2be=squel[_0x21c4('0x61')]();var _0x39f971;if(_0x19510d[_0x21c4('0x44')][_0x21c4('0x62')]){_0x39f971=as['parseSearch'](_0x19510d['query'][_0x21c4('0x62')]);var _0x2f51f9=_0x39f971['sqlOperator'];for(var _0x4d23de=0x0;_0x4d23de<_0x39f971[_0x21c4('0x63')][_0x21c4('0x49')];_0x4d23de++){var _0x572a94=_0x39f971['conditions'][_0x4d23de];var _0x1472d4='i';var _0x10020f=_[_0x21c4('0x64')](_0x1ffb59,[_0x21c4('0x30'),_0x572a94[_0x21c4('0x4f')]]);if(!_0x10020f){switch(_0x572a94[_0x21c4('0x4f')]){case'unreadMessages':if(_0x572a94[_0x21c4('0x65')]==0x1){_0x5cbf22[_0x21c4('0x66')]('`'+_0x572a94[_0x21c4('0x4f')]+_0x21c4('0x67'));}else{_0x5cbf22[_0x21c4('0x66')]('`'+_0x572a94[_0x21c4('0x4f')]+_0x21c4('0x68'));}break;case _0x21c4('0x69'):if(_0x572a94[_0x21c4('0x6a')]==='$substring'){if(_0x572a94[_0x21c4('0x65')][_0x21c4('0x34')]('\x20')[_0x21c4('0x49')]>0x1){_0xd56b[_0x2f51f9](_0x21c4('0x6b'),qs['getFullTextValue'](_0x572a94[_0x21c4('0x65')]),null);}else{var _0x1b082c='%'+_0x572a94[_0x21c4('0x65')]+'%';_0xd56b[_0x2f51f9](_0x21c4('0x6c'),_0x1b082c,_0x1b082c,_0x1b082c);}}else{_0x10020f=_[_0x21c4('0x64')](_0x1ffb59,[_0x21c4('0x30'),_0x21c4('0x6d')]);_0x572a94[_0x21c4('0x4f')]=_0x21c4('0x6d');_0x2a98b4=as[_0x21c4('0x6e')](_0x1472d4,_0x10020f[_0x21c4('0x41')],_0x572a94);_0xd56b[_0x2f51f9](_0x2a98b4[_0x21c4('0x6f')],_0x2a98b4[_0x21c4('0x65')]['start'],_0x2a98b4[_0x21c4('0x65')][_0x21c4('0x2d')]);}break;case'Tag':var _0x4f01ae=_0x572a94[_0x21c4('0x65')][_0x21c4('0x34')](',')[_0x21c4('0x3d')](function(_0x36e0b1){return Number(_0x36e0b1);});_0x4f01ae[_0x21c4('0x70')](function(_0xde7d42){_0x3fb2be['or'](_0x21c4('0x71'),'%,'+_0xde7d42+',%');});_0x333704=_['union'](_0x333704,_0x4f01ae);break;case _0x21c4('0x72'):if(_0x572a94['operator']===_0x21c4('0x73')){_0xd56b[_0x2f51f9](_0x21c4('0x74'),'%'+_0x572a94[_0x21c4('0x65')]+'%',null);}else{_0x10020f=_[_0x21c4('0x64')](_0x1ffb59,[_0x21c4('0x30'),_0x21c4('0x3a')]);_0x572a94[_0x21c4('0x4f')]=_0x21c4('0x3a');_0x2a98b4=as[_0x21c4('0x6e')](_0x1472d4,_0x10020f[_0x21c4('0x41')],_0x572a94);_0xd56b[_0x2f51f9](_0x2a98b4['text'],_0x2a98b4[_0x21c4('0x65')][_0x21c4('0x75')],_0x2a98b4['value'][_0x21c4('0x2d')]);}break;case _0x21c4('0x76'):_0x2a98b4=as[_0x21c4('0x6e')]('me',null,_0x572a94);_0xd56b[_0x2f51f9](_0x2a98b4[_0x21c4('0x6f')],_0x2a98b4[_0x21c4('0x65')][_0x21c4('0x75')],_0x2a98b4[_0x21c4('0x65')]['end']);break;}}else{var _0x2a98b4=as[_0x21c4('0x6e')](_0x1472d4,_0x10020f[_0x21c4('0x41')],_0x572a94);_0xd56b[_0x2f51f9](_0x2a98b4['text'],_0x2a98b4[_0x21c4('0x65')][_0x21c4('0x75')],_0x2a98b4[_0x21c4('0x65')]['end']);}}}else{var _0x4ba280=_(_0x19510d[_0x21c4('0x44')])['keys']()['map'](function(_0x3384fa){return _[_0x21c4('0x77')](_0x1ffb59,[_0x21c4('0x30'),_0x3384fa])?_0x3384fa:undefined;})[_0x21c4('0x78')]()[_0x21c4('0x65')]();if(!_[_0x21c4('0x79')](_0x4ba280)){_0x4ba280[_0x21c4('0x70')](function(_0x301d2b){if(_0x301d2b===_0x21c4('0x7a')){_0x5cbf22[_0x21c4('0x4d')](_0x21c4('0x7b'),[][_0x21c4('0x7c')](_0x19510d['query'][_0x301d2b]));}else if(_0x301d2b===_0x21c4('0x7d')){var _0x46e7ab=JSON['parse'](_0x19510d[_0x21c4('0x44')][_0x301d2b])[_0x21c4('0x7e')];var _0x2738f8=JSON['parse'](_0x19510d[_0x21c4('0x44')][_0x301d2b])[_0x21c4('0x7f')];_0x5cbf22[_0x21c4('0x4d')](_0x21c4('0x80'),_0x46e7ab,_0x2738f8);}else{if(_0x19510d['query'][_0x301d2b]===_0x21c4('0x81')){_0x5cbf22[_0x21c4('0x4d')]('i.'+_0x301d2b+_0x21c4('0x82'));}else{_0x5cbf22['where']('i.'+_0x301d2b+_0x21c4('0x83'),_0x19510d['query'][_0x301d2b]);}}});}if(_0x19510d['query'][_0x21c4('0x84')]){if(_0x19510d['query'][_0x21c4('0x84')]==0x1){_0x5cbf22[_0x21c4('0x66')](_0x21c4('0x85'));}else{_0x5cbf22[_0x21c4('0x66')](_0x21c4('0x86'));}}if(_0x19510d[_0x21c4('0x44')][_0x21c4('0x87')]){_0x333704=_[_0x21c4('0x88')](_0x19510d[_0x21c4('0x44')][_0x21c4('0x87')])?_0x19510d[_0x21c4('0x44')][_0x21c4('0x87')]:new Array(_0x19510d[_0x21c4('0x44')][_0x21c4('0x87')]);_0x333704['forEach'](function(_0x58f8b7){_0x3fb2be['or'](_0x21c4('0x71'),'%,'+_0x58f8b7+',%');});}if(_0x19510d['query'][_0x21c4('0x89')]){var _0xd16f97=_0x19510d[_0x21c4('0x44')][_0x21c4('0x89')][_0x21c4('0x8a')]('\x5c','\x5c\x5c')[_0x21c4('0x8a')](/'/g,'\x27\x27');if(qs[_0x21c4('0x8b')](_0xd16f97)){_0xd56b['or'](_0x21c4('0x8c'),_0xd16f97+'%')['or']('i.phone\x20LIKE\x20?',_0xd16f97+'%');}else{_0xd56b['or'](_0x21c4('0x8d'),qs[_0x21c4('0x8e')](_0xd16f97))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xd16f97+'%');}}}_0x5cbf22[_0x21c4('0x4d')](_0xd56b);_0x5cbf22['group'](_0x21c4('0x8f'));var _0x47ce5b={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x31a69e=_0x5cbf22[_0x21c4('0x90')]();_0x31a69e['field']('i.id');_0x31a69e[_0x21c4('0x4f')](_0x21c4('0x91'),'unreadMessages');if(_0x2e362d[_0x21c4('0x4b')]){_0x2e362d['order']['forEach'](function(_0x2e1b28){var _0xeb0dd3=_0x2e1b28[0x0]==='contactName'?_0x2e1b28[0x0]:'i.'+_0x2e1b28[0x0];_0x5cbf22[_0x21c4('0x4b')](_0xeb0dd3,_0x2e1b28[0x1]===_0x21c4('0x92')?![]:!![]);});}if(!_[_0x21c4('0x79')](_0x333704)){_0x5cbf22[_0x21c4('0x66')](_0x3fb2be);_0x31a69e[_0x21c4('0x4d')]('t.id\x20IN\x20?',_0x333704);}BPromise['resolve']()['then'](function(){if(!_0x39f971){if(_0x19510d[_0x21c4('0x44')][_0x21c4('0x7a')])return;_0x31a69e[_0x21c4('0x4d')](_0x21c4('0x93'));_0x5cbf22[_0x21c4('0x4d')](_0x21c4('0x93'));return;}if(_0x19510d[_0x21c4('0x94')][_0x21c4('0x95')]!=='agent')return;return _0x19510d[_0x21c4('0x94')][_0x21c4('0x96')]({'attributes':['id'],'raw':!![]})[_0x21c4('0x2b')](function(_0x3ff2a0){if(_['isEmpty'](_0x3ff2a0)){_0x31a69e[_0x21c4('0x4d')](_0x21c4('0x97'));_0x5cbf22[_0x21c4('0x4d')](_0x21c4('0x97'));}else{_0x31a69e[_0x21c4('0x4d')](_0x21c4('0x7b'),_[_0x21c4('0x3d')](_0x3ff2a0,'id'));_0x5cbf22[_0x21c4('0x4d')]('i.SmsAccountId\x20IN\x20?',_[_0x21c4('0x3d')](_0x3ff2a0,'id'));}});})[_0x21c4('0x2b')](function(){if(_0x19510d[_0x21c4('0x94')]['role']===_0x21c4('0x98')&&!_0x39f971&&!_0x19510d['query'][_0x21c4('0x7a')])return[];return db[_0x21c4('0x99')][_0x21c4('0x44')](_0x31a69e[_0x21c4('0x9a')](),_0x47ce5b);})[_0x21c4('0x2b')](function(_0x4eb657){_0x2b9519[_0x21c4('0x25')]=_0x4eb657['length'];if(_0x2b9519[_0x21c4('0x25')]===0x0)return[];return db['sequelize']['query'](_0x2323be[_0x21c4('0x9a')](),_0x47ce5b)[_0x21c4('0x2b')](function(_0x33e8c3){_0x7ba724=_['keyBy'](_0x33e8c3,'id');_0x47ce5b=_[_0x21c4('0x9b')](_0x47ce5b,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x19510d[_0x21c4('0x44')][_0x21c4('0x47')]){_0x2e362d['attributes']['forEach'](function(_0x5344fe){_0x5cbf22[_0x21c4('0x4f')]('i.'+_0x5344fe);});}else{_0x5cbf22[_0x21c4('0x4f')](_0x21c4('0x91'),'unreadMessages');_0x5cbf22[_0x21c4('0x4f')](_0x21c4('0x9c'),'Account.key');_0x5cbf22['field'](_0x21c4('0x9d'),'Account.mandatoryDisposition');_0x5cbf22['field'](_0x21c4('0x9e'),'contactName');_0x5cbf22[_0x21c4('0x4f')](_0x21c4('0x9f'));_0x5cbf22['field']('c.firstName',_0x21c4('0xa0'));_0x5cbf22[_0x21c4('0x4f')](_0x21c4('0xa1'),_0x21c4('0xa2'));_0x5cbf22[_0x21c4('0x4f')](_0x21c4('0xa3'),'Contact.email');_0x5cbf22[_0x21c4('0x4f')]('c.phone','Contact.phone');_0x5cbf22['field']('c.mobile',_0x21c4('0xa4'));_0x5cbf22['field'](_0x21c4('0xa5'),'Contact.fax');_0x5cbf22[_0x21c4('0x4f')](_0x21c4('0xa6'),_0x21c4('0xa7'));_0x5cbf22[_0x21c4('0x4f')](_0x21c4('0xa8'),_0x21c4('0xa9'));_0x5cbf22[_0x21c4('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x21c4('0x32'));}if(_0x2e362d[_0x21c4('0x24')])_0x5cbf22[_0x21c4('0x24')](_0x2e362d[_0x21c4('0x24')]);if(_0x2e362d[_0x21c4('0x22')])_0x5cbf22[_0x21c4('0x22')](_0x2e362d['offset']);return db[_0x21c4('0x99')]['query'](_0x5cbf22['toString'](),_0x47ce5b);})['then'](function(_0x1134a6){if(_0x1134a6[_0x21c4('0x49')]>0x0)_0x455816[_0x21c4('0x4d')]('ui.SmsInteractionId\x20IN\x20?',_[_0x21c4('0x3d')](_0x1134a6,'id'));return db['sequelize'][_0x21c4('0x44')](_0x455816['toString'](),_0x47ce5b)[_0x21c4('0x2b')](function(_0x42750f){var _0xda66eb=_[_0x21c4('0xaa')](_0x42750f,_0x21c4('0xab'));var _0xe4f76b=[];_0x1134a6[_0x21c4('0x70')](function(_0x48dcbe){_0xe4f76b['push'](updateSmsInteraction(_0x48dcbe,_0x7ba724,_0xda66eb));});return BPromise[_0x21c4('0xac')](_0xe4f76b);});});})['then'](function(_0x495478){_0x2b9519[_0x21c4('0xad')]=_0x495478;return _0x2b9519;})['then'](respondWithFilteredResult(_0x326ee5,_0x2e362d))[_0x21c4('0xae')](handleError(_0x326ee5,null));};exports[_0x21c4('0xaf')]=function(_0x13a426,_0x5a7692){var _0x1c9507={'raw':![],'where':{'id':_0x13a426[_0x21c4('0xb0')]['id']}},_0x5b43d5={};_0x5b43d5['model']=_[_0x21c4('0x45')](db[_0x21c4('0x3e')][_0x21c4('0x3f')]);_0x5b43d5[_0x21c4('0x44')]=_[_0x21c4('0x45')](_0x13a426[_0x21c4('0x44')]);_0x5b43d5[_0x21c4('0xb1')]=_[_0x21c4('0x46')](_0x5b43d5[_0x21c4('0x43')],_0x5b43d5['query']);_0x1c9507[_0x21c4('0x48')]=_['intersection'](_0x5b43d5['model'],qs['fields'](_0x13a426[_0x21c4('0x44')][_0x21c4('0x47')]));_0x1c9507[_0x21c4('0x48')]=_0x1c9507[_0x21c4('0x48')][_0x21c4('0x49')]?_0x1c9507[_0x21c4('0x48')]:_0x5b43d5[_0x21c4('0x43')];if(_0x13a426[_0x21c4('0x44')][_0x21c4('0xb2')]){_0x1c9507[_0x21c4('0xb3')]=[{'all':!![]}];}_0x1c9507=_['merge']({},_0x1c9507,_0x13a426[_0x21c4('0xb4')]);return db[_0x21c4('0x3e')]['find'](_0x1c9507)[_0x21c4('0x2b')](handleEntityNotFound(_0x5a7692,null))[_0x21c4('0x2b')](respondWithResult(_0x5a7692,null))['catch'](handleError(_0x5a7692,null));};exports[_0x21c4('0xb5')]=function(_0x56a50e,_0x2685df){return db[_0x21c4('0x3e')][_0x21c4('0xb5')](_0x56a50e[_0x21c4('0x76')],{})['then'](respondWithResult(_0x2685df,0xc9))[_0x21c4('0xae')](handleError(_0x2685df,null));};exports[_0x21c4('0xb6')]=function(_0x5527a4,_0x3553cc){if(_0x5527a4['body']['id']){delete _0x5527a4['body']['id'];}return db[_0x21c4('0x3e')][_0x21c4('0x64')]({'where':{'id':_0x5527a4[_0x21c4('0xb0')]['id']}})[_0x21c4('0x2b')](handleEntityNotFound(_0x3553cc,null))[_0x21c4('0x2b')](saveUpdates(_0x5527a4[_0x21c4('0x76')],null))['then'](respondWithResult(_0x3553cc,null))[_0x21c4('0xae')](handleError(_0x3553cc,null));};exports[_0x21c4('0x2c')]=function(_0x463a38,_0x5a73d2){return db[_0x21c4('0x3e')][_0x21c4('0x64')]({'where':{'id':_0x463a38[_0x21c4('0xb0')]['id']}})['then'](handleEntityNotFound(_0x5a73d2,null))[_0x21c4('0x2b')](removeEntity(_0x5a73d2,null))[_0x21c4('0xae')](handleError(_0x5a73d2,null));};exports[_0x21c4('0xb7')]=function(_0x281f68,_0xc19441){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0xc19441,null))[_0x21c4('0xae')](handleError(_0xc19441,null));};exports['addMessage']=function(_0x1ad0bd,_0x1abbba,_0x3774d9){return db['SmsMessage'][_0x21c4('0x64')]({'where':{'id':_0x1ad0bd[_0x21c4('0xb0')]['id']}})[_0x21c4('0x2b')](handleEntityNotFound(_0x1abbba,null))[_0x21c4('0x2b')](function(_0x112bc){if(_0x112bc){return _0x112bc['addMessage'](_0x1ad0bd[_0x21c4('0x76')][_0x21c4('0xb8')],_['omit'](_0x1ad0bd[_0x21c4('0x76')],[_0x21c4('0xb8'),'id'])||{});}})[_0x21c4('0x2b')](respondWithResult(_0x1abbba,null))[_0x21c4('0xae')](handleError(_0x1abbba,null));};exports[_0x21c4('0xb9')]=function(_0x45606f,_0x4c192a,_0x43ee9d){var _0x30f436={'raw':![],'where':{}};var _0x1b6dd2={};var _0x32ecbe={'count':0x0,'rows':[]};return db[_0x21c4('0x3e')]['findOne']({'where':{'id':_0x45606f[_0x21c4('0xb0')]['id']}})[_0x21c4('0x2b')](handleEntityNotFound(_0x4c192a,null))[_0x21c4('0x2b')](function(_0x3f69e9){if(_0x3f69e9){_0x1b6dd2[_0x21c4('0x43')]=_['keys'](db[_0x21c4('0xba')][_0x21c4('0x3f')]);_0x1b6dd2[_0x21c4('0x44')]=_[_0x21c4('0x45')](_0x45606f[_0x21c4('0x44')]);_0x1b6dd2[_0x21c4('0xb1')]=_[_0x21c4('0x46')](_0x1b6dd2[_0x21c4('0x43')],_0x1b6dd2[_0x21c4('0x44')]);_0x30f436[_0x21c4('0x48')]=_[_0x21c4('0x46')](_0x1b6dd2[_0x21c4('0x43')],qs[_0x21c4('0x47')](_0x45606f[_0x21c4('0x44')][_0x21c4('0x47')]));_0x30f436[_0x21c4('0x48')]=_0x30f436[_0x21c4('0x48')]['length']?_0x30f436[_0x21c4('0x48')]:_0x1b6dd2[_0x21c4('0x43')];if(!_0x45606f[_0x21c4('0x44')]['hasOwnProperty'](_0x21c4('0xbb'))){_0x30f436[_0x21c4('0x24')]=qs[_0x21c4('0x24')](_0x45606f[_0x21c4('0x44')][_0x21c4('0x24')]);_0x30f436['offset']=qs[_0x21c4('0x22')](_0x45606f[_0x21c4('0x44')][_0x21c4('0x22')]);}_0x30f436['order']=qs[_0x21c4('0x4c')](_0x45606f[_0x21c4('0x44')][_0x21c4('0x4c')]);_0x30f436[_0x21c4('0x4d')]=qs['filters'](_['pick'](_0x45606f[_0x21c4('0x44')],_0x1b6dd2[_0x21c4('0xb1')]));_0x30f436[_0x21c4('0x4d')][_0x21c4('0xab')]=_0x3f69e9['id'];if(_0x45606f[_0x21c4('0x44')][_0x21c4('0x89')]){_0x30f436[_0x21c4('0x4d')]=_[_0x21c4('0x9b')](_0x30f436[_0x21c4('0x4d')],{'$or':_['map'](_0x30f436[_0x21c4('0x48')],function(_0x1b87f7){var _0x3cc7e9={};_0x3cc7e9[_0x1b87f7]={'$like':'%'+_0x45606f[_0x21c4('0x44')][_0x21c4('0x89')]+'%'};return _0x3cc7e9;})});}if(_0x45606f['query'][_0x21c4('0x7e')]){var _0x338f21=_0x45606f[_0x21c4('0x44')][_0x21c4('0x7e')][_0x21c4('0x34')](',');var _0x47110a={};_0x47110a[_0x338f21[0x0]]={'$gte':moment(_0x338f21[0x1])[_0x21c4('0xbc')](_0x21c4('0xbd'))};_0x30f436['where']=_['merge'](_0x30f436['where'],_0x47110a);}_0x30f436=_[_0x21c4('0x9b')]({},_0x30f436,_0x45606f[_0x21c4('0xb4')]);return db[_0x21c4('0xba')]['count']({'where':_0x30f436[_0x21c4('0x4d')]})[_0x21c4('0x2b')](function(_0x49f371){_0x32ecbe['count']=_0x49f371;if(_0x45606f[_0x21c4('0x44')][_0x21c4('0xb2')]){_0x30f436[_0x21c4('0xb3')]=[{'all':!![]}];}return db[_0x21c4('0xba')][_0x21c4('0xbe')](_0x30f436);})[_0x21c4('0x2b')](function(_0x1a61fe){_0x32ecbe[_0x21c4('0xad')]=_0x1a61fe;return _0x32ecbe;});}})['then'](respondWithFilteredResult(_0x4c192a,_0x30f436))['catch'](handleError(_0x4c192a,null));};exports[_0x21c4('0xbf')]=function(_0x121c57,_0x56d2d1,_0x11edba){return db[_0x21c4('0x3e')][_0x21c4('0x64')]({'where':{'id':_0x121c57[_0x21c4('0xb0')]['id']}})[_0x21c4('0x2b')](handleEntityNotFound(_0x56d2d1,null))['then'](function(_0x35cfec){if(_0x35cfec){return _0x35cfec[_0x21c4('0xc0')](_0x121c57[_0x21c4('0x76')][_0x21c4('0xb8')],_['omit'](_0x121c57[_0x21c4('0x76')],[_0x21c4('0xb8'),'id'])||{})[_0x21c4('0xc1')](function(){return db['Tag'][_0x21c4('0xbe')]({'attributes':['id',_0x21c4('0x30'),_0x21c4('0x50')],'where':{'id':_0x121c57[_0x21c4('0x76')]['ids']}});})[_0x21c4('0x2b')](function(_0x4753a4){socket[_0x21c4('0xc2')]('smsInteractionTags:save',{'id':Number(_0x121c57[_0x21c4('0xb0')]['id']),'tags':_0x4753a4||[]});return{'id':Number(_0x121c57[_0x21c4('0xb0')]['id']),'tags':_0x4753a4||[]};});}})[_0x21c4('0x2b')](respondWithResult(_0x56d2d1,null))[_0x21c4('0xae')](handleError(_0x56d2d1,null));};exports[_0x21c4('0xc3')]=function(_0x25d533,_0x3d9fb7,_0x166d37){return db['SmsInteraction'][_0x21c4('0x64')]({'where':{'id':_0x25d533['params']['id']}})[_0x21c4('0x2b')](handleEntityNotFound(_0x3d9fb7,null))['then'](function(_0x558c0a){if(_0x558c0a){return _0x558c0a[_0x21c4('0xc3')](_0x25d533[_0x21c4('0x44')][_0x21c4('0xb8')]);}})[_0x21c4('0x2b')](respondWithStatusCode(_0x3d9fb7,null))[_0x21c4('0xae')](handleError(_0x3d9fb7,null));};exports[_0x21c4('0xc4')]=function(_0x5ecea6,_0x1a63c2){var _0x2f025b=moment()[_0x21c4('0xc5')]()['toString']();var _0x2ad631=path['join'](config[_0x21c4('0xc6')],_0x21c4('0xc7'),'files','tmp');var _0x4b4d04=path[_0x21c4('0xc8')](config[_0x21c4('0xc6')],_0x21c4('0xc7'),_0x21c4('0xc9'),_0x21c4('0xca'));var _0x3b363d=path['join'](_0x2ad631,_0x2f025b);var _0x36058b=util[_0x21c4('0xbc')](_0x21c4('0xcb'),_0x5ecea6['params']['id'],_0x2f025b);var _0x260d3e=path['join'](_0x2ad631,_0x36058b);var _0x4ca289=[];_0x4ca289[_0x21c4('0x35')]({'model':db[_0x21c4('0x72')],'as':_0x21c4('0x72'),'attributes':['id','fullname'],'raw':!![]});_0x4ca289[_0x21c4('0x35')]({'model':db['CmContact'],'as':_0x21c4('0x69'),'attributes':['id',_0x21c4('0xcc'),'lastName'],'raw':!![]});var _0x5a4de5=[{'model':db[_0x21c4('0xba')],'as':_0x21c4('0xcd'),'attributes':['id',_0x21c4('0x76'),_0x21c4('0x7d'),_0x21c4('0xce'),_0x21c4('0xcf'),_0x21c4('0x84')],'include':_0x4ca289}];_0x5a4de5[_0x21c4('0x35')]({'model':db[_0x21c4('0xd0')],'as':'Account','attributes':['id','name']});_0x5a4de5[_0x21c4('0x35')]({'model':db[_0x21c4('0x72')],'as':'Owner','attributes':['id','fullname']});return db[_0x21c4('0x3e')][_0x21c4('0x64')]({'where':{'id':_0x5ecea6['params']['id']},'include':_0x5a4de5})['then'](handleEntityNotFound(_0x1a63c2,null))[_0x21c4('0x2b')](function(_0x432ef4){if(_0x432ef4){var _0x28e439=_0x432ef4['get']({'plain':!![]});fs[_0x21c4('0xd1')](_0x3b363d);var _0x210fc5={'channel':_0x21c4('0xd2'),'account':_0x28e439[_0x21c4('0xd3')][_0x21c4('0x30')],'agent':_0x28e439['Owner']?_0x28e439[_0x21c4('0xd4')][_0x21c4('0x31')]:_0x21c4('0xd5'),'createdAt':moment(_0x28e439[_0x21c4('0x7d')])[_0x21c4('0xbc')](_0x21c4('0xbd'))['toString'](),'closedAt':_0x28e439[_0x21c4('0x39')]?moment(_0x28e439['closedAt'])[_0x21c4('0xbc')](_0x21c4('0xbd'))[_0x21c4('0x9a')]():'','disposition':_0x28e439['disposition'],'messages':_(_0x28e439['Messages'])[_0x21c4('0x89')]({'secret':![]})['map'](function(_0x46f371){return{'date':moment(_0x46f371[_0x21c4('0x7d')])[_0x21c4('0xbc')](_0x21c4('0xbd'))[_0x21c4('0x9a')](),'sender':_0x46f371[_0x21c4('0xce')]===_0x21c4('0xd6')?_0x46f371[_0x21c4('0x72')]?_0x46f371[_0x21c4('0x72')][_0x21c4('0x31')]:_0x21c4('0xd7'):_0x46f371[_0x21c4('0x69')][_0x21c4('0xcc')]+(_0x46f371[_0x21c4('0x69')][_0x21c4('0xd8')]?'\x20'+_0x46f371[_0x21c4('0x69')]['lastName']:''),'body':_0x46f371[_0x21c4('0x76')],'direction':_0x46f371[_0x21c4('0xce')]===_0x21c4('0xd6')?'A':'C','secret':_0x46f371['secret'],'read':_0x46f371['read']};})[_0x21c4('0x65')]()};return ejs[_0x21c4('0xd9')](path[_0x21c4('0xc8')](config[_0x21c4('0xc6')],'server',_0x21c4('0xda'),'downloadInteraction.ejs'),{'interaction':_0x210fc5})[_0x21c4('0x2b')](function(_0x6ba305){var _0x5b36b4=path[_0x21c4('0xc8')](_0x3b363d,_0x21c4('0xdb')+_0x28e439['id']+'-'+_0x2f025b+_0x21c4('0xdc'));var _0x28e678={'path':_0x5b36b4,'channel':_0x21c4('0xd2'),'interactionId':_0x28e439['id']};return pdf['createPdfFromHTML'](_0x6ba305,_0x28e678);})[_0x21c4('0x2b')](function(){return new BPromise(function(_0x99f05d,_0x1078b4){zipdir(_0x3b363d,{'saveTo':_0x260d3e},function(_0x3196b1,_0x1c456e){if(_0x3196b1)return _0x1078b4(_0x3196b1);return _0x99f05d(_0x1c456e);});})[_0x21c4('0x2b')](function(){return new BPromise(function(_0x4fa784,_0x3c1459){rimraf(_0x3b363d,function(_0x2789dc){if(_0x2789dc)_0x3c1459(_0x2789dc);return _0x4fa784();});});})[_0x21c4('0x2b')](function(){return _0x1a63c2[_0x21c4('0xc4')](_0x260d3e,_0x36058b,function(_0x598400){if(_0x598400){console[_0x21c4('0xdd')](_0x21c4('0xde'),_0x598400);}else{fs['unlinkSync'](_0x260d3e);}});});});}else{return _0x1a63c2[_0x21c4('0x1f')](0xc8);}})[_0x21c4('0xae')](handleError(_0x1a63c2,null));}; \ No newline at end of file +var _0x7777=['pick','field','color','tools_tags','select','u.id','u.fullname','from','user_has_sms_interactions','users','sms_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','length','value','having','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','start','Tag','User','operator','$substring','text','body','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','role','agent','user','i.SmsAccountId\x20IS\x20NULL','toString','keyBy','merge','SmsInteraction','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','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','show','params','intersection','includeAll','create','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','format','include','findAll','rows','addTags','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','firstName','createdAt','direction','secret','SmsAccount','Account','Owner','mkdirSync','Sms','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','catch','waiting','answered','unmanaged','closed','talking','UserId','total','index','rawAttributes','fieldName','type','query','keys','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x495a02,_0x1e0deb){var _0x21fa54=function(_0x4307f0){while(--_0x4307f0){_0x495a02['push'](_0x495a02['shift']());}};_0x21fa54(++_0x1e0deb);}(_0x7777,0x9c));var _0x7777=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x7777[_0x26d6d9];return _0x1b4875;};'use strict';var emlformat=require(_0x7777('0x0'));var rimraf=require(_0x7777('0x1'));var zipdir=require(_0x7777('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7777('0x3'));var moment=require(_0x7777('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7777('0x5'));var util=require(_0x7777('0x6'));var path=require(_0x7777('0x7'));var sox=require(_0x7777('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7777('0x9'));var _=require(_0x7777('0xa'));var squel=require(_0x7777('0xb'));var crypto=require(_0x7777('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7777('0xd'));var toCsv=require(_0x7777('0xe'));var querystring=require(_0x7777('0xf'));var Papa=require(_0x7777('0x10'));var Redis=require(_0x7777('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7777('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x7777('0x13'));var logger=require('../../config/logger')(_0x7777('0x14'));var utils=require(_0x7777('0x15'));var config=require(_0x7777('0x16'));var licenseUtil=require(_0x7777('0x17'));var db=require('../../mysqldb')['db'];config[_0x7777('0x18')]=_[_0x7777('0x19')](config[_0x7777('0x18')],{'host':_0x7777('0x1a'),'port':0x18eb});var socket=require(_0x7777('0x1b'))(new Redis(config[_0x7777('0x18')]));require(_0x7777('0x1c'))[_0x7777('0x1d')](socket);function respondWithStatusCode(_0x2040cf,_0x5ed418){_0x5ed418=_0x5ed418||0xcc;return function(_0x4528c4){if(_0x4528c4){return _0x2040cf[_0x7777('0x1e')](_0x5ed418);}return _0x2040cf[_0x7777('0x1f')](_0x5ed418)[_0x7777('0x20')]();};}function respondWithResult(_0x59ba67,_0x4c88f0){_0x4c88f0=_0x4c88f0||0xc8;return function(_0xf4fd11){if(_0xf4fd11){return _0x59ba67['status'](_0x4c88f0)[_0x7777('0x21')](_0xf4fd11);}};}function respondWithFilteredResult(_0x3405d0,_0x48a689){return function(_0x20b80d){if(_0x20b80d){var _0x1601ad=typeof _0x48a689[_0x7777('0x22')]===_0x7777('0x23')&&typeof _0x48a689[_0x7777('0x24')]===_0x7777('0x23');var _0x3451e1=_0x20b80d[_0x7777('0x25')];var _0x57f34f=_0x1601ad?0x0:_0x48a689[_0x7777('0x22')];var _0x2af86e=_0x1601ad?_0x20b80d[_0x7777('0x25')]:_0x48a689[_0x7777('0x22')]+_0x48a689[_0x7777('0x24')];var _0x2a573c;if(_0x2af86e>=_0x3451e1){_0x2af86e=_0x3451e1;_0x2a573c=0xc8;}else{_0x2a573c=0xce;}_0x3405d0[_0x7777('0x1f')](_0x2a573c);return _0x3405d0[_0x7777('0x26')](_0x7777('0x27'),_0x57f34f+'-'+_0x2af86e+'/'+_0x3451e1)[_0x7777('0x21')](_0x20b80d);}return null;};}function patchUpdates(_0x4d49c7){return function(_0x235d20){try{jsonpatch[_0x7777('0x28')](_0x235d20,_0x4d49c7,!![]);}catch(_0x55d836){return BPromise['reject'](_0x55d836);}return _0x235d20[_0x7777('0x29')]();};}function saveUpdates(_0x710c22,_0x109c2d){return function(_0x2b7790){if(_0x2b7790){return _0x2b7790[_0x7777('0x2a')](_0x710c22)[_0x7777('0x2b')](function(_0xeeefb9){return _0xeeefb9;});}return null;};}function removeEntity(_0x42d7a1,_0x379245){return function(_0x28491d){if(_0x28491d){return _0x28491d[_0x7777('0x2c')]()[_0x7777('0x2b')](function(){_0x42d7a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35e241,_0x1196b5){return function(_0x3b0215){if(!_0x3b0215){_0x35e241['sendStatus'](0x194);}return _0x3b0215;};}function handleError(_0x295904,_0x571158){_0x571158=_0x571158||0x1f4;return function(_0x177f8b){logger[_0x7777('0x2d')](_0x177f8b[_0x7777('0x2e')]);if(_0x177f8b[_0x7777('0x2f')]){delete _0x177f8b['name'];}_0x295904[_0x7777('0x1f')](_0x571158)[_0x7777('0x30')](_0x177f8b);};}function getInteractionUsers(_0x47e9ed,_0x4f63e7){return new BPromise(function(_0x393e86,_0x2bcc71){try{if(_0x4f63e7[_0x47e9ed['id']]){_0x47e9ed[_0x7777('0x31')]=_[_0x7777('0x32')](_0x4f63e7[_0x47e9ed['id']],function(_0x4d5cc8){return{'id':_0x4d5cc8['id'],'fullname':_0x4d5cc8[_0x7777('0x33')]};});}}catch(_0x172379){_0x2bcc71(_0x172379);}_0x393e86(_0x47e9ed);});}function getInteractionTags(_0x194630,_0x2bce4a){return new BPromise(function(_0x396a62,_0x205bc5){try{if(_0x194630['TagIds']){_0x194630['Tags']=[];_0x194630[_0x7777('0x34')][_0x7777('0x35')](',')[_0x7777('0x36')](function(_0x86527d){_0x194630[_0x7777('0x37')][_0x7777('0x38')](_0x2bce4a[_0x86527d]);});}delete _0x194630[_0x7777('0x34')];}catch(_0x38b19c){_0x205bc5(_0x38b19c);}_0x396a62(_0x194630);});}function updateSmsInteraction(_0x38f94c,_0x207c4b,_0x47a110){return new BPromise(function(_0xc3235d,_0x957388){return getInteractionUsers(_0x38f94c,_0x47a110)[_0x7777('0x2b')](function(_0x455330){return getInteractionTags(_0x455330,_0x207c4b);})[_0x7777('0x2b')](function(_0x12ee23){return getStateInteraction(_0x12ee23);})[_0x7777('0x2b')](function(_0x10714b){_0xc3235d(_0x10714b);})[_0x7777('0x39')](function(_0xb4b6e4){_0x957388(_0xb4b6e4);});});}function getStateInteraction(_0x427c57){return new BPromise(function(_0x52e6d3){_0x427c57[_0x7777('0x3a')]=0x0;_0x427c57['talking']=0x0;_0x427c57[_0x7777('0x3b')]=0x0;_0x427c57[_0x7777('0x3c')]=0x0;_0x427c57['total']=0x0;if(!_0x427c57[_0x7777('0x3d')]&&!_0x427c57['UserId']){_0x427c57['waiting']+=0x1;}if(!_0x427c57['closed']&&_0x427c57['UserId']){_0x427c57[_0x7777('0x3e')]+=0x1;if(_0x427c57[_0x7777('0x3a')]){_0x427c57[_0x7777('0x3a')]-=0x1;}}if(_0x427c57[_0x7777('0x3d')]&&_0x427c57['UserId']){_0x427c57[_0x7777('0x3b')]+=0x1;if(_0x427c57[_0x7777('0x3e')]){_0x427c57[_0x7777('0x3e')]-=0x1;}}if(_0x427c57[_0x7777('0x3d')]&&!_0x427c57[_0x7777('0x3f')]){_0x427c57[_0x7777('0x3c')]+=0x1;if(_0x427c57[_0x7777('0x3a')]){_0x427c57[_0x7777('0x3a')]-=0x1;}}_0x427c57[_0x7777('0x40')]+=0x1;_0x52e6d3(_0x427c57);});}exports[_0x7777('0x41')]=function(_0x7cb304,_0x3a352f){var _0x57865c={},_0x5f48fc={},_0x4f3102={'count':0x0,'rows':[]};var _0x3fba5c=_[_0x7777('0x32')](db['SmsInteraction'][_0x7777('0x42')],function(_0x34e96a){return{'name':_0x34e96a[_0x7777('0x43')],'type':_0x34e96a[_0x7777('0x44')]['key']};});_0x5f48fc['model']=_[_0x7777('0x32')](_0x3fba5c,_0x7777('0x2f'));_0x5f48fc[_0x7777('0x45')]=_[_0x7777('0x46')](_0x7cb304[_0x7777('0x45')]);_0x5f48fc[_0x7777('0x47')]=_['intersection'](_0x5f48fc[_0x7777('0x48')],_0x5f48fc[_0x7777('0x45')]);_0x57865c['attributes']=_['intersection'](_0x5f48fc[_0x7777('0x48')],qs[_0x7777('0x49')](_0x7cb304[_0x7777('0x45')][_0x7777('0x49')]));_0x57865c[_0x7777('0x4a')]=_0x57865c[_0x7777('0x4a')]['length']?_0x57865c[_0x7777('0x4a')]:_0x5f48fc[_0x7777('0x48')];if(!_0x7cb304[_0x7777('0x45')][_0x7777('0x4b')](_0x7777('0x4c'))){_0x57865c[_0x7777('0x24')]=qs[_0x7777('0x24')](_0x7cb304[_0x7777('0x45')][_0x7777('0x24')]);_0x57865c[_0x7777('0x22')]=qs[_0x7777('0x22')](_0x7cb304[_0x7777('0x45')]['offset']);}_0x57865c[_0x7777('0x4d')]=qs[_0x7777('0x4e')](_0x7cb304[_0x7777('0x45')][_0x7777('0x4e')]);_0x57865c[_0x7777('0x4f')]=qs[_0x7777('0x47')](_[_0x7777('0x50')](_0x7cb304['query'],_0x5f48fc['filters']),_0x3fba5c);var _0x25445e=[];var _0x29b8fe=squel['select']()[_0x7777('0x51')]('id')[_0x7777('0x51')]('name')[_0x7777('0x51')](_0x7777('0x52'))['from'](_0x7777('0x53'));var _0x2c6bcb=squel[_0x7777('0x54')]()[_0x7777('0x51')](_0x7777('0x55'))[_0x7777('0x51')](_0x7777('0x56'))[_0x7777('0x51')]('ui.SmsInteractionId')[_0x7777('0x57')](_0x7777('0x58'),'ui')['left_join'](_0x7777('0x59'),'u','u.id\x20=\x20ui.UserId');var _0x50f0f6=squel['select']()[_0x7777('0x57')](_0x7777('0x5a'),'i')[_0x7777('0x5b')]('cm_contacts','c',_0x7777('0x5c'))[_0x7777('0x5b')](_0x7777('0x59'),'o',_0x7777('0x5d'))[_0x7777('0x5b')]('sms_accounts','a',_0x7777('0x5e'))['left_join'](_0x7777('0x5f'),'me',_0x7777('0x60'))[_0x7777('0x5b')](_0x7777('0x61'),'it',_0x7777('0x62'))[_0x7777('0x5b')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5bea00=squel['expr']();var _0x32d429=[];var _0x21ff34=squel[_0x7777('0x63')]();var _0x475d40;if(_0x7cb304[_0x7777('0x45')][_0x7777('0x64')]){_0x475d40=as['parseSearch'](_0x7cb304[_0x7777('0x45')][_0x7777('0x64')]);var _0x5b06c5=_0x475d40[_0x7777('0x65')];for(var _0x21f4b8=0x0;_0x21f4b8<_0x475d40[_0x7777('0x66')][_0x7777('0x67')];_0x21f4b8++){var _0x293c01=_0x475d40['conditions'][_0x21f4b8];var _0x3b06cf='i';var _0x3ba02e=_['find'](_0x3fba5c,['name',_0x293c01['field']]);if(!_0x3ba02e){switch(_0x293c01[_0x7777('0x51')]){case'unreadMessages':if(_0x293c01[_0x7777('0x68')]==0x1){_0x50f0f6['having']('`'+_0x293c01[_0x7777('0x51')]+'`\x20=\x200');}else{_0x50f0f6[_0x7777('0x69')]('`'+_0x293c01[_0x7777('0x51')]+_0x7777('0x6a'));}break;case _0x7777('0x6b'):if(_0x293c01['operator']==='$substring'){if(_0x293c01[_0x7777('0x68')][_0x7777('0x35')]('\x20')['length']>0x1){_0x5bea00[_0x5b06c5](_0x7777('0x6c'),qs[_0x7777('0x6d')](_0x293c01[_0x7777('0x68')]),null);}else{var _0x1c6cd1='%'+_0x293c01[_0x7777('0x68')]+'%';_0x5bea00[_0x5b06c5](_0x7777('0x6e'),_0x1c6cd1,_0x1c6cd1,_0x1c6cd1);}}else{_0x3ba02e=_[_0x7777('0x6f')](_0x3fba5c,[_0x7777('0x2f'),'ContactId']);_0x293c01['field']=_0x7777('0x70');_0x593537=as[_0x7777('0x71')](_0x3b06cf,_0x3ba02e[_0x7777('0x44')],_0x293c01);_0x5bea00[_0x5b06c5](_0x593537['text'],_0x593537[_0x7777('0x68')][_0x7777('0x72')],_0x593537['value']['end']);}break;case _0x7777('0x73'):var _0x555d26=_0x293c01['value']['split'](',')[_0x7777('0x32')](function(_0x2bc772){return Number(_0x2bc772);});_0x555d26[_0x7777('0x36')](function(_0x1f0cda){_0x21ff34['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1f0cda+',%');});_0x32d429=_['union'](_0x32d429,_0x555d26);break;case _0x7777('0x74'):if(_0x293c01[_0x7777('0x75')]===_0x7777('0x76')){_0x5bea00[_0x5b06c5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x293c01[_0x7777('0x68')]+'%',null);}else{_0x3ba02e=_[_0x7777('0x6f')](_0x3fba5c,[_0x7777('0x2f'),_0x7777('0x3f')]);_0x293c01[_0x7777('0x51')]=_0x7777('0x3f');_0x593537=as[_0x7777('0x71')](_0x3b06cf,_0x3ba02e[_0x7777('0x44')],_0x293c01);_0x5bea00[_0x5b06c5](_0x593537[_0x7777('0x77')],_0x593537['value'][_0x7777('0x72')],_0x593537['value'][_0x7777('0x20')]);}break;case _0x7777('0x78'):_0x593537=as[_0x7777('0x71')]('me',null,_0x293c01);_0x5bea00[_0x5b06c5](_0x593537['text'],_0x593537['value'][_0x7777('0x72')],_0x593537[_0x7777('0x68')]['end']);break;}}else{var _0x593537=as['buildExpression'](_0x3b06cf,_0x3ba02e[_0x7777('0x44')],_0x293c01);_0x5bea00[_0x5b06c5](_0x593537[_0x7777('0x77')],_0x593537[_0x7777('0x68')][_0x7777('0x72')],_0x593537[_0x7777('0x68')][_0x7777('0x20')]);}}}else{var _0x1f1f95=_(_0x7cb304[_0x7777('0x45')])[_0x7777('0x46')]()[_0x7777('0x32')](function(_0x5413e1){return _['some'](_0x3fba5c,[_0x7777('0x2f'),_0x5413e1])?_0x5413e1:undefined;})['compact']()[_0x7777('0x68')]();if(!_[_0x7777('0x79')](_0x1f1f95)){_0x1f1f95[_0x7777('0x36')](function(_0xb31106){if(_0xb31106===_0x7777('0x7a')){_0x50f0f6[_0x7777('0x4f')](_0x7777('0x7b'),[][_0x7777('0x7c')](_0x7cb304[_0x7777('0x45')][_0xb31106]));}else if(_0xb31106==='createdAt'){var _0x495378=JSON['parse'](_0x7cb304[_0x7777('0x45')][_0xb31106])[_0x7777('0x7d')];var _0x5b4b7e=JSON[_0x7777('0x7e')](_0x7cb304[_0x7777('0x45')][_0xb31106])[_0x7777('0x7f')];_0x50f0f6[_0x7777('0x4f')](_0x7777('0x80'),_0x495378,_0x5b4b7e);}else{if(_0x7cb304[_0x7777('0x45')][_0xb31106]===_0x7777('0x81')){_0x50f0f6['where']('i.'+_0xb31106+_0x7777('0x82'));}else{_0x50f0f6[_0x7777('0x4f')]('i.'+_0xb31106+_0x7777('0x83'),_0x7cb304['query'][_0xb31106]);}}});}if(_0x7cb304[_0x7777('0x45')][_0x7777('0x84')]){if(_0x7cb304[_0x7777('0x45')][_0x7777('0x84')]==0x1){_0x50f0f6[_0x7777('0x69')](_0x7777('0x85'));}else{_0x50f0f6['having'](_0x7777('0x86'));}}if(_0x7cb304[_0x7777('0x45')][_0x7777('0x87')]){_0x32d429=_[_0x7777('0x88')](_0x7cb304['query'][_0x7777('0x87')])?_0x7cb304[_0x7777('0x45')]['tag']:new Array(_0x7cb304[_0x7777('0x45')]['tag']);_0x32d429[_0x7777('0x36')](function(_0x1b3959){_0x21ff34['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1b3959+',%');});}if(_0x7cb304['query'][_0x7777('0x89')]){var _0x14213b=_0x7cb304[_0x7777('0x45')][_0x7777('0x89')][_0x7777('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x7777('0x8b')](_0x14213b)){_0x5bea00['or']('i.id\x20LIKE\x20?',_0x14213b+'%')['or'](_0x7777('0x8c'),_0x14213b+'%');}else{_0x5bea00['or'](_0x7777('0x8d'),qs[_0x7777('0x6d')](_0x14213b))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x14213b+'%');}}}_0x50f0f6[_0x7777('0x4f')](_0x5bea00);_0x50f0f6['group'](_0x7777('0x8e'));var _0x5bfc38={'type':db[_0x7777('0x8f')][_0x7777('0x90')][_0x7777('0x91')],'raw':!![]};var _0x4a8e11=_0x50f0f6['clone']();_0x4a8e11[_0x7777('0x51')](_0x7777('0x8e'));_0x4a8e11['field'](_0x7777('0x92'),_0x7777('0x93'));if(_0x57865c[_0x7777('0x4d')]){_0x57865c[_0x7777('0x4d')][_0x7777('0x36')](function(_0x215454){var _0x47b19e=_0x215454[0x0]===_0x7777('0x94')?_0x215454[0x0]:'i.'+_0x215454[0x0];_0x50f0f6[_0x7777('0x4d')](_0x47b19e,_0x215454[0x1]===_0x7777('0x95')?![]:!![]);});}if(!_[_0x7777('0x79')](_0x32d429)){_0x50f0f6[_0x7777('0x69')](_0x21ff34);_0x4a8e11[_0x7777('0x4f')](_0x7777('0x96'),_0x32d429);}BPromise[_0x7777('0x97')]()[_0x7777('0x2b')](function(){if(!_0x475d40){if(_0x7cb304[_0x7777('0x45')][_0x7777('0x7a')])return;_0x4a8e11[_0x7777('0x4f')](_0x7777('0x98'));_0x50f0f6[_0x7777('0x4f')](_0x7777('0x98'));return;}if(_0x7cb304['user'][_0x7777('0x99')]!==_0x7777('0x9a'))return;return _0x7cb304[_0x7777('0x9b')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x5ea8a3){if(_[_0x7777('0x79')](_0x5ea8a3)){_0x4a8e11['where'](_0x7777('0x9c'));_0x50f0f6[_0x7777('0x4f')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x4a8e11[_0x7777('0x4f')](_0x7777('0x7b'),_[_0x7777('0x32')](_0x5ea8a3,'id'));_0x50f0f6[_0x7777('0x4f')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x5ea8a3,'id'));}});})[_0x7777('0x2b')](function(){if(_0x7cb304['user'][_0x7777('0x99')]===_0x7777('0x9a')&&!_0x475d40&&!_0x7cb304[_0x7777('0x45')]['SmsAccountId'])return[];return db['sequelize'][_0x7777('0x45')](_0x4a8e11['toString'](),_0x5bfc38);})[_0x7777('0x2b')](function(_0x3c95d9){_0x4f3102[_0x7777('0x25')]=_0x3c95d9[_0x7777('0x67')];if(_0x4f3102['count']===0x0)return[];return db['sequelize'][_0x7777('0x45')](_0x29b8fe[_0x7777('0x9d')](),_0x5bfc38)['then'](function(_0x24578d){_0x25445e=_[_0x7777('0x9e')](_0x24578d,'id');_0x5bfc38=_[_0x7777('0x9f')](_0x5bfc38,{'model':db[_0x7777('0xa0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x7cb304[_0x7777('0x45')]['fields']){_0x57865c[_0x7777('0x4a')][_0x7777('0x36')](function(_0x3da34d){_0x50f0f6[_0x7777('0x51')]('i.'+_0x3da34d);});}else{_0x50f0f6[_0x7777('0x51')](_0x7777('0x92'),_0x7777('0x93'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xa1'),_0x7777('0xa2'));_0x50f0f6['field'](_0x7777('0xa3'),_0x7777('0xa4'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xa5'),_0x7777('0x94'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xa6'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xa7'),'Contact.firstName');_0x50f0f6[_0x7777('0x51')](_0x7777('0xa8'),_0x7777('0xa9'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xaa'),_0x7777('0xab'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xac'),'Contact.phone');_0x50f0f6[_0x7777('0x51')](_0x7777('0xad'),_0x7777('0xae'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xaf'),_0x7777('0xb0'));_0x50f0f6[_0x7777('0x51')](_0x7777('0xb1'),'Owner.fullname');_0x50f0f6[_0x7777('0x51')]('o.internal',_0x7777('0xb2'));_0x50f0f6['field'](_0x7777('0xb3'),_0x7777('0x34'));}if(_0x57865c[_0x7777('0x24')])_0x50f0f6['limit'](_0x57865c[_0x7777('0x24')]);if(_0x57865c['offset'])_0x50f0f6['offset'](_0x57865c[_0x7777('0x22')]);return db[_0x7777('0xb4')][_0x7777('0x45')](_0x50f0f6[_0x7777('0x9d')](),_0x5bfc38);})[_0x7777('0x2b')](function(_0x4f9418){if(_0x4f9418[_0x7777('0x67')]>0x0)_0x2c6bcb[_0x7777('0x4f')](_0x7777('0xb5'),_['map'](_0x4f9418,'id'));return db['sequelize'][_0x7777('0x45')](_0x2c6bcb[_0x7777('0x9d')](),_0x5bfc38)[_0x7777('0x2b')](function(_0x118998){var _0x447121=_[_0x7777('0xb6')](_0x118998,_0x7777('0xb7'));var _0x3ee85d=[];_0x4f9418[_0x7777('0x36')](function(_0x38d83e){_0x3ee85d[_0x7777('0x38')](updateSmsInteraction(_0x38d83e,_0x25445e,_0x447121));});return BPromise[_0x7777('0xb8')](_0x3ee85d);});});})[_0x7777('0x2b')](function(_0x27a396){_0x4f3102['rows']=_0x27a396;return _0x4f3102;})[_0x7777('0x2b')](respondWithFilteredResult(_0x3a352f,_0x57865c))[_0x7777('0x39')](handleError(_0x3a352f,null));};exports[_0x7777('0xb9')]=function(_0x3f5f53,_0x165da9){var _0x2ecb18={'raw':![],'where':{'id':_0x3f5f53[_0x7777('0xba')]['id']}},_0x2bc0cb={};_0x2bc0cb[_0x7777('0x48')]=_['keys'](db[_0x7777('0xa0')][_0x7777('0x42')]);_0x2bc0cb[_0x7777('0x45')]=_[_0x7777('0x46')](_0x3f5f53[_0x7777('0x45')]);_0x2bc0cb['filters']=_[_0x7777('0xbb')](_0x2bc0cb[_0x7777('0x48')],_0x2bc0cb[_0x7777('0x45')]);_0x2ecb18[_0x7777('0x4a')]=_[_0x7777('0xbb')](_0x2bc0cb[_0x7777('0x48')],qs[_0x7777('0x49')](_0x3f5f53[_0x7777('0x45')]['fields']));_0x2ecb18['attributes']=_0x2ecb18[_0x7777('0x4a')][_0x7777('0x67')]?_0x2ecb18[_0x7777('0x4a')]:_0x2bc0cb['model'];if(_0x3f5f53[_0x7777('0x45')][_0x7777('0xbc')]){_0x2ecb18['include']=[{'all':!![]}];}_0x2ecb18=_['merge']({},_0x2ecb18,_0x3f5f53['options']);return db[_0x7777('0xa0')][_0x7777('0x6f')](_0x2ecb18)[_0x7777('0x2b')](handleEntityNotFound(_0x165da9,null))[_0x7777('0x2b')](respondWithResult(_0x165da9,null))[_0x7777('0x39')](handleError(_0x165da9,null));};exports[_0x7777('0xbd')]=function(_0x17af69,_0x563859){return db[_0x7777('0xa0')][_0x7777('0xbd')](_0x17af69[_0x7777('0x78')],{})[_0x7777('0x2b')](respondWithResult(_0x563859,0xc9))['catch'](handleError(_0x563859,null));};exports[_0x7777('0x2a')]=function(_0x4ad734,_0x5e2831){if(_0x4ad734[_0x7777('0x78')]['id']){delete _0x4ad734['body']['id'];}return db[_0x7777('0xa0')]['find']({'where':{'id':_0x4ad734['params']['id']}})['then'](handleEntityNotFound(_0x5e2831,null))[_0x7777('0x2b')](saveUpdates(_0x4ad734[_0x7777('0x78')],null))['then'](respondWithResult(_0x5e2831,null))[_0x7777('0x39')](handleError(_0x5e2831,null));};exports[_0x7777('0x2c')]=function(_0x4132e1,_0x21d80f){return db['SmsInteraction']['find']({'where':{'id':_0x4132e1[_0x7777('0xba')]['id']}})[_0x7777('0x2b')](handleEntityNotFound(_0x21d80f,null))[_0x7777('0x2b')](removeEntity(_0x21d80f,null))[_0x7777('0x39')](handleError(_0x21d80f,null));};exports['describe']=function(_0x4ee829,_0x1ddb84){return db[_0x7777('0xa0')][_0x7777('0xbe')]()[_0x7777('0x2b')](respondWithResult(_0x1ddb84,null))['catch'](handleError(_0x1ddb84,null));};exports[_0x7777('0xbf')]=function(_0x3d2533,_0x408db0,_0x25a1da){return db[_0x7777('0xc0')][_0x7777('0x6f')]({'where':{'id':_0x3d2533[_0x7777('0xba')]['id']}})[_0x7777('0x2b')](handleEntityNotFound(_0x408db0,null))[_0x7777('0x2b')](function(_0x50cdc3){if(_0x50cdc3){return _0x50cdc3[_0x7777('0xbf')](_0x3d2533[_0x7777('0x78')]['ids'],_[_0x7777('0xc1')](_0x3d2533[_0x7777('0x78')],[_0x7777('0xc2'),'id'])||{});}})[_0x7777('0x2b')](respondWithResult(_0x408db0,null))[_0x7777('0x39')](handleError(_0x408db0,null));};exports[_0x7777('0xc3')]=function(_0x1f0a4e,_0x40ee73,_0x5ef6b3){var _0x10deb4={'raw':![],'where':{}};var _0x3e5b99={};var _0xc8955b={'count':0x0,'rows':[]};return db[_0x7777('0xa0')][_0x7777('0xc4')]({'where':{'id':_0x1f0a4e['params']['id']}})[_0x7777('0x2b')](handleEntityNotFound(_0x40ee73,null))[_0x7777('0x2b')](function(_0x359792){if(_0x359792){_0x3e5b99[_0x7777('0x48')]=_[_0x7777('0x46')](db[_0x7777('0xc0')][_0x7777('0x42')]);_0x3e5b99[_0x7777('0x45')]=_[_0x7777('0x46')](_0x1f0a4e[_0x7777('0x45')]);_0x3e5b99[_0x7777('0x47')]=_[_0x7777('0xbb')](_0x3e5b99[_0x7777('0x48')],_0x3e5b99[_0x7777('0x45')]);_0x10deb4[_0x7777('0x4a')]=_['intersection'](_0x3e5b99[_0x7777('0x48')],qs[_0x7777('0x49')](_0x1f0a4e['query'][_0x7777('0x49')]));_0x10deb4[_0x7777('0x4a')]=_0x10deb4[_0x7777('0x4a')]['length']?_0x10deb4[_0x7777('0x4a')]:_0x3e5b99['model'];if(!_0x1f0a4e[_0x7777('0x45')][_0x7777('0x4b')]('nolimit')){_0x10deb4[_0x7777('0x24')]=qs[_0x7777('0x24')](_0x1f0a4e[_0x7777('0x45')][_0x7777('0x24')]);_0x10deb4[_0x7777('0x22')]=qs[_0x7777('0x22')](_0x1f0a4e[_0x7777('0x45')][_0x7777('0x22')]);}_0x10deb4[_0x7777('0x4d')]=qs['sort'](_0x1f0a4e[_0x7777('0x45')][_0x7777('0x4e')]);_0x10deb4['where']=qs['filters'](_[_0x7777('0x50')](_0x1f0a4e[_0x7777('0x45')],_0x3e5b99[_0x7777('0x47')]));_0x10deb4['where'][_0x7777('0xb7')]=_0x359792['id'];if(_0x1f0a4e[_0x7777('0x45')][_0x7777('0x89')]){_0x10deb4[_0x7777('0x4f')]=_[_0x7777('0x9f')](_0x10deb4[_0x7777('0x4f')],{'$or':_[_0x7777('0x32')](_0x10deb4[_0x7777('0x4a')],function(_0x37c11b){var _0x10ab75={};_0x10ab75[_0x37c11b]={'$like':'%'+_0x1f0a4e['query'][_0x7777('0x89')]+'%'};return _0x10ab75;})});}if(_0x1f0a4e[_0x7777('0x45')]['$gte']){var _0x5b744c=_0x1f0a4e['query'][_0x7777('0x7d')][_0x7777('0x35')](',');var _0x23f1d4={};_0x23f1d4[_0x5b744c[0x0]]={'$gte':moment(_0x5b744c[0x1])[_0x7777('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x10deb4[_0x7777('0x4f')]=_[_0x7777('0x9f')](_0x10deb4[_0x7777('0x4f')],_0x23f1d4);}_0x10deb4=_[_0x7777('0x9f')]({},_0x10deb4,_0x1f0a4e['options']);return db[_0x7777('0xc0')]['count']({'where':_0x10deb4[_0x7777('0x4f')]})[_0x7777('0x2b')](function(_0x47608a){_0xc8955b['count']=_0x47608a;if(_0x1f0a4e[_0x7777('0x45')]['includeAll']){_0x10deb4[_0x7777('0xc6')]=[{'all':!![]}];}return db['SmsMessage'][_0x7777('0xc7')](_0x10deb4);})['then'](function(_0x3d66c7){_0xc8955b[_0x7777('0xc8')]=_0x3d66c7;return _0xc8955b;});}})[_0x7777('0x2b')](respondWithFilteredResult(_0x40ee73,_0x10deb4))[_0x7777('0x39')](handleError(_0x40ee73,null));};exports[_0x7777('0xc9')]=function(_0x584792,_0x3c13fd,_0x5d194a){return db[_0x7777('0xa0')]['find']({'where':{'id':_0x584792['params']['id']}})[_0x7777('0x2b')](handleEntityNotFound(_0x3c13fd,null))[_0x7777('0x2b')](function(_0x2003f5){if(_0x2003f5){return _0x2003f5['setTags'](_0x584792[_0x7777('0x78')][_0x7777('0xc2')],_[_0x7777('0xc1')](_0x584792[_0x7777('0x78')],[_0x7777('0xc2'),'id'])||{})['spread'](function(){return db[_0x7777('0x73')][_0x7777('0xc7')]({'attributes':['id',_0x7777('0x2f'),'color'],'where':{'id':_0x584792[_0x7777('0x78')][_0x7777('0xc2')]}});})[_0x7777('0x2b')](function(_0x419160){socket['emit']('smsInteractionTags:save',{'id':Number(_0x584792['params']['id']),'tags':_0x419160||[]});return{'id':Number(_0x584792[_0x7777('0xba')]['id']),'tags':_0x419160||[]};});}})['then'](respondWithResult(_0x3c13fd,null))['catch'](handleError(_0x3c13fd,null));};exports[_0x7777('0xca')]=function(_0x37ba53,_0x57f48d,_0x925eed){return db[_0x7777('0xa0')][_0x7777('0x6f')]({'where':{'id':_0x37ba53[_0x7777('0xba')]['id']}})[_0x7777('0x2b')](handleEntityNotFound(_0x57f48d,null))['then'](function(_0x3e74a4){if(_0x3e74a4){return _0x3e74a4[_0x7777('0xca')](_0x37ba53[_0x7777('0x45')][_0x7777('0xc2')]);}})[_0x7777('0x2b')](respondWithStatusCode(_0x57f48d,null))['catch'](handleError(_0x57f48d,null));};exports[_0x7777('0xcb')]=function(_0x3d9f71,_0x5836e9){var _0x3721cb=moment()[_0x7777('0xcc')]()[_0x7777('0x9d')]();var _0x4b11a3=path[_0x7777('0xcd')](config[_0x7777('0xce')],_0x7777('0xcf'),'files',_0x7777('0xd0'));var _0x1c642f=path[_0x7777('0xcd')](config[_0x7777('0xce')],_0x7777('0xcf'),_0x7777('0xd1'),_0x7777('0xd2'));var _0x4991c6=path[_0x7777('0xcd')](_0x4b11a3,_0x3721cb);var _0x59f14d=util[_0x7777('0xc5')](_0x7777('0xd3'),_0x3d9f71[_0x7777('0xba')]['id'],_0x3721cb);var _0x52c8b8=path[_0x7777('0xcd')](_0x4b11a3,_0x59f14d);var _0x20f446=[];_0x20f446[_0x7777('0x38')]({'model':db[_0x7777('0x74')],'as':_0x7777('0x74'),'attributes':['id',_0x7777('0x33')],'raw':!![]});_0x20f446[_0x7777('0x38')]({'model':db[_0x7777('0xd4')],'as':_0x7777('0x6b'),'attributes':['id',_0x7777('0xd5'),'lastName'],'raw':!![]});var _0x242be2=[{'model':db[_0x7777('0xc0')],'as':'Messages','attributes':['id',_0x7777('0x78'),_0x7777('0xd6'),_0x7777('0xd7'),_0x7777('0xd8'),'read'],'include':_0x20f446}];_0x242be2['push']({'model':db[_0x7777('0xd9')],'as':_0x7777('0xda'),'attributes':['id',_0x7777('0x2f')]});_0x242be2[_0x7777('0x38')]({'model':db[_0x7777('0x74')],'as':_0x7777('0xdb'),'attributes':['id',_0x7777('0x33')]});return db[_0x7777('0xa0')][_0x7777('0x6f')]({'where':{'id':_0x3d9f71[_0x7777('0xba')]['id']},'include':_0x242be2})[_0x7777('0x2b')](handleEntityNotFound(_0x5836e9,null))[_0x7777('0x2b')](function(_0x152bd1){if(_0x152bd1){var _0x2a6648=_0x152bd1['get']({'plain':!![]});fs[_0x7777('0xdc')](_0x4991c6);var _0x4ccd2a={'channel':_0x7777('0xdd'),'account':_0x2a6648[_0x7777('0xda')]['name'],'agent':_0x2a6648[_0x7777('0xdb')]?_0x2a6648[_0x7777('0xdb')][_0x7777('0x33')]:'N.A.','createdAt':moment(_0x2a6648[_0x7777('0xd6')])[_0x7777('0xc5')](_0x7777('0xde'))[_0x7777('0x9d')](),'closedAt':_0x2a6648[_0x7777('0x3d')]?moment(_0x2a6648[_0x7777('0xdf')])[_0x7777('0xc5')](_0x7777('0xde'))[_0x7777('0x9d')]():'','disposition':_0x2a6648[_0x7777('0xe0')],'messages':_(_0x2a6648[_0x7777('0xe1')])[_0x7777('0x89')]({'secret':![]})['map'](function(_0x1e3706){return{'date':moment(_0x1e3706[_0x7777('0xd6')])[_0x7777('0xc5')](_0x7777('0xde'))[_0x7777('0x9d')](),'sender':_0x1e3706[_0x7777('0xd7')]===_0x7777('0xe2')?_0x1e3706['User']?_0x1e3706[_0x7777('0x74')][_0x7777('0x33')]:_0x7777('0xe3'):_0x1e3706[_0x7777('0x6b')][_0x7777('0xd5')]+(_0x1e3706[_0x7777('0x6b')][_0x7777('0xe4')]?'\x20'+_0x1e3706[_0x7777('0x6b')][_0x7777('0xe4')]:''),'body':_0x1e3706[_0x7777('0x78')],'direction':_0x1e3706[_0x7777('0xd7')]===_0x7777('0xe2')?'A':'C','secret':_0x1e3706['secret'],'read':_0x1e3706[_0x7777('0x84')]};})[_0x7777('0x68')]()};return ejs[_0x7777('0xe5')](path['join'](config[_0x7777('0xce')],_0x7777('0xcf'),_0x7777('0xe6'),_0x7777('0xe7')),{'interaction':_0x4ccd2a})['then'](function(_0x4d93eb){var _0x59fca8=path[_0x7777('0xcd')](_0x4991c6,_0x7777('0xe8')+_0x2a6648['id']+'-'+_0x3721cb+_0x7777('0xe9'));var _0x21b486={'path':_0x59fca8,'channel':_0x7777('0xdd'),'interactionId':_0x2a6648['id']};return pdf[_0x7777('0xea')](_0x4d93eb,_0x21b486);})[_0x7777('0x2b')](function(){return new BPromise(function(_0x4ca514,_0x4315aa){zipdir(_0x4991c6,{'saveTo':_0x52c8b8},function(_0x195b4f,_0x333341){if(_0x195b4f)return _0x4315aa(_0x195b4f);return _0x4ca514(_0x333341);});})[_0x7777('0x2b')](function(){return new BPromise(function(_0x516a48,_0xa94d5e){rimraf(_0x4991c6,function(_0x1bb210){if(_0x1bb210)_0xa94d5e(_0x1bb210);return _0x516a48();});});})[_0x7777('0x2b')](function(){return _0x5836e9[_0x7777('0xcb')](_0x52c8b8,_0x59f14d,function(_0x8917f0){if(_0x8917f0){console[_0x7777('0xeb')]('err',_0x8917f0);}else{fs['unlinkSync'](_0x52c8b8);}});});});}else{return _0x5836e9[_0x7777('0x1e')](0xc8);}})['catch'](handleError(_0x5836e9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index b4edffc..8201c7f 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 _0x0424=['SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','update','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x38cc31,_0x323e5e){var _0x246029=function(_0x2c89a0){while(--_0x2c89a0){_0x38cc31['push'](_0x38cc31['shift']());}};_0x246029(++_0x323e5e);}(_0x0424,0x159));var _0x4042=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x0424[_0x5d860f];return _0x236490;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x4042('0x0')];var SmsMessage=require(_0x4042('0x1'))['db'][_0x4042('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4042('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4042('0x4'),'afterDestroy':'remove'};function emitEvent(_0x491eae){return function(_0x20d8df,_0x24fdfd,_0x472795){_0x20d8df[_0x4042('0x5')]({'attributes':['id'],'raw':!![]})[_0x4042('0x6')](function(_0xa5310f){_0x20d8df[_0x4042('0x7')]('Users',_0xa5310f['map'](function(_0x280cd6){return{'id':_0x280cd6['id']};}));return SmsMessage[_0x4042('0x8')]({'where':{'SmsInteractionId':_0x20d8df['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4042('0x6')](function(_0x4b92d2){_0x20d8df[_0x4042('0x7')](_0x4042('0x9'),_0x4b92d2[_0x4042('0xa')]);SmsInteractionEvents[_0x4042('0xb')](_0x491eae+':'+_0x20d8df['id'],_0x20d8df);SmsInteractionEvents[_0x4042('0xb')](_0x491eae,_0x20d8df);_0x472795(null);})[_0x4042('0xc')](_0x472795(null));};}for(var e in events){if(events[_0x4042('0xd')](e)){var event=events[e];SmsInteraction[_0x4042('0xe')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0xed3c=['unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','getUsers','Users','then','setDataValue'];(function(_0x3a48bd,_0x1d6fcf){var _0x5eb18d=function(_0xf691c4){while(--_0xf691c4){_0x3a48bd['push'](_0x3a48bd['shift']());}};_0x5eb18d(++_0x1d6fcf);}(_0xed3c,0x1a6));var _0xced3=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0xed3c[_0x2cc0b3];return _0x1667ef;};'use strict';var EventEmitter=require(_0xced3('0x0'));var SmsInteraction=require(_0xced3('0x1'))['db'][_0xced3('0x2')];var SmsMessage=require(_0xced3('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xced3('0x3')](0x0);var events={'afterCreate':_0xced3('0x4'),'afterUpdate':_0xced3('0x5'),'afterDestroy':'remove'};function emitEvent(_0x51e500){return function(_0x3d3aa0,_0x1ada18,_0x2f92f8){_0x3d3aa0[_0xced3('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x510164){_0x3d3aa0['setDataValue'](_0xced3('0x7'),_0x510164['map'](function(_0x5bc7a7){return{'id':_0x5bc7a7['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3d3aa0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xced3('0x8')](function(_0x321c42){_0x3d3aa0[_0xced3('0x9')](_0xced3('0xa'),_0x321c42[_0xced3('0xb')]);SmsInteractionEvents['emit'](_0x51e500+':'+_0x3d3aa0['id'],_0x3d3aa0);SmsInteractionEvents[_0xced3('0xc')](_0x51e500,_0x3d3aa0);_0x2f92f8(null);})[_0xced3('0xd')](_0x2f92f8(null));};}for(var e in events){if(events[_0xced3('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xced3('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index b708649..0388e1a 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 _0x3dad=['exports','define','sms_interactions','closedAt','format','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x393b50,_0x4b4f27){var _0x29b4c6=function(_0x48bcb7){while(--_0x48bcb7){_0x393b50['push'](_0x393b50['shift']());}};_0x29b4c6(++_0x4b4f27);}(_0x3dad,0x1b7));var _0xd3da=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3dad[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xd3da('0x0'));var util=require(_0xd3da('0x1'));var logger=require('../../config/logger')(_0xd3da('0x2'));var moment=require('moment');var BPromise=require(_0xd3da('0x3'));var rp=require(_0xd3da('0x4'));var fs=require('fs');var path=require(_0xd3da('0x5'));var rimraf=require(_0xd3da('0x6'));var config=require(_0xd3da('0x7'));var attributes=require(_0xd3da('0x8'));module[_0xd3da('0x9')]=function(_0x2414f1,_0x5843e7){return _0x2414f1[_0xd3da('0xa')]('SmsInteraction',attributes,{'tableName':_0xd3da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b8c4b,_0x37ef2c,_0x328afb){if(_0x1b8c4b['changed']('closed')){_0x1b8c4b[_0xd3da('0xc')]=moment()[_0xd3da('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x328afb(null,_0x1b8c4b);}}});}; \ No newline at end of file +var _0x273a=['rimraf','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','bluebird','path'];(function(_0xca465b,_0x470663){var _0x3d988d=function(_0x2d2e1f){while(--_0x2d2e1f){_0xca465b['push'](_0xca465b['shift']());}};_0x3d988d(++_0x470663);}(_0x273a,0xea));var _0xa273=function(_0x374578,_0xc47540){_0x374578=_0x374578-0x0;var _0x32bfc0=_0x273a[_0x374578];return _0x32bfc0;};'use strict';var _=require(_0xa273('0x0'));var util=require(_0xa273('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa273('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa273('0x3'));var rimraf=require(_0xa273('0x4'));var config=require('../../config/environment');var attributes=require(_0xa273('0x5'));module['exports']=function(_0x35f95c,_0x45e6d1){return _0x35f95c[_0xa273('0x6')](_0xa273('0x7'),attributes,{'tableName':_0xa273('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x498ee8,_0x56b274,_0x14f206){if(_0x498ee8[_0xa273('0x9')](_0xa273('0xa'))){_0x498ee8[_0xa273('0xb')]=moment()[_0xa273('0xc')](_0xa273('0xd'));}_0x14f206(null,_0x498ee8);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 1d16204..0e9a17e 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 _0xfddb=['addTags','ids','omit','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','UpdateSmsInteraction','update','body','options','where','attributes','limit','AddTagsToSmsInteraction'];(function(_0x3f3e7a,_0x5b13f9){var _0x4b5ba6=function(_0x2529cc){while(--_0x2529cc){_0x3f3e7a['push'](_0x3f3e7a['shift']());}};_0x4b5ba6(++_0x5b13f9);}(_0xfddb,0x108));var _0xbfdd=function(_0x53ff5e,_0x15cba1){_0x53ff5e=_0x53ff5e-0x0;var _0xa4c2b=_0xfddb[_0x53ff5e];return _0xa4c2b;};'use strict';var _=require(_0xbfdd('0x0'));var util=require(_0xbfdd('0x1'));var moment=require(_0xbfdd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfdd('0x3'));var db=require(_0xbfdd('0x4'))['db'];var utils=require(_0xbfdd('0x5'));var logger=require('../../config/logger')(_0xbfdd('0x6'));var config=require(_0xbfdd('0x7'));var jayson=require(_0xbfdd('0x8'));var client=jayson['client'][_0xbfdd('0x9')]({'port':0x232a});config[_0xbfdd('0xa')]=_[_0xbfdd('0xb')](config[_0xbfdd('0xa')],{'host':_0xbfdd('0xc'),'port':0x18eb});var socket=require(_0xbfdd('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x3265ef,_0x41ac61,_0x43c740){return new BPromise(function(_0x4c71be,_0xc23116){return client[_0xbfdd('0xe')](_0x3265ef,_0x43c740)[_0xbfdd('0xf')](function(_0xd85c25){logger[_0xbfdd('0x10')](_0xbfdd('0x11'),_0x41ac61,_0xbfdd('0x12'));logger[_0xbfdd('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x41ac61,_0xbfdd('0x12'),JSON[_0xbfdd('0x14')](_0xd85c25));if(_0xd85c25[_0xbfdd('0x15')]){if(_0xd85c25[_0xbfdd('0x15')]['code']===0x1f4){logger[_0xbfdd('0x15')](_0xbfdd('0x11'),_0x41ac61,_0xd85c25[_0xbfdd('0x15')][_0xbfdd('0x16')]);return _0xc23116(_0xd85c25['error'][_0xbfdd('0x16')]);}logger[_0xbfdd('0x15')](_0xbfdd('0x11'),_0x41ac61,_0xd85c25[_0xbfdd('0x15')]['message']);return _0x4c71be(_0xd85c25[_0xbfdd('0x15')]['message']);}else{logger[_0xbfdd('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x41ac61,_0xbfdd('0x12'));_0x4c71be(_0xd85c25['result'][_0xbfdd('0x16')]);}})[_0xbfdd('0x17')](function(_0x1ff42a){logger[_0xbfdd('0x15')](_0xbfdd('0x11'),_0x41ac61,_0x1ff42a);_0xc23116(_0x1ff42a);});});}exports[_0xbfdd('0x18')]=function(_0x2947ff){var _0x186d45=this;return new Promise(function(_0x257861,_0x461b4f){return db['SmsInteraction'][_0xbfdd('0x19')](_0x2947ff[_0xbfdd('0x1a')],{'raw':_0x2947ff[_0xbfdd('0x1b')]?_0x2947ff['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2947ff[_0xbfdd('0x1b')]?_0x2947ff[_0xbfdd('0x1b')][_0xbfdd('0x1c')]||null:null,'attributes':_0x2947ff[_0xbfdd('0x1b')]?_0x2947ff[_0xbfdd('0x1b')][_0xbfdd('0x1d')]||null:null,'limit':_0x2947ff[_0xbfdd('0x1b')]?_0x2947ff[_0xbfdd('0x1b')][_0xbfdd('0x1e')]||null:null})['then'](function(_0x175a85){logger[_0xbfdd('0x10')](_0xbfdd('0x18'),_0x2947ff);logger['debug'](_0xbfdd('0x18'),_0x2947ff,JSON[_0xbfdd('0x14')](_0x175a85));_0x257861(_0x175a85);})[_0xbfdd('0x17')](function(_0x102271){logger[_0xbfdd('0x15')](_0xbfdd('0x18'),_0x102271[_0xbfdd('0x16')],_0x2947ff);_0x461b4f(_0x186d45['error'](0x1f4,_0x102271['message']));});});};exports[_0xbfdd('0x1f')]=function(_0xab6add){return new Promise(function(_0x359755,_0x17ae10){return db['SmsInteraction']['find']({'where':_0xab6add[_0xbfdd('0x1b')]?_0xab6add[_0xbfdd('0x1b')]['where']||null:null})[_0xbfdd('0xf')](function(_0x3aec62){if(_0x3aec62){return _0x3aec62[_0xbfdd('0x20')](_0xab6add[_0xbfdd('0x1a')][_0xbfdd('0x21')],_[_0xbfdd('0x22')](_0xab6add[_0xbfdd('0x1a')],[_0xbfdd('0x21'),'id'])||{});}})[_0xbfdd('0x23')](function(_0x16c4e0){logger['info'](_0xbfdd('0x24'),_0xab6add);logger[_0xbfdd('0x13')]('AddTags',_0xab6add,JSON[_0xbfdd('0x14')](_0x16c4e0));_0x359755(_0x16c4e0);})[_0xbfdd('0x17')](function(_0x59e028){logger[_0xbfdd('0x15')](_0xbfdd('0x24'),_0x59e028['message'],_0xab6add);_0x17ae10(_this[_0xbfdd('0x15')](0x1f4,_0x59e028['message']));});});}; \ No newline at end of file +var _0xa13b=['bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','debug','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','util'];(function(_0x18d187,_0x1b3eb9){var _0x5184b1=function(_0x1f1628){while(--_0x1f1628){_0x18d187['push'](_0x18d187['shift']());}};_0x5184b1(++_0x1b3eb9);}(_0xa13b,0x155));var _0xba13=function(_0x339854,_0x5cae3f){_0x339854=_0x339854-0x0;var _0x4b10aa=_0xa13b[_0x339854];return _0x4b10aa;};'use strict';var _=require('lodash');var util=require(_0xba13('0x0'));var moment=require('moment');var BPromise=require(_0xba13('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba13('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xba13('0x3'));var config=require(_0xba13('0x4'));var jayson=require(_0xba13('0x5'));var client=jayson[_0xba13('0x6')][_0xba13('0x7')]({'port':0x232a});config[_0xba13('0x8')]=_[_0xba13('0x9')](config['redis'],{'host':_0xba13('0xa'),'port':0x18eb});var socket=require(_0xba13('0xb'))(new Redis(config[_0xba13('0x8')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x20627,_0x1b105b,_0xd49130){return new BPromise(function(_0x5c9dea,_0x283a34){return client[_0xba13('0xc')](_0x20627,_0xd49130)[_0xba13('0xd')](function(_0x55d3e3){logger[_0xba13('0xe')](_0xba13('0xf'),_0x1b105b,'request\x20sent');logger['debug'](_0xba13('0x10'),_0x1b105b,_0xba13('0x11'),JSON[_0xba13('0x12')](_0x55d3e3));if(_0x55d3e3[_0xba13('0x13')]){if(_0x55d3e3[_0xba13('0x13')][_0xba13('0x14')]===0x1f4){logger[_0xba13('0x13')](_0xba13('0xf'),_0x1b105b,_0x55d3e3[_0xba13('0x13')]['message']);return _0x283a34(_0x55d3e3[_0xba13('0x13')]['message']);}logger[_0xba13('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x1b105b,_0x55d3e3[_0xba13('0x13')][_0xba13('0x15')]);return _0x5c9dea(_0x55d3e3[_0xba13('0x13')][_0xba13('0x15')]);}else{logger['info'](_0xba13('0xf'),_0x1b105b,'request\x20sent');_0x5c9dea(_0x55d3e3[_0xba13('0x16')][_0xba13('0x15')]);}})[_0xba13('0x17')](function(_0x594dba){logger[_0xba13('0x13')](_0xba13('0xf'),_0x1b105b,_0x594dba);_0x283a34(_0x594dba);});});}exports[_0xba13('0x18')]=function(_0x7f21ab){var _0xe415ce=this;return new Promise(function(_0x10b163,_0x33df06){return db[_0xba13('0x19')][_0xba13('0x1a')](_0x7f21ab[_0xba13('0x1b')],{'raw':_0x7f21ab['options']?_0x7f21ab[_0xba13('0x1c')][_0xba13('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7f21ab[_0xba13('0x1c')]?_0x7f21ab[_0xba13('0x1c')][_0xba13('0x1e')]||null:null,'attributes':_0x7f21ab[_0xba13('0x1c')]?_0x7f21ab[_0xba13('0x1c')]['attributes']||null:null,'limit':_0x7f21ab[_0xba13('0x1c')]?_0x7f21ab[_0xba13('0x1c')]['limit']||null:null})[_0xba13('0xd')](function(_0x461564){logger[_0xba13('0xe')](_0xba13('0x18'),_0x7f21ab);logger[_0xba13('0x1f')](_0xba13('0x18'),_0x7f21ab,JSON[_0xba13('0x12')](_0x461564));_0x10b163(_0x461564);})[_0xba13('0x17')](function(_0x7dceae){logger[_0xba13('0x13')]('UpdateSmsInteraction',_0x7dceae['message'],_0x7f21ab);_0x33df06(_0xe415ce['error'](0x1f4,_0x7dceae[_0xba13('0x15')]));});});};exports[_0xba13('0x20')]=function(_0xa6427f){return new Promise(function(_0x29d6b7,_0x280fd6){return db[_0xba13('0x19')][_0xba13('0x21')]({'where':_0xa6427f[_0xba13('0x1c')]?_0xa6427f[_0xba13('0x1c')][_0xba13('0x1e')]||null:null})[_0xba13('0xd')](function(_0x4f3a67){if(_0x4f3a67){return _0x4f3a67[_0xba13('0x22')](_0xa6427f['body'][_0xba13('0x23')],_[_0xba13('0x24')](_0xa6427f[_0xba13('0x1b')],[_0xba13('0x23'),'id'])||{});}})['spread'](function(_0x4bad2c){logger['info'](_0xba13('0x25'),_0xa6427f);logger[_0xba13('0x1f')](_0xba13('0x25'),_0xa6427f,JSON[_0xba13('0x12')](_0x4bad2c));_0x29d6b7(_0x4bad2c);})[_0xba13('0x17')](function(_0x1fc04a){logger['error'](_0xba13('0x25'),_0x1fc04a['message'],_0xa6427f);_0x280fd6(_this[_0xba13('0x13')](0x1f4,_0x1fc04a[_0xba13('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index a737c41..84cec75 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 _0x0143=['emit','removeListener','register','length','./smsInteraction.events','save','remove','update'];(function(_0x3f9217,_0x5164fe){var _0x22f564=function(_0x3538e8){while(--_0x3538e8){_0x3f9217['push'](_0x3f9217['shift']());}};_0x22f564(++_0x5164fe);}(_0x0143,0x134));var _0x3014=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0143[_0x6c993a];return _0x27f547;};'use strict';var SmsInteractionEvents=require(_0x3014('0x0'));var events=[_0x3014('0x1'),_0x3014('0x2'),_0x3014('0x3')];function createListener(_0x2564b0,_0x28667e){return function(_0x4168d4){_0x28667e[_0x3014('0x4')](_0x2564b0,_0x4168d4);};}function removeListener(_0x3b7cb8,_0x29c8f0){return function(){SmsInteractionEvents[_0x3014('0x5')](_0x3b7cb8,_0x29c8f0);};}exports[_0x3014('0x6')]=function(_0x2e3b82){for(var _0x4021ae=0x0,_0x1b30e3=events[_0x3014('0x7')];_0x4021ae<_0x1b30e3;_0x4021ae++){var _0x184841=events[_0x4021ae];var _0x54bd90=createListener('smsInteraction:'+_0x184841,_0x2e3b82);SmsInteractionEvents['on'](_0x184841,_0x54bd90);}}; \ No newline at end of file +var _0x84a5=['./smsInteraction.events','save','remove','update','emit','register','smsInteraction:'];(function(_0xa50ca1,_0x32a16d){var _0x3c214f=function(_0x44fb31){while(--_0x44fb31){_0xa50ca1['push'](_0xa50ca1['shift']());}};_0x3c214f(++_0x32a16d);}(_0x84a5,0x118));var _0x584a=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x84a5[_0x819464];return _0x49dcc0;};'use strict';var SmsInteractionEvents=require(_0x584a('0x0'));var events=[_0x584a('0x1'),_0x584a('0x2'),_0x584a('0x3')];function createListener(_0x4b25e7,_0x216a5d){return function(_0x4cf100){_0x216a5d[_0x584a('0x4')](_0x4b25e7,_0x4cf100);};}function removeListener(_0x522033,_0x4d89a3){return function(){SmsInteractionEvents['removeListener'](_0x522033,_0x4d89a3);};}exports[_0x584a('0x5')]=function(_0x5e8da7){for(var _0x3caecc=0x0,_0x4e2978=events['length'];_0x3caecc<_0x4e2978;_0x3caecc++){var _0x388847=events[_0x3caecc];var _0x429a30=createListener(_0x584a('0x6')+_0x388847,_0x5e8da7);SmsInteractionEvents['on'](_0x388847,_0x429a30);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8fbc121..7e34fae 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 _0x5707=['create','status','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','smsmessage:create'];(function(_0x4bf77c,_0x53999d){var _0x5d73c5=function(_0xd6d705){while(--_0xd6d705){_0x4bf77c['push'](_0x4bf77c['shift']());}};_0x5d73c5(++_0x53999d);}(_0x5707,0x1b9));var _0x7570=function(_0x371d15,_0xd98587){_0x371d15=_0x371d15-0x0;var _0x32afdf=_0x5707[_0x371d15];return _0x32afdf;};'use strict';var multer=require(_0x7570('0x0'));var util=require('util');var path=require(_0x7570('0x1'));var timeout=require(_0x7570('0x2'));var express=require(_0x7570('0x3'));var router=express[_0x7570('0x4')]();var fs_extra=require(_0x7570('0x5'));var auth=require(_0x7570('0x6'));var interaction=require(_0x7570('0x7'));var config=require(_0x7570('0x8'));var controller=require(_0x7570('0x9'));router[_0x7570('0xa')]('/',auth[_0x7570('0xb')](),controller[_0x7570('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7570('0xd')]);router[_0x7570('0xa')](_0x7570('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x7570('0xf')]('/',auth[_0x7570('0xb')](),interaction[_0x7570('0x10')]('sms',_0x7570('0x11')),controller[_0x7570('0x12')]);router['post']('/:id/status',controller[_0x7570('0x13')]);router[_0x7570('0x14')](_0x7570('0xe'),auth['isAuthenticated'](),controller[_0x7570('0x15')]);router[_0x7570('0x14')](_0x7570('0x16'),auth[_0x7570('0xb')](),controller[_0x7570('0x17')]);router[_0x7570('0x14')]('/:id/reject',auth[_0x7570('0xb')](),controller[_0x7570('0x18')]);router['delete'](_0x7570('0xe'),auth[_0x7570('0xb')](),controller[_0x7570('0x19')]);module[_0x7570('0x1a')]=router; \ No newline at end of file +var _0x6c3c=['delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','describe','show','tracked','smsmessage:create','create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6c3c,0x110));var _0xc6c3=function(_0xde2139,_0x1e53f2){_0xde2139=_0xde2139-0x0;var _0x15f86c=_0x6c3c[_0xde2139];return _0x15f86c;};'use strict';var multer=require(_0xc6c3('0x0'));var util=require(_0xc6c3('0x1'));var path=require('path');var timeout=require(_0xc6c3('0x2'));var express=require(_0xc6c3('0x3'));var router=express['Router']();var fs_extra=require(_0xc6c3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc6c3('0x5'));var config=require('../../config/environment');var controller=require(_0xc6c3('0x6'));router[_0xc6c3('0x7')]('/',auth[_0xc6c3('0x8')](),controller[_0xc6c3('0x9')]);router[_0xc6c3('0x7')]('/describe',auth[_0xc6c3('0x8')](),controller[_0xc6c3('0xa')]);router[_0xc6c3('0x7')]('/:id',auth[_0xc6c3('0x8')](),controller[_0xc6c3('0xb')]);router['post']('/',auth[_0xc6c3('0x8')](),interaction[_0xc6c3('0xc')]('sms',_0xc6c3('0xd')),controller[_0xc6c3('0xe')]);router[_0xc6c3('0xf')](_0xc6c3('0x10'),controller[_0xc6c3('0x11')]);router[_0xc6c3('0x12')](_0xc6c3('0x13'),auth[_0xc6c3('0x8')](),controller[_0xc6c3('0x14')]);router['put'](_0xc6c3('0x15'),auth[_0xc6c3('0x8')](),controller[_0xc6c3('0x16')]);router[_0xc6c3('0x12')](_0xc6c3('0x17'),auth[_0xc6c3('0x8')](),controller[_0xc6c3('0x18')]);router[_0xc6c3('0x19')](_0xc6c3('0x13'),auth[_0xc6c3('0x8')](),controller[_0xc6c3('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index d9c4850..737f92d 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 _0xde64=['BOOLEAN','ENUM','out','STRING','sequelize','exports','TEXT','medium'];(function(_0x18c8b8,_0x3429bd){var _0x5a7d1d=function(_0x46eaba){while(--_0x46eaba){_0x18c8b8['push'](_0x18c8b8['shift']());}};_0x5a7d1d(++_0x3429bd);}(_0xde64,0x17c));var _0x4de6=function(_0x3fa039,_0x21e56a){_0x3fa039=_0x3fa039-0x0;var _0x57f3e3=_0xde64[_0x3fa039];return _0x57f3e3;};'use strict';var Sequelize=require(_0x4de6('0x0'));module[_0x4de6('0x1')]={'body':{'type':Sequelize[_0x4de6('0x2')](_0x4de6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x4de6('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4de6('0x5')]('in','out'),'defaultValue':_0x4de6('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4de6('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x4de6('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4de6('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xa991=['out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x262baa,_0x283058){var _0x4f2257=function(_0x2cd1c6){while(--_0x2cd1c6){_0x262baa['push'](_0x262baa['shift']());}};_0x4f2257(++_0x283058);}(_0xa991,0x143));var _0x1a99=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xa991[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0x1a99('0x0'));module['exports']={'body':{'type':Sequelize[_0x1a99('0x1')](_0x1a99('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1a99('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1a99('0x4')]('in',_0x1a99('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1a99('0x6')](0xbe)},'phone':{'type':Sequelize[_0x1a99('0x6')]},'readAt':{'type':Sequelize[_0x1a99('0x7')]},'secret':{'type':Sequelize[_0x1a99('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1a99('0x6')]},'providerResponse':{'type':Sequelize[_0x1a99('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 39e1231..dd26818 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 _0x2dd8=['contact','User','agent','fullname','email','internal','SIP/%s','motionChannel','channel','event','accept','EventManager','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','interface','rejectmessage','SmsAccount','SmsAccountId','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','destroy','stack','name','send','map','SmsMessage','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','include','rows','params','find','create','body','update','describe','sms','readAt','format','UserId','get','SmsInteraction','SmsInteractionId','isNil','user','interaction','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x2dd8,0x143));var _0x82dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dd8[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x82dd('0x0'));var rimraf=require(_0x82dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x82dd('0x2'));var moment=require(_0x82dd('0x3'));var BPromise=require(_0x82dd('0x4'));var Mustache=require(_0x82dd('0x5'));var util=require(_0x82dd('0x6'));var path=require(_0x82dd('0x7'));var sox=require(_0x82dd('0x8'));var csv=require('to-csv');var ejs=require(_0x82dd('0x9'));var fs=require('fs');var fs_extra=require(_0x82dd('0xa'));var _=require(_0x82dd('0xb'));var squel=require(_0x82dd('0xc'));var crypto=require('crypto');var jsforce=require(_0x82dd('0xd'));var deskjs=require(_0x82dd('0xe'));var toCsv=require(_0x82dd('0xf'));var querystring=require(_0x82dd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82dd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82dd('0x12'));var hardwareService=require(_0x82dd('0x13'));var logger=require(_0x82dd('0x14'))(_0x82dd('0x15'));var utils=require(_0x82dd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x82dd('0x17'));var db=require(_0x82dd('0x18'))['db'];config[_0x82dd('0x19')]=_[_0x82dd('0x1a')](config[_0x82dd('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82dd('0x19')]));require(_0x82dd('0x1b'))[_0x82dd('0x1c')](socket);var jayson=require(_0x82dd('0x1d'));var client=jayson[_0x82dd('0x1e')][_0x82dd('0x1f')]({'port':0x232c});var client9002=jayson[_0x82dd('0x1e')][_0x82dd('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x101eb7,_0x1b90e0,_0x3d7664,_0x466fd3){return new BPromise(function(_0x1bdd14,_0x51d2a9){var _0x352400=_0x466fd3||client;return _0x352400[_0x82dd('0x20')](_0x101eb7,_0x3d7664)[_0x82dd('0x21')](function(_0x40a47a){logger[_0x82dd('0x22')](_0x82dd('0x23'),_0x1b90e0,_0x82dd('0x24'));logger[_0x82dd('0x25')](_0x82dd('0x26'),_0x1b90e0,_0x82dd('0x24'),JSON[_0x82dd('0x27')](_0x40a47a));if(_0x40a47a[_0x82dd('0x28')]){if(_0x40a47a[_0x82dd('0x28')]['code']===0x1f4){logger[_0x82dd('0x28')](_0x82dd('0x23'),_0x1b90e0,_0x40a47a[_0x82dd('0x28')][_0x82dd('0x29')]);return _0x51d2a9(_0x40a47a[_0x82dd('0x28')][_0x82dd('0x29')]);}logger[_0x82dd('0x28')](_0x82dd('0x23'),_0x1b90e0,_0x40a47a['error']['message']);return _0x1bdd14(_0x40a47a[_0x82dd('0x28')][_0x82dd('0x29')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x1b90e0,_0x82dd('0x24'));_0x1bdd14(_0x40a47a[_0x82dd('0x2a')][_0x82dd('0x29')]);}})[_0x82dd('0x2b')](function(_0x4609c1){logger[_0x82dd('0x28')](_0x82dd('0x23'),_0x1b90e0,_0x4609c1);_0x51d2a9(_0x4609c1);});});}function respondWithStatusCode(_0x1374e3,_0x1ae382){_0x1ae382=_0x1ae382||0xcc;return function(_0x1d27f1){if(_0x1d27f1){return _0x1374e3[_0x82dd('0x2c')](_0x1ae382);}return _0x1374e3[_0x82dd('0x2d')](_0x1ae382)[_0x82dd('0x2e')]();};}function respondWithResult(_0x242e59,_0x5543c2){_0x5543c2=_0x5543c2||0xc8;return function(_0x17531e){if(_0x17531e){return _0x242e59[_0x82dd('0x2d')](_0x5543c2)[_0x82dd('0x2f')](_0x17531e);}};}function respondWithFilteredResult(_0x53965f,_0x15da13){return function(_0x5238a2){if(_0x5238a2){var _0x15f31f=typeof _0x15da13[_0x82dd('0x30')]===_0x82dd('0x31')&&typeof _0x15da13['limit']===_0x82dd('0x31');var _0x212720=_0x5238a2['count'];var _0x5cfdee=_0x15f31f?0x0:_0x15da13[_0x82dd('0x30')];var _0x3ae12a=_0x15f31f?_0x5238a2['count']:_0x15da13[_0x82dd('0x30')]+_0x15da13[_0x82dd('0x32')];var _0x2d2b7b;if(_0x3ae12a>=_0x212720){_0x3ae12a=_0x212720;_0x2d2b7b=0xc8;}else{_0x2d2b7b=0xce;}_0x53965f['status'](_0x2d2b7b);return _0x53965f[_0x82dd('0x33')](_0x82dd('0x34'),_0x5cfdee+'-'+_0x3ae12a+'/'+_0x212720)['json'](_0x5238a2);}return null;};}function patchUpdates(_0x571cfb){return function(_0x1b3c04){try{jsonpatch[_0x82dd('0x35')](_0x1b3c04,_0x571cfb,!![]);}catch(_0x50d230){return BPromise[_0x82dd('0x36')](_0x50d230);}return _0x1b3c04[_0x82dd('0x37')]();};}function saveUpdates(_0xac506c,_0x5af437){return function(_0x31e34c){if(_0x31e34c){return _0x31e34c['update'](_0xac506c)[_0x82dd('0x21')](function(_0x140d7b){return _0x140d7b;});}return null;};}function removeEntity(_0x4bec1e,_0x304284){return function(_0x40998a){if(_0x40998a){return _0x40998a[_0x82dd('0x38')]()[_0x82dd('0x21')](function(){_0x4bec1e['status'](0xcc)[_0x82dd('0x2e')]();});}};}function handleEntityNotFound(_0x2605f6,_0x38bbc9){return function(_0x2f57d9){if(!_0x2f57d9){_0x2605f6[_0x82dd('0x2c')](0x194);}return _0x2f57d9;};}function handleError(_0x24e0c5,_0x2b9c94){_0x2b9c94=_0x2b9c94||0x1f4;return function(_0x9173c8){logger['error'](_0x9173c8[_0x82dd('0x39')]);if(_0x9173c8['name']){delete _0x9173c8[_0x82dd('0x3a')];}_0x24e0c5[_0x82dd('0x2d')](_0x2b9c94)[_0x82dd('0x3b')](_0x9173c8);};}exports['index']=function(_0x26f682,_0x457d44){var _0x1517d8={},_0x2608ef={},_0x47dcb3={'count':0x0,'rows':[]};var _0x5e6d7e=_[_0x82dd('0x3c')](db[_0x82dd('0x3d')][_0x82dd('0x3e')],function(_0x19c736){return{'name':_0x19c736['fieldName'],'type':_0x19c736['type'][_0x82dd('0x3f')]};});_0x2608ef[_0x82dd('0x40')]=_['map'](_0x5e6d7e,_0x82dd('0x3a'));_0x2608ef[_0x82dd('0x41')]=_[_0x82dd('0x42')](_0x26f682[_0x82dd('0x41')]);_0x2608ef[_0x82dd('0x43')]=_[_0x82dd('0x44')](_0x2608ef[_0x82dd('0x40')],_0x2608ef[_0x82dd('0x41')]);_0x1517d8[_0x82dd('0x45')]=_[_0x82dd('0x44')](_0x2608ef[_0x82dd('0x40')],qs[_0x82dd('0x46')](_0x26f682[_0x82dd('0x41')][_0x82dd('0x46')]));_0x1517d8[_0x82dd('0x45')]=_0x1517d8[_0x82dd('0x45')][_0x82dd('0x47')]?_0x1517d8[_0x82dd('0x45')]:_0x2608ef[_0x82dd('0x40')];if(!_0x26f682['query'][_0x82dd('0x48')]('nolimit')){_0x1517d8['limit']=qs[_0x82dd('0x32')](_0x26f682[_0x82dd('0x41')][_0x82dd('0x32')]);_0x1517d8['offset']=qs[_0x82dd('0x30')](_0x26f682[_0x82dd('0x41')][_0x82dd('0x30')]);}_0x1517d8[_0x82dd('0x49')]=qs[_0x82dd('0x4a')](_0x26f682[_0x82dd('0x41')]['sort']);_0x1517d8[_0x82dd('0x4b')]=qs[_0x82dd('0x43')](_[_0x82dd('0x4c')](_0x26f682[_0x82dd('0x41')],_0x2608ef[_0x82dd('0x43')]),_0x5e6d7e);if(_0x26f682['query'][_0x82dd('0x4d')]){_0x1517d8[_0x82dd('0x4b')]=_['merge'](_0x1517d8[_0x82dd('0x4b')],{'$or':_[_0x82dd('0x3c')](_0x5e6d7e,function(_0x1ed29a){if(_0x1ed29a[_0x82dd('0x4e')]!==_0x82dd('0x4f')){var _0x3d5606={};_0x3d5606[_0x1ed29a['name']]={'$like':'%'+_0x26f682[_0x82dd('0x41')][_0x82dd('0x4d')]+'%'};return _0x3d5606;}})});}_0x1517d8=_[_0x82dd('0x50')]({},_0x1517d8,_0x26f682[_0x82dd('0x51')]);var _0x4de57f={'where':_0x1517d8[_0x82dd('0x4b')]};return db[_0x82dd('0x3d')][_0x82dd('0x52')](_0x4de57f)['then'](function(_0x5e8a07){_0x47dcb3[_0x82dd('0x52')]=_0x5e8a07;if(_0x26f682[_0x82dd('0x41')][_0x82dd('0x53')]){_0x1517d8[_0x82dd('0x54')]=[{'all':!![]}];}return db[_0x82dd('0x3d')]['findAll'](_0x1517d8);})['then'](function(_0x47389c){_0x47dcb3[_0x82dd('0x55')]=_0x47389c;return _0x47dcb3;})['then'](respondWithFilteredResult(_0x457d44,_0x1517d8))['catch'](handleError(_0x457d44,null));};exports['show']=function(_0x676ebd,_0x489f38){var _0x2805a0={'raw':!![],'where':{'id':_0x676ebd[_0x82dd('0x56')]['id']}},_0x4b269f={};_0x4b269f[_0x82dd('0x40')]=_[_0x82dd('0x42')](db[_0x82dd('0x3d')][_0x82dd('0x3e')]);_0x4b269f[_0x82dd('0x41')]=_[_0x82dd('0x42')](_0x676ebd['query']);_0x4b269f[_0x82dd('0x43')]=_[_0x82dd('0x44')](_0x4b269f[_0x82dd('0x40')],_0x4b269f[_0x82dd('0x41')]);_0x2805a0[_0x82dd('0x45')]=_[_0x82dd('0x44')](_0x4b269f[_0x82dd('0x40')],qs[_0x82dd('0x46')](_0x676ebd['query'][_0x82dd('0x46')]));_0x2805a0[_0x82dd('0x45')]=_0x2805a0[_0x82dd('0x45')][_0x82dd('0x47')]?_0x2805a0[_0x82dd('0x45')]:_0x4b269f[_0x82dd('0x40')];if(_0x676ebd[_0x82dd('0x41')]['includeAll']){_0x2805a0[_0x82dd('0x54')]=[{'all':!![]}];}_0x2805a0=_[_0x82dd('0x50')]({},_0x2805a0,_0x676ebd['options']);return db[_0x82dd('0x3d')][_0x82dd('0x57')](_0x2805a0)[_0x82dd('0x21')](handleEntityNotFound(_0x489f38,null))['then'](respondWithResult(_0x489f38,null))[_0x82dd('0x2b')](handleError(_0x489f38,null));};exports['create']=function(_0x4707a1,_0x12b7a0){return db[_0x82dd('0x3d')][_0x82dd('0x58')](_0x4707a1[_0x82dd('0x59')],{})[_0x82dd('0x21')](respondWithResult(_0x12b7a0,0xc9))[_0x82dd('0x2b')](handleError(_0x12b7a0,null));};exports[_0x82dd('0x5a')]=function(_0x186db4,_0x4d00e5){if(_0x186db4[_0x82dd('0x59')]['id']){delete _0x186db4[_0x82dd('0x59')]['id'];}return db[_0x82dd('0x3d')]['find']({'where':{'id':_0x186db4[_0x82dd('0x56')]['id']}})[_0x82dd('0x21')](handleEntityNotFound(_0x4d00e5,null))[_0x82dd('0x21')](saveUpdates(_0x186db4[_0x82dd('0x59')],null))['then'](respondWithResult(_0x4d00e5,null))[_0x82dd('0x2b')](handleError(_0x4d00e5,null));};exports[_0x82dd('0x38')]=function(_0x20110c,_0x249272){return db[_0x82dd('0x3d')][_0x82dd('0x57')]({'where':{'id':_0x20110c['params']['id']}})[_0x82dd('0x21')](handleEntityNotFound(_0x249272,null))[_0x82dd('0x21')](removeEntity(_0x249272,null))[_0x82dd('0x2b')](handleError(_0x249272,null));};exports[_0x82dd('0x5b')]=function(_0x493000,_0x29afdf){return db['SmsMessage'][_0x82dd('0x5b')]()[_0x82dd('0x21')](respondWithResult(_0x29afdf,null))['catch'](handleError(_0x29afdf,null));};var interaction_log=require(_0x82dd('0x14'))('sms-interactions');exports['accept']=function(_0x33854f,_0x48d67c,_0x3265f7){var _0x5b3581={'agent':{},'channel':_0x82dd('0x5c')};if(_0x33854f[_0x82dd('0x59')]['id']){delete _0x33854f['body']['id'];}_0x33854f['body']['read']=!![];_0x33854f[_0x82dd('0x59')][_0x82dd('0x5d')]=moment()[_0x82dd('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x33854f[_0x82dd('0x59')][_0x82dd('0x5f')]=_0x33854f['body'][_0x82dd('0x5f')]||_0x33854f['user']['id'];_0x5b3581['agent']['id']=_0x33854f[_0x82dd('0x59')]['UserId'];return db[_0x82dd('0x3d')]['find']({'where':{'id':_0x33854f[_0x82dd('0x56')]['id'],'UserId':null}})[_0x82dd('0x21')](handleEntityNotFound(_0x48d67c,null))['then'](saveUpdates(_0x33854f[_0x82dd('0x59')],null))['then'](function(_0x1d22a9){if(_0x1d22a9){_0x5b3581[_0x82dd('0x29')]=_0x1d22a9[_0x82dd('0x60')]({'plain':!![]});return db[_0x82dd('0x61')][_0x82dd('0x57')]({'where':{'id':_0x1d22a9[_0x82dd('0x62')]}});}return null;})[_0x82dd('0x21')](handleEntityNotFound(_0x48d67c,null))[_0x82dd('0x21')](function(_0x403c52){if(_0x403c52){return _0x403c52['update']({'UserId':_0x33854f['body'][_0x82dd('0x5f')],'read1stAt':_[_0x82dd('0x63')](_0x403c52['read1stAt'])?moment()[_0x82dd('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x82dd('0x21')](function(_0x13b0be){if(_0x13b0be){_0x5b3581['interaction']=_0x13b0be[_0x82dd('0x60')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x33854f[_0x82dd('0x64')]['id'],_0x33854f[_0x82dd('0x64')][_0x82dd('0x3a')],_0x33854f[_0x82dd('0x64')]['role'],_0x5b3581[_0x82dd('0x65')]['id'],_0x33854f[_0x82dd('0x59')]?JSON['stringify'](_0x33854f[_0x82dd('0x59')]):_0x82dd('0x66'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5b3581);}return null;})[_0x82dd('0x21')](function(_0x559404){var _0x22f52f=_0x82dd('0x67')+_0x559404[_0x82dd('0x29')][_0x82dd('0x68')];return db[_0x82dd('0x69')][_0x82dd('0x41')](_0x22f52f,{'type':db[_0x82dd('0x6a')][_0x82dd('0x6b')][_0x82dd('0x6c')],'raw':!![]})[_0x82dd('0x21')](function(_0x2683c9){return _0x2683c9;});})[_0x82dd('0x21')](function(_0xb7d43e){if(_0xb7d43e){_0x5b3581[_0x82dd('0x29')][_0x82dd('0x6d')]=_0xb7d43e[0x0];if(!_0x33854f[_0x82dd('0x59')][_0x82dd('0x5f')])return;return db[_0x82dd('0x6e')][_0x82dd('0x57')]({'where':{'id':_0x33854f[_0x82dd('0x59')][_0x82dd('0x5f')],'role':_0x82dd('0x6f')},'attributes':['id','name',_0x82dd('0x70'),_0x82dd('0x71'),_0x82dd('0x72')],'raw':!![]});}return null;})[_0x82dd('0x21')](function(_0x24c8e0){if(!_0x24c8e0)return null;_0x5b3581['message'][_0x82dd('0x6f')]=_0x24c8e0;return _0x5b3581;})[_0x82dd('0x21')](function(_0x42abd2){if(_0x42abd2){if(_0x33854f[_0x82dd('0x59')]['manual']){_0x5b3581['message']['interface']=util[_0x82dd('0x5e')](_0x82dd('0x73'),_0x33854f[_0x82dd('0x64')][_0x82dd('0x3a')]);_0x5b3581[_0x82dd('0x29')]['channel']=_0x5b3581['channel'];_0x5b3581[_0x82dd('0x29')][_0x82dd('0x74')]=_0x5b3581[_0x82dd('0x75')];_0x5b3581['message'][_0x82dd('0x76')]=_0x82dd('0x77');return respondWithRpcPromise(_0x82dd('0x78'),_0x82dd('0x78'),{'event':'acceptmessage','message':_0x5b3581[_0x82dd('0x29')]},client9002)[_0x82dd('0x21')](function(){return _0x5b3581;});}return _0x5b3581;}return null;})[_0x82dd('0x21')](respondWithResult(_0x48d67c,null))[_0x82dd('0x2b')](handleError(_0x48d67c,null));};var interaction_log=require(_0x82dd('0x14'))(_0x82dd('0x79'));exports['reject']=function(_0x2d7aec,_0x5398da,_0x356954){var _0x586160={'agent':{},'channel':_0x82dd('0x5c')};if(_0x2d7aec[_0x82dd('0x59')]['id']){delete _0x2d7aec['body']['id'];}_0x2d7aec['body'][_0x82dd('0x5f')]=_0x2d7aec[_0x82dd('0x59')]['UserId']||_0x2d7aec[_0x82dd('0x64')]['id'];_0x586160[_0x82dd('0x6f')]['id']=_0x2d7aec['body'][_0x82dd('0x5f')];return db[_0x82dd('0x3d')][_0x82dd('0x57')]({'where':{'id':_0x2d7aec[_0x82dd('0x56')]['id'],'UserId':null}})[_0x82dd('0x21')](handleEntityNotFound(_0x5398da,null))[_0x82dd('0x21')](function(_0x37c65b){if(_0x37c65b){_0x586160[_0x82dd('0x29')]=_0x37c65b[_0x82dd('0x60')]({'plain':!![]});return db[_0x82dd('0x61')][_0x82dd('0x57')]({'where':{'id':_0x37c65b[_0x82dd('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x5398da,null))[_0x82dd('0x21')](function(_0xc39215){if(_0xc39215){_0x586160['interaction']=_0xc39215['get']({'plain':!![]});interaction_log['info'](_0x82dd('0x7a'),_0x2d7aec[_0x82dd('0x64')]['id'],_0x2d7aec[_0x82dd('0x64')][_0x82dd('0x3a')],_0x2d7aec[_0x82dd('0x64')]['role'],_0x586160[_0x82dd('0x65')]['id'],_0x2d7aec[_0x82dd('0x59')]?JSON['stringify'](_0x2d7aec['body']):_0x82dd('0x66'));return respondWithRpcPromise('RejectMessage',_0x82dd('0x7b'),_0x586160);}return null;})['then'](function(_0x4bd420){var _0x5b4613='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4bd420[_0x82dd('0x29')][_0x82dd('0x68')];return db['sequelize']['query'](_0x5b4613,{'type':db[_0x82dd('0x6a')][_0x82dd('0x6b')][_0x82dd('0x6c')],'raw':!![]})['then'](function(_0x2770eb){return _0x2770eb;});})[_0x82dd('0x21')](function(_0x183d04){if(_0x183d04){_0x586160[_0x82dd('0x29')][_0x82dd('0x6d')]=_0x183d04[0x0];if(!_0x2d7aec[_0x82dd('0x59')][_0x82dd('0x5f')])return;return db[_0x82dd('0x6e')]['find']({'where':{'id':_0x2d7aec['body'][_0x82dd('0x5f')],'role':_0x82dd('0x6f')},'attributes':['id',_0x82dd('0x3a'),_0x82dd('0x70'),_0x82dd('0x71'),'internal'],'raw':!![]});}return null;})[_0x82dd('0x21')](function(_0x33c16a){if(!_0x33c16a)return null;_0x586160[_0x82dd('0x29')]['agent']=_0x33c16a;return _0x586160;})['then'](function(_0x49360b){if(_0x49360b){_0x49360b[_0x82dd('0x29')][_0x82dd('0x7c')]=util[_0x82dd('0x5e')]('SIP/%s',_0x2d7aec[_0x82dd('0x64')]['name']);_0x49360b[_0x82dd('0x29')][_0x82dd('0x75')]=_0x586160['channel'];_0x49360b[_0x82dd('0x29')][_0x82dd('0x74')]=_0x586160[_0x82dd('0x75')];_0x49360b[_0x82dd('0x29')]['event']='reject';respondWithRpcPromise('EventManager',_0x82dd('0x78'),{'event':_0x82dd('0x7d'),'message':_0x49360b[_0x82dd('0x29')]},client9002);return _0x586160;}return null;})[_0x82dd('0x21')](respondWithResult(_0x5398da,null))[_0x82dd('0x2b')](handleError(_0x5398da,null));};exports[_0x82dd('0x2d')]=function(_0x4a1599,_0x30db33,_0x3f1f41){if(_0x4a1599[_0x82dd('0x59')]['id']){delete _0x4a1599[_0x82dd('0x59')]['id'];}var _0x4db1b9;return db[_0x82dd('0x3d')][_0x82dd('0x57')]({'where':{'id':_0x4a1599[_0x82dd('0x56')]['id']}})[_0x82dd('0x21')](handleEntityNotFound(_0x30db33,null))['then'](function(_0x1f4781){if(_0x1f4781){_0x4db1b9=_0x1f4781;return db[_0x82dd('0x7e')]['find']({'where':{'id':_0x1f4781[_0x82dd('0x7f')]}});}})[_0x82dd('0x21')](handleEntityNotFound(_0x30db33,null))[_0x82dd('0x21')](function(_0x1e4dd0){if(_0x1e4dd0){logger[_0x82dd('0x25')](_0x82dd('0x26'),'status','received\x20delivery\x20report\x20from',_0x1e4dd0['type'],util['inspect'](_0x4a1599['body'],{'showHidden':![],'depth':null}));switch(_0x1e4dd0['type']){case _0x82dd('0x80'):if(_0x4a1599[_0x82dd('0x59')][_0x82dd('0x81')]&&_0x4a1599['body'][_0x82dd('0x81')]===_0x4db1b9[_0x82dd('0x82')]){return _0x4db1b9[_0x82dd('0x5a')]({'read':!![]});}else{logger[_0x82dd('0x28')](_0x82dd('0x83'),_0x82dd('0x2d'),_0x82dd('0x80'),util[_0x82dd('0x84')](_0x4a1599[_0x82dd('0x59')],{'showHidden':![],'depth':null}));}break;case _0x82dd('0x85'):if(_0x4a1599[_0x82dd('0x59')][_0x82dd('0x86')]&&_0x4a1599['body'][_0x82dd('0x86')]===_0x4db1b9[_0x82dd('0x82')]&&_[_0x82dd('0x87')]([_0x82dd('0x88'),_0x82dd('0x89')],_0x4a1599['body'][_0x82dd('0x8a')])>=0x0){return _0x4db1b9[_0x82dd('0x5a')]({'read':!![]});}else{logger[_0x82dd('0x28')](_0x82dd('0x83'),_0x82dd('0x2d'),_0x82dd('0x8b'),util[_0x82dd('0x84')](_0x4a1599[_0x82dd('0x59')],{'showHidden':![],'depth':null}));}break;case _0x82dd('0x8c'):var _0x21fcf9=_0x4a1599[_0x82dd('0x59')][_0x82dd('0x8d')][0x0];if(_0x21fcf9[_0x82dd('0x2d')][_0x82dd('0x8e')]===_0x82dd('0x8f')){return _0x4db1b9[_0x82dd('0x5a')]({'read':!![]});}else{logger[_0x82dd('0x28')](_0x82dd('0x83'),_0x82dd('0x2d'),_0x82dd('0x8c'),util[_0x82dd('0x84')](_0x4a1599[_0x82dd('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x4db1b9;}})[_0x82dd('0x21')](respondWithResult(_0x30db33,null))[_0x82dd('0x2b')](handleError(_0x30db33,null));}; \ No newline at end of file +var _0x2b59=['interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','internal','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','SmsMessage','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','options','includeAll','rows','catch','show','params','keys','include','merge','find','create','body','describe','accept','read','readAt','format','UserId','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual'];(function(_0x207bf2,_0x1f95d7){var _0x2689a2=function(_0x16f46f){while(--_0x16f46f){_0x207bf2['push'](_0x207bf2['shift']());}};_0x2689a2(++_0x1f95d7);}(_0x2b59,0x1de));var _0x92b5=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x2b59[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x92b5('0x0'));var rimraf=require(_0x92b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x92b5('0x2'));var moment=require(_0x92b5('0x3'));var BPromise=require(_0x92b5('0x4'));var Mustache=require('mustache');var util=require(_0x92b5('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x92b5('0x6'));var ejs=require(_0x92b5('0x7'));var fs=require('fs');var fs_extra=require(_0x92b5('0x8'));var _=require(_0x92b5('0x9'));var squel=require(_0x92b5('0xa'));var crypto=require(_0x92b5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x92b5('0xc'));var toCsv=require(_0x92b5('0x6'));var querystring=require(_0x92b5('0xd'));var Papa=require('papaparse');var Redis=require(_0x92b5('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x92b5('0xf'));var as=require(_0x92b5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x92b5('0x11'))(_0x92b5('0x12'));var utils=require(_0x92b5('0x13'));var config=require(_0x92b5('0x14'));var licenseUtil=require(_0x92b5('0x15'));var db=require(_0x92b5('0x16'))['db'];config['redis']=_['defaults'](config[_0x92b5('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x92b5('0x18'))(new Redis(config[_0x92b5('0x17')]));require(_0x92b5('0x19'))['register'](socket);var jayson=require(_0x92b5('0x1a'));var client=jayson['client'][_0x92b5('0x1b')]({'port':0x232c});var client9002=jayson[_0x92b5('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x304bda,_0xb12c25,_0x283f6e,_0x3c6cbb){return new BPromise(function(_0x2355f4,_0x5005e9){var _0x2341eb=_0x3c6cbb||client;return _0x2341eb[_0x92b5('0x1d')](_0x304bda,_0x283f6e)[_0x92b5('0x1e')](function(_0xdd0f34){logger[_0x92b5('0x1f')](_0x92b5('0x20'),_0xb12c25,_0x92b5('0x21'));logger[_0x92b5('0x22')](_0x92b5('0x23'),_0xb12c25,_0x92b5('0x21'),JSON[_0x92b5('0x24')](_0xdd0f34));if(_0xdd0f34['error']){if(_0xdd0f34[_0x92b5('0x25')][_0x92b5('0x26')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0xb12c25,_0xdd0f34[_0x92b5('0x25')][_0x92b5('0x27')]);return _0x5005e9(_0xdd0f34[_0x92b5('0x25')]['message']);}logger[_0x92b5('0x25')]('SmsMessage,\x20%s,\x20%s',_0xb12c25,_0xdd0f34[_0x92b5('0x25')][_0x92b5('0x27')]);return _0x2355f4(_0xdd0f34[_0x92b5('0x25')]['message']);}else{logger[_0x92b5('0x1f')](_0x92b5('0x20'),_0xb12c25,_0x92b5('0x21'));_0x2355f4(_0xdd0f34[_0x92b5('0x28')][_0x92b5('0x27')]);}})['catch'](function(_0xdb8d9e){logger[_0x92b5('0x25')](_0x92b5('0x20'),_0xb12c25,_0xdb8d9e);_0x5005e9(_0xdb8d9e);});});}function respondWithStatusCode(_0x128d34,_0x3a92e0){_0x3a92e0=_0x3a92e0||0xcc;return function(_0x11f84a){if(_0x11f84a){return _0x128d34[_0x92b5('0x29')](_0x3a92e0);}return _0x128d34['status'](_0x3a92e0)[_0x92b5('0x2a')]();};}function respondWithResult(_0x3be293,_0x458756){_0x458756=_0x458756||0xc8;return function(_0x4cf2c4){if(_0x4cf2c4){return _0x3be293['status'](_0x458756)[_0x92b5('0x2b')](_0x4cf2c4);}};}function respondWithFilteredResult(_0x4139d3,_0x168c42){return function(_0x4a58a1){if(_0x4a58a1){var _0x47d10d=typeof _0x168c42[_0x92b5('0x2c')]===_0x92b5('0x2d')&&typeof _0x168c42[_0x92b5('0x2e')]===_0x92b5('0x2d');var _0x126bec=_0x4a58a1['count'];var _0x1ebf20=_0x47d10d?0x0:_0x168c42[_0x92b5('0x2c')];var _0x4a7a2e=_0x47d10d?_0x4a58a1[_0x92b5('0x2f')]:_0x168c42['offset']+_0x168c42['limit'];var _0x31e2cc;if(_0x4a7a2e>=_0x126bec){_0x4a7a2e=_0x126bec;_0x31e2cc=0xc8;}else{_0x31e2cc=0xce;}_0x4139d3[_0x92b5('0x30')](_0x31e2cc);return _0x4139d3['set'](_0x92b5('0x31'),_0x1ebf20+'-'+_0x4a7a2e+'/'+_0x126bec)[_0x92b5('0x2b')](_0x4a58a1);}return null;};}function patchUpdates(_0x41ab9a){return function(_0x1f5e95){try{jsonpatch[_0x92b5('0x32')](_0x1f5e95,_0x41ab9a,!![]);}catch(_0x12852f){return BPromise[_0x92b5('0x33')](_0x12852f);}return _0x1f5e95[_0x92b5('0x34')]();};}function saveUpdates(_0x9f506,_0x13dd2a){return function(_0x3eeac0){if(_0x3eeac0){return _0x3eeac0[_0x92b5('0x35')](_0x9f506)[_0x92b5('0x1e')](function(_0x36502d){return _0x36502d;});}return null;};}function removeEntity(_0x44b488,_0x3d5d1b){return function(_0x20963e){if(_0x20963e){return _0x20963e[_0x92b5('0x36')]()['then'](function(){_0x44b488[_0x92b5('0x30')](0xcc)[_0x92b5('0x2a')]();});}};}function handleEntityNotFound(_0x480a93,_0x4d2ec9){return function(_0x57c5d6){if(!_0x57c5d6){_0x480a93[_0x92b5('0x29')](0x194);}return _0x57c5d6;};}function handleError(_0x558c16,_0x1d589d){_0x1d589d=_0x1d589d||0x1f4;return function(_0x5f48e5){logger['error'](_0x5f48e5[_0x92b5('0x37')]);if(_0x5f48e5[_0x92b5('0x38')]){delete _0x5f48e5[_0x92b5('0x38')];}_0x558c16[_0x92b5('0x30')](_0x1d589d)['send'](_0x5f48e5);};}exports[_0x92b5('0x39')]=function(_0x55b8f9,_0x22338a){var _0x157323={},_0x279442={},_0x3850d2={'count':0x0,'rows':[]};var _0x375bbb=_[_0x92b5('0x3a')](db[_0x92b5('0x3b')]['rawAttributes'],function(_0x2c1b8f){return{'name':_0x2c1b8f['fieldName'],'type':_0x2c1b8f[_0x92b5('0x3c')][_0x92b5('0x3d')]};});_0x279442[_0x92b5('0x3e')]=_[_0x92b5('0x3a')](_0x375bbb,_0x92b5('0x38'));_0x279442[_0x92b5('0x3f')]=_['keys'](_0x55b8f9['query']);_0x279442['filters']=_[_0x92b5('0x40')](_0x279442['model'],_0x279442[_0x92b5('0x3f')]);_0x157323['attributes']=_['intersection'](_0x279442['model'],qs[_0x92b5('0x41')](_0x55b8f9[_0x92b5('0x3f')]['fields']));_0x157323[_0x92b5('0x42')]=_0x157323[_0x92b5('0x42')][_0x92b5('0x43')]?_0x157323['attributes']:_0x279442[_0x92b5('0x3e')];if(!_0x55b8f9[_0x92b5('0x3f')][_0x92b5('0x44')](_0x92b5('0x45'))){_0x157323[_0x92b5('0x2e')]=qs[_0x92b5('0x2e')](_0x55b8f9[_0x92b5('0x3f')][_0x92b5('0x2e')]);_0x157323[_0x92b5('0x2c')]=qs[_0x92b5('0x2c')](_0x55b8f9[_0x92b5('0x3f')][_0x92b5('0x2c')]);}_0x157323[_0x92b5('0x46')]=qs['sort'](_0x55b8f9[_0x92b5('0x3f')]['sort']);_0x157323[_0x92b5('0x47')]=qs[_0x92b5('0x48')](_[_0x92b5('0x49')](_0x55b8f9[_0x92b5('0x3f')],_0x279442[_0x92b5('0x48')]),_0x375bbb);if(_0x55b8f9[_0x92b5('0x3f')][_0x92b5('0x4a')]){_0x157323[_0x92b5('0x47')]=_['merge'](_0x157323[_0x92b5('0x47')],{'$or':_['map'](_0x375bbb,function(_0x57424d){if(_0x57424d[_0x92b5('0x3c')]!=='VIRTUAL'){var _0x424180={};_0x424180[_0x57424d['name']]={'$like':'%'+_0x55b8f9[_0x92b5('0x3f')][_0x92b5('0x4a')]+'%'};return _0x424180;}})});}_0x157323=_['merge']({},_0x157323,_0x55b8f9[_0x92b5('0x4b')]);var _0x4b6a15={'where':_0x157323[_0x92b5('0x47')]};return db[_0x92b5('0x3b')]['count'](_0x4b6a15)[_0x92b5('0x1e')](function(_0x5d400c){_0x3850d2[_0x92b5('0x2f')]=_0x5d400c;if(_0x55b8f9[_0x92b5('0x3f')][_0x92b5('0x4c')]){_0x157323['include']=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x157323);})[_0x92b5('0x1e')](function(_0x29da49){_0x3850d2[_0x92b5('0x4d')]=_0x29da49;return _0x3850d2;})[_0x92b5('0x1e')](respondWithFilteredResult(_0x22338a,_0x157323))[_0x92b5('0x4e')](handleError(_0x22338a,null));};exports[_0x92b5('0x4f')]=function(_0x4d8ae8,_0x147f73){var _0x2a9beb={'raw':!![],'where':{'id':_0x4d8ae8[_0x92b5('0x50')]['id']}},_0x41eea2={};_0x41eea2[_0x92b5('0x3e')]=_[_0x92b5('0x51')](db[_0x92b5('0x3b')]['rawAttributes']);_0x41eea2[_0x92b5('0x3f')]=_[_0x92b5('0x51')](_0x4d8ae8[_0x92b5('0x3f')]);_0x41eea2[_0x92b5('0x48')]=_[_0x92b5('0x40')](_0x41eea2[_0x92b5('0x3e')],_0x41eea2[_0x92b5('0x3f')]);_0x2a9beb[_0x92b5('0x42')]=_['intersection'](_0x41eea2['model'],qs[_0x92b5('0x41')](_0x4d8ae8[_0x92b5('0x3f')]['fields']));_0x2a9beb[_0x92b5('0x42')]=_0x2a9beb['attributes'][_0x92b5('0x43')]?_0x2a9beb[_0x92b5('0x42')]:_0x41eea2[_0x92b5('0x3e')];if(_0x4d8ae8[_0x92b5('0x3f')][_0x92b5('0x4c')]){_0x2a9beb[_0x92b5('0x52')]=[{'all':!![]}];}_0x2a9beb=_[_0x92b5('0x53')]({},_0x2a9beb,_0x4d8ae8[_0x92b5('0x4b')]);return db['SmsMessage'][_0x92b5('0x54')](_0x2a9beb)[_0x92b5('0x1e')](handleEntityNotFound(_0x147f73,null))[_0x92b5('0x1e')](respondWithResult(_0x147f73,null))[_0x92b5('0x4e')](handleError(_0x147f73,null));};exports[_0x92b5('0x55')]=function(_0x347c7b,_0x12853e){return db[_0x92b5('0x3b')]['create'](_0x347c7b[_0x92b5('0x56')],{})[_0x92b5('0x1e')](respondWithResult(_0x12853e,0xc9))[_0x92b5('0x4e')](handleError(_0x12853e,null));};exports['update']=function(_0x5c6f50,_0x405cba){if(_0x5c6f50[_0x92b5('0x56')]['id']){delete _0x5c6f50['body']['id'];}return db[_0x92b5('0x3b')][_0x92b5('0x54')]({'where':{'id':_0x5c6f50[_0x92b5('0x50')]['id']}})['then'](handleEntityNotFound(_0x405cba,null))[_0x92b5('0x1e')](saveUpdates(_0x5c6f50[_0x92b5('0x56')],null))[_0x92b5('0x1e')](respondWithResult(_0x405cba,null))['catch'](handleError(_0x405cba,null));};exports[_0x92b5('0x36')]=function(_0x120389,_0x3621f1){return db[_0x92b5('0x3b')][_0x92b5('0x54')]({'where':{'id':_0x120389[_0x92b5('0x50')]['id']}})['then'](handleEntityNotFound(_0x3621f1,null))[_0x92b5('0x1e')](removeEntity(_0x3621f1,null))[_0x92b5('0x4e')](handleError(_0x3621f1,null));};exports[_0x92b5('0x57')]=function(_0x4e9ce2,_0xc81de6){return db[_0x92b5('0x3b')][_0x92b5('0x57')]()[_0x92b5('0x1e')](respondWithResult(_0xc81de6,null))[_0x92b5('0x4e')](handleError(_0xc81de6,null));};var interaction_log=require(_0x92b5('0x11'))('sms-interactions');exports[_0x92b5('0x58')]=function(_0x5717b0,_0x460421,_0x1924a7){var _0x46ef69={'agent':{},'channel':'sms'};if(_0x5717b0[_0x92b5('0x56')]['id']){delete _0x5717b0['body']['id'];}_0x5717b0[_0x92b5('0x56')][_0x92b5('0x59')]=!![];_0x5717b0[_0x92b5('0x56')][_0x92b5('0x5a')]=moment()[_0x92b5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5717b0['body'][_0x92b5('0x5c')]=_0x5717b0[_0x92b5('0x56')][_0x92b5('0x5c')]||_0x5717b0['user']['id'];_0x46ef69[_0x92b5('0x5d')]['id']=_0x5717b0[_0x92b5('0x56')][_0x92b5('0x5c')];return db[_0x92b5('0x3b')][_0x92b5('0x54')]({'where':{'id':_0x5717b0[_0x92b5('0x50')]['id'],'UserId':null}})[_0x92b5('0x1e')](handleEntityNotFound(_0x460421,null))[_0x92b5('0x1e')](saveUpdates(_0x5717b0['body'],null))[_0x92b5('0x1e')](function(_0x5a92f5){if(_0x5a92f5){_0x46ef69['message']=_0x5a92f5[_0x92b5('0x5e')]({'plain':!![]});return db[_0x92b5('0x5f')][_0x92b5('0x54')]({'where':{'id':_0x5a92f5[_0x92b5('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x460421,null))[_0x92b5('0x1e')](function(_0x57b6f7){if(_0x57b6f7){return _0x57b6f7[_0x92b5('0x35')]({'UserId':_0x5717b0[_0x92b5('0x56')][_0x92b5('0x5c')],'read1stAt':_['isNil'](_0x57b6f7[_0x92b5('0x61')])?moment()[_0x92b5('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x92b5('0x1e')](function(_0x568c85){if(_0x568c85){_0x46ef69[_0x92b5('0x62')]=_0x568c85[_0x92b5('0x5e')]({'plain':!![]});interaction_log[_0x92b5('0x1f')](_0x92b5('0x63'),_0x5717b0['user']['id'],_0x5717b0[_0x92b5('0x64')][_0x92b5('0x38')],_0x5717b0[_0x92b5('0x64')]['role'],_0x46ef69[_0x92b5('0x62')]['id'],_0x5717b0['body']?JSON[_0x92b5('0x24')](_0x5717b0[_0x92b5('0x56')]):_0x92b5('0x65'));return respondWithRpcPromise(_0x92b5('0x66'),_0x92b5('0x67'),_0x46ef69);}return null;})[_0x92b5('0x1e')](function(_0x2995d6){var _0x210580=_0x92b5('0x68')+_0x2995d6['message'][_0x92b5('0x69')];return db[_0x92b5('0x6a')]['query'](_0x210580,{'type':db['Sequelize'][_0x92b5('0x6b')][_0x92b5('0x6c')],'raw':!![]})[_0x92b5('0x1e')](function(_0x42fd33){return _0x42fd33;});})[_0x92b5('0x1e')](function(_0x47b531){if(_0x47b531){_0x46ef69[_0x92b5('0x27')][_0x92b5('0x6d')]=_0x47b531[0x0];if(!_0x5717b0[_0x92b5('0x56')][_0x92b5('0x5c')])return;return db[_0x92b5('0x6e')][_0x92b5('0x54')]({'where':{'id':_0x5717b0[_0x92b5('0x56')]['UserId'],'role':'agent'},'attributes':['id',_0x92b5('0x38'),_0x92b5('0x6f'),_0x92b5('0x70'),'internal'],'raw':!![]});}return null;})['then'](function(_0x33b7d4){if(!_0x33b7d4)return null;_0x46ef69[_0x92b5('0x27')][_0x92b5('0x5d')]=_0x33b7d4;return _0x46ef69;})[_0x92b5('0x1e')](function(_0x216437){if(_0x216437){if(_0x5717b0['body'][_0x92b5('0x71')]){_0x46ef69[_0x92b5('0x27')][_0x92b5('0x72')]=util[_0x92b5('0x5b')](_0x92b5('0x73'),_0x5717b0['user'][_0x92b5('0x38')]);_0x46ef69[_0x92b5('0x27')]['channel']=_0x46ef69[_0x92b5('0x74')];_0x46ef69['message'][_0x92b5('0x75')]=_0x46ef69[_0x92b5('0x74')];_0x46ef69[_0x92b5('0x27')][_0x92b5('0x76')]=_0x92b5('0x58');return respondWithRpcPromise('EventManager',_0x92b5('0x77'),{'event':_0x92b5('0x78'),'message':_0x46ef69[_0x92b5('0x27')]},client9002)[_0x92b5('0x1e')](function(){return _0x46ef69;});}return _0x46ef69;}return null;})[_0x92b5('0x1e')](respondWithResult(_0x460421,null))[_0x92b5('0x4e')](handleError(_0x460421,null));};var interaction_log=require(_0x92b5('0x11'))(_0x92b5('0x79'));exports['reject']=function(_0x116a9b,_0x12fd53,_0x4599e3){var _0x3d609a={'agent':{},'channel':'sms'};if(_0x116a9b[_0x92b5('0x56')]['id']){delete _0x116a9b[_0x92b5('0x56')]['id'];}_0x116a9b['body']['UserId']=_0x116a9b[_0x92b5('0x56')][_0x92b5('0x5c')]||_0x116a9b['user']['id'];_0x3d609a[_0x92b5('0x5d')]['id']=_0x116a9b['body'][_0x92b5('0x5c')];return db['SmsMessage']['find']({'where':{'id':_0x116a9b[_0x92b5('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x12fd53,null))['then'](function(_0x37df02){if(_0x37df02){_0x3d609a[_0x92b5('0x27')]=_0x37df02[_0x92b5('0x5e')]({'plain':!![]});return db[_0x92b5('0x5f')][_0x92b5('0x54')]({'where':{'id':_0x37df02[_0x92b5('0x60')]}});}return null;})[_0x92b5('0x1e')](handleEntityNotFound(_0x12fd53,null))[_0x92b5('0x1e')](function(_0x3e0386){if(_0x3e0386){_0x3d609a['interaction']=_0x3e0386[_0x92b5('0x5e')]({'plain':!![]});interaction_log['info'](_0x92b5('0x7a'),_0x116a9b[_0x92b5('0x64')]['id'],_0x116a9b['user'][_0x92b5('0x38')],_0x116a9b[_0x92b5('0x64')][_0x92b5('0x7b')],_0x3d609a[_0x92b5('0x62')]['id'],_0x116a9b[_0x92b5('0x56')]?JSON[_0x92b5('0x24')](_0x116a9b[_0x92b5('0x56')]):_0x92b5('0x65'));return respondWithRpcPromise(_0x92b5('0x7c'),_0x92b5('0x7d'),_0x3d609a);}return null;})[_0x92b5('0x1e')](function(_0x50f90b){var _0x3940b3=_0x92b5('0x68')+_0x50f90b[_0x92b5('0x27')][_0x92b5('0x69')];return db[_0x92b5('0x6a')]['query'](_0x3940b3,{'type':db[_0x92b5('0x7e')]['QueryTypes'][_0x92b5('0x6c')],'raw':!![]})[_0x92b5('0x1e')](function(_0x5b8069){return _0x5b8069;});})[_0x92b5('0x1e')](function(_0x3819da){if(_0x3819da){_0x3d609a['message'][_0x92b5('0x6d')]=_0x3819da[0x0];if(!_0x116a9b[_0x92b5('0x56')][_0x92b5('0x5c')])return;return db[_0x92b5('0x6e')][_0x92b5('0x54')]({'where':{'id':_0x116a9b[_0x92b5('0x56')][_0x92b5('0x5c')],'role':_0x92b5('0x5d')},'attributes':['id',_0x92b5('0x38'),_0x92b5('0x6f'),_0x92b5('0x70'),_0x92b5('0x7f')],'raw':!![]});}return null;})[_0x92b5('0x1e')](function(_0x5f2adc){if(!_0x5f2adc)return null;_0x3d609a[_0x92b5('0x27')][_0x92b5('0x5d')]=_0x5f2adc;return _0x3d609a;})[_0x92b5('0x1e')](function(_0x3c8e69){if(_0x3c8e69){_0x3c8e69[_0x92b5('0x27')][_0x92b5('0x72')]=util[_0x92b5('0x5b')](_0x92b5('0x73'),_0x116a9b[_0x92b5('0x64')][_0x92b5('0x38')]);_0x3c8e69[_0x92b5('0x27')][_0x92b5('0x74')]=_0x3d609a[_0x92b5('0x74')];_0x3c8e69[_0x92b5('0x27')][_0x92b5('0x75')]=_0x3d609a[_0x92b5('0x74')];_0x3c8e69[_0x92b5('0x27')]['event']=_0x92b5('0x33');respondWithRpcPromise(_0x92b5('0x77'),_0x92b5('0x77'),{'event':_0x92b5('0x80'),'message':_0x3c8e69[_0x92b5('0x27')]},client9002);return _0x3d609a;}return null;})['then'](respondWithResult(_0x12fd53,null))['catch'](handleError(_0x12fd53,null));};exports['status']=function(_0x23300f,_0x115e69,_0x51f82f){if(_0x23300f[_0x92b5('0x56')]['id']){delete _0x23300f[_0x92b5('0x56')]['id'];}var _0x4ce84a;return db[_0x92b5('0x3b')][_0x92b5('0x54')]({'where':{'id':_0x23300f[_0x92b5('0x50')]['id']}})[_0x92b5('0x1e')](handleEntityNotFound(_0x115e69,null))[_0x92b5('0x1e')](function(_0x3a5ed0){if(_0x3a5ed0){_0x4ce84a=_0x3a5ed0;return db[_0x92b5('0x81')]['find']({'where':{'id':_0x3a5ed0[_0x92b5('0x82')]}});}})[_0x92b5('0x1e')](handleEntityNotFound(_0x115e69,null))['then'](function(_0x3f0d04){if(_0x3f0d04){logger[_0x92b5('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x92b5('0x30'),_0x92b5('0x83'),_0x3f0d04[_0x92b5('0x3c')],util[_0x92b5('0x84')](_0x23300f[_0x92b5('0x56')],{'showHidden':![],'depth':null}));switch(_0x3f0d04[_0x92b5('0x3c')]){case'twilio':if(_0x23300f['body'][_0x92b5('0x85')]&&_0x23300f['body'][_0x92b5('0x85')]===_0x4ce84a[_0x92b5('0x86')]){return _0x4ce84a[_0x92b5('0x35')]({'read':!![]});}else{logger[_0x92b5('0x25')](_0x92b5('0x87'),'status',_0x92b5('0x88'),util[_0x92b5('0x84')](_0x23300f['body'],{'showHidden':![],'depth':null}));}break;case _0x92b5('0x89'):if(_0x23300f[_0x92b5('0x56')][_0x92b5('0x8a')]&&_0x23300f[_0x92b5('0x56')]['MessageUUID']===_0x4ce84a[_0x92b5('0x86')]&&_[_0x92b5('0x8b')]([_0x92b5('0x8c'),_0x92b5('0x8d')],_0x23300f[_0x92b5('0x56')][_0x92b5('0x8e')])>=0x0){return _0x4ce84a[_0x92b5('0x35')]({'read':!![]});}else{logger[_0x92b5('0x25')](_0x92b5('0x87'),_0x92b5('0x30'),_0x92b5('0x8f'),util[_0x92b5('0x84')](_0x23300f[_0x92b5('0x56')],{'showHidden':![],'depth':null}));}break;case _0x92b5('0x90'):var _0x430d01=_0x23300f[_0x92b5('0x56')][_0x92b5('0x91')][0x0];if(_0x430d01[_0x92b5('0x30')][_0x92b5('0x92')]===_0x92b5('0x93')){return _0x4ce84a[_0x92b5('0x35')]({'read':!![]});}else{logger[_0x92b5('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x92b5('0x30'),'infobip',util[_0x92b5('0x84')](_0x23300f['body'],{'showHidden':![],'depth':null}));}break;}return _0x4ce84a;}})[_0x92b5('0x1e')](respondWithResult(_0x115e69,null))[_0x92b5('0x4e')](handleError(_0x115e69,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index f729c56..1369de0 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 _0xaabd=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0xaabd,0xba));var _0xdaab=function(_0x3494ee,_0x7b1b9a){_0x3494ee=_0x3494ee-0x0;var _0x12b115=_0xaabd[_0x3494ee];return _0x12b115;};'use strict';var EventEmitter=require(_0xdaab('0x0'));var SmsMessage=require(_0xdaab('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdaab('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdaab('0x3'),'afterDestroy':_0xdaab('0x4')};function emitEvent(_0x1baa14){return function(_0x54bd21,_0xd4c3b6,_0x1568da){SmsMessageEvents[_0xdaab('0x5')](_0x1baa14+':'+_0x54bd21['id'],_0x54bd21);SmsMessageEvents[_0xdaab('0x5')](_0x1baa14,_0x54bd21);_0x1568da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xdaab('0x6')](e,emitEvent(event));}}module[_0xdaab('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x8446=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x8446,0x1ab));var _0x6844=function(_0x1a1128,_0x1784d8){_0x1a1128=_0x1a1128-0x0;var _0x1f5bd2=_0x8446[_0x1a1128];return _0x1f5bd2;};'use strict';var EventEmitter=require(_0x6844('0x0'));var SmsMessage=require(_0x6844('0x1'))['db'][_0x6844('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6844('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6844('0x4'),'afterDestroy':_0x6844('0x5')};function emitEvent(_0x21ee92){return function(_0x67f823,_0x5c6ab3,_0x335e5b){SmsMessageEvents['emit'](_0x21ee92+':'+_0x67f823['id'],_0x67f823);SmsMessageEvents[_0x6844('0x6')](_0x21ee92,_0x67f823);_0x335e5b(null);};}for(var e in events){if(events[_0x6844('0x7')](e)){var event=events[e];SmsMessage[_0x6844('0x8')](e,emitEvent(event));}}module[_0x6844('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 41398e3..6db7aaa 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 _0xc1e1=['phone','authToken','messages','create','body','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','password','smsMethod','sender','login?username=','&password=','GET','sms','user_key','session_key','total_sent','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','username','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','crypto','apiKey','login','text','timestamp','keys','createHash','md5','digest','hex','signature=','/external/get/send.php?','csc','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','request-promise','rimraf','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','twilio','accountSid'];(function(_0x1fdd84,_0x3de96a){var _0x3d4d6b=function(_0x406c98){while(--_0x406c98){_0x1fdd84['push'](_0x1fdd84['shift']());}};_0x3d4d6b(++_0x3de96a);}(_0xc1e1,0xd6));var _0x1c1e=function(_0xdd8511,_0x94a83f){_0xdd8511=_0xdd8511-0x0;var _0x4935b8=_0xc1e1[_0xdd8511];return _0x4935b8;};'use strict';var _=require('lodash');var util=require(_0x1c1e('0x0'));var logger=require('../../config/logger')(_0x1c1e('0x1'));var moment=require(_0x1c1e('0x2'));var BPromise=require('bluebird');var rp=require(_0x1c1e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c1e('0x4'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x1c1e('0x5')]=function(_0x139b5b,_0xcf9bc6){return _0x139b5b[_0x1c1e('0x6')](_0x1c1e('0x7'),attributes,{'tableName':_0x1c1e('0x8'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x1c1e('0x9')]},{'name':_0x1c1e('0xa'),'fields':['body'],'type':_0x1c1e('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3139c5,_0x5a36a5,_0x678a1f){var _0x2bcc7b=_0x139b5b['models'];var _0x1fd4ae=_0x3139c5[_0x1c1e('0xc')]({'plain':!![]});if(_0x1fd4ae[_0x1c1e('0xd')][_0x1c1e('0xe')]()==='in'||_0x1fd4ae[_0x1c1e('0xd')][_0x1c1e('0xe')]()===_0x1c1e('0xf')&&!_0x1fd4ae[_0x1c1e('0x10')]&&!_[_0x1c1e('0x11')](_0x1fd4ae[_0x1c1e('0x12')])&&!_[_0x1c1e('0x11')](_0x1fd4ae['SmsInteractionId'])){_0x2bcc7b[_0x1c1e('0x13')]['findOne']({'where':{'id':_0x1fd4ae[_0x1c1e('0x14')]}})[_0x1c1e('0x15')](function(_0x22d60e){if(_0x22d60e){_0x22d60e[_0x1c1e('0x16')]({'lastMsgAt':_0x1fd4ae['createdAt'],'lastMsgDirection':_0x1fd4ae['direction'][_0x1c1e('0xe')]()});}})[_0x1c1e('0x17')](function(_0x5d60f1){console[_0x1c1e('0x18')](_0x5d60f1);});}if(_0x1fd4ae['direction']==='out'&&!_0x1fd4ae[_0x1c1e('0x10')]){var _0x5123d5;_0x2bcc7b[_0x1c1e('0x19')][_0x1c1e('0x1a')]({'where':{'id':_0x1fd4ae[_0x1c1e('0x1b')]},'raw':!![]})[_0x1c1e('0x15')](function(_0x5a1260){_0x5123d5=_0x5a1260;if(_0x5123d5&&_0x5123d5['type']){switch(_0x5123d5['type']){case _0x1c1e('0x1c'):var _0x13b190=require(_0x1c1e('0x1c'));if(_0x5123d5[_0x1c1e('0x1d')]&&_0x5123d5['authToken']&&_0x5123d5[_0x1c1e('0x1e')]){var _0x1a9a3a=new _0x13b190(_0x5123d5[_0x1c1e('0x1d')],_0x5123d5[_0x1c1e('0x1f')]);_0x1a9a3a[_0x1c1e('0x20')][_0x1c1e('0x21')]({'body':_0x1fd4ae[_0x1c1e('0x22')],'to':_0x1fd4ae[_0x1c1e('0x1e')],'from':_0x5123d5[_0x1c1e('0x1e')],'statusCallback':_0x5123d5[_0x1c1e('0x23')]+_0x1c1e('0x24')+_0x1fd4ae['id']+_0x1c1e('0x25')+_0x5123d5[_0x1c1e('0x26')]})['then'](function(_0x1308d0){if(_0x1308d0[_0x1c1e('0x27')]){return _0x3139c5[_0x1c1e('0x16')]({'messageId':_0x1308d0[_0x1c1e('0x27')]});}})[_0x1c1e('0x17')](function(_0x25a8ba){logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),'twilio',util['inspect'](_0x25a8ba,{'showHidden':![],'depth':null}));});}else{logger[_0x1c1e('0x18')](_0x1c1e('0x28'),'afterCreate','twilio',_0x1c1e('0x2a'));}break;case _0x1c1e('0x2b'):var _0x323b00='https://api.skebby.it/API/v1.0/REST/';if(_0x5123d5['username']&&_0x5123d5[_0x1c1e('0x2c')]){var _0x5655d6={'recipient':[_0x1fd4ae[_0x1c1e('0x1e')]],'message':_0x1fd4ae[_0x1c1e('0x22')],'message_type':_0x5123d5[_0x1c1e('0x2d')]};if(_0x5123d5['smsMethod']&&_0x5123d5['smsMethod']!=='SI'){_0x5655d6[_0x1c1e('0x2e')]=_0x5123d5[_0x1c1e('0x1e')];}var _0x4e2053={'url':_0x323b00+_0x1c1e('0x2f')+_0x5123d5['username']+_0x1c1e('0x30')+_0x5123d5[_0x1c1e('0x2c')],'method':_0x1c1e('0x31')};rp(_0x4e2053)['then'](function(_0x252141){var _0x130113=_0x252141['split'](';');var _0x217838={'user_key':_0x130113[0x0],'session_key':_0x130113[0x1]};_0x4e2053={'url':_0x323b00+_0x1c1e('0x32'),'method':'POST','headers':{'user_key':_0x217838[_0x1c1e('0x33')],'Session_key':_0x217838[_0x1c1e('0x34')]},'json':!![],'body':_0x5655d6};return rp(_0x4e2053);})['then'](function(_0x4a407f){if(_0x4a407f[_0x1c1e('0x35')]>=0x1){var _0x6ee063={'messageId':_0x4a407f['internal_order_id']};if(_0x5123d5[_0x1c1e('0x2d')]!=='GP'||!_0x5123d5[_0x1c1e('0x36')]){_0x6ee063[_0x1c1e('0x37')]=!![];}return _0x3139c5[_0x1c1e('0x16')](_0x6ee063);}else{return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x2b'),util[_0x1c1e('0x38')](_0x4a407f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x37add0){return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),'afterCreate',_0x1c1e('0x2b'),util[_0x1c1e('0x38')](_0x37add0,{'showHidden':![],'depth':null}));});}else{logger[_0x1c1e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1c1e('0x29'),'skebby',_0x1c1e('0x39'));}break;case _0x1c1e('0x3a'):if(_0x5123d5[_0x1c1e('0x1f')]){var _0x672105={'recipient':_0x1fd4ae['phone'],'message':_0x1fd4ae[_0x1c1e('0x22')],'sender':_0x5123d5[_0x1c1e('0x3b')]||_0x5123d5['phone'],'authorization':_0x5123d5[_0x1c1e('0x1f')]};var _0x5a36a5={'method':_0x1c1e('0x3c'),'uri':_0x1c1e('0x3d'),'body':_0x672105,'json':!![]};rp(_0x5a36a5)[_0x1c1e('0x15')](function(_0x15a1d2){var _0x3e626d={'messageId':_0x15a1d2[_0x1c1e('0x3e')]};if(!_0x5123d5[_0x1c1e('0x36')]){_0x3e626d[_0x1c1e('0x37')]=!![];}return _0x3139c5[_0x1c1e('0x16')](_0x3e626d);})['catch'](function(_0x13c7e1){logger[_0x1c1e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1c1e('0x29'),_0x1c1e('0x3a'),util[_0x1c1e('0x38')](_0x13c7e1,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1c1e('0x29'),_0x1c1e('0x3a'),_0x1c1e('0x3f'));}break;case _0x1c1e('0x40'):if(_0x5123d5[_0x1c1e('0x41')]&&_0x5123d5[_0x1c1e('0x2c')]){var _0x672105={'messages':[{'source':_0x1c1e('0x42'),'to':_0x1fd4ae[_0x1c1e('0x1e')],'body':_0x1fd4ae[_0x1c1e('0x22')],'from':_0x5123d5[_0x1c1e('0x3b')]||_0x5123d5['phone']}]};var _0x4039d5=util[_0x1c1e('0x43')]('%s:%s',_0x5123d5[_0x1c1e('0x41')],_0x5123d5[_0x1c1e('0x2c')]);var _0x5a36a5={'method':'POST','uri':_0x1c1e('0x44'),'body':_0x672105,'headers':{'Authorization':util[_0x1c1e('0x43')](_0x1c1e('0x45'),new Buffer(_0x4039d5)[_0x1c1e('0x46')](_0x1c1e('0x47')))},'json':!![]};rp(_0x5a36a5)[_0x1c1e('0x15')](function(_0x5c6ae3){if(_0x5c6ae3[_0x1c1e('0x48')]>=0xc8&&_0x5c6ae3[_0x1c1e('0x48')]<=0xce){if(_0x5c6ae3['data']&&_0x5c6ae3[_0x1c1e('0x49')][_0x1c1e('0x4a')]>0x0){var _0x41aa88=_[_0x1c1e('0x4b')](_0x5c6ae3[_0x1c1e('0x49')][_0x1c1e('0x20')]);var _0xc37a26={'messageId':_0x41aa88['message_id']};if(!_0x5123d5['deliveryReport']){_0xc37a26[_0x1c1e('0x37')]=!![];}return _0x3139c5[_0x1c1e('0x16')](_0xc37a26);}else{logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),'clickSend',util['inspect'](_0x5c6ae3,{'showHidden':![],'depth':null}));}}else{logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x4c'),util[_0x1c1e('0x38')](_0x5c6ae3,{'showHidden':![],'depth':null}));}})[_0x1c1e('0x17')](function(_0x30eae3){logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x4c'),util[_0x1c1e('0x38')](_0x30eae3,{'showHidden':![],'depth':null}));});}else{logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x4c'),_0x1c1e('0x39'));}break;case _0x1c1e('0x4d'):if(_0x5123d5[_0x1c1e('0x4e')]&&_0x5123d5['authToken']){var _0x672105={'dst':_0x1fd4ae[_0x1c1e('0x1e')],'text':_0x1fd4ae[_0x1c1e('0x22')],'src':_0x5123d5[_0x1c1e('0x3b')]||_0x5123d5[_0x1c1e('0x1e')],'url':_0x5123d5['remote']+'/api/sms/messages/'+_0x1fd4ae['id']+_0x1c1e('0x25')+_0x5123d5[_0x1c1e('0x26')]};var _0x4039d5=util[_0x1c1e('0x43')](_0x1c1e('0x4f'),_0x5123d5[_0x1c1e('0x4e')],_0x5123d5[_0x1c1e('0x1f')]);var _0x5a36a5={'method':_0x1c1e('0x3c'),'uri':util[_0x1c1e('0x43')](_0x1c1e('0x50'),_0x5123d5[_0x1c1e('0x4e')]),'body':_0x672105,'headers':{'Authorization':util[_0x1c1e('0x43')]('Basic\x20%s',new Buffer(_0x4039d5)['toString'](_0x1c1e('0x47')))},'json':!![]};rp(_0x5a36a5)[_0x1c1e('0x15')](function(_0x50632b){var _0x1e6aed={'messageId':_0x50632b[_0x1c1e('0x51')][0x0]};return _0x3139c5[_0x1c1e('0x16')](_0x1e6aed);})['catch'](function(_0x3ad851){logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x4d'),util['inspect'](_0x3ad851,{'showHidden':![],'depth':null}));});}else{logger[_0x1c1e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1c1e('0x4d'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x1c1e('0x52'):if(_0x5123d5[_0x1c1e('0x41')]&&_0x5123d5[_0x1c1e('0x2c')]){if(_0x5123d5[_0x1c1e('0x53')]){var _0x3af8d9={'method':_0x1c1e('0x3c'),'uri':_0x5123d5[_0x1c1e('0x53')]+_0x1c1e('0x54'),'body':{'username':_0x5123d5[_0x1c1e('0x41')],'password':_0x5123d5[_0x1c1e('0x2c')]},'json':!![]};return rp(_0x3af8d9)['then'](function(_0x3294dc){var _0x5e75e6={'method':_0x1c1e('0x3c'),'uri':_0x5123d5[_0x1c1e('0x53')]+_0x1c1e('0x55'),'body':{'messages':[{'from':_0x5123d5['phone'],'destinations':[{'to':_0x1fd4ae[_0x1c1e('0x1e')]}],'text':_0x1fd4ae[_0x1c1e('0x22')],'notifyUrl':_0x5123d5['remote']+'/api/sms/messages/'+_0x1fd4ae['id']+_0x1c1e('0x25')+_0x5123d5[_0x1c1e('0x26')],'notifyContentType':_0x1c1e('0x56'),'callbackData':_0x5123d5[_0x1c1e('0x1e')]+';'+_0x1fd4ae[_0x1c1e('0x22')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3294dc['token']},'json':!![]};return rp(_0x5e75e6)[_0x1c1e('0x15')](function(_0x215f11){if(_0x215f11[_0x1c1e('0x20')]){var _0x5c0595={'messageId':_0x215f11[_0x1c1e('0x20')][0x0][_0x1c1e('0x9')]};if(!_0x5123d5['deliveryReport']){_0x5c0595[_0x1c1e('0x37')]=!![];}return _0x3139c5[_0x1c1e('0x16')](_0x5c0595);}else{return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),'afterCreate','infobip',util[_0x1c1e('0x38')](_0x215f11,{'showHidden':![],'depth':null}));}});})[_0x1c1e('0x17')](function(_0x4686d8){return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x52'),util['inspect'](_0x4686d8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1c1e('0x28'),'afterCreate','infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x1c1e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1c1e('0x29'),_0x1c1e('0x52'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x9a8127=require(_0x1c1e('0x57'));if(_0x5123d5[_0x1c1e('0x58')]){var _0x4ef4bd={};_0x4ef4bd[_0x1c1e('0x59')]=_0x5123d5[_0x1c1e('0x41')];_0x4ef4bd[_0x1c1e('0x1e')]=_0x1fd4ae['phone'];_0x4ef4bd[_0x1c1e('0x2e')]=_0x5123d5['phone'];_0x4ef4bd[_0x1c1e('0x5a')]=_0x1fd4ae[_0x1c1e('0x22')];_0x4ef4bd[_0x1c1e('0x5b')]=+new Date();var _0x3db0e1='';var _0x2757e8='';var _0x46f96f=Object[_0x1c1e('0x5c')](_0x4ef4bd);_0x46f96f['sort']();for(var _0x3a3e56=0x0;_0x3a3e56<_0x46f96f['length'];_0x3a3e56++){if(_0x3db0e1!=''){_0x3db0e1+='&';}_0x3db0e1+=_0x46f96f[_0x3a3e56]+'='+encodeURIComponent(_0x4ef4bd[_0x46f96f[_0x3a3e56]]);_0x2757e8+=_0x4ef4bd[_0x46f96f[_0x3a3e56]];}_0x2757e8+=_0x5123d5['apiKey'];_0x2757e8=_0x9a8127[_0x1c1e('0x5d')](_0x1c1e('0x5e'))['update'](_0x2757e8)[_0x1c1e('0x5f')](_0x1c1e('0x60'));if(_0x3db0e1!==''){_0x3db0e1+='&';}_0x3db0e1+=_0x1c1e('0x61')+_0x2757e8;var _0x4e2053={'method':_0x1c1e('0x31'),'uri':_0x5123d5[_0x1c1e('0x53')]+_0x1c1e('0x62')+_0x3db0e1,'json':!![]};return rp(_0x4e2053)[_0x1c1e('0x15')](function(_0x140337){var _0xefcfab=Object[_0x1c1e('0x5c')](_0x140337);if(_0x140337[_0xefcfab[0x0]][_0x1c1e('0x18')]&&parseInt(_0x140337[_0xefcfab[0x0]][_0x1c1e('0x18')])===0x0){var _0x5ab8fd={'messageId':_0x140337[_0xefcfab[0x0]]['id_sms']};if(!_0x5123d5[_0x1c1e('0x36')]){_0x5ab8fd[_0x1c1e('0x37')]=!![];}return _0x3139c5[_0x1c1e('0x16')](_0x5ab8fd);}else{return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x63'),util[_0x1c1e('0x38')](_0x140337['error'],{'showHidden':![],'depth':null}));}})[_0x1c1e('0x17')](function(_0x1cd9c0){return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x63'),util[_0x1c1e('0x38')](_0x1cd9c0,{'showHidden':![],'depth':null}));});}else{logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x63'),'Missing\x20parameters:\x20apiKey');}break;case _0x1c1e('0x64'):if(_0x5123d5['apiKey']){var _0x210b51={'method':_0x1c1e('0x3c'),'uri':_0x1c1e('0x65'),'headers':{'Authorization':_0x5123d5[_0x1c1e('0x58')]},'body':{'content':_0x1fd4ae['body'],'to':[_0x1fd4ae[_0x1c1e('0x1e')]],'from':_0x5123d5[_0x1c1e('0x1e')],'binary':![],'clientMessageId':_0x1c1e('0x66'),'charset':_0x1c1e('0x67')},'json':!![]};rp(_0x210b51)[_0x1c1e('0x15')](function(_0x54c56e){if(!_0x54c56e[_0x1c1e('0x18')]){var _0xf044fa={'messageId':_0x54c56e[_0x1c1e('0x20')][0x0][_0x1c1e('0x68')]};if(!_0x5123d5[_0x1c1e('0x36')]){_0xf044fa['read']=!![];}return _0x3139c5[_0x1c1e('0x16')](_0xf044fa);}else{return logger['error'](_0x1c1e('0x28'),'afterCreate',_0x1c1e('0x64'),util[_0x1c1e('0x38')](_0x54c56e[_0x1c1e('0x18')],{'showHidden':![],'depth':null}));}})[_0x1c1e('0x17')](function(_0x32f442){return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),'afterCreate',_0x1c1e('0x64'),util[_0x1c1e('0x38')](_0x32f442,{'showHidden':![],'depth':null}));});}else{logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x64'),_0x1c1e('0x69'));}break;case _0x1c1e('0x6a'):if(_0x5123d5[_0x1c1e('0x41')]&&_0x5123d5['password']){var _0x4039d5=util['format']('%s:%s',_0x5123d5[_0x1c1e('0x41')],_0x5123d5[_0x1c1e('0x2c')]);var _0x5a36a5={'method':'POST','uri':_0x1c1e('0x6b')+_0x5123d5[_0x1c1e('0x6c')]+_0x1c1e('0x6d'),'body':{'to':[_0x1fd4ae['phone']],'text':_0x1fd4ae['body'],'from':_0x5123d5[_0x1c1e('0x1e')],'applicationId':_0x5123d5[_0x1c1e('0x6e')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x4039d5)[_0x1c1e('0x46')]('base64'))},'json':!![]};rp(_0x5a36a5)[_0x1c1e('0x15')](function(_0x7edfc8){if(_0x7edfc8['id']){var _0x503d74={'messageId':_0x7edfc8['id']};return _0x3139c5['update'](_0x503d74);}else{logger[_0x1c1e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1c1e('0x6a'),util[_0x1c1e('0x38')](_0x7edfc8,{'showHidden':![],'depth':null}));}})[_0x1c1e('0x17')](function(_0x194909){logger[_0x1c1e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1c1e('0x29'),_0x1c1e('0x6a'),util[_0x1c1e('0x38')](_0x194909,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x6a'),_0x1c1e('0x39'));}break;case _0x1c1e('0x6f'):if(_0x5123d5[_0x1c1e('0x58')]){var _0x17f3eb={};var _0x4e2053={'method':_0x1c1e('0x3c'),'uri':_0x1c1e('0x70'),'headers':{'Authorization':_0x1c1e('0x71')+_0x5123d5['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x5123d5[_0x1c1e('0x1e')],'to':_0x1fd4ae[_0x1c1e('0x1e')],'text':_0x1fd4ae['body']},'json':!![]};return rp(_0x4e2053)[_0x1c1e('0x15')](function(_0xf0af2d){if(_0xf0af2d['code']==0xca){_0x17f3eb[_0x1c1e('0x72')]=_0xf0af2d;var _0x5b41ef={'method':_0x1c1e('0x3c'),'uri':_0x1c1e('0x73'),'headers':{'Authorization':_0x1c1e('0x71')+_0x5123d5[_0x1c1e('0x58')],'Content-Type':_0x1c1e('0x56')},'body':{'refid':_0x17f3eb['message'][_0x1c1e('0x74')]},'json':!![]};return rp(_0x5b41ef)[_0x1c1e('0x15')](function(_0x2924bf){_0x17f3eb[_0x1c1e('0x75')]=_0x2924bf;var _0x5d6b57={'messageId':_0x17f3eb['message'][_0x1c1e('0x74')],'read':!![]};return _0x3139c5['update'](_0x5d6b57);});}else{return logger['error'](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x6f'),util[_0x1c1e('0x38')](_0xf0af2d,{'showHidden':![],'depth':null}));}})[_0x1c1e('0x17')](function(_0x1f751d){return logger[_0x1c1e('0x18')](_0x1c1e('0x28'),_0x1c1e('0x29'),_0x1c1e('0x6f'),util['inspect'](_0x1f751d,{'showHidden':![],'depth':null}));});}else{return logger[_0x1c1e('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1c1e('0x6f'),_0x1c1e('0x76'));}break;}}})[_0x1c1e('0x77')](function(){_0x678a1f();});}else{_0x678a1f();}}},'charset':_0x1c1e('0x78'),'collate':_0x1c1e('0x79')});}; \ No newline at end of file +var _0x3827=['moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','sender','login?username=','&password=','GET','split','sms','user_key','total_sent','internal_order_id','smsMethod','read','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','format','toString','base64','http_code','data','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','Basic\x20%s','infobip','baseUrl','/sms/2/text/advanced','IBSSO\x20','deliveryReport','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','application/json','message','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3827,0x177));var _0x7382=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3827[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x7382('0x0'));var util=require(_0x7382('0x1'));var logger=require(_0x7382('0x2'))('api');var moment=require(_0x7382('0x3'));var BPromise=require(_0x7382('0x4'));var rp=require(_0x7382('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7382('0x6'));var config=require(_0x7382('0x7'));var attributes=require(_0x7382('0x8'));module[_0x7382('0x9')]=function(_0xcd00a9,_0x1ee8af){return _0xcd00a9['define'](_0x7382('0xa'),attributes,{'tableName':_0x7382('0xb'),'paranoid':![],'indexes':[{'name':_0x7382('0xc'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x7382('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbf1020,_0x326e70,_0x4e3b04){var _0x44780c=_0xcd00a9[_0x7382('0xe')];var _0x3a4794=_0xbf1020[_0x7382('0xf')]({'plain':!![]});if(_0x3a4794[_0x7382('0x10')][_0x7382('0x11')]()==='in'||_0x3a4794[_0x7382('0x10')][_0x7382('0x11')]()===_0x7382('0x12')&&!_0x3a4794[_0x7382('0x13')]&&!_[_0x7382('0x14')](_0x3a4794[_0x7382('0x15')])&&!_[_0x7382('0x14')](_0x3a4794[_0x7382('0x16')])){_0x44780c[_0x7382('0x17')][_0x7382('0x18')]({'where':{'id':_0x3a4794['SmsInteractionId']}})[_0x7382('0x19')](function(_0x3ee8d8){if(_0x3ee8d8){_0x3ee8d8[_0x7382('0x1a')]({'lastMsgAt':_0x3a4794[_0x7382('0x1b')],'lastMsgDirection':_0x3a4794['direction']['toLowerCase']()});}})[_0x7382('0x1c')](function(_0x11bf05){console[_0x7382('0x1d')](_0x11bf05);});}if(_0x3a4794[_0x7382('0x10')]===_0x7382('0x12')&&!_0x3a4794[_0x7382('0x13')]){var _0x242718;_0x44780c[_0x7382('0x1e')][_0x7382('0x1f')]({'where':{'id':_0x3a4794[_0x7382('0x20')]},'raw':!![]})['then'](function(_0x8824c8){_0x242718=_0x8824c8;if(_0x242718&&_0x242718['type']){switch(_0x242718[_0x7382('0x21')]){case'twilio':var _0x2895af=require(_0x7382('0x22'));if(_0x242718[_0x7382('0x23')]&&_0x242718[_0x7382('0x24')]&&_0x242718[_0x7382('0x25')]){var _0x2982f2=new _0x2895af(_0x242718[_0x7382('0x23')],_0x242718[_0x7382('0x24')]);_0x2982f2[_0x7382('0x26')][_0x7382('0x27')]({'body':_0x3a4794[_0x7382('0xd')],'to':_0x3a4794['phone'],'from':_0x242718[_0x7382('0x25')],'statusCallback':_0x242718[_0x7382('0x28')]+_0x7382('0x29')+_0x3a4794['id']+_0x7382('0x2a')+_0x242718[_0x7382('0x2b')]})[_0x7382('0x19')](function(_0x1a19eb){if(_0x1a19eb[_0x7382('0x2c')]){return _0xbf1020[_0x7382('0x1a')]({'messageId':_0x1a19eb[_0x7382('0x2c')]});}})[_0x7382('0x1c')](function(_0x282c9){logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x22'),util[_0x7382('0x2f')](_0x282c9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x22'),_0x7382('0x30'));}break;case _0x7382('0x31'):var _0x560fed=_0x7382('0x32');if(_0x242718[_0x7382('0x33')]&&_0x242718[_0x7382('0x34')]){var _0x4e4e77={'recipient':[_0x3a4794[_0x7382('0x25')]],'message':_0x3a4794[_0x7382('0xd')],'message_type':_0x242718['smsMethod']};if(_0x242718['smsMethod']&&_0x242718['smsMethod']!=='SI'){_0x4e4e77[_0x7382('0x35')]=_0x242718[_0x7382('0x25')];}var _0x37f749={'url':_0x560fed+_0x7382('0x36')+_0x242718[_0x7382('0x33')]+_0x7382('0x37')+_0x242718[_0x7382('0x34')],'method':_0x7382('0x38')};rp(_0x37f749)[_0x7382('0x19')](function(_0x469a5f){var _0x363936=_0x469a5f[_0x7382('0x39')](';');var _0xba6001={'user_key':_0x363936[0x0],'session_key':_0x363936[0x1]};_0x37f749={'url':_0x560fed+_0x7382('0x3a'),'method':'POST','headers':{'user_key':_0xba6001[_0x7382('0x3b')],'Session_key':_0xba6001['session_key']},'json':!![],'body':_0x4e4e77};return rp(_0x37f749);})[_0x7382('0x19')](function(_0x3e7fb7){if(_0x3e7fb7[_0x7382('0x3c')]>=0x1){var _0x467e89={'messageId':_0x3e7fb7[_0x7382('0x3d')]};if(_0x242718[_0x7382('0x3e')]!=='GP'||!_0x242718['deliveryReport']){_0x467e89[_0x7382('0x3f')]=!![];}return _0xbf1020[_0x7382('0x1a')](_0x467e89);}else{return logger[_0x7382('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7382('0x2e'),_0x7382('0x31'),util[_0x7382('0x2f')](_0x3e7fb7,{'showHidden':![],'depth':null}));}})[_0x7382('0x1c')](function(_0x14383d){return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),'skebby',util[_0x7382('0x2f')](_0x14383d,{'showHidden':![],'depth':null}));});}else{logger[_0x7382('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7382('0x2e'),_0x7382('0x31'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x242718['authToken']){var _0x5d379e={'recipient':_0x3a4794[_0x7382('0x25')],'message':_0x3a4794[_0x7382('0xd')],'sender':_0x242718[_0x7382('0x40')]||_0x242718[_0x7382('0x25')],'authorization':_0x242718[_0x7382('0x24')]};var _0x326e70={'method':'POST','uri':_0x7382('0x41'),'body':_0x5d379e,'json':!![]};rp(_0x326e70)[_0x7382('0x19')](function(_0x157de8){var _0x3c784e={'messageId':_0x157de8[_0x7382('0x42')]};if(!_0x242718['deliveryReport']){_0x3c784e[_0x7382('0x3f')]=!![];}return _0xbf1020[_0x7382('0x1a')](_0x3c784e);})[_0x7382('0x1c')](function(_0x19abbb){logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x43'),util[_0x7382('0x2f')](_0x19abbb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x43'),_0x7382('0x44'));}break;case _0x7382('0x45'):if(_0x242718[_0x7382('0x33')]&&_0x242718[_0x7382('0x34')]){var _0x5d379e={'messages':[{'source':'xCALLY\x20Motion','to':_0x3a4794[_0x7382('0x25')],'body':_0x3a4794['body'],'from':_0x242718[_0x7382('0x40')]||_0x242718[_0x7382('0x25')]}]};var _0x15fa7f=util['format'](_0x7382('0x46'),_0x242718[_0x7382('0x33')],_0x242718[_0x7382('0x34')]);var _0x326e70={'method':_0x7382('0x47'),'uri':_0x7382('0x48'),'body':_0x5d379e,'headers':{'Authorization':util[_0x7382('0x49')]('Basic\x20%s',new Buffer(_0x15fa7f)[_0x7382('0x4a')](_0x7382('0x4b')))},'json':!![]};rp(_0x326e70)[_0x7382('0x19')](function(_0x51560b){if(_0x51560b['http_code']>=0xc8&&_0x51560b[_0x7382('0x4c')]<=0xce){if(_0x51560b['data']&&_0x51560b[_0x7382('0x4d')]['queued_count']>0x0){var _0x3d1dc1=_[_0x7382('0x4e')](_0x51560b[_0x7382('0x4d')][_0x7382('0x26')]);var _0x12af65={'messageId':_0x3d1dc1[_0x7382('0x4f')]};if(!_0x242718['deliveryReport']){_0x12af65[_0x7382('0x3f')]=!![];}return _0xbf1020[_0x7382('0x1a')](_0x12af65);}else{logger[_0x7382('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7382('0x2e'),_0x7382('0x50'),util[_0x7382('0x2f')](_0x51560b,{'showHidden':![],'depth':null}));}}else{logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x50'),util[_0x7382('0x2f')](_0x51560b,{'showHidden':![],'depth':null}));}})[_0x7382('0x1c')](function(_0x19d6eb){logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x50'),util[_0x7382('0x2f')](_0x19d6eb,{'showHidden':![],'depth':null}));});}else{logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),'clickSend',_0x7382('0x51'));}break;case _0x7382('0x52'):if(_0x242718[_0x7382('0x53')]&&_0x242718[_0x7382('0x24')]){var _0x5d379e={'dst':_0x3a4794['phone'],'text':_0x3a4794[_0x7382('0xd')],'src':_0x242718['senderString']||_0x242718[_0x7382('0x25')],'url':_0x242718[_0x7382('0x28')]+_0x7382('0x29')+_0x3a4794['id']+_0x7382('0x2a')+_0x242718[_0x7382('0x2b')]};var _0x15fa7f=util[_0x7382('0x49')](_0x7382('0x46'),_0x242718['authId'],_0x242718[_0x7382('0x24')]);var _0x326e70={'method':_0x7382('0x47'),'uri':util[_0x7382('0x49')]('https://api.plivo.com/v1/Account/%s/Message/',_0x242718[_0x7382('0x53')]),'body':_0x5d379e,'headers':{'Authorization':util[_0x7382('0x49')](_0x7382('0x54'),new Buffer(_0x15fa7f)['toString'](_0x7382('0x4b')))},'json':!![]};rp(_0x326e70)[_0x7382('0x19')](function(_0x275320){var _0x370b94={'messageId':_0x275320['message_uuid'][0x0]};return _0xbf1020[_0x7382('0x1a')](_0x370b94);})[_0x7382('0x1c')](function(_0x2ff276){logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x52'),util[_0x7382('0x2f')](_0x2ff276,{'showHidden':![],'depth':null}));});}else{logger[_0x7382('0x1d')](_0x7382('0x2d'),'afterCreate',_0x7382('0x52'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x7382('0x55'):if(_0x242718[_0x7382('0x33')]&&_0x242718[_0x7382('0x34')]){if(_0x242718[_0x7382('0x56')]){var _0x5043d5={'method':_0x7382('0x47'),'uri':_0x242718[_0x7382('0x56')]+'/auth/1/session','body':{'username':_0x242718['username'],'password':_0x242718[_0x7382('0x34')]},'json':!![]};return rp(_0x5043d5)[_0x7382('0x19')](function(_0x3d45ad){var _0x35eb76={'method':'POST','uri':_0x242718[_0x7382('0x56')]+_0x7382('0x57'),'body':{'messages':[{'from':_0x242718[_0x7382('0x25')],'destinations':[{'to':_0x3a4794[_0x7382('0x25')]}],'text':_0x3a4794[_0x7382('0xd')],'notifyUrl':_0x242718[_0x7382('0x28')]+'/api/sms/messages/'+_0x3a4794['id']+_0x7382('0x2a')+_0x242718[_0x7382('0x2b')],'notifyContentType':'application/json','callbackData':_0x242718['phone']+';'+_0x3a4794['body']}]},'headers':{'Authorization':_0x7382('0x58')+_0x3d45ad[_0x7382('0x2b')]},'json':!![]};return rp(_0x35eb76)[_0x7382('0x19')](function(_0x3a4631){if(_0x3a4631['messages']){var _0x2c20d5={'messageId':_0x3a4631[_0x7382('0x26')][0x0][_0x7382('0xc')]};if(!_0x242718[_0x7382('0x59')]){_0x2c20d5[_0x7382('0x3f')]=!![];}return _0xbf1020[_0x7382('0x1a')](_0x2c20d5);}else{return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),'infobip',util[_0x7382('0x2f')](_0x3a4631,{'showHidden':![],'depth':null}));}});})[_0x7382('0x1c')](function(_0x4bd38e){return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x55'),util[_0x7382('0x2f')](_0x4bd38e,{'showHidden':![],'depth':null}));});}else{logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x55'),_0x7382('0x5a'));}}else{logger[_0x7382('0x1d')](_0x7382('0x2d'),'afterCreate',_0x7382('0x55'),_0x7382('0x51'));}break;case'csc':var _0x10d1fb=require(_0x7382('0x5b'));if(_0x242718[_0x7382('0x5c')]){var _0x1c94d6={};_0x1c94d6[_0x7382('0x5d')]=_0x242718['username'];_0x1c94d6[_0x7382('0x25')]=_0x3a4794[_0x7382('0x25')];_0x1c94d6['sender']=_0x242718[_0x7382('0x25')];_0x1c94d6[_0x7382('0x5e')]=_0x3a4794[_0x7382('0xd')];_0x1c94d6['timestamp']=+new Date();var _0x12c479='';var _0x202371='';var _0x51bbfd=Object[_0x7382('0x5f')](_0x1c94d6);_0x51bbfd[_0x7382('0x60')]();for(var _0x5a1e7e=0x0;_0x5a1e7e<_0x51bbfd[_0x7382('0x61')];_0x5a1e7e++){if(_0x12c479!=''){_0x12c479+='&';}_0x12c479+=_0x51bbfd[_0x5a1e7e]+'='+encodeURIComponent(_0x1c94d6[_0x51bbfd[_0x5a1e7e]]);_0x202371+=_0x1c94d6[_0x51bbfd[_0x5a1e7e]];}_0x202371+=_0x242718[_0x7382('0x5c')];_0x202371=_0x10d1fb[_0x7382('0x62')](_0x7382('0x63'))['update'](_0x202371)[_0x7382('0x64')](_0x7382('0x65'));if(_0x12c479!==''){_0x12c479+='&';}_0x12c479+=_0x7382('0x66')+_0x202371;var _0x37f749={'method':_0x7382('0x38'),'uri':_0x242718[_0x7382('0x56')]+_0x7382('0x67')+_0x12c479,'json':!![]};return rp(_0x37f749)[_0x7382('0x19')](function(_0x3745d4){var _0xda8e51=Object[_0x7382('0x5f')](_0x3745d4);if(_0x3745d4[_0xda8e51[0x0]][_0x7382('0x1d')]&&parseInt(_0x3745d4[_0xda8e51[0x0]]['error'])===0x0){var _0x26975a={'messageId':_0x3745d4[_0xda8e51[0x0]][_0x7382('0x68')]};if(!_0x242718['deliveryReport']){_0x26975a[_0x7382('0x3f')]=!![];}return _0xbf1020[_0x7382('0x1a')](_0x26975a);}else{return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x69'),util[_0x7382('0x2f')](_0x3745d4[_0x7382('0x1d')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x5b9c67){return logger['error'](_0x7382('0x2d'),'afterCreate',_0x7382('0x69'),util['inspect'](_0x5b9c67,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7382('0x2e'),_0x7382('0x69'),_0x7382('0x6a'));}break;case _0x7382('0x6b'):if(_0x242718[_0x7382('0x5c')]){var _0x469e9c={'method':_0x7382('0x47'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x242718[_0x7382('0x5c')]},'body':{'content':_0x3a4794['body'],'to':[_0x3a4794[_0x7382('0x25')]],'from':_0x242718[_0x7382('0x25')],'binary':![],'clientMessageId':_0x7382('0x6c'),'charset':_0x7382('0x6d')},'json':!![]};rp(_0x469e9c)[_0x7382('0x19')](function(_0xe92317){if(!_0xe92317[_0x7382('0x1d')]){var _0x3403ae={'messageId':_0xe92317[_0x7382('0x26')][0x0]['apiMessageId']};if(!_0x242718[_0x7382('0x59')]){_0x3403ae['read']=!![];}return _0xbf1020[_0x7382('0x1a')](_0x3403ae);}else{return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x6b'),util['inspect'](_0xe92317[_0x7382('0x1d')],{'showHidden':![],'depth':null}));}})[_0x7382('0x1c')](function(_0x350290){return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x6b'),util[_0x7382('0x2f')](_0x350290,{'showHidden':![],'depth':null}));});}else{logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x6b'),'Missing\x20parameters:\x20apiKey');}break;case _0x7382('0x6e'):if(_0x242718[_0x7382('0x33')]&&_0x242718[_0x7382('0x34')]){var _0x15fa7f=util[_0x7382('0x49')]('%s:%s',_0x242718[_0x7382('0x33')],_0x242718[_0x7382('0x34')]);var _0x326e70={'method':_0x7382('0x47'),'uri':_0x7382('0x6f')+_0x242718[_0x7382('0x70')]+_0x7382('0x71'),'body':{'to':[_0x3a4794[_0x7382('0x25')]],'text':_0x3a4794[_0x7382('0xd')],'from':_0x242718[_0x7382('0x25')],'applicationId':_0x242718['applicationId']},'headers':{'Authorization':util['format'](_0x7382('0x54'),new Buffer(_0x15fa7f)['toString'](_0x7382('0x4b')))},'json':!![]};rp(_0x326e70)['then'](function(_0x1f2c4e){if(_0x1f2c4e['id']){var _0x45d3ba={'messageId':_0x1f2c4e['id']};return _0xbf1020[_0x7382('0x1a')](_0x45d3ba);}else{logger[_0x7382('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth',util[_0x7382('0x2f')](_0x1f2c4e,{'showHidden':![],'depth':null}));}})[_0x7382('0x1c')](function(_0x128899){logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x6e'),util[_0x7382('0x2f')](_0x128899,{'showHidden':![],'depth':null}));});}else{logger[_0x7382('0x1d')](_0x7382('0x2d'),'afterCreate',_0x7382('0x6e'),'Missing\x20parameters:\x20username,\x20password');}break;case'intelepeer':if(_0x242718['apiKey']){var _0x4ee054={};var _0x37f749={'method':_0x7382('0x47'),'uri':_0x7382('0x72'),'headers':{'Authorization':_0x7382('0x73')+_0x242718[_0x7382('0x5c')],'Content-Type':'application/json'},'body':{'from':_0x242718[_0x7382('0x25')],'to':_0x3a4794[_0x7382('0x25')],'text':_0x3a4794[_0x7382('0xd')]},'json':!![]};return rp(_0x37f749)[_0x7382('0x19')](function(_0x1608fd){if(_0x1608fd[_0x7382('0x74')]==0xca){_0x4ee054['message']=_0x1608fd;var _0x36118f={'method':_0x7382('0x47'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x7382('0x73')+_0x242718['apiKey'],'Content-Type':_0x7382('0x75')},'body':{'refid':_0x4ee054[_0x7382('0x76')][_0x7382('0x77')]},'json':!![]};return rp(_0x36118f)[_0x7382('0x19')](function(_0x53510b){_0x4ee054[_0x7382('0x78')]=_0x53510b;var _0x50110d={'messageId':_0x4ee054[_0x7382('0x76')][_0x7382('0x77')],'read':!![]};return _0xbf1020[_0x7382('0x1a')](_0x50110d);});}else{return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x79'),util[_0x7382('0x2f')](_0x1608fd,{'showHidden':![],'depth':null}));}})[_0x7382('0x1c')](function(_0x3e7f5e){return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),'intelepeer',util[_0x7382('0x2f')](_0x3e7f5e,{'showHidden':![],'depth':null}));});}else{return logger[_0x7382('0x1d')](_0x7382('0x2d'),_0x7382('0x2e'),_0x7382('0x79'),_0x7382('0x7a'));}break;}}})[_0x7382('0x7b')](function(){_0x4e3b04();});}else{_0x4e3b04();}}},'charset':_0x7382('0x7c'),'collate':_0x7382('0x7d')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index b054bc8..de61ada 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 _0x557c=['../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','body','debug','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x557c,0x107));var _0xc557=function(_0x438726,_0x4ea8db){_0x438726=_0x438726-0x0;var _0x2cd3ef=_0x557c[_0x438726];return _0x2cd3ef;};'use strict';var _=require(_0xc557('0x0'));var util=require(_0xc557('0x1'));var moment=require('moment');var BPromise=require(_0xc557('0x2'));var rs=require(_0xc557('0x3'));var fs=require('fs');var Redis=require(_0xc557('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc557('0x5'))(_0xc557('0x6'));var config=require(_0xc557('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc557('0x8')][_0xc557('0x9')]({'port':0x232a});config[_0xc557('0xa')]=_[_0xc557('0xb')](config[_0xc557('0xa')],{'host':_0xc557('0xc'),'port':0x18eb});var socket=require(_0xc557('0xd'))(new Redis(config[_0xc557('0xa')]));require(_0xc557('0xe'))['register'](socket);function respondWithRpcPromise(_0x4009a6,_0x6d6af6,_0x130135){return new BPromise(function(_0x1a3888,_0x13f7c3){return client[_0xc557('0xf')](_0x4009a6,_0x130135)[_0xc557('0x10')](function(_0x406502){logger[_0xc557('0x11')](_0xc557('0x12'),_0x6d6af6,_0xc557('0x13'));logger['debug'](_0xc557('0x14'),_0x6d6af6,_0xc557('0x13'),JSON[_0xc557('0x15')](_0x406502));if(_0x406502[_0xc557('0x16')]){if(_0x406502[_0xc557('0x16')]['code']===0x1f4){logger[_0xc557('0x16')]('SmsMessage,\x20%s,\x20%s',_0x6d6af6,_0x406502[_0xc557('0x16')][_0xc557('0x17')]);return _0x13f7c3(_0x406502[_0xc557('0x16')][_0xc557('0x17')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x6d6af6,_0x406502[_0xc557('0x16')][_0xc557('0x17')]);return _0x1a3888(_0x406502[_0xc557('0x16')][_0xc557('0x17')]);}else{logger[_0xc557('0x11')](_0xc557('0x12'),_0x6d6af6,'request\x20sent');_0x1a3888(_0x406502[_0xc557('0x18')]['message']);}})[_0xc557('0x19')](function(_0xcb54d5){logger[_0xc557('0x16')](_0xc557('0x12'),_0x6d6af6,_0xcb54d5);_0x13f7c3(_0xcb54d5);});});}exports[_0xc557('0x1a')]=function(_0x639800){var _0x4d2e9e=this;return new Promise(function(_0x4aa271,_0x55a47){return db[_0xc557('0x1b')]['create'](_0x639800[_0xc557('0x1c')],{'raw':_0x639800['options']?_0x639800['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e4732){logger[_0xc557('0x11')](_0xc557('0x1a'),_0x639800);logger[_0xc557('0x1d')](_0xc557('0x1a'),_0x639800,JSON[_0xc557('0x15')](_0x4e4732));_0x4aa271(_0x4e4732);})[_0xc557('0x19')](function(_0x243026){logger[_0xc557('0x16')]('CreateSmsMessage',_0x243026[_0xc557('0x17')],_0x639800);_0x55a47(_0x4d2e9e[_0xc557('0x16')](0x1f4,_0x243026[_0xc557('0x17')]));});});}; \ No newline at end of file +var _0x3c37=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','SmsMessage','body','options','then','CreateSmsMessage','debug','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','request'];(function(_0x401a4d,_0x4bb835){var _0x1faaff=function(_0x57539e){while(--_0x57539e){_0x401a4d['push'](_0x401a4d['shift']());}};_0x1faaff(++_0x4bb835);}(_0x3c37,0x159));var _0x73c3=function(_0x2aefba,_0x101757){_0x2aefba=_0x2aefba-0x0;var _0x1e292d=_0x3c37[_0x2aefba];return _0x1e292d;};'use strict';var _=require(_0x73c3('0x0'));var util=require(_0x73c3('0x1'));var moment=require(_0x73c3('0x2'));var BPromise=require(_0x73c3('0x3'));var rs=require(_0x73c3('0x4'));var fs=require('fs');var Redis=require(_0x73c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x73c3('0x6'));var config=require(_0x73c3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x73c3('0x8')][_0x73c3('0x9')]({'port':0x232a});config['redis']=_[_0x73c3('0xa')](config[_0x73c3('0xb')],{'host':_0x73c3('0xc'),'port':0x18eb});var socket=require(_0x73c3('0xd'))(new Redis(config['redis']));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4ea5ab,_0xb1f6a9,_0x3182c2){return new BPromise(function(_0x4a93ec,_0x310528){return client[_0x73c3('0xe')](_0x4ea5ab,_0x3182c2)['then'](function(_0x290846){logger[_0x73c3('0xf')](_0x73c3('0x10'),_0xb1f6a9,_0x73c3('0x11'));logger['debug'](_0x73c3('0x12'),_0xb1f6a9,'request\x20sent',JSON[_0x73c3('0x13')](_0x290846));if(_0x290846['error']){if(_0x290846['error'][_0x73c3('0x14')]===0x1f4){logger[_0x73c3('0x15')](_0x73c3('0x10'),_0xb1f6a9,_0x290846[_0x73c3('0x15')]['message']);return _0x310528(_0x290846[_0x73c3('0x15')][_0x73c3('0x16')]);}logger[_0x73c3('0x15')](_0x73c3('0x10'),_0xb1f6a9,_0x290846[_0x73c3('0x15')][_0x73c3('0x16')]);return _0x4a93ec(_0x290846[_0x73c3('0x15')][_0x73c3('0x16')]);}else{logger[_0x73c3('0xf')](_0x73c3('0x10'),_0xb1f6a9,_0x73c3('0x11'));_0x4a93ec(_0x290846['result'][_0x73c3('0x16')]);}})[_0x73c3('0x17')](function(_0x4f0666){logger[_0x73c3('0x15')](_0x73c3('0x10'),_0xb1f6a9,_0x4f0666);_0x310528(_0x4f0666);});});}exports['CreateSmsMessage']=function(_0x51077a){var _0x29906b=this;return new Promise(function(_0x521d6f,_0x8f9d8e){return db[_0x73c3('0x18')]['create'](_0x51077a[_0x73c3('0x19')],{'raw':_0x51077a[_0x73c3('0x1a')]?_0x51077a[_0x73c3('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x73c3('0x1b')](function(_0x4b6d63){logger[_0x73c3('0xf')](_0x73c3('0x1c'),_0x51077a);logger[_0x73c3('0x1d')](_0x73c3('0x1c'),_0x51077a,JSON['stringify'](_0x4b6d63));_0x521d6f(_0x4b6d63);})[_0x73c3('0x17')](function(_0x3620a7){logger['error']('CreateSmsMessage',_0x3620a7[_0x73c3('0x16')],_0x51077a);_0x8f9d8e(_0x29906b[_0x73c3('0x15')](0x1f4,_0x3620a7[_0x73c3('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 2bd2ee9..b16e700 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 _0xbdbe=['length','smsMessage:','remove','removeListener','register'];(function(_0x1f8873,_0x5ed9af){var _0x729fc8=function(_0x17e916){while(--_0x17e916){_0x1f8873['push'](_0x1f8873['shift']());}};_0x729fc8(++_0x5ed9af);}(_0xbdbe,0x151));var _0xebdb=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xbdbe[_0x4ff09b];return _0x3f5c2e;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0xebdb('0x0'),'update'];function createListener(_0x3cea2e,_0x2f4eeb){return function(_0x5aa91a){_0x2f4eeb['emit'](_0x3cea2e,_0x5aa91a);};}function removeListener(_0x2197d3,_0x5c40be){return function(){SmsMessageEvents[_0xebdb('0x1')](_0x2197d3,_0x5c40be);};}exports[_0xebdb('0x2')]=function(_0x44407b){for(var _0x983a88=0x0,_0x52042e=events[_0xebdb('0x3')];_0x983a88<_0x52042e;_0x983a88++){var _0x59eab4=events[_0x983a88];var _0x42c5f2=createListener(_0xebdb('0x4')+_0x59eab4,_0x44407b);SmsMessageEvents['on'](_0x59eab4,_0x42c5f2);}}; \ No newline at end of file +var _0x8bbe=['register','smsMessage:','./smsMessage.events','save','update','emit','removeListener'];(function(_0x5268ef,_0x10dc2c){var _0x160a88=function(_0x1a38a6){while(--_0x1a38a6){_0x5268ef['push'](_0x5268ef['shift']());}};_0x160a88(++_0x10dc2c);}(_0x8bbe,0xfe));var _0xe8bb=function(_0x550a09,_0x54b8dc){_0x550a09=_0x550a09-0x0;var _0x4ca9cd=_0x8bbe[_0x550a09];return _0x4ca9cd;};'use strict';var SmsMessageEvents=require(_0xe8bb('0x0'));var events=[_0xe8bb('0x1'),'remove',_0xe8bb('0x2')];function createListener(_0x4cba2c,_0x23cee3){return function(_0x34c9e2){_0x23cee3[_0xe8bb('0x3')](_0x4cba2c,_0x34c9e2);};}function removeListener(_0x186911,_0x4769ef){return function(){SmsMessageEvents[_0xe8bb('0x4')](_0x186911,_0x4769ef);};}exports[_0xe8bb('0x5')]=function(_0x15c728){for(var _0x1e00f8=0x0,_0x3ab2cb=events['length'];_0x1e00f8<_0x3ab2cb;_0x1e00f8++){var _0x4a37be=events[_0x1e00f8];var _0x89421f=createListener(_0xe8bb('0x6')+_0x4a37be,_0x15c728);SmsMessageEvents['on'](_0x4a37be,_0x89421f);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 1e3cea5..c65f963 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 _0x753b=['isAuthenticated','/:id','show','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','index','/describe'];(function(_0x291730,_0x51caba){var _0x39e7df=function(_0x4af94c){while(--_0x4af94c){_0x291730['push'](_0x291730['shift']());}};_0x39e7df(++_0x51caba);}(_0x753b,0xf0));var _0xb753=function(_0x4f9c46,_0x361afe){_0x4f9c46=_0x4f9c46-0x0;var _0x155365=_0x753b[_0x4f9c46];return _0x155365;};'use strict';var multer=require(_0xb753('0x0'));var util=require('util');var path=require(_0xb753('0x1'));var timeout=require(_0xb753('0x2'));var express=require(_0xb753('0x3'));var router=express[_0xb753('0x4')]();var fs_extra=require(_0xb753('0x5'));var auth=require(_0xb753('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb753('0x7'));var controller=require(_0xb753('0x8'));router[_0xb753('0x9')]('/',auth['isAuthenticated'](),controller[_0xb753('0xa')]);router[_0xb753('0x9')](_0xb753('0xb'),auth[_0xb753('0xc')](),controller['describe']);router[_0xb753('0x9')](_0xb753('0xd'),auth[_0xb753('0xc')](),controller[_0xb753('0xe')]);router[_0xb753('0x9')]('/:id/members',auth[_0xb753('0xc')](),controller[_0xb753('0xf')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xb753('0x10')]);router[_0xb753('0x9')](_0xb753('0x11'),auth[_0xb753('0xc')](),controller[_0xb753('0x12')]);router[_0xb753('0x13')]('/',auth[_0xb753('0xc')](),controller[_0xb753('0x14')]);router[_0xb753('0x13')](_0xb753('0x15'),auth['isAuthenticated'](),controller[_0xb753('0x16')]);router[_0xb753('0x13')](_0xb753('0x11'),auth[_0xb753('0xc')](),controller[_0xb753('0x17')]);router[_0xb753('0x18')](_0xb753('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb753('0x19')]('/:id',auth[_0xb753('0xc')](),controller['destroy']);router['delete'](_0xb753('0x15'),auth[_0xb753('0xc')](),controller[_0xb753('0x1a')]);router[_0xb753('0x19')](_0xb753('0x11'),auth[_0xb753('0xc')](),controller[_0xb753('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x7192=['../../components/auth/service','../../components/interaction/service','./smsQueue.controller','index','get','/describe','/:id','isAuthenticated','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3b558b,_0x2e6848){var _0x128709=function(_0xbb6e80){while(--_0xbb6e80){_0x3b558b['push'](_0x3b558b['shift']());}};_0x128709(++_0x2e6848);}(_0x7192,0x123));var _0x2719=function(_0x1f7c79,_0x314f73){_0x1f7c79=_0x1f7c79-0x0;var _0x5984b8=_0x7192[_0x1f7c79];return _0x5984b8;};'use strict';var multer=require(_0x2719('0x0'));var util=require(_0x2719('0x1'));var path=require(_0x2719('0x2'));var timeout=require(_0x2719('0x3'));var express=require('express');var router=express[_0x2719('0x4')]();var fs_extra=require(_0x2719('0x5'));var auth=require(_0x2719('0x6'));var interaction=require(_0x2719('0x7'));var config=require('../../config/environment');var controller=require(_0x2719('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x2719('0x9')]);router[_0x2719('0xa')](_0x2719('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2719('0xc'),auth[_0x2719('0xd')](),controller['show']);router[_0x2719('0xa')]('/:id/members',auth[_0x2719('0xd')](),controller[_0x2719('0xe')]);router['get'](_0x2719('0xf'),auth[_0x2719('0xd')](),controller[_0x2719('0x10')]);router[_0x2719('0xa')](_0x2719('0x11'),auth[_0x2719('0xd')](),controller['getAgents']);router[_0x2719('0x12')]('/',auth[_0x2719('0xd')](),controller[_0x2719('0x13')]);router[_0x2719('0x12')](_0x2719('0xf'),auth[_0x2719('0xd')](),controller[_0x2719('0x14')]);router[_0x2719('0x12')](_0x2719('0x11'),auth[_0x2719('0xd')](),controller['addAgents']);router[_0x2719('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x2719('0x16')]);router[_0x2719('0x17')]('/:id',auth[_0x2719('0xd')](),controller[_0x2719('0x18')]);router[_0x2719('0x17')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x2719('0x11'),auth[_0x2719('0xd')](),controller[_0x2719('0x19')]);module[_0x2719('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 4903976..5e32fcf 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 _0xecfa=['ENUM','rrmemory','sequelize','exports','name','STRING','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xecfa,0x1f3));var _0xaecf=function(_0x54a86a,_0x34d72e){_0x54a86a=_0x54a86a-0x0;var _0x5482a9=_0xecfa[_0x54a86a];return _0x5482a9;};'use strict';var Sequelize=require(_0xaecf('0x0'));module[_0xaecf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xaecf('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaecf('0x3')]},'timeout':{'type':Sequelize[_0xaecf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaecf('0x5')](_0xaecf('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x281b=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x9a29ea,_0x5b8b29){var _0x11f261=function(_0x397dea){while(--_0x397dea){_0x9a29ea['push'](_0x9a29ea['shift']());}};_0x11f261(++_0x5b8b29);}(_0x281b,0x136));var _0xb281=function(_0x3b6548,_0x572009){_0x3b6548=_0x3b6548-0x0;var _0x148940=_0x281b[_0x3b6548];return _0x148940;};'use strict';var Sequelize=require(_0xb281('0x0'));module['exports']={'name':{'type':Sequelize[_0xb281('0x1')],'unique':_0xb281('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb281('0x1')]},'timeout':{'type':Sequelize[_0xb281('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb281('0x4')](_0xb281('0x5'),_0xb281('0x6'),_0xb281('0x7'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 371c5b3..c62d2ae 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 _0x4892=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId'];(function(_0x2b4cd0,_0x457878){var _0x474616=function(_0x435315){while(--_0x435315){_0x2b4cd0['push'](_0x2b4cd0['shift']());}};_0x474616(++_0x457878);}(_0x4892,0x1ee));var _0x2489=function(_0xbdb5a5,_0x5dc4c1){_0xbdb5a5=_0xbdb5a5-0x0;var _0x3485b7=_0x4892[_0xbdb5a5];return _0x3485b7;};'use strict';var emlformat=require(_0x2489('0x0'));var rimraf=require(_0x2489('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2489('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2489('0x3'));var Mustache=require(_0x2489('0x4'));var util=require(_0x2489('0x5'));var path=require(_0x2489('0x6'));var sox=require(_0x2489('0x7'));var csv=require('to-csv');var ejs=require(_0x2489('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2489('0x9'));var squel=require(_0x2489('0xa'));var crypto=require(_0x2489('0xb'));var jsforce=require(_0x2489('0xc'));var deskjs=require(_0x2489('0xd'));var toCsv=require(_0x2489('0xe'));var querystring=require(_0x2489('0xf'));var Papa=require('papaparse');var Redis=require(_0x2489('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2489('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2489('0x12'))(_0x2489('0x13'));var utils=require(_0x2489('0x14'));var config=require(_0x2489('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2489('0x16')]=_[_0x2489('0x17')](config['redis'],{'host':_0x2489('0x18'),'port':0x18eb});var socket=require(_0x2489('0x19'))(new Redis(config[_0x2489('0x16')]));require(_0x2489('0x1a'))[_0x2489('0x1b')](socket);function respondWithStatusCode(_0x4fc0d4,_0x76ed3d){_0x76ed3d=_0x76ed3d||0xcc;return function(_0x3490a8){if(_0x3490a8){return _0x4fc0d4[_0x2489('0x1c')](_0x76ed3d);}return _0x4fc0d4[_0x2489('0x1d')](_0x76ed3d)['end']();};}function respondWithResult(_0x56b4db,_0x14a2e8){_0x14a2e8=_0x14a2e8||0xc8;return function(_0x66bf0b){if(_0x66bf0b){return _0x56b4db['status'](_0x14a2e8)[_0x2489('0x1e')](_0x66bf0b);}};}function respondWithFilteredResult(_0x509281,_0x180ff6){return function(_0x43a84d){if(_0x43a84d){var _0x5c72c0=typeof _0x180ff6['offset']===_0x2489('0x1f')&&typeof _0x180ff6[_0x2489('0x20')]===_0x2489('0x1f');var _0x47887b=_0x43a84d[_0x2489('0x21')];var _0x4f214b=_0x5c72c0?0x0:_0x180ff6[_0x2489('0x22')];var _0x370452=_0x5c72c0?_0x43a84d['count']:_0x180ff6['offset']+_0x180ff6[_0x2489('0x20')];var _0x4df4bd;if(_0x370452>=_0x47887b){_0x370452=_0x47887b;_0x4df4bd=0xc8;}else{_0x4df4bd=0xce;}_0x509281['status'](_0x4df4bd);return _0x509281[_0x2489('0x23')](_0x2489('0x24'),_0x4f214b+'-'+_0x370452+'/'+_0x47887b)['json'](_0x43a84d);}return null;};}function patchUpdates(_0x250563){return function(_0xa94609){try{jsonpatch['apply'](_0xa94609,_0x250563,!![]);}catch(_0x408f26){return BPromise['reject'](_0x408f26);}return _0xa94609[_0x2489('0x25')]();};}function saveUpdates(_0x5808ed,_0x22d03e){return function(_0xd8ef73){if(_0xd8ef73){return _0xd8ef73[_0x2489('0x26')](_0x5808ed)[_0x2489('0x27')](function(_0x1e2516){return _0x1e2516;});}return null;};}function removeEntity(_0x46d59b,_0x13b34e){return function(_0x251b4d){if(_0x251b4d){return _0x251b4d[_0x2489('0x28')]()[_0x2489('0x27')](function(){var _0x5bb5b6=_0x251b4d[_0x2489('0x29')]({'plain':!![]});var _0x3da321=_0x2489('0x2a');return db[_0x2489('0x2b')][_0x2489('0x28')]({'where':{'type':_0x3da321,'resourceId':_0x5bb5b6['id']}})[_0x2489('0x27')](function(){return _0x251b4d;});})['then'](function(){_0x46d59b[_0x2489('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2478f4,_0x3ad087){return function(_0xf61e1f){if(!_0xf61e1f){_0x2478f4[_0x2489('0x1c')](0x194);}return _0xf61e1f;};}function handleError(_0x1dc4eb,_0x4d6836){_0x4d6836=_0x4d6836||0x1f4;return function(_0x4e6f66){logger[_0x2489('0x2c')](_0x4e6f66[_0x2489('0x2d')]);if(_0x4e6f66[_0x2489('0x2e')]){delete _0x4e6f66[_0x2489('0x2e')];}_0x1dc4eb[_0x2489('0x1d')](_0x4d6836)[_0x2489('0x2f')](_0x4e6f66);};}exports[_0x2489('0x30')]=function(_0x472e41,_0x58da36){var _0x46c186={},_0x3037df={},_0x3b7867={'count':0x0,'rows':[]};var _0x525246=_[_0x2489('0x31')](db[_0x2489('0x32')][_0x2489('0x33')],function(_0x302bf4){return{'name':_0x302bf4['fieldName'],'type':_0x302bf4[_0x2489('0x34')][_0x2489('0x35')]};});_0x3037df[_0x2489('0x36')]=_['map'](_0x525246,_0x2489('0x2e'));_0x3037df[_0x2489('0x37')]=_['keys'](_0x472e41[_0x2489('0x37')]);_0x3037df[_0x2489('0x38')]=_[_0x2489('0x39')](_0x3037df[_0x2489('0x36')],_0x3037df[_0x2489('0x37')]);_0x46c186[_0x2489('0x3a')]=_[_0x2489('0x39')](_0x3037df[_0x2489('0x36')],qs[_0x2489('0x3b')](_0x472e41[_0x2489('0x37')][_0x2489('0x3b')]));_0x46c186[_0x2489('0x3a')]=_0x46c186[_0x2489('0x3a')][_0x2489('0x3c')]?_0x46c186[_0x2489('0x3a')]:_0x3037df[_0x2489('0x36')];if(!_0x472e41[_0x2489('0x37')][_0x2489('0x3d')](_0x2489('0x3e'))){_0x46c186['limit']=qs[_0x2489('0x20')](_0x472e41['query'][_0x2489('0x20')]);_0x46c186[_0x2489('0x22')]=qs[_0x2489('0x22')](_0x472e41[_0x2489('0x37')]['offset']);}_0x46c186[_0x2489('0x3f')]=qs[_0x2489('0x40')](_0x472e41[_0x2489('0x37')][_0x2489('0x40')]);_0x46c186[_0x2489('0x41')]=qs[_0x2489('0x38')](_[_0x2489('0x42')](_0x472e41[_0x2489('0x37')],_0x3037df[_0x2489('0x38')]),_0x525246);if(_0x472e41[_0x2489('0x37')][_0x2489('0x43')]){_0x46c186[_0x2489('0x41')]=_[_0x2489('0x44')](_0x46c186['where'],{'$or':_[_0x2489('0x31')](_0x525246,function(_0xbebcb2){if(_0xbebcb2[_0x2489('0x34')]!=='VIRTUAL'){var _0x31bf08={};_0x31bf08[_0xbebcb2[_0x2489('0x2e')]]={'$like':'%'+_0x472e41[_0x2489('0x37')]['filter']+'%'};return _0x31bf08;}})});}_0x46c186=_[_0x2489('0x44')]({},_0x46c186,_0x472e41['options']);var _0x4427e8={'where':_0x46c186[_0x2489('0x41')]};return db['SmsQueue'][_0x2489('0x21')](_0x4427e8)[_0x2489('0x27')](function(_0x37957a){_0x3b7867[_0x2489('0x21')]=_0x37957a;if(_0x472e41[_0x2489('0x37')][_0x2489('0x45')]){_0x46c186[_0x2489('0x46')]=[{'all':!![]}];}return db[_0x2489('0x32')][_0x2489('0x47')](_0x46c186);})[_0x2489('0x27')](function(_0x38c20a){_0x3b7867[_0x2489('0x48')]=_0x38c20a;return _0x3b7867;})['then'](respondWithFilteredResult(_0x58da36,_0x46c186))[_0x2489('0x49')](handleError(_0x58da36,null));};exports[_0x2489('0x4a')]=function(_0x19b7a8,_0x12a84e){var _0x3d7053={'raw':!![],'where':{'id':_0x19b7a8[_0x2489('0x4b')]['id']}},_0x429d7e={};_0x429d7e[_0x2489('0x36')]=_[_0x2489('0x4c')](db['SmsQueue']['rawAttributes']);_0x429d7e[_0x2489('0x37')]=_[_0x2489('0x4c')](_0x19b7a8[_0x2489('0x37')]);_0x429d7e['filters']=_['intersection'](_0x429d7e[_0x2489('0x36')],_0x429d7e['query']);_0x3d7053[_0x2489('0x3a')]=_[_0x2489('0x39')](_0x429d7e[_0x2489('0x36')],qs[_0x2489('0x3b')](_0x19b7a8[_0x2489('0x37')]['fields']));_0x3d7053['attributes']=_0x3d7053[_0x2489('0x3a')][_0x2489('0x3c')]?_0x3d7053['attributes']:_0x429d7e[_0x2489('0x36')];if(_0x19b7a8[_0x2489('0x37')][_0x2489('0x45')]){_0x3d7053['include']=[{'all':!![]}];}_0x3d7053=_[_0x2489('0x44')]({},_0x3d7053,_0x19b7a8[_0x2489('0x4d')]);return db[_0x2489('0x32')]['find'](_0x3d7053)[_0x2489('0x27')](handleEntityNotFound(_0x12a84e,null))[_0x2489('0x27')](respondWithResult(_0x12a84e,null))[_0x2489('0x49')](handleError(_0x12a84e,null));};exports['create']=function(_0x4b23bf,_0x3a8371){return db[_0x2489('0x32')][_0x2489('0x4e')](_0x4b23bf[_0x2489('0x4f')],{})['then'](function(_0x5e1464){var _0x12e438=_0x4b23bf['user']['get']({'plain':!![]});if(!_0x12e438)throw new Error(_0x2489('0x50'));if(_0x12e438[_0x2489('0x51')]===_0x2489('0x52')){var _0xc28534=_0x5e1464[_0x2489('0x29')]({'plain':!![]});var _0x28c1de=_0x2489('0x2a');return db[_0x2489('0x53')][_0x2489('0x54')]({'where':{'name':_0x28c1de,'userProfileId':_0x12e438[_0x2489('0x55')]},'raw':!![]})['then'](function(_0x5e8751){if(_0x5e8751&&_0x5e8751[_0x2489('0x56')]===0x0){return db[_0x2489('0x2b')]['create']({'name':_0xc28534[_0x2489('0x2e')],'resourceId':_0xc28534['id'],'type':_0x5e8751[_0x2489('0x2e')],'sectionId':_0x5e8751['id']},{})['then'](function(){return _0x5e1464;});}else{return _0x5e1464;}})[_0x2489('0x49')](function(_0x3e926f){logger[_0x2489('0x2c')](_0x2489('0x57'),_0x3e926f);throw _0x3e926f;});}return _0x5e1464;})[_0x2489('0x27')](respondWithResult(_0x3a8371,0xc9))[_0x2489('0x49')](handleError(_0x3a8371,null));};exports['update']=function(_0xa1ac2e,_0x1183ec){if(_0xa1ac2e['body']['id']){delete _0xa1ac2e[_0x2489('0x4f')]['id'];}return db[_0x2489('0x32')][_0x2489('0x54')]({'where':{'id':_0xa1ac2e[_0x2489('0x4b')]['id']}})[_0x2489('0x27')](handleEntityNotFound(_0x1183ec,null))[_0x2489('0x27')](saveUpdates(_0xa1ac2e[_0x2489('0x4f')],null))['then'](respondWithResult(_0x1183ec,null))[_0x2489('0x49')](handleError(_0x1183ec,null));};exports['destroy']=function(_0x5823e3,_0x4d5ccb){return db[_0x2489('0x32')][_0x2489('0x54')]({'where':{'id':_0x5823e3[_0x2489('0x4b')]['id']}})[_0x2489('0x27')](handleEntityNotFound(_0x4d5ccb,null))[_0x2489('0x27')](removeEntity(_0x4d5ccb,null))[_0x2489('0x49')](handleError(_0x4d5ccb,null));};exports[_0x2489('0x58')]=function(_0x2cb083,_0xfe3953){return db[_0x2489('0x32')][_0x2489('0x58')]()[_0x2489('0x27')](respondWithResult(_0xfe3953,null))[_0x2489('0x49')](handleError(_0xfe3953,null));};exports[_0x2489('0x59')]=function(_0x348251,_0x2ca117,_0x58a8e4){var _0x3e719d={'raw':!![],'where':{}},_0x5ea0cc={},_0x19cff9;return db[_0x2489('0x32')][_0x2489('0x5a')]({'where':{'id':_0x348251[_0x2489('0x4b')]['id']}})[_0x2489('0x27')](handleEntityNotFound(_0x2ca117,null))['then'](function(_0xa22dc5){if(_0xa22dc5){_0x19cff9=_0xa22dc5['get']({'plain':!![]});_0x5ea0cc[_0x2489('0x36')]=_[_0x2489('0x4c')](db[_0x2489('0x5b')][_0x2489('0x33')]);_0x5ea0cc[_0x2489('0x37')]=_[_0x2489('0x4c')](_0x348251['query']);_0x5ea0cc[_0x2489('0x38')]=_[_0x2489('0x39')](_0x5ea0cc[_0x2489('0x36')],_0x5ea0cc[_0x2489('0x37')]);_0x3e719d[_0x2489('0x3a')]=_[_0x2489('0x39')](_0x5ea0cc['model'],qs['fields'](_0x348251[_0x2489('0x37')][_0x2489('0x3b')]));_0x3e719d[_0x2489('0x3a')]=_0x3e719d[_0x2489('0x3a')][_0x2489('0x3c')]?_0x3e719d['attributes']:_0x5ea0cc[_0x2489('0x36')];if(!_0x348251[_0x2489('0x37')]['hasOwnProperty'](_0x2489('0x3e'))){_0x3e719d['limit']=qs[_0x2489('0x20')](_0x348251[_0x2489('0x37')][_0x2489('0x20')]);_0x3e719d[_0x2489('0x22')]=qs[_0x2489('0x22')](_0x348251[_0x2489('0x37')]['offset']);}_0x3e719d['order']=qs[_0x2489('0x40')](_0x348251[_0x2489('0x37')][_0x2489('0x40')]);_0x3e719d['where']=qs[_0x2489('0x38')](_[_0x2489('0x42')](_0x348251[_0x2489('0x37')],_0x5ea0cc[_0x2489('0x38')]));_0x3e719d['where'][_0x2489('0x5c')]=_0xa22dc5['id'];if(_0x348251[_0x2489('0x37')][_0x2489('0x43')]){_0x3e719d[_0x2489('0x41')]=_[_0x2489('0x44')](_0x3e719d[_0x2489('0x41')],{'$or':_[_0x2489('0x31')](_0x3e719d[_0x2489('0x3a')],function(_0x52ac73){var _0x45acb1={};_0x45acb1[_0x52ac73]={'$like':'%'+_0x348251[_0x2489('0x37')][_0x2489('0x43')]+'%'};return _0x45acb1;})});}_0x3e719d=_['merge']({},_0x3e719d,_0x348251[_0x2489('0x4d')]);return db['UserSmsQueue'][_0x2489('0x47')](_0x3e719d);}})['then'](function(_0x555193){if(_0x555193){return db[_0x2489('0x5d')][_0x2489('0x5e')]({'where':{'id':_['map'](_0x555193,_0x2489('0x5f')),'role':_0x2489('0x60')},'attributes':['id','name',_0x2489('0x61'),'updatedAt',_0x2489('0x62')]});}})[_0x2489('0x27')](function(_0x5af455){if(_0x5af455){return{'count':_0x5af455[_0x2489('0x21')],'rows':_[_0x2489('0x31')](_0x5af455[_0x2489('0x48')],function(_0x228c00){return{'membername':_0x228c00['name'],'UserId':_0x228c00['id'],'queue_name':_0x19cff9[_0x2489('0x2e')],'SmsQueueId':_0x19cff9['id'],'interface':util[_0x2489('0x63')](_0x2489('0x64'),_0x2489('0x65'),_0x228c00['name']),'penalty':0x0,'paused':_0x228c00[_0x2489('0x61')],'createdAt':_0x228c00[_0x2489('0x62')],'updatedAt':_0x228c00[_0x2489('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2489('0x27')](respondWithFilteredResult(_0x2ca117,_0x3e719d))[_0x2489('0x49')](handleError(_0x2ca117,null));};exports[_0x2489('0x67')]=function(_0x222229,_0x2881c3,_0x76ae27){var _0x3aecc7={};var _0x18fa9e={};var _0x16628f;var _0x19f5f8;return db['SmsQueue'][_0x2489('0x5a')]({'where':{'id':_0x222229['params']['id']}})['then'](handleEntityNotFound(_0x2881c3,null))[_0x2489('0x27')](function(_0x54d192){if(_0x54d192){_0x16628f=_0x54d192;_0x18fa9e['model']=_[_0x2489('0x4c')](db[_0x2489('0x68')][_0x2489('0x33')]);_0x18fa9e[_0x2489('0x37')]=_[_0x2489('0x4c')](_0x222229[_0x2489('0x37')]);_0x18fa9e[_0x2489('0x38')]=_[_0x2489('0x39')](_0x18fa9e[_0x2489('0x36')],_0x18fa9e['query']);_0x3aecc7[_0x2489('0x3a')]=_[_0x2489('0x39')](_0x18fa9e[_0x2489('0x36')],qs[_0x2489('0x3b')](_0x222229[_0x2489('0x37')][_0x2489('0x3b')]));_0x3aecc7[_0x2489('0x3a')]=_0x3aecc7[_0x2489('0x3a')][_0x2489('0x3c')]?_0x3aecc7[_0x2489('0x3a')]:_0x18fa9e[_0x2489('0x36')];_0x3aecc7[_0x2489('0x3f')]=qs[_0x2489('0x40')](_0x222229[_0x2489('0x37')][_0x2489('0x40')]);_0x3aecc7[_0x2489('0x41')]=qs[_0x2489('0x38')](_['pick'](_0x222229[_0x2489('0x37')],_0x18fa9e[_0x2489('0x38')]));if(_0x222229[_0x2489('0x37')][_0x2489('0x43')]){_0x3aecc7[_0x2489('0x41')]=_['merge'](_0x3aecc7['where'],{'$or':_[_0x2489('0x31')](_0x3aecc7[_0x2489('0x3a')],function(_0x3fd167){var _0x3c590a={};_0x3c590a[_0x3fd167]={'$like':'%'+_0x222229[_0x2489('0x37')][_0x2489('0x43')]+'%'};return _0x3c590a;})});}_0x3aecc7=_[_0x2489('0x44')]({},_0x3aecc7,_0x222229[_0x2489('0x4d')]);return _0x16628f[_0x2489('0x67')](_0x3aecc7);}})[_0x2489('0x27')](function(_0xaf11ca){if(_0xaf11ca){_0x19f5f8=_0xaf11ca[_0x2489('0x3c')];if(!_0x222229[_0x2489('0x37')]['hasOwnProperty'](_0x2489('0x3e'))){_0x3aecc7[_0x2489('0x20')]=qs[_0x2489('0x20')](_0x222229['query']['limit']);_0x3aecc7[_0x2489('0x22')]=qs[_0x2489('0x22')](_0x222229[_0x2489('0x37')][_0x2489('0x22')]);}return _0x16628f['getTeams'](_0x3aecc7);}})[_0x2489('0x27')](function(_0x9191ec){if(_0x9191ec){return _0x9191ec?{'count':_0x19f5f8,'rows':_0x9191ec}:null;}})[_0x2489('0x27')](respondWithResult(_0x2881c3,null))[_0x2489('0x49')](handleError(_0x2881c3,null));};exports[_0x2489('0x69')]=function(_0x3d829f,_0x38029a,_0xbaa20){var _0x250d3b=_0x3d829f[_0x2489('0x4f')][_0x2489('0x6a')];return db[_0x2489('0x68')]['findAll']({'where':{'id':_0x250d3b},'attributes':['id'],'include':[{'model':db[_0x2489('0x5d')],'as':_0x2489('0x6b'),'attributes':['id',_0x2489('0x2e'),_0x2489('0x6c'),'voicePause',_0x2489('0x6d')],'raw':!![]}]})['then'](function(_0x518eb5){if(_0x518eb5){var _0x304b21=_[_0x2489('0x6e')](_0x518eb5,function(_0x425e8e){var _0x2fbe57=_0x425e8e[_0x2489('0x29')]({'plain':!![]});return _0x2fbe57[_0x2489('0x6b')];});return db[_0x2489('0x32')]['find']({'where':{'id':_0x3d829f[_0x2489('0x4b')]['id']}})[_0x2489('0x27')](function(_0xea6c36){return db[_0x2489('0x6f')][_0x2489('0x70')](function(_0x340ad4){return _0xea6c36[_0x2489('0x69')](_0x250d3b,{'transaction':_0x340ad4})[_0x2489('0x27')](function(){return BPromise[_0x2489('0x71')](_0x304b21,function(_0x5b37c6){return db[_0x2489('0x5b')]['findOrCreate']({'where':{'UserId':_0x5b37c6['id'],'SmsQueueId':_0x3d829f[_0x2489('0x4b')]['id']},'transaction':_0x340ad4});});})[_0x2489('0x27')](function(){_0x304b21[_0x2489('0x72')](function(_0x2ec399){socket[_0x2489('0x73')](_0x2489('0x74'),{'UserId':_0x2ec399['id'],'SmsQueueId':_0xea6c36['id']});});});});});}})[_0x2489('0x27')](respondWithStatusCode(_0x38029a,null))[_0x2489('0x49')](handleError(_0x38029a,null));};exports['removeTeams']=function(_0x57e45d,_0x1e2919,_0x16b692){return db[_0x2489('0x68')][_0x2489('0x47')]({'where':{'id':_0x57e45d[_0x2489('0x37')][_0x2489('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2489('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x2489('0x27')](handleEntityNotFound(_0x1e2919,null))[_0x2489('0x27')](function(_0x2afe97){var _0x52942a=_[_0x2489('0x31')](_0x2afe97,'id');var _0x58849a=[];var _0x2a807d=[];var _0x5bade2=squel[_0x2489('0x75')]();_0x5bade2[_0x2489('0x76')](_0x2489('0x77'))[_0x2489('0x78')](_0x2489('0x79'),'tq')[_0x2489('0x7a')](_0x2489('0x7b'),'ut',_0x2489('0x7c'))[_0x2489('0x41')]('SmsQueueId\x20=\x20?',_0x57e45d[_0x2489('0x4b')]['id']);for(var _0x888b9a=0x0;_0x888b9a<_0x2afe97[_0x2489('0x3c')];_0x888b9a+=0x1){let _0x526641=_0x2afe97[_0x888b9a];for(var _0x41730b=0x0;_0x41730b<_0x526641[_0x2489('0x6b')][_0x2489('0x3c')];_0x41730b+=0x1){let _0x16df9d=_0x526641[_0x2489('0x6b')][_0x41730b];var _0x30cae3=_0x5bade2[_0x2489('0x7d')]();_0x30cae3['where'](_0x2489('0x7e'),_0x16df9d['id']);_0x2a807d[_0x2489('0x7f')](db[_0x2489('0x6f')][_0x2489('0x37')](_0x30cae3[_0x2489('0x80')](),{'type':db[_0x2489('0x6f')][_0x2489('0x81')]['SELECT']})[_0x2489('0x27')](function(_0x391967){if(_0x391967[_0x2489('0x3c')]===0x1){return _0x16df9d['id'];}else{var _0x3f049d=_['every'](_['map'](_0x391967,_0x2489('0x82')),function(_0x20889d){return _[_0x2489('0x83')](_0x52942a,_0x20889d);});if(_0x3f049d){return _0x16df9d['id'];}}}));}}return BPromise[_0x2489('0x84')](_0x2a807d)['then'](function(_0x367c1a){_0x58849a=_(_0x58849a)[_0x2489('0x85')](_0x367c1a)[_0x2489('0x86')]()[_0x2489('0x87')]();return db[_0x2489('0x32')][_0x2489('0x54')]({'where':{'id':_0x57e45d[_0x2489('0x4b')]['id']}})['then'](function(_0x45e481){return db[_0x2489('0x6f')][_0x2489('0x70')](function(_0x1bdcb7){return _0x45e481[_0x2489('0x88')](_0x57e45d[_0x2489('0x37')][_0x2489('0x6a')],{'transaction':_0x1bdcb7})[_0x2489('0x27')](function(){if(!_[_0x2489('0x89')](_0x58849a)){return _0x45e481['removeAgents'](_0x58849a,{'transaction':_0x1bdcb7});}})[_0x2489('0x27')](function(){_0x58849a[_0x2489('0x72')](function(_0x15e4bc){socket['emit'](_0x2489('0x8a'),{'UserId':_0x15e4bc,'SmsQueueId':_0x45e481['id']});});});});});});})[_0x2489('0x27')](respondWithStatusCode(_0x1e2919,null))['catch'](handleError(_0x1e2919,null));};exports[_0x2489('0x8b')]=function(_0x530f85,_0x4a0cfb,_0x55ac6c){return db[_0x2489('0x32')][_0x2489('0x54')]({'where':{'id':_0x530f85[_0x2489('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a0cfb,null))['then'](function(_0x44a8d4){if(_0x44a8d4){return _0x44a8d4[_0x2489('0x8b')](_0x530f85[_0x2489('0x4f')][_0x2489('0x6a')],_[_0x2489('0x8c')](_0x530f85[_0x2489('0x4f')],[_0x2489('0x6a'),'id'])||{})[_0x2489('0x8d')](function(_0x93fbea){for(var _0x274643=0x0;_0x274643<_0x530f85[_0x2489('0x4f')][_0x2489('0x6a')][_0x2489('0x3c')];_0x274643+=0x1){socket['emit'](_0x2489('0x74'),{'UserId':Number(_0x530f85[_0x2489('0x4f')][_0x2489('0x6a')][_0x274643]),'SmsQueueId':Number(_0x530f85[_0x2489('0x4b')]['id'])});}return _0x93fbea;});}})['then'](respondWithResult(_0x4a0cfb,null))[_0x2489('0x49')](handleError(_0x4a0cfb,null));};exports[_0x2489('0x8e')]=function(_0x14eb0c,_0x52227a,_0x2ddaef){return db[_0x2489('0x32')][_0x2489('0x54')]({'where':{'id':_0x14eb0c[_0x2489('0x4b')]['id']}})['then'](handleEntityNotFound(_0x52227a,null))['then'](function(_0x12dd40){if(_0x12dd40){return _0x12dd40['removeAgents'](_0x14eb0c['query'][_0x2489('0x6a')])[_0x2489('0x27')](function(){if(_[_0x2489('0x8f')](_0x14eb0c[_0x2489('0x37')]['ids'])){for(var _0x5aba92=0x0;_0x5aba92<_0x14eb0c[_0x2489('0x37')][_0x2489('0x6a')][_0x2489('0x3c')];_0x5aba92+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x14eb0c[_0x2489('0x37')][_0x2489('0x6a')][_0x5aba92]),'SmsQueueId':Number(_0x14eb0c[_0x2489('0x4b')]['id'])});}}else{socket[_0x2489('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x14eb0c[_0x2489('0x37')][_0x2489('0x6a')]),'SmsQueueId':Number(_0x14eb0c['params']['id'])});}});}})[_0x2489('0x27')](respondWithStatusCode(_0x52227a,null))[_0x2489('0x49')](handleError(_0x52227a,null));};exports['getAgents']=function(_0x24a25f,_0x62d7f9,_0x509386){var _0x371e2c={};var _0x520f72={};var _0x41cd0c;var _0x4ac902;return db[_0x2489('0x32')][_0x2489('0x5a')]({'where':{'id':_0x24a25f[_0x2489('0x4b')]['id']}})[_0x2489('0x27')](handleEntityNotFound(_0x62d7f9,null))[_0x2489('0x27')](function(_0x526fc8){if(_0x526fc8){_0x41cd0c=_0x526fc8;_0x520f72[_0x2489('0x36')]=_[_0x2489('0x4c')](db[_0x2489('0x5d')][_0x2489('0x33')]);_0x520f72[_0x2489('0x37')]=_['keys'](_0x24a25f[_0x2489('0x37')]);_0x520f72[_0x2489('0x38')]=_[_0x2489('0x39')](_0x520f72[_0x2489('0x36')],_0x520f72[_0x2489('0x37')]);_0x371e2c['attributes']=_[_0x2489('0x39')](_0x520f72[_0x2489('0x36')],qs[_0x2489('0x3b')](_0x24a25f[_0x2489('0x37')][_0x2489('0x3b')]));_0x371e2c[_0x2489('0x3a')]=_0x371e2c[_0x2489('0x3a')][_0x2489('0x3c')]?_0x371e2c[_0x2489('0x3a')]:_0x520f72[_0x2489('0x36')];_0x371e2c[_0x2489('0x3f')]=qs[_0x2489('0x40')](_0x24a25f[_0x2489('0x37')][_0x2489('0x40')]);_0x371e2c['where']=qs['filters'](_[_0x2489('0x42')](_0x24a25f[_0x2489('0x37')],_0x520f72[_0x2489('0x38')]));if(_0x24a25f[_0x2489('0x37')][_0x2489('0x43')]){_0x371e2c[_0x2489('0x41')]=_[_0x2489('0x44')](_0x371e2c[_0x2489('0x41')],{'$or':_[_0x2489('0x31')](_0x371e2c[_0x2489('0x3a')],function(_0x20e266){var _0x555ce1={};_0x555ce1[_0x20e266]={'$like':'%'+_0x24a25f['query']['filter']+'%'};return _0x555ce1;})});}_0x371e2c=_['merge']({},_0x371e2c,_0x24a25f[_0x2489('0x4d')]);return _0x41cd0c[_0x2489('0x90')](_0x371e2c);}})[_0x2489('0x27')](function(_0x454f1f){if(_0x454f1f){_0x4ac902=_0x454f1f[_0x2489('0x3c')];if(!_0x24a25f[_0x2489('0x37')]['hasOwnProperty'](_0x2489('0x3e'))){_0x371e2c[_0x2489('0x20')]=qs[_0x2489('0x20')](_0x24a25f['query'][_0x2489('0x20')]);_0x371e2c[_0x2489('0x22')]=qs[_0x2489('0x22')](_0x24a25f[_0x2489('0x37')]['offset']);}return _0x41cd0c[_0x2489('0x90')](_0x371e2c);}})['then'](function(_0x20cf1f){if(_0x20cf1f){return _0x20cf1f?{'count':_0x4ac902,'rows':_0x20cf1f}:null;}})[_0x2489('0x27')](respondWithResult(_0x62d7f9,null))[_0x2489('0x49')](handleError(_0x62d7f9,null));}; \ No newline at end of file +var _0x8fcf=['each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','sendStatus','error','name','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','type','filter','count','include','SmsQueue','findAll','show','params','options','find','catch','create','body','role','SmsQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserSmsQueue','rawAttributes','intersection','nolimit','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','voicePause','flatMap','Agents','sequelize','transaction'];(function(_0x4f33a1,_0x3808ea){var _0x571700=function(_0x1c65c6){while(--_0x1c65c6){_0x4f33a1['push'](_0x4f33a1['shift']());}};_0x571700(++_0x3808ea);}(_0x8fcf,0x1c9));var _0xf8fc=function(_0x5231f0,_0x2753dd){_0x5231f0=_0x5231f0-0x0;var _0x4b6795=_0x8fcf[_0x5231f0];return _0x4b6795;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf8fc('0x0'));var zipdir=require(_0xf8fc('0x1'));var jsonpatch=require(_0xf8fc('0x2'));var rp=require(_0xf8fc('0x3'));var moment=require(_0xf8fc('0x4'));var BPromise=require(_0xf8fc('0x5'));var Mustache=require(_0xf8fc('0x6'));var util=require(_0xf8fc('0x7'));var path=require(_0xf8fc('0x8'));var sox=require(_0xf8fc('0x9'));var csv=require(_0xf8fc('0xa'));var ejs=require(_0xf8fc('0xb'));var fs=require('fs');var fs_extra=require(_0xf8fc('0xc'));var _=require('lodash');var squel=require(_0xf8fc('0xd'));var crypto=require(_0xf8fc('0xe'));var jsforce=require(_0xf8fc('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf8fc('0x10'));var Papa=require('papaparse');var Redis=require(_0xf8fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf8fc('0x12'));var as=require(_0xf8fc('0x13'));var hardwareService=require(_0xf8fc('0x14'));var logger=require(_0xf8fc('0x15'))(_0xf8fc('0x16'));var utils=require('../../config/utils');var config=require(_0xf8fc('0x17'));var licenseUtil=require(_0xf8fc('0x18'));var db=require(_0xf8fc('0x19'))['db'];config[_0xf8fc('0x1a')]=_[_0xf8fc('0x1b')](config[_0xf8fc('0x1a')],{'host':_0xf8fc('0x1c'),'port':0x18eb});var socket=require(_0xf8fc('0x1d'))(new Redis(config[_0xf8fc('0x1a')]));require(_0xf8fc('0x1e'))[_0xf8fc('0x1f')](socket);function respondWithStatusCode(_0x3f01cc,_0x1afd5f){_0x1afd5f=_0x1afd5f||0xcc;return function(_0x4b1cee){if(_0x4b1cee){return _0x3f01cc['sendStatus'](_0x1afd5f);}return _0x3f01cc[_0xf8fc('0x20')](_0x1afd5f)[_0xf8fc('0x21')]();};}function respondWithResult(_0x51f5a4,_0x219abb){_0x219abb=_0x219abb||0xc8;return function(_0xc60881){if(_0xc60881){return _0x51f5a4[_0xf8fc('0x20')](_0x219abb)[_0xf8fc('0x22')](_0xc60881);}};}function respondWithFilteredResult(_0x52cf36,_0xead5e6){return function(_0x264821){if(_0x264821){var _0x55e4d5=typeof _0xead5e6[_0xf8fc('0x23')]===_0xf8fc('0x24')&&typeof _0xead5e6[_0xf8fc('0x25')]===_0xf8fc('0x24');var _0x4747a0=_0x264821['count'];var _0x3fd913=_0x55e4d5?0x0:_0xead5e6[_0xf8fc('0x23')];var _0x2ea8d6=_0x55e4d5?_0x264821['count']:_0xead5e6[_0xf8fc('0x23')]+_0xead5e6[_0xf8fc('0x25')];var _0xf8cd73;if(_0x2ea8d6>=_0x4747a0){_0x2ea8d6=_0x4747a0;_0xf8cd73=0xc8;}else{_0xf8cd73=0xce;}_0x52cf36[_0xf8fc('0x20')](_0xf8cd73);return _0x52cf36[_0xf8fc('0x26')](_0xf8fc('0x27'),_0x3fd913+'-'+_0x2ea8d6+'/'+_0x4747a0)[_0xf8fc('0x22')](_0x264821);}return null;};}function patchUpdates(_0x341bc2){return function(_0x5561f3){try{jsonpatch[_0xf8fc('0x28')](_0x5561f3,_0x341bc2,!![]);}catch(_0x289fdc){return BPromise[_0xf8fc('0x29')](_0x289fdc);}return _0x5561f3[_0xf8fc('0x2a')]();};}function saveUpdates(_0x942de1,_0x4ad15d){return function(_0x36f8bd){if(_0x36f8bd){return _0x36f8bd[_0xf8fc('0x2b')](_0x942de1)[_0xf8fc('0x2c')](function(_0x145f61){return _0x145f61;});}return null;};}function removeEntity(_0x18605c,_0x31e573){return function(_0x5c8467){if(_0x5c8467){return _0x5c8467['destroy']()[_0xf8fc('0x2c')](function(){var _0xeb501c=_0x5c8467[_0xf8fc('0x2d')]({'plain':!![]});var _0x5d4322='SmsQueues';return db[_0xf8fc('0x2e')]['destroy']({'where':{'type':_0x5d4322,'resourceId':_0xeb501c['id']}})['then'](function(){return _0x5c8467;});})['then'](function(){_0x18605c['status'](0xcc)[_0xf8fc('0x21')]();});}};}function handleEntityNotFound(_0x24d814,_0x19212a){return function(_0x43fa3d){if(!_0x43fa3d){_0x24d814[_0xf8fc('0x2f')](0x194);}return _0x43fa3d;};}function handleError(_0x1faa4d,_0x50f773){_0x50f773=_0x50f773||0x1f4;return function(_0xdf08e7){logger[_0xf8fc('0x30')](_0xdf08e7['stack']);if(_0xdf08e7[_0xf8fc('0x31')]){delete _0xdf08e7[_0xf8fc('0x31')];}_0x1faa4d[_0xf8fc('0x20')](_0x50f773)['send'](_0xdf08e7);};}exports['index']=function(_0x3f92f8,_0x454ee8){var _0x1d621a={},_0x35862c={},_0x335608={'count':0x0,'rows':[]};var _0x39c4b1=_['map'](db['SmsQueue']['rawAttributes'],function(_0x4bf837){return{'name':_0x4bf837['fieldName'],'type':_0x4bf837['type'][_0xf8fc('0x32')]};});_0x35862c[_0xf8fc('0x33')]=_[_0xf8fc('0x34')](_0x39c4b1,_0xf8fc('0x31'));_0x35862c[_0xf8fc('0x35')]=_[_0xf8fc('0x36')](_0x3f92f8[_0xf8fc('0x35')]);_0x35862c[_0xf8fc('0x37')]=_['intersection'](_0x35862c[_0xf8fc('0x33')],_0x35862c[_0xf8fc('0x35')]);_0x1d621a[_0xf8fc('0x38')]=_['intersection'](_0x35862c[_0xf8fc('0x33')],qs[_0xf8fc('0x39')](_0x3f92f8[_0xf8fc('0x35')][_0xf8fc('0x39')]));_0x1d621a[_0xf8fc('0x38')]=_0x1d621a[_0xf8fc('0x38')][_0xf8fc('0x3a')]?_0x1d621a['attributes']:_0x35862c[_0xf8fc('0x33')];if(!_0x3f92f8[_0xf8fc('0x35')][_0xf8fc('0x3b')]('nolimit')){_0x1d621a['limit']=qs['limit'](_0x3f92f8['query'][_0xf8fc('0x25')]);_0x1d621a[_0xf8fc('0x23')]=qs[_0xf8fc('0x23')](_0x3f92f8[_0xf8fc('0x35')]['offset']);}_0x1d621a[_0xf8fc('0x3c')]=qs[_0xf8fc('0x3d')](_0x3f92f8['query'][_0xf8fc('0x3d')]);_0x1d621a['where']=qs['filters'](_[_0xf8fc('0x3e')](_0x3f92f8[_0xf8fc('0x35')],_0x35862c[_0xf8fc('0x37')]),_0x39c4b1);if(_0x3f92f8[_0xf8fc('0x35')]['filter']){_0x1d621a[_0xf8fc('0x3f')]=_[_0xf8fc('0x40')](_0x1d621a[_0xf8fc('0x3f')],{'$or':_[_0xf8fc('0x34')](_0x39c4b1,function(_0x334c3d){if(_0x334c3d[_0xf8fc('0x41')]!=='VIRTUAL'){var _0x26e118={};_0x26e118[_0x334c3d[_0xf8fc('0x31')]]={'$like':'%'+_0x3f92f8['query'][_0xf8fc('0x42')]+'%'};return _0x26e118;}})});}_0x1d621a=_[_0xf8fc('0x40')]({},_0x1d621a,_0x3f92f8['options']);var _0xc43a61={'where':_0x1d621a[_0xf8fc('0x3f')]};return db['SmsQueue'][_0xf8fc('0x43')](_0xc43a61)['then'](function(_0x319d16){_0x335608[_0xf8fc('0x43')]=_0x319d16;if(_0x3f92f8[_0xf8fc('0x35')]['includeAll']){_0x1d621a[_0xf8fc('0x44')]=[{'all':!![]}];}return db[_0xf8fc('0x45')][_0xf8fc('0x46')](_0x1d621a);})[_0xf8fc('0x2c')](function(_0x59dc9a){_0x335608['rows']=_0x59dc9a;return _0x335608;})[_0xf8fc('0x2c')](respondWithFilteredResult(_0x454ee8,_0x1d621a))['catch'](handleError(_0x454ee8,null));};exports[_0xf8fc('0x47')]=function(_0x2cfc9e,_0x1dd794){var _0x1b0263={'raw':!![],'where':{'id':_0x2cfc9e[_0xf8fc('0x48')]['id']}},_0x2aff4b={};_0x2aff4b[_0xf8fc('0x33')]=_[_0xf8fc('0x36')](db[_0xf8fc('0x45')]['rawAttributes']);_0x2aff4b[_0xf8fc('0x35')]=_[_0xf8fc('0x36')](_0x2cfc9e[_0xf8fc('0x35')]);_0x2aff4b[_0xf8fc('0x37')]=_['intersection'](_0x2aff4b[_0xf8fc('0x33')],_0x2aff4b[_0xf8fc('0x35')]);_0x1b0263[_0xf8fc('0x38')]=_['intersection'](_0x2aff4b[_0xf8fc('0x33')],qs[_0xf8fc('0x39')](_0x2cfc9e[_0xf8fc('0x35')][_0xf8fc('0x39')]));_0x1b0263[_0xf8fc('0x38')]=_0x1b0263['attributes'][_0xf8fc('0x3a')]?_0x1b0263['attributes']:_0x2aff4b[_0xf8fc('0x33')];if(_0x2cfc9e[_0xf8fc('0x35')]['includeAll']){_0x1b0263[_0xf8fc('0x44')]=[{'all':!![]}];}_0x1b0263=_[_0xf8fc('0x40')]({},_0x1b0263,_0x2cfc9e[_0xf8fc('0x49')]);return db[_0xf8fc('0x45')][_0xf8fc('0x4a')](_0x1b0263)[_0xf8fc('0x2c')](handleEntityNotFound(_0x1dd794,null))[_0xf8fc('0x2c')](respondWithResult(_0x1dd794,null))[_0xf8fc('0x4b')](handleError(_0x1dd794,null));};exports['create']=function(_0x35fce5,_0x2653be){return db[_0xf8fc('0x45')][_0xf8fc('0x4c')](_0x35fce5[_0xf8fc('0x4d')],{})[_0xf8fc('0x2c')](function(_0x57a600){var _0x3c4eb0=_0x35fce5['user']['get']({'plain':!![]});if(!_0x3c4eb0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c4eb0[_0xf8fc('0x4e')]==='user'){var _0x26ce05=_0x57a600[_0xf8fc('0x2d')]({'plain':!![]});var _0x34ec81=_0xf8fc('0x4f');return db[_0xf8fc('0x50')][_0xf8fc('0x4a')]({'where':{'name':_0x34ec81,'userProfileId':_0x3c4eb0[_0xf8fc('0x51')]},'raw':!![]})[_0xf8fc('0x2c')](function(_0x3d70b7){if(_0x3d70b7&&_0x3d70b7[_0xf8fc('0x52')]===0x0){return db[_0xf8fc('0x2e')][_0xf8fc('0x4c')]({'name':_0x26ce05['name'],'resourceId':_0x26ce05['id'],'type':_0x3d70b7[_0xf8fc('0x31')],'sectionId':_0x3d70b7['id']},{})[_0xf8fc('0x2c')](function(){return _0x57a600;});}else{return _0x57a600;}})[_0xf8fc('0x4b')](function(_0x441c73){logger[_0xf8fc('0x30')](_0xf8fc('0x53'),_0x441c73);throw _0x441c73;});}return _0x57a600;})['then'](respondWithResult(_0x2653be,0xc9))['catch'](handleError(_0x2653be,null));};exports[_0xf8fc('0x2b')]=function(_0x14a43f,_0x2bc7e4){if(_0x14a43f[_0xf8fc('0x4d')]['id']){delete _0x14a43f['body']['id'];}return db[_0xf8fc('0x45')][_0xf8fc('0x4a')]({'where':{'id':_0x14a43f['params']['id']}})[_0xf8fc('0x2c')](handleEntityNotFound(_0x2bc7e4,null))[_0xf8fc('0x2c')](saveUpdates(_0x14a43f[_0xf8fc('0x4d')],null))['then'](respondWithResult(_0x2bc7e4,null))[_0xf8fc('0x4b')](handleError(_0x2bc7e4,null));};exports['destroy']=function(_0x247cf6,_0xc0aef8){return db[_0xf8fc('0x45')][_0xf8fc('0x4a')]({'where':{'id':_0x247cf6['params']['id']}})[_0xf8fc('0x2c')](handleEntityNotFound(_0xc0aef8,null))[_0xf8fc('0x2c')](removeEntity(_0xc0aef8,null))[_0xf8fc('0x4b')](handleError(_0xc0aef8,null));};exports[_0xf8fc('0x54')]=function(_0x2c599f,_0x5ac91f){return db[_0xf8fc('0x45')]['describe']()[_0xf8fc('0x2c')](respondWithResult(_0x5ac91f,null))[_0xf8fc('0x4b')](handleError(_0x5ac91f,null));};exports['getMembers']=function(_0x5bc763,_0x583591,_0x305385){var _0x14bd7b={'raw':!![],'where':{}},_0x166d03={},_0x133cd9;return db[_0xf8fc('0x45')][_0xf8fc('0x55')]({'where':{'id':_0x5bc763[_0xf8fc('0x48')]['id']}})[_0xf8fc('0x2c')](handleEntityNotFound(_0x583591,null))[_0xf8fc('0x2c')](function(_0xfa12a5){if(_0xfa12a5){_0x133cd9=_0xfa12a5[_0xf8fc('0x2d')]({'plain':!![]});_0x166d03[_0xf8fc('0x33')]=_['keys'](db[_0xf8fc('0x56')][_0xf8fc('0x57')]);_0x166d03[_0xf8fc('0x35')]=_['keys'](_0x5bc763[_0xf8fc('0x35')]);_0x166d03[_0xf8fc('0x37')]=_['intersection'](_0x166d03['model'],_0x166d03[_0xf8fc('0x35')]);_0x14bd7b[_0xf8fc('0x38')]=_[_0xf8fc('0x58')](_0x166d03[_0xf8fc('0x33')],qs[_0xf8fc('0x39')](_0x5bc763['query'][_0xf8fc('0x39')]));_0x14bd7b[_0xf8fc('0x38')]=_0x14bd7b[_0xf8fc('0x38')][_0xf8fc('0x3a')]?_0x14bd7b[_0xf8fc('0x38')]:_0x166d03[_0xf8fc('0x33')];if(!_0x5bc763['query'][_0xf8fc('0x3b')](_0xf8fc('0x59'))){_0x14bd7b[_0xf8fc('0x25')]=qs[_0xf8fc('0x25')](_0x5bc763['query'][_0xf8fc('0x25')]);_0x14bd7b[_0xf8fc('0x23')]=qs[_0xf8fc('0x23')](_0x5bc763['query'][_0xf8fc('0x23')]);}_0x14bd7b[_0xf8fc('0x3c')]=qs[_0xf8fc('0x3d')](_0x5bc763[_0xf8fc('0x35')][_0xf8fc('0x3d')]);_0x14bd7b[_0xf8fc('0x3f')]=qs[_0xf8fc('0x37')](_[_0xf8fc('0x3e')](_0x5bc763['query'],_0x166d03[_0xf8fc('0x37')]));_0x14bd7b[_0xf8fc('0x3f')][_0xf8fc('0x5a')]=_0xfa12a5['id'];if(_0x5bc763[_0xf8fc('0x35')]['filter']){_0x14bd7b['where']=_[_0xf8fc('0x40')](_0x14bd7b[_0xf8fc('0x3f')],{'$or':_[_0xf8fc('0x34')](_0x14bd7b['attributes'],function(_0x2481f3){var _0x420d42={};_0x420d42[_0x2481f3]={'$like':'%'+_0x5bc763[_0xf8fc('0x35')]['filter']+'%'};return _0x420d42;})});}_0x14bd7b=_[_0xf8fc('0x40')]({},_0x14bd7b,_0x5bc763['options']);return db['UserSmsQueue']['findAll'](_0x14bd7b);}})[_0xf8fc('0x2c')](function(_0x726812){if(_0x726812){return db[_0xf8fc('0x5b')][_0xf8fc('0x5c')]({'where':{'id':_[_0xf8fc('0x34')](_0x726812,_0xf8fc('0x5d')),'role':_0xf8fc('0x5e')},'attributes':['id',_0xf8fc('0x31'),_0xf8fc('0x5f'),_0xf8fc('0x60'),_0xf8fc('0x61')]});}})[_0xf8fc('0x2c')](function(_0x372d44){if(_0x372d44){return{'count':_0x372d44[_0xf8fc('0x43')],'rows':_[_0xf8fc('0x34')](_0x372d44[_0xf8fc('0x62')],function(_0x54ee3f){return{'membername':_0x54ee3f[_0xf8fc('0x31')],'UserId':_0x54ee3f['id'],'queue_name':_0x133cd9[_0xf8fc('0x31')],'SmsQueueId':_0x133cd9['id'],'interface':util[_0xf8fc('0x63')](_0xf8fc('0x64'),_0xf8fc('0x65'),_0x54ee3f[_0xf8fc('0x31')]),'penalty':0x0,'paused':_0x54ee3f[_0xf8fc('0x5f')],'createdAt':_0x54ee3f['createdAt'],'updatedAt':_0x54ee3f[_0xf8fc('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf8fc('0x2c')](respondWithFilteredResult(_0x583591,_0x14bd7b))[_0xf8fc('0x4b')](handleError(_0x583591,null));};exports[_0xf8fc('0x66')]=function(_0x238233,_0x8ef2ad,_0x5a2215){var _0x5e2e0a={};var _0x3b77ea={};var _0x2f0067;var _0x913790;return db['SmsQueue'][_0xf8fc('0x55')]({'where':{'id':_0x238233[_0xf8fc('0x48')]['id']}})['then'](handleEntityNotFound(_0x8ef2ad,null))['then'](function(_0x46e964){if(_0x46e964){_0x2f0067=_0x46e964;_0x3b77ea[_0xf8fc('0x33')]=_['keys'](db[_0xf8fc('0x67')][_0xf8fc('0x57')]);_0x3b77ea[_0xf8fc('0x35')]=_['keys'](_0x238233['query']);_0x3b77ea[_0xf8fc('0x37')]=_[_0xf8fc('0x58')](_0x3b77ea[_0xf8fc('0x33')],_0x3b77ea[_0xf8fc('0x35')]);_0x5e2e0a['attributes']=_['intersection'](_0x3b77ea[_0xf8fc('0x33')],qs[_0xf8fc('0x39')](_0x238233[_0xf8fc('0x35')][_0xf8fc('0x39')]));_0x5e2e0a['attributes']=_0x5e2e0a['attributes'][_0xf8fc('0x3a')]?_0x5e2e0a[_0xf8fc('0x38')]:_0x3b77ea[_0xf8fc('0x33')];_0x5e2e0a[_0xf8fc('0x3c')]=qs[_0xf8fc('0x3d')](_0x238233[_0xf8fc('0x35')]['sort']);_0x5e2e0a[_0xf8fc('0x3f')]=qs[_0xf8fc('0x37')](_['pick'](_0x238233[_0xf8fc('0x35')],_0x3b77ea[_0xf8fc('0x37')]));if(_0x238233[_0xf8fc('0x35')]['filter']){_0x5e2e0a[_0xf8fc('0x3f')]=_[_0xf8fc('0x40')](_0x5e2e0a[_0xf8fc('0x3f')],{'$or':_['map'](_0x5e2e0a['attributes'],function(_0x2a09a4){var _0x3b8a12={};_0x3b8a12[_0x2a09a4]={'$like':'%'+_0x238233[_0xf8fc('0x35')]['filter']+'%'};return _0x3b8a12;})});}_0x5e2e0a=_[_0xf8fc('0x40')]({},_0x5e2e0a,_0x238233[_0xf8fc('0x49')]);return _0x2f0067['getTeams'](_0x5e2e0a);}})[_0xf8fc('0x2c')](function(_0x652f55){if(_0x652f55){_0x913790=_0x652f55['length'];if(!_0x238233[_0xf8fc('0x35')][_0xf8fc('0x3b')](_0xf8fc('0x59'))){_0x5e2e0a[_0xf8fc('0x25')]=qs[_0xf8fc('0x25')](_0x238233[_0xf8fc('0x35')][_0xf8fc('0x25')]);_0x5e2e0a[_0xf8fc('0x23')]=qs['offset'](_0x238233['query'][_0xf8fc('0x23')]);}return _0x2f0067[_0xf8fc('0x66')](_0x5e2e0a);}})[_0xf8fc('0x2c')](function(_0x38e726){if(_0x38e726){return _0x38e726?{'count':_0x913790,'rows':_0x38e726}:null;}})[_0xf8fc('0x2c')](respondWithResult(_0x8ef2ad,null))[_0xf8fc('0x4b')](handleError(_0x8ef2ad,null));};exports[_0xf8fc('0x68')]=function(_0xc76202,_0x54aea8,_0x84442e){var _0xae593f=_0xc76202[_0xf8fc('0x4d')][_0xf8fc('0x69')];return db[_0xf8fc('0x67')][_0xf8fc('0x46')]({'where':{'id':_0xae593f},'attributes':['id'],'include':[{'model':db[_0xf8fc('0x5b')],'as':'Agents','attributes':['id',_0xf8fc('0x31'),'online',_0xf8fc('0x6a'),'interface'],'raw':!![]}]})['then'](function(_0x42d08d){if(_0x42d08d){var _0xf80fcc=_[_0xf8fc('0x6b')](_0x42d08d,function(_0xc126a5){var _0x3f381b=_0xc126a5[_0xf8fc('0x2d')]({'plain':!![]});return _0x3f381b[_0xf8fc('0x6c')];});return db[_0xf8fc('0x45')][_0xf8fc('0x4a')]({'where':{'id':_0xc76202['params']['id']}})[_0xf8fc('0x2c')](function(_0x5d868b){return db[_0xf8fc('0x6d')][_0xf8fc('0x6e')](function(_0xffc9ec){return _0x5d868b['addTeams'](_0xae593f,{'transaction':_0xffc9ec})[_0xf8fc('0x2c')](function(){return BPromise[_0xf8fc('0x6f')](_0xf80fcc,function(_0x26bd6f){return db[_0xf8fc('0x56')][_0xf8fc('0x70')]({'where':{'UserId':_0x26bd6f['id'],'SmsQueueId':_0xc76202[_0xf8fc('0x48')]['id']},'transaction':_0xffc9ec});});})[_0xf8fc('0x2c')](function(){_0xf80fcc[_0xf8fc('0x71')](function(_0x2d523f){socket[_0xf8fc('0x72')](_0xf8fc('0x73'),{'UserId':_0x2d523f['id'],'SmsQueueId':_0x5d868b['id']});});});});});}})[_0xf8fc('0x2c')](respondWithStatusCode(_0x54aea8,null))[_0xf8fc('0x4b')](handleError(_0x54aea8,null));};exports[_0xf8fc('0x74')]=function(_0x46c410,_0x477e35,_0xff4308){return db[_0xf8fc('0x67')][_0xf8fc('0x46')]({'where':{'id':_0x46c410['query'][_0xf8fc('0x69')]},'attributes':['id'],'include':[{'model':db[_0xf8fc('0x5b')],'as':_0xf8fc('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xf8fc('0x2c')](handleEntityNotFound(_0x477e35,null))[_0xf8fc('0x2c')](function(_0x6c15c4){var _0x3d6e03=_[_0xf8fc('0x34')](_0x6c15c4,'id');var _0x4417cb=[];var _0x46f6d2=[];var _0x5f20a4=squel[_0xf8fc('0x75')]();_0x5f20a4[_0xf8fc('0x76')]('tq.TeamId')[_0xf8fc('0x77')](_0xf8fc('0x78'),'tq')[_0xf8fc('0x79')](_0xf8fc('0x7a'),'ut',_0xf8fc('0x7b'))[_0xf8fc('0x3f')](_0xf8fc('0x7c'),_0x46c410['params']['id']);for(var _0x1e6b68=0x0;_0x1e6b68<_0x6c15c4['length'];_0x1e6b68+=0x1){let _0x3c4196=_0x6c15c4[_0x1e6b68];for(var _0x326f92=0x0;_0x326f92<_0x3c4196['Agents']['length'];_0x326f92+=0x1){let _0x556eb9=_0x3c4196[_0xf8fc('0x6c')][_0x326f92];var _0x583432=_0x5f20a4[_0xf8fc('0x7d')]();_0x583432[_0xf8fc('0x3f')]('ut.UserId\x20=\x20?',_0x556eb9['id']);_0x46f6d2[_0xf8fc('0x7e')](db[_0xf8fc('0x6d')][_0xf8fc('0x35')](_0x583432[_0xf8fc('0x7f')](),{'type':db[_0xf8fc('0x6d')]['QueryTypes'][_0xf8fc('0x80')]})[_0xf8fc('0x2c')](function(_0x274908){if(_0x274908['length']===0x1){return _0x556eb9['id'];}else{var _0x2966cb=_[_0xf8fc('0x81')](_[_0xf8fc('0x34')](_0x274908,'TeamId'),function(_0x59625a){return _[_0xf8fc('0x82')](_0x3d6e03,_0x59625a);});if(_0x2966cb){return _0x556eb9['id'];}}}));}}return BPromise[_0xf8fc('0x83')](_0x46f6d2)[_0xf8fc('0x2c')](function(_0x29687e){_0x4417cb=_(_0x4417cb)[_0xf8fc('0x84')](_0x29687e)[_0xf8fc('0x85')]()[_0xf8fc('0x86')]();return db['SmsQueue']['find']({'where':{'id':_0x46c410[_0xf8fc('0x48')]['id']}})['then'](function(_0x15e5bc){return db[_0xf8fc('0x6d')][_0xf8fc('0x6e')](function(_0x5567f9){return _0x15e5bc['removeTeams'](_0x46c410[_0xf8fc('0x35')][_0xf8fc('0x69')],{'transaction':_0x5567f9})['then'](function(){if(!_[_0xf8fc('0x87')](_0x4417cb)){return _0x15e5bc[_0xf8fc('0x88')](_0x4417cb,{'transaction':_0x5567f9});}})[_0xf8fc('0x2c')](function(){_0x4417cb[_0xf8fc('0x71')](function(_0x49c82b){socket[_0xf8fc('0x72')](_0xf8fc('0x89'),{'UserId':_0x49c82b,'SmsQueueId':_0x15e5bc['id']});});});});});});})[_0xf8fc('0x2c')](respondWithStatusCode(_0x477e35,null))[_0xf8fc('0x4b')](handleError(_0x477e35,null));};exports['addAgents']=function(_0x2e7c3f,_0x1f23ec,_0x4bafd2){return db[_0xf8fc('0x45')]['find']({'where':{'id':_0x2e7c3f[_0xf8fc('0x48')]['id']}})[_0xf8fc('0x2c')](handleEntityNotFound(_0x1f23ec,null))[_0xf8fc('0x2c')](function(_0x1b1aae){if(_0x1b1aae){return _0x1b1aae[_0xf8fc('0x8a')](_0x2e7c3f['body'][_0xf8fc('0x69')],_['omit'](_0x2e7c3f[_0xf8fc('0x4d')],[_0xf8fc('0x69'),'id'])||{})[_0xf8fc('0x8b')](function(_0x165056){for(var _0x17bf27=0x0;_0x17bf27<_0x2e7c3f[_0xf8fc('0x4d')][_0xf8fc('0x69')][_0xf8fc('0x3a')];_0x17bf27+=0x1){socket[_0xf8fc('0x72')](_0xf8fc('0x73'),{'UserId':Number(_0x2e7c3f[_0xf8fc('0x4d')][_0xf8fc('0x69')][_0x17bf27]),'SmsQueueId':Number(_0x2e7c3f[_0xf8fc('0x48')]['id'])});}return _0x165056;});}})['then'](respondWithResult(_0x1f23ec,null))[_0xf8fc('0x4b')](handleError(_0x1f23ec,null));};exports[_0xf8fc('0x88')]=function(_0x19af95,_0x1960b8,_0x45572e){return db[_0xf8fc('0x45')][_0xf8fc('0x4a')]({'where':{'id':_0x19af95['params']['id']}})[_0xf8fc('0x2c')](handleEntityNotFound(_0x1960b8,null))[_0xf8fc('0x2c')](function(_0x4be921){if(_0x4be921){return _0x4be921[_0xf8fc('0x88')](_0x19af95[_0xf8fc('0x35')]['ids'])['then'](function(){if(_[_0xf8fc('0x8c')](_0x19af95['query']['ids'])){for(var _0x300332=0x0;_0x300332<_0x19af95[_0xf8fc('0x35')][_0xf8fc('0x69')][_0xf8fc('0x3a')];_0x300332+=0x1){socket[_0xf8fc('0x72')](_0xf8fc('0x89'),{'UserId':Number(_0x19af95[_0xf8fc('0x35')]['ids'][_0x300332]),'SmsQueueId':Number(_0x19af95[_0xf8fc('0x48')]['id'])});}}else{socket[_0xf8fc('0x72')]('userSmsQueue:remove',{'UserId':Number(_0x19af95[_0xf8fc('0x35')][_0xf8fc('0x69')]),'SmsQueueId':Number(_0x19af95[_0xf8fc('0x48')]['id'])});}});}})[_0xf8fc('0x2c')](respondWithStatusCode(_0x1960b8,null))[_0xf8fc('0x4b')](handleError(_0x1960b8,null));};exports['getAgents']=function(_0x4359de,_0x57e21a,_0x3542ea){var _0x1838da={};var _0x66fdcb={};var _0x10adf4;var _0x29a55f;return db[_0xf8fc('0x45')]['findOne']({'where':{'id':_0x4359de[_0xf8fc('0x48')]['id']}})[_0xf8fc('0x2c')](handleEntityNotFound(_0x57e21a,null))['then'](function(_0x2d0551){if(_0x2d0551){_0x10adf4=_0x2d0551;_0x66fdcb[_0xf8fc('0x33')]=_[_0xf8fc('0x36')](db[_0xf8fc('0x5b')][_0xf8fc('0x57')]);_0x66fdcb[_0xf8fc('0x35')]=_['keys'](_0x4359de[_0xf8fc('0x35')]);_0x66fdcb[_0xf8fc('0x37')]=_[_0xf8fc('0x58')](_0x66fdcb[_0xf8fc('0x33')],_0x66fdcb[_0xf8fc('0x35')]);_0x1838da[_0xf8fc('0x38')]=_[_0xf8fc('0x58')](_0x66fdcb[_0xf8fc('0x33')],qs[_0xf8fc('0x39')](_0x4359de[_0xf8fc('0x35')][_0xf8fc('0x39')]));_0x1838da[_0xf8fc('0x38')]=_0x1838da[_0xf8fc('0x38')][_0xf8fc('0x3a')]?_0x1838da[_0xf8fc('0x38')]:_0x66fdcb['model'];_0x1838da[_0xf8fc('0x3c')]=qs[_0xf8fc('0x3d')](_0x4359de['query'][_0xf8fc('0x3d')]);_0x1838da[_0xf8fc('0x3f')]=qs[_0xf8fc('0x37')](_[_0xf8fc('0x3e')](_0x4359de[_0xf8fc('0x35')],_0x66fdcb['filters']));if(_0x4359de[_0xf8fc('0x35')][_0xf8fc('0x42')]){_0x1838da[_0xf8fc('0x3f')]=_[_0xf8fc('0x40')](_0x1838da['where'],{'$or':_['map'](_0x1838da['attributes'],function(_0x3c98cf){var _0xfe1930={};_0xfe1930[_0x3c98cf]={'$like':'%'+_0x4359de[_0xf8fc('0x35')][_0xf8fc('0x42')]+'%'};return _0xfe1930;})});}_0x1838da=_['merge']({},_0x1838da,_0x4359de[_0xf8fc('0x49')]);return _0x10adf4[_0xf8fc('0x8d')](_0x1838da);}})['then'](function(_0x5cbca0){if(_0x5cbca0){_0x29a55f=_0x5cbca0['length'];if(!_0x4359de[_0xf8fc('0x35')][_0xf8fc('0x3b')]('nolimit')){_0x1838da[_0xf8fc('0x25')]=qs[_0xf8fc('0x25')](_0x4359de[_0xf8fc('0x35')][_0xf8fc('0x25')]);_0x1838da[_0xf8fc('0x23')]=qs[_0xf8fc('0x23')](_0x4359de['query']['offset']);}return _0x10adf4['getAgents'](_0x1838da);}})['then'](function(_0x35c629){if(_0x35c629){return _0x35c629?{'count':_0x29a55f,'rows':_0x35c629}:null;}})[_0xf8fc('0x2c')](respondWithResult(_0x57e21a,null))[_0xf8fc('0x4b')](handleError(_0x57e21a,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 54a0a2f..d35583f 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 _0xb84f=['hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb84f,0xcb));var _0xfb84=function(_0x24a88c,_0x4b7b0f){_0x24a88c=_0x24a88c-0x0;var _0x47da79=_0xb84f[_0x24a88c];return _0x47da79;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xfb84('0x0'))['db'][_0xfb84('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xfb84('0x2')](0x0);var events={'afterCreate':_0xfb84('0x3'),'afterUpdate':_0xfb84('0x4'),'afterDestroy':_0xfb84('0x5')};function emitEvent(_0xab426e){return function(_0x492a41,_0xde896c,_0x495b99){SmsQueueEvents['emit'](_0xab426e+':'+_0x492a41['id'],_0x492a41);SmsQueueEvents[_0xfb84('0x6')](_0xab426e,_0x492a41);_0x495b99(null);};}for(var e in events){if(events[_0xfb84('0x7')](e)){var event=events[e];SmsQueue[_0xfb84('0x8')](e,emitEvent(event));}}module[_0xfb84('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0xed66=['hasOwnProperty','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','emit'];(function(_0x4f275a,_0x8dcd4f){var _0xe3bce6=function(_0x1272e9){while(--_0x1272e9){_0x4f275a['push'](_0x4f275a['shift']());}};_0xe3bce6(++_0x8dcd4f);}(_0xed66,0x1a0));var _0x6ed6=function(_0x551906,_0x569941){_0x551906=_0x551906-0x0;var _0x58bfb6=_0xed66[_0x551906];return _0x58bfb6;};'use strict';var EventEmitter=require(_0x6ed6('0x0'));var SmsQueue=require(_0x6ed6('0x1'))['db'][_0x6ed6('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x6ed6('0x3')](0x0);var events={'afterCreate':_0x6ed6('0x4'),'afterUpdate':_0x6ed6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5319ef){return function(_0x4e7ec9,_0x4214bd,_0x47a2ca){SmsQueueEvents[_0x6ed6('0x6')](_0x5319ef+':'+_0x4e7ec9['id'],_0x4e7ec9);SmsQueueEvents['emit'](_0x5319ef,_0x4e7ec9);_0x47a2ca(null);};}for(var e in events){if(events[_0x6ed6('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x6ed6('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 34a6828..19592b0 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 _0x03d8=['path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','sms_queues','util','moment','request-promise'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x03d8,0x1c9));var _0x803d=function(_0x472500,_0x5864cd){_0x472500=_0x472500-0x0;var _0xd11624=_0x03d8[_0x472500];return _0xd11624;};'use strict';var _=require('lodash');var util=require(_0x803d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x803d('0x1'));var BPromise=require('bluebird');var rp=require(_0x803d('0x2'));var fs=require('fs');var path=require(_0x803d('0x3'));var rimraf=require(_0x803d('0x4'));var config=require(_0x803d('0x5'));var attributes=require(_0x803d('0x6'));module[_0x803d('0x7')]=function(_0x513d2f,_0x61069e){return _0x513d2f[_0x803d('0x8')]('SmsQueue',attributes,{'tableName':_0x803d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb75=['path','rimraf','../../config/environment','./smsQueue.attributes','define','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16b12e,_0x579639){var _0x370fc5=function(_0x532c8a){while(--_0x532c8a){_0x16b12e['push'](_0x16b12e['shift']());}};_0x370fc5(++_0x579639);}(_0xfb75,0xc9));var _0x5fb7=function(_0x4beed5,_0x187b61){_0x4beed5=_0x4beed5-0x0;var _0x184fba=_0xfb75[_0x4beed5];return _0x184fba;};'use strict';var _=require(_0x5fb7('0x0'));var util=require(_0x5fb7('0x1'));var logger=require(_0x5fb7('0x2'))(_0x5fb7('0x3'));var moment=require(_0x5fb7('0x4'));var BPromise=require(_0x5fb7('0x5'));var rp=require(_0x5fb7('0x6'));var fs=require('fs');var path=require(_0x5fb7('0x7'));var rimraf=require(_0x5fb7('0x8'));var config=require(_0x5fb7('0x9'));var attributes=require(_0x5fb7('0xa'));module['exports']=function(_0x29d40c,_0x46f3c0){return _0x29d40c[_0x5fb7('0xb')]('SmsQueue',attributes,{'tableName':_0x5fb7('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 7a039ae..21af6a4 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 _0x138b=['debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSmsQueue','SmsQueue','findAll','options','attributes','include','map','model','catch','ShowSmsQueue','find','where','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x138b,0x10b));var _0xb138=function(_0x4104aa,_0x3a8513){_0x4104aa=_0x4104aa-0x0;var _0x28d295=_0x138b[_0x4104aa];return _0x28d295;};'use strict';var _=require('lodash');var util=require(_0xb138('0x0'));var moment=require(_0xb138('0x1'));var BPromise=require('bluebird');var rs=require(_0xb138('0x2'));var fs=require('fs');var Redis=require(_0xb138('0x3'));var db=require(_0xb138('0x4'))['db'];var utils=require(_0xb138('0x5'));var logger=require(_0xb138('0x6'))(_0xb138('0x7'));var config=require(_0xb138('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb138('0x9')]['http']({'port':0x232a});config[_0xb138('0xa')]=_[_0xb138('0xb')](config[_0xb138('0xa')],{'host':_0xb138('0xc'),'port':0x18eb});var socket=require(_0xb138('0xd'))(new Redis(config[_0xb138('0xa')]));require(_0xb138('0xe'))['register'](socket);function respondWithRpcPromise(_0xa0e24,_0x5f2fe8,_0x1b8bf2){return new BPromise(function(_0x3aa842,_0x129934){return client[_0xb138('0xf')](_0xa0e24,_0x1b8bf2)['then'](function(_0x1617b4){logger[_0xb138('0x10')](_0xb138('0x11'),_0x5f2fe8,_0xb138('0x12'));logger['debug'](_0xb138('0x13'),_0x5f2fe8,'request\x20sent',JSON[_0xb138('0x14')](_0x1617b4));if(_0x1617b4[_0xb138('0x15')]){if(_0x1617b4[_0xb138('0x15')][_0xb138('0x16')]===0x1f4){logger['error'](_0xb138('0x11'),_0x5f2fe8,_0x1617b4[_0xb138('0x15')][_0xb138('0x17')]);return _0x129934(_0x1617b4['error'][_0xb138('0x17')]);}logger[_0xb138('0x15')](_0xb138('0x11'),_0x5f2fe8,_0x1617b4[_0xb138('0x15')][_0xb138('0x17')]);return _0x3aa842(_0x1617b4['error'][_0xb138('0x17')]);}else{logger['info'](_0xb138('0x11'),_0x5f2fe8,_0xb138('0x12'));_0x3aa842(_0x1617b4['result'][_0xb138('0x17')]);}})['catch'](function(_0x217d29){logger['error'](_0xb138('0x11'),_0x5f2fe8,_0x217d29);_0x129934(_0x217d29);});});}exports[_0xb138('0x18')]=function(_0x492ab1){var _0x1b2f70=this;return new Promise(function(_0xc2fe12,_0x5f28fd){return db[_0xb138('0x19')][_0xb138('0x1a')]({'raw':_0x492ab1[_0xb138('0x1b')]?_0x492ab1[_0xb138('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x492ab1[_0xb138('0x1b')]?_0x492ab1[_0xb138('0x1b')]['where']||null:null,'attributes':_0x492ab1[_0xb138('0x1b')]?_0x492ab1['options'][_0xb138('0x1c')]||null:null,'limit':_0x492ab1['options']?_0x492ab1[_0xb138('0x1b')]['limit']||null:null,'include':_0x492ab1[_0xb138('0x1b')]?_0x492ab1[_0xb138('0x1b')][_0xb138('0x1d')]?_[_0xb138('0x1e')](_0x492ab1[_0xb138('0x1b')][_0xb138('0x1d')],function(_0x3b9d61){return{'model':db[_0x3b9d61['model']],'as':_0x3b9d61['as'],'attributes':_0x3b9d61[_0xb138('0x1c')],'include':_0x3b9d61['include']?_[_0xb138('0x1e')](_0x3b9d61[_0xb138('0x1d')],function(_0x939bca){return{'model':db[_0x939bca[_0xb138('0x1f')]],'as':_0x939bca['as'],'attributes':_0x939bca[_0xb138('0x1c')],'include':_0x939bca[_0xb138('0x1d')]?_[_0xb138('0x1e')](_0x939bca[_0xb138('0x1d')],function(_0x138ecc){return{'model':db[_0x138ecc[_0xb138('0x1f')]],'as':_0x138ecc['as'],'attributes':_0x138ecc[_0xb138('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a8b19){logger[_0xb138('0x10')](_0xb138('0x18'),_0x492ab1);logger['debug']('GetSmsQueue',_0x492ab1,JSON[_0xb138('0x14')](_0x4a8b19));_0xc2fe12(_0x4a8b19);})[_0xb138('0x20')](function(_0x56aa43){logger[_0xb138('0x15')](_0xb138('0x18'),_0x56aa43['message'],_0x492ab1);_0x5f28fd(_0x1b2f70['error'](0x1f4,_0x56aa43[_0xb138('0x17')]));});});};exports[_0xb138('0x21')]=function(_0x2c26c1){var _0x2609b0=this;return new Promise(function(_0x2dcc95,_0x55c420){return db[_0xb138('0x19')][_0xb138('0x22')]({'raw':_0x2c26c1[_0xb138('0x1b')]?_0x2c26c1[_0xb138('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2c26c1[_0xb138('0x1b')]?_0x2c26c1[_0xb138('0x1b')][_0xb138('0x23')]||null:null,'attributes':_0x2c26c1[_0xb138('0x1b')]?_0x2c26c1[_0xb138('0x1b')][_0xb138('0x1c')]||null:null,'include':_0x2c26c1[_0xb138('0x1b')]?_0x2c26c1[_0xb138('0x1b')][_0xb138('0x1d')]?_['map'](_0x2c26c1[_0xb138('0x1b')][_0xb138('0x1d')],function(_0x210a81){return{'model':db[_0x210a81[_0xb138('0x1f')]],'as':_0x210a81['as'],'attributes':_0x210a81[_0xb138('0x1c')],'include':_0x210a81[_0xb138('0x1d')]?_[_0xb138('0x1e')](_0x210a81[_0xb138('0x1d')],function(_0x30eb89){return{'model':db[_0x30eb89['model']],'as':_0x30eb89['as'],'attributes':_0x30eb89[_0xb138('0x1c')],'include':_0x30eb89['include']?_[_0xb138('0x1e')](_0x30eb89[_0xb138('0x1d')],function(_0x52c261){return{'model':db[_0x52c261['model']],'as':_0x52c261['as'],'attributes':_0x52c261[_0xb138('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb138('0x24')](function(_0x1b56e1){logger[_0xb138('0x10')]('ShowSmsQueue',_0x2c26c1);logger[_0xb138('0x25')](_0xb138('0x21'),_0x2c26c1,JSON['stringify'](_0x1b56e1));_0x2dcc95(_0x1b56e1);})[_0xb138('0x20')](function(_0x1fd4fe){logger['error']('ShowSmsQueue',_0x1fd4fe[_0xb138('0x17')],_0x2c26c1);_0x55c420(_0x2609b0[_0xb138('0x15')](0x1f4,_0x1fd4fe['message']));});});}; \ No newline at end of file +var _0xbbce=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','limit','include','model','map','find','where','attributes','ShowSmsQueue'];(function(_0x3ad3e4,_0x3162c0){var _0x37d7f0=function(_0x5905d7){while(--_0x5905d7){_0x3ad3e4['push'](_0x3ad3e4['shift']());}};_0x37d7f0(++_0x3162c0);}(_0xbbce,0x7c));var _0xebbc=function(_0x240803,_0x51de85){_0x240803=_0x240803-0x0;var _0x33c2b8=_0xbbce[_0x240803];return _0x33c2b8;};'use strict';var _=require('lodash');var util=require(_0xebbc('0x0'));var moment=require(_0xebbc('0x1'));var BPromise=require(_0xebbc('0x2'));var rs=require(_0xebbc('0x3'));var fs=require('fs');var Redis=require(_0xebbc('0x4'));var db=require(_0xebbc('0x5'))['db'];var utils=require(_0xebbc('0x6'));var logger=require(_0xebbc('0x7'))('rpc');var config=require(_0xebbc('0x8'));var jayson=require(_0xebbc('0x9'));var client=jayson[_0xebbc('0xa')][_0xebbc('0xb')]({'port':0x232a});config[_0xebbc('0xc')]=_[_0xebbc('0xd')](config[_0xebbc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xebbc('0xe'))(new Redis(config['redis']));require(_0xebbc('0xf'))[_0xebbc('0x10')](socket);function respondWithRpcPromise(_0x502982,_0x56d9b4,_0x1176b5){return new BPromise(function(_0x1249f2,_0x5c5491){return client[_0xebbc('0x11')](_0x502982,_0x1176b5)[_0xebbc('0x12')](function(_0x100040){logger[_0xebbc('0x13')](_0xebbc('0x14'),_0x56d9b4,'request\x20sent');logger[_0xebbc('0x15')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x56d9b4,_0xebbc('0x16'),JSON[_0xebbc('0x17')](_0x100040));if(_0x100040['error']){if(_0x100040[_0xebbc('0x18')]['code']===0x1f4){logger[_0xebbc('0x18')](_0xebbc('0x14'),_0x56d9b4,_0x100040[_0xebbc('0x18')][_0xebbc('0x19')]);return _0x5c5491(_0x100040['error']['message']);}logger[_0xebbc('0x18')]('SmsQueue,\x20%s,\x20%s',_0x56d9b4,_0x100040[_0xebbc('0x18')]['message']);return _0x1249f2(_0x100040[_0xebbc('0x18')][_0xebbc('0x19')]);}else{logger[_0xebbc('0x13')](_0xebbc('0x14'),_0x56d9b4,'request\x20sent');_0x1249f2(_0x100040[_0xebbc('0x1a')][_0xebbc('0x19')]);}})['catch'](function(_0x370e73){logger['error'](_0xebbc('0x14'),_0x56d9b4,_0x370e73);_0x5c5491(_0x370e73);});});}exports[_0xebbc('0x1b')]=function(_0x4cfe05){var _0x3ed735=this;return new Promise(function(_0x186105,_0x22e5db){return db[_0xebbc('0x1c')][_0xebbc('0x1d')]({'raw':_0x4cfe05['options']?_0x4cfe05[_0xebbc('0x1e')][_0xebbc('0x1f')]===undefined?!![]:![]:!![],'where':_0x4cfe05[_0xebbc('0x1e')]?_0x4cfe05[_0xebbc('0x1e')]['where']||null:null,'attributes':_0x4cfe05[_0xebbc('0x1e')]?_0x4cfe05['options']['attributes']||null:null,'limit':_0x4cfe05['options']?_0x4cfe05['options'][_0xebbc('0x20')]||null:null,'include':_0x4cfe05[_0xebbc('0x1e')]?_0x4cfe05['options'][_0xebbc('0x21')]?_['map'](_0x4cfe05[_0xebbc('0x1e')]['include'],function(_0x57964e){return{'model':db[_0x57964e[_0xebbc('0x22')]],'as':_0x57964e['as'],'attributes':_0x57964e['attributes'],'include':_0x57964e['include']?_[_0xebbc('0x23')](_0x57964e[_0xebbc('0x21')],function(_0x6a5da2){return{'model':db[_0x6a5da2[_0xebbc('0x22')]],'as':_0x6a5da2['as'],'attributes':_0x6a5da2['attributes'],'include':_0x6a5da2[_0xebbc('0x21')]?_['map'](_0x6a5da2[_0xebbc('0x21')],function(_0x1fe696){return{'model':db[_0x1fe696[_0xebbc('0x22')]],'as':_0x1fe696['as'],'attributes':_0x1fe696['attributes']};}):[]};}):[]};}):[]:[]})[_0xebbc('0x12')](function(_0x55eeab){logger['info'](_0xebbc('0x1b'),_0x4cfe05);logger[_0xebbc('0x15')](_0xebbc('0x1b'),_0x4cfe05,JSON[_0xebbc('0x17')](_0x55eeab));_0x186105(_0x55eeab);})['catch'](function(_0x473f27){logger['error'](_0xebbc('0x1b'),_0x473f27[_0xebbc('0x19')],_0x4cfe05);_0x22e5db(_0x3ed735[_0xebbc('0x18')](0x1f4,_0x473f27['message']));});});};exports['ShowSmsQueue']=function(_0x2fcb78){var _0x32a5e2=this;return new Promise(function(_0x3ccb85,_0x113108){return db[_0xebbc('0x1c')][_0xebbc('0x24')]({'raw':_0x2fcb78[_0xebbc('0x1e')]?_0x2fcb78[_0xebbc('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2fcb78[_0xebbc('0x1e')]?_0x2fcb78[_0xebbc('0x1e')][_0xebbc('0x25')]||null:null,'attributes':_0x2fcb78[_0xebbc('0x1e')]?_0x2fcb78[_0xebbc('0x1e')][_0xebbc('0x26')]||null:null,'include':_0x2fcb78[_0xebbc('0x1e')]?_0x2fcb78[_0xebbc('0x1e')][_0xebbc('0x21')]?_[_0xebbc('0x23')](_0x2fcb78[_0xebbc('0x1e')][_0xebbc('0x21')],function(_0xd98533){return{'model':db[_0xd98533[_0xebbc('0x22')]],'as':_0xd98533['as'],'attributes':_0xd98533['attributes'],'include':_0xd98533[_0xebbc('0x21')]?_[_0xebbc('0x23')](_0xd98533[_0xebbc('0x21')],function(_0x4b1d7a){return{'model':db[_0x4b1d7a[_0xebbc('0x22')]],'as':_0x4b1d7a['as'],'attributes':_0x4b1d7a[_0xebbc('0x26')],'include':_0x4b1d7a[_0xebbc('0x21')]?_['map'](_0x4b1d7a[_0xebbc('0x21')],function(_0x572dc7){return{'model':db[_0x572dc7[_0xebbc('0x22')]],'as':_0x572dc7['as'],'attributes':_0x572dc7[_0xebbc('0x26')]};}):[]};}):[]};}):[]:[]})[_0xebbc('0x12')](function(_0xdcb85f){logger['info'](_0xebbc('0x27'),_0x2fcb78);logger['debug']('ShowSmsQueue',_0x2fcb78,JSON[_0xebbc('0x17')](_0xdcb85f));_0x3ccb85(_0xdcb85f);})[_0xebbc('0x28')](function(_0x57e44d){logger['error'](_0xebbc('0x27'),_0x57e44d[_0xebbc('0x19')],_0x2fcb78);_0x113108(_0x32a5e2[_0xebbc('0x18')](0x1f4,_0x57e44d['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 47a0d4a..14ae575 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 _0x0237=['save','remove','removeListener','length','smsQueue:','./smsQueue.events'];(function(_0x37ec28,_0x1b2f80){var _0x343d3f=function(_0x55de4e){while(--_0x55de4e){_0x37ec28['push'](_0x37ec28['shift']());}};_0x343d3f(++_0x1b2f80);}(_0x0237,0x119));var _0x7023=function(_0x4aade4,_0x40f7a8){_0x4aade4=_0x4aade4-0x0;var _0x26010b=_0x0237[_0x4aade4];return _0x26010b;};'use strict';var SmsQueueEvents=require(_0x7023('0x0'));var events=[_0x7023('0x1'),_0x7023('0x2'),'update'];function createListener(_0x57b5c2,_0x54c9c3){return function(_0xa7ed86){_0x54c9c3['emit'](_0x57b5c2,_0xa7ed86);};}function removeListener(_0xc29e93,_0x4a72bc){return function(){SmsQueueEvents[_0x7023('0x3')](_0xc29e93,_0x4a72bc);};}exports['register']=function(_0x2df13e){for(var _0x3b8e7c=0x0,_0x440c64=events[_0x7023('0x4')];_0x3b8e7c<_0x440c64;_0x3b8e7c++){var _0x48da52=events[_0x3b8e7c];var _0x58f7c7=createListener(_0x7023('0x5')+_0x48da52,_0x2df13e);SmsQueueEvents['on'](_0x48da52,_0x58f7c7);}}; \ No newline at end of file +var _0xc348=['./smsQueue.events','save','remove','update','emit','register','length','smsQueue:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc348,0x188));var _0x8c34=function(_0x1a276b,_0x33e2f5){_0x1a276b=_0x1a276b-0x0;var _0x748dc1=_0xc348[_0x1a276b];return _0x748dc1;};'use strict';var SmsQueueEvents=require(_0x8c34('0x0'));var events=[_0x8c34('0x1'),_0x8c34('0x2'),_0x8c34('0x3')];function createListener(_0x30e792,_0x17862d){return function(_0x4cd4ed){_0x17862d[_0x8c34('0x4')](_0x30e792,_0x4cd4ed);};}function removeListener(_0x56678e,_0x36887a){return function(){SmsQueueEvents['removeListener'](_0x56678e,_0x36887a);};}exports[_0x8c34('0x5')]=function(_0x6eee86){for(var _0x59309b=0x0,_0x1ee84e=events[_0x8c34('0x6')];_0x59309b<_0x1ee84e;_0x59309b++){var _0x2fee29=events[_0x59309b];var _0x3e5d12=createListener(_0x8c34('0x7')+_0x2fee29,_0x6eee86);SmsQueueEvents['on'](_0x2fee29,_0x3e5d12);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index ef51ff4..ecec08f 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 _0x6dfb=['/describe','describe','/:id','show','post','put','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index'];(function(_0x3feb53,_0x5d8ac6){var _0x4ac42d=function(_0x821f87){while(--_0x821f87){_0x3feb53['push'](_0x3feb53['shift']());}};_0x4ac42d(++_0x5d8ac6);}(_0x6dfb,0x14a));var _0xb6df=function(_0x1ba544,_0x3e2406){_0x1ba544=_0x1ba544-0x0;var _0x926bbe=_0x6dfb[_0x1ba544];return _0x926bbe;};'use strict';var multer=require(_0xb6df('0x0'));var util=require(_0xb6df('0x1'));var path=require(_0xb6df('0x2'));var timeout=require('connect-timeout');var express=require(_0xb6df('0x3'));var router=express[_0xb6df('0x4')]();var fs_extra=require(_0xb6df('0x5'));var auth=require(_0xb6df('0x6'));var interaction=require(_0xb6df('0x7'));var config=require('../../config/environment');var controller=require(_0xb6df('0x8'));router[_0xb6df('0x9')]('/',auth[_0xb6df('0xa')](),controller[_0xb6df('0xb')]);router[_0xb6df('0x9')](_0xb6df('0xc'),auth[_0xb6df('0xa')](),controller[_0xb6df('0xd')]);router[_0xb6df('0x9')](_0xb6df('0xe'),auth[_0xb6df('0xa')](),controller[_0xb6df('0xf')]);router[_0xb6df('0x10')]('/',auth[_0xb6df('0xa')](),controller['create']);router[_0xb6df('0x11')](_0xb6df('0xe'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xb6df('0xe'),auth[_0xb6df('0xa')](),controller[_0xb6df('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7b58=['util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','create','put','update','delete','exports','multer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7b58,0xe9));var _0x87b5=function(_0x3871d7,_0x3cfcc5){_0x3871d7=_0x3871d7-0x0;var _0x28ec09=_0x7b58[_0x3871d7];return _0x28ec09;};'use strict';var multer=require(_0x87b5('0x0'));var util=require(_0x87b5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x87b5('0x2'));var auth=require(_0x87b5('0x3'));var interaction=require(_0x87b5('0x4'));var config=require(_0x87b5('0x5'));var controller=require(_0x87b5('0x6'));router['get']('/',auth[_0x87b5('0x7')](),controller['index']);router[_0x87b5('0x8')](_0x87b5('0x9'),auth[_0x87b5('0x7')](),controller[_0x87b5('0xa')]);router[_0x87b5('0x8')](_0x87b5('0xb'),auth[_0x87b5('0x7')](),controller[_0x87b5('0xc')]);router['post']('/',auth[_0x87b5('0x7')](),controller[_0x87b5('0xd')]);router[_0x87b5('0xe')](_0x87b5('0xb'),auth['isAuthenticated'](),controller[_0x87b5('0xf')]);router[_0x87b5('0x10')]('/:id',auth[_0x87b5('0x7')](),controller['destroy']);module[_0x87b5('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 ef7fc78..8d1c094 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 _0x63be=['STRING','DATE','exports'];(function(_0x635b0e,_0x3b5707){var _0x59c9c0=function(_0x38da25){while(--_0x38da25){_0x635b0e['push'](_0x635b0e['shift']());}};_0x59c9c0(++_0x3b5707);}(_0x63be,0xd7));var _0xe63b=function(_0x409163,_0x29db39){_0x409163=_0x409163-0x0;var _0x2a445b=_0x63be[_0x409163];return _0x2a445b;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe63b('0x0')]={'uniqueid':{'type':Sequelize[_0xe63b('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xe63b('0x2')]},'leaveAt':{'type':Sequelize[_0xe63b('0x2')]},'acceptAt':{'type':Sequelize[_0xe63b('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe63b('0x1')]}}; \ No newline at end of file +var _0x347a=['STRING','DATE','moment','sequelize','exports'];(function(_0x204587,_0x3e40c2){var _0x224eb0=function(_0x116bc7){while(--_0x116bc7){_0x204587['push'](_0x204587['shift']());}};_0x224eb0(++_0x3e40c2);}(_0x347a,0xe3));var _0xa347=function(_0x50392a,_0x2d4ed9){_0x50392a=_0x50392a-0x0;var _0x417b0a=_0x347a[_0x50392a];return _0x417b0a;};'use strict';var moment=require(_0xa347('0x0'));var Sequelize=require(_0xa347('0x1'));module[_0xa347('0x2')]={'uniqueid':{'type':Sequelize[_0xa347('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa347('0x3')]},'joinAt':{'type':Sequelize[_0xa347('0x4')]},'leaveAt':{'type':Sequelize[_0xa347('0x4')]},'acceptAt':{'type':Sequelize[_0xa347('0x4')]},'exitAt':{'type':Sequelize[_0xa347('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d754ef9..7f32a33 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 _0xc891=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','intersection','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0xc891,0x86));var _0x1c89=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xc891[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require(_0x1c89('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c89('0x2'));var rp=require(_0x1c89('0x3'));var moment=require(_0x1c89('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1c89('0x5'));var path=require(_0x1c89('0x6'));var sox=require('sox');var csv=require(_0x1c89('0x7'));var ejs=require(_0x1c89('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require(_0x1c89('0xb'));var jsforce=require(_0x1c89('0xc'));var deskjs=require(_0x1c89('0xd'));var toCsv=require(_0x1c89('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));var authService=require(_0x1c89('0xf'));var qs=require(_0x1c89('0x10'));var as=require(_0x1c89('0x11'));var hardwareService=require(_0x1c89('0x12'));var logger=require('../../config/logger')(_0x1c89('0x13'));var utils=require(_0x1c89('0x14'));var config=require(_0x1c89('0x15'));var licenseUtil=require(_0x1c89('0x16'));var db=require(_0x1c89('0x17'))['db'];function respondWithStatusCode(_0x177207,_0x435d3c){_0x435d3c=_0x435d3c||0xcc;return function(_0x51eb11){if(_0x51eb11){return _0x177207[_0x1c89('0x18')](_0x435d3c);}return _0x177207[_0x1c89('0x19')](_0x435d3c)['end']();};}function respondWithResult(_0x50a34f,_0x2e5530){_0x2e5530=_0x2e5530||0xc8;return function(_0x38a09c){if(_0x38a09c){return _0x50a34f[_0x1c89('0x19')](_0x2e5530)['json'](_0x38a09c);}};}function respondWithFilteredResult(_0x5c6963,_0xc760c8){return function(_0x5d68b3){if(_0x5d68b3){var _0xbfc371=typeof _0xc760c8['offset']===_0x1c89('0x1a')&&typeof _0xc760c8[_0x1c89('0x1b')]===_0x1c89('0x1a');var _0x4e9c82=_0x5d68b3['count'];var _0x4e3109=_0xbfc371?0x0:_0xc760c8['offset'];var _0x3a101f=_0xbfc371?_0x5d68b3[_0x1c89('0x1c')]:_0xc760c8[_0x1c89('0x1d')]+_0xc760c8[_0x1c89('0x1b')];var _0x36dd8c;if(_0x3a101f>=_0x4e9c82){_0x3a101f=_0x4e9c82;_0x36dd8c=0xc8;}else{_0x36dd8c=0xce;}_0x5c6963[_0x1c89('0x19')](_0x36dd8c);return _0x5c6963[_0x1c89('0x1e')](_0x1c89('0x1f'),_0x4e3109+'-'+_0x3a101f+'/'+_0x4e9c82)[_0x1c89('0x20')](_0x5d68b3);}return null;};}function patchUpdates(_0xf80ca){return function(_0x471cce){try{jsonpatch['apply'](_0x471cce,_0xf80ca,!![]);}catch(_0x365a6b){return BPromise[_0x1c89('0x21')](_0x365a6b);}return _0x471cce[_0x1c89('0x22')]();};}function saveUpdates(_0x34ff70,_0x530199){return function(_0x71d5a7){if(_0x71d5a7){return _0x71d5a7[_0x1c89('0x23')](_0x34ff70)[_0x1c89('0x24')](function(_0x412309){return _0x412309;});}return null;};}function removeEntity(_0x4ad018,_0x5cded2){return function(_0x15bb31){if(_0x15bb31){return _0x15bb31[_0x1c89('0x25')]()[_0x1c89('0x24')](function(){_0x4ad018['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11d73b,_0x3b55ae){return function(_0x614f93){if(!_0x614f93){_0x11d73b[_0x1c89('0x18')](0x194);}return _0x614f93;};}function handleError(_0x1c0b13,_0x98a3cc){_0x98a3cc=_0x98a3cc||0x1f4;return function(_0x296a44){logger[_0x1c89('0x26')](_0x296a44['stack']);if(_0x296a44[_0x1c89('0x27')]){delete _0x296a44[_0x1c89('0x27')];}_0x1c0b13['status'](_0x98a3cc)[_0x1c89('0x28')](_0x296a44);};}exports[_0x1c89('0x29')]=function(_0x4f9a4a,_0x339ecf){var _0x4ea3cd={},_0x3cb0ec={},_0x2f7234={'count':0x0,'rows':[]};var _0x9c67c9=_[_0x1c89('0x2a')](db[_0x1c89('0x2b')][_0x1c89('0x2c')],function(_0x183842){return{'name':_0x183842[_0x1c89('0x2d')],'type':_0x183842[_0x1c89('0x2e')]['key']};});_0x3cb0ec[_0x1c89('0x2f')]=_[_0x1c89('0x2a')](_0x9c67c9,_0x1c89('0x27'));_0x3cb0ec[_0x1c89('0x30')]=_[_0x1c89('0x31')](_0x4f9a4a[_0x1c89('0x30')]);_0x3cb0ec[_0x1c89('0x32')]=_['intersection'](_0x3cb0ec[_0x1c89('0x2f')],_0x3cb0ec[_0x1c89('0x30')]);_0x4ea3cd[_0x1c89('0x33')]=_['intersection'](_0x3cb0ec['model'],qs[_0x1c89('0x34')](_0x4f9a4a[_0x1c89('0x30')]['fields']));_0x4ea3cd[_0x1c89('0x33')]=_0x4ea3cd[_0x1c89('0x33')][_0x1c89('0x35')]?_0x4ea3cd[_0x1c89('0x33')]:_0x3cb0ec[_0x1c89('0x2f')];if(!_0x4f9a4a['query'][_0x1c89('0x36')](_0x1c89('0x37'))){_0x4ea3cd['limit']=qs[_0x1c89('0x1b')](_0x4f9a4a['query'][_0x1c89('0x1b')]);_0x4ea3cd['offset']=qs[_0x1c89('0x1d')](_0x4f9a4a['query']['offset']);}_0x4ea3cd[_0x1c89('0x38')]=qs[_0x1c89('0x39')](_0x4f9a4a[_0x1c89('0x30')]['sort']);_0x4ea3cd[_0x1c89('0x3a')]=qs[_0x1c89('0x32')](_[_0x1c89('0x3b')](_0x4f9a4a[_0x1c89('0x30')],_0x3cb0ec[_0x1c89('0x32')]),_0x9c67c9);if(_0x4f9a4a[_0x1c89('0x30')][_0x1c89('0x3c')]){_0x4ea3cd[_0x1c89('0x3a')]=_[_0x1c89('0x3d')](_0x4ea3cd['where'],{'$or':_['map'](_0x9c67c9,function(_0x451a27){if(_0x451a27[_0x1c89('0x2e')]!=='VIRTUAL'){var _0x33896f={};_0x33896f[_0x451a27['name']]={'$like':'%'+_0x4f9a4a[_0x1c89('0x30')]['filter']+'%'};return _0x33896f;}})});}_0x4ea3cd=_['merge']({},_0x4ea3cd,_0x4f9a4a[_0x1c89('0x3e')]);var _0x356803={'where':_0x4ea3cd[_0x1c89('0x3a')]};return db[_0x1c89('0x2b')][_0x1c89('0x1c')](_0x356803)[_0x1c89('0x24')](function(_0x431096){_0x2f7234[_0x1c89('0x1c')]=_0x431096;if(_0x4f9a4a[_0x1c89('0x30')][_0x1c89('0x3f')]){_0x4ea3cd[_0x1c89('0x40')]=[{'all':!![]}];}return db[_0x1c89('0x2b')][_0x1c89('0x41')](_0x4ea3cd);})['then'](function(_0x2db162){_0x2f7234[_0x1c89('0x42')]=_0x2db162;return _0x2f7234;})[_0x1c89('0x24')](respondWithFilteredResult(_0x339ecf,_0x4ea3cd))[_0x1c89('0x43')](handleError(_0x339ecf,null));};exports[_0x1c89('0x44')]=function(_0x4df29b,_0x4e7226){var _0x11b853={'raw':!![],'where':{'id':_0x4df29b['params']['id']}},_0x4fb662={};_0x4fb662[_0x1c89('0x2f')]=_[_0x1c89('0x31')](db[_0x1c89('0x2b')]['rawAttributes']);_0x4fb662[_0x1c89('0x30')]=_['keys'](_0x4df29b['query']);_0x4fb662[_0x1c89('0x32')]=_[_0x1c89('0x45')](_0x4fb662[_0x1c89('0x2f')],_0x4fb662[_0x1c89('0x30')]);_0x11b853['attributes']=_['intersection'](_0x4fb662[_0x1c89('0x2f')],qs[_0x1c89('0x34')](_0x4df29b['query']['fields']));_0x11b853[_0x1c89('0x33')]=_0x11b853[_0x1c89('0x33')][_0x1c89('0x35')]?_0x11b853[_0x1c89('0x33')]:_0x4fb662[_0x1c89('0x2f')];if(_0x4df29b['query'][_0x1c89('0x3f')]){_0x11b853['include']=[{'all':!![]}];}_0x11b853=_['merge']({},_0x11b853,_0x4df29b['options']);return db[_0x1c89('0x2b')]['find'](_0x11b853)['then'](handleEntityNotFound(_0x4e7226,null))[_0x1c89('0x24')](respondWithResult(_0x4e7226,null))[_0x1c89('0x43')](handleError(_0x4e7226,null));};exports[_0x1c89('0x46')]=function(_0x76bc8b,_0x44be0e){return db[_0x1c89('0x2b')][_0x1c89('0x46')](_0x76bc8b[_0x1c89('0x47')],{})[_0x1c89('0x24')](respondWithResult(_0x44be0e,0xc9))[_0x1c89('0x43')](handleError(_0x44be0e,null));};exports[_0x1c89('0x23')]=function(_0x3d36f2,_0x429fa5){if(_0x3d36f2[_0x1c89('0x47')]['id']){delete _0x3d36f2[_0x1c89('0x47')]['id'];}return db[_0x1c89('0x2b')][_0x1c89('0x48')]({'where':{'id':_0x3d36f2[_0x1c89('0x49')]['id']}})[_0x1c89('0x24')](handleEntityNotFound(_0x429fa5,null))[_0x1c89('0x24')](saveUpdates(_0x3d36f2[_0x1c89('0x47')],null))[_0x1c89('0x24')](respondWithResult(_0x429fa5,null))['catch'](handleError(_0x429fa5,null));};exports[_0x1c89('0x25')]=function(_0x185ed8,_0x23ac5c){return db[_0x1c89('0x2b')][_0x1c89('0x48')]({'where':{'id':_0x185ed8[_0x1c89('0x49')]['id']}})[_0x1c89('0x24')](handleEntityNotFound(_0x23ac5c,null))[_0x1c89('0x24')](removeEntity(_0x23ac5c,null))[_0x1c89('0x43')](handleError(_0x23ac5c,null));};exports[_0x1c89('0x4a')]=function(_0x1b05b0,_0x1903de){return db[_0x1c89('0x2b')][_0x1c89('0x4a')]()[_0x1c89('0x24')](respondWithResult(_0x1903de,null))['catch'](handleError(_0x1903de,null));}; \ No newline at end of file +var _0xc844=['params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','name','send','index','SmsQueueReport','rawAttributes','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body'];(function(_0x3ca1d8,_0x17340c){var _0x19d21c=function(_0x2354cd){while(--_0x2354cd){_0x3ca1d8['push'](_0x3ca1d8['shift']());}};_0x19d21c(++_0x17340c);}(_0xc844,0xe4));var _0x4c84=function(_0xef5414,_0x1fc015){_0xef5414=_0xef5414-0x0;var _0x189fb8=_0xc844[_0xef5414];return _0x189fb8;};'use strict';var emlformat=require(_0x4c84('0x0'));var rimraf=require(_0x4c84('0x1'));var zipdir=require(_0x4c84('0x2'));var jsonpatch=require(_0x4c84('0x3'));var rp=require(_0x4c84('0x4'));var moment=require(_0x4c84('0x5'));var BPromise=require(_0x4c84('0x6'));var Mustache=require(_0x4c84('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4c84('0x8'));var ejs=require(_0x4c84('0x9'));var fs=require('fs');var fs_extra=require(_0x4c84('0xa'));var _=require(_0x4c84('0xb'));var squel=require('squel');var crypto=require(_0x4c84('0xc'));var jsforce=require(_0x4c84('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4c84('0xe'));var Redis=require(_0x4c84('0xf'));var authService=require(_0x4c84('0x10'));var qs=require(_0x4c84('0x11'));var as=require(_0x4c84('0x12'));var hardwareService=require(_0x4c84('0x13'));var logger=require(_0x4c84('0x14'))(_0x4c84('0x15'));var utils=require('../../config/utils');var config=require(_0x4c84('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4c84('0x17'))['db'];function respondWithStatusCode(_0x54f617,_0x28bd3e){_0x28bd3e=_0x28bd3e||0xcc;return function(_0x342cf3){if(_0x342cf3){return _0x54f617[_0x4c84('0x18')](_0x28bd3e);}return _0x54f617[_0x4c84('0x19')](_0x28bd3e)[_0x4c84('0x1a')]();};}function respondWithResult(_0x2a2d3c,_0x2256e1){_0x2256e1=_0x2256e1||0xc8;return function(_0x2c7be9){if(_0x2c7be9){return _0x2a2d3c['status'](_0x2256e1)['json'](_0x2c7be9);}};}function respondWithFilteredResult(_0x2ee561,_0x98009c){return function(_0x1474fc){if(_0x1474fc){var _0x1295df=typeof _0x98009c[_0x4c84('0x1b')]===_0x4c84('0x1c')&&typeof _0x98009c[_0x4c84('0x1d')]===_0x4c84('0x1c');var _0x1fc270=_0x1474fc[_0x4c84('0x1e')];var _0x33e0ed=_0x1295df?0x0:_0x98009c[_0x4c84('0x1b')];var _0x4634ed=_0x1295df?_0x1474fc['count']:_0x98009c[_0x4c84('0x1b')]+_0x98009c['limit'];var _0x1ff864;if(_0x4634ed>=_0x1fc270){_0x4634ed=_0x1fc270;_0x1ff864=0xc8;}else{_0x1ff864=0xce;}_0x2ee561['status'](_0x1ff864);return _0x2ee561[_0x4c84('0x1f')](_0x4c84('0x20'),_0x33e0ed+'-'+_0x4634ed+'/'+_0x1fc270)[_0x4c84('0x21')](_0x1474fc);}return null;};}function patchUpdates(_0x3f46e2){return function(_0x103635){try{jsonpatch['apply'](_0x103635,_0x3f46e2,!![]);}catch(_0x2236d4){return BPromise[_0x4c84('0x22')](_0x2236d4);}return _0x103635[_0x4c84('0x23')]();};}function saveUpdates(_0x2b2d6f,_0x4a227a){return function(_0x5ba4fc){if(_0x5ba4fc){return _0x5ba4fc[_0x4c84('0x24')](_0x2b2d6f)[_0x4c84('0x25')](function(_0x169b33){return _0x169b33;});}return null;};}function removeEntity(_0x16cbe4,_0x2316e1){return function(_0x22d3b1){if(_0x22d3b1){return _0x22d3b1['destroy']()['then'](function(){_0x16cbe4[_0x4c84('0x19')](0xcc)[_0x4c84('0x1a')]();});}};}function handleEntityNotFound(_0x1310f4,_0xd42fc8){return function(_0x11bf08){if(!_0x11bf08){_0x1310f4[_0x4c84('0x18')](0x194);}return _0x11bf08;};}function handleError(_0x4ae5f0,_0x501194){_0x501194=_0x501194||0x1f4;return function(_0x2945ce){logger['error'](_0x2945ce['stack']);if(_0x2945ce[_0x4c84('0x26')]){delete _0x2945ce['name'];}_0x4ae5f0[_0x4c84('0x19')](_0x501194)[_0x4c84('0x27')](_0x2945ce);};}exports[_0x4c84('0x28')]=function(_0x6a9137,_0x26dd1a){var _0x5d77f4={},_0x324c5d={},_0x1097e2={'count':0x0,'rows':[]};var _0x3f7ddd=_['map'](db[_0x4c84('0x29')][_0x4c84('0x2a')],function(_0x3e6d35){return{'name':_0x3e6d35['fieldName'],'type':_0x3e6d35[_0x4c84('0x2b')]['key']};});_0x324c5d[_0x4c84('0x2c')]=_[_0x4c84('0x2d')](_0x3f7ddd,_0x4c84('0x26'));_0x324c5d[_0x4c84('0x2e')]=_[_0x4c84('0x2f')](_0x6a9137[_0x4c84('0x2e')]);_0x324c5d['filters']=_[_0x4c84('0x30')](_0x324c5d['model'],_0x324c5d[_0x4c84('0x2e')]);_0x5d77f4[_0x4c84('0x31')]=_[_0x4c84('0x30')](_0x324c5d[_0x4c84('0x2c')],qs[_0x4c84('0x32')](_0x6a9137[_0x4c84('0x2e')][_0x4c84('0x32')]));_0x5d77f4['attributes']=_0x5d77f4[_0x4c84('0x31')][_0x4c84('0x33')]?_0x5d77f4[_0x4c84('0x31')]:_0x324c5d['model'];if(!_0x6a9137[_0x4c84('0x2e')][_0x4c84('0x34')](_0x4c84('0x35'))){_0x5d77f4[_0x4c84('0x1d')]=qs[_0x4c84('0x1d')](_0x6a9137['query'][_0x4c84('0x1d')]);_0x5d77f4[_0x4c84('0x1b')]=qs['offset'](_0x6a9137[_0x4c84('0x2e')][_0x4c84('0x1b')]);}_0x5d77f4[_0x4c84('0x36')]=qs[_0x4c84('0x37')](_0x6a9137['query'][_0x4c84('0x37')]);_0x5d77f4[_0x4c84('0x38')]=qs[_0x4c84('0x39')](_[_0x4c84('0x3a')](_0x6a9137[_0x4c84('0x2e')],_0x324c5d['filters']),_0x3f7ddd);if(_0x6a9137[_0x4c84('0x2e')][_0x4c84('0x3b')]){_0x5d77f4[_0x4c84('0x38')]=_[_0x4c84('0x3c')](_0x5d77f4[_0x4c84('0x38')],{'$or':_[_0x4c84('0x2d')](_0x3f7ddd,function(_0x1d3162){if(_0x1d3162[_0x4c84('0x2b')]!==_0x4c84('0x3d')){var _0x147c73={};_0x147c73[_0x1d3162[_0x4c84('0x26')]]={'$like':'%'+_0x6a9137['query']['filter']+'%'};return _0x147c73;}})});}_0x5d77f4=_[_0x4c84('0x3c')]({},_0x5d77f4,_0x6a9137[_0x4c84('0x3e')]);var _0x2fed8a={'where':_0x5d77f4[_0x4c84('0x38')]};return db[_0x4c84('0x29')][_0x4c84('0x1e')](_0x2fed8a)['then'](function(_0x219b7f){_0x1097e2['count']=_0x219b7f;if(_0x6a9137[_0x4c84('0x2e')][_0x4c84('0x3f')]){_0x5d77f4[_0x4c84('0x40')]=[{'all':!![]}];}return db[_0x4c84('0x29')][_0x4c84('0x41')](_0x5d77f4);})[_0x4c84('0x25')](function(_0x50d214){_0x1097e2[_0x4c84('0x42')]=_0x50d214;return _0x1097e2;})[_0x4c84('0x25')](respondWithFilteredResult(_0x26dd1a,_0x5d77f4))[_0x4c84('0x43')](handleError(_0x26dd1a,null));};exports[_0x4c84('0x44')]=function(_0x49c233,_0x41bbd5){var _0x35baa3={'raw':!![],'where':{'id':_0x49c233['params']['id']}},_0x44beeb={};_0x44beeb['model']=_['keys'](db['SmsQueueReport']['rawAttributes']);_0x44beeb[_0x4c84('0x2e')]=_[_0x4c84('0x2f')](_0x49c233[_0x4c84('0x2e')]);_0x44beeb[_0x4c84('0x39')]=_['intersection'](_0x44beeb['model'],_0x44beeb[_0x4c84('0x2e')]);_0x35baa3[_0x4c84('0x31')]=_['intersection'](_0x44beeb[_0x4c84('0x2c')],qs[_0x4c84('0x32')](_0x49c233[_0x4c84('0x2e')][_0x4c84('0x32')]));_0x35baa3[_0x4c84('0x31')]=_0x35baa3[_0x4c84('0x31')][_0x4c84('0x33')]?_0x35baa3['attributes']:_0x44beeb[_0x4c84('0x2c')];if(_0x49c233[_0x4c84('0x2e')][_0x4c84('0x3f')]){_0x35baa3[_0x4c84('0x40')]=[{'all':!![]}];}_0x35baa3=_[_0x4c84('0x3c')]({},_0x35baa3,_0x49c233['options']);return db[_0x4c84('0x29')][_0x4c84('0x45')](_0x35baa3)['then'](handleEntityNotFound(_0x41bbd5,null))[_0x4c84('0x25')](respondWithResult(_0x41bbd5,null))[_0x4c84('0x43')](handleError(_0x41bbd5,null));};exports['create']=function(_0x5e3a2e,_0x24a8d9){return db['SmsQueueReport'][_0x4c84('0x46')](_0x5e3a2e[_0x4c84('0x47')],{})[_0x4c84('0x25')](respondWithResult(_0x24a8d9,0xc9))[_0x4c84('0x43')](handleError(_0x24a8d9,null));};exports[_0x4c84('0x24')]=function(_0x346d22,_0x4466ac){if(_0x346d22[_0x4c84('0x47')]['id']){delete _0x346d22[_0x4c84('0x47')]['id'];}return db[_0x4c84('0x29')][_0x4c84('0x45')]({'where':{'id':_0x346d22[_0x4c84('0x48')]['id']}})[_0x4c84('0x25')](handleEntityNotFound(_0x4466ac,null))[_0x4c84('0x25')](saveUpdates(_0x346d22[_0x4c84('0x47')],null))['then'](respondWithResult(_0x4466ac,null))['catch'](handleError(_0x4466ac,null));};exports[_0x4c84('0x49')]=function(_0x1f6b73,_0x49ac37){return db[_0x4c84('0x29')][_0x4c84('0x45')]({'where':{'id':_0x1f6b73[_0x4c84('0x48')]['id']}})['then'](handleEntityNotFound(_0x49ac37,null))[_0x4c84('0x25')](removeEntity(_0x49ac37,null))[_0x4c84('0x43')](handleError(_0x49ac37,null));};exports[_0x4c84('0x4a')]=function(_0x3ca8,_0x25d298){return db[_0x4c84('0x29')]['describe']()['then'](respondWithResult(_0x25d298,null))[_0x4c84('0x43')](handleError(_0x25d298,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 323fc74..67ceadd 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5b6ad9,_0x498092){var _0x47dc9a=function(_0x4aac88){while(--_0x4aac88){_0x5b6ad9['push'](_0x5b6ad9['shift']());}};_0x47dc9a(++_0x498092);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 4e05d15..169c936 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 _0x6e30=['options','raw','then','debug','UpdateSmsQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','catch','CreateSmsQueueReport','SmsQueueReport','create'];(function(_0x41b839,_0xcd158c){var _0x57f0bb=function(_0x266776){while(--_0x266776){_0x41b839['push'](_0x41b839['shift']());}};_0x57f0bb(++_0xcd158c);}(_0x6e30,0x1db));var _0x06e3=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x6e30[_0x4b7b69];return _0x173b4c;};'use strict';var _=require(_0x06e3('0x0'));var util=require('util');var moment=require(_0x06e3('0x1'));var BPromise=require(_0x06e3('0x2'));var rs=require(_0x06e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x06e3('0x4'));var logger=require(_0x06e3('0x5'))('rpc');var config=require(_0x06e3('0x6'));var jayson=require(_0x06e3('0x7'));var client=jayson['client'][_0x06e3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x23feee,_0x406cca,_0x217823){return new BPromise(function(_0x3d89b3,_0x5bcb98){return client['request'](_0x23feee,_0x217823)['then'](function(_0x3e5149){logger[_0x06e3('0x9')]('SmsQueueReport,\x20%s,\x20%s',_0x406cca,_0x06e3('0xa'));logger['debug'](_0x06e3('0xb'),_0x406cca,_0x06e3('0xa'),JSON[_0x06e3('0xc')](_0x3e5149));if(_0x3e5149[_0x06e3('0xd')]){if(_0x3e5149[_0x06e3('0xd')][_0x06e3('0xe')]===0x1f4){logger[_0x06e3('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x406cca,_0x3e5149['error']['message']);return _0x5bcb98(_0x3e5149['error'][_0x06e3('0xf')]);}logger['error'](_0x06e3('0x10'),_0x406cca,_0x3e5149[_0x06e3('0xd')][_0x06e3('0xf')]);return _0x3d89b3(_0x3e5149[_0x06e3('0xd')]['message']);}else{logger[_0x06e3('0x9')](_0x06e3('0x10'),_0x406cca,'request\x20sent');_0x3d89b3(_0x3e5149['result'][_0x06e3('0xf')]);}})[_0x06e3('0x11')](function(_0x26ec3b){logger['error'](_0x06e3('0x10'),_0x406cca,_0x26ec3b);_0x5bcb98(_0x26ec3b);});});}exports[_0x06e3('0x12')]=function(_0x174d5f){var _0x83a696=this;return new Promise(function(_0x198364,_0x5da2ab){return db[_0x06e3('0x13')][_0x06e3('0x14')](_0x174d5f['body'],{'raw':_0x174d5f[_0x06e3('0x15')]?_0x174d5f[_0x06e3('0x15')][_0x06e3('0x16')]===undefined?!![]:![]:!![]})[_0x06e3('0x17')](function(_0x49a390){logger[_0x06e3('0x9')](_0x06e3('0x12'),_0x174d5f);logger[_0x06e3('0x18')](_0x06e3('0x12'),_0x174d5f,JSON[_0x06e3('0xc')](_0x49a390));_0x198364(_0x49a390);})['catch'](function(_0x134aa9){logger['error'](_0x06e3('0x12'),_0x134aa9['message'],_0x174d5f);_0x5da2ab(_0x83a696['error'](0x1f4,_0x134aa9[_0x06e3('0xf')]));});});};exports[_0x06e3('0x19')]=function(_0x3c8f96){var _0x7fad37=this;return new Promise(function(_0x5e7620,_0x5059c4){return db['SmsQueueReport'][_0x06e3('0x1a')](_0x3c8f96[_0x06e3('0x1b')],{'raw':_0x3c8f96[_0x06e3('0x15')]?_0x3c8f96[_0x06e3('0x15')][_0x06e3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c8f96[_0x06e3('0x15')]?_0x3c8f96[_0x06e3('0x15')][_0x06e3('0x1c')]||null:null,'attributes':_0x3c8f96[_0x06e3('0x15')]?_0x3c8f96[_0x06e3('0x15')][_0x06e3('0x1d')]||null:null,'limit':_0x3c8f96[_0x06e3('0x15')]?_0x3c8f96[_0x06e3('0x15')][_0x06e3('0x1e')]||null:null})[_0x06e3('0x17')](function(_0x2c872a){logger['info'](_0x06e3('0x19'),_0x3c8f96);logger[_0x06e3('0x18')](_0x06e3('0x19'),_0x3c8f96,JSON['stringify'](_0x2c872a));_0x5e7620(_0x2c872a);})[_0x06e3('0x11')](function(_0x1fc261){logger['error'](_0x06e3('0x19'),_0x1fc261[_0x06e3('0xf')],_0x3c8f96);_0x5059c4(_0x7fad37[_0x06e3('0xd')](0x1f4,_0x1fc261[_0x06e3('0xf')]));});});}; \ No newline at end of file +var _0x7d34=['request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport','create','body','options','raw','info','catch','UpdateSmsQueueReport','SmsQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','then','SmsQueueReport,\x20%s,\x20%s','debug'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7d34,0x10a));var _0x47d3=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x7d34[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x47d3('0x0'));var util=require(_0x47d3('0x1'));var moment=require(_0x47d3('0x2'));var BPromise=require(_0x47d3('0x3'));var rs=require(_0x47d3('0x4'));var fs=require('fs');var Redis=require(_0x47d3('0x5'));var db=require(_0x47d3('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x47d3('0x7'));var jayson=require(_0x47d3('0x8'));var client=jayson['client'][_0x47d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x198714,_0x55df27,_0x33c645){return new BPromise(function(_0x55749e,_0x2f84c9){return client['request'](_0x198714,_0x33c645)[_0x47d3('0xa')](function(_0x20666a){logger['info'](_0x47d3('0xb'),_0x55df27,'request\x20sent');logger[_0x47d3('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x55df27,_0x47d3('0xd'),JSON[_0x47d3('0xe')](_0x20666a));if(_0x20666a[_0x47d3('0xf')]){if(_0x20666a['error'][_0x47d3('0x10')]===0x1f4){logger[_0x47d3('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x55df27,_0x20666a[_0x47d3('0xf')][_0x47d3('0x11')]);return _0x2f84c9(_0x20666a[_0x47d3('0xf')][_0x47d3('0x11')]);}logger[_0x47d3('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x55df27,_0x20666a['error']['message']);return _0x55749e(_0x20666a[_0x47d3('0xf')][_0x47d3('0x11')]);}else{logger['info'](_0x47d3('0xb'),_0x55df27,_0x47d3('0xd'));_0x55749e(_0x20666a[_0x47d3('0x12')]['message']);}})['catch'](function(_0x11b602){logger[_0x47d3('0xf')](_0x47d3('0xb'),_0x55df27,_0x11b602);_0x2f84c9(_0x11b602);});});}exports[_0x47d3('0x13')]=function(_0x2f0768){var _0x586af1=this;return new Promise(function(_0xd02bdb,_0x2bcb0c){return db['SmsQueueReport'][_0x47d3('0x14')](_0x2f0768[_0x47d3('0x15')],{'raw':_0x2f0768[_0x47d3('0x16')]?_0x2f0768['options'][_0x47d3('0x17')]===undefined?!![]:![]:!![]})[_0x47d3('0xa')](function(_0x21c9b1){logger[_0x47d3('0x18')](_0x47d3('0x13'),_0x2f0768);logger[_0x47d3('0xc')](_0x47d3('0x13'),_0x2f0768,JSON[_0x47d3('0xe')](_0x21c9b1));_0xd02bdb(_0x21c9b1);})[_0x47d3('0x19')](function(_0x6e4421){logger['error'](_0x47d3('0x13'),_0x6e4421[_0x47d3('0x11')],_0x2f0768);_0x2bcb0c(_0x586af1[_0x47d3('0xf')](0x1f4,_0x6e4421[_0x47d3('0x11')]));});});};exports[_0x47d3('0x1a')]=function(_0x282f57){var _0x4c2e22=this;return new Promise(function(_0x3f243c,_0x30c7dd){return db[_0x47d3('0x1b')]['update'](_0x282f57['body'],{'raw':_0x282f57[_0x47d3('0x16')]?_0x282f57[_0x47d3('0x16')][_0x47d3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x282f57[_0x47d3('0x16')]?_0x282f57[_0x47d3('0x16')][_0x47d3('0x1c')]||null:null,'attributes':_0x282f57[_0x47d3('0x16')]?_0x282f57['options'][_0x47d3('0x1d')]||null:null,'limit':_0x282f57[_0x47d3('0x16')]?_0x282f57[_0x47d3('0x16')][_0x47d3('0x1e')]||null:null})['then'](function(_0x22af62){logger[_0x47d3('0x18')]('UpdateSmsQueueReport',_0x282f57);logger[_0x47d3('0xc')](_0x47d3('0x1a'),_0x282f57,JSON[_0x47d3('0xe')](_0x22af62));_0x3f243c(_0x22af62);})[_0x47d3('0x19')](function(_0x2a0693){logger[_0x47d3('0xf')](_0x47d3('0x1a'),_0x2a0693[_0x47d3('0x11')],_0x282f57);_0x30c7dd(_0x4c2e22[_0x47d3('0xf')](0x1f4,_0x2a0693[_0x47d3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 387f944..0f06f1c 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 _0x25fa=['isAuthenticated','index','get','/describe','describe','/:id','post','put','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x25fa,0x109));var _0xa25f=function(_0x2bf96c,_0x448d18){_0x2bf96c=_0x2bf96c-0x0;var _0x8169d=_0x25fa[_0x2bf96c];return _0x8169d;};'use strict';var multer=require(_0xa25f('0x0'));var util=require('util');var path=require(_0xa25f('0x1'));var timeout=require(_0xa25f('0x2'));var express=require('express');var router=express[_0xa25f('0x3')]();var fs_extra=require(_0xa25f('0x4'));var auth=require(_0xa25f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa25f('0x6'));router['get']('/',auth[_0xa25f('0x7')](),controller[_0xa25f('0x8')]);router[_0xa25f('0x9')](_0xa25f('0xa'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xb')]);router[_0xa25f('0x9')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['show']);router[_0xa25f('0xd')]('/',auth[_0xa25f('0x7')](),controller['create']);router[_0xa25f('0xe')](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller[_0xa25f('0xf')]);router['delete'](_0xa25f('0xc'),auth[_0xa25f('0x7')](),controller['destroy']);module[_0xa25f('0x10')]=router; \ No newline at end of file +var _0xd2bb=['../../components/interaction/service','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d2c07,_0x2f8827){var _0x26da7d=function(_0x54a629){while(--_0x54a629){_0x1d2c07['push'](_0x1d2c07['shift']());}};_0x26da7d(++_0x2f8827);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x94b021,_0x3e419c){_0x94b021=_0x94b021-0x0;var _0xfde528=_0xd2bb[_0x94b021];return _0xfde528;};'use strict';var multer=require('multer');var util=require(_0xbd2b('0x0'));var path=require('path');var timeout=require(_0xbd2b('0x1'));var express=require(_0xbd2b('0x2'));var router=express[_0xbd2b('0x3')]();var fs_extra=require(_0xbd2b('0x4'));var auth=require(_0xbd2b('0x5'));var interaction=require(_0xbd2b('0x6'));var config=require('../../config/environment');var controller=require(_0xbd2b('0x7'));router[_0xbd2b('0x8')]('/',auth[_0xbd2b('0x9')](),controller[_0xbd2b('0xa')]);router[_0xbd2b('0x8')](_0xbd2b('0xb'),auth[_0xbd2b('0x9')](),controller[_0xbd2b('0xc')]);router[_0xbd2b('0x8')](_0xbd2b('0xd'),auth['isAuthenticated'](),controller[_0xbd2b('0xe')]);router['post']('/',auth[_0xbd2b('0x9')](),controller[_0xbd2b('0xf')]);router['put'](_0xbd2b('0xd'),auth[_0xbd2b('0x9')](),controller[_0xbd2b('0x10')]);router[_0xbd2b('0x11')](_0xbd2b('0xd'),auth[_0xbd2b('0x9')](),controller[_0xbd2b('0x12')]);module[_0xbd2b('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index d06f0d1..00c5184 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x590b61,_0x4c4335){var _0x1a14dc=function(_0x2ff4f6){while(--_0x2ff4f6){_0x590b61['push'](_0x590b61['shift']());}};_0x1a14dc(++_0x4c4335);}(_0x54ef,0x112));var _0xf54e=function(_0x4744ac,_0x2d9ca4){_0x4744ac=_0x4744ac-0x0;var _0x32badd=_0x54ef[_0x4744ac];return _0x32badd;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x9bde,0xe1));var _0xe9bd=function(_0x1a729a,_0x41249b){_0x1a729a=_0x1a729a-0x0;var _0x37a008=_0x9bde[_0x1a729a];return _0x37a008;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index f25c147..c62a833 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 _0x6d7e=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','SmsTransferReport','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','fields','create','body','find','describe','eml-format','rimraf'];(function(_0x5e6739,_0x32d872){var _0x147185=function(_0x2cf876){while(--_0x2cf876){_0x5e6739['push'](_0x5e6739['shift']());}};_0x147185(++_0x32d872);}(_0x6d7e,0x18e));var _0xe6d7=function(_0x4256ff,_0x30eb95){_0x4256ff=_0x4256ff-0x0;var _0x2e71ec=_0x6d7e[_0x4256ff];return _0x2e71ec;};'use strict';var emlformat=require(_0xe6d7('0x0'));var rimraf=require(_0xe6d7('0x1'));var zipdir=require(_0xe6d7('0x2'));var jsonpatch=require(_0xe6d7('0x3'));var rp=require(_0xe6d7('0x4'));var moment=require('moment');var BPromise=require(_0xe6d7('0x5'));var Mustache=require(_0xe6d7('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe6d7('0x7'));var csv=require(_0xe6d7('0x8'));var ejs=require(_0xe6d7('0x9'));var fs=require('fs');var fs_extra=require(_0xe6d7('0xa'));var _=require(_0xe6d7('0xb'));var squel=require(_0xe6d7('0xc'));var crypto=require(_0xe6d7('0xd'));var jsforce=require(_0xe6d7('0xe'));var deskjs=require(_0xe6d7('0xf'));var toCsv=require(_0xe6d7('0x8'));var querystring=require('querystring');var Papa=require(_0xe6d7('0x10'));var Redis=require(_0xe6d7('0x11'));var authService=require(_0xe6d7('0x12'));var qs=require(_0xe6d7('0x13'));var as=require(_0xe6d7('0x14'));var hardwareService=require(_0xe6d7('0x15'));var logger=require(_0xe6d7('0x16'))(_0xe6d7('0x17'));var utils=require('../../config/utils');var config=require(_0xe6d7('0x18'));var licenseUtil=require(_0xe6d7('0x19'));var db=require(_0xe6d7('0x1a'))['db'];function respondWithStatusCode(_0x34aa39,_0x508587){_0x508587=_0x508587||0xcc;return function(_0x2a52da){if(_0x2a52da){return _0x34aa39[_0xe6d7('0x1b')](_0x508587);}return _0x34aa39['status'](_0x508587)[_0xe6d7('0x1c')]();};}function respondWithResult(_0x3b8706,_0x52e0fb){_0x52e0fb=_0x52e0fb||0xc8;return function(_0x34fcf0){if(_0x34fcf0){return _0x3b8706[_0xe6d7('0x1d')](_0x52e0fb)['json'](_0x34fcf0);}};}function respondWithFilteredResult(_0x4852a5,_0x4b4581){return function(_0x1c34d7){if(_0x1c34d7){var _0x6ee34b=typeof _0x4b4581['offset']===_0xe6d7('0x1e')&&typeof _0x4b4581[_0xe6d7('0x1f')]===_0xe6d7('0x1e');var _0x5d91ab=_0x1c34d7[_0xe6d7('0x20')];var _0x2480c4=_0x6ee34b?0x0:_0x4b4581['offset'];var _0x4e8484=_0x6ee34b?_0x1c34d7[_0xe6d7('0x20')]:_0x4b4581['offset']+_0x4b4581[_0xe6d7('0x1f')];var _0x1632e7;if(_0x4e8484>=_0x5d91ab){_0x4e8484=_0x5d91ab;_0x1632e7=0xc8;}else{_0x1632e7=0xce;}_0x4852a5['status'](_0x1632e7);return _0x4852a5[_0xe6d7('0x21')]('Content-Range',_0x2480c4+'-'+_0x4e8484+'/'+_0x5d91ab)[_0xe6d7('0x22')](_0x1c34d7);}return null;};}function patchUpdates(_0x48ccd4){return function(_0xf137a9){try{jsonpatch[_0xe6d7('0x23')](_0xf137a9,_0x48ccd4,!![]);}catch(_0x576de8){return BPromise[_0xe6d7('0x24')](_0x576de8);}return _0xf137a9[_0xe6d7('0x25')]();};}function saveUpdates(_0x208527,_0x25cce0){return function(_0xf6379){if(_0xf6379){return _0xf6379[_0xe6d7('0x26')](_0x208527)[_0xe6d7('0x27')](function(_0x2a4797){return _0x2a4797;});}return null;};}function removeEntity(_0x328738,_0x3e6e2f){return function(_0x4a9bd6){if(_0x4a9bd6){return _0x4a9bd6[_0xe6d7('0x28')]()[_0xe6d7('0x27')](function(){_0x328738['status'](0xcc)[_0xe6d7('0x1c')]();});}};}function handleEntityNotFound(_0x1b31e8,_0x4150f1){return function(_0x415480){if(!_0x415480){_0x1b31e8['sendStatus'](0x194);}return _0x415480;};}function handleError(_0x22a831,_0x13c3d2){_0x13c3d2=_0x13c3d2||0x1f4;return function(_0x12642b){logger[_0xe6d7('0x29')](_0x12642b[_0xe6d7('0x2a')]);if(_0x12642b['name']){delete _0x12642b[_0xe6d7('0x2b')];}_0x22a831[_0xe6d7('0x1d')](_0x13c3d2)[_0xe6d7('0x2c')](_0x12642b);};}exports['index']=function(_0xf1927b,_0x142d11){var _0x4f6799={},_0x35eb4d={},_0x348f50={'count':0x0,'rows':[]};var _0x3559b4=_[_0xe6d7('0x2d')](db[_0xe6d7('0x2e')]['rawAttributes'],function(_0x1fa9e0){return{'name':_0x1fa9e0[_0xe6d7('0x2f')],'type':_0x1fa9e0[_0xe6d7('0x30')][_0xe6d7('0x31')]};});_0x35eb4d[_0xe6d7('0x32')]=_[_0xe6d7('0x2d')](_0x3559b4,'name');_0x35eb4d[_0xe6d7('0x33')]=_['keys'](_0xf1927b['query']);_0x35eb4d[_0xe6d7('0x34')]=_[_0xe6d7('0x35')](_0x35eb4d[_0xe6d7('0x32')],_0x35eb4d[_0xe6d7('0x33')]);_0x4f6799[_0xe6d7('0x36')]=_['intersection'](_0x35eb4d['model'],qs['fields'](_0xf1927b['query']['fields']));_0x4f6799[_0xe6d7('0x36')]=_0x4f6799[_0xe6d7('0x36')][_0xe6d7('0x37')]?_0x4f6799['attributes']:_0x35eb4d[_0xe6d7('0x32')];if(!_0xf1927b[_0xe6d7('0x33')][_0xe6d7('0x38')](_0xe6d7('0x39'))){_0x4f6799[_0xe6d7('0x1f')]=qs[_0xe6d7('0x1f')](_0xf1927b[_0xe6d7('0x33')][_0xe6d7('0x1f')]);_0x4f6799[_0xe6d7('0x3a')]=qs['offset'](_0xf1927b[_0xe6d7('0x33')][_0xe6d7('0x3a')]);}_0x4f6799[_0xe6d7('0x3b')]=qs[_0xe6d7('0x3c')](_0xf1927b[_0xe6d7('0x33')][_0xe6d7('0x3c')]);_0x4f6799[_0xe6d7('0x3d')]=qs[_0xe6d7('0x34')](_[_0xe6d7('0x3e')](_0xf1927b['query'],_0x35eb4d['filters']),_0x3559b4);if(_0xf1927b['query'][_0xe6d7('0x3f')]){_0x4f6799[_0xe6d7('0x3d')]=_[_0xe6d7('0x40')](_0x4f6799[_0xe6d7('0x3d')],{'$or':_[_0xe6d7('0x2d')](_0x3559b4,function(_0x1bcb67){if(_0x1bcb67[_0xe6d7('0x30')]!==_0xe6d7('0x41')){var _0x498849={};_0x498849[_0x1bcb67[_0xe6d7('0x2b')]]={'$like':'%'+_0xf1927b[_0xe6d7('0x33')][_0xe6d7('0x3f')]+'%'};return _0x498849;}})});}_0x4f6799=_[_0xe6d7('0x40')]({},_0x4f6799,_0xf1927b[_0xe6d7('0x42')]);var _0x304f90={'where':_0x4f6799[_0xe6d7('0x3d')]};return db['SmsTransferReport'][_0xe6d7('0x20')](_0x304f90)[_0xe6d7('0x27')](function(_0x1fb204){_0x348f50[_0xe6d7('0x20')]=_0x1fb204;if(_0xf1927b[_0xe6d7('0x33')][_0xe6d7('0x43')]){_0x4f6799[_0xe6d7('0x44')]=[{'all':!![]}];}return db[_0xe6d7('0x2e')]['findAll'](_0x4f6799);})[_0xe6d7('0x27')](function(_0x56c48c){_0x348f50[_0xe6d7('0x45')]=_0x56c48c;return _0x348f50;})[_0xe6d7('0x27')](respondWithFilteredResult(_0x142d11,_0x4f6799))[_0xe6d7('0x46')](handleError(_0x142d11,null));};exports[_0xe6d7('0x47')]=function(_0x4b9968,_0x13304b){var _0x3b109d={'raw':!![],'where':{'id':_0x4b9968[_0xe6d7('0x48')]['id']}},_0x1c73a0={};_0x1c73a0[_0xe6d7('0x32')]=_[_0xe6d7('0x49')](db[_0xe6d7('0x2e')][_0xe6d7('0x4a')]);_0x1c73a0[_0xe6d7('0x33')]=_[_0xe6d7('0x49')](_0x4b9968['query']);_0x1c73a0[_0xe6d7('0x34')]=_[_0xe6d7('0x35')](_0x1c73a0[_0xe6d7('0x32')],_0x1c73a0['query']);_0x3b109d[_0xe6d7('0x36')]=_['intersection'](_0x1c73a0[_0xe6d7('0x32')],qs[_0xe6d7('0x4b')](_0x4b9968['query'][_0xe6d7('0x4b')]));_0x3b109d['attributes']=_0x3b109d[_0xe6d7('0x36')][_0xe6d7('0x37')]?_0x3b109d[_0xe6d7('0x36')]:_0x1c73a0[_0xe6d7('0x32')];if(_0x4b9968[_0xe6d7('0x33')][_0xe6d7('0x43')]){_0x3b109d[_0xe6d7('0x44')]=[{'all':!![]}];}_0x3b109d=_[_0xe6d7('0x40')]({},_0x3b109d,_0x4b9968[_0xe6d7('0x42')]);return db[_0xe6d7('0x2e')]['find'](_0x3b109d)[_0xe6d7('0x27')](handleEntityNotFound(_0x13304b,null))['then'](respondWithResult(_0x13304b,null))[_0xe6d7('0x46')](handleError(_0x13304b,null));};exports[_0xe6d7('0x4c')]=function(_0x53bc0e,_0x197baa){return db['SmsTransferReport']['create'](_0x53bc0e['body'],{})['then'](respondWithResult(_0x197baa,0xc9))[_0xe6d7('0x46')](handleError(_0x197baa,null));};exports[_0xe6d7('0x26')]=function(_0x51dd0c,_0x4eff0c){if(_0x51dd0c[_0xe6d7('0x4d')]['id']){delete _0x51dd0c['body']['id'];}return db['SmsTransferReport'][_0xe6d7('0x4e')]({'where':{'id':_0x51dd0c[_0xe6d7('0x48')]['id']}})[_0xe6d7('0x27')](handleEntityNotFound(_0x4eff0c,null))['then'](saveUpdates(_0x51dd0c[_0xe6d7('0x4d')],null))[_0xe6d7('0x27')](respondWithResult(_0x4eff0c,null))['catch'](handleError(_0x4eff0c,null));};exports['destroy']=function(_0x17d255,_0x244fc6){return db[_0xe6d7('0x2e')]['find']({'where':{'id':_0x17d255[_0xe6d7('0x48')]['id']}})[_0xe6d7('0x27')](handleEntityNotFound(_0x244fc6,null))[_0xe6d7('0x27')](removeEntity(_0x244fc6,null))[_0xe6d7('0x46')](handleError(_0x244fc6,null));};exports[_0xe6d7('0x4f')]=function(_0x2257e8,_0x4d272e){return db['SmsTransferReport'][_0xe6d7('0x4f')]()[_0xe6d7('0x27')](respondWithResult(_0x4d272e,null))[_0xe6d7('0x46')](handleError(_0x4d272e,null));}; \ No newline at end of file +var _0x5173=['mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','send','index','map','SmsTransferReport','rawAttributes','type','key','name','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x25d4c5,_0x51c22e){var _0x400a70=function(_0x5985ad){while(--_0x5985ad){_0x25d4c5['push'](_0x25d4c5['shift']());}};_0x400a70(++_0x51c22e);}(_0x5173,0xd8));var _0x3517=function(_0x2dec50,_0x3902cc){_0x2dec50=_0x2dec50-0x0;var _0x4e8c66=_0x5173[_0x2dec50];return _0x4e8c66;};'use strict';var emlformat=require(_0x3517('0x0'));var rimraf=require(_0x3517('0x1'));var zipdir=require(_0x3517('0x2'));var jsonpatch=require(_0x3517('0x3'));var rp=require(_0x3517('0x4'));var moment=require('moment');var BPromise=require(_0x3517('0x5'));var Mustache=require(_0x3517('0x6'));var util=require(_0x3517('0x7'));var path=require(_0x3517('0x8'));var sox=require(_0x3517('0x9'));var csv=require(_0x3517('0xa'));var ejs=require(_0x3517('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3517('0xc'));var squel=require(_0x3517('0xd'));var crypto=require('crypto');var jsforce=require(_0x3517('0xe'));var deskjs=require(_0x3517('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3517('0x10'));var Redis=require('ioredis');var authService=require(_0x3517('0x11'));var qs=require(_0x3517('0x12'));var as=require(_0x3517('0x13'));var hardwareService=require(_0x3517('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x3517('0x15'));var config=require(_0x3517('0x16'));var licenseUtil=require(_0x3517('0x17'));var db=require(_0x3517('0x18'))['db'];function respondWithStatusCode(_0x1cd580,_0x361bce){_0x361bce=_0x361bce||0xcc;return function(_0x4e9e9b){if(_0x4e9e9b){return _0x1cd580[_0x3517('0x19')](_0x361bce);}return _0x1cd580['status'](_0x361bce)['end']();};}function respondWithResult(_0x58ee73,_0x4a72af){_0x4a72af=_0x4a72af||0xc8;return function(_0x21c5d3){if(_0x21c5d3){return _0x58ee73[_0x3517('0x1a')](_0x4a72af)[_0x3517('0x1b')](_0x21c5d3);}};}function respondWithFilteredResult(_0x62603d,_0x36f77c){return function(_0x22128e){if(_0x22128e){var _0xf95dc1=typeof _0x36f77c['offset']==='undefined'&&typeof _0x36f77c['limit']==='undefined';var _0x3b0096=_0x22128e[_0x3517('0x1c')];var _0x57d120=_0xf95dc1?0x0:_0x36f77c[_0x3517('0x1d')];var _0x5170f5=_0xf95dc1?_0x22128e['count']:_0x36f77c['offset']+_0x36f77c[_0x3517('0x1e')];var _0x5320b6;if(_0x5170f5>=_0x3b0096){_0x5170f5=_0x3b0096;_0x5320b6=0xc8;}else{_0x5320b6=0xce;}_0x62603d[_0x3517('0x1a')](_0x5320b6);return _0x62603d['set'](_0x3517('0x1f'),_0x57d120+'-'+_0x5170f5+'/'+_0x3b0096)['json'](_0x22128e);}return null;};}function patchUpdates(_0x576785){return function(_0x365cdc){try{jsonpatch[_0x3517('0x20')](_0x365cdc,_0x576785,!![]);}catch(_0x59cb75){return BPromise[_0x3517('0x21')](_0x59cb75);}return _0x365cdc[_0x3517('0x22')]();};}function saveUpdates(_0x4bc728,_0x2d1db9){return function(_0x4278ad){if(_0x4278ad){return _0x4278ad[_0x3517('0x23')](_0x4bc728)[_0x3517('0x24')](function(_0x2b8774){return _0x2b8774;});}return null;};}function removeEntity(_0x33b1e8,_0x7c937b){return function(_0x4042a1){if(_0x4042a1){return _0x4042a1[_0x3517('0x25')]()[_0x3517('0x24')](function(){_0x33b1e8[_0x3517('0x1a')](0xcc)[_0x3517('0x26')]();});}};}function handleEntityNotFound(_0x28dec5,_0x27f247){return function(_0x2b90f0){if(!_0x2b90f0){_0x28dec5[_0x3517('0x19')](0x194);}return _0x2b90f0;};}function handleError(_0x466cdf,_0x431e25){_0x431e25=_0x431e25||0x1f4;return function(_0x2ba92f){logger['error'](_0x2ba92f[_0x3517('0x27')]);if(_0x2ba92f['name']){delete _0x2ba92f['name'];}_0x466cdf[_0x3517('0x1a')](_0x431e25)[_0x3517('0x28')](_0x2ba92f);};}exports[_0x3517('0x29')]=function(_0x315955,_0x23468e){var _0x545f80={},_0x584ce0={},_0x36a8a1={'count':0x0,'rows':[]};var _0x241e4f=_[_0x3517('0x2a')](db[_0x3517('0x2b')][_0x3517('0x2c')],function(_0x465e31){return{'name':_0x465e31['fieldName'],'type':_0x465e31[_0x3517('0x2d')][_0x3517('0x2e')]};});_0x584ce0['model']=_[_0x3517('0x2a')](_0x241e4f,_0x3517('0x2f'));_0x584ce0['query']=_['keys'](_0x315955[_0x3517('0x30')]);_0x584ce0[_0x3517('0x31')]=_[_0x3517('0x32')](_0x584ce0[_0x3517('0x33')],_0x584ce0[_0x3517('0x30')]);_0x545f80['attributes']=_[_0x3517('0x32')](_0x584ce0[_0x3517('0x33')],qs[_0x3517('0x34')](_0x315955['query'][_0x3517('0x34')]));_0x545f80[_0x3517('0x35')]=_0x545f80[_0x3517('0x35')][_0x3517('0x36')]?_0x545f80[_0x3517('0x35')]:_0x584ce0['model'];if(!_0x315955['query'][_0x3517('0x37')](_0x3517('0x38'))){_0x545f80[_0x3517('0x1e')]=qs[_0x3517('0x1e')](_0x315955['query']['limit']);_0x545f80[_0x3517('0x1d')]=qs[_0x3517('0x1d')](_0x315955[_0x3517('0x30')][_0x3517('0x1d')]);}_0x545f80[_0x3517('0x39')]=qs['sort'](_0x315955[_0x3517('0x30')]['sort']);_0x545f80[_0x3517('0x3a')]=qs[_0x3517('0x31')](_[_0x3517('0x3b')](_0x315955[_0x3517('0x30')],_0x584ce0[_0x3517('0x31')]),_0x241e4f);if(_0x315955['query'][_0x3517('0x3c')]){_0x545f80['where']=_['merge'](_0x545f80[_0x3517('0x3a')],{'$or':_[_0x3517('0x2a')](_0x241e4f,function(_0x457dcf){if(_0x457dcf[_0x3517('0x2d')]!==_0x3517('0x3d')){var _0x5e4ed1={};_0x5e4ed1[_0x457dcf[_0x3517('0x2f')]]={'$like':'%'+_0x315955[_0x3517('0x30')][_0x3517('0x3c')]+'%'};return _0x5e4ed1;}})});}_0x545f80=_[_0x3517('0x3e')]({},_0x545f80,_0x315955[_0x3517('0x3f')]);var _0x3927d9={'where':_0x545f80[_0x3517('0x3a')]};return db[_0x3517('0x2b')][_0x3517('0x1c')](_0x3927d9)[_0x3517('0x24')](function(_0x302884){_0x36a8a1['count']=_0x302884;if(_0x315955[_0x3517('0x30')][_0x3517('0x40')]){_0x545f80[_0x3517('0x41')]=[{'all':!![]}];}return db[_0x3517('0x2b')][_0x3517('0x42')](_0x545f80);})['then'](function(_0x4e5a1e){_0x36a8a1[_0x3517('0x43')]=_0x4e5a1e;return _0x36a8a1;})['then'](respondWithFilteredResult(_0x23468e,_0x545f80))[_0x3517('0x44')](handleError(_0x23468e,null));};exports['show']=function(_0x3cd3db,_0x5cb7a4){var _0x4fb11c={'raw':!![],'where':{'id':_0x3cd3db['params']['id']}},_0x49edd9={};_0x49edd9[_0x3517('0x33')]=_['keys'](db[_0x3517('0x2b')][_0x3517('0x2c')]);_0x49edd9[_0x3517('0x30')]=_[_0x3517('0x45')](_0x3cd3db[_0x3517('0x30')]);_0x49edd9[_0x3517('0x31')]=_[_0x3517('0x32')](_0x49edd9[_0x3517('0x33')],_0x49edd9[_0x3517('0x30')]);_0x4fb11c['attributes']=_[_0x3517('0x32')](_0x49edd9['model'],qs[_0x3517('0x34')](_0x3cd3db[_0x3517('0x30')][_0x3517('0x34')]));_0x4fb11c[_0x3517('0x35')]=_0x4fb11c[_0x3517('0x35')]['length']?_0x4fb11c['attributes']:_0x49edd9['model'];if(_0x3cd3db[_0x3517('0x30')][_0x3517('0x40')]){_0x4fb11c[_0x3517('0x41')]=[{'all':!![]}];}_0x4fb11c=_[_0x3517('0x3e')]({},_0x4fb11c,_0x3cd3db[_0x3517('0x3f')]);return db[_0x3517('0x2b')][_0x3517('0x46')](_0x4fb11c)[_0x3517('0x24')](handleEntityNotFound(_0x5cb7a4,null))[_0x3517('0x24')](respondWithResult(_0x5cb7a4,null))['catch'](handleError(_0x5cb7a4,null));};exports[_0x3517('0x47')]=function(_0x37bd18,_0x19c19a){return db[_0x3517('0x2b')]['create'](_0x37bd18[_0x3517('0x48')],{})[_0x3517('0x24')](respondWithResult(_0x19c19a,0xc9))[_0x3517('0x44')](handleError(_0x19c19a,null));};exports[_0x3517('0x23')]=function(_0x209ff5,_0x32129d){if(_0x209ff5[_0x3517('0x48')]['id']){delete _0x209ff5[_0x3517('0x48')]['id'];}return db[_0x3517('0x2b')][_0x3517('0x46')]({'where':{'id':_0x209ff5['params']['id']}})[_0x3517('0x24')](handleEntityNotFound(_0x32129d,null))[_0x3517('0x24')](saveUpdates(_0x209ff5['body'],null))['then'](respondWithResult(_0x32129d,null))[_0x3517('0x44')](handleError(_0x32129d,null));};exports[_0x3517('0x25')]=function(_0x579b7b,_0x425766){return db['SmsTransferReport'][_0x3517('0x46')]({'where':{'id':_0x579b7b[_0x3517('0x49')]['id']}})['then'](handleEntityNotFound(_0x425766,null))[_0x3517('0x24')](removeEntity(_0x425766,null))[_0x3517('0x44')](handleError(_0x425766,null));};exports['describe']=function(_0x190afc,_0x3ea6b1){return db['SmsTransferReport']['describe']()[_0x3517('0x24')](respondWithResult(_0x3ea6b1,null))[_0x3517('0x44')](handleError(_0x3ea6b1,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 4b452be..3639a08 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 _0xf9fd=['lodash','util','../../config/logger','moment','bluebird','path','./smsTransferReport.attributes','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x7ef5fc,_0x5c5187){var _0x4e6bda=function(_0x26693b){while(--_0x26693b){_0x7ef5fc['push'](_0x7ef5fc['shift']());}};_0x4e6bda(++_0x5c5187);}(_0xf9fd,0x118));var _0xdf9f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xf9fd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xdf9f('0x0'));var util=require(_0xdf9f('0x1'));var logger=require(_0xdf9f('0x2'))('api');var moment=require(_0xdf9f('0x3'));var BPromise=require(_0xdf9f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf9f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdf9f('0x6'));module['exports']=function(_0x2de026,_0x2e45bb){return _0x2de026['define'](_0xdf9f('0x7'),attributes,{'tableName':_0xdf9f('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdf9f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf128=['bluebird','request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4f8b44,_0x4eda31){var _0x45727b=function(_0x566b10){while(--_0x566b10){_0x4f8b44['push'](_0x4f8b44['shift']());}};_0x45727b(++_0x4eda31);}(_0xf128,0x109));var _0x8f12=function(_0x59c5e8,_0x482de4){_0x59c5e8=_0x59c5e8-0x0;var _0x220a95=_0xf128[_0x59c5e8];return _0x220a95;};'use strict';var _=require(_0x8f12('0x0'));var util=require(_0x8f12('0x1'));var logger=require(_0x8f12('0x2'))(_0x8f12('0x3'));var moment=require(_0x8f12('0x4'));var BPromise=require(_0x8f12('0x5'));var rp=require(_0x8f12('0x6'));var fs=require('fs');var path=require(_0x8f12('0x7'));var rimraf=require('rimraf');var config=require(_0x8f12('0x8'));var attributes=require(_0x8f12('0x9'));module[_0x8f12('0xa')]=function(_0x19877e,_0x583b50){return _0x19877e[_0x8f12('0xb')](_0x8f12('0xc'),attributes,{'tableName':_0x8f12('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8f12('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 949d786..e063a87 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 _0x5395=['SmsTransferReport,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x248758,_0x5e46fd){var _0x4346b4=function(_0x2f70a5){while(--_0x2f70a5){_0x248758['push'](_0x248758['shift']());}};_0x4346b4(++_0x5e46fd);}(_0x5395,0x150));var _0x5539=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5395[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x5539('0x0'));var util=require('util');var moment=require(_0x5539('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5539('0x2'));var db=require(_0x5539('0x3'))['db'];var utils=require(_0x5539('0x4'));var logger=require('../../config/logger')(_0x5539('0x5'));var config=require(_0x5539('0x6'));var jayson=require(_0x5539('0x7'));var client=jayson[_0x5539('0x8')][_0x5539('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2aa7e0,_0x26f171,_0x16af83){return new BPromise(function(_0x56b645,_0x37fb7d){return client[_0x5539('0xa')](_0x2aa7e0,_0x16af83)[_0x5539('0xb')](function(_0x417b4c){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x26f171,'request\x20sent');logger['debug'](_0x5539('0xc'),_0x26f171,'request\x20sent',JSON[_0x5539('0xd')](_0x417b4c));if(_0x417b4c['error']){if(_0x417b4c[_0x5539('0xe')][_0x5539('0xf')]===0x1f4){logger['error'](_0x5539('0x10'),_0x26f171,_0x417b4c[_0x5539('0xe')][_0x5539('0x11')]);return _0x37fb7d(_0x417b4c[_0x5539('0xe')][_0x5539('0x11')]);}logger[_0x5539('0xe')](_0x5539('0x10'),_0x26f171,_0x417b4c['error'][_0x5539('0x11')]);return _0x56b645(_0x417b4c[_0x5539('0xe')]['message']);}else{logger[_0x5539('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x26f171,_0x5539('0x13'));_0x56b645(_0x417b4c[_0x5539('0x14')][_0x5539('0x11')]);}})[_0x5539('0x15')](function(_0x208599){logger[_0x5539('0xe')](_0x5539('0x10'),_0x26f171,_0x208599);_0x37fb7d(_0x208599);});});} \ No newline at end of file +var _0x49c4=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x5e95ff,_0x1815a5){var _0x4ec019=function(_0x32fc40){while(--_0x32fc40){_0x5e95ff['push'](_0x5e95ff['shift']());}};_0x4ec019(++_0x1815a5);}(_0x49c4,0x9b));var _0x449c=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x49c4[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x449c('0x0'));var util=require('util');var moment=require(_0x449c('0x1'));var BPromise=require(_0x449c('0x2'));var rs=require(_0x449c('0x3'));var fs=require('fs');var Redis=require(_0x449c('0x4'));var db=require(_0x449c('0x5'))['db'];var utils=require(_0x449c('0x6'));var logger=require(_0x449c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x449c('0x8'));var client=jayson[_0x449c('0x9')][_0x449c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db09a,_0x3e7c19,_0x43cb0e){return new BPromise(function(_0x3e6354,_0x6d76d1){return client[_0x449c('0xb')](_0x2db09a,_0x43cb0e)[_0x449c('0xc')](function(_0x32f061){logger[_0x449c('0xd')](_0x449c('0xe'),_0x3e7c19,_0x449c('0xf'));logger[_0x449c('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x3e7c19,'request\x20sent',JSON[_0x449c('0x11')](_0x32f061));if(_0x32f061[_0x449c('0x12')]){if(_0x32f061['error']['code']===0x1f4){logger['error'](_0x449c('0xe'),_0x3e7c19,_0x32f061[_0x449c('0x12')][_0x449c('0x13')]);return _0x6d76d1(_0x32f061[_0x449c('0x12')]['message']);}logger[_0x449c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3e7c19,_0x32f061[_0x449c('0x12')]['message']);return _0x3e6354(_0x32f061[_0x449c('0x12')][_0x449c('0x13')]);}else{logger[_0x449c('0xd')](_0x449c('0xe'),_0x3e7c19,_0x449c('0xf'));_0x3e6354(_0x32f061[_0x449c('0x14')][_0x449c('0x13')]);}})[_0x449c('0x15')](function(_0x132a5b){logger[_0x449c('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x3e7c19,_0x132a5b);_0x6d76d1(_0x132a5b);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index faae0c9..7cb6067 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 _0xe3d7=['now','post','single','file','create','put','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','%s-%s%s','extname'];(function(_0x940ffa,_0x4a5879){var _0x31119d=function(_0x475c4c){while(--_0x475c4c){_0x940ffa['push'](_0x940ffa['shift']());}};_0x31119d(++_0x4a5879);}(_0xe3d7,0x109));var _0x7e3d=function(_0x3a3ded,_0x4e2436){_0x3a3ded=_0x3a3ded-0x0;var _0x3dd968=_0xe3d7[_0x3a3ded];return _0x3dd968;};'use strict';var multer=require(_0x7e3d('0x0'));var util=require(_0x7e3d('0x1'));var path=require(_0x7e3d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e3d('0x3')]();var fs_extra=require(_0x7e3d('0x4'));var auth=require(_0x7e3d('0x5'));var interaction=require(_0x7e3d('0x6'));var config=require(_0x7e3d('0x7'));var controller=require(_0x7e3d('0x8'));router['get']('/',auth[_0x7e3d('0x9')](),controller[_0x7e3d('0xa')]);router[_0x7e3d('0xb')](_0x7e3d('0xc'),auth[_0x7e3d('0x9')](),controller[_0x7e3d('0xd')]);router[_0x7e3d('0xb')](_0x7e3d('0xe'),auth[_0x7e3d('0x9')](),controller[_0x7e3d('0xf')]);var upload=multer({'storage':multer[_0x7e3d('0x10')]({'destination':function(_0x293013,_0x537f20,_0xb2efec){_0xb2efec(null,path[_0x7e3d('0x11')](config[_0x7e3d('0x12')],_0x7e3d('0x13')));},'filename':function(_0x2c3d83,_0x5cdcab,_0x4da298){_0x5cdcab[_0x7e3d('0x14')]=_0x5cdcab[_0x7e3d('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4da298(null,util['format'](_0x7e3d('0x15'),path['basename'](_0x5cdcab['originalname'],path[_0x7e3d('0x16')](_0x5cdcab['originalname'])),Date[_0x7e3d('0x17')](),path[_0x7e3d('0x16')](_0x5cdcab[_0x7e3d('0x14')])));}})});router[_0x7e3d('0x18')]('/',upload[_0x7e3d('0x19')](_0x7e3d('0x1a')),controller[_0x7e3d('0x1b')]);router[_0x7e3d('0x1c')](_0x7e3d('0xc'),auth[_0x7e3d('0x9')](),controller[_0x7e3d('0x1d')]);router[_0x7e3d('0x1e')](_0x7e3d('0xc'),auth[_0x7e3d('0x9')](),controller[_0x7e3d('0x1e')]);module[_0x7e3d('0x1f')]=router; \ No newline at end of file +var _0xc519=['/:id/download','diskStorage','join','root','server/files/sounds/original/','originalname','format','basename','extname','now','post','single','file','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show'];(function(_0x56608c,_0x29eb74){var _0x3c7fb0=function(_0x154b1c){while(--_0x154b1c){_0x56608c['push'](_0x56608c['shift']());}};_0x3c7fb0(++_0x29eb74);}(_0xc519,0x8d));var _0x9c51=function(_0x439790,_0x2f4e02){_0x439790=_0x439790-0x0;var _0x1275ab=_0xc519[_0x439790];return _0x1275ab;};'use strict';var multer=require(_0x9c51('0x0'));var util=require(_0x9c51('0x1'));var path=require(_0x9c51('0x2'));var timeout=require(_0x9c51('0x3'));var express=require('express');var router=express[_0x9c51('0x4')]();var fs_extra=require(_0x9c51('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c51('0x6'));var config=require(_0x9c51('0x7'));var controller=require(_0x9c51('0x8'));router[_0x9c51('0x9')]('/',auth[_0x9c51('0xa')](),controller[_0x9c51('0xb')]);router[_0x9c51('0x9')](_0x9c51('0xc'),auth[_0x9c51('0xa')](),controller[_0x9c51('0xd')]);router[_0x9c51('0x9')](_0x9c51('0xe'),auth[_0x9c51('0xa')](),controller['download']);var upload=multer({'storage':multer[_0x9c51('0xf')]({'destination':function(_0x173448,_0x49cd16,_0x52d45d){_0x52d45d(null,path[_0x9c51('0x10')](config[_0x9c51('0x11')],_0x9c51('0x12')));},'filename':function(_0x53b3da,_0x211408,_0xe06bf4){_0x211408['originalname']=_0x211408[_0x9c51('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe06bf4(null,util[_0x9c51('0x14')]('%s-%s%s',path[_0x9c51('0x15')](_0x211408[_0x9c51('0x13')],path[_0x9c51('0x16')](_0x211408[_0x9c51('0x13')])),Date[_0x9c51('0x17')](),path['extname'](_0x211408['originalname'])));}})});router[_0x9c51('0x18')]('/',upload[_0x9c51('0x19')](_0x9c51('0x1a')),controller['create']);router[_0x9c51('0x1b')]('/:id',auth[_0x9c51('0xa')](),controller[_0x9c51('0x1c')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9c51('0x1d')]);module[_0x9c51('0x1e')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index d789cca..9687c78 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 _0x98a7=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x507cd9,_0x4762c1){var _0x132d1b=function(_0x5ecc1e){while(--_0x5ecc1e){_0x507cd9['push'](_0x507cd9['shift']());}};_0x132d1b(++_0x4762c1);}(_0x98a7,0x9e));var _0x798a=function(_0x421b41,_0xea3155){_0x421b41=_0x421b41-0x0;var _0x2c06c6=_0x98a7[_0x421b41];return _0x2c06c6;};'use strict';var Sequelize=require(_0x798a('0x0'));module[_0x798a('0x1')]={'name':{'type':Sequelize[_0x798a('0x2')],'unique':_0x798a('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x798a('0x2')]},'display_name':{'type':Sequelize[_0x798a('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x798a('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x798a('0x4')]},'original_sampleCount':{'type':Sequelize[_0x798a('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x798a('0x6')]},'converted_format':{'type':Sequelize[_0x798a('0x2')]},'converted_duration':{'type':Sequelize[_0x798a('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x798a('0x5')]},'converted_channelCount':{'type':Sequelize[_0x798a('0x6')]},'converted_bitRate':{'type':Sequelize[_0x798a('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x798a('0x6')]}}; \ No newline at end of file +var _0x67ec=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0x67ec,0x1a3));var _0xc67e=function(_0x250d65,_0x28f1a8){_0x250d65=_0x250d65-0x0;var _0x3b3ff9=_0x67ec[_0x250d65];return _0x3b3ff9;};'use strict';var Sequelize=require(_0xc67e('0x0'));module[_0xc67e('0x1')]={'name':{'type':Sequelize[_0xc67e('0x2')],'unique':_0xc67e('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc67e('0x2')]},'display_name':{'type':Sequelize[_0xc67e('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xc67e('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xc67e('0x4')]},'original_sampleCount':{'type':Sequelize[_0xc67e('0x5')]},'original_channelCount':{'type':Sequelize[_0xc67e('0x6')]},'original_bitRate':{'type':Sequelize[_0xc67e('0x5')]},'original_sampleRate':{'type':Sequelize[_0xc67e('0x6')]},'converted_format':{'type':Sequelize[_0xc67e('0x2')]},'converted_duration':{'type':Sequelize[_0xc67e('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xc67e('0x5')]},'converted_channelCount':{'type':Sequelize[_0xc67e('0x6')]},'converted_bitRate':{'type':Sequelize[_0xc67e('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xc67e('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 11153bb..6a57fe2 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 _0xac0a=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','destroy','then','get','end','error','send','index','map','Sound','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','catch','show','find','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','filename','extname','substring','server/files/sounds/original','info','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','update','params','description','original_format','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x40d82f,_0x27628d){var _0x3e1900=function(_0x1a6434){while(--_0x1a6434){_0x40d82f['push'](_0x40d82f['shift']());}};_0x3e1900(++_0x27628d);}(_0xac0a,0x1d7));var _0xaac0=function(_0x5d3676,_0x24edeb){_0x5d3676=_0x5d3676-0x0;var _0x504f5b=_0xac0a[_0x5d3676];return _0x504f5b;};'use strict';var emlformat=require(_0xaac0('0x0'));var rimraf=require(_0xaac0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaac0('0x2'));var moment=require(_0xaac0('0x3'));var BPromise=require(_0xaac0('0x4'));var Mustache=require(_0xaac0('0x5'));var util=require(_0xaac0('0x6'));var path=require('path');var sox=require(_0xaac0('0x7'));var csv=require(_0xaac0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac0('0x9'));var squel=require(_0xaac0('0xa'));var crypto=require(_0xaac0('0xb'));var jsforce=require(_0xaac0('0xc'));var deskjs=require(_0xaac0('0xd'));var toCsv=require(_0xaac0('0x8'));var querystring=require(_0xaac0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaac0('0xf'));var qs=require(_0xaac0('0x10'));var as=require(_0xaac0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaac0('0x12'))(_0xaac0('0x13'));var utils=require(_0xaac0('0x14'));var config=require(_0xaac0('0x15'));var licenseUtil=require(_0xaac0('0x16'));var db=require(_0xaac0('0x17'))['db'];function respondWithStatusCode(_0xfd6fcc,_0x434ef4){_0x434ef4=_0x434ef4||0xcc;return function(_0x25fd8e){if(_0x25fd8e){return _0xfd6fcc[_0xaac0('0x18')](_0x434ef4);}return _0xfd6fcc[_0xaac0('0x19')](_0x434ef4)['end']();};}function respondWithResult(_0x4297a6,_0x3f7c14){_0x3f7c14=_0x3f7c14||0xc8;return function(_0x215979){if(_0x215979){return _0x4297a6[_0xaac0('0x19')](_0x3f7c14)[_0xaac0('0x1a')](_0x215979);}};}function respondWithFilteredResult(_0x47a415,_0x8d768c){return function(_0x1c7943){if(_0x1c7943){var _0x3635de=typeof _0x8d768c['offset']==='undefined'&&typeof _0x8d768c[_0xaac0('0x1b')]===_0xaac0('0x1c');var _0x27e02c=_0x1c7943['count'];var _0x12e5df=_0x3635de?0x0:_0x8d768c[_0xaac0('0x1d')];var _0x38ab97=_0x3635de?_0x1c7943[_0xaac0('0x1e')]:_0x8d768c[_0xaac0('0x1d')]+_0x8d768c[_0xaac0('0x1b')];var _0x307e88;if(_0x38ab97>=_0x27e02c){_0x38ab97=_0x27e02c;_0x307e88=0xc8;}else{_0x307e88=0xce;}_0x47a415['status'](_0x307e88);return _0x47a415[_0xaac0('0x1f')](_0xaac0('0x20'),_0x12e5df+'-'+_0x38ab97+'/'+_0x27e02c)[_0xaac0('0x1a')](_0x1c7943);}return null;};}function patchUpdates(_0x44e37e){return function(_0x560fac){try{jsonpatch[_0xaac0('0x21')](_0x560fac,_0x44e37e,!![]);}catch(_0xfaec64){return BPromise[_0xaac0('0x22')](_0xfaec64);}return _0x560fac[_0xaac0('0x23')]();};}function saveUpdates(_0x5a0ea1,_0x571771){return function(_0x27ef81){if(_0x27ef81){return _0x27ef81['update'](_0x5a0ea1)['then'](function(_0x3092d6){return _0x3092d6;});}return null;};}function removeEntity(_0x328e6f,_0x5e0d4f){return function(_0x10881a){if(_0x10881a){return _0x10881a[_0xaac0('0x24')]()[_0xaac0('0x25')](function(){var _0x309189=_0x10881a[_0xaac0('0x26')]({'plain':!![]});var _0x3adcef='Sounds';return db['UserProfileResource'][_0xaac0('0x24')]({'where':{'type':_0x3adcef,'resourceId':_0x309189['id']}})['then'](function(){return _0x10881a;});})['then'](function(){_0x328e6f[_0xaac0('0x19')](0xcc)[_0xaac0('0x27')]();});}};}function handleEntityNotFound(_0x42a8c2,_0x470ccb){return function(_0x3a9073){if(!_0x3a9073){_0x42a8c2[_0xaac0('0x18')](0x194);}return _0x3a9073;};}function handleError(_0x1d4784,_0x46a65b){_0x46a65b=_0x46a65b||0x1f4;return function(_0x2d4a75){logger[_0xaac0('0x28')](_0x2d4a75['stack']);if(_0x2d4a75['name']){delete _0x2d4a75['name'];}_0x1d4784[_0xaac0('0x19')](_0x46a65b)[_0xaac0('0x29')](_0x2d4a75);};}exports[_0xaac0('0x2a')]=function(_0x47b73a,_0x4fca60){var _0x9e952a={},_0x566d1d={},_0x2390f5={'count':0x0,'rows':[]};var _0x3a1cc5=_[_0xaac0('0x2b')](db[_0xaac0('0x2c')][_0xaac0('0x2d')],function(_0x51eb00){return{'name':_0x51eb00[_0xaac0('0x2e')],'type':_0x51eb00['type'][_0xaac0('0x2f')]};});_0x566d1d[_0xaac0('0x30')]=_[_0xaac0('0x2b')](_0x3a1cc5,_0xaac0('0x31'));_0x566d1d[_0xaac0('0x32')]=_[_0xaac0('0x33')](_0x47b73a[_0xaac0('0x32')]);_0x566d1d['filters']=_[_0xaac0('0x34')](_0x566d1d['model'],_0x566d1d[_0xaac0('0x32')]);_0x9e952a[_0xaac0('0x35')]=_['intersection'](_0x566d1d[_0xaac0('0x30')],qs['fields'](_0x47b73a['query'][_0xaac0('0x36')]));_0x9e952a['attributes']=_0x9e952a[_0xaac0('0x35')][_0xaac0('0x37')]?_0x9e952a[_0xaac0('0x35')]:_0x566d1d['model'];if(!_0x47b73a[_0xaac0('0x32')][_0xaac0('0x38')](_0xaac0('0x39'))){_0x9e952a[_0xaac0('0x1b')]=qs['limit'](_0x47b73a['query'][_0xaac0('0x1b')]);_0x9e952a[_0xaac0('0x1d')]=qs['offset'](_0x47b73a[_0xaac0('0x32')]['offset']);}_0x9e952a[_0xaac0('0x3a')]=qs['sort'](_0x47b73a['query'][_0xaac0('0x3b')]);_0x9e952a[_0xaac0('0x3c')]=qs[_0xaac0('0x3d')](_[_0xaac0('0x3e')](_0x47b73a[_0xaac0('0x32')],_0x566d1d['filters']),_0x3a1cc5);if(_0x47b73a['query'][_0xaac0('0x3f')]){_0x9e952a[_0xaac0('0x3c')]=_[_0xaac0('0x40')](_0x9e952a[_0xaac0('0x3c')],{'$or':_[_0xaac0('0x2b')](_0x3a1cc5,function(_0x1d71ee){if(_0x1d71ee[_0xaac0('0x41')]!=='VIRTUAL'){var _0x2af6e9={};_0x2af6e9[_0x1d71ee[_0xaac0('0x31')]]={'$like':'%'+_0x47b73a['query'][_0xaac0('0x3f')]+'%'};return _0x2af6e9;}})});}_0x9e952a=_[_0xaac0('0x40')]({},_0x9e952a,_0x47b73a['options']);var _0x5c73b0={'where':_0x9e952a[_0xaac0('0x3c')]};return db[_0xaac0('0x2c')][_0xaac0('0x1e')](_0x5c73b0)[_0xaac0('0x25')](function(_0x57e92b){_0x2390f5[_0xaac0('0x1e')]=_0x57e92b;if(_0x47b73a[_0xaac0('0x32')][_0xaac0('0x42')]){_0x9e952a[_0xaac0('0x43')]=[{'all':!![]}];}return db[_0xaac0('0x2c')][_0xaac0('0x44')](_0x9e952a);})['then'](function(_0x20096f){_0x2390f5['rows']=_0x20096f;return _0x2390f5;})[_0xaac0('0x25')](respondWithFilteredResult(_0x4fca60,_0x9e952a))[_0xaac0('0x45')](handleError(_0x4fca60,null));};exports[_0xaac0('0x46')]=function(_0x453bc6,_0x42c898){var _0x25b303={'raw':!![],'where':{'id':_0x453bc6['params']['id']}},_0x10e815={};_0x10e815[_0xaac0('0x30')]=_[_0xaac0('0x33')](db['Sound'][_0xaac0('0x2d')]);_0x10e815[_0xaac0('0x32')]=_['keys'](_0x453bc6['query']);_0x10e815['filters']=_['intersection'](_0x10e815[_0xaac0('0x30')],_0x10e815[_0xaac0('0x32')]);_0x25b303[_0xaac0('0x35')]=_[_0xaac0('0x34')](_0x10e815[_0xaac0('0x30')],qs[_0xaac0('0x36')](_0x453bc6[_0xaac0('0x32')][_0xaac0('0x36')]));_0x25b303['attributes']=_0x25b303[_0xaac0('0x35')]['length']?_0x25b303[_0xaac0('0x35')]:_0x10e815[_0xaac0('0x30')];if(_0x453bc6[_0xaac0('0x32')][_0xaac0('0x42')]){_0x25b303[_0xaac0('0x43')]=[{'all':!![]}];}_0x25b303=_['merge']({},_0x25b303,_0x453bc6['options']);return db[_0xaac0('0x2c')][_0xaac0('0x47')](_0x25b303)[_0xaac0('0x25')](handleEntityNotFound(_0x42c898,null))[_0xaac0('0x25')](respondWithResult(_0x42c898,null))[_0xaac0('0x45')](handleError(_0x42c898,null));};exports[_0xaac0('0x48')]=function(_0x24e383,_0x48e02d,_0x10b82f){return db['Sound'][_0xaac0('0x47')]({'where':{'id':_0x24e383['params']['id']},'attributes':['name','save_name',_0xaac0('0x49')],'raw':!![]})[_0xaac0('0x25')](handleEntityNotFound(_0x48e02d,null))[_0xaac0('0x25')](function(_0xc1b682){if(_0xc1b682){if(!fs['existsSync'](path[_0xaac0('0x4a')](config[_0xaac0('0x4b')],_0xaac0('0x4c'),_0xc1b682[_0xaac0('0x4d')]+'.'+_0xc1b682[_0xaac0('0x49')]))){throw new db[(_0xaac0('0x4e'))][(_0xaac0('0x4f'))](_0xaac0('0x50'));}return _0x48e02d[_0xaac0('0x48')](path[_0xaac0('0x4a')](config[_0xaac0('0x4b')],'server/files/sounds/converted',util['format']('%s.%s',_0xc1b682[_0xaac0('0x4d')],_0xc1b682['converted_format'])),util[_0xaac0('0x51')](_0xaac0('0x52'),_0xc1b682[_0xaac0('0x31')],_0xc1b682['converted_format']));}return null;})[_0xaac0('0x45')](handleError(_0x48e02d,null));};exports[_0xaac0('0x53')]=function(_0x193ad7,_0x24ac2c,_0x4b0a2e){var _0x2f2b40={'name':path[_0xaac0('0x54')](_0x193ad7['file']['originalname'],path['extname'](_0x193ad7[_0xaac0('0x55')][_0xaac0('0x56')])),'save_name':path[_0xaac0('0x54')](_0x193ad7[_0xaac0('0x55')][_0xaac0('0x57')],path['extname'](_0x193ad7[_0xaac0('0x55')]['filename'])),'original_format':path[_0xaac0('0x58')](_0x193ad7[_0xaac0('0x55')][_0xaac0('0x56')])[_0xaac0('0x59')](0x1),'converted_format':'wav'};var _0x1fc257=path[_0xaac0('0x4a')](config[_0xaac0('0x4b')],_0xaac0('0x5a'),_0x193ad7[_0xaac0('0x55')][_0xaac0('0x57')]);var _0x4b6ea8=path[_0xaac0('0x4a')](config[_0xaac0('0x4b')],_0xaac0('0x4c'),util['format'](_0xaac0('0x52'),path[_0xaac0('0x54')](_0x193ad7['file'][_0xaac0('0x57')],path[_0xaac0('0x58')](_0x193ad7[_0xaac0('0x55')][_0xaac0('0x57')])),_0x2f2b40['converted_format']));logger[_0xaac0('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x1fc257);logger[_0xaac0('0x5b')]('Sound\x20upload\x20destination:\x20%s',_0x4b6ea8);try{fs[_0xaac0('0x5c')](_0x1fc257,parseInt(_0xaac0('0x5d'),0x8));var _0x29dad4=sox[_0xaac0('0x5e')](_0x1fc257,_0x4b6ea8,{'sampleRate':0x1f40,'format':_0xaac0('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x29dad4['on'](_0xaac0('0x28'),function(_0x13c611){fs[_0xaac0('0x60')](_0x1fc257);_0x24ac2c[_0xaac0('0x19')](0x1f4)[_0xaac0('0x29')](_0x13c611);});_0x29dad4['on'](_0xaac0('0x61'),function(_0x107473){_0x2f2b40[_0xaac0('0x62')]=isNaN(_0x107473[_0xaac0('0x63')])?null:_0x107473[_0xaac0('0x63')]*0x3e8;_0x2f2b40[_0xaac0('0x64')]=isNaN(_0x107473[_0xaac0('0x65')])?null:_0x107473['sampleCount'];_0x2f2b40[_0xaac0('0x66')]=isNaN(_0x107473[_0xaac0('0x67')])?null:_0x107473[_0xaac0('0x67')];_0x2f2b40[_0xaac0('0x68')]=isNaN(_0x107473[_0xaac0('0x69')])?null:_0x107473[_0xaac0('0x69')];_0x2f2b40[_0xaac0('0x6a')]=isNaN(_0x107473[_0xaac0('0x6b')])?null:_0x107473['sampleRate'];});_0x29dad4['on'](_0xaac0('0x6c'),function(_0x145a67){_0x2f2b40[_0xaac0('0x6d')]=isNaN(_0x145a67['duration'])?null:_0x145a67[_0xaac0('0x63')]*0x3e8;_0x2f2b40[_0xaac0('0x6e')]=isNaN(_0x145a67[_0xaac0('0x65')])?null:_0x145a67[_0xaac0('0x65')];_0x2f2b40[_0xaac0('0x6f')]=isNaN(_0x145a67[_0xaac0('0x67')])?null:_0x145a67[_0xaac0('0x67')];_0x2f2b40[_0xaac0('0x70')]=isNaN(_0x145a67[_0xaac0('0x69')])?null:_0x145a67[_0xaac0('0x69')];_0x2f2b40[_0xaac0('0x71')]=isNaN(_0x145a67[_0xaac0('0x6b')])?null:_0x145a67[_0xaac0('0x6b')];});_0x29dad4['on'](_0xaac0('0x27'),function(){fs['chmodSync'](_0x4b6ea8,parseInt(_0xaac0('0x5d'),0x8));return db['Sound'][_0xaac0('0x53')](_0x2f2b40)[_0xaac0('0x25')](function(_0x66572d){var _0x7946d3={'role':_0x193ad7[_0xaac0('0x72')][_0xaac0('0x73')],'userProfileId':_0x193ad7[_0xaac0('0x72')]['userProfileId']};if(!_0x7946d3)throw new Error(_0xaac0('0x74'));if(_0x7946d3['role']===_0xaac0('0x75')){var _0x1781bb=_0x66572d[_0xaac0('0x26')]({'plain':!![]});return db['UserProfileSection'][_0xaac0('0x47')]({'where':{'name':'Sounds','userProfileId':_0x7946d3['userProfileId']},'raw':!![]})[_0xaac0('0x25')](function(_0x451edd){if(_0x451edd&&_0x451edd[_0xaac0('0x76')]===0x0){return db['UserProfileResource'][_0xaac0('0x53')]({'name':_0x1781bb[_0xaac0('0x31')],'resourceId':_0x1781bb['id'],'type':_0x451edd[_0xaac0('0x31')],'sectionId':_0x451edd['id']},{})[_0xaac0('0x25')](function(){return _0x66572d;});}else{return _0x66572d;}})[_0xaac0('0x45')](function(_0x278755){logger[_0xaac0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x278755);throw _0x278755;});}return _0x66572d;})[_0xaac0('0x25')](respondWithResult(_0x24ac2c,null))[_0xaac0('0x45')](handleError(_0x24ac2c,null));});_0x29dad4['start']();}catch(_0x37a9bc){_0x24ac2c[_0xaac0('0x19')](0x1f4)[_0xaac0('0x29')](_0x37a9bc);}};exports[_0xaac0('0x77')]=function(_0x278692,_0x315183,_0x4490a2){return db['Sound'][_0xaac0('0x47')]({'where':{'id':_0x278692[_0xaac0('0x78')]['id']}})[_0xaac0('0x25')](handleEntityNotFound(_0x315183,null))[_0xaac0('0x25')](saveUpdates(_[_0xaac0('0x3e')](_0x278692[_0xaac0('0x72')],[_0xaac0('0x31'),_0xaac0('0x79')]),null))[_0xaac0('0x25')](respondWithResult(_0x315183,null))[_0xaac0('0x45')](handleError(_0x315183,null));};exports['delete']=function(_0x23739d,_0x535e12,_0xb3de85){return db[_0xaac0('0x2c')][_0xaac0('0x47')]({'where':{'id':_0x23739d['params']['id']}})[_0xaac0('0x25')](function(_0x292b62){if(_0x292b62){return _0x292b62['destroy']();}})['then'](function(_0x436826){var _0x523fee=path[_0xaac0('0x4a')](config[_0xaac0('0x4b')],_0xaac0('0x5a'),util['format'](_0xaac0('0x52'),_0x436826['save_name'],_0x436826[_0xaac0('0x7a')]));var _0x20e0a1=path[_0xaac0('0x4a')](config['root'],_0xaac0('0x4c'),util[_0xaac0('0x51')](_0xaac0('0x52'),_0x436826[_0xaac0('0x4d')],_0x436826['converted_format']));fs[_0xaac0('0x60')](_0x523fee);fs[_0xaac0('0x60')](_0x20e0a1);return _0x436826;})[_0xaac0('0x25')](function(_0x8c7149){if(_0x8c7149){return _0x535e12[_0xaac0('0x19')](0xcc)[_0xaac0('0x27')]();}})[_0xaac0('0x25')](handleEntityNotFound(_0x535e12,null))[_0xaac0('0x45')](handleError(_0x535e12,null));}; \ No newline at end of file +var _0xe405=['options','includeAll','include','findAll','show','keys','intersection','find','catch','download','params','save_name','converted_format','existsSync','join','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','root','format','create','basename','file','originalname','extname','filename','wav','server/files/sounds/original','%s.%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','send','description','original_format','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Sounds','destroy','error','name','map','Sound','key','query','filters','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0xb071a1,_0xcea5c6){var _0xa18af8=function(_0x24e7d8){while(--_0x24e7d8){_0xb071a1['push'](_0xb071a1['shift']());}};_0xa18af8(++_0xcea5c6);}(_0xe405,0x1aa));var _0x5e40=function(_0x1477d9,_0x3d7991){_0x1477d9=_0x1477d9-0x0;var _0x75a750=_0xe405[_0x1477d9];return _0x75a750;};'use strict';var emlformat=require(_0x5e40('0x0'));var rimraf=require(_0x5e40('0x1'));var zipdir=require(_0x5e40('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5e40('0x3'));var moment=require(_0x5e40('0x4'));var BPromise=require(_0x5e40('0x5'));var Mustache=require(_0x5e40('0x6'));var util=require('util');var path=require(_0x5e40('0x7'));var sox=require(_0x5e40('0x8'));var csv=require(_0x5e40('0x9'));var ejs=require(_0x5e40('0xa'));var fs=require('fs');var fs_extra=require(_0x5e40('0xb'));var _=require('lodash');var squel=require(_0x5e40('0xc'));var crypto=require('crypto');var jsforce=require(_0x5e40('0xd'));var deskjs=require(_0x5e40('0xe'));var toCsv=require(_0x5e40('0x9'));var querystring=require(_0x5e40('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5e40('0x10'));var qs=require(_0x5e40('0x11'));var as=require(_0x5e40('0x12'));var hardwareService=require(_0x5e40('0x13'));var logger=require(_0x5e40('0x14'))(_0x5e40('0x15'));var utils=require(_0x5e40('0x16'));var config=require(_0x5e40('0x17'));var licenseUtil=require(_0x5e40('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c5843,_0x119b1d){_0x119b1d=_0x119b1d||0xcc;return function(_0xaf6ea7){if(_0xaf6ea7){return _0x4c5843[_0x5e40('0x19')](_0x119b1d);}return _0x4c5843[_0x5e40('0x1a')](_0x119b1d)[_0x5e40('0x1b')]();};}function respondWithResult(_0x345324,_0x469806){_0x469806=_0x469806||0xc8;return function(_0x5ce33e){if(_0x5ce33e){return _0x345324[_0x5e40('0x1a')](_0x469806)[_0x5e40('0x1c')](_0x5ce33e);}};}function respondWithFilteredResult(_0x373c5a,_0x6ef303){return function(_0x16586e){if(_0x16586e){var _0x5b3525=typeof _0x6ef303[_0x5e40('0x1d')]===_0x5e40('0x1e')&&typeof _0x6ef303[_0x5e40('0x1f')]===_0x5e40('0x1e');var _0x43cd21=_0x16586e[_0x5e40('0x20')];var _0x4e00d0=_0x5b3525?0x0:_0x6ef303['offset'];var _0x7a72b0=_0x5b3525?_0x16586e[_0x5e40('0x20')]:_0x6ef303['offset']+_0x6ef303[_0x5e40('0x1f')];var _0x4d6e4c;if(_0x7a72b0>=_0x43cd21){_0x7a72b0=_0x43cd21;_0x4d6e4c=0xc8;}else{_0x4d6e4c=0xce;}_0x373c5a[_0x5e40('0x1a')](_0x4d6e4c);return _0x373c5a[_0x5e40('0x21')](_0x5e40('0x22'),_0x4e00d0+'-'+_0x7a72b0+'/'+_0x43cd21)[_0x5e40('0x1c')](_0x16586e);}return null;};}function patchUpdates(_0x55452b){return function(_0x335824){try{jsonpatch[_0x5e40('0x23')](_0x335824,_0x55452b,!![]);}catch(_0x58dcd9){return BPromise[_0x5e40('0x24')](_0x58dcd9);}return _0x335824['save']();};}function saveUpdates(_0x32c39a,_0x3993){return function(_0x45d401){if(_0x45d401){return _0x45d401[_0x5e40('0x25')](_0x32c39a)[_0x5e40('0x26')](function(_0x20fcf9){return _0x20fcf9;});}return null;};}function removeEntity(_0x3b12da,_0x1971d1){return function(_0x488fe1){if(_0x488fe1){return _0x488fe1['destroy']()[_0x5e40('0x26')](function(){var _0x5c0fd1=_0x488fe1[_0x5e40('0x27')]({'plain':!![]});var _0x2dd586=_0x5e40('0x28');return db['UserProfileResource'][_0x5e40('0x29')]({'where':{'type':_0x2dd586,'resourceId':_0x5c0fd1['id']}})['then'](function(){return _0x488fe1;});})['then'](function(){_0x3b12da[_0x5e40('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12136d,_0x24aa07){return function(_0x4868b8){if(!_0x4868b8){_0x12136d[_0x5e40('0x19')](0x194);}return _0x4868b8;};}function handleError(_0x5a5c43,_0x2c0dab){_0x2c0dab=_0x2c0dab||0x1f4;return function(_0x92e65d){logger[_0x5e40('0x2a')](_0x92e65d['stack']);if(_0x92e65d[_0x5e40('0x2b')]){delete _0x92e65d['name'];}_0x5a5c43[_0x5e40('0x1a')](_0x2c0dab)['send'](_0x92e65d);};}exports['index']=function(_0x1c681e,_0x37027a){var _0xd92978={},_0x88f7f0={},_0x2f3f40={'count':0x0,'rows':[]};var _0x20ae61=_[_0x5e40('0x2c')](db[_0x5e40('0x2d')]['rawAttributes'],function(_0x7e4e01){return{'name':_0x7e4e01['fieldName'],'type':_0x7e4e01['type'][_0x5e40('0x2e')]};});_0x88f7f0['model']=_[_0x5e40('0x2c')](_0x20ae61,'name');_0x88f7f0[_0x5e40('0x2f')]=_['keys'](_0x1c681e[_0x5e40('0x2f')]);_0x88f7f0[_0x5e40('0x30')]=_['intersection'](_0x88f7f0[_0x5e40('0x31')],_0x88f7f0[_0x5e40('0x2f')]);_0xd92978['attributes']=_['intersection'](_0x88f7f0[_0x5e40('0x31')],qs[_0x5e40('0x32')](_0x1c681e['query'][_0x5e40('0x32')]));_0xd92978['attributes']=_0xd92978[_0x5e40('0x33')][_0x5e40('0x34')]?_0xd92978[_0x5e40('0x33')]:_0x88f7f0['model'];if(!_0x1c681e[_0x5e40('0x2f')]['hasOwnProperty'](_0x5e40('0x35'))){_0xd92978[_0x5e40('0x1f')]=qs['limit'](_0x1c681e[_0x5e40('0x2f')][_0x5e40('0x1f')]);_0xd92978['offset']=qs[_0x5e40('0x1d')](_0x1c681e[_0x5e40('0x2f')][_0x5e40('0x1d')]);}_0xd92978[_0x5e40('0x36')]=qs[_0x5e40('0x37')](_0x1c681e[_0x5e40('0x2f')][_0x5e40('0x37')]);_0xd92978[_0x5e40('0x38')]=qs[_0x5e40('0x30')](_[_0x5e40('0x39')](_0x1c681e['query'],_0x88f7f0[_0x5e40('0x30')]),_0x20ae61);if(_0x1c681e['query'][_0x5e40('0x3a')]){_0xd92978[_0x5e40('0x38')]=_[_0x5e40('0x3b')](_0xd92978[_0x5e40('0x38')],{'$or':_['map'](_0x20ae61,function(_0x1198f7){if(_0x1198f7[_0x5e40('0x3c')]!==_0x5e40('0x3d')){var _0x16a5b9={};_0x16a5b9[_0x1198f7[_0x5e40('0x2b')]]={'$like':'%'+_0x1c681e[_0x5e40('0x2f')]['filter']+'%'};return _0x16a5b9;}})});}_0xd92978=_['merge']({},_0xd92978,_0x1c681e[_0x5e40('0x3e')]);var _0x79ecca={'where':_0xd92978[_0x5e40('0x38')]};return db[_0x5e40('0x2d')][_0x5e40('0x20')](_0x79ecca)[_0x5e40('0x26')](function(_0x237ad2){_0x2f3f40[_0x5e40('0x20')]=_0x237ad2;if(_0x1c681e['query'][_0x5e40('0x3f')]){_0xd92978[_0x5e40('0x40')]=[{'all':!![]}];}return db[_0x5e40('0x2d')][_0x5e40('0x41')](_0xd92978);})[_0x5e40('0x26')](function(_0x5125ed){_0x2f3f40['rows']=_0x5125ed;return _0x2f3f40;})[_0x5e40('0x26')](respondWithFilteredResult(_0x37027a,_0xd92978))['catch'](handleError(_0x37027a,null));};exports[_0x5e40('0x42')]=function(_0x2a2729,_0x1e1670){var _0x47f4a2={'raw':!![],'where':{'id':_0x2a2729['params']['id']}},_0x5098e6={};_0x5098e6[_0x5e40('0x31')]=_['keys'](db['Sound']['rawAttributes']);_0x5098e6[_0x5e40('0x2f')]=_[_0x5e40('0x43')](_0x2a2729[_0x5e40('0x2f')]);_0x5098e6['filters']=_['intersection'](_0x5098e6[_0x5e40('0x31')],_0x5098e6[_0x5e40('0x2f')]);_0x47f4a2[_0x5e40('0x33')]=_[_0x5e40('0x44')](_0x5098e6[_0x5e40('0x31')],qs[_0x5e40('0x32')](_0x2a2729[_0x5e40('0x2f')][_0x5e40('0x32')]));_0x47f4a2[_0x5e40('0x33')]=_0x47f4a2[_0x5e40('0x33')][_0x5e40('0x34')]?_0x47f4a2[_0x5e40('0x33')]:_0x5098e6[_0x5e40('0x31')];if(_0x2a2729['query'][_0x5e40('0x3f')]){_0x47f4a2[_0x5e40('0x40')]=[{'all':!![]}];}_0x47f4a2=_[_0x5e40('0x3b')]({},_0x47f4a2,_0x2a2729[_0x5e40('0x3e')]);return db[_0x5e40('0x2d')][_0x5e40('0x45')](_0x47f4a2)[_0x5e40('0x26')](handleEntityNotFound(_0x1e1670,null))[_0x5e40('0x26')](respondWithResult(_0x1e1670,null))[_0x5e40('0x46')](handleError(_0x1e1670,null));};exports[_0x5e40('0x47')]=function(_0xe9b2fa,_0x3de680,_0x5abb03){return db[_0x5e40('0x2d')][_0x5e40('0x45')]({'where':{'id':_0xe9b2fa[_0x5e40('0x48')]['id']},'attributes':['name',_0x5e40('0x49'),_0x5e40('0x4a')],'raw':!![]})[_0x5e40('0x26')](handleEntityNotFound(_0x3de680,null))[_0x5e40('0x26')](function(_0x5ad3cb){if(_0x5ad3cb){if(!fs[_0x5e40('0x4b')](path[_0x5e40('0x4c')](config['root'],_0x5e40('0x4d'),_0x5ad3cb[_0x5e40('0x49')]+'.'+_0x5ad3cb['converted_format']))){throw new db['Sequelize'][(_0x5e40('0x4e'))](_0x5e40('0x4f'));}return _0x3de680[_0x5e40('0x47')](path[_0x5e40('0x4c')](config[_0x5e40('0x50')],_0x5e40('0x4d'),util[_0x5e40('0x51')]('%s.%s',_0x5ad3cb['save_name'],_0x5ad3cb['converted_format'])),util[_0x5e40('0x51')]('%s.%s',_0x5ad3cb[_0x5e40('0x2b')],_0x5ad3cb[_0x5e40('0x4a')]));}return null;})[_0x5e40('0x46')](handleError(_0x3de680,null));};exports[_0x5e40('0x52')]=function(_0xf6d526,_0x289d92,_0x48476b){var _0x4cfd60={'name':path[_0x5e40('0x53')](_0xf6d526[_0x5e40('0x54')][_0x5e40('0x55')],path[_0x5e40('0x56')](_0xf6d526['file'][_0x5e40('0x55')])),'save_name':path[_0x5e40('0x53')](_0xf6d526[_0x5e40('0x54')][_0x5e40('0x57')],path[_0x5e40('0x56')](_0xf6d526['file'][_0x5e40('0x57')])),'original_format':path[_0x5e40('0x56')](_0xf6d526[_0x5e40('0x54')][_0x5e40('0x55')])['substring'](0x1),'converted_format':_0x5e40('0x58')};var _0x3cde6e=path[_0x5e40('0x4c')](config['root'],_0x5e40('0x59'),_0xf6d526['file'][_0x5e40('0x57')]);var _0x24bbc9=path['join'](config[_0x5e40('0x50')],'server/files/sounds/converted',util[_0x5e40('0x51')](_0x5e40('0x5a'),path[_0x5e40('0x53')](_0xf6d526[_0x5e40('0x54')]['filename'],path[_0x5e40('0x56')](_0xf6d526[_0x5e40('0x54')][_0x5e40('0x57')])),_0x4cfd60[_0x5e40('0x4a')]));logger[_0x5e40('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x3cde6e);logger[_0x5e40('0x5b')](_0x5e40('0x5c'),_0x24bbc9);try{fs[_0x5e40('0x5d')](_0x3cde6e,parseInt(_0x5e40('0x5e'),0x8));var _0x200027=sox[_0x5e40('0x5f')](_0x3cde6e,_0x24bbc9,{'sampleRate':0x1f40,'format':_0x5e40('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x200027['on']('error',function(_0x3ce958){fs[_0x5e40('0x60')](_0x3cde6e);_0x289d92['status'](0x1f4)['send'](_0x3ce958);});_0x200027['on']('src',function(_0x5f4e73){_0x4cfd60[_0x5e40('0x61')]=isNaN(_0x5f4e73['duration'])?null:_0x5f4e73[_0x5e40('0x62')]*0x3e8;_0x4cfd60[_0x5e40('0x63')]=isNaN(_0x5f4e73[_0x5e40('0x64')])?null:_0x5f4e73[_0x5e40('0x64')];_0x4cfd60[_0x5e40('0x65')]=isNaN(_0x5f4e73[_0x5e40('0x66')])?null:_0x5f4e73[_0x5e40('0x66')];_0x4cfd60['original_bitRate']=isNaN(_0x5f4e73[_0x5e40('0x67')])?null:_0x5f4e73[_0x5e40('0x67')];_0x4cfd60[_0x5e40('0x68')]=isNaN(_0x5f4e73['sampleRate'])?null:_0x5f4e73[_0x5e40('0x69')];});_0x200027['on']('dest',function(_0x4acc9d){_0x4cfd60['converted_duration']=isNaN(_0x4acc9d['duration'])?null:_0x4acc9d[_0x5e40('0x62')]*0x3e8;_0x4cfd60[_0x5e40('0x6a')]=isNaN(_0x4acc9d[_0x5e40('0x64')])?null:_0x4acc9d['sampleCount'];_0x4cfd60[_0x5e40('0x6b')]=isNaN(_0x4acc9d[_0x5e40('0x66')])?null:_0x4acc9d['channelCount'];_0x4cfd60[_0x5e40('0x6c')]=isNaN(_0x4acc9d[_0x5e40('0x67')])?null:_0x4acc9d['bitRate'];_0x4cfd60[_0x5e40('0x6d')]=isNaN(_0x4acc9d[_0x5e40('0x69')])?null:_0x4acc9d[_0x5e40('0x69')];});_0x200027['on']('end',function(){fs[_0x5e40('0x5d')](_0x24bbc9,parseInt(_0x5e40('0x5e'),0x8));return db[_0x5e40('0x2d')][_0x5e40('0x52')](_0x4cfd60)[_0x5e40('0x26')](function(_0x13b521){var _0x1953a8={'role':_0xf6d526['body'][_0x5e40('0x6e')],'userProfileId':_0xf6d526[_0x5e40('0x6f')][_0x5e40('0x70')]};if(!_0x1953a8)throw new Error(_0x5e40('0x71'));if(_0x1953a8['role']===_0x5e40('0x72')){var _0x61d062=_0x13b521[_0x5e40('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x5e40('0x45')]({'where':{'name':'Sounds','userProfileId':_0x1953a8[_0x5e40('0x70')]},'raw':!![]})[_0x5e40('0x26')](function(_0xdf8eda){if(_0xdf8eda&&_0xdf8eda[_0x5e40('0x73')]===0x0){return db[_0x5e40('0x74')][_0x5e40('0x52')]({'name':_0x61d062[_0x5e40('0x2b')],'resourceId':_0x61d062['id'],'type':_0xdf8eda[_0x5e40('0x2b')],'sectionId':_0xdf8eda['id']},{})[_0x5e40('0x26')](function(){return _0x13b521;});}else{return _0x13b521;}})[_0x5e40('0x46')](function(_0x3acd03){logger['error'](_0x5e40('0x75'),_0x3acd03);throw _0x3acd03;});}return _0x13b521;})['then'](respondWithResult(_0x289d92,null))[_0x5e40('0x46')](handleError(_0x289d92,null));});_0x200027[_0x5e40('0x76')]();}catch(_0x192eaa){_0x289d92[_0x5e40('0x1a')](0x1f4)[_0x5e40('0x77')](_0x192eaa);}};exports['update']=function(_0x58bfae,_0x1d8b71,_0xb73220){return db[_0x5e40('0x2d')][_0x5e40('0x45')]({'where':{'id':_0x58bfae['params']['id']}})[_0x5e40('0x26')](handleEntityNotFound(_0x1d8b71,null))['then'](saveUpdates(_[_0x5e40('0x39')](_0x58bfae[_0x5e40('0x6f')],[_0x5e40('0x2b'),_0x5e40('0x78')]),null))[_0x5e40('0x26')](respondWithResult(_0x1d8b71,null))[_0x5e40('0x46')](handleError(_0x1d8b71,null));};exports['delete']=function(_0x46f41b,_0x37e486,_0x2a0bdc){return db['Sound'][_0x5e40('0x45')]({'where':{'id':_0x46f41b[_0x5e40('0x48')]['id']}})[_0x5e40('0x26')](function(_0x3a5b17){if(_0x3a5b17){return _0x3a5b17[_0x5e40('0x29')]();}})['then'](function(_0xb13d5d){var _0x3e8b1f=path[_0x5e40('0x4c')](config['root'],'server/files/sounds/original',util[_0x5e40('0x51')](_0x5e40('0x5a'),_0xb13d5d[_0x5e40('0x49')],_0xb13d5d[_0x5e40('0x79')]));var _0x4b9e40=path['join'](config[_0x5e40('0x50')],_0x5e40('0x4d'),util['format']('%s.%s',_0xb13d5d[_0x5e40('0x49')],_0xb13d5d[_0x5e40('0x4a')]));fs[_0x5e40('0x60')](_0x3e8b1f);fs[_0x5e40('0x60')](_0x4b9e40);return _0xb13d5d;})[_0x5e40('0x26')](function(_0x29d775){if(_0x29d775){return _0x37e486[_0x5e40('0x1a')](0xcc)[_0x5e40('0x1b')]();}})[_0x5e40('0x26')](handleEntityNotFound(_0x37e486,null))[_0x5e40('0x46')](handleError(_0x37e486,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index ca86831..98bb1aa 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 _0x609f=['rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','moment','bluebird','path'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x609f,0x13f));var _0xf609=function(_0x523196,_0x1d6d0a){_0x523196=_0x523196-0x0;var _0x3c75a1=_0x609f[_0x523196];return _0x3c75a1;};'use strict';var _=require(_0xf609('0x0'));var util=require('util');var logger=require(_0xf609('0x1'))('api');var moment=require(_0xf609('0x2'));var BPromise=require(_0xf609('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf609('0x4'));var rimraf=require(_0xf609('0x5'));var config=require(_0xf609('0x6'));var attributes=require(_0xf609('0x7'));module[_0xf609('0x8')]=function(_0x239206,_0x19c152){return _0x239206[_0xf609('0x9')](_0xf609('0xa'),attributes,{'tableName':_0xf609('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ef4=['rimraf','./sound.attributes','exports','define','../../config/logger','api','path'];(function(_0x5f49ea,_0x6dcb62){var _0x18edf3=function(_0x46266e){while(--_0x46266e){_0x5f49ea['push'](_0x5f49ea['shift']());}};_0x18edf3(++_0x6dcb62);}(_0x1ef4,0xc1));var _0x41ef=function(_0x590013,_0x15df1e){_0x590013=_0x590013-0x0;var _0x497b78=_0x1ef4[_0x590013];return _0x497b78;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x41ef('0x0'))(_0x41ef('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41ef('0x2'));var rimraf=require(_0x41ef('0x3'));var config=require('../../config/environment');var attributes=require(_0x41ef('0x4'));module[_0x41ef('0x5')]=function(_0x46a72,_0x4a4e48){return _0x46a72[_0x41ef('0x6')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index dc5c064..8e52f07 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 _0x7a84=['rpc','jayson/promise','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x495374,_0x2f7e8e){var _0x6dd711=function(_0x188f9d){while(--_0x188f9d){_0x495374['push'](_0x495374['shift']());}};_0x6dd711(++_0x2f7e8e);}(_0x7a84,0x184));var _0x47a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a84[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x47a8('0x0'));var util=require(_0x47a8('0x1'));var moment=require(_0x47a8('0x2'));var BPromise=require(_0x47a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47a8('0x4'));var db=require(_0x47a8('0x5'))['db'];var utils=require(_0x47a8('0x6'));var logger=require(_0x47a8('0x7'))(_0x47a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x47a8('0x9'));var client=jayson['client'][_0x47a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x374049,_0x297caa,_0x96b211){return new BPromise(function(_0x6f8030,_0x1e35a4){return client['request'](_0x374049,_0x96b211)[_0x47a8('0xb')](function(_0x29f546){logger[_0x47a8('0xc')](_0x47a8('0xd'),_0x297caa,_0x47a8('0xe'));logger[_0x47a8('0xf')](_0x47a8('0x10'),_0x297caa,_0x47a8('0xe'),JSON[_0x47a8('0x11')](_0x29f546));if(_0x29f546['error']){if(_0x29f546[_0x47a8('0x12')][_0x47a8('0x13')]===0x1f4){logger[_0x47a8('0x12')]('Sound,\x20%s,\x20%s',_0x297caa,_0x29f546['error'][_0x47a8('0x14')]);return _0x1e35a4(_0x29f546[_0x47a8('0x12')]['message']);}logger[_0x47a8('0x12')](_0x47a8('0xd'),_0x297caa,_0x29f546[_0x47a8('0x12')][_0x47a8('0x14')]);return _0x6f8030(_0x29f546['error'][_0x47a8('0x14')]);}else{logger['info'](_0x47a8('0xd'),_0x297caa,_0x47a8('0xe'));_0x6f8030(_0x29f546[_0x47a8('0x15')]['message']);}})[_0x47a8('0x16')](function(_0xcd7a16){logger[_0x47a8('0x12')]('Sound,\x20%s,\x20%s',_0x297caa,_0xcd7a16);_0x1e35a4(_0xcd7a16);});});}exports[_0x47a8('0x17')]=function(_0x64537f){var _0x189646=this;return new Promise(function(_0x5df25b,_0x298415){return db[_0x47a8('0x18')][_0x47a8('0x19')]({'raw':_0x64537f[_0x47a8('0x1a')]?_0x64537f['options'][_0x47a8('0x1b')]===undefined?!![]:![]:!![],'where':_0x64537f[_0x47a8('0x1a')]?_0x64537f[_0x47a8('0x1a')][_0x47a8('0x1c')]||null:null,'attributes':_0x64537f[_0x47a8('0x1a')]?_0x64537f[_0x47a8('0x1a')][_0x47a8('0x1d')]||null:null,'include':_0x64537f['options']?_0x64537f['options'][_0x47a8('0x1e')]?_[_0x47a8('0x1f')](_0x64537f[_0x47a8('0x1a')]['include'],function(_0x16b19e){return{'model':db[_0x16b19e[_0x47a8('0x20')]],'as':_0x16b19e['as'],'attributes':_0x16b19e[_0x47a8('0x1d')],'include':_0x16b19e['include']?_[_0x47a8('0x1f')](_0x16b19e[_0x47a8('0x1e')],function(_0x350690){return{'model':db[_0x350690[_0x47a8('0x20')]],'as':_0x350690['as'],'attributes':_0x350690['attributes'],'include':_0x350690[_0x47a8('0x1e')]?_[_0x47a8('0x1f')](_0x350690[_0x47a8('0x1e')],function(_0x546578){return{'model':db[_0x546578[_0x47a8('0x20')]],'as':_0x546578['as'],'attributes':_0x546578[_0x47a8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x47a8('0xb')](function(_0x446df8){logger[_0x47a8('0xc')]('ShowSound',_0x64537f);logger[_0x47a8('0xf')](_0x47a8('0x17'),_0x64537f,JSON[_0x47a8('0x11')](_0x446df8));_0x5df25b(_0x446df8);})['catch'](function(_0x2c2984){logger[_0x47a8('0x12')](_0x47a8('0x17'),_0x2c2984['message'],_0x64537f);_0x298415(_0x189646[_0x47a8('0x12')](0x1f4,_0x2c2984[_0x47a8('0x14')]));});});}; \ No newline at end of file +var _0x8b66=['info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSound','Sound','find','options','where','attributes','include','model','map','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x514732,_0x363be3){var _0x2a471=function(_0xc942dc){while(--_0xc942dc){_0x514732['push'](_0x514732['shift']());}};_0x2a471(++_0x363be3);}(_0x8b66,0xf3));var _0x68b6=function(_0x24243b,_0x55c567){_0x24243b=_0x24243b-0x0;var _0x1a85ce=_0x8b66[_0x24243b];return _0x1a85ce;};'use strict';var _=require('lodash');var util=require(_0x68b6('0x0'));var moment=require(_0x68b6('0x1'));var BPromise=require(_0x68b6('0x2'));var rs=require(_0x68b6('0x3'));var fs=require('fs');var Redis=require(_0x68b6('0x4'));var db=require(_0x68b6('0x5'))['db'];var utils=require(_0x68b6('0x6'));var logger=require(_0x68b6('0x7'))('rpc');var config=require(_0x68b6('0x8'));var jayson=require(_0x68b6('0x9'));var client=jayson['client'][_0x68b6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45b734,_0x870d6a,_0x3e0f18){return new BPromise(function(_0xd14f30,_0x3fa58c){return client[_0x68b6('0xb')](_0x45b734,_0x3e0f18)[_0x68b6('0xc')](function(_0x2ebb98){logger[_0x68b6('0xd')](_0x68b6('0xe'),_0x870d6a,_0x68b6('0xf'));logger['debug'](_0x68b6('0x10'),_0x870d6a,'request\x20sent',JSON[_0x68b6('0x11')](_0x2ebb98));if(_0x2ebb98[_0x68b6('0x12')]){if(_0x2ebb98[_0x68b6('0x12')][_0x68b6('0x13')]===0x1f4){logger[_0x68b6('0x12')](_0x68b6('0xe'),_0x870d6a,_0x2ebb98[_0x68b6('0x12')][_0x68b6('0x14')]);return _0x3fa58c(_0x2ebb98['error'][_0x68b6('0x14')]);}logger[_0x68b6('0x12')](_0x68b6('0xe'),_0x870d6a,_0x2ebb98[_0x68b6('0x12')][_0x68b6('0x14')]);return _0xd14f30(_0x2ebb98['error'][_0x68b6('0x14')]);}else{logger[_0x68b6('0xd')]('Sound,\x20%s,\x20%s',_0x870d6a,_0x68b6('0xf'));_0xd14f30(_0x2ebb98['result'][_0x68b6('0x14')]);}})[_0x68b6('0x15')](function(_0x2b522c){logger[_0x68b6('0x12')](_0x68b6('0xe'),_0x870d6a,_0x2b522c);_0x3fa58c(_0x2b522c);});});}exports[_0x68b6('0x16')]=function(_0x4d183){var _0x517332=this;return new Promise(function(_0x164328,_0x116ca1){return db[_0x68b6('0x17')][_0x68b6('0x18')]({'raw':_0x4d183[_0x68b6('0x19')]?_0x4d183['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d183['options']?_0x4d183[_0x68b6('0x19')][_0x68b6('0x1a')]||null:null,'attributes':_0x4d183[_0x68b6('0x19')]?_0x4d183['options'][_0x68b6('0x1b')]||null:null,'include':_0x4d183[_0x68b6('0x19')]?_0x4d183[_0x68b6('0x19')][_0x68b6('0x1c')]?_['map'](_0x4d183[_0x68b6('0x19')][_0x68b6('0x1c')],function(_0x40419e){return{'model':db[_0x40419e[_0x68b6('0x1d')]],'as':_0x40419e['as'],'attributes':_0x40419e[_0x68b6('0x1b')],'include':_0x40419e['include']?_[_0x68b6('0x1e')](_0x40419e[_0x68b6('0x1c')],function(_0x327cc2){return{'model':db[_0x327cc2['model']],'as':_0x327cc2['as'],'attributes':_0x327cc2[_0x68b6('0x1b')],'include':_0x327cc2[_0x68b6('0x1c')]?_[_0x68b6('0x1e')](_0x327cc2['include'],function(_0x51f272){return{'model':db[_0x51f272[_0x68b6('0x1d')]],'as':_0x51f272['as'],'attributes':_0x51f272[_0x68b6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x68b6('0xc')](function(_0x5d2bbe){logger[_0x68b6('0xd')](_0x68b6('0x16'),_0x4d183);logger[_0x68b6('0x1f')]('ShowSound',_0x4d183,JSON[_0x68b6('0x11')](_0x5d2bbe));_0x164328(_0x5d2bbe);})[_0x68b6('0x15')](function(_0x3f596a){logger[_0x68b6('0x12')](_0x68b6('0x16'),_0x3f596a[_0x68b6('0x14')],_0x4d183);_0x116ca1(_0x517332[_0x68b6('0x12')](0x1f4,_0x3f596a[_0x68b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f1ee4aa..3796ffb 100644 --- a/server/api/squareMessage/index.js +++ b/server/api/squareMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x254b22,_0x27159f){var _0x1279db=function(_0x3ca06f){while(--_0x3ca06f){_0x254b22['push'](_0x254b22['shift']());}};_0x1279db(++_0x27159f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x178300,_0x53ce3a){_0x178300=_0x178300-0x0;var _0xe85fe4=_0x9ffd[_0x178300];return _0xe85fe4;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x110bec,_0x5f261a){_0x110bec=_0x110bec-0x0;var _0x7f57cc=_0x9ffd[_0x110bec];return _0x7f57cc;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index b0e69df..49f639e 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 _0x521f=['TEXT','medium','ENUM','out','STRING','exports'];(function(_0x34ecea,_0x3d11ce){var _0x44b6a8=function(_0x5843a1){while(--_0x5843a1){_0x34ecea['push'](_0x34ecea['shift']());}};_0x44b6a8(++_0x3d11ce);}(_0x521f,0x71));var _0xf521=function(_0x4872f0,_0x305d25){_0x4872f0=_0x4872f0-0x0;var _0x35b4fc=_0x521f[_0x4872f0];return _0x35b4fc;};'use strict';var Sequelize=require('sequelize');module[_0xf521('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xf521('0x1')](_0xf521('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xf521('0x3')]('in',_0xf521('0x4')),'defaultValue':_0xf521('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xf521('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6f19=['sequelize','STRING','out'];(function(_0xe76889,_0x267b48){var _0x39c9d5=function(_0x358607){while(--_0x358607){_0xe76889['push'](_0xe76889['shift']());}};_0x39c9d5(++_0x267b48);}(_0x6f19,0x111));var _0x96f1=function(_0x5c705c,_0x2c15bc){_0x5c705c=_0x5c705c-0x0;var _0xd79f3c=_0x6f19[_0x5c705c];return _0xd79f3c;};'use strict';var Sequelize=require(_0x96f1('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x96f1('0x1')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x96f1('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0x96f1('0x1')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 39b7e2b..7f18703 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 _0xd159=['path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','save','then','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util'];(function(_0x3c687c,_0x3637da){var _0x53a8f1=function(_0x46b971){while(--_0x46b971){_0x3c687c['push'](_0x3c687c['shift']());}};_0x53a8f1(++_0x3637da);}(_0xd159,0x19d));var _0x9d15=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd159[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x9d15('0x0'));var rimraf=require(_0x9d15('0x1'));var zipdir=require(_0x9d15('0x2'));var jsonpatch=require(_0x9d15('0x3'));var rp=require('request-promise');var moment=require(_0x9d15('0x4'));var BPromise=require(_0x9d15('0x5'));var Mustache=require('mustache');var util=require(_0x9d15('0x6'));var path=require(_0x9d15('0x7'));var sox=require(_0x9d15('0x8'));var csv=require('to-csv');var ejs=require(_0x9d15('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d15('0xa'));var squel=require(_0x9d15('0xb'));var crypto=require(_0x9d15('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9d15('0xd'));var toCsv=require(_0x9d15('0xe'));var querystring=require(_0x9d15('0xf'));var Papa=require(_0x9d15('0x10'));var Redis=require(_0x9d15('0x11'));var authService=require(_0x9d15('0x12'));var qs=require(_0x9d15('0x13'));var as=require(_0x9d15('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d15('0x15'))('api');var utils=require(_0x9d15('0x16'));var config=require(_0x9d15('0x17'));var licenseUtil=require(_0x9d15('0x18'));var db=require(_0x9d15('0x19'))['db'];function respondWithStatusCode(_0x136a4c,_0xaf4a1b){_0xaf4a1b=_0xaf4a1b||0xcc;return function(_0x1cea3f){if(_0x1cea3f){return _0x136a4c[_0x9d15('0x1a')](_0xaf4a1b);}return _0x136a4c['status'](_0xaf4a1b)[_0x9d15('0x1b')]();};}function respondWithResult(_0x2defbc,_0x5cf8f3){_0x5cf8f3=_0x5cf8f3||0xc8;return function(_0x1f98dc){if(_0x1f98dc){return _0x2defbc['status'](_0x5cf8f3)[_0x9d15('0x1c')](_0x1f98dc);}};}function respondWithFilteredResult(_0x4c08a2,_0x56112a){return function(_0x584946){if(_0x584946){var _0x50df1e=typeof _0x56112a[_0x9d15('0x1d')]===_0x9d15('0x1e')&&typeof _0x56112a['limit']===_0x9d15('0x1e');var _0x237fec=_0x584946['count'];var _0x2d3ec1=_0x50df1e?0x0:_0x56112a[_0x9d15('0x1d')];var _0x37878f=_0x50df1e?_0x584946[_0x9d15('0x1f')]:_0x56112a[_0x9d15('0x1d')]+_0x56112a[_0x9d15('0x20')];var _0x36ea6f;if(_0x37878f>=_0x237fec){_0x37878f=_0x237fec;_0x36ea6f=0xc8;}else{_0x36ea6f=0xce;}_0x4c08a2[_0x9d15('0x21')](_0x36ea6f);return _0x4c08a2[_0x9d15('0x22')]('Content-Range',_0x2d3ec1+'-'+_0x37878f+'/'+_0x237fec)[_0x9d15('0x1c')](_0x584946);}return null;};}function patchUpdates(_0x13a08c){return function(_0x49ef84){try{jsonpatch['apply'](_0x49ef84,_0x13a08c,!![]);}catch(_0xd96c05){return BPromise['reject'](_0xd96c05);}return _0x49ef84[_0x9d15('0x23')]();};}function saveUpdates(_0x4d98f0,_0x1e05a9){return function(_0x20c925){if(_0x20c925){return _0x20c925['update'](_0x4d98f0)[_0x9d15('0x24')](function(_0x5e6b8a){return _0x5e6b8a;});}return null;};}function removeEntity(_0x40ff10,_0x2c1ec9){return function(_0x5acf63){if(_0x5acf63){return _0x5acf63['destroy']()['then'](function(){_0x40ff10[_0x9d15('0x21')](0xcc)[_0x9d15('0x1b')]();});}};}function handleEntityNotFound(_0x143e19,_0x11a0e6){return function(_0xb5a9ff){if(!_0xb5a9ff){_0x143e19['sendStatus'](0x194);}return _0xb5a9ff;};}function handleError(_0x56710b,_0x22a092){_0x22a092=_0x22a092||0x1f4;return function(_0x4a361f){logger['error'](_0x4a361f[_0x9d15('0x25')]);if(_0x4a361f[_0x9d15('0x26')]){delete _0x4a361f['name'];}_0x56710b[_0x9d15('0x21')](_0x22a092)[_0x9d15('0x27')](_0x4a361f);};}exports['index']=function(_0x3f8900,_0x40f686){var _0x30e74b={},_0xdae6e={},_0xe502a5={'count':0x0,'rows':[]};var _0x1d4dd4=_[_0x9d15('0x28')](db[_0x9d15('0x29')][_0x9d15('0x2a')],function(_0x536b66){return{'name':_0x536b66[_0x9d15('0x2b')],'type':_0x536b66[_0x9d15('0x2c')]['key']};});_0xdae6e[_0x9d15('0x2d')]=_[_0x9d15('0x28')](_0x1d4dd4,_0x9d15('0x26'));_0xdae6e[_0x9d15('0x2e')]=_[_0x9d15('0x2f')](_0x3f8900[_0x9d15('0x2e')]);_0xdae6e['filters']=_[_0x9d15('0x30')](_0xdae6e[_0x9d15('0x2d')],_0xdae6e['query']);_0x30e74b['attributes']=_['intersection'](_0xdae6e['model'],qs['fields'](_0x3f8900[_0x9d15('0x2e')]['fields']));_0x30e74b['attributes']=_0x30e74b[_0x9d15('0x31')][_0x9d15('0x32')]?_0x30e74b[_0x9d15('0x31')]:_0xdae6e[_0x9d15('0x2d')];if(!_0x3f8900[_0x9d15('0x2e')][_0x9d15('0x33')]('nolimit')){_0x30e74b[_0x9d15('0x20')]=qs[_0x9d15('0x20')](_0x3f8900[_0x9d15('0x2e')][_0x9d15('0x20')]);_0x30e74b[_0x9d15('0x1d')]=qs[_0x9d15('0x1d')](_0x3f8900[_0x9d15('0x2e')][_0x9d15('0x1d')]);}_0x30e74b['order']=qs[_0x9d15('0x34')](_0x3f8900[_0x9d15('0x2e')][_0x9d15('0x34')]);_0x30e74b[_0x9d15('0x35')]=qs[_0x9d15('0x36')](_['pick'](_0x3f8900[_0x9d15('0x2e')],_0xdae6e[_0x9d15('0x36')]),_0x1d4dd4);if(_0x3f8900[_0x9d15('0x2e')][_0x9d15('0x37')]){_0x30e74b[_0x9d15('0x35')]=_[_0x9d15('0x38')](_0x30e74b[_0x9d15('0x35')],{'$or':_['map'](_0x1d4dd4,function(_0xcae3cf){if(_0xcae3cf[_0x9d15('0x2c')]!==_0x9d15('0x39')){var _0x3570cf={};_0x3570cf[_0xcae3cf[_0x9d15('0x26')]]={'$like':'%'+_0x3f8900['query'][_0x9d15('0x37')]+'%'};return _0x3570cf;}})});}_0x30e74b=_[_0x9d15('0x38')]({},_0x30e74b,_0x3f8900[_0x9d15('0x3a')]);var _0x275a8e={'where':_0x30e74b[_0x9d15('0x35')]};return db[_0x9d15('0x29')]['count'](_0x275a8e)[_0x9d15('0x24')](function(_0x491551){_0xe502a5[_0x9d15('0x1f')]=_0x491551;if(_0x3f8900[_0x9d15('0x2e')][_0x9d15('0x3b')]){_0x30e74b[_0x9d15('0x3c')]=[{'all':!![]}];}return db['SquareMessage'][_0x9d15('0x3d')](_0x30e74b);})[_0x9d15('0x24')](function(_0x59cff9){_0xe502a5['rows']=_0x59cff9;return _0xe502a5;})['then'](respondWithFilteredResult(_0x40f686,_0x30e74b))[_0x9d15('0x3e')](handleError(_0x40f686,null));};exports[_0x9d15('0x3f')]=function(_0x1377df,_0x5477a4){var _0x1191fb={'raw':!![],'where':{'id':_0x1377df[_0x9d15('0x40')]['id']}},_0x41aded={};_0x41aded[_0x9d15('0x2d')]=_[_0x9d15('0x2f')](db['SquareMessage'][_0x9d15('0x2a')]);_0x41aded['query']=_['keys'](_0x1377df[_0x9d15('0x2e')]);_0x41aded[_0x9d15('0x36')]=_[_0x9d15('0x30')](_0x41aded[_0x9d15('0x2d')],_0x41aded['query']);_0x1191fb['attributes']=_[_0x9d15('0x30')](_0x41aded[_0x9d15('0x2d')],qs[_0x9d15('0x41')](_0x1377df[_0x9d15('0x2e')][_0x9d15('0x41')]));_0x1191fb[_0x9d15('0x31')]=_0x1191fb['attributes'][_0x9d15('0x32')]?_0x1191fb[_0x9d15('0x31')]:_0x41aded[_0x9d15('0x2d')];if(_0x1377df['query'][_0x9d15('0x3b')]){_0x1191fb[_0x9d15('0x3c')]=[{'all':!![]}];}_0x1191fb=_['merge']({},_0x1191fb,_0x1377df[_0x9d15('0x3a')]);return db[_0x9d15('0x29')][_0x9d15('0x42')](_0x1191fb)['then'](handleEntityNotFound(_0x5477a4,null))[_0x9d15('0x24')](respondWithResult(_0x5477a4,null))['catch'](handleError(_0x5477a4,null));};exports[_0x9d15('0x43')]=function(_0x2017a8,_0x8595a){return db[_0x9d15('0x29')]['create'](_0x2017a8[_0x9d15('0x44')],{})[_0x9d15('0x24')](respondWithResult(_0x8595a,0xc9))[_0x9d15('0x3e')](handleError(_0x8595a,null));};exports['update']=function(_0x33c01d,_0x307396){if(_0x33c01d['body']['id']){delete _0x33c01d[_0x9d15('0x44')]['id'];}return db[_0x9d15('0x29')][_0x9d15('0x42')]({'where':{'id':_0x33c01d[_0x9d15('0x40')]['id']}})['then'](handleEntityNotFound(_0x307396,null))[_0x9d15('0x24')](saveUpdates(_0x33c01d[_0x9d15('0x44')],null))[_0x9d15('0x24')](respondWithResult(_0x307396,null))[_0x9d15('0x3e')](handleError(_0x307396,null));};exports[_0x9d15('0x45')]=function(_0x4659a7,_0x19cb96){return db[_0x9d15('0x29')]['find']({'where':{'id':_0x4659a7[_0x9d15('0x40')]['id']}})[_0x9d15('0x24')](handleEntityNotFound(_0x19cb96,null))[_0x9d15('0x24')](removeEntity(_0x19cb96,null))[_0x9d15('0x3e')](handleError(_0x19cb96,null));}; \ No newline at end of file +var _0x2922=['sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','SquareMessage','rows','params','keys','length','options','create','body','catch','find','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then'];(function(_0x408d22,_0x53eef9){var _0x58effd=function(_0x4ab8ee){while(--_0x4ab8ee){_0x408d22['push'](_0x408d22['shift']());}};_0x58effd(++_0x53eef9);}(_0x2922,0x107));var _0x2292=function(_0x9b1e58,_0x275770){_0x9b1e58=_0x9b1e58-0x0;var _0x50d9d4=_0x2922[_0x9b1e58];return _0x50d9d4;};'use strict';var emlformat=require(_0x2292('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2292('0x1'));var jsonpatch=require(_0x2292('0x2'));var rp=require(_0x2292('0x3'));var moment=require('moment');var BPromise=require(_0x2292('0x4'));var Mustache=require(_0x2292('0x5'));var util=require('util');var path=require(_0x2292('0x6'));var sox=require(_0x2292('0x7'));var csv=require('to-csv');var ejs=require(_0x2292('0x8'));var fs=require('fs');var fs_extra=require(_0x2292('0x9'));var _=require(_0x2292('0xa'));var squel=require(_0x2292('0xb'));var crypto=require(_0x2292('0xc'));var jsforce=require(_0x2292('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2292('0xe'));var querystring=require(_0x2292('0xf'));var Papa=require(_0x2292('0x10'));var Redis=require('ioredis');var authService=require(_0x2292('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2292('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2292('0x13'))(_0x2292('0x14'));var utils=require(_0x2292('0x15'));var config=require(_0x2292('0x16'));var licenseUtil=require(_0x2292('0x17'));var db=require(_0x2292('0x18'))['db'];function respondWithStatusCode(_0x7e8d80,_0x561876){_0x561876=_0x561876||0xcc;return function(_0x387e04){if(_0x387e04){return _0x7e8d80['sendStatus'](_0x561876);}return _0x7e8d80[_0x2292('0x19')](_0x561876)[_0x2292('0x1a')]();};}function respondWithResult(_0x26fda3,_0x59adfa){_0x59adfa=_0x59adfa||0xc8;return function(_0xfad30b){if(_0xfad30b){return _0x26fda3[_0x2292('0x19')](_0x59adfa)[_0x2292('0x1b')](_0xfad30b);}};}function respondWithFilteredResult(_0x37f83e,_0x5dc6fc){return function(_0x4851bd){if(_0x4851bd){var _0xcaa9a5=typeof _0x5dc6fc[_0x2292('0x1c')]===_0x2292('0x1d')&&typeof _0x5dc6fc['limit']===_0x2292('0x1d');var _0x3bfe1a=_0x4851bd[_0x2292('0x1e')];var _0x49fe4e=_0xcaa9a5?0x0:_0x5dc6fc[_0x2292('0x1c')];var _0x6d46b1=_0xcaa9a5?_0x4851bd[_0x2292('0x1e')]:_0x5dc6fc[_0x2292('0x1c')]+_0x5dc6fc['limit'];var _0x216781;if(_0x6d46b1>=_0x3bfe1a){_0x6d46b1=_0x3bfe1a;_0x216781=0xc8;}else{_0x216781=0xce;}_0x37f83e[_0x2292('0x19')](_0x216781);return _0x37f83e[_0x2292('0x1f')](_0x2292('0x20'),_0x49fe4e+'-'+_0x6d46b1+'/'+_0x3bfe1a)[_0x2292('0x1b')](_0x4851bd);}return null;};}function patchUpdates(_0x1defe2){return function(_0x5225bf){try{jsonpatch[_0x2292('0x21')](_0x5225bf,_0x1defe2,!![]);}catch(_0x1eb376){return BPromise['reject'](_0x1eb376);}return _0x5225bf[_0x2292('0x22')]();};}function saveUpdates(_0x5becdc,_0x36cd0c){return function(_0x3a5ef4){if(_0x3a5ef4){return _0x3a5ef4[_0x2292('0x23')](_0x5becdc)[_0x2292('0x24')](function(_0x5e5e5c){return _0x5e5e5c;});}return null;};}function removeEntity(_0x1566d6,_0x2353a2){return function(_0x4d7095){if(_0x4d7095){return _0x4d7095['destroy']()[_0x2292('0x24')](function(){_0x1566d6[_0x2292('0x19')](0xcc)[_0x2292('0x1a')]();});}};}function handleEntityNotFound(_0x2c0596,_0x5c92c8){return function(_0x5e2d27){if(!_0x5e2d27){_0x2c0596[_0x2292('0x25')](0x194);}return _0x5e2d27;};}function handleError(_0x4f28df,_0x258636){_0x258636=_0x258636||0x1f4;return function(_0x42b7c6){logger[_0x2292('0x26')](_0x42b7c6[_0x2292('0x27')]);if(_0x42b7c6[_0x2292('0x28')]){delete _0x42b7c6['name'];}_0x4f28df[_0x2292('0x19')](_0x258636)[_0x2292('0x29')](_0x42b7c6);};}exports[_0x2292('0x2a')]=function(_0x5c0617,_0x1e9cfd){var _0x1683e7={},_0x3fcee5={},_0x4654c8={'count':0x0,'rows':[]};var _0x185d07=_[_0x2292('0x2b')](db['SquareMessage'][_0x2292('0x2c')],function(_0x5495c8){return{'name':_0x5495c8['fieldName'],'type':_0x5495c8[_0x2292('0x2d')]['key']};});_0x3fcee5[_0x2292('0x2e')]=_['map'](_0x185d07,_0x2292('0x28'));_0x3fcee5[_0x2292('0x2f')]=_['keys'](_0x5c0617['query']);_0x3fcee5[_0x2292('0x30')]=_[_0x2292('0x31')](_0x3fcee5[_0x2292('0x2e')],_0x3fcee5[_0x2292('0x2f')]);_0x1683e7[_0x2292('0x32')]=_[_0x2292('0x31')](_0x3fcee5[_0x2292('0x2e')],qs[_0x2292('0x33')](_0x5c0617[_0x2292('0x2f')]['fields']));_0x1683e7[_0x2292('0x32')]=_0x1683e7[_0x2292('0x32')]['length']?_0x1683e7[_0x2292('0x32')]:_0x3fcee5[_0x2292('0x2e')];if(!_0x5c0617[_0x2292('0x2f')][_0x2292('0x34')](_0x2292('0x35'))){_0x1683e7[_0x2292('0x36')]=qs[_0x2292('0x36')](_0x5c0617[_0x2292('0x2f')][_0x2292('0x36')]);_0x1683e7[_0x2292('0x1c')]=qs[_0x2292('0x1c')](_0x5c0617[_0x2292('0x2f')]['offset']);}_0x1683e7[_0x2292('0x37')]=qs[_0x2292('0x38')](_0x5c0617[_0x2292('0x2f')][_0x2292('0x38')]);_0x1683e7[_0x2292('0x39')]=qs[_0x2292('0x30')](_[_0x2292('0x3a')](_0x5c0617[_0x2292('0x2f')],_0x3fcee5[_0x2292('0x30')]),_0x185d07);if(_0x5c0617[_0x2292('0x2f')][_0x2292('0x3b')]){_0x1683e7[_0x2292('0x39')]=_['merge'](_0x1683e7['where'],{'$or':_[_0x2292('0x2b')](_0x185d07,function(_0x3e8c7c){if(_0x3e8c7c[_0x2292('0x2d')]!==_0x2292('0x3c')){var _0x3556f6={};_0x3556f6[_0x3e8c7c[_0x2292('0x28')]]={'$like':'%'+_0x5c0617[_0x2292('0x2f')]['filter']+'%'};return _0x3556f6;}})});}_0x1683e7=_[_0x2292('0x3d')]({},_0x1683e7,_0x5c0617['options']);var _0x9bf3dd={'where':_0x1683e7[_0x2292('0x39')]};return db['SquareMessage'][_0x2292('0x1e')](_0x9bf3dd)['then'](function(_0x1c18f4){_0x4654c8[_0x2292('0x1e')]=_0x1c18f4;if(_0x5c0617[_0x2292('0x2f')][_0x2292('0x3e')]){_0x1683e7[_0x2292('0x3f')]=[{'all':!![]}];}return db[_0x2292('0x40')]['findAll'](_0x1683e7);})[_0x2292('0x24')](function(_0x18045b){_0x4654c8[_0x2292('0x41')]=_0x18045b;return _0x4654c8;})['then'](respondWithFilteredResult(_0x1e9cfd,_0x1683e7))['catch'](handleError(_0x1e9cfd,null));};exports['show']=function(_0x4b8f39,_0x12be11){var _0x54b11e={'raw':!![],'where':{'id':_0x4b8f39[_0x2292('0x42')]['id']}},_0x56ece5={};_0x56ece5[_0x2292('0x2e')]=_[_0x2292('0x43')](db[_0x2292('0x40')]['rawAttributes']);_0x56ece5['query']=_['keys'](_0x4b8f39[_0x2292('0x2f')]);_0x56ece5[_0x2292('0x30')]=_[_0x2292('0x31')](_0x56ece5['model'],_0x56ece5[_0x2292('0x2f')]);_0x54b11e[_0x2292('0x32')]=_['intersection'](_0x56ece5[_0x2292('0x2e')],qs['fields'](_0x4b8f39[_0x2292('0x2f')][_0x2292('0x33')]));_0x54b11e[_0x2292('0x32')]=_0x54b11e['attributes'][_0x2292('0x44')]?_0x54b11e[_0x2292('0x32')]:_0x56ece5['model'];if(_0x4b8f39[_0x2292('0x2f')][_0x2292('0x3e')]){_0x54b11e[_0x2292('0x3f')]=[{'all':!![]}];}_0x54b11e=_[_0x2292('0x3d')]({},_0x54b11e,_0x4b8f39[_0x2292('0x45')]);return db[_0x2292('0x40')]['find'](_0x54b11e)[_0x2292('0x24')](handleEntityNotFound(_0x12be11,null))[_0x2292('0x24')](respondWithResult(_0x12be11,null))['catch'](handleError(_0x12be11,null));};exports[_0x2292('0x46')]=function(_0x5e8fb1,_0x31017b){return db[_0x2292('0x40')][_0x2292('0x46')](_0x5e8fb1[_0x2292('0x47')],{})[_0x2292('0x24')](respondWithResult(_0x31017b,0xc9))[_0x2292('0x48')](handleError(_0x31017b,null));};exports[_0x2292('0x23')]=function(_0x19f93b,_0x387220){if(_0x19f93b['body']['id']){delete _0x19f93b[_0x2292('0x47')]['id'];}return db[_0x2292('0x40')][_0x2292('0x49')]({'where':{'id':_0x19f93b['params']['id']}})[_0x2292('0x24')](handleEntityNotFound(_0x387220,null))[_0x2292('0x24')](saveUpdates(_0x19f93b['body'],null))[_0x2292('0x24')](respondWithResult(_0x387220,null))[_0x2292('0x48')](handleError(_0x387220,null));};exports[_0x2292('0x4a')]=function(_0x3be58b,_0x328465){return db['SquareMessage'][_0x2292('0x49')]({'where':{'id':_0x3be58b[_0x2292('0x42')]['id']}})[_0x2292('0x24')](handleEntityNotFound(_0x328465,null))[_0x2292('0x24')](removeEntity(_0x328465,null))[_0x2292('0x48')](handleError(_0x328465,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 3d1b229..04fdb55 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 _0xfeb3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareMessage','square_messages','lodash','util'];(function(_0x1e1138,_0x8469f6){var _0x544879=function(_0x95b969){while(--_0x95b969){_0x1e1138['push'](_0x1e1138['shift']());}};_0x544879(++_0x8469f6);}(_0xfeb3,0x1a2));var _0x3feb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfeb3[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x3feb('0x0'));var util=require(_0x3feb('0x1'));var logger=require(_0x3feb('0x2'))(_0x3feb('0x3'));var moment=require(_0x3feb('0x4'));var BPromise=require(_0x3feb('0x5'));var rp=require(_0x3feb('0x6'));var fs=require('fs');var path=require(_0x3feb('0x7'));var rimraf=require(_0x3feb('0x8'));var config=require(_0x3feb('0x9'));var attributes=require('./squareMessage.attributes');module[_0x3feb('0xa')]=function(_0x1862f1,_0x3d3c94){return _0x1862f1[_0x3feb('0xb')](_0x3feb('0xc'),attributes,{'tableName':_0x3feb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38f3=['path','../../config/environment','./squareMessage.attributes','exports','define','lodash','util','moment','request-promise'];(function(_0x227508,_0x4c35b9){var _0x33e18b=function(_0x5504f9){while(--_0x5504f9){_0x227508['push'](_0x227508['shift']());}};_0x33e18b(++_0x4c35b9);}(_0x38f3,0xa7));var _0x338f=function(_0x5d0f97,_0x25009f){_0x5d0f97=_0x5d0f97-0x0;var _0xc7236=_0x38f3[_0x5d0f97];return _0xc7236;};'use strict';var _=require(_0x338f('0x0'));var util=require(_0x338f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x338f('0x2'));var BPromise=require('bluebird');var rp=require(_0x338f('0x3'));var fs=require('fs');var path=require(_0x338f('0x4'));var rimraf=require('rimraf');var config=require(_0x338f('0x5'));var attributes=require(_0x338f('0x6'));module[_0x338f('0x7')]=function(_0x4a4203,_0x972422){return _0x4a4203[_0x338f('0x8')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 1937545..ebfd5a6 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 _0x6a02=['info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareMessage','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x98d41b,_0x94068d){var _0x198570=function(_0xd79f65){while(--_0xd79f65){_0x98d41b['push'](_0x98d41b['shift']());}};_0x198570(++_0x94068d);}(_0x6a02,0xf7));var _0x26a0=function(_0x11a090,_0x118af9){_0x11a090=_0x11a090-0x0;var _0x32ae3d=_0x6a02[_0x11a090];return _0x32ae3d;};'use strict';var _=require('lodash');var util=require(_0x26a0('0x0'));var moment=require('moment');var BPromise=require(_0x26a0('0x1'));var rs=require(_0x26a0('0x2'));var fs=require('fs');var Redis=require(_0x26a0('0x3'));var db=require(_0x26a0('0x4'))['db'];var utils=require(_0x26a0('0x5'));var logger=require(_0x26a0('0x6'))('rpc');var config=require(_0x26a0('0x7'));var jayson=require(_0x26a0('0x8'));var client=jayson[_0x26a0('0x9')][_0x26a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bd775,_0x34fb2a,_0x20c2a2){return new BPromise(function(_0x135b61,_0x55008a){return client[_0x26a0('0xb')](_0x3bd775,_0x20c2a2)[_0x26a0('0xc')](function(_0x2a2e76){logger[_0x26a0('0xd')](_0x26a0('0xe'),_0x34fb2a,_0x26a0('0xf'));logger[_0x26a0('0x10')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x34fb2a,_0x26a0('0xf'),JSON[_0x26a0('0x11')](_0x2a2e76));if(_0x2a2e76[_0x26a0('0x12')]){if(_0x2a2e76['error'][_0x26a0('0x13')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x34fb2a,_0x2a2e76['error'][_0x26a0('0x14')]);return _0x55008a(_0x2a2e76['error'][_0x26a0('0x14')]);}logger[_0x26a0('0x12')](_0x26a0('0xe'),_0x34fb2a,_0x2a2e76[_0x26a0('0x12')][_0x26a0('0x14')]);return _0x135b61(_0x2a2e76[_0x26a0('0x12')][_0x26a0('0x14')]);}else{logger['info'](_0x26a0('0xe'),_0x34fb2a,_0x26a0('0xf'));_0x135b61(_0x2a2e76[_0x26a0('0x15')][_0x26a0('0x14')]);}})[_0x26a0('0x16')](function(_0x484da6){logger[_0x26a0('0x12')](_0x26a0('0xe'),_0x34fb2a,_0x484da6);_0x55008a(_0x484da6);});});}exports[_0x26a0('0x17')]=function(_0x5e43de){var _0x4af6fa=this;return new Promise(function(_0xed6607,_0x3db266){return db['SquareMessage']['create'](_0x5e43de['body'],{'raw':_0x5e43de[_0x26a0('0x18')]?_0x5e43de[_0x26a0('0x18')][_0x26a0('0x19')]===undefined?!![]:![]:!![]})[_0x26a0('0xc')](function(_0x2d03f7){logger['info']('CreateSquareMessage',_0x5e43de);logger['debug'](_0x26a0('0x17'),_0x5e43de,JSON[_0x26a0('0x11')](_0x2d03f7));_0xed6607(_0x2d03f7);})[_0x26a0('0x16')](function(_0x2f5f71){logger[_0x26a0('0x12')](_0x26a0('0x17'),_0x2f5f71[_0x26a0('0x14')],_0x5e43de);_0x3db266(_0x4af6fa[_0x26a0('0x12')](0x1f4,_0x2f5f71['message']));});});}; \ No newline at end of file +var _0xd3dd=['request\x20sent','stringify','error','code','message','result','catch','CreateSquareMessage','create','body','options','raw','then','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s'];(function(_0x439ca1,_0x1f2af1){var _0xf8371f=function(_0x41cdaa){while(--_0x41cdaa){_0x439ca1['push'](_0x439ca1['shift']());}};_0xf8371f(++_0x1f2af1);}(_0xd3dd,0x10a));var _0xdd3d=function(_0x4bda67,_0x3c284c){_0x4bda67=_0x4bda67-0x0;var _0xa071bb=_0xd3dd[_0x4bda67];return _0xa071bb;};'use strict';var _=require(_0xdd3d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdd3d('0x1'));var rs=require(_0xdd3d('0x2'));var fs=require('fs');var Redis=require(_0xdd3d('0x3'));var db=require(_0xdd3d('0x4'))['db'];var utils=require(_0xdd3d('0x5'));var logger=require(_0xdd3d('0x6'))(_0xdd3d('0x7'));var config=require('../../config/environment');var jayson=require(_0xdd3d('0x8'));var client=jayson[_0xdd3d('0x9')][_0xdd3d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fe885,_0x541567,_0x2c8b7b){return new BPromise(function(_0x2a2344,_0x420a06){return client[_0xdd3d('0xb')](_0x2fe885,_0x2c8b7b)['then'](function(_0x41280f){logger[_0xdd3d('0xc')](_0xdd3d('0xd'),_0x541567,_0xdd3d('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x541567,_0xdd3d('0xe'),JSON[_0xdd3d('0xf')](_0x41280f));if(_0x41280f[_0xdd3d('0x10')]){if(_0x41280f[_0xdd3d('0x10')][_0xdd3d('0x11')]===0x1f4){logger[_0xdd3d('0x10')](_0xdd3d('0xd'),_0x541567,_0x41280f[_0xdd3d('0x10')][_0xdd3d('0x12')]);return _0x420a06(_0x41280f[_0xdd3d('0x10')][_0xdd3d('0x12')]);}logger[_0xdd3d('0x10')](_0xdd3d('0xd'),_0x541567,_0x41280f['error']['message']);return _0x2a2344(_0x41280f[_0xdd3d('0x10')][_0xdd3d('0x12')]);}else{logger[_0xdd3d('0xc')](_0xdd3d('0xd'),_0x541567,'request\x20sent');_0x2a2344(_0x41280f[_0xdd3d('0x13')][_0xdd3d('0x12')]);}})[_0xdd3d('0x14')](function(_0x23e7ab){logger['error']('SquareMessage,\x20%s,\x20%s',_0x541567,_0x23e7ab);_0x420a06(_0x23e7ab);});});}exports[_0xdd3d('0x15')]=function(_0x55dff2){var _0x52caa3=this;return new Promise(function(_0x101b33,_0x2f70a3){return db['SquareMessage'][_0xdd3d('0x16')](_0x55dff2[_0xdd3d('0x17')],{'raw':_0x55dff2[_0xdd3d('0x18')]?_0x55dff2['options'][_0xdd3d('0x19')]===undefined?!![]:![]:!![]})[_0xdd3d('0x1a')](function(_0x3a2010){logger[_0xdd3d('0xc')](_0xdd3d('0x15'),_0x55dff2);logger[_0xdd3d('0x1b')](_0xdd3d('0x15'),_0x55dff2,JSON[_0xdd3d('0xf')](_0x3a2010));_0x101b33(_0x3a2010);})[_0xdd3d('0x14')](function(_0x51470b){logger['error']('CreateSquareMessage',_0x51470b['message'],_0x55dff2);_0x2f70a3(_0x52caa3[_0xdd3d('0x10')](0x1f4,_0x51470b[_0xdd3d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index b041e55..03b60fd 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 _0x0009=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id/test','15s','test','create','put','/:id','update','delete','destroy'];(function(_0x3ffe67,_0x3b1002){var _0x3ab874=function(_0x1aa5e1){while(--_0x1aa5e1){_0x3ffe67['push'](_0x3ffe67['shift']());}};_0x3ab874(++_0x3b1002);}(_0x0009,0x1a3));var _0x9000=function(_0x26c1ff,_0xb7c424){_0x26c1ff=_0x26c1ff-0x0;var _0xa7f0ee=_0x0009[_0x26c1ff];return _0xa7f0ee;};'use strict';var multer=require(_0x9000('0x0'));var util=require(_0x9000('0x1'));var path=require('path');var timeout=require(_0x9000('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9000('0x3'));var auth=require(_0x9000('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9000('0x5'));var controller=require(_0x9000('0x6'));router[_0x9000('0x7')]('/',auth[_0x9000('0x8')](),controller['index']);router[_0x9000('0x7')]('/:id',auth[_0x9000('0x8')](),controller['show']);router[_0x9000('0x7')](_0x9000('0x9'),auth['isAuthenticated'](),timeout(_0x9000('0xa')),controller[_0x9000('0xb')]);router['post']('/',auth[_0x9000('0x8')](),controller[_0x9000('0xc')]);router[_0x9000('0xd')](_0x9000('0xe'),auth['isAuthenticated'](),controller[_0x9000('0xf')]);router[_0x9000('0x10')](_0x9000('0xe'),auth['isAuthenticated'](),controller[_0x9000('0x11')]);module[_0x9000('0x12')]=router; \ No newline at end of file +var _0xf26b=['/:id/test','15s','test','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show'];(function(_0x42076c,_0xb695e0){var _0xe5aaa2=function(_0x4a38c4){while(--_0x4a38c4){_0x42076c['push'](_0x42076c['shift']());}};_0xe5aaa2(++_0xb695e0);}(_0xf26b,0xdb));var _0xbf26=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0xf26b[_0x5b47d9];return _0x4151f0;};'use strict';var multer=require(_0xbf26('0x0'));var util=require(_0xbf26('0x1'));var path=require('path');var timeout=require(_0xbf26('0x2'));var express=require('express');var router=express[_0xbf26('0x3')]();var fs_extra=require(_0xbf26('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbf26('0x5'));var config=require('../../config/environment');var controller=require(_0xbf26('0x6'));router[_0xbf26('0x7')]('/',auth[_0xbf26('0x8')](),controller[_0xbf26('0x9')]);router[_0xbf26('0x7')](_0xbf26('0xa'),auth['isAuthenticated'](),controller[_0xbf26('0xb')]);router[_0xbf26('0x7')](_0xbf26('0xc'),auth[_0xbf26('0x8')](),timeout(_0xbf26('0xd')),controller[_0xbf26('0xe')]);router[_0xbf26('0xf')]('/',auth[_0xbf26('0x8')](),controller[_0xbf26('0x10')]);router[_0xbf26('0x11')](_0xbf26('0xa'),auth[_0xbf26('0x8')](),controller[_0xbf26('0x12')]);router[_0xbf26('0x13')]('/:id',auth[_0xbf26('0x8')](),controller['destroy']);module[_0xbf26('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index de66ad0..455a318 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 _0xb000=['STRING','sequelize'];(function(_0x30c019,_0xcf8a){var _0x20e0de=function(_0x4e593a){while(--_0x4e593a){_0x30c019['push'](_0x30c019['shift']());}};_0x20e0de(++_0xcf8a);}(_0xb000,0x195));var _0x0b00=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xb000[_0x259d17];return _0x407535;};'use strict';var Sequelize=require(_0x0b00('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b00('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x0b00('0x1')]},'description':{'type':Sequelize[_0x0b00('0x1')]}}; \ No newline at end of file +var _0x2e31=['sequelize','exports','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e31,0xc8));var _0x12e3=function(_0x35c3ef,_0x3bfa86){_0x35c3ef=_0x35c3ef-0x0;var _0x3e8363=_0x2e31[_0x35c3ef];return _0x3e8363;};'use strict';var Sequelize=require(_0x12e3('0x0'));module[_0x12e3('0x1')]={'name':{'type':Sequelize[_0x12e3('0x2')],'unique':_0x12e3('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x12e3('0x2')]},'description':{'type':Sequelize[_0x12e3('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 3e8c598..5529570 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 _0x8328=['UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','UserProfileResource','error','stack','name','index','map','SquareOdbc','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','ODBC'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x8328,0x169));var _0x8832=function(_0x445c82,_0x447134){_0x445c82=_0x445c82-0x0;var _0x95d454=_0x8328[_0x445c82];return _0x95d454;};'use strict';var emlformat=require(_0x8832('0x0'));var rimraf=require(_0x8832('0x1'));var zipdir=require(_0x8832('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8832('0x3'));var moment=require(_0x8832('0x4'));var BPromise=require(_0x8832('0x5'));var Mustache=require(_0x8832('0x6'));var util=require(_0x8832('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8832('0x8'));var ejs=require(_0x8832('0x9'));var fs=require('fs');var fs_extra=require(_0x8832('0xa'));var _=require(_0x8832('0xb'));var squel=require('squel');var crypto=require(_0x8832('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8832('0xd'));var toCsv=require(_0x8832('0x8'));var querystring=require(_0x8832('0xe'));var Papa=require(_0x8832('0xf'));var Redis=require('ioredis');var authService=require(_0x8832('0x10'));var qs=require(_0x8832('0x11'));var as=require(_0x8832('0x12'));var hardwareService=require(_0x8832('0x13'));var logger=require(_0x8832('0x14'))(_0x8832('0x15'));var utils=require(_0x8832('0x16'));var config=require(_0x8832('0x17'));var licenseUtil=require(_0x8832('0x18'));var db=require(_0x8832('0x19'))['db'];function respondWithStatusCode(_0x5e12af,_0x3a7675){_0x3a7675=_0x3a7675||0xcc;return function(_0x387edd){if(_0x387edd){return _0x5e12af[_0x8832('0x1a')](_0x3a7675);}return _0x5e12af[_0x8832('0x1b')](_0x3a7675)[_0x8832('0x1c')]();};}function respondWithResult(_0x3f3a45,_0x55968f){_0x55968f=_0x55968f||0xc8;return function(_0x18c2eb){if(_0x18c2eb){return _0x3f3a45['status'](_0x55968f)[_0x8832('0x1d')](_0x18c2eb);}};}function respondWithFilteredResult(_0xa60688,_0x2baada){return function(_0x51b366){if(_0x51b366){var _0x1f1db2=typeof _0x2baada[_0x8832('0x1e')]===_0x8832('0x1f')&&typeof _0x2baada[_0x8832('0x20')]===_0x8832('0x1f');var _0x4f4e12=_0x51b366[_0x8832('0x21')];var _0x1c7a41=_0x1f1db2?0x0:_0x2baada[_0x8832('0x1e')];var _0x587b0c=_0x1f1db2?_0x51b366[_0x8832('0x21')]:_0x2baada[_0x8832('0x1e')]+_0x2baada['limit'];var _0x835b53;if(_0x587b0c>=_0x4f4e12){_0x587b0c=_0x4f4e12;_0x835b53=0xc8;}else{_0x835b53=0xce;}_0xa60688[_0x8832('0x1b')](_0x835b53);return _0xa60688[_0x8832('0x22')](_0x8832('0x23'),_0x1c7a41+'-'+_0x587b0c+'/'+_0x4f4e12)[_0x8832('0x1d')](_0x51b366);}return null;};}function patchUpdates(_0x22f6b6){return function(_0x3619ae){try{jsonpatch[_0x8832('0x24')](_0x3619ae,_0x22f6b6,!![]);}catch(_0x1f69b6){return BPromise[_0x8832('0x25')](_0x1f69b6);}return _0x3619ae[_0x8832('0x26')]();};}function saveUpdates(_0x475cb3,_0x5104fe){return function(_0x58c2ff){if(_0x58c2ff){return _0x58c2ff[_0x8832('0x27')](_0x475cb3)[_0x8832('0x28')](function(_0x25837c){return _0x25837c;});}return null;};}function removeEntity(_0x19ad7d,_0x5a7024){return function(_0x1c4cdf){if(_0x1c4cdf){return _0x1c4cdf['destroy']()['then'](function(){var _0x952299=_0x1c4cdf['get']({'plain':!![]});var _0x2947cf='ODBC';return db[_0x8832('0x29')]['destroy']({'where':{'type':_0x2947cf,'resourceId':_0x952299['id']}})['then'](function(){return _0x1c4cdf;});})[_0x8832('0x28')](function(){_0x19ad7d[_0x8832('0x1b')](0xcc)[_0x8832('0x1c')]();});}};}function handleEntityNotFound(_0x2afbb9,_0x23e543){return function(_0x111a4b){if(!_0x111a4b){_0x2afbb9[_0x8832('0x1a')](0x194);}return _0x111a4b;};}function handleError(_0x34a1e2,_0x164c93){_0x164c93=_0x164c93||0x1f4;return function(_0x4092b7){logger[_0x8832('0x2a')](_0x4092b7[_0x8832('0x2b')]);if(_0x4092b7[_0x8832('0x2c')]){delete _0x4092b7[_0x8832('0x2c')];}_0x34a1e2['status'](_0x164c93)['send'](_0x4092b7);};}exports[_0x8832('0x2d')]=function(_0x3a12a8,_0x486817){var _0x53a0e2={},_0x7a2221={},_0x25981a={'count':0x0,'rows':[]};var _0x2a1879=_[_0x8832('0x2e')](db[_0x8832('0x2f')][_0x8832('0x30')],function(_0x5c8087){return{'name':_0x5c8087['fieldName'],'type':_0x5c8087[_0x8832('0x31')]['key']};});_0x7a2221[_0x8832('0x32')]=_[_0x8832('0x2e')](_0x2a1879,_0x8832('0x2c'));_0x7a2221[_0x8832('0x33')]=_[_0x8832('0x34')](_0x3a12a8[_0x8832('0x33')]);_0x7a2221['filters']=_['intersection'](_0x7a2221[_0x8832('0x32')],_0x7a2221[_0x8832('0x33')]);_0x53a0e2['attributes']=_[_0x8832('0x35')](_0x7a2221[_0x8832('0x32')],qs['fields'](_0x3a12a8['query'][_0x8832('0x36')]));_0x53a0e2[_0x8832('0x37')]=_0x53a0e2[_0x8832('0x37')][_0x8832('0x38')]?_0x53a0e2[_0x8832('0x37')]:_0x7a2221[_0x8832('0x32')];if(!_0x3a12a8[_0x8832('0x33')][_0x8832('0x39')](_0x8832('0x3a'))){_0x53a0e2[_0x8832('0x20')]=qs[_0x8832('0x20')](_0x3a12a8[_0x8832('0x33')][_0x8832('0x20')]);_0x53a0e2[_0x8832('0x1e')]=qs[_0x8832('0x1e')](_0x3a12a8[_0x8832('0x33')]['offset']);}_0x53a0e2[_0x8832('0x3b')]=qs[_0x8832('0x3c')](_0x3a12a8['query'][_0x8832('0x3c')]);_0x53a0e2['where']=qs[_0x8832('0x3d')](_['pick'](_0x3a12a8[_0x8832('0x33')],_0x7a2221[_0x8832('0x3d')]),_0x2a1879);if(_0x3a12a8['query'][_0x8832('0x3e')]){_0x53a0e2[_0x8832('0x3f')]=_[_0x8832('0x40')](_0x53a0e2[_0x8832('0x3f')],{'$or':_[_0x8832('0x2e')](_0x2a1879,function(_0x25106f){if(_0x25106f['type']!=='VIRTUAL'){var _0x28cf1f={};_0x28cf1f[_0x25106f[_0x8832('0x2c')]]={'$like':'%'+_0x3a12a8[_0x8832('0x33')][_0x8832('0x3e')]+'%'};return _0x28cf1f;}})});}_0x53a0e2=_[_0x8832('0x40')]({},_0x53a0e2,_0x3a12a8[_0x8832('0x41')]);var _0x2d4e29={'where':_0x53a0e2[_0x8832('0x3f')]};return db[_0x8832('0x2f')][_0x8832('0x21')](_0x2d4e29)[_0x8832('0x28')](function(_0x4e77eb){_0x25981a[_0x8832('0x21')]=_0x4e77eb;if(_0x3a12a8[_0x8832('0x33')][_0x8832('0x42')]){_0x53a0e2[_0x8832('0x43')]=[{'all':!![]}];}return db[_0x8832('0x2f')][_0x8832('0x44')](_0x53a0e2);})['then'](function(_0x39f617){_0x25981a[_0x8832('0x45')]=_0x39f617;return _0x25981a;})[_0x8832('0x28')](respondWithFilteredResult(_0x486817,_0x53a0e2))[_0x8832('0x46')](handleError(_0x486817,null));};exports[_0x8832('0x47')]=function(_0x54da87,_0x12bcfb){var _0x4152a4={'raw':!![],'where':{'id':_0x54da87[_0x8832('0x48')]['id']}},_0x8edd46={};_0x8edd46[_0x8832('0x32')]=_[_0x8832('0x34')](db[_0x8832('0x2f')][_0x8832('0x30')]);_0x8edd46[_0x8832('0x33')]=_['keys'](_0x54da87['query']);_0x8edd46[_0x8832('0x3d')]=_[_0x8832('0x35')](_0x8edd46[_0x8832('0x32')],_0x8edd46['query']);_0x4152a4[_0x8832('0x37')]=_[_0x8832('0x35')](_0x8edd46[_0x8832('0x32')],qs[_0x8832('0x36')](_0x54da87[_0x8832('0x33')][_0x8832('0x36')]));_0x4152a4[_0x8832('0x37')]=_0x4152a4[_0x8832('0x37')]['length']?_0x4152a4['attributes']:_0x8edd46['model'];if(_0x54da87[_0x8832('0x33')]['includeAll']){_0x4152a4[_0x8832('0x43')]=[{'all':!![]}];}_0x4152a4=_['merge']({},_0x4152a4,_0x54da87[_0x8832('0x41')]);return db[_0x8832('0x2f')]['find'](_0x4152a4)[_0x8832('0x28')](handleEntityNotFound(_0x12bcfb,null))['then'](respondWithResult(_0x12bcfb,null))['catch'](handleError(_0x12bcfb,null));};exports[_0x8832('0x49')]=function(_0x4dd5c0,_0x19df5f){return db['SquareOdbc'][_0x8832('0x49')](_0x4dd5c0[_0x8832('0x4a')],{})[_0x8832('0x28')](function(_0x578f29){var _0x47fb84=_0x4dd5c0[_0x8832('0x4b')]['get']({'plain':!![]});if(!_0x47fb84)throw new Error(_0x8832('0x4c'));if(_0x47fb84['role']==='user'){var _0xa87017=_0x578f29[_0x8832('0x4d')]({'plain':!![]});var _0x46d773=_0x8832('0x4e');return db[_0x8832('0x4f')][_0x8832('0x50')]({'where':{'name':_0x46d773,'userProfileId':_0x47fb84['userProfileId']},'raw':!![]})[_0x8832('0x28')](function(_0x345a88){if(_0x345a88&&_0x345a88[_0x8832('0x51')]===0x0){return db['UserProfileResource'][_0x8832('0x49')]({'name':_0xa87017[_0x8832('0x2c')],'resourceId':_0xa87017['id'],'type':_0x345a88[_0x8832('0x2c')],'sectionId':_0x345a88['id']},{})['then'](function(){return _0x578f29;});}else{return _0x578f29;}})[_0x8832('0x46')](function(_0x3908a5){logger['error'](_0x8832('0x52'),_0x3908a5);throw _0x3908a5;});}return _0x578f29;})[_0x8832('0x28')](respondWithResult(_0x19df5f,0xc9))[_0x8832('0x46')](handleError(_0x19df5f,null));};exports[_0x8832('0x27')]=function(_0x3210bc,_0x5993a5){if(_0x3210bc[_0x8832('0x4a')]['id']){delete _0x3210bc[_0x8832('0x4a')]['id'];}return db[_0x8832('0x2f')][_0x8832('0x50')]({'where':{'id':_0x3210bc[_0x8832('0x48')]['id']}})[_0x8832('0x28')](handleEntityNotFound(_0x5993a5,null))[_0x8832('0x28')](saveUpdates(_0x3210bc[_0x8832('0x4a')],null))[_0x8832('0x28')](respondWithResult(_0x5993a5,null))[_0x8832('0x46')](handleError(_0x5993a5,null));};exports['destroy']=function(_0x439c22,_0x3289f9){return db[_0x8832('0x2f')][_0x8832('0x50')]({'where':{'id':_0x439c22[_0x8832('0x48')]['id']}})[_0x8832('0x28')](handleEntityNotFound(_0x3289f9,null))[_0x8832('0x28')](removeEntity(_0x3289f9,null))[_0x8832('0x46')](handleError(_0x3289f9,null));};exports[_0x8832('0x53')]=function(_0x1a8488,_0x22766a,_0x557374){var _0x480973;return db[_0x8832('0x2f')][_0x8832('0x50')]({'where':{'id':_0x1a8488['params']['id']},'attributes':['id',_0x8832('0x54')]})[_0x8832('0x28')](handleEntityNotFound(_0x22766a,null))[_0x8832('0x28')](function(_0x36349c){if(_0x36349c){var _0x243d94=require(_0x8832('0x55'))();_0x243d94[_0x8832('0x56')](_0x36349c['dsn']);_0x243d94[_0x8832('0x57')]();return _0x36349c;}})[_0x8832('0x28')](respondWithResult(_0x22766a,null))[_0x8832('0x46')](handleError(_0x22766a,null));}; \ No newline at end of file +var _0x17ab=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','save','then','get','ODBC','UserProfileResource','destroy','error','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','dsn','openSync','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv'];(function(_0xf74685,_0x5d4dd0){var _0x204782=function(_0x3b3e8e){while(--_0x3b3e8e){_0xf74685['push'](_0xf74685['shift']());}};_0x204782(++_0x5d4dd0);}(_0x17ab,0x1be));var _0xb17a=function(_0x49d8ae,_0x1ff10f){_0x49d8ae=_0x49d8ae-0x0;var _0x1e0547=_0x17ab[_0x49d8ae];return _0x1e0547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb17a('0x0'));var zipdir=require(_0xb17a('0x1'));var jsonpatch=require(_0xb17a('0x2'));var rp=require(_0xb17a('0x3'));var moment=require(_0xb17a('0x4'));var BPromise=require(_0xb17a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb17a('0x6'));var sox=require(_0xb17a('0x7'));var csv=require(_0xb17a('0x8'));var ejs=require(_0xb17a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb17a('0xa'));var squel=require(_0xb17a('0xb'));var crypto=require(_0xb17a('0xc'));var jsforce=require(_0xb17a('0xd'));var deskjs=require(_0xb17a('0xe'));var toCsv=require(_0xb17a('0x8'));var querystring=require(_0xb17a('0xf'));var Papa=require(_0xb17a('0x10'));var Redis=require(_0xb17a('0x11'));var authService=require(_0xb17a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb17a('0x13'));var hardwareService=require(_0xb17a('0x14'));var logger=require(_0xb17a('0x15'))(_0xb17a('0x16'));var utils=require(_0xb17a('0x17'));var config=require(_0xb17a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb17a('0x19'))['db'];function respondWithStatusCode(_0xace187,_0x2cd5a9){_0x2cd5a9=_0x2cd5a9||0xcc;return function(_0x583396){if(_0x583396){return _0xace187[_0xb17a('0x1a')](_0x2cd5a9);}return _0xace187['status'](_0x2cd5a9)[_0xb17a('0x1b')]();};}function respondWithResult(_0x103bb9,_0x512350){_0x512350=_0x512350||0xc8;return function(_0x4de1ea){if(_0x4de1ea){return _0x103bb9[_0xb17a('0x1c')](_0x512350)['json'](_0x4de1ea);}};}function respondWithFilteredResult(_0x476d52,_0x14ce5c){return function(_0x523166){if(_0x523166){var _0x2659b3=typeof _0x14ce5c['offset']===_0xb17a('0x1d')&&typeof _0x14ce5c[_0xb17a('0x1e')]==='undefined';var _0xb2000a=_0x523166[_0xb17a('0x1f')];var _0x5932f1=_0x2659b3?0x0:_0x14ce5c[_0xb17a('0x20')];var _0x4ee86d=_0x2659b3?_0x523166[_0xb17a('0x1f')]:_0x14ce5c[_0xb17a('0x20')]+_0x14ce5c[_0xb17a('0x1e')];var _0x2eecb9;if(_0x4ee86d>=_0xb2000a){_0x4ee86d=_0xb2000a;_0x2eecb9=0xc8;}else{_0x2eecb9=0xce;}_0x476d52['status'](_0x2eecb9);return _0x476d52[_0xb17a('0x21')]('Content-Range',_0x5932f1+'-'+_0x4ee86d+'/'+_0xb2000a)[_0xb17a('0x22')](_0x523166);}return null;};}function patchUpdates(_0xc8293b){return function(_0x5b97eb){try{jsonpatch[_0xb17a('0x23')](_0x5b97eb,_0xc8293b,!![]);}catch(_0x57a2fa){return BPromise['reject'](_0x57a2fa);}return _0x5b97eb[_0xb17a('0x24')]();};}function saveUpdates(_0x7bafd9,_0x3d5738){return function(_0x242fb6){if(_0x242fb6){return _0x242fb6['update'](_0x7bafd9)[_0xb17a('0x25')](function(_0x5a089a){return _0x5a089a;});}return null;};}function removeEntity(_0x1970cc,_0x3ca082){return function(_0x215a1d){if(_0x215a1d){return _0x215a1d['destroy']()[_0xb17a('0x25')](function(){var _0x330a6e=_0x215a1d[_0xb17a('0x26')]({'plain':!![]});var _0x30f90d=_0xb17a('0x27');return db[_0xb17a('0x28')][_0xb17a('0x29')]({'where':{'type':_0x30f90d,'resourceId':_0x330a6e['id']}})[_0xb17a('0x25')](function(){return _0x215a1d;});})['then'](function(){_0x1970cc[_0xb17a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277aba,_0x2f524a){return function(_0x548391){if(!_0x548391){_0x277aba[_0xb17a('0x1a')](0x194);}return _0x548391;};}function handleError(_0x2ce981,_0x523c66){_0x523c66=_0x523c66||0x1f4;return function(_0x5310ed){logger[_0xb17a('0x2a')](_0x5310ed[_0xb17a('0x2b')]);if(_0x5310ed[_0xb17a('0x2c')]){delete _0x5310ed[_0xb17a('0x2c')];}_0x2ce981[_0xb17a('0x1c')](_0x523c66)[_0xb17a('0x2d')](_0x5310ed);};}exports['index']=function(_0x506223,_0x1cb0f8){var _0x4dd8a2={},_0x263b88={},_0x654ec3={'count':0x0,'rows':[]};var _0x8ad26f=_[_0xb17a('0x2e')](db[_0xb17a('0x2f')][_0xb17a('0x30')],function(_0x4e6ea3){return{'name':_0x4e6ea3[_0xb17a('0x31')],'type':_0x4e6ea3[_0xb17a('0x32')]['key']};});_0x263b88['model']=_['map'](_0x8ad26f,_0xb17a('0x2c'));_0x263b88[_0xb17a('0x33')]=_[_0xb17a('0x34')](_0x506223['query']);_0x263b88[_0xb17a('0x35')]=_['intersection'](_0x263b88[_0xb17a('0x36')],_0x263b88[_0xb17a('0x33')]);_0x4dd8a2[_0xb17a('0x37')]=_['intersection'](_0x263b88[_0xb17a('0x36')],qs[_0xb17a('0x38')](_0x506223['query']['fields']));_0x4dd8a2[_0xb17a('0x37')]=_0x4dd8a2[_0xb17a('0x37')]['length']?_0x4dd8a2[_0xb17a('0x37')]:_0x263b88[_0xb17a('0x36')];if(!_0x506223[_0xb17a('0x33')][_0xb17a('0x39')](_0xb17a('0x3a'))){_0x4dd8a2[_0xb17a('0x1e')]=qs['limit'](_0x506223[_0xb17a('0x33')]['limit']);_0x4dd8a2[_0xb17a('0x20')]=qs['offset'](_0x506223[_0xb17a('0x33')][_0xb17a('0x20')]);}_0x4dd8a2[_0xb17a('0x3b')]=qs['sort'](_0x506223['query'][_0xb17a('0x3c')]);_0x4dd8a2[_0xb17a('0x3d')]=qs[_0xb17a('0x35')](_[_0xb17a('0x3e')](_0x506223[_0xb17a('0x33')],_0x263b88[_0xb17a('0x35')]),_0x8ad26f);if(_0x506223[_0xb17a('0x33')][_0xb17a('0x3f')]){_0x4dd8a2[_0xb17a('0x3d')]=_[_0xb17a('0x40')](_0x4dd8a2[_0xb17a('0x3d')],{'$or':_['map'](_0x8ad26f,function(_0x3bdeed){if(_0x3bdeed[_0xb17a('0x32')]!==_0xb17a('0x41')){var _0x1621e0={};_0x1621e0[_0x3bdeed[_0xb17a('0x2c')]]={'$like':'%'+_0x506223[_0xb17a('0x33')]['filter']+'%'};return _0x1621e0;}})});}_0x4dd8a2=_[_0xb17a('0x40')]({},_0x4dd8a2,_0x506223[_0xb17a('0x42')]);var _0x181829={'where':_0x4dd8a2['where']};return db[_0xb17a('0x2f')]['count'](_0x181829)[_0xb17a('0x25')](function(_0xdcee0c){_0x654ec3[_0xb17a('0x1f')]=_0xdcee0c;if(_0x506223[_0xb17a('0x33')][_0xb17a('0x43')]){_0x4dd8a2[_0xb17a('0x44')]=[{'all':!![]}];}return db[_0xb17a('0x2f')][_0xb17a('0x45')](_0x4dd8a2);})[_0xb17a('0x25')](function(_0x3fcc30){_0x654ec3[_0xb17a('0x46')]=_0x3fcc30;return _0x654ec3;})['then'](respondWithFilteredResult(_0x1cb0f8,_0x4dd8a2))[_0xb17a('0x47')](handleError(_0x1cb0f8,null));};exports[_0xb17a('0x48')]=function(_0x189400,_0x3b0a4a){var _0x41ee13={'raw':!![],'where':{'id':_0x189400[_0xb17a('0x49')]['id']}},_0x5d075a={};_0x5d075a[_0xb17a('0x36')]=_[_0xb17a('0x34')](db[_0xb17a('0x2f')]['rawAttributes']);_0x5d075a[_0xb17a('0x33')]=_[_0xb17a('0x34')](_0x189400[_0xb17a('0x33')]);_0x5d075a['filters']=_[_0xb17a('0x4a')](_0x5d075a[_0xb17a('0x36')],_0x5d075a[_0xb17a('0x33')]);_0x41ee13[_0xb17a('0x37')]=_[_0xb17a('0x4a')](_0x5d075a[_0xb17a('0x36')],qs[_0xb17a('0x38')](_0x189400[_0xb17a('0x33')][_0xb17a('0x38')]));_0x41ee13[_0xb17a('0x37')]=_0x41ee13[_0xb17a('0x37')][_0xb17a('0x4b')]?_0x41ee13[_0xb17a('0x37')]:_0x5d075a[_0xb17a('0x36')];if(_0x189400[_0xb17a('0x33')][_0xb17a('0x43')]){_0x41ee13[_0xb17a('0x44')]=[{'all':!![]}];}_0x41ee13=_[_0xb17a('0x40')]({},_0x41ee13,_0x189400['options']);return db['SquareOdbc'][_0xb17a('0x4c')](_0x41ee13)['then'](handleEntityNotFound(_0x3b0a4a,null))[_0xb17a('0x25')](respondWithResult(_0x3b0a4a,null))[_0xb17a('0x47')](handleError(_0x3b0a4a,null));};exports[_0xb17a('0x4d')]=function(_0x5807e2,_0x4d2925){return db[_0xb17a('0x2f')][_0xb17a('0x4d')](_0x5807e2[_0xb17a('0x4e')],{})[_0xb17a('0x25')](function(_0x4a8da1){var _0x3d93fc=_0x5807e2[_0xb17a('0x4f')][_0xb17a('0x26')]({'plain':!![]});if(!_0x3d93fc)throw new Error(_0xb17a('0x50'));if(_0x3d93fc[_0xb17a('0x51')]===_0xb17a('0x4f')){var _0x2c3868=_0x4a8da1[_0xb17a('0x26')]({'plain':!![]});var _0x3a9960=_0xb17a('0x27');return db[_0xb17a('0x52')]['find']({'where':{'name':_0x3a9960,'userProfileId':_0x3d93fc[_0xb17a('0x53')]},'raw':!![]})['then'](function(_0x4b8032){if(_0x4b8032&&_0x4b8032[_0xb17a('0x54')]===0x0){return db[_0xb17a('0x28')][_0xb17a('0x4d')]({'name':_0x2c3868['name'],'resourceId':_0x2c3868['id'],'type':_0x4b8032[_0xb17a('0x2c')],'sectionId':_0x4b8032['id']},{})[_0xb17a('0x25')](function(){return _0x4a8da1;});}else{return _0x4a8da1;}})[_0xb17a('0x47')](function(_0x4c551a){logger[_0xb17a('0x2a')](_0xb17a('0x55'),_0x4c551a);throw _0x4c551a;});}return _0x4a8da1;})[_0xb17a('0x25')](respondWithResult(_0x4d2925,0xc9))[_0xb17a('0x47')](handleError(_0x4d2925,null));};exports[_0xb17a('0x56')]=function(_0x267f9f,_0x283d6b){if(_0x267f9f[_0xb17a('0x4e')]['id']){delete _0x267f9f[_0xb17a('0x4e')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x267f9f[_0xb17a('0x49')]['id']}})[_0xb17a('0x25')](handleEntityNotFound(_0x283d6b,null))['then'](saveUpdates(_0x267f9f[_0xb17a('0x4e')],null))['then'](respondWithResult(_0x283d6b,null))[_0xb17a('0x47')](handleError(_0x283d6b,null));};exports[_0xb17a('0x29')]=function(_0x487748,_0xbee9c7){return db['SquareOdbc']['find']({'where':{'id':_0x487748[_0xb17a('0x49')]['id']}})[_0xb17a('0x25')](handleEntityNotFound(_0xbee9c7,null))[_0xb17a('0x25')](removeEntity(_0xbee9c7,null))[_0xb17a('0x47')](handleError(_0xbee9c7,null));};exports[_0xb17a('0x57')]=function(_0x1c78cf,_0x347b47,_0xc363d1){var _0x2a9fa6;return db[_0xb17a('0x2f')][_0xb17a('0x4c')]({'where':{'id':_0x1c78cf[_0xb17a('0x49')]['id']},'attributes':['id',_0xb17a('0x58')]})[_0xb17a('0x25')](handleEntityNotFound(_0x347b47,null))[_0xb17a('0x25')](function(_0x495162){if(_0x495162){var _0x5ea492=require('odbc')();_0x5ea492[_0xb17a('0x59')](_0x495162[_0xb17a('0x58')]);_0x5ea492[_0xb17a('0x5a')]();return _0x495162;}})[_0xb17a('0x25')](respondWithResult(_0x347b47,null))[_0xb17a('0x47')](handleError(_0x347b47,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 2d0d600..19b8749 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 _0x88d0=['bluebird','request-promise','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment'];(function(_0x464837,_0x41b71c){var _0x20f0be=function(_0x242bc5){while(--_0x242bc5){_0x464837['push'](_0x464837['shift']());}};_0x20f0be(++_0x41b71c);}(_0x88d0,0x127));var _0x088d=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x88d0[_0x497b1e];return _0x3f72e1;};'use strict';var _=require(_0x088d('0x0'));var util=require(_0x088d('0x1'));var logger=require(_0x088d('0x2'))(_0x088d('0x3'));var moment=require(_0x088d('0x4'));var BPromise=require(_0x088d('0x5'));var rp=require(_0x088d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x088d('0x7')]=function(_0x594a18,_0x4b5c25){return _0x594a18['define'](_0x088d('0x8'),attributes,{'tableName':_0x088d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1bd7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util'];(function(_0x1977ee,_0x2bffdd){var _0x31ecbd=function(_0x134541){while(--_0x134541){_0x1977ee['push'](_0x1977ee['shift']());}};_0x31ecbd(++_0x2bffdd);}(_0x1bd7,0xce));var _0x71bd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bd7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x71bd('0x0'));var util=require(_0x71bd('0x1'));var logger=require(_0x71bd('0x2'))(_0x71bd('0x3'));var moment=require(_0x71bd('0x4'));var BPromise=require(_0x71bd('0x5'));var rp=require(_0x71bd('0x6'));var fs=require('fs');var path=require(_0x71bd('0x7'));var rimraf=require(_0x71bd('0x8'));var config=require('../../config/environment');var attributes=require(_0x71bd('0x9'));module[_0x71bd('0xa')]=function(_0x21efc7,_0x26ee63){return _0x21efc7[_0x71bd('0xb')](_0x71bd('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 3d79429..81176f5 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 _0xc995=['model','attributes','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find','options','where','include','map'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0xc995,0x18f));var _0x5c99=function(_0x3448a4,_0x59c763){_0x3448a4=_0x3448a4-0x0;var _0x18037d=_0xc995[_0x3448a4];return _0x18037d;};'use strict';var _=require(_0x5c99('0x0'));var util=require('util');var moment=require(_0x5c99('0x1'));var BPromise=require(_0x5c99('0x2'));var rs=require(_0x5c99('0x3'));var fs=require('fs');var Redis=require(_0x5c99('0x4'));var db=require(_0x5c99('0x5'))['db'];var utils=require(_0x5c99('0x6'));var logger=require(_0x5c99('0x7'))('rpc');var config=require(_0x5c99('0x8'));var jayson=require(_0x5c99('0x9'));var client=jayson[_0x5c99('0xa')][_0x5c99('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45a442,_0x14ec1c,_0x4dc80e){return new BPromise(function(_0x3617eb,_0x30974e){return client[_0x5c99('0xc')](_0x45a442,_0x4dc80e)['then'](function(_0x14e359){logger['info'](_0x5c99('0xd'),_0x14ec1c,_0x5c99('0xe'));logger[_0x5c99('0xf')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x14ec1c,_0x5c99('0xe'),JSON[_0x5c99('0x10')](_0x14e359));if(_0x14e359[_0x5c99('0x11')]){if(_0x14e359[_0x5c99('0x11')][_0x5c99('0x12')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x14ec1c,_0x14e359[_0x5c99('0x11')]['message']);return _0x30974e(_0x14e359[_0x5c99('0x11')][_0x5c99('0x13')]);}logger[_0x5c99('0x11')](_0x5c99('0xd'),_0x14ec1c,_0x14e359[_0x5c99('0x11')][_0x5c99('0x13')]);return _0x3617eb(_0x14e359[_0x5c99('0x11')][_0x5c99('0x13')]);}else{logger[_0x5c99('0x14')](_0x5c99('0xd'),_0x14ec1c,_0x5c99('0xe'));_0x3617eb(_0x14e359[_0x5c99('0x15')][_0x5c99('0x13')]);}})[_0x5c99('0x16')](function(_0x10eb2e){logger['error'](_0x5c99('0xd'),_0x14ec1c,_0x10eb2e);_0x30974e(_0x10eb2e);});});}exports[_0x5c99('0x17')]=function(_0x2cca83){var _0xc9b753=this;return new Promise(function(_0x17be78,_0x1405d0){return db[_0x5c99('0x18')][_0x5c99('0x19')]({'raw':_0x2cca83[_0x5c99('0x1a')]?_0x2cca83[_0x5c99('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2cca83[_0x5c99('0x1a')]?_0x2cca83['options'][_0x5c99('0x1b')]||null:null,'attributes':_0x2cca83[_0x5c99('0x1a')]?_0x2cca83[_0x5c99('0x1a')]['attributes']||null:null,'include':_0x2cca83['options']?_0x2cca83[_0x5c99('0x1a')][_0x5c99('0x1c')]?_[_0x5c99('0x1d')](_0x2cca83[_0x5c99('0x1a')][_0x5c99('0x1c')],function(_0x42a114){return{'model':db[_0x42a114[_0x5c99('0x1e')]],'as':_0x42a114['as'],'attributes':_0x42a114[_0x5c99('0x1f')],'include':_0x42a114[_0x5c99('0x1c')]?_[_0x5c99('0x1d')](_0x42a114[_0x5c99('0x1c')],function(_0x2a6fbf){return{'model':db[_0x2a6fbf[_0x5c99('0x1e')]],'as':_0x2a6fbf['as'],'attributes':_0x2a6fbf[_0x5c99('0x1f')],'include':_0x2a6fbf[_0x5c99('0x1c')]?_[_0x5c99('0x1d')](_0x2a6fbf[_0x5c99('0x1c')],function(_0x8b9382){return{'model':db[_0x8b9382[_0x5c99('0x1e')]],'as':_0x8b9382['as'],'attributes':_0x8b9382[_0x5c99('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5c99('0x20')](function(_0x282579){logger['info']('ShowSquareOdbc',_0x2cca83);logger[_0x5c99('0xf')](_0x5c99('0x17'),_0x2cca83,JSON[_0x5c99('0x10')](_0x282579));_0x17be78(_0x282579);})[_0x5c99('0x16')](function(_0x332470){logger[_0x5c99('0x11')](_0x5c99('0x17'),_0x332470[_0x5c99('0x13')],_0x2cca83);_0x1405d0(_0xc9b753['error'](0x1f4,_0x332470['message']));});});}; \ No newline at end of file +var _0x2df2=['info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SquareOdbc','find','options','raw','attributes','map','include','model','ShowSquareOdbc','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','request','then'];(function(_0x4a0c72,_0x4db3a3){var _0x37763b=function(_0x5e7f7e){while(--_0x5e7f7e){_0x4a0c72['push'](_0x4a0c72['shift']());}};_0x37763b(++_0x4db3a3);}(_0x2df2,0x12b));var _0x22df=function(_0x20be6c,_0x544e09){_0x20be6c=_0x20be6c-0x0;var _0x117c8d=_0x2df2[_0x20be6c];return _0x117c8d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x22df('0x0'));var rs=require(_0x22df('0x1'));var fs=require('fs');var Redis=require(_0x22df('0x2'));var db=require(_0x22df('0x3'))['db'];var utils=require(_0x22df('0x4'));var logger=require(_0x22df('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x22df('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x460efa,_0x5e1a30,_0x26f461){return new BPromise(function(_0x19afba,_0x5da87c){return client[_0x22df('0x7')](_0x460efa,_0x26f461)[_0x22df('0x8')](function(_0x42335d){logger[_0x22df('0x9')](_0x22df('0xa'),_0x5e1a30,'request\x20sent');logger[_0x22df('0xb')](_0x22df('0xc'),_0x5e1a30,_0x22df('0xd'),JSON[_0x22df('0xe')](_0x42335d));if(_0x42335d[_0x22df('0xf')]){if(_0x42335d[_0x22df('0xf')][_0x22df('0x10')]===0x1f4){logger[_0x22df('0xf')](_0x22df('0xa'),_0x5e1a30,_0x42335d[_0x22df('0xf')]['message']);return _0x5da87c(_0x42335d[_0x22df('0xf')][_0x22df('0x11')]);}logger[_0x22df('0xf')](_0x22df('0xa'),_0x5e1a30,_0x42335d[_0x22df('0xf')]['message']);return _0x19afba(_0x42335d[_0x22df('0xf')]['message']);}else{logger[_0x22df('0x9')](_0x22df('0xa'),_0x5e1a30,'request\x20sent');_0x19afba(_0x42335d['result']['message']);}})[_0x22df('0x12')](function(_0x2f505e){logger['error'](_0x22df('0xa'),_0x5e1a30,_0x2f505e);_0x5da87c(_0x2f505e);});});}exports['ShowSquareOdbc']=function(_0x4d4eaa){var _0x1803e1=this;return new Promise(function(_0x5c6cd6,_0x5f4ddb){return db[_0x22df('0x13')][_0x22df('0x14')]({'raw':_0x4d4eaa[_0x22df('0x15')]?_0x4d4eaa[_0x22df('0x15')][_0x22df('0x16')]===undefined?!![]:![]:!![],'where':_0x4d4eaa[_0x22df('0x15')]?_0x4d4eaa[_0x22df('0x15')]['where']||null:null,'attributes':_0x4d4eaa[_0x22df('0x15')]?_0x4d4eaa[_0x22df('0x15')][_0x22df('0x17')]||null:null,'include':_0x4d4eaa[_0x22df('0x15')]?_0x4d4eaa['options']['include']?_[_0x22df('0x18')](_0x4d4eaa[_0x22df('0x15')][_0x22df('0x19')],function(_0x3655a8){return{'model':db[_0x3655a8[_0x22df('0x1a')]],'as':_0x3655a8['as'],'attributes':_0x3655a8[_0x22df('0x17')],'include':_0x3655a8[_0x22df('0x19')]?_[_0x22df('0x18')](_0x3655a8[_0x22df('0x19')],function(_0x23ea12){return{'model':db[_0x23ea12['model']],'as':_0x23ea12['as'],'attributes':_0x23ea12[_0x22df('0x17')],'include':_0x23ea12[_0x22df('0x19')]?_['map'](_0x23ea12['include'],function(_0x375fee){return{'model':db[_0x375fee[_0x22df('0x1a')]],'as':_0x375fee['as'],'attributes':_0x375fee[_0x22df('0x17')]};}):[]};}):[]};}):[]:[]})[_0x22df('0x8')](function(_0xa65cbb){logger['info'](_0x22df('0x1b'),_0x4d4eaa);logger[_0x22df('0xb')](_0x22df('0x1b'),_0x4d4eaa,JSON[_0x22df('0xe')](_0xa65cbb));_0x5c6cd6(_0xa65cbb);})[_0x22df('0x12')](function(_0x495853){logger[_0x22df('0xf')](_0x22df('0x1b'),_0x495853[_0x22df('0x11')],_0x4d4eaa);_0x5f4ddb(_0x1803e1[_0x22df('0xf')](0x1f4,_0x495853[_0x22df('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index f639352..d773e03 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 _0xb43c=['/:id/users','create','post','update','delete','destroy','removeUsers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb43c,0x1ea));var _0xcb43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb43c[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xcb43('0x0'));var util=require(_0xcb43('0x1'));var path=require(_0xcb43('0x2'));var timeout=require(_0xcb43('0x3'));var express=require(_0xcb43('0x4'));var router=express[_0xcb43('0x5')]();var fs_extra=require(_0xcb43('0x6'));var auth=require(_0xcb43('0x7'));var interaction=require(_0xcb43('0x8'));var config=require(_0xcb43('0x9'));var controller=require(_0xcb43('0xa'));router[_0xcb43('0xb')]('/',auth['isAuthenticated'](),controller[_0xcb43('0xc')]);router[_0xcb43('0xb')](_0xcb43('0xd'),auth[_0xcb43('0xe')](),controller[_0xcb43('0xf')]);router['get'](_0xcb43('0x10'),auth[_0xcb43('0xe')](),controller['getUsers']);router['post']('/',auth[_0xcb43('0xe')](),controller[_0xcb43('0x11')]);router[_0xcb43('0x12')](_0xcb43('0x10'),auth[_0xcb43('0xe')](),controller['addUsers']);router['put']('/:id',auth[_0xcb43('0xe')](),controller[_0xcb43('0x13')]);router[_0xcb43('0x14')](_0xcb43('0xd'),auth['isAuthenticated'](),controller[_0xcb43('0x15')]);router[_0xcb43('0x14')](_0xcb43('0x10'),auth[_0xcb43('0xe')](),controller[_0xcb43('0x16')]);module['exports']=router; \ No newline at end of file +var _0x4178=['/:id/users','addUsers','put','delete','destroy','removeUsers','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','getUsers','post','create'];(function(_0x209513,_0x3665aa){var _0x442761=function(_0x5314f9){while(--_0x5314f9){_0x209513['push'](_0x209513['shift']());}};_0x442761(++_0x3665aa);}(_0x4178,0x7f));var _0x8417=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4178[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x8417('0x0'));var path=require(_0x8417('0x1'));var timeout=require(_0x8417('0x2'));var express=require('express');var router=express[_0x8417('0x3')]();var fs_extra=require(_0x8417('0x4'));var auth=require(_0x8417('0x5'));var interaction=require(_0x8417('0x6'));var config=require(_0x8417('0x7'));var controller=require(_0x8417('0x8'));router[_0x8417('0x9')]('/',auth[_0x8417('0xa')](),controller[_0x8417('0xb')]);router[_0x8417('0x9')](_0x8417('0xc'),auth['isAuthenticated'](),controller[_0x8417('0xd')]);router[_0x8417('0x9')]('/:id/users',auth[_0x8417('0xa')](),controller[_0x8417('0xe')]);router[_0x8417('0xf')]('/',auth[_0x8417('0xa')](),controller[_0x8417('0x10')]);router[_0x8417('0xf')](_0x8417('0x11'),auth['isAuthenticated'](),controller[_0x8417('0x12')]);router[_0x8417('0x13')](_0x8417('0xc'),auth[_0x8417('0xa')](),controller['update']);router[_0x8417('0x14')](_0x8417('0xc'),auth[_0x8417('0xa')](),controller[_0x8417('0x15')]);router[_0x8417('0x14')]('/:id/users',auth[_0x8417('0xa')](),controller[_0x8417('0x16')]);module[_0x8417('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 cde35e1..0eae7ea 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 _0xc17b=['getDataValue','preproduction','utf8','production','toString','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long'];(function(_0x35c83f,_0x3dbed0){var _0xb2c150=function(_0x1d53ea){while(--_0x1d53ea){_0x35c83f['push'](_0x35c83f['shift']());}};_0xb2c150(++_0x3dbed0);}(_0xc17b,0xa2));var _0xbc17=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc17b[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require(_0xbc17('0x0'));module[_0xbc17('0x1')]={'name':{'type':Sequelize[_0xbc17('0x2')],'unique':_0xbc17('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbc17('0x2')]},'notes':{'type':Sequelize[_0xbc17('0x4')]},'preproduction':{'type':Sequelize[_0xbc17('0x5')](_0xbc17('0x6')),'get':function(){if(this[_0xbc17('0x7')]('preproduction')){return this[_0xbc17('0x7')](_0xbc17('0x8'))['toString'](_0xbc17('0x9'));}}},'production':{'type':Sequelize[_0xbc17('0x5')]('long'),'get':function(){if(this['getDataValue']('production')){return this[_0xbc17('0x7')](_0xbc17('0xa'))[_0xbc17('0xb')](_0xbc17('0x9'));}}},'savedAt':{'type':Sequelize[_0xbc17('0xc')]},'publishedAt':{'type':Sequelize[_0xbc17('0xc')]}}; \ No newline at end of file +var _0xbf91=['preproduction','utf8','long','production','toString','DATE','sequelize','STRING','TEXT','BLOB','getDataValue'];(function(_0x4bf244,_0x9b992d){var _0x5c6eb9=function(_0x2276d7){while(--_0x2276d7){_0x4bf244['push'](_0x4bf244['shift']());}};_0x5c6eb9(++_0x9b992d);}(_0xbf91,0xc1));var _0x1bf9=function(_0x28c5ba,_0x480ba4){_0x28c5ba=_0x28c5ba-0x0;var _0x64adc8=_0xbf91[_0x28c5ba];return _0x64adc8;};'use strict';var Sequelize=require(_0x1bf9('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bf9('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x1bf9('0x2')]},'preproduction':{'type':Sequelize[_0x1bf9('0x3')]('long'),'get':function(){if(this[_0x1bf9('0x4')](_0x1bf9('0x5'))){return this[_0x1bf9('0x4')]('preproduction')['toString'](_0x1bf9('0x6'));}}},'production':{'type':Sequelize['BLOB'](_0x1bf9('0x7')),'get':function(){if(this['getDataValue'](_0x1bf9('0x8'))){return this[_0x1bf9('0x4')](_0x1bf9('0x8'))[_0x1bf9('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0x1bf9('0xa')]},'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 5f4f13d..30ad47a 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 _0x6d7f=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','SquareProject','rows','catch','params','keys','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','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','socket.io-emitter','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','destroy','get','UserProfileResource','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6d7f,0xd9));var _0xf6d7=function(_0x486890,_0x55865e){_0x486890=_0x486890-0x0;var _0x343b0e=_0x6d7f[_0x486890];return _0x343b0e;};'use strict';var emlformat=require(_0xf6d7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf6d7('0x1'));var jsonpatch=require(_0xf6d7('0x2'));var rp=require(_0xf6d7('0x3'));var moment=require(_0xf6d7('0x4'));var BPromise=require(_0xf6d7('0x5'));var Mustache=require(_0xf6d7('0x6'));var util=require(_0xf6d7('0x7'));var path=require(_0xf6d7('0x8'));var sox=require(_0xf6d7('0x9'));var csv=require(_0xf6d7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6d7('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf6d7('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6d7('0xa'));var querystring=require('querystring');var Papa=require(_0xf6d7('0xd'));var Redis=require(_0xf6d7('0xe'));var authService=require(_0xf6d7('0xf'));var qs=require(_0xf6d7('0x10'));var as=require(_0xf6d7('0x11'));var hardwareService=require(_0xf6d7('0x12'));var logger=require(_0xf6d7('0x13'))(_0xf6d7('0x14'));var utils=require(_0xf6d7('0x15'));var config=require(_0xf6d7('0x16'));var licenseUtil=require(_0xf6d7('0x17'));var db=require('../../mysqldb')['db'];config[_0xf6d7('0x18')]=_['defaults'](config[_0xf6d7('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf6d7('0x19'))(new Redis(config['redis']));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x4c4d65,_0x5eb588){_0x5eb588=_0x5eb588||0xcc;return function(_0x29038a){if(_0x29038a){return _0x4c4d65[_0xf6d7('0x1a')](_0x5eb588);}return _0x4c4d65[_0xf6d7('0x1b')](_0x5eb588)[_0xf6d7('0x1c')]();};}function respondWithResult(_0x14f38b,_0xc18362){_0xc18362=_0xc18362||0xc8;return function(_0x17e181){if(_0x17e181){return _0x14f38b[_0xf6d7('0x1b')](_0xc18362)[_0xf6d7('0x1d')](_0x17e181);}};}function respondWithFilteredResult(_0x168149,_0x259801){return function(_0xc737e5){if(_0xc737e5){var _0x2bed1=typeof _0x259801['offset']===_0xf6d7('0x1e')&&typeof _0x259801[_0xf6d7('0x1f')]==='undefined';var _0x5a621f=_0xc737e5[_0xf6d7('0x20')];var _0x3c8397=_0x2bed1?0x0:_0x259801[_0xf6d7('0x21')];var _0x474899=_0x2bed1?_0xc737e5[_0xf6d7('0x20')]:_0x259801[_0xf6d7('0x21')]+_0x259801[_0xf6d7('0x1f')];var _0x3417bc;if(_0x474899>=_0x5a621f){_0x474899=_0x5a621f;_0x3417bc=0xc8;}else{_0x3417bc=0xce;}_0x168149['status'](_0x3417bc);return _0x168149['set'](_0xf6d7('0x22'),_0x3c8397+'-'+_0x474899+'/'+_0x5a621f)[_0xf6d7('0x1d')](_0xc737e5);}return null;};}function patchUpdates(_0x211048){return function(_0x112181){try{jsonpatch[_0xf6d7('0x23')](_0x112181,_0x211048,!![]);}catch(_0x269d3c){return BPromise['reject'](_0x269d3c);}return _0x112181[_0xf6d7('0x24')]();};}function saveUpdates(_0x50c465,_0x1b78ce){return function(_0x39efdc){if(_0x39efdc){return _0x39efdc[_0xf6d7('0x25')](_0x50c465)['then'](function(_0x3ff34f){return _0x3ff34f;});}return null;};}function removeEntity(_0x210d2a,_0x361f1c){return function(_0x7b90de){if(_0x7b90de){return _0x7b90de[_0xf6d7('0x26')]()['then'](function(){var _0x1c49f0=_0x7b90de[_0xf6d7('0x27')]({'plain':!![]});var _0x493a62='SquareProjects';return db[_0xf6d7('0x28')]['destroy']({'where':{'type':_0x493a62,'resourceId':_0x1c49f0['id']}})['then'](function(){return _0x7b90de;});})[_0xf6d7('0x29')](function(){_0x210d2a[_0xf6d7('0x1b')](0xcc)[_0xf6d7('0x1c')]();});}};}function handleEntityNotFound(_0x11ccb1,_0x3c531a){return function(_0x5b1b24){if(!_0x5b1b24){_0x11ccb1['sendStatus'](0x194);}return _0x5b1b24;};}function handleError(_0x13d9be,_0x1cfad7){_0x1cfad7=_0x1cfad7||0x1f4;return function(_0xd3fe16){logger[_0xf6d7('0x2a')](_0xd3fe16[_0xf6d7('0x2b')]);if(_0xd3fe16['name']){delete _0xd3fe16[_0xf6d7('0x2c')];}_0x13d9be[_0xf6d7('0x1b')](_0x1cfad7)[_0xf6d7('0x2d')](_0xd3fe16);};}exports[_0xf6d7('0x2e')]=function(_0x4b6807,_0x1eb586){var _0x1e52a9={},_0x226447={},_0x4ead80={'count':0x0,'rows':[]};var _0x57cb96=_[_0xf6d7('0x2f')](db['SquareProject'][_0xf6d7('0x30')],function(_0x1a57df){return{'name':_0x1a57df[_0xf6d7('0x31')],'type':_0x1a57df[_0xf6d7('0x32')][_0xf6d7('0x33')]};});_0x226447[_0xf6d7('0x34')]=_[_0xf6d7('0x2f')](_0x57cb96,_0xf6d7('0x2c'));_0x226447['query']=_['keys'](_0x4b6807[_0xf6d7('0x35')]);_0x226447[_0xf6d7('0x36')]=_[_0xf6d7('0x37')](_0x226447[_0xf6d7('0x34')],_0x226447[_0xf6d7('0x35')]);_0x1e52a9[_0xf6d7('0x38')]=_[_0xf6d7('0x37')](_0x226447[_0xf6d7('0x34')],qs[_0xf6d7('0x39')](_0x4b6807['query'][_0xf6d7('0x39')]));_0x1e52a9[_0xf6d7('0x38')]=_0x1e52a9[_0xf6d7('0x38')][_0xf6d7('0x3a')]?_0x1e52a9[_0xf6d7('0x38')]:_0x226447[_0xf6d7('0x34')];if(!_0x4b6807[_0xf6d7('0x35')][_0xf6d7('0x3b')](_0xf6d7('0x3c'))){_0x1e52a9['limit']=qs[_0xf6d7('0x1f')](_0x4b6807[_0xf6d7('0x35')][_0xf6d7('0x1f')]);_0x1e52a9[_0xf6d7('0x21')]=qs[_0xf6d7('0x21')](_0x4b6807['query'][_0xf6d7('0x21')]);}_0x1e52a9[_0xf6d7('0x3d')]=qs[_0xf6d7('0x3e')](_0x4b6807[_0xf6d7('0x35')]['sort']);_0x1e52a9[_0xf6d7('0x3f')]=qs[_0xf6d7('0x36')](_['pick'](_0x4b6807[_0xf6d7('0x35')],_0x226447['filters']),_0x57cb96);if(_0x4b6807['query'][_0xf6d7('0x40')]){_0x1e52a9[_0xf6d7('0x3f')]=_[_0xf6d7('0x41')](_0x1e52a9[_0xf6d7('0x3f')],{'$or':_[_0xf6d7('0x2f')](_0x57cb96,function(_0x248206){if(_0x248206[_0xf6d7('0x32')]!=='VIRTUAL'){var _0x10cfd9={};_0x10cfd9[_0x248206[_0xf6d7('0x2c')]]={'$like':'%'+_0x4b6807[_0xf6d7('0x35')][_0xf6d7('0x40')]+'%'};return _0x10cfd9;}})});}_0x1e52a9=_['merge']({},_0x1e52a9,_0x4b6807[_0xf6d7('0x42')]);var _0xc739b0={'where':_0x1e52a9[_0xf6d7('0x3f')]};return db[_0xf6d7('0x43')][_0xf6d7('0x20')](_0xc739b0)[_0xf6d7('0x29')](function(_0x378dd6){_0x4ead80[_0xf6d7('0x20')]=_0x378dd6;if(_0x4b6807[_0xf6d7('0x35')]['includeAll']){_0x1e52a9['include']=[{'all':!![]}];}return db[_0xf6d7('0x43')]['findAll'](_0x1e52a9);})['then'](function(_0x494b7d){_0x4ead80[_0xf6d7('0x44')]=_0x494b7d;return _0x4ead80;})[_0xf6d7('0x29')](respondWithFilteredResult(_0x1eb586,_0x1e52a9))[_0xf6d7('0x45')](handleError(_0x1eb586,null));};exports['show']=function(_0x4135c5,_0x1273bb){var _0x1236a2={'raw':![],'where':{'id':_0x4135c5[_0xf6d7('0x46')]['id']}},_0x2f96b0={};_0x2f96b0[_0xf6d7('0x34')]=_[_0xf6d7('0x47')](db['SquareProject'][_0xf6d7('0x30')]);_0x2f96b0['query']=_[_0xf6d7('0x47')](_0x4135c5[_0xf6d7('0x35')]);_0x2f96b0[_0xf6d7('0x36')]=_['intersection'](_0x2f96b0[_0xf6d7('0x34')],_0x2f96b0[_0xf6d7('0x35')]);_0x1236a2[_0xf6d7('0x38')]=_[_0xf6d7('0x37')](_0x2f96b0[_0xf6d7('0x34')],qs[_0xf6d7('0x39')](_0x4135c5['query'][_0xf6d7('0x39')]));_0x1236a2[_0xf6d7('0x38')]=_0x1236a2[_0xf6d7('0x38')][_0xf6d7('0x3a')]?_0x1236a2[_0xf6d7('0x38')]:_0x2f96b0[_0xf6d7('0x34')];if(_0x4135c5[_0xf6d7('0x35')]['includeAll']){_0x1236a2[_0xf6d7('0x48')]=[{'all':!![]}];}_0x1236a2=_[_0xf6d7('0x41')]({},_0x1236a2,_0x4135c5[_0xf6d7('0x42')]);return db[_0xf6d7('0x43')]['find'](_0x1236a2)[_0xf6d7('0x29')](handleEntityNotFound(_0x1273bb,null))[_0xf6d7('0x29')](respondWithResult(_0x1273bb,null))[_0xf6d7('0x45')](handleError(_0x1273bb,null));};exports[_0xf6d7('0x49')]=function(_0x52f966,_0x5b2c9a){return db[_0xf6d7('0x43')][_0xf6d7('0x49')](_0x52f966[_0xf6d7('0x4a')],{})[_0xf6d7('0x29')](function(_0x5de6af){var _0x2fc19b=_0x52f966[_0xf6d7('0x4b')][_0xf6d7('0x27')]({'plain':!![]});if(!_0x2fc19b)throw new Error(_0xf6d7('0x4c'));if(_0x2fc19b[_0xf6d7('0x4d')]===_0xf6d7('0x4b')){var _0x577fe7=_0x5de6af[_0xf6d7('0x27')]({'plain':!![]});var _0x15848a='SquareProjects';return db['UserProfileSection']['find']({'where':{'name':_0x15848a,'userProfileId':_0x2fc19b[_0xf6d7('0x4e')]},'raw':!![]})[_0xf6d7('0x29')](function(_0xd97f6f){if(_0xd97f6f&&_0xd97f6f['autoAssociation']===0x0){return db['UserProfileResource'][_0xf6d7('0x49')]({'name':_0x577fe7[_0xf6d7('0x2c')],'resourceId':_0x577fe7['id'],'type':_0xd97f6f[_0xf6d7('0x2c')],'sectionId':_0xd97f6f['id']},{})[_0xf6d7('0x29')](function(){return _0x5de6af;});}else{return _0x5de6af;}})[_0xf6d7('0x45')](function(_0x4c6a72){logger[_0xf6d7('0x2a')](_0xf6d7('0x4f'),_0x4c6a72);throw _0x4c6a72;});}return _0x5de6af;})[_0xf6d7('0x29')](respondWithResult(_0x5b2c9a,0xc9))[_0xf6d7('0x45')](handleError(_0x5b2c9a,null));};exports['update']=function(_0x3c1281,_0x38e399){if(_0x3c1281[_0xf6d7('0x4a')]['id']){delete _0x3c1281['body']['id'];}return db[_0xf6d7('0x43')][_0xf6d7('0x50')]({'where':{'id':_0x3c1281[_0xf6d7('0x46')]['id']}})['then'](handleEntityNotFound(_0x38e399,null))['then'](saveUpdates(_0x3c1281['body'],null))['then'](respondWithResult(_0x38e399,null))[_0xf6d7('0x45')](handleError(_0x38e399,null));};exports[_0xf6d7('0x26')]=function(_0x446f69,_0x510afd){return db[_0xf6d7('0x43')]['find']({'where':{'id':_0x446f69[_0xf6d7('0x46')]['id']}})['then'](handleEntityNotFound(_0x510afd,null))[_0xf6d7('0x29')](removeEntity(_0x510afd,null))[_0xf6d7('0x45')](handleError(_0x510afd,null));};exports[_0xf6d7('0x51')]=function(_0x4390b1,_0x575597,_0x50d5ef){return db[_0xf6d7('0x43')][_0xf6d7('0x50')]({'where':{'id':_0x4390b1[_0xf6d7('0x46')]['id']}})[_0xf6d7('0x29')](handleEntityNotFound(_0x575597,null))[_0xf6d7('0x29')](function(_0x488488){if(_0x488488){return _0x488488[_0xf6d7('0x51')](_0x4390b1[_0xf6d7('0x4a')]['ids'],_[_0xf6d7('0x52')](_0x4390b1[_0xf6d7('0x4a')],[_0xf6d7('0x53'),'id'])||{});}})['then'](respondWithResult(_0x575597,null))[_0xf6d7('0x45')](handleError(_0x575597,null));};exports['removeUsers']=function(_0x75fe38,_0x3b33fc,_0x32480b){return db['SquareProject'][_0xf6d7('0x50')]({'where':{'id':_0x75fe38[_0xf6d7('0x46')]['id']}})[_0xf6d7('0x29')](handleEntityNotFound(_0x3b33fc,null))[_0xf6d7('0x29')](function(_0x18ef73){if(_0x18ef73){return _0x18ef73[_0xf6d7('0x54')](_0x75fe38[_0xf6d7('0x35')][_0xf6d7('0x53')])[_0xf6d7('0x29')](function(){if(_[_0xf6d7('0x55')](_0x75fe38[_0xf6d7('0x35')][_0xf6d7('0x53')])){for(var _0x3c9a2b=0x0;_0x3c9a2b<_0x75fe38[_0xf6d7('0x35')][_0xf6d7('0x53')]['length'];_0x3c9a2b+=0x1){socket[_0xf6d7('0x56')](_0xf6d7('0x57'),{'UserId':Number(_0x75fe38['query'][_0xf6d7('0x53')][_0x3c9a2b]),'SquareProjectId':Number(_0x75fe38[_0xf6d7('0x46')]['id'])});}}else{socket[_0xf6d7('0x56')]('userSquareProject:remove',{'UserId':Number(_0x75fe38['query'][_0xf6d7('0x53')]),'SquareProjectId':Number(_0x75fe38['params']['id'])});}});}})[_0xf6d7('0x29')](respondWithStatusCode(_0x3b33fc,null))[_0xf6d7('0x45')](handleError(_0x3b33fc,null));};exports[_0xf6d7('0x58')]=function(_0x372b86,_0x440190,_0x12b52b){var _0x2c6a20={};var _0x4dc1c8={};var _0x1ce990;var _0x389f9d;return db['SquareProject']['findOne']({'where':{'id':_0x372b86['params']['id']}})['then'](handleEntityNotFound(_0x440190,null))[_0xf6d7('0x29')](function(_0x4f3e3b){if(_0x4f3e3b){_0x1ce990=_0x4f3e3b;_0x4dc1c8[_0xf6d7('0x34')]=_[_0xf6d7('0x47')](db['User']['rawAttributes']);_0x4dc1c8['query']=_[_0xf6d7('0x47')](_0x372b86[_0xf6d7('0x35')]);_0x4dc1c8['filters']=_[_0xf6d7('0x37')](_0x4dc1c8[_0xf6d7('0x34')],_0x4dc1c8[_0xf6d7('0x35')]);_0x2c6a20[_0xf6d7('0x38')]=_[_0xf6d7('0x37')](_0x4dc1c8[_0xf6d7('0x34')],qs[_0xf6d7('0x39')](_0x372b86[_0xf6d7('0x35')][_0xf6d7('0x39')]));_0x2c6a20[_0xf6d7('0x38')]=_0x2c6a20[_0xf6d7('0x38')]['length']?_0x2c6a20[_0xf6d7('0x38')]:_0x4dc1c8['model'];_0x2c6a20[_0xf6d7('0x3d')]=qs[_0xf6d7('0x3e')](_0x372b86[_0xf6d7('0x35')][_0xf6d7('0x3e')]);_0x2c6a20['where']=qs[_0xf6d7('0x36')](_[_0xf6d7('0x59')](_0x372b86[_0xf6d7('0x35')],_0x4dc1c8[_0xf6d7('0x36')]));if(_0x372b86[_0xf6d7('0x35')][_0xf6d7('0x40')]){_0x2c6a20[_0xf6d7('0x3f')]=_[_0xf6d7('0x41')](_0x2c6a20[_0xf6d7('0x3f')],{'$or':_[_0xf6d7('0x2f')](_0x2c6a20[_0xf6d7('0x38')],function(_0x59467d){var _0x1aa550={};_0x1aa550[_0x59467d]={'$like':'%'+_0x372b86[_0xf6d7('0x35')][_0xf6d7('0x40')]+'%'};return _0x1aa550;})});}_0x2c6a20=_[_0xf6d7('0x41')]({},_0x2c6a20,_0x372b86['options']);return _0x1ce990['getUsers'](_0x2c6a20);}})['then'](function(_0x3edfc0){if(_0x3edfc0){_0x389f9d=_0x3edfc0[_0xf6d7('0x3a')];if(!_0x372b86[_0xf6d7('0x35')][_0xf6d7('0x3b')](_0xf6d7('0x3c'))){_0x2c6a20[_0xf6d7('0x1f')]=qs[_0xf6d7('0x1f')](_0x372b86[_0xf6d7('0x35')][_0xf6d7('0x1f')]);_0x2c6a20['offset']=qs['offset'](_0x372b86[_0xf6d7('0x35')][_0xf6d7('0x21')]);}return _0x1ce990['getUsers'](_0x2c6a20);}})['then'](function(_0x577bea){if(_0x577bea){return _0x577bea?{'count':_0x389f9d,'rows':_0x577bea}:null;}})[_0xf6d7('0x29')](respondWithResult(_0x440190,null))[_0xf6d7('0x45')](handleError(_0x440190,null));}; \ No newline at end of file +var _0x88e3=['ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','pick','filter','nolimit','rimraf','zip-dir','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','sendStatus','status','undefined','limit','count','offset','set','json','apply','reject','update','destroy','SquareProjects','UserProfileResource','then','error','name','send','map','SquareProject','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers'];(function(_0x29543e,_0x46995f){var _0x316d48=function(_0x4ff53e){while(--_0x4ff53e){_0x29543e['push'](_0x29543e['shift']());}};_0x316d48(++_0x46995f);}(_0x88e3,0x6a));var _0x388e=function(_0x31061a,_0x5ab647){_0x31061a=_0x31061a-0x0;var _0x48d92a=_0x88e3[_0x31061a];return _0x48d92a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x388e('0x0'));var zipdir=require(_0x388e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x388e('0x2'));var moment=require(_0x388e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x388e('0x4'));var util=require(_0x388e('0x5'));var path=require('path');var sox=require(_0x388e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x388e('0x7'));var _=require(_0x388e('0x8'));var squel=require(_0x388e('0x9'));var crypto=require(_0x388e('0xa'));var jsforce=require(_0x388e('0xb'));var deskjs=require(_0x388e('0xc'));var toCsv=require(_0x388e('0xd'));var querystring=require(_0x388e('0xe'));var Papa=require(_0x388e('0xf'));var Redis=require(_0x388e('0x10'));var authService=require(_0x388e('0x11'));var qs=require(_0x388e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x388e('0x13'))(_0x388e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x388e('0x15'));var db=require(_0x388e('0x16'))['db'];config[_0x388e('0x17')]=_['defaults'](config[_0x388e('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x388e('0x18'))(new Redis(config[_0x388e('0x17')]));require(_0x388e('0x19'))[_0x388e('0x1a')](socket);function respondWithStatusCode(_0x49168e,_0x54e936){_0x54e936=_0x54e936||0xcc;return function(_0xfc1a32){if(_0xfc1a32){return _0x49168e[_0x388e('0x1b')](_0x54e936);}return _0x49168e['status'](_0x54e936)['end']();};}function respondWithResult(_0xe1dead,_0x2ccb44){_0x2ccb44=_0x2ccb44||0xc8;return function(_0x18b9f5){if(_0x18b9f5){return _0xe1dead[_0x388e('0x1c')](_0x2ccb44)['json'](_0x18b9f5);}};}function respondWithFilteredResult(_0x312b40,_0x2f3958){return function(_0x3de2cb){if(_0x3de2cb){var _0x2a4012=typeof _0x2f3958['offset']===_0x388e('0x1d')&&typeof _0x2f3958[_0x388e('0x1e')]===_0x388e('0x1d');var _0x416705=_0x3de2cb[_0x388e('0x1f')];var _0xe124bb=_0x2a4012?0x0:_0x2f3958[_0x388e('0x20')];var _0x1229d1=_0x2a4012?_0x3de2cb[_0x388e('0x1f')]:_0x2f3958[_0x388e('0x20')]+_0x2f3958[_0x388e('0x1e')];var _0x484ad6;if(_0x1229d1>=_0x416705){_0x1229d1=_0x416705;_0x484ad6=0xc8;}else{_0x484ad6=0xce;}_0x312b40['status'](_0x484ad6);return _0x312b40[_0x388e('0x21')]('Content-Range',_0xe124bb+'-'+_0x1229d1+'/'+_0x416705)[_0x388e('0x22')](_0x3de2cb);}return null;};}function patchUpdates(_0x158f09){return function(_0x9d669){try{jsonpatch[_0x388e('0x23')](_0x9d669,_0x158f09,!![]);}catch(_0x445421){return BPromise[_0x388e('0x24')](_0x445421);}return _0x9d669['save']();};}function saveUpdates(_0x4e1503,_0x3fd3a9){return function(_0x3be129){if(_0x3be129){return _0x3be129[_0x388e('0x25')](_0x4e1503)['then'](function(_0x56959e){return _0x56959e;});}return null;};}function removeEntity(_0x277e06,_0x1dbdb2){return function(_0x2798e6){if(_0x2798e6){return _0x2798e6[_0x388e('0x26')]()['then'](function(){var _0x50fab4=_0x2798e6['get']({'plain':!![]});var _0x17043a=_0x388e('0x27');return db[_0x388e('0x28')][_0x388e('0x26')]({'where':{'type':_0x17043a,'resourceId':_0x50fab4['id']}})['then'](function(){return _0x2798e6;});})[_0x388e('0x29')](function(){_0x277e06[_0x388e('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf72cd4,_0x3a2b7b){return function(_0x3529e6){if(!_0x3529e6){_0xf72cd4[_0x388e('0x1b')](0x194);}return _0x3529e6;};}function handleError(_0x50fc00,_0x270329){_0x270329=_0x270329||0x1f4;return function(_0x280b3b){logger[_0x388e('0x2a')](_0x280b3b['stack']);if(_0x280b3b[_0x388e('0x2b')]){delete _0x280b3b[_0x388e('0x2b')];}_0x50fc00['status'](_0x270329)[_0x388e('0x2c')](_0x280b3b);};}exports['index']=function(_0x2ee346,_0x19a8d0){var _0x4f06fc={},_0x52d184={},_0x1ef453={'count':0x0,'rows':[]};var _0x8a965a=_[_0x388e('0x2d')](db[_0x388e('0x2e')][_0x388e('0x2f')],function(_0x1c1ce4){return{'name':_0x1c1ce4[_0x388e('0x30')],'type':_0x1c1ce4['type'][_0x388e('0x31')]};});_0x52d184[_0x388e('0x32')]=_['map'](_0x8a965a,_0x388e('0x2b'));_0x52d184[_0x388e('0x33')]=_[_0x388e('0x34')](_0x2ee346['query']);_0x52d184['filters']=_[_0x388e('0x35')](_0x52d184[_0x388e('0x32')],_0x52d184['query']);_0x4f06fc[_0x388e('0x36')]=_[_0x388e('0x35')](_0x52d184['model'],qs['fields'](_0x2ee346[_0x388e('0x33')][_0x388e('0x37')]));_0x4f06fc['attributes']=_0x4f06fc[_0x388e('0x36')][_0x388e('0x38')]?_0x4f06fc[_0x388e('0x36')]:_0x52d184[_0x388e('0x32')];if(!_0x2ee346['query'][_0x388e('0x39')]('nolimit')){_0x4f06fc[_0x388e('0x1e')]=qs[_0x388e('0x1e')](_0x2ee346['query'][_0x388e('0x1e')]);_0x4f06fc['offset']=qs['offset'](_0x2ee346['query'][_0x388e('0x20')]);}_0x4f06fc[_0x388e('0x3a')]=qs[_0x388e('0x3b')](_0x2ee346[_0x388e('0x33')][_0x388e('0x3b')]);_0x4f06fc['where']=qs[_0x388e('0x3c')](_['pick'](_0x2ee346[_0x388e('0x33')],_0x52d184[_0x388e('0x3c')]),_0x8a965a);if(_0x2ee346[_0x388e('0x33')]['filter']){_0x4f06fc[_0x388e('0x3d')]=_[_0x388e('0x3e')](_0x4f06fc[_0x388e('0x3d')],{'$or':_['map'](_0x8a965a,function(_0x564ef3){if(_0x564ef3[_0x388e('0x3f')]!==_0x388e('0x40')){var _0x104a90={};_0x104a90[_0x564ef3[_0x388e('0x2b')]]={'$like':'%'+_0x2ee346[_0x388e('0x33')]['filter']+'%'};return _0x104a90;}})});}_0x4f06fc=_[_0x388e('0x3e')]({},_0x4f06fc,_0x2ee346[_0x388e('0x41')]);var _0x35ab00={'where':_0x4f06fc[_0x388e('0x3d')]};return db[_0x388e('0x2e')][_0x388e('0x1f')](_0x35ab00)[_0x388e('0x29')](function(_0x5d3fb9){_0x1ef453[_0x388e('0x1f')]=_0x5d3fb9;if(_0x2ee346[_0x388e('0x33')][_0x388e('0x42')]){_0x4f06fc[_0x388e('0x43')]=[{'all':!![]}];}return db['SquareProject'][_0x388e('0x44')](_0x4f06fc);})['then'](function(_0x455f55){_0x1ef453[_0x388e('0x45')]=_0x455f55;return _0x1ef453;})[_0x388e('0x29')](respondWithFilteredResult(_0x19a8d0,_0x4f06fc))[_0x388e('0x46')](handleError(_0x19a8d0,null));};exports['show']=function(_0x20e88c,_0x36deed){var _0x626658={'raw':![],'where':{'id':_0x20e88c[_0x388e('0x47')]['id']}},_0x3255b7={};_0x3255b7[_0x388e('0x32')]=_[_0x388e('0x34')](db[_0x388e('0x2e')]['rawAttributes']);_0x3255b7['query']=_[_0x388e('0x34')](_0x20e88c[_0x388e('0x33')]);_0x3255b7[_0x388e('0x3c')]=_[_0x388e('0x35')](_0x3255b7['model'],_0x3255b7[_0x388e('0x33')]);_0x626658[_0x388e('0x36')]=_[_0x388e('0x35')](_0x3255b7[_0x388e('0x32')],qs[_0x388e('0x37')](_0x20e88c[_0x388e('0x33')][_0x388e('0x37')]));_0x626658[_0x388e('0x36')]=_0x626658[_0x388e('0x36')]['length']?_0x626658['attributes']:_0x3255b7['model'];if(_0x20e88c[_0x388e('0x33')][_0x388e('0x42')]){_0x626658['include']=[{'all':!![]}];}_0x626658=_[_0x388e('0x3e')]({},_0x626658,_0x20e88c['options']);return db['SquareProject']['find'](_0x626658)['then'](handleEntityNotFound(_0x36deed,null))[_0x388e('0x29')](respondWithResult(_0x36deed,null))['catch'](handleError(_0x36deed,null));};exports[_0x388e('0x48')]=function(_0x5291eb,_0x422dcf){return db[_0x388e('0x2e')][_0x388e('0x48')](_0x5291eb[_0x388e('0x49')],{})[_0x388e('0x29')](function(_0x3a5f3d){var _0x59cbdf=_0x5291eb[_0x388e('0x4a')][_0x388e('0x4b')]({'plain':!![]});if(!_0x59cbdf)throw new Error(_0x388e('0x4c'));if(_0x59cbdf['role']==='user'){var _0x3813ef=_0x3a5f3d[_0x388e('0x4b')]({'plain':!![]});var _0x17395e=_0x388e('0x27');return db['UserProfileSection'][_0x388e('0x4d')]({'where':{'name':_0x17395e,'userProfileId':_0x59cbdf[_0x388e('0x4e')]},'raw':!![]})[_0x388e('0x29')](function(_0x5654e5){if(_0x5654e5&&_0x5654e5[_0x388e('0x4f')]===0x0){return db['UserProfileResource'][_0x388e('0x48')]({'name':_0x3813ef[_0x388e('0x2b')],'resourceId':_0x3813ef['id'],'type':_0x5654e5[_0x388e('0x2b')],'sectionId':_0x5654e5['id']},{})[_0x388e('0x29')](function(){return _0x3a5f3d;});}else{return _0x3a5f3d;}})[_0x388e('0x46')](function(_0x1665b6){logger[_0x388e('0x2a')](_0x388e('0x50'),_0x1665b6);throw _0x1665b6;});}return _0x3a5f3d;})[_0x388e('0x29')](respondWithResult(_0x422dcf,0xc9))[_0x388e('0x46')](handleError(_0x422dcf,null));};exports[_0x388e('0x25')]=function(_0x4ded94,_0x2c092d){if(_0x4ded94[_0x388e('0x49')]['id']){delete _0x4ded94['body']['id'];}return db[_0x388e('0x2e')][_0x388e('0x4d')]({'where':{'id':_0x4ded94['params']['id']}})[_0x388e('0x29')](handleEntityNotFound(_0x2c092d,null))[_0x388e('0x29')](saveUpdates(_0x4ded94[_0x388e('0x49')],null))[_0x388e('0x29')](respondWithResult(_0x2c092d,null))[_0x388e('0x46')](handleError(_0x2c092d,null));};exports['destroy']=function(_0x1fe821,_0x552681){return db[_0x388e('0x2e')][_0x388e('0x4d')]({'where':{'id':_0x1fe821[_0x388e('0x47')]['id']}})[_0x388e('0x29')](handleEntityNotFound(_0x552681,null))[_0x388e('0x29')](removeEntity(_0x552681,null))[_0x388e('0x46')](handleError(_0x552681,null));};exports['addUsers']=function(_0x30ecb6,_0x1ef260,_0x41f7a0){return db[_0x388e('0x2e')]['find']({'where':{'id':_0x30ecb6[_0x388e('0x47')]['id']}})[_0x388e('0x29')](handleEntityNotFound(_0x1ef260,null))[_0x388e('0x29')](function(_0x1ddb4f){if(_0x1ddb4f){return _0x1ddb4f[_0x388e('0x51')](_0x30ecb6['body'][_0x388e('0x52')],_[_0x388e('0x53')](_0x30ecb6['body'],[_0x388e('0x52'),'id'])||{});}})[_0x388e('0x29')](respondWithResult(_0x1ef260,null))[_0x388e('0x46')](handleError(_0x1ef260,null));};exports[_0x388e('0x54')]=function(_0x35cbe1,_0x46b077,_0x578d1e){return db[_0x388e('0x2e')][_0x388e('0x4d')]({'where':{'id':_0x35cbe1[_0x388e('0x47')]['id']}})['then'](handleEntityNotFound(_0x46b077,null))[_0x388e('0x29')](function(_0x464d54){if(_0x464d54){return _0x464d54[_0x388e('0x54')](_0x35cbe1['query'][_0x388e('0x52')])['then'](function(){if(_[_0x388e('0x55')](_0x35cbe1[_0x388e('0x33')][_0x388e('0x52')])){for(var _0x216e49=0x0;_0x216e49<_0x35cbe1['query'][_0x388e('0x52')][_0x388e('0x38')];_0x216e49+=0x1){socket[_0x388e('0x56')](_0x388e('0x57'),{'UserId':Number(_0x35cbe1[_0x388e('0x33')][_0x388e('0x52')][_0x216e49]),'SquareProjectId':Number(_0x35cbe1['params']['id'])});}}else{socket[_0x388e('0x56')](_0x388e('0x57'),{'UserId':Number(_0x35cbe1['query'][_0x388e('0x52')]),'SquareProjectId':Number(_0x35cbe1[_0x388e('0x47')]['id'])});}});}})[_0x388e('0x29')](respondWithStatusCode(_0x46b077,null))[_0x388e('0x46')](handleError(_0x46b077,null));};exports[_0x388e('0x58')]=function(_0x4e8270,_0x10dd8a,_0x54face){var _0x232bc={};var _0x324ac0={};var _0x3a25ba;var _0x4267bb;return db[_0x388e('0x2e')][_0x388e('0x59')]({'where':{'id':_0x4e8270['params']['id']}})[_0x388e('0x29')](handleEntityNotFound(_0x10dd8a,null))[_0x388e('0x29')](function(_0x234a0b){if(_0x234a0b){_0x3a25ba=_0x234a0b;_0x324ac0[_0x388e('0x32')]=_['keys'](db[_0x388e('0x5a')][_0x388e('0x2f')]);_0x324ac0[_0x388e('0x33')]=_[_0x388e('0x34')](_0x4e8270[_0x388e('0x33')]);_0x324ac0[_0x388e('0x3c')]=_[_0x388e('0x35')](_0x324ac0[_0x388e('0x32')],_0x324ac0[_0x388e('0x33')]);_0x232bc[_0x388e('0x36')]=_[_0x388e('0x35')](_0x324ac0[_0x388e('0x32')],qs[_0x388e('0x37')](_0x4e8270[_0x388e('0x33')][_0x388e('0x37')]));_0x232bc[_0x388e('0x36')]=_0x232bc[_0x388e('0x36')][_0x388e('0x38')]?_0x232bc[_0x388e('0x36')]:_0x324ac0[_0x388e('0x32')];_0x232bc[_0x388e('0x3a')]=qs[_0x388e('0x3b')](_0x4e8270[_0x388e('0x33')][_0x388e('0x3b')]);_0x232bc[_0x388e('0x3d')]=qs[_0x388e('0x3c')](_[_0x388e('0x5b')](_0x4e8270[_0x388e('0x33')],_0x324ac0[_0x388e('0x3c')]));if(_0x4e8270[_0x388e('0x33')]['filter']){_0x232bc[_0x388e('0x3d')]=_[_0x388e('0x3e')](_0x232bc['where'],{'$or':_[_0x388e('0x2d')](_0x232bc['attributes'],function(_0x2c6f52){var _0x1e3a4a={};_0x1e3a4a[_0x2c6f52]={'$like':'%'+_0x4e8270[_0x388e('0x33')][_0x388e('0x5c')]+'%'};return _0x1e3a4a;})});}_0x232bc=_['merge']({},_0x232bc,_0x4e8270['options']);return _0x3a25ba[_0x388e('0x58')](_0x232bc);}})[_0x388e('0x29')](function(_0x4bd14c){if(_0x4bd14c){_0x4267bb=_0x4bd14c[_0x388e('0x38')];if(!_0x4e8270['query'][_0x388e('0x39')](_0x388e('0x5d'))){_0x232bc[_0x388e('0x1e')]=qs[_0x388e('0x1e')](_0x4e8270[_0x388e('0x33')][_0x388e('0x1e')]);_0x232bc[_0x388e('0x20')]=qs[_0x388e('0x20')](_0x4e8270[_0x388e('0x33')][_0x388e('0x20')]);}return _0x3a25ba['getUsers'](_0x232bc);}})[_0x388e('0x29')](function(_0x25fd27){if(_0x25fd27){return _0x25fd27?{'count':_0x4267bb,'rows':_0x25fd27}:null;}})['then'](respondWithResult(_0x10dd8a,null))[_0x388e('0x46')](handleError(_0x10dd8a,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index cfd5316..bb3e04d 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 _0xad58=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','remove'];(function(_0x2d10c7,_0x1ddf8d){var _0x16c594=function(_0x57e8ff){while(--_0x57e8ff){_0x2d10c7['push'](_0x2d10c7['shift']());}};_0x16c594(++_0x1ddf8d);}(_0xad58,0x144));var _0x8ad5=function(_0x5108d0,_0xdc80a2){_0x5108d0=_0x5108d0-0x0;var _0x3d44e7=_0xad58[_0x5108d0];return _0x3d44e7;};'use strict';var EventEmitter=require(_0x8ad5('0x0'));var SquareProject=require(_0x8ad5('0x1'))['db'][_0x8ad5('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8ad5('0x3')};function emitEvent(_0x102978){return function(_0x4a20cd,_0x3dd4bb,_0x106a4d){SquareProjectEvents[_0x8ad5('0x4')](_0x102978+':'+_0x4a20cd['id'],_0x4a20cd);SquareProjectEvents[_0x8ad5('0x4')](_0x102978,_0x4a20cd);_0x106a4d(null);};}for(var e in events){if(events[_0x8ad5('0x5')](e)){var event=events[e];SquareProject[_0x8ad5('0x6')](e,emitEvent(event));}}module[_0x8ad5('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xf13f=['events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xe71da2,_0x500e03){var _0x2d52fb=function(_0x6b599f){while(--_0x6b599f){_0xe71da2['push'](_0xe71da2['shift']());}};_0x2d52fb(++_0x500e03);}(_0xf13f,0x122));var _0xff13=function(_0x154bd5,_0x3cfc72){_0x154bd5=_0x154bd5-0x0;var _0x354916=_0xf13f[_0x154bd5];return _0x354916;};'use strict';var EventEmitter=require(_0xff13('0x0'));var SquareProject=require(_0xff13('0x1'))['db'][_0xff13('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xff13('0x3')](0x0);var events={'afterCreate':_0xff13('0x4'),'afterUpdate':_0xff13('0x5'),'afterDestroy':_0xff13('0x6')};function emitEvent(_0x598784){return function(_0x3a426e,_0xbb7ba8,_0x25878d){SquareProjectEvents['emit'](_0x598784+':'+_0x3a426e['id'],_0x3a426e);SquareProjectEvents[_0xff13('0x7')](_0x598784,_0x3a426e);_0x25878d(null);};}for(var e in events){if(events[_0xff13('0x8')](e)){var event=events[e];SquareProject[_0xff13('0x9')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 88a7551..6b90d49 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 _0x6bed=['define','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x6bed,0x194));var _0xd6be=function(_0x4f05e7,_0x554455){_0x4f05e7=_0x4f05e7-0x0;var _0x4272ef=_0x6bed[_0x4f05e7];return _0x4272ef;};'use strict';var _=require(_0xd6be('0x0'));var util=require('util');var logger=require(_0xd6be('0x1'))(_0xd6be('0x2'));var moment=require(_0xd6be('0x3'));var BPromise=require(_0xd6be('0x4'));var rp=require(_0xd6be('0x5'));var fs=require('fs');var path=require(_0xd6be('0x6'));var rimraf=require(_0xd6be('0x7'));var config=require(_0xd6be('0x8'));var attributes=require('./squareProject.attributes');module[_0xd6be('0x9')]=function(_0x38a1af,_0x315e3f){return _0x38a1af[_0xd6be('0xa')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2aa48e,_0x39ed7a,_0x589aaf){if(_0x2aa48e[_0xd6be('0xb')](_0xd6be('0xc'))){_0x2aa48e[_0xd6be('0xd')]=moment()[_0xd6be('0xe')](_0xd6be('0xf'));}if(_0x2aa48e[_0xd6be('0xb')](_0xd6be('0x10'))){_0x2aa48e[_0xd6be('0x11')]=moment()[_0xd6be('0xe')](_0xd6be('0xf'));}_0x589aaf(null,_0x2aa48e);}}});}; \ No newline at end of file +var _0x8444=['path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2586ad,_0x3a2816){var _0x4128db=function(_0x209119){while(--_0x209119){_0x2586ad['push'](_0x2586ad['shift']());}};_0x4128db(++_0x3a2816);}(_0x8444,0x189));var _0x4844=function(_0x1edb56,_0x1d64c7){_0x1edb56=_0x1edb56-0x0;var _0x3c7274=_0x8444[_0x1edb56];return _0x3c7274;};'use strict';var _=require(_0x4844('0x0'));var util=require(_0x4844('0x1'));var logger=require(_0x4844('0x2'))(_0x4844('0x3'));var moment=require('moment');var BPromise=require(_0x4844('0x4'));var rp=require(_0x4844('0x5'));var fs=require('fs');var path=require(_0x4844('0x6'));var rimraf=require(_0x4844('0x7'));var config=require(_0x4844('0x8'));var attributes=require('./squareProject.attributes');module[_0x4844('0x9')]=function(_0x24d0c4,_0x292e10){return _0x24d0c4[_0x4844('0xa')](_0x4844('0xb'),attributes,{'tableName':_0x4844('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x349f22,_0x57c047,_0x5a1799){if(_0x349f22[_0x4844('0xd')](_0x4844('0xe'))){_0x349f22['savedAt']=moment()[_0x4844('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x349f22[_0x4844('0xd')](_0x4844('0x10'))){_0x349f22[_0x4844('0x11')]=moment()[_0x4844('0xf')](_0x4844('0x12'));}_0x5a1799(null,_0x349f22);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 03bcfd6..cdef68e 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 _0x420e=['info','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareProject,\x20%s,\x20%s','message','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','socket.io-emitter','./squareProject.socket','register','request'];(function(_0x5b7e4b,_0x3d50ba){var _0x349412=function(_0x267a2b){while(--_0x267a2b){_0x5b7e4b['push'](_0x5b7e4b['shift']());}};_0x349412(++_0x3d50ba);}(_0x420e,0xa0));var _0xe420=function(_0xe8139d,_0x36d7a2){_0xe8139d=_0xe8139d-0x0;var _0x2ac4bf=_0x420e[_0xe8139d];return _0x2ac4bf;};'use strict';var _=require(_0xe420('0x0'));var util=require('util');var moment=require(_0xe420('0x1'));var BPromise=require(_0xe420('0x2'));var rs=require(_0xe420('0x3'));var fs=require('fs');var Redis=require(_0xe420('0x4'));var db=require(_0xe420('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe420('0x6'))(_0xe420('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe420('0x8')][_0xe420('0x9')]({'port':0x232a});config[_0xe420('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe420('0xb'))(new Redis(config[_0xe420('0xa')]));require(_0xe420('0xc'))[_0xe420('0xd')](socket);function respondWithRpcPromise(_0x2a502a,_0x351872,_0x200273){return new BPromise(function(_0x388517,_0x275b99){return client[_0xe420('0xe')](_0x2a502a,_0x200273)['then'](function(_0x236bab){logger[_0xe420('0xf')]('SquareProject,\x20%s,\x20%s',_0x351872,'request\x20sent');logger['debug'](_0xe420('0x10'),_0x351872,_0xe420('0x11'),JSON[_0xe420('0x12')](_0x236bab));if(_0x236bab[_0xe420('0x13')]){if(_0x236bab[_0xe420('0x13')][_0xe420('0x14')]===0x1f4){logger[_0xe420('0x13')](_0xe420('0x15'),_0x351872,_0x236bab[_0xe420('0x13')][_0xe420('0x16')]);return _0x275b99(_0x236bab['error'][_0xe420('0x16')]);}logger[_0xe420('0x13')](_0xe420('0x15'),_0x351872,_0x236bab[_0xe420('0x13')][_0xe420('0x16')]);return _0x388517(_0x236bab[_0xe420('0x13')][_0xe420('0x16')]);}else{logger[_0xe420('0xf')](_0xe420('0x15'),_0x351872,'request\x20sent');_0x388517(_0x236bab['result'][_0xe420('0x16')]);}})['catch'](function(_0x59c44a){logger[_0xe420('0x13')](_0xe420('0x15'),_0x351872,_0x59c44a);_0x275b99(_0x59c44a);});});}exports[_0xe420('0x17')]=function(_0x223dca){var _0x43d4dc=this;return new Promise(function(_0x5d7ce3,_0x44dc96){return db[_0xe420('0x18')][_0xe420('0x19')]({'raw':_0x223dca[_0xe420('0x1a')]?_0x223dca[_0xe420('0x1a')][_0xe420('0x1b')]===undefined?!![]:![]:!![],'where':_0x223dca[_0xe420('0x1a')]?_0x223dca[_0xe420('0x1a')][_0xe420('0x1c')]||null:null,'attributes':_0x223dca[_0xe420('0x1a')]?_0x223dca[_0xe420('0x1a')][_0xe420('0x1d')]||null:null,'include':_0x223dca[_0xe420('0x1a')]?_0x223dca[_0xe420('0x1a')][_0xe420('0x1e')]?_[_0xe420('0x1f')](_0x223dca[_0xe420('0x1a')][_0xe420('0x1e')],function(_0x49e7d2){return{'model':db[_0x49e7d2[_0xe420('0x20')]],'as':_0x49e7d2['as'],'attributes':_0x49e7d2[_0xe420('0x1d')],'include':_0x49e7d2[_0xe420('0x1e')]?_[_0xe420('0x1f')](_0x49e7d2[_0xe420('0x1e')],function(_0x350828){return{'model':db[_0x350828[_0xe420('0x20')]],'as':_0x350828['as'],'attributes':_0x350828[_0xe420('0x1d')],'include':_0x350828[_0xe420('0x1e')]?_[_0xe420('0x1f')](_0x350828[_0xe420('0x1e')],function(_0x5976aa){return{'model':db[_0x5976aa[_0xe420('0x20')]],'as':_0x5976aa['as'],'attributes':_0x5976aa[_0xe420('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe420('0x21')](function(_0x4510be){logger[_0xe420('0xf')](_0xe420('0x17'),_0x223dca);logger['debug']('ShowSquareProject',_0x223dca,JSON['stringify'](_0x4510be));_0x5d7ce3(_0x4510be);})[_0xe420('0x22')](function(_0x1bac3e){logger[_0xe420('0x13')](_0xe420('0x17'),_0x1bac3e['message'],_0x223dca);_0x44dc96(_0x43d4dc[_0xe420('0x13')](0x1f4,_0x1bac3e[_0xe420('0x16')]));});});}; \ No newline at end of file +var _0x2644=['message','catch','ShowSquareProject','SquareProject','find','options','raw','attributes','map','model','include','then','debug','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5e891b,_0x88f5f7){var _0xb3a13f=function(_0x291fdc){while(--_0x291fdc){_0x5e891b['push'](_0x5e891b['shift']());}};_0xb3a13f(++_0x88f5f7);}(_0x2644,0x189));var _0x4264=function(_0xd6df5e,_0x4a4e46){_0xd6df5e=_0xd6df5e-0x0;var _0x155b12=_0x2644[_0xd6df5e];return _0x155b12;};'use strict';var _=require('lodash');var util=require(_0x4264('0x0'));var moment=require(_0x4264('0x1'));var BPromise=require(_0x4264('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4264('0x3'));var db=require(_0x4264('0x4'))['db'];var utils=require(_0x4264('0x5'));var logger=require(_0x4264('0x6'))(_0x4264('0x7'));var config=require(_0x4264('0x8'));var jayson=require(_0x4264('0x9'));var client=jayson['client'][_0x4264('0xa')]({'port':0x232a});config[_0x4264('0xb')]=_[_0x4264('0xc')](config['redis'],{'host':_0x4264('0xd'),'port':0x18eb});var socket=require(_0x4264('0xe'))(new Redis(config[_0x4264('0xb')]));require(_0x4264('0xf'))[_0x4264('0x10')](socket);function respondWithRpcPromise(_0x47d001,_0x2b8fce,_0x2498d2){return new BPromise(function(_0x21cc52,_0xa74519){return client[_0x4264('0x11')](_0x47d001,_0x2498d2)['then'](function(_0x1666ee){logger[_0x4264('0x12')](_0x4264('0x13'),_0x2b8fce,_0x4264('0x14'));logger['debug'](_0x4264('0x15'),_0x2b8fce,_0x4264('0x14'),JSON[_0x4264('0x16')](_0x1666ee));if(_0x1666ee[_0x4264('0x17')]){if(_0x1666ee['error'][_0x4264('0x18')]===0x1f4){logger[_0x4264('0x17')](_0x4264('0x13'),_0x2b8fce,_0x1666ee[_0x4264('0x17')]['message']);return _0xa74519(_0x1666ee[_0x4264('0x17')][_0x4264('0x19')]);}logger[_0x4264('0x17')](_0x4264('0x13'),_0x2b8fce,_0x1666ee[_0x4264('0x17')][_0x4264('0x19')]);return _0x21cc52(_0x1666ee[_0x4264('0x17')]['message']);}else{logger[_0x4264('0x12')](_0x4264('0x13'),_0x2b8fce,_0x4264('0x14'));_0x21cc52(_0x1666ee['result'][_0x4264('0x19')]);}})[_0x4264('0x1a')](function(_0x547503){logger[_0x4264('0x17')](_0x4264('0x13'),_0x2b8fce,_0x547503);_0xa74519(_0x547503);});});}exports[_0x4264('0x1b')]=function(_0x5c2dd2){var _0x303431=this;return new Promise(function(_0xa866dd,_0x117d97){return db[_0x4264('0x1c')][_0x4264('0x1d')]({'raw':_0x5c2dd2[_0x4264('0x1e')]?_0x5c2dd2[_0x4264('0x1e')][_0x4264('0x1f')]===undefined?!![]:![]:!![],'where':_0x5c2dd2[_0x4264('0x1e')]?_0x5c2dd2['options']['where']||null:null,'attributes':_0x5c2dd2[_0x4264('0x1e')]?_0x5c2dd2[_0x4264('0x1e')][_0x4264('0x20')]||null:null,'include':_0x5c2dd2[_0x4264('0x1e')]?_0x5c2dd2['options']['include']?_[_0x4264('0x21')](_0x5c2dd2[_0x4264('0x1e')]['include'],function(_0x19e4e6){return{'model':db[_0x19e4e6[_0x4264('0x22')]],'as':_0x19e4e6['as'],'attributes':_0x19e4e6[_0x4264('0x20')],'include':_0x19e4e6[_0x4264('0x23')]?_[_0x4264('0x21')](_0x19e4e6[_0x4264('0x23')],function(_0x542953){return{'model':db[_0x542953['model']],'as':_0x542953['as'],'attributes':_0x542953['attributes'],'include':_0x542953['include']?_[_0x4264('0x21')](_0x542953[_0x4264('0x23')],function(_0x3e335e){return{'model':db[_0x3e335e[_0x4264('0x22')]],'as':_0x3e335e['as'],'attributes':_0x3e335e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4264('0x24')](function(_0x44d150){logger[_0x4264('0x12')](_0x4264('0x1b'),_0x5c2dd2);logger[_0x4264('0x25')](_0x4264('0x1b'),_0x5c2dd2,JSON[_0x4264('0x16')](_0x44d150));_0xa866dd(_0x44d150);})[_0x4264('0x1a')](function(_0x461ee6){logger[_0x4264('0x17')]('ShowSquareProject',_0x461ee6[_0x4264('0x19')],_0x5c2dd2);_0x117d97(_0x303431[_0x4264('0x17')](0x1f4,_0x461ee6[_0x4264('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d45a18d..8da4997 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 _0x8875=['update','emit','register','./squareProject.events','save','remove'];(function(_0x418c0d,_0x329944){var _0x470ebb=function(_0x197369){while(--_0x197369){_0x418c0d['push'](_0x418c0d['shift']());}};_0x470ebb(++_0x329944);}(_0x8875,0x195));var _0x5887=function(_0xd2ccca,_0x31c5eb){_0xd2ccca=_0xd2ccca-0x0;var _0x418920=_0x8875[_0xd2ccca];return _0x418920;};'use strict';var SquareProjectEvents=require(_0x5887('0x0'));var events=[_0x5887('0x1'),_0x5887('0x2'),_0x5887('0x3')];function createListener(_0x341285,_0x8c4d3a){return function(_0xd0888e){_0x8c4d3a[_0x5887('0x4')](_0x341285,_0xd0888e);};}function removeListener(_0x5daaf6,_0x1ecce9){return function(){SquareProjectEvents['removeListener'](_0x5daaf6,_0x1ecce9);};}exports[_0x5887('0x5')]=function(_0x19b08d){for(var _0x26448e=0x0,_0x4a5c4c=events['length'];_0x26448e<_0x4a5c4c;_0x26448e++){var _0x1682ce=events[_0x26448e];var _0x5676d7=createListener('squareProject:'+_0x1682ce,_0x19b08d);SquareProjectEvents['on'](_0x1682ce,_0x5676d7);}}; \ No newline at end of file +var _0xeb7d=['register','length','save','remove','update','emit'];(function(_0x38b866,_0x1a19a5){var _0x53f081=function(_0x3d60d2){while(--_0x3d60d2){_0x38b866['push'](_0x38b866['shift']());}};_0x53f081(++_0x1a19a5);}(_0xeb7d,0xbc));var _0xdeb7=function(_0x54f415,_0x52be28){_0x54f415=_0x54f415-0x0;var _0xaca73b=_0xeb7d[_0x54f415];return _0xaca73b;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xdeb7('0x0'),_0xdeb7('0x1'),_0xdeb7('0x2')];function createListener(_0x5ef1db,_0x540172){return function(_0x5cff18){_0x540172[_0xdeb7('0x3')](_0x5ef1db,_0x5cff18);};}function removeListener(_0x6fef46,_0x465ff8){return function(){SquareProjectEvents['removeListener'](_0x6fef46,_0x465ff8);};}exports[_0xdeb7('0x4')]=function(_0x39c28d){for(var _0xefa32e=0x0,_0x33f8df=events[_0xdeb7('0x5')];_0xefa32e<_0x33f8df;_0xefa32e++){var _0x2f966a=events[_0xefa32e];var _0x34ccbc=createListener('squareProject:'+_0x2f966a,_0x39c28d);SquareProjectEvents['on'](_0x2f966a,_0x34ccbc);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 3749abf..b6b3d5d 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 _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x41f74a,_0x4f28ef){var _0x555352=function(_0x256f34){while(--_0x256f34){_0x41f74a['push'](_0x41f74a['shift']());}};_0x555352(++_0x4f28ef);}(_0xabce,0x103));var _0xeabc=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xabce[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x4936af,_0x598bf1){var _0x33598c=function(_0x3b2456){while(--_0x3b2456){_0x4936af['push'](_0x4936af['shift']());}};_0x33598c(++_0x598bf1);}(_0x814b,0x1a2));var _0xb814=function(_0x47a40b,_0x443ecf){_0x47a40b=_0x47a40b-0x0;var _0x19610c=_0x814b[_0x47a40b];return _0x19610c;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index eb50f27..6ac0903 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 _0x9c5a=['getDataValue','savePath','lastIndexOf','sequelize','exports','STRING','VIRTUAL'];(function(_0x5309d4,_0x1370fc){var _0x2da5e9=function(_0x4e32ed){while(--_0x4e32ed){_0x5309d4['push'](_0x5309d4['shift']());}};_0x2da5e9(++_0x1370fc);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x58db9e,_0x14e34d){_0x58db9e=_0x58db9e-0x0;var _0x1a68ed=_0x9c5a[_0x58db9e];return _0x1a68ed;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa9c5('0x2')]},'calleridname':{'type':Sequelize[_0xa9c5('0x2')]},'context':{'type':Sequelize[_0xa9c5('0x2')]},'extension':{'type':Sequelize[_0xa9c5('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa9c5('0x2')]},'dnid':{'type':Sequelize[_0xa9c5('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xa9c5('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xa9c5('0x2')]},'format':{'type':Sequelize[_0xa9c5('0x3')],'get':function(){var _0x4cb597='';var _0x4b6db6=this[_0xa9c5('0x4')](_0xa9c5('0x5'));if(_0x4b6db6){_0x4cb597=_0x4b6db6['substring'](_0x4b6db6[_0xa9c5('0x6')]('.'));}return _0x4cb597;}}}; \ No newline at end of file +var _0x5d17=['getDataValue','savePath','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x342f7c,_0x34fa7e){var _0x2ac7f8=function(_0x4c719b){while(--_0x4c719b){_0x342f7c['push'](_0x342f7c['shift']());}};_0x2ac7f8(++_0x34fa7e);}(_0x5d17,0x114));var _0x75d1=function(_0x38f70,_0x47a0f6){_0x38f70=_0x38f70-0x0;var _0x81fa37=_0x5d17[_0x38f70];return _0x81fa37;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x75d1('0x2')]},'context':{'type':Sequelize[_0x75d1('0x2')]},'extension':{'type':Sequelize[_0x75d1('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x75d1('0x2')]},'dnid':{'type':Sequelize[_0x75d1('0x2')]},'projectName':{'type':Sequelize[_0x75d1('0x2')]},'saveName':{'type':Sequelize[_0x75d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x75d1('0x2')]},'format':{'type':Sequelize[_0x75d1('0x3')],'get':function(){var _0x5c957a='';var _0x1ee61b=this[_0x75d1('0x4')](_0x75d1('0x5'));if(_0x1ee61b){_0x5c957a=_0x1ee61b[_0x75d1('0x6')](_0x1ee61b['lastIndexOf']('.'));}return _0x5c957a;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 48cd34d..1441852 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 _0xe34b=['status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','filter','merge','map','VIRTUAL','SquareRecording','includeAll','include','findAll','rows','catch','show','params','find','create','body','../../components/encryptor','uniqueid','savePath','format','%s.cypher','existsSync','recording','ValidationError','download','filename','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x1cf2a9,_0x2d765f){var _0x4323ba=function(_0x44e395){while(--_0x44e395){_0x1cf2a9['push'](_0x1cf2a9['shift']());}};_0x4323ba(++_0x2d765f);}(_0xe34b,0x1ca));var _0xbe34=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0xe34b[_0x879e31];return _0x3467e8;};'use strict';var emlformat=require(_0xbe34('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe34('0x1'));var jsonpatch=require(_0xbe34('0x2'));var rp=require(_0xbe34('0x3'));var moment=require(_0xbe34('0x4'));var BPromise=require(_0xbe34('0x5'));var Mustache=require(_0xbe34('0x6'));var util=require(_0xbe34('0x7'));var path=require(_0xbe34('0x8'));var sox=require(_0xbe34('0x9'));var csv=require(_0xbe34('0xa'));var ejs=require(_0xbe34('0xb'));var fs=require('fs');var fs_extra=require(_0xbe34('0xc'));var _=require('lodash');var squel=require(_0xbe34('0xd'));var crypto=require(_0xbe34('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xbe34('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbe34('0x10'));var Papa=require(_0xbe34('0x11'));var Redis=require(_0xbe34('0x12'));var authService=require(_0xbe34('0x13'));var qs=require(_0xbe34('0x14'));var as=require(_0xbe34('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe34('0x16'))(_0xbe34('0x17'));var utils=require(_0xbe34('0x18'));var config=require(_0xbe34('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45afed,_0x3d0407){_0x3d0407=_0x3d0407||0xcc;return function(_0x1d1af8){if(_0x1d1af8){return _0x45afed[_0xbe34('0x1a')](_0x3d0407);}return _0x45afed[_0xbe34('0x1b')](_0x3d0407)[_0xbe34('0x1c')]();};}function respondWithResult(_0x4be782,_0x4d0dee){_0x4d0dee=_0x4d0dee||0xc8;return function(_0x1b7188){if(_0x1b7188){return _0x4be782['status'](_0x4d0dee)['json'](_0x1b7188);}};}function respondWithFilteredResult(_0x42bb50,_0x4bed03){return function(_0x2252bc){if(_0x2252bc){var _0xb349dc=typeof _0x4bed03[_0xbe34('0x1d')]===_0xbe34('0x1e')&&typeof _0x4bed03[_0xbe34('0x1f')]===_0xbe34('0x1e');var _0x413444=_0x2252bc[_0xbe34('0x20')];var _0x367a65=_0xb349dc?0x0:_0x4bed03[_0xbe34('0x1d')];var _0x1d411a=_0xb349dc?_0x2252bc[_0xbe34('0x20')]:_0x4bed03[_0xbe34('0x1d')]+_0x4bed03[_0xbe34('0x1f')];var _0x48ffb8;if(_0x1d411a>=_0x413444){_0x1d411a=_0x413444;_0x48ffb8=0xc8;}else{_0x48ffb8=0xce;}_0x42bb50[_0xbe34('0x1b')](_0x48ffb8);return _0x42bb50[_0xbe34('0x21')](_0xbe34('0x22'),_0x367a65+'-'+_0x1d411a+'/'+_0x413444)[_0xbe34('0x23')](_0x2252bc);}return null;};}function patchUpdates(_0x25480e){return function(_0x3e332e){try{jsonpatch[_0xbe34('0x24')](_0x3e332e,_0x25480e,!![]);}catch(_0x16386e){return BPromise[_0xbe34('0x25')](_0x16386e);}return _0x3e332e[_0xbe34('0x26')]();};}function saveUpdates(_0x31fecb,_0x626ce8){return function(_0x47e24a){if(_0x47e24a){return _0x47e24a[_0xbe34('0x27')](_0x31fecb)['then'](function(_0x300c1b){return _0x300c1b;});}return null;};}function removeEntity(_0x2db510,_0x3634b9){return function(_0x181872){if(_0x181872){return _0x181872[_0xbe34('0x28')]()[_0xbe34('0x29')](function(){_0x2db510[_0xbe34('0x1b')](0xcc)[_0xbe34('0x1c')]();});}};}function handleEntityNotFound(_0x416396,_0x4f318d){return function(_0x7a3d0e){if(!_0x7a3d0e){_0x416396[_0xbe34('0x1a')](0x194);}return _0x7a3d0e;};}function handleError(_0x1c3875,_0x2b584f){_0x2b584f=_0x2b584f||0x1f4;return function(_0x13a7d6){logger[_0xbe34('0x2a')](_0x13a7d6[_0xbe34('0x2b')]);if(_0x13a7d6[_0xbe34('0x2c')]){delete _0x13a7d6['name'];}_0x1c3875[_0xbe34('0x1b')](_0x2b584f)[_0xbe34('0x2d')](_0x13a7d6);};}exports['index']=function(_0xbbad48,_0x27c721){var _0xa80977={},_0x1bd864={},_0x146999={'count':0x0,'rows':[]};var _0x5c4df9=_['map'](db['SquareRecording'][_0xbe34('0x2e')],function(_0x586e81){return{'name':_0x586e81[_0xbe34('0x2f')],'type':_0x586e81[_0xbe34('0x30')]['key']};});_0x1bd864[_0xbe34('0x31')]=_['map'](_0x5c4df9,_0xbe34('0x2c'));_0x1bd864[_0xbe34('0x32')]=_[_0xbe34('0x33')](_0xbbad48[_0xbe34('0x32')]);_0x1bd864['filters']=_['intersection'](_0x1bd864[_0xbe34('0x31')],_0x1bd864[_0xbe34('0x32')]);_0xa80977[_0xbe34('0x34')]=_[_0xbe34('0x35')](_0x1bd864[_0xbe34('0x31')],qs[_0xbe34('0x36')](_0xbbad48[_0xbe34('0x32')][_0xbe34('0x36')]));_0xa80977[_0xbe34('0x34')]=_0xa80977[_0xbe34('0x34')][_0xbe34('0x37')]?_0xa80977['attributes']:_0x1bd864[_0xbe34('0x31')];if(!_0xbbad48[_0xbe34('0x32')]['hasOwnProperty']('nolimit')){_0xa80977[_0xbe34('0x1f')]=qs[_0xbe34('0x1f')](_0xbbad48[_0xbe34('0x32')][_0xbe34('0x1f')]);_0xa80977[_0xbe34('0x1d')]=qs[_0xbe34('0x1d')](_0xbbad48[_0xbe34('0x32')][_0xbe34('0x1d')]);}_0xa80977[_0xbe34('0x38')]=qs[_0xbe34('0x39')](_0xbbad48['query'][_0xbe34('0x39')]);_0xa80977[_0xbe34('0x3a')]=qs['filters'](_['pick'](_0xbbad48['query'],_0x1bd864[_0xbe34('0x3b')]),_0x5c4df9);if(_0xbbad48['query'][_0xbe34('0x3c')]){_0xa80977[_0xbe34('0x3a')]=_[_0xbe34('0x3d')](_0xa80977[_0xbe34('0x3a')],{'$or':_[_0xbe34('0x3e')](_0x5c4df9,function(_0xbba4e8){if(_0xbba4e8['type']!==_0xbe34('0x3f')){var _0x30547d={};_0x30547d[_0xbba4e8[_0xbe34('0x2c')]]={'$like':'%'+_0xbbad48['query'][_0xbe34('0x3c')]+'%'};return _0x30547d;}})});}_0xa80977=_[_0xbe34('0x3d')]({},_0xa80977,_0xbbad48['options']);var _0x28e744={'where':_0xa80977[_0xbe34('0x3a')]};return db[_0xbe34('0x40')][_0xbe34('0x20')](_0x28e744)['then'](function(_0x278154){_0x146999['count']=_0x278154;if(_0xbbad48[_0xbe34('0x32')][_0xbe34('0x41')]){_0xa80977[_0xbe34('0x42')]=[{'all':!![]}];}return db[_0xbe34('0x40')][_0xbe34('0x43')](_0xa80977);})[_0xbe34('0x29')](function(_0x2e93a0){_0x146999[_0xbe34('0x44')]=_0x2e93a0;return _0x146999;})[_0xbe34('0x29')](respondWithFilteredResult(_0x27c721,_0xa80977))[_0xbe34('0x45')](handleError(_0x27c721,null));};exports[_0xbe34('0x46')]=function(_0x1639f5,_0x229c53){var _0x4556a3={'raw':!![],'where':{'id':_0x1639f5[_0xbe34('0x47')]['id']}},_0x1d4ab0={};_0x1d4ab0[_0xbe34('0x31')]=_['keys'](db['SquareRecording'][_0xbe34('0x2e')]);_0x1d4ab0[_0xbe34('0x32')]=_['keys'](_0x1639f5[_0xbe34('0x32')]);_0x1d4ab0[_0xbe34('0x3b')]=_['intersection'](_0x1d4ab0[_0xbe34('0x31')],_0x1d4ab0[_0xbe34('0x32')]);_0x4556a3['attributes']=_[_0xbe34('0x35')](_0x1d4ab0[_0xbe34('0x31')],qs[_0xbe34('0x36')](_0x1639f5[_0xbe34('0x32')][_0xbe34('0x36')]));_0x4556a3['attributes']=_0x4556a3[_0xbe34('0x34')][_0xbe34('0x37')]?_0x4556a3[_0xbe34('0x34')]:_0x1d4ab0[_0xbe34('0x31')];if(_0x1639f5['query'][_0xbe34('0x41')]){_0x4556a3[_0xbe34('0x42')]=[{'all':!![]}];}_0x4556a3=_['merge']({},_0x4556a3,_0x1639f5['options']);return db[_0xbe34('0x40')][_0xbe34('0x48')](_0x4556a3)['then'](handleEntityNotFound(_0x229c53,null))['then'](respondWithResult(_0x229c53,null))[_0xbe34('0x45')](handleError(_0x229c53,null));};exports[_0xbe34('0x49')]=function(_0x84c285,_0x1818d9){return db[_0xbe34('0x40')]['create'](_0x84c285[_0xbe34('0x4a')],{})['then'](respondWithResult(_0x1818d9,0xc9))['catch'](handleError(_0x1818d9,null));};exports[_0xbe34('0x27')]=function(_0x118438,_0x2ee86b){if(_0x118438[_0xbe34('0x4a')]['id']){delete _0x118438[_0xbe34('0x4a')]['id'];}return db[_0xbe34('0x40')][_0xbe34('0x48')]({'where':{'id':_0x118438['params']['id']}})[_0xbe34('0x29')](handleEntityNotFound(_0x2ee86b,null))[_0xbe34('0x29')](saveUpdates(_0x118438[_0xbe34('0x4a')],null))[_0xbe34('0x29')](respondWithResult(_0x2ee86b,null))[_0xbe34('0x45')](handleError(_0x2ee86b,null));};exports['download']=function(_0x193484,_0x193e9f,_0x36f7e0){var _0x37500e=require(_0xbe34('0x4b'));var _0x4ce8c8=![];var _0x4162e2={};if(_0x193484['query'][_0xbe34('0x30')]&&_0x193484['query'][_0xbe34('0x30')]===_0xbe34('0x4c')){_0x4162e2[_0xbe34('0x4c')]=_0x193484['params']['id'];}else{_0x4162e2['id']=_0x193484[_0xbe34('0x47')]['id'];}return db[_0xbe34('0x40')][_0xbe34('0x48')]({'where':_0x4162e2,'attributes':['id','savePath','filename'],'raw':!![]})[_0xbe34('0x29')](handleEntityNotFound(_0x193e9f,null))[_0xbe34('0x29')](function(_0x43c4c0){if(_0x43c4c0){var _0x1d8eda=_0x43c4c0[_0xbe34('0x4d')];var _0x28d1d4=util[_0xbe34('0x4e')](_0xbe34('0x4f'),_0x1d8eda);if(fs[_0xbe34('0x50')](_0x28d1d4)){_0x4ce8c8=!![];return _0x37500e['decryptFile'](_0x28d1d4,_0x1d8eda,config['secrets'][_0xbe34('0x51')])[_0xbe34('0x29')](function(){return _0x43c4c0;});}return _0x43c4c0;}})[_0xbe34('0x29')](function(_0x9c6ad4){if(_0x9c6ad4){var _0x5d5cd7=_0x9c6ad4[_0xbe34('0x4d')];if(!fs[_0xbe34('0x50')](_0x5d5cd7)){throw new db['Sequelize'][(_0xbe34('0x52'))]('SquareRecording\x20not\x20found');}if(_0x9c6ad4['filename']){return _0x193e9f[_0xbe34('0x53')](_0x5d5cd7,_0x9c6ad4[_0xbe34('0x54')]+path[_0xbe34('0x55')](_0x5d5cd7),function(){if(_0x4ce8c8){fs[_0xbe34('0x56')](_0x5d5cd7);}});}else{return _0x193e9f[_0xbe34('0x53')](_0x5d5cd7,function(_0x463f21){if(_0x4ce8c8){fs[_0xbe34('0x56')](_0x5d5cd7);}});}}})['catch'](function(_0x26ddf0){if(_0x26ddf0['message']===_0xbe34('0x57')){_0x193e9f[_0xbe34('0x1b')](0x194)[_0xbe34('0x2d')](_0xbe34('0x58'));}else{return handleError(_0x193e9f,null);}});};exports[_0xbe34('0x28')]=function(_0x5d7344,_0x396f83){return db[_0xbe34('0x40')]['find']({'where':{'id':_0x5d7344['params']['id']}})['then'](function(_0xff0894){if(_[_0xbe34('0x59')](_0xff0894)){throw new ReferenceError(_0xbe34('0x5a'));}return _0xff0894;})['then'](function(_0x425174){var _0x10eaa5=_0x425174[_0xbe34('0x4d')];logger[_0xbe34('0x5b')](_0xbe34('0x5c'),_0x10eaa5);if(!_[_0xbe34('0x59')](_0x425174[_0xbe34('0x4d')])&&fs['existsSync'](_0x10eaa5)){logger[_0xbe34('0x5b')](_0xbe34('0x5d')+_0x10eaa5+_0xbe34('0x5e'));fs['unlinkSync'](_0x10eaa5);}_0x10eaa5=_0x10eaa5+_0xbe34('0x5f');if(!_[_0xbe34('0x59')](_0x425174[_0xbe34('0x4d')])&&fs[_0xbe34('0x50')](_0x10eaa5)){logger[_0xbe34('0x5b')]('File:\x20\x22'+_0x10eaa5+_0xbe34('0x5e'));fs[_0xbe34('0x60')](_0x10eaa5);}return _0x425174;})[_0xbe34('0x29')](function(_0x166214){if(!_0x166214)throw new InternalError();return _0x166214[_0xbe34('0x28')]();})[_0xbe34('0x29')](function(){_0x396f83[_0xbe34('0x1b')](0xcc)[_0xbe34('0x1c')]();})['catch'](handleError(_0x396f83,null));}; \ No newline at end of file +var _0x2ff7=['type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','show','keys','includeAll','options','find','catch','create','body','update','params','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','recording','existsSync','Sequelize','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','Content-Range','apply','save','then','status','stack','name','send','SquareRecording','rawAttributes','fieldName'];(function(_0x1d9316,_0x45e6d4){var _0x5afd84=function(_0x4d6355){while(--_0x4d6355){_0x1d9316['push'](_0x1d9316['shift']());}};_0x5afd84(++_0x45e6d4);}(_0x2ff7,0x91));var _0x72ff=function(_0x697a67,_0x75c61d){_0x697a67=_0x697a67-0x0;var _0x116a70=_0x2ff7[_0x697a67];return _0x116a70;};'use strict';var emlformat=require(_0x72ff('0x0'));var rimraf=require(_0x72ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72ff('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x72ff('0x3'));var Mustache=require(_0x72ff('0x4'));var util=require(_0x72ff('0x5'));var path=require('path');var sox=require(_0x72ff('0x6'));var csv=require(_0x72ff('0x7'));var ejs=require(_0x72ff('0x8'));var fs=require('fs');var fs_extra=require(_0x72ff('0x9'));var _=require('lodash');var squel=require(_0x72ff('0xa'));var crypto=require(_0x72ff('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x72ff('0x7'));var querystring=require(_0x72ff('0xc'));var Papa=require(_0x72ff('0xd'));var Redis=require(_0x72ff('0xe'));var authService=require(_0x72ff('0xf'));var qs=require(_0x72ff('0x10'));var as=require(_0x72ff('0x11'));var hardwareService=require(_0x72ff('0x12'));var logger=require('../../config/logger')(_0x72ff('0x13'));var utils=require(_0x72ff('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x72ff('0x15'));var db=require(_0x72ff('0x16'))['db'];function respondWithStatusCode(_0x1ac48f,_0x5abcdd){_0x5abcdd=_0x5abcdd||0xcc;return function(_0x47ba1b){if(_0x47ba1b){return _0x1ac48f[_0x72ff('0x17')](_0x5abcdd);}return _0x1ac48f['status'](_0x5abcdd)[_0x72ff('0x18')]();};}function respondWithResult(_0x3b9213,_0x2f261a){_0x2f261a=_0x2f261a||0xc8;return function(_0x41b63f){if(_0x41b63f){return _0x3b9213['status'](_0x2f261a)[_0x72ff('0x19')](_0x41b63f);}};}function respondWithFilteredResult(_0xe5fc7b,_0x20cae6){return function(_0x179636){if(_0x179636){var _0x568193=typeof _0x20cae6[_0x72ff('0x1a')]===_0x72ff('0x1b')&&typeof _0x20cae6['limit']==='undefined';var _0x827dbd=_0x179636[_0x72ff('0x1c')];var _0x316bd8=_0x568193?0x0:_0x20cae6[_0x72ff('0x1a')];var _0x1c7613=_0x568193?_0x179636[_0x72ff('0x1c')]:_0x20cae6[_0x72ff('0x1a')]+_0x20cae6[_0x72ff('0x1d')];var _0x5e530c;if(_0x1c7613>=_0x827dbd){_0x1c7613=_0x827dbd;_0x5e530c=0xc8;}else{_0x5e530c=0xce;}_0xe5fc7b['status'](_0x5e530c);return _0xe5fc7b['set'](_0x72ff('0x1e'),_0x316bd8+'-'+_0x1c7613+'/'+_0x827dbd)['json'](_0x179636);}return null;};}function patchUpdates(_0x13890e){return function(_0x3a09a4){try{jsonpatch[_0x72ff('0x1f')](_0x3a09a4,_0x13890e,!![]);}catch(_0x56fa10){return BPromise['reject'](_0x56fa10);}return _0x3a09a4[_0x72ff('0x20')]();};}function saveUpdates(_0x16d8ef,_0x25a2d0){return function(_0x38ce8d){if(_0x38ce8d){return _0x38ce8d['update'](_0x16d8ef)[_0x72ff('0x21')](function(_0x2fdda0){return _0x2fdda0;});}return null;};}function removeEntity(_0x5e2e28,_0x15075a){return function(_0x480e92){if(_0x480e92){return _0x480e92['destroy']()[_0x72ff('0x21')](function(){_0x5e2e28[_0x72ff('0x22')](0xcc)[_0x72ff('0x18')]();});}};}function handleEntityNotFound(_0x194547,_0x237b14){return function(_0x3152b8){if(!_0x3152b8){_0x194547[_0x72ff('0x17')](0x194);}return _0x3152b8;};}function handleError(_0x3f03a2,_0x1d1e71){_0x1d1e71=_0x1d1e71||0x1f4;return function(_0x29eaaf){logger['error'](_0x29eaaf[_0x72ff('0x23')]);if(_0x29eaaf[_0x72ff('0x24')]){delete _0x29eaaf['name'];}_0x3f03a2[_0x72ff('0x22')](_0x1d1e71)[_0x72ff('0x25')](_0x29eaaf);};}exports['index']=function(_0xc3f2e1,_0x4faac8){var _0x26dd1a={},_0x247dce={},_0x32563a={'count':0x0,'rows':[]};var _0x4e4ebf=_['map'](db[_0x72ff('0x26')][_0x72ff('0x27')],function(_0x4443de){return{'name':_0x4443de[_0x72ff('0x28')],'type':_0x4443de[_0x72ff('0x29')][_0x72ff('0x2a')]};});_0x247dce[_0x72ff('0x2b')]=_[_0x72ff('0x2c')](_0x4e4ebf,_0x72ff('0x24'));_0x247dce[_0x72ff('0x2d')]=_['keys'](_0xc3f2e1[_0x72ff('0x2d')]);_0x247dce[_0x72ff('0x2e')]=_['intersection'](_0x247dce[_0x72ff('0x2b')],_0x247dce[_0x72ff('0x2d')]);_0x26dd1a[_0x72ff('0x2f')]=_[_0x72ff('0x30')](_0x247dce[_0x72ff('0x2b')],qs['fields'](_0xc3f2e1[_0x72ff('0x2d')][_0x72ff('0x31')]));_0x26dd1a[_0x72ff('0x2f')]=_0x26dd1a[_0x72ff('0x2f')]['length']?_0x26dd1a[_0x72ff('0x2f')]:_0x247dce['model'];if(!_0xc3f2e1[_0x72ff('0x2d')][_0x72ff('0x32')](_0x72ff('0x33'))){_0x26dd1a['limit']=qs[_0x72ff('0x1d')](_0xc3f2e1[_0x72ff('0x2d')][_0x72ff('0x1d')]);_0x26dd1a[_0x72ff('0x1a')]=qs[_0x72ff('0x1a')](_0xc3f2e1['query'][_0x72ff('0x1a')]);}_0x26dd1a[_0x72ff('0x34')]=qs['sort'](_0xc3f2e1[_0x72ff('0x2d')][_0x72ff('0x35')]);_0x26dd1a[_0x72ff('0x36')]=qs['filters'](_[_0x72ff('0x37')](_0xc3f2e1[_0x72ff('0x2d')],_0x247dce['filters']),_0x4e4ebf);if(_0xc3f2e1[_0x72ff('0x2d')][_0x72ff('0x38')]){_0x26dd1a[_0x72ff('0x36')]=_[_0x72ff('0x39')](_0x26dd1a[_0x72ff('0x36')],{'$or':_[_0x72ff('0x2c')](_0x4e4ebf,function(_0x1a025b){if(_0x1a025b[_0x72ff('0x29')]!==_0x72ff('0x3a')){var _0x3b8355={};_0x3b8355[_0x1a025b['name']]={'$like':'%'+_0xc3f2e1['query'][_0x72ff('0x38')]+'%'};return _0x3b8355;}})});}_0x26dd1a=_[_0x72ff('0x39')]({},_0x26dd1a,_0xc3f2e1['options']);var _0x2ab803={'where':_0x26dd1a[_0x72ff('0x36')]};return db['SquareRecording'][_0x72ff('0x1c')](_0x2ab803)['then'](function(_0x51c228){_0x32563a[_0x72ff('0x1c')]=_0x51c228;if(_0xc3f2e1[_0x72ff('0x2d')]['includeAll']){_0x26dd1a[_0x72ff('0x3b')]=[{'all':!![]}];}return db[_0x72ff('0x26')]['findAll'](_0x26dd1a);})[_0x72ff('0x21')](function(_0x5dfcb7){_0x32563a[_0x72ff('0x3c')]=_0x5dfcb7;return _0x32563a;})['then'](respondWithFilteredResult(_0x4faac8,_0x26dd1a))['catch'](handleError(_0x4faac8,null));};exports[_0x72ff('0x3d')]=function(_0x344d97,_0x141975){var _0x23c9c2={'raw':!![],'where':{'id':_0x344d97['params']['id']}},_0x2a5957={};_0x2a5957[_0x72ff('0x2b')]=_[_0x72ff('0x3e')](db[_0x72ff('0x26')][_0x72ff('0x27')]);_0x2a5957[_0x72ff('0x2d')]=_['keys'](_0x344d97[_0x72ff('0x2d')]);_0x2a5957[_0x72ff('0x2e')]=_[_0x72ff('0x30')](_0x2a5957[_0x72ff('0x2b')],_0x2a5957[_0x72ff('0x2d')]);_0x23c9c2[_0x72ff('0x2f')]=_[_0x72ff('0x30')](_0x2a5957[_0x72ff('0x2b')],qs[_0x72ff('0x31')](_0x344d97[_0x72ff('0x2d')][_0x72ff('0x31')]));_0x23c9c2[_0x72ff('0x2f')]=_0x23c9c2['attributes']['length']?_0x23c9c2[_0x72ff('0x2f')]:_0x2a5957['model'];if(_0x344d97[_0x72ff('0x2d')][_0x72ff('0x3f')]){_0x23c9c2[_0x72ff('0x3b')]=[{'all':!![]}];}_0x23c9c2=_['merge']({},_0x23c9c2,_0x344d97[_0x72ff('0x40')]);return db[_0x72ff('0x26')][_0x72ff('0x41')](_0x23c9c2)[_0x72ff('0x21')](handleEntityNotFound(_0x141975,null))['then'](respondWithResult(_0x141975,null))[_0x72ff('0x42')](handleError(_0x141975,null));};exports[_0x72ff('0x43')]=function(_0x360227,_0x4c54c8){return db['SquareRecording'][_0x72ff('0x43')](_0x360227[_0x72ff('0x44')],{})['then'](respondWithResult(_0x4c54c8,0xc9))['catch'](handleError(_0x4c54c8,null));};exports[_0x72ff('0x45')]=function(_0x502c6f,_0x53bf07){if(_0x502c6f[_0x72ff('0x44')]['id']){delete _0x502c6f[_0x72ff('0x44')]['id'];}return db['SquareRecording'][_0x72ff('0x41')]({'where':{'id':_0x502c6f[_0x72ff('0x46')]['id']}})['then'](handleEntityNotFound(_0x53bf07,null))[_0x72ff('0x21')](saveUpdates(_0x502c6f[_0x72ff('0x44')],null))[_0x72ff('0x21')](respondWithResult(_0x53bf07,null))['catch'](handleError(_0x53bf07,null));};exports['download']=function(_0x39558d,_0x54e8e4,_0x2a09e1){var _0x1991c2=require(_0x72ff('0x47'));var _0x44502b=![];var _0x2f69b2={};if(_0x39558d[_0x72ff('0x2d')][_0x72ff('0x29')]&&_0x39558d['query']['type']===_0x72ff('0x48')){_0x2f69b2[_0x72ff('0x48')]=_0x39558d[_0x72ff('0x46')]['id'];}else{_0x2f69b2['id']=_0x39558d['params']['id'];}return db[_0x72ff('0x26')][_0x72ff('0x41')]({'where':_0x2f69b2,'attributes':['id',_0x72ff('0x49'),_0x72ff('0x4a')],'raw':!![]})[_0x72ff('0x21')](handleEntityNotFound(_0x54e8e4,null))[_0x72ff('0x21')](function(_0xedca62){if(_0xedca62){var _0x9d285e=_0xedca62['savePath'];var _0x324a69=util[_0x72ff('0x4b')](_0x72ff('0x4c'),_0x9d285e);if(fs['existsSync'](_0x324a69)){_0x44502b=!![];return _0x1991c2[_0x72ff('0x4d')](_0x324a69,_0x9d285e,config['secrets'][_0x72ff('0x4e')])[_0x72ff('0x21')](function(){return _0xedca62;});}return _0xedca62;}})['then'](function(_0x2401ff){if(_0x2401ff){var _0x525dc8=_0x2401ff[_0x72ff('0x49')];if(!fs[_0x72ff('0x4f')](_0x525dc8)){throw new db[(_0x72ff('0x50'))]['ValidationError'](_0x72ff('0x51'));}if(_0x2401ff[_0x72ff('0x4a')]){return _0x54e8e4['download'](_0x525dc8,_0x2401ff[_0x72ff('0x4a')]+path[_0x72ff('0x52')](_0x525dc8),function(){if(_0x44502b){fs[_0x72ff('0x53')](_0x525dc8);}});}else{return _0x54e8e4['download'](_0x525dc8,function(_0x2d80fa){if(_0x44502b){fs[_0x72ff('0x53')](_0x525dc8);}});}}})[_0x72ff('0x42')](function(_0x156ce4){if(_0x156ce4['message']===_0x72ff('0x51')){_0x54e8e4['status'](0x194)['send'](_0x72ff('0x54'));}else{return handleError(_0x54e8e4,null);}});};exports[_0x72ff('0x55')]=function(_0x61c1d,_0x1b457e){return db[_0x72ff('0x26')][_0x72ff('0x41')]({'where':{'id':_0x61c1d['params']['id']}})[_0x72ff('0x21')](function(_0x2713e0){if(_['isNil'](_0x2713e0)){throw new ReferenceError(_0x72ff('0x56'));}return _0x2713e0;})['then'](function(_0x382530){var _0x3e50dd=_0x382530['savePath'];logger[_0x72ff('0x57')](_0x72ff('0x58'),_0x3e50dd);if(!_[_0x72ff('0x59')](_0x382530[_0x72ff('0x49')])&&fs[_0x72ff('0x4f')](_0x3e50dd)){logger[_0x72ff('0x57')](_0x72ff('0x5a')+_0x3e50dd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x72ff('0x5b')](_0x3e50dd);}_0x3e50dd=_0x3e50dd+'.cypher';if(!_[_0x72ff('0x59')](_0x382530['savePath'])&&fs[_0x72ff('0x4f')](_0x3e50dd)){logger[_0x72ff('0x57')](_0x72ff('0x5a')+_0x3e50dd+_0x72ff('0x5c'));fs[_0x72ff('0x5b')](_0x3e50dd);}return _0x382530;})[_0x72ff('0x21')](function(_0x401769){if(!_0x401769)throw new InternalError();return _0x401769['destroy']();})[_0x72ff('0x21')](function(){_0x1b457e[_0x72ff('0x22')](0xcc)[_0x72ff('0x18')]();})[_0x72ff('0x42')](handleError(_0x1b457e,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index cee47c3..481cc44 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 _0x4351=['exports','define','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x4351,0x1b5));var _0x1435=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4351[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x1435('0x0'));var util=require(_0x1435('0x1'));var logger=require(_0x1435('0x2'))(_0x1435('0x3'));var moment=require(_0x1435('0x4'));var BPromise=require(_0x1435('0x5'));var rp=require(_0x1435('0x6'));var fs=require('fs');var path=require(_0x1435('0x7'));var rimraf=require(_0x1435('0x8'));var config=require(_0x1435('0x9'));var attributes=require(_0x1435('0xa'));module[_0x1435('0xb')]=function(_0x1f0838,_0x3a9f9a){return _0x1f0838[_0x1435('0xc')]('SquareRecording',attributes,{'tableName':_0x1435('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd69e=['../../config/logger','moment','bluebird','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util'];(function(_0x1fd441,_0x2629bf){var _0x411a91=function(_0x5d14e3){while(--_0x5d14e3){_0x1fd441['push'](_0x1fd441['shift']());}};_0x411a91(++_0x2629bf);}(_0xd69e,0xa0));var _0xed69=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xd69e[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var logger=require(_0xed69('0x2'))('api');var moment=require(_0xed69('0x3'));var BPromise=require(_0xed69('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed69('0x5'));module['exports']=function(_0x5c6d8f,_0x1c85d5){return _0x5c6d8f[_0xed69('0x6')](_0xed69('0x7'),attributes,{'tableName':_0xed69('0x8'),'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 9ebb9c2..7e045a1 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 _0xb125=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','SquareRecording','body','options','raw','CreateSquareRecording','lodash','util'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0xb125,0x1a2));var _0x5b12=function(_0x1f3547,_0x1487ca){_0x1f3547=_0x1f3547-0x0;var _0x1e5599=_0xb125[_0x1f3547];return _0x1e5599;};'use strict';var _=require(_0x5b12('0x0'));var util=require(_0x5b12('0x1'));var moment=require('moment');var BPromise=require(_0x5b12('0x2'));var rs=require(_0x5b12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b12('0x4'))['db'];var utils=require(_0x5b12('0x5'));var logger=require(_0x5b12('0x6'))(_0x5b12('0x7'));var config=require(_0x5b12('0x8'));var jayson=require(_0x5b12('0x9'));var client=jayson[_0x5b12('0xa')][_0x5b12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x984f69,_0x15f1d5,_0x29f024){return new BPromise(function(_0x445538,_0x153b09){return client[_0x5b12('0xc')](_0x984f69,_0x29f024)[_0x5b12('0xd')](function(_0x2299a0){logger['info'](_0x5b12('0xe'),_0x15f1d5,_0x5b12('0xf'));logger[_0x5b12('0x10')](_0x5b12('0x11'),_0x15f1d5,_0x5b12('0xf'),JSON[_0x5b12('0x12')](_0x2299a0));if(_0x2299a0[_0x5b12('0x13')]){if(_0x2299a0[_0x5b12('0x13')]['code']===0x1f4){logger[_0x5b12('0x13')](_0x5b12('0xe'),_0x15f1d5,_0x2299a0['error']['message']);return _0x153b09(_0x2299a0['error'][_0x5b12('0x14')]);}logger['error'](_0x5b12('0xe'),_0x15f1d5,_0x2299a0[_0x5b12('0x13')][_0x5b12('0x14')]);return _0x445538(_0x2299a0[_0x5b12('0x13')][_0x5b12('0x14')]);}else{logger[_0x5b12('0x15')](_0x5b12('0xe'),_0x15f1d5,'request\x20sent');_0x445538(_0x2299a0['result'][_0x5b12('0x14')]);}})[_0x5b12('0x16')](function(_0x1a235a){logger[_0x5b12('0x13')](_0x5b12('0xe'),_0x15f1d5,_0x1a235a);_0x153b09(_0x1a235a);});});}exports['CreateSquareRecording']=function(_0x10452d){var _0x3e923b=this;return new Promise(function(_0x283bc0,_0xc35583){return db[_0x5b12('0x17')]['create'](_0x10452d[_0x5b12('0x18')],{'raw':_0x10452d['options']?_0x10452d[_0x5b12('0x19')][_0x5b12('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x48e3cc){logger[_0x5b12('0x15')](_0x5b12('0x1b'),_0x10452d);logger[_0x5b12('0x10')]('CreateSquareRecording',_0x10452d,JSON[_0x5b12('0x12')](_0x48e3cc));_0x283bc0(_0x48e3cc);})[_0x5b12('0x16')](function(_0xc34701){logger[_0x5b12('0x13')]('CreateSquareRecording',_0xc34701[_0x5b12('0x14')],_0x10452d);_0xc35583(_0x3e923b[_0x5b12('0x13')](0x1f4,_0xc34701['message']));});});}; \ No newline at end of file +var _0x34e6=['request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','info'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x34e6,0x10b));var _0x634e=function(_0x18dca2,_0x2d4082){_0x18dca2=_0x18dca2-0x0;var _0x46fee5=_0x34e6[_0x18dca2];return _0x46fee5;};'use strict';var _=require(_0x634e('0x0'));var util=require(_0x634e('0x1'));var moment=require(_0x634e('0x2'));var BPromise=require(_0x634e('0x3'));var rs=require(_0x634e('0x4'));var fs=require('fs');var Redis=require(_0x634e('0x5'));var db=require(_0x634e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x634e('0x7'))(_0x634e('0x8'));var config=require('../../config/environment');var jayson=require(_0x634e('0x9'));var client=jayson['client'][_0x634e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3189b3,_0x409089,_0x480e70){return new BPromise(function(_0x3cdf3a,_0x12b61f){return client['request'](_0x3189b3,_0x480e70)[_0x634e('0xb')](function(_0x3bfe30){logger[_0x634e('0xc')]('SquareRecording,\x20%s,\x20%s',_0x409089,_0x634e('0xd'));logger['debug'](_0x634e('0xe'),_0x409089,_0x634e('0xd'),JSON[_0x634e('0xf')](_0x3bfe30));if(_0x3bfe30['error']){if(_0x3bfe30[_0x634e('0x10')][_0x634e('0x11')]===0x1f4){logger[_0x634e('0x10')](_0x634e('0x12'),_0x409089,_0x3bfe30[_0x634e('0x10')][_0x634e('0x13')]);return _0x12b61f(_0x3bfe30[_0x634e('0x10')][_0x634e('0x13')]);}logger[_0x634e('0x10')](_0x634e('0x12'),_0x409089,_0x3bfe30[_0x634e('0x10')]['message']);return _0x3cdf3a(_0x3bfe30[_0x634e('0x10')][_0x634e('0x13')]);}else{logger[_0x634e('0xc')](_0x634e('0x12'),_0x409089,'request\x20sent');_0x3cdf3a(_0x3bfe30[_0x634e('0x14')][_0x634e('0x13')]);}})['catch'](function(_0x289919){logger[_0x634e('0x10')]('SquareRecording,\x20%s,\x20%s',_0x409089,_0x289919);_0x12b61f(_0x289919);});});}exports[_0x634e('0x15')]=function(_0x20a130){var _0x5c723=this;return new Promise(function(_0x38a43e,_0x320a2c){return db[_0x634e('0x16')][_0x634e('0x17')](_0x20a130[_0x634e('0x18')],{'raw':_0x20a130[_0x634e('0x19')]?_0x20a130[_0x634e('0x19')][_0x634e('0x1a')]===undefined?!![]:![]:!![]})[_0x634e('0xb')](function(_0x102f3e){logger[_0x634e('0xc')]('CreateSquareRecording',_0x20a130);logger['debug'](_0x634e('0x15'),_0x20a130,JSON[_0x634e('0xf')](_0x102f3e));_0x38a43e(_0x102f3e);})[_0x634e('0x1b')](function(_0x364c7d){logger[_0x634e('0x10')](_0x634e('0x15'),_0x364c7d[_0x634e('0x13')],_0x20a130);_0x320a2c(_0x5c723[_0x634e('0x10')](0x1f4,_0x364c7d[_0x634e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b6146a7..5784564 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x2f10ee,_0x46c931){var _0x28886e=function(_0x5e45d0){while(--_0x5e45d0){_0x2f10ee['push'](_0x2f10ee['shift']());}};_0x28886e(++_0x46c931);}(_0xe706,0xa3));var _0x6e70=function(_0x1508e9,_0x5dfaec){_0x1508e9=_0x1508e9-0x0;var _0x5a0bf5=_0xe706[_0x1508e9];return _0x5a0bf5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _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(_0x446970,_0x2e8abc){var _0xccb49a=function(_0x49d1f1){while(--_0x49d1f1){_0x446970['push'](_0x446970['shift']());}};_0xccb49a(++_0x2e8abc);}(_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('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index fdfc20c..6c0cab0 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 _0x4a70=['DATE','STRING'];(function(_0x4aad27,_0x2fe79f){var _0x114e91=function(_0x4b2568){while(--_0x4b2568){_0x4aad27['push'](_0x4aad27['shift']());}};_0x114e91(++_0x2fe79f);}(_0x4a70,0x83));var _0x04a7=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x4a70[_0x176317];return _0xef2759;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0x04a7('0x0')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x04a7('0x0')]},'type':{'type':Sequelize[_0x04a7('0x0')]},'uniqueid':{'type':Sequelize[_0x04a7('0x0')]},'version':{'type':Sequelize[_0x04a7('0x0')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x04a7('0x0')]},'callingani2':{'type':Sequelize[_0x04a7('0x0')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x04a7('0x0')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x04a7('0x0')]},'context':{'type':Sequelize[_0x04a7('0x0')]},'extension':{'type':Sequelize[_0x04a7('0x0')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x04a7('0x0')]},'accountcode':{'type':Sequelize[_0x04a7('0x0')]},'threadid':{'type':Sequelize[_0x04a7('0x0')]},'project_name':{'type':Sequelize[_0x04a7('0x0')]},'joinAt':{'type':Sequelize[_0x04a7('0x1')]},'leaveAt':{'type':Sequelize[_0x04a7('0x1')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x312f=['exports','STRING','DATE','BOOLEAN'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x312f,0x17c));var _0xf312=function(_0x4c40e1,_0x1a3e84){_0x4c40e1=_0x4c40e1-0x0;var _0x24487a=_0x312f[_0x4c40e1];return _0x24487a;};'use strict';var Sequelize=require('sequelize');module[_0xf312('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xf312('0x1')]},'request':{'type':Sequelize[_0xf312('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf312('0x1')]},'type':{'type':Sequelize[_0xf312('0x1')]},'uniqueid':{'type':Sequelize[_0xf312('0x1')]},'version':{'type':Sequelize[_0xf312('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xf312('0x1')]},'callingani2':{'type':Sequelize[_0xf312('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xf312('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xf312('0x1')]},'context':{'type':Sequelize[_0xf312('0x1')]},'extension':{'type':Sequelize[_0xf312('0x1')]},'priority':{'type':Sequelize[_0xf312('0x1')]},'enhanced':{'type':Sequelize[_0xf312('0x1')]},'accountcode':{'type':Sequelize[_0xf312('0x1')]},'threadid':{'type':Sequelize[_0xf312('0x1')]},'project_name':{'type':Sequelize[_0xf312('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf312('0x2')]},'bot':{'type':Sequelize[_0xf312('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 4f952ad..44dfbf2 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 _0xd3f9=['model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','SquareReport','includeAll','include','rows','catch','show','params','fields','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xd3f9,0x1e5));var _0x9d3f=function(_0x15a346,_0x46d825){_0x15a346=_0x15a346-0x0;var _0x275a0f=_0xd3f9[_0x15a346];return _0x275a0f;};'use strict';var emlformat=require(_0x9d3f('0x0'));var rimraf=require(_0x9d3f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d3f('0x2'));var rp=require(_0x9d3f('0x3'));var moment=require(_0x9d3f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9d3f('0x5'));var util=require(_0x9d3f('0x6'));var path=require('path');var sox=require(_0x9d3f('0x7'));var csv=require(_0x9d3f('0x8'));var ejs=require(_0x9d3f('0x9'));var fs=require('fs');var fs_extra=require(_0x9d3f('0xa'));var _=require(_0x9d3f('0xb'));var squel=require('squel');var crypto=require(_0x9d3f('0xc'));var jsforce=require(_0x9d3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9d3f('0xe'));var Papa=require(_0x9d3f('0xf'));var Redis=require('ioredis');var authService=require(_0x9d3f('0x10'));var qs=require(_0x9d3f('0x11'));var as=require(_0x9d3f('0x12'));var hardwareService=require(_0x9d3f('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9d3f('0x14'));var licenseUtil=require(_0x9d3f('0x15'));var db=require(_0x9d3f('0x16'))['db'];function respondWithStatusCode(_0x5e835c,_0x18c463){_0x18c463=_0x18c463||0xcc;return function(_0x47d523){if(_0x47d523){return _0x5e835c[_0x9d3f('0x17')](_0x18c463);}return _0x5e835c['status'](_0x18c463)[_0x9d3f('0x18')]();};}function respondWithResult(_0x1b5986,_0x2c0368){_0x2c0368=_0x2c0368||0xc8;return function(_0x5c683d){if(_0x5c683d){return _0x1b5986['status'](_0x2c0368)[_0x9d3f('0x19')](_0x5c683d);}};}function respondWithFilteredResult(_0x501049,_0x56dc87){return function(_0x494f7b){if(_0x494f7b){var _0x16a412=typeof _0x56dc87['offset']===_0x9d3f('0x1a')&&typeof _0x56dc87[_0x9d3f('0x1b')]===_0x9d3f('0x1a');var _0x420d5b=_0x494f7b[_0x9d3f('0x1c')];var _0xfe01cb=_0x16a412?0x0:_0x56dc87[_0x9d3f('0x1d')];var _0x55641a=_0x16a412?_0x494f7b['count']:_0x56dc87[_0x9d3f('0x1d')]+_0x56dc87[_0x9d3f('0x1b')];var _0xe2ce86;if(_0x55641a>=_0x420d5b){_0x55641a=_0x420d5b;_0xe2ce86=0xc8;}else{_0xe2ce86=0xce;}_0x501049[_0x9d3f('0x1e')](_0xe2ce86);return _0x501049[_0x9d3f('0x1f')](_0x9d3f('0x20'),_0xfe01cb+'-'+_0x55641a+'/'+_0x420d5b)[_0x9d3f('0x19')](_0x494f7b);}return null;};}function patchUpdates(_0x11aadb){return function(_0x5c0676){try{jsonpatch[_0x9d3f('0x21')](_0x5c0676,_0x11aadb,!![]);}catch(_0x1bed73){return BPromise[_0x9d3f('0x22')](_0x1bed73);}return _0x5c0676[_0x9d3f('0x23')]();};}function saveUpdates(_0x137035,_0x2e3905){return function(_0x4a0120){if(_0x4a0120){return _0x4a0120['update'](_0x137035)[_0x9d3f('0x24')](function(_0x3d9ace){return _0x3d9ace;});}return null;};}function removeEntity(_0x4cbc05,_0x43e427){return function(_0x2f862c){if(_0x2f862c){return _0x2f862c[_0x9d3f('0x25')]()['then'](function(){_0x4cbc05['status'](0xcc)[_0x9d3f('0x18')]();});}};}function handleEntityNotFound(_0x3e2d44,_0x40565b){return function(_0x5f57da){if(!_0x5f57da){_0x3e2d44[_0x9d3f('0x17')](0x194);}return _0x5f57da;};}function handleError(_0x46951f,_0x24b92e){_0x24b92e=_0x24b92e||0x1f4;return function(_0x3bf613){logger[_0x9d3f('0x26')](_0x3bf613[_0x9d3f('0x27')]);if(_0x3bf613[_0x9d3f('0x28')]){delete _0x3bf613[_0x9d3f('0x28')];}_0x46951f[_0x9d3f('0x1e')](_0x24b92e)[_0x9d3f('0x29')](_0x3bf613);};}exports[_0x9d3f('0x2a')]=function(_0x76908a,_0x2b2dc9){var _0x556bb8={},_0x4a1149={},_0x81b111={'count':0x0,'rows':[]};var _0x14110e=_[_0x9d3f('0x2b')](db['SquareReport'][_0x9d3f('0x2c')],function(_0x2c1a5c){return{'name':_0x2c1a5c['fieldName'],'type':_0x2c1a5c[_0x9d3f('0x2d')][_0x9d3f('0x2e')]};});_0x4a1149[_0x9d3f('0x2f')]=_[_0x9d3f('0x2b')](_0x14110e,_0x9d3f('0x28'));_0x4a1149[_0x9d3f('0x30')]=_[_0x9d3f('0x31')](_0x76908a[_0x9d3f('0x30')]);_0x4a1149[_0x9d3f('0x32')]=_[_0x9d3f('0x33')](_0x4a1149[_0x9d3f('0x2f')],_0x4a1149[_0x9d3f('0x30')]);_0x556bb8[_0x9d3f('0x34')]=_[_0x9d3f('0x33')](_0x4a1149[_0x9d3f('0x2f')],qs['fields'](_0x76908a[_0x9d3f('0x30')]['fields']));_0x556bb8['attributes']=_0x556bb8[_0x9d3f('0x34')][_0x9d3f('0x35')]?_0x556bb8[_0x9d3f('0x34')]:_0x4a1149[_0x9d3f('0x2f')];if(!_0x76908a['query'][_0x9d3f('0x36')](_0x9d3f('0x37'))){_0x556bb8[_0x9d3f('0x1b')]=qs['limit'](_0x76908a[_0x9d3f('0x30')]['limit']);_0x556bb8[_0x9d3f('0x1d')]=qs[_0x9d3f('0x1d')](_0x76908a[_0x9d3f('0x30')][_0x9d3f('0x1d')]);}_0x556bb8[_0x9d3f('0x38')]=qs[_0x9d3f('0x39')](_0x76908a['query'][_0x9d3f('0x39')]);_0x556bb8['where']=qs['filters'](_[_0x9d3f('0x3a')](_0x76908a[_0x9d3f('0x30')],_0x4a1149[_0x9d3f('0x32')]),_0x14110e);if(_0x76908a['query'][_0x9d3f('0x3b')]){_0x556bb8[_0x9d3f('0x3c')]=_[_0x9d3f('0x3d')](_0x556bb8[_0x9d3f('0x3c')],{'$or':_[_0x9d3f('0x2b')](_0x14110e,function(_0x5e5331){if(_0x5e5331['type']!=='VIRTUAL'){var _0x3592d5={};_0x3592d5[_0x5e5331[_0x9d3f('0x28')]]={'$like':'%'+_0x76908a['query'][_0x9d3f('0x3b')]+'%'};return _0x3592d5;}})});}_0x556bb8=_[_0x9d3f('0x3d')]({},_0x556bb8,_0x76908a[_0x9d3f('0x3e')]);var _0x44a3e8={'where':_0x556bb8['where']};return db[_0x9d3f('0x3f')][_0x9d3f('0x1c')](_0x44a3e8)['then'](function(_0x3ba9df){_0x81b111['count']=_0x3ba9df;if(_0x76908a['query'][_0x9d3f('0x40')]){_0x556bb8[_0x9d3f('0x41')]=[{'all':!![]}];}return db[_0x9d3f('0x3f')]['findAll'](_0x556bb8);})[_0x9d3f('0x24')](function(_0x59bb39){_0x81b111[_0x9d3f('0x42')]=_0x59bb39;return _0x81b111;})[_0x9d3f('0x24')](respondWithFilteredResult(_0x2b2dc9,_0x556bb8))[_0x9d3f('0x43')](handleError(_0x2b2dc9,null));};exports[_0x9d3f('0x44')]=function(_0xd309af,_0x97dcd6){var _0x24359c={'raw':!![],'where':{'id':_0xd309af[_0x9d3f('0x45')]['id']}},_0x3057b9={};_0x3057b9[_0x9d3f('0x2f')]=_[_0x9d3f('0x31')](db[_0x9d3f('0x3f')][_0x9d3f('0x2c')]);_0x3057b9[_0x9d3f('0x30')]=_['keys'](_0xd309af[_0x9d3f('0x30')]);_0x3057b9['filters']=_[_0x9d3f('0x33')](_0x3057b9[_0x9d3f('0x2f')],_0x3057b9[_0x9d3f('0x30')]);_0x24359c[_0x9d3f('0x34')]=_['intersection'](_0x3057b9[_0x9d3f('0x2f')],qs[_0x9d3f('0x46')](_0xd309af[_0x9d3f('0x30')][_0x9d3f('0x46')]));_0x24359c[_0x9d3f('0x34')]=_0x24359c[_0x9d3f('0x34')][_0x9d3f('0x35')]?_0x24359c['attributes']:_0x3057b9[_0x9d3f('0x2f')];if(_0xd309af[_0x9d3f('0x30')][_0x9d3f('0x40')]){_0x24359c['include']=[{'all':!![]}];}_0x24359c=_['merge']({},_0x24359c,_0xd309af[_0x9d3f('0x3e')]);return db[_0x9d3f('0x3f')][_0x9d3f('0x47')](_0x24359c)[_0x9d3f('0x24')](handleEntityNotFound(_0x97dcd6,null))['then'](respondWithResult(_0x97dcd6,null))[_0x9d3f('0x43')](handleError(_0x97dcd6,null));};exports['create']=function(_0x297ce7,_0x4f4c0e){return db[_0x9d3f('0x3f')][_0x9d3f('0x48')](_0x297ce7[_0x9d3f('0x49')],{})[_0x9d3f('0x24')](respondWithResult(_0x4f4c0e,0xc9))['catch'](handleError(_0x4f4c0e,null));};exports[_0x9d3f('0x4a')]=function(_0x592730,_0xb0722b){if(_0x592730['body']['id']){delete _0x592730[_0x9d3f('0x49')]['id'];}return db['SquareReport'][_0x9d3f('0x47')]({'where':{'id':_0x592730[_0x9d3f('0x45')]['id']}})[_0x9d3f('0x24')](handleEntityNotFound(_0xb0722b,null))[_0x9d3f('0x24')](saveUpdates(_0x592730['body'],null))[_0x9d3f('0x24')](respondWithResult(_0xb0722b,null))[_0x9d3f('0x43')](handleError(_0xb0722b,null));};exports[_0x9d3f('0x25')]=function(_0x24e1e2,_0xf7c77c){return db[_0x9d3f('0x3f')][_0x9d3f('0x47')]({'where':{'id':_0x24e1e2['params']['id']}})[_0x9d3f('0x24')](handleEntityNotFound(_0xf7c77c,null))['then'](removeEntity(_0xf7c77c,null))[_0x9d3f('0x43')](handleError(_0xf7c77c,null));};exports[_0x9d3f('0x4b')]=function(_0x5cfb44,_0x2a5b80){return db[_0x9d3f('0x3f')][_0x9d3f('0x4b')]()[_0x9d3f('0x24')](respondWithResult(_0x2a5b80,null))['catch'](handleError(_0x2a5b80,null));}; \ No newline at end of file +var _0x7bfa=['../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','sendStatus','error','stack','name','send','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x2ed4e9,_0x5dc89b){var _0x515748=function(_0x5a0c67){while(--_0x5a0c67){_0x2ed4e9['push'](_0x2ed4e9['shift']());}};_0x515748(++_0x5dc89b);}(_0x7bfa,0x103));var _0xa7bf=function(_0x49f913,_0x12ccd8){_0x49f913=_0x49f913-0x0;var _0xf48ea5=_0x7bfa[_0x49f913];return _0xf48ea5;};'use strict';var emlformat=require(_0xa7bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa7bf('0x1'));var jsonpatch=require(_0xa7bf('0x2'));var rp=require(_0xa7bf('0x3'));var moment=require(_0xa7bf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa7bf('0x5'));var path=require(_0xa7bf('0x6'));var sox=require(_0xa7bf('0x7'));var csv=require('to-csv');var ejs=require(_0xa7bf('0x8'));var fs=require('fs');var fs_extra=require(_0xa7bf('0x9'));var _=require(_0xa7bf('0xa'));var squel=require('squel');var crypto=require(_0xa7bf('0xb'));var jsforce=require(_0xa7bf('0xc'));var deskjs=require(_0xa7bf('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa7bf('0xe'));var Papa=require('papaparse');var Redis=require(_0xa7bf('0xf'));var authService=require(_0xa7bf('0x10'));var qs=require(_0xa7bf('0x11'));var as=require(_0xa7bf('0x12'));var hardwareService=require(_0xa7bf('0x13'));var logger=require('../../config/logger')(_0xa7bf('0x14'));var utils=require(_0xa7bf('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa7bf('0x16'));var db=require(_0xa7bf('0x17'))['db'];function respondWithStatusCode(_0x590707,_0x549381){_0x549381=_0x549381||0xcc;return function(_0xc6ca3d){if(_0xc6ca3d){return _0x590707['sendStatus'](_0x549381);}return _0x590707['status'](_0x549381)[_0xa7bf('0x18')]();};}function respondWithResult(_0x209110,_0x31603c){_0x31603c=_0x31603c||0xc8;return function(_0x23aeaf){if(_0x23aeaf){return _0x209110[_0xa7bf('0x19')](_0x31603c)[_0xa7bf('0x1a')](_0x23aeaf);}};}function respondWithFilteredResult(_0x24791a,_0x2c64c1){return function(_0x42256d){if(_0x42256d){var _0x35a72a=typeof _0x2c64c1[_0xa7bf('0x1b')]===_0xa7bf('0x1c')&&typeof _0x2c64c1[_0xa7bf('0x1d')]===_0xa7bf('0x1c');var _0x127ca4=_0x42256d[_0xa7bf('0x1e')];var _0x34a8d0=_0x35a72a?0x0:_0x2c64c1[_0xa7bf('0x1b')];var _0x18a9f3=_0x35a72a?_0x42256d['count']:_0x2c64c1[_0xa7bf('0x1b')]+_0x2c64c1[_0xa7bf('0x1d')];var _0x4ec9ac;if(_0x18a9f3>=_0x127ca4){_0x18a9f3=_0x127ca4;_0x4ec9ac=0xc8;}else{_0x4ec9ac=0xce;}_0x24791a['status'](_0x4ec9ac);return _0x24791a[_0xa7bf('0x1f')](_0xa7bf('0x20'),_0x34a8d0+'-'+_0x18a9f3+'/'+_0x127ca4)['json'](_0x42256d);}return null;};}function patchUpdates(_0x3f7b42){return function(_0x204d7f){try{jsonpatch[_0xa7bf('0x21')](_0x204d7f,_0x3f7b42,!![]);}catch(_0x3c483a){return BPromise['reject'](_0x3c483a);}return _0x204d7f['save']();};}function saveUpdates(_0x4d59fc,_0x401e73){return function(_0x578dcc){if(_0x578dcc){return _0x578dcc['update'](_0x4d59fc)[_0xa7bf('0x22')](function(_0xf4e245){return _0xf4e245;});}return null;};}function removeEntity(_0x3ac5f1,_0x336505){return function(_0x3b20d8){if(_0x3b20d8){return _0x3b20d8[_0xa7bf('0x23')]()[_0xa7bf('0x22')](function(){_0x3ac5f1[_0xa7bf('0x19')](0xcc)[_0xa7bf('0x18')]();});}};}function handleEntityNotFound(_0x594479,_0x16a436){return function(_0x4d24c2){if(!_0x4d24c2){_0x594479[_0xa7bf('0x24')](0x194);}return _0x4d24c2;};}function handleError(_0x10f4c4,_0xb92c61){_0xb92c61=_0xb92c61||0x1f4;return function(_0x3b4346){logger[_0xa7bf('0x25')](_0x3b4346[_0xa7bf('0x26')]);if(_0x3b4346[_0xa7bf('0x27')]){delete _0x3b4346['name'];}_0x10f4c4[_0xa7bf('0x19')](_0xb92c61)[_0xa7bf('0x28')](_0x3b4346);};}exports['index']=function(_0x50ab0d,_0x1946c0){var _0x148696={},_0x4ba329={},_0x402e2c={'count':0x0,'rows':[]};var _0x4d2756=_[_0xa7bf('0x29')](db[_0xa7bf('0x2a')][_0xa7bf('0x2b')],function(_0x21cbae){return{'name':_0x21cbae['fieldName'],'type':_0x21cbae[_0xa7bf('0x2c')][_0xa7bf('0x2d')]};});_0x4ba329[_0xa7bf('0x2e')]=_[_0xa7bf('0x29')](_0x4d2756,_0xa7bf('0x27'));_0x4ba329[_0xa7bf('0x2f')]=_[_0xa7bf('0x30')](_0x50ab0d['query']);_0x4ba329[_0xa7bf('0x31')]=_['intersection'](_0x4ba329[_0xa7bf('0x2e')],_0x4ba329['query']);_0x148696[_0xa7bf('0x32')]=_[_0xa7bf('0x33')](_0x4ba329['model'],qs[_0xa7bf('0x34')](_0x50ab0d[_0xa7bf('0x2f')][_0xa7bf('0x34')]));_0x148696[_0xa7bf('0x32')]=_0x148696['attributes'][_0xa7bf('0x35')]?_0x148696[_0xa7bf('0x32')]:_0x4ba329['model'];if(!_0x50ab0d[_0xa7bf('0x2f')][_0xa7bf('0x36')]('nolimit')){_0x148696[_0xa7bf('0x1d')]=qs['limit'](_0x50ab0d[_0xa7bf('0x2f')][_0xa7bf('0x1d')]);_0x148696[_0xa7bf('0x1b')]=qs['offset'](_0x50ab0d['query']['offset']);}_0x148696['order']=qs[_0xa7bf('0x37')](_0x50ab0d[_0xa7bf('0x2f')]['sort']);_0x148696[_0xa7bf('0x38')]=qs[_0xa7bf('0x31')](_['pick'](_0x50ab0d['query'],_0x4ba329['filters']),_0x4d2756);if(_0x50ab0d[_0xa7bf('0x2f')][_0xa7bf('0x39')]){_0x148696[_0xa7bf('0x38')]=_[_0xa7bf('0x3a')](_0x148696[_0xa7bf('0x38')],{'$or':_['map'](_0x4d2756,function(_0x773598){if(_0x773598[_0xa7bf('0x2c')]!==_0xa7bf('0x3b')){var _0x7c3c0e={};_0x7c3c0e[_0x773598[_0xa7bf('0x27')]]={'$like':'%'+_0x50ab0d[_0xa7bf('0x2f')][_0xa7bf('0x39')]+'%'};return _0x7c3c0e;}})});}_0x148696=_[_0xa7bf('0x3a')]({},_0x148696,_0x50ab0d[_0xa7bf('0x3c')]);var _0x1bb0d1={'where':_0x148696[_0xa7bf('0x38')]};return db[_0xa7bf('0x2a')][_0xa7bf('0x1e')](_0x1bb0d1)[_0xa7bf('0x22')](function(_0x213292){_0x402e2c[_0xa7bf('0x1e')]=_0x213292;if(_0x50ab0d[_0xa7bf('0x2f')][_0xa7bf('0x3d')]){_0x148696['include']=[{'all':!![]}];}return db[_0xa7bf('0x2a')][_0xa7bf('0x3e')](_0x148696);})[_0xa7bf('0x22')](function(_0x5d4578){_0x402e2c['rows']=_0x5d4578;return _0x402e2c;})[_0xa7bf('0x22')](respondWithFilteredResult(_0x1946c0,_0x148696))[_0xa7bf('0x3f')](handleError(_0x1946c0,null));};exports['show']=function(_0x41b3b3,_0x560514){var _0x3550bb={'raw':!![],'where':{'id':_0x41b3b3[_0xa7bf('0x40')]['id']}},_0x5bc0c7={};_0x5bc0c7[_0xa7bf('0x2e')]=_[_0xa7bf('0x30')](db[_0xa7bf('0x2a')][_0xa7bf('0x2b')]);_0x5bc0c7[_0xa7bf('0x2f')]=_[_0xa7bf('0x30')](_0x41b3b3[_0xa7bf('0x2f')]);_0x5bc0c7[_0xa7bf('0x31')]=_[_0xa7bf('0x33')](_0x5bc0c7[_0xa7bf('0x2e')],_0x5bc0c7[_0xa7bf('0x2f')]);_0x3550bb['attributes']=_['intersection'](_0x5bc0c7[_0xa7bf('0x2e')],qs[_0xa7bf('0x34')](_0x41b3b3[_0xa7bf('0x2f')]['fields']));_0x3550bb['attributes']=_0x3550bb[_0xa7bf('0x32')][_0xa7bf('0x35')]?_0x3550bb[_0xa7bf('0x32')]:_0x5bc0c7[_0xa7bf('0x2e')];if(_0x41b3b3[_0xa7bf('0x2f')][_0xa7bf('0x3d')]){_0x3550bb[_0xa7bf('0x41')]=[{'all':!![]}];}_0x3550bb=_[_0xa7bf('0x3a')]({},_0x3550bb,_0x41b3b3[_0xa7bf('0x3c')]);return db['SquareReport']['find'](_0x3550bb)[_0xa7bf('0x22')](handleEntityNotFound(_0x560514,null))[_0xa7bf('0x22')](respondWithResult(_0x560514,null))[_0xa7bf('0x3f')](handleError(_0x560514,null));};exports[_0xa7bf('0x42')]=function(_0x49c30f,_0x16363a){return db[_0xa7bf('0x2a')][_0xa7bf('0x42')](_0x49c30f[_0xa7bf('0x43')],{})[_0xa7bf('0x22')](respondWithResult(_0x16363a,0xc9))[_0xa7bf('0x3f')](handleError(_0x16363a,null));};exports['update']=function(_0x5f2a13,_0xbe442b){if(_0x5f2a13[_0xa7bf('0x43')]['id']){delete _0x5f2a13[_0xa7bf('0x43')]['id'];}return db[_0xa7bf('0x2a')][_0xa7bf('0x44')]({'where':{'id':_0x5f2a13[_0xa7bf('0x40')]['id']}})[_0xa7bf('0x22')](handleEntityNotFound(_0xbe442b,null))[_0xa7bf('0x22')](saveUpdates(_0x5f2a13[_0xa7bf('0x43')],null))[_0xa7bf('0x22')](respondWithResult(_0xbe442b,null))['catch'](handleError(_0xbe442b,null));};exports[_0xa7bf('0x23')]=function(_0x305161,_0x26663c){return db['SquareReport'][_0xa7bf('0x44')]({'where':{'id':_0x305161['params']['id']}})[_0xa7bf('0x22')](handleEntityNotFound(_0x26663c,null))[_0xa7bf('0x22')](removeEntity(_0x26663c,null))[_0xa7bf('0x3f')](handleError(_0x26663c,null));};exports[_0xa7bf('0x45')]=function(_0x516abb,_0x472e6a){return db['SquareReport'][_0xa7bf('0x45')]()[_0xa7bf('0x22')](respondWithResult(_0x472e6a,null))[_0xa7bf('0x3f')](handleError(_0x472e6a,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index e84b8fd..9da3c1b 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 _0x5b1e=['request-promise','path','rimraf','../../config/environment','exports','SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1dfcb9,_0x3f245e){var _0xc930a7=function(_0x4e8cfe){while(--_0x4e8cfe){_0x1dfcb9['push'](_0x1dfcb9['shift']());}};_0xc930a7(++_0x3f245e);}(_0x5b1e,0x9a));var _0xe5b1=function(_0x3dfada,_0x252088){_0x3dfada=_0x3dfada-0x0;var _0xf73f2=_0x5b1e[_0x3dfada];return _0xf73f2;};'use strict';var _=require(_0xe5b1('0x0'));var util=require(_0xe5b1('0x1'));var logger=require(_0xe5b1('0x2'))(_0xe5b1('0x3'));var moment=require(_0xe5b1('0x4'));var BPromise=require(_0xe5b1('0x5'));var rp=require(_0xe5b1('0x6'));var fs=require('fs');var path=require(_0xe5b1('0x7'));var rimraf=require(_0xe5b1('0x8'));var config=require(_0xe5b1('0x9'));var attributes=require('./squareReport.attributes');module[_0xe5b1('0xa')]=function(_0x161a9a,_0x1547c3){return _0x161a9a['define'](_0xe5b1('0xb'),attributes,{'tableName':_0xe5b1('0xc'),'paranoid':![],'indexes':[{'name':_0xe5b1('0xd'),'fields':[_0xe5b1('0xe'),'project_name']},{'name':_0xe5b1('0xf'),'fields':[_0xe5b1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7047=['leaveAt','util','../../config/logger','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','report_square'];(function(_0x479722,_0x231cef){var _0x2310fe=function(_0xd96529){while(--_0xd96529){_0x479722['push'](_0x479722['shift']());}};_0x2310fe(++_0x231cef);}(_0x7047,0x187));var _0x7704=function(_0x2876c4,_0x435253){_0x2876c4=_0x2876c4-0x0;var _0x441831=_0x7047[_0x2876c4];return _0x441831;};'use strict';var _=require('lodash');var util=require(_0x7704('0x0'));var logger=require(_0x7704('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7704('0x2'));var rimraf=require(_0x7704('0x3'));var config=require(_0x7704('0x4'));var attributes=require(_0x7704('0x5'));module[_0x7704('0x6')]=function(_0x2d1fea,_0xb5dc90){return _0x2d1fea['define'](_0x7704('0x7'),attributes,{'tableName':_0x7704('0x8'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid','project_name']},{'name':_0x7704('0x9'),'fields':[_0x7704('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 2e4f3cb..7ac08b5 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 _0x57b2=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','UpdateSquareReport','update','where','attributes','limit','then'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x57b2,0x14b));var _0x257b=function(_0x149670,_0x277815){_0x149670=_0x149670-0x0;var _0x5c2294=_0x57b2[_0x149670];return _0x5c2294;};'use strict';var _=require(_0x257b('0x0'));var util=require(_0x257b('0x1'));var moment=require(_0x257b('0x2'));var BPromise=require(_0x257b('0x3'));var rs=require(_0x257b('0x4'));var fs=require('fs');var Redis=require(_0x257b('0x5'));var db=require(_0x257b('0x6'))['db'];var utils=require(_0x257b('0x7'));var logger=require(_0x257b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x257b('0x9'));var client=jayson[_0x257b('0xa')][_0x257b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44f317,_0x39e0ed,_0x461333){return new BPromise(function(_0xc2ba9e,_0x1f2200){return client['request'](_0x44f317,_0x461333)['then'](function(_0x4da4b6){logger[_0x257b('0xc')](_0x257b('0xd'),_0x39e0ed,'request\x20sent');logger[_0x257b('0xe')](_0x257b('0xf'),_0x39e0ed,'request\x20sent',JSON['stringify'](_0x4da4b6));if(_0x4da4b6[_0x257b('0x10')]){if(_0x4da4b6[_0x257b('0x10')][_0x257b('0x11')]===0x1f4){logger[_0x257b('0x10')]('SquareReport,\x20%s,\x20%s',_0x39e0ed,_0x4da4b6[_0x257b('0x10')][_0x257b('0x12')]);return _0x1f2200(_0x4da4b6[_0x257b('0x10')][_0x257b('0x12')]);}logger[_0x257b('0x10')](_0x257b('0xd'),_0x39e0ed,_0x4da4b6[_0x257b('0x10')]['message']);return _0xc2ba9e(_0x4da4b6['error'][_0x257b('0x12')]);}else{logger[_0x257b('0xc')](_0x257b('0xd'),_0x39e0ed,'request\x20sent');_0xc2ba9e(_0x4da4b6[_0x257b('0x13')]['message']);}})[_0x257b('0x14')](function(_0x3df234){logger['error'](_0x257b('0xd'),_0x39e0ed,_0x3df234);_0x1f2200(_0x3df234);});});}exports[_0x257b('0x15')]=function(_0x297a7c){var _0x29f9cf=this;return new Promise(function(_0x313b75,_0x49be71){return db[_0x257b('0x16')]['create'](_0x297a7c[_0x257b('0x17')],{'raw':_0x297a7c[_0x257b('0x18')]?_0x297a7c[_0x257b('0x18')][_0x257b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x41e96c){logger[_0x257b('0xc')](_0x257b('0x15'),_0x297a7c);logger[_0x257b('0xe')](_0x257b('0x15'),_0x297a7c,JSON['stringify'](_0x41e96c));_0x313b75(_0x41e96c);})[_0x257b('0x14')](function(_0x3ce495){logger[_0x257b('0x10')](_0x257b('0x15'),_0x3ce495[_0x257b('0x12')],_0x297a7c);_0x49be71(_0x29f9cf[_0x257b('0x10')](0x1f4,_0x3ce495[_0x257b('0x12')]));});});};exports[_0x257b('0x1a')]=function(_0x8d55e1){var _0x570b68=this;return new Promise(function(_0x54da54,_0x2cd7ae){return db['SquareReport'][_0x257b('0x1b')](_0x8d55e1[_0x257b('0x17')],{'raw':_0x8d55e1[_0x257b('0x18')]?_0x8d55e1['options'][_0x257b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8d55e1[_0x257b('0x18')]?_0x8d55e1['options'][_0x257b('0x1c')]||null:null,'attributes':_0x8d55e1[_0x257b('0x18')]?_0x8d55e1[_0x257b('0x18')][_0x257b('0x1d')]||null:null,'limit':_0x8d55e1['options']?_0x8d55e1[_0x257b('0x18')][_0x257b('0x1e')]||null:null})[_0x257b('0x1f')](function(_0x384a8e){logger[_0x257b('0xc')](_0x257b('0x1a'),_0x8d55e1);logger[_0x257b('0xe')](_0x257b('0x1a'),_0x8d55e1,JSON[_0x257b('0x20')](_0x384a8e));_0x54da54(_0x384a8e);})['catch'](function(_0x1573bf){logger[_0x257b('0x10')](_0x257b('0x1a'),_0x1573bf[_0x257b('0x12')],_0x8d55e1);_0x2cd7ae(_0x570b68[_0x257b('0x10')](0x1f4,_0x1573bf[_0x257b('0x12')]));});});}; \ No newline at end of file +var _0x6a13=['result','catch','create','body','options','CreateSquareReport','UpdateSquareReport','SquareReport','update','raw','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x6a13,0x7a));var _0x36a1=function(_0x53a677,_0x5af0a2){_0x53a677=_0x53a677-0x0;var _0x15d753=_0x6a13[_0x53a677];return _0x15d753;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x36a1('0x0'));var BPromise=require(_0x36a1('0x1'));var rs=require(_0x36a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x36a1('0x3'))['db'];var utils=require(_0x36a1('0x4'));var logger=require('../../config/logger')(_0x36a1('0x5'));var config=require('../../config/environment');var jayson=require(_0x36a1('0x6'));var client=jayson[_0x36a1('0x7')][_0x36a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20b2dc,_0x17178a,_0x2918d8){return new BPromise(function(_0x1bbbbc,_0x29856b){return client['request'](_0x20b2dc,_0x2918d8)[_0x36a1('0x9')](function(_0x44288f){logger[_0x36a1('0xa')](_0x36a1('0xb'),_0x17178a,_0x36a1('0xc'));logger[_0x36a1('0xd')](_0x36a1('0xe'),_0x17178a,_0x36a1('0xc'),JSON[_0x36a1('0xf')](_0x44288f));if(_0x44288f['error']){if(_0x44288f['error']['code']===0x1f4){logger[_0x36a1('0x10')](_0x36a1('0xb'),_0x17178a,_0x44288f['error'][_0x36a1('0x11')]);return _0x29856b(_0x44288f[_0x36a1('0x10')][_0x36a1('0x11')]);}logger[_0x36a1('0x10')](_0x36a1('0xb'),_0x17178a,_0x44288f[_0x36a1('0x10')][_0x36a1('0x11')]);return _0x1bbbbc(_0x44288f[_0x36a1('0x10')][_0x36a1('0x11')]);}else{logger[_0x36a1('0xa')](_0x36a1('0xb'),_0x17178a,_0x36a1('0xc'));_0x1bbbbc(_0x44288f[_0x36a1('0x12')][_0x36a1('0x11')]);}})[_0x36a1('0x13')](function(_0x3cbd17){logger['error'](_0x36a1('0xb'),_0x17178a,_0x3cbd17);_0x29856b(_0x3cbd17);});});}exports['CreateSquareReport']=function(_0x3a1b01){var _0x1326d6=this;return new Promise(function(_0x586c00,_0x2bd574){return db['SquareReport'][_0x36a1('0x14')](_0x3a1b01[_0x36a1('0x15')],{'raw':_0x3a1b01['options']?_0x3a1b01[_0x36a1('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x36a1('0x9')](function(_0x5e9e81){logger[_0x36a1('0xa')]('CreateSquareReport',_0x3a1b01);logger[_0x36a1('0xd')](_0x36a1('0x17'),_0x3a1b01,JSON[_0x36a1('0xf')](_0x5e9e81));_0x586c00(_0x5e9e81);})['catch'](function(_0x106d82){logger['error'](_0x36a1('0x17'),_0x106d82[_0x36a1('0x11')],_0x3a1b01);_0x2bd574(_0x1326d6['error'](0x1f4,_0x106d82[_0x36a1('0x11')]));});});};exports[_0x36a1('0x18')]=function(_0x47cafc){var _0x4a1261=this;return new Promise(function(_0x2bbc71,_0x5ee3f7){return db[_0x36a1('0x19')][_0x36a1('0x1a')](_0x47cafc[_0x36a1('0x15')],{'raw':_0x47cafc[_0x36a1('0x16')]?_0x47cafc[_0x36a1('0x16')][_0x36a1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47cafc[_0x36a1('0x16')]?_0x47cafc['options']['where']||null:null,'attributes':_0x47cafc[_0x36a1('0x16')]?_0x47cafc[_0x36a1('0x16')]['attributes']||null:null,'limit':_0x47cafc[_0x36a1('0x16')]?_0x47cafc[_0x36a1('0x16')]['limit']||null:null})[_0x36a1('0x9')](function(_0x1d64df){logger[_0x36a1('0xa')](_0x36a1('0x18'),_0x47cafc);logger[_0x36a1('0xd')](_0x36a1('0x18'),_0x47cafc,JSON[_0x36a1('0xf')](_0x1d64df));_0x2bbc71(_0x1d64df);})['catch'](function(_0x8caffd){logger['error'](_0x36a1('0x18'),_0x8caffd[_0x36a1('0x11')],_0x47cafc);_0x5ee3f7(_0x4a1261[_0x36a1('0x10')](0x1f4,_0x8caffd[_0x36a1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index fe79b81..e544d92 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 _0x8d86=['./squareReportDetail.controller','get','isAuthenticated','describe','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1d50e1,_0x26faaf){var _0x3e8097=function(_0x5e8372){while(--_0x5e8372){_0x1d50e1['push'](_0x1d50e1['shift']());}};_0x3e8097(++_0x26faaf);}(_0x8d86,0xdc));var _0x68d8=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x8d86[_0x1abb09];return _0xea1c07;};'use strict';var multer=require(_0x68d8('0x0'));var util=require(_0x68d8('0x1'));var path=require(_0x68d8('0x2'));var timeout=require(_0x68d8('0x3'));var express=require(_0x68d8('0x4'));var router=express['Router']();var fs_extra=require(_0x68d8('0x5'));var auth=require(_0x68d8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x68d8('0x7'));var controller=require(_0x68d8('0x8'));router[_0x68d8('0x9')]('/',auth[_0x68d8('0xa')](),controller['index']);router[_0x68d8('0x9')]('/describe',auth[_0x68d8('0xa')](),controller[_0x68d8('0xb')]);router[_0x68d8('0x9')](_0x68d8('0xc'),auth[_0x68d8('0xa')](),controller[_0x68d8('0xd')]);router[_0x68d8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x68d8('0xf')](_0x68d8('0xc'),auth['isAuthenticated'](),controller[_0x68d8('0x10')]);router[_0x68d8('0x11')](_0x68d8('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x68d8('0x12')]=router; \ No newline at end of file +var _0x0d40=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./squareReportDetail.controller','get','index','isAuthenticated','/:id','show','put','update'];(function(_0x4cd917,_0x9c807a){var _0x14473d=function(_0x484728){while(--_0x484728){_0x4cd917['push'](_0x4cd917['shift']());}};_0x14473d(++_0x9c807a);}(_0x0d40,0xb6));var _0x00d4=function(_0x1e8219,_0x31b4a0){_0x1e8219=_0x1e8219-0x0;var _0x37d537=_0x0d40[_0x1e8219];return _0x37d537;};'use strict';var multer=require(_0x00d4('0x0'));var util=require(_0x00d4('0x1'));var path=require(_0x00d4('0x2'));var timeout=require(_0x00d4('0x3'));var express=require(_0x00d4('0x4'));var router=express['Router']();var fs_extra=require(_0x00d4('0x5'));var auth=require(_0x00d4('0x6'));var interaction=require(_0x00d4('0x7'));var config=require('../../config/environment');var controller=require(_0x00d4('0x8'));router[_0x00d4('0x9')]('/',auth['isAuthenticated'](),controller[_0x00d4('0xa')]);router[_0x00d4('0x9')]('/describe',auth[_0x00d4('0xb')](),controller['describe']);router[_0x00d4('0x9')](_0x00d4('0xc'),auth[_0x00d4('0xb')](),controller[_0x00d4('0xd')]);router['post']('/',auth[_0x00d4('0xb')](),controller['create']);router[_0x00d4('0xe')](_0x00d4('0xc'),auth['isAuthenticated'](),controller[_0x00d4('0xf')]);router[_0x00d4('0x10')](_0x00d4('0xc'),auth[_0x00d4('0xb')](),controller[_0x00d4('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 4c7356c..64451ed 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 _0x12d5=['TEXT','sequelize','exports','STRING'];(function(_0x22e5fd,_0x433bbc){var _0x46d33e=function(_0x3e040f){while(--_0x3e040f){_0x22e5fd['push'](_0x22e5fd['shift']());}};_0x46d33e(++_0x433bbc);}(_0x12d5,0x8d));var _0x512d=function(_0x3775ea,_0x325f1e){_0x3775ea=_0x3775ea-0x0;var _0xbea397=_0x12d5[_0x3775ea];return _0xbea397;};'use strict';var Sequelize=require(_0x512d('0x0'));module[_0x512d('0x1')]={'uniqueid':{'type':Sequelize[_0x512d('0x2')]},'node':{'type':Sequelize[_0x512d('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x512d('0x3')]},'project_name':{'type':Sequelize[_0x512d('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf378=['TEXT','sequelize','exports','STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xf378,0x109));var _0x8f37=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf378[_0x4d613c];return _0x301fe3;};'use strict';var Sequelize=require(_0x8f37('0x0'));module[_0x8f37('0x1')]={'uniqueid':{'type':Sequelize[_0x8f37('0x2')]},'node':{'type':Sequelize[_0x8f37('0x2')]},'application':{'type':Sequelize[_0x8f37('0x2')]},'data':{'type':Sequelize[_0x8f37('0x3')]},'project_name':{'type':Sequelize[_0x8f37('0x2')]},'callerid':{'type':Sequelize[_0x8f37('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4e0e757..ba96b5c 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 _0xe813=['filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','findAll','rows','catch','show','keys','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','status','index','map','rawAttributes','fieldName','type','key','query'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xe813,0xaf));var _0x3e81=function(_0x3bd497,_0x37d7a8){_0x3bd497=_0x3bd497-0x0;var _0x32f967=_0xe813[_0x3bd497];return _0x32f967;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3e81('0x0'));var zipdir=require(_0x3e81('0x1'));var jsonpatch=require(_0x3e81('0x2'));var rp=require(_0x3e81('0x3'));var moment=require('moment');var BPromise=require(_0x3e81('0x4'));var Mustache=require(_0x3e81('0x5'));var util=require(_0x3e81('0x6'));var path=require(_0x3e81('0x7'));var sox=require(_0x3e81('0x8'));var csv=require(_0x3e81('0x9'));var ejs=require(_0x3e81('0xa'));var fs=require('fs');var fs_extra=require(_0x3e81('0xb'));var _=require(_0x3e81('0xc'));var squel=require(_0x3e81('0xd'));var crypto=require(_0x3e81('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3e81('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e81('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e81('0x11'));var logger=require(_0x3e81('0x12'))(_0x3e81('0x13'));var utils=require(_0x3e81('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3e81('0x15'));var db=require(_0x3e81('0x16'))['db'];function respondWithStatusCode(_0xfb4ac7,_0x4552ac){_0x4552ac=_0x4552ac||0xcc;return function(_0x341d99){if(_0x341d99){return _0xfb4ac7['sendStatus'](_0x4552ac);}return _0xfb4ac7['status'](_0x4552ac)[_0x3e81('0x17')]();};}function respondWithResult(_0x57db34,_0x2e27fd){_0x2e27fd=_0x2e27fd||0xc8;return function(_0x3a0afe){if(_0x3a0afe){return _0x57db34['status'](_0x2e27fd)[_0x3e81('0x18')](_0x3a0afe);}};}function respondWithFilteredResult(_0x255afe,_0x3e7311){return function(_0x387d7d){if(_0x387d7d){var _0x380d44=typeof _0x3e7311[_0x3e81('0x19')]===_0x3e81('0x1a')&&typeof _0x3e7311[_0x3e81('0x1b')]===_0x3e81('0x1a');var _0x3297db=_0x387d7d[_0x3e81('0x1c')];var _0x4eafcd=_0x380d44?0x0:_0x3e7311[_0x3e81('0x19')];var _0x4dc3fe=_0x380d44?_0x387d7d['count']:_0x3e7311[_0x3e81('0x19')]+_0x3e7311[_0x3e81('0x1b')];var _0x4060b0;if(_0x4dc3fe>=_0x3297db){_0x4dc3fe=_0x3297db;_0x4060b0=0xc8;}else{_0x4060b0=0xce;}_0x255afe['status'](_0x4060b0);return _0x255afe[_0x3e81('0x1d')](_0x3e81('0x1e'),_0x4eafcd+'-'+_0x4dc3fe+'/'+_0x3297db)[_0x3e81('0x18')](_0x387d7d);}return null;};}function patchUpdates(_0x438017){return function(_0x38a7fd){try{jsonpatch[_0x3e81('0x1f')](_0x38a7fd,_0x438017,!![]);}catch(_0x4da617){return BPromise['reject'](_0x4da617);}return _0x38a7fd[_0x3e81('0x20')]();};}function saveUpdates(_0x17b6a3,_0x3b2bda){return function(_0x186d6d){if(_0x186d6d){return _0x186d6d[_0x3e81('0x21')](_0x17b6a3)['then'](function(_0x40faaa){return _0x40faaa;});}return null;};}function removeEntity(_0x1f4490,_0x570143){return function(_0x28d8d7){if(_0x28d8d7){return _0x28d8d7[_0x3e81('0x22')]()[_0x3e81('0x23')](function(){_0x1f4490['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43c629,_0x496cba){return function(_0x57c6c2){if(!_0x57c6c2){_0x43c629[_0x3e81('0x24')](0x194);}return _0x57c6c2;};}function handleError(_0x16e201,_0x5c5d63){_0x5c5d63=_0x5c5d63||0x1f4;return function(_0x3bf662){logger['error'](_0x3bf662[_0x3e81('0x25')]);if(_0x3bf662[_0x3e81('0x26')]){delete _0x3bf662[_0x3e81('0x26')];}_0x16e201[_0x3e81('0x27')](_0x5c5d63)['send'](_0x3bf662);};}exports[_0x3e81('0x28')]=function(_0x341e61,_0x485bf1){var _0x309ba0={},_0xd35dd9={},_0x343022={'count':0x0,'rows':[]};var _0x4e2641=_[_0x3e81('0x29')](db['SquareDetailsReport'][_0x3e81('0x2a')],function(_0x40eb6c){return{'name':_0x40eb6c[_0x3e81('0x2b')],'type':_0x40eb6c[_0x3e81('0x2c')][_0x3e81('0x2d')]};});_0xd35dd9['model']=_['map'](_0x4e2641,_0x3e81('0x26'));_0xd35dd9[_0x3e81('0x2e')]=_['keys'](_0x341e61[_0x3e81('0x2e')]);_0xd35dd9[_0x3e81('0x2f')]=_[_0x3e81('0x30')](_0xd35dd9[_0x3e81('0x31')],_0xd35dd9[_0x3e81('0x2e')]);_0x309ba0[_0x3e81('0x32')]=_[_0x3e81('0x30')](_0xd35dd9[_0x3e81('0x31')],qs[_0x3e81('0x33')](_0x341e61[_0x3e81('0x2e')][_0x3e81('0x33')]));_0x309ba0[_0x3e81('0x32')]=_0x309ba0[_0x3e81('0x32')]['length']?_0x309ba0[_0x3e81('0x32')]:_0xd35dd9[_0x3e81('0x31')];if(!_0x341e61[_0x3e81('0x2e')][_0x3e81('0x34')](_0x3e81('0x35'))){_0x309ba0[_0x3e81('0x1b')]=qs[_0x3e81('0x1b')](_0x341e61[_0x3e81('0x2e')][_0x3e81('0x1b')]);_0x309ba0[_0x3e81('0x19')]=qs[_0x3e81('0x19')](_0x341e61[_0x3e81('0x2e')]['offset']);}_0x309ba0[_0x3e81('0x36')]=qs[_0x3e81('0x37')](_0x341e61['query'][_0x3e81('0x37')]);_0x309ba0[_0x3e81('0x38')]=qs[_0x3e81('0x2f')](_[_0x3e81('0x39')](_0x341e61[_0x3e81('0x2e')],_0xd35dd9['filters']),_0x4e2641);if(_0x341e61[_0x3e81('0x2e')][_0x3e81('0x3a')]){_0x309ba0[_0x3e81('0x38')]=_[_0x3e81('0x3b')](_0x309ba0[_0x3e81('0x38')],{'$or':_[_0x3e81('0x29')](_0x4e2641,function(_0x51cf86){if(_0x51cf86[_0x3e81('0x2c')]!==_0x3e81('0x3c')){var _0x4720f2={};_0x4720f2[_0x51cf86['name']]={'$like':'%'+_0x341e61[_0x3e81('0x2e')]['filter']+'%'};return _0x4720f2;}})});}_0x309ba0=_[_0x3e81('0x3b')]({},_0x309ba0,_0x341e61[_0x3e81('0x3d')]);var _0x3a109b={'where':_0x309ba0[_0x3e81('0x38')]};return db[_0x3e81('0x3e')][_0x3e81('0x1c')](_0x3a109b)['then'](function(_0x1e4a8d){_0x343022[_0x3e81('0x1c')]=_0x1e4a8d;if(_0x341e61['query'][_0x3e81('0x3f')]){_0x309ba0['include']=[{'all':!![]}];}return db[_0x3e81('0x3e')][_0x3e81('0x40')](_0x309ba0);})[_0x3e81('0x23')](function(_0x370f05){_0x343022[_0x3e81('0x41')]=_0x370f05;return _0x343022;})[_0x3e81('0x23')](respondWithFilteredResult(_0x485bf1,_0x309ba0))[_0x3e81('0x42')](handleError(_0x485bf1,null));};exports[_0x3e81('0x43')]=function(_0x42a654,_0x3d8d4e){var _0x57e870={'raw':!![],'where':{'id':_0x42a654['params']['id']}},_0x29022c={};_0x29022c['model']=_[_0x3e81('0x44')](db[_0x3e81('0x3e')][_0x3e81('0x2a')]);_0x29022c[_0x3e81('0x2e')]=_[_0x3e81('0x44')](_0x42a654['query']);_0x29022c[_0x3e81('0x2f')]=_[_0x3e81('0x30')](_0x29022c[_0x3e81('0x31')],_0x29022c[_0x3e81('0x2e')]);_0x57e870[_0x3e81('0x32')]=_[_0x3e81('0x30')](_0x29022c[_0x3e81('0x31')],qs[_0x3e81('0x33')](_0x42a654[_0x3e81('0x2e')][_0x3e81('0x33')]));_0x57e870[_0x3e81('0x32')]=_0x57e870[_0x3e81('0x32')][_0x3e81('0x45')]?_0x57e870[_0x3e81('0x32')]:_0x29022c[_0x3e81('0x31')];if(_0x42a654['query'][_0x3e81('0x3f')]){_0x57e870['include']=[{'all':!![]}];}_0x57e870=_[_0x3e81('0x3b')]({},_0x57e870,_0x42a654['options']);return db[_0x3e81('0x3e')][_0x3e81('0x46')](_0x57e870)[_0x3e81('0x23')](handleEntityNotFound(_0x3d8d4e,null))[_0x3e81('0x23')](respondWithResult(_0x3d8d4e,null))[_0x3e81('0x42')](handleError(_0x3d8d4e,null));};exports[_0x3e81('0x47')]=function(_0x1dcb5f,_0x5d3266){return db['SquareDetailsReport'][_0x3e81('0x47')](_0x1dcb5f[_0x3e81('0x48')],{})[_0x3e81('0x23')](respondWithResult(_0x5d3266,0xc9))[_0x3e81('0x42')](handleError(_0x5d3266,null));};exports[_0x3e81('0x21')]=function(_0x40dc12,_0x354473){if(_0x40dc12['body']['id']){delete _0x40dc12[_0x3e81('0x48')]['id'];}return db[_0x3e81('0x3e')]['find']({'where':{'id':_0x40dc12['params']['id']}})[_0x3e81('0x23')](handleEntityNotFound(_0x354473,null))[_0x3e81('0x23')](saveUpdates(_0x40dc12['body'],null))[_0x3e81('0x23')](respondWithResult(_0x354473,null))[_0x3e81('0x42')](handleError(_0x354473,null));};exports[_0x3e81('0x22')]=function(_0x100256,_0x26443d){return db['SquareDetailsReport'][_0x3e81('0x46')]({'where':{'id':_0x100256['params']['id']}})['then'](handleEntityNotFound(_0x26443d,null))[_0x3e81('0x23')](removeEntity(_0x26443d,null))[_0x3e81('0x42')](handleError(_0x26443d,null));};exports['describe']=function(_0xb0c3b,_0x5108cc){return db[_0x3e81('0x3e')][_0x3e81('0x49')]()[_0x3e81('0x23')](respondWithResult(_0x5108cc,null))[_0x3e81('0x42')](handleError(_0x5108cc,null));}; \ No newline at end of file +var _0xe096=['sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','options','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','map','SquareDetailsReport','fieldName','type','key','model','name','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x97108c,_0x1e5da1){var _0x1c96cb=function(_0x48c007){while(--_0x48c007){_0x97108c['push'](_0x97108c['shift']());}};_0x1c96cb(++_0x1e5da1);}(_0xe096,0x198));var _0x6e09=function(_0x9a29ea,_0x5b8b29){_0x9a29ea=_0x9a29ea-0x0;var _0x11f261=_0xe096[_0x9a29ea];return _0x11f261;};'use strict';var emlformat=require(_0x6e09('0x0'));var rimraf=require(_0x6e09('0x1'));var zipdir=require(_0x6e09('0x2'));var jsonpatch=require(_0x6e09('0x3'));var rp=require(_0x6e09('0x4'));var moment=require(_0x6e09('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6e09('0x6'));var util=require(_0x6e09('0x7'));var path=require(_0x6e09('0x8'));var sox=require(_0x6e09('0x9'));var csv=require(_0x6e09('0xa'));var ejs=require(_0x6e09('0xb'));var fs=require('fs');var fs_extra=require(_0x6e09('0xc'));var _=require('lodash');var squel=require(_0x6e09('0xd'));var crypto=require(_0x6e09('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6e09('0xf'));var toCsv=require(_0x6e09('0xa'));var querystring=require(_0x6e09('0x10'));var Papa=require('papaparse');var Redis=require(_0x6e09('0x11'));var authService=require(_0x6e09('0x12'));var qs=require(_0x6e09('0x13'));var as=require(_0x6e09('0x14'));var hardwareService=require(_0x6e09('0x15'));var logger=require(_0x6e09('0x16'))('api');var utils=require(_0x6e09('0x17'));var config=require(_0x6e09('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa11617,_0x15876e){_0x15876e=_0x15876e||0xcc;return function(_0x451ad9){if(_0x451ad9){return _0xa11617['sendStatus'](_0x15876e);}return _0xa11617[_0x6e09('0x19')](_0x15876e)[_0x6e09('0x1a')]();};}function respondWithResult(_0xf5378b,_0x69e0ac){_0x69e0ac=_0x69e0ac||0xc8;return function(_0x4b1e60){if(_0x4b1e60){return _0xf5378b['status'](_0x69e0ac)['json'](_0x4b1e60);}};}function respondWithFilteredResult(_0x2b9b17,_0x149499){return function(_0x415013){if(_0x415013){var _0x51f54c=typeof _0x149499[_0x6e09('0x1b')]==='undefined'&&typeof _0x149499[_0x6e09('0x1c')]===_0x6e09('0x1d');var _0x14c469=_0x415013[_0x6e09('0x1e')];var _0x5ac8aa=_0x51f54c?0x0:_0x149499[_0x6e09('0x1b')];var _0x2f1330=_0x51f54c?_0x415013[_0x6e09('0x1e')]:_0x149499['offset']+_0x149499[_0x6e09('0x1c')];var _0x8328ec;if(_0x2f1330>=_0x14c469){_0x2f1330=_0x14c469;_0x8328ec=0xc8;}else{_0x8328ec=0xce;}_0x2b9b17[_0x6e09('0x19')](_0x8328ec);return _0x2b9b17[_0x6e09('0x1f')](_0x6e09('0x20'),_0x5ac8aa+'-'+_0x2f1330+'/'+_0x14c469)[_0x6e09('0x21')](_0x415013);}return null;};}function patchUpdates(_0x2de413){return function(_0x9b954a){try{jsonpatch[_0x6e09('0x22')](_0x9b954a,_0x2de413,!![]);}catch(_0x1f70a3){return BPromise[_0x6e09('0x23')](_0x1f70a3);}return _0x9b954a[_0x6e09('0x24')]();};}function saveUpdates(_0x554d6b,_0xc41946){return function(_0x4ee47a){if(_0x4ee47a){return _0x4ee47a[_0x6e09('0x25')](_0x554d6b)[_0x6e09('0x26')](function(_0x5c2fb1){return _0x5c2fb1;});}return null;};}function removeEntity(_0x353592,_0x224a8e){return function(_0x5d17a1){if(_0x5d17a1){return _0x5d17a1[_0x6e09('0x27')]()['then'](function(){_0x353592['status'](0xcc)[_0x6e09('0x1a')]();});}};}function handleEntityNotFound(_0x404f9d,_0x9bf51){return function(_0x4cce6b){if(!_0x4cce6b){_0x404f9d[_0x6e09('0x28')](0x194);}return _0x4cce6b;};}function handleError(_0x3be8e7,_0x143aea){_0x143aea=_0x143aea||0x1f4;return function(_0x4224aa){logger[_0x6e09('0x29')](_0x4224aa[_0x6e09('0x2a')]);if(_0x4224aa['name']){delete _0x4224aa['name'];}_0x3be8e7[_0x6e09('0x19')](_0x143aea)[_0x6e09('0x2b')](_0x4224aa);};}exports['index']=function(_0x111be5,_0x4c8a63){var _0xaa2d1={},_0x3bfb08={},_0x371efa={'count':0x0,'rows':[]};var _0x1e509c=_[_0x6e09('0x2c')](db[_0x6e09('0x2d')]['rawAttributes'],function(_0x4a9e0b){return{'name':_0x4a9e0b[_0x6e09('0x2e')],'type':_0x4a9e0b[_0x6e09('0x2f')][_0x6e09('0x30')]};});_0x3bfb08[_0x6e09('0x31')]=_[_0x6e09('0x2c')](_0x1e509c,_0x6e09('0x32'));_0x3bfb08['query']=_[_0x6e09('0x33')](_0x111be5[_0x6e09('0x34')]);_0x3bfb08['filters']=_[_0x6e09('0x35')](_0x3bfb08[_0x6e09('0x31')],_0x3bfb08['query']);_0xaa2d1['attributes']=_[_0x6e09('0x35')](_0x3bfb08[_0x6e09('0x31')],qs[_0x6e09('0x36')](_0x111be5[_0x6e09('0x34')][_0x6e09('0x36')]));_0xaa2d1[_0x6e09('0x37')]=_0xaa2d1['attributes'][_0x6e09('0x38')]?_0xaa2d1[_0x6e09('0x37')]:_0x3bfb08[_0x6e09('0x31')];if(!_0x111be5['query'][_0x6e09('0x39')](_0x6e09('0x3a'))){_0xaa2d1[_0x6e09('0x1c')]=qs['limit'](_0x111be5[_0x6e09('0x34')][_0x6e09('0x1c')]);_0xaa2d1[_0x6e09('0x1b')]=qs[_0x6e09('0x1b')](_0x111be5['query']['offset']);}_0xaa2d1[_0x6e09('0x3b')]=qs[_0x6e09('0x3c')](_0x111be5[_0x6e09('0x34')]['sort']);_0xaa2d1[_0x6e09('0x3d')]=qs[_0x6e09('0x3e')](_['pick'](_0x111be5['query'],_0x3bfb08[_0x6e09('0x3e')]),_0x1e509c);if(_0x111be5[_0x6e09('0x34')][_0x6e09('0x3f')]){_0xaa2d1[_0x6e09('0x3d')]=_[_0x6e09('0x40')](_0xaa2d1[_0x6e09('0x3d')],{'$or':_[_0x6e09('0x2c')](_0x1e509c,function(_0x3024a1){if(_0x3024a1[_0x6e09('0x2f')]!==_0x6e09('0x41')){var _0x20246e={};_0x20246e[_0x3024a1[_0x6e09('0x32')]]={'$like':'%'+_0x111be5[_0x6e09('0x34')][_0x6e09('0x3f')]+'%'};return _0x20246e;}})});}_0xaa2d1=_[_0x6e09('0x40')]({},_0xaa2d1,_0x111be5['options']);var _0x23cbe2={'where':_0xaa2d1[_0x6e09('0x3d')]};return db[_0x6e09('0x2d')][_0x6e09('0x1e')](_0x23cbe2)[_0x6e09('0x26')](function(_0x19a9d8){_0x371efa[_0x6e09('0x1e')]=_0x19a9d8;if(_0x111be5[_0x6e09('0x34')][_0x6e09('0x42')]){_0xaa2d1[_0x6e09('0x43')]=[{'all':!![]}];}return db[_0x6e09('0x2d')]['findAll'](_0xaa2d1);})[_0x6e09('0x26')](function(_0x594855){_0x371efa[_0x6e09('0x44')]=_0x594855;return _0x371efa;})['then'](respondWithFilteredResult(_0x4c8a63,_0xaa2d1))[_0x6e09('0x45')](handleError(_0x4c8a63,null));};exports[_0x6e09('0x46')]=function(_0x313d60,_0x39b6a6){var _0x5551a5={'raw':!![],'where':{'id':_0x313d60[_0x6e09('0x47')]['id']}},_0x10da08={};_0x10da08[_0x6e09('0x31')]=_[_0x6e09('0x33')](db[_0x6e09('0x2d')][_0x6e09('0x48')]);_0x10da08[_0x6e09('0x34')]=_['keys'](_0x313d60[_0x6e09('0x34')]);_0x10da08['filters']=_[_0x6e09('0x35')](_0x10da08['model'],_0x10da08[_0x6e09('0x34')]);_0x5551a5[_0x6e09('0x37')]=_[_0x6e09('0x35')](_0x10da08['model'],qs[_0x6e09('0x36')](_0x313d60[_0x6e09('0x34')][_0x6e09('0x36')]));_0x5551a5[_0x6e09('0x37')]=_0x5551a5[_0x6e09('0x37')][_0x6e09('0x38')]?_0x5551a5[_0x6e09('0x37')]:_0x10da08['model'];if(_0x313d60[_0x6e09('0x34')][_0x6e09('0x42')]){_0x5551a5[_0x6e09('0x43')]=[{'all':!![]}];}_0x5551a5=_[_0x6e09('0x40')]({},_0x5551a5,_0x313d60[_0x6e09('0x49')]);return db[_0x6e09('0x2d')]['find'](_0x5551a5)[_0x6e09('0x26')](handleEntityNotFound(_0x39b6a6,null))[_0x6e09('0x26')](respondWithResult(_0x39b6a6,null))['catch'](handleError(_0x39b6a6,null));};exports[_0x6e09('0x4a')]=function(_0x4d7439,_0x10ded1){return db['SquareDetailsReport'][_0x6e09('0x4a')](_0x4d7439[_0x6e09('0x4b')],{})[_0x6e09('0x26')](respondWithResult(_0x10ded1,0xc9))[_0x6e09('0x45')](handleError(_0x10ded1,null));};exports['update']=function(_0x1c2c2a,_0x55b93d){if(_0x1c2c2a[_0x6e09('0x4b')]['id']){delete _0x1c2c2a['body']['id'];}return db[_0x6e09('0x2d')][_0x6e09('0x4c')]({'where':{'id':_0x1c2c2a[_0x6e09('0x47')]['id']}})[_0x6e09('0x26')](handleEntityNotFound(_0x55b93d,null))[_0x6e09('0x26')](saveUpdates(_0x1c2c2a[_0x6e09('0x4b')],null))[_0x6e09('0x26')](respondWithResult(_0x55b93d,null))[_0x6e09('0x45')](handleError(_0x55b93d,null));};exports[_0x6e09('0x27')]=function(_0x4c1fd3,_0x2f7ffe){return db[_0x6e09('0x2d')][_0x6e09('0x4c')]({'where':{'id':_0x4c1fd3[_0x6e09('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f7ffe,null))[_0x6e09('0x26')](removeEntity(_0x2f7ffe,null))[_0x6e09('0x45')](handleError(_0x2f7ffe,null));};exports['describe']=function(_0x3c0574,_0x4fb181){return db[_0x6e09('0x2d')][_0x6e09('0x4d')]()['then'](respondWithResult(_0x4fb181,null))[_0x6e09('0x45')](handleError(_0x4fb181,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 091cc74..75e91f1 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 _0x03ab=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util'];(function(_0x5b3552,_0x419ae1){var _0x3b8bc6=function(_0x4a299b){while(--_0x4a299b){_0x5b3552['push'](_0x5b3552['shift']());}};_0x3b8bc6(++_0x419ae1);}(_0x03ab,0x124));var _0xb03a=function(_0x4dbdee,_0x52b472){_0x4dbdee=_0x4dbdee-0x0;var _0x4165b4=_0x03ab[_0x4dbdee];return _0x4165b4;};'use strict';var _=require(_0xb03a('0x0'));var util=require(_0xb03a('0x1'));var logger=require(_0xb03a('0x2'))(_0xb03a('0x3'));var moment=require(_0xb03a('0x4'));var BPromise=require(_0xb03a('0x5'));var rp=require(_0xb03a('0x6'));var fs=require('fs');var path=require(_0xb03a('0x7'));var rimraf=require(_0xb03a('0x8'));var config=require(_0xb03a('0x9'));var attributes=require(_0xb03a('0xa'));module['exports']=function(_0x45436b,_0x3021db){return _0x45436b[_0xb03a('0xb')](_0xb03a('0xc'),attributes,{'tableName':_0xb03a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1def=['bluebird','request-promise','path','rimraf','./squareReportDetail.attributes','exports','define','report_square_details','lodash','util','api','moment'];(function(_0x1e9c1b,_0x3affed){var _0x311b13=function(_0x17aa8e){while(--_0x17aa8e){_0x1e9c1b['push'](_0x1e9c1b['shift']());}};_0x311b13(++_0x3affed);}(_0x1def,0xc8));var _0xf1de=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x1def[_0x5ac84c];return _0x3c53d2;};'use strict';var _=require(_0xf1de('0x0'));var util=require(_0xf1de('0x1'));var logger=require('../../config/logger')(_0xf1de('0x2'));var moment=require(_0xf1de('0x3'));var BPromise=require(_0xf1de('0x4'));var rp=require(_0xf1de('0x5'));var fs=require('fs');var path=require(_0xf1de('0x6'));var rimraf=require(_0xf1de('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1de('0x8'));module[_0xf1de('0x9')]=function(_0xc93b9a,_0x47ad68){return _0xc93b9a[_0xf1de('0xa')]('SquareDetailsReport',attributes,{'tableName':_0xf1de('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 42d8739..1680356 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 _0x7894=['client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x408ac6,_0x43a94c){var _0x543f78=function(_0x12be77){while(--_0x12be77){_0x408ac6['push'](_0x408ac6['shift']());}};_0x543f78(++_0x43a94c);}(_0x7894,0x170));var _0x4789=function(_0x3890a5,_0x4f9df5){_0x3890a5=_0x3890a5-0x0;var _0x973312=_0x7894[_0x3890a5];return _0x973312;};'use strict';var _=require(_0x4789('0x0'));var util=require(_0x4789('0x1'));var moment=require(_0x4789('0x2'));var BPromise=require(_0x4789('0x3'));var rs=require(_0x4789('0x4'));var fs=require('fs');var Redis=require(_0x4789('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4789('0x6'));var logger=require(_0x4789('0x7'))('rpc');var config=require(_0x4789('0x8'));var jayson=require(_0x4789('0x9'));var client=jayson[_0x4789('0xa')][_0x4789('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114a90,_0x298902,_0x13b7f6){return new BPromise(function(_0x5a45ae,_0x49d256){return client[_0x4789('0xc')](_0x114a90,_0x13b7f6)['then'](function(_0x2e8038){logger[_0x4789('0xd')](_0x4789('0xe'),_0x298902,'request\x20sent');logger[_0x4789('0xf')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x298902,_0x4789('0x10'),JSON[_0x4789('0x11')](_0x2e8038));if(_0x2e8038[_0x4789('0x12')]){if(_0x2e8038['error']['code']===0x1f4){logger[_0x4789('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x298902,_0x2e8038[_0x4789('0x12')]['message']);return _0x49d256(_0x2e8038[_0x4789('0x12')][_0x4789('0x13')]);}logger['error'](_0x4789('0xe'),_0x298902,_0x2e8038['error'][_0x4789('0x13')]);return _0x5a45ae(_0x2e8038[_0x4789('0x12')][_0x4789('0x13')]);}else{logger['info'](_0x4789('0xe'),_0x298902,_0x4789('0x10'));_0x5a45ae(_0x2e8038['result'][_0x4789('0x13')]);}})['catch'](function(_0x118f97){logger[_0x4789('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x298902,_0x118f97);_0x49d256(_0x118f97);});});}exports[_0x4789('0x14')]=function(_0x5af7b3){var _0x2f1511=this;return new Promise(function(_0x56d799,_0x19dc59){return db[_0x4789('0x15')]['create'](_0x5af7b3[_0x4789('0x16')],{'raw':_0x5af7b3[_0x4789('0x17')]?_0x5af7b3[_0x4789('0x17')][_0x4789('0x18')]===undefined?!![]:![]:!![]})[_0x4789('0x19')](function(_0x3a707d){logger[_0x4789('0xd')](_0x4789('0x14'),_0x5af7b3);logger[_0x4789('0xf')](_0x4789('0x14'),_0x5af7b3,JSON[_0x4789('0x11')](_0x3a707d));_0x56d799(_0x3a707d);})[_0x4789('0x1a')](function(_0x4f7ceb){logger[_0x4789('0x12')](_0x4789('0x14'),_0x4f7ceb['message'],_0x5af7b3);_0x19dc59(_0x2f1511[_0x4789('0x12')](0x1f4,_0x4f7ceb[_0x4789('0x13')]));});});}; \ No newline at end of file +var _0x0db9=['../../config/environment','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareDetailsReport','create','body','raw','lodash','randomstring','ioredis','../../config/utils','rpc'];(function(_0x5d8875,_0x1812a6){var _0x2a3143=function(_0x3f26b2){while(--_0x3f26b2){_0x5d8875['push'](_0x5d8875['shift']());}};_0x2a3143(++_0x1812a6);}(_0x0db9,0xa3));var _0x90db=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0x0db9[_0x1f5a63];return _0x30bb7a;};'use strict';var _=require(_0x90db('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x90db('0x1'));var fs=require('fs');var Redis=require(_0x90db('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x90db('0x3'));var logger=require('../../config/logger')(_0x90db('0x4'));var config=require(_0x90db('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x90db('0x6')][_0x90db('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x476491,_0xee21f8,_0x915ca){return new BPromise(function(_0x9b6d0d,_0x4b0c1d){return client[_0x90db('0x8')](_0x476491,_0x915ca)[_0x90db('0x9')](function(_0x39512e){logger[_0x90db('0xa')](_0x90db('0xb'),_0xee21f8,_0x90db('0xc'));logger[_0x90db('0xd')](_0x90db('0xe'),_0xee21f8,_0x90db('0xc'),JSON[_0x90db('0xf')](_0x39512e));if(_0x39512e[_0x90db('0x10')]){if(_0x39512e['error'][_0x90db('0x11')]===0x1f4){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x4b0c1d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);return _0x9b6d0d(_0x39512e[_0x90db('0x10')][_0x90db('0x12')]);}else{logger[_0x90db('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0xee21f8,_0x90db('0xc'));_0x9b6d0d(_0x39512e['result'][_0x90db('0x12')]);}})[_0x90db('0x13')](function(_0x3de860){logger[_0x90db('0x10')](_0x90db('0xb'),_0xee21f8,_0x3de860);_0x4b0c1d(_0x3de860);});});}exports[_0x90db('0x14')]=function(_0x15e33e){var _0x43f40b=this;return new Promise(function(_0x24a16a,_0x171a4a){return db['SquareDetailsReport'][_0x90db('0x15')](_0x15e33e[_0x90db('0x16')],{'raw':_0x15e33e['options']?_0x15e33e['options'][_0x90db('0x17')]===undefined?!![]:![]:!![]})[_0x90db('0x9')](function(_0x300dc2){logger[_0x90db('0xa')](_0x90db('0x14'),_0x15e33e);logger[_0x90db('0xd')](_0x90db('0x14'),_0x15e33e,JSON['stringify'](_0x300dc2));_0x24a16a(_0x300dc2);})[_0x90db('0x13')](function(_0x1aeab9){logger[_0x90db('0x10')](_0x90db('0x14'),_0x1aeab9['message'],_0x15e33e);_0x171a4a(_0x43f40b[_0x90db('0x10')](0x1f4,_0x1aeab9['message']));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index a5845d8..d156d8c 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 _0x0870=['index','isAuthenticated','killProcess','express','Router','../../components/auth/service','get'];(function(_0x3a4bbc,_0x2b0f76){var _0x211dfa=function(_0x560ec4){while(--_0x560ec4){_0x3a4bbc['push'](_0x3a4bbc['shift']());}};_0x211dfa(++_0x2b0f76);}(_0x0870,0x1ca));var _0x0087=function(_0x554de6,_0x34ae65){_0x554de6=_0x554de6-0x0;var _0x2aa72a=_0x0870[_0x554de6];return _0x2aa72a;};'use strict';var express=require(_0x0087('0x0'));var router=express[_0x0087('0x1')]();var auth=require(_0x0087('0x2'));var controller=require('./system.controller');router[_0x0087('0x3')]('/',auth['isAuthenticated'](),controller[_0x0087('0x4')]);router[_0x0087('0x3')]('/process/:pid/kill',auth[_0x0087('0x5')](),controller[_0x0087('0x6')]);module['exports']=router; \ No newline at end of file +var _0xaea0=['isAuthenticated','index','get','/process/:pid/kill','killProcess','exports','../../components/auth/service','./system.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaea0,0xb6));var _0x0aea=function(_0x5d6c3e,_0x409a3e){_0x5d6c3e=_0x5d6c3e-0x0;var _0x44ecb7=_0xaea0[_0x5d6c3e];return _0x44ecb7;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x0aea('0x0'));var controller=require(_0x0aea('0x1'));router['get']('/',auth[_0x0aea('0x2')](),controller[_0x0aea('0x3')]);router[_0x0aea('0x4')](_0x0aea('0x5'),auth[_0x0aea('0x2')](),controller[_0x0aea('0x6')]);module[_0x0aea('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index be22814..e82d0bc 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 _0x9078=['systeminformation','exec','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','getAllData','status','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','indexOf','pid','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x9078,0xaf));var _0x8907=function(_0x1beff1,_0x31acec){_0x1beff1=_0x1beff1-0x0;var _0x2ee780=_0x9078[_0x1beff1];return _0x2ee780;};'use strict';var info=require(_0x8907('0x0'));var exec=require('child_process')[_0x8907('0x1')];var logger=require('../../config/logger')('api');var util=require(_0x8907('0x2'));var BPromise=require('bluebird');var _=require(_0x8907('0x3'));function handleError(_0x363a06,_0x59b5ff,_0x11723d){_0x59b5ff=_0x59b5ff||0x1f4;return function(_0x4ff770){logger[_0x8907('0x4')](_0x8907('0x5'),_0x11723d,_0x59b5ff,util[_0x8907('0x6')](_0x4ff770,{'showHidden':![],'depth':null}));delete _0x4ff770[_0x8907('0x7')];_0x363a06['status'](_0x59b5ff)['send'](_0x4ff770);};}exports['index']=function(_0x106ad7,_0x3e3fd8){return info[_0x8907('0x8')]()['then'](function(_0x2a7ac7){return _0x3e3fd8[_0x8907('0x9')](0xc8)[_0x8907('0xa')](_0x2a7ac7);})[_0x8907('0xb')](function(_0x1f30b3){return _0x3e3fd8[_0x8907('0x9')](0x1f4)[_0x8907('0xa')](_0x1f30b3);});};exports[_0x8907('0xc')]=function(_0x575aaa,_0x3efa99){var _0x52c353=[_0x8907('0xd')];return new BPromise(function(_0x22b5a4,_0x593b5a){return exec(util['format'](_0x8907('0xe'),_0x575aaa[_0x8907('0xf')]['pid']),function(_0x5ef1bd,_0x4f102d,_0x1ab09c){if(_0x5ef1bd){return _0x593b5a(_0x5ef1bd);}return _0x22b5a4(_0x4f102d);});})[_0x8907('0x10')](function(_0x3de803){var _0x359076=![];var _0x5c6742=_0x3de803[_0x8907('0x11')](/\n/);for(var _0x7aabb2=0x0,_0x5d6aa3=_0x52c353[_0x8907('0x12')];_0x7aabb2<_0x5d6aa3,_0x359076===![];_0x7aabb2+=0x1){if(_0x3de803[_0x8907('0x13')](_0x52c353[_0x7aabb2])>=0x0){_0x359076=!![];}}if(!_0x359076){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x575aaa['params'][_0x8907('0x14')]));}process[_0x8907('0x15')](_0x575aaa['params'][_0x8907('0x14')],_0x8907('0x16'));return _0x3efa99['status'](0xc8)[_0x8907('0xa')]({'message':util[_0x8907('0x17')](_0x8907('0x18'),_0x575aaa[_0x8907('0xf')][_0x8907('0x14')])});})['catch'](handleError(_0x3efa99,null,_0x8907('0xc')));}; \ No newline at end of file +var _0x0ee5=['status','catch','json','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','then'];(function(_0x116895,_0xf2457e){var _0x51b0d9=function(_0x5e38f6){while(--_0x5e38f6){_0x116895['push'](_0x116895['shift']());}};_0x51b0d9(++_0xf2457e);}(_0x0ee5,0x12f));var _0x50ee=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0ee5[_0x4565bf];return _0x5610ba;};'use strict';var info=require(_0x50ee('0x0'));var exec=require(_0x50ee('0x1'))[_0x50ee('0x2')];var logger=require(_0x50ee('0x3'))(_0x50ee('0x4'));var util=require(_0x50ee('0x5'));var BPromise=require(_0x50ee('0x6'));var _=require(_0x50ee('0x7'));function handleError(_0x88a824,_0x54f299,_0x5333a7){_0x54f299=_0x54f299||0x1f4;return function(_0x9f30ed){logger[_0x50ee('0x8')](_0x50ee('0x9'),_0x5333a7,_0x54f299,util[_0x50ee('0xa')](_0x9f30ed,{'showHidden':![],'depth':null}));delete _0x9f30ed[_0x50ee('0xb')];_0x88a824['status'](_0x54f299)[_0x50ee('0xc')](_0x9f30ed);};}exports[_0x50ee('0xd')]=function(_0x110825,_0x9218d9){return info[_0x50ee('0xe')]()[_0x50ee('0xf')](function(_0x523329){return _0x9218d9[_0x50ee('0x10')](0xc8)['json'](_0x523329);})[_0x50ee('0x11')](function(_0x5970ed){return _0x9218d9[_0x50ee('0x10')](0x1f4)[_0x50ee('0x12')](_0x5970ed);});};exports['killProcess']=function(_0x3755c0,_0x282491){var _0x4aa241=[_0x50ee('0x13')];return new BPromise(function(_0x4d4d0a,_0x4abaa4){return exec(util[_0x50ee('0x14')](_0x50ee('0x15'),_0x3755c0[_0x50ee('0x16')][_0x50ee('0x17')]),function(_0x310473,_0x9ab45d,_0x2cd57f){if(_0x310473){return _0x4abaa4(_0x310473);}return _0x4d4d0a(_0x9ab45d);});})[_0x50ee('0xf')](function(_0x584397){var _0x3c0394=![];var _0x4f6a3a=_0x584397['split'](/\n/);for(var _0x582ada=0x0,_0x1f4e79=_0x4aa241[_0x50ee('0x18')];_0x582ada<_0x1f4e79,_0x3c0394===![];_0x582ada+=0x1){if(_0x584397['indexOf'](_0x4aa241[_0x582ada])>=0x0){_0x3c0394=!![];}}if(!_0x3c0394){throw new Error(util[_0x50ee('0x14')](_0x50ee('0x19'),_0x3755c0['params'][_0x50ee('0x17')]));}process[_0x50ee('0x1a')](_0x3755c0[_0x50ee('0x16')][_0x50ee('0x17')],'SIGINT');return _0x282491['status'](0xc8)[_0x50ee('0x12')]({'message':util['format'](_0x50ee('0x1b'),_0x3755c0[_0x50ee('0x16')][_0x50ee('0x17')])});})[_0x50ee('0x11')](handleError(_0x282491,null,_0x50ee('0x1c')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 3a11603..f78211e 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 _0x55e6=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','/:id','create','update','exports','multer','util'];(function(_0xea90ef,_0x4995e4){var _0x47bbc0=function(_0xad20b2){while(--_0xad20b2){_0xea90ef['push'](_0xea90ef['shift']());}};_0x47bbc0(++_0x4995e4);}(_0x55e6,0xca));var _0x655e=function(_0xf5fe26,_0x54058d){_0xf5fe26=_0xf5fe26-0x0;var _0x1b2786=_0x55e6[_0xf5fe26];return _0x1b2786;};'use strict';var multer=require(_0x655e('0x0'));var util=require(_0x655e('0x1'));var path=require(_0x655e('0x2'));var timeout=require(_0x655e('0x3'));var express=require(_0x655e('0x4'));var router=express[_0x655e('0x5')]();var fs_extra=require(_0x655e('0x6'));var auth=require(_0x655e('0x7'));var interaction=require(_0x655e('0x8'));var config=require(_0x655e('0x9'));var controller=require(_0x655e('0xa'));router['get']('/',auth[_0x655e('0xb')](),controller[_0x655e('0xc')]);router['get'](_0x655e('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x655e('0xe')]);router['put']('/:id',auth[_0x655e('0xb')](),controller[_0x655e('0xf')]);router['delete']('/:id',auth[_0x655e('0xb')](),controller['destroy']);module[_0x655e('0x10')]=router; \ No newline at end of file +var _0x5a94=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0xcf8ee8,_0x3c37bc){var _0x5dc9ae=function(_0x1ac2c0){while(--_0x1ac2c0){_0xcf8ee8['push'](_0xcf8ee8['shift']());}};_0x5dc9ae(++_0x3c37bc);}(_0x5a94,0x1e5));var _0x45a9=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5a94[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x45a9('0x0'));var util=require(_0x45a9('0x1'));var path=require(_0x45a9('0x2'));var timeout=require(_0x45a9('0x3'));var express=require(_0x45a9('0x4'));var router=express[_0x45a9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x45a9('0x6'));var config=require(_0x45a9('0x7'));var controller=require(_0x45a9('0x8'));router[_0x45a9('0x9')]('/',auth[_0x45a9('0xa')](),controller[_0x45a9('0xb')]);router[_0x45a9('0x9')](_0x45a9('0xc'),auth[_0x45a9('0xa')](),controller[_0x45a9('0xd')]);router[_0x45a9('0xe')]('/',auth['isAuthenticated'](),controller[_0x45a9('0xf')]);router[_0x45a9('0x10')]('/:id',auth[_0x45a9('0xa')](),controller[_0x45a9('0x11')]);router[_0x45a9('0x12')](_0x45a9('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index a1a1c0f..b16c469 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 _0x80cd=['name','#0091EA','exports','STRING'];(function(_0x19875f,_0x5ce08a){var _0x8f968d=function(_0x188fa8){while(--_0x188fa8){_0x19875f['push'](_0x19875f['shift']());}};_0x8f968d(++_0x5ce08a);}(_0x80cd,0x146));var _0xd80c=function(_0x1139d0,_0x41e5f8){_0x1139d0=_0x1139d0-0x0;var _0xcc01a6=_0x80cd[_0x1139d0];return _0xcc01a6;};'use strict';var Sequelize=require('sequelize');module[_0xd80c('0x0')]={'name':{'type':Sequelize[_0xd80c('0x1')],'unique':_0xd80c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xd80c('0x1')],'defaultValue':_0xd80c('0x3')},'description':{'type':Sequelize[_0xd80c('0x1')]}}; \ No newline at end of file +var _0xf972=['sequelize','STRING','name'];(function(_0x50bafb,_0x5e3763){var _0x1590e0=function(_0x36432e){while(--_0x36432e){_0x50bafb['push'](_0x50bafb['shift']());}};_0x1590e0(++_0x5e3763);}(_0xf972,0x171));var _0x2f97=function(_0x3838fc,_0x57c67a){_0x3838fc=_0x3838fc-0x0;var _0x54b242=_0xf972[_0x3838fc];return _0x54b242;};'use strict';var Sequelize=require(_0x2f97('0x0'));module['exports']={'name':{'type':Sequelize[_0x2f97('0x1')],'unique':_0x2f97('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2f97('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x2f97('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 7311b0e..7a225cf 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 _0x4c4e=['util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','Tags','destroy','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','Tag','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2e5d25,_0x4eb3fb){_0x2e5d25=_0x2e5d25-0x0;var _0x45caae=_0x4c4e[_0x2e5d25];return _0x45caae;};'use strict';var emlformat=require(_0xe4c4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe4c4('0x1'));var jsonpatch=require(_0xe4c4('0x2'));var rp=require(_0xe4c4('0x3'));var moment=require('moment');var BPromise=require(_0xe4c4('0x4'));var Mustache=require(_0xe4c4('0x5'));var util=require(_0xe4c4('0x6'));var path=require('path');var sox=require(_0xe4c4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4c4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4c4('0x9'));var _=require(_0xe4c4('0xa'));var squel=require(_0xe4c4('0xb'));var crypto=require(_0xe4c4('0xc'));var jsforce=require(_0xe4c4('0xd'));var deskjs=require(_0xe4c4('0xe'));var toCsv=require(_0xe4c4('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe4c4('0x10'));var authService=require(_0xe4c4('0x11'));var qs=require(_0xe4c4('0x12'));var as=require(_0xe4c4('0x13'));var hardwareService=require(_0xe4c4('0x14'));var logger=require(_0xe4c4('0x15'))('api');var utils=require(_0xe4c4('0x16'));var config=require(_0xe4c4('0x17'));var licenseUtil=require(_0xe4c4('0x18'));var db=require(_0xe4c4('0x19'))['db'];function respondWithStatusCode(_0x50bfab,_0x262083){_0x262083=_0x262083||0xcc;return function(_0x115802){if(_0x115802){return _0x50bfab['sendStatus'](_0x262083);}return _0x50bfab[_0xe4c4('0x1a')](_0x262083)[_0xe4c4('0x1b')]();};}function respondWithResult(_0x5aa89b,_0x42ce9e){_0x42ce9e=_0x42ce9e||0xc8;return function(_0x29766a){if(_0x29766a){return _0x5aa89b['status'](_0x42ce9e)[_0xe4c4('0x1c')](_0x29766a);}};}function respondWithFilteredResult(_0x465c9b,_0x26ea05){return function(_0x40a36e){if(_0x40a36e){var _0x19e59b=typeof _0x26ea05[_0xe4c4('0x1d')]===_0xe4c4('0x1e')&&typeof _0x26ea05[_0xe4c4('0x1f')]===_0xe4c4('0x1e');var _0x36b10c=_0x40a36e[_0xe4c4('0x20')];var _0x42242c=_0x19e59b?0x0:_0x26ea05[_0xe4c4('0x1d')];var _0x43a9ce=_0x19e59b?_0x40a36e[_0xe4c4('0x20')]:_0x26ea05['offset']+_0x26ea05[_0xe4c4('0x1f')];var _0x24f946;if(_0x43a9ce>=_0x36b10c){_0x43a9ce=_0x36b10c;_0x24f946=0xc8;}else{_0x24f946=0xce;}_0x465c9b[_0xe4c4('0x1a')](_0x24f946);return _0x465c9b[_0xe4c4('0x21')]('Content-Range',_0x42242c+'-'+_0x43a9ce+'/'+_0x36b10c)[_0xe4c4('0x1c')](_0x40a36e);}return null;};}function patchUpdates(_0x1cad5d){return function(_0x1727eb){try{jsonpatch[_0xe4c4('0x22')](_0x1727eb,_0x1cad5d,!![]);}catch(_0x2c5aea){return BPromise[_0xe4c4('0x23')](_0x2c5aea);}return _0x1727eb[_0xe4c4('0x24')]();};}function saveUpdates(_0x393c96,_0x21bbb1){return function(_0x1a7690){if(_0x1a7690){return _0x1a7690[_0xe4c4('0x25')](_0x393c96)[_0xe4c4('0x26')](function(_0x138ead){return _0x138ead;});}return null;};}function removeEntity(_0x1db719,_0x15873e){return function(_0x59498e){if(_0x59498e){return _0x59498e['destroy']()[_0xe4c4('0x26')](function(){var _0x4dc8cc=_0x59498e[_0xe4c4('0x27')]({'plain':!![]});var _0x5374fd=_0xe4c4('0x28');return db['UserProfileResource'][_0xe4c4('0x29')]({'where':{'type':_0x5374fd,'resourceId':_0x4dc8cc['id']}})['then'](function(){return _0x59498e;});})[_0xe4c4('0x26')](function(){_0x1db719['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cea1f,_0x5d66ab){return function(_0x3221cd){if(!_0x3221cd){_0x4cea1f['sendStatus'](0x194);}return _0x3221cd;};}function handleError(_0x5b5ea5,_0xe2c1b4){_0xe2c1b4=_0xe2c1b4||0x1f4;return function(_0x11deab){logger['error'](_0x11deab['stack']);if(_0x11deab[_0xe4c4('0x2a')]){delete _0x11deab[_0xe4c4('0x2a')];}_0x5b5ea5['status'](_0xe2c1b4)[_0xe4c4('0x2b')](_0x11deab);};}exports[_0xe4c4('0x2c')]=function(_0x3f60fc,_0x48060e){var _0x5d49fd={},_0x46db7e={},_0x2c5652={'count':0x0,'rows':[]};var _0x12bde8=_[_0xe4c4('0x2d')](db['Tag']['rawAttributes'],function(_0x1731c8){return{'name':_0x1731c8[_0xe4c4('0x2e')],'type':_0x1731c8['type'][_0xe4c4('0x2f')]};});_0x46db7e[_0xe4c4('0x30')]=_[_0xe4c4('0x2d')](_0x12bde8,'name');_0x46db7e[_0xe4c4('0x31')]=_['keys'](_0x3f60fc[_0xe4c4('0x31')]);_0x46db7e[_0xe4c4('0x32')]=_[_0xe4c4('0x33')](_0x46db7e[_0xe4c4('0x30')],_0x46db7e[_0xe4c4('0x31')]);_0x5d49fd[_0xe4c4('0x34')]=_[_0xe4c4('0x33')](_0x46db7e[_0xe4c4('0x30')],qs[_0xe4c4('0x35')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x35')]));_0x5d49fd[_0xe4c4('0x34')]=_0x5d49fd['attributes'][_0xe4c4('0x36')]?_0x5d49fd[_0xe4c4('0x34')]:_0x46db7e[_0xe4c4('0x30')];if(!_0x3f60fc['query'][_0xe4c4('0x37')](_0xe4c4('0x38'))){_0x5d49fd[_0xe4c4('0x1f')]=qs['limit'](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x1f')]);_0x5d49fd[_0xe4c4('0x1d')]=qs[_0xe4c4('0x1d')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x1d')]);}_0x5d49fd[_0xe4c4('0x39')]=qs[_0xe4c4('0x3a')](_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x3a')]);_0x5d49fd['where']=qs[_0xe4c4('0x32')](_[_0xe4c4('0x3b')](_0x3f60fc[_0xe4c4('0x31')],_0x46db7e[_0xe4c4('0x32')]),_0x12bde8);if(_0x3f60fc['query'][_0xe4c4('0x3c')]){_0x5d49fd[_0xe4c4('0x3d')]=_['merge'](_0x5d49fd[_0xe4c4('0x3d')],{'$or':_[_0xe4c4('0x2d')](_0x12bde8,function(_0x4db15d){if(_0x4db15d[_0xe4c4('0x3e')]!==_0xe4c4('0x3f')){var _0x127bcd={};_0x127bcd[_0x4db15d[_0xe4c4('0x2a')]]={'$like':'%'+_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x3c')]+'%'};return _0x127bcd;}})});}_0x5d49fd=_[_0xe4c4('0x40')]({},_0x5d49fd,_0x3f60fc[_0xe4c4('0x41')]);var _0x1e457c={'where':_0x5d49fd[_0xe4c4('0x3d')]};return db[_0xe4c4('0x42')][_0xe4c4('0x20')](_0x1e457c)['then'](function(_0x3773dd){_0x2c5652[_0xe4c4('0x20')]=_0x3773dd;if(_0x3f60fc[_0xe4c4('0x31')][_0xe4c4('0x43')]){_0x5d49fd[_0xe4c4('0x44')]=[{'all':!![]}];}return db[_0xe4c4('0x42')]['findAll'](_0x5d49fd);})[_0xe4c4('0x26')](function(_0x526bef){_0x2c5652[_0xe4c4('0x45')]=_0x526bef;return _0x2c5652;})[_0xe4c4('0x26')](respondWithFilteredResult(_0x48060e,_0x5d49fd))[_0xe4c4('0x46')](handleError(_0x48060e,null));};exports[_0xe4c4('0x47')]=function(_0x48177f,_0x566eb7){var _0x55b527={'raw':!![],'where':{'id':_0x48177f[_0xe4c4('0x48')]['id']}},_0x23a668={};_0x23a668[_0xe4c4('0x30')]=_['keys'](db[_0xe4c4('0x42')][_0xe4c4('0x49')]);_0x23a668[_0xe4c4('0x31')]=_[_0xe4c4('0x4a')](_0x48177f['query']);_0x23a668[_0xe4c4('0x32')]=_[_0xe4c4('0x33')](_0x23a668[_0xe4c4('0x30')],_0x23a668[_0xe4c4('0x31')]);_0x55b527[_0xe4c4('0x34')]=_[_0xe4c4('0x33')](_0x23a668[_0xe4c4('0x30')],qs[_0xe4c4('0x35')](_0x48177f[_0xe4c4('0x31')]['fields']));_0x55b527[_0xe4c4('0x34')]=_0x55b527['attributes'][_0xe4c4('0x36')]?_0x55b527[_0xe4c4('0x34')]:_0x23a668[_0xe4c4('0x30')];if(_0x48177f[_0xe4c4('0x31')][_0xe4c4('0x43')]){_0x55b527[_0xe4c4('0x44')]=[{'all':!![]}];}_0x55b527=_[_0xe4c4('0x40')]({},_0x55b527,_0x48177f[_0xe4c4('0x41')]);return db[_0xe4c4('0x42')][_0xe4c4('0x4b')](_0x55b527)[_0xe4c4('0x26')](handleEntityNotFound(_0x566eb7,null))[_0xe4c4('0x26')](respondWithResult(_0x566eb7,null))[_0xe4c4('0x46')](handleError(_0x566eb7,null));};exports[_0xe4c4('0x4c')]=function(_0x535bcc,_0x4922f5){return db[_0xe4c4('0x42')][_0xe4c4('0x4c')](_0x535bcc['body'],{})[_0xe4c4('0x26')](function(_0x2853da){var _0x1211f9=_0x535bcc[_0xe4c4('0x4d')][_0xe4c4('0x27')]({'plain':!![]});if(!_0x1211f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1211f9[_0xe4c4('0x4e')]===_0xe4c4('0x4d')){var _0x4f6e03=_0x2853da[_0xe4c4('0x27')]({'plain':!![]});var _0x24b0e7='Tags';return db[_0xe4c4('0x4f')]['find']({'where':{'name':_0x24b0e7,'userProfileId':_0x1211f9[_0xe4c4('0x50')]},'raw':!![]})[_0xe4c4('0x26')](function(_0x2a54ef){if(_0x2a54ef&&_0x2a54ef[_0xe4c4('0x51')]===0x0){return db[_0xe4c4('0x52')]['create']({'name':_0x4f6e03[_0xe4c4('0x2a')],'resourceId':_0x4f6e03['id'],'type':_0x2a54ef[_0xe4c4('0x2a')],'sectionId':_0x2a54ef['id']},{})[_0xe4c4('0x26')](function(){return _0x2853da;});}else{return _0x2853da;}})[_0xe4c4('0x46')](function(_0x3c9fc4){logger[_0xe4c4('0x53')](_0xe4c4('0x54'),_0x3c9fc4);throw _0x3c9fc4;});}return _0x2853da;})[_0xe4c4('0x26')](respondWithResult(_0x4922f5,0xc9))[_0xe4c4('0x46')](handleError(_0x4922f5,null));};exports[_0xe4c4('0x25')]=function(_0x1fe354,_0x1940e3){if(_0x1fe354[_0xe4c4('0x55')]['id']){delete _0x1fe354[_0xe4c4('0x55')]['id'];}return db[_0xe4c4('0x42')][_0xe4c4('0x4b')]({'where':{'id':_0x1fe354['params']['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x1940e3,null))[_0xe4c4('0x26')](saveUpdates(_0x1fe354[_0xe4c4('0x55')],null))['then'](respondWithResult(_0x1940e3,null))[_0xe4c4('0x46')](handleError(_0x1940e3,null));};exports[_0xe4c4('0x29')]=function(_0x35f750,_0x512ca9){return db[_0xe4c4('0x42')]['find']({'where':{'id':_0x35f750[_0xe4c4('0x48')]['id']}})[_0xe4c4('0x26')](handleEntityNotFound(_0x512ca9,null))[_0xe4c4('0x26')](removeEntity(_0x512ca9,null))['catch'](handleError(_0x512ca9,null));}; \ No newline at end of file +var _0x2e54=['apply','reject','save','then','get','Tags','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','Tag','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','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','limit','count','set'];(function(_0x4545f8,_0x458e5c){var _0x5c784f=function(_0x4fb49e){while(--_0x4fb49e){_0x4545f8['push'](_0x4545f8['shift']());}};_0x5c784f(++_0x458e5c);}(_0x2e54,0x1dd));var _0x42e5=function(_0x234b2c,_0x41df58){_0x234b2c=_0x234b2c-0x0;var _0x576cf3=_0x2e54[_0x234b2c];return _0x576cf3;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){var _0xf29221=_0x32380f[_0x42e5('0x25')]({'plain':!![]});var _0x275c80=_0x42e5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x275c80,'resourceId':_0xf29221['id']}})[_0x42e5('0x24')](function(){return _0x32380f;});})['then'](function(){_0x37d10e['status'](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x5b1727,_0x392c6b){return function(_0x2d9e65){if(!_0x2d9e65){_0x5b1727[_0x42e5('0x18')](0x194);}return _0x2d9e65;};}function handleError(_0x1c8ee4,_0x27ae27){_0x27ae27=_0x27ae27||0x1f4;return function(_0x2f1edc){logger['error'](_0x2f1edc[_0x42e5('0x27')]);if(_0x2f1edc[_0x42e5('0x28')]){delete _0x2f1edc[_0x42e5('0x28')];}_0x1c8ee4[_0x42e5('0x19')](_0x27ae27)[_0x42e5('0x29')](_0x2f1edc);};}exports[_0x42e5('0x2a')]=function(_0x383e97,_0x282cbf){var _0x5a4930={},_0x2ba9ef={},_0x2c7542={'count':0x0,'rows':[]};var _0x3d9e8b=_[_0x42e5('0x2b')](db['Tag'][_0x42e5('0x2c')],function(_0xf5a3dc){return{'name':_0xf5a3dc[_0x42e5('0x2d')],'type':_0xf5a3dc[_0x42e5('0x2e')]['key']};});_0x2ba9ef['model']=_[_0x42e5('0x2b')](_0x3d9e8b,'name');_0x2ba9ef[_0x42e5('0x2f')]=_['keys'](_0x383e97[_0x42e5('0x2f')]);_0x2ba9ef[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2ba9ef['model'],_0x2ba9ef[_0x42e5('0x2f')]);_0x5a4930[_0x42e5('0x32')]=_['intersection'](_0x2ba9ef[_0x42e5('0x33')],qs['fields'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x5a4930[_0x42e5('0x32')]=_0x5a4930[_0x42e5('0x32')][_0x42e5('0x35')]?_0x5a4930[_0x42e5('0x32')]:_0x2ba9ef[_0x42e5('0x33')];if(!_0x383e97['query']['hasOwnProperty'](_0x42e5('0x36'))){_0x5a4930[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x383e97['query']['limit']);_0x5a4930['offset']=qs['offset'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x1c')]);}_0x5a4930[_0x42e5('0x37')]=qs[_0x42e5('0x38')](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x38')]);_0x5a4930[_0x42e5('0x39')]=qs[_0x42e5('0x30')](_['pick'](_0x383e97[_0x42e5('0x2f')],_0x2ba9ef['filters']),_0x3d9e8b);if(_0x383e97[_0x42e5('0x2f')][_0x42e5('0x3a')]){_0x5a4930[_0x42e5('0x39')]=_[_0x42e5('0x3b')](_0x5a4930[_0x42e5('0x39')],{'$or':_[_0x42e5('0x2b')](_0x3d9e8b,function(_0xd5e7f5){if(_0xd5e7f5['type']!==_0x42e5('0x3c')){var _0x356ff6={};_0x356ff6[_0xd5e7f5['name']]={'$like':'%'+_0x383e97[_0x42e5('0x2f')]['filter']+'%'};return _0x356ff6;}})});}_0x5a4930=_['merge']({},_0x5a4930,_0x383e97['options']);var _0x1105ea={'where':_0x5a4930[_0x42e5('0x39')]};return db[_0x42e5('0x3d')][_0x42e5('0x1f')](_0x1105ea)[_0x42e5('0x24')](function(_0x77aa22){_0x2c7542[_0x42e5('0x1f')]=_0x77aa22;if(_0x383e97['query'][_0x42e5('0x3e')]){_0x5a4930[_0x42e5('0x3f')]=[{'all':!![]}];}return db['Tag'][_0x42e5('0x40')](_0x5a4930);})[_0x42e5('0x24')](function(_0x5db771){_0x2c7542[_0x42e5('0x41')]=_0x5db771;return _0x2c7542;})[_0x42e5('0x24')](respondWithFilteredResult(_0x282cbf,_0x5a4930))[_0x42e5('0x42')](handleError(_0x282cbf,null));};exports[_0x42e5('0x43')]=function(_0x424304,_0x4d32f4){var _0x41e1fd={'raw':!![],'where':{'id':_0x424304[_0x42e5('0x44')]['id']}},_0xc34e51={};_0xc34e51[_0x42e5('0x33')]=_['keys'](db[_0x42e5('0x3d')][_0x42e5('0x2c')]);_0xc34e51[_0x42e5('0x2f')]=_[_0x42e5('0x45')](_0x424304[_0x42e5('0x2f')]);_0xc34e51[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0xc34e51[_0x42e5('0x33')],_0xc34e51['query']);_0x41e1fd[_0x42e5('0x32')]=_['intersection'](_0xc34e51['model'],qs[_0x42e5('0x34')](_0x424304[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x41e1fd[_0x42e5('0x32')]=_0x41e1fd[_0x42e5('0x32')][_0x42e5('0x35')]?_0x41e1fd[_0x42e5('0x32')]:_0xc34e51['model'];if(_0x424304[_0x42e5('0x2f')][_0x42e5('0x3e')]){_0x41e1fd[_0x42e5('0x3f')]=[{'all':!![]}];}_0x41e1fd=_[_0x42e5('0x3b')]({},_0x41e1fd,_0x424304[_0x42e5('0x46')]);return db[_0x42e5('0x3d')][_0x42e5('0x47')](_0x41e1fd)[_0x42e5('0x24')](handleEntityNotFound(_0x4d32f4,null))['then'](respondWithResult(_0x4d32f4,null))[_0x42e5('0x42')](handleError(_0x4d32f4,null));};exports[_0x42e5('0x48')]=function(_0x3616f4,_0x48757e){return db[_0x42e5('0x3d')][_0x42e5('0x48')](_0x3616f4[_0x42e5('0x49')],{})[_0x42e5('0x24')](function(_0x2586b0){var _0x528ddd=_0x3616f4[_0x42e5('0x4a')]['get']({'plain':!![]});if(!_0x528ddd)throw new Error(_0x42e5('0x4b'));if(_0x528ddd[_0x42e5('0x4c')]===_0x42e5('0x4a')){var _0x48b63b=_0x2586b0['get']({'plain':!![]});var _0x4f0639=_0x42e5('0x26');return db[_0x42e5('0x4d')][_0x42e5('0x47')]({'where':{'name':_0x4f0639,'userProfileId':_0x528ddd[_0x42e5('0x4e')]},'raw':!![]})['then'](function(_0x3ae9de){if(_0x3ae9de&&_0x3ae9de[_0x42e5('0x4f')]===0x0){return db[_0x42e5('0x50')]['create']({'name':_0x48b63b[_0x42e5('0x28')],'resourceId':_0x48b63b['id'],'type':_0x3ae9de['name'],'sectionId':_0x3ae9de['id']},{})[_0x42e5('0x24')](function(){return _0x2586b0;});}else{return _0x2586b0;}})[_0x42e5('0x42')](function(_0x53e29b){logger[_0x42e5('0x51')](_0x42e5('0x52'),_0x53e29b);throw _0x53e29b;});}return _0x2586b0;})[_0x42e5('0x24')](respondWithResult(_0x48757e,0xc9))[_0x42e5('0x42')](handleError(_0x48757e,null));};exports[_0x42e5('0x53')]=function(_0x3f043f,_0x41c1dc){if(_0x3f043f[_0x42e5('0x49')]['id']){delete _0x3f043f[_0x42e5('0x49')]['id'];}return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x3f043f[_0x42e5('0x44')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x41c1dc,null))[_0x42e5('0x24')](saveUpdates(_0x3f043f[_0x42e5('0x49')],null))[_0x42e5('0x24')](respondWithResult(_0x41c1dc,null))['catch'](handleError(_0x41c1dc,null));};exports[_0x42e5('0x54')]=function(_0x2b226f,_0x40b633){return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x2b226f['params']['id']}})['then'](handleEntityNotFound(_0x40b633,null))[_0x42e5('0x24')](removeEntity(_0x40b633,null))[_0x42e5('0x42')](handleError(_0x40b633,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 2b02ad4..52ecb1a 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 _0xefbb=['exports','define','Tag','lodash','api','bluebird','request-promise','../../config/environment','./tag.attributes'];(function(_0x45c8e7,_0x19759f){var _0x1b3424=function(_0x4d79a5){while(--_0x4d79a5){_0x45c8e7['push'](_0x45c8e7['shift']());}};_0x1b3424(++_0x19759f);}(_0xefbb,0x198));var _0xbefb=function(_0x4c45b5,_0x23e317){_0x4c45b5=_0x4c45b5-0x0;var _0x46a3ec=_0xefbb[_0x4c45b5];return _0x46a3ec;};'use strict';var _=require(_0xbefb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbefb('0x1'));var moment=require('moment');var BPromise=require(_0xbefb('0x2'));var rp=require(_0xbefb('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbefb('0x4'));var attributes=require(_0xbefb('0x5'));module[_0xbefb('0x6')]=function(_0x1395aa,_0x594faa){return _0x1395aa[_0xbefb('0x7')](_0xbefb('0x8'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d3e=['request-promise','path','rimraf','../../config/environment','exports','define','tools_tags','lodash','util','../../config/logger','api','bluebird'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x4d3e,0xdf));var _0xe4d3=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x4d3e[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xe4d3('0x0'));var util=require(_0xe4d3('0x1'));var logger=require(_0xe4d3('0x2'))(_0xe4d3('0x3'));var moment=require('moment');var BPromise=require(_0xe4d3('0x4'));var rp=require(_0xe4d3('0x5'));var fs=require('fs');var path=require(_0xe4d3('0x6'));var rimraf=require(_0xe4d3('0x7'));var config=require(_0xe4d3('0x8'));var attributes=require('./tag.attributes');module[_0xe4d3('0x9')]=function(_0x4d8580,_0x39a066){return _0x4d8580[_0xe4d3('0xa')]('Tag',attributes,{'tableName':_0xe4d3('0xb'),'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 c279aea..fe9ba0d 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 _0x7a2c=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','Tag,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x3599cc,_0x1b0037){var _0x576107=function(_0x1332be){while(--_0x1332be){_0x3599cc['push'](_0x3599cc['shift']());}};_0x576107(++_0x1b0037);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x109a3c,_0x3a5644){_0x109a3c=_0x109a3c-0x0;var _0x366c91=_0x7a2c[_0x109a3c];return _0x366c91;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var moment=require(_0xc7a2('0x1'));var BPromise=require(_0xc7a2('0x2'));var rs=require(_0xc7a2('0x3'));var fs=require('fs');var Redis=require(_0xc7a2('0x4'));var db=require(_0xc7a2('0x5'))['db'];var utils=require(_0xc7a2('0x6'));var logger=require(_0xc7a2('0x7'))(_0xc7a2('0x8'));var config=require('../../config/environment');var jayson=require(_0xc7a2('0x9'));var client=jayson[_0xc7a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481430,_0x48773c,_0x1dd150){return new BPromise(function(_0x3de428,_0x3f0573){return client[_0xc7a2('0xb')](_0x481430,_0x1dd150)['then'](function(_0x38518b){logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x48773c,'request\x20sent');logger[_0xc7a2('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x48773c,_0xc7a2('0xf'),JSON[_0xc7a2('0x10')](_0x38518b));if(_0x38518b[_0xc7a2('0x11')]){if(_0x38518b['error'][_0xc7a2('0x12')]===0x1f4){logger[_0xc7a2('0x11')](_0xc7a2('0xd'),_0x48773c,_0x38518b['error'][_0xc7a2('0x13')]);return _0x3f0573(_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);}logger[_0xc7a2('0x11')](_0xc7a2('0xd'),_0x48773c,_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);return _0x3de428(_0x38518b[_0xc7a2('0x11')][_0xc7a2('0x13')]);}else{logger[_0xc7a2('0xc')](_0xc7a2('0xd'),_0x48773c,_0xc7a2('0xf'));_0x3de428(_0x38518b[_0xc7a2('0x14')][_0xc7a2('0x13')]);}})[_0xc7a2('0x15')](function(_0x506396){logger[_0xc7a2('0x11')]('Tag,\x20%s,\x20%s',_0x48773c,_0x506396);_0x3f0573(_0x506396);});});} \ No newline at end of file +var _0xadb8=['Tag,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x208767,_0x420330){var _0x36d08d=function(_0x3fc14e){while(--_0x3fc14e){_0x208767['push'](_0x208767['shift']());}};_0x36d08d(++_0x420330);}(_0xadb8,0x1d0));var _0x8adb=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0xadb8[_0x18b344];return _0x5ef6bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8adb('0x0'));var BPromise=require('bluebird');var rs=require(_0x8adb('0x1'));var fs=require('fs');var Redis=require(_0x8adb('0x2'));var db=require(_0x8adb('0x3'))['db'];var utils=require(_0x8adb('0x4'));var logger=require(_0x8adb('0x5'))(_0x8adb('0x6'));var config=require(_0x8adb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8adb('0x8')][_0x8adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9f435,_0x2bebfe,_0x271bed){return new BPromise(function(_0x16b932,_0x27d994){return client['request'](_0x9f435,_0x271bed)['then'](function(_0x58ad1a){logger[_0x8adb('0xa')]('Tag,\x20%s,\x20%s',_0x2bebfe,'request\x20sent');logger['debug'](_0x8adb('0xb'),_0x2bebfe,_0x8adb('0xc'),JSON[_0x8adb('0xd')](_0x58ad1a));if(_0x58ad1a[_0x8adb('0xe')]){if(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0xf')]===0x1f4){logger[_0x8adb('0xe')](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);return _0x27d994(_0x58ad1a['error']['message']);}logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x58ad1a['error'][_0x8adb('0x11')]);return _0x16b932(_0x58ad1a[_0x8adb('0xe')][_0x8adb('0x11')]);}else{logger['info'](_0x8adb('0x10'),_0x2bebfe,_0x8adb('0xc'));_0x16b932(_0x58ad1a[_0x8adb('0x12')][_0x8adb('0x11')]);}})[_0x8adb('0x13')](function(_0x13659c){logger['error'](_0x8adb('0x10'),_0x2bebfe,_0x13659c);_0x27d994(_0x13659c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index b704c20..541f03f 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(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 f592fe1..feb1f98 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 _0xd8b0=['exports','sequelize'];(function(_0x40dbd3,_0x512994){var _0xb50d1b=function(_0x3a5b70){while(--_0x3a5b70){_0x40dbd3['push'](_0x40dbd3['shift']());}};_0xb50d1b(++_0x512994);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb10b=['name','sequelize','STRING'];(function(_0x2ddf73,_0x48d00d){var _0x3fbd44=function(_0x8c98d0){while(--_0x8c98d0){_0x2ddf73['push'](_0x2ddf73['shift']());}};_0x3fbd44(++_0x48d00d);}(_0xb10b,0x12a));var _0xbb10=function(_0x1c8567,_0x5180c6){_0x1c8567=_0x1c8567-0x0;var _0x5309fd=_0xb10b[_0x1c8567];return _0x5309fd;};'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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 803517a..4ebb816 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 _0xe123=['MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','sendStatus','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','isValidChannel','add','ids','removeQueues','addAgents','Voice','Mail','Openchannel','Whatsapp','transaction','penalty','QueueId','TeamVoiceQueue','User','emit','user','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','isArray','Chat','Sms','Fax','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','redis','defaults','socket.io-emitter','./team.socket','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Team','includeAll','include','rows','catch','show','params','find','create','body','get','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','sequelize','SELECT','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'];(function(_0x54d29c,_0x3e21f5){var _0x11bb67=function(_0x49beb4){while(--_0x49beb4){_0x54d29c['push'](_0x54d29c['shift']());}};_0x11bb67(++_0x3e21f5);}(_0xe123,0xd3));var _0x3e12=function(_0x39c0c9,_0x1a59a4){_0x39c0c9=_0x39c0c9-0x0;var _0x44a6c3=_0xe123[_0x39c0c9];return _0x44a6c3;};'use strict';var emlformat=require(_0x3e12('0x0'));var rimraf=require(_0x3e12('0x1'));var zipdir=require(_0x3e12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3e12('0x3'));var moment=require(_0x3e12('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3e12('0x5'));var util=require('util');var path=require(_0x3e12('0x6'));var sox=require(_0x3e12('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e12('0x8'));var squel=require(_0x3e12('0x9'));var crypto=require(_0x3e12('0xa'));var jsforce=require(_0x3e12('0xb'));var deskjs=require(_0x3e12('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3e12('0xd'));var Papa=require('papaparse');var Redis=require(_0x3e12('0xe'));var authService=require(_0x3e12('0xf'));var qs=require(_0x3e12('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e12('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x3e12('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3e12('0x13'));var db=require('../../mysqldb')['db'];config[_0x3e12('0x14')]=_[_0x3e12('0x15')](config[_0x3e12('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e12('0x16'))(new Redis(config[_0x3e12('0x14')]));require(_0x3e12('0x17'))['register'](socket);function respondWithStatusCode(_0x499fe2,_0x9e737d){_0x9e737d=_0x9e737d||0xcc;return function(_0x337e0e){if(_0x337e0e){return _0x499fe2['sendStatus'](_0x9e737d);}return _0x499fe2[_0x3e12('0x18')](_0x9e737d)[_0x3e12('0x19')]();};}function respondWithResult(_0x1f8a7f,_0x1b2af8){_0x1b2af8=_0x1b2af8||0xc8;return function(_0x577fc8){if(_0x577fc8){return _0x1f8a7f[_0x3e12('0x18')](_0x1b2af8)[_0x3e12('0x1a')](_0x577fc8);}};}function respondWithFilteredResult(_0x33799e,_0x28fe48){return function(_0x505327){if(_0x505327){var _0x3c5e34=typeof _0x28fe48[_0x3e12('0x1b')]===_0x3e12('0x1c')&&typeof _0x28fe48['limit']===_0x3e12('0x1c');var _0x4ca2a9=_0x505327[_0x3e12('0x1d')];var _0x338581=_0x3c5e34?0x0:_0x28fe48[_0x3e12('0x1b')];var _0xb2e24d=_0x3c5e34?_0x505327[_0x3e12('0x1d')]:_0x28fe48[_0x3e12('0x1b')]+_0x28fe48[_0x3e12('0x1e')];var _0x30bc86;if(_0xb2e24d>=_0x4ca2a9){_0xb2e24d=_0x4ca2a9;_0x30bc86=0xc8;}else{_0x30bc86=0xce;}_0x33799e[_0x3e12('0x18')](_0x30bc86);return _0x33799e[_0x3e12('0x1f')]('Content-Range',_0x338581+'-'+_0xb2e24d+'/'+_0x4ca2a9)[_0x3e12('0x1a')](_0x505327);}return null;};}function patchUpdates(_0x54113b){return function(_0xb6135c){try{jsonpatch[_0x3e12('0x20')](_0xb6135c,_0x54113b,!![]);}catch(_0x174b2f){return BPromise[_0x3e12('0x21')](_0x174b2f);}return _0xb6135c[_0x3e12('0x22')]();};}function saveUpdates(_0x3fd96c,_0xdc9a3){return function(_0x3dac39){if(_0x3dac39){return _0x3dac39[_0x3e12('0x23')](_0x3fd96c)[_0x3e12('0x24')](function(_0x556485){return _0x556485;});}return null;};}function handleEntityNotFound(_0x140ea2,_0x455859){return function(_0x170de6){if(!_0x170de6){_0x140ea2['sendStatus'](0x194);}return _0x170de6;};}function handleError(_0x22f395,_0x3a0238){_0x3a0238=_0x3a0238||0x1f4;return function(_0x1da57e){logger['error'](_0x1da57e[_0x3e12('0x25')]);if(_0x1da57e[_0x3e12('0x26')]){delete _0x1da57e['name'];}_0x22f395['status'](_0x3a0238)[_0x3e12('0x27')](_0x1da57e);};}exports[_0x3e12('0x28')]=function(_0x11f517,_0x4b6e0a){var _0x2e448d={},_0x229192={},_0x1c8459={'count':0x0,'rows':[]};var _0x5e2ad5=_['map'](db['Team'][_0x3e12('0x29')],function(_0x5ea110){return{'name':_0x5ea110['fieldName'],'type':_0x5ea110[_0x3e12('0x2a')][_0x3e12('0x2b')]};});_0x229192[_0x3e12('0x2c')]=_[_0x3e12('0x2d')](_0x5e2ad5,_0x3e12('0x26'));_0x229192[_0x3e12('0x2e')]=_[_0x3e12('0x2f')](_0x11f517[_0x3e12('0x2e')]);_0x229192[_0x3e12('0x30')]=_[_0x3e12('0x31')](_0x229192['model'],_0x229192[_0x3e12('0x2e')]);_0x2e448d[_0x3e12('0x32')]=_[_0x3e12('0x31')](_0x229192['model'],qs[_0x3e12('0x33')](_0x11f517['query'][_0x3e12('0x33')]));_0x2e448d[_0x3e12('0x32')]=_0x2e448d['attributes'][_0x3e12('0x34')]?_0x2e448d[_0x3e12('0x32')]:_0x229192['model'];if(!_0x11f517['query']['hasOwnProperty'](_0x3e12('0x35'))){_0x2e448d[_0x3e12('0x1e')]=qs[_0x3e12('0x1e')](_0x11f517[_0x3e12('0x2e')]['limit']);_0x2e448d[_0x3e12('0x1b')]=qs[_0x3e12('0x1b')](_0x11f517[_0x3e12('0x2e')][_0x3e12('0x1b')]);}_0x2e448d[_0x3e12('0x36')]=qs[_0x3e12('0x37')](_0x11f517[_0x3e12('0x2e')][_0x3e12('0x37')]);_0x2e448d[_0x3e12('0x38')]=qs[_0x3e12('0x30')](_[_0x3e12('0x39')](_0x11f517[_0x3e12('0x2e')],_0x229192[_0x3e12('0x30')]),_0x5e2ad5);if(_0x11f517['query']['filter']){_0x2e448d[_0x3e12('0x38')]=_[_0x3e12('0x3a')](_0x2e448d[_0x3e12('0x38')],{'$or':_['map'](_0x5e2ad5,function(_0x53a52a){if(_0x53a52a['type']!==_0x3e12('0x3b')){var _0x3f33f4={};_0x3f33f4[_0x53a52a['name']]={'$like':'%'+_0x11f517['query'][_0x3e12('0x3c')]+'%'};return _0x3f33f4;}})});}_0x2e448d=_[_0x3e12('0x3a')]({},_0x2e448d,_0x11f517[_0x3e12('0x3d')]);var _0x149a12={'where':_0x2e448d[_0x3e12('0x38')]};return db[_0x3e12('0x3e')][_0x3e12('0x1d')](_0x149a12)['then'](function(_0x4a5ec3){_0x1c8459[_0x3e12('0x1d')]=_0x4a5ec3;if(_0x11f517[_0x3e12('0x2e')][_0x3e12('0x3f')]){_0x2e448d[_0x3e12('0x40')]=[{'all':!![]}];}return db['Team']['findAll'](_0x2e448d);})[_0x3e12('0x24')](function(_0x42f9c9){_0x1c8459[_0x3e12('0x41')]=_0x42f9c9;return _0x1c8459;})['then'](respondWithFilteredResult(_0x4b6e0a,_0x2e448d))[_0x3e12('0x42')](handleError(_0x4b6e0a,null));};exports[_0x3e12('0x43')]=function(_0x5c56b9,_0x20618a){var _0x351859={'raw':![],'where':{'id':_0x5c56b9[_0x3e12('0x44')]['id']}},_0x48ea46={};_0x48ea46[_0x3e12('0x2c')]=_['keys'](db[_0x3e12('0x3e')][_0x3e12('0x29')]);_0x48ea46[_0x3e12('0x2e')]=_[_0x3e12('0x2f')](_0x5c56b9['query']);_0x48ea46['filters']=_[_0x3e12('0x31')](_0x48ea46[_0x3e12('0x2c')],_0x48ea46[_0x3e12('0x2e')]);_0x351859[_0x3e12('0x32')]=_[_0x3e12('0x31')](_0x48ea46[_0x3e12('0x2c')],qs['fields'](_0x5c56b9[_0x3e12('0x2e')][_0x3e12('0x33')]));_0x351859[_0x3e12('0x32')]=_0x351859[_0x3e12('0x32')]['length']?_0x351859['attributes']:_0x48ea46['model'];if(_0x5c56b9[_0x3e12('0x2e')]['includeAll']){_0x351859[_0x3e12('0x40')]=[{'all':!![]}];}_0x351859=_[_0x3e12('0x3a')]({},_0x351859,_0x5c56b9[_0x3e12('0x3d')]);return db[_0x3e12('0x3e')][_0x3e12('0x45')](_0x351859)[_0x3e12('0x24')](handleEntityNotFound(_0x20618a,null))[_0x3e12('0x24')](respondWithResult(_0x20618a,null))[_0x3e12('0x42')](handleError(_0x20618a,null));};exports[_0x3e12('0x46')]=function(_0x4b0012,_0x467c17){return db[_0x3e12('0x3e')]['create'](_0x4b0012[_0x3e12('0x47')],{})[_0x3e12('0x24')](function(_0x520092){var _0x407f14=_0x4b0012['user'][_0x3e12('0x48')]({'plain':!![]});if(!_0x407f14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x407f14[_0x3e12('0x49')]==='user'){var _0x3d447b=_0x520092['get']({'plain':!![]});var _0x291ad3=_0x3e12('0x4a');return db[_0x3e12('0x4b')]['find']({'where':{'name':_0x291ad3,'userProfileId':_0x407f14[_0x3e12('0x4c')]},'raw':!![]})[_0x3e12('0x24')](function(_0x13a7e9){if(_0x13a7e9&&_0x13a7e9[_0x3e12('0x4d')]===0x0){return db[_0x3e12('0x4e')][_0x3e12('0x46')]({'name':_0x3d447b[_0x3e12('0x26')],'resourceId':_0x3d447b['id'],'type':_0x13a7e9['name'],'sectionId':_0x13a7e9['id']},{})['then'](function(){return _0x520092;});}else{return _0x520092;}})[_0x3e12('0x42')](function(_0x372c75){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x372c75);throw _0x372c75;});}return _0x520092;})['then'](respondWithResult(_0x467c17,0xc9))['catch'](handleError(_0x467c17,null));};exports[_0x3e12('0x23')]=function(_0x41c7df,_0x590d9a){if(_0x41c7df[_0x3e12('0x47')]['id']){delete _0x41c7df[_0x3e12('0x47')]['id'];}return db[_0x3e12('0x3e')]['find']({'where':{'id':_0x41c7df[_0x3e12('0x44')]['id']}})['then'](handleEntityNotFound(_0x590d9a,null))[_0x3e12('0x24')](saveUpdates(_0x41c7df[_0x3e12('0x47')],null))['then'](respondWithResult(_0x590d9a,null))[_0x3e12('0x42')](handleError(_0x590d9a,null));};exports['destroy']=function(_0xcdfd9b,_0x52ba13){var _0x5e76df=_0xcdfd9b[_0x3e12('0x44')]['id'];var _0x706c68=[];return db['sequelize']['transaction'](function(_0x2073b3){var _0x4bdba3=_0x3e12('0x4f')+_0x5e76df;return db['sequelize']['query'](_0x4bdba3,{'type':db[_0x3e12('0x50')][_0x3e12('0x51')]['SELECT'],'raw':!![],'transaction':_0x2073b3})[_0x3e12('0x24')](function(_0x13803d){_0x706c68=_[_0x3e12('0x2d')](_0x13803d,function(_0x93d27c){return Number(_0x93d27c[_0x3e12('0x52')]);});})[_0x3e12('0x24')](function(){var _0x2664d8=_0x3e12('0x53')+_0x5e76df;return db[_0x3e12('0x54')]['query'](_0x2664d8,{'type':db[_0x3e12('0x50')][_0x3e12('0x51')][_0x3e12('0x55')],'raw':!![],'transaction':_0x2073b3});})[_0x3e12('0x24')](function(_0x1100e3){var _0x3c284c=_[_0x3e12('0x2d')](_0x1100e3,function(_0x983844){return Number(_0x983844['VoiceQueueId']);});return db[_0x3e12('0x56')][_0x3e12('0x57')]({'where':{'UserId':{'$in':_0x706c68},'VoiceQueueId':{'$in':_0x3c284c}},'transaction':_0x2073b3});})[_0x3e12('0x24')](function(){var _0x41b70d=_0x3e12('0x58')+_0x5e76df;return db[_0x3e12('0x54')]['query'](_0x41b70d,{'type':db['Sequelize']['QueryTypes'][_0x3e12('0x55')],'raw':!![],'transaction':_0x2073b3});})['then'](function(_0x4e9a77){var _0x335dd3=_[_0x3e12('0x2d')](_0x4e9a77,function(_0x2098af){return Number(_0x2098af[_0x3e12('0x59')]);});return db[_0x3e12('0x5a')][_0x3e12('0x57')]({'where':{'UserId':{'$in':_0x706c68},'MailQueueId':{'$in':_0x335dd3}},'transaction':_0x2073b3});})['then'](function(){var _0x1e7699='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x5e76df;return db['sequelize']['query'](_0x1e7699,{'type':db[_0x3e12('0x50')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2073b3});})[_0x3e12('0x24')](function(_0x3550a9){var _0xd678ba=_['map'](_0x3550a9,function(_0x130e68){return Number(_0x130e68[_0x3e12('0x5b')]);});return db[_0x3e12('0x5c')]['destroy']({'where':{'UserId':{'$in':_0x706c68},'SmsQueueId':{'$in':_0xd678ba}},'transaction':_0x2073b3});})[_0x3e12('0x24')](function(){var _0x577438=_0x3e12('0x5d')+_0x5e76df;return db[_0x3e12('0x54')][_0x3e12('0x2e')](_0x577438,{'type':db[_0x3e12('0x50')][_0x3e12('0x51')][_0x3e12('0x55')],'raw':!![],'transaction':_0x2073b3});})[_0x3e12('0x24')](function(_0x477bad){var _0x4ded50=_[_0x3e12('0x2d')](_0x477bad,function(_0x5e0906){return Number(_0x5e0906['ChatQueueId']);});return db[_0x3e12('0x5e')][_0x3e12('0x57')]({'where':{'UserId':{'$in':_0x706c68},'ChatQueueId':{'$in':_0x4ded50}},'transaction':_0x2073b3});})[_0x3e12('0x24')](function(){var _0x1a1e20=_0x3e12('0x5f')+_0x5e76df;return db[_0x3e12('0x54')][_0x3e12('0x2e')](_0x1a1e20,{'type':db[_0x3e12('0x50')][_0x3e12('0x51')][_0x3e12('0x55')],'raw':!![],'transaction':_0x2073b3});})[_0x3e12('0x24')](function(_0x24ff5a){var _0x3740dc=_[_0x3e12('0x2d')](_0x24ff5a,function(_0x370cdf){return Number(_0x370cdf[_0x3e12('0x60')]);});return db[_0x3e12('0x61')][_0x3e12('0x57')]({'where':{'UserId':{'$in':_0x706c68},'FaxQueueId':{'$in':_0x3740dc}},'transaction':_0x2073b3});})[_0x3e12('0x24')](function(){var _0x2442ef=_0x3e12('0x62')+_0x5e76df;return db[_0x3e12('0x54')]['query'](_0x2442ef,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2073b3});})[_0x3e12('0x24')](function(_0x2f96dc){var _0x4ffe94=_[_0x3e12('0x2d')](_0x2f96dc,function(_0x196c16){return Number(_0x196c16[_0x3e12('0x63')]);});return db[_0x3e12('0x64')][_0x3e12('0x57')]({'where':{'UserId':{'$in':_0x706c68},'OpenchannelQueueId':{'$in':_0x4ffe94}},'transaction':_0x2073b3});})[_0x3e12('0x24')](function(){var _0x43c2a0=_0x3e12('0x65')+_0x5e76df;return db[_0x3e12('0x54')]['query'](_0x43c2a0,{'type':db[_0x3e12('0x50')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x2073b3});})['then'](function(_0x29a2e3){var _0x1a325c=_[_0x3e12('0x2d')](_0x29a2e3,function(_0x3e6736){return Number(_0x3e6736[_0x3e12('0x66')]);});return db['UserWhatsappQueue'][_0x3e12('0x57')]({'where':{'UserId':{'$in':_0x706c68},'WhatsappQueueId':{'$in':_0x1a325c}},'transaction':_0x2073b3});})['then'](function(){return db[_0x3e12('0x67')][_0x3e12('0x45')]({'where':{'TeamId':_0x5e76df}});})[_0x3e12('0x24')](function(_0x228ccd){if(_0x228ccd===null){return;}return db[_0x3e12('0x68')]['destroy']({'where':{'UserId':{'$in':_0x706c68},'VoicePrefixId':_0x228ccd[_0x3e12('0x69')]},'transaction':_0x2073b3});})[_0x3e12('0x24')](function(){return db[_0x3e12('0x3e')][_0x3e12('0x57')]({'where':{'id':_0x5e76df},'cascade':!![],'transaction':_0x2073b3});})[_0x3e12('0x24')](function(_0x46da4e){if(_0x46da4e===0x0){_0x52ba13[_0x3e12('0x6a')](0x194);}else{return db[_0x3e12('0x4e')][_0x3e12('0x57')]({'where':{'type':_0x3e12('0x4a'),'resourceId':_0x5e76df},'cascade':!![],'transaction':_0x2073b3})[_0x3e12('0x24')](function(){_0x52ba13[_0x3e12('0x18')](0xcc)['end']();});}})[_0x3e12('0x42')](function(_0x455e2e){_0x52ba13[_0x3e12('0x18')](0x1f4)['send'](_0x455e2e);});});};exports[_0x3e12('0x6b')]=function(_0x2cbf7c,_0x4e3137,_0x14e022){return db[_0x3e12('0x3e')][_0x3e12('0x6c')]({'where':{'id':_0x2cbf7c[_0x3e12('0x44')]['id']}})[_0x3e12('0x24')](handleEntityNotFound(_0x4e3137,null))[_0x3e12('0x24')](function(_0x29c6eb){if(!_0x2cbf7c[_0x3e12('0x2e')][_0x3e12('0x6d')]||!utils['isValidChannel'](_0x2cbf7c[_0x3e12('0x2e')]['channel'])){throw new db['Sequelize'][(_0x3e12('0x6e'))](_0x3e12('0x6f'));}var _0x4af956={};var _0x438569={};_0x438569['model']=_[_0x3e12('0x2f')](db[_[_0x3e12('0x70')](_0x2cbf7c[_0x3e12('0x2e')][_0x3e12('0x6d')][_0x3e12('0x71')]())+_0x3e12('0x72')]['rawAttributes']);_0x438569[_0x3e12('0x2e')]=_[_0x3e12('0x2f')](_0x2cbf7c[_0x3e12('0x2e')]);_0x438569[_0x3e12('0x30')]=_['intersection'](_0x438569['model'],_0x438569[_0x3e12('0x2e')]);_0x4af956[_0x3e12('0x32')]=_['intersection'](_0x438569[_0x3e12('0x2c')],qs[_0x3e12('0x33')](_0x2cbf7c[_0x3e12('0x2e')][_0x3e12('0x33')]));_0x4af956['attributes']=_0x4af956['attributes'][_0x3e12('0x34')]?_0x4af956[_0x3e12('0x32')]:_0x438569[_0x3e12('0x2c')];_0x4af956[_0x3e12('0x1e')]=qs[_0x3e12('0x1e')](_0x2cbf7c[_0x3e12('0x2e')][_0x3e12('0x1e')]);_0x4af956[_0x3e12('0x1b')]=qs[_0x3e12('0x1b')](_0x2cbf7c[_0x3e12('0x2e')][_0x3e12('0x1b')]);_0x4af956[_0x3e12('0x36')]=qs[_0x3e12('0x37')](_0x2cbf7c[_0x3e12('0x2e')][_0x3e12('0x37')]);_0x4af956['where']=qs[_0x3e12('0x30')](_['pick'](_0x2cbf7c[_0x3e12('0x2e')],_0x438569[_0x3e12('0x30')]));_0x4af956=_['merge']({},_0x4af956,_0x2cbf7c[_0x3e12('0x3d')]);return _0x29c6eb[_0x3e12('0x48')+_[_0x3e12('0x70')](_0x2cbf7c[_0x3e12('0x2e')][_0x3e12('0x6d')]['toLowerCase']())+_0x3e12('0x73')](_0x4af956);})[_0x3e12('0x24')](respondWithResult(_0x4e3137,null))[_0x3e12('0x42')](handleError(_0x4e3137,null));};exports['addQueues']=function(_0x4e71ee,_0x253b10,_0x456249){return db[_0x3e12('0x3e')][_0x3e12('0x6c')]({'where':{'id':_0x4e71ee['params']['id']}})['then'](function(_0x2aeed4){if(_0x2aeed4){if(!_0x4e71ee[_0x3e12('0x47')][_0x3e12('0x6d')]||!utils[_0x3e12('0x74')](_0x4e71ee[_0x3e12('0x47')][_0x3e12('0x6d')])){throw new db[(_0x3e12('0x50'))][(_0x3e12('0x6e'))](_0x3e12('0x6f'));}return _0x2aeed4[_0x3e12('0x75')+_['capitalize'](_0x4e71ee[_0x3e12('0x47')]['channel']['toLowerCase']())+_0x3e12('0x73')](_0x4e71ee[_0x3e12('0x47')][_0x3e12('0x76')]);}return null;})['then'](handleEntityNotFound(_0x253b10,null))[_0x3e12('0x24')](respondWithStatusCode(_0x253b10,null))['catch'](handleError(_0x253b10,null));};exports[_0x3e12('0x77')]=function(_0x244dfe,_0x8a4df1,_0x1fde14){return db[_0x3e12('0x3e')][_0x3e12('0x6c')]({'where':{'id':_0x244dfe[_0x3e12('0x44')]['id']}})['then'](function(_0x3d1ce9){if(_0x3d1ce9){if(!_0x244dfe[_0x3e12('0x2e')][_0x3e12('0x6d')]||!utils[_0x3e12('0x74')](_0x244dfe[_0x3e12('0x2e')][_0x3e12('0x6d')])){throw new db[(_0x3e12('0x50'))][(_0x3e12('0x6e'))](_0x3e12('0x6f'));}return _0x3d1ce9['remove'+_['capitalize'](_0x244dfe[_0x3e12('0x2e')][_0x3e12('0x6d')]['toLowerCase']())+'Queues'](_0x244dfe[_0x3e12('0x2e')][_0x3e12('0x76')]);}return null;})[_0x3e12('0x24')](handleEntityNotFound(_0x8a4df1,null))[_0x3e12('0x24')](respondWithStatusCode(_0x8a4df1,null))[_0x3e12('0x42')](handleError(_0x8a4df1,null));};exports[_0x3e12('0x78')]=function(_0x2e8606,_0x4e5d1e){var _0x145197=_['isArray'](_0x2e8606['body'][_0x3e12('0x76')])?_0x2e8606['body'][_0x3e12('0x76')]:[_0x2e8606[_0x3e12('0x47')]['ids']];var _0x4d8987=_0x2e8606[_0x3e12('0x44')]['id'];return db[_0x3e12('0x3e')][_0x3e12('0x45')]({'where':{'id':_0x4d8987}})['then'](handleEntityNotFound(_0x4e5d1e,null))[_0x3e12('0x24')](function(_0x2b8680){if(_0x2b8680){var _0x365e12=[_0x3e12('0x79'),'Chat',_0x3e12('0x7a'),'Sms','Fax',_0x3e12('0x7b'),_0x3e12('0x7c')];return db[_0x3e12('0x54')][_0x3e12('0x7d')](function(_0x1d3798){var _0x42918d=_[_0x3e12('0x2d')](_0x365e12,function(_0x40f320){var _0x521c2e={'attributes':['id','name']};if(_0x40f320===_0x3e12('0x79')){_0x521c2e['through']={'attributes':[_0x3e12('0x7e')]};}return _0x2b8680[_0x3e12('0x48')+_0x40f320+_0x3e12('0x73')](_0x521c2e)[_0x3e12('0x24')](function(_0x3f0f84){var _0x2c8fa7=_[_0x3e12('0x2d')](_0x3f0f84,function(_0x333aa2){var _0x35e388=_[_0x3e12('0x2d')](_0x145197,function(_0x277063){var _0x52cd57={'where':{'UserId':_0x277063,[_0x40f320+_0x3e12('0x7f')]:_0x333aa2['id']},'transaction':_0x1d3798};if(_0x40f320===_0x3e12('0x79')){_0x52cd57[_0x3e12('0x15')]={'penalty':_0x333aa2[_0x3e12('0x80')][_0x3e12('0x7e')]};}return db[_0x3e12('0x81')+_0x40f320+_0x3e12('0x72')]['findOrCreate'](_0x52cd57)[_0x3e12('0x24')](function(){socket[_0x3e12('0x82')](_0x3e12('0x83')+_0x40f320+_0x3e12('0x84'),{'UserId':_0x277063,[_0x40f320+_0x3e12('0x7f')]:_0x333aa2['id']});if(_0x40f320!=='Voice'){return;}return db[_0x3e12('0x81')][_0x3e12('0x85')]({'where':{'id':_0x145197,'online':0x1},'attributes':['id',_0x3e12('0x26'),_0x3e12('0x86'),_0x3e12('0x87'),_0x3e12('0x88')],'raw':!![]})[_0x3e12('0x24')](function(_0x285f99){var _0x1694f6=_[_0x3e12('0x2d')](_0x285f99,function(_0x25fa00){return db[_0x3e12('0x89')][_0x3e12('0x8a')]({'membername':_0x25fa00[_0x3e12('0x26')],'UserId':_0x25fa00['id'],'queue_name':_0x333aa2['name'],'VoiceQueueId':_0x333aa2['id'],'interface':_[_0x3e12('0x8b')](_0x25fa00[_0x3e12('0x88')])?util[_0x3e12('0x8c')](_0x3e12('0x8d'),_0x25fa00[_0x3e12('0x26')]):_0x25fa00[_0x3e12('0x88')],'paused':_0x25fa00[_0x3e12('0x87')]||![],'penalty':_0x333aa2[_0x3e12('0x80')][_0x3e12('0x7e')]},{'transaction':_0x1d3798});});return Promise['all'](_0x1694f6);});});});return Promise[_0x3e12('0x8e')](_0x35e388);});return Promise[_0x3e12('0x8e')](_0x2c8fa7);})[_0x3e12('0x24')](function(){return db[_0x3e12('0x67')][_0x3e12('0x6c')]({'where':{'teamId':_0x4d8987}})['then'](function(_0x33c2af){if(_0x33c2af){var _0x2e1136=_[_0x3e12('0x2d')](_0x145197,function(_0x27d5fa){db['UserVoicePrefix']['upsert']({'UserId':_0x27d5fa,'VoicePrefixId':_0x33c2af[_0x3e12('0x69')]});});return Promise[_0x3e12('0x8e')](_0x2e1136);}});});});return Promise[_0x3e12('0x8e')](_0x42918d)[_0x3e12('0x24')](function(){return _0x2b8680['addAgents'](_0x145197,{'transaction':_0x1d3798})['spread'](function(_0x47d9a9){return _0x47d9a9;});});});}})[_0x3e12('0x24')](respondWithResult(_0x4e5d1e,null))[_0x3e12('0x42')](handleError(_0x4e5d1e,null));};exports[_0x3e12('0x8f')]=function(_0x3d3426,_0x35a362){var _0x126f92=_[_0x3e12('0x90')](_0x3d3426[_0x3e12('0x2e')]['ids'])?_0x3d3426[_0x3e12('0x2e')][_0x3e12('0x76')]:[_0x3d3426['query']['ids']];var _0x3ea4cb=_0x3d3426[_0x3e12('0x44')]['id'];return db[_0x3e12('0x3e')]['find']({'where':{'id':_0x3ea4cb}})['then'](handleEntityNotFound(_0x35a362,null))[_0x3e12('0x24')](function(_0x434f40){if(_0x434f40){var _0x2a44da=[_0x3e12('0x79'),_0x3e12('0x91'),_0x3e12('0x7a'),_0x3e12('0x92'),_0x3e12('0x93'),_0x3e12('0x7b'),_0x3e12('0x7c')];return db[_0x3e12('0x54')][_0x3e12('0x7d')](function(_0x5019e4){var _0x26c2c1=_[_0x3e12('0x2d')](_0x2a44da,function(_0x4ed69a){var _0x1d7e58={'attributes':['id',_0x3e12('0x26')]};return _0x434f40['get'+_0x4ed69a+_0x3e12('0x73')](_0x1d7e58)[_0x3e12('0x24')](function(_0x2bc631){var _0x252e59=_[_0x3e12('0x2d')](_0x2bc631,function(_0x280b57){return _0x280b57[_0x3e12('0x8f')](_0x126f92,{'transaction':_0x5019e4})[_0x3e12('0x24')](function(){var _0x2ae6d6=_['map'](_0x126f92,function(_0x29b947){socket[_0x3e12('0x82')]('user'+_0x4ed69a+'Queue:remove',{'UserId':Number(_0x29b947),[_0x4ed69a+'QueueId']:_0x280b57['id']});if(_0x4ed69a!==_0x3e12('0x79')){return;}return db[_0x3e12('0x89')][_0x3e12('0x57')]({'where':{'VoiceQueueId':_0x280b57['id'],'UserId':_0x29b947},'transaction':_0x5019e4});});return Promise[_0x3e12('0x8e')](_0x2ae6d6);});});return Promise[_0x3e12('0x8e')](_0x252e59);});});return Promise[_0x3e12('0x8e')](_0x26c2c1)[_0x3e12('0x24')](function(){return _0x434f40['removeAgents'](_0x126f92,{'transaction':_0x5019e4});})[_0x3e12('0x24')](function(){return db[_0x3e12('0x67')]['findOne']({'where':{'teamId':_0x3ea4cb}})[_0x3e12('0x24')](function(_0x81699c){if(_0x81699c){var _0x10b46c=_[_0x3e12('0x2d')](_0x126f92,function(_0x30fc72){db[_0x3e12('0x68')][_0x3e12('0x57')]({'where':{'UserId':_0x30fc72,'VoicePrefixId':_0x81699c['VoicePrefixId']}});});return Promise[_0x3e12('0x8e')](_0x10b46c);}});});});}})['then'](respondWithStatusCode(_0x35a362,null))[_0x3e12('0x42')](handleError(_0x35a362,null));};exports[_0x3e12('0x94')]=function(_0x37437e,_0x4b07de,_0x2438a6){var _0xa82411={};var _0x45ca0b={};var _0x44f42a;var _0x304f4d;return db[_0x3e12('0x3e')][_0x3e12('0x6c')]({'where':{'id':_0x37437e[_0x3e12('0x44')]['id']}})[_0x3e12('0x24')](handleEntityNotFound(_0x4b07de,null))[_0x3e12('0x24')](function(_0x233e0b){if(_0x233e0b){_0x44f42a=_0x233e0b;_0x45ca0b['model']=_[_0x3e12('0x2f')](db[_0x3e12('0x81')][_0x3e12('0x29')]);_0x45ca0b[_0x3e12('0x2e')]=_['keys'](_0x37437e[_0x3e12('0x2e')]);_0x45ca0b['filters']=_[_0x3e12('0x31')](_0x45ca0b['model'],_0x45ca0b['query']);_0xa82411[_0x3e12('0x32')]=_['intersection'](_0x45ca0b[_0x3e12('0x2c')],qs[_0x3e12('0x33')](_0x37437e[_0x3e12('0x2e')][_0x3e12('0x33')]));_0xa82411[_0x3e12('0x32')]=_0xa82411[_0x3e12('0x32')][_0x3e12('0x34')]?_0xa82411[_0x3e12('0x32')]:_0x45ca0b[_0x3e12('0x2c')];_0xa82411['order']=qs['sort'](_0x37437e['query'][_0x3e12('0x37')]);_0xa82411[_0x3e12('0x38')]=qs['filters'](_[_0x3e12('0x39')](_0x37437e[_0x3e12('0x2e')],_0x45ca0b[_0x3e12('0x30')]));if(_0x37437e[_0x3e12('0x2e')][_0x3e12('0x3c')]){_0xa82411['where']=_['merge'](_0xa82411[_0x3e12('0x38')],{'$or':_[_0x3e12('0x2d')](_0xa82411[_0x3e12('0x32')],function(_0x113b3c){var _0x3e5286={};_0x3e5286[_0x113b3c]={'$like':'%'+_0x37437e['query'][_0x3e12('0x3c')]+'%'};return _0x3e5286;})});}_0xa82411=_['merge']({},_0xa82411,_0x37437e['options']);return _0x44f42a[_0x3e12('0x94')](_0xa82411);}})['then'](function(_0x339b8b){if(_0x339b8b){_0x304f4d=_0x339b8b[_0x3e12('0x34')];if(!_0x37437e[_0x3e12('0x2e')][_0x3e12('0x95')](_0x3e12('0x35'))){_0xa82411['limit']=qs[_0x3e12('0x1e')](_0x37437e[_0x3e12('0x2e')][_0x3e12('0x1e')]);_0xa82411[_0x3e12('0x1b')]=qs[_0x3e12('0x1b')](_0x37437e[_0x3e12('0x2e')]['offset']);}return _0x44f42a[_0x3e12('0x94')](_0xa82411);}})[_0x3e12('0x24')](function(_0x44d24b){if(_0x44d24b){return _0x44d24b?{'count':_0x304f4d,'rows':_0x44d24b}:null;}})[_0x3e12('0x24')](respondWithResult(_0x4b07de,null))[_0x3e12('0x42')](handleError(_0x4b07de,null));}; \ No newline at end of file +var _0x674c=['transaction','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','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','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','Queue','Queues','addQueues','ValidationError','toLowerCase','ids','removeQueues','remove','addAgents','Voice','Chat','Fax','Openchannel','Whatsapp','through','penalty','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','QueueId','findAll','voicePause','interface','UserVoiceQueueRt','upsert','format','SIP/%s','all','VoicePrefixId','spread','removeAgents','Sms','Queue:remove','getAgents','pick','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','Content-Range','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Team','count','includeAll','include','rows','catch','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','UserProfileSection','UserProfileResource','destroy','sequelize'];(function(_0x252c3b,_0xb5d91c){var _0x5dd6bb=function(_0x5629b0){while(--_0x5629b0){_0x252c3b['push'](_0x252c3b['shift']());}};_0x5dd6bb(++_0xb5d91c);}(_0x674c,0x165));var _0xc674=function(_0x1de671,_0x45aa05){_0x1de671=_0x1de671-0x0;var _0x486df1=_0x674c[_0x1de671];return _0x486df1;};'use strict';var emlformat=require(_0xc674('0x0'));var rimraf=require(_0xc674('0x1'));var zipdir=require(_0xc674('0x2'));var jsonpatch=require(_0xc674('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc674('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc674('0x5'));var sox=require(_0xc674('0x6'));var csv=require(_0xc674('0x7'));var ejs=require(_0xc674('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc674('0x9'));var squel=require(_0xc674('0xa'));var crypto=require(_0xc674('0xb'));var jsforce=require(_0xc674('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc674('0x7'));var querystring=require(_0xc674('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc674('0xe'));var hardwareService=require(_0xc674('0xf'));var logger=require(_0xc674('0x10'))('api');var utils=require(_0xc674('0x11'));var config=require(_0xc674('0x12'));var licenseUtil=require(_0xc674('0x13'));var db=require(_0xc674('0x14'))['db'];config['redis']=_[_0xc674('0x15')](config[_0xc674('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xc674('0x17'))(new Redis(config['redis']));require('./team.socket')['register'](socket);function respondWithStatusCode(_0x363430,_0x52a531){_0x52a531=_0x52a531||0xcc;return function(_0x2e00ff){if(_0x2e00ff){return _0x363430[_0xc674('0x18')](_0x52a531);}return _0x363430[_0xc674('0x19')](_0x52a531)[_0xc674('0x1a')]();};}function respondWithResult(_0x573c6c,_0x58b920){_0x58b920=_0x58b920||0xc8;return function(_0x1ae428){if(_0x1ae428){return _0x573c6c[_0xc674('0x19')](_0x58b920)[_0xc674('0x1b')](_0x1ae428);}};}function respondWithFilteredResult(_0x493874,_0x3bd331){return function(_0x1ee90f){if(_0x1ee90f){var _0x1cedbe=typeof _0x3bd331[_0xc674('0x1c')]===_0xc674('0x1d')&&typeof _0x3bd331[_0xc674('0x1e')]===_0xc674('0x1d');var _0x16e588=_0x1ee90f['count'];var _0x265b1c=_0x1cedbe?0x0:_0x3bd331[_0xc674('0x1c')];var _0x3cd4d9=_0x1cedbe?_0x1ee90f['count']:_0x3bd331[_0xc674('0x1c')]+_0x3bd331[_0xc674('0x1e')];var _0x965dd0;if(_0x3cd4d9>=_0x16e588){_0x3cd4d9=_0x16e588;_0x965dd0=0xc8;}else{_0x965dd0=0xce;}_0x493874['status'](_0x965dd0);return _0x493874['set'](_0xc674('0x1f'),_0x265b1c+'-'+_0x3cd4d9+'/'+_0x16e588)[_0xc674('0x1b')](_0x1ee90f);}return null;};}function patchUpdates(_0x443057){return function(_0x4368f5){try{jsonpatch['apply'](_0x4368f5,_0x443057,!![]);}catch(_0x20fb24){return BPromise[_0xc674('0x20')](_0x20fb24);}return _0x4368f5[_0xc674('0x21')]();};}function saveUpdates(_0x27758e,_0x33e1df){return function(_0x2de5ca){if(_0x2de5ca){return _0x2de5ca[_0xc674('0x22')](_0x27758e)[_0xc674('0x23')](function(_0x337e2d){return _0x337e2d;});}return null;};}function handleEntityNotFound(_0x197dc3,_0x4e30f7){return function(_0x5998f9){if(!_0x5998f9){_0x197dc3['sendStatus'](0x194);}return _0x5998f9;};}function handleError(_0x31b7fb,_0x172119){_0x172119=_0x172119||0x1f4;return function(_0x21bd42){logger[_0xc674('0x24')](_0x21bd42[_0xc674('0x25')]);if(_0x21bd42[_0xc674('0x26')]){delete _0x21bd42['name'];}_0x31b7fb['status'](_0x172119)[_0xc674('0x27')](_0x21bd42);};}exports['index']=function(_0x22d8ff,_0x3fb78d){var _0xb65aa6={},_0xe306b3={},_0x1cd96f={'count':0x0,'rows':[]};var _0x388b2b=_[_0xc674('0x28')](db['Team'][_0xc674('0x29')],function(_0x43014d){return{'name':_0x43014d[_0xc674('0x2a')],'type':_0x43014d[_0xc674('0x2b')]['key']};});_0xe306b3[_0xc674('0x2c')]=_['map'](_0x388b2b,_0xc674('0x26'));_0xe306b3[_0xc674('0x2d')]=_['keys'](_0x22d8ff['query']);_0xe306b3[_0xc674('0x2e')]=_[_0xc674('0x2f')](_0xe306b3['model'],_0xe306b3[_0xc674('0x2d')]);_0xb65aa6[_0xc674('0x30')]=_[_0xc674('0x2f')](_0xe306b3['model'],qs[_0xc674('0x31')](_0x22d8ff[_0xc674('0x2d')][_0xc674('0x31')]));_0xb65aa6[_0xc674('0x30')]=_0xb65aa6[_0xc674('0x30')][_0xc674('0x32')]?_0xb65aa6[_0xc674('0x30')]:_0xe306b3['model'];if(!_0x22d8ff[_0xc674('0x2d')]['hasOwnProperty'](_0xc674('0x33'))){_0xb65aa6[_0xc674('0x1e')]=qs['limit'](_0x22d8ff[_0xc674('0x2d')][_0xc674('0x1e')]);_0xb65aa6[_0xc674('0x1c')]=qs[_0xc674('0x1c')](_0x22d8ff[_0xc674('0x2d')][_0xc674('0x1c')]);}_0xb65aa6[_0xc674('0x34')]=qs['sort'](_0x22d8ff[_0xc674('0x2d')][_0xc674('0x35')]);_0xb65aa6[_0xc674('0x36')]=qs[_0xc674('0x2e')](_['pick'](_0x22d8ff['query'],_0xe306b3[_0xc674('0x2e')]),_0x388b2b);if(_0x22d8ff['query'][_0xc674('0x37')]){_0xb65aa6['where']=_[_0xc674('0x38')](_0xb65aa6[_0xc674('0x36')],{'$or':_[_0xc674('0x28')](_0x388b2b,function(_0x5c9375){if(_0x5c9375[_0xc674('0x2b')]!==_0xc674('0x39')){var _0x437636={};_0x437636[_0x5c9375[_0xc674('0x26')]]={'$like':'%'+_0x22d8ff[_0xc674('0x2d')][_0xc674('0x37')]+'%'};return _0x437636;}})});}_0xb65aa6=_[_0xc674('0x38')]({},_0xb65aa6,_0x22d8ff[_0xc674('0x3a')]);var _0x311827={'where':_0xb65aa6['where']};return db[_0xc674('0x3b')][_0xc674('0x3c')](_0x311827)[_0xc674('0x23')](function(_0x3dd4bc){_0x1cd96f[_0xc674('0x3c')]=_0x3dd4bc;if(_0x22d8ff[_0xc674('0x2d')][_0xc674('0x3d')]){_0xb65aa6[_0xc674('0x3e')]=[{'all':!![]}];}return db['Team']['findAll'](_0xb65aa6);})['then'](function(_0x492633){_0x1cd96f[_0xc674('0x3f')]=_0x492633;return _0x1cd96f;})[_0xc674('0x23')](respondWithFilteredResult(_0x3fb78d,_0xb65aa6))[_0xc674('0x40')](handleError(_0x3fb78d,null));};exports['show']=function(_0x25d456,_0x8926c8){var _0x17392d={'raw':![],'where':{'id':_0x25d456[_0xc674('0x41')]['id']}},_0x1d94fd={};_0x1d94fd['model']=_[_0xc674('0x42')](db[_0xc674('0x3b')]['rawAttributes']);_0x1d94fd[_0xc674('0x2d')]=_['keys'](_0x25d456[_0xc674('0x2d')]);_0x1d94fd[_0xc674('0x2e')]=_['intersection'](_0x1d94fd['model'],_0x1d94fd[_0xc674('0x2d')]);_0x17392d[_0xc674('0x30')]=_['intersection'](_0x1d94fd[_0xc674('0x2c')],qs['fields'](_0x25d456[_0xc674('0x2d')][_0xc674('0x31')]));_0x17392d[_0xc674('0x30')]=_0x17392d[_0xc674('0x30')]['length']?_0x17392d[_0xc674('0x30')]:_0x1d94fd['model'];if(_0x25d456[_0xc674('0x2d')][_0xc674('0x3d')]){_0x17392d[_0xc674('0x3e')]=[{'all':!![]}];}_0x17392d=_[_0xc674('0x38')]({},_0x17392d,_0x25d456[_0xc674('0x3a')]);return db['Team'][_0xc674('0x43')](_0x17392d)[_0xc674('0x23')](handleEntityNotFound(_0x8926c8,null))[_0xc674('0x23')](respondWithResult(_0x8926c8,null))[_0xc674('0x40')](handleError(_0x8926c8,null));};exports[_0xc674('0x44')]=function(_0x477dbd,_0x522dc6){return db[_0xc674('0x3b')][_0xc674('0x44')](_0x477dbd[_0xc674('0x45')],{})['then'](function(_0x5b3d3a){var _0x1b2332=_0x477dbd[_0xc674('0x46')][_0xc674('0x47')]({'plain':!![]});if(!_0x1b2332)throw new Error(_0xc674('0x48'));if(_0x1b2332['role']===_0xc674('0x46')){var _0x4cfb48=_0x5b3d3a['get']({'plain':!![]});var _0x510b54=_0xc674('0x49');return db[_0xc674('0x4a')][_0xc674('0x43')]({'where':{'name':_0x510b54,'userProfileId':_0x1b2332['userProfileId']},'raw':!![]})[_0xc674('0x23')](function(_0x18b178){if(_0x18b178&&_0x18b178['autoAssociation']===0x0){return db[_0xc674('0x4b')][_0xc674('0x44')]({'name':_0x4cfb48['name'],'resourceId':_0x4cfb48['id'],'type':_0x18b178[_0xc674('0x26')],'sectionId':_0x18b178['id']},{})[_0xc674('0x23')](function(){return _0x5b3d3a;});}else{return _0x5b3d3a;}})[_0xc674('0x40')](function(_0x4dfbfe){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dfbfe);throw _0x4dfbfe;});}return _0x5b3d3a;})[_0xc674('0x23')](respondWithResult(_0x522dc6,0xc9))[_0xc674('0x40')](handleError(_0x522dc6,null));};exports['update']=function(_0x345e44,_0xbcc3){if(_0x345e44['body']['id']){delete _0x345e44[_0xc674('0x45')]['id'];}return db['Team'][_0xc674('0x43')]({'where':{'id':_0x345e44[_0xc674('0x41')]['id']}})['then'](handleEntityNotFound(_0xbcc3,null))[_0xc674('0x23')](saveUpdates(_0x345e44[_0xc674('0x45')],null))['then'](respondWithResult(_0xbcc3,null))['catch'](handleError(_0xbcc3,null));};exports[_0xc674('0x4c')]=function(_0x3a5a4f,_0x41e140){var _0xe1bc50=_0x3a5a4f[_0xc674('0x41')]['id'];var _0x26e5f5=[];return db[_0xc674('0x4d')][_0xc674('0x4e')](function(_0xfbb98){var _0x316115='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0xe1bc50;return db[_0xc674('0x4d')][_0xc674('0x2d')](_0x316115,{'type':db[_0xc674('0x4f')][_0xc674('0x50')]['SELECT'],'raw':!![],'transaction':_0xfbb98})[_0xc674('0x23')](function(_0x498385){_0x26e5f5=_['map'](_0x498385,function(_0x52e100){return Number(_0x52e100[_0xc674('0x51')]);});})['then'](function(){var _0x29d50d=_0xc674('0x52')+_0xe1bc50;return db[_0xc674('0x4d')][_0xc674('0x2d')](_0x29d50d,{'type':db[_0xc674('0x4f')][_0xc674('0x50')][_0xc674('0x53')],'raw':!![],'transaction':_0xfbb98});})['then'](function(_0x1c5b32){var _0x96c156=_['map'](_0x1c5b32,function(_0x302a55){return Number(_0x302a55[_0xc674('0x54')]);});return db[_0xc674('0x55')][_0xc674('0x4c')]({'where':{'UserId':{'$in':_0x26e5f5},'VoiceQueueId':{'$in':_0x96c156}},'transaction':_0xfbb98});})['then'](function(){var _0x95823a=_0xc674('0x56')+_0xe1bc50;return db[_0xc674('0x4d')][_0xc674('0x2d')](_0x95823a,{'type':db['Sequelize'][_0xc674('0x50')][_0xc674('0x53')],'raw':!![],'transaction':_0xfbb98});})[_0xc674('0x23')](function(_0x29a6df){var _0x2235e5=_[_0xc674('0x28')](_0x29a6df,function(_0x29751){return Number(_0x29751[_0xc674('0x57')]);});return db[_0xc674('0x58')][_0xc674('0x4c')]({'where':{'UserId':{'$in':_0x26e5f5},'MailQueueId':{'$in':_0x2235e5}},'transaction':_0xfbb98});})['then'](function(){var _0x93b5eb=_0xc674('0x59')+_0xe1bc50;return db[_0xc674('0x4d')]['query'](_0x93b5eb,{'type':db[_0xc674('0x4f')][_0xc674('0x50')][_0xc674('0x53')],'raw':!![],'transaction':_0xfbb98});})['then'](function(_0x2e016a){var _0x4f8c91=_['map'](_0x2e016a,function(_0x21373c){return Number(_0x21373c['SmsQueueId']);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x26e5f5},'SmsQueueId':{'$in':_0x4f8c91}},'transaction':_0xfbb98});})[_0xc674('0x23')](function(){var _0x4d0d7b=_0xc674('0x5a')+_0xe1bc50;return db[_0xc674('0x4d')]['query'](_0x4d0d7b,{'type':db[_0xc674('0x4f')][_0xc674('0x50')][_0xc674('0x53')],'raw':!![],'transaction':_0xfbb98});})[_0xc674('0x23')](function(_0x5b4f08){var _0x65ed0b=_['map'](_0x5b4f08,function(_0x4f5a0f){return Number(_0x4f5a0f[_0xc674('0x5b')]);});return db['UserChatQueue'][_0xc674('0x4c')]({'where':{'UserId':{'$in':_0x26e5f5},'ChatQueueId':{'$in':_0x65ed0b}},'transaction':_0xfbb98});})['then'](function(){var _0x566516=_0xc674('0x5c')+_0xe1bc50;return db['sequelize'][_0xc674('0x2d')](_0x566516,{'type':db[_0xc674('0x4f')][_0xc674('0x50')][_0xc674('0x53')],'raw':!![],'transaction':_0xfbb98});})[_0xc674('0x23')](function(_0x363429){var _0x532019=_[_0xc674('0x28')](_0x363429,function(_0x395232){return Number(_0x395232['FaxQueueId']);});return db[_0xc674('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x26e5f5},'FaxQueueId':{'$in':_0x532019}},'transaction':_0xfbb98});})['then'](function(){var _0x56fb38=_0xc674('0x5e')+_0xe1bc50;return db[_0xc674('0x4d')][_0xc674('0x2d')](_0x56fb38,{'type':db[_0xc674('0x4f')][_0xc674('0x50')][_0xc674('0x53')],'raw':!![],'transaction':_0xfbb98});})[_0xc674('0x23')](function(_0x4bb617){var _0x1075b3=_[_0xc674('0x28')](_0x4bb617,function(_0x9be435){return Number(_0x9be435[_0xc674('0x5f')]);});return db[_0xc674('0x60')][_0xc674('0x4c')]({'where':{'UserId':{'$in':_0x26e5f5},'OpenchannelQueueId':{'$in':_0x1075b3}},'transaction':_0xfbb98});})['then'](function(){var _0x1ea2de=_0xc674('0x61')+_0xe1bc50;return db[_0xc674('0x4d')][_0xc674('0x2d')](_0x1ea2de,{'type':db[_0xc674('0x4f')][_0xc674('0x50')][_0xc674('0x53')],'raw':!![],'transaction':_0xfbb98});})[_0xc674('0x23')](function(_0xc7820e){var _0x30fe60=_[_0xc674('0x28')](_0xc7820e,function(_0xa38428){return Number(_0xa38428[_0xc674('0x62')]);});return db[_0xc674('0x63')]['destroy']({'where':{'UserId':{'$in':_0x26e5f5},'WhatsappQueueId':{'$in':_0x30fe60}},'transaction':_0xfbb98});})[_0xc674('0x23')](function(){return db[_0xc674('0x64')][_0xc674('0x43')]({'where':{'TeamId':_0xe1bc50}});})[_0xc674('0x23')](function(_0x474ada){if(_0x474ada===null){return;}return db[_0xc674('0x65')][_0xc674('0x4c')]({'where':{'UserId':{'$in':_0x26e5f5},'VoicePrefixId':_0x474ada['VoicePrefixId']},'transaction':_0xfbb98});})[_0xc674('0x23')](function(){return db['Team'][_0xc674('0x4c')]({'where':{'id':_0xe1bc50},'cascade':!![],'transaction':_0xfbb98});})[_0xc674('0x23')](function(_0x3a3c4e){if(_0x3a3c4e===0x0){_0x41e140[_0xc674('0x18')](0x194);}else{return db[_0xc674('0x4b')][_0xc674('0x4c')]({'where':{'type':_0xc674('0x49'),'resourceId':_0xe1bc50},'cascade':!![],'transaction':_0xfbb98})[_0xc674('0x23')](function(){_0x41e140[_0xc674('0x19')](0xcc)[_0xc674('0x1a')]();});}})['catch'](function(_0x50109b){_0x41e140[_0xc674('0x19')](0x1f4)[_0xc674('0x27')](_0x50109b);});});};exports[_0xc674('0x66')]=function(_0x17a0ce,_0x9dfa11,_0x45cc9e){return db[_0xc674('0x3b')][_0xc674('0x67')]({'where':{'id':_0x17a0ce[_0xc674('0x41')]['id']}})[_0xc674('0x23')](handleEntityNotFound(_0x9dfa11,null))[_0xc674('0x23')](function(_0x3ae389){if(!_0x17a0ce[_0xc674('0x2d')][_0xc674('0x68')]||!utils[_0xc674('0x69')](_0x17a0ce[_0xc674('0x2d')]['channel'])){throw new db[(_0xc674('0x4f'))]['ValidationError'](_0xc674('0x6a'));}var _0x353421={};var _0x2ad7e3={};_0x2ad7e3[_0xc674('0x2c')]=_[_0xc674('0x42')](db[_[_0xc674('0x6b')](_0x17a0ce[_0xc674('0x2d')][_0xc674('0x68')]['toLowerCase']())+_0xc674('0x6c')][_0xc674('0x29')]);_0x2ad7e3[_0xc674('0x2d')]=_[_0xc674('0x42')](_0x17a0ce[_0xc674('0x2d')]);_0x2ad7e3[_0xc674('0x2e')]=_[_0xc674('0x2f')](_0x2ad7e3[_0xc674('0x2c')],_0x2ad7e3[_0xc674('0x2d')]);_0x353421[_0xc674('0x30')]=_[_0xc674('0x2f')](_0x2ad7e3['model'],qs['fields'](_0x17a0ce[_0xc674('0x2d')][_0xc674('0x31')]));_0x353421['attributes']=_0x353421[_0xc674('0x30')][_0xc674('0x32')]?_0x353421['attributes']:_0x2ad7e3['model'];_0x353421[_0xc674('0x1e')]=qs['limit'](_0x17a0ce[_0xc674('0x2d')]['limit']);_0x353421[_0xc674('0x1c')]=qs['offset'](_0x17a0ce[_0xc674('0x2d')][_0xc674('0x1c')]);_0x353421[_0xc674('0x34')]=qs['sort'](_0x17a0ce[_0xc674('0x2d')][_0xc674('0x35')]);_0x353421[_0xc674('0x36')]=qs[_0xc674('0x2e')](_['pick'](_0x17a0ce[_0xc674('0x2d')],_0x2ad7e3[_0xc674('0x2e')]));_0x353421=_['merge']({},_0x353421,_0x17a0ce['options']);return _0x3ae389['get'+_[_0xc674('0x6b')](_0x17a0ce[_0xc674('0x2d')]['channel']['toLowerCase']())+_0xc674('0x6d')](_0x353421);})[_0xc674('0x23')](respondWithResult(_0x9dfa11,null))['catch'](handleError(_0x9dfa11,null));};exports[_0xc674('0x6e')]=function(_0x5b2668,_0x30040b,_0x16ae0b){return db[_0xc674('0x3b')]['findOne']({'where':{'id':_0x5b2668[_0xc674('0x41')]['id']}})[_0xc674('0x23')](function(_0x437192){if(_0x437192){if(!_0x5b2668[_0xc674('0x45')][_0xc674('0x68')]||!utils[_0xc674('0x69')](_0x5b2668['body'][_0xc674('0x68')])){throw new db[(_0xc674('0x4f'))][(_0xc674('0x6f'))](_0xc674('0x6a'));}return _0x437192['add'+_['capitalize'](_0x5b2668['body'][_0xc674('0x68')][_0xc674('0x70')]())+_0xc674('0x6d')](_0x5b2668[_0xc674('0x45')][_0xc674('0x71')]);}return null;})[_0xc674('0x23')](handleEntityNotFound(_0x30040b,null))[_0xc674('0x23')](respondWithStatusCode(_0x30040b,null))[_0xc674('0x40')](handleError(_0x30040b,null));};exports[_0xc674('0x72')]=function(_0x1bc4e3,_0x5d8249,_0x447f41){return db[_0xc674('0x3b')][_0xc674('0x67')]({'where':{'id':_0x1bc4e3[_0xc674('0x41')]['id']}})[_0xc674('0x23')](function(_0x4e01fd){if(_0x4e01fd){if(!_0x1bc4e3[_0xc674('0x2d')]['channel']||!utils[_0xc674('0x69')](_0x1bc4e3[_0xc674('0x2d')][_0xc674('0x68')])){throw new db[(_0xc674('0x4f'))][(_0xc674('0x6f'))](_0xc674('0x6a'));}return _0x4e01fd[_0xc674('0x73')+_[_0xc674('0x6b')](_0x1bc4e3[_0xc674('0x2d')][_0xc674('0x68')][_0xc674('0x70')]())+_0xc674('0x6d')](_0x1bc4e3[_0xc674('0x2d')]['ids']);}return null;})[_0xc674('0x23')](handleEntityNotFound(_0x5d8249,null))[_0xc674('0x23')](respondWithStatusCode(_0x5d8249,null))['catch'](handleError(_0x5d8249,null));};exports[_0xc674('0x74')]=function(_0x151de1,_0x17a597){var _0x19823b=_['isArray'](_0x151de1[_0xc674('0x45')][_0xc674('0x71')])?_0x151de1[_0xc674('0x45')]['ids']:[_0x151de1[_0xc674('0x45')][_0xc674('0x71')]];var _0x4f52bc=_0x151de1[_0xc674('0x41')]['id'];return db[_0xc674('0x3b')][_0xc674('0x43')]({'where':{'id':_0x4f52bc}})['then'](handleEntityNotFound(_0x17a597,null))[_0xc674('0x23')](function(_0x48b8f8){if(_0x48b8f8){var _0x4044ab=[_0xc674('0x75'),_0xc674('0x76'),'Mail','Sms',_0xc674('0x77'),_0xc674('0x78'),_0xc674('0x79')];return db[_0xc674('0x4d')][_0xc674('0x4e')](function(_0x284c23){var _0x3d60c2=_[_0xc674('0x28')](_0x4044ab,function(_0x24597b){var _0x1e8ec2={'attributes':['id',_0xc674('0x26')]};if(_0x24597b===_0xc674('0x75')){_0x1e8ec2[_0xc674('0x7a')]={'attributes':[_0xc674('0x7b')]};}return _0x48b8f8[_0xc674('0x47')+_0x24597b+'Queues'](_0x1e8ec2)[_0xc674('0x23')](function(_0x585417){var _0x218471=_[_0xc674('0x28')](_0x585417,function(_0x40558e){var _0x366efc=_['map'](_0x19823b,function(_0x2cd5ab){var _0xf79aae={'where':{'UserId':_0x2cd5ab,[_0x24597b+'QueueId']:_0x40558e['id']},'transaction':_0x284c23};if(_0x24597b==='Voice'){_0xf79aae[_0xc674('0x15')]={'penalty':_0x40558e[_0xc674('0x7c')][_0xc674('0x7b')]};}return db[_0xc674('0x7d')+_0x24597b+_0xc674('0x6c')][_0xc674('0x7e')](_0xf79aae)[_0xc674('0x23')](function(){socket[_0xc674('0x7f')](_0xc674('0x46')+_0x24597b+_0xc674('0x80'),{'UserId':_0x2cd5ab,[_0x24597b+_0xc674('0x81')]:_0x40558e['id']});if(_0x24597b!==_0xc674('0x75')){return;}return db[_0xc674('0x7d')][_0xc674('0x82')]({'where':{'id':_0x19823b,'online':0x1},'attributes':['id','name','online',_0xc674('0x83'),_0xc674('0x84')],'raw':!![]})['then'](function(_0x3687d0){var _0x58301c=_[_0xc674('0x28')](_0x3687d0,function(_0x1f0ce0){return db[_0xc674('0x85')][_0xc674('0x86')]({'membername':_0x1f0ce0[_0xc674('0x26')],'UserId':_0x1f0ce0['id'],'queue_name':_0x40558e[_0xc674('0x26')],'VoiceQueueId':_0x40558e['id'],'interface':_['isNil'](_0x1f0ce0['interface'])?util[_0xc674('0x87')](_0xc674('0x88'),_0x1f0ce0[_0xc674('0x26')]):_0x1f0ce0[_0xc674('0x84')],'paused':_0x1f0ce0[_0xc674('0x83')]||![],'penalty':_0x40558e[_0xc674('0x7c')][_0xc674('0x7b')]},{'transaction':_0x284c23});});return Promise[_0xc674('0x89')](_0x58301c);});});});return Promise[_0xc674('0x89')](_0x366efc);});return Promise[_0xc674('0x89')](_0x218471);})[_0xc674('0x23')](function(){return db[_0xc674('0x64')][_0xc674('0x67')]({'where':{'teamId':_0x4f52bc}})[_0xc674('0x23')](function(_0x2745c2){if(_0x2745c2){var _0x2dea48=_[_0xc674('0x28')](_0x19823b,function(_0x2605b4){db['UserVoicePrefix'][_0xc674('0x86')]({'UserId':_0x2605b4,'VoicePrefixId':_0x2745c2[_0xc674('0x8a')]});});return Promise[_0xc674('0x89')](_0x2dea48);}});});});return Promise[_0xc674('0x89')](_0x3d60c2)[_0xc674('0x23')](function(){return _0x48b8f8[_0xc674('0x74')](_0x19823b,{'transaction':_0x284c23})[_0xc674('0x8b')](function(_0x113bf3){return _0x113bf3;});});});}})[_0xc674('0x23')](respondWithResult(_0x17a597,null))[_0xc674('0x40')](handleError(_0x17a597,null));};exports[_0xc674('0x8c')]=function(_0xc143a2,_0x579052){var _0x344249=_['isArray'](_0xc143a2[_0xc674('0x2d')]['ids'])?_0xc143a2[_0xc674('0x2d')][_0xc674('0x71')]:[_0xc143a2[_0xc674('0x2d')][_0xc674('0x71')]];var _0x57a7d9=_0xc143a2[_0xc674('0x41')]['id'];return db['Team'][_0xc674('0x43')]({'where':{'id':_0x57a7d9}})['then'](handleEntityNotFound(_0x579052,null))[_0xc674('0x23')](function(_0x230245){if(_0x230245){var _0x426a58=[_0xc674('0x75'),_0xc674('0x76'),'Mail',_0xc674('0x8d'),_0xc674('0x77'),_0xc674('0x78'),_0xc674('0x79')];return db['sequelize']['transaction'](function(_0x365c7e){var _0x3cf318=_[_0xc674('0x28')](_0x426a58,function(_0x5787b6){var _0x4ed8da={'attributes':['id',_0xc674('0x26')]};return _0x230245['get'+_0x5787b6+_0xc674('0x6d')](_0x4ed8da)[_0xc674('0x23')](function(_0x15759c){var _0x53276b=_[_0xc674('0x28')](_0x15759c,function(_0x5ec0bd){return _0x5ec0bd[_0xc674('0x8c')](_0x344249,{'transaction':_0x365c7e})[_0xc674('0x23')](function(){var _0x821a27=_[_0xc674('0x28')](_0x344249,function(_0x636713){socket[_0xc674('0x7f')](_0xc674('0x46')+_0x5787b6+_0xc674('0x8e'),{'UserId':Number(_0x636713),[_0x5787b6+'QueueId']:_0x5ec0bd['id']});if(_0x5787b6!==_0xc674('0x75')){return;}return db['UserVoiceQueueRt'][_0xc674('0x4c')]({'where':{'VoiceQueueId':_0x5ec0bd['id'],'UserId':_0x636713},'transaction':_0x365c7e});});return Promise['all'](_0x821a27);});});return Promise[_0xc674('0x89')](_0x53276b);});});return Promise[_0xc674('0x89')](_0x3cf318)[_0xc674('0x23')](function(){return _0x230245[_0xc674('0x8c')](_0x344249,{'transaction':_0x365c7e});})['then'](function(){return db[_0xc674('0x64')][_0xc674('0x67')]({'where':{'teamId':_0x57a7d9}})['then'](function(_0x4d5175){if(_0x4d5175){var _0x486602=_[_0xc674('0x28')](_0x344249,function(_0x90b072){db['UserVoicePrefix'][_0xc674('0x4c')]({'where':{'UserId':_0x90b072,'VoicePrefixId':_0x4d5175[_0xc674('0x8a')]}});});return Promise['all'](_0x486602);}});});});}})[_0xc674('0x23')](respondWithStatusCode(_0x579052,null))[_0xc674('0x40')](handleError(_0x579052,null));};exports[_0xc674('0x8f')]=function(_0x424271,_0x3837ec,_0x5c95b8){var _0x2a7b60={};var _0x13f78f={};var _0x46e25e;var _0x35e8fd;return db[_0xc674('0x3b')][_0xc674('0x67')]({'where':{'id':_0x424271[_0xc674('0x41')]['id']}})[_0xc674('0x23')](handleEntityNotFound(_0x3837ec,null))[_0xc674('0x23')](function(_0x4f1ad0){if(_0x4f1ad0){_0x46e25e=_0x4f1ad0;_0x13f78f['model']=_[_0xc674('0x42')](db['User'][_0xc674('0x29')]);_0x13f78f[_0xc674('0x2d')]=_[_0xc674('0x42')](_0x424271['query']);_0x13f78f['filters']=_[_0xc674('0x2f')](_0x13f78f['model'],_0x13f78f[_0xc674('0x2d')]);_0x2a7b60['attributes']=_['intersection'](_0x13f78f[_0xc674('0x2c')],qs['fields'](_0x424271[_0xc674('0x2d')][_0xc674('0x31')]));_0x2a7b60[_0xc674('0x30')]=_0x2a7b60[_0xc674('0x30')][_0xc674('0x32')]?_0x2a7b60[_0xc674('0x30')]:_0x13f78f[_0xc674('0x2c')];_0x2a7b60[_0xc674('0x34')]=qs[_0xc674('0x35')](_0x424271[_0xc674('0x2d')]['sort']);_0x2a7b60[_0xc674('0x36')]=qs[_0xc674('0x2e')](_[_0xc674('0x90')](_0x424271[_0xc674('0x2d')],_0x13f78f[_0xc674('0x2e')]));if(_0x424271[_0xc674('0x2d')][_0xc674('0x37')]){_0x2a7b60[_0xc674('0x36')]=_[_0xc674('0x38')](_0x2a7b60['where'],{'$or':_[_0xc674('0x28')](_0x2a7b60[_0xc674('0x30')],function(_0xe57d94){var _0x4ac22f={};_0x4ac22f[_0xe57d94]={'$like':'%'+_0x424271['query'][_0xc674('0x37')]+'%'};return _0x4ac22f;})});}_0x2a7b60=_[_0xc674('0x38')]({},_0x2a7b60,_0x424271['options']);return _0x46e25e['getAgents'](_0x2a7b60);}})[_0xc674('0x23')](function(_0x44c8ec){if(_0x44c8ec){_0x35e8fd=_0x44c8ec[_0xc674('0x32')];if(!_0x424271[_0xc674('0x2d')]['hasOwnProperty'](_0xc674('0x33'))){_0x2a7b60[_0xc674('0x1e')]=qs[_0xc674('0x1e')](_0x424271['query'][_0xc674('0x1e')]);_0x2a7b60[_0xc674('0x1c')]=qs['offset'](_0x424271['query'][_0xc674('0x1c')]);}return _0x46e25e[_0xc674('0x8f')](_0x2a7b60);}})[_0xc674('0x23')](function(_0x336a26){if(_0x336a26){return _0x336a26?{'count':_0x35e8fd,'rows':_0x336a26}:null;}})[_0xc674('0x23')](respondWithResult(_0x3837ec,null))[_0xc674('0x40')](handleError(_0x3837ec,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 2344ec6..7b418b1 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 _0x80b0=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x259efb,_0xe3ab10){var _0x8f2084=function(_0x389304){while(--_0x389304){_0x259efb['push'](_0x259efb['shift']());}};_0x8f2084(++_0xe3ab10);}(_0x80b0,0x103));var _0x080b=function(_0x46c452,_0xf2a465){_0x46c452=_0x46c452-0x0;var _0x599b8c=_0x80b0[_0x46c452];return _0x599b8c;};'use strict';var EventEmitter=require(_0x080b('0x0'));var Team=require(_0x080b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x080b('0x2')](0x0);var events={'afterCreate':_0x080b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x58ebd9){return function(_0x3103eb,_0x35964f,_0x7fcd87){TeamEvents[_0x080b('0x4')](_0x58ebd9+':'+_0x3103eb['id'],_0x3103eb);TeamEvents['emit'](_0x58ebd9,_0x3103eb);_0x7fcd87(null);};}for(var e in events){if(events[_0x080b('0x5')](e)){var event=events[e];Team[_0x080b('0x6')](e,emitEvent(event));}}module[_0x080b('0x7')]=TeamEvents; \ No newline at end of file +var _0x4705=['save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Team'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x4705,0x116));var _0x5470=function(_0x4c81ba,_0x20e62a){_0x4c81ba=_0x4c81ba-0x0;var _0x1d2d27=_0x4705[_0x4c81ba];return _0x1d2d27;};'use strict';var EventEmitter=require('events');var Team=require(_0x5470('0x0'))['db'][_0x5470('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5470('0x2'),'afterUpdate':'update','afterDestroy':_0x5470('0x3')};function emitEvent(_0x4677c6){return function(_0x3875e2,_0x46c07b,_0x36a8f7){TeamEvents[_0x5470('0x4')](_0x4677c6+':'+_0x3875e2['id'],_0x3875e2);TeamEvents[_0x5470('0x4')](_0x4677c6,_0x3875e2);_0x36a8f7(null);};}for(var e in events){if(events[_0x5470('0x5')](e)){var event=events[e];Team[_0x5470('0x6')](e,emitEvent(event));}}module[_0x5470('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 2d4bc1e..3adccbd 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 _0x130c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','Team','teams','util','../../config/logger','api'];(function(_0x318054,_0x516efd){var _0x19a6ae=function(_0x4a35f2){while(--_0x4a35f2){_0x318054['push'](_0x318054['shift']());}};_0x19a6ae(++_0x516efd);}(_0x130c,0x1c0));var _0xc130=function(_0x50148a,_0x340e54){_0x50148a=_0x50148a-0x0;var _0x3aef8d=_0x130c[_0x50148a];return _0x3aef8d;};'use strict';var _=require('lodash');var util=require(_0xc130('0x0'));var logger=require(_0xc130('0x1'))(_0xc130('0x2'));var moment=require(_0xc130('0x3'));var BPromise=require(_0xc130('0x4'));var rp=require(_0xc130('0x5'));var fs=require('fs');var path=require(_0xc130('0x6'));var rimraf=require(_0xc130('0x7'));var config=require(_0xc130('0x8'));var attributes=require('./team.attributes');module['exports']=function(_0x3dfcd8,_0x2b9716){return _0x3dfcd8['define'](_0xc130('0x9'),attributes,{'tableName':_0xc130('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1852=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Team','teams','lodash','util','../../config/logger','moment'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x1852,0x1c4));var _0x2185=function(_0x2b50dd,_0x251bf3){_0x2b50dd=_0x2b50dd-0x0;var _0x434ece=_0x1852[_0x2b50dd];return _0x434ece;};'use strict';var _=require(_0x2185('0x0'));var util=require(_0x2185('0x1'));var logger=require(_0x2185('0x2'))('api');var moment=require(_0x2185('0x3'));var BPromise=require(_0x2185('0x4'));var rp=require(_0x2185('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2185('0x6'));var config=require(_0x2185('0x7'));var attributes=require('./team.attributes');module[_0x2185('0x8')]=function(_0x322c10,_0x4ea816){return _0x322c10[_0x2185('0x9')](_0x2185('0xa'),attributes,{'tableName':_0x2185('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 29d463a..d57c440 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 _0x29a0=['Team,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','debug'];(function(_0x260b13,_0xa10467){var _0x589e54=function(_0x478796){while(--_0x478796){_0x260b13['push'](_0x260b13['shift']());}};_0x589e54(++_0xa10467);}(_0x29a0,0xf1));var _0x029a=function(_0x48a01e,_0x50a44e){_0x48a01e=_0x48a01e-0x0;var _0x13eb02=_0x29a0[_0x48a01e];return _0x13eb02;};'use strict';var _=require(_0x029a('0x0'));var util=require(_0x029a('0x1'));var moment=require(_0x029a('0x2'));var BPromise=require(_0x029a('0x3'));var rs=require(_0x029a('0x4'));var fs=require('fs');var Redis=require(_0x029a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x029a('0x6'));var jayson=require(_0x029a('0x7'));var client=jayson[_0x029a('0x8')][_0x029a('0x9')]({'port':0x232a});config[_0x029a('0xa')]=_[_0x029a('0xb')](config[_0x029a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x029a('0xc'))(new Redis(config[_0x029a('0xa')]));require(_0x029a('0xd'))['register'](socket);function respondWithRpcPromise(_0x8b3d67,_0x30c135,_0x18604c){return new BPromise(function(_0x279d78,_0x18dc69){return client[_0x029a('0xe')](_0x8b3d67,_0x18604c)[_0x029a('0xf')](function(_0x1fdadb){logger[_0x029a('0x10')](_0x029a('0x11'),_0x30c135,'request\x20sent');logger[_0x029a('0x12')](_0x029a('0x13'),_0x30c135,_0x029a('0x14'),JSON['stringify'](_0x1fdadb));if(_0x1fdadb['error']){if(_0x1fdadb['error'][_0x029a('0x15')]===0x1f4){logger[_0x029a('0x16')](_0x029a('0x11'),_0x30c135,_0x1fdadb[_0x029a('0x16')][_0x029a('0x17')]);return _0x18dc69(_0x1fdadb['error'][_0x029a('0x17')]);}logger[_0x029a('0x16')](_0x029a('0x11'),_0x30c135,_0x1fdadb[_0x029a('0x16')]['message']);return _0x279d78(_0x1fdadb[_0x029a('0x16')]['message']);}else{logger[_0x029a('0x10')](_0x029a('0x11'),_0x30c135,'request\x20sent');_0x279d78(_0x1fdadb[_0x029a('0x18')]['message']);}})[_0x029a('0x19')](function(_0x2bdf0e){logger[_0x029a('0x16')](_0x029a('0x11'),_0x30c135,_0x2bdf0e);_0x18dc69(_0x2bdf0e);});});} \ No newline at end of file +var _0x623e=['result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Team,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x623e,0x65));var _0xe623=function(_0xc4e092,_0x5a666c){_0xc4e092=_0xc4e092-0x0;var _0x1143c6=_0x623e[_0xc4e092];return _0x1143c6;};'use strict';var _=require(_0xe623('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe623('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe623('0x2'));var db=require(_0xe623('0x3'))['db'];var utils=require(_0xe623('0x4'));var logger=require(_0xe623('0x5'))(_0xe623('0x6'));var config=require('../../config/environment');var jayson=require(_0xe623('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xe623('0x8')]=_[_0xe623('0x9')](config[_0xe623('0x8')],{'host':_0xe623('0xa'),'port':0x18eb});var socket=require(_0xe623('0xb'))(new Redis(config['redis']));require('./team.socket')[_0xe623('0xc')](socket);function respondWithRpcPromise(_0x5930e2,_0x5645fe,_0x1e8468){return new BPromise(function(_0x4300f6,_0x36842d){return client[_0xe623('0xd')](_0x5930e2,_0x1e8468)[_0xe623('0xe')](function(_0x40afb2){logger[_0xe623('0xf')]('Team,\x20%s,\x20%s',_0x5645fe,'request\x20sent');logger[_0xe623('0x10')](_0xe623('0x11'),_0x5645fe,_0xe623('0x12'),JSON[_0xe623('0x13')](_0x40afb2));if(_0x40afb2['error']){if(_0x40afb2[_0xe623('0x14')][_0xe623('0x15')]===0x1f4){logger[_0xe623('0x14')](_0xe623('0x16'),_0x5645fe,_0x40afb2[_0xe623('0x14')][_0xe623('0x17')]);return _0x36842d(_0x40afb2['error'][_0xe623('0x17')]);}logger[_0xe623('0x14')]('Team,\x20%s,\x20%s',_0x5645fe,_0x40afb2['error'][_0xe623('0x17')]);return _0x4300f6(_0x40afb2[_0xe623('0x14')][_0xe623('0x17')]);}else{logger[_0xe623('0xf')](_0xe623('0x16'),_0x5645fe,'request\x20sent');_0x4300f6(_0x40afb2[_0xe623('0x18')][_0xe623('0x17')]);}})['catch'](function(_0x1bda74){logger[_0xe623('0x14')](_0xe623('0x16'),_0x5645fe,_0x1bda74);_0x36842d(_0x1bda74);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 79079dd..493d6f1 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 _0x56e5=['save','remove','update','emit','removeListener','register','team:','./team.events'];(function(_0x325bd0,_0x30d5c2){var _0x123c8b=function(_0x289be7){while(--_0x289be7){_0x325bd0['push'](_0x325bd0['shift']());}};_0x123c8b(++_0x30d5c2);}(_0x56e5,0x18f));var _0x556e=function(_0x1a0303,_0x6508d3){_0x1a0303=_0x1a0303-0x0;var _0x4f9bee=_0x56e5[_0x1a0303];return _0x4f9bee;};'use strict';var TeamEvents=require(_0x556e('0x0'));var events=[_0x556e('0x1'),_0x556e('0x2'),_0x556e('0x3')];function createListener(_0x3fe1f9,_0x191886){return function(_0x1eae83){_0x191886[_0x556e('0x4')](_0x3fe1f9,_0x1eae83);};}function removeListener(_0x367309,_0x4ceab0){return function(){TeamEvents[_0x556e('0x5')](_0x367309,_0x4ceab0);};}exports[_0x556e('0x6')]=function(_0x3168ec){for(var _0x2335a9=0x0,_0x5a387b=events['length'];_0x2335a9<_0x5a387b;_0x2335a9++){var _0x2b93bb=events[_0x2335a9];var _0x236500=createListener(_0x556e('0x7')+_0x2b93bb,_0x3168ec);TeamEvents['on'](_0x2b93bb,_0x236500);}}; \ No newline at end of file +var _0x950a=['removeListener','register','length','team:','./team.events','save','remove','emit'];(function(_0x32b3e7,_0x1a7928){var _0x3e783b=function(_0x452c53){while(--_0x452c53){_0x32b3e7['push'](_0x32b3e7['shift']());}};_0x3e783b(++_0x1a7928);}(_0x950a,0x174));var _0xa950=function(_0x49007e,_0x604493){_0x49007e=_0x49007e-0x0;var _0x2dbca6=_0x950a[_0x49007e];return _0x2dbca6;};'use strict';var TeamEvents=require(_0xa950('0x0'));var events=[_0xa950('0x1'),_0xa950('0x2'),'update'];function createListener(_0x4738c5,_0x5cde25){return function(_0x498d62){_0x5cde25[_0xa950('0x3')](_0x4738c5,_0x498d62);};}function removeListener(_0x335705,_0x35f833){return function(){TeamEvents[_0xa950('0x4')](_0x335705,_0x35f833);};}exports[_0xa950('0x5')]=function(_0x1090b){for(var _0x3fa8ac=0x0,_0x57e8ff=events[_0xa950('0x6')];_0x3fa8ac<_0x57e8ff;_0x3fa8ac++){var _0x11bd04=events[_0x3fa8ac];var _0x13f2de=createListener(_0xa950('0x7')+_0x11bd04,_0x1090b);TeamEvents['on'](_0x11bd04,_0x13f2de);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 9a47a27..b031159 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 _0x6324=['INTEGER','sequelize','exports'];(function(_0x41b369,_0x29e21f){var _0x2af633=function(_0x588c87){while(--_0x588c87){_0x41b369['push'](_0x41b369['shift']());}};_0x2af633(++_0x29e21f);}(_0x6324,0x142));var _0x4632=function(_0x4a0b15,_0x54818b){_0x4a0b15=_0x4a0b15-0x0;var _0x54f515=_0x6324[_0x4a0b15];return _0x54f515;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'TeamId':{'type':Sequelize[_0x4632('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x4632('0x2')]}}; \ No newline at end of file +var _0xb3ea=['exports','INTEGER','sequelize'];(function(_0x5dae83,_0x5034b1){var _0x361a1b=function(_0x2a0e91){while(--_0x2a0e91){_0x5dae83['push'](_0x5dae83['shift']());}};_0x361a1b(++_0x5034b1);}(_0xb3ea,0xc5));var _0xab3e=function(_0x13894e,_0x3ff20f){_0x13894e=_0x13894e-0x0;var _0x11a5ca=_0xb3ea[_0x13894e];return _0x11a5ca;};'use strict';var Sequelize=require(_0xab3e('0x0'));module[_0xab3e('0x1')]={'TeamId':{'type':Sequelize[_0xab3e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xab3e('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index b5960e9..e4b021c 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 _0x8c11=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','lodash','util'];(function(_0x12dcc0,_0x59a5a2){var _0x50eee5=function(_0x450766){while(--_0x450766){_0x12dcc0['push'](_0x12dcc0['shift']());}};_0x50eee5(++_0x59a5a2);}(_0x8c11,0xf5));var _0x18c1=function(_0x2ac507,_0x34e90f){_0x2ac507=_0x2ac507-0x0;var _0x15fee2=_0x8c11[_0x2ac507];return _0x15fee2;};'use strict';var _=require(_0x18c1('0x0'));var util=require(_0x18c1('0x1'));var logger=require(_0x18c1('0x2'))(_0x18c1('0x3'));var moment=require(_0x18c1('0x4'));var BPromise=require(_0x18c1('0x5'));var rp=require(_0x18c1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18c1('0x7'));var config=require(_0x18c1('0x8'));var attributes=require(_0x18c1('0x9'));module[_0x18c1('0xa')]=function(_0x1264cd,_0x12aa20){return _0x1264cd[_0x18c1('0xb')](_0x18c1('0xc'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12c9=['define','TeamVoicePrefix','team_has_voice_prefixes','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x4d05dd,_0x258cdd){var _0x1c5226=function(_0x1a857c){while(--_0x1a857c){_0x4d05dd['push'](_0x4d05dd['shift']());}};_0x1c5226(++_0x258cdd);}(_0x12c9,0x9f));var _0x912c=function(_0x597c92,_0x43c599){_0x597c92=_0x597c92-0x0;var _0x9cfc93=_0x12c9[_0x597c92];return _0x9cfc93;};'use strict';var _=require(_0x912c('0x0'));var util=require('util');var logger=require(_0x912c('0x1'))('api');var moment=require(_0x912c('0x2'));var BPromise=require('bluebird');var rp=require(_0x912c('0x3'));var fs=require('fs');var path=require(_0x912c('0x4'));var rimraf=require(_0x912c('0x5'));var config=require(_0x912c('0x6'));var attributes=require(_0x912c('0x7'));module[_0x912c('0x8')]=function(_0x572179,_0x5daa7d){return _0x572179[_0x912c('0x9')](_0x912c('0xa'),attributes,{'tableName':_0x912c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 1a65a4d..c1a7bd5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x53a80f,_0x39dd77){var _0x115919=function(_0x5280ef){while(--_0x5280ef){_0x53a80f['push'](_0x53a80f['shift']());}};_0x115919(++_0x39dd77);}(_0xe706,0xa3));var _0x6e70=function(_0x45655c,_0x407b81){_0x45655c=_0x45655c-0x0;var _0x24a8d9=_0xe706[_0x45655c];return _0x24a8d9;};'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(_0x2140a2,_0x537416){var _0x1dd6e=function(_0x24e44e){while(--_0x24e44e){_0x2140a2['push'](_0x2140a2['shift']());}};_0x1dd6e(++_0x537416);}(_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 diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index d8e44d7..a0627c0 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 _0xb9f0=['exports','sequelize'];(function(_0x400609,_0x36cdd5){var _0x152dce=function(_0x49c7a7){while(--_0x49c7a7){_0x400609['push'](_0x400609['shift']());}};_0x152dce(++_0x36cdd5);}(_0xb9f0,0x1df));var _0x0b9f=function(_0x2ea9b5,_0x5c0e88){_0x2ea9b5=_0x2ea9b5-0x0;var _0x1b8dab=_0xb9f0[_0x2ea9b5];return _0x1b8dab;};'use strict';var Sequelize=require(_0x0b9f('0x0'));module[_0x0b9f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb879=['INTEGER'];(function(_0x4f3dee,_0x46bb90){var _0x291aad=function(_0x3ca8f5){while(--_0x3ca8f5){_0x4f3dee['push'](_0x4f3dee['shift']());}};_0x291aad(++_0x46bb90);}(_0xb879,0x15d));var _0x9b87=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb879[_0x5d2803];return _0xdcad2c;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9b87('0x0')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 51b56df..a7ec31d 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 _0xd382=['request-promise','path','rimraf','../../config/environment','define','team_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd382,0x1b6));var _0x2d38=function(_0x3d4c1f,_0x584936){_0x3d4c1f=_0x3d4c1f-0x0;var _0x4950ab=_0xd382[_0x3d4c1f];return _0x4950ab;};'use strict';var _=require(_0x2d38('0x0'));var util=require(_0x2d38('0x1'));var logger=require(_0x2d38('0x2'))(_0x2d38('0x3'));var moment=require(_0x2d38('0x4'));var BPromise=require(_0x2d38('0x5'));var rp=require(_0x2d38('0x6'));var fs=require('fs');var path=require(_0x2d38('0x7'));var rimraf=require(_0x2d38('0x8'));var config=require(_0x2d38('0x9'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0x5a8219,_0x30106c){return _0x5a8219[_0x2d38('0xa')]('TeamVoiceQueue',attributes,{'tableName':_0x2d38('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a9c=['TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var logger=require(_0xc8a9('0x2'))(_0xc8a9('0x3'));var moment=require(_0xc8a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xc8a9('0x5'));var fs=require('fs');var path=require(_0xc8a9('0x6'));var rimraf=require('rimraf');var config=require(_0xc8a9('0x7'));var attributes=require(_0xc8a9('0x8'));module[_0xc8a9('0x9')]=function(_0x4c1e04,_0xb4340b){return _0x4c1e04[_0xc8a9('0xa')](_0xc8a9('0xb'),attributes,{'tableName':_0xc8a9('0xc'),'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 81a8ccc..0c7e05e 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 _0xcaa4=['debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x19b84f,_0x48765e){var _0x18067b=function(_0x1c69aa){while(--_0x1c69aa){_0x19b84f['push'](_0x19b84f['shift']());}};_0x18067b(++_0x48765e);}(_0xcaa4,0x1b7));var _0x4caa=function(_0x589d67,_0x1bf3b4){_0x589d67=_0x589d67-0x0;var _0xc1d3b3=_0xcaa4[_0x589d67];return _0xc1d3b3;};'use strict';var _=require(_0x4caa('0x0'));var util=require(_0x4caa('0x1'));var moment=require(_0x4caa('0x2'));var BPromise=require(_0x4caa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4caa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4caa('0x5'));var logger=require(_0x4caa('0x6'))(_0x4caa('0x7'));var config=require(_0x4caa('0x8'));var jayson=require(_0x4caa('0x9'));var client=jayson[_0x4caa('0xa')][_0x4caa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xec6c60,_0x4add3b,_0x451e1a){return new BPromise(function(_0x22ff6c,_0x27862e){return client[_0x4caa('0xc')](_0xec6c60,_0x451e1a)[_0x4caa('0xd')](function(_0x291598){logger[_0x4caa('0xe')](_0x4caa('0xf'),_0x4add3b,_0x4caa('0x10'));logger[_0x4caa('0x11')](_0x4caa('0x12'),_0x4add3b,_0x4caa('0x10'),JSON['stringify'](_0x291598));if(_0x291598[_0x4caa('0x13')]){if(_0x291598[_0x4caa('0x13')][_0x4caa('0x14')]===0x1f4){logger[_0x4caa('0x13')](_0x4caa('0xf'),_0x4add3b,_0x291598[_0x4caa('0x13')][_0x4caa('0x15')]);return _0x27862e(_0x291598[_0x4caa('0x13')]['message']);}logger[_0x4caa('0x13')](_0x4caa('0xf'),_0x4add3b,_0x291598[_0x4caa('0x13')]['message']);return _0x22ff6c(_0x291598[_0x4caa('0x13')]['message']);}else{logger[_0x4caa('0xe')](_0x4caa('0xf'),_0x4add3b,_0x4caa('0x10'));_0x22ff6c(_0x291598[_0x4caa('0x16')][_0x4caa('0x15')]);}})[_0x4caa('0x17')](function(_0xcaa67e){logger[_0x4caa('0x13')](_0x4caa('0xf'),_0x4add3b,_0xcaa67e);_0x27862e(_0xcaa67e);});});} \ No newline at end of file +var _0x461d=['request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x461d,0x166));var _0xd461=function(_0x567996,_0x228449){_0x567996=_0x567996-0x0;var _0x40277e=_0x461d[_0x567996];return _0x40277e;};'use strict';var _=require(_0xd461('0x0'));var util=require(_0xd461('0x1'));var moment=require('moment');var BPromise=require(_0xd461('0x2'));var rs=require(_0xd461('0x3'));var fs=require('fs');var Redis=require(_0xd461('0x4'));var db=require(_0xd461('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd461('0x6'))(_0xd461('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd461('0x8')][_0xd461('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x137454,_0x27e7b9,_0xa2ed8a){return new BPromise(function(_0x4b3d75,_0x554884){return client[_0xd461('0xa')](_0x137454,_0xa2ed8a)[_0xd461('0xb')](function(_0x38e788){logger[_0xd461('0xc')](_0xd461('0xd'),_0x27e7b9,'request\x20sent');logger[_0xd461('0xe')](_0xd461('0xf'),_0x27e7b9,_0xd461('0x10'),JSON[_0xd461('0x11')](_0x38e788));if(_0x38e788[_0xd461('0x12')]){if(_0x38e788[_0xd461('0x12')]['code']===0x1f4){logger[_0xd461('0x12')](_0xd461('0xd'),_0x27e7b9,_0x38e788[_0xd461('0x12')][_0xd461('0x13')]);return _0x554884(_0x38e788[_0xd461('0x12')]['message']);}logger[_0xd461('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x27e7b9,_0x38e788['error'][_0xd461('0x13')]);return _0x4b3d75(_0x38e788[_0xd461('0x12')][_0xd461('0x13')]);}else{logger[_0xd461('0xc')](_0xd461('0xd'),_0x27e7b9,'request\x20sent');_0x4b3d75(_0x38e788[_0xd461('0x14')][_0xd461('0x13')]);}})[_0xd461('0x15')](function(_0x1a462b){logger['error'](_0xd461('0xd'),_0x27e7b9,_0x1a462b);_0x554884(_0x1a462b);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 366b76a..7bf0be7 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 _0x958a=['get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x19f00f,_0x181deb){var _0x332a97=function(_0x21d60e){while(--_0x21d60e){_0x19f00f['push'](_0x19f00f['shift']());}};_0x332a97(++_0x181deb);}(_0x958a,0x128));var _0xa958=function(_0x338259,_0x404a84){_0x338259=_0x338259-0x0;var _0x4bf0e6=_0x958a[_0x338259];return _0x4bf0e6;};'use strict';var multer=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var path=require('path');var timeout=require(_0xa958('0x2'));var express=require(_0xa958('0x3'));var router=express[_0xa958('0x4')]();var fs_extra=require(_0xa958('0x5'));var auth=require(_0xa958('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa958('0x7'));var controller=require('./template.controller');router[_0xa958('0x8')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xa')]);router[_0xa958('0x8')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa958('0xd')]);router[_0xa958('0xe')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xf')]);router[_0xa958('0x10')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x11')]);module[_0xa958('0x12')]=router; \ No newline at end of file +var _0x2525=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2525,0x1f0));var _0x5252=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x2525[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x5252('0x0'));var util=require(_0x5252('0x1'));var path=require(_0x5252('0x2'));var timeout=require(_0x5252('0x3'));var express=require(_0x5252('0x4'));var router=express[_0x5252('0x5')]();var fs_extra=require(_0x5252('0x6'));var auth=require(_0x5252('0x7'));var interaction=require(_0x5252('0x8'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0x5252('0x9')]('/',auth[_0x5252('0xa')](),controller[_0x5252('0xb')]);router[_0x5252('0x9')](_0x5252('0xc'),auth[_0x5252('0xa')](),controller['show']);router[_0x5252('0xd')]('/',auth['isAuthenticated'](),controller[_0x5252('0xe')]);router[_0x5252('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x5252('0x10')]);router['delete'](_0x5252('0xc'),auth[_0x5252('0xa')](),controller[_0x5252('0x11')]);module[_0x5252('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0954481..f18f641 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 _0x0bff=['STRING','TEXT','sequelize','exports'];(function(_0x3a3268,_0xa31ac5){var _0xa65f4=function(_0x5289dc){while(--_0x5289dc){_0x3a3268['push'](_0x3a3268['shift']());}};_0xa65f4(++_0xa31ac5);}(_0x0bff,0x92));var _0xf0bf=function(_0x22b0ca,_0x185e91){_0x22b0ca=_0x22b0ca-0x0;var _0x26422b=_0x0bff[_0x22b0ca];return _0x26422b;};'use strict';var Sequelize=require(_0xf0bf('0x0'));module[_0xf0bf('0x1')]={'name':{'type':Sequelize[_0xf0bf('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xf0bf('0x3')]}}; \ No newline at end of file +var _0x3980=['exports','STRING','TEXT','sequelize'];(function(_0x3cf713,_0x3901a9){var _0x174d42=function(_0x3bff25){while(--_0x3bff25){_0x3cf713['push'](_0x3cf713['shift']());}};_0x174d42(++_0x3901a9);}(_0x3980,0xcf));var _0x0398=function(_0x3a365c,_0x3aebda){_0x3a365c=_0x3a365c-0x0;var _0x55e411=_0x3980[_0x3a365c];return _0x55e411;};'use strict';var Sequelize=require(_0x0398('0x0'));module[_0x0398('0x1')]={'name':{'type':Sequelize[_0x0398('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x0398('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index a9e22b8..99dcbb2 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 _0xb202=['request-promise','bluebird','util','path','sox','to-csv','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','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','destroy','Templates','UserProfileResource','then','stack','index','map','Template','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','find','eml-format','zip-dir','fast-json-patch'];(function(_0xc15e30,_0x231639){var _0x5a2d88=function(_0x36893e){while(--_0x36893e){_0xc15e30['push'](_0xc15e30['shift']());}};_0x5a2d88(++_0x231639);}(_0xb202,0xf0));var _0x2b20=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xb202[_0x2555d0];return _0x3bb486;};'use strict';var emlformat=require(_0x2b20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2b20('0x1'));var jsonpatch=require(_0x2b20('0x2'));var rp=require(_0x2b20('0x3'));var moment=require('moment');var BPromise=require(_0x2b20('0x4'));var Mustache=require('mustache');var util=require(_0x2b20('0x5'));var path=require(_0x2b20('0x6'));var sox=require(_0x2b20('0x7'));var csv=require(_0x2b20('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b20('0x9'));var _=require(_0x2b20('0xa'));var squel=require(_0x2b20('0xb'));var crypto=require('crypto');var jsforce=require(_0x2b20('0xc'));var deskjs=require(_0x2b20('0xd'));var toCsv=require(_0x2b20('0x8'));var querystring=require(_0x2b20('0xe'));var Papa=require(_0x2b20('0xf'));var Redis=require(_0x2b20('0x10'));var authService=require(_0x2b20('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b20('0x12'));var hardwareService=require(_0x2b20('0x13'));var logger=require(_0x2b20('0x14'))(_0x2b20('0x15'));var utils=require('../../config/utils');var config=require(_0x2b20('0x16'));var licenseUtil=require(_0x2b20('0x17'));var db=require(_0x2b20('0x18'))['db'];function respondWithStatusCode(_0x2350d7,_0x4fa491){_0x4fa491=_0x4fa491||0xcc;return function(_0x2fe089){if(_0x2fe089){return _0x2350d7[_0x2b20('0x19')](_0x4fa491);}return _0x2350d7['status'](_0x4fa491)[_0x2b20('0x1a')]();};}function respondWithResult(_0xa293d6,_0x4fa2a7){_0x4fa2a7=_0x4fa2a7||0xc8;return function(_0x64f81a){if(_0x64f81a){return _0xa293d6[_0x2b20('0x1b')](_0x4fa2a7)['json'](_0x64f81a);}};}function respondWithFilteredResult(_0x80ca1a,_0x129523){return function(_0x546b93){if(_0x546b93){var _0xd07a1a=typeof _0x129523['offset']===_0x2b20('0x1c')&&typeof _0x129523[_0x2b20('0x1d')]===_0x2b20('0x1c');var _0x253577=_0x546b93[_0x2b20('0x1e')];var _0x4b1cb4=_0xd07a1a?0x0:_0x129523['offset'];var _0x52312e=_0xd07a1a?_0x546b93[_0x2b20('0x1e')]:_0x129523[_0x2b20('0x1f')]+_0x129523[_0x2b20('0x1d')];var _0x4f4892;if(_0x52312e>=_0x253577){_0x52312e=_0x253577;_0x4f4892=0xc8;}else{_0x4f4892=0xce;}_0x80ca1a['status'](_0x4f4892);return _0x80ca1a['set'](_0x2b20('0x20'),_0x4b1cb4+'-'+_0x52312e+'/'+_0x253577)[_0x2b20('0x21')](_0x546b93);}return null;};}function patchUpdates(_0x905d5c){return function(_0x12bcf9){try{jsonpatch[_0x2b20('0x22')](_0x12bcf9,_0x905d5c,!![]);}catch(_0x56d2bf){return BPromise[_0x2b20('0x23')](_0x56d2bf);}return _0x12bcf9[_0x2b20('0x24')]();};}function saveUpdates(_0x5a5d7d,_0x11ba44){return function(_0x59d618){if(_0x59d618){return _0x59d618['update'](_0x5a5d7d)['then'](function(_0x4dba27){return _0x4dba27;});}return null;};}function removeEntity(_0x477640,_0x271c43){return function(_0x1748b2){if(_0x1748b2){return _0x1748b2[_0x2b20('0x25')]()['then'](function(){var _0x1bb7a7=_0x1748b2['get']({'plain':!![]});var _0xe213c1=_0x2b20('0x26');return db[_0x2b20('0x27')][_0x2b20('0x25')]({'where':{'type':_0xe213c1,'resourceId':_0x1bb7a7['id']}})[_0x2b20('0x28')](function(){return _0x1748b2;});})[_0x2b20('0x28')](function(){_0x477640[_0x2b20('0x1b')](0xcc)[_0x2b20('0x1a')]();});}};}function handleEntityNotFound(_0x18298f,_0x4a1469){return function(_0x116c98){if(!_0x116c98){_0x18298f[_0x2b20('0x19')](0x194);}return _0x116c98;};}function handleError(_0x3d6595,_0x398239){_0x398239=_0x398239||0x1f4;return function(_0x4739b1){logger['error'](_0x4739b1[_0x2b20('0x29')]);if(_0x4739b1['name']){delete _0x4739b1['name'];}_0x3d6595[_0x2b20('0x1b')](_0x398239)['send'](_0x4739b1);};}exports[_0x2b20('0x2a')]=function(_0x500c3c,_0x399b90){var _0x175084={},_0x512273={},_0x3fd68a={'count':0x0,'rows':[]};var _0x3d6df1=_[_0x2b20('0x2b')](db[_0x2b20('0x2c')][_0x2b20('0x2d')],function(_0xeb61eb){return{'name':_0xeb61eb[_0x2b20('0x2e')],'type':_0xeb61eb[_0x2b20('0x2f')][_0x2b20('0x30')]};});_0x512273[_0x2b20('0x31')]=_[_0x2b20('0x2b')](_0x3d6df1,_0x2b20('0x32'));_0x512273[_0x2b20('0x33')]=_[_0x2b20('0x34')](_0x500c3c[_0x2b20('0x33')]);_0x512273['filters']=_[_0x2b20('0x35')](_0x512273['model'],_0x512273[_0x2b20('0x33')]);_0x175084['attributes']=_[_0x2b20('0x35')](_0x512273[_0x2b20('0x31')],qs[_0x2b20('0x36')](_0x500c3c['query']['fields']));_0x175084[_0x2b20('0x37')]=_0x175084[_0x2b20('0x37')][_0x2b20('0x38')]?_0x175084[_0x2b20('0x37')]:_0x512273[_0x2b20('0x31')];if(!_0x500c3c[_0x2b20('0x33')][_0x2b20('0x39')](_0x2b20('0x3a'))){_0x175084[_0x2b20('0x1d')]=qs[_0x2b20('0x1d')](_0x500c3c[_0x2b20('0x33')][_0x2b20('0x1d')]);_0x175084[_0x2b20('0x1f')]=qs['offset'](_0x500c3c[_0x2b20('0x33')][_0x2b20('0x1f')]);}_0x175084[_0x2b20('0x3b')]=qs[_0x2b20('0x3c')](_0x500c3c['query'][_0x2b20('0x3c')]);_0x175084[_0x2b20('0x3d')]=qs[_0x2b20('0x3e')](_[_0x2b20('0x3f')](_0x500c3c[_0x2b20('0x33')],_0x512273[_0x2b20('0x3e')]),_0x3d6df1);if(_0x500c3c['query'][_0x2b20('0x40')]){_0x175084[_0x2b20('0x3d')]=_[_0x2b20('0x41')](_0x175084[_0x2b20('0x3d')],{'$or':_['map'](_0x3d6df1,function(_0x1aa0b0){if(_0x1aa0b0[_0x2b20('0x2f')]!=='VIRTUAL'){var _0x4e6d49={};_0x4e6d49[_0x1aa0b0['name']]={'$like':'%'+_0x500c3c[_0x2b20('0x33')][_0x2b20('0x40')]+'%'};return _0x4e6d49;}})});}_0x175084=_[_0x2b20('0x41')]({},_0x175084,_0x500c3c['options']);var _0x641704={'where':_0x175084[_0x2b20('0x3d')]};return db[_0x2b20('0x2c')][_0x2b20('0x1e')](_0x641704)[_0x2b20('0x28')](function(_0x8ecc4f){_0x3fd68a[_0x2b20('0x1e')]=_0x8ecc4f;if(_0x500c3c[_0x2b20('0x33')][_0x2b20('0x42')]){_0x175084[_0x2b20('0x43')]=[{'all':!![]}];}return db[_0x2b20('0x2c')]['findAll'](_0x175084);})[_0x2b20('0x28')](function(_0x2ad9bc){_0x3fd68a['rows']=_0x2ad9bc;return _0x3fd68a;})[_0x2b20('0x28')](respondWithFilteredResult(_0x399b90,_0x175084))[_0x2b20('0x44')](handleError(_0x399b90,null));};exports[_0x2b20('0x45')]=function(_0x4073ad,_0x28c7f3){var _0x488ed0={'raw':!![],'where':{'id':_0x4073ad[_0x2b20('0x46')]['id']}},_0xa1734a={};_0xa1734a[_0x2b20('0x31')]=_[_0x2b20('0x34')](db[_0x2b20('0x2c')][_0x2b20('0x2d')]);_0xa1734a[_0x2b20('0x33')]=_[_0x2b20('0x34')](_0x4073ad[_0x2b20('0x33')]);_0xa1734a['filters']=_[_0x2b20('0x35')](_0xa1734a[_0x2b20('0x31')],_0xa1734a[_0x2b20('0x33')]);_0x488ed0['attributes']=_[_0x2b20('0x35')](_0xa1734a[_0x2b20('0x31')],qs[_0x2b20('0x36')](_0x4073ad[_0x2b20('0x33')][_0x2b20('0x36')]));_0x488ed0[_0x2b20('0x37')]=_0x488ed0[_0x2b20('0x37')][_0x2b20('0x38')]?_0x488ed0[_0x2b20('0x37')]:_0xa1734a[_0x2b20('0x31')];if(_0x4073ad['query']['includeAll']){_0x488ed0['include']=[{'all':!![]}];}_0x488ed0=_[_0x2b20('0x41')]({},_0x488ed0,_0x4073ad['options']);return db[_0x2b20('0x2c')]['find'](_0x488ed0)[_0x2b20('0x28')](handleEntityNotFound(_0x28c7f3,null))['then'](respondWithResult(_0x28c7f3,null))[_0x2b20('0x44')](handleError(_0x28c7f3,null));};exports[_0x2b20('0x47')]=function(_0x343c69,_0x259e64){return db[_0x2b20('0x2c')][_0x2b20('0x47')](_0x343c69[_0x2b20('0x48')],{})['then'](function(_0x1d4387){var _0x2b4e70=_0x343c69[_0x2b20('0x49')][_0x2b20('0x4a')]({'plain':!![]});if(!_0x2b4e70)throw new Error(_0x2b20('0x4b'));if(_0x2b4e70[_0x2b20('0x4c')]===_0x2b20('0x49')){var _0x161b40=_0x1d4387[_0x2b20('0x4a')]({'plain':!![]});var _0x1c8af8=_0x2b20('0x26');return db[_0x2b20('0x4d')]['find']({'where':{'name':_0x1c8af8,'userProfileId':_0x2b4e70[_0x2b20('0x4e')]},'raw':!![]})['then'](function(_0x4c4bf7){if(_0x4c4bf7&&_0x4c4bf7['autoAssociation']===0x0){return db[_0x2b20('0x27')][_0x2b20('0x47')]({'name':_0x161b40[_0x2b20('0x32')],'resourceId':_0x161b40['id'],'type':_0x4c4bf7[_0x2b20('0x32')],'sectionId':_0x4c4bf7['id']},{})[_0x2b20('0x28')](function(){return _0x1d4387;});}else{return _0x1d4387;}})[_0x2b20('0x44')](function(_0x1cb371){logger[_0x2b20('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1cb371);throw _0x1cb371;});}return _0x1d4387;})[_0x2b20('0x28')](respondWithResult(_0x259e64,0xc9))['catch'](handleError(_0x259e64,null));};exports['update']=function(_0x16c1a3,_0x3e0ca0){if(_0x16c1a3[_0x2b20('0x48')]['id']){delete _0x16c1a3[_0x2b20('0x48')]['id'];}return db[_0x2b20('0x2c')][_0x2b20('0x50')]({'where':{'id':_0x16c1a3['params']['id']}})[_0x2b20('0x28')](handleEntityNotFound(_0x3e0ca0,null))[_0x2b20('0x28')](saveUpdates(_0x16c1a3[_0x2b20('0x48')],null))[_0x2b20('0x28')](respondWithResult(_0x3e0ca0,null))[_0x2b20('0x44')](handleError(_0x3e0ca0,null));};exports[_0x2b20('0x25')]=function(_0x4ea2f8,_0x3227f6){return db[_0x2b20('0x2c')][_0x2b20('0x50')]({'where':{'id':_0x4ea2f8[_0x2b20('0x46')]['id']}})[_0x2b20('0x28')](handleEntityNotFound(_0x3227f6,null))[_0x2b20('0x28')](removeEntity(_0x3227f6,null))[_0x2b20('0x44')](handleError(_0x3227f6,null));}; \ No newline at end of file +var _0x3e10=['create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','Templates','UserProfileResource','destroy','end','stack','name','index','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','options','includeAll','include','Template','findAll','catch','params','find'];(function(_0x195919,_0x177c79){var _0x2aa39d=function(_0x31841c){while(--_0x31841c){_0x195919['push'](_0x195919['shift']());}};_0x2aa39d(++_0x177c79);}(_0x3e10,0x1a4));var _0x03e1=function(_0x2e59db,_0x53f747){_0x2e59db=_0x2e59db-0x0;var _0x5be504=_0x3e10[_0x2e59db];return _0x5be504;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03e1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x03e1('0x1'));var moment=require(_0x03e1('0x2'));var BPromise=require(_0x03e1('0x3'));var Mustache=require(_0x03e1('0x4'));var util=require(_0x03e1('0x5'));var path=require(_0x03e1('0x6'));var sox=require(_0x03e1('0x7'));var csv=require(_0x03e1('0x8'));var ejs=require(_0x03e1('0x9'));var fs=require('fs');var fs_extra=require(_0x03e1('0xa'));var _=require(_0x03e1('0xb'));var squel=require(_0x03e1('0xc'));var crypto=require(_0x03e1('0xd'));var jsforce=require(_0x03e1('0xe'));var deskjs=require(_0x03e1('0xf'));var toCsv=require(_0x03e1('0x8'));var querystring=require('querystring');var Papa=require(_0x03e1('0x10'));var Redis=require(_0x03e1('0x11'));var authService=require(_0x03e1('0x12'));var qs=require(_0x03e1('0x13'));var as=require(_0x03e1('0x14'));var hardwareService=require(_0x03e1('0x15'));var logger=require(_0x03e1('0x16'))('api');var utils=require(_0x03e1('0x17'));var config=require(_0x03e1('0x18'));var licenseUtil=require(_0x03e1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5654cd,_0x5024d2){_0x5024d2=_0x5024d2||0xcc;return function(_0x5be266){if(_0x5be266){return _0x5654cd[_0x03e1('0x1a')](_0x5024d2);}return _0x5654cd[_0x03e1('0x1b')](_0x5024d2)['end']();};}function respondWithResult(_0x34c75b,_0x8b5cc8){_0x8b5cc8=_0x8b5cc8||0xc8;return function(_0x1d620b){if(_0x1d620b){return _0x34c75b[_0x03e1('0x1b')](_0x8b5cc8)[_0x03e1('0x1c')](_0x1d620b);}};}function respondWithFilteredResult(_0x4c24f3,_0xa8de5a){return function(_0x443465){if(_0x443465){var _0x4aa460=typeof _0xa8de5a['offset']==='undefined'&&typeof _0xa8de5a[_0x03e1('0x1d')]===_0x03e1('0x1e');var _0x2af08b=_0x443465[_0x03e1('0x1f')];var _0x21332f=_0x4aa460?0x0:_0xa8de5a[_0x03e1('0x20')];var _0x50cd75=_0x4aa460?_0x443465['count']:_0xa8de5a[_0x03e1('0x20')]+_0xa8de5a[_0x03e1('0x1d')];var _0x42b980;if(_0x50cd75>=_0x2af08b){_0x50cd75=_0x2af08b;_0x42b980=0xc8;}else{_0x42b980=0xce;}_0x4c24f3[_0x03e1('0x1b')](_0x42b980);return _0x4c24f3[_0x03e1('0x21')]('Content-Range',_0x21332f+'-'+_0x50cd75+'/'+_0x2af08b)[_0x03e1('0x1c')](_0x443465);}return null;};}function patchUpdates(_0x1f7d8a){return function(_0x17f4e8){try{jsonpatch[_0x03e1('0x22')](_0x17f4e8,_0x1f7d8a,!![]);}catch(_0x3520a6){return BPromise[_0x03e1('0x23')](_0x3520a6);}return _0x17f4e8[_0x03e1('0x24')]();};}function saveUpdates(_0xac3fed,_0x57e18b){return function(_0x2f850a){if(_0x2f850a){return _0x2f850a[_0x03e1('0x25')](_0xac3fed)[_0x03e1('0x26')](function(_0xd3468c){return _0xd3468c;});}return null;};}function removeEntity(_0x18d191,_0x45ed25){return function(_0x4493be){if(_0x4493be){return _0x4493be['destroy']()[_0x03e1('0x26')](function(){var _0x6ee648=_0x4493be['get']({'plain':!![]});var _0x23df38=_0x03e1('0x27');return db[_0x03e1('0x28')][_0x03e1('0x29')]({'where':{'type':_0x23df38,'resourceId':_0x6ee648['id']}})[_0x03e1('0x26')](function(){return _0x4493be;});})[_0x03e1('0x26')](function(){_0x18d191[_0x03e1('0x1b')](0xcc)[_0x03e1('0x2a')]();});}};}function handleEntityNotFound(_0x56ded6,_0x444af9){return function(_0x2e1b7d){if(!_0x2e1b7d){_0x56ded6[_0x03e1('0x1a')](0x194);}return _0x2e1b7d;};}function handleError(_0x377729,_0xa76f9e){_0xa76f9e=_0xa76f9e||0x1f4;return function(_0x570203){logger['error'](_0x570203[_0x03e1('0x2b')]);if(_0x570203[_0x03e1('0x2c')]){delete _0x570203['name'];}_0x377729[_0x03e1('0x1b')](_0xa76f9e)['send'](_0x570203);};}exports[_0x03e1('0x2d')]=function(_0x375d94,_0x27229e){var _0x555e24={},_0x6f3035={},_0xa732c0={'count':0x0,'rows':[]};var _0x4e50af=_['map'](db['Template'][_0x03e1('0x2e')],function(_0x5b4618){return{'name':_0x5b4618[_0x03e1('0x2f')],'type':_0x5b4618['type'][_0x03e1('0x30')]};});_0x6f3035['model']=_[_0x03e1('0x31')](_0x4e50af,_0x03e1('0x2c'));_0x6f3035[_0x03e1('0x32')]=_[_0x03e1('0x33')](_0x375d94[_0x03e1('0x32')]);_0x6f3035[_0x03e1('0x34')]=_['intersection'](_0x6f3035[_0x03e1('0x35')],_0x6f3035[_0x03e1('0x32')]);_0x555e24[_0x03e1('0x36')]=_[_0x03e1('0x37')](_0x6f3035[_0x03e1('0x35')],qs[_0x03e1('0x38')](_0x375d94[_0x03e1('0x32')][_0x03e1('0x38')]));_0x555e24['attributes']=_0x555e24[_0x03e1('0x36')][_0x03e1('0x39')]?_0x555e24['attributes']:_0x6f3035['model'];if(!_0x375d94[_0x03e1('0x32')]['hasOwnProperty'](_0x03e1('0x3a'))){_0x555e24['limit']=qs[_0x03e1('0x1d')](_0x375d94[_0x03e1('0x32')][_0x03e1('0x1d')]);_0x555e24['offset']=qs['offset'](_0x375d94[_0x03e1('0x32')][_0x03e1('0x20')]);}_0x555e24[_0x03e1('0x3b')]=qs['sort'](_0x375d94[_0x03e1('0x32')][_0x03e1('0x3c')]);_0x555e24[_0x03e1('0x3d')]=qs[_0x03e1('0x34')](_[_0x03e1('0x3e')](_0x375d94[_0x03e1('0x32')],_0x6f3035[_0x03e1('0x34')]),_0x4e50af);if(_0x375d94[_0x03e1('0x32')]['filter']){_0x555e24[_0x03e1('0x3d')]=_[_0x03e1('0x3f')](_0x555e24['where'],{'$or':_['map'](_0x4e50af,function(_0x3e2886){if(_0x3e2886['type']!=='VIRTUAL'){var _0x23454f={};_0x23454f[_0x3e2886['name']]={'$like':'%'+_0x375d94[_0x03e1('0x32')]['filter']+'%'};return _0x23454f;}})});}_0x555e24=_[_0x03e1('0x3f')]({},_0x555e24,_0x375d94[_0x03e1('0x40')]);var _0x1ede34={'where':_0x555e24[_0x03e1('0x3d')]};return db['Template'][_0x03e1('0x1f')](_0x1ede34)[_0x03e1('0x26')](function(_0x41ba4c){_0xa732c0[_0x03e1('0x1f')]=_0x41ba4c;if(_0x375d94[_0x03e1('0x32')][_0x03e1('0x41')]){_0x555e24[_0x03e1('0x42')]=[{'all':!![]}];}return db[_0x03e1('0x43')][_0x03e1('0x44')](_0x555e24);})[_0x03e1('0x26')](function(_0x14578f){_0xa732c0['rows']=_0x14578f;return _0xa732c0;})[_0x03e1('0x26')](respondWithFilteredResult(_0x27229e,_0x555e24))[_0x03e1('0x45')](handleError(_0x27229e,null));};exports['show']=function(_0x439333,_0x413dd5){var _0xabacd={'raw':!![],'where':{'id':_0x439333[_0x03e1('0x46')]['id']}},_0x2139b7={};_0x2139b7[_0x03e1('0x35')]=_[_0x03e1('0x33')](db[_0x03e1('0x43')][_0x03e1('0x2e')]);_0x2139b7[_0x03e1('0x32')]=_[_0x03e1('0x33')](_0x439333[_0x03e1('0x32')]);_0x2139b7[_0x03e1('0x34')]=_[_0x03e1('0x37')](_0x2139b7[_0x03e1('0x35')],_0x2139b7[_0x03e1('0x32')]);_0xabacd[_0x03e1('0x36')]=_[_0x03e1('0x37')](_0x2139b7[_0x03e1('0x35')],qs['fields'](_0x439333[_0x03e1('0x32')][_0x03e1('0x38')]));_0xabacd['attributes']=_0xabacd[_0x03e1('0x36')][_0x03e1('0x39')]?_0xabacd[_0x03e1('0x36')]:_0x2139b7['model'];if(_0x439333[_0x03e1('0x32')][_0x03e1('0x41')]){_0xabacd[_0x03e1('0x42')]=[{'all':!![]}];}_0xabacd=_[_0x03e1('0x3f')]({},_0xabacd,_0x439333['options']);return db['Template'][_0x03e1('0x47')](_0xabacd)['then'](handleEntityNotFound(_0x413dd5,null))[_0x03e1('0x26')](respondWithResult(_0x413dd5,null))[_0x03e1('0x45')](handleError(_0x413dd5,null));};exports[_0x03e1('0x48')]=function(_0x41cac3,_0x1d11ff){return db['Template'][_0x03e1('0x48')](_0x41cac3['body'],{})[_0x03e1('0x26')](function(_0xe2a623){var _0x58bdb2=_0x41cac3[_0x03e1('0x49')][_0x03e1('0x4a')]({'plain':!![]});if(!_0x58bdb2)throw new Error(_0x03e1('0x4b'));if(_0x58bdb2[_0x03e1('0x4c')]===_0x03e1('0x49')){var _0x3a684f=_0xe2a623['get']({'plain':!![]});var _0x15f213='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x15f213,'userProfileId':_0x58bdb2[_0x03e1('0x4d')]},'raw':!![]})[_0x03e1('0x26')](function(_0x289945){if(_0x289945&&_0x289945[_0x03e1('0x4e')]===0x0){return db[_0x03e1('0x28')][_0x03e1('0x48')]({'name':_0x3a684f['name'],'resourceId':_0x3a684f['id'],'type':_0x289945['name'],'sectionId':_0x289945['id']},{})[_0x03e1('0x26')](function(){return _0xe2a623;});}else{return _0xe2a623;}})[_0x03e1('0x45')](function(_0x46d191){logger[_0x03e1('0x4f')](_0x03e1('0x50'),_0x46d191);throw _0x46d191;});}return _0xe2a623;})['then'](respondWithResult(_0x1d11ff,0xc9))['catch'](handleError(_0x1d11ff,null));};exports['update']=function(_0x91ac40,_0xeaa130){if(_0x91ac40[_0x03e1('0x51')]['id']){delete _0x91ac40[_0x03e1('0x51')]['id'];}return db[_0x03e1('0x43')][_0x03e1('0x47')]({'where':{'id':_0x91ac40['params']['id']}})[_0x03e1('0x26')](handleEntityNotFound(_0xeaa130,null))[_0x03e1('0x26')](saveUpdates(_0x91ac40[_0x03e1('0x51')],null))[_0x03e1('0x26')](respondWithResult(_0xeaa130,null))[_0x03e1('0x45')](handleError(_0xeaa130,null));};exports[_0x03e1('0x29')]=function(_0xcc26ae,_0x1755ac){return db[_0x03e1('0x43')][_0x03e1('0x47')]({'where':{'id':_0xcc26ae[_0x03e1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1755ac,null))['then'](removeEntity(_0x1755ac,null))['catch'](handleError(_0x1755ac,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 199871b..4dbe076 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 _0x7d23=['../../config/environment','./template.attributes','exports','Template','tools_templates','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x273642,_0x39481a){var _0x4f9e50=function(_0xb2eb67){while(--_0xb2eb67){_0x273642['push'](_0x273642['shift']());}};_0x4f9e50(++_0x39481a);}(_0x7d23,0x1a5));var _0x37d2=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x7d23[_0x2aea9e];return _0x430b92;};'use strict';var _=require('lodash');var util=require(_0x37d2('0x0'));var logger=require(_0x37d2('0x1'))(_0x37d2('0x2'));var moment=require(_0x37d2('0x3'));var BPromise=require(_0x37d2('0x4'));var rp=require(_0x37d2('0x5'));var fs=require('fs');var path=require(_0x37d2('0x6'));var rimraf=require(_0x37d2('0x7'));var config=require(_0x37d2('0x8'));var attributes=require(_0x37d2('0x9'));module[_0x37d2('0xa')]=function(_0x11ec52,_0x1e22ff){return _0x11ec52['define'](_0x37d2('0xb'),attributes,{'tableName':_0x37d2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x726d=['tools_templates','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./template.attributes','exports','define','Template'];(function(_0x56cc20,_0x32ee14){var _0x3d5648=function(_0x3a1246){while(--_0x3a1246){_0x56cc20['push'](_0x56cc20['shift']());}};_0x3d5648(++_0x32ee14);}(_0x726d,0xd9));var _0xd726=function(_0x19184c,_0x2925ba){_0x19184c=_0x19184c-0x0;var _0x2c7bb6=_0x726d[_0x19184c];return _0x2c7bb6;};'use strict';var _=require('lodash');var util=require(_0xd726('0x0'));var logger=require(_0xd726('0x1'))(_0xd726('0x2'));var moment=require(_0xd726('0x3'));var BPromise=require(_0xd726('0x4'));var rp=require(_0xd726('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd726('0x6'));var config=require('../../config/environment');var attributes=require(_0xd726('0x7'));module[_0xd726('0x8')]=function(_0x3e9fc9,_0x5aebdd){return _0x3e9fc9[_0xd726('0x9')](_0xd726('0xa'),attributes,{'tableName':_0xd726('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index a61f44d..45f11c9 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 _0xcd2c=['Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','stringify','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5ef70d,_0x1b14c0){var _0x307667=function(_0x49509b){while(--_0x49509b){_0x5ef70d['push'](_0x5ef70d['shift']());}};_0x307667(++_0x1b14c0);}(_0xcd2c,0x195));var _0xccd2=function(_0x623e5e,_0x2d0a5b){_0x623e5e=_0x623e5e-0x0;var _0x24e3c1=_0xcd2c[_0x623e5e];return _0x24e3c1;};'use strict';var _=require(_0xccd2('0x0'));var util=require(_0xccd2('0x1'));var moment=require(_0xccd2('0x2'));var BPromise=require(_0xccd2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccd2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xccd2('0x5'));var logger=require(_0xccd2('0x6'))(_0xccd2('0x7'));var config=require(_0xccd2('0x8'));var jayson=require(_0xccd2('0x9'));var client=jayson[_0xccd2('0xa')][_0xccd2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a1fec,_0x44c4e7,_0x2fbd19){return new BPromise(function(_0x4b2ac2,_0x2b5982){return client[_0xccd2('0xc')](_0x1a1fec,_0x2fbd19)[_0xccd2('0xd')](function(_0xc375ce){logger[_0xccd2('0xe')](_0xccd2('0xf'),_0x44c4e7,_0xccd2('0x10'));logger[_0xccd2('0x11')](_0xccd2('0x12'),_0x44c4e7,_0xccd2('0x10'),JSON['stringify'](_0xc375ce));if(_0xc375ce[_0xccd2('0x13')]){if(_0xc375ce[_0xccd2('0x13')]['code']===0x1f4){logger[_0xccd2('0x13')](_0xccd2('0xf'),_0x44c4e7,_0xc375ce[_0xccd2('0x13')]['message']);return _0x2b5982(_0xc375ce['error']['message']);}logger[_0xccd2('0x13')]('Template,\x20%s,\x20%s',_0x44c4e7,_0xc375ce[_0xccd2('0x13')][_0xccd2('0x14')]);return _0x4b2ac2(_0xc375ce[_0xccd2('0x13')][_0xccd2('0x14')]);}else{logger['info'](_0xccd2('0xf'),_0x44c4e7,_0xccd2('0x10'));_0x4b2ac2(_0xc375ce[_0xccd2('0x15')][_0xccd2('0x14')]);}})['catch'](function(_0x59be3c){logger[_0xccd2('0x13')](_0xccd2('0xf'),_0x44c4e7,_0x59be3c);_0x2b5982(_0x59be3c);});});}exports[_0xccd2('0x16')]=function(_0x402c3c){var _0x1a775a=this;return new Promise(function(_0x42fc72,_0x340075){return db[_0xccd2('0x17')][_0xccd2('0x18')]({'raw':_0x402c3c[_0xccd2('0x19')]?_0x402c3c['options'][_0xccd2('0x1a')]===undefined?!![]:![]:!![],'where':_0x402c3c[_0xccd2('0x19')]?_0x402c3c[_0xccd2('0x19')][_0xccd2('0x1b')]||null:null,'attributes':_0x402c3c[_0xccd2('0x19')]?_0x402c3c['options'][_0xccd2('0x1c')]||null:null,'limit':_0x402c3c[_0xccd2('0x19')]?_0x402c3c[_0xccd2('0x19')][_0xccd2('0x1d')]||null:null,'include':_0x402c3c[_0xccd2('0x19')]?_0x402c3c[_0xccd2('0x19')][_0xccd2('0x1e')]?_['map'](_0x402c3c['options']['include'],function(_0x25ad2a){return{'model':db[_0x25ad2a[_0xccd2('0x1f')]],'as':_0x25ad2a['as'],'attributes':_0x25ad2a[_0xccd2('0x1c')],'include':_0x25ad2a['include']?_[_0xccd2('0x20')](_0x25ad2a[_0xccd2('0x1e')],function(_0x216e77){return{'model':db[_0x216e77['model']],'as':_0x216e77['as'],'attributes':_0x216e77[_0xccd2('0x1c')],'include':_0x216e77[_0xccd2('0x1e')]?_[_0xccd2('0x20')](_0x216e77[_0xccd2('0x1e')],function(_0x1a1559){return{'model':db[_0x1a1559[_0xccd2('0x1f')]],'as':_0x1a1559['as'],'attributes':_0x1a1559[_0xccd2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xccd2('0xd')](function(_0x4f9b2d){logger[_0xccd2('0xe')]('GetTemplate',_0x402c3c);logger[_0xccd2('0x11')](_0xccd2('0x16'),_0x402c3c,JSON[_0xccd2('0x21')](_0x4f9b2d));_0x42fc72(_0x4f9b2d);})[_0xccd2('0x22')](function(_0x5eb924){logger[_0xccd2('0x13')](_0xccd2('0x16'),_0x5eb924['message'],_0x402c3c);_0x340075(_0x1a775a[_0xccd2('0x13')](0x1f4,_0x5eb924[_0xccd2('0x14')]));});});}; \ No newline at end of file +var _0x678e=['findAll','options','where','attributes','limit','include','model','map','GetTemplate','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Template'];(function(_0x1fbd36,_0x3d2a74){var _0x4b16d9=function(_0x5e4a28){while(--_0x5e4a28){_0x1fbd36['push'](_0x1fbd36['shift']());}};_0x4b16d9(++_0x3d2a74);}(_0x678e,0x153));var _0xe678=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x678e[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xe678('0x0'));var util=require(_0xe678('0x1'));var moment=require(_0xe678('0x2'));var BPromise=require(_0xe678('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe678('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe678('0x5'));var config=require(_0xe678('0x6'));var jayson=require(_0xe678('0x7'));var client=jayson[_0xe678('0x8')][_0xe678('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d3b7f,_0x3da449,_0x542426){return new BPromise(function(_0x1227d0,_0x197f0f){return client['request'](_0x4d3b7f,_0x542426)['then'](function(_0x3442a3){logger[_0xe678('0xa')](_0xe678('0xb'),_0x3da449,_0xe678('0xc'));logger[_0xe678('0xd')](_0xe678('0xe'),_0x3da449,_0xe678('0xc'),JSON[_0xe678('0xf')](_0x3442a3));if(_0x3442a3[_0xe678('0x10')]){if(_0x3442a3[_0xe678('0x10')][_0xe678('0x11')]===0x1f4){logger[_0xe678('0x10')](_0xe678('0xb'),_0x3da449,_0x3442a3[_0xe678('0x10')][_0xe678('0x12')]);return _0x197f0f(_0x3442a3['error'][_0xe678('0x12')]);}logger['error'](_0xe678('0xb'),_0x3da449,_0x3442a3['error'][_0xe678('0x12')]);return _0x1227d0(_0x3442a3['error'][_0xe678('0x12')]);}else{logger[_0xe678('0xa')](_0xe678('0xb'),_0x3da449,_0xe678('0xc'));_0x1227d0(_0x3442a3['result'][_0xe678('0x12')]);}})[_0xe678('0x13')](function(_0x148897){logger['error']('Template,\x20%s,\x20%s',_0x3da449,_0x148897);_0x197f0f(_0x148897);});});}exports['GetTemplate']=function(_0x57a7e8){var _0x4e02c0=this;return new Promise(function(_0x44152a,_0x3ba2d4){return db[_0xe678('0x14')][_0xe678('0x15')]({'raw':_0x57a7e8[_0xe678('0x16')]?_0x57a7e8[_0xe678('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x57a7e8['options']?_0x57a7e8[_0xe678('0x16')][_0xe678('0x17')]||null:null,'attributes':_0x57a7e8[_0xe678('0x16')]?_0x57a7e8[_0xe678('0x16')][_0xe678('0x18')]||null:null,'limit':_0x57a7e8['options']?_0x57a7e8[_0xe678('0x16')][_0xe678('0x19')]||null:null,'include':_0x57a7e8[_0xe678('0x16')]?_0x57a7e8[_0xe678('0x16')][_0xe678('0x1a')]?_['map'](_0x57a7e8[_0xe678('0x16')][_0xe678('0x1a')],function(_0x2bea77){return{'model':db[_0x2bea77[_0xe678('0x1b')]],'as':_0x2bea77['as'],'attributes':_0x2bea77[_0xe678('0x18')],'include':_0x2bea77['include']?_[_0xe678('0x1c')](_0x2bea77[_0xe678('0x1a')],function(_0x42c925){return{'model':db[_0x42c925['model']],'as':_0x42c925['as'],'attributes':_0x42c925[_0xe678('0x18')],'include':_0x42c925[_0xe678('0x1a')]?_[_0xe678('0x1c')](_0x42c925['include'],function(_0x493af5){return{'model':db[_0x493af5[_0xe678('0x1b')]],'as':_0x493af5['as'],'attributes':_0x493af5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x585d6b){logger['info'](_0xe678('0x1d'),_0x57a7e8);logger[_0xe678('0xd')](_0xe678('0x1d'),_0x57a7e8,JSON['stringify'](_0x585d6b));_0x44152a(_0x585d6b);})[_0xe678('0x13')](function(_0x3f2290){logger[_0xe678('0x10')](_0xe678('0x1d'),_0x3f2290[_0xe678('0x12')],_0x57a7e8);_0x3ba2d4(_0x4e02c0[_0xe678('0x10')](0x1f4,_0x3f2290[_0xe678('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index d7d9e9b..74e579e 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 _0xa2bf=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','/:id/all_conditions','post','addAnyCondition','update','delete','destroy','exports'];(function(_0x2b8cdb,_0xd65707){var _0x328f61=function(_0x497269){while(--_0x497269){_0x2b8cdb['push'](_0x2b8cdb['shift']());}};_0x328f61(++_0xd65707);}(_0xa2bf,0xa8));var _0xfa2b=function(_0x36591a,_0x4c44f9){_0x36591a=_0x36591a-0x0;var _0x193b1d=_0xa2bf[_0x36591a];return _0x193b1d;};'use strict';var multer=require(_0xfa2b('0x0'));var util=require(_0xfa2b('0x1'));var path=require(_0xfa2b('0x2'));var timeout=require(_0xfa2b('0x3'));var express=require('express');var router=express[_0xfa2b('0x4')]();var fs_extra=require(_0xfa2b('0x5'));var auth=require(_0xfa2b('0x6'));var interaction=require(_0xfa2b('0x7'));var config=require(_0xfa2b('0x8'));var controller=require(_0xfa2b('0x9'));router[_0xfa2b('0xa')]('/',auth[_0xfa2b('0xb')](),controller[_0xfa2b('0xc')]);router[_0xfa2b('0xa')](_0xfa2b('0xd'),auth[_0xfa2b('0xb')](),controller[_0xfa2b('0xe')]);router[_0xfa2b('0xa')]('/:id/all_conditions',auth[_0xfa2b('0xb')](),controller[_0xfa2b('0xf')]);router['get'](_0xfa2b('0x10'),auth[_0xfa2b('0xb')](),controller[_0xfa2b('0x11')]);router[_0xfa2b('0xa')](_0xfa2b('0x12'),auth[_0xfa2b('0xb')](),controller[_0xfa2b('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfa2b('0x14')]);router['post'](_0xfa2b('0x15'),auth[_0xfa2b('0xb')](),controller['addAllCondition']);router[_0xfa2b('0x16')](_0xfa2b('0x10'),auth[_0xfa2b('0xb')](),controller[_0xfa2b('0x17')]);router[_0xfa2b('0x16')](_0xfa2b('0x12'),auth[_0xfa2b('0xb')](),controller['addAction']);router['put'](_0xfa2b('0xd'),auth['isAuthenticated'](),controller[_0xfa2b('0x18')]);router[_0xfa2b('0x19')](_0xfa2b('0xd'),auth['isAuthenticated'](),controller[_0xfa2b('0x1a')]);module[_0xfa2b('0x1b')]=router; \ No newline at end of file +var _0x0762=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','getAllConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition'];(function(_0xa9f272,_0x25ddd3){var _0x56494f=function(_0x13a251){while(--_0x13a251){_0xa9f272['push'](_0xa9f272['shift']());}};_0x56494f(++_0x25ddd3);}(_0x0762,0x1e5));var _0x2076=function(_0x5ae187,_0x8afd5c){_0x5ae187=_0x5ae187-0x0;var _0x211069=_0x0762[_0x5ae187];return _0x211069;};'use strict';var multer=require('multer');var util=require(_0x2076('0x0'));var path=require(_0x2076('0x1'));var timeout=require(_0x2076('0x2'));var express=require(_0x2076('0x3'));var router=express['Router']();var fs_extra=require(_0x2076('0x4'));var auth=require(_0x2076('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2076('0x6'));var controller=require(_0x2076('0x7'));router[_0x2076('0x8')]('/',auth[_0x2076('0x9')](),controller[_0x2076('0xa')]);router[_0x2076('0x8')]('/:id',auth[_0x2076('0x9')](),controller['show']);router[_0x2076('0x8')]('/:id/all_conditions',auth[_0x2076('0x9')](),controller[_0x2076('0xb')]);router[_0x2076('0x8')]('/:id/any_conditions',auth[_0x2076('0x9')](),controller['getAnyConditions']);router['get'](_0x2076('0xc'),auth[_0x2076('0x9')](),controller[_0x2076('0xd')]);router[_0x2076('0xe')]('/',auth[_0x2076('0x9')](),controller[_0x2076('0xf')]);router[_0x2076('0xe')]('/:id/all_conditions',auth[_0x2076('0x9')](),controller[_0x2076('0x10')]);router['post'](_0x2076('0x11'),auth[_0x2076('0x9')](),controller[_0x2076('0x12')]);router[_0x2076('0xe')](_0x2076('0xc'),auth[_0x2076('0x9')](),controller['addAction']);router['put'](_0x2076('0x13'),auth[_0x2076('0x9')](),controller[_0x2076('0x14')]);router[_0x2076('0x15')]('/:id',auth[_0x2076('0x9')](),controller[_0x2076('0x16')]);module[_0x2076('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 0c42075..e1e2a95 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 _0x3ba1=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1c156e,_0x3263a6){var _0x58fc22=function(_0x42f1eb){while(--_0x42f1eb){_0x1c156e['push'](_0x1c156e['shift']());}};_0x58fc22(++_0x3263a6);}(_0x3ba1,0x10f));var _0x13ba=function(_0x347f12,_0x586ebb){_0x347f12=_0x347f12-0x0;var _0x40e9c6=_0x3ba1[_0x347f12];return _0x40e9c6;};'use strict';var Sequelize=require(_0x13ba('0x0'));module[_0x13ba('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x13ba('0x2')]},'description':{'type':Sequelize[_0x13ba('0x2')]},'status':{'type':Sequelize[_0x13ba('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x07f2=['exports','STRING','BOOLEAN','sequelize'];(function(_0x187856,_0x2ecf29){var _0x44702e=function(_0x13120e){while(--_0x13120e){_0x187856['push'](_0x187856['shift']());}};_0x44702e(++_0x2ecf29);}(_0x07f2,0x10f));var _0x207f=function(_0x11131e,_0x254c6e){_0x11131e=_0x11131e-0x0;var _0x3b7335=_0x07f2[_0x11131e];return _0x3b7335;};'use strict';var Sequelize=require(_0x207f('0x0'));module[_0x207f('0x1')]={'name':{'type':Sequelize[_0x207f('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x207f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index a4243d2..6ffa9a7 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 _0xa4b9=['ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Triggers','UserProfileResource','end','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','Trigger','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','order','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xa4b9,0x116));var _0x9a4b=function(_0x33ee55,_0x235c9e){_0x33ee55=_0x33ee55-0x0;var _0xef7a3d=_0xa4b9[_0x33ee55];return _0xef7a3d;};'use strict';var emlformat=require(_0x9a4b('0x0'));var rimraf=require(_0x9a4b('0x1'));var zipdir=require(_0x9a4b('0x2'));var jsonpatch=require(_0x9a4b('0x3'));var rp=require('request-promise');var moment=require(_0x9a4b('0x4'));var BPromise=require(_0x9a4b('0x5'));var Mustache=require(_0x9a4b('0x6'));var util=require('util');var path=require(_0x9a4b('0x7'));var sox=require(_0x9a4b('0x8'));var csv=require(_0x9a4b('0x9'));var ejs=require(_0x9a4b('0xa'));var fs=require('fs');var fs_extra=require(_0x9a4b('0xb'));var _=require(_0x9a4b('0xc'));var squel=require(_0x9a4b('0xd'));var crypto=require(_0x9a4b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9a4b('0xf'));var toCsv=require(_0x9a4b('0x9'));var querystring=require(_0x9a4b('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a4b('0x11'));var authService=require(_0x9a4b('0x12'));var qs=require(_0x9a4b('0x13'));var as=require(_0x9a4b('0x14'));var hardwareService=require(_0x9a4b('0x15'));var logger=require(_0x9a4b('0x16'))(_0x9a4b('0x17'));var utils=require(_0x9a4b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xdb5dbe,_0x3e5324){_0x3e5324=_0x3e5324||0xcc;return function(_0x509378){if(_0x509378){return _0xdb5dbe[_0x9a4b('0x19')](_0x3e5324);}return _0xdb5dbe['status'](_0x3e5324)['end']();};}function respondWithResult(_0x2e5855,_0x2af238){_0x2af238=_0x2af238||0xc8;return function(_0x53ef0a){if(_0x53ef0a){return _0x2e5855[_0x9a4b('0x1a')](_0x2af238)[_0x9a4b('0x1b')](_0x53ef0a);}};}function respondWithFilteredResult(_0x1bd3ce,_0x582495){return function(_0x2e7026){if(_0x2e7026){var _0x1ffa43=typeof _0x582495[_0x9a4b('0x1c')]===_0x9a4b('0x1d')&&typeof _0x582495[_0x9a4b('0x1e')]===_0x9a4b('0x1d');var _0x1744de=_0x2e7026['count'];var _0x51c913=_0x1ffa43?0x0:_0x582495[_0x9a4b('0x1c')];var _0xdd7040=_0x1ffa43?_0x2e7026[_0x9a4b('0x1f')]:_0x582495[_0x9a4b('0x1c')]+_0x582495[_0x9a4b('0x1e')];var _0x20d4e4;if(_0xdd7040>=_0x1744de){_0xdd7040=_0x1744de;_0x20d4e4=0xc8;}else{_0x20d4e4=0xce;}_0x1bd3ce[_0x9a4b('0x1a')](_0x20d4e4);return _0x1bd3ce[_0x9a4b('0x20')](_0x9a4b('0x21'),_0x51c913+'-'+_0xdd7040+'/'+_0x1744de)['json'](_0x2e7026);}return null;};}function patchUpdates(_0x444f14){return function(_0x1ede1f){try{jsonpatch['apply'](_0x1ede1f,_0x444f14,!![]);}catch(_0x4776d6){return BPromise['reject'](_0x4776d6);}return _0x1ede1f[_0x9a4b('0x22')]();};}function saveUpdates(_0x2d5edc,_0x503909){return function(_0x1560ff){if(_0x1560ff){return _0x1560ff[_0x9a4b('0x23')](_0x2d5edc)[_0x9a4b('0x24')](function(_0xcf3eeb){return _0xcf3eeb;});}return null;};}function removeEntity(_0x42934c,_0xedc212){return function(_0x540758){if(_0x540758){return _0x540758[_0x9a4b('0x25')]()[_0x9a4b('0x24')](function(){var _0x3373ae=_0x540758[_0x9a4b('0x26')]({'plain':!![]});var _0x154aee=_0x9a4b('0x27');return db[_0x9a4b('0x28')][_0x9a4b('0x25')]({'where':{'type':_0x154aee,'resourceId':_0x3373ae['id']}})[_0x9a4b('0x24')](function(){return _0x540758;});})['then'](function(){_0x42934c[_0x9a4b('0x1a')](0xcc)[_0x9a4b('0x29')]();});}};}function handleEntityNotFound(_0x4152f2,_0xcf6802){return function(_0x3ec64f){if(!_0x3ec64f){_0x4152f2[_0x9a4b('0x19')](0x194);}return _0x3ec64f;};}function handleError(_0x3dc001,_0x3cb237){_0x3cb237=_0x3cb237||0x1f4;return function(_0x5e68a1){logger[_0x9a4b('0x2a')](_0x5e68a1[_0x9a4b('0x2b')]);if(_0x5e68a1[_0x9a4b('0x2c')]){delete _0x5e68a1[_0x9a4b('0x2c')];}_0x3dc001[_0x9a4b('0x1a')](_0x3cb237)[_0x9a4b('0x2d')](_0x5e68a1);};}exports[_0x9a4b('0x2e')]=function(_0x4db7d5,_0x389d21){var _0x1e626c={},_0x27e3de={},_0x158563={'count':0x0,'rows':[]};var _0x58ce69=_[_0x9a4b('0x2f')](db['Trigger']['rawAttributes'],function(_0x311b28){return{'name':_0x311b28['fieldName'],'type':_0x311b28[_0x9a4b('0x30')][_0x9a4b('0x31')]};});_0x27e3de[_0x9a4b('0x32')]=_['map'](_0x58ce69,'name');_0x27e3de[_0x9a4b('0x33')]=_[_0x9a4b('0x34')](_0x4db7d5[_0x9a4b('0x33')]);_0x27e3de[_0x9a4b('0x35')]=_[_0x9a4b('0x36')](_0x27e3de[_0x9a4b('0x32')],_0x27e3de[_0x9a4b('0x33')]);_0x1e626c[_0x9a4b('0x37')]=_[_0x9a4b('0x36')](_0x27e3de[_0x9a4b('0x32')],qs[_0x9a4b('0x38')](_0x4db7d5[_0x9a4b('0x33')][_0x9a4b('0x38')]));_0x1e626c[_0x9a4b('0x37')]=_0x1e626c['attributes'][_0x9a4b('0x39')]?_0x1e626c[_0x9a4b('0x37')]:_0x27e3de[_0x9a4b('0x32')];if(!_0x4db7d5[_0x9a4b('0x33')][_0x9a4b('0x3a')](_0x9a4b('0x3b'))){_0x1e626c[_0x9a4b('0x1e')]=qs[_0x9a4b('0x1e')](_0x4db7d5[_0x9a4b('0x33')][_0x9a4b('0x1e')]);_0x1e626c[_0x9a4b('0x1c')]=qs[_0x9a4b('0x1c')](_0x4db7d5['query'][_0x9a4b('0x1c')]);}_0x1e626c['order']=qs[_0x9a4b('0x3c')](_0x4db7d5[_0x9a4b('0x33')][_0x9a4b('0x3c')]);_0x1e626c[_0x9a4b('0x3d')]=qs['filters'](_['pick'](_0x4db7d5[_0x9a4b('0x33')],_0x27e3de[_0x9a4b('0x35')]),_0x58ce69);if(_0x4db7d5[_0x9a4b('0x33')][_0x9a4b('0x3e')]){_0x1e626c['where']=_[_0x9a4b('0x3f')](_0x1e626c[_0x9a4b('0x3d')],{'$or':_[_0x9a4b('0x2f')](_0x58ce69,function(_0x54a48b){if(_0x54a48b[_0x9a4b('0x30')]!==_0x9a4b('0x40')){var _0x4acaf8={};_0x4acaf8[_0x54a48b['name']]={'$like':'%'+_0x4db7d5[_0x9a4b('0x33')][_0x9a4b('0x3e')]+'%'};return _0x4acaf8;}})});}_0x1e626c=_[_0x9a4b('0x3f')]({},_0x1e626c,_0x4db7d5['options']);var _0x22a500={'where':_0x1e626c[_0x9a4b('0x3d')]};return db[_0x9a4b('0x41')][_0x9a4b('0x1f')](_0x22a500)[_0x9a4b('0x24')](function(_0x3784fa){_0x158563['count']=_0x3784fa;if(_0x4db7d5['query'][_0x9a4b('0x42')]){_0x1e626c[_0x9a4b('0x43')]=[{'all':!![]}];}return db['Trigger'][_0x9a4b('0x44')](_0x1e626c);})[_0x9a4b('0x24')](function(_0x4f9309){_0x158563[_0x9a4b('0x45')]=_0x4f9309;return _0x158563;})[_0x9a4b('0x24')](respondWithFilteredResult(_0x389d21,_0x1e626c))[_0x9a4b('0x46')](handleError(_0x389d21,null));};exports['show']=function(_0x548e6b,_0x17260c){var _0x4ff84a={'raw':![],'where':{'id':_0x548e6b[_0x9a4b('0x47')]['id']}},_0xca6e5f={};_0xca6e5f[_0x9a4b('0x32')]=_[_0x9a4b('0x34')](db[_0x9a4b('0x41')][_0x9a4b('0x48')]);_0xca6e5f[_0x9a4b('0x33')]=_[_0x9a4b('0x34')](_0x548e6b[_0x9a4b('0x33')]);_0xca6e5f[_0x9a4b('0x35')]=_[_0x9a4b('0x36')](_0xca6e5f[_0x9a4b('0x32')],_0xca6e5f[_0x9a4b('0x33')]);_0x4ff84a['attributes']=_[_0x9a4b('0x36')](_0xca6e5f['model'],qs['fields'](_0x548e6b['query'][_0x9a4b('0x38')]));_0x4ff84a['attributes']=_0x4ff84a['attributes'][_0x9a4b('0x39')]?_0x4ff84a[_0x9a4b('0x37')]:_0xca6e5f[_0x9a4b('0x32')];if(_0x548e6b[_0x9a4b('0x33')][_0x9a4b('0x42')]){_0x4ff84a[_0x9a4b('0x43')]=[{'all':!![]}];}_0x4ff84a=_[_0x9a4b('0x3f')]({},_0x4ff84a,_0x548e6b[_0x9a4b('0x49')]);return db[_0x9a4b('0x41')][_0x9a4b('0x4a')](_0x4ff84a)[_0x9a4b('0x24')](handleEntityNotFound(_0x17260c,null))[_0x9a4b('0x24')](respondWithResult(_0x17260c,null))[_0x9a4b('0x46')](handleError(_0x17260c,null));};exports[_0x9a4b('0x4b')]=function(_0xa62f6c,_0x5a23ad){return db[_0x9a4b('0x41')][_0x9a4b('0x4b')](_0xa62f6c[_0x9a4b('0x4c')],{})['then'](function(_0x3dcabd){var _0x1f1e16=_0xa62f6c[_0x9a4b('0x4d')]['get']({'plain':!![]});if(!_0x1f1e16)throw new Error(_0x9a4b('0x4e'));if(_0x1f1e16[_0x9a4b('0x4f')]===_0x9a4b('0x4d')){var _0x2e65dc=_0x3dcabd[_0x9a4b('0x26')]({'plain':!![]});var _0x53af4b='Triggers';return db[_0x9a4b('0x50')]['find']({'where':{'name':_0x53af4b,'userProfileId':_0x1f1e16[_0x9a4b('0x51')]},'raw':!![]})[_0x9a4b('0x24')](function(_0x1f1b00){if(_0x1f1b00&&_0x1f1b00[_0x9a4b('0x52')]===0x0){return db[_0x9a4b('0x28')][_0x9a4b('0x4b')]({'name':_0x2e65dc['name'],'resourceId':_0x2e65dc['id'],'type':_0x1f1b00[_0x9a4b('0x2c')],'sectionId':_0x1f1b00['id']},{})[_0x9a4b('0x24')](function(){return _0x3dcabd;});}else{return _0x3dcabd;}})[_0x9a4b('0x46')](function(_0x49fbdb){logger[_0x9a4b('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x49fbdb);throw _0x49fbdb;});}return _0x3dcabd;})['then'](respondWithResult(_0x5a23ad,0xc9))[_0x9a4b('0x46')](handleError(_0x5a23ad,null));};exports[_0x9a4b('0x23')]=function(_0x1aa235,_0x498e48){if(_0x1aa235[_0x9a4b('0x4c')]['id']){delete _0x1aa235['body']['id'];}return db['Trigger'][_0x9a4b('0x4a')]({'where':{'id':_0x1aa235[_0x9a4b('0x47')]['id']}})[_0x9a4b('0x24')](handleEntityNotFound(_0x498e48,null))[_0x9a4b('0x24')](saveUpdates(_0x1aa235[_0x9a4b('0x4c')],null))['then'](respondWithResult(_0x498e48,null))[_0x9a4b('0x46')](handleError(_0x498e48,null));};exports[_0x9a4b('0x25')]=function(_0x5b10ca,_0x2c490f){return db['Trigger'][_0x9a4b('0x4a')]({'where':{'id':_0x5b10ca[_0x9a4b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2c490f,null))[_0x9a4b('0x24')](removeEntity(_0x2c490f,null))[_0x9a4b('0x46')](handleError(_0x2c490f,null));};exports['addAllCondition']=function(_0x31b754,_0xc208dd,_0x459fe8){if(_0x31b754['body']['id']){delete _0x31b754[_0x9a4b('0x4c')]['id'];}return db['Trigger']['find']({'where':{'id':_0x31b754[_0x9a4b('0x47')]['id']}})[_0x9a4b('0x24')](handleEntityNotFound(_0xc208dd,null))[_0x9a4b('0x24')](function(_0x2f2cf4){if(_0x2f2cf4){_0x31b754[_0x9a4b('0x4c')][_0x9a4b('0x53')]=_0x2f2cf4['id'];return db[_0x9a4b('0x54')][_0x9a4b('0x4b')](_0x31b754[_0x9a4b('0x4c')]);}})['then'](respondWithResult(_0xc208dd,null))[_0x9a4b('0x46')](handleError(_0xc208dd,null));};exports[_0x9a4b('0x55')]=function(_0x42e29,_0x1482ca,_0x5d1534){if(_0x42e29[_0x9a4b('0x4c')]['id']){delete _0x42e29[_0x9a4b('0x4c')]['id'];}return db[_0x9a4b('0x41')][_0x9a4b('0x4a')]({'where':{'id':_0x42e29[_0x9a4b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1482ca,null))[_0x9a4b('0x24')](function(_0x5b1aa5){if(_0x5b1aa5){_0x42e29[_0x9a4b('0x4c')][_0x9a4b('0x56')]=_0x5b1aa5['id'];return db['Condition'][_0x9a4b('0x4b')](_0x42e29[_0x9a4b('0x4c')]);}})['then'](respondWithResult(_0x1482ca,null))['catch'](handleError(_0x1482ca,null));};exports[_0x9a4b('0x57')]=function(_0x26bdfe,_0x3ec2e2,_0x5ca1d1){var _0x5327e0={};var _0x18fccb={};var _0x5842a3;var _0x308cc9;return db['Trigger'][_0x9a4b('0x58')]({'where':{'id':_0x26bdfe[_0x9a4b('0x47')]['id']}})[_0x9a4b('0x24')](handleEntityNotFound(_0x3ec2e2,null))[_0x9a4b('0x24')](function(_0x13ce24){if(_0x13ce24){_0x5842a3=_0x13ce24;_0x18fccb[_0x9a4b('0x32')]=_[_0x9a4b('0x34')](db['Condition'][_0x9a4b('0x48')]);_0x18fccb['query']=_[_0x9a4b('0x34')](_0x26bdfe[_0x9a4b('0x33')]);_0x18fccb[_0x9a4b('0x35')]=_[_0x9a4b('0x36')](_0x18fccb['model'],_0x18fccb[_0x9a4b('0x33')]);_0x5327e0[_0x9a4b('0x37')]=_[_0x9a4b('0x36')](_0x18fccb[_0x9a4b('0x32')],qs[_0x9a4b('0x38')](_0x26bdfe['query'][_0x9a4b('0x38')]));_0x5327e0[_0x9a4b('0x37')]=_0x5327e0[_0x9a4b('0x37')]['length']?_0x5327e0['attributes']:_0x18fccb[_0x9a4b('0x32')];_0x5327e0[_0x9a4b('0x59')]=qs[_0x9a4b('0x3c')](_0x26bdfe[_0x9a4b('0x33')][_0x9a4b('0x3c')]);_0x5327e0[_0x9a4b('0x3d')]=qs['filters'](_[_0x9a4b('0x5a')](_0x26bdfe[_0x9a4b('0x33')],_0x18fccb[_0x9a4b('0x35')]));if(_0x26bdfe[_0x9a4b('0x33')][_0x9a4b('0x3e')]){_0x5327e0['where']=_[_0x9a4b('0x3f')](_0x5327e0[_0x9a4b('0x3d')],{'$or':_[_0x9a4b('0x2f')](_0x5327e0[_0x9a4b('0x37')],function(_0x525e86){var _0x1ae281={};_0x1ae281[_0x525e86]={'$like':'%'+_0x26bdfe[_0x9a4b('0x33')][_0x9a4b('0x3e')]+'%'};return _0x1ae281;})});}_0x5327e0=_[_0x9a4b('0x3f')]({},_0x5327e0,_0x26bdfe[_0x9a4b('0x49')]);return _0x5842a3[_0x9a4b('0x57')](_0x5327e0);}})['then'](function(_0x40cbf5){if(_0x40cbf5){_0x308cc9=_0x40cbf5[_0x9a4b('0x39')];if(!_0x26bdfe[_0x9a4b('0x33')][_0x9a4b('0x3a')](_0x9a4b('0x3b'))){_0x5327e0[_0x9a4b('0x1e')]=qs[_0x9a4b('0x1e')](_0x26bdfe[_0x9a4b('0x33')][_0x9a4b('0x1e')]);_0x5327e0[_0x9a4b('0x1c')]=qs[_0x9a4b('0x1c')](_0x26bdfe[_0x9a4b('0x33')][_0x9a4b('0x1c')]);}return _0x5842a3[_0x9a4b('0x57')](_0x5327e0);}})[_0x9a4b('0x24')](function(_0x2dac18){if(_0x2dac18){return _0x2dac18?{'count':_0x308cc9,'rows':_0x2dac18}:null;}})[_0x9a4b('0x24')](respondWithResult(_0x3ec2e2,null))[_0x9a4b('0x46')](handleError(_0x3ec2e2,null));};exports['getAnyConditions']=function(_0x550a0c,_0x48a58c,_0x3c1440){var _0x7e2785={};var _0x1cb6ff={};var _0x46bbdd;var _0x16abf2;return db[_0x9a4b('0x41')]['findOne']({'where':{'id':_0x550a0c['params']['id']}})[_0x9a4b('0x24')](handleEntityNotFound(_0x48a58c,null))['then'](function(_0x36467a){if(_0x36467a){_0x46bbdd=_0x36467a;_0x1cb6ff[_0x9a4b('0x32')]=_['keys'](db['Condition'][_0x9a4b('0x48')]);_0x1cb6ff['query']=_[_0x9a4b('0x34')](_0x550a0c[_0x9a4b('0x33')]);_0x1cb6ff['filters']=_['intersection'](_0x1cb6ff['model'],_0x1cb6ff['query']);_0x7e2785[_0x9a4b('0x37')]=_[_0x9a4b('0x36')](_0x1cb6ff[_0x9a4b('0x32')],qs[_0x9a4b('0x38')](_0x550a0c['query'][_0x9a4b('0x38')]));_0x7e2785[_0x9a4b('0x37')]=_0x7e2785['attributes'][_0x9a4b('0x39')]?_0x7e2785['attributes']:_0x1cb6ff[_0x9a4b('0x32')];_0x7e2785[_0x9a4b('0x59')]=qs['sort'](_0x550a0c[_0x9a4b('0x33')][_0x9a4b('0x3c')]);_0x7e2785[_0x9a4b('0x3d')]=qs[_0x9a4b('0x35')](_[_0x9a4b('0x5a')](_0x550a0c[_0x9a4b('0x33')],_0x1cb6ff[_0x9a4b('0x35')]));if(_0x550a0c[_0x9a4b('0x33')][_0x9a4b('0x3e')]){_0x7e2785[_0x9a4b('0x3d')]=_[_0x9a4b('0x3f')](_0x7e2785[_0x9a4b('0x3d')],{'$or':_[_0x9a4b('0x2f')](_0x7e2785[_0x9a4b('0x37')],function(_0x44d3ce){var _0x422146={};_0x422146[_0x44d3ce]={'$like':'%'+_0x550a0c[_0x9a4b('0x33')]['filter']+'%'};return _0x422146;})});}_0x7e2785=_[_0x9a4b('0x3f')]({},_0x7e2785,_0x550a0c['options']);return _0x46bbdd['getAnyConditions'](_0x7e2785);}})['then'](function(_0x84bc13){if(_0x84bc13){_0x16abf2=_0x84bc13[_0x9a4b('0x39')];if(!_0x550a0c[_0x9a4b('0x33')]['hasOwnProperty']('nolimit')){_0x7e2785['limit']=qs[_0x9a4b('0x1e')](_0x550a0c[_0x9a4b('0x33')][_0x9a4b('0x1e')]);_0x7e2785['offset']=qs[_0x9a4b('0x1c')](_0x550a0c['query'][_0x9a4b('0x1c')]);}return _0x46bbdd[_0x9a4b('0x5b')](_0x7e2785);}})[_0x9a4b('0x24')](function(_0x8e98dd){if(_0x8e98dd){return _0x8e98dd?{'count':_0x16abf2,'rows':_0x8e98dd}:null;}})[_0x9a4b('0x24')](respondWithResult(_0x48a58c,null))['catch'](handleError(_0x48a58c,null));};exports[_0x9a4b('0x5c')]=function(_0x243815,_0x1e4c46,_0x433d31){if(_0x243815['body']['id']){delete _0x243815[_0x9a4b('0x4c')]['id'];}return db[_0x9a4b('0x41')][_0x9a4b('0x4a')]({'where':{'id':_0x243815[_0x9a4b('0x47')]['id']}})[_0x9a4b('0x24')](handleEntityNotFound(_0x1e4c46,null))[_0x9a4b('0x24')](function(_0x59db6a){if(_0x59db6a){_0x243815[_0x9a4b('0x4c')][_0x9a4b('0x5d')]=_0x59db6a['id'];return db[_0x9a4b('0x5e')][_0x9a4b('0x4b')](_0x243815[_0x9a4b('0x4c')]);}})[_0x9a4b('0x24')](respondWithResult(_0x1e4c46,null))[_0x9a4b('0x46')](handleError(_0x1e4c46,null));};exports['getActions']=function(_0x5c48b4,_0xc81aee,_0x5c6a3f){var _0x3a5cd1={};var _0x480372={};var _0x2ef800;var _0x187e1c;return db['Trigger'][_0x9a4b('0x58')]({'where':{'id':_0x5c48b4[_0x9a4b('0x47')]['id']}})['then'](handleEntityNotFound(_0xc81aee,null))[_0x9a4b('0x24')](function(_0x5cde02){if(_0x5cde02){_0x2ef800=_0x5cde02;_0x480372[_0x9a4b('0x32')]=_[_0x9a4b('0x34')](db['Action'][_0x9a4b('0x48')]);_0x480372[_0x9a4b('0x33')]=_[_0x9a4b('0x34')](_0x5c48b4[_0x9a4b('0x33')]);_0x480372['filters']=_[_0x9a4b('0x36')](_0x480372['model'],_0x480372[_0x9a4b('0x33')]);_0x3a5cd1[_0x9a4b('0x37')]=_['intersection'](_0x480372[_0x9a4b('0x32')],qs[_0x9a4b('0x38')](_0x5c48b4['query']['fields']));_0x3a5cd1[_0x9a4b('0x37')]=_0x3a5cd1[_0x9a4b('0x37')]['length']?_0x3a5cd1[_0x9a4b('0x37')]:_0x480372['model'];_0x3a5cd1['order']=qs[_0x9a4b('0x3c')](_0x5c48b4[_0x9a4b('0x33')]['sort']);_0x3a5cd1[_0x9a4b('0x3d')]=qs[_0x9a4b('0x35')](_[_0x9a4b('0x5a')](_0x5c48b4['query'],_0x480372[_0x9a4b('0x35')]));if(_0x5c48b4[_0x9a4b('0x33')]['filter']){_0x3a5cd1[_0x9a4b('0x3d')]=_['merge'](_0x3a5cd1[_0x9a4b('0x3d')],{'$or':_[_0x9a4b('0x2f')](_0x3a5cd1[_0x9a4b('0x37')],function(_0x50efb1){var _0x4e0121={};_0x4e0121[_0x50efb1]={'$like':'%'+_0x5c48b4[_0x9a4b('0x33')]['filter']+'%'};return _0x4e0121;})});}_0x3a5cd1=_[_0x9a4b('0x3f')]({},_0x3a5cd1,_0x5c48b4[_0x9a4b('0x49')]);return _0x2ef800[_0x9a4b('0x5f')](_0x3a5cd1);}})[_0x9a4b('0x24')](function(_0x2977b3){if(_0x2977b3){_0x187e1c=_0x2977b3['length'];if(!_0x5c48b4[_0x9a4b('0x33')][_0x9a4b('0x3a')]('nolimit')){_0x3a5cd1[_0x9a4b('0x1e')]=qs[_0x9a4b('0x1e')](_0x5c48b4[_0x9a4b('0x33')][_0x9a4b('0x1e')]);_0x3a5cd1['offset']=qs[_0x9a4b('0x1c')](_0x5c48b4[_0x9a4b('0x33')][_0x9a4b('0x1c')]);}return _0x2ef800['getActions'](_0x3a5cd1);}})[_0x9a4b('0x24')](function(_0x1e5143){if(_0x1e5143){return _0x1e5143?{'count':_0x187e1c,'rows':_0x1e5143}:null;}})[_0x9a4b('0x24')](respondWithResult(_0xc81aee,null))[_0x9a4b('0x46')](handleError(_0xc81aee,null));}; \ No newline at end of file +var _0x1cdd=['options','Trigger','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addAllCondition','addAnyCondition','TriggerAnyId','Condition','findOne','length','getAllConditions','hasOwnProperty','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','UserProfileResource','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL'];(function(_0x3eafe1,_0x198c3f){var _0x584461=function(_0x59fd48){while(--_0x59fd48){_0x3eafe1['push'](_0x3eafe1['shift']());}};_0x584461(++_0x198c3f);}(_0x1cdd,0x19a));var _0xd1cd=function(_0x2ec952,_0x551ddd){_0x2ec952=_0x2ec952-0x0;var _0x485dab=_0x1cdd[_0x2ec952];return _0x485dab;};'use strict';var emlformat=require(_0xd1cd('0x0'));var rimraf=require(_0xd1cd('0x1'));var zipdir=require(_0xd1cd('0x2'));var jsonpatch=require(_0xd1cd('0x3'));var rp=require(_0xd1cd('0x4'));var moment=require(_0xd1cd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd1cd('0x6'));var util=require(_0xd1cd('0x7'));var path=require(_0xd1cd('0x8'));var sox=require(_0xd1cd('0x9'));var csv=require(_0xd1cd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd1cd('0xb'));var _=require(_0xd1cd('0xc'));var squel=require(_0xd1cd('0xd'));var crypto=require(_0xd1cd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd1cd('0xf'));var toCsv=require(_0xd1cd('0xa'));var querystring=require('querystring');var Papa=require(_0xd1cd('0x10'));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(_0xd1cd('0x11'));var logger=require(_0xd1cd('0x12'))(_0xd1cd('0x13'));var utils=require(_0xd1cd('0x14'));var config=require(_0xd1cd('0x15'));var licenseUtil=require(_0xd1cd('0x16'));var db=require(_0xd1cd('0x17'))['db'];function respondWithStatusCode(_0x1b7107,_0x27883b){_0x27883b=_0x27883b||0xcc;return function(_0x2e57ba){if(_0x2e57ba){return _0x1b7107[_0xd1cd('0x18')](_0x27883b);}return _0x1b7107['status'](_0x27883b)[_0xd1cd('0x19')]();};}function respondWithResult(_0x2cd6d8,_0x2ad855){_0x2ad855=_0x2ad855||0xc8;return function(_0x2dfd42){if(_0x2dfd42){return _0x2cd6d8[_0xd1cd('0x1a')](_0x2ad855)[_0xd1cd('0x1b')](_0x2dfd42);}};}function respondWithFilteredResult(_0x500dc7,_0x39b0e3){return function(_0x5b9101){if(_0x5b9101){var _0x16a1a4=typeof _0x39b0e3[_0xd1cd('0x1c')]===_0xd1cd('0x1d')&&typeof _0x39b0e3[_0xd1cd('0x1e')]===_0xd1cd('0x1d');var _0x135ccd=_0x5b9101[_0xd1cd('0x1f')];var _0xc130da=_0x16a1a4?0x0:_0x39b0e3['offset'];var _0x28e069=_0x16a1a4?_0x5b9101[_0xd1cd('0x1f')]:_0x39b0e3[_0xd1cd('0x1c')]+_0x39b0e3['limit'];var _0x2e3744;if(_0x28e069>=_0x135ccd){_0x28e069=_0x135ccd;_0x2e3744=0xc8;}else{_0x2e3744=0xce;}_0x500dc7[_0xd1cd('0x1a')](_0x2e3744);return _0x500dc7[_0xd1cd('0x20')](_0xd1cd('0x21'),_0xc130da+'-'+_0x28e069+'/'+_0x135ccd)[_0xd1cd('0x1b')](_0x5b9101);}return null;};}function patchUpdates(_0x1549be){return function(_0x491f1a){try{jsonpatch[_0xd1cd('0x22')](_0x491f1a,_0x1549be,!![]);}catch(_0x5d81f8){return BPromise['reject'](_0x5d81f8);}return _0x491f1a[_0xd1cd('0x23')]();};}function saveUpdates(_0x3bcf9a,_0x355be1){return function(_0x3371e9){if(_0x3371e9){return _0x3371e9[_0xd1cd('0x24')](_0x3bcf9a)[_0xd1cd('0x25')](function(_0x32ccc3){return _0x32ccc3;});}return null;};}function removeEntity(_0x1ff128,_0x39bde3){return function(_0x119c9d){if(_0x119c9d){return _0x119c9d['destroy']()[_0xd1cd('0x25')](function(){var _0x2872b6=_0x119c9d['get']({'plain':!![]});var _0x3a1083='Triggers';return db[_0xd1cd('0x26')][_0xd1cd('0x27')]({'where':{'type':_0x3a1083,'resourceId':_0x2872b6['id']}})[_0xd1cd('0x25')](function(){return _0x119c9d;});})[_0xd1cd('0x25')](function(){_0x1ff128[_0xd1cd('0x1a')](0xcc)[_0xd1cd('0x19')]();});}};}function handleEntityNotFound(_0x1cb30a,_0x1826df){return function(_0x3b82c0){if(!_0x3b82c0){_0x1cb30a[_0xd1cd('0x18')](0x194);}return _0x3b82c0;};}function handleError(_0x56f914,_0x5a29c4){_0x5a29c4=_0x5a29c4||0x1f4;return function(_0x1f5d56){logger[_0xd1cd('0x28')](_0x1f5d56[_0xd1cd('0x29')]);if(_0x1f5d56[_0xd1cd('0x2a')]){delete _0x1f5d56[_0xd1cd('0x2a')];}_0x56f914[_0xd1cd('0x1a')](_0x5a29c4)[_0xd1cd('0x2b')](_0x1f5d56);};}exports[_0xd1cd('0x2c')]=function(_0x15adca,_0xb8bbc3){var _0x80ce17={},_0x4f1f6f={},_0xad5afe={'count':0x0,'rows':[]};var _0x528ea7=_['map'](db['Trigger'][_0xd1cd('0x2d')],function(_0x1bd18e){return{'name':_0x1bd18e[_0xd1cd('0x2e')],'type':_0x1bd18e[_0xd1cd('0x2f')][_0xd1cd('0x30')]};});_0x4f1f6f[_0xd1cd('0x31')]=_[_0xd1cd('0x32')](_0x528ea7,_0xd1cd('0x2a'));_0x4f1f6f[_0xd1cd('0x33')]=_[_0xd1cd('0x34')](_0x15adca[_0xd1cd('0x33')]);_0x4f1f6f['filters']=_[_0xd1cd('0x35')](_0x4f1f6f[_0xd1cd('0x31')],_0x4f1f6f[_0xd1cd('0x33')]);_0x80ce17['attributes']=_[_0xd1cd('0x35')](_0x4f1f6f[_0xd1cd('0x31')],qs[_0xd1cd('0x36')](_0x15adca[_0xd1cd('0x33')][_0xd1cd('0x36')]));_0x80ce17['attributes']=_0x80ce17[_0xd1cd('0x37')]['length']?_0x80ce17['attributes']:_0x4f1f6f[_0xd1cd('0x31')];if(!_0x15adca[_0xd1cd('0x33')]['hasOwnProperty'](_0xd1cd('0x38'))){_0x80ce17['limit']=qs['limit'](_0x15adca['query'][_0xd1cd('0x1e')]);_0x80ce17[_0xd1cd('0x1c')]=qs[_0xd1cd('0x1c')](_0x15adca[_0xd1cd('0x33')][_0xd1cd('0x1c')]);}_0x80ce17[_0xd1cd('0x39')]=qs[_0xd1cd('0x3a')](_0x15adca[_0xd1cd('0x33')][_0xd1cd('0x3a')]);_0x80ce17[_0xd1cd('0x3b')]=qs[_0xd1cd('0x3c')](_[_0xd1cd('0x3d')](_0x15adca[_0xd1cd('0x33')],_0x4f1f6f[_0xd1cd('0x3c')]),_0x528ea7);if(_0x15adca[_0xd1cd('0x33')][_0xd1cd('0x3e')]){_0x80ce17[_0xd1cd('0x3b')]=_[_0xd1cd('0x3f')](_0x80ce17[_0xd1cd('0x3b')],{'$or':_['map'](_0x528ea7,function(_0x5482a7){if(_0x5482a7[_0xd1cd('0x2f')]!==_0xd1cd('0x40')){var _0x14a1e9={};_0x14a1e9[_0x5482a7[_0xd1cd('0x2a')]]={'$like':'%'+_0x15adca[_0xd1cd('0x33')][_0xd1cd('0x3e')]+'%'};return _0x14a1e9;}})});}_0x80ce17=_[_0xd1cd('0x3f')]({},_0x80ce17,_0x15adca[_0xd1cd('0x41')]);var _0x589d8d={'where':_0x80ce17[_0xd1cd('0x3b')]};return db[_0xd1cd('0x42')][_0xd1cd('0x1f')](_0x589d8d)[_0xd1cd('0x25')](function(_0x21e7b7){_0xad5afe[_0xd1cd('0x1f')]=_0x21e7b7;if(_0x15adca[_0xd1cd('0x33')][_0xd1cd('0x43')]){_0x80ce17[_0xd1cd('0x44')]=[{'all':!![]}];}return db[_0xd1cd('0x42')][_0xd1cd('0x45')](_0x80ce17);})[_0xd1cd('0x25')](function(_0x25b2dd){_0xad5afe[_0xd1cd('0x46')]=_0x25b2dd;return _0xad5afe;})['then'](respondWithFilteredResult(_0xb8bbc3,_0x80ce17))[_0xd1cd('0x47')](handleError(_0xb8bbc3,null));};exports[_0xd1cd('0x48')]=function(_0x5476c9,_0x41c35b){var _0x1dbac7={'raw':![],'where':{'id':_0x5476c9[_0xd1cd('0x49')]['id']}},_0x2503db={};_0x2503db[_0xd1cd('0x31')]=_[_0xd1cd('0x34')](db[_0xd1cd('0x42')][_0xd1cd('0x2d')]);_0x2503db[_0xd1cd('0x33')]=_[_0xd1cd('0x34')](_0x5476c9[_0xd1cd('0x33')]);_0x2503db[_0xd1cd('0x3c')]=_[_0xd1cd('0x35')](_0x2503db['model'],_0x2503db['query']);_0x1dbac7[_0xd1cd('0x37')]=_[_0xd1cd('0x35')](_0x2503db[_0xd1cd('0x31')],qs['fields'](_0x5476c9[_0xd1cd('0x33')][_0xd1cd('0x36')]));_0x1dbac7[_0xd1cd('0x37')]=_0x1dbac7[_0xd1cd('0x37')]['length']?_0x1dbac7[_0xd1cd('0x37')]:_0x2503db[_0xd1cd('0x31')];if(_0x5476c9['query'][_0xd1cd('0x43')]){_0x1dbac7[_0xd1cd('0x44')]=[{'all':!![]}];}_0x1dbac7=_['merge']({},_0x1dbac7,_0x5476c9[_0xd1cd('0x41')]);return db[_0xd1cd('0x42')][_0xd1cd('0x4a')](_0x1dbac7)['then'](handleEntityNotFound(_0x41c35b,null))[_0xd1cd('0x25')](respondWithResult(_0x41c35b,null))['catch'](handleError(_0x41c35b,null));};exports[_0xd1cd('0x4b')]=function(_0x186354,_0x42579c){return db[_0xd1cd('0x42')][_0xd1cd('0x4b')](_0x186354[_0xd1cd('0x4c')],{})[_0xd1cd('0x25')](function(_0x372997){var _0x40eb9e=_0x186354[_0xd1cd('0x4d')][_0xd1cd('0x4e')]({'plain':!![]});if(!_0x40eb9e)throw new Error(_0xd1cd('0x4f'));if(_0x40eb9e['role']==='user'){var _0x2aa07f=_0x372997[_0xd1cd('0x4e')]({'plain':!![]});var _0x17a4d5='Triggers';return db[_0xd1cd('0x50')]['find']({'where':{'name':_0x17a4d5,'userProfileId':_0x40eb9e[_0xd1cd('0x51')]},'raw':!![]})['then'](function(_0x3364b8){if(_0x3364b8&&_0x3364b8[_0xd1cd('0x52')]===0x0){return db[_0xd1cd('0x26')]['create']({'name':_0x2aa07f[_0xd1cd('0x2a')],'resourceId':_0x2aa07f['id'],'type':_0x3364b8[_0xd1cd('0x2a')],'sectionId':_0x3364b8['id']},{})[_0xd1cd('0x25')](function(){return _0x372997;});}else{return _0x372997;}})[_0xd1cd('0x47')](function(_0x3fc4d2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fc4d2);throw _0x3fc4d2;});}return _0x372997;})[_0xd1cd('0x25')](respondWithResult(_0x42579c,0xc9))[_0xd1cd('0x47')](handleError(_0x42579c,null));};exports['update']=function(_0x5a89ce,_0x1350ae){if(_0x5a89ce[_0xd1cd('0x4c')]['id']){delete _0x5a89ce[_0xd1cd('0x4c')]['id'];}return db[_0xd1cd('0x42')][_0xd1cd('0x4a')]({'where':{'id':_0x5a89ce[_0xd1cd('0x49')]['id']}})[_0xd1cd('0x25')](handleEntityNotFound(_0x1350ae,null))[_0xd1cd('0x25')](saveUpdates(_0x5a89ce[_0xd1cd('0x4c')],null))[_0xd1cd('0x25')](respondWithResult(_0x1350ae,null))['catch'](handleError(_0x1350ae,null));};exports[_0xd1cd('0x27')]=function(_0x2dc3ff,_0x5695e7){return db['Trigger'][_0xd1cd('0x4a')]({'where':{'id':_0x2dc3ff[_0xd1cd('0x49')]['id']}})[_0xd1cd('0x25')](handleEntityNotFound(_0x5695e7,null))['then'](removeEntity(_0x5695e7,null))[_0xd1cd('0x47')](handleError(_0x5695e7,null));};exports[_0xd1cd('0x53')]=function(_0x198ca7,_0x353de5,_0x3f7104){if(_0x198ca7[_0xd1cd('0x4c')]['id']){delete _0x198ca7['body']['id'];}return db['Trigger'][_0xd1cd('0x4a')]({'where':{'id':_0x198ca7[_0xd1cd('0x49')]['id']}})[_0xd1cd('0x25')](handleEntityNotFound(_0x353de5,null))['then'](function(_0x57341b){if(_0x57341b){_0x198ca7[_0xd1cd('0x4c')]['TriggerAllId']=_0x57341b['id'];return db['Condition'][_0xd1cd('0x4b')](_0x198ca7['body']);}})[_0xd1cd('0x25')](respondWithResult(_0x353de5,null))['catch'](handleError(_0x353de5,null));};exports[_0xd1cd('0x54')]=function(_0x2daa30,_0x43cd64,_0x1c9a56){if(_0x2daa30['body']['id']){delete _0x2daa30[_0xd1cd('0x4c')]['id'];}return db[_0xd1cd('0x42')][_0xd1cd('0x4a')]({'where':{'id':_0x2daa30[_0xd1cd('0x49')]['id']}})[_0xd1cd('0x25')](handleEntityNotFound(_0x43cd64,null))[_0xd1cd('0x25')](function(_0x1e288a){if(_0x1e288a){_0x2daa30['body'][_0xd1cd('0x55')]=_0x1e288a['id'];return db[_0xd1cd('0x56')][_0xd1cd('0x4b')](_0x2daa30['body']);}})[_0xd1cd('0x25')](respondWithResult(_0x43cd64,null))['catch'](handleError(_0x43cd64,null));};exports['getAllConditions']=function(_0x1485d4,_0xb0d898,_0x214fd2){var _0xd9da97={};var _0x246c42={};var _0x35b020;var _0x53840e;return db[_0xd1cd('0x42')][_0xd1cd('0x57')]({'where':{'id':_0x1485d4['params']['id']}})['then'](handleEntityNotFound(_0xb0d898,null))[_0xd1cd('0x25')](function(_0x59856e){if(_0x59856e){_0x35b020=_0x59856e;_0x246c42[_0xd1cd('0x31')]=_[_0xd1cd('0x34')](db[_0xd1cd('0x56')][_0xd1cd('0x2d')]);_0x246c42[_0xd1cd('0x33')]=_[_0xd1cd('0x34')](_0x1485d4[_0xd1cd('0x33')]);_0x246c42[_0xd1cd('0x3c')]=_['intersection'](_0x246c42[_0xd1cd('0x31')],_0x246c42[_0xd1cd('0x33')]);_0xd9da97[_0xd1cd('0x37')]=_[_0xd1cd('0x35')](_0x246c42['model'],qs[_0xd1cd('0x36')](_0x1485d4[_0xd1cd('0x33')][_0xd1cd('0x36')]));_0xd9da97[_0xd1cd('0x37')]=_0xd9da97[_0xd1cd('0x37')][_0xd1cd('0x58')]?_0xd9da97[_0xd1cd('0x37')]:_0x246c42['model'];_0xd9da97['order']=qs[_0xd1cd('0x3a')](_0x1485d4[_0xd1cd('0x33')][_0xd1cd('0x3a')]);_0xd9da97['where']=qs[_0xd1cd('0x3c')](_[_0xd1cd('0x3d')](_0x1485d4['query'],_0x246c42['filters']));if(_0x1485d4[_0xd1cd('0x33')][_0xd1cd('0x3e')]){_0xd9da97[_0xd1cd('0x3b')]=_['merge'](_0xd9da97[_0xd1cd('0x3b')],{'$or':_[_0xd1cd('0x32')](_0xd9da97['attributes'],function(_0x4a4abd){var _0x5bfce8={};_0x5bfce8[_0x4a4abd]={'$like':'%'+_0x1485d4['query'][_0xd1cd('0x3e')]+'%'};return _0x5bfce8;})});}_0xd9da97=_[_0xd1cd('0x3f')]({},_0xd9da97,_0x1485d4[_0xd1cd('0x41')]);return _0x35b020[_0xd1cd('0x59')](_0xd9da97);}})[_0xd1cd('0x25')](function(_0x998a08){if(_0x998a08){_0x53840e=_0x998a08[_0xd1cd('0x58')];if(!_0x1485d4[_0xd1cd('0x33')][_0xd1cd('0x5a')](_0xd1cd('0x38'))){_0xd9da97[_0xd1cd('0x1e')]=qs[_0xd1cd('0x1e')](_0x1485d4[_0xd1cd('0x33')][_0xd1cd('0x1e')]);_0xd9da97[_0xd1cd('0x1c')]=qs['offset'](_0x1485d4[_0xd1cd('0x33')][_0xd1cd('0x1c')]);}return _0x35b020[_0xd1cd('0x59')](_0xd9da97);}})['then'](function(_0x7ab6f9){if(_0x7ab6f9){return _0x7ab6f9?{'count':_0x53840e,'rows':_0x7ab6f9}:null;}})[_0xd1cd('0x25')](respondWithResult(_0xb0d898,null))[_0xd1cd('0x47')](handleError(_0xb0d898,null));};exports['getAnyConditions']=function(_0x19064f,_0x38b13f,_0x44fa0a){var _0x2a2b49={};var _0x3f7d5d={};var _0x56ef24;var _0x50e7cb;return db[_0xd1cd('0x42')][_0xd1cd('0x57')]({'where':{'id':_0x19064f[_0xd1cd('0x49')]['id']}})['then'](handleEntityNotFound(_0x38b13f,null))[_0xd1cd('0x25')](function(_0x2a5e26){if(_0x2a5e26){_0x56ef24=_0x2a5e26;_0x3f7d5d[_0xd1cd('0x31')]=_['keys'](db['Condition'][_0xd1cd('0x2d')]);_0x3f7d5d[_0xd1cd('0x33')]=_['keys'](_0x19064f['query']);_0x3f7d5d[_0xd1cd('0x3c')]=_[_0xd1cd('0x35')](_0x3f7d5d[_0xd1cd('0x31')],_0x3f7d5d[_0xd1cd('0x33')]);_0x2a2b49[_0xd1cd('0x37')]=_[_0xd1cd('0x35')](_0x3f7d5d[_0xd1cd('0x31')],qs['fields'](_0x19064f[_0xd1cd('0x33')][_0xd1cd('0x36')]));_0x2a2b49[_0xd1cd('0x37')]=_0x2a2b49[_0xd1cd('0x37')]['length']?_0x2a2b49[_0xd1cd('0x37')]:_0x3f7d5d[_0xd1cd('0x31')];_0x2a2b49[_0xd1cd('0x39')]=qs[_0xd1cd('0x3a')](_0x19064f[_0xd1cd('0x33')][_0xd1cd('0x3a')]);_0x2a2b49[_0xd1cd('0x3b')]=qs[_0xd1cd('0x3c')](_[_0xd1cd('0x3d')](_0x19064f['query'],_0x3f7d5d[_0xd1cd('0x3c')]));if(_0x19064f['query']['filter']){_0x2a2b49[_0xd1cd('0x3b')]=_[_0xd1cd('0x3f')](_0x2a2b49[_0xd1cd('0x3b')],{'$or':_[_0xd1cd('0x32')](_0x2a2b49['attributes'],function(_0x230311){var _0x3a6c7b={};_0x3a6c7b[_0x230311]={'$like':'%'+_0x19064f[_0xd1cd('0x33')]['filter']+'%'};return _0x3a6c7b;})});}_0x2a2b49=_[_0xd1cd('0x3f')]({},_0x2a2b49,_0x19064f[_0xd1cd('0x41')]);return _0x56ef24[_0xd1cd('0x5b')](_0x2a2b49);}})[_0xd1cd('0x25')](function(_0x3b0b16){if(_0x3b0b16){_0x50e7cb=_0x3b0b16[_0xd1cd('0x58')];if(!_0x19064f['query'][_0xd1cd('0x5a')]('nolimit')){_0x2a2b49[_0xd1cd('0x1e')]=qs[_0xd1cd('0x1e')](_0x19064f['query'][_0xd1cd('0x1e')]);_0x2a2b49['offset']=qs[_0xd1cd('0x1c')](_0x19064f['query'][_0xd1cd('0x1c')]);}return _0x56ef24[_0xd1cd('0x5b')](_0x2a2b49);}})['then'](function(_0x582861){if(_0x582861){return _0x582861?{'count':_0x50e7cb,'rows':_0x582861}:null;}})[_0xd1cd('0x25')](respondWithResult(_0x38b13f,null))[_0xd1cd('0x47')](handleError(_0x38b13f,null));};exports['addAction']=function(_0x33f114,_0x439a7c,_0x53b7fc){if(_0x33f114['body']['id']){delete _0x33f114[_0xd1cd('0x4c')]['id'];}return db['Trigger'][_0xd1cd('0x4a')]({'where':{'id':_0x33f114[_0xd1cd('0x49')]['id']}})[_0xd1cd('0x25')](handleEntityNotFound(_0x439a7c,null))[_0xd1cd('0x25')](function(_0x59aab3){if(_0x59aab3){_0x33f114[_0xd1cd('0x4c')][_0xd1cd('0x5c')]=_0x59aab3['id'];return db[_0xd1cd('0x5d')][_0xd1cd('0x4b')](_0x33f114['body']);}})['then'](respondWithResult(_0x439a7c,null))[_0xd1cd('0x47')](handleError(_0x439a7c,null));};exports['getActions']=function(_0x20ea5e,_0x3ed6f7,_0x33f442){var _0x21c239={};var _0x4cb9dc={};var _0x4cba4c;var _0x2ee8ce;return db['Trigger'][_0xd1cd('0x57')]({'where':{'id':_0x20ea5e[_0xd1cd('0x49')]['id']}})[_0xd1cd('0x25')](handleEntityNotFound(_0x3ed6f7,null))[_0xd1cd('0x25')](function(_0x45af4a){if(_0x45af4a){_0x4cba4c=_0x45af4a;_0x4cb9dc[_0xd1cd('0x31')]=_[_0xd1cd('0x34')](db[_0xd1cd('0x5d')][_0xd1cd('0x2d')]);_0x4cb9dc[_0xd1cd('0x33')]=_[_0xd1cd('0x34')](_0x20ea5e[_0xd1cd('0x33')]);_0x4cb9dc[_0xd1cd('0x3c')]=_[_0xd1cd('0x35')](_0x4cb9dc[_0xd1cd('0x31')],_0x4cb9dc[_0xd1cd('0x33')]);_0x21c239[_0xd1cd('0x37')]=_['intersection'](_0x4cb9dc[_0xd1cd('0x31')],qs[_0xd1cd('0x36')](_0x20ea5e[_0xd1cd('0x33')]['fields']));_0x21c239['attributes']=_0x21c239['attributes'][_0xd1cd('0x58')]?_0x21c239[_0xd1cd('0x37')]:_0x4cb9dc[_0xd1cd('0x31')];_0x21c239[_0xd1cd('0x39')]=qs[_0xd1cd('0x3a')](_0x20ea5e[_0xd1cd('0x33')][_0xd1cd('0x3a')]);_0x21c239[_0xd1cd('0x3b')]=qs['filters'](_['pick'](_0x20ea5e[_0xd1cd('0x33')],_0x4cb9dc[_0xd1cd('0x3c')]));if(_0x20ea5e['query'][_0xd1cd('0x3e')]){_0x21c239[_0xd1cd('0x3b')]=_['merge'](_0x21c239[_0xd1cd('0x3b')],{'$or':_[_0xd1cd('0x32')](_0x21c239[_0xd1cd('0x37')],function(_0x49151b){var _0x52b5b9={};_0x52b5b9[_0x49151b]={'$like':'%'+_0x20ea5e['query'][_0xd1cd('0x3e')]+'%'};return _0x52b5b9;})});}_0x21c239=_[_0xd1cd('0x3f')]({},_0x21c239,_0x20ea5e[_0xd1cd('0x41')]);return _0x4cba4c[_0xd1cd('0x5e')](_0x21c239);}})['then'](function(_0x47134c){if(_0x47134c){_0x2ee8ce=_0x47134c[_0xd1cd('0x58')];if(!_0x20ea5e[_0xd1cd('0x33')][_0xd1cd('0x5a')](_0xd1cd('0x38'))){_0x21c239[_0xd1cd('0x1e')]=qs[_0xd1cd('0x1e')](_0x20ea5e['query'][_0xd1cd('0x1e')]);_0x21c239[_0xd1cd('0x1c')]=qs[_0xd1cd('0x1c')](_0x20ea5e[_0xd1cd('0x33')][_0xd1cd('0x1c')]);}return _0x4cba4c['getActions'](_0x21c239);}})[_0xd1cd('0x25')](function(_0x513551){if(_0x513551){return _0x513551?{'count':_0x2ee8ce,'rows':_0x513551}:null;}})[_0xd1cd('0x25')](respondWithResult(_0x3ed6f7,null))[_0xd1cd('0x47')](handleError(_0x3ed6f7,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index d729924..8f85c4d 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 _0x63b6=['rimraf','../../config/environment','./trigger.attributes','define','tools_triggers','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63b6,0x127));var _0x663b=function(_0x378bf7,_0x404f98){_0x378bf7=_0x378bf7-0x0;var _0x3c36f3=_0x63b6[_0x378bf7];return _0x3c36f3;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var logger=require(_0x663b('0x2'))('api');var moment=require(_0x663b('0x3'));var BPromise=require('bluebird');var rp=require(_0x663b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var attributes=require(_0x663b('0x7'));module['exports']=function(_0x4486b1,_0x57e43e){return _0x4486b1[_0x663b('0x8')]('Trigger',attributes,{'tableName':_0x663b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3ea=['../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','util','../../config/logger','moment','request-promise','rimraf'];(function(_0x2ee85e,_0x250e18){var _0x1912e9=function(_0x2ccb30){while(--_0x2ccb30){_0x2ee85e['push'](_0x2ee85e['shift']());}};_0x1912e9(++_0x250e18);}(_0xb3ea,0x10d));var _0xab3e=function(_0x34ccdf,_0xfea6fd){_0x34ccdf=_0x34ccdf-0x0;var _0x3f7f7b=_0xb3ea[_0x34ccdf];return _0x3f7f7b;};'use strict';var _=require(_0xab3e('0x0'));var util=require(_0xab3e('0x1'));var logger=require(_0xab3e('0x2'))('api');var moment=require(_0xab3e('0x3'));var BPromise=require('bluebird');var rp=require(_0xab3e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab3e('0x5'));var config=require(_0xab3e('0x6'));var attributes=require(_0xab3e('0x7'));module[_0xab3e('0x8')]=function(_0x135941,_0x570744){return _0x135941[_0xab3e('0x9')]('Trigger',attributes,{'tableName':_0xab3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 10dbdb3..53e9cbb 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 _0x157f=['Trigger','findAll','options','attributes','include','map','model','debug','raw','where','ShowTrigger','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetTrigger'];(function(_0x386b08,_0x5d49da){var _0x4b38ef=function(_0x197a15){while(--_0x197a15){_0x386b08['push'](_0x386b08['shift']());}};_0x4b38ef(++_0x5d49da);}(_0x157f,0xd2));var _0xf157=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x157f[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xf157('0x0'));var util=require(_0xf157('0x1'));var moment=require('moment');var BPromise=require(_0xf157('0x2'));var rs=require(_0xf157('0x3'));var fs=require('fs');var Redis=require(_0xf157('0x4'));var db=require(_0xf157('0x5'))['db'];var utils=require(_0xf157('0x6'));var logger=require(_0xf157('0x7'))(_0xf157('0x8'));var config=require(_0xf157('0x9'));var jayson=require(_0xf157('0xa'));var client=jayson[_0xf157('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f11d5,_0x2a3e68,_0x26c384){return new BPromise(function(_0x598a82,_0x1e0f37){return client['request'](_0x4f11d5,_0x26c384)[_0xf157('0xc')](function(_0x554f4e){logger['info'](_0xf157('0xd'),_0x2a3e68,'request\x20sent');logger['debug'](_0xf157('0xe'),_0x2a3e68,'request\x20sent',JSON[_0xf157('0xf')](_0x554f4e));if(_0x554f4e[_0xf157('0x10')]){if(_0x554f4e['error']['code']===0x1f4){logger[_0xf157('0x10')](_0xf157('0xd'),_0x2a3e68,_0x554f4e[_0xf157('0x10')]['message']);return _0x1e0f37(_0x554f4e['error'][_0xf157('0x11')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x2a3e68,_0x554f4e[_0xf157('0x10')]['message']);return _0x598a82(_0x554f4e[_0xf157('0x10')][_0xf157('0x11')]);}else{logger[_0xf157('0x12')](_0xf157('0xd'),_0x2a3e68,'request\x20sent');_0x598a82(_0x554f4e[_0xf157('0x13')][_0xf157('0x11')]);}})['catch'](function(_0x4eb791){logger[_0xf157('0x10')](_0xf157('0xd'),_0x2a3e68,_0x4eb791);_0x1e0f37(_0x4eb791);});});}exports[_0xf157('0x14')]=function(_0x22c3bb){var _0x42ffc1=this;return new Promise(function(_0x5f1349,_0x300490){return db[_0xf157('0x15')][_0xf157('0x16')]({'raw':_0x22c3bb['options']?_0x22c3bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x22c3bb['options']?_0x22c3bb[_0xf157('0x17')]['where']||null:null,'attributes':_0x22c3bb[_0xf157('0x17')]?_0x22c3bb[_0xf157('0x17')][_0xf157('0x18')]||null:null,'limit':_0x22c3bb[_0xf157('0x17')]?_0x22c3bb[_0xf157('0x17')]['limit']||null:null,'include':_0x22c3bb[_0xf157('0x17')]?_0x22c3bb[_0xf157('0x17')][_0xf157('0x19')]?_[_0xf157('0x1a')](_0x22c3bb[_0xf157('0x17')][_0xf157('0x19')],function(_0x484ae2){return{'model':db[_0x484ae2['model']],'as':_0x484ae2['as'],'attributes':_0x484ae2['attributes'],'include':_0x484ae2[_0xf157('0x19')]?_[_0xf157('0x1a')](_0x484ae2[_0xf157('0x19')],function(_0x50dfb3){return{'model':db[_0x50dfb3[_0xf157('0x1b')]],'as':_0x50dfb3['as'],'attributes':_0x50dfb3[_0xf157('0x18')],'include':_0x50dfb3[_0xf157('0x19')]?_[_0xf157('0x1a')](_0x50dfb3[_0xf157('0x19')],function(_0x2d4307){return{'model':db[_0x2d4307['model']],'as':_0x2d4307['as'],'attributes':_0x2d4307[_0xf157('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf157('0xc')](function(_0x5300ac){logger[_0xf157('0x12')](_0xf157('0x14'),_0x22c3bb);logger[_0xf157('0x1c')](_0xf157('0x14'),_0x22c3bb,JSON[_0xf157('0xf')](_0x5300ac));_0x5f1349(_0x5300ac);})['catch'](function(_0x3528b2){logger[_0xf157('0x10')](_0xf157('0x14'),_0x3528b2[_0xf157('0x11')],_0x22c3bb);_0x300490(_0x42ffc1['error'](0x1f4,_0x3528b2[_0xf157('0x11')]));});});};exports['ShowTrigger']=function(_0x2824ab){var _0x2861b0=this;return new Promise(function(_0x40b9c7,_0x1198db){return db[_0xf157('0x15')]['find']({'raw':_0x2824ab[_0xf157('0x17')]?_0x2824ab['options'][_0xf157('0x1d')]===undefined?!![]:![]:!![],'where':_0x2824ab[_0xf157('0x17')]?_0x2824ab[_0xf157('0x17')][_0xf157('0x1e')]||null:null,'attributes':_0x2824ab['options']?_0x2824ab['options']['attributes']||null:null,'include':_0x2824ab[_0xf157('0x17')]?_0x2824ab[_0xf157('0x17')][_0xf157('0x19')]?_['map'](_0x2824ab[_0xf157('0x17')]['include'],function(_0x4cdb05){return{'model':db[_0x4cdb05['model']],'as':_0x4cdb05['as'],'attributes':_0x4cdb05[_0xf157('0x18')],'include':_0x4cdb05[_0xf157('0x19')]?_['map'](_0x4cdb05[_0xf157('0x19')],function(_0x3da8eb){return{'model':db[_0x3da8eb[_0xf157('0x1b')]],'as':_0x3da8eb['as'],'attributes':_0x3da8eb[_0xf157('0x18')],'include':_0x3da8eb[_0xf157('0x19')]?_['map'](_0x3da8eb[_0xf157('0x19')],function(_0x13f701){return{'model':db[_0x13f701[_0xf157('0x1b')]],'as':_0x13f701['as'],'attributes':_0x13f701['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xdedbd3){logger[_0xf157('0x12')]('ShowTrigger',_0x2824ab);logger[_0xf157('0x1c')](_0xf157('0x1f'),_0x2824ab,JSON['stringify'](_0xdedbd3));_0x40b9c7(_0xdedbd3);})[_0xf157('0x20')](function(_0x2b0b2b){logger[_0xf157('0x10')]('ShowTrigger',_0x2b0b2b[_0xf157('0x11')],_0x2824ab);_0x1198db(_0x2861b0['error'](0x1f4,_0x2b0b2b[_0xf157('0x11')]));});});}; \ No newline at end of file +var _0xd93f=['find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','findAll','options','raw','where','limit','include','map','model','attributes','ShowTrigger','Trigger'];(function(_0x537501,_0x1509e4){var _0x54bfc2=function(_0x29bd68){while(--_0x29bd68){_0x537501['push'](_0x537501['shift']());}};_0x54bfc2(++_0x1509e4);}(_0xd93f,0xba));var _0xfd93=function(_0x2166e1,_0x4a9a63){_0x2166e1=_0x2166e1-0x0;var _0x42ada1=_0xd93f[_0x2166e1];return _0x42ada1;};'use strict';var _=require(_0xfd93('0x0'));var util=require(_0xfd93('0x1'));var moment=require(_0xfd93('0x2'));var BPromise=require('bluebird');var rs=require(_0xfd93('0x3'));var fs=require('fs');var Redis=require(_0xfd93('0x4'));var db=require(_0xfd93('0x5'))['db'];var utils=require(_0xfd93('0x6'));var logger=require(_0xfd93('0x7'))(_0xfd93('0x8'));var config=require(_0xfd93('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfd93('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29a997,_0x184c34,_0x30ac62){return new BPromise(function(_0x1928ba,_0x15b1c4){return client[_0xfd93('0xb')](_0x29a997,_0x30ac62)[_0xfd93('0xc')](function(_0x4a417f){logger[_0xfd93('0xd')](_0xfd93('0xe'),_0x184c34,_0xfd93('0xf'));logger[_0xfd93('0x10')](_0xfd93('0x11'),_0x184c34,_0xfd93('0xf'),JSON[_0xfd93('0x12')](_0x4a417f));if(_0x4a417f[_0xfd93('0x13')]){if(_0x4a417f['error'][_0xfd93('0x14')]===0x1f4){logger[_0xfd93('0x13')](_0xfd93('0xe'),_0x184c34,_0x4a417f[_0xfd93('0x13')][_0xfd93('0x15')]);return _0x15b1c4(_0x4a417f[_0xfd93('0x13')][_0xfd93('0x15')]);}logger[_0xfd93('0x13')](_0xfd93('0xe'),_0x184c34,_0x4a417f['error'][_0xfd93('0x15')]);return _0x1928ba(_0x4a417f[_0xfd93('0x13')][_0xfd93('0x15')]);}else{logger[_0xfd93('0xd')](_0xfd93('0xe'),_0x184c34,_0xfd93('0xf'));_0x1928ba(_0x4a417f[_0xfd93('0x16')][_0xfd93('0x15')]);}})[_0xfd93('0x17')](function(_0x43af4d){logger['error'](_0xfd93('0xe'),_0x184c34,_0x43af4d);_0x15b1c4(_0x43af4d);});});}exports[_0xfd93('0x18')]=function(_0x16dda0){var _0x1e2399=this;return new Promise(function(_0x55d47b,_0x195e68){return db['Trigger'][_0xfd93('0x19')]({'raw':_0x16dda0[_0xfd93('0x1a')]?_0x16dda0['options'][_0xfd93('0x1b')]===undefined?!![]:![]:!![],'where':_0x16dda0[_0xfd93('0x1a')]?_0x16dda0['options'][_0xfd93('0x1c')]||null:null,'attributes':_0x16dda0['options']?_0x16dda0[_0xfd93('0x1a')]['attributes']||null:null,'limit':_0x16dda0[_0xfd93('0x1a')]?_0x16dda0['options'][_0xfd93('0x1d')]||null:null,'include':_0x16dda0[_0xfd93('0x1a')]?_0x16dda0[_0xfd93('0x1a')][_0xfd93('0x1e')]?_[_0xfd93('0x1f')](_0x16dda0['options'][_0xfd93('0x1e')],function(_0x224bac){return{'model':db[_0x224bac[_0xfd93('0x20')]],'as':_0x224bac['as'],'attributes':_0x224bac['attributes'],'include':_0x224bac[_0xfd93('0x1e')]?_[_0xfd93('0x1f')](_0x224bac[_0xfd93('0x1e')],function(_0x1d1ba9){return{'model':db[_0x1d1ba9['model']],'as':_0x1d1ba9['as'],'attributes':_0x1d1ba9[_0xfd93('0x21')],'include':_0x1d1ba9[_0xfd93('0x1e')]?_[_0xfd93('0x1f')](_0x1d1ba9[_0xfd93('0x1e')],function(_0x4a50f7){return{'model':db[_0x4a50f7[_0xfd93('0x20')]],'as':_0x4a50f7['as'],'attributes':_0x4a50f7[_0xfd93('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfd93('0xc')](function(_0x37ecef){logger['info'](_0xfd93('0x18'),_0x16dda0);logger['debug'](_0xfd93('0x18'),_0x16dda0,JSON[_0xfd93('0x12')](_0x37ecef));_0x55d47b(_0x37ecef);})[_0xfd93('0x17')](function(_0x4ebe98){logger[_0xfd93('0x13')](_0xfd93('0x18'),_0x4ebe98[_0xfd93('0x15')],_0x16dda0);_0x195e68(_0x1e2399[_0xfd93('0x13')](0x1f4,_0x4ebe98[_0xfd93('0x15')]));});});};exports[_0xfd93('0x22')]=function(_0x191fcc){var _0x500469=this;return new Promise(function(_0x1a7533,_0x11240b){return db[_0xfd93('0x23')][_0xfd93('0x24')]({'raw':_0x191fcc[_0xfd93('0x1a')]?_0x191fcc[_0xfd93('0x1a')][_0xfd93('0x1b')]===undefined?!![]:![]:!![],'where':_0x191fcc[_0xfd93('0x1a')]?_0x191fcc['options'][_0xfd93('0x1c')]||null:null,'attributes':_0x191fcc[_0xfd93('0x1a')]?_0x191fcc[_0xfd93('0x1a')][_0xfd93('0x21')]||null:null,'include':_0x191fcc['options']?_0x191fcc[_0xfd93('0x1a')][_0xfd93('0x1e')]?_['map'](_0x191fcc[_0xfd93('0x1a')][_0xfd93('0x1e')],function(_0x107cb3){return{'model':db[_0x107cb3[_0xfd93('0x20')]],'as':_0x107cb3['as'],'attributes':_0x107cb3['attributes'],'include':_0x107cb3[_0xfd93('0x1e')]?_['map'](_0x107cb3[_0xfd93('0x1e')],function(_0x1ad17e){return{'model':db[_0x1ad17e[_0xfd93('0x20')]],'as':_0x1ad17e['as'],'attributes':_0x1ad17e[_0xfd93('0x21')],'include':_0x1ad17e[_0xfd93('0x1e')]?_[_0xfd93('0x1f')](_0x1ad17e[_0xfd93('0x1e')],function(_0x587c91){return{'model':db[_0x587c91['model']],'as':_0x587c91['as'],'attributes':_0x587c91['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd93('0xc')](function(_0x5da0c6){logger['info'](_0xfd93('0x22'),_0x191fcc);logger['debug']('ShowTrigger',_0x191fcc,JSON[_0xfd93('0x12')](_0x5da0c6));_0x1a7533(_0x5da0c6);})[_0xfd93('0x17')](function(_0x298cb6){logger[_0xfd93('0x13')](_0xfd93('0x22'),_0x298cb6[_0xfd93('0x15')],_0x191fcc);_0x11240b(_0x500469['error'](0x1f4,_0x298cb6[_0xfd93('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index c2c3747..43a786c 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 _0xcd34=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','post','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra'];(function(_0xf93d7f,_0xdb2d1c){var _0x4a660a=function(_0x1055d0){while(--_0x1055d0){_0xf93d7f['push'](_0xf93d7f['shift']());}};_0x4a660a(++_0xdb2d1c);}(_0xcd34,0x10c));var _0x4cd3=function(_0x4f922b,_0x262ffb){_0x4f922b=_0x4f922b-0x0;var _0x3e3694=_0xcd34[_0x4f922b];return _0x3e3694;};'use strict';var multer=require(_0x4cd3('0x0'));var util=require('util');var path=require(_0x4cd3('0x1'));var timeout=require(_0x4cd3('0x2'));var express=require('express');var router=express[_0x4cd3('0x3')]();var fs_extra=require(_0x4cd3('0x4'));var auth=require(_0x4cd3('0x5'));var interaction=require(_0x4cd3('0x6'));var config=require(_0x4cd3('0x7'));var controller=require(_0x4cd3('0x8'));router[_0x4cd3('0x9')]('/',auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xb')]);router[_0x4cd3('0x9')](_0x4cd3('0xc'),auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xd')]);router['post'](_0x4cd3('0xe'),auth[_0x4cd3('0xa')](),controller[_0x4cd3('0xf')]);router[_0x4cd3('0x10')]('/',auth[_0x4cd3('0xa')](),controller['create']);router[_0x4cd3('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x4cd3('0x12')]);router[_0x4cd3('0x13')](_0x4cd3('0xc'),auth['isAuthenticated'](),controller[_0x4cd3('0x14')]);module['exports']=router; \ No newline at end of file +var _0xeab4=['./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','create','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x15b298,_0x5bd763){var _0x301ee4=function(_0x46910e){while(--_0x46910e){_0x15b298['push'](_0x15b298['shift']());}};_0x301ee4(++_0x5bd763);}(_0xeab4,0xf5));var _0x4eab=function(_0x56f732,_0x12b050){_0x56f732=_0x56f732-0x0;var _0x2089ed=_0xeab4[_0x56f732];return _0x2089ed;};'use strict';var multer=require('multer');var util=require(_0x4eab('0x0'));var path=require('path');var timeout=require(_0x4eab('0x1'));var express=require('express');var router=express[_0x4eab('0x2')]();var fs_extra=require(_0x4eab('0x3'));var auth=require(_0x4eab('0x4'));var interaction=require(_0x4eab('0x5'));var config=require(_0x4eab('0x6'));var controller=require(_0x4eab('0x7'));router['get']('/',auth[_0x4eab('0x8')](),controller[_0x4eab('0x9')]);router[_0x4eab('0xa')](_0x4eab('0xb'),auth[_0x4eab('0x8')](),controller[_0x4eab('0xc')]);router[_0x4eab('0xd')](_0x4eab('0xe'),auth[_0x4eab('0x8')](),controller['clone']);router[_0x4eab('0xd')]('/',auth[_0x4eab('0x8')](),controller[_0x4eab('0xf')]);router[_0x4eab('0x10')]('/:id',auth[_0x4eab('0x8')](),controller[_0x4eab('0x11')]);router[_0x4eab('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x4eab('0x13')]);module[_0x4eab('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 12e1036..0459e33 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 _0x4186=['BOOLEAN','exports','name','ENUM','friend','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','transport','getDataValue','rfc2833','info','shortinfo','auto','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac','uas','pai','fingerprint','certificate','passive','dynamic','nonat'];(function(_0xb30a60,_0x19580f){var _0x381a7b=function(_0x27f846){while(--_0x27f846){_0xb30a60['push'](_0xb30a60['shift']());}};_0x381a7b(++_0x19580f);}(_0x4186,0x189));var _0x6418=function(_0x102b0c,_0x33dee4){_0x102b0c=_0x102b0c-0x0;var _0x9b15ca=_0x4186[_0x102b0c];return _0x9b15ca;};'use strict';var Sequelize=require('sequelize');module[_0x6418('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6418('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x3'),'user','peer'),'allowNull':![],'defaultValue':_0x6418('0x3')},'context':{'type':Sequelize[_0x6418('0x4')],'allowNull':![],'defaultValue':_0x6418('0x5')},'callingpres':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x6'),_0x6418('0x7'),'ALLOWED_FAILED_SCREEN',_0x6418('0x8'),_0x6418('0x9'),_0x6418('0xa'),_0x6418('0xb'),_0x6418('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x6418('0x4')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x6418('0x4')]},'transport':{'type':Sequelize[_0x6418('0x4')],'defaultValue':'udp','set':function(_0x34b589){this[_0x6418('0xd')]('transport',_0x34b589?_0x34b589[_0x6418('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x6418('0xf'))?this[_0x6418('0x10')](_0x6418('0xf'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x6418('0x11'),_0x6418('0x12'),_0x6418('0x13'),'inband',_0x6418('0x14')),'defaultValue':_0x6418('0x11')},'directmedia':{'type':Sequelize[_0x6418('0x2')]('yes','no','nonat',_0x6418('0x15'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6418('0x4')]},'directmediadeny':{'type':Sequelize[_0x6418('0x4')]},'nat':{'type':Sequelize[_0x6418('0x4')],'defaultValue':_0x6418('0x17'),'set':function(_0x79bd2d){this[_0x6418('0xd')](_0x6418('0x18'),_0x79bd2d?_0x79bd2d[_0x6418('0xe')](','):null);},'get':function(){return this[_0x6418('0x10')](_0x6418('0x18'))?this[_0x6418('0x10')](_0x6418('0x18'))['split'](','):null;},'comment':_0x6418('0x19')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x6418('0x4')]},'pickupgroup':{'type':Sequelize[_0x6418('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x6418('0x4')]},'language':{'type':Sequelize[_0x6418('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x6418('0x1a')},'allow':{'type':Sequelize[_0x6418('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x332aac){this['setDataValue']('allow',_0x332aac?_0x332aac[_0x6418('0xe')](';'):_0x6418('0x1b'));},'get':function(){return this[_0x6418('0x10')](_0x6418('0x1c'))?this[_0x6418('0x10')](_0x6418('0x1c'))[_0x6418('0x1d')](';'):null;},'comment':_0x6418('0x1e')},'autoframing':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'insecure':{'type':Sequelize[_0x6418('0x4')],'defaultValue':_0x6418('0x1f'),'set':function(_0x1b258b){this[_0x6418('0xd')](_0x6418('0x20'),_0x1b258b?_0x1b258b[_0x6418('0xe')](','):null);},'get':function(){return this[_0x6418('0x10')](_0x6418('0x20'))?this[_0x6418('0x10')]('insecure')[_0x6418('0x1d')](','):null;},'comment':_0x6418('0x21')},'trustrpid':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6418('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x6418('0x16'),'no',_0x6418('0x22'))},'promiscredir':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'accountcode':{'type':Sequelize[_0x6418('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x6418('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x6418('0x16'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x6418('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x6418('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x6418('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x6418('0x2')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x6418('0x4')]},'template':{'type':Sequelize[_0x6418('0x4')]},'videosupport':{'type':Sequelize['ENUM'](_0x6418('0x16'),'no',_0x6418('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6418('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'mailbox':{'type':Sequelize[_0x6418('0x4')]},'session_timers':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x26'),_0x6418('0x27'),'originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x6418('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x28'),_0x6418('0x29')),'defaultValue':_0x6418('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x6418('0x4')]},'regexten':{'type':Sequelize[_0x6418('0x4')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x6418('0x4')]},'port':{'type':Sequelize[_0x6418('0x23')](0x5)},'qualify':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no'),'defaultValue':_0x6418('0x16')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x6418('0x4')]},'defaultuser':{'type':Sequelize[_0x6418('0x4')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x6418('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x6418('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x6418('0x2')]('yes','no',_0x6418('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6418('0x4')]},'callbackextension':{'type':Sequelize[_0x6418('0x4')]},'timert1':{'type':Sequelize[_0x6418('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x6418('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x6418('0x4')]},'contactdeny':{'type':Sequelize[_0x6418('0x4')]},'contactacl':{'type':Sequelize[_0x6418('0x4')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x6418('0x23')](0xb)},'encryption':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6418('0x2')]('yes','no')},'force_avp':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'icesupport':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'dtlsenable':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x6418('0x16'),'no',_0x6418('0x2b'),_0x6418('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x6418('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x6418('0x4')]},'dtlsprivatekey':{'type':Sequelize[_0x6418('0x4')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x6418('0x4')]},'dtlscapath':{'type':Sequelize[_0x6418('0x4')]},'dtlssetup':{'type':Sequelize[_0x6418('0x2')]('active',_0x6418('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x6418('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x6418('0x4')]},'call_limit':{'type':Sequelize[_0x6418('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x6418('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no')},'vmexten':{'type':Sequelize[_0x6418('0x4')]},'mohinterpret':{'type':Sequelize[_0x6418('0x4')]},'mohsuggest':{'type':Sequelize[_0x6418('0x4')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6418('0x4')]},'host':{'type':Sequelize[_0x6418('0x4')],'defaultValue':_0x6418('0x2e')},'canreinvite':{'type':Sequelize[_0x6418('0x2')](_0x6418('0x16'),'no',_0x6418('0x2f'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x6418('0x4')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x6418('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x6418('0x4')],'defaultValue':'no'}}; \ No newline at end of file +var _0x1c3e=['PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','insecure','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','active','passive','actpass','dynamic','update,nonat','BOOLEAN','exports','STRING','name','friend','peer','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED'];(function(_0x3cfe6c,_0x71345c){var _0x1776bd=function(_0x41c884){while(--_0x41c884){_0x3cfe6c['push'](_0x3cfe6c['shift']());}};_0x1776bd(++_0x71345c);}(_0x1c3e,0x127));var _0xe1c3=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x1c3e[_0x11946c];return _0x383935;};'use strict';var Sequelize=require('sequelize');module[_0xe1c3('0x0')]={'name':{'type':Sequelize[_0xe1c3('0x1')],'allowNull':![],'unique':_0xe1c3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe1c3('0x3'),'user',_0xe1c3('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xe1c3('0x1')],'allowNull':![],'defaultValue':_0xe1c3('0x5')},'callingpres':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x7'),_0xe1c3('0x8'),_0xe1c3('0x9'),'ALLOWED',_0xe1c3('0xa'),_0xe1c3('0xb'),_0xe1c3('0xc'),_0xe1c3('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xe1c3('0x1')]},'secret':{'type':Sequelize[_0xe1c3('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xe1c3('0x1')]},'transport':{'type':Sequelize[_0xe1c3('0x1')],'defaultValue':_0xe1c3('0xe'),'set':function(_0x32959f){this['setDataValue'](_0xe1c3('0xf'),_0x32959f?_0x32959f[_0xe1c3('0x10')](','):null);},'get':function(){return this[_0xe1c3('0x11')](_0xe1c3('0xf'))?this['getDataValue'](_0xe1c3('0xf'))[_0xe1c3('0x12')](','):null;},'comment':_0xe1c3('0x13')},'dtmfmode':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x14'),_0xe1c3('0x15'),_0xe1c3('0x16'),_0xe1c3('0x17'),_0xe1c3('0x18')),'defaultValue':_0xe1c3('0x14')},'directmedia':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no',_0xe1c3('0x1a'),_0xe1c3('0x1b'),_0xe1c3('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe1c3('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe1c3('0x1')]},'directmediadeny':{'type':Sequelize[_0xe1c3('0x1')]},'nat':{'type':Sequelize[_0xe1c3('0x1')],'defaultValue':_0xe1c3('0x1d'),'set':function(_0x1b6f77){this[_0xe1c3('0x1e')](_0xe1c3('0x1f'),_0x1b6f77?_0x1b6f77['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0xe1c3('0x11')](_0xe1c3('0x1f'))[_0xe1c3('0x12')](','):null;},'comment':_0xe1c3('0x20')},'callgroup':{'type':Sequelize[_0xe1c3('0x1')]},'namedcallgroup':{'type':Sequelize[_0xe1c3('0x1')]},'pickupgroup':{'type':Sequelize[_0xe1c3('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe1c3('0x1')]},'language':{'type':Sequelize[_0xe1c3('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xe1c3('0x21')},'allow':{'type':Sequelize[_0xe1c3('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x29a654){this[_0xe1c3('0x1e')]('allow',_0x29a654?_0x29a654[_0xe1c3('0x10')](';'):_0xe1c3('0x22'));},'get':function(){return this[_0xe1c3('0x11')]('allow')?this[_0xe1c3('0x11')]('allow')[_0xe1c3('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no')},'insecure':{'type':Sequelize[_0xe1c3('0x1')],'defaultValue':'port,invite','set':function(_0x5ada5b){this[_0xe1c3('0x1e')](_0xe1c3('0x23'),_0x5ada5b?_0x5ada5b[_0xe1c3('0x10')](','):null);},'get':function(){return this[_0xe1c3('0x11')](_0xe1c3('0x23'))?this['getDataValue'](_0xe1c3('0x23'))[_0xe1c3('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no')},'accountcode':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xe1c3('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no'),'defaultValue':_0xe1c3('0x19')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xe1c3('0x6')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xe1c3('0x1')]},'template':{'type':Sequelize[_0xe1c3('0x1')]},'videosupport':{'type':Sequelize[_0xe1c3('0x6')]('yes','no',_0xe1c3('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no')},'mailbox':{'type':Sequelize[_0xe1c3('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0xe1c3('0x27'),_0xe1c3('0x28'),_0xe1c3('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x2a'),'uas'),'defaultValue':_0xe1c3('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xe1c3('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xe1c3('0x1')]},'fromuser':{'type':Sequelize[_0xe1c3('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no'),'defaultValue':_0xe1c3('0x19')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xe1c3('0x1')]},'defaultuser':{'type':Sequelize[_0xe1c3('0x1')]},'rtptimeout':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe1c3('0x1')]},'callbackextension':{'type':Sequelize[_0xe1c3('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xe1c3('0x1')]},'contactdeny':{'type':Sequelize[_0xe1c3('0x1')]},'contactacl':{'type':Sequelize[_0xe1c3('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xe1c3('0x1')]},'maxforwards':{'type':Sequelize[_0xe1c3('0x24')](0xb)},'encryption':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no')},'icesupport':{'type':Sequelize[_0xe1c3('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no',_0xe1c3('0x2c'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe1c3('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xe1c3('0x1')]},'dtlscipher':{'type':Sequelize[_0xe1c3('0x1')]},'dtlscafile':{'type':Sequelize[_0xe1c3('0x1')]},'dtlscapath':{'type':Sequelize[_0xe1c3('0x1')]},'dtlssetup':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x2d'),_0xe1c3('0x2e'),_0xe1c3('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe1c3('0x1')]},'usereqphone':{'type':Sequelize[_0xe1c3('0x6')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe1c3('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xe1c3('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0xe1c3('0x6')](_0xe1c3('0x19'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xe1c3('0x1')]},'parkinglot':{'type':Sequelize[_0xe1c3('0x1')]},'description':{'type':Sequelize[_0xe1c3('0x1')]},'host':{'type':Sequelize[_0xe1c3('0x1')],'defaultValue':_0xe1c3('0x30')},'canreinvite':{'type':Sequelize['ENUM'](_0xe1c3('0x19'),'no','nonat','update',_0xe1c3('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe1c3('0x1')]},'otherFields':{'type':Sequelize[_0xe1c3('0x1')]},'active':{'type':Sequelize[_0xe1c3('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe1c3('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 31002ef..d56b055 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 _0xedd9=['body','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trunk,\x20%s,\x20%s','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','Trunks','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','Trunk','findAll','rows','show','params','length','find','omit'];(function(_0x146904,_0x424b32){var _0x236889=function(_0x215f21){while(--_0x215f21){_0x146904['push'](_0x146904['shift']());}};_0x236889(++_0x424b32);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a08bc,_0xf2e46f){_0x5a08bc=_0x5a08bc-0x0;var _0x5693a0=_0xedd9[_0x5a08bc];return _0x5693a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];var jayson=require(_0x9edd('0x18'));var client=jayson[_0x9edd('0x19')][_0x9edd('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xfca576,_0xef5498,_0x47eb64,_0x176bfa){return new BPromise(function(_0x44fc7c,_0x891832){var _0x4d9a7=_0x176bfa||client;return _0x4d9a7[_0x9edd('0x1b')](_0xfca576,_0x47eb64)[_0x9edd('0x1c')](function(_0x1042aa){logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x9edd('0x1e'));logger[_0x9edd('0x1f')](_0x9edd('0x20'),_0xef5498,'request\x20sent',JSON[_0x9edd('0x21')](_0x1042aa));if(_0x1042aa[_0x9edd('0x22')]){if(_0x1042aa[_0x9edd('0x22')]['code']===0x1f4){logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')][_0x9edd('0x23')]);return _0x891832(_0x1042aa['error']['message']);}logger[_0x9edd('0x22')]('Trunk,\x20%s,\x20%s',_0xef5498,_0x1042aa[_0x9edd('0x22')]['message']);return _0x44fc7c(_0x1042aa['error'][_0x9edd('0x23')]);}else{logger[_0x9edd('0x1d')]('Trunk,\x20%s,\x20%s',_0xef5498,'request\x20sent');_0x44fc7c(_0x1042aa[_0x9edd('0x24')][_0x9edd('0x23')]);}})[_0x9edd('0x25')](function(_0x542172){logger[_0x9edd('0x22')](_0x9edd('0x26'),_0xef5498,_0x542172);_0x891832(_0x542172);});});}function respondWithStatusCode(_0x44a6c1,_0x2ca65f){_0x2ca65f=_0x2ca65f||0xcc;return function(_0x339a0d){if(_0x339a0d){return _0x44a6c1['sendStatus'](_0x2ca65f);}return _0x44a6c1[_0x9edd('0x27')](_0x2ca65f)[_0x9edd('0x28')]();};}function respondWithResult(_0x3a1ea5,_0x2f9f86){_0x2f9f86=_0x2f9f86||0xc8;return function(_0x310a4d){if(_0x310a4d){return _0x3a1ea5['status'](_0x2f9f86)['json'](_0x310a4d);}};}function respondWithFilteredResult(_0x3276ee,_0xfeca7b){return function(_0x8d67aa){if(_0x8d67aa){var _0x25e135=typeof _0xfeca7b[_0x9edd('0x29')]==='undefined'&&typeof _0xfeca7b['limit']===_0x9edd('0x2a');var _0x257a26=_0x8d67aa[_0x9edd('0x2b')];var _0x52746a=_0x25e135?0x0:_0xfeca7b[_0x9edd('0x29')];var _0x28cfae=_0x25e135?_0x8d67aa[_0x9edd('0x2b')]:_0xfeca7b[_0x9edd('0x29')]+_0xfeca7b['limit'];var _0x2155a1;if(_0x28cfae>=_0x257a26){_0x28cfae=_0x257a26;_0x2155a1=0xc8;}else{_0x2155a1=0xce;}_0x3276ee[_0x9edd('0x27')](_0x2155a1);return _0x3276ee[_0x9edd('0x2c')](_0x9edd('0x2d'),_0x52746a+'-'+_0x28cfae+'/'+_0x257a26)[_0x9edd('0x2e')](_0x8d67aa);}return null;};}function patchUpdates(_0x42e664){return function(_0x209aba){try{jsonpatch[_0x9edd('0x2f')](_0x209aba,_0x42e664,!![]);}catch(_0x19b6c1){return BPromise[_0x9edd('0x30')](_0x19b6c1);}return _0x209aba[_0x9edd('0x31')]();};}function saveUpdates(_0x138002,_0x6907a5){return function(_0xa55906){if(_0xa55906){return _0xa55906[_0x9edd('0x32')](_0x138002)['then'](function(_0x1453d2){return _0x1453d2;});}return null;};}function removeEntity(_0x259259,_0x267c74){return function(_0x5d1707){if(_0x5d1707){return _0x5d1707[_0x9edd('0x33')]()[_0x9edd('0x1c')](function(){var _0xde9b13=_0x5d1707[_0x9edd('0x34')]({'plain':!![]});var _0x21bc30=_0x9edd('0x35');return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'type':_0x21bc30,'resourceId':_0xde9b13['id']}})[_0x9edd('0x1c')](function(){return _0x5d1707;});})[_0x9edd('0x1c')](function(){_0x259259[_0x9edd('0x27')](0xcc)[_0x9edd('0x28')]();});}};}function handleEntityNotFound(_0x27eb7e,_0x14f780){return function(_0x5757fc){if(!_0x5757fc){_0x27eb7e[_0x9edd('0x37')](0x194);}return _0x5757fc;};}function handleError(_0x5ed62d,_0x968303){_0x968303=_0x968303||0x1f4;return function(_0x148630){logger[_0x9edd('0x22')](_0x148630[_0x9edd('0x38')]);if(_0x148630[_0x9edd('0x39')]){delete _0x148630['name'];}_0x5ed62d[_0x9edd('0x27')](_0x968303)[_0x9edd('0x3a')](_0x148630);};}exports[_0x9edd('0x3b')]=function(_0x38e9be,_0x1be77f){var _0x337e6c={},_0x5c0627={},_0x1cbbac={'count':0x0,'rows':[]};var _0x1ccee8=_[_0x9edd('0x3c')](db['Trunk'][_0x9edd('0x3d')],function(_0x56a228){return{'name':_0x56a228[_0x9edd('0x3e')],'type':_0x56a228['type'][_0x9edd('0x3f')]};});_0x5c0627[_0x9edd('0x40')]=_[_0x9edd('0x3c')](_0x1ccee8,'name');_0x5c0627[_0x9edd('0x41')]=_[_0x9edd('0x42')](_0x38e9be[_0x9edd('0x41')]);_0x5c0627['filters']=_[_0x9edd('0x43')](_0x5c0627['model'],_0x5c0627[_0x9edd('0x41')]);_0x337e6c[_0x9edd('0x44')]=_['intersection'](_0x5c0627[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x45')]));_0x337e6c['attributes']=_0x337e6c[_0x9edd('0x44')]['length']?_0x337e6c[_0x9edd('0x44')]:_0x5c0627[_0x9edd('0x40')];if(!_0x38e9be['query'][_0x9edd('0x46')]('nolimit')){_0x337e6c['limit']=qs[_0x9edd('0x47')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x47')]);_0x337e6c[_0x9edd('0x29')]=qs[_0x9edd('0x29')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x29')]);}_0x337e6c[_0x9edd('0x48')]=qs[_0x9edd('0x49')](_0x38e9be[_0x9edd('0x41')][_0x9edd('0x49')]);_0x337e6c[_0x9edd('0x4a')]=qs[_0x9edd('0x4b')](_[_0x9edd('0x4c')](_0x38e9be[_0x9edd('0x41')],_0x5c0627['filters']),_0x1ccee8);if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x4d')]){_0x337e6c[_0x9edd('0x4a')]=_[_0x9edd('0x4e')](_0x337e6c[_0x9edd('0x4a')],{'$or':_[_0x9edd('0x3c')](_0x1ccee8,function(_0x10d41e){if(_0x10d41e['type']!=='VIRTUAL'){var _0x4bc7a1={};_0x4bc7a1[_0x10d41e[_0x9edd('0x39')]]={'$like':'%'+_0x38e9be['query'][_0x9edd('0x4d')]+'%'};return _0x4bc7a1;}})});}_0x337e6c=_[_0x9edd('0x4e')]({},_0x337e6c,_0x38e9be[_0x9edd('0x4f')]);var _0x8db801={'where':_0x337e6c[_0x9edd('0x4a')]};return db['Trunk'][_0x9edd('0x2b')](_0x8db801)[_0x9edd('0x1c')](function(_0x40e33d){_0x1cbbac['count']=_0x40e33d;if(_0x38e9be[_0x9edd('0x41')][_0x9edd('0x50')]){_0x337e6c[_0x9edd('0x51')]=[{'all':!![]}];}return db[_0x9edd('0x52')][_0x9edd('0x53')](_0x337e6c);})[_0x9edd('0x1c')](function(_0x4d4f33){_0x1cbbac[_0x9edd('0x54')]=_0x4d4f33;return _0x1cbbac;})[_0x9edd('0x1c')](respondWithFilteredResult(_0x1be77f,_0x337e6c))['catch'](handleError(_0x1be77f,null));};exports[_0x9edd('0x55')]=function(_0x8d8701,_0x4bb324){var _0x2bd089={'raw':![],'where':{'id':_0x8d8701[_0x9edd('0x56')]['id']}},_0x8134cd={};_0x8134cd['model']=_[_0x9edd('0x42')](db[_0x9edd('0x52')][_0x9edd('0x3d')]);_0x8134cd[_0x9edd('0x41')]=_['keys'](_0x8d8701[_0x9edd('0x41')]);_0x8134cd[_0x9edd('0x4b')]=_[_0x9edd('0x43')](_0x8134cd['model'],_0x8134cd[_0x9edd('0x41')]);_0x2bd089[_0x9edd('0x44')]=_['intersection'](_0x8134cd[_0x9edd('0x40')],qs['fields'](_0x8d8701[_0x9edd('0x41')][_0x9edd('0x45')]));_0x2bd089[_0x9edd('0x44')]=_0x2bd089[_0x9edd('0x44')][_0x9edd('0x57')]?_0x2bd089[_0x9edd('0x44')]:_0x8134cd[_0x9edd('0x40')];if(_0x8d8701[_0x9edd('0x41')][_0x9edd('0x50')]){_0x2bd089[_0x9edd('0x51')]=[{'all':!![]}];}_0x2bd089=_[_0x9edd('0x4e')]({},_0x2bd089,_0x8d8701['options']);return db[_0x9edd('0x52')][_0x9edd('0x58')](_0x2bd089)[_0x9edd('0x1c')](handleEntityNotFound(_0x4bb324,null))['then'](respondWithResult(_0x4bb324,null))[_0x9edd('0x25')](handleError(_0x4bb324,null));};exports['clone']=function(_0x54d83d,_0x54ecfa){var _0x1348a7={'where':{'id':_0x54d83d[_0x9edd('0x56')]['id']}},_0x45f47c={};_0x45f47c[_0x9edd('0x40')]=_['keys'](db['Trunk']['rawAttributes']);_0x1348a7[_0x9edd('0x44')]=_[_0x9edd('0x43')](_0x45f47c[_0x9edd('0x40')],qs[_0x9edd('0x45')](_0x54d83d[_0x9edd('0x41')][_0x9edd('0x45')]));_0x1348a7[_0x9edd('0x44')]=_0x1348a7[_0x9edd('0x44')]['length']?_0x1348a7[_0x9edd('0x44')]:_0x45f47c['model'];if(_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]){_0x1348a7['include']=[{'all':!![]}];}_0x1348a7=_[_0x9edd('0x4e')]({},_0x1348a7,_0x54d83d[_0x9edd('0x4f')]);return db[_0x9edd('0x52')]['find'](_0x1348a7)[_0x9edd('0x1c')](handleEntityNotFound(_0x54ecfa,null))[_0x9edd('0x1c')](function(_0x430eb4){if(_0x430eb4){var _0x15ebfa=_0x430eb4[_0x9edd('0x34')]({'plain':!![]});_0x15ebfa=qs[_0x9edd('0x59')](_0x15ebfa,['id','createdAt','updatedAt']);_0x54d83d[_0x9edd('0x5a')]=_['omit'](_0x54d83d[_0x9edd('0x5a')],['id',_0x9edd('0x5b'),_0x9edd('0x5c')]);return db[_0x9edd('0x52')]['create'](_[_0x9edd('0x4e')](_0x15ebfa,_0x54d83d['body']),{'include':_0x54d83d[_0x9edd('0x41')][_0x9edd('0x50')]?[{'all':!![]}]:undefined})[_0x9edd('0x1c')](function(_0x5ca123){var _0x2651a2=_0x54d83d['user'][_0x9edd('0x34')]({'plain':!![]});if(!_0x2651a2)throw new Error(_0x9edd('0x5d'));if(_0x2651a2['role']===_0x9edd('0x5e')){var _0x4a72d0=_0x5ca123[_0x9edd('0x34')]({'plain':!![]});var _0x134c9c=_0x9edd('0x35');return db['UserProfileSection'][_0x9edd('0x58')]({'where':{'name':_0x134c9c,'userProfileId':_0x2651a2[_0x9edd('0x5f')]},'raw':!![]})[_0x9edd('0x1c')](function(_0x2015fc){if(_0x2015fc&&_0x2015fc[_0x9edd('0x60')]===0x0){return db['UserProfileResource']['create']({'name':_0x4a72d0[_0x9edd('0x39')],'resourceId':_0x4a72d0['id'],'type':_0x2015fc[_0x9edd('0x39')],'sectionId':_0x2015fc['id']},{})['then'](function(){return _0x5ca123;});}else{return _0x5ca123;}})['catch'](function(_0x52afd7){logger[_0x9edd('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52afd7);throw _0x52afd7;});}return _0x5ca123;});}})['then'](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x25')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x61')]=function(_0x589348,_0xb9ebeb,_0x11e082){var _0x34dff5;return db['Trunk'][_0x9edd('0x61')](_0x589348['body'],{'raw':!![]})[_0x9edd('0x1c')](function(_0x18d1a0){_0x34dff5=_0x18d1a0;return db['Trunk'][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x5c1746){var _0x2bd6d1=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/trunk.ejs'),_0x9edd('0x65'));var _0x58330c=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],'server/files/templates/registry.ejs'),_0x9edd('0x65'));var _0x286593=ejs[_0x9edd('0x66')](_0x2bd6d1,{'trunks':_0x5c1746||[]});fs[_0x9edd('0x67')](_0x9edd('0x68'),_0x286593);if(_0x34dff5[_0x9edd('0x69')]){var _0x3fa4a9=ejs['render'](_0x58330c,{'trunks':_0x5c1746||[]});fs['writeFileSync'](_0x9edd('0x6a'),_0x3fa4a9);}})[_0x9edd('0x1c')](function(){return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x61'),{'module':_0x9edd('0x6c')});})['then'](function(){var _0x2e40c8=_0x589348[_0x9edd('0x5e')][_0x9edd('0x34')]({'plain':!![]});if(!_0x2e40c8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e40c8[_0x9edd('0x6d')]===_0x9edd('0x5e')){var _0x4b1c12=_0x34dff5[_0x9edd('0x34')]({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'name':_0x9edd('0x35'),'userProfileId':_0x2e40c8[_0x9edd('0x5f')]},'raw':!![]})['then'](function(_0x3f08ac){if(_0x3f08ac&&_0x3f08ac['autoAssociation']===0x0){return db['UserProfileResource'][_0x9edd('0x61')]({'name':_0x4b1c12[_0x9edd('0x39')],'resourceId':_0x4b1c12['id'],'type':_0x3f08ac[_0x9edd('0x39')],'sectionId':_0x3f08ac['id']},{})['then'](function(){return _0x34dff5;});}else{return _0x34dff5;}})[_0x9edd('0x25')](function(_0x286e47){logger['error'](_0x9edd('0x6f'),_0x286e47);throw _0x286e47;});}return _0x34dff5;})[_0x9edd('0x1c')](respondWithResult(_0xb9ebeb,0xc9))[_0x9edd('0x25')](handleError(_0xb9ebeb,null));};exports[_0x9edd('0x32')]=function(_0x54ac71,_0x5e68db,_0x1129b7){var _0x5bb28c;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x54ac71[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x5e68db,null))[_0x9edd('0x1c')](saveUpdates(_0x54ac71[_0x9edd('0x5a')],null))[_0x9edd('0x1c')](function(_0x5a4d4b){if(_0x5a4d4b){_0x5bb28c=_0x5a4d4b;return db[_0x9edd('0x52')]['findAll']({'raw':!![]});}})[_0x9edd('0x1c')](function(_0x3c4db7){if(_0x3c4db7){var _0x2c7562=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),'utf8');var _0x25e3e7=fs[_0x9edd('0x62')](path['join'](config[_0x9edd('0x64')],_0x9edd('0x71')),'utf8');var _0x304e56=ejs[_0x9edd('0x66')](_0x2c7562,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_trunks.conf',_0x304e56);var _0x41cd76=ejs[_0x9edd('0x66')](_0x25e3e7,{'trunks':_0x3c4db7||[]});fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x41cd76);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x9edd('0x1c')](function(_0x1a6d3d){if(_0x1a6d3d){return _0x5bb28c;}})[_0x9edd('0x1c')](respondWithResult(_0x5e68db,null))['catch'](handleError(_0x5e68db,null));};exports['destroy']=function(_0x49dc1d,_0x56d794,_0x388252){var _0x20762d;return db[_0x9edd('0x52')][_0x9edd('0x58')]({'where':{'id':_0x49dc1d[_0x9edd('0x56')]['id']}})[_0x9edd('0x1c')](handleEntityNotFound(_0x56d794,null))[_0x9edd('0x1c')](removeEntity(_0x56d794,null))[_0x9edd('0x1c')](function(){return db[_0x9edd('0x52')][_0x9edd('0x53')]({'raw':!![]});})[_0x9edd('0x1c')](function(_0x4cfa99){var _0x367fc6=fs[_0x9edd('0x62')](path[_0x9edd('0x63')](config[_0x9edd('0x64')],_0x9edd('0x70')),_0x9edd('0x65'));var _0x3d4890=fs[_0x9edd('0x62')](path['join'](config['root'],_0x9edd('0x71')),'utf8');var _0x35950b=ejs['render'](_0x367fc6,{'trunks':_0x4cfa99});var _0x21c35f=ejs[_0x9edd('0x66')](_0x3d4890,{'trunks':_0x4cfa99});fs['writeFileSync'](_0x9edd('0x68'),_0x35950b);fs[_0x9edd('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x21c35f);return respondWithRpcPromise(_0x9edd('0x6b'),_0x9edd('0x33'),{'module':_0x9edd('0x6c')});})[_0x9edd('0x25')](handleError(_0x56d794,null));}; \ No newline at end of file +var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x351e68,_0x381381){var _0x4587fd=function(_0x501e65){while(--_0x501e65){_0x351e68['push'](_0x351e68['shift']());}};_0x4587fd(++_0x381381);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x1701c9,_0xbed747){_0x1701c9=_0x1701c9-0x0;var _0x8776f0=_0xd6d6[_0x1701c9];return _0x8776f0;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 0e4785c..2883b7c 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 _0xf306=['exports','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes'];(function(_0x165b49,_0x4f2f56){var _0x57b11b=function(_0x14e1ab){while(--_0x14e1ab){_0x165b49['push'](_0x165b49['shift']());}};_0x57b11b(++_0x4f2f56);}(_0xf306,0x141));var _0x6f30=function(_0x4fb1a5,_0x43cf7f){_0x4fb1a5=_0x4fb1a5-0x0;var _0x40202e=_0xf306[_0x4fb1a5];return _0x40202e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f30('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6f30('0x1'));var rp=require(_0x6f30('0x2'));var fs=require('fs');var path=require(_0x6f30('0x3'));var rimraf=require(_0x6f30('0x4'));var config=require(_0x6f30('0x5'));var attributes=require(_0x6f30('0x6'));module[_0x6f30('0x7')]=function(_0x3f69a3,_0x45898e){return _0x3f69a3['define']('Trunk',attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa01c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','define','Trunk','tools_trunks','util'];(function(_0x2dfdc8,_0x56ff85){var _0x3c0c2a=function(_0x2418e8){while(--_0x2418e8){_0x2dfdc8['push'](_0x2dfdc8['shift']());}};_0x3c0c2a(++_0x56ff85);}(_0xa01c,0xb5));var _0xca01=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa01c[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xca01('0x0'));var logger=require(_0xca01('0x1'))(_0xca01('0x2'));var moment=require(_0xca01('0x3'));var BPromise=require(_0xca01('0x4'));var rp=require(_0xca01('0x5'));var fs=require('fs');var path=require(_0xca01('0x6'));var rimraf=require(_0xca01('0x7'));var config=require(_0xca01('0x8'));var attributes=require(_0xca01('0x9'));module['exports']=function(_0x2db0bc,_0x4fbd57){return _0x2db0bc[_0xca01('0xa')](_0xca01('0xb'),attributes,{'tableName':_0xca01('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 1b1772f..bc79f19 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 _0x3fdd=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then'];(function(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0x3fdd,0xcb));var _0xd3fd=function(_0x1b5a2a,_0x2a0575){_0x1b5a2a=_0x1b5a2a-0x0;var _0x1f000a=_0x3fdd[_0x1b5a2a];return _0x1f000a;};'use strict';var _=require(_0xd3fd('0x0'));var util=require(_0xd3fd('0x1'));var moment=require(_0xd3fd('0x2'));var BPromise=require(_0xd3fd('0x3'));var rs=require(_0xd3fd('0x4'));var fs=require('fs');var Redis=require(_0xd3fd('0x5'));var db=require(_0xd3fd('0x6'))['db'];var utils=require(_0xd3fd('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd3fd('0x8'));var jayson=require(_0xd3fd('0x9'));var client=jayson['client'][_0xd3fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12ce7c,_0x4726ca,_0x4b40fb){return new BPromise(function(_0x1bdc02,_0x10bab7){return client[_0xd3fd('0xb')](_0x12ce7c,_0x4b40fb)[_0xd3fd('0xc')](function(_0x5703e4){logger[_0xd3fd('0xd')](_0xd3fd('0xe'),_0x4726ca,_0xd3fd('0xf'));logger[_0xd3fd('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x4726ca,_0xd3fd('0xf'),JSON[_0xd3fd('0x11')](_0x5703e4));if(_0x5703e4[_0xd3fd('0x12')]){if(_0x5703e4[_0xd3fd('0x12')][_0xd3fd('0x13')]===0x1f4){logger['error'](_0xd3fd('0xe'),_0x4726ca,_0x5703e4[_0xd3fd('0x12')][_0xd3fd('0x14')]);return _0x10bab7(_0x5703e4['error'][_0xd3fd('0x14')]);}logger[_0xd3fd('0x12')](_0xd3fd('0xe'),_0x4726ca,_0x5703e4[_0xd3fd('0x12')][_0xd3fd('0x14')]);return _0x1bdc02(_0x5703e4[_0xd3fd('0x12')]['message']);}else{logger[_0xd3fd('0xd')]('Trunk,\x20%s,\x20%s',_0x4726ca,'request\x20sent');_0x1bdc02(_0x5703e4[_0xd3fd('0x15')][_0xd3fd('0x14')]);}})[_0xd3fd('0x16')](function(_0x41161f){logger[_0xd3fd('0x12')](_0xd3fd('0xe'),_0x4726ca,_0x41161f);_0x10bab7(_0x41161f);});});}exports[_0xd3fd('0x17')]=function(_0x37ad6a){var _0x1ef561=this;return new Promise(function(_0x211d98,_0x5ef1c5){return db[_0xd3fd('0x18')][_0xd3fd('0x19')]({'raw':_0x37ad6a[_0xd3fd('0x1a')]?_0x37ad6a['options'][_0xd3fd('0x1b')]===undefined?!![]:![]:!![],'where':_0x37ad6a[_0xd3fd('0x1a')]?_0x37ad6a[_0xd3fd('0x1a')][_0xd3fd('0x1c')]||null:null,'attributes':_0x37ad6a['options']?_0x37ad6a[_0xd3fd('0x1a')][_0xd3fd('0x1d')]||null:null,'limit':_0x37ad6a[_0xd3fd('0x1a')]?_0x37ad6a[_0xd3fd('0x1a')][_0xd3fd('0x1e')]||null:null,'include':_0x37ad6a[_0xd3fd('0x1a')]?_0x37ad6a[_0xd3fd('0x1a')][_0xd3fd('0x1f')]?_['map'](_0x37ad6a[_0xd3fd('0x1a')]['include'],function(_0x15164f){return{'model':db[_0x15164f['model']],'as':_0x15164f['as'],'attributes':_0x15164f['attributes'],'include':_0x15164f[_0xd3fd('0x1f')]?_[_0xd3fd('0x20')](_0x15164f['include'],function(_0x4e8b1f){return{'model':db[_0x4e8b1f[_0xd3fd('0x21')]],'as':_0x4e8b1f['as'],'attributes':_0x4e8b1f['attributes'],'include':_0x4e8b1f['include']?_[_0xd3fd('0x20')](_0x4e8b1f[_0xd3fd('0x1f')],function(_0x28c08a){return{'model':db[_0x28c08a[_0xd3fd('0x21')]],'as':_0x28c08a['as'],'attributes':_0x28c08a['attributes']};}):[]};}):[]};}):[]:[]})[_0xd3fd('0xc')](function(_0x474f86){logger['info'](_0xd3fd('0x17'),_0x37ad6a);logger['debug'](_0xd3fd('0x17'),_0x37ad6a,JSON[_0xd3fd('0x11')](_0x474f86));_0x211d98(_0x474f86);})[_0xd3fd('0x16')](function(_0x2d289f){logger[_0xd3fd('0x12')](_0xd3fd('0x17'),_0x2d289f['message'],_0x37ad6a);_0x5ef1c5(_0x1ef561[_0xd3fd('0x12')](0x1f4,_0x2d289f[_0xd3fd('0x14')]));});});};exports[_0xd3fd('0x22')]=function(_0x683699){var _0x46abcd=this;return new Promise(function(_0x1c7916,_0x12152e){return db[_0xd3fd('0x18')][_0xd3fd('0x23')]({'raw':_0x683699[_0xd3fd('0x1a')]?_0x683699[_0xd3fd('0x1a')][_0xd3fd('0x1b')]===undefined?!![]:![]:!![],'where':_0x683699[_0xd3fd('0x1a')]?_0x683699[_0xd3fd('0x1a')][_0xd3fd('0x1c')]||null:null,'attributes':_0x683699[_0xd3fd('0x1a')]?_0x683699[_0xd3fd('0x1a')][_0xd3fd('0x1d')]||null:null,'include':_0x683699[_0xd3fd('0x1a')]?_0x683699[_0xd3fd('0x1a')][_0xd3fd('0x1f')]?_[_0xd3fd('0x20')](_0x683699[_0xd3fd('0x1a')][_0xd3fd('0x1f')],function(_0x5eed81){return{'model':db[_0x5eed81[_0xd3fd('0x21')]],'as':_0x5eed81['as'],'attributes':_0x5eed81['attributes'],'include':_0x5eed81['include']?_[_0xd3fd('0x20')](_0x5eed81[_0xd3fd('0x1f')],function(_0x39100c){return{'model':db[_0x39100c[_0xd3fd('0x21')]],'as':_0x39100c['as'],'attributes':_0x39100c['attributes'],'include':_0x39100c['include']?_[_0xd3fd('0x20')](_0x39100c[_0xd3fd('0x1f')],function(_0x2eef6a){return{'model':db[_0x2eef6a[_0xd3fd('0x21')]],'as':_0x2eef6a['as'],'attributes':_0x2eef6a[_0xd3fd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd3fd('0xc')](function(_0xd5ba54){logger[_0xd3fd('0xd')](_0xd3fd('0x22'),_0x683699);logger[_0xd3fd('0x10')](_0xd3fd('0x22'),_0x683699,JSON[_0xd3fd('0x11')](_0xd5ba54));_0x1c7916(_0xd5ba54);})[_0xd3fd('0x16')](function(_0x3a3317){logger[_0xd3fd('0x12')](_0xd3fd('0x22'),_0x3a3317[_0xd3fd('0x14')],_0x683699);_0x12152e(_0x46abcd[_0xd3fd('0x12')](0x1f4,_0x3a3317[_0xd3fd('0x14')]));});});}; \ No newline at end of file +var _0x36d7=['http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','debug','ShowTrunk','find','raw','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x36d7,0x84));var _0x736d=function(_0x2c396c,_0x4db177){_0x2c396c=_0x2c396c-0x0;var _0x26219b=_0x36d7[_0x2c396c];return _0x26219b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x736d('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x736d('0x1'));var db=require(_0x736d('0x2'))['db'];var utils=require(_0x736d('0x3'));var logger=require(_0x736d('0x4'))('rpc');var config=require(_0x736d('0x5'));var jayson=require(_0x736d('0x6'));var client=jayson[_0x736d('0x7')][_0x736d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cc67e,_0x5be139,_0x539158){return new BPromise(function(_0x437710,_0x1b604d){return client[_0x736d('0x9')](_0x2cc67e,_0x539158)[_0x736d('0xa')](function(_0x200c1a){logger[_0x736d('0xb')](_0x736d('0xc'),_0x5be139,'request\x20sent');logger['debug'](_0x736d('0xd'),_0x5be139,_0x736d('0xe'),JSON[_0x736d('0xf')](_0x200c1a));if(_0x200c1a[_0x736d('0x10')]){if(_0x200c1a[_0x736d('0x10')][_0x736d('0x11')]===0x1f4){logger[_0x736d('0x10')](_0x736d('0xc'),_0x5be139,_0x200c1a[_0x736d('0x10')][_0x736d('0x12')]);return _0x1b604d(_0x200c1a['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x5be139,_0x200c1a[_0x736d('0x10')]['message']);return _0x437710(_0x200c1a['error'][_0x736d('0x12')]);}else{logger[_0x736d('0xb')]('Trunk,\x20%s,\x20%s',_0x5be139,_0x736d('0xe'));_0x437710(_0x200c1a[_0x736d('0x13')][_0x736d('0x12')]);}})[_0x736d('0x14')](function(_0x1ddc67){logger[_0x736d('0x10')](_0x736d('0xc'),_0x5be139,_0x1ddc67);_0x1b604d(_0x1ddc67);});});}exports[_0x736d('0x15')]=function(_0x1398a6){var _0x13c369=this;return new Promise(function(_0x233d8a,_0x3de36b){return db[_0x736d('0x16')][_0x736d('0x17')]({'raw':_0x1398a6[_0x736d('0x18')]?_0x1398a6['options']['raw']===undefined?!![]:![]:!![],'where':_0x1398a6['options']?_0x1398a6[_0x736d('0x18')][_0x736d('0x19')]||null:null,'attributes':_0x1398a6[_0x736d('0x18')]?_0x1398a6['options'][_0x736d('0x1a')]||null:null,'limit':_0x1398a6['options']?_0x1398a6[_0x736d('0x18')][_0x736d('0x1b')]||null:null,'include':_0x1398a6['options']?_0x1398a6[_0x736d('0x18')][_0x736d('0x1c')]?_[_0x736d('0x1d')](_0x1398a6[_0x736d('0x18')][_0x736d('0x1c')],function(_0x48da5f){return{'model':db[_0x48da5f['model']],'as':_0x48da5f['as'],'attributes':_0x48da5f[_0x736d('0x1a')],'include':_0x48da5f[_0x736d('0x1c')]?_[_0x736d('0x1d')](_0x48da5f[_0x736d('0x1c')],function(_0x5c2b18){return{'model':db[_0x5c2b18[_0x736d('0x1e')]],'as':_0x5c2b18['as'],'attributes':_0x5c2b18[_0x736d('0x1a')],'include':_0x5c2b18[_0x736d('0x1c')]?_[_0x736d('0x1d')](_0x5c2b18[_0x736d('0x1c')],function(_0x19e53c){return{'model':db[_0x19e53c['model']],'as':_0x19e53c['as'],'attributes':_0x19e53c[_0x736d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x736d('0xa')](function(_0x258a48){logger[_0x736d('0xb')](_0x736d('0x15'),_0x1398a6);logger[_0x736d('0x1f')](_0x736d('0x15'),_0x1398a6,JSON['stringify'](_0x258a48));_0x233d8a(_0x258a48);})['catch'](function(_0x39e76e){logger[_0x736d('0x10')]('GetTrunk',_0x39e76e[_0x736d('0x12')],_0x1398a6);_0x3de36b(_0x13c369[_0x736d('0x10')](0x1f4,_0x39e76e['message']));});});};exports[_0x736d('0x20')]=function(_0x227af9){var _0x1ca47c=this;return new Promise(function(_0x30cecb,_0x2f6d66){return db['Trunk'][_0x736d('0x21')]({'raw':_0x227af9[_0x736d('0x18')]?_0x227af9['options'][_0x736d('0x22')]===undefined?!![]:![]:!![],'where':_0x227af9[_0x736d('0x18')]?_0x227af9[_0x736d('0x18')][_0x736d('0x19')]||null:null,'attributes':_0x227af9[_0x736d('0x18')]?_0x227af9[_0x736d('0x18')]['attributes']||null:null,'include':_0x227af9['options']?_0x227af9[_0x736d('0x18')]['include']?_[_0x736d('0x1d')](_0x227af9['options']['include'],function(_0x48df85){return{'model':db[_0x48df85[_0x736d('0x1e')]],'as':_0x48df85['as'],'attributes':_0x48df85[_0x736d('0x1a')],'include':_0x48df85[_0x736d('0x1c')]?_[_0x736d('0x1d')](_0x48df85[_0x736d('0x1c')],function(_0x4827df){return{'model':db[_0x4827df[_0x736d('0x1e')]],'as':_0x4827df['as'],'attributes':_0x4827df[_0x736d('0x1a')],'include':_0x4827df[_0x736d('0x1c')]?_[_0x736d('0x1d')](_0x4827df['include'],function(_0x5b4daf){return{'model':db[_0x5b4daf['model']],'as':_0x5b4daf['as'],'attributes':_0x5b4daf[_0x736d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x736d('0xa')](function(_0x33f943){logger['info'](_0x736d('0x20'),_0x227af9);logger[_0x736d('0x1f')](_0x736d('0x20'),_0x227af9,JSON['stringify'](_0x33f943));_0x30cecb(_0x33f943);})['catch'](function(_0x403dd9){logger[_0x736d('0x10')]('ShowTrunk',_0x403dd9[_0x736d('0x12')],_0x227af9);_0x2f6d66(_0x1ca47c[_0x736d('0x10')](0x1f4,_0x403dd9[_0x736d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index fbd4b4d..df1e630 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x099c=['/:id','update','exports','express','Router','../../components/auth/service','./user-setting.controller','put'];(function(_0xfed299,_0x21b8d0){var _0x4ef1f2=function(_0x347a84){while(--_0x347a84){_0xfed299['push'](_0xfed299['shift']());}};_0x4ef1f2(++_0x21b8d0);}(_0x099c,0x163));var _0xc099=function(_0x1b96c6,_0x45e55a){_0x1b96c6=_0x1b96c6-0x0;var _0x4a20fa=_0x099c[_0x1b96c6];return _0x4a20fa;};'use strict';var express=require(_0xc099('0x0'));var router=express[_0xc099('0x1')]();var auth=require(_0xc099('0x2'));var controller=require(_0xc099('0x3'));router[_0xc099('0x4')](_0xc099('0x5'),auth['isAuthenticated'](),controller[_0xc099('0x6')]);module[_0xc099('0x7')]=router; \ No newline at end of file +var _0xf4ef=['Router','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0xf4ef,0x7f));var _0xff4e=function(_0x5cc8b9,_0x20e3c3){_0x5cc8b9=_0x5cc8b9-0x0;var _0x58892e=_0xf4ef[_0x5cc8b9];return _0x58892e;};'use strict';var express=require(_0xff4e('0x0'));var router=express[_0xff4e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xff4e('0x2'));router[_0xff4e('0x3')](_0xff4e('0x4'),auth[_0xff4e('0x5')](),controller[_0xff4e('0x6')]);module[_0xff4e('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 568efc3..13e662a 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9420=['sequelize','error','warning','debug','exports','BOOLEAN','TEXT','DATE','INTEGER','UserId'];(function(_0x3e0c6b,_0x52636f){var _0x4bf365=function(_0x21dce4){while(--_0x21dce4){_0x3e0c6b['push'](_0x3e0c6b['shift']());}};_0x4bf365(++_0x52636f);}(_0x9420,0x78));var _0x0942=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x9420[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x0942('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0942('0x1'),_0x0942('0x2'),'info',_0x0942('0x3')];module[_0x0942('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0942('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x0942('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0942('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x0942('0x8')],'unique':_0x0942('0x9')}}; \ No newline at end of file +var _0xb252=['INTEGER','sequelize','warning','info','exports','ENUM','error','BOOLEAN'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb252,0x119));var _0x2b25=function(_0x3d9544,_0x78d35c){_0x3d9544=_0x3d9544-0x0;var _0x2acc8f=_0xb252[_0x3d9544];return _0x2acc8f;};'use strict';var Sequelize=require(_0x2b25('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x2b25('0x1'),_0x2b25('0x2'),'debug'];module[_0x2b25('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x2b25('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x2b25('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x2b25('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x2b25('0x7')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index 5a62b16..4a375dc 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa1a5=['api','../../config/environment','../../mysqldb','socket.io-emitter','./user-setting.socket','register','redis','defaults','localhost','status','json','update','then','sendStatus','error','send','user','role','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','body','catch','lodash','../../config/logger'];(function(_0x35bdcf,_0x21421c){var _0x5a4fc7=function(_0x374f22){while(--_0x374f22){_0x35bdcf['push'](_0x35bdcf['shift']());}};_0x5a4fc7(++_0x21421c);}(_0xa1a5,0x1b8));var _0x5a1a=function(_0x45eb23,_0x4aec60){_0x45eb23=_0x45eb23-0x0;var _0xed5ddf=_0xa1a5[_0x45eb23];return _0xed5ddf;};'use strict';var _=require(_0x5a1a('0x0'));var Redis=require('ioredis');var logger=require(_0x5a1a('0x1'))(_0x5a1a('0x2'));var config=require(_0x5a1a('0x3'));var db=require(_0x5a1a('0x4'))['db'];var socket=require(_0x5a1a('0x5'))(new Redis(config['redis']));require(_0x5a1a('0x6'))[_0x5a1a('0x7')](socket);config[_0x5a1a('0x8')]=_[_0x5a1a('0x9')](config[_0x5a1a('0x8')],{'host':_0x5a1a('0xa'),'port':0x18eb});function respondWithResult(_0x1062b9,_0x59e0f6){_0x59e0f6=_0x59e0f6||0xc8;return function(_0x1ec37f){if(_0x1ec37f){return _0x1062b9[_0x5a1a('0xb')](_0x59e0f6)[_0x5a1a('0xc')](_0x1ec37f);}};}function saveUpdates(_0x34dc28){return function(_0x24ac2d){if(_0x24ac2d){return _0x24ac2d[_0x5a1a('0xd')](_0x34dc28)[_0x5a1a('0xe')](function(_0x45cf06){return _0x45cf06;});}return null;};}function handleEntityNotFound(_0x761a91){return function(_0x57c5ca){if(!_0x57c5ca){_0x761a91[_0x5a1a('0xf')](0x194);}return _0x57c5ca;};}function handleError(_0x27baef,_0x1474c2){_0x1474c2=_0x1474c2||0x1f4;return function(_0x4c9226){logger[_0x5a1a('0x10')](_0x4c9226['stack']);if(_0x4c9226['name']){delete _0x4c9226['name'];}_0x27baef[_0x5a1a('0xb')](_0x1474c2)[_0x5a1a('0x11')](_0x4c9226);};}exports[_0x5a1a('0xd')]=function(_0x1406bd,_0x567c65){if(_0x1406bd[_0x5a1a('0x12')][_0x5a1a('0x13')]!=='admin')throw new Error(_0x5a1a('0x14'));if(isNaN(Number(_0x1406bd[_0x5a1a('0x15')]['id'])))throw new Error(_0x5a1a('0x16'));return db['UserSetting'][_0x5a1a('0x17')]({'where':{'id':_0x1406bd[_0x5a1a('0x15')]['id']}})[_0x5a1a('0xe')](handleEntityNotFound(_0x567c65,null))[_0x5a1a('0xe')](saveUpdates(_0x1406bd[_0x5a1a('0x18')],null))[_0x5a1a('0xe')](respondWithResult(_0x567c65,null))[_0x5a1a('0x19')](handleError(_0x567c65,null));}; \ No newline at end of file +var _0x0ef0=['find','body','catch','lodash','ioredis','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','defaults','localhost','status','json','then','sendStatus','error','stack','name','update','role','params','Invalid\x20user\x20setting\x20id','UserSetting'];(function(_0x334e51,_0x104838){var _0x4cfe52=function(_0x344875){while(--_0x344875){_0x334e51['push'](_0x334e51['shift']());}};_0x4cfe52(++_0x104838);}(_0x0ef0,0x80));var _0x00ef=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0x0ef0[_0x138836];return _0x322688;};'use strict';var _=require(_0x00ef('0x0'));var Redis=require(_0x00ef('0x1'));var logger=require('../../config/logger')(_0x00ef('0x2'));var config=require(_0x00ef('0x3'));var db=require(_0x00ef('0x4'))['db'];var socket=require(_0x00ef('0x5'))(new Redis(config[_0x00ef('0x6')]));require(_0x00ef('0x7'))['register'](socket);config['redis']=_[_0x00ef('0x8')](config[_0x00ef('0x6')],{'host':_0x00ef('0x9'),'port':0x18eb});function respondWithResult(_0x19321c,_0x50cbde){_0x50cbde=_0x50cbde||0xc8;return function(_0x303c49){if(_0x303c49){return _0x19321c[_0x00ef('0xa')](_0x50cbde)[_0x00ef('0xb')](_0x303c49);}};}function saveUpdates(_0x1b2fb8){return function(_0x3aab3c){if(_0x3aab3c){return _0x3aab3c['update'](_0x1b2fb8)[_0x00ef('0xc')](function(_0x1d16ab){return _0x1d16ab;});}return null;};}function handleEntityNotFound(_0x2dce41){return function(_0x58cbca){if(!_0x58cbca){_0x2dce41[_0x00ef('0xd')](0x194);}return _0x58cbca;};}function handleError(_0x55c5d5,_0x1e70af){_0x1e70af=_0x1e70af||0x1f4;return function(_0xed42a9){logger[_0x00ef('0xe')](_0xed42a9[_0x00ef('0xf')]);if(_0xed42a9[_0x00ef('0x10')]){delete _0xed42a9['name'];}_0x55c5d5[_0x00ef('0xa')](_0x1e70af)['send'](_0xed42a9);};}exports[_0x00ef('0x11')]=function(_0x21ffb1,_0x49f9ee){if(_0x21ffb1['user'][_0x00ef('0x12')]!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x21ffb1[_0x00ef('0x13')]['id'])))throw new Error(_0x00ef('0x14'));return db[_0x00ef('0x15')][_0x00ef('0x16')]({'where':{'id':_0x21ffb1['params']['id']}})[_0x00ef('0xc')](handleEntityNotFound(_0x49f9ee,null))['then'](saveUpdates(_0x21ffb1[_0x00ef('0x17')],null))[_0x00ef('0xc')](respondWithResult(_0x49f9ee,null))[_0x00ef('0x18')](handleError(_0x49f9ee,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 94d63bf..73afa70 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x042c=['hook','exports','events','UserSetting','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x51f05a,_0x3ed827){var _0x29e7af=function(_0x2d2e41){while(--_0x2d2e41){_0x51f05a['push'](_0x51f05a['shift']());}};_0x29e7af(++_0x3ed827);}(_0x042c,0x107));var _0xc042=function(_0x597d60,_0x5ad4b1){_0x597d60=_0x597d60-0x0;var _0x43b771=_0x042c[_0x597d60];return _0x43b771;};'use strict';var EventEmitter=require(_0xc042('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xc042('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xc042('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc042('0x3'),'afterDestroy':_0xc042('0x4')};function emitEvent(_0x3eb0f9){return function(_0x84e4c6,_0x57b6db,_0x3115f9){UserSettingEvents[_0xc042('0x5')](_0x3eb0f9+':'+_0x84e4c6['id'],_0x84e4c6);UserSettingEvents[_0xc042('0x5')](_0x3eb0f9,_0x84e4c6);_0x3115f9(null);};}for(var e in events){if(events[_0xc042('0x6')](e)){var event=events[e];UserSetting[_0xc042('0x7')](e,emitEvent(event));}}module[_0xc042('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x91a5=['../../mysqldb','UserSetting','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x91a5,0xc0));var _0x591a=function(_0x2b81be,_0x544bdf){_0x2b81be=_0x2b81be-0x0;var _0x8ed4a7=_0x91a5[_0x2b81be];return _0x8ed4a7;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x591a('0x0'))['db'][_0x591a('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x591a('0x2')](0x0);var events={'afterCreate':_0x591a('0x3'),'afterUpdate':'update','afterDestroy':_0x591a('0x4')};function emitEvent(_0x35d1bb){return function(_0x45ac7a,_0x15dd87,_0x4a4480){UserSettingEvents[_0x591a('0x5')](_0x35d1bb+':'+_0x45ac7a['id'],_0x45ac7a);UserSettingEvents[_0x591a('0x5')](_0x35d1bb,_0x45ac7a);_0x4a4480(null);};}for(var e in events){if(events[_0x591a('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x591a('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index 66c1098..14ef9ff 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc9b=['user_settings','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting'];(function(_0x30480a,_0x57fc1d){var _0x2f3d57=function(_0x2cea5f){while(--_0x2cea5f){_0x30480a['push'](_0x30480a['shift']());}};_0x2f3d57(++_0x57fc1d);}(_0xdc9b,0x70));var _0xbdc9=function(_0x3315a7,_0x54de5d){_0x3315a7=_0x3315a7-0x0;var _0x166fbb=_0xdc9b[_0x3315a7];return _0x166fbb;};'use strict';var attributes=require(_0xbdc9('0x0'));module[_0xbdc9('0x1')]=function(_0x16319c){return _0x16319c['define'](_0xbdc9('0x2'),attributes,{'tableName':_0xbdc9('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x505175){if(!_0x505175['clientSideLoggingEnabled'])_0x505175[_0xbdc9('0x4')]=null;else if(_0x505175[_0xbdc9('0x4')]===null)_0x505175['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0xc686=['clientSideLoggingEnabledSince','UserSetting','clientSideLoggingEnabled'];(function(_0x213ae2,_0x27391f){var _0x1fbaeb=function(_0x54cf7b){while(--_0x54cf7b){_0x213ae2['push'](_0x213ae2['shift']());}};_0x1fbaeb(++_0x27391f);}(_0xc686,0x148));var _0x6c68=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xc686[_0x6131cd];return _0x47e916;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x2c78d4){return _0x2c78d4['define'](_0x6c68('0x0'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f6b6d){if(!_0x1f6b6d[_0x6c68('0x1')])_0x1f6b6d[_0x6c68('0x2')]=null;else if(_0x1f6b6d[_0x6c68('0x2')]===null)_0x1f6b6d[_0x6c68('0x2')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 113d27f..a1952a0 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfd5=['update','user-setting:update','emit','user-setting:update:user-','UserId','register','length','save','remove'];(function(_0x574c93,_0x1f6875){var _0x35912f=function(_0x3800a6){while(--_0x3800a6){_0x574c93['push'](_0x574c93['shift']());}};_0x35912f(++_0x1f6875);}(_0xcfd5,0x139));var _0x5cfd=function(_0x52a4e9,_0x2ac05a){_0x52a4e9=_0x52a4e9-0x0;var _0x584393=_0xcfd5[_0x52a4e9];return _0x584393;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x5cfd('0x0'),_0x5cfd('0x1'),_0x5cfd('0x2')];function createListener(_0x137e9d,_0x4f9ac0){return function(_0x375563){_0x4f9ac0['emit'](_0x137e9d,_0x375563);if(_0x137e9d===_0x5cfd('0x3')){_0x4f9ac0[_0x5cfd('0x4')](_0x5cfd('0x5')+_0x375563[_0x5cfd('0x6')],_0x375563);}};}exports[_0x5cfd('0x7')]=function(_0x524305){for(var _0x258f88=0x0,_0x1467e3=events[_0x5cfd('0x8')];_0x258f88<_0x1467e3;_0x258f88++){var _0x11136f=events[_0x258f88];var _0xafcaef=createListener('user-setting:'+_0x11136f,_0x524305);UserSettingEvents['on'](_0x11136f,_0xafcaef);}}; \ No newline at end of file +var _0xd937=['user-setting:','remove','update','emit','UserId','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd937,0x9b));var _0x7d93=function(_0x5a5644,_0x4d1bfa){_0x5a5644=_0x5a5644-0x0;var _0x42b4b0=_0xd937[_0x5a5644];return _0x42b4b0;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=['save',_0x7d93('0x0'),_0x7d93('0x1')];function createListener(_0x1c30c0,_0x19ef15){return function(_0x43ed6e){_0x19ef15[_0x7d93('0x2')](_0x1c30c0,_0x43ed6e);if(_0x1c30c0==='user-setting:update'){_0x19ef15['emit']('user-setting:update:user-'+_0x43ed6e[_0x7d93('0x3')],_0x43ed6e);}};}exports[_0x7d93('0x4')]=function(_0x31885f){for(var _0x1133c8=0x0,_0x1b37fb=events[_0x7d93('0x5')];_0x1133c8<_0x1b37fb;_0x1133c8++){var _0x4866dc=events[_0x1133c8];var _0x38f1d6=createListener(_0x7d93('0x6')+_0x4866dc,_0x31885f);UserSettingEvents['on'](_0x4866dc,_0x38f1d6);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 5f24d43..625efc8 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 _0xfc38=['/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/api_key','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','describe','/whoami','whoami','/presence','isAuthenticated','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','create','/create_many','bulkCreate','addQueues','diskStorage','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','/:id/login','/:id/logout'];(function(_0xd15036,_0x276c7d){var _0x383871=function(_0xcc3812){while(--_0xcc3812){_0xd15036['push'](_0xd15036['shift']());}};_0x383871(++_0x276c7d);}(_0xfc38,0x12a));var _0x8fc3=function(_0x14d752,_0x40833b){_0x14d752=_0x14d752-0x0;var _0x225bea=_0xfc38[_0x14d752];return _0x225bea;};'use strict';var multer=require(_0x8fc3('0x0'));var util=require(_0x8fc3('0x1'));var path=require(_0x8fc3('0x2'));var timeout=require(_0x8fc3('0x3'));var express=require(_0x8fc3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8fc3('0x5'));var interaction=require(_0x8fc3('0x6'));var config=require(_0x8fc3('0x7'));var controller=require(_0x8fc3('0x8'));router[_0x8fc3('0x9')]('/',auth['isAuthenticated'](),controller[_0x8fc3('0xa')]);router[_0x8fc3('0x9')](_0x8fc3('0xb'),auth['isAuthenticated'](),controller[_0x8fc3('0xc')]);router[_0x8fc3('0x9')](_0x8fc3('0xd'),auth['isAuthenticated'](),controller[_0x8fc3('0xe')]);router['get'](_0x8fc3('0xf'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x11')]);router[_0x8fc3('0x9')](_0x8fc3('0x12'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x13')]);router[_0x8fc3('0x9')](_0x8fc3('0x14'),controller[_0x8fc3('0x15')]);router[_0x8fc3('0x9')](_0x8fc3('0x16'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x17')]);router[_0x8fc3('0x9')](_0x8fc3('0x18'),auth[_0x8fc3('0x10')](),controller['getContacts']);router[_0x8fc3('0x9')](_0x8fc3('0x19'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x1a')]);router[_0x8fc3('0x9')](_0x8fc3('0x1b'),auth['isAuthenticated'](),controller[_0x8fc3('0x1c')]);router[_0x8fc3('0x9')]('/:id/groups',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x1d')]);router[_0x8fc3('0x9')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x8fc3('0x9')](_0x8fc3('0x1e'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x1f')]);router[_0x8fc3('0x9')](_0x8fc3('0x20'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x21')]);router[_0x8fc3('0x9')](_0x8fc3('0x22'),auth[_0x8fc3('0x10')](),controller['getOpenchannelInteractions']);router[_0x8fc3('0x9')](_0x8fc3('0x23'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x24')]);router[_0x8fc3('0x9')](_0x8fc3('0x25'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x26')]);router[_0x8fc3('0x9')]('/:id/fax/interactions',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x27')]);router[_0x8fc3('0x9')](_0x8fc3('0x28'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x29')]);router[_0x8fc3('0x9')](_0x8fc3('0x2a'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x2b')]);router[_0x8fc3('0x9')](_0x8fc3('0x2c'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x2d')]);router[_0x8fc3('0x9')](_0x8fc3('0x2e'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x2f')]);router[_0x8fc3('0x9')]('/:id/prefixes',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x30')]);router[_0x8fc3('0x9')](_0x8fc3('0x31'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x32')]);router[_0x8fc3('0x9')](_0x8fc3('0x33'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x34')]);router['get'](_0x8fc3('0x35'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x36')]);router[_0x8fc3('0x9')](_0x8fc3('0x37'),auth['isAuthenticated'](),controller[_0x8fc3('0x38')]);router['get'](_0x8fc3('0x39'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x3a')]);router[_0x8fc3('0x9')](_0x8fc3('0x3b'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x3c')]);router['get'](_0x8fc3('0x3d'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x3e')]);router['get'](_0x8fc3('0x3f'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x40')]);router[_0x8fc3('0x9')]('/:id/api_key',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x41')]);router[_0x8fc3('0x42')]('/:id/contacts',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x43')]);router[_0x8fc3('0x42')]('/',auth['isAuthenticated'](),controller[_0x8fc3('0x44')]);router[_0x8fc3('0x42')](_0x8fc3('0x45'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x46')]);router['post'](_0x8fc3('0x19'),auth['isAuthenticated'](),controller[_0x8fc3('0x47')]);var upload=multer({'storage':multer[_0x8fc3('0x48')]({'destination':function(_0x3d701c,_0x3ece92,_0x1be179){_0x1be179(null,path['join'](config[_0x8fc3('0x49')],_0x8fc3('0x4a')));},'filename':function(_0x318a04,_0x3d1b78,_0x2a1466){_0x2a1466(null,util[_0x8fc3('0x4b')](_0x8fc3('0x4c'),Date['now'](),_0x3d1b78[_0x8fc3('0x4d')]));}})});router[_0x8fc3('0x42')]('/:id/avatar',upload[_0x8fc3('0x4e')](_0x8fc3('0x4f')),controller[_0x8fc3('0x50')]);router[_0x8fc3('0x42')](_0x8fc3('0x51'),auth[_0x8fc3('0x10')](),controller['login']);router['post'](_0x8fc3('0x52'),auth[_0x8fc3('0x10')](),controller['logout']);router[_0x8fc3('0x42')](_0x8fc3('0x53'),auth['isAuthenticated'](),controller[_0x8fc3('0x54')]);router[_0x8fc3('0x42')](_0x8fc3('0x55'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x56')]);router[_0x8fc3('0x42')](_0x8fc3('0x2a'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x57')]);router[_0x8fc3('0x42')](_0x8fc3('0x58'),auth['isAuthenticated'](),controller[_0x8fc3('0x59')]);router['post'](_0x8fc3('0x5a'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x5b')]);router[_0x8fc3('0x42')](_0x8fc3('0x5c'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x5d')]);router[_0x8fc3('0x42')]('/:id/sms_interactions',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x5e')]);router[_0x8fc3('0x42')](_0x8fc3('0x5f'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x60')]);router[_0x8fc3('0x42')](_0x8fc3('0x61'),auth['isAuthenticated'](),controller[_0x8fc3('0x62')]);router[_0x8fc3('0x42')]('/:id/fax_accounts',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x63')]);router[_0x8fc3('0x42')](_0x8fc3('0x33'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x64')]);router['post'](_0x8fc3('0x35'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x65')]);router[_0x8fc3('0x42')]('/:id/sms_accounts',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x66')]);router['post']('/:id/chat_websites',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x67')]);router[_0x8fc3('0x42')](_0x8fc3('0x3b'),auth[_0x8fc3('0x10')](),controller['addWhatsappAccounts']);router['post']('/:id/square_projects',auth[_0x8fc3('0x10')](),controller['addSquareProjects']);router[_0x8fc3('0x42')](_0x8fc3('0x68'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x69')]);router[_0x8fc3('0x6a')](_0x8fc3('0x12'),auth['isAuthenticated'](),controller[_0x8fc3('0x6b')]);router['put']('/:id/password',auth['isAuthenticated'](),controller[_0x8fc3('0x6c')]);router[_0x8fc3('0x6d')](_0x8fc3('0x19'),auth['isAuthenticated'](),controller[_0x8fc3('0x6e')]);router[_0x8fc3('0x6d')]('/:id/teams',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x6f')]);router['delete'](_0x8fc3('0x12'),auth['isAuthenticated'](),controller[_0x8fc3('0x70')]);router[_0x8fc3('0x6d')]('/:id/chat_interactions',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x71')]);router[_0x8fc3('0x6d')](_0x8fc3('0x5a'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x72')]);router[_0x8fc3('0x6d')](_0x8fc3('0x5c'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x73')]);router[_0x8fc3('0x6d')]('/:id/sms_interactions',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x74')]);router['delete'](_0x8fc3('0x5f'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x75')]);router['delete'](_0x8fc3('0x61'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x76')]);router[_0x8fc3('0x6d')](_0x8fc3('0x31'),auth['isAuthenticated'](),controller[_0x8fc3('0x77')]);router[_0x8fc3('0x6d')](_0x8fc3('0x33'),auth['isAuthenticated'](),controller[_0x8fc3('0x78')]);router['delete'](_0x8fc3('0x35'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x79')]);router['delete'](_0x8fc3('0x37'),auth['isAuthenticated'](),controller[_0x8fc3('0x7a')]);router[_0x8fc3('0x6d')](_0x8fc3('0x39'),auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x7b')]);router[_0x8fc3('0x6d')]('/:id/whatsapp_accounts',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x7c')]);router[_0x8fc3('0x6d')](_0x8fc3('0x3d'),auth[_0x8fc3('0x10')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x8fc3('0x10')](),controller[_0x8fc3('0x7d')]);module[_0x8fc3('0x7e')]=router; \ No newline at end of file +var _0x8fe6=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','/:id','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','addQueues','diskStorage','root','format','%s-%s','now','originalname','single','file','/:id/login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','/:id/queues','removeQueues','/:id/teams','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','/:id/chat_websites','removeChatWebsites','removeSquareProjects','removeApiKey','exports'];(function(_0x34f9f0,_0xa63711){var _0x52bcd1=function(_0x1d8cbd){while(--_0x1d8cbd){_0x34f9f0['push'](_0x34f9f0['shift']());}};_0x52bcd1(++_0xa63711);}(_0x8fe6,0x156));var _0x68fe=function(_0x509b9d,_0x234651){_0x509b9d=_0x509b9d-0x0;var _0x5a755f=_0x8fe6[_0x509b9d];return _0x5a755f;};'use strict';var multer=require(_0x68fe('0x0'));var util=require(_0x68fe('0x1'));var path=require(_0x68fe('0x2'));var timeout=require(_0x68fe('0x3'));var express=require(_0x68fe('0x4'));var router=express['Router']();var fs_extra=require(_0x68fe('0x5'));var auth=require(_0x68fe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x68fe('0x7'));router[_0x68fe('0x8')]('/',auth[_0x68fe('0x9')](),controller[_0x68fe('0xa')]);router[_0x68fe('0x8')](_0x68fe('0xb'),auth[_0x68fe('0x9')](),controller[_0x68fe('0xc')]);router[_0x68fe('0x8')](_0x68fe('0xd'),auth[_0x68fe('0x9')](),controller[_0x68fe('0xe')]);router[_0x68fe('0x8')](_0x68fe('0xf'),auth[_0x68fe('0x9')](),controller['getPresence']);router['get'](_0x68fe('0x10'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x11')]);router[_0x68fe('0x8')](_0x68fe('0x12'),controller['getAvatar']);router[_0x68fe('0x8')](_0x68fe('0x13'),auth['isAuthenticated'](),controller[_0x68fe('0x14')]);router[_0x68fe('0x8')](_0x68fe('0x15'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x16')]);router['get']('/:id/queues',auth[_0x68fe('0x9')](),controller[_0x68fe('0x17')]);router['get'](_0x68fe('0x18'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x19')]);router[_0x68fe('0x8')](_0x68fe('0x1a'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x1b')]);router[_0x68fe('0x8')](_0x68fe('0x1c'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x1d')]);router[_0x68fe('0x8')]('/:id/screen_recordings',auth[_0x68fe('0x9')](),controller[_0x68fe('0x1e')]);router[_0x68fe('0x8')](_0x68fe('0x1f'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x20')]);router[_0x68fe('0x8')](_0x68fe('0x21'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x22')]);router[_0x68fe('0x8')](_0x68fe('0x23'),auth['isAuthenticated'](),controller[_0x68fe('0x24')]);router[_0x68fe('0x8')](_0x68fe('0x25'),auth[_0x68fe('0x9')](),controller['getSmsInteractions']);router[_0x68fe('0x8')](_0x68fe('0x26'),auth['isAuthenticated'](),controller[_0x68fe('0x27')]);router[_0x68fe('0x8')](_0x68fe('0x28'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router[_0x68fe('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x68fe('0x29')]);router[_0x68fe('0x8')](_0x68fe('0x2a'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x2b')]);router[_0x68fe('0x8')]('/:id/agents',auth[_0x68fe('0x9')](),controller[_0x68fe('0x2c')]);router['get'](_0x68fe('0x2d'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x2e')]);router[_0x68fe('0x8')](_0x68fe('0x2f'),auth['isAuthenticated'](),controller[_0x68fe('0x30')]);router['get'](_0x68fe('0x31'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x32')]);router['get'](_0x68fe('0x33'),auth[_0x68fe('0x9')](),controller['getOpenchannelAccounts']);router[_0x68fe('0x8')](_0x68fe('0x34'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x35')]);router[_0x68fe('0x8')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x68fe('0x36')]);router[_0x68fe('0x8')](_0x68fe('0x37'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x38')]);router[_0x68fe('0x8')](_0x68fe('0x39'),auth['isAuthenticated'](),controller[_0x68fe('0x3a')]);router[_0x68fe('0x8')](_0x68fe('0x3b'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x3c')]);router[_0x68fe('0x8')](_0x68fe('0x3d'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x3e')]);router[_0x68fe('0x3f')](_0x68fe('0x15'),auth[_0x68fe('0x9')](),controller['addContacts']);router[_0x68fe('0x3f')]('/',auth[_0x68fe('0x9')](),controller[_0x68fe('0x40')]);router[_0x68fe('0x3f')](_0x68fe('0x41'),auth[_0x68fe('0x9')](),controller['bulkCreate']);router[_0x68fe('0x3f')]('/:id/queues',auth[_0x68fe('0x9')](),controller[_0x68fe('0x42')]);var upload=multer({'storage':multer[_0x68fe('0x43')]({'destination':function(_0x1e527d,_0x1b1bfa,_0x5ebf5f){_0x5ebf5f(null,path['join'](config[_0x68fe('0x44')],'server/files/images/'));},'filename':function(_0x1fbce9,_0x26c7a3,_0x2cef6d){_0x2cef6d(null,util[_0x68fe('0x45')](_0x68fe('0x46'),Date[_0x68fe('0x47')](),_0x26c7a3[_0x68fe('0x48')]));}})});router[_0x68fe('0x3f')](_0x68fe('0x12'),upload[_0x68fe('0x49')](_0x68fe('0x4a')),controller['addAvatar']);router[_0x68fe('0x3f')](_0x68fe('0x4b'),auth[_0x68fe('0x9')](),controller['login']);router[_0x68fe('0x3f')](_0x68fe('0x4c'),auth[_0x68fe('0x9')](),controller['logout']);router[_0x68fe('0x3f')](_0x68fe('0x4d'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x4e')]);router[_0x68fe('0x3f')](_0x68fe('0x4f'),auth['isAuthenticated'](),controller['unpause']);router[_0x68fe('0x3f')]('/:id/teams',auth[_0x68fe('0x9')](),controller[_0x68fe('0x50')]);router[_0x68fe('0x3f')](_0x68fe('0x51'),auth['isAuthenticated'](),controller[_0x68fe('0x52')]);router[_0x68fe('0x3f')](_0x68fe('0x53'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x54')]);router[_0x68fe('0x3f')](_0x68fe('0x55'),auth[_0x68fe('0x9')](),controller['addFaxInteractions']);router[_0x68fe('0x3f')]('/:id/sms_interactions',auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x68fe('0x3f')](_0x68fe('0x56'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x57')]);router[_0x68fe('0x3f')](_0x68fe('0x58'),auth[_0x68fe('0x9')](),controller['addWhatsappInteractions']);router['post'](_0x68fe('0x2f'),auth['isAuthenticated'](),controller[_0x68fe('0x59')]);router[_0x68fe('0x3f')]('/:id/mail_accounts',auth[_0x68fe('0x9')](),controller[_0x68fe('0x5a')]);router['post']('/:id/openchannel_accounts',auth[_0x68fe('0x9')](),controller['addOpenchannelAccounts']);router[_0x68fe('0x3f')](_0x68fe('0x34'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x5b')]);router[_0x68fe('0x3f')]('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router['post'](_0x68fe('0x37'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x5c')]);router[_0x68fe('0x3f')](_0x68fe('0x39'),auth[_0x68fe('0x9')](),controller['addSquareProjects']);router[_0x68fe('0x3f')]('/:id/api_key',auth[_0x68fe('0x9')](),controller[_0x68fe('0x5d')]);router['put'](_0x68fe('0x10'),auth['isAuthenticated'](),controller['update']);router[_0x68fe('0x5e')](_0x68fe('0x5f'),auth['isAuthenticated'](),controller[_0x68fe('0x60')]);router[_0x68fe('0x61')](_0x68fe('0x62'),auth['isAuthenticated'](),controller[_0x68fe('0x63')]);router[_0x68fe('0x61')](_0x68fe('0x64'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x68fe('0x61')](_0x68fe('0x10'),auth[_0x68fe('0x9')](),controller['destroy']);router[_0x68fe('0x61')](_0x68fe('0x51'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x68fe('0x61')](_0x68fe('0x53'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x65')]);router[_0x68fe('0x61')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x68fe('0x66')]);router[_0x68fe('0x61')](_0x68fe('0x67'),auth['isAuthenticated'](),controller[_0x68fe('0x68')]);router[_0x68fe('0x61')](_0x68fe('0x56'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x69')]);router[_0x68fe('0x61')](_0x68fe('0x58'),auth[_0x68fe('0x9')](),controller['removeWhatsappInteractions']);router[_0x68fe('0x61')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x68fe('0x6a')]);router[_0x68fe('0x61')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x68fe('0x6b')]);router['delete'](_0x68fe('0x33'),auth[_0x68fe('0x9')](),controller['removeOpenchannelAccounts']);router['delete'](_0x68fe('0x34'),auth['isAuthenticated'](),controller[_0x68fe('0x6c')]);router[_0x68fe('0x61')](_0x68fe('0x6d'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x6e')]);router[_0x68fe('0x61')](_0x68fe('0x37'),auth[_0x68fe('0x9')](),controller['removeWhatsappAccounts']);router[_0x68fe('0x61')]('/:id/square_projects',auth[_0x68fe('0x9')](),controller[_0x68fe('0x6f')]);router[_0x68fe('0x61')](_0x68fe('0x3d'),auth[_0x68fe('0x9')](),controller[_0x68fe('0x70')]);module[_0x68fe('0x71')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 8c691af..f05e342 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 _0xdd3b=['encryption','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','loginAttempts','sequelize','moment','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','email','ENUM','admin','user','agent','telephone','local','internal','\x22%s\x22\x20<%s>','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','auto','yes','update','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','certificate','active','passive','nonat','update,nonat','TEXT','showWebBar','isArray','wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux'];(function(_0x19c860,_0x568e76){var _0x25aa01=function(_0x40be14){while(--_0x40be14){_0x19c860['push'](_0x19c860['shift']());}};_0x25aa01(++_0x568e76);}(_0xdd3b,0x119));var _0xbdd3=function(_0x44a5b6,_0x382727){_0x44a5b6=_0x44a5b6-0x0;var _0x4b8969=_0xdd3b[_0x44a5b6];return _0x4b8969;};'use strict';var Sequelize=require(_0xbdd3('0x0'));var moment=require(_0xbdd3('0x1'));var util=require(_0xbdd3('0x2'));var _=require(_0xbdd3('0x3'));module[_0xbdd3('0x4')]={'name':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':![],'unique':_0xbdd3('0x6'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x225ab6){this['setDataValue'](_0xbdd3('0x6'),_0x225ab6);this[_0xbdd3('0x7')]('defaultuser',_0x225ab6);},'comment':_0xbdd3('0x8')},'fullname':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':![],'set':function(_0xb05219){this[_0xbdd3('0x7')](_0xbdd3('0x9'),_0xb05219);this[_0xbdd3('0x7')](_0xbdd3('0xa'),util[_0xbdd3('0xb')]('\x22%s\x22\x20<%s>',_0xb05219,this[_0xbdd3('0xc')]('internal')));}},'alias':{'type':Sequelize[_0xbdd3('0x5')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x5417a3){if(_0x5417a3){this[_0xbdd3('0x7')](_0xbdd3('0xd'),_0x5417a3['toLowerCase']());}}},'role':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0xf'),_0xbdd3('0x10'),_0xbdd3('0x11'),_0xbdd3('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xbdd3('0x5')],'defaultValue':_0xbdd3('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x434ee4){this[_0xbdd3('0x7')](_0xbdd3('0x14'),_0x434ee4);this[_0xbdd3('0x7')]('accountcode',_0x434ee4);this[_0xbdd3('0x7')](_0xbdd3('0xa'),util[_0xbdd3('0xb')](_0xbdd3('0x15'),this[_0xbdd3('0xc')](_0xbdd3('0x9')),_0x434ee4));}},'salt':{'type':Sequelize[_0xbdd3('0x5')]},'phone':{'type':Sequelize[_0xbdd3('0x5')]},'mobile':{'type':Sequelize[_0xbdd3('0x5')]},'address':{'type':Sequelize[_0xbdd3('0x5')]},'zipcode':{'type':Sequelize[_0xbdd3('0x5')]},'userpic':{'type':Sequelize[_0xbdd3('0x5')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xbdd3('0x5')],'defaultValue':_0xbdd3('0x17')},'lastPauseAt':{'type':Sequelize[_0xbdd3('0x18')]},'chatCapacity':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xbdd3('0x19')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xbdd3('0x19')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0xbdd3('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xbdd3('0x1a'),_0xbdd3('0x10'),_0xbdd3('0x1b')),'allowNull':!![],'defaultValue':_0xbdd3('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0xbdd3('0x1c'),_0xbdd3('0x1d'),_0xbdd3('0x1e'),_0xbdd3('0x1f'),_0xbdd3('0x20'),_0xbdd3('0x21'),_0xbdd3('0x22'),_0xbdd3('0x23')),'allowNull':!![]},'deny':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'permit':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'transport':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![],'defaultValue':_0xbdd3('0x24'),'set':function(_0x2d6abe){this['setDataValue'](_0xbdd3('0x25'),_0x2d6abe?_0x2d6abe[_0xbdd3('0x26')](','):null);},'get':function(){return this[_0xbdd3('0xc')](_0xbdd3('0x25'))?this['getDataValue'](_0xbdd3('0x25'))[_0xbdd3('0x27')](','):null;},'comment':_0xbdd3('0x28')},'dtmfmode':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x29'),_0xbdd3('0x2a'),_0xbdd3('0x2b'),'inband',_0xbdd3('0x2c')),'allowNull':!![],'defaultValue':_0xbdd3('0x29')},'directmedia':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no','nonat',_0xbdd3('0x2e'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xbdd3('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![],'defaultValue':_0xbdd3('0x2f'),'set':function(_0x54a722){this['setDataValue'](_0xbdd3('0x30'),_0x54a722?_0x54a722[_0xbdd3('0x26')](','):null);},'get':function(){return this[_0xbdd3('0xc')]('nat')?this[_0xbdd3('0xc')]('nat')[_0xbdd3('0x27')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xbdd3('0x5')]},'language':{'type':Sequelize[_0xbdd3('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xbdd3('0x5')]},'disallow':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':![],'defaultValue':_0xbdd3('0x31')},'allow':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':![],'defaultValue':_0xbdd3('0x32'),'set':function(_0x516d9b){this[_0xbdd3('0x7')](_0xbdd3('0x33'),_0x516d9b?_0x516d9b['join'](';'):_0xbdd3('0x32'));},'get':function(){return this[_0xbdd3('0xc')]('allow')?this[_0xbdd3('0xc')]('allow')[_0xbdd3('0x27')](';'):null;},'comment':_0xbdd3('0x34')},'autoframing':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![],'set':function(_0x220358){this['setDataValue'](_0xbdd3('0x35'),_0x220358?_0x220358[_0xbdd3('0x26')](','):null);},'get':function(){return this[_0xbdd3('0xc')]('insecure')?this['getDataValue']('insecure')[_0xbdd3('0x27')](','):null;},'comment':_0xbdd3('0x36')},'trustrpid':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xbdd3('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no',_0xbdd3('0x37')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![],'defaultValue':_0xbdd3('0x38')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![],'defaultValue':_0xbdd3('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xbdd3('0xe')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no',_0xbdd3('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xbdd3('0xe')]('accept',_0xbdd3('0x3a'),_0xbdd3('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xbdd3('0xe')]('uac',_0xbdd3('0x3c')),'allowNull':!![],'defaultValue':_0xbdd3('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xbdd3('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xbdd3('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xbdd3('0x2d'),'no',_0xbdd3('0x3d'),_0xbdd3('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x3f'),_0xbdd3('0x40'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xbdd3('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xbdd3('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xbdd3('0xe')](_0xbdd3('0x2d'),'no',_0xbdd3('0x41'),'update',_0xbdd3('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xbdd3('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xbdd3('0x18')]},'passwordResetAt':{'type':Sequelize[_0xbdd3('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xbdd3('0x43')]},'showWebBar':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x0,'set':function(_0x10a856){this[_0xbdd3('0x7')](_0xbdd3('0x44'),_0x10a856);var _0x42a125=this['get']({'plain':!![]});switch(_0x10a856){case 0x0:case 0x1:var _0x268e53=_0x42a125['transport']?_[_0xbdd3('0x45')](_0x42a125[_0xbdd3('0x25')])?_0x42a125['transport'][_0xbdd3('0x26')]():_0x42a125[_0xbdd3('0x25')]:'udp';if(_0x268e53===_0xbdd3('0x46')){_0x268e53=_0xbdd3('0x24');}this[_0xbdd3('0x7')](_0xbdd3('0x25'),_0x268e53);this[_0xbdd3('0x7')]('encryption','no');this[_0xbdd3('0x7')](_0xbdd3('0x47'),null);this[_0xbdd3('0x7')]('force_avp',null);this[_0xbdd3('0x7')](_0xbdd3('0x48'),null);this['setDataValue'](_0xbdd3('0x49'),null);this[_0xbdd3('0x7')](_0xbdd3('0x4a'),null);this[_0xbdd3('0x7')](_0xbdd3('0x4b'),null);this[_0xbdd3('0x7')](_0xbdd3('0x4c'),null);this['setDataValue'](_0xbdd3('0x4d'),null);this['setDataValue'](_0xbdd3('0x4e'),'no');break;case 0x2:this[_0xbdd3('0x7')](_0xbdd3('0x25'),_0xbdd3('0x46'));this[_0xbdd3('0x7')](_0xbdd3('0x4f'),_0xbdd3('0x2d'));this[_0xbdd3('0x7')](_0xbdd3('0x47'),_0xbdd3('0x2d'));this['setDataValue']('force_avp',_0xbdd3('0x2d'));this['setDataValue'](_0xbdd3('0x48'),_0xbdd3('0x2d'));this['setDataValue'](_0xbdd3('0x49'),_0xbdd3('0x2d'));this['setDataValue']('dtlsverify','no');this[_0xbdd3('0x7')]('dtlssetup',_0xbdd3('0x50'));this[_0xbdd3('0x7')]('dtlscertfile',_0x42a125[_0xbdd3('0x4c')]||_0xbdd3('0x51'));this[_0xbdd3('0x7')](_0xbdd3('0x4d'),_0x42a125[_0xbdd3('0x4d')]||_0xbdd3('0x52'));this[_0xbdd3('0x7')](_0xbdd3('0x4e'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xbdd3('0x43')],'set':function(_0x2a67b5){this[_0xbdd3('0x7')]('permissions',_0x2a67b5?_0x2a67b5[_0xbdd3('0x26')](','):[]);},'get':function(){return this['getDataValue'](_0xbdd3('0x53'))?_[_0xbdd3('0x54')](this[_0xbdd3('0xc')](_0xbdd3('0x53'))['split'](','),function(_0x19c56f){return parseInt(_0x19c56f,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xbdd3('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xbdd3('0x5')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xbdd3('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xbdd3('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xbdd3('0x55')],'get':function(){return this['getDataValue'](_0xbdd3('0x56'))?this[_0xbdd3('0xc')](_0xbdd3('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xbdd3('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3be143){if(typeof _0x3be143==='string'){var _0x16fd5d=_0x3be143==='1'?!![]:_0x3be143==='0'?![]:_0x3be143==='true'?!![]:_0x3be143===_0xbdd3('0x57')?![]:![];this[_0xbdd3('0x7')](_0xbdd3('0x58'),_0x16fd5d);}else{this[_0xbdd3('0x7')]('screenrecording',_0x3be143);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xf327a7){this[_0xbdd3('0x7')]('blocked',_0xf327a7);if(_0xf327a7===!![]){this[_0xbdd3('0x7')]('blockedAt',moment());this[_0xbdd3('0x7')](_0xbdd3('0x59'),0x0);}else{this['setDataValue']('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xbdd3('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xbdd3('0x19')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xbdd3('0x19')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xbdd3('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0xa534=['rtcp_mux','wss','force_avp','icesupport','/etc/pki/tls/certs/motion.crt','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','exports','STRING','name','defaultuser','The\x20name\x20of\x20the\x20user','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','uac','uas','certificate','actpass','update,nonat','TEXT','showWebBar','get','isArray','encryption','avpf','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey'];(function(_0x542667,_0x24518e){var _0x520a54=function(_0x1b96e9){while(--_0x1b96e9){_0x542667['push'](_0x542667['shift']());}};_0x520a54(++_0x24518e);}(_0xa534,0xcc));var _0x4a53=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xa534[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0x4a53('0x0'));var moment=require(_0x4a53('0x1'));var util=require('util');var _=require('lodash');module[_0x4a53('0x2')]={'name':{'type':Sequelize[_0x4a53('0x3')],'allowNull':![],'unique':_0x4a53('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x15c39b){this['setDataValue'](_0x4a53('0x4'),_0x15c39b);this['setDataValue'](_0x4a53('0x5'),_0x15c39b);},'comment':_0x4a53('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x956e21){this[_0x4a53('0x7')](_0x4a53('0x8'),_0x956e21);this['setDataValue'](_0x4a53('0x9'),util[_0x4a53('0xa')](_0x4a53('0xb'),_0x956e21,this[_0x4a53('0xc')](_0x4a53('0xd'))));}},'alias':{'type':Sequelize[_0x4a53('0x3')]},'email':{'type':Sequelize[_0x4a53('0x3')],'allowNull':![],'unique':_0x4a53('0xe'),'validate':{'isEmail':!![]},'set':function(_0x1b834c){if(_0x1b834c){this[_0x4a53('0x7')](_0x4a53('0xe'),_0x1b834c[_0x4a53('0xf')]());}}},'role':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x11'),_0x4a53('0x12'),_0x4a53('0x13'),_0x4a53('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x4a53('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x4a53('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x4a53('0xd'),'set':function(_0x5c106d){this[_0x4a53('0x7')](_0x4a53('0xd'),_0x5c106d);this['setDataValue'](_0x4a53('0x15'),_0x5c106d);this[_0x4a53('0x7')](_0x4a53('0x9'),util['format'](_0x4a53('0xb'),this['getDataValue'](_0x4a53('0x8')),_0x5c106d));}},'salt':{'type':Sequelize[_0x4a53('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x4a53('0x3')]},'address':{'type':Sequelize[_0x4a53('0x3')]},'zipcode':{'type':Sequelize[_0x4a53('0x3')]},'userpic':{'type':Sequelize[_0x4a53('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x4a53('0x3')]},'online':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x4a53('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4a53('0x3')],'defaultValue':_0x4a53('0x18')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x4a53('0x19')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![],'defaultValue':_0x4a53('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x4a53('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x1b'),_0x4a53('0x12'),_0x4a53('0x1c')),'allowNull':!![],'defaultValue':_0x4a53('0x1b')},'context':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![],'defaultValue':_0x4a53('0x1d')},'callingpres':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x1e'),_0x4a53('0x1f'),_0x4a53('0x20'),_0x4a53('0x21'),_0x4a53('0x22'),_0x4a53('0x23'),_0x4a53('0x24'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![],'defaultValue':_0x4a53('0x25'),'set':function(_0x16e986){this['setDataValue'](_0x4a53('0x26'),_0x16e986?_0x16e986[_0x4a53('0x27')](','):null);},'get':function(){return this['getDataValue'](_0x4a53('0x26'))?this[_0x4a53('0xc')](_0x4a53('0x26'))['split'](','):null;},'comment':_0x4a53('0x28')},'dtmfmode':{'type':Sequelize['ENUM'](_0x4a53('0x29'),_0x4a53('0x2a'),_0x4a53('0x2b'),_0x4a53('0x2c'),_0x4a53('0x2d')),'allowNull':!![],'defaultValue':_0x4a53('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x4a53('0x2e'),'no',_0x4a53('0x2f'),_0x4a53('0x30'),_0x4a53('0x31')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![],'defaultValue':_0x4a53('0x32'),'set':function(_0x2bb3bd){this[_0x4a53('0x7')](_0x4a53('0x33'),_0x2bb3bd?_0x2bb3bd['join'](','):null);},'get':function(){return this[_0x4a53('0xc')](_0x4a53('0x33'))?this[_0x4a53('0xc')](_0x4a53('0x33'))['split'](','):null;},'comment':_0x4a53('0x34')},'callgroup':{'type':Sequelize[_0x4a53('0x3')]},'namedcallgroup':{'type':Sequelize[_0x4a53('0x3')]},'pickupgroup':{'type':Sequelize[_0x4a53('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x4a53('0x3')]},'language':{'type':Sequelize[_0x4a53('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4a53('0x3')]},'disallow':{'type':Sequelize[_0x4a53('0x3')],'allowNull':![],'defaultValue':_0x4a53('0x35')},'allow':{'type':Sequelize[_0x4a53('0x3')],'allowNull':![],'defaultValue':_0x4a53('0x36'),'set':function(_0x4218af){this[_0x4a53('0x7')](_0x4a53('0x37'),_0x4218af?_0x4218af[_0x4a53('0x27')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x4a53('0xc')](_0x4a53('0x37'))?this['getDataValue']('allow')[_0x4a53('0x38')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![],'set':function(_0x464613){this[_0x4a53('0x7')]('insecure',_0x464613?_0x464613[_0x4a53('0x27')](','):null);},'get':function(){return this[_0x4a53('0xc')](_0x4a53('0x39'))?this[_0x4a53('0xc')]('insecure')[_0x4a53('0x38')](','):null;},'comment':_0x4a53('0x3a')},'trustrpid':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4a53('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![],'defaultValue':_0x4a53('0x3b')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x4a53('0x2e'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x4a53('0x10')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x4a53('0x2e'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x4a53('0x2e'),'no',_0x4a53('0x3c')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x4a53('0x10')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x4a53('0x3d'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x3e'),'uas'),'allowNull':!![],'defaultValue':_0x4a53('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![],'defaultValue':_0x4a53('0x2e')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4a53('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x4a53('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no','fingerprint',_0x4a53('0x40')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4a53('0x10')]('active','passive',_0x4a53('0x41')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x4a53('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4a53('0x10')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x4a53('0x10')](_0x4a53('0x2e'),'no',_0x4a53('0x2f'),'update',_0x4a53('0x42')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x4a53('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x4a53('0x17')]},'passwordResetAt':{'type':Sequelize[_0x4a53('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x4a53('0x43')]},'showWebBar':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0,'set':function(_0x38170e){this[_0x4a53('0x7')](_0x4a53('0x44'),_0x38170e);var _0x272e0f=this[_0x4a53('0x45')]({'plain':!![]});switch(_0x38170e){case 0x0:case 0x1:var _0x31fcac=_0x272e0f['transport']?_[_0x4a53('0x46')](_0x272e0f[_0x4a53('0x26')])?_0x272e0f[_0x4a53('0x26')][_0x4a53('0x27')]():_0x272e0f['transport']:_0x4a53('0x25');if(_0x31fcac==='wss'){_0x31fcac=_0x4a53('0x25');}this[_0x4a53('0x7')](_0x4a53('0x26'),_0x31fcac);this[_0x4a53('0x7')](_0x4a53('0x47'),'no');this[_0x4a53('0x7')](_0x4a53('0x48'),null);this[_0x4a53('0x7')]('force_avp',null);this[_0x4a53('0x7')]('icesupport',null);this[_0x4a53('0x7')](_0x4a53('0x49'),null);this[_0x4a53('0x7')](_0x4a53('0x4a'),null);this[_0x4a53('0x7')](_0x4a53('0x4b'),null);this['setDataValue'](_0x4a53('0x4c'),null);this[_0x4a53('0x7')](_0x4a53('0x4d'),null);this[_0x4a53('0x7')](_0x4a53('0x4e'),'no');break;case 0x2:this[_0x4a53('0x7')]('transport',_0x4a53('0x4f'));this[_0x4a53('0x7')]('encryption',_0x4a53('0x2e'));this[_0x4a53('0x7')](_0x4a53('0x48'),_0x4a53('0x2e'));this['setDataValue'](_0x4a53('0x50'),_0x4a53('0x2e'));this[_0x4a53('0x7')](_0x4a53('0x51'),_0x4a53('0x2e'));this['setDataValue']('dtlsenable',_0x4a53('0x2e'));this[_0x4a53('0x7')](_0x4a53('0x4a'),'no');this[_0x4a53('0x7')](_0x4a53('0x4b'),'actpass');this[_0x4a53('0x7')](_0x4a53('0x4c'),_0x272e0f[_0x4a53('0x4c')]||_0x4a53('0x52'));this[_0x4a53('0x7')](_0x4a53('0x4d'),_0x272e0f['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this[_0x4a53('0x7')](_0x4a53('0x4e'),_0x4a53('0x2e'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x4867d0){this[_0x4a53('0x7')]('permissions',_0x4867d0?_0x4867d0[_0x4a53('0x27')](','):[]);},'get':function(){return this[_0x4a53('0xc')](_0x4a53('0x53'))?_[_0x4a53('0x54')](this['getDataValue'](_0x4a53('0x53'))[_0x4a53('0x38')](','),function(_0x583f62){return parseInt(_0x583f62,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x4a53('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x4a53('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x4a53('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x4a53('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4a53('0x10')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x4a53('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x4a53('0x55')],'get':function(){return this[_0x4a53('0xc')](_0x4a53('0x56'))?this[_0x4a53('0xc')](_0x4a53('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x4a53('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![],'set':function(_0xfc9d87){if(typeof _0xfc9d87==='string'){var _0x299ee6=_0xfc9d87==='1'?!![]:_0xfc9d87==='0'?![]:_0xfc9d87===_0x4a53('0x57')?!![]:_0xfc9d87===_0x4a53('0x58')?![]:![];this[_0x4a53('0x7')](_0x4a53('0x59'),_0x299ee6);}else{this[_0x4a53('0x7')](_0x4a53('0x59'),_0xfc9d87);}}},'blocked':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![],'set':function(_0x2db7e0){this[_0x4a53('0x7')](_0x4a53('0x5a'),_0x2db7e0);if(_0x2db7e0===!![]){this[_0x4a53('0x7')](_0x4a53('0x5b'),moment());this[_0x4a53('0x7')](_0x4a53('0x5c'),0x0);}else{this[_0x4a53('0x7')](_0x4a53('0x5b'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x4a53('0x19')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x4a53('0x19')](0x5)[_0x4a53('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x4a53('0x16')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9b39f3d..0ff19d1 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 _0xda24=['mailbox','fullname','email','permissions','101','103','113','110','104','105','106','100','111','115','create','agent','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','findAll','compact','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','toLowerCase','Queues','penalty','spread','emit','capitalize','Queue:save','format','SIP/%s','each','upsert','removeQueues','remove','isArray','QueueId','Queue:remove','voice','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','existsSync','server/files/images/','download','getOpenTabs','whatsapp','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MAIL','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','order','sort','pick','hasOwnProperty','List','Tag','Tags','tag','nolimit','getQueues','Queue','get','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','UserId','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','forEach','getChannels','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','concat','YYYY-MM-DD\x20HH:mm:ss','isMiddleware','resolve','logout','pause','updateAttributes','type','DEFAULT\x20PAUSE','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','QueuePause','manual','set','Pause','unpause','getTeams','Team','addTeams','getVoiceQueues','setDataValue','Voice','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','Sms','getWhatsappQueues','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Whatsapp','getFaxQueues','removeAgent','getLists','CmList','values','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','addSmsInteractions','user_has_sms_interactions:save','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','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$lt','$ne','$eq','$not','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','lastName','Contact','dialActive','VoiceQueue','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','createApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','isEmpty','inbound','lower','col','desc','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','idle','unavailable','ringing','busy','slice','charAt','toUpperCase','select','field','ui.','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','moment','util','path','lodash','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','./user.socket','register','defaults','client','http','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','destroy','role','Users','user','Agents','Telephones','telephone','filter','ignore','includes','value','UserProfileResource','end','stack','name','send','index','User','rawAttributes','map','key','password','salt','getOptions','where','query','includeAll','include','userSetting','UserSetting','attributes','push','openTabs','true','rows','length','chat','dataValues','sms','mail','openchannel','all','show','params','model','differenceBy','keys','filters','intersection','fields','merge','options','find','fax','body','describe','addContacts','ids','omit','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','voicemail'];(function(_0x4d2434,_0x22dd2b){var _0xa6bbe3=function(_0x4a7277){while(--_0x4a7277){_0x4d2434['push'](_0x4d2434['shift']());}};_0xa6bbe3(++_0x22dd2b);}(_0xda24,0x127));var _0x4da2=function(_0x1b4b25,_0x314c18){_0x1b4b25=_0x1b4b25-0x0;var _0x47a055=_0xda24[_0x1b4b25];return _0x47a055;};'use strict';var moment=require(_0x4da2('0x0'));var BPromise=require('bluebird');var util=require(_0x4da2('0x1'));var path=require(_0x4da2('0x2'));var fs=require('fs');var _=require(_0x4da2('0x3'));var squel=require('squel');var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require(_0x4da2('0x4'));var qs=require(_0x4da2('0x5'));var logger=require(_0x4da2('0x6'))('api');var utils=require(_0x4da2('0x7'));var config=require(_0x4da2('0x8'));var licenseUtil=require(_0x4da2('0x9'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x4da2('0xa')]));require(_0x4da2('0xb'))[_0x4da2('0xc')](socket);config['redis']=_[_0x4da2('0xd')](config[_0x4da2('0xa')],{'host':'localhost','port':0x18eb});var client=jayson[_0x4da2('0xe')][_0x4da2('0xf')]({'port':0x232a});var values;function respondWithRpcPromise(_0x59a9d2,_0x2d0173,_0x5d63b4,_0x48a028){return new BPromise(function(_0x278ef8,_0x10f2e8){var _0x50fdc5=_0x48a028||client;return _0x50fdc5[_0x4da2('0x10')](_0x59a9d2,_0x5d63b4)[_0x4da2('0x11')](function(_0x46fb5f){logger[_0x4da2('0x12')]('User,\x20%s,\x20%s',_0x2d0173,_0x4da2('0x13'));logger[_0x4da2('0x14')](_0x4da2('0x15'),_0x2d0173,_0x4da2('0x13'),JSON[_0x4da2('0x16')](_0x46fb5f));if(_0x46fb5f[_0x4da2('0x17')]){if(_0x46fb5f[_0x4da2('0x17')][_0x4da2('0x18')]===0x1f4){logger[_0x4da2('0x17')](_0x4da2('0x19'),_0x2d0173,_0x46fb5f[_0x4da2('0x17')][_0x4da2('0x1a')]);return _0x10f2e8(_0x46fb5f[_0x4da2('0x17')][_0x4da2('0x1a')]);}logger[_0x4da2('0x17')](_0x4da2('0x19'),_0x2d0173,_0x46fb5f[_0x4da2('0x17')][_0x4da2('0x1a')]);return _0x278ef8(_0x46fb5f['error'][_0x4da2('0x1a')]);}else{logger[_0x4da2('0x12')](_0x4da2('0x19'),_0x2d0173,_0x4da2('0x13'));_0x278ef8(_0x46fb5f[_0x4da2('0x1b')][_0x4da2('0x1a')]);}})[_0x4da2('0x1c')](function(_0x5b359b){logger[_0x4da2('0x17')](_0x4da2('0x19'),_0x2d0173,_0x5b359b);_0x10f2e8(_0x5b359b);});});}function respondWithStatusCode(_0x360f19,_0x1fa44b){_0x1fa44b=_0x1fa44b||0xcc;return function(_0x59f49e){if(_0x59f49e){return _0x360f19[_0x4da2('0x1d')](_0x1fa44b);}return _0x360f19['status'](_0x1fa44b)['end']();};}function respondWithResult(_0x51da21,_0x54646a){_0x54646a=_0x54646a||0xc8;return function(_0x215d92){if(_0x215d92){return _0x51da21[_0x4da2('0x1e')](_0x54646a)[_0x4da2('0x1f')](_0x215d92);}};}function respondWithFilteredResult(_0x121d86,_0x54e968){return function(_0xcf4758){if(_0xcf4758){var _0x3a1f23=typeof _0x54e968[_0x4da2('0x20')]===_0x4da2('0x21')&&typeof _0x54e968[_0x4da2('0x22')]===_0x4da2('0x21');var _0x29a923=_0xcf4758[_0x4da2('0x23')];var _0x54616b=_0x3a1f23?0x0:_0x54e968[_0x4da2('0x20')];var _0x36c38f=_0x3a1f23?_0xcf4758[_0x4da2('0x23')]:_0x54e968[_0x4da2('0x20')]+_0x54e968[_0x4da2('0x22')];var _0x24a0d5;if(_0x36c38f>=_0x29a923){_0x36c38f=_0x29a923;_0x24a0d5=0xc8;}else{_0x24a0d5=0xce;}_0x121d86[_0x4da2('0x1e')](_0x24a0d5);return _0x121d86['set'](_0x4da2('0x24'),_0x54616b+'-'+_0x36c38f+'/'+_0x29a923)[_0x4da2('0x1f')](_0xcf4758);}return null;};}function saveUpdates(_0x2ebbd8){return function(_0x650718){if(_0x650718){return _0x650718[_0x4da2('0x25')](_0x2ebbd8)[_0x4da2('0x11')](function(_0x57d6cc){return _0x57d6cc;});}return null;};}function removeEntity(_0x596f6d){return function(_0x2b45c4){if(_0x2b45c4){return _0x2b45c4[_0x4da2('0x26')]()['then'](function(){var _0x4b5b5a=_0x2b45c4['get']({'plain':!![]});if(_0x4b5b5a[_0x4da2('0x27')]==='admin')return;var _0x327c16=[{'name':_0x4da2('0x28'),'value':_0x4da2('0x29'),'ignore':!![]},{'name':_0x4da2('0x2a'),'value':'agent','ignore':![]},{'name':_0x4da2('0x2b'),'value':_0x4da2('0x2c'),'ignore':![]}];var _0x56626f=_(_0x327c16)[_0x4da2('0x2d')](_0x4da2('0x2e'))['map']('value')['value']();if(_[_0x4da2('0x2f')](_0x56626f,_0x4b5b5a['role'])){return;}var _0x47028a=_['find'](_0x327c16,[_0x4da2('0x30'),_0x4b5b5a[_0x4da2('0x27')]])['name'];return db[_0x4da2('0x31')]['destroy']({'where':{'type':_0x47028a,'resourceId':_0x4b5b5a['id']}})[_0x4da2('0x11')](function(){return _0x2b45c4;});})[_0x4da2('0x11')](function(){_0x596f6d[_0x4da2('0x1e')](0xcc)[_0x4da2('0x32')]();});}};}function handleEntityNotFound(_0x12ab7a){return function(_0x411ab4){if(!_0x411ab4){_0x12ab7a[_0x4da2('0x1d')](0x194);}return _0x411ab4;};}function handleError(_0x48d0c3,_0x2a2ec7){_0x2a2ec7=_0x2a2ec7||0x1f4;return function(_0x4ca8b9){logger['error'](_0x4ca8b9[_0x4da2('0x33')]);if(_0x4ca8b9[_0x4da2('0x34')]){delete _0x4ca8b9[_0x4da2('0x34')];}_0x48d0c3[_0x4da2('0x1e')](_0x2a2ec7)[_0x4da2('0x35')](_0x4ca8b9);};}exports[_0x4da2('0x36')]=function(_0x186ff,_0xdf4454){var _0x59d5d2={},_0x172acb={'count':0x0,'rows':[]};var _0x70b130=_(db[_0x4da2('0x37')][_0x4da2('0x38')])[_0x4da2('0x39')](function(_0x2c3545){return{'name':_0x2c3545['fieldName'],'type':_0x2c3545['type'][_0x4da2('0x3a')]};})[_0x4da2('0x2d')](function(_0x269844){return!_[_0x4da2('0x2f')]([_0x4da2('0x3b'),_0x4da2('0x3c')],_0x269844[_0x4da2('0x34')]);})[_0x4da2('0x30')]();_0x59d5d2=qs[_0x4da2('0x3d')](_0x70b130,_0x186ff);var _0x59f465={'where':_0x59d5d2[_0x4da2('0x3e')]};return db[_0x4da2('0x37')][_0x4da2('0x23')](_0x59f465)[_0x4da2('0x11')](function(_0x40f9e8){_0x172acb['count']=_0x40f9e8;if(_0x186ff[_0x4da2('0x3f')][_0x4da2('0x40')]){_0x59d5d2[_0x4da2('0x41')]=[{'all':!![]}];}if(_0x186ff['query'][_0x4da2('0x42')]==='true'){_0x59d5d2['include']=[{'model':db[_0x4da2('0x43')],'as':_0x4da2('0x42')}];}if(!_[_0x4da2('0x2f')](_0x59d5d2[_0x4da2('0x44')],'id')){_0x59d5d2[_0x4da2('0x44')][_0x4da2('0x45')]('id');}return db[_0x4da2('0x37')]['findAll'](_0x59d5d2);})[_0x4da2('0x11')](function(_0xbaef3e){_0x172acb['rows']=_0xbaef3e;if(_0x186ff[_0x4da2('0x3f')][_0x4da2('0x46')]===_0x4da2('0x47')){var _0x28cdf7=[];for(var _0x191693=0x0;_0x191693<_0x172acb[_0x4da2('0x48')][_0x4da2('0x49')];_0x191693++){_0x28cdf7[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4a'),_0x172acb['rows'][_0x191693][_0x4da2('0x4b')]));_0x28cdf7[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4c'),_0x172acb['rows'][_0x191693][_0x4da2('0x4b')]));_0x28cdf7[_0x4da2('0x45')](get_open_tabs('fax',_0x172acb[_0x4da2('0x48')][_0x191693][_0x4da2('0x4b')]));_0x28cdf7['push'](get_open_tabs(_0x4da2('0x4d'),_0x172acb[_0x4da2('0x48')][_0x191693][_0x4da2('0x4b')]));_0x28cdf7[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4e'),_0x172acb['rows'][_0x191693][_0x4da2('0x4b')]));_0x28cdf7[_0x4da2('0x45')](get_open_tabs('whatsapp',_0x172acb[_0x4da2('0x48')][_0x191693][_0x4da2('0x4b')]));}return BPromise[_0x4da2('0x4f')](_0x28cdf7)['then'](function(){return _0x172acb;});}else{return _0x172acb;}})[_0x4da2('0x11')](respondWithFilteredResult(_0xdf4454,_0x59d5d2))[_0x4da2('0x1c')](handleError(_0xdf4454,null));};exports[_0x4da2('0x50')]=function(_0x3040a2,_0x51caa5){var _0x1f5469={'raw':![],'where':{'id':_0x3040a2[_0x4da2('0x51')]['id']}},_0x45da06={};_0x45da06[_0x4da2('0x52')]=_[_0x4da2('0x53')](_[_0x4da2('0x54')](db['User'][_0x4da2('0x38')]),['password',_0x4da2('0x3c')]);_0x45da06[_0x4da2('0x3f')]=_[_0x4da2('0x54')](_0x3040a2[_0x4da2('0x3f')]);_0x45da06[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x45da06[_0x4da2('0x52')],_0x45da06[_0x4da2('0x3f')]);_0x1f5469[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x45da06[_0x4da2('0x52')],qs['fields'](_0x3040a2[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x1f5469['attributes']=_0x1f5469[_0x4da2('0x44')][_0x4da2('0x49')]?_0x1f5469[_0x4da2('0x44')]:_0x45da06[_0x4da2('0x52')];if(_0x3040a2[_0x4da2('0x3f')][_0x4da2('0x40')]){_0x1f5469[_0x4da2('0x41')]=[{'all':!![]}];}if(_0x3040a2['query']['userSetting']===_0x4da2('0x47')){_0x1f5469[_0x4da2('0x41')]=[{'model':db['UserSetting'],'as':_0x4da2('0x42')}];}_0x1f5469=_[_0x4da2('0x58')]({},_0x1f5469,_0x3040a2[_0x4da2('0x59')]);if(!_[_0x4da2('0x2f')](_0x1f5469['attributes'],'id')){_0x1f5469[_0x4da2('0x44')][_0x4da2('0x45')]('id');}return db[_0x4da2('0x37')][_0x4da2('0x5a')](_0x1f5469)[_0x4da2('0x11')](handleEntityNotFound(_0x51caa5,null))['then'](function(_0x126ac8){var _0x4de241=[];values=_0x126ac8;if(_0x3040a2[_0x4da2('0x3f')][_0x4da2('0x46')]==='true'){_0x4de241[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4a'),_0x126ac8['dataValues']));_0x4de241[_0x4da2('0x45')](get_open_tabs('sms',_0x126ac8[_0x4da2('0x4b')]));_0x4de241[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4e'),_0x126ac8['dataValues']));_0x4de241[_0x4da2('0x45')](get_open_tabs('whatsapp',_0x126ac8[_0x4da2('0x4b')]));_0x4de241[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x5b'),_0x126ac8['dataValues']));_0x4de241[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4d'),_0x126ac8[_0x4da2('0x4b')]));return BPromise['all'](_0x4de241);}else{return values;}})[_0x4da2('0x11')](function(){return values;})['then'](respondWithResult(_0x51caa5,null))[_0x4da2('0x1c')](handleError(_0x51caa5,null));};exports[_0x4da2('0x25')]=function(_0x1e6c45,_0x409565){if(_0x1e6c45[_0x4da2('0x5c')]['id']){delete _0x1e6c45[_0x4da2('0x5c')]['id'];}delete _0x1e6c45[_0x4da2('0x5c')]['role'];return db[_0x4da2('0x37')]['find']({'where':{'id':_0x1e6c45['params']['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x409565,null))[_0x4da2('0x11')](saveUpdates(_0x1e6c45[_0x4da2('0x5c')],null))[_0x4da2('0x11')](respondWithResult(_0x409565,null))['catch'](handleError(_0x409565,null));};exports[_0x4da2('0x5d')]=function(_0x4bce59,_0x1cc68e){return db['User'][_0x4da2('0x5d')]()[_0x4da2('0x11')](respondWithResult(_0x1cc68e,null))[_0x4da2('0x1c')](handleError(_0x1cc68e,null));};exports[_0x4da2('0x5e')]=function(_0x5c1783,_0x2dd05b){return db[_0x4da2('0x37')][_0x4da2('0x5a')]({'where':{'id':_0x5c1783[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x2dd05b,null))[_0x4da2('0x11')](function(_0x1fd7e2){if(_0x1fd7e2){return _0x1fd7e2[_0x4da2('0x5e')](_0x5c1783[_0x4da2('0x5c')][_0x4da2('0x5f')],_[_0x4da2('0x60')](_0x5c1783[_0x4da2('0x5c')],[_0x4da2('0x5f'),'id'])||{});}})[_0x4da2('0x11')](respondWithResult(_0x2dd05b,null))[_0x4da2('0x1c')](handleError(_0x2dd05b,null));};function validateUser(_0x422bef){return new BPromise(function(_0x5a52dc,_0x176dde){if(_0x422bef[_0x4da2('0x61')])return _0x5a52dc(_0x422bef);return db[_0x4da2('0x62')][_0x4da2('0x63')](0x1)[_0x4da2('0x11')](function(_0xe75a31){if(_0xe75a31[_0x4da2('0x64')])authService[_0x4da2('0x65')](_0x422bef[_0x4da2('0x3b')]);db['User'][_0x4da2('0x66')](_0x4da2('0x61'))[_0x4da2('0x11')](function(_0x1b414d){if(_[_0x4da2('0x67')](_0x1b414d)){_0x422bef['internal']=_0xe75a31[_0x4da2('0x68')]||0x1;return;}if(_['isNil'](_0xe75a31[_0x4da2('0x68')])||_0xe75a31[_0x4da2('0x68')]===_0x1b414d){_0x422bef['internal']=_0x1b414d+0x1;return;}if(_0xe75a31[_0x4da2('0x68')]>_0x1b414d){_0x422bef[_0x4da2('0x61')]=_0xe75a31['min_internal'];return;}return db[_0x4da2('0x69')][_0x4da2('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[_0x4da2('0x69')][_0x4da2('0x6a')][_0x4da2('0x6b')]})[_0x4da2('0x11')](function(_0x2fa53a){if(_0x2fa53a&&_0x2fa53a['length']){for(var _0xae0e22=0x0,_0x2ef154=_0x2fa53a['length'];_0xae0e22<_0x2ef154&&_[_0x4da2('0x67')](_0x422bef[_0x4da2('0x61')]);_0xae0e22++){if(_0xe75a31['min_internal']<=_0x2fa53a[_0xae0e22][_0x4da2('0x6c')]){_0x422bef['internal']=_0x2fa53a[_0xae0e22][_0x4da2('0x6c')];}else if(_0xe75a31[_0x4da2('0x68')]>_0x2fa53a[_0xae0e22]['from']&&_0xe75a31[_0x4da2('0x68')]<=_0x2fa53a[_0xae0e22]['to']){_0x422bef[_0x4da2('0x61')]=_0xe75a31[_0x4da2('0x68')];}}}if(_['isNil'](_0x422bef[_0x4da2('0x61')])){_0x422bef['internal']=_0x1b414d+0x1;}return _0x5a52dc(_0x422bef);});});})[_0x4da2('0x1c')](function(_0x5a8b2d){_0x176dde(_0x5a8b2d);});});}function updateUser(_0x155f06){return new BPromise(function(_0x8e5d92,_0x18cf46){try{if(_0x155f06[_0x4da2('0x6d')]){_0x155f06[_0x4da2('0x6e')]=_0x155f06[_0x4da2('0x61')];_0x155f06['VoiceMail']={'mailbox':_0x155f06[_0x4da2('0x61')],'password':_0x155f06[_0x4da2('0x3b')],'fullname':_0x155f06[_0x4da2('0x6f')],'email':_0x155f06[_0x4da2('0x70')]};}if(_0x155f06[_0x4da2('0x27')]==='agent'){if(!_0x155f06[_0x4da2('0x71')])_0x155f06['permissions']=[_0x4da2('0x72'),'102',_0x4da2('0x73'),_0x4da2('0x74'),_0x4da2('0x75'),_0x4da2('0x76'),_0x4da2('0x77'),_0x4da2('0x78'),'107','108','109',_0x4da2('0x79'),_0x4da2('0x7a'),'114',_0x4da2('0x7b')];}_0x8e5d92(_0x155f06);}catch(_0x2c28cb){_0x18cf46(_0x2c28cb);}});}exports[_0x4da2('0x7c')]=function(_0x3f436b,_0x6c759e){if(_0x3f436b[_0x4da2('0x29')][_0x4da2('0x27')]===_0x4da2('0x7d'))throw new Error(_0x4da2('0x7e'));if(_0x3f436b[_0x4da2('0x5c')]['role']==='user'&&_0x3f436b[_0x4da2('0x29')]['role']!==_0x4da2('0x7f')){throw new Error(_0x4da2('0x80'));}if(_0x3f436b[_0x4da2('0x5c')]['role']===_0x4da2('0x7f')&&_0x3f436b['user'][_0x4da2('0x27')]!==_0x4da2('0x7f')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x4da2('0x81')]([_0x3f436b[_0x4da2('0x5c')]])[_0x4da2('0x11')](function(){return validateUser(_0x3f436b[_0x4da2('0x5c')]);})[_0x4da2('0x11')](function(_0x4d3fd6){return updateUser(_0x4d3fd6)['then'](function(_0x40291f){if(_0x40291f[_0x4da2('0x27')]===_0x4da2('0x7f')){_0x40291f[_0x4da2('0x82')]=_0x3f436b[_0x4da2('0x29')][_0x4da2('0x82')];delete _0x40291f[_0x4da2('0x83')];}return _0x40291f;});})[_0x4da2('0x11')](function(_0xab8b18){return db[_0x4da2('0x37')][_0x4da2('0x7c')](_0xab8b18,{'include':[{'model':db[_0x4da2('0x84')],'as':_0x4da2('0x84')}]});})[_0x4da2('0x11')](function(_0x1006a9){if(_0x3f436b[_0x4da2('0x5c')][_0x4da2('0x27')]===_0x4da2('0x29'))return _0x1006a9;if(_0x3f436b[_0x4da2('0x29')]['role']!=='user')return _0x1006a9;return db['UserProfileSection'][_0x4da2('0x5a')]({'where':{'name':_0x1006a9[_0x4da2('0x27')]===_0x4da2('0x7d')?'Agents':'Telephones','userProfileId':_0x3f436b['user'][_0x4da2('0x83')]},'raw':!![]})[_0x4da2('0x11')](function(_0x40d370){if(!_0x40d370||_0x40d370[_0x4da2('0x85')]!=0x0)return _0x1006a9;return db[_0x4da2('0x31')][_0x4da2('0x7c')]({'name':_0x1006a9[_0x4da2('0x34')],'resourceId':_0x1006a9['id'],'type':_0x40d370[_0x4da2('0x34')],'sectionId':_0x40d370['id']},{})[_0x4da2('0x11')](function(){return _0x1006a9;});})[_0x4da2('0x1c')](function(_0x445876){logger[_0x4da2('0x17')](_0x4da2('0x86'),_0x445876);throw _0x445876;});})[_0x4da2('0x11')](respondWithResult(_0x6c759e,0xc9))[_0x4da2('0x1c')](handleError(_0x6c759e,null));};exports[_0x4da2('0x87')]=function(_0x303823,_0x2ce389){var _0x48bbc7=_0x303823[_0x4da2('0x5c')];var _0x5aaf1f=[];if(_0x303823['user'][_0x4da2('0x27')]==='agent')throw new Error(_0x4da2('0x7e'));if(_[_0x4da2('0x88')](_0x48bbc7,[_0x4da2('0x27'),_0x4da2('0x29')])&&_0x303823[_0x4da2('0x29')]['role']!==_0x4da2('0x7f')){throw new Error(_0x4da2('0x80'));}if(_[_0x4da2('0x88')](_0x48bbc7,['role',_0x4da2('0x7f')])&&_0x303823[_0x4da2('0x29')][_0x4da2('0x27')]!==_0x4da2('0x7f')){throw new Error(_0x4da2('0x89'));}return licenseUtil[_0x4da2('0x81')](_0x48bbc7)['then'](function(){return validateUser(_0x48bbc7[0x0]);})[_0x4da2('0x11')](function(){for(var _0x477da1=0x1;_0x477da1<_0x48bbc7[_0x4da2('0x49')];_0x477da1++){var _0x2e2167=_0x48bbc7[_0x477da1-0x1][_0x4da2('0x61')];if(!_0x48bbc7[_0x477da1]['internal'])_0x48bbc7[_0x477da1][_0x4da2('0x61')]=_0x2e2167+0x1;_0x5aaf1f[_0x4da2('0x45')](validateUser(_0x48bbc7[_0x477da1]));}return BPromise['all'](_0x5aaf1f);})[_0x4da2('0x11')](function(){_0x5aaf1f=[];for(var _0x57ccb8=0x0;_0x57ccb8<_0x48bbc7[_0x4da2('0x49')];_0x57ccb8++){_0x5aaf1f[_0x4da2('0x45')](updateUser(_0x48bbc7[_0x57ccb8]));}return BPromise[_0x4da2('0x4f')](_0x5aaf1f);})[_0x4da2('0x11')](function(){return BPromise['each'](_0x48bbc7,function(_0xfd903){return db['User'][_0x4da2('0x7c')](_0xfd903,{'include':[{'model':db[_0x4da2('0x84')],'as':_0x4da2('0x84')}]})[_0x4da2('0x11')](function(_0x401706){_0xfd903['id']=_0x401706['id'];return _0xfd903;});});})[_0x4da2('0x11')](function(_0x1475e1){if(_0x303823[_0x4da2('0x5c')][_0x4da2('0x27')]===_0x4da2('0x29'))return _0x1475e1;if(_0x303823['user']['role']!==_0x4da2('0x29'))return _0x1475e1;var _0x384114=_[_0x4da2('0x88')](_0x1475e1,function(_0x5a9f3b){return _0x5a9f3b['role']==='agent'||_0x5a9f3b[_0x4da2('0x27')]===_0x4da2('0x2c');});if(!_0x384114)return _0x1475e1;return db['UserProfileSection'][_0x4da2('0x8a')]({'where':{'name':{'$or':[_0x4da2('0x2a'),_0x4da2('0x2b')]},'userProfileId':_0x303823['user']['userProfileId']},'raw':!![]})['then'](function(_0x1acf6d){if(_['isEmpty'](_0x1acf6d)||!_[_0x4da2('0x88')](_0x1acf6d,[_0x4da2('0x85'),0x0]))return _0x1475e1;_0x5aaf1f=[];var _0x480305=_(_0x1acf6d)[_0x4da2('0x39')](function(_0x17cf3c){if(_0x17cf3c[_0x4da2('0x85')]===0x1)return;return _0x17cf3c['name']===_0x4da2('0x2a')?_0x4da2('0x7d'):_0x4da2('0x2c');})[_0x4da2('0x8b')]()[_0x4da2('0x30')]();for(var _0x5d3c38=0x0;_0x5d3c38<_0x1475e1[_0x4da2('0x49')];_0x5d3c38++){if(!_[_0x4da2('0x2f')](_0x480305,_0x1475e1[_0x5d3c38]['role']))return;var _0x15c6c8=_0x1475e1[_0x5d3c38][_0x4da2('0x27')]===_0x4da2('0x7d')?'Agents':_0x4da2('0x2b');_0x5aaf1f[_0x4da2('0x45')](db[_0x4da2('0x31')][_0x4da2('0x7c')]({'name':_0x1475e1[_0x5d3c38][_0x4da2('0x34')],'resourceId':_0x1475e1[_0x5d3c38]['id'],'type':_0x15c6c8,'sectionId':_['find'](_0x1acf6d,[_0x4da2('0x34'),_0x15c6c8])['id']},{}));}return BPromise[_0x4da2('0x4f')](_0x5aaf1f);});})[_0x4da2('0x11')](respondWithResult(_0x2ce389,0xc9))['catch'](handleError(_0x2ce389,null));};exports['changePassword']=function(_0x288dff,_0x515b87){if(_0x288dff[_0x4da2('0x5c')]['id']){delete _0x288dff[_0x4da2('0x5c')]['id'];}return db[_0x4da2('0x37')][_0x4da2('0x5a')]({'where':{'id':_0x288dff['params']['id']}})[_0x4da2('0x11')](function(_0x252f2f){if(!_0x252f2f)return null;if(_0x252f2f['id']===_0x288dff[_0x4da2('0x29')]['id']){if(!_0x288dff[_0x4da2('0x5c')]['oldPassword']||!_0x288dff[_0x4da2('0x5c')][_0x4da2('0x8c')]){throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))](_0x4da2('0x8f'));}if(!_0x252f2f[_0x4da2('0x90')](_0x288dff[_0x4da2('0x5c')][_0x4da2('0x91')])){throw new db[(_0x4da2('0x8d'))]['ValidationError'](_0x4da2('0x92'));}if(_0x288dff[_0x4da2('0x5c')][_0x4da2('0x91')]===_0x288dff[_0x4da2('0x5c')][_0x4da2('0x8c')]){throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x288dff['user']['role']===_0x4da2('0x7f')){if(!_0x288dff[_0x4da2('0x5c')]['newPassword']){throw new db['Sequelize'][(_0x4da2('0x8e'))](_0x4da2('0x93'));}}else if(_0x288dff[_0x4da2('0x29')][_0x4da2('0x27')]===_0x4da2('0x29')){if(!_0x288dff['body'][_0x4da2('0x8c')]){throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))](_0x4da2('0x93'));}if(_0x252f2f[_0x4da2('0x27')]!==_0x4da2('0x7d')){throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))](_0x4da2('0x7e'));}}else{throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))](_0x4da2('0x7e'));}return _0x252f2f;})[_0x4da2('0x11')](handleEntityNotFound(_0x515b87,null))[_0x4da2('0x11')](function(_0x37324e){return db[_0x4da2('0x62')][_0x4da2('0x94')]({'attributes':['id',_0x4da2('0x64'),'enforcePasswordHistory',_0x4da2('0x95')]})[_0x4da2('0x11')](function(_0x1b5200){if(_0x1b5200['securePassword'])authService['validatePasswordPattern'](_0x288dff[_0x4da2('0x5c')][_0x4da2('0x8c')]);if(!_0x1b5200[_0x4da2('0x96')]||!_0x37324e[_0x4da2('0x97')])return _0x37324e;authService[_0x4da2('0x98')](_0x288dff[_0x4da2('0x5c')][_0x4da2('0x8c')],_0x37324e['previousPasswords'],_0x1b5200['passwordHistoryLimit']);return _0x37324e;})[_0x4da2('0x11')](saveUpdates({'password':_0x288dff[_0x4da2('0x5c')][_0x4da2('0x8c')],'passwordResetAt':_0x288dff['user']['id']==_0x288dff[_0x4da2('0x51')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x288dff['body'][_0x4da2('0x8c')],_0x37324e[_0x4da2('0x97')])},null));})[_0x4da2('0x11')](respondWithResult(_0x515b87,null))['catch'](handleError(_0x515b87,null));};exports[_0x4da2('0x99')]=function(_0x50c6ef,_0x1157e3){var _0x1617a7=_0x50c6ef[_0x4da2('0x5c')][_0x4da2('0x9a')];return db['User'][_0x4da2('0x5a')]({'where':{'id':_0x50c6ef[_0x4da2('0x51')]['id']},'attributes':['id',_0x4da2('0x34'),_0x4da2('0x27'),_0x4da2('0x9b'),_0x4da2('0x9c'),_0x4da2('0x9d'),_0x4da2('0x9e')]})[_0x4da2('0x11')](handleEntityNotFound(_0x1157e3,null))[_0x4da2('0x11')](function(_0x3a7b00){if(_0x3a7b00){if(!utils[_0x4da2('0x9f')](_0x1617a7)){throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))](_0x4da2('0xa0'));}return _0x3a7b00['add'+_['capitalize'](_0x1617a7[_0x4da2('0xa1')]())+_0x4da2('0xa2')](_0x50c6ef[_0x4da2('0x5c')]['ids'],{'penalty':_0x50c6ef[_0x4da2('0x5c')][_0x4da2('0xa3')]||0x0})[_0x4da2('0xa4')](function(_0x54fc8f){for(var _0xc10fe5=0x0;_0xc10fe5<_0x50c6ef['body']['ids'][_0x4da2('0x49')];_0xc10fe5+=0x1){var _0x32d04a={'UserId':Number(_0x50c6ef[_0x4da2('0x51')]['id'])};_0x32d04a[_['capitalize'](_0x1617a7[_0x4da2('0xa1')]())+'QueueId']=Number(_0x50c6ef[_0x4da2('0x5c')][_0x4da2('0x5f')][_0xc10fe5]);socket[_0x4da2('0xa5')]('user'+_[_0x4da2('0xa6')](_0x1617a7[_0x4da2('0xa1')]())+_0x4da2('0xa7'),_0x32d04a);}return _0x54fc8f;})[_0x4da2('0x11')](function(){if(_0x1617a7==='voice'){return db['VoiceQueue'][_0x4da2('0x8a')]({'where':{'id':_0x50c6ef[_0x4da2('0x5c')][_0x4da2('0x5f')]||[]},'raw':!![],'attributes':['id',_0x4da2('0x34')]});}})[_0x4da2('0x11')](function(_0x269e02){var _0x50f7e6=_0x3a7b00['get']({'plain':!![]});var _0x37f283=[];if(_0x1617a7==='voice'&&_0x50f7e6['role']===_0x4da2('0x7d')&&_0x50f7e6[_0x4da2('0x9b')]){for(var _0x127936=0x0;_0x127936<_0x269e02[_0x4da2('0x49')];_0x127936+=0x1){_0x37f283['push']({'membername':_0x50f7e6[_0x4da2('0x34')],'UserId':_0x50f7e6['id'],'queue_name':_0x269e02[_0x127936][_0x4da2('0x34')],'VoiceQueueId':_0x269e02[_0x127936]['id'],'interface':_['isNil'](_0x50f7e6[_0x4da2('0x9e')])?util[_0x4da2('0xa8')](_0x4da2('0xa9'),_0x50f7e6[_0x4da2('0x34')]):_0x50f7e6[_0x4da2('0x9e')],'paused':_0x50f7e6[_0x4da2('0x9d')]||![],'penalty':_0x50c6ef[_0x4da2('0x5c')]['penalty']||0x0});}return BPromise[_0x4da2('0xaa')](_0x37f283,function(_0x4047e0){return db['UserVoiceQueueRt'][_0x4da2('0xab')](_0x4047e0);});}return _0x3a7b00;});}})[_0x4da2('0x11')](respondWithStatusCode(_0x1157e3,null))[_0x4da2('0x1c')](handleError(_0x1157e3,null));};exports[_0x4da2('0xac')]=function(_0x1c9acc,_0x54b729){var _0x410db5,_0x5cf6b7;return db[_0x4da2('0x37')][_0x4da2('0x5a')]({'where':{'id':_0x1c9acc[_0x4da2('0x51')]['id']},'attributes':['id','name',_0x4da2('0x27')]})[_0x4da2('0x11')](handleEntityNotFound(_0x54b729,null))[_0x4da2('0x11')](function(_0x1fa6b8){if(_0x1fa6b8){_0x410db5=_0x1fa6b8;if(!_0x1c9acc[_0x4da2('0x3f')]['channel']||!utils[_0x4da2('0x9f')](_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x9a')])){throw new db['Sequelize']['ValidationError'](_0x4da2('0xa0'));}return _0x1fa6b8[_0x4da2('0xad')+_['capitalize'](_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x9a')]['toLowerCase']())+_0x4da2('0xa2')](_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x5f')]);}})[_0x4da2('0x11')](function(_0x43ada5){if(_[_0x4da2('0xae')](_0x1c9acc['query'][_0x4da2('0x5f')])){for(var _0xb5136f=0x0;_0xb5136f<_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x5f')]['length'];_0xb5136f+=0x1){_0x5cf6b7={'UserId':Number(_0x1c9acc[_0x4da2('0x51')]['id'])};_0x5cf6b7[_[_0x4da2('0xa6')](_0x1c9acc[_0x4da2('0x3f')]['channel'][_0x4da2('0xa1')]())+_0x4da2('0xaf')]=Number(_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x5f')][_0xb5136f]);socket[_0x4da2('0xa5')]('user'+_[_0x4da2('0xa6')](_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x9a')][_0x4da2('0xa1')]())+_0x4da2('0xb0'),_0x5cf6b7);}}else{_0x5cf6b7={'UserId':Number(_0x1c9acc[_0x4da2('0x51')]['id'])};_0x5cf6b7[_[_0x4da2('0xa6')](_0x1c9acc['query'][_0x4da2('0x9a')][_0x4da2('0xa1')]())+_0x4da2('0xaf')]=Number(_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x5f')]);socket[_0x4da2('0xa5')]('user'+_[_0x4da2('0xa6')](_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x9a')][_0x4da2('0xa1')]())+_0x4da2('0xb0'),_0x5cf6b7);}return _0x43ada5;})[_0x4da2('0x11')](function(){if(_0x1c9acc[_0x4da2('0x3f')][_0x4da2('0x9a')]===_0x4da2('0xb1')){return db[_0x4da2('0xb2')]['destroy']({'where':{'UserId':_0x1c9acc['params']['id'],'VoiceQueueId':_0x1c9acc['query'][_0x4da2('0x5f')]},'individualHooks':!![]})[_0x4da2('0x11')](function(){return _0x410db5;});}return _0x410db5;})[_0x4da2('0x11')](respondWithStatusCode(_0x54b729,null))['catch'](handleError(_0x54b729,null));};exports[_0x4da2('0xb3')]=function(_0x4999a3,_0x32479a){_0x4999a3[_0x4da2('0x5c')][_0x4da2('0xb4')]=_0x4999a3[_0x4da2('0xb5')][_0x4da2('0xb6')];return db[_0x4da2('0x37')][_0x4da2('0x5a')]({'where':{'id':_0x4999a3[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x32479a,null))[_0x4da2('0x11')](saveUpdates(_0x4999a3[_0x4da2('0x5c')],null))['then'](respondWithResult(_0x32479a,null))[_0x4da2('0x1c')](handleError(_0x32479a,null));};exports[_0x4da2('0xb7')]=function(_0x26acfc,_0x3a39ec){var _0x1df359=path[_0x4da2('0xb8')](config[_0x4da2('0xb9')],_0x4da2('0xba'));return db[_0x4da2('0x37')][_0x4da2('0x5a')]({'where':{'id':_0x26acfc[_0x4da2('0x51')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x4da2('0x11')](handleEntityNotFound(_0x3a39ec,null))[_0x4da2('0x11')](function(_0x3f7f76){if(_0x3f7f76){if(_[_0x4da2('0x67')](_0x3f7f76[_0x4da2('0xb4')])){return _0x3a39ec['download'](_0x1df359);}else{if(!fs[_0x4da2('0xbb')](path['join'](config['root'],_0x4da2('0xbc'),_0x3f7f76[_0x4da2('0xb4')]))){return _0x3a39ec[_0x4da2('0xbd')](_0x1df359);}return _0x3a39ec[_0x4da2('0xbd')](path[_0x4da2('0xb8')](config[_0x4da2('0xb9')],_0x4da2('0xbc'),_0x3f7f76[_0x4da2('0xb4')]));}}})['catch'](handleError(_0x3a39ec,null));};exports[_0x4da2('0xbe')]=function(_0x1b47b9,_0xb6f90a){return db[_0x4da2('0x37')]['find']({'where':{'id':_0x1b47b9[_0x4da2('0x51')]['id']},'attributes':['id']})[_0x4da2('0x11')](handleEntityNotFound(_0xb6f90a,null))[_0x4da2('0x11')](function(_0x540647){var _0x2dfd1f=[];values=_0x540647[_0x4da2('0x4b')];_0x2dfd1f[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4a'),_0x540647[_0x4da2('0x4b')]));_0x2dfd1f[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x4c'),_0x540647[_0x4da2('0x4b')]));_0x2dfd1f['push'](get_open_tabs(_0x4da2('0x4e'),_0x540647[_0x4da2('0x4b')]));_0x2dfd1f[_0x4da2('0x45')](get_open_tabs(_0x4da2('0xbf'),_0x540647[_0x4da2('0x4b')]));_0x2dfd1f[_0x4da2('0x45')](get_open_tabs(_0x4da2('0x5b'),_0x540647[_0x4da2('0x4b')]));_0x2dfd1f['push'](get_open_tabs('mail',_0x540647[_0x4da2('0x4b')]));return BPromise['all'](_0x2dfd1f);})[_0x4da2('0x11')](function(_0x551d2d){if(_0x551d2d){var _0x4171c6=_['map'](values[_0x4da2('0xc0')],function(_0x293bd1){return{'channel':_0x4da2('0xc1'),'id':_0x293bd1['id'],'createdAt':_0x293bd1[_0x4da2('0xc2')]};});var _0x39cded=_[_0x4da2('0x39')](values['FaxOpenTabs'],function(_0x3f03f5){return{'channel':_0x4da2('0xc3'),'id':_0x3f03f5['id'],'createdAt':_0x3f03f5[_0x4da2('0xc2')]};});var _0x5df6d5=_[_0x4da2('0x39')](values[_0x4da2('0xc4')],function(_0x3aa3c4){return{'channel':_0x4da2('0xc5'),'id':_0x3aa3c4['id'],'createdAt':_0x3aa3c4[_0x4da2('0xc2')]};});var _0x5d0a5b=_[_0x4da2('0x39')](values['MailOpenTabs'],function(_0x3a0d7c){return{'channel':_0x4da2('0xc6'),'id':_0x3a0d7c['id'],'createdAt':_0x3a0d7c[_0x4da2('0xc2')]};});var _0x5be85b=_[_0x4da2('0x39')](values['SmsOpenTabs'],function(_0x105b09){return{'channel':_0x4da2('0xc7'),'id':_0x105b09['id'],'createdAt':_0x105b09['createdAt']};});var _0x31b684=_[_0x4da2('0x39')](values[_0x4da2('0xc8')],function(_0x59d953){return{'channel':_0x4da2('0xc9'),'id':_0x59d953['id'],'createdAt':_0x59d953[_0x4da2('0xc2')]};});var _0x493bf2=_['concat'](_0x4171c6,_0x39cded,_0x5df6d5,_0x5d0a5b,_0x5be85b,_0x31b684);var _0x4d6382={'count':_0x493bf2[_0x4da2('0x49')],'rows':_0x493bf2};return _0x4d6382;}else return null;})[_0x4da2('0x11')](respondWithResult(_0xb6f90a,null))[_0x4da2('0x1c')](handleError(_0xb6f90a,null));};exports[_0x4da2('0xca')]=function(_0x1a895d,_0x446e2f){var _0x476961={};var _0x2ba90a={};var _0x10a4ee;var _0x3d5135;return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0x1a895d[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x446e2f,null))['then'](function(_0x3a8e90){if(_0x3a8e90){_0x10a4ee=_0x3a8e90;_0x2ba90a[_0x4da2('0x52')]=_[_0x4da2('0x54')](db[_0x4da2('0xcb')][_0x4da2('0x38')]);_0x2ba90a[_0x4da2('0x3f')]=_['keys'](_0x1a895d[_0x4da2('0x3f')]);_0x2ba90a[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x2ba90a[_0x4da2('0x52')],_0x2ba90a['query']);_0x476961['attributes']=_[_0x4da2('0x56')](_0x2ba90a[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x1a895d[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x476961[_0x4da2('0x44')]=_0x476961['attributes']['length']?_0x476961[_0x4da2('0x44')]:_0x2ba90a['model'];_0x476961[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0x1a895d[_0x4da2('0x3f')]['sort']);_0x476961['where']=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x1a895d[_0x4da2('0x3f')],_0x2ba90a['filters']));if(_0x1a895d[_0x4da2('0x3f')]['filter']){_0x476961[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x476961[_0x4da2('0x3e')],{'$or':_['map'](_0x476961['attributes'],function(_0x4f3c0e){var _0x268031={};_0x268031[_0x4f3c0e]={'$like':'%'+_0x1a895d[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x268031;})});}_0x476961=_[_0x4da2('0x58')]({},_0x476961,_0x1a895d[_0x4da2('0x59')]);return _0x10a4ee[_0x4da2('0xca')](_0x476961);}})[_0x4da2('0x11')](function(_0x494918){if(_0x494918){_0x3d5135=_0x494918[_0x4da2('0x49')];if(_0x1a895d[_0x4da2('0x3f')][_0x4da2('0xcf')]('includeAll')){_0x476961[_0x4da2('0x41')]=[{'model':db['CmList'],'as':_0x4da2('0xd0'),'required':![]},{'model':db[_0x4da2('0xd1')],'as':_0x4da2('0xd2'),'attributes':['id','name','color'],'where':_0x1a895d[_0x4da2('0x3f')]['tag']?{'id':_0x1a895d['query'][_0x4da2('0xd3')]}:undefined,'required':_0x1a895d[_0x4da2('0x3f')][_0x4da2('0xd3')]?!![]:![]}];}if(!_0x1a895d[_0x4da2('0x3f')][_0x4da2('0xcf')](_0x4da2('0xd4'))){_0x476961[_0x4da2('0x22')]=qs[_0x4da2('0x22')](_0x1a895d[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x476961[_0x4da2('0x20')]=qs[_0x4da2('0x20')](_0x1a895d[_0x4da2('0x3f')]['offset']);}return _0x10a4ee[_0x4da2('0xca')](_0x476961);}})[_0x4da2('0x11')](function(_0x4b79ab){if(_0x4b79ab){return _0x4b79ab?{'count':_0x3d5135,'rows':_0x4b79ab}:null;}})[_0x4da2('0x11')](respondWithResult(_0x446e2f,null))[_0x4da2('0x1c')](handleError(_0x446e2f,null));};exports[_0x4da2('0xd5')]=function(_0x32cfa2,_0x460081){var _0x298efd;var _0x2bfd88={};var _0x25235b;return db['User'][_0x4da2('0x94')]({'where':{'id':_0x32cfa2[_0x4da2('0x51')]['id']},'attributes':['id',_0x4da2('0x34'),_0x4da2('0x27')]})['then'](handleEntityNotFound(_0x460081,null))[_0x4da2('0x11')](function(_0x12425c){if(!utils[_0x4da2('0x9f')](_0x32cfa2['query']['channel'])){throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))](_0x4da2('0xa0'));}_0x298efd=_0x12425c;var _0x4284ce={};_0x4284ce[_0x4da2('0x52')]=_[_0x4da2('0x54')](db[_[_0x4da2('0xa6')](_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0x9a')])+'Queue'][_0x4da2('0x38')]);_0x4284ce['query']=_['keys'](_0x32cfa2['query']);_0x4284ce[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x4284ce[_0x4da2('0x52')],_0x4284ce[_0x4da2('0x3f')]);_0x2bfd88[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x4284ce[_0x4da2('0x52')],qs['fields'](_0x32cfa2['query'][_0x4da2('0x57')]));_0x2bfd88['attributes']=_0x2bfd88[_0x4da2('0x44')][_0x4da2('0x49')]?_0x2bfd88[_0x4da2('0x44')]:_0x4284ce[_0x4da2('0x52')];_0x2bfd88['order']=qs[_0x4da2('0xcd')](_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0xcd')]);_0x2bfd88[_0x4da2('0x3e')]=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x32cfa2['query'],_0x4284ce[_0x4da2('0x55')]));if(_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x2bfd88[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x2bfd88[_0x4da2('0x3e')],{'$or':_['map'](_0x2bfd88[_0x4da2('0x44')],function(_0x4e118e){var _0x1ee43b={};_0x1ee43b[_0x4e118e]={'$like':'%'+_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x1ee43b;})});}_0x2bfd88=_[_0x4da2('0x58')]({},_0x2bfd88,_0x32cfa2['options']);switch(_0x298efd['role']){case'admin':return db[_['capitalize'](_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0x9a')])+_0x4da2('0xd6')][_0x4da2('0x8a')](_0x2bfd88);case _0x4da2('0x29'):case _0x4da2('0x7d'):return _0x298efd[_0x4da2('0xd7')+_[_0x4da2('0xa6')](_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0x9a')])+_0x4da2('0xa2')](_0x2bfd88);default:throw new db[(_0x4da2('0x8d'))]['ValidationError'](_0x4da2('0xd8'));}})[_0x4da2('0x11')](function(_0x32cc34){_0x25235b=_0x32cc34[_0x4da2('0x49')];if(!_0x32cfa2[_0x4da2('0x3f')]['hasOwnProperty'](_0x4da2('0xd4'))){_0x2bfd88['limit']=qs[_0x4da2('0x22')](_0x32cfa2['query'][_0x4da2('0x22')]);_0x2bfd88[_0x4da2('0x20')]=qs[_0x4da2('0x20')](_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0x20')]);}switch(_0x298efd[_0x4da2('0x27')]){case _0x4da2('0x7f'):return db[_[_0x4da2('0xa6')](_0x32cfa2[_0x4da2('0x3f')][_0x4da2('0x9a')])+_0x4da2('0xd6')][_0x4da2('0x8a')](_0x2bfd88);case'user':case _0x4da2('0x7d'):return _0x298efd[_0x4da2('0xd7')+_[_0x4da2('0xa6')](_0x32cfa2['query'][_0x4da2('0x9a')])+_0x4da2('0xa2')](_0x2bfd88);}})[_0x4da2('0x11')](function(_0x10afbc){return{'count':_0x25235b,'rows':_0x10afbc};})['then'](respondWithResult(_0x460081,null))['catch'](handleError(_0x460081,null));};exports[_0x4da2('0xd9')]=function(_0x432bc8,_0x5827b1){var _0x2574a6={};var _0x40dee9={};var _0x2f7946;var _0x33cb72;return db[_0x4da2('0x37')]['findOne']({'where':{'id':_0x432bc8['params']['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x5827b1,null))[_0x4da2('0x11')](function(_0x90eea6){if(_0x90eea6){_0x2f7946=_0x90eea6;_0x40dee9['model']=_[_0x4da2('0x54')](db[_0x4da2('0xb2')][_0x4da2('0x38')]);_0x40dee9[_0x4da2('0x3f')]=_[_0x4da2('0x54')](_0x432bc8[_0x4da2('0x3f')]);_0x40dee9[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x40dee9[_0x4da2('0x52')],_0x40dee9['query']);_0x2574a6[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x40dee9['model'],qs[_0x4da2('0x57')](_0x432bc8[_0x4da2('0x3f')]['fields']));_0x2574a6[_0x4da2('0x44')]=_0x2574a6['attributes'][_0x4da2('0x49')]?_0x2574a6[_0x4da2('0x44')]:_0x40dee9[_0x4da2('0x52')];_0x2574a6['order']=qs[_0x4da2('0xcd')](_0x432bc8[_0x4da2('0x3f')]['sort']);_0x2574a6['where']=qs[_0x4da2('0x55')](_['pick'](_0x432bc8['query'],_0x40dee9[_0x4da2('0x55')]));if(_0x432bc8[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x2574a6[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x2574a6['where'],{'$or':_[_0x4da2('0x39')](_0x2574a6[_0x4da2('0x44')],function(_0x349987){var _0x3d32e2={};_0x3d32e2[_0x349987]={'$like':'%'+_0x432bc8[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x3d32e2;})});}_0x2574a6=_[_0x4da2('0x58')]({},_0x2574a6,_0x432bc8[_0x4da2('0x59')]);return _0x2f7946[_0x4da2('0xd9')](_0x2574a6);}})[_0x4da2('0x11')](function(_0x51db96){if(_0x51db96){_0x33cb72=_0x51db96[_0x4da2('0x49')];if(!_0x432bc8[_0x4da2('0x3f')][_0x4da2('0xcf')]('nolimit')){_0x2574a6[_0x4da2('0x22')]=qs[_0x4da2('0x22')](_0x432bc8[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x2574a6[_0x4da2('0x20')]=qs[_0x4da2('0x20')](_0x432bc8[_0x4da2('0x3f')][_0x4da2('0x20')]);}return _0x2f7946[_0x4da2('0xd9')](_0x2574a6);}})['then'](function(_0x8f5db0){if(_0x8f5db0){return _0x8f5db0?{'count':_0x33cb72,'rows':_0x8f5db0}:null;}})[_0x4da2('0x11')](respondWithResult(_0x5827b1,null))['catch'](handleError(_0x5827b1,null));};exports[_0x4da2('0xda')]=function(_0x2cd814,_0x4f9850){var _0x32debb={};var _0x9a2e35={};var _0x5e7ff0;var _0x4a3c7f;return db[_0x4da2('0x37')]['findOne']({'where':{'id':_0x2cd814[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x4f9850,null))[_0x4da2('0x11')](function(_0x290911){if(_0x290911){_0x5e7ff0=_0x290911;_0x9a2e35[_0x4da2('0x52')]=_[_0x4da2('0x54')](db[_0x4da2('0xdb')][_0x4da2('0x38')]);_0x9a2e35['query']=_[_0x4da2('0x54')](_0x2cd814[_0x4da2('0x3f')]);_0x9a2e35[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x9a2e35['model'],_0x9a2e35[_0x4da2('0x3f')]);_0x32debb['attributes']=_[_0x4da2('0x56')](_0x9a2e35[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x2cd814[_0x4da2('0x3f')]['fields']));_0x32debb[_0x4da2('0x44')]=_0x32debb[_0x4da2('0x44')][_0x4da2('0x49')]?_0x32debb[_0x4da2('0x44')]:_0x9a2e35[_0x4da2('0x52')];_0x32debb[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0x2cd814[_0x4da2('0x3f')]['sort']);_0x32debb[_0x4da2('0x3e')]=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x2cd814['query'],_0x9a2e35[_0x4da2('0x55')]));if(_0x2cd814[_0x4da2('0x3f')]['filter']){_0x32debb[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x32debb[_0x4da2('0x3e')],{'$or':_[_0x4da2('0x39')](_0x32debb[_0x4da2('0x44')],function(_0x20a11c){var _0x15ae9a={};_0x15ae9a[_0x20a11c]={'$like':'%'+_0x2cd814[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x15ae9a;})});}_0x32debb=_[_0x4da2('0x58')]({},_0x32debb,_0x2cd814[_0x4da2('0x59')]);return _0x5e7ff0['getGroups'](_0x32debb);}})[_0x4da2('0x11')](function(_0x38ba96){if(_0x38ba96){_0x4a3c7f=_0x38ba96['length'];if(!_0x2cd814[_0x4da2('0x3f')][_0x4da2('0xcf')](_0x4da2('0xd4'))){_0x32debb[_0x4da2('0x22')]=qs[_0x4da2('0x22')](_0x2cd814[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x32debb[_0x4da2('0x20')]=qs[_0x4da2('0x20')](_0x2cd814[_0x4da2('0x3f')][_0x4da2('0x20')]);}return _0x5e7ff0[_0x4da2('0xda')](_0x32debb);}})['then'](function(_0x19bd51){if(_0x19bd51){return _0x19bd51?{'count':_0x4a3c7f,'rows':_0x19bd51}:null;}})[_0x4da2('0x11')](respondWithResult(_0x4f9850,null))[_0x4da2('0x1c')](handleError(_0x4f9850,null));};exports['getRecordings']=function(_0x5c1f88,_0x27c104){var _0x3fe2e3={'raw':!![],'where':{}};var _0x2c6697={};var _0x29e73f={'count':0x0,'rows':[]};return db[_0x4da2('0x37')]['findOne']({'where':{'id':_0x5c1f88[_0x4da2('0x51')]['id']}})['then'](handleEntityNotFound(_0x27c104,null))['then'](function(_0x51e20f){if(_0x51e20f){_0x2c6697[_0x4da2('0x52')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x2c6697[_0x4da2('0x3f')]=_['keys'](_0x5c1f88['query']);_0x2c6697[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x2c6697['model'],_0x2c6697[_0x4da2('0x3f')]);_0x3fe2e3[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x2c6697[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x5c1f88[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x3fe2e3[_0x4da2('0x44')]=_0x3fe2e3[_0x4da2('0x44')][_0x4da2('0x49')]?_0x3fe2e3['attributes']:_0x2c6697[_0x4da2('0x52')];if(!_0x5c1f88['query'][_0x4da2('0xcf')](_0x4da2('0xd4'))){_0x3fe2e3[_0x4da2('0x22')]=qs[_0x4da2('0x22')](_0x5c1f88[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x3fe2e3[_0x4da2('0x20')]=qs['offset'](_0x5c1f88['query'][_0x4da2('0x20')]);}_0x3fe2e3[_0x4da2('0xcc')]=qs['sort'](_0x5c1f88[_0x4da2('0x3f')][_0x4da2('0xcd')]);_0x3fe2e3[_0x4da2('0x3e')]=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x5c1f88['query'],_0x2c6697['filters']));_0x3fe2e3[_0x4da2('0x3e')]['UserId']=_0x51e20f['id'];if(_0x5c1f88[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x3fe2e3['where']=_[_0x4da2('0x58')](_0x3fe2e3[_0x4da2('0x3e')],{'$or':_['map'](_0x3fe2e3['attributes'],function(_0x48af93){var _0x5dcbf9={};_0x5dcbf9[_0x48af93]={'$like':'%'+_0x5c1f88[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x5dcbf9;})});}_0x3fe2e3=_[_0x4da2('0x58')]({},_0x3fe2e3,_0x5c1f88['options']);return db[_0x4da2('0xdc')][_0x4da2('0x23')]({'where':_0x3fe2e3[_0x4da2('0x3e')]})[_0x4da2('0x11')](function(_0x3dc047){_0x29e73f[_0x4da2('0x23')]=_0x3dc047;if(_0x5c1f88[_0x4da2('0x3f')][_0x4da2('0x40')]){_0x3fe2e3[_0x4da2('0x41')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x3fe2e3);})[_0x4da2('0x11')](function(_0x445673){_0x29e73f['rows']=_0x445673;return _0x29e73f;});}})[_0x4da2('0x11')](respondWithFilteredResult(_0x27c104,_0x3fe2e3))['catch'](handleError(_0x27c104,null));};exports['getScreenRecordings']=function(_0xf3af82,_0xd2fe29){var _0xa2205b={'raw':!![],'where':{}};var _0x3d0ba6={};var _0x200d06={'count':0x0,'rows':[]};return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0xf3af82[_0x4da2('0x51')]['id']}})['then'](handleEntityNotFound(_0xd2fe29,null))[_0x4da2('0x11')](function(_0x36f5c5){if(_0x36f5c5){_0x3d0ba6[_0x4da2('0x52')]=_[_0x4da2('0x54')](db[_0x4da2('0xdd')][_0x4da2('0x38')]);_0x3d0ba6['query']=_[_0x4da2('0x54')](_0xf3af82[_0x4da2('0x3f')]);_0x3d0ba6['filters']=_['intersection'](_0x3d0ba6[_0x4da2('0x52')],_0x3d0ba6[_0x4da2('0x3f')]);_0xa2205b[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x3d0ba6[_0x4da2('0x52')],qs['fields'](_0xf3af82[_0x4da2('0x3f')]['fields']));_0xa2205b['attributes']=_0xa2205b['attributes'][_0x4da2('0x49')]?_0xa2205b[_0x4da2('0x44')]:_0x3d0ba6[_0x4da2('0x52')];if(!_0xf3af82[_0x4da2('0x3f')][_0x4da2('0xcf')](_0x4da2('0xd4'))){_0xa2205b['limit']=qs[_0x4da2('0x22')](_0xf3af82[_0x4da2('0x3f')][_0x4da2('0x22')]);_0xa2205b['offset']=qs[_0x4da2('0x20')](_0xf3af82['query'][_0x4da2('0x20')]);}_0xa2205b[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0xf3af82['query'][_0x4da2('0xcd')]);_0xa2205b[_0x4da2('0x3e')]=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0xf3af82[_0x4da2('0x3f')],_0x3d0ba6[_0x4da2('0x55')]));_0xa2205b['where']['UserId']=_0x36f5c5['id'];if(_0xf3af82[_0x4da2('0x3f')]['filter']){_0xa2205b['where']=_[_0x4da2('0x58')](_0xa2205b[_0x4da2('0x3e')],{'$or':_[_0x4da2('0x39')](_0xa2205b[_0x4da2('0x44')],function(_0x40d91a){var _0x638935={};_0x638935[_0x40d91a]={'$like':'%'+_0xf3af82[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x638935;})});}_0xa2205b=_[_0x4da2('0x58')]({},_0xa2205b,_0xf3af82[_0x4da2('0x59')]);return db[_0x4da2('0xdd')]['count']({'where':_0xa2205b[_0x4da2('0x3e')]})['then'](function(_0x6dbc4e){_0x200d06[_0x4da2('0x23')]=_0x6dbc4e;if(_0xf3af82[_0x4da2('0x3f')][_0x4da2('0x40')]){_0xa2205b[_0x4da2('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4da2('0x8a')](_0xa2205b);})['then'](function(_0x284d10){_0x200d06['rows']=_0x284d10;return _0x200d06;});}})[_0x4da2('0x11')](respondWithFilteredResult(_0xd2fe29,_0xa2205b))[_0x4da2('0x1c')](handleError(_0xd2fe29,null));};exports[_0x4da2('0xde')]=function(_0x111465,_0x4f4abe){var _0x423f2e={};var _0x411f14={};var _0x4c7149;var _0x512bc4;return db[_0x4da2('0x37')]['findOne']({'where':{'id':_0x111465[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x4f4abe,null))['then'](function(_0x58eb59){if(_0x58eb59){_0x4c7149=_0x58eb59;_0x411f14[_0x4da2('0x52')]=_['keys'](db[_0x4da2('0xdf')][_0x4da2('0x38')]);_0x411f14[_0x4da2('0x3f')]=_[_0x4da2('0x54')](_0x111465[_0x4da2('0x3f')]);_0x411f14['filters']=_['intersection'](_0x411f14[_0x4da2('0x52')],_0x411f14[_0x4da2('0x3f')]);_0x423f2e[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x411f14[_0x4da2('0x52')],qs['fields'](_0x111465['query']['fields']));_0x423f2e[_0x4da2('0x44')]=_0x423f2e[_0x4da2('0x44')][_0x4da2('0x49')]?_0x423f2e[_0x4da2('0x44')]:_0x411f14[_0x4da2('0x52')];_0x423f2e[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0x111465[_0x4da2('0x3f')]['sort']);_0x423f2e[_0x4da2('0x3e')]=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x111465[_0x4da2('0x3f')],_0x411f14[_0x4da2('0x55')]));if(_0x111465[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x423f2e[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x423f2e[_0x4da2('0x3e')],{'$or':_[_0x4da2('0x39')](_0x423f2e[_0x4da2('0x44')],function(_0x5bbc5a){var _0x3aee9e={};_0x3aee9e[_0x5bbc5a]={'$like':'%'+_0x111465[_0x4da2('0x3f')]['filter']+'%'};return _0x3aee9e;})});}_0x423f2e=_[_0x4da2('0x58')]({},_0x423f2e,_0x111465[_0x4da2('0x59')]);return _0x4c7149['getChatInteractions'](_0x423f2e);}})[_0x4da2('0x11')](function(_0x54a1eb){if(_0x54a1eb){_0x512bc4=_0x54a1eb['length'];if(!_0x111465[_0x4da2('0x3f')][_0x4da2('0xcf')]('nolimit')){_0x423f2e['limit']=qs['limit'](_0x111465[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x423f2e['offset']=qs[_0x4da2('0x20')](_0x111465[_0x4da2('0x3f')][_0x4da2('0x20')]);}return _0x4c7149['getChatInteractions'](_0x423f2e);}})[_0x4da2('0x11')](function(_0x4175d6){if(_0x4175d6){return _0x4175d6?{'count':_0x512bc4,'rows':_0x4175d6}:null;}})[_0x4da2('0x11')](respondWithResult(_0x4f4abe,null))['catch'](handleError(_0x4f4abe,null));};exports[_0x4da2('0xe0')]=function(_0x545cc8,_0x242cb7){var _0x3478ac={};var _0x3150eb={};var _0x887857;var _0x1a1b6b;return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0x545cc8[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x242cb7,null))[_0x4da2('0x11')](function(_0x4586aa){if(_0x4586aa){_0x887857=_0x4586aa;_0x3150eb['model']=_[_0x4da2('0x54')](db[_0x4da2('0xe1')][_0x4da2('0x38')]);_0x3150eb['query']=_[_0x4da2('0x54')](_0x545cc8[_0x4da2('0x3f')]);_0x3150eb['filters']=_[_0x4da2('0x56')](_0x3150eb[_0x4da2('0x52')],_0x3150eb['query']);_0x3478ac[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x3150eb[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x545cc8[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x3478ac['attributes']=_0x3478ac[_0x4da2('0x44')][_0x4da2('0x49')]?_0x3478ac['attributes']:_0x3150eb[_0x4da2('0x52')];_0x3478ac[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0x545cc8[_0x4da2('0x3f')][_0x4da2('0xcd')]);_0x3478ac['where']=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x545cc8[_0x4da2('0x3f')],_0x3150eb[_0x4da2('0x55')]));if(_0x545cc8[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x3478ac[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x3478ac[_0x4da2('0x3e')],{'$or':_[_0x4da2('0x39')](_0x3478ac['attributes'],function(_0x16677b){var _0x47237d={};_0x47237d[_0x16677b]={'$like':'%'+_0x545cc8[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x47237d;})});}_0x3478ac=_[_0x4da2('0x58')]({},_0x3478ac,_0x545cc8[_0x4da2('0x59')]);return _0x887857[_0x4da2('0xe0')](_0x3478ac);}})[_0x4da2('0x11')](function(_0x62e265){if(_0x62e265){_0x1a1b6b=_0x62e265[_0x4da2('0x49')];if(!_0x545cc8[_0x4da2('0x3f')][_0x4da2('0xcf')]('nolimit')){_0x3478ac['limit']=qs['limit'](_0x545cc8[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x3478ac[_0x4da2('0x20')]=qs[_0x4da2('0x20')](_0x545cc8[_0x4da2('0x3f')]['offset']);}return _0x887857['getOpenchannelInteractions'](_0x3478ac);}})['then'](function(_0x386fe9){if(_0x386fe9){return _0x386fe9?{'count':_0x1a1b6b,'rows':_0x386fe9}:null;}})[_0x4da2('0x11')](respondWithResult(_0x242cb7,null))['catch'](handleError(_0x242cb7,null));};exports[_0x4da2('0xe2')]=function(_0x2811cc,_0x3c16dc){var _0x3522a0={'raw':!![],'where':{}};var _0xf34c58={};var _0x1e6b76={'count':0x0,'rows':[]};return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0x2811cc['params']['id']}})['then'](handleEntityNotFound(_0x3c16dc,null))[_0x4da2('0x11')](function(_0x45be6f){if(_0x45be6f){_0xf34c58[_0x4da2('0x52')]=_['keys'](db[_0x4da2('0xe3')][_0x4da2('0x38')]);_0xf34c58[_0x4da2('0x3f')]=_[_0x4da2('0x54')](_0x2811cc[_0x4da2('0x3f')]);_0xf34c58[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0xf34c58[_0x4da2('0x52')],_0xf34c58[_0x4da2('0x3f')]);_0x3522a0[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0xf34c58['model'],qs[_0x4da2('0x57')](_0x2811cc[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x3522a0[_0x4da2('0x44')]=_0x3522a0['attributes'][_0x4da2('0x49')]?_0x3522a0[_0x4da2('0x44')]:_0xf34c58['model'];if(!_0x2811cc[_0x4da2('0x3f')][_0x4da2('0xcf')]('nolimit')){_0x3522a0['limit']=qs['limit'](_0x2811cc[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x3522a0['offset']=qs[_0x4da2('0x20')](_0x2811cc['query'][_0x4da2('0x20')]);}_0x3522a0['order']=qs[_0x4da2('0xcd')](_0x2811cc[_0x4da2('0x3f')]['sort']);_0x3522a0['where']=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x2811cc['query'],_0xf34c58[_0x4da2('0x55')]));_0x3522a0['where'][_0x4da2('0xe4')]=_0x45be6f['id'];if(_0x2811cc[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x3522a0[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x3522a0['where'],{'$or':_[_0x4da2('0x39')](_0x3522a0['attributes'],function(_0x5d37c2){var _0x3b478c={};_0x3b478c[_0x5d37c2]={'$like':'%'+_0x2811cc[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x3b478c;})});}_0x3522a0=_[_0x4da2('0x58')]({},_0x3522a0,_0x2811cc[_0x4da2('0x59')]);return db['MailInteraction'][_0x4da2('0x23')]({'where':_0x3522a0['where']})['then'](function(_0x50bb7d){_0x1e6b76[_0x4da2('0x23')]=_0x50bb7d;if(_0x2811cc[_0x4da2('0x3f')][_0x4da2('0x40')]){_0x3522a0['include']=[{'all':!![]}];}return db[_0x4da2('0xe3')][_0x4da2('0x8a')](_0x3522a0);})['then'](function(_0x3dbabd){_0x1e6b76[_0x4da2('0x48')]=_0x3dbabd;return _0x1e6b76;});}})[_0x4da2('0x11')](respondWithFilteredResult(_0x3c16dc,_0x3522a0))['catch'](handleError(_0x3c16dc,null));};exports[_0x4da2('0xe5')]=function(_0x2347a4,_0x1e0151){var _0x189852={};var _0x5a1f26={};var _0x4f10f4;var _0x1213c0;return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0x2347a4[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x1e0151,null))['then'](function(_0x39a473){if(_0x39a473){_0x4f10f4=_0x39a473;_0x5a1f26[_0x4da2('0x52')]=_['keys'](db[_0x4da2('0xe6')][_0x4da2('0x38')]);_0x5a1f26['query']=_[_0x4da2('0x54')](_0x2347a4['query']);_0x5a1f26['filters']=_[_0x4da2('0x56')](_0x5a1f26[_0x4da2('0x52')],_0x5a1f26[_0x4da2('0x3f')]);_0x189852[_0x4da2('0x44')]=_['intersection'](_0x5a1f26['model'],qs[_0x4da2('0x57')](_0x2347a4[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x189852['attributes']=_0x189852[_0x4da2('0x44')][_0x4da2('0x49')]?_0x189852[_0x4da2('0x44')]:_0x5a1f26['model'];_0x189852['order']=qs['sort'](_0x2347a4[_0x4da2('0x3f')][_0x4da2('0xcd')]);_0x189852['where']=qs['filters'](_[_0x4da2('0xce')](_0x2347a4[_0x4da2('0x3f')],_0x5a1f26['filters']));if(_0x2347a4['query']['filter']){_0x189852['where']=_['merge'](_0x189852[_0x4da2('0x3e')],{'$or':_[_0x4da2('0x39')](_0x189852['attributes'],function(_0x4df407){var _0x2b5f49={};_0x2b5f49[_0x4df407]={'$like':'%'+_0x2347a4[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x2b5f49;})});}_0x189852=_[_0x4da2('0x58')]({},_0x189852,_0x2347a4['options']);return _0x4f10f4[_0x4da2('0xe5')](_0x189852);}})['then'](function(_0x1025ab){if(_0x1025ab){_0x1213c0=_0x1025ab[_0x4da2('0x49')];if(!_0x2347a4[_0x4da2('0x3f')]['hasOwnProperty']('nolimit')){_0x189852[_0x4da2('0x22')]=qs['limit'](_0x2347a4[_0x4da2('0x3f')][_0x4da2('0x22')]);_0x189852[_0x4da2('0x20')]=qs[_0x4da2('0x20')](_0x2347a4[_0x4da2('0x3f')][_0x4da2('0x20')]);}return _0x4f10f4[_0x4da2('0xe5')](_0x189852);}})[_0x4da2('0x11')](function(_0x23845e){if(_0x23845e){return _0x23845e?{'count':_0x1213c0,'rows':_0x23845e}:null;}})['then'](respondWithResult(_0x1e0151,null))[_0x4da2('0x1c')](handleError(_0x1e0151,null));};exports['getFaxInteractions']=function(_0x48dca9,_0x2fb03d){var _0xd6a303={};var _0x670184={};var _0x44f022;var _0x2e62ea;return db[_0x4da2('0x37')]['findOne']({'where':{'id':_0x48dca9['params']['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x2fb03d,null))['then'](function(_0x1fe448){if(_0x1fe448){_0x44f022=_0x1fe448;_0x670184[_0x4da2('0x52')]=_['keys'](db['FaxInteraction'][_0x4da2('0x38')]);_0x670184['query']=_[_0x4da2('0x54')](_0x48dca9[_0x4da2('0x3f')]);_0x670184[_0x4da2('0x55')]=_['intersection'](_0x670184[_0x4da2('0x52')],_0x670184['query']);_0xd6a303[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x670184[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x48dca9[_0x4da2('0x3f')]['fields']));_0xd6a303[_0x4da2('0x44')]=_0xd6a303[_0x4da2('0x44')][_0x4da2('0x49')]?_0xd6a303[_0x4da2('0x44')]:_0x670184[_0x4da2('0x52')];_0xd6a303[_0x4da2('0xcc')]=qs['sort'](_0x48dca9[_0x4da2('0x3f')]['sort']);_0xd6a303[_0x4da2('0x3e')]=qs[_0x4da2('0x55')](_[_0x4da2('0xce')](_0x48dca9['query'],_0x670184[_0x4da2('0x55')]));if(_0x48dca9[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0xd6a303['where']=_[_0x4da2('0x58')](_0xd6a303[_0x4da2('0x3e')],{'$or':_['map'](_0xd6a303['attributes'],function(_0x9a67f7){var _0x39f871={};_0x39f871[_0x9a67f7]={'$like':'%'+_0x48dca9[_0x4da2('0x3f')]['filter']+'%'};return _0x39f871;})});}_0xd6a303=_[_0x4da2('0x58')]({},_0xd6a303,_0x48dca9['options']);return _0x44f022[_0x4da2('0xe7')](_0xd6a303);}})[_0x4da2('0x11')](function(_0xcedd8d){if(_0xcedd8d){_0x2e62ea=_0xcedd8d['length'];if(!_0x48dca9[_0x4da2('0x3f')]['hasOwnProperty'](_0x4da2('0xd4'))){_0xd6a303[_0x4da2('0x22')]=qs['limit'](_0x48dca9[_0x4da2('0x3f')][_0x4da2('0x22')]);_0xd6a303[_0x4da2('0x20')]=qs['offset'](_0x48dca9[_0x4da2('0x3f')][_0x4da2('0x20')]);}return _0x44f022[_0x4da2('0xe7')](_0xd6a303);}})[_0x4da2('0x11')](function(_0x19ad48){if(_0x19ad48){return _0x19ad48?{'count':_0x2e62ea,'rows':_0x19ad48}:null;}})[_0x4da2('0x11')](respondWithResult(_0x2fb03d,null))['catch'](handleError(_0x2fb03d,null));};exports[_0x4da2('0xe8')]=function(_0x4cb837,_0x377136){var _0x101a4d={};var _0x3bba67={};var _0x936f33;var _0x17dad0;return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0x4cb837[_0x4da2('0x51')]['id']}})['then'](handleEntityNotFound(_0x377136,null))[_0x4da2('0x11')](function(_0x463f7d){if(_0x463f7d){_0x936f33=_0x463f7d;_0x3bba67[_0x4da2('0x52')]=_[_0x4da2('0x54')](db[_0x4da2('0xe9')][_0x4da2('0x38')]);_0x3bba67[_0x4da2('0x3f')]=_[_0x4da2('0x54')](_0x4cb837[_0x4da2('0x3f')]);_0x3bba67[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x3bba67['model'],_0x3bba67[_0x4da2('0x3f')]);_0x101a4d['attributes']=_['intersection'](_0x3bba67[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x4cb837[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x101a4d['attributes']=_0x101a4d['attributes']['length']?_0x101a4d['attributes']:_0x3bba67[_0x4da2('0x52')];_0x101a4d[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0x4cb837[_0x4da2('0x3f')][_0x4da2('0xcd')]);_0x101a4d['where']=qs['filters'](_['pick'](_0x4cb837[_0x4da2('0x3f')],_0x3bba67[_0x4da2('0x55')]));if(_0x4cb837[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x101a4d[_0x4da2('0x3e')]=_['merge'](_0x101a4d[_0x4da2('0x3e')],{'$or':_[_0x4da2('0x39')](_0x101a4d[_0x4da2('0x44')],function(_0x70d456){var _0x527e4a={};_0x527e4a[_0x70d456]={'$like':'%'+_0x4cb837[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x527e4a;})});}_0x101a4d=_[_0x4da2('0x58')]({},_0x101a4d,_0x4cb837['options']);return _0x936f33[_0x4da2('0xe8')](_0x101a4d);}})['then'](function(_0x270d2f){if(_0x270d2f){_0x17dad0=_0x270d2f[_0x4da2('0x49')];if(!_0x4cb837[_0x4da2('0x3f')][_0x4da2('0xcf')]('nolimit')){_0x101a4d['limit']=qs['limit'](_0x4cb837['query'][_0x4da2('0x22')]);_0x101a4d[_0x4da2('0x20')]=qs['offset'](_0x4cb837[_0x4da2('0x3f')][_0x4da2('0x20')]);}return _0x936f33[_0x4da2('0xe8')](_0x101a4d);}})[_0x4da2('0x11')](function(_0x2db3c3){if(_0x2db3c3){return _0x2db3c3?{'count':_0x17dad0,'rows':_0x2db3c3}:null;}})['then'](respondWithResult(_0x377136,null))[_0x4da2('0x1c')](handleError(_0x377136,null));};exports['login']=function(_0x3aa4c4,_0x356afc,_0xda7e28){var _0x5c5697;var _0x4dafce;var _0x3e7a36;var _0x2fb6f0=!_[_0x4da2('0x67')](_0x3aa4c4[_0x4da2('0x51')]['id'])?_0x3aa4c4[_0x4da2('0x51')]['id']:!_[_0x4da2('0x67')](_0x3aa4c4[_0x4da2('0x29')]['id'])?_0x3aa4c4[_0x4da2('0x29')]['id']:null;return db['User'][_0x4da2('0x5a')]({'where':{'id':_0x2fb6f0,'role':{'$or':[_0x4da2('0x7f'),'user',_0x4da2('0x7d')]}},'attributes':['id',_0x4da2('0x34'),_0x4da2('0xea'),'mobile',_0x4da2('0x27'),_0x4da2('0x61'),_0x4da2('0x9c')]})[_0x4da2('0x11')](function(_0x2f0a6d){if(_0x2f0a6d){if(_0x2f0a6d[_0x4da2('0x27')]===_0x4da2('0x7d')){_0x5c5697=_0x2f0a6d;if(_0x3aa4c4[_0x4da2('0x5c')]['interface']){_0x3e7a36=util['format'](_0x4da2('0xeb'),_0x5c5697[_0x3aa4c4[_0x4da2('0x5c')]['interface']]);}else if(_0x3aa4c4['body'][_0x4da2('0xec')]){_0x3e7a36=util['format'](_0x4da2('0xa9'),_0x3aa4c4[_0x4da2('0x5c')][_0x4da2('0xec')]);}else{_0x3e7a36=util['format'](_0x4da2('0xa9'),_0x5c5697[_0x4da2('0x34')]);}socket['to'](util[_0x4da2('0xa8')]('user:%s',_0x5c5697[_0x4da2('0x34')]))[_0x4da2('0xa5')](_0x4da2('0xed'),{'user':{'id':_0x5c5697['id'],'name':_0x5c5697[_0x4da2('0x34')]},'ip':_0x3aa4c4[_0x4da2('0xee')][_0x4da2('0xef')]||_0x3aa4c4[_0x4da2('0xf0')][_0x4da2('0xf1')]||_0x3aa4c4[_0x4da2('0xf2')][_0x4da2('0xf1')]||_0x3aa4c4[_0x4da2('0xf0')][_0x4da2('0xf2')][_0x4da2('0xf1')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x5c5697[_0x4da2('0x34')]},'individualHooks':!![]});}}else{throw new db[(_0x4da2('0x8d'))][(_0x4da2('0x8e'))](_0x4da2('0xf3'));}})[_0x4da2('0x11')](function(){if(_0x5c5697){return _0x5c5697['getVoiceQueues']({'raw':!![]});}})[_0x4da2('0x11')](function(_0x34c58c){if(_0x5c5697){var _0x4d170d=[];if(_0x34c58c){_0x4dafce=_0x34c58c;if(_0x4dafce[_0x4da2('0x49')]){for(var _0x4db9e2=0x0;_0x4db9e2<_0x4dafce[_0x4da2('0x49')];_0x4db9e2++){_0x4d170d['push']({'membername':_0x5c5697[_0x4da2('0x34')],'UserId':_0x5c5697['id'],'queue_name':_0x4dafce[_0x4db9e2][_0x4da2('0x34')],'VoiceQueueId':_0x4dafce[_0x4db9e2]['id'],'interface':_0x3e7a36,'paused':_0x5c5697[_0x4da2('0x9c')]||![],'penalty':_0x4dafce[_0x4db9e2][_0x4da2('0xf4')]||0x0});}return BPromise[_0x4da2('0xaa')](_0x4d170d,function(_0x67bf04){return db[_0x4da2('0xb2')]['upsert'](_0x67bf04);});}}}})[_0x4da2('0x11')](function(){if(_0x5c5697){return db['MemberReport'][_0x4da2('0x8a')]({'where':{'membername':_0x5c5697[_0x4da2('0x34')],'exitAt':null}});}})[_0x4da2('0x11')](function(_0x239efa){if(_0x5c5697){var _0x1658fc=[];_0x239efa[_0x4da2('0xf5')](function(_0x2f8f50){_0x1658fc[_0x4da2('0x45')](_0x2f8f50[_0x4da2('0x25')]({'exitAt':moment()[_0x4da2('0xa8')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x4da2('0x4f')](_0x1658fc);}})[_0x4da2('0x11')](function(){if(_0x5c5697){var _0x215211=[];var _0x2ea510=[];var _0x318b7c=utils[_0x4da2('0xf6')]();var _0x41c9b9={'membername':_0x5c5697[_0x4da2('0x34')],'interface':_0x3e7a36,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x5c5697['role'],'internal':_0x5c5697[_0x4da2('0x61')]};_0x318b7c['forEach'](function(_0x5450bf){_0x215211[_0x4da2('0x45')](_[_0x4da2('0x58')]({'channel':_0x5450bf,'type':_0x4da2('0xf7'),'data1':_0x3aa4c4[_0x4da2('0x5c')][_0x4da2('0xf8')],'data2':_0x3e7a36},_0x41c9b9));if(_0x5c5697[_0x4da2('0x9c')]){_0x2ea510['push'](_['merge']({'channel':_0x5450bf,'type':_0x4da2('0xf9'),'data1':_0x4da2('0xfa')},_0x41c9b9));}});return db[_0x4da2('0xfb')][_0x4da2('0x87')](_0x215211[_0x4da2('0xfc')](_0x2ea510),{'individualHooks':!![]});}})[_0x4da2('0x11')](function(){if(_0x5c5697){return _0x5c5697['update']({'online':!![],'lastLoginAt':moment()[_0x4da2('0xa8')](_0x4da2('0xfd')),'voicePause':_0x5c5697['loginInPause']||![],'mailPause':_0x5c5697[_0x4da2('0x9c')]||![],'chatPause':_0x5c5697[_0x4da2('0x9c')]||![],'faxPause':_0x5c5697[_0x4da2('0x9c')]||![],'smsPause':_0x5c5697[_0x4da2('0x9c')]||![],'openchannelPause':_0x5c5697[_0x4da2('0x9c')]||![],'whatsappPause':_0x5c5697[_0x4da2('0x9c')]||![],'pauseType':_0x5c5697[_0x4da2('0x9c')]?_0x4da2('0xfa'):null,'interface':_0x3e7a36,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x4da2('0x11')](function(_0x17ca8f){if(_0x3aa4c4[_0x4da2('0xfe')]){return _0xda7e28();}else{return BPromise[_0x4da2('0xff')](_0x17ca8f)[_0x4da2('0x11')](respondWithResult(_0x356afc,null));}})[_0x4da2('0x1c')](handleError(_0x356afc,null));};exports[_0x4da2('0x100')]=function(_0x228983,_0x1f9d1a){var _0x105a91;return db['User'][_0x4da2('0x5a')]({'where':{'id':_0x228983[_0x4da2('0x51')]['id'],'role':'agent'},'attributes':['id',_0x4da2('0x34'),_0x4da2('0x27')]})['then'](handleEntityNotFound(_0x1f9d1a,null))[_0x4da2('0x11')](function(_0x15cce3){if(_0x15cce3){_0x105a91=_0x15cce3;return db[_0x4da2('0xb2')][_0x4da2('0x26')]({'where':{'membername':_0x105a91[_0x4da2('0x34')]},'individualHooks':!![]});}})[_0x4da2('0x11')](function(){return db['MemberReport'][_0x4da2('0x8a')]({'where':{'membername':_0x105a91[_0x4da2('0x34')],'exitAt':null}});})[_0x4da2('0x11')](function(_0xfde6cb){var _0x347545=[];_0xfde6cb[_0x4da2('0xf5')](function(_0xc38fa5){_0x347545['push'](_0xc38fa5[_0x4da2('0x25')]({'exitAt':moment()[_0x4da2('0xa8')](_0x4da2('0xfd'))}));});return BPromise[_0x4da2('0x4f')](_0x347545);})[_0x4da2('0x11')](function(){return _0x105a91[_0x4da2('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x4da2('0x11')](respondWithResult(_0x1f9d1a,null))[_0x4da2('0x1c')](handleError(_0x1f9d1a,null));};exports[_0x4da2('0x101')]=function(_0x4187bd,_0x239b76){var _0xf4331f;return db['UserVoiceQueueRt'][_0x4da2('0x25')]({'paused':0x1},{'where':{'UserId':_0x4187bd[_0x4da2('0x51')]['id']},'individualHooks':!![]})[_0x4da2('0x11')](function(){return db[_0x4da2('0x37')][_0x4da2('0x5a')]({'where':{'id':_0x4187bd[_0x4da2('0x51')]['id'],'role':'agent'},'attributes':['id','name','role',_0x4da2('0x61'),_0x4da2('0x9e')]});})[_0x4da2('0x11')](handleEntityNotFound(_0x239b76,null))['then'](function(_0x515a4c){if(_0x515a4c){_0xf4331f=_0x515a4c;return respondWithRpcPromise('QueuePause',_0x4da2('0x101'),{'id':_0xf4331f['id'],'name':_0xf4331f[_0x4da2('0x34')],'pause':!![]});}})['then'](function(){if(_0xf4331f){return db[_0x4da2('0xfb')][_0x4da2('0x8a')]({'where':{'membername':_0xf4331f[_0x4da2('0x34')],'type':_0x4da2('0xf9'),'exitAt':null}});}})[_0x4da2('0x11')](function(_0xa86598){if(_0xa86598['length']){var _0x125be5=moment()[_0x4da2('0xa8')](_0x4da2('0xfd'));for(var _0x43f0af=0x0,_0x3b78e9=_0xa86598[_0x4da2('0x49')];_0x43f0af<_0x3b78e9;_0x43f0af++){_0xa86598[_0x43f0af][_0x4da2('0x102')]({'exitAt':_0x125be5});}}})[_0x4da2('0x11')](function(){var _0x47456d=[];var _0x20ae63=utils[_0x4da2('0xf6')]();_0x20ae63['forEach'](function(_0x1d9788){_0x47456d['push']({'channel':_0x1d9788,'membername':_0xf4331f[_0x4da2('0x34')],'interface':_[_0x4da2('0x67')](_0xf4331f[_0x4da2('0x9e')])?util[_0x4da2('0xa8')]('SIP/%s',_0xf4331f['name']):_0xf4331f[_0x4da2('0x9e')],'type':_0x4da2('0xf9'),'enterAt':moment()[_0x4da2('0xa8')](_0x4da2('0xfd')),'data1':_0x4187bd[_0x4da2('0x5c')][_0x4da2('0x103')]||_0x4da2('0x104'),'role':_0xf4331f[_0x4da2('0x27')],'internal':_0xf4331f[_0x4da2('0x61')]});});return db[_0x4da2('0xfb')][_0x4da2('0x87')](_0x47456d,{'individualHooks':!![]});})[_0x4da2('0x11')](function(){return _0xf4331f[_0x4da2('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4187bd[_0x4da2('0x5c')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x4da2('0xfd'))});})[_0x4da2('0x11')](respondWithResult(_0x239b76,null))[_0x4da2('0x1c')](handleError(_0x239b76,null));};exports['unpause']=function(_0x172cca,_0x3880e6){var _0x500f88;return db[_0x4da2('0x37')][_0x4da2('0x5a')]({'where':{'id':_0x172cca[_0x4da2('0x51')]['id']},'attributes':['id',_0x4da2('0x34'),_0x4da2('0x27'),_0x4da2('0x9d'),'mailPause','chatPause',_0x4da2('0x105'),_0x4da2('0x106'),'smsPause',_0x4da2('0x107'),_0x4da2('0x108'),_0x4da2('0x109')]})['then'](handleEntityNotFound(_0x3880e6,null))['then'](function(_0x44a6f4){if(_0x44a6f4){_0x500f88=_0x44a6f4;if(_0x172cca['body']['channel']&&!utils[_0x4da2('0x9f')](_0x172cca[_0x4da2('0x5c')][_0x4da2('0x9a')])){throw new db['Sequelize'][(_0x4da2('0x8e'))](_0x4da2('0xa0'));}switch(_0x172cca[_0x4da2('0x5c')][_0x4da2('0x9a')]){case _0x4da2('0xb1'):return respondWithRpcPromise(_0x4da2('0x10a'),'unpause',{'id':_0x500f88['id'],'name':_0x500f88[_0x4da2('0x34')],'pause':![]})[_0x4da2('0x11')](function(){return db['UserVoiceQueueRt'][_0x4da2('0x25')]({'paused':0x0},{'where':{'UserId':_0x500f88['id']},'individualHooks':!![]});})[_0x4da2('0x11')](function(){return db[_0x4da2('0xfb')]['find']({'where':{'channel':_0x172cca['body'][_0x4da2('0x9a')],'membername':_0x500f88[_0x4da2('0x34')],'type':'PAUSE','exitAt':null}});})[_0x4da2('0x11')](function(_0x71af8f){if(_0x71af8f){return _0x71af8f['update']({'exitAt':moment()['format'](_0x4da2('0xfd')),'data2':_0x4da2('0x10b')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x500f88[_0x4da2('0x25')]({'voicePause':![]});});case'mail':case'chat':case'fax':case _0x4da2('0x4c'):case _0x4da2('0xbf'):case _0x4da2('0x4e'):return db[_0x4da2('0xfb')]['find']({'where':{'channel':_0x172cca[_0x4da2('0x5c')][_0x4da2('0x9a')],'membername':_0x500f88[_0x4da2('0x34')],'type':_0x4da2('0xf9'),'exitAt':null}})[_0x4da2('0x11')](function(_0xab58d2){if(_0xab58d2){return _0xab58d2[_0x4da2('0x25')]({'exitAt':moment()['format'](_0x4da2('0xfd')),'data2':_0x4da2('0x10b')},{'individualHooks':!![]});}return null;})[_0x4da2('0x11')](function(){var _0x3985fc={};_[_0x4da2('0x10c')](_0x3985fc,util[_0x4da2('0xa8')]('%s%s',_0x172cca[_0x4da2('0x5c')][_0x4da2('0x9a')],_0x4da2('0x10d')),![]);return _0x500f88[_0x4da2('0x25')](_0x3985fc);});default:return respondWithRpcPromise(_0x4da2('0x10a'),_0x4da2('0x10e'),{'id':_0x500f88['id'],'name':_0x500f88[_0x4da2('0x34')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x500f88['id']}});})[_0x4da2('0x11')](function(){return db[_0x4da2('0xfb')][_0x4da2('0x8a')]({'where':{'membername':_0x500f88[_0x4da2('0x34')],'type':_0x4da2('0xf9'),'exitAt':null}});})[_0x4da2('0x11')](function(_0x1d2bdf){var _0x1320a2=[];_0x1d2bdf[_0x4da2('0xf5')](function(_0x283058){_0x1320a2[_0x4da2('0x45')](_0x283058[_0x4da2('0x25')]({'exitAt':moment()[_0x4da2('0xa8')](_0x4da2('0xfd')),'data2':'manual'}));});return BPromise[_0x4da2('0x4f')](_0x1320a2);})[_0x4da2('0x11')](function(){return _0x500f88[_0x4da2('0x25')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0x3880e6,null))[_0x4da2('0x1c')](handleError(_0x3880e6,null));};exports[_0x4da2('0x10f')]=function(_0x2b7f28,_0x58c23c){var _0x43e98f={};var _0x4ccf0c={};var _0x357060;var _0xae273;return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0x2b7f28[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x58c23c,null))[_0x4da2('0x11')](function(_0x1dcbe5){if(_0x1dcbe5){_0x357060=_0x1dcbe5;_0x4ccf0c[_0x4da2('0x52')]=_[_0x4da2('0x54')](db[_0x4da2('0x110')]['rawAttributes']);_0x4ccf0c['query']=_[_0x4da2('0x54')](_0x2b7f28['query']);_0x4ccf0c[_0x4da2('0x55')]=_['intersection'](_0x4ccf0c['model'],_0x4ccf0c[_0x4da2('0x3f')]);_0x43e98f['attributes']=_[_0x4da2('0x56')](_0x4ccf0c[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x2b7f28[_0x4da2('0x3f')]['fields']));_0x43e98f[_0x4da2('0x44')]=_0x43e98f['attributes'][_0x4da2('0x49')]?_0x43e98f['attributes']:_0x4ccf0c[_0x4da2('0x52')];_0x43e98f[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0x2b7f28['query']['sort']);_0x43e98f[_0x4da2('0x3e')]=qs['filters'](_[_0x4da2('0xce')](_0x2b7f28['query'],_0x4ccf0c[_0x4da2('0x55')]));if(_0x2b7f28[_0x4da2('0x3f')]['filter']){_0x43e98f[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x43e98f['where'],{'$or':_[_0x4da2('0x39')](_0x43e98f['attributes'],function(_0x37d626){var _0x46ea0d={};_0x46ea0d[_0x37d626]={'$like':'%'+_0x2b7f28[_0x4da2('0x3f')][_0x4da2('0x2d')]+'%'};return _0x46ea0d;})});}_0x43e98f=_[_0x4da2('0x58')]({},_0x43e98f,_0x2b7f28[_0x4da2('0x59')]);return _0x357060[_0x4da2('0x10f')](_0x43e98f);}})[_0x4da2('0x11')](function(_0x424319){if(_0x424319){_0xae273=_0x424319[_0x4da2('0x49')];if(!_0x2b7f28[_0x4da2('0x3f')][_0x4da2('0xcf')]('nolimit')){_0x43e98f[_0x4da2('0x22')]=qs[_0x4da2('0x22')](_0x2b7f28['query'][_0x4da2('0x22')]);_0x43e98f[_0x4da2('0x20')]=qs[_0x4da2('0x20')](_0x2b7f28[_0x4da2('0x3f')][_0x4da2('0x20')]);}return _0x357060[_0x4da2('0x10f')](_0x43e98f);}})[_0x4da2('0x11')](function(_0x596f27){if(_0x596f27){return _0x596f27?{'count':_0xae273,'rows':_0x596f27}:null;}})['then'](respondWithResult(_0x58c23c,null))[_0x4da2('0x1c')](handleError(_0x58c23c,null));};exports[_0x4da2('0x111')]=function(_0x3b0136,_0x1b788b){return db[_0x4da2('0x37')]['find']({'where':{'id':_0x3b0136[_0x4da2('0x51')]['id']}})['then'](handleEntityNotFound(_0x1b788b,null))[_0x4da2('0x11')](function(_0x289437){if(_0x289437){var _0x4e20f0=_0x289437[_0x4da2('0xd7')]({'plain':!![]});return _0x289437[_0x4da2('0x111')](_0x3b0136[_0x4da2('0x5c')][_0x4da2('0x5f')],_[_0x4da2('0x60')](_0x3b0136[_0x4da2('0x5c')],[_0x4da2('0x5f'),'id'])||{})['then'](function(){for(var _0x2e8848=0x0;_0x2e8848<_0x3b0136[_0x4da2('0x5c')][_0x4da2('0x5f')][_0x4da2('0x49')];_0x2e8848++){var _0x3c2e49=[];var _0x46c498={};db[_0x4da2('0x110')]['findOne']({'where':{'id':_0x3b0136[_0x4da2('0x5c')]['ids'][_0x2e8848]}})[_0x4da2('0x11')](function(_0x4d2319){_0x46c498=_0x4d2319[_0x4da2('0x4b')];_0x3c2e49[_0x4da2('0x45')](_0x4d2319[_0x4da2('0x112')]()[_0x4da2('0x11')](function(_0x28dd38){for(var _0x4fe1fb=0x0;_0x4fe1fb<_0x28dd38[_0x4da2('0x49')];_0x4fe1fb++){_0x28dd38[_0x4fe1fb][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x114'));}return _0x28dd38;}));_0x3c2e49[_0x4da2('0x45')](_0x4d2319[_0x4da2('0x115')]()[_0x4da2('0x11')](function(_0x5183cf){for(var _0x4bce6e=0x0;_0x4bce6e<_0x5183cf['length'];_0x4bce6e++){_0x5183cf[_0x4bce6e][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x116'));}return _0x5183cf;}));_0x3c2e49[_0x4da2('0x45')](_0x4d2319[_0x4da2('0x117')]()['then'](function(_0x540826){for(var _0x4d99b9=0x0;_0x4d99b9<_0x540826[_0x4da2('0x49')];_0x4d99b9++){_0x540826[_0x4d99b9][_0x4da2('0x113')]('channel',_0x4da2('0x118'));}return _0x540826;}));_0x3c2e49[_0x4da2('0x45')](_0x4d2319[_0x4da2('0x119')]()[_0x4da2('0x11')](function(_0x4d87d7){for(var _0x43332d=0x0;_0x43332d<_0x4d87d7[_0x4da2('0x49')];_0x43332d++){_0x4d87d7[_0x43332d][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x11a'));}return _0x4d87d7;}));_0x3c2e49[_0x4da2('0x45')](_0x4d2319[_0x4da2('0x11b')]()[_0x4da2('0x11')](function(_0x100c23){for(var _0x1d4106=0x0;_0x1d4106<_0x100c23[_0x4da2('0x49')];_0x1d4106++){_0x100c23[_0x1d4106][_0x4da2('0x113')](_0x4da2('0x9a'),'Whatsapp');}return _0x100c23;}));_0x3c2e49[_0x4da2('0x45')](_0x4d2319['getFaxQueues']()[_0x4da2('0x11')](function(_0x429251){for(var _0xb1b19b=0x0;_0xb1b19b<_0x429251[_0x4da2('0x49')];_0xb1b19b++){_0x429251[_0xb1b19b][_0x4da2('0x113')](_0x4da2('0x9a'),'Fax');}return _0x429251;}));_0x3c2e49['push'](_0x4d2319[_0x4da2('0x11c')]()['then'](function(_0x387dc3){for(var _0x18b103=0x0;_0x18b103<_0x387dc3[_0x4da2('0x49')];_0x18b103++){_0x387dc3[_0x18b103][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x11d'));}return _0x387dc3;}));return BPromise['all'](_0x3c2e49);})[_0x4da2('0x11')](function(_0x34e978){var _0x49598b=_[_0x4da2('0x11e')](_0x34e978);_0x3c2e49=[];return db[_0x4da2('0x69')][_0x4da2('0x11f')](function(_0x34b549){for(var _0xca9e57=0x0;_0xca9e57<_0x49598b['length'];_0xca9e57++){_0x3c2e49[_0x4da2('0x45')](_0x49598b[_0xca9e57][_0x4da2('0x120')](_0x4e20f0['id']),{'transaction':_0x34b549});}return BPromise[_0x4da2('0x4f')](_0x3c2e49)[_0x4da2('0x11')](function(){if(_0x4e20f0[_0x4da2('0x9b')]){return BPromise[_0x4da2('0xaa')](_[_0x4da2('0x2d')](_0x49598b,function(_0x5e4c76){return _0x5e4c76[_0x4da2('0x121')]('channel')===_0x4da2('0x114');}),function(_0x14df5a){return db[_0x4da2('0xb2')][_0x4da2('0xab')]({'membername':_0x4e20f0[_0x4da2('0x34')],'UserId':_0x4e20f0['id'],'queue_name':_0x14df5a[_0x4da2('0x34')],'VoiceQueueId':_0x14df5a['id'],'interface':_[_0x4da2('0x67')](_0x4e20f0['interface'])?util[_0x4da2('0xa8')](_0x4da2('0xa9'),_0x4e20f0[_0x4da2('0x34')]):_0x4e20f0[_0x4da2('0x9e')],'paused':_0x4e20f0[_0x4da2('0x9d')]||![],'penalty':_0x4e20f0[_0x4da2('0xa3')]},{'transaction':_0x34b549});});}else{return;}})['then'](function(){for(var _0x35fe52=0x0;_0x35fe52<_0x49598b['length'];_0x35fe52++){var _0x35f88a=_0x49598b[_0x35fe52][_0x4da2('0x121')](_0x4da2('0x9a'));var _0x544319=_0x35f88a+'QueueId';socket['emit'](_0x4da2('0x29')+_0x35f88a+_0x4da2('0xa7'),{'UserId':_0x4e20f0['id'],['queueField']:_0x49598b[_0x35fe52]['id']});}});});})[_0x4da2('0x11')](function(){db[_0x4da2('0x122')]['findOne']({'where':{'teamId':_0x46c498['id']}})[_0x4da2('0x11')](function(_0x21d18e){if(_0x21d18e){db[_0x4da2('0x123')][_0x4da2('0x7c')]({'UserId':_0x3b0136[_0x4da2('0x51')]['id'],'VoicePrefixId':_0x21d18e[_0x4da2('0x124')]});}});});}});}})['then'](respondWithStatusCode(_0x1b788b,null))[_0x4da2('0x1c')](handleError(_0x1b788b,null));};exports['removeTeams']=function(_0x3e2c56,_0x5c3264){return db['User'][_0x4da2('0x94')]({'where':{'id':_0x3e2c56[_0x4da2('0x51')]['id']}})[_0x4da2('0x11')](handleEntityNotFound(_0x5c3264,null))[_0x4da2('0x11')](function(_0x18b9ea){if(_0x18b9ea){var _0x12692b=_0x18b9ea['get']({'plain':!![]});var _0x400116=_0x3e2c56[_0x4da2('0x3f')][_0x4da2('0x5f')];return _0x18b9ea[_0x4da2('0x125')](_0x400116)[_0x4da2('0x11')](function(){for(var _0x81fa13=0x0;_0x81fa13<_0x400116['length'];_0x81fa13++){var _0x28915e=[];var _0x4d48b2={};db[_0x4da2('0x110')]['findOne']({'where':{'id':_0x400116[_0x81fa13]}})[_0x4da2('0x11')](function(_0x38ed5d){_0x4d48b2=_0x38ed5d['dataValues'];_0x28915e['push'](_0x38ed5d['getVoiceQueues']()[_0x4da2('0x11')](function(_0x272a82){for(var _0xf08a3b=0x0;_0xf08a3b<_0x272a82[_0x4da2('0x49')];_0xf08a3b++){_0x272a82[_0xf08a3b][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x114'));}return _0x272a82;}));_0x28915e[_0x4da2('0x45')](_0x38ed5d['getChatQueues']()[_0x4da2('0x11')](function(_0xb89798){for(var _0x415a4a=0x0;_0x415a4a<_0xb89798[_0x4da2('0x49')];_0x415a4a++){_0xb89798[_0x415a4a][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x116'));}return _0xb89798;}));_0x28915e[_0x4da2('0x45')](_0x38ed5d[_0x4da2('0x117')]()['then'](function(_0x525c9e){for(var _0x2a5d79=0x0;_0x2a5d79<_0x525c9e[_0x4da2('0x49')];_0x2a5d79++){_0x525c9e[_0x2a5d79][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x118'));}return _0x525c9e;}));_0x28915e[_0x4da2('0x45')](_0x38ed5d[_0x4da2('0x119')]()['then'](function(_0x147348){for(var _0x404388=0x0;_0x404388<_0x147348[_0x4da2('0x49')];_0x404388++){_0x147348[_0x404388][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x11a'));}return _0x147348;}));_0x28915e['push'](_0x38ed5d[_0x4da2('0x11b')]()[_0x4da2('0x11')](function(_0x2a1e4b){for(var _0x2b8319=0x0;_0x2b8319<_0x2a1e4b[_0x4da2('0x49')];_0x2b8319++){_0x2a1e4b[_0x2b8319][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x126'));}return _0x2a1e4b;}));_0x28915e[_0x4da2('0x45')](_0x38ed5d[_0x4da2('0x127')]()[_0x4da2('0x11')](function(_0x43e9fb){for(var _0x561781=0x0;_0x561781<_0x43e9fb[_0x4da2('0x49')];_0x561781++){_0x43e9fb[_0x561781][_0x4da2('0x113')](_0x4da2('0x9a'),'Fax');}return _0x43e9fb;}));_0x28915e[_0x4da2('0x45')](_0x38ed5d[_0x4da2('0x11c')]()[_0x4da2('0x11')](function(_0x3e100a){for(var _0x130454=0x0;_0x130454<_0x3e100a[_0x4da2('0x49')];_0x130454++){_0x3e100a[_0x130454][_0x4da2('0x113')](_0x4da2('0x9a'),_0x4da2('0x11d'));}return _0x3e100a;}));return BPromise[_0x4da2('0x4f')](_0x28915e);})[_0x4da2('0x11')](function(_0x1e049d){var _0x3de8d3=_['flatten'](_0x1e049d);_0x28915e=[];return db[_0x4da2('0x69')][_0x4da2('0x11f')](function(_0x20bc48){for(var _0x9dcf79=0x0;_0x9dcf79<_0x3de8d3['length'];_0x9dcf79++){_0x28915e[_0x4da2('0x45')](_0x3de8d3[_0x9dcf79][_0x4da2('0x128')](_0x12692b['id']),{'transaction':_0x20bc48});}return BPromise[_0x4da2('0x4f')](_0x28915e)['then'](function(){if(_0x12692b[_0x4da2('0x9b')]){return BPromise['each'](_[_0x4da2('0x2d')](_0x3de8d3,function(_0x4bab8a){return _0x4bab8a['getDataValue'](_0x4da2('0x9a'))==='Voice';}),function(_0x4601ba){return db['UserVoiceQueueRt'][_0x4da2('0x26')]({'where':{'VoiceQueueId':_0x4601ba['id'],'UserId':_0x12692b['id']},'transaction':_0x20bc48});});}else{return;}})[_0x4da2('0x11')](function(){db[_0x4da2('0x122')][_0x4da2('0x94')]({'where':{'teamId':_0x4d48b2['id']}})[_0x4da2('0x11')](function(_0x1d4a06){if(_0x1d4a06){return db['UserVoicePrefix'][_0x4da2('0x26')]({'where':{'UserId':_0x12692b['id'],'VoicePrefixId':_0x1d4a06[_0x4da2('0x4b')][_0x4da2('0x124')]}});}});})[_0x4da2('0x11')](function(){for(var _0x429982=0x0;_0x429982<_0x3de8d3[_0x4da2('0x49')];_0x429982++){var _0x266173=_0x3de8d3[_0x429982][_0x4da2('0x121')](_0x4da2('0x9a'));var _0x4e1e9f=_0x266173+_0x4da2('0xaf');socket[_0x4da2('0xa5')]('user'+_0x266173+_0x4da2('0xb0'),{'UserId':_0x12692b['id'],['queueField']:_0x3de8d3[_0x429982]['id']});}});});});}});}})[_0x4da2('0x11')](respondWithStatusCode(_0x5c3264,null))['catch'](handleError(_0x5c3264,null));};exports[_0x4da2('0x129')]=function(_0x562b33,_0x27411e){var _0xdddd06={};var _0xad145d={};var _0x1aa9fc;var _0x2f2d3f;return db[_0x4da2('0x37')]['findOne']({'where':{'id':_0x562b33['params']['id']}})['then'](handleEntityNotFound(_0x27411e,null))[_0x4da2('0x11')](function(_0x5cb9d1){if(_0x5cb9d1){_0x1aa9fc=_0x5cb9d1;_0xad145d[_0x4da2('0x52')]=_[_0x4da2('0x54')](db[_0x4da2('0x12a')][_0x4da2('0x38')]);_0xad145d[_0x4da2('0x3f')]=_[_0x4da2('0x54')](_0x562b33[_0x4da2('0x3f')]);_0xad145d['filters']=_[_0x4da2('0x56')](_0xad145d[_0x4da2('0x52')],_0xad145d[_0x4da2('0x3f')]);_0xdddd06[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0xad145d['model'],qs['fields'](_0x562b33[_0x4da2('0x3f')][_0x4da2('0x57')]));_0xdddd06[_0x4da2('0x44')]=_0xdddd06['attributes'][_0x4da2('0x49')]?_0xdddd06[_0x4da2('0x44')]:_0xad145d[_0x4da2('0x52')];_0xdddd06[_0x4da2('0xcc')]=qs['sort'](_0x562b33[_0x4da2('0x3f')][_0x4da2('0xcd')]);_0xdddd06[_0x4da2('0x3e')]=qs[_0x4da2('0x55')](_['pick'](_0x562b33['query'],_0xad145d[_0x4da2('0x55')]));if(_0x562b33[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0xdddd06[_0x4da2('0x3e')]=_['merge'](_0xdddd06[_0x4da2('0x3e')],{'$or':_[_0x4da2('0x39')](_0xdddd06[_0x4da2('0x44')],function(_0x2a17c8){var _0x171f5c={};_0x171f5c[_0x2a17c8]={'$like':'%'+_0x562b33['query']['filter']+'%'};return _0x171f5c;})});}_0xdddd06=_['merge']({},_0xdddd06,_0x562b33['options']);return _0x1aa9fc[_0x4da2('0x129')](_0xdddd06);}})['then'](function(_0x1a382b){if(_0x1a382b){_0x2f2d3f=_0x1a382b[_0x4da2('0x49')];if(!_0x562b33[_0x4da2('0x3f')]['hasOwnProperty'](_0x4da2('0xd4'))){_0xdddd06[_0x4da2('0x22')]=qs[_0x4da2('0x22')](_0x562b33[_0x4da2('0x3f')][_0x4da2('0x22')]);_0xdddd06['offset']=qs[_0x4da2('0x20')](_0x562b33['query'][_0x4da2('0x20')]);}return _0x1aa9fc[_0x4da2('0x129')](_0xdddd06);}})[_0x4da2('0x11')](function(_0x91c537){if(_0x91c537){return _0x91c537?{'count':_0x2f2d3f,'rows':_0x91c537}:null;}})[_0x4da2('0x11')](respondWithResult(_0x27411e,null))[_0x4da2('0x1c')](handleError(_0x27411e,null));};exports['getAgents']=function(_0x53a59a,_0x53fc88){var _0x316ba5={};var _0x576886={};var _0x38433d;return db[_0x4da2('0x37')][_0x4da2('0x94')]({'where':{'id':_0x53a59a[_0x4da2('0x51')]['id']}})['then'](handleEntityNotFound(_0x53fc88,null))[_0x4da2('0x11')](function(_0x343680){if(_0x343680){_0x38433d=_0x343680;_0x576886[_0x4da2('0x52')]=_['keys'](db['User'][_0x4da2('0x38')]);_0x576886[_0x4da2('0x3f')]=_[_0x4da2('0x54')](_0x53a59a[_0x4da2('0x3f')]);_0x576886[_0x4da2('0x55')]=_[_0x4da2('0x56')](_0x576886[_0x4da2('0x52')],_0x576886[_0x4da2('0x3f')]);_0x316ba5[_0x4da2('0x44')]=_[_0x4da2('0x56')](_0x576886[_0x4da2('0x52')],qs[_0x4da2('0x57')](_0x53a59a[_0x4da2('0x3f')][_0x4da2('0x57')]));_0x316ba5[_0x4da2('0x44')]=_0x316ba5[_0x4da2('0x44')][_0x4da2('0x49')]?_0x316ba5[_0x4da2('0x44')]:_0x576886[_0x4da2('0x52')];_0x316ba5[_0x4da2('0xcc')]=qs[_0x4da2('0xcd')](_0x53a59a[_0x4da2('0x3f')][_0x4da2('0xcd')]);_0x316ba5[_0x4da2('0x3e')]=qs['filters'](_[_0x4da2('0xce')](_0x53a59a['query'],_0x576886[_0x4da2('0x55')]));if(_0x53a59a[_0x4da2('0x3f')][_0x4da2('0x2d')]){_0x316ba5[_0x4da2('0x3e')]=_[_0x4da2('0x58')](_0x316ba5['where'],{'$or':_['map'](_0x316ba5[_0x4da2('0x44')],function(_0x27da63){var _0x19f49b={};_0x19f49b[_0x27da63]={'$like':'%'+_0x53a59a[_0x4da2('0x3f')]['filter']+'%'};return _0x19f49b;})});}_0x316ba5[_0x4da2('0x52')]=db['User'];_0x316ba5['as']='Agents';_0x316ba5=_[_0x4da2('0x58')]({},_0x316ba5,_0x53a59a[_0x4da2('0x59')]);return _0x38433d[_0x4da2('0x112')]({'include':[_0x316ba5]});}})[_0x4da2('0x11')](function(_0x4488ed){if(_0x4488ed){var _0x4e236e={},_0x366e89=[];for(var _0x10e788=0x0;_0x10e788<_0x4488ed[_0x4da2('0x49')];_0x10e788+=0x1){for(var _0x3c6d21=0x0,_0x188bf2;_0x3c6d21<_0x4488ed[_0x10e788]['Agents']['length'];_0x3c6d21+=0x1){_0x188bf2=_0x4488ed[_0x10e788][_0x4da2('0x2a')][_0x3c6d21][_0x4da2('0xd7')]({'plain':!![]});_0x4e236e[_0x188bf2['id']]=_0x188bf2;}}_0x4e236e=_[_0x4da2('0x12b')](_0x4e236e);for(var _0x28be71=qs[_0x4da2('0x20')](_0x53a59a[_0x4da2('0x3f')][_0x4da2('0x20')]);_0x28be71<_0x4e236e[_0x4da2('0x49')]&&_0x366e89[_0x4da2('0x49')]=_0x4e890b){_0x1f86a4=_0x4e890b;_0x595da0=0xc8;}else{_0x595da0=0xce;}_0x20d6bc[_0x41ac('0x1f')](_0x595da0);return _0x20d6bc[_0x41ac('0x26')](_0x41ac('0x27'),_0x37e7a2+'-'+_0x1f86a4+'/'+_0x4e890b)[_0x41ac('0x21')](_0x4ae5e2);}return null;};}function saveUpdates(_0x40df5d){return function(_0xa99fea){if(_0xa99fea){return _0xa99fea[_0x41ac('0x28')](_0x40df5d)[_0x41ac('0x29')](function(_0x50af8a){return _0x50af8a;});}return null;};}function removeEntity(_0x3397fa){return function(_0x4adedd){if(_0x4adedd){return _0x4adedd[_0x41ac('0x2a')]()['then'](function(){var _0x191837=_0x4adedd[_0x41ac('0x2b')]({'plain':!![]});if(_0x191837[_0x41ac('0x2c')]===_0x41ac('0x2d'))return;var _0x4fa51d=[{'name':_0x41ac('0x2e'),'value':_0x41ac('0x2f'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x151c37=_(_0x4fa51d)[_0x41ac('0x30')](_0x41ac('0x31'))['map'](_0x41ac('0x32'))['value']();if(_['includes'](_0x151c37,_0x191837['role'])){return;}var _0x10c0c7=_['find'](_0x4fa51d,[_0x41ac('0x32'),_0x191837[_0x41ac('0x2c')]])[_0x41ac('0x33')];return db[_0x41ac('0x34')][_0x41ac('0x2a')]({'where':{'type':_0x10c0c7,'resourceId':_0x191837['id']}})['then'](function(){return _0x4adedd;});})[_0x41ac('0x29')](function(){_0x3397fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ee671){return function(_0x5e39c1){if(!_0x5e39c1){_0x5ee671[_0x41ac('0x1e')](0x194);}return _0x5e39c1;};}function handleError(_0x452b5e,_0x5034a1){_0x5034a1=_0x5034a1||0x1f4;return function(_0x17b9b0){logger[_0x41ac('0x1a')](_0x17b9b0[_0x41ac('0x35')]);if(_0x17b9b0['name']){delete _0x17b9b0[_0x41ac('0x33')];}_0x452b5e[_0x41ac('0x1f')](_0x5034a1)[_0x41ac('0x36')](_0x17b9b0);};}exports[_0x41ac('0x37')]=function(_0x52da68,_0x10055f){var _0x1e43e4={},_0x2cb9e8={'count':0x0,'rows':[]};var _0x40c5f5=_(db[_0x41ac('0x38')]['rawAttributes'])['map'](function(_0x2b6205){return{'name':_0x2b6205[_0x41ac('0x39')],'type':_0x2b6205[_0x41ac('0x3a')][_0x41ac('0x3b')]};})['filter'](function(_0x25ddbf){return!_[_0x41ac('0x3c')]([_0x41ac('0x3d'),'salt'],_0x25ddbf['name']);})[_0x41ac('0x32')]();_0x1e43e4=qs['getOptions'](_0x40c5f5,_0x52da68);var _0x2d53be={'where':_0x1e43e4[_0x41ac('0x3e')]};return db[_0x41ac('0x38')][_0x41ac('0x25')](_0x2d53be)[_0x41ac('0x29')](function(_0x1b18c1){_0x2cb9e8[_0x41ac('0x25')]=_0x1b18c1;if(_0x52da68[_0x41ac('0x3f')][_0x41ac('0x40')]){_0x1e43e4['include']=[{'all':!![]}];}if(_0x52da68[_0x41ac('0x3f')][_0x41ac('0x41')]===_0x41ac('0x42')){_0x1e43e4[_0x41ac('0x43')]=[{'model':db[_0x41ac('0x44')],'as':_0x41ac('0x41')}];}if(!_[_0x41ac('0x3c')](_0x1e43e4[_0x41ac('0x45')],'id')){_0x1e43e4[_0x41ac('0x45')][_0x41ac('0x46')]('id');}return db[_0x41ac('0x38')]['findAll'](_0x1e43e4);})[_0x41ac('0x29')](function(_0x5279e8){_0x2cb9e8[_0x41ac('0x47')]=_0x5279e8;if(_0x52da68[_0x41ac('0x3f')][_0x41ac('0x48')]===_0x41ac('0x42')){var _0x4dd4a1=[];for(var _0xa859d7=0x0;_0xa859d7<_0x2cb9e8['rows']['length'];_0xa859d7++){_0x4dd4a1[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x49'),_0x2cb9e8['rows'][_0xa859d7][_0x41ac('0x4a')]));_0x4dd4a1[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x4b'),_0x2cb9e8[_0x41ac('0x47')][_0xa859d7][_0x41ac('0x4a')]));_0x4dd4a1[_0x41ac('0x46')](get_open_tabs('fax',_0x2cb9e8['rows'][_0xa859d7][_0x41ac('0x4a')]));_0x4dd4a1[_0x41ac('0x46')](get_open_tabs('mail',_0x2cb9e8[_0x41ac('0x47')][_0xa859d7]['dataValues']));_0x4dd4a1[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x4c'),_0x2cb9e8[_0x41ac('0x47')][_0xa859d7][_0x41ac('0x4a')]));_0x4dd4a1[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x4d'),_0x2cb9e8[_0x41ac('0x47')][_0xa859d7]['dataValues']));}return BPromise[_0x41ac('0x4e')](_0x4dd4a1)['then'](function(){return _0x2cb9e8;});}else{return _0x2cb9e8;}})[_0x41ac('0x29')](respondWithFilteredResult(_0x10055f,_0x1e43e4))[_0x41ac('0x1d')](handleError(_0x10055f,null));};exports[_0x41ac('0x4f')]=function(_0x3c73ed,_0x2341f5){var _0x6fab6={'raw':![],'where':{'id':_0x3c73ed[_0x41ac('0x50')]['id']}},_0x22bfb3={};_0x22bfb3[_0x41ac('0x51')]=_[_0x41ac('0x52')](_[_0x41ac('0x53')](db[_0x41ac('0x38')][_0x41ac('0x54')]),[_0x41ac('0x3d'),_0x41ac('0x55')]);_0x22bfb3[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x3c73ed[_0x41ac('0x3f')]);_0x22bfb3['filters']=_[_0x41ac('0x56')](_0x22bfb3['model'],_0x22bfb3[_0x41ac('0x3f')]);_0x6fab6[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x22bfb3[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x3c73ed[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x6fab6[_0x41ac('0x45')]=_0x6fab6[_0x41ac('0x45')][_0x41ac('0x58')]?_0x6fab6['attributes']:_0x22bfb3[_0x41ac('0x51')];if(_0x3c73ed[_0x41ac('0x3f')]['includeAll']){_0x6fab6['include']=[{'all':!![]}];}if(_0x3c73ed['query'][_0x41ac('0x41')]==='true'){_0x6fab6[_0x41ac('0x43')]=[{'model':db[_0x41ac('0x44')],'as':_0x41ac('0x41')}];}_0x6fab6=_[_0x41ac('0x59')]({},_0x6fab6,_0x3c73ed[_0x41ac('0x5a')]);if(!_[_0x41ac('0x3c')](_0x6fab6[_0x41ac('0x45')],'id')){_0x6fab6[_0x41ac('0x45')][_0x41ac('0x46')]('id');}return db[_0x41ac('0x38')][_0x41ac('0x5b')](_0x6fab6)['then'](handleEntityNotFound(_0x2341f5,null))[_0x41ac('0x29')](function(_0x3d0db3){var _0x186a69=[];values=_0x3d0db3;if(_0x3c73ed[_0x41ac('0x3f')][_0x41ac('0x48')]===_0x41ac('0x42')){_0x186a69[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x49'),_0x3d0db3[_0x41ac('0x4a')]));_0x186a69[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x4b'),_0x3d0db3[_0x41ac('0x4a')]));_0x186a69[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x4c'),_0x3d0db3[_0x41ac('0x4a')]));_0x186a69['push'](get_open_tabs('whatsapp',_0x3d0db3[_0x41ac('0x4a')]));_0x186a69[_0x41ac('0x46')](get_open_tabs('fax',_0x3d0db3[_0x41ac('0x4a')]));_0x186a69[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x5c'),_0x3d0db3[_0x41ac('0x4a')]));return BPromise[_0x41ac('0x4e')](_0x186a69);}else{return values;}})[_0x41ac('0x29')](function(){return values;})[_0x41ac('0x29')](respondWithResult(_0x2341f5,null))[_0x41ac('0x1d')](handleError(_0x2341f5,null));};exports[_0x41ac('0x28')]=function(_0x22ea8d,_0x45b6fe){if(_0x22ea8d[_0x41ac('0x5d')]['id']){delete _0x22ea8d['body']['id'];}delete _0x22ea8d[_0x41ac('0x5d')]['role'];return db[_0x41ac('0x38')]['find']({'where':{'id':_0x22ea8d[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x45b6fe,null))['then'](saveUpdates(_0x22ea8d[_0x41ac('0x5d')],null))[_0x41ac('0x29')](respondWithResult(_0x45b6fe,null))[_0x41ac('0x1d')](handleError(_0x45b6fe,null));};exports[_0x41ac('0x5e')]=function(_0x1d6241,_0x5df9c6){return db[_0x41ac('0x38')][_0x41ac('0x5e')]()[_0x41ac('0x29')](respondWithResult(_0x5df9c6,null))[_0x41ac('0x1d')](handleError(_0x5df9c6,null));};exports['addContacts']=function(_0x635ec4,_0x180701){return db['User'][_0x41ac('0x5b')]({'where':{'id':_0x635ec4['params']['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x180701,null))[_0x41ac('0x29')](function(_0x97ffd6){if(_0x97ffd6){return _0x97ffd6[_0x41ac('0x5f')](_0x635ec4[_0x41ac('0x5d')][_0x41ac('0x60')],_[_0x41ac('0x61')](_0x635ec4['body'],[_0x41ac('0x60'),'id'])||{});}})['then'](respondWithResult(_0x180701,null))['catch'](handleError(_0x180701,null));};function validateUser(_0x9d0d14){return new BPromise(function(_0x196e88,_0x2ec359){if(_0x9d0d14[_0x41ac('0x62')])return _0x196e88(_0x9d0d14);return db[_0x41ac('0x63')][_0x41ac('0x64')](0x1)['then'](function(_0x38d320){if(_0x38d320['securePassword'])authService[_0x41ac('0x65')](_0x9d0d14[_0x41ac('0x3d')]);db[_0x41ac('0x38')][_0x41ac('0x66')](_0x41ac('0x62'))[_0x41ac('0x29')](function(_0x923e4){if(_['isNil'](_0x923e4)){_0x9d0d14['internal']=_0x38d320[_0x41ac('0x67')]||0x1;return;}if(_[_0x41ac('0x68')](_0x38d320[_0x41ac('0x67')])||_0x38d320[_0x41ac('0x67')]===_0x923e4){_0x9d0d14['internal']=_0x923e4+0x1;return;}if(_0x38d320[_0x41ac('0x67')]>_0x923e4){_0x9d0d14[_0x41ac('0x62')]=_0x38d320[_0x41ac('0x67')];return;}return db[_0x41ac('0x69')][_0x41ac('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[_0x41ac('0x69')][_0x41ac('0x6a')][_0x41ac('0x6b')]})[_0x41ac('0x29')](function(_0x2b068f){if(_0x2b068f&&_0x2b068f[_0x41ac('0x58')]){for(var _0x44f23b=0x0,_0xc5928a=_0x2b068f['length'];_0x44f23b<_0xc5928a&&_[_0x41ac('0x68')](_0x9d0d14[_0x41ac('0x62')]);_0x44f23b++){if(_0x38d320[_0x41ac('0x67')]<=_0x2b068f[_0x44f23b][_0x41ac('0x6c')]){_0x9d0d14[_0x41ac('0x62')]=_0x2b068f[_0x44f23b][_0x41ac('0x6c')];}else if(_0x38d320['min_internal']>_0x2b068f[_0x44f23b]['from']&&_0x38d320[_0x41ac('0x67')]<=_0x2b068f[_0x44f23b]['to']){_0x9d0d14[_0x41ac('0x62')]=_0x38d320['min_internal'];}}}if(_[_0x41ac('0x68')](_0x9d0d14[_0x41ac('0x62')])){_0x9d0d14[_0x41ac('0x62')]=_0x923e4+0x1;}return _0x196e88(_0x9d0d14);});});})['catch'](function(_0x4e169d){_0x2ec359(_0x4e169d);});});}function updateUser(_0x33ff98){return new BPromise(function(_0x457635,_0x559c48){try{if(_0x33ff98[_0x41ac('0x6d')]){_0x33ff98[_0x41ac('0x6e')]=_0x33ff98[_0x41ac('0x62')];_0x33ff98[_0x41ac('0x6f')]={'mailbox':_0x33ff98[_0x41ac('0x62')],'password':_0x33ff98[_0x41ac('0x3d')],'fullname':_0x33ff98['fullname'],'email':_0x33ff98[_0x41ac('0x70')]};}if(_0x33ff98[_0x41ac('0x2c')]===_0x41ac('0x71')){if(!_0x33ff98[_0x41ac('0x72')])_0x33ff98['permissions']=[_0x41ac('0x73'),'102','103',_0x41ac('0x74'),_0x41ac('0x75'),_0x41ac('0x76'),_0x41ac('0x77'),_0x41ac('0x78'),'107',_0x41ac('0x79'),_0x41ac('0x7a'),'100',_0x41ac('0x7b'),_0x41ac('0x7c'),_0x41ac('0x7d')];}_0x457635(_0x33ff98);}catch(_0x415fa2){_0x559c48(_0x415fa2);}});}exports['create']=function(_0x5605b3,_0x4e8b51){if(_0x5605b3[_0x41ac('0x2f')]['role']===_0x41ac('0x71'))throw new Error(_0x41ac('0x7e'));if(_0x5605b3[_0x41ac('0x5d')][_0x41ac('0x2c')]===_0x41ac('0x2f')&&_0x5605b3['user'][_0x41ac('0x2c')]!==_0x41ac('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x5605b3['body'][_0x41ac('0x2c')]===_0x41ac('0x2d')&&_0x5605b3[_0x41ac('0x2f')][_0x41ac('0x2c')]!==_0x41ac('0x2d')){throw new Error(_0x41ac('0x7f'));}return licenseUtil['checkUserLimits']([_0x5605b3[_0x41ac('0x5d')]])[_0x41ac('0x29')](function(){return validateUser(_0x5605b3[_0x41ac('0x5d')]);})[_0x41ac('0x29')](function(_0x57f646){return updateUser(_0x57f646)[_0x41ac('0x29')](function(_0x45f16a){if(_0x45f16a['role']===_0x41ac('0x2d')){_0x45f16a[_0x41ac('0x80')]=_0x5605b3[_0x41ac('0x2f')][_0x41ac('0x80')];delete _0x45f16a[_0x41ac('0x81')];}return _0x45f16a;});})[_0x41ac('0x29')](function(_0x2bba0b){return db[_0x41ac('0x38')][_0x41ac('0x82')](_0x2bba0b,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x41ac('0x29')](function(_0x15b63f){if(_0x5605b3[_0x41ac('0x5d')]['role']===_0x41ac('0x2f'))return _0x15b63f;if(_0x5605b3[_0x41ac('0x2f')][_0x41ac('0x2c')]!=='user')return _0x15b63f;return db[_0x41ac('0x83')][_0x41ac('0x5b')]({'where':{'name':_0x15b63f[_0x41ac('0x2c')]==='agent'?'Agents':_0x41ac('0x84'),'userProfileId':_0x5605b3[_0x41ac('0x2f')][_0x41ac('0x81')]},'raw':!![]})[_0x41ac('0x29')](function(_0x39d758){if(!_0x39d758||_0x39d758['autoAssociation']!=0x0)return _0x15b63f;return db['UserProfileResource'][_0x41ac('0x82')]({'name':_0x15b63f[_0x41ac('0x33')],'resourceId':_0x15b63f['id'],'type':_0x39d758[_0x41ac('0x33')],'sectionId':_0x39d758['id']},{})[_0x41ac('0x29')](function(){return _0x15b63f;});})[_0x41ac('0x1d')](function(_0x437775){logger[_0x41ac('0x1a')](_0x41ac('0x85'),_0x437775);throw _0x437775;});})['then'](respondWithResult(_0x4e8b51,0xc9))[_0x41ac('0x1d')](handleError(_0x4e8b51,null));};exports[_0x41ac('0x86')]=function(_0x40ffc1,_0x3a5660){var _0x2231f9=_0x40ffc1[_0x41ac('0x5d')];var _0x56e6a9=[];if(_0x40ffc1[_0x41ac('0x2f')][_0x41ac('0x2c')]===_0x41ac('0x71'))throw new Error('Unauthorized');if(_[_0x41ac('0x87')](_0x2231f9,[_0x41ac('0x2c'),_0x41ac('0x2f')])&&_0x40ffc1[_0x41ac('0x2f')][_0x41ac('0x2c')]!==_0x41ac('0x2d')){throw new Error(_0x41ac('0x88'));}if(_['some'](_0x2231f9,[_0x41ac('0x2c'),_0x41ac('0x2d')])&&_0x40ffc1[_0x41ac('0x2f')][_0x41ac('0x2c')]!==_0x41ac('0x2d')){throw new Error(_0x41ac('0x89'));}return licenseUtil[_0x41ac('0x8a')](_0x2231f9)[_0x41ac('0x29')](function(){return validateUser(_0x2231f9[0x0]);})[_0x41ac('0x29')](function(){for(var _0x42d866=0x1;_0x42d866<_0x2231f9[_0x41ac('0x58')];_0x42d866++){var _0x252e99=_0x2231f9[_0x42d866-0x1][_0x41ac('0x62')];if(!_0x2231f9[_0x42d866][_0x41ac('0x62')])_0x2231f9[_0x42d866][_0x41ac('0x62')]=_0x252e99+0x1;_0x56e6a9['push'](validateUser(_0x2231f9[_0x42d866]));}return BPromise[_0x41ac('0x4e')](_0x56e6a9);})[_0x41ac('0x29')](function(){_0x56e6a9=[];for(var _0x5d38fd=0x0;_0x5d38fd<_0x2231f9[_0x41ac('0x58')];_0x5d38fd++){_0x56e6a9[_0x41ac('0x46')](updateUser(_0x2231f9[_0x5d38fd]));}return BPromise['all'](_0x56e6a9);})[_0x41ac('0x29')](function(){return BPromise[_0x41ac('0x8b')](_0x2231f9,function(_0x21b28c){return db[_0x41ac('0x38')]['create'](_0x21b28c,{'include':[{'model':db['VoiceMail'],'as':_0x41ac('0x6f')}]})['then'](function(_0x425328){_0x21b28c['id']=_0x425328['id'];return _0x21b28c;});});})[_0x41ac('0x29')](function(_0x21c666){if(_0x40ffc1['body'][_0x41ac('0x2c')]==='user')return _0x21c666;if(_0x40ffc1[_0x41ac('0x2f')][_0x41ac('0x2c')]!==_0x41ac('0x2f'))return _0x21c666;var _0x57f058=_[_0x41ac('0x87')](_0x21c666,function(_0x6d2625){return _0x6d2625[_0x41ac('0x2c')]===_0x41ac('0x71')||_0x6d2625[_0x41ac('0x2c')]===_0x41ac('0x8c');});if(!_0x57f058)return _0x21c666;return db['UserProfileSection'][_0x41ac('0x8d')]({'where':{'name':{'$or':[_0x41ac('0x8e'),_0x41ac('0x84')]},'userProfileId':_0x40ffc1[_0x41ac('0x2f')][_0x41ac('0x81')]},'raw':!![]})[_0x41ac('0x29')](function(_0x4ae7ef){if(_[_0x41ac('0x8f')](_0x4ae7ef)||!_[_0x41ac('0x87')](_0x4ae7ef,[_0x41ac('0x90'),0x0]))return _0x21c666;_0x56e6a9=[];var _0x2cc044=_(_0x4ae7ef)['map'](function(_0x180392){if(_0x180392[_0x41ac('0x90')]===0x1)return;return _0x180392[_0x41ac('0x33')]===_0x41ac('0x8e')?_0x41ac('0x71'):'telephone';})['compact']()[_0x41ac('0x32')]();for(var _0xb4eb46=0x0;_0xb4eb46<_0x21c666[_0x41ac('0x58')];_0xb4eb46++){if(!_[_0x41ac('0x3c')](_0x2cc044,_0x21c666[_0xb4eb46][_0x41ac('0x2c')]))return;var _0x5c336d=_0x21c666[_0xb4eb46]['role']===_0x41ac('0x71')?_0x41ac('0x8e'):_0x41ac('0x84');_0x56e6a9[_0x41ac('0x46')](db[_0x41ac('0x34')][_0x41ac('0x82')]({'name':_0x21c666[_0xb4eb46][_0x41ac('0x33')],'resourceId':_0x21c666[_0xb4eb46]['id'],'type':_0x5c336d,'sectionId':_['find'](_0x4ae7ef,[_0x41ac('0x33'),_0x5c336d])['id']},{}));}return BPromise[_0x41ac('0x4e')](_0x56e6a9);});})[_0x41ac('0x29')](respondWithResult(_0x3a5660,0xc9))['catch'](handleError(_0x3a5660,null));};exports[_0x41ac('0x91')]=function(_0x3f4b6d,_0xb59b73){if(_0x3f4b6d[_0x41ac('0x5d')]['id']){delete _0x3f4b6d['body']['id'];}return db[_0x41ac('0x38')]['find']({'where':{'id':_0x3f4b6d[_0x41ac('0x50')]['id']}})['then'](function(_0x4c4063){if(!_0x4c4063)return null;if(_0x4c4063['id']===_0x3f4b6d[_0x41ac('0x2f')]['id']){if(!_0x3f4b6d[_0x41ac('0x5d')]['oldPassword']||!_0x3f4b6d[_0x41ac('0x5d')]['newPassword']){throw new db[(_0x41ac('0x92'))]['ValidationError'](_0x41ac('0x93'));}if(!_0x4c4063[_0x41ac('0x94')](_0x3f4b6d[_0x41ac('0x5d')][_0x41ac('0x95')])){throw new db['Sequelize'][(_0x41ac('0x96'))]('Wrong\x20credentials');}if(_0x3f4b6d[_0x41ac('0x5d')]['oldPassword']===_0x3f4b6d['body']['newPassword']){throw new db[(_0x41ac('0x92'))][(_0x41ac('0x96'))](_0x41ac('0x97'));}}else if(_0x3f4b6d[_0x41ac('0x2f')][_0x41ac('0x2c')]==='admin'){if(!_0x3f4b6d[_0x41ac('0x5d')][_0x41ac('0x98')]){throw new db['Sequelize']['ValidationError'](_0x41ac('0x99'));}}else if(_0x3f4b6d[_0x41ac('0x2f')][_0x41ac('0x2c')]===_0x41ac('0x2f')){if(!_0x3f4b6d[_0x41ac('0x5d')][_0x41ac('0x98')]){throw new db['Sequelize']['ValidationError'](_0x41ac('0x99'));}if(_0x4c4063[_0x41ac('0x2c')]!==_0x41ac('0x71')){throw new db[(_0x41ac('0x92'))][(_0x41ac('0x96'))](_0x41ac('0x7e'));}}else{throw new db[(_0x41ac('0x92'))][(_0x41ac('0x96'))](_0x41ac('0x7e'));}return _0x4c4063;})['then'](handleEntityNotFound(_0xb59b73,null))['then'](function(_0x77b26){return db[_0x41ac('0x63')][_0x41ac('0x9a')]({'attributes':['id',_0x41ac('0x9b'),_0x41ac('0x9c'),_0x41ac('0x9d')]})[_0x41ac('0x29')](function(_0x38c42f){if(_0x38c42f['securePassword'])authService[_0x41ac('0x65')](_0x3f4b6d[_0x41ac('0x5d')][_0x41ac('0x98')]);if(!_0x38c42f[_0x41ac('0x9c')]||!_0x77b26[_0x41ac('0x9e')])return _0x77b26;authService[_0x41ac('0x9f')](_0x3f4b6d[_0x41ac('0x5d')][_0x41ac('0x98')],_0x77b26[_0x41ac('0x9e')],_0x38c42f[_0x41ac('0x9d')]);return _0x77b26;})[_0x41ac('0x29')](saveUpdates({'password':_0x3f4b6d['body']['newPassword'],'passwordResetAt':_0x3f4b6d['user']['id']==_0x3f4b6d[_0x41ac('0x50')]['id']?moment():null,'previousPasswords':authService[_0x41ac('0xa0')](_0x3f4b6d['body'][_0x41ac('0x98')],_0x77b26[_0x41ac('0x9e')])},null));})[_0x41ac('0x29')](respondWithResult(_0xb59b73,null))[_0x41ac('0x1d')](handleError(_0xb59b73,null));};exports[_0x41ac('0xa1')]=function(_0x9b31ad,_0x5870a1){var _0x454471=_0x9b31ad['body'][_0x41ac('0xa2')];return db[_0x41ac('0x38')][_0x41ac('0x5b')]({'where':{'id':_0x9b31ad[_0x41ac('0x50')]['id']},'attributes':['id','name','role',_0x41ac('0xa3'),_0x41ac('0xa4'),_0x41ac('0xa5'),_0x41ac('0xa6')]})['then'](handleEntityNotFound(_0x5870a1,null))[_0x41ac('0x29')](function(_0x405343){if(_0x405343){if(!utils[_0x41ac('0xa7')](_0x454471)){throw new db[(_0x41ac('0x92'))][(_0x41ac('0x96'))]('Unknown\x20channel');}return _0x405343[_0x41ac('0xa8')+_[_0x41ac('0xa9')](_0x454471[_0x41ac('0xaa')]())+_0x41ac('0xab')](_0x9b31ad['body'][_0x41ac('0x60')],{'penalty':_0x9b31ad[_0x41ac('0x5d')][_0x41ac('0xac')]||0x0})[_0x41ac('0xad')](function(_0x35788d){for(var _0x7f5d4e=0x0;_0x7f5d4e<_0x9b31ad[_0x41ac('0x5d')][_0x41ac('0x60')][_0x41ac('0x58')];_0x7f5d4e+=0x1){var _0x4bb2a4={'UserId':Number(_0x9b31ad[_0x41ac('0x50')]['id'])};_0x4bb2a4[_[_0x41ac('0xa9')](_0x454471[_0x41ac('0xaa')]())+_0x41ac('0xae')]=Number(_0x9b31ad['body']['ids'][_0x7f5d4e]);socket[_0x41ac('0xaf')](_0x41ac('0x2f')+_[_0x41ac('0xa9')](_0x454471[_0x41ac('0xaa')]())+'Queue:save',_0x4bb2a4);}return _0x35788d;})['then'](function(){if(_0x454471===_0x41ac('0xb0')){return db['VoiceQueue']['findAll']({'where':{'id':_0x9b31ad[_0x41ac('0x5d')][_0x41ac('0x60')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x41ac('0x29')](function(_0x9eb942){var _0x45a95f=_0x405343[_0x41ac('0x2b')]({'plain':!![]});var _0xa82b0=[];if(_0x454471===_0x41ac('0xb0')&&_0x45a95f[_0x41ac('0x2c')]===_0x41ac('0x71')&&_0x45a95f['online']){for(var _0x162a7e=0x0;_0x162a7e<_0x9eb942[_0x41ac('0x58')];_0x162a7e+=0x1){_0xa82b0[_0x41ac('0x46')]({'membername':_0x45a95f[_0x41ac('0x33')],'UserId':_0x45a95f['id'],'queue_name':_0x9eb942[_0x162a7e][_0x41ac('0x33')],'VoiceQueueId':_0x9eb942[_0x162a7e]['id'],'interface':_[_0x41ac('0x68')](_0x45a95f['interface'])?util[_0x41ac('0xb1')]('SIP/%s',_0x45a95f['name']):_0x45a95f['interface'],'paused':_0x45a95f[_0x41ac('0xa5')]||![],'penalty':_0x9b31ad[_0x41ac('0x5d')][_0x41ac('0xac')]||0x0});}return BPromise[_0x41ac('0x8b')](_0xa82b0,function(_0x1a94b0){return db['UserVoiceQueueRt'][_0x41ac('0xb2')](_0x1a94b0);});}return _0x405343;});}})[_0x41ac('0x29')](respondWithStatusCode(_0x5870a1,null))[_0x41ac('0x1d')](handleError(_0x5870a1,null));};exports[_0x41ac('0xb3')]=function(_0x507680,_0x5bec4b){var _0x4e0b4d,_0x4b8508;return db[_0x41ac('0x38')][_0x41ac('0x5b')]({'where':{'id':_0x507680[_0x41ac('0x50')]['id']},'attributes':['id','name',_0x41ac('0x2c')]})['then'](handleEntityNotFound(_0x5bec4b,null))['then'](function(_0x52adb2){if(_0x52adb2){_0x4e0b4d=_0x52adb2;if(!_0x507680[_0x41ac('0x3f')][_0x41ac('0xa2')]||!utils[_0x41ac('0xa7')](_0x507680[_0x41ac('0x3f')][_0x41ac('0xa2')])){throw new db[(_0x41ac('0x92'))]['ValidationError'](_0x41ac('0xb4'));}return _0x52adb2[_0x41ac('0xb5')+_[_0x41ac('0xa9')](_0x507680[_0x41ac('0x3f')][_0x41ac('0xa2')][_0x41ac('0xaa')]())+'Queues'](_0x507680[_0x41ac('0x3f')][_0x41ac('0x60')]);}})['then'](function(_0xf6e296){if(_[_0x41ac('0xb6')](_0x507680[_0x41ac('0x3f')][_0x41ac('0x60')])){for(var _0x596010=0x0;_0x596010<_0x507680['query']['ids'][_0x41ac('0x58')];_0x596010+=0x1){_0x4b8508={'UserId':Number(_0x507680[_0x41ac('0x50')]['id'])};_0x4b8508[_['capitalize'](_0x507680['query'][_0x41ac('0xa2')][_0x41ac('0xaa')]())+'QueueId']=Number(_0x507680[_0x41ac('0x3f')][_0x41ac('0x60')][_0x596010]);socket[_0x41ac('0xaf')]('user'+_[_0x41ac('0xa9')](_0x507680[_0x41ac('0x3f')][_0x41ac('0xa2')][_0x41ac('0xaa')]())+'Queue:remove',_0x4b8508);}}else{_0x4b8508={'UserId':Number(_0x507680[_0x41ac('0x50')]['id'])};_0x4b8508[_[_0x41ac('0xa9')](_0x507680['query'][_0x41ac('0xa2')][_0x41ac('0xaa')]())+_0x41ac('0xae')]=Number(_0x507680[_0x41ac('0x3f')][_0x41ac('0x60')]);socket['emit'](_0x41ac('0x2f')+_[_0x41ac('0xa9')](_0x507680[_0x41ac('0x3f')][_0x41ac('0xa2')][_0x41ac('0xaa')]())+_0x41ac('0xb7'),_0x4b8508);}return _0xf6e296;})[_0x41ac('0x29')](function(){if(_0x507680[_0x41ac('0x3f')][_0x41ac('0xa2')]==='voice'){return db['UserVoiceQueueRt'][_0x41ac('0x2a')]({'where':{'UserId':_0x507680[_0x41ac('0x50')]['id'],'VoiceQueueId':_0x507680[_0x41ac('0x3f')][_0x41ac('0x60')]},'individualHooks':!![]})[_0x41ac('0x29')](function(){return _0x4e0b4d;});}return _0x4e0b4d;})[_0x41ac('0x29')](respondWithStatusCode(_0x5bec4b,null))['catch'](handleError(_0x5bec4b,null));};exports[_0x41ac('0xb8')]=function(_0x2edd47,_0x251919){_0x2edd47[_0x41ac('0x5d')]['userpic']=_0x2edd47['file'][_0x41ac('0xb9')];return db[_0x41ac('0x38')]['find']({'where':{'id':_0x2edd47[_0x41ac('0x50')]['id']}})['then'](handleEntityNotFound(_0x251919,null))[_0x41ac('0x29')](saveUpdates(_0x2edd47[_0x41ac('0x5d')],null))[_0x41ac('0x29')](respondWithResult(_0x251919,null))['catch'](handleError(_0x251919,null));};exports[_0x41ac('0xba')]=function(_0x1e1274,_0x55fd8a){var _0x37da09=path[_0x41ac('0xbb')](config['root'],_0x41ac('0xbc'));return db[_0x41ac('0x38')][_0x41ac('0x5b')]({'where':{'id':_0x1e1274['params']['id']},'attributes':['id',_0x41ac('0xbd')],'raw':!![]})['then'](handleEntityNotFound(_0x55fd8a,null))[_0x41ac('0x29')](function(_0x29d8ad){if(_0x29d8ad){if(_[_0x41ac('0x68')](_0x29d8ad[_0x41ac('0xbd')])){return _0x55fd8a['download'](_0x37da09);}else{if(!fs['existsSync'](path[_0x41ac('0xbb')](config[_0x41ac('0xbe')],_0x41ac('0xbf'),_0x29d8ad[_0x41ac('0xbd')]))){return _0x55fd8a[_0x41ac('0xc0')](_0x37da09);}return _0x55fd8a[_0x41ac('0xc0')](path['join'](config[_0x41ac('0xbe')],'server/files/images/',_0x29d8ad['userpic']));}}})[_0x41ac('0x1d')](handleError(_0x55fd8a,null));};exports[_0x41ac('0xc1')]=function(_0x2940bc,_0x28119a){return db[_0x41ac('0x38')]['find']({'where':{'id':_0x2940bc[_0x41ac('0x50')]['id']},'attributes':['id']})[_0x41ac('0x29')](handleEntityNotFound(_0x28119a,null))[_0x41ac('0x29')](function(_0x5b6dc2){var _0x7ce5ed=[];values=_0x5b6dc2[_0x41ac('0x4a')];_0x7ce5ed['push'](get_open_tabs('chat',_0x5b6dc2[_0x41ac('0x4a')]));_0x7ce5ed['push'](get_open_tabs(_0x41ac('0x4b'),_0x5b6dc2['dataValues']));_0x7ce5ed[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x4c'),_0x5b6dc2[_0x41ac('0x4a')]));_0x7ce5ed[_0x41ac('0x46')](get_open_tabs('whatsapp',_0x5b6dc2[_0x41ac('0x4a')]));_0x7ce5ed[_0x41ac('0x46')](get_open_tabs('fax',_0x5b6dc2['dataValues']));_0x7ce5ed[_0x41ac('0x46')](get_open_tabs(_0x41ac('0x5c'),_0x5b6dc2[_0x41ac('0x4a')]));return BPromise[_0x41ac('0x4e')](_0x7ce5ed);})['then'](function(_0x2dd1d5){if(_0x2dd1d5){var _0x42cb2d=_[_0x41ac('0xc2')](values[_0x41ac('0xc3')],function(_0x65ea08){return{'channel':_0x41ac('0xc4'),'id':_0x65ea08['id'],'createdAt':_0x65ea08[_0x41ac('0xc5')]};});var _0x3461fa=_[_0x41ac('0xc2')](values[_0x41ac('0xc6')],function(_0x4cba2e){return{'channel':'FAX','id':_0x4cba2e['id'],'createdAt':_0x4cba2e['createdAt']};});var _0x4597de=_[_0x41ac('0xc2')](values[_0x41ac('0xc7')],function(_0x2a01ff){return{'channel':_0x41ac('0xc8'),'id':_0x2a01ff['id'],'createdAt':_0x2a01ff[_0x41ac('0xc5')]};});var _0x4805f5=_[_0x41ac('0xc2')](values[_0x41ac('0xc9')],function(_0x13ad0b){return{'channel':_0x41ac('0xca'),'id':_0x13ad0b['id'],'createdAt':_0x13ad0b[_0x41ac('0xc5')]};});var _0x166f6e=_[_0x41ac('0xc2')](values[_0x41ac('0xcb')],function(_0x3c1490){return{'channel':'SMS','id':_0x3c1490['id'],'createdAt':_0x3c1490[_0x41ac('0xc5')]};});var _0x42ec8c=_[_0x41ac('0xc2')](values['WhatsappOpenTabs'],function(_0x212ed2){return{'channel':_0x41ac('0xcc'),'id':_0x212ed2['id'],'createdAt':_0x212ed2[_0x41ac('0xc5')]};});var _0x4d4b96=_[_0x41ac('0xcd')](_0x42cb2d,_0x3461fa,_0x4597de,_0x4805f5,_0x166f6e,_0x42ec8c);var _0x3b2c0f={'count':_0x4d4b96[_0x41ac('0x58')],'rows':_0x4d4b96};return _0x3b2c0f;}else return null;})['then'](respondWithResult(_0x28119a,null))[_0x41ac('0x1d')](handleError(_0x28119a,null));};exports[_0x41ac('0xce')]=function(_0x27bbb1,_0x35f4ef){var _0x3f4b00={};var _0x110a4f={};var _0x419bf0;var _0x400e14;return db[_0x41ac('0x38')]['findOne']({'where':{'id':_0x27bbb1[_0x41ac('0x50')]['id']}})['then'](handleEntityNotFound(_0x35f4ef,null))[_0x41ac('0x29')](function(_0x3049e5){if(_0x3049e5){_0x419bf0=_0x3049e5;_0x110a4f['model']=_[_0x41ac('0x53')](db[_0x41ac('0xcf')][_0x41ac('0x54')]);_0x110a4f[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x27bbb1['query']);_0x110a4f[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x110a4f['model'],_0x110a4f['query']);_0x3f4b00[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x110a4f[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x27bbb1['query'][_0x41ac('0x57')]));_0x3f4b00[_0x41ac('0x45')]=_0x3f4b00[_0x41ac('0x45')]['length']?_0x3f4b00[_0x41ac('0x45')]:_0x110a4f['model'];_0x3f4b00[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x27bbb1['query'][_0x41ac('0xd2')]);_0x3f4b00[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x27bbb1[_0x41ac('0x3f')],_0x110a4f[_0x41ac('0xd0')]));if(_0x27bbb1[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x3f4b00[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x3f4b00['where'],{'$or':_[_0x41ac('0xc2')](_0x3f4b00[_0x41ac('0x45')],function(_0x28f4ac){var _0x1e7d6e={};_0x1e7d6e[_0x28f4ac]={'$like':'%'+_0x27bbb1[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0x1e7d6e;})});}_0x3f4b00=_[_0x41ac('0x59')]({},_0x3f4b00,_0x27bbb1[_0x41ac('0x5a')]);return _0x419bf0[_0x41ac('0xce')](_0x3f4b00);}})[_0x41ac('0x29')](function(_0x52bb19){if(_0x52bb19){_0x400e14=_0x52bb19['length'];if(_0x27bbb1[_0x41ac('0x3f')]['hasOwnProperty']('includeAll')){_0x3f4b00[_0x41ac('0x43')]=[{'model':db[_0x41ac('0xd4')],'as':'List','required':![]},{'model':db[_0x41ac('0xd5')],'as':_0x41ac('0xd6'),'attributes':['id','name',_0x41ac('0xd7')],'where':_0x27bbb1[_0x41ac('0x3f')][_0x41ac('0xd8')]?{'id':_0x27bbb1['query'][_0x41ac('0xd8')]}:undefined,'required':_0x27bbb1[_0x41ac('0x3f')]['tag']?!![]:![]}];}if(!_0x27bbb1[_0x41ac('0x3f')]['hasOwnProperty'](_0x41ac('0xd9'))){_0x3f4b00[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x27bbb1[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x3f4b00[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x27bbb1[_0x41ac('0x3f')][_0x41ac('0x24')]);}return _0x419bf0[_0x41ac('0xce')](_0x3f4b00);}})[_0x41ac('0x29')](function(_0x3abbb7){if(_0x3abbb7){return _0x3abbb7?{'count':_0x400e14,'rows':_0x3abbb7}:null;}})[_0x41ac('0x29')](respondWithResult(_0x35f4ef,null))[_0x41ac('0x1d')](handleError(_0x35f4ef,null));};exports[_0x41ac('0xda')]=function(_0x44da5d,_0x4954fd){var _0x131025;var _0x284b1a={};var _0x5d95b6;return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x44da5d[_0x41ac('0x50')]['id']},'attributes':['id',_0x41ac('0x33'),_0x41ac('0x2c')]})[_0x41ac('0x29')](handleEntityNotFound(_0x4954fd,null))[_0x41ac('0x29')](function(_0x5c0766){if(!utils['isValidChannel'](_0x44da5d[_0x41ac('0x3f')][_0x41ac('0xa2')])){throw new db['Sequelize'][(_0x41ac('0x96'))](_0x41ac('0xb4'));}_0x131025=_0x5c0766;var _0x5d7668={};_0x5d7668[_0x41ac('0x51')]=_[_0x41ac('0x53')](db[_['capitalize'](_0x44da5d[_0x41ac('0x3f')][_0x41ac('0xa2')])+_0x41ac('0xdb')][_0x41ac('0x54')]);_0x5d7668[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x44da5d[_0x41ac('0x3f')]);_0x5d7668[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x5d7668[_0x41ac('0x51')],_0x5d7668['query']);_0x284b1a['attributes']=_[_0x41ac('0x56')](_0x5d7668[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x44da5d[_0x41ac('0x3f')]['fields']));_0x284b1a['attributes']=_0x284b1a['attributes'][_0x41ac('0x58')]?_0x284b1a[_0x41ac('0x45')]:_0x5d7668[_0x41ac('0x51')];_0x284b1a[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x44da5d['query'][_0x41ac('0xd2')]);_0x284b1a[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_['pick'](_0x44da5d['query'],_0x5d7668[_0x41ac('0xd0')]));if(_0x44da5d[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x284b1a[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x284b1a[_0x41ac('0x3e')],{'$or':_[_0x41ac('0xc2')](_0x284b1a['attributes'],function(_0x2f8fc1){var _0x309d1d={};_0x309d1d[_0x2f8fc1]={'$like':'%'+_0x44da5d[_0x41ac('0x3f')]['filter']+'%'};return _0x309d1d;})});}_0x284b1a=_[_0x41ac('0x59')]({},_0x284b1a,_0x44da5d[_0x41ac('0x5a')]);switch(_0x131025[_0x41ac('0x2c')]){case _0x41ac('0x2d'):return db[_['capitalize'](_0x44da5d[_0x41ac('0x3f')][_0x41ac('0xa2')])+_0x41ac('0xdb')][_0x41ac('0x8d')](_0x284b1a);case'user':case _0x41ac('0x71'):return _0x131025['get'+_[_0x41ac('0xa9')](_0x44da5d[_0x41ac('0x3f')][_0x41ac('0xa2')])+_0x41ac('0xab')](_0x284b1a);default:throw new db[(_0x41ac('0x92'))]['ValidationError'](_0x41ac('0xdc'));}})['then'](function(_0xc672b6){_0x5d95b6=_0xc672b6[_0x41ac('0x58')];if(!_0x44da5d[_0x41ac('0x3f')][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x284b1a[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x44da5d[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x284b1a['offset']=qs['offset'](_0x44da5d[_0x41ac('0x3f')][_0x41ac('0x24')]);}switch(_0x131025[_0x41ac('0x2c')]){case'admin':return db[_[_0x41ac('0xa9')](_0x44da5d[_0x41ac('0x3f')]['channel'])+_0x41ac('0xdb')]['findAll'](_0x284b1a);case _0x41ac('0x2f'):case _0x41ac('0x71'):return _0x131025[_0x41ac('0x2b')+_[_0x41ac('0xa9')](_0x44da5d[_0x41ac('0x3f')][_0x41ac('0xa2')])+'Queues'](_0x284b1a);}})['then'](function(_0x57339a){return{'count':_0x5d95b6,'rows':_0x57339a};})[_0x41ac('0x29')](respondWithResult(_0x4954fd,null))[_0x41ac('0x1d')](handleError(_0x4954fd,null));};exports['getVoiceQueuesRt']=function(_0x39755d,_0x1476d8){var _0x2456f9={};var _0x34ec2a={};var _0xf76b5;var _0x5355be;return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x39755d[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x1476d8,null))[_0x41ac('0x29')](function(_0x391955){if(_0x391955){_0xf76b5=_0x391955;_0x34ec2a[_0x41ac('0x51')]=_['keys'](db[_0x41ac('0xde')][_0x41ac('0x54')]);_0x34ec2a['query']=_['keys'](_0x39755d[_0x41ac('0x3f')]);_0x34ec2a[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x34ec2a[_0x41ac('0x51')],_0x34ec2a[_0x41ac('0x3f')]);_0x2456f9[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x34ec2a[_0x41ac('0x51')],qs['fields'](_0x39755d[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x2456f9['attributes']=_0x2456f9[_0x41ac('0x45')][_0x41ac('0x58')]?_0x2456f9[_0x41ac('0x45')]:_0x34ec2a[_0x41ac('0x51')];_0x2456f9[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x39755d['query'][_0x41ac('0xd2')]);_0x2456f9[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x39755d[_0x41ac('0x3f')],_0x34ec2a[_0x41ac('0xd0')]));if(_0x39755d[_0x41ac('0x3f')]['filter']){_0x2456f9['where']=_[_0x41ac('0x59')](_0x2456f9['where'],{'$or':_[_0x41ac('0xc2')](_0x2456f9[_0x41ac('0x45')],function(_0x5196ad){var _0x4fa76e={};_0x4fa76e[_0x5196ad]={'$like':'%'+_0x39755d[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0x4fa76e;})});}_0x2456f9=_['merge']({},_0x2456f9,_0x39755d[_0x41ac('0x5a')]);return _0xf76b5[_0x41ac('0xdf')](_0x2456f9);}})[_0x41ac('0x29')](function(_0x9f46b5){if(_0x9f46b5){_0x5355be=_0x9f46b5[_0x41ac('0x58')];if(!_0x39755d[_0x41ac('0x3f')][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x2456f9[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x39755d[_0x41ac('0x3f')]['limit']);_0x2456f9[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x39755d[_0x41ac('0x3f')][_0x41ac('0x24')]);}return _0xf76b5[_0x41ac('0xdf')](_0x2456f9);}})[_0x41ac('0x29')](function(_0x53badf){if(_0x53badf){return _0x53badf?{'count':_0x5355be,'rows':_0x53badf}:null;}})['then'](respondWithResult(_0x1476d8,null))[_0x41ac('0x1d')](handleError(_0x1476d8,null));};exports[_0x41ac('0xe0')]=function(_0x4407a6,_0xd9fa23){var _0x573c76={};var _0x3caea1={};var _0x21f8e9;var _0x19809a;return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x4407a6[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0xd9fa23,null))[_0x41ac('0x29')](function(_0x30e1d1){if(_0x30e1d1){_0x21f8e9=_0x30e1d1;_0x3caea1[_0x41ac('0x51')]=_['keys'](db[_0x41ac('0xe1')]['rawAttributes']);_0x3caea1[_0x41ac('0x3f')]=_['keys'](_0x4407a6['query']);_0x3caea1[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x3caea1[_0x41ac('0x51')],_0x3caea1[_0x41ac('0x3f')]);_0x573c76[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x3caea1[_0x41ac('0x51')],qs['fields'](_0x4407a6[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x573c76[_0x41ac('0x45')]=_0x573c76[_0x41ac('0x45')][_0x41ac('0x58')]?_0x573c76[_0x41ac('0x45')]:_0x3caea1['model'];_0x573c76[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x4407a6['query']['sort']);_0x573c76[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x4407a6[_0x41ac('0x3f')],_0x3caea1[_0x41ac('0xd0')]));if(_0x4407a6['query'][_0x41ac('0x30')]){_0x573c76['where']=_[_0x41ac('0x59')](_0x573c76['where'],{'$or':_[_0x41ac('0xc2')](_0x573c76[_0x41ac('0x45')],function(_0x1f71f7){var _0x2df7f5={};_0x2df7f5[_0x1f71f7]={'$like':'%'+_0x4407a6[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0x2df7f5;})});}_0x573c76=_['merge']({},_0x573c76,_0x4407a6[_0x41ac('0x5a')]);return _0x21f8e9[_0x41ac('0xe0')](_0x573c76);}})[_0x41ac('0x29')](function(_0x49d45a){if(_0x49d45a){_0x19809a=_0x49d45a[_0x41ac('0x58')];if(!_0x4407a6[_0x41ac('0x3f')][_0x41ac('0xdd')]('nolimit')){_0x573c76[_0x41ac('0x23')]=qs['limit'](_0x4407a6[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x573c76[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x4407a6[_0x41ac('0x3f')]['offset']);}return _0x21f8e9[_0x41ac('0xe0')](_0x573c76);}})['then'](function(_0x4a7ac1){if(_0x4a7ac1){return _0x4a7ac1?{'count':_0x19809a,'rows':_0x4a7ac1}:null;}})['then'](respondWithResult(_0xd9fa23,null))['catch'](handleError(_0xd9fa23,null));};exports[_0x41ac('0xe2')]=function(_0x303bef,_0x2f71a4){var _0x5ed797={'raw':!![],'where':{}};var _0x265f2d={};var _0x455d95={'count':0x0,'rows':[]};return db['User'][_0x41ac('0x9a')]({'where':{'id':_0x303bef[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x2f71a4,null))[_0x41ac('0x29')](function(_0x4c05ba){if(_0x4c05ba){_0x265f2d[_0x41ac('0x51')]=_['keys'](db[_0x41ac('0xe3')]['rawAttributes']);_0x265f2d[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x303bef['query']);_0x265f2d['filters']=_['intersection'](_0x265f2d['model'],_0x265f2d[_0x41ac('0x3f')]);_0x5ed797[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x265f2d[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x303bef[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x5ed797[_0x41ac('0x45')]=_0x5ed797['attributes'][_0x41ac('0x58')]?_0x5ed797[_0x41ac('0x45')]:_0x265f2d[_0x41ac('0x51')];if(!_0x303bef[_0x41ac('0x3f')][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x5ed797['limit']=qs[_0x41ac('0x23')](_0x303bef[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x5ed797['offset']=qs[_0x41ac('0x24')](_0x303bef[_0x41ac('0x3f')][_0x41ac('0x24')]);}_0x5ed797[_0x41ac('0xd1')]=qs['sort'](_0x303bef[_0x41ac('0x3f')][_0x41ac('0xd2')]);_0x5ed797[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x303bef[_0x41ac('0x3f')],_0x265f2d[_0x41ac('0xd0')]));_0x5ed797['where'][_0x41ac('0xe4')]=_0x4c05ba['id'];if(_0x303bef[_0x41ac('0x3f')]['filter']){_0x5ed797[_0x41ac('0x3e')]=_['merge'](_0x5ed797['where'],{'$or':_[_0x41ac('0xc2')](_0x5ed797[_0x41ac('0x45')],function(_0x2801d4){var _0x3bc178={};_0x3bc178[_0x2801d4]={'$like':'%'+_0x303bef['query']['filter']+'%'};return _0x3bc178;})});}_0x5ed797=_[_0x41ac('0x59')]({},_0x5ed797,_0x303bef['options']);return db['VoiceRecording']['count']({'where':_0x5ed797[_0x41ac('0x3e')]})['then'](function(_0x3e3a3e){_0x455d95[_0x41ac('0x25')]=_0x3e3a3e;if(_0x303bef['query'][_0x41ac('0x40')]){_0x5ed797[_0x41ac('0x43')]=[{'all':!![]}];}return db[_0x41ac('0xe3')][_0x41ac('0x8d')](_0x5ed797);})['then'](function(_0x5302c5){_0x455d95['rows']=_0x5302c5;return _0x455d95;});}})[_0x41ac('0x29')](respondWithFilteredResult(_0x2f71a4,_0x5ed797))[_0x41ac('0x1d')](handleError(_0x2f71a4,null));};exports['getScreenRecordings']=function(_0x5c3793,_0x5b3423){var _0x5b50f7={'raw':!![],'where':{}};var _0xd5641b={};var _0x139c16={'count':0x0,'rows':[]};return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x5c3793[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x5b3423,null))['then'](function(_0x1c17b2){if(_0x1c17b2){_0xd5641b[_0x41ac('0x51')]=_[_0x41ac('0x53')](db[_0x41ac('0xe5')][_0x41ac('0x54')]);_0xd5641b[_0x41ac('0x3f')]=_['keys'](_0x5c3793[_0x41ac('0x3f')]);_0xd5641b['filters']=_[_0x41ac('0x56')](_0xd5641b[_0x41ac('0x51')],_0xd5641b['query']);_0x5b50f7[_0x41ac('0x45')]=_['intersection'](_0xd5641b[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x5c3793[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x5b50f7[_0x41ac('0x45')]=_0x5b50f7[_0x41ac('0x45')][_0x41ac('0x58')]?_0x5b50f7['attributes']:_0xd5641b[_0x41ac('0x51')];if(!_0x5c3793[_0x41ac('0x3f')][_0x41ac('0xdd')]('nolimit')){_0x5b50f7[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x5c3793[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x5b50f7[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x5c3793[_0x41ac('0x3f')][_0x41ac('0x24')]);}_0x5b50f7[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x5c3793['query'][_0x41ac('0xd2')]);_0x5b50f7[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x5c3793[_0x41ac('0x3f')],_0xd5641b['filters']));_0x5b50f7[_0x41ac('0x3e')][_0x41ac('0xe4')]=_0x1c17b2['id'];if(_0x5c3793[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x5b50f7[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x5b50f7[_0x41ac('0x3e')],{'$or':_['map'](_0x5b50f7[_0x41ac('0x45')],function(_0x375b49){var _0xdc877={};_0xdc877[_0x375b49]={'$like':'%'+_0x5c3793['query'][_0x41ac('0x30')]+'%'};return _0xdc877;})});}_0x5b50f7=_[_0x41ac('0x59')]({},_0x5b50f7,_0x5c3793[_0x41ac('0x5a')]);return db[_0x41ac('0xe5')][_0x41ac('0x25')]({'where':_0x5b50f7[_0x41ac('0x3e')]})[_0x41ac('0x29')](function(_0x311296){_0x139c16[_0x41ac('0x25')]=_0x311296;if(_0x5c3793[_0x41ac('0x3f')]['includeAll']){_0x5b50f7[_0x41ac('0x43')]=[{'all':!![]}];}return db[_0x41ac('0xe5')][_0x41ac('0x8d')](_0x5b50f7);})[_0x41ac('0x29')](function(_0x380333){_0x139c16[_0x41ac('0x47')]=_0x380333;return _0x139c16;});}})[_0x41ac('0x29')](respondWithFilteredResult(_0x5b3423,_0x5b50f7))[_0x41ac('0x1d')](handleError(_0x5b3423,null));};exports[_0x41ac('0xe6')]=function(_0x51fdf7,_0x5ae608){var _0x135219={};var _0x1b5563={};var _0xea355b;var _0x38197d;return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x51fdf7[_0x41ac('0x50')]['id']}})['then'](handleEntityNotFound(_0x5ae608,null))[_0x41ac('0x29')](function(_0x208b44){if(_0x208b44){_0xea355b=_0x208b44;_0x1b5563['model']=_[_0x41ac('0x53')](db[_0x41ac('0xe7')][_0x41ac('0x54')]);_0x1b5563[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x51fdf7[_0x41ac('0x3f')]);_0x1b5563['filters']=_['intersection'](_0x1b5563[_0x41ac('0x51')],_0x1b5563[_0x41ac('0x3f')]);_0x135219[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x1b5563[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x51fdf7['query'][_0x41ac('0x57')]));_0x135219['attributes']=_0x135219[_0x41ac('0x45')][_0x41ac('0x58')]?_0x135219['attributes']:_0x1b5563[_0x41ac('0x51')];_0x135219[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x51fdf7['query']['sort']);_0x135219['where']=qs['filters'](_['pick'](_0x51fdf7[_0x41ac('0x3f')],_0x1b5563['filters']));if(_0x51fdf7[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x135219[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x135219[_0x41ac('0x3e')],{'$or':_[_0x41ac('0xc2')](_0x135219['attributes'],function(_0x32424e){var _0xbe429f={};_0xbe429f[_0x32424e]={'$like':'%'+_0x51fdf7[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0xbe429f;})});}_0x135219=_[_0x41ac('0x59')]({},_0x135219,_0x51fdf7[_0x41ac('0x5a')]);return _0xea355b[_0x41ac('0xe6')](_0x135219);}})[_0x41ac('0x29')](function(_0x8c8c6c){if(_0x8c8c6c){_0x38197d=_0x8c8c6c[_0x41ac('0x58')];if(!_0x51fdf7[_0x41ac('0x3f')][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x135219['limit']=qs['limit'](_0x51fdf7[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x135219[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x51fdf7[_0x41ac('0x3f')][_0x41ac('0x24')]);}return _0xea355b[_0x41ac('0xe6')](_0x135219);}})['then'](function(_0x359688){if(_0x359688){return _0x359688?{'count':_0x38197d,'rows':_0x359688}:null;}})[_0x41ac('0x29')](respondWithResult(_0x5ae608,null))[_0x41ac('0x1d')](handleError(_0x5ae608,null));};exports[_0x41ac('0xe8')]=function(_0x347852,_0x376694){var _0x3e7653={};var _0x1d7369={};var _0x1fcb53;var _0x111de2;return db[_0x41ac('0x38')]['findOne']({'where':{'id':_0x347852[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x376694,null))[_0x41ac('0x29')](function(_0x539692){if(_0x539692){_0x1fcb53=_0x539692;_0x1d7369['model']=_['keys'](db[_0x41ac('0xe9')]['rawAttributes']);_0x1d7369[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x347852[_0x41ac('0x3f')]);_0x1d7369['filters']=_['intersection'](_0x1d7369['model'],_0x1d7369['query']);_0x3e7653[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x1d7369['model'],qs[_0x41ac('0x57')](_0x347852[_0x41ac('0x3f')]['fields']));_0x3e7653[_0x41ac('0x45')]=_0x3e7653['attributes'][_0x41ac('0x58')]?_0x3e7653[_0x41ac('0x45')]:_0x1d7369[_0x41ac('0x51')];_0x3e7653[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x347852['query']['sort']);_0x3e7653[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x347852[_0x41ac('0x3f')],_0x1d7369[_0x41ac('0xd0')]));if(_0x347852[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x3e7653[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x3e7653[_0x41ac('0x3e')],{'$or':_['map'](_0x3e7653[_0x41ac('0x45')],function(_0x56d66a){var _0x19d512={};_0x19d512[_0x56d66a]={'$like':'%'+_0x347852[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0x19d512;})});}_0x3e7653=_[_0x41ac('0x59')]({},_0x3e7653,_0x347852[_0x41ac('0x5a')]);return _0x1fcb53['getOpenchannelInteractions'](_0x3e7653);}})[_0x41ac('0x29')](function(_0x486a13){if(_0x486a13){_0x111de2=_0x486a13[_0x41ac('0x58')];if(!_0x347852[_0x41ac('0x3f')]['hasOwnProperty'](_0x41ac('0xd9'))){_0x3e7653[_0x41ac('0x23')]=qs['limit'](_0x347852[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x3e7653[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x347852[_0x41ac('0x3f')][_0x41ac('0x24')]);}return _0x1fcb53[_0x41ac('0xe8')](_0x3e7653);}})[_0x41ac('0x29')](function(_0x3b559e){if(_0x3b559e){return _0x3b559e?{'count':_0x111de2,'rows':_0x3b559e}:null;}})[_0x41ac('0x29')](respondWithResult(_0x376694,null))[_0x41ac('0x1d')](handleError(_0x376694,null));};exports[_0x41ac('0xea')]=function(_0x1c6e72,_0x1807aa){var _0x5bca1b={'raw':!![],'where':{}};var _0x1a57a5={};var _0x5e417f={'count':0x0,'rows':[]};return db['User'][_0x41ac('0x9a')]({'where':{'id':_0x1c6e72[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x1807aa,null))['then'](function(_0x23b5bf){if(_0x23b5bf){_0x1a57a5[_0x41ac('0x51')]=_[_0x41ac('0x53')](db['MailInteraction']['rawAttributes']);_0x1a57a5[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x1c6e72['query']);_0x1a57a5[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x1a57a5[_0x41ac('0x51')],_0x1a57a5['query']);_0x5bca1b[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x1a57a5[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x1c6e72[_0x41ac('0x3f')]['fields']));_0x5bca1b[_0x41ac('0x45')]=_0x5bca1b['attributes']['length']?_0x5bca1b[_0x41ac('0x45')]:_0x1a57a5[_0x41ac('0x51')];if(!_0x1c6e72['query'][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x5bca1b[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x1c6e72[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x5bca1b[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x1c6e72[_0x41ac('0x3f')][_0x41ac('0x24')]);}_0x5bca1b[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x1c6e72[_0x41ac('0x3f')][_0x41ac('0xd2')]);_0x5bca1b[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x1c6e72[_0x41ac('0x3f')],_0x1a57a5[_0x41ac('0xd0')]));_0x5bca1b[_0x41ac('0x3e')][_0x41ac('0xe4')]=_0x23b5bf['id'];if(_0x1c6e72[_0x41ac('0x3f')]['filter']){_0x5bca1b['where']=_[_0x41ac('0x59')](_0x5bca1b[_0x41ac('0x3e')],{'$or':_[_0x41ac('0xc2')](_0x5bca1b['attributes'],function(_0x42a5a2){var _0x5dc55e={};_0x5dc55e[_0x42a5a2]={'$like':'%'+_0x1c6e72[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0x5dc55e;})});}_0x5bca1b=_[_0x41ac('0x59')]({},_0x5bca1b,_0x1c6e72['options']);return db['MailInteraction']['count']({'where':_0x5bca1b['where']})[_0x41ac('0x29')](function(_0x328595){_0x5e417f[_0x41ac('0x25')]=_0x328595;if(_0x1c6e72['query'][_0x41ac('0x40')]){_0x5bca1b[_0x41ac('0x43')]=[{'all':!![]}];}return db['MailInteraction'][_0x41ac('0x8d')](_0x5bca1b);})['then'](function(_0x5eb0d6){_0x5e417f[_0x41ac('0x47')]=_0x5eb0d6;return _0x5e417f;});}})[_0x41ac('0x29')](respondWithFilteredResult(_0x1807aa,_0x5bca1b))[_0x41ac('0x1d')](handleError(_0x1807aa,null));};exports[_0x41ac('0xeb')]=function(_0x26a2e1,_0x2a1afd){var _0x4c6a23={};var _0x86f86b={};var _0x275593;var _0x59aa15;return db['User'][_0x41ac('0x9a')]({'where':{'id':_0x26a2e1[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x2a1afd,null))[_0x41ac('0x29')](function(_0x4a122b){if(_0x4a122b){_0x275593=_0x4a122b;_0x86f86b[_0x41ac('0x51')]=_[_0x41ac('0x53')](db['SmsInteraction'][_0x41ac('0x54')]);_0x86f86b['query']=_[_0x41ac('0x53')](_0x26a2e1[_0x41ac('0x3f')]);_0x86f86b[_0x41ac('0xd0')]=_['intersection'](_0x86f86b[_0x41ac('0x51')],_0x86f86b['query']);_0x4c6a23[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x86f86b[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x26a2e1[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x4c6a23['attributes']=_0x4c6a23[_0x41ac('0x45')]['length']?_0x4c6a23['attributes']:_0x86f86b[_0x41ac('0x51')];_0x4c6a23[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x26a2e1[_0x41ac('0x3f')]['sort']);_0x4c6a23['where']=qs[_0x41ac('0xd0')](_['pick'](_0x26a2e1['query'],_0x86f86b[_0x41ac('0xd0')]));if(_0x26a2e1[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x4c6a23[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x4c6a23['where'],{'$or':_[_0x41ac('0xc2')](_0x4c6a23['attributes'],function(_0x36cb7f){var _0x3b7381={};_0x3b7381[_0x36cb7f]={'$like':'%'+_0x26a2e1[_0x41ac('0x3f')]['filter']+'%'};return _0x3b7381;})});}_0x4c6a23=_[_0x41ac('0x59')]({},_0x4c6a23,_0x26a2e1[_0x41ac('0x5a')]);return _0x275593['getSmsInteractions'](_0x4c6a23);}})['then'](function(_0xe00cc3){if(_0xe00cc3){_0x59aa15=_0xe00cc3[_0x41ac('0x58')];if(!_0x26a2e1['query'][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x4c6a23[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x26a2e1['query'][_0x41ac('0x23')]);_0x4c6a23['offset']=qs[_0x41ac('0x24')](_0x26a2e1[_0x41ac('0x3f')][_0x41ac('0x24')]);}return _0x275593[_0x41ac('0xeb')](_0x4c6a23);}})[_0x41ac('0x29')](function(_0x2a717b){if(_0x2a717b){return _0x2a717b?{'count':_0x59aa15,'rows':_0x2a717b}:null;}})[_0x41ac('0x29')](respondWithResult(_0x2a1afd,null))[_0x41ac('0x1d')](handleError(_0x2a1afd,null));};exports[_0x41ac('0xec')]=function(_0x378a93,_0x2829dc){var _0x323d3f={};var _0x204439={};var _0x5ee9cf;var _0x4fed68;return db[_0x41ac('0x38')]['findOne']({'where':{'id':_0x378a93[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x2829dc,null))[_0x41ac('0x29')](function(_0x207c3c){if(_0x207c3c){_0x5ee9cf=_0x207c3c;_0x204439[_0x41ac('0x51')]=_[_0x41ac('0x53')](db['FaxInteraction'][_0x41ac('0x54')]);_0x204439[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x378a93[_0x41ac('0x3f')]);_0x204439['filters']=_['intersection'](_0x204439[_0x41ac('0x51')],_0x204439[_0x41ac('0x3f')]);_0x323d3f[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x204439[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x378a93[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x323d3f[_0x41ac('0x45')]=_0x323d3f[_0x41ac('0x45')][_0x41ac('0x58')]?_0x323d3f[_0x41ac('0x45')]:_0x204439[_0x41ac('0x51')];_0x323d3f[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x378a93[_0x41ac('0x3f')][_0x41ac('0xd2')]);_0x323d3f[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x378a93['query'],_0x204439[_0x41ac('0xd0')]));if(_0x378a93['query'][_0x41ac('0x30')]){_0x323d3f[_0x41ac('0x3e')]=_['merge'](_0x323d3f[_0x41ac('0x3e')],{'$or':_[_0x41ac('0xc2')](_0x323d3f[_0x41ac('0x45')],function(_0x3af750){var _0x1f51e5={};_0x1f51e5[_0x3af750]={'$like':'%'+_0x378a93[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0x1f51e5;})});}_0x323d3f=_[_0x41ac('0x59')]({},_0x323d3f,_0x378a93[_0x41ac('0x5a')]);return _0x5ee9cf[_0x41ac('0xec')](_0x323d3f);}})[_0x41ac('0x29')](function(_0x5d331c){if(_0x5d331c){_0x4fed68=_0x5d331c['length'];if(!_0x378a93['query'][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x323d3f[_0x41ac('0x23')]=qs['limit'](_0x378a93[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x323d3f[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x378a93[_0x41ac('0x3f')][_0x41ac('0x24')]);}return _0x5ee9cf[_0x41ac('0xec')](_0x323d3f);}})[_0x41ac('0x29')](function(_0x8478f5){if(_0x8478f5){return _0x8478f5?{'count':_0x4fed68,'rows':_0x8478f5}:null;}})[_0x41ac('0x29')](respondWithResult(_0x2829dc,null))[_0x41ac('0x1d')](handleError(_0x2829dc,null));};exports[_0x41ac('0xed')]=function(_0x8285ae,_0x3b3853){var _0x2daac6={};var _0xc9f720={};var _0x4c8743;var _0x5de237;return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x8285ae[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x3b3853,null))[_0x41ac('0x29')](function(_0x37d520){if(_0x37d520){_0x4c8743=_0x37d520;_0xc9f720[_0x41ac('0x51')]=_['keys'](db[_0x41ac('0xee')][_0x41ac('0x54')]);_0xc9f720['query']=_[_0x41ac('0x53')](_0x8285ae[_0x41ac('0x3f')]);_0xc9f720[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0xc9f720[_0x41ac('0x51')],_0xc9f720[_0x41ac('0x3f')]);_0x2daac6[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0xc9f720[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x8285ae[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x2daac6[_0x41ac('0x45')]=_0x2daac6[_0x41ac('0x45')][_0x41ac('0x58')]?_0x2daac6[_0x41ac('0x45')]:_0xc9f720[_0x41ac('0x51')];_0x2daac6[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x8285ae['query'][_0x41ac('0xd2')]);_0x2daac6['where']=qs['filters'](_['pick'](_0x8285ae[_0x41ac('0x3f')],_0xc9f720[_0x41ac('0xd0')]));if(_0x8285ae[_0x41ac('0x3f')]['filter']){_0x2daac6['where']=_[_0x41ac('0x59')](_0x2daac6[_0x41ac('0x3e')],{'$or':_[_0x41ac('0xc2')](_0x2daac6[_0x41ac('0x45')],function(_0x28fafd){var _0xc07988={};_0xc07988[_0x28fafd]={'$like':'%'+_0x8285ae[_0x41ac('0x3f')]['filter']+'%'};return _0xc07988;})});}_0x2daac6=_[_0x41ac('0x59')]({},_0x2daac6,_0x8285ae[_0x41ac('0x5a')]);return _0x4c8743[_0x41ac('0xed')](_0x2daac6);}})[_0x41ac('0x29')](function(_0x796b26){if(_0x796b26){_0x5de237=_0x796b26[_0x41ac('0x58')];if(!_0x8285ae[_0x41ac('0x3f')][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x2daac6[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x8285ae[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x2daac6[_0x41ac('0x24')]=qs['offset'](_0x8285ae[_0x41ac('0x3f')]['offset']);}return _0x4c8743[_0x41ac('0xed')](_0x2daac6);}})[_0x41ac('0x29')](function(_0x5dda93){if(_0x5dda93){return _0x5dda93?{'count':_0x5de237,'rows':_0x5dda93}:null;}})[_0x41ac('0x29')](respondWithResult(_0x3b3853,null))[_0x41ac('0x1d')](handleError(_0x3b3853,null));};exports[_0x41ac('0xef')]=function(_0x21da6d,_0x4f4db2,_0x3026b0){var _0x56bc20;var _0x3725d4;var _0xd9a9;var _0x3c2849=!_[_0x41ac('0x68')](_0x21da6d[_0x41ac('0x50')]['id'])?_0x21da6d['params']['id']:!_[_0x41ac('0x68')](_0x21da6d[_0x41ac('0x2f')]['id'])?_0x21da6d['user']['id']:null;return db[_0x41ac('0x38')]['find']({'where':{'id':_0x3c2849,'role':{'$or':[_0x41ac('0x2d'),_0x41ac('0x2f'),_0x41ac('0x71')]}},'attributes':['id',_0x41ac('0x33'),_0x41ac('0xf0'),_0x41ac('0xf1'),'role','internal','loginInPause']})['then'](function(_0x3f835b){if(_0x3f835b){if(_0x3f835b[_0x41ac('0x2c')]==='agent'){_0x56bc20=_0x3f835b;if(_0x21da6d[_0x41ac('0x5d')]['interface']){_0xd9a9=util[_0x41ac('0xb1')](_0x41ac('0xf2'),_0x56bc20[_0x21da6d[_0x41ac('0x5d')][_0x41ac('0xa6')]]);}else if(_0x21da6d[_0x41ac('0x5d')][_0x41ac('0xf3')]){_0xd9a9=util['format']('SIP/%s',_0x21da6d[_0x41ac('0x5d')][_0x41ac('0xf3')]);}else{_0xd9a9=util[_0x41ac('0xb1')](_0x41ac('0xf4'),_0x56bc20['name']);}socket['to'](util[_0x41ac('0xb1')]('user:%s',_0x56bc20[_0x41ac('0x33')]))[_0x41ac('0xaf')](_0x41ac('0xf5'),{'user':{'id':_0x56bc20['id'],'name':_0x56bc20[_0x41ac('0x33')]},'ip':_0x21da6d['headers'][_0x41ac('0xf6')]||_0x21da6d[_0x41ac('0xf7')][_0x41ac('0xf8')]||_0x21da6d[_0x41ac('0xf9')][_0x41ac('0xf8')]||_0x21da6d[_0x41ac('0xf7')][_0x41ac('0xf9')][_0x41ac('0xf8')]});return db['UserVoiceQueueRt'][_0x41ac('0x2a')]({'where':{'membername':_0x56bc20[_0x41ac('0x33')]},'individualHooks':!![]});}}else{throw new db[(_0x41ac('0x92'))][(_0x41ac('0x96'))](_0x41ac('0xfa'));}})[_0x41ac('0x29')](function(){if(_0x56bc20){return _0x56bc20[_0x41ac('0xfb')]({'raw':!![]});}})[_0x41ac('0x29')](function(_0x180a5d){if(_0x56bc20){var _0x23634a=[];if(_0x180a5d){_0x3725d4=_0x180a5d;if(_0x3725d4[_0x41ac('0x58')]){for(var _0x3c53ba=0x0;_0x3c53ba<_0x3725d4[_0x41ac('0x58')];_0x3c53ba++){_0x23634a['push']({'membername':_0x56bc20['name'],'UserId':_0x56bc20['id'],'queue_name':_0x3725d4[_0x3c53ba][_0x41ac('0x33')],'VoiceQueueId':_0x3725d4[_0x3c53ba]['id'],'interface':_0xd9a9,'paused':_0x56bc20[_0x41ac('0xa4')]||![],'penalty':_0x3725d4[_0x3c53ba][_0x41ac('0xfc')]||0x0});}return BPromise[_0x41ac('0x8b')](_0x23634a,function(_0x55f3c1){return db[_0x41ac('0xde')][_0x41ac('0xb2')](_0x55f3c1);});}}}})['then'](function(){if(_0x56bc20){return db[_0x41ac('0xfd')][_0x41ac('0x8d')]({'where':{'membername':_0x56bc20[_0x41ac('0x33')],'exitAt':null}});}})[_0x41ac('0x29')](function(_0x3bf1ff){if(_0x56bc20){var _0x1ab725=[];_0x3bf1ff['forEach'](function(_0x8356d1){_0x1ab725['push'](_0x8356d1[_0x41ac('0x28')]({'exitAt':moment()['format'](_0x41ac('0xfe'))}));});return BPromise[_0x41ac('0x4e')](_0x1ab725);}})['then'](function(){if(_0x56bc20){var _0x50c309=[];var _0x2e805e=[];var _0x42b992=utils['getChannels']();var _0x3dcac3={'membername':_0x56bc20['name'],'interface':_0xd9a9,'enterAt':moment()['format'](_0x41ac('0xfe')),'role':_0x56bc20[_0x41ac('0x2c')],'internal':_0x56bc20['internal']};_0x42b992['forEach'](function(_0x6bd176){_0x50c309[_0x41ac('0x46')](_['merge']({'channel':_0x6bd176,'type':_0x41ac('0xff'),'data1':_0x21da6d['body']['device'],'data2':_0xd9a9},_0x3dcac3));if(_0x56bc20[_0x41ac('0xa4')]){_0x2e805e['push'](_[_0x41ac('0x59')]({'channel':_0x6bd176,'type':'PAUSE','data1':_0x41ac('0x100')},_0x3dcac3));}});return db[_0x41ac('0xfd')][_0x41ac('0x86')](_0x50c309[_0x41ac('0xcd')](_0x2e805e),{'individualHooks':!![]});}})['then'](function(){if(_0x56bc20){return _0x56bc20[_0x41ac('0x28')]({'online':!![],'lastLoginAt':moment()[_0x41ac('0xb1')](_0x41ac('0xfe')),'voicePause':_0x56bc20[_0x41ac('0xa4')]||![],'mailPause':_0x56bc20[_0x41ac('0xa4')]||![],'chatPause':_0x56bc20[_0x41ac('0xa4')]||![],'faxPause':_0x56bc20[_0x41ac('0xa4')]||![],'smsPause':_0x56bc20[_0x41ac('0xa4')]||![],'openchannelPause':_0x56bc20[_0x41ac('0xa4')]||![],'whatsappPause':_0x56bc20[_0x41ac('0xa4')]||![],'pauseType':_0x56bc20[_0x41ac('0xa4')]?_0x41ac('0x100'):null,'interface':_0xd9a9,'lastPauseAt':moment()[_0x41ac('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x41ac('0x29')](function(_0x16e1e6){if(_0x21da6d[_0x41ac('0x101')]){return _0x3026b0();}else{return BPromise[_0x41ac('0x102')](_0x16e1e6)[_0x41ac('0x29')](respondWithResult(_0x4f4db2,null));}})[_0x41ac('0x1d')](handleError(_0x4f4db2,null));};exports[_0x41ac('0x103')]=function(_0x19020b,_0x5b94d0){var _0x151c30;return db[_0x41ac('0x38')][_0x41ac('0x5b')]({'where':{'id':_0x19020b[_0x41ac('0x50')]['id'],'role':_0x41ac('0x71')},'attributes':['id',_0x41ac('0x33'),_0x41ac('0x2c')]})[_0x41ac('0x29')](handleEntityNotFound(_0x5b94d0,null))[_0x41ac('0x29')](function(_0x34d9e2){if(_0x34d9e2){_0x151c30=_0x34d9e2;return db[_0x41ac('0xde')][_0x41ac('0x2a')]({'where':{'membername':_0x151c30[_0x41ac('0x33')]},'individualHooks':!![]});}})[_0x41ac('0x29')](function(){return db[_0x41ac('0xfd')][_0x41ac('0x8d')]({'where':{'membername':_0x151c30['name'],'exitAt':null}});})[_0x41ac('0x29')](function(_0x355bfe){var _0x4c4216=[];_0x355bfe[_0x41ac('0x104')](function(_0x115711){_0x4c4216['push'](_0x115711[_0x41ac('0x28')]({'exitAt':moment()[_0x41ac('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x41ac('0x4e')](_0x4c4216);})[_0x41ac('0x29')](function(){return _0x151c30[_0x41ac('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x41ac('0x29')](respondWithResult(_0x5b94d0,null))[_0x41ac('0x1d')](handleError(_0x5b94d0,null));};exports[_0x41ac('0x105')]=function(_0xb3dd52,_0x39277a){var _0x8890a7;return db[_0x41ac('0xde')][_0x41ac('0x28')]({'paused':0x1},{'where':{'UserId':_0xb3dd52['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0x41ac('0x38')][_0x41ac('0x5b')]({'where':{'id':_0xb3dd52[_0x41ac('0x50')]['id'],'role':_0x41ac('0x71')},'attributes':['id','name','role',_0x41ac('0x62'),_0x41ac('0xa6')]});})[_0x41ac('0x29')](handleEntityNotFound(_0x39277a,null))[_0x41ac('0x29')](function(_0x330257){if(_0x330257){_0x8890a7=_0x330257;return respondWithRpcPromise('QueuePause','pause',{'id':_0x8890a7['id'],'name':_0x8890a7[_0x41ac('0x33')],'pause':!![]});}})['then'](function(){if(_0x8890a7){return db['MemberReport']['findAll']({'where':{'membername':_0x8890a7[_0x41ac('0x33')],'type':'PAUSE','exitAt':null}});}})[_0x41ac('0x29')](function(_0x5e06bc){if(_0x5e06bc[_0x41ac('0x58')]){var _0x542a2c=moment()[_0x41ac('0xb1')](_0x41ac('0xfe'));for(var _0x21ab5c=0x0,_0x4976a4=_0x5e06bc[_0x41ac('0x58')];_0x21ab5c<_0x4976a4;_0x21ab5c++){_0x5e06bc[_0x21ab5c][_0x41ac('0x106')]({'exitAt':_0x542a2c});}}})[_0x41ac('0x29')](function(){var _0x4d8716=[];var _0xf8bc8b=utils['getChannels']();_0xf8bc8b[_0x41ac('0x104')](function(_0x2b9344){_0x4d8716[_0x41ac('0x46')]({'channel':_0x2b9344,'membername':_0x8890a7[_0x41ac('0x33')],'interface':_[_0x41ac('0x68')](_0x8890a7[_0x41ac('0xa6')])?util[_0x41ac('0xb1')]('SIP/%s',_0x8890a7[_0x41ac('0x33')]):_0x8890a7[_0x41ac('0xa6')],'type':_0x41ac('0x107'),'enterAt':moment()[_0x41ac('0xb1')](_0x41ac('0xfe')),'data1':_0xb3dd52[_0x41ac('0x5d')][_0x41ac('0x3a')]||_0x41ac('0x108'),'role':_0x8890a7[_0x41ac('0x2c')],'internal':_0x8890a7[_0x41ac('0x62')]});});return db[_0x41ac('0xfd')][_0x41ac('0x86')](_0x4d8716,{'individualHooks':!![]});})[_0x41ac('0x29')](function(){return _0x8890a7['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0xb3dd52['body'][_0x41ac('0x3a')]||_0x41ac('0x108'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x41ac('0x29')](respondWithResult(_0x39277a,null))[_0x41ac('0x1d')](handleError(_0x39277a,null));};exports[_0x41ac('0x109')]=function(_0x5b8c4b,_0x1f8fab){var _0x1da890;return db[_0x41ac('0x38')][_0x41ac('0x5b')]({'where':{'id':_0x5b8c4b['params']['id']},'attributes':['id',_0x41ac('0x33'),_0x41ac('0x2c'),'voicePause',_0x41ac('0x10a'),_0x41ac('0x10b'),_0x41ac('0x10c'),_0x41ac('0x10d'),'smsPause',_0x41ac('0x10e'),_0x41ac('0x10f'),_0x41ac('0x110')]})['then'](handleEntityNotFound(_0x1f8fab,null))[_0x41ac('0x29')](function(_0x3e3146){if(_0x3e3146){_0x1da890=_0x3e3146;if(_0x5b8c4b[_0x41ac('0x5d')]['channel']&&!utils[_0x41ac('0xa7')](_0x5b8c4b[_0x41ac('0x5d')][_0x41ac('0xa2')])){throw new db[(_0x41ac('0x92'))][(_0x41ac('0x96'))]('Unknown\x20channel');}switch(_0x5b8c4b['body'][_0x41ac('0xa2')]){case'voice':return respondWithRpcPromise('QueuePause',_0x41ac('0x109'),{'id':_0x1da890['id'],'name':_0x1da890[_0x41ac('0x33')],'pause':![]})[_0x41ac('0x29')](function(){return db[_0x41ac('0xde')]['update']({'paused':0x0},{'where':{'UserId':_0x1da890['id']},'individualHooks':!![]});})[_0x41ac('0x29')](function(){return db[_0x41ac('0xfd')][_0x41ac('0x5b')]({'where':{'channel':_0x5b8c4b[_0x41ac('0x5d')][_0x41ac('0xa2')],'membername':_0x1da890[_0x41ac('0x33')],'type':'PAUSE','exitAt':null}});})[_0x41ac('0x29')](function(_0x4affaa){if(_0x4affaa){return _0x4affaa['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x41ac('0x111')},{'individualHooks':!![]});}return null;})[_0x41ac('0x29')](function(){return _0x1da890[_0x41ac('0x28')]({'voicePause':![]});});case _0x41ac('0x5c'):case _0x41ac('0x49'):case _0x41ac('0x112'):case _0x41ac('0x4b'):case'whatsapp':case _0x41ac('0x4c'):return db['MemberReport'][_0x41ac('0x5b')]({'where':{'channel':_0x5b8c4b[_0x41ac('0x5d')][_0x41ac('0xa2')],'membername':_0x1da890[_0x41ac('0x33')],'type':'PAUSE','exitAt':null}})[_0x41ac('0x29')](function(_0xb76397){if(_0xb76397){return _0xb76397['update']({'exitAt':moment()[_0x41ac('0xb1')](_0x41ac('0xfe')),'data2':_0x41ac('0x111')},{'individualHooks':!![]});}return null;})[_0x41ac('0x29')](function(){var _0x43e175={};_[_0x41ac('0x26')](_0x43e175,util[_0x41ac('0xb1')](_0x41ac('0x113'),_0x5b8c4b['body'][_0x41ac('0xa2')],'Pause'),![]);return _0x1da890['update'](_0x43e175);});default:return respondWithRpcPromise(_0x41ac('0x114'),_0x41ac('0x109'),{'id':_0x1da890['id'],'name':_0x1da890['name'],'pause':![]})[_0x41ac('0x29')](function(){return db[_0x41ac('0xde')]['update']({'paused':0x0},{'where':{'UserId':_0x1da890['id']}});})[_0x41ac('0x29')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x1da890[_0x41ac('0x33')],'type':_0x41ac('0x107'),'exitAt':null}});})['then'](function(_0x51da18){var _0x46e3fa=[];_0x51da18[_0x41ac('0x104')](function(_0xa002e8){_0x46e3fa['push'](_0xa002e8[_0x41ac('0x28')]({'exitAt':moment()[_0x41ac('0xb1')](_0x41ac('0xfe')),'data2':_0x41ac('0x111')}));});return BPromise[_0x41ac('0x4e')](_0x46e3fa);})[_0x41ac('0x29')](function(){return _0x1da890['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x41ac('0x29')](respondWithResult(_0x1f8fab,null))['catch'](handleError(_0x1f8fab,null));};exports[_0x41ac('0x115')]=function(_0x27f3c9,_0x3fd2c4){var _0x23c0ff={};var _0x2cb6e6={};var _0x2afdd2;var _0x33337f;return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x27f3c9['params']['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x3fd2c4,null))[_0x41ac('0x29')](function(_0x4d6c2c){if(_0x4d6c2c){_0x2afdd2=_0x4d6c2c;_0x2cb6e6['model']=_['keys'](db[_0x41ac('0x116')][_0x41ac('0x54')]);_0x2cb6e6[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x27f3c9[_0x41ac('0x3f')]);_0x2cb6e6[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x2cb6e6[_0x41ac('0x51')],_0x2cb6e6[_0x41ac('0x3f')]);_0x23c0ff[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x2cb6e6['model'],qs[_0x41ac('0x57')](_0x27f3c9[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x23c0ff[_0x41ac('0x45')]=_0x23c0ff[_0x41ac('0x45')][_0x41ac('0x58')]?_0x23c0ff[_0x41ac('0x45')]:_0x2cb6e6[_0x41ac('0x51')];_0x23c0ff[_0x41ac('0xd1')]=qs['sort'](_0x27f3c9[_0x41ac('0x3f')][_0x41ac('0xd2')]);_0x23c0ff[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x27f3c9['query'],_0x2cb6e6[_0x41ac('0xd0')]));if(_0x27f3c9[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x23c0ff['where']=_[_0x41ac('0x59')](_0x23c0ff[_0x41ac('0x3e')],{'$or':_[_0x41ac('0xc2')](_0x23c0ff[_0x41ac('0x45')],function(_0x57cc82){var _0x2b0212={};_0x2b0212[_0x57cc82]={'$like':'%'+_0x27f3c9[_0x41ac('0x3f')]['filter']+'%'};return _0x2b0212;})});}_0x23c0ff=_['merge']({},_0x23c0ff,_0x27f3c9[_0x41ac('0x5a')]);return _0x2afdd2[_0x41ac('0x115')](_0x23c0ff);}})[_0x41ac('0x29')](function(_0x1aa370){if(_0x1aa370){_0x33337f=_0x1aa370['length'];if(!_0x27f3c9[_0x41ac('0x3f')][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x23c0ff[_0x41ac('0x23')]=qs['limit'](_0x27f3c9[_0x41ac('0x3f')]['limit']);_0x23c0ff[_0x41ac('0x24')]=qs[_0x41ac('0x24')](_0x27f3c9[_0x41ac('0x3f')]['offset']);}return _0x2afdd2['getTeams'](_0x23c0ff);}})[_0x41ac('0x29')](function(_0x51c868){if(_0x51c868){return _0x51c868?{'count':_0x33337f,'rows':_0x51c868}:null;}})['then'](respondWithResult(_0x3fd2c4,null))[_0x41ac('0x1d')](handleError(_0x3fd2c4,null));};exports[_0x41ac('0x117')]=function(_0x1b6a55,_0x1e969c){return db[_0x41ac('0x38')]['find']({'where':{'id':_0x1b6a55['params']['id']}})['then'](handleEntityNotFound(_0x1e969c,null))['then'](function(_0x140de5){if(_0x140de5){var _0x36944e=_0x140de5[_0x41ac('0x2b')]({'plain':!![]});return _0x140de5[_0x41ac('0x117')](_0x1b6a55[_0x41ac('0x5d')][_0x41ac('0x60')],_['omit'](_0x1b6a55[_0x41ac('0x5d')],[_0x41ac('0x60'),'id'])||{})[_0x41ac('0x29')](function(){for(var _0x26208a=0x0;_0x26208a<_0x1b6a55[_0x41ac('0x5d')][_0x41ac('0x60')][_0x41ac('0x58')];_0x26208a++){var _0xbd8a65=[];var _0x203728={};db[_0x41ac('0x116')][_0x41ac('0x9a')]({'where':{'id':_0x1b6a55[_0x41ac('0x5d')][_0x41ac('0x60')][_0x26208a]}})[_0x41ac('0x29')](function(_0x9159a4){_0x203728=_0x9159a4[_0x41ac('0x4a')];_0xbd8a65[_0x41ac('0x46')](_0x9159a4[_0x41ac('0xfb')]()[_0x41ac('0x29')](function(_0x3e79a8){for(var _0x59851d=0x0;_0x59851d<_0x3e79a8[_0x41ac('0x58')];_0x59851d++){_0x3e79a8[_0x59851d][_0x41ac('0x118')](_0x41ac('0xa2'),_0x41ac('0x119'));}return _0x3e79a8;}));_0xbd8a65[_0x41ac('0x46')](_0x9159a4[_0x41ac('0x11a')]()[_0x41ac('0x29')](function(_0x546c63){for(var _0x5ba563=0x0;_0x5ba563<_0x546c63[_0x41ac('0x58')];_0x5ba563++){_0x546c63[_0x5ba563][_0x41ac('0x118')](_0x41ac('0xa2'),_0x41ac('0x11b'));}return _0x546c63;}));_0xbd8a65[_0x41ac('0x46')](_0x9159a4[_0x41ac('0x11c')]()[_0x41ac('0x29')](function(_0x39e813){for(var _0x330c34=0x0;_0x330c34<_0x39e813[_0x41ac('0x58')];_0x330c34++){_0x39e813[_0x330c34]['setDataValue']('channel',_0x41ac('0x11d'));}return _0x39e813;}));_0xbd8a65['push'](_0x9159a4['getSmsQueues']()[_0x41ac('0x29')](function(_0x3a6c37){for(var _0x5190c1=0x0;_0x5190c1<_0x3a6c37['length'];_0x5190c1++){_0x3a6c37[_0x5190c1][_0x41ac('0x118')](_0x41ac('0xa2'),_0x41ac('0x11e'));}return _0x3a6c37;}));_0xbd8a65[_0x41ac('0x46')](_0x9159a4[_0x41ac('0x11f')]()[_0x41ac('0x29')](function(_0xdbe0e0){for(var _0x187f4d=0x0;_0x187f4d<_0xdbe0e0['length'];_0x187f4d++){_0xdbe0e0[_0x187f4d][_0x41ac('0x118')](_0x41ac('0xa2'),_0x41ac('0x120'));}return _0xdbe0e0;}));_0xbd8a65[_0x41ac('0x46')](_0x9159a4[_0x41ac('0x121')]()[_0x41ac('0x29')](function(_0x45e808){for(var _0x3ad8fd=0x0;_0x3ad8fd<_0x45e808[_0x41ac('0x58')];_0x3ad8fd++){_0x45e808[_0x3ad8fd][_0x41ac('0x118')](_0x41ac('0xa2'),_0x41ac('0x122'));}return _0x45e808;}));_0xbd8a65[_0x41ac('0x46')](_0x9159a4['getOpenchannelQueues']()[_0x41ac('0x29')](function(_0x365ea2){for(var _0x3a99cb=0x0;_0x3a99cb<_0x365ea2[_0x41ac('0x58')];_0x3a99cb++){_0x365ea2[_0x3a99cb][_0x41ac('0x118')]('channel',_0x41ac('0x123'));}return _0x365ea2;}));return BPromise['all'](_0xbd8a65);})[_0x41ac('0x29')](function(_0x455b6f){var _0x239f6f=_[_0x41ac('0x124')](_0x455b6f);_0xbd8a65=[];return db[_0x41ac('0x69')][_0x41ac('0x125')](function(_0x44b6bc){for(var _0xf4995e=0x0;_0xf4995e<_0x239f6f[_0x41ac('0x58')];_0xf4995e++){_0xbd8a65[_0x41ac('0x46')](_0x239f6f[_0xf4995e][_0x41ac('0x126')](_0x36944e['id']),{'transaction':_0x44b6bc});}return BPromise[_0x41ac('0x4e')](_0xbd8a65)['then'](function(){if(_0x36944e[_0x41ac('0xa3')]){return BPromise['each'](_[_0x41ac('0x30')](_0x239f6f,function(_0x27599e){return _0x27599e['getDataValue'](_0x41ac('0xa2'))==='Voice';}),function(_0x2f71d3){return db['UserVoiceQueueRt']['upsert']({'membername':_0x36944e[_0x41ac('0x33')],'UserId':_0x36944e['id'],'queue_name':_0x2f71d3[_0x41ac('0x33')],'VoiceQueueId':_0x2f71d3['id'],'interface':_['isNil'](_0x36944e['interface'])?util[_0x41ac('0xb1')](_0x41ac('0xf4'),_0x36944e[_0x41ac('0x33')]):_0x36944e['interface'],'paused':_0x36944e[_0x41ac('0xa5')]||![],'penalty':_0x36944e['penalty']},{'transaction':_0x44b6bc});});}else{return;}})['then'](function(){for(var _0x56d0dd=0x0;_0x56d0dd<_0x239f6f['length'];_0x56d0dd++){var _0x388884=_0x239f6f[_0x56d0dd]['getDataValue'](_0x41ac('0xa2'));var _0x4ec6b4=_0x388884+_0x41ac('0xae');socket[_0x41ac('0xaf')]('user'+_0x388884+'Queue:save',{'UserId':_0x36944e['id'],['queueField']:_0x239f6f[_0x56d0dd]['id']});}});});})[_0x41ac('0x29')](function(){db[_0x41ac('0x127')][_0x41ac('0x9a')]({'where':{'teamId':_0x203728['id']}})[_0x41ac('0x29')](function(_0x4525a9){if(_0x4525a9){db[_0x41ac('0x128')][_0x41ac('0x82')]({'UserId':_0x1b6a55[_0x41ac('0x50')]['id'],'VoicePrefixId':_0x4525a9[_0x41ac('0x129')]});}});});}});}})['then'](respondWithStatusCode(_0x1e969c,null))['catch'](handleError(_0x1e969c,null));};exports[_0x41ac('0x12a')]=function(_0x3915c9,_0x596a91){return db[_0x41ac('0x38')][_0x41ac('0x9a')]({'where':{'id':_0x3915c9[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x596a91,null))[_0x41ac('0x29')](function(_0x4f8ff0){if(_0x4f8ff0){var _0x4ebfcc=_0x4f8ff0[_0x41ac('0x2b')]({'plain':!![]});var _0x5e3dcb=_0x3915c9[_0x41ac('0x3f')][_0x41ac('0x60')];return _0x4f8ff0[_0x41ac('0x12a')](_0x5e3dcb)[_0x41ac('0x29')](function(){for(var _0x320520=0x0;_0x320520<_0x5e3dcb['length'];_0x320520++){var _0x4460c7=[];var _0x316c3b={};db[_0x41ac('0x116')]['findOne']({'where':{'id':_0x5e3dcb[_0x320520]}})['then'](function(_0x1f2cc7){_0x316c3b=_0x1f2cc7['dataValues'];_0x4460c7['push'](_0x1f2cc7[_0x41ac('0xfb')]()[_0x41ac('0x29')](function(_0xb5d5cc){for(var _0x25edb=0x0;_0x25edb<_0xb5d5cc[_0x41ac('0x58')];_0x25edb++){_0xb5d5cc[_0x25edb]['setDataValue'](_0x41ac('0xa2'),'Voice');}return _0xb5d5cc;}));_0x4460c7[_0x41ac('0x46')](_0x1f2cc7[_0x41ac('0x11a')]()['then'](function(_0x459f2f){for(var _0x22b2b4=0x0;_0x22b2b4<_0x459f2f['length'];_0x22b2b4++){_0x459f2f[_0x22b2b4]['setDataValue'](_0x41ac('0xa2'),_0x41ac('0x11b'));}return _0x459f2f;}));_0x4460c7['push'](_0x1f2cc7[_0x41ac('0x11c')]()['then'](function(_0x5c701b){for(var _0x368043=0x0;_0x368043<_0x5c701b['length'];_0x368043++){_0x5c701b[_0x368043]['setDataValue'](_0x41ac('0xa2'),'Mail');}return _0x5c701b;}));_0x4460c7[_0x41ac('0x46')](_0x1f2cc7['getSmsQueues']()[_0x41ac('0x29')](function(_0x339f0e){for(var _0x3565c6=0x0;_0x3565c6<_0x339f0e[_0x41ac('0x58')];_0x3565c6++){_0x339f0e[_0x3565c6][_0x41ac('0x118')](_0x41ac('0xa2'),'Sms');}return _0x339f0e;}));_0x4460c7['push'](_0x1f2cc7[_0x41ac('0x11f')]()[_0x41ac('0x29')](function(_0x177ee9){for(var _0x43b60a=0x0;_0x43b60a<_0x177ee9[_0x41ac('0x58')];_0x43b60a++){_0x177ee9[_0x43b60a]['setDataValue'](_0x41ac('0xa2'),_0x41ac('0x120'));}return _0x177ee9;}));_0x4460c7[_0x41ac('0x46')](_0x1f2cc7['getFaxQueues']()[_0x41ac('0x29')](function(_0x5c82cc){for(var _0x1402d5=0x0;_0x1402d5<_0x5c82cc[_0x41ac('0x58')];_0x1402d5++){_0x5c82cc[_0x1402d5][_0x41ac('0x118')](_0x41ac('0xa2'),_0x41ac('0x122'));}return _0x5c82cc;}));_0x4460c7[_0x41ac('0x46')](_0x1f2cc7['getOpenchannelQueues']()[_0x41ac('0x29')](function(_0x62e6f2){for(var _0x134d0b=0x0;_0x134d0b<_0x62e6f2[_0x41ac('0x58')];_0x134d0b++){_0x62e6f2[_0x134d0b][_0x41ac('0x118')]('channel','Openchannel');}return _0x62e6f2;}));return BPromise[_0x41ac('0x4e')](_0x4460c7);})[_0x41ac('0x29')](function(_0x442aa1){var _0x3cef36=_[_0x41ac('0x124')](_0x442aa1);_0x4460c7=[];return db['sequelize']['transaction'](function(_0x1619be){for(var _0x4caf21=0x0;_0x4caf21<_0x3cef36['length'];_0x4caf21++){_0x4460c7[_0x41ac('0x46')](_0x3cef36[_0x4caf21][_0x41ac('0x12b')](_0x4ebfcc['id']),{'transaction':_0x1619be});}return BPromise[_0x41ac('0x4e')](_0x4460c7)[_0x41ac('0x29')](function(){if(_0x4ebfcc[_0x41ac('0xa3')]){return BPromise[_0x41ac('0x8b')](_[_0x41ac('0x30')](_0x3cef36,function(_0x2b8327){return _0x2b8327[_0x41ac('0x12c')](_0x41ac('0xa2'))===_0x41ac('0x119');}),function(_0x3fcd40){return db[_0x41ac('0xde')]['destroy']({'where':{'VoiceQueueId':_0x3fcd40['id'],'UserId':_0x4ebfcc['id']},'transaction':_0x1619be});});}else{return;}})['then'](function(){db[_0x41ac('0x127')]['findOne']({'where':{'teamId':_0x316c3b['id']}})[_0x41ac('0x29')](function(_0x3ba7d9){if(_0x3ba7d9){return db[_0x41ac('0x128')]['destroy']({'where':{'UserId':_0x4ebfcc['id'],'VoicePrefixId':_0x3ba7d9['dataValues'][_0x41ac('0x129')]}});}});})[_0x41ac('0x29')](function(){for(var _0x2fc6a4=0x0;_0x2fc6a4<_0x3cef36[_0x41ac('0x58')];_0x2fc6a4++){var _0x3ba9eb=_0x3cef36[_0x2fc6a4][_0x41ac('0x12c')](_0x41ac('0xa2'));var _0x387bf4=_0x3ba9eb+_0x41ac('0xae');socket[_0x41ac('0xaf')](_0x41ac('0x2f')+_0x3ba9eb+_0x41ac('0xb7'),{'UserId':_0x4ebfcc['id'],['queueField']:_0x3cef36[_0x2fc6a4]['id']});}});});});}});}})[_0x41ac('0x29')](respondWithStatusCode(_0x596a91,null))[_0x41ac('0x1d')](handleError(_0x596a91,null));};exports[_0x41ac('0x12d')]=function(_0x2280f0,_0x43c79d){var _0x3cf7bb={};var _0x2d9fe7={};var _0x1a111a;var _0x1e5b40;return db['User'][_0x41ac('0x9a')]({'where':{'id':_0x2280f0[_0x41ac('0x50')]['id']}})['then'](handleEntityNotFound(_0x43c79d,null))[_0x41ac('0x29')](function(_0x23b3e7){if(_0x23b3e7){_0x1a111a=_0x23b3e7;_0x2d9fe7[_0x41ac('0x51')]=_[_0x41ac('0x53')](db['CmList']['rawAttributes']);_0x2d9fe7[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x2280f0['query']);_0x2d9fe7[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x2d9fe7['model'],_0x2d9fe7[_0x41ac('0x3f')]);_0x3cf7bb[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x2d9fe7[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x2280f0[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x3cf7bb['attributes']=_0x3cf7bb[_0x41ac('0x45')][_0x41ac('0x58')]?_0x3cf7bb[_0x41ac('0x45')]:_0x2d9fe7['model'];_0x3cf7bb[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x2280f0[_0x41ac('0x3f')]['sort']);_0x3cf7bb[_0x41ac('0x3e')]=qs[_0x41ac('0xd0')](_[_0x41ac('0xd3')](_0x2280f0[_0x41ac('0x3f')],_0x2d9fe7['filters']));if(_0x2280f0[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x3cf7bb[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x3cf7bb['where'],{'$or':_[_0x41ac('0xc2')](_0x3cf7bb[_0x41ac('0x45')],function(_0x35794c){var _0x537ae7={};_0x537ae7[_0x35794c]={'$like':'%'+_0x2280f0[_0x41ac('0x3f')][_0x41ac('0x30')]+'%'};return _0x537ae7;})});}_0x3cf7bb=_[_0x41ac('0x59')]({},_0x3cf7bb,_0x2280f0['options']);return _0x1a111a[_0x41ac('0x12d')](_0x3cf7bb);}})[_0x41ac('0x29')](function(_0x2e7273){if(_0x2e7273){_0x1e5b40=_0x2e7273[_0x41ac('0x58')];if(!_0x2280f0[_0x41ac('0x3f')][_0x41ac('0xdd')](_0x41ac('0xd9'))){_0x3cf7bb[_0x41ac('0x23')]=qs[_0x41ac('0x23')](_0x2280f0[_0x41ac('0x3f')][_0x41ac('0x23')]);_0x3cf7bb[_0x41ac('0x24')]=qs['offset'](_0x2280f0['query'][_0x41ac('0x24')]);}return _0x1a111a[_0x41ac('0x12d')](_0x3cf7bb);}})[_0x41ac('0x29')](function(_0x2043d7){if(_0x2043d7){return _0x2043d7?{'count':_0x1e5b40,'rows':_0x2043d7}:null;}})[_0x41ac('0x29')](respondWithResult(_0x43c79d,null))[_0x41ac('0x1d')](handleError(_0x43c79d,null));};exports['getAgents']=function(_0x368acc,_0x2b787a){var _0x570e5b={};var _0x1907af={};var _0xfa97f7;return db['User'][_0x41ac('0x9a')]({'where':{'id':_0x368acc[_0x41ac('0x50')]['id']}})[_0x41ac('0x29')](handleEntityNotFound(_0x2b787a,null))[_0x41ac('0x29')](function(_0x4728b4){if(_0x4728b4){_0xfa97f7=_0x4728b4;_0x1907af[_0x41ac('0x51')]=_['keys'](db[_0x41ac('0x38')][_0x41ac('0x54')]);_0x1907af[_0x41ac('0x3f')]=_[_0x41ac('0x53')](_0x368acc['query']);_0x1907af[_0x41ac('0xd0')]=_[_0x41ac('0x56')](_0x1907af['model'],_0x1907af[_0x41ac('0x3f')]);_0x570e5b[_0x41ac('0x45')]=_[_0x41ac('0x56')](_0x1907af[_0x41ac('0x51')],qs[_0x41ac('0x57')](_0x368acc[_0x41ac('0x3f')][_0x41ac('0x57')]));_0x570e5b[_0x41ac('0x45')]=_0x570e5b[_0x41ac('0x45')][_0x41ac('0x58')]?_0x570e5b[_0x41ac('0x45')]:_0x1907af[_0x41ac('0x51')];_0x570e5b[_0x41ac('0xd1')]=qs[_0x41ac('0xd2')](_0x368acc[_0x41ac('0x3f')][_0x41ac('0xd2')]);_0x570e5b[_0x41ac('0x3e')]=qs['filters'](_['pick'](_0x368acc[_0x41ac('0x3f')],_0x1907af[_0x41ac('0xd0')]));if(_0x368acc[_0x41ac('0x3f')][_0x41ac('0x30')]){_0x570e5b[_0x41ac('0x3e')]=_[_0x41ac('0x59')](_0x570e5b['where'],{'$or':_['map'](_0x570e5b['attributes'],function(_0x26b5e0){var _0x34ec61={};_0x34ec61[_0x26b5e0]={'$like':'%'+_0x368acc[_0x41ac('0x3f')]['filter']+'%'};return _0x34ec61;})});}_0x570e5b[_0x41ac('0x51')]=db[_0x41ac('0x38')];_0x570e5b['as']=_0x41ac('0x8e');_0x570e5b=_[_0x41ac('0x59')]({},_0x570e5b,_0x368acc['options']);return _0xfa97f7[_0x41ac('0xfb')]({'include':[_0x570e5b]});}})[_0x41ac('0x29')](function(_0x4882ea){if(_0x4882ea){var _0x5f3d1b={},_0x50645e=[];for(var _0x5a79d5=0x0;_0x5a79d5<_0x4882ea['length'];_0x5a79d5+=0x1){for(var _0x20a983=0x0,_0x42c34d;_0x20a983<_0x4882ea[_0x5a79d5]['Agents']['length'];_0x20a983+=0x1){_0x42c34d=_0x4882ea[_0x5a79d5][_0x41ac('0x8e')][_0x20a983]['get']({'plain':!![]});_0x5f3d1b[_0x42c34d['id']]=_0x42c34d;}}_0x5f3d1b=_[_0x41ac('0x12e')](_0x5f3d1b);for(var _0x395e9f=qs[_0x41ac('0x24')](_0x368acc[_0x41ac('0x3f')][_0x41ac('0x24')]);_0x395e9f<_0x5f3d1b[_0x41ac('0x58')]&&_0x50645e[_0x41ac('0x58')]=_0x247ea0[_0x6d7b('0x4e')]){throw new Error(_0x6d7b('0x4f'));}})[_0x6d7b('0x24')](function(){if(_0x1b1bd2){return db['UserVoiceQueueRt'][_0x6d7b('0x50')]({'where':{'membername':_0x1b1bd2[_0x6d7b('0x27')]},'individualHooks':!![]});}})[_0x6d7b('0x24')](function(){if(_0x1b1bd2){return _0x1b1bd2[_0x6d7b('0x51')]({'raw':!![]});}})['then'](function(_0x305ce0){if(_0x1b1bd2){if(_0x305ce0){var _0x128b1d=[];_0x450b84=_0x305ce0;if(_0x450b84[_0x6d7b('0x2e')]){for(var _0x98be65=0x0;_0x98be65<_0x450b84[_0x6d7b('0x2e')];_0x98be65++){_0x128b1d[_0x6d7b('0x45')](db[_0x6d7b('0x2b')][_0x6d7b('0x52')]({'membername':_0x1b1bd2[_0x6d7b('0x27')],'UserId':_0x1b1bd2['id'],'queue_name':_0x450b84[_0x98be65][_0x6d7b('0x27')],'VoiceQueueId':_0x450b84[_0x98be65]['id'],'interface':_0xf9127a,'paused':_0x1b1bd2[_0x6d7b('0x49')]||![],'penalty':_0x450b84[_0x98be65][_0x6d7b('0x53')]||0x0}));}return BPromise[_0x6d7b('0x46')](_0x128b1d);}}}})[_0x6d7b('0x24')](function(){if(_0x1b1bd2){return db[_0x6d7b('0x2d')]['findAll']({'where':{'membername':_0x1b1bd2[_0x6d7b('0x27')],'exitAt':null}});}})['then'](function(_0x1657c6){if(_0x1b1bd2){if(_0x1657c6&&_0x1657c6['length']){var _0x508bae=[];_0x1657c6['forEach'](function(_0x2557c6){_0x508bae['push'](_0x2557c6[_0x6d7b('0x2c')]({'exitAt':moment()[_0x6d7b('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6d7b('0x46')](_0x508bae);}}})[_0x6d7b('0x24')](function(_0x46cfbd){if(_0x1b1bd2){var _0x3b42f4=[];var _0x29e39f=[];var _0x5254d2=utils[_0x6d7b('0x32')]();var _0x5dd5c5={'membername':_0x1b1bd2['name'],'interface':_0xf9127a,'enterAt':moment()[_0x6d7b('0x2f')](_0x6d7b('0x30')),'role':_0x1b1bd2[_0x6d7b('0x28')],'internal':_0x1b1bd2[_0x6d7b('0x29')]};_0x5254d2[_0x6d7b('0x33')](function(_0x5aafea){_0x3b42f4[_0x6d7b('0x45')](_[_0x6d7b('0x54')]({'channel':_0x5aafea,'type':'LOGIN','data1':'callysquare','data2':_0xf9127a},_0x5dd5c5));if(_0x1b1bd2[_0x6d7b('0x49')]){_0x29e39f[_0x6d7b('0x45')](_[_0x6d7b('0x54')]({'channel':_0x5aafea,'type':_0x6d7b('0x3d'),'data1':'LOGININPAUSE'},_0x5dd5c5));}});return db[_0x6d7b('0x2d')][_0x6d7b('0x37')](_0x3b42f4['concat'](_0x29e39f),{'individualHooks':!![]});}})[_0x6d7b('0x24')](function(){if(_0x1b1bd2){return _0x1b1bd2[_0x6d7b('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x6d7b('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x1b1bd2[_0x6d7b('0x49')]||![],'mailPause':_0x1b1bd2[_0x6d7b('0x49')]||![],'chatPause':_0x1b1bd2['loginInPause']||![],'faxPause':_0x1b1bd2['loginInPause']||![],'smsPause':_0x1b1bd2[_0x6d7b('0x49')]||![],'openchannelPause':_0x1b1bd2['loginInPause']||![],'pauseType':_0x1b1bd2['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x6d7b('0x30')),'interface':_0xf9127a});}})[_0x6d7b('0x24')](function(_0x23d192){_0x4315b5(_0x23d192);})['catch'](function(_0x259825){_0x19151a(_0x32a1f5[_0x6d7b('0x14')](0x1f4,_0x259825[_0x6d7b('0x15')]));});});}; \ No newline at end of file +var _0x2b01=['openchannel','Pause','push','all','LogoutUser','findOne','destroy','mobile','phone','loginInPause','count','../../config/license/util','getLicense','agents','getVoiceQueues','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./user.socket','request','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetUser','User','findAll','options','raw','where','limit','include','map','model','attributes','info','debug','ShowUser','PauseUser','find','name','role','internal','interface','update','MemberReport','PAUSE','length','format','updateAttributes','getChannels','forEach','isNil','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','channel','Unknown\x20channel','UserVoiceQueueRt','system','mail','fax','sms'];(function(_0x3867f2,_0xa4c19){var _0x5c9bfe=function(_0x40115a){while(--_0x40115a){_0x3867f2['push'](_0x3867f2['shift']());}};_0x5c9bfe(++_0xa4c19);}(_0x2b01,0x174));var _0x12b0=function(_0x57a08b,_0x9b0cf5){_0x57a08b=_0x57a08b-0x0;var _0x1fe694=_0x2b01[_0x57a08b];return _0x1fe694;};'use strict';var _=require(_0x12b0('0x0'));var util=require('util');var moment=require(_0x12b0('0x1'));var BPromise=require(_0x12b0('0x2'));var rs=require(_0x12b0('0x3'));var fs=require('fs');var Redis=require(_0x12b0('0x4'));var db=require(_0x12b0('0x5'))['db'];var utils=require(_0x12b0('0x6'));var logger=require(_0x12b0('0x7'))(_0x12b0('0x8'));var config=require(_0x12b0('0x9'));var jayson=require(_0x12b0('0xa'));var client=jayson[_0x12b0('0xb')][_0x12b0('0xc')]({'port':0x232a});config['redis']=_[_0x12b0('0xd')](config[_0x12b0('0xe')],{'host':_0x12b0('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12b0('0xe')]));require(_0x12b0('0x10'))['register'](socket);function respondWithRpcPromise(_0x3e0d20,_0x38db7e,_0x591f84){return new BPromise(function(_0x4fa194,_0x9b877f){return client[_0x12b0('0x11')](_0x3e0d20,_0x591f84)[_0x12b0('0x12')](function(_0x4998c4){logger['info'](_0x12b0('0x13'),_0x38db7e,_0x12b0('0x14'));logger['debug'](_0x12b0('0x15'),_0x38db7e,_0x12b0('0x14'),JSON[_0x12b0('0x16')](_0x4998c4));if(_0x4998c4[_0x12b0('0x17')]){if(_0x4998c4[_0x12b0('0x17')][_0x12b0('0x18')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x38db7e,_0x4998c4[_0x12b0('0x17')][_0x12b0('0x19')]);return _0x9b877f(_0x4998c4[_0x12b0('0x17')][_0x12b0('0x19')]);}logger[_0x12b0('0x17')]('User,\x20%s,\x20%s',_0x38db7e,_0x4998c4[_0x12b0('0x17')]['message']);return _0x4fa194(_0x4998c4[_0x12b0('0x17')]['message']);}else{logger['info'](_0x12b0('0x13'),_0x38db7e,_0x12b0('0x14'));_0x4fa194(_0x4998c4['result'][_0x12b0('0x19')]);}})[_0x12b0('0x1a')](function(_0x4ef7db){logger['error'](_0x12b0('0x13'),_0x38db7e,_0x4ef7db);_0x9b877f(_0x4ef7db);});});}exports[_0x12b0('0x1b')]=function(_0x4026f3){var _0x50984b=this;return new Promise(function(_0xbf22a3,_0x77d3e3){return db[_0x12b0('0x1c')][_0x12b0('0x1d')]({'raw':_0x4026f3[_0x12b0('0x1e')]?_0x4026f3[_0x12b0('0x1e')][_0x12b0('0x1f')]===undefined?!![]:![]:!![],'where':_0x4026f3[_0x12b0('0x1e')]?_0x4026f3['options'][_0x12b0('0x20')]||null:null,'attributes':_0x4026f3[_0x12b0('0x1e')]?_0x4026f3[_0x12b0('0x1e')]['attributes']||null:null,'limit':_0x4026f3[_0x12b0('0x1e')]?_0x4026f3[_0x12b0('0x1e')][_0x12b0('0x21')]||null:null,'include':_0x4026f3[_0x12b0('0x1e')]?_0x4026f3[_0x12b0('0x1e')][_0x12b0('0x22')]?_[_0x12b0('0x23')](_0x4026f3[_0x12b0('0x1e')][_0x12b0('0x22')],function(_0x445c28){return{'model':db[_0x445c28[_0x12b0('0x24')]],'as':_0x445c28['as'],'attributes':_0x445c28[_0x12b0('0x25')],'include':_0x445c28[_0x12b0('0x22')]?_[_0x12b0('0x23')](_0x445c28[_0x12b0('0x22')],function(_0x135637){return{'model':db[_0x135637[_0x12b0('0x24')]],'as':_0x135637['as'],'attributes':_0x135637[_0x12b0('0x25')],'include':_0x135637[_0x12b0('0x22')]?_[_0x12b0('0x23')](_0x135637[_0x12b0('0x22')],function(_0x2d5225){return{'model':db[_0x2d5225[_0x12b0('0x24')]],'as':_0x2d5225['as'],'attributes':_0x2d5225['attributes']};}):[]};}):[]};}):[]:[]})[_0x12b0('0x12')](function(_0x5a361d){logger[_0x12b0('0x26')](_0x12b0('0x1b'),_0x4026f3);logger[_0x12b0('0x27')](_0x12b0('0x1b'),_0x4026f3,JSON['stringify'](_0x5a361d));_0xbf22a3(_0x5a361d);})['catch'](function(_0x27fdbb){logger[_0x12b0('0x17')](_0x12b0('0x1b'),_0x27fdbb['message'],_0x4026f3);_0x77d3e3(_0x50984b['error'](0x1f4,_0x27fdbb['message']));});});};exports[_0x12b0('0x28')]=function(_0x199cf4){var _0x5cc80d=this;return new Promise(function(_0x2356b4,_0x54ee5f){return db[_0x12b0('0x1c')]['find']({'raw':_0x199cf4[_0x12b0('0x1e')]?_0x199cf4[_0x12b0('0x1e')][_0x12b0('0x1f')]===undefined?!![]:![]:!![],'where':_0x199cf4[_0x12b0('0x1e')]?_0x199cf4[_0x12b0('0x1e')][_0x12b0('0x20')]||null:null,'attributes':_0x199cf4[_0x12b0('0x1e')]?_0x199cf4[_0x12b0('0x1e')][_0x12b0('0x25')]||null:null,'include':_0x199cf4['options']?_0x199cf4[_0x12b0('0x1e')]['include']?_[_0x12b0('0x23')](_0x199cf4[_0x12b0('0x1e')][_0x12b0('0x22')],function(_0x57da64){return{'model':db[_0x57da64['model']],'as':_0x57da64['as'],'attributes':_0x57da64[_0x12b0('0x25')],'include':_0x57da64['include']?_['map'](_0x57da64[_0x12b0('0x22')],function(_0x5846b5){return{'model':db[_0x5846b5[_0x12b0('0x24')]],'as':_0x5846b5['as'],'attributes':_0x5846b5['attributes'],'include':_0x5846b5['include']?_[_0x12b0('0x23')](_0x5846b5[_0x12b0('0x22')],function(_0x12466b){return{'model':db[_0x12466b[_0x12b0('0x24')]],'as':_0x12466b['as'],'attributes':_0x12466b[_0x12b0('0x25')]};}):[]};}):[]};}):[]:[]})[_0x12b0('0x12')](function(_0x39ced9){logger[_0x12b0('0x26')](_0x12b0('0x28'),_0x199cf4);logger[_0x12b0('0x27')](_0x12b0('0x28'),_0x199cf4,JSON[_0x12b0('0x16')](_0x39ced9));_0x2356b4(_0x39ced9);})[_0x12b0('0x1a')](function(_0x41244d){logger[_0x12b0('0x17')](_0x12b0('0x28'),_0x41244d[_0x12b0('0x19')],_0x199cf4);_0x54ee5f(_0x5cc80d[_0x12b0('0x17')](0x1f4,_0x41244d[_0x12b0('0x19')]));});});};exports[_0x12b0('0x29')]=function(_0xdcadde){var _0x688a0e=this;return new Promise(function(_0x549ebc,_0x4ea047){var _0x422623;return db['User'][_0x12b0('0x2a')]({'where':_0xdcadde[_0x12b0('0x1e')]['where']||{},'attributes':['id',_0x12b0('0x2b'),_0x12b0('0x2c'),_0x12b0('0x2d'),_0x12b0('0x2e')]})[_0x12b0('0x12')](function(_0x3e6579){if(_0x3e6579){_0x422623=_0x3e6579;return db['UserVoiceQueueRt'][_0x12b0('0x2f')]({'paused':0x1},{'where':{'UserId':_0x422623['id']},'individualHooks':!![]});}})['then'](function(){if(_0x422623){return db[_0x12b0('0x30')][_0x12b0('0x1d')]({'where':{'membername':_0x422623[_0x12b0('0x2b')],'type':_0x12b0('0x31'),'exitAt':null}});}})['then'](function(_0x294f8c){if(_0x422623){if(_0x294f8c&&_0x294f8c[_0x12b0('0x32')]){var _0x381e0f=moment()[_0x12b0('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x213a1a=0x0,_0x3e7be8=_0x294f8c[_0x12b0('0x32')];_0x213a1a<_0x3e7be8;_0x213a1a++){_0x294f8c[_0x213a1a][_0x12b0('0x34')]({'exitAt':_0x381e0f});}}}})['then'](function(){if(_0x422623){var _0x48462b=[];var _0x4c323a=utils[_0x12b0('0x35')]();_0x4c323a[_0x12b0('0x36')](function(_0x5268cd){_0x48462b['push']({'channel':_0x5268cd,'membername':_0x422623['name'],'interface':_[_0x12b0('0x37')](_0x422623[_0x12b0('0x2e')])?util[_0x12b0('0x33')](_0x12b0('0x38'),_0x422623[_0x12b0('0x2b')]):_0x422623[_0x12b0('0x2e')],'type':'PAUSE','enterAt':moment()[_0x12b0('0x33')](_0x12b0('0x39')),'data1':_0xdcadde[_0x12b0('0x3a')][_0x12b0('0x3b')]||_0x12b0('0x3c'),'role':_0x422623[_0x12b0('0x2c')],'internal':_0x422623['internal'],'uniqueid':_0xdcadde[_0x12b0('0x3a')]['uniqueid']||null});});return db[_0x12b0('0x30')]['bulkCreate'](_0x48462b,{'individualHooks':!![]});}})[_0x12b0('0x12')](function(){if(_0x422623){return _0x422623[_0x12b0('0x2f')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xdcadde[_0x12b0('0x3a')][_0x12b0('0x3b')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x12b0('0x33')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x12b0('0x12')](function(_0x9d656d){_0x549ebc(_0x9d656d);})[_0x12b0('0x1a')](function(_0x3daf82){_0x4ea047(_0x688a0e[_0x12b0('0x17')](0x1f4,_0x3daf82[_0x12b0('0x19')]));});});};exports['UnpauseUser']=function(_0xe66c80){var _0xbd33b3=this;return new Promise(function(_0x2dc220,_0x209381){var _0x3cbf2a;return db[_0x12b0('0x1c')]['findOne']({'where':_0xe66c80[_0x12b0('0x1e')][_0x12b0('0x20')]||{},'attributes':['id',_0x12b0('0x2b')]})[_0x12b0('0x12')](function(_0x2a17cd){if(_0x2a17cd){_0x3cbf2a=_0x2a17cd;if(_0xe66c80[_0x12b0('0x3a')][_0x12b0('0x3d')]&&!utils['isValidChannel'](_0xe66c80[_0x12b0('0x3a')]['channel'])){throw new Error(_0x12b0('0x3e'));}switch(_0xe66c80[_0x12b0('0x3a')][_0x12b0('0x3d')]){case'voice':return db[_0x12b0('0x3f')][_0x12b0('0x2f')]({'paused':0x0},{'where':{'UserId':_0x3cbf2a['id']}})[_0x12b0('0x12')](function(){return db[_0x12b0('0x30')][_0x12b0('0x2a')]({'where':{'channel':_0xe66c80[_0x12b0('0x3a')][_0x12b0('0x3d')],'membername':_0x3cbf2a[_0x12b0('0x2b')],'type':'PAUSE','exitAt':null}});})[_0x12b0('0x12')](function(_0x4be158){if(_0x4be158){return _0x4be158[_0x12b0('0x2f')]({'exitAt':moment()['format'](_0x12b0('0x39')),'data2':_0x12b0('0x40')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3cbf2a[_0x12b0('0x2f')]({'voicePause':![]});});case _0x12b0('0x41'):case'chat':case _0x12b0('0x42'):case _0x12b0('0x43'):case _0x12b0('0x44'):case'whatsapp':return db['MemberReport'][_0x12b0('0x2a')]({'where':{'channel':_0xe66c80[_0x12b0('0x3a')][_0x12b0('0x3d')],'membername':_0x3cbf2a[_0x12b0('0x2b')],'type':'PAUSE','exitAt':null}})[_0x12b0('0x12')](function(_0x41a314){return _0x41a314['update']({'exitAt':moment()['format'](_0x12b0('0x39')),'data2':_0x12b0('0x40')},{'individualHooks':!![]});})[_0x12b0('0x12')](function(){var _0xd761ba={};_['set'](_0xd761ba,util[_0x12b0('0x33')]('%s%s',_0xe66c80[_0x12b0('0x3a')][_0x12b0('0x3d')],_0x12b0('0x45')),![]);return _0x3cbf2a[_0x12b0('0x2f')](_0xd761ba);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x3cbf2a['id']}})[_0x12b0('0x12')](function(){return db[_0x12b0('0x30')][_0x12b0('0x1d')]({'where':{'membername':_0x3cbf2a[_0x12b0('0x2b')],'type':_0x12b0('0x31'),'exitAt':null}});})[_0x12b0('0x12')](function(_0x2510af){var _0x31789d=[];_0x2510af['forEach'](function(_0x2f8b6f){_0x31789d[_0x12b0('0x46')](_0x2f8b6f['update']({'exitAt':moment()[_0x12b0('0x33')](_0x12b0('0x39')),'data2':_0x12b0('0x40')}));});return BPromise[_0x12b0('0x47')](_0x31789d);})[_0x12b0('0x12')](function(){return _0x3cbf2a[_0x12b0('0x2f')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x12b0('0x12')](function(_0x3c3555){_0x2dc220(_0x3c3555);})[_0x12b0('0x1a')](function(_0xf315ce){_0x209381(_0xbd33b3[_0x12b0('0x17')](0x1f4,_0xf315ce[_0x12b0('0x19')]));});});};exports[_0x12b0('0x48')]=function(_0x1d23a5){var _0x74c42d=this;return new Promise(function(_0x1266ce,_0x525eef){var _0x183650;return db[_0x12b0('0x1c')][_0x12b0('0x49')]({'where':_0x1d23a5[_0x12b0('0x1e')][_0x12b0('0x20')]||{},'attributes':['id','name']})['then'](function(_0x20273a){if(_0x20273a){_0x183650=_0x20273a;return db[_0x12b0('0x3f')][_0x12b0('0x4a')]({'where':{'membername':_0x183650[_0x12b0('0x2b')]},'individualHooks':!![]});}})[_0x12b0('0x12')](function(){if(_0x183650){return db[_0x12b0('0x30')][_0x12b0('0x1d')]({'where':{'membername':_0x183650[_0x12b0('0x2b')],'exitAt':null}});}})[_0x12b0('0x12')](function(_0x3a420a){if(_0x183650){if(_0x3a420a&&_0x3a420a[_0x12b0('0x32')]){var _0x2ffeaa=[];_0x3a420a[_0x12b0('0x36')](function(_0x593c7b){_0x2ffeaa[_0x12b0('0x46')](_0x593c7b['update']({'exitAt':moment()[_0x12b0('0x33')](_0x12b0('0x39'))}));});return BPromise[_0x12b0('0x47')](_0x2ffeaa);}}})[_0x12b0('0x12')](function(){if(_0x183650){return _0x183650[_0x12b0('0x2f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x4f04a0){_0x1266ce(_0x4f04a0);})[_0x12b0('0x1a')](function(_0x53354d){_0x525eef(_0x74c42d[_0x12b0('0x17')](0x1f4,_0x53354d[_0x12b0('0x19')]));});});};exports['LoginUser']=function(_0x50166d){var _0x35668e=this;return new Promise(function(_0x455810,_0x30086d){var _0x240a31;var _0x2322b1;var _0x1f419d;var _0x11bc78;return db[_0x12b0('0x1c')][_0x12b0('0x49')]({'where':_0x50166d[_0x12b0('0x1e')][_0x12b0('0x20')]||{},'attributes':['id',_0x12b0('0x2b'),'role',_0x12b0('0x4b'),_0x12b0('0x4c'),_0x12b0('0x2d'),_0x12b0('0x4d'),'interface']})[_0x12b0('0x12')](function(_0x346311){if(_0x346311){_0x240a31=_0x346311;_0x11bc78=_0x50166d['body'][_0x12b0('0x2e')]?_0x50166d[_0x12b0('0x3a')][_0x12b0('0x2e')]:util[_0x12b0('0x33')]('SIP/%s',_0x240a31[_0x12b0('0x2b')]);return db['User'][_0x12b0('0x4e')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x240a31['id']}}});}})['then'](function(_0x129d97){if(_0x129d97){_0x1f419d=_0x129d97;return require(_0x12b0('0x4f'))[_0x12b0('0x50')]();}})[_0x12b0('0x12')](function(_0x48da57){if(_0x48da57&&_0x48da57[_0x12b0('0x51')]&&_0x1f419d>=_0x48da57[_0x12b0('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x12b0('0x12')](function(){if(_0x240a31){return db[_0x12b0('0x3f')][_0x12b0('0x4a')]({'where':{'membername':_0x240a31['name']},'individualHooks':!![]});}})['then'](function(){if(_0x240a31){return _0x240a31[_0x12b0('0x52')]({'raw':!![]});}})[_0x12b0('0x12')](function(_0x4f6662){if(_0x240a31){if(_0x4f6662){var _0x3bc715=[];_0x2322b1=_0x4f6662;if(_0x2322b1[_0x12b0('0x32')]){for(var _0xaca9a4=0x0;_0xaca9a4<_0x2322b1[_0x12b0('0x32')];_0xaca9a4++){_0x3bc715[_0x12b0('0x46')](db[_0x12b0('0x3f')]['upsert']({'membername':_0x240a31[_0x12b0('0x2b')],'UserId':_0x240a31['id'],'queue_name':_0x2322b1[_0xaca9a4][_0x12b0('0x2b')],'VoiceQueueId':_0x2322b1[_0xaca9a4]['id'],'interface':_0x11bc78,'paused':_0x240a31[_0x12b0('0x4d')]||![],'penalty':_0x2322b1[_0xaca9a4]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x12b0('0x47')](_0x3bc715);}}}})['then'](function(){if(_0x240a31){return db['MemberReport'][_0x12b0('0x1d')]({'where':{'membername':_0x240a31['name'],'exitAt':null}});}})[_0x12b0('0x12')](function(_0x83a65){if(_0x240a31){if(_0x83a65&&_0x83a65[_0x12b0('0x32')]){var _0x594c0e=[];_0x83a65[_0x12b0('0x36')](function(_0x60eba3){_0x594c0e[_0x12b0('0x46')](_0x60eba3[_0x12b0('0x2f')]({'exitAt':moment()[_0x12b0('0x33')](_0x12b0('0x39'))}));});return BPromise[_0x12b0('0x47')](_0x594c0e);}}})[_0x12b0('0x12')](function(_0x36cda3){if(_0x240a31){var _0x867a55=[];var _0x5a104a=[];var _0x289266=utils[_0x12b0('0x35')]();var _0x17e9f8={'membername':_0x240a31[_0x12b0('0x2b')],'interface':_0x11bc78,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x240a31[_0x12b0('0x2c')],'internal':_0x240a31[_0x12b0('0x2d')]};_0x289266[_0x12b0('0x36')](function(_0x2235cb){_0x867a55[_0x12b0('0x46')](_[_0x12b0('0x53')]({'channel':_0x2235cb,'type':_0x12b0('0x54'),'data1':_0x12b0('0x55'),'data2':_0x11bc78},_0x17e9f8));if(_0x240a31[_0x12b0('0x4d')]){_0x5a104a[_0x12b0('0x46')](_[_0x12b0('0x53')]({'channel':_0x2235cb,'type':_0x12b0('0x31'),'data1':_0x12b0('0x56')},_0x17e9f8));}});return db['MemberReport']['bulkCreate'](_0x867a55[_0x12b0('0x57')](_0x5a104a),{'individualHooks':!![]});}})['then'](function(){if(_0x240a31){return _0x240a31[_0x12b0('0x2f')]({'online':!![],'lastLoginAt':moment()[_0x12b0('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x240a31[_0x12b0('0x4d')]||![],'mailPause':_0x240a31[_0x12b0('0x4d')]||![],'chatPause':_0x240a31[_0x12b0('0x4d')]||![],'faxPause':_0x240a31[_0x12b0('0x4d')]||![],'smsPause':_0x240a31[_0x12b0('0x4d')]||![],'openchannelPause':_0x240a31[_0x12b0('0x4d')]||![],'pauseType':_0x240a31[_0x12b0('0x4d')]?_0x12b0('0x56'):null,'lastPauseAt':moment()[_0x12b0('0x33')](_0x12b0('0x39')),'interface':_0x11bc78});}})[_0x12b0('0x12')](function(_0x3b1ee6){_0x455810(_0x3b1ee6);})[_0x12b0('0x1a')](function(_0x3e14fe){_0x30086d(_0x35668e[_0x12b0('0x17')](0x1f4,_0x3e14fe['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 959d632..a1211c3 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 _0xd97d=['user:','save','remove','update','register','length'];(function(_0x83f529,_0x3d55d7){var _0x4383b8=function(_0x6ceff1){while(--_0x6ceff1){_0x83f529['push'](_0x83f529['shift']());}};_0x4383b8(++_0x3d55d7);}(_0xd97d,0x157));var _0xdd97=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xd97d[_0x5f09c5];return _0x426ad9;};'use strict';var UserEvents=require('./user.events');var events=[_0xdd97('0x0'),_0xdd97('0x1'),_0xdd97('0x2')];function createListener(_0x482c02,_0xc475e3){return function(_0x1c9114){_0xc475e3['emit'](_0x482c02,_0x1c9114);};}function removeListener(_0x29b45a,_0x25f21d){return function(){UserEvents['removeListener'](_0x29b45a,_0x25f21d);};}exports[_0xdd97('0x3')]=function(_0x345781){for(var _0x193b50=0x0,_0x54e288=events[_0xdd97('0x4')];_0x193b50<_0x54e288;_0x193b50++){var _0x50a286=events[_0x193b50];var _0xf7ec35=createListener(_0xdd97('0x5')+_0x50a286,_0x345781);UserEvents['on'](_0x50a286,_0xf7ec35);}}; \ No newline at end of file +var _0x4e02=['remove','update','emit','removeListener','register','length','user:','save'];(function(_0x2600fc,_0x51522f){var _0x5ade65=function(_0x5065d8){while(--_0x5065d8){_0x2600fc['push'](_0x2600fc['shift']());}};_0x5ade65(++_0x51522f);}(_0x4e02,0xdf));var _0x24e0=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x4e02[_0x4709c0];return _0x13348b;};'use strict';var UserEvents=require('./user.events');var events=[_0x24e0('0x0'),_0x24e0('0x1'),_0x24e0('0x2')];function createListener(_0x1afd93,_0x5f1155){return function(_0x515d47){_0x5f1155[_0x24e0('0x3')](_0x1afd93,_0x515d47);};}function removeListener(_0x15e053,_0x96606c){return function(){UserEvents[_0x24e0('0x4')](_0x15e053,_0x96606c);};}exports[_0x24e0('0x5')]=function(_0x4c4c42){for(var _0x334c2c=0x0,_0x589414=events[_0x24e0('0x6')];_0x334c2c<_0x589414;_0x334c2c++){var _0x10c41c=events[_0x334c2c];var _0x582c30=createListener(_0x24e0('0x7')+_0x10c41c,_0x4c4c42);UserEvents['on'](_0x10c41c,_0x582c30);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 19ea8f5..ee15491 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x213475,_0x1cce90){var _0x4d9f5d=function(_0x59e254){while(--_0x59e254){_0x213475['push'](_0x213475['shift']());}};_0x4d9f5d(++_0x1cce90);}(_0xe706,0xa3));var _0x6e70=function(_0x18805f,_0x9973b){_0x18805f=_0x18805f-0x0;var _0x54edbb=_0xe706[_0x18805f];return _0x54edbb;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1e88c1,_0x295507){var _0x5e81fb=function(_0x17b298){while(--_0x17b298){_0x1e88c1['push'](_0x1e88c1['shift']());}};_0x5e81fb(++_0x295507);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index d3f87de..8b0d9dc 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 _0x2263=['exports','INTEGER','sequelize'];(function(_0x17dc77,_0x44c57e){var _0x53e00c=function(_0x356a75){while(--_0x356a75){_0x17dc77['push'](_0x17dc77['shift']());}};_0x53e00c(++_0x44c57e);}(_0x2263,0x6e));var _0x3226=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x2263[_0x5d80de];return _0x1c7556;};'use strict';var Sequelize=require(_0x3226('0x0'));module[_0x3226('0x1')]={'penalty':{'type':Sequelize[_0x3226('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1937=['exports','INTEGER'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x1937,0x10c));var _0x7193=function(_0x13e635,_0x2a514f){_0x13e635=_0x13e635-0x0;var _0x28bcd0=_0x1937[_0x13e635];return _0x28bcd0;};'use strict';var Sequelize=require('sequelize');module[_0x7193('0x0')]={'penalty':{'type':Sequelize[_0x7193('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 87bd8ff..31047bf 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 _0x621d=['./userChatQueue.attributes','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x621d,0x163));var _0xd621=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x621d[_0x35a274];return _0x40d905;};'use strict';var _=require(_0xd621('0x0'));var util=require(_0xd621('0x1'));var logger=require(_0xd621('0x2'))('api');var moment=require(_0xd621('0x3'));var BPromise=require(_0xd621('0x4'));var rp=require(_0xd621('0x5'));var fs=require('fs');var path=require(_0xd621('0x6'));var rimraf=require(_0xd621('0x7'));var config=require('../../config/environment');var attributes=require(_0xd621('0x8'));module['exports']=function(_0x1cae5f,_0x4fed23){return _0x1cae5f['define'](_0xd621('0x9'),attributes,{'tableName':_0xd621('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x59b8=['exports','define','UserChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x368c85,_0x586b0a){var _0x3477c2=function(_0x3ef6d9){while(--_0x3ef6d9){_0x368c85['push'](_0x368c85['shift']());}};_0x3477c2(++_0x586b0a);}(_0x59b8,0xc6));var _0x859b=function(_0x44f603,_0x42103c){_0x44f603=_0x44f603-0x0;var _0x4e00a3=_0x59b8[_0x44f603];return _0x4e00a3;};'use strict';var _=require(_0x859b('0x0'));var util=require(_0x859b('0x1'));var logger=require(_0x859b('0x2'))(_0x859b('0x3'));var moment=require('moment');var BPromise=require(_0x859b('0x4'));var rp=require(_0x859b('0x5'));var fs=require('fs');var path=require(_0x859b('0x6'));var rimraf=require(_0x859b('0x7'));var config=require(_0x859b('0x8'));var attributes=require(_0x859b('0x9'));module[_0x859b('0xa')]=function(_0x56ff75,_0x1ca7fa){return _0x56ff75[_0x859b('0xb')](_0x859b('0xc'),attributes,{'tableName':'user_has_chat_queues','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 3b9faa4..9c541e7 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 _0x3742=['http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','../../config/utils','rpc','../../config/environment','client'];(function(_0x39700b,_0x37d751){var _0x29ff5b=function(_0x2bda69){while(--_0x2bda69){_0x39700b['push'](_0x39700b['shift']());}};_0x29ff5b(++_0x37d751);}(_0x3742,0xad));var _0x2374=function(_0x3bca62,_0x11f9a5){_0x3bca62=_0x3bca62-0x0;var _0x392a6a=_0x3742[_0x3bca62];return _0x392a6a;};'use strict';var _=require(_0x2374('0x0'));var util=require(_0x2374('0x1'));var moment=require(_0x2374('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(_0x2374('0x3'));var logger=require('../../config/logger')(_0x2374('0x4'));var config=require(_0x2374('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x2374('0x6')][_0x2374('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2401ef,_0x23f29b,_0x41f980){return new BPromise(function(_0x25a60f,_0xd79755){return client['request'](_0x2401ef,_0x41f980)['then'](function(_0x3900cd){logger[_0x2374('0x8')](_0x2374('0x9'),_0x23f29b,_0x2374('0xa'));logger[_0x2374('0xb')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x23f29b,'request\x20sent',JSON[_0x2374('0xc')](_0x3900cd));if(_0x3900cd[_0x2374('0xd')]){if(_0x3900cd[_0x2374('0xd')][_0x2374('0xe')]===0x1f4){logger[_0x2374('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x23f29b,_0x3900cd[_0x2374('0xd')][_0x2374('0xf')]);return _0xd79755(_0x3900cd[_0x2374('0xd')]['message']);}logger[_0x2374('0xd')](_0x2374('0x9'),_0x23f29b,_0x3900cd['error'][_0x2374('0xf')]);return _0x25a60f(_0x3900cd[_0x2374('0xd')][_0x2374('0xf')]);}else{logger[_0x2374('0x8')](_0x2374('0x9'),_0x23f29b,_0x2374('0xa'));_0x25a60f(_0x3900cd[_0x2374('0x10')][_0x2374('0xf')]);}})[_0x2374('0x11')](function(_0x4dab87){logger[_0x2374('0xd')](_0x2374('0x9'),_0x23f29b,_0x4dab87);_0xd79755(_0x4dab87);});});} \ No newline at end of file +var _0x9b27=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ce0d2,_0x2ded29){var _0x337e7c=function(_0x4ed665){while(--_0x4ed665){_0x1ce0d2['push'](_0x1ce0d2['shift']());}};_0x337e7c(++_0x2ded29);}(_0x9b27,0x18a));var _0x79b2=function(_0x3a28e2,_0x58325a){_0x3a28e2=_0x3a28e2-0x0;var _0xfd325a=_0x9b27[_0x3a28e2];return _0xfd325a;};'use strict';var _=require('lodash');var util=require(_0x79b2('0x0'));var moment=require(_0x79b2('0x1'));var BPromise=require(_0x79b2('0x2'));var rs=require(_0x79b2('0x3'));var fs=require('fs');var Redis=require(_0x79b2('0x4'));var db=require(_0x79b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x79b2('0x6'));var config=require(_0x79b2('0x7'));var jayson=require(_0x79b2('0x8'));var client=jayson[_0x79b2('0x9')][_0x79b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dae9d,_0x16241d,_0x59d13c){return new BPromise(function(_0x247302,_0x5cfa51){return client[_0x79b2('0xb')](_0x3dae9d,_0x59d13c)[_0x79b2('0xc')](function(_0x4083f4){logger[_0x79b2('0xd')](_0x79b2('0xe'),_0x16241d,_0x79b2('0xf'));logger[_0x79b2('0x10')](_0x79b2('0x11'),_0x16241d,_0x79b2('0xf'),JSON[_0x79b2('0x12')](_0x4083f4));if(_0x4083f4[_0x79b2('0x13')]){if(_0x4083f4[_0x79b2('0x13')][_0x79b2('0x14')]===0x1f4){logger[_0x79b2('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x16241d,_0x4083f4[_0x79b2('0x13')][_0x79b2('0x15')]);return _0x5cfa51(_0x4083f4[_0x79b2('0x13')]['message']);}logger[_0x79b2('0x13')](_0x79b2('0xe'),_0x16241d,_0x4083f4['error'][_0x79b2('0x15')]);return _0x247302(_0x4083f4['error'][_0x79b2('0x15')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x16241d,_0x79b2('0xf'));_0x247302(_0x4083f4['result'][_0x79b2('0x15')]);}})[_0x79b2('0x16')](function(_0x36b8fe){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x16241d,_0x36b8fe);_0x5cfa51(_0x36b8fe);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9328b4d..415ba51 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1bbb21,_0x3b381d){var _0x505cbb=function(_0x47840a){while(--_0x47840a){_0x1bbb21['push'](_0x1bbb21['shift']());}};_0x505cbb(++_0x3b381d);}(_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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x14612f,_0x1c3389){var _0x3c41ad=function(_0x41043c){while(--_0x41043c){_0x14612f['push'](_0x14612f['shift']());}};_0x3c41ad(++_0x1c3389);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 27d62aa..d37637a 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 _0x7f72=['exports','INTEGER','STRING','sequelize'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7f72,0x7f));var _0x27f7=function(_0x5d4241,_0x29fba1){_0x5d4241=_0x5d4241-0x0;var _0x5c044b=_0x7f72[_0x5d4241];return _0x5c044b;};'use strict';var Sequelize=require(_0x27f7('0x0'));module[_0x27f7('0x1')]={'penalty':{'type':Sequelize[_0x27f7('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x27f7('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x27f7('0x3')]}}; \ No newline at end of file +var _0x5a5a=['STRING','sequelize','INTEGER'];(function(_0x42226e,_0x58b3ad){var _0x1040ee=function(_0x6681b8){while(--_0x6681b8){_0x42226e['push'](_0x42226e['shift']());}};_0x1040ee(++_0x58b3ad);}(_0x5a5a,0xdf));var _0xa5a5=function(_0x4ab866,_0x40e607){_0x4ab866=_0x4ab866-0x0;var _0x56047a=_0x5a5a[_0x4ab866];return _0x56047a;};'use strict';var Sequelize=require(_0xa5a5('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa5a5('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa5a5('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa5a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 6e5d354..9ccee2b 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 _0x4d56=['./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xb01cb6,_0xc6b651){var _0x5bd641=function(_0x463055){while(--_0x463055){_0xb01cb6['push'](_0xb01cb6['shift']());}};_0x5bd641(++_0xc6b651);}(_0x4d56,0x144));var _0x64d5=function(_0x3c2154,_0xe2a446){_0x3c2154=_0x3c2154-0x0;var _0x1d2907=_0x4d56[_0x3c2154];return _0x1d2907;};'use strict';var _=require('lodash');var util=require(_0x64d5('0x0'));var logger=require(_0x64d5('0x1'))(_0x64d5('0x2'));var moment=require('moment');var BPromise=require(_0x64d5('0x3'));var rp=require(_0x64d5('0x4'));var fs=require('fs');var path=require(_0x64d5('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x64d5('0x6'));module[_0x64d5('0x7')]=function(_0x48ef39,_0x73157a){return _0x48ef39['define'](_0x64d5('0x8'),attributes,{'tableName':_0x64d5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ae1=['define','user_has_fax_queues','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x8ae1,0x1e2));var _0x18ae=function(_0x28263d,_0x15227b){_0x28263d=_0x28263d-0x0;var _0x2a1807=_0x8ae1[_0x28263d];return _0x2a1807;};'use strict';var _=require(_0x18ae('0x0'));var util=require('util');var logger=require(_0x18ae('0x1'))('api');var moment=require(_0x18ae('0x2'));var BPromise=require(_0x18ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x18ae('0x4'));var rimraf=require(_0x18ae('0x5'));var config=require(_0x18ae('0x6'));var attributes=require('./userFaxQueue.attributes');module[_0x18ae('0x7')]=function(_0x298f8a,_0xae9d2b){return _0x298f8a[_0x18ae('0x8')]('UserFaxQueue',attributes,{'tableName':_0x18ae('0x9'),'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 8f86945..69c5e1c 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 _0x2dd7=['../../config/environment','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4a460f,_0x1379a1){var _0x311e8f=function(_0x15e275){while(--_0x15e275){_0x4a460f['push'](_0x4a460f['shift']());}};_0x311e8f(++_0x1379a1);}(_0x2dd7,0xf5));var _0x72dd=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0x2dd7[_0x3b5049];return _0x12454e;};'use strict';var _=require(_0x72dd('0x0'));var util=require('util');var moment=require(_0x72dd('0x1'));var BPromise=require('bluebird');var rs=require(_0x72dd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72dd('0x3'))['db'];var utils=require(_0x72dd('0x4'));var logger=require(_0x72dd('0x5'))(_0x72dd('0x6'));var config=require(_0x72dd('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x72dd('0x8')][_0x72dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x361f05,_0x1ede46,_0x26f4a4){return new BPromise(function(_0x310df5,_0x1d7cab){return client[_0x72dd('0xa')](_0x361f05,_0x26f4a4)[_0x72dd('0xb')](function(_0x2654fa){logger[_0x72dd('0xc')](_0x72dd('0xd'),_0x1ede46,_0x72dd('0xe'));logger[_0x72dd('0xf')](_0x72dd('0x10'),_0x1ede46,_0x72dd('0xe'),JSON[_0x72dd('0x11')](_0x2654fa));if(_0x2654fa[_0x72dd('0x12')]){if(_0x2654fa['error'][_0x72dd('0x13')]===0x1f4){logger[_0x72dd('0x12')](_0x72dd('0xd'),_0x1ede46,_0x2654fa[_0x72dd('0x12')]['message']);return _0x1d7cab(_0x2654fa['error'][_0x72dd('0x14')]);}logger[_0x72dd('0x12')](_0x72dd('0xd'),_0x1ede46,_0x2654fa[_0x72dd('0x12')][_0x72dd('0x14')]);return _0x310df5(_0x2654fa[_0x72dd('0x12')][_0x72dd('0x14')]);}else{logger['info'](_0x72dd('0xd'),_0x1ede46,_0x72dd('0xe'));_0x310df5(_0x2654fa['result'][_0x72dd('0x14')]);}})['catch'](function(_0x3d48c8){logger[_0x72dd('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x1ede46,_0x3d48c8);_0x1d7cab(_0x3d48c8);});});} \ No newline at end of file +var _0x488b=['info','UserFaxQueue,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x31119c,_0x420fc4){var _0x14a2cf=function(_0x264fde){while(--_0x264fde){_0x31119c['push'](_0x31119c['shift']());}};_0x14a2cf(++_0x420fc4);}(_0x488b,0x15e));var _0xb488=function(_0x1d6358,_0x346eb0){_0x1d6358=_0x1d6358-0x0;var _0x5731b3=_0x488b[_0x1d6358];return _0x5731b3;};'use strict';var _=require(_0xb488('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb488('0x1'));var rs=require(_0xb488('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb488('0x3'))['db'];var utils=require(_0xb488('0x4'));var logger=require(_0xb488('0x5'))(_0xb488('0x6'));var config=require(_0xb488('0x7'));var jayson=require(_0xb488('0x8'));var client=jayson[_0xb488('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a154,_0x37e50b,_0x42f5d4){return new BPromise(function(_0x532443,_0x1c6e45){return client['request'](_0x3a154,_0x42f5d4)[_0xb488('0xa')](function(_0x4e5f88){logger[_0xb488('0xb')](_0xb488('0xc'),_0x37e50b,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x37e50b,'request\x20sent',JSON[_0xb488('0xd')](_0x4e5f88));if(_0x4e5f88[_0xb488('0xe')]){if(_0x4e5f88[_0xb488('0xe')][_0xb488('0xf')]===0x1f4){logger[_0xb488('0xe')](_0xb488('0xc'),_0x37e50b,_0x4e5f88['error'][_0xb488('0x10')]);return _0x1c6e45(_0x4e5f88[_0xb488('0xe')][_0xb488('0x10')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x37e50b,_0x4e5f88[_0xb488('0xe')][_0xb488('0x10')]);return _0x532443(_0x4e5f88[_0xb488('0xe')][_0xb488('0x10')]);}else{logger[_0xb488('0xb')](_0xb488('0xc'),_0x37e50b,_0xb488('0x11'));_0x532443(_0x4e5f88[_0xb488('0x12')][_0xb488('0x10')]);}})['catch'](function(_0x47334c){logger[_0xb488('0xe')](_0xb488('0xc'),_0x37e50b,_0x47334c);_0x1c6e45(_0x47334c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 9e77fbe..036df85 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x17d1fd,_0x57ce7c){var _0x3ef66c=function(_0x169109){while(--_0x169109){_0x17d1fd['push'](_0x17d1fd['shift']());}};_0x3ef66c(++_0x57ce7c);}(_0x70e0,0x17b));var _0x070e=function(_0x41c59f,_0x40f502){_0x41c59f=_0x41c59f-0x0;var _0x2850c1=_0x70e0[_0x41c59f];return _0x2850c1;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x52ce3e,_0x25abc7){var _0x49f0ef=function(_0x108653){while(--_0x108653){_0x52ce3e['push'](_0x52ce3e['shift']());}};_0x49f0ef(++_0x25abc7);}(_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'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 6c1b23f..02ddeb4 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 _0x3566=['sequelize'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3566,0x159));var _0x6356=function(_0x290c89,_0x4a8a49){_0x290c89=_0x290c89-0x0;var _0x23aedd=_0x3566[_0x290c89];return _0x23aedd;};'use strict';var Sequelize=require(_0x6356('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x400a=['sequelize','INTEGER'];(function(_0x183f92,_0x13326f){var _0x2be6f2=function(_0x430833){while(--_0x430833){_0x183f92['push'](_0x183f92['shift']());}};_0x2be6f2(++_0x13326f);}(_0x400a,0x152));var _0xa400=function(_0x250337,_0x54267b){_0x250337=_0x250337-0x0;var _0x10c225=_0x400a[_0x250337];return _0x10c225;};'use strict';var Sequelize=require(_0xa400('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa400('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 3269156..d0a83b4 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 _0xdc29=['exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes'];(function(_0x60578a,_0x16136a){var _0x298834=function(_0x54dc95){while(--_0x54dc95){_0x60578a['push'](_0x60578a['shift']());}};_0x298834(++_0x16136a);}(_0xdc29,0x9e));var _0x9dc2=function(_0x2da6a0,_0x47bfde){_0x2da6a0=_0x2da6a0-0x0;var _0x3787bb=_0xdc29[_0x2da6a0];return _0x3787bb;};'use strict';var _=require(_0x9dc2('0x0'));var util=require(_0x9dc2('0x1'));var logger=require(_0x9dc2('0x2'))(_0x9dc2('0x3'));var moment=require(_0x9dc2('0x4'));var BPromise=require(_0x9dc2('0x5'));var rp=require(_0x9dc2('0x6'));var fs=require('fs');var path=require(_0x9dc2('0x7'));var rimraf=require('rimraf');var config=require(_0x9dc2('0x8'));var attributes=require(_0x9dc2('0x9'));module[_0x9dc2('0xa')]=function(_0x246e53,_0x354075){return _0x246e53[_0x9dc2('0xb')](_0x9dc2('0xc'),attributes,{'tableName':_0x9dc2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b7b=['../../config/logger','moment','bluebird','path','rimraf','./userMailQueue.attributes','define','user_has_mail_queues','lodash','util'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x0b7b,0x9e));var _0xb0b7=function(_0x389ecc,_0xb62531){_0x389ecc=_0x389ecc-0x0;var _0x45133e=_0x0b7b[_0x389ecc];return _0x45133e;};'use strict';var _=require(_0xb0b7('0x0'));var util=require(_0xb0b7('0x1'));var logger=require(_0xb0b7('0x2'))('api');var moment=require(_0xb0b7('0x3'));var BPromise=require(_0xb0b7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0b7('0x5'));var rimraf=require(_0xb0b7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb0b7('0x7'));module['exports']=function(_0x409838,_0x349bea){return _0x409838[_0xb0b7('0x8')]('UserMailQueue',attributes,{'tableName':_0xb0b7('0x9'),'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 4d4d92e..c60bf6c 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1a7446,_0x4bd8be){var _0x21af95=function(_0x358704){while(--_0x358704){_0x1a7446['push'](_0x1a7446['shift']());}};_0x21af95(++_0x4bd8be);}(_0x00bb,0x1d8));var _0xb00b=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x00bb[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x498547,_0x4b657d){var _0x3cf209=function(_0x2b949d){while(--_0x2b949d){_0x498547['push'](_0x498547['shift']());}};_0x3cf209(++_0x4b657d);}(_0x6aa7,0x178));var _0x76aa=function(_0x22b92f,_0x50c476){_0x22b92f=_0x22b92f-0x0;var _0x3843c3=_0x6aa7[_0x22b92f];return _0x3843c3;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index d118471..ae1fcac 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 _0x923d=['multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated','sendUserNotification','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x923d,0x1c3));var _0xd923=function(_0x51b894,_0x55f166){_0x51b894=_0x51b894-0x0;var _0x51e73d=_0x923d[_0x51b894];return _0x51e73d;};'use strict';var multer=require(_0xd923('0x0'));var util=require(_0xd923('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd923('0x2')]();var fs_extra=require(_0xd923('0x3'));var auth=require(_0xd923('0x4'));var interaction=require(_0xd923('0x5'));var config=require(_0xd923('0x6'));var controller=require(_0xd923('0x7'));router['post']('/',auth[_0xd923('0x8')](),controller[_0xd923('0x9')]);module[_0xd923('0xa')]=router; \ No newline at end of file +var _0x36cf=['exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x36cf,0xa6));var _0xf36c=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x36cf[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0xf36c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf36c('0x1'));var express=require(_0xf36c('0x2'));var router=express['Router']();var fs_extra=require(_0xf36c('0x3'));var auth=require(_0xf36c('0x4'));var interaction=require(_0xf36c('0x5'));var config=require(_0xf36c('0x6'));var controller=require('./userNotification.controller');router[_0xf36c('0x7')]('/',auth[_0xf36c('0x8')](),controller[_0xf36c('0x9')]);module[_0xf36c('0xa')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 0632726..c5fe9a6 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 _0xf44c=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x3277c2,_0x474368){var _0x3f6639=function(_0x37442e){while(--_0x37442e){_0x3277c2['push'](_0x3277c2['shift']());}};_0x3f6639(++_0x474368);}(_0xf44c,0xbb));var _0xcf44=function(_0x395159,_0x68cc6){_0x395159=_0x395159-0x0;var _0x3b8d9c=_0xf44c[_0x395159];return _0x3b8d9c;};'use strict';var Sequelize=require(_0xcf44('0x0'));module[_0xcf44('0x1')]={'body':{'type':Sequelize[_0xcf44('0x2')]},'senderName':{'type':Sequelize[_0xcf44('0x3')]},'recipientsId':{'type':Sequelize[_0xcf44('0x2')]},'recipientsDescription':{'type':Sequelize[_0xcf44('0x3')]},'beep':{'type':Sequelize[_0xcf44('0x4')]}}; \ No newline at end of file +var _0x1876=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4f301f,_0x4a4752){var _0x19d7f=function(_0x380f53){while(--_0x380f53){_0x4f301f['push'](_0x4f301f['shift']());}};_0x19d7f(++_0x4a4752);}(_0x1876,0x19e));var _0x6187=function(_0x35dc56,_0x4aa77c){_0x35dc56=_0x35dc56-0x0;var _0x3b63c7=_0x1876[_0x35dc56];return _0x3b63c7;};'use strict';var Sequelize=require(_0x6187('0x0'));module[_0x6187('0x1')]={'body':{'type':Sequelize[_0x6187('0x2')]},'senderName':{'type':Sequelize[_0x6187('0x3')]},'recipientsId':{'type':Sequelize[_0x6187('0x2')]},'recipientsDescription':{'type':Sequelize[_0x6187('0x3')]},'beep':{'type':Sequelize[_0x6187('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 38439dd..dda543b 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 _0xf218=['Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','UserNotification','forEach','recipient','userNotification:send','catch','text','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','startCase','User','ids','queue','Queue','push','all','union','flatten','map','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','status','json','undefined','limit','count','offset','set','reject','update','destroy','then','end','error','stack','send','sendUserNotification','body','hasOwnProperty','TemplateId'];(function(_0x21dbc4,_0x3582dc){var _0x2af4e5=function(_0x2f957b){while(--_0x2f957b){_0x21dbc4['push'](_0x21dbc4['shift']());}};_0x2af4e5(++_0x3582dc);}(_0xf218,0x96));var _0x8f21=function(_0x2e353f,_0x15d70a){_0x2e353f=_0x2e353f-0x0;var _0x4b0700=_0xf218[_0x2e353f];return _0x4b0700;};'use strict';var emlformat=require(_0x8f21('0x0'));var rimraf=require(_0x8f21('0x1'));var zipdir=require(_0x8f21('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f21('0x3'));var Mustache=require(_0x8f21('0x4'));var util=require(_0x8f21('0x5'));var path=require(_0x8f21('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8f21('0x7'));var fs=require('fs');var fs_extra=require(_0x8f21('0x8'));var _=require(_0x8f21('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8f21('0xa'));var deskjs=require(_0x8f21('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8f21('0xc'));var Redis=require(_0x8f21('0xd'));var authService=require(_0x8f21('0xe'));var qs=require(_0x8f21('0xf'));var as=require(_0x8f21('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f21('0x11'))(_0x8f21('0x12'));var utils=require(_0x8f21('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8f21('0x14'))['db'];config[_0x8f21('0x15')]=_[_0x8f21('0x16')](config[_0x8f21('0x15')],{'host':_0x8f21('0x17'),'port':0x18eb});var socket=require(_0x8f21('0x18'))(new Redis(config[_0x8f21('0x15')]));require(_0x8f21('0x19'))[_0x8f21('0x1a')](socket);function respondWithStatusCode(_0x4c4d41,_0x23f091){_0x23f091=_0x23f091||0xcc;return function(_0x19cb46){if(_0x19cb46){return _0x4c4d41['sendStatus'](_0x23f091);}return _0x4c4d41[_0x8f21('0x1b')](_0x23f091)['end']();};}function respondWithResult(_0x4c7f40,_0x5585e7){_0x5585e7=_0x5585e7||0xc8;return function(_0x4eb5d1){if(_0x4eb5d1){return _0x4c7f40['status'](_0x5585e7)[_0x8f21('0x1c')](_0x4eb5d1);}};}function respondWithFilteredResult(_0x152256,_0x36b068){return function(_0x3eb4b7){if(_0x3eb4b7){var _0x5f0e4b=typeof _0x36b068['offset']===_0x8f21('0x1d')&&typeof _0x36b068[_0x8f21('0x1e')]===_0x8f21('0x1d');var _0x4cdf11=_0x3eb4b7[_0x8f21('0x1f')];var _0x3dc94a=_0x5f0e4b?0x0:_0x36b068[_0x8f21('0x20')];var _0x5ad20f=_0x5f0e4b?_0x3eb4b7[_0x8f21('0x1f')]:_0x36b068['offset']+_0x36b068[_0x8f21('0x1e')];var _0x15ec83;if(_0x5ad20f>=_0x4cdf11){_0x5ad20f=_0x4cdf11;_0x15ec83=0xc8;}else{_0x15ec83=0xce;}_0x152256[_0x8f21('0x1b')](_0x15ec83);return _0x152256[_0x8f21('0x21')]('Content-Range',_0x3dc94a+'-'+_0x5ad20f+'/'+_0x4cdf11)[_0x8f21('0x1c')](_0x3eb4b7);}return null;};}function patchUpdates(_0x5de064){return function(_0x36dac7){try{jsonpatch['apply'](_0x36dac7,_0x5de064,!![]);}catch(_0x370e06){return BPromise[_0x8f21('0x22')](_0x370e06);}return _0x36dac7['save']();};}function saveUpdates(_0x4a4668,_0x59dc75){return function(_0x32015c){if(_0x32015c){return _0x32015c[_0x8f21('0x23')](_0x4a4668)['then'](function(_0x2b2287){return _0x2b2287;});}return null;};}function removeEntity(_0x5e12a8,_0x185823){return function(_0x262e44){if(_0x262e44){return _0x262e44[_0x8f21('0x24')]()[_0x8f21('0x25')](function(){_0x5e12a8[_0x8f21('0x1b')](0xcc)[_0x8f21('0x26')]();});}};}function handleEntityNotFound(_0x2b2c2d,_0x164e46){return function(_0x3d9086){if(!_0x3d9086){_0x2b2c2d['sendStatus'](0x194);}return _0x3d9086;};}function handleError(_0x4279e2,_0x5ead24){_0x5ead24=_0x5ead24||0x1f4;return function(_0x316e10){logger[_0x8f21('0x27')](_0x316e10[_0x8f21('0x28')]);if(_0x316e10['name']){delete _0x316e10['name'];}_0x4279e2[_0x8f21('0x1b')](_0x5ead24)[_0x8f21('0x29')](_0x316e10);};}exports[_0x8f21('0x2a')]=function(_0x19853b,_0x677ba1,_0x5741df){if(!_0x19853b[_0x8f21('0x2b')]['hasOwnProperty']('text')&&!_0x19853b[_0x8f21('0x2b')][_0x8f21('0x2c')](_0x8f21('0x2d'))){throw new db[(_0x8f21('0x2e'))][(_0x8f21('0x2f'))](_0x8f21('0x30'));}else{if(_0x19853b[_0x8f21('0x2b')][_0x8f21('0x2c')](_0x8f21('0x2d'))&&!_0x19853b[_0x8f21('0x2b')]['hasOwnProperty']('view')){throw new db[(_0x8f21('0x2e'))][(_0x8f21('0x2f'))](_0x8f21('0x31'));}if(!_0x19853b[_0x8f21('0x2b')][_0x8f21('0x2c')](_0x8f21('0x32'))){throw new db[(_0x8f21('0x2e'))][(_0x8f21('0x2f'))](_0x8f21('0x33'));}else{try{var _0x58f9f8=JSON[_0x8f21('0x34')](_0x19853b[_0x8f21('0x2b')][_0x8f21('0x32')]);}catch(_0x108d41){logger['error'](_0x108d41);throw new db['Sequelize'][(_0x8f21('0x2f'))](_0x8f21('0x35'));}var _0x50e9a4=['chatqueue',_0x8f21('0x36'),_0x8f21('0x37'),_0x8f21('0x38'),_0x8f21('0x39'),_0x8f21('0x3a'),_0x8f21('0x3b'),'team',_0x8f21('0x3c')];if(_[_0x8f21('0x3d')](_0x58f9f8,function(_0x19c480){return!_[_0x8f21('0x3e')](_0x50e9a4,_0x19c480[_0x8f21('0x3f')][_0x8f21('0x40')]());})){throw new db[(_0x8f21('0x2e'))][(_0x8f21('0x2f'))](_0x8f21('0x41'));}}}var _0x3e6415={};_0x3e6415[_0x8f21('0x42')]=_0x19853b[_0x8f21('0x2b')][_0x8f21('0x2c')](_0x8f21('0x42'))?_0x19853b[_0x8f21('0x2b')][_0x8f21('0x42')]:_0x19853b[_0x8f21('0x3c')][_0x8f21('0x43')];_0x3e6415[_0x8f21('0x44')]=_[_0x8f21('0x45')](_0x19853b[_0x8f21('0x2b')]['recipientsDescription'])?null:_0x19853b['body'][_0x8f21('0x44')];_0x3e6415['beep']=_0x19853b[_0x8f21('0x2b')][_0x8f21('0x46')]||![];_0x3e6415[_0x8f21('0x47')]=_0x19853b['user']['id'];return getContent(_0x19853b[_0x8f21('0x2b')])[_0x8f21('0x25')](function(_0x39a1d1){_0x3e6415[_0x8f21('0x2b')]=_0x39a1d1;return getRecipients(_0x58f9f8);})[_0x8f21('0x25')](function(_0x114505){_0x3e6415[_0x8f21('0x48')]=_['sortBy'](_0x114505)[_0x8f21('0x49')](',');return db[_0x8f21('0x4a')][_0x8f21('0x4b')](function(_0x469b50){return db[_0x8f21('0x4c')]['create'](_0x3e6415,{'raw':!![],'transaction':_0x469b50})['then'](function(_0x541c6b){var _0xdc1118={'sender':_0x3e6415[_0x8f21('0x42')],'description':_0x3e6415[_0x8f21('0x44')],'content':_0x3e6415[_0x8f21('0x2b')],'beep':_0x3e6415[_0x8f21('0x46')]};_0x114505[_0x8f21('0x4d')](function(_0x10c0f2){_0xdc1118[_0x8f21('0x4e')]=_0x10c0f2;socket['emit'](_0x8f21('0x4f'),_0xdc1118);});return _0x541c6b;});});})[_0x8f21('0x25')](respondWithResult(_0x677ba1,0xc9))[_0x8f21('0x50')](handleError(_0x677ba1,null));};function getContent(_0x43abf5){return new BPromise(function(_0x5e0eee,_0x5eecd3){if(_0x43abf5['text']){_0x5e0eee(_0x43abf5[_0x8f21('0x51')]);return;}return db[_0x8f21('0x52')][_0x8f21('0x53')]({'attributes':['html'],'where':{'id':_0x43abf5['TemplateId']},'raw':!![]})[_0x8f21('0x25')](function(_0x58543e){if(!_0x58543e)throw new db[(_0x8f21('0x2e'))][(_0x8f21('0x2f'))](_0x8f21('0x54'));var _0x3bcd6c=Mustache[_0x8f21('0x55')](_0x58543e[_0x8f21('0x56')],_0x43abf5[_0x8f21('0x57')]);_0x5e0eee(_0x3bcd6c);})[_0x8f21('0x50')](function(_0x262f38){_0x5eecd3(_0x262f38);});});}function getRecipients(_0x110b02){return new BPromise(function(_0x155e50,_0x42e6cb){var _0x4fbd44=[];var _0xc5c99b=[];_0x110b02[_0x8f21('0x4d')](function(_0x5a651a){var _0x5c51aa=_[_0x8f21('0x58')](_0x5a651a[_0x8f21('0x3f')][_0x8f21('0x40')]());if(_0x5c51aa===_0x8f21('0x59')){_0x4fbd44=_['union'](_0x4fbd44,_0x5a651a[_0x8f21('0x5a')]);}else{if(_['includes'](_0x5c51aa,'queue'))_0x5c51aa=_0x5c51aa['replace'](_0x8f21('0x5b'),_0x8f21('0x5c'));_0x5a651a[_0x8f21('0x5a')]['forEach'](function(_0x3fdcbf){_0xc5c99b[_0x8f21('0x5d')](getAgents(_0x5c51aa,_0x3fdcbf));});}});return BPromise[_0x8f21('0x5e')](_0xc5c99b)[_0x8f21('0x25')](function(_0x1d8ace){_0x4fbd44=_[_0x8f21('0x5f')](_0x4fbd44,_[_0x8f21('0x60')](_0x1d8ace));_0x155e50(_0x4fbd44);})[_0x8f21('0x50')](function(_0x38c3b9){_0x42e6cb(_0x38c3b9);});});}function getAgents(_0x590fc5,_0x5b91e6){return new BPromise(function(_0x13cc2d,_0x502264){return db[_0x590fc5][_0x8f21('0x53')]({'where':{'id':_0x5b91e6}})[_0x8f21('0x25')](function(_0x15f612){return _0x15f612['getAgents']({'attributes':['id'],'raw':!![]})[_0x8f21('0x25')](function(_0x19f0b4){var _0x258b27=_[_0x8f21('0x61')](_0x19f0b4,'id');_0x13cc2d(_0x258b27);});})['catch'](function(_0x3ff275){_0x502264(_0x3ff275);});});} \ No newline at end of file +var _0x8014=['apply','reject','save','update','then','sendUserNotification','hasOwnProperty','text','body','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','ValidationError','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','transaction','forEach','recipient','userNotification:send','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view','catch','startCase','toLowerCase','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x1820ab,_0x698f97){var _0x8e1f17=function(_0x560edd){while(--_0x560edd){_0x1820ab['push'](_0x1820ab['shift']());}};_0x8e1f17(++_0x698f97);}(_0x8014,0x10a));var _0x4801=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x8014[_0x31bab3];return _0x4fd382;};'use strict';var emlformat=require(_0x4801('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4801('0x1'));var jsonpatch=require(_0x4801('0x2'));var rp=require(_0x4801('0x3'));var moment=require('moment');var BPromise=require(_0x4801('0x4'));var Mustache=require(_0x4801('0x5'));var util=require(_0x4801('0x6'));var path=require(_0x4801('0x7'));var sox=require(_0x4801('0x8'));var csv=require(_0x4801('0x9'));var ejs=require(_0x4801('0xa'));var fs=require('fs');var fs_extra=require(_0x4801('0xb'));var _=require(_0x4801('0xc'));var squel=require(_0x4801('0xd'));var crypto=require('crypto');var jsforce=require(_0x4801('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4801('0xf'));var Papa=require(_0x4801('0x10'));var Redis=require(_0x4801('0x11'));var authService=require(_0x4801('0x12'));var qs=require(_0x4801('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4801('0x14'))(_0x4801('0x15'));var utils=require(_0x4801('0x16'));var config=require(_0x4801('0x17'));var licenseUtil=require(_0x4801('0x18'));var db=require(_0x4801('0x19'))['db'];config[_0x4801('0x1a')]=_[_0x4801('0x1b')](config[_0x4801('0x1a')],{'host':_0x4801('0x1c'),'port':0x18eb});var socket=require(_0x4801('0x1d'))(new Redis(config['redis']));require(_0x4801('0x1e'))['register'](socket);function respondWithStatusCode(_0x472120,_0x4fa477){_0x4fa477=_0x4fa477||0xcc;return function(_0x167513){if(_0x167513){return _0x472120[_0x4801('0x1f')](_0x4fa477);}return _0x472120[_0x4801('0x20')](_0x4fa477)[_0x4801('0x21')]();};}function respondWithResult(_0x3caaa6,_0xb587bb){_0xb587bb=_0xb587bb||0xc8;return function(_0x395d22){if(_0x395d22){return _0x3caaa6['status'](_0xb587bb)[_0x4801('0x22')](_0x395d22);}};}function respondWithFilteredResult(_0x4f38db,_0x57aeee){return function(_0x25d50f){if(_0x25d50f){var _0x4bac96=typeof _0x57aeee[_0x4801('0x23')]===_0x4801('0x24')&&typeof _0x57aeee[_0x4801('0x25')]===_0x4801('0x24');var _0x4c4dae=_0x25d50f[_0x4801('0x26')];var _0xa4fa00=_0x4bac96?0x0:_0x57aeee[_0x4801('0x23')];var _0x5dc581=_0x4bac96?_0x25d50f[_0x4801('0x26')]:_0x57aeee[_0x4801('0x23')]+_0x57aeee[_0x4801('0x25')];var _0x267ca4;if(_0x5dc581>=_0x4c4dae){_0x5dc581=_0x4c4dae;_0x267ca4=0xc8;}else{_0x267ca4=0xce;}_0x4f38db['status'](_0x267ca4);return _0x4f38db['set'](_0x4801('0x27'),_0xa4fa00+'-'+_0x5dc581+'/'+_0x4c4dae)[_0x4801('0x22')](_0x25d50f);}return null;};}function patchUpdates(_0x34ef19){return function(_0x4fda5e){try{jsonpatch[_0x4801('0x28')](_0x4fda5e,_0x34ef19,!![]);}catch(_0x456c53){return BPromise[_0x4801('0x29')](_0x456c53);}return _0x4fda5e[_0x4801('0x2a')]();};}function saveUpdates(_0x2991b1,_0x41438e){return function(_0x4d61ba){if(_0x4d61ba){return _0x4d61ba[_0x4801('0x2b')](_0x2991b1)[_0x4801('0x2c')](function(_0x52dfe2){return _0x52dfe2;});}return null;};}function removeEntity(_0x4f5317,_0x4face5){return function(_0x5504e5){if(_0x5504e5){return _0x5504e5['destroy']()[_0x4801('0x2c')](function(){_0x4f5317[_0x4801('0x20')](0xcc)[_0x4801('0x21')]();});}};}function handleEntityNotFound(_0x5c5e8c,_0x5e9658){return function(_0x2feaf2){if(!_0x2feaf2){_0x5c5e8c[_0x4801('0x1f')](0x194);}return _0x2feaf2;};}function handleError(_0x21a0f4,_0x2add9d){_0x2add9d=_0x2add9d||0x1f4;return function(_0x5cf596){logger['error'](_0x5cf596['stack']);if(_0x5cf596['name']){delete _0x5cf596['name'];}_0x21a0f4['status'](_0x2add9d)['send'](_0x5cf596);};}exports[_0x4801('0x2d')]=function(_0x39be47,_0x4b7e45,_0x5be68e){if(!_0x39be47['body'][_0x4801('0x2e')](_0x4801('0x2f'))&&!_0x39be47[_0x4801('0x30')]['hasOwnProperty'](_0x4801('0x31'))){throw new db[(_0x4801('0x32'))]['ValidationError'](_0x4801('0x33'));}else{if(_0x39be47['body'][_0x4801('0x2e')](_0x4801('0x31'))&&!_0x39be47[_0x4801('0x30')][_0x4801('0x2e')]('view')){throw new db[(_0x4801('0x32'))][(_0x4801('0x34'))](_0x4801('0x35'));}if(!_0x39be47['body']['hasOwnProperty']('recipients')){throw new db[(_0x4801('0x32'))][(_0x4801('0x34'))](_0x4801('0x36'));}else{try{var _0xfd80a0=JSON[_0x4801('0x37')](_0x39be47[_0x4801('0x30')][_0x4801('0x38')]);}catch(_0x4c170c){logger[_0x4801('0x39')](_0x4c170c);throw new db[(_0x4801('0x32'))][(_0x4801('0x34'))](_0x4801('0x3a'));}var _0x32dd9c=[_0x4801('0x3b'),_0x4801('0x3c'),_0x4801('0x3d'),_0x4801('0x3e'),_0x4801('0x3f'),_0x4801('0x40'),_0x4801('0x41'),_0x4801('0x42'),'user'];if(_[_0x4801('0x43')](_0xfd80a0,function(_0x3991a5){return!_[_0x4801('0x44')](_0x32dd9c,_0x3991a5[_0x4801('0x45')]['toLowerCase']());})){throw new db[(_0x4801('0x32'))]['ValidationError'](_0x4801('0x46'));}}}var _0xa4e6df={};_0xa4e6df[_0x4801('0x47')]=_0x39be47[_0x4801('0x30')][_0x4801('0x2e')](_0x4801('0x47'))?_0x39be47[_0x4801('0x30')]['senderName']:_0x39be47[_0x4801('0x48')][_0x4801('0x49')];_0xa4e6df[_0x4801('0x4a')]=_[_0x4801('0x4b')](_0x39be47[_0x4801('0x30')][_0x4801('0x4a')])?null:_0x39be47[_0x4801('0x30')]['recipientsDescription'];_0xa4e6df[_0x4801('0x4c')]=_0x39be47['body']['beep']||![];_0xa4e6df[_0x4801('0x4d')]=_0x39be47['user']['id'];return getContent(_0x39be47[_0x4801('0x30')])[_0x4801('0x2c')](function(_0x21d62e){_0xa4e6df[_0x4801('0x30')]=_0x21d62e;return getRecipients(_0xfd80a0);})['then'](function(_0x28ab8d){_0xa4e6df[_0x4801('0x4e')]=_['sortBy'](_0x28ab8d)[_0x4801('0x4f')](',');return db['sequelize'][_0x4801('0x50')](function(_0x1427b6){return db['UserNotification']['create'](_0xa4e6df,{'raw':!![],'transaction':_0x1427b6})['then'](function(_0x193035){var _0x3e19a6={'sender':_0xa4e6df[_0x4801('0x47')],'description':_0xa4e6df['recipientsDescription'],'content':_0xa4e6df[_0x4801('0x30')],'beep':_0xa4e6df['beep']};_0x28ab8d[_0x4801('0x51')](function(_0x452189){_0x3e19a6[_0x4801('0x52')]=_0x452189;socket['emit'](_0x4801('0x53'),_0x3e19a6);});return _0x193035;});});})[_0x4801('0x2c')](respondWithResult(_0x4b7e45,0xc9))['catch'](handleError(_0x4b7e45,null));};function getContent(_0x5bc5a8){return new BPromise(function(_0x865d26,_0x408086){if(_0x5bc5a8[_0x4801('0x2f')]){_0x865d26(_0x5bc5a8[_0x4801('0x2f')]);return;}return db['Template']['findOne']({'attributes':[_0x4801('0x54')],'where':{'id':_0x5bc5a8[_0x4801('0x31')]},'raw':!![]})['then'](function(_0x4ead13){if(!_0x4ead13)throw new db[(_0x4801('0x32'))][(_0x4801('0x34'))](_0x4801('0x55'));var _0x480488=Mustache[_0x4801('0x56')](_0x4ead13['html'],_0x5bc5a8[_0x4801('0x57')]);_0x865d26(_0x480488);})[_0x4801('0x58')](function(_0x5683da){_0x408086(_0x5683da);});});}function getRecipients(_0x4aeb57){return new BPromise(function(_0x4774bd,_0x583cba){var _0x11ec3e=[];var _0x523926=[];_0x4aeb57[_0x4801('0x51')](function(_0xbd20d3){var _0x22b597=_[_0x4801('0x59')](_0xbd20d3[_0x4801('0x45')][_0x4801('0x5a')]());if(_0x22b597===_0x4801('0x5b')){_0x11ec3e=_[_0x4801('0x5c')](_0x11ec3e,_0xbd20d3[_0x4801('0x5d')]);}else{if(_['includes'](_0x22b597,_0x4801('0x5e')))_0x22b597=_0x22b597[_0x4801('0x5f')]('queue',_0x4801('0x60'));_0xbd20d3[_0x4801('0x5d')][_0x4801('0x51')](function(_0x45c9c5){_0x523926[_0x4801('0x61')](getAgents(_0x22b597,_0x45c9c5));});}});return BPromise[_0x4801('0x62')](_0x523926)[_0x4801('0x2c')](function(_0x3defa4){_0x11ec3e=_[_0x4801('0x5c')](_0x11ec3e,_[_0x4801('0x63')](_0x3defa4));_0x4774bd(_0x11ec3e);})[_0x4801('0x58')](function(_0x1d11ac){_0x583cba(_0x1d11ac);});});}function getAgents(_0x37b555,_0x3fff6f){return new BPromise(function(_0xa3f07c,_0xd2ee3){return db[_0x37b555]['findOne']({'where':{'id':_0x3fff6f}})[_0x4801('0x2c')](function(_0x3382dd){return _0x3382dd[_0x4801('0x64')]({'attributes':['id'],'raw':!![]})[_0x4801('0x2c')](function(_0x2e2c2a){var _0x2b8955=_[_0x4801('0x65')](_0x2e2c2a,'id');_0xa3f07c(_0x2b8955);});})[_0x4801('0x58')](function(_0x313ba1){_0xd2ee3(_0x313ba1);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 27cc8d1..e718b79 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 _0x13aa=['update','remove','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','save'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0x13aa,0xc4));var _0xa13a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x13aa[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xa13a('0x0'));var UserNotification=require(_0xa13a('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa13a('0x2')](0x0);var events={'afterCreate':_0xa13a('0x3'),'afterUpdate':_0xa13a('0x4'),'afterDestroy':_0xa13a('0x5')};function emitEvent(_0x310188){return function(_0x12715c,_0x22da57,_0x4970b8){UserNotificationEvents[_0xa13a('0x6')](_0x310188+':'+_0x12715c['id'],_0x12715c);UserNotificationEvents[_0xa13a('0x6')](_0x310188,_0x12715c);_0x4970b8(null);};}for(var e in events){if(events[_0xa13a('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x603d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','save','update','remove'];(function(_0x299a81,_0x39e05c){var _0x53d383=function(_0x1e73ff){while(--_0x1e73ff){_0x299a81['push'](_0x299a81['shift']());}};_0x53d383(++_0x39e05c);}(_0x603d,0x68));var _0xd603=function(_0x3b0662,_0x12d99f){_0x3b0662=_0x3b0662-0x0;var _0x3cef8b=_0x603d[_0x3b0662];return _0x3cef8b;};'use strict';var EventEmitter=require(_0xd603('0x0'));var UserNotification=require(_0xd603('0x1'))['db'][_0xd603('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd603('0x3'),'afterUpdate':_0xd603('0x4'),'afterDestroy':_0xd603('0x5')};function emitEvent(_0x4c9764){return function(_0x9f7f24,_0x3e6ba5,_0x3e11df){UserNotificationEvents[_0xd603('0x6')](_0x4c9764+':'+_0x9f7f24['id'],_0x9f7f24);UserNotificationEvents[_0xd603('0x6')](_0x4c9764,_0x9f7f24);_0x3e11df(null);};}for(var e in events){if(events[_0xd603('0x7')](e)){var event=events[e];UserNotification[_0xd603('0x8')](e,emitEvent(event));}}module[_0xd603('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 4c9b891..c455977 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 _0x3fca=['./userNotification.attributes','UserNotification','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x13bb29,_0x1e2734){var _0x25e984=function(_0x5905d4){while(--_0x5905d4){_0x13bb29['push'](_0x13bb29['shift']());}};_0x25e984(++_0x1e2734);}(_0x3fca,0x12c));var _0xa3fc=function(_0x3fbe46,_0x5c2f9a){_0x3fbe46=_0x3fbe46-0x0;var _0x1aeaa3=_0x3fca[_0x3fbe46];return _0x1aeaa3;};'use strict';var _=require('lodash');var util=require(_0xa3fc('0x0'));var logger=require(_0xa3fc('0x1'))(_0xa3fc('0x2'));var moment=require(_0xa3fc('0x3'));var BPromise=require(_0xa3fc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3fc('0x5'));var rimraf=require(_0xa3fc('0x6'));var config=require(_0xa3fc('0x7'));var attributes=require(_0xa3fc('0x8'));module['exports']=function(_0x46300d,_0x2d0d67){return _0x46300d['define'](_0xa3fc('0x9'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa3fc('0xa')});}; \ No newline at end of file +var _0xf2ba=['../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','rimraf'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xf2ba,0xab));var _0xaf2b=function(_0x326c47,_0x8dca2){_0x326c47=_0x326c47-0x0;var _0x564786=_0xf2ba[_0x326c47];return _0x564786;};'use strict';var _=require(_0xaf2b('0x0'));var util=require(_0xaf2b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaf2b('0x2'));var BPromise=require(_0xaf2b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaf2b('0x4'));var config=require(_0xaf2b('0x5'));var attributes=require(_0xaf2b('0x6'));module['exports']=function(_0x4e6e12,_0x57f9b6){return _0x4e6e12[_0xaf2b('0x7')](_0xaf2b('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf2b('0x9'),'collate':_0xaf2b('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index f67128a..99d20d9 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 _0x88c9=['defaults','localhost','socket.io-emitter','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x46ee9c,_0x455b0c){var _0x4f1b15=function(_0x1baa09){while(--_0x1baa09){_0x46ee9c['push'](_0x46ee9c['shift']());}};_0x4f1b15(++_0x455b0c);}(_0x88c9,0x76));var _0x988c=function(_0x1fa0a3,_0x225b52){_0x1fa0a3=_0x1fa0a3-0x0;var _0x259fab=_0x88c9[_0x1fa0a3];return _0x259fab;};'use strict';var _=require(_0x988c('0x0'));var util=require(_0x988c('0x1'));var moment=require(_0x988c('0x2'));var BPromise=require('bluebird');var rs=require(_0x988c('0x3'));var fs=require('fs');var Redis=require(_0x988c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x988c('0x5'));var logger=require(_0x988c('0x6'))('rpc');var config=require(_0x988c('0x7'));var jayson=require(_0x988c('0x8'));var client=jayson[_0x988c('0x9')][_0x988c('0xa')]({'port':0x232a});config[_0x988c('0xb')]=_[_0x988c('0xc')](config['redis'],{'host':_0x988c('0xd'),'port':0x18eb});var socket=require(_0x988c('0xe'))(new Redis(config[_0x988c('0xb')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x530c6e,_0xcab60d,_0x87106f){return new BPromise(function(_0x4b9221,_0x2b85aa){return client[_0x988c('0xf')](_0x530c6e,_0x87106f)['then'](function(_0x44da9b){logger[_0x988c('0x10')](_0x988c('0x11'),_0xcab60d,_0x988c('0x12'));logger[_0x988c('0x13')](_0x988c('0x14'),_0xcab60d,_0x988c('0x12'),JSON[_0x988c('0x15')](_0x44da9b));if(_0x44da9b[_0x988c('0x16')]){if(_0x44da9b[_0x988c('0x16')][_0x988c('0x17')]===0x1f4){logger[_0x988c('0x16')]('UserNotification,\x20%s,\x20%s',_0xcab60d,_0x44da9b['error'][_0x988c('0x18')]);return _0x2b85aa(_0x44da9b['error'][_0x988c('0x18')]);}logger[_0x988c('0x16')](_0x988c('0x11'),_0xcab60d,_0x44da9b[_0x988c('0x16')][_0x988c('0x18')]);return _0x4b9221(_0x44da9b[_0x988c('0x16')][_0x988c('0x18')]);}else{logger[_0x988c('0x10')](_0x988c('0x11'),_0xcab60d,_0x988c('0x12'));_0x4b9221(_0x44da9b[_0x988c('0x19')][_0x988c('0x18')]);}})['catch'](function(_0x46bbfa){logger[_0x988c('0x16')](_0x988c('0x11'),_0xcab60d,_0x46bbfa);_0x2b85aa(_0x46bbfa);});});} \ No newline at end of file +var _0xe44d=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4d83bd,_0x5ce16f){var _0x7a1329=function(_0x109d02){while(--_0x109d02){_0x4d83bd['push'](_0x4d83bd['shift']());}};_0x7a1329(++_0x5ce16f);}(_0xe44d,0x7d));var _0xde44=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xe44d[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xde44('0x0'));var util=require(_0xde44('0x1'));var moment=require(_0xde44('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde44('0x3'))['db'];var utils=require(_0xde44('0x4'));var logger=require('../../config/logger')(_0xde44('0x5'));var config=require(_0xde44('0x6'));var jayson=require(_0xde44('0x7'));var client=jayson[_0xde44('0x8')][_0xde44('0x9')]({'port':0x232a});config[_0xde44('0xa')]=_[_0xde44('0xb')](config['redis'],{'host':_0xde44('0xc'),'port':0x18eb});var socket=require(_0xde44('0xd'))(new Redis(config['redis']));require(_0xde44('0xe'))['register'](socket);function respondWithRpcPromise(_0x5da42a,_0x50eb4a,_0x34e856){return new BPromise(function(_0x5526b4,_0x464b69){return client['request'](_0x5da42a,_0x34e856)[_0xde44('0xf')](function(_0x2b1512){logger['info'](_0xde44('0x10'),_0x50eb4a,_0xde44('0x11'));logger[_0xde44('0x12')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x50eb4a,_0xde44('0x11'),JSON['stringify'](_0x2b1512));if(_0x2b1512[_0xde44('0x13')]){if(_0x2b1512['error']['code']===0x1f4){logger['error'](_0xde44('0x10'),_0x50eb4a,_0x2b1512[_0xde44('0x13')][_0xde44('0x14')]);return _0x464b69(_0x2b1512[_0xde44('0x13')][_0xde44('0x14')]);}logger[_0xde44('0x13')](_0xde44('0x10'),_0x50eb4a,_0x2b1512[_0xde44('0x13')][_0xde44('0x14')]);return _0x5526b4(_0x2b1512[_0xde44('0x13')][_0xde44('0x14')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x50eb4a,_0xde44('0x11'));_0x5526b4(_0x2b1512['result']['message']);}})[_0xde44('0x15')](function(_0x2d095a){logger['error']('UserNotification,\x20%s,\x20%s',_0x50eb4a,_0x2d095a);_0x464b69(_0x2d095a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 44ab7a2..56ce487 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 _0x713a=['removeListener','length','./userNotification.events','save','remove'];(function(_0x1c5371,_0x10cca0){var _0x17c1ea=function(_0x9ed313){while(--_0x9ed313){_0x1c5371['push'](_0x1c5371['shift']());}};_0x17c1ea(++_0x10cca0);}(_0x713a,0x115));var _0xa713=function(_0x307a74,_0x372f13){_0x307a74=_0x307a74-0x0;var _0x2a19ec=_0x713a[_0x307a74];return _0x2a19ec;};'use strict';var UserNotificationEvents=require(_0xa713('0x0'));var events=[_0xa713('0x1'),_0xa713('0x2'),'update'];function createListener(_0x412749,_0x3c4438){return function(_0x525cdc){_0x3c4438['emit'](_0x412749,_0x525cdc);};}function removeListener(_0x287239,_0x5cde47){return function(){UserNotificationEvents[_0xa713('0x3')](_0x287239,_0x5cde47);};}exports['register']=function(_0x585c8f){for(var _0x5887d0=0x0,_0x3094e8=events[_0xa713('0x4')];_0x5887d0<_0x3094e8;_0x5887d0++){var _0x36f97d=events[_0x5887d0];var _0x3593b4=createListener('userNotification:'+_0x36f97d,_0x585c8f);UserNotificationEvents['on'](_0x36f97d,_0x3593b4);}}; \ No newline at end of file +var _0x956b=['./userNotification.events','save','remove','update','emit','removeListener','register','userNotification:'];(function(_0x141cbd,_0x53e3db){var _0x29729c=function(_0x3ef415){while(--_0x3ef415){_0x141cbd['push'](_0x141cbd['shift']());}};_0x29729c(++_0x53e3db);}(_0x956b,0x128));var _0xb956=function(_0x431b57,_0x338845){_0x431b57=_0x431b57-0x0;var _0x49ddcf=_0x956b[_0x431b57];return _0x49ddcf;};'use strict';var UserNotificationEvents=require(_0xb956('0x0'));var events=[_0xb956('0x1'),_0xb956('0x2'),_0xb956('0x3')];function createListener(_0x3ad12c,_0x4494f7){return function(_0x183359){_0x4494f7[_0xb956('0x4')](_0x3ad12c,_0x183359);};}function removeListener(_0x52232b,_0x2bb2b0){return function(){UserNotificationEvents[_0xb956('0x5')](_0x52232b,_0x2bb2b0);};}exports[_0xb956('0x6')]=function(_0x2b26ce){for(var _0x4ff5f5=0x0,_0x5487c3=events['length'];_0x4ff5f5<_0x5487c3;_0x4ff5f5++){var _0x9d7599=events[_0x4ff5f5];var _0x30e466=createListener(_0xb956('0x7')+_0x9d7599,_0x2b26ce);UserNotificationEvents['on'](_0x9d7599,_0x30e466);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 0f47663..12c0139 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4dc811,_0x1d73fb){var _0x447e06=function(_0xeebbc6){while(--_0xeebbc6){_0x4dc811['push'](_0x4dc811['shift']());}};_0x447e06(++_0x1d73fb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x674d53,_0x42b217){var _0x983d83=function(_0x1399b0){while(--_0x1399b0){_0x674d53['push'](_0x674d53['shift']());}};_0x983d83(++_0x42b217);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34c553,_0x3e7dfc){_0x34c553=_0x34c553-0x0;var _0x1357d2=_0xcb91[_0x34c553];return _0x1357d2;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index e8f25c1..f8c51b7 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 _0xb02a=['sequelize','INTEGER'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb02a,0xb0));var _0xab02=function(_0x1b35f6,_0x31d567){_0x1b35f6=_0x1b35f6-0x0;var _0x4c145b=_0xb02a[_0x1b35f6];return _0x4c145b;};'use strict';var Sequelize=require(_0xab02('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xab02('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcb20=['INTEGER','exports'];(function(_0x481f78,_0x3b9e3c){var _0x3360e7=function(_0x16fc3b){while(--_0x16fc3b){_0x481f78['push'](_0x481f78['shift']());}};_0x3360e7(++_0x3b9e3c);}(_0xcb20,0x129));var _0x0cb2=function(_0x3be450,_0x2df398){_0x3be450=_0x3be450-0x0;var _0x163afe=_0xcb20[_0x3be450];return _0x163afe;};'use strict';var Sequelize=require('sequelize');module[_0x0cb2('0x0')]={'penalty':{'type':Sequelize[_0x0cb2('0x1')],'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 2ea30bc..27ce99c 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 _0x593f=['rimraf','../../config/environment','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x593f,0x109));var _0xf593=function(_0x4a599b,_0x1d2125){_0x4a599b=_0x4a599b-0x0;var _0x2d53d3=_0x593f[_0x4a599b];return _0x2d53d3;};'use strict';var _=require(_0xf593('0x0'));var util=require(_0xf593('0x1'));var logger=require(_0xf593('0x2'))(_0xf593('0x3'));var moment=require('moment');var BPromise=require(_0xf593('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf593('0x5'));var config=require(_0xf593('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module['exports']=function(_0x52f5b2,_0x2c397e){return _0x52f5b2[_0xf593('0x7')]('UserOpenchannelQueue',attributes,{'tableName':_0xf593('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x71e8=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf','exports'];(function(_0x2924d7,_0x1136b2){var _0x31a312=function(_0x559034){while(--_0x559034){_0x2924d7['push'](_0x2924d7['shift']());}};_0x31a312(++_0x1136b2);}(_0x71e8,0x158));var _0x871e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x71e8[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x871e('0x0'));var util=require(_0x871e('0x1'));var logger=require(_0x871e('0x2'))(_0x871e('0x3'));var moment=require('moment');var BPromise=require(_0x871e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x871e('0x5'));var rimraf=require(_0x871e('0x6'));var config=require('../../config/environment');var attributes=require('./userOpenchannelQueue.attributes');module[_0x871e('0x7')]=function(_0x440d4f,_0x276305){return _0x440d4f[_0x871e('0x8')](_0x871e('0x9'),attributes,{'tableName':_0x871e('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 c560fac..3bb3d71 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 _0x0418=['then','UserOpenchannelQueue,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x0418,0x187));var _0x8041=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0418[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x8041('0x0'));var util=require(_0x8041('0x1'));var moment=require('moment');var BPromise=require(_0x8041('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8041('0x3'));var db=require(_0x8041('0x4'))['db'];var utils=require(_0x8041('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8041('0x6'));var jayson=require(_0x8041('0x7'));var client=jayson['client'][_0x8041('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x400956,_0x4591df,_0xd07cc6){return new BPromise(function(_0x2e3ea8,_0x1ab326){return client['request'](_0x400956,_0xd07cc6)[_0x8041('0x9')](function(_0x461774){logger['info'](_0x8041('0xa'),_0x4591df,'request\x20sent');logger[_0x8041('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4591df,'request\x20sent',JSON[_0x8041('0xc')](_0x461774));if(_0x461774[_0x8041('0xd')]){if(_0x461774['error'][_0x8041('0xe')]===0x1f4){logger['error'](_0x8041('0xa'),_0x4591df,_0x461774[_0x8041('0xd')][_0x8041('0xf')]);return _0x1ab326(_0x461774[_0x8041('0xd')][_0x8041('0xf')]);}logger[_0x8041('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4591df,_0x461774[_0x8041('0xd')][_0x8041('0xf')]);return _0x2e3ea8(_0x461774['error'][_0x8041('0xf')]);}else{logger[_0x8041('0x10')](_0x8041('0xa'),_0x4591df,_0x8041('0x11'));_0x2e3ea8(_0x461774[_0x8041('0x12')][_0x8041('0xf')]);}})[_0x8041('0x13')](function(_0x1d47a5){logger[_0x8041('0xd')](_0x8041('0xa'),_0x4591df,_0x1d47a5);_0x1ab326(_0x1d47a5);});});} \ No newline at end of file +var _0x1c97=['jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','../../config/logger','rpc','../../config/environment'];(function(_0x44b827,_0x1bb1aa){var _0x527342=function(_0x481338){while(--_0x481338){_0x44b827['push'](_0x44b827['shift']());}};_0x527342(++_0x1bb1aa);}(_0x1c97,0xf8));var _0x71c9=function(_0x556398,_0x55b931){_0x556398=_0x556398-0x0;var _0x578757=_0x1c97[_0x556398];return _0x578757;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x71c9('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x71c9('0x1'))(_0x71c9('0x2'));var config=require(_0x71c9('0x3'));var jayson=require(_0x71c9('0x4'));var client=jayson[_0x71c9('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26af00,_0x2ea42c,_0x551619){return new BPromise(function(_0xfd5d03,_0x2c124a){return client[_0x71c9('0x6')](_0x26af00,_0x551619)[_0x71c9('0x7')](function(_0x46dc60){logger[_0x71c9('0x8')](_0x71c9('0x9'),_0x2ea42c,_0x71c9('0xa'));logger[_0x71c9('0xb')](_0x71c9('0xc'),_0x2ea42c,_0x71c9('0xa'),JSON[_0x71c9('0xd')](_0x46dc60));if(_0x46dc60[_0x71c9('0xe')]){if(_0x46dc60['error']['code']===0x1f4){logger[_0x71c9('0xe')](_0x71c9('0x9'),_0x2ea42c,_0x46dc60[_0x71c9('0xe')][_0x71c9('0xf')]);return _0x2c124a(_0x46dc60[_0x71c9('0xe')][_0x71c9('0xf')]);}logger[_0x71c9('0xe')](_0x71c9('0x9'),_0x2ea42c,_0x46dc60[_0x71c9('0xe')]['message']);return _0xfd5d03(_0x46dc60[_0x71c9('0xe')][_0x71c9('0xf')]);}else{logger[_0x71c9('0x8')](_0x71c9('0x9'),_0x2ea42c,'request\x20sent');_0xfd5d03(_0x46dc60[_0x71c9('0x10')][_0x71c9('0xf')]);}})[_0x71c9('0x11')](function(_0x20a6ae){logger[_0x71c9('0xe')](_0x71c9('0x9'),_0x2ea42c,_0x20a6ae);_0x2c124a(_0x20a6ae);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f2b823b..fce9555 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 _0xcffc=['getSections','/:id/resources','getResources','post','create','/:id/clone','addSections','addResources','put','delete','/:id','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id/sections'];(function(_0x10a546,_0x5ea132){var _0x30e897=function(_0x54964b){while(--_0x54964b){_0x10a546['push'](_0x10a546['shift']());}};_0x30e897(++_0x5ea132);}(_0xcffc,0x1d1));var _0xccff=function(_0x95452a,_0x2de7e6){_0x95452a=_0x95452a-0x0;var _0xfa6961=_0xcffc[_0x95452a];return _0xfa6961;};'use strict';var multer=require(_0xccff('0x0'));var util=require(_0xccff('0x1'));var path=require(_0xccff('0x2'));var timeout=require(_0xccff('0x3'));var express=require(_0xccff('0x4'));var router=express[_0xccff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xccff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xccff('0x7'));var controller=require(_0xccff('0x8'));router[_0xccff('0x9')]('/',auth['isAuthenticated'](),controller[_0xccff('0xa')]);router['get'](_0xccff('0xb'),auth[_0xccff('0xc')](),controller[_0xccff('0xd')]);router[_0xccff('0x9')]('/:id',auth[_0xccff('0xc')](),controller['show']);router[_0xccff('0x9')](_0xccff('0xe'),auth['isAuthenticated'](),controller[_0xccff('0xf')]);router[_0xccff('0x9')](_0xccff('0x10'),auth[_0xccff('0xc')](),controller[_0xccff('0x11')]);router[_0xccff('0x12')]('/',auth[_0xccff('0xc')](),controller[_0xccff('0x13')]);router[_0xccff('0x12')](_0xccff('0x14'),auth[_0xccff('0xc')](),controller['clone']);router['post']('/:id/sections',auth['isAuthenticated'](),controller[_0xccff('0x15')]);router['post']('/:id/resources',auth[_0xccff('0xc')](),controller[_0xccff('0x16')]);router[_0xccff('0x17')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xccff('0x18')](_0xccff('0x19'),auth[_0xccff('0xc')](),controller[_0xccff('0x1a')]);router['delete'](_0xccff('0xe'),auth['isAuthenticated'](),controller[_0xccff('0x1b')]);router[_0xccff('0x18')](_0xccff('0x10'),auth[_0xccff('0xc')](),controller[_0xccff('0x1c')]);module[_0xccff('0x1d')]=router; \ No newline at end of file +var _0xe7d9=['../../components/interaction/service','./userProfile.controller','isAuthenticated','get','describe','/:id','show','/:id/sections','/:id/resources','getResources','post','create','addSections','update','delete','destroy','removeSections','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xe7d9,0xe9));var _0x9e7d=function(_0x143619,_0x45d113){_0x143619=_0x143619-0x0;var _0x8e5ebe=_0xe7d9[_0x143619];return _0x8e5ebe;};'use strict';var multer=require(_0x9e7d('0x0'));var util=require('util');var path=require(_0x9e7d('0x1'));var timeout=require(_0x9e7d('0x2'));var express=require(_0x9e7d('0x3'));var router=express[_0x9e7d('0x4')]();var fs_extra=require(_0x9e7d('0x5'));var auth=require(_0x9e7d('0x6'));var interaction=require(_0x9e7d('0x7'));var config=require('../../config/environment');var controller=require(_0x9e7d('0x8'));router['get']('/',auth[_0x9e7d('0x9')](),controller['index']);router[_0x9e7d('0xa')]('/describe',auth[_0x9e7d('0x9')](),controller[_0x9e7d('0xb')]);router['get'](_0x9e7d('0xc'),auth[_0x9e7d('0x9')](),controller[_0x9e7d('0xd')]);router[_0x9e7d('0xa')](_0x9e7d('0xe'),auth[_0x9e7d('0x9')](),controller['getSections']);router[_0x9e7d('0xa')](_0x9e7d('0xf'),auth['isAuthenticated'](),controller[_0x9e7d('0x10')]);router[_0x9e7d('0x11')]('/',auth[_0x9e7d('0x9')](),controller[_0x9e7d('0x12')]);router['post']('/:id/clone',auth[_0x9e7d('0x9')](),controller['clone']);router['post'](_0x9e7d('0xe'),auth[_0x9e7d('0x9')](),controller[_0x9e7d('0x13')]);router[_0x9e7d('0x11')](_0x9e7d('0xf'),auth['isAuthenticated'](),controller['addResources']);router['put'](_0x9e7d('0xc'),auth['isAuthenticated'](),controller[_0x9e7d('0x14')]);router[_0x9e7d('0x15')](_0x9e7d('0xc'),auth[_0x9e7d('0x9')](),controller[_0x9e7d('0x16')]);router['delete'](_0x9e7d('0xe'),auth[_0x9e7d('0x9')](),controller[_0x9e7d('0x17')]);router[_0x9e7d('0x15')](_0x9e7d('0xf'),auth[_0x9e7d('0x9')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index da9a420..d5c3c2c 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 _0x52be=['crudPermissions','join','getDataValue','BOOLEAN','sequelize','STRING'];(function(_0x16a019,_0x165f31){var _0x4f2465=function(_0x329143){while(--_0x329143){_0x16a019['push'](_0x16a019['shift']());}};_0x4f2465(++_0x165f31);}(_0x52be,0x88));var _0xe52b=function(_0xa8369a,_0x3d2319){_0xa8369a=_0xa8369a-0x0;var _0x4b74b7=_0x52be[_0xa8369a];return _0x4b74b7;};'use strict';var Sequelize=require(_0xe52b('0x0'));module['exports']={'name':{'type':Sequelize[_0xe52b('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xe52b('0x1')],'set':function(_0x2f479b){this['setDataValue'](_0xe52b('0x2'),_0x2f479b?_0x2f479b[_0xe52b('0x3')](''):[]);},'get':function(){return this[_0xe52b('0x4')]('crudPermissions')?this['getDataValue'](_0xe52b('0x2'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xe52b('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xe52b('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xe52b('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xe52b('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xe52b('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xe52b('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xe52b('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xcacf=['getDataValue','split','BOOLEAN','STRING','name','setDataValue','crudPermissions','join'];(function(_0x53dc2f,_0x352f5f){var _0x2db8b6=function(_0x1c82c9){while(--_0x1c82c9){_0x53dc2f['push'](_0x53dc2f['shift']());}};_0x2db8b6(++_0x352f5f);}(_0xcacf,0x1bb));var _0xfcac=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xcacf[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfcac('0x0')],'allowNull':![],'unique':_0xfcac('0x1')},'crudPermissions':{'type':Sequelize[_0xfcac('0x0')],'set':function(_0x5284bb){this[_0xfcac('0x2')](_0xfcac('0x3'),_0x5284bb?_0x5284bb[_0xfcac('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xfcac('0x3'))?this[_0xfcac('0x5')](_0xfcac('0x3'))[_0xfcac('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xfcac('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xfcac('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xfcac('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xfcac('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xfcac('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfcac('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 567e1bd..ab85980 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 _0x19cb=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','limit','undefined','offset','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','create','body','clone','find','get','crudPermissions','omit','createdAt','updatedAt','sequelize','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','addResources','transaction','bulkCreate','removeResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','rimraf','zip-dir','request-promise','bluebird','sox','to-csv','lodash'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x19cb,0x146));var _0xb19c=function(_0x284308,_0x379669){_0x284308=_0x284308-0x0;var _0x1a1f0a=_0x19cb[_0x284308];return _0x1a1f0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb19c('0x0'));var zipdir=require(_0xb19c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb19c('0x2'));var moment=require('moment');var BPromise=require(_0xb19c('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xb19c('0x4'));var csv=require(_0xb19c('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb19c('0x6'));var squel=require(_0xb19c('0x7'));var crypto=require(_0xb19c('0x8'));var jsforce=require(_0xb19c('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb19c('0xa'));var Papa=require(_0xb19c('0xb'));var Redis=require(_0xb19c('0xc'));var authService=require(_0xb19c('0xd'));var qs=require(_0xb19c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb19c('0xf'));var logger=require(_0xb19c('0x10'))(_0xb19c('0x11'));var utils=require(_0xb19c('0x12'));var config=require(_0xb19c('0x13'));var licenseUtil=require(_0xb19c('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xb19c('0x15')],{'host':_0xb19c('0x16'),'port':0x18eb});var socket=require(_0xb19c('0x17'))(new Redis(config['redis']));require(_0xb19c('0x18'))[_0xb19c('0x19')](socket);function respondWithStatusCode(_0x3be3f4,_0x547c77){_0x547c77=_0x547c77||0xcc;return function(_0x12f4b1){if(_0x12f4b1){return _0x3be3f4['sendStatus'](_0x547c77);}return _0x3be3f4[_0xb19c('0x1a')](_0x547c77)[_0xb19c('0x1b')]();};}function respondWithResult(_0x2d239c,_0x1eec19){_0x1eec19=_0x1eec19||0xc8;return function(_0x11eea0){if(_0x11eea0){return _0x2d239c['status'](_0x1eec19)[_0xb19c('0x1c')](_0x11eea0);}};}function respondWithFilteredResult(_0x3b598c,_0xf3a2fa){return function(_0x2b2815){if(_0x2b2815){var _0x2be2d0=typeof _0xf3a2fa['offset']==='undefined'&&typeof _0xf3a2fa[_0xb19c('0x1d')]===_0xb19c('0x1e');var _0x547809=_0x2b2815['count'];var _0x285590=_0x2be2d0?0x0:_0xf3a2fa[_0xb19c('0x1f')];var _0xe42795=_0x2be2d0?_0x2b2815[_0xb19c('0x20')]:_0xf3a2fa['offset']+_0xf3a2fa[_0xb19c('0x1d')];var _0x14daf5;if(_0xe42795>=_0x547809){_0xe42795=_0x547809;_0x14daf5=0xc8;}else{_0x14daf5=0xce;}_0x3b598c[_0xb19c('0x1a')](_0x14daf5);return _0x3b598c['set'](_0xb19c('0x21'),_0x285590+'-'+_0xe42795+'/'+_0x547809)[_0xb19c('0x1c')](_0x2b2815);}return null;};}function patchUpdates(_0x186f47){return function(_0x2ce819){try{jsonpatch[_0xb19c('0x22')](_0x2ce819,_0x186f47,!![]);}catch(_0x5aaf38){return BPromise['reject'](_0x5aaf38);}return _0x2ce819[_0xb19c('0x23')]();};}function saveUpdates(_0x5c56cc,_0x7b3f7a){return function(_0x562386){if(_0x562386){return _0x562386[_0xb19c('0x24')](_0x5c56cc)[_0xb19c('0x25')](function(_0x2877a9){return _0x2877a9;});}return null;};}function removeEntity(_0x3542f7,_0x41bde5){return function(_0x1774fc){if(_0x1774fc){return _0x1774fc[_0xb19c('0x26')]()[_0xb19c('0x25')](function(){_0x3542f7['status'](0xcc)[_0xb19c('0x1b')]();});}};}function handleEntityNotFound(_0x259569,_0x1c18fe){return function(_0x318c5d){if(!_0x318c5d){_0x259569['sendStatus'](0x194);}return _0x318c5d;};}function handleError(_0x5d9bcd,_0x5f13fb){_0x5f13fb=_0x5f13fb||0x1f4;return function(_0xaca236){logger[_0xb19c('0x27')](_0xaca236[_0xb19c('0x28')]);if(_0xaca236[_0xb19c('0x29')]){delete _0xaca236[_0xb19c('0x29')];}_0x5d9bcd['status'](_0x5f13fb)[_0xb19c('0x2a')](_0xaca236);};}exports[_0xb19c('0x2b')]=function(_0x12fc7c,_0x405088){var _0x11ddf3={},_0x1b91d5={},_0x7b42f5={'count':0x0,'rows':[]};var _0x4bd235=_[_0xb19c('0x2c')](db[_0xb19c('0x2d')]['rawAttributes'],function(_0x10ddc7){return{'name':_0x10ddc7[_0xb19c('0x2e')],'type':_0x10ddc7[_0xb19c('0x2f')][_0xb19c('0x30')]};});_0x1b91d5[_0xb19c('0x31')]=_['map'](_0x4bd235,'name');_0x1b91d5[_0xb19c('0x32')]=_[_0xb19c('0x33')](_0x12fc7c[_0xb19c('0x32')]);_0x1b91d5['filters']=_[_0xb19c('0x34')](_0x1b91d5[_0xb19c('0x31')],_0x1b91d5[_0xb19c('0x32')]);_0x11ddf3[_0xb19c('0x35')]=_[_0xb19c('0x34')](_0x1b91d5[_0xb19c('0x31')],qs[_0xb19c('0x36')](_0x12fc7c[_0xb19c('0x32')][_0xb19c('0x36')]));_0x11ddf3['attributes']=_0x11ddf3[_0xb19c('0x35')][_0xb19c('0x37')]?_0x11ddf3['attributes']:_0x1b91d5['model'];if(!_0x12fc7c[_0xb19c('0x32')][_0xb19c('0x38')](_0xb19c('0x39'))){_0x11ddf3['limit']=qs[_0xb19c('0x1d')](_0x12fc7c['query'][_0xb19c('0x1d')]);_0x11ddf3['offset']=qs[_0xb19c('0x1f')](_0x12fc7c[_0xb19c('0x32')][_0xb19c('0x1f')]);}_0x11ddf3[_0xb19c('0x3a')]=qs[_0xb19c('0x3b')](_0x12fc7c[_0xb19c('0x32')][_0xb19c('0x3b')]);_0x11ddf3[_0xb19c('0x3c')]=qs[_0xb19c('0x3d')](_[_0xb19c('0x3e')](_0x12fc7c[_0xb19c('0x32')],_0x1b91d5['filters']),_0x4bd235);if(_0x12fc7c[_0xb19c('0x32')][_0xb19c('0x3f')]){_0x11ddf3[_0xb19c('0x3c')]=_[_0xb19c('0x40')](_0x11ddf3[_0xb19c('0x3c')],{'$or':_[_0xb19c('0x2c')](_0x4bd235,function(_0x5c4f10){if(_0x5c4f10[_0xb19c('0x2f')]!==_0xb19c('0x41')){var _0x5bde43={};_0x5bde43[_0x5c4f10[_0xb19c('0x29')]]={'$like':'%'+_0x12fc7c['query'][_0xb19c('0x3f')]+'%'};return _0x5bde43;}})});}_0x11ddf3=_[_0xb19c('0x40')]({},_0x11ddf3,_0x12fc7c[_0xb19c('0x42')]);var _0x238524={'where':_0x11ddf3[_0xb19c('0x3c')]};return db[_0xb19c('0x2d')][_0xb19c('0x20')](_0x238524)['then'](function(_0x584a57){_0x7b42f5[_0xb19c('0x20')]=_0x584a57;if(_0x12fc7c['query'][_0xb19c('0x43')]){_0x11ddf3[_0xb19c('0x44')]=[{'all':!![]}];}return db[_0xb19c('0x2d')][_0xb19c('0x45')](_0x11ddf3);})['then'](function(_0x48b108){_0x7b42f5['rows']=_0x48b108;return _0x7b42f5;})[_0xb19c('0x25')](respondWithFilteredResult(_0x405088,_0x11ddf3))[_0xb19c('0x46')](handleError(_0x405088,null));};exports[_0xb19c('0x47')]=function(_0x34480b,_0x13feda){var _0x40b02a={'raw':![],'where':{'id':_0x34480b[_0xb19c('0x48')]['id']}},_0x2568f2={};_0x2568f2[_0xb19c('0x31')]=_['keys'](db[_0xb19c('0x2d')][_0xb19c('0x49')]);_0x2568f2[_0xb19c('0x32')]=_[_0xb19c('0x33')](_0x34480b[_0xb19c('0x32')]);_0x2568f2[_0xb19c('0x3d')]=_[_0xb19c('0x34')](_0x2568f2[_0xb19c('0x31')],_0x2568f2[_0xb19c('0x32')]);_0x40b02a[_0xb19c('0x35')]=_[_0xb19c('0x34')](_0x2568f2['model'],qs[_0xb19c('0x36')](_0x34480b[_0xb19c('0x32')][_0xb19c('0x36')]));_0x40b02a[_0xb19c('0x35')]=_0x40b02a['attributes']['length']?_0x40b02a[_0xb19c('0x35')]:_0x2568f2[_0xb19c('0x31')];if(_0x34480b[_0xb19c('0x32')][_0xb19c('0x43')]){_0x40b02a['include']=[{'all':!![]}];}_0x40b02a=_[_0xb19c('0x40')]({},_0x40b02a,_0x34480b[_0xb19c('0x42')]);return db['UserProfile']['find'](_0x40b02a)[_0xb19c('0x25')](handleEntityNotFound(_0x13feda,null))[_0xb19c('0x25')](respondWithResult(_0x13feda,null))[_0xb19c('0x46')](handleError(_0x13feda,null));};exports[_0xb19c('0x4a')]=function(_0x2f4edd,_0x15f019){return db[_0xb19c('0x2d')][_0xb19c('0x4a')](_0x2f4edd[_0xb19c('0x4b')],{})['then'](respondWithResult(_0x15f019,0xc9))['catch'](handleError(_0x15f019,null));};exports[_0xb19c('0x4c')]=function(_0x1304f2,_0x55968c){var _0x37b630={'where':{'id':_0x1304f2[_0xb19c('0x48')]['id']}},_0x33e7a3={};_0x33e7a3[_0xb19c('0x31')]=_[_0xb19c('0x33')](db[_0xb19c('0x2d')][_0xb19c('0x49')]);_0x37b630['attributes']=_[_0xb19c('0x34')](_0x33e7a3[_0xb19c('0x31')],qs['fields'](_0x1304f2[_0xb19c('0x32')]['fields']));_0x37b630['attributes']=_0x37b630['attributes'][_0xb19c('0x37')]?_0x37b630[_0xb19c('0x35')]:_0x33e7a3[_0xb19c('0x31')];if(_0x1304f2[_0xb19c('0x32')][_0xb19c('0x43')]){_0x37b630['include']=[{'all':!![]}];}_0x37b630=_[_0xb19c('0x40')]({},_0x37b630,_0x1304f2[_0xb19c('0x42')]);return db[_0xb19c('0x2d')][_0xb19c('0x4d')](_0x37b630)[_0xb19c('0x25')](handleEntityNotFound(_0x55968c,null))['then'](function(_0x18f7c2){if(_0x18f7c2){var _0x5e2236=_0x18f7c2[_0xb19c('0x4e')]({'plain':!![]});_0x5e2236=qs['omit'](_0x5e2236,['id','createdAt','updatedAt',_0xb19c('0x4f')]);_0x1304f2['body']=_[_0xb19c('0x50')](_0x1304f2[_0xb19c('0x4b')],['id',_0xb19c('0x51'),_0xb19c('0x52')]);return db[_0xb19c('0x53')]['transaction'](function(_0x13c621){return db[_0xb19c('0x2d')]['create'](_[_0xb19c('0x40')](_0x5e2236,_0x1304f2[_0xb19c('0x4b')]),{'include':_0x1304f2[_0xb19c('0x32')][_0xb19c('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x13c621})[_0xb19c('0x25')](function(_0x32246b){var _0x359eed=_0x32246b['get']({'plain':!![]});return db[_0xb19c('0x54')][_0xb19c('0x45')]({'where':{'userProfileId':_0x1304f2[_0xb19c('0x48')]['id']},'raw':!![]})['then'](function(_0x4b3288){if(_0x4b3288){return BPromise['each'](_0x4b3288,function(_0x4c8e9c){return new BPromise(function(_0x14b104,_0x2334e5){if(_0x4c8e9c[_0xb19c('0x55')]===null||_0x4c8e9c[_0xb19c('0x55')]===0x1)_0x14b104(null);return db[_0xb19c('0x56')][_0xb19c('0x45')]({'where':{'sectionId':_0x4c8e9c['id']},'raw':!![]})[_0xb19c('0x25')](function(_0x22fcfa){var _0xa51a15=_['map'](_0x22fcfa,function(_0x296450){return qs['omit'](_0x296450,['id','createdAt','updatedAt',_0xb19c('0x57')]);});_0x14b104(_0xa51a15);})[_0xb19c('0x46')](function(_0xfd718b){_0x2334e5(_0xfd718b);});})[_0xb19c('0x25')](function(_0x27c79c){var _0x14e9db=qs[_0xb19c('0x50')](_0x4c8e9c,['id',_0xb19c('0x51'),_0xb19c('0x52')]);_0x14e9db[_0xb19c('0x58')]=_0x359eed['id'];if(_0x27c79c)_0x14e9db[_0xb19c('0x59')]=_0x27c79c;return _0x14e9db;})[_0xb19c('0x25')](function(_0x58bdde){return db['UserProfileSection'][_0xb19c('0x4a')](_0x58bdde,{'include':[{'model':db[_0xb19c('0x56')],'as':_0xb19c('0x59')}],'raw':!![],'transaction':_0x13c621});});})[_0xb19c('0x25')](function(){return _0x359eed;});}});});});}})[_0xb19c('0x25')](respondWithResult(_0x55968c,0xc9))[_0xb19c('0x46')](handleError(_0x55968c,null));};exports['update']=function(_0x21acd1,_0x1d5d65){if(_0x21acd1[_0xb19c('0x4b')]['id']){delete _0x21acd1[_0xb19c('0x4b')]['id'];}return db[_0xb19c('0x2d')][_0xb19c('0x4d')]({'where':{'id':_0x21acd1[_0xb19c('0x48')]['id']}})[_0xb19c('0x25')](handleEntityNotFound(_0x1d5d65,null))[_0xb19c('0x25')](saveUpdates(_0x21acd1[_0xb19c('0x4b')],null))['then'](respondWithResult(_0x1d5d65,null))[_0xb19c('0x46')](handleError(_0x1d5d65,null));};exports['destroy']=function(_0xadd092,_0x444435){return db[_0xb19c('0x2d')][_0xb19c('0x4d')]({'where':{'id':_0xadd092[_0xb19c('0x48')]['id']}})[_0xb19c('0x25')](handleEntityNotFound(_0x444435,null))['then'](removeEntity(_0x444435,null))['catch'](handleError(_0x444435,null));};exports[_0xb19c('0x5a')]=function(_0x46fbd8,_0x3a37c7){return db[_0xb19c('0x2d')][_0xb19c('0x5a')]()[_0xb19c('0x25')](respondWithResult(_0x3a37c7,null))[_0xb19c('0x46')](handleError(_0x3a37c7,null));};exports['addSections']=function(_0x3983d9,_0x5c4e77){var _0x57e3e3=_0x3983d9[_0xb19c('0x4b')];return db[_0xb19c('0x2d')][_0xb19c('0x4d')]({'where':{'id':_0x3983d9[_0xb19c('0x48')]['id']}})[_0xb19c('0x25')](handleEntityNotFound(_0x5c4e77,null))[_0xb19c('0x25')](function(_0x36cc0a){if(_0x36cc0a){return db[_0xb19c('0x53')]['transaction'](function(_0x36c7a8){return db[_0xb19c('0x54')]['destroy']({'where':{'userProfileId':_0x3983d9[_0xb19c('0x48')]['id'],'sectionId':_[_0xb19c('0x2c')](_0x57e3e3,function(_0x4a1f75){return _0x4a1f75[_0xb19c('0x57')];})},'transaction':_0x36c7a8})[_0xb19c('0x25')](function(){var _0x204b23=_[_0xb19c('0x2c')](_0x57e3e3,function(_0x589908){_0x589908[_0xb19c('0x58')]=_0x3983d9[_0xb19c('0x48')]['id'];return _0x589908;});var _0x485689=[];return BPromise[_0xb19c('0x5b')](_0x204b23,function(_0x26e0c9){return db['UserProfileSection']['create'](_0x26e0c9,{'include':[{'model':db[_0xb19c('0x56')],'as':_0xb19c('0x59')}],'raw':!![],'transaction':_0x36c7a8})[_0xb19c('0x25')](function(_0x488d63){_0x485689[_0xb19c('0x5c')](_0x488d63[_0xb19c('0x4e')]({'plain':!![]}));});})[_0xb19c('0x25')](function(){return _0x485689;});});});}})[_0xb19c('0x25')](function(_0x431c41){return _0x431c41;})[_0xb19c('0x25')](respondWithResult(_0x5c4e77,null))[_0xb19c('0x46')](handleError(_0x5c4e77,null));};exports[_0xb19c('0x5d')]=function(_0x2ff038,_0x4767a1){var _0x164034;return db[_0xb19c('0x2d')][_0xb19c('0x4d')]({'where':{'id':_0x2ff038[_0xb19c('0x48')]['id']},'attributes':['id','name']})[_0xb19c('0x25')](handleEntityNotFound(_0x4767a1,null))['then'](function(_0x371050){if(_0x371050){_0x164034=_0x371050;return db[_0xb19c('0x54')]['destroy']({'where':{'userProfileId':_0x2ff038[_0xb19c('0x48')]['id'],'sectionId':_0x2ff038[_0xb19c('0x32')][_0xb19c('0x5e')]}});}})[_0xb19c('0x25')](function(){return _0x164034;})['then'](respondWithStatusCode(_0x4767a1,null))[_0xb19c('0x46')](handleError(_0x4767a1,null));};exports[_0xb19c('0x5f')]=function(_0x142d76,_0x1ace99){var _0x3989a6=[];var _0x2c94e3=[];return db['UserProfileSection'][_0xb19c('0x45')]({'where':{'userProfileId':_0x142d76[_0xb19c('0x48')]['id']},'raw':!![]})[_0xb19c('0x25')](function(_0x19c937){_0x3989a6=_[_0xb19c('0x3f')](_0x19c937,function(_0x122acc){return _0x122acc[_0xb19c('0x60')]===0x1||_[_0xb19c('0x61')]([0x3eb,0x709],_0x122acc[_0xb19c('0x57')]);});if(!_[_0xb19c('0x62')](_0x3989a6)){return _[_0xb19c('0x2c')](_0x3989a6,function(_0x291409){return _0x291409[_0xb19c('0x57')];});}else{return;}})['then'](function(_0x10bd3f){if(_0x10bd3f)_0x2c94e3=_0x10bd3f;if(_[_0xb19c('0x61')](_0x2c94e3,0x64)){var _0x50df2e=_[_0xb19c('0x4d')](_0x3989a6,{'sectionId':0x64});return hasDefaultDashboard(_0x50df2e)[_0xb19c('0x25')](function(_0x474aa){return _[_0xb19c('0x2c')](_0x3989a6,function(_0x1cbb0f){if(_0x1cbb0f[_0xb19c('0x57')]===0x64){_0x1cbb0f[_0xb19c('0x63')]=_0x474aa;}return _0x1cbb0f;});});}else{return;}})[_0xb19c('0x25')](function(_0x28c0d1){if(_0x28c0d1)_0x3989a6=_0x28c0d1;if(_['includes'](_0x2c94e3,0x3eb)){var _0x4d0383=_[_0xb19c('0x4d')](_0x3989a6,{'sectionId':0x3eb});return getCustomDashboards(_0x4d0383)[_0xb19c('0x25')](function(_0x2aa155){return _['map'](_0x3989a6,function(_0x46959d){if(_0x4d0383[_0xb19c('0x60')]){if(_0x46959d[_0xb19c('0x57')]===0x3eb){_0x46959d['subsections']=_0x2aa155;}}else{if(_0x46959d[_0xb19c('0x57')]===0x64){_0x46959d[_0xb19c('0x63')]=_0x2aa155;}}return _0x46959d;});});}else{return;}})[_0xb19c('0x25')](function(_0x4bb988){if(_0x4bb988)_0x3989a6=_0x4bb988;if(_[_0xb19c('0x61')](_0x2c94e3,0x709)){var _0x56c4aa=_[_0xb19c('0x4d')](_0x3989a6,{'sectionId':0x709});return getPlugins(_0x56c4aa)[_0xb19c('0x25')](function(_0x216bd9){if(_0x56c4aa['enabled']){return _[_0xb19c('0x2c')](_0x3989a6,function(_0x17393e){if(_0x17393e[_0xb19c('0x57')]===0x709){_0x17393e[_0xb19c('0x63')]=_0x216bd9;}return _0x17393e;});}else{var _0x27e4f1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x216bd9};var _0x341625=_[_0xb19c('0x2c')](_0x3989a6);_0x341625[_0xb19c('0x5c')](_0x27e4f1);return _0x341625;}});}else{return;}})[_0xb19c('0x25')](function(_0x2c29af){if(_0x2c29af)_0x3989a6=_0x2c29af;return _[_0xb19c('0x3f')](_0x3989a6,[_0xb19c('0x60'),0x1]);})[_0xb19c('0x25')](respondWithResult(_0x1ace99,null))['catch'](handleError(_0x1ace99,null));};function hasDefaultDashboard(_0x8e0d97){var _0x105801=[0x65];return new BPromise(function(_0x312550,_0xea6a8f){try{if(_0x8e0d97['autoAssociation']){_0x312550(_0x105801);}else{return db[_0xb19c('0x56')]['findOne']({'where':{'sectionId':_0x8e0d97['id']},'raw':!![]})['then'](function(_0x4af856){_0x4af856?_0x312550(_0x105801):_0x312550();});}}catch(_0x43b64a){_0xea6a8f(_0x43b64a);}});}function getCustomDashboards(_0x5678da){var _0x33f82e=[];return new BPromise(function(_0x545676,_0x4d0b61){try{if(_0x5678da[_0xb19c('0x55')]){return db[_0xb19c('0x64')][_0xb19c('0x45')]({'raw':!![]})['then'](function(_0x4d83f8){_0x4d83f8[_0xb19c('0x65')](function(_0x1c6d21){_0x33f82e[_0xb19c('0x5c')](_0x1c6d21['id']+0x1869f);});_0x545676(_0x33f82e);});}else{return db['UserProfileResource'][_0xb19c('0x45')]({'where':{'sectionId':_0x5678da['id']},'raw':!![]})[_0xb19c('0x25')](function(_0x14d416){_0x14d416[_0xb19c('0x65')](function(_0x3158d6){_0x33f82e[_0xb19c('0x5c')](_0x3158d6[_0xb19c('0x66')]+0x1869f);});_0x545676(_0x33f82e);});}}catch(_0x23c89f){_0x4d0b61(_0x23c89f);}});}function getPlugins(_0x4a57bd){var _0x108d95=[];return new BPromise(function(_0x1bd006,_0x362b8b){try{if(_0x4a57bd[_0xb19c('0x55')]){return db[_0xb19c('0x67')]['findAll']({'raw':!![]})['then'](function(_0x29b0e6){_0x29b0e6['forEach'](function(_0xdff8b2){_0x108d95[_0xb19c('0x5c')](_0xdff8b2['id']+0x15b38);});_0x1bd006(_0x108d95);});}else{return db[_0xb19c('0x56')]['findAll']({'where':{'sectionId':_0x4a57bd['id']},'raw':!![]})[_0xb19c('0x25')](function(_0x20cf96){_0x20cf96[_0xb19c('0x65')](function(_0x5dd872){_0x108d95['push'](_0x5dd872[_0xb19c('0x66')]+0x15b38);});_0x1bd006(_0x108d95);});}}catch(_0x51d142){_0x362b8b(_0x51d142);}});}exports[_0xb19c('0x68')]=function(_0x3c5bbb,_0x1e467f){return db['UserProfile'][_0xb19c('0x4d')]({'where':{'id':_0x3c5bbb[_0xb19c('0x48')]['id']}})[_0xb19c('0x25')](handleEntityNotFound(_0x1e467f,null))[_0xb19c('0x25')](function(_0x2a8503){if(_0x2a8503){return db[_0xb19c('0x53')][_0xb19c('0x69')](function(_0x4ada4b){return db[_0xb19c('0x54')][_0xb19c('0x45')]({'where':{'userProfileId':_0x3c5bbb['params']['id']},'attributes':['id'],'raw':!![]})[_0xb19c('0x25')](function(_0x3fe6c6){if(_0x3fe6c6){return db[_0xb19c('0x54')][_0xb19c('0x26')]({'where':{'userProfileId':_0x3c5bbb[_0xb19c('0x48')]['id'],'id':_[_0xb19c('0x2c')](_0x3fe6c6,function(_0x3a9ac8){return _0x3a9ac8['id'];})},'transaction':_0x4ada4b});}})[_0xb19c('0x25')](function(_0x4906cc){var _0x37cd70=_[_0xb19c('0x2c')](_0x3c5bbb[_0xb19c('0x4b')],function(_0xc48227){_0xc48227[_0xb19c('0x58')]=_0x3c5bbb[_0xb19c('0x48')]['id'];return _0xc48227;});return db[_0xb19c('0x54')]['bulkCreate'](_0x37cd70,{'raw':!![],'transaction':_0x4ada4b});})[_0xb19c('0x25')](function(_0x1305a0){var _0x3b677a=_[_0xb19c('0x3f')](_[_0xb19c('0x2c')](_0x1305a0,function(_0x5698d0){return _0x5698d0[_0xb19c('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x3b677a){return db[_0xb19c('0x54')][_0xb19c('0x45')]({'where':{'userProfileId':_0x3c5bbb[_0xb19c('0x48')]['id'],'sectionId':_[_0xb19c('0x2c')](_0x3b677a,function(_0x47777f){return _0x47777f[_0xb19c('0x57')];})},'attributes':['id',_0xb19c('0x57')],'raw':!![]})[_0xb19c('0x25')](function(_0x5910e8){var _0x1a7216=_['map'](_0x3c5bbb[_0xb19c('0x4b')],function(_0x84213c){_0x84213c[_0xb19c('0x58')]=_0x3c5bbb['params']['id'];return _0x84213c;});return db[_0xb19c('0x56')][_0xb19c('0x6a')](_0x1a7216,{'raw':!![],'transaction':_0x4ada4b});});}})['catch'](handleError(_0x1e467f,null));});}})[_0xb19c('0x25')](function(_0x32428b){var _0x8bc779=_[_0xb19c('0x2c')](_0x32428b,function(_0xc50e9){return _0xc50e9['get']({'plain':!![]});});})[_0xb19c('0x25')](respondWithResult(_0x1e467f,null))[_0xb19c('0x46')](handleError(_0x1e467f,null));};exports[_0xb19c('0x6b')]=function(_0x522b50,_0x33d784,_0xe094cd){return db[_0xb19c('0x2d')][_0xb19c('0x4d')]({'where':{'id':_0x522b50[_0xb19c('0x48')]['id']}})[_0xb19c('0x25')](handleEntityNotFound(_0x33d784,null))[_0xb19c('0x25')](function(_0x18ea2b){if(_0x18ea2b){return _0x18ea2b[_0xb19c('0x6b')](_0x522b50['query'][_0xb19c('0x5e')]);}})[_0xb19c('0x25')](respondWithStatusCode(_0x33d784,null))['catch'](handleError(_0x33d784,null));};exports['getResources']=function(_0x304883,_0x458211){var _0x2d12cc={};if(!_0x304883[_0xb19c('0x32')][_0xb19c('0x6c')])throw new Error(_0xb19c('0x6d'));if(!_0x304883[_0xb19c('0x32')][_0xb19c('0x38')](_0xb19c('0x39'))){_0x2d12cc['limit']=qs[_0xb19c('0x1d')](_0x304883[_0xb19c('0x32')][_0xb19c('0x1d')]);_0x2d12cc[_0xb19c('0x1f')]=qs[_0xb19c('0x1f')](_0x304883[_0xb19c('0x32')][_0xb19c('0x1f')]);}return db[_0xb19c('0x2d')][_0xb19c('0x4d')]({'where':{'id':_0x304883['params']['id']}})[_0xb19c('0x25')](function(_0x58f102){if(!_0x58f102)throw new Error(_0xb19c('0x6e')+_0x304883['params']['id']);return db['UserProfile']['getResources'](_0x304883);})[_0xb19c('0x25')](respondWithFilteredResult(_0x458211,_0x2d12cc))[_0xb19c('0x46')](handleError(_0x458211,null));}; \ No newline at end of file +var _0x62cf=['addSections','transaction','userProfileId','push','removeSections','getSections','enabled','includes','sectionId','isEmpty','subsections','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','Missing\x20section\x20parameter','nolimit','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','destroy','error','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','UserProfile','findAll','rows','show','params','length','include','find','create','body','catch','get','createdAt','crudPermissions','omit','updatedAt','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','Resources','update','describe'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x62cf,0x81));var _0xf62c=function(_0x3754fc,_0x8c0b13){_0x3754fc=_0x3754fc-0x0;var _0x344f66=_0x62cf[_0x3754fc];return _0x344f66;};'use strict';var emlformat=require(_0xf62c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf62c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf62c('0x2'));var moment=require(_0xf62c('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf62c('0x4'));var path=require(_0xf62c('0x5'));var sox=require(_0xf62c('0x6'));var csv=require(_0xf62c('0x7'));var ejs=require(_0xf62c('0x8'));var fs=require('fs');var fs_extra=require(_0xf62c('0x9'));var _=require(_0xf62c('0xa'));var squel=require(_0xf62c('0xb'));var crypto=require(_0xf62c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf62c('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf62c('0xe'));var Papa=require(_0xf62c('0xf'));var Redis=require(_0xf62c('0x10'));var authService=require(_0xf62c('0x11'));var qs=require(_0xf62c('0x12'));var as=require(_0xf62c('0x13'));var hardwareService=require(_0xf62c('0x14'));var logger=require(_0xf62c('0x15'))(_0xf62c('0x16'));var utils=require(_0xf62c('0x17'));var config=require(_0xf62c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf62c('0x19'))['db'];config['redis']=_['defaults'](config[_0xf62c('0x1a')],{'host':_0xf62c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf62c('0x1a')]));require(_0xf62c('0x1c'))['register'](socket);function respondWithStatusCode(_0x1c47fa,_0x4a5cba){_0x4a5cba=_0x4a5cba||0xcc;return function(_0x265253){if(_0x265253){return _0x1c47fa[_0xf62c('0x1d')](_0x4a5cba);}return _0x1c47fa['status'](_0x4a5cba)[_0xf62c('0x1e')]();};}function respondWithResult(_0x3ffb03,_0x55bba7){_0x55bba7=_0x55bba7||0xc8;return function(_0x29aece){if(_0x29aece){return _0x3ffb03[_0xf62c('0x1f')](_0x55bba7)[_0xf62c('0x20')](_0x29aece);}};}function respondWithFilteredResult(_0x5c087b,_0x25c80c){return function(_0xc7da63){if(_0xc7da63){var _0x8180f3=typeof _0x25c80c[_0xf62c('0x21')]===_0xf62c('0x22')&&typeof _0x25c80c['limit']===_0xf62c('0x22');var _0xad689c=_0xc7da63[_0xf62c('0x23')];var _0x55a475=_0x8180f3?0x0:_0x25c80c['offset'];var _0x3ae15e=_0x8180f3?_0xc7da63[_0xf62c('0x23')]:_0x25c80c[_0xf62c('0x21')]+_0x25c80c[_0xf62c('0x24')];var _0x23bf2b;if(_0x3ae15e>=_0xad689c){_0x3ae15e=_0xad689c;_0x23bf2b=0xc8;}else{_0x23bf2b=0xce;}_0x5c087b['status'](_0x23bf2b);return _0x5c087b['set']('Content-Range',_0x55a475+'-'+_0x3ae15e+'/'+_0xad689c)[_0xf62c('0x20')](_0xc7da63);}return null;};}function patchUpdates(_0x1c883c){return function(_0x4490ed){try{jsonpatch[_0xf62c('0x25')](_0x4490ed,_0x1c883c,!![]);}catch(_0x34bf70){return BPromise[_0xf62c('0x26')](_0x34bf70);}return _0x4490ed['save']();};}function saveUpdates(_0x33b572,_0x120077){return function(_0x424660){if(_0x424660){return _0x424660['update'](_0x33b572)['then'](function(_0x48541f){return _0x48541f;});}return null;};}function removeEntity(_0x496992,_0x2165ae){return function(_0x5c4e52){if(_0x5c4e52){return _0x5c4e52[_0xf62c('0x27')]()['then'](function(){_0x496992[_0xf62c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9da128,_0x41c49f){return function(_0x439f48){if(!_0x439f48){_0x9da128[_0xf62c('0x1d')](0x194);}return _0x439f48;};}function handleError(_0xbaa5a0,_0x4d00ab){_0x4d00ab=_0x4d00ab||0x1f4;return function(_0x1ecd60){logger[_0xf62c('0x28')](_0x1ecd60[_0xf62c('0x29')]);if(_0x1ecd60[_0xf62c('0x2a')]){delete _0x1ecd60[_0xf62c('0x2a')];}_0xbaa5a0[_0xf62c('0x1f')](_0x4d00ab)[_0xf62c('0x2b')](_0x1ecd60);};}exports[_0xf62c('0x2c')]=function(_0x19b820,_0x1862eb){var _0x554fce={},_0x398d1c={},_0x1aaeb9={'count':0x0,'rows':[]};var _0x56ec5f=_[_0xf62c('0x2d')](db['UserProfile'][_0xf62c('0x2e')],function(_0x20895e){return{'name':_0x20895e['fieldName'],'type':_0x20895e['type'][_0xf62c('0x2f')]};});_0x398d1c[_0xf62c('0x30')]=_['map'](_0x56ec5f,_0xf62c('0x2a'));_0x398d1c['query']=_[_0xf62c('0x31')](_0x19b820[_0xf62c('0x32')]);_0x398d1c[_0xf62c('0x33')]=_[_0xf62c('0x34')](_0x398d1c['model'],_0x398d1c['query']);_0x554fce[_0xf62c('0x35')]=_['intersection'](_0x398d1c[_0xf62c('0x30')],qs['fields'](_0x19b820[_0xf62c('0x32')][_0xf62c('0x36')]));_0x554fce[_0xf62c('0x35')]=_0x554fce[_0xf62c('0x35')]['length']?_0x554fce[_0xf62c('0x35')]:_0x398d1c[_0xf62c('0x30')];if(!_0x19b820[_0xf62c('0x32')][_0xf62c('0x37')]('nolimit')){_0x554fce[_0xf62c('0x24')]=qs[_0xf62c('0x24')](_0x19b820['query'][_0xf62c('0x24')]);_0x554fce[_0xf62c('0x21')]=qs[_0xf62c('0x21')](_0x19b820[_0xf62c('0x32')][_0xf62c('0x21')]);}_0x554fce[_0xf62c('0x38')]=qs[_0xf62c('0x39')](_0x19b820[_0xf62c('0x32')][_0xf62c('0x39')]);_0x554fce[_0xf62c('0x3a')]=qs[_0xf62c('0x33')](_[_0xf62c('0x3b')](_0x19b820[_0xf62c('0x32')],_0x398d1c[_0xf62c('0x33')]),_0x56ec5f);if(_0x19b820[_0xf62c('0x32')][_0xf62c('0x3c')]){_0x554fce[_0xf62c('0x3a')]=_[_0xf62c('0x3d')](_0x554fce[_0xf62c('0x3a')],{'$or':_[_0xf62c('0x2d')](_0x56ec5f,function(_0x499d19){if(_0x499d19[_0xf62c('0x3e')]!==_0xf62c('0x3f')){var _0x18c174={};_0x18c174[_0x499d19[_0xf62c('0x2a')]]={'$like':'%'+_0x19b820['query'][_0xf62c('0x3c')]+'%'};return _0x18c174;}})});}_0x554fce=_[_0xf62c('0x3d')]({},_0x554fce,_0x19b820[_0xf62c('0x40')]);var _0x10bc4c={'where':_0x554fce[_0xf62c('0x3a')]};return db['UserProfile']['count'](_0x10bc4c)[_0xf62c('0x41')](function(_0x588ad1){_0x1aaeb9[_0xf62c('0x23')]=_0x588ad1;if(_0x19b820[_0xf62c('0x32')][_0xf62c('0x42')]){_0x554fce['include']=[{'all':!![]}];}return db[_0xf62c('0x43')][_0xf62c('0x44')](_0x554fce);})[_0xf62c('0x41')](function(_0x3a550c){_0x1aaeb9[_0xf62c('0x45')]=_0x3a550c;return _0x1aaeb9;})[_0xf62c('0x41')](respondWithFilteredResult(_0x1862eb,_0x554fce))['catch'](handleError(_0x1862eb,null));};exports[_0xf62c('0x46')]=function(_0x4d0248,_0x40f2d9){var _0x311e77={'raw':![],'where':{'id':_0x4d0248[_0xf62c('0x47')]['id']}},_0x197769={};_0x197769[_0xf62c('0x30')]=_[_0xf62c('0x31')](db[_0xf62c('0x43')][_0xf62c('0x2e')]);_0x197769[_0xf62c('0x32')]=_['keys'](_0x4d0248[_0xf62c('0x32')]);_0x197769[_0xf62c('0x33')]=_['intersection'](_0x197769['model'],_0x197769[_0xf62c('0x32')]);_0x311e77['attributes']=_[_0xf62c('0x34')](_0x197769[_0xf62c('0x30')],qs['fields'](_0x4d0248[_0xf62c('0x32')]['fields']));_0x311e77[_0xf62c('0x35')]=_0x311e77['attributes'][_0xf62c('0x48')]?_0x311e77['attributes']:_0x197769[_0xf62c('0x30')];if(_0x4d0248[_0xf62c('0x32')][_0xf62c('0x42')]){_0x311e77[_0xf62c('0x49')]=[{'all':!![]}];}_0x311e77=_['merge']({},_0x311e77,_0x4d0248[_0xf62c('0x40')]);return db[_0xf62c('0x43')][_0xf62c('0x4a')](_0x311e77)[_0xf62c('0x41')](handleEntityNotFound(_0x40f2d9,null))[_0xf62c('0x41')](respondWithResult(_0x40f2d9,null))['catch'](handleError(_0x40f2d9,null));};exports[_0xf62c('0x4b')]=function(_0x2d8e15,_0x41efdf){return db[_0xf62c('0x43')][_0xf62c('0x4b')](_0x2d8e15[_0xf62c('0x4c')],{})[_0xf62c('0x41')](respondWithResult(_0x41efdf,0xc9))[_0xf62c('0x4d')](handleError(_0x41efdf,null));};exports['clone']=function(_0x236d87,_0x24e405){var _0x501461={'where':{'id':_0x236d87['params']['id']}},_0x112ddf={};_0x112ddf['model']=_[_0xf62c('0x31')](db[_0xf62c('0x43')]['rawAttributes']);_0x501461[_0xf62c('0x35')]=_['intersection'](_0x112ddf[_0xf62c('0x30')],qs[_0xf62c('0x36')](_0x236d87[_0xf62c('0x32')][_0xf62c('0x36')]));_0x501461[_0xf62c('0x35')]=_0x501461[_0xf62c('0x35')][_0xf62c('0x48')]?_0x501461[_0xf62c('0x35')]:_0x112ddf[_0xf62c('0x30')];if(_0x236d87[_0xf62c('0x32')][_0xf62c('0x42')]){_0x501461[_0xf62c('0x49')]=[{'all':!![]}];}_0x501461=_[_0xf62c('0x3d')]({},_0x501461,_0x236d87['options']);return db[_0xf62c('0x43')][_0xf62c('0x4a')](_0x501461)[_0xf62c('0x41')](handleEntityNotFound(_0x24e405,null))['then'](function(_0x1e5a24){if(_0x1e5a24){var _0x13e8bb=_0x1e5a24[_0xf62c('0x4e')]({'plain':!![]});_0x13e8bb=qs['omit'](_0x13e8bb,['id',_0xf62c('0x4f'),'updatedAt',_0xf62c('0x50')]);_0x236d87['body']=_[_0xf62c('0x51')](_0x236d87['body'],['id',_0xf62c('0x4f'),_0xf62c('0x52')]);return db[_0xf62c('0x53')]['transaction'](function(_0x4b8117){return db[_0xf62c('0x43')][_0xf62c('0x4b')](_[_0xf62c('0x3d')](_0x13e8bb,_0x236d87[_0xf62c('0x4c')]),{'include':_0x236d87[_0xf62c('0x32')][_0xf62c('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x4b8117})[_0xf62c('0x41')](function(_0x4289f5){var _0x267344=_0x4289f5[_0xf62c('0x4e')]({'plain':!![]});return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x236d87[_0xf62c('0x47')]['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x25003a){if(_0x25003a){return BPromise[_0xf62c('0x55')](_0x25003a,function(_0x4a6833){return new BPromise(function(_0x307eab,_0x4d5b80){if(_0x4a6833[_0xf62c('0x56')]===null||_0x4a6833[_0xf62c('0x56')]===0x1)_0x307eab(null);return db[_0xf62c('0x57')][_0xf62c('0x44')]({'where':{'sectionId':_0x4a6833['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x6f8e86){var _0x3a57a8=_[_0xf62c('0x2d')](_0x6f8e86,function(_0x3cfe0f){return qs[_0xf62c('0x51')](_0x3cfe0f,['id',_0xf62c('0x4f'),_0xf62c('0x52'),'sectionId']);});_0x307eab(_0x3a57a8);})[_0xf62c('0x4d')](function(_0x2e0b24){_0x4d5b80(_0x2e0b24);});})['then'](function(_0x30c8ef){var _0x38c458=qs[_0xf62c('0x51')](_0x4a6833,['id','createdAt',_0xf62c('0x52')]);_0x38c458['userProfileId']=_0x267344['id'];if(_0x30c8ef)_0x38c458[_0xf62c('0x58')]=_0x30c8ef;return _0x38c458;})[_0xf62c('0x41')](function(_0x5020fa){return db['UserProfileSection'][_0xf62c('0x4b')](_0x5020fa,{'include':[{'model':db[_0xf62c('0x57')],'as':_0xf62c('0x58')}],'raw':!![],'transaction':_0x4b8117});});})['then'](function(){return _0x267344;});}});});});}})['then'](respondWithResult(_0x24e405,0xc9))['catch'](handleError(_0x24e405,null));};exports[_0xf62c('0x59')]=function(_0x51568e,_0x1361ca){if(_0x51568e[_0xf62c('0x4c')]['id']){delete _0x51568e[_0xf62c('0x4c')]['id'];}return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x51568e[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](handleEntityNotFound(_0x1361ca,null))[_0xf62c('0x41')](saveUpdates(_0x51568e[_0xf62c('0x4c')],null))[_0xf62c('0x41')](respondWithResult(_0x1361ca,null))[_0xf62c('0x4d')](handleError(_0x1361ca,null));};exports['destroy']=function(_0x26d55f,_0x18f8d4){return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x26d55f[_0xf62c('0x47')]['id']}})['then'](handleEntityNotFound(_0x18f8d4,null))['then'](removeEntity(_0x18f8d4,null))[_0xf62c('0x4d')](handleError(_0x18f8d4,null));};exports['describe']=function(_0x3a59f7,_0x4a7cb3){return db[_0xf62c('0x43')][_0xf62c('0x5a')]()['then'](respondWithResult(_0x4a7cb3,null))['catch'](handleError(_0x4a7cb3,null));};exports[_0xf62c('0x5b')]=function(_0x11aec2,_0x30f424){var _0x2e2c7e=_0x11aec2['body'];return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x11aec2[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](handleEntityNotFound(_0x30f424,null))['then'](function(_0x561b58){if(_0x561b58){return db[_0xf62c('0x53')][_0xf62c('0x5c')](function(_0x476ddc){return db['UserProfileSection'][_0xf62c('0x27')]({'where':{'userProfileId':_0x11aec2['params']['id'],'sectionId':_[_0xf62c('0x2d')](_0x2e2c7e,function(_0x2e45a3){return _0x2e45a3['sectionId'];})},'transaction':_0x476ddc})[_0xf62c('0x41')](function(){var _0x38e41d=_[_0xf62c('0x2d')](_0x2e2c7e,function(_0x5113ab){_0x5113ab[_0xf62c('0x5d')]=_0x11aec2[_0xf62c('0x47')]['id'];return _0x5113ab;});var _0x3ce580=[];return BPromise['each'](_0x38e41d,function(_0x4d639b){return db[_0xf62c('0x54')][_0xf62c('0x4b')](_0x4d639b,{'include':[{'model':db['UserProfileResource'],'as':_0xf62c('0x58')}],'raw':!![],'transaction':_0x476ddc})[_0xf62c('0x41')](function(_0xcd46d2){_0x3ce580[_0xf62c('0x5e')](_0xcd46d2[_0xf62c('0x4e')]({'plain':!![]}));});})[_0xf62c('0x41')](function(){return _0x3ce580;});});});}})[_0xf62c('0x41')](function(_0x4eb0ae){return _0x4eb0ae;})['then'](respondWithResult(_0x30f424,null))[_0xf62c('0x4d')](handleError(_0x30f424,null));};exports[_0xf62c('0x5f')]=function(_0x5d9f68,_0x1bc9dc){var _0x14ef34;return db[_0xf62c('0x43')]['find']({'where':{'id':_0x5d9f68[_0xf62c('0x47')]['id']},'attributes':['id',_0xf62c('0x2a')]})[_0xf62c('0x41')](handleEntityNotFound(_0x1bc9dc,null))['then'](function(_0x37ef58){if(_0x37ef58){_0x14ef34=_0x37ef58;return db[_0xf62c('0x54')][_0xf62c('0x27')]({'where':{'userProfileId':_0x5d9f68[_0xf62c('0x47')]['id'],'sectionId':_0x5d9f68['query']['ids']}});}})[_0xf62c('0x41')](function(){return _0x14ef34;})[_0xf62c('0x41')](respondWithStatusCode(_0x1bc9dc,null))[_0xf62c('0x4d')](handleError(_0x1bc9dc,null));};exports[_0xf62c('0x60')]=function(_0x48ea18,_0x4ae41e){var _0x2906ac=[];var _0x406f21=[];return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x48ea18['params']['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x54d966){_0x2906ac=_[_0xf62c('0x3c')](_0x54d966,function(_0x435ab7){return _0x435ab7[_0xf62c('0x61')]===0x1||_[_0xf62c('0x62')]([0x3eb,0x709],_0x435ab7[_0xf62c('0x63')]);});if(!_[_0xf62c('0x64')](_0x2906ac)){return _[_0xf62c('0x2d')](_0x2906ac,function(_0x454643){return _0x454643['sectionId'];});}else{return;}})[_0xf62c('0x41')](function(_0x41eabb){if(_0x41eabb)_0x406f21=_0x41eabb;if(_['includes'](_0x406f21,0x64)){var _0x517d56=_['find'](_0x2906ac,{'sectionId':0x64});return hasDefaultDashboard(_0x517d56)[_0xf62c('0x41')](function(_0x5e6bf3){return _['map'](_0x2906ac,function(_0x15db4e){if(_0x15db4e[_0xf62c('0x63')]===0x64){_0x15db4e['subsections']=_0x5e6bf3;}return _0x15db4e;});});}else{return;}})[_0xf62c('0x41')](function(_0x1cf053){if(_0x1cf053)_0x2906ac=_0x1cf053;if(_[_0xf62c('0x62')](_0x406f21,0x3eb)){var _0x3c13f5=_[_0xf62c('0x4a')](_0x2906ac,{'sectionId':0x3eb});return getCustomDashboards(_0x3c13f5)[_0xf62c('0x41')](function(_0x52b418){return _[_0xf62c('0x2d')](_0x2906ac,function(_0x58d86e){if(_0x3c13f5[_0xf62c('0x61')]){if(_0x58d86e[_0xf62c('0x63')]===0x3eb){_0x58d86e['subsections']=_0x52b418;}}else{if(_0x58d86e[_0xf62c('0x63')]===0x64){_0x58d86e['subsections']=_0x52b418;}}return _0x58d86e;});});}else{return;}})[_0xf62c('0x41')](function(_0x41a415){if(_0x41a415)_0x2906ac=_0x41a415;if(_[_0xf62c('0x62')](_0x406f21,0x709)){var _0x151b17=_['find'](_0x2906ac,{'sectionId':0x709});return getPlugins(_0x151b17)['then'](function(_0x2a8290){if(_0x151b17[_0xf62c('0x61')]){return _[_0xf62c('0x2d')](_0x2906ac,function(_0xd1215a){if(_0xd1215a[_0xf62c('0x63')]===0x709){_0xd1215a[_0xf62c('0x65')]=_0x2a8290;}return _0xd1215a;});}else{var _0x12f6dc={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2a8290};var _0x377f37=_[_0xf62c('0x2d')](_0x2906ac);_0x377f37[_0xf62c('0x5e')](_0x12f6dc);return _0x377f37;}});}else{return;}})[_0xf62c('0x41')](function(_0x177848){if(_0x177848)_0x2906ac=_0x177848;return _[_0xf62c('0x3c')](_0x2906ac,[_0xf62c('0x61'),0x1]);})[_0xf62c('0x41')](respondWithResult(_0x4ae41e,null))[_0xf62c('0x4d')](handleError(_0x4ae41e,null));};function hasDefaultDashboard(_0x51cbfa){var _0x398c3c=[0x65];return new BPromise(function(_0x1e03e3,_0x32a4df){try{if(_0x51cbfa[_0xf62c('0x56')]){_0x1e03e3(_0x398c3c);}else{return db['UserProfileResource'][_0xf62c('0x66')]({'where':{'sectionId':_0x51cbfa['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x9be280){_0x9be280?_0x1e03e3(_0x398c3c):_0x1e03e3();});}}catch(_0x415070){_0x32a4df(_0x415070);}});}function getCustomDashboards(_0xdf7c97){var _0x161a8a=[];return new BPromise(function(_0x38fa69,_0x45bbdd){try{if(_0xdf7c97[_0xf62c('0x56')]){return db['Dashboard'][_0xf62c('0x44')]({'raw':!![]})[_0xf62c('0x41')](function(_0x16f330){_0x16f330[_0xf62c('0x67')](function(_0x556579){_0x161a8a[_0xf62c('0x5e')](_0x556579['id']+0x1869f);});_0x38fa69(_0x161a8a);});}else{return db[_0xf62c('0x57')]['findAll']({'where':{'sectionId':_0xdf7c97['id']},'raw':!![]})[_0xf62c('0x41')](function(_0x57c7b4){_0x57c7b4[_0xf62c('0x67')](function(_0x4755af){_0x161a8a['push'](_0x4755af[_0xf62c('0x68')]+0x1869f);});_0x38fa69(_0x161a8a);});}}catch(_0xdaa04d){_0x45bbdd(_0xdaa04d);}});}function getPlugins(_0x2cad38){var _0xd179ba=[];return new BPromise(function(_0x2971c9,_0xae799){try{if(_0x2cad38[_0xf62c('0x56')]){return db[_0xf62c('0x69')][_0xf62c('0x44')]({'raw':!![]})['then'](function(_0x1bc773){_0x1bc773['forEach'](function(_0x249823){_0xd179ba[_0xf62c('0x5e')](_0x249823['id']+0x15b38);});_0x2971c9(_0xd179ba);});}else{return db[_0xf62c('0x57')]['findAll']({'where':{'sectionId':_0x2cad38['id']},'raw':!![]})['then'](function(_0x3b8ec7){_0x3b8ec7[_0xf62c('0x67')](function(_0x742e1c){_0xd179ba[_0xf62c('0x5e')](_0x742e1c[_0xf62c('0x68')]+0x15b38);});_0x2971c9(_0xd179ba);});}}catch(_0x51a76c){_0xae799(_0x51a76c);}});}exports['addResources']=function(_0x221cb3,_0x4f0c40){return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x221cb3[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](handleEntityNotFound(_0x4f0c40,null))[_0xf62c('0x41')](function(_0x7a95a1){if(_0x7a95a1){return db[_0xf62c('0x53')][_0xf62c('0x5c')](function(_0x3320e2){return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x221cb3['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x177227){if(_0x177227){return db[_0xf62c('0x54')][_0xf62c('0x27')]({'where':{'userProfileId':_0x221cb3['params']['id'],'id':_[_0xf62c('0x2d')](_0x177227,function(_0x287cc9){return _0x287cc9['id'];})},'transaction':_0x3320e2});}})['then'](function(_0x4cbd15){var _0x480e4b=_[_0xf62c('0x2d')](_0x221cb3[_0xf62c('0x4c')],function(_0x24a15e){_0x24a15e[_0xf62c('0x5d')]=_0x221cb3[_0xf62c('0x47')]['id'];return _0x24a15e;});return db[_0xf62c('0x54')]['bulkCreate'](_0x480e4b,{'raw':!![],'transaction':_0x3320e2});})[_0xf62c('0x41')](function(_0xaf86d7){var _0x5402a8=_[_0xf62c('0x3c')](_[_0xf62c('0x2d')](_0xaf86d7,function(_0x32dd6b){return _0x32dd6b[_0xf62c('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x5402a8){return db[_0xf62c('0x54')][_0xf62c('0x44')]({'where':{'userProfileId':_0x221cb3[_0xf62c('0x47')]['id'],'sectionId':_['map'](_0x5402a8,function(_0x2eb05b){return _0x2eb05b[_0xf62c('0x63')];})},'attributes':['id',_0xf62c('0x63')],'raw':!![]})['then'](function(_0x3d3d9c){var _0x28a421=_[_0xf62c('0x2d')](_0x221cb3['body'],function(_0x24cf4a){_0x24cf4a[_0xf62c('0x5d')]=_0x221cb3[_0xf62c('0x47')]['id'];return _0x24cf4a;});return db[_0xf62c('0x57')][_0xf62c('0x6a')](_0x28a421,{'raw':!![],'transaction':_0x3320e2});});}})[_0xf62c('0x4d')](handleError(_0x4f0c40,null));});}})[_0xf62c('0x41')](function(_0x4d8647){var _0x50e7b0=_['map'](_0x4d8647,function(_0x193a61){return _0x193a61[_0xf62c('0x4e')]({'plain':!![]});});})[_0xf62c('0x41')](respondWithResult(_0x4f0c40,null))['catch'](handleError(_0x4f0c40,null));};exports[_0xf62c('0x6b')]=function(_0x130f02,_0xf3bca3,_0x528921){return db[_0xf62c('0x43')][_0xf62c('0x4a')]({'where':{'id':_0x130f02[_0xf62c('0x47')]['id']}})['then'](handleEntityNotFound(_0xf3bca3,null))[_0xf62c('0x41')](function(_0xee782f){if(_0xee782f){return _0xee782f[_0xf62c('0x6b')](_0x130f02[_0xf62c('0x32')]['ids']);}})[_0xf62c('0x41')](respondWithStatusCode(_0xf3bca3,null))[_0xf62c('0x4d')](handleError(_0xf3bca3,null));};exports['getResources']=function(_0x30231b,_0x57a0a2){var _0x40f0c9={};if(!_0x30231b['query']['section'])throw new Error(_0xf62c('0x6c'));if(!_0x30231b[_0xf62c('0x32')][_0xf62c('0x37')](_0xf62c('0x6d'))){_0x40f0c9[_0xf62c('0x24')]=qs['limit'](_0x30231b[_0xf62c('0x32')][_0xf62c('0x24')]);_0x40f0c9[_0xf62c('0x21')]=qs[_0xf62c('0x21')](_0x30231b[_0xf62c('0x32')][_0xf62c('0x21')]);}return db['UserProfile'][_0xf62c('0x4a')]({'where':{'id':_0x30231b[_0xf62c('0x47')]['id']}})[_0xf62c('0x41')](function(_0x45d000){if(!_0x45d000)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x30231b[_0xf62c('0x47')]['id']);return db[_0xf62c('0x43')]['getResources'](_0x30231b);})['then'](respondWithFilteredResult(_0x57a0a2,_0x40f0c9))['catch'](handleError(_0x57a0a2,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 6c39db4..e259251 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 _0x27a0=['hook','exports','../../mysqldb','UserProfile','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3231ee,_0x44e1ef){var _0x2092f1=function(_0x3329cd){while(--_0x3329cd){_0x3231ee['push'](_0x3231ee['shift']());}};_0x2092f1(++_0x44e1ef);}(_0x27a0,0xbf));var _0x027a=function(_0x1c017a,_0x5535a8){_0x1c017a=_0x1c017a-0x0;var _0x50c1da=_0x27a0[_0x1c017a];return _0x50c1da;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x027a('0x0'))['db'][_0x027a('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x027a('0x2')](0x0);var events={'afterCreate':_0x027a('0x3'),'afterUpdate':_0x027a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x58a58b){return function(_0x4e8d6b,_0x47cd65,_0x30a54d){UserProfileEvents[_0x027a('0x5')](_0x58a58b+':'+_0x4e8d6b['id'],_0x4e8d6b);UserProfileEvents[_0x027a('0x5')](_0x58a58b,_0x4e8d6b);_0x30a54d(null);};}for(var e in events){if(events[_0x027a('0x6')](e)){var event=events[e];UserProfile[_0x027a('0x7')](e,emitEvent(event));}}module[_0x027a('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x6003=['../../mysqldb','UserProfile','setMaxListeners','remove','emit','hasOwnProperty','events'];(function(_0x3957e3,_0x53fcd8){var _0xb23048=function(_0x2363f9){while(--_0x2363f9){_0x3957e3['push'](_0x3957e3['shift']());}};_0xb23048(++_0x53fcd8);}(_0x6003,0xae));var _0x3600=function(_0x5ddb96,_0x115b74){_0x5ddb96=_0x5ddb96-0x0;var _0x2a26c9=_0x6003[_0x5ddb96];return _0x2a26c9;};'use strict';var EventEmitter=require(_0x3600('0x0'));var UserProfile=require(_0x3600('0x1'))['db'][_0x3600('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3600('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3600('0x4')};function emitEvent(_0x3fb36b){return function(_0x29c0fd,_0x47b8b3,_0x29fadd){UserProfileEvents[_0x3600('0x5')](_0x3fb36b+':'+_0x29c0fd['id'],_0x29c0fd);UserProfileEvents['emit'](_0x3fb36b,_0x29c0fd);_0x29fadd(null);};}for(var e in events){if(events[_0x3600('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index a298f38..edb6e10 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 _0xd32a=['CmList','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','agent','Telephones','membername','User','role','telephone','VoiceQueues','name','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','VoiceChanSpy','ivrcampaigns','Campaign','MailQueue','MailAccount','MailSubstatus','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','Users','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Schedule','sounds','Sound','tags','Tag','Template','triggers','trunks','Trunk','variables','plugins','extractedreports','metrics','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','model','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','merge','AnalyticExtractedReport','includeAll','include','forEach','reportType','default','DefaultReports','reportId','CustomReports','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','value','map','catch','findAll','then','associatedResources','type','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','JscriptyProject','contacts','Lists','ListId'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xd32a,0x160));var _0xad32=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xd32a[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xad32('0x0'));var attributes=require(_0xad32('0x1'));var qs=require(_0xad32('0x2'));var squel=require('squel');module[_0xad32('0x3')]=function(_0x95eb4f){var _0x36c0ce=_0x95eb4f['models'];function _0x4de8cc(_0xbe0311,_0x38c434){return new Promise(function(_0x32bb55,_0x5655d3){if(!_0x38c434)return _0x32bb55(null);var _0x2881b3=_0x38c434['filter']?{[_0x38c434[_0xad32('0x4')][_0xad32('0x5')]]:_0x38c434[_0xad32('0x4')][_0xad32('0x6')]}:undefined;return _0x36c0ce[_0xbe0311]['findAll']({'where':_0x2881b3,'raw':!![]})['then'](function(_0x5db30c){_0x38c434['associatedResources']=_[_0xad32('0x7')](_0x5db30c,'id');_0x32bb55(_0x38c434);})[_0xad32('0x8')](function(_0x141bc4){_0x5655d3(_0x141bc4);});});}function _0x1dab9e(_0x32bb53,_0x440741){return new Promise(function(_0x47ecea,_0x3086e5){var _0x2ee622=_0x32bb53[_0xad32('0x4')]?{[_0x32bb53[_0xad32('0x4')][_0xad32('0x5')]]:_0x32bb53[_0xad32('0x4')][_0xad32('0x6')]}:undefined;return _0x36c0ce[_0x32bb53['model']][_0xad32('0x9')]({'where':_0x2ee622,'raw':!![]})[_0xad32('0xa')](function(_0x2c5e5c){_0x440741['associatedResources']=_[_0xad32('0x7')](_0x2c5e5c,function(_0xad2dc8){return _0xad2dc8['name'];});_0x47ecea(_0x440741);})['catch'](function(_0x43cee8){_0x3086e5(_0x43cee8);});});}function _0x2b5325(_0x431496,_0x3a430f,_0x57b4e2){if(!_0x3a430f)return Promise['resolve'](null);return new Promise(function(_0x43fd64,_0x30c08d){return _0x36c0ce['UserProfileResource'][_0xad32('0x9')]({'where':{'sectionId':_0x3a430f['id']},'raw':!![]})['then'](function(_0x5f057e){if(_0x431496[_0xad32('0x5')]&&_0x431496[_0xad32('0x5')]!=='id'){_0x3a430f[_0xad32('0xb')]=_[_0xad32('0x7')](_0x5f057e,function(_0x6be0ee){return _0x6be0ee[_0x431496['field']];});}else{if(_0x57b4e2==='AnalyticExtractedReport'){_0x3a430f[_0xad32('0xb')]=_[_0xad32('0x7')](_0x5f057e,function(_0x52250c){return{'id':_0x52250c['resourceId'],'type':_0x52250c[_0xad32('0xc')]};});}else{_0x3a430f[_0xad32('0xb')]=_['map'](_0x5f057e,function(_0x5f2534){return _0x5f2534[_0xad32('0xd')];});}}_0x43fd64(_0x3a430f);})['catch'](function(_0x15094c){_0x30c08d(_0x15094c);});});}function _0x506e4f(_0x50c957,_0xef294a){var _0x63474b={'parentSections':[]};switch(_0x50c957[_0xad32('0xe')]()){case _0xad32('0xf'):_0x63474b[_0xad32('0x10')]=_0xad32('0x11');break;case _0xad32('0x12'):_0x63474b[_0xad32('0x10')]=_0xad32('0x13');break;case'squarerecordings':_0x63474b['childModel']=_0xad32('0x14');_0x63474b[_0xad32('0x15')]=[{'name':'SquareProjects','field':'name','foreignKey':'projectName'}];break;case'projects':_0x63474b['childModel']=_0xad32('0x16');break;case _0xad32('0x17'):_0x63474b[_0xad32('0x10')]='CmContact';_0x63474b[_0xad32('0x15')]=[{'name':_0xad32('0x18'),'field':'id','foreignKey':_0xad32('0x19')}];break;case'lists':_0x63474b['childModel']=_0xad32('0x1a');break;case'companies':_0x63474b[_0xad32('0x10')]='CmCompany';break;case _0xad32('0x1b'):_0x63474b[_0xad32('0x10')]=_0xad32('0x1c');break;case'chatqueues':_0x63474b[_0xad32('0x10')]=_0xad32('0x1d');break;case _0xad32('0x1e'):_0x63474b[_0xad32('0x10')]='ChatWebsite';break;case _0xad32('0x1f'):_0x63474b['childModel']='FaxQueue';break;case _0xad32('0x20'):_0x63474b['childModel']=_0xad32('0x21');break;case _0xad32('0x22'):case _0xad32('0x23'):case _0xad32('0x24'):_0x63474b[_0xad32('0x10')]='VoiceExtension';break;case _0xad32('0x25'):_0x63474b['childModel']=_0xad32('0x26');break;case'voicemails':_0x63474b[_0xad32('0x10')]=_0xad32('0x27');break;case _0xad32('0x28'):_0x63474b[_0xad32('0x10')]=_0xad32('0x29');_0x63474b[_0xad32('0x15')]=[{'name':_0xad32('0x2a'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xad32('0x2b')]}},{'name':_0xad32('0x2c'),'field':'name','foreignKey':_0xad32('0x2d'),'model':_0xad32('0x2e'),'filter':{'field':_0xad32('0x2f'),'value':[_0xad32('0x30')]}},{'name':_0xad32('0x31'),'field':_0xad32('0x32'),'foreignKey':_0xad32('0x33'),'model':_0xad32('0x34'),'filter':{'field':_0xad32('0xc'),'value':[_0xad32('0x35')]}},{'name':_0xad32('0x36'),'field':'name','foreignKey':_0xad32('0x33'),'model':_0xad32('0x34'),'filter':{'field':'type','value':[_0xad32('0x37')]}}];break;case'musiconholds':_0x63474b['childModel']=_0xad32('0x38');break;case'chanspies':_0x63474b['childModel']=_0xad32('0x39');break;case'voiceprefixes':_0x63474b[_0xad32('0x10')]='VoicePrefix';break;case _0xad32('0x3a'):_0x63474b['childModel']=_0xad32('0x3b');break;case'mailqueues':_0x63474b[_0xad32('0x10')]=_0xad32('0x3c');break;case'mailaccounts':_0x63474b[_0xad32('0x10')]=_0xad32('0x3d');break;case'mailsubstatuses':_0x63474b[_0xad32('0x10')]=_0xad32('0x3e');break;case'openchannelqueues':_0x63474b['childModel']=_0xad32('0x3f');break;case _0xad32('0x40'):_0x63474b[_0xad32('0x10')]='OpenchannelAccount';break;case _0xad32('0x41'):_0x63474b[_0xad32('0x10')]=_0xad32('0x42');break;case _0xad32('0x43'):_0x63474b['childModel']=_0xad32('0x44');break;case'whatsappqueues':_0x63474b['childModel']=_0xad32('0x45');break;case _0xad32('0x46'):_0x63474b[_0xad32('0x10')]=_0xad32('0x47');break;case _0xad32('0x48'):_0x63474b[_0xad32('0x10')]='Team';break;case _0xad32('0x49'):case _0xad32('0x4a'):_0x63474b[_0xad32('0x10')]=_0xad32('0x34');if(_0xef294a){_0x63474b['parentSections']=[{'name':_0xad32('0x31')},{'name':'QueueCampaigns'}];}break;case _0xad32('0x4b'):case _0xad32('0x4c'):case'telephones':_0x63474b[_0xad32('0x10')]=_0xad32('0x2e');if(_0xef294a){_0x63474b[_0xad32('0x15')]=[{'name':_0xad32('0x4d'),'filter':{'field':_0xad32('0x2f'),'value':[_0xad32('0x4e'),_0xad32('0x4f')]},'ignore':!![]},{'name':_0xad32('0x2a')},{'name':_0xad32('0x2c')}];}break;case'zendeskaccounts':_0x63474b[_0xad32('0x10')]=_0xad32('0x50');break;case'salesforceaccounts':_0x63474b[_0xad32('0x10')]=_0xad32('0x51');break;case _0xad32('0x52'):_0x63474b[_0xad32('0x10')]=_0xad32('0x53');break;case _0xad32('0x54'):_0x63474b[_0xad32('0x10')]=_0xad32('0x55');break;case _0xad32('0x56'):_0x63474b[_0xad32('0x10')]=_0xad32('0x57');break;case _0xad32('0x58'):_0x63474b[_0xad32('0x10')]=_0xad32('0x59');break;case _0xad32('0x5a'):_0x63474b['childModel']=_0xad32('0x2e');break;case _0xad32('0x5b'):_0x63474b[_0xad32('0x10')]=_0xad32('0x5c');break;case _0xad32('0x5d'):_0x63474b[_0xad32('0x10')]=_0xad32('0x5e');break;case _0xad32('0x5f'):_0x63474b[_0xad32('0x10')]=_0xad32('0x60');break;case _0xad32('0x61'):_0x63474b['childModel']=_0xad32('0x62');break;case _0xad32('0x63'):_0x63474b[_0xad32('0x10')]='Pause';break;case'scheduler':_0x63474b[_0xad32('0x10')]=_0xad32('0x64');break;case _0xad32('0x65'):_0x63474b[_0xad32('0x10')]=_0xad32('0x66');break;case _0xad32('0x67'):_0x63474b[_0xad32('0x10')]=_0xad32('0x68');break;case'templates':_0x63474b[_0xad32('0x10')]=_0xad32('0x69');break;case _0xad32('0x6a'):_0x63474b[_0xad32('0x10')]='Trigger';break;case _0xad32('0x6b'):_0x63474b[_0xad32('0x10')]=_0xad32('0x6c');break;case _0xad32('0x6d'):_0x63474b[_0xad32('0x10')]='Variable';break;case _0xad32('0x6e'):_0x63474b[_0xad32('0x10')]='Plugin';break;case _0xad32('0x6f'):_0x63474b[_0xad32('0x10')]='AnalyticExtractedReport';_0x63474b[_0xad32('0x15')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xad32('0x70'):_0x63474b[_0xad32('0x10')]='AnalyticMetric';break;}return _0x63474b;}function _0x109f6d(_0x17abfd,_0x4af7a1){var _0x14ceb0=_0x17abfd['charAt'](0x0)[_0xad32('0x71')]()+_0x17abfd[_0xad32('0x72')](0x1);var _0x195049={'type':_0x36c0ce[_0xad32('0x73')][_0xad32('0x74')]['SELECT'],'raw':!![]};return new Promise(function(_0x14f0c7,_0x18455d){var _0x160d7b=squel[_0xad32('0x75')]()[_0xad32('0x5')](_0xad32('0x76')+_0x14ceb0+_0xad32('0x77'),'id')[_0xad32('0x5')](_0xad32('0x78'))[_0xad32('0x79')](_0xad32('0x7a')+_0x17abfd+_0xad32('0x7b'),'ui')[_0xad32('0x7c')](_0xad32('0x7d'),_0x4af7a1['id']);return _0x36c0ce[_0xad32('0x7e')][_0xad32('0x7f')](_0x160d7b[_0xad32('0x80')](),_0x195049)['then'](function(_0x5bc568){_0x4af7a1[_0x14ceb0+_0xad32('0x81')]=_0x5bc568;_0x14f0c7(_0x5bc568);})['catch'](function(_0x274058){_0x18455d(_0x274058);});});}return _0x95eb4f[_0xad32('0x82')](_0xad32('0x83'),attributes,{'tableName':_0xad32('0x84'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xa7fb5b){var _0x108c34={'raw':_0xa7fb5b[_0xad32('0x7f')][_0xad32('0x85')],'where':{}};var _0x39a170={};var _0x350efc={'count':0x0,'rows':[]};var _0x5b9fad=_0xa7fb5b[_0xad32('0x7f')][_0xad32('0x86')];var _0x3ca090=_0xa7fb5b['query'][_0xad32('0x87')]||![];var _0x12a8de=_0x506e4f(_0x5b9fad,_0x3ca090);if(!_0x12a8de[_0xad32('0x10')])throw new Error(_0xad32('0x88')+_0x5b9fad+'\x27');var _0x216fdd=[{'name':_0x5b9fad}];if(!_[_0xad32('0x89')](_0x12a8de[_0xad32('0x15')]))_0x216fdd=_0x12a8de['parentSections'];var _0xbe94d4=[];for(var _0x1984ae=0x0;_0x1984ae<_0x216fdd[_0xad32('0x8a')];_0x1984ae++){_0xbe94d4['push'](_0x36c0ce[_0xad32('0x8b')][_0xad32('0x8c')]({'where':{'userProfileId':_0xa7fb5b[_0xad32('0x8d')]['id'],'name':_0x216fdd[_0x1984ae][_0xad32('0x32')]},'raw':!![]}));}return Promise[_0xad32('0x8e')](_0xbe94d4)['then'](function(_0x59d0b0){var _0x146b6f=_[_0xad32('0x4')](_0x59d0b0,function(_0x1504f6){return _0x1504f6?_0x1504f6:undefined;});var _0x5a3b97=_[_0xad32('0x4')](_0x216fdd,[_0xad32('0x8f'),!![]]);var _0x11e1fb=_[_0xad32('0x89')](_0x146b6f)&&_[_0xad32('0x89')](_0x5a3b97)?null:_[_0xad32('0x90')](_0x5a3b97,_0x146b6f);if(!_0x11e1fb)return null;var _0x3c5632=[];for(var _0x50a8d0=0x0;_0x50a8d0<_0x11e1fb[_0xad32('0x8a')];_0x50a8d0++){var _0x3f472d=_['find'](_0x216fdd,function(_0x10fac5){return _0x11e1fb[_0x50a8d0]?_0x10fac5[_0xad32('0x32')]===_0x11e1fb[_0x50a8d0]['name']:null;});if(_0x3f472d){if(_0x11e1fb[_0x50a8d0][_0xad32('0x8f')]){_0x3c5632[_0xad32('0x91')](_0x4de8cc(_0x12a8de[_0xad32('0x10')],_0x11e1fb[_0x50a8d0]));}else{if(!_0x11e1fb[_0x50a8d0][_0xad32('0x92')]){_0x3c5632['push'](_0x2b5325(_0x3f472d,_0x11e1fb[_0x50a8d0],_0x12a8de['childModel']));}else{if(_0x3f472d[_0xad32('0x93')]){_0x3c5632[_0xad32('0x91')](_0x1dab9e(_0x3f472d,_0x11e1fb[_0x50a8d0]));}}}}}return Promise['all'](_0x3c5632);})[_0xad32('0xa')](function(_0x31df09){var _0x3ca761=_0x31df09;var _0x22b91f=null;if(_0x3ca761){_0x22b91f=_0x3ca761[_0xad32('0x8a')]===0x1?_0x3ca761[0x0]:null;}if(!_0x22b91f&&!_0x3ca761)return _0x350efc;var _0x3c36b4=_0x36c0ce[_0x12a8de['childModel']][_0xad32('0x94')];_0x39a170['model']=_[_0xad32('0x95')](_0x3c36b4);_0x39a170[_0xad32('0x7f')]=_['keys'](_0xa7fb5b['query']);_0x39a170[_0xad32('0x96')]=_[_0xad32('0x97')](_0x39a170['model'],_0x39a170[_0xad32('0x7f')]);_0x108c34[_0xad32('0x98')]=_[_0xad32('0x97')](_0x39a170[_0xad32('0x93')],qs['fields'](_0xa7fb5b[_0xad32('0x7f')][_0xad32('0x99')]));_0x108c34[_0xad32('0x98')]=_0x108c34['attributes'][_0xad32('0x8a')]?_0x108c34[_0xad32('0x98')]:_0x39a170[_0xad32('0x93')];if(!_0xa7fb5b[_0xad32('0x7f')][_0xad32('0x9a')](_0xad32('0x9b'))){_0x108c34[_0xad32('0x9c')]=qs['limit'](_0xa7fb5b['query'][_0xad32('0x9c')]);_0x108c34[_0xad32('0x9d')]=qs[_0xad32('0x9d')](_0xa7fb5b[_0xad32('0x7f')][_0xad32('0x9d')]);}_0x108c34[_0xad32('0x9e')]=qs['sort'](_0xa7fb5b['query'][_0xad32('0x9f')]);_0x108c34[_0xad32('0x7c')]=qs[_0xad32('0x96')](_[_0xad32('0xa0')](_0xa7fb5b[_0xad32('0x7f')],_0x39a170[_0xad32('0x96')]));if(_0xa7fb5b[_0xad32('0x7f')][_0xad32('0x4')]){_0x108c34[_0xad32('0x7c')]=_['merge'](_0x108c34['where'],{'$or':_[_0xad32('0x7')](_0x3c36b4,function(_0xa73e9b){if(_0xa73e9b[_0xad32('0xc')][_0xad32('0xa1')]!==_0xad32('0xa2')){var _0x18f9d4={};_0x18f9d4[_0xa73e9b[_0xad32('0x5')]]={'$like':'%'+_0xa7fb5b[_0xad32('0x7f')]['filter']+'%'};return _0x18f9d4;}})});}var _0x46bb71=[];var _0x42283f=null;var _0x567d7c={};if(_0x22b91f){_0x42283f=_[_0xad32('0x8c')](_0x216fdd,['name',_0x22b91f[_0xad32('0x32')]]);if(_0x42283f['field']){_0x567d7c={};if(_0x12a8de[_0xad32('0x10')]==='AnalyticExtractedReport'){_0x567d7c[_0x42283f[_0xad32('0xa3')]]=_[_0xad32('0x7')](_0x22b91f[_0xad32('0xb')],'id');}else{_0x567d7c[_0x42283f[_0xad32('0xa3')]]=_0x22b91f[_0xad32('0xb')];}_0x46bb71['push'](_0x567d7c);}else{_0x108c34[_0xad32('0x7c')]['id']=_0x22b91f[_0xad32('0xb')];}}else{for(var _0xc6c856=0x0;_0xc6c856<_0x3ca761['length'];_0xc6c856++){_0x42283f=_['find'](_0x216fdd,[_0xad32('0x32'),_0x3ca761[_0xc6c856]['name']]);if(_0x42283f[_0xad32('0x5')]){_0x567d7c={};_0x567d7c[_0x42283f['foreignKey']]=_0x3ca761[_0xc6c856]['associatedResources'];_0x46bb71[_0xad32('0x91')](_0x567d7c);}else{if(!_0x108c34['where']['id'])_0x108c34[_0xad32('0x7c')]['id']=[];_0x3ca761[_0xc6c856][_0xad32('0xb')]['forEach'](function(_0x1d7944){_0x108c34['where']['id'][_0xad32('0x91')](_0x1d7944);});}}}if(!_[_0xad32('0x89')](_0x46bb71)){_0x108c34[_0xad32('0x7c')]=_[_0xad32('0xa4')](_0x108c34[_0xad32('0x7c')],{'$and':{'$or':_0x46bb71}});}_0x108c34=_[_0xad32('0xa4')]({},_0x108c34,_0xa7fb5b['options']);if(_0x22b91f&&!_0x22b91f['autoAssociation']&&_0x12a8de[_0xad32('0x10')]===_0xad32('0xa5')){if(_0xa7fb5b[_0xad32('0x7f')][_0xad32('0xa6')]){_0x108c34[_0xad32('0xa7')]=[{'all':!![]}];}return _0x36c0ce[_0x12a8de[_0xad32('0x10')]]['findAll'](_0x108c34)[_0xad32('0xa')](function(_0x14a94c){var _0x73ff7a=[];_0x14a94c[_0xad32('0xa8')](function(_0x2816ad){var _0x6c8f57;switch(_0x2816ad[_0xad32('0xa9')]){case _0xad32('0xaa'):_0x6c8f57=_[_0xad32('0x8c')](_0x22b91f[_0xad32('0xb')],function(_0x5c1895){return _0x5c1895['id']===_0x2816ad['reportId']&&_0x5c1895[_0xad32('0xc')]===_0xad32('0xab');});break;case'custom':_0x6c8f57=_[_0xad32('0x8c')](_0x22b91f['associatedResources'],function(_0x2f5afd){return _0x2f5afd['id']===_0x2816ad[_0xad32('0xac')]&&_0x2f5afd[_0xad32('0xc')]===_0xad32('0xad');});break;}if(_0x6c8f57)_0x73ff7a[_0xad32('0x91')](_0x2816ad);});_0x350efc[_0xad32('0xae')]=_0x73ff7a[_0xad32('0x8a')];_0x350efc[_0xad32('0xaf')]=_0x73ff7a;return _0x350efc;});}else{return _0x36c0ce[_0x12a8de[_0xad32('0x10')]]['count']({'where':_0x108c34[_0xad32('0x7c')]})[_0xad32('0xa')](function(_0x262beb){_0x350efc[_0xad32('0xae')]=_0x262beb;if(_0xa7fb5b['query'][_0xad32('0xa6')]){if(_0x12a8de[_0xad32('0x10')]===_0xad32('0xb0')){_0x108c34[_0xad32('0xa7')]=[{'model':_0x36c0ce['Tag'],'as':_0xad32('0xb1'),'attributes':['id',_0xad32('0x32'),_0xad32('0xb2')],'required':_0xa7fb5b[_0xad32('0x7f')][_0xad32('0xb3')]?!![]:![]},{'model':_0x36c0ce[_0xad32('0x68')],'as':_0xad32('0xb4'),'attributes':['id',_0xad32('0x32'),_0xad32('0xb2')],'through':_0xa7fb5b[_0xad32('0x7f')][_0xad32('0xb3')]?{'attributes':[],'where':{'TagId':_0xa7fb5b[_0xad32('0x7f')][_0xad32('0xb3')]||undefined}}:{},'required':_0xa7fb5b[_0xad32('0x7f')]['tag']?!![]:![]}];}else{_0x108c34['include']=[{'all':!![]}];}}return _0x36c0ce[_0x12a8de['childModel']][_0xad32('0x9')](_0x108c34);})[_0xad32('0xa')](function(_0x7c2a7c){_0x350efc[_0xad32('0xaf')]=_0x7c2a7c;if(_0x5b9fad===_0xad32('0x2a')&&_0xa7fb5b[_0xad32('0x7f')][_0xad32('0xb5')]===_0xad32('0xb6')){var _0x3498bc=[];for(var _0x4c1d8e=0x0;_0x4c1d8e<_0x350efc[_0xad32('0xaf')][_0xad32('0x8a')];_0x4c1d8e++){_0x3498bc[_0xad32('0x91')](_0x109f6d(_0xad32('0xb7'),_0x350efc['rows'][_0x4c1d8e]['dataValues']));_0x3498bc[_0xad32('0x91')](_0x109f6d(_0xad32('0xb8'),_0x350efc[_0xad32('0xaf')][_0x4c1d8e][_0xad32('0xb9')]));_0x3498bc[_0xad32('0x91')](_0x109f6d(_0xad32('0xba'),_0x350efc[_0xad32('0xaf')][_0x4c1d8e][_0xad32('0xb9')]));_0x3498bc[_0xad32('0x91')](_0x109f6d(_0xad32('0xbb'),_0x350efc[_0xad32('0xaf')][_0x4c1d8e][_0xad32('0xb9')]));_0x3498bc[_0xad32('0x91')](_0x109f6d(_0xad32('0xbc'),_0x350efc[_0xad32('0xaf')][_0x4c1d8e][_0xad32('0xb9')]));_0x3498bc[_0xad32('0x91')](_0x109f6d('whatsapp',_0x350efc[_0xad32('0xaf')][_0x4c1d8e]['dataValues']));}return Promise[_0xad32('0x8e')](_0x3498bc)[_0xad32('0xa')](function(){return _0x350efc;});}return _0x350efc;});}});}}});}; \ No newline at end of file +var _0x4bab=['Disposition','customdashboards','Dashboard','intervals','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','trunks','Trunk','variables','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','QueryTypes','SELECT','select','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','find','params','all','ignore','union','push','length','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','foreignKey','autoAssociation','include','forEach','DefaultReports','custom','rows','count','Tags','tag','ThroughTags','openTabs','true','chat','dataValues','sms','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','resolve','UserProfileResource','resourceId','type','toLowerCase','childModel','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','VoiceRecording','Agents','User','Telephones','membername','role','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','smsqueues','SmsQueue','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions'];(function(_0x59f8bf,_0x3876ac){var _0x32d623=function(_0x1119af){while(--_0x1119af){_0x59f8bf['push'](_0x59f8bf['shift']());}};_0x32d623(++_0x3876ac);}(_0x4bab,0x1ce));var _0xb4ba=function(_0x4fbf1f,_0x2a76b3){_0x4fbf1f=_0x4fbf1f-0x0;var _0x391359=_0x4bab[_0x4fbf1f];return _0x391359;};'use strict';var _=require(_0xb4ba('0x0'));var attributes=require(_0xb4ba('0x1'));var qs=require(_0xb4ba('0x2'));var squel=require(_0xb4ba('0x3'));module['exports']=function(_0xa12e5f){var _0x3a3996=_0xa12e5f[_0xb4ba('0x4')];function _0x1353c1(_0xf86b7b,_0x59d9f9){return new Promise(function(_0x5d8803,_0x559204){if(!_0x59d9f9)return _0x5d8803(null);var _0x14ffa9=_0x59d9f9[_0xb4ba('0x5')]?{[_0x59d9f9['filter'][_0xb4ba('0x6')]]:_0x59d9f9['filter'][_0xb4ba('0x7')]}:undefined;return _0x3a3996[_0xf86b7b][_0xb4ba('0x8')]({'where':_0x14ffa9,'raw':!![]})[_0xb4ba('0x9')](function(_0x6a205c){_0x59d9f9[_0xb4ba('0xa')]=_['map'](_0x6a205c,'id');_0x5d8803(_0x59d9f9);})[_0xb4ba('0xb')](function(_0x28d96d){_0x559204(_0x28d96d);});});}function _0xd9784f(_0x4f4690,_0x250c20){return new Promise(function(_0x135f51,_0x402dbc){var _0x4f08b5=_0x4f4690[_0xb4ba('0x5')]?{[_0x4f4690[_0xb4ba('0x5')][_0xb4ba('0x6')]]:_0x4f4690[_0xb4ba('0x5')]['value']}:undefined;return _0x3a3996[_0x4f4690[_0xb4ba('0xc')]][_0xb4ba('0x8')]({'where':_0x4f08b5,'raw':!![]})[_0xb4ba('0x9')](function(_0x360a26){_0x250c20[_0xb4ba('0xa')]=_[_0xb4ba('0xd')](_0x360a26,function(_0x26dde7){return _0x26dde7[_0xb4ba('0xe')];});_0x135f51(_0x250c20);})[_0xb4ba('0xb')](function(_0x26acc4){_0x402dbc(_0x26acc4);});});}function _0x2ee45b(_0x550363,_0x4f6fde,_0x3d81f9){if(!_0x4f6fde)return Promise[_0xb4ba('0xf')](null);return new Promise(function(_0x17f731,_0x13cd65){return _0x3a3996[_0xb4ba('0x10')]['findAll']({'where':{'sectionId':_0x4f6fde['id']},'raw':!![]})[_0xb4ba('0x9')](function(_0x38883c){if(_0x550363[_0xb4ba('0x6')]&&_0x550363[_0xb4ba('0x6')]!=='id'){_0x4f6fde[_0xb4ba('0xa')]=_[_0xb4ba('0xd')](_0x38883c,function(_0x43c877){return _0x43c877[_0x550363['field']];});}else{if(_0x3d81f9==='AnalyticExtractedReport'){_0x4f6fde[_0xb4ba('0xa')]=_[_0xb4ba('0xd')](_0x38883c,function(_0x41f4f4){return{'id':_0x41f4f4[_0xb4ba('0x11')],'type':_0x41f4f4[_0xb4ba('0x12')]};});}else{_0x4f6fde[_0xb4ba('0xa')]=_[_0xb4ba('0xd')](_0x38883c,function(_0x5765bc){return _0x5765bc[_0xb4ba('0x11')];});}}_0x17f731(_0x4f6fde);})['catch'](function(_0xab12b7){_0x13cd65(_0xab12b7);});});}function _0xbf5cde(_0x36a8a5,_0x56ef97){var _0x172834={'parentSections':[]};switch(_0x36a8a5[_0xb4ba('0x13')]()){case'squareprojects':_0x172834[_0xb4ba('0x14')]='SquareProject';break;case _0xb4ba('0x15'):_0x172834['childModel']='SquareOdbc';break;case _0xb4ba('0x16'):_0x172834['childModel']=_0xb4ba('0x17');_0x172834[_0xb4ba('0x18')]=[{'name':_0xb4ba('0x19'),'field':_0xb4ba('0xe'),'foreignKey':_0xb4ba('0x1a')}];break;case _0xb4ba('0x1b'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x1c');break;case _0xb4ba('0x1d'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x1e');_0x172834['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0xb4ba('0x1f')}];break;case _0xb4ba('0x20'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x21');break;case _0xb4ba('0x22'):_0x172834[_0xb4ba('0x14')]='CmCompany';break;case'globalcustomfields':_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x23');break;case'chatqueues':_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x24');break;case _0xb4ba('0x25'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x26');break;case _0xb4ba('0x27'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x28');break;case _0xb4ba('0x29'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x2a');break;case'inboundroutes':case _0xb4ba('0x2b'):case _0xb4ba('0x2c'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x2d');break;case _0xb4ba('0x2e'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x2f');break;case'voicemails':_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x30');break;case _0xb4ba('0x31'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x32');_0x172834[_0xb4ba('0x18')]=[{'name':_0xb4ba('0x33'),'field':_0xb4ba('0xe'),'foreignKey':'membername','model':_0xb4ba('0x34'),'filter':{'field':'role','value':['agent']}},{'name':_0xb4ba('0x35'),'field':_0xb4ba('0xe'),'foreignKey':_0xb4ba('0x36'),'model':_0xb4ba('0x34'),'filter':{'field':_0xb4ba('0x37'),'value':['telephone']}},{'name':_0xb4ba('0x38'),'field':_0xb4ba('0xe'),'foreignKey':_0xb4ba('0x39'),'model':_0xb4ba('0x3a'),'filter':{'field':_0xb4ba('0x12'),'value':[_0xb4ba('0x3b')]}},{'name':_0xb4ba('0x3c'),'field':_0xb4ba('0xe'),'foreignKey':'queue','model':_0xb4ba('0x3a'),'filter':{'field':_0xb4ba('0x12'),'value':['outbound']}}];break;case _0xb4ba('0x3d'):_0x172834['childModel']=_0xb4ba('0x3e');break;case _0xb4ba('0x3f'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x40');break;case _0xb4ba('0x41'):_0x172834[_0xb4ba('0x14')]='VoicePrefix';break;case _0xb4ba('0x42'):_0x172834[_0xb4ba('0x14')]='Campaign';break;case'mailqueues':_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x43');break;case _0xb4ba('0x44'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x45');break;case _0xb4ba('0x46'):_0x172834[_0xb4ba('0x14')]='MailSubstatus';break;case _0xb4ba('0x47'):_0x172834['childModel']='OpenchannelQueue';break;case'openchannelaccounts':_0x172834[_0xb4ba('0x14')]='OpenchannelAccount';break;case _0xb4ba('0x48'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x49');break;case'smsaccounts':_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x4a');break;case _0xb4ba('0x4b'):_0x172834[_0xb4ba('0x14')]='WhatsappQueue';break;case _0xb4ba('0x4c'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x4d');break;case _0xb4ba('0x4e'):_0x172834['childModel']='Team';break;case _0xb4ba('0x4f'):case _0xb4ba('0x50'):_0x172834[_0xb4ba('0x14')]='VoiceQueue';if(_0x56ef97){_0x172834[_0xb4ba('0x18')]=[{'name':_0xb4ba('0x38')},{'name':_0xb4ba('0x3c')}];}break;case _0xb4ba('0x51'):case _0xb4ba('0x52'):case _0xb4ba('0x53'):_0x172834[_0xb4ba('0x14')]='User';if(_0x56ef97){_0x172834[_0xb4ba('0x18')]=[{'name':_0xb4ba('0x54'),'filter':{'field':'role','value':[_0xb4ba('0x55'),_0xb4ba('0x56')]},'ignore':!![]},{'name':_0xb4ba('0x33')},{'name':_0xb4ba('0x35')}];}break;case _0xb4ba('0x57'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x58');break;case _0xb4ba('0x59'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x5a');break;case _0xb4ba('0x5b'):_0x172834[_0xb4ba('0x14')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x5c');break;case _0xb4ba('0x5d'):_0x172834['childModel']='DeskAccount';break;case _0xb4ba('0x5e'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x5f');break;case _0xb4ba('0x60'):_0x172834['childModel']=_0xb4ba('0x34');break;case _0xb4ba('0x61'):_0x172834[_0xb4ba('0x14')]='CannedAnswer';break;case _0xb4ba('0x62'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x63');break;case _0xb4ba('0x64'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x65');break;case _0xb4ba('0x66'):_0x172834[_0xb4ba('0x14')]='Interval';break;case _0xb4ba('0x67'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x68');break;case _0xb4ba('0x69'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x6a');break;case'sounds':_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x6b');break;case _0xb4ba('0x6c'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x6d');break;case _0xb4ba('0x6e'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x6f');break;case _0xb4ba('0x70'):_0x172834['childModel']='Trigger';break;case _0xb4ba('0x71'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x72');break;case _0xb4ba('0x73'):_0x172834[_0xb4ba('0x14')]='Variable';break;case _0xb4ba('0x74'):_0x172834['childModel']=_0xb4ba('0x75');break;case _0xb4ba('0x76'):_0x172834['childModel']=_0xb4ba('0x77');_0x172834['parentSections']=[{'name':_0xb4ba('0x78'),'field':'id','foreignKey':_0xb4ba('0x79')}];break;case _0xb4ba('0x7a'):_0x172834[_0xb4ba('0x14')]=_0xb4ba('0x7b');break;}return _0x172834;}function _0x5991a3(_0x213e01,_0x48859c){var _0x5a941e=_0x213e01[_0xb4ba('0x7c')](0x0)[_0xb4ba('0x7d')]()+_0x213e01['slice'](0x1);var _0x5448aa={'type':_0x3a3996['Sequelize'][_0xb4ba('0x7e')][_0xb4ba('0x7f')],'raw':!![]};return new Promise(function(_0x134d22,_0x4dfed9){var _0x5b2469=squel[_0xb4ba('0x80')]()[_0xb4ba('0x6')]('ui.'+_0x5a941e+_0xb4ba('0x81'),'id')[_0xb4ba('0x6')](_0xb4ba('0x82'))[_0xb4ba('0x83')](_0xb4ba('0x84')+_0x213e01+_0xb4ba('0x85'),'ui')[_0xb4ba('0x86')](_0xb4ba('0x87'),_0x48859c['id']);return _0x3a3996[_0xb4ba('0x88')][_0xb4ba('0x89')](_0x5b2469['toString'](),_0x5448aa)[_0xb4ba('0x9')](function(_0x48e219){_0x48859c[_0x5a941e+_0xb4ba('0x8a')]=_0x48e219;_0x134d22(_0x48e219);})[_0xb4ba('0xb')](function(_0x12ff35){_0x4dfed9(_0x12ff35);});});}return _0xa12e5f[_0xb4ba('0x8b')](_0xb4ba('0x8c'),attributes,{'tableName':_0xb4ba('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4f5ccf){var _0x11d14e={'raw':_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0x8e')],'where':{}};var _0x4ef780={};var _0x5e2006={'count':0x0,'rows':[]};var _0xfbe8ed=_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0x8f')];var _0xefe93e=_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0x90')]||![];var _0x50cf29=_0xbf5cde(_0xfbe8ed,_0xefe93e);if(!_0x50cf29[_0xb4ba('0x14')])throw new Error(_0xb4ba('0x91')+_0xfbe8ed+'\x27');var _0x47ca1a=[{'name':_0xfbe8ed}];if(!_[_0xb4ba('0x92')](_0x50cf29['parentSections']))_0x47ca1a=_0x50cf29[_0xb4ba('0x18')];var _0x264ec5=[];for(var _0x1945a7=0x0;_0x1945a7<_0x47ca1a['length'];_0x1945a7++){_0x264ec5['push'](_0x3a3996['UserProfileSection'][_0xb4ba('0x93')]({'where':{'userProfileId':_0x4f5ccf[_0xb4ba('0x94')]['id'],'name':_0x47ca1a[_0x1945a7][_0xb4ba('0xe')]},'raw':!![]}));}return Promise[_0xb4ba('0x95')](_0x264ec5)[_0xb4ba('0x9')](function(_0x3cba08){var _0x2cd64e=_[_0xb4ba('0x5')](_0x3cba08,function(_0x35b7bf){return _0x35b7bf?_0x35b7bf:undefined;});var _0x4a5d96=_[_0xb4ba('0x5')](_0x47ca1a,[_0xb4ba('0x96'),!![]]);var _0x4b2aa1=_[_0xb4ba('0x92')](_0x2cd64e)&&_['isEmpty'](_0x4a5d96)?null:_[_0xb4ba('0x97')](_0x4a5d96,_0x2cd64e);if(!_0x4b2aa1)return null;var _0x3c3232=[];for(var _0x4cb958=0x0;_0x4cb958<_0x4b2aa1['length'];_0x4cb958++){var _0x327569=_['find'](_0x47ca1a,function(_0x152e71){return _0x4b2aa1[_0x4cb958]?_0x152e71[_0xb4ba('0xe')]===_0x4b2aa1[_0x4cb958][_0xb4ba('0xe')]:null;});if(_0x327569){if(_0x4b2aa1[_0x4cb958]['ignore']){_0x3c3232[_0xb4ba('0x98')](_0x1353c1(_0x50cf29[_0xb4ba('0x14')],_0x4b2aa1[_0x4cb958]));}else{if(!_0x4b2aa1[_0x4cb958]['autoAssociation']){_0x3c3232['push'](_0x2ee45b(_0x327569,_0x4b2aa1[_0x4cb958],_0x50cf29['childModel']));}else{if(_0x327569['model']){_0x3c3232[_0xb4ba('0x98')](_0xd9784f(_0x327569,_0x4b2aa1[_0x4cb958]));}}}}}return Promise[_0xb4ba('0x95')](_0x3c3232);})[_0xb4ba('0x9')](function(_0x575cbc){var _0x4e19e3=_0x575cbc;var _0x4b33fe=null;if(_0x4e19e3){_0x4b33fe=_0x4e19e3[_0xb4ba('0x99')]===0x1?_0x4e19e3[0x0]:null;}if(!_0x4b33fe&&!_0x4e19e3)return _0x5e2006;var _0x3c6443=_0x3a3996[_0x50cf29[_0xb4ba('0x14')]][_0xb4ba('0x9a')];_0x4ef780['model']=_[_0xb4ba('0x9b')](_0x3c6443);_0x4ef780[_0xb4ba('0x89')]=_[_0xb4ba('0x9b')](_0x4f5ccf['query']);_0x4ef780[_0xb4ba('0x9c')]=_[_0xb4ba('0x9d')](_0x4ef780[_0xb4ba('0xc')],_0x4ef780[_0xb4ba('0x89')]);_0x11d14e[_0xb4ba('0x9e')]=_[_0xb4ba('0x9d')](_0x4ef780['model'],qs[_0xb4ba('0x9f')](_0x4f5ccf[_0xb4ba('0x89')]['fields']));_0x11d14e[_0xb4ba('0x9e')]=_0x11d14e['attributes']['length']?_0x11d14e[_0xb4ba('0x9e')]:_0x4ef780[_0xb4ba('0xc')];if(!_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0xa0')](_0xb4ba('0xa1'))){_0x11d14e['limit']=qs[_0xb4ba('0xa2')](_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0xa2')]);_0x11d14e[_0xb4ba('0xa3')]=qs['offset'](_0x4f5ccf['query'][_0xb4ba('0xa3')]);}_0x11d14e[_0xb4ba('0xa4')]=qs[_0xb4ba('0xa5')](_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0xa5')]);_0x11d14e['where']=qs[_0xb4ba('0x9c')](_[_0xb4ba('0xa6')](_0x4f5ccf[_0xb4ba('0x89')],_0x4ef780[_0xb4ba('0x9c')]));if(_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0x5')]){_0x11d14e[_0xb4ba('0x86')]=_[_0xb4ba('0xa7')](_0x11d14e[_0xb4ba('0x86')],{'$or':_[_0xb4ba('0xd')](_0x3c6443,function(_0x2e3e33){if(_0x2e3e33[_0xb4ba('0x12')][_0xb4ba('0xa8')]!=='VIRTUAL'){var _0x2a3144={};_0x2a3144[_0x2e3e33[_0xb4ba('0x6')]]={'$like':'%'+_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0x5')]+'%'};return _0x2a3144;}})});}var _0x50e554=[];var _0x2074e1=null;var _0x3a0e2a={};if(_0x4b33fe){_0x2074e1=_[_0xb4ba('0x93')](_0x47ca1a,[_0xb4ba('0xe'),_0x4b33fe[_0xb4ba('0xe')]]);if(_0x2074e1[_0xb4ba('0x6')]){_0x3a0e2a={};if(_0x50cf29[_0xb4ba('0x14')]===_0xb4ba('0x77')){_0x3a0e2a[_0x2074e1[_0xb4ba('0xa9')]]=_[_0xb4ba('0xd')](_0x4b33fe[_0xb4ba('0xa')],'id');}else{_0x3a0e2a[_0x2074e1[_0xb4ba('0xa9')]]=_0x4b33fe[_0xb4ba('0xa')];}_0x50e554[_0xb4ba('0x98')](_0x3a0e2a);}else{_0x11d14e['where']['id']=_0x4b33fe[_0xb4ba('0xa')];}}else{for(var _0x282f1e=0x0;_0x282f1e<_0x4e19e3['length'];_0x282f1e++){_0x2074e1=_[_0xb4ba('0x93')](_0x47ca1a,[_0xb4ba('0xe'),_0x4e19e3[_0x282f1e][_0xb4ba('0xe')]]);if(_0x2074e1[_0xb4ba('0x6')]){_0x3a0e2a={};_0x3a0e2a[_0x2074e1[_0xb4ba('0xa9')]]=_0x4e19e3[_0x282f1e][_0xb4ba('0xa')];_0x50e554[_0xb4ba('0x98')](_0x3a0e2a);}else{if(!_0x11d14e[_0xb4ba('0x86')]['id'])_0x11d14e['where']['id']=[];_0x4e19e3[_0x282f1e]['associatedResources']['forEach'](function(_0x202992){_0x11d14e[_0xb4ba('0x86')]['id'][_0xb4ba('0x98')](_0x202992);});}}}if(!_['isEmpty'](_0x50e554)){_0x11d14e[_0xb4ba('0x86')]=_[_0xb4ba('0xa7')](_0x11d14e['where'],{'$and':{'$or':_0x50e554}});}_0x11d14e=_[_0xb4ba('0xa7')]({},_0x11d14e,_0x4f5ccf['options']);if(_0x4b33fe&&!_0x4b33fe[_0xb4ba('0xaa')]&&_0x50cf29[_0xb4ba('0x14')]===_0xb4ba('0x77')){if(_0x4f5ccf[_0xb4ba('0x89')]['includeAll']){_0x11d14e[_0xb4ba('0xab')]=[{'all':!![]}];}return _0x3a3996[_0x50cf29[_0xb4ba('0x14')]][_0xb4ba('0x8')](_0x11d14e)['then'](function(_0x2398cd){var _0x4c5b9c=[];_0x2398cd[_0xb4ba('0xac')](function(_0x56b612){var _0x27d2cf;switch(_0x56b612['reportType']){case'default':_0x27d2cf=_[_0xb4ba('0x93')](_0x4b33fe[_0xb4ba('0xa')],function(_0x4bebb5){return _0x4bebb5['id']===_0x56b612[_0xb4ba('0x79')]&&_0x4bebb5[_0xb4ba('0x12')]===_0xb4ba('0xad');});break;case _0xb4ba('0xae'):_0x27d2cf=_['find'](_0x4b33fe[_0xb4ba('0xa')],function(_0x425407){return _0x425407['id']===_0x56b612[_0xb4ba('0x79')]&&_0x425407[_0xb4ba('0x12')]==='CustomReports';});break;}if(_0x27d2cf)_0x4c5b9c['push'](_0x56b612);});_0x5e2006['count']=_0x4c5b9c[_0xb4ba('0x99')];_0x5e2006[_0xb4ba('0xaf')]=_0x4c5b9c;return _0x5e2006;});}else{return _0x3a3996[_0x50cf29[_0xb4ba('0x14')]][_0xb4ba('0xb0')]({'where':_0x11d14e[_0xb4ba('0x86')]})[_0xb4ba('0x9')](function(_0x3a4070){_0x5e2006['count']=_0x3a4070;if(_0x4f5ccf[_0xb4ba('0x89')]['includeAll']){if(_0x50cf29[_0xb4ba('0x14')]===_0xb4ba('0x1e')){_0x11d14e[_0xb4ba('0xab')]=[{'model':_0x3a3996[_0xb4ba('0x6d')],'as':_0xb4ba('0xb1'),'attributes':['id',_0xb4ba('0xe'),'color'],'required':_0x4f5ccf[_0xb4ba('0x89')][_0xb4ba('0xb2')]?!![]:![]},{'model':_0x3a3996['Tag'],'as':_0xb4ba('0xb3'),'attributes':['id',_0xb4ba('0xe'),'color'],'through':_0x4f5ccf['query'][_0xb4ba('0xb2')]?{'attributes':[],'where':{'TagId':_0x4f5ccf[_0xb4ba('0x89')]['tag']||undefined}}:{},'required':_0x4f5ccf[_0xb4ba('0x89')]['tag']?!![]:![]}];}else{_0x11d14e[_0xb4ba('0xab')]=[{'all':!![]}];}}return _0x3a3996[_0x50cf29[_0xb4ba('0x14')]][_0xb4ba('0x8')](_0x11d14e);})[_0xb4ba('0x9')](function(_0x54b36e){_0x5e2006[_0xb4ba('0xaf')]=_0x54b36e;if(_0xfbe8ed===_0xb4ba('0x33')&&_0x4f5ccf['query'][_0xb4ba('0xb4')]===_0xb4ba('0xb5')){var _0x18f9d9=[];for(var _0x1300dc=0x0;_0x1300dc<_0x5e2006[_0xb4ba('0xaf')][_0xb4ba('0x99')];_0x1300dc++){_0x18f9d9[_0xb4ba('0x98')](_0x5991a3(_0xb4ba('0xb6'),_0x5e2006['rows'][_0x1300dc][_0xb4ba('0xb7')]));_0x18f9d9[_0xb4ba('0x98')](_0x5991a3(_0xb4ba('0xb8'),_0x5e2006[_0xb4ba('0xaf')][_0x1300dc][_0xb4ba('0xb7')]));_0x18f9d9[_0xb4ba('0x98')](_0x5991a3('fax',_0x5e2006[_0xb4ba('0xaf')][_0x1300dc][_0xb4ba('0xb7')]));_0x18f9d9[_0xb4ba('0x98')](_0x5991a3('mail',_0x5e2006['rows'][_0x1300dc][_0xb4ba('0xb7')]));_0x18f9d9[_0xb4ba('0x98')](_0x5991a3(_0xb4ba('0xb9'),_0x5e2006['rows'][_0x1300dc][_0xb4ba('0xb7')]));_0x18f9d9['push'](_0x5991a3(_0xb4ba('0xba'),_0x5e2006[_0xb4ba('0xaf')][_0x1300dc][_0xb4ba('0xb7')]));}return Promise['all'](_0x18f9d9)['then'](function(){return _0x5e2006;});}return _0x5e2006;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index d3b152b..b4e982a 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 _0x4910=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util'];(function(_0x26e864,_0x5bcf17){var _0x3c7f60=function(_0xa44f70){while(--_0xa44f70){_0x26e864['push'](_0x26e864['shift']());}};_0x3c7f60(++_0x5bcf17);}(_0x4910,0x1d9));var _0x0491=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4910[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});config[_0x0491('0xc')]=_['defaults'](config[_0x0491('0xc')],{'host':_0x0491('0xd'),'port':0x18eb});var socket=require(_0x0491('0xe'))(new Redis(config[_0x0491('0xc')]));require(_0x0491('0xf'))['register'](socket);function respondWithRpcPromise(_0x1a4359,_0x51bd65,_0x39bafa){return new BPromise(function(_0x1b57a1,_0x3ff9c6){return client[_0x0491('0x10')](_0x1a4359,_0x39bafa)[_0x0491('0x11')](function(_0x12ab48){logger[_0x0491('0x12')](_0x0491('0x13'),_0x51bd65,_0x0491('0x14'));logger[_0x0491('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x51bd65,_0x0491('0x14'),JSON['stringify'](_0x12ab48));if(_0x12ab48[_0x0491('0x16')]){if(_0x12ab48['error']['code']===0x1f4){logger[_0x0491('0x16')](_0x0491('0x13'),_0x51bd65,_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);return _0x3ff9c6(_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);}logger[_0x0491('0x16')](_0x0491('0x13'),_0x51bd65,_0x12ab48[_0x0491('0x16')][_0x0491('0x17')]);return _0x1b57a1(_0x12ab48['error'][_0x0491('0x17')]);}else{logger[_0x0491('0x12')](_0x0491('0x13'),_0x51bd65,_0x0491('0x14'));_0x1b57a1(_0x12ab48[_0x0491('0x18')][_0x0491('0x17')]);}})['catch'](function(_0x1a924b){logger[_0x0491('0x16')]('UserProfile,\x20%s,\x20%s',_0x51bd65,_0x1a924b);_0x3ff9c6(_0x1a924b);});});} \ No newline at end of file +var _0xd7d5=['localhost','socket.io-emitter','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x192cbe,_0x3b4b43){var _0x4ce395=function(_0x5388ae){while(--_0x5388ae){_0x192cbe['push'](_0x192cbe['shift']());}};_0x4ce395(++_0x3b4b43);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x513cae,_0x2a1776){_0x513cae=_0x513cae-0x0;var _0x379fbf=_0xd7d5[_0x513cae];return _0x379fbf;};'use strict';var _=require(_0x5d7d('0x0'));var util=require(_0x5d7d('0x1'));var moment=require(_0x5d7d('0x2'));var BPromise=require(_0x5d7d('0x3'));var rs=require(_0x5d7d('0x4'));var fs=require('fs');var Redis=require(_0x5d7d('0x5'));var db=require(_0x5d7d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d7d('0x7'))('rpc');var config=require(_0x5d7d('0x8'));var jayson=require(_0x5d7d('0x9'));var client=jayson[_0x5d7d('0xa')][_0x5d7d('0xb')]({'port':0x232a});config[_0x5d7d('0xc')]=_[_0x5d7d('0xd')](config[_0x5d7d('0xc')],{'host':_0x5d7d('0xe'),'port':0x18eb});var socket=require(_0x5d7d('0xf'))(new Redis(config[_0x5d7d('0xc')]));require('./userProfile.socket')[_0x5d7d('0x10')](socket);function respondWithRpcPromise(_0x2d1bc4,_0x32bf2c,_0x307eb8){return new BPromise(function(_0x4b890d,_0x17512e){return client[_0x5d7d('0x11')](_0x2d1bc4,_0x307eb8)[_0x5d7d('0x12')](function(_0x139664){logger['info'](_0x5d7d('0x13'),_0x32bf2c,_0x5d7d('0x14'));logger[_0x5d7d('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x32bf2c,_0x5d7d('0x14'),JSON['stringify'](_0x139664));if(_0x139664['error']){if(_0x139664['error'][_0x5d7d('0x16')]===0x1f4){logger[_0x5d7d('0x17')]('UserProfile,\x20%s,\x20%s',_0x32bf2c,_0x139664['error'][_0x5d7d('0x18')]);return _0x17512e(_0x139664[_0x5d7d('0x17')][_0x5d7d('0x18')]);}logger[_0x5d7d('0x17')](_0x5d7d('0x13'),_0x32bf2c,_0x139664['error']['message']);return _0x4b890d(_0x139664['error'][_0x5d7d('0x18')]);}else{logger[_0x5d7d('0x19')](_0x5d7d('0x13'),_0x32bf2c,_0x5d7d('0x14'));_0x4b890d(_0x139664[_0x5d7d('0x1a')][_0x5d7d('0x18')]);}})[_0x5d7d('0x1b')](function(_0x36edec){logger[_0x5d7d('0x17')](_0x5d7d('0x13'),_0x32bf2c,_0x36edec);_0x17512e(_0x36edec);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 1fc3394..59f12c4 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 _0x609e=['emit','removeListener','register','./userProfile.events','remove','update'];(function(_0x5ba683,_0x107187){var _0x1ac843=function(_0x454d5b){while(--_0x454d5b){_0x5ba683['push'](_0x5ba683['shift']());}};_0x1ac843(++_0x107187);}(_0x609e,0x19b));var _0xe609=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x609e[_0x3ff085];return _0x2b68c3;};'use strict';var UserProfileEvents=require(_0xe609('0x0'));var events=['save',_0xe609('0x1'),_0xe609('0x2')];function createListener(_0x216bee,_0x3dbdc8){return function(_0x5ef7ae){_0x3dbdc8[_0xe609('0x3')](_0x216bee,_0x5ef7ae);};}function removeListener(_0x21c014,_0x530f9a){return function(){UserProfileEvents[_0xe609('0x4')](_0x21c014,_0x530f9a);};}exports[_0xe609('0x5')]=function(_0xecb1c0){for(var _0x505a00=0x0,_0x192f91=events['length'];_0x505a00<_0x192f91;_0x505a00++){var _0x5f4569=events[_0x505a00];var _0x3ef083=createListener('userProfile:'+_0x5f4569,_0xecb1c0);UserProfileEvents['on'](_0x5f4569,_0x3ef083);}}; \ No newline at end of file +var _0x28de=['register','length','userProfile:','./userProfile.events','save','remove','update','emit','removeListener'];(function(_0xe34ba0,_0x1b4bd5){var _0x3ce284=function(_0x3f04ce){while(--_0x3f04ce){_0xe34ba0['push'](_0xe34ba0['shift']());}};_0x3ce284(++_0x1b4bd5);}(_0x28de,0x174));var _0xe28d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28de[_0x321bb2];return _0x9c12ed;};'use strict';var UserProfileEvents=require(_0xe28d('0x0'));var events=[_0xe28d('0x1'),_0xe28d('0x2'),_0xe28d('0x3')];function createListener(_0x1b98ed,_0x4a3e8c){return function(_0x4dd39e){_0x4a3e8c[_0xe28d('0x4')](_0x1b98ed,_0x4dd39e);};}function removeListener(_0x1b6543,_0x190a23){return function(){UserProfileEvents[_0xe28d('0x5')](_0x1b6543,_0x190a23);};}exports[_0xe28d('0x6')]=function(_0x42f183){for(var _0x5dfa51=0x0,_0x2ba48b=events[_0xe28d('0x7')];_0x5dfa51<_0x2ba48b;_0x5dfa51++){var _0x348958=events[_0x5dfa51];var _0x3fd0aa=createListener(_0xe28d('0x8')+_0x348958,_0x42f183);UserProfileEvents['on'](_0x348958,_0x3fd0aa);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 9b17cda..1f1a81b 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 _0x21de=['destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x21de,0x1a5));var _0xe21d=function(_0x123876,_0x322dc8){_0x123876=_0x123876-0x0;var _0xefb957=_0x21de[_0x123876];return _0xefb957;};'use strict';var multer=require('multer');var util=require(_0xe21d('0x0'));var path=require(_0xe21d('0x1'));var timeout=require('connect-timeout');var express=require(_0xe21d('0x2'));var router=express[_0xe21d('0x3')]();var fs_extra=require(_0xe21d('0x4'));var auth=require(_0xe21d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe21d('0x6'));var controller=require(_0xe21d('0x7'));router[_0xe21d('0x8')]('/',auth['isAuthenticated'](),controller[_0xe21d('0x9')]);router[_0xe21d('0x8')](_0xe21d('0xa'),auth[_0xe21d('0xb')](),controller[_0xe21d('0xc')]);router['get'](_0xe21d('0xd'),auth['isAuthenticated'](),controller[_0xe21d('0xe')]);router[_0xe21d('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe21d('0x10')](_0xe21d('0xd'),auth[_0xe21d('0xb')](),controller[_0xe21d('0x11')]);router[_0xe21d('0x12')](_0xe21d('0xd'),auth[_0xe21d('0xb')](),controller[_0xe21d('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5ba9=['update','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create'];(function(_0x48f92c,_0x4a1f8c){var _0x4f08c0=function(_0x4f8f1a){while(--_0x4f8f1a){_0x48f92c['push'](_0x48f92c['shift']());}};_0x4f08c0(++_0x4a1f8c);}(_0x5ba9,0x1a7));var _0x95ba=function(_0x32d0b8,_0x5bb9b6){_0x32d0b8=_0x32d0b8-0x0;var _0x5c41b1=_0x5ba9[_0x32d0b8];return _0x5c41b1;};'use strict';var multer=require(_0x95ba('0x0'));var util=require(_0x95ba('0x1'));var path=require('path');var timeout=require(_0x95ba('0x2'));var express=require(_0x95ba('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x95ba('0x4'));var interaction=require(_0x95ba('0x5'));var config=require(_0x95ba('0x6'));var controller=require(_0x95ba('0x7'));router['get']('/',auth[_0x95ba('0x8')](),controller[_0x95ba('0x9')]);router[_0x95ba('0xa')](_0x95ba('0xb'),auth[_0x95ba('0x8')](),controller[_0x95ba('0xc')]);router['get'](_0x95ba('0xd'),auth[_0x95ba('0x8')](),controller[_0x95ba('0xe')]);router[_0x95ba('0xf')]('/',auth[_0x95ba('0x8')](),controller[_0x95ba('0x10')]);router['put'](_0x95ba('0xd'),auth[_0x95ba('0x8')](),controller[_0x95ba('0x11')]);router[_0x95ba('0x12')]('/:id',auth[_0x95ba('0x8')](),controller[_0x95ba('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 7c16b4e..ea6fef6 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 _0xf4b5=['STRING','INTEGER','exports'];(function(_0x25e11a,_0x579eaf){var _0x281ed0=function(_0x209f13){while(--_0x209f13){_0x25e11a['push'](_0x25e11a['shift']());}};_0x281ed0(++_0x579eaf);}(_0xf4b5,0x185));var _0x5f4b=function(_0x1a55b1,_0x96ec8b){_0x1a55b1=_0x1a55b1-0x0;var _0x3ba4b0=_0xf4b5[_0x1a55b1];return _0x3ba4b0;};'use strict';var Sequelize=require('sequelize');module[_0x5f4b('0x0')]={'name':{'type':Sequelize[_0x5f4b('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x5f4b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5f4b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x86dc=['exports','STRING','INTEGER','sequelize'];(function(_0x1d3702,_0x278a04){var _0x1f5662=function(_0x2685db){while(--_0x2685db){_0x1d3702['push'](_0x1d3702['shift']());}};_0x1f5662(++_0x278a04);}(_0x86dc,0x123));var _0xc86d=function(_0x5b6a3c,_0xc0b244){_0x5b6a3c=_0x5b6a3c-0x0;var _0x4ca9fe=_0x86dc[_0x5b6a3c];return _0x4ca9fe;};'use strict';var Sequelize=require(_0xc86d('0x0'));module[_0xc86d('0x1')]={'name':{'type':Sequelize[_0xc86d('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xc86d('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc86d('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 86e3640..4562abe 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 _0xfcf0=['nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xfcf0,0x138));var _0x0fcf=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xfcf0[_0x46d0c9];return _0x174506;};'use strict';var emlformat=require(_0x0fcf('0x0'));var rimraf=require(_0x0fcf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0fcf('0x2'));var rp=require(_0x0fcf('0x3'));var moment=require(_0x0fcf('0x4'));var BPromise=require(_0x0fcf('0x5'));var Mustache=require('mustache');var util=require(_0x0fcf('0x6'));var path=require(_0x0fcf('0x7'));var sox=require(_0x0fcf('0x8'));var csv=require(_0x0fcf('0x9'));var ejs=require(_0x0fcf('0xa'));var fs=require('fs');var fs_extra=require(_0x0fcf('0xb'));var _=require(_0x0fcf('0xc'));var squel=require(_0x0fcf('0xd'));var crypto=require('crypto');var jsforce=require(_0x0fcf('0xe'));var deskjs=require(_0x0fcf('0xf'));var toCsv=require(_0x0fcf('0x9'));var querystring=require('querystring');var Papa=require(_0x0fcf('0x10'));var Redis=require(_0x0fcf('0x11'));var authService=require(_0x0fcf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0fcf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fcf('0x14'))(_0x0fcf('0x15'));var utils=require(_0x0fcf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0fcf('0x17'))['db'];function respondWithStatusCode(_0x3c999e,_0x4b4904){_0x4b4904=_0x4b4904||0xcc;return function(_0x20153d){if(_0x20153d){return _0x3c999e[_0x0fcf('0x18')](_0x4b4904);}return _0x3c999e[_0x0fcf('0x19')](_0x4b4904)[_0x0fcf('0x1a')]();};}function respondWithResult(_0x25fadc,_0x48bba6){_0x48bba6=_0x48bba6||0xc8;return function(_0xa32692){if(_0xa32692){return _0x25fadc[_0x0fcf('0x19')](_0x48bba6)[_0x0fcf('0x1b')](_0xa32692);}};}function respondWithFilteredResult(_0x5e867f,_0x3c09c4){return function(_0x610106){if(_0x610106){var _0x445207=typeof _0x3c09c4[_0x0fcf('0x1c')]==='undefined'&&typeof _0x3c09c4[_0x0fcf('0x1d')]===_0x0fcf('0x1e');var _0x1a8477=_0x610106[_0x0fcf('0x1f')];var _0x19cfbd=_0x445207?0x0:_0x3c09c4['offset'];var _0x18ea32=_0x445207?_0x610106[_0x0fcf('0x1f')]:_0x3c09c4['offset']+_0x3c09c4[_0x0fcf('0x1d')];var _0x1b9a90;if(_0x18ea32>=_0x1a8477){_0x18ea32=_0x1a8477;_0x1b9a90=0xc8;}else{_0x1b9a90=0xce;}_0x5e867f['status'](_0x1b9a90);return _0x5e867f[_0x0fcf('0x20')]('Content-Range',_0x19cfbd+'-'+_0x18ea32+'/'+_0x1a8477)[_0x0fcf('0x1b')](_0x610106);}return null;};}function patchUpdates(_0x13454e){return function(_0x5c8279){try{jsonpatch[_0x0fcf('0x21')](_0x5c8279,_0x13454e,!![]);}catch(_0x3f28d0){return BPromise[_0x0fcf('0x22')](_0x3f28d0);}return _0x5c8279['save']();};}function saveUpdates(_0x2f03ce,_0x1dafc8){return function(_0x196d30){if(_0x196d30){return _0x196d30[_0x0fcf('0x23')](_0x2f03ce)[_0x0fcf('0x24')](function(_0x30e1b0){return _0x30e1b0;});}return null;};}function removeEntity(_0x5841a9,_0x2eef74){return function(_0x253641){if(_0x253641){return _0x253641[_0x0fcf('0x25')]()[_0x0fcf('0x24')](function(){_0x5841a9[_0x0fcf('0x19')](0xcc)[_0x0fcf('0x1a')]();});}};}function handleEntityNotFound(_0x2ce990,_0x18f269){return function(_0x117510){if(!_0x117510){_0x2ce990['sendStatus'](0x194);}return _0x117510;};}function handleError(_0x18965e,_0xc107a){_0xc107a=_0xc107a||0x1f4;return function(_0x41b7a2){logger[_0x0fcf('0x26')](_0x41b7a2[_0x0fcf('0x27')]);if(_0x41b7a2[_0x0fcf('0x28')]){delete _0x41b7a2[_0x0fcf('0x28')];}_0x18965e['status'](_0xc107a)[_0x0fcf('0x29')](_0x41b7a2);};}exports[_0x0fcf('0x2a')]=function(_0x200517,_0x35180d){var _0x49fd0e={},_0x5d9bcd={},_0x4af80d={'count':0x0,'rows':[]};var _0x428194=_['map'](db[_0x0fcf('0x2b')][_0x0fcf('0x2c')],function(_0x56a416){return{'name':_0x56a416[_0x0fcf('0x2d')],'type':_0x56a416[_0x0fcf('0x2e')][_0x0fcf('0x2f')]};});_0x5d9bcd[_0x0fcf('0x30')]=_[_0x0fcf('0x31')](_0x428194,_0x0fcf('0x28'));_0x5d9bcd['query']=_[_0x0fcf('0x32')](_0x200517[_0x0fcf('0x33')]);_0x5d9bcd[_0x0fcf('0x34')]=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],_0x5d9bcd[_0x0fcf('0x33')]);_0x49fd0e['attributes']=_[_0x0fcf('0x35')](_0x5d9bcd[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x49fd0e[_0x0fcf('0x37')]=_0x49fd0e[_0x0fcf('0x37')][_0x0fcf('0x38')]?_0x49fd0e[_0x0fcf('0x37')]:_0x5d9bcd[_0x0fcf('0x30')];if(!_0x200517[_0x0fcf('0x33')][_0x0fcf('0x39')](_0x0fcf('0x3a'))){_0x49fd0e[_0x0fcf('0x1d')]=qs['limit'](_0x200517['query'][_0x0fcf('0x1d')]);_0x49fd0e['offset']=qs['offset'](_0x200517[_0x0fcf('0x33')][_0x0fcf('0x1c')]);}_0x49fd0e[_0x0fcf('0x3b')]=qs['sort'](_0x200517['query'][_0x0fcf('0x3c')]);_0x49fd0e[_0x0fcf('0x3d')]=qs[_0x0fcf('0x34')](_['pick'](_0x200517[_0x0fcf('0x33')],_0x5d9bcd[_0x0fcf('0x34')]),_0x428194);if(_0x200517[_0x0fcf('0x33')]['filter']){_0x49fd0e['where']=_['merge'](_0x49fd0e[_0x0fcf('0x3d')],{'$or':_[_0x0fcf('0x31')](_0x428194,function(_0xdfdd1){if(_0xdfdd1[_0x0fcf('0x2e')]!==_0x0fcf('0x3e')){var _0x4be8eb={};_0x4be8eb[_0xdfdd1[_0x0fcf('0x28')]]={'$like':'%'+_0x200517[_0x0fcf('0x33')][_0x0fcf('0x3f')]+'%'};return _0x4be8eb;}})});}_0x49fd0e=_['merge']({},_0x49fd0e,_0x200517['options']);var _0x13e4b2={'where':_0x49fd0e[_0x0fcf('0x3d')]};return db[_0x0fcf('0x2b')][_0x0fcf('0x1f')](_0x13e4b2)[_0x0fcf('0x24')](function(_0x4c6669){_0x4af80d[_0x0fcf('0x1f')]=_0x4c6669;if(_0x200517[_0x0fcf('0x33')][_0x0fcf('0x40')]){_0x49fd0e[_0x0fcf('0x41')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x49fd0e);})[_0x0fcf('0x24')](function(_0x2444a6){_0x4af80d['rows']=_0x2444a6;return _0x4af80d;})[_0x0fcf('0x24')](respondWithFilteredResult(_0x35180d,_0x49fd0e))[_0x0fcf('0x42')](handleError(_0x35180d,null));};exports['show']=function(_0x237fa6,_0xfc2f2b){var _0x44eb03={'raw':![],'where':{'id':_0x237fa6[_0x0fcf('0x43')]['id']}},_0x1f322b={};_0x1f322b['model']=_[_0x0fcf('0x32')](db[_0x0fcf('0x2b')]['rawAttributes']);_0x1f322b['query']=_[_0x0fcf('0x32')](_0x237fa6['query']);_0x1f322b['filters']=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],_0x1f322b[_0x0fcf('0x33')]);_0x44eb03[_0x0fcf('0x37')]=_[_0x0fcf('0x35')](_0x1f322b[_0x0fcf('0x30')],qs[_0x0fcf('0x36')](_0x237fa6[_0x0fcf('0x33')][_0x0fcf('0x36')]));_0x44eb03[_0x0fcf('0x37')]=_0x44eb03['attributes'][_0x0fcf('0x38')]?_0x44eb03[_0x0fcf('0x37')]:_0x1f322b[_0x0fcf('0x30')];if(_0x237fa6['query']['includeAll']){_0x44eb03[_0x0fcf('0x41')]=[{'all':!![]}];}_0x44eb03=_[_0x0fcf('0x44')]({},_0x44eb03,_0x237fa6[_0x0fcf('0x45')]);return db[_0x0fcf('0x2b')]['find'](_0x44eb03)['then'](handleEntityNotFound(_0xfc2f2b,null))[_0x0fcf('0x24')](respondWithResult(_0xfc2f2b,null))[_0x0fcf('0x42')](handleError(_0xfc2f2b,null));};exports[_0x0fcf('0x46')]=function(_0x1fb83d,_0x345188){return db[_0x0fcf('0x2b')][_0x0fcf('0x46')](_0x1fb83d[_0x0fcf('0x47')],{})['then'](respondWithResult(_0x345188,0xc9))['catch'](handleError(_0x345188,null));};exports[_0x0fcf('0x23')]=function(_0x243699,_0x28d2f4){if(_0x243699[_0x0fcf('0x47')]['id']){delete _0x243699[_0x0fcf('0x47')]['id'];}return db[_0x0fcf('0x2b')]['find']({'where':{'id':_0x243699[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x28d2f4,null))['then'](saveUpdates(_0x243699[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x28d2f4,null))[_0x0fcf('0x42')](handleError(_0x28d2f4,null));};exports[_0x0fcf('0x25')]=function(_0x5435c0,_0xc514bf){return db[_0x0fcf('0x2b')][_0x0fcf('0x48')]({'where':{'id':_0x5435c0[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0xc514bf,null))[_0x0fcf('0x24')](removeEntity(_0xc514bf,null))[_0x0fcf('0x42')](handleError(_0xc514bf,null));};exports[_0x0fcf('0x49')]=function(_0x389d71,_0x3a473c){return db[_0x0fcf('0x2b')][_0x0fcf('0x49')]()[_0x0fcf('0x24')](respondWithResult(_0x3a473c,null))[_0x0fcf('0x42')](handleError(_0x3a473c,null));}; \ No newline at end of file +var _0x524e=['end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','UserProfileResource','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x42eff4,_0x4f41f1){var _0x501b91=function(_0xe8d4b){while(--_0xe8d4b){_0x42eff4['push'](_0x42eff4['shift']());}};_0x501b91(++_0x4f41f1);}(_0x524e,0x15e));var _0xe524=function(_0x2259d9,_0x2e02a4){_0x2259d9=_0x2259d9-0x0;var _0x364f85=_0x524e[_0x2259d9];return _0x364f85;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['UserProfileResource'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['UserProfileResource'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};exports[_0xe524('0x4b')]=function(_0x208aa8,_0x2fa143){return db['UserProfileResource'][_0xe524('0x4b')]()[_0xe524('0x3f')](respondWithResult(_0x2fa143,null))[_0xe524('0x44')](handleError(_0x2fa143,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f907342..f9362d3 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 _0x7740=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7740,0xbe));var _0x0774=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x7740[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0x0774('0x0'));var util=require(_0x0774('0x1'));var logger=require(_0x0774('0x2'))(_0x0774('0x3'));var moment=require('moment');var BPromise=require(_0x0774('0x4'));var rp=require(_0x0774('0x5'));var fs=require('fs');var path=require(_0x0774('0x6'));var rimraf=require(_0x0774('0x7'));var config=require(_0x0774('0x8'));var attributes=require(_0x0774('0x9'));module[_0x0774('0xa')]=function(_0x5d005a,_0x13c967){return _0x5d005a[_0x0774('0xb')](_0x0774('0xc'),attributes,{'tableName':_0x0774('0xd'),'paranoid':![],'indexes':[{'name':_0x0774('0xe'),'fields':[_0x0774('0xf'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3ac=['resourceId','sectionId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources'];(function(_0x553e1e,_0x5bedef){var _0x3bb17b=function(_0x53ad59){while(--_0x53ad59){_0x553e1e['push'](_0x553e1e['shift']());}};_0x3bb17b(++_0x5bedef);}(_0xa3ac,0xa7));var _0xca3a=function(_0x1da669,_0x25fae0){_0x1da669=_0x1da669-0x0;var _0x3a17a0=_0xa3ac[_0x1da669];return _0x3a17a0;};'use strict';var _=require(_0xca3a('0x0'));var util=require(_0xca3a('0x1'));var logger=require(_0xca3a('0x2'))('api');var moment=require(_0xca3a('0x3'));var BPromise=require(_0xca3a('0x4'));var rp=require(_0xca3a('0x5'));var fs=require('fs');var path=require(_0xca3a('0x6'));var rimraf=require(_0xca3a('0x7'));var config=require(_0xca3a('0x8'));var attributes=require(_0xca3a('0x9'));module['exports']=function(_0x243b1c,_0x5cae0b){return _0x243b1c[_0xca3a('0xa')](_0xca3a('0xb'),attributes,{'tableName':_0xca3a('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xca3a('0xd'),_0xca3a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 831b16b..b117feb 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 _0x6f0d=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','UserProfileResource,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x1b4573,_0x2c5663){var _0x2f6da0=function(_0x2f3cce){while(--_0x2f3cce){_0x1b4573['push'](_0x1b4573['shift']());}};_0x2f6da0(++_0x2c5663);}(_0x6f0d,0x8f));var _0xd6f0=function(_0x19aeaa,_0x3e2c37){_0x19aeaa=_0x19aeaa-0x0;var _0x204752=_0x6f0d[_0x19aeaa];return _0x204752;};'use strict';var _=require(_0xd6f0('0x0'));var util=require(_0xd6f0('0x1'));var moment=require(_0xd6f0('0x2'));var BPromise=require(_0xd6f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6f0('0x4'));var db=require(_0xd6f0('0x5'))['db'];var utils=require(_0xd6f0('0x6'));var logger=require(_0xd6f0('0x7'))(_0xd6f0('0x8'));var config=require('../../config/environment');var jayson=require(_0xd6f0('0x9'));var client=jayson[_0xd6f0('0xa')][_0xd6f0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17b882,_0x5569ca,_0x4d745a){return new BPromise(function(_0x19b176,_0x1809aa){return client[_0xd6f0('0xc')](_0x17b882,_0x4d745a)['then'](function(_0x1311c3){logger[_0xd6f0('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x5569ca,'request\x20sent');logger[_0xd6f0('0xe')](_0xd6f0('0xf'),_0x5569ca,_0xd6f0('0x10'),JSON[_0xd6f0('0x11')](_0x1311c3));if(_0x1311c3['error']){if(_0x1311c3['error'][_0xd6f0('0x12')]===0x1f4){logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x5569ca,_0x1311c3[_0xd6f0('0x13')][_0xd6f0('0x15')]);return _0x1809aa(_0x1311c3[_0xd6f0('0x13')][_0xd6f0('0x15')]);}logger[_0xd6f0('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x5569ca,_0x1311c3[_0xd6f0('0x13')][_0xd6f0('0x15')]);return _0x19b176(_0x1311c3[_0xd6f0('0x13')][_0xd6f0('0x15')]);}else{logger[_0xd6f0('0xd')](_0xd6f0('0x14'),_0x5569ca,_0xd6f0('0x10'));_0x19b176(_0x1311c3[_0xd6f0('0x16')]['message']);}})[_0xd6f0('0x17')](function(_0x50c5d7){logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x5569ca,_0x50c5d7);_0x1809aa(_0x50c5d7);});});} \ No newline at end of file +var _0xb23f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x4739c1,_0xd1d82c){var _0x1b7f42=function(_0x316e28){while(--_0x316e28){_0x4739c1['push'](_0x4739c1['shift']());}};_0x1b7f42(++_0xd1d82c);}(_0xb23f,0x13f));var _0xfb23=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb23f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xfb23('0x0'));var moment=require(_0xfb23('0x1'));var BPromise=require(_0xfb23('0x2'));var rs=require(_0xfb23('0x3'));var fs=require('fs');var Redis=require(_0xfb23('0x4'));var db=require(_0xfb23('0x5'))['db'];var utils=require(_0xfb23('0x6'));var logger=require(_0xfb23('0x7'))(_0xfb23('0x8'));var config=require(_0xfb23('0x9'));var jayson=require(_0xfb23('0xa'));var client=jayson[_0xfb23('0xb')][_0xfb23('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4d78cd,_0x2f40a1,_0x52f11a){return new BPromise(function(_0x5640dc,_0x1aa5c9){return client['request'](_0x4d78cd,_0x52f11a)['then'](function(_0x3f4f77){logger[_0xfb23('0xd')](_0xfb23('0xe'),_0x2f40a1,'request\x20sent');logger[_0xfb23('0xf')](_0xfb23('0x10'),_0x2f40a1,_0xfb23('0x11'),JSON[_0xfb23('0x12')](_0x3f4f77));if(_0x3f4f77[_0xfb23('0x13')]){if(_0x3f4f77[_0xfb23('0x13')][_0xfb23('0x14')]===0x1f4){logger[_0xfb23('0x13')](_0xfb23('0xe'),_0x2f40a1,_0x3f4f77['error'][_0xfb23('0x15')]);return _0x1aa5c9(_0x3f4f77['error'][_0xfb23('0x15')]);}logger[_0xfb23('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x2f40a1,_0x3f4f77[_0xfb23('0x13')]['message']);return _0x5640dc(_0x3f4f77[_0xfb23('0x13')][_0xfb23('0x15')]);}else{logger[_0xfb23('0xd')](_0xfb23('0xe'),_0x2f40a1,_0xfb23('0x11'));_0x5640dc(_0x3f4f77['result']['message']);}})[_0xfb23('0x16')](function(_0x3a81b0){logger[_0xfb23('0x13')](_0xfb23('0xe'),_0x2f40a1,_0x3a81b0);_0x1aa5c9(_0x3a81b0);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 413afee..5b39dda 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 _0xae9b=['describe','/:id','post','create','put','update','delete','destroy','exports','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe'];(function(_0x404f13,_0x4fa35f){var _0x1f9dbb=function(_0x492b33){while(--_0x492b33){_0x404f13['push'](_0x404f13['shift']());}};_0x1f9dbb(++_0x4fa35f);}(_0xae9b,0x117));var _0xbae9=function(_0x15f8f4,_0x1f53ed){_0x15f8f4=_0x15f8f4-0x0;var _0x1d3aab=_0xae9b[_0x15f8f4];return _0x1d3aab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbae9('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbae9('0x1')]();var fs_extra=require(_0xbae9('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xbae9('0x3'));var config=require(_0xbae9('0x4'));var controller=require(_0xbae9('0x5'));router[_0xbae9('0x6')]('/',auth[_0xbae9('0x7')](),controller['index']);router[_0xbae9('0x6')](_0xbae9('0x8'),auth[_0xbae9('0x7')](),controller[_0xbae9('0x9')]);router[_0xbae9('0x6')](_0xbae9('0xa'),auth[_0xbae9('0x7')](),controller['show']);router[_0xbae9('0xb')]('/',auth[_0xbae9('0x7')](),controller[_0xbae9('0xc')]);router[_0xbae9('0xd')]('/:id',auth[_0xbae9('0x7')](),controller[_0xbae9('0xe')]);router[_0xbae9('0xf')](_0xbae9('0xa'),auth['isAuthenticated'](),controller[_0xbae9('0x10')]);module[_0xbae9('0x11')]=router; \ No newline at end of file +var _0x83c9=['delete','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','/describe','isAuthenticated','describe','get','show','post','put','/:id','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x83c9,0x69));var _0x983c=function(_0x2a6d45,_0x3c9321){_0x2a6d45=_0x2a6d45-0x0;var _0x295253=_0x83c9[_0x2a6d45];return _0x295253;};'use strict';var multer=require(_0x983c('0x0'));var util=require('util');var path=require(_0x983c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x983c('0x2'));var auth=require(_0x983c('0x3'));var interaction=require(_0x983c('0x4'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x983c('0x5'),auth[_0x983c('0x6')](),controller[_0x983c('0x7')]);router[_0x983c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x983c('0x9')]);router[_0x983c('0xa')]('/',auth[_0x983c('0x6')](),controller['create']);router[_0x983c('0xb')](_0x983c('0xc'),auth[_0x983c('0x6')](),controller[_0x983c('0xd')]);router[_0x983c('0xe')](_0x983c('0xc'),auth[_0x983c('0x6')](),controller[_0x983c('0xf')]);module[_0x983c('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 9763585..ed234f3 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 _0x0972=['crudPermissions','join','getDataValue','split','exports','STRING','BOOLEAN','setDataValue'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0972,0x64));var _0x2097=function(_0x4d5fdf,_0x1e687c){_0x4d5fdf=_0x4d5fdf-0x0;var _0x3798fe=_0x0972[_0x4d5fdf];return _0x3798fe;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2097('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x348ad8){this[_0x2097('0x3')](_0x2097('0x4'),_0x348ad8?_0x348ad8[_0x2097('0x5')](''):[]);},'get':function(){return this[_0x2097('0x6')](_0x2097('0x4'))?this[_0x2097('0x6')]('crudPermissions')[_0x2097('0x7')](''):[];}}}; \ No newline at end of file +var _0xae60=['setDataValue','join','getDataValue','crudPermissions','split','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x1b075e,_0x3210a9){var _0x4c3ea8=function(_0x118d99){while(--_0x118d99){_0x1b075e['push'](_0x1b075e['shift']());}};_0x4c3ea8(++_0x3210a9);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xae60[_0x4ae6ef];return _0x3cbb4e;};'use strict';var Sequelize=require(_0x0ae6('0x0'));module[_0x0ae6('0x1')]={'name':{'type':Sequelize[_0x0ae6('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0ae6('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0ae6('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0ae6('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x4c014f){this[_0x0ae6('0x5')]('crudPermissions',_0x4c014f?_0x4c014f[_0x0ae6('0x6')](''):[]);},'get':function(){return this[_0x0ae6('0x7')](_0x0ae6('0x8'))?this[_0x0ae6('0x7')](_0x0ae6('0x8'))[_0x0ae6('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 2db992c..15aa272 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 _0x1540=['map','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','UserProfileSection','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','error'];(function(_0x1f2532,_0x38c52f){var _0x330f85=function(_0x33e161){while(--_0x33e161){_0x1f2532['push'](_0x1f2532['shift']());}};_0x330f85(++_0x38c52f);}(_0x1540,0x13d));var _0x0154=function(_0x4168f7,_0xc7e745){_0x4168f7=_0x4168f7-0x0;var _0x23654d=_0x1540[_0x4168f7];return _0x23654d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0154('0x0'));var zipdir=require(_0x0154('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0154('0x2'));var moment=require(_0x0154('0x3'));var BPromise=require(_0x0154('0x4'));var Mustache=require('mustache');var util=require(_0x0154('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x0154('0x6'));var ejs=require(_0x0154('0x7'));var fs=require('fs');var fs_extra=require(_0x0154('0x8'));var _=require(_0x0154('0x9'));var squel=require(_0x0154('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0154('0xb'));var toCsv=require(_0x0154('0x6'));var querystring=require(_0x0154('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0154('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x0154('0xe'));var hardwareService=require(_0x0154('0xf'));var logger=require(_0x0154('0x10'))(_0x0154('0x11'));var utils=require(_0x0154('0x12'));var config=require(_0x0154('0x13'));var licenseUtil=require(_0x0154('0x14'));var db=require(_0x0154('0x15'))['db'];function respondWithStatusCode(_0x13197b,_0x38f7bb){_0x38f7bb=_0x38f7bb||0xcc;return function(_0x2588d2){if(_0x2588d2){return _0x13197b[_0x0154('0x16')](_0x38f7bb);}return _0x13197b[_0x0154('0x17')](_0x38f7bb)['end']();};}function respondWithResult(_0x193e78,_0x225312){_0x225312=_0x225312||0xc8;return function(_0x5593d6){if(_0x5593d6){return _0x193e78['status'](_0x225312)[_0x0154('0x18')](_0x5593d6);}};}function respondWithFilteredResult(_0xbe3e38,_0x5243dd){return function(_0x299b77){if(_0x299b77){var _0x243f84=typeof _0x5243dd[_0x0154('0x19')]===_0x0154('0x1a')&&typeof _0x5243dd[_0x0154('0x1b')]==='undefined';var _0x48cf7b=_0x299b77[_0x0154('0x1c')];var _0x2fe056=_0x243f84?0x0:_0x5243dd[_0x0154('0x19')];var _0x13cbdf=_0x243f84?_0x299b77['count']:_0x5243dd[_0x0154('0x19')]+_0x5243dd[_0x0154('0x1b')];var _0x70ccd7;if(_0x13cbdf>=_0x48cf7b){_0x13cbdf=_0x48cf7b;_0x70ccd7=0xc8;}else{_0x70ccd7=0xce;}_0xbe3e38[_0x0154('0x17')](_0x70ccd7);return _0xbe3e38[_0x0154('0x1d')](_0x0154('0x1e'),_0x2fe056+'-'+_0x13cbdf+'/'+_0x48cf7b)[_0x0154('0x18')](_0x299b77);}return null;};}function patchUpdates(_0x599572){return function(_0x11d129){try{jsonpatch['apply'](_0x11d129,_0x599572,!![]);}catch(_0x5892e9){return BPromise[_0x0154('0x1f')](_0x5892e9);}return _0x11d129[_0x0154('0x20')]();};}function saveUpdates(_0x55220a,_0x5f10c7){return function(_0x2e7418){if(_0x2e7418){return _0x2e7418[_0x0154('0x21')](_0x55220a)['then'](function(_0x2695b0){return _0x2695b0;});}return null;};}function removeEntity(_0x544c34,_0x47589f){return function(_0x4a1a28){if(_0x4a1a28){return _0x4a1a28[_0x0154('0x22')]()[_0x0154('0x23')](function(){_0x544c34[_0x0154('0x17')](0xcc)[_0x0154('0x24')]();});}};}function handleEntityNotFound(_0x497f52,_0x3f8571){return function(_0x3dffc7){if(!_0x3dffc7){_0x497f52[_0x0154('0x16')](0x194);}return _0x3dffc7;};}function handleError(_0x31bfa7,_0x43a9bc){_0x43a9bc=_0x43a9bc||0x1f4;return function(_0x58a579){logger[_0x0154('0x25')](_0x58a579['stack']);if(_0x58a579['name']){delete _0x58a579['name'];}_0x31bfa7[_0x0154('0x17')](_0x43a9bc)['send'](_0x58a579);};}exports['index']=function(_0x5d7162,_0x4a15f3){var _0x47719d={},_0x1bdaf3={},_0x5cb333={'count':0x0,'rows':[]};var _0xa79350=_[_0x0154('0x26')](db['UserProfileSection'][_0x0154('0x27')],function(_0x11d00d){return{'name':_0x11d00d[_0x0154('0x28')],'type':_0x11d00d[_0x0154('0x29')][_0x0154('0x2a')]};});_0x1bdaf3['model']=_[_0x0154('0x26')](_0xa79350,_0x0154('0x2b'));_0x1bdaf3[_0x0154('0x2c')]=_[_0x0154('0x2d')](_0x5d7162[_0x0154('0x2c')]);_0x1bdaf3[_0x0154('0x2e')]=_[_0x0154('0x2f')](_0x1bdaf3['model'],_0x1bdaf3[_0x0154('0x2c')]);_0x47719d[_0x0154('0x30')]=_[_0x0154('0x2f')](_0x1bdaf3[_0x0154('0x31')],qs[_0x0154('0x32')](_0x5d7162['query'][_0x0154('0x32')]));_0x47719d[_0x0154('0x30')]=_0x47719d[_0x0154('0x30')][_0x0154('0x33')]?_0x47719d['attributes']:_0x1bdaf3[_0x0154('0x31')];if(!_0x5d7162['query'][_0x0154('0x34')](_0x0154('0x35'))){_0x47719d[_0x0154('0x1b')]=qs[_0x0154('0x1b')](_0x5d7162[_0x0154('0x2c')][_0x0154('0x1b')]);_0x47719d['offset']=qs[_0x0154('0x19')](_0x5d7162[_0x0154('0x2c')][_0x0154('0x19')]);}_0x47719d['order']=qs[_0x0154('0x36')](_0x5d7162[_0x0154('0x2c')][_0x0154('0x36')]);_0x47719d[_0x0154('0x37')]=qs[_0x0154('0x2e')](_['pick'](_0x5d7162[_0x0154('0x2c')],_0x1bdaf3[_0x0154('0x2e')]),_0xa79350);if(_0x5d7162[_0x0154('0x2c')][_0x0154('0x38')]){_0x47719d[_0x0154('0x37')]=_[_0x0154('0x39')](_0x47719d[_0x0154('0x37')],{'$or':_['map'](_0xa79350,function(_0x2ac636){if(_0x2ac636['type']!=='VIRTUAL'){var _0x14dcaf={};_0x14dcaf[_0x2ac636[_0x0154('0x2b')]]={'$like':'%'+_0x5d7162[_0x0154('0x2c')]['filter']+'%'};return _0x14dcaf;}})});}_0x47719d=_[_0x0154('0x39')]({},_0x47719d,_0x5d7162['options']);var _0x6a4147={'where':_0x47719d[_0x0154('0x37')]};return db[_0x0154('0x3a')][_0x0154('0x1c')](_0x6a4147)[_0x0154('0x23')](function(_0x17b2ec){_0x5cb333[_0x0154('0x1c')]=_0x17b2ec;if(_0x5d7162[_0x0154('0x2c')]['includeAll']){_0x47719d[_0x0154('0x3b')]=[{'all':!![]}];}return db['UserProfileSection'][_0x0154('0x3c')](_0x47719d);})['then'](function(_0x2902ad){_0x5cb333[_0x0154('0x3d')]=_0x2902ad;return _0x5cb333;})[_0x0154('0x23')](respondWithFilteredResult(_0x4a15f3,_0x47719d))[_0x0154('0x3e')](handleError(_0x4a15f3,null));};exports[_0x0154('0x3f')]=function(_0x12fa7b,_0x4780f0){var _0x8c0d65={'raw':![],'where':{'id':_0x12fa7b[_0x0154('0x40')]['id']}},_0x40709f={};_0x40709f['model']=_[_0x0154('0x2d')](db['UserProfileSection'][_0x0154('0x27')]);_0x40709f[_0x0154('0x2c')]=_[_0x0154('0x2d')](_0x12fa7b['query']);_0x40709f['filters']=_[_0x0154('0x2f')](_0x40709f[_0x0154('0x31')],_0x40709f[_0x0154('0x2c')]);_0x8c0d65[_0x0154('0x30')]=_[_0x0154('0x2f')](_0x40709f['model'],qs[_0x0154('0x32')](_0x12fa7b[_0x0154('0x2c')][_0x0154('0x32')]));_0x8c0d65[_0x0154('0x30')]=_0x8c0d65['attributes'][_0x0154('0x33')]?_0x8c0d65[_0x0154('0x30')]:_0x40709f['model'];if(_0x12fa7b['query'][_0x0154('0x41')]){_0x8c0d65[_0x0154('0x3b')]=[{'all':!![]}];}_0x8c0d65=_[_0x0154('0x39')]({},_0x8c0d65,_0x12fa7b[_0x0154('0x42')]);return db[_0x0154('0x3a')][_0x0154('0x43')](_0x8c0d65)['then'](handleEntityNotFound(_0x4780f0,null))['then'](respondWithResult(_0x4780f0,null))['catch'](handleError(_0x4780f0,null));};exports[_0x0154('0x44')]=function(_0x45580a,_0x152de9){return db[_0x0154('0x3a')][_0x0154('0x44')](_0x45580a[_0x0154('0x45')],{})[_0x0154('0x23')](respondWithResult(_0x152de9,0xc9))[_0x0154('0x3e')](handleError(_0x152de9,null));};exports[_0x0154('0x21')]=function(_0x4729b3,_0x348f24){if(_0x4729b3[_0x0154('0x45')]['id']){delete _0x4729b3[_0x0154('0x45')]['id'];}return db[_0x0154('0x3a')][_0x0154('0x43')]({'where':{'id':_0x4729b3[_0x0154('0x40')]['id']}})[_0x0154('0x23')](handleEntityNotFound(_0x348f24,null))[_0x0154('0x23')](saveUpdates(_0x4729b3[_0x0154('0x45')],null))[_0x0154('0x23')](respondWithResult(_0x348f24,null))[_0x0154('0x3e')](handleError(_0x348f24,null));};exports[_0x0154('0x22')]=function(_0x16631f,_0x10b730){return db[_0x0154('0x3a')][_0x0154('0x43')]({'where':{'id':_0x16631f[_0x0154('0x40')]['id']}})[_0x0154('0x23')](handleEntityNotFound(_0x10b730,null))['then'](removeEntity(_0x10b730,null))[_0x0154('0x3e')](handleError(_0x10b730,null));};exports[_0x0154('0x46')]=function(_0x2deb52,_0x4d7a66){return db['UserProfileSection'][_0x0154('0x46')]()[_0x0154('0x23')](respondWithResult(_0x4d7a66,null))[_0x0154('0x3e')](handleError(_0x4d7a66,null));}; \ No newline at end of file +var _0x00c2=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','findAll','rows','show','include','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x00c2,0xae));var _0x200c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x00c2[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x200c('0x0'));var rimraf=require(_0x200c('0x1'));var zipdir=require(_0x200c('0x2'));var jsonpatch=require(_0x200c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x200c('0x4'));var util=require(_0x200c('0x5'));var path=require(_0x200c('0x6'));var sox=require(_0x200c('0x7'));var csv=require(_0x200c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x200c('0x9'));var jsforce=require(_0x200c('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x200c('0xb'));var Papa=require(_0x200c('0xc'));var Redis=require(_0x200c('0xd'));var authService=require(_0x200c('0xe'));var qs=require(_0x200c('0xf'));var as=require(_0x200c('0x10'));var hardwareService=require(_0x200c('0x11'));var logger=require(_0x200c('0x12'))(_0x200c('0x13'));var utils=require(_0x200c('0x14'));var config=require(_0x200c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x200c('0x16'))['db'];function respondWithStatusCode(_0x11b7f5,_0x4ff288){_0x4ff288=_0x4ff288||0xcc;return function(_0x3d604d){if(_0x3d604d){return _0x11b7f5[_0x200c('0x17')](_0x4ff288);}return _0x11b7f5[_0x200c('0x18')](_0x4ff288)['end']();};}function respondWithResult(_0x3ac2aa,_0x3b337b){_0x3b337b=_0x3b337b||0xc8;return function(_0x4717ce){if(_0x4717ce){return _0x3ac2aa[_0x200c('0x18')](_0x3b337b)[_0x200c('0x19')](_0x4717ce);}};}function respondWithFilteredResult(_0x578b8c,_0x7b0d1b){return function(_0x191b2f){if(_0x191b2f){var _0x1c75ad=typeof _0x7b0d1b['offset']===_0x200c('0x1a')&&typeof _0x7b0d1b['limit']===_0x200c('0x1a');var _0x200439=_0x191b2f[_0x200c('0x1b')];var _0x3d9263=_0x1c75ad?0x0:_0x7b0d1b[_0x200c('0x1c')];var _0xce55f9=_0x1c75ad?_0x191b2f[_0x200c('0x1b')]:_0x7b0d1b[_0x200c('0x1c')]+_0x7b0d1b[_0x200c('0x1d')];var _0xa68c7b;if(_0xce55f9>=_0x200439){_0xce55f9=_0x200439;_0xa68c7b=0xc8;}else{_0xa68c7b=0xce;}_0x578b8c[_0x200c('0x18')](_0xa68c7b);return _0x578b8c[_0x200c('0x1e')](_0x200c('0x1f'),_0x3d9263+'-'+_0xce55f9+'/'+_0x200439)[_0x200c('0x19')](_0x191b2f);}return null;};}function patchUpdates(_0x15303d){return function(_0x979cd5){try{jsonpatch[_0x200c('0x20')](_0x979cd5,_0x15303d,!![]);}catch(_0x518fc2){return BPromise[_0x200c('0x21')](_0x518fc2);}return _0x979cd5['save']();};}function saveUpdates(_0x3afb9c,_0xc0447e){return function(_0x4e8c0a){if(_0x4e8c0a){return _0x4e8c0a[_0x200c('0x22')](_0x3afb9c)[_0x200c('0x23')](function(_0x406ab8){return _0x406ab8;});}return null;};}function removeEntity(_0x309fc3,_0x1445c9){return function(_0x4e8343){if(_0x4e8343){return _0x4e8343[_0x200c('0x24')]()['then'](function(){_0x309fc3['status'](0xcc)[_0x200c('0x25')]();});}};}function handleEntityNotFound(_0x20db11,_0x314d24){return function(_0x3c0e5c){if(!_0x3c0e5c){_0x20db11['sendStatus'](0x194);}return _0x3c0e5c;};}function handleError(_0x4cded0,_0x3dec8c){_0x3dec8c=_0x3dec8c||0x1f4;return function(_0x5cc075){logger[_0x200c('0x26')](_0x5cc075[_0x200c('0x27')]);if(_0x5cc075[_0x200c('0x28')]){delete _0x5cc075[_0x200c('0x28')];}_0x4cded0[_0x200c('0x18')](_0x3dec8c)[_0x200c('0x29')](_0x5cc075);};}exports[_0x200c('0x2a')]=function(_0x2a66c3,_0x712634){var _0x33a0bd={},_0x185c1d={},_0x7ff488={'count':0x0,'rows':[]};var _0x1eda7e=_[_0x200c('0x2b')](db[_0x200c('0x2c')][_0x200c('0x2d')],function(_0x56c4e8){return{'name':_0x56c4e8[_0x200c('0x2e')],'type':_0x56c4e8[_0x200c('0x2f')]['key']};});_0x185c1d[_0x200c('0x30')]=_[_0x200c('0x2b')](_0x1eda7e,_0x200c('0x28'));_0x185c1d['query']=_[_0x200c('0x31')](_0x2a66c3[_0x200c('0x32')]);_0x185c1d[_0x200c('0x33')]=_['intersection'](_0x185c1d[_0x200c('0x30')],_0x185c1d[_0x200c('0x32')]);_0x33a0bd[_0x200c('0x34')]=_[_0x200c('0x35')](_0x185c1d[_0x200c('0x30')],qs['fields'](_0x2a66c3[_0x200c('0x32')][_0x200c('0x36')]));_0x33a0bd[_0x200c('0x34')]=_0x33a0bd[_0x200c('0x34')][_0x200c('0x37')]?_0x33a0bd[_0x200c('0x34')]:_0x185c1d[_0x200c('0x30')];if(!_0x2a66c3[_0x200c('0x32')][_0x200c('0x38')](_0x200c('0x39'))){_0x33a0bd[_0x200c('0x1d')]=qs[_0x200c('0x1d')](_0x2a66c3[_0x200c('0x32')][_0x200c('0x1d')]);_0x33a0bd[_0x200c('0x1c')]=qs[_0x200c('0x1c')](_0x2a66c3[_0x200c('0x32')][_0x200c('0x1c')]);}_0x33a0bd[_0x200c('0x3a')]=qs[_0x200c('0x3b')](_0x2a66c3['query'][_0x200c('0x3b')]);_0x33a0bd[_0x200c('0x3c')]=qs[_0x200c('0x33')](_[_0x200c('0x3d')](_0x2a66c3[_0x200c('0x32')],_0x185c1d[_0x200c('0x33')]),_0x1eda7e);if(_0x2a66c3[_0x200c('0x32')][_0x200c('0x3e')]){_0x33a0bd[_0x200c('0x3c')]=_['merge'](_0x33a0bd['where'],{'$or':_[_0x200c('0x2b')](_0x1eda7e,function(_0x5d491f){if(_0x5d491f[_0x200c('0x2f')]!=='VIRTUAL'){var _0x54afc6={};_0x54afc6[_0x5d491f[_0x200c('0x28')]]={'$like':'%'+_0x2a66c3[_0x200c('0x32')][_0x200c('0x3e')]+'%'};return _0x54afc6;}})});}_0x33a0bd=_['merge']({},_0x33a0bd,_0x2a66c3[_0x200c('0x3f')]);var _0x271ba9={'where':_0x33a0bd['where']};return db[_0x200c('0x2c')][_0x200c('0x1b')](_0x271ba9)[_0x200c('0x23')](function(_0x503be5){_0x7ff488[_0x200c('0x1b')]=_0x503be5;if(_0x2a66c3[_0x200c('0x32')][_0x200c('0x40')]){_0x33a0bd['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x200c('0x41')](_0x33a0bd);})[_0x200c('0x23')](function(_0x3eb9a2){_0x7ff488[_0x200c('0x42')]=_0x3eb9a2;return _0x7ff488;})[_0x200c('0x23')](respondWithFilteredResult(_0x712634,_0x33a0bd))['catch'](handleError(_0x712634,null));};exports[_0x200c('0x43')]=function(_0x52c583,_0x1c1bc5){var _0xc8dfa6={'raw':![],'where':{'id':_0x52c583['params']['id']}},_0x300d54={};_0x300d54[_0x200c('0x30')]=_[_0x200c('0x31')](db['UserProfileSection'][_0x200c('0x2d')]);_0x300d54[_0x200c('0x32')]=_[_0x200c('0x31')](_0x52c583[_0x200c('0x32')]);_0x300d54['filters']=_[_0x200c('0x35')](_0x300d54['model'],_0x300d54[_0x200c('0x32')]);_0xc8dfa6['attributes']=_[_0x200c('0x35')](_0x300d54['model'],qs[_0x200c('0x36')](_0x52c583[_0x200c('0x32')][_0x200c('0x36')]));_0xc8dfa6['attributes']=_0xc8dfa6[_0x200c('0x34')][_0x200c('0x37')]?_0xc8dfa6[_0x200c('0x34')]:_0x300d54['model'];if(_0x52c583[_0x200c('0x32')][_0x200c('0x40')]){_0xc8dfa6[_0x200c('0x44')]=[{'all':!![]}];}_0xc8dfa6=_[_0x200c('0x45')]({},_0xc8dfa6,_0x52c583[_0x200c('0x3f')]);return db[_0x200c('0x2c')][_0x200c('0x46')](_0xc8dfa6)[_0x200c('0x23')](handleEntityNotFound(_0x1c1bc5,null))[_0x200c('0x23')](respondWithResult(_0x1c1bc5,null))[_0x200c('0x47')](handleError(_0x1c1bc5,null));};exports[_0x200c('0x48')]=function(_0x5478e5,_0x11db87){return db[_0x200c('0x2c')][_0x200c('0x48')](_0x5478e5[_0x200c('0x49')],{})[_0x200c('0x23')](respondWithResult(_0x11db87,0xc9))[_0x200c('0x47')](handleError(_0x11db87,null));};exports[_0x200c('0x22')]=function(_0x404d3f,_0x8f139f){if(_0x404d3f[_0x200c('0x49')]['id']){delete _0x404d3f['body']['id'];}return db[_0x200c('0x2c')]['find']({'where':{'id':_0x404d3f[_0x200c('0x4a')]['id']}})[_0x200c('0x23')](handleEntityNotFound(_0x8f139f,null))[_0x200c('0x23')](saveUpdates(_0x404d3f[_0x200c('0x49')],null))[_0x200c('0x23')](respondWithResult(_0x8f139f,null))['catch'](handleError(_0x8f139f,null));};exports['destroy']=function(_0x107b7a,_0x1d7491){return db[_0x200c('0x2c')]['find']({'where':{'id':_0x107b7a[_0x200c('0x4a')]['id']}})[_0x200c('0x23')](handleEntityNotFound(_0x1d7491,null))[_0x200c('0x23')](removeEntity(_0x1d7491,null))[_0x200c('0x47')](handleError(_0x1d7491,null));};exports[_0x200c('0x4b')]=function(_0x50a8e0,_0x476fd6){return db['UserProfileSection'][_0x200c('0x4b')]()[_0x200c('0x23')](respondWithResult(_0x476fd6,null))[_0x200c('0x47')](handleError(_0x476fd6,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index edb6757..2235006 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 _0x9133=['util','../../config/logger','api','moment','bluebird','rimraf','./userProfileSection.attributes','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x9133,0x178));var _0x3913=function(_0x57fcc0,_0x585004){_0x57fcc0=_0x57fcc0-0x0;var _0x5270df=_0x9133[_0x57fcc0];return _0x5270df;};'use strict';var _=require(_0x3913('0x0'));var util=require(_0x3913('0x1'));var logger=require(_0x3913('0x2'))(_0x3913('0x3'));var moment=require(_0x3913('0x4'));var BPromise=require(_0x3913('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3913('0x6'));var config=require('../../config/environment');var attributes=require(_0x3913('0x7'));module['exports']=function(_0x488212,_0x1e151e){return _0x488212[_0x3913('0x8')]('UserProfileSection',attributes,{'tableName':_0x3913('0x9'),'paranoid':![],'indexes':[{'name':_0x3913('0xa'),'fields':[_0x3913('0xb'),_0x3913('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91ed=['UserProfileSection','compositeIndex','sectionId','util','../../config/logger','api','moment','bluebird','rimraf','./userProfileSection.attributes','exports','define'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x91ed,0xab));var _0xd91e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x91ed[_0x36ed48];return _0x51c63a;};'use strict';var _=require('lodash');var util=require(_0xd91e('0x0'));var logger=require(_0xd91e('0x1'))(_0xd91e('0x2'));var moment=require(_0xd91e('0x3'));var BPromise=require(_0xd91e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd91e('0x5'));var config=require('../../config/environment');var attributes=require(_0xd91e('0x6'));module[_0xd91e('0x7')]=function(_0x480dc8,_0x4681d2){return _0x480dc8[_0xd91e('0x8')](_0xd91e('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xd91e('0xa'),'fields':[_0xd91e('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 48889d5..ca55457 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 _0x6722=['info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x372e59,_0x22f9fe){var _0x17730e=function(_0x54f373){while(--_0x54f373){_0x372e59['push'](_0x372e59['shift']());}};_0x17730e(++_0x22f9fe);}(_0x6722,0x12d));var _0x2672=function(_0x4f15f9,_0xa04e46){_0x4f15f9=_0x4f15f9-0x0;var _0x8b85cd=_0x6722[_0x4f15f9];return _0x8b85cd;};'use strict';var _=require(_0x2672('0x0'));var util=require(_0x2672('0x1'));var moment=require(_0x2672('0x2'));var BPromise=require(_0x2672('0x3'));var rs=require(_0x2672('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2672('0x5'))['db'];var utils=require(_0x2672('0x6'));var logger=require(_0x2672('0x7'))(_0x2672('0x8'));var config=require(_0x2672('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2672('0xa')][_0x2672('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ec367,_0x16de1c,_0x230304){return new BPromise(function(_0x3d8280,_0x43dbde){return client[_0x2672('0xc')](_0x5ec367,_0x230304)[_0x2672('0xd')](function(_0x17611e){logger[_0x2672('0xe')](_0x2672('0xf'),_0x16de1c,_0x2672('0x10'));logger[_0x2672('0x11')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x16de1c,_0x2672('0x10'),JSON['stringify'](_0x17611e));if(_0x17611e['error']){if(_0x17611e[_0x2672('0x12')]['code']===0x1f4){logger['error'](_0x2672('0xf'),_0x16de1c,_0x17611e[_0x2672('0x12')]['message']);return _0x43dbde(_0x17611e[_0x2672('0x12')][_0x2672('0x13')]);}logger['error'](_0x2672('0xf'),_0x16de1c,_0x17611e[_0x2672('0x12')][_0x2672('0x13')]);return _0x3d8280(_0x17611e[_0x2672('0x12')]['message']);}else{logger[_0x2672('0xe')](_0x2672('0xf'),_0x16de1c,_0x2672('0x10'));_0x3d8280(_0x17611e[_0x2672('0x14')][_0x2672('0x13')]);}})['catch'](function(_0xc65170){logger[_0x2672('0x12')](_0x2672('0xf'),_0x16de1c,_0xc65170);_0x43dbde(_0xc65170);});});} \ No newline at end of file +var _0x96e8=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x5bb1ff,_0x18e742){var _0x4f9e94=function(_0x3b7e72){while(--_0x3b7e72){_0x5bb1ff['push'](_0x5bb1ff['shift']());}};_0x4f9e94(++_0x18e742);}(_0x96e8,0x99));var _0x896e=function(_0xbc4f9f,_0x111984){_0xbc4f9f=_0xbc4f9f-0x0;var _0x3bec7d=_0x96e8[_0xbc4f9f];return _0x3bec7d;};'use strict';var _=require(_0x896e('0x0'));var util=require(_0x896e('0x1'));var moment=require(_0x896e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x896e('0x3'));var db=require(_0x896e('0x4'))['db'];var utils=require(_0x896e('0x5'));var logger=require(_0x896e('0x6'))(_0x896e('0x7'));var config=require(_0x896e('0x8'));var jayson=require(_0x896e('0x9'));var client=jayson[_0x896e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29dac4,_0x455a76,_0x148d7b){return new BPromise(function(_0x5943b2,_0x2277cf){return client[_0x896e('0xb')](_0x29dac4,_0x148d7b)[_0x896e('0xc')](function(_0x3b4ed3){logger[_0x896e('0xd')](_0x896e('0xe'),_0x455a76,'request\x20sent');logger[_0x896e('0xf')](_0x896e('0x10'),_0x455a76,_0x896e('0x11'),JSON[_0x896e('0x12')](_0x3b4ed3));if(_0x3b4ed3[_0x896e('0x13')]){if(_0x3b4ed3[_0x896e('0x13')]['code']===0x1f4){logger['error'](_0x896e('0xe'),_0x455a76,_0x3b4ed3[_0x896e('0x13')]['message']);return _0x2277cf(_0x3b4ed3['error'][_0x896e('0x14')]);}logger[_0x896e('0x13')](_0x896e('0xe'),_0x455a76,_0x3b4ed3[_0x896e('0x13')][_0x896e('0x14')]);return _0x5943b2(_0x3b4ed3[_0x896e('0x13')]['message']);}else{logger[_0x896e('0xd')](_0x896e('0xe'),_0x455a76,'request\x20sent');_0x5943b2(_0x3b4ed3[_0x896e('0x15')][_0x896e('0x14')]);}})['catch'](function(_0x54a069){logger[_0x896e('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x455a76,_0x54a069);_0x2277cf(_0x54a069);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index afe76a5..838f13f 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3c5818,_0x2c8848){var _0x382924=function(_0x39c3d7){while(--_0x39c3d7){_0x3c5818['push'](_0x3c5818['shift']());}};_0x382924(++_0x2c8848);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1507cd,_0x46d7a1){var _0x24a2b1=function(_0x988fd2){while(--_0x988fd2){_0x1507cd['push'](_0x1507cd['shift']());}};_0x24a2b1(++_0x46d7a1);}(_0x70e0,0x17b));var _0x070e=function(_0x5f47c3,_0x3922b6){_0x5f47c3=_0x5f47c3-0x0;var _0x1a0f2a=_0x70e0[_0x5f47c3];return _0x1a0f2a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index c95c6d2..e8a99ad 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 _0x887d=['exports','INTEGER','sequelize'];(function(_0x810c47,_0x583a77){var _0x4339c5=function(_0x2d0a9e){while(--_0x2d0a9e){_0x810c47['push'](_0x810c47['shift']());}};_0x4339c5(++_0x583a77);}(_0x887d,0x19d));var _0xd887=function(_0x295d74,_0x8f3175){_0x295d74=_0x295d74-0x0;var _0x4663d0=_0x887d[_0x295d74];return _0x4663d0;};'use strict';var Sequelize=require(_0xd887('0x0'));module[_0xd887('0x1')]={'penalty':{'type':Sequelize[_0xd887('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfb82=['exports','INTEGER','sequelize'];(function(_0x4de77b,_0x3c6be9){var _0x1d4541=function(_0x49add3){while(--_0x49add3){_0x4de77b['push'](_0x4de77b['shift']());}};_0x1d4541(++_0x3c6be9);}(_0xfb82,0x17f));var _0x2fb8=function(_0x10e25c,_0x5a895b){_0x10e25c=_0x10e25c-0x0;var _0x19da00=_0xfb82[_0x10e25c];return _0x19da00;};'use strict';var Sequelize=require(_0x2fb8('0x0'));module[_0x2fb8('0x1')]={'penalty':{'type':Sequelize[_0x2fb8('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 fc27bd6..e0efcd2 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 _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','lodash','util'];(function(_0x460091,_0x157b5a){var _0x2a843f=function(_0x270ea7){while(--_0x270ea7){_0x460091['push'](_0x460091['shift']());}};_0x2a843f(++_0x157b5a);}(_0xf494,0x1c6));var _0x4f49=function(_0x470db9,_0x934588){_0x470db9=_0x470db9-0x0;var _0x6b5253=_0xf494[_0x470db9];return _0x6b5253;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf1b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','lodash','util','../../config/logger','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x6bf9fc,_0x3a6e41){_0x6bf9fc=_0x6bf9fc-0x0;var _0x29a0ac=_0xaf1b[_0x6bf9fc];return _0x29a0ac;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var logger=require(_0xbaf1('0x2'))(_0xbaf1('0x3'));var moment=require(_0xbaf1('0x4'));var BPromise=require(_0xbaf1('0x5'));var rp=require(_0xbaf1('0x6'));var fs=require('fs');var path=require(_0xbaf1('0x7'));var rimraf=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var attributes=require(_0xbaf1('0xa'));module[_0xbaf1('0xb')]=function(_0x7dd657,_0x2f05ad){return _0x7dd657['define'](_0xbaf1('0xc'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 39dc8c1..104f709 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 _0x4962=['moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','util'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4962,0x103));var _0x2496=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x4962[_0x5c7e53];return _0x1c9af9;};'use strict';var _=require('lodash');var util=require(_0x2496('0x0'));var moment=require(_0x2496('0x1'));var BPromise=require(_0x2496('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2496('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2496('0x4'))(_0x2496('0x5'));var config=require(_0x2496('0x6'));var jayson=require(_0x2496('0x7'));var client=jayson[_0x2496('0x8')][_0x2496('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x544682,_0x5b54a3,_0x2a5b65){return new BPromise(function(_0x3312f7,_0x5d8f34){return client[_0x2496('0xa')](_0x544682,_0x2a5b65)[_0x2496('0xb')](function(_0x2102f1){logger[_0x2496('0xc')](_0x2496('0xd'),_0x5b54a3,_0x2496('0xe'));logger[_0x2496('0xf')](_0x2496('0x10'),_0x5b54a3,_0x2496('0xe'),JSON['stringify'](_0x2102f1));if(_0x2102f1['error']){if(_0x2102f1['error']['code']===0x1f4){logger[_0x2496('0x11')](_0x2496('0xd'),_0x5b54a3,_0x2102f1[_0x2496('0x11')][_0x2496('0x12')]);return _0x5d8f34(_0x2102f1[_0x2496('0x11')][_0x2496('0x12')]);}logger[_0x2496('0x11')](_0x2496('0xd'),_0x5b54a3,_0x2102f1[_0x2496('0x11')]['message']);return _0x3312f7(_0x2102f1['error']['message']);}else{logger[_0x2496('0xc')](_0x2496('0xd'),_0x5b54a3,'request\x20sent');_0x3312f7(_0x2102f1['result']['message']);}})[_0x2496('0x13')](function(_0x4ab3ee){logger[_0x2496('0x11')](_0x2496('0xd'),_0x5b54a3,_0x4ab3ee);_0x5d8f34(_0x4ab3ee);});});} \ No newline at end of file +var _0x0233=['stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x2351c4,_0x1dca54){var _0x1dd3f8=function(_0x4c3fa2){while(--_0x4c3fa2){_0x2351c4['push'](_0x2351c4['shift']());}};_0x1dd3f8(++_0x1dca54);}(_0x0233,0x149));var _0x3023=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x0233[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x3023('0x0'));var util=require(_0x3023('0x1'));var moment=require('moment');var BPromise=require(_0x3023('0x2'));var rs=require(_0x3023('0x3'));var fs=require('fs');var Redis=require(_0x3023('0x4'));var db=require(_0x3023('0x5'))['db'];var utils=require(_0x3023('0x6'));var logger=require(_0x3023('0x7'))(_0x3023('0x8'));var config=require(_0x3023('0x9'));var jayson=require(_0x3023('0xa'));var client=jayson[_0x3023('0xb')][_0x3023('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x525e54,_0x3091bb,_0x5791a8){return new BPromise(function(_0x10c000,_0x17947e){return client[_0x3023('0xd')](_0x525e54,_0x5791a8)['then'](function(_0x18634b){logger['info']('UserSmsQueue,\x20%s,\x20%s',_0x3091bb,_0x3023('0xe'));logger['debug'](_0x3023('0xf'),_0x3091bb,'request\x20sent',JSON[_0x3023('0x10')](_0x18634b));if(_0x18634b['error']){if(_0x18634b[_0x3023('0x11')][_0x3023('0x12')]===0x1f4){logger[_0x3023('0x11')](_0x3023('0x13'),_0x3091bb,_0x18634b['error'][_0x3023('0x14')]);return _0x17947e(_0x18634b[_0x3023('0x11')][_0x3023('0x14')]);}logger[_0x3023('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x3091bb,_0x18634b[_0x3023('0x11')][_0x3023('0x14')]);return _0x10c000(_0x18634b[_0x3023('0x11')]['message']);}else{logger[_0x3023('0x15')](_0x3023('0x13'),_0x3091bb,'request\x20sent');_0x10c000(_0x18634b['result']['message']);}})[_0x3023('0x16')](function(_0x33241c){logger['error'](_0x3023('0x13'),_0x3091bb,_0x33241c);_0x17947e(_0x33241c);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 614fdbc..dd86ff3 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 _0xffe7=['sequelize','INTEGER'];(function(_0x27519f,_0x49216a){var _0x149a8e=function(_0x386ade){while(--_0x386ade){_0x27519f['push'](_0x27519f['shift']());}};_0x149a8e(++_0x49216a);}(_0xffe7,0xc8));var _0x7ffe=function(_0x3166f4,_0x2107e5){_0x3166f4=_0x3166f4-0x0;var _0x1d6d2b=_0xffe7[_0x3166f4];return _0x1d6d2b;};'use strict';var Sequelize=require(_0x7ffe('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x7ffe('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x7ffe('0x1')]}}; \ No newline at end of file +var _0xc5e1=['INTEGER','exports'];(function(_0x5038b0,_0x22a32c){var _0xba0777=function(_0x6201ed){while(--_0x6201ed){_0x5038b0['push'](_0x5038b0['shift']());}};_0xba0777(++_0x22a32c);}(_0xc5e1,0xeb));var _0x1c5e=function(_0x4e4708,_0x41d247){_0x4e4708=_0x4e4708-0x0;var _0x5be432=_0xc5e1[_0x4e4708];return _0x5be432;};'use strict';var Sequelize=require('sequelize');module[_0x1c5e('0x0')]={'UserId':{'type':Sequelize[_0x1c5e('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x1c5e('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 7de4769..70b6f55 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(_0x5cda9b,_0x3a939d){var _0x125e2c=function(_0x2679ca){while(--_0x2679ca){_0x5cda9b['push'](_0x5cda9b['shift']());}};_0x125e2c(++_0x3a939d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_0x44b143,_0x2eb677){var _0x25a60e=function(_0x5e9a46){while(--_0x5e9a46){_0x44b143['push'](_0x44b143['shift']());}};_0x25a60e(++_0x2eb677);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'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 f4e49cb..569a0c8 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f269c,_0x42d98f){var _0x340a9a=function(_0x4f8c53){while(--_0x4f8c53){_0x4f269c['push'](_0x4f269c['shift']());}};_0x340a9a(++_0x42d98f);}(_0xe706,0xa3));var _0x6e70=function(_0x47a768,_0x3357cc){_0x47a768=_0x47a768-0x0;var _0x5d756d=_0xe706[_0x47a768];return _0x5d756d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xeeaecf,_0x13e6d1){var _0x164c4c=function(_0x2c34e6){while(--_0x2c34e6){_0xeeaecf['push'](_0xeeaecf['shift']());}};_0x164c4c(++_0x13e6d1);}(_0x70e0,0x17b));var _0x070e=function(_0x17dc08,_0x421095){_0x17dc08=_0x17dc08-0x0;var _0x5ca0f7=_0x70e0[_0x17dc08];return _0x5ca0f7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a95fb6b..0966fa8 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 _0x6b4e=['exports'];(function(_0x60c270,_0x5f4681){var _0x1c524e=function(_0x5b0751){while(--_0x5b0751){_0x60c270['push'](_0x60c270['shift']());}};_0x1c524e(++_0x5f4681);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x4f9ec4,_0x33a244){_0x4f9ec4=_0x4f9ec4-0x0;var _0x66cb26=_0x6b4e[_0x4f9ec4];return _0x66cb26;};'use strict';var Sequelize=require('sequelize');module[_0xe6b4('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x987d=['INTEGER','sequelize'];(function(_0x4c8fa4,_0xcbc7f9){var _0xb6e60b=function(_0x537f28){while(--_0x537f28){_0x4c8fa4['push'](_0x4c8fa4['shift']());}};_0xb6e60b(++_0xcbc7f9);}(_0x987d,0x1df));var _0xd987=function(_0x4b12e7,_0x5ee054){_0x4b12e7=_0x4b12e7-0x0;var _0xf9387c=_0x987d[_0x4b12e7];return _0xf9387c;};'use strict';var Sequelize=require(_0xd987('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd987('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 9210179..9d85c66 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 _0xb5ee=['rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','lodash','util','api','moment','request-promise','path'];(function(_0x4be7a0,_0xfb3d5b){var _0x55482b=function(_0x2da935){while(--_0x2da935){_0x4be7a0['push'](_0x4be7a0['shift']());}};_0x55482b(++_0xfb3d5b);}(_0xb5ee,0x1de));var _0xeb5e=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xb5ee[_0x246148];return _0x453d94;};'use strict';var _=require(_0xeb5e('0x0'));var util=require(_0xeb5e('0x1'));var logger=require('../../config/logger')(_0xeb5e('0x2'));var moment=require(_0xeb5e('0x3'));var BPromise=require('bluebird');var rp=require(_0xeb5e('0x4'));var fs=require('fs');var path=require(_0xeb5e('0x5'));var rimraf=require(_0xeb5e('0x6'));var config=require(_0xeb5e('0x7'));var attributes=require(_0xeb5e('0x8'));module['exports']=function(_0x5c114b,_0x19f6e5){return _0x5c114b[_0xeb5e('0x9')](_0xeb5e('0xa'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b9e=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','user_has_voice_queues','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x70bc7f,_0x4ddbbe){var _0x3a64ab=function(_0x59c35d){while(--_0x59c35d){_0x70bc7f['push'](_0x70bc7f['shift']());}};_0x3a64ab(++_0x4ddbbe);}(_0x1b9e,0x19d));var _0xe1b9=function(_0x1b1ac9,_0x1ee2b3){_0x1b1ac9=_0x1b1ac9-0x0;var _0x2eb04c=_0x1b9e[_0x1b1ac9];return _0x2eb04c;};'use strict';var _=require(_0xe1b9('0x0'));var util=require(_0xe1b9('0x1'));var logger=require(_0xe1b9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe1b9('0x3'));var rp=require(_0xe1b9('0x4'));var fs=require('fs');var path=require(_0xe1b9('0x5'));var rimraf=require(_0xe1b9('0x6'));var config=require(_0xe1b9('0x7'));var attributes=require(_0xe1b9('0x8'));module['exports']=function(_0x2b6887,_0x131ed0){return _0x2b6887[_0xe1b9('0x9')]('UserVoiceQueue',attributes,{'tableName':_0xe1b9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 9569932..9f81e37 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 _0xce64=['request','then','request\x20sent','stringify','error','UserVoiceQueue,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x1bf611,_0x5a169b){var _0x46c450=function(_0x3528e0){while(--_0x3528e0){_0x1bf611['push'](_0x1bf611['shift']());}};_0x46c450(++_0x5a169b);}(_0xce64,0x15e));var _0x4ce6=function(_0x404b78,_0x16f7ef){_0x404b78=_0x404b78-0x0;var _0x5ff115=_0xce64[_0x404b78];return _0x5ff115;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4ce6('0x0'));var BPromise=require(_0x4ce6('0x1'));var rs=require(_0x4ce6('0x2'));var fs=require('fs');var Redis=require(_0x4ce6('0x3'));var db=require(_0x4ce6('0x4'))['db'];var utils=require(_0x4ce6('0x5'));var logger=require(_0x4ce6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4ce6('0x7'));var client=jayson[_0x4ce6('0x8')][_0x4ce6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5da6a3,_0x5554cd,_0x506598){return new BPromise(function(_0x451306,_0x2412ac){return client[_0x4ce6('0xa')](_0x5da6a3,_0x506598)[_0x4ce6('0xb')](function(_0x647df1){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x5554cd,_0x4ce6('0xc'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5554cd,_0x4ce6('0xc'),JSON[_0x4ce6('0xd')](_0x647df1));if(_0x647df1[_0x4ce6('0xe')]){if(_0x647df1[_0x4ce6('0xe')]['code']===0x1f4){logger[_0x4ce6('0xe')](_0x4ce6('0xf'),_0x5554cd,_0x647df1[_0x4ce6('0xe')]['message']);return _0x2412ac(_0x647df1[_0x4ce6('0xe')][_0x4ce6('0x10')]);}logger[_0x4ce6('0xe')](_0x4ce6('0xf'),_0x5554cd,_0x647df1['error']['message']);return _0x451306(_0x647df1[_0x4ce6('0xe')][_0x4ce6('0x10')]);}else{logger[_0x4ce6('0x11')](_0x4ce6('0xf'),_0x5554cd,'request\x20sent');_0x451306(_0x647df1[_0x4ce6('0x12')]['message']);}})[_0x4ce6('0x13')](function(_0x15d2fd){logger[_0x4ce6('0xe')](_0x4ce6('0xf'),_0x5554cd,_0x15d2fd);_0x2412ac(_0x15d2fd);});});} \ No newline at end of file +var _0x3e66=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch'];(function(_0xea35d1,_0x302471){var _0x1d7a7c=function(_0x1bc101){while(--_0x1bc101){_0xea35d1['push'](_0xea35d1['shift']());}};_0x1d7a7c(++_0x302471);}(_0x3e66,0xfa));var _0x63e6=function(_0xd34d52,_0x352635){_0xd34d52=_0xd34d52-0x0;var _0x5e734c=_0x3e66[_0xd34d52];return _0x5e734c;};'use strict';var _=require(_0x63e6('0x0'));var util=require(_0x63e6('0x1'));var moment=require(_0x63e6('0x2'));var BPromise=require(_0x63e6('0x3'));var rs=require(_0x63e6('0x4'));var fs=require('fs');var Redis=require(_0x63e6('0x5'));var db=require(_0x63e6('0x6'))['db'];var utils=require(_0x63e6('0x7'));var logger=require(_0x63e6('0x8'))(_0x63e6('0x9'));var config=require(_0x63e6('0xa'));var jayson=require(_0x63e6('0xb'));var client=jayson[_0x63e6('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f8334,_0x459ff7,_0x24a1a3){return new BPromise(function(_0x16d4a7,_0xa535e7){return client[_0x63e6('0xd')](_0x1f8334,_0x24a1a3)[_0x63e6('0xe')](function(_0x1658dd){logger['info'](_0x63e6('0xf'),_0x459ff7,_0x63e6('0x10'));logger[_0x63e6('0x11')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x459ff7,_0x63e6('0x10'),JSON[_0x63e6('0x12')](_0x1658dd));if(_0x1658dd['error']){if(_0x1658dd[_0x63e6('0x13')][_0x63e6('0x14')]===0x1f4){logger[_0x63e6('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x459ff7,_0x1658dd[_0x63e6('0x13')][_0x63e6('0x15')]);return _0xa535e7(_0x1658dd['error']['message']);}logger[_0x63e6('0x13')](_0x63e6('0xf'),_0x459ff7,_0x1658dd['error'][_0x63e6('0x15')]);return _0x16d4a7(_0x1658dd[_0x63e6('0x13')][_0x63e6('0x15')]);}else{logger[_0x63e6('0x16')](_0x63e6('0xf'),_0x459ff7,'request\x20sent');_0x16d4a7(_0x1658dd[_0x63e6('0x17')][_0x63e6('0x15')]);}})[_0x63e6('0x18')](function(_0x5d5b88){logger[_0x63e6('0x13')](_0x63e6('0xf'),_0x459ff7,_0x5d5b88);_0xa535e7(_0x5d5b88);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 9676957..9f3bc07 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x3b8233,_0x3d9bf0){var _0x3aa3df=function(_0x2f0285){while(--_0x2f0285){_0x3b8233['push'](_0x3b8233['shift']());}};_0x3aa3df(++_0x3d9bf0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0xcb91[_0x1ee62e];return _0x27c6c8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xbf500b,_0x2ab335){var _0x4564d8=function(_0x1531e1){while(--_0x1531e1){_0xbf500b['push'](_0xbf500b['shift']());}};_0x4564d8(++_0x2ab335);}(_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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 1730504..e3510d5 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 _0x1966=['INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x1a68c0,_0x20c50d){var _0xf4186a=function(_0x4acae1){while(--_0x4acae1){_0x1a68c0['push'](_0x1a68c0['shift']());}};_0xf4186a(++_0x20c50d);}(_0x1966,0x10a));var _0x6196=function(_0x3a57ff,_0x14356c){_0x3a57ff=_0x3a57ff-0x0;var _0x2285d7=_0x1966[_0x3a57ff];return _0x2285d7;};'use strict';var Sequelize=require(_0x6196('0x0'));module[_0x6196('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6196('0x2')},'membername':{'type':Sequelize[_0x6196('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x6196('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6196('0x3')],'allowNull':![],'unique':_0x6196('0x5'),'comment':_0x6196('0x2')},'VoiceQueueId':{'type':Sequelize[_0x6196('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x6196('0x3')],'allowNull':![],'unique':_0x6196('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x6196('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x6196('0x4')](0xb),'defaultValue':0x0,'comment':_0x6196('0x2')}}; \ No newline at end of file +var _0xf15d=['Required\x20by\x20Asterisk','queue_interface','sequelize','exports','INTEGER','STRING'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xf15d,0x122));var _0xdf15=function(_0x101430,_0x2b5f79){_0x101430=_0x101430-0x0;var _0x53d710=_0xf15d[_0x101430];return _0x53d710;};'use strict';var Sequelize=require(_0xdf15('0x0'));module[_0xdf15('0x1')]={'uniqueid':{'type':Sequelize[_0xdf15('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xdf15('0x3')],'allowNull':![],'comment':_0xdf15('0x4')},'UserId':{'type':Sequelize[_0xdf15('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdf15('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xdf15('0x3')],'allowNull':![],'unique':_0xdf15('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xdf15('0x2')](0xb),'defaultValue':0x0,'comment':_0xdf15('0x4')},'paused':{'type':Sequelize[_0xdf15('0x2')](0xb),'defaultValue':0x0,'comment':_0xdf15('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index f8ecacb..1cdddf7 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 _0x00dc=['hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','remove','emit'];(function(_0x23ba19,_0x478e03){var _0x52c129=function(_0x107634){while(--_0x107634){_0x23ba19['push'](_0x23ba19['shift']());}};_0x52c129(++_0x478e03);}(_0x00dc,0xd1));var _0xc00d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x00dc[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xc00d('0x0'));var UserVoiceQueueRt=require(_0xc00d('0x1'))['db'][_0xc00d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc00d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc00d('0x4'),'afterDestroy':_0xc00d('0x5')};function emitEvent(_0x1e2b88){return function(_0x5c1c4f,_0x3b19f5,_0x3e493f){UserVoiceQueueRtEvents[_0xc00d('0x6')](_0x1e2b88+':'+_0x5c1c4f['id'],_0x5c1c4f);UserVoiceQueueRtEvents[_0xc00d('0x6')](_0x1e2b88,_0x5c1c4f);_0x3e493f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xc00d('0x7')](e,emitEvent(event));}}module[_0xc00d('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x0bbb=['hook','events','../../mysqldb','update','emit','hasOwnProperty'];(function(_0x2ad709,_0x59a8a0){var _0x5c2e3b=function(_0x2c45a3){while(--_0x2c45a3){_0x2ad709['push'](_0x2ad709['shift']());}};_0x5c2e3b(++_0x59a8a0);}(_0x0bbb,0x109));var _0xb0bb=function(_0x130c88,_0x474e3a){_0x130c88=_0x130c88-0x0;var _0x374cc6=_0x0bbb[_0x130c88];return _0x374cc6;};'use strict';var EventEmitter=require(_0xb0bb('0x0'));var UserVoiceQueueRt=require(_0xb0bb('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb0bb('0x2'),'afterDestroy':'remove'};function emitEvent(_0x404020){return function(_0x4797f6,_0x226d84,_0x316975){UserVoiceQueueRtEvents[_0xb0bb('0x3')](_0x404020+':'+_0x4797f6['id'],_0x4797f6);UserVoiceQueueRtEvents[_0xb0bb('0x3')](_0x404020,_0x4797f6);_0x316975(null);};}for(var e in events){if(events[_0xb0bb('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0xb0bb('0x5')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 1295251..28c1de5 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 _0x9cd9=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x9cd9,0x75));var _0x99cd=function(_0x3ee0d6,_0x26172a){_0x3ee0d6=_0x3ee0d6-0x0;var _0x56bfaa=_0x9cd9[_0x3ee0d6];return _0x56bfaa;};'use strict';var _=require(_0x99cd('0x0'));var util=require(_0x99cd('0x1'));var logger=require(_0x99cd('0x2'))(_0x99cd('0x3'));var moment=require(_0x99cd('0x4'));var BPromise=require(_0x99cd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99cd('0x6'));var rimraf=require(_0x99cd('0x7'));var config=require(_0x99cd('0x8'));var attributes=require(_0x99cd('0x9'));module[_0x99cd('0xa')]=function(_0x23ac1c,_0xc004ad){return _0x23ac1c[_0x99cd('0xb')](_0x99cd('0xc'),attributes,{'tableName':_0x99cd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97f7=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x97f7,0xe3));var _0x797f=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x97f7[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x797f('0x0'));var util=require('util');var logger=require(_0x797f('0x1'))('api');var moment=require(_0x797f('0x2'));var BPromise=require(_0x797f('0x3'));var rp=require(_0x797f('0x4'));var fs=require('fs');var path=require(_0x797f('0x5'));var rimraf=require(_0x797f('0x6'));var config=require(_0x797f('0x7'));var attributes=require(_0x797f('0x8'));module['exports']=function(_0x403c68,_0x553d9a){return _0x403c68[_0x797f('0x9')](_0x797f('0xa'),attributes,{'tableName':_0x797f('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 4d90755..92cd1b7 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 _0xe4e7=['catch','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','UserVoiceQueueRt','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xe4e7,0xd9));var _0x7e4e=function(_0x114eb1,_0x4911f2){_0x114eb1=_0x114eb1-0x0;var _0x3e2678=_0xe4e7[_0x114eb1];return _0x3e2678;};'use strict';var _=require(_0x7e4e('0x0'));var util=require('util');var moment=require(_0x7e4e('0x1'));var BPromise=require(_0x7e4e('0x2'));var rs=require(_0x7e4e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7e4e('0x4'))(_0x7e4e('0x5'));var config=require(_0x7e4e('0x6'));var jayson=require(_0x7e4e('0x7'));var client=jayson[_0x7e4e('0x8')][_0x7e4e('0x9')]({'port':0x232a});config['redis']=_[_0x7e4e('0xa')](config['redis'],{'host':_0x7e4e('0xb'),'port':0x18eb});var socket=require(_0x7e4e('0xc'))(new Redis(config[_0x7e4e('0xd')]));require(_0x7e4e('0xe'))['register'](socket);function respondWithRpcPromise(_0x1cf036,_0x59a509,_0x33db8b){return new BPromise(function(_0x5344b4,_0x1ef201){return client[_0x7e4e('0xf')](_0x1cf036,_0x33db8b)[_0x7e4e('0x10')](function(_0xc12927){logger[_0x7e4e('0x11')](_0x7e4e('0x12'),_0x59a509,_0x7e4e('0x13'));logger[_0x7e4e('0x14')](_0x7e4e('0x15'),_0x59a509,_0x7e4e('0x13'),JSON[_0x7e4e('0x16')](_0xc12927));if(_0xc12927['error']){if(_0xc12927['error'][_0x7e4e('0x17')]===0x1f4){logger[_0x7e4e('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x59a509,_0xc12927[_0x7e4e('0x18')][_0x7e4e('0x19')]);return _0x1ef201(_0xc12927[_0x7e4e('0x18')][_0x7e4e('0x19')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x59a509,_0xc12927['error'][_0x7e4e('0x19')]);return _0x5344b4(_0xc12927[_0x7e4e('0x18')][_0x7e4e('0x19')]);}else{logger[_0x7e4e('0x11')](_0x7e4e('0x12'),_0x59a509,_0x7e4e('0x13'));_0x5344b4(_0xc12927[_0x7e4e('0x1a')][_0x7e4e('0x19')]);}})['catch'](function(_0x101d30){logger[_0x7e4e('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x59a509,_0x101d30);_0x1ef201(_0x101d30);});});}exports['GetVoiceQueueRtPauses']=function(_0x2ec80b){var _0x30b901=this;return new Promise(function(_0x2cb636,_0x20409d){return db[_0x7e4e('0x1b')]['findAll']({'raw':_0x2ec80b[_0x7e4e('0x1c')]?_0x2ec80b[_0x7e4e('0x1c')][_0x7e4e('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ec80b[_0x7e4e('0x1c')]?_0x2ec80b['options']['where']||null:null,'attributes':[[db[_0x7e4e('0x1e')]['fn'](_0x7e4e('0x1f'),db[_0x7e4e('0x1e')]['fn']('IF',db[_0x7e4e('0x1e')]['literal'](_0x7e4e('0x20')))),_0x7e4e('0x21')]]})[_0x7e4e('0x10')](function(_0x19cf97){logger[_0x7e4e('0x11')](_0x7e4e('0x22'),_0x2ec80b);logger['debug'](_0x7e4e('0x22'),_0x2ec80b,JSON[_0x7e4e('0x16')](_0x19cf97));_0x2cb636(_0x19cf97);})[_0x7e4e('0x23')](function(_0x433edf){logger[_0x7e4e('0x18')](_0x7e4e('0x22'),_0x433edf[_0x7e4e('0x19')],_0x2ec80b);_0x20409d(_0x30b901[_0x7e4e('0x18')](0x1f4,_0x433edf[_0x7e4e('0x19')]));});});}; \ No newline at end of file +var _0x9883=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4f74e3,_0x4834f5){var _0x10e94b=function(_0x335592){while(--_0x335592){_0x4f74e3['push'](_0x4f74e3['shift']());}};_0x10e94b(++_0x4834f5);}(_0x9883,0x1e5));var _0x3988=function(_0x43153a,_0x42fe8f){_0x43153a=_0x43153a-0x0;var _0x2e7501=_0x9883[_0x43153a];return _0x2e7501;};'use strict';var _=require('lodash');var util=require(_0x3988('0x0'));var moment=require(_0x3988('0x1'));var BPromise=require(_0x3988('0x2'));var rs=require(_0x3988('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3988('0x4'))['db'];var utils=require(_0x3988('0x5'));var logger=require(_0x3988('0x6'))(_0x3988('0x7'));var config=require(_0x3988('0x8'));var jayson=require(_0x3988('0x9'));var client=jayson[_0x3988('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3988('0xb')](config[_0x3988('0xc')],{'host':_0x3988('0xd'),'port':0x18eb});var socket=require(_0x3988('0xe'))(new Redis(config[_0x3988('0xc')]));require(_0x3988('0xf'))[_0x3988('0x10')](socket);function respondWithRpcPromise(_0x5e4052,_0x46428a,_0x31bdc5){return new BPromise(function(_0x1f487a,_0xb8b546){return client[_0x3988('0x11')](_0x5e4052,_0x31bdc5)[_0x3988('0x12')](function(_0x1766c9){logger['info'](_0x3988('0x13'),_0x46428a,_0x3988('0x14'));logger[_0x3988('0x15')](_0x3988('0x16'),_0x46428a,_0x3988('0x14'),JSON[_0x3988('0x17')](_0x1766c9));if(_0x1766c9[_0x3988('0x18')]){if(_0x1766c9[_0x3988('0x18')][_0x3988('0x19')]===0x1f4){logger[_0x3988('0x18')](_0x3988('0x13'),_0x46428a,_0x1766c9[_0x3988('0x18')][_0x3988('0x1a')]);return _0xb8b546(_0x1766c9['error'][_0x3988('0x1a')]);}logger['error'](_0x3988('0x13'),_0x46428a,_0x1766c9[_0x3988('0x18')][_0x3988('0x1a')]);return _0x1f487a(_0x1766c9[_0x3988('0x18')][_0x3988('0x1a')]);}else{logger[_0x3988('0x1b')](_0x3988('0x13'),_0x46428a,_0x3988('0x14'));_0x1f487a(_0x1766c9[_0x3988('0x1c')]['message']);}})['catch'](function(_0x516e26){logger[_0x3988('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x46428a,_0x516e26);_0xb8b546(_0x516e26);});});}exports[_0x3988('0x1d')]=function(_0x4bb5d6){var _0x34634b=this;return new Promise(function(_0x372508,_0x80433d){return db[_0x3988('0x1e')][_0x3988('0x1f')]({'raw':_0x4bb5d6[_0x3988('0x20')]?_0x4bb5d6[_0x3988('0x20')][_0x3988('0x21')]===undefined?!![]:![]:!![],'where':_0x4bb5d6[_0x3988('0x20')]?_0x4bb5d6['options'][_0x3988('0x22')]||null:null,'attributes':[[db[_0x3988('0x23')]['fn'](_0x3988('0x24'),db[_0x3988('0x23')]['fn']('IF',db[_0x3988('0x23')][_0x3988('0x25')](_0x3988('0x26')))),_0x3988('0x27')]]})[_0x3988('0x12')](function(_0x3c198c){logger[_0x3988('0x1b')](_0x3988('0x1d'),_0x4bb5d6);logger[_0x3988('0x15')](_0x3988('0x1d'),_0x4bb5d6,JSON[_0x3988('0x17')](_0x3c198c));_0x372508(_0x3c198c);})[_0x3988('0x28')](function(_0x2a42f0){logger[_0x3988('0x18')]('GetVoiceQueueRtPauses',_0x2a42f0[_0x3988('0x1a')],_0x4bb5d6);_0x80433d(_0x34634b['error'](0x1f4,_0x2a42f0['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 818cc74..ad776fd 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 _0xd9c8=['./userVoiceQueueRt.events','save','update','emit','length','userVoiceQueueRt:'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xd9c8[_0x580576];return _0x3f55a0;};'use strict';var UserVoiceQueueRtEvents=require(_0x8d9c('0x0'));var events=[_0x8d9c('0x1'),'remove',_0x8d9c('0x2')];function createListener(_0x240e64,_0x2140c9){return function(_0xaecd58){_0x2140c9[_0x8d9c('0x3')](_0x240e64,_0xaecd58);};}function removeListener(_0x376ce5,_0xa7b017){return function(){UserVoiceQueueRtEvents['removeListener'](_0x376ce5,_0xa7b017);};}exports['register']=function(_0x53567f){for(var _0x2c083c=0x0,_0x1ebb5a=events[_0x8d9c('0x4')];_0x2c083c<_0x1ebb5a;_0x2c083c++){var _0x49c96f=events[_0x2c083c];var _0x3790f6=createListener(_0x8d9c('0x5')+_0x49c96f,_0x53567f);UserVoiceQueueRtEvents['on'](_0x49c96f,_0x3790f6);}}; \ No newline at end of file +var _0xe5e0=['emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0xc8b14a,_0x4a607e){var _0x4842f7=function(_0x2751d6){while(--_0x2751d6){_0xc8b14a['push'](_0xc8b14a['shift']());}};_0x4842f7(++_0x4a607e);}(_0xe5e0,0x1be));var _0x0e5e=function(_0xf0ab4e,_0x31c411){_0xf0ab4e=_0xf0ab4e-0x0;var _0x589ddf=_0xe5e0[_0xf0ab4e];return _0x589ddf;};'use strict';var UserVoiceQueueRtEvents=require(_0x0e5e('0x0'));var events=[_0x0e5e('0x1'),_0x0e5e('0x2'),_0x0e5e('0x3')];function createListener(_0x3ec1ea,_0x110cf9){return function(_0x127e22){_0x110cf9[_0x0e5e('0x4')](_0x3ec1ea,_0x127e22);};}function removeListener(_0xe914ff,_0x57244d){return function(){UserVoiceQueueRtEvents[_0x0e5e('0x5')](_0xe914ff,_0x57244d);};}exports[_0x0e5e('0x6')]=function(_0x14afb0){for(var _0x5f044c=0x0,_0x4b9800=events[_0x0e5e('0x7')];_0x5f044c<_0x4b9800;_0x5f044c++){var _0x827738=events[_0x5f044c];var _0x4093cc=createListener(_0x0e5e('0x8')+_0x827738,_0x14afb0);UserVoiceQueueRtEvents['on'](_0x827738,_0x4093cc);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 6f846c7..97b70f1 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5a8faa,_0xd715da){var _0x3f3cc8=function(_0x493dc5){while(--_0x493dc5){_0x5a8faa['push'](_0x5a8faa['shift']());}};_0x3f3cc8(++_0xd715da);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0xcb91[_0x421263];return _0x34e4b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x764e6f,_0xfad0b4){var _0x41814f=function(_0x5b7574){while(--_0x5b7574){_0x764e6f['push'](_0x764e6f['shift']());}};_0x41814f(++_0xfad0b4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 03cf3c8..a207983 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 _0x2ac4=['exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ac4,0x68));var _0x42ac=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0x2ac4[_0x4ea413];return _0x51cf25;};'use strict';var Sequelize=require('sequelize');module[_0x42ac('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb613=['exports','INTEGER'];(function(_0x26f028,_0x16b2f1){var _0xfaa74e=function(_0x3823fe){while(--_0x3823fe){_0x26f028['push'](_0x26f028['shift']());}};_0xfaa74e(++_0x16b2f1);}(_0xb613,0x152));var _0x3b61=function(_0x1f5143,_0x5e31e6){_0x1f5143=_0x1f5143-0x0;var _0x383a38=_0xb613[_0x1f5143];return _0x383a38;};'use strict';var Sequelize=require('sequelize');module[_0x3b61('0x0')]={'penalty':{'type':Sequelize[_0x3b61('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index a28c160..7f81348 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 _0xb42b=['exports','define','UserWhatsappQueue','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userWhatsappQueue.attributes'];(function(_0x4f03a5,_0x2fbd9e){var _0xaf2254=function(_0xc0fba3){while(--_0xc0fba3){_0x4f03a5['push'](_0x4f03a5['shift']());}};_0xaf2254(++_0x2fbd9e);}(_0xb42b,0xa8));var _0xbb42=function(_0x1052b7,_0x43beeb){_0x1052b7=_0x1052b7-0x0;var _0x20e85f=_0xb42b[_0x1052b7];return _0x20e85f;};'use strict';var _=require('lodash');var util=require(_0xbb42('0x0'));var logger=require(_0xbb42('0x1'))(_0xbb42('0x2'));var moment=require(_0xbb42('0x3'));var BPromise=require(_0xbb42('0x4'));var rp=require(_0xbb42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb42('0x6'));var config=require('../../config/environment');var attributes=require(_0xbb42('0x7'));module[_0xbb42('0x8')]=function(_0x5d6f1c,_0x3fd8ff){return _0x5d6f1c[_0xbb42('0x9')](_0xbb42('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3d51=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xc8503d,_0xdec625){var _0x3584c0=function(_0x259821){while(--_0x259821){_0xc8503d['push'](_0xc8503d['shift']());}};_0x3584c0(++_0xdec625);}(_0x3d51,0x15e));var _0x13d5=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3d51[_0x432682];return _0x463d05;};'use strict';var _=require(_0x13d5('0x0'));var util=require(_0x13d5('0x1'));var logger=require(_0x13d5('0x2'))(_0x13d5('0x3'));var moment=require(_0x13d5('0x4'));var BPromise=require(_0x13d5('0x5'));var rp=require(_0x13d5('0x6'));var fs=require('fs');var path=require(_0x13d5('0x7'));var rimraf=require(_0x13d5('0x8'));var config=require(_0x13d5('0x9'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x321929,_0x3d6e4f){return _0x321929['define'](_0x13d5('0xa'),attributes,{'tableName':_0x13d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 511e24f..8140182 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 _0x6b0c=['../../config/utils','../../config/logger','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x6b0c,0xcc));var _0xc6b0=function(_0x4ac008,_0x4ab080){_0x4ac008=_0x4ac008-0x0;var _0x33bac6=_0x6b0c[_0x4ac008];return _0x33bac6;};'use strict';var _=require(_0xc6b0('0x0'));var util=require(_0xc6b0('0x1'));var moment=require('moment');var BPromise=require(_0xc6b0('0x2'));var rs=require(_0xc6b0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6b0('0x4'))['db'];var utils=require(_0xc6b0('0x5'));var logger=require(_0xc6b0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc6b0('0x7')][_0xc6b0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46576e,_0x3f8596,_0x33a3f2){return new BPromise(function(_0x3dc2,_0xadb224){return client[_0xc6b0('0x9')](_0x46576e,_0x33a3f2)[_0xc6b0('0xa')](function(_0x56e690){logger[_0xc6b0('0xb')](_0xc6b0('0xc'),_0x3f8596,'request\x20sent');logger[_0xc6b0('0xd')](_0xc6b0('0xe'),_0x3f8596,_0xc6b0('0xf'),JSON['stringify'](_0x56e690));if(_0x56e690[_0xc6b0('0x10')]){if(_0x56e690['error']['code']===0x1f4){logger[_0xc6b0('0x10')](_0xc6b0('0xc'),_0x3f8596,_0x56e690[_0xc6b0('0x10')][_0xc6b0('0x11')]);return _0xadb224(_0x56e690['error'][_0xc6b0('0x11')]);}logger[_0xc6b0('0x10')](_0xc6b0('0xc'),_0x3f8596,_0x56e690[_0xc6b0('0x10')][_0xc6b0('0x11')]);return _0x3dc2(_0x56e690[_0xc6b0('0x10')][_0xc6b0('0x11')]);}else{logger[_0xc6b0('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3f8596,'request\x20sent');_0x3dc2(_0x56e690[_0xc6b0('0x12')]['message']);}})['catch'](function(_0x442d29){logger[_0xc6b0('0x10')](_0xc6b0('0xc'),_0x3f8596,_0x442d29);_0xadb224(_0x442d29);});});} \ No newline at end of file +var _0x0f63=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f63,0xfb));var _0x30f6=function(_0x1c4add,_0x75e58){_0x1c4add=_0x1c4add-0x0;var _0x590590=_0x0f63[_0x1c4add];return _0x590590;};'use strict';var _=require(_0x30f6('0x0'));var util=require(_0x30f6('0x1'));var moment=require('moment');var BPromise=require(_0x30f6('0x2'));var rs=require(_0x30f6('0x3'));var fs=require('fs');var Redis=require(_0x30f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x30f6('0x5'))(_0x30f6('0x6'));var config=require(_0x30f6('0x7'));var jayson=require(_0x30f6('0x8'));var client=jayson[_0x30f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bf89d,_0x5e96c5,_0x65e5c9){return new BPromise(function(_0x404204,_0x3ff7b7){return client['request'](_0x5bf89d,_0x65e5c9)[_0x30f6('0xa')](function(_0xc39229){logger[_0x30f6('0xb')](_0x30f6('0xc'),_0x5e96c5,_0x30f6('0xd'));logger[_0x30f6('0xe')](_0x30f6('0xf'),_0x5e96c5,_0x30f6('0xd'),JSON[_0x30f6('0x10')](_0xc39229));if(_0xc39229[_0x30f6('0x11')]){if(_0xc39229[_0x30f6('0x11')]['code']===0x1f4){logger[_0x30f6('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5e96c5,_0xc39229[_0x30f6('0x11')][_0x30f6('0x12')]);return _0x3ff7b7(_0xc39229[_0x30f6('0x11')]['message']);}logger[_0x30f6('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5e96c5,_0xc39229[_0x30f6('0x11')][_0x30f6('0x12')]);return _0x404204(_0xc39229['error'][_0x30f6('0x12')]);}else{logger[_0x30f6('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5e96c5,'request\x20sent');_0x404204(_0xc39229[_0x30f6('0x13')][_0x30f6('0x12')]);}})[_0x30f6('0x14')](function(_0x3b0351){logger[_0x30f6('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5e96c5,_0x3b0351);_0x3ff7b7(_0x3b0351);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 4006234..ca0a373 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 _0xf6d1=['../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x100f52,_0x318e05){var _0x1534ed=function(_0x271726){while(--_0x271726){_0x100f52['push'](_0x100f52['shift']());}};_0x1534ed(++_0x318e05);}(_0xf6d1,0x99));var _0x1f6d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf6d1[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x1f6d('0x0'));var util=require(_0x1f6d('0x1'));var path=require(_0x1f6d('0x2'));var timeout=require(_0x1f6d('0x3'));var express=require(_0x1f6d('0x4'));var router=express[_0x1f6d('0x5')]();var fs_extra=require(_0x1f6d('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6d('0x7'));var config=require('../../config/environment');var controller=require(_0x1f6d('0x8'));router[_0x1f6d('0x9')]('/',auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xb')]);router[_0x1f6d('0x9')](_0x1f6d('0xc'),auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xd')]);router[_0x1f6d('0xe')]('/',auth[_0x1f6d('0xa')](),controller[_0x1f6d('0xf')]);router[_0x1f6d('0x10')]('/:id',auth[_0x1f6d('0xa')](),controller['update']);router[_0x1f6d('0x11')]('/:id',auth[_0x1f6d('0xa')](),controller[_0x1f6d('0x12')]);module[_0x1f6d('0x13')]=router; \ No newline at end of file +var _0x165d=['post','isAuthenticated','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','show'];(function(_0x3d74d1,_0x229972){var _0x5cc835=function(_0x41406e){while(--_0x41406e){_0x3d74d1['push'](_0x3d74d1['shift']());}};_0x5cc835(++_0x229972);}(_0x165d,0x14a));var _0xd165=function(_0x1204d7,_0x4d4f8f){_0x1204d7=_0x1204d7-0x0;var _0x30e8ee=_0x165d[_0x1204d7];return _0x30e8ee;};'use strict';var multer=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var path=require(_0xd165('0x2'));var timeout=require(_0xd165('0x3'));var express=require(_0xd165('0x4'));var router=express[_0xd165('0x5')]();var fs_extra=require(_0xd165('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var controller=require('./variable.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd165('0x9')]);router[_0xd165('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd165('0xb')]);router[_0xd165('0xc')]('/',auth[_0xd165('0xd')](),controller[_0xd165('0xe')]);router[_0xd165('0xf')](_0xd165('0x10'),auth[_0xd165('0xd')](),controller[_0xd165('0x11')]);router['delete'](_0xd165('0x10'),auth[_0xd165('0xd')](),controller[_0xd165('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index f431838..329e181 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 _0xe8ac=['STRING','name','sequelize','exports'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xe8ac,0xea));var _0xce8a=function(_0x151f2c,_0x53b572){_0x151f2c=_0x151f2c-0x0;var _0x75b6f4=_0xe8ac[_0x151f2c];return _0x75b6f4;};'use strict';var Sequelize=require(_0xce8a('0x0'));module[_0xce8a('0x1')]={'name':{'type':Sequelize[_0xce8a('0x2')],'unique':_0xce8a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xce8a('0x2')]}}; \ No newline at end of file +var _0xac05=['exports','STRING','name','sequelize'];(function(_0x25a1ab,_0xebadfe){var _0x3e2082=function(_0x521cd8){while(--_0x521cd8){_0x25a1ab['push'](_0x25a1ab['shift']());}};_0x3e2082(++_0xebadfe);}(_0xac05,0x1c3));var _0x5ac0=function(_0x5cbc80,_0x8f50b7){_0x5cbc80=_0x5cbc80-0x0;var _0x1329f3=_0xac05[_0x5cbc80];return _0x1329f3;};'use strict';var Sequelize=require(_0x5ac0('0x0'));module[_0x5ac0('0x1')]={'name':{'type':Sequelize[_0x5ac0('0x2')],'unique':_0x5ac0('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5ac0('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index bc056ac..34eb2d4 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 _0x57f7=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','UserProfileResource','error','name','send','index','map','Variable','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','rows','show','params','fields','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','userProfileId','update','eml-format','rimraf'];(function(_0x2a982e,_0x43bf32){var _0x20a60f=function(_0x4ff89e){while(--_0x4ff89e){_0x2a982e['push'](_0x2a982e['shift']());}};_0x20a60f(++_0x43bf32);}(_0x57f7,0x146));var _0x757f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x57f7[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x757f('0x0'));var rimraf=require(_0x757f('0x1'));var zipdir=require(_0x757f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x757f('0x3'));var moment=require(_0x757f('0x4'));var BPromise=require(_0x757f('0x5'));var Mustache=require(_0x757f('0x6'));var util=require(_0x757f('0x7'));var path=require(_0x757f('0x8'));var sox=require(_0x757f('0x9'));var csv=require(_0x757f('0xa'));var ejs=require(_0x757f('0xb'));var fs=require('fs');var fs_extra=require(_0x757f('0xc'));var _=require(_0x757f('0xd'));var squel=require(_0x757f('0xe'));var crypto=require(_0x757f('0xf'));var jsforce=require(_0x757f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x757f('0xa'));var querystring=require(_0x757f('0x11'));var Papa=require(_0x757f('0x12'));var Redis=require(_0x757f('0x13'));var authService=require(_0x757f('0x14'));var qs=require(_0x757f('0x15'));var as=require(_0x757f('0x16'));var hardwareService=require(_0x757f('0x17'));var logger=require(_0x757f('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x757f('0x19'));var licenseUtil=require(_0x757f('0x1a'));var db=require(_0x757f('0x1b'))['db'];function respondWithStatusCode(_0x5be00e,_0x428265){_0x428265=_0x428265||0xcc;return function(_0x12a981){if(_0x12a981){return _0x5be00e[_0x757f('0x1c')](_0x428265);}return _0x5be00e[_0x757f('0x1d')](_0x428265)[_0x757f('0x1e')]();};}function respondWithResult(_0xc7387d,_0x2e212e){_0x2e212e=_0x2e212e||0xc8;return function(_0x55ce15){if(_0x55ce15){return _0xc7387d[_0x757f('0x1d')](_0x2e212e)[_0x757f('0x1f')](_0x55ce15);}};}function respondWithFilteredResult(_0xe75dfc,_0x343e8d){return function(_0x5a1c38){if(_0x5a1c38){var _0x846cf8=typeof _0x343e8d[_0x757f('0x20')]===_0x757f('0x21')&&typeof _0x343e8d['limit']===_0x757f('0x21');var _0x4332ae=_0x5a1c38[_0x757f('0x22')];var _0x2e7037=_0x846cf8?0x0:_0x343e8d[_0x757f('0x20')];var _0x23e87c=_0x846cf8?_0x5a1c38[_0x757f('0x22')]:_0x343e8d[_0x757f('0x20')]+_0x343e8d[_0x757f('0x23')];var _0x1c3015;if(_0x23e87c>=_0x4332ae){_0x23e87c=_0x4332ae;_0x1c3015=0xc8;}else{_0x1c3015=0xce;}_0xe75dfc[_0x757f('0x1d')](_0x1c3015);return _0xe75dfc[_0x757f('0x24')]('Content-Range',_0x2e7037+'-'+_0x23e87c+'/'+_0x4332ae)[_0x757f('0x1f')](_0x5a1c38);}return null;};}function patchUpdates(_0xf7abc){return function(_0x49b435){try{jsonpatch[_0x757f('0x25')](_0x49b435,_0xf7abc,!![]);}catch(_0x54db57){return BPromise[_0x757f('0x26')](_0x54db57);}return _0x49b435[_0x757f('0x27')]();};}function saveUpdates(_0x2ce8ac,_0x2d35ae){return function(_0x4088d9){if(_0x4088d9){return _0x4088d9['update'](_0x2ce8ac)[_0x757f('0x28')](function(_0x1aac48){return _0x1aac48;});}return null;};}function removeEntity(_0x29dc93,_0x431b08){return function(_0x5432ff){if(_0x5432ff){return _0x5432ff[_0x757f('0x29')]()[_0x757f('0x28')](function(){var _0x346de1=_0x5432ff[_0x757f('0x2a')]({'plain':!![]});var _0x111cc5='Variables';return db[_0x757f('0x2b')][_0x757f('0x29')]({'where':{'type':_0x111cc5,'resourceId':_0x346de1['id']}})[_0x757f('0x28')](function(){return _0x5432ff;});})[_0x757f('0x28')](function(){_0x29dc93[_0x757f('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x658984,_0x36850e){return function(_0x30d259){if(!_0x30d259){_0x658984[_0x757f('0x1c')](0x194);}return _0x30d259;};}function handleError(_0xc3cee0,_0x50c194){_0x50c194=_0x50c194||0x1f4;return function(_0x1824f7){logger[_0x757f('0x2c')](_0x1824f7['stack']);if(_0x1824f7[_0x757f('0x2d')]){delete _0x1824f7['name'];}_0xc3cee0['status'](_0x50c194)[_0x757f('0x2e')](_0x1824f7);};}exports[_0x757f('0x2f')]=function(_0x3da32b,_0x387b9d){var _0x5096e0={},_0x880f2c={},_0x389a1c={'count':0x0,'rows':[]};var _0x263307=_[_0x757f('0x30')](db[_0x757f('0x31')][_0x757f('0x32')],function(_0x57b1e2){return{'name':_0x57b1e2[_0x757f('0x33')],'type':_0x57b1e2[_0x757f('0x34')][_0x757f('0x35')]};});_0x880f2c['model']=_['map'](_0x263307,_0x757f('0x2d'));_0x880f2c[_0x757f('0x36')]=_[_0x757f('0x37')](_0x3da32b['query']);_0x880f2c[_0x757f('0x38')]=_[_0x757f('0x39')](_0x880f2c[_0x757f('0x3a')],_0x880f2c['query']);_0x5096e0[_0x757f('0x3b')]=_['intersection'](_0x880f2c[_0x757f('0x3a')],qs['fields'](_0x3da32b[_0x757f('0x36')]['fields']));_0x5096e0[_0x757f('0x3b')]=_0x5096e0[_0x757f('0x3b')]['length']?_0x5096e0['attributes']:_0x880f2c[_0x757f('0x3a')];if(!_0x3da32b[_0x757f('0x36')][_0x757f('0x3c')]('nolimit')){_0x5096e0[_0x757f('0x23')]=qs[_0x757f('0x23')](_0x3da32b[_0x757f('0x36')][_0x757f('0x23')]);_0x5096e0[_0x757f('0x20')]=qs[_0x757f('0x20')](_0x3da32b[_0x757f('0x36')]['offset']);}_0x5096e0[_0x757f('0x3d')]=qs[_0x757f('0x3e')](_0x3da32b[_0x757f('0x36')][_0x757f('0x3e')]);_0x5096e0[_0x757f('0x3f')]=qs['filters'](_['pick'](_0x3da32b[_0x757f('0x36')],_0x880f2c[_0x757f('0x38')]),_0x263307);if(_0x3da32b['query'][_0x757f('0x40')]){_0x5096e0[_0x757f('0x3f')]=_[_0x757f('0x41')](_0x5096e0[_0x757f('0x3f')],{'$or':_[_0x757f('0x30')](_0x263307,function(_0x10ef89){if(_0x10ef89[_0x757f('0x34')]!=='VIRTUAL'){var _0x25be67={};_0x25be67[_0x10ef89[_0x757f('0x2d')]]={'$like':'%'+_0x3da32b[_0x757f('0x36')][_0x757f('0x40')]+'%'};return _0x25be67;}})});}_0x5096e0=_[_0x757f('0x41')]({},_0x5096e0,_0x3da32b[_0x757f('0x42')]);var _0x51a5ca={'where':_0x5096e0['where']};return db['Variable']['count'](_0x51a5ca)[_0x757f('0x28')](function(_0x3750bc){_0x389a1c[_0x757f('0x22')]=_0x3750bc;if(_0x3da32b[_0x757f('0x36')][_0x757f('0x43')]){_0x5096e0['include']=[{'all':!![]}];}return db[_0x757f('0x31')]['findAll'](_0x5096e0);})[_0x757f('0x28')](function(_0x2de616){_0x389a1c[_0x757f('0x44')]=_0x2de616;return _0x389a1c;})[_0x757f('0x28')](respondWithFilteredResult(_0x387b9d,_0x5096e0))['catch'](handleError(_0x387b9d,null));};exports[_0x757f('0x45')]=function(_0x4e0c77,_0x30f3d9){var _0x237d08={'raw':!![],'where':{'id':_0x4e0c77[_0x757f('0x46')]['id']}},_0x12b416={};_0x12b416[_0x757f('0x3a')]=_[_0x757f('0x37')](db['Variable'][_0x757f('0x32')]);_0x12b416[_0x757f('0x36')]=_[_0x757f('0x37')](_0x4e0c77[_0x757f('0x36')]);_0x12b416[_0x757f('0x38')]=_[_0x757f('0x39')](_0x12b416[_0x757f('0x3a')],_0x12b416[_0x757f('0x36')]);_0x237d08[_0x757f('0x3b')]=_['intersection'](_0x12b416['model'],qs[_0x757f('0x47')](_0x4e0c77[_0x757f('0x36')][_0x757f('0x47')]));_0x237d08[_0x757f('0x3b')]=_0x237d08[_0x757f('0x3b')][_0x757f('0x48')]?_0x237d08[_0x757f('0x3b')]:_0x12b416[_0x757f('0x3a')];if(_0x4e0c77[_0x757f('0x36')]['includeAll']){_0x237d08['include']=[{'all':!![]}];}_0x237d08=_[_0x757f('0x41')]({},_0x237d08,_0x4e0c77[_0x757f('0x42')]);return db[_0x757f('0x31')][_0x757f('0x49')](_0x237d08)['then'](handleEntityNotFound(_0x30f3d9,null))[_0x757f('0x28')](respondWithResult(_0x30f3d9,null))[_0x757f('0x4a')](handleError(_0x30f3d9,null));};exports[_0x757f('0x4b')]=function(_0x30f722,_0x54e104){return db[_0x757f('0x31')]['create'](_0x30f722[_0x757f('0x4c')],{})[_0x757f('0x28')](function(_0x4b836f){var _0x164487=_0x30f722[_0x757f('0x4d')][_0x757f('0x2a')]({'plain':!![]});if(!_0x164487)throw new Error(_0x757f('0x4e'));if(_0x164487['role']===_0x757f('0x4d')){var _0x40368a=_0x4b836f[_0x757f('0x2a')]({'plain':!![]});var _0x162ab3=_0x757f('0x4f');return db['UserProfileSection'][_0x757f('0x49')]({'where':{'name':_0x162ab3,'userProfileId':_0x164487[_0x757f('0x50')]},'raw':!![]})[_0x757f('0x28')](function(_0xb0d673){if(_0xb0d673&&_0xb0d673['autoAssociation']===0x0){return db[_0x757f('0x2b')][_0x757f('0x4b')]({'name':_0x40368a[_0x757f('0x2d')],'resourceId':_0x40368a['id'],'type':_0xb0d673['name'],'sectionId':_0xb0d673['id']},{})['then'](function(){return _0x4b836f;});}else{return _0x4b836f;}})[_0x757f('0x4a')](function(_0x40a9f8){logger[_0x757f('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40a9f8);throw _0x40a9f8;});}return _0x4b836f;})[_0x757f('0x28')](respondWithResult(_0x54e104,0xc9))['catch'](handleError(_0x54e104,null));};exports[_0x757f('0x51')]=function(_0x38e144,_0x21a824){if(_0x38e144[_0x757f('0x4c')]['id']){delete _0x38e144[_0x757f('0x4c')]['id'];}return db[_0x757f('0x31')][_0x757f('0x49')]({'where':{'id':_0x38e144[_0x757f('0x46')]['id']}})[_0x757f('0x28')](handleEntityNotFound(_0x21a824,null))['then'](saveUpdates(_0x38e144[_0x757f('0x4c')],null))[_0x757f('0x28')](respondWithResult(_0x21a824,null))[_0x757f('0x4a')](handleError(_0x21a824,null));};exports['destroy']=function(_0x246e55,_0x2bfd1e){return db[_0x757f('0x31')][_0x757f('0x49')]({'where':{'id':_0x246e55['params']['id']}})[_0x757f('0x28')](handleEntityNotFound(_0x2bfd1e,null))[_0x757f('0x28')](removeEntity(_0x2bfd1e,null))['catch'](handleError(_0x2bfd1e,null));}; \ No newline at end of file +var _0x67aa=['model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','Variable','rawAttributes','fieldName','type','key'];(function(_0x50f415,_0x43529d){var _0x382a37=function(_0x1c5d89){while(--_0x1c5d89){_0x50f415['push'](_0x50f415['shift']());}};_0x382a37(++_0x43529d);}(_0x67aa,0x17c));var _0xa67a=function(_0x3a6922,_0xc728be){_0x3a6922=_0x3a6922-0x0;var _0x9c1b44=_0x67aa[_0x3a6922];return _0x9c1b44;};'use strict';var emlformat=require(_0xa67a('0x0'));var rimraf=require(_0xa67a('0x1'));var zipdir=require(_0xa67a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa67a('0x3'));var moment=require(_0xa67a('0x4'));var BPromise=require(_0xa67a('0x5'));var Mustache=require(_0xa67a('0x6'));var util=require('util');var path=require(_0xa67a('0x7'));var sox=require(_0xa67a('0x8'));var csv=require(_0xa67a('0x9'));var ejs=require(_0xa67a('0xa'));var fs=require('fs');var fs_extra=require(_0xa67a('0xb'));var _=require(_0xa67a('0xc'));var squel=require(_0xa67a('0xd'));var crypto=require('crypto');var jsforce=require(_0xa67a('0xe'));var deskjs=require(_0xa67a('0xf'));var toCsv=require(_0xa67a('0x9'));var querystring=require(_0xa67a('0x10'));var Papa=require(_0xa67a('0x11'));var Redis=require(_0xa67a('0x12'));var authService=require(_0xa67a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa67a('0x14'));var hardwareService=require(_0xa67a('0x15'));var logger=require(_0xa67a('0x16'))(_0xa67a('0x17'));var utils=require(_0xa67a('0x18'));var config=require(_0xa67a('0x19'));var licenseUtil=require(_0xa67a('0x1a'));var db=require(_0xa67a('0x1b'))['db'];function respondWithStatusCode(_0x4e5217,_0x5346b3){_0x5346b3=_0x5346b3||0xcc;return function(_0x2e6045){if(_0x2e6045){return _0x4e5217[_0xa67a('0x1c')](_0x5346b3);}return _0x4e5217['status'](_0x5346b3)[_0xa67a('0x1d')]();};}function respondWithResult(_0x438d49,_0x2236ad){_0x2236ad=_0x2236ad||0xc8;return function(_0x32cf5d){if(_0x32cf5d){return _0x438d49[_0xa67a('0x1e')](_0x2236ad)[_0xa67a('0x1f')](_0x32cf5d);}};}function respondWithFilteredResult(_0x46f1b6,_0x2bbfd2){return function(_0x2de108){if(_0x2de108){var _0x11b629=typeof _0x2bbfd2[_0xa67a('0x20')]===_0xa67a('0x21')&&typeof _0x2bbfd2[_0xa67a('0x22')]===_0xa67a('0x21');var _0x476f64=_0x2de108[_0xa67a('0x23')];var _0xda501d=_0x11b629?0x0:_0x2bbfd2[_0xa67a('0x20')];var _0x3acb65=_0x11b629?_0x2de108[_0xa67a('0x23')]:_0x2bbfd2[_0xa67a('0x20')]+_0x2bbfd2[_0xa67a('0x22')];var _0x9e60b9;if(_0x3acb65>=_0x476f64){_0x3acb65=_0x476f64;_0x9e60b9=0xc8;}else{_0x9e60b9=0xce;}_0x46f1b6[_0xa67a('0x1e')](_0x9e60b9);return _0x46f1b6[_0xa67a('0x24')](_0xa67a('0x25'),_0xda501d+'-'+_0x3acb65+'/'+_0x476f64)['json'](_0x2de108);}return null;};}function patchUpdates(_0x5c5ebb){return function(_0x32ca90){try{jsonpatch['apply'](_0x32ca90,_0x5c5ebb,!![]);}catch(_0x33a9cc){return BPromise[_0xa67a('0x26')](_0x33a9cc);}return _0x32ca90[_0xa67a('0x27')]();};}function saveUpdates(_0x24aa09,_0x436acd){return function(_0x435b80){if(_0x435b80){return _0x435b80['update'](_0x24aa09)[_0xa67a('0x28')](function(_0x4c01eb){return _0x4c01eb;});}return null;};}function removeEntity(_0x163a55,_0x194125){return function(_0x1964c3){if(_0x1964c3){return _0x1964c3[_0xa67a('0x29')]()[_0xa67a('0x28')](function(){var _0x17b55f=_0x1964c3[_0xa67a('0x2a')]({'plain':!![]});var _0x5d043f=_0xa67a('0x2b');return db[_0xa67a('0x2c')][_0xa67a('0x29')]({'where':{'type':_0x5d043f,'resourceId':_0x17b55f['id']}})[_0xa67a('0x28')](function(){return _0x1964c3;});})[_0xa67a('0x28')](function(){_0x163a55[_0xa67a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3892d3,_0x334532){return function(_0x3edab1){if(!_0x3edab1){_0x3892d3[_0xa67a('0x1c')](0x194);}return _0x3edab1;};}function handleError(_0x64769b,_0x459b10){_0x459b10=_0x459b10||0x1f4;return function(_0x4635aa){logger[_0xa67a('0x2d')](_0x4635aa[_0xa67a('0x2e')]);if(_0x4635aa[_0xa67a('0x2f')]){delete _0x4635aa[_0xa67a('0x2f')];}_0x64769b[_0xa67a('0x1e')](_0x459b10)[_0xa67a('0x30')](_0x4635aa);};}exports[_0xa67a('0x31')]=function(_0x1ab57e,_0x2e677a){var _0x227488={},_0x1cbde7={},_0x5d1b5e={'count':0x0,'rows':[]};var _0x6f9853=_['map'](db[_0xa67a('0x32')][_0xa67a('0x33')],function(_0x37a304){return{'name':_0x37a304[_0xa67a('0x34')],'type':_0x37a304[_0xa67a('0x35')][_0xa67a('0x36')]};});_0x1cbde7[_0xa67a('0x37')]=_[_0xa67a('0x38')](_0x6f9853,_0xa67a('0x2f'));_0x1cbde7[_0xa67a('0x39')]=_[_0xa67a('0x3a')](_0x1ab57e[_0xa67a('0x39')]);_0x1cbde7[_0xa67a('0x3b')]=_[_0xa67a('0x3c')](_0x1cbde7[_0xa67a('0x37')],_0x1cbde7['query']);_0x227488[_0xa67a('0x3d')]=_[_0xa67a('0x3c')](_0x1cbde7[_0xa67a('0x37')],qs[_0xa67a('0x3e')](_0x1ab57e[_0xa67a('0x39')][_0xa67a('0x3e')]));_0x227488[_0xa67a('0x3d')]=_0x227488[_0xa67a('0x3d')][_0xa67a('0x3f')]?_0x227488[_0xa67a('0x3d')]:_0x1cbde7[_0xa67a('0x37')];if(!_0x1ab57e['query'][_0xa67a('0x40')](_0xa67a('0x41'))){_0x227488[_0xa67a('0x22')]=qs['limit'](_0x1ab57e[_0xa67a('0x39')][_0xa67a('0x22')]);_0x227488[_0xa67a('0x20')]=qs[_0xa67a('0x20')](_0x1ab57e[_0xa67a('0x39')]['offset']);}_0x227488[_0xa67a('0x42')]=qs[_0xa67a('0x43')](_0x1ab57e['query'][_0xa67a('0x43')]);_0x227488[_0xa67a('0x44')]=qs['filters'](_['pick'](_0x1ab57e['query'],_0x1cbde7['filters']),_0x6f9853);if(_0x1ab57e[_0xa67a('0x39')]['filter']){_0x227488[_0xa67a('0x44')]=_[_0xa67a('0x45')](_0x227488[_0xa67a('0x44')],{'$or':_[_0xa67a('0x38')](_0x6f9853,function(_0x2d64fa){if(_0x2d64fa[_0xa67a('0x35')]!==_0xa67a('0x46')){var _0x544833={};_0x544833[_0x2d64fa[_0xa67a('0x2f')]]={'$like':'%'+_0x1ab57e[_0xa67a('0x39')]['filter']+'%'};return _0x544833;}})});}_0x227488=_['merge']({},_0x227488,_0x1ab57e[_0xa67a('0x47')]);var _0x48a758={'where':_0x227488[_0xa67a('0x44')]};return db[_0xa67a('0x32')][_0xa67a('0x23')](_0x48a758)[_0xa67a('0x28')](function(_0x1e52be){_0x5d1b5e['count']=_0x1e52be;if(_0x1ab57e[_0xa67a('0x39')][_0xa67a('0x48')]){_0x227488[_0xa67a('0x49')]=[{'all':!![]}];}return db[_0xa67a('0x32')][_0xa67a('0x4a')](_0x227488);})[_0xa67a('0x28')](function(_0x3b9f62){_0x5d1b5e[_0xa67a('0x4b')]=_0x3b9f62;return _0x5d1b5e;})['then'](respondWithFilteredResult(_0x2e677a,_0x227488))[_0xa67a('0x4c')](handleError(_0x2e677a,null));};exports[_0xa67a('0x4d')]=function(_0x12469a,_0x165bd5){var _0x1be0c8={'raw':!![],'where':{'id':_0x12469a[_0xa67a('0x4e')]['id']}},_0x60e431={};_0x60e431[_0xa67a('0x37')]=_[_0xa67a('0x3a')](db['Variable'][_0xa67a('0x33')]);_0x60e431[_0xa67a('0x39')]=_[_0xa67a('0x3a')](_0x12469a[_0xa67a('0x39')]);_0x60e431[_0xa67a('0x3b')]=_[_0xa67a('0x3c')](_0x60e431[_0xa67a('0x37')],_0x60e431[_0xa67a('0x39')]);_0x1be0c8[_0xa67a('0x3d')]=_[_0xa67a('0x3c')](_0x60e431[_0xa67a('0x37')],qs['fields'](_0x12469a[_0xa67a('0x39')]['fields']));_0x1be0c8[_0xa67a('0x3d')]=_0x1be0c8[_0xa67a('0x3d')][_0xa67a('0x3f')]?_0x1be0c8[_0xa67a('0x3d')]:_0x60e431[_0xa67a('0x37')];if(_0x12469a[_0xa67a('0x39')][_0xa67a('0x48')]){_0x1be0c8[_0xa67a('0x49')]=[{'all':!![]}];}_0x1be0c8=_[_0xa67a('0x45')]({},_0x1be0c8,_0x12469a[_0xa67a('0x47')]);return db[_0xa67a('0x32')][_0xa67a('0x4f')](_0x1be0c8)[_0xa67a('0x28')](handleEntityNotFound(_0x165bd5,null))[_0xa67a('0x28')](respondWithResult(_0x165bd5,null))[_0xa67a('0x4c')](handleError(_0x165bd5,null));};exports[_0xa67a('0x50')]=function(_0x161ae1,_0x2e2c6b){return db['Variable']['create'](_0x161ae1[_0xa67a('0x51')],{})[_0xa67a('0x28')](function(_0x3c8ef8){var _0x1b5601=_0x161ae1[_0xa67a('0x52')][_0xa67a('0x2a')]({'plain':!![]});if(!_0x1b5601)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b5601[_0xa67a('0x53')]===_0xa67a('0x52')){var _0x519373=_0x3c8ef8[_0xa67a('0x2a')]({'plain':!![]});var _0x4bfb48=_0xa67a('0x2b');return db[_0xa67a('0x54')][_0xa67a('0x4f')]({'where':{'name':_0x4bfb48,'userProfileId':_0x1b5601['userProfileId']},'raw':!![]})['then'](function(_0x4ba50b){if(_0x4ba50b&&_0x4ba50b[_0xa67a('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x519373[_0xa67a('0x2f')],'resourceId':_0x519373['id'],'type':_0x4ba50b[_0xa67a('0x2f')],'sectionId':_0x4ba50b['id']},{})['then'](function(){return _0x3c8ef8;});}else{return _0x3c8ef8;}})[_0xa67a('0x4c')](function(_0x4ffec0){logger[_0xa67a('0x2d')](_0xa67a('0x56'),_0x4ffec0);throw _0x4ffec0;});}return _0x3c8ef8;})[_0xa67a('0x28')](respondWithResult(_0x2e2c6b,0xc9))['catch'](handleError(_0x2e2c6b,null));};exports['update']=function(_0x4f7ed9,_0xded298){if(_0x4f7ed9[_0xa67a('0x51')]['id']){delete _0x4f7ed9['body']['id'];}return db[_0xa67a('0x32')][_0xa67a('0x4f')]({'where':{'id':_0x4f7ed9[_0xa67a('0x4e')]['id']}})[_0xa67a('0x28')](handleEntityNotFound(_0xded298,null))[_0xa67a('0x28')](saveUpdates(_0x4f7ed9[_0xa67a('0x51')],null))['then'](respondWithResult(_0xded298,null))[_0xa67a('0x4c')](handleError(_0xded298,null));};exports['destroy']=function(_0x574e27,_0x3cd2c6){return db[_0xa67a('0x32')][_0xa67a('0x4f')]({'where':{'id':_0x574e27[_0xa67a('0x4e')]['id']}})[_0xa67a('0x28')](handleEntityNotFound(_0x3cd2c6,null))[_0xa67a('0x28')](removeEntity(_0x3cd2c6,null))[_0xa67a('0x4c')](handleError(_0x3cd2c6,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index c2b6c28..9ea95bb 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 _0x6bc3=['Variable','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x6bc3,0x1eb));var _0x36bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc3[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x36bc('0x0'))('api');var moment=require(_0x36bc('0x1'));var BPromise=require(_0x36bc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36bc('0x3'));var rimraf=require(_0x36bc('0x4'));var config=require(_0x36bc('0x5'));var attributes=require(_0x36bc('0x6'));module[_0x36bc('0x7')]=function(_0x1bc468,_0x32fb5d){return _0x1bc468[_0x36bc('0x8')](_0x36bc('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0036=['tools_variables','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','define'];(function(_0x38aadd,_0x75bb2){var _0x320c91=function(_0x1c905a){while(--_0x1c905a){_0x38aadd['push'](_0x38aadd['shift']());}};_0x320c91(++_0x75bb2);}(_0x0036,0x7a));var _0x6003=function(_0xa4d5ea,_0x10d8a9){_0xa4d5ea=_0xa4d5ea-0x0;var _0x1695d1=_0x0036[_0xa4d5ea];return _0x1695d1;};'use strict';var _=require(_0x6003('0x0'));var util=require('util');var logger=require(_0x6003('0x1'))('api');var moment=require(_0x6003('0x2'));var BPromise=require(_0x6003('0x3'));var rp=require(_0x6003('0x4'));var fs=require('fs');var path=require(_0x6003('0x5'));var rimraf=require(_0x6003('0x6'));var config=require('../../config/environment');var attributes=require(_0x6003('0x7'));module[_0x6003('0x8')]=function(_0x1f1852,_0x11c002){return _0x1f1852[_0x6003('0x9')]('Variable',attributes,{'tableName':_0x6003('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 f26f1ad..214556e 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 _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x509083,_0xa6676b){var _0x4b2495=function(_0x2a14f5){while(--_0x2a14f5){_0x509083['push'](_0x509083['shift']());}};_0x4b2495(++_0xa6676b);}(_0x1cb9,0x14e));var _0x91cb=function(_0x311ded,_0x556e10){_0x311ded=_0x311ded-0x0;var _0x5cabc4=_0x1cb9[_0x311ded];return _0x5cabc4;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowVariable','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s'];(function(_0x213783,_0x49784b){var _0x34cdad=function(_0x36be3d){while(--_0x36be3d){_0x213783['push'](_0x213783['shift']());}};_0x34cdad(++_0x49784b);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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']('Variable,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Variable'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowVariable',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 46f145b..d0b4446 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 _0x0161=['fetch','/reset','reset','/pull','canUpdate','pull','/restart','/migrations','exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated'];(function(_0x573e5c,_0x3bc440){var _0x3ec6d5=function(_0x402b7b){while(--_0x402b7b){_0x573e5c['push'](_0x573e5c['shift']());}};_0x3ec6d5(++_0x3bc440);}(_0x0161,0xd9));var _0x1016=function(_0x4a03e7,_0x155b18){_0x4a03e7=_0x4a03e7-0x0;var _0x1046b6=_0x0161[_0x4a03e7];return _0x1046b6;};'use strict';var express=require(_0x1016('0x0'));var router=express['Router']();var auth=require(_0x1016('0x1'));var controller=require(_0x1016('0x2'));router[_0x1016('0x3')]('/',controller[_0x1016('0x4')]);router[_0x1016('0x3')](_0x1016('0x5'),auth[_0x1016('0x6')](),auth['canUpdate'](),controller[_0x1016('0x7')]);router[_0x1016('0x3')](_0x1016('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x1016('0x9')]);router[_0x1016('0x3')](_0x1016('0xa'),auth['isAuthenticated'](),auth[_0x1016('0xb')](),controller[_0x1016('0xc')]);router['get'](_0x1016('0xd'),auth[_0x1016('0x6')](),controller['restart']);router[_0x1016('0x3')](_0x1016('0xe'),controller['migrations']);module[_0x1016('0xf')]=router; \ No newline at end of file +var _0x9594=['./version.controller','get','index','/fetch','isAuthenticated','/reset','reset','canUpdate','pull','/restart','restart','/migrations','migrations','exports','express','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9594,0x10e));var _0x4959=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x9594[_0x37bd26];return _0xe83dc4;};'use strict';var express=require(_0x4959('0x0'));var router=express['Router']();var auth=require(_0x4959('0x1'));var controller=require(_0x4959('0x2'));router[_0x4959('0x3')]('/',controller[_0x4959('0x4')]);router[_0x4959('0x3')](_0x4959('0x5'),auth[_0x4959('0x6')](),auth['canUpdate'](),controller['fetch']);router[_0x4959('0x3')](_0x4959('0x7'),auth[_0x4959('0x6')](),auth['canUpdate'](),controller[_0x4959('0x8')]);router[_0x4959('0x3')]('/pull',auth[_0x4959('0x6')](),auth[_0x4959('0x9')](),controller[_0x4959('0xa')]);router[_0x4959('0x3')](_0x4959('0xb'),auth['isAuthenticated'](),controller[_0x4959('0xc')]);router[_0x4959('0x3')](_0x4959('0xd'),controller[_0x4959('0xe')]);module[_0x4959('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index a04a0d2..d419293 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 _0x9a04=['migrations','readdirSync','join','server','length','replace','.js','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','json','status','origin','master','error','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully'];(function(_0x17312f,_0x1ffd21){var _0x3a344f=function(_0x563da0){while(--_0x563da0){_0x17312f['push'](_0x17312f['shift']());}};_0x3a344f(++_0x1ffd21);}(_0x9a04,0x1da));var _0x49a0=function(_0x4ae7b5,_0x994eff){_0x4ae7b5=_0x4ae7b5-0x0;var _0x255f8f=_0x9a04[_0x4ae7b5];return _0x255f8f;};'use strict';var Umzug=require(_0x49a0('0x0'));var path=require(_0x49a0('0x1'));var fs=require('fs');var _=require(_0x49a0('0x2'));var pkginfo=require(_0x49a0('0x3'))(module,_0x49a0('0x4'));var compareVersions=require(_0x49a0('0x5'));var exec=require(_0x49a0('0x6'))[_0x49a0('0x7')];var db=require(_0x49a0('0x8'))['db'];var config=require(_0x49a0('0x9'));var pm2=require(_0x49a0('0xa'));var logger=require(_0x49a0('0xb'))(_0x49a0('0xc'));var git=require(_0x49a0('0xd'))(config[_0x49a0('0xe')]);exports[_0x49a0('0xf')]=function(_0x548767,_0xfb903){var _0x9e5555={'current':module[_0x49a0('0x10')][_0x49a0('0x4')],'phonebar':0x2};if(_0x548767[_0x49a0('0x11')]&&_0x548767[_0x49a0('0x11')][_0x49a0('0x12')]){return git[_0x49a0('0x13')]()[_0x49a0('0x14')](function(_0x33de68,_0x29f675){_0x9e5555['latest']=(_0x33de68?module[_0x49a0('0x10')][_0x49a0('0x4')]:_0x29f675[_0x49a0('0x12')])||'2.0.0';return _0xfb903['status'](0xc8)[_0x49a0('0x15')](_0x9e5555);});}else{return _0xfb903[_0x49a0('0x16')](0xc8)['json'](_0x9e5555);}};exports['fetch']=function(_0x3dd2b8,_0x3d9010){return git[_0x49a0('0x13')]([_0x49a0('0x17'),_0x49a0('0x18')],function(_0x4cc6c5){if(_0x4cc6c5){logger[_0x49a0('0x19')](_0x4cc6c5);return _0x3d9010[_0x49a0('0x16')](0x1f4)[_0x49a0('0x15')](_0x4cc6c5);}logger['info']('git\x20fetch');return _0x3d9010[_0x49a0('0x16')](0xc8)['json']({'output':_0x49a0('0x1a')});});};exports[_0x49a0('0x1b')]=function(_0x1178d9,_0x3f4da6){return git[_0x49a0('0x1b')]([_0x49a0('0x1c'),_0x49a0('0x1d')],function(_0x492dda){if(_0x492dda){logger['error'](_0x492dda);return _0x3f4da6[_0x49a0('0x16')](0x1f4)[_0x49a0('0x15')](_0x492dda);}logger[_0x49a0('0x1e')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x3f4da6[_0x49a0('0x16')](0xc8)['json']({'output':_0x49a0('0x1f')});});};exports[_0x49a0('0x20')]=function(_0x59074a,_0x25e0bb){exec(_0x49a0('0x21'),function(_0x9a71a3,_0xef7171,_0x5854fe){logger[_0x49a0('0x1e')](_0xef7171);logger[_0x49a0('0x1e')](_0x5854fe);if(_0x9a71a3){logger['error'](_0x9a71a3);return _0x25e0bb[_0x49a0('0x16')](0x1f4)[_0x49a0('0x15')](_0x9a71a3);}return _0x25e0bb[_0x49a0('0x16')](0xc8)[_0x49a0('0x15')]({'output':_0xef7171});});};exports[_0x49a0('0x22')]=function(_0x643e56,_0x4fe07b){return pm2[_0x49a0('0x22')](_0x49a0('0x23'))[_0x49a0('0x24')](function(_0x2c4f54){logger[_0x49a0('0x1e')](_0x49a0('0x25'),_0x2c4f54);return _0x4fe07b[_0x49a0('0x16')](0xc8)[_0x49a0('0x15')]({'output':_0x49a0('0x26')});})['catch'](function(_0x2fd2ad){logger[_0x49a0('0x19')](_0x2fd2ad);return _0x4fe07b[_0x49a0('0x16')](0x1f4)[_0x49a0('0x15')](_0x2fd2ad);});};exports[_0x49a0('0x27')]=function(_0xd53dfc,_0x51775b){var _0x466b3d=fs[_0x49a0('0x28')](path[_0x49a0('0x29')](config[_0x49a0('0xe')],_0x49a0('0x2a'),_0x49a0('0x27')));var _0x89dff4=[];for(var _0x5217a9=0x0;_0x5217a9<_0x466b3d[_0x49a0('0x2b')];_0x5217a9++){var _0x721621=_0x466b3d[_0x5217a9][_0x49a0('0x2c')](_0x49a0('0x2d'),'');if(compareVersions(module['exports'][_0x49a0('0x4')],_0x721621)===-0x1){_0x89dff4[_0x49a0('0x2e')](_0x721621);}}if(_0x89dff4[_0x49a0('0x2b')]){var _0x28e36e=_0x89dff4[_0x49a0('0x2f')](compareVersions);var _0x48b65e=new Umzug({'storage':_0x49a0('0x30'),'storageOptions':{'model':db[_0x49a0('0x31')],'modelName':_0x49a0('0x31'),'columnName':_0x49a0('0x4')},'migrations':{'params':[db[_0x49a0('0x30')]['getQueryInterface'](),db[_0x49a0('0x30')]['constructor'],function(){throw new Error(_0x49a0('0x32'));}],'path':path['join'](config[_0x49a0('0xe')],'server',_0x49a0('0x27')),'pattern':/\.js$/}});_0x48b65e['up']({'migrations':_[_0x49a0('0x33')](_0x28e36e,function(_0x2eac98){return _0x2eac98+'.js';})})[_0x49a0('0x24')](function(){return _0x51775b[_0x49a0('0x16')](0xc8)['json']({'output':_0x49a0('0x34')+module[_0x49a0('0x10')][_0x49a0('0x4')]+'\x20to\x20'+_[_0x49a0('0x35')](_0x28e36e),'migrations':_[_0x49a0('0x29')](_0x28e36e)});})[_0x49a0('0x36')](function(_0x2c3235){if(_0x2c3235 instanceof db[_0x49a0('0x30')][_0x49a0('0x37')]){return _0x51775b[_0x49a0('0x16')](0xc8)[_0x49a0('0x15')]({'output':_0x49a0('0x38')});}else{return _0x51775b[_0x49a0('0x16')](0x1f4)[_0x49a0('0x15')](_0x2c3235);}});}else{return _0x51775b['status'](0xc8)[_0x49a0('0x15')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x3b37=['origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','update','simple-git','root','latest','fetch','tags','exports','2.0.0','status','json'];(function(_0x14981d,_0x5c785c){var _0x15475f=function(_0x353d7e){while(--_0x353d7e){_0x14981d['push'](_0x14981d['shift']());}};_0x15475f(++_0x5c785c);}(_0x3b37,0x195));var _0x73b3=function(_0x1018b8,_0x25465f){_0x1018b8=_0x1018b8-0x0;var _0x58f09d=_0x3b37[_0x1018b8];return _0x58f09d;};'use strict';var Umzug=require(_0x73b3('0x0'));var path=require(_0x73b3('0x1'));var fs=require('fs');var _=require(_0x73b3('0x2'));var pkginfo=require('pkginfo')(module,_0x73b3('0x3'));var compareVersions=require(_0x73b3('0x4'));var exec=require(_0x73b3('0x5'))[_0x73b3('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x73b3('0x7'));var pm2=require(_0x73b3('0x8'));var logger=require('../../config/logger')(_0x73b3('0x9'));var git=require(_0x73b3('0xa'))(config[_0x73b3('0xb')]);exports['index']=function(_0x530d14,_0x336593){var _0x3c064a={'current':module['exports'][_0x73b3('0x3')],'phonebar':0x2};if(_0x530d14['query']&&_0x530d14['query'][_0x73b3('0xc')]){return git[_0x73b3('0xd')]()[_0x73b3('0xe')](function(_0x4f1484,_0x157fb){_0x3c064a[_0x73b3('0xc')]=(_0x4f1484?module[_0x73b3('0xf')][_0x73b3('0x3')]:_0x157fb[_0x73b3('0xc')])||_0x73b3('0x10');return _0x336593[_0x73b3('0x11')](0xc8)['json'](_0x3c064a);});}else{return _0x336593[_0x73b3('0x11')](0xc8)[_0x73b3('0x12')](_0x3c064a);}};exports[_0x73b3('0xd')]=function(_0x245598,_0x3a540e){return git[_0x73b3('0xd')]([_0x73b3('0x13'),'master'],function(_0x4b5037){if(_0x4b5037){logger[_0x73b3('0x14')](_0x4b5037);return _0x3a540e['status'](0x1f4)['json'](_0x4b5037);}logger[_0x73b3('0x15')](_0x73b3('0x16'));return _0x3a540e[_0x73b3('0x11')](0xc8)[_0x73b3('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports['reset']=function(_0x13303c,_0x3228e2){return git[_0x73b3('0x17')]([_0x73b3('0x18'),_0x73b3('0x19')],function(_0x251735){if(_0x251735){logger[_0x73b3('0x14')](_0x251735);return _0x3228e2[_0x73b3('0x11')](0x1f4)['json'](_0x251735);}logger[_0x73b3('0x15')](_0x73b3('0x1a'));return _0x3228e2[_0x73b3('0x11')](0xc8)[_0x73b3('0x12')]({'output':_0x73b3('0x1b')});});};exports[_0x73b3('0x1c')]=function(_0x5d2c22,_0x22ea64){exec(_0x73b3('0x1d'),function(_0x4812b0,_0x42908a,_0x24df31){logger[_0x73b3('0x15')](_0x42908a);logger[_0x73b3('0x15')](_0x24df31);if(_0x4812b0){logger[_0x73b3('0x14')](_0x4812b0);return _0x22ea64[_0x73b3('0x11')](0x1f4)[_0x73b3('0x12')](_0x4812b0);}return _0x22ea64[_0x73b3('0x11')](0xc8)[_0x73b3('0x12')]({'output':_0x42908a});});};exports['restart']=function(_0x58aeb0,_0xda99c6){return pm2[_0x73b3('0x1e')]('motion2')[_0x73b3('0x1f')](function(_0x16ea5b){logger[_0x73b3('0x15')](_0x73b3('0x20'),_0x16ea5b);return _0xda99c6[_0x73b3('0x11')](0xc8)[_0x73b3('0x12')]({'output':_0x73b3('0x21')});})[_0x73b3('0x22')](function(_0x1f7342){logger['error'](_0x1f7342);return _0xda99c6[_0x73b3('0x11')](0x1f4)[_0x73b3('0x12')](_0x1f7342);});};exports[_0x73b3('0x23')]=function(_0x53f2df,_0x20d945){var _0x42d775=fs['readdirSync'](path[_0x73b3('0x24')](config[_0x73b3('0xb')],_0x73b3('0x25'),_0x73b3('0x23')));var _0x27f400=[];for(var _0x555189=0x0;_0x555189<_0x42d775[_0x73b3('0x26')];_0x555189++){var _0x197e5b=_0x42d775[_0x555189][_0x73b3('0x27')](_0x73b3('0x28'),'');if(compareVersions(module[_0x73b3('0xf')][_0x73b3('0x3')],_0x197e5b)===-0x1){_0x27f400[_0x73b3('0x29')](_0x197e5b);}}if(_0x27f400[_0x73b3('0x26')]){var _0x11b148=_0x27f400[_0x73b3('0x2a')](compareVersions);var _0x1351bd=new Umzug({'storage':_0x73b3('0x2b'),'storageOptions':{'model':db[_0x73b3('0x2c')],'modelName':'Migration','columnName':_0x73b3('0x3')},'migrations':{'params':[db[_0x73b3('0x2b')][_0x73b3('0x2d')](),db[_0x73b3('0x2b')][_0x73b3('0x2e')],function(){throw new Error(_0x73b3('0x2f'));}],'path':path[_0x73b3('0x24')](config['root'],'server',_0x73b3('0x23')),'pattern':/\.js$/}});_0x1351bd['up']({'migrations':_[_0x73b3('0x30')](_0x11b148,function(_0x5456b5){return _0x5456b5+_0x73b3('0x28');})})[_0x73b3('0x1f')](function(){return _0x20d945['status'](0xc8)[_0x73b3('0x12')]({'output':_0x73b3('0x31')+module[_0x73b3('0xf')][_0x73b3('0x3')]+_0x73b3('0x32')+_[_0x73b3('0x33')](_0x11b148),'migrations':_[_0x73b3('0x24')](_0x11b148)});})[_0x73b3('0x22')](function(_0x2a46ed){if(_0x2a46ed instanceof db['sequelize']['UniqueConstraintError']){return _0x20d945['status'](0xc8)[_0x73b3('0x12')]({'output':_0x73b3('0x34')});}else{return _0x20d945[_0x73b3('0x11')](0x1f4)['json'](_0x2a46ed);}});}else{return _0x20d945[_0x73b3('0x11')](0xc8)[_0x73b3('0x12')]({'output':_0x73b3('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index be277ae..68e0f58 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 _0x7a6d=['delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','update'];(function(_0x1956e2,_0x25d530){var _0xbc218a=function(_0x4b4677){while(--_0x4b4677){_0x1956e2['push'](_0x1956e2['shift']());}};_0xbc218a(++_0x25d530);}(_0x7a6d,0x1c4));var _0xd7a6=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x7a6d[_0x17928f];return _0x500b63;};'use strict';var multer=require(_0xd7a6('0x0'));var util=require(_0xd7a6('0x1'));var path=require(_0xd7a6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd7a6('0x3')]();var fs_extra=require(_0xd7a6('0x4'));var auth=require(_0xd7a6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd7a6('0x6'));var controller=require(_0xd7a6('0x7'));router[_0xd7a6('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7a6('0x9')]);router[_0xd7a6('0x8')](_0xd7a6('0xa'),auth[_0xd7a6('0xb')](),controller[_0xd7a6('0xc')]);router['get'](_0xd7a6('0xd'),auth[_0xd7a6('0xb')](),controller['show']);router[_0xd7a6('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd7a6('0xd'),auth[_0xd7a6('0xb')](),controller[_0xd7a6('0xf')]);router[_0xd7a6('0x10')]('/:id',auth[_0xd7a6('0xb')](),controller['destroy']);module[_0xd7a6('0x11')]=router; \ No newline at end of file +var _0x3b27=['../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4d672c,_0x15a6e0){var _0x22dc61=function(_0x1cc2f8){while(--_0x1cc2f8){_0x4d672c['push'](_0x4d672c['shift']());}};_0x22dc61(++_0x15a6e0);}(_0x3b27,0x11c));var _0x73b2=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x3b27[_0x2aec52];return _0x3b8835;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73b2('0x0'));var timeout=require('connect-timeout');var express=require(_0x73b2('0x1'));var router=express[_0x73b2('0x2')]();var fs_extra=require(_0x73b2('0x3'));var auth=require(_0x73b2('0x4'));var interaction=require(_0x73b2('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x73b2('0x6')]('/',auth[_0x73b2('0x7')](),controller[_0x73b2('0x8')]);router[_0x73b2('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x73b2('0x9')]);router[_0x73b2('0x6')](_0x73b2('0xa'),auth[_0x73b2('0x7')](),controller[_0x73b2('0xb')]);router[_0x73b2('0xc')]('/',auth[_0x73b2('0x7')](),controller[_0x73b2('0xd')]);router[_0x73b2('0xe')](_0x73b2('0xa'),auth[_0x73b2('0x7')](),controller[_0x73b2('0xf')]);router['delete']('/:id',auth[_0x73b2('0x7')](),controller['destroy']);module[_0x73b2('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index ce7f490..8baff0c 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 _0x8f59=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x8f59,0x11d));var _0x98f5=function(_0x359dcf,_0x5786cf){_0x359dcf=_0x359dcf-0x0;var _0x25a5c5=_0x8f59[_0x359dcf];return _0x25a5c5;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'type':{'type':Sequelize[_0x98f5('0x2')]},'uniqueid':{'type':Sequelize[_0x98f5('0x2')]},'calleridnum':{'type':Sequelize[_0x98f5('0x2')]},'calleridname':{'type':Sequelize[_0x98f5('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x98f5('0x2')]},'membername':{'type':Sequelize[_0x98f5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x98f5('0x3')]},'agentconnectAt':{'type':Sequelize[_0x98f5('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x98f5('0x3')]},'agentdumpAt':{'type':Sequelize[_0x98f5('0x3')]},'holdtime':{'type':Sequelize[_0x98f5('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x98f5('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x98f5('0x4')]},'agentacw':{'type':Sequelize[_0x98f5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x98f5('0x2')]},'lastevent':{'type':Sequelize[_0x98f5('0x2')]},'channel':{'type':Sequelize[_0x98f5('0x2')]},'channelstate':{'type':Sequelize[_0x98f5('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x98f5('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x98f5('0x2')]},'context':{'type':Sequelize[_0x98f5('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x98f5('0x2')]},'destchannel':{'type':Sequelize[_0x98f5('0x2')]},'destchannelstate':{'type':Sequelize[_0x98f5('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x98f5('0x2')]},'destcalleridnum':{'type':Sequelize[_0x98f5('0x2')]},'destcalleridname':{'type':Sequelize[_0x98f5('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x98f5('0x2')]},'destlanguage':{'type':Sequelize[_0x98f5('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x98f5('0x2')]},'destexten':{'type':Sequelize[_0x98f5('0x2')]},'destpriority':{'type':Sequelize[_0x98f5('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x98f5('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x98f5('0x2')]},'transfer':{'type':Sequelize[_0x98f5('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x98f5('0x6')},'transferexten':{'type':Sequelize[_0x98f5('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x56bd=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x3337b6,_0x42c7f9){var _0x568270=function(_0x56e5df){while(--_0x56e5df){_0x3337b6['push'](_0x3337b6['shift']());}};_0x568270(++_0x42c7f9);}(_0x56bd,0xe9));var _0xd56b=function(_0x5a2fb1,_0x126060){_0x5a2fb1=_0x5a2fb1-0x0;var _0x8d8a55=_0x56bd[_0x5a2fb1];return _0x8d8a55;};'use strict';var Sequelize=require('sequelize');module[_0xd56b('0x0')]={'type':{'type':Sequelize[_0xd56b('0x1')]},'uniqueid':{'type':Sequelize[_0xd56b('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xd56b('0x1')]},'queue':{'type':Sequelize[_0xd56b('0x1')]},'interface':{'type':Sequelize[_0xd56b('0x1')]},'membername':{'type':Sequelize[_0xd56b('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd56b('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xd56b('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xd56b('0x2')]},'agentdumpAt':{'type':Sequelize[_0xd56b('0x2')]},'holdtime':{'type':Sequelize[_0xd56b('0x3')]},'agentcomplete':{'type':Sequelize[_0xd56b('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd56b('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd56b('0x3')]},'agentacw':{'type':Sequelize[_0xd56b('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd56b('0x3')]},'reason':{'type':Sequelize[_0xd56b('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xd56b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd56b('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd56b('0x1')]},'language':{'type':Sequelize[_0xd56b('0x1')]},'accountcode':{'type':Sequelize[_0xd56b('0x1')]},'context':{'type':Sequelize[_0xd56b('0x1')]},'exten':{'type':Sequelize[_0xd56b('0x1')]},'priority':{'type':Sequelize[_0xd56b('0x1')]},'destchannel':{'type':Sequelize[_0xd56b('0x1')]},'destchannelstate':{'type':Sequelize[_0xd56b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xd56b('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd56b('0x1')]},'destcalleridname':{'type':Sequelize[_0xd56b('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd56b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd56b('0x1')]},'destlanguage':{'type':Sequelize[_0xd56b('0x1')]},'destaccountcode':{'type':Sequelize[_0xd56b('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xd56b('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd56b('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd56b('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xd56b('0x1')]},'transfer':{'type':Sequelize[_0xd56b('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd56b('0x1')],'comment':_0xd56b('0x5')},'transferexten':{'type':Sequelize[_0xd56b('0x1')]},'transferuniqueid':{'type':Sequelize[_0xd56b('0x1')]},'agententerreason':{'type':Sequelize[_0xd56b('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 75f5804..2172a5f 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(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 35bd676..5306aa8 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 _0xea31=['request-promise','path','rimraf','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x257b0e,_0x563d7e){var _0x27ac2a=function(_0x3a4bbc){while(--_0x3a4bbc){_0x257b0e['push'](_0x257b0e['shift']());}};_0x27ac2a(++_0x563d7e);}(_0xea31,0x6b));var _0x1ea3=function(_0x47e9fa,_0x195359){_0x47e9fa=_0x47e9fa-0x0;var _0x1f0b42=_0xea31[_0x47e9fa];return _0x1f0b42;};'use strict';var _=require(_0x1ea3('0x0'));var util=require('util');var logger=require(_0x1ea3('0x1'))(_0x1ea3('0x2'));var moment=require(_0x1ea3('0x3'));var BPromise=require(_0x1ea3('0x4'));var rp=require(_0x1ea3('0x5'));var fs=require('fs');var path=require(_0x1ea3('0x6'));var rimraf=require(_0x1ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ea3('0x8'));module[_0x1ea3('0x9')]=function(_0x6810da,_0x27c695){return _0x6810da[_0x1ea3('0xa')]('VoiceAgentReport',attributes,{'tableName':_0x1ea3('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1ea3('0xc'),_0x1ea3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfc76=['destuniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','./voiceAgentReport.attributes','define','report_agent','uniqueid'];(function(_0xfaad5,_0x3bce11){var _0x2a29a7=function(_0x50ea09){while(--_0x50ea09){_0xfaad5['push'](_0xfaad5['shift']());}};_0x2a29a7(++_0x3bce11);}(_0xfc76,0xb5));var _0x6fc7=function(_0x154bb2,_0x49cf08){_0x154bb2=_0x154bb2-0x0;var _0x1b8c11=_0xfc76[_0x154bb2];return _0x1b8c11;};'use strict';var _=require('lodash');var util=require(_0x6fc7('0x0'));var logger=require(_0x6fc7('0x1'))(_0x6fc7('0x2'));var moment=require(_0x6fc7('0x3'));var BPromise=require(_0x6fc7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fc7('0x5'));var rimraf=require(_0x6fc7('0x6'));var config=require('../../config/environment');var attributes=require(_0x6fc7('0x7'));module['exports']=function(_0xe8177b,_0x82a35a){return _0xe8177b[_0x6fc7('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x6fc7('0x9'),'paranoid':![],'indexes':[{'fields':[_0x6fc7('0xa'),_0x6fc7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 5d28d49..4c40d82 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 _0x097e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','code','error','VoiceAgentReport,\x20%s,\x20%s','message','result','CreateVoiceAgentReport','options','debug','stringify','UpdateVoiceAgentReport','VoiceAgentReport','update','body','raw','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x278ebf,_0x142c9b){var _0x3a0134=function(_0x4ed34e){while(--_0x4ed34e){_0x278ebf['push'](_0x278ebf['shift']());}};_0x3a0134(++_0x142c9b);}(_0x097e,0x64));var _0xe097=function(_0x274980,_0x9dd5f1){_0x274980=_0x274980-0x0;var _0xda7859=_0x097e[_0x274980];return _0xda7859;};'use strict';var _=require(_0xe097('0x0'));var util=require(_0xe097('0x1'));var moment=require(_0xe097('0x2'));var BPromise=require(_0xe097('0x3'));var rs=require(_0xe097('0x4'));var fs=require('fs');var Redis=require(_0xe097('0x5'));var db=require(_0xe097('0x6'))['db'];var utils=require(_0xe097('0x7'));var logger=require('../../config/logger')(_0xe097('0x8'));var config=require(_0xe097('0x9'));var jayson=require(_0xe097('0xa'));var client=jayson[_0xe097('0xb')][_0xe097('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55063a,_0x855c0c,_0x1cdc05){return new BPromise(function(_0x54ffda,_0xe4feab){return client[_0xe097('0xd')](_0x55063a,_0x1cdc05)[_0xe097('0xe')](function(_0x4c679b){logger[_0xe097('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x855c0c,_0xe097('0x10'));logger['debug'](_0xe097('0x11'),_0x855c0c,_0xe097('0x10'),JSON['stringify'](_0x4c679b));if(_0x4c679b['error']){if(_0x4c679b['error'][_0xe097('0x12')]===0x1f4){logger[_0xe097('0x13')](_0xe097('0x14'),_0x855c0c,_0x4c679b['error'][_0xe097('0x15')]);return _0xe4feab(_0x4c679b['error'][_0xe097('0x15')]);}logger[_0xe097('0x13')](_0xe097('0x14'),_0x855c0c,_0x4c679b[_0xe097('0x13')][_0xe097('0x15')]);return _0x54ffda(_0x4c679b[_0xe097('0x13')][_0xe097('0x15')]);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x855c0c,_0xe097('0x10'));_0x54ffda(_0x4c679b[_0xe097('0x16')]['message']);}})['catch'](function(_0x4a5a01){logger[_0xe097('0x13')](_0xe097('0x14'),_0x855c0c,_0x4a5a01);_0xe4feab(_0x4a5a01);});});}exports[_0xe097('0x17')]=function(_0x159783){var _0x4e5e37=this;return new Promise(function(_0x1c4622,_0x3f695e){return db['VoiceAgentReport']['create'](_0x159783['body'],{'raw':_0x159783[_0xe097('0x18')]?_0x159783[_0xe097('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe097('0xe')](function(_0x2382da){logger[_0xe097('0xf')](_0xe097('0x17'),_0x159783);logger[_0xe097('0x19')](_0xe097('0x17'),_0x159783,JSON[_0xe097('0x1a')](_0x2382da));_0x1c4622(_0x2382da);})['catch'](function(_0x5252b6){logger['error'](_0xe097('0x17'),_0x5252b6[_0xe097('0x15')],_0x159783);_0x3f695e(_0x4e5e37[_0xe097('0x13')](0x1f4,_0x5252b6['message']));});});};exports[_0xe097('0x1b')]=function(_0x586ef0){var _0x207b12=this;return new Promise(function(_0x3990ba,_0x11688e){return db[_0xe097('0x1c')][_0xe097('0x1d')](_0x586ef0[_0xe097('0x1e')],{'raw':_0x586ef0[_0xe097('0x18')]?_0x586ef0[_0xe097('0x18')][_0xe097('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x586ef0[_0xe097('0x18')]?_0x586ef0['options'][_0xe097('0x20')]||null:null,'attributes':_0x586ef0[_0xe097('0x18')]?_0x586ef0[_0xe097('0x18')][_0xe097('0x21')]||null:null,'limit':_0x586ef0['options']?_0x586ef0[_0xe097('0x18')][_0xe097('0x22')]||null:null})[_0xe097('0xe')](function(_0x3b9278){logger[_0xe097('0xf')](_0xe097('0x1b'),_0x586ef0);logger[_0xe097('0x19')](_0xe097('0x1b'),_0x586ef0,JSON['stringify'](_0x3b9278));_0x3990ba(_0x3b9278);})[_0xe097('0x23')](function(_0x14e0cc){logger[_0xe097('0x13')](_0xe097('0x1b'),_0x14e0cc[_0xe097('0x15')],_0x586ef0);_0x11688e(_0x207b12['error'](0x1f4,_0x14e0cc['message']));});});}; \ No newline at end of file +var _0x6838=['request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','debug','catch','UpdateVoiceAgentReport','update','where','limit','lodash','moment','randomstring','ioredis','../../config/utils','rpc','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6838,0x13f));var _0x8683=function(_0x3e6898,_0x25681e){_0x3e6898=_0x3e6898-0x0;var _0x419360=_0x6838[_0x3e6898];return _0x419360;};'use strict';var _=require(_0x8683('0x0'));var util=require('util');var moment=require(_0x8683('0x1'));var BPromise=require('bluebird');var rs=require(_0x8683('0x2'));var fs=require('fs');var Redis=require(_0x8683('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8683('0x4'));var logger=require('../../config/logger')(_0x8683('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8683('0x6')][_0x8683('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x344c45,_0x56c245,_0x1d05d4){return new BPromise(function(_0x3ddcd1,_0x1b97b9){return client[_0x8683('0x8')](_0x344c45,_0x1d05d4)['then'](function(_0x2cdb34){logger[_0x8683('0x9')](_0x8683('0xa'),_0x56c245,_0x8683('0xb'));logger['debug'](_0x8683('0xc'),_0x56c245,'request\x20sent',JSON[_0x8683('0xd')](_0x2cdb34));if(_0x2cdb34[_0x8683('0xe')]){if(_0x2cdb34[_0x8683('0xe')][_0x8683('0xf')]===0x1f4){logger[_0x8683('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x56c245,_0x2cdb34[_0x8683('0xe')][_0x8683('0x10')]);return _0x1b97b9(_0x2cdb34[_0x8683('0xe')][_0x8683('0x10')]);}logger[_0x8683('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x56c245,_0x2cdb34['error'][_0x8683('0x10')]);return _0x3ddcd1(_0x2cdb34['error']['message']);}else{logger[_0x8683('0x9')](_0x8683('0xa'),_0x56c245,'request\x20sent');_0x3ddcd1(_0x2cdb34['result'][_0x8683('0x10')]);}})['catch'](function(_0x1d670a){logger[_0x8683('0xe')](_0x8683('0xa'),_0x56c245,_0x1d670a);_0x1b97b9(_0x1d670a);});});}exports[_0x8683('0x11')]=function(_0x5486e1){var _0x4b8299=this;return new Promise(function(_0x460592,_0x58a323){return db[_0x8683('0x12')][_0x8683('0x13')](_0x5486e1[_0x8683('0x14')],{'raw':_0x5486e1[_0x8683('0x15')]?_0x5486e1[_0x8683('0x15')][_0x8683('0x16')]===undefined?!![]:![]:!![]})[_0x8683('0x17')](function(_0x426406){logger['info'](_0x8683('0x11'),_0x5486e1);logger[_0x8683('0x18')]('CreateVoiceAgentReport',_0x5486e1,JSON['stringify'](_0x426406));_0x460592(_0x426406);})[_0x8683('0x19')](function(_0x57fecf){logger[_0x8683('0xe')](_0x8683('0x11'),_0x57fecf[_0x8683('0x10')],_0x5486e1);_0x58a323(_0x4b8299[_0x8683('0xe')](0x1f4,_0x57fecf['message']));});});};exports[_0x8683('0x1a')]=function(_0x2d5f00){var _0x4a6679=this;return new Promise(function(_0x3f0320,_0x141729){return db['VoiceAgentReport'][_0x8683('0x1b')](_0x2d5f00[_0x8683('0x14')],{'raw':_0x2d5f00[_0x8683('0x15')]?_0x2d5f00[_0x8683('0x15')][_0x8683('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5f00[_0x8683('0x15')]?_0x2d5f00[_0x8683('0x15')][_0x8683('0x1c')]||null:null,'attributes':_0x2d5f00['options']?_0x2d5f00[_0x8683('0x15')]['attributes']||null:null,'limit':_0x2d5f00[_0x8683('0x15')]?_0x2d5f00[_0x8683('0x15')][_0x8683('0x1d')]||null:null})[_0x8683('0x17')](function(_0x12e184){logger[_0x8683('0x9')](_0x8683('0x1a'),_0x2d5f00);logger['debug'](_0x8683('0x1a'),_0x2d5f00,JSON[_0x8683('0xd')](_0x12e184));_0x3f0320(_0x12e184);})[_0x8683('0x19')](function(_0x19b79e){logger[_0x8683('0xe')](_0x8683('0x1a'),_0x19b79e[_0x8683('0x10')],_0x2d5f00);_0x141729(_0x4a6679['error'](0x1f4,_0x19b79e[_0x8683('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 9d4c40f..ccdfec1 100644 --- a/server/api/voiceCallReport/index.js +++ b/server/api/voiceCallReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9a19=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x3d10d8,_0x1dc526){var _0x4e38c0=function(_0x3d03fc){while(--_0x3d03fc){_0x3d10d8['push'](_0x3d10d8['shift']());}};_0x4e38c0(++_0x1dc526);}(_0x9a19,0x114));var _0x99a1=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9a19[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x99a1('0xa')](_0x99a1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x99a1('0xe')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x10')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0x11')]);router[_0x99a1('0x12')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x13')]);module[_0x99a1('0x14')]=router; \ No newline at end of file +var _0xcb66=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x21f86b,_0x479866){var _0x164296=function(_0x13a517){while(--_0x13a517){_0x21f86b['push'](_0x21f86b['shift']());}};_0x164296(++_0x479866);}(_0xcb66,0x19f));var _0x6cb6=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0xcb66[_0x1344d6];return _0xf45b24;};'use strict';var multer=require('multer');var util=require(_0x6cb6('0x0'));var path=require(_0x6cb6('0x1'));var timeout=require(_0x6cb6('0x2'));var express=require(_0x6cb6('0x3'));var router=express[_0x6cb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cb6('0x5'));var interaction=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var controller=require(_0x6cb6('0x8'));router[_0x6cb6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6cb6('0x9')](_0x6cb6('0xa'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xc')]);router[_0x6cb6('0x9')](_0x6cb6('0xd'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xe')]);router[_0x6cb6('0xf')]('/',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x10')]);router[_0x6cb6('0x11')](_0x6cb6('0xd'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x12')]);module[_0x6cb6('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 0e6046f..fe7f850 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 _0xdd6a=['INTEGER','sequelize','exports','ENUM','inbound','internal','outbound','outbound-fax','dialer','STRING','TEXT','DATE'];(function(_0x54afbc,_0x9d44bd){var _0xe5e0b7=function(_0x18f7d2){while(--_0x18f7d2){_0x54afbc['push'](_0x54afbc['shift']());}};_0xe5e0b7(++_0x9d44bd);}(_0xdd6a,0x15d));var _0xadd6=function(_0x336264,_0x32e1d9){_0x336264=_0x336264-0x0;var _0x53cf91=_0xdd6a[_0x336264];return _0x53cf91;};'use strict';var Sequelize=require(_0xadd6('0x0'));module[_0xadd6('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xadd6('0x2')](_0xadd6('0x3'),_0xadd6('0x4'),_0xadd6('0x5'),'inbound-fax',_0xadd6('0x6'),_0xadd6('0x7'))},'tag':{'type':Sequelize[_0xadd6('0x8')]},'accountcode':{'type':Sequelize[_0xadd6('0x8')]},'source':{'type':Sequelize[_0xadd6('0x8')]},'destination':{'type':Sequelize[_0xadd6('0x8')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xadd6('0x8')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xadd6('0x8')]},'lastapplication':{'type':Sequelize[_0xadd6('0x8')]},'lastdata':{'type':Sequelize[_0xadd6('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xadd6('0xa')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xadd6('0xa')]},'duration':{'type':Sequelize[_0xadd6('0xb')]},'billableseconds':{'type':Sequelize[_0xadd6('0xb')]},'mohtime':{'type':Sequelize[_0xadd6('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xadd6('0x8')]},'amaflags':{'type':Sequelize[_0xadd6('0x8')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xadd6('0x8')]},'userSecondDisposition':{'type':Sequelize[_0xadd6('0x8')]},'userThirdDisposition':{'type':Sequelize[_0xadd6('0x8')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb0c3=['INTEGER','sequelize','exports','internal','inbound-fax','outbound-fax','STRING','TEXT','DATE'];(function(_0x3b2da1,_0x5dc17b){var _0x4f530a=function(_0x2e8533){while(--_0x2e8533){_0x3b2da1['push'](_0x3b2da1['shift']());}};_0x4f530a(++_0x5dc17b);}(_0xb0c3,0x9a));var _0x3b0c=function(_0x4de1d3,_0x46b0ba){_0x4de1d3=_0x4de1d3-0x0;var _0x1879a6=_0xb0c3[_0x4de1d3];return _0x1879a6;};'use strict';var Sequelize=require(_0x3b0c('0x0'));module[_0x3b0c('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('inbound',_0x3b0c('0x2'),'outbound',_0x3b0c('0x3'),_0x3b0c('0x4'),'dialer')},'tag':{'type':Sequelize[_0x3b0c('0x5')]},'accountcode':{'type':Sequelize[_0x3b0c('0x5')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x3b0c('0x5')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3b0c('0x5')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x3b0c('0x6')]},'starttime':{'type':Sequelize[_0x3b0c('0x7')]},'systemanswertime':{'type':Sequelize[_0x3b0c('0x7')]},'answertime':{'type':Sequelize[_0x3b0c('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x3b0c('0x8')]},'mohtime':{'type':Sequelize[_0x3b0c('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3b0c('0x5')]},'amaflags':{'type':Sequelize[_0x3b0c('0x5')]},'userfield':{'type':Sequelize[_0x3b0c('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x3b0c('0x5')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3b0c('0x5')]},'prefix':{'type':Sequelize[_0x3b0c('0x5')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x3b0c('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index fe84d43..4d6c298 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x2a904a,_0x202907){var _0x322764=function(_0x54e4f5){while(--_0x54e4f5){_0x2a904a['push'](_0x2a904a['shift']());}};_0x322764(++_0x202907);}(_0xdb28,0x106));var _0x8db2=function(_0x56505a,_0x454112){_0x56505a=_0x56505a-0x0;var _0x5b3d65=_0xdb28[_0x56505a];return _0x5b3d65;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0xadb5,0xad));var _0x5adb=function(_0x2f0da9,_0x10c9ad){_0x2f0da9=_0x2f0da9-0x0;var _0x2b216b=_0xadb5[_0x2f0da9];return _0x2b216b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 5887ec6..5e7c687 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 _0x8f9e=['request-promise','path','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger'];(function(_0x115be8,_0x38566d){var _0x9ba2d7=function(_0x2c5c9e){while(--_0x2c5c9e){_0x115be8['push'](_0x115be8['shift']());}};_0x9ba2d7(++_0x38566d);}(_0x8f9e,0x10b));var _0xe8f9=function(_0x531c7d,_0x521c33){_0x531c7d=_0x531c7d-0x0;var _0x4eaf19=_0x8f9e[_0x531c7d];return _0x4eaf19;};'use strict';var _=require(_0xe8f9('0x0'));var util=require(_0xe8f9('0x1'));var logger=require(_0xe8f9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe8f9('0x3'));var fs=require('fs');var path=require(_0xe8f9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x258d85,_0x255cc2){return _0x258d85[_0xe8f9('0x5')](_0xe8f9('0x6'),attributes,{'tableName':_0xe8f9('0x7'),'paranoid':![],'indexes':[{'fields':[_0xe8f9('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd5f1=['report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','VoiceCallReport'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xd5f1,0x91));var _0x1d5f=function(_0x22fefb,_0x105065){_0x22fefb=_0x22fefb-0x0;var _0x49a5e0=_0xd5f1[_0x22fefb];return _0x49a5e0;};'use strict';var _=require(_0x1d5f('0x0'));var util=require(_0x1d5f('0x1'));var logger=require(_0x1d5f('0x2'))(_0x1d5f('0x3'));var moment=require(_0x1d5f('0x4'));var BPromise=require(_0x1d5f('0x5'));var rp=require(_0x1d5f('0x6'));var fs=require('fs');var path=require(_0x1d5f('0x7'));var rimraf=require(_0x1d5f('0x8'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x443e59,_0x87786d){return _0x443e59[_0x1d5f('0x9')](_0x1d5f('0xa'),attributes,{'tableName':_0x1d5f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1d5f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index f8167de..7ad99bd 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 _0x036b=['debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VoiceCallReport','options','limit','include','model','attributes','map','GetVoiceCallReport','CreateVoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent'];(function(_0x527547,_0x95fdb5){var _0x397af2=function(_0x12af4a){while(--_0x12af4a){_0x527547['push'](_0x527547['shift']());}};_0x397af2(++_0x95fdb5);}(_0x036b,0x145));var _0xb036=function(_0x51f309,_0x416ab1){_0x51f309=_0x51f309-0x0;var _0x529ea0=_0x036b[_0x51f309];return _0x529ea0;};'use strict';var _=require(_0xb036('0x0'));var util=require(_0xb036('0x1'));var moment=require(_0xb036('0x2'));var BPromise=require('bluebird');var rs=require(_0xb036('0x3'));var fs=require('fs');var Redis=require(_0xb036('0x4'));var db=require(_0xb036('0x5'))['db'];var utils=require(_0xb036('0x6'));var logger=require(_0xb036('0x7'))('rpc');var config=require(_0xb036('0x8'));var jayson=require(_0xb036('0x9'));var client=jayson[_0xb036('0xa')][_0xb036('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d495e,_0x35a13f,_0x5bbb44){return new BPromise(function(_0x465d7d,_0x5b3e48){return client[_0xb036('0xc')](_0x1d495e,_0x5bbb44)[_0xb036('0xd')](function(_0x347811){logger[_0xb036('0xe')](_0xb036('0xf'),_0x35a13f,_0xb036('0x10'));logger[_0xb036('0x11')](_0xb036('0x12'),_0x35a13f,_0xb036('0x10'),JSON[_0xb036('0x13')](_0x347811));if(_0x347811[_0xb036('0x14')]){if(_0x347811[_0xb036('0x14')][_0xb036('0x15')]===0x1f4){logger[_0xb036('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x35a13f,_0x347811['error']['message']);return _0x5b3e48(_0x347811[_0xb036('0x14')][_0xb036('0x16')]);}logger['error'](_0xb036('0xf'),_0x35a13f,_0x347811[_0xb036('0x14')][_0xb036('0x16')]);return _0x465d7d(_0x347811[_0xb036('0x14')]['message']);}else{logger[_0xb036('0xe')](_0xb036('0xf'),_0x35a13f,'request\x20sent');_0x465d7d(_0x347811['result'][_0xb036('0x16')]);}})[_0xb036('0x17')](function(_0x3c4adc){logger[_0xb036('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x35a13f,_0x3c4adc);_0x5b3e48(_0x3c4adc);});});}exports['GetVoiceCallReport']=function(_0x38e5c8){var _0x4ed446=this;return new Promise(function(_0x992a54,_0x788293){return db[_0xb036('0x18')]['findAll']({'raw':_0x38e5c8['options']?_0x38e5c8[_0xb036('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8['options']['where']||null:null,'attributes':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8[_0xb036('0x19')]['attributes']||null:null,'limit':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8[_0xb036('0x19')][_0xb036('0x1a')]||null:null,'include':_0x38e5c8[_0xb036('0x19')]?_0x38e5c8[_0xb036('0x19')][_0xb036('0x1b')]?_['map'](_0x38e5c8[_0xb036('0x19')][_0xb036('0x1b')],function(_0x581e8b){return{'model':db[_0x581e8b[_0xb036('0x1c')]],'as':_0x581e8b['as'],'attributes':_0x581e8b[_0xb036('0x1d')],'include':_0x581e8b[_0xb036('0x1b')]?_[_0xb036('0x1e')](_0x581e8b[_0xb036('0x1b')],function(_0x1fc870){return{'model':db[_0x1fc870[_0xb036('0x1c')]],'as':_0x1fc870['as'],'attributes':_0x1fc870[_0xb036('0x1d')],'include':_0x1fc870[_0xb036('0x1b')]?_[_0xb036('0x1e')](_0x1fc870[_0xb036('0x1b')],function(_0x3fff5f){return{'model':db[_0x3fff5f[_0xb036('0x1c')]],'as':_0x3fff5f['as'],'attributes':_0x3fff5f['attributes']};}):[]};}):[]};}):[]:[]})[_0xb036('0xd')](function(_0x1159fd){logger['info'](_0xb036('0x1f'),_0x38e5c8);logger['debug'](_0xb036('0x1f'),_0x38e5c8,JSON[_0xb036('0x13')](_0x1159fd));_0x992a54(_0x1159fd);})['catch'](function(_0x52ee5b){logger[_0xb036('0x14')]('GetVoiceCallReport',_0x52ee5b['message'],_0x38e5c8);_0x788293(_0x4ed446['error'](0x1f4,_0x52ee5b[_0xb036('0x16')]));});});};exports[_0xb036('0x20')]=function(_0x4628d5){var _0x22aa54=this;return new Promise(function(_0x5dd046,_0x46a75b){return db[_0xb036('0x18')][_0xb036('0x21')](_0x4628d5[_0xb036('0x22')],{'raw':_0x4628d5['options']?_0x4628d5[_0xb036('0x19')][_0xb036('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x2c7af8){logger[_0xb036('0xe')](_0xb036('0x20'),_0x4628d5);logger['debug'](_0xb036('0x20'),_0x4628d5,JSON[_0xb036('0x13')](_0x2c7af8));_0x5dd046(_0x2c7af8);})['catch'](function(_0x15326b){logger[_0xb036('0x14')](_0xb036('0x20'),_0x15326b['message'],_0x4628d5);_0x46a75b(_0x22aa54['error'](0x1f4,_0x15326b[_0xb036('0x16')]));});});};exports[_0xb036('0x24')]=function(_0x274957){var _0x5eabf0=this;return new Promise(function(_0x106550,_0x3ae515){return db['VoiceCallReport'][_0xb036('0x25')](_0x274957[_0xb036('0x22')],{'raw':_0x274957[_0xb036('0x19')]?_0x274957[_0xb036('0x19')][_0xb036('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x274957['options']?_0x274957['options']['where']||null:null,'attributes':_0x274957[_0xb036('0x19')]?_0x274957['options'][_0xb036('0x1d')]||null:null,'limit':_0x274957[_0xb036('0x19')]?_0x274957[_0xb036('0x19')][_0xb036('0x1a')]||null:null})[_0xb036('0xd')](function(_0x543d09){logger[_0xb036('0xe')](_0xb036('0x24'),_0x274957);logger[_0xb036('0x11')](_0xb036('0x24'),_0x274957,JSON['stringify'](_0x543d09));_0x106550(_0x543d09);})['catch'](function(_0x1fadab){logger[_0xb036('0x14')](_0xb036('0x24'),_0x1fadab[_0xb036('0x16')],_0x274957);_0x3ae515(_0x5eabf0[_0xb036('0x14')](0x1f4,_0x1fadab[_0xb036('0x16')]));});});}; \ No newline at end of file +var _0x777b=['findAll','raw','options','where','attributes','limit','map','model','include','catch','CreateVoiceCallReport','create','body','debug','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport'];(function(_0x3b919d,_0x1d63c7){var _0x5ac910=function(_0x4deb14){while(--_0x4deb14){_0x3b919d['push'](_0x3b919d['shift']());}};_0x5ac910(++_0x1d63c7);}(_0x777b,0x168));var _0xb777=function(_0x58063b,_0x3c8bc4){_0x58063b=_0x58063b-0x0;var _0x162a23=_0x777b[_0x58063b];return _0x162a23;};'use strict';var _=require(_0xb777('0x0'));var util=require(_0xb777('0x1'));var moment=require(_0xb777('0x2'));var BPromise=require(_0xb777('0x3'));var rs=require(_0xb777('0x4'));var fs=require('fs');var Redis=require(_0xb777('0x5'));var db=require(_0xb777('0x6'))['db'];var utils=require(_0xb777('0x7'));var logger=require(_0xb777('0x8'))(_0xb777('0x9'));var config=require(_0xb777('0xa'));var jayson=require(_0xb777('0xb'));var client=jayson[_0xb777('0xc')][_0xb777('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x524476,_0x375bd7,_0x15eb97){return new BPromise(function(_0x2f5d71,_0x53151d){return client[_0xb777('0xe')](_0x524476,_0x15eb97)[_0xb777('0xf')](function(_0x599556){logger[_0xb777('0x10')](_0xb777('0x11'),_0x375bd7,_0xb777('0x12'));logger['debug'](_0xb777('0x13'),_0x375bd7,_0xb777('0x12'),JSON[_0xb777('0x14')](_0x599556));if(_0x599556[_0xb777('0x15')]){if(_0x599556['error'][_0xb777('0x16')]===0x1f4){logger[_0xb777('0x15')](_0xb777('0x11'),_0x375bd7,_0x599556['error'][_0xb777('0x17')]);return _0x53151d(_0x599556[_0xb777('0x15')][_0xb777('0x17')]);}logger[_0xb777('0x15')](_0xb777('0x11'),_0x375bd7,_0x599556[_0xb777('0x15')]['message']);return _0x2f5d71(_0x599556['error']['message']);}else{logger['info'](_0xb777('0x11'),_0x375bd7,_0xb777('0x12'));_0x2f5d71(_0x599556[_0xb777('0x18')][_0xb777('0x17')]);}})['catch'](function(_0x1a5207){logger[_0xb777('0x15')]('VoiceCallReport,\x20%s,\x20%s',_0x375bd7,_0x1a5207);_0x53151d(_0x1a5207);});});}exports[_0xb777('0x19')]=function(_0x40eaaa){var _0x263c5d=this;return new Promise(function(_0x404efe,_0x40e791){return db[_0xb777('0x1a')][_0xb777('0x1b')]({'raw':_0x40eaaa['options']?_0x40eaaa['options'][_0xb777('0x1c')]===undefined?!![]:![]:!![],'where':_0x40eaaa[_0xb777('0x1d')]?_0x40eaaa[_0xb777('0x1d')][_0xb777('0x1e')]||null:null,'attributes':_0x40eaaa[_0xb777('0x1d')]?_0x40eaaa[_0xb777('0x1d')][_0xb777('0x1f')]||null:null,'limit':_0x40eaaa[_0xb777('0x1d')]?_0x40eaaa['options'][_0xb777('0x20')]||null:null,'include':_0x40eaaa[_0xb777('0x1d')]?_0x40eaaa[_0xb777('0x1d')]['include']?_[_0xb777('0x21')](_0x40eaaa[_0xb777('0x1d')]['include'],function(_0x384e6f){return{'model':db[_0x384e6f[_0xb777('0x22')]],'as':_0x384e6f['as'],'attributes':_0x384e6f['attributes'],'include':_0x384e6f[_0xb777('0x23')]?_['map'](_0x384e6f[_0xb777('0x23')],function(_0x188c77){return{'model':db[_0x188c77[_0xb777('0x22')]],'as':_0x188c77['as'],'attributes':_0x188c77[_0xb777('0x1f')],'include':_0x188c77[_0xb777('0x23')]?_[_0xb777('0x21')](_0x188c77[_0xb777('0x23')],function(_0x197a13){return{'model':db[_0x197a13[_0xb777('0x22')]],'as':_0x197a13['as'],'attributes':_0x197a13[_0xb777('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb777('0xf')](function(_0x211fd4){logger['info'](_0xb777('0x19'),_0x40eaaa);logger['debug']('GetVoiceCallReport',_0x40eaaa,JSON[_0xb777('0x14')](_0x211fd4));_0x404efe(_0x211fd4);})[_0xb777('0x24')](function(_0xc38772){logger[_0xb777('0x15')]('GetVoiceCallReport',_0xc38772['message'],_0x40eaaa);_0x40e791(_0x263c5d[_0xb777('0x15')](0x1f4,_0xc38772[_0xb777('0x17')]));});});};exports[_0xb777('0x25')]=function(_0x408590){var _0x55c463=this;return new Promise(function(_0x26c277,_0x32990d){return db[_0xb777('0x1a')][_0xb777('0x26')](_0x408590[_0xb777('0x27')],{'raw':_0x408590[_0xb777('0x1d')]?_0x408590[_0xb777('0x1d')][_0xb777('0x1c')]===undefined?!![]:![]:!![]})[_0xb777('0xf')](function(_0x3740e5){logger[_0xb777('0x10')](_0xb777('0x25'),_0x408590);logger[_0xb777('0x28')](_0xb777('0x25'),_0x408590,JSON[_0xb777('0x14')](_0x3740e5));_0x26c277(_0x3740e5);})[_0xb777('0x24')](function(_0x578cbc){logger['error']('CreateVoiceCallReport',_0x578cbc[_0xb777('0x17')],_0x408590);_0x32990d(_0x55c463[_0xb777('0x15')](0x1f4,_0x578cbc['message']));});});};exports[_0xb777('0x29')]=function(_0x2871e4){var _0x35b25c=this;return new Promise(function(_0x4a8512,_0x49e849){return db['VoiceCallReport'][_0xb777('0x2a')](_0x2871e4[_0xb777('0x27')],{'raw':_0x2871e4[_0xb777('0x1d')]?_0x2871e4[_0xb777('0x1d')][_0xb777('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2871e4['options']?_0x2871e4[_0xb777('0x1d')][_0xb777('0x1e')]||null:null,'attributes':_0x2871e4[_0xb777('0x1d')]?_0x2871e4[_0xb777('0x1d')][_0xb777('0x1f')]||null:null,'limit':_0x2871e4[_0xb777('0x1d')]?_0x2871e4['options'][_0xb777('0x20')]||null:null})[_0xb777('0xf')](function(_0x3296fb){logger['info'](_0xb777('0x29'),_0x2871e4);logger[_0xb777('0x28')](_0xb777('0x29'),_0x2871e4,JSON[_0xb777('0x14')](_0x3296fb));_0x4a8512(_0x3296fb);})[_0xb777('0x24')](function(_0x45f7e5){logger['error']('UpdateVoiceCallReport',_0x45f7e5[_0xb777('0x17')],_0x2871e4);_0x49e849(_0x35b25c['error'](0x1f4,_0x45f7e5[_0xb777('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 3cb38ed..558ab53 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 _0xd6f9=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceChanSpy.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','exports'];(function(_0x1d71c5,_0x1df803){var _0x35e9c8=function(_0x4de11f){while(--_0x4de11f){_0x1d71c5['push'](_0x1d71c5['shift']());}};_0x35e9c8(++_0x1df803);}(_0xd6f9,0x168));var _0x9d6f=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0xd6f9[_0x9c8b4a];return _0x198bef;};'use strict';var multer=require(_0x9d6f('0x0'));var util=require('util');var path=require(_0x9d6f('0x1'));var timeout=require(_0x9d6f('0x2'));var express=require('express');var router=express[_0x9d6f('0x3')]();var fs_extra=require(_0x9d6f('0x4'));var auth=require(_0x9d6f('0x5'));var interaction=require(_0x9d6f('0x6'));var config=require('../../config/environment');var controller=require(_0x9d6f('0x7'));router['get']('/',auth[_0x9d6f('0x8')](),controller[_0x9d6f('0x9')]);router[_0x9d6f('0xa')](_0x9d6f('0xb'),auth[_0x9d6f('0x8')](),controller[_0x9d6f('0xc')]);router[_0x9d6f('0xd')]('/',auth[_0x9d6f('0x8')](),controller[_0x9d6f('0xe')]);router['put'](_0x9d6f('0xb'),auth[_0x9d6f('0x8')](),controller[_0x9d6f('0xf')]);router[_0x9d6f('0x10')](_0x9d6f('0xb'),auth[_0x9d6f('0x8')](),controller['destroy']);module[_0x9d6f('0x11')]=router; \ No newline at end of file +var _0xdc8f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','destroy','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc8f,0x140));var _0xfdc8=function(_0xaaa4fd,_0x9c5f4b){_0xaaa4fd=_0xaaa4fd-0x0;var _0xd428ce=_0xdc8f[_0xaaa4fd];return _0xd428ce;};'use strict';var multer=require(_0xfdc8('0x0'));var util=require(_0xfdc8('0x1'));var path=require(_0xfdc8('0x2'));var timeout=require(_0xfdc8('0x3'));var express=require(_0xfdc8('0x4'));var router=express[_0xfdc8('0x5')]();var fs_extra=require(_0xfdc8('0x6'));var auth=require(_0xfdc8('0x7'));var interaction=require(_0xfdc8('0x8'));var config=require(_0xfdc8('0x9'));var controller=require('./voiceChanSpy.controller');router[_0xfdc8('0xa')]('/',auth[_0xfdc8('0xb')](),controller[_0xfdc8('0xc')]);router[_0xfdc8('0xa')](_0xfdc8('0xd'),auth['isAuthenticated'](),controller[_0xfdc8('0xe')]);router[_0xfdc8('0xf')]('/',auth[_0xfdc8('0xb')](),controller[_0xfdc8('0x10')]);router['put'](_0xfdc8('0xd'),auth[_0xfdc8('0xb')](),controller[_0xfdc8('0x11')]);router['delete'](_0xfdc8('0xd'),auth[_0xfdc8('0xb')](),controller[_0xfdc8('0x12')]);module[_0xfdc8('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 6554676..197d442 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 _0xc1eb=['setDataValue','options','join','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x93ff00,_0x246c04){var _0x33a05a=function(_0x5273ff){while(--_0x5273ff){_0x93ff00['push'](_0x93ff00['shift']());}};_0x33a05a(++_0x246c04);}(_0xc1eb,0xad));var _0xbc1e=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xc1eb[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0xbc1e('0x0'));module[_0xbc1e('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xbc1e('0x2')],'set':function(_0xc06bb0){this[_0xbc1e('0x3')](_0xbc1e('0x4'),_0xc06bb0?_0xc06bb0[_0xbc1e('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xbc1e('0x4'))?this['getDataValue'](_0xbc1e('0x4'))[_0xbc1e('0x6')](''):[];}},'auth':{'type':Sequelize[_0xbc1e('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xbc1e('0x2')]},'record':{'type':Sequelize[_0xbc1e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbc1e('0x2')]},'description':{'type':Sequelize[_0xbc1e('0x2')]}}; \ No newline at end of file +var _0xefb0=['join','split','BOOLEAN','sequelize','exports','STRING','setDataValue','options'];(function(_0x1df4fe,_0x260b7e){var _0x2fd306=function(_0x3bbc40){while(--_0x3bbc40){_0x1df4fe['push'](_0x1df4fe['shift']());}};_0x2fd306(++_0x260b7e);}(_0xefb0,0x163));var _0x0efb=function(_0x5a4e1b,_0x40d30c){_0x5a4e1b=_0x5a4e1b-0x0;var _0x47a95a=_0xefb0[_0x5a4e1b];return _0x47a95a;};'use strict';var Sequelize=require(_0x0efb('0x0'));module[_0x0efb('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0efb('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x0efb('0x2')],'set':function(_0x25cbee){this[_0x0efb('0x3')](_0x0efb('0x4'),_0x25cbee?_0x25cbee[_0x0efb('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x0efb('0x4'))?this['getDataValue']('options')[_0x0efb('0x6')](''):[];}},'auth':{'type':Sequelize[_0x0efb('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x0efb('0x2')]},'record':{'type':Sequelize[_0x0efb('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x0efb('0x2')]},'description':{'type':Sequelize[_0x0efb('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4c43ae9..0954590 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 _0x8135=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','update','then','get','ChanSpies','UserProfileResource','destroy','name','send','map','VoiceChanSpy','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','show','rawAttributes','length','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8135,0x99));var _0x5813=function(_0x21e41b,_0x41a954){_0x21e41b=_0x21e41b-0x0;var _0x5699a0=_0x8135[_0x21e41b];return _0x5699a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5813('0x0'));var zipdir=require(_0x5813('0x1'));var jsonpatch=require(_0x5813('0x2'));var rp=require(_0x5813('0x3'));var moment=require('moment');var BPromise=require(_0x5813('0x4'));var Mustache=require(_0x5813('0x5'));var util=require(_0x5813('0x6'));var path=require(_0x5813('0x7'));var sox=require(_0x5813('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5813('0x9'));var _=require(_0x5813('0xa'));var squel=require(_0x5813('0xb'));var crypto=require(_0x5813('0xc'));var jsforce=require(_0x5813('0xd'));var deskjs=require(_0x5813('0xe'));var toCsv=require(_0x5813('0xf'));var querystring=require(_0x5813('0x10'));var Papa=require(_0x5813('0x11'));var Redis=require(_0x5813('0x12'));var authService=require(_0x5813('0x13'));var qs=require(_0x5813('0x14'));var as=require(_0x5813('0x15'));var hardwareService=require(_0x5813('0x16'));var logger=require(_0x5813('0x17'))(_0x5813('0x18'));var utils=require(_0x5813('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5813('0x1a'));var db=require(_0x5813('0x1b'))['db'];function respondWithStatusCode(_0x1121b9,_0x479d1f){_0x479d1f=_0x479d1f||0xcc;return function(_0x3386c9){if(_0x3386c9){return _0x1121b9[_0x5813('0x1c')](_0x479d1f);}return _0x1121b9['status'](_0x479d1f)[_0x5813('0x1d')]();};}function respondWithResult(_0x12e825,_0x57df76){_0x57df76=_0x57df76||0xc8;return function(_0xd88f23){if(_0xd88f23){return _0x12e825[_0x5813('0x1e')](_0x57df76)[_0x5813('0x1f')](_0xd88f23);}};}function respondWithFilteredResult(_0x5044e9,_0x2bbf85){return function(_0x1e1298){if(_0x1e1298){var _0x5d2724=typeof _0x2bbf85[_0x5813('0x20')]==='undefined'&&typeof _0x2bbf85['limit']==='undefined';var _0x5705c9=_0x1e1298['count'];var _0x2f76d2=_0x5d2724?0x0:_0x2bbf85[_0x5813('0x20')];var _0x1e43df=_0x5d2724?_0x1e1298['count']:_0x2bbf85[_0x5813('0x20')]+_0x2bbf85[_0x5813('0x21')];var _0x7b7ee8;if(_0x1e43df>=_0x5705c9){_0x1e43df=_0x5705c9;_0x7b7ee8=0xc8;}else{_0x7b7ee8=0xce;}_0x5044e9[_0x5813('0x1e')](_0x7b7ee8);return _0x5044e9['set'](_0x5813('0x22'),_0x2f76d2+'-'+_0x1e43df+'/'+_0x5705c9)[_0x5813('0x1f')](_0x1e1298);}return null;};}function patchUpdates(_0x43ebf3){return function(_0x4757aa){try{jsonpatch['apply'](_0x4757aa,_0x43ebf3,!![]);}catch(_0x1f2506){return BPromise[_0x5813('0x23')](_0x1f2506);}return _0x4757aa[_0x5813('0x24')]();};}function saveUpdates(_0x5639ed,_0xd5703e){return function(_0xd116c0){if(_0xd116c0){return _0xd116c0[_0x5813('0x25')](_0x5639ed)[_0x5813('0x26')](function(_0x18a483){return _0x18a483;});}return null;};}function removeEntity(_0x183f7d,_0x39474b){return function(_0xf3ffef){if(_0xf3ffef){return _0xf3ffef['destroy']()[_0x5813('0x26')](function(){var _0x3d59e9=_0xf3ffef[_0x5813('0x27')]({'plain':!![]});var _0x43e264=_0x5813('0x28');return db[_0x5813('0x29')][_0x5813('0x2a')]({'where':{'type':_0x43e264,'resourceId':_0x3d59e9['id']}})['then'](function(){return _0xf3ffef;});})[_0x5813('0x26')](function(){_0x183f7d[_0x5813('0x1e')](0xcc)[_0x5813('0x1d')]();});}};}function handleEntityNotFound(_0x4c9385,_0x2051e9){return function(_0x51163f){if(!_0x51163f){_0x4c9385['sendStatus'](0x194);}return _0x51163f;};}function handleError(_0x4a94ca,_0x3ab943){_0x3ab943=_0x3ab943||0x1f4;return function(_0x17acb5){logger['error'](_0x17acb5['stack']);if(_0x17acb5[_0x5813('0x2b')]){delete _0x17acb5[_0x5813('0x2b')];}_0x4a94ca[_0x5813('0x1e')](_0x3ab943)[_0x5813('0x2c')](_0x17acb5);};}exports['index']=function(_0x520db4,_0x330661){var _0x3ecd07={},_0x18da7b={},_0x534b5c={'count':0x0,'rows':[]};var _0x2e6665=_[_0x5813('0x2d')](db[_0x5813('0x2e')]['rawAttributes'],function(_0x363275){return{'name':_0x363275[_0x5813('0x2f')],'type':_0x363275[_0x5813('0x30')]['key']};});_0x18da7b[_0x5813('0x31')]=_[_0x5813('0x2d')](_0x2e6665,_0x5813('0x2b'));_0x18da7b[_0x5813('0x32')]=_[_0x5813('0x33')](_0x520db4[_0x5813('0x32')]);_0x18da7b[_0x5813('0x34')]=_['intersection'](_0x18da7b[_0x5813('0x31')],_0x18da7b[_0x5813('0x32')]);_0x3ecd07[_0x5813('0x35')]=_[_0x5813('0x36')](_0x18da7b[_0x5813('0x31')],qs['fields'](_0x520db4[_0x5813('0x32')][_0x5813('0x37')]));_0x3ecd07[_0x5813('0x35')]=_0x3ecd07[_0x5813('0x35')]['length']?_0x3ecd07['attributes']:_0x18da7b[_0x5813('0x31')];if(!_0x520db4[_0x5813('0x32')][_0x5813('0x38')](_0x5813('0x39'))){_0x3ecd07['limit']=qs[_0x5813('0x21')](_0x520db4['query'][_0x5813('0x21')]);_0x3ecd07[_0x5813('0x20')]=qs[_0x5813('0x20')](_0x520db4[_0x5813('0x32')][_0x5813('0x20')]);}_0x3ecd07[_0x5813('0x3a')]=qs[_0x5813('0x3b')](_0x520db4['query'][_0x5813('0x3b')]);_0x3ecd07[_0x5813('0x3c')]=qs['filters'](_[_0x5813('0x3d')](_0x520db4[_0x5813('0x32')],_0x18da7b[_0x5813('0x34')]),_0x2e6665);if(_0x520db4[_0x5813('0x32')][_0x5813('0x3e')]){_0x3ecd07[_0x5813('0x3c')]=_[_0x5813('0x3f')](_0x3ecd07['where'],{'$or':_[_0x5813('0x2d')](_0x2e6665,function(_0x2b946f){if(_0x2b946f[_0x5813('0x30')]!==_0x5813('0x40')){var _0x47a4e7={};_0x47a4e7[_0x2b946f[_0x5813('0x2b')]]={'$like':'%'+_0x520db4[_0x5813('0x32')][_0x5813('0x3e')]+'%'};return _0x47a4e7;}})});}_0x3ecd07=_['merge']({},_0x3ecd07,_0x520db4[_0x5813('0x41')]);var _0xcfe61a={'where':_0x3ecd07['where']};return db[_0x5813('0x2e')][_0x5813('0x42')](_0xcfe61a)[_0x5813('0x26')](function(_0x34787a){_0x534b5c[_0x5813('0x42')]=_0x34787a;if(_0x520db4[_0x5813('0x32')]['includeAll']){_0x3ecd07[_0x5813('0x43')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x3ecd07);})['then'](function(_0x58603a){_0x534b5c[_0x5813('0x44')]=_0x58603a;return _0x534b5c;})[_0x5813('0x26')](respondWithFilteredResult(_0x330661,_0x3ecd07))[_0x5813('0x45')](handleError(_0x330661,null));};exports[_0x5813('0x46')]=function(_0x542976,_0x4625c5){var _0x225687={'raw':![],'where':{'id':_0x542976['params']['id']}},_0x1745c3={};_0x1745c3[_0x5813('0x31')]=_[_0x5813('0x33')](db[_0x5813('0x2e')][_0x5813('0x47')]);_0x1745c3[_0x5813('0x32')]=_['keys'](_0x542976[_0x5813('0x32')]);_0x1745c3['filters']=_[_0x5813('0x36')](_0x1745c3[_0x5813('0x31')],_0x1745c3[_0x5813('0x32')]);_0x225687[_0x5813('0x35')]=_[_0x5813('0x36')](_0x1745c3['model'],qs[_0x5813('0x37')](_0x542976[_0x5813('0x32')][_0x5813('0x37')]));_0x225687['attributes']=_0x225687['attributes'][_0x5813('0x48')]?_0x225687['attributes']:_0x1745c3[_0x5813('0x31')];if(_0x542976[_0x5813('0x32')][_0x5813('0x49')]){_0x225687[_0x5813('0x43')]=[{'all':!![]}];}_0x225687=_['merge']({},_0x225687,_0x542976[_0x5813('0x41')]);return db[_0x5813('0x2e')]['find'](_0x225687)[_0x5813('0x26')](handleEntityNotFound(_0x4625c5,null))['then'](respondWithResult(_0x4625c5,null))[_0x5813('0x45')](handleError(_0x4625c5,null));};exports[_0x5813('0x4a')]=function(_0x493af1,_0x1099d9){return db[_0x5813('0x2e')][_0x5813('0x4a')](_0x493af1['body'],{})['then'](function(_0x3830ab){var _0x215b1a=_0x493af1[_0x5813('0x4b')][_0x5813('0x27')]({'plain':!![]});if(!_0x215b1a)throw new Error(_0x5813('0x4c'));if(_0x215b1a[_0x5813('0x4d')]==='user'){var _0x492e03=_0x3830ab['get']({'plain':!![]});var _0xc7baae=_0x5813('0x28');return db[_0x5813('0x4e')][_0x5813('0x4f')]({'where':{'name':_0xc7baae,'userProfileId':_0x215b1a[_0x5813('0x50')]},'raw':!![]})[_0x5813('0x26')](function(_0x13a68d){if(_0x13a68d&&_0x13a68d[_0x5813('0x51')]===0x0){return db[_0x5813('0x29')][_0x5813('0x4a')]({'name':_0x492e03[_0x5813('0x2b')],'resourceId':_0x492e03['id'],'type':_0x13a68d[_0x5813('0x2b')],'sectionId':_0x13a68d['id']},{})[_0x5813('0x26')](function(){return _0x3830ab;});}else{return _0x3830ab;}})['catch'](function(_0x202390){logger['error'](_0x5813('0x52'),_0x202390);throw _0x202390;});}return _0x3830ab;})['then'](respondWithResult(_0x1099d9,0xc9))[_0x5813('0x45')](handleError(_0x1099d9,null));};exports[_0x5813('0x25')]=function(_0x4b3891,_0x408cdd){if(_0x4b3891[_0x5813('0x53')]['id']){delete _0x4b3891['body']['id'];}return db[_0x5813('0x2e')]['find']({'where':{'id':_0x4b3891[_0x5813('0x54')]['id']}})[_0x5813('0x26')](handleEntityNotFound(_0x408cdd,null))[_0x5813('0x26')](saveUpdates(_0x4b3891['body'],null))['then'](respondWithResult(_0x408cdd,null))[_0x5813('0x45')](handleError(_0x408cdd,null));};exports[_0x5813('0x2a')]=function(_0x586d9d,_0x5cbcf8){return db[_0x5813('0x2e')]['find']({'where':{'id':_0x586d9d[_0x5813('0x54')]['id']}})['then'](handleEntityNotFound(_0x5cbcf8,null))[_0x5813('0x26')](removeEntity(_0x5cbcf8,null))[_0x5813('0x45')](handleError(_0x5cbcf8,null));}; \ No newline at end of file +var _0x1b32=['end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','VoiceChanSpy','findAll','rows','show','params','includeAll','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','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/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1b32,0x85));var _0x21b3=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x1b32[_0x45b034];return _0x509cb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21b3('0x0'));var zipdir=require(_0x21b3('0x1'));var jsonpatch=require(_0x21b3('0x2'));var rp=require(_0x21b3('0x3'));var moment=require(_0x21b3('0x4'));var BPromise=require(_0x21b3('0x5'));var Mustache=require(_0x21b3('0x6'));var util=require(_0x21b3('0x7'));var path=require(_0x21b3('0x8'));var sox=require(_0x21b3('0x9'));var csv=require(_0x21b3('0xa'));var ejs=require(_0x21b3('0xb'));var fs=require('fs');var fs_extra=require(_0x21b3('0xc'));var _=require(_0x21b3('0xd'));var squel=require(_0x21b3('0xe'));var crypto=require('crypto');var jsforce=require(_0x21b3('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x21b3('0x10'));var Redis=require(_0x21b3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x21b3('0x12'));var hardwareService=require(_0x21b3('0x13'));var logger=require(_0x21b3('0x14'))('api');var utils=require(_0x21b3('0x15'));var config=require(_0x21b3('0x16'));var licenseUtil=require(_0x21b3('0x17'));var db=require(_0x21b3('0x18'))['db'];function respondWithStatusCode(_0x40cc5a,_0x2c7abb){_0x2c7abb=_0x2c7abb||0xcc;return function(_0x3bff49){if(_0x3bff49){return _0x40cc5a[_0x21b3('0x19')](_0x2c7abb);}return _0x40cc5a[_0x21b3('0x1a')](_0x2c7abb)['end']();};}function respondWithResult(_0xa537ad,_0x810f46){_0x810f46=_0x810f46||0xc8;return function(_0x43bede){if(_0x43bede){return _0xa537ad['status'](_0x810f46)[_0x21b3('0x1b')](_0x43bede);}};}function respondWithFilteredResult(_0x4c931d,_0x3f7b4a){return function(_0x579a37){if(_0x579a37){var _0x15662a=typeof _0x3f7b4a[_0x21b3('0x1c')]===_0x21b3('0x1d')&&typeof _0x3f7b4a[_0x21b3('0x1e')]==='undefined';var _0x3f7e7a=_0x579a37['count'];var _0x408c17=_0x15662a?0x0:_0x3f7b4a[_0x21b3('0x1c')];var _0xaf1eba=_0x15662a?_0x579a37[_0x21b3('0x1f')]:_0x3f7b4a['offset']+_0x3f7b4a[_0x21b3('0x1e')];var _0x1e31bb;if(_0xaf1eba>=_0x3f7e7a){_0xaf1eba=_0x3f7e7a;_0x1e31bb=0xc8;}else{_0x1e31bb=0xce;}_0x4c931d[_0x21b3('0x1a')](_0x1e31bb);return _0x4c931d['set'](_0x21b3('0x20'),_0x408c17+'-'+_0xaf1eba+'/'+_0x3f7e7a)[_0x21b3('0x1b')](_0x579a37);}return null;};}function patchUpdates(_0x2f996d){return function(_0x3fe141){try{jsonpatch[_0x21b3('0x21')](_0x3fe141,_0x2f996d,!![]);}catch(_0x1be234){return BPromise[_0x21b3('0x22')](_0x1be234);}return _0x3fe141['save']();};}function saveUpdates(_0xbb78f3,_0x54695b){return function(_0x139672){if(_0x139672){return _0x139672[_0x21b3('0x23')](_0xbb78f3)[_0x21b3('0x24')](function(_0x4fcb87){return _0x4fcb87;});}return null;};}function removeEntity(_0x19ba2c,_0x5bda6e){return function(_0x3ee234){if(_0x3ee234){return _0x3ee234[_0x21b3('0x25')]()[_0x21b3('0x24')](function(){var _0x4412f0=_0x3ee234[_0x21b3('0x26')]({'plain':!![]});var _0x2e3221='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x2e3221,'resourceId':_0x4412f0['id']}})[_0x21b3('0x24')](function(){return _0x3ee234;});})[_0x21b3('0x24')](function(){_0x19ba2c[_0x21b3('0x1a')](0xcc)[_0x21b3('0x27')]();});}};}function handleEntityNotFound(_0x18eba4,_0x58a356){return function(_0x170e78){if(!_0x170e78){_0x18eba4['sendStatus'](0x194);}return _0x170e78;};}function handleError(_0x16d012,_0x56063c){_0x56063c=_0x56063c||0x1f4;return function(_0x469e42){logger[_0x21b3('0x28')](_0x469e42[_0x21b3('0x29')]);if(_0x469e42['name']){delete _0x469e42[_0x21b3('0x2a')];}_0x16d012[_0x21b3('0x1a')](_0x56063c)[_0x21b3('0x2b')](_0x469e42);};}exports[_0x21b3('0x2c')]=function(_0x34663e,_0x210c49){var _0x2cc056={},_0x4bbec2={},_0x5c3f6f={'count':0x0,'rows':[]};var _0x2053d4=_[_0x21b3('0x2d')](db['VoiceChanSpy'][_0x21b3('0x2e')],function(_0xa04ac7){return{'name':_0xa04ac7[_0x21b3('0x2f')],'type':_0xa04ac7[_0x21b3('0x30')][_0x21b3('0x31')]};});_0x4bbec2[_0x21b3('0x32')]=_[_0x21b3('0x2d')](_0x2053d4,_0x21b3('0x2a'));_0x4bbec2[_0x21b3('0x33')]=_['keys'](_0x34663e['query']);_0x4bbec2[_0x21b3('0x34')]=_['intersection'](_0x4bbec2[_0x21b3('0x32')],_0x4bbec2[_0x21b3('0x33')]);_0x2cc056['attributes']=_[_0x21b3('0x35')](_0x4bbec2[_0x21b3('0x32')],qs[_0x21b3('0x36')](_0x34663e[_0x21b3('0x33')]['fields']));_0x2cc056[_0x21b3('0x37')]=_0x2cc056[_0x21b3('0x37')][_0x21b3('0x38')]?_0x2cc056[_0x21b3('0x37')]:_0x4bbec2['model'];if(!_0x34663e[_0x21b3('0x33')]['hasOwnProperty'](_0x21b3('0x39'))){_0x2cc056[_0x21b3('0x1e')]=qs[_0x21b3('0x1e')](_0x34663e[_0x21b3('0x33')][_0x21b3('0x1e')]);_0x2cc056[_0x21b3('0x1c')]=qs[_0x21b3('0x1c')](_0x34663e['query']['offset']);}_0x2cc056[_0x21b3('0x3a')]=qs[_0x21b3('0x3b')](_0x34663e[_0x21b3('0x33')][_0x21b3('0x3b')]);_0x2cc056['where']=qs[_0x21b3('0x34')](_[_0x21b3('0x3c')](_0x34663e[_0x21b3('0x33')],_0x4bbec2[_0x21b3('0x34')]),_0x2053d4);if(_0x34663e[_0x21b3('0x33')][_0x21b3('0x3d')]){_0x2cc056[_0x21b3('0x3e')]=_[_0x21b3('0x3f')](_0x2cc056[_0x21b3('0x3e')],{'$or':_[_0x21b3('0x2d')](_0x2053d4,function(_0x36dd10){if(_0x36dd10['type']!==_0x21b3('0x40')){var _0x321050={};_0x321050[_0x36dd10['name']]={'$like':'%'+_0x34663e[_0x21b3('0x33')]['filter']+'%'};return _0x321050;}})});}_0x2cc056=_[_0x21b3('0x3f')]({},_0x2cc056,_0x34663e[_0x21b3('0x41')]);var _0x483f0c={'where':_0x2cc056['where']};return db['VoiceChanSpy'][_0x21b3('0x1f')](_0x483f0c)[_0x21b3('0x24')](function(_0x3e6501){_0x5c3f6f[_0x21b3('0x1f')]=_0x3e6501;if(_0x34663e['query']['includeAll']){_0x2cc056[_0x21b3('0x42')]=[{'all':!![]}];}return db[_0x21b3('0x43')][_0x21b3('0x44')](_0x2cc056);})[_0x21b3('0x24')](function(_0x306bf2){_0x5c3f6f[_0x21b3('0x45')]=_0x306bf2;return _0x5c3f6f;})[_0x21b3('0x24')](respondWithFilteredResult(_0x210c49,_0x2cc056))['catch'](handleError(_0x210c49,null));};exports[_0x21b3('0x46')]=function(_0x44cf7d,_0x164de9){var _0x282b05={'raw':![],'where':{'id':_0x44cf7d[_0x21b3('0x47')]['id']}},_0x119b43={};_0x119b43['model']=_['keys'](db[_0x21b3('0x43')][_0x21b3('0x2e')]);_0x119b43[_0x21b3('0x33')]=_['keys'](_0x44cf7d[_0x21b3('0x33')]);_0x119b43[_0x21b3('0x34')]=_[_0x21b3('0x35')](_0x119b43[_0x21b3('0x32')],_0x119b43[_0x21b3('0x33')]);_0x282b05[_0x21b3('0x37')]=_['intersection'](_0x119b43[_0x21b3('0x32')],qs[_0x21b3('0x36')](_0x44cf7d[_0x21b3('0x33')]['fields']));_0x282b05['attributes']=_0x282b05['attributes'][_0x21b3('0x38')]?_0x282b05[_0x21b3('0x37')]:_0x119b43[_0x21b3('0x32')];if(_0x44cf7d[_0x21b3('0x33')][_0x21b3('0x48')]){_0x282b05[_0x21b3('0x42')]=[{'all':!![]}];}_0x282b05=_[_0x21b3('0x3f')]({},_0x282b05,_0x44cf7d[_0x21b3('0x41')]);return db[_0x21b3('0x43')]['find'](_0x282b05)['then'](handleEntityNotFound(_0x164de9,null))['then'](respondWithResult(_0x164de9,null))[_0x21b3('0x49')](handleError(_0x164de9,null));};exports[_0x21b3('0x4a')]=function(_0x4046cd,_0x2e4add){return db[_0x21b3('0x43')][_0x21b3('0x4a')](_0x4046cd[_0x21b3('0x4b')],{})[_0x21b3('0x24')](function(_0x3590b0){var _0x46c106=_0x4046cd['user'][_0x21b3('0x26')]({'plain':!![]});if(!_0x46c106)throw new Error(_0x21b3('0x4c'));if(_0x46c106[_0x21b3('0x4d')]===_0x21b3('0x4e')){var _0x34509e=_0x3590b0[_0x21b3('0x26')]({'plain':!![]});var _0xf10700=_0x21b3('0x4f');return db[_0x21b3('0x50')]['find']({'where':{'name':_0xf10700,'userProfileId':_0x46c106[_0x21b3('0x51')]},'raw':!![]})[_0x21b3('0x24')](function(_0x3cfd1e){if(_0x3cfd1e&&_0x3cfd1e[_0x21b3('0x52')]===0x0){return db[_0x21b3('0x53')]['create']({'name':_0x34509e['name'],'resourceId':_0x34509e['id'],'type':_0x3cfd1e[_0x21b3('0x2a')],'sectionId':_0x3cfd1e['id']},{})[_0x21b3('0x24')](function(){return _0x3590b0;});}else{return _0x3590b0;}})[_0x21b3('0x49')](function(_0x1be6d3){logger[_0x21b3('0x28')](_0x21b3('0x54'),_0x1be6d3);throw _0x1be6d3;});}return _0x3590b0;})['then'](respondWithResult(_0x2e4add,0xc9))['catch'](handleError(_0x2e4add,null));};exports[_0x21b3('0x23')]=function(_0xc28070,_0x45eb49){if(_0xc28070[_0x21b3('0x4b')]['id']){delete _0xc28070['body']['id'];}return db[_0x21b3('0x43')]['find']({'where':{'id':_0xc28070[_0x21b3('0x47')]['id']}})[_0x21b3('0x24')](handleEntityNotFound(_0x45eb49,null))['then'](saveUpdates(_0xc28070['body'],null))[_0x21b3('0x24')](respondWithResult(_0x45eb49,null))[_0x21b3('0x49')](handleError(_0x45eb49,null));};exports[_0x21b3('0x25')]=function(_0xd3eb29,_0xc612b5){return db[_0x21b3('0x43')][_0x21b3('0x55')]({'where':{'id':_0xd3eb29['params']['id']}})[_0x21b3('0x24')](handleEntityNotFound(_0xc612b5,null))[_0x21b3('0x24')](removeEntity(_0xc612b5,null))[_0x21b3('0x49')](handleError(_0xc612b5,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 31eea87..ae4aa4d 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 _0x474f=['CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','agent','then','catch','models','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','Set'];(function(_0x38999,_0x51d5ee){var _0x593758=function(_0x407644){while(--_0x407644){_0x38999['push'](_0x38999['shift']());}};_0x593758(++_0x51d5ee);}(_0x474f,0x11d));var _0xf474=function(_0xe7a30e,_0x466910){_0xe7a30e=_0xe7a30e-0x0;var _0x16b553=_0x474f[_0xe7a30e];return _0x16b553;};'use strict';var _=require(_0xf474('0x0'));var util=require('util');var BPromise=require(_0xf474('0x1'));var attributes=require(_0xf474('0x2'));var getUserApplications=function(_0x39ce7f,_0x283334,_0x2ca35b){var _0x5ccf88=0x1;var _0x7b9683=[];var _0xf96a82={'context':_0x283334[_0xf474('0x3')]||'from-sip','exten':util[_0xf474('0x4')](_0xf474('0x5'),_0x39ce7f[_0xf474('0x6')],_0x2ca35b),'type':_0xf474('0x7'),'isApp':![],'ChanSpyId':_0x39ce7f['id'],'UserId':_0x283334['id']};_0x7b9683[_0xf474('0x8')](_[_0xf474('0x9')]({'app':_0xf474('0xa'),'appdata':util[_0xf474('0x4')](_0xf474('0xb'),'chanspy'),'priority':_0x5ccf88++},_0xf96a82));if(_0x39ce7f[_0xf474('0xc')]){_0x7b9683['push'](_[_0xf474('0x9')]({'app':_0xf474('0xd'),'appdata':util[_0xf474('0x4')](_0xf474('0xe'),_0x39ce7f[_0xf474('0xf')]),'priority':_0x5ccf88++},_0xf96a82));}if(_0x39ce7f[_0xf474('0x10')]){_0x7b9683[_0xf474('0x8')](_[_0xf474('0x9')]({'app':_0xf474('0x11'),'appdata':_0x39ce7f[_0xf474('0x12')],'priority':_0x5ccf88++},_0xf96a82));}_0x7b9683[_0xf474('0x8')](_[_0xf474('0x9')]({'app':_0xf474('0x13'),'appdata':util[_0xf474('0x4')](_0xf474('0x14'),_0x283334[_0xf474('0x15')],_0x39ce7f[_0xf474('0x16')]?_0x39ce7f[_0xf474('0x16')][_0xf474('0x17')](''):''),'priority':_0x5ccf88++},_0xf96a82));if(_0x39ce7f[_0xf474('0xc')]){_0x7b9683['push'](_[_0xf474('0x9')]({'app':'StopMixMonitor','priority':_0x5ccf88++},_0xf96a82));}return _0x7b9683;};var getChanSpyApplications=function(_0x18a65c,_0x31f129){var _0x3b6db3=[];for(var _0x59e73f=0x0,_0x3033f5=0x1;_0x59e73f<_0x31f129[_0xf474('0x18')];_0x59e73f++,_0x3033f5=0x1){_0x3b6db3=_0x3b6db3[_0xf474('0x19')](getUserApplications(_0x18a65c,_0x31f129[_0x59e73f],_0x31f129[_0x59e73f]['internal']));if(_0x31f129[_0x59e73f][_0xf474('0x1a')]!=_0x31f129[_0x59e73f][_0xf474('0x15')]){_0x3b6db3=_0x3b6db3[_0xf474('0x19')](getUserApplications(_0x18a65c,_0x31f129[_0x59e73f],_0x31f129[_0x59e73f]['name']));}}return _0x3b6db3;};var getChanSpyPromise=function(_0x3f0237,_0x4b32f5){return new BPromise(function(_0x59faaf,_0x283bae){return _0x3f0237[_0xf474('0x1b')][_0xf474('0x1c')]({'attributes':['id',_0xf474('0x15'),_0xf474('0x1a')],'where':{'role':_0xf474('0x1d'),'chanspy':!![]},'raw':!![]})[_0xf474('0x1e')](function(_0xd5393){if(_0xd5393){return _0x59faaf(getChanSpyApplications(_0x4b32f5,_0xd5393));}return _0x59faaf([]);})[_0xf474('0x1f')](function(_0x1f6de1){_0x283bae(_0x1f6de1);});});};module['exports']=function(_0x2af8e7,_0x46244d){var _0x41dbb0=_0x2af8e7[_0xf474('0x20')];return _0x2af8e7['define']('VoiceChanSpy',attributes,{'tableName':_0xf474('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x228815,_0x187f5d,_0x272f42){return getChanSpyPromise(_0x41dbb0,_0x228815)['then'](function(_0xe967c6){if(_0xe967c6&&_0xe967c6[_0xf474('0x18')]){return _0x41dbb0[_0xf474('0x22')][_0xf474('0x23')](_0xe967c6);}})['then'](function(){_0x272f42();})[_0xf474('0x1f')](function(_0x5473f9){_0x272f42(_0x5473f9);});},'afterUpdate':function(_0x57f3d6,_0x22a566,_0x40edc5){return _0x41dbb0[_0xf474('0x22')][_0xf474('0x24')]({'where':{'ChanSpyId':_0x57f3d6['id']}})[_0xf474('0x1e')](function(){return getChanSpyPromise(_0x41dbb0,_0x57f3d6);})['then'](function(_0x42b84d){if(_0x42b84d&&_0x42b84d[_0xf474('0x18')]){return _0x41dbb0[_0xf474('0x22')][_0xf474('0x23')](_0x42b84d);}})[_0xf474('0x1e')](function(){_0x40edc5();})['catch'](function(_0x51ace0){_0x40edc5(_0x51ace0);});},'afterDestroy':function(_0x1986a7,_0x2a9c8d,_0x2bfeac){return _0x41dbb0[_0xf474('0x22')]['destroy']({'where':{'ChanSpyId':_0x1986a7['id']}})['then'](function(){_0x2bfeac();})[_0xf474('0x1f')](function(_0x412c1e){_0x2bfeac(_0x412c1e);});}}});}; \ No newline at end of file +var _0x3ebb=['merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','format','${UNIQUEID}.%s,a','recordingFormat','push','password','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','length','internal','concat','User','findAll','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip'];(function(_0xad854b,_0x24fb5d){var _0x75c82d=function(_0x41964f){while(--_0x41964f){_0xad854b['push'](_0xad854b['shift']());}};_0x75c82d(++_0x24fb5d);}(_0x3ebb,0xf6));var _0xb3eb=function(_0x549168,_0x3fe73a){_0x549168=_0x549168-0x0;var _0x11ff7c=_0x3ebb[_0x549168];return _0x11ff7c;};'use strict';var _=require(_0xb3eb('0x0'));var util=require(_0xb3eb('0x1'));var BPromise=require(_0xb3eb('0x2'));var attributes=require(_0xb3eb('0x3'));var getUserApplications=function(_0x3dba37,_0x12a606,_0xc23d3a){var _0x535a52=0x1;var _0x396724=[];var _0x32328b={'context':_0x12a606[_0xb3eb('0x4')]||_0xb3eb('0x5'),'exten':util['format']('%s%s',_0x3dba37['prefix'],_0xc23d3a),'type':'system','isApp':![],'ChanSpyId':_0x3dba37['id'],'UserId':_0x12a606['id']};_0x396724['push'](_[_0xb3eb('0x6')]({'app':_0xb3eb('0x7'),'appdata':util['format'](_0xb3eb('0x8'),_0xb3eb('0x9')),'priority':_0x535a52++},_0x32328b));if(_0x3dba37[_0xb3eb('0xa')]){_0x396724['push'](_[_0xb3eb('0x6')]({'app':_0xb3eb('0xb'),'appdata':util[_0xb3eb('0xc')](_0xb3eb('0xd'),_0x3dba37[_0xb3eb('0xe')]),'priority':_0x535a52++},_0x32328b));}if(_0x3dba37['auth']){_0x396724[_0xb3eb('0xf')](_[_0xb3eb('0x6')]({'app':'Authenticate','appdata':_0x3dba37[_0xb3eb('0x10')],'priority':_0x535a52++},_0x32328b));}_0x396724[_0xb3eb('0xf')](_[_0xb3eb('0x6')]({'app':_0xb3eb('0x11'),'appdata':util[_0xb3eb('0xc')](_0xb3eb('0x12'),_0x12a606[_0xb3eb('0x13')],_0x3dba37[_0xb3eb('0x14')]?_0x3dba37[_0xb3eb('0x14')]['join'](''):''),'priority':_0x535a52++},_0x32328b));if(_0x3dba37[_0xb3eb('0xa')]){_0x396724['push'](_[_0xb3eb('0x6')]({'app':_0xb3eb('0x15'),'priority':_0x535a52++},_0x32328b));}return _0x396724;};var getChanSpyApplications=function(_0xd1a709,_0xb52edf){var _0x379b5c=[];for(var _0x6083e7=0x0,_0x4a28cd=0x1;_0x6083e7<_0xb52edf[_0xb3eb('0x16')];_0x6083e7++,_0x4a28cd=0x1){_0x379b5c=_0x379b5c['concat'](getUserApplications(_0xd1a709,_0xb52edf[_0x6083e7],_0xb52edf[_0x6083e7][_0xb3eb('0x17')]));if(_0xb52edf[_0x6083e7][_0xb3eb('0x17')]!=_0xb52edf[_0x6083e7][_0xb3eb('0x13')]){_0x379b5c=_0x379b5c[_0xb3eb('0x18')](getUserApplications(_0xd1a709,_0xb52edf[_0x6083e7],_0xb52edf[_0x6083e7]['name']));}}return _0x379b5c;};var getChanSpyPromise=function(_0x88c701,_0x44ea50){return new BPromise(function(_0x5187b5,_0x2c2279){return _0x88c701[_0xb3eb('0x19')][_0xb3eb('0x1a')]({'attributes':['id',_0xb3eb('0x13'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0xb3eb('0x1b')](function(_0x1abe82){if(_0x1abe82){return _0x5187b5(getChanSpyApplications(_0x44ea50,_0x1abe82));}return _0x5187b5([]);})[_0xb3eb('0x1c')](function(_0x435aee){_0x2c2279(_0x435aee);});});};module['exports']=function(_0x2c8b44,_0x40c38f){var _0x208ee4=_0x2c8b44[_0xb3eb('0x1d')];return _0x2c8b44[_0xb3eb('0x1e')](_0xb3eb('0x1f'),attributes,{'tableName':_0xb3eb('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x59aded,_0x18c41f,_0x1f3d08){return getChanSpyPromise(_0x208ee4,_0x59aded)['then'](function(_0x321c58){if(_0x321c58&&_0x321c58['length']){return _0x208ee4[_0xb3eb('0x21')][_0xb3eb('0x22')](_0x321c58);}})[_0xb3eb('0x1b')](function(){_0x1f3d08();})['catch'](function(_0x1672b5){_0x1f3d08(_0x1672b5);});},'afterUpdate':function(_0x1245ac,_0x22d3e1,_0x294f45){return _0x208ee4[_0xb3eb('0x21')][_0xb3eb('0x23')]({'where':{'ChanSpyId':_0x1245ac['id']}})[_0xb3eb('0x1b')](function(){return getChanSpyPromise(_0x208ee4,_0x1245ac);})[_0xb3eb('0x1b')](function(_0x14600b){if(_0x14600b&&_0x14600b[_0xb3eb('0x16')]){return _0x208ee4[_0xb3eb('0x21')][_0xb3eb('0x22')](_0x14600b);}})[_0xb3eb('0x1b')](function(){_0x294f45();})['catch'](function(_0x38af4d){_0x294f45(_0x38af4d);});},'afterDestroy':function(_0x19e9c3,_0x4530bc,_0x4f3deb){return _0x208ee4[_0xb3eb('0x21')]['destroy']({'where':{'ChanSpyId':_0x19e9c3['id']}})[_0xb3eb('0x1b')](function(){_0x4f3deb();})[_0xb3eb('0x1c')](function(_0x22eaf8){_0x4f3deb(_0x22eaf8);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 843ed79..6c0b4bf 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 _0x13f6=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','lodash','util'];(function(_0x14a62c,_0x5c77e1){var _0x5bab14=function(_0xa6dc35){while(--_0xa6dc35){_0x14a62c['push'](_0x14a62c['shift']());}};_0x5bab14(++_0x5c77e1);}(_0x13f6,0x124));var _0x613f=function(_0x151f09,_0x45c6af){_0x151f09=_0x151f09-0x0;var _0x1bb92e=_0x13f6[_0x151f09];return _0x1bb92e;};'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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\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')]('VoiceChanSpy,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});} \ No newline at end of file +var _0x579c=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x32d04d,_0x33b2ef){var _0x2152ca=function(_0x3ee3b2){while(--_0x3ee3b2){_0x32d04d['push'](_0x32d04d['shift']());}};_0x2152ca(++_0x33b2ef);}(_0x579c,0xda));var _0xc579=function(_0x461294,_0x4cb967){_0x461294=_0x461294-0x0;var _0x2d6110=_0x579c[_0x461294];return _0x2d6110;};'use strict';var _=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var moment=require(_0xc579('0x2'));var BPromise=require(_0xc579('0x3'));var rs=require(_0xc579('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc579('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc579('0x6'))(_0xc579('0x7'));var config=require(_0xc579('0x8'));var jayson=require(_0xc579('0x9'));var client=jayson[_0xc579('0xa')][_0xc579('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e451b,_0x585167,_0x1c6d9c){return new BPromise(function(_0x293c4a,_0x2ce949){return client[_0xc579('0xc')](_0x2e451b,_0x1c6d9c)[_0xc579('0xd')](function(_0x44b151){logger[_0xc579('0xe')](_0xc579('0xf'),_0x585167,'request\x20sent');logger[_0xc579('0x10')](_0xc579('0x11'),_0x585167,_0xc579('0x12'),JSON[_0xc579('0x13')](_0x44b151));if(_0x44b151[_0xc579('0x14')]){if(_0x44b151[_0xc579('0x14')][_0xc579('0x15')]===0x1f4){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x44b151[_0xc579('0x14')][_0xc579('0x16')]);return _0x2ce949(_0x44b151['error'][_0xc579('0x16')]);}logger['error'](_0xc579('0xf'),_0x585167,_0x44b151['error'][_0xc579('0x16')]);return _0x293c4a(_0x44b151['error'][_0xc579('0x16')]);}else{logger['info'](_0xc579('0xf'),_0x585167,_0xc579('0x12'));_0x293c4a(_0x44b151['result']['message']);}})[_0xc579('0x17')](function(_0x2abc55){logger[_0xc579('0x14')](_0xc579('0xf'),_0x585167,_0x2abc55);_0x2ce949(_0x2abc55);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index d989f12..b68c2ef 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 _0x8180=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util'];(function(_0x5d8a70,_0x5d6228){var _0x4c56a5=function(_0x3ecca7){while(--_0x3ecca7){_0x5d8a70['push'](_0x5d8a70['shift']());}};_0x4c56a5(++_0x5d6228);}(_0x8180,0xb2));var _0x0818=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x8180[_0x35885a];return _0xe86249;};'use strict';var multer=require(_0x0818('0x0'));var util=require(_0x0818('0x1'));var path=require(_0x0818('0x2'));var timeout=require(_0x0818('0x3'));var express=require('express');var router=express[_0x0818('0x4')]();var fs_extra=require(_0x0818('0x5'));var auth=require(_0x0818('0x6'));var interaction=require(_0x0818('0x7'));var config=require(_0x0818('0x8'));var controller=require(_0x0818('0x9'));router[_0x0818('0xa')]('/',auth[_0x0818('0xb')](),controller[_0x0818('0xc')]);router[_0x0818('0xa')](_0x0818('0xd'),auth[_0x0818('0xb')](),controller['show']);router[_0x0818('0xe')]('/',auth[_0x0818('0xb')](),controller['create']);router[_0x0818('0xf')](_0x0818('0xd'),auth[_0x0818('0xb')](),controller[_0x0818('0x10')]);router[_0x0818('0x11')]('/:id',auth[_0x0818('0xb')](),controller[_0x0818('0x12')]);module[_0x0818('0x13')]=router; \ No newline at end of file +var _0x1ea9=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0xa2b52b,_0x3544e6){var _0x2b6f71=function(_0x49f3e4){while(--_0x49f3e4){_0xa2b52b['push'](_0xa2b52b['shift']());}};_0x2b6f71(++_0x3544e6);}(_0x1ea9,0x192));var _0x91ea=function(_0x4a2183,_0x53e74d){_0x4a2183=_0x4a2183-0x0;var _0xc7c01d=_0x1ea9[_0x4a2183];return _0xc7c01d;};'use strict';var multer=require('multer');var util=require(_0x91ea('0x0'));var path=require(_0x91ea('0x1'));var timeout=require(_0x91ea('0x2'));var express=require(_0x91ea('0x3'));var router=express[_0x91ea('0x4')]();var fs_extra=require(_0x91ea('0x5'));var auth=require(_0x91ea('0x6'));var interaction=require(_0x91ea('0x7'));var config=require(_0x91ea('0x8'));var controller=require(_0x91ea('0x9'));router[_0x91ea('0xa')]('/',auth[_0x91ea('0xb')](),controller['index']);router['get']('/:id',auth[_0x91ea('0xb')](),controller[_0x91ea('0xc')]);router[_0x91ea('0xd')]('/',auth[_0x91ea('0xb')](),controller[_0x91ea('0xe')]);router[_0x91ea('0xf')](_0x91ea('0x10'),auth[_0x91ea('0xb')](),controller[_0x91ea('0x11')]);router[_0x91ea('0x12')](_0x91ea('0x10'),auth['isAuthenticated'](),controller[_0x91ea('0x13')]);module[_0x91ea('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 6e0485b..e80ca82 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 _0x2a8d=['STRING','BOOLEAN','exports'];(function(_0x4a5195,_0x20603e){var _0x30908e=function(_0x3c57bf){while(--_0x3c57bf){_0x4a5195['push'](_0x4a5195['shift']());}};_0x30908e(++_0x20603e);}(_0x2a8d,0xce));var _0xd2a8=function(_0x3794a0,_0x1a9cfc){_0x3794a0=_0x3794a0-0x0;var _0x5bdaba=_0x2a8d[_0x3794a0];return _0x5bdaba;};'use strict';var Sequelize=require('sequelize');module[_0xd2a8('0x0')]={'name':{'type':Sequelize[_0xd2a8('0x1')],'unique':'name'},'description':{'type':Sequelize[_0xd2a8('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd2a8('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4c08=['STRING','name','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c08,0x1eb));var _0x84c0=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x4c08[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require(_0x84c0('0x0'));module['exports']={'name':{'type':Sequelize[_0x84c0('0x1')],'unique':_0x84c0('0x2')},'description':{'type':Sequelize[_0x84c0('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 65057f9..5fc5d5d 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 _0xde60=['index','map','fieldName','type','key','query','intersection','model','attributes','fields','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','params','keys','rawAttributes','length','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','Contexts','sendStatus','stack','name','send'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xde60,0xfb));var _0x0de6=function(_0x498396,_0x395c9a){_0x498396=_0x498396-0x0;var _0x1b0fbd=_0xde60[_0x498396];return _0x1b0fbd;};'use strict';var emlformat=require(_0x0de6('0x0'));var rimraf=require(_0x0de6('0x1'));var zipdir=require(_0x0de6('0x2'));var jsonpatch=require(_0x0de6('0x3'));var rp=require(_0x0de6('0x4'));var moment=require(_0x0de6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0de6('0x6'));var path=require('path');var sox=require(_0x0de6('0x7'));var csv=require('to-csv');var ejs=require(_0x0de6('0x8'));var fs=require('fs');var fs_extra=require(_0x0de6('0x9'));var _=require('lodash');var squel=require(_0x0de6('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0de6('0xb'));var toCsv=require(_0x0de6('0xc'));var querystring=require(_0x0de6('0xd'));var Papa=require(_0x0de6('0xe'));var Redis=require(_0x0de6('0xf'));var authService=require(_0x0de6('0x10'));var qs=require(_0x0de6('0x11'));var as=require(_0x0de6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0de6('0x13'))(_0x0de6('0x14'));var utils=require(_0x0de6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0de6('0x16'));var db=require(_0x0de6('0x17'))['db'];var jayson=require(_0x0de6('0x18'));var client=jayson[_0x0de6('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x243b21,_0x5ba1c6,_0x4bb40c,_0x2f52c6){return new BPromise(function(_0x5ea836,_0x224523){var _0x3cfcc7=_0x2f52c6||client;return _0x3cfcc7['request'](_0x243b21,_0x4bb40c)[_0x0de6('0x1a')](function(_0x41fb21){logger[_0x0de6('0x1b')](_0x0de6('0x1c'),_0x5ba1c6,_0x0de6('0x1d'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5ba1c6,_0x0de6('0x1d'),JSON[_0x0de6('0x1e')](_0x41fb21));if(_0x41fb21['error']){if(_0x41fb21[_0x0de6('0x1f')][_0x0de6('0x20')]===0x1f4){logger[_0x0de6('0x1f')](_0x0de6('0x1c'),_0x5ba1c6,_0x41fb21[_0x0de6('0x1f')][_0x0de6('0x21')]);return _0x224523(_0x41fb21[_0x0de6('0x1f')][_0x0de6('0x21')]);}logger[_0x0de6('0x1f')](_0x0de6('0x1c'),_0x5ba1c6,_0x41fb21[_0x0de6('0x1f')]['message']);return _0x5ea836(_0x41fb21[_0x0de6('0x1f')][_0x0de6('0x21')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x5ba1c6,_0x0de6('0x1d'));_0x5ea836(_0x41fb21[_0x0de6('0x22')][_0x0de6('0x21')]);}})[_0x0de6('0x23')](function(_0x45e6e9){logger[_0x0de6('0x1f')](_0x0de6('0x1c'),_0x5ba1c6,_0x45e6e9);_0x224523(_0x45e6e9);});});}function respondWithStatusCode(_0x38d19a,_0x2be26e){_0x2be26e=_0x2be26e||0xcc;return function(_0x14ac63){if(_0x14ac63){return _0x38d19a['sendStatus'](_0x2be26e);}return _0x38d19a[_0x0de6('0x24')](_0x2be26e)[_0x0de6('0x25')]();};}function respondWithResult(_0x79c631,_0x2c6b31){_0x2c6b31=_0x2c6b31||0xc8;return function(_0x229b0f){if(_0x229b0f){return _0x79c631[_0x0de6('0x24')](_0x2c6b31)[_0x0de6('0x26')](_0x229b0f);}};}function respondWithFilteredResult(_0x370fe8,_0x20287d){return function(_0x1a98dd){if(_0x1a98dd){var _0x13c13f=typeof _0x20287d[_0x0de6('0x27')]===_0x0de6('0x28')&&typeof _0x20287d[_0x0de6('0x29')]===_0x0de6('0x28');var _0x515300=_0x1a98dd[_0x0de6('0x2a')];var _0x330434=_0x13c13f?0x0:_0x20287d['offset'];var _0x5321b7=_0x13c13f?_0x1a98dd[_0x0de6('0x2a')]:_0x20287d['offset']+_0x20287d[_0x0de6('0x29')];var _0x126ff3;if(_0x5321b7>=_0x515300){_0x5321b7=_0x515300;_0x126ff3=0xc8;}else{_0x126ff3=0xce;}_0x370fe8[_0x0de6('0x24')](_0x126ff3);return _0x370fe8[_0x0de6('0x2b')](_0x0de6('0x2c'),_0x330434+'-'+_0x5321b7+'/'+_0x515300)[_0x0de6('0x26')](_0x1a98dd);}return null;};}function patchUpdates(_0x46d7e9){return function(_0x57d17d){try{jsonpatch[_0x0de6('0x2d')](_0x57d17d,_0x46d7e9,!![]);}catch(_0x331436){return BPromise[_0x0de6('0x2e')](_0x331436);}return _0x57d17d[_0x0de6('0x2f')]();};}function saveUpdates(_0x6a0512,_0x137822){return function(_0x53b893){if(_0x53b893){return _0x53b893[_0x0de6('0x30')](_0x6a0512)['then'](function(_0x4fc61c){return _0x4fc61c;});}return null;};}function removeEntity(_0x38800e,_0x54016a){return function(_0x25bf03){if(_0x25bf03){return _0x25bf03[_0x0de6('0x31')]()[_0x0de6('0x1a')](function(){var _0x77a6a=_0x25bf03['get']({'plain':!![]});var _0x721d3c=_0x0de6('0x32');return db['UserProfileResource']['destroy']({'where':{'type':_0x721d3c,'resourceId':_0x77a6a['id']}})[_0x0de6('0x1a')](function(){return _0x25bf03;});})['then'](function(){_0x38800e[_0x0de6('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c451c,_0x1c6d1f){return function(_0x563374){if(!_0x563374){_0x5c451c[_0x0de6('0x33')](0x194);}return _0x563374;};}function handleError(_0xc1e238,_0xd75060){_0xd75060=_0xd75060||0x1f4;return function(_0x5ace3e){logger[_0x0de6('0x1f')](_0x5ace3e[_0x0de6('0x34')]);if(_0x5ace3e[_0x0de6('0x35')]){delete _0x5ace3e[_0x0de6('0x35')];}_0xc1e238[_0x0de6('0x24')](_0xd75060)[_0x0de6('0x36')](_0x5ace3e);};}exports[_0x0de6('0x37')]=function(_0x5b9815,_0x1c9d78){var _0x22850b={},_0xf4219b={},_0x1c4ac9={'count':0x0,'rows':[]};var _0x5e76c5=_[_0x0de6('0x38')](db['VoiceContext']['rawAttributes'],function(_0x5d0f7b){return{'name':_0x5d0f7b[_0x0de6('0x39')],'type':_0x5d0f7b[_0x0de6('0x3a')][_0x0de6('0x3b')]};});_0xf4219b['model']=_['map'](_0x5e76c5,'name');_0xf4219b[_0x0de6('0x3c')]=_['keys'](_0x5b9815['query']);_0xf4219b['filters']=_[_0x0de6('0x3d')](_0xf4219b[_0x0de6('0x3e')],_0xf4219b[_0x0de6('0x3c')]);_0x22850b[_0x0de6('0x3f')]=_[_0x0de6('0x3d')](_0xf4219b[_0x0de6('0x3e')],qs[_0x0de6('0x40')](_0x5b9815[_0x0de6('0x3c')]['fields']));_0x22850b[_0x0de6('0x3f')]=_0x22850b[_0x0de6('0x3f')]['length']?_0x22850b[_0x0de6('0x3f')]:_0xf4219b[_0x0de6('0x3e')];if(!_0x5b9815[_0x0de6('0x3c')]['hasOwnProperty'](_0x0de6('0x41'))){_0x22850b[_0x0de6('0x29')]=qs[_0x0de6('0x29')](_0x5b9815[_0x0de6('0x3c')][_0x0de6('0x29')]);_0x22850b[_0x0de6('0x27')]=qs[_0x0de6('0x27')](_0x5b9815[_0x0de6('0x3c')][_0x0de6('0x27')]);}_0x22850b['order']=qs[_0x0de6('0x42')](_0x5b9815[_0x0de6('0x3c')][_0x0de6('0x42')]);_0x22850b[_0x0de6('0x43')]=qs[_0x0de6('0x44')](_['pick'](_0x5b9815[_0x0de6('0x3c')],_0xf4219b[_0x0de6('0x44')]),_0x5e76c5);if(_0x5b9815[_0x0de6('0x3c')][_0x0de6('0x45')]){_0x22850b[_0x0de6('0x43')]=_[_0x0de6('0x46')](_0x22850b['where'],{'$or':_[_0x0de6('0x38')](_0x5e76c5,function(_0x235758){if(_0x235758[_0x0de6('0x3a')]!==_0x0de6('0x47')){var _0x3f4390={};_0x3f4390[_0x235758[_0x0de6('0x35')]]={'$like':'%'+_0x5b9815[_0x0de6('0x3c')][_0x0de6('0x45')]+'%'};return _0x3f4390;}})});}_0x22850b=_['merge']({},_0x22850b,_0x5b9815[_0x0de6('0x48')]);var _0x1858c9={'where':_0x22850b[_0x0de6('0x43')]};return db[_0x0de6('0x49')][_0x0de6('0x2a')](_0x1858c9)['then'](function(_0x30e1c9){_0x1c4ac9[_0x0de6('0x2a')]=_0x30e1c9;if(_0x5b9815[_0x0de6('0x3c')][_0x0de6('0x4a')]){_0x22850b[_0x0de6('0x4b')]=[{'all':!![]}];}return db[_0x0de6('0x49')][_0x0de6('0x4c')](_0x22850b);})[_0x0de6('0x1a')](function(_0x1d904a){_0x1c4ac9[_0x0de6('0x4d')]=_0x1d904a;return _0x1c4ac9;})['then'](respondWithFilteredResult(_0x1c9d78,_0x22850b))['catch'](handleError(_0x1c9d78,null));};exports['show']=function(_0x2c9730,_0x48c6f7){var _0x5f0d65={'raw':![],'where':{'id':_0x2c9730[_0x0de6('0x4e')]['id']}},_0x118578={};_0x118578['model']=_[_0x0de6('0x4f')](db[_0x0de6('0x49')][_0x0de6('0x50')]);_0x118578[_0x0de6('0x3c')]=_[_0x0de6('0x4f')](_0x2c9730[_0x0de6('0x3c')]);_0x118578['filters']=_[_0x0de6('0x3d')](_0x118578[_0x0de6('0x3e')],_0x118578['query']);_0x5f0d65[_0x0de6('0x3f')]=_[_0x0de6('0x3d')](_0x118578[_0x0de6('0x3e')],qs['fields'](_0x2c9730['query'][_0x0de6('0x40')]));_0x5f0d65[_0x0de6('0x3f')]=_0x5f0d65[_0x0de6('0x3f')][_0x0de6('0x51')]?_0x5f0d65[_0x0de6('0x3f')]:_0x118578[_0x0de6('0x3e')];if(_0x2c9730[_0x0de6('0x3c')][_0x0de6('0x4a')]){_0x5f0d65[_0x0de6('0x4b')]=[{'all':!![]}];}_0x5f0d65=_[_0x0de6('0x46')]({},_0x5f0d65,_0x2c9730[_0x0de6('0x48')]);return db[_0x0de6('0x49')][_0x0de6('0x52')](_0x5f0d65)[_0x0de6('0x1a')](handleEntityNotFound(_0x48c6f7,null))[_0x0de6('0x1a')](respondWithResult(_0x48c6f7,null))[_0x0de6('0x23')](handleError(_0x48c6f7,null));};exports[_0x0de6('0x53')]=function(_0x3be986,_0x421ac7,_0x443719){var _0x1cc23c;return db['VoiceContext'][_0x0de6('0x53')](_0x3be986[_0x0de6('0x54')],{'raw':!![]})['then'](function(_0x34e602){_0x1cc23c=_0x34e602;return db[_0x0de6('0x49')][_0x0de6('0x4c')]({'raw':!![]});})[_0x0de6('0x1a')](function(_0x329fd6){var _0x13abd3=fs[_0x0de6('0x55')](path[_0x0de6('0x56')](config[_0x0de6('0x57')],_0x0de6('0x58')),_0x0de6('0x59'));var _0x20b43b=ejs[_0x0de6('0x5a')](_0x13abd3,{'contexts':_0x329fd6||[]});fs[_0x0de6('0x5b')](_0x0de6('0x5c'),_0x20b43b);})['then'](function(){return respondWithRpcPromise(_0x0de6('0x5d'),_0x0de6('0x53'),{'module':'chan_sip.so'});})[_0x0de6('0x1a')](function(){var _0x1930c4=_0x3be986[_0x0de6('0x5e')]['get']({'plain':!![]});if(!_0x1930c4)throw new Error(_0x0de6('0x5f'));if(_0x1930c4['role']===_0x0de6('0x5e')){var _0x26eeb4=_0x1cc23c[_0x0de6('0x60')]({'plain':!![]});return db[_0x0de6('0x61')]['find']({'where':{'name':_0x0de6('0x32'),'userProfileId':_0x1930c4[_0x0de6('0x62')]},'raw':!![]})[_0x0de6('0x1a')](function(_0x5af554){if(_0x5af554&&_0x5af554['autoAssociation']===0x0){return db[_0x0de6('0x63')]['create']({'name':_0x26eeb4[_0x0de6('0x35')],'resourceId':_0x26eeb4['id'],'type':_0x5af554[_0x0de6('0x35')],'sectionId':_0x5af554['id']},{})[_0x0de6('0x1a')](function(){return _0x1cc23c;});}else{return _0x1cc23c;}})['catch'](function(_0x5394e3){logger['error'](_0x0de6('0x64'),_0x5394e3);throw _0x5394e3;});}return _0x1cc23c;})[_0x0de6('0x1a')](respondWithResult(_0x421ac7,0xc9))[_0x0de6('0x23')](handleError(_0x421ac7,null));};exports[_0x0de6('0x30')]=function(_0x533428,_0x132336,_0x17dc35){var _0x2d5e5e;return db[_0x0de6('0x49')][_0x0de6('0x52')]({'where':{'id':_0x533428[_0x0de6('0x4e')]['id']}})[_0x0de6('0x1a')](handleEntityNotFound(_0x132336,null))[_0x0de6('0x1a')](saveUpdates(_0x533428['body'],null))[_0x0de6('0x1a')](function(_0x236c67){if(_0x236c67){_0x2d5e5e=_0x236c67;return db[_0x0de6('0x49')][_0x0de6('0x4c')]({'raw':!![]});}})['then'](function(_0x586142){var _0x162c8a=fs['readFileSync'](path[_0x0de6('0x56')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x9c4ab=ejs['render'](_0x162c8a,{'contexts':_0x586142||[]});fs[_0x0de6('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x9c4ab);})['then'](function(){return respondWithRpcPromise(_0x0de6('0x5d'),_0x0de6('0x30'),{'module':_0x0de6('0x65')});})[_0x0de6('0x1a')](function(){return _0x2d5e5e;})[_0x0de6('0x1a')](respondWithResult(_0x132336,null))['catch'](handleError(_0x132336,null));};exports[_0x0de6('0x31')]=function(_0x2d1bf8,_0x13399d,_0x298aa2){var _0x42310f;return db[_0x0de6('0x49')][_0x0de6('0x52')]({'where':{'id':_0x2d1bf8[_0x0de6('0x4e')]['id']}})[_0x0de6('0x1a')](handleEntityNotFound(_0x13399d,null))['then'](removeEntity(_0x13399d,null))['then'](function(){return db[_0x0de6('0x49')][_0x0de6('0x4c')]({'raw':!![]});})[_0x0de6('0x1a')](function(_0x372347){var _0x42519a=fs[_0x0de6('0x55')](path['join'](config[_0x0de6('0x57')],_0x0de6('0x58')),_0x0de6('0x59'));var _0x4a5b02=ejs[_0x0de6('0x5a')](_0x42519a,{'contexts':_0x372347});fs[_0x0de6('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4a5b02);return respondWithRpcPromise(_0x0de6('0x5d'),_0x0de6('0x31'),{'module':'chan_sip.so'});})[_0x0de6('0x23')](handleError(_0x13399d,null));}; \ No newline at end of file +var _0x240e=['sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','destroy','get','Contexts','stack','send','index','VoiceContext','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','name','options','includeAll','include','findAll','rows','params','rawAttributes','create','readFileSync','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','server/files/templates/context.ejs','utf8','Reload','chan_sip.so','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x240e,0x176));var _0xe240=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x240e[_0x34bf97];return _0x292719;};'use strict';var emlformat=require(_0xe240('0x0'));var rimraf=require(_0xe240('0x1'));var zipdir=require(_0xe240('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe240('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe240('0x4'));var util=require(_0xe240('0x5'));var path=require('path');var sox=require(_0xe240('0x6'));var csv=require(_0xe240('0x7'));var ejs=require(_0xe240('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe240('0x9'));var squel=require(_0xe240('0xa'));var crypto=require(_0xe240('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe240('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe240('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe240('0xe'));var qs=require(_0xe240('0xf'));var as=require(_0xe240('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe240('0x11'))(_0xe240('0x12'));var utils=require(_0xe240('0x13'));var config=require(_0xe240('0x14'));var licenseUtil=require(_0xe240('0x15'));var db=require(_0xe240('0x16'))['db'];var jayson=require(_0xe240('0x17'));var client=jayson[_0xe240('0x18')][_0xe240('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4bf755,_0x4d4de2,_0x2c9e94,_0x457fca){return new BPromise(function(_0x56180e,_0x8be3f7){var _0xc74173=_0x457fca||client;return _0xc74173[_0xe240('0x1a')](_0x4bf755,_0x2c9e94)[_0xe240('0x1b')](function(_0x4148f9){logger[_0xe240('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x4d4de2,'request\x20sent');logger[_0xe240('0x1d')](_0xe240('0x1e'),_0x4d4de2,_0xe240('0x1f'),JSON['stringify'](_0x4148f9));if(_0x4148f9[_0xe240('0x20')]){if(_0x4148f9[_0xe240('0x20')][_0xe240('0x21')]===0x1f4){logger['error'](_0xe240('0x22'),_0x4d4de2,_0x4148f9['error'][_0xe240('0x23')]);return _0x8be3f7(_0x4148f9[_0xe240('0x20')][_0xe240('0x23')]);}logger[_0xe240('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4d4de2,_0x4148f9[_0xe240('0x20')][_0xe240('0x23')]);return _0x56180e(_0x4148f9[_0xe240('0x20')][_0xe240('0x23')]);}else{logger[_0xe240('0x1c')](_0xe240('0x22'),_0x4d4de2,_0xe240('0x1f'));_0x56180e(_0x4148f9[_0xe240('0x24')]['message']);}})[_0xe240('0x25')](function(_0x397b46){logger[_0xe240('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4d4de2,_0x397b46);_0x8be3f7(_0x397b46);});});}function respondWithStatusCode(_0x4f095f,_0x7c223a){_0x7c223a=_0x7c223a||0xcc;return function(_0x489e27){if(_0x489e27){return _0x4f095f[_0xe240('0x26')](_0x7c223a);}return _0x4f095f['status'](_0x7c223a)[_0xe240('0x27')]();};}function respondWithResult(_0x1fa15e,_0x48415a){_0x48415a=_0x48415a||0xc8;return function(_0x2ef5f3){if(_0x2ef5f3){return _0x1fa15e[_0xe240('0x28')](_0x48415a)['json'](_0x2ef5f3);}};}function respondWithFilteredResult(_0x246a81,_0x44b661){return function(_0x5ba76b){if(_0x5ba76b){var _0x1d142b=typeof _0x44b661['offset']===_0xe240('0x29')&&typeof _0x44b661[_0xe240('0x2a')]===_0xe240('0x29');var _0x5a629b=_0x5ba76b[_0xe240('0x2b')];var _0x192615=_0x1d142b?0x0:_0x44b661['offset'];var _0x394886=_0x1d142b?_0x5ba76b[_0xe240('0x2b')]:_0x44b661[_0xe240('0x2c')]+_0x44b661[_0xe240('0x2a')];var _0x1bb4a7;if(_0x394886>=_0x5a629b){_0x394886=_0x5a629b;_0x1bb4a7=0xc8;}else{_0x1bb4a7=0xce;}_0x246a81[_0xe240('0x28')](_0x1bb4a7);return _0x246a81[_0xe240('0x2d')]('Content-Range',_0x192615+'-'+_0x394886+'/'+_0x5a629b)[_0xe240('0x2e')](_0x5ba76b);}return null;};}function patchUpdates(_0x2acdbc){return function(_0x48e498){try{jsonpatch[_0xe240('0x2f')](_0x48e498,_0x2acdbc,!![]);}catch(_0x9e992e){return BPromise[_0xe240('0x30')](_0x9e992e);}return _0x48e498[_0xe240('0x31')]();};}function saveUpdates(_0x1dafb9,_0x2e97df){return function(_0x4d99b2){if(_0x4d99b2){return _0x4d99b2[_0xe240('0x32')](_0x1dafb9)[_0xe240('0x1b')](function(_0xaa0d22){return _0xaa0d22;});}return null;};}function removeEntity(_0x3cc3c4,_0x342e25){return function(_0x531637){if(_0x531637){return _0x531637[_0xe240('0x33')]()['then'](function(){var _0x2257c1=_0x531637[_0xe240('0x34')]({'plain':!![]});var _0x552aed=_0xe240('0x35');return db['UserProfileResource'][_0xe240('0x33')]({'where':{'type':_0x552aed,'resourceId':_0x2257c1['id']}})[_0xe240('0x1b')](function(){return _0x531637;});})[_0xe240('0x1b')](function(){_0x3cc3c4[_0xe240('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18cecb,_0x1a3d9b){return function(_0x417897){if(!_0x417897){_0x18cecb[_0xe240('0x26')](0x194);}return _0x417897;};}function handleError(_0x2de64a,_0x5c7a0e){_0x5c7a0e=_0x5c7a0e||0x1f4;return function(_0x46b403){logger[_0xe240('0x20')](_0x46b403[_0xe240('0x36')]);if(_0x46b403['name']){delete _0x46b403['name'];}_0x2de64a[_0xe240('0x28')](_0x5c7a0e)[_0xe240('0x37')](_0x46b403);};}exports[_0xe240('0x38')]=function(_0x2e8ad8,_0x1f8556){var _0x2b38a1={},_0x3f443b={},_0x43fd6d={'count':0x0,'rows':[]};var _0xd0ee8b=_['map'](db[_0xe240('0x39')]['rawAttributes'],function(_0x208125){return{'name':_0x208125['fieldName'],'type':_0x208125['type'][_0xe240('0x3a')]};});_0x3f443b[_0xe240('0x3b')]=_[_0xe240('0x3c')](_0xd0ee8b,'name');_0x3f443b[_0xe240('0x3d')]=_[_0xe240('0x3e')](_0x2e8ad8[_0xe240('0x3d')]);_0x3f443b['filters']=_[_0xe240('0x3f')](_0x3f443b[_0xe240('0x3b')],_0x3f443b[_0xe240('0x3d')]);_0x2b38a1[_0xe240('0x40')]=_[_0xe240('0x3f')](_0x3f443b['model'],qs[_0xe240('0x41')](_0x2e8ad8[_0xe240('0x3d')][_0xe240('0x41')]));_0x2b38a1[_0xe240('0x40')]=_0x2b38a1[_0xe240('0x40')]['length']?_0x2b38a1[_0xe240('0x40')]:_0x3f443b['model'];if(!_0x2e8ad8['query'][_0xe240('0x42')](_0xe240('0x43'))){_0x2b38a1[_0xe240('0x2a')]=qs[_0xe240('0x2a')](_0x2e8ad8[_0xe240('0x3d')][_0xe240('0x2a')]);_0x2b38a1[_0xe240('0x2c')]=qs[_0xe240('0x2c')](_0x2e8ad8[_0xe240('0x3d')][_0xe240('0x2c')]);}_0x2b38a1[_0xe240('0x44')]=qs[_0xe240('0x45')](_0x2e8ad8['query'][_0xe240('0x45')]);_0x2b38a1[_0xe240('0x46')]=qs[_0xe240('0x47')](_['pick'](_0x2e8ad8[_0xe240('0x3d')],_0x3f443b[_0xe240('0x47')]),_0xd0ee8b);if(_0x2e8ad8[_0xe240('0x3d')][_0xe240('0x48')]){_0x2b38a1[_0xe240('0x46')]=_[_0xe240('0x49')](_0x2b38a1[_0xe240('0x46')],{'$or':_[_0xe240('0x3c')](_0xd0ee8b,function(_0x3db2b2){if(_0x3db2b2['type']!=='VIRTUAL'){var _0x486678={};_0x486678[_0x3db2b2[_0xe240('0x4a')]]={'$like':'%'+_0x2e8ad8[_0xe240('0x3d')][_0xe240('0x48')]+'%'};return _0x486678;}})});}_0x2b38a1=_[_0xe240('0x49')]({},_0x2b38a1,_0x2e8ad8[_0xe240('0x4b')]);var _0x19d6be={'where':_0x2b38a1[_0xe240('0x46')]};return db[_0xe240('0x39')][_0xe240('0x2b')](_0x19d6be)[_0xe240('0x1b')](function(_0x198c83){_0x43fd6d[_0xe240('0x2b')]=_0x198c83;if(_0x2e8ad8['query'][_0xe240('0x4c')]){_0x2b38a1[_0xe240('0x4d')]=[{'all':!![]}];}return db[_0xe240('0x39')][_0xe240('0x4e')](_0x2b38a1);})['then'](function(_0x5292b7){_0x43fd6d[_0xe240('0x4f')]=_0x5292b7;return _0x43fd6d;})['then'](respondWithFilteredResult(_0x1f8556,_0x2b38a1))[_0xe240('0x25')](handleError(_0x1f8556,null));};exports['show']=function(_0x1f7a71,_0x46db99){var _0x457e89={'raw':![],'where':{'id':_0x1f7a71[_0xe240('0x50')]['id']}},_0x84227a={};_0x84227a[_0xe240('0x3b')]=_[_0xe240('0x3e')](db[_0xe240('0x39')][_0xe240('0x51')]);_0x84227a['query']=_[_0xe240('0x3e')](_0x1f7a71['query']);_0x84227a['filters']=_[_0xe240('0x3f')](_0x84227a[_0xe240('0x3b')],_0x84227a[_0xe240('0x3d')]);_0x457e89[_0xe240('0x40')]=_[_0xe240('0x3f')](_0x84227a[_0xe240('0x3b')],qs[_0xe240('0x41')](_0x1f7a71[_0xe240('0x3d')][_0xe240('0x41')]));_0x457e89[_0xe240('0x40')]=_0x457e89[_0xe240('0x40')]['length']?_0x457e89[_0xe240('0x40')]:_0x84227a['model'];if(_0x1f7a71['query']['includeAll']){_0x457e89['include']=[{'all':!![]}];}_0x457e89=_[_0xe240('0x49')]({},_0x457e89,_0x1f7a71['options']);return db['VoiceContext']['find'](_0x457e89)[_0xe240('0x1b')](handleEntityNotFound(_0x46db99,null))[_0xe240('0x1b')](respondWithResult(_0x46db99,null))[_0xe240('0x25')](handleError(_0x46db99,null));};exports['create']=function(_0xa8eea5,_0x50bf9e,_0x42757e){var _0x1b061d;return db[_0xe240('0x39')][_0xe240('0x52')](_0xa8eea5['body'],{'raw':!![]})[_0xe240('0x1b')](function(_0x3473be){_0x1b061d=_0x3473be;return db['VoiceContext'][_0xe240('0x4e')]({'raw':!![]});})[_0xe240('0x1b')](function(_0x5928f8){var _0x4a9a4f=fs[_0xe240('0x53')](path['join'](config[_0xe240('0x54')],'server/files/templates/context.ejs'),'utf8');var _0x157ee1=ejs[_0xe240('0x55')](_0x4a9a4f,{'contexts':_0x5928f8||[]});fs[_0xe240('0x56')](_0xe240('0x57'),_0x157ee1);})[_0xe240('0x1b')](function(){return respondWithRpcPromise('Reload',_0xe240('0x52'),{'module':'chan_sip.so'});})[_0xe240('0x1b')](function(){var _0x3f4d59=_0xa8eea5['user'][_0xe240('0x34')]({'plain':!![]});if(!_0x3f4d59)throw new Error(_0xe240('0x58'));if(_0x3f4d59[_0xe240('0x59')]===_0xe240('0x5a')){var _0x32e074=_0x1b061d[_0xe240('0x34')]({'plain':!![]});return db[_0xe240('0x5b')][_0xe240('0x5c')]({'where':{'name':'Contexts','userProfileId':_0x3f4d59[_0xe240('0x5d')]},'raw':!![]})['then'](function(_0x1012fa){if(_0x1012fa&&_0x1012fa[_0xe240('0x5e')]===0x0){return db[_0xe240('0x5f')][_0xe240('0x52')]({'name':_0x32e074[_0xe240('0x4a')],'resourceId':_0x32e074['id'],'type':_0x1012fa[_0xe240('0x4a')],'sectionId':_0x1012fa['id']},{})[_0xe240('0x1b')](function(){return _0x1b061d;});}else{return _0x1b061d;}})[_0xe240('0x25')](function(_0x4cd3dd){logger['error'](_0xe240('0x60'),_0x4cd3dd);throw _0x4cd3dd;});}return _0x1b061d;})[_0xe240('0x1b')](respondWithResult(_0x50bf9e,0xc9))[_0xe240('0x25')](handleError(_0x50bf9e,null));};exports[_0xe240('0x32')]=function(_0x5c38f5,_0x59c04f,_0x16ce87){var _0x4d9aa1;return db[_0xe240('0x39')][_0xe240('0x5c')]({'where':{'id':_0x5c38f5['params']['id']}})[_0xe240('0x1b')](handleEntityNotFound(_0x59c04f,null))['then'](saveUpdates(_0x5c38f5[_0xe240('0x61')],null))[_0xe240('0x1b')](function(_0x27ed4c){if(_0x27ed4c){_0x4d9aa1=_0x27ed4c;return db[_0xe240('0x39')][_0xe240('0x4e')]({'raw':!![]});}})[_0xe240('0x1b')](function(_0x5a929a){var _0x3db546=fs[_0xe240('0x53')](path[_0xe240('0x62')](config[_0xe240('0x54')],_0xe240('0x63')),_0xe240('0x64'));var _0xa20c30=ejs[_0xe240('0x55')](_0x3db546,{'contexts':_0x5a929a||[]});fs[_0xe240('0x56')](_0xe240('0x57'),_0xa20c30);})[_0xe240('0x1b')](function(){return respondWithRpcPromise(_0xe240('0x65'),'update',{'module':_0xe240('0x66')});})['then'](function(){return _0x4d9aa1;})[_0xe240('0x1b')](respondWithResult(_0x59c04f,null))['catch'](handleError(_0x59c04f,null));};exports[_0xe240('0x33')]=function(_0x196fed,_0x2debb8,_0x17b0f1){var _0x291d4e;return db[_0xe240('0x39')]['find']({'where':{'id':_0x196fed[_0xe240('0x50')]['id']}})[_0xe240('0x1b')](handleEntityNotFound(_0x2debb8,null))[_0xe240('0x1b')](removeEntity(_0x2debb8,null))[_0xe240('0x1b')](function(){return db[_0xe240('0x39')]['findAll']({'raw':!![]});})[_0xe240('0x1b')](function(_0xe6b218){var _0x46206b=fs[_0xe240('0x53')](path[_0xe240('0x62')](config[_0xe240('0x54')],_0xe240('0x63')),_0xe240('0x64'));var _0x4a724e=ejs[_0xe240('0x55')](_0x46206b,{'contexts':_0xe6b218});fs[_0xe240('0x56')](_0xe240('0x57'),_0x4a724e);return respondWithRpcPromise('Reload','destroy',{'module':_0xe240('0x66')});})[_0xe240('0x25')](handleError(_0x2debb8,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7ac7d40..d6025d3 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 _0x2ade=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceContext.attributes','exports','define','voice_contexts'];(function(_0x5b340e,_0x1b289d){var _0x497e43=function(_0x5b766d){while(--_0x5b766d){_0x5b340e['push'](_0x5b340e['shift']());}};_0x497e43(++_0x1b289d);}(_0x2ade,0xb6));var _0xe2ad=function(_0x28b758,_0x4b519f){_0x28b758=_0x28b758-0x0;var _0x19b333=_0x2ade[_0x28b758];return _0x19b333;};'use strict';var _=require(_0xe2ad('0x0'));var util=require(_0xe2ad('0x1'));var logger=require(_0xe2ad('0x2'))(_0xe2ad('0x3'));var moment=require(_0xe2ad('0x4'));var BPromise=require(_0xe2ad('0x5'));var rp=require(_0xe2ad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2ad('0x7'));var config=require(_0xe2ad('0x8'));var attributes=require(_0xe2ad('0x9'));module[_0xe2ad('0xa')]=function(_0x100613,_0x49b6fe){return _0x100613[_0xe2ad('0xb')]('VoiceContext',attributes,{'tableName':_0xe2ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb666=['moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api'];(function(_0x1c6fce,_0x5ca9cf){var _0x1356b7=function(_0x13f26c){while(--_0x13f26c){_0x1c6fce['push'](_0x1c6fce['shift']());}};_0x1356b7(++_0x5ca9cf);}(_0xb666,0x1e6));var _0x6b66=function(_0x13b442,_0x448c33){_0x13b442=_0x13b442-0x0;var _0x49d09c=_0xb666[_0x13b442];return _0x49d09c;};'use strict';var _=require(_0x6b66('0x0'));var util=require(_0x6b66('0x1'));var logger=require(_0x6b66('0x2'))(_0x6b66('0x3'));var moment=require(_0x6b66('0x4'));var BPromise=require(_0x6b66('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b66('0x6'));var rimraf=require(_0x6b66('0x7'));var config=require(_0x6b66('0x8'));var attributes=require(_0x6b66('0x9'));module[_0x6b66('0xa')]=function(_0x1964fc,_0x2640e3){return _0x1964fc[_0x6b66('0xb')](_0x6b66('0xc'),attributes,{'tableName':_0x6b66('0xd'),'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 af49619..9721cc3 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 _0xfde3=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x47f7dd,_0x43c225){var _0x2c3739=function(_0x2cad75){while(--_0x2cad75){_0x47f7dd['push'](_0x47f7dd['shift']());}};_0x2c3739(++_0x43c225);}(_0xfde3,0x19f));var _0x3fde=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfde3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3fde('0x0'));var util=require(_0x3fde('0x1'));var moment=require(_0x3fde('0x2'));var BPromise=require(_0x3fde('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fde('0x4'));var db=require(_0x3fde('0x5'))['db'];var utils=require(_0x3fde('0x6'));var logger=require('../../config/logger')(_0x3fde('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3fde('0x8')][_0x3fde('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55ae50,_0x2100d7,_0x72051d){return new BPromise(function(_0x4e44d8,_0x199a48){return client[_0x3fde('0xa')](_0x55ae50,_0x72051d)[_0x3fde('0xb')](function(_0x950123){logger[_0x3fde('0xc')](_0x3fde('0xd'),_0x2100d7,_0x3fde('0xe'));logger[_0x3fde('0xf')](_0x3fde('0x10'),_0x2100d7,_0x3fde('0xe'),JSON[_0x3fde('0x11')](_0x950123));if(_0x950123[_0x3fde('0x12')]){if(_0x950123['error'][_0x3fde('0x13')]===0x1f4){logger['error'](_0x3fde('0xd'),_0x2100d7,_0x950123[_0x3fde('0x12')]['message']);return _0x199a48(_0x950123[_0x3fde('0x12')][_0x3fde('0x14')]);}logger[_0x3fde('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2100d7,_0x950123[_0x3fde('0x12')][_0x3fde('0x14')]);return _0x4e44d8(_0x950123[_0x3fde('0x12')][_0x3fde('0x14')]);}else{logger[_0x3fde('0xc')]('VoiceContext,\x20%s,\x20%s',_0x2100d7,_0x3fde('0xe'));_0x4e44d8(_0x950123[_0x3fde('0x15')][_0x3fde('0x14')]);}})[_0x3fde('0x16')](function(_0x4754f8){logger[_0x3fde('0x12')]('VoiceContext,\x20%s,\x20%s',_0x2100d7,_0x4754f8);_0x199a48(_0x4754f8);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x44c844,_0x1e3d7d){var _0x1d51b7=function(_0x575840){while(--_0x575840){_0x44c844['push'](_0x44c844['shift']());}};_0x1d51b7(++_0x1e3d7d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 9536e5d..dc23b9e 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 _0x5ebe=['isAuthenticated','index','/describe','show','create','put','update','delete','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceDialReport.controller','get'];(function(_0x35af27,_0x59cca0){var _0x42f239=function(_0x3eae07){while(--_0x3eae07){_0x35af27['push'](_0x35af27['shift']());}};_0x42f239(++_0x59cca0);}(_0x5ebe,0x69));var _0xe5eb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5ebe[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe5eb('0x0'));var path=require(_0xe5eb('0x1'));var timeout=require(_0xe5eb('0x2'));var express=require(_0xe5eb('0x3'));var router=express[_0xe5eb('0x4')]();var fs_extra=require(_0xe5eb('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5eb('0x6'));var controller=require(_0xe5eb('0x7'));router[_0xe5eb('0x8')]('/',auth[_0xe5eb('0x9')](),controller[_0xe5eb('0xa')]);router[_0xe5eb('0x8')](_0xe5eb('0xb'),auth[_0xe5eb('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe5eb('0xc')]);router['post']('/',auth[_0xe5eb('0x9')](),controller[_0xe5eb('0xd')]);router[_0xe5eb('0xe')]('/:id',auth[_0xe5eb('0x9')](),controller[_0xe5eb('0xf')]);router[_0xe5eb('0x10')](_0xe5eb('0x11'),auth[_0xe5eb('0x9')](),controller['destroy']);module[_0xe5eb('0x12')]=router; \ No newline at end of file +var _0xc1cb=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','index','get','isAuthenticated','describe','/:id','post','create','put','update','delete'];(function(_0x40b63b,_0x3a4e79){var _0x558501=function(_0x4e8158){while(--_0x4e8158){_0x40b63b['push'](_0x40b63b['shift']());}};_0x558501(++_0x3a4e79);}(_0xc1cb,0xac));var _0xbc1c=function(_0x3f5519,_0x40abda){_0x3f5519=_0x3f5519-0x0;var _0x25cdbe=_0xc1cb[_0x3f5519];return _0x25cdbe;};'use strict';var multer=require(_0xbc1c('0x0'));var util=require(_0xbc1c('0x1'));var path=require('path');var timeout=require(_0xbc1c('0x2'));var express=require('express');var router=express[_0xbc1c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbc1c('0x4'));var interaction=require(_0xbc1c('0x5'));var config=require(_0xbc1c('0x6'));var controller=require(_0xbc1c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbc1c('0x8')]);router[_0xbc1c('0x9')]('/describe',auth[_0xbc1c('0xa')](),controller[_0xbc1c('0xb')]);router['get'](_0xbc1c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xbc1c('0xd')]('/',auth[_0xbc1c('0xa')](),controller[_0xbc1c('0xe')]);router[_0xbc1c('0xf')](_0xbc1c('0xc'),auth[_0xbc1c('0xa')](),controller[_0xbc1c('0x10')]);router[_0xbc1c('0x11')](_0xbc1c('0xc'),auth[_0xbc1c('0xa')](),controller['destroy']);module[_0xbc1c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index f356c74..d0d3097 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 _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x4d2716,_0x11d867){var _0x3ea8a1=function(_0x17c27c){while(--_0x17c27c){_0x4d2716['push'](_0x4d2716['shift']());}};_0x3ea8a1(++_0x11d867);}(_0xe5b3,0x133));var _0x3e5b=function(_0x51fc20,_0x20453f){_0x51fc20=_0x51fc20-0x0;var _0x4d9798=_0xe5b3[_0x51fc20];return _0x4d9798;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x84ab=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x4aefc9,_0x27bfdc){var _0x1537a4=function(_0x3836a6){while(--_0x3836a6){_0x4aefc9['push'](_0x4aefc9['shift']());}};_0x1537a4(++_0x27bfdc);}(_0x84ab,0x12f));var _0xb84a=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x84ab[_0x38987f];return _0x4cb697;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'privilege':{'type':Sequelize[_0xb84a('0x2')]},'channel':{'type':Sequelize[_0xb84a('0x2')]},'channelstate':{'type':Sequelize[_0xb84a('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb84a('0x2')]},'calleridname':{'type':Sequelize[_0xb84a('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'language':{'type':Sequelize[_0xb84a('0x2')]},'accountcode':{'type':Sequelize[_0xb84a('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xb84a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb84a('0x2')]},'destchannelstate':{'type':Sequelize[_0xb84a('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb84a('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb84a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb84a('0x2')]},'destlanguage':{'type':Sequelize[_0xb84a('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb84a('0x3')]},'destuniqueid':{'type':Sequelize[_0xb84a('0x2')]},'destlinkedid':{'type':Sequelize[_0xb84a('0x2')]},'dialstring':{'type':Sequelize[_0xb84a('0x2')]},'dialstatus':{'type':Sequelize[_0xb84a('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb84a('0x4')]},'endtime':{'type':Sequelize[_0xb84a('0x4')]},'lastevent':{'type':Sequelize[_0xb84a('0x2')],'comment':_0xb84a('0x5')},'routeId':{'type':Sequelize[_0xb84a('0x3')]},'duration':{'type':Sequelize[_0xb84a('0x3')]},'holdtime':{'type':Sequelize[_0xb84a('0x3')]},'billableseconds':{'type':Sequelize[_0xb84a('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index a59938e..58ddccc 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 _0x8361=['ejs','fs-extra','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','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','name','send','VoiceDialReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','VIRTUAL','filter','options','include','findAll','rows','show','params','includeAll','catch','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv'];(function(_0x1bca18,_0x20fd49){var _0x185ee4=function(_0x4347a5){while(--_0x4347a5){_0x1bca18['push'](_0x1bca18['shift']());}};_0x185ee4(++_0x20fd49);}(_0x8361,0x166));var _0x1836=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x8361[_0x11005e];return _0x29338f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1836('0x0'));var zipdir=require(_0x1836('0x1'));var jsonpatch=require(_0x1836('0x2'));var rp=require(_0x1836('0x3'));var moment=require('moment');var BPromise=require(_0x1836('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1836('0x5'));var csv=require(_0x1836('0x6'));var ejs=require(_0x1836('0x7'));var fs=require('fs');var fs_extra=require(_0x1836('0x8'));var _=require('lodash');var squel=require(_0x1836('0x9'));var crypto=require('crypto');var jsforce=require(_0x1836('0xa'));var deskjs=require(_0x1836('0xb'));var toCsv=require(_0x1836('0x6'));var querystring=require(_0x1836('0xc'));var Papa=require(_0x1836('0xd'));var Redis=require(_0x1836('0xe'));var authService=require(_0x1836('0xf'));var qs=require(_0x1836('0x10'));var as=require(_0x1836('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1836('0x12'))('api');var utils=require(_0x1836('0x13'));var config=require(_0x1836('0x14'));var licenseUtil=require(_0x1836('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3edd18,_0x3ff9ea){_0x3ff9ea=_0x3ff9ea||0xcc;return function(_0x31b4f6){if(_0x31b4f6){return _0x3edd18['sendStatus'](_0x3ff9ea);}return _0x3edd18['status'](_0x3ff9ea)['end']();};}function respondWithResult(_0x3f04f6,_0x5d0c65){_0x5d0c65=_0x5d0c65||0xc8;return function(_0xe4f569){if(_0xe4f569){return _0x3f04f6[_0x1836('0x16')](_0x5d0c65)['json'](_0xe4f569);}};}function respondWithFilteredResult(_0x5a575c,_0x2273fd){return function(_0x7e2e09){if(_0x7e2e09){var _0x5b4273=typeof _0x2273fd[_0x1836('0x17')]===_0x1836('0x18')&&typeof _0x2273fd[_0x1836('0x19')]==='undefined';var _0x42f1a6=_0x7e2e09[_0x1836('0x1a')];var _0x30a7e1=_0x5b4273?0x0:_0x2273fd['offset'];var _0x3cb3f4=_0x5b4273?_0x7e2e09[_0x1836('0x1a')]:_0x2273fd['offset']+_0x2273fd[_0x1836('0x19')];var _0x4ca949;if(_0x3cb3f4>=_0x42f1a6){_0x3cb3f4=_0x42f1a6;_0x4ca949=0xc8;}else{_0x4ca949=0xce;}_0x5a575c[_0x1836('0x16')](_0x4ca949);return _0x5a575c[_0x1836('0x1b')](_0x1836('0x1c'),_0x30a7e1+'-'+_0x3cb3f4+'/'+_0x42f1a6)[_0x1836('0x1d')](_0x7e2e09);}return null;};}function patchUpdates(_0x47f260){return function(_0x386102){try{jsonpatch[_0x1836('0x1e')](_0x386102,_0x47f260,!![]);}catch(_0x169758){return BPromise[_0x1836('0x1f')](_0x169758);}return _0x386102[_0x1836('0x20')]();};}function saveUpdates(_0x241a70,_0x27660e){return function(_0x190ce1){if(_0x190ce1){return _0x190ce1['update'](_0x241a70)[_0x1836('0x21')](function(_0x42cd6a){return _0x42cd6a;});}return null;};}function removeEntity(_0x234229,_0x36c430){return function(_0x3899d4){if(_0x3899d4){return _0x3899d4[_0x1836('0x22')]()[_0x1836('0x21')](function(){_0x234229[_0x1836('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cded4,_0x18174e){return function(_0x5b6b22){if(!_0x5b6b22){_0x3cded4[_0x1836('0x23')](0x194);}return _0x5b6b22;};}function handleError(_0x4fc48d,_0x2e8a6b){_0x2e8a6b=_0x2e8a6b||0x1f4;return function(_0xc2896f){logger[_0x1836('0x24')](_0xc2896f['stack']);if(_0xc2896f[_0x1836('0x25')]){delete _0xc2896f[_0x1836('0x25')];}_0x4fc48d[_0x1836('0x16')](_0x2e8a6b)[_0x1836('0x26')](_0xc2896f);};}exports['index']=function(_0x3402f0,_0x3ef5ee){var _0x5d519e={},_0x114bc1={},_0x29a277={'count':0x0,'rows':[]};var _0x2176ce=_['map'](db[_0x1836('0x27')][_0x1836('0x28')],function(_0x11cbb2){return{'name':_0x11cbb2[_0x1836('0x29')],'type':_0x11cbb2['type'][_0x1836('0x2a')]};});_0x114bc1['model']=_[_0x1836('0x2b')](_0x2176ce,_0x1836('0x25'));_0x114bc1[_0x1836('0x2c')]=_[_0x1836('0x2d')](_0x3402f0['query']);_0x114bc1[_0x1836('0x2e')]=_[_0x1836('0x2f')](_0x114bc1[_0x1836('0x30')],_0x114bc1[_0x1836('0x2c')]);_0x5d519e[_0x1836('0x31')]=_[_0x1836('0x2f')](_0x114bc1[_0x1836('0x30')],qs[_0x1836('0x32')](_0x3402f0[_0x1836('0x2c')][_0x1836('0x32')]));_0x5d519e[_0x1836('0x31')]=_0x5d519e[_0x1836('0x31')][_0x1836('0x33')]?_0x5d519e[_0x1836('0x31')]:_0x114bc1[_0x1836('0x30')];if(!_0x3402f0[_0x1836('0x2c')][_0x1836('0x34')]('nolimit')){_0x5d519e[_0x1836('0x19')]=qs['limit'](_0x3402f0[_0x1836('0x2c')][_0x1836('0x19')]);_0x5d519e[_0x1836('0x17')]=qs[_0x1836('0x17')](_0x3402f0['query'][_0x1836('0x17')]);}_0x5d519e[_0x1836('0x35')]=qs[_0x1836('0x36')](_0x3402f0[_0x1836('0x2c')][_0x1836('0x36')]);_0x5d519e['where']=qs[_0x1836('0x2e')](_[_0x1836('0x37')](_0x3402f0[_0x1836('0x2c')],_0x114bc1[_0x1836('0x2e')]),_0x2176ce);if(_0x3402f0['query']['filter']){_0x5d519e['where']=_[_0x1836('0x38')](_0x5d519e[_0x1836('0x39')],{'$or':_['map'](_0x2176ce,function(_0x2e1776){if(_0x2e1776['type']!==_0x1836('0x3a')){var _0x4706b4={};_0x4706b4[_0x2e1776['name']]={'$like':'%'+_0x3402f0[_0x1836('0x2c')][_0x1836('0x3b')]+'%'};return _0x4706b4;}})});}_0x5d519e=_[_0x1836('0x38')]({},_0x5d519e,_0x3402f0[_0x1836('0x3c')]);var _0x2a0152={'where':_0x5d519e[_0x1836('0x39')]};return db[_0x1836('0x27')][_0x1836('0x1a')](_0x2a0152)['then'](function(_0x58b673){_0x29a277[_0x1836('0x1a')]=_0x58b673;if(_0x3402f0[_0x1836('0x2c')]['includeAll']){_0x5d519e[_0x1836('0x3d')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x1836('0x3e')](_0x5d519e);})[_0x1836('0x21')](function(_0x24ac9c){_0x29a277[_0x1836('0x3f')]=_0x24ac9c;return _0x29a277;})[_0x1836('0x21')](respondWithFilteredResult(_0x3ef5ee,_0x5d519e))['catch'](handleError(_0x3ef5ee,null));};exports[_0x1836('0x40')]=function(_0x1b9181,_0x378393){var _0x17155d={'raw':!![],'where':{'id':_0x1b9181[_0x1836('0x41')]['id']}},_0x37e007={};_0x37e007['model']=_[_0x1836('0x2d')](db[_0x1836('0x27')][_0x1836('0x28')]);_0x37e007[_0x1836('0x2c')]=_[_0x1836('0x2d')](_0x1b9181[_0x1836('0x2c')]);_0x37e007[_0x1836('0x2e')]=_['intersection'](_0x37e007[_0x1836('0x30')],_0x37e007['query']);_0x17155d[_0x1836('0x31')]=_[_0x1836('0x2f')](_0x37e007['model'],qs[_0x1836('0x32')](_0x1b9181[_0x1836('0x2c')][_0x1836('0x32')]));_0x17155d[_0x1836('0x31')]=_0x17155d[_0x1836('0x31')][_0x1836('0x33')]?_0x17155d['attributes']:_0x37e007['model'];if(_0x1b9181[_0x1836('0x2c')][_0x1836('0x42')]){_0x17155d[_0x1836('0x3d')]=[{'all':!![]}];}_0x17155d=_[_0x1836('0x38')]({},_0x17155d,_0x1b9181[_0x1836('0x3c')]);return db[_0x1836('0x27')]['find'](_0x17155d)['then'](handleEntityNotFound(_0x378393,null))[_0x1836('0x21')](respondWithResult(_0x378393,null))[_0x1836('0x43')](handleError(_0x378393,null));};exports[_0x1836('0x44')]=function(_0xac888d,_0x3f9f5f){return db[_0x1836('0x27')][_0x1836('0x44')](_0xac888d[_0x1836('0x45')],{})[_0x1836('0x21')](respondWithResult(_0x3f9f5f,0xc9))[_0x1836('0x43')](handleError(_0x3f9f5f,null));};exports[_0x1836('0x46')]=function(_0xd7beed,_0x529be9){if(_0xd7beed['body']['id']){delete _0xd7beed[_0x1836('0x45')]['id'];}return db[_0x1836('0x27')][_0x1836('0x47')]({'where':{'id':_0xd7beed[_0x1836('0x41')]['id']}})[_0x1836('0x21')](handleEntityNotFound(_0x529be9,null))[_0x1836('0x21')](saveUpdates(_0xd7beed['body'],null))[_0x1836('0x21')](respondWithResult(_0x529be9,null))[_0x1836('0x43')](handleError(_0x529be9,null));};exports[_0x1836('0x22')]=function(_0x33673c,_0x4a2128){return db[_0x1836('0x27')][_0x1836('0x47')]({'where':{'id':_0x33673c['params']['id']}})[_0x1836('0x21')](handleEntityNotFound(_0x4a2128,null))[_0x1836('0x21')](removeEntity(_0x4a2128,null))[_0x1836('0x43')](handleError(_0x4a2128,null));};exports[_0x1836('0x48')]=function(_0x4d8c27,_0x12582a){return db[_0x1836('0x27')][_0x1836('0x48')]()[_0x1836('0x21')](respondWithResult(_0x12582a,null))[_0x1836('0x43')](handleError(_0x12582a,null));}; \ No newline at end of file +var _0xd452=['order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4870e7,_0x4fcb94){var _0x39cbad=function(_0x2badb8){while(--_0x2badb8){_0x4870e7['push'](_0x4870e7['shift']());}};_0x39cbad(++_0x4fcb94);}(_0xd452,0xf6));var _0x2d45=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd452[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x2d45('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d45('0x1'));var jsonpatch=require(_0x2d45('0x2'));var rp=require(_0x2d45('0x3'));var moment=require(_0x2d45('0x4'));var BPromise=require(_0x2d45('0x5'));var Mustache=require(_0x2d45('0x6'));var util=require('util');var path=require(_0x2d45('0x7'));var sox=require(_0x2d45('0x8'));var csv=require(_0x2d45('0x9'));var ejs=require(_0x2d45('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d45('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2d45('0xc'));var deskjs=require(_0x2d45('0xd'));var toCsv=require(_0x2d45('0x9'));var querystring=require(_0x2d45('0xe'));var Papa=require(_0x2d45('0xf'));var Redis=require(_0x2d45('0x10'));var authService=require(_0x2d45('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2d45('0x12'));var hardwareService=require(_0x2d45('0x13'));var logger=require(_0x2d45('0x14'))(_0x2d45('0x15'));var utils=require(_0x2d45('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2d45('0x17'));var db=require(_0x2d45('0x18'))['db'];function respondWithStatusCode(_0x6f4e07,_0xfd4d8b){_0xfd4d8b=_0xfd4d8b||0xcc;return function(_0xb7a222){if(_0xb7a222){return _0x6f4e07[_0x2d45('0x19')](_0xfd4d8b);}return _0x6f4e07[_0x2d45('0x1a')](_0xfd4d8b)[_0x2d45('0x1b')]();};}function respondWithResult(_0x449190,_0x1723af){_0x1723af=_0x1723af||0xc8;return function(_0x33c6cc){if(_0x33c6cc){return _0x449190[_0x2d45('0x1a')](_0x1723af)['json'](_0x33c6cc);}};}function respondWithFilteredResult(_0xee41b0,_0x43fb4e){return function(_0x1c7553){if(_0x1c7553){var _0x5c97a5=typeof _0x43fb4e[_0x2d45('0x1c')]===_0x2d45('0x1d')&&typeof _0x43fb4e[_0x2d45('0x1e')]===_0x2d45('0x1d');var _0x57ad82=_0x1c7553[_0x2d45('0x1f')];var _0x554db6=_0x5c97a5?0x0:_0x43fb4e['offset'];var _0x14f2e9=_0x5c97a5?_0x1c7553[_0x2d45('0x1f')]:_0x43fb4e[_0x2d45('0x1c')]+_0x43fb4e[_0x2d45('0x1e')];var _0xe342fa;if(_0x14f2e9>=_0x57ad82){_0x14f2e9=_0x57ad82;_0xe342fa=0xc8;}else{_0xe342fa=0xce;}_0xee41b0[_0x2d45('0x1a')](_0xe342fa);return _0xee41b0[_0x2d45('0x20')](_0x2d45('0x21'),_0x554db6+'-'+_0x14f2e9+'/'+_0x57ad82)[_0x2d45('0x22')](_0x1c7553);}return null;};}function patchUpdates(_0x9412eb){return function(_0x384bf6){try{jsonpatch['apply'](_0x384bf6,_0x9412eb,!![]);}catch(_0x4457ab){return BPromise[_0x2d45('0x23')](_0x4457ab);}return _0x384bf6[_0x2d45('0x24')]();};}function saveUpdates(_0x241e5f,_0x20e0d5){return function(_0xc0d214){if(_0xc0d214){return _0xc0d214[_0x2d45('0x25')](_0x241e5f)['then'](function(_0x353714){return _0x353714;});}return null;};}function removeEntity(_0x5eb11c,_0x19555c){return function(_0x131c47){if(_0x131c47){return _0x131c47['destroy']()[_0x2d45('0x26')](function(){_0x5eb11c['status'](0xcc)[_0x2d45('0x1b')]();});}};}function handleEntityNotFound(_0x94446e,_0x165a81){return function(_0x58f898){if(!_0x58f898){_0x94446e[_0x2d45('0x19')](0x194);}return _0x58f898;};}function handleError(_0x3c124e,_0x120b40){_0x120b40=_0x120b40||0x1f4;return function(_0x525d82){logger['error'](_0x525d82[_0x2d45('0x27')]);if(_0x525d82[_0x2d45('0x28')]){delete _0x525d82[_0x2d45('0x28')];}_0x3c124e[_0x2d45('0x1a')](_0x120b40)[_0x2d45('0x29')](_0x525d82);};}exports[_0x2d45('0x2a')]=function(_0x132dbe,_0xd0cb23){var _0x9483da={},_0x36a597={},_0x5ad0e8={'count':0x0,'rows':[]};var _0x289449=_[_0x2d45('0x2b')](db[_0x2d45('0x2c')][_0x2d45('0x2d')],function(_0x34454a){return{'name':_0x34454a[_0x2d45('0x2e')],'type':_0x34454a['type'][_0x2d45('0x2f')]};});_0x36a597['model']=_[_0x2d45('0x2b')](_0x289449,_0x2d45('0x28'));_0x36a597[_0x2d45('0x30')]=_[_0x2d45('0x31')](_0x132dbe[_0x2d45('0x30')]);_0x36a597[_0x2d45('0x32')]=_[_0x2d45('0x33')](_0x36a597[_0x2d45('0x34')],_0x36a597['query']);_0x9483da[_0x2d45('0x35')]=_['intersection'](_0x36a597[_0x2d45('0x34')],qs['fields'](_0x132dbe['query'][_0x2d45('0x36')]));_0x9483da[_0x2d45('0x35')]=_0x9483da[_0x2d45('0x35')][_0x2d45('0x37')]?_0x9483da[_0x2d45('0x35')]:_0x36a597['model'];if(!_0x132dbe[_0x2d45('0x30')][_0x2d45('0x38')](_0x2d45('0x39'))){_0x9483da[_0x2d45('0x1e')]=qs['limit'](_0x132dbe[_0x2d45('0x30')]['limit']);_0x9483da['offset']=qs['offset'](_0x132dbe[_0x2d45('0x30')][_0x2d45('0x1c')]);}_0x9483da[_0x2d45('0x3a')]=qs[_0x2d45('0x3b')](_0x132dbe[_0x2d45('0x30')][_0x2d45('0x3b')]);_0x9483da[_0x2d45('0x3c')]=qs[_0x2d45('0x32')](_[_0x2d45('0x3d')](_0x132dbe[_0x2d45('0x30')],_0x36a597[_0x2d45('0x32')]),_0x289449);if(_0x132dbe['query'][_0x2d45('0x3e')]){_0x9483da[_0x2d45('0x3c')]=_[_0x2d45('0x3f')](_0x9483da[_0x2d45('0x3c')],{'$or':_['map'](_0x289449,function(_0x387822){if(_0x387822[_0x2d45('0x40')]!==_0x2d45('0x41')){var _0x1e5b18={};_0x1e5b18[_0x387822['name']]={'$like':'%'+_0x132dbe[_0x2d45('0x30')]['filter']+'%'};return _0x1e5b18;}})});}_0x9483da=_[_0x2d45('0x3f')]({},_0x9483da,_0x132dbe[_0x2d45('0x42')]);var _0x4a2bde={'where':_0x9483da['where']};return db[_0x2d45('0x2c')][_0x2d45('0x1f')](_0x4a2bde)[_0x2d45('0x26')](function(_0x4d00d2){_0x5ad0e8['count']=_0x4d00d2;if(_0x132dbe[_0x2d45('0x30')]['includeAll']){_0x9483da[_0x2d45('0x43')]=[{'all':!![]}];}return db[_0x2d45('0x2c')][_0x2d45('0x44')](_0x9483da);})[_0x2d45('0x26')](function(_0x9fcc01){_0x5ad0e8['rows']=_0x9fcc01;return _0x5ad0e8;})['then'](respondWithFilteredResult(_0xd0cb23,_0x9483da))[_0x2d45('0x45')](handleError(_0xd0cb23,null));};exports[_0x2d45('0x46')]=function(_0x37f019,_0x53d90e){var _0x809114={'raw':!![],'where':{'id':_0x37f019[_0x2d45('0x47')]['id']}},_0xef57ad={};_0xef57ad['model']=_['keys'](db['VoiceDialReport'][_0x2d45('0x2d')]);_0xef57ad[_0x2d45('0x30')]=_[_0x2d45('0x31')](_0x37f019['query']);_0xef57ad[_0x2d45('0x32')]=_[_0x2d45('0x33')](_0xef57ad[_0x2d45('0x34')],_0xef57ad['query']);_0x809114[_0x2d45('0x35')]=_[_0x2d45('0x33')](_0xef57ad[_0x2d45('0x34')],qs['fields'](_0x37f019[_0x2d45('0x30')]['fields']));_0x809114[_0x2d45('0x35')]=_0x809114[_0x2d45('0x35')][_0x2d45('0x37')]?_0x809114[_0x2d45('0x35')]:_0xef57ad[_0x2d45('0x34')];if(_0x37f019[_0x2d45('0x30')]['includeAll']){_0x809114[_0x2d45('0x43')]=[{'all':!![]}];}_0x809114=_[_0x2d45('0x3f')]({},_0x809114,_0x37f019['options']);return db[_0x2d45('0x2c')][_0x2d45('0x48')](_0x809114)[_0x2d45('0x26')](handleEntityNotFound(_0x53d90e,null))[_0x2d45('0x26')](respondWithResult(_0x53d90e,null))[_0x2d45('0x45')](handleError(_0x53d90e,null));};exports[_0x2d45('0x49')]=function(_0x13db80,_0x2a2a38){return db[_0x2d45('0x2c')][_0x2d45('0x49')](_0x13db80[_0x2d45('0x4a')],{})[_0x2d45('0x26')](respondWithResult(_0x2a2a38,0xc9))['catch'](handleError(_0x2a2a38,null));};exports[_0x2d45('0x25')]=function(_0x4ad3fa,_0x124859){if(_0x4ad3fa[_0x2d45('0x4a')]['id']){delete _0x4ad3fa[_0x2d45('0x4a')]['id'];}return db[_0x2d45('0x2c')][_0x2d45('0x48')]({'where':{'id':_0x4ad3fa[_0x2d45('0x47')]['id']}})[_0x2d45('0x26')](handleEntityNotFound(_0x124859,null))[_0x2d45('0x26')](saveUpdates(_0x4ad3fa['body'],null))[_0x2d45('0x26')](respondWithResult(_0x124859,null))['catch'](handleError(_0x124859,null));};exports['destroy']=function(_0x250369,_0x2376b6){return db[_0x2d45('0x2c')][_0x2d45('0x48')]({'where':{'id':_0x250369[_0x2d45('0x47')]['id']}})[_0x2d45('0x26')](handleEntityNotFound(_0x2376b6,null))[_0x2d45('0x26')](removeEntity(_0x2376b6,null))[_0x2d45('0x45')](handleError(_0x2376b6,null));};exports[_0x2d45('0x4b')]=function(_0x30d1dd,_0x156e2d){return db[_0x2d45('0x2c')][_0x2d45('0x4b')]()[_0x2d45('0x26')](respondWithResult(_0x156e2d,null))['catch'](handleError(_0x156e2d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 1e1c852..7164f88 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 _0x25fa=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','./voiceDialReport.attributes','define','VoiceDialReport','report_dial'];(function(_0x3ed2b3,_0x1d9e25){var _0x11b21e=function(_0x19ce1b){while(--_0x19ce1b){_0x3ed2b3['push'](_0x3ed2b3['shift']());}};_0x11b21e(++_0x1d9e25);}(_0x25fa,0x109));var _0xa25f=function(_0x2fc250,_0x327bcc){_0x2fc250=_0x2fc250-0x0;var _0x13ef9b=_0x25fa[_0x2fc250];return _0x13ef9b;};'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':[{'fields':[_0xa25f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd121=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','bluebird','path'];(function(_0x366eab,_0x27fa58){var _0x4e9f5d=function(_0x35dd62){while(--_0x35dd62){_0x366eab['push'](_0x366eab['shift']());}};_0x4e9f5d(++_0x27fa58);}(_0xd121,0x112));var _0x1d12=function(_0x1566f7,_0x1c7aa1){_0x1566f7=_0x1566f7-0x0;var _0x37f438=_0xd121[_0x1566f7];return _0x37f438;};'use strict';var _=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var logger=require('../../config/logger')(_0x1d12('0x2'));var moment=require(_0x1d12('0x3'));var BPromise=require(_0x1d12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d12('0x5'));var rimraf=require(_0x1d12('0x6'));var config=require(_0x1d12('0x7'));var attributes=require(_0x1d12('0x8'));module[_0x1d12('0x9')]=function(_0x259051,_0xf99790){return _0x259051[_0x1d12('0xa')](_0x1d12('0xb'),attributes,{'tableName':_0x1d12('0xc'),'paranoid':![],'indexes':[{'fields':[_0x1d12('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index d2e065e..de0170a 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 _0xafe3=['jayson/promise','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateVoiceDialReport','body','options','raw','UpdateVoiceDialReport','VoiceDialReport','update','attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x296ed9,_0x5be0e8){var _0x59bb48=function(_0xb44b02){while(--_0xb44b02){_0x296ed9['push'](_0x296ed9['shift']());}};_0x59bb48(++_0x5be0e8);}(_0xafe3,0x189));var _0x3afe=function(_0x587975,_0xf68c6b){_0x587975=_0x587975-0x0;var _0x135dea=_0xafe3[_0x587975];return _0x135dea;};'use strict';var _=require('lodash');var util=require(_0x3afe('0x0'));var moment=require(_0x3afe('0x1'));var BPromise=require(_0x3afe('0x2'));var rs=require(_0x3afe('0x3'));var fs=require('fs');var Redis=require(_0x3afe('0x4'));var db=require(_0x3afe('0x5'))['db'];var utils=require(_0x3afe('0x6'));var logger=require(_0x3afe('0x7'))(_0x3afe('0x8'));var config=require(_0x3afe('0x9'));var jayson=require(_0x3afe('0xa'));var client=jayson['client'][_0x3afe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x433c16,_0x566d6b,_0x503ffe){return new BPromise(function(_0x41fd64,_0x5e64af){return client['request'](_0x433c16,_0x503ffe)[_0x3afe('0xc')](function(_0x143432){logger[_0x3afe('0xd')](_0x3afe('0xe'),_0x566d6b,_0x3afe('0xf'));logger[_0x3afe('0x10')](_0x3afe('0x11'),_0x566d6b,_0x3afe('0xf'),JSON[_0x3afe('0x12')](_0x143432));if(_0x143432[_0x3afe('0x13')]){if(_0x143432[_0x3afe('0x13')][_0x3afe('0x14')]===0x1f4){logger['error'](_0x3afe('0xe'),_0x566d6b,_0x143432[_0x3afe('0x13')][_0x3afe('0x15')]);return _0x5e64af(_0x143432[_0x3afe('0x13')][_0x3afe('0x15')]);}logger[_0x3afe('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x566d6b,_0x143432[_0x3afe('0x13')][_0x3afe('0x15')]);return _0x41fd64(_0x143432['error']['message']);}else{logger[_0x3afe('0xd')](_0x3afe('0xe'),_0x566d6b,_0x3afe('0xf'));_0x41fd64(_0x143432['result'][_0x3afe('0x15')]);}})[_0x3afe('0x16')](function(_0x45a732){logger['error'](_0x3afe('0xe'),_0x566d6b,_0x45a732);_0x5e64af(_0x45a732);});});}exports[_0x3afe('0x17')]=function(_0x4ee69b){var _0x195700=this;return new Promise(function(_0x2f7d1b,_0x22a236){return db['VoiceDialReport']['create'](_0x4ee69b[_0x3afe('0x18')],{'raw':_0x4ee69b['options']?_0x4ee69b[_0x3afe('0x19')][_0x3afe('0x1a')]===undefined?!![]:![]:!![]})[_0x3afe('0xc')](function(_0x5955bf){logger[_0x3afe('0xd')](_0x3afe('0x17'),_0x4ee69b);logger['debug'](_0x3afe('0x17'),_0x4ee69b,JSON['stringify'](_0x5955bf));_0x2f7d1b(_0x5955bf);})[_0x3afe('0x16')](function(_0x3bb7d2){logger[_0x3afe('0x13')](_0x3afe('0x17'),_0x3bb7d2[_0x3afe('0x15')],_0x4ee69b);_0x22a236(_0x195700[_0x3afe('0x13')](0x1f4,_0x3bb7d2['message']));});});};exports[_0x3afe('0x1b')]=function(_0x254a9b){var _0xfca557=this;return new Promise(function(_0x34ceab,_0x458fcb){return db[_0x3afe('0x1c')][_0x3afe('0x1d')](_0x254a9b[_0x3afe('0x18')],{'raw':_0x254a9b[_0x3afe('0x19')]?_0x254a9b[_0x3afe('0x19')][_0x3afe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x254a9b[_0x3afe('0x19')]?_0x254a9b[_0x3afe('0x19')]['where']||null:null,'attributes':_0x254a9b[_0x3afe('0x19')]?_0x254a9b[_0x3afe('0x19')][_0x3afe('0x1e')]||null:null,'limit':_0x254a9b[_0x3afe('0x19')]?_0x254a9b[_0x3afe('0x19')]['limit']||null:null})[_0x3afe('0xc')](function(_0x8251ab){logger[_0x3afe('0xd')]('UpdateVoiceDialReport',_0x254a9b);logger[_0x3afe('0x10')](_0x3afe('0x1b'),_0x254a9b,JSON['stringify'](_0x8251ab));_0x34ceab(_0x8251ab);})[_0x3afe('0x16')](function(_0x42a9c8){logger[_0x3afe('0x13')](_0x3afe('0x1b'),_0x42a9c8[_0x3afe('0x15')],_0x254a9b);_0x458fcb(_0xfca557['error'](0x1f4,_0x42a9c8[_0x3afe('0x15')]));});});}; \ No newline at end of file +var _0xae38=['info','catch','UpdateVoiceDialReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','request\x20sent','result','CreateVoiceDialReport','VoiceDialReport','create','options','raw'];(function(_0x2904a8,_0x73180){var _0x4aae50=function(_0x491df9){while(--_0x491df9){_0x2904a8['push'](_0x2904a8['shift']());}};_0x4aae50(++_0x73180);}(_0xae38,0x189));var _0x8ae3=function(_0x24113c,_0x2c10a4){_0x24113c=_0x24113c-0x0;var _0x2c63ba=_0xae38[_0x24113c];return _0x2c63ba;};'use strict';var _=require(_0x8ae3('0x0'));var util=require(_0x8ae3('0x1'));var moment=require(_0x8ae3('0x2'));var BPromise=require(_0x8ae3('0x3'));var rs=require(_0x8ae3('0x4'));var fs=require('fs');var Redis=require(_0x8ae3('0x5'));var db=require(_0x8ae3('0x6'))['db'];var utils=require(_0x8ae3('0x7'));var logger=require(_0x8ae3('0x8'))(_0x8ae3('0x9'));var config=require('../../config/environment');var jayson=require(_0x8ae3('0xa'));var client=jayson['client'][_0x8ae3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1703cd,_0x35a310,_0x127dc3){return new BPromise(function(_0x287c85,_0x5bcbb1){return client[_0x8ae3('0xc')](_0x1703cd,_0x127dc3)[_0x8ae3('0xd')](function(_0x3cca6d){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x35a310,'request\x20sent');logger[_0x8ae3('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x35a310,'request\x20sent',JSON[_0x8ae3('0xf')](_0x3cca6d));if(_0x3cca6d[_0x8ae3('0x10')]){if(_0x3cca6d[_0x8ae3('0x10')][_0x8ae3('0x11')]===0x1f4){logger[_0x8ae3('0x10')](_0x8ae3('0x12'),_0x35a310,_0x3cca6d['error']['message']);return _0x5bcbb1(_0x3cca6d['error'][_0x8ae3('0x13')]);}logger[_0x8ae3('0x10')](_0x8ae3('0x12'),_0x35a310,_0x3cca6d[_0x8ae3('0x10')][_0x8ae3('0x13')]);return _0x287c85(_0x3cca6d[_0x8ae3('0x10')]['message']);}else{logger['info'](_0x8ae3('0x12'),_0x35a310,_0x8ae3('0x14'));_0x287c85(_0x3cca6d[_0x8ae3('0x15')][_0x8ae3('0x13')]);}})['catch'](function(_0x87f6a9){logger[_0x8ae3('0x10')](_0x8ae3('0x12'),_0x35a310,_0x87f6a9);_0x5bcbb1(_0x87f6a9);});});}exports[_0x8ae3('0x16')]=function(_0x2fa1c9){var _0x53aa26=this;return new Promise(function(_0x1a8b9e,_0x554e9e){return db[_0x8ae3('0x17')][_0x8ae3('0x18')](_0x2fa1c9['body'],{'raw':_0x2fa1c9[_0x8ae3('0x19')]?_0x2fa1c9[_0x8ae3('0x19')][_0x8ae3('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x18fd2f){logger[_0x8ae3('0x1b')]('CreateVoiceDialReport',_0x2fa1c9);logger[_0x8ae3('0xe')](_0x8ae3('0x16'),_0x2fa1c9,JSON[_0x8ae3('0xf')](_0x18fd2f));_0x1a8b9e(_0x18fd2f);})[_0x8ae3('0x1c')](function(_0xc13237){logger['error'](_0x8ae3('0x16'),_0xc13237[_0x8ae3('0x13')],_0x2fa1c9);_0x554e9e(_0x53aa26[_0x8ae3('0x10')](0x1f4,_0xc13237[_0x8ae3('0x13')]));});});};exports[_0x8ae3('0x1d')]=function(_0x2909cc){var _0x4f7ecf=this;return new Promise(function(_0x1eb887,_0x14a057){return db[_0x8ae3('0x17')][_0x8ae3('0x1e')](_0x2909cc[_0x8ae3('0x1f')],{'raw':_0x2909cc['options']?_0x2909cc[_0x8ae3('0x19')][_0x8ae3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2909cc['options']?_0x2909cc[_0x8ae3('0x19')][_0x8ae3('0x20')]||null:null,'attributes':_0x2909cc[_0x8ae3('0x19')]?_0x2909cc['options'][_0x8ae3('0x21')]||null:null,'limit':_0x2909cc[_0x8ae3('0x19')]?_0x2909cc[_0x8ae3('0x19')][_0x8ae3('0x22')]||null:null})[_0x8ae3('0xd')](function(_0x2e27f8){logger['info'](_0x8ae3('0x1d'),_0x2909cc);logger[_0x8ae3('0xe')](_0x8ae3('0x1d'),_0x2909cc,JSON['stringify'](_0x2e27f8));_0x1eb887(_0x2e27f8);})['catch'](function(_0x4590a0){logger[_0x8ae3('0x10')](_0x8ae3('0x1d'),_0x4590a0['message'],_0x2909cc);_0x14a057(_0x4f7ecf[_0x8ae3('0x10')](0x1f4,_0x4590a0[_0x8ae3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index f3f466b..5ac1b62 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 _0x27fb=['/:id/applications','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','get','show','post'];(function(_0x403484,_0x33b8ba){var _0x55b2bc=function(_0x1f9b3a){while(--_0x1f9b3a){_0x403484['push'](_0x403484['shift']());}};_0x55b2bc(++_0x33b8ba);}(_0x27fb,0x1eb));var _0xb27f=function(_0x35450e,_0x1ad7b3){_0x35450e=_0x35450e-0x0;var _0xfbb741=_0x27fb[_0x35450e];return _0xfbb741;};'use strict';var multer=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var path=require(_0xb27f('0x2'));var timeout=require(_0xb27f('0x3'));var express=require(_0xb27f('0x4'));var router=express['Router']();var fs_extra=require(_0xb27f('0x5'));var auth=require(_0xb27f('0x6'));var interaction=require(_0xb27f('0x7'));var config=require(_0xb27f('0x8'));var controller=require(_0xb27f('0x9'));router['get']('/',auth[_0xb27f('0xa')](),controller[_0xb27f('0xb')]);router[_0xb27f('0xc')]('/:id',auth[_0xb27f('0xa')](),controller[_0xb27f('0xd')]);router['post']('/',auth[_0xb27f('0xa')](),controller['create']);router[_0xb27f('0xe')](_0xb27f('0xf'),auth[_0xb27f('0xa')](),controller['addApplications']);router[_0xb27f('0x10')](_0xb27f('0x11'),auth[_0xb27f('0xa')](),controller[_0xb27f('0x12')]);router[_0xb27f('0x13')](_0xb27f('0x11'),auth[_0xb27f('0xa')](),controller[_0xb27f('0x14')]);module[_0xb27f('0x15')]=router; \ No newline at end of file +var _0xf772=['./voiceExtension.controller','get','/:id','post','isAuthenticated','create','/:id/applications','put','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf772,0x1e7));var _0x2f77=function(_0x1fd1c8,_0x132f5c){_0x1fd1c8=_0x1fd1c8-0x0;var _0x84cbbc=_0xf772[_0x1fd1c8];return _0x84cbbc;};'use strict';var multer=require('multer');var util=require(_0x2f77('0x0'));var path=require('path');var timeout=require(_0x2f77('0x1'));var express=require('express');var router=express[_0x2f77('0x2')]();var fs_extra=require(_0x2f77('0x3'));var auth=require(_0x2f77('0x4'));var interaction=require(_0x2f77('0x5'));var config=require(_0x2f77('0x6'));var controller=require(_0x2f77('0x7'));router[_0x2f77('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2f77('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x2f77('0xa')]('/',auth[_0x2f77('0xb')](),controller[_0x2f77('0xc')]);router[_0x2f77('0xa')](_0x2f77('0xd'),auth[_0x2f77('0xb')](),controller['addApplications']);router[_0x2f77('0xe')](_0x2f77('0x9'),auth[_0x2f77('0xb')](),controller[_0x2f77('0xf')]);router[_0x2f77('0x10')](_0x2f77('0x9'),auth[_0x2f77('0xb')](),controller[_0x2f77('0x11')]);module[_0x2f77('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 6607ee1..e0ef14f 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 _0x817a=['inbound-fax','system','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal'];(function(_0x4710fb,_0xb65b41){var _0x4c26f5=function(_0x27373d){while(--_0x27373d){_0x4710fb['push'](_0x4710fb['shift']());}};_0x4c26f5(++_0xb65b41);}(_0x817a,0xf7));var _0xa817=function(_0x1c98d6,_0x3c8854){_0x1c98d6=_0x1c98d6-0x0;var _0x154a76=_0x817a[_0x1c98d6];return _0x154a76;};'use strict';var Sequelize=require(_0xa817('0x0'));module['exports']={'context':{'type':Sequelize[_0xa817('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xa817('0x1')],'allowNull':![],'unique':_0xa817('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xa817('0x2')},'tag':{'type':Sequelize[_0xa817('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xa817('0x1')],'allowNull':![],'defaultValue':_0xa817('0x3')},'appdata':{'type':Sequelize[_0xa817('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xa817('0x4')](_0xa817('0x5'),_0xa817('0x6'),_0xa817('0x7'),_0xa817('0x8'),'outbound-fax',_0xa817('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa817('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0xa817('0xa')]},'isApp':{'type':Sequelize[_0xa817('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xa817('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xa817('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xa817('0xc')],'get':function(_0x1ef516){return this[_0xa817('0xd')](_0xa817('0xe'));}},'alias':{'type':Sequelize[_0xa817('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x4583=['internal','inbound-fax','outbound-fax','system','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound'];(function(_0x138dd8,_0x2be09){var _0x4186fd=function(_0x116749){while(--_0x116749){_0x138dd8['push'](_0x138dd8['shift']());}};_0x4186fd(++_0x2be09);}(_0x4583,0x199));var _0x3458=function(_0x500147,_0x3c4606){_0x500147=_0x500147-0x0;var _0x5b08ab=_0x4583[_0x500147];return _0x5b08ab;};'use strict';var Sequelize=require(_0x3458('0x0'));module['exports']={'context':{'type':Sequelize[_0x3458('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x3458('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x3458('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x3458('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x3458('0x1')],'allowNull':![],'defaultValue':_0x3458('0x3')},'appdata':{'type':Sequelize[_0x3458('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x3458('0x4')](_0x3458('0x5'),_0x3458('0x6'),_0x3458('0x7'),_0x3458('0x8'),_0x3458('0x9'),_0x3458('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x3458('0x1')]},'interval':{'type':Sequelize[_0x3458('0x1')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x3458('0xb')]},'isApp':{'type':Sequelize[_0x3458('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x3458('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x3458('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x3458('0x1')],'defaultValue':_0x3458('0xd')},'answer':{'type':Sequelize[_0x3458('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x3458('0xe')],'get':function(_0x4474d4){return this[_0x3458('0xf')]('exten');}},'alias':{'type':Sequelize[_0x3458('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 08f168b..e60a35e 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 _0x9569=['nolimit','order','sort','where','filters','merge','VIRTUAL','includeAll','findAll','rows','catch','include','options','destroy','params','create','body','outbound','startsWith','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','sendStatus','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','then','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','stack','name','send','index','VoiceExtension','rawAttributes','fieldName','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0xe9e6cf,_0x395f6d){var _0x2b8851=function(_0x4d6bd4){while(--_0x4d6bd4){_0xe9e6cf['push'](_0xe9e6cf['shift']());}};_0x2b8851(++_0x395f6d);}(_0x9569,0xed));var _0x9956=function(_0xe69fcf,_0x1386ab){_0xe69fcf=_0xe69fcf-0x0;var _0x3ff335=_0x9569[_0xe69fcf];return _0x3ff335;};'use strict';var _=require('lodash');var Redis=require(_0x9956('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x9956('0x1'))('api');var config=require(_0x9956('0x2'));var db=require(_0x9956('0x3'))['db'];config[_0x9956('0x4')]=_[_0x9956('0x5')](config[_0x9956('0x4')],{'host':_0x9956('0x6'),'port':0x18eb});var socket=require(_0x9956('0x7'))(new Redis(config[_0x9956('0x4')]));require(_0x9956('0x8'))['register'](socket);function respondWithStatusCode(_0x27c590,_0x53ea40){_0x53ea40=_0x53ea40||0xcc;return function(_0x528b19){if(_0x528b19){return _0x27c590['sendStatus'](_0x53ea40);}return _0x27c590[_0x9956('0x9')](_0x53ea40)[_0x9956('0xa')]();};}function respondWithResult(_0x1aba90,_0x4764ea){_0x4764ea=_0x4764ea||0xc8;return function(_0x35bad0){if(_0x35bad0){return _0x1aba90[_0x9956('0x9')](_0x4764ea)[_0x9956('0xb')](_0x35bad0);}};}function respondWithFilteredResult(_0x1f920f,_0x16b0be){return function(_0x214612){if(_0x214612){var _0x37ad08=typeof _0x16b0be['offset']===_0x9956('0xc')&&typeof _0x16b0be[_0x9956('0xd')]===_0x9956('0xc');var _0xd27653=_0x214612[_0x9956('0xe')];var _0x123813=_0x37ad08?0x0:_0x16b0be['offset'];var _0x22c2c3=_0x37ad08?_0x214612[_0x9956('0xe')]:_0x16b0be[_0x9956('0xf')]+_0x16b0be[_0x9956('0xd')];var _0x26aa09;if(_0x22c2c3>=_0xd27653){_0x22c2c3=_0xd27653;_0x26aa09=0xc8;}else{_0x26aa09=0xce;}_0x1f920f[_0x9956('0x9')](_0x26aa09);return _0x1f920f[_0x9956('0x10')](_0x9956('0x11'),_0x123813+'-'+_0x22c2c3+'/'+_0xd27653)[_0x9956('0xb')](_0x214612);}return null;};}function removeEntity(_0x29ba99){return function(_0x405831){if(_0x405831){return _0x405831['destroy']()[_0x9956('0x12')](function(){var _0xe9c4f1=_0x405831['get']({'plain':!![]});var _0x1054f5=[{'name':_0x9956('0x13'),'value':_0x9956('0x14'),'ignore':![]},{'name':_0x9956('0x15'),'value':'outbound','ignore':![]},{'name':_0x9956('0x16'),'value':_0x9956('0x17'),'ignore':![]}];var _0x407ee1=_(_0x1054f5)[_0x9956('0x18')](_0x9956('0x19'))[_0x9956('0x1a')]('value')[_0x9956('0x1b')]();if(_[_0x9956('0x1c')](_0x407ee1,_0xe9c4f1[_0x9956('0x1d')])){return;}var _0xa5ca94=_[_0x9956('0x1e')](_0x1054f5,[_0x9956('0x1b'),_0xe9c4f1[_0x9956('0x1d')]])['name'];return db[_0x9956('0x1f')]['destroy']({'where':{'type':_0xa5ca94,'resourceId':_0xe9c4f1['id']}})[_0x9956('0x12')](function(){return _0x405831;});})[_0x9956('0x12')](function(){_0x29ba99[_0x9956('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1569d1){return function(_0x363911){if(!_0x363911){_0x1569d1['sendStatus'](0x194);}return _0x363911;};}function handleError(_0xe7cb68,_0x1dc9ce){_0x1dc9ce=_0x1dc9ce||0x1f4;return function(_0x1a62fe){logger['error'](_0x1a62fe[_0x9956('0x20')]);if(_0x1a62fe[_0x9956('0x21')]){delete _0x1a62fe['name'];}_0xe7cb68[_0x9956('0x9')](_0x1dc9ce)[_0x9956('0x22')](_0x1a62fe);};}exports[_0x9956('0x23')]=function(_0x3bf6de,_0x3fb92b){var _0xf30183={},_0x5bbbad={},_0x375b60={'count':0x0,'rows':[]};var _0x2a856b=_[_0x9956('0x1a')](db[_0x9956('0x24')][_0x9956('0x25')],function(_0x3768e2){return{'name':_0x3768e2[_0x9956('0x26')],'type':_0x3768e2['type'][_0x9956('0x27')]};});_0x5bbbad['model']=_[_0x9956('0x1a')](_0x2a856b,_0x9956('0x21'));_0x5bbbad['query']=_[_0x9956('0x28')](_0x3bf6de[_0x9956('0x29')]);_0x5bbbad['filters']=_[_0x9956('0x2a')](_0x5bbbad[_0x9956('0x2b')],_0x5bbbad[_0x9956('0x29')]);_0xf30183[_0x9956('0x2c')]=_[_0x9956('0x2a')](_0x5bbbad[_0x9956('0x2b')],qs[_0x9956('0x2d')](_0x3bf6de[_0x9956('0x29')][_0x9956('0x2d')]));_0xf30183[_0x9956('0x2c')]=_0xf30183[_0x9956('0x2c')][_0x9956('0x2e')]?_0xf30183[_0x9956('0x2c')]:_0x5bbbad[_0x9956('0x2b')];if(!_0x3bf6de[_0x9956('0x29')][_0x9956('0x2f')](_0x9956('0x30'))){_0xf30183[_0x9956('0xd')]=qs[_0x9956('0xd')](_0x3bf6de[_0x9956('0x29')]['limit']);_0xf30183[_0x9956('0xf')]=qs['offset'](_0x3bf6de[_0x9956('0x29')][_0x9956('0xf')]);}_0xf30183[_0x9956('0x31')]=qs['sort'](_0x3bf6de[_0x9956('0x29')][_0x9956('0x32')]);_0xf30183[_0x9956('0x33')]=qs[_0x9956('0x34')](_['pick'](_0x3bf6de[_0x9956('0x29')],_0x5bbbad[_0x9956('0x34')]),_0x2a856b);if(_0x3bf6de[_0x9956('0x29')][_0x9956('0x18')]){_0xf30183[_0x9956('0x33')]=_[_0x9956('0x35')](_0xf30183[_0x9956('0x33')],{'$or':_[_0x9956('0x1a')](_0x2a856b,function(_0x41f1c1){if(_0x41f1c1[_0x9956('0x1d')]!==_0x9956('0x36')){var _0x5c0d8d={};_0x5c0d8d[_0x41f1c1[_0x9956('0x21')]]={'$like':'%'+_0x3bf6de[_0x9956('0x29')]['filter']+'%'};return _0x5c0d8d;}})});}_0xf30183=_[_0x9956('0x35')]({},_0xf30183,_0x3bf6de['options']);var _0x267de9={'where':_0xf30183[_0x9956('0x33')]};return db[_0x9956('0x24')][_0x9956('0xe')](_0x267de9)[_0x9956('0x12')](function(_0x30ae14){_0x375b60['count']=_0x30ae14;if(_0x3bf6de[_0x9956('0x29')][_0x9956('0x37')]){_0xf30183['include']=[{'all':!![]}];}return db[_0x9956('0x24')][_0x9956('0x38')](_0xf30183);})['then'](function(_0x468d7e){_0x375b60[_0x9956('0x39')]=_0x468d7e;return _0x375b60;})[_0x9956('0x12')](respondWithFilteredResult(_0x3fb92b,_0xf30183))[_0x9956('0x3a')](handleError(_0x3fb92b,null));};exports['show']=function(_0xfc24dd,_0x329158){var _0x18b4a0={'raw':![],'where':{'id':_0xfc24dd['params']['id']}},_0x57a501={};_0x57a501[_0x9956('0x2b')]=_[_0x9956('0x28')](db[_0x9956('0x24')][_0x9956('0x25')]);_0x57a501[_0x9956('0x29')]=_[_0x9956('0x28')](_0xfc24dd[_0x9956('0x29')]);_0x57a501[_0x9956('0x34')]=_[_0x9956('0x2a')](_0x57a501['model'],_0x57a501[_0x9956('0x29')]);_0x18b4a0[_0x9956('0x2c')]=_[_0x9956('0x2a')](_0x57a501[_0x9956('0x2b')],qs['fields'](_0xfc24dd['query'][_0x9956('0x2d')]));_0x18b4a0[_0x9956('0x2c')]=_0x18b4a0[_0x9956('0x2c')][_0x9956('0x2e')]?_0x18b4a0['attributes']:_0x57a501[_0x9956('0x2b')];if(_0xfc24dd[_0x9956('0x29')][_0x9956('0x37')]){_0x18b4a0[_0x9956('0x3b')]=[{'all':!![]}];}_0x18b4a0=_[_0x9956('0x35')]({},_0x18b4a0,_0xfc24dd[_0x9956('0x3c')]);return db[_0x9956('0x24')]['find'](_0x18b4a0)[_0x9956('0x12')](handleEntityNotFound(_0x329158,null))[_0x9956('0x12')](respondWithResult(_0x329158,null))[_0x9956('0x3a')](handleError(_0x329158,null));};exports[_0x9956('0x3d')]=function(_0x49698e,_0x41796d){return db[_0x9956('0x24')][_0x9956('0x1e')]({'where':{'id':_0x49698e[_0x9956('0x3e')]['id']}})[_0x9956('0x12')](handleEntityNotFound(_0x41796d,null))['then'](removeEntity(_0x41796d,null))[_0x9956('0x3a')](handleError(_0x41796d,null));};exports[_0x9956('0x3f')]=function(_0x5879ba,_0x1b6ebf){if(_0x5879ba[_0x9956('0x40')]['type']===_0x9956('0x41')&&!_[_0x9956('0x42')](_0x5879ba[_0x9956('0x40')][_0x9956('0x43')],'_')){_0x5879ba[_0x9956('0x40')][_0x9956('0x43')]='_'[_0x9956('0x44')](_0x5879ba[_0x9956('0x40')][_0x9956('0x43')]);}return db['VoiceExtension'][_0x9956('0x3f')](_0x5879ba[_0x9956('0x40')],{'raw':![]})['then'](function(_0x2c2eb2){var _0x3d0e76=_0x5879ba[_0x9956('0x45')][_0x9956('0x46')]({'plain':!![]});if(!_0x3d0e76)throw new Error(_0x9956('0x47'));if(_0x3d0e76[_0x9956('0x48')]===_0x9956('0x45')){var _0x3567f4=_0x2c2eb2[_0x9956('0x46')]({'plain':!![]});var _0x49a4dc=[{'name':_0x9956('0x13'),'value':_0x9956('0x14')},{'name':_0x9956('0x15'),'value':'outbound'},{'name':_0x9956('0x16'),'value':_0x9956('0x17')}];var _0x252f19=_[_0x9956('0x1e')](_0x49a4dc,[_0x9956('0x1b'),_0x3567f4[_0x9956('0x1d')]])[_0x9956('0x21')];return db[_0x9956('0x49')][_0x9956('0x1e')]({'where':{'name':_0x252f19,'userProfileId':_0x3d0e76['userProfileId']},'raw':!![]})[_0x9956('0x12')](function(_0x486c14){if(_0x486c14&&_0x486c14[_0x9956('0x4a')]===0x0){return db[_0x9956('0x1f')][_0x9956('0x3f')]({'name':_0x3567f4[_0x9956('0x21')],'resourceId':_0x3567f4['id'],'type':_0x486c14[_0x9956('0x21')],'sectionId':_0x486c14['id']},{})[_0x9956('0x12')](function(){return _0x2c2eb2;});}else{return _0x2c2eb2;}})[_0x9956('0x3a')](function(_0x5c771a){logger[_0x9956('0x4b')](_0x9956('0x4c'),_0x5c771a);throw _0x5c771a;});}return _0x2c2eb2;})[_0x9956('0x12')](respondWithResult(_0x1b6ebf,0xc9))[_0x9956('0x3a')](handleError(_0x1b6ebf,null));};exports['update']=function(_0x2a38d7,_0x59e438){if(_0x2a38d7['body']['id']){delete _0x2a38d7[_0x9956('0x40')]['id'];}return db[_0x9956('0x24')]['find']({'where':{'id':_0x2a38d7['params']['id']}})[_0x9956('0x12')](handleEntityNotFound(_0x59e438,null))[_0x9956('0x12')](function(_0x2a7464){if(_0x2a7464){return db[_0x9956('0x24')]['update'](_[_0x9956('0x4d')](_0x2a38d7['body'],[_0x9956('0x43'),'context',_0x9956('0x4e'),_0x9956('0x4f'),_0x9956('0x50'),_0x9956('0x51'),_0x9956('0x52')]),{'where':{'context':_0x2a7464[_0x9956('0x53')],'exten':_0x2a7464['exten']},'individualHooks':!![]})[_0x9956('0x12')](function(_0x2a9b7e){return _0x2a9b7e;});}return null;})[_0x9956('0x12')](respondWithStatusCode(_0x59e438,null))[_0x9956('0x3a')](handleError(_0x59e438,null));};exports[_0x9956('0x54')]=function(_0x1e9346,_0x4553a0){var _0x54debb=_0x1e9346[_0x9956('0x3e')]['id'];var _0xa47f2d=_0x1e9346[_0x9956('0x40')];var _0x580ed3=0xc8;var _0x37bca5=null;return db[_0x9956('0x55')][_0x9956('0x56')]({'isolationLevel':db['sequelize'][_0x9956('0x57')]['ISOLATION_LEVELS'][_0x9956('0x58')]},function(_0xd3fe5c){return db[_0x9956('0x24')][_0x9956('0x59')]({'where':{'id':_0x54debb},'transaction':_0xd3fe5c})[_0x9956('0x12')](function(_0x30b4d8){if(_0x30b4d8){return db[_0x9956('0x24')][_0x9956('0x3d')]({'where':{'VoiceExtensionId':_0x54debb},'transaction':_0xd3fe5c})[_0x9956('0x12')](function(){var _0x33f58e=_[_0x9956('0x1a')](_0xa47f2d,function(_0x4aaad8){_0x4aaad8[_0x9956('0x5a')]=_0x54debb;_0x4aaad8['isApp']=!![];return _0x4aaad8;});return _0x30b4d8[_0x9956('0x5b')](_0x33f58e);})['then'](function(_0x51d1ae){return db['VoiceExtension']['bulkCreate'](_0x51d1ae,{'transaction':_0xd3fe5c});});}else{_0x580ed3=0x194;_0x37bca5=[];}});})['then'](function(){if(_0x580ed3!==0x194){return db['VoiceExtension'][_0x9956('0x5c')]({'where':{'isApp':!![],'VoiceExtensionId':_0x54debb},'order':_0x9956('0x5d')})[_0x9956('0x12')](function(_0x18b947){_0x37bca5=_0x18b947;});}})[_0x9956('0x3a')](function(_0x4a2a1d){_0x580ed3=0x1f4;logger[_0x9956('0x4b')](_0x4a2a1d[_0x9956('0x20')]);if(_0x4a2a1d[_0x9956('0x21')]){delete _0x4a2a1d[_0x9956('0x21')];}_0x37bca5=_0x4a2a1d;})['finally'](function(){if(_0x37bca5===null){_0x4553a0[_0x9956('0x5e')](_0x580ed3);}else{if(_0x580ed3===0x1f4){_0x4553a0['status'](_0x580ed3)[_0x9956('0x22')](_0x37bca5);}else{_0x4553a0[_0x9956('0x9')](_0x580ed3)[_0x9956('0xb')](_0x37bca5);}}});}; \ No newline at end of file +var _0x1faa=['pick','merge','VIRTUAL','options','rows','catch','show','params','keys','rawAttributes','fields','length','includeAll','include','find','startsWith','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','sendStatus','end','status','json','limit','undefined','count','offset','set','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','internal','filter','ignore','map','value','includes','type','UserProfileResource','stack','name','index','VoiceExtension','fieldName','key','model','query','filters','attributes','intersection','nolimit','order','sort','where'];(function(_0x58788d,_0x88b74f){var _0x58ceba=function(_0x16a416){while(--_0x16a416){_0x58788d['push'](_0x58788d['shift']());}};_0x58ceba(++_0x88b74f);}(_0x1faa,0x14b));var _0xa1fa=function(_0x3c54ca,_0x306fa8){_0x3c54ca=_0x3c54ca-0x0;var _0x1e09d3=_0x1faa[_0x3c54ca];return _0x1e09d3;};'use strict';var _=require(_0xa1fa('0x0'));var Redis=require(_0xa1fa('0x1'));var qs=require(_0xa1fa('0x2'));var logger=require(_0xa1fa('0x3'))(_0xa1fa('0x4'));var config=require(_0xa1fa('0x5'));var db=require(_0xa1fa('0x6'))['db'];config[_0xa1fa('0x7')]=_[_0xa1fa('0x8')](config[_0xa1fa('0x7')],{'host':_0xa1fa('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa1fa('0xa'))['register'](socket);function respondWithStatusCode(_0x2e5a0c,_0x4ad555){_0x4ad555=_0x4ad555||0xcc;return function(_0x43fd3e){if(_0x43fd3e){return _0x2e5a0c[_0xa1fa('0xb')](_0x4ad555);}return _0x2e5a0c['status'](_0x4ad555)[_0xa1fa('0xc')]();};}function respondWithResult(_0x5bbdc8,_0x3e2a8c){_0x3e2a8c=_0x3e2a8c||0xc8;return function(_0x4090c1){if(_0x4090c1){return _0x5bbdc8[_0xa1fa('0xd')](_0x3e2a8c)[_0xa1fa('0xe')](_0x4090c1);}};}function respondWithFilteredResult(_0x218678,_0x36c282){return function(_0x1cc4a0){if(_0x1cc4a0){var _0x37631f=typeof _0x36c282['offset']==='undefined'&&typeof _0x36c282[_0xa1fa('0xf')]===_0xa1fa('0x10');var _0x3c8aa6=_0x1cc4a0[_0xa1fa('0x11')];var _0x1e3588=_0x37631f?0x0:_0x36c282[_0xa1fa('0x12')];var _0x1c8120=_0x37631f?_0x1cc4a0[_0xa1fa('0x11')]:_0x36c282[_0xa1fa('0x12')]+_0x36c282[_0xa1fa('0xf')];var _0xc93f97;if(_0x1c8120>=_0x3c8aa6){_0x1c8120=_0x3c8aa6;_0xc93f97=0xc8;}else{_0xc93f97=0xce;}_0x218678[_0xa1fa('0xd')](_0xc93f97);return _0x218678[_0xa1fa('0x13')]('Content-Range',_0x1e3588+'-'+_0x1c8120+'/'+_0x3c8aa6)[_0xa1fa('0xe')](_0x1cc4a0);}return null;};}function removeEntity(_0x44dfc7){return function(_0x3f6312){if(_0x3f6312){return _0x3f6312[_0xa1fa('0x14')]()[_0xa1fa('0x15')](function(){var _0x375aac=_0x3f6312[_0xa1fa('0x16')]({'plain':!![]});var _0x447672=[{'name':_0xa1fa('0x17'),'value':'inbound','ignore':![]},{'name':_0xa1fa('0x18'),'value':_0xa1fa('0x19'),'ignore':![]},{'name':'InternalRoutes','value':_0xa1fa('0x1a'),'ignore':![]}];var _0x544c48=_(_0x447672)[_0xa1fa('0x1b')](_0xa1fa('0x1c'))[_0xa1fa('0x1d')]('value')[_0xa1fa('0x1e')]();if(_[_0xa1fa('0x1f')](_0x544c48,_0x375aac[_0xa1fa('0x20')])){return;}var _0x3e4eda=_['find'](_0x447672,[_0xa1fa('0x1e'),_0x375aac[_0xa1fa('0x20')]])['name'];return db[_0xa1fa('0x21')][_0xa1fa('0x14')]({'where':{'type':_0x3e4eda,'resourceId':_0x375aac['id']}})['then'](function(){return _0x3f6312;});})[_0xa1fa('0x15')](function(){_0x44dfc7[_0xa1fa('0xd')](0xcc)[_0xa1fa('0xc')]();});}};}function handleEntityNotFound(_0x180e99){return function(_0x2ba82a){if(!_0x2ba82a){_0x180e99['sendStatus'](0x194);}return _0x2ba82a;};}function handleError(_0x43e030,_0x5e33e5){_0x5e33e5=_0x5e33e5||0x1f4;return function(_0x45b3c3){logger['error'](_0x45b3c3[_0xa1fa('0x22')]);if(_0x45b3c3[_0xa1fa('0x23')]){delete _0x45b3c3['name'];}_0x43e030[_0xa1fa('0xd')](_0x5e33e5)['send'](_0x45b3c3);};}exports[_0xa1fa('0x24')]=function(_0x1d73d7,_0x13aed1){var _0x5c024c={},_0x280745={},_0x2bba97={'count':0x0,'rows':[]};var _0x4249b6=_[_0xa1fa('0x1d')](db[_0xa1fa('0x25')]['rawAttributes'],function(_0x27f0b4){return{'name':_0x27f0b4[_0xa1fa('0x26')],'type':_0x27f0b4[_0xa1fa('0x20')][_0xa1fa('0x27')]};});_0x280745[_0xa1fa('0x28')]=_[_0xa1fa('0x1d')](_0x4249b6,_0xa1fa('0x23'));_0x280745[_0xa1fa('0x29')]=_['keys'](_0x1d73d7[_0xa1fa('0x29')]);_0x280745[_0xa1fa('0x2a')]=_['intersection'](_0x280745[_0xa1fa('0x28')],_0x280745['query']);_0x5c024c[_0xa1fa('0x2b')]=_[_0xa1fa('0x2c')](_0x280745[_0xa1fa('0x28')],qs['fields'](_0x1d73d7[_0xa1fa('0x29')]['fields']));_0x5c024c[_0xa1fa('0x2b')]=_0x5c024c[_0xa1fa('0x2b')]['length']?_0x5c024c[_0xa1fa('0x2b')]:_0x280745[_0xa1fa('0x28')];if(!_0x1d73d7[_0xa1fa('0x29')]['hasOwnProperty'](_0xa1fa('0x2d'))){_0x5c024c[_0xa1fa('0xf')]=qs['limit'](_0x1d73d7[_0xa1fa('0x29')]['limit']);_0x5c024c[_0xa1fa('0x12')]=qs[_0xa1fa('0x12')](_0x1d73d7[_0xa1fa('0x29')][_0xa1fa('0x12')]);}_0x5c024c[_0xa1fa('0x2e')]=qs[_0xa1fa('0x2f')](_0x1d73d7[_0xa1fa('0x29')][_0xa1fa('0x2f')]);_0x5c024c[_0xa1fa('0x30')]=qs[_0xa1fa('0x2a')](_[_0xa1fa('0x31')](_0x1d73d7[_0xa1fa('0x29')],_0x280745[_0xa1fa('0x2a')]),_0x4249b6);if(_0x1d73d7[_0xa1fa('0x29')][_0xa1fa('0x1b')]){_0x5c024c[_0xa1fa('0x30')]=_[_0xa1fa('0x32')](_0x5c024c[_0xa1fa('0x30')],{'$or':_[_0xa1fa('0x1d')](_0x4249b6,function(_0x262718){if(_0x262718[_0xa1fa('0x20')]!==_0xa1fa('0x33')){var _0x4d313c={};_0x4d313c[_0x262718[_0xa1fa('0x23')]]={'$like':'%'+_0x1d73d7[_0xa1fa('0x29')][_0xa1fa('0x1b')]+'%'};return _0x4d313c;}})});}_0x5c024c=_[_0xa1fa('0x32')]({},_0x5c024c,_0x1d73d7[_0xa1fa('0x34')]);var _0x3b6a0e={'where':_0x5c024c['where']};return db[_0xa1fa('0x25')][_0xa1fa('0x11')](_0x3b6a0e)[_0xa1fa('0x15')](function(_0x1daf09){_0x2bba97[_0xa1fa('0x11')]=_0x1daf09;if(_0x1d73d7[_0xa1fa('0x29')]['includeAll']){_0x5c024c['include']=[{'all':!![]}];}return db[_0xa1fa('0x25')]['findAll'](_0x5c024c);})['then'](function(_0x5b1c95){_0x2bba97[_0xa1fa('0x35')]=_0x5b1c95;return _0x2bba97;})[_0xa1fa('0x15')](respondWithFilteredResult(_0x13aed1,_0x5c024c))[_0xa1fa('0x36')](handleError(_0x13aed1,null));};exports[_0xa1fa('0x37')]=function(_0xaed50e,_0x371bb7){var _0xfaa670={'raw':![],'where':{'id':_0xaed50e[_0xa1fa('0x38')]['id']}},_0x48bc94={};_0x48bc94[_0xa1fa('0x28')]=_[_0xa1fa('0x39')](db[_0xa1fa('0x25')][_0xa1fa('0x3a')]);_0x48bc94[_0xa1fa('0x29')]=_[_0xa1fa('0x39')](_0xaed50e[_0xa1fa('0x29')]);_0x48bc94[_0xa1fa('0x2a')]=_[_0xa1fa('0x2c')](_0x48bc94[_0xa1fa('0x28')],_0x48bc94[_0xa1fa('0x29')]);_0xfaa670[_0xa1fa('0x2b')]=_[_0xa1fa('0x2c')](_0x48bc94['model'],qs[_0xa1fa('0x3b')](_0xaed50e[_0xa1fa('0x29')][_0xa1fa('0x3b')]));_0xfaa670[_0xa1fa('0x2b')]=_0xfaa670[_0xa1fa('0x2b')][_0xa1fa('0x3c')]?_0xfaa670[_0xa1fa('0x2b')]:_0x48bc94['model'];if(_0xaed50e[_0xa1fa('0x29')][_0xa1fa('0x3d')]){_0xfaa670[_0xa1fa('0x3e')]=[{'all':!![]}];}_0xfaa670=_['merge']({},_0xfaa670,_0xaed50e[_0xa1fa('0x34')]);return db[_0xa1fa('0x25')][_0xa1fa('0x3f')](_0xfaa670)[_0xa1fa('0x15')](handleEntityNotFound(_0x371bb7,null))[_0xa1fa('0x15')](respondWithResult(_0x371bb7,null))[_0xa1fa('0x36')](handleError(_0x371bb7,null));};exports[_0xa1fa('0x14')]=function(_0x382cc6,_0x5403dc){return db[_0xa1fa('0x25')][_0xa1fa('0x3f')]({'where':{'id':_0x382cc6[_0xa1fa('0x38')]['id']}})[_0xa1fa('0x15')](handleEntityNotFound(_0x5403dc,null))[_0xa1fa('0x15')](removeEntity(_0x5403dc,null))[_0xa1fa('0x36')](handleError(_0x5403dc,null));};exports['create']=function(_0xa82cc0,_0x504b50){if(_0xa82cc0['body']['type']===_0xa1fa('0x19')&&!_[_0xa1fa('0x40')](_0xa82cc0[_0xa1fa('0x41')][_0xa1fa('0x42')],'_')){_0xa82cc0[_0xa1fa('0x41')][_0xa1fa('0x42')]='_'[_0xa1fa('0x43')](_0xa82cc0[_0xa1fa('0x41')][_0xa1fa('0x42')]);}return db[_0xa1fa('0x25')][_0xa1fa('0x44')](_0xa82cc0['body'],{'raw':![]})['then'](function(_0x5435f2){var _0x465f9e=_0xa82cc0[_0xa1fa('0x45')][_0xa1fa('0x16')]({'plain':!![]});if(!_0x465f9e)throw new Error(_0xa1fa('0x46'));if(_0x465f9e[_0xa1fa('0x47')]===_0xa1fa('0x45')){var _0x5b0e3e=_0x5435f2[_0xa1fa('0x16')]({'plain':!![]});var _0x178915=[{'name':_0xa1fa('0x17'),'value':_0xa1fa('0x48')},{'name':_0xa1fa('0x18'),'value':'outbound'},{'name':_0xa1fa('0x49'),'value':'internal'}];var _0x22b3b3=_[_0xa1fa('0x3f')](_0x178915,[_0xa1fa('0x1e'),_0x5b0e3e['type']])[_0xa1fa('0x23')];return db[_0xa1fa('0x4a')][_0xa1fa('0x3f')]({'where':{'name':_0x22b3b3,'userProfileId':_0x465f9e[_0xa1fa('0x4b')]},'raw':!![]})[_0xa1fa('0x15')](function(_0x39f82a){if(_0x39f82a&&_0x39f82a[_0xa1fa('0x4c')]===0x0){return db[_0xa1fa('0x21')][_0xa1fa('0x44')]({'name':_0x5b0e3e[_0xa1fa('0x23')],'resourceId':_0x5b0e3e['id'],'type':_0x39f82a[_0xa1fa('0x23')],'sectionId':_0x39f82a['id']},{})[_0xa1fa('0x15')](function(){return _0x5435f2;});}else{return _0x5435f2;}})[_0xa1fa('0x36')](function(_0x3afd98){logger[_0xa1fa('0x4d')](_0xa1fa('0x4e'),_0x3afd98);throw _0x3afd98;});}return _0x5435f2;})['then'](respondWithResult(_0x504b50,0xc9))[_0xa1fa('0x36')](handleError(_0x504b50,null));};exports['update']=function(_0x455c85,_0x59c766){if(_0x455c85[_0xa1fa('0x41')]['id']){delete _0x455c85[_0xa1fa('0x41')]['id'];}return db[_0xa1fa('0x25')][_0xa1fa('0x3f')]({'where':{'id':_0x455c85['params']['id']}})[_0xa1fa('0x15')](handleEntityNotFound(_0x59c766,null))[_0xa1fa('0x15')](function(_0x304c34){if(_0x304c34){return db[_0xa1fa('0x25')]['update'](_[_0xa1fa('0x31')](_0x455c85[_0xa1fa('0x41')],['exten',_0xa1fa('0x4f'),_0xa1fa('0x50'),_0xa1fa('0x51'),'cutdigits',_0xa1fa('0x52'),_0xa1fa('0x53')]),{'where':{'context':_0x304c34['context'],'exten':_0x304c34['exten']},'individualHooks':!![]})[_0xa1fa('0x15')](function(_0x12f4c2){return _0x12f4c2;});}return null;})['then'](respondWithStatusCode(_0x59c766,null))[_0xa1fa('0x36')](handleError(_0x59c766,null));};exports[_0xa1fa('0x54')]=function(_0x8318ed,_0x2dafbc){var _0x1c9476=_0x8318ed['params']['id'];var _0xd14397=_0x8318ed['body'];var _0x3b1b33=0xc8;var _0x42f1b6=null;return db[_0xa1fa('0x55')][_0xa1fa('0x56')]({'isolationLevel':db[_0xa1fa('0x55')][_0xa1fa('0x57')][_0xa1fa('0x58')]['READ_COMMITTED']},function(_0x5853a2){return db[_0xa1fa('0x25')][_0xa1fa('0x59')]({'where':{'id':_0x1c9476},'transaction':_0x5853a2})[_0xa1fa('0x15')](function(_0x4b0684){if(_0x4b0684){return db[_0xa1fa('0x25')][_0xa1fa('0x14')]({'where':{'VoiceExtensionId':_0x1c9476},'transaction':_0x5853a2})[_0xa1fa('0x15')](function(){var _0x248c89=_[_0xa1fa('0x1d')](_0xd14397,function(_0xff539a){_0xff539a[_0xa1fa('0x5a')]=_0x1c9476;_0xff539a['isApp']=!![];return _0xff539a;});return _0x4b0684[_0xa1fa('0x5b')](_0x248c89);})[_0xa1fa('0x15')](function(_0x18782e){return db[_0xa1fa('0x25')][_0xa1fa('0x5c')](_0x18782e,{'transaction':_0x5853a2});});}else{_0x3b1b33=0x194;_0x42f1b6=[];}});})[_0xa1fa('0x15')](function(){if(_0x3b1b33!==0x194){return db[_0xa1fa('0x25')][_0xa1fa('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1c9476},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x2a25c4){_0x42f1b6=_0x2a25c4;});}})[_0xa1fa('0x36')](function(_0x5ee300){_0x3b1b33=0x1f4;logger[_0xa1fa('0x4d')](_0x5ee300[_0xa1fa('0x22')]);if(_0x5ee300[_0xa1fa('0x23')]){delete _0x5ee300[_0xa1fa('0x23')];}_0x42f1b6=_0x5ee300;})[_0xa1fa('0x5e')](function(){if(_0x42f1b6===null){_0x2dafbc[_0xa1fa('0xb')](_0x3b1b33);}else{if(_0x3b1b33===0x1f4){_0x2dafbc['status'](_0x3b1b33)['send'](_0x42f1b6);}else{_0x2dafbc[_0xa1fa('0xd')](_0x3b1b33)[_0xa1fa('0xe')](_0x42f1b6);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 5e29544..34998cc 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 _0xf3ce=['VoiceExtension','save','update','remove','emit','hasOwnProperty','events'];(function(_0x583745,_0x2d1897){var _0x4ba020=function(_0x288616){while(--_0x288616){_0x583745['push'](_0x583745['shift']());}};_0x4ba020(++_0x2d1897);}(_0xf3ce,0x11e));var _0xef3c=function(_0x10fe9e,_0x5514b4){_0x10fe9e=_0x10fe9e-0x0;var _0x29ef86=_0xf3ce[_0x10fe9e];return _0x29ef86;};'use strict';var EventEmitter=require(_0xef3c('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xef3c('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef3c('0x2'),'afterUpdate':_0xef3c('0x3'),'afterDestroy':_0xef3c('0x4')};function emitEvent(_0x2c2d64){return function(_0x3cb9aa,_0x530779,_0x17c9d6){VoiceExtensionEvents[_0xef3c('0x5')](_0x2c2d64+':'+_0x3cb9aa['id'],_0x3cb9aa);VoiceExtensionEvents['emit'](_0x2c2d64,_0x3cb9aa);_0x17c9d6(null);};}for(var e in events){if(events[_0xef3c('0x6')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x75af=['events','VoiceExtension','setMaxListeners','save','update','remove','emit','exports'];(function(_0x48e38b,_0x14c7d6){var _0xc66994=function(_0x5c4e1a){while(--_0x5c4e1a){_0x48e38b['push'](_0x48e38b['shift']());}};_0xc66994(++_0x14c7d6);}(_0x75af,0x68));var _0xf75a=function(_0x31bb14,_0x574af9){_0x31bb14=_0x31bb14-0x0;var _0x49db15=_0x75af[_0x31bb14];return _0x49db15;};'use strict';var EventEmitter=require(_0xf75a('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0xf75a('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf75a('0x2')](0x0);var events={'afterCreate':_0xf75a('0x3'),'afterUpdate':_0xf75a('0x4'),'afterDestroy':_0xf75a('0x5')};function emitEvent(_0x1fe199){return function(_0x9e2239,_0x416a64,_0x3d25f1){VoiceExtensionEvents[_0xf75a('0x6')](_0x1fe199+':'+_0x9e2239['id'],_0x9e2239);VoiceExtensionEvents[_0xf75a('0x6')](_0x1fe199,_0x9e2239);_0x3d25f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xf75a('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 efba2b6..b72de7e 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 _0x8075=['catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','models','CDR(type)=','context','exten','type','alias','Set','NoOp','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','param','prefix','phone','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','IntervalId','then','interval','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','playback','includes','app','custom','answer','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','appType','outboundDial','appdata','priority','last','concat'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8075,0xab));var _0x5807=function(_0x5bac68,_0x18d03d){_0x5bac68=_0x5bac68-0x0;var _0x34cdc9=_0x8075[_0x5bac68];return _0x34cdc9;};'use strict';var _=require(_0x5807('0x0'));var attributes=require(_0x5807('0x1'));module['exports']=function(_0x1b99c5){var _0x5efb54=_0x1b99c5[_0x5807('0x2')];function _0x11de2e(_0x4e287b){var _0x35d426=0x2;var _0x8f6a62=[{'type':_0x4e287b['type'],'app':'Set','appdata':_0x5807('0x3')+_0x4e287b['type'],'context':_0x4e287b[_0x5807('0x4')],'exten':_0x4e287b[_0x5807('0x5')],'priority':_0x35d426++,'VoiceExtensionId':_0x4e287b['id']},{'type':_0x4e287b[_0x5807('0x6')],'app':_0x4e287b[_0x5807('0x7')]?_0x5807('0x8'):_0x5807('0x9'),'appdata':_0x4e287b['alias']?'CDR(routeAlias)='+_0x4e287b[_0x5807('0x7')]:_0x5807('0xa'),'context':_0x4e287b[_0x5807('0x4')],'exten':_0x4e287b[_0x5807('0x5')],'priority':_0x35d426++,'VoiceExtensionId':_0x4e287b['id']}];if(_0x4e287b[_0x5807('0x6')]===_0x5807('0xb')){_0x8f6a62[_0x5807('0xc')]({'type':_0x5807('0xb'),'app':_0x5807('0x8'),'appdata':_0x5807('0xd')+_0x4e287b['id'],'context':_0x4e287b[_0x5807('0x4')],'exten':_0x4e287b['exten'],'priority':_0x35d426++,'VoiceExtensionId':_0x4e287b['id']});}_0x8f6a62[_0x5807('0xc')]({'type':_0x4e287b[_0x5807('0x6')],'app':_0x5807('0x8'),'appdata':_0x5807('0xe'),'context':_0x4e287b[_0x5807('0x4')],'exten':_0x4e287b[_0x5807('0x5')],'priority':_0x35d426++,'VoiceExtensionId':_0x4e287b['id']},{'type':_0x4e287b[_0x5807('0x6')],'app':_0x5807('0x8'),'appdata':_0x5807('0xf'),'context':_0x4e287b[_0x5807('0x4')],'exten':_0x4e287b[_0x5807('0x5')],'priority':_0x35d426++,'VoiceExtensionId':_0x4e287b['id']},{'type':_0x4e287b[_0x5807('0x6')],'app':_0x5807('0x8'),'appdata':_0x5807('0x10'),'context':_0x4e287b[_0x5807('0x4')],'exten':_0x4e287b[_0x5807('0x5')],'priority':_0x35d426++,'VoiceExtensionId':_0x4e287b['id']});return _0x8f6a62;}function _0x3db6ea(_0x2d340e){var _0x563d44=0x2;var _0x153536=[{'type':_0x5807('0x11'),'app':_0x5807('0x8'),'appdata':_0x5807('0x12'),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e['exten'],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':_0x2d340e[_0x5807('0x7')]?_0x5807('0x8'):_0x5807('0x9'),'appdata':_0x2d340e['alias']?_0x5807('0x13')+_0x2d340e[_0x5807('0x7')]:_0x5807('0xa'),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e[_0x5807('0x5')],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':_0x5807('0x8'),'appdata':_0x5807('0x14')+(_0x2d340e['cutdigits']?'${EXTEN:'+_0x2d340e[_0x5807('0x15')]+'}':_0x5807('0x16')),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e['exten'],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':_0x5807('0x8'),'appdata':'CDR(routeid)='+_0x2d340e['id'],'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e[_0x5807('0x5')],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':'ExecIf','appdata':_0x5807('0x17')+(_0x563d44+0x2)+_0x5807('0x18')+(_0x563d44+0x1)+')','context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e[_0x5807('0x5')],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':'outbound','app':'Set','appdata':_0x2d340e[_0x5807('0x15')]?'CDR(prefix)=${EXTEN:0:'+_0x2d340e[_0x5807('0x15')]+'}':_0x5807('0x19'),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e['exten'],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e['exten'],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':'Set','appdata':_0x5807('0xf'),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e[_0x5807('0x5')],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':_0x5807('0x8'),'appdata':_0x5807('0x10'),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e['exten'],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':_0x5807('0x11'),'app':_0x5807('0x8'),'appdata':'outboundrouteid='+_0x2d340e['id'],'context':_0x2d340e['context'],'exten':_0x2d340e[_0x5807('0x5')],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']}];if(_0x2d340e[_0x5807('0x1a')](_0x5807('0x1b'))&&_0x2d340e[_0x5807('0x1b')]!==_0x5807('0x1c')){_0x153536[_0x5807('0xc')]({'type':'outbound','app':_0x5807('0x8'),'appdata':_0x5807('0x1d'),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e[_0x5807('0x5')],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']},{'type':'outbound','app':_0x5807('0x8'),'appdata':_0x5807('0x1e')+_0x2d340e[_0x5807('0x1b')]||_0x5807('0x1f'),'context':_0x2d340e[_0x5807('0x4')],'exten':_0x2d340e[_0x5807('0x5')],'priority':_0x563d44++,'VoiceExtensionId':_0x2d340e['id']});}return _0x153536;}function _0x51c93f(_0x3eb149,_0x20422c){var _0x10a7d5=[{'name':_0x5807('0x20'),'param':0x0},{'name':_0x5807('0x21'),'param':0x1},{'name':_0x5807('0x22'),'param':0x2},{'name':_0x5807('0x23'),'param':0x3}];var _0x4ebcc2={};var _0x18209e=_0x20422c[_0x5807('0x24')](',');var _0x5f289c=[];for(var _0x3ed257=0x0;_0x3ed257<_0x10a7d5[_0x5807('0x25')];_0x3ed257++){switch(_0x10a7d5[_0x3ed257]['name']){case _0x5807('0x20'):_0x4ebcc2[_0x5807('0x20')]=_0x18209e[_0x10a7d5[_0x3ed257][_0x5807('0x26')]]['split']('/')[0x1];_0x4ebcc2['phone']=_0x18209e[_0x10a7d5[_0x3ed257]['param']]['split']('/')[0x2];_0x4ebcc2[_0x5807('0x27')]=_0x4ebcc2[_0x5807('0x28')]?_0x4ebcc2[_0x5807('0x28')][_0x5807('0x24')]('$')[0x0]:undefined;_0x4ebcc2[_0x5807('0x28')]=_0x3eb149[_0x5807('0x15')]?(_0x4ebcc2[_0x5807('0x27')]||'')+_0x5807('0x29')+_0x3eb149[_0x5807('0x15')]+'}':(_0x4ebcc2[_0x5807('0x27')]||'')+_0x5807('0x16');_0x5f289c[_0x10a7d5[_0x3ed257]['param']]=[_0x5807('0x2a'),_0x4ebcc2[_0x5807('0x20')],_0x4ebcc2[_0x5807('0x28')]][_0x5807('0x2b')]('/');break;case _0x5807('0x22'):_0x4ebcc2[_0x5807('0x22')]=_0x18209e[_0x10a7d5[_0x3ed257][_0x5807('0x26')]];if(_0x3eb149[_0x5807('0x1b')]!==_0x5807('0x1c')){if(_0x4ebcc2['options'][_0x5807('0x2c')](_0x5807('0x2d'))<0x0){_0x4ebcc2['options']+=_0x5807('0x2d');}}else{_0x4ebcc2[_0x5807('0x22')]=_0x4ebcc2['options']['replace'](_0x5807('0x2d'),'');}_0x5f289c[_0x10a7d5[_0x3ed257][_0x5807('0x26')]]=_0x4ebcc2[_0x5807('0x22')];break;default:_0x5f289c[_0x10a7d5[_0x3ed257][_0x5807('0x26')]]=_0x18209e[_0x10a7d5[_0x3ed257][_0x5807('0x26')]];}}return _0x5f289c[_0x5807('0x2b')](',');}function _0x282eab(_0x3c6256,_0x5d4e69,_0x19f17d){return new Promise(function(_0x3b7154,_0x1e928b){var _0x57879e=[];if(_[_0x5807('0x2e')](_0x5d4e69))return _0x3b7154(_0x57879e);_0x5efb54[_0x5807('0x2f')]['findAll']({'attributes':['id','interval',_0x5807('0x30')],'raw':!![]})[_0x5807('0x31')](function(_0x4001da){for(var _0x3f8f1b=0x0,_0x4f429b=0x0;_0x3f8f1b<_0x5d4e69[_0x5807('0x25')];_0x3f8f1b++,_0x4f429b=0x0){var _0x5015a9=_0x5d4e69[_0x3f8f1b];var _0x274d47=[];var _0x51e368=[];delete _0x5015a9['id'];if(_0x5015a9[_0x5807('0x32')]!==_0x5807('0x33')){_0x5015a9[_0x5807('0x34')]=[_0x5015a9[_0x5807('0x32')]];}else{_0x5015a9[_0x5807('0x34')]=_0x5015a9[_0x5807('0x30')]?_[_0x5807('0x35')](_['filter'](_0x4001da,{'IntervalId':_0x5015a9[_0x5807('0x30')]}),_0x5807('0x32')):[];}_0x5015a9['context']=_0x3c6256[_0x5807('0x4')];_0x5015a9[_0x5807('0x5')]=_0x3c6256[_0x5807('0x5')];if(_0x5015a9[_0x5807('0x6')])_0x5015a9[_0x5807('0x6')]=_0x5015a9[_0x5807('0x6')][_0x5807('0x36')]();if(_0x3c6256[_0x5807('0x6')]==='outbound'){if(_0x5015a9[_0x5807('0x1a')](_0x5807('0x37'))&&_0x5015a9[_0x5807('0x37')]&&_0x5015a9['tag']!=='--'){_0x274d47['push']({'type':_0x5015a9['type']['toLowerCase'](),'app':'Set','appdata':_0x5807('0x38')+_0x5015a9[_0x5807('0x37')],'context':_0x3c6256['context'],'exten':_0x3c6256[_0x5807('0x5')],'priority':_0x5015a9[_0x5807('0x34')][_0x5807('0x25')]+_0x19f17d+_0x4f429b++,'VoiceExtensionId':_0x3c6256['id']});}_0x274d47[_0x5807('0xc')]({'type':_0x5015a9[_0x5807('0x6')]['toLowerCase'](),'app':'ExecIf','appdata':_0x5807('0x39')+(_0x5015a9[_0x5807('0x3a')]?_0x5807('0x3b')+_0x5015a9[_0x5807('0x3a')]+')':'NoOp(No\x20number\x20available)'),'context':_0x3c6256[_0x5807('0x4')],'exten':_0x3c6256[_0x5807('0x5')],'priority':_0x5015a9[_0x5807('0x34')][_0x5807('0x25')]+_0x19f17d+_0x4f429b++,'VoiceExtensionId':_0x3c6256['id']});}else{if(_0x5015a9['hasOwnProperty']('answer')){if(['queue',_0x5807('0x3c')][_0x5807('0x3d')](_0x5015a9[_0x5807('0x3e')]['toLowerCase']())&&_0x5015a9['appType']!==_0x5807('0x3f')){if(_0x5015a9[_0x5807('0x40')]){_0x274d47[_0x5807('0xc')]({'type':_0x5015a9[_0x5807('0x6')]['toLowerCase'](),'app':_0x5807('0x41'),'appdata':_0x5807('0x42'),'context':_0x3c6256['context'],'exten':_0x3c6256[_0x5807('0x5')],'priority':_0x5015a9[_0x5807('0x34')][_0x5807('0x25')]+_0x19f17d+_0x4f429b++,'VoiceExtensionId':_0x3c6256['id']});_0x274d47['push']({'type':_0x5015a9[_0x5807('0x6')][_0x5807('0x36')](),'app':_0x5807('0x8'),'appdata':_0x5807('0x43'),'context':_0x3c6256[_0x5807('0x4')],'exten':_0x3c6256[_0x5807('0x5')],'priority':_0x5015a9[_0x5807('0x34')][_0x5807('0x25')]+_0x19f17d+_0x4f429b++,'VoiceExtensionId':_0x3c6256['id']});}else{_0x274d47['push']({'type':_0x5015a9[_0x5807('0x6')][_0x5807('0x36')](),'app':_0x5807('0x41'),'appdata':_0x5807('0x44'),'context':_0x3c6256[_0x5807('0x4')],'exten':_0x3c6256[_0x5807('0x5')],'priority':_0x5015a9[_0x5807('0x34')][_0x5807('0x25')]+_0x19f17d+_0x4f429b++,'VoiceExtensionId':_0x3c6256['id']});_0x274d47[_0x5807('0xc')]({'type':_0x5015a9[_0x5807('0x6')]['toLowerCase'](),'app':_0x5807('0x8'),'appdata':_0x5807('0x45'),'context':_0x3c6256[_0x5807('0x4')],'exten':_0x3c6256['exten'],'priority':_0x5015a9[_0x5807('0x34')][_0x5807('0x25')]+_0x19f17d+_0x4f429b++,'VoiceExtensionId':_0x3c6256['id']});}}}}for(var _0x3adebd=0x0;_0x3adebd<_0x5015a9[_0x5807('0x34')][_0x5807('0x25')];_0x3adebd++){var _0x1092e8=_0x19f17d+_0x5015a9[_0x5807('0x34')][_0x5807('0x25')];var _0x3fb2ee=_0x3adebd===_0x5015a9[_0x5807('0x34')]['length']-0x1?_0x19f17d+_0x274d47[_0x5807('0x25')]+_0x51e368[_0x5807('0x25')]+0x2:_0x19f17d+_0x3adebd+0x1;_0x274d47[_0x5807('0x46')](_0x3adebd,0x0,{'type':_0x3c6256['type'],'app':_0x5807('0x47'),'appdata':_0x5015a9[_0x5807('0x34')][_0x3adebd]+'?'+_0x3c6256[_0x5807('0x4')]+',${EXTEN},'+_0x1092e8+':'+_0x3c6256['context']+',${EXTEN},'+_0x3fb2ee,'exten':_0x3c6256[_0x5807('0x5')],'context':_0x3c6256['context'],'priority':_0x19f17d+_0x3adebd,'VoiceExtensionId':_0x3c6256['id']});}if(_0x5015a9[_0x5807('0x48')]===_0x5807('0x49'))_0x5015a9[_0x5807('0x4a')]=_0x51c93f(_0x3c6256,_0x5015a9[_0x5807('0x4a')]);_0x5015a9[_0x5807('0x4b')]=_0x274d47[_0x5807('0x25')]?_[_0x5807('0x4c')](_0x274d47)[_0x5807('0x4b')]+0x1:_0x19f17d;_0x57879e=_[_0x5807('0x4d')](_0x57879e,_0x274d47,[_0x5015a9],_0x51e368);_0x19f17d=_[_0x5807('0x4c')](_0x57879e)[_0x5807('0x4b')]+0x1;}return _0x3b7154(_0x57879e);})[_0x5807('0x4e')](function(_0x183dec){_0x1e928b(_0x183dec);});});}return _0x1b99c5[_0x5807('0x4f')](_0x5807('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5ed144){var _0x1af270=this[_0x5807('0x51')]({'plain':!![]});var _0x400391=_0x1af270[_0x5807('0x6')]==='outbound'?_0x3db6ea(_0x1af270):_0x11de2e(_0x1af270);return _0x282eab(_0x1af270,_0x5ed144,_[_0x5807('0x4c')](_0x400391)[_0x5807('0x4b')]+0x1)[_0x5807('0x31')](function(_0x1841a8){var _0xa83821=_['concat'](_0x400391,_0x1841a8);_0xa83821[_0x5807('0xc')]({'type':_0x1af270['type'],'app':_0x5807('0x52'),'exten':_0x1af270['exten'],'context':_0x1af270[_0x5807('0x4')],'priority':_[_0x5807('0x4c')](_0xa83821)[_0x5807('0x4b')]+0x1,'VoiceExtensionId':_0x1af270['id']});return _0xa83821;});}}});}; \ No newline at end of file +var _0xe93b=['*,*,*,*','intervals','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','queue','playback','includes','app','appType','custom','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','CDR(type)=outbound','outbound','No\x20alias\x20set','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','param','phone','prefix','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0xe93b,0x1c2));var _0xbe93=function(_0x328837,_0x4423c8){_0x328837=_0x328837-0x0;var _0x10993e=_0xe93b[_0x328837];return _0x10993e;};'use strict';var _=require('lodash');var attributes=require(_0xbe93('0x0'));module[_0xbe93('0x1')]=function(_0x32bd75){var _0x4e4141=_0x32bd75[_0xbe93('0x2')];function _0x1b21c8(_0x39a786){var _0xf6395=0x2;var _0xc103ec=[{'type':_0x39a786[_0xbe93('0x3')],'app':_0xbe93('0x4'),'appdata':_0xbe93('0x5')+_0x39a786['type'],'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']},{'type':_0x39a786[_0xbe93('0x3')],'app':_0x39a786[_0xbe93('0x8')]?_0xbe93('0x4'):_0xbe93('0x9'),'appdata':_0x39a786[_0xbe93('0x8')]?_0xbe93('0xa')+_0x39a786[_0xbe93('0x8')]:'No\x20alias\x20set','context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']}];if(_0x39a786[_0xbe93('0x3')]===_0xbe93('0xb')){_0xc103ec[_0xbe93('0xc')]({'type':_0xbe93('0xb'),'app':'Set','appdata':_0xbe93('0xd')+_0x39a786['id'],'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']});}_0xc103ec['push']({'type':_0x39a786['type'],'app':_0xbe93('0x4'),'appdata':_0xbe93('0xe'),'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786['exten'],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']},{'type':_0x39a786['type'],'app':_0xbe93('0x4'),'appdata':_0xbe93('0xf'),'context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']},{'type':_0x39a786[_0xbe93('0x3')],'app':_0xbe93('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x39a786[_0xbe93('0x6')],'exten':_0x39a786[_0xbe93('0x7')],'priority':_0xf6395++,'VoiceExtensionId':_0x39a786['id']});return _0xc103ec;}function _0x481af3(_0x13f6f5){var _0x4506fc=0x2;var _0x4c2841=[{'type':'outbound','app':_0xbe93('0x4'),'appdata':_0xbe93('0x10'),'context':_0x13f6f5['context'],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0x13f6f5[_0xbe93('0x8')]?_0xbe93('0x4'):_0xbe93('0x9'),'appdata':_0x13f6f5[_0xbe93('0x8')]?_0xbe93('0xa')+_0x13f6f5['alias']:_0xbe93('0x12'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':'CDR(destination)='+(_0x13f6f5[_0xbe93('0x13')]?_0xbe93('0x14')+_0x13f6f5[_0xbe93('0x13')]+'}':_0xbe93('0x15')),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':'outbound','app':_0xbe93('0x4'),'appdata':_0xbe93('0xd')+_0x13f6f5['id'],'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':'outbound','app':_0xbe93('0x16'),'appdata':_0xbe93('0x17')+(_0x4506fc+0x2)+_0xbe93('0x18')+(_0x4506fc+0x1)+')','context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0x13f6f5[_0xbe93('0x13')]?_0xbe93('0x19')+_0x13f6f5[_0xbe93('0x13')]+'}':_0xbe93('0x1a'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0xbe93('0xe'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x13f6f5['context'],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0xbe93('0x1b')+_0x13f6f5['id'],'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']}];if(_0x13f6f5[_0xbe93('0x1c')](_0xbe93('0x1d'))&&_0x13f6f5[_0xbe93('0x1d')]!==_0xbe93('0x1e')){_0x4c2841[_0xbe93('0xc')]({'type':_0xbe93('0x11'),'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5[_0xbe93('0x7')],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']},{'type':_0xbe93('0x11'),'app':_0xbe93('0x4'),'appdata':_0xbe93('0x1f')+_0x13f6f5['recordingFormat']||_0xbe93('0x20'),'context':_0x13f6f5[_0xbe93('0x6')],'exten':_0x13f6f5['exten'],'priority':_0x4506fc++,'VoiceExtensionId':_0x13f6f5['id']});}return _0x4c2841;}function _0x11a166(_0x107597,_0x3ed4a0){var _0x152173=[{'name':_0xbe93('0x21'),'param':0x0},{'name':_0xbe93('0x22'),'param':0x1},{'name':_0xbe93('0x23'),'param':0x2},{'name':_0xbe93('0x24'),'param':0x3}];var _0x57bf56={};var _0x11baa2=_0x3ed4a0[_0xbe93('0x25')](',');var _0x378edc=[];for(var _0x1ff4be=0x0;_0x1ff4be<_0x152173[_0xbe93('0x26')];_0x1ff4be++){switch(_0x152173[_0x1ff4be][_0xbe93('0x27')]){case _0xbe93('0x21'):_0x57bf56['trunk']=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]][_0xbe93('0x25')]('/')[0x1];_0x57bf56[_0xbe93('0x29')]=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]][_0xbe93('0x25')]('/')[0x2];_0x57bf56[_0xbe93('0x2a')]=_0x57bf56[_0xbe93('0x29')]?_0x57bf56[_0xbe93('0x29')]['split']('$')[0x0]:undefined;_0x57bf56[_0xbe93('0x29')]=_0x107597[_0xbe93('0x13')]?(_0x57bf56[_0xbe93('0x2a')]||'')+_0xbe93('0x14')+_0x107597[_0xbe93('0x13')]+'}':(_0x57bf56['prefix']||'')+'${EXTEN}';_0x378edc[_0x152173[_0x1ff4be][_0xbe93('0x28')]]=[_0xbe93('0x2b'),_0x57bf56[_0xbe93('0x21')],_0x57bf56[_0xbe93('0x29')]][_0xbe93('0x2c')]('/');break;case _0xbe93('0x23'):_0x57bf56[_0xbe93('0x23')]=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]];if(_0x107597['recordingFormat']!==_0xbe93('0x1e')){if(_0x57bf56[_0xbe93('0x23')][_0xbe93('0x2d')](_0xbe93('0x2e'))<0x0){_0x57bf56['options']+=_0xbe93('0x2e');}}else{_0x57bf56[_0xbe93('0x23')]=_0x57bf56[_0xbe93('0x23')][_0xbe93('0x2f')]('U(xcally-mixmonitor-context)','');}_0x378edc[_0x152173[_0x1ff4be][_0xbe93('0x28')]]=_0x57bf56[_0xbe93('0x23')];break;default:_0x378edc[_0x152173[_0x1ff4be][_0xbe93('0x28')]]=_0x11baa2[_0x152173[_0x1ff4be][_0xbe93('0x28')]];}}return _0x378edc[_0xbe93('0x2c')](',');}function _0xe35b66(_0x15eb6f,_0x4dc751,_0x1671ed){return new Promise(function(_0xeb5628,_0x3f1062){var _0x160492=[];if(_[_0xbe93('0x30')](_0x4dc751))return _0xeb5628(_0x160492);_0x4e4141[_0xbe93('0x31')][_0xbe93('0x32')]({'attributes':['id',_0xbe93('0x33'),_0xbe93('0x34')],'raw':!![]})[_0xbe93('0x35')](function(_0x27c52e){for(var _0x48af0e=0x0,_0x3d287c=0x0;_0x48af0e<_0x4dc751[_0xbe93('0x26')];_0x48af0e++,_0x3d287c=0x0){var _0x3d1fc4=_0x4dc751[_0x48af0e];var _0x26718b=[];var _0x24e195=[];delete _0x3d1fc4['id'];if(_0x3d1fc4['interval']!==_0xbe93('0x36')){_0x3d1fc4[_0xbe93('0x37')]=[_0x3d1fc4[_0xbe93('0x33')]];}else{_0x3d1fc4[_0xbe93('0x37')]=_0x3d1fc4['IntervalId']?_['map'](_['filter'](_0x27c52e,{'IntervalId':_0x3d1fc4[_0xbe93('0x34')]}),'interval'):[];}_0x3d1fc4[_0xbe93('0x6')]=_0x15eb6f[_0xbe93('0x6')];_0x3d1fc4[_0xbe93('0x7')]=_0x15eb6f['exten'];if(_0x3d1fc4[_0xbe93('0x3')])_0x3d1fc4['type']=_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')]();if(_0x15eb6f[_0xbe93('0x3')]===_0xbe93('0x11')){if(_0x3d1fc4['hasOwnProperty'](_0xbe93('0x39'))&&_0x3d1fc4[_0xbe93('0x39')]&&_0x3d1fc4['tag']!=='--'){_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4['type']['toLowerCase'](),'app':'Set','appdata':_0xbe93('0x3a')+_0x3d1fc4['tag'],'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f['exten'],'priority':_0x3d1fc4[_0xbe93('0x37')]['length']+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}_0x26718b['push']({'type':_0x3d1fc4['type']['toLowerCase'](),'app':_0xbe93('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3d1fc4[_0xbe93('0x3b')]?_0xbe93('0x3c')+_0x3d1fc4[_0xbe93('0x3b')]+')':'NoOp(No\x20number\x20available)'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4['intervals'][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}else{if(_0x3d1fc4[_0xbe93('0x1c')]('answer')){if([_0xbe93('0x3d'),_0xbe93('0x3e')][_0xbe93('0x3f')](_0x3d1fc4[_0xbe93('0x40')][_0xbe93('0x38')]())&&_0x3d1fc4[_0xbe93('0x41')]!==_0xbe93('0x42')){if(_0x3d1fc4[_0xbe93('0x43')]){_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4['type'][_0xbe93('0x38')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f['exten'],'priority':_0x3d1fc4[_0xbe93('0x37')]['length']+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')](),'app':'Set','appdata':_0xbe93('0x44'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4['intervals'][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}else{_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')](),'app':'ExecIf','appdata':_0xbe93('0x45'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4[_0xbe93('0x37')][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});_0x26718b[_0xbe93('0xc')]({'type':_0x3d1fc4[_0xbe93('0x3')][_0xbe93('0x38')](),'app':_0xbe93('0x4'),'appdata':_0xbe93('0x46'),'context':_0x15eb6f[_0xbe93('0x6')],'exten':_0x15eb6f[_0xbe93('0x7')],'priority':_0x3d1fc4['intervals'][_0xbe93('0x26')]+_0x1671ed+_0x3d287c++,'VoiceExtensionId':_0x15eb6f['id']});}}}}for(var _0x16e9f3=0x0;_0x16e9f3<_0x3d1fc4['intervals'][_0xbe93('0x26')];_0x16e9f3++){var _0x5525b4=_0x1671ed+_0x3d1fc4[_0xbe93('0x37')][_0xbe93('0x26')];var _0x4d0447=_0x16e9f3===_0x3d1fc4[_0xbe93('0x37')][_0xbe93('0x26')]-0x1?_0x1671ed+_0x26718b['length']+_0x24e195['length']+0x2:_0x1671ed+_0x16e9f3+0x1;_0x26718b[_0xbe93('0x47')](_0x16e9f3,0x0,{'type':_0x15eb6f[_0xbe93('0x3')],'app':_0xbe93('0x48'),'appdata':_0x3d1fc4[_0xbe93('0x37')][_0x16e9f3]+'?'+_0x15eb6f[_0xbe93('0x6')]+_0xbe93('0x49')+_0x5525b4+':'+_0x15eb6f[_0xbe93('0x6')]+_0xbe93('0x49')+_0x4d0447,'exten':_0x15eb6f[_0xbe93('0x7')],'context':_0x15eb6f['context'],'priority':_0x1671ed+_0x16e9f3,'VoiceExtensionId':_0x15eb6f['id']});}if(_0x3d1fc4[_0xbe93('0x41')]==='outboundDial')_0x3d1fc4[_0xbe93('0x4a')]=_0x11a166(_0x15eb6f,_0x3d1fc4['appdata']);_0x3d1fc4[_0xbe93('0x4b')]=_0x26718b['length']?_[_0xbe93('0x4c')](_0x26718b)[_0xbe93('0x4b')]+0x1:_0x1671ed;_0x160492=_[_0xbe93('0x4d')](_0x160492,_0x26718b,[_0x3d1fc4],_0x24e195);_0x1671ed=_[_0xbe93('0x4c')](_0x160492)[_0xbe93('0x4b')]+0x1;}return _0xeb5628(_0x160492);})[_0xbe93('0x4e')](function(_0x4fb3da){_0x3f1062(_0x4fb3da);});});}return _0x32bd75[_0xbe93('0x4f')](_0xbe93('0x50'),attributes,{'tableName':_0xbe93('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1e5e34){var _0x269229=this[_0xbe93('0x52')]({'plain':!![]});var _0x26d74c=_0x269229[_0xbe93('0x3')]==='outbound'?_0x481af3(_0x269229):_0x1b21c8(_0x269229);return _0xe35b66(_0x269229,_0x1e5e34,_[_0xbe93('0x4c')](_0x26d74c)[_0xbe93('0x4b')]+0x1)['then'](function(_0x4a8e7b){var _0x27f137=_[_0xbe93('0x4d')](_0x26d74c,_0x4a8e7b);_0x27f137[_0xbe93('0xc')]({'type':_0x269229[_0xbe93('0x3')],'app':_0xbe93('0x53'),'exten':_0x269229[_0xbe93('0x7')],'context':_0x269229[_0xbe93('0x6')],'priority':_['last'](_0x27f137)[_0xbe93('0x4b')]+0x1,'VoiceExtensionId':_0x269229['id']});return _0x27f137;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index b333ba3..79675c4 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 _0x00f0=['request\x20sent','result','catch','GetVoiceExtension','findAll','options','where','limit','include','map','model','attributes','then','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','VoiceExtension,\x20%s,\x20%s'];(function(_0xd7df6d,_0x2e784b){var _0x304544=function(_0x4e6594){while(--_0x4e6594){_0xd7df6d['push'](_0xd7df6d['shift']());}};_0x304544(++_0x2e784b);}(_0x00f0,0xec));var _0x000f=function(_0x988952,_0x5790e3){_0x988952=_0x988952-0x0;var _0x5534bb=_0x00f0[_0x988952];return _0x5534bb;};'use strict';var _=require(_0x000f('0x0'));var util=require(_0x000f('0x1'));var moment=require(_0x000f('0x2'));var BPromise=require(_0x000f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x000f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x000f('0x5'))('rpc');var config=require(_0x000f('0x6'));var jayson=require(_0x000f('0x7'));var client=jayson['client'][_0x000f('0x8')]({'port':0x232a});config[_0x000f('0x9')]=_[_0x000f('0xa')](config[_0x000f('0x9')],{'host':_0x000f('0xb'),'port':0x18eb});var socket=require(_0x000f('0xc'))(new Redis(config[_0x000f('0x9')]));require(_0x000f('0xd'))[_0x000f('0xe')](socket);function respondWithRpcPromise(_0x278cd8,_0x190417,_0x504f65){return new BPromise(function(_0x59749b,_0x1a8ebf){return client[_0x000f('0xf')](_0x278cd8,_0x504f65)['then'](function(_0x2bac47){logger[_0x000f('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x190417,'request\x20sent');logger[_0x000f('0x11')](_0x000f('0x12'),_0x190417,'request\x20sent',JSON['stringify'](_0x2bac47));if(_0x2bac47[_0x000f('0x13')]){if(_0x2bac47[_0x000f('0x13')][_0x000f('0x14')]===0x1f4){logger[_0x000f('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x190417,_0x2bac47[_0x000f('0x13')]['message']);return _0x1a8ebf(_0x2bac47['error'][_0x000f('0x15')]);}logger['error'](_0x000f('0x16'),_0x190417,_0x2bac47[_0x000f('0x13')][_0x000f('0x15')]);return _0x59749b(_0x2bac47[_0x000f('0x13')][_0x000f('0x15')]);}else{logger[_0x000f('0x10')](_0x000f('0x16'),_0x190417,_0x000f('0x17'));_0x59749b(_0x2bac47[_0x000f('0x18')][_0x000f('0x15')]);}})[_0x000f('0x19')](function(_0x156342){logger[_0x000f('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x190417,_0x156342);_0x1a8ebf(_0x156342);});});}exports[_0x000f('0x1a')]=function(_0x26aad4){var _0x53f06f=this;return new Promise(function(_0x2cdb5c,_0x51e8c7){return db['VoiceExtension'][_0x000f('0x1b')]({'raw':_0x26aad4[_0x000f('0x1c')]?_0x26aad4[_0x000f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x26aad4['options']?_0x26aad4[_0x000f('0x1c')][_0x000f('0x1d')]||null:null,'attributes':_0x26aad4['options']?_0x26aad4[_0x000f('0x1c')]['attributes']||null:null,'limit':_0x26aad4[_0x000f('0x1c')]?_0x26aad4['options'][_0x000f('0x1e')]||null:null,'include':_0x26aad4[_0x000f('0x1c')]?_0x26aad4[_0x000f('0x1c')][_0x000f('0x1f')]?_[_0x000f('0x20')](_0x26aad4[_0x000f('0x1c')]['include'],function(_0x461d33){return{'model':db[_0x461d33[_0x000f('0x21')]],'as':_0x461d33['as'],'attributes':_0x461d33[_0x000f('0x22')],'include':_0x461d33['include']?_[_0x000f('0x20')](_0x461d33[_0x000f('0x1f')],function(_0x1d541b){return{'model':db[_0x1d541b[_0x000f('0x21')]],'as':_0x1d541b['as'],'attributes':_0x1d541b[_0x000f('0x22')],'include':_0x1d541b[_0x000f('0x1f')]?_[_0x000f('0x20')](_0x1d541b['include'],function(_0x11c2a2){return{'model':db[_0x11c2a2[_0x000f('0x21')]],'as':_0x11c2a2['as'],'attributes':_0x11c2a2[_0x000f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x000f('0x23')](function(_0x49ac76){logger[_0x000f('0x10')]('GetVoiceExtension',_0x26aad4);logger[_0x000f('0x11')](_0x000f('0x1a'),_0x26aad4,JSON[_0x000f('0x24')](_0x49ac76));_0x2cdb5c(_0x49ac76);})[_0x000f('0x19')](function(_0x1532c8){logger['error'](_0x000f('0x1a'),_0x1532c8[_0x000f('0x15')],_0x26aad4);_0x51e8c7(_0x53f06f['error'](0x1f4,_0x1532c8[_0x000f('0x15')]));});});}; \ No newline at end of file +var _0x9576=['attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','../../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','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where'];(function(_0x581f8e,_0x5617cb){var _0x18aec=function(_0x4536c7){while(--_0x4536c7){_0x581f8e['push'](_0x581f8e['shift']());}};_0x18aec(++_0x5617cb);}(_0x9576,0x182));var _0x6957=function(_0x3d8c85,_0xbe9639){_0x3d8c85=_0x3d8c85-0x0;var _0x34a654=_0x9576[_0x3d8c85];return _0x34a654;};'use strict';var _=require(_0x6957('0x0'));var util=require(_0x6957('0x1'));var moment=require(_0x6957('0x2'));var BPromise=require(_0x6957('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6957('0x4'))['db'];var utils=require(_0x6957('0x5'));var logger=require(_0x6957('0x6'))(_0x6957('0x7'));var config=require(_0x6957('0x8'));var jayson=require(_0x6957('0x9'));var client=jayson[_0x6957('0xa')]['http']({'port':0x232a});config[_0x6957('0xb')]=_[_0x6957('0xc')](config[_0x6957('0xb')],{'host':_0x6957('0xd'),'port':0x18eb});var socket=require(_0x6957('0xe'))(new Redis(config[_0x6957('0xb')]));require('./voiceExtension.socket')[_0x6957('0xf')](socket);function respondWithRpcPromise(_0x1dded8,_0x483af0,_0x55078f){return new BPromise(function(_0x3e0520,_0x25c338){return client[_0x6957('0x10')](_0x1dded8,_0x55078f)[_0x6957('0x11')](function(_0x3e2f16){logger[_0x6957('0x12')](_0x6957('0x13'),_0x483af0,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x483af0,_0x6957('0x14'),JSON[_0x6957('0x15')](_0x3e2f16));if(_0x3e2f16[_0x6957('0x16')]){if(_0x3e2f16[_0x6957('0x16')][_0x6957('0x17')]===0x1f4){logger[_0x6957('0x16')](_0x6957('0x13'),_0x483af0,_0x3e2f16['error']['message']);return _0x25c338(_0x3e2f16['error'][_0x6957('0x18')]);}logger[_0x6957('0x16')](_0x6957('0x13'),_0x483af0,_0x3e2f16[_0x6957('0x16')]['message']);return _0x3e0520(_0x3e2f16[_0x6957('0x16')]['message']);}else{logger[_0x6957('0x12')](_0x6957('0x13'),_0x483af0,'request\x20sent');_0x3e0520(_0x3e2f16[_0x6957('0x19')][_0x6957('0x18')]);}})[_0x6957('0x1a')](function(_0x4c527c){logger[_0x6957('0x16')](_0x6957('0x13'),_0x483af0,_0x4c527c);_0x25c338(_0x4c527c);});});}exports[_0x6957('0x1b')]=function(_0x135893){var _0x1ce753=this;return new Promise(function(_0x26d3fd,_0x35ee5b){return db[_0x6957('0x1c')]['findAll']({'raw':_0x135893['options']?_0x135893[_0x6957('0x1d')][_0x6957('0x1e')]===undefined?!![]:![]:!![],'where':_0x135893[_0x6957('0x1d')]?_0x135893[_0x6957('0x1d')][_0x6957('0x1f')]||null:null,'attributes':_0x135893[_0x6957('0x1d')]?_0x135893[_0x6957('0x1d')][_0x6957('0x20')]||null:null,'limit':_0x135893['options']?_0x135893[_0x6957('0x1d')][_0x6957('0x21')]||null:null,'include':_0x135893[_0x6957('0x1d')]?_0x135893[_0x6957('0x1d')]['include']?_['map'](_0x135893[_0x6957('0x1d')][_0x6957('0x22')],function(_0x5c4e49){return{'model':db[_0x5c4e49['model']],'as':_0x5c4e49['as'],'attributes':_0x5c4e49[_0x6957('0x20')],'include':_0x5c4e49[_0x6957('0x22')]?_[_0x6957('0x23')](_0x5c4e49['include'],function(_0x330015){return{'model':db[_0x330015[_0x6957('0x24')]],'as':_0x330015['as'],'attributes':_0x330015[_0x6957('0x20')],'include':_0x330015[_0x6957('0x22')]?_[_0x6957('0x23')](_0x330015[_0x6957('0x22')],function(_0x2d33ef){return{'model':db[_0x2d33ef[_0x6957('0x24')]],'as':_0x2d33ef['as'],'attributes':_0x2d33ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x6957('0x11')](function(_0x3a6e07){logger[_0x6957('0x12')](_0x6957('0x1b'),_0x135893);logger[_0x6957('0x25')](_0x6957('0x1b'),_0x135893,JSON[_0x6957('0x15')](_0x3a6e07));_0x26d3fd(_0x3a6e07);})[_0x6957('0x1a')](function(_0x1300b1){logger[_0x6957('0x16')](_0x6957('0x1b'),_0x1300b1['message'],_0x135893);_0x35ee5b(_0x1ce753['error'](0x1f4,_0x1300b1[_0x6957('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 7389c34..d62a827 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 _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x519327,_0x105bfd){var _0x5e595d=function(_0x5644e3){while(--_0x5644e3){_0x519327['push'](_0x519327['shift']());}};_0x5e595d(++_0x105bfd);}(_0x5fab,0x177));var _0xb5fa=function(_0x2903d4,_0x35d7c1){_0x2903d4=_0x2903d4-0x0;var _0x2d966f=_0x5fab[_0x2903d4];return _0x2d966f;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x32cda3,_0xf915c3){var _0x3d3b6e=function(_0x5d385d){while(--_0x5d385d){_0x32cda3['push'](_0x32cda3['shift']());}};_0x3d3b6e(++_0xf915c3);}(_0x7a54,0x106));var _0x47a5=function(_0x3c350f,_0x4dadd0){_0x3c350f=_0x3c350f-0x0;var _0x55469f=_0x7a54[_0x3c350f];return _0x55469f;};'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 4e89880..bef6b08 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 _0x8aad=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','show','/:id/messages','post','create','put','/:id','update'];(function(_0x53100a,_0x26681f){var _0x25606a=function(_0x1b6310){while(--_0x1b6310){_0x53100a['push'](_0x53100a['shift']());}};_0x25606a(++_0x26681f);}(_0x8aad,0x146));var _0xd8aa=function(_0x5bfbf7,_0x558a61){_0x5bfbf7=_0x5bfbf7-0x0;var _0x5cc05=_0x8aad[_0x5bfbf7];return _0x5cc05;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var fs_extra=require(_0xd8aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8aa('0x5'));var controller=require('./voiceMail.controller');router['get']('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x7')]);router[_0xd8aa('0x8')]('/:id',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x8')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd8aa('0xb')]('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0xd')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x11')]);module[_0xd8aa('0x12')]=router; \ No newline at end of file +var _0xa6b0=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x57642f,_0x1cadbc){var _0x43a4a8=function(_0x57f9f4){while(--_0x57f9f4){_0x57642f['push'](_0x57642f['shift']());}};_0x43a4a8(++_0x1cadbc);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x10972b,_0xd1b41c){_0x10972b=_0x10972b-0x0;var _0x64fda1=_0xa6b0[_0x10972b];return _0x64fda1;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var fs_extra=require(_0x0a6b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a6b('0x5'));var config=require(_0x0a6b('0x6'));var controller=require(_0x0a6b('0x7'));router[_0x0a6b('0x8')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xa')]);router[_0x0a6b('0x8')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xc')]);router[_0x0a6b('0x8')](_0x0a6b('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x0a6b('0xe')]('/',auth[_0x0a6b('0x9')](),controller[_0x0a6b('0xf')]);router[_0x0a6b('0x10')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xb'),auth[_0x0a6b('0x9')](),controller[_0x0a6b('0x13')]);module[_0x0a6b('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 1e73229..8940f6d 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 _0x6861=['mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20'];(function(_0x1f16de,_0x548eb9){var _0x36cd80=function(_0x4e1a45){while(--_0x4e1a45){_0x1f16de['push'](_0x1f16de['shift']());}};_0x36cd80(++_0x548eb9);}(_0x6861,0x1b9));var _0x1686=function(_0x358339,_0xefcde4){_0x358339=_0x358339-0x0;var _0x8246a6=_0x6861[_0x358339];return _0x8246a6;};'use strict';var Sequelize=require(_0x1686('0x0'));module[_0x1686('0x1')]={'customer_id':{'type':Sequelize[_0x1686('0x2')]},'context':{'type':Sequelize[_0x1686('0x2')],'defaultValue':_0x1686('0x3'),'unique':_0x1686('0x4')},'mailbox':{'type':Sequelize[_0x1686('0x2')],'defaultValue':'','allowNull':![],'unique':_0x1686('0x4')},'password':{'type':Sequelize[_0x1686('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1686('0x2')],'validate':{'isEmail':!![]},'set':function(_0xde5db6){this[_0x1686('0x5')](_0x1686('0x6'),typeof _0xde5db6===_0x1686('0x7')&&_0xde5db6[_0x1686('0x8')]()?_0xde5db6[_0x1686('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x1686('0x2')],'defaultValue':_0x1686('0x9')},'attach':{'type':Sequelize['ENUM'](_0x1686('0xa'),'no'),'defaultValue':_0x1686('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1686('0xb')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x1686('0x2')]},'review':{'type':Sequelize['ENUM'](_0x1686('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1686('0xb')](_0x1686('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1686('0xb')](_0x1686('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1686('0xb')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1686('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x1686('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1686('0xb')](_0x1686('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1686('0xb')](_0x1686('0xa'),'no'),'defaultValue':_0x1686('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1686('0xb')](_0x1686('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1686('0xb')](_0x1686('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1686('0xb')](_0x1686('0xa'),'no'),'defaultValue':_0x1686('0xa'),'allowNull':![]},'stamp':{'type':_0x1686('0xd')},'emailsubject':{'type':Sequelize[_0x1686('0x2')]},'emailbody':{'type':Sequelize[_0x1686('0x2')]},'maxsecs':{'type':Sequelize[_0x1686('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1686('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1686('0xf')],'get':function(){return this[_0x1686('0x10')](_0x1686('0x11'))+_0x1686('0x12')+this['getDataValue'](_0x1686('0x13'));}}}; \ No newline at end of file +var _0x604c=['email','string','trim','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','contest_mailbox','setDataValue'];(function(_0x2fff7c,_0xfca01c){var _0x210753=function(_0x349512){while(--_0x349512){_0x2fff7c['push'](_0x2fff7c['shift']());}};_0x210753(++_0xfca01c);}(_0x604c,0x10c));var _0xc604=function(_0x2bc556,_0x5dbc77){_0x2bc556=_0x2bc556-0x0;var _0x1fc6f3=_0x604c[_0x2bc556];return _0x1fc6f3;};'use strict';var Sequelize=require('sequelize');module[_0xc604('0x0')]={'customer_id':{'type':Sequelize[_0xc604('0x1')]},'context':{'type':Sequelize[_0xc604('0x1')],'defaultValue':'from-voicemail','unique':_0xc604('0x2')},'mailbox':{'type':Sequelize[_0xc604('0x1')],'defaultValue':'','allowNull':![],'unique':_0xc604('0x2')},'password':{'type':Sequelize[_0xc604('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc604('0x1')],'validate':{'isEmail':!![]},'set':function(_0x21ff16){this[_0xc604('0x3')](_0xc604('0x4'),typeof _0x21ff16===_0xc604('0x5')&&_0x21ff16[_0xc604('0x6')]()?_0x21ff16[_0xc604('0x6')]():null);}},'pager':{'type':Sequelize[_0xc604('0x1')]},'tz':{'type':Sequelize[_0xc604('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xc604('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xc604('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xc604('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xc604('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc604('0x7')](_0xc604('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc604('0x7')](_0xc604('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc604('0x7')](_0xc604('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xc604('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc604('0x7')](_0xc604('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc604('0x7')]('yes','no'),'defaultValue':_0xc604('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc604('0x7')](_0xc604('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc604('0x7')](_0xc604('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xc604('0x8'),'allowNull':![]},'stamp':{'type':_0xc604('0x9')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xc604('0x1')]},'maxsecs':{'type':Sequelize[_0xc604('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc604('0xb')],'get':function(){return this[_0xc604('0xc')](_0xc604('0xd'))+_0xc604('0xe')+this[_0xc604('0xc')](_0xc604('0xf'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 1b3a965..d1b79f4 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 _0x3266=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','count','set','Content-Range','save','update','then','destroy','get','error','stack','name','send','index','VoiceMail','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','find'];(function(_0x4694c2,_0x110d75){var _0x5a3dcb=function(_0x4aabe8){while(--_0x4aabe8){_0x4694c2['push'](_0x4694c2['shift']());}};_0x5a3dcb(++_0x110d75);}(_0x3266,0x6a));var _0x6326=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x3266[_0x12f688];return _0x59c3de;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){var _0x72d020=_0x2d0d00[_0x6326('0x27')]({'plain':!![]});var _0x575701='Voicemails';return db['UserProfileResource'][_0x6326('0x26')]({'where':{'type':_0x575701,'resourceId':_0x72d020['id']}})['then'](function(){return _0x2d0d00;});})[_0x6326('0x25')](function(){_0x429bb0[_0x6326('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e33d,_0x21ec69){return function(_0xb68fec){if(!_0xb68fec){_0x15e33d[_0x6326('0x1c')](0x194);}return _0xb68fec;};}function handleError(_0x2d2180,_0x45d037){_0x45d037=_0x45d037||0x1f4;return function(_0x40e036){logger[_0x6326('0x28')](_0x40e036[_0x6326('0x29')]);if(_0x40e036[_0x6326('0x2a')]){delete _0x40e036[_0x6326('0x2a')];}_0x2d2180[_0x6326('0x1d')](_0x45d037)[_0x6326('0x2b')](_0x40e036);};}exports[_0x6326('0x2c')]=function(_0x2e0445,_0x20c5ab){var _0x520e57={},_0x2bf5ef={},_0x47303c={'count':0x0,'rows':[]};var _0x1f8982=_['map'](db[_0x6326('0x2d')]['rawAttributes'],function(_0x4e703a){return{'name':_0x4e703a[_0x6326('0x2e')],'type':_0x4e703a[_0x6326('0x2f')][_0x6326('0x30')]};});_0x2bf5ef[_0x6326('0x31')]=_[_0x6326('0x32')](_0x1f8982,_0x6326('0x2a'));_0x2bf5ef[_0x6326('0x33')]=_[_0x6326('0x34')](_0x2e0445[_0x6326('0x33')]);_0x2bf5ef[_0x6326('0x35')]=_[_0x6326('0x36')](_0x2bf5ef[_0x6326('0x31')],_0x2bf5ef['query']);_0x520e57[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2bf5ef['model'],qs[_0x6326('0x38')](_0x2e0445[_0x6326('0x33')][_0x6326('0x38')]));_0x520e57['attributes']=_0x520e57[_0x6326('0x37')]['length']?_0x520e57['attributes']:_0x2bf5ef[_0x6326('0x31')];if(!_0x2e0445[_0x6326('0x33')][_0x6326('0x39')]('nolimit')){_0x520e57[_0x6326('0x3a')]=qs['limit'](_0x2e0445[_0x6326('0x33')]['limit']);_0x520e57[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x2e0445[_0x6326('0x33')][_0x6326('0x1f')]);}_0x520e57[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x2e0445['query'][_0x6326('0x3c')]);_0x520e57[_0x6326('0x3d')]=qs['filters'](_[_0x6326('0x3e')](_0x2e0445['query'],_0x2bf5ef['filters']),_0x1f8982);if(_0x2e0445[_0x6326('0x33')][_0x6326('0x3f')]){_0x520e57[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x520e57[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x1f8982,function(_0x5de1c3){if(_0x5de1c3['type']!==_0x6326('0x41')){var _0x5b68af={};_0x5b68af[_0x5de1c3[_0x6326('0x2a')]]={'$like':'%'+_0x2e0445['query'][_0x6326('0x3f')]+'%'};return _0x5b68af;}})});}_0x520e57=_[_0x6326('0x40')]({},_0x520e57,_0x2e0445[_0x6326('0x42')]);var _0x1da798={'where':_0x520e57[_0x6326('0x3d')]};return db[_0x6326('0x2d')][_0x6326('0x20')](_0x1da798)[_0x6326('0x25')](function(_0x3b089b){_0x47303c[_0x6326('0x20')]=_0x3b089b;if(_0x2e0445[_0x6326('0x33')]['includeAll']){_0x520e57[_0x6326('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x6326('0x44')](_0x520e57);})[_0x6326('0x25')](function(_0x16fc33){_0x47303c[_0x6326('0x45')]=_0x16fc33;return _0x47303c;})['then'](respondWithFilteredResult(_0x20c5ab,_0x520e57))[_0x6326('0x46')](handleError(_0x20c5ab,null));};exports[_0x6326('0x47')]=function(_0x562d5f,_0x12703d){var _0xe6a992={'raw':!![],'where':{'id':_0x562d5f[_0x6326('0x48')]['id']}},_0x7a5057={};_0x7a5057['model']=_[_0x6326('0x34')](db[_0x6326('0x2d')][_0x6326('0x49')]);_0x7a5057[_0x6326('0x33')]=_[_0x6326('0x34')](_0x562d5f[_0x6326('0x33')]);_0x7a5057[_0x6326('0x35')]=_['intersection'](_0x7a5057[_0x6326('0x31')],_0x7a5057[_0x6326('0x33')]);_0xe6a992[_0x6326('0x37')]=_[_0x6326('0x36')](_0x7a5057['model'],qs[_0x6326('0x38')](_0x562d5f['query'][_0x6326('0x38')]));_0xe6a992[_0x6326('0x37')]=_0xe6a992[_0x6326('0x37')][_0x6326('0x4a')]?_0xe6a992[_0x6326('0x37')]:_0x7a5057['model'];if(_0x562d5f[_0x6326('0x33')]['includeAll']){_0xe6a992['include']=[{'all':!![]}];}_0xe6a992=_[_0x6326('0x40')]({},_0xe6a992,_0x562d5f[_0x6326('0x42')]);return db['VoiceMail'][_0x6326('0x4b')](_0xe6a992)[_0x6326('0x25')](handleEntityNotFound(_0x12703d,null))[_0x6326('0x25')](respondWithResult(_0x12703d,null))[_0x6326('0x46')](handleError(_0x12703d,null));};exports[_0x6326('0x4c')]=function(_0x4f8dc0,_0x4af0ee){return db[_0x6326('0x2d')][_0x6326('0x4c')](_0x4f8dc0[_0x6326('0x4d')],{})[_0x6326('0x25')](function(_0x210a1b){var _0x318d19=_0x4f8dc0[_0x6326('0x4e')]['get']({'plain':!![]});if(!_0x318d19)throw new Error(_0x6326('0x4f'));if(_0x318d19[_0x6326('0x50')]===_0x6326('0x4e')){var _0x3e7674=_0x210a1b[_0x6326('0x27')]({'plain':!![]});var _0x4ff8e6=_0x6326('0x51');return db['UserProfileSection'][_0x6326('0x4b')]({'where':{'name':_0x4ff8e6,'userProfileId':_0x318d19[_0x6326('0x52')]},'raw':!![]})['then'](function(_0x37b045){if(_0x37b045&&_0x37b045['autoAssociation']===0x0){return db[_0x6326('0x53')][_0x6326('0x4c')]({'name':_0x3e7674[_0x6326('0x2a')],'resourceId':_0x3e7674['id'],'type':_0x37b045[_0x6326('0x2a')],'sectionId':_0x37b045['id']},{})['then'](function(){return _0x210a1b;});}else{return _0x210a1b;}})[_0x6326('0x46')](function(_0xbe6b3e){logger['error'](_0x6326('0x54'),_0xbe6b3e);throw _0xbe6b3e;});}return _0x210a1b;})[_0x6326('0x25')](respondWithResult(_0x4af0ee,0xc9))[_0x6326('0x46')](handleError(_0x4af0ee,null));};exports['update']=function(_0x2bece1,_0x2ac64b){if(_0x2bece1['body']['id']){delete _0x2bece1[_0x6326('0x4d')]['id'];}return db['VoiceMail'][_0x6326('0x4b')]({'where':{'id':_0x2bece1[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x2ac64b,null))[_0x6326('0x25')](saveUpdates(_0x2bece1[_0x6326('0x4d')],null))[_0x6326('0x25')](respondWithResult(_0x2ac64b,null))[_0x6326('0x46')](handleError(_0x2ac64b,null));};exports['destroy']=function(_0x51adce,_0x4d4de7){return db[_0x6326('0x2d')]['find']({'where':{'id':_0x51adce[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4d4de7,null))[_0x6326('0x25')](removeEntity(_0x4d4de7,null))[_0x6326('0x46')](handleError(_0x4d4de7,null));};exports[_0x6326('0x55')]=function(_0x4b5bc6,_0x23bf64,_0x2e4244){return db['VoiceMail'][_0x6326('0x56')]({'where':{'id':_0x4b5bc6[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x23bf64,null))[_0x6326('0x25')](function(_0x45e3d5){var _0x36f2f5;var _0x320d43={},_0x2f624f={};_0x2f624f[_0x6326('0x31')]=_[_0x6326('0x34')](db['VoiceMailMessage'][_0x6326('0x49')]);_0x2f624f[_0x6326('0x33')]=_[_0x6326('0x34')](_0x4b5bc6[_0x6326('0x33')]);_0x2f624f['filters']=_['intersection'](_0x2f624f[_0x6326('0x31')],_0x2f624f[_0x6326('0x33')]);_0x320d43[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2f624f[_0x6326('0x31')],qs['fields'](_0x4b5bc6['query'][_0x6326('0x38')]));_0x320d43[_0x6326('0x37')]=_0x320d43[_0x6326('0x37')][_0x6326('0x4a')]?_0x320d43['attributes']:_0x2f624f[_0x6326('0x31')];if(!_0x4b5bc6[_0x6326('0x33')][_0x6326('0x39')](_0x6326('0x57'))){_0x320d43[_0x6326('0x3a')]=qs[_0x6326('0x3a')](_0x4b5bc6['query'][_0x6326('0x3a')]);_0x320d43['offset']=qs[_0x6326('0x1f')](_0x4b5bc6[_0x6326('0x33')]['offset']);}_0x320d43[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3c')]);_0x320d43[_0x6326('0x3d')]=qs[_0x6326('0x35')](_[_0x6326('0x3e')](_0x4b5bc6[_0x6326('0x33')],_0x2f624f[_0x6326('0x35')]));if(_0x4b5bc6[_0x6326('0x33')]['filter']){_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x320d43[_0x6326('0x37')],function(_0x5599da){var _0x299795={};_0x299795[_0x5599da]={'$like':'%'+_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3f')]+'%'};return _0x299795;})});}_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43['where'],{'mailboxuser':_0x45e3d5[_0x6326('0x58')]});_0x320d43=_['merge']({},_0x320d43,_0x4b5bc6['options']);return db[_0x6326('0x59')][_0x6326('0x5a')](_0x320d43)[_0x6326('0x25')](respondWithFilteredResult(_0x23bf64,_0x320d43));})[_0x6326('0x46')](handleError(_0x23bf64,null));}; \ No newline at end of file +var _0xd914=['limit','order','sort','where','filters','pick','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','show','params','merge','find','create','body','get','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','filter','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','Voicemails','UserProfileResource','name','send','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x16c1a8,_0x1c2c71){var _0x479e9d=function(_0x590f14){while(--_0x590f14){_0x16c1a8['push'](_0x16c1a8['shift']());}};_0x479e9d(++_0x1c2c71);}(_0xd914,0x17f));var _0x4d91=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0xd914[_0x152678];return _0x311a9;};'use strict';var emlformat=require(_0x4d91('0x0'));var rimraf=require(_0x4d91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d91('0x2'));var rp=require(_0x4d91('0x3'));var moment=require(_0x4d91('0x4'));var BPromise=require(_0x4d91('0x5'));var Mustache=require(_0x4d91('0x6'));var util=require(_0x4d91('0x7'));var path=require('path');var sox=require(_0x4d91('0x8'));var csv=require('to-csv');var ejs=require(_0x4d91('0x9'));var fs=require('fs');var fs_extra=require(_0x4d91('0xa'));var _=require(_0x4d91('0xb'));var squel=require(_0x4d91('0xc'));var crypto=require(_0x4d91('0xd'));var jsforce=require(_0x4d91('0xe'));var deskjs=require(_0x4d91('0xf'));var toCsv=require(_0x4d91('0x10'));var querystring=require('querystring');var Papa=require(_0x4d91('0x11'));var Redis=require(_0x4d91('0x12'));var authService=require(_0x4d91('0x13'));var qs=require(_0x4d91('0x14'));var as=require(_0x4d91('0x15'));var hardwareService=require(_0x4d91('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x4d91('0x17'));var config=require(_0x4d91('0x18'));var licenseUtil=require(_0x4d91('0x19'));var db=require(_0x4d91('0x1a'))['db'];function respondWithStatusCode(_0x1c15b7,_0x318e0c){_0x318e0c=_0x318e0c||0xcc;return function(_0x4ea591){if(_0x4ea591){return _0x1c15b7['sendStatus'](_0x318e0c);}return _0x1c15b7[_0x4d91('0x1b')](_0x318e0c)[_0x4d91('0x1c')]();};}function respondWithResult(_0xb6590d,_0x3c9fd6){_0x3c9fd6=_0x3c9fd6||0xc8;return function(_0x33fbd4){if(_0x33fbd4){return _0xb6590d[_0x4d91('0x1b')](_0x3c9fd6)[_0x4d91('0x1d')](_0x33fbd4);}};}function respondWithFilteredResult(_0x4f5aef,_0x3a8ec9){return function(_0x42631a){if(_0x42631a){var _0x1e2ef7=typeof _0x3a8ec9[_0x4d91('0x1e')]===_0x4d91('0x1f')&&typeof _0x3a8ec9['limit']===_0x4d91('0x1f');var _0xb75abf=_0x42631a[_0x4d91('0x20')];var _0x44b9a7=_0x1e2ef7?0x0:_0x3a8ec9['offset'];var _0x350e23=_0x1e2ef7?_0x42631a[_0x4d91('0x20')]:_0x3a8ec9[_0x4d91('0x1e')]+_0x3a8ec9['limit'];var _0x13ef2c;if(_0x350e23>=_0xb75abf){_0x350e23=_0xb75abf;_0x13ef2c=0xc8;}else{_0x13ef2c=0xce;}_0x4f5aef[_0x4d91('0x1b')](_0x13ef2c);return _0x4f5aef[_0x4d91('0x21')](_0x4d91('0x22'),_0x44b9a7+'-'+_0x350e23+'/'+_0xb75abf)[_0x4d91('0x1d')](_0x42631a);}return null;};}function patchUpdates(_0x40cde4){return function(_0xc1d44f){try{jsonpatch[_0x4d91('0x23')](_0xc1d44f,_0x40cde4,!![]);}catch(_0x30d911){return BPromise[_0x4d91('0x24')](_0x30d911);}return _0xc1d44f['save']();};}function saveUpdates(_0x4493da,_0x5f5236){return function(_0x57913e){if(_0x57913e){return _0x57913e[_0x4d91('0x25')](_0x4493da)[_0x4d91('0x26')](function(_0x341d18){return _0x341d18;});}return null;};}function removeEntity(_0x9cb864,_0x7d8cbf){return function(_0x12b722){if(_0x12b722){return _0x12b722[_0x4d91('0x27')]()[_0x4d91('0x26')](function(){var _0x55356b=_0x12b722['get']({'plain':!![]});var _0x1ee6b3=_0x4d91('0x28');return db[_0x4d91('0x29')][_0x4d91('0x27')]({'where':{'type':_0x1ee6b3,'resourceId':_0x55356b['id']}})[_0x4d91('0x26')](function(){return _0x12b722;});})[_0x4d91('0x26')](function(){_0x9cb864[_0x4d91('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc353,_0xda9802){return function(_0x12ac74){if(!_0x12ac74){_0x3dc353['sendStatus'](0x194);}return _0x12ac74;};}function handleError(_0x480a56,_0x299f27){_0x299f27=_0x299f27||0x1f4;return function(_0x470079){logger['error'](_0x470079['stack']);if(_0x470079[_0x4d91('0x2a')]){delete _0x470079[_0x4d91('0x2a')];}_0x480a56[_0x4d91('0x1b')](_0x299f27)[_0x4d91('0x2b')](_0x470079);};}exports['index']=function(_0x2587a1,_0x31bbf8){var _0x468e95={},_0xee7535={},_0xa63422={'count':0x0,'rows':[]};var _0x3466f3=_[_0x4d91('0x2c')](db['VoiceMail'][_0x4d91('0x2d')],function(_0x4f44ff){return{'name':_0x4f44ff['fieldName'],'type':_0x4f44ff[_0x4d91('0x2e')][_0x4d91('0x2f')]};});_0xee7535['model']=_[_0x4d91('0x2c')](_0x3466f3,_0x4d91('0x2a'));_0xee7535[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x2587a1[_0x4d91('0x30')]);_0xee7535['filters']=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],_0xee7535[_0x4d91('0x30')]);_0x468e95[_0x4d91('0x34')]=_[_0x4d91('0x32')](_0xee7535[_0x4d91('0x33')],qs['fields'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x35')]));_0x468e95['attributes']=_0x468e95[_0x4d91('0x34')][_0x4d91('0x36')]?_0x468e95[_0x4d91('0x34')]:_0xee7535['model'];if(!_0x2587a1[_0x4d91('0x30')][_0x4d91('0x37')](_0x4d91('0x38'))){_0x468e95[_0x4d91('0x39')]=qs['limit'](_0x2587a1[_0x4d91('0x30')][_0x4d91('0x39')]);_0x468e95[_0x4d91('0x1e')]=qs[_0x4d91('0x1e')](_0x2587a1['query']['offset']);}_0x468e95[_0x4d91('0x3a')]=qs[_0x4d91('0x3b')](_0x2587a1['query'][_0x4d91('0x3b')]);_0x468e95[_0x4d91('0x3c')]=qs[_0x4d91('0x3d')](_[_0x4d91('0x3e')](_0x2587a1['query'],_0xee7535[_0x4d91('0x3d')]),_0x3466f3);if(_0x2587a1[_0x4d91('0x30')]['filter']){_0x468e95[_0x4d91('0x3c')]=_['merge'](_0x468e95[_0x4d91('0x3c')],{'$or':_['map'](_0x3466f3,function(_0x2dc892){if(_0x2dc892['type']!==_0x4d91('0x3f')){var _0x2782d2={};_0x2782d2[_0x2dc892[_0x4d91('0x2a')]]={'$like':'%'+_0x2587a1[_0x4d91('0x30')]['filter']+'%'};return _0x2782d2;}})});}_0x468e95=_['merge']({},_0x468e95,_0x2587a1[_0x4d91('0x40')]);var _0x55c8d0={'where':_0x468e95[_0x4d91('0x3c')]};return db[_0x4d91('0x41')]['count'](_0x55c8d0)[_0x4d91('0x26')](function(_0x2ae356){_0xa63422[_0x4d91('0x20')]=_0x2ae356;if(_0x2587a1[_0x4d91('0x30')][_0x4d91('0x42')]){_0x468e95[_0x4d91('0x43')]=[{'all':!![]}];}return db[_0x4d91('0x41')]['findAll'](_0x468e95);})[_0x4d91('0x26')](function(_0x4c70af){_0xa63422[_0x4d91('0x44')]=_0x4c70af;return _0xa63422;})[_0x4d91('0x26')](respondWithFilteredResult(_0x31bbf8,_0x468e95))[_0x4d91('0x45')](handleError(_0x31bbf8,null));};exports[_0x4d91('0x46')]=function(_0x20ec78,_0x1fc884){var _0x4b8e12={'raw':!![],'where':{'id':_0x20ec78[_0x4d91('0x47')]['id']}},_0x4ffc08={};_0x4ffc08[_0x4d91('0x33')]=_['keys'](db[_0x4d91('0x41')][_0x4d91('0x2d')]);_0x4ffc08[_0x4d91('0x30')]=_[_0x4d91('0x31')](_0x20ec78[_0x4d91('0x30')]);_0x4ffc08[_0x4d91('0x3d')]=_[_0x4d91('0x32')](_0x4ffc08[_0x4d91('0x33')],_0x4ffc08[_0x4d91('0x30')]);_0x4b8e12['attributes']=_['intersection'](_0x4ffc08[_0x4d91('0x33')],qs['fields'](_0x20ec78[_0x4d91('0x30')][_0x4d91('0x35')]));_0x4b8e12[_0x4d91('0x34')]=_0x4b8e12[_0x4d91('0x34')]['length']?_0x4b8e12[_0x4d91('0x34')]:_0x4ffc08['model'];if(_0x20ec78['query'][_0x4d91('0x42')]){_0x4b8e12[_0x4d91('0x43')]=[{'all':!![]}];}_0x4b8e12=_[_0x4d91('0x48')]({},_0x4b8e12,_0x20ec78[_0x4d91('0x40')]);return db[_0x4d91('0x41')][_0x4d91('0x49')](_0x4b8e12)['then'](handleEntityNotFound(_0x1fc884,null))[_0x4d91('0x26')](respondWithResult(_0x1fc884,null))[_0x4d91('0x45')](handleError(_0x1fc884,null));};exports[_0x4d91('0x4a')]=function(_0x449dd8,_0x106e5b){return db[_0x4d91('0x41')][_0x4d91('0x4a')](_0x449dd8[_0x4d91('0x4b')],{})[_0x4d91('0x26')](function(_0x145dfd){var _0x16f776=_0x449dd8['user'][_0x4d91('0x4c')]({'plain':!![]});if(!_0x16f776)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16f776[_0x4d91('0x4d')]===_0x4d91('0x4e')){var _0x195e65=_0x145dfd[_0x4d91('0x4c')]({'plain':!![]});var _0x436a3d=_0x4d91('0x28');return db[_0x4d91('0x4f')][_0x4d91('0x49')]({'where':{'name':_0x436a3d,'userProfileId':_0x16f776['userProfileId']},'raw':!![]})[_0x4d91('0x26')](function(_0x43e72c){if(_0x43e72c&&_0x43e72c[_0x4d91('0x50')]===0x0){return db[_0x4d91('0x29')][_0x4d91('0x4a')]({'name':_0x195e65[_0x4d91('0x2a')],'resourceId':_0x195e65['id'],'type':_0x43e72c[_0x4d91('0x2a')],'sectionId':_0x43e72c['id']},{})['then'](function(){return _0x145dfd;});}else{return _0x145dfd;}})[_0x4d91('0x45')](function(_0x2159e4){logger[_0x4d91('0x51')](_0x4d91('0x52'),_0x2159e4);throw _0x2159e4;});}return _0x145dfd;})[_0x4d91('0x26')](respondWithResult(_0x106e5b,0xc9))[_0x4d91('0x45')](handleError(_0x106e5b,null));};exports[_0x4d91('0x25')]=function(_0x4138c5,_0x645923){if(_0x4138c5[_0x4d91('0x4b')]['id']){delete _0x4138c5[_0x4d91('0x4b')]['id'];}return db[_0x4d91('0x41')][_0x4d91('0x49')]({'where':{'id':_0x4138c5[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x645923,null))[_0x4d91('0x26')](saveUpdates(_0x4138c5[_0x4d91('0x4b')],null))['then'](respondWithResult(_0x645923,null))['catch'](handleError(_0x645923,null));};exports['destroy']=function(_0x45cf4e,_0x10c1dd){return db[_0x4d91('0x41')]['find']({'where':{'id':_0x45cf4e[_0x4d91('0x47')]['id']}})[_0x4d91('0x26')](handleEntityNotFound(_0x10c1dd,null))[_0x4d91('0x26')](removeEntity(_0x10c1dd,null))['catch'](handleError(_0x10c1dd,null));};exports['getMessages']=function(_0x5bc877,_0x75aa6d,_0x26bfde){return db[_0x4d91('0x41')][_0x4d91('0x53')]({'where':{'id':_0x5bc877[_0x4d91('0x47')]['id']}})['then'](handleEntityNotFound(_0x75aa6d,null))[_0x4d91('0x26')](function(_0x20c0f2){var _0x4d9b87;var _0x563558={},_0x3f4f24={};_0x3f4f24['model']=_[_0x4d91('0x31')](db[_0x4d91('0x54')][_0x4d91('0x2d')]);_0x3f4f24['query']=_[_0x4d91('0x31')](_0x5bc877[_0x4d91('0x30')]);_0x3f4f24[_0x4d91('0x3d')]=_[_0x4d91('0x32')](_0x3f4f24[_0x4d91('0x33')],_0x3f4f24[_0x4d91('0x30')]);_0x563558[_0x4d91('0x34')]=_['intersection'](_0x3f4f24['model'],qs['fields'](_0x5bc877['query'][_0x4d91('0x35')]));_0x563558[_0x4d91('0x34')]=_0x563558[_0x4d91('0x34')]['length']?_0x563558[_0x4d91('0x34')]:_0x3f4f24['model'];if(!_0x5bc877[_0x4d91('0x30')][_0x4d91('0x37')]('nolimit')){_0x563558['limit']=qs[_0x4d91('0x39')](_0x5bc877[_0x4d91('0x30')][_0x4d91('0x39')]);_0x563558[_0x4d91('0x1e')]=qs[_0x4d91('0x1e')](_0x5bc877[_0x4d91('0x30')][_0x4d91('0x1e')]);}_0x563558[_0x4d91('0x3a')]=qs[_0x4d91('0x3b')](_0x5bc877[_0x4d91('0x30')]['sort']);_0x563558['where']=qs[_0x4d91('0x3d')](_[_0x4d91('0x3e')](_0x5bc877[_0x4d91('0x30')],_0x3f4f24[_0x4d91('0x3d')]));if(_0x5bc877[_0x4d91('0x30')][_0x4d91('0x55')]){_0x563558[_0x4d91('0x3c')]=_[_0x4d91('0x48')](_0x563558[_0x4d91('0x3c')],{'$or':_['map'](_0x563558['attributes'],function(_0x515574){var _0x51156f={};_0x51156f[_0x515574]={'$like':'%'+_0x5bc877[_0x4d91('0x30')][_0x4d91('0x55')]+'%'};return _0x51156f;})});}_0x563558[_0x4d91('0x3c')]=_[_0x4d91('0x48')](_0x563558[_0x4d91('0x3c')],{'mailboxuser':_0x20c0f2[_0x4d91('0x56')]});_0x563558=_[_0x4d91('0x48')]({},_0x563558,_0x5bc877[_0x4d91('0x40')]);return db[_0x4d91('0x54')][_0x4d91('0x57')](_0x563558)[_0x4d91('0x26')](respondWithFilteredResult(_0x75aa6d,_0x563558));})[_0x4d91('0x45')](handleError(_0x75aa6d,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 0888014..84ce4e6 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 _0x95e1=['define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x3ee952,_0x565e0f){var _0xc0c8b1=function(_0x57e219){while(--_0x57e219){_0x3ee952['push'](_0x3ee952['shift']());}};_0xc0c8b1(++_0x565e0f);}(_0x95e1,0xba));var _0x195e=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x95e1[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0x195e('0x0'));var util=require('util');var logger=require(_0x195e('0x1'))(_0x195e('0x2'));var moment=require('moment');var BPromise=require(_0x195e('0x3'));var rp=require(_0x195e('0x4'));var fs=require('fs');var path=require(_0x195e('0x5'));var rimraf=require(_0x195e('0x6'));var config=require(_0x195e('0x7'));var attributes=require(_0x195e('0x8'));module['exports']=function(_0x484c4b,_0x2ffea4){return _0x484c4b[_0x195e('0x9')](_0x195e('0xa'),attributes,{'tableName':_0x195e('0xb'),'paranoid':![],'indexes':[{'name':_0x195e('0xc'),'fields':[_0x195e('0xd'),_0x195e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc831=['moment','bluebird','request-promise','path','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api'];(function(_0x3869b6,_0x1c9e8b){var _0x53ef5d=function(_0x135b27){while(--_0x135b27){_0x3869b6['push'](_0x3869b6['shift']());}};_0x53ef5d(++_0x1c9e8b);}(_0xc831,0x1dc));var _0x1c83=function(_0x27e4f2,_0x99d6f4){_0x27e4f2=_0x27e4f2-0x0;var _0x159913=_0xc831[_0x27e4f2];return _0x159913;};'use strict';var _=require(_0x1c83('0x0'));var util=require(_0x1c83('0x1'));var logger=require(_0x1c83('0x2'))(_0x1c83('0x3'));var moment=require(_0x1c83('0x4'));var BPromise=require(_0x1c83('0x5'));var rp=require(_0x1c83('0x6'));var fs=require('fs');var path=require(_0x1c83('0x7'));var rimraf=require('rimraf');var config=require(_0x1c83('0x8'));var attributes=require(_0x1c83('0x9'));module['exports']=function(_0x57683e,_0x276df2){return _0x57683e[_0x1c83('0xa')](_0x1c83('0xb'),attributes,{'tableName':_0x1c83('0xc'),'paranoid':![],'indexes':[{'name':_0x1c83('0xd'),'fields':['mailbox',_0x1c83('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 8b06889..19b46fa 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 _0xfbb5=['then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0xfbb5,0x15e));var _0x5fbb=function(_0x5ee2cf,_0x482dca){_0x5ee2cf=_0x5ee2cf-0x0;var _0x7ce747=_0xfbb5[_0x5ee2cf];return _0x7ce747;};'use strict';var _=require(_0x5fbb('0x0'));var util=require(_0x5fbb('0x1'));var moment=require('moment');var BPromise=require(_0x5fbb('0x2'));var rs=require(_0x5fbb('0x3'));var fs=require('fs');var Redis=require(_0x5fbb('0x4'));var db=require(_0x5fbb('0x5'))['db'];var utils=require(_0x5fbb('0x6'));var logger=require(_0x5fbb('0x7'))(_0x5fbb('0x8'));var config=require(_0x5fbb('0x9'));var jayson=require(_0x5fbb('0xa'));var client=jayson[_0x5fbb('0xb')][_0x5fbb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xae6cba,_0x567fe6,_0x55cb0a){return new BPromise(function(_0x40e3ed,_0x40e68e){return client[_0x5fbb('0xd')](_0xae6cba,_0x55cb0a)[_0x5fbb('0xe')](function(_0x548f0f){logger[_0x5fbb('0xf')](_0x5fbb('0x10'),_0x567fe6,'request\x20sent');logger[_0x5fbb('0x11')](_0x5fbb('0x12'),_0x567fe6,_0x5fbb('0x13'),JSON[_0x5fbb('0x14')](_0x548f0f));if(_0x548f0f[_0x5fbb('0x15')]){if(_0x548f0f[_0x5fbb('0x15')][_0x5fbb('0x16')]===0x1f4){logger[_0x5fbb('0x15')](_0x5fbb('0x10'),_0x567fe6,_0x548f0f[_0x5fbb('0x15')]['message']);return _0x40e68e(_0x548f0f['error'][_0x5fbb('0x17')]);}logger[_0x5fbb('0x15')](_0x5fbb('0x10'),_0x567fe6,_0x548f0f[_0x5fbb('0x15')][_0x5fbb('0x17')]);return _0x40e3ed(_0x548f0f[_0x5fbb('0x15')]['message']);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x567fe6,'request\x20sent');_0x40e3ed(_0x548f0f[_0x5fbb('0x18')][_0x5fbb('0x17')]);}})[_0x5fbb('0x19')](function(_0x17161e){logger[_0x5fbb('0x15')]('VoiceMail,\x20%s,\x20%s',_0x567fe6,_0x17161e);_0x40e68e(_0x17161e);});});} \ No newline at end of file +var _0xfb92=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','randomstring','ioredis'];(function(_0x2b4014,_0x578211){var _0x5bc6f5=function(_0x462318){while(--_0x462318){_0x2b4014['push'](_0x2b4014['shift']());}};_0x5bc6f5(++_0x578211);}(_0xfb92,0x1c4));var _0x2fb9=function(_0x8ae40b,_0x4a1832){_0x8ae40b=_0x8ae40b-0x0;var _0x38bb1a=_0xfb92[_0x8ae40b];return _0x38bb1a;};'use strict';var _=require(_0x2fb9('0x0'));var util=require(_0x2fb9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2fb9('0x2'));var fs=require('fs');var Redis=require(_0x2fb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fb9('0x4'));var logger=require(_0x2fb9('0x5'))(_0x2fb9('0x6'));var config=require(_0x2fb9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2fb9('0x8')][_0x2fb9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xefbc27,_0xb672e4,_0x94556e){return new BPromise(function(_0x4f43ef,_0x10fcaa){return client[_0x2fb9('0xa')](_0xefbc27,_0x94556e)[_0x2fb9('0xb')](function(_0x753637){logger['info'](_0x2fb9('0xc'),_0xb672e4,_0x2fb9('0xd'));logger[_0x2fb9('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0xb672e4,'request\x20sent',JSON[_0x2fb9('0xf')](_0x753637));if(_0x753637[_0x2fb9('0x10')]){if(_0x753637[_0x2fb9('0x10')]['code']===0x1f4){logger[_0x2fb9('0x10')](_0x2fb9('0xc'),_0xb672e4,_0x753637[_0x2fb9('0x10')][_0x2fb9('0x11')]);return _0x10fcaa(_0x753637[_0x2fb9('0x10')][_0x2fb9('0x11')]);}logger[_0x2fb9('0x10')](_0x2fb9('0xc'),_0xb672e4,_0x753637[_0x2fb9('0x10')][_0x2fb9('0x11')]);return _0x4f43ef(_0x753637[_0x2fb9('0x10')][_0x2fb9('0x11')]);}else{logger['info'](_0x2fb9('0xc'),_0xb672e4,_0x2fb9('0xd'));_0x4f43ef(_0x753637[_0x2fb9('0x12')][_0x2fb9('0x11')]);}})['catch'](function(_0x3bf581){logger[_0x2fb9('0x10')]('VoiceMail,\x20%s,\x20%s',_0xb672e4,_0x3bf581);_0x10fcaa(_0x3bf581);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 9f100f9..4566fa5 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 _0x0836=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','isAuthenticated','show','/:id/download','post','update','destroy','exports','util','path','connect-timeout'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x0836,0x9f));var _0x6083=function(_0x49c73b,_0x2fad7d){_0x49c73b=_0x49c73b-0x0;var _0x2105a9=_0x0836[_0x49c73b];return _0x2105a9;};'use strict';var multer=require('multer');var util=require(_0x6083('0x0'));var path=require(_0x6083('0x1'));var timeout=require(_0x6083('0x2'));var express=require(_0x6083('0x3'));var router=express['Router']();var fs_extra=require(_0x6083('0x4'));var auth=require(_0x6083('0x5'));var interaction=require(_0x6083('0x6'));var config=require(_0x6083('0x7'));var controller=require(_0x6083('0x8'));router[_0x6083('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6083('0x9')](_0x6083('0xa'),auth[_0x6083('0xb')](),controller[_0x6083('0xc')]);router[_0x6083('0x9')](_0x6083('0xd'),auth['isAuthenticated'](),controller['download']);router[_0x6083('0xe')]('/',auth[_0x6083('0xb')](),controller['create']);router['put'](_0x6083('0xa'),auth[_0x6083('0xb')](),controller[_0x6083('0xf')]);router['delete'](_0x6083('0xa'),auth['isAuthenticated'](),controller[_0x6083('0x10')]);module[_0x6083('0x11')]=router; \ No newline at end of file +var _0x2f01=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','post','put','update','delete'];(function(_0x2090d0,_0x4aa2f0){var _0x45d390=function(_0xfe5fdb){while(--_0xfe5fdb){_0x2090d0['push'](_0x2090d0['shift']());}};_0x45d390(++_0x4aa2f0);}(_0x2f01,0x13d));var _0x12f0=function(_0x4ed7ec,_0x2b2ab0){_0x4ed7ec=_0x4ed7ec-0x0;var _0x68d8a6=_0x2f01[_0x4ed7ec];return _0x68d8a6;};'use strict';var multer=require(_0x12f0('0x0'));var util=require(_0x12f0('0x1'));var path=require(_0x12f0('0x2'));var timeout=require(_0x12f0('0x3'));var express=require(_0x12f0('0x4'));var router=express[_0x12f0('0x5')]();var fs_extra=require(_0x12f0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x12f0('0x7'));var config=require(_0x12f0('0x8'));var controller=require(_0x12f0('0x9'));router[_0x12f0('0xa')]('/',auth[_0x12f0('0xb')](),controller['index']);router[_0x12f0('0xa')](_0x12f0('0xc'),auth[_0x12f0('0xb')](),controller[_0x12f0('0xd')]);router[_0x12f0('0xa')](_0x12f0('0xe'),auth[_0x12f0('0xb')](),controller['download']);router[_0x12f0('0xf')]('/',auth[_0x12f0('0xb')](),controller['create']);router[_0x12f0('0x10')]('/:id',auth[_0x12f0('0xb')](),controller[_0x12f0('0x11')]);router[_0x12f0('0x12')](_0x12f0('0xc'),auth[_0x12f0('0xb')](),controller[_0x12f0('0x13')]);module[_0x12f0('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index f093d0e..9d6fff5 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 _0x60ba=['sequelize','exports','VIRTUAL','INTEGER','STRING','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x412308,_0x4de66a){var _0x2a0f5e=function(_0x2526b1){while(--_0x2526b1){_0x412308['push'](_0x412308['shift']());}};_0x2a0f5e(++_0x4de66a);}(_0x60ba,0x1e3));var _0xa60b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60ba[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xa60b('0x0'));module[_0xa60b('0x1')]={'name':{'type':Sequelize[_0xa60b('0x2')],'get':function(_0x4e7cb7){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xa60b('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa60b('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0xa60b('0x5')](_0xa60b('0x6'))}}; \ No newline at end of file +var _0x3296=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','STRING'];(function(_0x5234e4,_0x2a4ed3){var _0x580a82=function(_0x13f98e){while(--_0x13f98e){_0x5234e4['push'](_0x5234e4['shift']());}};_0x580a82(++_0x2a4ed3);}(_0x3296,0xac));var _0x6329=function(_0x36a787,_0x3650ad){_0x36a787=_0x36a787-0x0;var _0x4486db=_0x3296[_0x36a787];return _0x4486db;};'use strict';var Sequelize=require(_0x6329('0x0'));module['exports']={'name':{'type':Sequelize[_0x6329('0x1')],'get':function(_0x4ede93){return this[_0x6329('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x6329('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x6329('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x6329('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x6329('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x6329('0x4')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x6329('0x5'),'defaultValue':Sequelize[_0x6329('0x6')](_0x6329('0x7'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 4160674..f0db573 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 _0xf982=['VIRTUAL','where','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','download','recording','VoiceMailMessage\x20not\x20found','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge'];(function(_0x3ec285,_0x5c264d){var _0x1197c0=function(_0xbcedad){while(--_0xbcedad){_0x3ec285['push'](_0x3ec285['shift']());}};_0x1197c0(++_0x5c264d);}(_0xf982,0x171));var _0x2f98=function(_0x36cc17,_0x2009b5){_0x36cc17=_0x36cc17-0x0;var _0x220e98=_0xf982[_0x36cc17];return _0x220e98;};'use strict';var emlformat=require(_0x2f98('0x0'));var rimraf=require(_0x2f98('0x1'));var zipdir=require(_0x2f98('0x2'));var jsonpatch=require(_0x2f98('0x3'));var rp=require(_0x2f98('0x4'));var moment=require(_0x2f98('0x5'));var BPromise=require(_0x2f98('0x6'));var Mustache=require(_0x2f98('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f98('0x8'));var csv=require(_0x2f98('0x9'));var ejs=require(_0x2f98('0xa'));var fs=require('fs');var fs_extra=require(_0x2f98('0xb'));var _=require(_0x2f98('0xc'));var squel=require(_0x2f98('0xd'));var crypto=require('crypto');var jsforce=require(_0x2f98('0xe'));var deskjs=require(_0x2f98('0xf'));var toCsv=require(_0x2f98('0x9'));var querystring=require(_0x2f98('0x10'));var Papa=require(_0x2f98('0x11'));var Redis=require(_0x2f98('0x12'));var authService=require(_0x2f98('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2f98('0x14'));var hardwareService=require(_0x2f98('0x15'));var logger=require(_0x2f98('0x16'))(_0x2f98('0x17'));var utils=require(_0x2f98('0x18'));var config=require(_0x2f98('0x19'));var licenseUtil=require(_0x2f98('0x1a'));var db=require(_0x2f98('0x1b'))['db'];function respondWithStatusCode(_0x45c8c1,_0x316b0e){_0x316b0e=_0x316b0e||0xcc;return function(_0xc83ac2){if(_0xc83ac2){return _0x45c8c1[_0x2f98('0x1c')](_0x316b0e);}return _0x45c8c1[_0x2f98('0x1d')](_0x316b0e)[_0x2f98('0x1e')]();};}function respondWithResult(_0x462967,_0x15f585){_0x15f585=_0x15f585||0xc8;return function(_0x1235c8){if(_0x1235c8){return _0x462967[_0x2f98('0x1d')](_0x15f585)[_0x2f98('0x1f')](_0x1235c8);}};}function respondWithFilteredResult(_0x111eb5,_0x304b53){return function(_0x182f36){if(_0x182f36){var _0x1677eb=typeof _0x304b53[_0x2f98('0x20')]===_0x2f98('0x21')&&typeof _0x304b53[_0x2f98('0x22')]===_0x2f98('0x21');var _0x19ca77=_0x182f36[_0x2f98('0x23')];var _0x1ae7ec=_0x1677eb?0x0:_0x304b53[_0x2f98('0x20')];var _0x5a0dcb=_0x1677eb?_0x182f36['count']:_0x304b53[_0x2f98('0x20')]+_0x304b53[_0x2f98('0x22')];var _0x253e7e;if(_0x5a0dcb>=_0x19ca77){_0x5a0dcb=_0x19ca77;_0x253e7e=0xc8;}else{_0x253e7e=0xce;}_0x111eb5[_0x2f98('0x1d')](_0x253e7e);return _0x111eb5[_0x2f98('0x24')](_0x2f98('0x25'),_0x1ae7ec+'-'+_0x5a0dcb+'/'+_0x19ca77)[_0x2f98('0x1f')](_0x182f36);}return null;};}function patchUpdates(_0x4f5b5a){return function(_0x5be1cb){try{jsonpatch[_0x2f98('0x26')](_0x5be1cb,_0x4f5b5a,!![]);}catch(_0x12e240){return BPromise[_0x2f98('0x27')](_0x12e240);}return _0x5be1cb[_0x2f98('0x28')]();};}function saveUpdates(_0x4d831d,_0x2362c5){return function(_0x546ba0){if(_0x546ba0){return _0x546ba0['update'](_0x4d831d)[_0x2f98('0x29')](function(_0x1f8bfb){return _0x1f8bfb;});}return null;};}function removeEntity(_0x209196,_0x4e2667){return function(_0x460a64){if(_0x460a64){return _0x460a64['destroy']()['then'](function(){_0x209196[_0x2f98('0x1d')](0xcc)[_0x2f98('0x1e')]();});}};}function handleEntityNotFound(_0x4468c6,_0x4dba43){return function(_0xa73000){if(!_0xa73000){_0x4468c6[_0x2f98('0x1c')](0x194);}return _0xa73000;};}function handleError(_0x1e047d,_0x182d27){_0x182d27=_0x182d27||0x1f4;return function(_0x35c47c){logger[_0x2f98('0x2a')](_0x35c47c['stack']);if(_0x35c47c['name']){delete _0x35c47c[_0x2f98('0x2b')];}_0x1e047d[_0x2f98('0x1d')](_0x182d27)[_0x2f98('0x2c')](_0x35c47c);};}exports[_0x2f98('0x2d')]=function(_0x6e1daf,_0x34970e){var _0xabebdd={},_0x23ee02={},_0x426375={'count':0x0,'rows':[]};var _0x534c22=_[_0x2f98('0x2e')](db[_0x2f98('0x2f')][_0x2f98('0x30')],function(_0x468a27){return{'name':_0x468a27[_0x2f98('0x31')],'type':_0x468a27[_0x2f98('0x32')][_0x2f98('0x33')]};});_0x23ee02[_0x2f98('0x34')]=_[_0x2f98('0x35')](_[_0x2f98('0x2e')](_0x534c22,_0x2f98('0x2b')),[_0x2f98('0x2b')]);_0x23ee02[_0x2f98('0x36')]=_[_0x2f98('0x37')](_0x6e1daf[_0x2f98('0x36')]);_0x23ee02['filters']=_[_0x2f98('0x38')](_0x23ee02[_0x2f98('0x34')],_0x23ee02['query']);_0xabebdd[_0x2f98('0x39')]=_['intersection'](_0x23ee02[_0x2f98('0x34')],qs['fields'](_0x6e1daf[_0x2f98('0x36')][_0x2f98('0x3a')]));_0xabebdd[_0x2f98('0x39')]=_0xabebdd[_0x2f98('0x39')]['length']?_0xabebdd[_0x2f98('0x39')]:_0x23ee02['model'];if(!_0x6e1daf[_0x2f98('0x36')][_0x2f98('0x3b')](_0x2f98('0x3c'))){_0xabebdd['limit']=qs[_0x2f98('0x22')](_0x6e1daf['query'][_0x2f98('0x22')]);_0xabebdd[_0x2f98('0x20')]=qs['offset'](_0x6e1daf['query'][_0x2f98('0x20')]);}_0xabebdd[_0x2f98('0x3d')]=qs[_0x2f98('0x3e')](_0x6e1daf['query']['sort']);_0xabebdd['where']=qs['filters'](_['pick'](_0x6e1daf['query'],_0x23ee02[_0x2f98('0x3f')]),_0x534c22);if(_0x6e1daf['query'][_0x2f98('0x40')]){_0xabebdd['where']=_[_0x2f98('0x41')](_0xabebdd['where'],{'$or':_[_0x2f98('0x2e')](_0x534c22,function(_0x227042){if(_0x227042['type']!==_0x2f98('0x42')){var _0x10dd7a={};_0x10dd7a[_0x227042['name']]={'$like':'%'+_0x6e1daf[_0x2f98('0x36')][_0x2f98('0x40')]+'%'};return _0x10dd7a;}})});}_0xabebdd=_[_0x2f98('0x41')]({},_0xabebdd,_0x6e1daf['options']);var _0x579bd4={'where':_0xabebdd[_0x2f98('0x43')]};return db[_0x2f98('0x2f')]['count'](_0x579bd4)[_0x2f98('0x29')](function(_0x3377aa){_0x426375[_0x2f98('0x23')]=_0x3377aa;if(_0x6e1daf[_0x2f98('0x36')][_0x2f98('0x44')]){_0xabebdd[_0x2f98('0x45')]=[{'all':!![]}];}return db[_0x2f98('0x2f')][_0x2f98('0x46')](_0xabebdd);})[_0x2f98('0x29')](function(_0x6f8e7a){_0x426375[_0x2f98('0x47')]=_0x6f8e7a;return _0x426375;})[_0x2f98('0x29')](respondWithFilteredResult(_0x34970e,_0xabebdd))['catch'](handleError(_0x34970e,null));};exports[_0x2f98('0x48')]=function(_0x1081d5,_0xeb2730){var _0x542344={'raw':!![],'where':{'id':_0x1081d5[_0x2f98('0x49')]['id']}},_0x29e6ef={};_0x29e6ef[_0x2f98('0x34')]=_[_0x2f98('0x37')](db['VoiceMailMessage']['rawAttributes']);_0x29e6ef[_0x2f98('0x36')]=_[_0x2f98('0x37')](_0x1081d5[_0x2f98('0x36')]);_0x29e6ef[_0x2f98('0x3f')]=_[_0x2f98('0x38')](_0x29e6ef[_0x2f98('0x34')],_0x29e6ef['query']);_0x542344[_0x2f98('0x39')]=_[_0x2f98('0x38')](_0x29e6ef[_0x2f98('0x34')],qs[_0x2f98('0x3a')](_0x1081d5[_0x2f98('0x36')][_0x2f98('0x3a')]));_0x542344[_0x2f98('0x39')]=_0x542344[_0x2f98('0x39')][_0x2f98('0x4a')]?_0x542344[_0x2f98('0x39')]:_0x29e6ef[_0x2f98('0x34')];if(_0x1081d5[_0x2f98('0x36')][_0x2f98('0x44')]){_0x542344[_0x2f98('0x45')]=[{'all':!![]}];}_0x542344=_[_0x2f98('0x41')]({},_0x542344,_0x1081d5[_0x2f98('0x4b')]);return db[_0x2f98('0x2f')][_0x2f98('0x4c')](_0x542344)[_0x2f98('0x29')](handleEntityNotFound(_0xeb2730,null))[_0x2f98('0x29')](respondWithResult(_0xeb2730,null))[_0x2f98('0x4d')](handleError(_0xeb2730,null));};exports[_0x2f98('0x4e')]=function(_0x4ae09f,_0x3d736d){return db[_0x2f98('0x2f')]['create'](_0x4ae09f['body'],{})[_0x2f98('0x29')](respondWithResult(_0x3d736d,0xc9))[_0x2f98('0x4d')](handleError(_0x3d736d,null));};exports['update']=function(_0x3614d7,_0x3f2850){if(_0x3614d7[_0x2f98('0x4f')]['id']){delete _0x3614d7[_0x2f98('0x4f')]['id'];}return db[_0x2f98('0x2f')][_0x2f98('0x4c')]({'where':{'id':_0x3614d7[_0x2f98('0x49')]['id']}})[_0x2f98('0x29')](handleEntityNotFound(_0x3f2850,null))['then'](saveUpdates(_0x3614d7[_0x2f98('0x4f')],null))['then'](respondWithResult(_0x3f2850,null))[_0x2f98('0x4d')](handleError(_0x3f2850,null));};exports['destroy']=function(_0x418cae,_0x6a3b0d){return db[_0x2f98('0x2f')]['find']({'where':{'id':_0x418cae[_0x2f98('0x49')]['id']}})[_0x2f98('0x29')](handleEntityNotFound(_0x6a3b0d,null))['then'](removeEntity(_0x6a3b0d,null))['catch'](handleError(_0x6a3b0d,null));};exports[_0x2f98('0x50')]=function(_0x57f90d,_0x241ba6,_0x476bae){return db[_0x2f98('0x2f')][_0x2f98('0x4c')]({'where':{'id':_0x57f90d[_0x2f98('0x49')]['id']},'attributes':['id',_0x2f98('0x51'),'msg_id']})['then'](handleEntityNotFound(_0x241ba6,null))[_0x2f98('0x29')](function(_0x154e6f){if(_0x154e6f){if(!_0x154e6f[_0x2f98('0x51')]){throw new db['Sequelize']['ValidationError'](_0x2f98('0x52'));}var _0x364e53={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x154e6f[_0x2f98('0x53')]){_0x364e53[_0x2f98('0x54')]=_0x2f98('0x55')+_0x154e6f[_0x2f98('0x53')]+_0x2f98('0x56');}_0x241ba6['set'](_0x364e53);return _0x241ba6['send'](new Buffer(_0x154e6f[_0x2f98('0x51')]));}})['catch'](handleError(_0x241ba6,null));}; \ No newline at end of file +var _0xe429=['name','send','index','VoiceMailMessage','rawAttributes','fieldName','key','model','differenceBy','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','update','body','recording','msg_id','Sequelize','ValidationError','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','count','set','json','apply','then','destroy','sendStatus','error','stack'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe429,0x12a));var _0x9e42=function(_0x1cc9d5,_0x464c67){_0x1cc9d5=_0x1cc9d5-0x0;var _0x695a62=_0xe429[_0x1cc9d5];return _0x695a62;};'use strict';var emlformat=require(_0x9e42('0x0'));var rimraf=require(_0x9e42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e42('0x2'));var rp=require('request-promise');var moment=require(_0x9e42('0x3'));var BPromise=require(_0x9e42('0x4'));var Mustache=require('mustache');var util=require(_0x9e42('0x5'));var path=require(_0x9e42('0x6'));var sox=require(_0x9e42('0x7'));var csv=require(_0x9e42('0x8'));var ejs=require(_0x9e42('0x9'));var fs=require('fs');var fs_extra=require(_0x9e42('0xa'));var _=require(_0x9e42('0xb'));var squel=require(_0x9e42('0xc'));var crypto=require('crypto');var jsforce=require(_0x9e42('0xd'));var deskjs=require(_0x9e42('0xe'));var toCsv=require(_0x9e42('0x8'));var querystring=require(_0x9e42('0xf'));var Papa=require(_0x9e42('0x10'));var Redis=require(_0x9e42('0x11'));var authService=require(_0x9e42('0x12'));var qs=require(_0x9e42('0x13'));var as=require(_0x9e42('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e42('0x15'))('api');var utils=require(_0x9e42('0x16'));var config=require(_0x9e42('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e42('0x18'))['db'];function respondWithStatusCode(_0x259cde,_0x151043){_0x151043=_0x151043||0xcc;return function(_0x3bc7a3){if(_0x3bc7a3){return _0x259cde['sendStatus'](_0x151043);}return _0x259cde['status'](_0x151043)[_0x9e42('0x19')]();};}function respondWithResult(_0x5e3668,_0x448a3f){_0x448a3f=_0x448a3f||0xc8;return function(_0x106d5e){if(_0x106d5e){return _0x5e3668[_0x9e42('0x1a')](_0x448a3f)['json'](_0x106d5e);}};}function respondWithFilteredResult(_0xd41ba4,_0x34574c){return function(_0x240d02){if(_0x240d02){var _0x2bb02e=typeof _0x34574c[_0x9e42('0x1b')]==='undefined'&&typeof _0x34574c[_0x9e42('0x1c')]==='undefined';var _0x47fce0=_0x240d02[_0x9e42('0x1d')];var _0x5121a7=_0x2bb02e?0x0:_0x34574c[_0x9e42('0x1b')];var _0x3f691d=_0x2bb02e?_0x240d02[_0x9e42('0x1d')]:_0x34574c[_0x9e42('0x1b')]+_0x34574c['limit'];var _0x37d6e9;if(_0x3f691d>=_0x47fce0){_0x3f691d=_0x47fce0;_0x37d6e9=0xc8;}else{_0x37d6e9=0xce;}_0xd41ba4['status'](_0x37d6e9);return _0xd41ba4[_0x9e42('0x1e')]('Content-Range',_0x5121a7+'-'+_0x3f691d+'/'+_0x47fce0)[_0x9e42('0x1f')](_0x240d02);}return null;};}function patchUpdates(_0x551b6a){return function(_0x2043f9){try{jsonpatch[_0x9e42('0x20')](_0x2043f9,_0x551b6a,!![]);}catch(_0x4781c5){return BPromise['reject'](_0x4781c5);}return _0x2043f9['save']();};}function saveUpdates(_0x3ed828,_0x63dafd){return function(_0x57408f){if(_0x57408f){return _0x57408f['update'](_0x3ed828)[_0x9e42('0x21')](function(_0x7aaffe){return _0x7aaffe;});}return null;};}function removeEntity(_0x31c0c2,_0x517b31){return function(_0x9f1867){if(_0x9f1867){return _0x9f1867[_0x9e42('0x22')]()[_0x9e42('0x21')](function(){_0x31c0c2[_0x9e42('0x1a')](0xcc)[_0x9e42('0x19')]();});}};}function handleEntityNotFound(_0x8734c,_0x55cf8c){return function(_0x294bf2){if(!_0x294bf2){_0x8734c[_0x9e42('0x23')](0x194);}return _0x294bf2;};}function handleError(_0x1796e8,_0x3444fc){_0x3444fc=_0x3444fc||0x1f4;return function(_0x5458e4){logger[_0x9e42('0x24')](_0x5458e4[_0x9e42('0x25')]);if(_0x5458e4[_0x9e42('0x26')]){delete _0x5458e4['name'];}_0x1796e8[_0x9e42('0x1a')](_0x3444fc)[_0x9e42('0x27')](_0x5458e4);};}exports[_0x9e42('0x28')]=function(_0x53f718,_0x31c43c){var _0x40d0bb={},_0x5b17cf={},_0x1b84cf={'count':0x0,'rows':[]};var _0x4e0889=_['map'](db[_0x9e42('0x29')][_0x9e42('0x2a')],function(_0x4b6dde){return{'name':_0x4b6dde[_0x9e42('0x2b')],'type':_0x4b6dde['type'][_0x9e42('0x2c')]};});_0x5b17cf[_0x9e42('0x2d')]=_[_0x9e42('0x2e')](_['map'](_0x4e0889,'name'),[_0x9e42('0x26')]);_0x5b17cf['query']=_['keys'](_0x53f718[_0x9e42('0x2f')]);_0x5b17cf['filters']=_[_0x9e42('0x30')](_0x5b17cf['model'],_0x5b17cf[_0x9e42('0x2f')]);_0x40d0bb['attributes']=_[_0x9e42('0x30')](_0x5b17cf[_0x9e42('0x2d')],qs['fields'](_0x53f718[_0x9e42('0x2f')][_0x9e42('0x31')]));_0x40d0bb[_0x9e42('0x32')]=_0x40d0bb['attributes'][_0x9e42('0x33')]?_0x40d0bb['attributes']:_0x5b17cf['model'];if(!_0x53f718['query'][_0x9e42('0x34')](_0x9e42('0x35'))){_0x40d0bb['limit']=qs[_0x9e42('0x1c')](_0x53f718[_0x9e42('0x2f')][_0x9e42('0x1c')]);_0x40d0bb[_0x9e42('0x1b')]=qs['offset'](_0x53f718[_0x9e42('0x2f')][_0x9e42('0x1b')]);}_0x40d0bb[_0x9e42('0x36')]=qs['sort'](_0x53f718[_0x9e42('0x2f')][_0x9e42('0x37')]);_0x40d0bb[_0x9e42('0x38')]=qs[_0x9e42('0x39')](_[_0x9e42('0x3a')](_0x53f718['query'],_0x5b17cf[_0x9e42('0x39')]),_0x4e0889);if(_0x53f718[_0x9e42('0x2f')][_0x9e42('0x3b')]){_0x40d0bb[_0x9e42('0x38')]=_[_0x9e42('0x3c')](_0x40d0bb['where'],{'$or':_[_0x9e42('0x3d')](_0x4e0889,function(_0x12badf){if(_0x12badf[_0x9e42('0x3e')]!==_0x9e42('0x3f')){var _0x93ef5d={};_0x93ef5d[_0x12badf['name']]={'$like':'%'+_0x53f718[_0x9e42('0x2f')][_0x9e42('0x3b')]+'%'};return _0x93ef5d;}})});}_0x40d0bb=_[_0x9e42('0x3c')]({},_0x40d0bb,_0x53f718[_0x9e42('0x40')]);var _0x21c8ff={'where':_0x40d0bb[_0x9e42('0x38')]};return db[_0x9e42('0x29')][_0x9e42('0x1d')](_0x21c8ff)[_0x9e42('0x21')](function(_0x41696e){_0x1b84cf[_0x9e42('0x1d')]=_0x41696e;if(_0x53f718[_0x9e42('0x2f')][_0x9e42('0x41')]){_0x40d0bb[_0x9e42('0x42')]=[{'all':!![]}];}return db[_0x9e42('0x29')]['findAll'](_0x40d0bb);})[_0x9e42('0x21')](function(_0x4a3a4a){_0x1b84cf[_0x9e42('0x43')]=_0x4a3a4a;return _0x1b84cf;})['then'](respondWithFilteredResult(_0x31c43c,_0x40d0bb))['catch'](handleError(_0x31c43c,null));};exports[_0x9e42('0x44')]=function(_0x3ab550,_0x223dec){var _0x2ffb3c={'raw':!![],'where':{'id':_0x3ab550[_0x9e42('0x45')]['id']}},_0x27f7d6={};_0x27f7d6[_0x9e42('0x2d')]=_[_0x9e42('0x46')](db[_0x9e42('0x29')][_0x9e42('0x2a')]);_0x27f7d6[_0x9e42('0x2f')]=_['keys'](_0x3ab550[_0x9e42('0x2f')]);_0x27f7d6[_0x9e42('0x39')]=_['intersection'](_0x27f7d6[_0x9e42('0x2d')],_0x27f7d6['query']);_0x2ffb3c[_0x9e42('0x32')]=_[_0x9e42('0x30')](_0x27f7d6[_0x9e42('0x2d')],qs[_0x9e42('0x31')](_0x3ab550[_0x9e42('0x2f')][_0x9e42('0x31')]));_0x2ffb3c[_0x9e42('0x32')]=_0x2ffb3c[_0x9e42('0x32')][_0x9e42('0x33')]?_0x2ffb3c[_0x9e42('0x32')]:_0x27f7d6['model'];if(_0x3ab550['query'][_0x9e42('0x41')]){_0x2ffb3c[_0x9e42('0x42')]=[{'all':!![]}];}_0x2ffb3c=_['merge']({},_0x2ffb3c,_0x3ab550[_0x9e42('0x40')]);return db[_0x9e42('0x29')][_0x9e42('0x47')](_0x2ffb3c)['then'](handleEntityNotFound(_0x223dec,null))[_0x9e42('0x21')](respondWithResult(_0x223dec,null))[_0x9e42('0x48')](handleError(_0x223dec,null));};exports[_0x9e42('0x49')]=function(_0x4fe473,_0x80fb68){return db[_0x9e42('0x29')][_0x9e42('0x49')](_0x4fe473['body'],{})['then'](respondWithResult(_0x80fb68,0xc9))[_0x9e42('0x48')](handleError(_0x80fb68,null));};exports[_0x9e42('0x4a')]=function(_0x34690a,_0x5bf147){if(_0x34690a[_0x9e42('0x4b')]['id']){delete _0x34690a[_0x9e42('0x4b')]['id'];}return db[_0x9e42('0x29')][_0x9e42('0x47')]({'where':{'id':_0x34690a[_0x9e42('0x45')]['id']}})[_0x9e42('0x21')](handleEntityNotFound(_0x5bf147,null))['then'](saveUpdates(_0x34690a['body'],null))[_0x9e42('0x21')](respondWithResult(_0x5bf147,null))[_0x9e42('0x48')](handleError(_0x5bf147,null));};exports['destroy']=function(_0x48210c,_0x504c8b){return db['VoiceMailMessage'][_0x9e42('0x47')]({'where':{'id':_0x48210c[_0x9e42('0x45')]['id']}})[_0x9e42('0x21')](handleEntityNotFound(_0x504c8b,null))[_0x9e42('0x21')](removeEntity(_0x504c8b,null))['catch'](handleError(_0x504c8b,null));};exports['download']=function(_0x185971,_0x473a1d,_0x54b984){return db[_0x9e42('0x29')]['find']({'where':{'id':_0x185971['params']['id']},'attributes':['id',_0x9e42('0x4c'),_0x9e42('0x4d')]})[_0x9e42('0x21')](handleEntityNotFound(_0x473a1d,null))['then'](function(_0x2a416b){if(_0x2a416b){if(!_0x2a416b[_0x9e42('0x4c')]){throw new db[(_0x9e42('0x4e'))][(_0x9e42('0x4f'))]('VoiceMailMessage\x20not\x20found');}var _0x418052={'Content-Type':'audio/wav','Content-Disposition':_0x9e42('0x50')};if(_0x2a416b[_0x9e42('0x4d')]){_0x418052[_0x9e42('0x51')]=_0x9e42('0x52')+_0x2a416b['msg_id']+_0x9e42('0x53');}_0x473a1d['set'](_0x418052);return _0x473a1d[_0x9e42('0x27')](new Buffer(_0x2a416b['recording']));}})[_0x9e42('0x48')](handleError(_0x473a1d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 2600a1f..e3c9067 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 _0x2ffe=['rimraf','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xd05d0e,_0x222ec6){var _0xa812c=function(_0x207028){while(--_0x207028){_0xd05d0e['push'](_0xd05d0e['shift']());}};_0xa812c(++_0x222ec6);}(_0x2ffe,0xea));var _0xe2ff=function(_0x5c80a4,_0x5ac374){_0x5c80a4=_0x5c80a4-0x0;var _0x11c1a2=_0x2ffe[_0x5c80a4];return _0x11c1a2;};'use strict';var _=require(_0xe2ff('0x0'));var util=require(_0xe2ff('0x1'));var logger=require(_0xe2ff('0x2'))(_0xe2ff('0x3'));var moment=require(_0xe2ff('0x4'));var BPromise=require('bluebird');var rp=require(_0xe2ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2ff('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xe2ff('0x7')]=function(_0x51f4e1,_0x16cbe9){return _0x51f4e1[_0xe2ff('0x8')](_0xe2ff('0x9'),attributes,{'tableName':_0xe2ff('0xa'),'paranoid':![],'indexes':[{'name':_0xe2ff('0xb'),'fields':[_0xe2ff('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1335=['VoiceMailMessage','dir','lodash','../../config/logger','api','bluebird','path','rimraf','exports'];(function(_0xbeb588,_0x343364){var _0x11fbc5=function(_0x4bb0e3){while(--_0x4bb0e3){_0xbeb588['push'](_0xbeb588['shift']());}};_0x11fbc5(++_0x343364);}(_0x1335,0x1f1));var _0x5133=function(_0x28773d,_0x1111ce){_0x28773d=_0x28773d-0x0;var _0x3006a8=_0x1335[_0x28773d];return _0x3006a8;};'use strict';var _=require(_0x5133('0x0'));var util=require('util');var logger=require(_0x5133('0x1'))(_0x5133('0x2'));var moment=require('moment');var BPromise=require(_0x5133('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5133('0x4'));var rimraf=require(_0x5133('0x5'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x5133('0x6')]=function(_0x2f26de,_0x5da313){return _0x2f26de['define'](_0x5133('0x7'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x5133('0x8'),'fields':[_0x5133('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 2d6a181..8a1d18c 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 _0x1a19=['result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3c060c,_0x545bc4){var _0x5aef0d=function(_0x2173b9){while(--_0x2173b9){_0x3c060c['push'](_0x3c060c['shift']());}};_0x5aef0d(++_0x545bc4);}(_0x1a19,0xe9));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x91a1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x91a1('0x1'));var fs=require('fs');var Redis=require(_0x91a1('0x2'));var db=require(_0x91a1('0x3'))['db'];var utils=require(_0x91a1('0x4'));var logger=require(_0x91a1('0x5'))('rpc');var config=require(_0x91a1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x91a1('0x7')][_0x91a1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x413ed0,_0x786532,_0x186825){return new BPromise(function(_0x116a56,_0x4c0f19){return client[_0x91a1('0x9')](_0x413ed0,_0x186825)[_0x91a1('0xa')](function(_0x24bc78){logger[_0x91a1('0xb')](_0x91a1('0xc'),_0x786532,'request\x20sent');logger['debug'](_0x91a1('0xd'),_0x786532,_0x91a1('0xe'),JSON[_0x91a1('0xf')](_0x24bc78));if(_0x24bc78[_0x91a1('0x10')]){if(_0x24bc78[_0x91a1('0x10')][_0x91a1('0x11')]===0x1f4){logger[_0x91a1('0x10')](_0x91a1('0xc'),_0x786532,_0x24bc78[_0x91a1('0x10')]['message']);return _0x4c0f19(_0x24bc78['error'][_0x91a1('0x12')]);}logger[_0x91a1('0x10')](_0x91a1('0xc'),_0x786532,_0x24bc78[_0x91a1('0x10')][_0x91a1('0x12')]);return _0x116a56(_0x24bc78[_0x91a1('0x10')][_0x91a1('0x12')]);}else{logger['info'](_0x91a1('0xc'),_0x786532,_0x91a1('0xe'));_0x116a56(_0x24bc78[_0x91a1('0x13')][_0x91a1('0x12')]);}})[_0x91a1('0x14')](function(_0x4bccb0){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x786532,_0x4bccb0);_0x4c0f19(_0x4bccb0);});});} \ No newline at end of file +var _0x22bf=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','result'];(function(_0xdf7d60,_0x59893c){var _0x5d3b1f=function(_0xcedc4b){while(--_0xcedc4b){_0xdf7d60['push'](_0xdf7d60['shift']());}};_0x5d3b1f(++_0x59893c);}(_0x22bf,0x135));var _0xf22b=function(_0x3364e1,_0x45966d){_0x3364e1=_0x3364e1-0x0;var _0x1e5e03=_0x22bf[_0x3364e1];return _0x1e5e03;};'use strict';var _=require(_0xf22b('0x0'));var util=require(_0xf22b('0x1'));var moment=require(_0xf22b('0x2'));var BPromise=require(_0xf22b('0x3'));var rs=require(_0xf22b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf22b('0x5'))['db'];var utils=require(_0xf22b('0x6'));var logger=require(_0xf22b('0x7'))(_0xf22b('0x8'));var config=require(_0xf22b('0x9'));var jayson=require(_0xf22b('0xa'));var client=jayson['client'][_0xf22b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fb7c2,_0x125cf9,_0x10773d){return new BPromise(function(_0xd58829,_0x3247f5){return client[_0xf22b('0xc')](_0x3fb7c2,_0x10773d)['then'](function(_0x508f43){logger[_0xf22b('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x125cf9,_0xf22b('0xe'));logger[_0xf22b('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x125cf9,_0xf22b('0xe'),JSON[_0xf22b('0x10')](_0x508f43));if(_0x508f43[_0xf22b('0x11')]){if(_0x508f43[_0xf22b('0x11')]['code']===0x1f4){logger[_0xf22b('0x11')](_0xf22b('0x12'),_0x125cf9,_0x508f43[_0xf22b('0x11')][_0xf22b('0x13')]);return _0x3247f5(_0x508f43[_0xf22b('0x11')][_0xf22b('0x13')]);}logger[_0xf22b('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x125cf9,_0x508f43[_0xf22b('0x11')]['message']);return _0xd58829(_0x508f43['error'][_0xf22b('0x13')]);}else{logger['info'](_0xf22b('0x12'),_0x125cf9,_0xf22b('0xe'));_0xd58829(_0x508f43[_0xf22b('0x14')][_0xf22b('0x13')]);}})[_0xf22b('0x15')](function(_0x52b0cc){logger[_0xf22b('0x11')](_0xf22b('0x12'),_0x125cf9,_0x52b0cc);_0x3247f5(_0x52b0cc);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 8aee6a7..830089e 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 _0xdf33=['get','isAuthenticated','show','/:id/sounds','getSounds','post','create','update','/:id','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdf33,0xfd));var _0x3df3=function(_0x335bc4,_0x27f3fd){_0x335bc4=_0x335bc4-0x0;var _0x3240fc=_0xdf33[_0x335bc4];return _0x3240fc;};'use strict';var multer=require(_0x3df3('0x0'));var util=require(_0x3df3('0x1'));var path=require(_0x3df3('0x2'));var timeout=require(_0x3df3('0x3'));var express=require('express');var router=express[_0x3df3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3df3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3df3('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x3df3('0x7')]('/',auth[_0x3df3('0x8')](),controller['index']);router[_0x3df3('0x7')]('/:id',auth[_0x3df3('0x8')](),controller[_0x3df3('0x9')]);router[_0x3df3('0x7')](_0x3df3('0xa'),auth['isAuthenticated'](),controller[_0x3df3('0xb')]);router[_0x3df3('0xc')]('/',auth[_0x3df3('0x8')](),controller[_0x3df3('0xd')]);router[_0x3df3('0xc')](_0x3df3('0xa'),auth[_0x3df3('0x8')](),controller['addSound']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3df3('0xe')]);router['delete'](_0x3df3('0xf'),auth[_0x3df3('0x8')](),controller[_0x3df3('0x10')]);router['delete'](_0x3df3('0x11'),auth[_0x3df3('0x8')](),controller[_0x3df3('0x12')]);module[_0x3df3('0x13')]=router; \ No newline at end of file +var _0x3e45=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','getSounds','create','/:id/sounds','addSound','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','express','Router','fs-extra'];(function(_0x242e07,_0x2fa9e5){var _0x13f134=function(_0x10a124){while(--_0x10a124){_0x242e07['push'](_0x242e07['shift']());}};_0x13f134(++_0x2fa9e5);}(_0x3e45,0x16b));var _0x53e4=function(_0x2d08b5,_0x1f1d49){_0x2d08b5=_0x2d08b5-0x0;var _0x38bec0=_0x3e45[_0x2d08b5];return _0x38bec0;};'use strict';var multer=require(_0x53e4('0x0'));var util=require('util');var path=require(_0x53e4('0x1'));var timeout=require('connect-timeout');var express=require(_0x53e4('0x2'));var router=express[_0x53e4('0x3')]();var fs_extra=require(_0x53e4('0x4'));var auth=require(_0x53e4('0x5'));var interaction=require(_0x53e4('0x6'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0x53e4('0x7')]('/',auth['isAuthenticated'](),controller[_0x53e4('0x8')]);router[_0x53e4('0x7')](_0x53e4('0x9'),auth[_0x53e4('0xa')](),controller[_0x53e4('0xb')]);router[_0x53e4('0x7')]('/:id/sounds',auth[_0x53e4('0xa')](),controller[_0x53e4('0xc')]);router['post']('/',auth[_0x53e4('0xa')](),controller[_0x53e4('0xd')]);router['post'](_0x53e4('0xe'),auth['isAuthenticated'](),controller[_0x53e4('0xf')]);router[_0x53e4('0x10')](_0x53e4('0x9'),auth[_0x53e4('0xa')](),controller[_0x53e4('0x11')]);router[_0x53e4('0x12')](_0x53e4('0x9'),auth[_0x53e4('0xa')](),controller[_0x53e4('0x13')]);router[_0x53e4('0x12')](_0x53e4('0x14'),auth[_0x53e4('0xa')](),controller[_0x53e4('0x15')]);module[_0x53e4('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 3a0bb2b..eeea6cb 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 _0xd33a=['exports','STRING','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x1512fe,_0x9e83f5){var _0x263d0e=function(_0xbeeac0){while(--_0xbeeac0){_0x1512fe['push'](_0x1512fe['shift']());}};_0x263d0e(++_0x9e83f5);}(_0xd33a,0x1df));var _0xad33=function(_0x3a2549,_0x51f586){_0x3a2549=_0x3a2549-0x0;var _0x5aeb82=_0xd33a[_0x3a2549];return _0x5aeb82;};'use strict';var Sequelize=require(_0xad33('0x0'));module[_0xad33('0x1')]={'name':{'type':Sequelize[_0xad33('0x2')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xad33('0x3')](_0xad33('0x4'),_0xad33('0x5'),_0xad33('0x6'),_0xad33('0x7'),_0xad33('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0xad33('0x5')},'directory':{'type':Sequelize[_0xad33('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xad33('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xad33('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xad33('0x2')],'allowNull':!![],'defaultValue':_0xad33('0x9')},'format':{'type':Sequelize[_0xad33('0x2')],'allowNull':!![]},'stamp':{'type':_0xad33('0xa')},'defaultEntry':{'type':Sequelize[_0xad33('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8f52=['TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom','mp3nb','quietmp3nb','mp3'];(function(_0x5bf0f8,_0x5d316b){var _0x236a0c=function(_0x59e0ca){while(--_0x59e0ca){_0x5bf0f8['push'](_0x5bf0f8['shift']());}};_0x236a0c(++_0x5d316b);}(_0x8f52,0xf2));var _0x28f5=function(_0x492221,_0x9e2521){_0x492221=_0x492221-0x0;var _0x398bf9=_0x8f52[_0x492221];return _0x398bf9;};'use strict';var Sequelize=require('sequelize');module[_0x28f5('0x0')]={'name':{'type':Sequelize[_0x28f5('0x1')],'allowNull':![],'unique':_0x28f5('0x2')},'mode':{'type':Sequelize[_0x28f5('0x3')](_0x28f5('0x4'),'files',_0x28f5('0x5'),_0x28f5('0x6'),'quietmp3',_0x28f5('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x28f5('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x28f5('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x28f5('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x28f5('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x28f5('0x1')],'allowNull':!![]},'stamp':{'type':_0x28f5('0x8')},'defaultEntry':{'type':Sequelize[_0x28f5('0x9')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 67634b4..0d07a9a 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 _0x7711=['MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','basename','extname','%s.%s','symlinkSync','Sequelize','removeSound','id2','createdAt','getSounds','length','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','json','apply','reject','update','then','destroy','get','end','sendStatus','stack','name','index','map','VoiceMusicOnHold','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','body','create','sequelize','transaction','mode','files','directory','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x2865ca,_0x52cfc6){var _0x1d4c71=function(_0x82ada2){while(--_0x82ada2){_0x2865ca['push'](_0x2865ca['shift']());}};_0x1d4c71(++_0x52cfc6);}(_0x7711,0x1e6));var _0x1771=function(_0x4b1f2d,_0x1a9828){_0x4b1f2d=_0x4b1f2d-0x0;var _0x3bb740=_0x7711[_0x4b1f2d];return _0x3bb740;};'use strict';var emlformat=require(_0x1771('0x0'));var rimraf=require(_0x1771('0x1'));var zipdir=require(_0x1771('0x2'));var jsonpatch=require(_0x1771('0x3'));var rp=require(_0x1771('0x4'));var moment=require('moment');var BPromise=require(_0x1771('0x5'));var Mustache=require(_0x1771('0x6'));var util=require(_0x1771('0x7'));var path=require(_0x1771('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1771('0x9'));var fs=require('fs');var fs_extra=require(_0x1771('0xa'));var _=require('lodash');var squel=require(_0x1771('0xb'));var crypto=require(_0x1771('0xc'));var jsforce=require(_0x1771('0xd'));var deskjs=require(_0x1771('0xe'));var toCsv=require(_0x1771('0xf'));var querystring=require(_0x1771('0x10'));var Papa=require(_0x1771('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1771('0x12'));var hardwareService=require(_0x1771('0x13'));var logger=require('../../config/logger')(_0x1771('0x14'));var utils=require(_0x1771('0x15'));var config=require(_0x1771('0x16'));var licenseUtil=require(_0x1771('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31fd9e,_0x34a628){_0x34a628=_0x34a628||0xcc;return function(_0xedf71b){if(_0xedf71b){return _0x31fd9e['sendStatus'](_0x34a628);}return _0x31fd9e['status'](_0x34a628)['end']();};}function respondWithResult(_0x1dc852,_0x3fc93d){_0x3fc93d=_0x3fc93d||0xc8;return function(_0x10b165){if(_0x10b165){return _0x1dc852[_0x1771('0x18')](_0x3fc93d)['json'](_0x10b165);}};}function respondWithFilteredResult(_0x2d338f,_0x55a887){return function(_0x3128f0){if(_0x3128f0){var _0x2c8237=typeof _0x55a887[_0x1771('0x19')]===_0x1771('0x1a')&&typeof _0x55a887[_0x1771('0x1b')]===_0x1771('0x1a');var _0x273510=_0x3128f0[_0x1771('0x1c')];var _0x9eab4c=_0x2c8237?0x0:_0x55a887[_0x1771('0x19')];var _0x1b388e=_0x2c8237?_0x3128f0[_0x1771('0x1c')]:_0x55a887[_0x1771('0x19')]+_0x55a887[_0x1771('0x1b')];var _0x4beeca;if(_0x1b388e>=_0x273510){_0x1b388e=_0x273510;_0x4beeca=0xc8;}else{_0x4beeca=0xce;}_0x2d338f[_0x1771('0x18')](_0x4beeca);return _0x2d338f['set']('Content-Range',_0x9eab4c+'-'+_0x1b388e+'/'+_0x273510)[_0x1771('0x1d')](_0x3128f0);}return null;};}function patchUpdates(_0x14cf85){return function(_0x4300ab){try{jsonpatch[_0x1771('0x1e')](_0x4300ab,_0x14cf85,!![]);}catch(_0x5bc700){return BPromise[_0x1771('0x1f')](_0x5bc700);}return _0x4300ab['save']();};}function saveUpdates(_0x11f42e,_0x3cc2e5){return function(_0x462a7f){if(_0x462a7f){return _0x462a7f[_0x1771('0x20')](_0x11f42e)[_0x1771('0x21')](function(_0x2b0076){return _0x2b0076;});}return null;};}function removeEntity(_0x18dc85,_0x1e9528){return function(_0x27920a){if(_0x27920a){return _0x27920a[_0x1771('0x22')]()[_0x1771('0x21')](function(){var _0x186aad=_0x27920a[_0x1771('0x23')]({'plain':!![]});var _0x162735='MusicOnHolds';return db['UserProfileResource'][_0x1771('0x22')]({'where':{'type':_0x162735,'resourceId':_0x186aad['id']}})[_0x1771('0x21')](function(){return _0x27920a;});})[_0x1771('0x21')](function(){_0x18dc85[_0x1771('0x18')](0xcc)[_0x1771('0x24')]();});}};}function handleEntityNotFound(_0x1b4509,_0x2cce43){return function(_0x33fdef){if(!_0x33fdef){_0x1b4509[_0x1771('0x25')](0x194);}return _0x33fdef;};}function handleError(_0x579cb4,_0xef2894){_0xef2894=_0xef2894||0x1f4;return function(_0x220b35){logger['error'](_0x220b35[_0x1771('0x26')]);if(_0x220b35['name']){delete _0x220b35[_0x1771('0x27')];}_0x579cb4['status'](_0xef2894)['send'](_0x220b35);};}exports[_0x1771('0x28')]=function(_0x2d34d2,_0x58eac5){var _0x4857d0={},_0x32338e={},_0x1ffd9d={'count':0x0,'rows':[]};var _0x751f05=_[_0x1771('0x29')](db[_0x1771('0x2a')]['rawAttributes'],function(_0x394d50){return{'name':_0x394d50['fieldName'],'type':_0x394d50[_0x1771('0x2b')][_0x1771('0x2c')]};});_0x32338e['model']=_[_0x1771('0x29')](_0x751f05,'name');_0x32338e['query']=_['keys'](_0x2d34d2[_0x1771('0x2d')]);_0x32338e[_0x1771('0x2e')]=_[_0x1771('0x2f')](_0x32338e[_0x1771('0x30')],_0x32338e[_0x1771('0x2d')]);_0x4857d0['attributes']=_[_0x1771('0x2f')](_0x32338e[_0x1771('0x30')],qs[_0x1771('0x31')](_0x2d34d2[_0x1771('0x2d')][_0x1771('0x31')]));_0x4857d0[_0x1771('0x32')]=_0x4857d0[_0x1771('0x32')]['length']?_0x4857d0['attributes']:_0x32338e['model'];if(!_0x2d34d2[_0x1771('0x2d')][_0x1771('0x33')](_0x1771('0x34'))){_0x4857d0['limit']=qs[_0x1771('0x1b')](_0x2d34d2[_0x1771('0x2d')][_0x1771('0x1b')]);_0x4857d0[_0x1771('0x19')]=qs[_0x1771('0x19')](_0x2d34d2[_0x1771('0x2d')][_0x1771('0x19')]);}_0x4857d0[_0x1771('0x35')]=qs[_0x1771('0x36')](_0x2d34d2[_0x1771('0x2d')]['sort']);delete _0x2d34d2['query'][_0x1771('0x36')];_0x4857d0[_0x1771('0x37')]=qs[_0x1771('0x2e')](_['pick'](_0x2d34d2[_0x1771('0x2d')],_0x32338e[_0x1771('0x2e')]),_0x751f05);if(_0x2d34d2[_0x1771('0x2d')][_0x1771('0x38')]){_0x4857d0['where']=_[_0x1771('0x39')](_0x4857d0[_0x1771('0x37')],{'$or':_[_0x1771('0x29')](_0x751f05,function(_0x4d1e16){if(_0x4d1e16[_0x1771('0x2b')]!==_0x1771('0x3a')){var _0x37fae0={};_0x37fae0[_0x4d1e16[_0x1771('0x27')]]={'$like':'%'+_0x2d34d2[_0x1771('0x2d')][_0x1771('0x38')]+'%'};return _0x37fae0;}})});}_0x4857d0=_['merge']({},_0x4857d0,_0x2d34d2[_0x1771('0x3b')]);var _0x5c051a={'where':_0x4857d0[_0x1771('0x37')]};return db['VoiceMusicOnHold']['count'](_0x5c051a)['then'](function(_0x39af4b){_0x1ffd9d['count']=_0x39af4b;if(_0x2d34d2[_0x1771('0x2d')][_0x1771('0x3c')]){_0x4857d0[_0x1771('0x3d')]=[{'all':!![]}];}return db[_0x1771('0x2a')][_0x1771('0x3e')](_0x4857d0);})['then'](function(_0x50a84f){_0x1ffd9d[_0x1771('0x3f')]=_0x50a84f;return _0x1ffd9d;})[_0x1771('0x21')](respondWithFilteredResult(_0x58eac5,_0x4857d0))[_0x1771('0x40')](handleError(_0x58eac5,null));};exports[_0x1771('0x41')]=function(_0x3f45f5,_0x402f8b){var _0x48221b={'raw':![],'where':{'id':_0x3f45f5[_0x1771('0x42')]['id']}},_0x16b495={};_0x16b495[_0x1771('0x30')]=_['keys'](db[_0x1771('0x2a')][_0x1771('0x43')]);_0x16b495['query']=_[_0x1771('0x44')](_0x3f45f5[_0x1771('0x2d')]);_0x16b495[_0x1771('0x2e')]=_[_0x1771('0x2f')](_0x16b495[_0x1771('0x30')],_0x16b495[_0x1771('0x2d')]);_0x48221b['attributes']=_[_0x1771('0x2f')](_0x16b495[_0x1771('0x30')],qs[_0x1771('0x31')](_0x3f45f5['query'][_0x1771('0x31')]));_0x48221b[_0x1771('0x32')]=_0x48221b['attributes']['length']?_0x48221b['attributes']:_0x16b495[_0x1771('0x30')];if(_0x3f45f5[_0x1771('0x2d')]['includeAll']){_0x48221b[_0x1771('0x3d')]=[{'all':!![]}];}_0x48221b=_['merge']({},_0x48221b,_0x3f45f5[_0x1771('0x3b')]);return db[_0x1771('0x2a')][_0x1771('0x45')](_0x48221b)[_0x1771('0x21')](handleEntityNotFound(_0x402f8b,null))[_0x1771('0x21')](respondWithResult(_0x402f8b,null))[_0x1771('0x40')](handleError(_0x402f8b,null));};exports['update']=function(_0x24f4be,_0x105371){if(_0x24f4be['body']['id']){delete _0x24f4be[_0x1771('0x46')]['id'];}return db[_0x1771('0x2a')]['find']({'where':{'id':_0x24f4be[_0x1771('0x42')]['id']}})[_0x1771('0x21')](handleEntityNotFound(_0x105371,null))[_0x1771('0x21')](saveUpdates(_0x24f4be[_0x1771('0x46')],null))['then'](respondWithResult(_0x105371,null))[_0x1771('0x40')](handleError(_0x105371,null));};exports[_0x1771('0x47')]=function(_0x58d131,_0x454943,_0x7e1eaa){return db[_0x1771('0x48')][_0x1771('0x49')](function(_0x430166){if(_0x58d131[_0x1771('0x46')][_0x1771('0x4a')]===_0x1771('0x4b')){_0x58d131[_0x1771('0x46')][_0x1771('0x4c')]=path['join'](config[_0x1771('0x4d')],_0x1771('0x4e'),_0x58d131[_0x1771('0x46')][_0x1771('0x27')]);}return db[_0x1771('0x2a')]['create'](_0x58d131[_0x1771('0x46')],{'transaction':_0x430166})[_0x1771('0x21')](function(_0x439257){if(_0x58d131[_0x1771('0x46')][_0x1771('0x4a')]===_0x1771('0x4b')){fs[_0x1771('0x4f')](_0x439257[_0x1771('0x4c')],parseInt(_0x1771('0x50'),0x8));}var _0x10e4bc=_0x58d131['user'][_0x1771('0x23')]({'plain':!![]});if(!_0x10e4bc)throw new Error(_0x1771('0x51'));if(_0x10e4bc['role']===_0x1771('0x52')){var _0x5de40f=_0x439257['get']({'plain':!![]});return db[_0x1771('0x53')][_0x1771('0x45')]({'where':{'name':_0x1771('0x54'),'userProfileId':_0x10e4bc[_0x1771('0x55')]},'raw':!![]})['then'](function(_0x454071){if(_0x454071&&_0x454071[_0x1771('0x56')]===0x0){return db[_0x1771('0x57')]['create']({'name':_0x5de40f['name'],'resourceId':_0x5de40f['id'],'type':_0x454071['name'],'sectionId':_0x454071['id']},{})[_0x1771('0x21')](function(){return _0x439257;});}else{return _0x439257;}})[_0x1771('0x40')](function(_0x1ae7cc){logger[_0x1771('0x58')](_0x1771('0x59'),_0x1ae7cc);});}return _0x439257;});})['then'](respondWithResult(_0x454943,0xc9))['catch'](handleError(_0x454943,null));};exports[_0x1771('0x22')]=function(_0x474576,_0x37d58c,_0x1ad97b){var _0xce8f1f;return db['VoiceMusicOnHold'][_0x1771('0x45')]({'where':{'id':_0x474576[_0x1771('0x42')]['id']}})['then'](function(_0x30ea8c){if(_0x30ea8c){return db[_0x1771('0x48')][_0x1771('0x49')](function(_0x980a26){return _0x30ea8c['destroy']({'transaction':_0x980a26,'raw':!![]})[_0x1771('0x21')](function(_0x2fb19c){if(_0x2fb19c[_0x1771('0x4c')]){fs[_0x1771('0x5a')](_0x2fb19c[_0x1771('0x4c')])[_0x1771('0x5b')](function(_0x120072){fs[_0x1771('0x5c')](path[_0x1771('0x5d')](_0x2fb19c[_0x1771('0x4c')],_0x120072));});fs['rmdirSync'](_0x2fb19c['directory']);}return _0x2fb19c;});})[_0x1771('0x40')](function(_0x4ed036){throw new db['Sequelize'][(_0x1771('0x5e'))](_0x4ed036[_0x1771('0x5f')]);});}})['then'](handleEntityNotFound(_0x37d58c,null))[_0x1771('0x21')](removeEntity(_0x37d58c,null))[_0x1771('0x40')](handleError(_0x37d58c,null));};exports[_0x1771('0x60')]=function(_0x1f898d,_0xc0917b,_0x26630e){return db['sequelize'][_0x1771('0x49')](function(_0x2a2349){var _0x4f2a20;return db['VoiceMusicOnHold'][_0x1771('0x45')]({'where':{'id':_0x1f898d[_0x1771('0x42')]['id']}})[_0x1771('0x21')](function(_0x231028){if(_0x231028){_0x4f2a20=_0x231028;return _0x231028[_0x1771('0x60')](_0x1f898d['body']['id'],{'transaction':_0x2a2349});}})['then'](function(_0x2240bd){if(_0x2240bd){return db[_0x1771('0x61')][_0x1771('0x62')]({'where':{'id':_0x1f898d[_0x1771('0x46')]['id']},'attributes':['id','name',_0x1771('0x63'),_0x1771('0x64'),'createdAt'],'raw':!![]});}})['then'](function(_0x188dc2){if(_0x188dc2){var _0x18b42b=path['join'](config[_0x1771('0x4d')],_0x1771('0x65'),util[_0x1771('0x66')]('%s.%s',path[_0x1771('0x67')](_0x188dc2[_0x1771('0x63')],path[_0x1771('0x68')](_0x188dc2['save_name'])),_0x188dc2[_0x1771('0x64')]));var _0x1d40df=path[_0x1771('0x5d')](config[_0x1771('0x4d')],_0x1771('0x4e'),_0x4f2a20[_0x1771('0x27')],util[_0x1771('0x66')](_0x1771('0x69'),_0x188dc2['name'],_0x188dc2[_0x1771('0x64')]));fs[_0x1771('0x6a')](_0x18b42b,_0x1d40df);return _0x188dc2;}})[_0x1771('0x40')](function(_0x6efe7d){throw new db[(_0x1771('0x6b'))]['ValidationError'](_0x6efe7d['message']);});})['then'](handleEntityNotFound(_0xc0917b,null))[_0x1771('0x21')](respondWithResult(_0xc0917b,0xc9))[_0x1771('0x40')](handleError(_0xc0917b,null));};exports[_0x1771('0x6c')]=function(_0x576fec,_0x3972e1,_0x42d051){return db[_0x1771('0x48')]['transaction'](function(_0x38d1cb){var _0x41f08f;return db[_0x1771('0x2a')][_0x1771('0x62')]({'where':{'id':_0x576fec[_0x1771('0x42')]['id']}})[_0x1771('0x21')](handleEntityNotFound(_0x3972e1,null))[_0x1771('0x21')](function(_0xb9fd7){if(_0xb9fd7){_0x41f08f=_0xb9fd7;return _0xb9fd7[_0x1771('0x6c')](_0x576fec[_0x1771('0x42')]['id2']);}})[_0x1771('0x21')](function(_0x3ddf34){if(_0x3ddf34){return db[_0x1771('0x61')][_0x1771('0x62')]({'where':{'id':_0x576fec[_0x1771('0x42')][_0x1771('0x6d')]},'attributes':['id','name',_0x1771('0x63'),_0x1771('0x64'),_0x1771('0x6e')],'raw':!![]});}})[_0x1771('0x21')](function(_0x4ca853){if(_0x4ca853){fs[_0x1771('0x5c')](path['join'](_0x41f08f[_0x1771('0x4c')],util[_0x1771('0x66')](_0x1771('0x69'),_0x4ca853['name'],_0x4ca853[_0x1771('0x64')])));return _0x4ca853;}})[_0x1771('0x40')](function(_0x370d85){throw new db[(_0x1771('0x6b'))]['ValidationError'](_0x370d85[_0x1771('0x5f')]);});})['then'](handleEntityNotFound(_0x3972e1,null))[_0x1771('0x21')](respondWithStatusCode(_0x3972e1,0xcc))[_0x1771('0x40')](handleError(_0x3972e1,null));};exports[_0x1771('0x6f')]=function(_0x5c4962,_0x31bfd9,_0x13626e){var _0x4d3c0d={};var _0xc01613={};var _0x4c9423;var _0x4b89ea;return db[_0x1771('0x2a')][_0x1771('0x62')]({'where':{'id':_0x5c4962[_0x1771('0x42')]['id']}})[_0x1771('0x21')](handleEntityNotFound(_0x31bfd9,null))[_0x1771('0x21')](function(_0x470a4d){if(_0x470a4d){_0x4c9423=_0x470a4d;_0xc01613['model']=_[_0x1771('0x44')](db[_0x1771('0x61')]['rawAttributes']);_0xc01613['query']=_['keys'](_0x5c4962[_0x1771('0x2d')]);_0xc01613[_0x1771('0x2e')]=_[_0x1771('0x2f')](_0xc01613[_0x1771('0x30')],_0xc01613['query']);_0x4d3c0d[_0x1771('0x32')]=_[_0x1771('0x2f')](_0xc01613[_0x1771('0x30')],qs['fields'](_0x5c4962[_0x1771('0x2d')][_0x1771('0x31')]));_0x4d3c0d['attributes']=_0x4d3c0d[_0x1771('0x32')][_0x1771('0x70')]?_0x4d3c0d[_0x1771('0x32')]:_0xc01613[_0x1771('0x30')];_0x4d3c0d[_0x1771('0x35')]=qs[_0x1771('0x36')](_0x5c4962[_0x1771('0x2d')]['sort']);_0x4d3c0d['where']=qs[_0x1771('0x2e')](_[_0x1771('0x71')](_0x5c4962['query'],_0xc01613[_0x1771('0x2e')]));if(_0x5c4962[_0x1771('0x2d')][_0x1771('0x38')]){_0x4d3c0d[_0x1771('0x37')]=_[_0x1771('0x39')](_0x4d3c0d[_0x1771('0x37')],{'$or':_[_0x1771('0x29')](_0x4d3c0d[_0x1771('0x32')],function(_0x54a239){var _0x142b39={};_0x142b39[_0x54a239]={'$like':'%'+_0x5c4962[_0x1771('0x2d')]['filter']+'%'};return _0x142b39;})});}_0x4d3c0d=_[_0x1771('0x39')]({},_0x4d3c0d,_0x5c4962[_0x1771('0x3b')]);return _0x4c9423[_0x1771('0x6f')](_0x4d3c0d);}})['then'](function(_0x29d2cd){if(_0x29d2cd){_0x4b89ea=_0x29d2cd[_0x1771('0x70')];if(!_0x5c4962['query'][_0x1771('0x33')](_0x1771('0x34'))){_0x4d3c0d[_0x1771('0x1b')]=qs[_0x1771('0x1b')](_0x5c4962[_0x1771('0x2d')]['limit']);_0x4d3c0d[_0x1771('0x19')]=qs[_0x1771('0x19')](_0x5c4962[_0x1771('0x2d')][_0x1771('0x19')]);}return _0x4c9423[_0x1771('0x6f')](_0x4d3c0d);}})[_0x1771('0x21')](function(_0x541ab9){if(_0x541ab9){return _0x541ab9?{'count':_0x4b89ea,'rows':_0x541ab9}:null;}})[_0x1771('0x21')](respondWithResult(_0x31bfd9,null))['catch'](handleError(_0x31bfd9,null));}; \ No newline at end of file +var _0xc8e3=['set','apply','save','update','then','destroy','get','UserProfileResource','stack','name','send','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','create','sequelize','transaction','files','root','server/files/moh','mode','directory','0777','user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','error','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','join','format','basename','extname','%s.%s','symlinkSync','removeSound','id2','getSounds','order','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','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','end','status','json','offset','undefined','limit','count'];(function(_0x165908,_0x22a0b8){var _0x4d112f=function(_0x305740){while(--_0x305740){_0x165908['push'](_0x165908['shift']());}};_0x4d112f(++_0x22a0b8);}(_0xc8e3,0x13b));var _0x3c8e=function(_0x451497,_0x263564){_0x451497=_0x451497-0x0;var _0x18a78a=_0xc8e3[_0x451497];return _0x18a78a;};'use strict';var emlformat=require(_0x3c8e('0x0'));var rimraf=require(_0x3c8e('0x1'));var zipdir=require(_0x3c8e('0x2'));var jsonpatch=require(_0x3c8e('0x3'));var rp=require('request-promise');var moment=require(_0x3c8e('0x4'));var BPromise=require(_0x3c8e('0x5'));var Mustache=require(_0x3c8e('0x6'));var util=require(_0x3c8e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x3c8e('0x8'));var ejs=require(_0x3c8e('0x9'));var fs=require('fs');var fs_extra=require(_0x3c8e('0xa'));var _=require(_0x3c8e('0xb'));var squel=require('squel');var crypto=require(_0x3c8e('0xc'));var jsforce=require(_0x3c8e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3c8e('0x8'));var querystring=require(_0x3c8e('0xe'));var Papa=require(_0x3c8e('0xf'));var Redis=require(_0x3c8e('0x10'));var authService=require(_0x3c8e('0x11'));var qs=require(_0x3c8e('0x12'));var as=require(_0x3c8e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c8e('0x14'))(_0x3c8e('0x15'));var utils=require(_0x3c8e('0x16'));var config=require(_0x3c8e('0x17'));var licenseUtil=require(_0x3c8e('0x18'));var db=require(_0x3c8e('0x19'))['db'];function respondWithStatusCode(_0x236eb1,_0x275785){_0x275785=_0x275785||0xcc;return function(_0x5ed8b3){if(_0x5ed8b3){return _0x236eb1['sendStatus'](_0x275785);}return _0x236eb1['status'](_0x275785)[_0x3c8e('0x1a')]();};}function respondWithResult(_0x1549c7,_0x497a99){_0x497a99=_0x497a99||0xc8;return function(_0x1e749d){if(_0x1e749d){return _0x1549c7[_0x3c8e('0x1b')](_0x497a99)[_0x3c8e('0x1c')](_0x1e749d);}};}function respondWithFilteredResult(_0x1c8bc1,_0x538c98){return function(_0x15e733){if(_0x15e733){var _0x475231=typeof _0x538c98[_0x3c8e('0x1d')]===_0x3c8e('0x1e')&&typeof _0x538c98[_0x3c8e('0x1f')]===_0x3c8e('0x1e');var _0x24f070=_0x15e733[_0x3c8e('0x20')];var _0x16b46a=_0x475231?0x0:_0x538c98[_0x3c8e('0x1d')];var _0x4cefdb=_0x475231?_0x15e733['count']:_0x538c98[_0x3c8e('0x1d')]+_0x538c98[_0x3c8e('0x1f')];var _0x3e5f73;if(_0x4cefdb>=_0x24f070){_0x4cefdb=_0x24f070;_0x3e5f73=0xc8;}else{_0x3e5f73=0xce;}_0x1c8bc1[_0x3c8e('0x1b')](_0x3e5f73);return _0x1c8bc1[_0x3c8e('0x21')]('Content-Range',_0x16b46a+'-'+_0x4cefdb+'/'+_0x24f070)[_0x3c8e('0x1c')](_0x15e733);}return null;};}function patchUpdates(_0x22d0ee){return function(_0x5abe25){try{jsonpatch[_0x3c8e('0x22')](_0x5abe25,_0x22d0ee,!![]);}catch(_0x5d6b50){return BPromise['reject'](_0x5d6b50);}return _0x5abe25[_0x3c8e('0x23')]();};}function saveUpdates(_0x2a6f57,_0x44eaa2){return function(_0x32694c){if(_0x32694c){return _0x32694c[_0x3c8e('0x24')](_0x2a6f57)[_0x3c8e('0x25')](function(_0x407b95){return _0x407b95;});}return null;};}function removeEntity(_0x386745,_0x534996){return function(_0x4c165b){if(_0x4c165b){return _0x4c165b[_0x3c8e('0x26')]()[_0x3c8e('0x25')](function(){var _0x152730=_0x4c165b[_0x3c8e('0x27')]({'plain':!![]});var _0x33b736='MusicOnHolds';return db[_0x3c8e('0x28')][_0x3c8e('0x26')]({'where':{'type':_0x33b736,'resourceId':_0x152730['id']}})[_0x3c8e('0x25')](function(){return _0x4c165b;});})['then'](function(){_0x386745[_0x3c8e('0x1b')](0xcc)[_0x3c8e('0x1a')]();});}};}function handleEntityNotFound(_0x311d3e,_0x4a5cd5){return function(_0x4d7007){if(!_0x4d7007){_0x311d3e['sendStatus'](0x194);}return _0x4d7007;};}function handleError(_0x550e6d,_0x3e8d8f){_0x3e8d8f=_0x3e8d8f||0x1f4;return function(_0x570fed){logger['error'](_0x570fed[_0x3c8e('0x29')]);if(_0x570fed['name']){delete _0x570fed[_0x3c8e('0x2a')];}_0x550e6d[_0x3c8e('0x1b')](_0x3e8d8f)[_0x3c8e('0x2b')](_0x570fed);};}exports['index']=function(_0x575cc2,_0x17eb9e){var _0x47f0c7={},_0x2084d7={},_0x35f135={'count':0x0,'rows':[]};var _0x18598b=_['map'](db[_0x3c8e('0x2c')][_0x3c8e('0x2d')],function(_0x1009e9){return{'name':_0x1009e9[_0x3c8e('0x2e')],'type':_0x1009e9[_0x3c8e('0x2f')][_0x3c8e('0x30')]};});_0x2084d7[_0x3c8e('0x31')]=_[_0x3c8e('0x32')](_0x18598b,_0x3c8e('0x2a'));_0x2084d7[_0x3c8e('0x33')]=_[_0x3c8e('0x34')](_0x575cc2[_0x3c8e('0x33')]);_0x2084d7[_0x3c8e('0x35')]=_['intersection'](_0x2084d7['model'],_0x2084d7[_0x3c8e('0x33')]);_0x47f0c7['attributes']=_[_0x3c8e('0x36')](_0x2084d7[_0x3c8e('0x31')],qs[_0x3c8e('0x37')](_0x575cc2['query']['fields']));_0x47f0c7[_0x3c8e('0x38')]=_0x47f0c7[_0x3c8e('0x38')]['length']?_0x47f0c7[_0x3c8e('0x38')]:_0x2084d7[_0x3c8e('0x31')];if(!_0x575cc2[_0x3c8e('0x33')][_0x3c8e('0x39')](_0x3c8e('0x3a'))){_0x47f0c7[_0x3c8e('0x1f')]=qs[_0x3c8e('0x1f')](_0x575cc2['query'][_0x3c8e('0x1f')]);_0x47f0c7[_0x3c8e('0x1d')]=qs['offset'](_0x575cc2[_0x3c8e('0x33')][_0x3c8e('0x1d')]);}_0x47f0c7['order']=qs[_0x3c8e('0x3b')](_0x575cc2[_0x3c8e('0x33')]['sort']);delete _0x575cc2[_0x3c8e('0x33')]['sort'];_0x47f0c7[_0x3c8e('0x3c')]=qs[_0x3c8e('0x35')](_[_0x3c8e('0x3d')](_0x575cc2[_0x3c8e('0x33')],_0x2084d7[_0x3c8e('0x35')]),_0x18598b);if(_0x575cc2[_0x3c8e('0x33')][_0x3c8e('0x3e')]){_0x47f0c7[_0x3c8e('0x3c')]=_['merge'](_0x47f0c7['where'],{'$or':_[_0x3c8e('0x32')](_0x18598b,function(_0x351461){if(_0x351461[_0x3c8e('0x2f')]!==_0x3c8e('0x3f')){var _0x4d762e={};_0x4d762e[_0x351461[_0x3c8e('0x2a')]]={'$like':'%'+_0x575cc2[_0x3c8e('0x33')][_0x3c8e('0x3e')]+'%'};return _0x4d762e;}})});}_0x47f0c7=_[_0x3c8e('0x40')]({},_0x47f0c7,_0x575cc2['options']);var _0xb131b4={'where':_0x47f0c7[_0x3c8e('0x3c')]};return db[_0x3c8e('0x2c')][_0x3c8e('0x20')](_0xb131b4)[_0x3c8e('0x25')](function(_0x4045ff){_0x35f135[_0x3c8e('0x20')]=_0x4045ff;if(_0x575cc2[_0x3c8e('0x33')][_0x3c8e('0x41')]){_0x47f0c7[_0x3c8e('0x42')]=[{'all':!![]}];}return db[_0x3c8e('0x2c')][_0x3c8e('0x43')](_0x47f0c7);})[_0x3c8e('0x25')](function(_0x2adace){_0x35f135[_0x3c8e('0x44')]=_0x2adace;return _0x35f135;})['then'](respondWithFilteredResult(_0x17eb9e,_0x47f0c7))[_0x3c8e('0x45')](handleError(_0x17eb9e,null));};exports[_0x3c8e('0x46')]=function(_0x12a693,_0x1d3cfd){var _0x1248a2={'raw':![],'where':{'id':_0x12a693[_0x3c8e('0x47')]['id']}},_0x4b4780={};_0x4b4780[_0x3c8e('0x31')]=_[_0x3c8e('0x34')](db[_0x3c8e('0x2c')][_0x3c8e('0x2d')]);_0x4b4780['query']=_[_0x3c8e('0x34')](_0x12a693['query']);_0x4b4780[_0x3c8e('0x35')]=_['intersection'](_0x4b4780[_0x3c8e('0x31')],_0x4b4780['query']);_0x1248a2[_0x3c8e('0x38')]=_['intersection'](_0x4b4780[_0x3c8e('0x31')],qs[_0x3c8e('0x37')](_0x12a693[_0x3c8e('0x33')][_0x3c8e('0x37')]));_0x1248a2[_0x3c8e('0x38')]=_0x1248a2[_0x3c8e('0x38')][_0x3c8e('0x48')]?_0x1248a2[_0x3c8e('0x38')]:_0x4b4780[_0x3c8e('0x31')];if(_0x12a693[_0x3c8e('0x33')]['includeAll']){_0x1248a2[_0x3c8e('0x42')]=[{'all':!![]}];}_0x1248a2=_['merge']({},_0x1248a2,_0x12a693[_0x3c8e('0x49')]);return db[_0x3c8e('0x2c')][_0x3c8e('0x4a')](_0x1248a2)[_0x3c8e('0x25')](handleEntityNotFound(_0x1d3cfd,null))[_0x3c8e('0x25')](respondWithResult(_0x1d3cfd,null))[_0x3c8e('0x45')](handleError(_0x1d3cfd,null));};exports[_0x3c8e('0x24')]=function(_0x1d4c5d,_0x4635fa){if(_0x1d4c5d['body']['id']){delete _0x1d4c5d[_0x3c8e('0x4b')]['id'];}return db[_0x3c8e('0x2c')][_0x3c8e('0x4a')]({'where':{'id':_0x1d4c5d[_0x3c8e('0x47')]['id']}})[_0x3c8e('0x25')](handleEntityNotFound(_0x4635fa,null))[_0x3c8e('0x25')](saveUpdates(_0x1d4c5d[_0x3c8e('0x4b')],null))[_0x3c8e('0x25')](respondWithResult(_0x4635fa,null))[_0x3c8e('0x45')](handleError(_0x4635fa,null));};exports[_0x3c8e('0x4c')]=function(_0x3f7b9a,_0x1d792d,_0x4caec4){return db[_0x3c8e('0x4d')][_0x3c8e('0x4e')](function(_0xf2ee16){if(_0x3f7b9a['body']['mode']===_0x3c8e('0x4f')){_0x3f7b9a[_0x3c8e('0x4b')]['directory']=path['join'](config[_0x3c8e('0x50')],_0x3c8e('0x51'),_0x3f7b9a['body'][_0x3c8e('0x2a')]);}return db[_0x3c8e('0x2c')][_0x3c8e('0x4c')](_0x3f7b9a[_0x3c8e('0x4b')],{'transaction':_0xf2ee16})[_0x3c8e('0x25')](function(_0x140d80){if(_0x3f7b9a['body'][_0x3c8e('0x52')]===_0x3c8e('0x4f')){fs['mkdirSync'](_0x140d80[_0x3c8e('0x53')],parseInt(_0x3c8e('0x54'),0x8));}var _0x4587ef=_0x3f7b9a[_0x3c8e('0x55')][_0x3c8e('0x27')]({'plain':!![]});if(!_0x4587ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4587ef[_0x3c8e('0x56')]==='user'){var _0x22971e=_0x140d80[_0x3c8e('0x27')]({'plain':!![]});return db[_0x3c8e('0x57')][_0x3c8e('0x4a')]({'where':{'name':_0x3c8e('0x58'),'userProfileId':_0x4587ef[_0x3c8e('0x59')]},'raw':!![]})['then'](function(_0x3adbfa){if(_0x3adbfa&&_0x3adbfa[_0x3c8e('0x5a')]===0x0){return db['UserProfileResource'][_0x3c8e('0x4c')]({'name':_0x22971e[_0x3c8e('0x2a')],'resourceId':_0x22971e['id'],'type':_0x3adbfa[_0x3c8e('0x2a')],'sectionId':_0x3adbfa['id']},{})[_0x3c8e('0x25')](function(){return _0x140d80;});}else{return _0x140d80;}})[_0x3c8e('0x45')](function(_0x4b0752){logger[_0x3c8e('0x5b')](_0x3c8e('0x5c'),_0x4b0752);});}return _0x140d80;});})['then'](respondWithResult(_0x1d792d,0xc9))[_0x3c8e('0x45')](handleError(_0x1d792d,null));};exports[_0x3c8e('0x26')]=function(_0xb85af9,_0x543efa,_0x1780a0){var _0x4db53a;return db['VoiceMusicOnHold'][_0x3c8e('0x4a')]({'where':{'id':_0xb85af9[_0x3c8e('0x47')]['id']}})[_0x3c8e('0x25')](function(_0x48de41){if(_0x48de41){return db[_0x3c8e('0x4d')][_0x3c8e('0x4e')](function(_0x2e31a1){return _0x48de41[_0x3c8e('0x26')]({'transaction':_0x2e31a1,'raw':!![]})[_0x3c8e('0x25')](function(_0x27e7af){if(_0x27e7af[_0x3c8e('0x53')]){fs[_0x3c8e('0x5d')](_0x27e7af[_0x3c8e('0x53')])[_0x3c8e('0x5e')](function(_0xe91e13){fs[_0x3c8e('0x5f')](path['join'](_0x27e7af[_0x3c8e('0x53')],_0xe91e13));});fs[_0x3c8e('0x60')](_0x27e7af['directory']);}return _0x27e7af;});})[_0x3c8e('0x45')](function(_0xed7455){throw new db[(_0x3c8e('0x61'))][(_0x3c8e('0x62'))](_0xed7455[_0x3c8e('0x63')]);});}})['then'](handleEntityNotFound(_0x543efa,null))[_0x3c8e('0x25')](removeEntity(_0x543efa,null))['catch'](handleError(_0x543efa,null));};exports[_0x3c8e('0x64')]=function(_0x58d661,_0x5858ac,_0x3d071e){return db[_0x3c8e('0x4d')][_0x3c8e('0x4e')](function(_0x52e144){var _0x2c5f65;return db[_0x3c8e('0x2c')][_0x3c8e('0x4a')]({'where':{'id':_0x58d661['params']['id']}})[_0x3c8e('0x25')](function(_0xdc397){if(_0xdc397){_0x2c5f65=_0xdc397;return _0xdc397[_0x3c8e('0x64')](_0x58d661['body']['id'],{'transaction':_0x52e144});}})[_0x3c8e('0x25')](function(_0x378c31){if(_0x378c31){return db[_0x3c8e('0x65')][_0x3c8e('0x66')]({'where':{'id':_0x58d661[_0x3c8e('0x4b')]['id']},'attributes':['id','name',_0x3c8e('0x67'),_0x3c8e('0x68'),_0x3c8e('0x69')],'raw':!![]});}})[_0x3c8e('0x25')](function(_0x58fcc8){if(_0x58fcc8){var _0x45bf8a=path[_0x3c8e('0x6a')](config[_0x3c8e('0x50')],'server/files/sounds/converted',util[_0x3c8e('0x6b')]('%s.%s',path[_0x3c8e('0x6c')](_0x58fcc8[_0x3c8e('0x67')],path[_0x3c8e('0x6d')](_0x58fcc8[_0x3c8e('0x67')])),_0x58fcc8['converted_format']));var _0x40ebf8=path[_0x3c8e('0x6a')](config[_0x3c8e('0x50')],_0x3c8e('0x51'),_0x2c5f65[_0x3c8e('0x2a')],util[_0x3c8e('0x6b')](_0x3c8e('0x6e'),_0x58fcc8[_0x3c8e('0x2a')],_0x58fcc8[_0x3c8e('0x68')]));fs[_0x3c8e('0x6f')](_0x45bf8a,_0x40ebf8);return _0x58fcc8;}})[_0x3c8e('0x45')](function(_0x49dda5){throw new db['Sequelize'][(_0x3c8e('0x62'))](_0x49dda5[_0x3c8e('0x63')]);});})[_0x3c8e('0x25')](handleEntityNotFound(_0x5858ac,null))[_0x3c8e('0x25')](respondWithResult(_0x5858ac,0xc9))['catch'](handleError(_0x5858ac,null));};exports[_0x3c8e('0x70')]=function(_0x466f80,_0x23a5ce,_0x10619e){return db[_0x3c8e('0x4d')]['transaction'](function(_0x177b9d){var _0x1fadfd;return db['VoiceMusicOnHold'][_0x3c8e('0x66')]({'where':{'id':_0x466f80['params']['id']}})[_0x3c8e('0x25')](handleEntityNotFound(_0x23a5ce,null))[_0x3c8e('0x25')](function(_0x322432){if(_0x322432){_0x1fadfd=_0x322432;return _0x322432[_0x3c8e('0x70')](_0x466f80[_0x3c8e('0x47')][_0x3c8e('0x71')]);}})[_0x3c8e('0x25')](function(_0x3363d2){if(_0x3363d2){return db[_0x3c8e('0x65')]['findOne']({'where':{'id':_0x466f80['params'][_0x3c8e('0x71')]},'attributes':['id',_0x3c8e('0x2a'),_0x3c8e('0x67'),_0x3c8e('0x68'),'createdAt'],'raw':!![]});}})[_0x3c8e('0x25')](function(_0x2167a0){if(_0x2167a0){fs[_0x3c8e('0x5f')](path[_0x3c8e('0x6a')](_0x1fadfd['directory'],util[_0x3c8e('0x6b')](_0x3c8e('0x6e'),_0x2167a0[_0x3c8e('0x2a')],_0x2167a0['converted_format'])));return _0x2167a0;}})['catch'](function(_0x4c8797){throw new db[(_0x3c8e('0x61'))][(_0x3c8e('0x62'))](_0x4c8797[_0x3c8e('0x63')]);});})[_0x3c8e('0x25')](handleEntityNotFound(_0x23a5ce,null))[_0x3c8e('0x25')](respondWithStatusCode(_0x23a5ce,0xcc))[_0x3c8e('0x45')](handleError(_0x23a5ce,null));};exports[_0x3c8e('0x72')]=function(_0x3f3b84,_0x596c25,_0x2389e4){var _0x1c989c={};var _0x338912={};var _0x371428;var _0x3ee7ac;return db[_0x3c8e('0x2c')]['findOne']({'where':{'id':_0x3f3b84[_0x3c8e('0x47')]['id']}})[_0x3c8e('0x25')](handleEntityNotFound(_0x596c25,null))['then'](function(_0x310f83){if(_0x310f83){_0x371428=_0x310f83;_0x338912[_0x3c8e('0x31')]=_[_0x3c8e('0x34')](db[_0x3c8e('0x65')][_0x3c8e('0x2d')]);_0x338912[_0x3c8e('0x33')]=_[_0x3c8e('0x34')](_0x3f3b84['query']);_0x338912['filters']=_[_0x3c8e('0x36')](_0x338912[_0x3c8e('0x31')],_0x338912[_0x3c8e('0x33')]);_0x1c989c[_0x3c8e('0x38')]=_[_0x3c8e('0x36')](_0x338912[_0x3c8e('0x31')],qs['fields'](_0x3f3b84[_0x3c8e('0x33')][_0x3c8e('0x37')]));_0x1c989c[_0x3c8e('0x38')]=_0x1c989c[_0x3c8e('0x38')][_0x3c8e('0x48')]?_0x1c989c[_0x3c8e('0x38')]:_0x338912[_0x3c8e('0x31')];_0x1c989c[_0x3c8e('0x73')]=qs[_0x3c8e('0x3b')](_0x3f3b84[_0x3c8e('0x33')][_0x3c8e('0x3b')]);_0x1c989c['where']=qs['filters'](_['pick'](_0x3f3b84['query'],_0x338912[_0x3c8e('0x35')]));if(_0x3f3b84[_0x3c8e('0x33')][_0x3c8e('0x3e')]){_0x1c989c[_0x3c8e('0x3c')]=_[_0x3c8e('0x40')](_0x1c989c[_0x3c8e('0x3c')],{'$or':_[_0x3c8e('0x32')](_0x1c989c['attributes'],function(_0x41018c){var _0x4a5671={};_0x4a5671[_0x41018c]={'$like':'%'+_0x3f3b84[_0x3c8e('0x33')][_0x3c8e('0x3e')]+'%'};return _0x4a5671;})});}_0x1c989c=_[_0x3c8e('0x40')]({},_0x1c989c,_0x3f3b84[_0x3c8e('0x49')]);return _0x371428[_0x3c8e('0x72')](_0x1c989c);}})['then'](function(_0x5c50d1){if(_0x5c50d1){_0x3ee7ac=_0x5c50d1[_0x3c8e('0x48')];if(!_0x3f3b84[_0x3c8e('0x33')][_0x3c8e('0x39')](_0x3c8e('0x3a'))){_0x1c989c['limit']=qs[_0x3c8e('0x1f')](_0x3f3b84[_0x3c8e('0x33')][_0x3c8e('0x1f')]);_0x1c989c[_0x3c8e('0x1d')]=qs[_0x3c8e('0x1d')](_0x3f3b84[_0x3c8e('0x33')][_0x3c8e('0x1d')]);}return _0x371428['getSounds'](_0x1c989c);}})[_0x3c8e('0x25')](function(_0x2ea77e){if(_0x2ea77e){return _0x2ea77e?{'count':_0x3ee7ac,'rows':_0x2ea77e}:null;}})[_0x3c8e('0x25')](respondWithResult(_0x596c25,null))[_0x3c8e('0x45')](handleError(_0x596c25,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index fabb1ed..ff36a1d 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 _0x0f24=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','voice_musiconhold','lodash'];(function(_0x59f0f7,_0x423bc4){var _0xf5ef2a=function(_0x53c37f){while(--_0x53c37f){_0x59f0f7['push'](_0x59f0f7['shift']());}};_0xf5ef2a(++_0x423bc4);}(_0x0f24,0x19f));var _0x40f2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0f24[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x40f2('0x0'));var util=require(_0x40f2('0x1'));var logger=require(_0x40f2('0x2'))('api');var moment=require(_0x40f2('0x3'));var BPromise=require(_0x40f2('0x4'));var rp=require(_0x40f2('0x5'));var fs=require('fs');var path=require(_0x40f2('0x6'));var rimraf=require(_0x40f2('0x7'));var config=require(_0x40f2('0x8'));var attributes=require(_0x40f2('0x9'));module[_0x40f2('0xa')]=function(_0x1dc110,_0xab72e9){return _0x1dc110['define'](_0x40f2('0xb'),attributes,{'tableName':_0x40f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67b8=['../../config/environment','./voiceMusicOnHold.attributes','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x50829b,_0x57e56a){var _0x2ef4db=function(_0xcdfd3b){while(--_0xcdfd3b){_0x50829b['push'](_0x50829b['shift']());}};_0x2ef4db(++_0x57e56a);}(_0x67b8,0x18b));var _0x867b=function(_0x241a5f,_0x5ddb72){_0x241a5f=_0x241a5f-0x0;var _0x27c2a1=_0x67b8[_0x241a5f];return _0x27c2a1;};'use strict';var _=require(_0x867b('0x0'));var util=require(_0x867b('0x1'));var logger=require(_0x867b('0x2'))('api');var moment=require(_0x867b('0x3'));var BPromise=require(_0x867b('0x4'));var rp=require(_0x867b('0x5'));var fs=require('fs');var path=require(_0x867b('0x6'));var rimraf=require(_0x867b('0x7'));var config=require(_0x867b('0x8'));var attributes=require(_0x867b('0x9'));module['exports']=function(_0x408438,_0x37be97){return _0x408438[_0x867b('0xa')](_0x867b('0xb'),attributes,{'tableName':_0x867b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 6cf1856..f9f46eb 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x49f158,_0x5102b0){var _0x334058=function(_0x4a6023){while(--_0x4a6023){_0x49f158['push'](_0x49f158['shift']());}};_0x334058(++_0x5102b0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0xcb91[_0x441f7a];return _0x4821da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _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(_0x2e4a84,_0x5b5e09){var _0x20f22b=function(_0x1996ea){while(--_0x1996ea){_0x2e4a84['push'](_0x2e4a84['shift']());}};_0x20f22b(++_0x5b5e09);}(_0x70e0,0x17b));var _0x070e=function(_0x2caa46,_0x518e20){_0x2caa46=_0x2caa46-0x0;var _0x4f79bb=_0x70e0[_0x2caa46];return _0x4f79bb;};'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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 742cf38..3768874 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 _0x4ce6=['/:id/teams','getTeams','post','create','addTeams','put','update','delete','destroy','removeAgents','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/users'];(function(_0x13c117,_0x55ac19){var _0xe752ab=function(_0x211400){while(--_0x211400){_0x13c117['push'](_0x13c117['shift']());}};_0xe752ab(++_0x55ac19);}(_0x4ce6,0x108));var _0x64ce=function(_0x1e6b59,_0x5eca5d){_0x1e6b59=_0x1e6b59-0x0;var _0x40d7c5=_0x4ce6[_0x1e6b59];return _0x40d7c5;};'use strict';var multer=require(_0x64ce('0x0'));var util=require('util');var path=require(_0x64ce('0x1'));var timeout=require(_0x64ce('0x2'));var express=require(_0x64ce('0x3'));var router=express[_0x64ce('0x4')]();var fs_extra=require(_0x64ce('0x5'));var auth=require(_0x64ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x64ce('0x7'));var controller=require('./voicePrefix.controller');router['get']('/',auth[_0x64ce('0x8')](),controller[_0x64ce('0x9')]);router['get'](_0x64ce('0xa'),auth[_0x64ce('0x8')](),controller[_0x64ce('0xb')]);router[_0x64ce('0xc')](_0x64ce('0xd'),auth[_0x64ce('0x8')](),controller[_0x64ce('0xe')]);router[_0x64ce('0xc')](_0x64ce('0xf'),auth[_0x64ce('0x8')](),controller['getAgents']);router[_0x64ce('0xc')](_0x64ce('0x10'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x11')]);router[_0x64ce('0x12')]('/',auth[_0x64ce('0x8')](),controller[_0x64ce('0x13')]);router[_0x64ce('0x12')]('/:id/users',auth[_0x64ce('0x8')](),controller['addAgents']);router['post'](_0x64ce('0x10'),auth['isAuthenticated'](),controller[_0x64ce('0x14')]);router[_0x64ce('0x15')](_0x64ce('0xd'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x16')]);router[_0x64ce('0x17')](_0x64ce('0xd'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x64ce('0x19')]);router[_0x64ce('0x17')](_0x64ce('0x10'),auth[_0x64ce('0x8')](),controller[_0x64ce('0x1a')]);module[_0x64ce('0x1b')]=router; \ No newline at end of file +var _0xb87c=['removeAgents','removeTeams','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','post','create','addAgents','addTeams','delete','destroy'];(function(_0xceb153,_0x2c2c69){var _0x32e966=function(_0x5bc8ef){while(--_0x5bc8ef){_0xceb153['push'](_0xceb153['shift']());}};_0x32e966(++_0x2c2c69);}(_0xb87c,0x1d7));var _0xcb87=function(_0x179627,_0x2b0312){_0x179627=_0x179627-0x0;var _0x1f31f1=_0xb87c[_0x179627];return _0x1f31f1;};'use strict';var multer=require('multer');var util=require(_0xcb87('0x0'));var path=require(_0xcb87('0x1'));var timeout=require(_0xcb87('0x2'));var express=require(_0xcb87('0x3'));var router=express[_0xcb87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb87('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcb87('0x6'));router[_0xcb87('0x7')]('/',auth[_0xcb87('0x8')](),controller[_0xcb87('0x9')]);router[_0xcb87('0x7')](_0xcb87('0xa'),auth['isAuthenticated'](),controller[_0xcb87('0xb')]);router[_0xcb87('0x7')](_0xcb87('0xc'),auth[_0xcb87('0x8')](),controller[_0xcb87('0xd')]);router['get'](_0xcb87('0xe'),auth[_0xcb87('0x8')](),controller[_0xcb87('0xf')]);router[_0xcb87('0x7')](_0xcb87('0x10'),auth[_0xcb87('0x8')](),controller['getTeams']);router[_0xcb87('0x11')]('/',auth[_0xcb87('0x8')](),controller[_0xcb87('0x12')]);router[_0xcb87('0x11')]('/:id/users',auth[_0xcb87('0x8')](),controller[_0xcb87('0x13')]);router['post'](_0xcb87('0x10'),auth['isAuthenticated'](),controller[_0xcb87('0x14')]);router['put'](_0xcb87('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xcb87('0x15')]('/:id',auth[_0xcb87('0x8')](),controller[_0xcb87('0x16')]);router['delete'](_0xcb87('0xe'),auth[_0xcb87('0x8')](),controller[_0xcb87('0x17')]);router[_0xcb87('0x15')]('/:id/teams',auth[_0xcb87('0x8')](),controller[_0xcb87('0x18')]);module[_0xcb87('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a0c4122..14e51f5 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 _0x5a7d=['exports','name','system-','getDataValue','STRING','INTEGER','sequelize'];(function(_0x2faa1b,_0x2e64b3){var _0xcf83c1=function(_0x2599d1){while(--_0x2599d1){_0x2faa1b['push'](_0x2faa1b['shift']());}};_0xcf83c1(++_0x2e64b3);}(_0x5a7d,0x1db));var _0xd5a7=function(_0x3fa4bd,_0x14a72d){_0x3fa4bd=_0x3fa4bd-0x0;var _0x358c95=_0x5a7d[_0x3fa4bd];return _0x358c95;};'use strict';var Sequelize=require(_0xd5a7('0x0'));module[_0xd5a7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd5a7('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0xa37ad3){return _0xd5a7('0x3')+this[_0xd5a7('0x4')](_0xd5a7('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xd5a7('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0xd5a7('0x6')]}}; \ No newline at end of file +var _0x5667=['VIRTUAL','system-','name','INTEGER','STRING'];(function(_0x27ec50,_0x1d8698){var _0x2da0f5=function(_0x206a3e){while(--_0x206a3e){_0x27ec50['push'](_0x27ec50['shift']());}};_0x2da0f5(++_0x1d8698);}(_0x5667,0xd6));var _0x7566=function(_0x27a6fd,_0x3de57b){_0x27a6fd=_0x27a6fd-0x0;var _0x5c58c3=_0x5667[_0x27a6fd];return _0x5c58c3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7566('0x0')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x7566('0x1')],'get':function(_0x33d099){return _0x7566('0x2')+this['getDataValue'](_0x7566('0x3'))+'-';}},'description':{'type':Sequelize[_0x7566('0x0')]},'callerIdAll':{'type':Sequelize[_0x7566('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0x7566('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index ecca418..c3c84ed 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 _0x6343=['create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','type','priority','NoOp','Voice\x20Prefix','VoicePrefixId','push','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','${EXTEN:','charAt','prefix','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','order','getTeams','Team','pick','hasOwnProperty','addTeams','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','every','includes','all','union','compact','value','removeTeams','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','includeAll','include','findAll','catch','show','params','length','options','find','describe'];(function(_0x5c61a9,_0x4b8ddb){var _0x7b0451=function(_0xb24e4c){while(--_0xb24e4c){_0x5c61a9['push'](_0x5c61a9['shift']());}};_0x7b0451(++_0x4b8ddb);}(_0x6343,0x168));var _0x3634=function(_0x3b381e,_0x54b373){_0x3b381e=_0x3b381e-0x0;var _0x2cbe88=_0x6343[_0x3b381e];return _0x2cbe88;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];config[_0x3634('0x13')]=_[_0x3634('0x14')](config[_0x3634('0x13')],{'host':_0x3634('0x15'),'port':0x18eb});var socket=require(_0x3634('0x16'))(new Redis(config[_0x3634('0x13')]));require(_0x3634('0x17'))[_0x3634('0x18')](socket);function respondWithStatusCode(_0x7e4801,_0x2ad793){_0x2ad793=_0x2ad793||0xcc;return function(_0x5a5063){if(_0x5a5063){return _0x7e4801[_0x3634('0x19')](_0x2ad793);}return _0x7e4801['status'](_0x2ad793)[_0x3634('0x1a')]();};}function respondWithResult(_0x18285c,_0x2fc628){_0x2fc628=_0x2fc628||0xc8;return function(_0x78f93f){if(_0x78f93f){return _0x18285c[_0x3634('0x1b')](_0x2fc628)['json'](_0x78f93f);}};}function respondWithFilteredResult(_0x3121a3,_0x4b8ec8){return function(_0x50350d){if(_0x50350d){var _0x2aaac7=typeof _0x4b8ec8['offset']===_0x3634('0x1c')&&typeof _0x4b8ec8[_0x3634('0x1d')]===_0x3634('0x1c');var _0x5603d2=_0x50350d[_0x3634('0x1e')];var _0x4366bc=_0x2aaac7?0x0:_0x4b8ec8['offset'];var _0xeb9231=_0x2aaac7?_0x50350d['count']:_0x4b8ec8[_0x3634('0x1f')]+_0x4b8ec8[_0x3634('0x1d')];var _0x5b77a7;if(_0xeb9231>=_0x5603d2){_0xeb9231=_0x5603d2;_0x5b77a7=0xc8;}else{_0x5b77a7=0xce;}_0x3121a3[_0x3634('0x1b')](_0x5b77a7);return _0x3121a3[_0x3634('0x20')](_0x3634('0x21'),_0x4366bc+'-'+_0xeb9231+'/'+_0x5603d2)['json'](_0x50350d);}return null;};}function patchUpdates(_0x22b7ef){return function(_0x2c8874){try{jsonpatch['apply'](_0x2c8874,_0x22b7ef,!![]);}catch(_0x3936ee){return BPromise['reject'](_0x3936ee);}return _0x2c8874['save']();};}function saveUpdates(_0x3a8c41,_0x862ab5){return function(_0x5df6fb){if(_0x5df6fb){return _0x5df6fb[_0x3634('0x22')](_0x3a8c41)[_0x3634('0x23')](function(_0x17db44){return _0x17db44;});}return null;};}function removeEntity(_0x225ddc,_0x363ca2){return function(_0x12bca9){if(_0x12bca9){return _0x12bca9[_0x3634('0x24')]()[_0x3634('0x23')](function(){var _0x22f1f1=_0x12bca9['get']({'plain':!![]});var _0x1b0a44='VoicePrefixes';return db['UserProfileResource']['destroy']({'where':{'type':_0x1b0a44,'resourceId':_0x22f1f1['id']}})[_0x3634('0x23')](function(){return _0x12bca9;});})['then'](function(){_0x225ddc[_0x3634('0x1b')](0xcc)[_0x3634('0x1a')]();});}};}function handleEntityNotFound(_0x49804f,_0x55a77f){return function(_0x282f73){if(!_0x282f73){_0x49804f['sendStatus'](0x194);}return _0x282f73;};}function handleError(_0x281504,_0x5d273c){_0x5d273c=_0x5d273c||0x1f4;return function(_0x1e04cc){logger[_0x3634('0x25')](_0x1e04cc[_0x3634('0x26')]);if(_0x1e04cc[_0x3634('0x27')]){delete _0x1e04cc[_0x3634('0x27')];}_0x281504[_0x3634('0x1b')](_0x5d273c)[_0x3634('0x28')](_0x1e04cc);};}exports[_0x3634('0x29')]=function(_0x507753,_0x535215){var _0x4d26b4={},_0x3ebdbf={},_0x4abc18={'count':0x0,'rows':[]};var _0xb9bc8c=_[_0x3634('0x2a')](db[_0x3634('0x2b')][_0x3634('0x2c')],function(_0x28e3a0){return{'name':_0x28e3a0[_0x3634('0x2d')],'type':_0x28e3a0['type'][_0x3634('0x2e')]};});_0x3ebdbf[_0x3634('0x2f')]=_[_0x3634('0x2a')](_0xb9bc8c,_0x3634('0x27'));_0x3ebdbf[_0x3634('0x30')]=_[_0x3634('0x31')](_0x507753[_0x3634('0x30')]);_0x3ebdbf[_0x3634('0x32')]=_[_0x3634('0x33')](_0x3ebdbf['model'],_0x3ebdbf[_0x3634('0x30')]);_0x4d26b4[_0x3634('0x34')]=_[_0x3634('0x33')](_0x3ebdbf[_0x3634('0x2f')],qs['fields'](_0x507753[_0x3634('0x30')][_0x3634('0x35')]));_0x4d26b4[_0x3634('0x34')]=_0x4d26b4['attributes']['length']?_0x4d26b4['attributes']:_0x3ebdbf[_0x3634('0x2f')];if(!_0x507753[_0x3634('0x30')]['hasOwnProperty'](_0x3634('0x36'))){_0x4d26b4[_0x3634('0x1d')]=qs[_0x3634('0x1d')](_0x507753[_0x3634('0x30')][_0x3634('0x1d')]);_0x4d26b4[_0x3634('0x1f')]=qs[_0x3634('0x1f')](_0x507753['query'][_0x3634('0x1f')]);}_0x4d26b4['order']=qs[_0x3634('0x37')](_0x507753[_0x3634('0x30')][_0x3634('0x37')]);_0x4d26b4[_0x3634('0x38')]=qs[_0x3634('0x32')](_['pick'](_0x507753[_0x3634('0x30')],_0x3ebdbf[_0x3634('0x32')]),_0xb9bc8c);if(_0x507753[_0x3634('0x30')][_0x3634('0x39')]){_0x4d26b4[_0x3634('0x38')]=_[_0x3634('0x3a')](_0x4d26b4[_0x3634('0x38')],{'$or':_[_0x3634('0x2a')](_0xb9bc8c,function(_0x16b43d){if(_0x16b43d['type']!=='VIRTUAL'){var _0x14586d={};_0x14586d[_0x16b43d['name']]={'$like':'%'+_0x507753['query']['filter']+'%'};return _0x14586d;}})});}_0x4d26b4=_[_0x3634('0x3a')]({},_0x4d26b4,_0x507753['options']);var _0x197d65={'where':_0x4d26b4[_0x3634('0x38')]};return db['VoicePrefix']['count'](_0x197d65)['then'](function(_0x324970){_0x4abc18[_0x3634('0x1e')]=_0x324970;if(_0x507753['query'][_0x3634('0x3b')]){_0x4d26b4[_0x3634('0x3c')]=[{'all':!![]}];}return db[_0x3634('0x2b')][_0x3634('0x3d')](_0x4d26b4);})[_0x3634('0x23')](function(_0x5f0711){_0x4abc18['rows']=_0x5f0711;return _0x4abc18;})[_0x3634('0x23')](respondWithFilteredResult(_0x535215,_0x4d26b4))[_0x3634('0x3e')](handleError(_0x535215,null));};exports[_0x3634('0x3f')]=function(_0x2bced7,_0x14e88c){var _0x30dd54={'raw':![],'where':{'id':_0x2bced7[_0x3634('0x40')]['id']}},_0x4bfeec={};_0x4bfeec[_0x3634('0x2f')]=_[_0x3634('0x31')](db['VoicePrefix']['rawAttributes']);_0x4bfeec[_0x3634('0x30')]=_[_0x3634('0x31')](_0x2bced7[_0x3634('0x30')]);_0x4bfeec[_0x3634('0x32')]=_[_0x3634('0x33')](_0x4bfeec[_0x3634('0x2f')],_0x4bfeec[_0x3634('0x30')]);_0x30dd54[_0x3634('0x34')]=_['intersection'](_0x4bfeec[_0x3634('0x2f')],qs[_0x3634('0x35')](_0x2bced7[_0x3634('0x30')][_0x3634('0x35')]));_0x30dd54[_0x3634('0x34')]=_0x30dd54[_0x3634('0x34')][_0x3634('0x41')]?_0x30dd54[_0x3634('0x34')]:_0x4bfeec[_0x3634('0x2f')];if(_0x2bced7['query'][_0x3634('0x3b')]){_0x30dd54[_0x3634('0x3c')]=[{'all':!![]}];}_0x30dd54=_['merge']({},_0x30dd54,_0x2bced7[_0x3634('0x42')]);return db[_0x3634('0x2b')][_0x3634('0x43')](_0x30dd54)[_0x3634('0x23')](handleEntityNotFound(_0x14e88c,null))[_0x3634('0x23')](respondWithResult(_0x14e88c,null))[_0x3634('0x3e')](handleError(_0x14e88c,null));};exports['destroy']=function(_0x2663a2,_0x2356a9){return db[_0x3634('0x2b')][_0x3634('0x43')]({'where':{'id':_0x2663a2[_0x3634('0x40')]['id']}})['then'](handleEntityNotFound(_0x2356a9,null))[_0x3634('0x23')](removeEntity(_0x2356a9,null))[_0x3634('0x3e')](handleError(_0x2356a9,null));};exports['describe']=function(_0x52b79b,_0x3eb274){return db['VoicePrefix'][_0x3634('0x44')]()[_0x3634('0x23')](respondWithResult(_0x3eb274,null))[_0x3634('0x3e')](handleError(_0x3eb274,null));};exports[_0x3634('0x45')]=function(_0x5a024e,_0x274494){var _0x26d8d0;return db[_0x3634('0x46')][_0x3634('0x47')](function(_0x1ac9a9){return db[_0x3634('0x2b')][_0x3634('0x45')](_0x5a024e[_0x3634('0x48')],{'transaction':_0x1ac9a9})[_0x3634('0x23')](function(_0x320286){_0x26d8d0=_0x320286[_0x3634('0x49')]({'plain':!![]});return db[_0x3634('0x4a')]['find']({'where':{'id':_0x26d8d0[_0x3634('0x4b')]},'raw':!![]})[_0x3634('0x23')](function(_0x75547c){return createVoicePrefixExtensions(_0x26d8d0,_0x75547c,_0x1ac9a9);});});})[_0x3634('0x23')](function(){var _0x752546=_0x5a024e[_0x3634('0x4c')][_0x3634('0x49')]({'plain':!![]});if(!_0x752546)throw new Error(_0x3634('0x4d'));if(_0x752546[_0x3634('0x4e')]==='user'){var _0x2bcb9e=_0x26d8d0;return db[_0x3634('0x4f')]['find']({'where':{'name':_0x3634('0x50'),'userProfileId':_0x752546[_0x3634('0x51')]},'raw':!![]})['then'](function(_0x1089c2){if(_0x1089c2&&_0x1089c2[_0x3634('0x52')]===0x0){return db[_0x3634('0x53')]['create']({'name':_0x2bcb9e[_0x3634('0x27')],'resourceId':_0x2bcb9e['id'],'type':_0x1089c2['name'],'sectionId':_0x1089c2['id']},{})[_0x3634('0x23')](function(){return _0x26d8d0;});}else{return _0x26d8d0;}})['catch'](function(_0x960c9a){logger[_0x3634('0x25')](_0x3634('0x54'),_0x960c9a);throw _0x960c9a;});}return _0x26d8d0;})['then'](respondWithResult(_0x274494,null))[_0x3634('0x3e')](handleError(_0x274494,null));};function Extension(_0x2b72cd,_0x5df700,_0x2a2c92,_0xbc0017){this[_0x3634('0x55')]=_0x3634('0x56');this['exten']=_0x2b72cd;this[_0x3634('0x57')]=_0x2a2c92;this[_0x3634('0x58')]='system';this['description']='Voice\x20Prefix\x20Extension';this[_0x3634('0x59')]=_0x5df700;this['appdata']=_0xbc0017;}function createVoicePrefixExtensions(_0x1a3205,_0x31f838,_0x185b18){return new BPromise(function(_0x5e29a2,_0x1445a4){var _0x3f3dc1=new Extension(formatPrefixName(_0x1a3205['prefix']),0x1,_0x3634('0x5a'),_0x3634('0x5b'));_0x3f3dc1[_0x3634('0x5c')]=_0x1a3205['id'];return db['VoiceExtension'][_0x3634('0x45')](_0x3f3dc1,{'transaction':_0x185b18})[_0x3634('0x23')](function(_0x897c0e){var _0xb7dd01=_0x897c0e[_0x3634('0x49')]({'plain':!![]});var _0x4af226=_[_0x3634('0x2a')](addVoicePrefixExtensions(_0x1a3205,_0x31f838),function(_0x294703){_0x294703[_0x3634('0x4b')]=_0xb7dd01['id'];_0x294703['VoicePrefixId']=_0x1a3205['id'];return _0x294703;});return db[_0x3634('0x4a')]['bulkCreate'](_0x4af226,{'transaction':_0x185b18})[_0x3634('0x23')](function(_0x12ee97){if(!_0x12ee97){return _0x1445a4('Extensions\x20creation\x20failed');}else{return _0x5e29a2(_0x12ee97);}})[_0x3634('0x3e')](function(_0x1854da){return _0x1445a4(_0x1854da);});});;});};function addVoicePrefixExtensions(_0x11808f,_0x59011d){var _0x44b9c1=[];var _0x4b724c=formatPrefixName(_0x11808f['prefix']);_0x44b9c1[_0x3634('0x5d')](new Extension(_0x4b724c,0x2,'Set',_0x3634('0x5e')+_0x11808f[_0x3634('0x27')]));if(_0x11808f[_0x3634('0x5f')]){_0x44b9c1[_0x3634('0x5d')](new Extension(_0x4b724c,0x3,'Set',_0x3634('0x60')+_0x11808f[_0x3634('0x5f')]));}else{_0x44b9c1['push'](new Extension(_0x4b724c,0x3,_0x3634('0x5a'),'No\x20callerid\x20available'));}_0x44b9c1[_0x3634('0x5d')](new Extension(_0x4b724c,0x4,'goto',_0x59011d['context']+','+_0x3634('0x61')+(0x8+_0x11808f[_0x3634('0x27')][_0x3634('0x41')])+'}'+','+0x1));return _0x44b9c1;}function formatPrefixName(_0x55f9dc){var _0x2d9115='_';for(var _0x49e63d=0x0;_0x49e63d<_0x55f9dc[_0x3634('0x41')];_0x49e63d++){if(_0x55f9dc[_0x3634('0x62')](_0x49e63d)=='-'){_0x2d9115+=_0x55f9dc[_0x3634('0x62')](_0x49e63d);}else{_0x2d9115+='['+_0x55f9dc[_0x3634('0x62')](_0x49e63d)+']';}}_0x2d9115+='.';return _0x2d9115;}exports[_0x3634('0x22')]=function(_0x11ecfb,_0x23f153,_0x18da49){var _0x347acc=_0x11ecfb[_0x3634('0x48')];_0x347acc[_0x3634('0x63')]='system-'+_0x347acc['name']+'-';return db[_0x3634('0x46')]['transaction'](function(_0x465712){return db[_0x3634('0x2b')][_0x3634('0x22')](_0x347acc,{'where':{'id':_0x347acc['id']},'transaction':_0x465712})[_0x3634('0x23')](function(){return db[_0x3634('0x4a')]['destroy']({'where':{'VoicePrefixId':_0x347acc['id']},'transaction':_0x465712})[_0x3634('0x23')](function(){return db[_0x3634('0x4a')][_0x3634('0x43')]({'where':{'id':_0x347acc[_0x3634('0x4b')]},'raw':!![]})[_0x3634('0x23')](function(_0x55b538){return createVoicePrefixExtensions(_0x347acc,_0x55b538,_0x465712);});});});})[_0x3634('0x23')](function(){return db[_0x3634('0x2b')][_0x3634('0x64')](_0x347acc['id']);})[_0x3634('0x23')](respondWithResult(_0x23f153,null))['catch'](handleError(_0x23f153,null));};exports['addAgents']=function(_0x15fa89,_0x248cd0,_0x3ac037){return db[_0x3634('0x2b')]['find']({'where':{'id':_0x15fa89[_0x3634('0x40')]['id']}})['then'](handleEntityNotFound(_0x248cd0,null))[_0x3634('0x23')](function(_0x543328){if(_0x543328){return _0x543328[_0x3634('0x65')](_0x15fa89[_0x3634('0x48')][_0x3634('0x66')],_[_0x3634('0x67')](_0x15fa89[_0x3634('0x48')],[_0x3634('0x66'),'id'])||{})['spread'](function(_0x3007d1){for(var _0x5cd87a=0x0;_0x5cd87a<_0x15fa89[_0x3634('0x48')][_0x3634('0x66')][_0x3634('0x41')];_0x5cd87a+=0x1){socket[_0x3634('0x68')](_0x3634('0x69'),{'UserId':Number(_0x15fa89[_0x3634('0x48')][_0x3634('0x66')][_0x5cd87a]),'VoicePrefixId':Number(_0x15fa89[_0x3634('0x40')]['id'])});}return _0x3007d1;});}})[_0x3634('0x23')](respondWithResult(_0x248cd0,null))['catch'](handleError(_0x248cd0,null));};exports[_0x3634('0x6a')]=function(_0x21a99c,_0x170e35,_0x3f21a3){return db[_0x3634('0x2b')][_0x3634('0x43')]({'where':{'id':_0x21a99c[_0x3634('0x40')]['id']}})[_0x3634('0x23')](handleEntityNotFound(_0x170e35,null))[_0x3634('0x23')](function(_0x33c2aa){if(_0x33c2aa){return _0x33c2aa['removeAgents'](_0x21a99c[_0x3634('0x30')][_0x3634('0x66')])['then'](function(){if(_['isArray'](_0x21a99c[_0x3634('0x30')][_0x3634('0x66')])){for(var _0x32373b=0x0;_0x32373b<_0x21a99c[_0x3634('0x30')]['ids'][_0x3634('0x41')];_0x32373b+=0x1){socket[_0x3634('0x68')]('userVoicePrefix:remove',{'UserId':Number(_0x21a99c[_0x3634('0x30')][_0x3634('0x66')][_0x32373b]),'VoicePrefixId':Number(_0x21a99c['params']['id'])});}}else{socket[_0x3634('0x68')](_0x3634('0x6b'),{'UserId':Number(_0x21a99c['query'][_0x3634('0x66')]),'VoicePrefixId':Number(_0x21a99c[_0x3634('0x40')]['id'])});}});}})['then'](respondWithStatusCode(_0x170e35,null))[_0x3634('0x3e')](handleError(_0x170e35,null));};exports[_0x3634('0x6c')]=function(_0xf4ba17,_0x47c0ce,_0x54b94c){var _0x5466c4={};var _0x3018cd={};var _0x407727;var _0x1a0004;return db[_0x3634('0x2b')]['findOne']({'where':{'id':_0xf4ba17['params']['id']}})[_0x3634('0x23')](handleEntityNotFound(_0x47c0ce,null))[_0x3634('0x23')](function(_0x2bc8c6){if(_0x2bc8c6){_0x407727=_0x2bc8c6;_0x3018cd[_0x3634('0x2f')]=_[_0x3634('0x31')](db[_0x3634('0x6d')][_0x3634('0x2c')]);_0x3018cd[_0x3634('0x30')]=_['keys'](_0xf4ba17[_0x3634('0x30')]);_0x3018cd[_0x3634('0x32')]=_[_0x3634('0x33')](_0x3018cd['model'],_0x3018cd[_0x3634('0x30')]);_0x5466c4[_0x3634('0x34')]=_[_0x3634('0x33')](_0x3018cd['model'],qs[_0x3634('0x35')](_0xf4ba17['query'][_0x3634('0x35')]));_0x5466c4['attributes']=_0x5466c4[_0x3634('0x34')][_0x3634('0x41')]?_0x5466c4[_0x3634('0x34')]:_0x3018cd[_0x3634('0x2f')];_0x5466c4[_0x3634('0x6e')]=qs[_0x3634('0x37')](_0xf4ba17[_0x3634('0x30')][_0x3634('0x37')]);_0x5466c4[_0x3634('0x38')]=qs[_0x3634('0x32')](_['pick'](_0xf4ba17[_0x3634('0x30')],_0x3018cd[_0x3634('0x32')]));if(_0xf4ba17[_0x3634('0x30')][_0x3634('0x39')]){_0x5466c4[_0x3634('0x38')]=_[_0x3634('0x3a')](_0x5466c4[_0x3634('0x38')],{'$or':_[_0x3634('0x2a')](_0x5466c4[_0x3634('0x34')],function(_0x10e0a2){var _0x8bca31={};_0x8bca31[_0x10e0a2]={'$like':'%'+_0xf4ba17[_0x3634('0x30')][_0x3634('0x39')]+'%'};return _0x8bca31;})});}_0x5466c4=_[_0x3634('0x3a')]({},_0x5466c4,_0xf4ba17[_0x3634('0x42')]);return _0x407727[_0x3634('0x6c')](_0x5466c4);}})[_0x3634('0x23')](function(_0x351c1f){if(_0x351c1f){_0x1a0004=_0x351c1f[_0x3634('0x41')];if(!_0xf4ba17['query']['hasOwnProperty'](_0x3634('0x36'))){_0x5466c4[_0x3634('0x1d')]=qs['limit'](_0xf4ba17[_0x3634('0x30')][_0x3634('0x1d')]);_0x5466c4['offset']=qs[_0x3634('0x1f')](_0xf4ba17['query'][_0x3634('0x1f')]);}return _0x407727[_0x3634('0x6c')](_0x5466c4);}})[_0x3634('0x23')](function(_0xfc3bd8){if(_0xfc3bd8){return _0xfc3bd8?{'count':_0x1a0004,'rows':_0xfc3bd8}:null;}})[_0x3634('0x23')](respondWithResult(_0x47c0ce,null))[_0x3634('0x3e')](handleError(_0x47c0ce,null));};exports[_0x3634('0x6f')]=function(_0x128714,_0x32a64e,_0x3363c1){var _0x5661cc={};var _0x249647={};var _0x2d60e3;var _0x498fb1;return db[_0x3634('0x2b')]['findOne']({'where':{'id':_0x128714['params']['id']}})[_0x3634('0x23')](handleEntityNotFound(_0x32a64e,null))['then'](function(_0xac7d50){if(_0xac7d50){_0x2d60e3=_0xac7d50;_0x249647[_0x3634('0x2f')]=_[_0x3634('0x31')](db[_0x3634('0x70')][_0x3634('0x2c')]);_0x249647[_0x3634('0x30')]=_[_0x3634('0x31')](_0x128714[_0x3634('0x30')]);_0x249647['filters']=_[_0x3634('0x33')](_0x249647[_0x3634('0x2f')],_0x249647[_0x3634('0x30')]);_0x5661cc[_0x3634('0x34')]=_[_0x3634('0x33')](_0x249647[_0x3634('0x2f')],qs['fields'](_0x128714[_0x3634('0x30')][_0x3634('0x35')]));_0x5661cc['attributes']=_0x5661cc[_0x3634('0x34')][_0x3634('0x41')]?_0x5661cc[_0x3634('0x34')]:_0x249647[_0x3634('0x2f')];_0x5661cc[_0x3634('0x6e')]=qs['sort'](_0x128714[_0x3634('0x30')][_0x3634('0x37')]);_0x5661cc[_0x3634('0x38')]=qs['filters'](_[_0x3634('0x71')](_0x128714[_0x3634('0x30')],_0x249647[_0x3634('0x32')]));if(_0x128714[_0x3634('0x30')]['filter']){_0x5661cc['where']=_[_0x3634('0x3a')](_0x5661cc[_0x3634('0x38')],{'$or':_[_0x3634('0x2a')](_0x5661cc[_0x3634('0x34')],function(_0x55b759){var _0x4a0665={};_0x4a0665[_0x55b759]={'$like':'%'+_0x128714[_0x3634('0x30')]['filter']+'%'};return _0x4a0665;})});}_0x5661cc=_[_0x3634('0x3a')]({},_0x5661cc,_0x128714[_0x3634('0x42')]);return _0x2d60e3[_0x3634('0x6f')](_0x5661cc);}})[_0x3634('0x23')](function(_0x5885ea){if(_0x5885ea){_0x498fb1=_0x5885ea[_0x3634('0x41')];if(!_0x128714['query'][_0x3634('0x72')](_0x3634('0x36'))){_0x5661cc[_0x3634('0x1d')]=qs['limit'](_0x128714[_0x3634('0x30')]['limit']);_0x5661cc['offset']=qs[_0x3634('0x1f')](_0x128714[_0x3634('0x30')][_0x3634('0x1f')]);}return _0x2d60e3['getTeams'](_0x5661cc);}})['then'](function(_0x971689){if(_0x971689){return _0x971689?{'count':_0x498fb1,'rows':_0x971689}:null;}})[_0x3634('0x23')](respondWithResult(_0x32a64e,null))[_0x3634('0x3e')](handleError(_0x32a64e,null));};exports[_0x3634('0x73')]=function(_0xc9fe1a,_0x381331,_0xe79299){var _0x171490=_0xc9fe1a[_0x3634('0x48')][_0x3634('0x66')];var _0x4e313;return db[_0x3634('0x70')][_0x3634('0x3d')]({'where':{'id':_0x171490},'attributes':['id'],'include':[{'model':db[_0x3634('0x6d')],'as':_0x3634('0x74'),'attributes':['id',_0x3634('0x27'),_0x3634('0x75'),_0x3634('0x76'),_0x3634('0x77')],'raw':!![]}]})[_0x3634('0x23')](function(_0x3e7ae9){if(_0x3e7ae9){_0x4e313=_0x3e7ae9;var _0x336f18=_[_0x3634('0x78')](_0x3e7ae9,function(_0x54dad5){var _0x42d434=_0x54dad5[_0x3634('0x49')]({'plain':!![]});return _0x42d434['Agents'];});return db['VoicePrefix']['find']({'where':{'id':_0xc9fe1a[_0x3634('0x40')]['id']}})[_0x3634('0x23')](function(_0x10f006){return db['sequelize'][_0x3634('0x47')](function(_0xb0bfc2){return _0x10f006['addTeams'](_0x171490,{'transaction':_0xb0bfc2})[_0x3634('0x23')](function(){return BPromise['each'](_0x4e313,function(_0x56221c){return db[_0x3634('0x79')][_0x3634('0x7a')]({'TeamId':_0x56221c['id'],'VoicePrefixId':_0xc9fe1a[_0x3634('0x40')]['id']},{'transaction':_0xb0bfc2});});})[_0x3634('0x23')](function(){return BPromise['each'](_0x336f18,function(_0x2aa9b9){return db[_0x3634('0x7b')][_0x3634('0x7c')]({'where':{'UserId':_0x2aa9b9['id'],'VoicePrefixId':_0xc9fe1a[_0x3634('0x40')]['id']},'transaction':_0xb0bfc2});});})[_0x3634('0x23')](function(){_0x336f18[_0x3634('0x7d')](function(_0x4243ac){socket[_0x3634('0x68')](_0x3634('0x69'),{'UserId':_0x4243ac['id'],'VoicePrefixId':_0x10f006['id']});});});});});}})[_0x3634('0x23')](respondWithStatusCode(_0x381331,null))[_0x3634('0x3e')](handleError(_0x381331,null));};exports['removeTeams']=function(_0xca145e,_0x41af2b,_0x41df60){return db['Team'][_0x3634('0x3d')]({'where':{'id':_0xca145e[_0x3634('0x30')][_0x3634('0x66')]},'attributes':['id'],'include':[{'model':db[_0x3634('0x6d')],'as':_0x3634('0x74'),'attributes':['id'],'raw':!![]}]})[_0x3634('0x23')](handleEntityNotFound(_0x41af2b,null))['then'](function(_0x292441){var _0x2d341d=_[_0x3634('0x2a')](_0x292441,'id');var _0x5f2abf=[];var _0x2d9dcd=[];var _0x28ee79=squel['select']();_0x28ee79[_0x3634('0x7e')](_0x3634('0x7f'))[_0x3634('0x80')](_0x3634('0x81'),'tq')[_0x3634('0x82')](_0x3634('0x83'),'ut',_0x3634('0x84'))[_0x3634('0x38')](_0x3634('0x85'),_0xca145e['params']['id']);for(var _0xb5ca9f=0x0;_0xb5ca9f<_0x292441['length'];_0xb5ca9f+=0x1){let _0x300cfb=_0x292441[_0xb5ca9f];for(var _0x17ba97=0x0;_0x17ba97<_0x300cfb[_0x3634('0x74')]['length'];_0x17ba97+=0x1){let _0x9a5e22=_0x300cfb['Agents'][_0x17ba97];var _0x2390b9=_0x28ee79[_0x3634('0x86')]();_0x2390b9[_0x3634('0x38')]('ut.UserId\x20=\x20?',_0x9a5e22['id']);_0x2d9dcd[_0x3634('0x5d')](db[_0x3634('0x46')][_0x3634('0x30')](_0x2390b9[_0x3634('0x87')](),{'type':db[_0x3634('0x46')]['QueryTypes']['SELECT']})['then'](function(_0x92948d){if(_0x92948d['length']===0x1){return _0x9a5e22['id'];}else{var _0x4c0a7e=_[_0x3634('0x88')](_[_0x3634('0x2a')](_0x92948d,'TeamId'),function(_0x2dfb16){return _[_0x3634('0x89')](_0x2d341d,_0x2dfb16);});if(_0x4c0a7e){return _0x9a5e22['id'];}}}));}}return BPromise[_0x3634('0x8a')](_0x2d9dcd)['then'](function(_0x48eeaf){_0x5f2abf=_(_0x5f2abf)[_0x3634('0x8b')](_0x48eeaf)[_0x3634('0x8c')]()[_0x3634('0x8d')]();return db[_0x3634('0x2b')]['find']({'where':{'id':_0xca145e[_0x3634('0x40')]['id']}})[_0x3634('0x23')](function(_0x130205){return db['sequelize'][_0x3634('0x47')](function(_0x11253d){return _0x130205[_0x3634('0x8e')](_0xca145e['query']['ids'],{'transaction':_0x11253d})['then'](function(){if(!_['isEmpty'](_0x5f2abf)){return _0x130205[_0x3634('0x6a')](_0x5f2abf,{'transaction':_0x11253d});}})[_0x3634('0x23')](function(){_0x5f2abf[_0x3634('0x7d')](function(_0x36d826){socket[_0x3634('0x68')](_0x3634('0x6b'),{'UserId':_0x36d826,'VoicePrefixId':_0x130205['id']});});});});});});})[_0x3634('0x23')](respondWithStatusCode(_0x41af2b,null))[_0x3634('0x3e')](handleError(_0x41af2b,null));}; \ No newline at end of file +var _0xab40=['PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','omit','body','ids','spread','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','findAll','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','userVoicePrefix:save','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','error','stack','name','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','rows','catch','params','length','find','describe','create','sequelize','transaction','get','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','description','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll'];(function(_0x4afa72,_0x296430){var _0x55a44b=function(_0x28d31c){while(--_0x28d31c){_0x4afa72['push'](_0x4afa72['shift']());}};_0x55a44b(++_0x296430);}(_0xab40,0xcd));var _0x0ab4=function(_0x191703,_0x45514b){_0x191703=_0x191703-0x0;var _0x154a99=_0xab40[_0x191703];return _0x154a99;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];config[_0x0ab4('0x15')]=_[_0x0ab4('0x16')](config[_0x0ab4('0x15')],{'host':_0x0ab4('0x17'),'port':0x18eb});var socket=require(_0x0ab4('0x18'))(new Redis(config[_0x0ab4('0x15')]));require(_0x0ab4('0x19'))[_0x0ab4('0x1a')](socket);function respondWithStatusCode(_0x3cb1df,_0x2033c8){_0x2033c8=_0x2033c8||0xcc;return function(_0x216a17){if(_0x216a17){return _0x3cb1df[_0x0ab4('0x1b')](_0x2033c8);}return _0x3cb1df[_0x0ab4('0x1c')](_0x2033c8)[_0x0ab4('0x1d')]();};}function respondWithResult(_0x2a83a8,_0x2403db){_0x2403db=_0x2403db||0xc8;return function(_0x283b15){if(_0x283b15){return _0x2a83a8[_0x0ab4('0x1c')](_0x2403db)['json'](_0x283b15);}};}function respondWithFilteredResult(_0x5000d4,_0x49634f){return function(_0x17422f){if(_0x17422f){var _0x30d5df=typeof _0x49634f[_0x0ab4('0x1e')]==='undefined'&&typeof _0x49634f[_0x0ab4('0x1f')]===_0x0ab4('0x20');var _0x212ebd=_0x17422f[_0x0ab4('0x21')];var _0x4e7852=_0x30d5df?0x0:_0x49634f['offset'];var _0xdb0797=_0x30d5df?_0x17422f['count']:_0x49634f[_0x0ab4('0x1e')]+_0x49634f[_0x0ab4('0x1f')];var _0x5bb1d0;if(_0xdb0797>=_0x212ebd){_0xdb0797=_0x212ebd;_0x5bb1d0=0xc8;}else{_0x5bb1d0=0xce;}_0x5000d4[_0x0ab4('0x1c')](_0x5bb1d0);return _0x5000d4[_0x0ab4('0x22')](_0x0ab4('0x23'),_0x4e7852+'-'+_0xdb0797+'/'+_0x212ebd)[_0x0ab4('0x24')](_0x17422f);}return null;};}function patchUpdates(_0x12d06d){return function(_0x52d7d3){try{jsonpatch['apply'](_0x52d7d3,_0x12d06d,!![]);}catch(_0x24b929){return BPromise[_0x0ab4('0x25')](_0x24b929);}return _0x52d7d3[_0x0ab4('0x26')]();};}function saveUpdates(_0x13c882,_0x4e4b80){return function(_0x42d2dd){if(_0x42d2dd){return _0x42d2dd[_0x0ab4('0x27')](_0x13c882)[_0x0ab4('0x28')](function(_0x4ea9aa){return _0x4ea9aa;});}return null;};}function removeEntity(_0x4c5caf,_0x176ff1){return function(_0x1c132c){if(_0x1c132c){return _0x1c132c[_0x0ab4('0x29')]()['then'](function(){var _0x519b23=_0x1c132c['get']({'plain':!![]});var _0x19ecc6='VoicePrefixes';return db[_0x0ab4('0x2a')][_0x0ab4('0x29')]({'where':{'type':_0x19ecc6,'resourceId':_0x519b23['id']}})['then'](function(){return _0x1c132c;});})['then'](function(){_0x4c5caf['status'](0xcc)[_0x0ab4('0x1d')]();});}};}function handleEntityNotFound(_0x183bac,_0x1cfdad){return function(_0x3f61cb){if(!_0x3f61cb){_0x183bac[_0x0ab4('0x1b')](0x194);}return _0x3f61cb;};}function handleError(_0x588e0d,_0x5b55c1){_0x5b55c1=_0x5b55c1||0x1f4;return function(_0x580d56){logger[_0x0ab4('0x2b')](_0x580d56[_0x0ab4('0x2c')]);if(_0x580d56[_0x0ab4('0x2d')]){delete _0x580d56[_0x0ab4('0x2d')];}_0x588e0d[_0x0ab4('0x1c')](_0x5b55c1)['send'](_0x580d56);};}exports['index']=function(_0x285a29,_0xe6682){var _0x361f7c={},_0x4819be={},_0x48e430={'count':0x0,'rows':[]};var _0x1b19db=_['map'](db[_0x0ab4('0x2e')][_0x0ab4('0x2f')],function(_0x263e5a){return{'name':_0x263e5a[_0x0ab4('0x30')],'type':_0x263e5a[_0x0ab4('0x31')][_0x0ab4('0x32')]};});_0x4819be['model']=_[_0x0ab4('0x33')](_0x1b19db,_0x0ab4('0x2d'));_0x4819be[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x285a29['query']);_0x4819be['filters']=_[_0x0ab4('0x36')](_0x4819be[_0x0ab4('0x37')],_0x4819be[_0x0ab4('0x34')]);_0x361f7c['attributes']=_['intersection'](_0x4819be['model'],qs[_0x0ab4('0x38')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x361f7c['attributes']=_0x361f7c['attributes']['length']?_0x361f7c[_0x0ab4('0x39')]:_0x4819be[_0x0ab4('0x37')];if(!_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x361f7c[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x361f7c[_0x0ab4('0x1e')]=qs['offset'](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}_0x361f7c[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x361f7c[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x285a29[_0x0ab4('0x34')],_0x4819be[_0x0ab4('0x3f')]),_0x1b19db);if(_0x285a29[_0x0ab4('0x34')]['filter']){_0x361f7c[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x361f7c[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x1b19db,function(_0x589b46){if(_0x589b46[_0x0ab4('0x31')]!=='VIRTUAL'){var _0x43e5ba={};_0x43e5ba[_0x589b46[_0x0ab4('0x2d')]]={'$like':'%'+_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x42')]+'%'};return _0x43e5ba;}})});}_0x361f7c=_[_0x0ab4('0x41')]({},_0x361f7c,_0x285a29[_0x0ab4('0x43')]);var _0x5815d1={'where':_0x361f7c[_0x0ab4('0x3e')]};return db[_0x0ab4('0x2e')][_0x0ab4('0x21')](_0x5815d1)['then'](function(_0x395e0b){_0x48e430[_0x0ab4('0x21')]=_0x395e0b;if(_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x44')]){_0x361f7c[_0x0ab4('0x45')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x361f7c);})['then'](function(_0x2f54dd){_0x48e430[_0x0ab4('0x46')]=_0x2f54dd;return _0x48e430;})['then'](respondWithFilteredResult(_0xe6682,_0x361f7c))[_0x0ab4('0x47')](handleError(_0xe6682,null));};exports['show']=function(_0x2d1d87,_0x562262){var _0x365be1={'raw':![],'where':{'id':_0x2d1d87[_0x0ab4('0x48')]['id']}},_0x300fd8={};_0x300fd8[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x2e')]['rawAttributes']);_0x300fd8[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x2d1d87[_0x0ab4('0x34')]);_0x300fd8[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x300fd8[_0x0ab4('0x37')],_0x300fd8['query']);_0x365be1[_0x0ab4('0x39')]=_['intersection'](_0x300fd8[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x2d1d87[_0x0ab4('0x34')]['fields']));_0x365be1[_0x0ab4('0x39')]=_0x365be1[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x365be1[_0x0ab4('0x39')]:_0x300fd8[_0x0ab4('0x37')];if(_0x2d1d87[_0x0ab4('0x34')]['includeAll']){_0x365be1[_0x0ab4('0x45')]=[{'all':!![]}];}_0x365be1=_[_0x0ab4('0x41')]({},_0x365be1,_0x2d1d87[_0x0ab4('0x43')]);return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')](_0x365be1)[_0x0ab4('0x28')](handleEntityNotFound(_0x562262,null))[_0x0ab4('0x28')](respondWithResult(_0x562262,null))[_0x0ab4('0x47')](handleError(_0x562262,null));};exports[_0x0ab4('0x29')]=function(_0x24bb13,_0x1a9675){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x24bb13['params']['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0x1a9675,null))[_0x0ab4('0x28')](removeEntity(_0x1a9675,null))['catch'](handleError(_0x1a9675,null));};exports[_0x0ab4('0x4b')]=function(_0x48efa4,_0x53d66f){return db[_0x0ab4('0x2e')][_0x0ab4('0x4b')]()[_0x0ab4('0x28')](respondWithResult(_0x53d66f,null))['catch'](handleError(_0x53d66f,null));};exports[_0x0ab4('0x4c')]=function(_0xb3bd1e,_0xeddaa1){var _0xaed2d;return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1eea3b){return db['VoicePrefix'][_0x0ab4('0x4c')](_0xb3bd1e['body'],{'transaction':_0x1eea3b})[_0x0ab4('0x28')](function(_0x55c073){_0xaed2d=_0x55c073[_0x0ab4('0x4f')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xaed2d[_0x0ab4('0x50')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x433346){return createVoicePrefixExtensions(_0xaed2d,_0x433346,_0x1eea3b);});});})[_0x0ab4('0x28')](function(){var _0x4e2db5=_0xb3bd1e[_0x0ab4('0x51')][_0x0ab4('0x4f')]({'plain':!![]});if(!_0x4e2db5)throw new Error(_0x0ab4('0x52'));if(_0x4e2db5[_0x0ab4('0x53')]===_0x0ab4('0x51')){var _0x2354fa=_0xaed2d;return db[_0x0ab4('0x54')][_0x0ab4('0x4a')]({'where':{'name':_0x0ab4('0x55'),'userProfileId':_0x4e2db5[_0x0ab4('0x56')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x355ba8){if(_0x355ba8&&_0x355ba8[_0x0ab4('0x57')]===0x0){return db[_0x0ab4('0x2a')][_0x0ab4('0x4c')]({'name':_0x2354fa[_0x0ab4('0x2d')],'resourceId':_0x2354fa['id'],'type':_0x355ba8[_0x0ab4('0x2d')],'sectionId':_0x355ba8['id']},{})[_0x0ab4('0x28')](function(){return _0xaed2d;});}else{return _0xaed2d;}})[_0x0ab4('0x47')](function(_0x59705f){logger[_0x0ab4('0x2b')](_0x0ab4('0x58'),_0x59705f);throw _0x59705f;});}return _0xaed2d;})[_0x0ab4('0x28')](respondWithResult(_0xeddaa1,null))[_0x0ab4('0x47')](handleError(_0xeddaa1,null));};function Extension(_0x32e38c,_0x3bcb90,_0x387619,_0x251e4d){this['context']=_0x0ab4('0x59');this[_0x0ab4('0x5a')]=_0x32e38c;this['app']=_0x387619;this['type']=_0x0ab4('0x5b');this[_0x0ab4('0x5c')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3bcb90;this[_0x0ab4('0x5d')]=_0x251e4d;}function createVoicePrefixExtensions(_0x5b4bbe,_0x597d26,_0x427b51){return new BPromise(function(_0x3cdedf,_0x12dccd){var _0x42cbcb=new Extension(formatPrefixName(_0x5b4bbe[_0x0ab4('0x5e')]),0x1,_0x0ab4('0x5f'),_0x0ab4('0x60'));_0x42cbcb['VoicePrefixId']=_0x5b4bbe['id'];return db[_0x0ab4('0x61')][_0x0ab4('0x4c')](_0x42cbcb,{'transaction':_0x427b51})[_0x0ab4('0x28')](function(_0x406df2){var _0x194733=_0x406df2[_0x0ab4('0x4f')]({'plain':!![]});var _0x4f1847=_[_0x0ab4('0x33')](addVoicePrefixExtensions(_0x5b4bbe,_0x597d26),function(_0x1b7925){_0x1b7925['VoiceExtensionId']=_0x194733['id'];_0x1b7925[_0x0ab4('0x62')]=_0x5b4bbe['id'];return _0x1b7925;});return db['VoiceExtension'][_0x0ab4('0x63')](_0x4f1847,{'transaction':_0x427b51})['then'](function(_0x268b23){if(!_0x268b23){return _0x12dccd(_0x0ab4('0x64'));}else{return _0x3cdedf(_0x268b23);}})[_0x0ab4('0x47')](function(_0x2e728f){return _0x12dccd(_0x2e728f);});});;});};function addVoicePrefixExtensions(_0x509611,_0x581547){var _0x10dd5b=[];var _0x4477ba=formatPrefixName(_0x509611['prefix']);_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x2,_0x0ab4('0x66'),_0x0ab4('0x67')+_0x509611['name']));if(_0x509611[_0x0ab4('0x68')]){_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x66'),_0x0ab4('0x69')+_0x509611[_0x0ab4('0x68')]));}else{_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x5f'),_0x0ab4('0x6a')));}_0x10dd5b['push'](new Extension(_0x4477ba,0x4,'goto',_0x581547[_0x0ab4('0x6b')]+','+_0x0ab4('0x6c')+(0x8+_0x509611[_0x0ab4('0x2d')][_0x0ab4('0x49')])+'}'+','+0x1));return _0x10dd5b;}function formatPrefixName(_0x58c611){var _0x417926='_';for(var _0x5256d4=0x0;_0x5256d4<_0x58c611[_0x0ab4('0x49')];_0x5256d4++){if(_0x58c611[_0x0ab4('0x6d')](_0x5256d4)=='-'){_0x417926+=_0x58c611[_0x0ab4('0x6d')](_0x5256d4);}else{_0x417926+='['+_0x58c611[_0x0ab4('0x6d')](_0x5256d4)+']';}}_0x417926+='.';return _0x417926;}exports[_0x0ab4('0x27')]=function(_0x41b65f,_0x46a008,_0xf42b98){var _0x29cf79=_0x41b65f['body'];_0x29cf79[_0x0ab4('0x5e')]='system-'+_0x29cf79[_0x0ab4('0x2d')]+'-';return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1481b2){return db[_0x0ab4('0x2e')][_0x0ab4('0x27')](_0x29cf79,{'where':{'id':_0x29cf79['id']},'transaction':_0x1481b2})[_0x0ab4('0x28')](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x29')]({'where':{'VoicePrefixId':_0x29cf79['id']},'transaction':_0x1481b2})['then'](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x4a')]({'where':{'id':_0x29cf79['VoiceExtensionId']},'raw':!![]})[_0x0ab4('0x28')](function(_0x2d4921){return createVoicePrefixExtensions(_0x29cf79,_0x2d4921,_0x1481b2);});});});})[_0x0ab4('0x28')](function(){return db['VoicePrefix'][_0x0ab4('0x6e')](_0x29cf79['id']);})[_0x0ab4('0x28')](respondWithResult(_0x46a008,null))[_0x0ab4('0x47')](handleError(_0x46a008,null));};exports[_0x0ab4('0x6f')]=function(_0x531a07,_0x5bf57e,_0x398b3e){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x531a07[_0x0ab4('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bf57e,null))[_0x0ab4('0x28')](function(_0xa0f095){if(_0xa0f095){return _0xa0f095[_0x0ab4('0x6f')](_0x531a07['body']['ids'],_[_0x0ab4('0x70')](_0x531a07[_0x0ab4('0x71')],[_0x0ab4('0x72'),'id'])||{})[_0x0ab4('0x73')](function(_0x46f69a){for(var _0x1c8965=0x0;_0x1c8965<_0x531a07[_0x0ab4('0x71')]['ids'][_0x0ab4('0x49')];_0x1c8965+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x531a07[_0x0ab4('0x71')]['ids'][_0x1c8965]),'VoicePrefixId':Number(_0x531a07[_0x0ab4('0x48')]['id'])});}return _0x46f69a;});}})[_0x0ab4('0x28')](respondWithResult(_0x5bf57e,null))[_0x0ab4('0x47')](handleError(_0x5bf57e,null));};exports[_0x0ab4('0x74')]=function(_0x1eec8e,_0x4bffd4,_0x586bd6){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x1eec8e['params']['id']}})['then'](handleEntityNotFound(_0x4bffd4,null))[_0x0ab4('0x28')](function(_0x3e3ded){if(_0x3e3ded){return _0x3e3ded['removeAgents'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])[_0x0ab4('0x28')](function(){if(_['isArray'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])){for(var _0x2033fc=0x0;_0x2033fc<_0x1eec8e[_0x0ab4('0x34')]['ids'][_0x0ab4('0x49')];_0x2033fc+=0x1){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')][_0x2033fc]),'VoicePrefixId':Number(_0x1eec8e[_0x0ab4('0x48')]['id'])});}}else{socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')]),'VoicePrefixId':Number(_0x1eec8e['params']['id'])});}});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x4bffd4,null))[_0x0ab4('0x47')](handleError(_0x4bffd4,null));};exports[_0x0ab4('0x77')]=function(_0x78c98e,_0xb803f2,_0x5adfaa){var _0x448fcb={};var _0x88676f={};var _0xd916e0;var _0x28a722;return db[_0x0ab4('0x2e')][_0x0ab4('0x78')]({'where':{'id':_0x78c98e[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0xb803f2,null))[_0x0ab4('0x28')](function(_0x23968d){if(_0x23968d){_0xd916e0=_0x23968d;_0x88676f[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x79')][_0x0ab4('0x2f')]);_0x88676f['query']=_[_0x0ab4('0x35')](_0x78c98e[_0x0ab4('0x34')]);_0x88676f[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x88676f['model'],_0x88676f['query']);_0x448fcb[_0x0ab4('0x39')]=_[_0x0ab4('0x36')](_0x88676f['model'],qs[_0x0ab4('0x38')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x448fcb[_0x0ab4('0x39')]=_0x448fcb[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x448fcb[_0x0ab4('0x39')]:_0x88676f['model'];_0x448fcb[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x448fcb[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x78c98e[_0x0ab4('0x34')],_0x88676f[_0x0ab4('0x3f')]));if(_0x78c98e['query'][_0x0ab4('0x42')]){_0x448fcb['where']=_[_0x0ab4('0x41')](_0x448fcb[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x448fcb[_0x0ab4('0x39')],function(_0x12ee59){var _0x76fa2={};_0x76fa2[_0x12ee59]={'$like':'%'+_0x78c98e['query']['filter']+'%'};return _0x76fa2;})});}_0x448fcb=_[_0x0ab4('0x41')]({},_0x448fcb,_0x78c98e[_0x0ab4('0x43')]);return _0xd916e0['getAgents'](_0x448fcb);}})['then'](function(_0x21f0a2){if(_0x21f0a2){_0x28a722=_0x21f0a2[_0x0ab4('0x49')];if(!_0x78c98e['query'][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x448fcb[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x78c98e['query'][_0x0ab4('0x1f')]);_0x448fcb['offset']=qs['offset'](_0x78c98e[_0x0ab4('0x34')]['offset']);}return _0xd916e0[_0x0ab4('0x77')](_0x448fcb);}})[_0x0ab4('0x28')](function(_0xb1cac2){if(_0xb1cac2){return _0xb1cac2?{'count':_0x28a722,'rows':_0xb1cac2}:null;}})['then'](respondWithResult(_0xb803f2,null))[_0x0ab4('0x47')](handleError(_0xb803f2,null));};exports[_0x0ab4('0x7a')]=function(_0x840fc2,_0x2282d7,_0x2bf00c){var _0x37a592={};var _0x171969={};var _0x51f02a;var _0x2a25d5;return db['VoicePrefix'][_0x0ab4('0x78')]({'where':{'id':_0x840fc2['params']['id']}})['then'](handleEntityNotFound(_0x2282d7,null))[_0x0ab4('0x28')](function(_0x7ae8b2){if(_0x7ae8b2){_0x51f02a=_0x7ae8b2;_0x171969[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x7b')]['rawAttributes']);_0x171969['query']=_[_0x0ab4('0x35')](_0x840fc2[_0x0ab4('0x34')]);_0x171969['filters']=_[_0x0ab4('0x36')](_0x171969['model'],_0x171969[_0x0ab4('0x34')]);_0x37a592[_0x0ab4('0x39')]=_['intersection'](_0x171969[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x37a592['attributes']=_0x37a592['attributes'][_0x0ab4('0x49')]?_0x37a592[_0x0ab4('0x39')]:_0x171969[_0x0ab4('0x37')];_0x37a592['order']=qs[_0x0ab4('0x3d')](_0x840fc2['query'][_0x0ab4('0x3d')]);_0x37a592[_0x0ab4('0x3e')]=qs['filters'](_['pick'](_0x840fc2['query'],_0x171969[_0x0ab4('0x3f')]));if(_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x42')]){_0x37a592[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x37a592['where'],{'$or':_[_0x0ab4('0x33')](_0x37a592[_0x0ab4('0x39')],function(_0x5e43fe){var _0xde4e2c={};_0xde4e2c[_0x5e43fe]={'$like':'%'+_0x840fc2[_0x0ab4('0x34')]['filter']+'%'};return _0xde4e2c;})});}_0x37a592=_[_0x0ab4('0x41')]({},_0x37a592,_0x840fc2[_0x0ab4('0x43')]);return _0x51f02a['getTeams'](_0x37a592);}})[_0x0ab4('0x28')](function(_0x213828){if(_0x213828){_0x2a25d5=_0x213828[_0x0ab4('0x49')];if(!_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x37a592[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x37a592['offset']=qs[_0x0ab4('0x1e')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}return _0x51f02a[_0x0ab4('0x7a')](_0x37a592);}})[_0x0ab4('0x28')](function(_0x4a9e47){if(_0x4a9e47){return _0x4a9e47?{'count':_0x2a25d5,'rows':_0x4a9e47}:null;}})['then'](respondWithResult(_0x2282d7,null))[_0x0ab4('0x47')](handleError(_0x2282d7,null));};exports['addTeams']=function(_0x15e2f6,_0x3da0c1,_0x415e42){var _0x1effa7=_0x15e2f6['body'][_0x0ab4('0x72')];var _0x33c31a;return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x1effa7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ab4('0x7d'),'attributes':['id',_0x0ab4('0x2d'),_0x0ab4('0x7e'),_0x0ab4('0x7f'),'interface'],'raw':!![]}]})['then'](function(_0x2c6284){if(_0x2c6284){_0x33c31a=_0x2c6284;var _0x272680=_[_0x0ab4('0x80')](_0x2c6284,function(_0x4e064a){var _0x29f715=_0x4e064a['get']({'plain':!![]});return _0x29f715[_0x0ab4('0x7d')];});return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x15e2f6['params']['id']}})['then'](function(_0x1d9644){return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0xa094f5){return _0x1d9644['addTeams'](_0x1effa7,{'transaction':_0xa094f5})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x33c31a,function(_0x45d3fa){return db[_0x0ab4('0x82')][_0x0ab4('0x83')]({'TeamId':_0x45d3fa['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},{'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x272680,function(_0x1d74f9){return db[_0x0ab4('0x84')][_0x0ab4('0x85')]({'where':{'UserId':_0x1d74f9['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){_0x272680['forEach'](function(_0x3984a2){socket[_0x0ab4('0x75')](_0x0ab4('0x86'),{'UserId':_0x3984a2['id'],'VoicePrefixId':_0x1d9644['id']});});});});});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x3da0c1,null))[_0x0ab4('0x47')](handleError(_0x3da0c1,null));};exports[_0x0ab4('0x87')]=function(_0x2ad3a9,_0x29f866,_0x182dfa){return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x2ad3a9['query'][_0x0ab4('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0ab4('0x79')],'as':_0x0ab4('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x0ab4('0x28')](handleEntityNotFound(_0x29f866,null))[_0x0ab4('0x28')](function(_0x50b719){var _0x2fbbec=_['map'](_0x50b719,'id');var _0x4379f1=[];var _0x175a2a=[];var _0x332b1c=squel[_0x0ab4('0x88')]();_0x332b1c[_0x0ab4('0x89')]('tq.TeamId')[_0x0ab4('0x8a')](_0x0ab4('0x8b'),'tq')[_0x0ab4('0x8c')](_0x0ab4('0x8d'),'ut',_0x0ab4('0x8e'))['where'](_0x0ab4('0x8f'),_0x2ad3a9[_0x0ab4('0x48')]['id']);for(var _0x3acf39=0x0;_0x3acf39<_0x50b719[_0x0ab4('0x49')];_0x3acf39+=0x1){let _0x28bc17=_0x50b719[_0x3acf39];for(var _0x927d5=0x0;_0x927d5<_0x28bc17[_0x0ab4('0x7d')][_0x0ab4('0x49')];_0x927d5+=0x1){let _0x43fde8=_0x28bc17[_0x0ab4('0x7d')][_0x927d5];var _0x3791e6=_0x332b1c[_0x0ab4('0x90')]();_0x3791e6[_0x0ab4('0x3e')](_0x0ab4('0x91'),_0x43fde8['id']);_0x175a2a['push'](db['sequelize']['query'](_0x3791e6['toString'](),{'type':db[_0x0ab4('0x4d')][_0x0ab4('0x92')]['SELECT']})[_0x0ab4('0x28')](function(_0x19e3f9){if(_0x19e3f9['length']===0x1){return _0x43fde8['id'];}else{var _0x58e215=_[_0x0ab4('0x93')](_['map'](_0x19e3f9,_0x0ab4('0x94')),function(_0x22fb42){return _['includes'](_0x2fbbec,_0x22fb42);});if(_0x58e215){return _0x43fde8['id'];}}}));}}return BPromise[_0x0ab4('0x95')](_0x175a2a)[_0x0ab4('0x28')](function(_0x17fed9){_0x4379f1=_(_0x4379f1)[_0x0ab4('0x96')](_0x17fed9)[_0x0ab4('0x97')]()[_0x0ab4('0x98')]();return db['VoicePrefix'][_0x0ab4('0x4a')]({'where':{'id':_0x2ad3a9[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](function(_0x4148dd){return db[_0x0ab4('0x4d')]['transaction'](function(_0x1a8f36){return _0x4148dd[_0x0ab4('0x87')](_0x2ad3a9['query'][_0x0ab4('0x72')],{'transaction':_0x1a8f36})[_0x0ab4('0x28')](function(){if(!_[_0x0ab4('0x99')](_0x4379f1)){return _0x4148dd[_0x0ab4('0x74')](_0x4379f1,{'transaction':_0x1a8f36});}})[_0x0ab4('0x28')](function(){_0x4379f1[_0x0ab4('0x9a')](function(_0x4bc8ff){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':_0x4bc8ff,'VoicePrefixId':_0x4148dd['id']});});});});});});})[_0x0ab4('0x28')](respondWithStatusCode(_0x29f866,null))[_0x0ab4('0x47')](handleError(_0x29f866,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 554aef5..8681193 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 _0xb894=['VoicePrefix','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb894,0x130));var _0x4b89=function(_0x3016a1,_0x3a55d4){_0x3016a1=_0x3016a1-0x0;var _0x1530c8=_0xb894[_0x3016a1];return _0x1530c8;};'use strict';var EventEmitter=require(_0x4b89('0x0'));var VoicePrefix=require(_0x4b89('0x1'))['db'][_0x4b89('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x4b89('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4b89('0x4'),'afterDestroy':_0x4b89('0x5')};function emitEvent(_0x3445cf){return function(_0x189b07,_0x506355,_0x3dadd2){VoicePrefixEvents['emit'](_0x3445cf+':'+_0x189b07['id'],_0x189b07);VoicePrefixEvents[_0x4b89('0x6')](_0x3445cf,_0x189b07);_0x3dadd2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x4b89('0x7')](e,emitEvent(event));}}module[_0x4b89('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xbcb0=['hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','update','remove','emit'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xbcb0,0x182));var _0x0bcb=function(_0x398573,_0x39c184){_0x398573=_0x398573-0x0;var _0x1fb2d3=_0xbcb0[_0x398573];return _0x1fb2d3;};'use strict';var EventEmitter=require(_0x0bcb('0x0'));var VoicePrefix=require(_0x0bcb('0x1'))['db'][_0x0bcb('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bcb('0x3'),'afterDestroy':_0x0bcb('0x4')};function emitEvent(_0x1b66fe){return function(_0x3f6a66,_0x497098,_0x3c41e7){VoicePrefixEvents[_0x0bcb('0x5')](_0x1b66fe+':'+_0x3f6a66['id'],_0x3f6a66);VoicePrefixEvents[_0x0bcb('0x5')](_0x1b66fe,_0x3f6a66);_0x3c41e7(null);};}for(var e in events){if(events[_0x0bcb('0x6')](e)){var event=events[e];VoicePrefix[_0x0bcb('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index df21422..021125e 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 _0xa00c=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x316fae,_0x31caf1){var _0x13b2f3=function(_0x1f68fd){while(--_0x1f68fd){_0x316fae['push'](_0x316fae['shift']());}};_0x13b2f3(++_0x31caf1);}(_0xa00c,0x173));var _0xca00=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa00c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xca00('0x0'));var util=require('util');var logger=require(_0xca00('0x1'))('api');var moment=require(_0xca00('0x2'));var BPromise=require('bluebird');var rp=require(_0xca00('0x3'));var fs=require('fs');var path=require(_0xca00('0x4'));var rimraf=require(_0xca00('0x5'));var config=require(_0xca00('0x6'));var attributes=require(_0xca00('0x7'));module[_0xca00('0x8')]=function(_0x184298,_0x321982){return _0x184298[_0xca00('0x9')](_0xca00('0xa'),attributes,{'tableName':_0xca00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x699a=['exports','define','VoicePrefix','voice_prefixes','lodash','util','moment','bluebird','request-promise','rimraf','./voicePrefix.attributes'];(function(_0x47bac4,_0x20933f){var _0x1bf082=function(_0x64dce3){while(--_0x64dce3){_0x47bac4['push'](_0x47bac4['shift']());}};_0x1bf082(++_0x20933f);}(_0x699a,0x1b1));var _0xa699=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0x699a[_0x50f6e5];return _0x5988c5;};'use strict';var _=require(_0xa699('0x0'));var util=require(_0xa699('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa699('0x2'));var BPromise=require(_0xa699('0x3'));var rp=require(_0xa699('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa699('0x5'));var config=require('../../config/environment');var attributes=require(_0xa699('0x6'));module[_0xa699('0x7')]=function(_0x2949cd,_0x253681){return _0x2949cd[_0xa699('0x8')](_0xa699('0x9'),attributes,{'tableName':_0xa699('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 4f9650d..37c0b64 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 _0x7c71=['register','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket'];(function(_0x24086a,_0x5d445f){var _0x3e3584=function(_0x3bb3ef){while(--_0x3bb3ef){_0x24086a['push'](_0x24086a['shift']());}};_0x3e3584(++_0x5d445f);}(_0x7c71,0x177));var _0x17c7=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x7c71[_0x307086];return _0x699043;};'use strict';var _=require(_0x17c7('0x0'));var util=require(_0x17c7('0x1'));var moment=require(_0x17c7('0x2'));var BPromise=require(_0x17c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17c7('0x4'));var db=require(_0x17c7('0x5'))['db'];var utils=require(_0x17c7('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x17c7('0x7'));var jayson=require(_0x17c7('0x8'));var client=jayson[_0x17c7('0x9')][_0x17c7('0xa')]({'port':0x232a});config[_0x17c7('0xb')]=_[_0x17c7('0xc')](config[_0x17c7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x17c7('0xd'))(new Redis(config[_0x17c7('0xb')]));require(_0x17c7('0xe'))[_0x17c7('0xf')](socket);function respondWithRpcPromise(_0xa21ca2,_0x21aa20,_0x2df59d){return new BPromise(function(_0x45dcce,_0x16965c){return client[_0x17c7('0x10')](_0xa21ca2,_0x2df59d)['then'](function(_0x4da796){logger[_0x17c7('0x11')](_0x17c7('0x12'),_0x21aa20,'request\x20sent');logger[_0x17c7('0x13')](_0x17c7('0x14'),_0x21aa20,'request\x20sent',JSON[_0x17c7('0x15')](_0x4da796));if(_0x4da796[_0x17c7('0x16')]){if(_0x4da796['error']['code']===0x1f4){logger[_0x17c7('0x16')](_0x17c7('0x12'),_0x21aa20,_0x4da796[_0x17c7('0x16')][_0x17c7('0x17')]);return _0x16965c(_0x4da796[_0x17c7('0x16')][_0x17c7('0x17')]);}logger[_0x17c7('0x16')](_0x17c7('0x12'),_0x21aa20,_0x4da796[_0x17c7('0x16')][_0x17c7('0x17')]);return _0x45dcce(_0x4da796[_0x17c7('0x16')][_0x17c7('0x17')]);}else{logger['info'](_0x17c7('0x12'),_0x21aa20,_0x17c7('0x18'));_0x45dcce(_0x4da796['result'][_0x17c7('0x17')]);}})[_0x17c7('0x19')](function(_0x2c652c){logger[_0x17c7('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x21aa20,_0x2c652c);_0x16965c(_0x2c652c);});});} \ No newline at end of file +var _0x8458=['result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x25a1ac,_0x113c18){var _0x13ea3a=function(_0x91718d){while(--_0x91718d){_0x25a1ac['push'](_0x25a1ac['shift']());}};_0x13ea3a(++_0x113c18);}(_0x8458,0x1a5));var _0x8845=function(_0x47ffbb,_0x570241){_0x47ffbb=_0x47ffbb-0x0;var _0x348417=_0x8458[_0x47ffbb];return _0x348417;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var moment=require(_0x8845('0x1'));var BPromise=require(_0x8845('0x2'));var rs=require(_0x8845('0x3'));var fs=require('fs');var Redis=require(_0x8845('0x4'));var db=require(_0x8845('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8845('0x6'))(_0x8845('0x7'));var config=require(_0x8845('0x8'));var jayson=require(_0x8845('0x9'));var client=jayson[_0x8845('0xa')]['http']({'port':0x232a});config[_0x8845('0xb')]=_['defaults'](config[_0x8845('0xb')],{'host':_0x8845('0xc'),'port':0x18eb});var socket=require(_0x8845('0xd'))(new Redis(config['redis']));require(_0x8845('0xe'))[_0x8845('0xf')](socket);function respondWithRpcPromise(_0x59cd0b,_0x33d23e,_0xd846f1){return new BPromise(function(_0x55703d,_0x3b9c78){return client[_0x8845('0x10')](_0x59cd0b,_0xd846f1)[_0x8845('0x11')](function(_0x1f1027){logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));logger[_0x8845('0x15')](_0x8845('0x16'),_0x33d23e,_0x8845('0x14'),JSON[_0x8845('0x17')](_0x1f1027));if(_0x1f1027[_0x8845('0x18')]){if(_0x1f1027[_0x8845('0x18')][_0x8845('0x19')]===0x1f4){logger['error'](_0x8845('0x13'),_0x33d23e,_0x1f1027[_0x8845('0x18')]['message']);return _0x3b9c78(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}logger[_0x8845('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x33d23e,_0x1f1027['error']['message']);return _0x55703d(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}else{logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));_0x55703d(_0x1f1027[_0x8845('0x1b')][_0x8845('0x1a')]);}})['catch'](function(_0x4e6a6f){logger['error'](_0x8845('0x13'),_0x33d23e,_0x4e6a6f);_0x3b9c78(_0x4e6a6f);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 389379b..269fc54 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 _0xae7b=['voicePrefix:','./voicePrefix.events','save','remove','emit','register','length'];(function(_0x5c4f5c,_0x460a17){var _0x4e8de5=function(_0x461474){while(--_0x461474){_0x5c4f5c['push'](_0x5c4f5c['shift']());}};_0x4e8de5(++_0x460a17);}(_0xae7b,0xbe));var _0xbae7=function(_0x4471c2,_0x531995){_0x4471c2=_0x4471c2-0x0;var _0x15361c=_0xae7b[_0x4471c2];return _0x15361c;};'use strict';var VoicePrefixEvents=require(_0xbae7('0x0'));var events=[_0xbae7('0x1'),_0xbae7('0x2'),'update'];function createListener(_0x54a99e,_0x324890){return function(_0x2da494){_0x324890[_0xbae7('0x3')](_0x54a99e,_0x2da494);};}function removeListener(_0xc0d4b9,_0x49bdda){return function(){VoicePrefixEvents['removeListener'](_0xc0d4b9,_0x49bdda);};}exports[_0xbae7('0x4')]=function(_0xb625f6){for(var _0x163147=0x0,_0x56c84c=events[_0xbae7('0x5')];_0x163147<_0x56c84c;_0x163147++){var _0x539635=events[_0x163147];var _0x228a90=createListener(_0xbae7('0x6')+_0x539635,_0xb625f6);VoicePrefixEvents['on'](_0x539635,_0x228a90);}}; \ No newline at end of file +var _0x2bdb=['voicePrefix:','./voicePrefix.events','remove','removeListener','register'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x2bdb,0x105));var _0xb2bd=function(_0x31bf14,_0x2c3fd3){_0x31bf14=_0x31bf14-0x0;var _0x9e9c5c=_0x2bdb[_0x31bf14];return _0x9e9c5c;};'use strict';var VoicePrefixEvents=require(_0xb2bd('0x0'));var events=['save',_0xb2bd('0x1'),'update'];function createListener(_0x3b40de,_0x1d3ddb){return function(_0xab9a35){_0x1d3ddb['emit'](_0x3b40de,_0xab9a35);};}function removeListener(_0x438ced,_0x2be356){return function(){VoicePrefixEvents[_0xb2bd('0x2')](_0x438ced,_0x2be356);};}exports[_0xb2bd('0x3')]=function(_0x461137){for(var _0x2ef40b=0x0,_0x3bff5b=events['length'];_0x2ef40b<_0x3bff5b;_0x2ef40b++){var _0x21462b=events[_0x2ef40b];var _0x4d9d3f=createListener(_0xb2bd('0x4')+_0x21462b,_0x461137);VoicePrefixEvents['on'](_0x21462b,_0x4d9d3f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index d52886f..8395c3d 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xb10b,0x12a));var _0xbb10=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0xb10b[_0x24875d];return _0x181471;};'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('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x455f19,_0x4f8f3a){var _0x422f21=function(_0x4537cd){while(--_0x4537cd){_0x455f19['push'](_0x455f19['shift']());}};_0x422f21(++_0x4f8f3a);}(_0xb10b,0x12a));var _0xbb10=function(_0x2074fb,_0x26707f){_0x2074fb=_0x2074fb-0x0;var _0x4c71d3=_0xb10b[_0x2074fb];return _0x4c71d3;};'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('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 59d245a..c87f8ac 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 _0xb13e=['strategy','getDataValue','dialMethod','booked','progressive','INTEGER','yes','all','TEXT','setDataValue','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','leastrecent','fewestcalls','rrmemory','linear','rrordered','ringall'];(function(_0x5a8dec,_0x4f6183){var _0x72fd50=function(_0x1c6487){while(--_0x1c6487){_0x5a8dec['push'](_0x5a8dec['shift']());}};_0x72fd50(++_0x4f6183);}(_0xb13e,0x1f0));var _0xeb13=function(_0xe1d243,_0x4a4aa2){_0xe1d243=_0xe1d243-0x0;var _0x4b47d6=_0xb13e[_0xe1d243];return _0x4b47d6;};'use strict';var Sequelize=require(_0xeb13('0x0'));module[_0xeb13('0x1')]={'name':{'type':Sequelize[_0xeb13('0x2')],'allowNull':![],'unique':_0xeb13('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x5'),_0xeb13('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':_0xeb13('0x7')},'announce':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0xeb13('0x4')]('rr','ringall',_0xeb13('0x8'),_0xeb13('0x9'),'random',_0xeb13('0xa'),_0xeb13('0xb'),'wrandom',_0xeb13('0xc')),'allowNull':![],'defaultValue':_0xeb13('0xd'),'set':function(_0xbe6419){this['setDataValue'](_0xeb13('0xe'),_0xbe6419?_0xbe6419:_0xeb13('0xa'));},'get':function(){var _0x1a1e51=this[_0xeb13('0xf')]('type');var _0x56d3d6=this[_0xeb13('0xf')](_0xeb13('0x10'));var _0x5798d9=this[_0xeb13('0xf')](_0xeb13('0xe'));if(_0x1a1e51==='inbound'){return _0x5798d9;}if(_0x56d3d6==='booked'&&_0x5798d9==='rrmemory'||_0x56d3d6===_0xeb13('0x11')&&_0x5798d9==='roundrobin'){return _0x5798d9;}if(_0x56d3d6===_0xeb13('0x12')||_0x56d3d6==='predictive'||_0x56d3d6==='power'){return _0x5798d9;}return null;}},'servicelevel':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xeb13('0x13')](0xb)},'timeout':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xeb13('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':_0xeb13('0x14')},'autopause':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no',_0xeb13('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xeb13('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xeb13('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xeb13('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xeb13('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':_0xeb13('0x14')},'announce_holdtime':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xeb13('0x4')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xeb13('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xeb13('0x2')]},'queue_youarenext':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xeb13('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0xeb13('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xeb13('0x16')],'set':function(_0x58244e){this[_0xeb13('0x17')]('periodic_announce',_0x58244e?_0x58244e[_0xeb13('0x18')](','):[]);},'get':function(){return this[_0xeb13('0xf')]('periodic_announce')?this[_0xeb13('0xf')]('periodic_announce')['split'](','):[];}},'joinempty':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':'yes','set':function(_0x10994f){this['setDataValue']('joinempty',_0x10994f?_0x10994f['join'](','):undefined);},'get':function(){return this[_0xeb13('0xf')](_0xeb13('0x19'))?this['getDataValue'](_0xeb13('0x19'))[_0xeb13('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':'no','set':function(_0x1f2aa8){this['setDataValue'](_0xeb13('0x1b'),_0x1f2aa8?_0x1f2aa8[_0xeb13('0x18')](','):undefined);},'get':function(){return this[_0xeb13('0xf')]('leavewhenempty')?this[_0xeb13('0xf')](_0xeb13('0x1b'))[_0xeb13('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xeb13('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0xeb13('0x1c')],'defaultValue':0x0,'set':function(_0x4532e9){this[_0xeb13('0x17')](_0xeb13('0x1d'),_0x4532e9);if(_0x4532e9){if(this['getDataValue'](_0xeb13('0x1e'))<0x2){this[_0xeb13('0x17')](_0xeb13('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xeb13('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xeb13('0x1c')],'defaultValue':0x0,'comment':_0xeb13('0x1f')},'dialMethod':{'type':Sequelize['ENUM'](_0xeb13('0x20'),'progressive',_0xeb13('0x21'),_0xeb13('0x22'),_0xeb13('0x11')),'defaultValue':_0xeb13('0x12'),'comment':_0xeb13('0x23')},'dialLimitChannel':{'type':Sequelize[_0xeb13('0x13')](0x4)[_0xeb13('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xeb13('0x25')},'dialLimitQueue':{'type':Sequelize[_0xeb13('0x13')](0x4)[_0xeb13('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xeb13('0x26')},'dialPowerLevel':{'type':Sequelize[_0xeb13('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xeb13('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x29'),_0xeb13('0x2a')),'defaultValue':_0xeb13('0x2a'),'comment':_0xeb13('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xeb13('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0xeb13('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xeb13('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize[_0xeb13('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xeb13('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xeb13('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb13('0x2e')},'dialQueueOptions':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':_0xeb13('0x2f'),'comment':_0xeb13('0x30')},'dialQueueTimeout':{'type':Sequelize[_0xeb13('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0xeb13('0x2')],'comment':_0xeb13('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)[_0xeb13('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb13('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xeb13('0x13')](0x5)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)[_0xeb13('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb13('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0xeb13('0x13')](0x5)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xeb13('0x24')],'defaultValue':0x3,'comment':_0xeb13('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xeb13('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xeb13('0x38')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':_0xeb13('0x39')},'dialPrefix':{'type':Sequelize[_0xeb13('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x3a'),_0xeb13('0x3b'),'onlyIfOpen'),'defaultValue':_0xeb13('0x3a')},'dialAMDActive':{'type':Sequelize[_0xeb13('0x1c')],'defaultValue':0x0,'comment':_0xeb13('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0xeb13('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xeb13('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0xeb13('0x13')](0x9)[_0xeb13('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xeb13('0x13')](0x9)[_0xeb13('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xeb13('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xeb13('0x13')](0x9)[_0xeb13('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeb13('0x3f')},'dialAMDMinWordLength':{'type':Sequelize[_0xeb13('0x13')](0x9)[_0xeb13('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xeb13('0x40')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xeb13('0x13')](0x9)[_0xeb13('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xeb13('0x41')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xeb13('0x13')](0x9)[_0xeb13('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xeb13('0x13')](0x5)[_0xeb13('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xeb13('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xeb13('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xeb13('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0xeb13('0x13')](0x5)[_0xeb13('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xeb13('0x44')},'dialRecallInQueue':{'type':Sequelize[_0xeb13('0x1c')],'defaultValue':0x0,'comment':_0xeb13('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0xeb13('0x4')](_0xeb13('0x46'),_0xeb13('0x47')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xeb13('0x2')],'comment':_0xeb13('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xeb13('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xeb13('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xeb13('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)[_0xeb13('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)[_0xeb13('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb13('0x49')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb13('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xeb13('0x13')](0x5)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x4c')},'dialMachineMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)[_0xeb13('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb13('0x4d')},'dialMachineRetryFrequency':{'type':Sequelize[_0xeb13('0x13')](0x5)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xeb13('0x13')](0x3)[_0xeb13('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xeb13('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xeb13('0x13')](0x5)[_0xeb13('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xeb13('0x50')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xeb13('0x51')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xeb13('0x52'),'set':function(_0x418983){if(!_0x418983)this[_0xeb13('0x17')](_0xeb13('0x53'),null);this[_0xeb13('0x17')](_0xeb13('0x54'),_0x418983);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xeb13('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xeb13('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xeb13('0x1c')],'defaultValue':![]}}; \ No newline at end of file +var _0xac93=['leavewhenempty','BOOLEAN','acw','wrapuptime','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','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\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#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','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','setDataValue','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','ENUM','yes','all','once','periodic_announce','join','joinempty','split'];(function(_0x276d44,_0x246d3e){var _0x4245c4=function(_0x3d3448){while(--_0x3d3448){_0x276d44['push'](_0x276d44['shift']());}};_0x4245c4(++_0x246d3e);}(_0xac93,0x1ce));var _0x3ac9=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xac93[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require(_0x3ac9('0x0'));module[_0x3ac9('0x1')]={'name':{'type':Sequelize[_0x3ac9('0x2')],'allowNull':![],'unique':_0x3ac9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x3ac9('0x4'),_0x3ac9('0x5')),'allowNull':![],'defaultValue':_0x3ac9('0x4')},'musiconhold':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x3ac9('0x6'),_0x3ac9('0x7'),_0x3ac9('0x8'),_0x3ac9('0x9'),_0x3ac9('0xa'),_0x3ac9('0xb'),'wrandom','rrordered'),'allowNull':![],'defaultValue':_0x3ac9('0x6'),'set':function(_0x2962ea){this[_0x3ac9('0xc')](_0x3ac9('0xd'),_0x2962ea?_0x2962ea:'rrmemory');},'get':function(){var _0x42a989=this[_0x3ac9('0xe')]('type');var _0xdee70e=this['getDataValue'](_0x3ac9('0xf'));var _0x56ae9f=this[_0x3ac9('0xe')](_0x3ac9('0xd'));if(_0x42a989===_0x3ac9('0x4')){return _0x56ae9f;}if(_0xdee70e===_0x3ac9('0x10')&&_0x56ae9f===_0x3ac9('0xa')||_0xdee70e===_0x3ac9('0x10')&&_0x56ae9f===_0x3ac9('0x11')){return _0x56ae9f;}if(_0xdee70e===_0x3ac9('0x12')||_0xdee70e===_0x3ac9('0x13')||_0xdee70e===_0x3ac9('0x14')){return _0x56ae9f;}return null;}},'servicelevel':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3ac9('0x15')](0xb)},'timeout':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x3ac9('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3ac9('0x16')]('yes','no'),'defaultValue':_0x3ac9('0x17')},'autopause':{'type':Sequelize[_0x3ac9('0x16')]('yes','no',_0x3ac9('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3ac9('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3ac9('0x16')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x3ac9('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3ac9('0x16')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3ac9('0x16')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3ac9('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no'),'defaultValue':_0x3ac9('0x17')},'announce_holdtime':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no',_0x3ac9('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x3ac9('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3ac9('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3ac9('0x2')]},'queue_youarenext':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3ac9('0x2')]},'queue_quantity1':{'type':Sequelize[_0x3ac9('0x2')]},'queue_quantity2':{'type':Sequelize[_0x3ac9('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3ac9('0x2')]},'queue_less_than':{'type':Sequelize[_0x3ac9('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0xf7f47a){this[_0x3ac9('0xc')](_0x3ac9('0x1a'),_0xf7f47a?_0xf7f47a[_0x3ac9('0x1b')](','):[]);},'get':function(){return this[_0x3ac9('0xe')]('periodic_announce')?this[_0x3ac9('0xe')](_0x3ac9('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':'yes','set':function(_0x15d7ea){this['setDataValue']('joinempty',_0x15d7ea?_0x15d7ea[_0x3ac9('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this['getDataValue'](_0x3ac9('0x1c'))[_0x3ac9('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0xf36158){this[_0x3ac9('0xc')](_0x3ac9('0x1e'),_0xf36158?_0xf36158['join'](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x3ac9('0xe')](_0x3ac9('0x1e'))[_0x3ac9('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3ac9('0x16')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3ac9('0x2')]},'acw':{'type':Sequelize[_0x3ac9('0x1f')],'defaultValue':0x0,'set':function(_0x5ce7e7){this[_0x3ac9('0xc')](_0x3ac9('0x20'),_0x5ce7e7);if(_0x5ce7e7){if(this[_0x3ac9('0xe')](_0x3ac9('0x21'))<0x2){this[_0x3ac9('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3ac9('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x3ac9('0x16')]('preview',_0x3ac9('0x12'),_0x3ac9('0x14'),_0x3ac9('0x13'),_0x3ac9('0x10')),'defaultValue':_0x3ac9('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x3ac9('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3ac9('0x23')},'dialLimitQueue':{'type':Sequelize[_0x3ac9('0x15')](0x4)[_0x3ac9('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3ac9('0x24')},'dialPowerLevel':{'type':Sequelize[_0x3ac9('0x25')](0x2)[_0x3ac9('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3ac9('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x27'),_0x3ac9('0x28')),'defaultValue':_0x3ac9('0x28'),'comment':_0x3ac9('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x3ac9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3ac9('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x3ac9('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3ac9('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3ac9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3ac9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x3ac9('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':'tTxX','comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x3ac9('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x2d')},'dialQueueProject':{'type':Sequelize[_0x3ac9('0x2')],'comment':_0x3ac9('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3ac9('0x15')](0x5)[_0x3ac9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ac9('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3ac9('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ac9('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3ac9('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3ac9('0x15')](0x5)[_0x3ac9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ac9('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)[_0x3ac9('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3ac9('0x35')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x3ac9('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x36'),_0x3ac9('0x37'),_0x3ac9('0x38')),'defaultValue':_0x3ac9('0x36')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3ac9('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x3ac9('0x15')](0x9)[_0x3ac9('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3ac9('0x3a')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3ac9('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3ac9('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3ac9('0x15')](0x9)[_0x3ac9('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3ac9('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3ac9('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ac9('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3ac9('0x22')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3ac9('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3ac9('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3ac9('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3ac9('0x15')](0x9)[_0x3ac9('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3ac9('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3ac9('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3ac9('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3ac9('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3ac9('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x3ac9('0x15')](0x5)[_0x3ac9('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x3ac9('0x1f')],'defaultValue':0x0,'comment':_0x3ac9('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3ac9('0x16')](_0x3ac9('0x44'),_0x3ac9('0x45')),'defaultValue':_0x3ac9('0x44')},'dialQueueProject2':{'type':Sequelize[_0x3ac9('0x2')],'comment':_0x3ac9('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3ac9('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3ac9('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3ac9('0x46')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3ac9('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3ac9('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)[_0x3ac9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3ac9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)[_0x3ac9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x3ac9('0x15')](0x5)[_0x3ac9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ac9('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)[_0x3ac9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3ac9('0x15')](0x5)[_0x3ac9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)[_0x3ac9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3ac9('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ac9('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3ac9('0x15')](0x3)[_0x3ac9('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3ac9('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3ac9('0x15')](0x5)[_0x3ac9('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3ac9('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3ac9('0x15')],'allowNull':!![],'comment':_0x3ac9('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x3ac9('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x12dfd1){if(!_0x12dfd1)this[_0x3ac9('0xc')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x3ac9('0x51'),_0x12dfd1);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3ac9('0x15')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3ac9('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x3ac9('0x1f')],'defaultValue':!![]},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x3ac9('0x1f')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 8f6f692..96f1e75 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 _0xb63b=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','update','findOne','CmHopper','VoiceQueueId','hasOwnProperty','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','select','field','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','ContactId','ListId','NOW()','scheduledAt','CmListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','removeLists','CmList','getBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','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','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','get','VoiceQueues','inbound','QueueCampaigns','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','order','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','options','create','body'];(function(_0x420b24,_0x382adc){var _0x4da552=function(_0x4e1623){while(--_0x4e1623){_0x420b24['push'](_0x420b24['shift']());}};_0x4da552(++_0x382adc);}(_0xb63b,0x11d));var _0xbb63=function(_0x51d859,_0x446e18){_0x51d859=_0x51d859-0x0;var _0x16d1e7=_0xb63b[_0x51d859];return _0x16d1e7;};'use strict';var emlformat=require(_0xbb63('0x0'));var rimraf=require(_0xbb63('0x1'));var zipdir=require(_0xbb63('0x2'));var jsonpatch=require(_0xbb63('0x3'));var rp=require(_0xbb63('0x4'));var moment=require(_0xbb63('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbb63('0x6'));var util=require(_0xbb63('0x7'));var path=require(_0xbb63('0x8'));var sox=require(_0xbb63('0x9'));var csv=require(_0xbb63('0xa'));var ejs=require(_0xbb63('0xb'));var fs=require('fs');var fs_extra=require(_0xbb63('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb63('0xd'));var jsforce=require(_0xbb63('0xe'));var deskjs=require(_0xbb63('0xf'));var toCsv=require(_0xbb63('0xa'));var querystring=require(_0xbb63('0x10'));var Papa=require(_0xbb63('0x11'));var Redis=require(_0xbb63('0x12'));var authService=require(_0xbb63('0x13'));var qs=require(_0xbb63('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb63('0x15'));var logger=require(_0xbb63('0x16'))(_0xbb63('0x17'));var utils=require(_0xbb63('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xbb63('0x19'));var db=require(_0xbb63('0x1a'))['db'];config[_0xbb63('0x1b')]=_['defaults'](config['redis'],{'host':_0xbb63('0x1c'),'port':0x18eb});var socket=require(_0xbb63('0x1d'))(new Redis(config[_0xbb63('0x1b')]));require(_0xbb63('0x1e'))[_0xbb63('0x1f')](socket);function respondWithStatusCode(_0x3b8cbe,_0xe17c27){_0xe17c27=_0xe17c27||0xcc;return function(_0x272497){if(_0x272497){return _0x3b8cbe[_0xbb63('0x20')](_0xe17c27);}return _0x3b8cbe[_0xbb63('0x21')](_0xe17c27)[_0xbb63('0x22')]();};}function respondWithResult(_0x5c1641,_0x15eff4){_0x15eff4=_0x15eff4||0xc8;return function(_0x41c9ed){if(_0x41c9ed){return _0x5c1641['status'](_0x15eff4)['json'](_0x41c9ed);}};}function respondWithFilteredResult(_0x1364da,_0x309de2){return function(_0x5b8c4b){if(_0x5b8c4b){var _0x20c317=typeof _0x309de2[_0xbb63('0x23')]===_0xbb63('0x24')&&typeof _0x309de2[_0xbb63('0x25')]==='undefined';var _0x5baced=_0x5b8c4b[_0xbb63('0x26')];var _0x4db7ab=_0x20c317?0x0:_0x309de2[_0xbb63('0x23')];var _0x41cf60=_0x20c317?_0x5b8c4b['count']:_0x309de2['offset']+_0x309de2[_0xbb63('0x25')];var _0x22ffaf;if(_0x41cf60>=_0x5baced){_0x41cf60=_0x5baced;_0x22ffaf=0xc8;}else{_0x22ffaf=0xce;}_0x1364da[_0xbb63('0x21')](_0x22ffaf);return _0x1364da[_0xbb63('0x27')](_0xbb63('0x28'),_0x4db7ab+'-'+_0x41cf60+'/'+_0x5baced)[_0xbb63('0x29')](_0x5b8c4b);}return null;};}function patchUpdates(_0x126dbb){return function(_0x1085c4){try{jsonpatch['apply'](_0x1085c4,_0x126dbb,!![]);}catch(_0x20eb6b){return BPromise['reject'](_0x20eb6b);}return _0x1085c4[_0xbb63('0x2a')]();};}function saveUpdates(_0x4ad774,_0x5f5c75){return function(_0xb40611){if(_0xb40611){return _0xb40611['update'](_0x4ad774)[_0xbb63('0x2b')](function(_0x1127ae){return _0x1127ae;});}return null;};}function removeEntity(_0x3fa43c,_0x12f6fa){return function(_0x937ef6){if(_0x937ef6){return _0x937ef6['destroy']()[_0xbb63('0x2b')](function(){var _0x16d5a6=_0x937ef6[_0xbb63('0x2c')]({'plain':!![]});var _0xe6f370=[{'name':_0xbb63('0x2d'),'value':_0xbb63('0x2e'),'ignore':![]},{'name':_0xbb63('0x2f'),'value':'outbound','ignore':![]}];var _0x3e40cc=_(_0xe6f370)['filter'](_0xbb63('0x30'))[_0xbb63('0x31')]('value')[_0xbb63('0x32')]();if(_[_0xbb63('0x33')](_0x3e40cc,_0x16d5a6[_0xbb63('0x34')])){return;}var _0x4fe246=_[_0xbb63('0x35')](_0xe6f370,['value',_0x16d5a6['type']])[_0xbb63('0x36')];return db[_0xbb63('0x37')][_0xbb63('0x38')]({'where':{'type':_0x4fe246,'resourceId':_0x16d5a6['id']}})['then'](function(){return _0x937ef6;});})[_0xbb63('0x2b')](function(){_0x3fa43c[_0xbb63('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d2757,_0x2bb939){return function(_0x56f421){if(!_0x56f421){_0x1d2757['sendStatus'](0x194);}return _0x56f421;};}function handleError(_0x4c6848,_0x5191e9){_0x5191e9=_0x5191e9||0x1f4;return function(_0x22dab9){logger[_0xbb63('0x39')](_0x22dab9['stack']);if(_0x22dab9[_0xbb63('0x36')]){delete _0x22dab9[_0xbb63('0x36')];}_0x4c6848[_0xbb63('0x21')](_0x5191e9)[_0xbb63('0x3a')](_0x22dab9);};}exports[_0xbb63('0x3b')]=function(_0x26dd45,_0x59a280){var _0x596914={},_0x3de0e5={},_0x3d7a51={'count':0x0,'rows':[]};var _0x406f07=_[_0xbb63('0x31')](db[_0xbb63('0x3c')][_0xbb63('0x3d')],function(_0x336522){return{'name':_0x336522[_0xbb63('0x3e')],'type':_0x336522[_0xbb63('0x34')][_0xbb63('0x3f')]};});_0x3de0e5[_0xbb63('0x40')]=_[_0xbb63('0x31')](_0x406f07,_0xbb63('0x36'));_0x3de0e5[_0xbb63('0x41')]=_[_0xbb63('0x42')](_0x26dd45[_0xbb63('0x41')]);_0x3de0e5['filters']=_[_0xbb63('0x43')](_0x3de0e5[_0xbb63('0x40')],_0x3de0e5[_0xbb63('0x41')]);_0x596914[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x3de0e5[_0xbb63('0x40')],qs[_0xbb63('0x45')](_0x26dd45[_0xbb63('0x41')][_0xbb63('0x45')]));_0x596914[_0xbb63('0x44')]=_0x596914[_0xbb63('0x44')][_0xbb63('0x46')]?_0x596914[_0xbb63('0x44')]:_0x3de0e5[_0xbb63('0x40')];if(!_0x26dd45['query']['hasOwnProperty']('nolimit')){_0x596914['limit']=qs[_0xbb63('0x25')](_0x26dd45['query']['limit']);_0x596914[_0xbb63('0x23')]=qs['offset'](_0x26dd45[_0xbb63('0x41')]['offset']);}_0x596914[_0xbb63('0x47')]=qs[_0xbb63('0x48')](_0x26dd45[_0xbb63('0x41')][_0xbb63('0x48')]);_0x596914['where']=qs['filters'](_[_0xbb63('0x49')](_0x26dd45[_0xbb63('0x41')],_0x3de0e5[_0xbb63('0x4a')]),_0x406f07);if(_0x26dd45[_0xbb63('0x41')][_0xbb63('0x4b')]){_0x596914[_0xbb63('0x4c')]=_['merge'](_0x596914['where'],{'$or':_['map'](_0x406f07,function(_0x208ca6){if(_0x208ca6[_0xbb63('0x34')]!==_0xbb63('0x4d')){var _0x1c4662={};_0x1c4662[_0x208ca6['name']]={'$like':'%'+_0x26dd45[_0xbb63('0x41')][_0xbb63('0x4b')]+'%'};return _0x1c4662;}})});}_0x596914=_[_0xbb63('0x4e')]({},_0x596914,_0x26dd45['options']);var _0x338e46={'where':_0x596914[_0xbb63('0x4c')]};return db[_0xbb63('0x3c')][_0xbb63('0x26')](_0x338e46)['then'](function(_0x2cc336){_0x3d7a51[_0xbb63('0x26')]=_0x2cc336;if(_0x26dd45[_0xbb63('0x41')][_0xbb63('0x4f')]){_0x596914[_0xbb63('0x50')]=[{'all':!![]}];}return db[_0xbb63('0x3c')][_0xbb63('0x51')](_0x596914);})['then'](function(_0x52f6cb){_0x3d7a51[_0xbb63('0x52')]=_0x52f6cb;return _0x3d7a51;})['then'](respondWithFilteredResult(_0x59a280,_0x596914))[_0xbb63('0x53')](handleError(_0x59a280,null));};exports['show']=function(_0x33f94b,_0x4f02ba){var _0x418acd={'raw':![],'where':{'id':_0x33f94b['params']['id']}},_0x2b55fe={};_0x2b55fe[_0xbb63('0x40')]=_[_0xbb63('0x42')](db[_0xbb63('0x3c')][_0xbb63('0x3d')]);_0x2b55fe[_0xbb63('0x41')]=_[_0xbb63('0x42')](_0x33f94b['query']);_0x2b55fe['filters']=_['intersection'](_0x2b55fe[_0xbb63('0x40')],_0x2b55fe[_0xbb63('0x41')]);_0x418acd[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x2b55fe['model'],qs['fields'](_0x33f94b[_0xbb63('0x41')][_0xbb63('0x45')]));_0x418acd[_0xbb63('0x44')]=_0x418acd[_0xbb63('0x44')][_0xbb63('0x46')]?_0x418acd[_0xbb63('0x44')]:_0x2b55fe[_0xbb63('0x40')];if(_0x33f94b[_0xbb63('0x41')][_0xbb63('0x4f')]){_0x418acd[_0xbb63('0x50')]=[{'all':!![]}];}_0x418acd=_[_0xbb63('0x4e')]({},_0x418acd,_0x33f94b[_0xbb63('0x54')]);return db['VoiceQueue'][_0xbb63('0x35')](_0x418acd)[_0xbb63('0x2b')](handleEntityNotFound(_0x4f02ba,null))[_0xbb63('0x2b')](respondWithResult(_0x4f02ba,null))[_0xbb63('0x53')](handleError(_0x4f02ba,null));};exports[_0xbb63('0x55')]=function(_0x6f14ec,_0x2dc895){return db[_0xbb63('0x3c')][_0xbb63('0x55')](_0x6f14ec[_0xbb63('0x56')],{})[_0xbb63('0x2b')](function(_0x3a2ce0){var _0x18106e=_0x6f14ec[_0xbb63('0x57')][_0xbb63('0x2c')]({'plain':!![]});if(!_0x18106e)throw new Error(_0xbb63('0x58'));if(_0x18106e[_0xbb63('0x59')]===_0xbb63('0x57')){var _0x1dca18=_0x3a2ce0['get']({'plain':!![]});var _0x1c8974=[{'name':_0xbb63('0x2d'),'value':_0xbb63('0x2e')},{'name':_0xbb63('0x2f'),'value':_0xbb63('0x5a')}];var _0x2648c3=_[_0xbb63('0x35')](_0x1c8974,[_0xbb63('0x32'),_0x1dca18[_0xbb63('0x34')]])['name'];return db[_0xbb63('0x5b')][_0xbb63('0x35')]({'where':{'name':_0x2648c3,'userProfileId':_0x18106e[_0xbb63('0x5c')]},'raw':!![]})['then'](function(_0x34d545){if(_0x34d545&&_0x34d545[_0xbb63('0x5d')]===0x0){return db[_0xbb63('0x37')][_0xbb63('0x55')]({'name':_0x1dca18['name'],'resourceId':_0x1dca18['id'],'type':_0x34d545[_0xbb63('0x36')],'sectionId':_0x34d545['id']},{})[_0xbb63('0x2b')](function(){return _0x3a2ce0;});}else{return _0x3a2ce0;}})[_0xbb63('0x53')](function(_0x4b72e2){logger[_0xbb63('0x39')](_0xbb63('0x5e'),_0x4b72e2);throw _0x4b72e2;});}return _0x3a2ce0;})[_0xbb63('0x2b')](respondWithResult(_0x2dc895,0xc9))[_0xbb63('0x53')](handleError(_0x2dc895,null));};exports[_0xbb63('0x5f')]=function(_0x3dc49c,_0x49442e){var _0x2cbe81={'where':{'id':_0x3dc49c[_0xbb63('0x60')]['id']}},_0x2eabc0={};_0x2eabc0[_0xbb63('0x40')]=_[_0xbb63('0x42')](db[_0xbb63('0x3c')]['rawAttributes']);_0x2cbe81[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x2eabc0['model'],qs[_0xbb63('0x45')](_0x3dc49c[_0xbb63('0x41')][_0xbb63('0x45')]));_0x2cbe81[_0xbb63('0x44')]=_0x2cbe81['attributes']['length']?_0x2cbe81[_0xbb63('0x44')]:_0x2eabc0[_0xbb63('0x40')];if(_0x3dc49c[_0xbb63('0x41')][_0xbb63('0x4f')]){_0x2cbe81[_0xbb63('0x50')]=[{'all':!![]}];}_0x2cbe81=_[_0xbb63('0x4e')]({},_0x2cbe81,_0x3dc49c[_0xbb63('0x54')]);return db[_0xbb63('0x3c')][_0xbb63('0x35')](_0x2cbe81)['then'](handleEntityNotFound(_0x49442e,null))[_0xbb63('0x2b')](function(_0x3b6f20){if(_0x3b6f20){var _0x32011c=_0x3b6f20[_0xbb63('0x2c')]({'plain':!![]});_0x32011c=qs[_0xbb63('0x61')](_0x32011c,['id','createdAt',_0xbb63('0x62')]);_0x3dc49c[_0xbb63('0x56')]=_['omit'](_0x3dc49c['body'],['id',_0xbb63('0x63'),_0xbb63('0x62')]);return db['VoiceQueue'][_0xbb63('0x55')](_[_0xbb63('0x4e')](_0x32011c,_0x3dc49c[_0xbb63('0x56')]),{'include':_0x3dc49c['query'][_0xbb63('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x2e9e62){var _0x293ecd=_0x3dc49c[_0xbb63('0x57')][_0xbb63('0x2c')]({'plain':!![]});if(!_0x293ecd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293ecd[_0xbb63('0x59')]===_0xbb63('0x57')){var _0x3b5aeb=_0x2e9e62[_0xbb63('0x2c')]({'plain':!![]});var _0x4b9e50=[{'name':_0xbb63('0x2d'),'value':_0xbb63('0x2e')},{'name':_0xbb63('0x2f'),'value':'outbound'}];var _0x48b67a=_[_0xbb63('0x35')](_0x4b9e50,[_0xbb63('0x32'),_0x3b5aeb[_0xbb63('0x34')]])[_0xbb63('0x36')];return db[_0xbb63('0x5b')][_0xbb63('0x35')]({'where':{'name':_0x48b67a,'userProfileId':_0x293ecd[_0xbb63('0x5c')]},'raw':!![]})[_0xbb63('0x2b')](function(_0x4dafb0){if(_0x4dafb0&&_0x4dafb0[_0xbb63('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x3b5aeb[_0xbb63('0x36')],'resourceId':_0x3b5aeb['id'],'type':_0x4dafb0[_0xbb63('0x36')],'sectionId':_0x4dafb0['id']},{})['then'](function(){return _0x2e9e62;});}else{return _0x2e9e62;}})[_0xbb63('0x53')](function(_0x1ecbf1){logger[_0xbb63('0x39')](_0xbb63('0x5e'),_0x1ecbf1);throw _0x1ecbf1;});}return _0x2e9e62;});}})['then'](respondWithResult(_0x49442e,0xc9))[_0xbb63('0x53')](handleError(_0x49442e,null));};exports[_0xbb63('0x64')]=function(_0x2d7204,_0x1b4071){if(_0x2d7204[_0xbb63('0x56')]['id']){delete _0x2d7204[_0xbb63('0x56')]['id'];}return db[_0xbb63('0x3c')][_0xbb63('0x35')]({'where':{'id':_0x2d7204[_0xbb63('0x60')]['id']}})['then'](handleEntityNotFound(_0x1b4071,null))[_0xbb63('0x2b')](saveUpdates(_0x2d7204[_0xbb63('0x56')],null))['then'](respondWithResult(_0x1b4071,null))[_0xbb63('0x53')](handleError(_0x1b4071,null));};exports[_0xbb63('0x38')]=function(_0x2c7828,_0x3beb3a){return db[_0xbb63('0x3c')][_0xbb63('0x35')]({'where':{'id':_0x2c7828[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x3beb3a,null))[_0xbb63('0x2b')](removeEntity(_0x3beb3a,null))['catch'](handleError(_0x3beb3a,null));};exports['getHoppers']=function(_0x18b849,_0x50ab65,_0x1a42d5){var _0x80aa49={'raw':![],'where':{}};var _0x61746e={};var _0x5e45c1={'count':0x0,'rows':[]};return db[_0xbb63('0x3c')][_0xbb63('0x65')]({'where':{'id':_0x18b849['params']['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x50ab65,null))[_0xbb63('0x2b')](function(_0x4c4dc3){if(_0x4c4dc3){_0x61746e[_0xbb63('0x40')]=_[_0xbb63('0x42')](db[_0xbb63('0x66')][_0xbb63('0x3d')]);_0x61746e['query']=_[_0xbb63('0x42')](_0x18b849['query']);_0x61746e['filters']=_[_0xbb63('0x43')](_0x61746e['model'],_0x61746e[_0xbb63('0x41')]);_0x80aa49[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x61746e['model'],qs['fields'](_0x18b849['query'][_0xbb63('0x45')]));_0x80aa49['attributes']=_0x80aa49[_0xbb63('0x44')]['length']?_0x80aa49['attributes']:_0x61746e[_0xbb63('0x40')];if(!_0x18b849[_0xbb63('0x41')]['hasOwnProperty']('nolimit')){_0x80aa49[_0xbb63('0x25')]=qs['limit'](_0x18b849[_0xbb63('0x41')][_0xbb63('0x25')]);_0x80aa49[_0xbb63('0x23')]=qs[_0xbb63('0x23')](_0x18b849['query'][_0xbb63('0x23')]);}_0x80aa49[_0xbb63('0x47')]=qs[_0xbb63('0x48')](_0x18b849[_0xbb63('0x41')][_0xbb63('0x48')]);_0x80aa49[_0xbb63('0x4c')]=qs[_0xbb63('0x4a')](_['pick'](_0x18b849[_0xbb63('0x41')],_0x61746e['filters']));_0x80aa49['where'][_0xbb63('0x67')]=_0x4c4dc3['id'];if(_0x18b849[_0xbb63('0x41')]['filter']){_0x80aa49['where']=_['merge'](_0x80aa49[_0xbb63('0x4c')],{'$or':_[_0xbb63('0x31')](_0x80aa49[_0xbb63('0x44')],function(_0x296a44){var _0xa0db6e={};_0xa0db6e[_0x296a44]={'$like':'%'+_0x18b849[_0xbb63('0x41')][_0xbb63('0x4b')]+'%'};return _0xa0db6e;})});}_0x80aa49=_[_0xbb63('0x4e')]({},_0x80aa49,_0x18b849[_0xbb63('0x54')]);return db[_0xbb63('0x66')][_0xbb63('0x26')]({'where':_0x80aa49[_0xbb63('0x4c')]})[_0xbb63('0x2b')](function(_0x52dbff){_0x5e45c1[_0xbb63('0x26')]=_0x52dbff;if(_0x18b849[_0xbb63('0x41')][_0xbb63('0x4f')]){_0x80aa49[_0xbb63('0x50')]=[{'all':!![]}];}return db[_0xbb63('0x66')][_0xbb63('0x51')](_0x80aa49);})['then'](function(_0x309a61){_0x5e45c1[_0xbb63('0x52')]=_0x309a61;return _0x5e45c1;});}})[_0xbb63('0x2b')](respondWithFilteredResult(_0x50ab65,_0x80aa49))[_0xbb63('0x53')](handleError(_0x50ab65,null));};exports['getHopperHistories']=function(_0x1c182a,_0x43f98a,_0x48915e){var _0x1c6fc3={'raw':!![],'where':{}};var _0x4e6eb6={};var _0x320297={'count':0x0,'rows':[]};return db[_0xbb63('0x3c')]['findOne']({'where':{'id':_0x1c182a['params']['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x43f98a,null))['then'](function(_0x35ca81){if(_0x35ca81){_0x4e6eb6[_0xbb63('0x40')]=_[_0xbb63('0x42')](db['CmHopperHistory'][_0xbb63('0x3d')]);_0x4e6eb6['query']=_[_0xbb63('0x42')](_0x1c182a[_0xbb63('0x41')]);_0x4e6eb6[_0xbb63('0x4a')]=_['intersection'](_0x4e6eb6['model'],_0x4e6eb6[_0xbb63('0x41')]);_0x1c6fc3[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x4e6eb6[_0xbb63('0x40')],qs['fields'](_0x1c182a[_0xbb63('0x41')][_0xbb63('0x45')]));_0x1c6fc3[_0xbb63('0x44')]=_0x1c6fc3[_0xbb63('0x44')]['length']?_0x1c6fc3[_0xbb63('0x44')]:_0x4e6eb6[_0xbb63('0x40')];if(!_0x1c182a[_0xbb63('0x41')][_0xbb63('0x68')](_0xbb63('0x69'))){_0x1c6fc3['limit']=qs[_0xbb63('0x25')](_0x1c182a[_0xbb63('0x41')][_0xbb63('0x25')]);_0x1c6fc3['offset']=qs[_0xbb63('0x23')](_0x1c182a[_0xbb63('0x41')]['offset']);}_0x1c6fc3['order']=qs[_0xbb63('0x48')](_0x1c182a['query']['sort']);_0x1c6fc3[_0xbb63('0x4c')]=qs['filters'](_['pick'](_0x1c182a[_0xbb63('0x41')],_0x4e6eb6[_0xbb63('0x4a')]));_0x1c6fc3[_0xbb63('0x4c')][_0xbb63('0x67')]=_0x35ca81['id'];if(_0x1c182a[_0xbb63('0x41')][_0xbb63('0x4b')]){_0x1c6fc3[_0xbb63('0x4c')]=_[_0xbb63('0x4e')](_0x1c6fc3['where'],{'$or':_[_0xbb63('0x31')](_0x1c6fc3[_0xbb63('0x44')],function(_0x4dfca7){var _0x32a78f={};_0x32a78f[_0x4dfca7]={'$like':'%'+_0x1c182a['query'][_0xbb63('0x4b')]+'%'};return _0x32a78f;})});}_0x1c6fc3=_['merge']({},_0x1c6fc3,_0x1c182a['options']);return db[_0xbb63('0x6a')][_0xbb63('0x26')]({'where':_0x1c6fc3[_0xbb63('0x4c')]})[_0xbb63('0x2b')](function(_0x1ff72e){_0x320297[_0xbb63('0x26')]=_0x1ff72e;if(_0x1c182a[_0xbb63('0x41')][_0xbb63('0x4f')]){_0x1c6fc3[_0xbb63('0x50')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xbb63('0x51')](_0x1c6fc3);})[_0xbb63('0x2b')](function(_0x3ddc90){_0x320297[_0xbb63('0x52')]=_0x3ddc90;return _0x320297;});}})[_0xbb63('0x2b')](respondWithFilteredResult(_0x43f98a,_0x1c6fc3))['catch'](handleError(_0x43f98a,null));};exports[_0xbb63('0x6b')]=function(_0x795251,_0x528ae7,_0x41bb71){var _0x4d809a={'raw':!![],'where':{}};var _0x5e2704={};var _0x68ce63={'count':0x0,'rows':[]};return db[_0xbb63('0x3c')][_0xbb63('0x65')]({'where':{'id':_0x795251[_0xbb63('0x60')]['id']}})['then'](handleEntityNotFound(_0x528ae7,null))['then'](function(_0x482c9c){if(_0x482c9c){_0x5e2704[_0xbb63('0x40')]=_[_0xbb63('0x42')](db[_0xbb63('0x6c')]['rawAttributes']);_0x5e2704[_0xbb63('0x41')]=_[_0xbb63('0x42')](_0x795251['query']);_0x5e2704['filters']=_[_0xbb63('0x43')](_0x5e2704[_0xbb63('0x40')],_0x5e2704['query']);_0x4d809a[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x5e2704[_0xbb63('0x40')],qs[_0xbb63('0x45')](_0x795251['query']['fields']));_0x4d809a[_0xbb63('0x44')]=_0x4d809a['attributes'][_0xbb63('0x46')]?_0x4d809a['attributes']:_0x5e2704['model'];if(!_0x795251[_0xbb63('0x41')][_0xbb63('0x68')](_0xbb63('0x69'))){_0x4d809a[_0xbb63('0x25')]=qs['limit'](_0x795251['query'][_0xbb63('0x25')]);_0x4d809a[_0xbb63('0x23')]=qs[_0xbb63('0x23')](_0x795251[_0xbb63('0x41')][_0xbb63('0x23')]);}_0x4d809a[_0xbb63('0x47')]=qs['sort'](_0x795251[_0xbb63('0x41')]['sort']);_0x4d809a['where']=qs[_0xbb63('0x4a')](_['pick'](_0x795251[_0xbb63('0x41')],_0x5e2704['filters']));_0x4d809a[_0xbb63('0x4c')][_0xbb63('0x67')]=_0x482c9c['id'];if(_0x795251[_0xbb63('0x41')][_0xbb63('0x4b')]){_0x4d809a[_0xbb63('0x4c')]=_[_0xbb63('0x4e')](_0x4d809a['where'],{'$or':_[_0xbb63('0x31')](_0x4d809a[_0xbb63('0x44')],function(_0x2571f8){var _0x2e3723={};_0x2e3723[_0x2571f8]={'$like':'%'+_0x795251['query']['filter']+'%'};return _0x2e3723;})});}_0x4d809a=_[_0xbb63('0x4e')]({},_0x4d809a,_0x795251[_0xbb63('0x54')]);return db['CmHopperFinal'][_0xbb63('0x26')]({'where':_0x4d809a[_0xbb63('0x4c')]})[_0xbb63('0x2b')](function(_0x44ef9f){_0x68ce63[_0xbb63('0x26')]=_0x44ef9f;if(_0x795251[_0xbb63('0x41')][_0xbb63('0x4f')]){_0x4d809a[_0xbb63('0x50')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x4d809a);})[_0xbb63('0x2b')](function(_0x30eee9){_0x68ce63[_0xbb63('0x52')]=_0x30eee9;return _0x68ce63;});}})['then'](respondWithFilteredResult(_0x528ae7,_0x4d809a))[_0xbb63('0x53')](handleError(_0x528ae7,null));};exports[_0xbb63('0x6d')]=function(_0x2ff122,_0x34b257,_0x2ce0ef){var _0x52fe47={'raw':!![],'where':{}};var _0x5af81f={};var _0x349d6f={'count':0x0,'rows':[]};return db[_0xbb63('0x3c')][_0xbb63('0x65')]({'where':{'id':_0x2ff122[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x34b257,null))[_0xbb63('0x2b')](function(_0x10964b){if(_0x10964b){_0x5af81f[_0xbb63('0x40')]=_['keys'](db[_0xbb63('0x6e')][_0xbb63('0x3d')]);_0x5af81f[_0xbb63('0x41')]=_[_0xbb63('0x42')](_0x2ff122[_0xbb63('0x41')]);_0x5af81f[_0xbb63('0x4a')]=_['intersection'](_0x5af81f[_0xbb63('0x40')],_0x5af81f[_0xbb63('0x41')]);_0x52fe47[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x5af81f['model'],qs['fields'](_0x2ff122['query'][_0xbb63('0x45')]));_0x52fe47[_0xbb63('0x44')]=_0x52fe47[_0xbb63('0x44')][_0xbb63('0x46')]?_0x52fe47[_0xbb63('0x44')]:_0x5af81f[_0xbb63('0x40')];if(!_0x2ff122[_0xbb63('0x41')][_0xbb63('0x68')]('nolimit')){_0x52fe47[_0xbb63('0x25')]=qs['limit'](_0x2ff122[_0xbb63('0x41')][_0xbb63('0x25')]);_0x52fe47[_0xbb63('0x23')]=qs[_0xbb63('0x23')](_0x2ff122[_0xbb63('0x41')]['offset']);}_0x52fe47[_0xbb63('0x47')]=qs[_0xbb63('0x48')](_0x2ff122[_0xbb63('0x41')][_0xbb63('0x48')]);_0x52fe47['where']=qs[_0xbb63('0x4a')](_['pick'](_0x2ff122['query'],_0x5af81f[_0xbb63('0x4a')]));_0x52fe47[_0xbb63('0x4c')][_0xbb63('0x67')]=_0x10964b['id'];if(_0x2ff122[_0xbb63('0x41')][_0xbb63('0x4b')]){_0x52fe47[_0xbb63('0x4c')]=_[_0xbb63('0x4e')](_0x52fe47['where'],{'$or':_[_0xbb63('0x31')](_0x52fe47[_0xbb63('0x44')],function(_0x5dcdac){var _0x2149c1={};_0x2149c1[_0x5dcdac]={'$like':'%'+_0x2ff122[_0xbb63('0x41')]['filter']+'%'};return _0x2149c1;})});}_0x52fe47=_['merge']({},_0x52fe47,_0x2ff122[_0xbb63('0x54')]);return db[_0xbb63('0x6e')][_0xbb63('0x26')]({'where':_0x52fe47[_0xbb63('0x4c')]})[_0xbb63('0x2b')](function(_0x58e166){_0x349d6f[_0xbb63('0x26')]=_0x58e166;if(_0x2ff122[_0xbb63('0x41')][_0xbb63('0x4f')]){_0x52fe47[_0xbb63('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xbb63('0x51')](_0x52fe47);})['then'](function(_0x2d5d68){_0x349d6f[_0xbb63('0x52')]=_0x2d5d68;return _0x349d6f;});}})[_0xbb63('0x2b')](respondWithFilteredResult(_0x34b257,_0x52fe47))['catch'](handleError(_0x34b257,null));};exports[_0xbb63('0x6f')]=function(_0x1d2057,_0x160ad1,_0x331455){var _0xb85cbf={};var _0x3319d4={};var _0x13846a;var _0x44bc66;return db[_0xbb63('0x3c')][_0xbb63('0x65')]({'where':{'id':_0x1d2057[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x160ad1,null))[_0xbb63('0x2b')](function(_0x1fbacd){if(_0x1fbacd){_0x13846a=_0x1fbacd;_0x3319d4['model']=_[_0xbb63('0x42')](db['Team'][_0xbb63('0x3d')]);_0x3319d4[_0xbb63('0x41')]=_['keys'](_0x1d2057[_0xbb63('0x41')]);_0x3319d4[_0xbb63('0x4a')]=_['intersection'](_0x3319d4['model'],_0x3319d4[_0xbb63('0x41')]);_0xb85cbf[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x3319d4['model'],qs[_0xbb63('0x45')](_0x1d2057[_0xbb63('0x41')][_0xbb63('0x45')]));_0xb85cbf[_0xbb63('0x44')]=_0xb85cbf[_0xbb63('0x44')][_0xbb63('0x46')]?_0xb85cbf['attributes']:_0x3319d4['model'];_0xb85cbf[_0xbb63('0x47')]=qs[_0xbb63('0x48')](_0x1d2057[_0xbb63('0x41')][_0xbb63('0x48')]);_0xb85cbf[_0xbb63('0x4c')]=qs[_0xbb63('0x4a')](_[_0xbb63('0x49')](_0x1d2057['query'],_0x3319d4[_0xbb63('0x4a')]));if(_0x1d2057[_0xbb63('0x41')]['filter']){_0xb85cbf['where']=_['merge'](_0xb85cbf[_0xbb63('0x4c')],{'$or':_[_0xbb63('0x31')](_0xb85cbf[_0xbb63('0x44')],function(_0x13a507){var _0x5071cb={};_0x5071cb[_0x13a507]={'$like':'%'+_0x1d2057[_0xbb63('0x41')][_0xbb63('0x4b')]+'%'};return _0x5071cb;})});}_0xb85cbf=_['merge']({},_0xb85cbf,_0x1d2057['options']);return _0x13846a[_0xbb63('0x6f')](_0xb85cbf);}})['then'](function(_0x5b1fb8){if(_0x5b1fb8){_0x44bc66=_0x5b1fb8[_0xbb63('0x46')];if(!_0x1d2057['query'][_0xbb63('0x68')]('nolimit')){_0xb85cbf[_0xbb63('0x25')]=qs[_0xbb63('0x25')](_0x1d2057[_0xbb63('0x41')][_0xbb63('0x25')]);_0xb85cbf[_0xbb63('0x23')]=qs[_0xbb63('0x23')](_0x1d2057['query'][_0xbb63('0x23')]);}return _0x13846a[_0xbb63('0x6f')](_0xb85cbf);}})[_0xbb63('0x2b')](function(_0x9d60a5){if(_0x9d60a5){return _0x9d60a5?{'count':_0x44bc66,'rows':_0x9d60a5}:null;}})[_0xbb63('0x2b')](respondWithResult(_0x160ad1,null))[_0xbb63('0x53')](handleError(_0x160ad1,null));};exports['addTeams']=function(_0x447c84,_0x493dc3,_0x2a1bba){var _0x46523a=_0x447c84[_0xbb63('0x56')][_0xbb63('0x70')];var _0x322f09=_[_0xbb63('0x31')](_0x46523a,'id');return db[_0xbb63('0x71')][_0xbb63('0x51')]({'where':{'id':_0x322f09},'attributes':['id'],'include':[{'model':db[_0xbb63('0x72')],'as':_0xbb63('0x73'),'attributes':['id',_0xbb63('0x36'),_0xbb63('0x74'),'voicePause',_0xbb63('0x75')],'raw':!![]}]})[_0xbb63('0x2b')](function(_0x48321c){if(_0x48321c){var _0x1fd8c8=_[_0xbb63('0x76')](_0x48321c,function(_0x21f0cf){var _0x7b1d5e=_0x21f0cf[_0xbb63('0x2c')]({'plain':!![]});_0x7b1d5e[_0xbb63('0x73')][_0xbb63('0x77')](function(_0x5df3c6){_0x5df3c6[_0xbb63('0x78')]=_[_0xbb63('0x35')](_0x46523a,{'id':_0x7b1d5e['id']})[_0xbb63('0x78')];});return _0x7b1d5e[_0xbb63('0x73')];});return db[_0xbb63('0x3c')]['find']({'where':{'id':_0x447c84[_0xbb63('0x60')]['id']}})['then'](function(_0x2696cb){return db[_0xbb63('0x79')][_0xbb63('0x7a')](function(_0x37ddbd){return _0x2696cb[_0xbb63('0x7b')](_0x322f09,{'transaction':_0x37ddbd})[_0xbb63('0x2b')](function(){return BPromise[_0xbb63('0x7c')](_0x46523a,function(_0x287f98){return db[_0xbb63('0x7d')][_0xbb63('0x7e')]({'TeamId':_0x287f98['id'],'VoiceQueueId':_0x447c84['params']['id'],'penalty':_0x287f98[_0xbb63('0x78')]},{'transaction':_0x37ddbd});});})['then'](function(){return BPromise[_0xbb63('0x7c')](_0x1fd8c8,function(_0x541566){return db[_0xbb63('0x7f')]['findOrCreate']({'where':{'UserId':_0x541566['id'],'VoiceQueueId':_0x447c84['params']['id']},'defaults':{'penalty':_0x541566[_0xbb63('0x78')]},'transaction':_0x37ddbd});});})['then'](function(){return BPromise[_0xbb63('0x7c')](_[_0xbb63('0x4b')](_0x1fd8c8,{'online':!![]}),function(_0x5160b8){return db['UserVoiceQueueRt'][_0xbb63('0x7e')]({'membername':_0x5160b8[_0xbb63('0x36')],'UserId':_0x5160b8['id'],'queue_name':_0x2696cb[_0xbb63('0x36')],'VoiceQueueId':_0x2696cb['id'],'interface':_[_0xbb63('0x80')](_0x5160b8[_0xbb63('0x75')])?util[_0xbb63('0x81')](_0xbb63('0x82'),_0x5160b8['name']):_0x5160b8[_0xbb63('0x75')],'paused':_0x5160b8[_0xbb63('0x83')]||![],'penalty':_0x5160b8[_0xbb63('0x78')]},{'transaction':_0x37ddbd});});})[_0xbb63('0x2b')](function(){_0x1fd8c8[_0xbb63('0x77')](function(_0x3d5fa4){socket[_0xbb63('0x84')](_0xbb63('0x85'),{'UserId':_0x3d5fa4['id'],'VoiceQueueId':_0x2696cb['id']});});});});});}})[_0xbb63('0x2b')](respondWithStatusCode(_0x493dc3,null))['catch'](handleError(_0x493dc3,null));};exports[_0xbb63('0x86')]=function(_0x19af70,_0x368fa9,_0x524d08){return db[_0xbb63('0x71')][_0xbb63('0x51')]({'where':{'id':_0x19af70[_0xbb63('0x41')][_0xbb63('0x87')]},'attributes':['id'],'include':[{'model':db[_0xbb63('0x72')],'as':_0xbb63('0x73'),'attributes':['id'],'raw':!![]}]})[_0xbb63('0x2b')](handleEntityNotFound(_0x368fa9,null))[_0xbb63('0x2b')](function(_0x2aa9fb){var _0x27b24b=_[_0xbb63('0x31')](_0x2aa9fb,'id');var _0x2febbd=[];var _0x2f302a=[];var _0x2accba=squel[_0xbb63('0x88')]();_0x2accba[_0xbb63('0x89')]('tq.TeamId')['from'](_0xbb63('0x8a'),'tq')[_0xbb63('0x8b')]('user_has_teams','ut',_0xbb63('0x8c'))[_0xbb63('0x4c')](_0xbb63('0x8d'),_0x19af70[_0xbb63('0x60')]['id']);for(var _0x2a7134=0x0;_0x2a7134<_0x2aa9fb[_0xbb63('0x46')];_0x2a7134+=0x1){let _0x171fc3=_0x2aa9fb[_0x2a7134];for(var _0x2cd331=0x0;_0x2cd331<_0x171fc3['Agents'][_0xbb63('0x46')];_0x2cd331+=0x1){let _0x448061=_0x171fc3[_0xbb63('0x73')][_0x2cd331];var _0x55ddc6=_0x2accba[_0xbb63('0x5f')]();_0x55ddc6['where'](_0xbb63('0x8e'),_0x448061['id']);_0x2f302a[_0xbb63('0x8f')](db[_0xbb63('0x79')][_0xbb63('0x41')](_0x55ddc6[_0xbb63('0x90')](),{'type':db['sequelize'][_0xbb63('0x91')][_0xbb63('0x92')]})[_0xbb63('0x2b')](function(_0x3034fb){if(_0x3034fb[_0xbb63('0x46')]===0x1){return _0x448061['id'];}else{var _0x18f060=_[_0xbb63('0x93')](_[_0xbb63('0x31')](_0x3034fb,_0xbb63('0x94')),function(_0x4a8b28){return _[_0xbb63('0x33')](_0x27b24b,_0x4a8b28);});if(_0x18f060){return _0x448061['id'];}}}));}}return BPromise[_0xbb63('0x95')](_0x2f302a)[_0xbb63('0x2b')](function(_0x4735d5){_0x2febbd=_(_0x2febbd)[_0xbb63('0x96')](_0x4735d5)['compact']()[_0xbb63('0x32')]();return db[_0xbb63('0x3c')][_0xbb63('0x35')]({'where':{'id':_0x19af70[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](function(_0xe5efa2){return db[_0xbb63('0x79')][_0xbb63('0x7a')](function(_0xcbcd38){return _0xe5efa2[_0xbb63('0x86')](_0x19af70[_0xbb63('0x41')]['ids'],{'transaction':_0xcbcd38})[_0xbb63('0x2b')](function(){if(!_[_0xbb63('0x97')](_0x2febbd)){return _0xe5efa2[_0xbb63('0x98')](_0x2febbd,{'transaction':_0xcbcd38})[_0xbb63('0x2b')](function(){return db[_0xbb63('0x99')][_0xbb63('0x38')]({'where':{'VoiceQueueId':_0x19af70[_0xbb63('0x60')]['id'],'UserId':_0x2febbd},'transaction':_0xcbcd38});});}})[_0xbb63('0x2b')](function(){_0x2febbd[_0xbb63('0x77')](function(_0x444784){socket[_0xbb63('0x84')](_0xbb63('0x9a'),{'UserId':_0x444784,'VoiceQueueId':_0xe5efa2['id']});});});});});});})['then'](respondWithStatusCode(_0x368fa9,null))['catch'](handleError(_0x368fa9,null));};exports[_0xbb63('0x9b')]=function(_0x52900d,_0x3d8fb1,_0x3cda8b){var _0x5f0962,_0x4064fb;return db[_0xbb63('0x3c')][_0xbb63('0x35')]({'where':{'id':_0x52900d[_0xbb63('0x60')]['id']}})['then'](handleEntityNotFound(_0x3d8fb1,null))[_0xbb63('0x2b')](function(_0x58e0e7){if(_0x58e0e7){_0x4064fb=_0x58e0e7;return _0x58e0e7[_0xbb63('0x9b')](_0x52900d[_0xbb63('0x56')][_0xbb63('0x87')],_[_0xbb63('0x61')](_0x52900d[_0xbb63('0x56')],['ids','id'])||{})[_0xbb63('0x9c')](function(_0x33393a){for(var _0x305511=0x0;_0x305511<_0x52900d['body'][_0xbb63('0x87')][_0xbb63('0x46')];_0x305511+=0x1){socket[_0xbb63('0x84')](_0xbb63('0x85'),{'UserId':Number(_0x52900d['body'][_0xbb63('0x87')][_0x305511]),'VoiceQueueId':Number(_0x52900d['params']['id'])});}return _0x33393a;});}})['then'](function(_0x2baf30){_0x5f0962=_0x2baf30||[];if(_0x4064fb){return db[_0xbb63('0x72')][_0xbb63('0x51')]({'where':{'id':_0x52900d[_0xbb63('0x56')][_0xbb63('0x87')]},'attributes':['id',_0xbb63('0x36'),_0xbb63('0x74'),_0xbb63('0x83'),_0xbb63('0x75')],'raw':!![]});}})[_0xbb63('0x2b')](function(_0x1963a6){if(!_[_0xbb63('0x97')](_0x1963a6)){var _0x1a2897=[];for(var _0x53615e=0x0;_0x53615e<_0x1963a6[_0xbb63('0x46')];_0x53615e++){if(_0x1963a6[_0x53615e]['online']){_0x1a2897[_0xbb63('0x8f')](db[_0xbb63('0x99')][_0xbb63('0x7e')]({'membername':_0x1963a6[_0x53615e]['name'],'UserId':_0x1963a6[_0x53615e]['id'],'queue_name':_0x4064fb[_0xbb63('0x36')],'VoiceQueueId':_0x4064fb['id'],'interface':_[_0xbb63('0x80')](_0x1963a6[_0x53615e][_0xbb63('0x75')])?util['format'](_0xbb63('0x82'),_0x1963a6[_0x53615e][_0xbb63('0x36')]):_0x1963a6[_0x53615e][_0xbb63('0x75')],'paused':_0x1963a6[_0x53615e][_0xbb63('0x83')]||![],'penalty':_0x52900d[_0xbb63('0x56')][_0xbb63('0x78')]||0x0}));}}return BPromise[_0xbb63('0x95')](_0x1a2897);}})[_0xbb63('0x2b')](function(){return _0x5f0962;})[_0xbb63('0x2b')](respondWithResult(_0x3d8fb1,null))['catch'](handleError(_0x3d8fb1,null));};exports['removeAgents']=function(_0x3d6817,_0x14e9cc,_0x4f2206){return db['VoiceQueue'][_0xbb63('0x35')]({'where':{'id':_0x3d6817[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x14e9cc,null))[_0xbb63('0x2b')](function(_0x166088){if(_0x166088){return _0x166088[_0xbb63('0x98')](_0x3d6817['query']['ids'])['then'](function(){if(_[_0xbb63('0x9d')](_0x3d6817[_0xbb63('0x41')][_0xbb63('0x87')])){for(var _0x1e2778=0x0;_0x1e2778<_0x3d6817['query'][_0xbb63('0x87')][_0xbb63('0x46')];_0x1e2778+=0x1){socket[_0xbb63('0x84')](_0xbb63('0x9a'),{'UserId':Number(_0x3d6817['query'][_0xbb63('0x87')][_0x1e2778]),'VoiceQueueId':Number(_0x3d6817[_0xbb63('0x60')]['id'])});}}else{socket[_0xbb63('0x84')](_0xbb63('0x9a'),{'UserId':Number(_0x3d6817['query']['ids']),'VoiceQueueId':Number(_0x3d6817[_0xbb63('0x60')]['id'])});}});}})[_0xbb63('0x2b')](function(_0x1c0982){return db[_0xbb63('0x99')]['destroy']({'where':{'VoiceQueueId':_0x3d6817[_0xbb63('0x60')]['id'],'UserId':_0x3d6817[_0xbb63('0x41')][_0xbb63('0x87')]}})[_0xbb63('0x2b')](function(){return _0x1c0982;});})[_0xbb63('0x2b')](respondWithStatusCode(_0x14e9cc,null))[_0xbb63('0x53')](handleError(_0x14e9cc,null));};exports[_0xbb63('0x9e')]=function(_0x2423b3,_0x709449,_0x2498cf){var _0x24bd51={};var _0x3013c3={};var _0x18217d;var _0x169f77;return db[_0xbb63('0x3c')][_0xbb63('0x65')]({'where':{'id':_0x2423b3[_0xbb63('0x60')]['id']}})['then'](handleEntityNotFound(_0x709449,null))[_0xbb63('0x2b')](function(_0x40cd1e){if(_0x40cd1e){_0x18217d=_0x40cd1e;_0x3013c3[_0xbb63('0x40')]=_[_0xbb63('0x42')](db[_0xbb63('0x72')][_0xbb63('0x3d')]);_0x3013c3[_0xbb63('0x41')]=_['keys'](_0x2423b3[_0xbb63('0x41')]);_0x3013c3[_0xbb63('0x4a')]=_['intersection'](_0x3013c3[_0xbb63('0x40')],_0x3013c3[_0xbb63('0x41')]);_0x24bd51[_0xbb63('0x44')]=_['intersection'](_0x3013c3[_0xbb63('0x40')],qs[_0xbb63('0x45')](_0x2423b3[_0xbb63('0x41')][_0xbb63('0x45')]));_0x24bd51['attributes']=_0x24bd51[_0xbb63('0x44')]['length']?_0x24bd51['attributes']:_0x3013c3[_0xbb63('0x40')];_0x24bd51[_0xbb63('0x47')]=qs[_0xbb63('0x48')](_0x2423b3['query'][_0xbb63('0x48')]);_0x24bd51[_0xbb63('0x4c')]=qs[_0xbb63('0x4a')](_['pick'](_0x2423b3[_0xbb63('0x41')],_0x3013c3['filters']));if(_0x2423b3[_0xbb63('0x41')][_0xbb63('0x4b')]){_0x24bd51[_0xbb63('0x4c')]=_[_0xbb63('0x4e')](_0x24bd51[_0xbb63('0x4c')],{'$or':_[_0xbb63('0x31')](_0x24bd51['attributes'],function(_0x19e0e3){var _0x1d4a4b={};_0x1d4a4b[_0x19e0e3]={'$like':'%'+_0x2423b3['query'][_0xbb63('0x4b')]+'%'};return _0x1d4a4b;})});}_0x24bd51=_['merge']({},_0x24bd51,_0x2423b3[_0xbb63('0x54')]);return _0x18217d[_0xbb63('0x9e')](_0x24bd51);}})['then'](function(_0xe5e52a){if(_0xe5e52a){_0x169f77=_0xe5e52a[_0xbb63('0x46')];if(!_0x2423b3[_0xbb63('0x41')][_0xbb63('0x68')](_0xbb63('0x69'))){_0x24bd51[_0xbb63('0x25')]=qs[_0xbb63('0x25')](_0x2423b3['query']['limit']);_0x24bd51[_0xbb63('0x23')]=qs[_0xbb63('0x23')](_0x2423b3[_0xbb63('0x41')][_0xbb63('0x23')]);}return _0x18217d[_0xbb63('0x9e')](_0x24bd51);}})[_0xbb63('0x2b')](function(_0x491a34){if(_0x491a34){return _0x491a34?{'count':_0x169f77,'rows':_0x491a34}:null;}})[_0xbb63('0x2b')](respondWithResult(_0x709449,null))[_0xbb63('0x53')](handleError(_0x709449,null));};exports['getMembers']=function(_0x226c25,_0x2d4ac7,_0x590214){var _0x3ffd26={};var _0x5206f1={};var _0x316dd4;var _0x14ab66;return db[_0xbb63('0x3c')]['findOne']({'where':{'id':_0x226c25[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x2d4ac7,null))[_0xbb63('0x2b')](function(_0x4f833d){if(_0x4f833d){_0x316dd4=_0x4f833d;_0x5206f1[_0xbb63('0x40')]=_[_0xbb63('0x42')](db[_0xbb63('0x99')]['rawAttributes']);_0x5206f1['query']=_[_0xbb63('0x42')](_0x226c25[_0xbb63('0x41')]);_0x5206f1[_0xbb63('0x4a')]=_[_0xbb63('0x43')](_0x5206f1['model'],_0x5206f1['query']);_0x3ffd26[_0xbb63('0x44')]=_[_0xbb63('0x43')](_0x5206f1[_0xbb63('0x40')],qs[_0xbb63('0x45')](_0x226c25[_0xbb63('0x41')]['fields']));_0x3ffd26[_0xbb63('0x44')]=_0x3ffd26[_0xbb63('0x44')][_0xbb63('0x46')]?_0x3ffd26[_0xbb63('0x44')]:_0x5206f1[_0xbb63('0x40')];_0x3ffd26[_0xbb63('0x47')]=qs[_0xbb63('0x48')](_0x226c25['query']['sort']);_0x3ffd26['where']=qs[_0xbb63('0x4a')](_[_0xbb63('0x49')](_0x226c25[_0xbb63('0x41')],_0x5206f1[_0xbb63('0x4a')]));if(_0x226c25[_0xbb63('0x41')]['filter']){_0x3ffd26[_0xbb63('0x4c')]=_[_0xbb63('0x4e')](_0x3ffd26[_0xbb63('0x4c')],{'$or':_['map'](_0x3ffd26[_0xbb63('0x44')],function(_0x20cc46){var _0x3914e9={};_0x3914e9[_0x20cc46]={'$like':'%'+_0x226c25[_0xbb63('0x41')][_0xbb63('0x4b')]+'%'};return _0x3914e9;})});}_0x3ffd26=_[_0xbb63('0x4e')]({},_0x3ffd26,_0x226c25[_0xbb63('0x54')]);return _0x316dd4['getMembers'](_0x3ffd26);}})[_0xbb63('0x2b')](function(_0x194f1c){if(_0x194f1c){_0x14ab66=_0x194f1c[_0xbb63('0x46')];if(!_0x226c25[_0xbb63('0x41')]['hasOwnProperty']('nolimit')){_0x3ffd26[_0xbb63('0x25')]=qs[_0xbb63('0x25')](_0x226c25[_0xbb63('0x41')]['limit']);_0x3ffd26[_0xbb63('0x23')]=qs[_0xbb63('0x23')](_0x226c25[_0xbb63('0x41')][_0xbb63('0x23')]);}return _0x316dd4['getMembers'](_0x3ffd26);}})[_0xbb63('0x2b')](function(_0x5964b2){return _0x5964b2?{'count':_0x14ab66,'rows':_0x5964b2}:null;})[_0xbb63('0x2b')](respondWithResult(_0x2d4ac7,null))[_0xbb63('0x53')](handleError(_0x2d4ac7,null));};exports['getLists']=function(_0x3ad26d,_0x2b324b,_0x1f44ca){var _0x327a81={};var _0x4d8094={};var _0x4262e2;var _0x332aab;return db[_0xbb63('0x3c')]['findOne']({'where':{'id':_0x3ad26d[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x2b324b,null))['then'](function(_0x287f61){if(_0x287f61){_0x4262e2=_0x287f61;_0x4d8094[_0xbb63('0x40')]=_[_0xbb63('0x42')](db['CmList'][_0xbb63('0x3d')]);_0x4d8094[_0xbb63('0x41')]=_['keys'](_0x3ad26d['query']);_0x4d8094[_0xbb63('0x4a')]=_[_0xbb63('0x43')](_0x4d8094['model'],_0x4d8094[_0xbb63('0x41')]);_0x327a81[_0xbb63('0x44')]=_['intersection'](_0x4d8094[_0xbb63('0x40')],qs['fields'](_0x3ad26d[_0xbb63('0x41')][_0xbb63('0x45')]));_0x327a81['attributes']=_0x327a81['attributes'][_0xbb63('0x46')]?_0x327a81[_0xbb63('0x44')]:_0x4d8094[_0xbb63('0x40')];_0x327a81[_0xbb63('0x47')]=qs['sort'](_0x3ad26d[_0xbb63('0x41')][_0xbb63('0x48')]);_0x327a81[_0xbb63('0x4c')]=qs['filters'](_[_0xbb63('0x49')](_0x3ad26d[_0xbb63('0x41')],_0x4d8094[_0xbb63('0x4a')]));if(_0x3ad26d[_0xbb63('0x41')][_0xbb63('0x4b')]){_0x327a81[_0xbb63('0x4c')]=_[_0xbb63('0x4e')](_0x327a81[_0xbb63('0x4c')],{'$or':_[_0xbb63('0x31')](_0x327a81[_0xbb63('0x44')],function(_0x11840f){var _0x5797ba={};_0x5797ba[_0x11840f]={'$like':'%'+_0x3ad26d[_0xbb63('0x41')][_0xbb63('0x4b')]+'%'};return _0x5797ba;})});}_0x327a81=_[_0xbb63('0x4e')]({},_0x327a81,_0x3ad26d[_0xbb63('0x54')]);return _0x4262e2['getLists'](_0x327a81);}})['then'](function(_0x5df243){if(_0x5df243){_0x332aab=_0x5df243['length'];if(!_0x3ad26d[_0xbb63('0x41')]['hasOwnProperty']('nolimit')){_0x327a81[_0xbb63('0x25')]=qs[_0xbb63('0x25')](_0x3ad26d[_0xbb63('0x41')][_0xbb63('0x25')]);_0x327a81[_0xbb63('0x23')]=qs['offset'](_0x3ad26d[_0xbb63('0x41')][_0xbb63('0x23')]);}return _0x4262e2['getLists'](_0x327a81);}})[_0xbb63('0x2b')](function(_0x54965a){if(_0x54965a){return _0x54965a?{'count':_0x332aab,'rows':_0x54965a}:null;}})[_0xbb63('0x2b')](respondWithResult(_0x2b324b,null))['catch'](handleError(_0x2b324b,null));};exports[_0xbb63('0x9f')]=function(_0x4cec8f,_0x91ebb9,_0x23bd44){var _0x237c7c,_0x55af94;return db['VoiceQueue'][_0xbb63('0x35')]({'where':{'id':_0x4cec8f[_0xbb63('0x60')]['id']}})['then'](handleEntityNotFound(_0x91ebb9,null))['then'](function(_0x3feb0c){if(_0x3feb0c){_0x55af94=_0x3feb0c;return _0x3feb0c[_0xbb63('0x9f')](_0x4cec8f[_0xbb63('0x56')]['ids'],_['omit'](_0x4cec8f[_0xbb63('0x56')],[_0xbb63('0x87'),'id'])||{});}return null;})[_0xbb63('0x9c')](function(_0x2aa5eb){var _0xcbacb7;_0x237c7c=_0x2aa5eb||[];var _0x341f29=[];if(_0x2aa5eb){for(var _0x35613c=0x0;_0x35613c<_0x2aa5eb[_0xbb63('0x46')];_0x35613c+=0x1){var _0x4d6638=_0x2aa5eb[_0x35613c][_0xbb63('0x2c')]({'plain':!![]});_0x55af94[_0xbb63('0xa0')]=_0x4cec8f[_0xbb63('0x56')]['dialCheckDuplicateType']?_0x4cec8f[_0xbb63('0x56')]['dialCheckDuplicateType']:_0x55af94[_0xbb63('0xa0')];switch(_0x55af94[_0xbb63('0xa0')]){case _0xbb63('0xa1'):_0xcbacb7=squel[_0xbb63('0xa2')]()[_0xbb63('0xa3')](_0xbb63('0xa4'))['fromQuery']([_0xbb63('0xa5'),'scheduledAt',_0xbb63('0xa6'),_0xbb63('0xa7'),_0xbb63('0x67'),_0xbb63('0x63'),_0xbb63('0x62')],squel[_0xbb63('0x88')]()[_0xbb63('0x89')](_0xbb63('0xa5'),_0xbb63('0xa5'))[_0xbb63('0x89')](_0xbb63('0xa8'),_0xbb63('0xa9'))[_0xbb63('0x89')]('id',_0xbb63('0xa6'))[_0xbb63('0x89')](_0x4d6638[_0xbb63('0xaa')]['toString'](),'ListId')['field'](_0x4cec8f[_0xbb63('0x60')]['id'][_0xbb63('0x90')](),_0xbb63('0x67'))[_0xbb63('0x89')](_0xbb63('0xa8'),'createdAt')[_0xbb63('0x89')]('NOW()','updatedAt')[_0xbb63('0xab')](_0xbb63('0xac'))[_0xbb63('0x4c')]('deletedAt\x20IS\x20NULL')[_0xbb63('0x4c')](_0xbb63('0xad'),_0x4d6638[_0xbb63('0xaa')][_0xbb63('0x90')]())[_0xbb63('0x4c')](_0xbb63('0xae'))[_0xbb63('0x4c')](_0xbb63('0xaf'),squel[_0xbb63('0x88')]()[_0xbb63('0x89')](_0xbb63('0xb0'))[_0xbb63('0xab')](_0xbb63('0xb1'))[_0xbb63('0x4c')](_0xbb63('0x8d'),_0x4cec8f['params']['id'][_0xbb63('0x90')]()))['where'](_0xbb63('0xaf'),squel[_0xbb63('0x88')]()[_0xbb63('0x89')](_0xbb63('0xb2'))[_0xbb63('0xab')](_0xbb63('0xa4'))[_0xbb63('0x4c')]('VoiceQueueId\x20=\x20?',_0x4cec8f[_0xbb63('0x60')]['id']['toString']())))['toString']();break;case _0xbb63('0xb3'):_0xcbacb7=squel[_0xbb63('0xa2')]()[_0xbb63('0xa3')]('cm_hopper')['fromQuery']([_0xbb63('0xa5'),_0xbb63('0xa9'),_0xbb63('0xa6'),_0xbb63('0xa7'),_0xbb63('0x67'),'createdAt',_0xbb63('0x62')],squel[_0xbb63('0x88')]()[_0xbb63('0x89')](_0xbb63('0xa5'),'phone')[_0xbb63('0x89')](_0xbb63('0xa8'),_0xbb63('0xa9'))[_0xbb63('0x89')]('id','ContactId')[_0xbb63('0x89')](_0x4d6638[_0xbb63('0xaa')][_0xbb63('0x90')](),'ListId')[_0xbb63('0x89')](_0x4cec8f['params']['id'][_0xbb63('0x90')](),'VoiceQueueId')[_0xbb63('0x89')]('NOW()',_0xbb63('0x63'))[_0xbb63('0x89')]('NOW()',_0xbb63('0x62'))[_0xbb63('0xab')](_0xbb63('0xac'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xbb63('0xad'),_0x4d6638[_0xbb63('0xaa')]['toString']())[_0xbb63('0x4c')]('phone\x20IS\x20NOT\x20NULL')[_0xbb63('0x4c')](_0xbb63('0xaf'),squel[_0xbb63('0x88')]()[_0xbb63('0x89')](_0xbb63('0xb2'))[_0xbb63('0xab')](_0xbb63('0xa4'))[_0xbb63('0x4c')](_0xbb63('0x8d'),_0x4cec8f[_0xbb63('0x60')]['id']['toString']())))[_0xbb63('0x90')]();break;default:_0xcbacb7=squel[_0xbb63('0xa2')]()[_0xbb63('0xa3')]('cm_hopper')[_0xbb63('0xb4')](['phone','scheduledAt',_0xbb63('0xa6'),_0xbb63('0xa7'),_0xbb63('0x67'),'createdAt',_0xbb63('0x62')],squel['select']()['field']('phone',_0xbb63('0xa5'))['field'](_0xbb63('0xa8'),'scheduledAt')[_0xbb63('0x89')]('id',_0xbb63('0xa6'))[_0xbb63('0x89')](_0x4d6638[_0xbb63('0xaa')][_0xbb63('0x90')](),_0xbb63('0xa7'))['field'](_0x4cec8f['params']['id'][_0xbb63('0x90')](),_0xbb63('0x67'))[_0xbb63('0x89')](_0xbb63('0xa8'),_0xbb63('0x63'))['field']('NOW()',_0xbb63('0x62'))['from'](_0xbb63('0xac'))[_0xbb63('0x4c')](_0xbb63('0xb5'))[_0xbb63('0x4c')](_0xbb63('0xad'),_0x4d6638[_0xbb63('0xaa')]['toString']())['where'](_0xbb63('0xae')))[_0xbb63('0x90')]();}_0x341f29['push'](db[_0xbb63('0x79')][_0xbb63('0x41')](_0xcbacb7));}return BPromise[_0xbb63('0x95')](_0x341f29);}})[_0xbb63('0x2b')](function(){return _0x237c7c;})[_0xbb63('0x2b')](respondWithResult(_0x91ebb9,null))[_0xbb63('0x53')](handleError(_0x91ebb9,null));};exports[_0xbb63('0xb6')]=function(_0x33bbf5,_0x3ef1b5,_0x2262b7){return db[_0xbb63('0x3c')][_0xbb63('0x35')]({'where':{'id':_0x33bbf5[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x3ef1b5,null))['then'](function(_0x11c6e8){if(_0x11c6e8){return _0x11c6e8[_0xbb63('0xb6')](_0x33bbf5[_0xbb63('0x41')][_0xbb63('0x87')]);}})['then'](function(_0x578194){if(_0x578194){return db['CmHopper']['destroy']({'where':{'ListId':_0x33bbf5[_0xbb63('0x41')][_0xbb63('0x87')],'VoiceQueueId':_0x33bbf5['params']['id']}})[_0xbb63('0x2b')](function(){return _0x578194;});}})[_0xbb63('0x2b')](respondWithStatusCode(_0x3ef1b5,null))['catch'](handleError(_0x3ef1b5,null));};exports['getBlackLists']=function(_0x32205a,_0xc6ba64,_0x4f9f07){var _0x549343={};var _0x2c8d67={};var _0x103efa;var _0xcd6d49;return db[_0xbb63('0x3c')][_0xbb63('0x65')]({'where':{'id':_0x32205a['params']['id']}})['then'](handleEntityNotFound(_0xc6ba64,null))[_0xbb63('0x2b')](function(_0x1eb1e7){if(_0x1eb1e7){_0x103efa=_0x1eb1e7;_0x2c8d67[_0xbb63('0x40')]=_['keys'](db[_0xbb63('0xb7')]['rawAttributes']);_0x2c8d67[_0xbb63('0x41')]=_['keys'](_0x32205a['query']);_0x2c8d67[_0xbb63('0x4a')]=_['intersection'](_0x2c8d67['model'],_0x2c8d67['query']);_0x549343['attributes']=_[_0xbb63('0x43')](_0x2c8d67[_0xbb63('0x40')],qs[_0xbb63('0x45')](_0x32205a[_0xbb63('0x41')][_0xbb63('0x45')]));_0x549343[_0xbb63('0x44')]=_0x549343[_0xbb63('0x44')]['length']?_0x549343[_0xbb63('0x44')]:_0x2c8d67[_0xbb63('0x40')];_0x549343[_0xbb63('0x47')]=qs[_0xbb63('0x48')](_0x32205a[_0xbb63('0x41')]['sort']);_0x549343[_0xbb63('0x4c')]=qs[_0xbb63('0x4a')](_[_0xbb63('0x49')](_0x32205a[_0xbb63('0x41')],_0x2c8d67[_0xbb63('0x4a')]));if(_0x32205a[_0xbb63('0x41')]['filter']){_0x549343['where']=_[_0xbb63('0x4e')](_0x549343[_0xbb63('0x4c')],{'$or':_[_0xbb63('0x31')](_0x549343[_0xbb63('0x44')],function(_0x1a3af4){var _0x2a9b51={};_0x2a9b51[_0x1a3af4]={'$like':'%'+_0x32205a[_0xbb63('0x41')][_0xbb63('0x4b')]+'%'};return _0x2a9b51;})});}_0x549343=_[_0xbb63('0x4e')]({},_0x549343,_0x32205a['options']);return _0x103efa[_0xbb63('0xb8')](_0x549343);}})[_0xbb63('0x2b')](function(_0x33f5d8){if(_0x33f5d8){_0xcd6d49=_0x33f5d8['length'];if(!_0x32205a[_0xbb63('0x41')][_0xbb63('0x68')](_0xbb63('0x69'))){_0x549343[_0xbb63('0x25')]=qs['limit'](_0x32205a['query'][_0xbb63('0x25')]);_0x549343[_0xbb63('0x23')]=qs[_0xbb63('0x23')](_0x32205a[_0xbb63('0x41')][_0xbb63('0x23')]);}return _0x103efa[_0xbb63('0xb8')](_0x549343);}})[_0xbb63('0x2b')](function(_0x5d1b88){if(_0x5d1b88){return _0x5d1b88?{'count':_0xcd6d49,'rows':_0x5d1b88}:null;}})['then'](respondWithResult(_0xc6ba64,null))[_0xbb63('0x53')](handleError(_0xc6ba64,null));};exports['addBlackLists']=function(_0x3e5957,_0x822347,_0x2ab387){var _0x121abd,_0x53def8;return db['VoiceQueue'][_0xbb63('0x35')]({'where':{'id':_0x3e5957[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x822347,null))['then'](function(_0x286e46){if(_0x286e46){_0x53def8=_0x286e46;return _0x286e46['addBlackLists'](_0x3e5957[_0xbb63('0x56')][_0xbb63('0x87')],_['omit'](_0x3e5957[_0xbb63('0x56')],[_0xbb63('0x87'),'id'])||{});}return null;})[_0xbb63('0x9c')](function(_0x3dbc60){var _0x44c90e;_0x121abd=_0x3dbc60||[];var _0x538809=[];if(_0x3dbc60){for(var _0x305d21=0x0;_0x305d21<_0x3dbc60[_0xbb63('0x46')];_0x305d21+=0x1){var _0x232561=_0x3dbc60[_0x305d21][_0xbb63('0x2c')]({'plain':!![]});_0x44c90e=squel['insert']()[_0xbb63('0xa3')]('cm_hopper_black')[_0xbb63('0xb4')]([_0xbb63('0xa5'),'ContactId','ListId',_0xbb63('0x67'),_0xbb63('0x63'),'updatedAt'],squel[_0xbb63('0x88')]()['field'](_0xbb63('0xa5'),_0xbb63('0xa5'))[_0xbb63('0x89')]('id','ContactId')[_0xbb63('0x89')](_0x232561[_0xbb63('0xaa')]['toString'](),'ListId')[_0xbb63('0x89')](_0x3e5957['params']['id'][_0xbb63('0x90')](),_0xbb63('0x67'))['field']('NOW()','createdAt')['field']('NOW()',_0xbb63('0x62'))[_0xbb63('0xab')](_0xbb63('0xac'))[_0xbb63('0x4c')](_0xbb63('0xb5'))['where'](_0xbb63('0xad'),_0x232561[_0xbb63('0xaa')][_0xbb63('0x90')]())[_0xbb63('0x4c')](_0xbb63('0xae')))[_0xbb63('0x90')]();_0x538809[_0xbb63('0x8f')](db[_0xbb63('0x79')]['query'](_0x44c90e));}return BPromise[_0xbb63('0x95')](_0x538809);}})['then'](function(){return _0x121abd;})['then'](respondWithResult(_0x822347,null))[_0xbb63('0x53')](handleError(_0x822347,null));};exports[_0xbb63('0xb9')]=function(_0x3e78ec,_0x2d9f99,_0x3f9708){return db[_0xbb63('0x3c')][_0xbb63('0x35')]({'where':{'id':_0x3e78ec[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](handleEntityNotFound(_0x2d9f99,null))['then'](function(_0x22c383){if(_0x22c383){return _0x22c383[_0xbb63('0xb9')](_0x3e78ec[_0xbb63('0x41')][_0xbb63('0x87')]);}})[_0xbb63('0x2b')](function(_0x258510){if(_0x258510){return db[_0xbb63('0x6e')]['destroy']({'where':{'ListId':_0x3e78ec[_0xbb63('0x41')][_0xbb63('0x87')],'VoiceQueueId':_0x3e78ec[_0xbb63('0x60')]['id']}})[_0xbb63('0x2b')](function(){return _0x258510;});}})[_0xbb63('0x2b')](respondWithStatusCode(_0x2d9f99,null))[_0xbb63('0x53')](handleError(_0x2d9f99,null));}; \ No newline at end of file +var _0x2700=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','error','send','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','catch','create','body','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','autoAssociation','update','getHoppers','findOne','pick','CmHopper','CmHopperHistory','getHopperFinals','VoiceQueueId','CmHopperFinal','CmHopperBlack','getTeams','addTeams','teams','Team','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','upsert','UserVoiceQueue','findOrCreate','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','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','toString','QueryTypes','every','all','union','compact','isEmpty','removeAgents','addAgents','spread','UserVoiceQueueRt','isArray','userVoiceQueue:remove','getAgents','User','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','NOW()','scheduledAt','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_hopper','onlyIfOpen','deletedAt\x20IS\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv'];(function(_0x561098,_0xdd1933){var _0x42701a=function(_0x2ab50f){while(--_0x2ab50f){_0x561098['push'](_0x561098['shift']());}};_0x42701a(++_0xdd1933);}(_0x2700,0xa8));var _0x0270=function(_0x402b1f,_0x3df329){_0x402b1f=_0x402b1f-0x0;var _0x5d22f2=_0x2700[_0x402b1f];return _0x5d22f2;};'use strict';var emlformat=require(_0x0270('0x0'));var rimraf=require(_0x0270('0x1'));var zipdir=require(_0x0270('0x2'));var jsonpatch=require(_0x0270('0x3'));var rp=require(_0x0270('0x4'));var moment=require(_0x0270('0x5'));var BPromise=require(_0x0270('0x6'));var Mustache=require(_0x0270('0x7'));var util=require('util');var path=require(_0x0270('0x8'));var sox=require(_0x0270('0x9'));var csv=require('to-csv');var ejs=require(_0x0270('0xa'));var fs=require('fs');var fs_extra=require(_0x0270('0xb'));var _=require(_0x0270('0xc'));var squel=require(_0x0270('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0270('0xe'));var toCsv=require(_0x0270('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0270('0x10'));var authService=require(_0x0270('0x11'));var qs=require(_0x0270('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0270('0x13'));var logger=require(_0x0270('0x14'))('api');var utils=require(_0x0270('0x15'));var config=require(_0x0270('0x16'));var licenseUtil=require(_0x0270('0x17'));var db=require(_0x0270('0x18'))['db'];config['redis']=_['defaults'](config[_0x0270('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0270('0x1a'))(new Redis(config[_0x0270('0x19')]));require('./voiceQueue.socket')[_0x0270('0x1b')](socket);function respondWithStatusCode(_0x47e28b,_0x60160a){_0x60160a=_0x60160a||0xcc;return function(_0x283790){if(_0x283790){return _0x47e28b[_0x0270('0x1c')](_0x60160a);}return _0x47e28b[_0x0270('0x1d')](_0x60160a)[_0x0270('0x1e')]();};}function respondWithResult(_0x502afd,_0x468db7){_0x468db7=_0x468db7||0xc8;return function(_0x1db467){if(_0x1db467){return _0x502afd['status'](_0x468db7)[_0x0270('0x1f')](_0x1db467);}};}function respondWithFilteredResult(_0x567430,_0xb7770c){return function(_0x13fda0){if(_0x13fda0){var _0x3aaa3f=typeof _0xb7770c['offset']==='undefined'&&typeof _0xb7770c['limit']===_0x0270('0x20');var _0x254ce5=_0x13fda0[_0x0270('0x21')];var _0x438690=_0x3aaa3f?0x0:_0xb7770c[_0x0270('0x22')];var _0x2fcc6a=_0x3aaa3f?_0x13fda0[_0x0270('0x21')]:_0xb7770c[_0x0270('0x22')]+_0xb7770c[_0x0270('0x23')];var _0x4c1ef4;if(_0x2fcc6a>=_0x254ce5){_0x2fcc6a=_0x254ce5;_0x4c1ef4=0xc8;}else{_0x4c1ef4=0xce;}_0x567430[_0x0270('0x1d')](_0x4c1ef4);return _0x567430[_0x0270('0x24')](_0x0270('0x25'),_0x438690+'-'+_0x2fcc6a+'/'+_0x254ce5)[_0x0270('0x1f')](_0x13fda0);}return null;};}function patchUpdates(_0x58143e){return function(_0x1956c0){try{jsonpatch['apply'](_0x1956c0,_0x58143e,!![]);}catch(_0x17d65b){return BPromise[_0x0270('0x26')](_0x17d65b);}return _0x1956c0[_0x0270('0x27')]();};}function saveUpdates(_0x43ceb2,_0x4d423a){return function(_0x303776){if(_0x303776){return _0x303776['update'](_0x43ceb2)[_0x0270('0x28')](function(_0xfc8cc0){return _0xfc8cc0;});}return null;};}function removeEntity(_0x1b251c,_0x5d114d){return function(_0x34f26a){if(_0x34f26a){return _0x34f26a['destroy']()['then'](function(){var _0x5721bc=_0x34f26a['get']({'plain':!![]});var _0x53c429=[{'name':_0x0270('0x29'),'value':_0x0270('0x2a'),'ignore':![]},{'name':_0x0270('0x2b'),'value':_0x0270('0x2c'),'ignore':![]}];var _0xc6138d=_(_0x53c429)[_0x0270('0x2d')](_0x0270('0x2e'))[_0x0270('0x2f')](_0x0270('0x30'))[_0x0270('0x30')]();if(_[_0x0270('0x31')](_0xc6138d,_0x5721bc[_0x0270('0x32')])){return;}var _0x10db76=_[_0x0270('0x33')](_0x53c429,['value',_0x5721bc[_0x0270('0x32')]])[_0x0270('0x34')];return db[_0x0270('0x35')][_0x0270('0x36')]({'where':{'type':_0x10db76,'resourceId':_0x5721bc['id']}})[_0x0270('0x28')](function(){return _0x34f26a;});})[_0x0270('0x28')](function(){_0x1b251c['status'](0xcc)[_0x0270('0x1e')]();});}};}function handleEntityNotFound(_0x2bc766,_0x469552){return function(_0x19e87d){if(!_0x19e87d){_0x2bc766[_0x0270('0x1c')](0x194);}return _0x19e87d;};}function handleError(_0x3a7cbd,_0x221c6f){_0x221c6f=_0x221c6f||0x1f4;return function(_0x25ee9f){logger[_0x0270('0x37')](_0x25ee9f['stack']);if(_0x25ee9f[_0x0270('0x34')]){delete _0x25ee9f['name'];}_0x3a7cbd[_0x0270('0x1d')](_0x221c6f)[_0x0270('0x38')](_0x25ee9f);};}exports['index']=function(_0x4a05a7,_0xd0a46a){var _0x1889c4={},_0x3684fd={},_0x5cd233={'count':0x0,'rows':[]};var _0x1613aa=_[_0x0270('0x2f')](db[_0x0270('0x39')]['rawAttributes'],function(_0x1727a8){return{'name':_0x1727a8[_0x0270('0x3a')],'type':_0x1727a8[_0x0270('0x32')][_0x0270('0x3b')]};});_0x3684fd[_0x0270('0x3c')]=_[_0x0270('0x2f')](_0x1613aa,'name');_0x3684fd[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x4a05a7[_0x0270('0x3d')]);_0x3684fd[_0x0270('0x3f')]=_[_0x0270('0x40')](_0x3684fd[_0x0270('0x3c')],_0x3684fd[_0x0270('0x3d')]);_0x1889c4['attributes']=_[_0x0270('0x40')](_0x3684fd[_0x0270('0x3c')],qs[_0x0270('0x41')](_0x4a05a7[_0x0270('0x3d')][_0x0270('0x41')]));_0x1889c4[_0x0270('0x42')]=_0x1889c4[_0x0270('0x42')]['length']?_0x1889c4[_0x0270('0x42')]:_0x3684fd['model'];if(!_0x4a05a7[_0x0270('0x3d')][_0x0270('0x43')](_0x0270('0x44'))){_0x1889c4['limit']=qs['limit'](_0x4a05a7['query'][_0x0270('0x23')]);_0x1889c4[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x4a05a7[_0x0270('0x3d')]['offset']);}_0x1889c4[_0x0270('0x45')]=qs[_0x0270('0x46')](_0x4a05a7[_0x0270('0x3d')][_0x0270('0x46')]);_0x1889c4['where']=qs[_0x0270('0x3f')](_['pick'](_0x4a05a7[_0x0270('0x3d')],_0x3684fd['filters']),_0x1613aa);if(_0x4a05a7[_0x0270('0x3d')][_0x0270('0x2d')]){_0x1889c4[_0x0270('0x47')]=_[_0x0270('0x48')](_0x1889c4['where'],{'$or':_[_0x0270('0x2f')](_0x1613aa,function(_0x27f7b2){if(_0x27f7b2[_0x0270('0x32')]!==_0x0270('0x49')){var _0x4e790c={};_0x4e790c[_0x27f7b2[_0x0270('0x34')]]={'$like':'%'+_0x4a05a7['query'][_0x0270('0x2d')]+'%'};return _0x4e790c;}})});}_0x1889c4=_[_0x0270('0x48')]({},_0x1889c4,_0x4a05a7[_0x0270('0x4a')]);var _0x1ad9fb={'where':_0x1889c4[_0x0270('0x47')]};return db[_0x0270('0x39')][_0x0270('0x21')](_0x1ad9fb)[_0x0270('0x28')](function(_0x6e6202){_0x5cd233['count']=_0x6e6202;if(_0x4a05a7['query'][_0x0270('0x4b')]){_0x1889c4[_0x0270('0x4c')]=[{'all':!![]}];}return db[_0x0270('0x39')][_0x0270('0x4d')](_0x1889c4);})[_0x0270('0x28')](function(_0xb99ea7){_0x5cd233[_0x0270('0x4e')]=_0xb99ea7;return _0x5cd233;})[_0x0270('0x28')](respondWithFilteredResult(_0xd0a46a,_0x1889c4))['catch'](handleError(_0xd0a46a,null));};exports['show']=function(_0x1c7a33,_0x2e788f){var _0x130d6f={'raw':![],'where':{'id':_0x1c7a33[_0x0270('0x4f')]['id']}},_0x573af9={};_0x573af9[_0x0270('0x3c')]=_['keys'](db['VoiceQueue'][_0x0270('0x50')]);_0x573af9[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x1c7a33['query']);_0x573af9[_0x0270('0x3f')]=_[_0x0270('0x40')](_0x573af9['model'],_0x573af9[_0x0270('0x3d')]);_0x130d6f['attributes']=_[_0x0270('0x40')](_0x573af9['model'],qs[_0x0270('0x41')](_0x1c7a33[_0x0270('0x3d')]['fields']));_0x130d6f['attributes']=_0x130d6f[_0x0270('0x42')]['length']?_0x130d6f['attributes']:_0x573af9['model'];if(_0x1c7a33[_0x0270('0x3d')][_0x0270('0x4b')]){_0x130d6f[_0x0270('0x4c')]=[{'all':!![]}];}_0x130d6f=_[_0x0270('0x48')]({},_0x130d6f,_0x1c7a33[_0x0270('0x4a')]);return db[_0x0270('0x39')][_0x0270('0x33')](_0x130d6f)[_0x0270('0x28')](handleEntityNotFound(_0x2e788f,null))[_0x0270('0x28')](respondWithResult(_0x2e788f,null))[_0x0270('0x51')](handleError(_0x2e788f,null));};exports[_0x0270('0x52')]=function(_0x119293,_0x10d2cf){return db['VoiceQueue'][_0x0270('0x52')](_0x119293[_0x0270('0x53')],{})['then'](function(_0x544f10){var _0x3e9c95=_0x119293[_0x0270('0x54')][_0x0270('0x55')]({'plain':!![]});if(!_0x3e9c95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e9c95[_0x0270('0x56')]===_0x0270('0x54')){var _0x1ff677=_0x544f10[_0x0270('0x55')]({'plain':!![]});var _0x4ce4a1=[{'name':_0x0270('0x29'),'value':_0x0270('0x2a')},{'name':_0x0270('0x2b'),'value':_0x0270('0x2c')}];var _0x3ce236=_[_0x0270('0x33')](_0x4ce4a1,[_0x0270('0x30'),_0x1ff677[_0x0270('0x32')]])[_0x0270('0x34')];return db[_0x0270('0x57')][_0x0270('0x33')]({'where':{'name':_0x3ce236,'userProfileId':_0x3e9c95[_0x0270('0x58')]},'raw':!![]})[_0x0270('0x28')](function(_0x32eda8){if(_0x32eda8&&_0x32eda8['autoAssociation']===0x0){return db[_0x0270('0x35')]['create']({'name':_0x1ff677[_0x0270('0x34')],'resourceId':_0x1ff677['id'],'type':_0x32eda8[_0x0270('0x34')],'sectionId':_0x32eda8['id']},{})[_0x0270('0x28')](function(){return _0x544f10;});}else{return _0x544f10;}})[_0x0270('0x51')](function(_0x318339){logger[_0x0270('0x37')](_0x0270('0x59'),_0x318339);throw _0x318339;});}return _0x544f10;})['then'](respondWithResult(_0x10d2cf,0xc9))[_0x0270('0x51')](handleError(_0x10d2cf,null));};exports[_0x0270('0x5a')]=function(_0x519e0,_0x49e450){var _0x4efc26={'where':{'id':_0x519e0['params']['id']}},_0x5212f2={};_0x5212f2[_0x0270('0x3c')]=_[_0x0270('0x3e')](db[_0x0270('0x39')]['rawAttributes']);_0x4efc26[_0x0270('0x42')]=_[_0x0270('0x40')](_0x5212f2[_0x0270('0x3c')],qs[_0x0270('0x41')](_0x519e0[_0x0270('0x3d')][_0x0270('0x41')]));_0x4efc26[_0x0270('0x42')]=_0x4efc26['attributes'][_0x0270('0x5b')]?_0x4efc26[_0x0270('0x42')]:_0x5212f2[_0x0270('0x3c')];if(_0x519e0[_0x0270('0x3d')][_0x0270('0x4b')]){_0x4efc26[_0x0270('0x4c')]=[{'all':!![]}];}_0x4efc26=_[_0x0270('0x48')]({},_0x4efc26,_0x519e0[_0x0270('0x4a')]);return db[_0x0270('0x39')][_0x0270('0x33')](_0x4efc26)[_0x0270('0x28')](handleEntityNotFound(_0x49e450,null))['then'](function(_0x1c81de){if(_0x1c81de){var _0x1e0ade=_0x1c81de[_0x0270('0x55')]({'plain':!![]});_0x1e0ade=qs[_0x0270('0x5c')](_0x1e0ade,['id',_0x0270('0x5d'),_0x0270('0x5e')]);_0x519e0[_0x0270('0x53')]=_['omit'](_0x519e0['body'],['id',_0x0270('0x5d'),'updatedAt']);return db['VoiceQueue'][_0x0270('0x52')](_[_0x0270('0x48')](_0x1e0ade,_0x519e0[_0x0270('0x53')]),{'include':_0x519e0[_0x0270('0x3d')][_0x0270('0x4b')]?[{'all':!![]}]:undefined})[_0x0270('0x28')](function(_0x4622ea){var _0x5dcd85=_0x519e0['user'][_0x0270('0x55')]({'plain':!![]});if(!_0x5dcd85)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5dcd85['role']===_0x0270('0x54')){var _0x3ac734=_0x4622ea[_0x0270('0x55')]({'plain':!![]});var _0xd9ff69=[{'name':'VoiceQueues','value':_0x0270('0x2a')},{'name':'QueueCampaigns','value':_0x0270('0x2c')}];var _0x28597d=_[_0x0270('0x33')](_0xd9ff69,[_0x0270('0x30'),_0x3ac734['type']])['name'];return db[_0x0270('0x57')][_0x0270('0x33')]({'where':{'name':_0x28597d,'userProfileId':_0x5dcd85[_0x0270('0x58')]},'raw':!![]})['then'](function(_0x4f77ca){if(_0x4f77ca&&_0x4f77ca[_0x0270('0x5f')]===0x0){return db[_0x0270('0x35')]['create']({'name':_0x3ac734[_0x0270('0x34')],'resourceId':_0x3ac734['id'],'type':_0x4f77ca[_0x0270('0x34')],'sectionId':_0x4f77ca['id']},{})[_0x0270('0x28')](function(){return _0x4622ea;});}else{return _0x4622ea;}})[_0x0270('0x51')](function(_0x349994){logger['error'](_0x0270('0x59'),_0x349994);throw _0x349994;});}return _0x4622ea;});}})[_0x0270('0x28')](respondWithResult(_0x49e450,0xc9))[_0x0270('0x51')](handleError(_0x49e450,null));};exports[_0x0270('0x60')]=function(_0x27c49d,_0x47dbdf){if(_0x27c49d['body']['id']){delete _0x27c49d[_0x0270('0x53')]['id'];}return db[_0x0270('0x39')][_0x0270('0x33')]({'where':{'id':_0x27c49d['params']['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x47dbdf,null))[_0x0270('0x28')](saveUpdates(_0x27c49d[_0x0270('0x53')],null))[_0x0270('0x28')](respondWithResult(_0x47dbdf,null))[_0x0270('0x51')](handleError(_0x47dbdf,null));};exports['destroy']=function(_0x394523,_0x17417d){return db[_0x0270('0x39')]['find']({'where':{'id':_0x394523[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x17417d,null))[_0x0270('0x28')](removeEntity(_0x17417d,null))[_0x0270('0x51')](handleError(_0x17417d,null));};exports[_0x0270('0x61')]=function(_0x244026,_0x41e160,_0x4f7255){var _0x4b5ec0={'raw':![],'where':{}};var _0x5b3efb={};var _0x2864db={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0270('0x62')]({'where':{'id':_0x244026[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x41e160,null))['then'](function(_0x48accd){if(_0x48accd){_0x5b3efb['model']=_[_0x0270('0x3e')](db['CmHopper'][_0x0270('0x50')]);_0x5b3efb[_0x0270('0x3d')]=_['keys'](_0x244026[_0x0270('0x3d')]);_0x5b3efb[_0x0270('0x3f')]=_[_0x0270('0x40')](_0x5b3efb['model'],_0x5b3efb[_0x0270('0x3d')]);_0x4b5ec0['attributes']=_[_0x0270('0x40')](_0x5b3efb['model'],qs[_0x0270('0x41')](_0x244026[_0x0270('0x3d')][_0x0270('0x41')]));_0x4b5ec0['attributes']=_0x4b5ec0['attributes'][_0x0270('0x5b')]?_0x4b5ec0['attributes']:_0x5b3efb[_0x0270('0x3c')];if(!_0x244026['query'][_0x0270('0x43')](_0x0270('0x44'))){_0x4b5ec0[_0x0270('0x23')]=qs[_0x0270('0x23')](_0x244026[_0x0270('0x3d')][_0x0270('0x23')]);_0x4b5ec0[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x244026['query'][_0x0270('0x22')]);}_0x4b5ec0[_0x0270('0x45')]=qs[_0x0270('0x46')](_0x244026['query']['sort']);_0x4b5ec0[_0x0270('0x47')]=qs[_0x0270('0x3f')](_[_0x0270('0x63')](_0x244026['query'],_0x5b3efb[_0x0270('0x3f')]));_0x4b5ec0['where']['VoiceQueueId']=_0x48accd['id'];if(_0x244026['query'][_0x0270('0x2d')]){_0x4b5ec0[_0x0270('0x47')]=_[_0x0270('0x48')](_0x4b5ec0[_0x0270('0x47')],{'$or':_[_0x0270('0x2f')](_0x4b5ec0[_0x0270('0x42')],function(_0x25e084){var _0x60545d={};_0x60545d[_0x25e084]={'$like':'%'+_0x244026[_0x0270('0x3d')][_0x0270('0x2d')]+'%'};return _0x60545d;})});}_0x4b5ec0=_[_0x0270('0x48')]({},_0x4b5ec0,_0x244026[_0x0270('0x4a')]);return db[_0x0270('0x64')][_0x0270('0x21')]({'where':_0x4b5ec0[_0x0270('0x47')]})['then'](function(_0x5933bb){_0x2864db[_0x0270('0x21')]=_0x5933bb;if(_0x244026[_0x0270('0x3d')]['includeAll']){_0x4b5ec0[_0x0270('0x4c')]=[{'all':!![]}];}return db['CmHopper'][_0x0270('0x4d')](_0x4b5ec0);})[_0x0270('0x28')](function(_0x1756cc){_0x2864db['rows']=_0x1756cc;return _0x2864db;});}})['then'](respondWithFilteredResult(_0x41e160,_0x4b5ec0))['catch'](handleError(_0x41e160,null));};exports['getHopperHistories']=function(_0x3bc900,_0x37faf1,_0x18928a){var _0x9d024a={'raw':!![],'where':{}};var _0x3e338c={};var _0x18fb26={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x0270('0x62')]({'where':{'id':_0x3bc900[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x37faf1,null))[_0x0270('0x28')](function(_0x1b980e){if(_0x1b980e){_0x3e338c['model']=_[_0x0270('0x3e')](db[_0x0270('0x65')][_0x0270('0x50')]);_0x3e338c['query']=_[_0x0270('0x3e')](_0x3bc900[_0x0270('0x3d')]);_0x3e338c[_0x0270('0x3f')]=_[_0x0270('0x40')](_0x3e338c['model'],_0x3e338c[_0x0270('0x3d')]);_0x9d024a[_0x0270('0x42')]=_[_0x0270('0x40')](_0x3e338c['model'],qs[_0x0270('0x41')](_0x3bc900['query']['fields']));_0x9d024a['attributes']=_0x9d024a['attributes'][_0x0270('0x5b')]?_0x9d024a['attributes']:_0x3e338c[_0x0270('0x3c')];if(!_0x3bc900['query'][_0x0270('0x43')](_0x0270('0x44'))){_0x9d024a[_0x0270('0x23')]=qs[_0x0270('0x23')](_0x3bc900[_0x0270('0x3d')]['limit']);_0x9d024a[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x3bc900['query'][_0x0270('0x22')]);}_0x9d024a[_0x0270('0x45')]=qs['sort'](_0x3bc900[_0x0270('0x3d')][_0x0270('0x46')]);_0x9d024a[_0x0270('0x47')]=qs[_0x0270('0x3f')](_[_0x0270('0x63')](_0x3bc900['query'],_0x3e338c[_0x0270('0x3f')]));_0x9d024a[_0x0270('0x47')]['VoiceQueueId']=_0x1b980e['id'];if(_0x3bc900[_0x0270('0x3d')][_0x0270('0x2d')]){_0x9d024a[_0x0270('0x47')]=_[_0x0270('0x48')](_0x9d024a[_0x0270('0x47')],{'$or':_[_0x0270('0x2f')](_0x9d024a[_0x0270('0x42')],function(_0x21b7e4){var _0x3c291c={};_0x3c291c[_0x21b7e4]={'$like':'%'+_0x3bc900[_0x0270('0x3d')][_0x0270('0x2d')]+'%'};return _0x3c291c;})});}_0x9d024a=_[_0x0270('0x48')]({},_0x9d024a,_0x3bc900['options']);return db[_0x0270('0x65')][_0x0270('0x21')]({'where':_0x9d024a['where']})[_0x0270('0x28')](function(_0x4237b3){_0x18fb26[_0x0270('0x21')]=_0x4237b3;if(_0x3bc900[_0x0270('0x3d')][_0x0270('0x4b')]){_0x9d024a['include']=[{'all':!![]}];}return db[_0x0270('0x65')][_0x0270('0x4d')](_0x9d024a);})['then'](function(_0x5b717d){_0x18fb26[_0x0270('0x4e')]=_0x5b717d;return _0x18fb26;});}})[_0x0270('0x28')](respondWithFilteredResult(_0x37faf1,_0x9d024a))['catch'](handleError(_0x37faf1,null));};exports[_0x0270('0x66')]=function(_0x458051,_0x5a3779,_0x4a2ace){var _0x39277e={'raw':!![],'where':{}};var _0x4df977={};var _0x2b0f85={'count':0x0,'rows':[]};return db[_0x0270('0x39')]['findOne']({'where':{'id':_0x458051[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x5a3779,null))[_0x0270('0x28')](function(_0x5547ec){if(_0x5547ec){_0x4df977[_0x0270('0x3c')]=_['keys'](db['CmHopperFinal'][_0x0270('0x50')]);_0x4df977[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x458051[_0x0270('0x3d')]);_0x4df977['filters']=_['intersection'](_0x4df977[_0x0270('0x3c')],_0x4df977['query']);_0x39277e[_0x0270('0x42')]=_[_0x0270('0x40')](_0x4df977[_0x0270('0x3c')],qs['fields'](_0x458051['query'][_0x0270('0x41')]));_0x39277e[_0x0270('0x42')]=_0x39277e[_0x0270('0x42')][_0x0270('0x5b')]?_0x39277e[_0x0270('0x42')]:_0x4df977[_0x0270('0x3c')];if(!_0x458051[_0x0270('0x3d')][_0x0270('0x43')](_0x0270('0x44'))){_0x39277e[_0x0270('0x23')]=qs['limit'](_0x458051[_0x0270('0x3d')][_0x0270('0x23')]);_0x39277e[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x458051[_0x0270('0x3d')][_0x0270('0x22')]);}_0x39277e[_0x0270('0x45')]=qs[_0x0270('0x46')](_0x458051['query'][_0x0270('0x46')]);_0x39277e[_0x0270('0x47')]=qs[_0x0270('0x3f')](_['pick'](_0x458051[_0x0270('0x3d')],_0x4df977[_0x0270('0x3f')]));_0x39277e['where'][_0x0270('0x67')]=_0x5547ec['id'];if(_0x458051['query']['filter']){_0x39277e[_0x0270('0x47')]=_[_0x0270('0x48')](_0x39277e[_0x0270('0x47')],{'$or':_[_0x0270('0x2f')](_0x39277e[_0x0270('0x42')],function(_0x392fa5){var _0x2c1379={};_0x2c1379[_0x392fa5]={'$like':'%'+_0x458051[_0x0270('0x3d')][_0x0270('0x2d')]+'%'};return _0x2c1379;})});}_0x39277e=_[_0x0270('0x48')]({},_0x39277e,_0x458051[_0x0270('0x4a')]);return db[_0x0270('0x68')]['count']({'where':_0x39277e[_0x0270('0x47')]})[_0x0270('0x28')](function(_0x518d46){_0x2b0f85[_0x0270('0x21')]=_0x518d46;if(_0x458051['query']['includeAll']){_0x39277e[_0x0270('0x4c')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0270('0x4d')](_0x39277e);})[_0x0270('0x28')](function(_0x5f2b5c){_0x2b0f85[_0x0270('0x4e')]=_0x5f2b5c;return _0x2b0f85;});}})['then'](respondWithFilteredResult(_0x5a3779,_0x39277e))[_0x0270('0x51')](handleError(_0x5a3779,null));};exports['getHopperBlacks']=function(_0x54738a,_0x38cf23,_0x11aed1){var _0x20cd86={'raw':!![],'where':{}};var _0x94cc90={};var _0x754994={'count':0x0,'rows':[]};return db[_0x0270('0x39')][_0x0270('0x62')]({'where':{'id':_0x54738a[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x38cf23,null))['then'](function(_0x239a15){if(_0x239a15){_0x94cc90[_0x0270('0x3c')]=_[_0x0270('0x3e')](db[_0x0270('0x69')][_0x0270('0x50')]);_0x94cc90[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x54738a[_0x0270('0x3d')]);_0x94cc90[_0x0270('0x3f')]=_[_0x0270('0x40')](_0x94cc90[_0x0270('0x3c')],_0x94cc90[_0x0270('0x3d')]);_0x20cd86['attributes']=_[_0x0270('0x40')](_0x94cc90[_0x0270('0x3c')],qs[_0x0270('0x41')](_0x54738a[_0x0270('0x3d')][_0x0270('0x41')]));_0x20cd86[_0x0270('0x42')]=_0x20cd86[_0x0270('0x42')][_0x0270('0x5b')]?_0x20cd86['attributes']:_0x94cc90[_0x0270('0x3c')];if(!_0x54738a[_0x0270('0x3d')]['hasOwnProperty'](_0x0270('0x44'))){_0x20cd86[_0x0270('0x23')]=qs['limit'](_0x54738a[_0x0270('0x3d')]['limit']);_0x20cd86['offset']=qs[_0x0270('0x22')](_0x54738a[_0x0270('0x3d')][_0x0270('0x22')]);}_0x20cd86[_0x0270('0x45')]=qs[_0x0270('0x46')](_0x54738a[_0x0270('0x3d')][_0x0270('0x46')]);_0x20cd86[_0x0270('0x47')]=qs[_0x0270('0x3f')](_[_0x0270('0x63')](_0x54738a['query'],_0x94cc90['filters']));_0x20cd86['where']['VoiceQueueId']=_0x239a15['id'];if(_0x54738a['query'][_0x0270('0x2d')]){_0x20cd86['where']=_[_0x0270('0x48')](_0x20cd86[_0x0270('0x47')],{'$or':_[_0x0270('0x2f')](_0x20cd86[_0x0270('0x42')],function(_0x388e63){var _0x2a072b={};_0x2a072b[_0x388e63]={'$like':'%'+_0x54738a[_0x0270('0x3d')]['filter']+'%'};return _0x2a072b;})});}_0x20cd86=_[_0x0270('0x48')]({},_0x20cd86,_0x54738a['options']);return db[_0x0270('0x69')][_0x0270('0x21')]({'where':_0x20cd86[_0x0270('0x47')]})['then'](function(_0x3e77c5){_0x754994[_0x0270('0x21')]=_0x3e77c5;if(_0x54738a[_0x0270('0x3d')][_0x0270('0x4b')]){_0x20cd86['include']=[{'all':!![]}];}return db[_0x0270('0x69')]['findAll'](_0x20cd86);})[_0x0270('0x28')](function(_0x423ef0){_0x754994['rows']=_0x423ef0;return _0x754994;});}})[_0x0270('0x28')](respondWithFilteredResult(_0x38cf23,_0x20cd86))['catch'](handleError(_0x38cf23,null));};exports[_0x0270('0x6a')]=function(_0x261846,_0xf5baca,_0x51567b){var _0x160c99={};var _0x37c47f={};var _0x2c9245;var _0x5c1629;return db[_0x0270('0x39')]['findOne']({'where':{'id':_0x261846['params']['id']}})['then'](handleEntityNotFound(_0xf5baca,null))[_0x0270('0x28')](function(_0x34f358){if(_0x34f358){_0x2c9245=_0x34f358;_0x37c47f[_0x0270('0x3c')]=_[_0x0270('0x3e')](db['Team']['rawAttributes']);_0x37c47f[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x261846[_0x0270('0x3d')]);_0x37c47f[_0x0270('0x3f')]=_[_0x0270('0x40')](_0x37c47f['model'],_0x37c47f[_0x0270('0x3d')]);_0x160c99[_0x0270('0x42')]=_['intersection'](_0x37c47f[_0x0270('0x3c')],qs[_0x0270('0x41')](_0x261846['query'][_0x0270('0x41')]));_0x160c99[_0x0270('0x42')]=_0x160c99[_0x0270('0x42')][_0x0270('0x5b')]?_0x160c99[_0x0270('0x42')]:_0x37c47f[_0x0270('0x3c')];_0x160c99[_0x0270('0x45')]=qs['sort'](_0x261846['query'][_0x0270('0x46')]);_0x160c99['where']=qs[_0x0270('0x3f')](_[_0x0270('0x63')](_0x261846[_0x0270('0x3d')],_0x37c47f[_0x0270('0x3f')]));if(_0x261846[_0x0270('0x3d')][_0x0270('0x2d')]){_0x160c99[_0x0270('0x47')]=_[_0x0270('0x48')](_0x160c99[_0x0270('0x47')],{'$or':_['map'](_0x160c99['attributes'],function(_0x10c116){var _0x4bb86f={};_0x4bb86f[_0x10c116]={'$like':'%'+_0x261846[_0x0270('0x3d')][_0x0270('0x2d')]+'%'};return _0x4bb86f;})});}_0x160c99=_[_0x0270('0x48')]({},_0x160c99,_0x261846[_0x0270('0x4a')]);return _0x2c9245[_0x0270('0x6a')](_0x160c99);}})[_0x0270('0x28')](function(_0x54b44f){if(_0x54b44f){_0x5c1629=_0x54b44f['length'];if(!_0x261846[_0x0270('0x3d')][_0x0270('0x43')]('nolimit')){_0x160c99[_0x0270('0x23')]=qs['limit'](_0x261846[_0x0270('0x3d')][_0x0270('0x23')]);_0x160c99[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x261846[_0x0270('0x3d')][_0x0270('0x22')]);}return _0x2c9245['getTeams'](_0x160c99);}})['then'](function(_0x38f6bd){if(_0x38f6bd){return _0x38f6bd?{'count':_0x5c1629,'rows':_0x38f6bd}:null;}})[_0x0270('0x28')](respondWithResult(_0xf5baca,null))[_0x0270('0x51')](handleError(_0xf5baca,null));};exports[_0x0270('0x6b')]=function(_0xe4bbaa,_0x50e65b,_0x20e2ca){var _0x5e7d8c=_0xe4bbaa['body'][_0x0270('0x6c')];var _0x129ff3=_['map'](_0x5e7d8c,'id');return db[_0x0270('0x6d')][_0x0270('0x4d')]({'where':{'id':_0x129ff3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0270('0x6e'),'attributes':['id',_0x0270('0x34'),_0x0270('0x6f'),_0x0270('0x70'),_0x0270('0x71')],'raw':!![]}]})[_0x0270('0x28')](function(_0x5ee87e){if(_0x5ee87e){var _0x55db14=_[_0x0270('0x72')](_0x5ee87e,function(_0x11ee48){var _0x58c756=_0x11ee48['get']({'plain':!![]});_0x58c756[_0x0270('0x6e')][_0x0270('0x73')](function(_0x5611b3){_0x5611b3[_0x0270('0x74')]=_[_0x0270('0x33')](_0x5e7d8c,{'id':_0x58c756['id']})['penalty'];});return _0x58c756['Agents'];});return db[_0x0270('0x39')][_0x0270('0x33')]({'where':{'id':_0xe4bbaa['params']['id']}})[_0x0270('0x28')](function(_0x33af48){return db['sequelize'][_0x0270('0x75')](function(_0x37081b){return _0x33af48[_0x0270('0x6b')](_0x129ff3,{'transaction':_0x37081b})[_0x0270('0x28')](function(){return BPromise[_0x0270('0x76')](_0x5e7d8c,function(_0x3fba7e){return db['TeamVoiceQueue'][_0x0270('0x77')]({'TeamId':_0x3fba7e['id'],'VoiceQueueId':_0xe4bbaa[_0x0270('0x4f')]['id'],'penalty':_0x3fba7e[_0x0270('0x74')]},{'transaction':_0x37081b});});})['then'](function(){return BPromise[_0x0270('0x76')](_0x55db14,function(_0x215448){return db[_0x0270('0x78')][_0x0270('0x79')]({'where':{'UserId':_0x215448['id'],'VoiceQueueId':_0xe4bbaa[_0x0270('0x4f')]['id']},'defaults':{'penalty':_0x215448[_0x0270('0x74')]},'transaction':_0x37081b});});})['then'](function(){return BPromise[_0x0270('0x76')](_[_0x0270('0x2d')](_0x55db14,{'online':!![]}),function(_0x559781){return db['UserVoiceQueueRt']['upsert']({'membername':_0x559781[_0x0270('0x34')],'UserId':_0x559781['id'],'queue_name':_0x33af48[_0x0270('0x34')],'VoiceQueueId':_0x33af48['id'],'interface':_['isNil'](_0x559781[_0x0270('0x71')])?util[_0x0270('0x7a')](_0x0270('0x7b'),_0x559781['name']):_0x559781['interface'],'paused':_0x559781['voicePause']||![],'penalty':_0x559781[_0x0270('0x74')]},{'transaction':_0x37081b});});})[_0x0270('0x28')](function(){_0x55db14[_0x0270('0x73')](function(_0x272493){socket[_0x0270('0x7c')](_0x0270('0x7d'),{'UserId':_0x272493['id'],'VoiceQueueId':_0x33af48['id']});});});});});}})['then'](respondWithStatusCode(_0x50e65b,null))[_0x0270('0x51')](handleError(_0x50e65b,null));};exports[_0x0270('0x7e')]=function(_0x5e2ddd,_0x79400c,_0xd190b7){return db[_0x0270('0x6d')][_0x0270('0x4d')]({'where':{'id':_0x5e2ddd[_0x0270('0x3d')][_0x0270('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0270('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x0270('0x28')](handleEntityNotFound(_0x79400c,null))['then'](function(_0x4bb68e){var _0xfd4a70=_[_0x0270('0x2f')](_0x4bb68e,'id');var _0x2820d3=[];var _0x206220=[];var _0x37bd28=squel[_0x0270('0x80')]();_0x37bd28[_0x0270('0x81')](_0x0270('0x82'))[_0x0270('0x83')](_0x0270('0x84'),'tq')[_0x0270('0x85')](_0x0270('0x86'),'ut',_0x0270('0x87'))[_0x0270('0x47')](_0x0270('0x88'),_0x5e2ddd[_0x0270('0x4f')]['id']);for(var _0x3ca8d0=0x0;_0x3ca8d0<_0x4bb68e[_0x0270('0x5b')];_0x3ca8d0+=0x1){let _0x5d5496=_0x4bb68e[_0x3ca8d0];for(var _0x2a16e2=0x0;_0x2a16e2<_0x5d5496[_0x0270('0x6e')][_0x0270('0x5b')];_0x2a16e2+=0x1){let _0x2268f8=_0x5d5496[_0x0270('0x6e')][_0x2a16e2];var _0x2d5c2e=_0x37bd28[_0x0270('0x5a')]();_0x2d5c2e['where'](_0x0270('0x89'),_0x2268f8['id']);_0x206220[_0x0270('0x8a')](db['sequelize'][_0x0270('0x3d')](_0x2d5c2e[_0x0270('0x8b')](),{'type':db['sequelize'][_0x0270('0x8c')]['SELECT']})[_0x0270('0x28')](function(_0x1c78fe){if(_0x1c78fe[_0x0270('0x5b')]===0x1){return _0x2268f8['id'];}else{var _0x338a6f=_[_0x0270('0x8d')](_[_0x0270('0x2f')](_0x1c78fe,'TeamId'),function(_0x1187ec){return _[_0x0270('0x31')](_0xfd4a70,_0x1187ec);});if(_0x338a6f){return _0x2268f8['id'];}}}));}}return BPromise[_0x0270('0x8e')](_0x206220)[_0x0270('0x28')](function(_0x28c05d){_0x2820d3=_(_0x2820d3)[_0x0270('0x8f')](_0x28c05d)[_0x0270('0x90')]()[_0x0270('0x30')]();return db[_0x0270('0x39')]['find']({'where':{'id':_0x5e2ddd[_0x0270('0x4f')]['id']}})['then'](function(_0x28e857){return db['sequelize'][_0x0270('0x75')](function(_0x40230b){return _0x28e857[_0x0270('0x7e')](_0x5e2ddd[_0x0270('0x3d')][_0x0270('0x7f')],{'transaction':_0x40230b})[_0x0270('0x28')](function(){if(!_[_0x0270('0x91')](_0x2820d3)){return _0x28e857[_0x0270('0x92')](_0x2820d3,{'transaction':_0x40230b})[_0x0270('0x28')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x5e2ddd[_0x0270('0x4f')]['id'],'UserId':_0x2820d3},'transaction':_0x40230b});});}})[_0x0270('0x28')](function(){_0x2820d3['forEach'](function(_0x57105f){socket[_0x0270('0x7c')]('userVoiceQueue:remove',{'UserId':_0x57105f,'VoiceQueueId':_0x28e857['id']});});});});});});})[_0x0270('0x28')](respondWithStatusCode(_0x79400c,null))[_0x0270('0x51')](handleError(_0x79400c,null));};exports['addAgents']=function(_0x29d467,_0x306dbb,_0x43a899){var _0x566977,_0x3f6ebe;return db['VoiceQueue'][_0x0270('0x33')]({'where':{'id':_0x29d467['params']['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x306dbb,null))[_0x0270('0x28')](function(_0x1d6b9d){if(_0x1d6b9d){_0x3f6ebe=_0x1d6b9d;return _0x1d6b9d[_0x0270('0x93')](_0x29d467[_0x0270('0x53')][_0x0270('0x7f')],_[_0x0270('0x5c')](_0x29d467[_0x0270('0x53')],[_0x0270('0x7f'),'id'])||{})[_0x0270('0x94')](function(_0x26ed79){for(var _0x3c5e11=0x0;_0x3c5e11<_0x29d467[_0x0270('0x53')][_0x0270('0x7f')]['length'];_0x3c5e11+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x29d467['body']['ids'][_0x3c5e11]),'VoiceQueueId':Number(_0x29d467[_0x0270('0x4f')]['id'])});}return _0x26ed79;});}})[_0x0270('0x28')](function(_0x239d52){_0x566977=_0x239d52||[];if(_0x3f6ebe){return db['User'][_0x0270('0x4d')]({'where':{'id':_0x29d467['body'][_0x0270('0x7f')]},'attributes':['id',_0x0270('0x34'),_0x0270('0x6f'),_0x0270('0x70'),_0x0270('0x71')],'raw':!![]});}})[_0x0270('0x28')](function(_0x2209d0){if(!_['isEmpty'](_0x2209d0)){var _0x4a98f4=[];for(var _0x1774b0=0x0;_0x1774b0<_0x2209d0[_0x0270('0x5b')];_0x1774b0++){if(_0x2209d0[_0x1774b0]['online']){_0x4a98f4['push'](db[_0x0270('0x95')][_0x0270('0x77')]({'membername':_0x2209d0[_0x1774b0]['name'],'UserId':_0x2209d0[_0x1774b0]['id'],'queue_name':_0x3f6ebe[_0x0270('0x34')],'VoiceQueueId':_0x3f6ebe['id'],'interface':_['isNil'](_0x2209d0[_0x1774b0][_0x0270('0x71')])?util[_0x0270('0x7a')](_0x0270('0x7b'),_0x2209d0[_0x1774b0][_0x0270('0x34')]):_0x2209d0[_0x1774b0][_0x0270('0x71')],'paused':_0x2209d0[_0x1774b0]['voicePause']||![],'penalty':_0x29d467[_0x0270('0x53')][_0x0270('0x74')]||0x0}));}}return BPromise['all'](_0x4a98f4);}})['then'](function(){return _0x566977;})[_0x0270('0x28')](respondWithResult(_0x306dbb,null))[_0x0270('0x51')](handleError(_0x306dbb,null));};exports['removeAgents']=function(_0x3a8b78,_0x251738,_0x3a832b){return db['VoiceQueue']['find']({'where':{'id':_0x3a8b78[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x251738,null))['then'](function(_0x4e0ec6){if(_0x4e0ec6){return _0x4e0ec6['removeAgents'](_0x3a8b78['query'][_0x0270('0x7f')])[_0x0270('0x28')](function(){if(_[_0x0270('0x96')](_0x3a8b78[_0x0270('0x3d')]['ids'])){for(var _0x24244f=0x0;_0x24244f<_0x3a8b78[_0x0270('0x3d')][_0x0270('0x7f')][_0x0270('0x5b')];_0x24244f+=0x1){socket[_0x0270('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x3a8b78[_0x0270('0x3d')][_0x0270('0x7f')][_0x24244f]),'VoiceQueueId':Number(_0x3a8b78[_0x0270('0x4f')]['id'])});}}else{socket[_0x0270('0x7c')](_0x0270('0x97'),{'UserId':Number(_0x3a8b78[_0x0270('0x3d')]['ids']),'VoiceQueueId':Number(_0x3a8b78[_0x0270('0x4f')]['id'])});}});}})[_0x0270('0x28')](function(_0x5a2798){return db[_0x0270('0x95')]['destroy']({'where':{'VoiceQueueId':_0x3a8b78[_0x0270('0x4f')]['id'],'UserId':_0x3a8b78[_0x0270('0x3d')]['ids']}})[_0x0270('0x28')](function(){return _0x5a2798;});})[_0x0270('0x28')](respondWithStatusCode(_0x251738,null))[_0x0270('0x51')](handleError(_0x251738,null));};exports[_0x0270('0x98')]=function(_0x381076,_0x5bbebf,_0x4ca658){var _0x1e8abb={};var _0x1ce59c={};var _0x5d9939;var _0x14f59f;return db['VoiceQueue'][_0x0270('0x62')]({'where':{'id':_0x381076['params']['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x5bbebf,null))['then'](function(_0x233a9c){if(_0x233a9c){_0x5d9939=_0x233a9c;_0x1ce59c['model']=_[_0x0270('0x3e')](db[_0x0270('0x99')]['rawAttributes']);_0x1ce59c[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x381076[_0x0270('0x3d')]);_0x1ce59c[_0x0270('0x3f')]=_['intersection'](_0x1ce59c[_0x0270('0x3c')],_0x1ce59c[_0x0270('0x3d')]);_0x1e8abb[_0x0270('0x42')]=_[_0x0270('0x40')](_0x1ce59c[_0x0270('0x3c')],qs[_0x0270('0x41')](_0x381076[_0x0270('0x3d')][_0x0270('0x41')]));_0x1e8abb[_0x0270('0x42')]=_0x1e8abb['attributes'][_0x0270('0x5b')]?_0x1e8abb[_0x0270('0x42')]:_0x1ce59c['model'];_0x1e8abb['order']=qs['sort'](_0x381076[_0x0270('0x3d')][_0x0270('0x46')]);_0x1e8abb[_0x0270('0x47')]=qs[_0x0270('0x3f')](_[_0x0270('0x63')](_0x381076[_0x0270('0x3d')],_0x1ce59c[_0x0270('0x3f')]));if(_0x381076[_0x0270('0x3d')][_0x0270('0x2d')]){_0x1e8abb[_0x0270('0x47')]=_[_0x0270('0x48')](_0x1e8abb['where'],{'$or':_['map'](_0x1e8abb[_0x0270('0x42')],function(_0x4b745f){var _0x39211f={};_0x39211f[_0x4b745f]={'$like':'%'+_0x381076[_0x0270('0x3d')][_0x0270('0x2d')]+'%'};return _0x39211f;})});}_0x1e8abb=_[_0x0270('0x48')]({},_0x1e8abb,_0x381076['options']);return _0x5d9939['getAgents'](_0x1e8abb);}})[_0x0270('0x28')](function(_0x52d0e3){if(_0x52d0e3){_0x14f59f=_0x52d0e3[_0x0270('0x5b')];if(!_0x381076['query'][_0x0270('0x43')](_0x0270('0x44'))){_0x1e8abb[_0x0270('0x23')]=qs[_0x0270('0x23')](_0x381076['query'][_0x0270('0x23')]);_0x1e8abb[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x381076[_0x0270('0x3d')][_0x0270('0x22')]);}return _0x5d9939[_0x0270('0x98')](_0x1e8abb);}})[_0x0270('0x28')](function(_0x3c83aa){if(_0x3c83aa){return _0x3c83aa?{'count':_0x14f59f,'rows':_0x3c83aa}:null;}})[_0x0270('0x28')](respondWithResult(_0x5bbebf,null))[_0x0270('0x51')](handleError(_0x5bbebf,null));};exports[_0x0270('0x9a')]=function(_0x267edf,_0x3d9dc0,_0x58cecb){var _0x495b10={};var _0x515670={};var _0x17557f;var _0x222af0;return db[_0x0270('0x39')][_0x0270('0x62')]({'where':{'id':_0x267edf[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x3d9dc0,null))[_0x0270('0x28')](function(_0x3f2aec){if(_0x3f2aec){_0x17557f=_0x3f2aec;_0x515670[_0x0270('0x3c')]=_[_0x0270('0x3e')](db[_0x0270('0x95')][_0x0270('0x50')]);_0x515670['query']=_[_0x0270('0x3e')](_0x267edf[_0x0270('0x3d')]);_0x515670['filters']=_[_0x0270('0x40')](_0x515670[_0x0270('0x3c')],_0x515670[_0x0270('0x3d')]);_0x495b10['attributes']=_[_0x0270('0x40')](_0x515670[_0x0270('0x3c')],qs[_0x0270('0x41')](_0x267edf[_0x0270('0x3d')][_0x0270('0x41')]));_0x495b10['attributes']=_0x495b10['attributes'][_0x0270('0x5b')]?_0x495b10[_0x0270('0x42')]:_0x515670['model'];_0x495b10[_0x0270('0x45')]=qs['sort'](_0x267edf[_0x0270('0x3d')][_0x0270('0x46')]);_0x495b10[_0x0270('0x47')]=qs[_0x0270('0x3f')](_[_0x0270('0x63')](_0x267edf[_0x0270('0x3d')],_0x515670[_0x0270('0x3f')]));if(_0x267edf[_0x0270('0x3d')][_0x0270('0x2d')]){_0x495b10[_0x0270('0x47')]=_[_0x0270('0x48')](_0x495b10[_0x0270('0x47')],{'$or':_[_0x0270('0x2f')](_0x495b10[_0x0270('0x42')],function(_0xc39208){var _0x4004cd={};_0x4004cd[_0xc39208]={'$like':'%'+_0x267edf['query'][_0x0270('0x2d')]+'%'};return _0x4004cd;})});}_0x495b10=_[_0x0270('0x48')]({},_0x495b10,_0x267edf[_0x0270('0x4a')]);return _0x17557f[_0x0270('0x9a')](_0x495b10);}})[_0x0270('0x28')](function(_0x39aec1){if(_0x39aec1){_0x222af0=_0x39aec1[_0x0270('0x5b')];if(!_0x267edf[_0x0270('0x3d')][_0x0270('0x43')](_0x0270('0x44'))){_0x495b10['limit']=qs[_0x0270('0x23')](_0x267edf[_0x0270('0x3d')][_0x0270('0x23')]);_0x495b10[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x267edf[_0x0270('0x3d')][_0x0270('0x22')]);}return _0x17557f[_0x0270('0x9a')](_0x495b10);}})[_0x0270('0x28')](function(_0x46e5d7){return _0x46e5d7?{'count':_0x222af0,'rows':_0x46e5d7}:null;})[_0x0270('0x28')](respondWithResult(_0x3d9dc0,null))['catch'](handleError(_0x3d9dc0,null));};exports['getLists']=function(_0x4769c1,_0xd5c3bd,_0x2c305f){var _0x40619f={};var _0x40c487={};var _0x452834;var _0x5ccb26;return db[_0x0270('0x39')][_0x0270('0x62')]({'where':{'id':_0x4769c1[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0xd5c3bd,null))[_0x0270('0x28')](function(_0x41c5e3){if(_0x41c5e3){_0x452834=_0x41c5e3;_0x40c487[_0x0270('0x3c')]=_['keys'](db[_0x0270('0x9b')][_0x0270('0x50')]);_0x40c487[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x4769c1[_0x0270('0x3d')]);_0x40c487[_0x0270('0x3f')]=_[_0x0270('0x40')](_0x40c487['model'],_0x40c487[_0x0270('0x3d')]);_0x40619f[_0x0270('0x42')]=_[_0x0270('0x40')](_0x40c487[_0x0270('0x3c')],qs[_0x0270('0x41')](_0x4769c1['query'][_0x0270('0x41')]));_0x40619f['attributes']=_0x40619f[_0x0270('0x42')][_0x0270('0x5b')]?_0x40619f[_0x0270('0x42')]:_0x40c487['model'];_0x40619f[_0x0270('0x45')]=qs[_0x0270('0x46')](_0x4769c1[_0x0270('0x3d')][_0x0270('0x46')]);_0x40619f[_0x0270('0x47')]=qs[_0x0270('0x3f')](_[_0x0270('0x63')](_0x4769c1[_0x0270('0x3d')],_0x40c487[_0x0270('0x3f')]));if(_0x4769c1['query'][_0x0270('0x2d')]){_0x40619f[_0x0270('0x47')]=_['merge'](_0x40619f['where'],{'$or':_[_0x0270('0x2f')](_0x40619f[_0x0270('0x42')],function(_0x443066){var _0x147a2e={};_0x147a2e[_0x443066]={'$like':'%'+_0x4769c1[_0x0270('0x3d')]['filter']+'%'};return _0x147a2e;})});}_0x40619f=_[_0x0270('0x48')]({},_0x40619f,_0x4769c1[_0x0270('0x4a')]);return _0x452834[_0x0270('0x9c')](_0x40619f);}})['then'](function(_0x43b222){if(_0x43b222){_0x5ccb26=_0x43b222['length'];if(!_0x4769c1['query']['hasOwnProperty'](_0x0270('0x44'))){_0x40619f['limit']=qs[_0x0270('0x23')](_0x4769c1[_0x0270('0x3d')][_0x0270('0x23')]);_0x40619f[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x4769c1[_0x0270('0x3d')]['offset']);}return _0x452834[_0x0270('0x9c')](_0x40619f);}})[_0x0270('0x28')](function(_0x5094ad){if(_0x5094ad){return _0x5094ad?{'count':_0x5ccb26,'rows':_0x5094ad}:null;}})[_0x0270('0x28')](respondWithResult(_0xd5c3bd,null))['catch'](handleError(_0xd5c3bd,null));};exports['addLists']=function(_0xfb30fe,_0x2a30a0,_0x69be7e){var _0xb6b18c,_0x2f905b;return db['VoiceQueue'][_0x0270('0x33')]({'where':{'id':_0xfb30fe[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x2a30a0,null))[_0x0270('0x28')](function(_0x421c2f){if(_0x421c2f){_0x2f905b=_0x421c2f;return _0x421c2f[_0x0270('0x9d')](_0xfb30fe[_0x0270('0x53')][_0x0270('0x7f')],_[_0x0270('0x5c')](_0xfb30fe[_0x0270('0x53')],['ids','id'])||{});}return null;})[_0x0270('0x94')](function(_0x5807eb){var _0x25bd13;_0xb6b18c=_0x5807eb||[];var _0x397273=[];if(_0x5807eb){for(var _0x1792d4=0x0;_0x1792d4<_0x5807eb[_0x0270('0x5b')];_0x1792d4+=0x1){var _0x36be5d=_0x5807eb[_0x1792d4][_0x0270('0x55')]({'plain':!![]});_0x2f905b[_0x0270('0x9e')]=_0xfb30fe['body'][_0x0270('0x9e')]?_0xfb30fe[_0x0270('0x53')][_0x0270('0x9e')]:_0x2f905b[_0x0270('0x9e')];switch(_0x2f905b['dialCheckDuplicateType']){case _0x0270('0x9f'):_0x25bd13=squel[_0x0270('0xa0')]()[_0x0270('0xa1')]('cm_hopper')[_0x0270('0xa2')]([_0x0270('0xa3'),'scheduledAt',_0x0270('0xa4'),_0x0270('0xa5'),_0x0270('0x67'),'createdAt',_0x0270('0x5e')],squel['select']()[_0x0270('0x81')](_0x0270('0xa3'),_0x0270('0xa3'))[_0x0270('0x81')](_0x0270('0xa6'),_0x0270('0xa7'))['field']('id','ContactId')[_0x0270('0x81')](_0x36be5d[_0x0270('0xa8')][_0x0270('0x8b')](),_0x0270('0xa5'))['field'](_0xfb30fe[_0x0270('0x4f')]['id']['toString'](),_0x0270('0x67'))[_0x0270('0x81')](_0x0270('0xa6'),'createdAt')[_0x0270('0x81')]('NOW()','updatedAt')[_0x0270('0x83')](_0x0270('0xa9'))[_0x0270('0x47')]('deletedAt\x20IS\x20NULL')[_0x0270('0x47')](_0x0270('0xaa'),_0x36be5d['CmListId']['toString']())[_0x0270('0x47')](_0x0270('0xab'))[_0x0270('0x47')](_0x0270('0xac'),squel[_0x0270('0x80')]()[_0x0270('0x81')](_0x0270('0xad'))[_0x0270('0x83')](_0x0270('0xae'))['where']('VoiceQueueId\x20=\x20?',_0xfb30fe[_0x0270('0x4f')]['id'][_0x0270('0x8b')]()))[_0x0270('0x47')](_0x0270('0xac'),squel[_0x0270('0x80')]()[_0x0270('0x81')]('COALESCE(phone,\x27\x27)')[_0x0270('0x83')](_0x0270('0xaf'))[_0x0270('0x47')](_0x0270('0x88'),_0xfb30fe['params']['id'][_0x0270('0x8b')]())))[_0x0270('0x8b')]();break;case _0x0270('0xb0'):_0x25bd13=squel[_0x0270('0xa0')]()[_0x0270('0xa1')]('cm_hopper')[_0x0270('0xa2')]([_0x0270('0xa3'),_0x0270('0xa7'),_0x0270('0xa4'),_0x0270('0xa5'),'VoiceQueueId',_0x0270('0x5d'),_0x0270('0x5e')],squel[_0x0270('0x80')]()[_0x0270('0x81')](_0x0270('0xa3'),_0x0270('0xa3'))[_0x0270('0x81')](_0x0270('0xa6'),'scheduledAt')[_0x0270('0x81')]('id',_0x0270('0xa4'))['field'](_0x36be5d['CmListId'][_0x0270('0x8b')](),_0x0270('0xa5'))[_0x0270('0x81')](_0xfb30fe[_0x0270('0x4f')]['id'][_0x0270('0x8b')](),_0x0270('0x67'))['field'](_0x0270('0xa6'),'createdAt')[_0x0270('0x81')](_0x0270('0xa6'),'updatedAt')[_0x0270('0x83')]('cm_contacts')[_0x0270('0x47')](_0x0270('0xb1'))[_0x0270('0x47')](_0x0270('0xaa'),_0x36be5d['CmListId'][_0x0270('0x8b')]())[_0x0270('0x47')](_0x0270('0xab'))[_0x0270('0x47')](_0x0270('0xac'),squel[_0x0270('0x80')]()[_0x0270('0x81')]('COALESCE(phone,\x27\x27)')[_0x0270('0x83')](_0x0270('0xaf'))[_0x0270('0x47')](_0x0270('0x88'),_0xfb30fe[_0x0270('0x4f')]['id'][_0x0270('0x8b')]())))['toString']();break;default:_0x25bd13=squel[_0x0270('0xa0')]()[_0x0270('0xa1')](_0x0270('0xaf'))[_0x0270('0xa2')]([_0x0270('0xa3'),_0x0270('0xa7'),_0x0270('0xa4'),_0x0270('0xa5'),_0x0270('0x67'),_0x0270('0x5d'),'updatedAt'],squel[_0x0270('0x80')]()[_0x0270('0x81')](_0x0270('0xa3'),_0x0270('0xa3'))[_0x0270('0x81')](_0x0270('0xa6'),'scheduledAt')[_0x0270('0x81')]('id',_0x0270('0xa4'))['field'](_0x36be5d[_0x0270('0xa8')]['toString'](),_0x0270('0xa5'))[_0x0270('0x81')](_0xfb30fe['params']['id'][_0x0270('0x8b')](),_0x0270('0x67'))[_0x0270('0x81')](_0x0270('0xa6'),_0x0270('0x5d'))[_0x0270('0x81')]('NOW()',_0x0270('0x5e'))[_0x0270('0x83')]('cm_contacts')[_0x0270('0x47')](_0x0270('0xb1'))[_0x0270('0x47')](_0x0270('0xaa'),_0x36be5d[_0x0270('0xa8')]['toString']())[_0x0270('0x47')](_0x0270('0xab')))[_0x0270('0x8b')]();}_0x397273[_0x0270('0x8a')](db['sequelize'][_0x0270('0x3d')](_0x25bd13));}return BPromise[_0x0270('0x8e')](_0x397273);}})[_0x0270('0x28')](function(){return _0xb6b18c;})[_0x0270('0x28')](respondWithResult(_0x2a30a0,null))['catch'](handleError(_0x2a30a0,null));};exports[_0x0270('0xb2')]=function(_0x836ca4,_0x210de4,_0x9154ee){return db[_0x0270('0x39')][_0x0270('0x33')]({'where':{'id':_0x836ca4[_0x0270('0x4f')]['id']}})['then'](handleEntityNotFound(_0x210de4,null))['then'](function(_0x811e3a){if(_0x811e3a){return _0x811e3a['removeLists'](_0x836ca4[_0x0270('0x3d')][_0x0270('0x7f')]);}})[_0x0270('0x28')](function(_0x47ec64){if(_0x47ec64){return db['CmHopper'][_0x0270('0x36')]({'where':{'ListId':_0x836ca4['query'][_0x0270('0x7f')],'VoiceQueueId':_0x836ca4[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](function(){return _0x47ec64;});}})[_0x0270('0x28')](respondWithStatusCode(_0x210de4,null))[_0x0270('0x51')](handleError(_0x210de4,null));};exports[_0x0270('0xb3')]=function(_0x6f4102,_0x1dc644,_0xab0766){var _0x55d1db={};var _0x439253={};var _0x247ce4;var _0x6283c9;return db[_0x0270('0x39')][_0x0270('0x62')]({'where':{'id':_0x6f4102[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x1dc644,null))['then'](function(_0x6a51b7){if(_0x6a51b7){_0x247ce4=_0x6a51b7;_0x439253[_0x0270('0x3c')]=_[_0x0270('0x3e')](db[_0x0270('0x9b')][_0x0270('0x50')]);_0x439253[_0x0270('0x3d')]=_[_0x0270('0x3e')](_0x6f4102['query']);_0x439253['filters']=_['intersection'](_0x439253[_0x0270('0x3c')],_0x439253[_0x0270('0x3d')]);_0x55d1db[_0x0270('0x42')]=_[_0x0270('0x40')](_0x439253['model'],qs[_0x0270('0x41')](_0x6f4102[_0x0270('0x3d')]['fields']));_0x55d1db['attributes']=_0x55d1db['attributes'][_0x0270('0x5b')]?_0x55d1db[_0x0270('0x42')]:_0x439253[_0x0270('0x3c')];_0x55d1db[_0x0270('0x45')]=qs[_0x0270('0x46')](_0x6f4102[_0x0270('0x3d')][_0x0270('0x46')]);_0x55d1db[_0x0270('0x47')]=qs['filters'](_['pick'](_0x6f4102[_0x0270('0x3d')],_0x439253[_0x0270('0x3f')]));if(_0x6f4102['query']['filter']){_0x55d1db[_0x0270('0x47')]=_[_0x0270('0x48')](_0x55d1db[_0x0270('0x47')],{'$or':_[_0x0270('0x2f')](_0x55d1db[_0x0270('0x42')],function(_0x4763cb){var _0x462483={};_0x462483[_0x4763cb]={'$like':'%'+_0x6f4102['query']['filter']+'%'};return _0x462483;})});}_0x55d1db=_[_0x0270('0x48')]({},_0x55d1db,_0x6f4102[_0x0270('0x4a')]);return _0x247ce4[_0x0270('0xb3')](_0x55d1db);}})[_0x0270('0x28')](function(_0x11eafc){if(_0x11eafc){_0x6283c9=_0x11eafc['length'];if(!_0x6f4102['query'][_0x0270('0x43')](_0x0270('0x44'))){_0x55d1db[_0x0270('0x23')]=qs[_0x0270('0x23')](_0x6f4102['query'][_0x0270('0x23')]);_0x55d1db[_0x0270('0x22')]=qs[_0x0270('0x22')](_0x6f4102[_0x0270('0x3d')]['offset']);}return _0x247ce4['getBlackLists'](_0x55d1db);}})[_0x0270('0x28')](function(_0x3be23a){if(_0x3be23a){return _0x3be23a?{'count':_0x6283c9,'rows':_0x3be23a}:null;}})[_0x0270('0x28')](respondWithResult(_0x1dc644,null))[_0x0270('0x51')](handleError(_0x1dc644,null));};exports[_0x0270('0xb4')]=function(_0x56487a,_0x8e070b,_0x3f5fc4){var _0x1be304,_0x3ca28f;return db[_0x0270('0x39')]['find']({'where':{'id':_0x56487a[_0x0270('0x4f')]['id']}})['then'](handleEntityNotFound(_0x8e070b,null))['then'](function(_0x51029e){if(_0x51029e){_0x3ca28f=_0x51029e;return _0x51029e[_0x0270('0xb4')](_0x56487a[_0x0270('0x53')]['ids'],_[_0x0270('0x5c')](_0x56487a['body'],[_0x0270('0x7f'),'id'])||{});}return null;})['spread'](function(_0x5b6de6){var _0x605171;_0x1be304=_0x5b6de6||[];var _0x2d713e=[];if(_0x5b6de6){for(var _0x56d137=0x0;_0x56d137<_0x5b6de6[_0x0270('0x5b')];_0x56d137+=0x1){var _0x48f318=_0x5b6de6[_0x56d137][_0x0270('0x55')]({'plain':!![]});_0x605171=squel[_0x0270('0xa0')]()[_0x0270('0xa1')](_0x0270('0xb5'))[_0x0270('0xa2')]([_0x0270('0xa3'),_0x0270('0xa4'),_0x0270('0xa5'),_0x0270('0x67'),_0x0270('0x5d'),_0x0270('0x5e')],squel[_0x0270('0x80')]()[_0x0270('0x81')](_0x0270('0xa3'),_0x0270('0xa3'))[_0x0270('0x81')]('id',_0x0270('0xa4'))[_0x0270('0x81')](_0x48f318[_0x0270('0xa8')]['toString'](),_0x0270('0xa5'))[_0x0270('0x81')](_0x56487a[_0x0270('0x4f')]['id'][_0x0270('0x8b')](),_0x0270('0x67'))[_0x0270('0x81')](_0x0270('0xa6'),_0x0270('0x5d'))['field'](_0x0270('0xa6'),_0x0270('0x5e'))[_0x0270('0x83')](_0x0270('0xa9'))[_0x0270('0x47')](_0x0270('0xb1'))[_0x0270('0x47')](_0x0270('0xaa'),_0x48f318[_0x0270('0xa8')][_0x0270('0x8b')]())[_0x0270('0x47')](_0x0270('0xab')))[_0x0270('0x8b')]();_0x2d713e[_0x0270('0x8a')](db[_0x0270('0xb6')][_0x0270('0x3d')](_0x605171));}return BPromise[_0x0270('0x8e')](_0x2d713e);}})[_0x0270('0x28')](function(){return _0x1be304;})[_0x0270('0x28')](respondWithResult(_0x8e070b,null))['catch'](handleError(_0x8e070b,null));};exports[_0x0270('0xb7')]=function(_0xea3a3c,_0x416d78,_0x4c8212){return db[_0x0270('0x39')][_0x0270('0x33')]({'where':{'id':_0xea3a3c[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](handleEntityNotFound(_0x416d78,null))[_0x0270('0x28')](function(_0x37b27b){if(_0x37b27b){return _0x37b27b[_0x0270('0xb7')](_0xea3a3c['query']['ids']);}})[_0x0270('0x28')](function(_0x59a9f7){if(_0x59a9f7){return db[_0x0270('0x69')][_0x0270('0x36')]({'where':{'ListId':_0xea3a3c[_0x0270('0x3d')][_0x0270('0x7f')],'VoiceQueueId':_0xea3a3c[_0x0270('0x4f')]['id']}})[_0x0270('0x28')](function(){return _0x59a9f7;});}})['then'](respondWithStatusCode(_0x416d78,null))[_0x0270('0x51')](handleError(_0x416d78,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 17b1b50..50c8cdf 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 _0x2b80=['emit','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove'];(function(_0x2a9bb2,_0xccdbcb){var _0x58c695=function(_0x3ef90a){while(--_0x3ef90a){_0x2a9bb2['push'](_0x2a9bb2['shift']());}};_0x58c695(++_0xccdbcb);}(_0x2b80,0x189));var _0x02b8=function(_0x13d430,_0xfe5f60){_0x13d430=_0x13d430-0x0;var _0x40d925=_0x2b80[_0x13d430];return _0x40d925;};'use strict';var EventEmitter=require(_0x02b8('0x0'));var VoiceQueue=require(_0x02b8('0x1'))['db'][_0x02b8('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x02b8('0x3')](0x0);var events={'afterCreate':_0x02b8('0x4'),'afterUpdate':_0x02b8('0x5'),'afterDestroy':_0x02b8('0x6')};function emitEvent(_0x13379d){return function(_0x38c86b,_0x3ef132,_0x52d96a){VoiceQueueEvents[_0x02b8('0x7')](_0x13379d+':'+_0x38c86b['id'],_0x38c86b);VoiceQueueEvents[_0x02b8('0x7')](_0x13379d,_0x38c86b);_0x52d96a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x02b8('0x8')](e,emitEvent(event));}}module[_0x02b8('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0xc64c=['remove','emit','hasOwnProperty','events','VoiceQueue','setMaxListeners','update'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xc64c,0xce));var _0xcc64=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0xc64c[_0x5e8eae];return _0xdd09cd;};'use strict';var EventEmitter=require(_0xcc64('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xcc64('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xcc64('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcc64('0x3'),'afterDestroy':_0xcc64('0x4')};function emitEvent(_0x1b98bd){return function(_0x47e05b,_0x3a1048,_0x3b561f){VoiceQueueEvents[_0xcc64('0x5')](_0x1b98bd+':'+_0x47e05b['id'],_0x47e05b);VoiceQueueEvents[_0xcc64('0x5')](_0x1b98bd,_0x47e05b);_0x3b561f(null);};}for(var e in events){if(events[_0xcc64('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5fc9616..dbb163b 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x2ced4f,_0x54891c){var _0x5acd2a=function(_0x3ff619){while(--_0x3ff619){_0x2ced4f['push'](_0x2ced4f['shift']());}};_0x5acd2a(++_0x54891c);}(_0x70e0,0x17b));var _0x070e=function(_0x3887a4,_0x1bd75f){_0x3887a4=_0x3887a4-0x0;var _0x5ce180=_0x70e0[_0x3887a4];return _0x5ce180;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x50034a,_0x641c23){var _0x470e79=function(_0xd9c520){while(--_0xd9c520){_0x50034a['push'](_0x50034a['shift']());}};_0x470e79(++_0x641c23);}(_0xedd9,0xfc));var _0x9edd=function(_0x5cf133,_0x1bca31){_0x5cf133=_0x5cf133-0x0;var _0x5c7698=_0xedd9[_0x5cf133];return _0x5c7698;};'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':'voice_queues','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 5f655a5..c67e92a 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 _0x0bd7=['request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceQueue','findAll','options','where','attributes','limit','include','map','model','info','GetVoiceQueue','find','ShowVoiceQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./voiceQueue.socket'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0x0bd7,0x69));var _0x70bd=function(_0x308dcc,_0x2d1178){_0x308dcc=_0x308dcc-0x0;var _0x361717=_0x0bd7[_0x308dcc];return _0x361717;};'use strict';var _=require(_0x70bd('0x0'));var util=require(_0x70bd('0x1'));var moment=require(_0x70bd('0x2'));var BPromise=require('bluebird');var rs=require(_0x70bd('0x3'));var fs=require('fs');var Redis=require(_0x70bd('0x4'));var db=require(_0x70bd('0x5'))['db'];var utils=require(_0x70bd('0x6'));var logger=require(_0x70bd('0x7'))(_0x70bd('0x8'));var config=require('../../config/environment');var jayson=require(_0x70bd('0x9'));var client=jayson[_0x70bd('0xa')][_0x70bd('0xb')]({'port':0x232a});config[_0x70bd('0xc')]=_['defaults'](config['redis'],{'host':_0x70bd('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x70bd('0xe'))['register'](socket);function respondWithRpcPromise(_0x221d10,_0x4d667c,_0x1ca8da){return new BPromise(function(_0x2e6ec3,_0x4f1e6f){return client[_0x70bd('0xf')](_0x221d10,_0x1ca8da)[_0x70bd('0x10')](function(_0x135370){logger['info'](_0x70bd('0x11'),_0x4d667c,_0x70bd('0x12'));logger[_0x70bd('0x13')](_0x70bd('0x14'),_0x4d667c,_0x70bd('0x12'),JSON[_0x70bd('0x15')](_0x135370));if(_0x135370[_0x70bd('0x16')]){if(_0x135370['error'][_0x70bd('0x17')]===0x1f4){logger[_0x70bd('0x16')](_0x70bd('0x11'),_0x4d667c,_0x135370['error'][_0x70bd('0x18')]);return _0x4f1e6f(_0x135370[_0x70bd('0x16')]['message']);}logger[_0x70bd('0x16')](_0x70bd('0x11'),_0x4d667c,_0x135370[_0x70bd('0x16')][_0x70bd('0x18')]);return _0x2e6ec3(_0x135370[_0x70bd('0x16')][_0x70bd('0x18')]);}else{logger['info'](_0x70bd('0x11'),_0x4d667c,_0x70bd('0x12'));_0x2e6ec3(_0x135370[_0x70bd('0x19')][_0x70bd('0x18')]);}})[_0x70bd('0x1a')](function(_0x5243a3){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x4d667c,_0x5243a3);_0x4f1e6f(_0x5243a3);});});}exports['GetVoiceQueue']=function(_0x2f2766){var _0x533817=this;return new Promise(function(_0x4fe0d6,_0x1e1746){return db[_0x70bd('0x1b')][_0x70bd('0x1c')]({'raw':_0x2f2766[_0x70bd('0x1d')]?_0x2f2766[_0x70bd('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2f2766[_0x70bd('0x1d')]?_0x2f2766[_0x70bd('0x1d')][_0x70bd('0x1e')]||null:null,'attributes':_0x2f2766['options']?_0x2f2766[_0x70bd('0x1d')][_0x70bd('0x1f')]||null:null,'limit':_0x2f2766[_0x70bd('0x1d')]?_0x2f2766[_0x70bd('0x1d')][_0x70bd('0x20')]||null:null,'include':_0x2f2766[_0x70bd('0x1d')]?_0x2f2766[_0x70bd('0x1d')][_0x70bd('0x21')]?_[_0x70bd('0x22')](_0x2f2766[_0x70bd('0x1d')]['include'],function(_0x2e41fd){return{'model':db[_0x2e41fd['model']],'as':_0x2e41fd['as'],'attributes':_0x2e41fd[_0x70bd('0x1f')],'include':_0x2e41fd['include']?_['map'](_0x2e41fd[_0x70bd('0x21')],function(_0x58809a){return{'model':db[_0x58809a['model']],'as':_0x58809a['as'],'attributes':_0x58809a[_0x70bd('0x1f')],'include':_0x58809a[_0x70bd('0x21')]?_[_0x70bd('0x22')](_0x58809a[_0x70bd('0x21')],function(_0x240256){return{'model':db[_0x240256[_0x70bd('0x23')]],'as':_0x240256['as'],'attributes':_0x240256[_0x70bd('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3aab29){logger[_0x70bd('0x24')](_0x70bd('0x25'),_0x2f2766);logger[_0x70bd('0x13')]('GetVoiceQueue',_0x2f2766,JSON['stringify'](_0x3aab29));_0x4fe0d6(_0x3aab29);})[_0x70bd('0x1a')](function(_0x104675){logger[_0x70bd('0x16')](_0x70bd('0x25'),_0x104675[_0x70bd('0x18')],_0x2f2766);_0x1e1746(_0x533817[_0x70bd('0x16')](0x1f4,_0x104675[_0x70bd('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x165e62){var _0x140136=this;return new Promise(function(_0xdf3aa7,_0xd037bf){return db[_0x70bd('0x1b')][_0x70bd('0x26')]({'raw':_0x165e62[_0x70bd('0x1d')]?_0x165e62['options']['raw']===undefined?!![]:![]:!![],'where':_0x165e62[_0x70bd('0x1d')]?_0x165e62[_0x70bd('0x1d')][_0x70bd('0x1e')]||null:null,'attributes':_0x165e62[_0x70bd('0x1d')]?_0x165e62['options'][_0x70bd('0x1f')]||null:null,'include':_0x165e62[_0x70bd('0x1d')]?_0x165e62[_0x70bd('0x1d')][_0x70bd('0x21')]?_[_0x70bd('0x22')](_0x165e62[_0x70bd('0x1d')][_0x70bd('0x21')],function(_0x1ff426){return{'model':db[_0x1ff426['model']],'as':_0x1ff426['as'],'attributes':_0x1ff426[_0x70bd('0x1f')],'include':_0x1ff426[_0x70bd('0x21')]?_['map'](_0x1ff426[_0x70bd('0x21')],function(_0x5a5bb5){return{'model':db[_0x5a5bb5[_0x70bd('0x23')]],'as':_0x5a5bb5['as'],'attributes':_0x5a5bb5[_0x70bd('0x1f')],'include':_0x5a5bb5[_0x70bd('0x21')]?_[_0x70bd('0x22')](_0x5a5bb5['include'],function(_0x7227d1){return{'model':db[_0x7227d1['model']],'as':_0x7227d1['as'],'attributes':_0x7227d1[_0x70bd('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x70bd('0x10')](function(_0x1c3285){logger[_0x70bd('0x24')]('ShowVoiceQueue',_0x165e62);logger[_0x70bd('0x13')](_0x70bd('0x27'),_0x165e62,JSON['stringify'](_0x1c3285));_0xdf3aa7(_0x1c3285);})[_0x70bd('0x1a')](function(_0x22b836){logger[_0x70bd('0x16')](_0x70bd('0x27'),_0x22b836[_0x70bd('0x18')],_0x165e62);_0xd037bf(_0x140136[_0x70bd('0x16')](0x1f4,_0x22b836[_0x70bd('0x18')]));});});}; \ No newline at end of file +var _0xd66c=['client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','debug','ShowVoiceQueue','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise'];(function(_0x371057,_0x328aa9){var _0x37f3b2=function(_0x3c9892){while(--_0x3c9892){_0x371057['push'](_0x371057['shift']());}};_0x37f3b2(++_0x328aa9);}(_0xd66c,0x188));var _0xcd66=function(_0x4fe8fc,_0x29d8d4){_0x4fe8fc=_0x4fe8fc-0x0;var _0x3946cd=_0xd66c[_0x4fe8fc];return _0x3946cd;};'use strict';var _=require(_0xcd66('0x0'));var util=require(_0xcd66('0x1'));var moment=require(_0xcd66('0x2'));var BPromise=require(_0xcd66('0x3'));var rs=require(_0xcd66('0x4'));var fs=require('fs');var Redis=require(_0xcd66('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcd66('0x6'));var config=require('../../config/environment');var jayson=require(_0xcd66('0x7'));var client=jayson[_0xcd66('0x8')][_0xcd66('0x9')]({'port':0x232a});config[_0xcd66('0xa')]=_[_0xcd66('0xb')](config[_0xcd66('0xa')],{'host':_0xcd66('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcd66('0xd'))[_0xcd66('0xe')](socket);function respondWithRpcPromise(_0x157cff,_0x73937c,_0x380951){return new BPromise(function(_0x4ab11f,_0x1cae43){return client[_0xcd66('0xf')](_0x157cff,_0x380951)['then'](function(_0x37e0e9){logger[_0xcd66('0x10')](_0xcd66('0x11'),_0x73937c,_0xcd66('0x12'));logger['debug'](_0xcd66('0x13'),_0x73937c,'request\x20sent',JSON['stringify'](_0x37e0e9));if(_0x37e0e9[_0xcd66('0x14')]){if(_0x37e0e9['error'][_0xcd66('0x15')]===0x1f4){logger[_0xcd66('0x14')](_0xcd66('0x11'),_0x73937c,_0x37e0e9['error'][_0xcd66('0x16')]);return _0x1cae43(_0x37e0e9[_0xcd66('0x14')][_0xcd66('0x16')]);}logger[_0xcd66('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x73937c,_0x37e0e9[_0xcd66('0x14')][_0xcd66('0x16')]);return _0x4ab11f(_0x37e0e9[_0xcd66('0x14')][_0xcd66('0x16')]);}else{logger[_0xcd66('0x10')](_0xcd66('0x11'),_0x73937c,'request\x20sent');_0x4ab11f(_0x37e0e9[_0xcd66('0x17')][_0xcd66('0x16')]);}})[_0xcd66('0x18')](function(_0x59c7be){logger['error'](_0xcd66('0x11'),_0x73937c,_0x59c7be);_0x1cae43(_0x59c7be);});});}exports[_0xcd66('0x19')]=function(_0x17dfd7){var _0x2611b8=this;return new Promise(function(_0x1d11ae,_0x38cfcc){return db[_0xcd66('0x1a')][_0xcd66('0x1b')]({'raw':_0x17dfd7['options']?_0x17dfd7[_0xcd66('0x1c')][_0xcd66('0x1d')]===undefined?!![]:![]:!![],'where':_0x17dfd7[_0xcd66('0x1c')]?_0x17dfd7[_0xcd66('0x1c')][_0xcd66('0x1e')]||null:null,'attributes':_0x17dfd7[_0xcd66('0x1c')]?_0x17dfd7[_0xcd66('0x1c')][_0xcd66('0x1f')]||null:null,'limit':_0x17dfd7[_0xcd66('0x1c')]?_0x17dfd7[_0xcd66('0x1c')][_0xcd66('0x20')]||null:null,'include':_0x17dfd7['options']?_0x17dfd7[_0xcd66('0x1c')][_0xcd66('0x21')]?_['map'](_0x17dfd7[_0xcd66('0x1c')]['include'],function(_0x925c59){return{'model':db[_0x925c59[_0xcd66('0x22')]],'as':_0x925c59['as'],'attributes':_0x925c59[_0xcd66('0x1f')],'include':_0x925c59[_0xcd66('0x21')]?_[_0xcd66('0x23')](_0x925c59[_0xcd66('0x21')],function(_0x27953a){return{'model':db[_0x27953a[_0xcd66('0x22')]],'as':_0x27953a['as'],'attributes':_0x27953a[_0xcd66('0x1f')],'include':_0x27953a[_0xcd66('0x21')]?_[_0xcd66('0x23')](_0x27953a[_0xcd66('0x21')],function(_0x1601a0){return{'model':db[_0x1601a0[_0xcd66('0x22')]],'as':_0x1601a0['as'],'attributes':_0x1601a0[_0xcd66('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcd66('0x24')](function(_0x2d3789){logger[_0xcd66('0x10')](_0xcd66('0x19'),_0x17dfd7);logger[_0xcd66('0x25')](_0xcd66('0x19'),_0x17dfd7,JSON['stringify'](_0x2d3789));_0x1d11ae(_0x2d3789);})['catch'](function(_0x50d6d6){logger[_0xcd66('0x14')](_0xcd66('0x19'),_0x50d6d6[_0xcd66('0x16')],_0x17dfd7);_0x38cfcc(_0x2611b8['error'](0x1f4,_0x50d6d6[_0xcd66('0x16')]));});});};exports[_0xcd66('0x26')]=function(_0x2d6231){var _0x571c18=this;return new Promise(function(_0x484d0e,_0xb6d487){return db[_0xcd66('0x1a')]['find']({'raw':_0x2d6231[_0xcd66('0x1c')]?_0x2d6231[_0xcd66('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2d6231[_0xcd66('0x1c')]?_0x2d6231[_0xcd66('0x1c')][_0xcd66('0x1e')]||null:null,'attributes':_0x2d6231['options']?_0x2d6231['options'][_0xcd66('0x1f')]||null:null,'include':_0x2d6231[_0xcd66('0x1c')]?_0x2d6231[_0xcd66('0x1c')][_0xcd66('0x21')]?_['map'](_0x2d6231[_0xcd66('0x1c')][_0xcd66('0x21')],function(_0x4e55ce){return{'model':db[_0x4e55ce[_0xcd66('0x22')]],'as':_0x4e55ce['as'],'attributes':_0x4e55ce[_0xcd66('0x1f')],'include':_0x4e55ce[_0xcd66('0x21')]?_[_0xcd66('0x23')](_0x4e55ce['include'],function(_0x5d040a){return{'model':db[_0x5d040a[_0xcd66('0x22')]],'as':_0x5d040a['as'],'attributes':_0x5d040a[_0xcd66('0x1f')],'include':_0x5d040a['include']?_[_0xcd66('0x23')](_0x5d040a['include'],function(_0x475311){return{'model':db[_0x475311['model']],'as':_0x475311['as'],'attributes':_0x475311[_0xcd66('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xcd66('0x24')](function(_0x3e7605){logger[_0xcd66('0x10')]('ShowVoiceQueue',_0x2d6231);logger[_0xcd66('0x25')]('ShowVoiceQueue',_0x2d6231,JSON[_0xcd66('0x27')](_0x3e7605));_0x484d0e(_0x3e7605);})[_0xcd66('0x18')](function(_0x34a86f){logger[_0xcd66('0x14')](_0xcd66('0x26'),_0x34a86f[_0xcd66('0x16')],_0x2d6231);_0xb6d487(_0x571c18[_0xcd66('0x14')](0x1f4,_0x34a86f[_0xcd66('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 67f52b7..2d3d881 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 _0xe456=['update','emit','register','length','voiceQueue:','./voiceQueue.events','remove'];(function(_0x28928e,_0x4b4ccf){var _0x5f3411=function(_0x2ca8cb){while(--_0x2ca8cb){_0x28928e['push'](_0x28928e['shift']());}};_0x5f3411(++_0x4b4ccf);}(_0xe456,0x8a));var _0x6e45=function(_0x118b0c,_0x1b8451){_0x118b0c=_0x118b0c-0x0;var _0x3a7e6a=_0xe456[_0x118b0c];return _0x3a7e6a;};'use strict';var VoiceQueueEvents=require(_0x6e45('0x0'));var events=['save',_0x6e45('0x1'),_0x6e45('0x2')];function createListener(_0x5ce401,_0x440411){return function(_0x1ff6f8){_0x440411[_0x6e45('0x3')](_0x5ce401,_0x1ff6f8);};}function removeListener(_0x1ddf30,_0x4ab527){return function(){VoiceQueueEvents['removeListener'](_0x1ddf30,_0x4ab527);};}exports[_0x6e45('0x4')]=function(_0xedf4da){for(var _0x253ff9=0x0,_0x3a8936=events[_0x6e45('0x5')];_0x253ff9<_0x3a8936;_0x253ff9++){var _0x4a06bc=events[_0x253ff9];var _0x1e1fb4=createListener(_0x6e45('0x6')+_0x4a06bc,_0xedf4da);VoiceQueueEvents['on'](_0x4a06bc,_0x1e1fb4);}}; \ No newline at end of file +var _0x7cc9=['update','emit','removeListener','register','length','voiceQueue:','save','remove'];(function(_0x552a9b,_0x4f42c9){var _0x46f310=function(_0x22e434){while(--_0x22e434){_0x552a9b['push'](_0x552a9b['shift']());}};_0x46f310(++_0x4f42c9);}(_0x7cc9,0x156));var _0x97cc=function(_0x54d2bd,_0x57c539){_0x54d2bd=_0x54d2bd-0x0;var _0x34f0d4=_0x7cc9[_0x54d2bd];return _0x34f0d4;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x97cc('0x0'),_0x97cc('0x1'),_0x97cc('0x2')];function createListener(_0x1516ae,_0xae1ea8){return function(_0x34e38b){_0xae1ea8[_0x97cc('0x3')](_0x1516ae,_0x34e38b);};}function removeListener(_0x37e033,_0x56756a){return function(){VoiceQueueEvents[_0x97cc('0x4')](_0x37e033,_0x56756a);};}exports[_0x97cc('0x5')]=function(_0x18485c){for(var _0x1fa837=0x0,_0x304abc=events[_0x97cc('0x6')];_0x1fa837<_0x304abc;_0x1fa837++){var _0x4d0d46=events[_0x1fa837];var _0x1aad9d=createListener(_0x97cc('0x7')+_0x4d0d46,_0x18485c);VoiceQueueEvents['on'](_0x4d0d46,_0x1aad9d);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index be3bedd..ad98afb 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 _0x3436=['/describe','isAuthenticated','/index','getVoiceQueuesReport','show','post','create','/:id','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','index'];(function(_0x102b0c,_0x33dee4){var _0x9b15ca=function(_0x42d504){while(--_0x42d504){_0x102b0c['push'](_0x102b0c['shift']());}};_0x9b15ca(++_0x33dee4);}(_0x3436,0x9e));var _0x6343=function(_0x33dd59,_0x5c547f){_0x33dd59=_0x33dd59-0x0;var _0x31c27e=_0x3436[_0x33dd59];return _0x31c27e;};'use strict';var multer=require(_0x6343('0x0'));var util=require(_0x6343('0x1'));var path=require(_0x6343('0x2'));var timeout=require('connect-timeout');var express=require(_0x6343('0x3'));var router=express['Router']();var fs_extra=require(_0x6343('0x4'));var auth=require(_0x6343('0x5'));var interaction=require(_0x6343('0x6'));var config=require('../../config/environment');var controller=require(_0x6343('0x7'));router[_0x6343('0x8')]('/',auth['isAuthenticated'](),controller[_0x6343('0x9')]);router[_0x6343('0x8')](_0x6343('0xa'),auth[_0x6343('0xb')](),controller['describe']);router['get'](_0x6343('0xc'),auth[_0x6343('0xb')](),controller[_0x6343('0xd')]);router[_0x6343('0x8')]('/:id',auth[_0x6343('0xb')](),controller[_0x6343('0xe')]);router[_0x6343('0xf')]('/',auth[_0x6343('0xb')](),controller[_0x6343('0x10')]);router['put'](_0x6343('0x11'),auth['isAuthenticated'](),controller[_0x6343('0x12')]);router[_0x6343('0x13')]('/:id',auth[_0x6343('0xb')](),controller[_0x6343('0x14')]);module['exports']=router; \ No newline at end of file +var _0x4e07=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','/:id','show','put','delete','destroy','util','path','connect-timeout','express'];(function(_0x45cb53,_0x537f28){var _0x3a2de4=function(_0x53550f){while(--_0x53550f){_0x45cb53['push'](_0x45cb53['shift']());}};_0x3a2de4(++_0x537f28);}(_0x4e07,0xba));var _0x74e0=function(_0x404601,_0x1f3289){_0x404601=_0x404601-0x0;var _0x40d5cc=_0x4e07[_0x404601];return _0x40d5cc;};'use strict';var multer=require('multer');var util=require(_0x74e0('0x0'));var path=require(_0x74e0('0x1'));var timeout=require(_0x74e0('0x2'));var express=require(_0x74e0('0x3'));var router=express[_0x74e0('0x4')]();var fs_extra=require(_0x74e0('0x5'));var auth=require(_0x74e0('0x6'));var interaction=require(_0x74e0('0x7'));var config=require('../../config/environment');var controller=require(_0x74e0('0x8'));router[_0x74e0('0x9')]('/',auth[_0x74e0('0xa')](),controller[_0x74e0('0xb')]);router[_0x74e0('0x9')](_0x74e0('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x74e0('0x9')](_0x74e0('0xd'),auth[_0x74e0('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0x74e0('0xe'),auth[_0x74e0('0xa')](),controller[_0x74e0('0xf')]);router['post']('/',auth[_0x74e0('0xa')](),controller['create']);router[_0x74e0('0x10')](_0x74e0('0xe'),auth[_0x74e0('0xa')](),controller['update']);router[_0x74e0('0x11')](_0x74e0('0xe'),auth[_0x74e0('0xa')](),controller[_0x74e0('0x12')]);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 7c815f7..fd958d7 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 _0x51b6=['sequelize','moment','exports','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x49ccaa,_0x5944f2){var _0x2c1ae1=function(_0x3e02b8){while(--_0x3e02b8){_0x49ccaa['push'](_0x49ccaa['shift']());}};_0x2c1ae1(++_0x5944f2);}(_0x51b6,0x1ed));var _0x651b=function(_0x243a5f,_0x3257d5){_0x243a5f=_0x243a5f-0x0;var _0xb30ff6=_0x51b6[_0x243a5f];return _0xb30ff6;};'use strict';var Sequelize=require(_0x651b('0x0'));var moment=require(_0x651b('0x1'));module[_0x651b('0x2')]={'type':{'type':Sequelize[_0x651b('0x3')]},'uniqueid':{'type':Sequelize[_0x651b('0x3')]},'calleridnum':{'type':Sequelize[_0x651b('0x3')]},'calleridname':{'type':Sequelize[_0x651b('0x3')]},'queue':{'type':Sequelize[_0x651b('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x651b('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0xadb3ad){var _0x7bebc0=moment(_0xadb3ad);var _0x7e47e2=moment(this['getDataValue'](_0x651b('0x5')))[_0x651b('0x6')](_0x651b('0x7'));var _0x189deb=_0x7bebc0[_0x651b('0x8')](_0x7e47e2,_0x651b('0x9'));this[_0x651b('0xa')](_0x651b('0xb'),_0xadb3ad);this[_0x651b('0xa')](_0x651b('0xc'),_0x189deb||null);}},'position':{'type':Sequelize[_0x651b('0xd')]},'count':{'type':Sequelize[_0x651b('0xd')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x651b('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x651b('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x651b('0x3')],'comment':_0x651b('0xe')},'originalposition':{'type':Sequelize[_0x651b('0xd')]},'channel':{'type':Sequelize[_0x651b('0x3')]},'connectedlinenum':{'type':Sequelize[_0x651b('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x651b('0x3')]},'context':{'type':Sequelize[_0x651b('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x651b('0xd')]},'mohtime':{'type':Sequelize[_0x651b('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x651b('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x651b('0x3')],'comment':_0x651b('0x10')},'transferexten':{'type':Sequelize[_0x651b('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x651b('0x3')]},'secondDisposition':{'type':Sequelize[_0x651b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x651b('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x657b=['STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x657b,0xfd));var _0xb657=function(_0x22295,_0x544908){_0x22295=_0x22295-0x0;var _0x2ac7f5=_0x657b[_0x22295];return _0x2ac7f5;};'use strict';var Sequelize=require(_0xb657('0x0'));var moment=require(_0xb657('0x1'));module[_0xb657('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb657('0x3')]},'calleridnum':{'type':Sequelize[_0xb657('0x3')]},'calleridname':{'type':Sequelize[_0xb657('0x3')]},'queue':{'type':Sequelize[_0xb657('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xb657('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x36f2f8){var _0x309331=moment(_0x36f2f8);var _0x567106=moment(this['getDataValue'](_0xb657('0x5')))[_0xb657('0x6')](_0xb657('0x7'));var _0x5de110=_0x309331[_0xb657('0x8')](_0x567106,'seconds');this[_0xb657('0x9')](_0xb657('0xa'),_0x36f2f8);this['setDataValue'](_0xb657('0xb'),_0x5de110||null);}},'position':{'type':Sequelize[_0xb657('0xc')]},'count':{'type':Sequelize[_0xb657('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xb657('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xb657('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb657('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0xb657('0x3')],'comment':_0xb657('0xe')},'originalposition':{'type':Sequelize[_0xb657('0xc')]},'channel':{'type':Sequelize[_0xb657('0x3')]},'connectedlinenum':{'type':Sequelize[_0xb657('0x3')]},'connectedlinename':{'type':Sequelize[_0xb657('0x3')]},'accountcode':{'type':Sequelize[_0xb657('0x3')]},'context':{'type':Sequelize[_0xb657('0x3')]},'exten':{'type':Sequelize[_0xb657('0x3')]},'priority':{'type':Sequelize[_0xb657('0x3')]},'holdtime':{'type':Sequelize[_0xb657('0xc')]},'mohtime':{'type':Sequelize[_0xb657('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb657('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xb657('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb657('0x3')],'comment':_0xb657('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb657('0x3')]},'disposition':{'type':Sequelize[_0xb657('0x3')]},'secondDisposition':{'type':Sequelize[_0xb657('0x3')]},'thirdDisposition':{'type':Sequelize[_0xb657('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xb657('0xc')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index c0dcf3c..b02933e 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 _0x7345=['type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','find','destroy','describe','hasOwnProperty','order','findAll','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','stack','name','send','index','map','VoiceQueueReport','rawAttributes'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x7345,0x15d));var _0x5734=function(_0x159e46,_0x54e6a6){_0x159e46=_0x159e46-0x0;var _0x497774=_0x7345[_0x159e46];return _0x497774;};'use strict';var emlformat=require(_0x5734('0x0'));var rimraf=require(_0x5734('0x1'));var zipdir=require(_0x5734('0x2'));var jsonpatch=require(_0x5734('0x3'));var rp=require(_0x5734('0x4'));var moment=require(_0x5734('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5734('0x6'));var util=require('util');var path=require(_0x5734('0x7'));var sox=require('sox');var csv=require(_0x5734('0x8'));var ejs=require(_0x5734('0x9'));var fs=require('fs');var fs_extra=require(_0x5734('0xa'));var _=require('lodash');var squel=require(_0x5734('0xb'));var crypto=require(_0x5734('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5734('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5734('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5734('0xf'))('api');var utils=require(_0x5734('0x10'));var config=require(_0x5734('0x11'));var licenseUtil=require(_0x5734('0x12'));var db=require(_0x5734('0x13'))['db'];config[_0x5734('0x14')]=_[_0x5734('0x15')](config[_0x5734('0x14')],{'host':_0x5734('0x16'),'port':0x18eb});var socket=require(_0x5734('0x17'))(new Redis(config[_0x5734('0x14')]));require(_0x5734('0x18'))[_0x5734('0x19')](socket);function respondWithStatusCode(_0x113d43,_0x326b6d){_0x326b6d=_0x326b6d||0xcc;return function(_0x1101dd){if(_0x1101dd){return _0x113d43[_0x5734('0x1a')](_0x326b6d);}return _0x113d43[_0x5734('0x1b')](_0x326b6d)[_0x5734('0x1c')]();};}function respondWithResult(_0x4fda28,_0x46cb92){_0x46cb92=_0x46cb92||0xc8;return function(_0x59bb8e){if(_0x59bb8e){return _0x4fda28[_0x5734('0x1b')](_0x46cb92)[_0x5734('0x1d')](_0x59bb8e);}};}function respondWithFilteredResult(_0x58414c,_0x2a4f91){return function(_0x22e230){if(_0x22e230){var _0xeed194=typeof _0x2a4f91[_0x5734('0x1e')]===_0x5734('0x1f')&&typeof _0x2a4f91[_0x5734('0x20')]===_0x5734('0x1f');var _0x2a48e3=_0x22e230[_0x5734('0x21')];var _0x23e42f=_0xeed194?0x0:_0x2a4f91[_0x5734('0x1e')];var _0x58d7d0=_0xeed194?_0x22e230[_0x5734('0x21')]:_0x2a4f91[_0x5734('0x1e')]+_0x2a4f91[_0x5734('0x20')];var _0x13c83b;if(_0x58d7d0>=_0x2a48e3){_0x58d7d0=_0x2a48e3;_0x13c83b=0xc8;}else{_0x13c83b=0xce;}_0x58414c[_0x5734('0x1b')](_0x13c83b);return _0x58414c['set']('Content-Range',_0x23e42f+'-'+_0x58d7d0+'/'+_0x2a48e3)['json'](_0x22e230);}return null;};}function patchUpdates(_0xe41bc3){return function(_0x4cf3ef){try{jsonpatch[_0x5734('0x22')](_0x4cf3ef,_0xe41bc3,!![]);}catch(_0xa36652){return BPromise[_0x5734('0x23')](_0xa36652);}return _0x4cf3ef[_0x5734('0x24')]();};}function saveUpdates(_0x448624,_0x2fa10a){return function(_0x7f8a71){if(_0x7f8a71){return _0x7f8a71[_0x5734('0x25')](_0x448624)[_0x5734('0x26')](function(_0x113e38){return _0x113e38;});}return null;};}function removeEntity(_0x2ed553,_0x381e73){return function(_0xb8c1a3){if(_0xb8c1a3){return _0xb8c1a3['destroy']()[_0x5734('0x26')](function(){_0x2ed553[_0x5734('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224ae7,_0x15c956){return function(_0x2d27ee){if(!_0x2d27ee){_0x224ae7['sendStatus'](0x194);}return _0x2d27ee;};}function handleError(_0x223050,_0x17e05e){_0x17e05e=_0x17e05e||0x1f4;return function(_0x16dc3b){logger['error'](_0x16dc3b[_0x5734('0x27')]);if(_0x16dc3b['name']){delete _0x16dc3b[_0x5734('0x28')];}_0x223050[_0x5734('0x1b')](_0x17e05e)[_0x5734('0x29')](_0x16dc3b);};}exports[_0x5734('0x2a')]=function(_0x56c0a8,_0x36fc6a){var _0x3b8388={},_0x583df0={},_0x12042d={'count':0x0,'rows':[]};var _0x5d1bd8=_[_0x5734('0x2b')](db[_0x5734('0x2c')][_0x5734('0x2d')],function(_0x20dbf8){return{'name':_0x20dbf8['fieldName'],'type':_0x20dbf8[_0x5734('0x2e')][_0x5734('0x2f')]};});_0x583df0['model']=_['map'](_0x5d1bd8,_0x5734('0x28'));_0x583df0['query']=_[_0x5734('0x30')](_0x56c0a8[_0x5734('0x31')]);_0x583df0[_0x5734('0x32')]=_[_0x5734('0x33')](_0x583df0[_0x5734('0x34')],_0x583df0['query']);_0x3b8388[_0x5734('0x35')]=_[_0x5734('0x33')](_0x583df0['model'],qs[_0x5734('0x36')](_0x56c0a8[_0x5734('0x31')][_0x5734('0x36')]));_0x3b8388['attributes']=_0x3b8388[_0x5734('0x35')][_0x5734('0x37')]?_0x3b8388['attributes']:_0x583df0[_0x5734('0x34')];if(!_0x56c0a8[_0x5734('0x31')]['hasOwnProperty'](_0x5734('0x38'))){_0x3b8388[_0x5734('0x20')]=qs[_0x5734('0x20')](_0x56c0a8[_0x5734('0x31')]['limit']);_0x3b8388[_0x5734('0x1e')]=qs[_0x5734('0x1e')](_0x56c0a8[_0x5734('0x31')]['offset']);}_0x3b8388['order']=qs[_0x5734('0x39')](_0x56c0a8[_0x5734('0x31')]['sort']);_0x3b8388[_0x5734('0x3a')]=qs[_0x5734('0x32')](_[_0x5734('0x3b')](_0x56c0a8[_0x5734('0x31')],_0x583df0[_0x5734('0x32')]),_0x5d1bd8);if(_0x56c0a8['query'][_0x5734('0x3c')]){_0x3b8388[_0x5734('0x3a')]=_[_0x5734('0x3d')](_0x3b8388[_0x5734('0x3a')],{'$or':_[_0x5734('0x2b')](_0x5d1bd8,function(_0x5b2c9c){if(_0x5b2c9c['type']!==_0x5734('0x3e')){var _0xe6d899={};_0xe6d899[_0x5b2c9c[_0x5734('0x28')]]={'$like':'%'+_0x56c0a8[_0x5734('0x31')]['filter']+'%'};return _0xe6d899;}})});}_0x3b8388=_['merge']({},_0x3b8388,_0x56c0a8[_0x5734('0x3f')]);var _0x5efea7={'where':_0x3b8388[_0x5734('0x3a')]};return db[_0x5734('0x2c')][_0x5734('0x21')](_0x5efea7)[_0x5734('0x26')](function(_0x567009){_0x12042d['count']=_0x567009;if(_0x56c0a8['query']['includeAll']){_0x3b8388[_0x5734('0x40')]=[{'all':!![]}];}return db[_0x5734('0x2c')]['findAll'](_0x3b8388);})[_0x5734('0x26')](function(_0x4979e7){_0x12042d[_0x5734('0x41')]=_0x4979e7;return _0x12042d;})[_0x5734('0x26')](respondWithFilteredResult(_0x36fc6a,_0x3b8388))[_0x5734('0x42')](handleError(_0x36fc6a,null));};exports[_0x5734('0x43')]=function(_0x5198a2,_0x2ce1b8){var _0x2b02d6={'raw':![],'where':{'id':_0x5198a2[_0x5734('0x44')]['id']}},_0xf5519d={};_0xf5519d[_0x5734('0x34')]=_['keys'](db[_0x5734('0x2c')][_0x5734('0x2d')]);_0xf5519d[_0x5734('0x31')]=_[_0x5734('0x30')](_0x5198a2[_0x5734('0x31')]);_0xf5519d[_0x5734('0x32')]=_[_0x5734('0x33')](_0xf5519d['model'],_0xf5519d[_0x5734('0x31')]);_0x2b02d6[_0x5734('0x35')]=_[_0x5734('0x33')](_0xf5519d[_0x5734('0x34')],qs[_0x5734('0x36')](_0x5198a2[_0x5734('0x31')][_0x5734('0x36')]));_0x2b02d6['attributes']=_0x2b02d6[_0x5734('0x35')][_0x5734('0x37')]?_0x2b02d6[_0x5734('0x35')]:_0xf5519d[_0x5734('0x34')];if(_0x5198a2[_0x5734('0x31')][_0x5734('0x45')]){_0x2b02d6[_0x5734('0x40')]=[{'all':!![]}];}_0x2b02d6=_[_0x5734('0x3d')]({},_0x2b02d6,_0x5198a2[_0x5734('0x3f')]);return db[_0x5734('0x2c')]['find'](_0x2b02d6)[_0x5734('0x26')](handleEntityNotFound(_0x2ce1b8,null))[_0x5734('0x26')](respondWithResult(_0x2ce1b8,null))[_0x5734('0x42')](handleError(_0x2ce1b8,null));};exports[_0x5734('0x46')]=function(_0xa08702,_0x5185a2){return db[_0x5734('0x2c')][_0x5734('0x46')](_0xa08702['body'],{})[_0x5734('0x26')](respondWithResult(_0x5185a2,0xc9))[_0x5734('0x42')](handleError(_0x5185a2,null));};exports[_0x5734('0x25')]=function(_0x59829e,_0x5a2128){if(_0x59829e[_0x5734('0x47')]['id']){delete _0x59829e[_0x5734('0x47')]['id'];}return db[_0x5734('0x2c')][_0x5734('0x48')]({'where':{'id':_0x59829e[_0x5734('0x44')]['id']}})[_0x5734('0x26')](handleEntityNotFound(_0x5a2128,null))[_0x5734('0x26')](saveUpdates(_0x59829e[_0x5734('0x47')],null))[_0x5734('0x26')](respondWithResult(_0x5a2128,null))[_0x5734('0x42')](handleError(_0x5a2128,null));};exports[_0x5734('0x49')]=function(_0x2eaf34,_0x2e3fae){return db[_0x5734('0x2c')]['find']({'where':{'id':_0x2eaf34[_0x5734('0x44')]['id']}})[_0x5734('0x26')](handleEntityNotFound(_0x2e3fae,null))[_0x5734('0x26')](removeEntity(_0x2e3fae,null))[_0x5734('0x42')](handleError(_0x2e3fae,null));};exports['describe']=function(_0xb68433,_0x38faf7){return db[_0x5734('0x2c')][_0x5734('0x4a')]()[_0x5734('0x26')](respondWithResult(_0x38faf7,null))[_0x5734('0x42')](handleError(_0x38faf7,null));};exports['getVoiceQueuesReport']=function(_0x5b2a84,_0x10dcc9){var _0x23b751={},_0x29a4e8={},_0x2cde68={'count':0x0,'rows':[]};_0x29a4e8[_0x5734('0x34')]=_[_0x5734('0x30')](db['VoiceQueueReport'][_0x5734('0x2d')]);_0x29a4e8[_0x5734('0x31')]=_['keys'](_0x5b2a84[_0x5734('0x31')]);_0x29a4e8[_0x5734('0x32')]=_[_0x5734('0x33')](_0x29a4e8['model'],_0x29a4e8['query']);_0x23b751[_0x5734('0x35')]=_[_0x5734('0x33')](_0x29a4e8[_0x5734('0x34')],qs[_0x5734('0x36')](_0x5b2a84['query'][_0x5734('0x36')]));_0x23b751[_0x5734('0x35')]=_0x23b751[_0x5734('0x35')]['length']?_0x23b751[_0x5734('0x35')]:_0x29a4e8[_0x5734('0x34')];if(!_0x5b2a84[_0x5734('0x31')][_0x5734('0x4b')](_0x5734('0x38'))){_0x23b751[_0x5734('0x20')]=qs[_0x5734('0x20')](_0x5b2a84[_0x5734('0x31')][_0x5734('0x20')]);_0x23b751[_0x5734('0x1e')]=qs[_0x5734('0x1e')](_0x5b2a84[_0x5734('0x31')]['offset']);}_0x23b751[_0x5734('0x4c')]=qs[_0x5734('0x39')](_0x5b2a84[_0x5734('0x31')][_0x5734('0x39')]);_0x23b751[_0x5734('0x3a')]=qs[_0x5734('0x32')](_['pick'](_0x5b2a84[_0x5734('0x31')],_0x29a4e8[_0x5734('0x32')]));if(_0x5b2a84[_0x5734('0x31')][_0x5734('0x3c')]){_0x23b751['where']=_[_0x5734('0x3d')](_0x23b751[_0x5734('0x3a')],{'$or':_['map'](_0x23b751[_0x5734('0x35')],function(_0x32aa5e){var _0x5bb458={};_0x5bb458[_0x32aa5e]={'$like':'%'+_0x5b2a84[_0x5734('0x31')]['filter']+'%'};return _0x5bb458;})});}_0x23b751=_[_0x5734('0x3d')]({},_0x23b751,_0x5b2a84[_0x5734('0x3f')]);var _0x42594c={'where':_0x23b751[_0x5734('0x3a')]};return db['VoiceQueueReport'][_0x5734('0x21')](_0x42594c)[_0x5734('0x26')](function(_0x3dcca5){_0x2cde68[_0x5734('0x21')]=_0x3dcca5;if(_0x5b2a84['query'][_0x5734('0x45')]){_0x23b751[_0x5734('0x40')]=[{'all':!![]}];}return db[_0x5734('0x2c')][_0x5734('0x4d')](_0x23b751);})[_0x5734('0x26')](function(_0x1decef){_0x2cde68[_0x5734('0x41')]=_0x1decef;return _0x2cde68;})[_0x5734('0x26')](respondWithFilteredResult(_0x10dcc9,_0x23b751,_0x5734('0x4e')))[_0x5734('0x42')](handleError(_0x10dcc9,null,_0x5734('0x4e')));}; \ No newline at end of file +var _0xb3d4=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','VoiceQueueReport','count','includeAll','rows','catch','params','keys','length','create','body','find','describe','include','findAll','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0xb3d4,0x194));var _0x4b3d=function(_0x1913b1,_0xd2c8f7){_0x1913b1=_0x1913b1-0x0;var _0x5a2121=_0xb3d4[_0x1913b1];return _0x5a2121;};'use strict';var emlformat=require(_0x4b3d('0x0'));var rimraf=require(_0x4b3d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b3d('0x2'));var rp=require(_0x4b3d('0x3'));var moment=require('moment');var BPromise=require(_0x4b3d('0x4'));var Mustache=require('mustache');var util=require(_0x4b3d('0x5'));var path=require('path');var sox=require(_0x4b3d('0x6'));var csv=require(_0x4b3d('0x7'));var ejs=require(_0x4b3d('0x8'));var fs=require('fs');var fs_extra=require(_0x4b3d('0x9'));var _=require(_0x4b3d('0xa'));var squel=require(_0x4b3d('0xb'));var crypto=require(_0x4b3d('0xc'));var jsforce=require(_0x4b3d('0xd'));var deskjs=require(_0x4b3d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4b3d('0xf'));var authService=require(_0x4b3d('0x10'));var qs=require(_0x4b3d('0x11'));var as=require(_0x4b3d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4b3d('0x13'));var utils=require(_0x4b3d('0x14'));var config=require(_0x4b3d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b3d('0x16'))['db'];config[_0x4b3d('0x17')]=_[_0x4b3d('0x18')](config[_0x4b3d('0x17')],{'host':_0x4b3d('0x19'),'port':0x18eb});var socket=require(_0x4b3d('0x1a'))(new Redis(config[_0x4b3d('0x17')]));require(_0x4b3d('0x1b'))['register'](socket);function respondWithStatusCode(_0x172113,_0x33e131){_0x33e131=_0x33e131||0xcc;return function(_0x4e270b){if(_0x4e270b){return _0x172113[_0x4b3d('0x1c')](_0x33e131);}return _0x172113[_0x4b3d('0x1d')](_0x33e131)[_0x4b3d('0x1e')]();};}function respondWithResult(_0x1a9883,_0x4addfa){_0x4addfa=_0x4addfa||0xc8;return function(_0x44238c){if(_0x44238c){return _0x1a9883[_0x4b3d('0x1d')](_0x4addfa)[_0x4b3d('0x1f')](_0x44238c);}};}function respondWithFilteredResult(_0x4aab76,_0xc5cc1a){return function(_0x4187af){if(_0x4187af){var _0x295703=typeof _0xc5cc1a[_0x4b3d('0x20')]===_0x4b3d('0x21')&&typeof _0xc5cc1a[_0x4b3d('0x22')]==='undefined';var _0x1a2ee1=_0x4187af['count'];var _0x381e00=_0x295703?0x0:_0xc5cc1a[_0x4b3d('0x20')];var _0x38f57e=_0x295703?_0x4187af['count']:_0xc5cc1a[_0x4b3d('0x20')]+_0xc5cc1a[_0x4b3d('0x22')];var _0x522922;if(_0x38f57e>=_0x1a2ee1){_0x38f57e=_0x1a2ee1;_0x522922=0xc8;}else{_0x522922=0xce;}_0x4aab76[_0x4b3d('0x1d')](_0x522922);return _0x4aab76[_0x4b3d('0x23')](_0x4b3d('0x24'),_0x381e00+'-'+_0x38f57e+'/'+_0x1a2ee1)[_0x4b3d('0x1f')](_0x4187af);}return null;};}function patchUpdates(_0x40f536){return function(_0x10d894){try{jsonpatch[_0x4b3d('0x25')](_0x10d894,_0x40f536,!![]);}catch(_0xd9417a){return BPromise[_0x4b3d('0x26')](_0xd9417a);}return _0x10d894[_0x4b3d('0x27')]();};}function saveUpdates(_0x4c9b3e,_0x49f5e8){return function(_0x5ba763){if(_0x5ba763){return _0x5ba763[_0x4b3d('0x28')](_0x4c9b3e)[_0x4b3d('0x29')](function(_0x54b0f2){return _0x54b0f2;});}return null;};}function removeEntity(_0x2b76fc,_0x5c77ef){return function(_0x5d5af7){if(_0x5d5af7){return _0x5d5af7[_0x4b3d('0x2a')]()[_0x4b3d('0x29')](function(){_0x2b76fc[_0x4b3d('0x1d')](0xcc)[_0x4b3d('0x1e')]();});}};}function handleEntityNotFound(_0x19c2c8,_0x4e08df){return function(_0x1c3d60){if(!_0x1c3d60){_0x19c2c8['sendStatus'](0x194);}return _0x1c3d60;};}function handleError(_0x337427,_0x3c230b){_0x3c230b=_0x3c230b||0x1f4;return function(_0x4fb02c){logger[_0x4b3d('0x2b')](_0x4fb02c['stack']);if(_0x4fb02c[_0x4b3d('0x2c')]){delete _0x4fb02c['name'];}_0x337427[_0x4b3d('0x1d')](_0x3c230b)[_0x4b3d('0x2d')](_0x4fb02c);};}exports[_0x4b3d('0x2e')]=function(_0x1b630c,_0x67c7c8){var _0x247969={},_0x4a4755={},_0x591412={'count':0x0,'rows':[]};var _0x25f498=_['map'](db['VoiceQueueReport'][_0x4b3d('0x2f')],function(_0x3e8008){return{'name':_0x3e8008[_0x4b3d('0x30')],'type':_0x3e8008[_0x4b3d('0x31')][_0x4b3d('0x32')]};});_0x4a4755[_0x4b3d('0x33')]=_[_0x4b3d('0x34')](_0x25f498,_0x4b3d('0x2c'));_0x4a4755[_0x4b3d('0x35')]=_['keys'](_0x1b630c[_0x4b3d('0x35')]);_0x4a4755[_0x4b3d('0x36')]=_[_0x4b3d('0x37')](_0x4a4755[_0x4b3d('0x33')],_0x4a4755[_0x4b3d('0x35')]);_0x247969[_0x4b3d('0x38')]=_[_0x4b3d('0x37')](_0x4a4755[_0x4b3d('0x33')],qs[_0x4b3d('0x39')](_0x1b630c['query'][_0x4b3d('0x39')]));_0x247969[_0x4b3d('0x38')]=_0x247969['attributes']['length']?_0x247969[_0x4b3d('0x38')]:_0x4a4755[_0x4b3d('0x33')];if(!_0x1b630c[_0x4b3d('0x35')][_0x4b3d('0x3a')](_0x4b3d('0x3b'))){_0x247969[_0x4b3d('0x22')]=qs[_0x4b3d('0x22')](_0x1b630c[_0x4b3d('0x35')][_0x4b3d('0x22')]);_0x247969[_0x4b3d('0x20')]=qs[_0x4b3d('0x20')](_0x1b630c[_0x4b3d('0x35')]['offset']);}_0x247969['order']=qs['sort'](_0x1b630c[_0x4b3d('0x35')][_0x4b3d('0x3c')]);_0x247969[_0x4b3d('0x3d')]=qs['filters'](_[_0x4b3d('0x3e')](_0x1b630c[_0x4b3d('0x35')],_0x4a4755[_0x4b3d('0x36')]),_0x25f498);if(_0x1b630c[_0x4b3d('0x35')]['filter']){_0x247969[_0x4b3d('0x3d')]=_[_0x4b3d('0x3f')](_0x247969[_0x4b3d('0x3d')],{'$or':_[_0x4b3d('0x34')](_0x25f498,function(_0x19ffe2){if(_0x19ffe2[_0x4b3d('0x31')]!==_0x4b3d('0x40')){var _0x1bc66f={};_0x1bc66f[_0x19ffe2[_0x4b3d('0x2c')]]={'$like':'%'+_0x1b630c['query'][_0x4b3d('0x41')]+'%'};return _0x1bc66f;}})});}_0x247969=_[_0x4b3d('0x3f')]({},_0x247969,_0x1b630c[_0x4b3d('0x42')]);var _0x53ffa1={'where':_0x247969['where']};return db[_0x4b3d('0x43')][_0x4b3d('0x44')](_0x53ffa1)[_0x4b3d('0x29')](function(_0x2b7d40){_0x591412[_0x4b3d('0x44')]=_0x2b7d40;if(_0x1b630c[_0x4b3d('0x35')][_0x4b3d('0x45')]){_0x247969['include']=[{'all':!![]}];}return db[_0x4b3d('0x43')]['findAll'](_0x247969);})[_0x4b3d('0x29')](function(_0x26ac71){_0x591412[_0x4b3d('0x46')]=_0x26ac71;return _0x591412;})[_0x4b3d('0x29')](respondWithFilteredResult(_0x67c7c8,_0x247969))[_0x4b3d('0x47')](handleError(_0x67c7c8,null));};exports['show']=function(_0x4fb0d3,_0x59881c){var _0x5d7f85={'raw':![],'where':{'id':_0x4fb0d3[_0x4b3d('0x48')]['id']}},_0x590da3={};_0x590da3[_0x4b3d('0x33')]=_['keys'](db[_0x4b3d('0x43')][_0x4b3d('0x2f')]);_0x590da3[_0x4b3d('0x35')]=_[_0x4b3d('0x49')](_0x4fb0d3[_0x4b3d('0x35')]);_0x590da3[_0x4b3d('0x36')]=_[_0x4b3d('0x37')](_0x590da3[_0x4b3d('0x33')],_0x590da3[_0x4b3d('0x35')]);_0x5d7f85[_0x4b3d('0x38')]=_[_0x4b3d('0x37')](_0x590da3['model'],qs['fields'](_0x4fb0d3[_0x4b3d('0x35')][_0x4b3d('0x39')]));_0x5d7f85[_0x4b3d('0x38')]=_0x5d7f85[_0x4b3d('0x38')][_0x4b3d('0x4a')]?_0x5d7f85[_0x4b3d('0x38')]:_0x590da3['model'];if(_0x4fb0d3[_0x4b3d('0x35')][_0x4b3d('0x45')]){_0x5d7f85['include']=[{'all':!![]}];}_0x5d7f85=_['merge']({},_0x5d7f85,_0x4fb0d3['options']);return db[_0x4b3d('0x43')]['find'](_0x5d7f85)[_0x4b3d('0x29')](handleEntityNotFound(_0x59881c,null))[_0x4b3d('0x29')](respondWithResult(_0x59881c,null))['catch'](handleError(_0x59881c,null));};exports[_0x4b3d('0x4b')]=function(_0x3df255,_0xd631eb){return db[_0x4b3d('0x43')][_0x4b3d('0x4b')](_0x3df255['body'],{})['then'](respondWithResult(_0xd631eb,0xc9))[_0x4b3d('0x47')](handleError(_0xd631eb,null));};exports[_0x4b3d('0x28')]=function(_0x3d01cb,_0x841c85){if(_0x3d01cb['body']['id']){delete _0x3d01cb[_0x4b3d('0x4c')]['id'];}return db[_0x4b3d('0x43')][_0x4b3d('0x4d')]({'where':{'id':_0x3d01cb[_0x4b3d('0x48')]['id']}})['then'](handleEntityNotFound(_0x841c85,null))[_0x4b3d('0x29')](saveUpdates(_0x3d01cb[_0x4b3d('0x4c')],null))['then'](respondWithResult(_0x841c85,null))['catch'](handleError(_0x841c85,null));};exports[_0x4b3d('0x2a')]=function(_0x365bff,_0xb4c17e){return db[_0x4b3d('0x43')][_0x4b3d('0x4d')]({'where':{'id':_0x365bff[_0x4b3d('0x48')]['id']}})[_0x4b3d('0x29')](handleEntityNotFound(_0xb4c17e,null))[_0x4b3d('0x29')](removeEntity(_0xb4c17e,null))['catch'](handleError(_0xb4c17e,null));};exports[_0x4b3d('0x4e')]=function(_0x26c03e,_0x1f1c2c){return db['VoiceQueueReport'][_0x4b3d('0x4e')]()[_0x4b3d('0x29')](respondWithResult(_0x1f1c2c,null))['catch'](handleError(_0x1f1c2c,null));};exports['getVoiceQueuesReport']=function(_0x1729e1,_0x12609f){var _0x5aaaad={},_0xf81c8d={},_0x4bfb52={'count':0x0,'rows':[]};_0xf81c8d[_0x4b3d('0x33')]=_['keys'](db[_0x4b3d('0x43')]['rawAttributes']);_0xf81c8d[_0x4b3d('0x35')]=_[_0x4b3d('0x49')](_0x1729e1[_0x4b3d('0x35')]);_0xf81c8d[_0x4b3d('0x36')]=_[_0x4b3d('0x37')](_0xf81c8d[_0x4b3d('0x33')],_0xf81c8d['query']);_0x5aaaad[_0x4b3d('0x38')]=_[_0x4b3d('0x37')](_0xf81c8d[_0x4b3d('0x33')],qs['fields'](_0x1729e1[_0x4b3d('0x35')][_0x4b3d('0x39')]));_0x5aaaad[_0x4b3d('0x38')]=_0x5aaaad[_0x4b3d('0x38')]['length']?_0x5aaaad[_0x4b3d('0x38')]:_0xf81c8d['model'];if(!_0x1729e1[_0x4b3d('0x35')]['hasOwnProperty'](_0x4b3d('0x3b'))){_0x5aaaad[_0x4b3d('0x22')]=qs['limit'](_0x1729e1['query'][_0x4b3d('0x22')]);_0x5aaaad['offset']=qs[_0x4b3d('0x20')](_0x1729e1[_0x4b3d('0x35')][_0x4b3d('0x20')]);}_0x5aaaad['order']=qs[_0x4b3d('0x3c')](_0x1729e1['query']['sort']);_0x5aaaad[_0x4b3d('0x3d')]=qs[_0x4b3d('0x36')](_['pick'](_0x1729e1[_0x4b3d('0x35')],_0xf81c8d[_0x4b3d('0x36')]));if(_0x1729e1[_0x4b3d('0x35')][_0x4b3d('0x41')]){_0x5aaaad['where']=_[_0x4b3d('0x3f')](_0x5aaaad['where'],{'$or':_[_0x4b3d('0x34')](_0x5aaaad[_0x4b3d('0x38')],function(_0x1fd771){var _0x1fa2ea={};_0x1fa2ea[_0x1fd771]={'$like':'%'+_0x1729e1[_0x4b3d('0x35')][_0x4b3d('0x41')]+'%'};return _0x1fa2ea;})});}_0x5aaaad=_[_0x4b3d('0x3f')]({},_0x5aaaad,_0x1729e1['options']);var _0x129282={'where':_0x5aaaad['where']};return db[_0x4b3d('0x43')]['count'](_0x129282)['then'](function(_0x30abf6){_0x4bfb52['count']=_0x30abf6;if(_0x1729e1['query'][_0x4b3d('0x45')]){_0x5aaaad[_0x4b3d('0x4f')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x4b3d('0x50')](_0x5aaaad);})['then'](function(_0x51e29c){_0x4bfb52[_0x4b3d('0x46')]=_0x51e29c;return _0x4bfb52;})[_0x4b3d('0x29')](respondWithFilteredResult(_0x12609f,_0x5aaaad,_0x4b3d('0x51')))[_0x4b3d('0x47')](handleError(_0x12609f,null,_0x4b3d('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index a2db8d5..4d28582 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 _0x5849=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x3c1aaa,_0x34139a){var _0x460ec9=function(_0x9a40f7){while(--_0x9a40f7){_0x3c1aaa['push'](_0x3c1aaa['shift']());}};_0x460ec9(++_0x34139a);}(_0x5849,0x167));var _0x9584=function(_0x40305c,_0x141ee2){_0x40305c=_0x40305c-0x0;var _0x3b6fe3=_0x5849[_0x40305c];return _0x3b6fe3;};'use strict';var EventEmitter=require(_0x9584('0x0'));var VoiceQueueReport=require(_0x9584('0x1'))['db'][_0x9584('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9584('0x3')](0x0);var events={'afterCreate':_0x9584('0x4'),'afterUpdate':_0x9584('0x5'),'afterDestroy':'remove'};function emitEvent(_0x447548){return function(_0x107707,_0x35fafa,_0x2b8a17){VoiceQueueReportEvents[_0x9584('0x6')](_0x447548+':'+_0x107707['id'],_0x107707);VoiceQueueReportEvents[_0x9584('0x6')](_0x447548,_0x107707);_0x2b8a17(null);};}for(var e in events){if(events[_0x9584('0x7')](e)){var event=events[e];VoiceQueueReport[_0x9584('0x8')](e,emitEvent(event));}}module[_0x9584('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x9416=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update'];(function(_0x485240,_0x2498fc){var _0x26ea8c=function(_0x4e792a){while(--_0x4e792a){_0x485240['push'](_0x485240['shift']());}};_0x26ea8c(++_0x2498fc);}(_0x9416,0xae));var _0x6941=function(_0x59e2a0,_0x405ed0){_0x59e2a0=_0x59e2a0-0x0;var _0x2a1c35=_0x9416[_0x59e2a0];return _0x2a1c35;};'use strict';var EventEmitter=require(_0x6941('0x0'));var VoiceQueueReport=require(_0x6941('0x1'))['db'][_0x6941('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6941('0x3')](0x0);var events={'afterCreate':_0x6941('0x4'),'afterUpdate':_0x6941('0x5'),'afterDestroy':'remove'};function emitEvent(_0x54c079){return function(_0x4e8c12,_0x5bfec1,_0x219fd1){VoiceQueueReportEvents[_0x6941('0x6')](_0x54c079+':'+_0x4e8c12['id'],_0x4e8c12);VoiceQueueReportEvents[_0x6941('0x6')](_0x54c079,_0x4e8c12);_0x219fd1(null);};}for(var e in events){if(events[_0x6941('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x6941('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 4e383b8..5abdc20 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 _0x5643=['report_queue','uniqueid','bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports'];(function(_0x1b768e,_0x8ee33c){var _0x31ea76=function(_0x4adf75){while(--_0x4adf75){_0x1b768e['push'](_0x1b768e['shift']());}};_0x31ea76(++_0x8ee33c);}(_0x5643,0x162));var _0x3564=function(_0x20ddce,_0x163041){_0x20ddce=_0x20ddce-0x0;var _0x5d63ea=_0x5643[_0x20ddce];return _0x5d63ea;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3564('0x0'));var rp=require(_0x3564('0x1'));var fs=require('fs');var path=require(_0x3564('0x2'));var rimraf=require(_0x3564('0x3'));var config=require('../../config/environment');var attributes=require(_0x3564('0x4'));module[_0x3564('0x5')]=function(_0x4e59d5,_0x1e198e){return _0x4e59d5['define']('VoiceQueueReport',attributes,{'tableName':_0x3564('0x6'),'paranoid':![],'indexes':[{'fields':[_0x3564('0x7')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2549=['request-promise','path','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x2549,0x19e));var _0x9254=function(_0x26dc3a,_0x284d98){_0x26dc3a=_0x26dc3a-0x0;var _0x47036c=_0x2549[_0x26dc3a];return _0x47036c;};'use strict';var _=require(_0x9254('0x0'));var util=require(_0x9254('0x1'));var logger=require(_0x9254('0x2'))(_0x9254('0x3'));var moment=require(_0x9254('0x4'));var BPromise=require(_0x9254('0x5'));var rp=require(_0x9254('0x6'));var fs=require('fs');var path=require(_0x9254('0x7'));var rimraf=require('rimraf');var config=require(_0x9254('0x8'));var attributes=require(_0x9254('0x9'));module['exports']=function(_0x584683,_0xc30d70){return _0x584683[_0x9254('0xa')](_0x9254('0xb'),attributes,{'tableName':_0x9254('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x9254('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 75cfa94..e8fb6eb 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 _0xbf0f=['request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','limit','include','map','model','attributes','catch','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf0f,0x1c1));var _0xfbf0=function(_0x2de0a7,_0x38d3e7){_0x2de0a7=_0x2de0a7-0x0;var _0x429437=_0xbf0f[_0x2de0a7];return _0x429437;};'use strict';var _=require(_0xfbf0('0x0'));var util=require(_0xfbf0('0x1'));var moment=require('moment');var BPromise=require(_0xfbf0('0x2'));var rs=require(_0xfbf0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbf0('0x4'));var logger=require(_0xfbf0('0x5'))('rpc');var config=require(_0xfbf0('0x6'));var jayson=require(_0xfbf0('0x7'));var client=jayson['client'][_0xfbf0('0x8')]({'port':0x232a});config['redis']=_[_0xfbf0('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfbf0('0xa'))(new Redis(config[_0xfbf0('0xb')]));require('./voiceQueueReport.socket')[_0xfbf0('0xc')](socket);function respondWithRpcPromise(_0x44ec88,_0x5d8f1b,_0x28df0b){return new BPromise(function(_0x280cfc,_0x430743){return client[_0xfbf0('0xd')](_0x44ec88,_0x28df0b)[_0xfbf0('0xe')](function(_0x1a153c){logger[_0xfbf0('0xf')](_0xfbf0('0x10'),_0x5d8f1b,_0xfbf0('0x11'));logger[_0xfbf0('0x12')](_0xfbf0('0x13'),_0x5d8f1b,_0xfbf0('0x11'),JSON[_0xfbf0('0x14')](_0x1a153c));if(_0x1a153c[_0xfbf0('0x15')]){if(_0x1a153c[_0xfbf0('0x15')][_0xfbf0('0x16')]===0x1f4){logger['error'](_0xfbf0('0x10'),_0x5d8f1b,_0x1a153c[_0xfbf0('0x15')]['message']);return _0x430743(_0x1a153c[_0xfbf0('0x15')][_0xfbf0('0x17')]);}logger[_0xfbf0('0x15')](_0xfbf0('0x10'),_0x5d8f1b,_0x1a153c[_0xfbf0('0x15')][_0xfbf0('0x17')]);return _0x280cfc(_0x1a153c[_0xfbf0('0x15')][_0xfbf0('0x17')]);}else{logger[_0xfbf0('0xf')](_0xfbf0('0x10'),_0x5d8f1b,'request\x20sent');_0x280cfc(_0x1a153c[_0xfbf0('0x18')][_0xfbf0('0x17')]);}})['catch'](function(_0x4451da){logger[_0xfbf0('0x15')](_0xfbf0('0x10'),_0x5d8f1b,_0x4451da);_0x430743(_0x4451da);});});}exports[_0xfbf0('0x19')]=function(_0x25309b){var _0x15f962=this;return new Promise(function(_0x42f528,_0x3af91d){return db[_0xfbf0('0x1a')][_0xfbf0('0x1b')]({'raw':_0x25309b[_0xfbf0('0x1c')]?_0x25309b['options']['raw']===undefined?!![]:![]:!![],'where':_0x25309b[_0xfbf0('0x1c')]?_0x25309b[_0xfbf0('0x1c')][_0xfbf0('0x1d')]||null:null,'attributes':_0x25309b[_0xfbf0('0x1c')]?_0x25309b[_0xfbf0('0x1c')]['attributes']||null:null,'limit':_0x25309b[_0xfbf0('0x1c')]?_0x25309b['options'][_0xfbf0('0x1e')]||null:null,'include':_0x25309b[_0xfbf0('0x1c')]?_0x25309b[_0xfbf0('0x1c')][_0xfbf0('0x1f')]?_[_0xfbf0('0x20')](_0x25309b[_0xfbf0('0x1c')]['include'],function(_0xdcb2b){return{'model':db[_0xdcb2b[_0xfbf0('0x21')]],'as':_0xdcb2b['as'],'attributes':_0xdcb2b[_0xfbf0('0x22')],'include':_0xdcb2b['include']?_[_0xfbf0('0x20')](_0xdcb2b[_0xfbf0('0x1f')],function(_0x583407){return{'model':db[_0x583407[_0xfbf0('0x21')]],'as':_0x583407['as'],'attributes':_0x583407[_0xfbf0('0x22')],'include':_0x583407[_0xfbf0('0x1f')]?_[_0xfbf0('0x20')](_0x583407[_0xfbf0('0x1f')],function(_0x42ad8c){return{'model':db[_0x42ad8c[_0xfbf0('0x21')]],'as':_0x42ad8c['as'],'attributes':_0x42ad8c[_0xfbf0('0x22')]};}):[]};}):[]};}):[]:[]})[_0xfbf0('0xe')](function(_0x3ddc3f){logger['info'](_0xfbf0('0x19'),_0x25309b);logger[_0xfbf0('0x12')](_0xfbf0('0x19'),_0x25309b,JSON['stringify'](_0x3ddc3f));_0x42f528(_0x3ddc3f);})[_0xfbf0('0x23')](function(_0x5877fc){logger[_0xfbf0('0x15')]('GetVoiceQueueReport',_0x5877fc['message'],_0x25309b);_0x3af91d(_0x15f962[_0xfbf0('0x15')](0x1f4,_0x5877fc['message']));});});};exports[_0xfbf0('0x24')]=function(_0x4a6597){var _0xec2eab=this;return new Promise(function(_0x1fe5a8,_0x4688e3){return db[_0xfbf0('0x1a')][_0xfbf0('0x25')](_0x4a6597[_0xfbf0('0x26')],{'raw':_0x4a6597[_0xfbf0('0x1c')]?_0x4a6597[_0xfbf0('0x1c')][_0xfbf0('0x27')]===undefined?!![]:![]:!![]})['then'](function(_0x480be1){logger[_0xfbf0('0xf')]('CreateVoiceQueueReport',_0x4a6597);logger[_0xfbf0('0x12')](_0xfbf0('0x24'),_0x4a6597,JSON[_0xfbf0('0x14')](_0x480be1));_0x1fe5a8(_0x480be1);})['catch'](function(_0x581448){logger[_0xfbf0('0x15')](_0xfbf0('0x24'),_0x581448[_0xfbf0('0x17')],_0x4a6597);_0x4688e3(_0xec2eab[_0xfbf0('0x15')](0x1f4,_0x581448[_0xfbf0('0x17')]));});});};exports[_0xfbf0('0x28')]=function(_0x249cf4){var _0x3346b1=this;return new Promise(function(_0xe88a,_0x525e8e){return db[_0xfbf0('0x1a')][_0xfbf0('0x29')](_0x249cf4[_0xfbf0('0x26')],{'raw':_0x249cf4[_0xfbf0('0x1c')]?_0x249cf4[_0xfbf0('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x249cf4['options']?_0x249cf4[_0xfbf0('0x1c')][_0xfbf0('0x1d')]||null:null,'attributes':_0x249cf4[_0xfbf0('0x1c')]?_0x249cf4[_0xfbf0('0x1c')][_0xfbf0('0x22')]||null:null,'limit':_0x249cf4[_0xfbf0('0x1c')]?_0x249cf4[_0xfbf0('0x1c')]['limit']||null:null})['then'](function(_0x174e54){logger['info'](_0xfbf0('0x28'),_0x249cf4);logger[_0xfbf0('0x12')](_0xfbf0('0x28'),_0x249cf4,JSON[_0xfbf0('0x14')](_0x174e54));_0xe88a(_0x174e54);})[_0xfbf0('0x23')](function(_0x23cb5b){logger[_0xfbf0('0x15')]('UpdateVoiceQueueReport',_0x23cb5b[_0xfbf0('0x17')],_0x249cf4);_0x525e8e(_0x3346b1[_0xfbf0('0x15')](0x1f4,_0x23cb5b[_0xfbf0('0x17')]));});});}; \ No newline at end of file +var _0x7ef5=['./voiceQueueReport.socket','register','then','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','where','attributes','limit','include','map','model','info','CreateVoiceQueueReport','create','body','raw','UpdateVoiceQueueReport','update','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter'];(function(_0x365d3d,_0x2c1c9e){var _0x2fa91a=function(_0x231e41){while(--_0x231e41){_0x365d3d['push'](_0x365d3d['shift']());}};_0x2fa91a(++_0x2c1c9e);}(_0x7ef5,0x6f));var _0x57ef=function(_0x2f7f8a,_0x2069c1){_0x2f7f8a=_0x2f7f8a-0x0;var _0x5be8d9=_0x7ef5[_0x2f7f8a];return _0x5be8d9;};'use strict';var _=require(_0x57ef('0x0'));var util=require(_0x57ef('0x1'));var moment=require('moment');var BPromise=require(_0x57ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57ef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x57ef('0x4'));var logger=require(_0x57ef('0x5'))(_0x57ef('0x6'));var config=require(_0x57ef('0x7'));var jayson=require(_0x57ef('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x57ef('0x9')]=_[_0x57ef('0xa')](config[_0x57ef('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x57ef('0xb'))(new Redis(config[_0x57ef('0x9')]));require(_0x57ef('0xc'))[_0x57ef('0xd')](socket);function respondWithRpcPromise(_0x5e867e,_0x2f0317,_0x376ef2){return new BPromise(function(_0x23434b,_0x2cea2a){return client['request'](_0x5e867e,_0x376ef2)[_0x57ef('0xe')](function(_0x452216){logger['info'](_0x57ef('0xf'),_0x2f0317,'request\x20sent');logger[_0x57ef('0x10')](_0x57ef('0x11'),_0x2f0317,_0x57ef('0x12'),JSON[_0x57ef('0x13')](_0x452216));if(_0x452216[_0x57ef('0x14')]){if(_0x452216['error'][_0x57ef('0x15')]===0x1f4){logger['error'](_0x57ef('0xf'),_0x2f0317,_0x452216[_0x57ef('0x14')][_0x57ef('0x16')]);return _0x2cea2a(_0x452216['error'][_0x57ef('0x16')]);}logger[_0x57ef('0x14')](_0x57ef('0xf'),_0x2f0317,_0x452216[_0x57ef('0x14')][_0x57ef('0x16')]);return _0x23434b(_0x452216[_0x57ef('0x14')][_0x57ef('0x16')]);}else{logger['info'](_0x57ef('0xf'),_0x2f0317,_0x57ef('0x12'));_0x23434b(_0x452216['result'][_0x57ef('0x16')]);}})[_0x57ef('0x17')](function(_0x5e349e){logger[_0x57ef('0x14')](_0x57ef('0xf'),_0x2f0317,_0x5e349e);_0x2cea2a(_0x5e349e);});});}exports[_0x57ef('0x18')]=function(_0x3465f1){var _0x1b74b3=this;return new Promise(function(_0xac153,_0x249b7d){return db[_0x57ef('0x19')][_0x57ef('0x1a')]({'raw':_0x3465f1[_0x57ef('0x1b')]?_0x3465f1[_0x57ef('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3465f1[_0x57ef('0x1b')]?_0x3465f1['options'][_0x57ef('0x1c')]||null:null,'attributes':_0x3465f1[_0x57ef('0x1b')]?_0x3465f1['options'][_0x57ef('0x1d')]||null:null,'limit':_0x3465f1['options']?_0x3465f1[_0x57ef('0x1b')][_0x57ef('0x1e')]||null:null,'include':_0x3465f1['options']?_0x3465f1[_0x57ef('0x1b')][_0x57ef('0x1f')]?_[_0x57ef('0x20')](_0x3465f1[_0x57ef('0x1b')]['include'],function(_0x2d62ee){return{'model':db[_0x2d62ee['model']],'as':_0x2d62ee['as'],'attributes':_0x2d62ee['attributes'],'include':_0x2d62ee[_0x57ef('0x1f')]?_[_0x57ef('0x20')](_0x2d62ee[_0x57ef('0x1f')],function(_0xa0671c){return{'model':db[_0xa0671c['model']],'as':_0xa0671c['as'],'attributes':_0xa0671c[_0x57ef('0x1d')],'include':_0xa0671c[_0x57ef('0x1f')]?_[_0x57ef('0x20')](_0xa0671c[_0x57ef('0x1f')],function(_0x16ae32){return{'model':db[_0x16ae32[_0x57ef('0x21')]],'as':_0x16ae32['as'],'attributes':_0x16ae32['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x338639){logger[_0x57ef('0x22')](_0x57ef('0x18'),_0x3465f1);logger[_0x57ef('0x10')](_0x57ef('0x18'),_0x3465f1,JSON[_0x57ef('0x13')](_0x338639));_0xac153(_0x338639);})[_0x57ef('0x17')](function(_0x331e1c){logger['error']('GetVoiceQueueReport',_0x331e1c[_0x57ef('0x16')],_0x3465f1);_0x249b7d(_0x1b74b3[_0x57ef('0x14')](0x1f4,_0x331e1c['message']));});});};exports[_0x57ef('0x23')]=function(_0x202b1f){var _0x256e99=this;return new Promise(function(_0x4ebfee,_0x5ba802){return db[_0x57ef('0x19')][_0x57ef('0x24')](_0x202b1f[_0x57ef('0x25')],{'raw':_0x202b1f[_0x57ef('0x1b')]?_0x202b1f[_0x57ef('0x1b')][_0x57ef('0x26')]===undefined?!![]:![]:!![]})[_0x57ef('0xe')](function(_0x50bcbc){logger[_0x57ef('0x22')](_0x57ef('0x23'),_0x202b1f);logger[_0x57ef('0x10')](_0x57ef('0x23'),_0x202b1f,JSON['stringify'](_0x50bcbc));_0x4ebfee(_0x50bcbc);})['catch'](function(_0x47cc8b){logger[_0x57ef('0x14')](_0x57ef('0x23'),_0x47cc8b[_0x57ef('0x16')],_0x202b1f);_0x5ba802(_0x256e99['error'](0x1f4,_0x47cc8b['message']));});});};exports[_0x57ef('0x27')]=function(_0xd28129){var _0x1177ea=this;return new Promise(function(_0x250a3d,_0xc2fd2b){return db[_0x57ef('0x19')][_0x57ef('0x28')](_0xd28129[_0x57ef('0x25')],{'raw':_0xd28129[_0x57ef('0x1b')]?_0xd28129[_0x57ef('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd28129[_0x57ef('0x1b')]?_0xd28129[_0x57ef('0x1b')]['where']||null:null,'attributes':_0xd28129[_0x57ef('0x1b')]?_0xd28129[_0x57ef('0x1b')][_0x57ef('0x1d')]||null:null,'limit':_0xd28129['options']?_0xd28129[_0x57ef('0x1b')]['limit']||null:null})[_0x57ef('0xe')](function(_0x4f2bb3){logger['info'](_0x57ef('0x27'),_0xd28129);logger['debug'](_0x57ef('0x27'),_0xd28129,JSON['stringify'](_0x4f2bb3));_0x250a3d(_0x4f2bb3);})[_0x57ef('0x17')](function(_0x18dcde){logger[_0x57ef('0x14')]('UpdateVoiceQueueReport',_0x18dcde[_0x57ef('0x16')],_0xd28129);_0xc2fd2b(_0x1177ea[_0x57ef('0x14')](0x1f4,_0x18dcde[_0x57ef('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index b0624bc..0089a5f 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 _0x92bc=['remove','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x92bc,0x106));var _0xc92b=function(_0x449b64,_0x3271a5){_0x449b64=_0x449b64-0x0;var _0x2b2ad3=_0x92bc[_0x449b64];return _0x2b2ad3;};'use strict';var VoiceQueueReportEvents=require(_0xc92b('0x0'));var events=[_0xc92b('0x1'),_0xc92b('0x2'),'update'];function createListener(_0x559048,_0x43af72){return function(_0x28bc3a){_0x43af72[_0xc92b('0x3')](_0x559048,_0x28bc3a);};}function removeListener(_0x1d7812,_0x56c979){return function(){VoiceQueueReportEvents[_0xc92b('0x4')](_0x1d7812,_0x56c979);};}exports[_0xc92b('0x5')]=function(_0x3dbb56){for(var _0x51b6e7=0x0,_0x5ed947=events[_0xc92b('0x6')];_0x51b6e7<_0x5ed947;_0x51b6e7++){var _0x439122=events[_0x51b6e7];var _0x498856=createListener(_0xc92b('0x7')+_0x439122,_0x3dbb56);VoiceQueueReportEvents['on'](_0x439122,_0x498856);}}; \ No newline at end of file +var _0xf7ed=['removeListener','register','length','save','remove','emit'];(function(_0x46dfc3,_0x18fee2){var _0xe7e7e6=function(_0x6912bc){while(--_0x6912bc){_0x46dfc3['push'](_0x46dfc3['shift']());}};_0xe7e7e6(++_0x18fee2);}(_0xf7ed,0x1a1));var _0xdf7e=function(_0x38ff3c,_0x53525b){_0x38ff3c=_0x38ff3c-0x0;var _0x339faa=_0xf7ed[_0x38ff3c];return _0x339faa;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xdf7e('0x0'),_0xdf7e('0x1'),'update'];function createListener(_0x32ad1d,_0x1be898){return function(_0x4d5830){_0x1be898[_0xdf7e('0x2')](_0x32ad1d,_0x4d5830);};}function removeListener(_0x1447a3,_0x5107c9){return function(){VoiceQueueReportEvents[_0xdf7e('0x3')](_0x1447a3,_0x5107c9);};}exports[_0xdf7e('0x4')]=function(_0x1c4f77){for(var _0x51db33=0x0,_0x1d5a38=events[_0xdf7e('0x5')];_0x51db33<_0x1d5a38;_0x51db33++){var _0x196ef8=events[_0x51db33];var _0x202750=createListener('voiceQueueReport:'+_0x196ef8,_0x1c4f77);VoiceQueueReportEvents['on'](_0x196ef8,_0x202750);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 6c68ebe..c3ee2c1 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 _0xc72f=['create','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','post'];(function(_0x26a3fe,_0x1a5471){var _0x33f708=function(_0x468152){while(--_0x468152){_0x26a3fe['push'](_0x26a3fe['shift']());}};_0x33f708(++_0x1a5471);}(_0xc72f,0x9e));var _0xfc72=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xc72f[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0xfc72('0x0'));var util=require(_0xfc72('0x1'));var path=require(_0xfc72('0x2'));var timeout=require(_0xfc72('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfc72('0x4'));var auth=require(_0xfc72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfc72('0x6'));var controller=require('./voiceQueuesLog.controller');router[_0xfc72('0x7')]('/',auth[_0xfc72('0x8')](),controller[_0xfc72('0x9')]);router[_0xfc72('0x7')](_0xfc72('0xa'),auth[_0xfc72('0x8')](),controller['show']);router[_0xfc72('0xb')]('/',auth[_0xfc72('0x8')](),controller[_0xfc72('0xc')]);router[_0xfc72('0xd')]('/:id',auth[_0xfc72('0x8')](),controller[_0xfc72('0xe')]);router[_0xfc72('0xf')](_0xfc72('0xa'),auth[_0xfc72('0x8')](),controller['destroy']);module[_0xfc72('0x10')]=router; \ No newline at end of file +var _0x5b89=['./voiceQueuesLog.controller','get','/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','multer','util','connect-timeout','../../config/environment'];(function(_0x19dc6f,_0x3893ca){var _0x371a5d=function(_0x41d57c){while(--_0x41d57c){_0x19dc6f['push'](_0x19dc6f['shift']());}};_0x371a5d(++_0x3893ca);}(_0x5b89,0xdd));var _0x95b8=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x5b89[_0x31a37b];return _0x49ae16;};'use strict';var multer=require(_0x95b8('0x0'));var util=require(_0x95b8('0x1'));var path=require('path');var timeout=require(_0x95b8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x95b8('0x3'));var controller=require(_0x95b8('0x4'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x95b8('0x5')](_0x95b8('0x6'),auth['isAuthenticated'](),controller[_0x95b8('0x7')]);router[_0x95b8('0x8')]('/',auth[_0x95b8('0x9')](),controller[_0x95b8('0xa')]);router[_0x95b8('0xb')](_0x95b8('0x6'),auth[_0x95b8('0x9')](),controller['update']);router[_0x95b8('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x95b8('0xd')]);module[_0x95b8('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index ee1dead..464a64c 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 _0x1d34=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','exports'];(function(_0xfa4e06,_0x375478){var _0x3e783c=function(_0x449263){while(--_0x449263){_0xfa4e06['push'](_0xfa4e06['shift']());}};_0x3e783c(++_0x375478);}(_0x1d34,0xb2));var _0x41d3=function(_0xc5a08a,_0x58def8){_0xc5a08a=_0xc5a08a-0x0;var _0x4f4054=_0x1d34[_0xc5a08a];return _0x4f4054;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x41d3('0x0'));module[_0x41d3('0x1')]={'time':{'type':Sequelize[_0x41d3('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x41d3('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x41d3('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x41d3('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x41d3('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x41d3('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x41d3('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x41d3('0x3')],'allowNull':![],'defaultValue':moment()[_0x41d3('0x4')](_0x41d3('0x5'))}}; \ No newline at end of file +var _0x64f5=['format','YYYY-MM-DD\x20HH:mm:ss','exports','STRING'];(function(_0x461e47,_0x501133){var _0x5bb17d=function(_0x58a2ed){while(--_0x58a2ed){_0x461e47['push'](_0x461e47['shift']());}};_0x5bb17d(++_0x501133);}(_0x64f5,0x1ee));var _0x564f=function(_0x2fba34,_0x1fc5a9){_0x2fba34=_0x2fba34-0x0;var _0x5ba25e=_0x64f5[_0x2fba34];return _0x5ba25e;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x564f('0x0')]={'time':{'type':Sequelize[_0x564f('0x1')]},'callid':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x564f('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x564f('0x2')](_0x564f('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 786ff7b..b54d191 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 _0x8a4d=['apply','reject','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','VoiceQueuesLog','include','rows','catch','keys','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0xcf550d,_0x4f614e){var _0x5d6087=function(_0x55951a){while(--_0x55951a){_0xcf550d['push'](_0xcf550d['shift']());}};_0x5d6087(++_0x4f614e);}(_0x8a4d,0xfa));var _0xd8a4=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x8a4d[_0x20fb02];return _0x24a33e;};'use strict';var emlformat=require(_0xd8a4('0x0'));var rimraf=require(_0xd8a4('0x1'));var zipdir=require(_0xd8a4('0x2'));var jsonpatch=require(_0xd8a4('0x3'));var rp=require(_0xd8a4('0x4'));var moment=require(_0xd8a4('0x5'));var BPromise=require(_0xd8a4('0x6'));var Mustache=require('mustache');var util=require(_0xd8a4('0x7'));var path=require(_0xd8a4('0x8'));var sox=require('sox');var csv=require(_0xd8a4('0x9'));var ejs=require(_0xd8a4('0xa'));var fs=require('fs');var fs_extra=require(_0xd8a4('0xb'));var _=require('lodash');var squel=require(_0xd8a4('0xc'));var crypto=require('crypto');var jsforce=require(_0xd8a4('0xd'));var deskjs=require(_0xd8a4('0xe'));var toCsv=require(_0xd8a4('0x9'));var querystring=require(_0xd8a4('0xf'));var Papa=require(_0xd8a4('0x10'));var Redis=require(_0xd8a4('0x11'));var authService=require(_0xd8a4('0x12'));var qs=require(_0xd8a4('0x13'));var as=require(_0xd8a4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd8a4('0x15'));var utils=require(_0xd8a4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd8a4('0x17'));var db=require(_0xd8a4('0x18'))['db'];function respondWithStatusCode(_0x40f59b,_0x138b6c){_0x138b6c=_0x138b6c||0xcc;return function(_0x19841b){if(_0x19841b){return _0x40f59b[_0xd8a4('0x19')](_0x138b6c);}return _0x40f59b[_0xd8a4('0x1a')](_0x138b6c)[_0xd8a4('0x1b')]();};}function respondWithResult(_0x2de0dc,_0x5c75f3){_0x5c75f3=_0x5c75f3||0xc8;return function(_0x54d2b8){if(_0x54d2b8){return _0x2de0dc[_0xd8a4('0x1a')](_0x5c75f3)[_0xd8a4('0x1c')](_0x54d2b8);}};}function respondWithFilteredResult(_0x25fb95,_0x26a7ae){return function(_0x43bf65){if(_0x43bf65){var _0x200b0e=typeof _0x26a7ae[_0xd8a4('0x1d')]===_0xd8a4('0x1e')&&typeof _0x26a7ae[_0xd8a4('0x1f')]==='undefined';var _0x5f7fb0=_0x43bf65[_0xd8a4('0x20')];var _0xb9f3d6=_0x200b0e?0x0:_0x26a7ae['offset'];var _0x55edbf=_0x200b0e?_0x43bf65[_0xd8a4('0x20')]:_0x26a7ae[_0xd8a4('0x1d')]+_0x26a7ae['limit'];var _0x1bcbc7;if(_0x55edbf>=_0x5f7fb0){_0x55edbf=_0x5f7fb0;_0x1bcbc7=0xc8;}else{_0x1bcbc7=0xce;}_0x25fb95[_0xd8a4('0x1a')](_0x1bcbc7);return _0x25fb95['set'](_0xd8a4('0x21'),_0xb9f3d6+'-'+_0x55edbf+'/'+_0x5f7fb0)[_0xd8a4('0x1c')](_0x43bf65);}return null;};}function patchUpdates(_0x5e9f57){return function(_0x5d81cf){try{jsonpatch[_0xd8a4('0x22')](_0x5d81cf,_0x5e9f57,!![]);}catch(_0x5d680c){return BPromise[_0xd8a4('0x23')](_0x5d680c);}return _0x5d81cf['save']();};}function saveUpdates(_0x666ff3,_0x421029){return function(_0x1aca1e){if(_0x1aca1e){return _0x1aca1e['update'](_0x666ff3)[_0xd8a4('0x24')](function(_0x361114){return _0x361114;});}return null;};}function removeEntity(_0x47c6fa,_0x35368e){return function(_0x13f53a){if(_0x13f53a){return _0x13f53a[_0xd8a4('0x25')]()[_0xd8a4('0x24')](function(){_0x47c6fa[_0xd8a4('0x1a')](0xcc)[_0xd8a4('0x1b')]();});}};}function handleEntityNotFound(_0x1585bd,_0x56dfe3){return function(_0x3ad770){if(!_0x3ad770){_0x1585bd[_0xd8a4('0x19')](0x194);}return _0x3ad770;};}function handleError(_0x209fb5,_0x228d49){_0x228d49=_0x228d49||0x1f4;return function(_0x70f3e9){logger['error'](_0x70f3e9[_0xd8a4('0x26')]);if(_0x70f3e9[_0xd8a4('0x27')]){delete _0x70f3e9[_0xd8a4('0x27')];}_0x209fb5[_0xd8a4('0x1a')](_0x228d49)[_0xd8a4('0x28')](_0x70f3e9);};}exports[_0xd8a4('0x29')]=function(_0x376a88,_0x4a493c){var _0x296772={},_0x43852a={},_0xeadb0b={'count':0x0,'rows':[]};var _0x2d678b=_[_0xd8a4('0x2a')](db['VoiceQueuesLog'][_0xd8a4('0x2b')],function(_0xbacd22){return{'name':_0xbacd22[_0xd8a4('0x2c')],'type':_0xbacd22['type'][_0xd8a4('0x2d')]};});_0x43852a[_0xd8a4('0x2e')]=_[_0xd8a4('0x2a')](_0x2d678b,_0xd8a4('0x27'));_0x43852a[_0xd8a4('0x2f')]=_['keys'](_0x376a88[_0xd8a4('0x2f')]);_0x43852a[_0xd8a4('0x30')]=_[_0xd8a4('0x31')](_0x43852a[_0xd8a4('0x2e')],_0x43852a[_0xd8a4('0x2f')]);_0x296772[_0xd8a4('0x32')]=_[_0xd8a4('0x31')](_0x43852a[_0xd8a4('0x2e')],qs['fields'](_0x376a88[_0xd8a4('0x2f')][_0xd8a4('0x33')]));_0x296772['attributes']=_0x296772['attributes'][_0xd8a4('0x34')]?_0x296772[_0xd8a4('0x32')]:_0x43852a[_0xd8a4('0x2e')];if(!_0x376a88[_0xd8a4('0x2f')]['hasOwnProperty']('nolimit')){_0x296772[_0xd8a4('0x1f')]=qs[_0xd8a4('0x1f')](_0x376a88[_0xd8a4('0x2f')][_0xd8a4('0x1f')]);_0x296772[_0xd8a4('0x1d')]=qs[_0xd8a4('0x1d')](_0x376a88[_0xd8a4('0x2f')][_0xd8a4('0x1d')]);}_0x296772[_0xd8a4('0x35')]=qs['sort'](_0x376a88['query'][_0xd8a4('0x36')]);_0x296772[_0xd8a4('0x37')]=qs[_0xd8a4('0x30')](_[_0xd8a4('0x38')](_0x376a88[_0xd8a4('0x2f')],_0x43852a['filters']),_0x2d678b);if(_0x376a88[_0xd8a4('0x2f')]['filter']){_0x296772[_0xd8a4('0x37')]=_[_0xd8a4('0x39')](_0x296772['where'],{'$or':_[_0xd8a4('0x2a')](_0x2d678b,function(_0x3f1671){if(_0x3f1671[_0xd8a4('0x3a')]!==_0xd8a4('0x3b')){var _0x1f05a1={};_0x1f05a1[_0x3f1671['name']]={'$like':'%'+_0x376a88['query'][_0xd8a4('0x3c')]+'%'};return _0x1f05a1;}})});}_0x296772=_['merge']({},_0x296772,_0x376a88['options']);var _0x2a1b05={'where':_0x296772[_0xd8a4('0x37')]};return db[_0xd8a4('0x3d')]['count'](_0x2a1b05)[_0xd8a4('0x24')](function(_0x32865a){_0xeadb0b['count']=_0x32865a;if(_0x376a88[_0xd8a4('0x2f')]['includeAll']){_0x296772[_0xd8a4('0x3e')]=[{'all':!![]}];}return db[_0xd8a4('0x3d')]['findAll'](_0x296772);})['then'](function(_0x5e38e5){_0xeadb0b[_0xd8a4('0x3f')]=_0x5e38e5;return _0xeadb0b;})[_0xd8a4('0x24')](respondWithFilteredResult(_0x4a493c,_0x296772))[_0xd8a4('0x40')](handleError(_0x4a493c,null));};exports['show']=function(_0x453dfb,_0x1fd57a){var _0x11fd51={'raw':!![],'where':{'id':_0x453dfb['params']['id']}},_0x58a09b={};_0x58a09b[_0xd8a4('0x2e')]=_[_0xd8a4('0x41')](db[_0xd8a4('0x3d')]['rawAttributes']);_0x58a09b[_0xd8a4('0x2f')]=_[_0xd8a4('0x41')](_0x453dfb['query']);_0x58a09b[_0xd8a4('0x30')]=_[_0xd8a4('0x31')](_0x58a09b[_0xd8a4('0x2e')],_0x58a09b[_0xd8a4('0x2f')]);_0x11fd51[_0xd8a4('0x32')]=_['intersection'](_0x58a09b[_0xd8a4('0x2e')],qs[_0xd8a4('0x33')](_0x453dfb[_0xd8a4('0x2f')]['fields']));_0x11fd51[_0xd8a4('0x32')]=_0x11fd51[_0xd8a4('0x32')]['length']?_0x11fd51[_0xd8a4('0x32')]:_0x58a09b[_0xd8a4('0x2e')];if(_0x453dfb['query']['includeAll']){_0x11fd51[_0xd8a4('0x3e')]=[{'all':!![]}];}_0x11fd51=_[_0xd8a4('0x39')]({},_0x11fd51,_0x453dfb[_0xd8a4('0x42')]);return db[_0xd8a4('0x3d')][_0xd8a4('0x43')](_0x11fd51)[_0xd8a4('0x24')](handleEntityNotFound(_0x1fd57a,null))[_0xd8a4('0x24')](respondWithResult(_0x1fd57a,null))['catch'](handleError(_0x1fd57a,null));};exports[_0xd8a4('0x44')]=function(_0x5b84f2,_0x154d40){return db[_0xd8a4('0x3d')][_0xd8a4('0x44')](_0x5b84f2[_0xd8a4('0x45')],{})[_0xd8a4('0x24')](respondWithResult(_0x154d40,0xc9))[_0xd8a4('0x40')](handleError(_0x154d40,null));};exports['update']=function(_0x492a43,_0x295d7e){if(_0x492a43[_0xd8a4('0x45')]['id']){delete _0x492a43[_0xd8a4('0x45')]['id'];}return db[_0xd8a4('0x3d')][_0xd8a4('0x43')]({'where':{'id':_0x492a43[_0xd8a4('0x46')]['id']}})[_0xd8a4('0x24')](handleEntityNotFound(_0x295d7e,null))[_0xd8a4('0x24')](saveUpdates(_0x492a43[_0xd8a4('0x45')],null))[_0xd8a4('0x24')](respondWithResult(_0x295d7e,null))[_0xd8a4('0x40')](handleError(_0x295d7e,null));};exports[_0xd8a4('0x25')]=function(_0xbf8d32,_0x25082b){return db['VoiceQueuesLog']['find']({'where':{'id':_0xbf8d32[_0xd8a4('0x46')]['id']}})[_0xd8a4('0x24')](handleEntityNotFound(_0x25082b,null))[_0xd8a4('0x24')](removeEntity(_0x25082b,null))[_0xd8a4('0x40')](handleError(_0x25082b,null));}; \ No newline at end of file +var _0x3474=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','name','index','map','VoiceQueuesLog','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment'];(function(_0x732d54,_0x5708f4){var _0x55e766=function(_0x1e9b2f){while(--_0x1e9b2f){_0x732d54['push'](_0x732d54['shift']());}};_0x55e766(++_0x5708f4);}(_0x3474,0x88));var _0x4347=function(_0x469616,_0x4d260c){_0x469616=_0x469616-0x0;var _0x5b9e5b=_0x3474[_0x469616];return _0x5b9e5b;};'use strict';var emlformat=require(_0x4347('0x0'));var rimraf=require(_0x4347('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4347('0x2'));var rp=require('request-promise');var moment=require(_0x4347('0x3'));var BPromise=require(_0x4347('0x4'));var Mustache=require('mustache');var util=require(_0x4347('0x5'));var path=require(_0x4347('0x6'));var sox=require('sox');var csv=require(_0x4347('0x7'));var ejs=require(_0x4347('0x8'));var fs=require('fs');var fs_extra=require(_0x4347('0x9'));var _=require(_0x4347('0xa'));var squel=require(_0x4347('0xb'));var crypto=require(_0x4347('0xc'));var jsforce=require(_0x4347('0xd'));var deskjs=require(_0x4347('0xe'));var toCsv=require(_0x4347('0x7'));var querystring=require('querystring');var Papa=require(_0x4347('0xf'));var Redis=require(_0x4347('0x10'));var authService=require(_0x4347('0x11'));var qs=require(_0x4347('0x12'));var as=require(_0x4347('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4347('0x14'))(_0x4347('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4347('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c7506,_0x5e8b24){_0x5e8b24=_0x5e8b24||0xcc;return function(_0xb026a4){if(_0xb026a4){return _0x2c7506[_0x4347('0x17')](_0x5e8b24);}return _0x2c7506[_0x4347('0x18')](_0x5e8b24)['end']();};}function respondWithResult(_0x4b3a03,_0x20cb01){_0x20cb01=_0x20cb01||0xc8;return function(_0x5b4ea7){if(_0x5b4ea7){return _0x4b3a03[_0x4347('0x18')](_0x20cb01)[_0x4347('0x19')](_0x5b4ea7);}};}function respondWithFilteredResult(_0x41d113,_0x27ed5c){return function(_0x259cf5){if(_0x259cf5){var _0x29b85c=typeof _0x27ed5c[_0x4347('0x1a')]==='undefined'&&typeof _0x27ed5c[_0x4347('0x1b')]===_0x4347('0x1c');var _0x19c03e=_0x259cf5[_0x4347('0x1d')];var _0x15c32d=_0x29b85c?0x0:_0x27ed5c[_0x4347('0x1a')];var _0x120e5c=_0x29b85c?_0x259cf5[_0x4347('0x1d')]:_0x27ed5c[_0x4347('0x1a')]+_0x27ed5c[_0x4347('0x1b')];var _0x24b9f6;if(_0x120e5c>=_0x19c03e){_0x120e5c=_0x19c03e;_0x24b9f6=0xc8;}else{_0x24b9f6=0xce;}_0x41d113[_0x4347('0x18')](_0x24b9f6);return _0x41d113[_0x4347('0x1e')](_0x4347('0x1f'),_0x15c32d+'-'+_0x120e5c+'/'+_0x19c03e)['json'](_0x259cf5);}return null;};}function patchUpdates(_0x4dc6ff){return function(_0x506f5b){try{jsonpatch[_0x4347('0x20')](_0x506f5b,_0x4dc6ff,!![]);}catch(_0x44191d){return BPromise[_0x4347('0x21')](_0x44191d);}return _0x506f5b['save']();};}function saveUpdates(_0x1681a0,_0x1baeae){return function(_0x5bdb36){if(_0x5bdb36){return _0x5bdb36[_0x4347('0x22')](_0x1681a0)[_0x4347('0x23')](function(_0x5ab655){return _0x5ab655;});}return null;};}function removeEntity(_0x4701fb,_0x16fb29){return function(_0x3a61d3){if(_0x3a61d3){return _0x3a61d3[_0x4347('0x24')]()[_0x4347('0x23')](function(){_0x4701fb[_0x4347('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33562f,_0x20ec5c){return function(_0x5ee3c1){if(!_0x5ee3c1){_0x33562f['sendStatus'](0x194);}return _0x5ee3c1;};}function handleError(_0x2d94ef,_0x37d804){_0x37d804=_0x37d804||0x1f4;return function(_0x3057f1){logger['error'](_0x3057f1['stack']);if(_0x3057f1[_0x4347('0x25')]){delete _0x3057f1[_0x4347('0x25')];}_0x2d94ef[_0x4347('0x18')](_0x37d804)['send'](_0x3057f1);};}exports[_0x4347('0x26')]=function(_0x723aa,_0x424215){var _0x5743a7={},_0x521edc={},_0x369f44={'count':0x0,'rows':[]};var _0x24acea=_[_0x4347('0x27')](db[_0x4347('0x28')][_0x4347('0x29')],function(_0x5a1a0e){return{'name':_0x5a1a0e['fieldName'],'type':_0x5a1a0e['type'][_0x4347('0x2a')]};});_0x521edc[_0x4347('0x2b')]=_[_0x4347('0x27')](_0x24acea,_0x4347('0x25'));_0x521edc[_0x4347('0x2c')]=_[_0x4347('0x2d')](_0x723aa[_0x4347('0x2c')]);_0x521edc[_0x4347('0x2e')]=_[_0x4347('0x2f')](_0x521edc[_0x4347('0x2b')],_0x521edc[_0x4347('0x2c')]);_0x5743a7[_0x4347('0x30')]=_[_0x4347('0x2f')](_0x521edc['model'],qs['fields'](_0x723aa[_0x4347('0x2c')][_0x4347('0x31')]));_0x5743a7[_0x4347('0x30')]=_0x5743a7[_0x4347('0x30')][_0x4347('0x32')]?_0x5743a7[_0x4347('0x30')]:_0x521edc[_0x4347('0x2b')];if(!_0x723aa[_0x4347('0x2c')][_0x4347('0x33')](_0x4347('0x34'))){_0x5743a7[_0x4347('0x1b')]=qs[_0x4347('0x1b')](_0x723aa[_0x4347('0x2c')][_0x4347('0x1b')]);_0x5743a7[_0x4347('0x1a')]=qs['offset'](_0x723aa['query'][_0x4347('0x1a')]);}_0x5743a7[_0x4347('0x35')]=qs['sort'](_0x723aa[_0x4347('0x2c')][_0x4347('0x36')]);_0x5743a7[_0x4347('0x37')]=qs[_0x4347('0x2e')](_['pick'](_0x723aa[_0x4347('0x2c')],_0x521edc[_0x4347('0x2e')]),_0x24acea);if(_0x723aa[_0x4347('0x2c')][_0x4347('0x38')]){_0x5743a7[_0x4347('0x37')]=_[_0x4347('0x39')](_0x5743a7['where'],{'$or':_[_0x4347('0x27')](_0x24acea,function(_0x385c3a){if(_0x385c3a[_0x4347('0x3a')]!=='VIRTUAL'){var _0x40f1b3={};_0x40f1b3[_0x385c3a[_0x4347('0x25')]]={'$like':'%'+_0x723aa[_0x4347('0x2c')][_0x4347('0x38')]+'%'};return _0x40f1b3;}})});}_0x5743a7=_[_0x4347('0x39')]({},_0x5743a7,_0x723aa[_0x4347('0x3b')]);var _0x22efbe={'where':_0x5743a7[_0x4347('0x37')]};return db['VoiceQueuesLog'][_0x4347('0x1d')](_0x22efbe)[_0x4347('0x23')](function(_0x2d7392){_0x369f44[_0x4347('0x1d')]=_0x2d7392;if(_0x723aa[_0x4347('0x2c')][_0x4347('0x3c')]){_0x5743a7[_0x4347('0x3d')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x4347('0x3e')](_0x5743a7);})['then'](function(_0x37588e){_0x369f44[_0x4347('0x3f')]=_0x37588e;return _0x369f44;})[_0x4347('0x23')](respondWithFilteredResult(_0x424215,_0x5743a7))['catch'](handleError(_0x424215,null));};exports[_0x4347('0x40')]=function(_0x17318c,_0x3fc96d){var _0x1431e0={'raw':!![],'where':{'id':_0x17318c[_0x4347('0x41')]['id']}},_0x2b313e={};_0x2b313e[_0x4347('0x2b')]=_[_0x4347('0x2d')](db[_0x4347('0x28')][_0x4347('0x29')]);_0x2b313e[_0x4347('0x2c')]=_['keys'](_0x17318c[_0x4347('0x2c')]);_0x2b313e[_0x4347('0x2e')]=_[_0x4347('0x2f')](_0x2b313e['model'],_0x2b313e[_0x4347('0x2c')]);_0x1431e0['attributes']=_['intersection'](_0x2b313e[_0x4347('0x2b')],qs[_0x4347('0x31')](_0x17318c['query'][_0x4347('0x31')]));_0x1431e0['attributes']=_0x1431e0['attributes'][_0x4347('0x32')]?_0x1431e0[_0x4347('0x30')]:_0x2b313e[_0x4347('0x2b')];if(_0x17318c['query'][_0x4347('0x3c')]){_0x1431e0[_0x4347('0x3d')]=[{'all':!![]}];}_0x1431e0=_[_0x4347('0x39')]({},_0x1431e0,_0x17318c[_0x4347('0x3b')]);return db[_0x4347('0x28')][_0x4347('0x42')](_0x1431e0)[_0x4347('0x23')](handleEntityNotFound(_0x3fc96d,null))['then'](respondWithResult(_0x3fc96d,null))[_0x4347('0x43')](handleError(_0x3fc96d,null));};exports[_0x4347('0x44')]=function(_0x292918,_0x27534e){return db[_0x4347('0x28')]['create'](_0x292918['body'],{})['then'](respondWithResult(_0x27534e,0xc9))[_0x4347('0x43')](handleError(_0x27534e,null));};exports['update']=function(_0x28da57,_0x33f33e){if(_0x28da57[_0x4347('0x45')]['id']){delete _0x28da57[_0x4347('0x45')]['id'];}return db[_0x4347('0x28')]['find']({'where':{'id':_0x28da57[_0x4347('0x41')]['id']}})['then'](handleEntityNotFound(_0x33f33e,null))[_0x4347('0x23')](saveUpdates(_0x28da57['body'],null))[_0x4347('0x23')](respondWithResult(_0x33f33e,null))[_0x4347('0x43')](handleError(_0x33f33e,null));};exports[_0x4347('0x24')]=function(_0x23a773,_0x587a22){return db['VoiceQueuesLog']['find']({'where':{'id':_0x23a773[_0x4347('0x41')]['id']}})[_0x4347('0x23')](handleEntityNotFound(_0x587a22,null))[_0x4347('0x23')](removeEntity(_0x587a22,null))[_0x4347('0x43')](handleError(_0x587a22,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index c107004..2baf42f 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 _0xc305=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','api','moment'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0xc305,0xcf));var _0x5c30=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0xc305[_0x190ff6];return _0x5356d2;};'use strict';var _=require(_0x5c30('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5c30('0x1'));var moment=require(_0x5c30('0x2'));var BPromise=require('bluebird');var rp=require(_0x5c30('0x3'));var fs=require('fs');var path=require(_0x5c30('0x4'));var rimraf=require(_0x5c30('0x5'));var config=require(_0x5c30('0x6'));var attributes=require(_0x5c30('0x7'));module['exports']=function(_0x311c48,_0x295b5b){return _0x311c48[_0x5c30('0x8')](_0x5c30('0x9'),attributes,{'tableName':_0x5c30('0xa'),'paranoid':![],'indexes':[{'name':_0x5c30('0xb'),'fields':[_0x5c30('0xc'),_0x5c30('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc16b=['exports','define','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./voiceQueuesLog.attributes'];(function(_0xa8d40a,_0x174d0f){var _0x5bd5a6=function(_0x53b363){while(--_0x53b363){_0xa8d40a['push'](_0xa8d40a['shift']());}};_0x5bd5a6(++_0x174d0f);}(_0xc16b,0x76));var _0xbc16=function(_0x19330a,_0x54a607){_0x19330a=_0x19330a-0x0;var _0x206113=_0xc16b[_0x19330a];return _0x206113;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var logger=require(_0xbc16('0x2'))(_0xbc16('0x3'));var moment=require(_0xbc16('0x4'));var BPromise=require(_0xbc16('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbc16('0x6'));var attributes=require(_0xbc16('0x7'));module[_0xbc16('0x8')]=function(_0x20ac2f,_0x1c345b){return _0x20ac2f[_0xbc16('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xbc16('0xa'),'paranoid':![],'indexes':[{'name':_0xbc16('0xb'),'fields':[_0xbc16('0xc'),_0xbc16('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 7f613ee..f9d0622 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 _0xeb32=['error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeb32,0x169));var _0x2eb3=function(_0x1b4b78,_0x54c2ef){_0x1b4b78=_0x1b4b78-0x0;var _0x332dfb=_0xeb32[_0x1b4b78];return _0x332dfb;};'use strict';var _=require(_0x2eb3('0x0'));var util=require(_0x2eb3('0x1'));var moment=require(_0x2eb3('0x2'));var BPromise=require(_0x2eb3('0x3'));var rs=require(_0x2eb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2eb3('0x5'));var logger=require(_0x2eb3('0x6'))('rpc');var config=require(_0x2eb3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2eb3('0x8')][_0x2eb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d2843,_0x10c208,_0x4371cf){return new BPromise(function(_0x157a2d,_0x1c0002){return client['request'](_0x5d2843,_0x4371cf)[_0x2eb3('0xa')](function(_0x5b0446){logger[_0x2eb3('0xb')](_0x2eb3('0xc'),_0x10c208,_0x2eb3('0xd'));logger[_0x2eb3('0xe')](_0x2eb3('0xf'),_0x10c208,_0x2eb3('0xd'),JSON[_0x2eb3('0x10')](_0x5b0446));if(_0x5b0446[_0x2eb3('0x11')]){if(_0x5b0446[_0x2eb3('0x11')][_0x2eb3('0x12')]===0x1f4){logger['error'](_0x2eb3('0xc'),_0x10c208,_0x5b0446['error']['message']);return _0x1c0002(_0x5b0446['error'][_0x2eb3('0x13')]);}logger[_0x2eb3('0x11')](_0x2eb3('0xc'),_0x10c208,_0x5b0446[_0x2eb3('0x11')][_0x2eb3('0x13')]);return _0x157a2d(_0x5b0446['error'][_0x2eb3('0x13')]);}else{logger[_0x2eb3('0xb')](_0x2eb3('0xc'),_0x10c208,_0x2eb3('0xd'));_0x157a2d(_0x5b0446[_0x2eb3('0x14')]['message']);}})['catch'](function(_0x324f5b){logger['error'](_0x2eb3('0xc'),_0x10c208,_0x324f5b);_0x1c0002(_0x324f5b);});});} \ No newline at end of file +var _0xa391=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x273174,_0x20d967){var _0x4fbc80=function(_0x529f32){while(--_0x529f32){_0x273174['push'](_0x273174['shift']());}};_0x4fbc80(++_0x20d967);}(_0xa391,0x1ee));var _0x1a39=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa391[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x1a39('0x0'));var moment=require('moment');var BPromise=require(_0x1a39('0x1'));var rs=require(_0x1a39('0x2'));var fs=require('fs');var Redis=require(_0x1a39('0x3'));var db=require(_0x1a39('0x4'))['db'];var utils=require(_0x1a39('0x5'));var logger=require('../../config/logger')(_0x1a39('0x6'));var config=require(_0x1a39('0x7'));var jayson=require(_0x1a39('0x8'));var client=jayson[_0x1a39('0x9')][_0x1a39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a94b8,_0x2ec880,_0x532449){return new BPromise(function(_0x382591,_0x5e02d2){return client[_0x1a39('0xb')](_0x1a94b8,_0x532449)[_0x1a39('0xc')](function(_0x48aba4){logger[_0x1a39('0xd')](_0x1a39('0xe'),_0x2ec880,_0x1a39('0xf'));logger[_0x1a39('0x10')](_0x1a39('0x11'),_0x2ec880,'request\x20sent',JSON['stringify'](_0x48aba4));if(_0x48aba4[_0x1a39('0x12')]){if(_0x48aba4[_0x1a39('0x12')]['code']===0x1f4){logger[_0x1a39('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2ec880,_0x48aba4['error'][_0x1a39('0x13')]);return _0x5e02d2(_0x48aba4[_0x1a39('0x12')][_0x1a39('0x13')]);}logger[_0x1a39('0x12')](_0x1a39('0xe'),_0x2ec880,_0x48aba4['error'][_0x1a39('0x13')]);return _0x382591(_0x48aba4[_0x1a39('0x12')][_0x1a39('0x13')]);}else{logger['info'](_0x1a39('0xe'),_0x2ec880,'request\x20sent');_0x382591(_0x48aba4[_0x1a39('0x14')][_0x1a39('0x13')]);}})[_0x1a39('0x15')](function(_0x373db2){logger[_0x1a39('0x12')](_0x1a39('0xe'),_0x2ec880,_0x373db2);_0x5e02d2(_0x373db2);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 879fe3d..7000ac8 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 _0x738b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','/:id','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','delete','destroy','exports','multer','path'];(function(_0x2ed502,_0x3b7fab){var _0x191886=function(_0x446add){while(--_0x446add){_0x2ed502['push'](_0x2ed502['shift']());}};_0x191886(++_0x3b7fab);}(_0x738b,0x1ec));var _0xb738=function(_0x10a169,_0x5cc213){_0x10a169=_0x10a169-0x0;var _0x24925d=_0x738b[_0x10a169];return _0x24925d;};'use strict';var multer=require(_0xb738('0x0'));var util=require('util');var path=require(_0xb738('0x1'));var timeout=require(_0xb738('0x2'));var express=require(_0xb738('0x3'));var router=express[_0xb738('0x4')]();var fs_extra=require(_0xb738('0x5'));var auth=require(_0xb738('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb738('0x7'));var controller=require(_0xb738('0x8'));router[_0xb738('0x9')]('/',auth[_0xb738('0xa')](),controller[_0xb738('0xb')]);router[_0xb738('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xb738('0xc')]);router[_0xb738('0x9')](_0xb738('0xd'),auth[_0xb738('0xa')](),controller['show']);router['get'](_0xb738('0xe'),auth[_0xb738('0xa')](),controller[_0xb738('0xf')]);router['get'](_0xb738('0x10'),controller[_0xb738('0x11')]);router[_0xb738('0x9')](_0xb738('0x12'),auth[_0xb738('0xa')](),controller[_0xb738('0x13')]);router[_0xb738('0x14')]('/',auth[_0xb738('0xa')](),controller[_0xb738('0x15')]);router[_0xb738('0x14')](_0xb738('0x12'),auth['isAuthenticated'](),controller[_0xb738('0x16')]);router['put'](_0xb738('0xd'),auth[_0xb738('0xa')](),controller['update']);router[_0xb738('0x17')]('/:id',auth[_0xb738('0xa')](),controller[_0xb738('0x18')]);module[_0xb738('0x19')]=router; \ No newline at end of file +var _0xdaf6=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceRecording.controller','isAuthenticated','index','describe','/:id','show','get','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe'];(function(_0x30670f,_0x4b5b68){var _0x52a57f=function(_0x1740b3){while(--_0x1740b3){_0x30670f['push'](_0x30670f['shift']());}};_0x52a57f(++_0x4b5b68);}(_0xdaf6,0x8d));var _0x6daf=function(_0x42db3e,_0x4e0e33){_0x42db3e=_0x42db3e-0x0;var _0x1c86e2=_0xdaf6[_0x42db3e];return _0x1c86e2;};'use strict';var multer=require(_0x6daf('0x0'));var util=require(_0x6daf('0x1'));var path=require(_0x6daf('0x2'));var timeout=require(_0x6daf('0x3'));var express=require(_0x6daf('0x4'));var router=express['Router']();var fs_extra=require(_0x6daf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6daf('0x6'));var config=require(_0x6daf('0x7'));var controller=require(_0x6daf('0x8'));router['get']('/',auth[_0x6daf('0x9')](),controller[_0x6daf('0xa')]);router['get']('/describe',auth[_0x6daf('0x9')](),controller[_0x6daf('0xb')]);router['get'](_0x6daf('0xc'),auth[_0x6daf('0x9')](),controller[_0x6daf('0xd')]);router[_0x6daf('0xe')](_0x6daf('0xf'),auth[_0x6daf('0x9')](),controller[_0x6daf('0x10')]);router['get'](_0x6daf('0x11'),controller[_0x6daf('0x12')]);router[_0x6daf('0xe')](_0x6daf('0x13'),auth[_0x6daf('0x9')](),controller[_0x6daf('0x14')]);router[_0x6daf('0x15')]('/',auth[_0x6daf('0x9')](),controller[_0x6daf('0x16')]);router['post']('/:id/transcribe',auth['isAuthenticated'](),controller['runTranscribe']);router[_0x6daf('0x17')](_0x6daf('0xc'),auth[_0x6daf('0x9')](),controller[_0x6daf('0x18')]);router['delete'](_0x6daf('0xc'),auth[_0x6daf('0x9')](),controller[_0x6daf('0x19')]);module[_0x6daf('0x1a')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 0f16469..9e6c727 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(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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 bd6a02d..adba955 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 _0x734b=['includeAll','include','findAll','rows','catch','params','find','create','body','describe','download','uniqueid','value','existsSync','decryptFile','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','../../components/encryptor','sequelize','MD5','token','$and','push','%s.cypher','secrets','ValidationError','destroy','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','filters','pick','where','merge','VIRTUAL','filter','options','VoiceRecording'];(function(_0xddf202,_0x1890fa){var _0x1a95da=function(_0x3e9943){while(--_0x3e9943){_0xddf202['push'](_0xddf202['shift']());}};_0x1a95da(++_0x1890fa);}(_0x734b,0x19a));var _0xb734=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x734b[_0x119d5a];return _0x15bff4;};'use strict';var emlformat=require(_0xb734('0x0'));var rimraf=require(_0xb734('0x1'));var zipdir=require(_0xb734('0x2'));var jsonpatch=require(_0xb734('0x3'));var rp=require(_0xb734('0x4'));var moment=require('moment');var BPromise=require(_0xb734('0x5'));var Mustache=require('mustache');var util=require(_0xb734('0x6'));var path=require(_0xb734('0x7'));var sox=require(_0xb734('0x8'));var csv=require('to-csv');var ejs=require(_0xb734('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb734('0xa'));var squel=require(_0xb734('0xb'));var crypto=require(_0xb734('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb734('0xd'));var toCsv=require(_0xb734('0xe'));var querystring=require(_0xb734('0xf'));var Papa=require(_0xb734('0x10'));var AWS=require(_0xb734('0x11'));var uuidv4=require('uuid/v4');var Redis=require(_0xb734('0x12'));var authService=require(_0xb734('0x13'));var qs=require(_0xb734('0x14'));var as=require(_0xb734('0x15'));var hardwareService=require(_0xb734('0x16'));var logger=require(_0xb734('0x17'))(_0xb734('0x18'));var utils=require('../../config/utils');var config=require(_0xb734('0x19'));var licenseUtil=require(_0xb734('0x1a'));var db=require(_0xb734('0x1b'))['db'];function respondWithStatusCode(_0x19bc8c,_0x234e83){_0x234e83=_0x234e83||0xcc;return function(_0x178dd2){if(_0x178dd2){return _0x19bc8c[_0xb734('0x1c')](_0x234e83);}return _0x19bc8c['status'](_0x234e83)[_0xb734('0x1d')]();};}function respondWithResult(_0x351059,_0x392906){_0x392906=_0x392906||0xc8;return function(_0x35fdc2){if(_0x35fdc2){return _0x351059[_0xb734('0x1e')](_0x392906)[_0xb734('0x1f')](_0x35fdc2);}};}function respondWithFilteredResult(_0x4943e8,_0x461018){return function(_0x2e139a){if(_0x2e139a){var _0x254484=typeof _0x461018[_0xb734('0x20')]===_0xb734('0x21')&&typeof _0x461018[_0xb734('0x22')]===_0xb734('0x21');var _0x2b666e=_0x2e139a[_0xb734('0x23')];var _0x3b3826=_0x254484?0x0:_0x461018[_0xb734('0x20')];var _0x26e48e=_0x254484?_0x2e139a['count']:_0x461018[_0xb734('0x20')]+_0x461018[_0xb734('0x22')];var _0x204a31;if(_0x26e48e>=_0x2b666e){_0x26e48e=_0x2b666e;_0x204a31=0xc8;}else{_0x204a31=0xce;}_0x4943e8['status'](_0x204a31);return _0x4943e8[_0xb734('0x24')](_0xb734('0x25'),_0x3b3826+'-'+_0x26e48e+'/'+_0x2b666e)['json'](_0x2e139a);}return null;};}function patchUpdates(_0x7f7729){return function(_0x3298a1){try{jsonpatch[_0xb734('0x26')](_0x3298a1,_0x7f7729,!![]);}catch(_0x1e36de){return BPromise[_0xb734('0x27')](_0x1e36de);}return _0x3298a1[_0xb734('0x28')]();};}function saveUpdates(_0x1a1b3a,_0x2f11b7){return function(_0x51ebab){if(_0x51ebab){return _0x51ebab[_0xb734('0x29')](_0x1a1b3a)[_0xb734('0x2a')](function(_0x1992f3){return _0x1992f3;});}return null;};}function removeEntity(_0x799972,_0x3fdeaa){return function(_0x37b5d5){if(_0x37b5d5){return _0x37b5d5['destroy']()[_0xb734('0x2a')](function(){_0x799972[_0xb734('0x1e')](0xcc)[_0xb734('0x1d')]();});}};}function handleEntityNotFound(_0xb593ae,_0x110674){return function(_0x14f135){if(!_0x14f135){_0xb593ae[_0xb734('0x1c')](0x194);}return _0x14f135;};}function handleError(_0x1df281,_0x171e7a){_0x171e7a=_0x171e7a||0x1f4;return function(_0x1f81ba){logger[_0xb734('0x2b')](_0x1f81ba[_0xb734('0x2c')]);if(_0x1f81ba[_0xb734('0x2d')]){delete _0x1f81ba[_0xb734('0x2d')];}_0x1df281[_0xb734('0x1e')](_0x171e7a)['send'](_0x1f81ba);};}exports['index']=function(_0x385eaa,_0x15e52e){var _0x2dec78={},_0x1ae34f={},_0x1d2953={'count':0x0,'rows':[]};var _0x33cbca=_[_0xb734('0x2e')](db['VoiceRecording'][_0xb734('0x2f')],function(_0x3d66ef){return{'name':_0x3d66ef[_0xb734('0x30')],'type':_0x3d66ef[_0xb734('0x31')][_0xb734('0x32')]};});_0x1ae34f[_0xb734('0x33')]=_[_0xb734('0x34')](_[_0xb734('0x2e')](_0x33cbca,_0xb734('0x2d')),[_0xb734('0x35')]);_0x1ae34f[_0xb734('0x36')]=_[_0xb734('0x37')](_0x385eaa['query']);_0x1ae34f['filters']=_[_0xb734('0x38')](_0x1ae34f[_0xb734('0x33')],_0x1ae34f[_0xb734('0x36')]);_0x2dec78[_0xb734('0x39')]=_[_0xb734('0x38')](_0x1ae34f[_0xb734('0x33')],qs[_0xb734('0x3a')](_0x385eaa[_0xb734('0x36')][_0xb734('0x3a')]));_0x2dec78[_0xb734('0x39')]=_0x2dec78[_0xb734('0x39')][_0xb734('0x3b')]?_0x2dec78[_0xb734('0x39')]:_0x1ae34f[_0xb734('0x33')];if(!_0x385eaa[_0xb734('0x36')][_0xb734('0x3c')]('nolimit')){_0x2dec78['limit']=qs[_0xb734('0x22')](_0x385eaa['query']['limit']);_0x2dec78[_0xb734('0x20')]=qs['offset'](_0x385eaa[_0xb734('0x36')][_0xb734('0x20')]);}_0x2dec78[_0xb734('0x3d')]=qs['sort'](_0x385eaa[_0xb734('0x36')]['sort']);_0x2dec78['where']=qs[_0xb734('0x3e')](_[_0xb734('0x3f')](_0x385eaa[_0xb734('0x36')],_0x1ae34f['filters']),_0x33cbca);if(_0x385eaa[_0xb734('0x36')]['filter']){_0x2dec78[_0xb734('0x40')]=_[_0xb734('0x41')](_0x2dec78[_0xb734('0x40')],{'$or':_[_0xb734('0x2e')](_0x33cbca,function(_0x316c67){if(_0x316c67[_0xb734('0x31')]!==_0xb734('0x42')){var _0x4f26e7={};_0x4f26e7[_0x316c67['name']]={'$like':'%'+_0x385eaa[_0xb734('0x36')][_0xb734('0x43')]+'%'};return _0x4f26e7;}})});}_0x2dec78=_['merge']({},_0x2dec78,_0x385eaa[_0xb734('0x44')]);var _0x48ee64={'where':_0x2dec78[_0xb734('0x40')]};return db[_0xb734('0x45')][_0xb734('0x23')](_0x48ee64)[_0xb734('0x2a')](function(_0x1902dc){_0x1d2953['count']=_0x1902dc;if(_0x385eaa[_0xb734('0x36')][_0xb734('0x46')]){_0x2dec78[_0xb734('0x47')]=[{'all':!![]}];}return db[_0xb734('0x45')][_0xb734('0x48')](_0x2dec78);})[_0xb734('0x2a')](function(_0x5b74f6){_0x1d2953[_0xb734('0x49')]=_0x5b74f6;return _0x1d2953;})[_0xb734('0x2a')](respondWithFilteredResult(_0x15e52e,_0x2dec78))[_0xb734('0x4a')](handleError(_0x15e52e,null));};exports['show']=function(_0xc31f3,_0x4af545){var _0x408a18={'raw':![],'where':{'id':_0xc31f3[_0xb734('0x4b')]['id']}},_0x1f3c21={};_0x1f3c21[_0xb734('0x33')]=_[_0xb734('0x37')](db['VoiceRecording']['rawAttributes']);_0x1f3c21[_0xb734('0x36')]=_['keys'](_0xc31f3[_0xb734('0x36')]);_0x1f3c21[_0xb734('0x3e')]=_[_0xb734('0x38')](_0x1f3c21['model'],_0x1f3c21[_0xb734('0x36')]);_0x408a18['attributes']=_[_0xb734('0x38')](_0x1f3c21[_0xb734('0x33')],qs[_0xb734('0x3a')](_0xc31f3['query'][_0xb734('0x3a')]));_0x408a18['attributes']=_0x408a18[_0xb734('0x39')][_0xb734('0x3b')]?_0x408a18[_0xb734('0x39')]:_0x1f3c21['model'];if(_0xc31f3[_0xb734('0x36')]['includeAll']){_0x408a18['include']=[{'all':!![]}];}_0x408a18=_['merge']({},_0x408a18,_0xc31f3['options']);return db[_0xb734('0x45')][_0xb734('0x4c')](_0x408a18)[_0xb734('0x2a')](handleEntityNotFound(_0x4af545,null))['then'](respondWithResult(_0x4af545,null))[_0xb734('0x4a')](handleError(_0x4af545,null));};exports[_0xb734('0x4d')]=function(_0x29876f,_0x518fb4){return db['VoiceRecording'][_0xb734('0x4d')](_0x29876f['body'],{})[_0xb734('0x2a')](respondWithResult(_0x518fb4,0xc9))[_0xb734('0x4a')](handleError(_0x518fb4,null));};exports[_0xb734('0x29')]=function(_0x1d40c7,_0x1bc0bb){if(_0x1d40c7[_0xb734('0x4e')]['id']){delete _0x1d40c7[_0xb734('0x4e')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x1d40c7[_0xb734('0x4b')]['id']}})[_0xb734('0x2a')](handleEntityNotFound(_0x1bc0bb,null))[_0xb734('0x2a')](saveUpdates(_0x1d40c7[_0xb734('0x4e')],null))[_0xb734('0x2a')](respondWithResult(_0x1bc0bb,null))[_0xb734('0x4a')](handleError(_0x1bc0bb,null));};exports['describe']=function(_0x28f705,_0xb71846){return db['VoiceRecording'][_0xb734('0x4f')]()[_0xb734('0x2a')](respondWithResult(_0xb71846,null))['catch'](handleError(_0xb71846,null));};exports[_0xb734('0x50')]=function(_0x394761,_0x3406ce,_0x8fd78c){var _0x69f881=require('../../components/encryptor');var _0x5d9a7f=![];var _0x324ca7={};if(_0x394761['query'][_0xb734('0x31')]&&_0x394761[_0xb734('0x36')][_0xb734('0x31')]===_0xb734('0x51')){_0x324ca7[_0xb734('0x51')]=_0x394761[_0xb734('0x4b')]['id'];}else{_0x324ca7['id']=_0x394761[_0xb734('0x4b')]['id'];}return db[_0xb734('0x45')]['find']({'where':_0x324ca7,'attributes':['id',_0xb734('0x52')],'raw':!![]})[_0xb734('0x2a')](handleEntityNotFound(_0x3406ce,null))[_0xb734('0x2a')](function(_0x2db497){if(_0x2db497){var _0x595bef=_0x2db497[_0xb734('0x52')];var _0x19b47a=util[_0xb734('0x35')]('%s.cypher',_0x595bef);if(fs[_0xb734('0x53')](_0x19b47a)){_0x5d9a7f=!![];return _0x69f881[_0xb734('0x54')](_0x19b47a,_0x595bef,config['secrets'][_0xb734('0x55')])['then'](function(){return _0x2db497;});}return _0x2db497;}})[_0xb734('0x2a')](function(_0x5eb806){if(_0x5eb806){var _0x1ff017=_0x5eb806[_0xb734('0x52')];if(!fs[_0xb734('0x53')](_0x1ff017)){throw new db[(_0xb734('0x56'))]['ValidationError'](_0xb734('0x57'));}if(_0x5eb806[_0xb734('0x58')]){return _0x3406ce[_0xb734('0x50')](_0x1ff017,_0x5eb806['filename']+path[_0xb734('0x59')](_0x1ff017),function(){if(_0x5d9a7f){fs[_0xb734('0x5a')](_0x1ff017);}});}else{return _0x3406ce[_0xb734('0x50')](_0x1ff017,function(_0x2d55a7){if(_0x5d9a7f){fs[_0xb734('0x5a')](_0x1ff017);}});}}})[_0xb734('0x4a')](function(_0x111bf8){if(_0x111bf8[_0xb734('0x5b')]===_0xb734('0x57')){_0x3406ce[_0xb734('0x1e')](0x194)[_0xb734('0x5c')](_0xb734('0x5d'));}else{return handleError(_0x3406ce,null);}});};exports['downloads']=function(_0x182a3f,_0x1c3918,_0x8dfb19){var _0x3b5128=require(_0xb734('0x5e'));var _0x4cc96a=![];var _0x54725f={'$and':[db['sequelize'][_0xb734('0x40')](db[_0xb734('0x5f')]['fn'](_0xb734('0x60'),db[_0xb734('0x5f')]['col'](_0xb734('0x51'))),_0x182a3f[_0xb734('0x36')][_0xb734('0x61')])]};if(_0x182a3f['query'][_0xb734('0x31')]&&_0x182a3f[_0xb734('0x36')][_0xb734('0x31')]===_0xb734('0x51')){_0x54725f[_0xb734('0x62')][_0xb734('0x63')]({'uniqueid':_0x182a3f[_0xb734('0x4b')]['id']});}else{_0x54725f[_0xb734('0x62')]['push']({'id':_0x182a3f[_0xb734('0x4b')]['id']});}return db[_0xb734('0x45')][_0xb734('0x4c')]({'where':_0x54725f,'attributes':['id',_0xb734('0x52')],'raw':!![]})[_0xb734('0x2a')](handleEntityNotFound(_0x1c3918,null))[_0xb734('0x2a')](function(_0x4fc674){if(_0x4fc674){var _0x32cb2b=util[_0xb734('0x35')](_0xb734('0x64'),_0x4fc674[_0xb734('0x52')]);if(fs[_0xb734('0x53')](_0x32cb2b)){_0x4cc96a=!![];return _0x3b5128['decryptFile'](_0x32cb2b,_0x4fc674[_0xb734('0x52')],config[_0xb734('0x65')][_0xb734('0x55')])[_0xb734('0x2a')](function(){return _0x4fc674;});}return _0x4fc674;}})[_0xb734('0x2a')](function(_0xd8d0a7){if(_0xd8d0a7){if(!fs[_0xb734('0x53')](_0xd8d0a7[_0xb734('0x52')])){throw new db[(_0xb734('0x56'))][(_0xb734('0x66'))](_0xb734('0x57'));}if(_0xd8d0a7[_0xb734('0x58')]){return _0x1c3918['download'](_0xd8d0a7['value'],_0xd8d0a7['filename']+path[_0xb734('0x59')](_0xd8d0a7['value']),function(){if(_0x4cc96a){fs[_0xb734('0x5a')](_0xd8d0a7['value']);}});}else{return _0x1c3918['download'](_0xd8d0a7[_0xb734('0x52')],function(_0x28a76a){if(_0x4cc96a){fs[_0xb734('0x5a')](_0xd8d0a7['value']);}});}}})[_0xb734('0x4a')](handleError(_0x1c3918,null));};exports[_0xb734('0x67')]=function(_0x1d03a5,_0x3404b3){return db[_0xb734('0x45')][_0xb734('0x4c')]({'where':{'id':_0x1d03a5[_0xb734('0x4b')]['id']}})[_0xb734('0x2a')](function(_0x2bdbe8){if(_[_0xb734('0x68')](_0x2bdbe8)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2bdbe8;})[_0xb734('0x2a')](function(_0x3bef58){var _0x491ba2=_0x3bef58[_0xb734('0x52')];logger[_0xb734('0x69')](_0xb734('0x6a'),_0x491ba2);if(!_[_0xb734('0x68')](_0x3bef58[_0xb734('0x52')])&&fs[_0xb734('0x53')](_0x491ba2)){logger[_0xb734('0x69')](_0xb734('0x6b')+_0x491ba2+_0xb734('0x6c'));fs[_0xb734('0x6d')](_0x491ba2);}_0x491ba2=_0x491ba2+_0xb734('0x6e');if(!_['isNil'](_0x3bef58[_0xb734('0x52')])&&fs[_0xb734('0x53')](_0x491ba2)){logger[_0xb734('0x69')](_0xb734('0x6b')+_0x491ba2+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x491ba2);}return _0x3bef58;})[_0xb734('0x2a')](function(_0x4a42b7){if(!_0x4a42b7)throw new InternalError();return _0x4a42b7[_0xb734('0x67')]();})['then'](function(){_0x3404b3[_0xb734('0x1e')](0xcc)[_0xb734('0x1d')]();})[_0xb734('0x4a')](handleError(_0x3404b3,null));};function getBucketslist(_0x1ae29c,_0x2fa5fb,_0x903424){return new Promise(function(_0x2ece06,_0x11778d){var _0x483d33=new AWS['S3']({'accessKeyId':_0x2fa5fb,'secretAccessKey':_0x1ae29c,'region':_0x903424});_0x483d33[_0xb734('0x6f')]({},function(_0x20f586,_0xbbfc51){if(_0x20f586){return _0x11778d(_0x20f586);}else{return _0x2ece06(_0xbbfc51);}});});}function createBucket(_0x3101ea,_0x25865f,_0x3d648d,_0x7d1142){return new Promise(function(_0x5b760b,_0x5555b3){var _0x10bb88=new AWS['S3']({'accessKeyId':_0x25865f,'secretAccessKey':_0x3101ea,'region':_0x3d648d});_0x10bb88['createBucket']({'Bucket':_0x7d1142},function(_0x57acb3,_0x93f6a5){if(_0x57acb3){return _0x5555b3(_0x57acb3);}else{return _0x5b760b(_0x93f6a5);}});});}function uploadFile(_0x185278,_0x24c14d,_0x4050a8,_0x4dfe7a,_0x51125c,_0x4ec7ca){return new Promise(function(_0x5b1586,_0x39a908){var _0x3b82e0=new AWS['S3']({'accessKeyId':_0x24c14d,'secretAccessKey':_0x185278,'region':_0x4050a8});_0x3b82e0[_0xb734('0x70')]({'Bucket':_0x4dfe7a,'Key':_0x51125c,'Body':_0x4ec7ca},function(_0xdc215a,_0x5569fa){if(_0xdc215a){return _0x39a908(_0xdc215a);}else{return _0x5b1586(_0x5569fa);}});});}function startTranscribe(_0xf07cf,_0x4c6cf6,_0x1c57d0,_0xe3c660,_0x3e9d58,_0x3add67){return new Promise(function(_0x33ccac,_0x2c1906){var _0x1b1153=new AWS[(_0xb734('0x71'))]({'accessKeyId':_0x4c6cf6,'secretAccessKey':_0xf07cf,'region':_0x1c57d0});_0x1b1153[_0xb734('0x72')]({'TranscriptionJobName':_0xe3c660,'LanguageCode':_0x3e9d58,'Media':{'MediaFileUri':_0x3add67}},function(_0x5921f8,_0x7a67bf){if(_0x5921f8){return _0x2c1906(_0x5921f8);}else{return _0x33ccac(_0x7a67bf);}});});}function transcribe(_0x1716be,_0x5de059,_0x47cecc,_0x41134c,_0xd337a7,_0x2d790b,_0x8cf0f){return new Promise(function(_0x39758c,_0x21acdc){var _0x2a1a15={};logger[_0xb734('0x69')](util['format'](_0xb734('0x73'),_0x1716be,_0xd337a7));return uploadFile(_0x5de059,_0x47cecc,_0x41134c,_0xd337a7,path[_0xb734('0x74')](_0x2d790b),fs[_0xb734('0x75')](_0x2d790b))[_0xb734('0x2a')](function(_0x452463){logger[_0xb734('0x69')](util[_0xb734('0x35')](_0xb734('0x76'),_0x1716be,_0xd337a7,_0x452463['Location']));_0x2a1a15['bucket']=_0x452463['Bucket'];_0x2a1a15[_0xb734('0x77')]=_0x452463[_0xb734('0x78')];logger[_0xb734('0x69')](util[_0xb734('0x35')](_0xb734('0x79'),_0x1716be));return startTranscribe(_0x5de059,_0x47cecc,_0x41134c,uuidv4(),_0x8cf0f,_0x452463[_0xb734('0x78')]);})[_0xb734('0x2a')](function(_0x42f468){logger[_0xb734('0x69')](util[_0xb734('0x35')](_0xb734('0x7a'),_0x1716be,_0x42f468[_0xb734('0x7b')][_0xb734('0x7c')]));_0x2a1a15[_0xb734('0x7d')]=_0x42f468[_0xb734('0x7b')][_0xb734('0x7c')];_0x2a1a15[_0xb734('0x7e')]=_0x42f468['TranscriptionJob'][_0xb734('0x7f')];return _0x39758c(_0x2a1a15);})[_0xb734('0x4a')](function(_0x3b3ed3){return _0x21acdc(_0x3b3ed3);});});}exports[_0xb734('0x80')]=function(_0x503618,_0x1b1405,_0x28a8a8){var _0x3b8910;var _0x2e6056;var _0x15e23a;var _0x21b887=require(_0xb734('0x5e'));return db[_0xb734('0x45')][_0xb734('0x81')]({'where':{'id':_0x503618[_0xb734('0x4b')]['id']}})[_0xb734('0x2a')](function(_0x5c2a0b){if(_0x5c2a0b){var _0x1f7b64=util['format']('%s.cypher',_0x5c2a0b[_0xb734('0x52')]);if(fs['existsSync'](_0x1f7b64)){cypher=!![];return _0x21b887['decryptFile'](_0x1f7b64,_0x5c2a0b[_0xb734('0x52')],config['secrets'][_0xb734('0x55')])[_0xb734('0x2a')](function(){return _0x5c2a0b;});}return _0x5c2a0b;}})[_0xb734('0x2a')](function(_0x437f47){if(!_0x437f47){throw new db[(_0xb734('0x56'))][(_0xb734('0x66'))](_0xb734('0x82'));}_0x2e6056=_0x437f47;return db[_0xb734('0x83')][_0xb734('0x81')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x1b1405,null))[_0xb734('0x2a')](function(_0x2a341a){if(_0x2a341a){_0x3b8910=_0x2a341a;if(!_0x3b8910[_0xb734('0x84')]||!_0x3b8910[_0xb734('0x85')]||!_0x3b8910[_0xb734('0x86')]||!_0x3b8910[_0xb734('0x87')]||!_0x3b8910['bucket']){throw new db['Sequelize'][(_0xb734('0x66'))](_0xb734('0x88'));}if(_0x503618[_0xb734('0x4e')][_0xb734('0x89')]&&(!_0x3b8910[_0xb734('0x8a')]||!_0x3b8910[_0xb734('0x8b')]||!_0x3b8910[_0xb734('0x8c')]||!_0x3b8910[_0xb734('0x87')]||!_0x3b8910[_0xb734('0x8d')])){throw new db['Sequelize']['ValidationError'](_0xb734('0x8e'));}return db[_0xb734('0x8f')][_0xb734('0x81')]({'where':{'id':_0x3b8910[_0xb734('0x85')]}});}})['then'](function(_0x228f2d){if(!_0x228f2d){throw new db[(_0xb734('0x56'))][(_0xb734('0x66'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x228f2d['data1']||!_0x228f2d[_0xb734('0x90')]){throw new db[(_0xb734('0x56'))]['ValidationError'](_0xb734('0x91'));}_0x15e23a=_0x228f2d;return getBucketslist(_0x15e23a[_0xb734('0x92')],_0x15e23a[_0xb734('0x90')],_0x3b8910[_0xb734('0x86')]);})[_0xb734('0x2a')](function(_0xe6ebc7){if(_0xe6ebc7&&_0xe6ebc7[_0xb734('0x93')]){var _0x43b0e5=_[_0xb734('0x4c')](_0xe6ebc7[_0xb734('0x93')],function(_0x5274a1){return _0x5274a1[_0xb734('0x94')]===_0x3b8910[_0xb734('0x8d')];});if(!_0x43b0e5){logger[_0xb734('0x69')](util[_0xb734('0x35')](_0xb734('0x95'),_0x503618[_0xb734('0x4b')]['id'],_0x3b8910[_0xb734('0x8d')]));return createBucket(_0x15e23a[_0xb734('0x92')],_0x15e23a[_0xb734('0x90')],_0x3b8910[_0xb734('0x86')],_0x3b8910['bucket']);}logger['info'](util[_0xb734('0x35')](_0xb734('0x96'),_0x503618[_0xb734('0x4b')]['id'],_0x3b8910['bucket']));return;}})[_0xb734('0x2a')](function(_0x5d22b5){if(_0x2e6056[_0xb734('0x7e')]===_0xb734('0x97')){return transcribe(_0x503618['params']['id'],_0x15e23a[_0xb734('0x92')],_0x15e23a[_0xb734('0x90')],_0x3b8910[_0xb734('0x86')],_0x3b8910[_0xb734('0x8d')],_0x2e6056[_0xb734('0x52')],_0x3b8910[_0xb734('0x87')]);}else{logger[_0xb734('0x69')](util[_0xb734('0x35')](_0xb734('0x98'),_0x503618[_0xb734('0x4b')]['id']));return{'transcribeStatus':_0xb734('0x99')};}})[_0xb734('0x2a')](function(_0x218a97){if(_0x218a97){_0x218a97[_0xb734('0x9a')]=_0x503618[_0xb734('0x4e')][_0xb734('0x89')];return _0x2e6056['updateAttributes'](_0x218a97);}})[_0xb734('0x2a')](respondWithResult(_0x1b1405,null))[_0xb734('0x4a')](handleError(_0x1b1405,null));};function writeFile(_0x40c835,_0x5d0a87){return new Promise(function(_0x113799,_0x1739b4){fs['writeFile'](_0x5d0a87,_0x40c835,function(_0x2590ba,_0x14bafd){if(_0x2590ba){return _0x1739b4(_0x2590ba);}else{return _0x113799(_0x14bafd);}});});}exports[_0xb734('0x9b')]=function(_0x20ecbb,_0x20d3ff,_0x396324){return db[_0xb734('0x45')][_0xb734('0x81')]({'where':{'id':_0x20ecbb[_0xb734('0x4b')]['id']}})[_0xb734('0x2a')](handleEntityNotFound(_0x20d3ff))['then'](function(_0x2ef3e4){if(_0x2ef3e4&&_0x2ef3e4['fileText']){var _0x5107d1=_0x2ef3e4[_0xb734('0x9c')];var _0x313dbd=config['root']+_0xb734('0x9d')+_0x2ef3e4['id']+_0xb734('0x9e');if(fs['existsSync'](_0x313dbd)){return _0x313dbd;}return writeFile(_0x5107d1,_0x313dbd)[_0xb734('0x2a')](function(){return _0x313dbd;});}else{throw new db['Sequelize'][(_0xb734('0x66'))](_0xb734('0x9f'));}})[_0xb734('0x2a')](function(_0x717ee0){return _0x20d3ff[_0xb734('0x50')](_0x717ee0);})[_0xb734('0x4a')](handleError(_0x20d3ff));}; \ No newline at end of file +var _0x7676=['undefined','count','limit','set','Content-Range','json','apply','reject','update','then','error','name','send','index','rawAttributes','model','differenceBy','map','format','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','VoiceRecording','includeAll','rows','catch','show','params','options','find','create','body','describe','download','../../components/encryptor','value','existsSync','decryptFile','recording','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','token','push','$and','%s.cypher','Sequelize','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','readFileSync','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','secrets','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','eml-format','zip-dir','moment','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7676,0x101));var _0x6767=function(_0x3939aa,_0x179f1b){_0x3939aa=_0x3939aa-0x0;var _0x2f921b=_0x7676[_0x3939aa];return _0x2f921b;};'use strict';var emlformat=require(_0x6767('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6767('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6767('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6767('0x3'));var path=require(_0x6767('0x4'));var sox=require(_0x6767('0x5'));var csv=require(_0x6767('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6767('0x7'));var _=require('lodash');var squel=require(_0x6767('0x8'));var crypto=require(_0x6767('0x9'));var jsforce=require(_0x6767('0xa'));var deskjs=require(_0x6767('0xb'));var toCsv=require(_0x6767('0x6'));var querystring=require(_0x6767('0xc'));var Papa=require(_0x6767('0xd'));var AWS=require(_0x6767('0xe'));var uuidv4=require('uuid/v4');var Redis=require(_0x6767('0xf'));var authService=require(_0x6767('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6767('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6767('0x12'))(_0x6767('0x13'));var utils=require(_0x6767('0x14'));var config=require(_0x6767('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6767('0x16'))['db'];function respondWithStatusCode(_0x34cc38,_0x10ca55){_0x10ca55=_0x10ca55||0xcc;return function(_0x306478){if(_0x306478){return _0x34cc38[_0x6767('0x17')](_0x10ca55);}return _0x34cc38[_0x6767('0x18')](_0x10ca55)[_0x6767('0x19')]();};}function respondWithResult(_0x3300cd,_0x164e80){_0x164e80=_0x164e80||0xc8;return function(_0x2d71d7){if(_0x2d71d7){return _0x3300cd[_0x6767('0x18')](_0x164e80)['json'](_0x2d71d7);}};}function respondWithFilteredResult(_0x24d5ea,_0x142725){return function(_0x5ed056){if(_0x5ed056){var _0x39ab8b=typeof _0x142725[_0x6767('0x1a')]===_0x6767('0x1b')&&typeof _0x142725['limit']===_0x6767('0x1b');var _0x4d77fc=_0x5ed056[_0x6767('0x1c')];var _0x509f95=_0x39ab8b?0x0:_0x142725[_0x6767('0x1a')];var _0x15517c=_0x39ab8b?_0x5ed056[_0x6767('0x1c')]:_0x142725[_0x6767('0x1a')]+_0x142725[_0x6767('0x1d')];var _0x236e4d;if(_0x15517c>=_0x4d77fc){_0x15517c=_0x4d77fc;_0x236e4d=0xc8;}else{_0x236e4d=0xce;}_0x24d5ea[_0x6767('0x18')](_0x236e4d);return _0x24d5ea[_0x6767('0x1e')](_0x6767('0x1f'),_0x509f95+'-'+_0x15517c+'/'+_0x4d77fc)[_0x6767('0x20')](_0x5ed056);}return null;};}function patchUpdates(_0x390b97){return function(_0x389a1c){try{jsonpatch[_0x6767('0x21')](_0x389a1c,_0x390b97,!![]);}catch(_0x5e8b52){return BPromise[_0x6767('0x22')](_0x5e8b52);}return _0x389a1c['save']();};}function saveUpdates(_0x5030ad,_0x5b0b09){return function(_0x15b521){if(_0x15b521){return _0x15b521[_0x6767('0x23')](_0x5030ad)[_0x6767('0x24')](function(_0x3d9588){return _0x3d9588;});}return null;};}function removeEntity(_0x5d5918,_0x564b3a){return function(_0x2bf75d){if(_0x2bf75d){return _0x2bf75d['destroy']()[_0x6767('0x24')](function(){_0x5d5918[_0x6767('0x18')](0xcc)[_0x6767('0x19')]();});}};}function handleEntityNotFound(_0x12c5d3,_0x2aecb5){return function(_0x4fa2b8){if(!_0x4fa2b8){_0x12c5d3[_0x6767('0x17')](0x194);}return _0x4fa2b8;};}function handleError(_0x5e72ed,_0x3a3b3c){_0x3a3b3c=_0x3a3b3c||0x1f4;return function(_0x572a16){logger[_0x6767('0x25')](_0x572a16['stack']);if(_0x572a16[_0x6767('0x26')]){delete _0x572a16[_0x6767('0x26')];}_0x5e72ed[_0x6767('0x18')](_0x3a3b3c)[_0x6767('0x27')](_0x572a16);};}exports[_0x6767('0x28')]=function(_0x391c6d,_0x3c2f80){var _0x21bdc7={},_0x3b6edc={},_0x8db029={'count':0x0,'rows':[]};var _0x5827c5=_['map'](db['VoiceRecording'][_0x6767('0x29')],function(_0x1b55fb){return{'name':_0x1b55fb['fieldName'],'type':_0x1b55fb['type']['key']};});_0x3b6edc[_0x6767('0x2a')]=_[_0x6767('0x2b')](_[_0x6767('0x2c')](_0x5827c5,_0x6767('0x26')),[_0x6767('0x2d')]);_0x3b6edc[_0x6767('0x2e')]=_[_0x6767('0x2f')](_0x391c6d[_0x6767('0x2e')]);_0x3b6edc[_0x6767('0x30')]=_[_0x6767('0x31')](_0x3b6edc[_0x6767('0x2a')],_0x3b6edc[_0x6767('0x2e')]);_0x21bdc7[_0x6767('0x32')]=_[_0x6767('0x31')](_0x3b6edc[_0x6767('0x2a')],qs[_0x6767('0x33')](_0x391c6d[_0x6767('0x2e')][_0x6767('0x33')]));_0x21bdc7[_0x6767('0x32')]=_0x21bdc7[_0x6767('0x32')][_0x6767('0x34')]?_0x21bdc7[_0x6767('0x32')]:_0x3b6edc[_0x6767('0x2a')];if(!_0x391c6d['query'][_0x6767('0x35')](_0x6767('0x36'))){_0x21bdc7[_0x6767('0x1d')]=qs[_0x6767('0x1d')](_0x391c6d[_0x6767('0x2e')][_0x6767('0x1d')]);_0x21bdc7[_0x6767('0x1a')]=qs[_0x6767('0x1a')](_0x391c6d[_0x6767('0x2e')]['offset']);}_0x21bdc7['order']=qs[_0x6767('0x37')](_0x391c6d[_0x6767('0x2e')][_0x6767('0x37')]);_0x21bdc7['where']=qs[_0x6767('0x30')](_['pick'](_0x391c6d[_0x6767('0x2e')],_0x3b6edc[_0x6767('0x30')]),_0x5827c5);if(_0x391c6d[_0x6767('0x2e')][_0x6767('0x38')]){_0x21bdc7[_0x6767('0x39')]=_[_0x6767('0x3a')](_0x21bdc7['where'],{'$or':_[_0x6767('0x2c')](_0x5827c5,function(_0x4f5e6e){if(_0x4f5e6e[_0x6767('0x3b')]!==_0x6767('0x3c')){var _0xfac223={};_0xfac223[_0x4f5e6e[_0x6767('0x26')]]={'$like':'%'+_0x391c6d[_0x6767('0x2e')]['filter']+'%'};return _0xfac223;}})});}_0x21bdc7=_['merge']({},_0x21bdc7,_0x391c6d['options']);var _0x377bc9={'where':_0x21bdc7[_0x6767('0x39')]};return db[_0x6767('0x3d')][_0x6767('0x1c')](_0x377bc9)[_0x6767('0x24')](function(_0x2dd84a){_0x8db029['count']=_0x2dd84a;if(_0x391c6d['query'][_0x6767('0x3e')]){_0x21bdc7['include']=[{'all':!![]}];}return db[_0x6767('0x3d')]['findAll'](_0x21bdc7);})[_0x6767('0x24')](function(_0x2c1c10){_0x8db029[_0x6767('0x3f')]=_0x2c1c10;return _0x8db029;})[_0x6767('0x24')](respondWithFilteredResult(_0x3c2f80,_0x21bdc7))[_0x6767('0x40')](handleError(_0x3c2f80,null));};exports[_0x6767('0x41')]=function(_0x105d5a,_0x30d61f){var _0xb8ce87={'raw':![],'where':{'id':_0x105d5a[_0x6767('0x42')]['id']}},_0x531d86={};_0x531d86[_0x6767('0x2a')]=_['keys'](db['VoiceRecording'][_0x6767('0x29')]);_0x531d86[_0x6767('0x2e')]=_[_0x6767('0x2f')](_0x105d5a[_0x6767('0x2e')]);_0x531d86[_0x6767('0x30')]=_[_0x6767('0x31')](_0x531d86[_0x6767('0x2a')],_0x531d86[_0x6767('0x2e')]);_0xb8ce87[_0x6767('0x32')]=_['intersection'](_0x531d86['model'],qs[_0x6767('0x33')](_0x105d5a[_0x6767('0x2e')][_0x6767('0x33')]));_0xb8ce87['attributes']=_0xb8ce87[_0x6767('0x32')][_0x6767('0x34')]?_0xb8ce87['attributes']:_0x531d86[_0x6767('0x2a')];if(_0x105d5a[_0x6767('0x2e')][_0x6767('0x3e')]){_0xb8ce87['include']=[{'all':!![]}];}_0xb8ce87=_[_0x6767('0x3a')]({},_0xb8ce87,_0x105d5a[_0x6767('0x43')]);return db[_0x6767('0x3d')][_0x6767('0x44')](_0xb8ce87)[_0x6767('0x24')](handleEntityNotFound(_0x30d61f,null))[_0x6767('0x24')](respondWithResult(_0x30d61f,null))[_0x6767('0x40')](handleError(_0x30d61f,null));};exports['create']=function(_0xadb5dd,_0x35f3ab){return db[_0x6767('0x3d')][_0x6767('0x45')](_0xadb5dd[_0x6767('0x46')],{})[_0x6767('0x24')](respondWithResult(_0x35f3ab,0xc9))[_0x6767('0x40')](handleError(_0x35f3ab,null));};exports[_0x6767('0x23')]=function(_0xb65599,_0x564e61){if(_0xb65599['body']['id']){delete _0xb65599[_0x6767('0x46')]['id'];}return db[_0x6767('0x3d')][_0x6767('0x44')]({'where':{'id':_0xb65599[_0x6767('0x42')]['id']}})['then'](handleEntityNotFound(_0x564e61,null))[_0x6767('0x24')](saveUpdates(_0xb65599['body'],null))[_0x6767('0x24')](respondWithResult(_0x564e61,null))['catch'](handleError(_0x564e61,null));};exports[_0x6767('0x47')]=function(_0x23ca99,_0x55206a){return db['VoiceRecording'][_0x6767('0x47')]()['then'](respondWithResult(_0x55206a,null))[_0x6767('0x40')](handleError(_0x55206a,null));};exports[_0x6767('0x48')]=function(_0xa6458e,_0x84bd63,_0x5dc09b){var _0x2a47c0=require(_0x6767('0x49'));var _0x55d453=![];var _0x5f4bd1={};if(_0xa6458e[_0x6767('0x2e')][_0x6767('0x3b')]&&_0xa6458e[_0x6767('0x2e')][_0x6767('0x3b')]==='uniqueid'){_0x5f4bd1['uniqueid']=_0xa6458e[_0x6767('0x42')]['id'];}else{_0x5f4bd1['id']=_0xa6458e[_0x6767('0x42')]['id'];}return db[_0x6767('0x3d')][_0x6767('0x44')]({'where':_0x5f4bd1,'attributes':['id','value'],'raw':!![]})[_0x6767('0x24')](handleEntityNotFound(_0x84bd63,null))[_0x6767('0x24')](function(_0x2d72ee){if(_0x2d72ee){var _0x4eb40d=_0x2d72ee[_0x6767('0x4a')];var _0x5a1786=util['format']('%s.cypher',_0x4eb40d);if(fs[_0x6767('0x4b')](_0x5a1786)){_0x55d453=!![];return _0x2a47c0[_0x6767('0x4c')](_0x5a1786,_0x4eb40d,config['secrets'][_0x6767('0x4d')])[_0x6767('0x24')](function(){return _0x2d72ee;});}return _0x2d72ee;}})[_0x6767('0x24')](function(_0x5e5725){if(_0x5e5725){var _0x4f5010=_0x5e5725['value'];if(!fs[_0x6767('0x4b')](_0x4f5010)){throw new db['Sequelize'][(_0x6767('0x4e'))](_0x6767('0x4f'));}if(_0x5e5725[_0x6767('0x50')]){return _0x84bd63[_0x6767('0x48')](_0x4f5010,_0x5e5725[_0x6767('0x50')]+path['extname'](_0x4f5010),function(){if(_0x55d453){fs[_0x6767('0x51')](_0x4f5010);}});}else{return _0x84bd63[_0x6767('0x48')](_0x4f5010,function(_0x304b2f){if(_0x55d453){fs[_0x6767('0x51')](_0x4f5010);}});}}})['catch'](function(_0x1926cd){if(_0x1926cd[_0x6767('0x52')]==='VoiceRecording\x20not\x20found'){_0x84bd63[_0x6767('0x18')](0x194)[_0x6767('0x27')](_0x6767('0x53'));}else{return handleError(_0x84bd63,null);}});};exports[_0x6767('0x54')]=function(_0x5187e3,_0x438bdf,_0x1ea29a){var _0x53c6e9=require(_0x6767('0x49'));var _0x21674d=![];var _0x1b4fe4={'$and':[db['sequelize'][_0x6767('0x39')](db[_0x6767('0x55')]['fn'](_0x6767('0x56'),db[_0x6767('0x55')]['col']('uniqueid')),_0x5187e3[_0x6767('0x2e')][_0x6767('0x57')])]};if(_0x5187e3[_0x6767('0x2e')][_0x6767('0x3b')]&&_0x5187e3[_0x6767('0x2e')][_0x6767('0x3b')]==='uniqueid'){_0x1b4fe4['$and'][_0x6767('0x58')]({'uniqueid':_0x5187e3['params']['id']});}else{_0x1b4fe4[_0x6767('0x59')]['push']({'id':_0x5187e3[_0x6767('0x42')]['id']});}return db[_0x6767('0x3d')][_0x6767('0x44')]({'where':_0x1b4fe4,'attributes':['id','value'],'raw':!![]})[_0x6767('0x24')](handleEntityNotFound(_0x438bdf,null))[_0x6767('0x24')](function(_0x8f1e5f){if(_0x8f1e5f){var _0xcf8bb2=util[_0x6767('0x2d')](_0x6767('0x5a'),_0x8f1e5f[_0x6767('0x4a')]);if(fs[_0x6767('0x4b')](_0xcf8bb2)){_0x21674d=!![];return _0x53c6e9[_0x6767('0x4c')](_0xcf8bb2,_0x8f1e5f[_0x6767('0x4a')],config['secrets']['recording'])[_0x6767('0x24')](function(){return _0x8f1e5f;});}return _0x8f1e5f;}})[_0x6767('0x24')](function(_0x186981){if(_0x186981){if(!fs[_0x6767('0x4b')](_0x186981['value'])){throw new db[(_0x6767('0x5b'))]['ValidationError'](_0x6767('0x4f'));}if(_0x186981[_0x6767('0x50')]){return _0x438bdf[_0x6767('0x48')](_0x186981['value'],_0x186981['filename']+path['extname'](_0x186981[_0x6767('0x4a')]),function(){if(_0x21674d){fs[_0x6767('0x51')](_0x186981['value']);}});}else{return _0x438bdf['download'](_0x186981[_0x6767('0x4a')],function(_0x116802){if(_0x21674d){fs[_0x6767('0x51')](_0x186981[_0x6767('0x4a')]);}});}}})[_0x6767('0x40')](handleError(_0x438bdf,null));};exports[_0x6767('0x5c')]=function(_0x3ae01c,_0x5567c5){return db[_0x6767('0x3d')][_0x6767('0x44')]({'where':{'id':_0x3ae01c[_0x6767('0x42')]['id']}})[_0x6767('0x24')](function(_0x256521){if(_[_0x6767('0x5d')](_0x256521)){throw new ReferenceError(_0x6767('0x5e'));}return _0x256521;})['then'](function(_0x1dc03a){var _0x1a7d01=_0x1dc03a[_0x6767('0x4a')];logger[_0x6767('0x5f')](_0x6767('0x60'),_0x1a7d01);if(!_[_0x6767('0x5d')](_0x1dc03a[_0x6767('0x4a')])&&fs[_0x6767('0x4b')](_0x1a7d01)){logger[_0x6767('0x5f')](_0x6767('0x61')+_0x1a7d01+_0x6767('0x62'));fs[_0x6767('0x63')](_0x1a7d01);}_0x1a7d01=_0x1a7d01+_0x6767('0x64');if(!_[_0x6767('0x5d')](_0x1dc03a['value'])&&fs[_0x6767('0x4b')](_0x1a7d01)){logger['info'](_0x6767('0x61')+_0x1a7d01+_0x6767('0x62'));fs[_0x6767('0x63')](_0x1a7d01);}return _0x1dc03a;})[_0x6767('0x24')](function(_0x54b473){if(!_0x54b473)throw new InternalError();return _0x54b473[_0x6767('0x5c')]();})['then'](function(){_0x5567c5[_0x6767('0x18')](0xcc)[_0x6767('0x19')]();})['catch'](handleError(_0x5567c5,null));};function getBucketslist(_0x39aaa9,_0x36e57e,_0x7496b3){return new Promise(function(_0x490fba,_0x343f9a){var _0x3b33ad=new AWS['S3']({'accessKeyId':_0x36e57e,'secretAccessKey':_0x39aaa9,'region':_0x7496b3});_0x3b33ad[_0x6767('0x65')]({},function(_0x4eda61,_0x3acf53){if(_0x4eda61){return _0x343f9a(_0x4eda61);}else{return _0x490fba(_0x3acf53);}});});}function createBucket(_0x139195,_0x3a41b1,_0x15ffec,_0x26966a){return new Promise(function(_0x406fe5,_0x3c46cf){var _0x5b6f90=new AWS['S3']({'accessKeyId':_0x3a41b1,'secretAccessKey':_0x139195,'region':_0x15ffec});_0x5b6f90[_0x6767('0x66')]({'Bucket':_0x26966a},function(_0x545f5a,_0x443407){if(_0x545f5a){return _0x3c46cf(_0x545f5a);}else{return _0x406fe5(_0x443407);}});});}function uploadFile(_0xaf6de6,_0x4c91a1,_0x4ce6c7,_0x5af634,_0x428e5e,_0x4bda48){return new Promise(function(_0x6738f5,_0x19e4b4){var _0x2f5cd8=new AWS['S3']({'accessKeyId':_0x4c91a1,'secretAccessKey':_0xaf6de6,'region':_0x4ce6c7});_0x2f5cd8['upload']({'Bucket':_0x5af634,'Key':_0x428e5e,'Body':_0x4bda48},function(_0x55bfcd,_0x3b2a22){if(_0x55bfcd){return _0x19e4b4(_0x55bfcd);}else{return _0x6738f5(_0x3b2a22);}});});}function startTranscribe(_0x54614a,_0xf46788,_0xab07a9,_0x8364ed,_0xc13486,_0x2f2eaf){return new Promise(function(_0x5d05cc,_0x4ed5cc){var _0x34e24a=new AWS['TranscribeService']({'accessKeyId':_0xf46788,'secretAccessKey':_0x54614a,'region':_0xab07a9});_0x34e24a[_0x6767('0x67')]({'TranscriptionJobName':_0x8364ed,'LanguageCode':_0xc13486,'Media':{'MediaFileUri':_0x2f2eaf}},function(_0x4050b5,_0xc4f5d4){if(_0x4050b5){return _0x4ed5cc(_0x4050b5);}else{return _0x5d05cc(_0xc4f5d4);}});});}function transcribe(_0x190851,_0x32f51b,_0x4d1da8,_0x37ad69,_0x37df53,_0x2464be,_0x556391){return new Promise(function(_0x4945ad,_0xffb1fb){var _0x39576d={};logger['info'](util[_0x6767('0x2d')](_0x6767('0x68'),_0x190851,_0x37df53));return uploadFile(_0x32f51b,_0x4d1da8,_0x37ad69,_0x37df53,path['basename'](_0x2464be),fs[_0x6767('0x69')](_0x2464be))['then'](function(_0x38b6b4){logger[_0x6767('0x5f')](util[_0x6767('0x2d')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x190851,_0x37df53,_0x38b6b4[_0x6767('0x6a')]));_0x39576d['bucket']=_0x38b6b4[_0x6767('0x6b')];_0x39576d[_0x6767('0x6c')]=_0x38b6b4[_0x6767('0x6a')];logger[_0x6767('0x5f')](util['format'](_0x6767('0x6d'),_0x190851));return startTranscribe(_0x32f51b,_0x4d1da8,_0x37ad69,uuidv4(),_0x556391,_0x38b6b4[_0x6767('0x6a')]);})[_0x6767('0x24')](function(_0x313988){logger[_0x6767('0x5f')](util[_0x6767('0x2d')](_0x6767('0x6e'),_0x190851,_0x313988[_0x6767('0x6f')]['TranscriptionJobName']));_0x39576d['transcribeName']=_0x313988[_0x6767('0x6f')][_0x6767('0x70')];_0x39576d[_0x6767('0x71')]=_0x313988[_0x6767('0x6f')][_0x6767('0x72')];return _0x4945ad(_0x39576d);})['catch'](function(_0x1a6c14){return _0xffb1fb(_0x1a6c14);});});}exports[_0x6767('0x73')]=function(_0x20861b,_0x17eea4,_0x27a267){var _0x199aca;var _0x473d19;var _0xad7c1d;var _0x46e33b=require(_0x6767('0x49'));return db['VoiceRecording'][_0x6767('0x74')]({'where':{'id':_0x20861b[_0x6767('0x42')]['id']}})[_0x6767('0x24')](function(_0x2d1607){if(_0x2d1607){var _0x301f61=util[_0x6767('0x2d')](_0x6767('0x5a'),_0x2d1607[_0x6767('0x4a')]);if(fs[_0x6767('0x4b')](_0x301f61)){cypher=!![];return _0x46e33b[_0x6767('0x4c')](_0x301f61,_0x2d1607[_0x6767('0x4a')],config[_0x6767('0x75')][_0x6767('0x4d')])[_0x6767('0x24')](function(){return _0x2d1607;});}return _0x2d1607;}})['then'](function(_0x12e862){if(!_0x12e862){throw new db[(_0x6767('0x5b'))][(_0x6767('0x4e'))]('Voice\x20Recording\x20not\x20found');}_0x473d19=_0x12e862;return db[_0x6767('0x76')][_0x6767('0x74')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x17eea4,null))[_0x6767('0x24')](function(_0x5c33c8){if(_0x5c33c8){_0x199aca=_0x5c33c8;if(!_0x199aca[_0x6767('0x77')]||!_0x199aca[_0x6767('0x78')]||!_0x199aca[_0x6767('0x79')]||!_0x199aca[_0x6767('0x7a')]||!_0x199aca[_0x6767('0x7b')]){throw new db[(_0x6767('0x5b'))][(_0x6767('0x4e'))](_0x6767('0x7c'));}if(_0x20861b[_0x6767('0x46')][_0x6767('0x7d')]&&(!_0x199aca[_0x6767('0x7e')]||!_0x199aca['sentimentAccountId']||!_0x199aca[_0x6767('0x7f')]||!_0x199aca[_0x6767('0x7a')]||!_0x199aca[_0x6767('0x7b')])){throw new db[(_0x6767('0x5b'))][(_0x6767('0x4e'))](_0x6767('0x80'));}return db['CloudProvider'][_0x6767('0x74')]({'where':{'id':_0x199aca[_0x6767('0x78')]}});}})['then'](function(_0x4e3063){if(!_0x4e3063){throw new db[(_0x6767('0x5b'))][(_0x6767('0x4e'))](_0x6767('0x81'));}if(!_0x4e3063['data1']||!_0x4e3063['data2']){throw new db[(_0x6767('0x5b'))]['ValidationError'](_0x6767('0x82'));}_0xad7c1d=_0x4e3063;return getBucketslist(_0xad7c1d['data1'],_0xad7c1d[_0x6767('0x83')],_0x199aca[_0x6767('0x79')]);})[_0x6767('0x24')](function(_0x243a7b){if(_0x243a7b&&_0x243a7b[_0x6767('0x84')]){var _0x2ce964=_[_0x6767('0x44')](_0x243a7b[_0x6767('0x84')],function(_0x2ef14a){return _0x2ef14a[_0x6767('0x85')]===_0x199aca['bucket'];});if(!_0x2ce964){logger['info'](util[_0x6767('0x2d')](_0x6767('0x86'),_0x20861b[_0x6767('0x42')]['id'],_0x199aca[_0x6767('0x7b')]));return createBucket(_0xad7c1d['data1'],_0xad7c1d['data2'],_0x199aca[_0x6767('0x79')],_0x199aca[_0x6767('0x7b')]);}logger[_0x6767('0x5f')](util[_0x6767('0x2d')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x20861b[_0x6767('0x42')]['id'],_0x199aca[_0x6767('0x7b')]));return;}})[_0x6767('0x24')](function(_0x3b2f22){if(_0x473d19['transcribeStatus']===_0x6767('0x87')){return transcribe(_0x20861b[_0x6767('0x42')]['id'],_0xad7c1d['data1'],_0xad7c1d[_0x6767('0x83')],_0x199aca[_0x6767('0x79')],_0x199aca[_0x6767('0x7b')],_0x473d19[_0x6767('0x4a')],_0x199aca['language']);}else{logger[_0x6767('0x5f')](util[_0x6767('0x2d')](_0x6767('0x88'),_0x20861b[_0x6767('0x42')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x6767('0x24')](function(_0x5de5c4){if(_0x5de5c4){_0x5de5c4[_0x6767('0x89')]=_0x20861b[_0x6767('0x46')][_0x6767('0x7d')];return _0x473d19[_0x6767('0x8a')](_0x5de5c4);}})['then'](respondWithResult(_0x17eea4,null))[_0x6767('0x40')](handleError(_0x17eea4,null));};function writeFile(_0x25cc82,_0x258419){return new Promise(function(_0x50b125,_0x41c26d){fs[_0x6767('0x8b')](_0x258419,_0x25cc82,function(_0x3eeb71,_0x3868fb){if(_0x3eeb71){return _0x41c26d(_0x3eeb71);}else{return _0x50b125(_0x3868fb);}});});}exports[_0x6767('0x8c')]=function(_0x11f7e4,_0x586d1f,_0x315040){return db[_0x6767('0x3d')][_0x6767('0x74')]({'where':{'id':_0x11f7e4['params']['id']}})[_0x6767('0x24')](handleEntityNotFound(_0x586d1f))[_0x6767('0x24')](function(_0x3f3d79){if(_0x3f3d79&&_0x3f3d79[_0x6767('0x8d')]){var _0x244c35=_0x3f3d79[_0x6767('0x8d')];var _0x38eb7c=config['root']+'/server/files/transcribes/transcribe_'+_0x3f3d79['id']+'.txt';if(fs[_0x6767('0x4b')](_0x38eb7c)){return _0x38eb7c;}return writeFile(_0x244c35,_0x38eb7c)[_0x6767('0x24')](function(){return _0x38eb7c;});}else{throw new db[(_0x6767('0x5b'))][(_0x6767('0x4e'))]('Transcript\x20not\x20available');}})[_0x6767('0x24')](function(_0x4c6add){return _0x586d1f[_0x6767('0x48')](_0x4c6add);})[_0x6767('0x40')](handleError(_0x586d1f));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 759736b..0ed2d06 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 _0x58fa=['VoiceRecording','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x5090a5,_0x2292db){var _0x24e206=function(_0x1a7517){while(--_0x1a7517){_0x5090a5['push'](_0x5090a5['shift']());}};_0x24e206(++_0x2292db);}(_0x58fa,0x129));var _0xa58f=function(_0x50929a,_0x40f311){_0x50929a=_0x50929a-0x0;var _0x3408c1=_0x58fa[_0x50929a];return _0x3408c1;};'use strict';var _=require(_0xa58f('0x0'));var util=require(_0xa58f('0x1'));var logger=require(_0xa58f('0x2'))(_0xa58f('0x3'));var moment=require(_0xa58f('0x4'));var BPromise=require(_0xa58f('0x5'));var rp=require(_0xa58f('0x6'));var fs=require('fs');var path=require(_0xa58f('0x7'));var rimraf=require(_0xa58f('0x8'));var config=require(_0xa58f('0x9'));var attributes=require(_0xa58f('0xa'));module['exports']=function(_0xf4fcc6,_0x193513){return _0xf4fcc6['define'](_0xa58f('0xb'),attributes,{'tableName':_0xa58f('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa58f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7a1=['rimraf','../../config/environment','./voiceRecording.attributes','exports','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x507965,_0x4944f4){var _0x3608fc=function(_0x14c8d0){while(--_0x14c8d0){_0x507965['push'](_0x507965['shift']());}};_0x3608fc(++_0x4944f4);}(_0xb7a1,0xe6));var _0x1b7a=function(_0x15ce71,_0x3f1491){_0x15ce71=_0x15ce71-0x0;var _0x5a878b=_0xb7a1[_0x15ce71];return _0x5a878b;};'use strict';var _=require(_0x1b7a('0x0'));var util=require(_0x1b7a('0x1'));var logger=require(_0x1b7a('0x2'))(_0x1b7a('0x3'));var moment=require(_0x1b7a('0x4'));var BPromise=require(_0x1b7a('0x5'));var rp=require(_0x1b7a('0x6'));var fs=require('fs');var path=require(_0x1b7a('0x7'));var rimraf=require(_0x1b7a('0x8'));var config=require(_0x1b7a('0x9'));var attributes=require(_0x1b7a('0xa'));module[_0x1b7a('0xb')]=function(_0x1ea99b,_0x529c3c){return _0x1ea99b['define']('VoiceRecording',attributes,{'tableName':_0x1b7a('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x1b7a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 0db2653..0cc67cf 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 _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(_0x5da875,_0x475a8b){var _0x25d687=function(_0xb8a423){while(--_0xb8a423){_0x5da875['push'](_0x5da875['shift']());}};_0x25d687(++_0x475a8b);}(_0x33af,0xec));var _0xf33a=function(_0x38dcff,_0x5f249d){_0x38dcff=_0x38dcff-0x0;var _0x6cb881=_0x33af[_0x38dcff];return _0x6cb881;};'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 +var _0xf61e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','update','body','options','raw','where','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0x15b001,_0x5b0a5a){var _0x28b44c=function(_0x4d0a64){while(--_0x4d0a64){_0x15b001['push'](_0x15b001['shift']());}};_0x28b44c(++_0x5b0a5a);}(_0xf61e,0x191));var _0xef61=function(_0x1d143f,_0x5771a0){_0x1d143f=_0x1d143f-0x0;var _0x245d38=_0xf61e[_0x1d143f];return _0x245d38;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['VoiceRecording'][_0xef61('0x18')](_0x22dc1b[_0xef61('0x19')],{'raw':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x1a')][_0xef61('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22dc1b[_0xef61('0x1a')]?_0x22dc1b[_0xef61('0x1a')][_0xef61('0x1c')]||null:null,'attributes':_0x22dc1b[_0xef61('0x1a')]?_0x22dc1b[_0xef61('0x1a')]['attributes']||null:null,'limit':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x1a')]['limit']||null:null})[_0xef61('0x1d')](function(_0x5ae7a2){logger['info'](_0xef61('0x17'),_0x22dc1b);logger['debug']('UpdateVoiceRecording',_0x22dc1b,JSON[_0xef61('0x12')](_0x5ae7a2));_0x28315a(_0x5ae7a2);})[_0xef61('0x16')](function(_0x3ceb14){logger[_0xef61('0x13')]('UpdateVoiceRecording',_0x3ceb14[_0xef61('0x15')],_0x22dc1b);_0xdd5e38(_0xfc36d6['error'](0x1f4,_0x3ceb14[_0xef61('0x15')]));});});};exports[_0xef61('0x1e')]=function(_0x2419a9){var _0xf4c7c9=this;return new Promise(function(_0x2155f1,_0x45ece2){var _0x258b5a=require(_0xef61('0x1f'));var _0x297df7;return db[_0xef61('0x20')][_0xef61('0x21')]({'attributes':['id',_0xef61('0x22')],'where':{'id':0x1},'raw':!![]})[_0xef61('0x1d')](function(_0x63edd4){_0x297df7=_0x63edd4;return db[_0xef61('0x23')][_0xef61('0x24')](_0x2419a9[_0xef61('0x19')]);})[_0xef61('0x1d')](function(_0x587e26){if(_0x297df7[_0xef61('0x22')]&&fs[_0xef61('0x25')](_0x587e26[_0xef61('0x26')])){var _0x4f35ad=util['format'](_0xef61('0x27'),_0x587e26[_0xef61('0x26')]);return _0x258b5a[_0xef61('0x28')](_0x587e26['value'],_0x4f35ad,config[_0xef61('0x29')][_0xef61('0x2a')])['then'](function(){fs[_0xef61('0x2b')](_0x587e26['value']);logger['info'](_0xef61('0x2c'));return _0x587e26;});}return _0x587e26;})['then'](function(_0x8ed629){logger['info'](_0xef61('0x1e'),_0x2419a9);logger[_0xef61('0x10')](_0xef61('0x1e'),_0x2419a9,JSON[_0xef61('0x12')](_0x8ed629));_0x2155f1(_0x8ed629);})[_0xef61('0x16')](function(_0x1bdcb9){logger[_0xef61('0x13')](_0xef61('0x1e'),_0x1bdcb9[_0xef61('0x15')],_0x2419a9);_0x45ece2(_0xf4c7c9[_0xef61('0x13')](0x1f4,_0x1bdcb9['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 8d2a142..276a9bb 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 _0x5ab3=['../../config/environment','get','isAuthenticated','index','describe','post','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service'];(function(_0x16ec9d,_0x36ac5d){var _0x1e98b=function(_0x18a954){while(--_0x18a954){_0x16ec9d['push'](_0x16ec9d['shift']());}};_0x1e98b(++_0x36ac5d);}(_0x5ab3,0xa4));var _0x35ab=function(_0x5429e3,_0x662386){_0x5429e3=_0x5429e3-0x0;var _0x551369=_0x5ab3[_0x5429e3];return _0x551369;};'use strict';var multer=require(_0x35ab('0x0'));var util=require(_0x35ab('0x1'));var path=require(_0x35ab('0x2'));var timeout=require(_0x35ab('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x35ab('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x35ab('0x5'));var config=require(_0x35ab('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x35ab('0x7')]('/',auth[_0x35ab('0x8')](),controller[_0x35ab('0x9')]);router[_0x35ab('0x7')]('/describe',auth[_0x35ab('0x8')](),controller[_0x35ab('0xa')]);router['get']('/:id',auth[_0x35ab('0x8')](),controller['show']);router[_0x35ab('0xb')]('/',auth[_0x35ab('0x8')](),controller['create']);router['put'](_0x35ab('0xc'),auth['isAuthenticated'](),controller[_0x35ab('0xd')]);router[_0x35ab('0xe')](_0x35ab('0xc'),auth[_0x35ab('0x8')](),controller[_0x35ab('0xf')]);module[_0x35ab('0x10')]=router; \ No newline at end of file +var _0x87bb=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','multer'];(function(_0x1753e7,_0x238b88){var _0x3e73f2=function(_0x2566d9){while(--_0x2566d9){_0x1753e7['push'](_0x1753e7['shift']());}};_0x3e73f2(++_0x238b88);}(_0x87bb,0x1da));var _0xb87b=function(_0xbd4b57,_0x5a1128){_0xbd4b57=_0xbd4b57-0x0;var _0x119486=_0x87bb[_0xbd4b57];return _0x119486;};'use strict';var multer=require(_0xb87b('0x0'));var util=require(_0xb87b('0x1'));var path=require(_0xb87b('0x2'));var timeout=require(_0xb87b('0x3'));var express=require('express');var router=express[_0xb87b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb87b('0x5'));var config=require(_0xb87b('0x6'));var controller=require(_0xb87b('0x7'));router[_0xb87b('0x8')]('/',auth[_0xb87b('0x9')](),controller['index']);router[_0xb87b('0x8')](_0xb87b('0xa'),auth[_0xb87b('0x9')](),controller[_0xb87b('0xb')]);router[_0xb87b('0x8')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller[_0xb87b('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb87b('0xe')]);router[_0xb87b('0xf')](_0xb87b('0xc'),auth[_0xb87b('0x9')](),controller[_0xb87b('0x10')]);router[_0xb87b('0x11')](_0xb87b('0xc'),auth['isAuthenticated'](),controller[_0xb87b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 117235e..0519d25 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 _0x800b=['sequelize','moment','ENUM','blind','attended','STRING','Yes'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x800b,0x11f));var _0xb800=function(_0x22ffbf,_0x16f31e){_0x22ffbf=_0x22ffbf-0x0;var _0x360c17=_0x800b[_0x22ffbf];return _0x360c17;};'use strict';var Sequelize=require(_0xb800('0x0'));var moment=require(_0xb800('0x1'));module['exports']={'type':{'type':Sequelize[_0xb800('0x2')](_0xb800('0x3'),_0xb800('0x4'))},'result':{'type':Sequelize[_0xb800('0x5')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0xb800('0x5')]},'transferercalleridname':{'type':Sequelize[_0xb800('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb800('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xb800('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xb800('0x5')]},'transferercontext':{'type':Sequelize[_0xb800('0x5')]},'transfererexten':{'type':Sequelize[_0xb800('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xb800('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xb800('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xb800('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb800('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb800('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xb800('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xb800('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xb800('0x6'),'No')},'context':{'type':Sequelize[_0xb800('0x5')]},'extension':{'type':Sequelize[_0xb800('0x5')]}}; \ No newline at end of file +var _0xf5b9=['ENUM','moment','exports','blind','attended','STRING'];(function(_0x1989b0,_0x61b173){var _0x211da3=function(_0x185743){while(--_0x185743){_0x1989b0['push'](_0x1989b0['shift']());}};_0x211da3(++_0x61b173);}(_0xf5b9,0x1ab));var _0x9f5b=function(_0x228182,_0x28ee3a){_0x228182=_0x228182-0x0;var _0x2f651f=_0xf5b9[_0x228182];return _0x2f651f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9f5b('0x0'));module[_0x9f5b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9f5b('0x2'),_0x9f5b('0x3'))},'result':{'type':Sequelize[_0x9f5b('0x4')]},'transfererchannel':{'type':Sequelize[_0x9f5b('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x9f5b('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x9f5b('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x9f5b('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x9f5b('0x4')]},'transfereechannel':{'type':Sequelize[_0x9f5b('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x9f5b('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x9f5b('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x9f5b('0x4')]},'transfereecontext':{'type':Sequelize[_0x9f5b('0x4')]},'transfereeexten':{'type':Sequelize[_0x9f5b('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x9f5b('0x4')]},'isexternal':{'type':Sequelize[_0x9f5b('0x5')]('Yes','No')},'context':{'type':Sequelize['STRING']},'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 30e32d6..28315cb 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 _0x3c21=['describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','reject','save','update','then','destroy','end','error','stack','name','map','VoiceTransferReport','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','find','create','body'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x3c21,0x178));var _0x13c2=function(_0x306b44,_0x123944){_0x306b44=_0x306b44-0x0;var _0x1cef6b=_0x3c21[_0x306b44];return _0x1cef6b;};'use strict';var emlformat=require(_0x13c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x13c2('0x1'));var jsonpatch=require(_0x13c2('0x2'));var rp=require(_0x13c2('0x3'));var moment=require(_0x13c2('0x4'));var BPromise=require(_0x13c2('0x5'));var Mustache=require('mustache');var util=require(_0x13c2('0x6'));var path=require(_0x13c2('0x7'));var sox=require('sox');var csv=require(_0x13c2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13c2('0x9'));var _=require('lodash');var squel=require(_0x13c2('0xa'));var crypto=require(_0x13c2('0xb'));var jsforce=require(_0x13c2('0xc'));var deskjs=require(_0x13c2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x13c2('0xe'));var Papa=require(_0x13c2('0xf'));var Redis=require(_0x13c2('0x10'));var authService=require(_0x13c2('0x11'));var qs=require(_0x13c2('0x12'));var as=require(_0x13c2('0x13'));var hardwareService=require(_0x13c2('0x14'));var logger=require(_0x13c2('0x15'))(_0x13c2('0x16'));var utils=require(_0x13c2('0x17'));var config=require(_0x13c2('0x18'));var licenseUtil=require(_0x13c2('0x19'));var db=require(_0x13c2('0x1a'))['db'];function respondWithStatusCode(_0x29fa15,_0x5703a3){_0x5703a3=_0x5703a3||0xcc;return function(_0x5ca2ae){if(_0x5ca2ae){return _0x29fa15[_0x13c2('0x1b')](_0x5703a3);}return _0x29fa15[_0x13c2('0x1c')](_0x5703a3)['end']();};}function respondWithResult(_0x5f4dd3,_0xc19200){_0xc19200=_0xc19200||0xc8;return function(_0x417393){if(_0x417393){return _0x5f4dd3['status'](_0xc19200)[_0x13c2('0x1d')](_0x417393);}};}function respondWithFilteredResult(_0x5405fd,_0x558eb7){return function(_0x79a0c7){if(_0x79a0c7){var _0x99f35c=typeof _0x558eb7['offset']===_0x13c2('0x1e')&&typeof _0x558eb7[_0x13c2('0x1f')]===_0x13c2('0x1e');var _0x23fa67=_0x79a0c7[_0x13c2('0x20')];var _0x7b8bcf=_0x99f35c?0x0:_0x558eb7[_0x13c2('0x21')];var _0x428741=_0x99f35c?_0x79a0c7[_0x13c2('0x20')]:_0x558eb7['offset']+_0x558eb7[_0x13c2('0x1f')];var _0x4725d2;if(_0x428741>=_0x23fa67){_0x428741=_0x23fa67;_0x4725d2=0xc8;}else{_0x4725d2=0xce;}_0x5405fd[_0x13c2('0x1c')](_0x4725d2);return _0x5405fd['set']('Content-Range',_0x7b8bcf+'-'+_0x428741+'/'+_0x23fa67)[_0x13c2('0x1d')](_0x79a0c7);}return null;};}function patchUpdates(_0x2cc62f){return function(_0x3663f4){try{jsonpatch['apply'](_0x3663f4,_0x2cc62f,!![]);}catch(_0x44a6ef){return BPromise[_0x13c2('0x22')](_0x44a6ef);}return _0x3663f4[_0x13c2('0x23')]();};}function saveUpdates(_0x20fa68,_0x1408d7){return function(_0x32cdc3){if(_0x32cdc3){return _0x32cdc3[_0x13c2('0x24')](_0x20fa68)[_0x13c2('0x25')](function(_0x1a7f88){return _0x1a7f88;});}return null;};}function removeEntity(_0x2b2ef8,_0x4743a1){return function(_0x17a079){if(_0x17a079){return _0x17a079[_0x13c2('0x26')]()[_0x13c2('0x25')](function(){_0x2b2ef8[_0x13c2('0x1c')](0xcc)[_0x13c2('0x27')]();});}};}function handleEntityNotFound(_0x27e1f4,_0x234294){return function(_0x32321c){if(!_0x32321c){_0x27e1f4['sendStatus'](0x194);}return _0x32321c;};}function handleError(_0x5cc097,_0x55e225){_0x55e225=_0x55e225||0x1f4;return function(_0x3e6a51){logger[_0x13c2('0x28')](_0x3e6a51[_0x13c2('0x29')]);if(_0x3e6a51[_0x13c2('0x2a')]){delete _0x3e6a51[_0x13c2('0x2a')];}_0x5cc097['status'](_0x55e225)['send'](_0x3e6a51);};}exports['index']=function(_0x45aaa2,_0x4854f5){var _0x214a31={},_0x3e3b4e={},_0xf68d0c={'count':0x0,'rows':[]};var _0x206939=_[_0x13c2('0x2b')](db[_0x13c2('0x2c')]['rawAttributes'],function(_0x465172){return{'name':_0x465172[_0x13c2('0x2d')],'type':_0x465172[_0x13c2('0x2e')][_0x13c2('0x2f')]};});_0x3e3b4e['model']=_[_0x13c2('0x2b')](_0x206939,_0x13c2('0x2a'));_0x3e3b4e['query']=_[_0x13c2('0x30')](_0x45aaa2[_0x13c2('0x31')]);_0x3e3b4e['filters']=_[_0x13c2('0x32')](_0x3e3b4e[_0x13c2('0x33')],_0x3e3b4e['query']);_0x214a31['attributes']=_['intersection'](_0x3e3b4e[_0x13c2('0x33')],qs[_0x13c2('0x34')](_0x45aaa2[_0x13c2('0x31')]['fields']));_0x214a31[_0x13c2('0x35')]=_0x214a31['attributes'][_0x13c2('0x36')]?_0x214a31[_0x13c2('0x35')]:_0x3e3b4e[_0x13c2('0x33')];if(!_0x45aaa2[_0x13c2('0x31')][_0x13c2('0x37')](_0x13c2('0x38'))){_0x214a31[_0x13c2('0x1f')]=qs[_0x13c2('0x1f')](_0x45aaa2[_0x13c2('0x31')][_0x13c2('0x1f')]);_0x214a31[_0x13c2('0x21')]=qs[_0x13c2('0x21')](_0x45aaa2[_0x13c2('0x31')][_0x13c2('0x21')]);}_0x214a31[_0x13c2('0x39')]=qs[_0x13c2('0x3a')](_0x45aaa2['query']['sort']);_0x214a31[_0x13c2('0x3b')]=qs[_0x13c2('0x3c')](_['pick'](_0x45aaa2[_0x13c2('0x31')],_0x3e3b4e['filters']),_0x206939);if(_0x45aaa2[_0x13c2('0x31')][_0x13c2('0x3d')]){_0x214a31[_0x13c2('0x3b')]=_[_0x13c2('0x3e')](_0x214a31[_0x13c2('0x3b')],{'$or':_[_0x13c2('0x2b')](_0x206939,function(_0x298821){if(_0x298821[_0x13c2('0x2e')]!==_0x13c2('0x3f')){var _0x2d096a={};_0x2d096a[_0x298821['name']]={'$like':'%'+_0x45aaa2[_0x13c2('0x31')][_0x13c2('0x3d')]+'%'};return _0x2d096a;}})});}_0x214a31=_[_0x13c2('0x3e')]({},_0x214a31,_0x45aaa2[_0x13c2('0x40')]);var _0xbb4c0b={'where':_0x214a31[_0x13c2('0x3b')]};return db[_0x13c2('0x2c')]['count'](_0xbb4c0b)[_0x13c2('0x25')](function(_0x3355d1){_0xf68d0c[_0x13c2('0x20')]=_0x3355d1;if(_0x45aaa2[_0x13c2('0x31')][_0x13c2('0x41')]){_0x214a31['include']=[{'all':!![]}];}return db[_0x13c2('0x2c')][_0x13c2('0x42')](_0x214a31);})['then'](function(_0x4d8925){_0xf68d0c[_0x13c2('0x43')]=_0x4d8925;return _0xf68d0c;})[_0x13c2('0x25')](respondWithFilteredResult(_0x4854f5,_0x214a31))[_0x13c2('0x44')](handleError(_0x4854f5,null));};exports['show']=function(_0x243905,_0x1f62df){var _0x271b66={'raw':!![],'where':{'id':_0x243905[_0x13c2('0x45')]['id']}},_0x320731={};_0x320731[_0x13c2('0x33')]=_[_0x13c2('0x30')](db[_0x13c2('0x2c')][_0x13c2('0x46')]);_0x320731['query']=_[_0x13c2('0x30')](_0x243905[_0x13c2('0x31')]);_0x320731[_0x13c2('0x3c')]=_[_0x13c2('0x32')](_0x320731['model'],_0x320731[_0x13c2('0x31')]);_0x271b66[_0x13c2('0x35')]=_[_0x13c2('0x32')](_0x320731['model'],qs[_0x13c2('0x34')](_0x243905[_0x13c2('0x31')][_0x13c2('0x34')]));_0x271b66[_0x13c2('0x35')]=_0x271b66[_0x13c2('0x35')][_0x13c2('0x36')]?_0x271b66[_0x13c2('0x35')]:_0x320731[_0x13c2('0x33')];if(_0x243905[_0x13c2('0x31')]['includeAll']){_0x271b66['include']=[{'all':!![]}];}_0x271b66=_[_0x13c2('0x3e')]({},_0x271b66,_0x243905[_0x13c2('0x40')]);return db['VoiceTransferReport'][_0x13c2('0x47')](_0x271b66)[_0x13c2('0x25')](handleEntityNotFound(_0x1f62df,null))['then'](respondWithResult(_0x1f62df,null))[_0x13c2('0x44')](handleError(_0x1f62df,null));};exports[_0x13c2('0x48')]=function(_0x50f18e,_0xed7500){return db[_0x13c2('0x2c')][_0x13c2('0x48')](_0x50f18e['body'],{})[_0x13c2('0x25')](respondWithResult(_0xed7500,0xc9))[_0x13c2('0x44')](handleError(_0xed7500,null));};exports[_0x13c2('0x24')]=function(_0xb109c2,_0x55c750){if(_0xb109c2[_0x13c2('0x49')]['id']){delete _0xb109c2[_0x13c2('0x49')]['id'];}return db[_0x13c2('0x2c')][_0x13c2('0x47')]({'where':{'id':_0xb109c2[_0x13c2('0x45')]['id']}})['then'](handleEntityNotFound(_0x55c750,null))[_0x13c2('0x25')](saveUpdates(_0xb109c2[_0x13c2('0x49')],null))[_0x13c2('0x25')](respondWithResult(_0x55c750,null))[_0x13c2('0x44')](handleError(_0x55c750,null));};exports[_0x13c2('0x26')]=function(_0x518d19,_0x4ddb1c){return db[_0x13c2('0x2c')][_0x13c2('0x47')]({'where':{'id':_0x518d19[_0x13c2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4ddb1c,null))['then'](removeEntity(_0x4ddb1c,null))['catch'](handleError(_0x4ddb1c,null));};exports['describe']=function(_0x28889e,_0x5a9648){return db['VoiceTransferReport'][_0x13c2('0x4a')]()['then'](respondWithResult(_0x5a9648,null))['catch'](handleError(_0x5a9648,null));}; \ No newline at end of file +var _0x9599=['body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','VoiceTransferReport','includeAll','include','findAll','show','params','keys','length','options','find','catch','create'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x9599,0x178));var _0x9959=function(_0x4cfc35,_0xb52690){_0x4cfc35=_0x4cfc35-0x0;var _0x43a384=_0x9599[_0x4cfc35];return _0x43a384;};'use strict';var emlformat=require(_0x9959('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9959('0x1'));var rp=require(_0x9959('0x2'));var moment=require(_0x9959('0x3'));var BPromise=require(_0x9959('0x4'));var Mustache=require(_0x9959('0x5'));var util=require(_0x9959('0x6'));var path=require(_0x9959('0x7'));var sox=require(_0x9959('0x8'));var csv=require(_0x9959('0x9'));var ejs=require(_0x9959('0xa'));var fs=require('fs');var fs_extra=require(_0x9959('0xb'));var _=require(_0x9959('0xc'));var squel=require('squel');var crypto=require(_0x9959('0xd'));var jsforce=require(_0x9959('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9959('0x9'));var querystring=require(_0x9959('0xf'));var Papa=require(_0x9959('0x10'));var Redis=require(_0x9959('0x11'));var authService=require(_0x9959('0x12'));var qs=require(_0x9959('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9959('0x14'));var utils=require('../../config/utils');var config=require(_0x9959('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9959('0x16'))['db'];function respondWithStatusCode(_0x53fd5e,_0x3ebf04){_0x3ebf04=_0x3ebf04||0xcc;return function(_0x5dcb23){if(_0x5dcb23){return _0x53fd5e[_0x9959('0x17')](_0x3ebf04);}return _0x53fd5e['status'](_0x3ebf04)[_0x9959('0x18')]();};}function respondWithResult(_0x4a6859,_0x4ff7d5){_0x4ff7d5=_0x4ff7d5||0xc8;return function(_0x29826){if(_0x29826){return _0x4a6859['status'](_0x4ff7d5)[_0x9959('0x19')](_0x29826);}};}function respondWithFilteredResult(_0x5c8b26,_0x49d6d0){return function(_0x5189c5){if(_0x5189c5){var _0xbdcda6=typeof _0x49d6d0['offset']===_0x9959('0x1a')&&typeof _0x49d6d0[_0x9959('0x1b')]===_0x9959('0x1a');var _0x173a8d=_0x5189c5[_0x9959('0x1c')];var _0x5dbe6f=_0xbdcda6?0x0:_0x49d6d0[_0x9959('0x1d')];var _0x42407e=_0xbdcda6?_0x5189c5[_0x9959('0x1c')]:_0x49d6d0[_0x9959('0x1d')]+_0x49d6d0[_0x9959('0x1b')];var _0x1c9edf;if(_0x42407e>=_0x173a8d){_0x42407e=_0x173a8d;_0x1c9edf=0xc8;}else{_0x1c9edf=0xce;}_0x5c8b26[_0x9959('0x1e')](_0x1c9edf);return _0x5c8b26[_0x9959('0x1f')](_0x9959('0x20'),_0x5dbe6f+'-'+_0x42407e+'/'+_0x173a8d)[_0x9959('0x19')](_0x5189c5);}return null;};}function patchUpdates(_0x1d87cd){return function(_0x1ad584){try{jsonpatch[_0x9959('0x21')](_0x1ad584,_0x1d87cd,!![]);}catch(_0x5bc976){return BPromise[_0x9959('0x22')](_0x5bc976);}return _0x1ad584[_0x9959('0x23')]();};}function saveUpdates(_0x44b791,_0x521b55){return function(_0x914736){if(_0x914736){return _0x914736[_0x9959('0x24')](_0x44b791)[_0x9959('0x25')](function(_0xbd344b){return _0xbd344b;});}return null;};}function removeEntity(_0x4ed8fd,_0x45835f){return function(_0x2bf995){if(_0x2bf995){return _0x2bf995[_0x9959('0x26')]()['then'](function(){_0x4ed8fd['status'](0xcc)[_0x9959('0x18')]();});}};}function handleEntityNotFound(_0x4ed14f,_0x72113b){return function(_0x20f632){if(!_0x20f632){_0x4ed14f['sendStatus'](0x194);}return _0x20f632;};}function handleError(_0x38036d,_0x10513a){_0x10513a=_0x10513a||0x1f4;return function(_0x2e9881){logger[_0x9959('0x27')](_0x2e9881[_0x9959('0x28')]);if(_0x2e9881['name']){delete _0x2e9881[_0x9959('0x29')];}_0x38036d[_0x9959('0x1e')](_0x10513a)['send'](_0x2e9881);};}exports[_0x9959('0x2a')]=function(_0x38431e,_0x57693e){var _0xc19540={},_0x4c34a7={},_0x2b8160={'count':0x0,'rows':[]};var _0x598d8a=_[_0x9959('0x2b')](db['VoiceTransferReport'][_0x9959('0x2c')],function(_0x3a22cd){return{'name':_0x3a22cd['fieldName'],'type':_0x3a22cd[_0x9959('0x2d')][_0x9959('0x2e')]};});_0x4c34a7[_0x9959('0x2f')]=_[_0x9959('0x2b')](_0x598d8a,'name');_0x4c34a7[_0x9959('0x30')]=_['keys'](_0x38431e[_0x9959('0x30')]);_0x4c34a7['filters']=_[_0x9959('0x31')](_0x4c34a7[_0x9959('0x2f')],_0x4c34a7[_0x9959('0x30')]);_0xc19540[_0x9959('0x32')]=_['intersection'](_0x4c34a7['model'],qs['fields'](_0x38431e[_0x9959('0x30')][_0x9959('0x33')]));_0xc19540[_0x9959('0x32')]=_0xc19540[_0x9959('0x32')]['length']?_0xc19540[_0x9959('0x32')]:_0x4c34a7['model'];if(!_0x38431e[_0x9959('0x30')][_0x9959('0x34')](_0x9959('0x35'))){_0xc19540[_0x9959('0x1b')]=qs[_0x9959('0x1b')](_0x38431e['query'][_0x9959('0x1b')]);_0xc19540[_0x9959('0x1d')]=qs['offset'](_0x38431e[_0x9959('0x30')][_0x9959('0x1d')]);}_0xc19540[_0x9959('0x36')]=qs[_0x9959('0x37')](_0x38431e[_0x9959('0x30')][_0x9959('0x37')]);_0xc19540['where']=qs[_0x9959('0x38')](_[_0x9959('0x39')](_0x38431e[_0x9959('0x30')],_0x4c34a7[_0x9959('0x38')]),_0x598d8a);if(_0x38431e['query'][_0x9959('0x3a')]){_0xc19540[_0x9959('0x3b')]=_[_0x9959('0x3c')](_0xc19540['where'],{'$or':_[_0x9959('0x2b')](_0x598d8a,function(_0x230e07){if(_0x230e07[_0x9959('0x2d')]!==_0x9959('0x3d')){var _0xd608a0={};_0xd608a0[_0x230e07[_0x9959('0x29')]]={'$like':'%'+_0x38431e['query']['filter']+'%'};return _0xd608a0;}})});}_0xc19540=_['merge']({},_0xc19540,_0x38431e['options']);var _0x3cb025={'where':_0xc19540[_0x9959('0x3b')]};return db[_0x9959('0x3e')]['count'](_0x3cb025)[_0x9959('0x25')](function(_0xd8e751){_0x2b8160[_0x9959('0x1c')]=_0xd8e751;if(_0x38431e[_0x9959('0x30')][_0x9959('0x3f')]){_0xc19540[_0x9959('0x40')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x9959('0x41')](_0xc19540);})['then'](function(_0x57fc55){_0x2b8160['rows']=_0x57fc55;return _0x2b8160;})['then'](respondWithFilteredResult(_0x57693e,_0xc19540))['catch'](handleError(_0x57693e,null));};exports[_0x9959('0x42')]=function(_0x26d63c,_0xe153e7){var _0x4f9711={'raw':!![],'where':{'id':_0x26d63c[_0x9959('0x43')]['id']}},_0x2059b2={};_0x2059b2['model']=_[_0x9959('0x44')](db[_0x9959('0x3e')][_0x9959('0x2c')]);_0x2059b2[_0x9959('0x30')]=_[_0x9959('0x44')](_0x26d63c[_0x9959('0x30')]);_0x2059b2[_0x9959('0x38')]=_[_0x9959('0x31')](_0x2059b2[_0x9959('0x2f')],_0x2059b2[_0x9959('0x30')]);_0x4f9711[_0x9959('0x32')]=_['intersection'](_0x2059b2['model'],qs[_0x9959('0x33')](_0x26d63c[_0x9959('0x30')][_0x9959('0x33')]));_0x4f9711[_0x9959('0x32')]=_0x4f9711[_0x9959('0x32')][_0x9959('0x45')]?_0x4f9711[_0x9959('0x32')]:_0x2059b2[_0x9959('0x2f')];if(_0x26d63c[_0x9959('0x30')][_0x9959('0x3f')]){_0x4f9711[_0x9959('0x40')]=[{'all':!![]}];}_0x4f9711=_[_0x9959('0x3c')]({},_0x4f9711,_0x26d63c[_0x9959('0x46')]);return db[_0x9959('0x3e')][_0x9959('0x47')](_0x4f9711)[_0x9959('0x25')](handleEntityNotFound(_0xe153e7,null))['then'](respondWithResult(_0xe153e7,null))[_0x9959('0x48')](handleError(_0xe153e7,null));};exports[_0x9959('0x49')]=function(_0x3d9f3b,_0x43f39d){return db['VoiceTransferReport'][_0x9959('0x49')](_0x3d9f3b[_0x9959('0x4a')],{})['then'](respondWithResult(_0x43f39d,0xc9))[_0x9959('0x48')](handleError(_0x43f39d,null));};exports[_0x9959('0x24')]=function(_0x5bce17,_0x3b6e23){if(_0x5bce17[_0x9959('0x4a')]['id']){delete _0x5bce17[_0x9959('0x4a')]['id'];}return db[_0x9959('0x3e')][_0x9959('0x47')]({'where':{'id':_0x5bce17[_0x9959('0x43')]['id']}})[_0x9959('0x25')](handleEntityNotFound(_0x3b6e23,null))['then'](saveUpdates(_0x5bce17[_0x9959('0x4a')],null))['then'](respondWithResult(_0x3b6e23,null))[_0x9959('0x48')](handleError(_0x3b6e23,null));};exports[_0x9959('0x26')]=function(_0x1ca640,_0x348a81){return db[_0x9959('0x3e')][_0x9959('0x47')]({'where':{'id':_0x1ca640['params']['id']}})['then'](handleEntityNotFound(_0x348a81,null))[_0x9959('0x25')](removeEntity(_0x348a81,null))['catch'](handleError(_0x348a81,null));};exports['describe']=function(_0x39cf2c,_0x5c5675){return db['VoiceTransferReport']['describe']()['then'](respondWithResult(_0x5c5675,null))[_0x9959('0x48')](handleError(_0x5c5675,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index fe4cf37..854a8a8 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 _0x5062=['report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport'];(function(_0x221b60,_0x2d2107){var _0x1f23a2=function(_0x507f28){while(--_0x507f28){_0x221b60['push'](_0x221b60['shift']());}};_0x1f23a2(++_0x2d2107);}(_0x5062,0x1c8));var _0x2506=function(_0x1816df,_0x128f0d){_0x1816df=_0x1816df-0x0;var _0xe5bc55=_0x5062[_0x1816df];return _0xe5bc55;};'use strict';var _=require(_0x2506('0x0'));var util=require('util');var logger=require(_0x2506('0x1'))(_0x2506('0x2'));var moment=require(_0x2506('0x3'));var BPromise=require(_0x2506('0x4'));var rp=require(_0x2506('0x5'));var fs=require('fs');var path=require(_0x2506('0x6'));var rimraf=require(_0x2506('0x7'));var config=require(_0x2506('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0x2506('0x9')]=function(_0x10abb0,_0x62d62d){return _0x10abb0[_0x2506('0xa')](_0x2506('0xb'),attributes,{'tableName':_0x2506('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d41=['bluebird','request-promise','path','../../config/environment','exports','define','report_call_transfer','lodash','../../config/logger','api','moment'];(function(_0x4c1a45,_0x35c814){var _0x27fc3a=function(_0x1a451b){while(--_0x1a451b){_0x4c1a45['push'](_0x4c1a45['shift']());}};_0x27fc3a(++_0x35c814);}(_0x6d41,0xee));var _0x16d4=function(_0x2b1b8b,_0x35f39c){_0x2b1b8b=_0x2b1b8b-0x0;var _0x21c218=_0x6d41[_0x2b1b8b];return _0x21c218;};'use strict';var _=require(_0x16d4('0x0'));var util=require('util');var logger=require(_0x16d4('0x1'))(_0x16d4('0x2'));var moment=require(_0x16d4('0x3'));var BPromise=require(_0x16d4('0x4'));var rp=require(_0x16d4('0x5'));var fs=require('fs');var path=require(_0x16d4('0x6'));var rimraf=require('rimraf');var config=require(_0x16d4('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x16d4('0x8')]=function(_0x5c897a,_0x3cab4a){return _0x5c897a[_0x16d4('0x9')]('VoiceTransferReport',attributes,{'tableName':_0x16d4('0xa'),'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 fd8f059..626b409 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 _0x0657=['info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xef8e1b,_0x1692ec){var _0x4864b6=function(_0x3a6773){while(--_0x3a6773){_0xef8e1b['push'](_0xef8e1b['shift']());}};_0x4864b6(++_0x1692ec);}(_0x0657,0xc4));var _0x7065=function(_0x3a01d0,_0xe6fc3b){_0x3a01d0=_0x3a01d0-0x0;var _0x7ed223=_0x0657[_0x3a01d0];return _0x7ed223;};'use strict';var _=require(_0x7065('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7065('0x1'));var rs=require(_0x7065('0x2'));var fs=require('fs');var Redis=require(_0x7065('0x3'));var db=require(_0x7065('0x4'))['db'];var utils=require(_0x7065('0x5'));var logger=require(_0x7065('0x6'))(_0x7065('0x7'));var config=require(_0x7065('0x8'));var jayson=require(_0x7065('0x9'));var client=jayson[_0x7065('0xa')][_0x7065('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fb018,_0x5d871d,_0x1634d0){return new BPromise(function(_0x5f137c,_0x1a3606){return client[_0x7065('0xc')](_0x3fb018,_0x1634d0)[_0x7065('0xd')](function(_0x1b5f36){logger[_0x7065('0xe')]('VoiceTransferReport,\x20%s,\x20%s',_0x5d871d,_0x7065('0xf'));logger[_0x7065('0x10')](_0x7065('0x11'),_0x5d871d,_0x7065('0xf'),JSON[_0x7065('0x12')](_0x1b5f36));if(_0x1b5f36[_0x7065('0x13')]){if(_0x1b5f36[_0x7065('0x13')]['code']===0x1f4){logger[_0x7065('0x13')](_0x7065('0x14'),_0x5d871d,_0x1b5f36[_0x7065('0x13')][_0x7065('0x15')]);return _0x1a3606(_0x1b5f36['error']['message']);}logger[_0x7065('0x13')](_0x7065('0x14'),_0x5d871d,_0x1b5f36['error'][_0x7065('0x15')]);return _0x5f137c(_0x1b5f36[_0x7065('0x13')]['message']);}else{logger[_0x7065('0xe')](_0x7065('0x14'),_0x5d871d,_0x7065('0xf'));_0x5f137c(_0x1b5f36[_0x7065('0x16')][_0x7065('0x15')]);}})[_0x7065('0x17')](function(_0x20d556){logger[_0x7065('0x13')](_0x7065('0x14'),_0x5d871d,_0x20d556);_0x1a3606(_0x20d556);});});}exports[_0x7065('0x18')]=function(_0x58c05b){var _0x7d2dd8=this;return new Promise(function(_0xbda7d9,_0x1a4bea){return db[_0x7065('0x19')][_0x7065('0x1a')](_0x58c05b[_0x7065('0x1b')],{'raw':_0x58c05b[_0x7065('0x1c')]?_0x58c05b[_0x7065('0x1c')][_0x7065('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x9bc335){logger[_0x7065('0xe')](_0x7065('0x18'),_0x58c05b);logger['debug'](_0x7065('0x18'),_0x58c05b,JSON[_0x7065('0x12')](_0x9bc335));_0xbda7d9(_0x9bc335);})[_0x7065('0x17')](function(_0x19a696){logger['error'](_0x7065('0x18'),_0x19a696[_0x7065('0x15')],_0x58c05b);_0x1a4bea(_0x7d2dd8['error'](0x1f4,_0x19a696[_0x7065('0x15')]));});});}; \ No newline at end of file +var _0x3cad=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateVoiceTransferReport','body','options','raw','then','lodash'];(function(_0x2f7270,_0x307af1){var _0xe1d89a=function(_0x1ba203){while(--_0x1ba203){_0x2f7270['push'](_0x2f7270['shift']());}};_0xe1d89a(++_0x307af1);}(_0x3cad,0x10d));var _0xd3ca=function(_0x206ba9,_0x3556a9){_0x206ba9=_0x206ba9-0x0;var _0x2d5868=_0x3cad[_0x206ba9];return _0x2d5868;};'use strict';var _=require(_0xd3ca('0x0'));var util=require(_0xd3ca('0x1'));var moment=require('moment');var BPromise=require(_0xd3ca('0x2'));var rs=require(_0xd3ca('0x3'));var fs=require('fs');var Redis=require(_0xd3ca('0x4'));var db=require(_0xd3ca('0x5'))['db'];var utils=require(_0xd3ca('0x6'));var logger=require('../../config/logger')(_0xd3ca('0x7'));var config=require(_0xd3ca('0x8'));var jayson=require(_0xd3ca('0x9'));var client=jayson[_0xd3ca('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x228151,_0x2fec4b,_0xaca0c5){return new BPromise(function(_0x2179bc,_0x345c3a){return client[_0xd3ca('0xb')](_0x228151,_0xaca0c5)['then'](function(_0x2e9da1){logger[_0xd3ca('0xc')](_0xd3ca('0xd'),_0x2fec4b,'request\x20sent');logger[_0xd3ca('0xe')](_0xd3ca('0xf'),_0x2fec4b,_0xd3ca('0x10'),JSON[_0xd3ca('0x11')](_0x2e9da1));if(_0x2e9da1[_0xd3ca('0x12')]){if(_0x2e9da1['error'][_0xd3ca('0x13')]===0x1f4){logger[_0xd3ca('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x2fec4b,_0x2e9da1[_0xd3ca('0x12')]['message']);return _0x345c3a(_0x2e9da1['error']['message']);}logger[_0xd3ca('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x2fec4b,_0x2e9da1[_0xd3ca('0x12')][_0xd3ca('0x14')]);return _0x2179bc(_0x2e9da1[_0xd3ca('0x12')][_0xd3ca('0x14')]);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x2fec4b,_0xd3ca('0x10'));_0x2179bc(_0x2e9da1[_0xd3ca('0x15')][_0xd3ca('0x14')]);}})['catch'](function(_0x3b41bb){logger[_0xd3ca('0x12')](_0xd3ca('0xd'),_0x2fec4b,_0x3b41bb);_0x345c3a(_0x3b41bb);});});}exports[_0xd3ca('0x16')]=function(_0x5216cf){var _0x1d3b41=this;return new Promise(function(_0x155b13,_0x38bf59){return db['VoiceTransferReport']['create'](_0x5216cf[_0xd3ca('0x17')],{'raw':_0x5216cf[_0xd3ca('0x18')]?_0x5216cf['options'][_0xd3ca('0x19')]===undefined?!![]:![]:!![]})[_0xd3ca('0x1a')](function(_0x1af336){logger[_0xd3ca('0xc')](_0xd3ca('0x16'),_0x5216cf);logger[_0xd3ca('0xe')](_0xd3ca('0x16'),_0x5216cf,JSON[_0xd3ca('0x11')](_0x1af336));_0x155b13(_0x1af336);})['catch'](function(_0x4589e2){logger[_0xd3ca('0x12')](_0xd3ca('0x16'),_0x4589e2[_0xd3ca('0x14')],_0x5216cf);_0x38bf59(_0x1d3b41[_0xd3ca('0x12')](0x1f4,_0x4589e2[_0xd3ca('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index c5c251d..75cf468 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 _0x5b02=['Router','../../components/auth/service','./webbar.controller','isAuthenticated','originate','post','/hangup','isWebrtcLicence','/answer','/hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x2b185b,_0x7484e6){var _0x3d8fdb=function(_0x45e97c){while(--_0x45e97c){_0x2b185b['push'](_0x2b185b['shift']());}};_0x3d8fdb(++_0x7484e6);}(_0x5b02,0xe9));var _0x25b0=function(_0x24f806,_0x27ef30){_0x24f806=_0x24f806-0x0;var _0x37e450=_0x5b02[_0x24f806];return _0x37e450;};'use strict';var express=require(_0x25b0('0x0'));var router=express[_0x25b0('0x1')]();var auth=require(_0x25b0('0x2'));var controller=require(_0x25b0('0x3'));router['post']('/originate',auth[_0x25b0('0x4')](),auth['isWebrtcLicence'](),controller[_0x25b0('0x5')]);router[_0x25b0('0x6')](_0x25b0('0x7'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hangup']);router[_0x25b0('0x6')](_0x25b0('0x9'),auth['isAuthenticated'](),auth[_0x25b0('0x8')](),controller['answer']);router['post'](_0x25b0('0xa'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller['hold']);router[_0x25b0('0x6')](_0x25b0('0xb'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xc')]);router[_0x25b0('0x6')](_0x25b0('0xd'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0xe')]);router[_0x25b0('0x6')](_0x25b0('0xf'),auth[_0x25b0('0x4')](),auth[_0x25b0('0x8')](),controller[_0x25b0('0x10')]);module[_0x25b0('0x11')]=router; \ No newline at end of file +var _0x750a=['Router','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','/answer','/unhold','unhold','/calls','calls','/transfer','transfer','exports'];(function(_0x21d532,_0x4552a4){var _0x37bda1=function(_0x134a6f){while(--_0x134a6f){_0x21d532['push'](_0x21d532['shift']());}};_0x37bda1(++_0x4552a4);}(_0x750a,0x140));var _0xa750=function(_0x38c100,_0x3c1a2f){_0x38c100=_0x38c100-0x0;var _0x287880=_0x750a[_0x38c100];return _0x287880;};'use strict';var express=require('express');var router=express[_0xa750('0x0')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router[_0xa750('0x1')](_0xa750('0x2'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x5')]);router[_0xa750('0x1')](_0xa750('0x6'),auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller[_0xa750('0x7')]);router[_0xa750('0x1')](_0xa750('0x8'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller['answer']);router[_0xa750('0x1')]('/hold',auth[_0xa750('0x3')](),auth[_0xa750('0x4')](),controller['hold']);router[_0xa750('0x1')](_0xa750('0x9'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xa750('0xa')]);router['post'](_0xa750('0xb'),auth[_0xa750('0x3')](),auth['isWebrtcLicence'](),controller[_0xa750('0xc')]);router[_0xa750('0x1')](_0xa750('0xd'),auth['isAuthenticated'](),auth[_0xa750('0x4')](),controller[_0xa750('0xe')]);module[_0xa750('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 bc38b31..3f25b95 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 _0x00b3=['webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','jayson/promise','http','webbarapi','ioredis','redis','defaults','socket.io-emitter','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','send','NotFound','then','code','message','catch','User','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','body','json','userId','callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup\x20fired:','validate','length','format','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:'];(function(_0x63f6f7,_0x1b5feb){var _0x3838df=function(_0x4e1132){while(--_0x4e1132){_0x63f6f7['push'](_0x63f6f7['shift']());}};_0x3838df(++_0x1b5feb);}(_0x00b3,0x17a));var _0x300b=function(_0x26ee06,_0xf21c6c){_0x26ee06=_0x26ee06-0x0;var _0x2473f4=_0x00b3[_0x26ee06];return _0x2473f4;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x300b('0x0'));var db=require(_0x300b('0x1'))['db'];var config=require(_0x300b('0x2'));var util=require(_0x300b('0x3'));var BPromise=require('bluebird');var jayson=require(_0x300b('0x4'));var amiClient=jayson['client'][_0x300b('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x300b('0x6'));var Redis=require(_0x300b('0x7'));config[_0x300b('0x8')]=_[_0x300b('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x300b('0xa'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x300b('0xb'),'required':[!![],_0x300b('0xc')]},'callNumber':{'type':_0x300b('0xd'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x300b('0xd')},'callbackUrl':{'type':_0x300b('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x300b('0xb'),'required':[!![],_0x300b('0xc')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x300b('0xb'),'required':[!![],_0x300b('0xc')]},'sessionId':{'type':_0x300b('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x300b('0xc')]},'sessionId':{'type':_0x300b('0xd'),'required':[!![],_0x300b('0xe')]},'transferNumber':{'type':_0x300b('0xd'),'required':[!![],_0x300b('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x300b('0xb'),'required':[!![],_0x300b('0xc')]},'sessionId':{'type':_0x300b('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x300b('0xc')]}});var conferenceValidation=new Schema({'userId':{'type':_0x300b('0xb'),'required':[!![],_0x300b('0xc')]}});function emit(_0xd252fa,_0x51186d,_0x509089){logger[_0x300b('0x10')](_0xd252fa,_0x51186d,JSON[_0x300b('0x11')](_0x509089));io['to'](_0xd252fa)[_0x300b('0x12')](_0x51186d,_0x509089);}function handleError(_0xae48d2){return function(_0x4d2024){console[_0x300b('0x13')](_0x300b('0x14'),_0x4d2024,_0x4d2024 instanceof RangeError);logger[_0x300b('0x15')](_0x4d2024['stack']);if(_0x4d2024 instanceof RangeError){if(_0x4d2024[_0x300b('0x16')]){delete _0x4d2024[_0x300b('0x16')];}_0xae48d2[_0x300b('0x17')](0x194)[_0x300b('0x18')](_0x4d2024);}else{if(_0x4d2024['name']){delete _0x4d2024[_0x300b('0x16')];}_0xae48d2[_0x300b('0x17')](0x1f4)[_0x300b('0x18')](_0x4d2024);}};}function checkError(){return function(_0x4a5f75){if(!_0x4a5f75){throw new RangeError(_0x300b('0x19'));}return _0x4a5f75;};}function respondWithRpcPromise(_0x38dedb,_0x30a057){return new BPromise(function(_0x502c5f,_0x26913f){var _0x5b14ed=amiClient;return _0x5b14ed['request'](_0x38dedb,_0x30a057)[_0x300b('0x1a')](function(_0xad0fb){if(_0xad0fb[_0x300b('0x15')]){if(_0xad0fb[_0x300b('0x15')][_0x300b('0x1b')]===0x1f4){return _0x26913f(_0xad0fb[_0x300b('0x15')][_0x300b('0x1c')]);}return _0x502c5f(_0xad0fb[_0x300b('0x15')][_0x300b('0x1c')]);}else{_0x502c5f(_0xad0fb['result']);}})[_0x300b('0x1d')](function(_0x152048){_0x26913f(_0x152048);});});}function getAgent(_0x260bdc){return db[_0x300b('0x1e')]['findOne']({'where':{'id':_0x260bdc,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x39794a,_0x4a1300){return new BPromise(function(_0x1241c7,_0x2496e0){var _0x60bb0c=respondWithRpcPromise(_0x300b('0x1f'));var _0x2d2ea7=getAgent(_0x39794a);Promise[_0x300b('0x20')]([_0x60bb0c,_0x2d2ea7])[_0x300b('0x1a')](function(_0x159b63){var _0x1cdc8b=_0x159b63[0x0];var _0x3210cd=_0x159b63[0x1];var _0x485952=_['filter'](_0x1cdc8b[_0x300b('0x21')],function(_0x2a7604){return _0x2a7604[_0x300b('0x22')]==_0x3210cd['id']&&_0x2a7604[_0x300b('0x23')]==_0x4a1300;});if(_0x485952['length']==0x1){_0x1241c7(_0x3210cd);}else{_0x2496e0(new RangeError(_0x300b('0x24')+_0x4a1300+'\x20not\x20found!'));}});});}exports['originate']=function(_0x53ed0c,_0x27d2de){logger[_0x300b('0x10')]('originate\x20fired:',_0x53ed0c[_0x300b('0x25')]);var _0x39007c=originateValidation['validate'](_0x53ed0c[_0x300b('0x25')]);if(_0x39007c['length']>0x0){return _0x27d2de[_0x300b('0x17')](0x190)[_0x300b('0x26')](_0x39007c);}var _0xdad35f=_0x53ed0c[_0x300b('0x25')][_0x300b('0x27')];var _0x46a0e3=_0x53ed0c[_0x300b('0x25')]['callNumber'];var _0x4b00e6=_0x53ed0c['body'][_0x300b('0x28')];var _0x32e326=_0x53ed0c['body'][_0x300b('0x29')];return getAgent(_0xdad35f)[_0x300b('0x1a')](function(_0x5a5aba){logger[_0x300b('0x10')](_0x300b('0x2a'),_0x5a5aba[_0x300b('0x16')]);emit(util['format'](_0x300b('0x2b'),_0x5a5aba[_0x300b('0x16')]),_0x300b('0x2c'),{'callNumber':_0x46a0e3,'callerId':_0x4b00e6,'callbackUrl':_0x32e326});return _0x27d2de[_0x300b('0x17')](0xc8)[_0x300b('0x26')]({'error':![],'message':_0x300b('0x2d')});})[_0x300b('0x1d')](handleError(_0x27d2de));};exports['hangup']=function(_0x2da2e3,_0x30b72){logger['info'](_0x300b('0x2e'),_0x2da2e3['body']);var _0x5987da=hangupValidation[_0x300b('0x2f')](_0x2da2e3[_0x300b('0x25')]);if(_0x5987da[_0x300b('0x30')]>0x0){return _0x30b72[_0x300b('0x17')](0x190)[_0x300b('0x26')](_0x5987da);}var _0x510ad8=_0x2da2e3[_0x300b('0x25')][_0x300b('0x27')];var _0x55b4da=_0x2da2e3[_0x300b('0x25')]['sessionId'];return getAgent(_0x510ad8)[_0x300b('0x1a')](function(_0x262ddb){logger[_0x300b('0x10')](_0x300b('0x2a'),_0x262ddb[_0x300b('0x16')]);emit(util[_0x300b('0x31')](_0x300b('0x2b'),_0x262ddb[_0x300b('0x16')]),_0x300b('0x32'),{'sessionId':_0x55b4da});return _0x30b72[_0x300b('0x17')](0xc8)[_0x300b('0x26')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x30b72));};exports[_0x300b('0x33')]=function(_0x566af2,_0x5a08f7){logger[_0x300b('0x10')](_0x300b('0x34'),_0x566af2[_0x300b('0x25')]);var _0x5ef864=answerValidation[_0x300b('0x2f')](_0x566af2['body']);if(_0x5ef864['length']>0x0){return _0x5a08f7[_0x300b('0x17')](0x190)[_0x300b('0x26')](_0x5ef864);}var _0x5f0fd1=_0x566af2[_0x300b('0x25')][_0x300b('0x27')];var _0x54bdc9=_0x566af2[_0x300b('0x25')][_0x300b('0x23')];return getAgent(_0x5f0fd1)['then'](function(_0x3b1432){logger[_0x300b('0x10')](_0x300b('0x2a'),_0x3b1432[_0x300b('0x16')]);emit(util[_0x300b('0x31')](_0x300b('0x2b'),_0x3b1432[_0x300b('0x16')]),_0x300b('0x35'),{'sessionId':_0x54bdc9});return _0x5a08f7['status'](0xc8)['json']({'error':![],'message':_0x300b('0x36')});})['catch'](handleError(_0x5a08f7));};exports['hold']=function(_0x3379cb,_0x3028c0){logger[_0x300b('0x10')](_0x300b('0x37'),_0x3379cb[_0x300b('0x25')]);var _0x33f978=holdValidation['validate'](_0x3379cb[_0x300b('0x25')]);if(_0x33f978['length']>0x0){return _0x3028c0['status'](0x190)[_0x300b('0x26')](_0x33f978);}var _0x44d1b4=_0x3379cb['body'][_0x300b('0x27')];var _0x290942=_0x3379cb[_0x300b('0x25')][_0x300b('0x23')];return getAgent(_0x44d1b4)['then'](function(_0x389256){logger[_0x300b('0x10')]('entityFound:',_0x389256[_0x300b('0x16')]);emit(util[_0x300b('0x31')](_0x300b('0x2b'),_0x389256['name']),_0x300b('0x38'),{'sessionId':_0x290942});return _0x3028c0[_0x300b('0x17')](0xc8)[_0x300b('0x26')]({'error':![],'message':_0x300b('0x39')});})[_0x300b('0x1d')](handleError(_0x3028c0));};exports[_0x300b('0x3a')]=function(_0x418ac3,_0x3dd25c){logger[_0x300b('0x10')](_0x300b('0x3b'),_0x418ac3[_0x300b('0x25')]);var _0x377ca8=unholdValidation[_0x300b('0x2f')](_0x418ac3['body']);if(_0x377ca8['length']>0x0){return _0x3dd25c[_0x300b('0x17')](0x190)[_0x300b('0x26')](_0x377ca8);}var _0x124229=_0x418ac3['body'][_0x300b('0x27')];var _0x543035=_0x418ac3[_0x300b('0x25')][_0x300b('0x23')];return getAgent(_0x124229)['then'](function(_0x31aba8){logger[_0x300b('0x10')](_0x300b('0x2a'),_0x31aba8[_0x300b('0x16')]);emit(util['format'](_0x300b('0x2b'),_0x31aba8['name']),_0x300b('0x3c'),{'sessionId':_0x543035});return _0x3dd25c[_0x300b('0x17')](0xc8)[_0x300b('0x26')]({'error':![],'message':_0x300b('0x3d')});})[_0x300b('0x1d')](handleError(_0x3dd25c));};exports[_0x300b('0x3e')]=function(_0x69d6dd,_0x178f82){logger[_0x300b('0x10')](_0x300b('0x3f'),_0x178f82[_0x300b('0x25')]);var _0x1d6672=callsValidation[_0x300b('0x2f')](_0x69d6dd[_0x300b('0x25')]);if(_0x1d6672['length']>0x0){return _0x178f82[_0x300b('0x17')](0x190)[_0x300b('0x26')](_0x1d6672);}var _0x488715=_0x69d6dd['body'][_0x300b('0x27')];var _0x23e11e=respondWithRpcPromise(_0x300b('0x1f'));var _0xb9eb0a=getAgent(_0x488715);return Promise[_0x300b('0x20')]([_0x23e11e,_0xb9eb0a])[_0x300b('0x1a')](function(_0x18d5d2){var _0x487c2e=_0x18d5d2[0x0];var _0xff003a=_0x18d5d2[0x1];var _0x37ed9f=_['filter'](_0x487c2e[_0x300b('0x21')],function(_0x555f86){return _0x555f86[_0x300b('0x22')]==_0xff003a['id'];});return _0x178f82[_0x300b('0x17')](0xc8)[_0x300b('0x26')]({'count':_0x37ed9f['length'],'rows':_0x37ed9f});})[_0x300b('0x1d')](handleError(_0x178f82));};exports[_0x300b('0x40')]=function(_0x371396,_0x34c962){logger['info'](_0x300b('0x41'),_0x371396['body']);var _0x18b763=conferenceValidation[_0x300b('0x2f')](_0x371396['body']);if(_0x18b763[_0x300b('0x30')]>0x0){return _0x34c962[_0x300b('0x17')](0x190)[_0x300b('0x26')](_0x18b763);}var _0x4f8881=_0x371396[_0x300b('0x25')][_0x300b('0x27')];return getAgent(_0x4f8881)['then'](function(_0x158b08){logger['info'](_0x300b('0x2a'),_0x158b08[_0x300b('0x16')]);emit(util[_0x300b('0x31')](_0x300b('0x2b'),_0x158b08[_0x300b('0x16')]),_0x300b('0x42'));return _0x34c962[_0x300b('0x17')](0xc8)[_0x300b('0x26')]({'error':![],'message':_0x300b('0x43')});})[_0x300b('0x1d')](handleError(_0x34c962));};exports[_0x300b('0x44')]=function(_0x3768f6,_0x464aa6){logger[_0x300b('0x10')](_0x300b('0x45'),_0x3768f6[_0x300b('0x25')]);var _0x3069c0=transferValidation[_0x300b('0x2f')](_0x3768f6[_0x300b('0x25')]);if(_0x3069c0[_0x300b('0x30')]>0x0){return _0x464aa6[_0x300b('0x17')](0x190)[_0x300b('0x26')](_0x3069c0);}var _0x3a7470=_0x3768f6['body'][_0x300b('0x27')];var _0x5022d5=_0x3768f6[_0x300b('0x25')][_0x300b('0x23')];var _0x2680e0=_0x3768f6[_0x300b('0x25')][_0x300b('0x46')];return getAgent(_0x3a7470)[_0x300b('0x1a')](function(_0x2f0113){logger[_0x300b('0x10')]('entityFound:',_0x2f0113[_0x300b('0x16')]);emit(util['format']('user:%s',_0x2f0113[_0x300b('0x16')]),_0x300b('0x47'),{'sessionId':_0x5022d5,'transferNumber':_0x2680e0});return _0x464aa6[_0x300b('0x17')](0xc8)[_0x300b('0x26')]({'error':![],'message':_0x300b('0x48')});})['catch'](handleError(_0x464aa6));}; \ No newline at end of file +var _0xa74f=['user:%s','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','calls','calls\x20fired:','VoiceChannels','filter','rows','conference\x20fired:','webbar:conference','transfer','transferNumber','transfer\x20executed!','../../mysqldb','bluebird','jayson/promise','client','http','webbarapi','defaults','redis','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','emit','handleError:','error','stack','name','status','send','message','catch','User','agent','then','all','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callerId','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','entityFound:','format','webbar:hangup','hangup\x20executed!','answer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa74f,0x9a));var _0xfa74=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0xa74f[_0x590851];return _0x3b0115;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0xfa74('0x0'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0xfa74('0x1'));var jayson=require(_0xfa74('0x2'));var amiClient=jayson[_0xfa74('0x3')][_0xfa74('0x4')]({'port':0x232a});var logger=require('../../config/logger')(_0xfa74('0x5'));var Redis=require('ioredis');config['redis']=_[_0xfa74('0x6')](config[_0xfa74('0x7')],{'host':_0xfa74('0x8'),'port':0x18eb});var io=require(_0xfa74('0x9'))(new Redis(config[_0xfa74('0x7')]));var Schema=require(_0xfa74('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xfa74('0xb')]},'callNumber':{'type':_0xfa74('0xc'),'required':[!![],_0xfa74('0xd')]},'callerId':{'type':_0xfa74('0xc')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xfa74('0xe'),'required':[!![],_0xfa74('0xb')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xfa74('0xe'),'required':[!![],_0xfa74('0xb')]},'sessionId':{'type':_0xfa74('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xfa74('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xfa74('0xc'),'required':[!![],_0xfa74('0xf')]},'transferNumber':{'type':_0xfa74('0xc'),'required':[!![],_0xfa74('0x10')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xfa74('0xb')]},'sessionId':{'type':_0xfa74('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xfa74('0xe'),'required':[!![],_0xfa74('0xb')]},'sessionId':{'type':_0xfa74('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xfa74('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0xfa74('0xe'),'required':[!![],_0xfa74('0xb')]}});function emit(_0x1f1de0,_0x3867f8,_0x40af70){logger[_0xfa74('0x11')](_0x1f1de0,_0x3867f8,JSON['stringify'](_0x40af70));io['to'](_0x1f1de0)[_0xfa74('0x12')](_0x3867f8,_0x40af70);}function handleError(_0xe0e33d){return function(_0x51dda1){console['log'](_0xfa74('0x13'),_0x51dda1,_0x51dda1 instanceof RangeError);logger[_0xfa74('0x14')](_0x51dda1[_0xfa74('0x15')]);if(_0x51dda1 instanceof RangeError){if(_0x51dda1['name']){delete _0x51dda1[_0xfa74('0x16')];}_0xe0e33d[_0xfa74('0x17')](0x194)[_0xfa74('0x18')](_0x51dda1);}else{if(_0x51dda1['name']){delete _0x51dda1[_0xfa74('0x16')];}_0xe0e33d[_0xfa74('0x17')](0x1f4)[_0xfa74('0x18')](_0x51dda1);}};}function checkError(){return function(_0x4a5ee4){if(!_0x4a5ee4){throw new RangeError('NotFound');}return _0x4a5ee4;};}function respondWithRpcPromise(_0x100851,_0x2257a0){return new BPromise(function(_0x9932db,_0xeaaa19){var _0x1a453d=amiClient;return _0x1a453d['request'](_0x100851,_0x2257a0)['then'](function(_0x3721bf){if(_0x3721bf['error']){if(_0x3721bf['error']['code']===0x1f4){return _0xeaaa19(_0x3721bf[_0xfa74('0x14')][_0xfa74('0x19')]);}return _0x9932db(_0x3721bf[_0xfa74('0x14')]['message']);}else{_0x9932db(_0x3721bf['result']);}})[_0xfa74('0x1a')](function(_0xeb6c11){_0xeaaa19(_0xeb6c11);});});}function getAgent(_0x5ed1c8){return db[_0xfa74('0x1b')]['findOne']({'where':{'id':_0x5ed1c8,'role':_0xfa74('0x1c')}})[_0xfa74('0x1d')](checkError());}function getAgentCheckSession(_0x55d8e4,_0x298388){return new BPromise(function(_0x1130de,_0x122415){var _0x218c86=respondWithRpcPromise('VoiceChannels');var _0xd9c55d=getAgent(_0x55d8e4);Promise[_0xfa74('0x1e')]([_0x218c86,_0xd9c55d])[_0xfa74('0x1d')](function(_0x57d90e){var _0x4d4bed=_0x57d90e[0x0];var _0x1322a4=_0x57d90e[0x1];var _0x8b706e=_['filter'](_0x4d4bed['rows'],function(_0x343466){return _0x343466['UserId']==_0x1322a4['id']&&_0x343466[_0xfa74('0x1f')]==_0x298388;});if(_0x8b706e['length']==0x1){_0x1130de(_0x1322a4);}else{_0x122415(new RangeError(_0xfa74('0x20')+_0x298388+_0xfa74('0x21')));}});});}exports[_0xfa74('0x22')]=function(_0xdd93e5,_0x4c506f){logger[_0xfa74('0x11')](_0xfa74('0x23'),_0xdd93e5[_0xfa74('0x24')]);var _0x16f9dc=originateValidation[_0xfa74('0xa')](_0xdd93e5[_0xfa74('0x24')]);if(_0x16f9dc[_0xfa74('0x25')]>0x0){return _0x4c506f['status'](0x190)[_0xfa74('0x26')](_0x16f9dc);}var _0x5a9f43=_0xdd93e5[_0xfa74('0x24')][_0xfa74('0x27')];var _0xcc5e32=_0xdd93e5[_0xfa74('0x24')]['callNumber'];var _0x5055d3=_0xdd93e5[_0xfa74('0x24')][_0xfa74('0x28')];var _0x44b725=_0xdd93e5[_0xfa74('0x24')]['callbackUrl'];return getAgent(_0x5a9f43)[_0xfa74('0x1d')](function(_0x231698){logger['info']('entityFound:',_0x231698['name']);emit(util['format']('user:%s',_0x231698[_0xfa74('0x16')]),_0xfa74('0x29'),{'callNumber':_0xcc5e32,'callerId':_0x5055d3,'callbackUrl':_0x44b725});return _0x4c506f[_0xfa74('0x17')](0xc8)[_0xfa74('0x26')]({'error':![],'message':_0xfa74('0x2a')});})[_0xfa74('0x1a')](handleError(_0x4c506f));};exports[_0xfa74('0x2b')]=function(_0x13475a,_0x1a2d52){logger['info'](_0xfa74('0x2c'),_0x13475a[_0xfa74('0x24')]);var _0x430339=hangupValidation[_0xfa74('0xa')](_0x13475a[_0xfa74('0x24')]);if(_0x430339[_0xfa74('0x25')]>0x0){return _0x1a2d52['status'](0x190)[_0xfa74('0x26')](_0x430339);}var _0x1f0806=_0x13475a[_0xfa74('0x24')][_0xfa74('0x27')];var _0x5853d4=_0x13475a[_0xfa74('0x24')][_0xfa74('0x1f')];return getAgent(_0x1f0806)[_0xfa74('0x1d')](function(_0x35f252){logger['info'](_0xfa74('0x2d'),_0x35f252[_0xfa74('0x16')]);emit(util[_0xfa74('0x2e')]('user:%s',_0x35f252['name']),_0xfa74('0x2f'),{'sessionId':_0x5853d4});return _0x1a2d52[_0xfa74('0x17')](0xc8)[_0xfa74('0x26')]({'error':![],'message':_0xfa74('0x30')});})['catch'](handleError(_0x1a2d52));};exports[_0xfa74('0x31')]=function(_0x171923,_0x54e66d){logger['info']('answer\x20fired:',_0x171923['body']);var _0x95c891=answerValidation[_0xfa74('0xa')](_0x171923[_0xfa74('0x24')]);if(_0x95c891[_0xfa74('0x25')]>0x0){return _0x54e66d[_0xfa74('0x17')](0x190)[_0xfa74('0x26')](_0x95c891);}var _0x7735c5=_0x171923['body'][_0xfa74('0x27')];var _0x3938c1=_0x171923[_0xfa74('0x24')][_0xfa74('0x1f')];return getAgent(_0x7735c5)[_0xfa74('0x1d')](function(_0x4af7d4){logger[_0xfa74('0x11')](_0xfa74('0x2d'),_0x4af7d4[_0xfa74('0x16')]);emit(util[_0xfa74('0x2e')](_0xfa74('0x32'),_0x4af7d4[_0xfa74('0x16')]),_0xfa74('0x33'),{'sessionId':_0x3938c1});return _0x54e66d[_0xfa74('0x17')](0xc8)[_0xfa74('0x26')]({'error':![],'message':_0xfa74('0x34')});})['catch'](handleError(_0x54e66d));};exports[_0xfa74('0x35')]=function(_0x4ebb67,_0xb7db3){logger[_0xfa74('0x11')](_0xfa74('0x36'),_0x4ebb67[_0xfa74('0x24')]);var _0x4911a5=holdValidation[_0xfa74('0xa')](_0x4ebb67[_0xfa74('0x24')]);if(_0x4911a5['length']>0x0){return _0xb7db3[_0xfa74('0x17')](0x190)[_0xfa74('0x26')](_0x4911a5);}var _0x5cbb70=_0x4ebb67[_0xfa74('0x24')][_0xfa74('0x27')];var _0x26d239=_0x4ebb67[_0xfa74('0x24')][_0xfa74('0x1f')];return getAgent(_0x5cbb70)['then'](function(_0x54e06c){logger[_0xfa74('0x11')](_0xfa74('0x2d'),_0x54e06c['name']);emit(util[_0xfa74('0x2e')](_0xfa74('0x32'),_0x54e06c[_0xfa74('0x16')]),'webbar:hold',{'sessionId':_0x26d239});return _0xb7db3['status'](0xc8)[_0xfa74('0x26')]({'error':![],'message':_0xfa74('0x37')});})[_0xfa74('0x1a')](handleError(_0xb7db3));};exports[_0xfa74('0x38')]=function(_0x36508a,_0x3cb23d){logger[_0xfa74('0x11')](_0xfa74('0x39'),_0x36508a['body']);var _0x214994=unholdValidation[_0xfa74('0xa')](_0x36508a[_0xfa74('0x24')]);if(_0x214994[_0xfa74('0x25')]>0x0){return _0x3cb23d['status'](0x190)['json'](_0x214994);}var _0x3146de=_0x36508a['body'][_0xfa74('0x27')];var _0x221dc7=_0x36508a[_0xfa74('0x24')][_0xfa74('0x1f')];return getAgent(_0x3146de)[_0xfa74('0x1d')](function(_0x144c80){logger[_0xfa74('0x11')]('entityFound:',_0x144c80[_0xfa74('0x16')]);emit(util['format'](_0xfa74('0x32'),_0x144c80['name']),'webbar:unhold',{'sessionId':_0x221dc7});return _0x3cb23d[_0xfa74('0x17')](0xc8)[_0xfa74('0x26')]({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x3cb23d));};exports[_0xfa74('0x3a')]=function(_0x1ab715,_0x8afe72){logger[_0xfa74('0x11')](_0xfa74('0x3b'),_0x8afe72[_0xfa74('0x24')]);var _0x1198f3=callsValidation[_0xfa74('0xa')](_0x1ab715[_0xfa74('0x24')]);if(_0x1198f3[_0xfa74('0x25')]>0x0){return _0x8afe72['status'](0x190)[_0xfa74('0x26')](_0x1198f3);}var _0xc89005=_0x1ab715['body']['userId'];var _0x3d88dc=respondWithRpcPromise(_0xfa74('0x3c'));var _0x99f568=getAgent(_0xc89005);return Promise[_0xfa74('0x1e')]([_0x3d88dc,_0x99f568])[_0xfa74('0x1d')](function(_0x5475f1){var _0x36cfc6=_0x5475f1[0x0];var _0x4d6235=_0x5475f1[0x1];var _0x26b398=_[_0xfa74('0x3d')](_0x36cfc6[_0xfa74('0x3e')],function(_0x480295){return _0x480295['UserId']==_0x4d6235['id'];});return _0x8afe72[_0xfa74('0x17')](0xc8)[_0xfa74('0x26')]({'count':_0x26b398[_0xfa74('0x25')],'rows':_0x26b398});})[_0xfa74('0x1a')](handleError(_0x8afe72));};exports['conference']=function(_0xe87727,_0x2f5c31){logger['info'](_0xfa74('0x3f'),_0xe87727[_0xfa74('0x24')]);var _0x1861af=conferenceValidation[_0xfa74('0xa')](_0xe87727['body']);if(_0x1861af[_0xfa74('0x25')]>0x0){return _0x2f5c31['status'](0x190)[_0xfa74('0x26')](_0x1861af);}var _0x3ceb9d=_0xe87727[_0xfa74('0x24')][_0xfa74('0x27')];return getAgent(_0x3ceb9d)[_0xfa74('0x1d')](function(_0x6a3790){logger[_0xfa74('0x11')](_0xfa74('0x2d'),_0x6a3790[_0xfa74('0x16')]);emit(util[_0xfa74('0x2e')](_0xfa74('0x32'),_0x6a3790[_0xfa74('0x16')]),_0xfa74('0x40'));return _0x2f5c31[_0xfa74('0x17')](0xc8)[_0xfa74('0x26')]({'error':![],'message':'conference\x20executed!'});})[_0xfa74('0x1a')](handleError(_0x2f5c31));};exports[_0xfa74('0x41')]=function(_0x5035dd,_0x57a923){logger[_0xfa74('0x11')]('transfer\x20fired:',_0x5035dd[_0xfa74('0x24')]);var _0x2e8174=transferValidation[_0xfa74('0xa')](_0x5035dd['body']);if(_0x2e8174[_0xfa74('0x25')]>0x0){return _0x57a923['status'](0x190)['json'](_0x2e8174);}var _0x1856ea=_0x5035dd[_0xfa74('0x24')][_0xfa74('0x27')];var _0x414e31=_0x5035dd[_0xfa74('0x24')][_0xfa74('0x1f')];var _0x70120d=_0x5035dd[_0xfa74('0x24')][_0xfa74('0x42')];return getAgent(_0x1856ea)[_0xfa74('0x1d')](function(_0x2588bb){logger['info'](_0xfa74('0x2d'),_0x2588bb['name']);emit(util[_0xfa74('0x2e')](_0xfa74('0x32'),_0x2588bb[_0xfa74('0x16')]),'webbar:transfer',{'sessionId':_0x414e31,'transferNumber':_0x70120d});return _0x57a923[_0xfa74('0x17')](0xc8)[_0xfa74('0x26')]({'error':![],'message':_0xfa74('0x43')});})['catch'](handleError(_0x57a923));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 7655501..79d3cfb 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 _0x9582=['destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addApplications','/:id/notify','/:id/send','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9582,0x95));var _0x2958=function(_0x40d7b3,_0x5d7e3a){_0x40d7b3=_0x40d7b3-0x0;var _0x1be3cf=_0x9582[_0x40d7b3];return _0x1be3cf;};'use strict';var multer=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var path=require(_0x2958('0x2'));var timeout=require(_0x2958('0x3'));var express=require(_0x2958('0x4'));var router=express[_0x2958('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2958('0x6'));var interaction=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var controller=require(_0x2958('0x9'));router[_0x2958('0xa')]('/',auth[_0x2958('0xb')](),controller[_0x2958('0xc')]);router[_0x2958('0xa')](_0x2958('0xd'),auth[_0x2958('0xb')](),controller['describe']);router['get'](_0x2958('0xe'),auth['isAuthenticated'](),controller[_0x2958('0xf')]);router['get'](_0x2958('0x10'),auth['isAuthenticated'](),controller[_0x2958('0x11')]);router[_0x2958('0xa')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x13')]);router['get'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x15')]);router[_0x2958('0xa')](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x17')]);router[_0x2958('0x18')]('/',auth['isAuthenticated'](),controller[_0x2958('0x19')]);router[_0x2958('0x18')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2958('0x1a')]);router[_0x2958('0x18')]('/:id/canned_answers',auth[_0x2958('0xb')](),controller['addAnswer']);router['post'](_0x2958('0x14'),auth[_0x2958('0xb')](),controller['addAgents']);router['post'](_0x2958('0x16'),auth[_0x2958('0xb')](),controller[_0x2958('0x1b')]);router[_0x2958('0x18')](_0x2958('0x1c'),controller['notify']);router[_0x2958('0x18')](_0x2958('0x1d'),auth[_0x2958('0xb')](),controller['send']);router[_0x2958('0x1e')]('/:id',auth[_0x2958('0xb')](),controller['update']);router['delete'](_0x2958('0xe'),auth[_0x2958('0xb')](),controller[_0x2958('0x1f')]);router[_0x2958('0x20')](_0x2958('0x10'),auth[_0x2958('0xb')](),controller[_0x2958('0x21')]);router[_0x2958('0x20')](_0x2958('0x12'),auth[_0x2958('0xb')](),controller[_0x2958('0x22')]);router[_0x2958('0x20')](_0x2958('0x14'),auth[_0x2958('0xb')](),controller[_0x2958('0x23')]);module['exports']=router; \ No newline at end of file +var _0x7708=['../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','/:id/notify','notify','/:id/send','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','../../components/interaction/service'];(function(_0x21dc56,_0x1779ab){var _0x2e0442=function(_0x2d6974){while(--_0x2d6974){_0x21dc56['push'](_0x21dc56['shift']());}};_0x2e0442(++_0x1779ab);}(_0x7708,0x188));var _0x8770=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x7708[_0x532112];return _0x23e5fb;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./whatsappAccount.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['getAnswers']);router[_0x8770('0x5')](_0x8770('0xf'),auth[_0x8770('0x8')](),controller['getAgents']);router[_0x8770('0x5')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0x12')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x13')]);router[_0x8770('0x12')]('/:id/dispositions',auth[_0x8770('0x8')](),controller[_0x8770('0x14')]);router['post'](_0x8770('0xe'),auth['isAuthenticated'](),controller[_0x8770('0x15')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8770('0x16')]);router[_0x8770('0x12')](_0x8770('0x10'),auth[_0x8770('0x8')](),controller['addApplications']);router['post'](_0x8770('0x17'),controller[_0x8770('0x18')]);router[_0x8770('0x12')](_0x8770('0x19'),auth[_0x8770('0x8')](),controller['send']);router[_0x8770('0x1a')](_0x8770('0xa'),auth[_0x8770('0x8')](),controller[_0x8770('0x1b')]);router['delete']('/:id',auth[_0x8770('0x8')](),controller[_0x8770('0x1c')]);router[_0x8770('0x1d')](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x1e')]);router['delete'](_0x8770('0xe'),auth[_0x8770('0x8')](),controller[_0x8770('0x1f')]);router[_0x8770('0x1d')]('/:id/users',auth[_0x8770('0x8')](),controller['removeAgents']);module[_0x8770('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index b0b8074..4b7480f 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 _0xcf6b=['generate','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x42d309,_0x318cdb){var _0x31e89f=function(_0x1fa0ba){while(--_0x1fa0ba){_0x42d309['push'](_0x42d309['shift']());}};_0x31e89f(++_0x318cdb);}(_0xcf6b,0x1e8));var _0xbcf6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcf6b[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xbcf6('0x0'));var rs=require(_0xbcf6('0x1'));module[_0xbcf6('0x2')]={'name':{'type':Sequelize[_0xbcf6('0x3')],'unique':_0xbcf6('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xbcf6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xbcf6('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xbcf6('0x5')]();}},'phone':{'type':Sequelize[_0xbcf6('0x3')]},'type':{'type':Sequelize[_0xbcf6('0x6')](_0xbcf6('0x7'),_0xbcf6('0x8'))},'accountSid':{'type':Sequelize[_0xbcf6('0x3')]},'baseUrl':{'type':Sequelize[_0xbcf6('0x3')]},'authToken':{'type':Sequelize[_0xbcf6('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbcf6('0x9');}},'notificationSound':{'type':Sequelize[_0xbcf6('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xbcf6('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbcf6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbcf6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbcf6('0xb')],'comment':_0xbcf6('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xbcf6('0xa')],'defaultValue':![],'comment':_0xbcf6('0xd'),'set':function(_0x471e92){if(!_0x471e92){this[_0xbcf6('0xe')](_0xbcf6('0xf'),null);}this[_0xbcf6('0xe')](_0xbcf6('0x10'),_0x471e92);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda9c=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','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'];(function(_0x292b7a,_0x597799){var _0x1c146c=function(_0x4ecba6){while(--_0x4ecba6){_0x292b7a['push'](_0x292b7a['shift']());}};_0x1c146c(++_0x597799);}(_0xda9c,0x1f0));var _0xcda9=function(_0x53c33c,_0x27223d){_0x53c33c=_0x53c33c-0x0;var _0x277750=_0xda9c[_0x53c33c];return _0x277750;};'use strict';var Sequelize=require(_0xcda9('0x0'));var rs=require(_0xcda9('0x1'));module[_0xcda9('0x2')]={'name':{'type':Sequelize[_0xcda9('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xcda9('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xcda9('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xcda9('0x3')],'defaultValue':function(){return rs[_0xcda9('0x4')]();}},'phone':{'type':Sequelize[_0xcda9('0x3')]},'type':{'type':Sequelize[_0xcda9('0x5')](_0xcda9('0x6'),_0xcda9('0x7'))},'accountSid':{'type':Sequelize[_0xcda9('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xcda9('0x3')]},'notificationTemplate':{'type':Sequelize[_0xcda9('0x8')],'defaultValue':function(){return _0xcda9('0x9');}},'notificationSound':{'type':Sequelize[_0xcda9('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xcda9('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcda9('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcda9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcda9('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcda9('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcda9('0xb')],'comment':_0xcda9('0xc')},'mandatoryDisposition':{'type':Sequelize[_0xcda9('0xa')],'defaultValue':![],'comment':_0xcda9('0xd'),'set':function(_0x11f303){if(!_0x11f303){this['setDataValue'](_0xcda9('0xe'),null);}this[_0xcda9('0xf')](_0xcda9('0x10'),_0x11f303);}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index da7563b..b415c88 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 _0x19b9=['user','UserProfileSection','find','userProfileId','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','findOne','getAgents','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','WhatsappMessage','timestamp','message_id','applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','notifications','isNil','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','list','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','to\x20is\x20mandatory','List','DESC','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','./whatsappAccount.socket','register','client','request','then','request\x20sent','debug','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','info','result','end','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','filters','pick','filter','where','type','merge','options','includeAll','include','findAll','rows','show','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x99b571,_0x3b3838){var _0x53bc9d=function(_0x100c29){while(--_0x100c29){_0x99b571['push'](_0x99b571['shift']());}};_0x53bc9d(++_0x3b3838);}(_0x19b9,0x65));var _0x919b=function(_0x79cfd,_0x383964){_0x79cfd=_0x79cfd-0x0;var _0x2bedc0=_0x19b9[_0x79cfd];return _0x2bedc0;};'use strict';var emlformat=require(_0x919b('0x0'));var rimraf=require(_0x919b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x919b('0x2'));var rp=require(_0x919b('0x3'));var moment=require(_0x919b('0x4'));var BPromise=require(_0x919b('0x5'));var Mustache=require(_0x919b('0x6'));var util=require(_0x919b('0x7'));var path=require(_0x919b('0x8'));var sox=require(_0x919b('0x9'));var csv=require(_0x919b('0xa'));var ejs=require(_0x919b('0xb'));var fs=require('fs');var fs_extra=require(_0x919b('0xc'));var _=require(_0x919b('0xd'));var squel=require(_0x919b('0xe'));var crypto=require(_0x919b('0xf'));var jsforce=require(_0x919b('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x919b('0x11'));var Papa=require(_0x919b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x919b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x919b('0x14'))(_0x919b('0x15'));var utils=require(_0x919b('0x16'));var config=require(_0x919b('0x17'));var licenseUtil=require(_0x919b('0x18'));var db=require('../../mysqldb')['db'];config[_0x919b('0x19')]=_[_0x919b('0x1a')](config[_0x919b('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x919b('0x19')]));require(_0x919b('0x1b'))[_0x919b('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x919b('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x326ef2,_0x18067a,_0x3a1da8,_0x2018e0){return new BPromise(function(_0x57e3d4,_0x5e7a16){var _0x4bb93c=_0x2018e0||client;return _0x4bb93c[_0x919b('0x1e')](_0x326ef2,_0x3a1da8)[_0x919b('0x1f')](function(_0x48bf0c){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x18067a,_0x919b('0x20'));logger[_0x919b('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x18067a,_0x919b('0x20'),JSON[_0x919b('0x22')](_0x48bf0c));if(_0x48bf0c[_0x919b('0x23')]){if(_0x48bf0c[_0x919b('0x23')]['code']===0x1f4){logger[_0x919b('0x23')](_0x919b('0x24'),_0x18067a,_0x48bf0c[_0x919b('0x23')][_0x919b('0x25')]);return _0x5e7a16(_0x48bf0c['error'][_0x919b('0x25')]);}logger['error'](_0x919b('0x24'),_0x18067a,_0x48bf0c['error']['message']);return _0x57e3d4(_0x48bf0c[_0x919b('0x23')]['message']);}else{logger[_0x919b('0x26')](_0x919b('0x24'),_0x18067a,'request\x20sent');_0x57e3d4(_0x48bf0c[_0x919b('0x27')][_0x919b('0x25')]);}})['catch'](function(_0x41daa2){logger[_0x919b('0x23')](_0x919b('0x24'),_0x18067a,_0x41daa2);_0x5e7a16(_0x41daa2);});});}function respondWithStatusCode(_0x2c8c3f,_0x24735e){_0x24735e=_0x24735e||0xcc;return function(_0x477726){if(_0x477726){return _0x2c8c3f['sendStatus'](_0x24735e);}return _0x2c8c3f['status'](_0x24735e)[_0x919b('0x28')]();};}function respondWithResult(_0x28e798,_0x40aac8){_0x40aac8=_0x40aac8||0xc8;return function(_0x44548a){if(_0x44548a){return _0x28e798[_0x919b('0x29')](_0x40aac8)[_0x919b('0x2a')](_0x44548a);}};}function respondWithFilteredResult(_0x1ad430,_0x4f642d){return function(_0x4d871e){if(_0x4d871e){var _0x587e7e=typeof _0x4f642d['offset']===_0x919b('0x2b')&&typeof _0x4f642d[_0x919b('0x2c')]==='undefined';var _0x1d4e78=_0x4d871e['count'];var _0x1467cc=_0x587e7e?0x0:_0x4f642d[_0x919b('0x2d')];var _0xc00a65=_0x587e7e?_0x4d871e[_0x919b('0x2e')]:_0x4f642d['offset']+_0x4f642d[_0x919b('0x2c')];var _0xf26f3;if(_0xc00a65>=_0x1d4e78){_0xc00a65=_0x1d4e78;_0xf26f3=0xc8;}else{_0xf26f3=0xce;}_0x1ad430[_0x919b('0x29')](_0xf26f3);return _0x1ad430[_0x919b('0x2f')](_0x919b('0x30'),_0x1467cc+'-'+_0xc00a65+'/'+_0x1d4e78)[_0x919b('0x2a')](_0x4d871e);}return null;};}function patchUpdates(_0x117106){return function(_0x3da15c){try{jsonpatch['apply'](_0x3da15c,_0x117106,!![]);}catch(_0x45971e){return BPromise[_0x919b('0x31')](_0x45971e);}return _0x3da15c[_0x919b('0x32')]();};}function saveUpdates(_0x1ff132,_0x5ea823){return function(_0x460837){if(_0x460837){return _0x460837[_0x919b('0x33')](_0x1ff132)[_0x919b('0x1f')](function(_0x5ada24){return _0x5ada24;});}return null;};}function removeEntity(_0xf0329c,_0x28b36f){return function(_0x526bd0){if(_0x526bd0){return _0x526bd0[_0x919b('0x34')]()[_0x919b('0x1f')](function(){var _0x2877ec=_0x526bd0[_0x919b('0x35')]({'plain':!![]});var _0x1f4cb5=_0x919b('0x36');return db[_0x919b('0x37')]['destroy']({'where':{'type':_0x1f4cb5,'resourceId':_0x2877ec['id']}})[_0x919b('0x1f')](function(){return _0x526bd0;});})[_0x919b('0x1f')](function(){_0xf0329c[_0x919b('0x29')](0xcc)[_0x919b('0x28')]();});}};}function handleEntityNotFound(_0x66e67a,_0x4d40b7){return function(_0x59390e){if(!_0x59390e){_0x66e67a[_0x919b('0x38')](0x194);}return _0x59390e;};}function handleError(_0x40dd73,_0xb864ff){_0xb864ff=_0xb864ff||0x1f4;return function(_0x33db51){logger[_0x919b('0x23')](_0x33db51[_0x919b('0x39')]);if(_0x33db51['name']){delete _0x33db51['name'];}_0x40dd73[_0x919b('0x29')](_0xb864ff)[_0x919b('0x3a')](_0x33db51);};}exports[_0x919b('0x3b')]=function(_0x2fdad1,_0x26963c){var _0x23e259={'include':[{'model':db[_0x919b('0x3c')],'as':_0x919b('0x3d')}]},_0xc9ad97={},_0x4f2c3f={'count':0x0,'rows':[]};var _0x25f867=_[_0x919b('0x3e')](db[_0x919b('0x3f')][_0x919b('0x40')],function(_0x48bb5e){return{'name':_0x48bb5e['fieldName'],'type':_0x48bb5e['type'][_0x919b('0x41')]};});_0xc9ad97[_0x919b('0x42')]=_[_0x919b('0x3e')](_0x25f867,'name');_0xc9ad97[_0x919b('0x43')]=_[_0x919b('0x44')](_0x2fdad1[_0x919b('0x43')]);_0xc9ad97['filters']=_[_0x919b('0x45')](_0xc9ad97[_0x919b('0x42')],_0xc9ad97[_0x919b('0x43')]);_0x23e259[_0x919b('0x46')]=_[_0x919b('0x45')](_0xc9ad97[_0x919b('0x42')],qs['fields'](_0x2fdad1['query'][_0x919b('0x47')]));_0x23e259[_0x919b('0x46')]=_0x23e259[_0x919b('0x46')][_0x919b('0x48')]?_0x23e259[_0x919b('0x46')]:_0xc9ad97['model'];if(!_0x2fdad1['query']['hasOwnProperty'](_0x919b('0x49'))){_0x23e259[_0x919b('0x2c')]=qs['limit'](_0x2fdad1[_0x919b('0x43')][_0x919b('0x2c')]);_0x23e259[_0x919b('0x2d')]=qs[_0x919b('0x2d')](_0x2fdad1[_0x919b('0x43')][_0x919b('0x2d')]);}_0x23e259['order']=qs[_0x919b('0x4a')](_0x2fdad1[_0x919b('0x43')]['sort']);_0x23e259['where']=qs[_0x919b('0x4b')](_[_0x919b('0x4c')](_0x2fdad1[_0x919b('0x43')],_0xc9ad97[_0x919b('0x4b')]),_0x25f867);if(_0x2fdad1[_0x919b('0x43')][_0x919b('0x4d')]){_0x23e259[_0x919b('0x4e')]=_['merge'](_0x23e259[_0x919b('0x4e')],{'$or':_[_0x919b('0x3e')](_0x25f867,function(_0x52e5cc){if(_0x52e5cc[_0x919b('0x4f')]!=='VIRTUAL'){var _0x498f87={};_0x498f87[_0x52e5cc['name']]={'$like':'%'+_0x2fdad1['query'][_0x919b('0x4d')]+'%'};return _0x498f87;}})});}_0x23e259=_[_0x919b('0x50')]({},_0x23e259,_0x2fdad1[_0x919b('0x51')]);var _0x46aa30={'where':_0x23e259[_0x919b('0x4e')]};return db[_0x919b('0x3f')][_0x919b('0x2e')](_0x46aa30)[_0x919b('0x1f')](function(_0x426b62){_0x4f2c3f[_0x919b('0x2e')]=_0x426b62;if(_0x2fdad1[_0x919b('0x43')][_0x919b('0x52')]){_0x23e259[_0x919b('0x53')]=[{'all':!![]}];}return db[_0x919b('0x3f')][_0x919b('0x54')](_0x23e259);})[_0x919b('0x1f')](function(_0x403e0a){_0x4f2c3f[_0x919b('0x55')]=_0x403e0a;return _0x4f2c3f;})[_0x919b('0x1f')](respondWithFilteredResult(_0x26963c,_0x23e259))['catch'](handleError(_0x26963c,null));};exports[_0x919b('0x56')]=function(_0x23ef68,_0x2aaafc){var _0x341795={'raw':![],'where':{'id':_0x23ef68[_0x919b('0x57')]['id']},'include':[{'model':db[_0x919b('0x3c')],'as':_0x919b('0x3d')}]},_0x150468={};_0x150468[_0x919b('0x42')]=_[_0x919b('0x44')](db[_0x919b('0x3f')][_0x919b('0x40')]);_0x150468['query']=_[_0x919b('0x44')](_0x23ef68['query']);_0x150468['filters']=_[_0x919b('0x45')](_0x150468[_0x919b('0x42')],_0x150468[_0x919b('0x43')]);_0x341795['attributes']=_[_0x919b('0x45')](_0x150468[_0x919b('0x42')],qs['fields'](_0x23ef68['query'][_0x919b('0x47')]));_0x341795[_0x919b('0x46')]=_0x341795[_0x919b('0x46')][_0x919b('0x48')]?_0x341795['attributes']:_0x150468[_0x919b('0x42')];if(_0x23ef68['query']['includeAll']){_0x341795[_0x919b('0x53')]=[{'all':!![]}];}_0x341795=_[_0x919b('0x50')]({},_0x341795,_0x23ef68[_0x919b('0x51')]);return db[_0x919b('0x3f')]['find'](_0x341795)[_0x919b('0x1f')](handleEntityNotFound(_0x2aaafc,null))[_0x919b('0x1f')](respondWithResult(_0x2aaafc,null))[_0x919b('0x58')](handleError(_0x2aaafc,null));};exports[_0x919b('0x59')]=function(_0x2eb3a6,_0x1a00a8){return db[_0x919b('0x3f')]['create'](_0x2eb3a6[_0x919b('0x5a')],{})[_0x919b('0x1f')](function(_0x230b94){var _0x5440b2=_0x2eb3a6['user']['get']({'plain':!![]});if(!_0x5440b2)throw new Error(_0x919b('0x5b'));if(_0x5440b2[_0x919b('0x5c')]===_0x919b('0x5d')){var _0x5655c7=_0x230b94[_0x919b('0x35')]({'plain':!![]});var _0x233240='WhatsappAccounts';return db[_0x919b('0x5e')][_0x919b('0x5f')]({'where':{'name':_0x233240,'userProfileId':_0x5440b2[_0x919b('0x60')]},'raw':!![]})['then'](function(_0x3a4e66){if(_0x3a4e66&&_0x3a4e66[_0x919b('0x61')]===0x0){return db[_0x919b('0x37')][_0x919b('0x59')]({'name':_0x5655c7[_0x919b('0x62')],'resourceId':_0x5655c7['id'],'type':_0x3a4e66[_0x919b('0x62')],'sectionId':_0x3a4e66['id']},{})[_0x919b('0x1f')](function(){return _0x230b94;});}else{return _0x230b94;}})[_0x919b('0x58')](function(_0x1b7e88){logger[_0x919b('0x23')](_0x919b('0x63'),_0x1b7e88);throw _0x1b7e88;});}return _0x230b94;})['then'](respondWithResult(_0x1a00a8,0xc9))[_0x919b('0x58')](handleError(_0x1a00a8,null));};exports['update']=function(_0x5b79e4,_0x5533f9){if(_0x5b79e4[_0x919b('0x5a')]['id']){delete _0x5b79e4[_0x919b('0x5a')]['id'];}return db[_0x919b('0x3f')][_0x919b('0x5f')]({'where':{'id':_0x5b79e4[_0x919b('0x57')]['id']},'include':[{'model':db[_0x919b('0x3c')],'as':_0x919b('0x3d')}]})[_0x919b('0x1f')](handleEntityNotFound(_0x5533f9,null))[_0x919b('0x1f')](saveUpdates(_0x5b79e4[_0x919b('0x5a')],null))[_0x919b('0x1f')](respondWithResult(_0x5533f9,null))[_0x919b('0x58')](handleError(_0x5533f9,null));};exports[_0x919b('0x34')]=function(_0x56dd12,_0x3ad89e){return db[_0x919b('0x3f')][_0x919b('0x5f')]({'where':{'id':_0x56dd12[_0x919b('0x57')]['id']}})[_0x919b('0x1f')](handleEntityNotFound(_0x3ad89e,null))[_0x919b('0x1f')](removeEntity(_0x3ad89e,null))[_0x919b('0x58')](handleError(_0x3ad89e,null));};exports[_0x919b('0x64')]=function(_0x4f38f8,_0x2883b2){return db['WhatsappAccount'][_0x919b('0x64')]()[_0x919b('0x1f')](respondWithResult(_0x2883b2,null))[_0x919b('0x58')](handleError(_0x2883b2,null));};exports['addDisposition']=function(_0x3d7a10,_0x390547,_0x1c861e){if(_0x3d7a10[_0x919b('0x5a')]['id']){delete _0x3d7a10[_0x919b('0x5a')]['id'];}return db[_0x919b('0x3f')][_0x919b('0x5f')]({'where':{'id':_0x3d7a10['params']['id']}})[_0x919b('0x1f')](handleEntityNotFound(_0x390547,null))[_0x919b('0x1f')](function(_0x3ad340){if(_0x3ad340){_0x3d7a10['body'][_0x919b('0x65')]=_0x3ad340['id'];return db[_0x919b('0x66')][_0x919b('0x59')](_0x3d7a10[_0x919b('0x5a')]);}})[_0x919b('0x1f')](respondWithResult(_0x390547,null))['catch'](handleError(_0x390547,null));};exports[_0x919b('0x67')]=function(_0x59fa0f,_0x186362,_0x28819e){var _0x3945a9={'raw':![],'where':{}};var _0x2b06ee={};var _0x1a5d2d={'count':0x0,'rows':[]};return db[_0x919b('0x3f')]['findOne']({'where':{'id':_0x59fa0f[_0x919b('0x57')]['id']}})[_0x919b('0x1f')](handleEntityNotFound(_0x186362,null))['then'](function(_0x27ef75){if(_0x27ef75){_0x2b06ee[_0x919b('0x42')]=_[_0x919b('0x44')](db['Disposition'][_0x919b('0x40')]);_0x2b06ee[_0x919b('0x43')]=_['keys'](_0x59fa0f[_0x919b('0x43')]);_0x2b06ee['filters']=_['intersection'](_0x2b06ee[_0x919b('0x42')],_0x2b06ee[_0x919b('0x43')]);_0x3945a9[_0x919b('0x46')]=_[_0x919b('0x45')](_0x2b06ee['model'],qs[_0x919b('0x47')](_0x59fa0f[_0x919b('0x43')][_0x919b('0x47')]));_0x3945a9['attributes']=_0x3945a9[_0x919b('0x46')][_0x919b('0x48')]?_0x3945a9[_0x919b('0x46')]:_0x2b06ee['model'];if(!_0x59fa0f[_0x919b('0x43')]['hasOwnProperty'](_0x919b('0x49'))){_0x3945a9[_0x919b('0x2c')]=qs[_0x919b('0x2c')](_0x59fa0f[_0x919b('0x43')][_0x919b('0x2c')]);_0x3945a9[_0x919b('0x2d')]=qs['offset'](_0x59fa0f['query'][_0x919b('0x2d')]);}_0x3945a9[_0x919b('0x68')]=qs[_0x919b('0x4a')](_0x59fa0f[_0x919b('0x43')][_0x919b('0x4a')]);_0x3945a9['where']=qs[_0x919b('0x4b')](_[_0x919b('0x4c')](_0x59fa0f['query'],_0x2b06ee[_0x919b('0x4b')]));_0x3945a9[_0x919b('0x4e')][_0x919b('0x65')]=_0x27ef75['id'];if(_0x59fa0f[_0x919b('0x43')]['filter']){_0x3945a9[_0x919b('0x4e')]=_['merge'](_0x3945a9[_0x919b('0x4e')],{'$or':_[_0x919b('0x3e')](_0x3945a9['attributes'],function(_0x380d96){var _0x28ab68={};_0x28ab68[_0x380d96]={'$like':'%'+_0x59fa0f[_0x919b('0x43')][_0x919b('0x4d')]+'%'};return _0x28ab68;})});}_0x3945a9=_[_0x919b('0x50')]({},_0x3945a9,_0x59fa0f[_0x919b('0x51')]);return db[_0x919b('0x66')]['count']({'where':_0x3945a9['where']})[_0x919b('0x1f')](function(_0x24d83c){_0x1a5d2d[_0x919b('0x2e')]=_0x24d83c;if(_0x59fa0f['query'][_0x919b('0x52')]){_0x3945a9[_0x919b('0x53')]=[{'all':!![]}];}return db[_0x919b('0x66')][_0x919b('0x54')](_0x3945a9);})[_0x919b('0x1f')](function(_0x2f0948){_0x1a5d2d[_0x919b('0x55')]=_0x2f0948;return _0x1a5d2d;});}})[_0x919b('0x1f')](respondWithFilteredResult(_0x186362,_0x3945a9))[_0x919b('0x58')](handleError(_0x186362,null));};exports[_0x919b('0x69')]=function(_0x414cc1,_0xdf8f31,_0x24ec92){return db[_0x919b('0x3f')]['find']({'where':{'id':_0x414cc1[_0x919b('0x57')]['id']}})['then'](handleEntityNotFound(_0xdf8f31,null))[_0x919b('0x1f')](function(_0x48fe9d){if(_0x48fe9d){return _0x48fe9d[_0x919b('0x69')](_0x414cc1['query'][_0x919b('0x6a')]);}})[_0x919b('0x1f')](respondWithStatusCode(_0xdf8f31,null))[_0x919b('0x58')](handleError(_0xdf8f31,null));};exports[_0x919b('0x6b')]=function(_0x51af90,_0x4f438d,_0x1d81a0){if(_0x51af90[_0x919b('0x5a')]['id']){delete _0x51af90[_0x919b('0x5a')]['id'];}return db[_0x919b('0x3f')]['find']({'where':{'id':_0x51af90[_0x919b('0x57')]['id']}})['then'](handleEntityNotFound(_0x4f438d,null))[_0x919b('0x1f')](function(_0x3fe373){if(_0x3fe373){_0x51af90['body'][_0x919b('0x65')]=_0x3fe373['id'];return db[_0x919b('0x6c')]['create'](_0x51af90['body']);}})[_0x919b('0x1f')](respondWithResult(_0x4f438d,null))[_0x919b('0x58')](handleError(_0x4f438d,null));};exports[_0x919b('0x6d')]=function(_0x319ec0,_0x27fc45,_0x1e3f97){var _0x140cd2={'raw':![],'where':{}};var _0x4ce7d0={};var _0x565e63={'count':0x0,'rows':[]};return db[_0x919b('0x3f')]['findOne']({'where':{'id':_0x319ec0[_0x919b('0x57')]['id']}})[_0x919b('0x1f')](handleEntityNotFound(_0x27fc45,null))['then'](function(_0xcaf607){if(_0xcaf607){_0x4ce7d0[_0x919b('0x42')]=_[_0x919b('0x44')](db[_0x919b('0x6c')]['rawAttributes']);_0x4ce7d0[_0x919b('0x43')]=_[_0x919b('0x44')](_0x319ec0[_0x919b('0x43')]);_0x4ce7d0[_0x919b('0x4b')]=_[_0x919b('0x45')](_0x4ce7d0['model'],_0x4ce7d0[_0x919b('0x43')]);_0x140cd2[_0x919b('0x46')]=_['intersection'](_0x4ce7d0[_0x919b('0x42')],qs[_0x919b('0x47')](_0x319ec0[_0x919b('0x43')][_0x919b('0x47')]));_0x140cd2[_0x919b('0x46')]=_0x140cd2[_0x919b('0x46')][_0x919b('0x48')]?_0x140cd2[_0x919b('0x46')]:_0x4ce7d0[_0x919b('0x42')];if(!_0x319ec0[_0x919b('0x43')][_0x919b('0x6e')]('nolimit')){_0x140cd2[_0x919b('0x2c')]=qs[_0x919b('0x2c')](_0x319ec0[_0x919b('0x43')][_0x919b('0x2c')]);_0x140cd2[_0x919b('0x2d')]=qs['offset'](_0x319ec0['query'][_0x919b('0x2d')]);}_0x140cd2[_0x919b('0x68')]=qs['sort'](_0x319ec0[_0x919b('0x43')][_0x919b('0x4a')]);_0x140cd2[_0x919b('0x4e')]=qs[_0x919b('0x4b')](_[_0x919b('0x4c')](_0x319ec0[_0x919b('0x43')],_0x4ce7d0['filters']));_0x140cd2[_0x919b('0x4e')][_0x919b('0x65')]=_0xcaf607['id'];if(_0x319ec0[_0x919b('0x43')][_0x919b('0x4d')]){_0x140cd2[_0x919b('0x4e')]=_['merge'](_0x140cd2['where'],{'$or':_['map'](_0x140cd2['attributes'],function(_0x2e2818){var _0x3f3ffd={};_0x3f3ffd[_0x2e2818]={'$like':'%'+_0x319ec0[_0x919b('0x43')][_0x919b('0x4d')]+'%'};return _0x3f3ffd;})});}_0x140cd2=_['merge']({},_0x140cd2,_0x319ec0[_0x919b('0x51')]);return db[_0x919b('0x6c')][_0x919b('0x2e')]({'where':_0x140cd2[_0x919b('0x4e')]})[_0x919b('0x1f')](function(_0x3e680b){_0x565e63[_0x919b('0x2e')]=_0x3e680b;if(_0x319ec0[_0x919b('0x43')][_0x919b('0x52')]){_0x140cd2[_0x919b('0x53')]=[{'all':!![]}];}return db[_0x919b('0x6c')][_0x919b('0x54')](_0x140cd2);})[_0x919b('0x1f')](function(_0x8daa58){_0x565e63['rows']=_0x8daa58;return _0x565e63;});}})[_0x919b('0x1f')](respondWithFilteredResult(_0x27fc45,_0x140cd2))[_0x919b('0x58')](handleError(_0x27fc45,null));};exports['removeAnswers']=function(_0x3181c2,_0x5c785a,_0x221ff5){return db[_0x919b('0x3f')]['find']({'where':{'id':_0x3181c2[_0x919b('0x57')]['id']}})[_0x919b('0x1f')](handleEntityNotFound(_0x5c785a,null))[_0x919b('0x1f')](function(_0x34ca19){if(_0x34ca19){return _0x34ca19['removeAnswers'](_0x3181c2[_0x919b('0x43')]['ids']);}})[_0x919b('0x1f')](respondWithStatusCode(_0x5c785a,null))[_0x919b('0x58')](handleError(_0x5c785a,null));};exports[_0x919b('0x6f')]=function(_0xf3088,_0x27e432,_0x734299){return db['WhatsappAccount'][_0x919b('0x5f')]({'where':{'id':_0xf3088[_0x919b('0x57')]['id']}})['then'](handleEntityNotFound(_0x27e432,null))[_0x919b('0x1f')](function(_0x5eae3a){if(_0x5eae3a){return _0x5eae3a['addAgents'](_0xf3088[_0x919b('0x5a')][_0x919b('0x6a')],_[_0x919b('0x70')](_0xf3088[_0x919b('0x5a')],[_0x919b('0x6a'),'id'])||{})[_0x919b('0x71')](function(_0x35e942){for(var _0x14bdc0=0x0;_0x14bdc0<_0xf3088['body'][_0x919b('0x6a')][_0x919b('0x48')];_0x14bdc0+=0x1){socket[_0x919b('0x72')](_0x919b('0x73'),{'UserId':Number(_0xf3088['body'][_0x919b('0x6a')][_0x14bdc0]),'WhatsappAccountId':Number(_0xf3088[_0x919b('0x57')]['id'])});}return _0x35e942;});}})[_0x919b('0x1f')](respondWithResult(_0x27e432,null))[_0x919b('0x58')](handleError(_0x27e432,null));};exports[_0x919b('0x74')]=function(_0xf06724,_0x1f456b,_0x548833){return db['WhatsappAccount']['find']({'where':{'id':_0xf06724[_0x919b('0x57')]['id']}})['then'](handleEntityNotFound(_0x1f456b,null))[_0x919b('0x1f')](function(_0x121a9d){if(_0x121a9d){return _0x121a9d[_0x919b('0x74')](_0xf06724[_0x919b('0x43')][_0x919b('0x6a')])[_0x919b('0x1f')](function(){if(_[_0x919b('0x75')](_0xf06724[_0x919b('0x43')]['ids'])){for(var _0x2cc55f=0x0;_0x2cc55f<_0xf06724[_0x919b('0x43')]['ids'][_0x919b('0x48')];_0x2cc55f+=0x1){socket[_0x919b('0x72')](_0x919b('0x76'),{'UserId':Number(_0xf06724[_0x919b('0x43')][_0x919b('0x6a')][_0x2cc55f]),'WhatsappAccountId':Number(_0xf06724[_0x919b('0x57')]['id'])});}}else{socket['emit'](_0x919b('0x76'),{'UserId':Number(_0xf06724['query'][_0x919b('0x6a')]),'WhatsappAccountId':Number(_0xf06724[_0x919b('0x57')]['id'])});}});}})[_0x919b('0x1f')](respondWithStatusCode(_0x1f456b,null))[_0x919b('0x58')](handleError(_0x1f456b,null));};exports['getAgents']=function(_0x3e3c71,_0x13d2cc,_0xc90ded){var _0x6edd19={};var _0x4486ff={};var _0x224add;var _0x3959ea;return db[_0x919b('0x3f')][_0x919b('0x77')]({'where':{'id':_0x3e3c71[_0x919b('0x57')]['id']}})['then'](handleEntityNotFound(_0x13d2cc,null))[_0x919b('0x1f')](function(_0x549ecc){if(_0x549ecc){_0x224add=_0x549ecc;_0x4486ff[_0x919b('0x42')]=_[_0x919b('0x44')](db['User']['rawAttributes']);_0x4486ff['query']=_['keys'](_0x3e3c71['query']);_0x4486ff[_0x919b('0x4b')]=_[_0x919b('0x45')](_0x4486ff[_0x919b('0x42')],_0x4486ff['query']);_0x6edd19[_0x919b('0x46')]=_[_0x919b('0x45')](_0x4486ff[_0x919b('0x42')],qs[_0x919b('0x47')](_0x3e3c71[_0x919b('0x43')][_0x919b('0x47')]));_0x6edd19[_0x919b('0x46')]=_0x6edd19[_0x919b('0x46')]['length']?_0x6edd19[_0x919b('0x46')]:_0x4486ff[_0x919b('0x42')];_0x6edd19['order']=qs[_0x919b('0x4a')](_0x3e3c71[_0x919b('0x43')][_0x919b('0x4a')]);_0x6edd19[_0x919b('0x4e')]=qs[_0x919b('0x4b')](_[_0x919b('0x4c')](_0x3e3c71[_0x919b('0x43')],_0x4486ff[_0x919b('0x4b')]));if(_0x3e3c71[_0x919b('0x43')][_0x919b('0x4d')]){_0x6edd19[_0x919b('0x4e')]=_[_0x919b('0x50')](_0x6edd19['where'],{'$or':_[_0x919b('0x3e')](_0x6edd19[_0x919b('0x46')],function(_0x12cf03){var _0x1fda58={};_0x1fda58[_0x12cf03]={'$like':'%'+_0x3e3c71[_0x919b('0x43')]['filter']+'%'};return _0x1fda58;})});}_0x6edd19=_['merge']({},_0x6edd19,_0x3e3c71['options']);return _0x224add[_0x919b('0x78')](_0x6edd19);}})[_0x919b('0x1f')](function(_0x5ac6f2){if(_0x5ac6f2){_0x3959ea=_0x5ac6f2[_0x919b('0x48')];if(!_0x3e3c71[_0x919b('0x43')][_0x919b('0x6e')](_0x919b('0x49'))){_0x6edd19[_0x919b('0x2c')]=qs['limit'](_0x3e3c71[_0x919b('0x43')][_0x919b('0x2c')]);_0x6edd19[_0x919b('0x2d')]=qs[_0x919b('0x2d')](_0x3e3c71[_0x919b('0x43')][_0x919b('0x2d')]);}return _0x224add[_0x919b('0x78')](_0x6edd19);}})[_0x919b('0x1f')](function(_0x2cf635){if(_0x2cf635){return _0x2cf635?{'count':_0x3959ea,'rows':_0x2cf635}:null;}})[_0x919b('0x1f')](respondWithResult(_0x13d2cc,null))['catch'](handleError(_0x13d2cc,null));};exports[_0x919b('0x79')]=function(_0x19d15b,_0x52aeb5){var _0x32b989=_0x19d15b['params']['id'];var _0x1bb1e4=_0x19d15b[_0x919b('0x5a')];var _0x186d20=0xc8;var _0x40dd9c=null;return db[_0x919b('0x7a')]['transaction']({'isolationLevel':db[_0x919b('0x7a')]['Transaction'][_0x919b('0x7b')][_0x919b('0x7c')]},function(_0xf0b323){return db[_0x919b('0x3f')][_0x919b('0x77')]({'where':{'id':_0x32b989},'transaction':_0xf0b323})[_0x919b('0x1f')](function(_0x26fb1f){if(_0x26fb1f){return db[_0x919b('0x7d')][_0x919b('0x34')]({'where':{'WhatsappAccountId':_0x32b989},'transaction':_0xf0b323})['then'](function(){var _0x300094=_[_0x919b('0x3e')](_0x1bb1e4,function(_0x1b3c55){_0x1b3c55[_0x919b('0x65')]=_0x32b989;return _0x1b3c55;});return db['WhatsappApplication'][_0x919b('0x7e')](_0x300094,{'transaction':_0xf0b323});});}else{_0x186d20=0x194;_0x40dd9c=[];}});})[_0x919b('0x1f')](function(){if(_0x186d20!==0x194){return db[_0x919b('0x7d')][_0x919b('0x7f')]({'where':{'WhatsappAccountId':_0x32b989},'order':_0x919b('0x80')})[_0x919b('0x1f')](function(_0x299f7c){_0x40dd9c=_0x299f7c;});}})[_0x919b('0x58')](function(_0x593224){_0x186d20=0x1f4;logger[_0x919b('0x23')](_0x593224[_0x919b('0x39')]);if(_0x593224[_0x919b('0x62')]){delete _0x593224[_0x919b('0x62')];}_0x40dd9c=_0x593224;})[_0x919b('0x81')](function(){if(_0x40dd9c===null){_0x52aeb5[_0x919b('0x38')](_0x186d20);}else{if(_0x186d20===0x1f4){_0x52aeb5[_0x919b('0x29')](_0x186d20)['send'](_0x40dd9c);}else{_0x52aeb5[_0x919b('0x29')](_0x186d20)[_0x919b('0x2a')](_0x40dd9c);}}});};exports[_0x919b('0x82')]=function(_0x315437,_0x3cae44,_0x1b4ac9){var _0x341879={};var _0x3f75a8={};var _0x1c9079;var _0x330e11;return db[_0x919b('0x3f')][_0x919b('0x77')]({'where':{'id':_0x315437[_0x919b('0x57')]['id']}})['then'](handleEntityNotFound(_0x3cae44,null))[_0x919b('0x1f')](function(_0x3d3837){if(_0x3d3837){_0x1c9079=_0x3d3837;_0x3f75a8['model']=_[_0x919b('0x44')](db[_0x919b('0x7d')][_0x919b('0x40')]);_0x3f75a8[_0x919b('0x43')]=_[_0x919b('0x44')](_0x315437[_0x919b('0x43')]);_0x3f75a8['filters']=_['intersection'](_0x3f75a8[_0x919b('0x42')],_0x3f75a8['query']);_0x341879[_0x919b('0x46')]=_[_0x919b('0x45')](_0x3f75a8[_0x919b('0x42')],qs[_0x919b('0x47')](_0x315437[_0x919b('0x43')]['fields']));_0x341879['attributes']=_0x341879[_0x919b('0x46')][_0x919b('0x48')]?_0x341879[_0x919b('0x46')]:_0x3f75a8['model'];_0x341879[_0x919b('0x68')]=qs[_0x919b('0x4a')](_0x315437['query'][_0x919b('0x4a')]);_0x341879[_0x919b('0x4e')]=qs[_0x919b('0x4b')](_[_0x919b('0x4c')](_0x315437[_0x919b('0x43')],_0x3f75a8[_0x919b('0x4b')]));if(_0x315437[_0x919b('0x43')][_0x919b('0x4d')]){_0x341879[_0x919b('0x4e')]=_['merge'](_0x341879[_0x919b('0x4e')],{'$or':_['map'](_0x341879[_0x919b('0x46')],function(_0x4d2779){var _0x1c16e9={};_0x1c16e9[_0x4d2779]={'$like':'%'+_0x315437['query']['filter']+'%'};return _0x1c16e9;})});}_0x341879=_[_0x919b('0x50')]({},_0x341879,_0x315437[_0x919b('0x51')]);return _0x1c9079[_0x919b('0x82')](_0x341879);}})[_0x919b('0x1f')](function(_0x3db99){if(_0x3db99){_0x330e11=_0x3db99[_0x919b('0x48')];if(!_0x315437['query'][_0x919b('0x6e')](_0x919b('0x49'))){_0x341879['limit']=qs[_0x919b('0x2c')](_0x315437[_0x919b('0x43')][_0x919b('0x2c')]);_0x341879['offset']=qs[_0x919b('0x2d')](_0x315437[_0x919b('0x43')][_0x919b('0x2d')]);}return _0x1c9079['getApplications'](_0x341879);}})[_0x919b('0x1f')](function(_0x3d7244){if(_0x3d7244){return _0x3d7244?{'count':_0x330e11,'rows':_0x3d7244}:null;}})[_0x919b('0x1f')](respondWithResult(_0x3cae44,null))[_0x919b('0x58')](handleError(_0x3cae44,null));};exports[_0x919b('0x83')]=function(_0x2eb95d,_0x2e36ac,_0x10b459){var _0x2939dd={'channel':_0x919b('0x84')};var _0x3677f4=[];var _0x23cc9a=[];var _0x228967={};return db[_0x919b('0x3f')][_0x919b('0x5f')]({'where':{'id':_0x2eb95d[_0x919b('0x57')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x919b('0x85')}]})['then'](handleEntityNotFound(_0x2e36ac,null))[_0x919b('0x1f')](function(_0x1f13fb){_0x2939dd[_0x919b('0x86')]=_0x1f13fb;if(_0x2939dd[_0x919b('0x86')]&&_0x2939dd[_0x919b('0x86')][_0x919b('0x4f')]===_0x919b('0x87')&&_0x2eb95d[_0x919b('0x5a')][_0x919b('0x88')]){if(_0x2eb95d['body'][_0x919b('0x88')]['length']===0x0)return;if(_0x2eb95d[_0x919b('0x5a')][_0x919b('0x88')][0x0][_0x919b('0x89')]!=='read')return;return db[_0x919b('0x8a')]['update']({'read':!![],'readAt':_0x2eb95d[_0x919b('0x5a')][_0x919b('0x88')][0x0][_0x919b('0x8b')]},{'where':{'messageId':_0x2eb95d[_0x919b('0x5a')]['statuses'][0x0][_0x919b('0x8c')]},'individualHooks':!![]})[_0x919b('0x1f')](function(_0x495770){return _0x2e36ac['status'](0xc8)['json'](_0x495770);});}_0x2939dd[_0x919b('0x8d')]=_['orderBy'](_0x1f13fb[_0x919b('0x85')],[_0x919b('0x80')],['asc']);if(_0x2939dd[_0x919b('0x86')]['Applications']){delete _0x2939dd[_0x919b('0x86')][_0x919b('0x85')];}return db[_0x919b('0x8e')][_0x919b('0x64')]()[_0x919b('0x1f')](function(_0x4bfead){if(!_0x4bfead){throw new db[(_0x919b('0x8f'))][(_0x919b('0x90'))](_0x919b('0x91'));}_0x3677f4=_[_0x919b('0x92')](_[_0x919b('0x44')](_0x4bfead),[_0x919b('0x93'),_0x919b('0x94')]);_0x23cc9a=_[_0x919b('0x92')](_[_0x919b('0x44')](_0x4bfead),[_0x919b('0x93'),_0x919b('0x94'),'CompanyId',_0x919b('0x95')]);_0x2939dd[_0x919b('0x5a')]={'mapKey':_0x919b('0x96')};if(_0x2939dd[_0x919b('0x86')]&&_0x2939dd[_0x919b('0x86')][_0x919b('0x4f')]===_0x919b('0x97')){_0x2939dd[_0x919b('0x5a')][_0x919b('0x98')]=_0x2eb95d['body'][_0x919b('0x99')][_0x919b('0x9a')]('whatsapp:','');_0x2939dd[_0x919b('0x5a')][_0x919b('0x5a')]=_0x2eb95d[_0x919b('0x5a')][_0x919b('0x9b')];_0x2939dd[_0x919b('0x5a')][_0x919b('0x9c')]=_0x2eb95d[_0x919b('0x5a')][_0x919b('0x9d')];}if(_0x2939dd[_0x919b('0x86')]&&_0x2939dd[_0x919b('0x86')][_0x919b('0x4f')]===_0x919b('0x87')){_0x2939dd[_0x919b('0x5a')][_0x919b('0x98')]=_0x2eb95d[_0x919b('0x5a')]['notifications'][0x0]['from'];_0x2939dd[_0x919b('0x5a')][_0x919b('0x5a')]=_0x2eb95d[_0x919b('0x5a')][_0x919b('0x9e')][0x0][_0x919b('0x25')][_0x919b('0x5a')];_0x2939dd[_0x919b('0x5a')]['messageId']=_0x2eb95d[_0x919b('0x5a')][_0x919b('0x9e')][0x0][_0x919b('0x8c')];}if(_0x2939dd[_0x919b('0x5a')]['id']){delete _0x2939dd[_0x919b('0x5a')]['id'];}if(_[_0x919b('0x9f')](_0x2939dd['body'][_0x919b('0x98')])){throw new db['Sequelize']['ValidationError'](_0x919b('0xa0'));}if(_[_0x919b('0x9f')](_0x2939dd['body'][_0x919b('0x5a')])||_0x2939dd['body'][_0x919b('0x5a')]===''){throw new db['Sequelize'][(_0x919b('0x90'))](_0x919b('0xa1'));}if(_[_0x919b('0x9f')](_0x2939dd['body'][_0x919b('0xa2')])){throw new db[(_0x919b('0x8f'))][(_0x919b('0x90'))](_0x919b('0xa3')+_0x23cc9a);}if(!_['includes'](_0x23cc9a,_0x2939dd[_0x919b('0x5a')]['mapKey'])){throw new db['Sequelize'][(_0x919b('0x90'))](_0x919b('0xa4')+_0x23cc9a);}_0x228967[_0x2939dd[_0x919b('0x5a')][_0x919b('0xa2')]]=_0x2939dd[_0x919b('0x5a')]['from'];return db[_0x919b('0xa5')]['find']({'where':{'id':_0x2939dd[_0x919b('0x86')][_0x919b('0x95')]},'include':[{'model':db['CmContact'],'as':_0x919b('0xa6'),'where':_0x228967,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x919b('0x1f')](handleEntityNotFound(_0x2e36ac,null))[_0x919b('0x1f')](function(_0x19d9ba){if(_0x19d9ba){_0x2939dd[_0x919b('0xa7')]=_[_0x919b('0x70')](_0x19d9ba,[_0x919b('0xa6')]);if(_0x19d9ba[_0x919b('0xa6')]['length']){return _0x19d9ba[_0x919b('0xa6')][0x0];}var _0x36f67a=_[_0x919b('0x1a')](_0x2939dd[_0x919b('0x5a')],{'firstName':_0x2939dd[_0x919b('0x5a')][_0x919b('0x98')],'ListId':_0x19d9ba['id']});_0x36f67a[_0x2939dd[_0x919b('0x5a')][_0x919b('0xa2')]]=_0x2939dd[_0x919b('0x5a')]['from'];return db['CmContact'][_0x919b('0x59')](_0x36f67a,{'fields':_0x3677f4,'raw':!![]});}})[_0x919b('0x1f')](handleEntityNotFound(_0x2e36ac,null))['then'](function(_0x2497d9){if(_0x2497d9){_0x2939dd[_0x919b('0xa8')]=_0x2497d9;var _0x4e626f={'ContactId':_0x2497d9['id'],'phone':_0x2939dd[_0x919b('0x5a')][_0x919b('0x98')],'WhatsappAccountId':_0x2eb95d['params']['id']};var _0x4380d7={'ContactId':_0x2497d9['id'],'WhatsappAccountId':_0x2eb95d[_0x919b('0x57')]['id'],'closed':![]};return db[_0x919b('0xa9')][_0x919b('0x5f')]({'where':_0x4380d7})['then'](function(_0x1325a2){if(_0x1325a2){return[_0x1325a2,![]];}return db[_0x919b('0xa9')][_0x919b('0x59')](_0x4e626f)[_0x919b('0x1f')](function(_0x18ae80){return[_0x18ae80,!![]];});});}})[_0x919b('0x71')](function(_0x593fbc,_0x105ad1){_0x2939dd[_0x919b('0xaa')]=_0x593fbc[_0x919b('0x35')]({'plain':!![]});_0x2939dd[_0x919b('0xaa')][_0x919b('0xab')]=![];if(_0x105ad1){if(_0x2939dd[_0x919b('0x86')][_0x919b('0xac')]){_0x2939dd[_0x919b('0x8d')][_0x919b('0xad')]({'id':0x0,'priority':_0x2939dd[_0x919b('0x8d')][_0x919b('0x48')]+0x1,'app':_0x919b('0xae'),'appdata':_0x919b('0xaf'),'interval':_0x919b('0xb0')});}_0x2939dd['interaction'][_0x919b('0xab')]=!![];}return db[_0x919b('0x8a')][_0x919b('0x59')]({'phone':_0x2939dd[_0x919b('0x5a')][_0x919b('0x98')],'messageId':_0x2939dd['body'][_0x919b('0x9c')],'body':_0x2939dd['body'][_0x919b('0x5a')],'WhatsappAccountId':_0x2eb95d[_0x919b('0x57')]['id'],'WhatsappInteractionId':_0x593fbc['id'],'direction':'in','ContactId':_0x593fbc[_0x919b('0xb1')],'AttachmentId':_0x2939dd[_0x919b('0x5a')]['AttachmentId']});})[_0x919b('0x1f')](function(_0x1140d6){_0x2939dd['message']=_0x1140d6;if(_0x2939dd['interaction'][_0x919b('0xb2')]){return db[_0x919b('0xb3')][_0x919b('0x5f')]({'attributes':['id',_0x919b('0x62')],'where':{'id':_0x2939dd[_0x919b('0xaa')]['UserId']}})[_0x919b('0x1f')](function(_0x5659e4){if(_0x5659e4){_0x2939dd[_0x919b('0x8d')][_0x919b('0xb4')]({'id':0x0,'priority':0x0,'app':_0x919b('0xb5'),'appdata':_0x5659e4[_0x919b('0x62')]+','+(_0x2939dd['account'][_0x919b('0xb6')]||0xa),'interval':_0x919b('0xb0')});}return respondWithRpcPromise(_0x919b('0xb7'),'startRouting',_0x2939dd);});}return respondWithRpcPromise(_0x919b('0xb7'),_0x919b('0xb8'),_0x2939dd);})['then'](function(_0x41d3a3){if(_0x41d3a3){var _0xd58ebe=0xc8;var _0x163432=_0x919b('0xb9');logger[_0x919b('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x163432,_0xd58ebe,_0x919b('0xba'));logger[_0x919b('0x21')](_0x919b('0xbb'),_0x163432,_0xd58ebe,_0x919b('0xba'),JSON[_0x919b('0x22')](_0x41d3a3));if(_0x2939dd[_0x919b('0x86')][_0x919b('0x4f')]===_0x919b('0x97')){return _0x2e36ac[_0x919b('0x29')](_0xd58ebe)[_0x919b('0x2f')]('Content-Type',_0x919b('0xbc'))['send']('\x0a');}else{return _0x2e36ac[_0x919b('0x29')](_0xd58ebe)['json'](_0x41d3a3);}}});})['catch'](handleError(_0x2e36ac,null));};exports[_0x919b('0x3a')]=function(_0x508eef,_0x254dd2,_0x5452c){var _0x2a7ddb,_0xc297fa,_0x5d0e4e;if(_[_0x919b('0x9f')](_0x508eef['body'][_0x919b('0x5a')])||_0x508eef[_0x919b('0x5a')][_0x919b('0x5a')]===''){throw new db[(_0x919b('0x8f'))][(_0x919b('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x508eef[_0x919b('0x5a')]['to'])){throw new db[(_0x919b('0x8f'))][(_0x919b('0x90'))](_0x919b('0xbd'));}_0x2a7ddb=_0x508eef['body']['to'];return db[_0x919b('0x3f')][_0x919b('0x5f')]({'where':{'id':_0x508eef[_0x919b('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x919b('0xbe'),'include':[{'model':db[_0x919b('0x8e')],'as':_0x919b('0xa6'),'where':{'mobile':_0x2a7ddb},'limit':0x1,'order':[['updatedAt',_0x919b('0xbf')]]}]}]})[_0x919b('0x1f')](handleEntityNotFound(_0x254dd2,null))[_0x919b('0x1f')](function(_0x400b81){if(_0x400b81&&_0x400b81[_0x919b('0xbe')]){_0xc297fa=_0x400b81['get']({'plain':!![]});if(_0xc297fa['List']&&_0xc297fa[_0x919b('0xbe')][_0x919b('0xa6')][_0x919b('0x48')]){return _0xc297fa[_0x919b('0xbe')][_0x919b('0xa6')][0x0];}return db['CmContact'][_0x919b('0x59')](_[_0x919b('0x1a')](_0x508eef[_0x919b('0x5a')],{'firstName':_0x2a7ddb,'mobile':_0x2a7ddb,'phone':_0x2a7ddb,'ListId':_0xc297fa['ListId']}));}})[_0x919b('0x1f')](handleEntityNotFound(_0x254dd2,null))[_0x919b('0x1f')](function(_0x5b765b){if(_0x5b765b){_0x5d0e4e=_0x5b765b;return db[_0x919b('0xa9')]['find']({'where':{'ContactId':_0x5d0e4e['id'],'closed':![],'WhatsappAccountId':_0xc297fa['id']}})['then'](function(_0x2b3efe){if(_0x2b3efe){return[_0x2b3efe,![]];}return db[_0x919b('0xa9')][_0x919b('0x59')]({'UserId':_0x508eef[_0x919b('0x5d')]['id'],'ContactId':_0x5d0e4e['id'],'WhatsappAccountId':_0xc297fa['id'],'phone':_0x2a7ddb,'firstMsgDirection':'out','Messages':[_[_0x919b('0x50')](_0x508eef[_0x919b('0x5a')],{'read':![],'body':_0x508eef[_0x919b('0x5a')][_0x919b('0x5a')],'phone':_0x2a7ddb,'WhatsappAccountId':_0xc297fa['id'],'UserId':_0x508eef[_0x919b('0x5d')]['id'],'ContactId':_0x5d0e4e['id']})]},{'include':[{'model':db[_0x919b('0x8a')],'as':_0x919b('0xc0')}]})['then'](function(_0x23be95){return[_0x23be95,!![]];});});}})['spread'](function(_0x503cbe,_0x2e95ec){if(_0x2e95ec){return _0x503cbe;}return db[_0x919b('0x8a')][_0x919b('0x59')](_[_0x919b('0x50')](_0x508eef[_0x919b('0x5a')],{'read':![],'body':_0x508eef['body'][_0x919b('0x5a')],'phone':_0x2a7ddb,'WhatsappAccountId':_0xc297fa['id'],'WhatsappInteractionId':_0x503cbe['id'],'UserId':_0x508eef[_0x919b('0x5d')]['id'],'ContactId':_0x5d0e4e['id']}))['then'](function(_0x287261){_0x503cbe[_0x919b('0xc1')][_0x919b('0xc0')]=[];_0x503cbe[_0x919b('0xc1')]['Messages'][_0x919b('0xad')](_0x287261[_0x919b('0xc1')]);return _0x503cbe;});})['then'](respondWithResult(_0x254dd2,null))[_0x919b('0x58')](handleError(_0x254dd2,null));}; \ No newline at end of file +var _0x6df8=['rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','isArray','userWhatsappAccount:remove','getAgents','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','Body','messageId','MessageSid','notifications','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','defaults','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','text/xml','send','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappAccount,\x20%s,\x20%s','end','json','offset','undefined','limit','count','status','set','apply','reject','save','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0xc29935,_0x36d699){var _0x3a9410=function(_0x2b543e){while(--_0x2b543e){_0xc29935['push'](_0xc29935['shift']());}};_0x3a9410(++_0x36d699);}(_0x6df8,0x13b));var _0x86df=function(_0x2cbaa1,_0x5e4692){_0x2cbaa1=_0x2cbaa1-0x0;var _0x5334de=_0x6df8[_0x2cbaa1];return _0x5334de;};'use strict';var emlformat=require(_0x86df('0x0'));var rimraf=require(_0x86df('0x1'));var zipdir=require(_0x86df('0x2'));var jsonpatch=require(_0x86df('0x3'));var rp=require(_0x86df('0x4'));var moment=require(_0x86df('0x5'));var BPromise=require(_0x86df('0x6'));var Mustache=require(_0x86df('0x7'));var util=require(_0x86df('0x8'));var path=require(_0x86df('0x9'));var sox=require(_0x86df('0xa'));var csv=require(_0x86df('0xb'));var ejs=require(_0x86df('0xc'));var fs=require('fs');var fs_extra=require(_0x86df('0xd'));var _=require('lodash');var squel=require(_0x86df('0xe'));var crypto=require(_0x86df('0xf'));var jsforce=require(_0x86df('0x10'));var deskjs=require(_0x86df('0x11'));var toCsv=require(_0x86df('0xb'));var querystring=require(_0x86df('0x12'));var Papa=require(_0x86df('0x13'));var Redis=require(_0x86df('0x14'));var authService=require(_0x86df('0x15'));var qs=require(_0x86df('0x16'));var as=require(_0x86df('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x86df('0x18'));var utils=require('../../config/utils');var config=require(_0x86df('0x19'));var licenseUtil=require(_0x86df('0x1a'));var db=require('../../mysqldb')['db'];config[_0x86df('0x1b')]=_['defaults'](config[_0x86df('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x86df('0x1c'))[_0x86df('0x1d')](socket);var jayson=require(_0x86df('0x1e'));var client=jayson[_0x86df('0x1f')][_0x86df('0x20')]({'port':0x232c});function respondWithRpcPromise(_0xc0b89d,_0x3289bb,_0x57d61a,_0x4f8066){return new BPromise(function(_0x1e901a,_0x268a87){var _0x2b6d5e=_0x4f8066||client;return _0x2b6d5e[_0x86df('0x21')](_0xc0b89d,_0x57d61a)[_0x86df('0x22')](function(_0x50e891){logger[_0x86df('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x3289bb,'request\x20sent');logger[_0x86df('0x24')](_0x86df('0x25'),_0x3289bb,'request\x20sent',JSON[_0x86df('0x26')](_0x50e891));if(_0x50e891[_0x86df('0x27')]){if(_0x50e891[_0x86df('0x27')][_0x86df('0x28')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3289bb,_0x50e891[_0x86df('0x27')][_0x86df('0x29')]);return _0x268a87(_0x50e891[_0x86df('0x27')][_0x86df('0x29')]);}logger[_0x86df('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x3289bb,_0x50e891['error'][_0x86df('0x29')]);return _0x1e901a(_0x50e891[_0x86df('0x27')][_0x86df('0x29')]);}else{logger[_0x86df('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x3289bb,'request\x20sent');_0x1e901a(_0x50e891[_0x86df('0x2a')]['message']);}})['catch'](function(_0x335802){logger['error'](_0x86df('0x2b'),_0x3289bb,_0x335802);_0x268a87(_0x335802);});});}function respondWithStatusCode(_0x367d31,_0x1dad71){_0x1dad71=_0x1dad71||0xcc;return function(_0x4d0b2c){if(_0x4d0b2c){return _0x367d31['sendStatus'](_0x1dad71);}return _0x367d31['status'](_0x1dad71)[_0x86df('0x2c')]();};}function respondWithResult(_0x34583e,_0x26538b){_0x26538b=_0x26538b||0xc8;return function(_0x1d384f){if(_0x1d384f){return _0x34583e['status'](_0x26538b)[_0x86df('0x2d')](_0x1d384f);}};}function respondWithFilteredResult(_0x1f68c0,_0x17f2a3){return function(_0x31de83){if(_0x31de83){var _0x4ed0ea=typeof _0x17f2a3[_0x86df('0x2e')]===_0x86df('0x2f')&&typeof _0x17f2a3[_0x86df('0x30')]===_0x86df('0x2f');var _0x3369c0=_0x31de83[_0x86df('0x31')];var _0x5938cb=_0x4ed0ea?0x0:_0x17f2a3[_0x86df('0x2e')];var _0x3efcf8=_0x4ed0ea?_0x31de83['count']:_0x17f2a3[_0x86df('0x2e')]+_0x17f2a3['limit'];var _0x3ec64e;if(_0x3efcf8>=_0x3369c0){_0x3efcf8=_0x3369c0;_0x3ec64e=0xc8;}else{_0x3ec64e=0xce;}_0x1f68c0[_0x86df('0x32')](_0x3ec64e);return _0x1f68c0[_0x86df('0x33')]('Content-Range',_0x5938cb+'-'+_0x3efcf8+'/'+_0x3369c0)['json'](_0x31de83);}return null;};}function patchUpdates(_0x44d823){return function(_0x49b949){try{jsonpatch[_0x86df('0x34')](_0x49b949,_0x44d823,!![]);}catch(_0x3c1553){return BPromise[_0x86df('0x35')](_0x3c1553);}return _0x49b949[_0x86df('0x36')]();};}function saveUpdates(_0xe73c55,_0x39d497){return function(_0x578acd){if(_0x578acd){return _0x578acd['update'](_0xe73c55)[_0x86df('0x22')](function(_0x403018){return _0x403018;});}return null;};}function removeEntity(_0x2d7924,_0x24dc54){return function(_0xc13294){if(_0xc13294){return _0xc13294[_0x86df('0x37')]()[_0x86df('0x22')](function(){var _0x5b9ee1=_0xc13294[_0x86df('0x38')]({'plain':!![]});var _0x557b93=_0x86df('0x39');return db[_0x86df('0x3a')]['destroy']({'where':{'type':_0x557b93,'resourceId':_0x5b9ee1['id']}})['then'](function(){return _0xc13294;});})[_0x86df('0x22')](function(){_0x2d7924['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa54a0d,_0x536c4e){return function(_0x5933d8){if(!_0x5933d8){_0xa54a0d[_0x86df('0x3b')](0x194);}return _0x5933d8;};}function handleError(_0x415504,_0x4c1de2){_0x4c1de2=_0x4c1de2||0x1f4;return function(_0x309060){logger[_0x86df('0x27')](_0x309060['stack']);if(_0x309060[_0x86df('0x3c')]){delete _0x309060[_0x86df('0x3c')];}_0x415504[_0x86df('0x32')](_0x4c1de2)['send'](_0x309060);};}exports['index']=function(_0x42a05b,_0x19f6ee){var _0x4e2876={'include':[{'model':db[_0x86df('0x3d')],'as':_0x86df('0x3e')}]},_0x16fb5b={},_0x2e928b={'count':0x0,'rows':[]};var _0x3f5cc3=_[_0x86df('0x3f')](db[_0x86df('0x40')]['rawAttributes'],function(_0x1550f6){return{'name':_0x1550f6['fieldName'],'type':_0x1550f6[_0x86df('0x41')][_0x86df('0x42')]};});_0x16fb5b['model']=_['map'](_0x3f5cc3,_0x86df('0x3c'));_0x16fb5b[_0x86df('0x43')]=_[_0x86df('0x44')](_0x42a05b['query']);_0x16fb5b['filters']=_[_0x86df('0x45')](_0x16fb5b[_0x86df('0x46')],_0x16fb5b[_0x86df('0x43')]);_0x4e2876[_0x86df('0x47')]=_['intersection'](_0x16fb5b[_0x86df('0x46')],qs['fields'](_0x42a05b[_0x86df('0x43')][_0x86df('0x48')]));_0x4e2876[_0x86df('0x47')]=_0x4e2876['attributes'][_0x86df('0x49')]?_0x4e2876[_0x86df('0x47')]:_0x16fb5b[_0x86df('0x46')];if(!_0x42a05b['query'][_0x86df('0x4a')](_0x86df('0x4b'))){_0x4e2876[_0x86df('0x30')]=qs[_0x86df('0x30')](_0x42a05b[_0x86df('0x43')][_0x86df('0x30')]);_0x4e2876[_0x86df('0x2e')]=qs[_0x86df('0x2e')](_0x42a05b[_0x86df('0x43')]['offset']);}_0x4e2876[_0x86df('0x4c')]=qs[_0x86df('0x4d')](_0x42a05b[_0x86df('0x43')][_0x86df('0x4d')]);_0x4e2876[_0x86df('0x4e')]=qs[_0x86df('0x4f')](_[_0x86df('0x50')](_0x42a05b[_0x86df('0x43')],_0x16fb5b[_0x86df('0x4f')]),_0x3f5cc3);if(_0x42a05b['query'][_0x86df('0x51')]){_0x4e2876[_0x86df('0x4e')]=_[_0x86df('0x52')](_0x4e2876['where'],{'$or':_['map'](_0x3f5cc3,function(_0x49aae0){if(_0x49aae0[_0x86df('0x41')]!==_0x86df('0x53')){var _0x5c473f={};_0x5c473f[_0x49aae0[_0x86df('0x3c')]]={'$like':'%'+_0x42a05b[_0x86df('0x43')][_0x86df('0x51')]+'%'};return _0x5c473f;}})});}_0x4e2876=_[_0x86df('0x52')]({},_0x4e2876,_0x42a05b[_0x86df('0x54')]);var _0x29ccc6={'where':_0x4e2876[_0x86df('0x4e')]};return db[_0x86df('0x40')][_0x86df('0x31')](_0x29ccc6)[_0x86df('0x22')](function(_0x2bd32e){_0x2e928b[_0x86df('0x31')]=_0x2bd32e;if(_0x42a05b[_0x86df('0x43')][_0x86df('0x55')]){_0x4e2876['include']=[{'all':!![]}];}return db[_0x86df('0x40')][_0x86df('0x56')](_0x4e2876);})[_0x86df('0x22')](function(_0x2bca70){_0x2e928b[_0x86df('0x57')]=_0x2bca70;return _0x2e928b;})[_0x86df('0x22')](respondWithFilteredResult(_0x19f6ee,_0x4e2876))[_0x86df('0x58')](handleError(_0x19f6ee,null));};exports[_0x86df('0x59')]=function(_0x2cc006,_0x5a0957){var _0x2ac7ae={'raw':![],'where':{'id':_0x2cc006[_0x86df('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0x86df('0x3e')}]},_0x5f322e={};_0x5f322e[_0x86df('0x46')]=_[_0x86df('0x44')](db[_0x86df('0x40')][_0x86df('0x5b')]);_0x5f322e[_0x86df('0x43')]=_[_0x86df('0x44')](_0x2cc006[_0x86df('0x43')]);_0x5f322e['filters']=_[_0x86df('0x45')](_0x5f322e[_0x86df('0x46')],_0x5f322e[_0x86df('0x43')]);_0x2ac7ae[_0x86df('0x47')]=_[_0x86df('0x45')](_0x5f322e[_0x86df('0x46')],qs[_0x86df('0x48')](_0x2cc006['query'][_0x86df('0x48')]));_0x2ac7ae['attributes']=_0x2ac7ae[_0x86df('0x47')][_0x86df('0x49')]?_0x2ac7ae[_0x86df('0x47')]:_0x5f322e['model'];if(_0x2cc006[_0x86df('0x43')][_0x86df('0x55')]){_0x2ac7ae[_0x86df('0x5c')]=[{'all':!![]}];}_0x2ac7ae=_[_0x86df('0x52')]({},_0x2ac7ae,_0x2cc006[_0x86df('0x54')]);return db[_0x86df('0x40')][_0x86df('0x5d')](_0x2ac7ae)['then'](handleEntityNotFound(_0x5a0957,null))['then'](respondWithResult(_0x5a0957,null))['catch'](handleError(_0x5a0957,null));};exports['create']=function(_0x18852a,_0x57d3f4){return db[_0x86df('0x40')][_0x86df('0x5e')](_0x18852a[_0x86df('0x5f')],{})[_0x86df('0x22')](function(_0x4ccbf3){var _0x101aae=_0x18852a[_0x86df('0x60')][_0x86df('0x38')]({'plain':!![]});if(!_0x101aae)throw new Error(_0x86df('0x61'));if(_0x101aae[_0x86df('0x62')]===_0x86df('0x60')){var _0x5e855a=_0x4ccbf3[_0x86df('0x38')]({'plain':!![]});var _0x29e535=_0x86df('0x39');return db[_0x86df('0x63')][_0x86df('0x5d')]({'where':{'name':_0x29e535,'userProfileId':_0x101aae[_0x86df('0x64')]},'raw':!![]})[_0x86df('0x22')](function(_0x5c3893){if(_0x5c3893&&_0x5c3893['autoAssociation']===0x0){return db['UserProfileResource'][_0x86df('0x5e')]({'name':_0x5e855a[_0x86df('0x3c')],'resourceId':_0x5e855a['id'],'type':_0x5c3893['name'],'sectionId':_0x5c3893['id']},{})[_0x86df('0x22')](function(){return _0x4ccbf3;});}else{return _0x4ccbf3;}})[_0x86df('0x58')](function(_0x3d3d6d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d3d6d);throw _0x3d3d6d;});}return _0x4ccbf3;})[_0x86df('0x22')](respondWithResult(_0x57d3f4,0xc9))[_0x86df('0x58')](handleError(_0x57d3f4,null));};exports[_0x86df('0x65')]=function(_0xa3f7bb,_0x4fc809){if(_0xa3f7bb[_0x86df('0x5f')]['id']){delete _0xa3f7bb[_0x86df('0x5f')]['id'];}return db['WhatsappAccount'][_0x86df('0x5d')]({'where':{'id':_0xa3f7bb[_0x86df('0x5a')]['id']},'include':[{'model':db[_0x86df('0x3d')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x4fc809,null))[_0x86df('0x22')](saveUpdates(_0xa3f7bb[_0x86df('0x5f')],null))[_0x86df('0x22')](respondWithResult(_0x4fc809,null))[_0x86df('0x58')](handleError(_0x4fc809,null));};exports[_0x86df('0x37')]=function(_0xe16d81,_0x50ce98){return db[_0x86df('0x40')]['find']({'where':{'id':_0xe16d81[_0x86df('0x5a')]['id']}})[_0x86df('0x22')](handleEntityNotFound(_0x50ce98,null))['then'](removeEntity(_0x50ce98,null))[_0x86df('0x58')](handleError(_0x50ce98,null));};exports['describe']=function(_0x48d03e,_0x4ce70e){return db['WhatsappAccount'][_0x86df('0x66')]()[_0x86df('0x22')](respondWithResult(_0x4ce70e,null))['catch'](handleError(_0x4ce70e,null));};exports[_0x86df('0x67')]=function(_0x3ad61a,_0x43b382,_0x37cd22){if(_0x3ad61a[_0x86df('0x5f')]['id']){delete _0x3ad61a[_0x86df('0x5f')]['id'];}return db[_0x86df('0x40')][_0x86df('0x5d')]({'where':{'id':_0x3ad61a['params']['id']}})[_0x86df('0x22')](handleEntityNotFound(_0x43b382,null))[_0x86df('0x22')](function(_0x48a416){if(_0x48a416){_0x3ad61a[_0x86df('0x5f')][_0x86df('0x68')]=_0x48a416['id'];return db['Disposition'][_0x86df('0x5e')](_0x3ad61a[_0x86df('0x5f')]);}})[_0x86df('0x22')](respondWithResult(_0x43b382,null))[_0x86df('0x58')](handleError(_0x43b382,null));};exports[_0x86df('0x69')]=function(_0xd901f2,_0x60f63a,_0x283bed){var _0xcebde6={'raw':![],'where':{}};var _0x1fc25d={};var _0x1201c6={'count':0x0,'rows':[]};return db[_0x86df('0x40')][_0x86df('0x6a')]({'where':{'id':_0xd901f2[_0x86df('0x5a')]['id']}})['then'](handleEntityNotFound(_0x60f63a,null))[_0x86df('0x22')](function(_0x90eb6d){if(_0x90eb6d){_0x1fc25d[_0x86df('0x46')]=_[_0x86df('0x44')](db[_0x86df('0x6b')][_0x86df('0x5b')]);_0x1fc25d[_0x86df('0x43')]=_[_0x86df('0x44')](_0xd901f2['query']);_0x1fc25d[_0x86df('0x4f')]=_['intersection'](_0x1fc25d[_0x86df('0x46')],_0x1fc25d[_0x86df('0x43')]);_0xcebde6[_0x86df('0x47')]=_['intersection'](_0x1fc25d[_0x86df('0x46')],qs['fields'](_0xd901f2[_0x86df('0x43')][_0x86df('0x48')]));_0xcebde6[_0x86df('0x47')]=_0xcebde6[_0x86df('0x47')][_0x86df('0x49')]?_0xcebde6[_0x86df('0x47')]:_0x1fc25d['model'];if(!_0xd901f2[_0x86df('0x43')][_0x86df('0x4a')](_0x86df('0x4b'))){_0xcebde6[_0x86df('0x30')]=qs[_0x86df('0x30')](_0xd901f2[_0x86df('0x43')][_0x86df('0x30')]);_0xcebde6[_0x86df('0x2e')]=qs[_0x86df('0x2e')](_0xd901f2[_0x86df('0x43')][_0x86df('0x2e')]);}_0xcebde6[_0x86df('0x4c')]=qs[_0x86df('0x4d')](_0xd901f2[_0x86df('0x43')][_0x86df('0x4d')]);_0xcebde6[_0x86df('0x4e')]=qs[_0x86df('0x4f')](_[_0x86df('0x50')](_0xd901f2[_0x86df('0x43')],_0x1fc25d[_0x86df('0x4f')]));_0xcebde6[_0x86df('0x4e')][_0x86df('0x68')]=_0x90eb6d['id'];if(_0xd901f2[_0x86df('0x43')][_0x86df('0x51')]){_0xcebde6['where']=_[_0x86df('0x52')](_0xcebde6[_0x86df('0x4e')],{'$or':_[_0x86df('0x3f')](_0xcebde6['attributes'],function(_0xfd7163){var _0x5eef4e={};_0x5eef4e[_0xfd7163]={'$like':'%'+_0xd901f2[_0x86df('0x43')]['filter']+'%'};return _0x5eef4e;})});}_0xcebde6=_[_0x86df('0x52')]({},_0xcebde6,_0xd901f2[_0x86df('0x54')]);return db[_0x86df('0x6b')][_0x86df('0x31')]({'where':_0xcebde6[_0x86df('0x4e')]})['then'](function(_0x95208f){_0x1201c6['count']=_0x95208f;if(_0xd901f2[_0x86df('0x43')][_0x86df('0x55')]){_0xcebde6[_0x86df('0x5c')]=[{'all':!![]}];}return db[_0x86df('0x6b')][_0x86df('0x56')](_0xcebde6);})[_0x86df('0x22')](function(_0x4cbaec){_0x1201c6[_0x86df('0x57')]=_0x4cbaec;return _0x1201c6;});}})[_0x86df('0x22')](respondWithFilteredResult(_0x60f63a,_0xcebde6))[_0x86df('0x58')](handleError(_0x60f63a,null));};exports['removeDispositions']=function(_0x5ca06a,_0x2d8fa9,_0x350bba){return db[_0x86df('0x40')]['find']({'where':{'id':_0x5ca06a['params']['id']}})['then'](handleEntityNotFound(_0x2d8fa9,null))['then'](function(_0x42572e){if(_0x42572e){return _0x42572e[_0x86df('0x6c')](_0x5ca06a[_0x86df('0x43')][_0x86df('0x6d')]);}})[_0x86df('0x22')](respondWithStatusCode(_0x2d8fa9,null))[_0x86df('0x58')](handleError(_0x2d8fa9,null));};exports[_0x86df('0x6e')]=function(_0x47fc0e,_0x57965f,_0x38c826){if(_0x47fc0e['body']['id']){delete _0x47fc0e[_0x86df('0x5f')]['id'];}return db[_0x86df('0x40')][_0x86df('0x5d')]({'where':{'id':_0x47fc0e['params']['id']}})[_0x86df('0x22')](handleEntityNotFound(_0x57965f,null))[_0x86df('0x22')](function(_0x3dd3a0){if(_0x3dd3a0){_0x47fc0e[_0x86df('0x5f')][_0x86df('0x68')]=_0x3dd3a0['id'];return db[_0x86df('0x6f')]['create'](_0x47fc0e['body']);}})['then'](respondWithResult(_0x57965f,null))[_0x86df('0x58')](handleError(_0x57965f,null));};exports[_0x86df('0x70')]=function(_0xc60407,_0x1b81e,_0x5e1309){var _0x533906={'raw':![],'where':{}};var _0x255e88={};var _0x219410={'count':0x0,'rows':[]};return db[_0x86df('0x40')][_0x86df('0x6a')]({'where':{'id':_0xc60407['params']['id']}})[_0x86df('0x22')](handleEntityNotFound(_0x1b81e,null))[_0x86df('0x22')](function(_0x21a092){if(_0x21a092){_0x255e88['model']=_[_0x86df('0x44')](db[_0x86df('0x6f')][_0x86df('0x5b')]);_0x255e88[_0x86df('0x43')]=_[_0x86df('0x44')](_0xc60407[_0x86df('0x43')]);_0x255e88['filters']=_[_0x86df('0x45')](_0x255e88[_0x86df('0x46')],_0x255e88['query']);_0x533906[_0x86df('0x47')]=_[_0x86df('0x45')](_0x255e88[_0x86df('0x46')],qs['fields'](_0xc60407[_0x86df('0x43')]['fields']));_0x533906[_0x86df('0x47')]=_0x533906[_0x86df('0x47')]['length']?_0x533906['attributes']:_0x255e88[_0x86df('0x46')];if(!_0xc60407[_0x86df('0x43')]['hasOwnProperty']('nolimit')){_0x533906['limit']=qs[_0x86df('0x30')](_0xc60407[_0x86df('0x43')][_0x86df('0x30')]);_0x533906['offset']=qs[_0x86df('0x2e')](_0xc60407[_0x86df('0x43')][_0x86df('0x2e')]);}_0x533906['order']=qs[_0x86df('0x4d')](_0xc60407[_0x86df('0x43')][_0x86df('0x4d')]);_0x533906[_0x86df('0x4e')]=qs['filters'](_['pick'](_0xc60407[_0x86df('0x43')],_0x255e88[_0x86df('0x4f')]));_0x533906['where'][_0x86df('0x68')]=_0x21a092['id'];if(_0xc60407[_0x86df('0x43')]['filter']){_0x533906[_0x86df('0x4e')]=_[_0x86df('0x52')](_0x533906[_0x86df('0x4e')],{'$or':_[_0x86df('0x3f')](_0x533906['attributes'],function(_0x490d73){var _0x33143e={};_0x33143e[_0x490d73]={'$like':'%'+_0xc60407[_0x86df('0x43')][_0x86df('0x51')]+'%'};return _0x33143e;})});}_0x533906=_[_0x86df('0x52')]({},_0x533906,_0xc60407[_0x86df('0x54')]);return db[_0x86df('0x6f')]['count']({'where':_0x533906['where']})[_0x86df('0x22')](function(_0x11f13c){_0x219410[_0x86df('0x31')]=_0x11f13c;if(_0xc60407[_0x86df('0x43')][_0x86df('0x55')]){_0x533906[_0x86df('0x5c')]=[{'all':!![]}];}return db[_0x86df('0x6f')][_0x86df('0x56')](_0x533906);})['then'](function(_0x334f29){_0x219410[_0x86df('0x57')]=_0x334f29;return _0x219410;});}})['then'](respondWithFilteredResult(_0x1b81e,_0x533906))['catch'](handleError(_0x1b81e,null));};exports['removeAnswers']=function(_0x419cca,_0x58e8a3,_0x109370){return db[_0x86df('0x40')][_0x86df('0x5d')]({'where':{'id':_0x419cca['params']['id']}})[_0x86df('0x22')](handleEntityNotFound(_0x58e8a3,null))[_0x86df('0x22')](function(_0x47ec00){if(_0x47ec00){return _0x47ec00[_0x86df('0x71')](_0x419cca[_0x86df('0x43')][_0x86df('0x6d')]);}})[_0x86df('0x22')](respondWithStatusCode(_0x58e8a3,null))['catch'](handleError(_0x58e8a3,null));};exports[_0x86df('0x72')]=function(_0x3c75e0,_0x17d6c8,_0x14ed5d){return db[_0x86df('0x40')]['find']({'where':{'id':_0x3c75e0[_0x86df('0x5a')]['id']}})[_0x86df('0x22')](handleEntityNotFound(_0x17d6c8,null))[_0x86df('0x22')](function(_0x3000b8){if(_0x3000b8){return _0x3000b8[_0x86df('0x72')](_0x3c75e0[_0x86df('0x5f')]['ids'],_[_0x86df('0x73')](_0x3c75e0[_0x86df('0x5f')],['ids','id'])||{})[_0x86df('0x74')](function(_0x31bef4){for(var _0x3bcc9c=0x0;_0x3bcc9c<_0x3c75e0[_0x86df('0x5f')][_0x86df('0x6d')][_0x86df('0x49')];_0x3bcc9c+=0x1){socket[_0x86df('0x75')]('userWhatsappAccount:save',{'UserId':Number(_0x3c75e0[_0x86df('0x5f')][_0x86df('0x6d')][_0x3bcc9c]),'WhatsappAccountId':Number(_0x3c75e0[_0x86df('0x5a')]['id'])});}return _0x31bef4;});}})['then'](respondWithResult(_0x17d6c8,null))[_0x86df('0x58')](handleError(_0x17d6c8,null));};exports['removeAgents']=function(_0x1f83cc,_0xc6c3d0,_0x47f412){return db[_0x86df('0x40')][_0x86df('0x5d')]({'where':{'id':_0x1f83cc[_0x86df('0x5a')]['id']}})[_0x86df('0x22')](handleEntityNotFound(_0xc6c3d0,null))['then'](function(_0x1e868e){if(_0x1e868e){return _0x1e868e['removeAgents'](_0x1f83cc['query'][_0x86df('0x6d')])[_0x86df('0x22')](function(){if(_[_0x86df('0x76')](_0x1f83cc[_0x86df('0x43')][_0x86df('0x6d')])){for(var _0x2827e4=0x0;_0x2827e4<_0x1f83cc['query'][_0x86df('0x6d')][_0x86df('0x49')];_0x2827e4+=0x1){socket[_0x86df('0x75')](_0x86df('0x77'),{'UserId':Number(_0x1f83cc[_0x86df('0x43')][_0x86df('0x6d')][_0x2827e4]),'WhatsappAccountId':Number(_0x1f83cc[_0x86df('0x5a')]['id'])});}}else{socket[_0x86df('0x75')](_0x86df('0x77'),{'UserId':Number(_0x1f83cc[_0x86df('0x43')]['ids']),'WhatsappAccountId':Number(_0x1f83cc[_0x86df('0x5a')]['id'])});}});}})[_0x86df('0x22')](respondWithStatusCode(_0xc6c3d0,null))[_0x86df('0x58')](handleError(_0xc6c3d0,null));};exports['getAgents']=function(_0x46dd6a,_0x5aa060,_0x7d8b1c){var _0x3de27f={};var _0x496a8b={};var _0x5531d7;var _0x4832a4;return db[_0x86df('0x40')][_0x86df('0x6a')]({'where':{'id':_0x46dd6a['params']['id']}})[_0x86df('0x22')](handleEntityNotFound(_0x5aa060,null))[_0x86df('0x22')](function(_0x2f2529){if(_0x2f2529){_0x5531d7=_0x2f2529;_0x496a8b['model']=_[_0x86df('0x44')](db['User']['rawAttributes']);_0x496a8b[_0x86df('0x43')]=_[_0x86df('0x44')](_0x46dd6a[_0x86df('0x43')]);_0x496a8b['filters']=_[_0x86df('0x45')](_0x496a8b[_0x86df('0x46')],_0x496a8b['query']);_0x3de27f[_0x86df('0x47')]=_[_0x86df('0x45')](_0x496a8b[_0x86df('0x46')],qs[_0x86df('0x48')](_0x46dd6a[_0x86df('0x43')][_0x86df('0x48')]));_0x3de27f[_0x86df('0x47')]=_0x3de27f['attributes']['length']?_0x3de27f[_0x86df('0x47')]:_0x496a8b[_0x86df('0x46')];_0x3de27f[_0x86df('0x4c')]=qs['sort'](_0x46dd6a[_0x86df('0x43')][_0x86df('0x4d')]);_0x3de27f['where']=qs[_0x86df('0x4f')](_['pick'](_0x46dd6a['query'],_0x496a8b[_0x86df('0x4f')]));if(_0x46dd6a['query'][_0x86df('0x51')]){_0x3de27f[_0x86df('0x4e')]=_[_0x86df('0x52')](_0x3de27f[_0x86df('0x4e')],{'$or':_['map'](_0x3de27f[_0x86df('0x47')],function(_0x3673bc){var _0x4a512c={};_0x4a512c[_0x3673bc]={'$like':'%'+_0x46dd6a['query']['filter']+'%'};return _0x4a512c;})});}_0x3de27f=_[_0x86df('0x52')]({},_0x3de27f,_0x46dd6a[_0x86df('0x54')]);return _0x5531d7[_0x86df('0x78')](_0x3de27f);}})[_0x86df('0x22')](function(_0x551f3c){if(_0x551f3c){_0x4832a4=_0x551f3c['length'];if(!_0x46dd6a[_0x86df('0x43')][_0x86df('0x4a')](_0x86df('0x4b'))){_0x3de27f['limit']=qs['limit'](_0x46dd6a['query'][_0x86df('0x30')]);_0x3de27f['offset']=qs[_0x86df('0x2e')](_0x46dd6a[_0x86df('0x43')][_0x86df('0x2e')]);}return _0x5531d7['getAgents'](_0x3de27f);}})[_0x86df('0x22')](function(_0x3a7653){if(_0x3a7653){return _0x3a7653?{'count':_0x4832a4,'rows':_0x3a7653}:null;}})[_0x86df('0x22')](respondWithResult(_0x5aa060,null))['catch'](handleError(_0x5aa060,null));};exports[_0x86df('0x79')]=function(_0x46b80a,_0x229260){var _0x59c8b3=_0x46b80a['params']['id'];var _0x13968f=_0x46b80a[_0x86df('0x5f')];var _0x8230e9=0xc8;var _0x10fae5=null;return db['sequelize'][_0x86df('0x7a')]({'isolationLevel':db[_0x86df('0x7b')][_0x86df('0x7c')][_0x86df('0x7d')][_0x86df('0x7e')]},function(_0x72d968){return db[_0x86df('0x40')]['findOne']({'where':{'id':_0x59c8b3},'transaction':_0x72d968})[_0x86df('0x22')](function(_0x1c0c21){if(_0x1c0c21){return db[_0x86df('0x7f')][_0x86df('0x37')]({'where':{'WhatsappAccountId':_0x59c8b3},'transaction':_0x72d968})['then'](function(){var _0x3c19ac=_['map'](_0x13968f,function(_0x244bb9){_0x244bb9[_0x86df('0x68')]=_0x59c8b3;return _0x244bb9;});return db[_0x86df('0x7f')][_0x86df('0x80')](_0x3c19ac,{'transaction':_0x72d968});});}else{_0x8230e9=0x194;_0x10fae5=[];}});})['then'](function(){if(_0x8230e9!==0x194){return db[_0x86df('0x7f')][_0x86df('0x81')]({'where':{'WhatsappAccountId':_0x59c8b3},'order':_0x86df('0x82')})[_0x86df('0x22')](function(_0x12da38){_0x10fae5=_0x12da38;});}})[_0x86df('0x58')](function(_0x1784fc){_0x8230e9=0x1f4;logger[_0x86df('0x27')](_0x1784fc[_0x86df('0x83')]);if(_0x1784fc['name']){delete _0x1784fc[_0x86df('0x3c')];}_0x10fae5=_0x1784fc;})[_0x86df('0x84')](function(){if(_0x10fae5===null){_0x229260[_0x86df('0x3b')](_0x8230e9);}else{if(_0x8230e9===0x1f4){_0x229260[_0x86df('0x32')](_0x8230e9)['send'](_0x10fae5);}else{_0x229260[_0x86df('0x32')](_0x8230e9)[_0x86df('0x2d')](_0x10fae5);}}});};exports[_0x86df('0x85')]=function(_0x3f079e,_0x2f17cc,_0x45524a){var _0x2e0261={};var _0x5672db={};var _0x4c2595;var _0x174eb5;return db['WhatsappAccount'][_0x86df('0x6a')]({'where':{'id':_0x3f079e[_0x86df('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f17cc,null))[_0x86df('0x22')](function(_0x3ba757){if(_0x3ba757){_0x4c2595=_0x3ba757;_0x5672db['model']=_['keys'](db[_0x86df('0x7f')][_0x86df('0x5b')]);_0x5672db[_0x86df('0x43')]=_[_0x86df('0x44')](_0x3f079e['query']);_0x5672db[_0x86df('0x4f')]=_['intersection'](_0x5672db[_0x86df('0x46')],_0x5672db[_0x86df('0x43')]);_0x2e0261[_0x86df('0x47')]=_['intersection'](_0x5672db[_0x86df('0x46')],qs[_0x86df('0x48')](_0x3f079e[_0x86df('0x43')][_0x86df('0x48')]));_0x2e0261[_0x86df('0x47')]=_0x2e0261['attributes'][_0x86df('0x49')]?_0x2e0261[_0x86df('0x47')]:_0x5672db['model'];_0x2e0261['order']=qs[_0x86df('0x4d')](_0x3f079e[_0x86df('0x43')][_0x86df('0x4d')]);_0x2e0261[_0x86df('0x4e')]=qs[_0x86df('0x4f')](_[_0x86df('0x50')](_0x3f079e['query'],_0x5672db[_0x86df('0x4f')]));if(_0x3f079e['query'][_0x86df('0x51')]){_0x2e0261[_0x86df('0x4e')]=_['merge'](_0x2e0261['where'],{'$or':_[_0x86df('0x3f')](_0x2e0261['attributes'],function(_0x3846cd){var _0x5bc71c={};_0x5bc71c[_0x3846cd]={'$like':'%'+_0x3f079e[_0x86df('0x43')][_0x86df('0x51')]+'%'};return _0x5bc71c;})});}_0x2e0261=_['merge']({},_0x2e0261,_0x3f079e[_0x86df('0x54')]);return _0x4c2595['getApplications'](_0x2e0261);}})['then'](function(_0x14fc9c){if(_0x14fc9c){_0x174eb5=_0x14fc9c[_0x86df('0x49')];if(!_0x3f079e[_0x86df('0x43')][_0x86df('0x4a')](_0x86df('0x4b'))){_0x2e0261['limit']=qs[_0x86df('0x30')](_0x3f079e[_0x86df('0x43')][_0x86df('0x30')]);_0x2e0261[_0x86df('0x2e')]=qs[_0x86df('0x2e')](_0x3f079e[_0x86df('0x43')][_0x86df('0x2e')]);}return _0x4c2595['getApplications'](_0x2e0261);}})[_0x86df('0x22')](function(_0x4df82d){if(_0x4df82d){return _0x4df82d?{'count':_0x174eb5,'rows':_0x4df82d}:null;}})[_0x86df('0x22')](respondWithResult(_0x2f17cc,null))[_0x86df('0x58')](handleError(_0x2f17cc,null));};exports[_0x86df('0x86')]=function(_0x658072,_0x474ae8,_0x42d19e){var _0x1f7e57={'channel':_0x86df('0x87')};var _0x2ef3a3=[];var _0x32e008=[];var _0x4b99c5={};return db['WhatsappAccount']['find']({'where':{'id':_0x658072['params']['id']},'include':[{'model':db[_0x86df('0x7f')],'as':_0x86df('0x88')}]})[_0x86df('0x22')](handleEntityNotFound(_0x474ae8,null))['then'](function(_0x4a952c){_0x1f7e57[_0x86df('0x89')]=_0x4a952c;if(_0x1f7e57[_0x86df('0x89')]&&_0x1f7e57['account'][_0x86df('0x41')]===_0x86df('0x8a')&&_0x658072[_0x86df('0x5f')]['statuses']){if(_0x658072[_0x86df('0x5f')][_0x86df('0x8b')][_0x86df('0x49')]===0x0)return;if(_0x658072[_0x86df('0x5f')]['statuses'][0x0][_0x86df('0x8c')]!==_0x86df('0x8d'))return;return db[_0x86df('0x8e')][_0x86df('0x65')]({'read':!![],'readAt':_0x658072[_0x86df('0x5f')]['statuses'][0x0][_0x86df('0x8f')]},{'where':{'messageId':_0x658072[_0x86df('0x5f')][_0x86df('0x8b')][0x0][_0x86df('0x90')]},'individualHooks':!![]})[_0x86df('0x22')](function(_0x19f46b){return _0x474ae8[_0x86df('0x32')](0xc8)[_0x86df('0x2d')](_0x19f46b);});}_0x1f7e57[_0x86df('0x91')]=_[_0x86df('0x92')](_0x4a952c['Applications'],[_0x86df('0x82')],[_0x86df('0x93')]);if(_0x1f7e57[_0x86df('0x89')]['Applications']){delete _0x1f7e57[_0x86df('0x89')]['Applications'];}return db['CmContact'][_0x86df('0x66')]()[_0x86df('0x22')](function(_0x2e2fb4){if(!_0x2e2fb4){throw new db[(_0x86df('0x94'))][(_0x86df('0x95'))](_0x86df('0x96'));}_0x2ef3a3=_[_0x86df('0x97')](_[_0x86df('0x44')](_0x2e2fb4),[_0x86df('0x98'),_0x86df('0x99')]);_0x32e008=_[_0x86df('0x97')](_[_0x86df('0x44')](_0x2e2fb4),[_0x86df('0x98'),_0x86df('0x99'),_0x86df('0x9a'),_0x86df('0x9b')]);_0x1f7e57[_0x86df('0x5f')]={'mapKey':_0x86df('0x9c')};if(_0x1f7e57[_0x86df('0x89')]&&_0x1f7e57[_0x86df('0x89')][_0x86df('0x41')]===_0x86df('0x9d')){_0x1f7e57[_0x86df('0x5f')][_0x86df('0x9e')]=_0x658072[_0x86df('0x5f')][_0x86df('0x9f')][_0x86df('0xa0')]('whatsapp:','');_0x1f7e57[_0x86df('0x5f')][_0x86df('0x5f')]=_0x658072['body'][_0x86df('0xa1')];_0x1f7e57[_0x86df('0x5f')][_0x86df('0xa2')]=_0x658072[_0x86df('0x5f')][_0x86df('0xa3')];}if(_0x1f7e57['account']&&_0x1f7e57['account'][_0x86df('0x41')]===_0x86df('0x8a')){_0x1f7e57[_0x86df('0x5f')]['from']=_0x658072[_0x86df('0x5f')]['notifications'][0x0][_0x86df('0x9e')];_0x1f7e57['body'][_0x86df('0x5f')]=_0x658072[_0x86df('0x5f')][_0x86df('0xa4')][0x0][_0x86df('0x29')][_0x86df('0x5f')];_0x1f7e57[_0x86df('0x5f')]['messageId']=_0x658072['body'][_0x86df('0xa4')][0x0]['message_id'];}if(_0x1f7e57[_0x86df('0x5f')]['id']){delete _0x1f7e57['body']['id'];}if(_['isNil'](_0x1f7e57['body'][_0x86df('0x9e')])){throw new db['Sequelize'][(_0x86df('0x95'))](_0x86df('0xa5'));}if(_[_0x86df('0xa6')](_0x1f7e57[_0x86df('0x5f')][_0x86df('0x5f')])||_0x1f7e57[_0x86df('0x5f')]['body']===''){throw new db['Sequelize'][(_0x86df('0x95'))](_0x86df('0xa7'));}if(_[_0x86df('0xa6')](_0x1f7e57[_0x86df('0x5f')][_0x86df('0xa8')])){throw new db['Sequelize'][(_0x86df('0x95'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x32e008);}if(!_[_0x86df('0xa9')](_0x32e008,_0x1f7e57[_0x86df('0x5f')][_0x86df('0xa8')])){throw new db[(_0x86df('0x94'))][(_0x86df('0x95'))](_0x86df('0xaa')+_0x32e008);}_0x4b99c5[_0x1f7e57[_0x86df('0x5f')]['mapKey']]=_0x1f7e57[_0x86df('0x5f')][_0x86df('0x9e')];return db[_0x86df('0xab')]['find']({'where':{'id':_0x1f7e57[_0x86df('0x89')][_0x86df('0x9b')]},'include':[{'model':db[_0x86df('0xac')],'as':_0x86df('0xad'),'where':_0x4b99c5,'limit':0x1,'order':[[_0x86df('0x99'),'DESC']]}]});})[_0x86df('0x22')](handleEntityNotFound(_0x474ae8,null))[_0x86df('0x22')](function(_0x2df09b){if(_0x2df09b){_0x1f7e57['list']=_[_0x86df('0x73')](_0x2df09b,['Contacts']);if(_0x2df09b[_0x86df('0xad')][_0x86df('0x49')]){return _0x2df09b['Contacts'][0x0];}var _0x29d29d=_[_0x86df('0xae')](_0x1f7e57[_0x86df('0x5f')],{'firstName':_0x1f7e57[_0x86df('0x5f')]['from'],'ListId':_0x2df09b['id']});_0x29d29d[_0x1f7e57[_0x86df('0x5f')]['mapKey']]=_0x1f7e57[_0x86df('0x5f')]['from'];return db['CmContact'][_0x86df('0x5e')](_0x29d29d,{'fields':_0x2ef3a3,'raw':!![]});}})[_0x86df('0x22')](handleEntityNotFound(_0x474ae8,null))[_0x86df('0x22')](function(_0x2423f3){if(_0x2423f3){_0x1f7e57[_0x86df('0xaf')]=_0x2423f3;var _0x230ce4={'ContactId':_0x2423f3['id'],'phone':_0x1f7e57[_0x86df('0x5f')][_0x86df('0x9e')],'WhatsappAccountId':_0x658072['params']['id']};var _0x416771={'ContactId':_0x2423f3['id'],'WhatsappAccountId':_0x658072['params']['id'],'closed':![]};return db[_0x86df('0xb0')]['find']({'where':_0x416771})[_0x86df('0x22')](function(_0x1369c5){if(_0x1369c5){return[_0x1369c5,![]];}return db[_0x86df('0xb0')][_0x86df('0x5e')](_0x230ce4)[_0x86df('0x22')](function(_0x1f5bfe){return[_0x1f5bfe,!![]];});});}})[_0x86df('0x74')](function(_0xc21dee,_0x26fb4a){_0x1f7e57[_0x86df('0xb1')]=_0xc21dee[_0x86df('0x38')]({'plain':!![]});_0x1f7e57[_0x86df('0xb1')]['created']=![];if(_0x26fb4a){if(_0x1f7e57[_0x86df('0x89')][_0x86df('0xb2')]){_0x1f7e57['applications'][_0x86df('0xb3')]({'id':0x0,'priority':_0x1f7e57['applications'][_0x86df('0x49')]+0x1,'app':_0x86df('0xb4'),'appdata':_0x86df('0xb5'),'interval':_0x86df('0xb6')});}_0x1f7e57['interaction'][_0x86df('0xb7')]=!![];}return db[_0x86df('0x8e')]['create']({'phone':_0x1f7e57['body'][_0x86df('0x9e')],'messageId':_0x1f7e57[_0x86df('0x5f')][_0x86df('0xa2')],'body':_0x1f7e57['body'][_0x86df('0x5f')],'WhatsappAccountId':_0x658072['params']['id'],'WhatsappInteractionId':_0xc21dee['id'],'direction':'in','ContactId':_0xc21dee[_0x86df('0xb8')],'AttachmentId':_0x1f7e57[_0x86df('0x5f')]['AttachmentId']});})[_0x86df('0x22')](function(_0x48f2ea){_0x1f7e57[_0x86df('0x29')]=_0x48f2ea;if(_0x1f7e57[_0x86df('0xb1')][_0x86df('0xb9')]){return db[_0x86df('0xba')][_0x86df('0x5d')]({'attributes':['id',_0x86df('0x3c')],'where':{'id':_0x1f7e57[_0x86df('0xb1')][_0x86df('0xb9')]}})[_0x86df('0x22')](function(_0x1ed58a){if(_0x1ed58a){_0x1f7e57['applications'][_0x86df('0xbb')]({'id':0x0,'priority':0x0,'app':_0x86df('0xbc'),'appdata':_0x1ed58a[_0x86df('0x3c')]+','+(_0x1f7e57[_0x86df('0x89')][_0x86df('0xbd')]||0xa),'interval':_0x86df('0xb6')});}return respondWithRpcPromise(_0x86df('0xbe'),_0x86df('0xbf'),_0x1f7e57);});}return respondWithRpcPromise(_0x86df('0xbe'),_0x86df('0xbf'),_0x1f7e57);})[_0x86df('0x22')](function(_0x12a023){if(_0x12a023){var _0x284dc9=0xc8;var _0x4ec4a8='receiveMessage';logger[_0x86df('0x23')](_0x86df('0x25'),_0x4ec4a8,_0x284dc9,'entity\x20found');logger[_0x86df('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4ec4a8,_0x284dc9,_0x86df('0xc0'),JSON[_0x86df('0x26')](_0x12a023));if(_0x1f7e57[_0x86df('0x89')][_0x86df('0x41')]===_0x86df('0x9d')){return _0x474ae8[_0x86df('0x32')](_0x284dc9)[_0x86df('0x33')]('Content-Type',_0x86df('0xc1'))[_0x86df('0xc2')]('\x0a');}else{return _0x474ae8['status'](_0x284dc9)[_0x86df('0x2d')](_0x12a023);}}});})[_0x86df('0x58')](handleError(_0x474ae8,null));};exports[_0x86df('0xc2')]=function(_0x557d57,_0x1d26fa,_0x45480a){var _0x11b5ac,_0x5d1f7b,_0x4f4f3c;if(_[_0x86df('0xa6')](_0x557d57[_0x86df('0x5f')]['body'])||_0x557d57['body'][_0x86df('0x5f')]===''){throw new db[(_0x86df('0x94'))][(_0x86df('0x95'))](_0x86df('0xa7'));}if(_['isNil'](_0x557d57['body']['to'])){throw new db[(_0x86df('0x94'))]['ValidationError'](_0x86df('0xc3'));}_0x11b5ac=_0x557d57[_0x86df('0x5f')]['to'];return db[_0x86df('0x40')][_0x86df('0x5d')]({'where':{'id':_0x557d57['params']['id']},'include':[{'model':db['CmList'],'as':_0x86df('0xc4'),'include':[{'model':db[_0x86df('0xac')],'as':_0x86df('0xad'),'where':{'mobile':_0x11b5ac},'limit':0x1,'order':[[_0x86df('0x99'),_0x86df('0xc5')]]}]}]})['then'](handleEntityNotFound(_0x1d26fa,null))[_0x86df('0x22')](function(_0x154cfb){if(_0x154cfb&&_0x154cfb[_0x86df('0xc4')]){_0x5d1f7b=_0x154cfb[_0x86df('0x38')]({'plain':!![]});if(_0x5d1f7b[_0x86df('0xc4')]&&_0x5d1f7b[_0x86df('0xc4')][_0x86df('0xad')][_0x86df('0x49')]){return _0x5d1f7b[_0x86df('0xc4')]['Contacts'][0x0];}return db[_0x86df('0xac')]['create'](_[_0x86df('0xae')](_0x557d57['body'],{'firstName':_0x11b5ac,'mobile':_0x11b5ac,'phone':_0x11b5ac,'ListId':_0x5d1f7b[_0x86df('0x9b')]}));}})[_0x86df('0x22')](handleEntityNotFound(_0x1d26fa,null))[_0x86df('0x22')](function(_0x9466c6){if(_0x9466c6){_0x4f4f3c=_0x9466c6;return db[_0x86df('0xb0')]['find']({'where':{'ContactId':_0x4f4f3c['id'],'closed':![],'WhatsappAccountId':_0x5d1f7b['id']}})['then'](function(_0x2ae963){if(_0x2ae963){return[_0x2ae963,![]];}return db['WhatsappInteraction'][_0x86df('0x5e')]({'UserId':_0x557d57['user']['id'],'ContactId':_0x4f4f3c['id'],'WhatsappAccountId':_0x5d1f7b['id'],'phone':_0x11b5ac,'firstMsgDirection':_0x86df('0xc6'),'Messages':[_[_0x86df('0x52')](_0x557d57['body'],{'read':![],'body':_0x557d57[_0x86df('0x5f')]['body'],'phone':_0x11b5ac,'WhatsappAccountId':_0x5d1f7b['id'],'UserId':_0x557d57[_0x86df('0x60')]['id'],'ContactId':_0x4f4f3c['id']})]},{'include':[{'model':db[_0x86df('0x8e')],'as':_0x86df('0xc7')}]})[_0x86df('0x22')](function(_0x1e2260){return[_0x1e2260,!![]];});});}})[_0x86df('0x74')](function(_0x4c0532,_0xa7991e){if(_0xa7991e){return _0x4c0532;}return db[_0x86df('0x8e')]['create'](_[_0x86df('0x52')](_0x557d57[_0x86df('0x5f')],{'read':![],'body':_0x557d57[_0x86df('0x5f')]['body'],'phone':_0x11b5ac,'WhatsappAccountId':_0x5d1f7b['id'],'WhatsappInteractionId':_0x4c0532['id'],'UserId':_0x557d57[_0x86df('0x60')]['id'],'ContactId':_0x4f4f3c['id']}))[_0x86df('0x22')](function(_0x564549){_0x4c0532[_0x86df('0xc8')][_0x86df('0xc7')]=[];_0x4c0532[_0x86df('0xc8')][_0x86df('0xc7')][_0x86df('0xb3')](_0x564549['dataValues']);return _0x4c0532;});})['then'](respondWithResult(_0x1d26fa,null))[_0x86df('0x58')](handleError(_0x1d26fa,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 3775a39..da07e15 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 _0x5aa4=['hasOwnProperty','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0x2f205c,_0x37e1ba){var _0x3b75b9=function(_0x2c1693){while(--_0x2c1693){_0x2f205c['push'](_0x2f205c['shift']());}};_0x3b75b9(++_0x37e1ba);}(_0x5aa4,0x14f));var _0x45aa=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x5aa4[_0x22b39b];return _0x280e1d;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x45aa('0x0'))['db'][_0x45aa('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x45aa('0x2')](0x0);var events={'afterCreate':_0x45aa('0x3'),'afterUpdate':_0x45aa('0x4'),'afterDestroy':_0x45aa('0x5')};function emitEvent(_0x7fe8c9){return function(_0x1c8813,_0x5f397b,_0x37ef73){WhatsappAccountEvents['emit'](_0x7fe8c9+':'+_0x1c8813['id'],_0x1c8813);WhatsappAccountEvents[_0x45aa('0x6')](_0x7fe8c9,_0x1c8813);_0x37ef73(null);};}for(var e in events){if(events[_0x45aa('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x45aa('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x9f1c=['exports','events','../../mysqldb','WhatsappAccount','save','emit','hasOwnProperty','hook'];(function(_0x5266e7,_0x97b16b){var _0x5470f1=function(_0x10258e){while(--_0x10258e){_0x5266e7['push'](_0x5266e7['shift']());}};_0x5470f1(++_0x97b16b);}(_0x9f1c,0x199));var _0xc9f1=function(_0x33c897,_0x4b506d){_0x33c897=_0x33c897-0x0;var _0x1c31d6=_0x9f1c[_0x33c897];return _0x1c31d6;};'use strict';var EventEmitter=require(_0xc9f1('0x0'));var WhatsappAccount=require(_0xc9f1('0x1'))['db'][_0xc9f1('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc9f1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xab020){return function(_0x37b457,_0x3752de,_0x3f5484){WhatsappAccountEvents[_0xc9f1('0x4')](_0xab020+':'+_0x37b457['id'],_0x37b457);WhatsappAccountEvents['emit'](_0xab020,_0x37b457);_0x3f5484(null);};}for(var e in events){if(events[_0xc9f1('0x5')](e)){var event=events[e];WhatsappAccount[_0xc9f1('0x6')](e,emitEvent(event));}}module[_0xc9f1('0x7')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 5b74186..0520588 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 _0x494a=['../../config/environment','define','WhatsappAccount','whatsapp_accounts','util','bluebird','request-promise','path'];(function(_0x43ece4,_0x4dcdff){var _0x53eebc=function(_0x2cd1a3){while(--_0x2cd1a3){_0x43ece4['push'](_0x43ece4['shift']());}};_0x53eebc(++_0x4dcdff);}(_0x494a,0xcc));var _0xa494=function(_0x13b409,_0x223ce3){_0x13b409=_0x13b409-0x0;var _0x553a55=_0x494a[_0x13b409];return _0x553a55;};'use strict';var _=require('lodash');var util=require(_0xa494('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa494('0x1'));var rp=require(_0xa494('0x2'));var fs=require('fs');var path=require(_0xa494('0x3'));var rimraf=require('rimraf');var config=require(_0xa494('0x4'));var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x3ce9f7,_0xf353ee){return _0x3ce9f7[_0xa494('0x5')](_0xa494('0x6'),attributes,{'tableName':_0xa494('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab69=['define','WhatsappAccount','whatsapp_accounts','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0xdf5fc5,_0x37255b){var _0x52f5a5=function(_0x5e37aa){while(--_0x5e37aa){_0xdf5fc5['push'](_0xdf5fc5['shift']());}};_0x52f5a5(++_0x37255b);}(_0xab69,0x1b3));var _0x9ab6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xab69[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x9ab6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9ab6('0x1'));var moment=require(_0x9ab6('0x2'));var BPromise=require(_0x9ab6('0x3'));var rp=require(_0x9ab6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ab6('0x5'));var config=require(_0x9ab6('0x6'));var attributes=require(_0x9ab6('0x7'));module[_0x9ab6('0x8')]=function(_0x16f5a7,_0x10ebd1){return _0x16f5a7[_0x9ab6('0x9')](_0x9ab6('0xa'),attributes,{'tableName':_0x9ab6('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 0584a07..e46d9a9 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 _0xa53d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','attributes','include','map','model','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa53d,0x1a1));var _0xda53=function(_0x414d02,_0xf25ab3){_0x414d02=_0x414d02-0x0;var _0x19db72=_0xa53d[_0x414d02];return _0x19db72;};'use strict';var _=require('lodash');var util=require(_0xda53('0x0'));var moment=require('moment');var BPromise=require(_0xda53('0x1'));var rs=require(_0xda53('0x2'));var fs=require('fs');var Redis=require(_0xda53('0x3'));var db=require(_0xda53('0x4'))['db'];var utils=require(_0xda53('0x5'));var logger=require(_0xda53('0x6'))(_0xda53('0x7'));var config=require(_0xda53('0x8'));var jayson=require(_0xda53('0x9'));var client=jayson['client'][_0xda53('0xa')]({'port':0x232a});config[_0xda53('0xb')]=_[_0xda53('0xc')](config[_0xda53('0xb')],{'host':_0xda53('0xd'),'port':0x18eb});var socket=require(_0xda53('0xe'))(new Redis(config['redis']));require(_0xda53('0xf'))[_0xda53('0x10')](socket);function respondWithRpcPromise(_0x2f73de,_0x4054ea,_0x5e0e83){return new BPromise(function(_0x26c299,_0x8ac6be){return client[_0xda53('0x11')](_0x2f73de,_0x5e0e83)[_0xda53('0x12')](function(_0x5b295b){logger[_0xda53('0x13')](_0xda53('0x14'),_0x4054ea,_0xda53('0x15'));logger[_0xda53('0x16')](_0xda53('0x17'),_0x4054ea,_0xda53('0x15'),JSON[_0xda53('0x18')](_0x5b295b));if(_0x5b295b[_0xda53('0x19')]){if(_0x5b295b[_0xda53('0x19')][_0xda53('0x1a')]===0x1f4){logger[_0xda53('0x19')](_0xda53('0x14'),_0x4054ea,_0x5b295b[_0xda53('0x19')][_0xda53('0x1b')]);return _0x8ac6be(_0x5b295b['error'][_0xda53('0x1b')]);}logger['error'](_0xda53('0x14'),_0x4054ea,_0x5b295b[_0xda53('0x19')]['message']);return _0x26c299(_0x5b295b['error'][_0xda53('0x1b')]);}else{logger[_0xda53('0x13')](_0xda53('0x14'),_0x4054ea,_0xda53('0x15'));_0x26c299(_0x5b295b[_0xda53('0x1c')][_0xda53('0x1b')]);}})[_0xda53('0x1d')](function(_0x339192){logger[_0xda53('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x4054ea,_0x339192);_0x8ac6be(_0x339192);});});}exports[_0xda53('0x1e')]=function(_0x2b9a07){var _0x2e2a07=this;return new Promise(function(_0x907f16,_0x45240c){return db[_0xda53('0x1f')][_0xda53('0x20')]({'raw':_0x2b9a07['options']?_0x2b9a07[_0xda53('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x2b9a07[_0xda53('0x21')]?_0x2b9a07[_0xda53('0x21')]['where']||null:null,'attributes':_0x2b9a07[_0xda53('0x21')]?_0x2b9a07['options'][_0xda53('0x22')]||null:null,'include':_0x2b9a07[_0xda53('0x21')]?_0x2b9a07[_0xda53('0x21')][_0xda53('0x23')]?_[_0xda53('0x24')](_0x2b9a07[_0xda53('0x21')][_0xda53('0x23')],function(_0x509c2e){return{'model':db[_0x509c2e[_0xda53('0x25')]],'as':_0x509c2e['as'],'attributes':_0x509c2e[_0xda53('0x22')],'include':_0x509c2e['include']?_[_0xda53('0x24')](_0x509c2e[_0xda53('0x23')],function(_0x1dbec1){return{'model':db[_0x1dbec1[_0xda53('0x25')]],'as':_0x1dbec1['as'],'attributes':_0x1dbec1[_0xda53('0x22')],'include':_0x1dbec1[_0xda53('0x23')]?_[_0xda53('0x24')](_0x1dbec1[_0xda53('0x23')],function(_0x2ffe74){return{'model':db[_0x2ffe74[_0xda53('0x25')]],'as':_0x2ffe74['as'],'attributes':_0x2ffe74[_0xda53('0x22')]};}):[]};}):[]};}):[]:[]})[_0xda53('0x12')](function(_0x21eb39){logger[_0xda53('0x13')](_0xda53('0x1e'),_0x2b9a07);logger[_0xda53('0x16')](_0xda53('0x1e'),_0x2b9a07,JSON[_0xda53('0x18')](_0x21eb39));_0x907f16(_0x21eb39);})['catch'](function(_0xc6bee0){logger[_0xda53('0x19')]('ShowWhatsappAccount',_0xc6bee0[_0xda53('0x1b')],_0x2b9a07);_0x45240c(_0x2e2a07[_0xda53('0x19')](0x1f4,_0xc6bee0[_0xda53('0x1b')]));});});}; \ No newline at end of file +var _0x1fac=['catch','ShowWhatsappAccount','find','options','raw','attributes','map','include','model','then','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x571a12,_0x244f3d){var _0xb4fcd3=function(_0x4050ae){while(--_0x4050ae){_0x571a12['push'](_0x571a12['shift']());}};_0xb4fcd3(++_0x244f3d);}(_0x1fac,0xe9));var _0xc1fa=function(_0x5a00e3,_0x1a0d82){_0x5a00e3=_0x5a00e3-0x0;var _0x458b8a=_0x1fac[_0x5a00e3];return _0x458b8a;};'use strict';var _=require(_0xc1fa('0x0'));var util=require('util');var moment=require(_0xc1fa('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1fa('0x2'));var fs=require('fs');var Redis=require(_0xc1fa('0x3'));var db=require(_0xc1fa('0x4'))['db'];var utils=require(_0xc1fa('0x5'));var logger=require(_0xc1fa('0x6'))(_0xc1fa('0x7'));var config=require(_0xc1fa('0x8'));var jayson=require(_0xc1fa('0x9'));var client=jayson[_0xc1fa('0xa')]['http']({'port':0x232a});config[_0xc1fa('0xb')]=_[_0xc1fa('0xc')](config[_0xc1fa('0xb')],{'host':_0xc1fa('0xd'),'port':0x18eb});var socket=require(_0xc1fa('0xe'))(new Redis(config['redis']));require(_0xc1fa('0xf'))[_0xc1fa('0x10')](socket);function respondWithRpcPromise(_0x43b4d9,_0x2179a3,_0x2989bf){return new BPromise(function(_0xfbe5ad,_0x4c8c49){return client[_0xc1fa('0x11')](_0x43b4d9,_0x2989bf)['then'](function(_0x264409){logger[_0xc1fa('0x12')](_0xc1fa('0x13'),_0x2179a3,_0xc1fa('0x14'));logger[_0xc1fa('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x2179a3,_0xc1fa('0x14'),JSON['stringify'](_0x264409));if(_0x264409[_0xc1fa('0x16')]){if(_0x264409[_0xc1fa('0x16')][_0xc1fa('0x17')]===0x1f4){logger['error'](_0xc1fa('0x13'),_0x2179a3,_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);return _0x4c8c49(_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);}logger[_0xc1fa('0x16')](_0xc1fa('0x13'),_0x2179a3,_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);return _0xfbe5ad(_0x264409[_0xc1fa('0x16')][_0xc1fa('0x18')]);}else{logger[_0xc1fa('0x12')](_0xc1fa('0x13'),_0x2179a3,_0xc1fa('0x14'));_0xfbe5ad(_0x264409[_0xc1fa('0x19')]['message']);}})[_0xc1fa('0x1a')](function(_0x5ef86e){logger[_0xc1fa('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0x2179a3,_0x5ef86e);_0x4c8c49(_0x5ef86e);});});}exports[_0xc1fa('0x1b')]=function(_0x259574){var _0x5dea02=this;return new Promise(function(_0xcb9f94,_0x31b859){return db['WhatsappAccount'][_0xc1fa('0x1c')]({'raw':_0x259574[_0xc1fa('0x1d')]?_0x259574[_0xc1fa('0x1d')][_0xc1fa('0x1e')]===undefined?!![]:![]:!![],'where':_0x259574[_0xc1fa('0x1d')]?_0x259574[_0xc1fa('0x1d')]['where']||null:null,'attributes':_0x259574[_0xc1fa('0x1d')]?_0x259574[_0xc1fa('0x1d')][_0xc1fa('0x1f')]||null:null,'include':_0x259574['options']?_0x259574['options']['include']?_[_0xc1fa('0x20')](_0x259574[_0xc1fa('0x1d')][_0xc1fa('0x21')],function(_0x76bf82){return{'model':db[_0x76bf82[_0xc1fa('0x22')]],'as':_0x76bf82['as'],'attributes':_0x76bf82[_0xc1fa('0x1f')],'include':_0x76bf82['include']?_[_0xc1fa('0x20')](_0x76bf82['include'],function(_0x11bf53){return{'model':db[_0x11bf53[_0xc1fa('0x22')]],'as':_0x11bf53['as'],'attributes':_0x11bf53['attributes'],'include':_0x11bf53['include']?_[_0xc1fa('0x20')](_0x11bf53[_0xc1fa('0x21')],function(_0x1e042d){return{'model':db[_0x1e042d['model']],'as':_0x1e042d['as'],'attributes':_0x1e042d[_0xc1fa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc1fa('0x23')](function(_0x6dc0a0){logger[_0xc1fa('0x12')]('ShowWhatsappAccount',_0x259574);logger[_0xc1fa('0x15')](_0xc1fa('0x1b'),_0x259574,JSON[_0xc1fa('0x24')](_0x6dc0a0));_0xcb9f94(_0x6dc0a0);})[_0xc1fa('0x1a')](function(_0x4c4c35){logger[_0xc1fa('0x16')](_0xc1fa('0x1b'),_0x4c4c35['message'],_0x259574);_0x31b859(_0x5dea02[_0xc1fa('0x16')](0x1f4,_0x4c4c35[_0xc1fa('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a5642e5..bf6a69a 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 _0x152e=['emit','removeListener','length','whatsappAccount:','remove'];(function(_0x2e4326,_0x5e3110){var _0x409019=function(_0x41614b){while(--_0x41614b){_0x2e4326['push'](_0x2e4326['shift']());}};_0x409019(++_0x5e3110);}(_0x152e,0x1c6));var _0xe152=function(_0x477270,_0x4adea6){_0x477270=_0x477270-0x0;var _0x21ae0d=_0x152e[_0x477270];return _0x21ae0d;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0xe152('0x0'),'update'];function createListener(_0x32bf1e,_0x1f8cda){return function(_0x51a797){_0x1f8cda[_0xe152('0x1')](_0x32bf1e,_0x51a797);};}function removeListener(_0x1edf0b,_0x6d72d4){return function(){WhatsappAccountEvents[_0xe152('0x2')](_0x1edf0b,_0x6d72d4);};}exports['register']=function(_0x2642a6){for(var _0x528ab4=0x0,_0x466126=events[_0xe152('0x3')];_0x528ab4<_0x466126;_0x528ab4++){var _0x558f0f=events[_0x528ab4];var _0x50246d=createListener(_0xe152('0x4')+_0x558f0f,_0x2642a6);WhatsappAccountEvents['on'](_0x558f0f,_0x50246d);}}; \ No newline at end of file +var _0x9dba=['register','save','remove','update','emit'];(function(_0x105b6b,_0x46b7cd){var _0x2d4e52=function(_0x39b78e){while(--_0x39b78e){_0x105b6b['push'](_0x105b6b['shift']());}};_0x2d4e52(++_0x46b7cd);}(_0x9dba,0x7e));var _0xa9db=function(_0x3e9bef,_0x431c20){_0x3e9bef=_0x3e9bef-0x0;var _0x2d8086=_0x9dba[_0x3e9bef];return _0x2d8086;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xa9db('0x0'),_0xa9db('0x1'),_0xa9db('0x2')];function createListener(_0x2200cd,_0x4eb355){return function(_0xd5d788){_0x4eb355[_0xa9db('0x3')](_0x2200cd,_0xd5d788);};}function removeListener(_0x103f10,_0xb7dfc3){return function(){WhatsappAccountEvents['removeListener'](_0x103f10,_0xb7dfc3);};}exports[_0xa9db('0x4')]=function(_0x3d3bfa){for(var _0xffc972=0x0,_0x5ca581=events['length'];_0xffc972<_0x5ca581;_0xffc972++){var _0x49b775=events[_0xffc972];var _0x1b91de=createListener('whatsappAccount:'+_0x49b775,_0x3d3bfa);WhatsappAccountEvents['on'](_0x49b775,_0x1b91de);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 0df26c6..764ea4f 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 _0x1c6b=['../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service'];(function(_0x512243,_0x515f84){var _0x2f5cae=function(_0x11e21a){while(--_0x11e21a){_0x512243['push'](_0x512243['shift']());}};_0x2f5cae(++_0x515f84);}(_0x1c6b,0x162));var _0xb1c6=function(_0x5e8906,_0x18f1e7){_0x5e8906=_0x5e8906-0x0;var _0x3b6622=_0x1c6b[_0x5e8906];return _0x3b6622;};'use strict';var multer=require(_0xb1c6('0x0'));var util=require(_0xb1c6('0x1'));var path=require(_0xb1c6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1c6('0x3')]();var fs_extra=require(_0xb1c6('0x4'));var auth=require(_0xb1c6('0x5'));var interaction=require(_0xb1c6('0x6'));var config=require(_0xb1c6('0x7'));var controller=require(_0xb1c6('0x8'));router['get']('/',auth[_0xb1c6('0x9')](),controller[_0xb1c6('0xa')]);router[_0xb1c6('0xb')]('/:id',auth[_0xb1c6('0x9')](),controller['show']);router[_0xb1c6('0xc')]('/',auth['isAuthenticated'](),controller[_0xb1c6('0xd')]);router[_0xb1c6('0xe')](_0xb1c6('0xf'),auth['isAuthenticated'](),controller[_0xb1c6('0x10')]);router[_0xb1c6('0x11')]('/:id',auth[_0xb1c6('0x9')](),controller[_0xb1c6('0x12')]);module[_0xb1c6('0x13')]=router; \ No newline at end of file +var _0x494c=['post','create','put','update','delete','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5833c7,_0x18eb95){var _0x33e6cd=function(_0x4ec815){while(--_0x4ec815){_0x5833c7['push'](_0x5833c7['shift']());}};_0x33e6cd(++_0x18eb95);}(_0x494c,0x115));var _0xc494=function(_0x5515e7,_0x32d5e3){_0x5515e7=_0x5515e7-0x0;var _0x47dc97=_0x494c[_0x5515e7];return _0x47dc97;};'use strict';var multer=require('multer');var util=require(_0xc494('0x0'));var path=require(_0xc494('0x1'));var timeout=require(_0xc494('0x2'));var express=require(_0xc494('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc494('0x4'));var interaction=require(_0xc494('0x5'));var config=require('../../config/environment');var controller=require(_0xc494('0x6'));router[_0xc494('0x7')]('/',auth[_0xc494('0x8')](),controller[_0xc494('0x9')]);router[_0xc494('0x7')](_0xc494('0xa'),auth['isAuthenticated'](),controller[_0xc494('0xb')]);router[_0xc494('0xc')]('/',auth['isAuthenticated'](),controller[_0xc494('0xd')]);router[_0xc494('0xe')](_0xc494('0xa'),auth[_0xc494('0x8')](),controller[_0xc494('0xf')]);router[_0xc494('0x10')](_0xc494('0xa'),auth[_0xc494('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 5ce53f1..74b3709 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 _0x3947=['exports','INTEGER','noop','TEXT','STRING','sequelize'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x3947,0xe9));var _0x7394=function(_0x5bbe6f,_0x55963b){_0x5bbe6f=_0x5bbe6f-0x0;var _0x59803b=_0x3947[_0x5bbe6f];return _0x59803b;};'use strict';var Sequelize=require(_0x7394('0x0'));module[_0x7394('0x1')]={'priority':{'type':Sequelize[_0x7394('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7394('0x3')},'appdata':{'type':Sequelize[_0x7394('0x4')]()},'description':{'type':Sequelize[_0x7394('0x5')]},'interval':{'type':Sequelize[_0x7394('0x5')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc18e=['STRING','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x57bb0f,_0x6cda09){var _0x4e8b9f=function(_0x101ed9){while(--_0x101ed9){_0x57bb0f['push'](_0x57bb0f['shift']());}};_0x4e8b9f(++_0x6cda09);}(_0xc18e,0x1db));var _0xec18=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0xc18e[_0x453e2b];return _0x50f306;};'use strict';var Sequelize=require(_0xec18('0x0'));module[_0xec18('0x1')]={'priority':{'type':Sequelize[_0xec18('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xec18('0x3')},'appdata':{'type':Sequelize[_0xec18('0x4')]()},'description':{'type':Sequelize[_0xec18('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 6be18aa..dfe49a2 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 _0x8838=['bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','WhatsappApplication','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','include','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x5e75ad,_0x81b762){var _0x47e0b4=function(_0x53ac55){while(--_0x53ac55){_0x5e75ad['push'](_0x5e75ad['shift']());}};_0x47e0b4(++_0x81b762);}(_0x8838,0x90));var _0x8883=function(_0x2a81b3,_0x4db6f4){_0x2a81b3=_0x2a81b3-0x0;var _0x4094a0=_0x8838[_0x2a81b3];return _0x4094a0;};'use strict';var emlformat=require(_0x8883('0x0'));var rimraf=require(_0x8883('0x1'));var zipdir=require(_0x8883('0x2'));var jsonpatch=require(_0x8883('0x3'));var rp=require(_0x8883('0x4'));var moment=require(_0x8883('0x5'));var BPromise=require(_0x8883('0x6'));var Mustache=require(_0x8883('0x7'));var util=require(_0x8883('0x8'));var path=require(_0x8883('0x9'));var sox=require(_0x8883('0xa'));var csv=require(_0x8883('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8883('0xc'));var squel=require('squel');var crypto=require(_0x8883('0xd'));var jsforce=require(_0x8883('0xe'));var deskjs=require(_0x8883('0xf'));var toCsv=require(_0x8883('0xb'));var querystring=require(_0x8883('0x10'));var Papa=require(_0x8883('0x11'));var Redis=require(_0x8883('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8883('0x13'));var as=require(_0x8883('0x14'));var hardwareService=require(_0x8883('0x15'));var logger=require(_0x8883('0x16'))('api');var utils=require(_0x8883('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8883('0x18'));var db=require(_0x8883('0x19'))['db'];function respondWithStatusCode(_0x357db6,_0x42dd7f){_0x42dd7f=_0x42dd7f||0xcc;return function(_0x3ad46c){if(_0x3ad46c){return _0x357db6[_0x8883('0x1a')](_0x42dd7f);}return _0x357db6[_0x8883('0x1b')](_0x42dd7f)[_0x8883('0x1c')]();};}function respondWithResult(_0x4663ba,_0x5f5259){_0x5f5259=_0x5f5259||0xc8;return function(_0x37ed54){if(_0x37ed54){return _0x4663ba[_0x8883('0x1b')](_0x5f5259)[_0x8883('0x1d')](_0x37ed54);}};}function respondWithFilteredResult(_0x347575,_0x5b9cba){return function(_0x126280){if(_0x126280){var _0x55e8ab=typeof _0x5b9cba[_0x8883('0x1e')]==='undefined'&&typeof _0x5b9cba[_0x8883('0x1f')]==='undefined';var _0x2ff211=_0x126280[_0x8883('0x20')];var _0x127b5f=_0x55e8ab?0x0:_0x5b9cba[_0x8883('0x1e')];var _0x1ec1b5=_0x55e8ab?_0x126280['count']:_0x5b9cba['offset']+_0x5b9cba[_0x8883('0x1f')];var _0x118c33;if(_0x1ec1b5>=_0x2ff211){_0x1ec1b5=_0x2ff211;_0x118c33=0xc8;}else{_0x118c33=0xce;}_0x347575['status'](_0x118c33);return _0x347575[_0x8883('0x21')](_0x8883('0x22'),_0x127b5f+'-'+_0x1ec1b5+'/'+_0x2ff211)[_0x8883('0x1d')](_0x126280);}return null;};}function patchUpdates(_0x4a7185){return function(_0x1bb80d){try{jsonpatch[_0x8883('0x23')](_0x1bb80d,_0x4a7185,!![]);}catch(_0x10d674){return BPromise[_0x8883('0x24')](_0x10d674);}return _0x1bb80d[_0x8883('0x25')]();};}function saveUpdates(_0x4c2376,_0x2ee36c){return function(_0xbb362f){if(_0xbb362f){return _0xbb362f['update'](_0x4c2376)[_0x8883('0x26')](function(_0x154e5f){return _0x154e5f;});}return null;};}function removeEntity(_0x171d63,_0x51fdd9){return function(_0x3f90e8){if(_0x3f90e8){return _0x3f90e8[_0x8883('0x27')]()[_0x8883('0x26')](function(){_0x171d63[_0x8883('0x1b')](0xcc)[_0x8883('0x1c')]();});}};}function handleEntityNotFound(_0x223412,_0x2b53e5){return function(_0x5d7c59){if(!_0x5d7c59){_0x223412[_0x8883('0x1a')](0x194);}return _0x5d7c59;};}function handleError(_0x576019,_0x1b6c13){_0x1b6c13=_0x1b6c13||0x1f4;return function(_0x5c3a68){logger['error'](_0x5c3a68['stack']);if(_0x5c3a68['name']){delete _0x5c3a68[_0x8883('0x28')];}_0x576019[_0x8883('0x1b')](_0x1b6c13)[_0x8883('0x29')](_0x5c3a68);};}exports['index']=function(_0x21529a,_0x1147ed){var _0x26df5b={},_0x2e772e={},_0x576605={'count':0x0,'rows':[]};var _0x15fcdb=_['map'](db[_0x8883('0x2a')][_0x8883('0x2b')],function(_0x2bdd57){return{'name':_0x2bdd57[_0x8883('0x2c')],'type':_0x2bdd57[_0x8883('0x2d')][_0x8883('0x2e')]};});_0x2e772e[_0x8883('0x2f')]=_['map'](_0x15fcdb,'name');_0x2e772e['query']=_[_0x8883('0x30')](_0x21529a[_0x8883('0x31')]);_0x2e772e[_0x8883('0x32')]=_['intersection'](_0x2e772e[_0x8883('0x2f')],_0x2e772e[_0x8883('0x31')]);_0x26df5b['attributes']=_['intersection'](_0x2e772e[_0x8883('0x2f')],qs['fields'](_0x21529a['query'][_0x8883('0x33')]));_0x26df5b[_0x8883('0x34')]=_0x26df5b['attributes'][_0x8883('0x35')]?_0x26df5b[_0x8883('0x34')]:_0x2e772e[_0x8883('0x2f')];if(!_0x21529a['query'][_0x8883('0x36')](_0x8883('0x37'))){_0x26df5b[_0x8883('0x1f')]=qs[_0x8883('0x1f')](_0x21529a[_0x8883('0x31')][_0x8883('0x1f')]);_0x26df5b[_0x8883('0x1e')]=qs[_0x8883('0x1e')](_0x21529a[_0x8883('0x31')][_0x8883('0x1e')]);}_0x26df5b[_0x8883('0x38')]=qs[_0x8883('0x39')](_0x21529a[_0x8883('0x31')][_0x8883('0x39')]);_0x26df5b[_0x8883('0x3a')]=qs['filters'](_[_0x8883('0x3b')](_0x21529a['query'],_0x2e772e[_0x8883('0x32')]),_0x15fcdb);if(_0x21529a['query'][_0x8883('0x3c')]){_0x26df5b['where']=_[_0x8883('0x3d')](_0x26df5b[_0x8883('0x3a')],{'$or':_['map'](_0x15fcdb,function(_0x2c3965){if(_0x2c3965[_0x8883('0x2d')]!==_0x8883('0x3e')){var _0x480609={};_0x480609[_0x2c3965[_0x8883('0x28')]]={'$like':'%'+_0x21529a[_0x8883('0x31')][_0x8883('0x3c')]+'%'};return _0x480609;}})});}_0x26df5b=_[_0x8883('0x3d')]({},_0x26df5b,_0x21529a[_0x8883('0x3f')]);var _0x21e90c={'where':_0x26df5b[_0x8883('0x3a')]};return db[_0x8883('0x2a')][_0x8883('0x20')](_0x21e90c)[_0x8883('0x26')](function(_0x262ef7){_0x576605[_0x8883('0x20')]=_0x262ef7;if(_0x21529a[_0x8883('0x31')][_0x8883('0x40')]){_0x26df5b['include']=[{'all':!![]}];}return db[_0x8883('0x2a')]['findAll'](_0x26df5b);})[_0x8883('0x26')](function(_0x3626bf){_0x576605[_0x8883('0x41')]=_0x3626bf;return _0x576605;})[_0x8883('0x26')](respondWithFilteredResult(_0x1147ed,_0x26df5b))[_0x8883('0x42')](handleError(_0x1147ed,null));};exports[_0x8883('0x43')]=function(_0x12af4c,_0x27a11a){var _0x5a66de={'raw':!![],'where':{'id':_0x12af4c[_0x8883('0x44')]['id']}},_0x35b867={};_0x35b867[_0x8883('0x2f')]=_[_0x8883('0x30')](db[_0x8883('0x2a')][_0x8883('0x2b')]);_0x35b867[_0x8883('0x31')]=_['keys'](_0x12af4c[_0x8883('0x31')]);_0x35b867[_0x8883('0x32')]=_[_0x8883('0x45')](_0x35b867[_0x8883('0x2f')],_0x35b867['query']);_0x5a66de[_0x8883('0x34')]=_[_0x8883('0x45')](_0x35b867[_0x8883('0x2f')],qs['fields'](_0x12af4c[_0x8883('0x31')]['fields']));_0x5a66de[_0x8883('0x34')]=_0x5a66de['attributes'][_0x8883('0x35')]?_0x5a66de[_0x8883('0x34')]:_0x35b867['model'];if(_0x12af4c['query']['includeAll']){_0x5a66de[_0x8883('0x46')]=[{'all':!![]}];}_0x5a66de=_[_0x8883('0x3d')]({},_0x5a66de,_0x12af4c[_0x8883('0x3f')]);return db['WhatsappApplication'][_0x8883('0x47')](_0x5a66de)[_0x8883('0x26')](handleEntityNotFound(_0x27a11a,null))[_0x8883('0x26')](respondWithResult(_0x27a11a,null))[_0x8883('0x42')](handleError(_0x27a11a,null));};exports[_0x8883('0x48')]=function(_0x58fdd8,_0x43683f){return db[_0x8883('0x2a')][_0x8883('0x48')](_0x58fdd8[_0x8883('0x49')],{})[_0x8883('0x26')](respondWithResult(_0x43683f,0xc9))[_0x8883('0x42')](handleError(_0x43683f,null));};exports[_0x8883('0x4a')]=function(_0x21ee60,_0x598086){if(_0x21ee60['body']['id']){delete _0x21ee60[_0x8883('0x49')]['id'];}return db[_0x8883('0x2a')]['find']({'where':{'id':_0x21ee60[_0x8883('0x44')]['id']}})['then'](handleEntityNotFound(_0x598086,null))['then'](saveUpdates(_0x21ee60[_0x8883('0x49')],null))[_0x8883('0x26')](respondWithResult(_0x598086,null))['catch'](handleError(_0x598086,null));};exports[_0x8883('0x27')]=function(_0x153ba6,_0x23f464){return db[_0x8883('0x2a')][_0x8883('0x47')]({'where':{'id':_0x153ba6[_0x8883('0x44')]['id']}})[_0x8883('0x26')](handleEntityNotFound(_0x23f464,null))[_0x8883('0x26')](removeEntity(_0x23f464,null))[_0x8883('0x42')](handleError(_0x23f464,null));}; \ No newline at end of file +var _0xcf2f=['sort','pick','where','merge','VIRTUAL','filter','options','WhatsappApplication','includeAll','include','rows','catch','params','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x5a9fb9,_0xb126c4){var _0x110430=function(_0x5112a1){while(--_0x5112a1){_0x5a9fb9['push'](_0x5a9fb9['shift']());}};_0x110430(++_0xb126c4);}(_0xcf2f,0xa7));var _0xfcf2=function(_0xcfd7ff,_0x4088f0){_0xcfd7ff=_0xcfd7ff-0x0;var _0x5e5158=_0xcf2f[_0xcfd7ff];return _0x5e5158;};'use strict';var emlformat=require(_0xfcf2('0x0'));var rimraf=require(_0xfcf2('0x1'));var zipdir=require(_0xfcf2('0x2'));var jsonpatch=require(_0xfcf2('0x3'));var rp=require(_0xfcf2('0x4'));var moment=require('moment');var BPromise=require(_0xfcf2('0x5'));var Mustache=require(_0xfcf2('0x6'));var util=require(_0xfcf2('0x7'));var path=require(_0xfcf2('0x8'));var sox=require(_0xfcf2('0x9'));var csv=require(_0xfcf2('0xa'));var ejs=require(_0xfcf2('0xb'));var fs=require('fs');var fs_extra=require(_0xfcf2('0xc'));var _=require(_0xfcf2('0xd'));var squel=require(_0xfcf2('0xe'));var crypto=require(_0xfcf2('0xf'));var jsforce=require(_0xfcf2('0x10'));var deskjs=require(_0xfcf2('0x11'));var toCsv=require(_0xfcf2('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcf2('0x12'));var qs=require(_0xfcf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcf2('0x14'));var logger=require(_0xfcf2('0x15'))(_0xfcf2('0x16'));var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfcf2('0x18'))['db'];function respondWithStatusCode(_0x1ba610,_0x175ac9){_0x175ac9=_0x175ac9||0xcc;return function(_0x1be8cc){if(_0x1be8cc){return _0x1ba610['sendStatus'](_0x175ac9);}return _0x1ba610[_0xfcf2('0x19')](_0x175ac9)['end']();};}function respondWithResult(_0x5b414a,_0x5dc04b){_0x5dc04b=_0x5dc04b||0xc8;return function(_0xc87ff4){if(_0xc87ff4){return _0x5b414a['status'](_0x5dc04b)[_0xfcf2('0x1a')](_0xc87ff4);}};}function respondWithFilteredResult(_0x1febf8,_0x245f9a){return function(_0x21f7d1){if(_0x21f7d1){var _0x315b2f=typeof _0x245f9a[_0xfcf2('0x1b')]===_0xfcf2('0x1c')&&typeof _0x245f9a['limit']===_0xfcf2('0x1c');var _0x213125=_0x21f7d1[_0xfcf2('0x1d')];var _0x581d78=_0x315b2f?0x0:_0x245f9a[_0xfcf2('0x1b')];var _0x1b3c89=_0x315b2f?_0x21f7d1[_0xfcf2('0x1d')]:_0x245f9a[_0xfcf2('0x1b')]+_0x245f9a[_0xfcf2('0x1e')];var _0x53c406;if(_0x1b3c89>=_0x213125){_0x1b3c89=_0x213125;_0x53c406=0xc8;}else{_0x53c406=0xce;}_0x1febf8[_0xfcf2('0x19')](_0x53c406);return _0x1febf8[_0xfcf2('0x1f')]('Content-Range',_0x581d78+'-'+_0x1b3c89+'/'+_0x213125)[_0xfcf2('0x1a')](_0x21f7d1);}return null;};}function patchUpdates(_0x23c079){return function(_0x206738){try{jsonpatch[_0xfcf2('0x20')](_0x206738,_0x23c079,!![]);}catch(_0x51e0b7){return BPromise[_0xfcf2('0x21')](_0x51e0b7);}return _0x206738[_0xfcf2('0x22')]();};}function saveUpdates(_0x422c5a,_0x1eeebd){return function(_0x5afab5){if(_0x5afab5){return _0x5afab5[_0xfcf2('0x23')](_0x422c5a)[_0xfcf2('0x24')](function(_0x232f6f){return _0x232f6f;});}return null;};}function removeEntity(_0x584e76,_0x26641a){return function(_0x151aa8){if(_0x151aa8){return _0x151aa8['destroy']()[_0xfcf2('0x24')](function(){_0x584e76[_0xfcf2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6f14,_0x26bfcc){return function(_0x1f0f07){if(!_0x1f0f07){_0x1e6f14[_0xfcf2('0x25')](0x194);}return _0x1f0f07;};}function handleError(_0x5bb384,_0x1deca3){_0x1deca3=_0x1deca3||0x1f4;return function(_0x448222){logger[_0xfcf2('0x26')](_0x448222[_0xfcf2('0x27')]);if(_0x448222[_0xfcf2('0x28')]){delete _0x448222[_0xfcf2('0x28')];}_0x5bb384[_0xfcf2('0x19')](_0x1deca3)[_0xfcf2('0x29')](_0x448222);};}exports[_0xfcf2('0x2a')]=function(_0x56f839,_0x4c2935){var _0x695f31={},_0x878504={},_0x3308c3={'count':0x0,'rows':[]};var _0x532db6=_[_0xfcf2('0x2b')](db['WhatsappApplication'][_0xfcf2('0x2c')],function(_0x26651e){return{'name':_0x26651e[_0xfcf2('0x2d')],'type':_0x26651e[_0xfcf2('0x2e')][_0xfcf2('0x2f')]};});_0x878504[_0xfcf2('0x30')]=_[_0xfcf2('0x2b')](_0x532db6,'name');_0x878504['query']=_[_0xfcf2('0x31')](_0x56f839[_0xfcf2('0x32')]);_0x878504[_0xfcf2('0x33')]=_[_0xfcf2('0x34')](_0x878504['model'],_0x878504['query']);_0x695f31[_0xfcf2('0x35')]=_['intersection'](_0x878504[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x56f839['query'][_0xfcf2('0x36')]));_0x695f31[_0xfcf2('0x35')]=_0x695f31[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x695f31[_0xfcf2('0x35')]:_0x878504[_0xfcf2('0x30')];if(!_0x56f839[_0xfcf2('0x32')]['hasOwnProperty'](_0xfcf2('0x38'))){_0x695f31[_0xfcf2('0x1e')]=qs['limit'](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x1e')]);_0x695f31['offset']=qs[_0xfcf2('0x1b')](_0x56f839[_0xfcf2('0x32')]['offset']);}_0x695f31[_0xfcf2('0x39')]=qs[_0xfcf2('0x3a')](_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3a')]);_0x695f31['where']=qs[_0xfcf2('0x33')](_[_0xfcf2('0x3b')](_0x56f839[_0xfcf2('0x32')],_0x878504[_0xfcf2('0x33')]),_0x532db6);if(_0x56f839[_0xfcf2('0x32')]['filter']){_0x695f31[_0xfcf2('0x3c')]=_[_0xfcf2('0x3d')](_0x695f31[_0xfcf2('0x3c')],{'$or':_[_0xfcf2('0x2b')](_0x532db6,function(_0x41cac2){if(_0x41cac2['type']!==_0xfcf2('0x3e')){var _0x4dfc61={};_0x4dfc61[_0x41cac2[_0xfcf2('0x28')]]={'$like':'%'+_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x3f')]+'%'};return _0x4dfc61;}})});}_0x695f31=_[_0xfcf2('0x3d')]({},_0x695f31,_0x56f839[_0xfcf2('0x40')]);var _0x59b404={'where':_0x695f31[_0xfcf2('0x3c')]};return db[_0xfcf2('0x41')][_0xfcf2('0x1d')](_0x59b404)['then'](function(_0x1e8e71){_0x3308c3[_0xfcf2('0x1d')]=_0x1e8e71;if(_0x56f839[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x695f31[_0xfcf2('0x43')]=[{'all':!![]}];}return db[_0xfcf2('0x41')]['findAll'](_0x695f31);})['then'](function(_0x526c42){_0x3308c3[_0xfcf2('0x44')]=_0x526c42;return _0x3308c3;})[_0xfcf2('0x24')](respondWithFilteredResult(_0x4c2935,_0x695f31))[_0xfcf2('0x45')](handleError(_0x4c2935,null));};exports['show']=function(_0x559aea,_0x5efb5c){var _0x3fb288={'raw':!![],'where':{'id':_0x559aea[_0xfcf2('0x46')]['id']}},_0xab0747={};_0xab0747[_0xfcf2('0x30')]=_[_0xfcf2('0x31')](db[_0xfcf2('0x41')][_0xfcf2('0x2c')]);_0xab0747[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](_0x559aea[_0xfcf2('0x32')]);_0xab0747[_0xfcf2('0x33')]=_['intersection'](_0xab0747['model'],_0xab0747[_0xfcf2('0x32')]);_0x3fb288[_0xfcf2('0x35')]=_[_0xfcf2('0x34')](_0xab0747[_0xfcf2('0x30')],qs[_0xfcf2('0x36')](_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x36')]));_0x3fb288[_0xfcf2('0x35')]=_0x3fb288[_0xfcf2('0x35')][_0xfcf2('0x37')]?_0x3fb288[_0xfcf2('0x35')]:_0xab0747[_0xfcf2('0x30')];if(_0x559aea[_0xfcf2('0x32')][_0xfcf2('0x42')]){_0x3fb288[_0xfcf2('0x43')]=[{'all':!![]}];}_0x3fb288=_[_0xfcf2('0x3d')]({},_0x3fb288,_0x559aea[_0xfcf2('0x40')]);return db['WhatsappApplication'][_0xfcf2('0x47')](_0x3fb288)[_0xfcf2('0x24')](handleEntityNotFound(_0x5efb5c,null))['then'](respondWithResult(_0x5efb5c,null))[_0xfcf2('0x45')](handleError(_0x5efb5c,null));};exports['create']=function(_0x12eef4,_0xe85e89){return db[_0xfcf2('0x41')][_0xfcf2('0x48')](_0x12eef4['body'],{})['then'](respondWithResult(_0xe85e89,0xc9))['catch'](handleError(_0xe85e89,null));};exports[_0xfcf2('0x23')]=function(_0x37d4bb,_0x20fcab){if(_0x37d4bb[_0xfcf2('0x49')]['id']){delete _0x37d4bb['body']['id'];}return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x37d4bb[_0xfcf2('0x46')]['id']}})['then'](handleEntityNotFound(_0x20fcab,null))[_0xfcf2('0x24')](saveUpdates(_0x37d4bb[_0xfcf2('0x49')],null))[_0xfcf2('0x24')](respondWithResult(_0x20fcab,null))[_0xfcf2('0x45')](handleError(_0x20fcab,null));};exports[_0xfcf2('0x4a')]=function(_0x4af270,_0x4c14d){return db[_0xfcf2('0x41')][_0xfcf2('0x47')]({'where':{'id':_0x4af270[_0xfcf2('0x46')]['id']}})[_0xfcf2('0x24')](handleEntityNotFound(_0x4c14d,null))[_0xfcf2('0x24')](removeEntity(_0x4c14d,null))['catch'](handleError(_0x4c14d,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6841bda..eb7a758 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 _0x008c=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','whatsapp_applications','utf8mb4_unicode_ci'];(function(_0x7fab52,_0x3d7625){var _0x6e5a0=function(_0x5ad961){while(--_0x5ad961){_0x7fab52['push'](_0x7fab52['shift']());}};_0x6e5a0(++_0x3d7625);}(_0x008c,0x188));var _0xc008=function(_0x3e2cf1,_0x2294a7){_0x3e2cf1=_0x3e2cf1-0x0;var _0x3796d0=_0x008c[_0x3e2cf1];return _0x3796d0;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('WhatsappApplication',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc008('0xd')});}; \ No newline at end of file +var _0x102b=['define','WhatsappApplication','whatsapp_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes'];(function(_0xe89c33,_0x462375){var _0x59cce4=function(_0x784ae0){while(--_0x784ae0){_0xe89c33['push'](_0xe89c33['shift']());}};_0x59cce4(++_0x462375);}(_0x102b,0x1be));var _0xb102=function(_0x2ea6e5,_0x5ba65c){_0x2ea6e5=_0x2ea6e5-0x0;var _0x54082e=_0x102b[_0x2ea6e5];return _0x54082e;};'use strict';var _=require('lodash');var util=require(_0xb102('0x0'));var logger=require('../../config/logger')(_0xb102('0x1'));var moment=require(_0xb102('0x2'));var BPromise=require(_0xb102('0x3'));var rp=require(_0xb102('0x4'));var fs=require('fs');var path=require(_0xb102('0x5'));var rimraf=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var attributes=require(_0xb102('0x8'));module['exports']=function(_0x3325b7,_0x370baa){return _0x3325b7[_0xb102('0x9')](_0xb102('0xa'),attributes,{'tableName':_0xb102('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb102('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 61d66d5..edf65b0 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 _0xda55=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x229b99,_0xb6a166){var _0x13e10c=function(_0x166e54){while(--_0x166e54){_0x229b99['push'](_0x229b99['shift']());}};_0x13e10c(++_0xb6a166);}(_0xda55,0x6d));var _0x5da5=function(_0x166dcd,_0x1ba118){_0x166dcd=_0x166dcd-0x0;var _0x1731d4=_0xda55[_0x166dcd];return _0x1731d4;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd877,_0x267469,_0x71b187){return new BPromise(function(_0x46290d,_0x3debdf){return client[_0x5da5('0x9')](_0x2fd877,_0x71b187)[_0x5da5('0xa')](function(_0x302795){logger['info'](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));logger[_0x5da5('0xd')](_0x5da5('0xe'),_0x267469,_0x5da5('0xc'),JSON[_0x5da5('0xf')](_0x302795));if(_0x302795[_0x5da5('0x10')]){if(_0x302795['error'][_0x5da5('0x11')]===0x1f4){logger[_0x5da5('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x267469,_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);return _0x3debdf(_0x302795[_0x5da5('0x10')][_0x5da5('0x12')]);}logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x302795['error']['message']);return _0x46290d(_0x302795['error'][_0x5da5('0x12')]);}else{logger[_0x5da5('0x13')](_0x5da5('0xb'),_0x267469,_0x5da5('0xc'));_0x46290d(_0x302795[_0x5da5('0x14')][_0x5da5('0x12')]);}})[_0x5da5('0x15')](function(_0x4a952a){logger[_0x5da5('0x10')](_0x5da5('0xb'),_0x267469,_0x4a952a);_0x3debdf(_0x4a952a);});});} \ No newline at end of file +var _0xe5b3=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x105c50,_0x29ba3e){var _0x570327=function(_0x3fa438){while(--_0x3fa438){_0x105c50['push'](_0x105c50['shift']());}};_0x570327(++_0x29ba3e);}(_0xe5b3,0x133));var _0x3e5b=function(_0x1215f5,_0x4261ef){_0x1215f5=_0x1215f5-0x0;var _0x254a1b=_0xe5b3[_0x1215f5];return _0x254a1b;};'use strict';var _=require('lodash');var util=require(_0x3e5b('0x0'));var moment=require(_0x3e5b('0x1'));var BPromise=require(_0x3e5b('0x2'));var rs=require(_0x3e5b('0x3'));var fs=require('fs');var Redis=require(_0x3e5b('0x4'));var db=require(_0x3e5b('0x5'))['db'];var utils=require(_0x3e5b('0x6'));var logger=require(_0x3e5b('0x7'))(_0x3e5b('0x8'));var config=require(_0x3e5b('0x9'));var jayson=require(_0x3e5b('0xa'));var client=jayson['client'][_0x3e5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5dcf55,_0x534e7d,_0x41d46f){return new BPromise(function(_0x3901c2,_0x3c7c2e){return client[_0x3e5b('0xc')](_0x5dcf55,_0x41d46f)['then'](function(_0x4ed6bc){logger[_0x3e5b('0xd')](_0x3e5b('0xe'),_0x534e7d,_0x3e5b('0xf'));logger[_0x3e5b('0x10')](_0x3e5b('0x11'),_0x534e7d,'request\x20sent',JSON[_0x3e5b('0x12')](_0x4ed6bc));if(_0x4ed6bc['error']){if(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x14')]===0x1f4){logger[_0x3e5b('0x13')](_0x3e5b('0xe'),_0x534e7d,_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);return _0x3c7c2e(_0x4ed6bc[_0x3e5b('0x13')]['message']);}logger[_0x3e5b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x4ed6bc['error']['message']);return _0x3901c2(_0x4ed6bc[_0x3e5b('0x13')][_0x3e5b('0x15')]);}else{logger[_0x3e5b('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x534e7d,_0x3e5b('0xf'));_0x3901c2(_0x4ed6bc['result']['message']);}})[_0x3e5b('0x16')](function(_0x11b41b){logger['error'](_0x3e5b('0xe'),_0x534e7d,_0x11b41b);_0x3c7c2e(_0x11b41b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index be52000..47a1714 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 _0xba34=['removeTags','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','destroy','delete'];(function(_0x2039d2,_0x1fd748){var _0x4214b4=function(_0x2e7199){while(--_0x2e7199){_0x2039d2['push'](_0x2039d2['shift']());}};_0x4214b4(++_0x1fd748);}(_0xba34,0x119));var _0x4ba3=function(_0x2db4e8,_0x223a80){_0x2db4e8=_0x2db4e8-0x0;var _0x14df15=_0xba34[_0x2db4e8];return _0x14df15;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0x8')](_0x4ba3('0xe'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x8')]('/:id/download',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x10')]);router['post']('/',auth[_0x4ba3('0x9')](),controller['create']);router[_0x4ba3('0x11')]('/:id/messages',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x12')]);router[_0x4ba3('0x11')](_0x4ba3('0x13'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),_0x4ba3('0x16')),controller[_0x4ba3('0x17')]);router[_0x4ba3('0x18')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),_0x4ba3('0x19')),controller[_0x4ba3('0x1a')]);router['delete'](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),interaction[_0x4ba3('0x14')](_0x4ba3('0x15'),'whatsappinteraction:destroy'),controller[_0x4ba3('0x1b')]);router[_0x4ba3('0x1c')](_0x4ba3('0x13'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0x1d')]);module[_0x4ba3('0x1e')]=router; \ No newline at end of file +var _0xb934=['addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','/:id/messages','/:id/download','download','post','create'];(function(_0x9c164b,_0x3c485c){var _0x2d2561=function(_0x3c2452){while(--_0x3c2452){_0x9c164b['push'](_0x9c164b['shift']());}};_0x2d2561(++_0x3c485c);}(_0xb934,0x92));var _0x4b93=function(_0xe6b1eb,_0x37df9c){_0xe6b1eb=_0xe6b1eb-0x0;var _0x220793=_0xb934[_0xe6b1eb];return _0x220793;};'use strict';var multer=require(_0x4b93('0x0'));var util=require(_0x4b93('0x1'));var path=require(_0x4b93('0x2'));var timeout=require('connect-timeout');var express=require(_0x4b93('0x3'));var router=express[_0x4b93('0x4')]();var fs_extra=require(_0x4b93('0x5'));var auth=require(_0x4b93('0x6'));var interaction=require(_0x4b93('0x7'));var config=require('../../config/environment');var controller=require('./whatsappInteraction.controller');router[_0x4b93('0x8')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0xa')]);router[_0x4b93('0x8')]('/describe',auth[_0x4b93('0x9')](),controller[_0x4b93('0xb')]);router[_0x4b93('0x8')](_0x4b93('0xc'),auth[_0x4b93('0x9')](),controller[_0x4b93('0xd')]);router[_0x4b93('0x8')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller['getMessages']);router[_0x4b93('0x8')](_0x4b93('0xf'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x10')]);router[_0x4b93('0x11')]('/',auth[_0x4b93('0x9')](),controller[_0x4b93('0x12')]);router[_0x4b93('0x11')](_0x4b93('0xe'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x13')]);router[_0x4b93('0x11')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')]('whatsapp',_0x4b93('0x16')),controller[_0x4b93('0x17')]);router[_0x4b93('0x18')]('/:id',auth[_0x4b93('0x9')](),interaction[_0x4b93('0x15')](_0x4b93('0x19'),_0x4b93('0x1a')),controller[_0x4b93('0x1b')]);router['delete'](_0x4b93('0xc'),auth[_0x4b93('0x9')](),interaction['tracked']('whatsapp',_0x4b93('0x1c')),controller[_0x4b93('0x1d')]);router[_0x4b93('0x1e')](_0x4b93('0x14'),auth[_0x4b93('0x9')](),controller[_0x4b93('0x1f')]);module[_0x4b93('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index da16fee..39874c6 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 _0x0686=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x8ae065,_0x3caa95){var _0x46140d=function(_0x2eb8bb){while(--_0x2eb8bb){_0x8ae065['push'](_0x8ae065['shift']());}};_0x46140d(++_0x3caa95);}(_0x0686,0x123));var _0x6068=function(_0x11b9b3,_0x40187a){_0x11b9b3=_0x11b9b3-0x0;var _0xed1215=_0x0686[_0x11b9b3];return _0xed1215;};'use strict';var Sequelize=require(_0x6068('0x0'));var moment=require(_0x6068('0x1'));module[_0x6068('0x2')]={'closed':{'type':Sequelize[_0x6068('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6068('0x4')]},'disposition':{'type':Sequelize[_0x6068('0x5')]},'secondDisposition':{'type':Sequelize[_0x6068('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6068('0x5')]},'phone':{'type':Sequelize[_0x6068('0x5')]},'read1stAt':{'type':Sequelize[_0x6068('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6068('0x6')]('in',_0x6068('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6068('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6068('0x6')]('in',_0x6068('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6068('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x39b3=['DATE','ENUM','out','sequelize','BOOLEAN','STRING'];(function(_0x4a4fef,_0x2592b1){var _0x17b4e0=function(_0x3decd3){while(--_0x3decd3){_0x4a4fef['push'](_0x4a4fef['shift']());}};_0x17b4e0(++_0x2592b1);}(_0x39b3,0xc9));var _0x339b=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x39b3[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x339b('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x339b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x339b('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x339b('0x2')]},'note':{'type':Sequelize[_0x339b('0x2')]},'phone':{'type':Sequelize[_0x339b('0x2')]},'read1stAt':{'type':Sequelize[_0x339b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x339b('0x4')]('in',_0x339b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x339b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x339b('0x4')]('in',_0x339b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x339b('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 794a8e9..e5a6934 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 _0x1867=['UserId','answered','unmanaged','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','field','color','from','select','u.id','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','whatsapp_accounts','whatsapp_messages','it.WhatsappInteractionId\x20=\x20i.id','expr','search','conditions','unreadMessages','value','having','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','body','some','compact','forEach','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','all','rows','show','params','include','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','merge','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','Tag','emit','removeTags','download','unix','join','server','files','tmp','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','read','WhatsappAccount','Account','mkdirSync','Whatsapp','Owner','N.A.','closedAt','disposition','basename','existsSync','createReadStream','createWriteStream','direction','out','System','renderFile','root','views','transcript-','.pdf','unlinkSync','sendStatus','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','register','status','end','json','undefined','limit','apply','save','update','destroy','then','error','stack','name','send','map','fullname','TagIds','split','Tags','push','catch','waiting','talking','total','closed'];(function(_0x58d2f9,_0xd166ee){var _0x429cfb=function(_0x25ab7a){while(--_0x25ab7a){_0x58d2f9['push'](_0x58d2f9['shift']());}};_0x429cfb(++_0xd166ee);}(_0x1867,0xb5));var _0x7186=function(_0x434e87,_0x1c5cba){_0x434e87=_0x434e87-0x0;var _0x45db12=_0x1867[_0x434e87];return _0x45db12;};'use strict';var emlformat=require(_0x7186('0x0'));var rimraf=require(_0x7186('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7186('0x2'));var rp=require('request-promise');var moment=require(_0x7186('0x3'));var BPromise=require(_0x7186('0x4'));var Mustache=require(_0x7186('0x5'));var util=require(_0x7186('0x6'));var path=require(_0x7186('0x7'));var sox=require(_0x7186('0x8'));var csv=require(_0x7186('0x9'));var ejs=require(_0x7186('0xa'));var fs=require('fs');var fs_extra=require(_0x7186('0xb'));var _=require('lodash');var squel=require(_0x7186('0xc'));var crypto=require(_0x7186('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7186('0xe'));var toCsv=require(_0x7186('0x9'));var querystring=require(_0x7186('0xf'));var Papa=require(_0x7186('0x10'));var Redis=require('ioredis');var authService=require(_0x7186('0x11'));var qs=require(_0x7186('0x12'));var as=require(_0x7186('0x13'));var pdf=require(_0x7186('0x14'));var hardwareService=require(_0x7186('0x15'));var logger=require('../../config/logger')(_0x7186('0x16'));var utils=require(_0x7186('0x17'));var config=require(_0x7186('0x18'));var licenseUtil=require(_0x7186('0x19'));var db=require('../../mysqldb')['db'];config[_0x7186('0x1a')]=_[_0x7186('0x1b')](config[_0x7186('0x1a')],{'host':_0x7186('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x7186('0x1d')](socket);function respondWithStatusCode(_0x1aa34c,_0x1e78f9){_0x1e78f9=_0x1e78f9||0xcc;return function(_0x1d392a){if(_0x1d392a){return _0x1aa34c['sendStatus'](_0x1e78f9);}return _0x1aa34c[_0x7186('0x1e')](_0x1e78f9)[_0x7186('0x1f')]();};}function respondWithResult(_0x915126,_0x396e13){_0x396e13=_0x396e13||0xc8;return function(_0x6508f5){if(_0x6508f5){return _0x915126[_0x7186('0x1e')](_0x396e13)[_0x7186('0x20')](_0x6508f5);}};}function respondWithFilteredResult(_0x2afef8,_0x56796f){return function(_0x24a877){if(_0x24a877){var _0xe1d780=typeof _0x56796f['offset']===_0x7186('0x21')&&typeof _0x56796f[_0x7186('0x22')]===_0x7186('0x21');var _0x4bdfad=_0x24a877['count'];var _0x298915=_0xe1d780?0x0:_0x56796f['offset'];var _0x3fc1f0=_0xe1d780?_0x24a877['count']:_0x56796f['offset']+_0x56796f['limit'];var _0x3f932b;if(_0x3fc1f0>=_0x4bdfad){_0x3fc1f0=_0x4bdfad;_0x3f932b=0xc8;}else{_0x3f932b=0xce;}_0x2afef8[_0x7186('0x1e')](_0x3f932b);return _0x2afef8['set']('Content-Range',_0x298915+'-'+_0x3fc1f0+'/'+_0x4bdfad)['json'](_0x24a877);}return null;};}function patchUpdates(_0x562403){return function(_0x2a8876){try{jsonpatch[_0x7186('0x23')](_0x2a8876,_0x562403,!![]);}catch(_0x116c93){return BPromise['reject'](_0x116c93);}return _0x2a8876[_0x7186('0x24')]();};}function saveUpdates(_0x182338,_0xb5bb54){return function(_0xa6be2b){if(_0xa6be2b){return _0xa6be2b[_0x7186('0x25')](_0x182338)['then'](function(_0x35e872){return _0x35e872;});}return null;};}function removeEntity(_0x207b9e,_0x4782ca){return function(_0x142bde){if(_0x142bde){return _0x142bde[_0x7186('0x26')]()[_0x7186('0x27')](function(){_0x207b9e[_0x7186('0x1e')](0xcc)[_0x7186('0x1f')]();});}};}function handleEntityNotFound(_0x53c3fe,_0x29d231){return function(_0x463f1e){if(!_0x463f1e){_0x53c3fe['sendStatus'](0x194);}return _0x463f1e;};}function handleError(_0x40356a,_0x4e61c6){_0x4e61c6=_0x4e61c6||0x1f4;return function(_0x19b109){logger[_0x7186('0x28')](_0x19b109[_0x7186('0x29')]);if(_0x19b109[_0x7186('0x2a')]){delete _0x19b109[_0x7186('0x2a')];}_0x40356a['status'](_0x4e61c6)[_0x7186('0x2b')](_0x19b109);};}function getInteractionUsers(_0x2b6003,_0x15dc7){return new BPromise(function(_0xd709e,_0x102121){try{if(_0x15dc7[_0x2b6003['id']]){_0x2b6003['Users']=_[_0x7186('0x2c')](_0x15dc7[_0x2b6003['id']],function(_0x397594){return{'id':_0x397594['id'],'fullname':_0x397594[_0x7186('0x2d')]};});}}catch(_0x4f0b44){_0x102121(_0x4f0b44);}_0xd709e(_0x2b6003);});}function getInteractionTags(_0xfb345,_0x36c1cd){return new BPromise(function(_0x1b099c,_0x15e146){try{if(_0xfb345[_0x7186('0x2e')]){_0xfb345['Tags']=[];_0xfb345['TagIds'][_0x7186('0x2f')](',')['forEach'](function(_0x2f722c){_0xfb345[_0x7186('0x30')][_0x7186('0x31')](_0x36c1cd[_0x2f722c]);});}delete _0xfb345['TagIds'];}catch(_0x1ca66f){_0x15e146(_0x1ca66f);}_0x1b099c(_0xfb345);});}function updateWhatsappInteraction(_0x2dfa69,_0x1de2e1,_0x24d64c){return new BPromise(function(_0x572083,_0x4ff69b){return getInteractionUsers(_0x2dfa69,_0x24d64c)['then'](function(_0x1a53fc){return getInteractionTags(_0x1a53fc,_0x1de2e1);})['then'](function(_0x5b8c4a){return getStateInteraction(_0x5b8c4a);})['then'](function(_0xe4807d){_0x572083(_0xe4807d);})[_0x7186('0x32')](function(_0x270832){_0x4ff69b(_0x270832);});});}function getStateInteraction(_0x2df1b9){return new BPromise(function(_0x1a1e41){_0x2df1b9[_0x7186('0x33')]=0x0;_0x2df1b9[_0x7186('0x34')]=0x0;_0x2df1b9['answered']=0x0;_0x2df1b9['unmanaged']=0x0;_0x2df1b9[_0x7186('0x35')]=0x0;if(!_0x2df1b9[_0x7186('0x36')]&&!_0x2df1b9['UserId']){_0x2df1b9[_0x7186('0x33')]+=0x1;}if(!_0x2df1b9[_0x7186('0x36')]&&_0x2df1b9[_0x7186('0x37')]){_0x2df1b9[_0x7186('0x34')]+=0x1;if(_0x2df1b9['waiting']){_0x2df1b9[_0x7186('0x33')]-=0x1;}}if(_0x2df1b9['closed']&&_0x2df1b9['UserId']){_0x2df1b9[_0x7186('0x38')]+=0x1;if(_0x2df1b9[_0x7186('0x34')]){_0x2df1b9[_0x7186('0x34')]-=0x1;}}if(_0x2df1b9[_0x7186('0x36')]&&!_0x2df1b9['UserId']){_0x2df1b9[_0x7186('0x39')]+=0x1;if(_0x2df1b9[_0x7186('0x33')]){_0x2df1b9[_0x7186('0x33')]-=0x1;}}_0x2df1b9['total']+=0x1;_0x1a1e41(_0x2df1b9);});}exports[_0x7186('0x3a')]=function(_0x311a77,_0x4aef80){var _0x3a48d8={},_0x2131db={},_0x4f4d40={'count':0x0,'rows':[]};var _0x375dec=_[_0x7186('0x2c')](db[_0x7186('0x3b')][_0x7186('0x3c')],function(_0x3c63c1){return{'name':_0x3c63c1[_0x7186('0x3d')],'type':_0x3c63c1[_0x7186('0x3e')][_0x7186('0x3f')]};});_0x2131db[_0x7186('0x40')]=_[_0x7186('0x2c')](_0x375dec,'name');_0x2131db[_0x7186('0x41')]=_[_0x7186('0x42')](_0x311a77['query']);_0x2131db[_0x7186('0x43')]=_[_0x7186('0x44')](_0x2131db['model'],_0x2131db[_0x7186('0x41')]);_0x3a48d8[_0x7186('0x45')]=_[_0x7186('0x44')](_0x2131db[_0x7186('0x40')],qs['fields'](_0x311a77[_0x7186('0x41')][_0x7186('0x46')]));_0x3a48d8[_0x7186('0x45')]=_0x3a48d8[_0x7186('0x45')][_0x7186('0x47')]?_0x3a48d8[_0x7186('0x45')]:_0x2131db[_0x7186('0x40')];if(!_0x311a77[_0x7186('0x41')][_0x7186('0x48')](_0x7186('0x49'))){_0x3a48d8[_0x7186('0x22')]=qs[_0x7186('0x22')](_0x311a77[_0x7186('0x41')][_0x7186('0x22')]);_0x3a48d8['offset']=qs['offset'](_0x311a77[_0x7186('0x41')][_0x7186('0x4a')]);}_0x3a48d8['order']=qs[_0x7186('0x4b')](_0x311a77['query'][_0x7186('0x4b')]);_0x3a48d8[_0x7186('0x4c')]=qs['filters'](_[_0x7186('0x4d')](_0x311a77['query'],_0x2131db['filters']),_0x375dec);var _0xcfc20c=[];var _0x214686=squel['select']()[_0x7186('0x4e')]('id')[_0x7186('0x4e')](_0x7186('0x2a'))[_0x7186('0x4e')](_0x7186('0x4f'))[_0x7186('0x50')]('tools_tags');var _0x6a6ef2=squel[_0x7186('0x51')]()[_0x7186('0x4e')](_0x7186('0x52'))[_0x7186('0x4e')]('u.fullname')[_0x7186('0x4e')](_0x7186('0x53'))['from'](_0x7186('0x54'),'ui')['left_join'](_0x7186('0x55'),'u',_0x7186('0x56'));var _0x41241f=squel[_0x7186('0x51')]()[_0x7186('0x50')]('whatsapp_interactions','i')[_0x7186('0x57')](_0x7186('0x58'),'c',_0x7186('0x59'))[_0x7186('0x57')]('users','o','o.id\x20=\x20i.UserId')[_0x7186('0x57')](_0x7186('0x5a'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x7186('0x57')](_0x7186('0x5b'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join']('whatsapp_interaction_has_tags','it',_0x7186('0x5c'))[_0x7186('0x57')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x45292d=squel[_0x7186('0x5d')]();var _0x5e039d=[];var _0x5534fa=squel[_0x7186('0x5d')]();var _0x5e96b7;if(_0x311a77['query'][_0x7186('0x5e')]){_0x5e96b7=as['parseSearch'](_0x311a77[_0x7186('0x41')]['search']);var _0x36b81b=_0x5e96b7['sqlOperator'];for(var _0x5ae4ba=0x0;_0x5ae4ba<_0x5e96b7[_0x7186('0x5f')]['length'];_0x5ae4ba++){var _0x5958cf=_0x5e96b7['conditions'][_0x5ae4ba];var _0x2304f1='i';var _0x2bc026=_['find'](_0x375dec,[_0x7186('0x2a'),_0x5958cf[_0x7186('0x4e')]]);if(!_0x2bc026){switch(_0x5958cf[_0x7186('0x4e')]){case _0x7186('0x60'):if(_0x5958cf[_0x7186('0x61')]==0x1){_0x41241f['having']('`'+_0x5958cf[_0x7186('0x4e')]+'`\x20=\x200');}else{_0x41241f[_0x7186('0x62')]('`'+_0x5958cf[_0x7186('0x4e')]+'`\x20>\x200');}break;case _0x7186('0x63'):if(_0x5958cf[_0x7186('0x64')]===_0x7186('0x65')){if(_0x5958cf['value']['split']('\x20')[_0x7186('0x47')]>0x1){_0x45292d[_0x36b81b](_0x7186('0x66'),qs[_0x7186('0x67')](_0x5958cf[_0x7186('0x61')]),null);}else{var _0x4fc258='%'+_0x5958cf[_0x7186('0x61')]+'%';_0x45292d[_0x36b81b](_0x7186('0x68'),_0x4fc258,_0x4fc258,_0x4fc258);}}else{_0x2bc026=_['find'](_0x375dec,[_0x7186('0x2a'),'ContactId']);_0x5958cf[_0x7186('0x4e')]=_0x7186('0x69');_0x4e9431=as[_0x7186('0x6a')](_0x2304f1,_0x2bc026['type'],_0x5958cf);_0x45292d[_0x36b81b](_0x4e9431[_0x7186('0x6b')],_0x4e9431[_0x7186('0x61')][_0x7186('0x6c')],_0x4e9431[_0x7186('0x61')]['end']);}break;case'Tag':var _0x31d7f4=_0x5958cf[_0x7186('0x61')][_0x7186('0x2f')](',')[_0x7186('0x2c')](function(_0x3f75aa){return Number(_0x3f75aa);});_0x31d7f4['forEach'](function(_0xbcb088){_0x5534fa['or'](_0x7186('0x6d'),'%,'+_0xbcb088+',%');});_0x5e039d=_[_0x7186('0x6e')](_0x5e039d,_0x31d7f4);break;case _0x7186('0x6f'):if(_0x5958cf[_0x7186('0x64')]===_0x7186('0x65')){_0x45292d[_0x36b81b](_0x7186('0x70'),'%'+_0x5958cf[_0x7186('0x61')]+'%',null);}else{_0x2bc026=_[_0x7186('0x71')](_0x375dec,['name',_0x7186('0x37')]);_0x5958cf[_0x7186('0x4e')]=_0x7186('0x37');_0x4e9431=as[_0x7186('0x6a')](_0x2304f1,_0x2bc026[_0x7186('0x3e')],_0x5958cf);_0x45292d[_0x36b81b](_0x4e9431['text'],_0x4e9431[_0x7186('0x61')][_0x7186('0x6c')],_0x4e9431[_0x7186('0x61')][_0x7186('0x1f')]);}break;case _0x7186('0x72'):_0x4e9431=as[_0x7186('0x6a')]('me',null,_0x5958cf);_0x45292d[_0x36b81b](_0x4e9431['text'],_0x4e9431['value'][_0x7186('0x6c')],_0x4e9431[_0x7186('0x61')][_0x7186('0x1f')]);break;}}else{var _0x4e9431=as[_0x7186('0x6a')](_0x2304f1,_0x2bc026[_0x7186('0x3e')],_0x5958cf);_0x45292d[_0x36b81b](_0x4e9431['text'],_0x4e9431['value'][_0x7186('0x6c')],_0x4e9431['value']['end']);}}}else{var _0x46be36=_(_0x311a77['query'])[_0x7186('0x42')]()[_0x7186('0x2c')](function(_0x20c8ff){return _[_0x7186('0x73')](_0x375dec,[_0x7186('0x2a'),_0x20c8ff])?_0x20c8ff:undefined;})[_0x7186('0x74')]()[_0x7186('0x61')]();if(!_['isEmpty'](_0x46be36)){_0x46be36[_0x7186('0x75')](function(_0x3fe0dd){if(_0x3fe0dd==='WhatsappAccountId'){_0x41241f[_0x7186('0x4c')](_0x7186('0x76'),[][_0x7186('0x77')](_0x311a77[_0x7186('0x41')][_0x3fe0dd]));}else if(_0x3fe0dd===_0x7186('0x78')){var _0x16a923=JSON[_0x7186('0x79')](_0x311a77['query'][_0x3fe0dd])[_0x7186('0x7a')];var _0x2e5201=JSON[_0x7186('0x79')](_0x311a77['query'][_0x3fe0dd])[_0x7186('0x7b')];_0x41241f['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16a923,_0x2e5201);}else{if(_0x311a77['query'][_0x3fe0dd]==='null'){_0x41241f[_0x7186('0x4c')]('i.'+_0x3fe0dd+_0x7186('0x7c'));}else{_0x41241f[_0x7186('0x4c')]('i.'+_0x3fe0dd+'\x20=\x20?',_0x311a77[_0x7186('0x41')][_0x3fe0dd]);}}});}if(_0x311a77[_0x7186('0x41')]['read']){if(_0x311a77[_0x7186('0x41')]['read']==0x1){_0x41241f[_0x7186('0x62')](_0x7186('0x7d'));}else{_0x41241f[_0x7186('0x62')](_0x7186('0x7e'));}}if(_0x311a77[_0x7186('0x41')][_0x7186('0x7f')]){_0x5e039d=_[_0x7186('0x80')](_0x311a77['query'][_0x7186('0x7f')])?_0x311a77[_0x7186('0x41')][_0x7186('0x7f')]:new Array(_0x311a77[_0x7186('0x41')][_0x7186('0x7f')]);_0x5e039d[_0x7186('0x75')](function(_0x384038){_0x5534fa['or'](_0x7186('0x6d'),'%,'+_0x384038+',%');});}if(_0x311a77[_0x7186('0x41')][_0x7186('0x81')]){var _0x57cd15=_0x311a77[_0x7186('0x41')][_0x7186('0x81')][_0x7186('0x82')]('\x5c','\x5c\x5c')[_0x7186('0x82')](/'/g,'\x27\x27');if(qs[_0x7186('0x83')](_0x57cd15)){_0x45292d['or'](_0x7186('0x84'),_0x57cd15+'%')['or'](_0x7186('0x85'),_0x57cd15+'%');}else{_0x45292d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x57cd15))['or'](_0x7186('0x86'),_0x57cd15+'%');}}}_0x41241f[_0x7186('0x4c')](_0x45292d);_0x41241f[_0x7186('0x87')]('i.id');var _0x14d259={'type':db[_0x7186('0x88')][_0x7186('0x89')][_0x7186('0x8a')],'raw':!![]};var _0x5e2738=_0x41241f[_0x7186('0x8b')]();_0x5e2738['field'](_0x7186('0x8c'));_0x5e2738[_0x7186('0x4e')](_0x7186('0x8d'),_0x7186('0x60'));if(_0x3a48d8[_0x7186('0x8e')]){_0x3a48d8['order'][_0x7186('0x75')](function(_0x1da8d1){var _0x48338d=_0x1da8d1[0x0]===_0x7186('0x8f')?_0x1da8d1[0x0]:'i.'+_0x1da8d1[0x0];_0x41241f[_0x7186('0x8e')](_0x48338d,_0x1da8d1[0x1]===_0x7186('0x90')?![]:!![]);});}if(!_[_0x7186('0x91')](_0x5e039d)){_0x41241f[_0x7186('0x62')](_0x5534fa);_0x5e2738[_0x7186('0x4c')](_0x7186('0x92'),_0x5e039d);}BPromise[_0x7186('0x93')]()[_0x7186('0x27')](function(){if(!_0x5e96b7){if(_0x311a77[_0x7186('0x41')][_0x7186('0x94')])return;_0x5e2738[_0x7186('0x4c')](_0x7186('0x95'));_0x41241f[_0x7186('0x4c')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x311a77[_0x7186('0x96')][_0x7186('0x97')]!==_0x7186('0x98'))return;return _0x311a77[_0x7186('0x96')][_0x7186('0x99')]({'attributes':['id'],'raw':!![]})[_0x7186('0x27')](function(_0x37550e){if(_[_0x7186('0x91')](_0x37550e)){_0x5e2738[_0x7186('0x4c')](_0x7186('0x9a'));_0x41241f[_0x7186('0x4c')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x5e2738[_0x7186('0x4c')]('i.WhatsappAccountId\x20IN\x20?',_[_0x7186('0x2c')](_0x37550e,'id'));_0x41241f['where'](_0x7186('0x76'),_[_0x7186('0x2c')](_0x37550e,'id'));}});})[_0x7186('0x27')](function(){if(_0x311a77[_0x7186('0x96')][_0x7186('0x97')]===_0x7186('0x98')&&!_0x5e96b7&&!_0x311a77[_0x7186('0x41')][_0x7186('0x94')])return[];return db[_0x7186('0x9b')][_0x7186('0x41')](_0x5e2738[_0x7186('0x9c')](),_0x14d259);})['then'](function(_0x224a6e){_0x4f4d40[_0x7186('0x9d')]=_0x224a6e[_0x7186('0x47')];if(_0x4f4d40['count']===0x0)return[];return db[_0x7186('0x9b')]['query'](_0x214686['toString'](),_0x14d259)[_0x7186('0x27')](function(_0x13d9b){_0xcfc20c=_[_0x7186('0x9e')](_0x13d9b,'id');_0x14d259=_['merge'](_0x14d259,{'model':db[_0x7186('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x311a77[_0x7186('0x41')][_0x7186('0x46')]){_0x3a48d8[_0x7186('0x45')][_0x7186('0x75')](function(_0x51bf74){_0x41241f[_0x7186('0x4e')]('i.'+_0x51bf74);});}else{_0x41241f[_0x7186('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7186('0x60'));_0x41241f[_0x7186('0x4e')](_0x7186('0x9f'),'Account.key');_0x41241f[_0x7186('0x4e')]('a.mandatoryDisposition',_0x7186('0xa0'));_0x41241f[_0x7186('0x4e')](_0x7186('0xa1'),_0x7186('0x8f'));_0x41241f[_0x7186('0x4e')](_0x7186('0xa2'));_0x41241f[_0x7186('0x4e')](_0x7186('0xa3'),_0x7186('0xa4'));_0x41241f[_0x7186('0x4e')](_0x7186('0xa5'),'Contact.lastName');_0x41241f['field']('c.email','Contact.email');_0x41241f['field'](_0x7186('0xa6'),_0x7186('0xa7'));_0x41241f[_0x7186('0x4e')](_0x7186('0xa8'),_0x7186('0xa9'));_0x41241f[_0x7186('0x4e')](_0x7186('0xaa'),'Contact.fax');_0x41241f[_0x7186('0x4e')](_0x7186('0xab'),_0x7186('0xac'));_0x41241f[_0x7186('0x4e')](_0x7186('0xad'),_0x7186('0xae'));_0x41241f[_0x7186('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7186('0x2e'));}if(_0x3a48d8[_0x7186('0x22')])_0x41241f[_0x7186('0x22')](_0x3a48d8[_0x7186('0x22')]);if(_0x3a48d8[_0x7186('0x4a')])_0x41241f[_0x7186('0x4a')](_0x3a48d8['offset']);return db[_0x7186('0x9b')][_0x7186('0x41')](_0x41241f['toString'](),_0x14d259);})[_0x7186('0x27')](function(_0x59328a){if(_0x59328a[_0x7186('0x47')]>0x0)_0x6a6ef2[_0x7186('0x4c')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x7186('0x2c')](_0x59328a,'id'));return db[_0x7186('0x9b')][_0x7186('0x41')](_0x6a6ef2[_0x7186('0x9c')](),_0x14d259)[_0x7186('0x27')](function(_0x1b8747){var _0x4cf640=_['groupBy'](_0x1b8747,'WhatsappInteractionId');var _0x36e93e=[];_0x59328a[_0x7186('0x75')](function(_0x23f894){_0x36e93e[_0x7186('0x31')](updateWhatsappInteraction(_0x23f894,_0xcfc20c,_0x4cf640));});return BPromise[_0x7186('0xaf')](_0x36e93e);});});})[_0x7186('0x27')](function(_0x4e69a2){_0x4f4d40[_0x7186('0xb0')]=_0x4e69a2;return _0x4f4d40;})['then'](respondWithFilteredResult(_0x4aef80,_0x3a48d8))[_0x7186('0x32')](handleError(_0x4aef80,null));};exports[_0x7186('0xb1')]=function(_0x7f20b9,_0x1aee28){var _0x341c92={'raw':![],'where':{'id':_0x7f20b9[_0x7186('0xb2')]['id']}},_0x44f0c0={};_0x44f0c0[_0x7186('0x40')]=_['keys'](db['WhatsappInteraction'][_0x7186('0x3c')]);_0x44f0c0[_0x7186('0x41')]=_[_0x7186('0x42')](_0x7f20b9[_0x7186('0x41')]);_0x44f0c0['filters']=_[_0x7186('0x44')](_0x44f0c0[_0x7186('0x40')],_0x44f0c0['query']);_0x341c92[_0x7186('0x45')]=_[_0x7186('0x44')](_0x44f0c0[_0x7186('0x40')],qs[_0x7186('0x46')](_0x7f20b9[_0x7186('0x41')][_0x7186('0x46')]));_0x341c92[_0x7186('0x45')]=_0x341c92[_0x7186('0x45')][_0x7186('0x47')]?_0x341c92[_0x7186('0x45')]:_0x44f0c0[_0x7186('0x40')];if(_0x7f20b9['query']['includeAll']){_0x341c92[_0x7186('0xb3')]=[{'all':!![]}];}_0x341c92=_['merge']({},_0x341c92,_0x7f20b9[_0x7186('0xb4')]);return db[_0x7186('0x3b')]['find'](_0x341c92)['then'](handleEntityNotFound(_0x1aee28,null))['then'](respondWithResult(_0x1aee28,null))['catch'](handleError(_0x1aee28,null));};exports[_0x7186('0xb5')]=function(_0x3b4806,_0x1611af){return db['WhatsappInteraction'][_0x7186('0xb5')](_0x3b4806[_0x7186('0x72')],{})[_0x7186('0x27')](respondWithResult(_0x1611af,0xc9))[_0x7186('0x32')](handleError(_0x1611af,null));};exports[_0x7186('0x25')]=function(_0x455399,_0x2bba2a){if(_0x455399['body']['id']){delete _0x455399['body']['id'];}return db[_0x7186('0x3b')][_0x7186('0x71')]({'where':{'id':_0x455399[_0x7186('0xb2')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x2bba2a,null))['then'](saveUpdates(_0x455399[_0x7186('0x72')],null))['then'](respondWithResult(_0x2bba2a,null))['catch'](handleError(_0x2bba2a,null));};exports[_0x7186('0x26')]=function(_0x17b27e,_0x12d183){return db['WhatsappInteraction'][_0x7186('0x71')]({'where':{'id':_0x17b27e[_0x7186('0xb2')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x12d183,null))[_0x7186('0x27')](removeEntity(_0x12d183,null))[_0x7186('0x32')](handleError(_0x12d183,null));};exports[_0x7186('0xb6')]=function(_0x995f7f,_0x3a039f){return db[_0x7186('0x3b')][_0x7186('0xb6')]()[_0x7186('0x27')](respondWithResult(_0x3a039f,null))[_0x7186('0x32')](handleError(_0x3a039f,null));};exports[_0x7186('0xb7')]=function(_0xa49592,_0x345e62,_0x5d5c11){return db[_0x7186('0xb8')][_0x7186('0x71')]({'where':{'id':_0xa49592['params']['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x345e62,null))[_0x7186('0x27')](function(_0x630512){if(_0x630512){return _0x630512['addMessage'](_0xa49592[_0x7186('0x72')][_0x7186('0xb9')],_[_0x7186('0xba')](_0xa49592[_0x7186('0x72')],[_0x7186('0xb9'),'id'])||{});}})[_0x7186('0x27')](respondWithResult(_0x345e62,null))[_0x7186('0x32')](handleError(_0x345e62,null));};exports[_0x7186('0xbb')]=function(_0x2dd722,_0xb2bf16,_0x20c253){var _0x2fe77c={'raw':![],'where':{}};var _0x2a2d5b={};var _0x1f1e26={'count':0x0,'rows':[]};return db[_0x7186('0x3b')][_0x7186('0xbc')]({'where':{'id':_0x2dd722[_0x7186('0xb2')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0xb2bf16,null))[_0x7186('0x27')](function(_0x52905d){if(_0x52905d){_0x2a2d5b['model']=_[_0x7186('0x42')](db[_0x7186('0xb8')]['rawAttributes']);_0x2a2d5b[_0x7186('0x41')]=_[_0x7186('0x42')](_0x2dd722[_0x7186('0x41')]);_0x2a2d5b[_0x7186('0x43')]=_[_0x7186('0x44')](_0x2a2d5b[_0x7186('0x40')],_0x2a2d5b[_0x7186('0x41')]);_0x2fe77c[_0x7186('0x45')]=_[_0x7186('0x44')](_0x2a2d5b['model'],qs[_0x7186('0x46')](_0x2dd722[_0x7186('0x41')][_0x7186('0x46')]));_0x2fe77c[_0x7186('0x45')]=_0x2fe77c[_0x7186('0x45')][_0x7186('0x47')]?_0x2fe77c[_0x7186('0x45')]:_0x2a2d5b[_0x7186('0x40')];if(!_0x2dd722[_0x7186('0x41')][_0x7186('0x48')](_0x7186('0x49'))){_0x2fe77c['limit']=qs[_0x7186('0x22')](_0x2dd722[_0x7186('0x41')][_0x7186('0x22')]);_0x2fe77c['offset']=qs[_0x7186('0x4a')](_0x2dd722['query'][_0x7186('0x4a')]);}_0x2fe77c[_0x7186('0x8e')]=qs[_0x7186('0x4b')](_0x2dd722['query'][_0x7186('0x4b')]);_0x2fe77c['where']=qs[_0x7186('0x43')](_[_0x7186('0x4d')](_0x2dd722[_0x7186('0x41')],_0x2a2d5b[_0x7186('0x43')]));_0x2fe77c['where']['WhatsappInteractionId']=_0x52905d['id'];if(_0x2dd722[_0x7186('0x41')][_0x7186('0x81')]){_0x2fe77c[_0x7186('0x4c')]=_[_0x7186('0xbd')](_0x2fe77c[_0x7186('0x4c')],{'$or':_[_0x7186('0x2c')](_0x2fe77c[_0x7186('0x45')],function(_0x4a69f5){var _0x2261c0={};_0x2261c0[_0x4a69f5]={'$like':'%'+_0x2dd722[_0x7186('0x41')][_0x7186('0x81')]+'%'};return _0x2261c0;})});}if(_0x2dd722[_0x7186('0x41')][_0x7186('0x7a')]){var _0x266682=_0x2dd722[_0x7186('0x41')][_0x7186('0x7a')][_0x7186('0x2f')](',');var _0x2bfb1d={};_0x2bfb1d[_0x266682[0x0]]={'$gte':moment(_0x266682[0x1])[_0x7186('0xbe')](_0x7186('0xbf'))};_0x2fe77c[_0x7186('0x4c')]=_[_0x7186('0xbd')](_0x2fe77c[_0x7186('0x4c')],_0x2bfb1d);}_0x2fe77c=_[_0x7186('0xbd')]({},_0x2fe77c,_0x2dd722['options']);return db[_0x7186('0xb8')][_0x7186('0x9d')]({'where':_0x2fe77c[_0x7186('0x4c')]})[_0x7186('0x27')](function(_0x4c96e7){_0x1f1e26[_0x7186('0x9d')]=_0x4c96e7;if(_0x2dd722[_0x7186('0x41')][_0x7186('0xc0')]){_0x2fe77c['include']=[{'all':!![]}];}return db[_0x7186('0xb8')][_0x7186('0xc1')](_0x2fe77c);})[_0x7186('0x27')](function(_0xd44d6e){_0x1f1e26['rows']=_0xd44d6e;return _0x1f1e26;});}})['then'](respondWithFilteredResult(_0xb2bf16,_0x2fe77c))[_0x7186('0x32')](handleError(_0xb2bf16,null));};exports[_0x7186('0xc2')]=function(_0x4f3d57,_0x720d5f,_0x525cb4){return db[_0x7186('0x3b')][_0x7186('0x71')]({'where':{'id':_0x4f3d57[_0x7186('0xb2')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x720d5f,null))[_0x7186('0x27')](function(_0x201168){if(_0x201168){return _0x201168[_0x7186('0xc3')](_0x4f3d57['body'][_0x7186('0xb9')],_[_0x7186('0xba')](_0x4f3d57[_0x7186('0x72')],['ids','id'])||{})['spread'](function(){return db[_0x7186('0xc4')]['findAll']({'attributes':['id',_0x7186('0x2a'),_0x7186('0x4f')],'where':{'id':_0x4f3d57[_0x7186('0x72')][_0x7186('0xb9')]}});})[_0x7186('0x27')](function(_0x19f4a8){socket[_0x7186('0xc5')]('whatsappInteractionTags:save',{'id':Number(_0x4f3d57[_0x7186('0xb2')]['id']),'tags':_0x19f4a8||[]});return{'id':Number(_0x4f3d57[_0x7186('0xb2')]['id']),'tags':_0x19f4a8||[]};});}})[_0x7186('0x27')](respondWithResult(_0x720d5f,null))[_0x7186('0x32')](handleError(_0x720d5f,null));};exports[_0x7186('0xc6')]=function(_0x10f462,_0x2355ce,_0x223e50){return db[_0x7186('0x3b')][_0x7186('0x71')]({'where':{'id':_0x10f462[_0x7186('0xb2')]['id']}})['then'](handleEntityNotFound(_0x2355ce,null))[_0x7186('0x27')](function(_0x34e69d){if(_0x34e69d){return _0x34e69d[_0x7186('0xc6')](_0x10f462[_0x7186('0x41')]['ids']);}})[_0x7186('0x27')](respondWithStatusCode(_0x2355ce,null))['catch'](handleError(_0x2355ce,null));};exports[_0x7186('0xc7')]=function(_0x427502,_0x96832c){var _0x279b7e=moment()[_0x7186('0xc8')]()[_0x7186('0x9c')]();var _0x3818a5=path[_0x7186('0xc9')](config['root'],_0x7186('0xca'),_0x7186('0xcb'),_0x7186('0xcc'));var _0x147e8f=path['join'](config['root'],_0x7186('0xca'),_0x7186('0xcb'),'attachments');var _0x3a0881=path[_0x7186('0xc9')](_0x3818a5,_0x279b7e);var _0x1dedfb=util[_0x7186('0xbe')](_0x7186('0xcd'),_0x427502[_0x7186('0xb2')]['id'],_0x279b7e);var _0x3c8358=path[_0x7186('0xc9')](_0x3818a5,_0x1dedfb);var _0x213691=[];_0x213691[_0x7186('0x31')]({'model':db['User'],'as':_0x7186('0x6f'),'attributes':['id',_0x7186('0x2d')],'raw':!![]});_0x213691[_0x7186('0x31')]({'model':db[_0x7186('0xce')],'as':_0x7186('0x63'),'attributes':['id',_0x7186('0xcf'),_0x7186('0xd0')],'raw':!![]});if(_0x427502[_0x7186('0x41')][_0x7186('0xd1')]){_0x213691['push']({'model':db[_0x7186('0xd2')],'as':'Attachment','raw':!![]});}var _0xe5fe03=[{'model':db[_0x7186('0xb8')],'as':_0x7186('0xd3'),'attributes':['id','body','createdAt','direction',_0x7186('0xd4'),_0x7186('0xd5')],'include':_0x213691}];_0xe5fe03[_0x7186('0x31')]({'model':db[_0x7186('0xd6')],'as':_0x7186('0xd7'),'attributes':['id','name']});_0xe5fe03[_0x7186('0x31')]({'model':db[_0x7186('0x6f')],'as':'Owner','attributes':['id',_0x7186('0x2d')]});return db[_0x7186('0x3b')][_0x7186('0x71')]({'where':{'id':_0x427502['params']['id']},'include':_0xe5fe03})['then'](handleEntityNotFound(_0x96832c,null))[_0x7186('0x27')](function(_0x370ba3){if(_0x370ba3){var _0x344aae=_0x370ba3['get']({'plain':!![]});fs[_0x7186('0xd8')](_0x3a0881);var _0x243deb={'channel':_0x7186('0xd9'),'account':_0x344aae[_0x7186('0xd7')][_0x7186('0x2a')],'agent':_0x344aae[_0x7186('0xda')]?_0x344aae[_0x7186('0xda')][_0x7186('0x2d')]:_0x7186('0xdb'),'createdAt':moment(_0x344aae[_0x7186('0x78')])[_0x7186('0xbe')](_0x7186('0xbf'))[_0x7186('0x9c')](),'closedAt':_0x344aae[_0x7186('0x36')]?moment(_0x344aae[_0x7186('0xdc')])[_0x7186('0xbe')](_0x7186('0xbf'))[_0x7186('0x9c')]():'','disposition':_0x344aae[_0x7186('0xdd')],'messages':_(_0x344aae[_0x7186('0xd3')])['filter']({'secret':![]})[_0x7186('0x2c')](function(_0x30e6c3){if(_0x30e6c3['Attachment']){var _0xb08281=path['join'](_0x147e8f,_0x30e6c3[_0x7186('0xd2')][_0x7186('0xde')]);if(fs[_0x7186('0xdf')](_0xb08281)){fs[_0x7186('0xe0')](_0xb08281)['pipe'](fs[_0x7186('0xe1')](path[_0x7186('0xc9')](_0x3a0881,_0x30e6c3[_0x7186('0xd2')]['basename'])));}}return{'date':moment(_0x30e6c3['createdAt'])[_0x7186('0xbe')](_0x7186('0xbf'))[_0x7186('0x9c')](),'sender':_0x30e6c3[_0x7186('0xe2')]===_0x7186('0xe3')?_0x30e6c3['User']?_0x30e6c3[_0x7186('0x6f')]['fullname']:_0x7186('0xe4'):_0x30e6c3[_0x7186('0x63')][_0x7186('0xcf')]+(_0x30e6c3[_0x7186('0x63')][_0x7186('0xd0')]?'\x20'+_0x30e6c3[_0x7186('0x63')][_0x7186('0xd0')]:''),'body':_0x30e6c3[_0x7186('0xd2')]?_0x30e6c3[_0x7186('0xd2')][_0x7186('0xde')]:_0x30e6c3[_0x7186('0x72')],'direction':_0x30e6c3[_0x7186('0xe2')]===_0x7186('0xe3')?'A':'C','secret':_0x30e6c3[_0x7186('0xd4')],'read':_0x30e6c3[_0x7186('0xd5')],'attachment':_0x30e6c3['Attachment']};})[_0x7186('0x61')]()};return ejs[_0x7186('0xe5')](path['join'](config[_0x7186('0xe6')],_0x7186('0xca'),_0x7186('0xe7'),'downloadInteraction.ejs'),{'interaction':_0x243deb})['then'](function(_0x251804){var _0x4bff53=path[_0x7186('0xc9')](_0x3a0881,_0x7186('0xe8')+_0x344aae['id']+'-'+_0x279b7e+_0x7186('0xe9'));var _0x366bbe={'path':_0x4bff53,'channel':_0x7186('0xd9'),'interactionId':_0x344aae['id']};return pdf['createPdfFromHTML'](_0x251804,_0x366bbe);})[_0x7186('0x27')](function(){return new BPromise(function(_0x1c28d9,_0x1c04b4){zipdir(_0x3a0881,{'saveTo':_0x3c8358},function(_0x10b1c7,_0x3a57d1){if(_0x10b1c7)return _0x1c04b4(_0x10b1c7);return _0x1c28d9(_0x3a57d1);});})[_0x7186('0x27')](function(){return new BPromise(function(_0x243aa8,_0x345180){rimraf(_0x3a0881,function(_0xfb87ea){if(_0xfb87ea)_0x345180(_0xfb87ea);return _0x243aa8();});});})[_0x7186('0x27')](function(){return _0x96832c[_0x7186('0xc7')](_0x3c8358,_0x1dedfb,function(_0x4d95a5){if(_0x4d95a5){console['log']('err',_0x4d95a5);}else{fs[_0x7186('0xea')](_0x3c8358);}});});});}else{return _0x96832c[_0x7186('0xeb')](0xc8);}})['catch'](handleError(_0x96832c,null));}; \ No newline at end of file +var _0x565e=['Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','some','compact','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','toString','merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','all','rows','show','options','create','body','params','describe','addMessage','omit','ids','getMessages','WhatsappMessage','nolimit','sort','WhatsappInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','spread','whatsappInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closedAt','disposition','basename','existsSync','pipe','createWriteStream','out','System','firstName','Contact','renderFile','views','transcript-','.pdf','createPdfFromHTML','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','stack','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','WhatsappInteraction','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe565('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe565('0x1'));var jsonpatch=require(_0xe565('0x2'));var rp=require(_0xe565('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe565('0x4'));var util=require(_0xe565('0x5'));var path=require(_0xe565('0x6'));var sox=require(_0xe565('0x7'));var csv=require(_0xe565('0x8'));var ejs=require(_0xe565('0x9'));var fs=require('fs');var fs_extra=require(_0xe565('0xa'));var _=require(_0xe565('0xb'));var squel=require(_0xe565('0xc'));var crypto=require(_0xe565('0xd'));var jsforce=require(_0xe565('0xe'));var deskjs=require(_0xe565('0xf'));var toCsv=require(_0xe565('0x8'));var querystring=require(_0xe565('0x10'));var Papa=require(_0xe565('0x11'));var Redis=require(_0xe565('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe565('0x13'));var as=require(_0xe565('0x14'));var pdf=require(_0xe565('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe565('0x16'))(_0xe565('0x17'));var utils=require(_0xe565('0x18'));var config=require(_0xe565('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe565('0x1a'))['db'];config['redis']=_[_0xe565('0x1b')](config['redis'],{'host':_0xe565('0x1c'),'port':0x18eb});var socket=require(_0xe565('0x1d'))(new Redis(config[_0xe565('0x1e')]));require('./whatsappInteraction.socket')[_0xe565('0x1f')](socket);function respondWithStatusCode(_0x177fbd,_0x127b29){_0x127b29=_0x127b29||0xcc;return function(_0x31b6c3){if(_0x31b6c3){return _0x177fbd['sendStatus'](_0x127b29);}return _0x177fbd[_0xe565('0x20')](_0x127b29)[_0xe565('0x21')]();};}function respondWithResult(_0x34a674,_0x178195){_0x178195=_0x178195||0xc8;return function(_0x3899de){if(_0x3899de){return _0x34a674[_0xe565('0x20')](_0x178195)['json'](_0x3899de);}};}function respondWithFilteredResult(_0x13d393,_0x42418f){return function(_0x38e6a0){if(_0x38e6a0){var _0x13aef8=typeof _0x42418f['offset']===_0xe565('0x22')&&typeof _0x42418f[_0xe565('0x23')]==='undefined';var _0x515786=_0x38e6a0[_0xe565('0x24')];var _0x426072=_0x13aef8?0x0:_0x42418f['offset'];var _0x3efaa1=_0x13aef8?_0x38e6a0[_0xe565('0x24')]:_0x42418f[_0xe565('0x25')]+_0x42418f['limit'];var _0x491f8b;if(_0x3efaa1>=_0x515786){_0x3efaa1=_0x515786;_0x491f8b=0xc8;}else{_0x491f8b=0xce;}_0x13d393[_0xe565('0x20')](_0x491f8b);return _0x13d393[_0xe565('0x26')](_0xe565('0x27'),_0x426072+'-'+_0x3efaa1+'/'+_0x515786)[_0xe565('0x28')](_0x38e6a0);}return null;};}function patchUpdates(_0x54237a){return function(_0x3cca25){try{jsonpatch['apply'](_0x3cca25,_0x54237a,!![]);}catch(_0x30b376){return BPromise[_0xe565('0x29')](_0x30b376);}return _0x3cca25[_0xe565('0x2a')]();};}function saveUpdates(_0x4edaed,_0x2d31bd){return function(_0x1e13aa){if(_0x1e13aa){return _0x1e13aa[_0xe565('0x2b')](_0x4edaed)[_0xe565('0x2c')](function(_0x5952b1){return _0x5952b1;});}return null;};}function removeEntity(_0x3b9b60,_0x519b72){return function(_0x35f4a9){if(_0x35f4a9){return _0x35f4a9[_0xe565('0x2d')]()[_0xe565('0x2c')](function(){_0x3b9b60['status'](0xcc)[_0xe565('0x21')]();});}};}function handleEntityNotFound(_0x3775ed,_0x32bf95){return function(_0x3eec54){if(!_0x3eec54){_0x3775ed[_0xe565('0x2e')](0x194);}return _0x3eec54;};}function handleError(_0x40a6c0,_0x2ec50e){_0x2ec50e=_0x2ec50e||0x1f4;return function(_0x2d1828){logger['error'](_0x2d1828[_0xe565('0x2f')]);if(_0x2d1828['name']){delete _0x2d1828[_0xe565('0x30')];}_0x40a6c0['status'](_0x2ec50e)['send'](_0x2d1828);};}function getInteractionUsers(_0x17fe89,_0x50b9ac){return new BPromise(function(_0xc7307b,_0x23c594){try{if(_0x50b9ac[_0x17fe89['id']]){_0x17fe89[_0xe565('0x31')]=_[_0xe565('0x32')](_0x50b9ac[_0x17fe89['id']],function(_0x706085){return{'id':_0x706085['id'],'fullname':_0x706085[_0xe565('0x33')]};});}}catch(_0x2fed58){_0x23c594(_0x2fed58);}_0xc7307b(_0x17fe89);});}function getInteractionTags(_0x58b0ac,_0x4a049d){return new BPromise(function(_0x2b3162,_0x20746d){try{if(_0x58b0ac[_0xe565('0x34')]){_0x58b0ac[_0xe565('0x35')]=[];_0x58b0ac['TagIds'][_0xe565('0x36')](',')[_0xe565('0x37')](function(_0x1af4e5){_0x58b0ac[_0xe565('0x35')][_0xe565('0x38')](_0x4a049d[_0x1af4e5]);});}delete _0x58b0ac['TagIds'];}catch(_0x19aad6){_0x20746d(_0x19aad6);}_0x2b3162(_0x58b0ac);});}function updateWhatsappInteraction(_0x12ccc8,_0x222a56,_0x369bb3){return new BPromise(function(_0x5b945a,_0x41824c){return getInteractionUsers(_0x12ccc8,_0x369bb3)[_0xe565('0x2c')](function(_0x2ced11){return getInteractionTags(_0x2ced11,_0x222a56);})['then'](function(_0x33bc9a){return getStateInteraction(_0x33bc9a);})[_0xe565('0x2c')](function(_0x5a7e53){_0x5b945a(_0x5a7e53);})[_0xe565('0x39')](function(_0x10cfc7){_0x41824c(_0x10cfc7);});});}function getStateInteraction(_0x52d856){return new BPromise(function(_0x114ab2){_0x52d856[_0xe565('0x3a')]=0x0;_0x52d856[_0xe565('0x3b')]=0x0;_0x52d856[_0xe565('0x3c')]=0x0;_0x52d856[_0xe565('0x3d')]=0x0;_0x52d856[_0xe565('0x3e')]=0x0;if(!_0x52d856[_0xe565('0x3f')]&&!_0x52d856[_0xe565('0x40')]){_0x52d856[_0xe565('0x3a')]+=0x1;}if(!_0x52d856[_0xe565('0x3f')]&&_0x52d856[_0xe565('0x40')]){_0x52d856[_0xe565('0x3b')]+=0x1;if(_0x52d856[_0xe565('0x3a')]){_0x52d856['waiting']-=0x1;}}if(_0x52d856[_0xe565('0x3f')]&&_0x52d856[_0xe565('0x40')]){_0x52d856[_0xe565('0x3c')]+=0x1;if(_0x52d856[_0xe565('0x3b')]){_0x52d856['talking']-=0x1;}}if(_0x52d856['closed']&&!_0x52d856[_0xe565('0x40')]){_0x52d856['unmanaged']+=0x1;if(_0x52d856['waiting']){_0x52d856[_0xe565('0x3a')]-=0x1;}}_0x52d856['total']+=0x1;_0x114ab2(_0x52d856);});}exports['index']=function(_0x37d8d0,_0x503b23){var _0x5f0492={},_0x27acb1={},_0x2423c9={'count':0x0,'rows':[]};var _0x17177e=_[_0xe565('0x32')](db[_0xe565('0x41')][_0xe565('0x42')],function(_0x1f2fc8){return{'name':_0x1f2fc8[_0xe565('0x43')],'type':_0x1f2fc8[_0xe565('0x44')]['key']};});_0x27acb1[_0xe565('0x45')]=_[_0xe565('0x32')](_0x17177e,_0xe565('0x30'));_0x27acb1[_0xe565('0x46')]=_[_0xe565('0x47')](_0x37d8d0[_0xe565('0x46')]);_0x27acb1[_0xe565('0x48')]=_[_0xe565('0x49')](_0x27acb1['model'],_0x27acb1[_0xe565('0x46')]);_0x5f0492[_0xe565('0x4a')]=_[_0xe565('0x49')](_0x27acb1[_0xe565('0x45')],qs[_0xe565('0x4b')](_0x37d8d0['query'][_0xe565('0x4b')]));_0x5f0492[_0xe565('0x4a')]=_0x5f0492[_0xe565('0x4a')][_0xe565('0x4c')]?_0x5f0492[_0xe565('0x4a')]:_0x27acb1[_0xe565('0x45')];if(!_0x37d8d0['query'][_0xe565('0x4d')]('nolimit')){_0x5f0492[_0xe565('0x23')]=qs[_0xe565('0x23')](_0x37d8d0[_0xe565('0x46')]['limit']);_0x5f0492['offset']=qs['offset'](_0x37d8d0[_0xe565('0x46')][_0xe565('0x25')]);}_0x5f0492[_0xe565('0x4e')]=qs['sort'](_0x37d8d0[_0xe565('0x46')]['sort']);_0x5f0492[_0xe565('0x4f')]=qs['filters'](_[_0xe565('0x50')](_0x37d8d0[_0xe565('0x46')],_0x27acb1['filters']),_0x17177e);var _0x8519b5=[];var _0x5387a3=squel[_0xe565('0x51')]()[_0xe565('0x52')]('id')['field'](_0xe565('0x30'))[_0xe565('0x52')](_0xe565('0x53'))[_0xe565('0x54')](_0xe565('0x55'));var _0x68ecf=squel['select']()[_0xe565('0x52')](_0xe565('0x56'))['field'](_0xe565('0x57'))['field'](_0xe565('0x58'))[_0xe565('0x54')](_0xe565('0x59'),'ui')[_0xe565('0x5a')]('users','u',_0xe565('0x5b'));var _0x39e1ab=squel[_0xe565('0x51')]()[_0xe565('0x54')](_0xe565('0x5c'),'i')[_0xe565('0x5a')](_0xe565('0x5d'),'c',_0xe565('0x5e'))[_0xe565('0x5a')]('users','o',_0xe565('0x5f'))[_0xe565('0x5a')](_0xe565('0x60'),'a',_0xe565('0x61'))[_0xe565('0x5a')](_0xe565('0x62'),'me',_0xe565('0x63'))[_0xe565('0x5a')](_0xe565('0x64'),'it',_0xe565('0x65'))['left_join'](_0xe565('0x55'),'t',_0xe565('0x66'));var _0x294792=squel[_0xe565('0x67')]();var _0x1e474a=[];var _0x7d88dd=squel['expr']();var _0x306e66;if(_0x37d8d0[_0xe565('0x46')][_0xe565('0x68')]){_0x306e66=as[_0xe565('0x69')](_0x37d8d0[_0xe565('0x46')][_0xe565('0x68')]);var _0x72426f=_0x306e66[_0xe565('0x6a')];for(var _0x4dcfb6=0x0;_0x4dcfb6<_0x306e66[_0xe565('0x6b')]['length'];_0x4dcfb6++){var _0xd6ed13=_0x306e66['conditions'][_0x4dcfb6];var _0x2abd89='i';var _0x34dd6b=_[_0xe565('0x6c')](_0x17177e,[_0xe565('0x30'),_0xd6ed13[_0xe565('0x52')]]);if(!_0x34dd6b){switch(_0xd6ed13[_0xe565('0x52')]){case _0xe565('0x6d'):if(_0xd6ed13[_0xe565('0x6e')]==0x1){_0x39e1ab[_0xe565('0x6f')]('`'+_0xd6ed13[_0xe565('0x52')]+_0xe565('0x70'));}else{_0x39e1ab[_0xe565('0x6f')]('`'+_0xd6ed13[_0xe565('0x52')]+'`\x20>\x200');}break;case'Contact':if(_0xd6ed13['operator']===_0xe565('0x71')){if(_0xd6ed13[_0xe565('0x6e')][_0xe565('0x36')]('\x20')['length']>0x1){_0x294792[_0x72426f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe565('0x72')](_0xd6ed13['value']),null);}else{var _0x572138='%'+_0xd6ed13['value']+'%';_0x294792[_0x72426f](_0xe565('0x73'),_0x572138,_0x572138,_0x572138);}}else{_0x34dd6b=_[_0xe565('0x6c')](_0x17177e,[_0xe565('0x30'),_0xe565('0x74')]);_0xd6ed13[_0xe565('0x52')]='ContactId';_0x1712f3=as[_0xe565('0x75')](_0x2abd89,_0x34dd6b[_0xe565('0x44')],_0xd6ed13);_0x294792[_0x72426f](_0x1712f3[_0xe565('0x76')],_0x1712f3['value'][_0xe565('0x77')],_0x1712f3[_0xe565('0x6e')]['end']);}break;case _0xe565('0x78'):var _0xf423e1=_0xd6ed13[_0xe565('0x6e')]['split'](',')['map'](function(_0x3a0056){return Number(_0x3a0056);});_0xf423e1['forEach'](function(_0xeeb3de){_0x7d88dd['or'](_0xe565('0x79'),'%,'+_0xeeb3de+',%');});_0x1e474a=_[_0xe565('0x7a')](_0x1e474a,_0xf423e1);break;case _0xe565('0x7b'):if(_0xd6ed13[_0xe565('0x7c')]===_0xe565('0x71')){_0x294792[_0x72426f](_0xe565('0x7d'),'%'+_0xd6ed13[_0xe565('0x6e')]+'%',null);}else{_0x34dd6b=_[_0xe565('0x6c')](_0x17177e,[_0xe565('0x30'),_0xe565('0x40')]);_0xd6ed13[_0xe565('0x52')]=_0xe565('0x40');_0x1712f3=as[_0xe565('0x75')](_0x2abd89,_0x34dd6b[_0xe565('0x44')],_0xd6ed13);_0x294792[_0x72426f](_0x1712f3[_0xe565('0x76')],_0x1712f3['value'][_0xe565('0x77')],_0x1712f3[_0xe565('0x6e')][_0xe565('0x21')]);}break;case'body':_0x1712f3=as[_0xe565('0x75')]('me',null,_0xd6ed13);_0x294792[_0x72426f](_0x1712f3[_0xe565('0x76')],_0x1712f3[_0xe565('0x6e')]['start'],_0x1712f3[_0xe565('0x6e')]['end']);break;}}else{var _0x1712f3=as[_0xe565('0x75')](_0x2abd89,_0x34dd6b['type'],_0xd6ed13);_0x294792[_0x72426f](_0x1712f3[_0xe565('0x76')],_0x1712f3['value'][_0xe565('0x77')],_0x1712f3[_0xe565('0x6e')]['end']);}}}else{var _0x11aa97=_(_0x37d8d0[_0xe565('0x46')])[_0xe565('0x47')]()[_0xe565('0x32')](function(_0x46f3e1){return _[_0xe565('0x7e')](_0x17177e,['name',_0x46f3e1])?_0x46f3e1:undefined;})[_0xe565('0x7f')]()[_0xe565('0x6e')]();if(!_['isEmpty'](_0x11aa97)){_0x11aa97['forEach'](function(_0x2fdb1d){if(_0x2fdb1d===_0xe565('0x80')){_0x39e1ab['where'](_0xe565('0x81'),[][_0xe565('0x82')](_0x37d8d0[_0xe565('0x46')][_0x2fdb1d]));}else if(_0x2fdb1d===_0xe565('0x83')){var _0x3ed391=JSON['parse'](_0x37d8d0['query'][_0x2fdb1d])[_0xe565('0x84')];var _0x31dd8e=JSON[_0xe565('0x85')](_0x37d8d0[_0xe565('0x46')][_0x2fdb1d])[_0xe565('0x86')];_0x39e1ab['where'](_0xe565('0x87'),_0x3ed391,_0x31dd8e);}else{if(_0x37d8d0[_0xe565('0x46')][_0x2fdb1d]===_0xe565('0x88')){_0x39e1ab['where']('i.'+_0x2fdb1d+_0xe565('0x89'));}else{_0x39e1ab['where']('i.'+_0x2fdb1d+_0xe565('0x8a'),_0x37d8d0[_0xe565('0x46')][_0x2fdb1d]);}}});}if(_0x37d8d0[_0xe565('0x46')][_0xe565('0x8b')]){if(_0x37d8d0['query'][_0xe565('0x8b')]==0x1){_0x39e1ab[_0xe565('0x6f')](_0xe565('0x8c'));}else{_0x39e1ab[_0xe565('0x6f')]('`unreadMessages`\x20>\x200');}}if(_0x37d8d0[_0xe565('0x46')][_0xe565('0x8d')]){_0x1e474a=_[_0xe565('0x8e')](_0x37d8d0[_0xe565('0x46')][_0xe565('0x8d')])?_0x37d8d0[_0xe565('0x46')]['tag']:new Array(_0x37d8d0[_0xe565('0x46')][_0xe565('0x8d')]);_0x1e474a[_0xe565('0x37')](function(_0xd43052){_0x7d88dd['or'](_0xe565('0x79'),'%,'+_0xd43052+',%');});}if(_0x37d8d0[_0xe565('0x46')][_0xe565('0x8f')]){var _0x404d60=_0x37d8d0[_0xe565('0x46')][_0xe565('0x8f')][_0xe565('0x90')]('\x5c','\x5c\x5c')[_0xe565('0x90')](/'/g,'\x27\x27');if(qs[_0xe565('0x91')](_0x404d60)){_0x294792['or'](_0xe565('0x92'),_0x404d60+'%')['or'](_0xe565('0x93'),_0x404d60+'%');}else{_0x294792['or'](_0xe565('0x94'),qs[_0xe565('0x72')](_0x404d60))['or'](_0xe565('0x95'),_0x404d60+'%');}}}_0x39e1ab[_0xe565('0x4f')](_0x294792);_0x39e1ab[_0xe565('0x96')]('i.id');var _0x5d38da={'type':db[_0xe565('0x97')][_0xe565('0x98')][_0xe565('0x99')],'raw':!![]};var _0x342285=_0x39e1ab['clone']();_0x342285['field'](_0xe565('0x9a'));_0x342285[_0xe565('0x52')](_0xe565('0x9b'),_0xe565('0x6d'));if(_0x5f0492[_0xe565('0x4e')]){_0x5f0492[_0xe565('0x4e')]['forEach'](function(_0x4eda9d){var _0x18c30c=_0x4eda9d[0x0]===_0xe565('0x9c')?_0x4eda9d[0x0]:'i.'+_0x4eda9d[0x0];_0x39e1ab[_0xe565('0x4e')](_0x18c30c,_0x4eda9d[0x1]===_0xe565('0x9d')?![]:!![]);});}if(!_['isEmpty'](_0x1e474a)){_0x39e1ab[_0xe565('0x6f')](_0x7d88dd);_0x342285[_0xe565('0x4f')]('t.id\x20IN\x20?',_0x1e474a);}BPromise['resolve']()[_0xe565('0x2c')](function(){if(!_0x306e66){if(_0x37d8d0[_0xe565('0x46')][_0xe565('0x80')])return;_0x342285['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x39e1ab[_0xe565('0x4f')](_0xe565('0x9e'));return;}if(_0x37d8d0[_0xe565('0x9f')][_0xe565('0xa0')]!==_0xe565('0xa1'))return;return _0x37d8d0[_0xe565('0x9f')][_0xe565('0xa2')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2a882d){if(_['isEmpty'](_0x2a882d)){_0x342285[_0xe565('0x4f')]('i.WhatsappAccountId\x20IS\x20NULL');_0x39e1ab[_0xe565('0x4f')](_0xe565('0xa3'));}else{_0x342285[_0xe565('0x4f')](_0xe565('0x81'),_[_0xe565('0x32')](_0x2a882d,'id'));_0x39e1ab[_0xe565('0x4f')]('i.WhatsappAccountId\x20IN\x20?',_[_0xe565('0x32')](_0x2a882d,'id'));}});})[_0xe565('0x2c')](function(){if(_0x37d8d0[_0xe565('0x9f')][_0xe565('0xa0')]==='agent'&&!_0x306e66&&!_0x37d8d0[_0xe565('0x46')][_0xe565('0x80')])return[];return db['sequelize'][_0xe565('0x46')](_0x342285['toString'](),_0x5d38da);})[_0xe565('0x2c')](function(_0x2fc371){_0x2423c9[_0xe565('0x24')]=_0x2fc371['length'];if(_0x2423c9['count']===0x0)return[];return db['sequelize']['query'](_0x5387a3[_0xe565('0xa4')](),_0x5d38da)[_0xe565('0x2c')](function(_0x5c2601){_0x8519b5=_['keyBy'](_0x5c2601,'id');_0x5d38da=_[_0xe565('0xa5')](_0x5d38da,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x37d8d0['query'][_0xe565('0x4b')]){_0x5f0492[_0xe565('0x4a')]['forEach'](function(_0x20800d){_0x39e1ab[_0xe565('0x52')]('i.'+_0x20800d);});}else{_0x39e1ab[_0xe565('0x52')](_0xe565('0x9b'),_0xe565('0x6d'));_0x39e1ab['field'](_0xe565('0xa6'),_0xe565('0xa7'));_0x39e1ab['field']('a.mandatoryDisposition',_0xe565('0xa8'));_0x39e1ab[_0xe565('0x52')](_0xe565('0xa9'),_0xe565('0x9c'));_0x39e1ab[_0xe565('0x52')](_0xe565('0xaa'));_0x39e1ab['field'](_0xe565('0xab'),_0xe565('0xac'));_0x39e1ab[_0xe565('0x52')]('c.lastName',_0xe565('0xad'));_0x39e1ab[_0xe565('0x52')]('c.email',_0xe565('0xae'));_0x39e1ab[_0xe565('0x52')](_0xe565('0xaf'),_0xe565('0xb0'));_0x39e1ab[_0xe565('0x52')](_0xe565('0xb1'),_0xe565('0xb2'));_0x39e1ab['field'](_0xe565('0xb3'),_0xe565('0xb4'));_0x39e1ab[_0xe565('0x52')]('o.fullname',_0xe565('0xb5'));_0x39e1ab['field'](_0xe565('0xb6'),'Owner.internal');_0x39e1ab[_0xe565('0x52')](_0xe565('0xb7'),'TagIds');}if(_0x5f0492[_0xe565('0x23')])_0x39e1ab[_0xe565('0x23')](_0x5f0492[_0xe565('0x23')]);if(_0x5f0492['offset'])_0x39e1ab['offset'](_0x5f0492['offset']);return db['sequelize']['query'](_0x39e1ab['toString'](),_0x5d38da);})[_0xe565('0x2c')](function(_0x41b40f){if(_0x41b40f[_0xe565('0x4c')]>0x0)_0x68ecf['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0xe565('0x32')](_0x41b40f,'id'));return db[_0xe565('0xb8')][_0xe565('0x46')](_0x68ecf[_0xe565('0xa4')](),_0x5d38da)[_0xe565('0x2c')](function(_0x23b73b){var _0x4b223a=_[_0xe565('0xb9')](_0x23b73b,'WhatsappInteractionId');var _0x4a72e3=[];_0x41b40f[_0xe565('0x37')](function(_0x361de2){_0x4a72e3[_0xe565('0x38')](updateWhatsappInteraction(_0x361de2,_0x8519b5,_0x4b223a));});return BPromise[_0xe565('0xba')](_0x4a72e3);});});})['then'](function(_0x485fc5){_0x2423c9[_0xe565('0xbb')]=_0x485fc5;return _0x2423c9;})[_0xe565('0x2c')](respondWithFilteredResult(_0x503b23,_0x5f0492))[_0xe565('0x39')](handleError(_0x503b23,null));};exports[_0xe565('0xbc')]=function(_0x13042d,_0x446732){var _0x569e2e={'raw':![],'where':{'id':_0x13042d['params']['id']}},_0x6ea415={};_0x6ea415[_0xe565('0x45')]=_[_0xe565('0x47')](db[_0xe565('0x41')]['rawAttributes']);_0x6ea415['query']=_[_0xe565('0x47')](_0x13042d['query']);_0x6ea415[_0xe565('0x48')]=_['intersection'](_0x6ea415[_0xe565('0x45')],_0x6ea415[_0xe565('0x46')]);_0x569e2e[_0xe565('0x4a')]=_[_0xe565('0x49')](_0x6ea415[_0xe565('0x45')],qs[_0xe565('0x4b')](_0x13042d[_0xe565('0x46')][_0xe565('0x4b')]));_0x569e2e[_0xe565('0x4a')]=_0x569e2e[_0xe565('0x4a')][_0xe565('0x4c')]?_0x569e2e[_0xe565('0x4a')]:_0x6ea415[_0xe565('0x45')];if(_0x13042d[_0xe565('0x46')]['includeAll']){_0x569e2e['include']=[{'all':!![]}];}_0x569e2e=_[_0xe565('0xa5')]({},_0x569e2e,_0x13042d[_0xe565('0xbd')]);return db[_0xe565('0x41')][_0xe565('0x6c')](_0x569e2e)[_0xe565('0x2c')](handleEntityNotFound(_0x446732,null))[_0xe565('0x2c')](respondWithResult(_0x446732,null))[_0xe565('0x39')](handleError(_0x446732,null));};exports['create']=function(_0x2d64a3,_0xeeeab1){return db['WhatsappInteraction'][_0xe565('0xbe')](_0x2d64a3[_0xe565('0xbf')],{})[_0xe565('0x2c')](respondWithResult(_0xeeeab1,0xc9))['catch'](handleError(_0xeeeab1,null));};exports['update']=function(_0x16a500,_0x2da03){if(_0x16a500['body']['id']){delete _0x16a500['body']['id'];}return db[_0xe565('0x41')][_0xe565('0x6c')]({'where':{'id':_0x16a500[_0xe565('0xc0')]['id']}})[_0xe565('0x2c')](handleEntityNotFound(_0x2da03,null))['then'](saveUpdates(_0x16a500['body'],null))[_0xe565('0x2c')](respondWithResult(_0x2da03,null))['catch'](handleError(_0x2da03,null));};exports[_0xe565('0x2d')]=function(_0x148890,_0x33197){return db[_0xe565('0x41')][_0xe565('0x6c')]({'where':{'id':_0x148890[_0xe565('0xc0')]['id']}})[_0xe565('0x2c')](handleEntityNotFound(_0x33197,null))[_0xe565('0x2c')](removeEntity(_0x33197,null))[_0xe565('0x39')](handleError(_0x33197,null));};exports[_0xe565('0xc1')]=function(_0x2fd364,_0x42339a){return db[_0xe565('0x41')][_0xe565('0xc1')]()[_0xe565('0x2c')](respondWithResult(_0x42339a,null))['catch'](handleError(_0x42339a,null));};exports[_0xe565('0xc2')]=function(_0x34e5b0,_0x104899,_0x30cdb3){return db['WhatsappMessage']['find']({'where':{'id':_0x34e5b0[_0xe565('0xc0')]['id']}})[_0xe565('0x2c')](handleEntityNotFound(_0x104899,null))[_0xe565('0x2c')](function(_0x2ea782){if(_0x2ea782){return _0x2ea782['addMessage'](_0x34e5b0[_0xe565('0xbf')]['ids'],_[_0xe565('0xc3')](_0x34e5b0[_0xe565('0xbf')],[_0xe565('0xc4'),'id'])||{});}})[_0xe565('0x2c')](respondWithResult(_0x104899,null))[_0xe565('0x39')](handleError(_0x104899,null));};exports[_0xe565('0xc5')]=function(_0x700628,_0x1fc4da,_0x11e67f){var _0x115ecb={'raw':![],'where':{}};var _0x10660f={};var _0x2ecd2b={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x700628[_0xe565('0xc0')]['id']}})[_0xe565('0x2c')](handleEntityNotFound(_0x1fc4da,null))[_0xe565('0x2c')](function(_0x36fe6a){if(_0x36fe6a){_0x10660f[_0xe565('0x45')]=_[_0xe565('0x47')](db[_0xe565('0xc6')][_0xe565('0x42')]);_0x10660f['query']=_[_0xe565('0x47')](_0x700628[_0xe565('0x46')]);_0x10660f[_0xe565('0x48')]=_['intersection'](_0x10660f[_0xe565('0x45')],_0x10660f[_0xe565('0x46')]);_0x115ecb[_0xe565('0x4a')]=_[_0xe565('0x49')](_0x10660f['model'],qs[_0xe565('0x4b')](_0x700628[_0xe565('0x46')][_0xe565('0x4b')]));_0x115ecb['attributes']=_0x115ecb[_0xe565('0x4a')][_0xe565('0x4c')]?_0x115ecb[_0xe565('0x4a')]:_0x10660f[_0xe565('0x45')];if(!_0x700628[_0xe565('0x46')][_0xe565('0x4d')](_0xe565('0xc7'))){_0x115ecb['limit']=qs[_0xe565('0x23')](_0x700628[_0xe565('0x46')]['limit']);_0x115ecb['offset']=qs[_0xe565('0x25')](_0x700628[_0xe565('0x46')][_0xe565('0x25')]);}_0x115ecb[_0xe565('0x4e')]=qs['sort'](_0x700628[_0xe565('0x46')][_0xe565('0xc8')]);_0x115ecb['where']=qs['filters'](_['pick'](_0x700628[_0xe565('0x46')],_0x10660f[_0xe565('0x48')]));_0x115ecb[_0xe565('0x4f')][_0xe565('0xc9')]=_0x36fe6a['id'];if(_0x700628[_0xe565('0x46')][_0xe565('0x8f')]){_0x115ecb[_0xe565('0x4f')]=_[_0xe565('0xa5')](_0x115ecb[_0xe565('0x4f')],{'$or':_[_0xe565('0x32')](_0x115ecb[_0xe565('0x4a')],function(_0x4b642d){var _0x19ceba={};_0x19ceba[_0x4b642d]={'$like':'%'+_0x700628['query'][_0xe565('0x8f')]+'%'};return _0x19ceba;})});}if(_0x700628[_0xe565('0x46')][_0xe565('0x84')]){var _0x2babbd=_0x700628[_0xe565('0x46')][_0xe565('0x84')][_0xe565('0x36')](',');var _0x5910a9={};_0x5910a9[_0x2babbd[0x0]]={'$gte':moment(_0x2babbd[0x1])[_0xe565('0xca')](_0xe565('0xcb'))};_0x115ecb['where']=_[_0xe565('0xa5')](_0x115ecb[_0xe565('0x4f')],_0x5910a9);}_0x115ecb=_[_0xe565('0xa5')]({},_0x115ecb,_0x700628[_0xe565('0xbd')]);return db[_0xe565('0xc6')][_0xe565('0x24')]({'where':_0x115ecb['where']})[_0xe565('0x2c')](function(_0x117523){_0x2ecd2b[_0xe565('0x24')]=_0x117523;if(_0x700628[_0xe565('0x46')][_0xe565('0xcc')]){_0x115ecb[_0xe565('0xcd')]=[{'all':!![]}];}return db[_0xe565('0xc6')][_0xe565('0xce')](_0x115ecb);})[_0xe565('0x2c')](function(_0xa6ad0a){_0x2ecd2b[_0xe565('0xbb')]=_0xa6ad0a;return _0x2ecd2b;});}})[_0xe565('0x2c')](respondWithFilteredResult(_0x1fc4da,_0x115ecb))[_0xe565('0x39')](handleError(_0x1fc4da,null));};exports['addTags']=function(_0xc93839,_0x425ed2,_0x5cdee2){return db[_0xe565('0x41')][_0xe565('0x6c')]({'where':{'id':_0xc93839[_0xe565('0xc0')]['id']}})['then'](handleEntityNotFound(_0x425ed2,null))['then'](function(_0x4bd265){if(_0x4bd265){return _0x4bd265['setTags'](_0xc93839[_0xe565('0xbf')][_0xe565('0xc4')],_[_0xe565('0xc3')](_0xc93839[_0xe565('0xbf')],[_0xe565('0xc4'),'id'])||{})[_0xe565('0xcf')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0xc93839[_0xe565('0xbf')][_0xe565('0xc4')]}});})[_0xe565('0x2c')](function(_0x3ef5d0){socket['emit'](_0xe565('0xd0'),{'id':Number(_0xc93839['params']['id']),'tags':_0x3ef5d0||[]});return{'id':Number(_0xc93839[_0xe565('0xc0')]['id']),'tags':_0x3ef5d0||[]};});}})['then'](respondWithResult(_0x425ed2,null))[_0xe565('0x39')](handleError(_0x425ed2,null));};exports[_0xe565('0xd1')]=function(_0x198ae4,_0xcaf85a,_0x5d4bb9){return db[_0xe565('0x41')]['find']({'where':{'id':_0x198ae4[_0xe565('0xc0')]['id']}})['then'](handleEntityNotFound(_0xcaf85a,null))['then'](function(_0x4e4b2c){if(_0x4e4b2c){return _0x4e4b2c[_0xe565('0xd1')](_0x198ae4['query'][_0xe565('0xc4')]);}})[_0xe565('0x2c')](respondWithStatusCode(_0xcaf85a,null))[_0xe565('0x39')](handleError(_0xcaf85a,null));};exports[_0xe565('0xd2')]=function(_0x40d5cf,_0x525b24){var _0x2e6422=moment()['unix']()[_0xe565('0xa4')]();var _0x3a2a15=path[_0xe565('0xd3')](config[_0xe565('0xd4')],_0xe565('0xd5'),_0xe565('0xd6'),_0xe565('0xd7'));var _0x45da38=path['join'](config[_0xe565('0xd4')],_0xe565('0xd5'),_0xe565('0xd6'),_0xe565('0xd8'));var _0x2518ac=path[_0xe565('0xd3')](_0x3a2a15,_0x2e6422);var _0x5e5a91=util[_0xe565('0xca')](_0xe565('0xd9'),_0x40d5cf['params']['id'],_0x2e6422);var _0x212b74=path[_0xe565('0xd3')](_0x3a2a15,_0x5e5a91);var _0x81b1a=[];_0x81b1a[_0xe565('0x38')]({'model':db[_0xe565('0x7b')],'as':_0xe565('0x7b'),'attributes':['id',_0xe565('0x33')],'raw':!![]});_0x81b1a[_0xe565('0x38')]({'model':db[_0xe565('0xda')],'as':'Contact','attributes':['id','firstName',_0xe565('0xdb')],'raw':!![]});if(_0x40d5cf[_0xe565('0x46')][_0xe565('0xd8')]){_0x81b1a[_0xe565('0x38')]({'model':db[_0xe565('0xdc')],'as':_0xe565('0xdc'),'raw':!![]});}var _0x424a5c=[{'model':db[_0xe565('0xc6')],'as':_0xe565('0xdd'),'attributes':['id',_0xe565('0xbf'),_0xe565('0x83'),_0xe565('0xde'),_0xe565('0xdf'),_0xe565('0x8b')],'include':_0x81b1a}];_0x424a5c['push']({'model':db[_0xe565('0xe0')],'as':_0xe565('0xe1'),'attributes':['id',_0xe565('0x30')]});_0x424a5c[_0xe565('0x38')]({'model':db[_0xe565('0x7b')],'as':'Owner','attributes':['id',_0xe565('0x33')]});return db[_0xe565('0x41')][_0xe565('0x6c')]({'where':{'id':_0x40d5cf['params']['id']},'include':_0x424a5c})['then'](handleEntityNotFound(_0x525b24,null))[_0xe565('0x2c')](function(_0x16431c){if(_0x16431c){var _0x1f31f5=_0x16431c[_0xe565('0xe2')]({'plain':!![]});fs[_0xe565('0xe3')](_0x2518ac);var _0x18cd34={'channel':_0xe565('0xe4'),'account':_0x1f31f5[_0xe565('0xe1')]['name'],'agent':_0x1f31f5['Owner']?_0x1f31f5[_0xe565('0xe5')][_0xe565('0x33')]:_0xe565('0xe6'),'createdAt':moment(_0x1f31f5[_0xe565('0x83')])[_0xe565('0xca')](_0xe565('0xcb'))[_0xe565('0xa4')](),'closedAt':_0x1f31f5['closed']?moment(_0x1f31f5[_0xe565('0xe7')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe565('0xa4')]():'','disposition':_0x1f31f5[_0xe565('0xe8')],'messages':_(_0x1f31f5['Messages'])[_0xe565('0x8f')]({'secret':![]})[_0xe565('0x32')](function(_0x5604df){if(_0x5604df['Attachment']){var _0x29215e=path[_0xe565('0xd3')](_0x45da38,_0x5604df['Attachment'][_0xe565('0xe9')]);if(fs[_0xe565('0xea')](_0x29215e)){fs['createReadStream'](_0x29215e)[_0xe565('0xeb')](fs[_0xe565('0xec')](path['join'](_0x2518ac,_0x5604df[_0xe565('0xdc')][_0xe565('0xe9')])));}}return{'date':moment(_0x5604df[_0xe565('0x83')])[_0xe565('0xca')](_0xe565('0xcb'))['toString'](),'sender':_0x5604df[_0xe565('0xde')]===_0xe565('0xed')?_0x5604df[_0xe565('0x7b')]?_0x5604df[_0xe565('0x7b')][_0xe565('0x33')]:_0xe565('0xee'):_0x5604df['Contact'][_0xe565('0xef')]+(_0x5604df[_0xe565('0xf0')][_0xe565('0xdb')]?'\x20'+_0x5604df['Contact']['lastName']:''),'body':_0x5604df[_0xe565('0xdc')]?_0x5604df[_0xe565('0xdc')]['basename']:_0x5604df[_0xe565('0xbf')],'direction':_0x5604df[_0xe565('0xde')]===_0xe565('0xed')?'A':'C','secret':_0x5604df[_0xe565('0xdf')],'read':_0x5604df[_0xe565('0x8b')],'attachment':_0x5604df[_0xe565('0xdc')]};})[_0xe565('0x6e')]()};return ejs[_0xe565('0xf1')](path[_0xe565('0xd3')](config['root'],_0xe565('0xd5'),_0xe565('0xf2'),'downloadInteraction.ejs'),{'interaction':_0x18cd34})[_0xe565('0x2c')](function(_0x38f7b2){var _0x4b518a=path[_0xe565('0xd3')](_0x2518ac,_0xe565('0xf3')+_0x1f31f5['id']+'-'+_0x2e6422+_0xe565('0xf4'));var _0x30bf51={'path':_0x4b518a,'channel':_0xe565('0xe4'),'interactionId':_0x1f31f5['id']};return pdf[_0xe565('0xf5')](_0x38f7b2,_0x30bf51);})['then'](function(){return new BPromise(function(_0x47060c,_0x1539ed){zipdir(_0x2518ac,{'saveTo':_0x212b74},function(_0x55993d,_0xc192e){if(_0x55993d)return _0x1539ed(_0x55993d);return _0x47060c(_0xc192e);});})[_0xe565('0x2c')](function(){return new BPromise(function(_0x58ebe2,_0x458149){rimraf(_0x2518ac,function(_0x58428f){if(_0x58428f)_0x458149(_0x58428f);return _0x58ebe2();});});})[_0xe565('0x2c')](function(){return _0x525b24[_0xe565('0xd2')](_0x212b74,_0x5e5a91,function(_0x2c05fe){if(_0x2c05fe){console['log']('err',_0x2c05fe);}else{fs[_0xe565('0xf6')](_0x212b74);}});});});}else{return _0x525b24[_0xe565('0x2e')](0xc8);}})['catch'](handleError(_0x525b24,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 07fc680..01e9363 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 _0x5397=['length','emit','catch','hasOwnProperty','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','Users','findAll'];(function(_0x3ed2dd,_0x154a63){var _0x46a6dc=function(_0xcffd6a){while(--_0xcffd6a){_0x3ed2dd['push'](_0x3ed2dd['shift']());}};_0x46a6dc(++_0x154a63);}(_0x5397,0x105));var _0x7539=function(_0x10910a,_0x1530de){_0x10910a=_0x10910a-0x0;var _0x123a9a=_0x5397[_0x10910a];return _0x123a9a;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x7539('0x0'))['db'][_0x7539('0x1')];var WhatsappMessage=require(_0x7539('0x0'))['db'][_0x7539('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7539('0x3')](0x0);var events={'afterCreate':_0x7539('0x4'),'afterUpdate':_0x7539('0x5'),'afterDestroy':_0x7539('0x6')};function emitEvent(_0x394310){return function(_0x5b6181,_0x19dcb4,_0x3486c2){_0x5b6181[_0x7539('0x7')]({'attributes':['id'],'raw':!![]})[_0x7539('0x8')](function(_0x2e3dad){_0x5b6181['setDataValue'](_0x7539('0x9'),_0x2e3dad['map'](function(_0xa25c56){return{'id':_0xa25c56['id']};}));return WhatsappMessage[_0x7539('0xa')]({'where':{'WhatsappInteractionId':_0x5b6181['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7539('0x8')](function(_0x448095){_0x5b6181['setDataValue']('unreadMessages',_0x448095[_0x7539('0xb')]);WhatsappInteractionEvents[_0x7539('0xc')](_0x394310+':'+_0x5b6181['id'],_0x5b6181);WhatsappInteractionEvents[_0x7539('0xc')](_0x394310,_0x5b6181);_0x3486c2(null);})[_0x7539('0xd')](_0x3486c2(null));};}for(var e in events){if(events[_0x7539('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x7539('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x235a=['../../mysqldb','WhatsappInteraction','WhatsappMessage','save','update','remove','getUsers','setDataValue','Users','map','findAll','length','hasOwnProperty','hook','exports','events'];(function(_0x4a4ecc,_0x2cbb25){var _0x206d63=function(_0x303c44){while(--_0x303c44){_0x4a4ecc['push'](_0x4a4ecc['shift']());}};_0x206d63(++_0x2cbb25);}(_0x235a,0x1ef));var _0xa235=function(_0x531a68,_0x1ebac3){_0x531a68=_0x531a68-0x0;var _0x5081de=_0x235a[_0x531a68];return _0x5081de;};'use strict';var EventEmitter=require(_0xa235('0x0'));var WhatsappInteraction=require(_0xa235('0x1'))['db'][_0xa235('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xa235('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa235('0x4'),'afterUpdate':_0xa235('0x5'),'afterDestroy':_0xa235('0x6')};function emitEvent(_0x314ebf){return function(_0x2e6eca,_0x5e94b0,_0x2961c8){_0x2e6eca[_0xa235('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2e535e){_0x2e6eca[_0xa235('0x8')](_0xa235('0x9'),_0x2e535e[_0xa235('0xa')](function(_0x5c60d9){return{'id':_0x5c60d9['id']};}));return WhatsappMessage[_0xa235('0xb')]({'where':{'WhatsappInteractionId':_0x2e6eca['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x560eb1){_0x2e6eca[_0xa235('0x8')]('unreadMessages',_0x560eb1[_0xa235('0xc')]);WhatsappInteractionEvents['emit'](_0x314ebf+':'+_0x2e6eca['id'],_0x2e6eca);WhatsappInteractionEvents['emit'](_0x314ebf,_0x2e6eca);_0x2961c8(null);})['catch'](_0x2961c8(null));};}for(var e in events){if(events[_0xa235('0xd')](e)){var event=events[e];WhatsappInteraction[_0xa235('0xe')](e,emitEvent(event));}}module[_0xa235('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index f4d92f2..83a5941 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 _0xdd1f=['../../config/environment','./whatsappInteraction.attributes','define','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0xc40b9f,_0x17ec1f){var _0x535b9c=function(_0x591b19){while(--_0x591b19){_0xc40b9f['push'](_0xc40b9f['shift']());}};_0x535b9c(++_0x17ec1f);}(_0xdd1f,0x13b));var _0xfdd1=function(_0x36982d,_0x786b47){_0x36982d=_0x36982d-0x0;var _0x5d7a29=_0xdd1f[_0x36982d];return _0x5d7a29;};'use strict';var _=require('lodash');var util=require(_0xfdd1('0x0'));var logger=require(_0xfdd1('0x1'))(_0xfdd1('0x2'));var moment=require(_0xfdd1('0x3'));var BPromise=require(_0xfdd1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdd1('0x5'));var rimraf=require(_0xfdd1('0x6'));var config=require(_0xfdd1('0x7'));var attributes=require(_0xfdd1('0x8'));module['exports']=function(_0xcdd996,_0x2aa593){return _0xcdd996[_0xfdd1('0x9')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x491f70,_0x47870f,_0x1e8b4b){if(_0x491f70[_0xfdd1('0xa')]('closed')){_0x491f70[_0xfdd1('0xb')]=moment()[_0xfdd1('0xc')](_0xfdd1('0xd'));}_0x1e8b4b(null,_0x491f70);}}});}; \ No newline at end of file +var _0x1b0f=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b0f,0x8f));var _0xf1b0=function(_0x23ddeb,_0x38469f){_0x23ddeb=_0x23ddeb-0x0;var _0x6c824=_0x1b0f[_0x23ddeb];return _0x6c824;};'use strict';var _=require('lodash');var util=require(_0xf1b0('0x0'));var logger=require(_0xf1b0('0x1'))(_0xf1b0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf1b0('0x3'));var fs=require('fs');var path=require(_0xf1b0('0x4'));var rimraf=require(_0xf1b0('0x5'));var config=require(_0xf1b0('0x6'));var attributes=require(_0xf1b0('0x7'));module[_0xf1b0('0x8')]=function(_0x137729,_0x45b37d){return _0x137729[_0xf1b0('0x9')](_0xf1b0('0xa'),attributes,{'tableName':_0xf1b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ac511,_0x72a9ae,_0x2c6559){if(_0x2ac511[_0xf1b0('0xc')](_0xf1b0('0xd'))){_0x2ac511[_0xf1b0('0xe')]=moment()['format'](_0xf1b0('0xf'));}_0x2c6559(null,_0x2ac511);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 5967961..e12d158 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 _0x677a=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateWhatsappInteraction','body','options','raw','where','attributes','catch','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','then','info'];(function(_0x10e473,_0x541bf1){var _0x13f220=function(_0x4b4e52){while(--_0x4b4e52){_0x10e473['push'](_0x10e473['shift']());}};_0x13f220(++_0x541bf1);}(_0x677a,0x1cf));var _0xa677=function(_0x75a4cb,_0x4d439c){_0x75a4cb=_0x75a4cb-0x0;var _0x5dbc66=_0x677a[_0x75a4cb];return _0x5dbc66;};'use strict';var _=require('lodash');var util=require(_0xa677('0x0'));var moment=require(_0xa677('0x1'));var BPromise=require(_0xa677('0x2'));var rs=require(_0xa677('0x3'));var fs=require('fs');var Redis=require(_0xa677('0x4'));var db=require(_0xa677('0x5'))['db'];var utils=require(_0xa677('0x6'));var logger=require(_0xa677('0x7'))(_0xa677('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa677('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa677('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa677('0xa')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1ffe3e,_0x28de3b,_0x3c86c6){return new BPromise(function(_0x2646b6,_0x1a4fd3){return client['request'](_0x1ffe3e,_0x3c86c6)[_0xa677('0xb')](function(_0x5a5ce6){logger[_0xa677('0xc')](_0xa677('0xd'),_0x28de3b,_0xa677('0xe'));logger[_0xa677('0xf')](_0xa677('0x10'),_0x28de3b,_0xa677('0xe'),JSON[_0xa677('0x11')](_0x5a5ce6));if(_0x5a5ce6[_0xa677('0x12')]){if(_0x5a5ce6[_0xa677('0x12')][_0xa677('0x13')]===0x1f4){logger[_0xa677('0x12')](_0xa677('0xd'),_0x28de3b,_0x5a5ce6[_0xa677('0x12')][_0xa677('0x14')]);return _0x1a4fd3(_0x5a5ce6[_0xa677('0x12')][_0xa677('0x14')]);}logger[_0xa677('0x12')](_0xa677('0xd'),_0x28de3b,_0x5a5ce6[_0xa677('0x12')][_0xa677('0x14')]);return _0x2646b6(_0x5a5ce6[_0xa677('0x12')]['message']);}else{logger[_0xa677('0xc')](_0xa677('0xd'),_0x28de3b,_0xa677('0xe'));_0x2646b6(_0x5a5ce6['result']['message']);}})['catch'](function(_0x1e252f){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x28de3b,_0x1e252f);_0x1a4fd3(_0x1e252f);});});}exports[_0xa677('0x15')]=function(_0xb4c270){var _0x4bfb89=this;return new Promise(function(_0x9990d8,_0x5900aa){return db['WhatsappInteraction']['update'](_0xb4c270[_0xa677('0x16')],{'raw':_0xb4c270[_0xa677('0x17')]?_0xb4c270[_0xa677('0x17')][_0xa677('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb4c270[_0xa677('0x17')]?_0xb4c270['options'][_0xa677('0x19')]||null:null,'attributes':_0xb4c270[_0xa677('0x17')]?_0xb4c270[_0xa677('0x17')][_0xa677('0x1a')]||null:null,'limit':_0xb4c270[_0xa677('0x17')]?_0xb4c270['options']['limit']||null:null})[_0xa677('0xb')](function(_0x2eeb6e){logger[_0xa677('0xc')](_0xa677('0x15'),_0xb4c270);logger['debug'](_0xa677('0x15'),_0xb4c270,JSON['stringify'](_0x2eeb6e));_0x9990d8(_0x2eeb6e);})[_0xa677('0x1b')](function(_0x4bdb5e){logger[_0xa677('0x12')]('UpdateWhatsappInteraction',_0x4bdb5e[_0xa677('0x14')],_0xb4c270);_0x5900aa(_0x4bfb89[_0xa677('0x12')](0x1f4,_0x4bdb5e[_0xa677('0x14')]));});});};exports[_0xa677('0x1c')]=function(_0x51377d){return new Promise(function(_0x44f62b,_0xa56b57){return db['WhatsappInteraction'][_0xa677('0x1d')]({'where':_0x51377d[_0xa677('0x17')]?_0x51377d[_0xa677('0x17')]['where']||null:null})['then'](function(_0x2648db){if(_0x2648db){return _0x2648db['addTags'](_0x51377d[_0xa677('0x16')][_0xa677('0x1e')],_[_0xa677('0x1f')](_0x51377d[_0xa677('0x16')],[_0xa677('0x1e'),'id'])||{});}})[_0xa677('0x20')](function(_0xe4098d){logger[_0xa677('0xc')](_0xa677('0x21'),_0x51377d);logger[_0xa677('0xf')]('AddTags',_0x51377d,JSON[_0xa677('0x11')](_0xe4098d));_0x44f62b(_0xe4098d);})[_0xa677('0x1b')](function(_0x1c5f76){logger[_0xa677('0x12')](_0xa677('0x21'),_0x1c5f76[_0xa677('0x14')],_0x51377d);_0xa56b57(_this[_0xa677('0x12')](0x1f4,_0x1c5f76[_0xa677('0x14')]));});});}; \ No newline at end of file +var _0x8d73=['catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','raw','options','where','attributes','limit','AddTagsToWhatsappInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message'];(function(_0x14d03,_0xfb5270){var _0x393cf8=function(_0x29c970){while(--_0x29c970){_0x14d03['push'](_0x14d03['shift']());}};_0x393cf8(++_0xfb5270);}(_0x8d73,0xe3));var _0x38d7=function(_0x53dc2f,_0x352f5f){_0x53dc2f=_0x53dc2f-0x0;var _0x2db8b6=_0x8d73[_0x53dc2f];return _0x2db8b6;};'use strict';var _=require(_0x38d7('0x0'));var util=require(_0x38d7('0x1'));var moment=require(_0x38d7('0x2'));var BPromise=require('bluebird');var rs=require(_0x38d7('0x3'));var fs=require('fs');var Redis=require(_0x38d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x38d7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x38d7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x38d7('0x7')][_0x38d7('0x8')]({'port':0x232a});config[_0x38d7('0x9')]=_['defaults'](config[_0x38d7('0x9')],{'host':_0x38d7('0xa'),'port':0x18eb});var socket=require(_0x38d7('0xb'))(new Redis(config[_0x38d7('0x9')]));require(_0x38d7('0xc'))[_0x38d7('0xd')](socket);function respondWithRpcPromise(_0xe21af9,_0x2adc45,_0x59a910){return new BPromise(function(_0x2f219b,_0x4f9b0d){return client[_0x38d7('0xe')](_0xe21af9,_0x59a910)[_0x38d7('0xf')](function(_0x572324){logger[_0x38d7('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x2adc45,'request\x20sent');logger[_0x38d7('0x11')](_0x38d7('0x12'),_0x2adc45,_0x38d7('0x13'),JSON[_0x38d7('0x14')](_0x572324));if(_0x572324[_0x38d7('0x15')]){if(_0x572324['error'][_0x38d7('0x16')]===0x1f4){logger['error'](_0x38d7('0x17'),_0x2adc45,_0x572324[_0x38d7('0x15')][_0x38d7('0x18')]);return _0x4f9b0d(_0x572324['error'][_0x38d7('0x18')]);}logger[_0x38d7('0x15')](_0x38d7('0x17'),_0x2adc45,_0x572324['error'][_0x38d7('0x18')]);return _0x2f219b(_0x572324[_0x38d7('0x15')][_0x38d7('0x18')]);}else{logger[_0x38d7('0x10')](_0x38d7('0x17'),_0x2adc45,_0x38d7('0x13'));_0x2f219b(_0x572324['result'][_0x38d7('0x18')]);}})[_0x38d7('0x19')](function(_0x5acc71){logger['error'](_0x38d7('0x17'),_0x2adc45,_0x5acc71);_0x4f9b0d(_0x5acc71);});});}exports[_0x38d7('0x1a')]=function(_0x49f905){var _0x2219cf=this;return new Promise(function(_0x3d6b33,_0x2dbf67){return db[_0x38d7('0x1b')][_0x38d7('0x1c')](_0x49f905[_0x38d7('0x1d')],{'raw':_0x49f905['options']?_0x49f905['options'][_0x38d7('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49f905[_0x38d7('0x1f')]?_0x49f905['options'][_0x38d7('0x20')]||null:null,'attributes':_0x49f905['options']?_0x49f905[_0x38d7('0x1f')][_0x38d7('0x21')]||null:null,'limit':_0x49f905[_0x38d7('0x1f')]?_0x49f905[_0x38d7('0x1f')][_0x38d7('0x22')]||null:null})['then'](function(_0x506c54){logger[_0x38d7('0x10')]('UpdateWhatsappInteraction',_0x49f905);logger[_0x38d7('0x11')]('UpdateWhatsappInteraction',_0x49f905,JSON[_0x38d7('0x14')](_0x506c54));_0x3d6b33(_0x506c54);})[_0x38d7('0x19')](function(_0x548458){logger[_0x38d7('0x15')](_0x38d7('0x1a'),_0x548458[_0x38d7('0x18')],_0x49f905);_0x2dbf67(_0x2219cf[_0x38d7('0x15')](0x1f4,_0x548458[_0x38d7('0x18')]));});});};exports[_0x38d7('0x23')]=function(_0x3902fb){return new Promise(function(_0x5f0763,_0x2b2d6f){return db[_0x38d7('0x1b')][_0x38d7('0x24')]({'where':_0x3902fb['options']?_0x3902fb[_0x38d7('0x1f')][_0x38d7('0x20')]||null:null})[_0x38d7('0xf')](function(_0x514101){if(_0x514101){return _0x514101[_0x38d7('0x25')](_0x3902fb['body']['ids'],_[_0x38d7('0x26')](_0x3902fb[_0x38d7('0x1d')],[_0x38d7('0x27'),'id'])||{});}})[_0x38d7('0x28')](function(_0x1ab5d6){logger[_0x38d7('0x10')]('AddTags',_0x3902fb);logger[_0x38d7('0x11')](_0x38d7('0x29'),_0x3902fb,JSON[_0x38d7('0x14')](_0x1ab5d6));_0x5f0763(_0x1ab5d6);})[_0x38d7('0x19')](function(_0x109b68){logger['error'](_0x38d7('0x29'),_0x109b68[_0x38d7('0x18')],_0x3902fb);_0x2b2d6f(_this[_0x38d7('0x15')](0x1f4,_0x109b68[_0x38d7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 04aaa77..23db025 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 _0xa37b=['whatsappInteraction:','save','remove','update','emit','removeListener','register'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa37b,0xef));var _0xba37=function(_0x272156,_0x5e4b0d){_0x272156=_0x272156-0x0;var _0x1071d0=_0xa37b[_0x272156];return _0x1071d0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xba37('0x0'),_0xba37('0x1'),_0xba37('0x2')];function createListener(_0x35dea0,_0x28073c){return function(_0x1ece50){_0x28073c[_0xba37('0x3')](_0x35dea0,_0x1ece50);};}function removeListener(_0x414797,_0x51acf1){return function(){WhatsappInteractionEvents[_0xba37('0x4')](_0x414797,_0x51acf1);};}exports[_0xba37('0x5')]=function(_0x286896){for(var _0x3059a3=0x0,_0xc35794=events['length'];_0x3059a3<_0xc35794;_0x3059a3++){var _0x5f6bcd=events[_0x3059a3];var _0x189423=createListener(_0xba37('0x6')+_0x5f6bcd,_0x286896);WhatsappInteractionEvents['on'](_0x5f6bcd,_0x189423);}}; \ No newline at end of file +var _0x61cc=['./whatsappInteraction.events','remove','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x14ba2f,_0x204a9a){var _0x4d27d4=function(_0x3469b8){while(--_0x3469b8){_0x14ba2f['push'](_0x14ba2f['shift']());}};_0x4d27d4(++_0x204a9a);}(_0x61cc,0x128));var _0xc61c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x61cc[_0x19e35c];return _0x3e1fe8;};'use strict';var WhatsappInteractionEvents=require(_0xc61c('0x0'));var events=['save',_0xc61c('0x1'),_0xc61c('0x2')];function createListener(_0x4b1e6d,_0x596b24){return function(_0x3e1934){_0x596b24[_0xc61c('0x3')](_0x4b1e6d,_0x3e1934);};}function removeListener(_0x4474c8,_0x258014){return function(){WhatsappInteractionEvents[_0xc61c('0x4')](_0x4474c8,_0x258014);};}exports[_0xc61c('0x5')]=function(_0x2cec44){for(var _0x4cac92=0x0,_0x2a5594=events[_0xc61c('0x6')];_0x4cac92<_0x2a5594;_0x4cac92++){var _0x4d3dd9=events[_0x4cac92];var _0x1837ec=createListener(_0xc61c('0x7')+_0x4d3dd9,_0x2cec44);WhatsappInteractionEvents['on'](_0x4d3dd9,_0x1837ec);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 946014a..0137c6b 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 _0xe10b=['tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','/:id','update','put','/:id/accept','/:id/reject','reject','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x401c38,_0x2ac280){var _0x291f83=function(_0x275b06){while(--_0x275b06){_0x401c38['push'](_0x401c38['shift']());}};_0x291f83(++_0x2ac280);}(_0xe10b,0x195));var _0xbe10=function(_0x3ff32c,_0x3b7f73){_0x3ff32c=_0x3ff32c-0x0;var _0xae696e=_0xe10b[_0x3ff32c];return _0xae696e;};'use strict';var multer=require(_0xbe10('0x0'));var util=require('util');var path=require(_0xbe10('0x1'));var timeout=require(_0xbe10('0x2'));var express=require(_0xbe10('0x3'));var router=express[_0xbe10('0x4')]();var fs_extra=require(_0xbe10('0x5'));var auth=require(_0xbe10('0x6'));var interaction=require(_0xbe10('0x7'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xbe10('0x8')]('/',auth[_0xbe10('0x9')](),controller[_0xbe10('0xa')]);router['get'](_0xbe10('0xb'),auth[_0xbe10('0x9')](),controller[_0xbe10('0xc')]);router[_0xbe10('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbe10('0xd')]);router[_0xbe10('0xe')]('/',auth[_0xbe10('0x9')](),interaction[_0xbe10('0xf')](_0xbe10('0x10'),_0xbe10('0x11')),controller[_0xbe10('0x12')]);router[_0xbe10('0xe')](_0xbe10('0x13'),controller[_0xbe10('0x14')]);router['put'](_0xbe10('0x15'),auth['isAuthenticated'](),controller[_0xbe10('0x16')]);router[_0xbe10('0x17')](_0xbe10('0x18'),auth[_0xbe10('0x9')](),controller['accept']);router[_0xbe10('0x17')](_0xbe10('0x19'),auth['isAuthenticated'](),controller[_0xbe10('0x1a')]);router['delete'](_0xbe10('0x15'),auth[_0xbe10('0x9')](),controller['destroy']);module[_0xbe10('0x1b')]=router; \ No newline at end of file +var _0x6007=['/:id/accept','/:id/reject','reject','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','describe','/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put'];(function(_0x1bdb82,_0x50e7a5){var _0x11a52b=function(_0x5f2d02){while(--_0x5f2d02){_0x1bdb82['push'](_0x1bdb82['shift']());}};_0x11a52b(++_0x50e7a5);}(_0x6007,0xef));var _0x7600=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x6007[_0xf44d98];return _0x5ebb04;};'use strict';var multer=require(_0x7600('0x0'));var util=require('util');var path=require(_0x7600('0x1'));var timeout=require(_0x7600('0x2'));var express=require(_0x7600('0x3'));var router=express[_0x7600('0x4')]();var fs_extra=require(_0x7600('0x5'));var auth=require(_0x7600('0x6'));var interaction=require(_0x7600('0x7'));var config=require('../../config/environment');var controller=require(_0x7600('0x8'));router[_0x7600('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7600('0x9')]('/describe',auth[_0x7600('0xa')](),controller[_0x7600('0xb')]);router[_0x7600('0x9')](_0x7600('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7600('0xd')]('/',auth[_0x7600('0xa')](),interaction[_0x7600('0xe')](_0x7600('0xf'),_0x7600('0x10')),controller[_0x7600('0x11')]);router[_0x7600('0xd')](_0x7600('0x12'),controller[_0x7600('0x13')]);router['put'](_0x7600('0xc'),auth[_0x7600('0xa')](),controller['update']);router[_0x7600('0x14')](_0x7600('0x15'),auth[_0x7600('0xa')](),controller['accept']);router['put'](_0x7600('0x16'),auth[_0x7600('0xa')](),controller[_0x7600('0x17')]);router['delete'](_0x7600('0xc'),auth[_0x7600('0xa')](),controller[_0x7600('0x18')]);module[_0x7600('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 30f8a4d..02cf717 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 _0xc240=['exports','TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize'];(function(_0x2c6fa1,_0x3983ad){var _0xa5f183=function(_0x1aa739){while(--_0x1aa739){_0x2c6fa1['push'](_0x2c6fa1['shift']());}};_0xa5f183(++_0x3983ad);}(_0xc240,0xa7));var _0x0c24=function(_0x301ec5,_0x318882){_0x301ec5=_0x301ec5-0x0;var _0x389229=_0xc240[_0x301ec5];return _0x389229;};'use strict';var Sequelize=require(_0x0c24('0x0'));module[_0x0c24('0x1')]={'body':{'type':Sequelize[_0x0c24('0x2')](_0x0c24('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0c24('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0c24('0x5')),'defaultValue':_0x0c24('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x0c24('0x6')]},'readAt':{'type':Sequelize[_0x0c24('0x7')]},'secret':{'type':Sequelize[_0x0c24('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0c24('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xf68d=['DATE','BOOLEAN','TEXT','exports','medium','ENUM','STRING'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xf68d,0x16f));var _0xdf68=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xf68d[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require('sequelize');module[_0xdf68('0x0')]={'body':{'type':Sequelize['TEXT'](_0xdf68('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xdf68('0x2')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xdf68('0x3')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xdf68('0x4')]},'secret':{'type':Sequelize[_0xdf68('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xdf68('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index bf56746..fc7764e 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 _0xa4c1=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','register','jayson/promise','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','destroy','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','length','find','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','WhatsappInteraction','WhatsappInteractionId','isNil','interaction','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','Sequelize','motionChannel','WhatsappAccount','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1764c8,_0x50e0b8){var _0x3cf065=function(_0x236b80){while(--_0x236b80){_0x1764c8['push'](_0x1764c8['shift']());}};_0x3cf065(++_0x50e0b8);}(_0xa4c1,0x103));var _0x1a4c=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xa4c1[_0x18d631];return _0x50d708;};'use strict';var emlformat=require(_0x1a4c('0x0'));var rimraf=require(_0x1a4c('0x1'));var zipdir=require(_0x1a4c('0x2'));var jsonpatch=require(_0x1a4c('0x3'));var rp=require(_0x1a4c('0x4'));var moment=require(_0x1a4c('0x5'));var BPromise=require(_0x1a4c('0x6'));var Mustache=require(_0x1a4c('0x7'));var util=require(_0x1a4c('0x8'));var path=require(_0x1a4c('0x9'));var sox=require(_0x1a4c('0xa'));var csv=require(_0x1a4c('0xb'));var ejs=require(_0x1a4c('0xc'));var fs=require('fs');var fs_extra=require(_0x1a4c('0xd'));var _=require(_0x1a4c('0xe'));var squel=require('squel');var crypto=require(_0x1a4c('0xf'));var jsforce=require(_0x1a4c('0x10'));var deskjs=require(_0x1a4c('0x11'));var toCsv=require(_0x1a4c('0xb'));var querystring=require(_0x1a4c('0x12'));var Papa=require(_0x1a4c('0x13'));var Redis=require(_0x1a4c('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x1a4c('0x15'));var as=require(_0x1a4c('0x16'));var hardwareService=require(_0x1a4c('0x17'));var logger=require('../../config/logger')(_0x1a4c('0x18'));var utils=require(_0x1a4c('0x19'));var config=require(_0x1a4c('0x1a'));var licenseUtil=require(_0x1a4c('0x1b'));var db=require(_0x1a4c('0x1c'))['db'];config['redis']=_[_0x1a4c('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1a4c('0x1e'))(new Redis(config[_0x1a4c('0x1f')]));require('./whatsappMessage.socket')[_0x1a4c('0x20')](socket);var jayson=require(_0x1a4c('0x21'));var client=jayson['client'][_0x1a4c('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x257f20,_0x416edc,_0x49f7cb,_0x23ea3f){return new BPromise(function(_0x37fe4b,_0x46095a){var _0x69f6c4=_0x23ea3f||client;return _0x69f6c4[_0x1a4c('0x23')](_0x257f20,_0x49f7cb)[_0x1a4c('0x24')](function(_0x386014){logger[_0x1a4c('0x25')](_0x1a4c('0x26'),_0x416edc,_0x1a4c('0x27'));logger['debug'](_0x1a4c('0x28'),_0x416edc,_0x1a4c('0x27'),JSON[_0x1a4c('0x29')](_0x386014));if(_0x386014[_0x1a4c('0x2a')]){if(_0x386014[_0x1a4c('0x2a')][_0x1a4c('0x2b')]===0x1f4){logger[_0x1a4c('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0x416edc,_0x386014['error']['message']);return _0x46095a(_0x386014['error'][_0x1a4c('0x2c')]);}logger['error'](_0x1a4c('0x26'),_0x416edc,_0x386014[_0x1a4c('0x2a')][_0x1a4c('0x2c')]);return _0x37fe4b(_0x386014['error']['message']);}else{logger[_0x1a4c('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x416edc,_0x1a4c('0x27'));_0x37fe4b(_0x386014[_0x1a4c('0x2d')][_0x1a4c('0x2c')]);}})[_0x1a4c('0x2e')](function(_0x41ecb5){logger[_0x1a4c('0x2a')](_0x1a4c('0x26'),_0x416edc,_0x41ecb5);_0x46095a(_0x41ecb5);});});}function respondWithStatusCode(_0x1114d1,_0x7c556){_0x7c556=_0x7c556||0xcc;return function(_0x469164){if(_0x469164){return _0x1114d1[_0x1a4c('0x2f')](_0x7c556);}return _0x1114d1[_0x1a4c('0x30')](_0x7c556)[_0x1a4c('0x31')]();};}function respondWithResult(_0x40825c,_0x4821a7){_0x4821a7=_0x4821a7||0xc8;return function(_0x2ea467){if(_0x2ea467){return _0x40825c['status'](_0x4821a7)[_0x1a4c('0x32')](_0x2ea467);}};}function respondWithFilteredResult(_0x24ec5b,_0x49c0d8){return function(_0x444620){if(_0x444620){var _0xaf8ca1=typeof _0x49c0d8['offset']===_0x1a4c('0x33')&&typeof _0x49c0d8[_0x1a4c('0x34')]==='undefined';var _0x439fe0=_0x444620[_0x1a4c('0x35')];var _0x138825=_0xaf8ca1?0x0:_0x49c0d8[_0x1a4c('0x36')];var _0x14d606=_0xaf8ca1?_0x444620[_0x1a4c('0x35')]:_0x49c0d8[_0x1a4c('0x36')]+_0x49c0d8[_0x1a4c('0x34')];var _0x34e745;if(_0x14d606>=_0x439fe0){_0x14d606=_0x439fe0;_0x34e745=0xc8;}else{_0x34e745=0xce;}_0x24ec5b[_0x1a4c('0x30')](_0x34e745);return _0x24ec5b[_0x1a4c('0x37')]('Content-Range',_0x138825+'-'+_0x14d606+'/'+_0x439fe0)[_0x1a4c('0x32')](_0x444620);}return null;};}function patchUpdates(_0xf4bb2a){return function(_0x555b10){try{jsonpatch['apply'](_0x555b10,_0xf4bb2a,!![]);}catch(_0x3ce0c7){return BPromise[_0x1a4c('0x38')](_0x3ce0c7);}return _0x555b10[_0x1a4c('0x39')]();};}function saveUpdates(_0x5240f0,_0x48973d){return function(_0x2df91a){if(_0x2df91a){return _0x2df91a[_0x1a4c('0x3a')](_0x5240f0)[_0x1a4c('0x24')](function(_0x4c8e62){return _0x4c8e62;});}return null;};}function removeEntity(_0x52a0c9,_0x41234b){return function(_0x49374c){if(_0x49374c){return _0x49374c[_0x1a4c('0x3b')]()[_0x1a4c('0x24')](function(){_0x52a0c9[_0x1a4c('0x30')](0xcc)[_0x1a4c('0x31')]();});}};}function handleEntityNotFound(_0x42ce30,_0x1078e8){return function(_0x19c65a){if(!_0x19c65a){_0x42ce30['sendStatus'](0x194);}return _0x19c65a;};}function handleError(_0x2c7e79,_0x4f23e3){_0x4f23e3=_0x4f23e3||0x1f4;return function(_0x1f94c5){logger[_0x1a4c('0x2a')](_0x1f94c5['stack']);if(_0x1f94c5[_0x1a4c('0x3c')]){delete _0x1f94c5[_0x1a4c('0x3c')];}_0x2c7e79[_0x1a4c('0x30')](_0x4f23e3)['send'](_0x1f94c5);};}exports[_0x1a4c('0x3d')]=function(_0x392c4a,_0xd887e2){var _0x5ddfd6={},_0x119a84={},_0x55b2df={'count':0x0,'rows':[]};var _0x58e002=_[_0x1a4c('0x3e')](db[_0x1a4c('0x3f')][_0x1a4c('0x40')],function(_0x4b9413){return{'name':_0x4b9413[_0x1a4c('0x41')],'type':_0x4b9413[_0x1a4c('0x42')][_0x1a4c('0x43')]};});_0x119a84[_0x1a4c('0x44')]=_[_0x1a4c('0x3e')](_0x58e002,_0x1a4c('0x3c'));_0x119a84[_0x1a4c('0x45')]=_[_0x1a4c('0x46')](_0x392c4a[_0x1a4c('0x45')]);_0x119a84[_0x1a4c('0x47')]=_[_0x1a4c('0x48')](_0x119a84[_0x1a4c('0x44')],_0x119a84[_0x1a4c('0x45')]);_0x5ddfd6[_0x1a4c('0x49')]=_[_0x1a4c('0x48')](_0x119a84['model'],qs[_0x1a4c('0x4a')](_0x392c4a[_0x1a4c('0x45')][_0x1a4c('0x4a')]));_0x5ddfd6[_0x1a4c('0x49')]=_0x5ddfd6[_0x1a4c('0x49')]['length']?_0x5ddfd6[_0x1a4c('0x49')]:_0x119a84[_0x1a4c('0x44')];if(!_0x392c4a[_0x1a4c('0x45')][_0x1a4c('0x4b')]('nolimit')){_0x5ddfd6[_0x1a4c('0x34')]=qs[_0x1a4c('0x34')](_0x392c4a[_0x1a4c('0x45')]['limit']);_0x5ddfd6[_0x1a4c('0x36')]=qs[_0x1a4c('0x36')](_0x392c4a['query'][_0x1a4c('0x36')]);}_0x5ddfd6[_0x1a4c('0x4c')]=qs[_0x1a4c('0x4d')](_0x392c4a['query']['sort']);_0x5ddfd6[_0x1a4c('0x4e')]=qs[_0x1a4c('0x47')](_['pick'](_0x392c4a['query'],_0x119a84['filters']),_0x58e002);if(_0x392c4a[_0x1a4c('0x45')][_0x1a4c('0x4f')]){_0x5ddfd6[_0x1a4c('0x4e')]=_[_0x1a4c('0x50')](_0x5ddfd6[_0x1a4c('0x4e')],{'$or':_[_0x1a4c('0x3e')](_0x58e002,function(_0x30ea58){if(_0x30ea58[_0x1a4c('0x42')]!=='VIRTUAL'){var _0x5a6fe4={};_0x5a6fe4[_0x30ea58['name']]={'$like':'%'+_0x392c4a['query']['filter']+'%'};return _0x5a6fe4;}})});}_0x5ddfd6=_[_0x1a4c('0x50')]({},_0x5ddfd6,_0x392c4a[_0x1a4c('0x51')]);var _0x14270d={'where':_0x5ddfd6['where']};return db[_0x1a4c('0x3f')][_0x1a4c('0x35')](_0x14270d)[_0x1a4c('0x24')](function(_0x15918a){_0x55b2df['count']=_0x15918a;if(_0x392c4a[_0x1a4c('0x45')][_0x1a4c('0x52')]){_0x5ddfd6[_0x1a4c('0x53')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x1a4c('0x54')](_0x5ddfd6);})['then'](function(_0x3e26af){_0x55b2df[_0x1a4c('0x55')]=_0x3e26af;return _0x55b2df;})[_0x1a4c('0x24')](respondWithFilteredResult(_0xd887e2,_0x5ddfd6))[_0x1a4c('0x2e')](handleError(_0xd887e2,null));};exports['show']=function(_0x589d9c,_0x27bea6){var _0x4981e6={'raw':!![],'where':{'id':_0x589d9c[_0x1a4c('0x56')]['id']}},_0x1e4a5d={};_0x1e4a5d[_0x1a4c('0x44')]=_[_0x1a4c('0x46')](db[_0x1a4c('0x3f')][_0x1a4c('0x40')]);_0x1e4a5d[_0x1a4c('0x45')]=_['keys'](_0x589d9c['query']);_0x1e4a5d['filters']=_[_0x1a4c('0x48')](_0x1e4a5d[_0x1a4c('0x44')],_0x1e4a5d[_0x1a4c('0x45')]);_0x4981e6[_0x1a4c('0x49')]=_[_0x1a4c('0x48')](_0x1e4a5d[_0x1a4c('0x44')],qs[_0x1a4c('0x4a')](_0x589d9c[_0x1a4c('0x45')]['fields']));_0x4981e6[_0x1a4c('0x49')]=_0x4981e6['attributes'][_0x1a4c('0x57')]?_0x4981e6['attributes']:_0x1e4a5d[_0x1a4c('0x44')];if(_0x589d9c[_0x1a4c('0x45')][_0x1a4c('0x52')]){_0x4981e6[_0x1a4c('0x53')]=[{'all':!![]}];}_0x4981e6=_[_0x1a4c('0x50')]({},_0x4981e6,_0x589d9c[_0x1a4c('0x51')]);return db[_0x1a4c('0x3f')][_0x1a4c('0x58')](_0x4981e6)['then'](handleEntityNotFound(_0x27bea6,null))[_0x1a4c('0x24')](respondWithResult(_0x27bea6,null))[_0x1a4c('0x2e')](handleError(_0x27bea6,null));};exports['create']=function(_0x30afa4,_0x1023c7){return db['WhatsappMessage']['create'](_0x30afa4['body'],{})['then'](respondWithResult(_0x1023c7,0xc9))[_0x1a4c('0x2e')](handleError(_0x1023c7,null));};exports[_0x1a4c('0x3a')]=function(_0x1595ad,_0x1aad9d){if(_0x1595ad['body']['id']){delete _0x1595ad[_0x1a4c('0x59')]['id'];}return db['WhatsappMessage'][_0x1a4c('0x58')]({'where':{'id':_0x1595ad[_0x1a4c('0x56')]['id']}})[_0x1a4c('0x24')](handleEntityNotFound(_0x1aad9d,null))[_0x1a4c('0x24')](saveUpdates(_0x1595ad[_0x1a4c('0x59')],null))[_0x1a4c('0x24')](respondWithResult(_0x1aad9d,null))[_0x1a4c('0x2e')](handleError(_0x1aad9d,null));};exports[_0x1a4c('0x3b')]=function(_0x5bd882,_0x23e4bc){return db[_0x1a4c('0x3f')][_0x1a4c('0x58')]({'where':{'id':_0x5bd882[_0x1a4c('0x56')]['id']}})[_0x1a4c('0x24')](handleEntityNotFound(_0x23e4bc,null))[_0x1a4c('0x24')](removeEntity(_0x23e4bc,null))[_0x1a4c('0x2e')](handleError(_0x23e4bc,null));};exports[_0x1a4c('0x5a')]=function(_0x7849d6,_0x137065){return db[_0x1a4c('0x3f')][_0x1a4c('0x5a')]()['then'](respondWithResult(_0x137065,null))[_0x1a4c('0x2e')](handleError(_0x137065,null));};var interaction_log=require(_0x1a4c('0x5b'))(_0x1a4c('0x5c'));exports[_0x1a4c('0x5d')]=function(_0x1e6849,_0x84643c,_0x24f9c3){var _0xc0adc9={'agent':{},'channel':_0x1a4c('0x5e')};if(_0x1e6849[_0x1a4c('0x59')]['id']){delete _0x1e6849[_0x1a4c('0x59')]['id'];}_0x1e6849[_0x1a4c('0x59')][_0x1a4c('0x5f')]=!![];_0x1e6849['body'][_0x1a4c('0x60')]=moment()[_0x1a4c('0x61')](_0x1a4c('0x62'));_0x1e6849[_0x1a4c('0x59')]['UserId']=_0x1e6849[_0x1a4c('0x59')][_0x1a4c('0x63')]||_0x1e6849['user']['id'];_0xc0adc9['agent']['id']=_0x1e6849[_0x1a4c('0x59')]['UserId'];return db[_0x1a4c('0x3f')]['find']({'where':{'id':_0x1e6849[_0x1a4c('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x84643c,null))[_0x1a4c('0x24')](saveUpdates(_0x1e6849[_0x1a4c('0x59')],null))[_0x1a4c('0x24')](function(_0x52a18e){if(_0x52a18e){_0xc0adc9[_0x1a4c('0x2c')]=_0x52a18e['get']({'plain':!![]});return db[_0x1a4c('0x64')][_0x1a4c('0x58')]({'where':{'id':_0x52a18e[_0x1a4c('0x65')]}});}return null;})[_0x1a4c('0x24')](handleEntityNotFound(_0x84643c,null))['then'](function(_0x354402){if(_0x354402){return _0x354402['update']({'UserId':_0x1e6849[_0x1a4c('0x59')]['UserId'],'read1stAt':_[_0x1a4c('0x66')](_0x354402['read1stAt'])?moment()[_0x1a4c('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x13c0bb){if(_0x13c0bb){_0xc0adc9[_0x1a4c('0x67')]=_0x13c0bb['get']({'plain':!![]});interaction_log[_0x1a4c('0x25')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1e6849['user']['id'],_0x1e6849[_0x1a4c('0x68')]['name'],_0x1e6849[_0x1a4c('0x68')][_0x1a4c('0x69')],_0xc0adc9[_0x1a4c('0x67')]['id'],_0x1e6849[_0x1a4c('0x59')]?JSON['stringify'](_0x1e6849[_0x1a4c('0x59')]):_0x1a4c('0x6a'));return respondWithRpcPromise(_0x1a4c('0x6b'),_0x1a4c('0x6c'),_0xc0adc9);}return null;})['then'](function(_0x1c2905){var _0x5e5a49=_0x1a4c('0x6d')+_0x1c2905[_0x1a4c('0x2c')]['ContactId'];return db['sequelize'][_0x1a4c('0x45')](_0x5e5a49,{'type':db['Sequelize'][_0x1a4c('0x6e')][_0x1a4c('0x6f')],'raw':!![]})[_0x1a4c('0x24')](function(_0x5aa98b){return _0x5aa98b;});})[_0x1a4c('0x24')](function(_0x5ea061){if(_0x5ea061){_0xc0adc9[_0x1a4c('0x2c')][_0x1a4c('0x70')]=_0x5ea061[0x0];if(!_0x1e6849[_0x1a4c('0x59')][_0x1a4c('0x63')])return;return db[_0x1a4c('0x71')][_0x1a4c('0x58')]({'where':{'id':_0x1e6849['body'][_0x1a4c('0x63')],'role':_0x1a4c('0x72')},'attributes':['id','name',_0x1a4c('0x73'),_0x1a4c('0x74'),_0x1a4c('0x75')],'raw':!![]});}return null;})[_0x1a4c('0x24')](function(_0x21973c){if(!_0x21973c)return null;_0xc0adc9[_0x1a4c('0x2c')][_0x1a4c('0x72')]=_0x21973c;return _0xc0adc9;})[_0x1a4c('0x24')](function(_0x417140){if(_0x417140){if(_0x1e6849[_0x1a4c('0x59')][_0x1a4c('0x76')]){_0xc0adc9[_0x1a4c('0x2c')][_0x1a4c('0x77')]=util[_0x1a4c('0x61')](_0x1a4c('0x78'),_0x1e6849['user'][_0x1a4c('0x3c')]);_0xc0adc9['message'][_0x1a4c('0x79')]=_0xc0adc9[_0x1a4c('0x79')];_0xc0adc9[_0x1a4c('0x2c')]['motionChannel']=_0xc0adc9[_0x1a4c('0x79')];_0xc0adc9['message'][_0x1a4c('0x7a')]=_0x1a4c('0x5d');return respondWithRpcPromise('EventManager',_0x1a4c('0x7b'),{'event':_0x1a4c('0x7c'),'message':_0xc0adc9[_0x1a4c('0x2c')]},client9002)[_0x1a4c('0x24')](function(){return _0xc0adc9;});}return _0xc0adc9;}return null;})[_0x1a4c('0x24')](respondWithResult(_0x84643c,null))[_0x1a4c('0x2e')](handleError(_0x84643c,null));};var interaction_log=require(_0x1a4c('0x5b'))(_0x1a4c('0x5c'));exports[_0x1a4c('0x38')]=function(_0x28a1aa,_0x3f1ead,_0x34fcbc){var _0x1fdd8b={'agent':{},'channel':'whatsapp'};if(_0x28a1aa['body']['id']){delete _0x28a1aa['body']['id'];}_0x28a1aa[_0x1a4c('0x59')]['UserId']=_0x28a1aa[_0x1a4c('0x59')][_0x1a4c('0x63')]||_0x28a1aa[_0x1a4c('0x68')]['id'];_0x1fdd8b['agent']['id']=_0x28a1aa[_0x1a4c('0x59')][_0x1a4c('0x63')];return db[_0x1a4c('0x3f')][_0x1a4c('0x58')]({'where':{'id':_0x28a1aa[_0x1a4c('0x56')]['id'],'UserId':null}})[_0x1a4c('0x24')](handleEntityNotFound(_0x3f1ead,null))[_0x1a4c('0x24')](function(_0x780477){if(_0x780477){_0x1fdd8b['message']=_0x780477['get']({'plain':!![]});return db[_0x1a4c('0x64')][_0x1a4c('0x58')]({'where':{'id':_0x780477['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3f1ead,null))[_0x1a4c('0x24')](function(_0x56a0ea){if(_0x56a0ea){_0x1fdd8b[_0x1a4c('0x67')]=_0x56a0ea[_0x1a4c('0x7d')]({'plain':!![]});interaction_log[_0x1a4c('0x25')](_0x1a4c('0x7e'),_0x28a1aa['user']['id'],_0x28a1aa[_0x1a4c('0x68')]['name'],_0x28a1aa[_0x1a4c('0x68')][_0x1a4c('0x69')],_0x1fdd8b[_0x1a4c('0x67')]['id'],_0x28a1aa[_0x1a4c('0x59')]?JSON[_0x1a4c('0x29')](_0x28a1aa[_0x1a4c('0x59')]):_0x1a4c('0x6a'));return respondWithRpcPromise(_0x1a4c('0x7f'),'rejectMessage',_0x1fdd8b);}return null;})[_0x1a4c('0x24')](function(_0x5e9da5){var _0x623f25=_0x1a4c('0x6d')+_0x5e9da5['message'][_0x1a4c('0x80')];return db['sequelize']['query'](_0x623f25,{'type':db[_0x1a4c('0x81')][_0x1a4c('0x6e')][_0x1a4c('0x6f')],'raw':!![]})[_0x1a4c('0x24')](function(_0x422725){return _0x422725;});})[_0x1a4c('0x24')](function(_0x502889){if(_0x502889){_0x1fdd8b[_0x1a4c('0x2c')][_0x1a4c('0x70')]=_0x502889[0x0];if(!_0x28a1aa[_0x1a4c('0x59')]['UserId'])return;return db[_0x1a4c('0x71')][_0x1a4c('0x58')]({'where':{'id':_0x28a1aa['body'][_0x1a4c('0x63')],'role':'agent'},'attributes':['id',_0x1a4c('0x3c'),_0x1a4c('0x73'),_0x1a4c('0x74'),_0x1a4c('0x75')],'raw':!![]});}return null;})[_0x1a4c('0x24')](function(_0x464d72){if(!_0x464d72)return null;_0x1fdd8b[_0x1a4c('0x2c')][_0x1a4c('0x72')]=_0x464d72;return _0x1fdd8b;})['then'](function(_0x3cc3f6){if(_0x3cc3f6){_0x3cc3f6[_0x1a4c('0x2c')][_0x1a4c('0x77')]=util[_0x1a4c('0x61')](_0x1a4c('0x78'),_0x28a1aa['user']['name']);_0x3cc3f6[_0x1a4c('0x2c')][_0x1a4c('0x79')]=_0x1fdd8b[_0x1a4c('0x79')];_0x3cc3f6['message'][_0x1a4c('0x82')]=_0x1fdd8b[_0x1a4c('0x79')];_0x3cc3f6['message']['event']=_0x1a4c('0x38');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x3cc3f6[_0x1a4c('0x2c')]},client9002);return _0x1fdd8b;}return null;})[_0x1a4c('0x24')](respondWithResult(_0x3f1ead,null))[_0x1a4c('0x2e')](handleError(_0x3f1ead,null));};exports[_0x1a4c('0x30')]=function(_0x4908e5,_0x19c791,_0x1cf924){if(_0x4908e5[_0x1a4c('0x59')]['id']){delete _0x4908e5[_0x1a4c('0x59')]['id'];}var _0x45fd38;return db[_0x1a4c('0x3f')][_0x1a4c('0x58')]({'where':{'id':_0x4908e5[_0x1a4c('0x56')]['id']}})[_0x1a4c('0x24')](handleEntityNotFound(_0x19c791,null))[_0x1a4c('0x24')](function(_0x47059b){if(_0x47059b){_0x45fd38=_0x47059b;return db[_0x1a4c('0x83')][_0x1a4c('0x58')]({'where':{'id':_0x47059b['WhatsappAccountId']}});}})[_0x1a4c('0x24')](handleEntityNotFound(_0x19c791,null))[_0x1a4c('0x24')](function(_0x3435fe){if(_0x3435fe){logger[_0x1a4c('0x84')](_0x1a4c('0x85'),_0x1a4c('0x30'),_0x1a4c('0x86'),_0x3435fe[_0x1a4c('0x42')],util[_0x1a4c('0x87')](_0x4908e5[_0x1a4c('0x59')],{'showHidden':![],'depth':null}));switch(_0x3435fe[_0x1a4c('0x42')]){case _0x1a4c('0x88'):if(_0x4908e5[_0x1a4c('0x59')][_0x1a4c('0x89')]&&_0x4908e5[_0x1a4c('0x59')][_0x1a4c('0x89')]===_0x45fd38[_0x1a4c('0x8a')]&&_0x4908e5[_0x1a4c('0x59')][_0x1a4c('0x8b')]&&_0x4908e5[_0x1a4c('0x59')]['MessageStatus']===_0x1a4c('0x5f')){return _0x45fd38['update']({'read':!![]});}else{logger[_0x1a4c('0x2a')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0x1a4c('0x87')](_0x4908e5[_0x1a4c('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x45fd38;}})[_0x1a4c('0x24')](respondWithResult(_0x19c791,null))[_0x1a4c('0x2e')](handleError(_0x19c791,null));}; \ No newline at end of file +var _0x33a6=['register','jayson/promise','http','client','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','include','show','params','keys','includeAll','options','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','UserId','user','agent','get','WhatsappInteraction','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','sequelize','Sequelize','QueryTypes','contact','fullname','email','internal','manual','channel','EventManager','acceptmessage','reject','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','User','interface','SIP/%s','motionChannel','event','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket'];(function(_0xe8f0d6,_0x18d367){var _0xf1d1e5=function(_0x4c6dcd){while(--_0x4c6dcd){_0xe8f0d6['push'](_0xe8f0d6['shift']());}};_0xf1d1e5(++_0x18d367);}(_0x33a6,0x188));var _0x633a=function(_0xf5db43,_0x1760e3){_0xf5db43=_0xf5db43-0x0;var _0x2fcd0d=_0x33a6[_0xf5db43];return _0x2fcd0d;};'use strict';var emlformat=require(_0x633a('0x0'));var rimraf=require(_0x633a('0x1'));var zipdir=require(_0x633a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x633a('0x3'));var moment=require(_0x633a('0x4'));var BPromise=require(_0x633a('0x5'));var Mustache=require(_0x633a('0x6'));var util=require('util');var path=require(_0x633a('0x7'));var sox=require(_0x633a('0x8'));var csv=require(_0x633a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x633a('0xa'));var squel=require('squel');var crypto=require(_0x633a('0xb'));var jsforce=require(_0x633a('0xc'));var deskjs=require(_0x633a('0xd'));var toCsv=require(_0x633a('0x9'));var querystring=require(_0x633a('0xe'));var Papa=require(_0x633a('0xf'));var Redis=require('ioredis');var authService=require(_0x633a('0x10'));var qs=require(_0x633a('0x11'));var as=require(_0x633a('0x12'));var hardwareService=require(_0x633a('0x13'));var logger=require(_0x633a('0x14'))(_0x633a('0x15'));var utils=require(_0x633a('0x16'));var config=require(_0x633a('0x17'));var licenseUtil=require(_0x633a('0x18'));var db=require(_0x633a('0x19'))['db'];config[_0x633a('0x1a')]=_[_0x633a('0x1b')](config['redis'],{'host':_0x633a('0x1c'),'port':0x18eb});var socket=require(_0x633a('0x1d'))(new Redis(config[_0x633a('0x1a')]));require(_0x633a('0x1e'))[_0x633a('0x1f')](socket);var jayson=require(_0x633a('0x20'));var client=jayson['client'][_0x633a('0x21')]({'port':0x232c});var client9002=jayson[_0x633a('0x22')][_0x633a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3a304e,_0x125bce,_0x535ccd,_0x1a8c11){return new BPromise(function(_0x47c8e7,_0x1fbb9f){var _0x24668f=_0x1a8c11||client;return _0x24668f[_0x633a('0x23')](_0x3a304e,_0x535ccd)[_0x633a('0x24')](function(_0x1832c0){logger[_0x633a('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x125bce,_0x633a('0x26'));logger[_0x633a('0x27')](_0x633a('0x28'),_0x125bce,_0x633a('0x26'),JSON[_0x633a('0x29')](_0x1832c0));if(_0x1832c0[_0x633a('0x2a')]){if(_0x1832c0['error'][_0x633a('0x2b')]===0x1f4){logger[_0x633a('0x2a')](_0x633a('0x2c'),_0x125bce,_0x1832c0[_0x633a('0x2a')][_0x633a('0x2d')]);return _0x1fbb9f(_0x1832c0[_0x633a('0x2a')][_0x633a('0x2d')]);}logger[_0x633a('0x2a')](_0x633a('0x2c'),_0x125bce,_0x1832c0[_0x633a('0x2a')]['message']);return _0x47c8e7(_0x1832c0[_0x633a('0x2a')]['message']);}else{logger[_0x633a('0x25')](_0x633a('0x2c'),_0x125bce,_0x633a('0x26'));_0x47c8e7(_0x1832c0['result'][_0x633a('0x2d')]);}})[_0x633a('0x2e')](function(_0x2419dc){logger[_0x633a('0x2a')](_0x633a('0x2c'),_0x125bce,_0x2419dc);_0x1fbb9f(_0x2419dc);});});}function respondWithStatusCode(_0x35f4a5,_0x233310){_0x233310=_0x233310||0xcc;return function(_0x358543){if(_0x358543){return _0x35f4a5[_0x633a('0x2f')](_0x233310);}return _0x35f4a5[_0x633a('0x30')](_0x233310)[_0x633a('0x31')]();};}function respondWithResult(_0x2fd765,_0x37a50a){_0x37a50a=_0x37a50a||0xc8;return function(_0x27c1a8){if(_0x27c1a8){return _0x2fd765['status'](_0x37a50a)[_0x633a('0x32')](_0x27c1a8);}};}function respondWithFilteredResult(_0x6fd28c,_0x2f5502){return function(_0x54a2be){if(_0x54a2be){var _0x339bd1=typeof _0x2f5502[_0x633a('0x33')]===_0x633a('0x34')&&typeof _0x2f5502[_0x633a('0x35')]==='undefined';var _0x3c2899=_0x54a2be[_0x633a('0x36')];var _0x2086f8=_0x339bd1?0x0:_0x2f5502['offset'];var _0x5da75e=_0x339bd1?_0x54a2be[_0x633a('0x36')]:_0x2f5502['offset']+_0x2f5502['limit'];var _0x466752;if(_0x5da75e>=_0x3c2899){_0x5da75e=_0x3c2899;_0x466752=0xc8;}else{_0x466752=0xce;}_0x6fd28c[_0x633a('0x30')](_0x466752);return _0x6fd28c[_0x633a('0x37')](_0x633a('0x38'),_0x2086f8+'-'+_0x5da75e+'/'+_0x3c2899)[_0x633a('0x32')](_0x54a2be);}return null;};}function patchUpdates(_0x42dac1){return function(_0x590be3){try{jsonpatch['apply'](_0x590be3,_0x42dac1,!![]);}catch(_0x2f92cc){return BPromise['reject'](_0x2f92cc);}return _0x590be3['save']();};}function saveUpdates(_0x1611c7,_0x4838d6){return function(_0x3181c1){if(_0x3181c1){return _0x3181c1[_0x633a('0x39')](_0x1611c7)[_0x633a('0x24')](function(_0x3d2784){return _0x3d2784;});}return null;};}function removeEntity(_0xdd0335,_0x5190dd){return function(_0x5a309f){if(_0x5a309f){return _0x5a309f[_0x633a('0x3a')]()[_0x633a('0x24')](function(){_0xdd0335['status'](0xcc)[_0x633a('0x31')]();});}};}function handleEntityNotFound(_0x1ab1d2,_0x125c95){return function(_0x426e6f){if(!_0x426e6f){_0x1ab1d2[_0x633a('0x2f')](0x194);}return _0x426e6f;};}function handleError(_0x388283,_0xdb8ecf){_0xdb8ecf=_0xdb8ecf||0x1f4;return function(_0x499447){logger[_0x633a('0x2a')](_0x499447[_0x633a('0x3b')]);if(_0x499447[_0x633a('0x3c')]){delete _0x499447[_0x633a('0x3c')];}_0x388283[_0x633a('0x30')](_0xdb8ecf)[_0x633a('0x3d')](_0x499447);};}exports[_0x633a('0x3e')]=function(_0x34f741,_0x276fd3){var _0x1d250={},_0x568dbf={},_0x2a44e5={'count':0x0,'rows':[]};var _0x2e2850=_['map'](db[_0x633a('0x3f')][_0x633a('0x40')],function(_0x5c2dc5){return{'name':_0x5c2dc5['fieldName'],'type':_0x5c2dc5['type'][_0x633a('0x41')]};});_0x568dbf[_0x633a('0x42')]=_[_0x633a('0x43')](_0x2e2850,_0x633a('0x3c'));_0x568dbf[_0x633a('0x44')]=_['keys'](_0x34f741[_0x633a('0x44')]);_0x568dbf[_0x633a('0x45')]=_[_0x633a('0x46')](_0x568dbf[_0x633a('0x42')],_0x568dbf[_0x633a('0x44')]);_0x1d250['attributes']=_[_0x633a('0x46')](_0x568dbf[_0x633a('0x42')],qs[_0x633a('0x47')](_0x34f741[_0x633a('0x44')][_0x633a('0x47')]));_0x1d250[_0x633a('0x48')]=_0x1d250['attributes'][_0x633a('0x49')]?_0x1d250[_0x633a('0x48')]:_0x568dbf[_0x633a('0x42')];if(!_0x34f741[_0x633a('0x44')]['hasOwnProperty'](_0x633a('0x4a'))){_0x1d250[_0x633a('0x35')]=qs[_0x633a('0x35')](_0x34f741[_0x633a('0x44')][_0x633a('0x35')]);_0x1d250[_0x633a('0x33')]=qs[_0x633a('0x33')](_0x34f741['query'][_0x633a('0x33')]);}_0x1d250[_0x633a('0x4b')]=qs[_0x633a('0x4c')](_0x34f741[_0x633a('0x44')][_0x633a('0x4c')]);_0x1d250['where']=qs[_0x633a('0x45')](_[_0x633a('0x4d')](_0x34f741[_0x633a('0x44')],_0x568dbf[_0x633a('0x45')]),_0x2e2850);if(_0x34f741['query']['filter']){_0x1d250[_0x633a('0x4e')]=_['merge'](_0x1d250[_0x633a('0x4e')],{'$or':_['map'](_0x2e2850,function(_0x30bf1f){if(_0x30bf1f[_0x633a('0x4f')]!==_0x633a('0x50')){var _0x5b1ed1={};_0x5b1ed1[_0x30bf1f['name']]={'$like':'%'+_0x34f741[_0x633a('0x44')][_0x633a('0x51')]+'%'};return _0x5b1ed1;}})});}_0x1d250=_[_0x633a('0x52')]({},_0x1d250,_0x34f741['options']);var _0x3350f9={'where':_0x1d250[_0x633a('0x4e')]};return db[_0x633a('0x3f')][_0x633a('0x36')](_0x3350f9)[_0x633a('0x24')](function(_0x5d002f){_0x2a44e5['count']=_0x5d002f;if(_0x34f741[_0x633a('0x44')]['includeAll']){_0x1d250[_0x633a('0x53')]=[{'all':!![]}];}return db[_0x633a('0x3f')]['findAll'](_0x1d250);})[_0x633a('0x24')](function(_0x4b8832){_0x2a44e5['rows']=_0x4b8832;return _0x2a44e5;})[_0x633a('0x24')](respondWithFilteredResult(_0x276fd3,_0x1d250))[_0x633a('0x2e')](handleError(_0x276fd3,null));};exports[_0x633a('0x54')]=function(_0x49767b,_0x10bd6d){var _0x5dfbca={'raw':!![],'where':{'id':_0x49767b[_0x633a('0x55')]['id']}},_0x50180a={};_0x50180a[_0x633a('0x42')]=_[_0x633a('0x56')](db['WhatsappMessage'][_0x633a('0x40')]);_0x50180a[_0x633a('0x44')]=_[_0x633a('0x56')](_0x49767b[_0x633a('0x44')]);_0x50180a[_0x633a('0x45')]=_[_0x633a('0x46')](_0x50180a[_0x633a('0x42')],_0x50180a[_0x633a('0x44')]);_0x5dfbca[_0x633a('0x48')]=_[_0x633a('0x46')](_0x50180a['model'],qs[_0x633a('0x47')](_0x49767b[_0x633a('0x44')][_0x633a('0x47')]));_0x5dfbca[_0x633a('0x48')]=_0x5dfbca[_0x633a('0x48')][_0x633a('0x49')]?_0x5dfbca[_0x633a('0x48')]:_0x50180a[_0x633a('0x42')];if(_0x49767b[_0x633a('0x44')][_0x633a('0x57')]){_0x5dfbca[_0x633a('0x53')]=[{'all':!![]}];}_0x5dfbca=_[_0x633a('0x52')]({},_0x5dfbca,_0x49767b[_0x633a('0x58')]);return db[_0x633a('0x3f')][_0x633a('0x59')](_0x5dfbca)[_0x633a('0x24')](handleEntityNotFound(_0x10bd6d,null))[_0x633a('0x24')](respondWithResult(_0x10bd6d,null))['catch'](handleError(_0x10bd6d,null));};exports[_0x633a('0x5a')]=function(_0x3a6bed,_0x283a66){return db['WhatsappMessage'][_0x633a('0x5a')](_0x3a6bed[_0x633a('0x5b')],{})[_0x633a('0x24')](respondWithResult(_0x283a66,0xc9))[_0x633a('0x2e')](handleError(_0x283a66,null));};exports[_0x633a('0x39')]=function(_0x3d82d2,_0x5ae3e0){if(_0x3d82d2[_0x633a('0x5b')]['id']){delete _0x3d82d2[_0x633a('0x5b')]['id'];}return db[_0x633a('0x3f')][_0x633a('0x59')]({'where':{'id':_0x3d82d2['params']['id']}})[_0x633a('0x24')](handleEntityNotFound(_0x5ae3e0,null))[_0x633a('0x24')](saveUpdates(_0x3d82d2['body'],null))['then'](respondWithResult(_0x5ae3e0,null))['catch'](handleError(_0x5ae3e0,null));};exports[_0x633a('0x3a')]=function(_0x5b6ea6,_0x172ca9){return db[_0x633a('0x3f')][_0x633a('0x59')]({'where':{'id':_0x5b6ea6[_0x633a('0x55')]['id']}})[_0x633a('0x24')](handleEntityNotFound(_0x172ca9,null))[_0x633a('0x24')](removeEntity(_0x172ca9,null))['catch'](handleError(_0x172ca9,null));};exports[_0x633a('0x5c')]=function(_0x7a8a24,_0x100676){return db[_0x633a('0x3f')]['describe']()[_0x633a('0x24')](respondWithResult(_0x100676,null))[_0x633a('0x2e')](handleError(_0x100676,null));};var interaction_log=require(_0x633a('0x14'))(_0x633a('0x5d'));exports[_0x633a('0x5e')]=function(_0x53be8e,_0x5c89ad,_0x54d076){var _0x59ce8c={'agent':{},'channel':_0x633a('0x5f')};if(_0x53be8e[_0x633a('0x5b')]['id']){delete _0x53be8e[_0x633a('0x5b')]['id'];}_0x53be8e[_0x633a('0x5b')][_0x633a('0x60')]=!![];_0x53be8e[_0x633a('0x5b')][_0x633a('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x53be8e[_0x633a('0x5b')][_0x633a('0x62')]=_0x53be8e['body'][_0x633a('0x62')]||_0x53be8e[_0x633a('0x63')]['id'];_0x59ce8c[_0x633a('0x64')]['id']=_0x53be8e['body'][_0x633a('0x62')];return db[_0x633a('0x3f')][_0x633a('0x59')]({'where':{'id':_0x53be8e['params']['id'],'UserId':null}})[_0x633a('0x24')](handleEntityNotFound(_0x5c89ad,null))['then'](saveUpdates(_0x53be8e[_0x633a('0x5b')],null))[_0x633a('0x24')](function(_0x15a13c){if(_0x15a13c){_0x59ce8c[_0x633a('0x2d')]=_0x15a13c[_0x633a('0x65')]({'plain':!![]});return db[_0x633a('0x66')][_0x633a('0x59')]({'where':{'id':_0x15a13c['WhatsappInteractionId']}});}return null;})[_0x633a('0x24')](handleEntityNotFound(_0x5c89ad,null))[_0x633a('0x24')](function(_0x2cbccb){if(_0x2cbccb){return _0x2cbccb[_0x633a('0x39')]({'UserId':_0x53be8e['body'][_0x633a('0x62')],'read1stAt':_['isNil'](_0x2cbccb[_0x633a('0x67')])?moment()[_0x633a('0x68')](_0x633a('0x69')):undefined});}return null;})[_0x633a('0x24')](function(_0x516690){if(_0x516690){_0x59ce8c[_0x633a('0x6a')]=_0x516690[_0x633a('0x65')]({'plain':!![]});interaction_log['info'](_0x633a('0x6b'),_0x53be8e[_0x633a('0x63')]['id'],_0x53be8e['user']['name'],_0x53be8e[_0x633a('0x63')]['role'],_0x59ce8c[_0x633a('0x6a')]['id'],_0x53be8e[_0x633a('0x5b')]?JSON[_0x633a('0x29')](_0x53be8e['body']):_0x633a('0x6c'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x59ce8c);}return null;})[_0x633a('0x24')](function(_0x7ebc72){var _0x40f735='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x7ebc72[_0x633a('0x2d')]['ContactId'];return db[_0x633a('0x6d')]['query'](_0x40f735,{'type':db[_0x633a('0x6e')][_0x633a('0x6f')]['SELECT'],'raw':!![]})[_0x633a('0x24')](function(_0x372fb7){return _0x372fb7;});})[_0x633a('0x24')](function(_0x8cf6aa){if(_0x8cf6aa){_0x59ce8c[_0x633a('0x2d')][_0x633a('0x70')]=_0x8cf6aa[0x0];if(!_0x53be8e[_0x633a('0x5b')][_0x633a('0x62')])return;return db['User'][_0x633a('0x59')]({'where':{'id':_0x53be8e['body']['UserId'],'role':_0x633a('0x64')},'attributes':['id',_0x633a('0x3c'),_0x633a('0x71'),_0x633a('0x72'),_0x633a('0x73')],'raw':!![]});}return null;})[_0x633a('0x24')](function(_0x367af2){if(!_0x367af2)return null;_0x59ce8c[_0x633a('0x2d')][_0x633a('0x64')]=_0x367af2;return _0x59ce8c;})[_0x633a('0x24')](function(_0x28a42a){if(_0x28a42a){if(_0x53be8e[_0x633a('0x5b')][_0x633a('0x74')]){_0x59ce8c[_0x633a('0x2d')]['interface']=util[_0x633a('0x68')]('SIP/%s',_0x53be8e['user'][_0x633a('0x3c')]);_0x59ce8c[_0x633a('0x2d')][_0x633a('0x75')]=_0x59ce8c[_0x633a('0x75')];_0x59ce8c[_0x633a('0x2d')]['motionChannel']=_0x59ce8c['channel'];_0x59ce8c['message']['event']=_0x633a('0x5e');return respondWithRpcPromise(_0x633a('0x76'),'EventManager',{'event':_0x633a('0x77'),'message':_0x59ce8c[_0x633a('0x2d')]},client9002)[_0x633a('0x24')](function(){return _0x59ce8c;});}return _0x59ce8c;}return null;})[_0x633a('0x24')](respondWithResult(_0x5c89ad,null))[_0x633a('0x2e')](handleError(_0x5c89ad,null));};var interaction_log=require('../../config/logger')(_0x633a('0x5d'));exports[_0x633a('0x78')]=function(_0x1b110c,_0x50acaf,_0x1f5669){var _0x29a8f1={'agent':{},'channel':_0x633a('0x5f')};if(_0x1b110c[_0x633a('0x5b')]['id']){delete _0x1b110c[_0x633a('0x5b')]['id'];}_0x1b110c[_0x633a('0x5b')]['UserId']=_0x1b110c[_0x633a('0x5b')][_0x633a('0x62')]||_0x1b110c[_0x633a('0x63')]['id'];_0x29a8f1['agent']['id']=_0x1b110c[_0x633a('0x5b')][_0x633a('0x62')];return db[_0x633a('0x3f')][_0x633a('0x59')]({'where':{'id':_0x1b110c[_0x633a('0x55')]['id'],'UserId':null}})[_0x633a('0x24')](handleEntityNotFound(_0x50acaf,null))[_0x633a('0x24')](function(_0x14a4fd){if(_0x14a4fd){_0x29a8f1[_0x633a('0x2d')]=_0x14a4fd[_0x633a('0x65')]({'plain':!![]});return db['WhatsappInteraction'][_0x633a('0x59')]({'where':{'id':_0x14a4fd[_0x633a('0x79')]}});}return null;})[_0x633a('0x24')](handleEntityNotFound(_0x50acaf,null))[_0x633a('0x24')](function(_0x253a9e){if(_0x253a9e){_0x29a8f1['interaction']=_0x253a9e[_0x633a('0x65')]({'plain':!![]});interaction_log['info'](_0x633a('0x7a'),_0x1b110c[_0x633a('0x63')]['id'],_0x1b110c[_0x633a('0x63')]['name'],_0x1b110c[_0x633a('0x63')][_0x633a('0x7b')],_0x29a8f1['interaction']['id'],_0x1b110c['body']?JSON[_0x633a('0x29')](_0x1b110c[_0x633a('0x5b')]):'null');return respondWithRpcPromise(_0x633a('0x7c'),'rejectMessage',_0x29a8f1);}return null;})['then'](function(_0x21a019){var _0x3c3e45=_0x633a('0x7d')+_0x21a019[_0x633a('0x2d')]['ContactId'];return db['sequelize']['query'](_0x3c3e45,{'type':db['Sequelize'][_0x633a('0x6f')][_0x633a('0x7e')],'raw':!![]})[_0x633a('0x24')](function(_0x2cfc22){return _0x2cfc22;});})[_0x633a('0x24')](function(_0x479d8e){if(_0x479d8e){_0x29a8f1['message']['contact']=_0x479d8e[0x0];if(!_0x1b110c[_0x633a('0x5b')][_0x633a('0x62')])return;return db[_0x633a('0x7f')][_0x633a('0x59')]({'where':{'id':_0x1b110c[_0x633a('0x5b')][_0x633a('0x62')],'role':_0x633a('0x64')},'attributes':['id',_0x633a('0x3c'),_0x633a('0x71'),_0x633a('0x72'),_0x633a('0x73')],'raw':!![]});}return null;})[_0x633a('0x24')](function(_0x160e9c){if(!_0x160e9c)return null;_0x29a8f1[_0x633a('0x2d')]['agent']=_0x160e9c;return _0x29a8f1;})[_0x633a('0x24')](function(_0x799e96){if(_0x799e96){_0x799e96[_0x633a('0x2d')][_0x633a('0x80')]=util['format'](_0x633a('0x81'),_0x1b110c[_0x633a('0x63')][_0x633a('0x3c')]);_0x799e96[_0x633a('0x2d')][_0x633a('0x75')]=_0x29a8f1['channel'];_0x799e96['message'][_0x633a('0x82')]=_0x29a8f1[_0x633a('0x75')];_0x799e96[_0x633a('0x2d')][_0x633a('0x83')]=_0x633a('0x78');respondWithRpcPromise(_0x633a('0x76'),_0x633a('0x76'),{'event':_0x633a('0x84'),'message':_0x799e96[_0x633a('0x2d')]},client9002);return _0x29a8f1;}return null;})[_0x633a('0x24')](respondWithResult(_0x50acaf,null))[_0x633a('0x2e')](handleError(_0x50acaf,null));};exports[_0x633a('0x30')]=function(_0x2cd9d8,_0x209c35,_0x1c51f7){if(_0x2cd9d8['body']['id']){delete _0x2cd9d8[_0x633a('0x5b')]['id'];}var _0x3e8875;return db[_0x633a('0x3f')]['find']({'where':{'id':_0x2cd9d8[_0x633a('0x55')]['id']}})[_0x633a('0x24')](handleEntityNotFound(_0x209c35,null))[_0x633a('0x24')](function(_0x462a60){if(_0x462a60){_0x3e8875=_0x462a60;return db[_0x633a('0x85')][_0x633a('0x59')]({'where':{'id':_0x462a60['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x209c35,null))[_0x633a('0x24')](function(_0x1212d4){if(_0x1212d4){logger[_0x633a('0x27')](_0x633a('0x86'),_0x633a('0x30'),_0x633a('0x87'),_0x1212d4[_0x633a('0x4f')],util[_0x633a('0x88')](_0x2cd9d8[_0x633a('0x5b')],{'showHidden':![],'depth':null}));switch(_0x1212d4[_0x633a('0x4f')]){case _0x633a('0x89'):if(_0x2cd9d8[_0x633a('0x5b')][_0x633a('0x8a')]&&_0x2cd9d8[_0x633a('0x5b')]['MessageSid']===_0x3e8875[_0x633a('0x8b')]&&_0x2cd9d8['body'][_0x633a('0x8c')]&&_0x2cd9d8[_0x633a('0x5b')][_0x633a('0x8c')]===_0x633a('0x60')){return _0x3e8875[_0x633a('0x39')]({'read':!![]});}else{logger[_0x633a('0x2a')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x633a('0x30'),_0x633a('0x89'),util[_0x633a('0x88')](_0x2cd9d8['body'],{'showHidden':![],'depth':null}));}break;}return _0x3e8875;}})[_0x633a('0x24')](respondWithResult(_0x209c35,null))[_0x633a('0x2e')](handleError(_0x209c35,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 7f9c5a1..f685dcc 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 _0x7894=['WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7894,0x170));var _0x4789=function(_0x12b262,_0x4df595){_0x12b262=_0x12b262-0x0;var _0x24d799=_0x7894[_0x12b262];return _0x24d799;};'use strict';var EventEmitter=require(_0x4789('0x0'));var WhatsappMessage=require(_0x4789('0x1'))['db'][_0x4789('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4789('0x3')](0x0);var events={'afterCreate':_0x4789('0x4'),'afterUpdate':_0x4789('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd4bd76){return function(_0x2b2dd3,_0x4e2393,_0x3394f6){WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76+':'+_0x2b2dd3['id'],_0x2b2dd3);WhatsappMessageEvents[_0x4789('0x6')](_0xd4bd76,_0x2b2dd3);_0x3394f6(null);};}for(var e in events){if(events[_0x4789('0x7')](e)){var event=events[e];WhatsappMessage[_0x4789('0x8')](e,emitEvent(event));}}module[_0x4789('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x153f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage'];(function(_0xfb38c3,_0x48e1c0){var _0x13105d=function(_0xd2b3ec){while(--_0xd2b3ec){_0xfb38c3['push'](_0xfb38c3['shift']());}};_0x13105d(++_0x48e1c0);}(_0x153f,0x15b));var _0xf153=function(_0x53ab39,_0x3dfc2e){_0x53ab39=_0x53ab39-0x0;var _0x24c1e6=_0x153f[_0x53ab39];return _0x24c1e6;};'use strict';var EventEmitter=require(_0xf153('0x0'));var WhatsappMessage=require(_0xf153('0x1'))['db'][_0xf153('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf153('0x3')](0x0);var events={'afterCreate':_0xf153('0x4'),'afterUpdate':_0xf153('0x5'),'afterDestroy':_0xf153('0x6')};function emitEvent(_0x59757c){return function(_0x364e65,_0x5c49c7,_0x1f9ead){WhatsappMessageEvents[_0xf153('0x7')](_0x59757c+':'+_0x364e65['id'],_0x364e65);WhatsappMessageEvents[_0xf153('0x7')](_0x59757c,_0x364e65);_0x1f9ead(null);};}for(var e in events){if(events[_0xf153('0x8')](e)){var event=events[e];WhatsappMessage[_0xf153('0x9')](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 a6a9ac1..6f101a1 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 _0x0532=['create','whatsapp:','remote','/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','Bearer\x20','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','./whatsappMessage.attributes','define','WhatsappMessage','messageId','body','get','direction','toLowerCase','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','authToken','messages'];(function(_0x144a40,_0x4787bb){var _0x294c2a=function(_0x40b18){while(--_0x40b18){_0x144a40['push'](_0x144a40['shift']());}};_0x294c2a(++_0x4787bb);}(_0x0532,0x16c));var _0x2053=function(_0x4927eb,_0x517b62){_0x4927eb=_0x4927eb-0x0;var _0x580161=_0x0532[_0x4927eb];return _0x580161;};'use strict';var _=require(_0x2053('0x0'));var util=require(_0x2053('0x1'));var logger=require(_0x2053('0x2'))(_0x2053('0x3'));var moment=require(_0x2053('0x4'));var BPromise=require('bluebird');var rp=require(_0x2053('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x2053('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2053('0x7'));module['exports']=function(_0x3632c6,_0x148226){return _0x3632c6[_0x2053('0x8')](_0x2053('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x2053('0xa'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0x2053('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51a796,_0x27e830,_0x29606c){var _0x2dfd5f=_0x3632c6['models'];var _0x58804b=_0x51a796[_0x2053('0xc')]({'plain':!![]});if(_0x58804b[_0x2053('0xd')]['toLowerCase']()==='in'||_0x58804b[_0x2053('0xd')][_0x2053('0xe')]()==='out'&&!_0x58804b[_0x2053('0xf')]&&!_['isNil'](_0x58804b[_0x2053('0x10')])){_0x2dfd5f[_0x2053('0x11')][_0x2053('0x12')]({'where':{'id':_0x58804b[_0x2053('0x13')]}})[_0x2053('0x14')](function(_0x55e69b){if(_0x55e69b){_0x55e69b[_0x2053('0x15')]({'lastMsgAt':_0x58804b[_0x2053('0x16')],'lastMsgDirection':_0x58804b[_0x2053('0xd')]['toLowerCase']()});}})[_0x2053('0x17')](function(_0xb70e3f){console[_0x2053('0x18')](_0xb70e3f);});}if(_0x58804b[_0x2053('0xd')]===_0x2053('0x19')&&!_0x58804b[_0x2053('0xf')]){var _0x6265a0;_0x2dfd5f[_0x2053('0x1a')][_0x2053('0x1b')]({'where':{'id':_0x58804b[_0x2053('0x1c')]},'raw':!![]})[_0x2053('0x14')](function(_0x2ac201){_0x6265a0=_0x2ac201;if(_0x6265a0&&_0x6265a0[_0x2053('0x1d')]){switch(_0x6265a0['type']){case _0x2053('0x1e'):var _0x4d377b=require(_0x2053('0x1e'));if(_0x6265a0[_0x2053('0x1f')]&&_0x6265a0['authToken']&&_0x6265a0[_0x2053('0x20')]){var _0x158fb1=new _0x4d377b(_0x6265a0[_0x2053('0x1f')],_0x6265a0[_0x2053('0x21')]);_0x158fb1[_0x2053('0x22')][_0x2053('0x23')]({'body':_0x58804b[_0x2053('0xb')],'to':_0x2053('0x24')+_0x58804b[_0x2053('0x20')],'from':'whatsapp:'+_0x6265a0['phone'],'statusCallback':_0x6265a0[_0x2053('0x25')]+_0x2053('0x26')+_0x58804b['id']+'/status?token='+_0x6265a0[_0x2053('0x27')]})[_0x2053('0x14')](function(_0x4d1ce2){if(_0x4d1ce2[_0x2053('0x28')]){return _0x51a796[_0x2053('0x15')]({'messageId':_0x4d1ce2[_0x2053('0x28')]});}})[_0x2053('0x17')](function(_0x50a561){logger[_0x2053('0x18')](_0x2053('0x29'),_0x2053('0x2a'),_0x2053('0x1e'),util[_0x2053('0x2b')](_0x50a561,{'showHidden':![],'depth':null}));});}else{logger[_0x2053('0x18')](_0x2053('0x29'),_0x2053('0x2a'),'twilio',_0x2053('0x2c'));}break;case _0x2053('0x2d'):var _0x234cb4=_0x6265a0[_0x2053('0x1f')];var _0x8a395e=_0x6265a0['authToken'];var _0x28fbbb=_0x6265a0[_0x2053('0x2e')]+_0x2053('0x2f')+_0x234cb4+_0x2053('0x30');var _0xeb8f67={'to':[_0x58804b[_0x2053('0x20')]],'message':{'type':'text','text':_0x58804b['body']}};var _0x5314eb={'method':_0x2053('0x31'),'uri':_0x28fbbb,'headers':{'Authorization':_0x2053('0x32')+_0x8a395e,'Content-Type':_0x2053('0x33')},'body':_0xeb8f67,'json':!![]};rp(_0x5314eb)[_0x2053('0x14')](function(_0x1d3eb6){if(_0x1d3eb6['statuses'][0x0][_0x2053('0x34')]){return _0x51a796['update']({'messageId':_0x1d3eb6[_0x2053('0x35')][0x0]['message_id']});}})['catch'](function(_0x5b5427){logger[_0x2053('0x36')](_0x2053('0x37'),_0x5b5427);});break;}}})['finally'](function(){_0x29606c();});}else{_0x29606c();}}},'charset':'utf8mb4','collate':_0x2053('0x38')});}; \ No newline at end of file +var _0x4337=['twilio','accountSid','authToken','messages','create','body','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','update','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','messageId','FULLTEXT','models','toLowerCase','direction','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','catch','secret','WhatsappAccount','find','type'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x4337,0x16e));var _0x7433=function(_0x2ec2a6,_0x1244e7){_0x2ec2a6=_0x2ec2a6-0x0;var _0x57ece7=_0x4337[_0x2ec2a6];return _0x57ece7;};'use strict';var _=require('lodash');var util=require(_0x7433('0x0'));var logger=require('../../config/logger')(_0x7433('0x1'));var moment=require(_0x7433('0x2'));var BPromise=require(_0x7433('0x3'));var rp=require(_0x7433('0x4'));var fetch=require(_0x7433('0x5'));var fs=require('fs');var path=require(_0x7433('0x6'));var rimraf=require(_0x7433('0x7'));var config=require(_0x7433('0x8'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x5b2902,_0xb83a0c){return _0x5b2902['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x7433('0x9'),'fields':[_0x7433('0x9')]},{'name':'fti_whatsapp_messages','fields':['body'],'type':_0x7433('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x250c3c,_0x130baf,_0x26d046){var _0x11b5c0=_0x5b2902[_0x7433('0xb')];var _0x1b9049=_0x250c3c['get']({'plain':!![]});if(_0x1b9049['direction'][_0x7433('0xc')]()==='in'||_0x1b9049[_0x7433('0xd')][_0x7433('0xc')]()===_0x7433('0xe')&&!_0x1b9049['secret']&&!_[_0x7433('0xf')](_0x1b9049[_0x7433('0x10')])){_0x11b5c0[_0x7433('0x11')][_0x7433('0x12')]({'where':{'id':_0x1b9049[_0x7433('0x13')]}})[_0x7433('0x14')](function(_0x32c6a9){if(_0x32c6a9){_0x32c6a9['update']({'lastMsgAt':_0x1b9049['createdAt'],'lastMsgDirection':_0x1b9049['direction']['toLowerCase']()});}})[_0x7433('0x15')](function(_0xb2780d){console['error'](_0xb2780d);});}if(_0x1b9049[_0x7433('0xd')]===_0x7433('0xe')&&!_0x1b9049[_0x7433('0x16')]){var _0x13284f;_0x11b5c0[_0x7433('0x17')][_0x7433('0x18')]({'where':{'id':_0x1b9049['WhatsappAccountId']},'raw':!![]})[_0x7433('0x14')](function(_0x1c0ebe){_0x13284f=_0x1c0ebe;if(_0x13284f&&_0x13284f[_0x7433('0x19')]){switch(_0x13284f[_0x7433('0x19')]){case _0x7433('0x1a'):var _0x21b3b7=require('twilio');if(_0x13284f[_0x7433('0x1b')]&&_0x13284f[_0x7433('0x1c')]&&_0x13284f['phone']){var _0x1a2221=new _0x21b3b7(_0x13284f[_0x7433('0x1b')],_0x13284f[_0x7433('0x1c')]);_0x1a2221[_0x7433('0x1d')][_0x7433('0x1e')]({'body':_0x1b9049[_0x7433('0x1f')],'to':_0x7433('0x20')+_0x1b9049['phone'],'from':_0x7433('0x20')+_0x13284f[_0x7433('0x21')],'statusCallback':_0x13284f['remote']+_0x7433('0x22')+_0x1b9049['id']+_0x7433('0x23')+_0x13284f[_0x7433('0x24')]})[_0x7433('0x14')](function(_0x5ea3f1){if(_0x5ea3f1['sid']){return _0x250c3c[_0x7433('0x25')]({'messageId':_0x5ea3f1[_0x7433('0x26')]});}})[_0x7433('0x15')](function(_0x45a8ec){logger[_0x7433('0x27')](_0x7433('0x28'),_0x7433('0x29'),_0x7433('0x1a'),util['inspect'](_0x45a8ec,{'showHidden':![],'depth':null}));});}else{logger[_0x7433('0x27')](_0x7433('0x28'),_0x7433('0x29'),_0x7433('0x1a'),_0x7433('0x2a'));}break;case _0x7433('0x2b'):var _0x4da178=_0x13284f[_0x7433('0x1b')];var _0x4d03ae=_0x13284f['authToken'];var _0x214346=_0x13284f[_0x7433('0x2c')]+_0x7433('0x2d')+_0x4da178+_0x7433('0x2e');var _0x3cad21={'to':[_0x1b9049['phone']],'message':{'type':_0x7433('0x2f'),'text':_0x1b9049[_0x7433('0x1f')]}};var _0x23d2de={'method':_0x7433('0x30'),'uri':_0x214346,'headers':{'Authorization':_0x7433('0x31')+_0x4d03ae,'Content-Type':_0x7433('0x32')},'body':_0x3cad21,'json':!![]};rp(_0x23d2de)['then'](function(_0x105059){if(_0x105059[_0x7433('0x33')][0x0][_0x7433('0x34')]){return _0x250c3c[_0x7433('0x25')]({'messageId':_0x105059[_0x7433('0x33')][0x0][_0x7433('0x34')]});}})[_0x7433('0x15')](function(_0x5c0146){logger['err'](_0x7433('0x35'),_0x5c0146);});break;}}})['finally'](function(){_0x26d046();});}else{_0x26d046();}}},'charset':_0x7433('0x36'),'collate':_0x7433('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index da9526c..55d3dfd 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 _0x8274=['../../config/logger','rpc','jayson/promise','http','localhost','socket.io-emitter','./whatsappMessage.socket','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x8274,0xf2));var _0x4827=function(_0x588d6d,_0x2ab9ac){_0x588d6d=_0x588d6d-0x0;var _0x26fa0a=_0x8274[_0x588d6d];return _0x26fa0a;};'use strict';var _=require(_0x4827('0x0'));var util=require(_0x4827('0x1'));var moment=require('moment');var BPromise=require(_0x4827('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4827('0x3'));var db=require(_0x4827('0x4'))['db'];var utils=require(_0x4827('0x5'));var logger=require(_0x4827('0x6'))(_0x4827('0x7'));var config=require('../../config/environment');var jayson=require(_0x4827('0x8'));var client=jayson['client'][_0x4827('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x4827('0xa'),'port':0x18eb});var socket=require(_0x4827('0xb'))(new Redis(config['redis']));require(_0x4827('0xc'))['register'](socket);function respondWithRpcPromise(_0x4fe4fe,_0x2fd1e3,_0xe31667){return new BPromise(function(_0x2f9ff3,_0x298858){return client['request'](_0x4fe4fe,_0xe31667)[_0x4827('0xd')](function(_0x366399){logger[_0x4827('0xe')](_0x4827('0xf'),_0x2fd1e3,_0x4827('0x10'));logger[_0x4827('0x11')](_0x4827('0x12'),_0x2fd1e3,_0x4827('0x10'),JSON[_0x4827('0x13')](_0x366399));if(_0x366399[_0x4827('0x14')]){if(_0x366399[_0x4827('0x14')][_0x4827('0x15')]===0x1f4){logger['error'](_0x4827('0xf'),_0x2fd1e3,_0x366399[_0x4827('0x14')][_0x4827('0x16')]);return _0x298858(_0x366399[_0x4827('0x14')][_0x4827('0x16')]);}logger['error'](_0x4827('0xf'),_0x2fd1e3,_0x366399['error'][_0x4827('0x16')]);return _0x2f9ff3(_0x366399[_0x4827('0x14')][_0x4827('0x16')]);}else{logger['info'](_0x4827('0xf'),_0x2fd1e3,_0x4827('0x10'));_0x2f9ff3(_0x366399[_0x4827('0x17')][_0x4827('0x16')]);}})['catch'](function(_0x556f77){logger[_0x4827('0x14')](_0x4827('0xf'),_0x2fd1e3,_0x556f77);_0x298858(_0x556f77);});});}exports[_0x4827('0x18')]=function(_0x31c76a){var _0x559aa2=this;return new Promise(function(_0x2c0ace,_0x561c2e){return db[_0x4827('0x19')][_0x4827('0x1a')](_0x31c76a[_0x4827('0x1b')],{'raw':_0x31c76a['options']?_0x31c76a[_0x4827('0x1c')][_0x4827('0x1d')]===undefined?!![]:![]:!![]})[_0x4827('0xd')](function(_0x3f33e6){logger[_0x4827('0xe')]('CreateWhatsappMessage',_0x31c76a);logger[_0x4827('0x11')](_0x4827('0x18'),_0x31c76a,JSON['stringify'](_0x3f33e6));_0x2c0ace(_0x3f33e6);})[_0x4827('0x1e')](function(_0x467c4c){logger[_0x4827('0x14')](_0x4827('0x18'),_0x467c4c[_0x4827('0x16')],_0x31c76a);_0x561c2e(_0x559aa2[_0x4827('0x14')](0x1f4,_0x467c4c[_0x4827('0x16')]));});});}; \ No newline at end of file +var _0x5c6a=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage'];(function(_0x2a3c07,_0x19afc5){var _0x49907f=function(_0x4a2610){while(--_0x4a2610){_0x2a3c07['push'](_0x2a3c07['shift']());}};_0x49907f(++_0x19afc5);}(_0x5c6a,0xbc));var _0xa5c6=function(_0x8d9589,_0x3ffcac){_0x8d9589=_0x8d9589-0x0;var _0x1b387d=_0x5c6a[_0x8d9589];return _0x1b387d;};'use strict';var _=require(_0xa5c6('0x0'));var util=require(_0xa5c6('0x1'));var moment=require(_0xa5c6('0x2'));var BPromise=require(_0xa5c6('0x3'));var rs=require(_0xa5c6('0x4'));var fs=require('fs');var Redis=require(_0xa5c6('0x5'));var db=require(_0xa5c6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5c6('0x7'))('rpc');var config=require(_0xa5c6('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xa5c6('0x9')]=_[_0xa5c6('0xa')](config[_0xa5c6('0x9')],{'host':_0xa5c6('0xb'),'port':0x18eb});var socket=require(_0xa5c6('0xc'))(new Redis(config[_0xa5c6('0x9')]));require('./whatsappMessage.socket')[_0xa5c6('0xd')](socket);function respondWithRpcPromise(_0x1e6c32,_0x26decf,_0x26d708){return new BPromise(function(_0x45013c,_0x5508c3){return client[_0xa5c6('0xe')](_0x1e6c32,_0x26d708)[_0xa5c6('0xf')](function(_0x3b7ee2){logger[_0xa5c6('0x10')](_0xa5c6('0x11'),_0x26decf,_0xa5c6('0x12'));logger[_0xa5c6('0x13')](_0xa5c6('0x14'),_0x26decf,'request\x20sent',JSON[_0xa5c6('0x15')](_0x3b7ee2));if(_0x3b7ee2[_0xa5c6('0x16')]){if(_0x3b7ee2[_0xa5c6('0x16')][_0xa5c6('0x17')]===0x1f4){logger[_0xa5c6('0x16')](_0xa5c6('0x11'),_0x26decf,_0x3b7ee2[_0xa5c6('0x16')][_0xa5c6('0x18')]);return _0x5508c3(_0x3b7ee2[_0xa5c6('0x16')][_0xa5c6('0x18')]);}logger[_0xa5c6('0x16')](_0xa5c6('0x11'),_0x26decf,_0x3b7ee2['error'][_0xa5c6('0x18')]);return _0x45013c(_0x3b7ee2['error'][_0xa5c6('0x18')]);}else{logger[_0xa5c6('0x10')](_0xa5c6('0x11'),_0x26decf,_0xa5c6('0x12'));_0x45013c(_0x3b7ee2[_0xa5c6('0x19')]['message']);}})[_0xa5c6('0x1a')](function(_0x3da106){logger[_0xa5c6('0x16')](_0xa5c6('0x11'),_0x26decf,_0x3da106);_0x5508c3(_0x3da106);});});}exports[_0xa5c6('0x1b')]=function(_0x269c5f){var _0x64507c=this;return new Promise(function(_0x1ea973,_0x13562f){return db[_0xa5c6('0x1c')]['create'](_0x269c5f['body'],{'raw':_0x269c5f[_0xa5c6('0x1d')]?_0x269c5f[_0xa5c6('0x1d')][_0xa5c6('0x1e')]===undefined?!![]:![]:!![]})[_0xa5c6('0xf')](function(_0x5e1fff){logger[_0xa5c6('0x10')]('CreateWhatsappMessage',_0x269c5f);logger[_0xa5c6('0x13')](_0xa5c6('0x1b'),_0x269c5f,JSON[_0xa5c6('0x15')](_0x5e1fff));_0x1ea973(_0x5e1fff);})[_0xa5c6('0x1a')](function(_0x2db893){logger[_0xa5c6('0x16')](_0xa5c6('0x1b'),_0x2db893[_0xa5c6('0x18')],_0x269c5f);_0x13562f(_0x64507c[_0xa5c6('0x16')](0x1f4,_0x2db893['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index ff9f39a..08399b4 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 _0x756b=['whatsappMessage:','./whatsappMessage.events','save','update','emit','removeListener','length'];(function(_0x77f20,_0x39ff0e){var _0x1b6084=function(_0xababcc){while(--_0xababcc){_0x77f20['push'](_0x77f20['shift']());}};_0x1b6084(++_0x39ff0e);}(_0x756b,0x86));var _0xb756=function(_0x1f1d24,_0x595493){_0x1f1d24=_0x1f1d24-0x0;var _0x5187e5=_0x756b[_0x1f1d24];return _0x5187e5;};'use strict';var WhatsappMessageEvents=require(_0xb756('0x0'));var events=[_0xb756('0x1'),'remove',_0xb756('0x2')];function createListener(_0x2fc221,_0x2fe805){return function(_0x35465f){_0x2fe805[_0xb756('0x3')](_0x2fc221,_0x35465f);};}function removeListener(_0x4c4878,_0x20c074){return function(){WhatsappMessageEvents[_0xb756('0x4')](_0x4c4878,_0x20c074);};}exports['register']=function(_0x1220e0){for(var _0x451153=0x0,_0x4cbda0=events[_0xb756('0x5')];_0x451153<_0x4cbda0;_0x451153++){var _0x2bbc7d=events[_0x451153];var _0x37572e=createListener(_0xb756('0x6')+_0x2bbc7d,_0x1220e0);WhatsappMessageEvents['on'](_0x2bbc7d,_0x37572e);}}; \ No newline at end of file +var _0x24d8=['removeListener','register','length','save','remove','update','emit'];(function(_0x3e456f,_0x3ad6fe){var _0x24129d=function(_0x1dab07){while(--_0x1dab07){_0x3e456f['push'](_0x3e456f['shift']());}};_0x24129d(++_0x3ad6fe);}(_0x24d8,0x168));var _0x824d=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x24d8[_0x344a3f];return _0x264712;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x824d('0x0'),_0x824d('0x1'),_0x824d('0x2')];function createListener(_0x1ae8a3,_0x104305){return function(_0x16f3af){_0x104305[_0x824d('0x3')](_0x1ae8a3,_0x16f3af);};}function removeListener(_0x5ee7ca,_0x487e8d){return function(){WhatsappMessageEvents[_0x824d('0x4')](_0x5ee7ca,_0x487e8d);};}exports[_0x824d('0x5')]=function(_0x2bcac5){for(var _0x2b55fe=0x0,_0x401b8f=events[_0x824d('0x6')];_0x2b55fe<_0x401b8f;_0x2b55fe++){var _0x559e9b=events[_0x2b55fe];var _0x3de364=createListener('whatsappMessage:'+_0x559e9b,_0x2bcac5);WhatsappMessageEvents['on'](_0x559e9b,_0x3de364);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index ae60e88..6d28285 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 _0x2787=['getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x29a631,_0x181a29){var _0x269751=function(_0x508fcd){while(--_0x508fcd){_0x29a631['push'](_0x29a631['shift']());}};_0x269751(++_0x181a29);}(_0x2787,0x15e));var _0x7278=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2787[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7278('0x0'));var util=require('util');var path=require(_0x7278('0x1'));var timeout=require('connect-timeout');var express=require(_0x7278('0x2'));var router=express[_0x7278('0x3')]();var fs_extra=require(_0x7278('0x4'));var auth=require(_0x7278('0x5'));var interaction=require(_0x7278('0x6'));var config=require(_0x7278('0x7'));var controller=require('./whatsappQueue.controller');router[_0x7278('0x8')]('/',auth[_0x7278('0x9')](),controller['index']);router[_0x7278('0x8')](_0x7278('0xa'),auth['isAuthenticated'](),controller[_0x7278('0xb')]);router[_0x7278('0x8')](_0x7278('0xc'),auth[_0x7278('0x9')](),controller[_0x7278('0xd')]);router[_0x7278('0x8')]('/:id/members',auth[_0x7278('0x9')](),controller[_0x7278('0xe')]);router[_0x7278('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7278('0xf')]);router['get'](_0x7278('0x10'),auth[_0x7278('0x9')](),controller['getAgents']);router[_0x7278('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7278('0x12'),auth[_0x7278('0x9')](),controller[_0x7278('0x13')]);router[_0x7278('0x11')]('/:id/users',auth[_0x7278('0x9')](),controller[_0x7278('0x14')]);router[_0x7278('0x15')](_0x7278('0xc'),auth['isAuthenticated'](),controller[_0x7278('0x16')]);router[_0x7278('0x17')](_0x7278('0xc'),auth[_0x7278('0x9')](),controller[_0x7278('0x18')]);router[_0x7278('0x17')]('/:id/teams',auth[_0x7278('0x9')](),controller[_0x7278('0x19')]);router[_0x7278('0x17')]('/:id/users',auth[_0x7278('0x9')](),controller[_0x7278('0x1a')]);module[_0x7278('0x1b')]=router; \ No newline at end of file +var _0x5727=['show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x4194e1,_0xb5a9a5){var _0x4fe19e=function(_0x58e9ed){while(--_0x58e9ed){_0x4194e1['push'](_0x4194e1['shift']());}};_0x4fe19e(++_0xb5a9a5);}(_0x5727,0x1c3));var _0x7572=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0x5727[_0x322bef];return _0x229e60;};'use strict';var multer=require('multer');var util=require(_0x7572('0x0'));var path=require(_0x7572('0x1'));var timeout=require(_0x7572('0x2'));var express=require(_0x7572('0x3'));var router=express['Router']();var fs_extra=require(_0x7572('0x4'));var auth=require(_0x7572('0x5'));var interaction=require(_0x7572('0x6'));var config=require(_0x7572('0x7'));var controller=require(_0x7572('0x8'));router[_0x7572('0x9')]('/',auth[_0x7572('0xa')](),controller['index']);router[_0x7572('0x9')](_0x7572('0xb'),auth[_0x7572('0xa')](),controller[_0x7572('0xc')]);router['get'](_0x7572('0xd'),auth[_0x7572('0xa')](),controller[_0x7572('0xe')]);router[_0x7572('0x9')](_0x7572('0xf'),auth[_0x7572('0xa')](),controller['getMembers']);router[_0x7572('0x9')](_0x7572('0x10'),auth[_0x7572('0xa')](),controller[_0x7572('0x11')]);router[_0x7572('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x7572('0x12')]);router[_0x7572('0x13')]('/',auth[_0x7572('0xa')](),controller[_0x7572('0x14')]);router[_0x7572('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7572('0x15')]);router[_0x7572('0x13')](_0x7572('0x16'),auth['isAuthenticated'](),controller[_0x7572('0x17')]);router[_0x7572('0x18')]('/:id',auth[_0x7572('0xa')](),controller[_0x7572('0x19')]);router[_0x7572('0x1a')](_0x7572('0xd'),auth[_0x7572('0xa')](),controller[_0x7572('0x1b')]);router[_0x7572('0x1a')]('/:id/teams',auth[_0x7572('0xa')](),controller[_0x7572('0x1c')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x7572('0x1d')]);module[_0x7572('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index ae7c997..b600e58 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 _0x131e=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0x131e,0x1ec));var _0xe131=function(_0x54d4d5,_0x14682c){_0x54d4d5=_0x54d4d5-0x0;var _0x5e597b=_0x131e[_0x54d4d5];return _0x5e597b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xe131('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xe131('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe131('0x2')](_0xe131('0x3'),_0xe131('0x4'),_0xe131('0x5'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9181=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x241658,_0x3cc0e7){var _0x5addfb=function(_0x4971fb){while(--_0x4971fb){_0x241658['push'](_0x241658['shift']());}};_0x5addfb(++_0x3cc0e7);}(_0x9181,0x182));var _0x1918=function(_0x207558,_0x32349b){_0x207558=_0x207558-0x0;var _0x501603=_0x9181[_0x207558];return _0x501603;};'use strict';var Sequelize=require(_0x1918('0x0'));module[_0x1918('0x1')]={'name':{'type':Sequelize[_0x1918('0x2')],'unique':_0x1918('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x1918('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1918('0x5'),'beepall',_0x1918('0x6'))},'description':{'type':Sequelize[_0x1918('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index bbb6515..ccb7f91 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 _0xffc4=['model','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','includeAll','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserWhatsappQueue','nolimit','WhatsappQueueId','User','UserId','agent','updatedAt','createdAt','rows','format','%s/%s','whatsappPause','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','findOne','getAgents','eml-format','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappQueue.socket','register','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','WhatsappQueues','UserProfileResource','then','sendStatus','stack','name','map','WhatsappQueue','rawAttributes','fieldName','key'];(function(_0x4fc08f,_0x2b50ec){var _0x148d8c=function(_0x5c024e){while(--_0x5c024e){_0x4fc08f['push'](_0x4fc08f['shift']());}};_0x148d8c(++_0x2b50ec);}(_0xffc4,0xe6));var _0x4ffc=function(_0x5c99d0,_0xe7b8ec){_0x5c99d0=_0x5c99d0-0x0;var _0x4675e4=_0xffc4[_0x5c99d0];return _0x4675e4;};'use strict';var emlformat=require(_0x4ffc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ffc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ffc('0x2'));var Mustache=require(_0x4ffc('0x3'));var util=require(_0x4ffc('0x4'));var path=require(_0x4ffc('0x5'));var sox=require('sox');var csv=require(_0x4ffc('0x6'));var ejs=require(_0x4ffc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ffc('0x8'));var squel=require(_0x4ffc('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ffc('0xa'));var toCsv=require(_0x4ffc('0x6'));var querystring=require(_0x4ffc('0xb'));var Papa=require(_0x4ffc('0xc'));var Redis=require(_0x4ffc('0xd'));var authService=require(_0x4ffc('0xe'));var qs=require(_0x4ffc('0xf'));var as=require(_0x4ffc('0x10'));var hardwareService=require(_0x4ffc('0x11'));var logger=require('../../config/logger')(_0x4ffc('0x12'));var utils=require(_0x4ffc('0x13'));var config=require(_0x4ffc('0x14'));var licenseUtil=require(_0x4ffc('0x15'));var db=require(_0x4ffc('0x16'))['db'];config[_0x4ffc('0x17')]=_[_0x4ffc('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4ffc('0x17')]));require(_0x4ffc('0x19'))[_0x4ffc('0x1a')](socket);function respondWithStatusCode(_0x1826b2,_0x115645){_0x115645=_0x115645||0xcc;return function(_0x533ed6){if(_0x533ed6){return _0x1826b2['sendStatus'](_0x115645);}return _0x1826b2['status'](_0x115645)[_0x4ffc('0x1b')]();};}function respondWithResult(_0x4d7bbb,_0x53a600){_0x53a600=_0x53a600||0xc8;return function(_0x24b5ad){if(_0x24b5ad){return _0x4d7bbb[_0x4ffc('0x1c')](_0x53a600)['json'](_0x24b5ad);}};}function respondWithFilteredResult(_0x453292,_0x3dd9c1){return function(_0x4fda47){if(_0x4fda47){var _0x5ccbf9=typeof _0x3dd9c1[_0x4ffc('0x1d')]===_0x4ffc('0x1e')&&typeof _0x3dd9c1[_0x4ffc('0x1f')]===_0x4ffc('0x1e');var _0x1f0dd6=_0x4fda47[_0x4ffc('0x20')];var _0xb5b28a=_0x5ccbf9?0x0:_0x3dd9c1[_0x4ffc('0x1d')];var _0x5d258f=_0x5ccbf9?_0x4fda47[_0x4ffc('0x20')]:_0x3dd9c1[_0x4ffc('0x1d')]+_0x3dd9c1['limit'];var _0x225970;if(_0x5d258f>=_0x1f0dd6){_0x5d258f=_0x1f0dd6;_0x225970=0xc8;}else{_0x225970=0xce;}_0x453292[_0x4ffc('0x1c')](_0x225970);return _0x453292[_0x4ffc('0x21')](_0x4ffc('0x22'),_0xb5b28a+'-'+_0x5d258f+'/'+_0x1f0dd6)[_0x4ffc('0x23')](_0x4fda47);}return null;};}function patchUpdates(_0x49af52){return function(_0x4bd092){try{jsonpatch[_0x4ffc('0x24')](_0x4bd092,_0x49af52,!![]);}catch(_0x55e926){return BPromise[_0x4ffc('0x25')](_0x55e926);}return _0x4bd092[_0x4ffc('0x26')]();};}function saveUpdates(_0x3d2530,_0x2f2304){return function(_0x5b59a9){if(_0x5b59a9){return _0x5b59a9[_0x4ffc('0x27')](_0x3d2530)['then'](function(_0x1d049b){return _0x1d049b;});}return null;};}function removeEntity(_0x58aee9,_0x1c8743){return function(_0x74a1cf){if(_0x74a1cf){return _0x74a1cf[_0x4ffc('0x28')]()['then'](function(){var _0x5be202=_0x74a1cf['get']({'plain':!![]});var _0x5d9a68=_0x4ffc('0x29');return db[_0x4ffc('0x2a')][_0x4ffc('0x28')]({'where':{'type':_0x5d9a68,'resourceId':_0x5be202['id']}})[_0x4ffc('0x2b')](function(){return _0x74a1cf;});})['then'](function(){_0x58aee9[_0x4ffc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178ae7,_0x4bd1a9){return function(_0x2f7b6f){if(!_0x2f7b6f){_0x178ae7[_0x4ffc('0x2c')](0x194);}return _0x2f7b6f;};}function handleError(_0x46c1df,_0x5f1fa9){_0x5f1fa9=_0x5f1fa9||0x1f4;return function(_0x4fdceb){logger['error'](_0x4fdceb[_0x4ffc('0x2d')]);if(_0x4fdceb[_0x4ffc('0x2e')]){delete _0x4fdceb[_0x4ffc('0x2e')];}_0x46c1df[_0x4ffc('0x1c')](_0x5f1fa9)['send'](_0x4fdceb);};}exports['index']=function(_0x4d862e,_0x2f00dd){var _0x28c450={},_0x2a1130={},_0x293c9a={'count':0x0,'rows':[]};var _0x3de571=_[_0x4ffc('0x2f')](db[_0x4ffc('0x30')][_0x4ffc('0x31')],function(_0x16814a){return{'name':_0x16814a[_0x4ffc('0x32')],'type':_0x16814a['type'][_0x4ffc('0x33')]};});_0x2a1130[_0x4ffc('0x34')]=_[_0x4ffc('0x2f')](_0x3de571,_0x4ffc('0x2e'));_0x2a1130['query']=_[_0x4ffc('0x35')](_0x4d862e[_0x4ffc('0x36')]);_0x2a1130['filters']=_[_0x4ffc('0x37')](_0x2a1130[_0x4ffc('0x34')],_0x2a1130[_0x4ffc('0x36')]);_0x28c450['attributes']=_[_0x4ffc('0x37')](_0x2a1130[_0x4ffc('0x34')],qs[_0x4ffc('0x38')](_0x4d862e[_0x4ffc('0x36')][_0x4ffc('0x38')]));_0x28c450[_0x4ffc('0x39')]=_0x28c450[_0x4ffc('0x39')][_0x4ffc('0x3a')]?_0x28c450[_0x4ffc('0x39')]:_0x2a1130[_0x4ffc('0x34')];if(!_0x4d862e['query'][_0x4ffc('0x3b')]('nolimit')){_0x28c450['limit']=qs[_0x4ffc('0x1f')](_0x4d862e[_0x4ffc('0x36')][_0x4ffc('0x1f')]);_0x28c450[_0x4ffc('0x1d')]=qs[_0x4ffc('0x1d')](_0x4d862e[_0x4ffc('0x36')]['offset']);}_0x28c450[_0x4ffc('0x3c')]=qs[_0x4ffc('0x3d')](_0x4d862e[_0x4ffc('0x36')][_0x4ffc('0x3d')]);_0x28c450['where']=qs[_0x4ffc('0x3e')](_[_0x4ffc('0x3f')](_0x4d862e[_0x4ffc('0x36')],_0x2a1130[_0x4ffc('0x3e')]),_0x3de571);if(_0x4d862e['query']['filter']){_0x28c450[_0x4ffc('0x40')]=_[_0x4ffc('0x41')](_0x28c450[_0x4ffc('0x40')],{'$or':_[_0x4ffc('0x2f')](_0x3de571,function(_0x816ad){if(_0x816ad[_0x4ffc('0x42')]!==_0x4ffc('0x43')){var _0x6d3fd1={};_0x6d3fd1[_0x816ad['name']]={'$like':'%'+_0x4d862e[_0x4ffc('0x36')][_0x4ffc('0x44')]+'%'};return _0x6d3fd1;}})});}_0x28c450=_[_0x4ffc('0x41')]({},_0x28c450,_0x4d862e[_0x4ffc('0x45')]);var _0x50c4be={'where':_0x28c450[_0x4ffc('0x40')]};return db['WhatsappQueue'][_0x4ffc('0x20')](_0x50c4be)[_0x4ffc('0x2b')](function(_0xb2249a){_0x293c9a[_0x4ffc('0x20')]=_0xb2249a;if(_0x4d862e[_0x4ffc('0x36')]['includeAll']){_0x28c450[_0x4ffc('0x46')]=[{'all':!![]}];}return db[_0x4ffc('0x30')][_0x4ffc('0x47')](_0x28c450);})['then'](function(_0x3cf1b3){_0x293c9a['rows']=_0x3cf1b3;return _0x293c9a;})[_0x4ffc('0x2b')](respondWithFilteredResult(_0x2f00dd,_0x28c450))[_0x4ffc('0x48')](handleError(_0x2f00dd,null));};exports[_0x4ffc('0x49')]=function(_0x4a4c81,_0x3d7c59){var _0x1fb9d7={'raw':!![],'where':{'id':_0x4a4c81['params']['id']}},_0x5c4432={};_0x5c4432[_0x4ffc('0x34')]=_[_0x4ffc('0x35')](db[_0x4ffc('0x30')]['rawAttributes']);_0x5c4432[_0x4ffc('0x36')]=_[_0x4ffc('0x35')](_0x4a4c81[_0x4ffc('0x36')]);_0x5c4432[_0x4ffc('0x3e')]=_['intersection'](_0x5c4432[_0x4ffc('0x34')],_0x5c4432[_0x4ffc('0x36')]);_0x1fb9d7[_0x4ffc('0x39')]=_[_0x4ffc('0x37')](_0x5c4432[_0x4ffc('0x34')],qs[_0x4ffc('0x38')](_0x4a4c81[_0x4ffc('0x36')]['fields']));_0x1fb9d7[_0x4ffc('0x39')]=_0x1fb9d7['attributes'][_0x4ffc('0x3a')]?_0x1fb9d7[_0x4ffc('0x39')]:_0x5c4432['model'];if(_0x4a4c81[_0x4ffc('0x36')][_0x4ffc('0x4a')]){_0x1fb9d7['include']=[{'all':!![]}];}_0x1fb9d7=_[_0x4ffc('0x41')]({},_0x1fb9d7,_0x4a4c81[_0x4ffc('0x45')]);return db[_0x4ffc('0x30')][_0x4ffc('0x4b')](_0x1fb9d7)['then'](handleEntityNotFound(_0x3d7c59,null))[_0x4ffc('0x2b')](respondWithResult(_0x3d7c59,null))[_0x4ffc('0x48')](handleError(_0x3d7c59,null));};exports['create']=function(_0x48a233,_0xacdfe3){return db[_0x4ffc('0x30')]['create'](_0x48a233[_0x4ffc('0x4c')],{})[_0x4ffc('0x2b')](function(_0x377764){var _0x2116a8=_0x48a233['user'][_0x4ffc('0x4d')]({'plain':!![]});if(!_0x2116a8)throw new Error(_0x4ffc('0x4e'));if(_0x2116a8[_0x4ffc('0x4f')]===_0x4ffc('0x50')){var _0x33929b=_0x377764[_0x4ffc('0x4d')]({'plain':!![]});var _0x521d77=_0x4ffc('0x29');return db[_0x4ffc('0x51')]['find']({'where':{'name':_0x521d77,'userProfileId':_0x2116a8[_0x4ffc('0x52')]},'raw':!![]})[_0x4ffc('0x2b')](function(_0x3f8351){if(_0x3f8351&&_0x3f8351['autoAssociation']===0x0){return db[_0x4ffc('0x2a')][_0x4ffc('0x53')]({'name':_0x33929b[_0x4ffc('0x2e')],'resourceId':_0x33929b['id'],'type':_0x3f8351[_0x4ffc('0x2e')],'sectionId':_0x3f8351['id']},{})[_0x4ffc('0x2b')](function(){return _0x377764;});}else{return _0x377764;}})[_0x4ffc('0x48')](function(_0x56a4f6){logger['error'](_0x4ffc('0x54'),_0x56a4f6);throw _0x56a4f6;});}return _0x377764;})[_0x4ffc('0x2b')](respondWithResult(_0xacdfe3,0xc9))['catch'](handleError(_0xacdfe3,null));};exports[_0x4ffc('0x27')]=function(_0x5578ee,_0x353bbe){if(_0x5578ee[_0x4ffc('0x4c')]['id']){delete _0x5578ee[_0x4ffc('0x4c')]['id'];}return db[_0x4ffc('0x30')][_0x4ffc('0x4b')]({'where':{'id':_0x5578ee[_0x4ffc('0x55')]['id']}})['then'](handleEntityNotFound(_0x353bbe,null))[_0x4ffc('0x2b')](saveUpdates(_0x5578ee['body'],null))[_0x4ffc('0x2b')](respondWithResult(_0x353bbe,null))['catch'](handleError(_0x353bbe,null));};exports[_0x4ffc('0x28')]=function(_0x4501a5,_0x749465){return db[_0x4ffc('0x30')][_0x4ffc('0x4b')]({'where':{'id':_0x4501a5[_0x4ffc('0x55')]['id']}})[_0x4ffc('0x2b')](handleEntityNotFound(_0x749465,null))[_0x4ffc('0x2b')](removeEntity(_0x749465,null))['catch'](handleError(_0x749465,null));};exports[_0x4ffc('0x56')]=function(_0x1d2927,_0x5488b5){return db['WhatsappQueue'][_0x4ffc('0x56')]()[_0x4ffc('0x2b')](respondWithResult(_0x5488b5,null))[_0x4ffc('0x48')](handleError(_0x5488b5,null));};exports[_0x4ffc('0x57')]=function(_0xb2eabd,_0xd30587,_0x182cff){var _0x25f767={'raw':!![],'where':{}},_0x292763={},_0xedd9e9;return db[_0x4ffc('0x30')]['findOne']({'where':{'id':_0xb2eabd[_0x4ffc('0x55')]['id']}})['then'](handleEntityNotFound(_0xd30587,null))[_0x4ffc('0x2b')](function(_0x3ff6f9){if(_0x3ff6f9){_0xedd9e9=_0x3ff6f9[_0x4ffc('0x4d')]({'plain':!![]});_0x292763[_0x4ffc('0x34')]=_[_0x4ffc('0x35')](db[_0x4ffc('0x58')][_0x4ffc('0x31')]);_0x292763[_0x4ffc('0x36')]=_[_0x4ffc('0x35')](_0xb2eabd['query']);_0x292763[_0x4ffc('0x3e')]=_['intersection'](_0x292763[_0x4ffc('0x34')],_0x292763['query']);_0x25f767[_0x4ffc('0x39')]=_[_0x4ffc('0x37')](_0x292763[_0x4ffc('0x34')],qs['fields'](_0xb2eabd['query'][_0x4ffc('0x38')]));_0x25f767[_0x4ffc('0x39')]=_0x25f767[_0x4ffc('0x39')][_0x4ffc('0x3a')]?_0x25f767[_0x4ffc('0x39')]:_0x292763[_0x4ffc('0x34')];if(!_0xb2eabd[_0x4ffc('0x36')][_0x4ffc('0x3b')](_0x4ffc('0x59'))){_0x25f767[_0x4ffc('0x1f')]=qs[_0x4ffc('0x1f')](_0xb2eabd[_0x4ffc('0x36')][_0x4ffc('0x1f')]);_0x25f767[_0x4ffc('0x1d')]=qs[_0x4ffc('0x1d')](_0xb2eabd[_0x4ffc('0x36')][_0x4ffc('0x1d')]);}_0x25f767[_0x4ffc('0x3c')]=qs['sort'](_0xb2eabd[_0x4ffc('0x36')][_0x4ffc('0x3d')]);_0x25f767[_0x4ffc('0x40')]=qs[_0x4ffc('0x3e')](_[_0x4ffc('0x3f')](_0xb2eabd[_0x4ffc('0x36')],_0x292763[_0x4ffc('0x3e')]));_0x25f767['where'][_0x4ffc('0x5a')]=_0x3ff6f9['id'];if(_0xb2eabd[_0x4ffc('0x36')][_0x4ffc('0x44')]){_0x25f767[_0x4ffc('0x40')]=_['merge'](_0x25f767['where'],{'$or':_['map'](_0x25f767[_0x4ffc('0x39')],function(_0x13ce51){var _0xa13204={};_0xa13204[_0x13ce51]={'$like':'%'+_0xb2eabd['query'][_0x4ffc('0x44')]+'%'};return _0xa13204;})});}_0x25f767=_[_0x4ffc('0x41')]({},_0x25f767,_0xb2eabd['options']);return db[_0x4ffc('0x58')]['findAll'](_0x25f767);}})[_0x4ffc('0x2b')](function(_0x3b9bd9){if(_0x3b9bd9){return db[_0x4ffc('0x5b')]['findAndCountAll']({'where':{'id':_[_0x4ffc('0x2f')](_0x3b9bd9,_0x4ffc('0x5c')),'role':_0x4ffc('0x5d')},'attributes':['id',_0x4ffc('0x2e'),'whatsappPause',_0x4ffc('0x5e'),_0x4ffc('0x5f')]});}})[_0x4ffc('0x2b')](function(_0x4db50e){if(_0x4db50e){return{'count':_0x4db50e[_0x4ffc('0x20')],'rows':_[_0x4ffc('0x2f')](_0x4db50e[_0x4ffc('0x60')],function(_0x2188c3){return{'membername':_0x2188c3[_0x4ffc('0x2e')],'UserId':_0x2188c3['id'],'queue_name':_0xedd9e9[_0x4ffc('0x2e')],'WhatsappQueueId':_0xedd9e9['id'],'interface':util[_0x4ffc('0x61')](_0x4ffc('0x62'),'SIP',_0x2188c3['name']),'penalty':0x0,'paused':_0x2188c3[_0x4ffc('0x63')],'createdAt':_0x2188c3['createdAt'],'updatedAt':_0x2188c3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4ffc('0x2b')](respondWithFilteredResult(_0xd30587,_0x25f767))[_0x4ffc('0x48')](handleError(_0xd30587,null));};exports[_0x4ffc('0x64')]=function(_0x451cf7,_0x2a71d5,_0x34ab5e){var _0x3226f8={};var _0x5a5c63={};var _0xc813b;var _0x433dcc;return db['WhatsappQueue']['findOne']({'where':{'id':_0x451cf7[_0x4ffc('0x55')]['id']}})[_0x4ffc('0x2b')](handleEntityNotFound(_0x2a71d5,null))['then'](function(_0x438347){if(_0x438347){_0xc813b=_0x438347;_0x5a5c63[_0x4ffc('0x34')]=_[_0x4ffc('0x35')](db[_0x4ffc('0x65')][_0x4ffc('0x31')]);_0x5a5c63[_0x4ffc('0x36')]=_['keys'](_0x451cf7[_0x4ffc('0x36')]);_0x5a5c63[_0x4ffc('0x3e')]=_[_0x4ffc('0x37')](_0x5a5c63[_0x4ffc('0x34')],_0x5a5c63[_0x4ffc('0x36')]);_0x3226f8[_0x4ffc('0x39')]=_[_0x4ffc('0x37')](_0x5a5c63['model'],qs[_0x4ffc('0x38')](_0x451cf7['query']['fields']));_0x3226f8[_0x4ffc('0x39')]=_0x3226f8[_0x4ffc('0x39')][_0x4ffc('0x3a')]?_0x3226f8[_0x4ffc('0x39')]:_0x5a5c63[_0x4ffc('0x34')];_0x3226f8[_0x4ffc('0x3c')]=qs[_0x4ffc('0x3d')](_0x451cf7['query'][_0x4ffc('0x3d')]);_0x3226f8[_0x4ffc('0x40')]=qs[_0x4ffc('0x3e')](_[_0x4ffc('0x3f')](_0x451cf7[_0x4ffc('0x36')],_0x5a5c63['filters']));if(_0x451cf7[_0x4ffc('0x36')]['filter']){_0x3226f8[_0x4ffc('0x40')]=_[_0x4ffc('0x41')](_0x3226f8[_0x4ffc('0x40')],{'$or':_[_0x4ffc('0x2f')](_0x3226f8[_0x4ffc('0x39')],function(_0x473684){var _0x266bcb={};_0x266bcb[_0x473684]={'$like':'%'+_0x451cf7[_0x4ffc('0x36')][_0x4ffc('0x44')]+'%'};return _0x266bcb;})});}_0x3226f8=_[_0x4ffc('0x41')]({},_0x3226f8,_0x451cf7[_0x4ffc('0x45')]);return _0xc813b['getTeams'](_0x3226f8);}})[_0x4ffc('0x2b')](function(_0x58a7f8){if(_0x58a7f8){_0x433dcc=_0x58a7f8['length'];if(!_0x451cf7['query'][_0x4ffc('0x3b')](_0x4ffc('0x59'))){_0x3226f8['limit']=qs['limit'](_0x451cf7[_0x4ffc('0x36')][_0x4ffc('0x1f')]);_0x3226f8[_0x4ffc('0x1d')]=qs[_0x4ffc('0x1d')](_0x451cf7[_0x4ffc('0x36')][_0x4ffc('0x1d')]);}return _0xc813b[_0x4ffc('0x64')](_0x3226f8);}})[_0x4ffc('0x2b')](function(_0xca3e04){if(_0xca3e04){return _0xca3e04?{'count':_0x433dcc,'rows':_0xca3e04}:null;}})['then'](respondWithResult(_0x2a71d5,null))[_0x4ffc('0x48')](handleError(_0x2a71d5,null));};exports['addTeams']=function(_0x5817d7,_0x3f13c7,_0x35a365){var _0x4340b3=_0x5817d7[_0x4ffc('0x4c')][_0x4ffc('0x66')];return db[_0x4ffc('0x65')]['findAll']({'where':{'id':_0x4340b3},'attributes':['id'],'include':[{'model':db[_0x4ffc('0x5b')],'as':_0x4ffc('0x67'),'attributes':['id',_0x4ffc('0x2e'),_0x4ffc('0x68'),_0x4ffc('0x69'),_0x4ffc('0x6a')],'raw':!![]}]})[_0x4ffc('0x2b')](function(_0x3c30e5){if(_0x3c30e5){var _0x31aaf2=_[_0x4ffc('0x6b')](_0x3c30e5,function(_0x236482){var _0x439f4a=_0x236482[_0x4ffc('0x4d')]({'plain':!![]});return _0x439f4a[_0x4ffc('0x67')];});return db[_0x4ffc('0x30')][_0x4ffc('0x4b')]({'where':{'id':_0x5817d7[_0x4ffc('0x55')]['id']}})[_0x4ffc('0x2b')](function(_0xf42384){return db[_0x4ffc('0x6c')][_0x4ffc('0x6d')](function(_0x1dd42c){return _0xf42384['addTeams'](_0x4340b3,{'transaction':_0x1dd42c})[_0x4ffc('0x2b')](function(){return BPromise[_0x4ffc('0x6e')](_0x31aaf2,function(_0x23c29b){return db[_0x4ffc('0x58')][_0x4ffc('0x6f')]({'where':{'UserId':_0x23c29b['id'],'WhatsappQueueId':_0x5817d7[_0x4ffc('0x55')]['id']},'transaction':_0x1dd42c});});})[_0x4ffc('0x2b')](function(){_0x31aaf2[_0x4ffc('0x70')](function(_0x4e97a6){socket[_0x4ffc('0x71')](_0x4ffc('0x72'),{'UserId':_0x4e97a6['id'],'WhatsappQueueId':_0xf42384['id']});});});});});}})[_0x4ffc('0x2b')](respondWithStatusCode(_0x3f13c7,null))[_0x4ffc('0x48')](handleError(_0x3f13c7,null));};exports[_0x4ffc('0x73')]=function(_0x5efe1d,_0x59eb1b,_0x25b3f6){return db[_0x4ffc('0x65')]['findAll']({'where':{'id':_0x5efe1d[_0x4ffc('0x36')][_0x4ffc('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4ffc('0x67'),'attributes':['id'],'raw':!![]}]})[_0x4ffc('0x2b')](handleEntityNotFound(_0x59eb1b,null))[_0x4ffc('0x2b')](function(_0x447adf){var _0x3afd56=_[_0x4ffc('0x2f')](_0x447adf,'id');var _0x5b1f3d=[];var _0x2b6d8c=[];var _0x161e97=squel['select']();_0x161e97[_0x4ffc('0x74')](_0x4ffc('0x75'))[_0x4ffc('0x76')](_0x4ffc('0x77'),'tq')[_0x4ffc('0x78')]('user_has_teams','ut',_0x4ffc('0x79'))[_0x4ffc('0x40')](_0x4ffc('0x7a'),_0x5efe1d['params']['id']);for(var _0x3789f1=0x0;_0x3789f1<_0x447adf['length'];_0x3789f1+=0x1){let _0x793c2a=_0x447adf[_0x3789f1];for(var _0x3ad879=0x0;_0x3ad879<_0x793c2a[_0x4ffc('0x67')]['length'];_0x3ad879+=0x1){let _0x1d6ebc=_0x793c2a[_0x4ffc('0x67')][_0x3ad879];var _0x340acf=_0x161e97[_0x4ffc('0x7b')]();_0x340acf[_0x4ffc('0x40')](_0x4ffc('0x7c'),_0x1d6ebc['id']);_0x2b6d8c[_0x4ffc('0x7d')](db['sequelize'][_0x4ffc('0x36')](_0x340acf['toString'](),{'type':db[_0x4ffc('0x6c')]['QueryTypes'][_0x4ffc('0x7e')]})[_0x4ffc('0x2b')](function(_0x18ea87){if(_0x18ea87[_0x4ffc('0x3a')]===0x1){return _0x1d6ebc['id'];}else{var _0x182498=_[_0x4ffc('0x7f')](_[_0x4ffc('0x2f')](_0x18ea87,_0x4ffc('0x80')),function(_0x1d8c90){return _[_0x4ffc('0x81')](_0x3afd56,_0x1d8c90);});if(_0x182498){return _0x1d6ebc['id'];}}}));}}return BPromise[_0x4ffc('0x82')](_0x2b6d8c)['then'](function(_0x5c6212){_0x5b1f3d=_(_0x5b1f3d)[_0x4ffc('0x83')](_0x5c6212)['compact']()[_0x4ffc('0x84')]();return db[_0x4ffc('0x30')]['find']({'where':{'id':_0x5efe1d[_0x4ffc('0x55')]['id']}})[_0x4ffc('0x2b')](function(_0x10a429){return db[_0x4ffc('0x6c')][_0x4ffc('0x6d')](function(_0x5e2cfb){return _0x10a429[_0x4ffc('0x73')](_0x5efe1d[_0x4ffc('0x36')][_0x4ffc('0x66')],{'transaction':_0x5e2cfb})['then'](function(){if(!_[_0x4ffc('0x85')](_0x5b1f3d)){return _0x10a429[_0x4ffc('0x86')](_0x5b1f3d,{'transaction':_0x5e2cfb});}})[_0x4ffc('0x2b')](function(){_0x5b1f3d['forEach'](function(_0x20f9d9){socket[_0x4ffc('0x71')](_0x4ffc('0x87'),{'UserId':_0x20f9d9,'WhatsappQueueId':_0x10a429['id']});});});});});});})[_0x4ffc('0x2b')](respondWithStatusCode(_0x59eb1b,null))[_0x4ffc('0x48')](handleError(_0x59eb1b,null));};exports[_0x4ffc('0x88')]=function(_0x1c835,_0x421f45,_0x47a4ca){return db['WhatsappQueue'][_0x4ffc('0x4b')]({'where':{'id':_0x1c835['params']['id']}})[_0x4ffc('0x2b')](handleEntityNotFound(_0x421f45,null))['then'](function(_0xe1d042){if(_0xe1d042){return _0xe1d042[_0x4ffc('0x88')](_0x1c835[_0x4ffc('0x4c')][_0x4ffc('0x66')],_[_0x4ffc('0x89')](_0x1c835[_0x4ffc('0x4c')],[_0x4ffc('0x66'),'id'])||{})['spread'](function(_0x2b5ac9){for(var _0x1ef701=0x0;_0x1ef701<_0x1c835['body'][_0x4ffc('0x66')][_0x4ffc('0x3a')];_0x1ef701+=0x1){socket[_0x4ffc('0x71')]('userWhatsappQueue:save',{'UserId':Number(_0x1c835[_0x4ffc('0x4c')]['ids'][_0x1ef701]),'WhatsappQueueId':Number(_0x1c835[_0x4ffc('0x55')]['id'])});}return _0x2b5ac9;});}})[_0x4ffc('0x2b')](respondWithResult(_0x421f45,null))[_0x4ffc('0x48')](handleError(_0x421f45,null));};exports[_0x4ffc('0x86')]=function(_0x4beb03,_0xd3ef8e,_0x5654f5){return db[_0x4ffc('0x30')][_0x4ffc('0x4b')]({'where':{'id':_0x4beb03[_0x4ffc('0x55')]['id']}})[_0x4ffc('0x2b')](handleEntityNotFound(_0xd3ef8e,null))[_0x4ffc('0x2b')](function(_0x5d38e6){if(_0x5d38e6){return _0x5d38e6[_0x4ffc('0x86')](_0x4beb03[_0x4ffc('0x36')][_0x4ffc('0x66')])[_0x4ffc('0x2b')](function(){if(_[_0x4ffc('0x8a')](_0x4beb03[_0x4ffc('0x36')][_0x4ffc('0x66')])){for(var _0x42131f=0x0;_0x42131f<_0x4beb03[_0x4ffc('0x36')][_0x4ffc('0x66')][_0x4ffc('0x3a')];_0x42131f+=0x1){socket['emit'](_0x4ffc('0x87'),{'UserId':Number(_0x4beb03[_0x4ffc('0x36')][_0x4ffc('0x66')][_0x42131f]),'WhatsappQueueId':Number(_0x4beb03[_0x4ffc('0x55')]['id'])});}}else{socket['emit'](_0x4ffc('0x87'),{'UserId':Number(_0x4beb03[_0x4ffc('0x36')][_0x4ffc('0x66')]),'WhatsappQueueId':Number(_0x4beb03[_0x4ffc('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0xd3ef8e,null))[_0x4ffc('0x48')](handleError(_0xd3ef8e,null));};exports['getAgents']=function(_0x34ca66,_0x3b3ef7,_0xf920e4){var _0x4a35ae={};var _0x67892a={};var _0x12515c;var _0x260917;return db[_0x4ffc('0x30')][_0x4ffc('0x8b')]({'where':{'id':_0x34ca66[_0x4ffc('0x55')]['id']}})[_0x4ffc('0x2b')](handleEntityNotFound(_0x3b3ef7,null))[_0x4ffc('0x2b')](function(_0x574881){if(_0x574881){_0x12515c=_0x574881;_0x67892a[_0x4ffc('0x34')]=_[_0x4ffc('0x35')](db['User'][_0x4ffc('0x31')]);_0x67892a[_0x4ffc('0x36')]=_[_0x4ffc('0x35')](_0x34ca66['query']);_0x67892a[_0x4ffc('0x3e')]=_[_0x4ffc('0x37')](_0x67892a['model'],_0x67892a[_0x4ffc('0x36')]);_0x4a35ae[_0x4ffc('0x39')]=_[_0x4ffc('0x37')](_0x67892a[_0x4ffc('0x34')],qs[_0x4ffc('0x38')](_0x34ca66[_0x4ffc('0x36')]['fields']));_0x4a35ae[_0x4ffc('0x39')]=_0x4a35ae[_0x4ffc('0x39')][_0x4ffc('0x3a')]?_0x4a35ae[_0x4ffc('0x39')]:_0x67892a[_0x4ffc('0x34')];_0x4a35ae[_0x4ffc('0x3c')]=qs['sort'](_0x34ca66[_0x4ffc('0x36')][_0x4ffc('0x3d')]);_0x4a35ae[_0x4ffc('0x40')]=qs[_0x4ffc('0x3e')](_['pick'](_0x34ca66[_0x4ffc('0x36')],_0x67892a[_0x4ffc('0x3e')]));if(_0x34ca66['query']['filter']){_0x4a35ae[_0x4ffc('0x40')]=_[_0x4ffc('0x41')](_0x4a35ae[_0x4ffc('0x40')],{'$or':_[_0x4ffc('0x2f')](_0x4a35ae[_0x4ffc('0x39')],function(_0x1cb97e){var _0x30ba1d={};_0x30ba1d[_0x1cb97e]={'$like':'%'+_0x34ca66[_0x4ffc('0x36')]['filter']+'%'};return _0x30ba1d;})});}_0x4a35ae=_[_0x4ffc('0x41')]({},_0x4a35ae,_0x34ca66[_0x4ffc('0x45')]);return _0x12515c[_0x4ffc('0x8c')](_0x4a35ae);}})[_0x4ffc('0x2b')](function(_0x3360aa){if(_0x3360aa){_0x260917=_0x3360aa[_0x4ffc('0x3a')];if(!_0x34ca66[_0x4ffc('0x36')][_0x4ffc('0x3b')](_0x4ffc('0x59'))){_0x4a35ae[_0x4ffc('0x1f')]=qs[_0x4ffc('0x1f')](_0x34ca66[_0x4ffc('0x36')][_0x4ffc('0x1f')]);_0x4a35ae[_0x4ffc('0x1d')]=qs['offset'](_0x34ca66[_0x4ffc('0x36')]['offset']);}return _0x12515c[_0x4ffc('0x8c')](_0x4a35ae);}})[_0x4ffc('0x2b')](function(_0x5c75e2){if(_0x5c75e2){return _0x5c75e2?{'count':_0x260917,'rows':_0x5c75e2}:null;}})[_0x4ffc('0x2b')](respondWithResult(_0x3b3ef7,null))['catch'](handleError(_0x3b3ef7,null));}; \ No newline at end of file +var _0x3cf0=['catch','show','params','rawAttributes','keys','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','findAll','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','Team','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','value','ids','isEmpty','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','reject','update','then','WhatsappQueues','UserProfileResource','destroy','error','send','index','map','WhatsappQueue','fieldName','key','model','name','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','type','merge','options','include','rows'];(function(_0x2c18bf,_0x139778){var _0x9da634=function(_0x3079b5){while(--_0x3079b5){_0x2c18bf['push'](_0x2c18bf['shift']());}};_0x9da634(++_0x139778);}(_0x3cf0,0xd4));var _0x03cf=function(_0x387162,_0x2e147b){_0x387162=_0x387162-0x0;var _0x52c7e4=_0x3cf0[_0x387162];return _0x52c7e4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03cf('0x0'));var zipdir=require(_0x03cf('0x1'));var jsonpatch=require(_0x03cf('0x2'));var rp=require(_0x03cf('0x3'));var moment=require(_0x03cf('0x4'));var BPromise=require(_0x03cf('0x5'));var Mustache=require(_0x03cf('0x6'));var util=require(_0x03cf('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x03cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03cf('0x9'));var _=require(_0x03cf('0xa'));var squel=require(_0x03cf('0xb'));var crypto=require(_0x03cf('0xc'));var jsforce=require(_0x03cf('0xd'));var deskjs=require(_0x03cf('0xe'));var toCsv=require(_0x03cf('0x8'));var querystring=require(_0x03cf('0xf'));var Papa=require(_0x03cf('0x10'));var Redis=require('ioredis');var authService=require(_0x03cf('0x11'));var qs=require(_0x03cf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03cf('0x13'));var logger=require(_0x03cf('0x14'))(_0x03cf('0x15'));var utils=require('../../config/utils');var config=require(_0x03cf('0x16'));var licenseUtil=require(_0x03cf('0x17'));var db=require(_0x03cf('0x18'))['db'];config[_0x03cf('0x19')]=_[_0x03cf('0x1a')](config[_0x03cf('0x19')],{'host':_0x03cf('0x1b'),'port':0x18eb});var socket=require(_0x03cf('0x1c'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x4e1841,_0x2a40f3){_0x2a40f3=_0x2a40f3||0xcc;return function(_0x5a19c1){if(_0x5a19c1){return _0x4e1841[_0x03cf('0x1d')](_0x2a40f3);}return _0x4e1841[_0x03cf('0x1e')](_0x2a40f3)[_0x03cf('0x1f')]();};}function respondWithResult(_0x4814d7,_0x488d23){_0x488d23=_0x488d23||0xc8;return function(_0x3ddc0a){if(_0x3ddc0a){return _0x4814d7['status'](_0x488d23)['json'](_0x3ddc0a);}};}function respondWithFilteredResult(_0x3a5cb8,_0x1bbe67){return function(_0x158d50){if(_0x158d50){var _0x56f5cf=typeof _0x1bbe67['offset']==='undefined'&&typeof _0x1bbe67[_0x03cf('0x20')]===_0x03cf('0x21');var _0x414eb0=_0x158d50[_0x03cf('0x22')];var _0x354def=_0x56f5cf?0x0:_0x1bbe67[_0x03cf('0x23')];var _0x5240a8=_0x56f5cf?_0x158d50[_0x03cf('0x22')]:_0x1bbe67[_0x03cf('0x23')]+_0x1bbe67[_0x03cf('0x20')];var _0x39f079;if(_0x5240a8>=_0x414eb0){_0x5240a8=_0x414eb0;_0x39f079=0xc8;}else{_0x39f079=0xce;}_0x3a5cb8[_0x03cf('0x1e')](_0x39f079);return _0x3a5cb8['set'](_0x03cf('0x24'),_0x354def+'-'+_0x5240a8+'/'+_0x414eb0)[_0x03cf('0x25')](_0x158d50);}return null;};}function patchUpdates(_0x54b2fb){return function(_0x2a7abe){try{jsonpatch['apply'](_0x2a7abe,_0x54b2fb,!![]);}catch(_0xc2e78f){return BPromise[_0x03cf('0x26')](_0xc2e78f);}return _0x2a7abe['save']();};}function saveUpdates(_0xcd9225,_0x1c8991){return function(_0x28d3a9){if(_0x28d3a9){return _0x28d3a9[_0x03cf('0x27')](_0xcd9225)['then'](function(_0xb6e19){return _0xb6e19;});}return null;};}function removeEntity(_0x9fa800,_0x2ee4ea){return function(_0x45da17){if(_0x45da17){return _0x45da17['destroy']()[_0x03cf('0x28')](function(){var _0x34289d=_0x45da17['get']({'plain':!![]});var _0x4faeb1=_0x03cf('0x29');return db[_0x03cf('0x2a')][_0x03cf('0x2b')]({'where':{'type':_0x4faeb1,'resourceId':_0x34289d['id']}})['then'](function(){return _0x45da17;});})['then'](function(){_0x9fa800['status'](0xcc)[_0x03cf('0x1f')]();});}};}function handleEntityNotFound(_0x2ad76b,_0x594f74){return function(_0x508106){if(!_0x508106){_0x2ad76b['sendStatus'](0x194);}return _0x508106;};}function handleError(_0x1cfd49,_0x3cced6){_0x3cced6=_0x3cced6||0x1f4;return function(_0x3dae1a){logger[_0x03cf('0x2c')](_0x3dae1a['stack']);if(_0x3dae1a['name']){delete _0x3dae1a['name'];}_0x1cfd49[_0x03cf('0x1e')](_0x3cced6)[_0x03cf('0x2d')](_0x3dae1a);};}exports[_0x03cf('0x2e')]=function(_0x214d3f,_0x51ed6d){var _0x4eaf9b={},_0x13a83d={},_0x36b2ff={'count':0x0,'rows':[]};var _0x38ddde=_[_0x03cf('0x2f')](db[_0x03cf('0x30')]['rawAttributes'],function(_0x28f110){return{'name':_0x28f110[_0x03cf('0x31')],'type':_0x28f110['type'][_0x03cf('0x32')]};});_0x13a83d[_0x03cf('0x33')]=_['map'](_0x38ddde,_0x03cf('0x34'));_0x13a83d['query']=_['keys'](_0x214d3f[_0x03cf('0x35')]);_0x13a83d[_0x03cf('0x36')]=_['intersection'](_0x13a83d[_0x03cf('0x33')],_0x13a83d[_0x03cf('0x35')]);_0x4eaf9b[_0x03cf('0x37')]=_[_0x03cf('0x38')](_0x13a83d[_0x03cf('0x33')],qs[_0x03cf('0x39')](_0x214d3f[_0x03cf('0x35')][_0x03cf('0x39')]));_0x4eaf9b[_0x03cf('0x37')]=_0x4eaf9b['attributes'][_0x03cf('0x3a')]?_0x4eaf9b[_0x03cf('0x37')]:_0x13a83d[_0x03cf('0x33')];if(!_0x214d3f[_0x03cf('0x35')]['hasOwnProperty'](_0x03cf('0x3b'))){_0x4eaf9b[_0x03cf('0x20')]=qs['limit'](_0x214d3f[_0x03cf('0x35')]['limit']);_0x4eaf9b[_0x03cf('0x23')]=qs[_0x03cf('0x23')](_0x214d3f[_0x03cf('0x35')][_0x03cf('0x23')]);}_0x4eaf9b[_0x03cf('0x3c')]=qs['sort'](_0x214d3f[_0x03cf('0x35')][_0x03cf('0x3d')]);_0x4eaf9b['where']=qs[_0x03cf('0x36')](_[_0x03cf('0x3e')](_0x214d3f[_0x03cf('0x35')],_0x13a83d[_0x03cf('0x36')]),_0x38ddde);if(_0x214d3f['query'][_0x03cf('0x3f')]){_0x4eaf9b[_0x03cf('0x40')]=_['merge'](_0x4eaf9b[_0x03cf('0x40')],{'$or':_[_0x03cf('0x2f')](_0x38ddde,function(_0x18121b){if(_0x18121b[_0x03cf('0x41')]!=='VIRTUAL'){var _0x5e0d62={};_0x5e0d62[_0x18121b[_0x03cf('0x34')]]={'$like':'%'+_0x214d3f['query'][_0x03cf('0x3f')]+'%'};return _0x5e0d62;}})});}_0x4eaf9b=_[_0x03cf('0x42')]({},_0x4eaf9b,_0x214d3f[_0x03cf('0x43')]);var _0x269062={'where':_0x4eaf9b[_0x03cf('0x40')]};return db[_0x03cf('0x30')][_0x03cf('0x22')](_0x269062)['then'](function(_0x2136c0){_0x36b2ff['count']=_0x2136c0;if(_0x214d3f[_0x03cf('0x35')]['includeAll']){_0x4eaf9b[_0x03cf('0x44')]=[{'all':!![]}];}return db[_0x03cf('0x30')]['findAll'](_0x4eaf9b);})[_0x03cf('0x28')](function(_0x3cd06c){_0x36b2ff[_0x03cf('0x45')]=_0x3cd06c;return _0x36b2ff;})['then'](respondWithFilteredResult(_0x51ed6d,_0x4eaf9b))[_0x03cf('0x46')](handleError(_0x51ed6d,null));};exports[_0x03cf('0x47')]=function(_0x46fe2f,_0x4e8586){var _0x1c6a6a={'raw':!![],'where':{'id':_0x46fe2f[_0x03cf('0x48')]['id']}},_0x407ecb={};_0x407ecb[_0x03cf('0x33')]=_['keys'](db[_0x03cf('0x30')][_0x03cf('0x49')]);_0x407ecb[_0x03cf('0x35')]=_[_0x03cf('0x4a')](_0x46fe2f[_0x03cf('0x35')]);_0x407ecb['filters']=_[_0x03cf('0x38')](_0x407ecb[_0x03cf('0x33')],_0x407ecb[_0x03cf('0x35')]);_0x1c6a6a[_0x03cf('0x37')]=_['intersection'](_0x407ecb[_0x03cf('0x33')],qs[_0x03cf('0x39')](_0x46fe2f[_0x03cf('0x35')][_0x03cf('0x39')]));_0x1c6a6a['attributes']=_0x1c6a6a['attributes'][_0x03cf('0x3a')]?_0x1c6a6a[_0x03cf('0x37')]:_0x407ecb['model'];if(_0x46fe2f[_0x03cf('0x35')][_0x03cf('0x4b')]){_0x1c6a6a['include']=[{'all':!![]}];}_0x1c6a6a=_[_0x03cf('0x42')]({},_0x1c6a6a,_0x46fe2f[_0x03cf('0x43')]);return db[_0x03cf('0x30')][_0x03cf('0x4c')](_0x1c6a6a)['then'](handleEntityNotFound(_0x4e8586,null))['then'](respondWithResult(_0x4e8586,null))['catch'](handleError(_0x4e8586,null));};exports[_0x03cf('0x4d')]=function(_0x1945b6,_0x1e2a36){return db[_0x03cf('0x30')][_0x03cf('0x4d')](_0x1945b6['body'],{})[_0x03cf('0x28')](function(_0x5e25d7){var _0x5ccf0e=_0x1945b6[_0x03cf('0x4e')]['get']({'plain':!![]});if(!_0x5ccf0e)throw new Error(_0x03cf('0x4f'));if(_0x5ccf0e[_0x03cf('0x50')]===_0x03cf('0x4e')){var _0x3da2da=_0x5e25d7[_0x03cf('0x51')]({'plain':!![]});var _0x5c1c6f=_0x03cf('0x29');return db[_0x03cf('0x52')][_0x03cf('0x4c')]({'where':{'name':_0x5c1c6f,'userProfileId':_0x5ccf0e[_0x03cf('0x53')]},'raw':!![]})[_0x03cf('0x28')](function(_0x1dfba5){if(_0x1dfba5&&_0x1dfba5[_0x03cf('0x54')]===0x0){return db[_0x03cf('0x2a')]['create']({'name':_0x3da2da[_0x03cf('0x34')],'resourceId':_0x3da2da['id'],'type':_0x1dfba5['name'],'sectionId':_0x1dfba5['id']},{})[_0x03cf('0x28')](function(){return _0x5e25d7;});}else{return _0x5e25d7;}})[_0x03cf('0x46')](function(_0xede943){logger[_0x03cf('0x2c')](_0x03cf('0x55'),_0xede943);throw _0xede943;});}return _0x5e25d7;})[_0x03cf('0x28')](respondWithResult(_0x1e2a36,0xc9))['catch'](handleError(_0x1e2a36,null));};exports[_0x03cf('0x27')]=function(_0x55d1d2,_0x33ff8b){if(_0x55d1d2['body']['id']){delete _0x55d1d2[_0x03cf('0x56')]['id'];}return db[_0x03cf('0x30')][_0x03cf('0x4c')]({'where':{'id':_0x55d1d2['params']['id']}})[_0x03cf('0x28')](handleEntityNotFound(_0x33ff8b,null))['then'](saveUpdates(_0x55d1d2[_0x03cf('0x56')],null))[_0x03cf('0x28')](respondWithResult(_0x33ff8b,null))[_0x03cf('0x46')](handleError(_0x33ff8b,null));};exports[_0x03cf('0x2b')]=function(_0x18c95a,_0x3c5d27){return db['WhatsappQueue'][_0x03cf('0x4c')]({'where':{'id':_0x18c95a[_0x03cf('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c5d27,null))[_0x03cf('0x28')](removeEntity(_0x3c5d27,null))[_0x03cf('0x46')](handleError(_0x3c5d27,null));};exports[_0x03cf('0x57')]=function(_0x2ec18b,_0x1f83f7){return db['WhatsappQueue'][_0x03cf('0x57')]()[_0x03cf('0x28')](respondWithResult(_0x1f83f7,null))[_0x03cf('0x46')](handleError(_0x1f83f7,null));};exports[_0x03cf('0x58')]=function(_0x2289b2,_0x446ea6,_0x142b9b){var _0x3251e0={'raw':!![],'where':{}},_0x3194ef={},_0x566c7c;return db[_0x03cf('0x30')]['findOne']({'where':{'id':_0x2289b2[_0x03cf('0x48')]['id']}})[_0x03cf('0x28')](handleEntityNotFound(_0x446ea6,null))[_0x03cf('0x28')](function(_0x42e57c){if(_0x42e57c){_0x566c7c=_0x42e57c[_0x03cf('0x51')]({'plain':!![]});_0x3194ef[_0x03cf('0x33')]=_['keys'](db[_0x03cf('0x59')]['rawAttributes']);_0x3194ef[_0x03cf('0x35')]=_[_0x03cf('0x4a')](_0x2289b2['query']);_0x3194ef[_0x03cf('0x36')]=_[_0x03cf('0x38')](_0x3194ef['model'],_0x3194ef[_0x03cf('0x35')]);_0x3251e0[_0x03cf('0x37')]=_[_0x03cf('0x38')](_0x3194ef[_0x03cf('0x33')],qs[_0x03cf('0x39')](_0x2289b2[_0x03cf('0x35')][_0x03cf('0x39')]));_0x3251e0[_0x03cf('0x37')]=_0x3251e0[_0x03cf('0x37')][_0x03cf('0x3a')]?_0x3251e0['attributes']:_0x3194ef['model'];if(!_0x2289b2['query'][_0x03cf('0x5a')](_0x03cf('0x3b'))){_0x3251e0['limit']=qs[_0x03cf('0x20')](_0x2289b2[_0x03cf('0x35')]['limit']);_0x3251e0[_0x03cf('0x23')]=qs[_0x03cf('0x23')](_0x2289b2[_0x03cf('0x35')][_0x03cf('0x23')]);}_0x3251e0[_0x03cf('0x3c')]=qs[_0x03cf('0x3d')](_0x2289b2['query']['sort']);_0x3251e0[_0x03cf('0x40')]=qs['filters'](_[_0x03cf('0x3e')](_0x2289b2[_0x03cf('0x35')],_0x3194ef[_0x03cf('0x36')]));_0x3251e0[_0x03cf('0x40')][_0x03cf('0x5b')]=_0x42e57c['id'];if(_0x2289b2[_0x03cf('0x35')][_0x03cf('0x3f')]){_0x3251e0[_0x03cf('0x40')]=_['merge'](_0x3251e0['where'],{'$or':_[_0x03cf('0x2f')](_0x3251e0[_0x03cf('0x37')],function(_0x1b4b48){var _0x5cf09f={};_0x5cf09f[_0x1b4b48]={'$like':'%'+_0x2289b2[_0x03cf('0x35')]['filter']+'%'};return _0x5cf09f;})});}_0x3251e0=_['merge']({},_0x3251e0,_0x2289b2['options']);return db['UserWhatsappQueue'][_0x03cf('0x5c')](_0x3251e0);}})[_0x03cf('0x28')](function(_0x427906){if(_0x427906){return db[_0x03cf('0x5d')][_0x03cf('0x5e')]({'where':{'id':_[_0x03cf('0x2f')](_0x427906,_0x03cf('0x5f')),'role':_0x03cf('0x60')},'attributes':['id',_0x03cf('0x34'),_0x03cf('0x61'),_0x03cf('0x62'),'createdAt']});}})['then'](function(_0x268208){if(_0x268208){return{'count':_0x268208[_0x03cf('0x22')],'rows':_['map'](_0x268208['rows'],function(_0xdcbb0a){return{'membername':_0xdcbb0a['name'],'UserId':_0xdcbb0a['id'],'queue_name':_0x566c7c[_0x03cf('0x34')],'WhatsappQueueId':_0x566c7c['id'],'interface':util[_0x03cf('0x63')](_0x03cf('0x64'),_0x03cf('0x65'),_0xdcbb0a[_0x03cf('0x34')]),'penalty':0x0,'paused':_0xdcbb0a[_0x03cf('0x61')],'createdAt':_0xdcbb0a[_0x03cf('0x66')],'updatedAt':_0xdcbb0a[_0x03cf('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x03cf('0x28')](respondWithFilteredResult(_0x446ea6,_0x3251e0))[_0x03cf('0x46')](handleError(_0x446ea6,null));};exports[_0x03cf('0x67')]=function(_0x26a418,_0x1469a4,_0x43e360){var _0x37ba53={};var _0x53499c={};var _0x44f9de;var _0x1b406d;return db[_0x03cf('0x30')][_0x03cf('0x68')]({'where':{'id':_0x26a418[_0x03cf('0x48')]['id']}})[_0x03cf('0x28')](handleEntityNotFound(_0x1469a4,null))[_0x03cf('0x28')](function(_0xf5682a){if(_0xf5682a){_0x44f9de=_0xf5682a;_0x53499c['model']=_[_0x03cf('0x4a')](db[_0x03cf('0x69')][_0x03cf('0x49')]);_0x53499c[_0x03cf('0x35')]=_['keys'](_0x26a418['query']);_0x53499c['filters']=_[_0x03cf('0x38')](_0x53499c[_0x03cf('0x33')],_0x53499c[_0x03cf('0x35')]);_0x37ba53[_0x03cf('0x37')]=_[_0x03cf('0x38')](_0x53499c[_0x03cf('0x33')],qs[_0x03cf('0x39')](_0x26a418[_0x03cf('0x35')][_0x03cf('0x39')]));_0x37ba53[_0x03cf('0x37')]=_0x37ba53[_0x03cf('0x37')]['length']?_0x37ba53['attributes']:_0x53499c[_0x03cf('0x33')];_0x37ba53['order']=qs[_0x03cf('0x3d')](_0x26a418[_0x03cf('0x35')][_0x03cf('0x3d')]);_0x37ba53[_0x03cf('0x40')]=qs[_0x03cf('0x36')](_[_0x03cf('0x3e')](_0x26a418[_0x03cf('0x35')],_0x53499c[_0x03cf('0x36')]));if(_0x26a418[_0x03cf('0x35')]['filter']){_0x37ba53[_0x03cf('0x40')]=_['merge'](_0x37ba53['where'],{'$or':_['map'](_0x37ba53['attributes'],function(_0x431a29){var _0x215598={};_0x215598[_0x431a29]={'$like':'%'+_0x26a418[_0x03cf('0x35')][_0x03cf('0x3f')]+'%'};return _0x215598;})});}_0x37ba53=_['merge']({},_0x37ba53,_0x26a418[_0x03cf('0x43')]);return _0x44f9de[_0x03cf('0x67')](_0x37ba53);}})['then'](function(_0x48600f){if(_0x48600f){_0x1b406d=_0x48600f['length'];if(!_0x26a418[_0x03cf('0x35')]['hasOwnProperty'](_0x03cf('0x3b'))){_0x37ba53['limit']=qs[_0x03cf('0x20')](_0x26a418[_0x03cf('0x35')]['limit']);_0x37ba53[_0x03cf('0x23')]=qs[_0x03cf('0x23')](_0x26a418[_0x03cf('0x35')][_0x03cf('0x23')]);}return _0x44f9de[_0x03cf('0x67')](_0x37ba53);}})[_0x03cf('0x28')](function(_0x5df0a0){if(_0x5df0a0){return _0x5df0a0?{'count':_0x1b406d,'rows':_0x5df0a0}:null;}})[_0x03cf('0x28')](respondWithResult(_0x1469a4,null))[_0x03cf('0x46')](handleError(_0x1469a4,null));};exports['addTeams']=function(_0x3e7cf4,_0x2772f9,_0x1d5843){var _0x246e8a=_0x3e7cf4[_0x03cf('0x56')]['ids'];return db[_0x03cf('0x69')][_0x03cf('0x5c')]({'where':{'id':_0x246e8a},'attributes':['id'],'include':[{'model':db[_0x03cf('0x5d')],'as':_0x03cf('0x6a'),'attributes':['id','name',_0x03cf('0x6b'),_0x03cf('0x6c'),'interface'],'raw':!![]}]})[_0x03cf('0x28')](function(_0x57ef6a){if(_0x57ef6a){var _0x182166=_[_0x03cf('0x6d')](_0x57ef6a,function(_0x43840f){var _0x3942bf=_0x43840f[_0x03cf('0x51')]({'plain':!![]});return _0x3942bf[_0x03cf('0x6a')];});return db[_0x03cf('0x30')][_0x03cf('0x4c')]({'where':{'id':_0x3e7cf4[_0x03cf('0x48')]['id']}})[_0x03cf('0x28')](function(_0x2c1079){return db[_0x03cf('0x6e')][_0x03cf('0x6f')](function(_0x112d8b){return _0x2c1079[_0x03cf('0x70')](_0x246e8a,{'transaction':_0x112d8b})[_0x03cf('0x28')](function(){return BPromise['each'](_0x182166,function(_0x23d920){return db[_0x03cf('0x59')][_0x03cf('0x71')]({'where':{'UserId':_0x23d920['id'],'WhatsappQueueId':_0x3e7cf4[_0x03cf('0x48')]['id']},'transaction':_0x112d8b});});})[_0x03cf('0x28')](function(){_0x182166[_0x03cf('0x72')](function(_0x231e15){socket[_0x03cf('0x73')](_0x03cf('0x74'),{'UserId':_0x231e15['id'],'WhatsappQueueId':_0x2c1079['id']});});});});});}})[_0x03cf('0x28')](respondWithStatusCode(_0x2772f9,null))[_0x03cf('0x46')](handleError(_0x2772f9,null));};exports[_0x03cf('0x75')]=function(_0x39db27,_0x1b4f45,_0x25bdee){return db[_0x03cf('0x69')][_0x03cf('0x5c')]({'where':{'id':_0x39db27[_0x03cf('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x03cf('0x5d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x03cf('0x28')](handleEntityNotFound(_0x1b4f45,null))[_0x03cf('0x28')](function(_0x185a9c){var _0x344d5d=_[_0x03cf('0x2f')](_0x185a9c,'id');var _0xad018e=[];var _0x5b89c6=[];var _0x378f06=squel['select']();_0x378f06[_0x03cf('0x76')](_0x03cf('0x77'))[_0x03cf('0x78')](_0x03cf('0x79'),'tq')[_0x03cf('0x7a')]('user_has_teams','ut',_0x03cf('0x7b'))[_0x03cf('0x40')](_0x03cf('0x7c'),_0x39db27[_0x03cf('0x48')]['id']);for(var _0x2b88fb=0x0;_0x2b88fb<_0x185a9c[_0x03cf('0x3a')];_0x2b88fb+=0x1){let _0x13a6f9=_0x185a9c[_0x2b88fb];for(var _0x55ddde=0x0;_0x55ddde<_0x13a6f9[_0x03cf('0x6a')][_0x03cf('0x3a')];_0x55ddde+=0x1){let _0x72215=_0x13a6f9[_0x03cf('0x6a')][_0x55ddde];var _0x56cb2e=_0x378f06['clone']();_0x56cb2e[_0x03cf('0x40')](_0x03cf('0x7d'),_0x72215['id']);_0x5b89c6[_0x03cf('0x7e')](db[_0x03cf('0x6e')][_0x03cf('0x35')](_0x56cb2e['toString'](),{'type':db['sequelize'][_0x03cf('0x7f')][_0x03cf('0x80')]})[_0x03cf('0x28')](function(_0x309603){if(_0x309603[_0x03cf('0x3a')]===0x1){return _0x72215['id'];}else{var _0x124191=_[_0x03cf('0x81')](_[_0x03cf('0x2f')](_0x309603,_0x03cf('0x82')),function(_0x28850b){return _['includes'](_0x344d5d,_0x28850b);});if(_0x124191){return _0x72215['id'];}}}));}}return BPromise['all'](_0x5b89c6)[_0x03cf('0x28')](function(_0x2f2396){_0xad018e=_(_0xad018e)[_0x03cf('0x83')](_0x2f2396)['compact']()[_0x03cf('0x84')]();return db['WhatsappQueue'][_0x03cf('0x4c')]({'where':{'id':_0x39db27[_0x03cf('0x48')]['id']}})[_0x03cf('0x28')](function(_0x16845d){return db['sequelize'][_0x03cf('0x6f')](function(_0x3ee0c6){return _0x16845d[_0x03cf('0x75')](_0x39db27[_0x03cf('0x35')][_0x03cf('0x85')],{'transaction':_0x3ee0c6})['then'](function(){if(!_[_0x03cf('0x86')](_0xad018e)){return _0x16845d['removeAgents'](_0xad018e,{'transaction':_0x3ee0c6});}})[_0x03cf('0x28')](function(){_0xad018e[_0x03cf('0x72')](function(_0x4a8801){socket[_0x03cf('0x73')]('userWhatsappQueue:remove',{'UserId':_0x4a8801,'WhatsappQueueId':_0x16845d['id']});});});});});});})[_0x03cf('0x28')](respondWithStatusCode(_0x1b4f45,null))['catch'](handleError(_0x1b4f45,null));};exports[_0x03cf('0x87')]=function(_0x4415d2,_0x4f479d,_0x5dd9c0){return db[_0x03cf('0x30')]['find']({'where':{'id':_0x4415d2[_0x03cf('0x48')]['id']}})[_0x03cf('0x28')](handleEntityNotFound(_0x4f479d,null))['then'](function(_0x400468){if(_0x400468){return _0x400468[_0x03cf('0x87')](_0x4415d2[_0x03cf('0x56')][_0x03cf('0x85')],_[_0x03cf('0x88')](_0x4415d2[_0x03cf('0x56')],[_0x03cf('0x85'),'id'])||{})[_0x03cf('0x89')](function(_0x7e2d92){for(var _0x1aa8c2=0x0;_0x1aa8c2<_0x4415d2[_0x03cf('0x56')][_0x03cf('0x85')][_0x03cf('0x3a')];_0x1aa8c2+=0x1){socket[_0x03cf('0x73')](_0x03cf('0x74'),{'UserId':Number(_0x4415d2[_0x03cf('0x56')][_0x03cf('0x85')][_0x1aa8c2]),'WhatsappQueueId':Number(_0x4415d2[_0x03cf('0x48')]['id'])});}return _0x7e2d92;});}})[_0x03cf('0x28')](respondWithResult(_0x4f479d,null))[_0x03cf('0x46')](handleError(_0x4f479d,null));};exports['removeAgents']=function(_0x305f2f,_0x1d66ff,_0x2b6048){return db[_0x03cf('0x30')]['find']({'where':{'id':_0x305f2f[_0x03cf('0x48')]['id']}})['then'](handleEntityNotFound(_0x1d66ff,null))[_0x03cf('0x28')](function(_0x55b78a){if(_0x55b78a){return _0x55b78a['removeAgents'](_0x305f2f[_0x03cf('0x35')][_0x03cf('0x85')])[_0x03cf('0x28')](function(){if(_[_0x03cf('0x8a')](_0x305f2f[_0x03cf('0x35')][_0x03cf('0x85')])){for(var _0x562e2e=0x0;_0x562e2e<_0x305f2f[_0x03cf('0x35')][_0x03cf('0x85')][_0x03cf('0x3a')];_0x562e2e+=0x1){socket[_0x03cf('0x73')](_0x03cf('0x8b'),{'UserId':Number(_0x305f2f[_0x03cf('0x35')]['ids'][_0x562e2e]),'WhatsappQueueId':Number(_0x305f2f[_0x03cf('0x48')]['id'])});}}else{socket[_0x03cf('0x73')](_0x03cf('0x8b'),{'UserId':Number(_0x305f2f[_0x03cf('0x35')][_0x03cf('0x85')]),'WhatsappQueueId':Number(_0x305f2f[_0x03cf('0x48')]['id'])});}});}})[_0x03cf('0x28')](respondWithStatusCode(_0x1d66ff,null))[_0x03cf('0x46')](handleError(_0x1d66ff,null));};exports['getAgents']=function(_0x40e482,_0x3fe24d,_0x312f9e){var _0x4804ae={};var _0x153507={};var _0x46e4a0;var _0x2fd0d4;return db['WhatsappQueue'][_0x03cf('0x68')]({'where':{'id':_0x40e482[_0x03cf('0x48')]['id']}})[_0x03cf('0x28')](handleEntityNotFound(_0x3fe24d,null))[_0x03cf('0x28')](function(_0x2cf15f){if(_0x2cf15f){_0x46e4a0=_0x2cf15f;_0x153507[_0x03cf('0x33')]=_[_0x03cf('0x4a')](db['User'][_0x03cf('0x49')]);_0x153507[_0x03cf('0x35')]=_[_0x03cf('0x4a')](_0x40e482[_0x03cf('0x35')]);_0x153507[_0x03cf('0x36')]=_['intersection'](_0x153507['model'],_0x153507[_0x03cf('0x35')]);_0x4804ae[_0x03cf('0x37')]=_[_0x03cf('0x38')](_0x153507['model'],qs[_0x03cf('0x39')](_0x40e482['query'][_0x03cf('0x39')]));_0x4804ae['attributes']=_0x4804ae[_0x03cf('0x37')][_0x03cf('0x3a')]?_0x4804ae[_0x03cf('0x37')]:_0x153507[_0x03cf('0x33')];_0x4804ae[_0x03cf('0x3c')]=qs['sort'](_0x40e482[_0x03cf('0x35')][_0x03cf('0x3d')]);_0x4804ae['where']=qs[_0x03cf('0x36')](_['pick'](_0x40e482['query'],_0x153507['filters']));if(_0x40e482[_0x03cf('0x35')][_0x03cf('0x3f')]){_0x4804ae['where']=_[_0x03cf('0x42')](_0x4804ae[_0x03cf('0x40')],{'$or':_['map'](_0x4804ae[_0x03cf('0x37')],function(_0xdd0102){var _0x3812e9={};_0x3812e9[_0xdd0102]={'$like':'%'+_0x40e482[_0x03cf('0x35')][_0x03cf('0x3f')]+'%'};return _0x3812e9;})});}_0x4804ae=_[_0x03cf('0x42')]({},_0x4804ae,_0x40e482['options']);return _0x46e4a0[_0x03cf('0x8c')](_0x4804ae);}})[_0x03cf('0x28')](function(_0x1d01f5){if(_0x1d01f5){_0x2fd0d4=_0x1d01f5[_0x03cf('0x3a')];if(!_0x40e482[_0x03cf('0x35')][_0x03cf('0x5a')](_0x03cf('0x3b'))){_0x4804ae[_0x03cf('0x20')]=qs[_0x03cf('0x20')](_0x40e482[_0x03cf('0x35')][_0x03cf('0x20')]);_0x4804ae[_0x03cf('0x23')]=qs[_0x03cf('0x23')](_0x40e482['query']['offset']);}return _0x46e4a0[_0x03cf('0x8c')](_0x4804ae);}})[_0x03cf('0x28')](function(_0x18528a){if(_0x18528a){return _0x18528a?{'count':_0x2fd0d4,'rows':_0x18528a}:null;}})[_0x03cf('0x28')](respondWithResult(_0x3fe24d,null))[_0x03cf('0x46')](handleError(_0x3fe24d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 6248e30..6fe1387 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 _0x8a52=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x2fc4a9,_0x5706b8){var _0x4e15eb=function(_0x46a1d2){while(--_0x46a1d2){_0x2fc4a9['push'](_0x2fc4a9['shift']());}};_0x4e15eb(++_0x5706b8);}(_0x8a52,0x1dc));var _0x28a5=function(_0x46253d,_0x395d05){_0x46253d=_0x46253d-0x0;var _0x1e9e66=_0x8a52[_0x46253d];return _0x1e9e66;};'use strict';var EventEmitter=require(_0x28a5('0x0'));var WhatsappQueue=require(_0x28a5('0x1'))['db'][_0x28a5('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x28a5('0x3')](0x0);var events={'afterCreate':_0x28a5('0x4'),'afterUpdate':_0x28a5('0x5'),'afterDestroy':_0x28a5('0x6')};function emitEvent(_0x44076a){return function(_0x4afac8,_0x5c7156,_0x29c32f){WhatsappQueueEvents[_0x28a5('0x7')](_0x44076a+':'+_0x4afac8['id'],_0x4afac8);WhatsappQueueEvents[_0x28a5('0x7')](_0x44076a,_0x4afac8);_0x29c32f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x28a5('0x8')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x4bf9=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bf9,0x1ec));var _0x94bf=function(_0x43c5ea,_0x3e05a1){_0x43c5ea=_0x43c5ea-0x0;var _0x5da38e=_0x4bf9[_0x43c5ea];return _0x5da38e;};'use strict';var EventEmitter=require(_0x94bf('0x0'));var WhatsappQueue=require(_0x94bf('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x94bf('0x2'),'afterUpdate':_0x94bf('0x3'),'afterDestroy':_0x94bf('0x4')};function emitEvent(_0x5267f3){return function(_0x468998,_0x28af5e,_0x5a48c4){WhatsappQueueEvents['emit'](_0x5267f3+':'+_0x468998['id'],_0x468998);WhatsappQueueEvents[_0x94bf('0x5')](_0x5267f3,_0x468998);_0x5a48c4(null);};}for(var e in events){if(events[_0x94bf('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x94bf('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 92635b2..c4a6b9a 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 _0xc6fd=['path','rimraf','../../config/environment','exports','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x504cbe,_0x2eb552){var _0x5b5f73=function(_0x7dc3e1){while(--_0x7dc3e1){_0x504cbe['push'](_0x504cbe['shift']());}};_0x5b5f73(++_0x2eb552);}(_0xc6fd,0x18a));var _0xdc6f=function(_0x172045,_0x4bc336){_0x172045=_0x172045-0x0;var _0x29cf47=_0xc6fd[_0x172045];return _0x29cf47;};'use strict';var _=require(_0xdc6f('0x0'));var util=require('util');var logger=require(_0xdc6f('0x1'))(_0xdc6f('0x2'));var moment=require(_0xdc6f('0x3'));var BPromise=require(_0xdc6f('0x4'));var rp=require(_0xdc6f('0x5'));var fs=require('fs');var path=require(_0xdc6f('0x6'));var rimraf=require(_0xdc6f('0x7'));var config=require(_0xdc6f('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0xdc6f('0x9')]=function(_0x3197e7,_0xf9d0e9){return _0x3197e7['define']('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0afb=['request-promise','path','rimraf','../../config/environment','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x29e5d1,_0x2c0acf){var _0x9ad429=function(_0x47a01e){while(--_0x47a01e){_0x29e5d1['push'](_0x29e5d1['shift']());}};_0x9ad429(++_0x2c0acf);}(_0x0afb,0x127));var _0xb0af=function(_0x47441f,_0x27e4c9){_0x47441f=_0x47441f-0x0;var _0x127a83=_0x0afb[_0x47441f];return _0x127a83;};'use strict';var _=require(_0xb0af('0x0'));var util=require('util');var logger=require(_0xb0af('0x1'))(_0xb0af('0x2'));var moment=require(_0xb0af('0x3'));var BPromise=require(_0xb0af('0x4'));var rp=require(_0xb0af('0x5'));var fs=require('fs');var path=require(_0xb0af('0x6'));var rimraf=require(_0xb0af('0x7'));var config=require(_0xb0af('0x8'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x47efa9,_0x313c74){return _0x47efa9[_0xb0af('0x9')](_0xb0af('0xa'),attributes,{'tableName':_0xb0af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 9c59a19..0cbe373 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 _0xd656=['message','result','catch','findAll','options','where','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','WhatsappQueue','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xd656,0x178));var _0x6d65=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd656[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x6d65('0x0'));var util=require(_0x6d65('0x1'));var moment=require(_0x6d65('0x2'));var BPromise=require(_0x6d65('0x3'));var rs=require(_0x6d65('0x4'));var fs=require('fs');var Redis=require(_0x6d65('0x5'));var db=require(_0x6d65('0x6'))['db'];var utils=require(_0x6d65('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d65('0x8'));var jayson=require(_0x6d65('0x9'));var client=jayson[_0x6d65('0xa')]['http']({'port':0x232a});config[_0x6d65('0xb')]=_[_0x6d65('0xc')](config[_0x6d65('0xb')],{'host':_0x6d65('0xd'),'port':0x18eb});var socket=require(_0x6d65('0xe'))(new Redis(config[_0x6d65('0xb')]));require(_0x6d65('0xf'))['register'](socket);function respondWithRpcPromise(_0x7c4b0d,_0x562ca8,_0xcdfde3){return new BPromise(function(_0x309465,_0x3f460c){return client[_0x6d65('0x10')](_0x7c4b0d,_0xcdfde3)[_0x6d65('0x11')](function(_0x2fb63c){logger[_0x6d65('0x12')](_0x6d65('0x13'),_0x562ca8,_0x6d65('0x14'));logger[_0x6d65('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x562ca8,_0x6d65('0x14'),JSON['stringify'](_0x2fb63c));if(_0x2fb63c[_0x6d65('0x16')]){if(_0x2fb63c[_0x6d65('0x16')][_0x6d65('0x17')]===0x1f4){logger[_0x6d65('0x16')](_0x6d65('0x13'),_0x562ca8,_0x2fb63c[_0x6d65('0x16')][_0x6d65('0x18')]);return _0x3f460c(_0x2fb63c[_0x6d65('0x16')][_0x6d65('0x18')]);}logger[_0x6d65('0x16')](_0x6d65('0x13'),_0x562ca8,_0x2fb63c[_0x6d65('0x16')][_0x6d65('0x18')]);return _0x309465(_0x2fb63c['error'][_0x6d65('0x18')]);}else{logger[_0x6d65('0x12')](_0x6d65('0x13'),_0x562ca8,_0x6d65('0x14'));_0x309465(_0x2fb63c[_0x6d65('0x19')][_0x6d65('0x18')]);}})[_0x6d65('0x1a')](function(_0x16d4d5){logger[_0x6d65('0x16')](_0x6d65('0x13'),_0x562ca8,_0x16d4d5);_0x3f460c(_0x16d4d5);});});}exports['GetWhatsappQueue']=function(_0x522809){var _0x4f004b=this;return new Promise(function(_0x420f27,_0x536559){return db['WhatsappQueue'][_0x6d65('0x1b')]({'raw':_0x522809[_0x6d65('0x1c')]?_0x522809[_0x6d65('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x522809[_0x6d65('0x1c')]?_0x522809[_0x6d65('0x1c')][_0x6d65('0x1d')]||null:null,'attributes':_0x522809[_0x6d65('0x1c')]?_0x522809[_0x6d65('0x1c')][_0x6d65('0x1e')]||null:null,'limit':_0x522809[_0x6d65('0x1c')]?_0x522809[_0x6d65('0x1c')][_0x6d65('0x1f')]||null:null,'include':_0x522809[_0x6d65('0x1c')]?_0x522809[_0x6d65('0x1c')][_0x6d65('0x20')]?_[_0x6d65('0x21')](_0x522809[_0x6d65('0x1c')][_0x6d65('0x20')],function(_0x1dc5b9){return{'model':db[_0x1dc5b9['model']],'as':_0x1dc5b9['as'],'attributes':_0x1dc5b9[_0x6d65('0x1e')],'include':_0x1dc5b9[_0x6d65('0x20')]?_[_0x6d65('0x21')](_0x1dc5b9[_0x6d65('0x20')],function(_0xdc454){return{'model':db[_0xdc454[_0x6d65('0x22')]],'as':_0xdc454['as'],'attributes':_0xdc454[_0x6d65('0x1e')],'include':_0xdc454[_0x6d65('0x20')]?_[_0x6d65('0x21')](_0xdc454['include'],function(_0x30a141){return{'model':db[_0x30a141[_0x6d65('0x22')]],'as':_0x30a141['as'],'attributes':_0x30a141[_0x6d65('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6d65('0x11')](function(_0x37e128){logger[_0x6d65('0x12')]('GetWhatsappQueue',_0x522809);logger[_0x6d65('0x15')](_0x6d65('0x23'),_0x522809,JSON['stringify'](_0x37e128));_0x420f27(_0x37e128);})[_0x6d65('0x1a')](function(_0x19021d){logger[_0x6d65('0x16')](_0x6d65('0x23'),_0x19021d['message'],_0x522809);_0x536559(_0x4f004b[_0x6d65('0x16')](0x1f4,_0x19021d['message']));});});};exports[_0x6d65('0x24')]=function(_0x1dd96d){var _0x4cb240=this;return new Promise(function(_0xcc438b,_0x212bba){return db[_0x6d65('0x25')]['find']({'raw':_0x1dd96d[_0x6d65('0x1c')]?_0x1dd96d['options'][_0x6d65('0x26')]===undefined?!![]:![]:!![],'where':_0x1dd96d['options']?_0x1dd96d[_0x6d65('0x1c')][_0x6d65('0x1d')]||null:null,'attributes':_0x1dd96d['options']?_0x1dd96d[_0x6d65('0x1c')]['attributes']||null:null,'include':_0x1dd96d[_0x6d65('0x1c')]?_0x1dd96d[_0x6d65('0x1c')][_0x6d65('0x20')]?_[_0x6d65('0x21')](_0x1dd96d[_0x6d65('0x1c')]['include'],function(_0x15f4a9){return{'model':db[_0x15f4a9[_0x6d65('0x22')]],'as':_0x15f4a9['as'],'attributes':_0x15f4a9['attributes'],'include':_0x15f4a9['include']?_[_0x6d65('0x21')](_0x15f4a9['include'],function(_0xaf05e3){return{'model':db[_0xaf05e3[_0x6d65('0x22')]],'as':_0xaf05e3['as'],'attributes':_0xaf05e3[_0x6d65('0x1e')],'include':_0xaf05e3[_0x6d65('0x20')]?_[_0x6d65('0x21')](_0xaf05e3[_0x6d65('0x20')],function(_0x149176){return{'model':db[_0x149176['model']],'as':_0x149176['as'],'attributes':_0x149176['attributes']};}):[]};}):[]};}):[]:[]})[_0x6d65('0x11')](function(_0x3456d3){logger[_0x6d65('0x12')](_0x6d65('0x24'),_0x1dd96d);logger[_0x6d65('0x15')]('ShowWhatsappQueue',_0x1dd96d,JSON[_0x6d65('0x27')](_0x3456d3));_0xcc438b(_0x3456d3);})[_0x6d65('0x1a')](function(_0x3169a0){logger[_0x6d65('0x16')](_0x6d65('0x24'),_0x3169a0[_0x6d65('0x18')],_0x1dd96d);_0x212bba(_0x4cb240['error'](0x1f4,_0x3169a0[_0x6d65('0x18')]));});});}; \ No newline at end of file +var _0x2ce1=['ShowWhatsappQueue','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','socket.io-emitter','./whatsappQueue.socket','request','then','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','include','map','model','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ce1,0x1f0));var _0x12ce=function(_0x6cc57,_0x14a1bd){_0x6cc57=_0x6cc57-0x0;var _0x3c964b=_0x2ce1[_0x6cc57];return _0x3c964b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x12ce('0x0'));var BPromise=require(_0x12ce('0x1'));var rs=require(_0x12ce('0x2'));var fs=require('fs');var Redis=require(_0x12ce('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x12ce('0x4'));var logger=require('../../config/logger')(_0x12ce('0x5'));var config=require(_0x12ce('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x12ce('0x7')][_0x12ce('0x8')]({'port':0x232a});config[_0x12ce('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x12ce('0xa'))(new Redis(config[_0x12ce('0x9')]));require(_0x12ce('0xb'))['register'](socket);function respondWithRpcPromise(_0x3182de,_0x4fe352,_0xa1b68){return new BPromise(function(_0x316ff1,_0x43c8f7){return client[_0x12ce('0xc')](_0x3182de,_0xa1b68)[_0x12ce('0xd')](function(_0xbd0287){logger['info'](_0x12ce('0xe'),_0x4fe352,'request\x20sent');logger[_0x12ce('0xf')](_0x12ce('0x10'),_0x4fe352,'request\x20sent',JSON[_0x12ce('0x11')](_0xbd0287));if(_0xbd0287[_0x12ce('0x12')]){if(_0xbd0287[_0x12ce('0x12')]['code']===0x1f4){logger[_0x12ce('0x12')](_0x12ce('0xe'),_0x4fe352,_0xbd0287[_0x12ce('0x12')][_0x12ce('0x13')]);return _0x43c8f7(_0xbd0287[_0x12ce('0x12')][_0x12ce('0x13')]);}logger['error'](_0x12ce('0xe'),_0x4fe352,_0xbd0287[_0x12ce('0x12')][_0x12ce('0x13')]);return _0x316ff1(_0xbd0287[_0x12ce('0x12')]['message']);}else{logger['info'](_0x12ce('0xe'),_0x4fe352,_0x12ce('0x14'));_0x316ff1(_0xbd0287['result'][_0x12ce('0x13')]);}})[_0x12ce('0x15')](function(_0x2a2a3c){logger['error'](_0x12ce('0xe'),_0x4fe352,_0x2a2a3c);_0x43c8f7(_0x2a2a3c);});});}exports[_0x12ce('0x16')]=function(_0x239b19){var _0x446495=this;return new Promise(function(_0x2501af,_0x111dad){return db[_0x12ce('0x17')]['findAll']({'raw':_0x239b19[_0x12ce('0x18')]?_0x239b19['options'][_0x12ce('0x19')]===undefined?!![]:![]:!![],'where':_0x239b19[_0x12ce('0x18')]?_0x239b19['options'][_0x12ce('0x1a')]||null:null,'attributes':_0x239b19[_0x12ce('0x18')]?_0x239b19['options'][_0x12ce('0x1b')]||null:null,'limit':_0x239b19[_0x12ce('0x18')]?_0x239b19[_0x12ce('0x18')]['limit']||null:null,'include':_0x239b19[_0x12ce('0x18')]?_0x239b19[_0x12ce('0x18')][_0x12ce('0x1c')]?_[_0x12ce('0x1d')](_0x239b19[_0x12ce('0x18')][_0x12ce('0x1c')],function(_0x566a2f){return{'model':db[_0x566a2f['model']],'as':_0x566a2f['as'],'attributes':_0x566a2f[_0x12ce('0x1b')],'include':_0x566a2f[_0x12ce('0x1c')]?_['map'](_0x566a2f[_0x12ce('0x1c')],function(_0x581500){return{'model':db[_0x581500['model']],'as':_0x581500['as'],'attributes':_0x581500[_0x12ce('0x1b')],'include':_0x581500[_0x12ce('0x1c')]?_[_0x12ce('0x1d')](_0x581500[_0x12ce('0x1c')],function(_0x33d00c){return{'model':db[_0x33d00c[_0x12ce('0x1e')]],'as':_0x33d00c['as'],'attributes':_0x33d00c[_0x12ce('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x12ce('0xd')](function(_0x644848){logger[_0x12ce('0x1f')]('GetWhatsappQueue',_0x239b19);logger[_0x12ce('0xf')](_0x12ce('0x16'),_0x239b19,JSON['stringify'](_0x644848));_0x2501af(_0x644848);})['catch'](function(_0x460875){logger[_0x12ce('0x12')](_0x12ce('0x16'),_0x460875[_0x12ce('0x13')],_0x239b19);_0x111dad(_0x446495[_0x12ce('0x12')](0x1f4,_0x460875[_0x12ce('0x13')]));});});};exports[_0x12ce('0x20')]=function(_0xf4240){var _0x3a2a6f=this;return new Promise(function(_0x55b13e,_0x40bab3){return db[_0x12ce('0x17')]['find']({'raw':_0xf4240['options']?_0xf4240[_0x12ce('0x18')][_0x12ce('0x19')]===undefined?!![]:![]:!![],'where':_0xf4240[_0x12ce('0x18')]?_0xf4240[_0x12ce('0x18')][_0x12ce('0x1a')]||null:null,'attributes':_0xf4240[_0x12ce('0x18')]?_0xf4240[_0x12ce('0x18')][_0x12ce('0x1b')]||null:null,'include':_0xf4240[_0x12ce('0x18')]?_0xf4240['options'][_0x12ce('0x1c')]?_[_0x12ce('0x1d')](_0xf4240[_0x12ce('0x18')][_0x12ce('0x1c')],function(_0x532771){return{'model':db[_0x532771['model']],'as':_0x532771['as'],'attributes':_0x532771[_0x12ce('0x1b')],'include':_0x532771[_0x12ce('0x1c')]?_[_0x12ce('0x1d')](_0x532771[_0x12ce('0x1c')],function(_0x50e1e2){return{'model':db[_0x50e1e2[_0x12ce('0x1e')]],'as':_0x50e1e2['as'],'attributes':_0x50e1e2[_0x12ce('0x1b')],'include':_0x50e1e2[_0x12ce('0x1c')]?_[_0x12ce('0x1d')](_0x50e1e2['include'],function(_0x389ecd){return{'model':db[_0x389ecd[_0x12ce('0x1e')]],'as':_0x389ecd['as'],'attributes':_0x389ecd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x62007f){logger[_0x12ce('0x1f')](_0x12ce('0x20'),_0xf4240);logger[_0x12ce('0xf')]('ShowWhatsappQueue',_0xf4240,JSON[_0x12ce('0x11')](_0x62007f));_0x55b13e(_0x62007f);})[_0x12ce('0x15')](function(_0x4043f4){logger['error']('ShowWhatsappQueue',_0x4043f4[_0x12ce('0x13')],_0xf4240);_0x40bab3(_0x3a2a6f['error'](0x1f4,_0x4043f4[_0x12ce('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index ea73bd4..77b15db 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 _0xbadf=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','emit','removeListener'];(function(_0x321817,_0x3e80b9){var _0x53c9ee=function(_0x288277){while(--_0x288277){_0x321817['push'](_0x321817['shift']());}};_0x53c9ee(++_0x3e80b9);}(_0xbadf,0x1cb));var _0xfbad=function(_0x4aac5a,_0x15b04c){_0x4aac5a=_0x4aac5a-0x0;var _0x42e7bc=_0xbadf[_0x4aac5a];return _0x42e7bc;};'use strict';var WhatsappQueueEvents=require(_0xfbad('0x0'));var events=[_0xfbad('0x1'),_0xfbad('0x2'),'update'];function createListener(_0x2b2224,_0x43512a){return function(_0x272d14){_0x43512a[_0xfbad('0x3')](_0x2b2224,_0x272d14);};}function removeListener(_0x140862,_0x4dd138){return function(){WhatsappQueueEvents[_0xfbad('0x4')](_0x140862,_0x4dd138);};}exports[_0xfbad('0x5')]=function(_0x32151e){for(var _0x1d8568=0x0,_0x3379ff=events[_0xfbad('0x6')];_0x1d8568<_0x3379ff;_0x1d8568++){var _0x685836=events[_0x1d8568];var _0x4ff868=createListener(_0xfbad('0x7')+_0x685836,_0x32151e);WhatsappQueueEvents['on'](_0x685836,_0x4ff868);}}; \ No newline at end of file +var _0xfa44=['length','whatsappQueue:','./whatsappQueue.events','remove','emit','removeListener'];(function(_0x3dda76,_0x1c59f0){var _0x1b87d8=function(_0x261aa5){while(--_0x261aa5){_0x3dda76['push'](_0x3dda76['shift']());}};_0x1b87d8(++_0x1c59f0);}(_0xfa44,0xc2));var _0x4fa4=function(_0x22ad0c,_0x56e8a1){_0x22ad0c=_0x22ad0c-0x0;var _0x3787a9=_0xfa44[_0x22ad0c];return _0x3787a9;};'use strict';var WhatsappQueueEvents=require(_0x4fa4('0x0'));var events=['save',_0x4fa4('0x1'),'update'];function createListener(_0x3acc84,_0x1af25d){return function(_0x28b947){_0x1af25d[_0x4fa4('0x2')](_0x3acc84,_0x28b947);};}function removeListener(_0x9d2534,_0x4b076e){return function(){WhatsappQueueEvents[_0x4fa4('0x3')](_0x9d2534,_0x4b076e);};}exports['register']=function(_0x56a574){for(var _0x5f1b2a=0x0,_0x487c23=events[_0x4fa4('0x4')];_0x5f1b2a<_0x487c23;_0x5f1b2a++){var _0x40db7c=events[_0x5f1b2a];var _0x9e0d5a=createListener(_0x4fa4('0x5')+_0x40db7c,_0x56a574);WhatsappQueueEvents['on'](_0x40db7c,_0x9e0d5a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index d7c9e84..c84ba5e 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 _0xd936=['isAuthenticated','get','/describe','describe','/:id','show','create','put','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x455a64,_0x10c8f4){var _0x45599f=function(_0x4fb0cc){while(--_0x4fb0cc){_0x455a64['push'](_0x455a64['shift']());}};_0x45599f(++_0x10c8f4);}(_0xd936,0xe6));var _0x6d93=function(_0x448614,_0x90e736){_0x448614=_0x448614-0x0;var _0x4d96a3=_0xd936[_0x448614];return _0x4d96a3;};'use strict';var multer=require(_0x6d93('0x0'));var util=require(_0x6d93('0x1'));var path=require(_0x6d93('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6d93('0x3')]();var fs_extra=require(_0x6d93('0x4'));var auth=require(_0x6d93('0x5'));var interaction=require(_0x6d93('0x6'));var config=require(_0x6d93('0x7'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0x6d93('0x8')](),controller['index']);router[_0x6d93('0x9')](_0x6d93('0xa'),auth[_0x6d93('0x8')](),controller[_0x6d93('0xb')]);router[_0x6d93('0x9')](_0x6d93('0xc'),auth[_0x6d93('0x8')](),controller[_0x6d93('0xd')]);router['post']('/',auth[_0x6d93('0x8')](),controller[_0x6d93('0xe')]);router[_0x6d93('0xf')]('/:id',auth[_0x6d93('0x8')](),controller['update']);router[_0x6d93('0x10')]('/:id',auth[_0x6d93('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd1a8=['isAuthenticated','index','/describe','/:id','post','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get'];(function(_0x9f7af3,_0xcbe532){var _0x64fafa=function(_0x1a3cfe){while(--_0x1a3cfe){_0x9f7af3['push'](_0x9f7af3['shift']());}};_0x64fafa(++_0xcbe532);}(_0xd1a8,0x9a));var _0x8d1a=function(_0x518b2f,_0xd21f9a){_0x518b2f=_0x518b2f-0x0;var _0x27e008=_0xd1a8[_0x518b2f];return _0x27e008;};'use strict';var multer=require(_0x8d1a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8d1a('0x1'));var router=express[_0x8d1a('0x2')]();var fs_extra=require(_0x8d1a('0x3'));var auth=require(_0x8d1a('0x4'));var interaction=require(_0x8d1a('0x5'));var config=require('../../config/environment');var controller=require(_0x8d1a('0x6'));router[_0x8d1a('0x7')]('/',auth[_0x8d1a('0x8')](),controller[_0x8d1a('0x9')]);router[_0x8d1a('0x7')](_0x8d1a('0xa'),auth[_0x8d1a('0x8')](),controller['describe']);router['get'](_0x8d1a('0xb'),auth[_0x8d1a('0x8')](),controller['show']);router[_0x8d1a('0xc')]('/',auth[_0x8d1a('0x8')](),controller['create']);router[_0x8d1a('0xd')](_0x8d1a('0xb'),auth[_0x8d1a('0x8')](),controller[_0x8d1a('0xe')]);router[_0x8d1a('0xf')](_0x8d1a('0xb'),auth[_0x8d1a('0x8')](),controller[_0x8d1a('0x10')]);module[_0x8d1a('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index d326dfd..119e27f 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(_0x334b09,_0x270dbe){var _0x291f95=function(_0x58284c){while(--_0x58284c){_0x334b09['push'](_0x334b09['shift']());}};_0x291f95(++_0x270dbe);}(_0x7a54,0x106));var _0x47a5=function(_0x423aad,_0x5d95c2){_0x423aad=_0x423aad-0x0;var _0x2d8778=_0x7a54[_0x423aad];return _0x2d8778;};'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(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 25cfc0d..3cbe2e2 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 _0x5c00=['request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','params','includeAll','catch','create','body','destroy','find','describe','eml-format','rimraf','zip-dir'];(function(_0x4f3322,_0x5a5a37){var _0x136fc2=function(_0x4142f8){while(--_0x4142f8){_0x4f3322['push'](_0x4f3322['shift']());}};_0x136fc2(++_0x5a5a37);}(_0x5c00,0x17e));var _0x05c0=function(_0xd719d2,_0x88d330){_0xd719d2=_0xd719d2-0x0;var _0x2c1995=_0x5c00[_0xd719d2];return _0x2c1995;};'use strict';var emlformat=require(_0x05c0('0x0'));var rimraf=require(_0x05c0('0x1'));var zipdir=require(_0x05c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x05c0('0x3'));var moment=require('moment');var BPromise=require(_0x05c0('0x4'));var Mustache=require(_0x05c0('0x5'));var util=require(_0x05c0('0x6'));var path=require(_0x05c0('0x7'));var sox=require('sox');var csv=require(_0x05c0('0x8'));var ejs=require(_0x05c0('0x9'));var fs=require('fs');var fs_extra=require(_0x05c0('0xa'));var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05c0('0x15'));var utils=require('../../config/utils');var config=require(_0x05c0('0x16'));var licenseUtil=require(_0x05c0('0x17'));var db=require(_0x05c0('0x18'))['db'];function respondWithStatusCode(_0x5a3e65,_0x4e39d4){_0x4e39d4=_0x4e39d4||0xcc;return function(_0x5eec41){if(_0x5eec41){return _0x5a3e65[_0x05c0('0x19')](_0x4e39d4);}return _0x5a3e65[_0x05c0('0x1a')](_0x4e39d4)[_0x05c0('0x1b')]();};}function respondWithResult(_0x12deeb,_0x25764b){_0x25764b=_0x25764b||0xc8;return function(_0xe57ed0){if(_0xe57ed0){return _0x12deeb[_0x05c0('0x1a')](_0x25764b)[_0x05c0('0x1c')](_0xe57ed0);}};}function respondWithFilteredResult(_0x4c3e54,_0x238e25){return function(_0x161a5f){if(_0x161a5f){var _0x4bb164=typeof _0x238e25[_0x05c0('0x1d')]===_0x05c0('0x1e')&&typeof _0x238e25[_0x05c0('0x1f')]===_0x05c0('0x1e');var _0xd07ad1=_0x161a5f[_0x05c0('0x20')];var _0x521cbd=_0x4bb164?0x0:_0x238e25[_0x05c0('0x1d')];var _0x1230e5=_0x4bb164?_0x161a5f[_0x05c0('0x20')]:_0x238e25['offset']+_0x238e25[_0x05c0('0x1f')];var _0x2023d6;if(_0x1230e5>=_0xd07ad1){_0x1230e5=_0xd07ad1;_0x2023d6=0xc8;}else{_0x2023d6=0xce;}_0x4c3e54[_0x05c0('0x1a')](_0x2023d6);return _0x4c3e54[_0x05c0('0x21')](_0x05c0('0x22'),_0x521cbd+'-'+_0x1230e5+'/'+_0xd07ad1)['json'](_0x161a5f);}return null;};}function patchUpdates(_0x407c1f){return function(_0x1014ef){try{jsonpatch['apply'](_0x1014ef,_0x407c1f,!![]);}catch(_0x548a0c){return BPromise['reject'](_0x548a0c);}return _0x1014ef[_0x05c0('0x23')]();};}function saveUpdates(_0x2055a3,_0x83f29){return function(_0x8e2d4){if(_0x8e2d4){return _0x8e2d4[_0x05c0('0x24')](_0x2055a3)[_0x05c0('0x25')](function(_0x14224f){return _0x14224f;});}return null;};}function removeEntity(_0x5b4eef,_0x9b4930){return function(_0x1abbf3){if(_0x1abbf3){return _0x1abbf3['destroy']()['then'](function(){_0x5b4eef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56aa78,_0x3df135){return function(_0x15b497){if(!_0x15b497){_0x56aa78['sendStatus'](0x194);}return _0x15b497;};}function handleError(_0x41a6a2,_0x336e1b){_0x336e1b=_0x336e1b||0x1f4;return function(_0x3617dc){logger[_0x05c0('0x26')](_0x3617dc['stack']);if(_0x3617dc[_0x05c0('0x27')]){delete _0x3617dc[_0x05c0('0x27')];}_0x41a6a2[_0x05c0('0x1a')](_0x336e1b)[_0x05c0('0x28')](_0x3617dc);};}exports[_0x05c0('0x29')]=function(_0x5d12e0,_0x57886b){var _0x56ba64={},_0x2df109={},_0xbe7d9e={'count':0x0,'rows':[]};var _0x2053d5=_[_0x05c0('0x2a')](db[_0x05c0('0x2b')][_0x05c0('0x2c')],function(_0x1c4c8f){return{'name':_0x1c4c8f[_0x05c0('0x2d')],'type':_0x1c4c8f[_0x05c0('0x2e')][_0x05c0('0x2f')]};});_0x2df109[_0x05c0('0x30')]=_[_0x05c0('0x2a')](_0x2053d5,'name');_0x2df109['query']=_[_0x05c0('0x31')](_0x5d12e0[_0x05c0('0x32')]);_0x2df109[_0x05c0('0x33')]=_['intersection'](_0x2df109[_0x05c0('0x30')],_0x2df109[_0x05c0('0x32')]);_0x56ba64['attributes']=_[_0x05c0('0x34')](_0x2df109['model'],qs[_0x05c0('0x35')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x35')]));_0x56ba64[_0x05c0('0x36')]=_0x56ba64[_0x05c0('0x36')][_0x05c0('0x37')]?_0x56ba64[_0x05c0('0x36')]:_0x2df109[_0x05c0('0x30')];if(!_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x38')](_0x05c0('0x39'))){_0x56ba64[_0x05c0('0x1f')]=qs[_0x05c0('0x1f')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x1f')]);_0x56ba64[_0x05c0('0x1d')]=qs[_0x05c0('0x1d')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x1d')]);}_0x56ba64[_0x05c0('0x3a')]=qs[_0x05c0('0x3b')](_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x3b')]);_0x56ba64[_0x05c0('0x3c')]=qs[_0x05c0('0x33')](_[_0x05c0('0x3d')](_0x5d12e0[_0x05c0('0x32')],_0x2df109[_0x05c0('0x33')]),_0x2053d5);if(_0x5d12e0[_0x05c0('0x32')][_0x05c0('0x3e')]){_0x56ba64[_0x05c0('0x3c')]=_[_0x05c0('0x3f')](_0x56ba64[_0x05c0('0x3c')],{'$or':_['map'](_0x2053d5,function(_0x2a19b4){if(_0x2a19b4[_0x05c0('0x2e')]!==_0x05c0('0x40')){var _0x3eff9e={};_0x3eff9e[_0x2a19b4['name']]={'$like':'%'+_0x5d12e0['query'][_0x05c0('0x3e')]+'%'};return _0x3eff9e;}})});}_0x56ba64=_[_0x05c0('0x3f')]({},_0x56ba64,_0x5d12e0[_0x05c0('0x41')]);var _0x4ced8e={'where':_0x56ba64[_0x05c0('0x3c')]};return db[_0x05c0('0x2b')][_0x05c0('0x20')](_0x4ced8e)[_0x05c0('0x25')](function(_0x47b349){_0xbe7d9e[_0x05c0('0x20')]=_0x47b349;if(_0x5d12e0[_0x05c0('0x32')]['includeAll']){_0x56ba64[_0x05c0('0x42')]=[{'all':!![]}];}return db[_0x05c0('0x2b')][_0x05c0('0x43')](_0x56ba64);})[_0x05c0('0x25')](function(_0x164e3a){_0xbe7d9e[_0x05c0('0x44')]=_0x164e3a;return _0xbe7d9e;})[_0x05c0('0x25')](respondWithFilteredResult(_0x57886b,_0x56ba64))['catch'](handleError(_0x57886b,null));};exports['show']=function(_0x29d62a,_0x1d1d94){var _0xaa5d53={'raw':!![],'where':{'id':_0x29d62a[_0x05c0('0x45')]['id']}},_0x11f079={};_0x11f079['model']=_[_0x05c0('0x31')](db[_0x05c0('0x2b')][_0x05c0('0x2c')]);_0x11f079[_0x05c0('0x32')]=_[_0x05c0('0x31')](_0x29d62a[_0x05c0('0x32')]);_0x11f079[_0x05c0('0x33')]=_['intersection'](_0x11f079[_0x05c0('0x30')],_0x11f079[_0x05c0('0x32')]);_0xaa5d53[_0x05c0('0x36')]=_[_0x05c0('0x34')](_0x11f079[_0x05c0('0x30')],qs[_0x05c0('0x35')](_0x29d62a[_0x05c0('0x32')][_0x05c0('0x35')]));_0xaa5d53[_0x05c0('0x36')]=_0xaa5d53[_0x05c0('0x36')][_0x05c0('0x37')]?_0xaa5d53['attributes']:_0x11f079['model'];if(_0x29d62a[_0x05c0('0x32')][_0x05c0('0x46')]){_0xaa5d53[_0x05c0('0x42')]=[{'all':!![]}];}_0xaa5d53=_[_0x05c0('0x3f')]({},_0xaa5d53,_0x29d62a[_0x05c0('0x41')]);return db[_0x05c0('0x2b')]['find'](_0xaa5d53)[_0x05c0('0x25')](handleEntityNotFound(_0x1d1d94,null))[_0x05c0('0x25')](respondWithResult(_0x1d1d94,null))[_0x05c0('0x47')](handleError(_0x1d1d94,null));};exports[_0x05c0('0x48')]=function(_0x587190,_0x34e94e){return db[_0x05c0('0x2b')][_0x05c0('0x48')](_0x587190[_0x05c0('0x49')],{})['then'](respondWithResult(_0x34e94e,0xc9))[_0x05c0('0x47')](handleError(_0x34e94e,null));};exports[_0x05c0('0x24')]=function(_0x2e5660,_0x9b521b){if(_0x2e5660['body']['id']){delete _0x2e5660[_0x05c0('0x49')]['id'];}return db[_0x05c0('0x2b')]['find']({'where':{'id':_0x2e5660[_0x05c0('0x45')]['id']}})['then'](handleEntityNotFound(_0x9b521b,null))['then'](saveUpdates(_0x2e5660[_0x05c0('0x49')],null))['then'](respondWithResult(_0x9b521b,null))[_0x05c0('0x47')](handleError(_0x9b521b,null));};exports[_0x05c0('0x4a')]=function(_0x2fedc0,_0x371aff){return db[_0x05c0('0x2b')][_0x05c0('0x4b')]({'where':{'id':_0x2fedc0['params']['id']}})[_0x05c0('0x25')](handleEntityNotFound(_0x371aff,null))['then'](removeEntity(_0x371aff,null))[_0x05c0('0x47')](handleError(_0x371aff,null));};exports[_0x05c0('0x4c')]=function(_0x183883,_0x13ad38){return db[_0x05c0('0x2b')][_0x05c0('0x4c')]()[_0x05c0('0x25')](respondWithResult(_0x13ad38,null))['catch'](handleError(_0x13ad38,null));}; \ No newline at end of file +var _0x36ee=['describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','WhatsappQueueReport','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','find'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe36e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe36e('0x1'));var moment=require(_0xe36e('0x2'));var BPromise=require(_0xe36e('0x3'));var Mustache=require(_0xe36e('0x4'));var util=require(_0xe36e('0x5'));var path=require(_0xe36e('0x6'));var sox=require(_0xe36e('0x7'));var csv=require(_0xe36e('0x8'));var ejs=require(_0xe36e('0x9'));var fs=require('fs');var fs_extra=require(_0xe36e('0xa'));var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x8'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var licenseUtil=require(_0xe36e('0x17'));var db=require(_0xe36e('0x18'))['db'];function respondWithStatusCode(_0x4fbdb2,_0x32981d){_0x32981d=_0x32981d||0xcc;return function(_0x27841e){if(_0x27841e){return _0x4fbdb2[_0xe36e('0x19')](_0x32981d);}return _0x4fbdb2[_0xe36e('0x1a')](_0x32981d)['end']();};}function respondWithResult(_0x3e264a,_0x521afa){_0x521afa=_0x521afa||0xc8;return function(_0x525155){if(_0x525155){return _0x3e264a[_0xe36e('0x1a')](_0x521afa)[_0xe36e('0x1b')](_0x525155);}};}function respondWithFilteredResult(_0x26fb37,_0x278135){return function(_0xd6828e){if(_0xd6828e){var _0x924cd5=typeof _0x278135[_0xe36e('0x1c')]===_0xe36e('0x1d')&&typeof _0x278135[_0xe36e('0x1e')]===_0xe36e('0x1d');var _0x5792e8=_0xd6828e[_0xe36e('0x1f')];var _0x2184ae=_0x924cd5?0x0:_0x278135['offset'];var _0x21d9a3=_0x924cd5?_0xd6828e['count']:_0x278135[_0xe36e('0x1c')]+_0x278135[_0xe36e('0x1e')];var _0x5e15f5;if(_0x21d9a3>=_0x5792e8){_0x21d9a3=_0x5792e8;_0x5e15f5=0xc8;}else{_0x5e15f5=0xce;}_0x26fb37[_0xe36e('0x1a')](_0x5e15f5);return _0x26fb37[_0xe36e('0x20')](_0xe36e('0x21'),_0x2184ae+'-'+_0x21d9a3+'/'+_0x5792e8)['json'](_0xd6828e);}return null;};}function patchUpdates(_0x21e95e){return function(_0x21bcf9){try{jsonpatch[_0xe36e('0x22')](_0x21bcf9,_0x21e95e,!![]);}catch(_0x3c4017){return BPromise[_0xe36e('0x23')](_0x3c4017);}return _0x21bcf9[_0xe36e('0x24')]();};}function saveUpdates(_0x4f438a,_0xd71137){return function(_0x4f214a){if(_0x4f214a){return _0x4f214a[_0xe36e('0x25')](_0x4f438a)[_0xe36e('0x26')](function(_0x437f3f){return _0x437f3f;});}return null;};}function removeEntity(_0x53e13a,_0x598a7a){return function(_0x4749a8){if(_0x4749a8){return _0x4749a8[_0xe36e('0x27')]()[_0xe36e('0x26')](function(){_0x53e13a[_0xe36e('0x1a')](0xcc)[_0xe36e('0x28')]();});}};}function handleEntityNotFound(_0x1507f9,_0x1a045c){return function(_0x5ac484){if(!_0x5ac484){_0x1507f9[_0xe36e('0x19')](0x194);}return _0x5ac484;};}function handleError(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0x1f4;return function(_0x262caa){logger['error'](_0x262caa[_0xe36e('0x29')]);if(_0x262caa['name']){delete _0x262caa[_0xe36e('0x2a')];}_0x35f9e7['status'](_0x10597f)[_0xe36e('0x2b')](_0x262caa);};}exports['index']=function(_0x410504,_0x4c5d98){var _0x3b1045={},_0x59548b={},_0x4bb75b={'count':0x0,'rows':[]};var _0x5d8fd8=_['map'](db[_0xe36e('0x2c')][_0xe36e('0x2d')],function(_0x4cf185){return{'name':_0x4cf185['fieldName'],'type':_0x4cf185[_0xe36e('0x2e')][_0xe36e('0x2f')]};});_0x59548b[_0xe36e('0x30')]=_[_0xe36e('0x31')](_0x5d8fd8,_0xe36e('0x2a'));_0x59548b[_0xe36e('0x32')]=_['keys'](_0x410504[_0xe36e('0x32')]);_0x59548b[_0xe36e('0x33')]=_['intersection'](_0x59548b[_0xe36e('0x30')],_0x59548b[_0xe36e('0x32')]);_0x3b1045[_0xe36e('0x34')]=_[_0xe36e('0x35')](_0x59548b[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x410504[_0xe36e('0x32')][_0xe36e('0x36')]));_0x3b1045[_0xe36e('0x34')]=_0x3b1045[_0xe36e('0x34')][_0xe36e('0x37')]?_0x3b1045['attributes']:_0x59548b[_0xe36e('0x30')];if(!_0x410504['query']['hasOwnProperty'](_0xe36e('0x38'))){_0x3b1045['limit']=qs[_0xe36e('0x1e')](_0x410504[_0xe36e('0x32')][_0xe36e('0x1e')]);_0x3b1045[_0xe36e('0x1c')]=qs['offset'](_0x410504['query'][_0xe36e('0x1c')]);}_0x3b1045[_0xe36e('0x39')]=qs[_0xe36e('0x3a')](_0x410504[_0xe36e('0x32')]['sort']);_0x3b1045[_0xe36e('0x3b')]=qs[_0xe36e('0x33')](_[_0xe36e('0x3c')](_0x410504['query'],_0x59548b[_0xe36e('0x33')]),_0x5d8fd8);if(_0x410504[_0xe36e('0x32')]['filter']){_0x3b1045[_0xe36e('0x3b')]=_[_0xe36e('0x3d')](_0x3b1045[_0xe36e('0x3b')],{'$or':_[_0xe36e('0x31')](_0x5d8fd8,function(_0xeadfa6){if(_0xeadfa6[_0xe36e('0x2e')]!==_0xe36e('0x3e')){var _0x20877d={};_0x20877d[_0xeadfa6[_0xe36e('0x2a')]]={'$like':'%'+_0x410504[_0xe36e('0x32')][_0xe36e('0x3f')]+'%'};return _0x20877d;}})});}_0x3b1045=_[_0xe36e('0x3d')]({},_0x3b1045,_0x410504[_0xe36e('0x40')]);var _0x5f396c={'where':_0x3b1045[_0xe36e('0x3b')]};return db[_0xe36e('0x2c')][_0xe36e('0x1f')](_0x5f396c)[_0xe36e('0x26')](function(_0x295feb){_0x4bb75b['count']=_0x295feb;if(_0x410504['query'][_0xe36e('0x41')]){_0x3b1045[_0xe36e('0x42')]=[{'all':!![]}];}return db[_0xe36e('0x2c')][_0xe36e('0x43')](_0x3b1045);})[_0xe36e('0x26')](function(_0x34a1ba){_0x4bb75b[_0xe36e('0x44')]=_0x34a1ba;return _0x4bb75b;})[_0xe36e('0x26')](respondWithFilteredResult(_0x4c5d98,_0x3b1045))['catch'](handleError(_0x4c5d98,null));};exports[_0xe36e('0x45')]=function(_0x2d392c,_0x4788a0){var _0x21dc35={'raw':!![],'where':{'id':_0x2d392c[_0xe36e('0x46')]['id']}},_0x5ef3e4={};_0x5ef3e4[_0xe36e('0x30')]=_[_0xe36e('0x47')](db[_0xe36e('0x2c')][_0xe36e('0x2d')]);_0x5ef3e4['query']=_[_0xe36e('0x47')](_0x2d392c[_0xe36e('0x32')]);_0x5ef3e4[_0xe36e('0x33')]=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],_0x5ef3e4[_0xe36e('0x32')]);_0x21dc35['attributes']=_[_0xe36e('0x35')](_0x5ef3e4[_0xe36e('0x30')],qs[_0xe36e('0x36')](_0x2d392c[_0xe36e('0x32')][_0xe36e('0x36')]));_0x21dc35['attributes']=_0x21dc35[_0xe36e('0x34')][_0xe36e('0x37')]?_0x21dc35[_0xe36e('0x34')]:_0x5ef3e4[_0xe36e('0x30')];if(_0x2d392c[_0xe36e('0x32')][_0xe36e('0x41')]){_0x21dc35[_0xe36e('0x42')]=[{'all':!![]}];}_0x21dc35=_[_0xe36e('0x3d')]({},_0x21dc35,_0x2d392c[_0xe36e('0x40')]);return db['WhatsappQueueReport']['find'](_0x21dc35)[_0xe36e('0x26')](handleEntityNotFound(_0x4788a0,null))['then'](respondWithResult(_0x4788a0,null))[_0xe36e('0x48')](handleError(_0x4788a0,null));};exports[_0xe36e('0x49')]=function(_0x38b93f,_0x25aa09){return db['WhatsappQueueReport'][_0xe36e('0x49')](_0x38b93f[_0xe36e('0x4a')],{})['then'](respondWithResult(_0x25aa09,0xc9))[_0xe36e('0x48')](handleError(_0x25aa09,null));};exports[_0xe36e('0x25')]=function(_0x2c26e6,_0x42eae5){if(_0x2c26e6[_0xe36e('0x4a')]['id']){delete _0x2c26e6[_0xe36e('0x4a')]['id'];}return db[_0xe36e('0x2c')][_0xe36e('0x4b')]({'where':{'id':_0x2c26e6[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x42eae5,null))[_0xe36e('0x26')](saveUpdates(_0x2c26e6[_0xe36e('0x4a')],null))[_0xe36e('0x26')](respondWithResult(_0x42eae5,null))[_0xe36e('0x48')](handleError(_0x42eae5,null));};exports[_0xe36e('0x27')]=function(_0x5678d3,_0x3262bf){return db['WhatsappQueueReport']['find']({'where':{'id':_0x5678d3[_0xe36e('0x46')]['id']}})[_0xe36e('0x26')](handleEntityNotFound(_0x3262bf,null))['then'](removeEntity(_0x3262bf,null))[_0xe36e('0x48')](handleError(_0x3262bf,null));};exports[_0xe36e('0x4c')]=function(_0x8a767a,_0x1f4a5d){return db[_0xe36e('0x2c')][_0xe36e('0x4c')]()[_0xe36e('0x26')](respondWithResult(_0x1f4a5d,null))[_0xe36e('0x48')](handleError(_0x1f4a5d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index d0db300..0229ddd 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 _0x9b88=['path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','moment','request-promise'];(function(_0x2cc62b,_0x3f5472){var _0x73e474=function(_0x313471){while(--_0x313471){_0x2cc62b['push'](_0x2cc62b['shift']());}};_0x73e474(++_0x3f5472);}(_0x9b88,0x96));var _0x89b8=function(_0x4d230c,_0x3862fd){_0x4d230c=_0x4d230c-0x0;var _0x16b044=_0x9b88[_0x4d230c];return _0x16b044;};'use strict';var _=require(_0x89b8('0x0'));var util=require('util');var logger=require(_0x89b8('0x1'))('api');var moment=require(_0x89b8('0x2'));var BPromise=require('bluebird');var rp=require(_0x89b8('0x3'));var fs=require('fs');var path=require(_0x89b8('0x4'));var rimraf=require('rimraf');var config=require(_0x89b8('0x5'));var attributes=require(_0x89b8('0x6'));module[_0x89b8('0x7')]=function(_0x365f17,_0x4c8976){return _0x365f17['define'](_0x89b8('0x8'),attributes,{'tableName':_0x89b8('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x89b8('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2c2d=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x2c2d,0x161));var _0xd2c2=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x2c2d[_0x11ce46];return _0x368a1e;};'use strict';var _=require(_0xd2c2('0x0'));var util=require(_0xd2c2('0x1'));var logger=require(_0xd2c2('0x2'))('api');var moment=require(_0xd2c2('0x3'));var BPromise=require(_0xd2c2('0x4'));var rp=require(_0xd2c2('0x5'));var fs=require('fs');var path=require(_0xd2c2('0x6'));var rimraf=require('rimraf');var config=require(_0xd2c2('0x7'));var attributes=require(_0xd2c2('0x8'));module[_0xd2c2('0x9')]=function(_0x4e2749,_0x3537d5){return _0x4e2749['define'](_0xd2c2('0xa'),attributes,{'tableName':_0xd2c2('0xb'),'paranoid':![],'indexes':[{'name':_0xd2c2('0xc'),'fields':[_0xd2c2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 25c7031..c5bfd3f 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 _0x9703=['message','info','result','CreateWhatsappQueueReport','WhatsappQueueReport','options','raw','catch','update','body','UpdateWhatsappQueueReport','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x34b19c,_0x3132c4){var _0x5e3d96=function(_0x18e676){while(--_0x18e676){_0x34b19c['push'](_0x34b19c['shift']());}};_0x5e3d96(++_0x3132c4);}(_0x9703,0xdb));var _0x3970=function(_0xf66a25,_0x527689){_0xf66a25=_0xf66a25-0x0;var _0x231422=_0x9703[_0xf66a25];return _0x231422;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3970('0x0'));var BPromise=require(_0x3970('0x1'));var rs=require(_0x3970('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3970('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3970('0x4'))('rpc');var config=require(_0x3970('0x5'));var jayson=require(_0x3970('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21986b,_0x1bf4d6,_0x282355){return new BPromise(function(_0x41d4d1,_0x235a56){return client[_0x3970('0x7')](_0x21986b,_0x282355)[_0x3970('0x8')](function(_0x28bdc3){logger['info'](_0x3970('0x9'),_0x1bf4d6,_0x3970('0xa'));logger[_0x3970('0xb')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1bf4d6,_0x3970('0xa'),JSON[_0x3970('0xc')](_0x28bdc3));if(_0x28bdc3['error']){if(_0x28bdc3[_0x3970('0xd')][_0x3970('0xe')]===0x1f4){logger[_0x3970('0xd')](_0x3970('0x9'),_0x1bf4d6,_0x28bdc3['error'][_0x3970('0xf')]);return _0x235a56(_0x28bdc3[_0x3970('0xd')][_0x3970('0xf')]);}logger[_0x3970('0xd')](_0x3970('0x9'),_0x1bf4d6,_0x28bdc3[_0x3970('0xd')][_0x3970('0xf')]);return _0x41d4d1(_0x28bdc3[_0x3970('0xd')]['message']);}else{logger[_0x3970('0x10')](_0x3970('0x9'),_0x1bf4d6,'request\x20sent');_0x41d4d1(_0x28bdc3[_0x3970('0x11')][_0x3970('0xf')]);}})['catch'](function(_0x50c297){logger['error'](_0x3970('0x9'),_0x1bf4d6,_0x50c297);_0x235a56(_0x50c297);});});}exports[_0x3970('0x12')]=function(_0x5747a2){var _0x4db273=this;return new Promise(function(_0x21bd6b,_0x476aea){return db[_0x3970('0x13')]['create'](_0x5747a2['body'],{'raw':_0x5747a2[_0x3970('0x14')]?_0x5747a2[_0x3970('0x14')][_0x3970('0x15')]===undefined?!![]:![]:!![]})[_0x3970('0x8')](function(_0x3c865){logger[_0x3970('0x10')]('CreateWhatsappQueueReport',_0x5747a2);logger[_0x3970('0xb')](_0x3970('0x12'),_0x5747a2,JSON[_0x3970('0xc')](_0x3c865));_0x21bd6b(_0x3c865);})[_0x3970('0x16')](function(_0x2058c5){logger[_0x3970('0xd')]('CreateWhatsappQueueReport',_0x2058c5[_0x3970('0xf')],_0x5747a2);_0x476aea(_0x4db273['error'](0x1f4,_0x2058c5[_0x3970('0xf')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xf010ac){var _0x4fe9e8=this;return new Promise(function(_0x193c67,_0x19f504){return db[_0x3970('0x13')][_0x3970('0x17')](_0xf010ac[_0x3970('0x18')],{'raw':_0xf010ac[_0x3970('0x14')]?_0xf010ac['options'][_0x3970('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf010ac[_0x3970('0x14')]?_0xf010ac[_0x3970('0x14')]['where']||null:null,'attributes':_0xf010ac[_0x3970('0x14')]?_0xf010ac[_0x3970('0x14')]['attributes']||null:null,'limit':_0xf010ac[_0x3970('0x14')]?_0xf010ac['options']['limit']||null:null})['then'](function(_0x2f43b4){logger[_0x3970('0x10')](_0x3970('0x19'),_0xf010ac);logger[_0x3970('0xb')](_0x3970('0x19'),_0xf010ac,JSON[_0x3970('0xc')](_0x2f43b4));_0x193c67(_0x2f43b4);})['catch'](function(_0x4ec998){logger[_0x3970('0xd')](_0x3970('0x19'),_0x4ec998['message'],_0xf010ac);_0x19f504(_0x4fe9e8[_0x3970('0xd')](0x1f4,_0x4ec998[_0x3970('0xf')]));});});}; \ No newline at end of file +var _0xe0b2=['client','http','request','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','WhatsappQueueReport','create','body','options','then','debug','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xe0b2,0x14b));var _0x2e0b=function(_0x5907eb,_0xe735ab){_0x5907eb=_0x5907eb-0x0;var _0x1f28bc=_0xe0b2[_0x5907eb];return _0x1f28bc;};'use strict';var _=require(_0x2e0b('0x0'));var util=require(_0x2e0b('0x1'));var moment=require(_0x2e0b('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e0b('0x3'));var fs=require('fs');var Redis=require(_0x2e0b('0x4'));var db=require(_0x2e0b('0x5'))['db'];var utils=require(_0x2e0b('0x6'));var logger=require(_0x2e0b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2e0b('0x8'));var client=jayson[_0x2e0b('0x9')][_0x2e0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe1edd2,_0x2e0e78,_0x2a6e30){return new BPromise(function(_0x562d5d,_0x12864a){return client[_0x2e0b('0xb')](_0xe1edd2,_0x2a6e30)['then'](function(_0x360731){logger[_0x2e0b('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2e0e78,_0x2e0b('0xd'));logger['debug'](_0x2e0b('0xe'),_0x2e0e78,_0x2e0b('0xd'),JSON[_0x2e0b('0xf')](_0x360731));if(_0x360731['error']){if(_0x360731[_0x2e0b('0x10')][_0x2e0b('0x11')]===0x1f4){logger[_0x2e0b('0x10')](_0x2e0b('0x12'),_0x2e0e78,_0x360731[_0x2e0b('0x10')][_0x2e0b('0x13')]);return _0x12864a(_0x360731[_0x2e0b('0x10')][_0x2e0b('0x13')]);}logger[_0x2e0b('0x10')](_0x2e0b('0x12'),_0x2e0e78,_0x360731[_0x2e0b('0x10')][_0x2e0b('0x13')]);return _0x562d5d(_0x360731['error']['message']);}else{logger[_0x2e0b('0xc')](_0x2e0b('0x12'),_0x2e0e78,_0x2e0b('0xd'));_0x562d5d(_0x360731[_0x2e0b('0x14')][_0x2e0b('0x13')]);}})['catch'](function(_0x48bc9){logger[_0x2e0b('0x10')](_0x2e0b('0x12'),_0x2e0e78,_0x48bc9);_0x12864a(_0x48bc9);});});}exports['CreateWhatsappQueueReport']=function(_0xd6f36f){var _0x208317=this;return new Promise(function(_0x56c2bf,_0x53127c){return db[_0x2e0b('0x15')][_0x2e0b('0x16')](_0xd6f36f[_0x2e0b('0x17')],{'raw':_0xd6f36f[_0x2e0b('0x18')]?_0xd6f36f[_0x2e0b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x2e0b('0x19')](function(_0x4df2d8){logger[_0x2e0b('0xc')]('CreateWhatsappQueueReport',_0xd6f36f);logger[_0x2e0b('0x1a')](_0x2e0b('0x1b'),_0xd6f36f,JSON[_0x2e0b('0xf')](_0x4df2d8));_0x56c2bf(_0x4df2d8);})[_0x2e0b('0x1c')](function(_0x269679){logger['error']('CreateWhatsappQueueReport',_0x269679[_0x2e0b('0x13')],_0xd6f36f);_0x53127c(_0x208317['error'](0x1f4,_0x269679[_0x2e0b('0x13')]));});});};exports[_0x2e0b('0x1d')]=function(_0x22d75e){var _0x4cf392=this;return new Promise(function(_0x5cb3d4,_0x29d217){return db[_0x2e0b('0x15')]['update'](_0x22d75e[_0x2e0b('0x17')],{'raw':_0x22d75e['options']?_0x22d75e[_0x2e0b('0x18')][_0x2e0b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22d75e['options']?_0x22d75e['options'][_0x2e0b('0x1f')]||null:null,'attributes':_0x22d75e['options']?_0x22d75e[_0x2e0b('0x18')][_0x2e0b('0x20')]||null:null,'limit':_0x22d75e[_0x2e0b('0x18')]?_0x22d75e[_0x2e0b('0x18')][_0x2e0b('0x21')]||null:null})[_0x2e0b('0x19')](function(_0x3fabc9){logger[_0x2e0b('0xc')](_0x2e0b('0x1d'),_0x22d75e);logger[_0x2e0b('0x1a')](_0x2e0b('0x1d'),_0x22d75e,JSON[_0x2e0b('0xf')](_0x3fabc9));_0x5cb3d4(_0x3fabc9);})[_0x2e0b('0x1c')](function(_0x37f264){logger[_0x2e0b('0x10')](_0x2e0b('0x1d'),_0x37f264[_0x2e0b('0x13')],_0x22d75e);_0x29d217(_0x4cf392[_0x2e0b('0x10')](0x1f4,_0x37f264[_0x2e0b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 43b6564..fef7a2c 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 _0x20cd=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','index','/describe','isAuthenticated','describe','get','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x20cd,0x19b));var _0xd20c=function(_0x5c8103,_0x314779){_0x5c8103=_0x5c8103-0x0;var _0x1e99f7=_0x20cd[_0x5c8103];return _0x1e99f7;};'use strict';var multer=require(_0xd20c('0x0'));var util=require(_0xd20c('0x1'));var path=require(_0xd20c('0x2'));var timeout=require(_0xd20c('0x3'));var express=require(_0xd20c('0x4'));var router=express[_0xd20c('0x5')]();var fs_extra=require(_0xd20c('0x6'));var auth=require(_0xd20c('0x7'));var interaction=require(_0xd20c('0x8'));var config=require(_0xd20c('0x9'));var controller=require(_0xd20c('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xd20c('0xb')]);router['get'](_0xd20c('0xc'),auth[_0xd20c('0xd')](),controller[_0xd20c('0xe')]);router[_0xd20c('0xf')]('/:id',auth[_0xd20c('0xd')](),controller['show']);router['post']('/',auth[_0xd20c('0xd')](),controller[_0xd20c('0x10')]);router[_0xd20c('0x11')](_0xd20c('0x12'),auth[_0xd20c('0xd')](),controller[_0xd20c('0x13')]);router[_0xd20c('0x14')](_0xd20c('0x12'),auth[_0xd20c('0xd')](),controller[_0xd20c('0x15')]);module[_0xd20c('0x16')]=router; \ No newline at end of file +var _0x5c05=['/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','index','isAuthenticated','get'];(function(_0x16ed42,_0x599f01){var _0x3b8f49=function(_0x34ba07){while(--_0x34ba07){_0x16ed42['push'](_0x16ed42['shift']());}};_0x3b8f49(++_0x599f01);}(_0x5c05,0x15e));var _0x55c0=function(_0x5b6e2a,_0x3c2918){_0x5b6e2a=_0x5b6e2a-0x0;var _0x21fa56=_0x5c05[_0x5b6e2a];return _0x21fa56;};'use strict';var multer=require(_0x55c0('0x0'));var util=require(_0x55c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x55c0('0x2'));var router=express[_0x55c0('0x3')]();var fs_extra=require(_0x55c0('0x4'));var auth=require(_0x55c0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x55c0('0x6'));var controller=require(_0x55c0('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x55c0('0x8')]);router['get']('/describe',auth[_0x55c0('0x9')](),controller['describe']);router[_0x55c0('0xa')](_0x55c0('0xb'),auth['isAuthenticated'](),controller[_0x55c0('0xc')]);router[_0x55c0('0xd')]('/',auth['isAuthenticated'](),controller[_0x55c0('0xe')]);router['put'](_0x55c0('0xb'),auth[_0x55c0('0x9')](),controller[_0x55c0('0xf')]);router[_0x55c0('0x10')](_0x55c0('0xb'),auth[_0x55c0('0x9')](),controller[_0x55c0('0x11')]);module[_0x55c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index bb9a73a..5751fb1 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 _0xe61a=['sequelize','exports','ENUM','agent','queue','DATE'];(function(_0x344c6b,_0x3b228d){var _0x3ef161=function(_0x5897fd){while(--_0x5897fd){_0x344c6b['push'](_0x344c6b['shift']());}};_0x3ef161(++_0x3b228d);}(_0xe61a,0x120));var _0xae61=function(_0x39ed4f,_0x5aae3d){_0x39ed4f=_0x39ed4f-0x0;var _0x2f26de=_0xe61a[_0x39ed4f];return _0x2f26de;};'use strict';var Sequelize=require(_0xae61('0x0'));module[_0xae61('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xae61('0x2')]('account',_0xae61('0x3'),_0xae61('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xae61('0x5')]}}; \ No newline at end of file +var _0x63a5=['queue','DATE','sequelize','exports','STRING','account'];(function(_0x191c34,_0x1fa270){var _0x43433b=function(_0x3dd0ab){while(--_0x3dd0ab){_0x191c34['push'](_0x191c34['shift']());}};_0x43433b(++_0x1fa270);}(_0x63a5,0x18e));var _0x563a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x63a5[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x563a('0x0'));module[_0x563a('0x1')]={'uniqueid':{'type':Sequelize[_0x563a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x563a('0x3'),'agent',_0x563a('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x563a('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index f756900..b02bdec 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 _0x4ca2=['bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','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','set','Content-Range','apply','save','update','then','destroy','error','name','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','fast-json-patch','request-promise','moment'];(function(_0x4fda1a,_0x2e02dc){var _0x4f0016=function(_0x4e3e45){while(--_0x4e3e45){_0x4fda1a['push'](_0x4fda1a['shift']());}};_0x4f0016(++_0x2e02dc);}(_0x4ca2,0x16e));var _0x24ca=function(_0x38bda3,_0x572484){_0x38bda3=_0x38bda3-0x0;var _0x79b88c=_0x4ca2[_0x38bda3];return _0x79b88c;};'use strict';var emlformat=require(_0x24ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x24ca('0x1'));var rp=require(_0x24ca('0x2'));var moment=require(_0x24ca('0x3'));var BPromise=require(_0x24ca('0x4'));var Mustache=require(_0x24ca('0x5'));var util=require('util');var path=require(_0x24ca('0x6'));var sox=require(_0x24ca('0x7'));var csv=require(_0x24ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24ca('0x9'));var _=require(_0x24ca('0xa'));var squel=require('squel');var crypto=require(_0x24ca('0xb'));var jsforce=require(_0x24ca('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x24ca('0x8'));var querystring=require(_0x24ca('0xd'));var Papa=require(_0x24ca('0xe'));var Redis=require('ioredis');var authService=require(_0x24ca('0xf'));var qs=require(_0x24ca('0x10'));var as=require(_0x24ca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x24ca('0x12'))(_0x24ca('0x13'));var utils=require(_0x24ca('0x14'));var config=require(_0x24ca('0x15'));var licenseUtil=require(_0x24ca('0x16'));var db=require(_0x24ca('0x17'))['db'];function respondWithStatusCode(_0x79527d,_0x5ae790){_0x5ae790=_0x5ae790||0xcc;return function(_0x3173df){if(_0x3173df){return _0x79527d[_0x24ca('0x18')](_0x5ae790);}return _0x79527d[_0x24ca('0x19')](_0x5ae790)[_0x24ca('0x1a')]();};}function respondWithResult(_0x238871,_0x4165e0){_0x4165e0=_0x4165e0||0xc8;return function(_0xa228e0){if(_0xa228e0){return _0x238871[_0x24ca('0x19')](_0x4165e0)[_0x24ca('0x1b')](_0xa228e0);}};}function respondWithFilteredResult(_0x44ee7c,_0x48386d){return function(_0x1bafd9){if(_0x1bafd9){var _0x5741c3=typeof _0x48386d['offset']===_0x24ca('0x1c')&&typeof _0x48386d[_0x24ca('0x1d')]===_0x24ca('0x1c');var _0x362777=_0x1bafd9[_0x24ca('0x1e')];var _0x286602=_0x5741c3?0x0:_0x48386d[_0x24ca('0x1f')];var _0x13fd8c=_0x5741c3?_0x1bafd9[_0x24ca('0x1e')]:_0x48386d[_0x24ca('0x1f')]+_0x48386d['limit'];var _0x96b9b3;if(_0x13fd8c>=_0x362777){_0x13fd8c=_0x362777;_0x96b9b3=0xc8;}else{_0x96b9b3=0xce;}_0x44ee7c[_0x24ca('0x19')](_0x96b9b3);return _0x44ee7c[_0x24ca('0x20')](_0x24ca('0x21'),_0x286602+'-'+_0x13fd8c+'/'+_0x362777)[_0x24ca('0x1b')](_0x1bafd9);}return null;};}function patchUpdates(_0x17a3b2){return function(_0x123fe5){try{jsonpatch[_0x24ca('0x22')](_0x123fe5,_0x17a3b2,!![]);}catch(_0x178e62){return BPromise['reject'](_0x178e62);}return _0x123fe5[_0x24ca('0x23')]();};}function saveUpdates(_0x2e9b10,_0x2a47fc){return function(_0x451fd4){if(_0x451fd4){return _0x451fd4[_0x24ca('0x24')](_0x2e9b10)[_0x24ca('0x25')](function(_0x118be4){return _0x118be4;});}return null;};}function removeEntity(_0x567d80,_0x548ed3){return function(_0x5b5a58){if(_0x5b5a58){return _0x5b5a58[_0x24ca('0x26')]()['then'](function(){_0x567d80[_0x24ca('0x19')](0xcc)[_0x24ca('0x1a')]();});}};}function handleEntityNotFound(_0x3d881f,_0x1fe4a4){return function(_0x468c25){if(!_0x468c25){_0x3d881f[_0x24ca('0x18')](0x194);}return _0x468c25;};}function handleError(_0x5a258a,_0x3953e5){_0x3953e5=_0x3953e5||0x1f4;return function(_0xdcbc72){logger[_0x24ca('0x27')](_0xdcbc72['stack']);if(_0xdcbc72['name']){delete _0xdcbc72[_0x24ca('0x28')];}_0x5a258a[_0x24ca('0x19')](_0x3953e5)['send'](_0xdcbc72);};}exports['index']=function(_0x3a6349,_0x59e96b){var _0x50b0df={},_0x3fbc56={},_0x24338d={'count':0x0,'rows':[]};var _0x2ee1ea=_['map'](db['WhatsappTransferReport'][_0x24ca('0x29')],function(_0xa03b76){return{'name':_0xa03b76[_0x24ca('0x2a')],'type':_0xa03b76[_0x24ca('0x2b')][_0x24ca('0x2c')]};});_0x3fbc56[_0x24ca('0x2d')]=_[_0x24ca('0x2e')](_0x2ee1ea,_0x24ca('0x28'));_0x3fbc56[_0x24ca('0x2f')]=_[_0x24ca('0x30')](_0x3a6349[_0x24ca('0x2f')]);_0x3fbc56['filters']=_[_0x24ca('0x31')](_0x3fbc56[_0x24ca('0x2d')],_0x3fbc56[_0x24ca('0x2f')]);_0x50b0df[_0x24ca('0x32')]=_['intersection'](_0x3fbc56[_0x24ca('0x2d')],qs[_0x24ca('0x33')](_0x3a6349[_0x24ca('0x2f')][_0x24ca('0x33')]));_0x50b0df[_0x24ca('0x32')]=_0x50b0df[_0x24ca('0x32')][_0x24ca('0x34')]?_0x50b0df['attributes']:_0x3fbc56[_0x24ca('0x2d')];if(!_0x3a6349['query'][_0x24ca('0x35')](_0x24ca('0x36'))){_0x50b0df[_0x24ca('0x1d')]=qs[_0x24ca('0x1d')](_0x3a6349[_0x24ca('0x2f')][_0x24ca('0x1d')]);_0x50b0df[_0x24ca('0x1f')]=qs['offset'](_0x3a6349[_0x24ca('0x2f')][_0x24ca('0x1f')]);}_0x50b0df[_0x24ca('0x37')]=qs['sort'](_0x3a6349[_0x24ca('0x2f')][_0x24ca('0x38')]);_0x50b0df['where']=qs[_0x24ca('0x39')](_[_0x24ca('0x3a')](_0x3a6349[_0x24ca('0x2f')],_0x3fbc56[_0x24ca('0x39')]),_0x2ee1ea);if(_0x3a6349[_0x24ca('0x2f')][_0x24ca('0x3b')]){_0x50b0df[_0x24ca('0x3c')]=_[_0x24ca('0x3d')](_0x50b0df[_0x24ca('0x3c')],{'$or':_[_0x24ca('0x2e')](_0x2ee1ea,function(_0x3678f1){if(_0x3678f1[_0x24ca('0x2b')]!==_0x24ca('0x3e')){var _0x5ad9cb={};_0x5ad9cb[_0x3678f1[_0x24ca('0x28')]]={'$like':'%'+_0x3a6349[_0x24ca('0x2f')]['filter']+'%'};return _0x5ad9cb;}})});}_0x50b0df=_[_0x24ca('0x3d')]({},_0x50b0df,_0x3a6349[_0x24ca('0x3f')]);var _0x51ea2d={'where':_0x50b0df[_0x24ca('0x3c')]};return db[_0x24ca('0x40')][_0x24ca('0x1e')](_0x51ea2d)[_0x24ca('0x25')](function(_0x52a839){_0x24338d[_0x24ca('0x1e')]=_0x52a839;if(_0x3a6349['query'][_0x24ca('0x41')]){_0x50b0df[_0x24ca('0x42')]=[{'all':!![]}];}return db[_0x24ca('0x40')][_0x24ca('0x43')](_0x50b0df);})[_0x24ca('0x25')](function(_0x51c464){_0x24338d['rows']=_0x51c464;return _0x24338d;})[_0x24ca('0x25')](respondWithFilteredResult(_0x59e96b,_0x50b0df))[_0x24ca('0x44')](handleError(_0x59e96b,null));};exports[_0x24ca('0x45')]=function(_0x2d418d,_0x5b02e8){var _0x2933f5={'raw':!![],'where':{'id':_0x2d418d[_0x24ca('0x46')]['id']}},_0x10edd9={};_0x10edd9[_0x24ca('0x2d')]=_[_0x24ca('0x30')](db[_0x24ca('0x40')][_0x24ca('0x29')]);_0x10edd9[_0x24ca('0x2f')]=_[_0x24ca('0x30')](_0x2d418d['query']);_0x10edd9[_0x24ca('0x39')]=_['intersection'](_0x10edd9[_0x24ca('0x2d')],_0x10edd9[_0x24ca('0x2f')]);_0x2933f5[_0x24ca('0x32')]=_['intersection'](_0x10edd9[_0x24ca('0x2d')],qs[_0x24ca('0x33')](_0x2d418d[_0x24ca('0x2f')][_0x24ca('0x33')]));_0x2933f5[_0x24ca('0x32')]=_0x2933f5[_0x24ca('0x32')]['length']?_0x2933f5[_0x24ca('0x32')]:_0x10edd9[_0x24ca('0x2d')];if(_0x2d418d[_0x24ca('0x2f')][_0x24ca('0x41')]){_0x2933f5[_0x24ca('0x42')]=[{'all':!![]}];}_0x2933f5=_[_0x24ca('0x3d')]({},_0x2933f5,_0x2d418d[_0x24ca('0x3f')]);return db[_0x24ca('0x40')][_0x24ca('0x47')](_0x2933f5)['then'](handleEntityNotFound(_0x5b02e8,null))[_0x24ca('0x25')](respondWithResult(_0x5b02e8,null))[_0x24ca('0x44')](handleError(_0x5b02e8,null));};exports['create']=function(_0xe37995,_0x388931){return db[_0x24ca('0x40')]['create'](_0xe37995[_0x24ca('0x48')],{})[_0x24ca('0x25')](respondWithResult(_0x388931,0xc9))[_0x24ca('0x44')](handleError(_0x388931,null));};exports[_0x24ca('0x24')]=function(_0x33738c,_0x540489){if(_0x33738c[_0x24ca('0x48')]['id']){delete _0x33738c[_0x24ca('0x48')]['id'];}return db['WhatsappTransferReport'][_0x24ca('0x47')]({'where':{'id':_0x33738c[_0x24ca('0x46')]['id']}})[_0x24ca('0x25')](handleEntityNotFound(_0x540489,null))[_0x24ca('0x25')](saveUpdates(_0x33738c[_0x24ca('0x48')],null))[_0x24ca('0x25')](respondWithResult(_0x540489,null))[_0x24ca('0x44')](handleError(_0x540489,null));};exports[_0x24ca('0x26')]=function(_0x13f1e6,_0x4cc4a6){return db['WhatsappTransferReport'][_0x24ca('0x47')]({'where':{'id':_0x13f1e6[_0x24ca('0x46')]['id']}})[_0x24ca('0x25')](handleEntityNotFound(_0x4cc4a6,null))[_0x24ca('0x25')](removeEntity(_0x4cc4a6,null))[_0x24ca('0x44')](handleError(_0x4cc4a6,null));};exports['describe']=function(_0xb207b8,_0x57834e){return db[_0x24ca('0x40')][_0x24ca('0x49')]()[_0x24ca('0x25')](respondWithResult(_0x57834e,null))[_0x24ca('0x44')](handleError(_0x57834e,null));}; \ No newline at end of file +var _0x6208=['name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','sort','where','filters','pick','filter','merge','includeAll','findAll','show','params','options','create','body','find','catch','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack'];(function(_0x431a1f,_0x56c9cd){var _0x4fd0b2=function(_0x215ac6){while(--_0x215ac6){_0x431a1f['push'](_0x431a1f['shift']());}};_0x4fd0b2(++_0x56c9cd);}(_0x6208,0x192));var _0x8620=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x6208[_0x3a0c4f];return _0x247049;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8620('0x0'));var zipdir=require(_0x8620('0x1'));var jsonpatch=require(_0x8620('0x2'));var rp=require(_0x8620('0x3'));var moment=require(_0x8620('0x4'));var BPromise=require(_0x8620('0x5'));var Mustache=require(_0x8620('0x6'));var util=require(_0x8620('0x7'));var path=require(_0x8620('0x8'));var sox=require(_0x8620('0x9'));var csv=require('to-csv');var ejs=require(_0x8620('0xa'));var fs=require('fs');var fs_extra=require(_0x8620('0xb'));var _=require(_0x8620('0xc'));var squel=require(_0x8620('0xd'));var crypto=require(_0x8620('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8620('0xf'));var toCsv=require(_0x8620('0x10'));var querystring=require('querystring');var Papa=require(_0x8620('0x11'));var Redis=require(_0x8620('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8620('0x13'));var as=require(_0x8620('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8620('0x15'))(_0x8620('0x16'));var utils=require(_0x8620('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8620('0x18'));var db=require(_0x8620('0x19'))['db'];function respondWithStatusCode(_0xdc52b1,_0x1154a1){_0x1154a1=_0x1154a1||0xcc;return function(_0x18de65){if(_0x18de65){return _0xdc52b1['sendStatus'](_0x1154a1);}return _0xdc52b1['status'](_0x1154a1)['end']();};}function respondWithResult(_0x2c55f3,_0x3effb3){_0x3effb3=_0x3effb3||0xc8;return function(_0x2b6dda){if(_0x2b6dda){return _0x2c55f3[_0x8620('0x1a')](_0x3effb3)[_0x8620('0x1b')](_0x2b6dda);}};}function respondWithFilteredResult(_0x30ee2c,_0x4fdb87){return function(_0x461e41){if(_0x461e41){var _0x37f7a3=typeof _0x4fdb87[_0x8620('0x1c')]===_0x8620('0x1d')&&typeof _0x4fdb87[_0x8620('0x1e')]===_0x8620('0x1d');var _0x170f41=_0x461e41[_0x8620('0x1f')];var _0x42d83d=_0x37f7a3?0x0:_0x4fdb87[_0x8620('0x1c')];var _0x56ce34=_0x37f7a3?_0x461e41[_0x8620('0x1f')]:_0x4fdb87[_0x8620('0x1c')]+_0x4fdb87[_0x8620('0x1e')];var _0x308c2d;if(_0x56ce34>=_0x170f41){_0x56ce34=_0x170f41;_0x308c2d=0xc8;}else{_0x308c2d=0xce;}_0x30ee2c['status'](_0x308c2d);return _0x30ee2c[_0x8620('0x20')](_0x8620('0x21'),_0x42d83d+'-'+_0x56ce34+'/'+_0x170f41)[_0x8620('0x1b')](_0x461e41);}return null;};}function patchUpdates(_0x312bd2){return function(_0x55c95f){try{jsonpatch[_0x8620('0x22')](_0x55c95f,_0x312bd2,!![]);}catch(_0x26aa74){return BPromise[_0x8620('0x23')](_0x26aa74);}return _0x55c95f['save']();};}function saveUpdates(_0x4f5f66,_0x54462c){return function(_0x4adbd0){if(_0x4adbd0){return _0x4adbd0[_0x8620('0x24')](_0x4f5f66)[_0x8620('0x25')](function(_0x2c5bfd){return _0x2c5bfd;});}return null;};}function removeEntity(_0x46437f,_0x1c80eb){return function(_0x50fb89){if(_0x50fb89){return _0x50fb89[_0x8620('0x26')]()[_0x8620('0x25')](function(){_0x46437f[_0x8620('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478069,_0xa1a2a9){return function(_0x225f2d){if(!_0x225f2d){_0x478069[_0x8620('0x27')](0x194);}return _0x225f2d;};}function handleError(_0x1cda68,_0x255892){_0x255892=_0x255892||0x1f4;return function(_0xbca089){logger[_0x8620('0x28')](_0xbca089[_0x8620('0x29')]);if(_0xbca089['name']){delete _0xbca089[_0x8620('0x2a')];}_0x1cda68[_0x8620('0x1a')](_0x255892)[_0x8620('0x2b')](_0xbca089);};}exports[_0x8620('0x2c')]=function(_0x46d7b8,_0x2100f0){var _0x1fe8df={},_0x5e02e5={},_0x3b624c={'count':0x0,'rows':[]};var _0x13cf6d=_[_0x8620('0x2d')](db[_0x8620('0x2e')][_0x8620('0x2f')],function(_0x4bbf18){return{'name':_0x4bbf18[_0x8620('0x30')],'type':_0x4bbf18[_0x8620('0x31')][_0x8620('0x32')]};});_0x5e02e5[_0x8620('0x33')]=_[_0x8620('0x2d')](_0x13cf6d,'name');_0x5e02e5['query']=_[_0x8620('0x34')](_0x46d7b8[_0x8620('0x35')]);_0x5e02e5['filters']=_[_0x8620('0x36')](_0x5e02e5[_0x8620('0x33')],_0x5e02e5[_0x8620('0x35')]);_0x1fe8df['attributes']=_[_0x8620('0x36')](_0x5e02e5[_0x8620('0x33')],qs[_0x8620('0x37')](_0x46d7b8[_0x8620('0x35')][_0x8620('0x37')]));_0x1fe8df['attributes']=_0x1fe8df[_0x8620('0x38')][_0x8620('0x39')]?_0x1fe8df['attributes']:_0x5e02e5[_0x8620('0x33')];if(!_0x46d7b8[_0x8620('0x35')]['hasOwnProperty']('nolimit')){_0x1fe8df[_0x8620('0x1e')]=qs['limit'](_0x46d7b8[_0x8620('0x35')][_0x8620('0x1e')]);_0x1fe8df[_0x8620('0x1c')]=qs['offset'](_0x46d7b8['query'][_0x8620('0x1c')]);}_0x1fe8df['order']=qs['sort'](_0x46d7b8[_0x8620('0x35')][_0x8620('0x3a')]);_0x1fe8df[_0x8620('0x3b')]=qs[_0x8620('0x3c')](_[_0x8620('0x3d')](_0x46d7b8[_0x8620('0x35')],_0x5e02e5[_0x8620('0x3c')]),_0x13cf6d);if(_0x46d7b8[_0x8620('0x35')][_0x8620('0x3e')]){_0x1fe8df[_0x8620('0x3b')]=_[_0x8620('0x3f')](_0x1fe8df[_0x8620('0x3b')],{'$or':_[_0x8620('0x2d')](_0x13cf6d,function(_0x43069c){if(_0x43069c[_0x8620('0x31')]!=='VIRTUAL'){var _0xa601fd={};_0xa601fd[_0x43069c[_0x8620('0x2a')]]={'$like':'%'+_0x46d7b8[_0x8620('0x35')][_0x8620('0x3e')]+'%'};return _0xa601fd;}})});}_0x1fe8df=_[_0x8620('0x3f')]({},_0x1fe8df,_0x46d7b8['options']);var _0x587b53={'where':_0x1fe8df[_0x8620('0x3b')]};return db[_0x8620('0x2e')][_0x8620('0x1f')](_0x587b53)['then'](function(_0x44f4c0){_0x3b624c[_0x8620('0x1f')]=_0x44f4c0;if(_0x46d7b8[_0x8620('0x35')][_0x8620('0x40')]){_0x1fe8df['include']=[{'all':!![]}];}return db[_0x8620('0x2e')][_0x8620('0x41')](_0x1fe8df);})[_0x8620('0x25')](function(_0x44c85d){_0x3b624c['rows']=_0x44c85d;return _0x3b624c;})[_0x8620('0x25')](respondWithFilteredResult(_0x2100f0,_0x1fe8df))['catch'](handleError(_0x2100f0,null));};exports[_0x8620('0x42')]=function(_0x6f6865,_0x3511ca){var _0x2a8724={'raw':!![],'where':{'id':_0x6f6865[_0x8620('0x43')]['id']}},_0x319112={};_0x319112['model']=_[_0x8620('0x34')](db[_0x8620('0x2e')]['rawAttributes']);_0x319112[_0x8620('0x35')]=_['keys'](_0x6f6865[_0x8620('0x35')]);_0x319112[_0x8620('0x3c')]=_[_0x8620('0x36')](_0x319112[_0x8620('0x33')],_0x319112['query']);_0x2a8724[_0x8620('0x38')]=_[_0x8620('0x36')](_0x319112['model'],qs[_0x8620('0x37')](_0x6f6865[_0x8620('0x35')][_0x8620('0x37')]));_0x2a8724[_0x8620('0x38')]=_0x2a8724[_0x8620('0x38')][_0x8620('0x39')]?_0x2a8724[_0x8620('0x38')]:_0x319112[_0x8620('0x33')];if(_0x6f6865[_0x8620('0x35')][_0x8620('0x40')]){_0x2a8724['include']=[{'all':!![]}];}_0x2a8724=_[_0x8620('0x3f')]({},_0x2a8724,_0x6f6865[_0x8620('0x44')]);return db['WhatsappTransferReport']['find'](_0x2a8724)[_0x8620('0x25')](handleEntityNotFound(_0x3511ca,null))['then'](respondWithResult(_0x3511ca,null))['catch'](handleError(_0x3511ca,null));};exports[_0x8620('0x45')]=function(_0x32d13e,_0xa1a6b9){return db['WhatsappTransferReport']['create'](_0x32d13e[_0x8620('0x46')],{})[_0x8620('0x25')](respondWithResult(_0xa1a6b9,0xc9))['catch'](handleError(_0xa1a6b9,null));};exports[_0x8620('0x24')]=function(_0x247b10,_0x1334fd){if(_0x247b10[_0x8620('0x46')]['id']){delete _0x247b10[_0x8620('0x46')]['id'];}return db[_0x8620('0x2e')][_0x8620('0x47')]({'where':{'id':_0x247b10[_0x8620('0x43')]['id']}})[_0x8620('0x25')](handleEntityNotFound(_0x1334fd,null))[_0x8620('0x25')](saveUpdates(_0x247b10[_0x8620('0x46')],null))[_0x8620('0x25')](respondWithResult(_0x1334fd,null))[_0x8620('0x48')](handleError(_0x1334fd,null));};exports[_0x8620('0x26')]=function(_0x2af6f2,_0x2958d9){return db[_0x8620('0x2e')][_0x8620('0x47')]({'where':{'id':_0x2af6f2[_0x8620('0x43')]['id']}})['then'](handleEntityNotFound(_0x2958d9,null))[_0x8620('0x25')](removeEntity(_0x2958d9,null))[_0x8620('0x48')](handleError(_0x2958d9,null));};exports[_0x8620('0x49')]=function(_0x2af0a1,_0x4cc49f){return db['WhatsappTransferReport'][_0x8620('0x49')]()[_0x8620('0x25')](respondWithResult(_0x4cc49f,null))['catch'](handleError(_0x4cc49f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index ba31e73..0092336 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 _0x99b7=['exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3fa50f,_0x11c479){var _0x4e81c7=function(_0x296fc8){while(--_0x296fc8){_0x3fa50f['push'](_0x3fa50f['shift']());}};_0x4e81c7(++_0x11c479);}(_0x99b7,0x138));var _0x799b=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x99b7[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x799b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x799b('0x1'));var moment=require(_0x799b('0x2'));var BPromise=require(_0x799b('0x3'));var rp=require(_0x799b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x799b('0x5'));var config=require(_0x799b('0x6'));var attributes=require('./whatsappTransferReport.attributes');module[_0x799b('0x7')]=function(_0x1e0b6c,_0x345e19){return _0x1e0b6c['define'](_0x799b('0x8'),attributes,{'tableName':_0x799b('0x9'),'paranoid':![],'indexes':[{'name':_0x799b('0xa'),'fields':[_0x799b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc004=['rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x16066e,_0x31e151){var _0x52a12e=function(_0x3e6bed){while(--_0x3e6bed){_0x16066e['push'](_0x16066e['shift']());}};_0x52a12e(++_0x31e151);}(_0xc004,0x118));var _0x4c00=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0xc004[_0x2307fa];return _0x496486;};'use strict';var _=require(_0x4c00('0x0'));var util=require(_0x4c00('0x1'));var logger=require(_0x4c00('0x2'))(_0x4c00('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c00('0x4'));var fs=require('fs');var path=require(_0x4c00('0x5'));var rimraf=require(_0x4c00('0x6'));var config=require(_0x4c00('0x7'));var attributes=require(_0x4c00('0x8'));module['exports']=function(_0x19e87e,_0x4ac165){return _0x19e87e[_0x4c00('0x9')](_0x4c00('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index daef418..a44f09a 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 _0xfe08=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','info','catch','moment','bluebird','randomstring'];(function(_0x50fce4,_0x1af2f4){var _0x1a32dd=function(_0x23c844){while(--_0x23c844){_0x50fce4['push'](_0x50fce4['shift']());}};_0x1a32dd(++_0x1af2f4);}(_0xfe08,0x15d));var _0x8fe0=function(_0x1698f6,_0x441e4b){_0x1698f6=_0x1698f6-0x0;var _0x11d58f=_0xfe08[_0x1698f6];return _0x11d58f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8fe0('0x0'));var BPromise=require(_0x8fe0('0x1'));var rs=require(_0x8fe0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fe0('0x3'))['db'];var utils=require(_0x8fe0('0x4'));var logger=require(_0x8fe0('0x5'))(_0x8fe0('0x6'));var config=require(_0x8fe0('0x7'));var jayson=require(_0x8fe0('0x8'));var client=jayson[_0x8fe0('0x9')][_0x8fe0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50ae06,_0x3f367e,_0x89f94f){return new BPromise(function(_0x304350,_0x346a83){return client[_0x8fe0('0xb')](_0x50ae06,_0x89f94f)[_0x8fe0('0xc')](function(_0x447c99){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x3f367e,'request\x20sent');logger[_0x8fe0('0xd')](_0x8fe0('0xe'),_0x3f367e,_0x8fe0('0xf'),JSON[_0x8fe0('0x10')](_0x447c99));if(_0x447c99[_0x8fe0('0x11')]){if(_0x447c99[_0x8fe0('0x11')]['code']===0x1f4){logger['error'](_0x8fe0('0x12'),_0x3f367e,_0x447c99[_0x8fe0('0x11')][_0x8fe0('0x13')]);return _0x346a83(_0x447c99[_0x8fe0('0x11')][_0x8fe0('0x13')]);}logger[_0x8fe0('0x11')](_0x8fe0('0x12'),_0x3f367e,_0x447c99[_0x8fe0('0x11')][_0x8fe0('0x13')]);return _0x304350(_0x447c99['error']['message']);}else{logger[_0x8fe0('0x14')](_0x8fe0('0x12'),_0x3f367e,'request\x20sent');_0x304350(_0x447c99['result'][_0x8fe0('0x13')]);}})[_0x8fe0('0x15')](function(_0x16e7cc){logger[_0x8fe0('0x11')](_0x8fe0('0x12'),_0x3f367e,_0x16e7cc);_0x346a83(_0x16e7cc);});});} \ No newline at end of file +var _0x4870=['request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','http','request','WhatsappTransferReport,\x20%s,\x20%s'];(function(_0x21af3a,_0x386e1d){var _0x268a49=function(_0x41a650){while(--_0x41a650){_0x21af3a['push'](_0x21af3a['shift']());}};_0x268a49(++_0x386e1d);}(_0x4870,0x8f));var _0x0487=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x4870[_0x35885a];return _0xe86249;};'use strict';var _=require(_0x0487('0x0'));var util=require(_0x0487('0x1'));var moment=require(_0x0487('0x2'));var BPromise=require(_0x0487('0x3'));var rs=require(_0x0487('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0487('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0487('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0487('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2aaf49,_0x305267,_0x1674ca){return new BPromise(function(_0x13f1a1,_0x23c495){return client[_0x0487('0x8')](_0x2aaf49,_0x1674ca)['then'](function(_0x2c6874){logger['info'](_0x0487('0x9'),_0x305267,'request\x20sent');logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x305267,_0x0487('0xa'),JSON[_0x0487('0xb')](_0x2c6874));if(_0x2c6874[_0x0487('0xc')]){if(_0x2c6874[_0x0487('0xc')][_0x0487('0xd')]===0x1f4){logger[_0x0487('0xc')](_0x0487('0x9'),_0x305267,_0x2c6874['error']['message']);return _0x23c495(_0x2c6874[_0x0487('0xc')][_0x0487('0xe')]);}logger[_0x0487('0xc')](_0x0487('0x9'),_0x305267,_0x2c6874[_0x0487('0xc')][_0x0487('0xe')]);return _0x13f1a1(_0x2c6874['error'][_0x0487('0xe')]);}else{logger[_0x0487('0xf')](_0x0487('0x9'),_0x305267,'request\x20sent');_0x13f1a1(_0x2c6874['result'][_0x0487('0xe')]);}})[_0x0487('0x10')](function(_0x2f15fe){logger[_0x0487('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x305267,_0x2f15fe);_0x23c495(_0x2f15fe);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 1764677..265e810 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9f7a=['./config/seedDB','./config/license','./config/environment','./config/pm2/config','./config/schedule','./config/schedule/transcribe','then','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','filter','online','Offline\x20apps:','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','lodash','./mysqldb'];(function(_0x236fa7,_0x1d5ac2){var _0x527f24=function(_0x57cf0e){while(--_0x57cf0e){_0x236fa7['push'](_0x236fa7['shift']());}};_0x527f24(++_0x1d5ac2);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x9f7a[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0xa9f7('0x0'));var db=require(_0xa9f7('0x1'))['db'];var seedDb=require(_0xa9f7('0x2'));var checkLicense=require(_0xa9f7('0x3'));var rpc=require('./rpc');var config=require(_0xa9f7('0x4'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0xa9f7('0x5'));var schedule=require(_0xa9f7('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xa9f7('0x7'));var provider=require('./config/schedule/cloud-provider');function main(){return db['sequelize']['sync']()[_0xa9f7('0x8')](function(){if(config['seedDB']){return seedDb[_0xa9f7('0x9')]();}})[_0xa9f7('0x8')](function(){return checkLicense[_0xa9f7('0x9')]();})['then'](function(){return rpc[_0xa9f7('0xa')]();})[_0xa9f7('0x8')](function(_0x4d9b2a){logger[_0xa9f7('0xb')](_0x4d9b2a);return chat[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return whatsapp[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return schedule[_0xa9f7('0xc')]();})[_0xa9f7('0x8')](function(){return transcribe['start']();})[_0xa9f7('0x8')](function(){return provider['start']();})[_0xa9f7('0x8')](function(_0x437a83){logger[_0xa9f7('0xb')](_0x437a83);return pm2['start'](pm2Config);})['then'](function(_0xe56a20){var _0x4855d0=_0xe56a20['filter'](function(_0x188f8a){return typeof _0x188f8a[_0xa9f7('0xd')]===_0xa9f7('0xe')&&_0x188f8a['exitCode']>=0x0;});if(_0x4855d0[_0xa9f7('0xf')]>0x0){throw new Error(_0x4855d0[_0xa9f7('0xf')]+_0xa9f7('0x10')+_['map'](_0x4855d0,function(_0x310009){return'\x22'+_0x310009[_0xa9f7('0x11')][_0xa9f7('0x12')]+'\x22';}));}logger[_0xa9f7('0xb')](_0xa9f7('0x13'),_[_0xa9f7('0x14')](_[_0xa9f7('0x15')](_0xe56a20,{'status':_0xa9f7('0x16')}),_0xa9f7('0x12'))['join']());logger[_0xa9f7('0xb')](_0xa9f7('0x17'),_[_0xa9f7('0x14')](_[_0xa9f7('0x15')](_0xe56a20,function(_0x402c6d){return _0x402c6d['status']!=='online';}),'name')['join']()||'None');console[_0xa9f7('0x18')]('App\x20Ready!');})[_0xa9f7('0x19')](function(_0x504304){console['log'](_0xa9f7('0x1a'),_0x504304);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x504304);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x2e88=['./config/license','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','filter','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','lodash','./mysqldb','./config/seedDB'];(function(_0x5075f1,_0x1476ce){var _0x2a8a20=function(_0x1326c6){while(--_0x1326c6){_0x5075f1['push'](_0x5075f1['shift']());}};_0x2a8a20(++_0x1476ce);}(_0x2e88,0x95));var _0x82e8=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0x2e88[_0x376db5];return _0x304c17;};'use strict';var _=require(_0x82e8('0x0'));var db=require(_0x82e8('0x1'))['db'];var seedDb=require(_0x82e8('0x2'));var checkLicense=require(_0x82e8('0x3'));var rpc=require(_0x82e8('0x4'));var config=require(_0x82e8('0x5'));var logger=require('./config/logger')(_0x82e8('0x6'));var pm2=require(_0x82e8('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x82e8('0x8'));var chat=require(_0x82e8('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x82e8('0xa'));var provider=require(_0x82e8('0xb'));function main(){return db[_0x82e8('0xc')][_0x82e8('0xd')]()[_0x82e8('0xe')](function(){if(config[_0x82e8('0xf')]){return seedDb[_0x82e8('0x10')]();}})[_0x82e8('0xe')](function(){return checkLicense[_0x82e8('0x10')]();})[_0x82e8('0xe')](function(){return rpc[_0x82e8('0x11')]();})['then'](function(_0x30b9bc){logger[_0x82e8('0x12')](_0x30b9bc);return chat[_0x82e8('0x13')]();})[_0x82e8('0xe')](function(){return whatsapp[_0x82e8('0x13')]();})[_0x82e8('0xe')](function(){return schedule[_0x82e8('0x13')]();})['then'](function(){return transcribe[_0x82e8('0x13')]();})[_0x82e8('0xe')](function(){return provider[_0x82e8('0x13')]();})[_0x82e8('0xe')](function(_0x192914){logger['info'](_0x192914);return pm2[_0x82e8('0x13')](pm2Config);})[_0x82e8('0xe')](function(_0xad6055){var _0x46e01e=_0xad6055['filter'](function(_0x25b60e){return typeof _0x25b60e[_0x82e8('0x14')]===_0x82e8('0x15')&&_0x25b60e[_0x82e8('0x14')]>=0x0;});if(_0x46e01e[_0x82e8('0x16')]>0x0){throw new Error(_0x46e01e['length']+_0x82e8('0x17')+_[_0x82e8('0x18')](_0x46e01e,function(_0x574ba2){return'\x22'+_0x574ba2[_0x82e8('0x19')][_0x82e8('0x1a')]+'\x22';}));}logger[_0x82e8('0x12')](_0x82e8('0x1b'),_[_0x82e8('0x18')](_[_0x82e8('0x1c')](_0xad6055,{'status':_0x82e8('0x1d')}),'name')[_0x82e8('0x1e')]());logger[_0x82e8('0x12')](_0x82e8('0x1f'),_[_0x82e8('0x18')](_[_0x82e8('0x1c')](_0xad6055,function(_0x5db337){return _0x5db337[_0x82e8('0x20')]!=='online';}),_0x82e8('0x1a'))[_0x82e8('0x1e')]()||_0x82e8('0x21'));console[_0x82e8('0x22')](_0x82e8('0x23'));})[_0x82e8('0x24')](function(_0x37d499){console['log'](_0x82e8('0x25'),_0x37d499);logger['error']('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x37d499);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 7822473..e86f7bd 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 _0x7cb3=['../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','fullname','name','email','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','lastLoginAt','lastPauseAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isAuthenticated','use','user','ChatInteraction','params','disposition','then','closed','status','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','find','authenticate','pass','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','User\x20not\x20found.','canUpdate','getLicense','update','webrtc','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','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','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','splice','encryptString','join','secret','session','options','promisify','verify','secrets','randomBytes','hex','floor','now','toString'];(function(_0x251825,_0x3057b5){var _0x44d23c=function(_0x583862){while(--_0x583862){_0x251825['push'](_0x251825['shift']());}};_0x44d23c(++_0x3057b5);}(_0x7cb3,0x7b));var _0x37cb=function(_0x598a89,_0x167f06){_0x598a89=_0x598a89-0x0;var _0x4be84a=_0x7cb3[_0x598a89];return _0x4be84a;};'use strict';var db=require(_0x37cb('0x0'))['db'];var config=require(_0x37cb('0x1'));var hardwareConf=require(_0x37cb('0x2'));var licenseUtil=require(_0x37cb('0x3'));var encryptor=require(_0x37cb('0x4'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x37cb('0x5'));var compose=require(_0x37cb('0x6'));var basicAuth=require(_0x37cb('0x7'));var crypto=require(_0x37cb('0x8'));var BPromise=require(_0x37cb('0x9'));var util=require(_0x37cb('0xa'));var moment=require(_0x37cb('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id','role',_0x37cb('0xc'),_0x37cb('0xd'),'internal',_0x37cb('0xe'),'userpic',_0x37cb('0xf'),_0x37cb('0x10'),_0x37cb('0x11'),_0x37cb('0x12'),_0x37cb('0x13'),_0x37cb('0x14'),_0x37cb('0x15'),'openchannelPause',_0x37cb('0x16'),'showWebBar',_0x37cb('0x17'),_0x37cb('0x18'),'crudPermissions',_0x37cb('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0x37cb('0x1a'),_0x37cb('0x1b'),'phoneBarEnableRecording',_0x37cb('0x1c'),_0x37cb('0x1d'),_0x37cb('0x1e'),_0x37cb('0x1f'),'phoneBarRemoteControl','phoneBarRemoteControlPort',_0x37cb('0x20'),_0x37cb('0x21'),_0x37cb('0x22'),_0x37cb('0x23'),_0x37cb('0x24'),'wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0x37cb('0x25'),_0x37cb('0x26'),_0x37cb('0x27')];exports['isChatInteractionAuthorized']=function(){return this[_0x37cb('0x28')](!![])[_0x37cb('0x29')](function(_0x57d25a,_0x4984c5,_0x32dc90){if(_0x57d25a[_0x37cb('0x2a')]){_0x32dc90();}else{return db[_0x37cb('0x2b')]['findOne']({'where':{'id':_0x57d25a[_0x37cb('0x2c')]['id']},'attributes':['id','closed',_0x37cb('0x2d')],'raw':!![]})[_0x37cb('0x2e')](function(_0x4ba240){if(_0x4ba240&&_0x4ba240[_0x37cb('0x2f')]){return _0x4984c5[_0x37cb('0x30')](_0x4ba240[_0x37cb('0x2d')]===_0x37cb('0x31')?0x195:0x193)['json']({'message':_0x4ba240[_0x37cb('0x2d')]==='unmanaged'?_0x37cb('0x32'):_0x37cb('0x33')});}else{_0x32dc90();}})[_0x37cb('0x34')](function(_0x1fc636){_0x32dc90(_0x1fc636);});}});};exports[_0x37cb('0x28')]=function isAuthenticated(_0x38a3a9){return compose()['use'](function(_0x2e9ca9,_0x3657c8,_0x1bdcc8){var _0x5646f6;if(_0x2e9ca9[_0x37cb('0x35')][_0x37cb('0x36')]){if(_[_0x37cb('0x37')](_0x2e9ca9['headers'][_0x37cb('0x36')],_0x37cb('0x38'))){var _0xe708ab=basicAuth(_0x2e9ca9);db[_0x37cb('0x39')][_0x37cb('0x3a')]({'where':{'name':_0xe708ab[_0x37cb('0xd')]}})[_0x37cb('0x2e')](function(_0x31f583){if(!_0x31f583||!_0x31f583[_0x37cb('0x3b')](_0xe708ab[_0x37cb('0x3c')])){return _0x3657c8[_0x37cb('0x30')](0x191)[_0x37cb('0x3d')]({'message':_0x37cb('0x3e')});}_0x2e9ca9[_0x37cb('0x2a')]={'id':_0x31f583['id']};_0x1bdcc8();})[_0x37cb('0x34')](function(_0x18cee3){_0x1bdcc8(_0x18cee3);});}else if(_[_0x37cb('0x37')](_0x2e9ca9['headers'][_0x37cb('0x36')],'Bearer')){validateJwt(_0x2e9ca9,_0x3657c8,_0x1bdcc8);}else{if(_0x38a3a9){_0x1bdcc8();}else{return _0x3657c8[_0x37cb('0x30')](0x193)[_0x37cb('0x3d')]({'message':_0x37cb('0x3f')});}}}else if(_0x2e9ca9[_0x37cb('0x40')]['apikey']){try{var _0x1e10f5={'audience':hardwareConf[_0x37cb('0x41')](),'issuer':hardwareConf[_0x37cb('0x41')]()};verifyJwt(_0x2e9ca9[_0x37cb('0x40')][_0x37cb('0x42')],_0x1e10f5)[_0x37cb('0x2e')](function(_0xd52311){return db[_0x37cb('0x39')][_0x37cb('0x3a')]({'where':{'id':_0xd52311[_0x37cb('0x43')]}})['then'](function(_0x5109f5){_0x5646f6=_0x5109f5;return db[_0x37cb('0x44')]['findOne']({'where':{'id':0x1},'attributes':[_0x37cb('0x45'),_0x37cb('0x46')],'raw':!![]});})[_0x37cb('0x2e')](function(_0x2268b5){if(!_0x5646f6||!_['isEqual'](_0x5646f6[_0x37cb('0x47')],_0xd52311[_0x37cb('0x48')])){return _0x3657c8[_0x37cb('0x30')](0x191)[_0x37cb('0x3d')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x5646f6[_0x37cb('0x49')]){return _0x3657c8[_0x37cb('0x30')](0x191)[_0x37cb('0x3d')]({'message':_0x37cb('0x4a')});}if(_0x5646f6[_0x37cb('0x4b')]){if(_0x2268b5[_0x37cb('0x46')]>0x0){if(moment(_0x5646f6[_0x37cb('0x4c')])[_0x37cb('0x4d')](_0x2268b5['blockDuration'],'minutes')>moment()){return _0x3657c8['status'](0x191)[_0x37cb('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x3657c8[_0x37cb('0x30')](0x191)[_0x37cb('0x3d')]({'message':_0x37cb('0x4a')});}}_0x2e9ca9[_0x37cb('0x2a')]={'id':_0x5646f6['id']};_0x1bdcc8();});})[_0x37cb('0x34')](function(){return _0x3657c8[_0x37cb('0x30')](0x191)[_0x37cb('0x3d')]({'message':_0x37cb('0x4a')});});}catch(_0x46b08c){_0x1bdcc8(_0x46b08c);}}else if(_0x38a3a9){_0x1bdcc8();}else{return _0x3657c8[_0x37cb('0x30')](0x193)[_0x37cb('0x3d')]({'message':_0x37cb('0x3f')});}})[_0x37cb('0x29')](function(_0x3afdb7,_0x3c63b9,_0x52f1b6){if(_0x3afdb7['user']){db[_0x37cb('0x39')]['find']({'where':{'id':_0x3afdb7[_0x37cb('0x2a')]['id']},'attributes':userAttributes})[_0x37cb('0x2e')](function(_0x25df5d){if(!_0x25df5d){return _0x3c63b9['status'](0x194)[_0x37cb('0x3d')]({'message':_0x37cb('0x4e')});}_0x3afdb7[_0x37cb('0x2a')]=_0x25df5d;_0x52f1b6();})[_0x37cb('0x34')](function(_0x159c12){_0x52f1b6(_0x159c12);});}else if(_0x38a3a9){_0x52f1b6();}else{return _0x3c63b9[_0x37cb('0x30')](0x194)[_0x37cb('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x37cb('0x4f')]=function canUpdate(){return compose()[_0x37cb('0x29')](function(_0x35da12,_0x4613db,_0x2945dc){return licenseUtil[_0x37cb('0x50')]()[_0x37cb('0x2e')](function(_0x3a8501){if(_0x3a8501[_0x37cb('0x51')]){_0x2945dc();}else{return _0x4613db['status'](0x193)[_0x37cb('0x3d')]({'message':'Forbidden'});}})[_0x37cb('0x34')](function(_0x225b1d){_0x2945dc(_0x225b1d);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x37cb('0x29')](function(_0x19d54c,_0x1efd30,_0x1a40bc){return licenseUtil[_0x37cb('0x50')]()[_0x37cb('0x2e')](function(_0x22b3b5){if(_0x22b3b5[_0x37cb('0x52')]){_0x1a40bc();}else{return _0x1efd30['status'](0x193)[_0x37cb('0x3d')]({'message':_0x37cb('0x53')});}})['catch'](function(_0x2552f1){_0x1a40bc(_0x2552f1);});});};exports[_0x37cb('0x54')]=function(_0x2ef58f,_0xe1767b,_0x27bab8){_0x2ef58f[_0x37cb('0x54')]=!![];return _0x27bab8();};exports[_0x37cb('0x55')]=function signToken(_0x262151){return signJwt(_0x262151);};exports[_0x37cb('0x56')]=function(_0x534810,_0x347d72){if(!_0x534810['user']){return _0x347d72['status'](0x194)[_0x37cb('0x3d')]({'message':_0x37cb('0x57')});}var _0x2ac333={'payload':{'id':_0x534810[_0x37cb('0x2a')]['id'],'role':_0x534810[_0x37cb('0x2a')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2ac333)['then'](function(_0x14cf81){_0x347d72['cookie'](_0x37cb('0x58'),_0x14cf81);_0x347d72['redirect'](_0x37cb('0x59'));})['catch'](function(_0x323185){return _0x347d72[_0x37cb('0x30')](0x1f4)[_0x37cb('0x5a')](_0x323185);});};exports[_0x37cb('0x5b')]=function(_0x196180){if(_[_0x37cb('0x5c')](_0x196180[_0x37cb('0x47')])||_['isNil'](_0x196180['apiKeyIat'])){return null;}else{return createJwt(_0x196180);}};exports[_0x37cb('0x5d')]=function(_0x36d3e9){_0x36d3e9[_0x37cb('0x47')]=generateNonce();_0x36d3e9[_0x37cb('0x5e')]=generateIssuedAt();return createJwt(_0x36d3e9);};exports[_0x37cb('0x5f')]=function(_0x4376c0,_0x422d4f){var _0x16df3b=_0x4376c0[_0x37cb('0x40')][_0x37cb('0x42')];if(_0x16df3b){var _0x2f9e3c={'nonce':_0x422d4f[_0x37cb('0x47')],'iat':_0x422d4f[_0x37cb('0x5e')],'audience':hardwareConf[_0x37cb('0x41')](),'issuer':hardwareConf[_0x37cb('0x41')]()};return verifyJwt(_0x16df3b,_0x2f9e3c)['then'](function(){return generateApiKey(_0x422d4f);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x37cb('0x60')]=function(_0x57c2e0){var _0x1d8a20=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1d8a20[_0x37cb('0x61')](_0x57c2e0))throw new db[(_0x37cb('0x62'))][(_0x37cb('0x63'))](_0x37cb('0x64'));return;};exports[_0x37cb('0x65')]=function(_0x62e4fd,_0x221485,_0x22aaba){var _0x4339c2=encryptor['decryptString'](_0x221485)[_0x37cb('0x66')](',');for(var _0x43131c=0x0;_0x43131c<_0x22aaba;_0x43131c++){if(!_0x4339c2[_0x43131c])break;if(_0x62e4fd[_0x37cb('0x67')]()===_0x4339c2[_0x43131c]['toLowerCase']()){var _0x2d2274=util[_0x37cb('0x68')](_0x37cb('0x69'),_0x22aaba);if(_0x22aaba===0x1){_0x2d2274=_0x37cb('0x6a');}throw new db['Sequelize']['ValidationError'](_0x2d2274);}}return;};exports[_0x37cb('0x6b')]=function(_0x48ac26,_0x1760e1){var _0x11c2c7=_0x1760e1?encryptor[_0x37cb('0x6c')](_0x1760e1)[_0x37cb('0x66')](','):[];if(_0x11c2c7['length']===0x5){_0x11c2c7[_0x37cb('0x6d')](-0x1,0x1);}_0x11c2c7['unshift'](_0x48ac26);return encryptor[_0x37cb('0x6e')](_0x11c2c7[_0x37cb('0x6f')](','));};function signJwt(_0x5d366e){var _0x3a8067=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x4c0ca8=_0x5d366e[_0x37cb('0x70')]||config['secrets'][_0x37cb('0x71')];return new BPromise(function(_0xb1bf58,_0x279305){_0x3a8067(_0x5d366e['payload'],_0x4c0ca8,_0x5d366e[_0x37cb('0x72')])[_0x37cb('0x2e')](function(_0xc7abc8){_0xb1bf58(_0xc7abc8);})[_0x37cb('0x34')](function(_0x2efc3a){_0x279305(_0x2efc3a);});});}function verifyJwt(_0x59d9c0,_0x9d54e,_0x16a812){var _0x395f47=BPromise[_0x37cb('0x73')](jwt[_0x37cb('0x74')],{'context':jwt});var _0x1c1c4e=_0x16a812||config[_0x37cb('0x75')][_0x37cb('0x71')];return new BPromise(function(_0x49a5ca,_0x47b2b4){_0x395f47(_0x59d9c0,_0x1c1c4e,_0x9d54e)['then'](function(_0x536c4b){_0x49a5ca(_0x536c4b);})[_0x37cb('0x34')](function(_0x506dec){_0x47b2b4(_0x506dec);});});}function generateNonce(){return crypto[_0x37cb('0x76')](0x10)['toString'](_0x37cb('0x77'));}function generateIssuedAt(){return Math[_0x37cb('0x78')](Date[_0x37cb('0x79')]()/0x3e8)[_0x37cb('0x7a')]();}function createJwt(_0x40a01d){var _0x264723={'payload':{'iat':_0x40a01d[_0x37cb('0x5e')],'nonce':_0x40a01d['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x40a01d['id']['toString'](),'issuer':hardwareConf[_0x37cb('0x41')](),'audience':hardwareConf[_0x37cb('0x41')]()}};return signJwt(_0x264723)[_0x37cb('0x2e')](function(_0x384730){return{'iat':_0x40a01d[_0x37cb('0x5e')],'nonce':_0x40a01d[_0x37cb('0x47')],'token':_0x384730};});} \ No newline at end of file +var _0xb441=['session','role','fullname','name','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','passwordResetAt','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','findOne','params','closed','disposition','then','status','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','authorization','Basic','User','find','authenticate','pass','Wrong\x20credentials.','startsWith','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','add','minutes','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','secrets','payload','options','randomBytes','toString','hex','floor','now','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','util','moment'];(function(_0x589b8b,_0x5b2933){var _0x252f88=function(_0x4feee7){while(--_0x4feee7){_0x589b8b['push'](_0x589b8b['shift']());}};_0x252f88(++_0x5b2933);}(_0xb441,0xf3));var _0x1b44=function(_0x4bf089,_0x417cc6){_0x4bf089=_0x4bf089-0x0;var _0x35452d=_0xb441[_0x4bf089];return _0x35452d;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0x1b44('0x0'));var licenseUtil=require(_0x1b44('0x1'));var encryptor=require(_0x1b44('0x2'));var _=require(_0x1b44('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x1b44('0x4'));var compose=require(_0x1b44('0x5'));var basicAuth=require(_0x1b44('0x6'));var crypto=require('crypto');var BPromise=require('bluebird');var util=require(_0x1b44('0x7'));var moment=require(_0x1b44('0x8'));var validateJwt=expressJwt({'secret':config['secrets'][_0x1b44('0x9')]});var userAttributes=['id',_0x1b44('0xa'),_0x1b44('0xb'),_0x1b44('0xc'),'internal','email',_0x1b44('0xd'),_0x1b44('0xe'),'md5secret',_0x1b44('0xf'),_0x1b44('0x10'),_0x1b44('0x11'),_0x1b44('0x12'),_0x1b44('0x13'),_0x1b44('0x14'),_0x1b44('0x15'),_0x1b44('0x16'),_0x1b44('0x17'),'lastPauseAt','crudPermissions',_0x1b44('0x18'),_0x1b44('0x19'),'alias','phoneBarAutoAnswer',_0x1b44('0x1a'),'phoneBarDnd',_0x1b44('0x1b'),_0x1b44('0x1c'),_0x1b44('0x1d'),_0x1b44('0x1e'),'phoneBarPrefixRequired',_0x1b44('0x1f'),_0x1b44('0x20'),_0x1b44('0x21'),_0x1b44('0x22'),_0x1b44('0x23'),_0x1b44('0x24'),_0x1b44('0x25'),_0x1b44('0x26'),_0x1b44('0x27'),'downloadOmnichannelInteractions',_0x1b44('0x28'),_0x1b44('0x29'),_0x1b44('0x2a')];exports[_0x1b44('0x2b')]=function(){return this['isAuthenticated'](!![])[_0x1b44('0x2c')](function(_0x18ed5c,_0x195698,_0x29c7bc){if(_0x18ed5c[_0x1b44('0x2d')]){_0x29c7bc();}else{return db['ChatInteraction'][_0x1b44('0x2e')]({'where':{'id':_0x18ed5c[_0x1b44('0x2f')]['id']},'attributes':['id',_0x1b44('0x30'),_0x1b44('0x31')],'raw':!![]})[_0x1b44('0x32')](function(_0x54d02a){if(_0x54d02a&&_0x54d02a[_0x1b44('0x30')]){return _0x195698[_0x1b44('0x33')](_0x54d02a[_0x1b44('0x31')]===_0x1b44('0x34')?0x195:0x193)[_0x1b44('0x35')]({'message':_0x54d02a['disposition']===_0x1b44('0x34')?_0x1b44('0x36'):'Forbidden.'});}else{_0x29c7bc();}})[_0x1b44('0x37')](function(_0x221e5d){_0x29c7bc(_0x221e5d);});}});};exports[_0x1b44('0x38')]=function isAuthenticated(_0x5aa9e7){return compose()[_0x1b44('0x2c')](function(_0x140086,_0x248911,_0x298f5c){var _0x327226;if(_0x140086[_0x1b44('0x39')][_0x1b44('0x3a')]){if(_['startsWith'](_0x140086[_0x1b44('0x39')][_0x1b44('0x3a')],_0x1b44('0x3b'))){var _0x45a321=basicAuth(_0x140086);db[_0x1b44('0x3c')][_0x1b44('0x3d')]({'where':{'name':_0x45a321[_0x1b44('0xc')]}})[_0x1b44('0x32')](function(_0x492424){if(!_0x492424||!_0x492424[_0x1b44('0x3e')](_0x45a321[_0x1b44('0x3f')])){return _0x248911['status'](0x191)[_0x1b44('0x35')]({'message':_0x1b44('0x40')});}_0x140086[_0x1b44('0x2d')]={'id':_0x492424['id']};_0x298f5c();})['catch'](function(_0x34d973){_0x298f5c(_0x34d973);});}else if(_[_0x1b44('0x41')](_0x140086['headers']['authorization'],_0x1b44('0x42'))){validateJwt(_0x140086,_0x248911,_0x298f5c);}else{if(_0x5aa9e7){_0x298f5c();}else{return _0x248911['status'](0x193)[_0x1b44('0x35')]({'message':_0x1b44('0x43')});}}}else if(_0x140086[_0x1b44('0x44')]['apikey']){try{var _0x1b40b1={'audience':hardwareConf[_0x1b44('0x45')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x140086[_0x1b44('0x44')][_0x1b44('0x46')],_0x1b40b1)[_0x1b44('0x32')](function(_0x508a9e){return db['User']['find']({'where':{'id':_0x508a9e['sub']}})['then'](function(_0x5abc46){_0x327226=_0x5abc46;return db[_0x1b44('0x47')][_0x1b44('0x2e')]({'where':{'id':0x1},'attributes':[_0x1b44('0x48'),_0x1b44('0x49')],'raw':!![]});})[_0x1b44('0x32')](function(_0x56752f){if(!_0x327226||!_[_0x1b44('0x4a')](_0x327226[_0x1b44('0x4b')],_0x508a9e[_0x1b44('0x4c')])){return _0x248911[_0x1b44('0x33')](0x191)[_0x1b44('0x35')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x327226[_0x1b44('0x4d')]){return _0x248911[_0x1b44('0x33')](0x191)[_0x1b44('0x35')]({'message':_0x1b44('0x4e')});}if(_0x327226[_0x1b44('0x4f')]){if(_0x56752f[_0x1b44('0x49')]>0x0){if(moment(_0x327226['blockedAt'])[_0x1b44('0x50')](_0x56752f[_0x1b44('0x49')],_0x1b44('0x51'))>moment()){return _0x248911[_0x1b44('0x33')](0x191)[_0x1b44('0x35')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x248911[_0x1b44('0x33')](0x191)['json']({'message':_0x1b44('0x4e')});}}_0x140086[_0x1b44('0x2d')]={'id':_0x327226['id']};_0x298f5c();});})['catch'](function(){return _0x248911[_0x1b44('0x33')](0x191)[_0x1b44('0x35')]({'message':_0x1b44('0x4e')});});}catch(_0x675b40){_0x298f5c(_0x675b40);}}else if(_0x5aa9e7){_0x298f5c();}else{return _0x248911[_0x1b44('0x33')](0x193)[_0x1b44('0x35')]({'message':_0x1b44('0x43')});}})[_0x1b44('0x2c')](function(_0x20ba43,_0x13c93b,_0x1c432e){if(_0x20ba43[_0x1b44('0x2d')]){db['User']['find']({'where':{'id':_0x20ba43[_0x1b44('0x2d')]['id']},'attributes':userAttributes})[_0x1b44('0x32')](function(_0x27f769){if(!_0x27f769){return _0x13c93b['status'](0x194)[_0x1b44('0x35')]({'message':_0x1b44('0x52')});}_0x20ba43[_0x1b44('0x2d')]=_0x27f769;_0x1c432e();})[_0x1b44('0x37')](function(_0x20ecef){_0x1c432e(_0x20ecef);});}else if(_0x5aa9e7){_0x1c432e();}else{return _0x13c93b[_0x1b44('0x33')](0x194)[_0x1b44('0x35')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x1b44('0x53')]=function canUpdate(){return compose()[_0x1b44('0x2c')](function(_0x2256a7,_0x2fd85b,_0x3a23b4){return licenseUtil[_0x1b44('0x54')]()['then'](function(_0x4a89de){if(_0x4a89de[_0x1b44('0x55')]){_0x3a23b4();}else{return _0x2fd85b[_0x1b44('0x33')](0x193)[_0x1b44('0x35')]({'message':_0x1b44('0x56')});}})[_0x1b44('0x37')](function(_0x13373a){_0x3a23b4(_0x13373a);});});};exports[_0x1b44('0x57')]=function isWebrtcLicence(){return compose()[_0x1b44('0x2c')](function(_0x1fa1e9,_0x3db913,_0x98991d){return licenseUtil[_0x1b44('0x54')]()[_0x1b44('0x32')](function(_0x5e001c){if(_0x5e001c['webrtc']){_0x98991d();}else{return _0x3db913[_0x1b44('0x33')](0x193)[_0x1b44('0x35')]({'message':'Forbidden'});}})[_0x1b44('0x37')](function(_0x46e9be){_0x98991d(_0x46e9be);});});};exports[_0x1b44('0x58')]=function(_0x1be1c4,_0x1d19c1,_0x443af0){_0x1be1c4[_0x1b44('0x58')]=!![];return _0x443af0();};exports[_0x1b44('0x59')]=function signToken(_0x3acd81){return signJwt(_0x3acd81);};exports[_0x1b44('0x5a')]=function(_0x568fe3,_0x5177ab){if(!_0x568fe3['user']){return _0x5177ab['status'](0x194)[_0x1b44('0x35')]({'message':_0x1b44('0x5b')});}var _0x1b19ca={'payload':{'id':_0x568fe3[_0x1b44('0x2d')]['id'],'role':_0x568fe3['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x1b19ca)[_0x1b44('0x32')](function(_0x3bab15){_0x5177ab[_0x1b44('0x5c')](_0x1b44('0x5d'),_0x3bab15);_0x5177ab['redirect'](_0x1b44('0x5e'));})[_0x1b44('0x37')](function(_0x2da6e2){return _0x5177ab[_0x1b44('0x33')](0x1f4)[_0x1b44('0x5f')](_0x2da6e2);});};exports['retrieveApiKey']=function(_0x1b263d){if(_[_0x1b44('0x60')](_0x1b263d['apiKeyNonce'])||_[_0x1b44('0x60')](_0x1b263d[_0x1b44('0x61')])){return null;}else{return createJwt(_0x1b263d);}};exports[_0x1b44('0x62')]=function(_0x2f208f){_0x2f208f['apiKeyNonce']=generateNonce();_0x2f208f[_0x1b44('0x61')]=generateIssuedAt();return createJwt(_0x2f208f);};exports['regenerateApiKey']=function(_0x41285c,_0x1d37f2){var _0x4ebe5e=_0x41285c['query'][_0x1b44('0x46')];if(_0x4ebe5e){var _0x171645={'nonce':_0x1d37f2[_0x1b44('0x4b')],'iat':_0x1d37f2[_0x1b44('0x61')],'audience':hardwareConf[_0x1b44('0x45')](),'issuer':hardwareConf[_0x1b44('0x45')]()};return verifyJwt(_0x4ebe5e,_0x171645)[_0x1b44('0x32')](function(){return generateApiKey(_0x1d37f2);});}else{throw{'message':_0x1b44('0x63')};}};exports[_0x1b44('0x64')]=function(_0x4a9a74){var _0xa1909b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0xa1909b['test'](_0x4a9a74))throw new db[(_0x1b44('0x65'))]['ValidationError'](_0x1b44('0x66'));return;};exports[_0x1b44('0x67')]=function(_0x537e2c,_0x5d325c,_0x4ee41c){var _0xb057e7=encryptor['decryptString'](_0x5d325c)[_0x1b44('0x68')](',');for(var _0x1733ea=0x0;_0x1733ea<_0x4ee41c;_0x1733ea++){if(!_0xb057e7[_0x1733ea])break;if(_0x537e2c[_0x1b44('0x69')]()===_0xb057e7[_0x1733ea]['toLowerCase']()){var _0x2014e2=util[_0x1b44('0x6a')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x4ee41c);if(_0x4ee41c===0x1){_0x2014e2=_0x1b44('0x6b');}throw new db[(_0x1b44('0x65'))][(_0x1b44('0x6c'))](_0x2014e2);}}return;};exports[_0x1b44('0x6d')]=function(_0x2fdb3a,_0x1b3d96){var _0x370bf8=_0x1b3d96?encryptor['decryptString'](_0x1b3d96)[_0x1b44('0x68')](','):[];if(_0x370bf8[_0x1b44('0x6e')]===0x5){_0x370bf8[_0x1b44('0x6f')](-0x1,0x1);}_0x370bf8[_0x1b44('0x70')](_0x2fdb3a);return encryptor[_0x1b44('0x71')](_0x370bf8[_0x1b44('0x72')](','));};function signJwt(_0x13b305){var _0x283230=BPromise[_0x1b44('0x73')](jwt[_0x1b44('0x74')],{'context':jwt});var _0x1437e5=_0x13b305[_0x1b44('0x75')]||config[_0x1b44('0x76')][_0x1b44('0x9')];return new BPromise(function(_0x351b86,_0x2de8a9){_0x283230(_0x13b305[_0x1b44('0x77')],_0x1437e5,_0x13b305[_0x1b44('0x78')])['then'](function(_0x4d616c){_0x351b86(_0x4d616c);})['catch'](function(_0x44fb45){_0x2de8a9(_0x44fb45);});});}function verifyJwt(_0x5c7c3b,_0x9fe79,_0xe76984){var _0x24e96e=BPromise[_0x1b44('0x73')](jwt['verify'],{'context':jwt});var _0x5b5891=_0xe76984||config[_0x1b44('0x76')][_0x1b44('0x9')];return new BPromise(function(_0x4938f2,_0x239324){_0x24e96e(_0x5c7c3b,_0x5b5891,_0x9fe79)[_0x1b44('0x32')](function(_0x45b7de){_0x4938f2(_0x45b7de);})[_0x1b44('0x37')](function(_0x18b829){_0x239324(_0x18b829);});});}function generateNonce(){return crypto[_0x1b44('0x79')](0x10)[_0x1b44('0x7a')](_0x1b44('0x7b'));}function generateIssuedAt(){return Math[_0x1b44('0x7c')](Date[_0x1b44('0x7d')]()/0x3e8)[_0x1b44('0x7a')]();}function createJwt(_0x58aacd){var _0x172f8b={'payload':{'iat':_0x58aacd[_0x1b44('0x61')],'nonce':_0x58aacd[_0x1b44('0x4b')]},'options':{'algorithm':'HS512','subject':_0x58aacd['id']['toString'](),'issuer':hardwareConf[_0x1b44('0x45')](),'audience':hardwareConf[_0x1b44('0x45')]()}};return signJwt(_0x172f8b)[_0x1b44('0x32')](function(_0x338739){return{'iat':_0x58aacd['apiKeyIat'],'nonce':_0x58aacd[_0x1b44('0x4b')],'token':_0x338739};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 566bcdd..dab3952 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 _0xc563=['final','encryptString','secret','base64','decryptString','utf8','bluebird','lodash','../../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','indexOf','hasOwnProperty','createWriteStream','createCipher','binary','write','end','close','unlink','decryptFile','createReadStream','createDecipher','update'];(function(_0x5a6513,_0x194cac){var _0x2460ef=function(_0x5315ee){while(--_0x5315ee){_0x5a6513['push'](_0x5a6513['shift']());}};_0x2460ef(++_0x194cac);}(_0xc563,0x138));var _0x3c56=function(_0x12bb86,_0x94e10d){_0x12bb86=_0x12bb86-0x0;var _0x2b3aa7=_0xc563[_0x12bb86];return _0x2b3aa7;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x3c56('0x0'));var _=require(_0x3c56('0x1'));var config=require(_0x3c56('0x2'));var logger=require(_0x3c56('0x3'))(_0x3c56('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x3c56('0x5')][_0x3c56('0x6')],'algorithm':_0x3c56('0x7')};const fileOptions={'algorithm':_0x3c56('0x8')};if(config[_0x3c56('0x9')]&&config[_0x3c56('0x9')][_0x3c56('0xa')]){var isSupported=isAlgorithmSupported(config[_0x3c56('0x9')][_0x3c56('0xa')]);if(isSupported){fileOptions[_0x3c56('0xa')]=config[_0x3c56('0x9')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3c56('0xb')](',\x20');logger[_0x3c56('0xc')](config['encrypt'][_0x3c56('0xa')],_0x3c56('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x568c14){return AES_SUPPORTED_RX[_0x3c56('0xe')](_0x568c14);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x56f447){return getSupportedCiphers()[_0x3c56('0xf')](_0x56f447)>-0x1;}function combineOptions(_0x28ce75){var _0x533cac={};for(var _0x50bb57 in fileOptions){if(fileOptions[_0x3c56('0x10')](_0x50bb57)){_0x533cac[_0x50bb57]=fileOptions[_0x50bb57];}}if(_0x28ce75){for(var _0x7f9d2e in _0x28ce75){if(_0x28ce75[_0x3c56('0x10')](_0x7f9d2e)){_0x533cac[_0x7f9d2e]=_0x28ce75[_0x7f9d2e];}}}return _0x533cac;}exports['encryptFile']=function(_0x16c373,_0x505428,_0x62f976,_0x1320f1){return new BPromise(function(_0x3ae071,_0x548881){_0x1320f1=combineOptions(_0x1320f1);var _0x580b99=new Buffer(_0x62f976);var _0x5deade=fs['createReadStream'](_0x16c373);var _0x50c42=fs[_0x3c56('0x11')](_0x505428);var _0x427c2d=crypto[_0x3c56('0x12')](_0x1320f1[_0x3c56('0xa')],_0x580b99);_0x5deade['on']('data',function(_0x4f4118){var _0x190ebe=new Buffer(_0x427c2d['update'](_0x4f4118),_0x3c56('0x13'));_0x50c42['write'](_0x190ebe);});_0x5deade['on']('end',function(){try{var _0x39eebe=new Buffer(_0x427c2d['final'](_0x3c56('0x13')),_0x3c56('0x13'));_0x50c42[_0x3c56('0x14')](_0x39eebe);_0x50c42[_0x3c56('0x15')]();_0x50c42['on'](_0x3c56('0x16'),function(){return _0x3ae071(_0x505428);});}catch(_0x1f0be5){fs[_0x3c56('0x17')](_0x505428);return _0x548881(_0x1f0be5);}});});};exports[_0x3c56('0x18')]=function(_0x29634b,_0x3c7088,_0x68de7a,_0x2fc849){return new BPromise(function(_0x1909a7,_0x1beb4c){_0x2fc849=combineOptions(_0x2fc849);var _0x3d5dba=new Buffer(_0x68de7a);var _0x2fe34f=fs[_0x3c56('0x19')](_0x29634b);var _0x42bc53=fs['createWriteStream'](_0x3c7088);var _0x130a62=crypto[_0x3c56('0x1a')](_0x2fc849['algorithm'],_0x3d5dba);_0x2fe34f['on']('data',function(_0x36fc8f){var _0x196bc7=new Buffer(_0x130a62[_0x3c56('0x1b')](_0x36fc8f),_0x3c56('0x13'));_0x42bc53[_0x3c56('0x14')](_0x196bc7);});_0x2fe34f['on'](_0x3c56('0x15'),function(){try{var _0x488f1e=new Buffer(_0x130a62[_0x3c56('0x1c')](_0x3c56('0x13')),'binary');_0x42bc53[_0x3c56('0x14')](_0x488f1e);_0x42bc53[_0x3c56('0x15')]();_0x42bc53['on'](_0x3c56('0x16'),function(){return _0x1909a7(_0x3c7088);});}catch(_0x31d217){fs[_0x3c56('0x17')](_0x3c7088);return _0x1beb4c(_0x31d217);}});});};exports[_0x3c56('0x1d')]=function(_0x3b753b,_0x12263c,_0x11fc8c){var _0x3e81e3=_0x11fc8c||stringOptions[_0x3c56('0xa')];var _0x368ba9=_0x12263c||stringOptions[_0x3c56('0x1e')];var _0x513eda=crypto[_0x3c56('0x12')](_0x3e81e3,_0x368ba9);var _0x5c4092=_0x513eda[_0x3c56('0x1b')](_0x3b753b,'utf8',_0x3c56('0x1f'));_0x5c4092+=_0x513eda[_0x3c56('0x1c')]('base64');return _0x5c4092;};exports[_0x3c56('0x20')]=function(_0x265248,_0x397d11,_0x531c80){var _0x2deaae=_0x531c80||stringOptions[_0x3c56('0xa')];var _0x51a461=_0x397d11||stringOptions[_0x3c56('0x1e')];var _0x510272=crypto[_0x3c56('0x1a')](_0x2deaae,_0x51a461);var _0x202df3=_0x510272['update'](_0x265248,_0x3c56('0x1f'),_0x3c56('0x21'));_0x202df3+=_0x510272[_0x3c56('0x1c')](_0x3c56('0x21'));return _0x202df3;}; \ No newline at end of file +var _0xef50=['error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','write','end','final','binary','close','unlink','decryptFile','createDecipher','update','createCipher','utf8','base64','decryptString','secret','bluebird','lodash','../../config/environment','../../config/logger','session','aes-256-ctr','aes192','encrypt','algorithm','join'];(function(_0x1cbdfa,_0x4a68aa){var _0x1251d1=function(_0x44f9f9){while(--_0x44f9f9){_0x1cbdfa['push'](_0x1cbdfa['shift']());}};_0x1251d1(++_0x4a68aa);}(_0xef50,0x9b));var _0x0ef5=function(_0x6e650c,_0x1599de){_0x6e650c=_0x6e650c-0x0;var _0x40927b=_0xef50[_0x6e650c];return _0x40927b;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x0ef5('0x0'));var _=require(_0x0ef5('0x1'));var config=require(_0x0ef5('0x2'));var logger=require(_0x0ef5('0x3'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x0ef5('0x4')],'algorithm':_0x0ef5('0x5')};const fileOptions={'algorithm':_0x0ef5('0x6')};if(config['encrypt']&&config[_0x0ef5('0x7')][_0x0ef5('0x8')]){var isSupported=isAlgorithmSupported(config[_0x0ef5('0x7')][_0x0ef5('0x8')]);if(isSupported){fileOptions[_0x0ef5('0x8')]=config[_0x0ef5('0x7')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0ef5('0x9')](',\x20');logger[_0x0ef5('0xa')](config[_0x0ef5('0x7')][_0x0ef5('0x8')],_0x0ef5('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x3c7079){return AES_SUPPORTED_RX[_0x0ef5('0xc')](_0x3c7079);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x118802){return getSupportedCiphers()[_0x0ef5('0xd')](_0x118802)>-0x1;}function combineOptions(_0x437651){var _0x4f3aba={};for(var _0x37ecf1 in fileOptions){if(fileOptions[_0x0ef5('0xe')](_0x37ecf1)){_0x4f3aba[_0x37ecf1]=fileOptions[_0x37ecf1];}}if(_0x437651){for(var _0x14903d in _0x437651){if(_0x437651[_0x0ef5('0xe')](_0x14903d)){_0x4f3aba[_0x14903d]=_0x437651[_0x14903d];}}}return _0x4f3aba;}exports[_0x0ef5('0xf')]=function(_0x300c4e,_0x1075d7,_0x2ced6c,_0x4955d2){return new BPromise(function(_0x21bcf4,_0x4a2269){_0x4955d2=combineOptions(_0x4955d2);var _0x44a838=new Buffer(_0x2ced6c);var _0x347d31=fs[_0x0ef5('0x10')](_0x300c4e);var _0x366bf3=fs[_0x0ef5('0x11')](_0x1075d7);var _0x54cce3=crypto['createCipher'](_0x4955d2['algorithm'],_0x44a838);_0x347d31['on'](_0x0ef5('0x12'),function(_0x170108){var _0xd0c4ea=new Buffer(_0x54cce3['update'](_0x170108),'binary');_0x366bf3[_0x0ef5('0x13')](_0xd0c4ea);});_0x347d31['on'](_0x0ef5('0x14'),function(){try{var _0x3f8574=new Buffer(_0x54cce3[_0x0ef5('0x15')](_0x0ef5('0x16')),_0x0ef5('0x16'));_0x366bf3[_0x0ef5('0x13')](_0x3f8574);_0x366bf3[_0x0ef5('0x14')]();_0x366bf3['on'](_0x0ef5('0x17'),function(){return _0x21bcf4(_0x1075d7);});}catch(_0x4d0439){fs[_0x0ef5('0x18')](_0x1075d7);return _0x4a2269(_0x4d0439);}});});};exports[_0x0ef5('0x19')]=function(_0x1be7ac,_0x15a50e,_0x4ebbb9,_0x53b803){return new BPromise(function(_0x5b01b0,_0x19295e){_0x53b803=combineOptions(_0x53b803);var _0x45aadf=new Buffer(_0x4ebbb9);var _0x5b4990=fs[_0x0ef5('0x10')](_0x1be7ac);var _0x18d701=fs[_0x0ef5('0x11')](_0x15a50e);var _0x53ecd5=crypto[_0x0ef5('0x1a')](_0x53b803[_0x0ef5('0x8')],_0x45aadf);_0x5b4990['on'](_0x0ef5('0x12'),function(_0x17d893){var _0x2e84c2=new Buffer(_0x53ecd5[_0x0ef5('0x1b')](_0x17d893),_0x0ef5('0x16'));_0x18d701[_0x0ef5('0x13')](_0x2e84c2);});_0x5b4990['on'](_0x0ef5('0x14'),function(){try{var _0x590fdc=new Buffer(_0x53ecd5[_0x0ef5('0x15')](_0x0ef5('0x16')),_0x0ef5('0x16'));_0x18d701[_0x0ef5('0x13')](_0x590fdc);_0x18d701[_0x0ef5('0x14')]();_0x18d701['on']('close',function(){return _0x5b01b0(_0x15a50e);});}catch(_0x518ba3){fs[_0x0ef5('0x18')](_0x15a50e);return _0x19295e(_0x518ba3);}});});};exports['encryptString']=function(_0x4c30c7,_0x43cd40,_0x16e858){var _0xf009d2=_0x16e858||stringOptions[_0x0ef5('0x8')];var _0x38bbd4=_0x43cd40||stringOptions['secret'];var _0x53bfbe=crypto[_0x0ef5('0x1c')](_0xf009d2,_0x38bbd4);var _0x384d8b=_0x53bfbe[_0x0ef5('0x1b')](_0x4c30c7,_0x0ef5('0x1d'),'base64');_0x384d8b+=_0x53bfbe[_0x0ef5('0x15')](_0x0ef5('0x1e'));return _0x384d8b;};exports[_0x0ef5('0x1f')]=function(_0x519f2b,_0x2917bd,_0xea005a){var _0x32dc43=_0xea005a||stringOptions[_0x0ef5('0x8')];var _0x4fbdbc=_0x2917bd||stringOptions[_0x0ef5('0x20')];var _0x5a1cf8=crypto[_0x0ef5('0x1a')](_0x32dc43,_0x4fbdbc);var _0x4b3d5f=_0x5a1cf8['update'](_0x519f2b,_0x0ef5('0x1e'),_0x0ef5('0x1d'));_0x4b3d5f+=_0x5a1cf8['final']('utf8');return _0x4b3d5f;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 056bda5..606bc1d 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 _0xf02b=['csv','%s.%s','writeFileSync','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','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','then','splitSizeCsv','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','split','length','isInteger','forEach','push','query','SELECT','dirname','basename','.csv','existsSync','join','each','%s%d.%s'];(function(_0x3bf1d9,_0x45314a){var _0x36ea8d=function(_0x1942cb){while(--_0x1942cb){_0x3bf1d9['push'](_0x3bf1d9['shift']());}};_0x36ea8d(++_0x45314a);}(_0xf02b,0x108));var _0xbf02=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0xf02b[_0x695b76];return _0x1dc21f;};'use strict';var util=require(_0xbf02('0x0'));var path=require('path');var _=require(_0xbf02('0x1'));var csv=require(_0xbf02('0x2'));var fs=require('fs');var BPromise=require(_0xbf02('0x3'));var zipdir=require(_0xbf02('0x4'));var rimraf=require('rimraf');var db=require(_0xbf02('0x5'))['db'];var dbH=require(_0xbf02('0x5'))[_0xbf02('0x6')];var logger=require(_0xbf02('0x7'))(_0xbf02('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xbf02('0x9')][0x2]);var QUERY=process[_0xbf02('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x16edb7,_0x537564){var _0x2a8e19={'status':_0x16edb7};var _0x677072={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x537564){_0x2a8e19['savename']=_0x537564;}return db['AnalyticExtractedReport'][_0xbf02('0xa')](_0x2a8e19,_0x677072);}function main(){var _0x3f8d85=0x1388;var _0xe2e892;logger['info'](util[_0xbf02('0xb')](_0xbf02('0xc'),EXTRACTED_REPORT_ID,_0xbf02('0xd')));return db['Setting'][_0xbf02('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0xbf02('0xf')](function(_0x69ac35){if(_0x69ac35){_0xe2e892=_0x69ac35;_0x3f8d85=_0xe2e892[_0xbf02('0x10')]||0x1388;}})[_0xbf02('0xf')](function(){return dbH['sequelize']['query'](util[_0xbf02('0xb')](_0xbf02('0x11'),QUERY),{'type':dbH[_0xbf02('0x12')][_0xbf02('0x13')]['SELECT']});})['then'](function(_0x13fbdb){if(!_0x13fbdb[0x0][_0xbf02('0x14')]){return analyticExtractedReport(_0xbf02('0x15'));}var _0x2a72ee=[];var _0x179c22=0x0;if(_0xe2e892[_0xbf02('0x16')]){if(_0x13fbdb&&_0x13fbdb[_0xbf02('0x17')]){var _0x137b49=_['range'](_0x13fbdb[0x0][_0xbf02('0x14')]/_0x3f8d85);var _0x251771=Number[_0xbf02('0x18')](_0x13fbdb[0x0][_0xbf02('0x14')]/_0x3f8d85)?_0x13fbdb[0x0][_0xbf02('0x14')]%_0x3f8d85:0x0;_0x137b49[_0xbf02('0x19')](function(_0x3757e2){if(_0x3757e2>0x0){_0x179c22+=_0x3f8d85;}_0x2a72ee[_0xbf02('0x1a')](dbH[_0xbf02('0x12')][_0xbf02('0x1b')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3f8d85,_0x179c22),{'type':dbH['sequelize'][_0xbf02('0x13')]['SELECT']}));});if(_0x251771>0x0){_0x179c22+=_0x3f8d85;_0x2a72ee[_0xbf02('0x1a')](dbH[_0xbf02('0x12')][_0xbf02('0x1b')](util[_0xbf02('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x251771,_0x179c22),{'type':dbH['sequelize']['QueryTypes'][_0xbf02('0x1c')]}));}}}else{_0x2a72ee[_0xbf02('0x1a')](dbH[_0xbf02('0x12')]['query'](QUERY,{'type':dbH[_0xbf02('0x12')][_0xbf02('0x13')][_0xbf02('0x1c')]}));}var _0x3dcf7b=path[_0xbf02('0x1d')](PATH);var _0x481fa2=path[_0xbf02('0x1e')](PATH,_0xbf02('0x1f'));var _0x1a6d32=_0xe2e892[_0xbf02('0x16')]&&_0x2a72ee[_0xbf02('0x17')]>0x1;var _0x3ca42d=[];if(!fs[_0xbf02('0x20')](path[_0xbf02('0x21')](_0x3dcf7b,_0x481fa2))&&_0x1a6d32){fs['mkdirSync'](path['join'](_0x3dcf7b,_0x481fa2));}return BPromise[_0xbf02('0x22')](_0x2a72ee,function(_0x2ba541){_0x3ca42d[_0xbf02('0x1a')](_0x2ba541);})['then'](function(){for(var _0x2f0bda=0x0;_0x2f0bda<_0x3ca42d[_0xbf02('0x17')];_0x2f0bda+=0x1){var _0x2dd239;var _0x64ac2a=_0x3ca42d[_0x2f0bda];if(_0x1a6d32){_0x2dd239=path[_0xbf02('0x21')](_0x3dcf7b,_0x481fa2,util[_0xbf02('0xb')](_0xbf02('0x23'),_0x481fa2,_0x2f0bda,_0xbf02('0x24')));}else{_0x2dd239=path[_0xbf02('0x21')](_0x3dcf7b,util[_0xbf02('0xb')](_0xbf02('0x25'),_0x481fa2,'csv'));}fs[_0xbf02('0x26')](_0x2dd239,csv(_0x64ac2a));}})[_0xbf02('0xf')](function(){if(_0x1a6d32){return new Promise(function(_0x5d5874){zipdir(path['join'](_0x3dcf7b,_0x481fa2),{'saveTo':path['join'](_0x3dcf7b,util[_0xbf02('0xb')]('%s.%s',_0x481fa2,_0xbf02('0x27')))},function(_0x5281cf,_0x1a85e4){rimraf(path['join'](_0x3dcf7b,_0x481fa2),function(){});_0x5d5874(_0xbf02('0x28'));});});}})[_0xbf02('0xf')](function(){logger[_0xbf02('0x29')](util['format'](_0xbf02('0x2a'),EXTRACTED_REPORT_ID,_0xbf02('0xd')));return analyticExtractedReport(_0xbf02('0x2b'),_0x1a6d32?util[_0xbf02('0xb')](_0xbf02('0x25'),_0x481fa2,_0x1a6d32?_0xbf02('0x27'):_0xbf02('0x24')):null);});})[_0xbf02('0x2c')](function(_0x14d16b){logger[_0xbf02('0x29')](util['format'](_0xbf02('0x2d'),EXTRACTED_REPORT_ID,_0xbf02('0xd')),util[_0xbf02('0x2e')](_0x14d16b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xbf02('0x2f'));})[_0xbf02('0x30')](function(){process[_0xbf02('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x7de3=['rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','format','CSV','Setting','find','split','splitSizeCsv','sequelize','query','SELECT','then','num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.csv','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','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','lodash','to-csv','bluebird'];(function(_0x336e97,_0x23e94c){var _0x184489=function(_0x38f532){while(--_0x38f532){_0x336e97['push'](_0x336e97['shift']());}};_0x184489(++_0x23e94c);}(_0x7de3,0x1d2));var _0x37de=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x7de3[_0xdea41a];return _0x15d0d8;};'use strict';var util=require(_0x37de('0x0'));var path=require('path');var _=require(_0x37de('0x1'));var csv=require(_0x37de('0x2'));var fs=require('fs');var BPromise=require(_0x37de('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x37de('0x4'));var db=require(_0x37de('0x5'))['db'];var dbH=require(_0x37de('0x5'))[_0x37de('0x6')];var logger=require(_0x37de('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x37de('0x8')][0x2]);var QUERY=process[_0x37de('0x8')][0x3];var PATH=process[_0x37de('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4d2988,_0x152797){var _0x27c0ca={'status':_0x4d2988};var _0x4f3ace={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x152797){_0x27c0ca[_0x37de('0x9')]=_0x152797;}return db[_0x37de('0xa')]['update'](_0x27c0ca,_0x4f3ace);}function main(){var _0x3e2a35=0x1388;var _0x3dd0af;logger['info'](util[_0x37de('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x37de('0xc')));return db[_0x37de('0xd')][_0x37de('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x37de('0xf'),_0x37de('0x10')]})['then'](function(_0x3b5935){if(_0x3b5935){_0x3dd0af=_0x3b5935;_0x3e2a35=_0x3dd0af[_0x37de('0x10')]||0x1388;}})['then'](function(){return dbH[_0x37de('0x11')][_0x37de('0x12')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x37de('0x11')]['QueryTypes'][_0x37de('0x13')]});})[_0x37de('0x14')](function(_0x596b9b){if(!_0x596b9b[0x0][_0x37de('0x15')]){return analyticExtractedReport('Empty');}var _0x2ee721=[];var _0x518f5f=0x0;if(_0x3dd0af[_0x37de('0xf')]){if(_0x596b9b&&_0x596b9b[_0x37de('0x16')]){var _0x579751=_['range'](_0x596b9b[0x0]['num']/_0x3e2a35);var _0x511445=Number['isInteger'](_0x596b9b[0x0][_0x37de('0x15')]/_0x3e2a35)?_0x596b9b[0x0][_0x37de('0x15')]%_0x3e2a35:0x0;_0x579751['forEach'](function(_0x1a3a10){if(_0x1a3a10>0x0){_0x518f5f+=_0x3e2a35;}_0x2ee721[_0x37de('0x17')](dbH[_0x37de('0x11')]['query'](util[_0x37de('0xb')](_0x37de('0x18'),QUERY,_0x3e2a35,_0x518f5f),{'type':dbH[_0x37de('0x11')][_0x37de('0x19')][_0x37de('0x13')]}));});if(_0x511445>0x0){_0x518f5f+=_0x3e2a35;_0x2ee721[_0x37de('0x17')](dbH['sequelize'][_0x37de('0x12')](util['format'](_0x37de('0x18'),QUERY,_0x511445,_0x518f5f),{'type':dbH[_0x37de('0x11')][_0x37de('0x19')][_0x37de('0x13')]}));}}}else{_0x2ee721[_0x37de('0x17')](dbH[_0x37de('0x11')][_0x37de('0x12')](QUERY,{'type':dbH[_0x37de('0x11')]['QueryTypes']['SELECT']}));}var _0x165ae5=path[_0x37de('0x1a')](PATH);var _0x2df44e=path[_0x37de('0x1b')](PATH,_0x37de('0x1c'));var _0x31f782=_0x3dd0af[_0x37de('0xf')]&&_0x2ee721['length']>0x1;var _0x4aefc9=[];if(!fs['existsSync'](path[_0x37de('0x1d')](_0x165ae5,_0x2df44e))&&_0x31f782){fs[_0x37de('0x1e')](path['join'](_0x165ae5,_0x2df44e));}return BPromise[_0x37de('0x1f')](_0x2ee721,function(_0x54eaa5){_0x4aefc9[_0x37de('0x17')](_0x54eaa5);})['then'](function(){for(var _0x19a92c=0x0;_0x19a92c<_0x4aefc9[_0x37de('0x16')];_0x19a92c+=0x1){var _0x13bfe5;var _0x23780d=_0x4aefc9[_0x19a92c];if(_0x31f782){_0x13bfe5=path['join'](_0x165ae5,_0x2df44e,util['format'](_0x37de('0x20'),_0x2df44e,_0x19a92c,'csv'));}else{_0x13bfe5=path['join'](_0x165ae5,util[_0x37de('0xb')](_0x37de('0x21'),_0x2df44e,_0x37de('0x22')));}fs[_0x37de('0x23')](_0x13bfe5,csv(_0x23780d));}})[_0x37de('0x14')](function(){if(_0x31f782){return new Promise(function(_0x272d61){zipdir(path[_0x37de('0x1d')](_0x165ae5,_0x2df44e),{'saveTo':path[_0x37de('0x1d')](_0x165ae5,util['format'](_0x37de('0x21'),_0x2df44e,_0x37de('0x24')))},function(_0x24fd24,_0x485579){rimraf(path[_0x37de('0x1d')](_0x165ae5,_0x2df44e),function(){});_0x272d61(_0x37de('0x25'));});});}})[_0x37de('0x14')](function(){logger[_0x37de('0x26')](util[_0x37de('0xb')](_0x37de('0x27'),EXTRACTED_REPORT_ID,_0x37de('0xc')));return analyticExtractedReport(_0x37de('0x28'),_0x31f782?util['format'](_0x37de('0x21'),_0x2df44e,_0x31f782?'zip':'csv'):null);});})[_0x37de('0x29')](function(_0x2e5ba9){logger[_0x37de('0x26')](util['format'](_0x37de('0x2a'),EXTRACTED_REPORT_ID,_0x37de('0xc')),util[_0x37de('0x2b')](_0x2e5ba9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x37de('0x2c'));})[_0x37de('0x2d')](function(){process[_0x37de('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c292228..8d4d1ed 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 _0x9329=['\x20/\x20','footer','Arial','black','right','Empty','split','then','range','num','isInteger','forEach','query','sequelize','SELECT','QueryTypes','dirname','basename','existsSync','join','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','createWriteStream','finish','error','end','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','argv','savename','AnalyticExtractedReport','update','map','tableHeader','toString','length','auto','body','push','concat','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','header','pageBreak','before','landscape'];(function(_0x28089e,_0x530f8a){var _0x46a73c=function(_0x461513){while(--_0x461513){_0x28089e['push'](_0x28089e['shift']());}};_0x46a73c(++_0x530f8a);}(_0x9329,0x7f));var _0x9932=function(_0x3249c7,_0x5d2f6f){_0x3249c7=_0x3249c7-0x0;var _0x1b3115=_0x9329[_0x3249c7];return _0x1b3115;};'use strict';var _=require(_0x9932('0x0'));var fs=require('fs');var util=require(_0x9932('0x1'));var path=require(_0x9932('0x2'));var moment=require(_0x9932('0x3'));var htmlToPdfmake=require(_0x9932('0x4'));var PdfPrinter=require(_0x9932('0x5'));var zipdir=require('zip-dir');var rimraf=require(_0x9932('0x6'));var JSDOM=require(_0x9932('0x7'))[_0x9932('0x8')];var window=new JSDOM('')['window'];var BPromise=require(_0x9932('0x9'));var db=require(_0x9932('0xa'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x9932('0xb')][0x2]);var QUERY=process[_0x9932('0xb')][0x3];var PATH=process[_0x9932('0xb')][0x4];var NAME=process[_0x9932('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x3b2359,_0x19a7b4){var _0x218624={'status':_0x3b2359};var _0x5b5c70={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x19a7b4){_0x218624[_0x9932('0xc')]=_0x19a7b4;}return db[_0x9932('0xd')][_0x9932('0xe')](_0x218624,_0x5b5c70);}function getHeaders(_0x325b39){return _[_0x9932('0xf')](_0x325b39,function(_0x4a7286){return{'text':_0x4a7286,'style':_0x9932('0x10')};});}function getRows(_0x2ec383,_0x4a5047){return _[_0x9932('0xf')](_0x4a5047,function(_0x3b56df){return _(_0x3b56df)['pick'](_0x2ec383)[_0x9932('0xf')](function(_0x1b6c7f){return _0x1b6c7f?_[_0x9932('0x11')](_0x1b6c7f):'';})['value']();});}function createTable(_0x1c5689,_0x103242){var _0x41c11e={'widths':_['fill'](Array(_0x1c5689[_0x9932('0x12')]),0x91),'heights':function(_0x1e155f){return _0x1e155f===0x0?_0x9932('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x335b3a=getHeaders(_0x1c5689);_0x41c11e[_0x9932('0x14')][_0x9932('0x15')](_0x335b3a);var _0x1e28db=getRows(_0x1c5689,_0x103242);_0x41c11e[_0x9932('0x14')]=_0x41c11e[_0x9932('0x14')][_0x9932('0x16')](_0x1e28db);return _0x41c11e;}function createTables(_0x54756c){var _0x1c4326=[];var _0x4f87a9=_[_0x9932('0x17')](Object[_0x9932('0x18')](_0x54756c[0x0]),0x5);_0x4f87a9['forEach'](function(_0x464262){_0x1c4326['push'](createTable(_0x464262,_0x54756c));});return _0x1c4326;}function getPDFDocDefinition(_0x3cc45a){var _0x37a34d=util['format'](_0x9932('0x19'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x9932('0x1a')])[_0x9932('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x9932('0x1c')])[_0x9932('0x1b')](FORMAT));var _0x97c4f=[];for(var _0x2514a5=0x0;_0x2514a5<_0x3cc45a['length'];_0x2514a5++){var _0x550b66=[];if(_0x2514a5===0x0){_0x550b66[_0x9932('0x15')]({'text':_0x37a34d,'style':_0x9932('0x1d')});}var _0x579fdd={'table':_0x3cc45a[_0x2514a5]};if(_0x2514a5>0x0){_0x579fdd[_0x9932('0x1e')]=_0x9932('0x1f');_0x579fdd['margin']=[0x0,0x46,0x0,0x0];}_0x550b66[_0x9932('0x15')](_0x579fdd);_0x97c4f[_0x9932('0x15')](_0x550b66);}return{'pageSize':'A4','pageOrientation':_0x9932('0x20'),'content':_0x97c4f,'footer':function(_0x413211,_0x407414){return{'text':_0x413211['toString']()+_0x9932('0x21')+_0x407414,'style':_0x9932('0x22')};},'defaultStyle':{'font':_0x9932('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x9932('0x24')},'footer':{'alignment':_0x9932('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x593989){var _0x54a668=0x1388;var _0x571733;if(!_0x593989[0x0]['num']){return analyticExtractedReport(_0x9932('0x26'));}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9932('0x27'),'splitSizePdf']})[_0x9932('0x28')](function(_0x30aab2){if(_0x30aab2){_0x571733=_0x30aab2;_0x54a668=_0x571733['splitSizePdf']||0x3e8;}})[_0x9932('0x28')](function(){var _0x5864c2=[];var _0x24d880=0x0;if(_0x571733[_0x9932('0x27')]){if(_0x593989&&_0x593989[_0x9932('0x12')]){var _0x2f77fe=_[_0x9932('0x29')](_0x593989[0x0][_0x9932('0x2a')]/_0x54a668);var _0xb9fdde=Number[_0x9932('0x2b')](_0x593989[0x0][_0x9932('0x2a')]/_0x54a668)?_0x593989[0x0][_0x9932('0x2a')]%_0x54a668:0x0;_0x2f77fe[_0x9932('0x2c')](function(_0x52fbf6){if(_0x52fbf6>0x0){_0x24d880+=_0x54a668;}_0x5864c2['push'](dbH['sequelize'][_0x9932('0x2d')](util[_0x9932('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x54a668,_0x24d880),{'type':dbH[_0x9932('0x2e')]['QueryTypes'][_0x9932('0x2f')]}));});if(_0xb9fdde>0x0){_0x24d880+=_0x54a668;_0x5864c2[_0x9932('0x15')](dbH[_0x9932('0x2e')][_0x9932('0x2d')](util[_0x9932('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xb9fdde,_0x24d880),{'type':dbH[_0x9932('0x2e')][_0x9932('0x30')][_0x9932('0x2f')]}));}}}else{_0x5864c2['push'](dbH[_0x9932('0x2e')]['query'](QUERY,{'type':dbH[_0x9932('0x2e')]['QueryTypes']['SELECT']}));}var _0x129ef2=path[_0x9932('0x31')](PATH);var _0x45da56=path[_0x9932('0x32')](PATH,'.pdf');var _0x4ed3b5=_0x571733[_0x9932('0x27')]&&_0x5864c2[_0x9932('0x12')]>0x1;var _0x5527c5=[];if(!fs[_0x9932('0x33')](path[_0x9932('0x34')](_0x129ef2,_0x45da56))&&_0x4ed3b5){fs['mkdirSync'](path['join'](_0x129ef2,_0x45da56));}return BPromise['each'](_0x5864c2,function(_0x527b4f){_0x5527c5[_0x9932('0x15')](_0x527b4f);})[_0x9932('0x28')](function(){var _0x142507=[];for(var _0x3e8543=0x0;_0x3e8543<_0x5527c5[_0x9932('0x12')];_0x3e8543+=0x1){var _0x4a8866=_0x5527c5[_0x3e8543];var _0x1e0688=createTables(_['flatten'](_0x4a8866));var _0x43a2e7;var _0x536923=getPDFDocDefinition(_0x1e0688);var _0x3f4ddb=getPDFPrinter();var _0x1508f4=_0x3f4ddb[_0x9932('0x35')](_0x536923);if(_0x4ed3b5){_0x43a2e7=path[_0x9932('0x34')](_0x129ef2,_0x45da56,util[_0x9932('0x1b')](_0x9932('0x36'),_0x45da56,_0x3e8543,_0x9932('0x37')));}else{_0x43a2e7=path[_0x9932('0x34')](_0x129ef2,util[_0x9932('0x1b')](_0x9932('0x38'),_0x45da56,_0x9932('0x37')));}_0x142507[_0x9932('0x15')](writePDFDocument(_0x1508f4,_0x43a2e7));}return Promise['all'](_0x142507);})[_0x9932('0x28')](function(){if(_0x4ed3b5){return new Promise(function(_0x10e266){zipdir(path['join'](_0x129ef2,_0x45da56),{'saveTo':path[_0x9932('0x34')](_0x129ef2,util[_0x9932('0x1b')](_0x9932('0x38'),_0x45da56,_0x9932('0x39')))},function(){rimraf(path['join'](_0x129ef2,_0x45da56),function(){});_0x10e266(_0x9932('0x3a'));});});}})['then'](function(){if(!_0x4ed3b5)return;rimraf(path[_0x9932('0x34')](_0x129ef2,_0x45da56),function(){});})[_0x9932('0x28')](function(){logger[_0x9932('0x3b')](util['format'](_0x9932('0x3c'),EXTRACTED_REPORT_ID,_0x9932('0x3d')));return analyticExtractedReport('Completed',_0x4ed3b5?util[_0x9932('0x1b')](_0x9932('0x38'),_0x45da56,_0x4ed3b5?_0x9932('0x39'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x9932('0x3b')](util[_0x9932('0x1b')](_0x9932('0x3e'),EXTRACTED_REPORT_ID,_0x9932('0x3d')));return db[_0x9932('0xd')][_0x9932('0x3f')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x9932('0x28')](function(_0x3a9c71){EXTRACTED_REPORT=_0x3a9c71;return dbH[_0x9932('0x2e')][_0x9932('0x2d')](util['format'](_0x9932('0x40'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x9932('0x2f')]});})[_0x9932('0x28')](extractReport)[_0x9932('0x41')](function(_0x49e115){logger[_0x9932('0x3b')](util[_0x9932('0x1b')](_0x9932('0x42'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x49e115,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9932('0x43'));})['finally'](function(){process[_0x9932('0x44')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x14ae8c=new PdfPrinter({'Arial':{'normal':__dirname+_0x9932('0x45'),'bold':__dirname+_0x9932('0x46'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x9932('0x47')}});return _0x14ae8c;}function getPDFDocDefinitionFromHTML(_0x3da333,_0x21956b){var _0x3bae8b=util['format']('%s\x20#%d',_0x21956b['channel'],_0x21956b[_0x9932('0x48')]);var _0x15f97d=moment()[_0x9932('0x1b')](_0x9932('0x49'))['toString']();var _0x4d8f7a=htmlToPdfmake(_0x3da333,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4d8f7a],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x9932('0x4a'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x9932('0x4a')}},'header':function(){return[{'text':_0x9932('0x4b'),'style':_0x9932('0x1d')}];},'footer':function(_0x5b83cb,_0x64775d){return[{'text':util[_0x9932('0x1b')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x3bae8b,_0x5b83cb,_0x64775d,_0x15f97d),'style':_0x9932('0x22')}];}};}function writePDFDocument(_0x6d31e2,_0x5b1e68){return new Promise(function(_0x12f0d5,_0x279c94){var _0x2b6995=_0x6d31e2['pipe'](fs[_0x9932('0x4c')](_0x5b1e68));_0x2b6995['on'](_0x9932('0x4d'),function(){_0x12f0d5(_0x9932('0x4d'));});_0x2b6995['on'](_0x9932('0x4e'),function(_0x25cd39){_0x279c94(_0x25cd39);});_0x6d31e2[_0x9932('0x4f')]();});}exports['createPdfFromHTML']=function(_0x480632,_0x21ee80){var _0xca1475=getPDFPrinter();var _0xe64295=getPDFDocDefinitionFromHTML(_0x480632,_0x21ee80);var _0x4f028a=_0xca1475['createPdfKitDocument'](_0xe64295);return writePDFDocument(_0x4f028a,_0x21ee80[_0x9932('0x2')])[_0x9932('0x41')](function(_0x22bfce){throw _0x22bfce;});}; \ No newline at end of file +var _0xfb26=['then','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','toString','center','Interaction\x20Transcript','header','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','catch','lodash','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader','pick','value','length','auto','body','push','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','pageBreak','before','margin','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xfb26,0x8f));var _0x6fb2=function(_0x13de53,_0x5cbc31){_0x13de53=_0x13de53-0x0;var _0x13c459=_0xfb26[_0x13de53];return _0x13c459;};'use strict';var _=require(_0x6fb2('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x6fb2('0x1'));var moment=require(_0x6fb2('0x2'));var htmlToPdfmake=require(_0x6fb2('0x3'));var PdfPrinter=require(_0x6fb2('0x4'));var zipdir=require(_0x6fb2('0x5'));var rimraf=require(_0x6fb2('0x6'));var JSDOM=require(_0x6fb2('0x7'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x6fb2('0x8'));var db=require(_0x6fb2('0x9'))['db'];var dbH=require('../../mysqldb')[_0x6fb2('0xa')];var logger=require(_0x6fb2('0xb'))(_0x6fb2('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x6fb2('0xd')][0x2]);var QUERY=process[_0x6fb2('0xd')][0x3];var PATH=process[_0x6fb2('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x6fb2('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xca79fc,_0x580357){var _0x4840b7={'status':_0xca79fc};var _0x4aeb15={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x580357){_0x4840b7[_0x6fb2('0xf')]=_0x580357;}return db[_0x6fb2('0x10')][_0x6fb2('0x11')](_0x4840b7,_0x4aeb15);}function getHeaders(_0x43d567){return _[_0x6fb2('0x12')](_0x43d567,function(_0x4e5a2a){return{'text':_0x4e5a2a,'style':_0x6fb2('0x13')};});}function getRows(_0x13409e,_0x4dfea3){return _[_0x6fb2('0x12')](_0x4dfea3,function(_0x49d25a){return _(_0x49d25a)[_0x6fb2('0x14')](_0x13409e)[_0x6fb2('0x12')](function(_0x44f61d){return _0x44f61d?_['toString'](_0x44f61d):'';})[_0x6fb2('0x15')]();});}function createTable(_0xd7b576,_0x1c6c0f){var _0x12f9e7={'widths':_['fill'](Array(_0xd7b576[_0x6fb2('0x16')]),0x91),'heights':function(_0x3aa58c){return _0x3aa58c===0x0?_0x6fb2('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xa1cc81=getHeaders(_0xd7b576);_0x12f9e7[_0x6fb2('0x18')][_0x6fb2('0x19')](_0xa1cc81);var _0xf8a0eb=getRows(_0xd7b576,_0x1c6c0f);_0x12f9e7[_0x6fb2('0x18')]=_0x12f9e7[_0x6fb2('0x18')]['concat'](_0xf8a0eb);return _0x12f9e7;}function createTables(_0x50b6ae){var _0x2ba914=[];var _0x5c8a7b=_['chunk'](Object[_0x6fb2('0x1a')](_0x50b6ae[0x0]),0x5);_0x5c8a7b[_0x6fb2('0x1b')](function(_0x1eaa31){_0x2ba914['push'](createTable(_0x1eaa31,_0x50b6ae));});return _0x2ba914;}function getPDFDocDefinition(_0x19f68c){var _0x213f78=util[_0x6fb2('0x1c')](_0x6fb2('0x1d'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x6fb2('0x1e')])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x6fb2('0x1c')](FORMAT));var _0x45681d=[];for(var _0x384b8a=0x0;_0x384b8a<_0x19f68c[_0x6fb2('0x16')];_0x384b8a++){var _0x4926d=[];if(_0x384b8a===0x0){_0x4926d[_0x6fb2('0x19')]({'text':_0x213f78,'style':'header'});}var _0x367d6a={'table':_0x19f68c[_0x384b8a]};if(_0x384b8a>0x0){_0x367d6a[_0x6fb2('0x1f')]=_0x6fb2('0x20');_0x367d6a[_0x6fb2('0x21')]=[0x0,0x46,0x0,0x0];}_0x4926d[_0x6fb2('0x19')](_0x367d6a);_0x45681d[_0x6fb2('0x19')](_0x4926d);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x45681d,'footer':function(_0x5e3898,_0x4db759){return{'text':_0x5e3898['toString']()+_0x6fb2('0x22')+_0x4db759,'style':_0x6fb2('0x23')};},'defaultStyle':{'font':_0x6fb2('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6fb2('0x25')},'footer':{'alignment':_0x6fb2('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xb142c0){var _0x192da4=0x1388;var _0x1cb87c;if(!_0xb142c0[0x0][_0x6fb2('0x27')]){return analyticExtractedReport(_0x6fb2('0x28'));}return db[_0x6fb2('0x29')][_0x6fb2('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6fb2('0x2b'),_0x6fb2('0x2c')]})[_0x6fb2('0x2d')](function(_0x36af22){if(_0x36af22){_0x1cb87c=_0x36af22;_0x192da4=_0x1cb87c[_0x6fb2('0x2c')]||0x3e8;}})[_0x6fb2('0x2d')](function(){var _0x294a49=[];var _0x1d741a=0x0;if(_0x1cb87c[_0x6fb2('0x2b')]){if(_0xb142c0&&_0xb142c0[_0x6fb2('0x16')]){var _0x46b424=_['range'](_0xb142c0[0x0]['num']/_0x192da4);var _0x14e95a=Number[_0x6fb2('0x2e')](_0xb142c0[0x0][_0x6fb2('0x27')]/_0x192da4)?_0xb142c0[0x0][_0x6fb2('0x27')]%_0x192da4:0x0;_0x46b424[_0x6fb2('0x1b')](function(_0x9b8aab){if(_0x9b8aab>0x0){_0x1d741a+=_0x192da4;}_0x294a49[_0x6fb2('0x19')](dbH[_0x6fb2('0x2f')][_0x6fb2('0x30')](util['format'](_0x6fb2('0x31'),QUERY,_0x192da4,_0x1d741a),{'type':dbH[_0x6fb2('0x2f')][_0x6fb2('0x32')][_0x6fb2('0x33')]}));});if(_0x14e95a>0x0){_0x1d741a+=_0x192da4;_0x294a49[_0x6fb2('0x19')](dbH[_0x6fb2('0x2f')]['query'](util[_0x6fb2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14e95a,_0x1d741a),{'type':dbH[_0x6fb2('0x2f')][_0x6fb2('0x32')][_0x6fb2('0x33')]}));}}}else{_0x294a49[_0x6fb2('0x19')](dbH[_0x6fb2('0x2f')][_0x6fb2('0x30')](QUERY,{'type':dbH[_0x6fb2('0x2f')]['QueryTypes'][_0x6fb2('0x33')]}));}var _0x4f8d78=path[_0x6fb2('0x34')](PATH);var _0x1b3baf=path[_0x6fb2('0x35')](PATH,_0x6fb2('0x36'));var _0x3e91cc=_0x1cb87c['split']&&_0x294a49['length']>0x1;var _0x65a92f=[];if(!fs[_0x6fb2('0x37')](path[_0x6fb2('0x38')](_0x4f8d78,_0x1b3baf))&&_0x3e91cc){fs['mkdirSync'](path[_0x6fb2('0x38')](_0x4f8d78,_0x1b3baf));}return BPromise[_0x6fb2('0x39')](_0x294a49,function(_0x434495){_0x65a92f[_0x6fb2('0x19')](_0x434495);})[_0x6fb2('0x2d')](function(){var _0x306451=[];for(var _0x21a4e7=0x0;_0x21a4e7<_0x65a92f[_0x6fb2('0x16')];_0x21a4e7+=0x1){var _0x25c902=_0x65a92f[_0x21a4e7];var _0x3099cc=createTables(_[_0x6fb2('0x3a')](_0x25c902));var _0x10d618;var _0x23fc7a=getPDFDocDefinition(_0x3099cc);var _0x26adeb=getPDFPrinter();var _0x1f5095=_0x26adeb[_0x6fb2('0x3b')](_0x23fc7a);if(_0x3e91cc){_0x10d618=path[_0x6fb2('0x38')](_0x4f8d78,_0x1b3baf,util[_0x6fb2('0x1c')](_0x6fb2('0x3c'),_0x1b3baf,_0x21a4e7,_0x6fb2('0x3d')));}else{_0x10d618=path['join'](_0x4f8d78,util[_0x6fb2('0x1c')](_0x6fb2('0x3e'),_0x1b3baf,'pdf'));}_0x306451['push'](writePDFDocument(_0x1f5095,_0x10d618));}return Promise[_0x6fb2('0x3f')](_0x306451);})[_0x6fb2('0x2d')](function(){if(_0x3e91cc){return new Promise(function(_0x2ee2d8){zipdir(path[_0x6fb2('0x38')](_0x4f8d78,_0x1b3baf),{'saveTo':path[_0x6fb2('0x38')](_0x4f8d78,util[_0x6fb2('0x1c')](_0x6fb2('0x3e'),_0x1b3baf,_0x6fb2('0x40')))},function(){rimraf(path['join'](_0x4f8d78,_0x1b3baf),function(){});_0x2ee2d8(_0x6fb2('0x41'));});});}})[_0x6fb2('0x2d')](function(){if(!_0x3e91cc)return;rimraf(path['join'](_0x4f8d78,_0x1b3baf),function(){});})[_0x6fb2('0x2d')](function(){logger[_0x6fb2('0x42')](util[_0x6fb2('0x1c')](_0x6fb2('0x43'),EXTRACTED_REPORT_ID,_0x6fb2('0x44')));return analyticExtractedReport(_0x6fb2('0x45'),_0x3e91cc?util[_0x6fb2('0x1c')](_0x6fb2('0x3e'),_0x1b3baf,_0x3e91cc?'zip':_0x6fb2('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6fb2('0x42')](util[_0x6fb2('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6fb2('0x44')));return db[_0x6fb2('0x10')][_0x6fb2('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6fb2('0x2d')](function(_0x34df60){EXTRACTED_REPORT=_0x34df60;return dbH['sequelize'][_0x6fb2('0x30')](util[_0x6fb2('0x1c')](_0x6fb2('0x47'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x6fb2('0x33')]});})[_0x6fb2('0x2d')](extractReport)['catch'](function(_0x4127ff){logger[_0x6fb2('0x42')](util[_0x6fb2('0x1c')](_0x6fb2('0x48'),EXTRACTED_REPORT_ID,_0x6fb2('0x44')),util[_0x6fb2('0x49')](_0x4127ff,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6fb2('0x4a'));})['finally'](function(){process[_0x6fb2('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x19771a=new PdfPrinter({'Arial':{'normal':__dirname+_0x6fb2('0x4c'),'bold':__dirname+_0x6fb2('0x4d'),'italics':__dirname+_0x6fb2('0x4e'),'bolditalics':__dirname+_0x6fb2('0x4f')}});return _0x19771a;}function getPDFDocDefinitionFromHTML(_0x462b93,_0x331930){var _0x58f984=util[_0x6fb2('0x1c')]('%s\x20#%d',_0x331930[_0x6fb2('0x50')],_0x331930[_0x6fb2('0x51')]);var _0x3bb7e0=moment()[_0x6fb2('0x1c')]('YYYY-MM-DD')[_0x6fb2('0x52')]();var _0x33b02c=htmlToPdfmake(_0x462b93,{'window':window,'tableAutoSize':!![]});return{'content':[_0x33b02c],'defaultStyle':{'font':_0x6fb2('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6fb2('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6fb2('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6fb2('0x53')}},'header':function(){return[{'text':_0x6fb2('0x54'),'style':_0x6fb2('0x55')}];},'footer':function(_0x2d24c1,_0x2f68a9){return[{'text':util['format'](_0x6fb2('0x56'),_0x58f984,_0x2d24c1,_0x2f68a9,_0x3bb7e0),'style':_0x6fb2('0x23')}];}};}function writePDFDocument(_0x33c0cb,_0x525414){return new Promise(function(_0x8045ab,_0x1f97fb){var _0x5c913a=_0x33c0cb[_0x6fb2('0x57')](fs[_0x6fb2('0x58')](_0x525414));_0x5c913a['on']('finish',function(){_0x8045ab(_0x6fb2('0x59'));});_0x5c913a['on'](_0x6fb2('0x5a'),function(_0x338a95){_0x1f97fb(_0x338a95);});_0x33c0cb[_0x6fb2('0x5b')]();});}exports[_0x6fb2('0x5c')]=function(_0x10fecf,_0x5e025c){var _0x33b02b=getPDFPrinter();var _0x5d6968=getPDFDocDefinitionFromHTML(_0x10fecf,_0x5e025c);var _0x329575=_0x33b02b[_0x6fb2('0x3b')](_0x5d6968);return writePDFDocument(_0x329575,_0x5e025c[_0x6fb2('0x1')])[_0x6fb2('0x5d')](function(_0x47685e){throw _0x47685e;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index b387e34..d3e6be5 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 _0x849d=['%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','length','existsSync','join','each'];(function(_0x240d8c,_0x979f5){var _0x4e0720=function(_0x3aef9d){while(--_0x3aef9d){_0x240d8c['push'](_0x240d8c['shift']());}};_0x4e0720(++_0x979f5);}(_0x849d,0x77));var _0xd849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xd849('0x0'));var path=require('path');var _=require(_0xd849('0x1'));var fs=require('fs');var json2xls=require(_0xd849('0x2'));var BPromise=require(_0xd849('0x3'));var zipdir=require(_0xd849('0x4'));var rimraf=require(_0xd849('0x5'));var db=require(_0xd849('0x6'))['db'];var dbH=require(_0xd849('0x6'))[_0xd849('0x7')];var logger=require(_0xd849('0x8'))(_0xd849('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xd849('0xa')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd849('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x48aaca,_0xfd2a6e){var _0x5e5443={'status':_0x48aaca};var _0x5848a2={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xfd2a6e){_0x5e5443[_0xd849('0xb')]=_0xfd2a6e;}return db[_0xd849('0xc')]['update'](_0x5e5443,_0x5848a2);}function main(){var _0x8a919f=0x1388;var _0x2a412b;logger['info'](util[_0xd849('0xd')](_0xd849('0xe'),EXTRACTED_REPORT_ID,_0xd849('0xf')));return db['Setting'][_0xd849('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd849('0x11'),_0xd849('0x12')]})[_0xd849('0x13')](function(_0x1070bf){if(_0x1070bf){_0x2a412b=_0x1070bf;_0x8a919f=_0x2a412b[_0xd849('0x12')]||0x1388;}})['then'](function(){return dbH[_0xd849('0x14')][_0xd849('0x15')](util['format'](_0xd849('0x16'),QUERY),{'type':dbH[_0xd849('0x14')][_0xd849('0x17')]['SELECT']});})['then'](function(_0x2e47b6){if(!_0x2e47b6[0x0][_0xd849('0x18')]){return analyticExtractedReport('Empty');}var _0x275beb=[];var _0x4bd14a=0x0;if(_0x2a412b[_0xd849('0x11')]){if(_0x2e47b6&&_0x2e47b6['length']){var _0x38071c=_[_0xd849('0x19')](_0x2e47b6[0x0][_0xd849('0x18')]/_0x8a919f);var _0x256e92=Number['isInteger'](_0x2e47b6[0x0][_0xd849('0x18')]/_0x8a919f)?_0x2e47b6[0x0][_0xd849('0x18')]%_0x8a919f:0x0;_0x38071c[_0xd849('0x1a')](function(_0x2a54a9){if(_0x2a54a9>0x0){_0x4bd14a+=_0x8a919f;}_0x275beb[_0xd849('0x1b')](dbH[_0xd849('0x14')][_0xd849('0x15')](util[_0xd849('0xd')](_0xd849('0x1c'),QUERY,_0x8a919f,_0x4bd14a),{'type':dbH[_0xd849('0x14')][_0xd849('0x17')][_0xd849('0x1d')]}));});if(_0x256e92>0x0){_0x4bd14a+=_0x8a919f;_0x275beb[_0xd849('0x1b')](dbH[_0xd849('0x14')][_0xd849('0x15')](util[_0xd849('0xd')](_0xd849('0x1c'),QUERY,_0x256e92,_0x4bd14a),{'type':dbH[_0xd849('0x14')][_0xd849('0x17')][_0xd849('0x1d')]}));}}}else{_0x275beb[_0xd849('0x1b')](dbH[_0xd849('0x14')][_0xd849('0x15')](QUERY,{'type':dbH[_0xd849('0x14')][_0xd849('0x17')][_0xd849('0x1d')]}));}var _0x5bef8f=path[_0xd849('0x1e')](PATH);var _0x3da544=path[_0xd849('0x1f')](PATH,_0xd849('0x20'));var _0x35c201=_0x2a412b[_0xd849('0x11')]&&_0x275beb[_0xd849('0x21')]>0x1;var _0x2ebfe5=[];if(!fs[_0xd849('0x22')](path[_0xd849('0x23')](_0x5bef8f,_0x3da544))&&_0x35c201){fs['mkdirSync'](path['join'](_0x5bef8f,_0x3da544));}return BPromise[_0xd849('0x24')](_0x275beb,function(_0xfe7ce0){_0x2ebfe5['push'](_0xfe7ce0);})[_0xd849('0x13')](function(){for(var _0x3a99eb=0x0;_0x3a99eb<_0x2ebfe5['length'];_0x3a99eb+=0x1){var _0x4961af;var _0x57d123=_0x2ebfe5[_0x3a99eb];if(_0x35c201){_0x4961af=path['join'](_0x5bef8f,_0x3da544,util['format'](_0xd849('0x25'),_0x3da544,_0x3a99eb,_0xd849('0x26')));}else{_0x4961af=path['join'](_0x5bef8f,util[_0xd849('0xd')](_0xd849('0x27'),_0x3da544,_0xd849('0x26')));}fs[_0xd849('0x28')](_0x4961af,json2xls(_0x57d123),_0xd849('0x29'));}})[_0xd849('0x13')](function(){if(_0x35c201){return new Promise(function(_0x5b89d5){zipdir(path['join'](_0x5bef8f,_0x3da544),{'saveTo':path[_0xd849('0x23')](_0x5bef8f,util[_0xd849('0xd')](_0xd849('0x27'),_0x3da544,_0xd849('0x2a')))},function(_0x539552,_0x978c25){rimraf(path[_0xd849('0x23')](_0x5bef8f,_0x3da544),function(){});_0x5b89d5(_0xd849('0x2b'));});});}})['then'](function(){logger[_0xd849('0x2c')](util[_0xd849('0xd')](_0xd849('0x2d'),EXTRACTED_REPORT_ID,_0xd849('0xf')));return analyticExtractedReport(_0xd849('0x2e'),_0x35c201?util[_0xd849('0xd')]('%s.%s',_0x3da544,_0x35c201?_0xd849('0x2a'):_0xd849('0x26')):null);});})[_0xd849('0x2f')](function(_0x2fa366){logger[_0xd849('0x2c')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd849('0xf')),util[_0xd849('0x30')](_0x2fa366,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd849('0x31'));})[_0xd849('0x32')](function(){process[_0xd849('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb36c=['%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','basename','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Setting','then','splitSizeXlsx','sequelize','QueryTypes','num','split','length','range','isInteger','forEach','push','query'];(function(_0x48aa9f,_0x26e09d){var _0x1efb5f=function(_0x233423){while(--_0x233423){_0x48aa9f['push'](_0x48aa9f['shift']());}};_0x1efb5f(++_0x26e09d);}(_0xb36c,0x1bb));var _0xcb36=function(_0x11c7d3,_0x4456fb){_0x11c7d3=_0x11c7d3-0x0;var _0x2a4074=_0xb36c[_0x11c7d3];return _0x2a4074;};'use strict';var util=require(_0xcb36('0x0'));var path=require('path');var _=require(_0xcb36('0x1'));var fs=require('fs');var json2xls=require(_0xcb36('0x2'));var BPromise=require(_0xcb36('0x3'));var zipdir=require(_0xcb36('0x4'));var rimraf=require(_0xcb36('0x5'));var db=require(_0xcb36('0x6'))['db'];var dbH=require(_0xcb36('0x6'))['dbH'];var logger=require(_0xcb36('0x7'))(_0xcb36('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xcb36('0x9')][0x2]);var QUERY=process[_0xcb36('0x9')][0x3];var PATH=process[_0xcb36('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x363579,_0x4a2055){var _0x4adfd4={'status':_0x363579};var _0x5d984e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4a2055){_0x4adfd4['savename']=_0x4a2055;}return db[_0xcb36('0xa')][_0xcb36('0xb')](_0x4adfd4,_0x5d984e);}function main(){var _0x34f7b3=0x1388;var _0xe6e2d0;logger[_0xcb36('0xc')](util[_0xcb36('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0xcb36('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0xcb36('0xf')](function(_0x1feac1){if(_0x1feac1){_0xe6e2d0=_0x1feac1;_0x34f7b3=_0xe6e2d0[_0xcb36('0x10')]||0x1388;}})[_0xcb36('0xf')](function(){return dbH[_0xcb36('0x11')]['query'](util[_0xcb36('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xcb36('0x11')][_0xcb36('0x12')]['SELECT']});})[_0xcb36('0xf')](function(_0x3bf474){if(!_0x3bf474[0x0][_0xcb36('0x13')]){return analyticExtractedReport('Empty');}var _0x40f533=[];var _0x439c14=0x0;if(_0xe6e2d0[_0xcb36('0x14')]){if(_0x3bf474&&_0x3bf474[_0xcb36('0x15')]){var _0x4f55fa=_[_0xcb36('0x16')](_0x3bf474[0x0][_0xcb36('0x13')]/_0x34f7b3);var _0x28ddd7=Number[_0xcb36('0x17')](_0x3bf474[0x0]['num']/_0x34f7b3)?_0x3bf474[0x0]['num']%_0x34f7b3:0x0;_0x4f55fa[_0xcb36('0x18')](function(_0x1339dc){if(_0x1339dc>0x0){_0x439c14+=_0x34f7b3;}_0x40f533[_0xcb36('0x19')](dbH['sequelize'][_0xcb36('0x1a')](util[_0xcb36('0xd')](_0xcb36('0x1b'),QUERY,_0x34f7b3,_0x439c14),{'type':dbH[_0xcb36('0x11')][_0xcb36('0x12')]['SELECT']}));});if(_0x28ddd7>0x0){_0x439c14+=_0x34f7b3;_0x40f533['push'](dbH[_0xcb36('0x11')][_0xcb36('0x1a')](util[_0xcb36('0xd')](_0xcb36('0x1b'),QUERY,_0x28ddd7,_0x439c14),{'type':dbH[_0xcb36('0x11')][_0xcb36('0x12')][_0xcb36('0x1c')]}));}}}else{_0x40f533[_0xcb36('0x19')](dbH[_0xcb36('0x11')][_0xcb36('0x1a')](QUERY,{'type':dbH[_0xcb36('0x11')][_0xcb36('0x12')]['SELECT']}));}var _0xa988d9=path['dirname'](PATH);var _0x579810=path[_0xcb36('0x1d')](PATH,'.xlsx');var _0x3fc8ec=_0xe6e2d0[_0xcb36('0x14')]&&_0x40f533['length']>0x1;var _0x47c6b9=[];if(!fs[_0xcb36('0x1e')](path[_0xcb36('0x1f')](_0xa988d9,_0x579810))&&_0x3fc8ec){fs[_0xcb36('0x20')](path['join'](_0xa988d9,_0x579810));}return BPromise[_0xcb36('0x21')](_0x40f533,function(_0x256529){_0x47c6b9[_0xcb36('0x19')](_0x256529);})['then'](function(){for(var _0x16abf0=0x0;_0x16abf0<_0x47c6b9['length'];_0x16abf0+=0x1){var _0x441c27;var _0x2b3501=_0x47c6b9[_0x16abf0];if(_0x3fc8ec){_0x441c27=path[_0xcb36('0x1f')](_0xa988d9,_0x579810,util[_0xcb36('0xd')](_0xcb36('0x22'),_0x579810,_0x16abf0,_0xcb36('0x23')));}else{_0x441c27=path[_0xcb36('0x1f')](_0xa988d9,util[_0xcb36('0xd')](_0xcb36('0x24'),_0x579810,_0xcb36('0x23')));}fs[_0xcb36('0x25')](_0x441c27,json2xls(_0x2b3501),_0xcb36('0x26'));}})['then'](function(){if(_0x3fc8ec){return new Promise(function(_0x3469e0){zipdir(path['join'](_0xa988d9,_0x579810),{'saveTo':path[_0xcb36('0x1f')](_0xa988d9,util[_0xcb36('0xd')](_0xcb36('0x24'),_0x579810,'zip'))},function(_0x3f54ee,_0x10c682){rimraf(path[_0xcb36('0x1f')](_0xa988d9,_0x579810),function(){});_0x3469e0('zip\x20finished');});});}})[_0xcb36('0xf')](function(){logger[_0xcb36('0xc')](util[_0xcb36('0xd')](_0xcb36('0x27'),EXTRACTED_REPORT_ID,_0xcb36('0x28')));return analyticExtractedReport(_0xcb36('0x29'),_0x3fc8ec?util['format'](_0xcb36('0x24'),_0x579810,_0x3fc8ec?'zip':_0xcb36('0x23')):null);});})[_0xcb36('0x2a')](function(_0x11ce11){logger[_0xcb36('0xc')](util['format'](_0xcb36('0x2b'),EXTRACTED_REPORT_ID,_0xcb36('0x28')),util['inspect'](_0x11ce11,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xcb36('0x2c'));})[_0xcb36('0x2d')](function(){process[_0xcb36('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 04b5854..891483e 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 _0x4954=['length','toLowerCase','updatedAt','interval','*,*,*,*','IntervalId','map','filter','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','app','appType','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','cutdigits','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab'];(function(_0x17fc33,_0x5a9171){var _0x3482b4=function(_0x223970){while(--_0x223970){_0x17fc33['push'](_0x17fc33['shift']());}};_0x3482b4(++_0x5a9171);}(_0x4954,0x1a3));var _0x4495=function(_0x21fb8f,_0x284a00){_0x21fb8f=_0x21fb8f-0x0;var _0x18e108=_0x4954[_0x21fb8f];return _0x18e108;};'use strict';var _=require(_0x4495('0x0'));var util=require('util');function rewrite(_0x55aaa0,_0x319728){var _0x8394dc=this;return _0x55aaa0[_0x4495('0x1')][_0x4495('0x2')][_0x4495('0x3')]({'raw':!![]})[_0x4495('0x4')](function(_0x258bb1){_0x8394dc[_0x4495('0x5')]=_0x258bb1;return _0x55aaa0[_0x4495('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x319728['IntervalId']},'raw':!![]});})[_0x4495('0x4')](function(_0x57727a){return _0x55aaa0[_0x4495('0x1')][_0x4495('0x6')][_0x4495('0x3')]({'where':{'exten':{'$in':_[_0x4495('0x7')](_['map'](_0x57727a,_0x4495('0x8')))}},'order':[{'raw':_0x4495('0x9')}],'raw':!![]});})[_0x4495('0x4')](function(_0x209fc7){var _0xa55942=_['filter'](_0x209fc7,{'priority':'1'});var _0x555fae=_['filter'](_0x209fc7,{'isApp':0x1});var _0x29752d=_[_0x4495('0xa')](_0x555fae,_0x4495('0x8'));var _0x4a9dff=[_0x4495('0xb'),_0x4495('0xc')];var _0x5d26b4=[];var _0x12799c=[];for(var _0x4ab501 in _0x29752d){if(_0x29752d[_0x4495('0xd')](_0x4ab501)){_0x8394dc[_0x4495('0xe')]=0x2;_0x8394dc[_0x4495('0xf')]=[];_0x8394dc[_0x4495('0x10')]=_[_0x4495('0x11')](_0xa55942,{'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')]});_0x8394dc['extensions'][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':'Set','appdata':util['format']('CDR(type)=%s',_0x29752d[_0x4ab501][0x0][_0x4495('0x13')]),'context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0]['exten'],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});if(_0x29752d[_0x4ab501][0x0][_0x4495('0x13')]===_0x4495('0x16')){_0x8394dc[_0x4495('0xf')]['push']({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':'Set','appdata':'CDR(routeid)='+_0x29752d[_0x4ab501][0x0]['VoiceExtensionId'],'context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0]['exten'],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});}else if(_0x29752d[_0x4ab501][0x0][_0x4495('0x13')]==='outbound'){if(_0x8394dc['extension']){_0x8394dc[_0x4495('0xf')]['push']({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':_0x4495('0x17'),'appdata':'CDR(destination)='+(_0x8394dc[_0x4495('0x10')]['cutdigits']?'${EXTEN:'+_0x8394dc[_0x4495('0x10')]['cutdigits']+'}':'${EXTEN}'),'context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0]['VoiceExtensionId']});}_0x8394dc['extensions'][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':_0x4495('0x17'),'appdata':_0x4495('0x18')+_0x29752d[_0x4ab501][0x0]['VoiceExtensionId'],'context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')],'priority':_0x8394dc['priority']++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0]['VoiceExtensionId']});var _0x24b5ce=_0x8394dc[_0x4495('0xe')]++;_0x8394dc[_0x4495('0xf')][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0]['type'],'app':_0x4495('0x19'),'appdata':_0x4495('0x1a')+(_0x24b5ce+0x2)+'):Goto('+(_0x24b5ce+0x1)+')','context':_0x29752d[_0x4ab501][0x0]['context'],'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')],'priority':_0x24b5ce,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});if(_0x8394dc[_0x4495('0x10')]){_0x8394dc['extensions'][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':_0x4495('0x17'),'appdata':_0x8394dc[_0x4495('0x10')][_0x4495('0x1b')]?'CDR(prefix)=${EXTEN:0:'+_0x8394dc[_0x4495('0x10')]['cutdigits']+'}':_0x4495('0x1c'),'context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')],'priority':_0x8394dc['priority']++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});}_0x8394dc[_0x4495('0xf')][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':_0x4495('0x17'),'appdata':_0x4495('0x1d')+_0x29752d[_0x4ab501][0x0]['VoiceExtensionId'],'context':_0x29752d[_0x4ab501][0x0]['context'],'exten':_0x29752d[_0x4ab501][0x0]['exten'],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0]['VoiceExtensionId']});if(_0x8394dc[_0x4495('0x10')]&&_0x8394dc['extension'][_0x4495('0xd')]('recordingFormat')&&_0x8394dc[_0x4495('0x10')][_0x4495('0x1e')]!==_0x4495('0x1f')){_0x8394dc[_0x4495('0xf')][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':'Set','appdata':_0x4495('0x20'),'context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});_0x8394dc[_0x4495('0xf')][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0]['type'],'app':_0x4495('0x17'),'appdata':_0x4495('0x21')+_0x8394dc['extension'][_0x4495('0x1e')]||'wav','context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});}}_0x8394dc[_0x4495('0xf')]['push']({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':_0x4495('0x17'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x29752d[_0x4ab501][0x0][_0x4495('0x14')],'exten':_0x29752d[_0x4ab501][0x0]['exten'],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});_0x8394dc[_0x4495('0xf')][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':'Set','appdata':_0x4495('0x22'),'context':_0x29752d[_0x4ab501][0x0]['context'],'exten':_0x29752d[_0x4ab501][0x0]['exten'],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});_0x8394dc['extensions']['push']({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':_0x4495('0x17'),'appdata':_0x4495('0x23'),'context':_0x29752d[_0x4ab501][0x0]['context'],'exten':_0x29752d[_0x4ab501][0x0]['exten'],'priority':_0x8394dc[_0x4495('0xe')]++,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});for(var _0x3de13a=0x0,_0x5ac737=0x0;_0x3de13a<_0x29752d[_0x4ab501][_0x4495('0x24')];_0x3de13a+=0x1,_0x5ac737=0x0){var _0x193813=_0x29752d[_0x4ab501][_0x3de13a];if(_0x193813[_0x4495('0x13')]){_0x193813['type']=_0x193813[_0x4495('0x13')][_0x4495('0x25')]();}var _0x2a86b9=[];var _0x56ff6f=[];delete _0x193813['id'];delete _0x193813['createdAt'];delete _0x193813[_0x4495('0x26')];var _0x6257a9=_0x193813[_0x4495('0x27')]!==_0x4495('0x28')?[_0x193813[_0x4495('0x27')]]:_0x193813[_0x4495('0x29')]?_[_0x4495('0x2a')](_[_0x4495('0x2b')](_0x8394dc['intervals'],{'IntervalId':_0x193813[_0x4495('0x29')]}),_0x4495('0x27')):[];if(_0x193813[_0x4495('0xd')](_0x4495('0x2c'))){if(_0x193813['tag']&&_0x193813[_0x4495('0x2c')]!=='--'){_0x2a86b9[_0x4495('0x12')]({'type':_0x193813[_0x4495('0x13')],'app':'Set','appdata':_0x4495('0x2d')+_0x193813[_0x4495('0x2c')],'context':_0x193813[_0x4495('0x14')],'exten':_0x193813[_0x4495('0x8')],'priority':_0x6257a9[_0x4495('0x24')]+_0x8394dc[_0x4495('0xe')]+_0x5ac737++,'VoiceExtensionId':_0x193813[_0x4495('0x15')]});}}if(_0x193813[_0x4495('0x13')]==='outbound'&&_0x193813[_0x4495('0xd')](_0x4495('0x2e'))){if(_0x193813[_0x4495('0x2e')]){_0x2a86b9[_0x4495('0x12')]({'type':_0x193813[_0x4495('0x13')],'app':_0x4495('0x19'),'appdata':_0x4495('0x2f')+_0x193813[_0x4495('0x2e')]+')','context':_0x193813[_0x4495('0x14')],'exten':_0x193813[_0x4495('0x8')],'priority':_0x6257a9[_0x4495('0x24')]+_0x8394dc[_0x4495('0xe')]+_0x5ac737++,'VoiceExtensionId':_0x193813[_0x4495('0x15')]});}else{_0x2a86b9[_0x4495('0x12')]({'type':_0x193813[_0x4495('0x13')],'app':_0x4495('0x19'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x193813[_0x4495('0x14')],'exten':_0x193813[_0x4495('0x8')],'priority':_0x6257a9['length']+_0x8394dc['priority']+_0x5ac737++,'VoiceExtensionId':_0x193813[_0x4495('0x15')]});}}if(_0x193813[_0x4495('0xd')]('answer')){if(_0x4a9dff[_0x4495('0x30')](_0x193813[_0x4495('0x31')]['toLowerCase']())>=0x0&&_0x193813[_0x4495('0x32')]!=='custom'){if(_0x193813[_0x4495('0x33')]){_0x2a86b9[_0x4495('0x12')]({'type':_0x193813['type'],'app':_0x4495('0x19'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x193813[_0x4495('0x14')],'exten':_0x193813[_0x4495('0x8')],'priority':_0x6257a9[_0x4495('0x24')]+_0x8394dc[_0x4495('0xe')]+_0x5ac737++,'VoiceExtensionId':_0x193813[_0x4495('0x15')]});_0x2a86b9[_0x4495('0x12')]({'type':_0x193813['type'],'app':_0x4495('0x17'),'appdata':_0x4495('0x34'),'context':_0x193813[_0x4495('0x14')],'exten':_0x193813['exten'],'priority':_0x6257a9[_0x4495('0x24')]+_0x8394dc['priority']+_0x5ac737++,'VoiceExtensionId':_0x193813[_0x4495('0x15')]});}else{_0x2a86b9[_0x4495('0x12')]({'type':_0x193813[_0x4495('0x13')],'app':_0x4495('0x19'),'appdata':_0x4495('0x35'),'context':_0x193813['context'],'exten':_0x193813[_0x4495('0x8')],'priority':_0x6257a9['length']+_0x8394dc[_0x4495('0xe')]+_0x5ac737++,'VoiceExtensionId':_0x193813['VoiceExtensionId']});_0x2a86b9[_0x4495('0x12')]({'type':_0x193813[_0x4495('0x13')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x193813[_0x4495('0x14')],'exten':_0x193813['exten'],'priority':_0x6257a9[_0x4495('0x24')]+_0x8394dc[_0x4495('0xe')]+_0x5ac737++,'VoiceExtensionId':_0x193813['VoiceExtensionId']});}}}for(var _0x37c28a=0x0;_0x37c28a<_0x6257a9['length'];_0x37c28a+=0x1){var _0x3c0133=_0x8394dc[_0x4495('0xe')]+_0x6257a9['length'];var _0x31cd5e=_0x37c28a===_0x6257a9[_0x4495('0x24')]-0x1?_0x8394dc['priority']+_0x2a86b9['length']+_0x56ff6f[_0x4495('0x24')]+0x2:_0x8394dc['priority']+_0x37c28a+0x1;_0x2a86b9[_0x4495('0x36')](_0x37c28a,0x0,{'type':_0x193813[_0x4495('0x13')],'app':_0x4495('0x37'),'appdata':_0x6257a9[_0x37c28a]+'?'+_0x193813[_0x4495('0x14')]+',${EXTEN},'+_0x3c0133+':'+_0x193813['context']+_0x4495('0x38')+_0x31cd5e,'exten':_0x193813['exten'],'context':_0x193813[_0x4495('0x14')],'priority':_0x8394dc[_0x4495('0xe')]+_0x37c28a,'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});}_0x193813['priority']=_0x2a86b9['length']?_[_0x4495('0x39')](_0x2a86b9)[_0x4495('0xe')]+0x1:_0x8394dc['priority'];_0x8394dc['priority']=(_0x56ff6f[_0x4495('0x24')]?_[_0x4495('0x39')](_0x56ff6f)[_0x4495('0xe')]:_0x193813['priority'])+0x1;_0x8394dc['extensions']=_[_0x4495('0x3a')](_0x8394dc[_0x4495('0xf')],_0x2a86b9,[_0x193813],_0x56ff6f);}_0x8394dc['extensions'][_0x4495('0x12')]({'type':_0x29752d[_0x4ab501][0x0][_0x4495('0x13')],'app':_0x4495('0x3b'),'exten':_0x29752d[_0x4ab501][0x0][_0x4495('0x8')],'context':_0x29752d[_0x4ab501][0x0]['context'],'priority':_0x8394dc['priority'],'VoiceExtensionId':_0x29752d[_0x4ab501][0x0][_0x4495('0x15')]});_0x5d26b4['push'](_0x29752d[_0x4ab501][0x0]['VoiceExtensionId']);_0x12799c=_[_0x4495('0x3a')](_0x12799c,_0x8394dc[_0x4495('0xf')]);}}return _0x55aaa0[_0x4495('0x3c')](function(_0x3588b0){return _0x55aaa0[_0x4495('0x1')][_0x4495('0x6')][_0x4495('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x5d26b4}},'transaction':_0x3588b0})[_0x4495('0x4')](function(_0x3670bd){return _0x55aaa0[_0x4495('0x1')][_0x4495('0x6')]['bulkCreate'](_[_0x4495('0x3e')](_0x12799c,_0x4495('0xe')),{'transaction':_0x3588b0});});});})['catch'](function(_0x3ae3b1){console[_0x4495('0x3f')](_0x3ae3b1);});}exports[_0x4495('0x40')]=rewrite; \ No newline at end of file +var _0xa48f=['Set','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','intervals','hasOwnProperty','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','util','Interval','findAll','then','models','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','priority','extension','find','extensions','push','type'];(function(_0x2b2ca4,_0x287f9b){var _0x3e3aad=function(_0x15b4ef){while(--_0x15b4ef){_0x2b2ca4['push'](_0x2b2ca4['shift']());}};_0x3e3aad(++_0x287f9b);}(_0xa48f,0x15c));var _0xfa48=function(_0x39fd75,_0x41892e){_0x39fd75=_0x39fd75-0x0;var _0x16e820=_0xa48f[_0x39fd75];return _0x16e820;};'use strict';var _=require(_0xfa48('0x0'));var util=require(_0xfa48('0x1'));function rewrite(_0x3aaf24,_0x104fc1){var _0x5361c1=this;return _0x3aaf24['models'][_0xfa48('0x2')][_0xfa48('0x3')]({'raw':!![]})[_0xfa48('0x4')](function(_0x2eb08b){_0x5361c1['intervals']=_0x2eb08b;return _0x3aaf24[_0xfa48('0x5')][_0xfa48('0x6')]['findAll']({'where':{'IntervalId':_0x104fc1[_0xfa48('0x7')]},'raw':!![]});})['then'](function(_0x12b25c){return _0x3aaf24['models'][_0xfa48('0x6')]['findAll']({'where':{'exten':{'$in':_[_0xfa48('0x8')](_[_0xfa48('0x9')](_0x12b25c,_0xfa48('0xa')))}},'order':[{'raw':_0xfa48('0xb')}],'raw':!![]});})[_0xfa48('0x4')](function(_0x829341){var _0x20dbf3=_[_0xfa48('0xc')](_0x829341,{'priority':'1'});var _0x4d382d=_[_0xfa48('0xc')](_0x829341,{'isApp':0x1});var _0x4d8ef9=_[_0xfa48('0xd')](_0x4d382d,_0xfa48('0xa'));var _0x56180c=[_0xfa48('0xe'),_0xfa48('0xf')];var _0x4c8aed=[];var _0x4083d5=[];for(var _0x223492 in _0x4d8ef9){if(_0x4d8ef9['hasOwnProperty'](_0x223492)){_0x5361c1[_0xfa48('0x10')]=0x2;_0x5361c1['extensions']=[];_0x5361c1[_0xfa48('0x11')]=_[_0xfa48('0x12')](_0x20dbf3,{'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')]});_0x5361c1[_0xfa48('0x13')][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':util['format'](_0xfa48('0x17'),_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')]),'context':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x18')],'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});if(_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')]===_0xfa48('0x1a')){_0x5361c1[_0xfa48('0x13')]['push']({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':'CDR(routeid)='+_0x4d8ef9[_0x223492][0x0]['VoiceExtensionId'],'context':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x18')],'exten':_0x4d8ef9[_0x223492][0x0]['exten'],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});}else if(_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')]==='outbound'){if(_0x5361c1[_0xfa48('0x11')]){_0x5361c1['extensions'][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0]['type'],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x1b')+(_0x5361c1[_0xfa48('0x11')][_0xfa48('0x1c')]?_0xfa48('0x1d')+_0x5361c1[_0xfa48('0x11')][_0xfa48('0x1c')]+'}':'${EXTEN}'),'context':_0x4d8ef9[_0x223492][0x0]['context'],'exten':_0x4d8ef9[_0x223492][0x0]['exten'],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});}_0x5361c1[_0xfa48('0x13')]['push']({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x1e')+_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')],'context':_0x4d8ef9[_0x223492][0x0]['context'],'exten':_0x4d8ef9[_0x223492][0x0]['exten'],'priority':_0x5361c1['priority']++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});var _0x405a0e=_0x5361c1[_0xfa48('0x10')]++;_0x5361c1['extensions']['push']({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x1f'),'appdata':_0xfa48('0x20')+(_0x405a0e+0x2)+_0xfa48('0x21')+(_0x405a0e+0x1)+')','context':_0x4d8ef9[_0x223492][0x0]['context'],'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'priority':_0x405a0e,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0]['VoiceExtensionId']});if(_0x5361c1['extension']){_0x5361c1[_0xfa48('0x13')][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':_0x5361c1[_0xfa48('0x11')][_0xfa48('0x1c')]?_0xfa48('0x22')+_0x5361c1[_0xfa48('0x11')]['cutdigits']+'}':_0xfa48('0x23'),'context':_0x4d8ef9[_0x223492][0x0]['context'],'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});}_0x5361c1[_0xfa48('0x13')][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':'Set','appdata':_0xfa48('0x24')+_0x4d8ef9[_0x223492][0x0]['VoiceExtensionId'],'context':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x18')],'exten':_0x4d8ef9[_0x223492][0x0]['exten'],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});if(_0x5361c1[_0xfa48('0x11')]&&_0x5361c1[_0xfa48('0x11')]['hasOwnProperty'](_0xfa48('0x25'))&&_0x5361c1[_0xfa48('0x11')][_0xfa48('0x25')]!=='none'){_0x5361c1['extensions'][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x26'),'context':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x18')],'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0]['VoiceExtensionId']});_0x5361c1[_0xfa48('0x13')]['push']({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x27')+_0x5361c1[_0xfa48('0x11')]['recordingFormat']||_0xfa48('0x28'),'context':_0x4d8ef9[_0x223492][0x0]['context'],'exten':_0x4d8ef9[_0x223492][0x0]['exten'],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});}}_0x5361c1[_0xfa48('0x13')][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x29'),'context':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x18')],'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});_0x5361c1[_0xfa48('0x13')][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x2a'),'context':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x18')],'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'priority':_0x5361c1['priority']++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});_0x5361c1[_0xfa48('0x13')][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0]['type'],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x2b'),'context':_0x4d8ef9[_0x223492][0x0]['context'],'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'priority':_0x5361c1[_0xfa48('0x10')]++,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0]['VoiceExtensionId']});for(var _0x850f5d=0x0,_0x8b07d=0x0;_0x850f5d<_0x4d8ef9[_0x223492][_0xfa48('0x2c')];_0x850f5d+=0x1,_0x8b07d=0x0){var _0x57f8f3=_0x4d8ef9[_0x223492][_0x850f5d];if(_0x57f8f3[_0xfa48('0x15')]){_0x57f8f3['type']=_0x57f8f3[_0xfa48('0x15')]['toLowerCase']();}var _0xd1dac=[];var _0x297120=[];delete _0x57f8f3['id'];delete _0x57f8f3['createdAt'];delete _0x57f8f3[_0xfa48('0x2d')];var _0x394a8e=_0x57f8f3[_0xfa48('0x2e')]!==_0xfa48('0x2f')?[_0x57f8f3[_0xfa48('0x2e')]]:_0x57f8f3['IntervalId']?_[_0xfa48('0x9')](_[_0xfa48('0xc')](_0x5361c1[_0xfa48('0x30')],{'IntervalId':_0x57f8f3[_0xfa48('0x7')]}),_0xfa48('0x2e')):[];if(_0x57f8f3[_0xfa48('0x31')]('tag')){if(_0x57f8f3[_0xfa48('0x32')]&&_0x57f8f3[_0xfa48('0x32')]!=='--'){_0xd1dac[_0xfa48('0x14')]({'type':_0x57f8f3[_0xfa48('0x15')],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x33')+_0x57f8f3[_0xfa48('0x32')],'context':_0x57f8f3['context'],'exten':_0x57f8f3['exten'],'priority':_0x394a8e[_0xfa48('0x2c')]+_0x5361c1[_0xfa48('0x10')]+_0x8b07d++,'VoiceExtensionId':_0x57f8f3[_0xfa48('0x19')]});}}if(_0x57f8f3[_0xfa48('0x15')]===_0xfa48('0x34')&&_0x57f8f3[_0xfa48('0x31')](_0xfa48('0x35'))){if(_0x57f8f3[_0xfa48('0x35')]){_0xd1dac[_0xfa48('0x14')]({'type':_0x57f8f3['type'],'app':'ExecIf','appdata':_0xfa48('0x36')+_0x57f8f3[_0xfa48('0x35')]+')','context':_0x57f8f3[_0xfa48('0x18')],'exten':_0x57f8f3[_0xfa48('0xa')],'priority':_0x394a8e[_0xfa48('0x2c')]+_0x5361c1[_0xfa48('0x10')]+_0x8b07d++,'VoiceExtensionId':_0x57f8f3['VoiceExtensionId']});}else{_0xd1dac[_0xfa48('0x14')]({'type':_0x57f8f3[_0xfa48('0x15')],'app':'ExecIf','appdata':_0xfa48('0x37'),'context':_0x57f8f3[_0xfa48('0x18')],'exten':_0x57f8f3['exten'],'priority':_0x394a8e[_0xfa48('0x2c')]+_0x5361c1[_0xfa48('0x10')]+_0x8b07d++,'VoiceExtensionId':_0x57f8f3[_0xfa48('0x19')]});}}if(_0x57f8f3[_0xfa48('0x31')](_0xfa48('0x38'))){if(_0x56180c['indexOf'](_0x57f8f3['app'][_0xfa48('0x39')]())>=0x0&&_0x57f8f3[_0xfa48('0x3a')]!==_0xfa48('0x3b')){if(_0x57f8f3[_0xfa48('0x38')]){_0xd1dac['push']({'type':_0x57f8f3['type'],'app':'ExecIf','appdata':_0xfa48('0x3c'),'context':_0x57f8f3[_0xfa48('0x18')],'exten':_0x57f8f3[_0xfa48('0xa')],'priority':_0x394a8e[_0xfa48('0x2c')]+_0x5361c1[_0xfa48('0x10')]+_0x8b07d++,'VoiceExtensionId':_0x57f8f3['VoiceExtensionId']});_0xd1dac[_0xfa48('0x14')]({'type':_0x57f8f3['type'],'app':_0xfa48('0x16'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x57f8f3[_0xfa48('0x18')],'exten':_0x57f8f3[_0xfa48('0xa')],'priority':_0x394a8e['length']+_0x5361c1[_0xfa48('0x10')]+_0x8b07d++,'VoiceExtensionId':_0x57f8f3['VoiceExtensionId']});}else{_0xd1dac[_0xfa48('0x14')]({'type':_0x57f8f3[_0xfa48('0x15')],'app':_0xfa48('0x1f'),'appdata':_0xfa48('0x3d'),'context':_0x57f8f3[_0xfa48('0x18')],'exten':_0x57f8f3[_0xfa48('0xa')],'priority':_0x394a8e[_0xfa48('0x2c')]+_0x5361c1[_0xfa48('0x10')]+_0x8b07d++,'VoiceExtensionId':_0x57f8f3[_0xfa48('0x19')]});_0xd1dac[_0xfa48('0x14')]({'type':_0x57f8f3['type'],'app':_0xfa48('0x16'),'appdata':_0xfa48('0x3e'),'context':_0x57f8f3[_0xfa48('0x18')],'exten':_0x57f8f3[_0xfa48('0xa')],'priority':_0x394a8e['length']+_0x5361c1[_0xfa48('0x10')]+_0x8b07d++,'VoiceExtensionId':_0x57f8f3[_0xfa48('0x19')]});}}}for(var _0x1ee2fe=0x0;_0x1ee2fe<_0x394a8e[_0xfa48('0x2c')];_0x1ee2fe+=0x1){var _0x2d0d24=_0x5361c1[_0xfa48('0x10')]+_0x394a8e[_0xfa48('0x2c')];var _0xc4d6d4=_0x1ee2fe===_0x394a8e['length']-0x1?_0x5361c1[_0xfa48('0x10')]+_0xd1dac[_0xfa48('0x2c')]+_0x297120[_0xfa48('0x2c')]+0x2:_0x5361c1['priority']+_0x1ee2fe+0x1;_0xd1dac['splice'](_0x1ee2fe,0x0,{'type':_0x57f8f3['type'],'app':_0xfa48('0x3f'),'appdata':_0x394a8e[_0x1ee2fe]+'?'+_0x57f8f3[_0xfa48('0x18')]+_0xfa48('0x40')+_0x2d0d24+':'+_0x57f8f3[_0xfa48('0x18')]+_0xfa48('0x40')+_0xc4d6d4,'exten':_0x57f8f3[_0xfa48('0xa')],'context':_0x57f8f3[_0xfa48('0x18')],'priority':_0x5361c1[_0xfa48('0x10')]+_0x1ee2fe,'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]});}_0x57f8f3['priority']=_0xd1dac['length']?_[_0xfa48('0x41')](_0xd1dac)[_0xfa48('0x10')]+0x1:_0x5361c1[_0xfa48('0x10')];_0x5361c1[_0xfa48('0x10')]=(_0x297120[_0xfa48('0x2c')]?_[_0xfa48('0x41')](_0x297120)[_0xfa48('0x10')]:_0x57f8f3[_0xfa48('0x10')])+0x1;_0x5361c1[_0xfa48('0x13')]=_[_0xfa48('0x42')](_0x5361c1[_0xfa48('0x13')],_0xd1dac,[_0x57f8f3],_0x297120);}_0x5361c1[_0xfa48('0x13')][_0xfa48('0x14')]({'type':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x15')],'app':_0xfa48('0x43'),'exten':_0x4d8ef9[_0x223492][0x0][_0xfa48('0xa')],'context':_0x4d8ef9[_0x223492][0x0][_0xfa48('0x18')],'priority':_0x5361c1[_0xfa48('0x10')],'VoiceExtensionId':_0x4d8ef9[_0x223492][0x0]['VoiceExtensionId']});_0x4c8aed['push'](_0x4d8ef9[_0x223492][0x0][_0xfa48('0x19')]);_0x4083d5=_['concat'](_0x4083d5,_0x5361c1[_0xfa48('0x13')]);}}return _0x3aaf24[_0xfa48('0x44')](function(_0xea4ff4){return _0x3aaf24[_0xfa48('0x5')][_0xfa48('0x6')][_0xfa48('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x4c8aed}},'transaction':_0xea4ff4})[_0xfa48('0x4')](function(_0x112da7){return _0x3aaf24[_0xfa48('0x5')]['VoiceExtension']['bulkCreate'](_[_0xfa48('0x46')](_0x4083d5,_0xfa48('0x10')),{'transaction':_0xea4ff4});});});})[_0xfa48('0x47')](function(_0x211b17){console[_0xfa48('0x48')](_0x211b17);});}exports[_0xfa48('0x49')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 5e32a9b..2b14f35 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 _0x2e1d=['errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','toString','NOW()','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','api','defaults','redis','localhost','argv','undefined','null','Missing\x20filepath\x20parameter!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x2e1d,0xc6));var _0xd2e1=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2e1d[_0x2c7618];return _0x5ce3f0;};'use strict';var BPromise=require(_0xd2e1('0x0'));var util=require(_0xd2e1('0x1'));var _=require(_0xd2e1('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0xd2e1('0x3'));var Redis=require(_0xd2e1('0x4'));var db=require(_0xd2e1('0x5'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xd2e1('0x6'));config['redis']=_[_0xd2e1('0x7')](config[_0xd2e1('0x8')],{'host':_0xd2e1('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')['register'](socket);try{if(!process[_0xd2e1('0xa')][0x2]||process[_0xd2e1('0xa')][0x2]===_0xd2e1('0xb')||process[_0xd2e1('0xa')][0x2]===_0xd2e1('0xc')){throw new Error(_0xd2e1('0xd'));}var FILEPATH=process[_0xd2e1('0xa')][0x2];if(!process[_0xd2e1('0xa')][0x3]||process[_0xd2e1('0xa')][0x3]===_0xd2e1('0xb')||process['argv'][0x3]===_0xd2e1('0xc')||!process[_0xd2e1('0xa')][0x4]||process['argv'][0x4]===_0xd2e1('0xb')||process['argv'][0x4]===_0xd2e1('0xc')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process['argv'][0x3][_0xd2e1('0xe')](','),process[_0xd2e1('0xa')][0x4][_0xd2e1('0xe')](','));if(!process[_0xd2e1('0xa')][0x5]||process[_0xd2e1('0xa')][0x5]==='undefined'||process[_0xd2e1('0xa')][0x5]==='null'){throw new Error(_0xd2e1('0xf'));}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xd2e1('0xa')][0x6]!=='undefined'&&process[_0xd2e1('0xa')][0x6]!==_0xd2e1('0xc')?process[_0xd2e1('0xa')][0x6]:null;var DUPLICATES=process[_0xd2e1('0xa')][0x7]&&process[_0xd2e1('0xa')][0x7]!==_0xd2e1('0xb')&&process[_0xd2e1('0xa')][0x7]!==_0xd2e1('0xc')?process[_0xd2e1('0xa')][0x7]:null;if(!process[_0xd2e1('0xa')][0x8]||process['argv'][0x8]===_0xd2e1('0xb')||process[_0xd2e1('0xa')][0x8]==='null'){throw new Error(_0xd2e1('0x10'));}var SOCKET_TIMESTAMP=process[_0xd2e1('0xa')][0x8];}catch(_0x4f9a89){logger[_0xd2e1('0x11')](_0x4f9a89);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(_0x3c9f39,_0x2da381,_0x429d3b,_0x50eeb1){var _0x53fe0d={'message':_0x2da381};_0x53fe0d[_0x3c9f39]=!![];if(_0x429d3b){_0x53fe0d[_0xd2e1('0x12')]=_0x429d3b;}if(_0x50eeb1){_0x53fe0d['index']=_0x50eeb1;}return _0x53fe0d;}function isEmail(_0x115b39){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))*$/[_0xd2e1('0x13')](_0x115b39);}function checkRow(_0x298305,_0x29f45c,_0x3105c7){return new BPromise(function(_0xdc9e58,_0x1de633){if(_[_0xd2e1('0x14')](_0x298305)){return _0x1de633(handleCheckRowError('error',_0xd2e1('0x15'),null,_0x3105c7));}if(_0x298305[_0xd2e1('0x16')]&&_0x298305['errors'][_0xd2e1('0x17')]){var _0x6ca123=_[_0xd2e1('0x18')](_0x298305[_0xd2e1('0x16')],_0xd2e1('0x19'))[_0xd2e1('0x1a')](';');return _0x1de633(handleCheckRowError(_0xd2e1('0x11'),_0x6ca123,null,_0x3105c7));}var _0x47a0f3={};for(var _0x3da369 in FIELDS){if(FIELDS[_0xd2e1('0x1b')](_0x3da369)&&FIELDS[_0x3da369]){_0x47a0f3[_0x3da369]=_0x298305[_0xd2e1('0x1c')][0x0][FIELDS[_0x3da369]]||_0x298305[_0xd2e1('0x1c')][0x0]['\ufeff'+FIELDS[_0x3da369]];}}if(!_0x47a0f3[_0xd2e1('0x1d')]){return _0x1de633(handleCheckRowError(_0xd2e1('0x11'),_0xd2e1('0x1e'),null,_0x3105c7));}if(!_0x47a0f3[_0xd2e1('0x1f')]){return _0x1de633(handleCheckRowError(_0xd2e1('0x11'),_0xd2e1('0x20'),null,_0x3105c7));}if(_0x47a0f3[_0xd2e1('0x21')]){var _0x1ed822=moment(_0x47a0f3['birthDate'],_0xd2e1('0x22'));if(!_0x1ed822[_0xd2e1('0x23')]()){return _0x1de633(handleCheckRowError(_0xd2e1('0x11'),_0xd2e1('0x24'),null,_0x3105c7));}}if(_0x47a0f3[_0xd2e1('0x25')]){if(!isEmail(_0x47a0f3['email'])){return _0x1de633(handleCheckRowError(_0xd2e1('0x11'),_0xd2e1('0x26'),null,_0x3105c7));}}_0x47a0f3[_0xd2e1('0x27')]=LISTID;_0x47a0f3['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xd2e1('0x17')]&&_0x29f45c){var _0x1f1043={};for(var _0x40477e=0x0,_0x119bc6=DUPLICATES[_0xd2e1('0x17')];_0x40477e<_0x119bc6;_0x40477e+=0x1){_0x1f1043[DUPLICATES[_0x40477e]]=_0x47a0f3[DUPLICATES[_0x40477e]];}var _0x2e474c=_[_0xd2e1('0x28')](_0x29f45c,_0x1f1043);if(_0x2e474c){return _0x1de633(handleCheckRowError(_0xd2e1('0x29'),'Duplicate\x20Contact',_0x2e474c,_0x3105c7));}}return db[_0xd2e1('0x2a')][_0xd2e1('0x2b')](_0x47a0f3,{'raw':!![],'hooks':![],'fields':_[_0xd2e1('0x2c')](_0x47a0f3)})[_0xd2e1('0x2d')](function(_0x4b5f80){if(DUPLICATES&&DUPLICATES['length']&&_0x29f45c){_0x29f45c[_0xd2e1('0x2e')](_[_0xd2e1('0x2f')](_0x47a0f3,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4b5f80['id'];return _0xdc9e58();})[_0xd2e1('0x30')](function(_0x31007a){return _0x1de633(handleCheckRowError(_0xd2e1('0x11'),_0xd2e1('0x31')+(_0x31007a[_0xd2e1('0x19')]||JSON[_0xd2e1('0x32')](_0x31007a)),null,_0x3105c7));});});}function checkHopper(){function _0x4ca9f8(){return function(_0x1b2cd2){logger[_0xd2e1('0x11')]('cmContact','checkHopper',util[_0xd2e1('0x33')](_0x1b2cd2,{'showHidden':![],'depth':null}));};}var _0x35ce87=function(_0x3f88a9,_0xebc264){var _0x451da6=squel[_0xd2e1('0x34')]()[_0xd2e1('0x35')](_0xd2e1('0x36'))[_0xd2e1('0x37')](['phone',_0xd2e1('0x38'),_0xd2e1('0x39'),_0xd2e1('0x27'),_0xebc264,'createdAt',_0xd2e1('0x3a')],squel[_0xd2e1('0x3b')]()['field'](_0xd2e1('0x1f'),_0xd2e1('0x1f'))['field']('NOW()',_0xd2e1('0x38'))[_0xd2e1('0x3c')]('id',_0xd2e1('0x39'))['field'](LISTID[_0xd2e1('0x3d')](),'ListId')['field'](_0x3f88a9['id'][_0xd2e1('0x3d')](),_0xebc264)[_0xd2e1('0x3c')](_0xd2e1('0x3e'),_0xd2e1('0x3f'))[_0xd2e1('0x3c')]('NOW()',_0xd2e1('0x3a'))[_0xd2e1('0x40')](_0xd2e1('0x41'))[_0xd2e1('0x42')](_0xd2e1('0x43'))[_0xd2e1('0x42')](_0xd2e1('0x44'),LISTID[_0xd2e1('0x3d')]())[_0xd2e1('0x42')](_0xd2e1('0x45'))[_0xd2e1('0x42')](_0xd2e1('0x46'),squel['select']()[_0xd2e1('0x3c')](_0xd2e1('0x1f'))[_0xd2e1('0x40')](_0xd2e1('0x36'))[_0xd2e1('0x42')](_0xebc264+_0xd2e1('0x47'),_0x3f88a9['id'][_0xd2e1('0x3d')]())))[_0xd2e1('0x3d')]();return _0x451da6;};var _0x5b3ef0=function(_0x5bbc66,_0x7d9090){var _0x10cf9d=squel[_0xd2e1('0x34')]()[_0xd2e1('0x35')]('cm_hopper')[_0xd2e1('0x37')]([_0xd2e1('0x1f'),'scheduledAt',_0xd2e1('0x39'),_0xd2e1('0x27'),_0x7d9090,_0xd2e1('0x3f'),'updatedAt'],squel['select']()[_0xd2e1('0x3c')](_0xd2e1('0x1f'),_0xd2e1('0x1f'))['field'](_0xd2e1('0x3e'),_0xd2e1('0x38'))[_0xd2e1('0x3c')]('id',_0xd2e1('0x39'))['field'](LISTID['toString'](),_0xd2e1('0x27'))[_0xd2e1('0x3c')](_0x5bbc66['id'][_0xd2e1('0x3d')](),_0x7d9090)[_0xd2e1('0x3c')](_0xd2e1('0x3e'),_0xd2e1('0x3f'))['field'](_0xd2e1('0x3e'),_0xd2e1('0x3a'))[_0xd2e1('0x40')](_0xd2e1('0x41'))['where'](_0xd2e1('0x43'))[_0xd2e1('0x42')](_0xd2e1('0x44'),LISTID[_0xd2e1('0x3d')]())[_0xd2e1('0x42')](_0xd2e1('0x48'),squel[_0xd2e1('0x49')](hopperContacts))[_0xd2e1('0x42')](_0xd2e1('0x45'))[_0xd2e1('0x42')](_0xd2e1('0x46'),squel[_0xd2e1('0x3b')]()[_0xd2e1('0x3c')](_0xd2e1('0x4a'))[_0xd2e1('0x40')](_0xd2e1('0x4b'))[_0xd2e1('0x42')](_0x7d9090+_0xd2e1('0x47'),_0x5bbc66['id'][_0xd2e1('0x3d')]()))['where'](_0xd2e1('0x46'),squel[_0xd2e1('0x3b')]()[_0xd2e1('0x3c')]('phone')[_0xd2e1('0x40')](_0xd2e1('0x36'))[_0xd2e1('0x42')](_0x7d9090+'\x20=\x20?',_0x5bbc66['id'][_0xd2e1('0x3d')]())))[_0xd2e1('0x3d')]();return _0x10cf9d;};function _0x509e8a(_0x142157,_0x989b48){var _0x2f0d14=squel[_0xd2e1('0x34')]()['into'](_0xd2e1('0x36'))[_0xd2e1('0x37')]([_0xd2e1('0x1f'),'scheduledAt',_0xd2e1('0x39'),_0xd2e1('0x27'),_0x989b48,_0xd2e1('0x3f'),'updatedAt'],squel[_0xd2e1('0x3b')]()['field'](_0xd2e1('0x1f'),'phone')[_0xd2e1('0x3c')](_0xd2e1('0x3e'),_0xd2e1('0x38'))[_0xd2e1('0x3c')]('id',_0xd2e1('0x39'))['field'](LISTID['toString'](),_0xd2e1('0x27'))[_0xd2e1('0x3c')](_0x142157['id'][_0xd2e1('0x3d')](),_0x989b48)['field'](_0xd2e1('0x3e'),'createdAt')[_0xd2e1('0x3c')](_0xd2e1('0x3e'),_0xd2e1('0x3a'))[_0xd2e1('0x40')](_0xd2e1('0x41'))[_0xd2e1('0x42')]('deletedAt\x20IS\x20NULL')[_0xd2e1('0x42')](_0xd2e1('0x44'),LISTID[_0xd2e1('0x3d')]())['where']('id\x20IN\x20?',squel[_0xd2e1('0x49')](hopperContacts))[_0xd2e1('0x42')](_0xd2e1('0x45')))[_0xd2e1('0x3d')]();return _0x2f0d14;}function _0x137520(_0x5552a0,_0x164b33){var _0x646482=squel['insert']()[_0xd2e1('0x35')](_0xd2e1('0x4c'))[_0xd2e1('0x37')](['phone',_0xd2e1('0x39'),_0xd2e1('0x27'),_0x164b33,_0xd2e1('0x3f'),_0xd2e1('0x3a')],squel[_0xd2e1('0x3b')]()[_0xd2e1('0x3c')]('phone','phone')['field']('id',_0xd2e1('0x39'))[_0xd2e1('0x3c')](LISTID['toString'](),'ListId')[_0xd2e1('0x3c')](_0x5552a0['id']['toString'](),_0x164b33)['field']('NOW()',_0xd2e1('0x3f'))[_0xd2e1('0x3c')](_0xd2e1('0x3e'),_0xd2e1('0x3a'))[_0xd2e1('0x40')](_0xd2e1('0x41'))[_0xd2e1('0x42')](_0xd2e1('0x43'))[_0xd2e1('0x42')](_0xd2e1('0x44'),LISTID[_0xd2e1('0x3d')]())['where'](_0xd2e1('0x48'),squel[_0xd2e1('0x49')](hopperContacts))[_0xd2e1('0x42')](_0xd2e1('0x45')))[_0xd2e1('0x3d')]();return _0x646482;}return db[_0xd2e1('0x4d')][_0xd2e1('0x4e')]({'where':{'type':_0xd2e1('0x4f')},'attributes':['id',_0xd2e1('0x50')],'include':[{'model':db[_0xd2e1('0x51')],'as':_0xd2e1('0x52'),'where':{'id':LISTID}}]})[_0xd2e1('0x2d')](function(_0x247494){var _0x5806c9=[];if(_0x247494){var _0x5091bc;for(var _0x2f5143=0x0,_0x4c8b98;_0x2f5143<_0x247494['length'];_0x2f5143+=0x1){_0x4c8b98=_0x247494[_0x2f5143][_0xd2e1('0x53')]({'plain':!![]});switch(_0x4c8b98['dialCheckDuplicateType']){case _0xd2e1('0x54'):_0x5806c9['push'](db[_0xd2e1('0x55')][_0xd2e1('0x56')](_0x5b3ef0(_0x4c8b98,_0xd2e1('0x57')))[_0xd2e1('0x2d')](function(){})[_0xd2e1('0x30')](_0x4ca9f8()));break;case _0xd2e1('0x58'):_0x5806c9[_0xd2e1('0x2e')](db[_0xd2e1('0x55')]['query'](_0x35ce87(_0x4c8b98,_0xd2e1('0x57')))[_0xd2e1('0x2d')](function(){})[_0xd2e1('0x30')](_0x4ca9f8()));break;default:_0x5806c9['push'](db[_0xd2e1('0x55')][_0xd2e1('0x56')](_0x509e8a(_0x4c8b98,_0xd2e1('0x57')))[_0xd2e1('0x2d')](function(){})[_0xd2e1('0x30')](_0x4ca9f8()));}}}return _0x5806c9;})['all']()[_0xd2e1('0x2d')](function(){return db['VoiceQueue'][_0xd2e1('0x4e')]({'where':{'type':_0xd2e1('0x4f')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xd2e1('0x59'),'where':{'id':LISTID}}]})[_0xd2e1('0x2d')](function(_0x18c2e8){var _0x26ae18=[];if(_0x18c2e8){var _0x1179a2;for(var _0x2946f3=0x0,_0x40f91a;_0x2946f3<_0x18c2e8[_0xd2e1('0x17')];_0x2946f3+=0x1){_0x40f91a=_0x18c2e8[_0x2946f3][_0xd2e1('0x53')]({'plain':!![]});_0x26ae18[_0xd2e1('0x2e')](db['sequelize'][_0xd2e1('0x56')](_0x137520(_0x40f91a,_0xd2e1('0x57')))[_0xd2e1('0x2d')](function(){})[_0xd2e1('0x30')](_0x4ca9f8()));}}return _0x26ae18;})[_0xd2e1('0x5a')]();})['then'](function(){return db[_0xd2e1('0x5b')][_0xd2e1('0x4e')]({'attributes':['id',_0xd2e1('0x50')],'include':[{'model':db[_0xd2e1('0x51')],'as':_0xd2e1('0x52'),'where':{'id':LISTID}}]})[_0xd2e1('0x2d')](function(_0x23bf63){var _0x3f7d6d=[];if(_0x23bf63){for(var _0x1d6145=0x0,_0x1a7811;_0x1d6145<_0x23bf63[_0xd2e1('0x17')];_0x1d6145+=0x1){_0x1a7811=_0x23bf63[_0x1d6145][_0xd2e1('0x53')]({'plain':!![]});switch(_0x1a7811[_0xd2e1('0x50')]){case _0xd2e1('0x54'):_0x3f7d6d[_0xd2e1('0x2e')](db[_0xd2e1('0x55')][_0xd2e1('0x56')](_0x5b3ef0(_0x1a7811,_0xd2e1('0x5c')))['then'](function(){})[_0xd2e1('0x30')](_0x4ca9f8()));break;case'onlyIfOpen':_0x3f7d6d[_0xd2e1('0x2e')](db[_0xd2e1('0x55')][_0xd2e1('0x56')](_0x35ce87(_0x1a7811,_0xd2e1('0x5c')))['then'](function(){})[_0xd2e1('0x30')](_0x4ca9f8()));break;default:_0x3f7d6d[_0xd2e1('0x2e')](db[_0xd2e1('0x55')]['query'](_0x509e8a(_0x1a7811,_0xd2e1('0x5c')))['then'](function(){})['catch'](_0x4ca9f8()));}}}return _0x3f7d6d;})[_0xd2e1('0x5a')]();})[_0xd2e1('0x2d')](function(){return db[_0xd2e1('0x5b')][_0xd2e1('0x4e')]({'attributes':['id'],'include':[{'model':db[_0xd2e1('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xd2e1('0x2d')](function(_0x23bc7f){var _0x14fb24=[];if(_0x23bc7f){for(var _0x21ff51=0x0,_0x13bd40;_0x21ff51<_0x23bc7f[_0xd2e1('0x17')];_0x21ff51+=0x1){_0x13bd40=_0x23bc7f[_0x21ff51][_0xd2e1('0x53')]({'plain':!![]});_0x14fb24[_0xd2e1('0x2e')](db[_0xd2e1('0x55')][_0xd2e1('0x56')](_0x137520(_0x13bd40,_0xd2e1('0x5c')))['then'](function(){})[_0xd2e1('0x30')](_0x4ca9f8()));}}return _0x14fb24;})[_0xd2e1('0x5a')]();})['catch'](function(_0x44512c){logger[_0xd2e1('0x11')](_0xd2e1('0x5d'),_0xd2e1('0x5e'),_0x44512c[_0xd2e1('0x19')]);});}var processPromises=function(_0x35ad73){return BPromise[_0xd2e1('0x5a')](promises)['then'](function(_0x554dcc){})[_0xd2e1('0x30')](function(_0x44f0c2){logger[_0xd2e1('0x11')](_0xd2e1('0x5f'),JSON[_0xd2e1('0x32')](_0x44f0c2));})[_0xd2e1('0x60')](function(){socket[_0xd2e1('0x61')](_0xd2e1('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x35ad73){return _0x35ad73[_0xd2e1('0x63')]();}});};var endCsv=function(){return BPromise[_0xd2e1('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xd2e1('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x2125df){logger[_0xd2e1('0x11')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0xd2e1('0x32')](_0x2125df));}finally{process[_0xd2e1('0x65')](0x0);}});};process['on'](_0xd2e1('0x66'),function(){logger['info'](_0xd2e1('0x67'));endCsv();});function main(){return BPromise[_0xd2e1('0x64')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xd2e1('0x2a')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x9e1874){var _0x8a1533=fs[_0xd2e1('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xd2e1('0x69')](_0x8a1533,{'header':!![],'skipEmptyLines':!![],'step':function(_0x46792f,_0x18942b){total+=0x1;var _0x4be2b3=total;promises['push'](checkRow(_0x46792f,_0x9e1874,_0x4be2b3)['then'](function(){success+=0x1;})['catch'](function(_0x519ebb){if(_0x519ebb['error']){errors+=0x1;delete _0x519ebb[_0xd2e1('0x11')];}else if(_0x519ebb['duplicate']){duplicates+=0x1;delete _0x519ebb['duplicate'];}rows['push'](_0x519ebb);}));if(total%0xc8===0x0){_0x18942b[_0xd2e1('0x6a')]();return processPromises(_0x18942b);}},'complete':function(){return processPromises()[_0xd2e1('0x2d')](function(){logger[_0xd2e1('0x6b')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x1cbedf,_0x24cfdf){logger[_0xd2e1('0x6b')](_0xd2e1('0x6c'),JSON[_0xd2e1('0x32')](_0x1cbedf));endCsv();}});})['catch'](function(_0x54f38d){logger[_0xd2e1('0x11')](_0xd2e1('0x6d'),JSON[_0xd2e1('0x32')](_0x54f38d));});}main(); \ No newline at end of file +var _0xc8c9=['exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','CmContact','create','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','fromQuery','scheduledAt','ContactId','field','NOW()','toString','createdAt','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','select','cm_hopper','\x20=\x20?','into','ListId\x20=\x20?','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:'];(function(_0xff1dd3,_0x40abd2){var _0x57e542=function(_0x302c6b){while(--_0x302c6b){_0xff1dd3['push'](_0xff1dd3['shift']());}};_0x57e542(++_0x40abd2);}(_0xc8c9,0x7a));var _0x9c8c=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0xc8c9[_0x195c21];return _0x3576a8;};'use strict';var BPromise=require(_0x9c8c('0x0'));var util=require(_0x9c8c('0x1'));var _=require(_0x9c8c('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x9c8c('0x3'));var Redis=require(_0x9c8c('0x4'));var db=require(_0x9c8c('0x5'))['db'];var config=require(_0x9c8c('0x6'));var logger=require(_0x9c8c('0x7'))('api');config[_0x9c8c('0x8')]=_[_0x9c8c('0x9')](config[_0x9c8c('0x8')],{'host':_0x9c8c('0xa'),'port':0x18eb});var socket=require(_0x9c8c('0xb'))(new Redis(config[_0x9c8c('0x8')]));require(_0x9c8c('0xc'))[_0x9c8c('0xd')](socket);try{if(!process[_0x9c8c('0xe')][0x2]||process['argv'][0x2]===_0x9c8c('0xf')||process[_0x9c8c('0xe')][0x2]===_0x9c8c('0x10')){throw new Error(_0x9c8c('0x11'));}var FILEPATH=process['argv'][0x2];if(!process[_0x9c8c('0xe')][0x3]||process[_0x9c8c('0xe')][0x3]===_0x9c8c('0xf')||process[_0x9c8c('0xe')][0x3]===_0x9c8c('0x10')||!process[_0x9c8c('0xe')][0x4]||process['argv'][0x4]===_0x9c8c('0xf')||process[_0x9c8c('0xe')][0x4]===_0x9c8c('0x10')){throw new Error(_0x9c8c('0x12'));}var FIELDS=_[_0x9c8c('0x13')](process[_0x9c8c('0xe')][0x3][_0x9c8c('0x14')](','),process[_0x9c8c('0xe')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x9c8c('0xe')][0x5]===_0x9c8c('0xf')||process['argv'][0x5]===_0x9c8c('0x10')){throw new Error(_0x9c8c('0x15'));}var LISTID=process[_0x9c8c('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0x9c8c('0xf')&&process[_0x9c8c('0xe')][0x6]!==_0x9c8c('0x10')?process[_0x9c8c('0xe')][0x6]:null;var DUPLICATES=process[_0x9c8c('0xe')][0x7]&&process[_0x9c8c('0xe')][0x7]!==_0x9c8c('0xf')&&process[_0x9c8c('0xe')][0x7]!==_0x9c8c('0x10')?process[_0x9c8c('0xe')][0x7]:null;if(!process[_0x9c8c('0xe')][0x8]||process[_0x9c8c('0xe')][0x8]===_0x9c8c('0xf')||process['argv'][0x8]===_0x9c8c('0x10')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x9c8c('0xe')][0x8];}catch(_0x56ec6d){logger['error'](_0x56ec6d);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(_0x510a50,_0x458248,_0x27f949,_0x43e01d){var _0x2dabf3={'message':_0x458248};_0x2dabf3[_0x510a50]=!![];if(_0x27f949){_0x2dabf3[_0x9c8c('0x16')]=_0x27f949;}if(_0x43e01d){_0x2dabf3[_0x9c8c('0x17')]=_0x43e01d;}return _0x2dabf3;}function isEmail(_0x5417c6){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))*$/[_0x9c8c('0x18')](_0x5417c6);}function checkRow(_0x101668,_0x308055,_0x55d9ba){return new BPromise(function(_0x16cd7a,_0x34f1ca){if(_['isNil'](_0x101668)){return _0x34f1ca(handleCheckRowError(_0x9c8c('0x19'),_0x9c8c('0x1a'),null,_0x55d9ba));}if(_0x101668['errors']&&_0x101668['errors'][_0x9c8c('0x1b')]){var _0x46ebc6=_[_0x9c8c('0x1c')](_0x101668['errors'],_0x9c8c('0x1d'))[_0x9c8c('0x1e')](';');return _0x34f1ca(handleCheckRowError('error',_0x46ebc6,null,_0x55d9ba));}var _0x2be480={};for(var _0x512590 in FIELDS){if(FIELDS[_0x9c8c('0x1f')](_0x512590)&&FIELDS[_0x512590]){_0x2be480[_0x512590]=_0x101668[_0x9c8c('0x20')][0x0][FIELDS[_0x512590]]||_0x101668[_0x9c8c('0x20')][0x0]['\ufeff'+FIELDS[_0x512590]];}}if(!_0x2be480['firstName']){return _0x34f1ca(handleCheckRowError(_0x9c8c('0x19'),_0x9c8c('0x21'),null,_0x55d9ba));}if(!_0x2be480[_0x9c8c('0x22')]){return _0x34f1ca(handleCheckRowError(_0x9c8c('0x19'),'phone\x20not\x20specified!',null,_0x55d9ba));}if(_0x2be480[_0x9c8c('0x23')]){var _0x297b8d=moment(_0x2be480[_0x9c8c('0x23')],_0x9c8c('0x24'));if(!_0x297b8d['isValid']()){return _0x34f1ca(handleCheckRowError(_0x9c8c('0x19'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x55d9ba));}}if(_0x2be480[_0x9c8c('0x25')]){if(!isEmail(_0x2be480[_0x9c8c('0x25')])){return _0x34f1ca(handleCheckRowError(_0x9c8c('0x19'),_0x9c8c('0x26'),null,_0x55d9ba));}}_0x2be480[_0x9c8c('0x27')]=LISTID;_0x2be480[_0x9c8c('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9c8c('0x1b')]&&_0x308055){var _0x3f3b34={};for(var _0x24267d=0x0,_0x2232fa=DUPLICATES[_0x9c8c('0x1b')];_0x24267d<_0x2232fa;_0x24267d+=0x1){_0x3f3b34[DUPLICATES[_0x24267d]]=_0x2be480[DUPLICATES[_0x24267d]];}var _0x290303=_[_0x9c8c('0x29')](_0x308055,_0x3f3b34);if(_0x290303){return _0x34f1ca(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x290303,_0x55d9ba));}}return db[_0x9c8c('0x2a')][_0x9c8c('0x2b')](_0x2be480,{'raw':!![],'hooks':![],'fields':_['keys'](_0x2be480)})[_0x9c8c('0x2c')](function(_0x12f108){if(DUPLICATES&&DUPLICATES[_0x9c8c('0x1b')]&&_0x308055){_0x308055['push'](_[_0x9c8c('0x2d')](_0x2be480,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x12f108['id'];return _0x16cd7a();})[_0x9c8c('0x2e')](function(_0x5b710e){return _0x34f1ca(handleCheckRowError(_0x9c8c('0x19'),_0x9c8c('0x2f')+(_0x5b710e['message']||JSON['stringify'](_0x5b710e)),null,_0x55d9ba));});});}function checkHopper(){function _0x52dcc8(){return function(_0x2f5cf7){logger[_0x9c8c('0x19')](_0x9c8c('0x30'),_0x9c8c('0x31'),util[_0x9c8c('0x32')](_0x2f5cf7,{'showHidden':![],'depth':null}));};}var _0x1d379c=function(_0x2d04bf,_0x1b93cb){var _0x4ad6c3=squel[_0x9c8c('0x33')]()['into']('cm_hopper')[_0x9c8c('0x34')]([_0x9c8c('0x22'),_0x9c8c('0x35'),_0x9c8c('0x36'),'ListId',_0x1b93cb,'createdAt','updatedAt'],squel['select']()[_0x9c8c('0x37')](_0x9c8c('0x22'),_0x9c8c('0x22'))[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x35'))[_0x9c8c('0x37')]('id','ContactId')[_0x9c8c('0x37')](LISTID[_0x9c8c('0x39')](),_0x9c8c('0x27'))['field'](_0x2d04bf['id'][_0x9c8c('0x39')](),_0x1b93cb)[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x3a'))[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x3b'))[_0x9c8c('0x3c')](_0x9c8c('0x3d'))[_0x9c8c('0x3e')](_0x9c8c('0x3f'))[_0x9c8c('0x3e')]('ListId\x20=\x20?',LISTID[_0x9c8c('0x39')]())[_0x9c8c('0x3e')](_0x9c8c('0x40'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x9c8c('0x41')]()[_0x9c8c('0x37')](_0x9c8c('0x22'))[_0x9c8c('0x3c')](_0x9c8c('0x42'))[_0x9c8c('0x3e')](_0x1b93cb+_0x9c8c('0x43'),_0x2d04bf['id']['toString']())))[_0x9c8c('0x39')]();return _0x4ad6c3;};var _0x41ccea=function(_0x37d4e7,_0x1302f3){var _0x37c9b6=squel['insert']()[_0x9c8c('0x44')](_0x9c8c('0x42'))[_0x9c8c('0x34')]([_0x9c8c('0x22'),'scheduledAt',_0x9c8c('0x36'),_0x9c8c('0x27'),_0x1302f3,_0x9c8c('0x3a'),'updatedAt'],squel['select']()['field'](_0x9c8c('0x22'),'phone')[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x35'))[_0x9c8c('0x37')]('id',_0x9c8c('0x36'))[_0x9c8c('0x37')](LISTID[_0x9c8c('0x39')](),_0x9c8c('0x27'))[_0x9c8c('0x37')](_0x37d4e7['id'][_0x9c8c('0x39')](),_0x1302f3)[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x3a'))[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x3b'))['from']('cm_contacts')[_0x9c8c('0x3e')](_0x9c8c('0x3f'))['where'](_0x9c8c('0x45'),LISTID[_0x9c8c('0x39')]())[_0x9c8c('0x3e')](_0x9c8c('0x46'),squel[_0x9c8c('0x47')](hopperContacts))[_0x9c8c('0x3e')](_0x9c8c('0x40'))[_0x9c8c('0x3e')](_0x9c8c('0x48'),squel[_0x9c8c('0x41')]()['field'](_0x9c8c('0x49'))['from']('cm_hopper_final')[_0x9c8c('0x3e')](_0x1302f3+_0x9c8c('0x43'),_0x37d4e7['id'][_0x9c8c('0x39')]()))['where'](_0x9c8c('0x48'),squel['select']()['field'](_0x9c8c('0x22'))['from'](_0x9c8c('0x42'))['where'](_0x1302f3+_0x9c8c('0x43'),_0x37d4e7['id'][_0x9c8c('0x39')]())))[_0x9c8c('0x39')]();return _0x37c9b6;};function _0x3ab1f7(_0x242f7e,_0x5b7cd4){var _0xa6cf42=squel['insert']()['into'](_0x9c8c('0x42'))[_0x9c8c('0x34')]([_0x9c8c('0x22'),'scheduledAt','ContactId',_0x9c8c('0x27'),_0x5b7cd4,_0x9c8c('0x3a'),_0x9c8c('0x3b')],squel[_0x9c8c('0x41')]()[_0x9c8c('0x37')](_0x9c8c('0x22'),_0x9c8c('0x22'))[_0x9c8c('0x37')](_0x9c8c('0x38'),'scheduledAt')[_0x9c8c('0x37')]('id','ContactId')['field'](LISTID[_0x9c8c('0x39')](),'ListId')[_0x9c8c('0x37')](_0x242f7e['id'][_0x9c8c('0x39')](),_0x5b7cd4)[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x3a'))['field'](_0x9c8c('0x38'),_0x9c8c('0x3b'))['from'](_0x9c8c('0x3d'))[_0x9c8c('0x3e')](_0x9c8c('0x3f'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x9c8c('0x3e')](_0x9c8c('0x46'),squel[_0x9c8c('0x47')](hopperContacts))[_0x9c8c('0x3e')](_0x9c8c('0x40')))[_0x9c8c('0x39')]();return _0xa6cf42;}function _0x465ea3(_0x2b7d33,_0x4eb0be){var _0xd46301=squel[_0x9c8c('0x33')]()[_0x9c8c('0x44')](_0x9c8c('0x4a'))[_0x9c8c('0x34')](['phone',_0x9c8c('0x36'),_0x9c8c('0x27'),_0x4eb0be,_0x9c8c('0x3a'),_0x9c8c('0x3b')],squel[_0x9c8c('0x41')]()[_0x9c8c('0x37')](_0x9c8c('0x22'),_0x9c8c('0x22'))['field']('id',_0x9c8c('0x36'))[_0x9c8c('0x37')](LISTID['toString'](),_0x9c8c('0x27'))[_0x9c8c('0x37')](_0x2b7d33['id']['toString'](),_0x4eb0be)[_0x9c8c('0x37')](_0x9c8c('0x38'),_0x9c8c('0x3a'))['field']('NOW()','updatedAt')[_0x9c8c('0x3c')]('cm_contacts')[_0x9c8c('0x3e')](_0x9c8c('0x3f'))[_0x9c8c('0x3e')](_0x9c8c('0x45'),LISTID[_0x9c8c('0x39')]())[_0x9c8c('0x3e')](_0x9c8c('0x46'),squel[_0x9c8c('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x9c8c('0x39')]();return _0xd46301;}return db[_0x9c8c('0x4b')][_0x9c8c('0x4c')]({'where':{'type':_0x9c8c('0x4d')},'attributes':['id',_0x9c8c('0x4e')],'include':[{'model':db[_0x9c8c('0x4f')],'as':_0x9c8c('0x50'),'where':{'id':LISTID}}]})[_0x9c8c('0x2c')](function(_0x34f37a){var _0x3e162b=[];if(_0x34f37a){var _0x25df72;for(var _0x33474c=0x0,_0x5166a9;_0x33474c<_0x34f37a[_0x9c8c('0x1b')];_0x33474c+=0x1){_0x5166a9=_0x34f37a[_0x33474c][_0x9c8c('0x51')]({'plain':!![]});switch(_0x5166a9['dialCheckDuplicateType']){case _0x9c8c('0x52'):_0x3e162b[_0x9c8c('0x53')](db[_0x9c8c('0x54')][_0x9c8c('0x55')](_0x41ccea(_0x5166a9,_0x9c8c('0x56')))[_0x9c8c('0x2c')](function(){})[_0x9c8c('0x2e')](_0x52dcc8()));break;case _0x9c8c('0x57'):_0x3e162b[_0x9c8c('0x53')](db[_0x9c8c('0x54')][_0x9c8c('0x55')](_0x1d379c(_0x5166a9,_0x9c8c('0x56')))[_0x9c8c('0x2c')](function(){})[_0x9c8c('0x2e')](_0x52dcc8()));break;default:_0x3e162b[_0x9c8c('0x53')](db[_0x9c8c('0x54')][_0x9c8c('0x55')](_0x3ab1f7(_0x5166a9,_0x9c8c('0x56')))['then'](function(){})[_0x9c8c('0x2e')](_0x52dcc8()));}}}return _0x3e162b;})[_0x9c8c('0x58')]()['then'](function(){return db[_0x9c8c('0x4b')]['findAll']({'where':{'type':_0x9c8c('0x4d')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x9c8c('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x2fa972){var _0x203109=[];if(_0x2fa972){var _0x53fe64;for(var _0x5b878a=0x0,_0x29e3e1;_0x5b878a<_0x2fa972['length'];_0x5b878a+=0x1){_0x29e3e1=_0x2fa972[_0x5b878a]['get']({'plain':!![]});_0x203109['push'](db[_0x9c8c('0x54')][_0x9c8c('0x55')](_0x465ea3(_0x29e3e1,'VoiceQueueId'))[_0x9c8c('0x2c')](function(){})['catch'](_0x52dcc8()));}}return _0x203109;})[_0x9c8c('0x58')]();})[_0x9c8c('0x2c')](function(){return db[_0x9c8c('0x5a')][_0x9c8c('0x4c')]({'attributes':['id',_0x9c8c('0x4e')],'include':[{'model':db[_0x9c8c('0x4f')],'as':_0x9c8c('0x50'),'where':{'id':LISTID}}]})[_0x9c8c('0x2c')](function(_0x305ce0){var _0x4b3cd4=[];if(_0x305ce0){for(var _0x42ec5a=0x0,_0x13c691;_0x42ec5a<_0x305ce0['length'];_0x42ec5a+=0x1){_0x13c691=_0x305ce0[_0x42ec5a][_0x9c8c('0x51')]({'plain':!![]});switch(_0x13c691[_0x9c8c('0x4e')]){case'always':_0x4b3cd4[_0x9c8c('0x53')](db['sequelize'][_0x9c8c('0x55')](_0x41ccea(_0x13c691,'CampaignId'))['then'](function(){})[_0x9c8c('0x2e')](_0x52dcc8()));break;case _0x9c8c('0x57'):_0x4b3cd4[_0x9c8c('0x53')](db[_0x9c8c('0x54')][_0x9c8c('0x55')](_0x1d379c(_0x13c691,_0x9c8c('0x5b')))['then'](function(){})['catch'](_0x52dcc8()));break;default:_0x4b3cd4[_0x9c8c('0x53')](db[_0x9c8c('0x54')][_0x9c8c('0x55')](_0x3ab1f7(_0x13c691,_0x9c8c('0x5b')))[_0x9c8c('0x2c')](function(){})[_0x9c8c('0x2e')](_0x52dcc8()));}}}return _0x4b3cd4;})[_0x9c8c('0x58')]();})['then'](function(){return db[_0x9c8c('0x5a')][_0x9c8c('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x9c8c('0x4f')],'as':_0x9c8c('0x59'),'where':{'id':LISTID}}]})[_0x9c8c('0x2c')](function(_0x1b6da4){var _0x536582=[];if(_0x1b6da4){for(var _0x3dd0c1=0x0,_0x392d47;_0x3dd0c1<_0x1b6da4[_0x9c8c('0x1b')];_0x3dd0c1+=0x1){_0x392d47=_0x1b6da4[_0x3dd0c1][_0x9c8c('0x51')]({'plain':!![]});_0x536582[_0x9c8c('0x53')](db[_0x9c8c('0x54')][_0x9c8c('0x55')](_0x465ea3(_0x392d47,_0x9c8c('0x5b')))[_0x9c8c('0x2c')](function(){})[_0x9c8c('0x2e')](_0x52dcc8()));}}return _0x536582;})['all']();})[_0x9c8c('0x2e')](function(_0x180635){logger[_0x9c8c('0x19')](_0x9c8c('0x5c'),_0x9c8c('0x5d'),_0x180635[_0x9c8c('0x1d')]);});}var processPromises=function(_0xd0ba07){return BPromise['all'](promises)['then'](function(_0x77ad4d){})[_0x9c8c('0x2e')](function(_0x559370){logger[_0x9c8c('0x19')]('Error\x20processing\x20rows\x20block:',JSON[_0x9c8c('0x5e')](_0x559370));})[_0x9c8c('0x5f')](function(){socket[_0x9c8c('0x60')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xd0ba07){return _0xd0ba07[_0x9c8c('0x61')]();}});};var endCsv=function(){return BPromise[_0x9c8c('0x62')]()[_0x9c8c('0x2c')](function(){if(hopperContacts){return checkHopper();}})[_0x9c8c('0x2c')](function(){socket['emit'](_0x9c8c('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9c8c('0x64')](FILEPATH);}catch(_0x2fec6a){logger['error'](_0x9c8c('0x65'),JSON[_0x9c8c('0x5e')](_0x2fec6a));}finally{process[_0x9c8c('0x66')](0x0);}});};process['on'](_0x9c8c('0x67'),function(){logger['info'](_0x9c8c('0x68'));endCsv();});function main(){return BPromise[_0x9c8c('0x62')]()[_0x9c8c('0x2c')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9c8c('0x14')](',');return db[_0x9c8c('0x2a')][_0x9c8c('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0xaef64e){var _0x239dfb=fs[_0x9c8c('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9c8c('0x6a')](_0x239dfb,{'header':!![],'skipEmptyLines':!![],'step':function(_0x138dd4,_0x56f5c4){total+=0x1;var _0x26a940=total;promises[_0x9c8c('0x53')](checkRow(_0x138dd4,_0xaef64e,_0x26a940)['then'](function(){success+=0x1;})[_0x9c8c('0x2e')](function(_0x4bb05b){if(_0x4bb05b['error']){errors+=0x1;delete _0x4bb05b[_0x9c8c('0x19')];}else if(_0x4bb05b[_0x9c8c('0x6b')]){duplicates+=0x1;delete _0x4bb05b['duplicate'];}rows['push'](_0x4bb05b);}));if(total%0xc8===0x0){_0x56f5c4[_0x9c8c('0x6c')]();return processPromises(_0x56f5c4);}},'complete':function(){return processPromises()[_0x9c8c('0x2c')](function(){logger[_0x9c8c('0x6d')](_0x9c8c('0x6e'));endCsv();});},'error':function(_0x35e171,_0x58626e){logger['info']('CSV\x20parse\x20error',JSON[_0x9c8c('0x5e')](_0x35e171));endCsv();}});})['catch'](function(_0x43d2ab){logger[_0x9c8c('0x19')](_0x9c8c('0x6f'),JSON[_0x9c8c('0x5e')](_0x43d2ab));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 1e1f19a..54ace2f 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 _0x48e7=['ListId','createdAt','updatedAt','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','cm_contacts.createdAt\x20=\x20?','field','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','UserId','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','push','sequelize','query','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','then','error','message','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','spread','length','all','catch','timezones','utcOffset','set','offset','dialTimezone','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','createReadStream','rows','data','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','YYYY-MM-DD','isNil','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','argv','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','defaults','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','join','.id\x20=\x20','\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId'];(function(_0x242501,_0x51a24a){var _0x21314c=function(_0x1aca0a){while(--_0x1aca0a){_0x242501['push'](_0x242501['shift']());}};_0x21314c(++_0x51a24a);}(_0x48e7,0x198));var _0x748e=function(_0x4b965f,_0x3568df){_0x4b965f=_0x4b965f-0x0;var _0xce5b40=_0x48e7[_0x4b965f];return _0xce5b40;};'use strict';var fs=require('fs');var path=require(_0x748e('0x0'));var _=require('lodash');var Papa=require(_0x748e('0x1'));var util=require(_0x748e('0x2'));var BPromise=require(_0x748e('0x3'));var moment=require(_0x748e('0x4'));var squel=require(_0x748e('0x5'));var Redis=require(_0x748e('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x748e('0x7'));var shared=require(_0x748e('0x8'));var logger=require('../../../config/logger')('import');config['redis']=_[_0x748e('0x9')](config[_0x748e('0xa')],{'host':_0x748e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x748e('0xc')](_0x748e('0xd'));function isEmail(_0x45e162){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))*$/[_0x748e('0xe')](_0x45e162);}function selectNotIn(_0x432937,_0x23df39,_0x2001ff,_0x27a39f,_0x2576c0){return squel[_0x748e('0xf')]()['field'](_0x748e('0x10'))[_0x748e('0x11')](_0x27a39f)[_0x748e('0x12')](_0x23df39,null,_0x23df39+_0x748e('0x13')+_0x27a39f+'.'+_0x2001ff)['where'](_0x27a39f+'.'+_0x2001ff+_0x748e('0x14')+_0x432937+'.'+_0x2001ff)[_0x748e('0x15')](_0x23df39+'.dialCheckDuplicateType\x20IN\x20('+_0x2576c0['join']()+')');}function insertCmHopper(_0x1c2efb,_0x48a97e,_0x2bf397,_0x9a01ba,_0x4318c7){var _0x1bae3a=[_0x748e('0x16'),_0x748e('0x17'),'cm_contacts.id',_0x748e('0x18'),_0x48a97e+'.'+_0x9a01ba,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x748e('0x19'),_0x748e('0x1a'),'\x22'+_0x4318c7+'\x22'];return squel[_0x748e('0x1b')]()[_0x748e('0x1c')](_0x748e('0x1d'))[_0x748e('0x1e')](['phone',_0x748e('0x1f'),_0x748e('0x20'),_0x748e('0x21'),_0x9a01ba,_0x748e('0x22'),_0x748e('0x23'),'priority','UserId','recallme'],squel[_0x748e('0xf')]()[_0x748e('0x24')](_0x1bae3a)[_0x748e('0x11')](_0x48a97e)['join'](_0x748e('0x25'),null,_0x748e('0x26')+_0x48a97e+_0x748e('0x27'))[_0x748e('0x12')](_0x2bf397,null,_0x2bf397+'.id\x20=\x20'+_0x48a97e+'.'+_0x9a01ba)['where'](_0x48a97e+_0x748e('0x28'),_0x1c2efb)[_0x748e('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x748e('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x48a97e,_0x2bf397,_0x9a01ba,_0x748e('0x1d'),['\x22always\x22',_0x748e('0x29')]))[_0x748e('0x15')](_0x748e('0x2a'),selectNotIn(_0x48a97e,_0x2bf397,_0x9a01ba,_0x748e('0x1d'),[_0x748e('0x2b')])))[_0x748e('0x2c')]();}function insertCmHopperBlack(_0x285e63,_0x50a3a3,_0x4c5f8a,_0x7ae86d){var _0x170d56=[_0x748e('0x16'),_0x748e('0x2d'),'cm_contacts.ListId',_0x50a3a3+'.'+_0x7ae86d,_0x748e('0x2e'),_0x748e('0x2f')];return squel['insert']()['into'](_0x748e('0x30'))[_0x748e('0x1e')]([_0x748e('0x10'),_0x748e('0x20'),'ListId',_0x7ae86d,_0x748e('0x22'),'updatedAt'],squel[_0x748e('0xf')]()['fields'](_0x170d56)[_0x748e('0x11')](_0x50a3a3)[_0x748e('0x12')](_0x748e('0x25'),null,'cm_contacts.ListId\x20=\x20'+_0x50a3a3+_0x748e('0x27'))[_0x748e('0x12')](_0x4c5f8a,null,_0x4c5f8a+_0x748e('0x13')+_0x50a3a3+'.'+_0x7ae86d)['where'](_0x50a3a3+_0x748e('0x28'),_0x285e63)[_0x748e('0x15')](_0x748e('0x31'),NOW)['where'](_0x748e('0x2a'),squel[_0x748e('0xf')]()[_0x748e('0x32')](_0x748e('0x10'))[_0x748e('0x11')](_0x748e('0x30'))['where'](_0x748e('0x33'),_0x285e63)[_0x748e('0x15')](_0x7ae86d+_0x748e('0x34'),_0x50a3a3+'.'+_0x7ae86d)))['toString']();}function insertTzCmHopper(_0x2803d4,_0xade705,_0x3f0755,_0x2b46fa,_0x18a669,_0x1ae5a5){var _0x436c31=[_0x748e('0x16'),_0x748e('0x35')+_0x1ae5a5+'.offset-cm_contacts.utcOffset\x20minute)',_0x748e('0x2d'),_0x748e('0x18'),_0xade705+'.'+_0x2b46fa,_0x748e('0x2e'),_0x748e('0x2f'),_0x748e('0x19'),'cm_contacts.UserId','\x22'+_0x18a669+'\x22'];var _0x512969=squel[_0x748e('0x1b')]()[_0x748e('0x1c')](_0x748e('0x1d'))[_0x748e('0x1e')]([_0x748e('0x10'),_0x748e('0x1f'),_0x748e('0x20'),_0x748e('0x21'),_0x2b46fa,'createdAt','updatedAt','priority',_0x748e('0x36'),'recallme'],squel[_0x748e('0xf')]()[_0x748e('0x24')](_0x436c31)[_0x748e('0x11')](_0xade705)[_0x748e('0x12')](_0x748e('0x25'),null,_0x748e('0x26')+_0xade705+_0x748e('0x27'))[_0x748e('0x12')](_0x3f0755,null,_0x3f0755+_0x748e('0x13')+_0xade705+'.'+_0x2b46fa)['join'](_0x1ae5a5,null,_0x1ae5a5+_0x748e('0x13')+_0xade705+'.'+_0x2b46fa)[_0x748e('0x15')](_0xade705+_0x748e('0x28'),_0x2803d4)[_0x748e('0x15')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x748e('0x15')](_0x748e('0x2a'),selectNotIn(_0xade705,_0x3f0755,_0x2b46fa,_0x748e('0x1d'),['\x22always\x22',_0x748e('0x29')]))[_0x748e('0x15')](_0x748e('0x2a'),selectNotIn(_0xade705,_0x3f0755,_0x2b46fa,'cm_hopper',[_0x748e('0x2b')])))[_0x748e('0x2c')]();return _0x512969;}function insertTzCmHopperBlack(_0x2dd7c9,_0x40e2c3,_0x481e42,_0x33c24b){var _0x330857=[_0x748e('0x16'),_0x748e('0x2d'),_0x748e('0x18'),_0x40e2c3+'.'+_0x33c24b,_0x748e('0x2e'),_0x748e('0x2f')];return squel[_0x748e('0x1b')]()['into'](_0x748e('0x30'))[_0x748e('0x1e')](['phone','ContactId',_0x748e('0x21'),_0x33c24b,'createdAt',_0x748e('0x23')],squel['select']()['fields'](_0x330857)[_0x748e('0x11')](_0x40e2c3)[_0x748e('0x12')](_0x748e('0x25'),null,_0x748e('0x26')+_0x40e2c3+'.CmListId')['join'](_0x481e42,null,_0x481e42+_0x748e('0x13')+_0x40e2c3+'.'+_0x33c24b)[_0x748e('0x15')](_0x40e2c3+_0x748e('0x28'),_0x2dd7c9)[_0x748e('0x15')](_0x748e('0x31'),NOW)['where'](_0x748e('0x2a'),squel[_0x748e('0xf')]()[_0x748e('0x32')](_0x748e('0x10'))[_0x748e('0x11')](_0x748e('0x30'))['where']('ListId\x20=\x20?',_0x2dd7c9)['where'](_0x33c24b+_0x748e('0x34'),_0x40e2c3+'.'+_0x33c24b)))[_0x748e('0x2c')]();}function insertCmContact(_0x24b4ca,_0x4970f3,_0x3c0e2a,_0x37c043){var _0x166d7e=_['concat'](_[_0x748e('0x37')](_0x37c043),[_0x748e('0x21'),_0x748e('0x38'),_0x748e('0x22'),_0x748e('0x23')]);return squel[_0x748e('0x1b')]()['into'](_0x748e('0x25'))[_0x748e('0x1e')](_0x166d7e,squel[_0x748e('0xf')]()[_0x748e('0x24')](_0x166d7e)[_0x748e('0x11')](_0x4970f3)[_0x748e('0x15')]('('+_0x3c0e2a[_0x748e('0x12')](',')+_0x748e('0x39'),squel['select']()[_0x748e('0x24')](_0x3c0e2a)[_0x748e('0x11')]('cm_contacts')[_0x748e('0x15')](_0x748e('0x33'),_0x24b4ca)[_0x748e('0x15')]('deletedAt\x20IS\x20NULL'))[_0x748e('0x15')](_0x748e('0x3a'),squel['select']()[_0x748e('0x32')](_0x748e('0x3b'),_0x748e('0x3c'))[_0x748e('0x11')](_0x4970f3)['group'](_0x3c0e2a[_0x748e('0x12')](','))))[_0x748e('0x2c')]();}function handleStop(){logger[_0x748e('0x3d')](_0x748e('0x3e'));stopped=!![];}function handleUncaughtException(_0xec97c1){logger['error'](_0xec97c1['message']);process[_0x748e('0x3f')](0x1);}function handleError(_0x39e143,_0x5c797e){stats[_0x748e('0x40')][_0x748e('0x41')]({'name':_0x5c797e['code'],'message':_0x5c797e['message'],'row':_0x39e143});}function handleQuery(_0x512f58){logger[_0x748e('0x3d')](_0x512f58);return db[_0x748e('0x42')][_0x748e('0x43')](_0x512f58)['spread'](function(_0x586de4){results[_0x748e('0x41')](_0x586de4);})['catch'](function(_0x3da074){logger['error'](_0x3da074['message']);});}function updateTzCampaigns(_0xfbd169){return new Promise(function(_0x48ec15,_0x4361c0){var _0x3913fb=squel[_0x748e('0xf')]()[_0x748e('0x24')]([_0x748e('0x44'),'campaigns.dialTimezone'])[_0x748e('0x11')](_0x748e('0x45'))['join'](_0x748e('0x46'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x748e('0x15')](_0x748e('0x47')+_0xfbd169);db[_0x748e('0x42')][_0x748e('0x43')](_0x3913fb['toString']())['spread'](function(_0x4b6896){var _0x48b1d4=[];for(var _0x2ec1b9=0x0;_0x2ec1b9<_0x4b6896['length'];_0x2ec1b9++){_0x48b1d4[_0x748e('0x41')](getTimezoneData(_0x4b6896[_0x2ec1b9],tmp_campaigns));}BPromise['all'](_0x48b1d4)[_0x748e('0x48')](function(){_0x48ec15({'val':0x1});});})['catch'](function(_0x1c9c16){logger[_0x748e('0x49')](_0x1c9c16[_0x748e('0x4a')]);_0x48ec15({'val':0x0});});});}function updateTzVoiceQueues(_0xaef075){return new Promise(function(_0x3f487d,_0x348dce){var _0x2daa02=squel[_0x748e('0xf')]()[_0x748e('0x24')](['voice_queues.id',_0x748e('0x4b')])['from'](_0x748e('0x4c'))[_0x748e('0x12')]('voice_queues_has_cm_lists',null,_0x748e('0x4d'))['where'](_0x748e('0x4e')+_0xaef075);db['sequelize'][_0x748e('0x43')](_0x2daa02[_0x748e('0x2c')]())[_0x748e('0x4f')](function(_0x4b2412){var _0x10a62d=[];for(var _0x3c8512=0x0;_0x3c8512<_0x4b2412[_0x748e('0x50')];_0x3c8512++){_0x10a62d[_0x748e('0x41')](getTimezoneData(_0x4b2412[_0x3c8512],tmp_voice_queues));}BPromise[_0x748e('0x51')](_0x10a62d)[_0x748e('0x48')](function(){_0x3f487d({'val':0x1});});})[_0x748e('0x52')](function(_0x48c570){logger[_0x748e('0x49')](_0x48c570['message']);_0x3f487d({'val':0x0});});});}function getTimezoneData(_0x7513cf,_0x3850a7){return new Promise(function(_0x22e99b,_0x1aae85){var _0x1a18bf=shared[_0x748e('0x53')];var _0x299911=_0x1a18bf[_0x7513cf['dialTimezone']];if(_['isNil'](_0x299911)){_0x22e99b({'ret':0x1});}else{var _0x196853=_0x299911[_0x748e('0x54')];var _0x515657=squel[_0x748e('0x1b')]()[_0x748e('0x1c')](_0x3850a7)[_0x748e('0x55')]('id',_0x7513cf['id'])[_0x748e('0x55')](_0x748e('0x56'),_0x196853)[_0x748e('0x55')](_0x748e('0x57'),_0x7513cf[_0x748e('0x57')])['toString']();return db['sequelize'][_0x748e('0x43')](_0x515657)['spread'](function(_0x2e9647){_0x22e99b({'ret':0x1});})[_0x748e('0x52')](function(_0x3adcd9){logger[_0x748e('0x49')](_0x3adcd9[_0x748e('0x4a')]);_0x1aae85({'ret':0x1});});}});}function handleTZQuery(_0x1e1563){logger[_0x748e('0x3d')](_0x1e1563);return db[_0x748e('0x42')][_0x748e('0x43')](_0x1e1563)[_0x748e('0x4f')](function(_0x2103fd){})['catch'](function(_0x38fb54){logger[_0x748e('0x49')](_0x38fb54[_0x748e('0x4a')]);});}function main(_0x16658a,_0x14a459,_0x27d38b,_0x370ee1){logger['info'](_0x748e('0x58'),_0x16658a,JSON[_0x748e('0x59')](_0x14a459));process[_0x748e('0x5a')]('start');var _0x1626e3=_0x14a459[_0x748e('0x5b')];var _0x21bbb2=_0x14a459[_0x748e('0x5c')];var _0x39d289=path['join'](config[_0x748e('0x5d')],_0x748e('0x5e'),_0x21bbb2+_0x748e('0x5f'));hasTZ=_[_0x748e('0x37')](_0x1626e3)[_0x748e('0x60')]('dialTimezone');var _0x25f37d=_[_0x748e('0x37')](_0x1626e3)[_0x748e('0x12')]();logger[_0x748e('0x3d')](_0x748e('0x61'),_0x25f37d);if(hasTZ)_0x25f37d+=_0x748e('0x62');fs[_0x748e('0x63')](_0x39d289,_0x25f37d+'\x0a');Papa['parse'](fs[_0x748e('0x64')](_0x16658a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5aa635,_0x1cc1eb){try{for(var _0x518449=0x0,_0x4cf087=[];_0x518449<_0x5aa635['data'][_0x748e('0x50')];_0x518449++){stats[_0x748e('0x65')]+=0x1;if(_0x5aa635[_0x748e('0x40')][_0x518449]){handleError(_0x5aa635['data'][_0x518449],_0x5aa635['errors'][_0x518449]);}else{var _0x12e0f=[];for(var _0x4d71c2 in _0x1626e3){if(_0x1626e3['hasOwnProperty'](_0x4d71c2)){if(_0x5aa635[_0x748e('0x66')][_0x518449][_0x1626e3[_0x4d71c2]]){var _0x1d0263=_[_0x748e('0x67')](_0x5aa635['data'][_0x518449][_0x1626e3[_0x4d71c2]][_0x748e('0x68')](/"/g,'\x27'));switch(_0x4d71c2){case'scheduledat':var _0x24bad9=moment(_0x1d0263,_0x748e('0xd'),!![]);if(_0x24bad9[_0x748e('0x69')]()){_0x4cf087['push']('\x22'+_0x1d0263+'\x22');}else{_0x12e0f[_0x748e('0x41')](_0x748e('0x6a'));}break;case'priority':var _0x3c0646=parseInt(_0x1d0263);_0x1d0263=_[_0x748e('0x6b')](_0x3c0646)||_0x3c0646<0x0||_0x3c0646>0x4?_0x370ee1?0x3:0x2:_0x3c0646;_0x4cf087[_0x748e('0x41')]('\x22'+_0x1d0263+'\x22');break;case _0x748e('0x36'):var _0x55d949=parseInt(_0x1d0263);if(_[_0x748e('0x6c')](_0x55d949)&&_[_0x748e('0x60')](_0x27d38b,_0x55d949)){_0x4cf087[_0x748e('0x41')]('\x22'+_0x55d949+'\x22');}else{_0x12e0f[_0x748e('0x41')](_0x748e('0x6d'));}break;case'email':if(isEmail(_0x1d0263)){_0x4cf087[_0x748e('0x41')]('\x22'+_0x1d0263+'\x22');}else{_0x12e0f[_0x748e('0x41')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0xd94042=moment(_0x1d0263,_0x748e('0x6e'),!![]);if(_0xd94042[_0x748e('0x69')]()){_0x4cf087[_0x748e('0x41')]('\x22'+_0x1d0263+'\x22');}else{_0x12e0f[_0x748e('0x41')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x748e('0x57'):var _0x48a71a=shared[_0x748e('0x53')];var _0x4d74e3=_0x48a71a[_0x1d0263];if(!_[_0x748e('0x6f')](_0x4d74e3)){var _0x5c92d1=_0x4d74e3[_0x748e('0x54')];_0x4cf087[_0x748e('0x41')]('\x22'+_0x1d0263+'\x22');_0x4cf087[_0x748e('0x41')]('\x22'+_0x5c92d1+'\x22');}break;default:_0x4cf087[_0x748e('0x41')]('\x22'+_0x1d0263+'\x22');}}else{switch(_0x4d71c2){case _0x748e('0x70'):case _0x748e('0x10'):_0x12e0f[_0x748e('0x41')](_0x4d71c2+_0x748e('0x71'));break;default:_0x4cf087['push']('\x22\x22');}}}}if(_0x12e0f[_0x748e('0x50')]){handleError(_0x5aa635['data'][_0x518449],{'code':_0x748e('0x72'),'message':_0x12e0f[_0x748e('0x12')]()});}else{fs[_0x748e('0x73')](_0x39d289,_0x4cf087[_0x748e('0x12')]()+'\x0a');}_0x4cf087=[];}if(!(stats['rows']%0xc8)){socket[_0x748e('0x74')](_0x748e('0x75')+_0x21bbb2,stats);stats[_0x748e('0x40')]=[];}}if(stopped){logger[_0x748e('0x3d')](_0x748e('0x76'));_0x1cc1eb[_0x748e('0x77')]();}}catch(_0x279510){handleError(_0x5aa635[_0x748e('0x66')][_0x518449],{'code':_0x748e('0x78'),'message':_0x279510[_0x748e('0x4a')]});logger[_0x748e('0x49')](_0x748e('0x79'),_0x279510['message']);}},'complete':function(){try{var _0x262670=[];var _0x5ae028=[];var _0x1934e2=_0x748e('0x25');if(_0x14a459[_0x748e('0x7a')]&&_0x14a459[_0x748e('0x7a')][_0x748e('0x50')]){_0x1934e2=_0x748e('0x7b')+_0x21bbb2;_0x262670['push']('CREATE\x20TABLE\x20'+_0x1934e2+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x748e('0x7c')+_0x21bbb2;tmp_voice_queues=_0x748e('0x7d')+_0x21bbb2;_0x5ae028['push']('CREATE\x20TABLE\x20'+tmp_campaigns+_0x748e('0x7e'));_0x5ae028[_0x748e('0x41')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x748e('0x7e'));BPromise[_0x748e('0x7f')](_0x5ae028,handleTZQuery)['then'](function(_0xbc70c6){updateTzCampaigns(_0x14a459[_0x748e('0x21')])['then'](function(_0x59d7ed){updateTzVoiceQueues(_0x14a459['ListId'])[_0x748e('0x48')](function(_0x1956e8){var _0x226ed2=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x39d289,_0x1934e2,_0x25f37d,_0x14a459[_0x748e('0x21')],_0x14a459[_0x748e('0x38')]||null,NOW,NOW);if(_[_0x748e('0x6f')](_0x1626e3['scheduledat'])){_0x226ed2+=_0x748e('0x80');}_0x262670[_0x748e('0x41')](_0x226ed2);if(_0x14a459['duplicates']&&_0x14a459[_0x748e('0x7a')]['length']){_0x262670[_0x748e('0x41')](insertCmContact(_0x14a459[_0x748e('0x21')],_0x1934e2,_0x14a459[_0x748e('0x7a')],_0x1626e3));_0x262670[_0x748e('0x41')](_0x748e('0x81')+_0x1934e2+';');}if(hasTZ){_0x262670['push'](insertTzCmHopper(_0x14a459[_0x748e('0x21')],_0x748e('0x82'),_0x748e('0x4c'),_0x748e('0x83'),_0x370ee1,tmp_voice_queues));_0x262670[_0x748e('0x41')](insertTzCmHopperBlack(_0x14a459[_0x748e('0x21')],_0x748e('0x84'),_0x748e('0x4c'),_0x748e('0x83')));_0x262670['push'](insertTzCmHopper(_0x14a459['ListId'],_0x748e('0x46'),'campaigns',_0x748e('0x85'),_0x370ee1,tmp_campaigns));_0x262670[_0x748e('0x41')](insertTzCmHopperBlack(_0x14a459['ListId'],'campaigns_has_cm_blacklists',_0x748e('0x45'),'CampaignId'));}else{_0x262670[_0x748e('0x41')](insertCmHopper(_0x14a459['ListId'],'voice_queues_has_cm_lists',_0x748e('0x4c'),_0x748e('0x83'),_0x370ee1));_0x262670[_0x748e('0x41')](insertCmHopperBlack(_0x14a459[_0x748e('0x21')],'voice_queues_has_cm_blacklists',_0x748e('0x4c'),_0x748e('0x83')));_0x262670['push'](insertCmHopper(_0x14a459[_0x748e('0x21')],_0x748e('0x46'),_0x748e('0x45'),_0x748e('0x85'),_0x370ee1));_0x262670['push'](insertCmHopperBlack(_0x14a459[_0x748e('0x21')],_0x748e('0x86'),_0x748e('0x45'),_0x748e('0x85')));}_0x262670[_0x748e('0x41')](_0x748e('0x81')+tmp_campaigns+';');_0x262670[_0x748e('0x41')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x748e('0x7f')](_0x262670,handleQuery)[_0x748e('0x48')](function(_0x54eecd){stats['finish']=!![];stats[_0x748e('0x87')]=_0x14a459[_0x748e('0x7a')]&&_0x14a459[_0x748e('0x7a')][_0x748e('0x50')]?results[0x2][_0x748e('0x87')]:results[0x0][_0x748e('0x87')];socket[_0x748e('0x74')](_0x748e('0x75')+_0x21bbb2,stats);fs[_0x748e('0x88')](_0x16658a);fs[_0x748e('0x88')](_0x39d289);process[_0x748e('0x3f')](0x0);})[_0x748e('0x52')](function(_0x44b96f){logger[_0x748e('0x49')](_0x44b96f['message']);process[_0x748e('0x3f')](0x1);});});});});}catch(_0x485bdc){logger[_0x748e('0x49')]('complete',_0x485bdc['message']);process[_0x748e('0x3f')](0x1);}},'error':function(_0x5a0e5c,_0x43ffa8,_0x27f3a5,_0x10942f){throw new Error(_0x10942f);}});}function validate(){if(process[_0x748e('0x89')]&&process[_0x748e('0x89')][_0x748e('0x50')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x4a27e5=path[_0x748e('0x12')](config[_0x748e('0x5d')],_0x748e('0x5e'),process[_0x748e('0x89')][0x2]);if(!fs['existsSync'](_0x4a27e5)){throw new Error(_0x748e('0x8a'));}var _0x5b193f={};try{_0x5b193f=JSON[_0x748e('0x8b')](process[_0x748e('0x89')][0x3]);if(!_0x5b193f[_0x748e('0x5b')]){throw new Error(_0x748e('0x8c'));}if(!_0x5b193f[_0x748e('0x5b')][_0x748e('0x10')]){throw new Error(_0x748e('0x8d'));}if(!_0x5b193f[_0x748e('0x5b')][_0x748e('0x70')]){throw new Error(_0x748e('0x8e'));}var _0x4944c2=0x0;if(_0x5b193f[_0x748e('0x5b')][_0x748e('0x36')]){_0x4944c2=0x1;}if(!_0x5b193f[_0x748e('0x21')]){throw new Error(_0x748e('0x8f'));}}catch(_0x3eaf52){throw new Error('body\x20id\x20mandatory');}var _0x1a69ee=[];try{_0x1a69ee=_['map'](JSON[_0x748e('0x8b')](process[_0x748e('0x89')][0x4]),'id');}catch(_0x814d27){logger[_0x748e('0x3d')](_0x748e('0x90'));}main(_0x4a27e5,_0x5b193f,_0x1a69ee,_0x4944c2);}validate();process['on'](_0x748e('0x91'),handleStop);process['on'](_0x748e('0x92'),handleUncaughtException); \ No newline at end of file +var _0x2a22=['cm_hopper_black','ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','exit','errors','push','code','message','sequelize','query','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists.CmListId=','then','catch','dialTimezone','isNil','utcOffset','set','offset','main','stringify','start','binding','root','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','complete','argv','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','socket.io-emitter','format','test','select','field','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','ContactId','priority','UserId','recallme','fields','from','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_contacts.createdAt','createdAt','updatedAt','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','fromQuery','ListId'];(function(_0x1ba5c8,_0x5a7c41){var _0x53aa62=function(_0x52b4de){while(--_0x52b4de){_0x1ba5c8['push'](_0x1ba5c8['shift']());}};_0x53aa62(++_0x5a7c41);}(_0x2a22,0x107));var _0x22a2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x2a22[_0x1694f5];return _0x5b4321;};'use strict';var fs=require('fs');var path=require(_0x22a2('0x0'));var _=require(_0x22a2('0x1'));var Papa=require('papaparse');var util=require(_0x22a2('0x2'));var BPromise=require(_0x22a2('0x3'));var moment=require(_0x22a2('0x4'));var squel=require(_0x22a2('0x5'));var Redis=require(_0x22a2('0x6'));var db=require('../../../mysqldb')['db'];var config=require(_0x22a2('0x7'));var shared=require(_0x22a2('0x8'));var logger=require('../../../config/logger')(_0x22a2('0x9'));config[_0x22a2('0xa')]=_[_0x22a2('0xb')](config[_0x22a2('0xa')],{'host':_0x22a2('0xc'),'port':0x18eb});var socket=require(_0x22a2('0xd'))(new Redis(config[_0x22a2('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x22a2('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xb25662){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))*$/[_0x22a2('0xf')](_0xb25662);}function selectNotIn(_0x414a06,_0x4d0f5f,_0xc5f5ce,_0x25b7d5,_0x2ee1aa){return squel[_0x22a2('0x10')]()[_0x22a2('0x11')]('phone')['from'](_0x25b7d5)[_0x22a2('0x12')](_0x4d0f5f,null,_0x4d0f5f+_0x22a2('0x13')+_0x25b7d5+'.'+_0xc5f5ce)[_0x22a2('0x14')](_0x25b7d5+'.'+_0xc5f5ce+_0x22a2('0x15')+_0x414a06+'.'+_0xc5f5ce)[_0x22a2('0x14')](_0x4d0f5f+_0x22a2('0x16')+_0x2ee1aa[_0x22a2('0x12')]()+')');}function insertCmHopper(_0x3a3c70,_0x195130,_0x517907,_0x279151,_0x9a318){var _0x2c09b5=['cm_contacts.phone',_0x22a2('0x17'),_0x22a2('0x18'),_0x22a2('0x19'),_0x195130+'.'+_0x279151,'cm_contacts.createdAt',_0x22a2('0x1a'),_0x22a2('0x1b'),_0x22a2('0x1c'),'\x22'+_0x9a318+'\x22'];return squel[_0x22a2('0x1d')]()[_0x22a2('0x1e')](_0x22a2('0x1f'))['fromQuery']([_0x22a2('0x20'),_0x22a2('0x21'),_0x22a2('0x22'),'ListId',_0x279151,'createdAt','updatedAt',_0x22a2('0x23'),_0x22a2('0x24'),_0x22a2('0x25')],squel['select']()[_0x22a2('0x26')](_0x2c09b5)[_0x22a2('0x27')](_0x195130)[_0x22a2('0x12')](_0x22a2('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x195130+_0x22a2('0x29'))['join'](_0x517907,null,_0x517907+'.id\x20=\x20'+_0x195130+'.'+_0x279151)[_0x22a2('0x14')](_0x195130+'.CmListId\x20=\x20?',_0x3a3c70)[_0x22a2('0x14')](_0x22a2('0x2a'),NOW)[_0x22a2('0x14')](_0x22a2('0x2b'),selectNotIn(_0x195130,_0x517907,_0x279151,_0x22a2('0x1f'),[_0x22a2('0x2c'),_0x22a2('0x2d')]))[_0x22a2('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x195130,_0x517907,_0x279151,_0x22a2('0x1f'),[_0x22a2('0x2c')])))[_0x22a2('0x2e')]();}function insertCmHopperBlack(_0x2245c3,_0xe50d56,_0x4ecb6f,_0x1a2a1b){var _0x45a39a=[_0x22a2('0x2f'),_0x22a2('0x18'),_0x22a2('0x19'),_0xe50d56+'.'+_0x1a2a1b,_0x22a2('0x30'),_0x22a2('0x1a')];return squel[_0x22a2('0x1d')]()[_0x22a2('0x1e')]('cm_hopper_black')['fromQuery']([_0x22a2('0x20'),'ContactId','ListId',_0x1a2a1b,_0x22a2('0x31'),_0x22a2('0x32')],squel[_0x22a2('0x10')]()['fields'](_0x45a39a)[_0x22a2('0x27')](_0xe50d56)['join'](_0x22a2('0x28'),null,_0x22a2('0x33')+_0xe50d56+_0x22a2('0x29'))[_0x22a2('0x12')](_0x4ecb6f,null,_0x4ecb6f+_0x22a2('0x13')+_0xe50d56+'.'+_0x1a2a1b)[_0x22a2('0x14')](_0xe50d56+_0x22a2('0x34'),_0x2245c3)[_0x22a2('0x14')](_0x22a2('0x2a'),NOW)['where'](_0x22a2('0x2b'),squel[_0x22a2('0x10')]()[_0x22a2('0x11')](_0x22a2('0x20'))['from']('cm_hopper_black')[_0x22a2('0x14')]('ListId\x20=\x20?',_0x2245c3)[_0x22a2('0x14')](_0x1a2a1b+_0x22a2('0x35'),_0xe50d56+'.'+_0x1a2a1b)))[_0x22a2('0x2e')]();}function insertTzCmHopper(_0x49dec7,_0x183650,_0x56b2e0,_0x189544,_0x3cf784,_0x3fa4e5){var _0x1cdc4d=[_0x22a2('0x2f'),_0x22a2('0x36')+_0x3fa4e5+'.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id',_0x22a2('0x19'),_0x183650+'.'+_0x189544,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x22a2('0x1b'),'cm_contacts.UserId','\x22'+_0x3cf784+'\x22'];var _0x31073d=squel[_0x22a2('0x1d')]()[_0x22a2('0x1e')](_0x22a2('0x1f'))[_0x22a2('0x37')]([_0x22a2('0x20'),'scheduledat','ContactId',_0x22a2('0x38'),_0x189544,_0x22a2('0x31'),_0x22a2('0x32'),_0x22a2('0x23'),_0x22a2('0x24'),'recallme'],squel[_0x22a2('0x10')]()[_0x22a2('0x26')](_0x1cdc4d)[_0x22a2('0x27')](_0x183650)[_0x22a2('0x12')](_0x22a2('0x28'),null,_0x22a2('0x33')+_0x183650+_0x22a2('0x29'))[_0x22a2('0x12')](_0x56b2e0,null,_0x56b2e0+'.id\x20=\x20'+_0x183650+'.'+_0x189544)[_0x22a2('0x12')](_0x3fa4e5,null,_0x3fa4e5+'.id\x20=\x20'+_0x183650+'.'+_0x189544)['where'](_0x183650+'.CmListId\x20=\x20?',_0x49dec7)[_0x22a2('0x14')](_0x22a2('0x2a'),NOW)['where'](_0x22a2('0x2b'),selectNotIn(_0x183650,_0x56b2e0,_0x189544,'cm_hopper',[_0x22a2('0x2c'),'\x22onlyIfOpen\x22']))[_0x22a2('0x14')](_0x22a2('0x2b'),selectNotIn(_0x183650,_0x56b2e0,_0x189544,'cm_hopper',[_0x22a2('0x2c')])))[_0x22a2('0x2e')]();return _0x31073d;}function insertTzCmHopperBlack(_0x58e528,_0x53775d,_0x5aa03d,_0x283154){var _0x1f9c58=[_0x22a2('0x2f'),_0x22a2('0x18'),'cm_contacts.ListId',_0x53775d+'.'+_0x283154,_0x22a2('0x30'),_0x22a2('0x1a')];return squel[_0x22a2('0x1d')]()['into'](_0x22a2('0x39'))[_0x22a2('0x37')]([_0x22a2('0x20'),'ContactId',_0x22a2('0x38'),_0x283154,'createdAt','updatedAt'],squel[_0x22a2('0x10')]()[_0x22a2('0x26')](_0x1f9c58)[_0x22a2('0x27')](_0x53775d)['join'](_0x22a2('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x53775d+'.CmListId')['join'](_0x5aa03d,null,_0x5aa03d+_0x22a2('0x13')+_0x53775d+'.'+_0x283154)[_0x22a2('0x14')](_0x53775d+_0x22a2('0x34'),_0x58e528)['where'](_0x22a2('0x2a'),NOW)[_0x22a2('0x14')](_0x22a2('0x2b'),squel[_0x22a2('0x10')]()[_0x22a2('0x11')](_0x22a2('0x20'))[_0x22a2('0x27')](_0x22a2('0x39'))['where'](_0x22a2('0x3a'),_0x58e528)[_0x22a2('0x14')](_0x283154+_0x22a2('0x35'),_0x53775d+'.'+_0x283154)))['toString']();}function insertCmContact(_0x28a74d,_0x22716b,_0x27e983,_0x144178){var _0x59ca63=_[_0x22a2('0x3b')](_[_0x22a2('0x3c')](_0x144178),[_0x22a2('0x38'),_0x22a2('0x3d'),'createdAt',_0x22a2('0x32')]);return squel['insert']()[_0x22a2('0x1e')](_0x22a2('0x28'))[_0x22a2('0x37')](_0x59ca63,squel['select']()[_0x22a2('0x26')](_0x59ca63)[_0x22a2('0x27')](_0x22716b)['where']('('+_0x27e983[_0x22a2('0x12')](',')+_0x22a2('0x3e'),squel[_0x22a2('0x10')]()[_0x22a2('0x26')](_0x27e983)['from'](_0x22a2('0x28'))[_0x22a2('0x14')](_0x22a2('0x3a'),_0x28a74d)['where'](_0x22a2('0x3f')))[_0x22a2('0x14')](_0x22a2('0x40'),squel[_0x22a2('0x10')]()[_0x22a2('0x11')](_0x22a2('0x41'),'min_id')['from'](_0x22716b)[_0x22a2('0x42')](_0x27e983[_0x22a2('0x12')](','))))[_0x22a2('0x2e')]();}function handleStop(){logger[_0x22a2('0x43')](_0x22a2('0x44'));stopped=!![];}function handleUncaughtException(_0x2a0bf0){logger[_0x22a2('0x45')](_0x2a0bf0['message']);process[_0x22a2('0x46')](0x1);}function handleError(_0x1f1506,_0x286349){stats[_0x22a2('0x47')][_0x22a2('0x48')]({'name':_0x286349[_0x22a2('0x49')],'message':_0x286349[_0x22a2('0x4a')],'row':_0x1f1506});}function handleQuery(_0xf22021){logger[_0x22a2('0x43')](_0xf22021);return db[_0x22a2('0x4b')][_0x22a2('0x4c')](_0xf22021)[_0x22a2('0x4d')](function(_0x5e6bbf){results[_0x22a2('0x48')](_0x5e6bbf);})['catch'](function(_0x1ca64d){logger[_0x22a2('0x45')](_0x1ca64d[_0x22a2('0x4a')]);});}function updateTzCampaigns(_0x871d8d){return new Promise(function(_0x3144b5,_0x1e23c6){var _0x2ccee2=squel[_0x22a2('0x10')]()['fields']([_0x22a2('0x4e'),'campaigns.dialTimezone'])[_0x22a2('0x27')](_0x22a2('0x4f'))[_0x22a2('0x12')](_0x22a2('0x50'),null,_0x22a2('0x51'))[_0x22a2('0x14')](_0x22a2('0x52')+_0x871d8d);db[_0x22a2('0x4b')][_0x22a2('0x4c')](_0x2ccee2[_0x22a2('0x2e')]())[_0x22a2('0x4d')](function(_0x62df18){var _0x25f59d=[];for(var _0x56df83=0x0;_0x56df83<_0x62df18[_0x22a2('0x53')];_0x56df83++){_0x25f59d['push'](getTimezoneData(_0x62df18[_0x56df83],tmp_campaigns));}BPromise[_0x22a2('0x54')](_0x25f59d)['then'](function(){_0x3144b5({'val':0x1});});})['catch'](function(_0x283140){logger['error'](_0x283140[_0x22a2('0x4a')]);_0x3144b5({'val':0x0});});});}function updateTzVoiceQueues(_0x41b67d){return new Promise(function(_0x53aa7d,_0x460726){var _0x194431=squel['select']()[_0x22a2('0x26')](['voice_queues.id',_0x22a2('0x55')])[_0x22a2('0x27')](_0x22a2('0x56'))['join']('voice_queues_has_cm_lists',null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x22a2('0x14')](_0x22a2('0x57')+_0x41b67d);db[_0x22a2('0x4b')][_0x22a2('0x4c')](_0x194431[_0x22a2('0x2e')]())[_0x22a2('0x4d')](function(_0x492af8){var _0x8a3fb3=[];for(var _0x424ad1=0x0;_0x424ad1<_0x492af8[_0x22a2('0x53')];_0x424ad1++){_0x8a3fb3[_0x22a2('0x48')](getTimezoneData(_0x492af8[_0x424ad1],tmp_voice_queues));}BPromise[_0x22a2('0x54')](_0x8a3fb3)[_0x22a2('0x58')](function(){_0x53aa7d({'val':0x1});});})[_0x22a2('0x59')](function(_0x8579a5){logger[_0x22a2('0x45')](_0x8579a5['message']);_0x53aa7d({'val':0x0});});});}function getTimezoneData(_0x65b349,_0x107871){return new Promise(function(_0x5be882,_0x5aab55){var _0x173328=shared['timezones'];var _0x2cf140=_0x173328[_0x65b349[_0x22a2('0x5a')]];if(_[_0x22a2('0x5b')](_0x2cf140)){_0x5be882({'ret':0x1});}else{var _0x8c2f47=_0x2cf140[_0x22a2('0x5c')];var _0xf1e5cb=squel[_0x22a2('0x1d')]()['into'](_0x107871)[_0x22a2('0x5d')]('id',_0x65b349['id'])[_0x22a2('0x5d')](_0x22a2('0x5e'),_0x8c2f47)['set'](_0x22a2('0x5a'),_0x65b349[_0x22a2('0x5a')])[_0x22a2('0x2e')]();return db[_0x22a2('0x4b')][_0x22a2('0x4c')](_0xf1e5cb)[_0x22a2('0x4d')](function(_0xd92927){_0x5be882({'ret':0x1});})[_0x22a2('0x59')](function(_0x3f0f3a){logger[_0x22a2('0x45')](_0x3f0f3a[_0x22a2('0x4a')]);_0x5aab55({'ret':0x1});});}});}function handleTZQuery(_0x2664bc){logger[_0x22a2('0x43')](_0x2664bc);return db[_0x22a2('0x4b')][_0x22a2('0x4c')](_0x2664bc)[_0x22a2('0x4d')](function(_0x41ad7d){})[_0x22a2('0x59')](function(_0x1767b5){logger[_0x22a2('0x45')](_0x1767b5[_0x22a2('0x4a')]);});}function main(_0x237c87,_0xbd3c1e,_0x1b0dbb,_0x6b2104){logger[_0x22a2('0x43')](_0x22a2('0x5f'),_0x237c87,JSON[_0x22a2('0x60')](_0xbd3c1e));process['send'](_0x22a2('0x61'));var _0x20eb45=_0xbd3c1e[_0x22a2('0x62')];var _0x432059=_0xbd3c1e['socket_timestamp'];var _0x11f4b2=path[_0x22a2('0x12')](config[_0x22a2('0x63')],'server/files/tmp',_0x432059+'.csv');hasTZ=_[_0x22a2('0x3c')](_0x20eb45)[_0x22a2('0x64')](_0x22a2('0x5a'));var _0x5443b4=_[_0x22a2('0x3c')](_0x20eb45)[_0x22a2('0x12')]();logger[_0x22a2('0x43')](_0x22a2('0x65'),_0x5443b4);if(hasTZ)_0x5443b4+=_0x22a2('0x66');fs[_0x22a2('0x67')](_0x11f4b2,_0x5443b4+'\x0a');Papa[_0x22a2('0x68')](fs[_0x22a2('0x69')](_0x237c87),{'header':!![],'skipEmptyLines':!![],'step':function(_0x505539,_0x3e0cb4){try{for(var _0x5e12ca=0x0,_0x27a53d=[];_0x5e12ca<_0x505539[_0x22a2('0x6a')][_0x22a2('0x53')];_0x5e12ca++){stats[_0x22a2('0x6b')]+=0x1;if(_0x505539[_0x22a2('0x47')][_0x5e12ca]){handleError(_0x505539[_0x22a2('0x6a')][_0x5e12ca],_0x505539['errors'][_0x5e12ca]);}else{var _0x404f96=[];for(var _0x22e790 in _0x20eb45){if(_0x20eb45['hasOwnProperty'](_0x22e790)){if(_0x505539[_0x22a2('0x6a')][_0x5e12ca][_0x20eb45[_0x22e790]]){var _0x2f132d=_[_0x22a2('0x6c')](_0x505539[_0x22a2('0x6a')][_0x5e12ca][_0x20eb45[_0x22e790]]['replace'](/"/g,'\x27'));switch(_0x22e790){case _0x22a2('0x21'):var _0x22db04=moment(_0x2f132d,_0x22a2('0x6d'),!![]);if(_0x22db04[_0x22a2('0x6e')]()){_0x27a53d[_0x22a2('0x48')]('\x22'+_0x2f132d+'\x22');}else{_0x404f96[_0x22a2('0x48')](_0x22a2('0x6f'));}break;case'priority':var _0x556faf=parseInt(_0x2f132d);_0x2f132d=_[_0x22a2('0x70')](_0x556faf)||_0x556faf<0x0||_0x556faf>0x4?_0x6b2104?0x3:0x2:_0x556faf;_0x27a53d[_0x22a2('0x48')]('\x22'+_0x2f132d+'\x22');break;case'UserId':var _0x1703b5=parseInt(_0x2f132d);if(_[_0x22a2('0x71')](_0x1703b5)&&_[_0x22a2('0x64')](_0x1b0dbb,_0x1703b5)){_0x27a53d[_0x22a2('0x48')]('\x22'+_0x1703b5+'\x22');}else{_0x404f96[_0x22a2('0x48')](_0x22a2('0x72'));}break;case _0x22a2('0x73'):if(isEmail(_0x2f132d)){_0x27a53d[_0x22a2('0x48')]('\x22'+_0x2f132d+'\x22');}else{_0x404f96['push'](_0x22a2('0x74'));}break;case _0x22a2('0x75'):var _0x316e9a=moment(_0x2f132d,_0x22a2('0x76'),!![]);if(_0x316e9a[_0x22a2('0x6e')]()){_0x27a53d['push']('\x22'+_0x2f132d+'\x22');}else{_0x404f96['push'](_0x22a2('0x77'));}break;case'dialTimezone':var _0x26e145=shared[_0x22a2('0x78')];var _0x33d80c=_0x26e145[_0x2f132d];if(!_[_0x22a2('0x5b')](_0x33d80c)){var _0x1411eb=_0x33d80c[_0x22a2('0x5c')];_0x27a53d[_0x22a2('0x48')]('\x22'+_0x2f132d+'\x22');_0x27a53d['push']('\x22'+_0x1411eb+'\x22');}break;default:_0x27a53d['push']('\x22'+_0x2f132d+'\x22');}}else{switch(_0x22e790){case _0x22a2('0x79'):case'phone':_0x404f96['push'](_0x22e790+_0x22a2('0x7a'));break;default:_0x27a53d['push']('\x22\x22');}}}}if(_0x404f96['length']){handleError(_0x505539[_0x22a2('0x6a')][_0x5e12ca],{'code':_0x22a2('0x7b'),'message':_0x404f96[_0x22a2('0x12')]()});}else{fs[_0x22a2('0x7c')](_0x11f4b2,_0x27a53d[_0x22a2('0x12')]()+'\x0a');}_0x27a53d=[];}if(!(stats[_0x22a2('0x6b')]%0xc8)){socket[_0x22a2('0x7d')](_0x22a2('0x7e')+_0x432059,stats);stats[_0x22a2('0x47')]=[];}}if(stopped){logger[_0x22a2('0x43')](_0x22a2('0x7f'));_0x3e0cb4[_0x22a2('0x80')]();}}catch(_0x2924c9){handleError(_0x505539['data'][_0x5e12ca],{'code':_0x22a2('0x81'),'message':_0x2924c9['message']});logger['error'](_0x22a2('0x82'),_0x2924c9[_0x22a2('0x4a')]);}},'complete':function(){try{var _0x1b6253=[];var _0x4c359a=[];var _0x168511='cm_contacts';if(_0xbd3c1e['duplicates']&&_0xbd3c1e[_0x22a2('0x83')][_0x22a2('0x53')]){_0x168511=_0x22a2('0x84')+_0x432059;_0x1b6253['push'](_0x22a2('0x85')+_0x168511+_0x22a2('0x86'));}tmp_campaigns=_0x22a2('0x87')+_0x432059;tmp_voice_queues=_0x22a2('0x88')+_0x432059;_0x4c359a[_0x22a2('0x48')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x22a2('0x89'));_0x4c359a[_0x22a2('0x48')](_0x22a2('0x85')+tmp_voice_queues+_0x22a2('0x89'));BPromise[_0x22a2('0x8a')](_0x4c359a,handleTZQuery)['then'](function(_0x3565eb){updateTzCampaigns(_0xbd3c1e['ListId'])[_0x22a2('0x58')](function(_0x4b37c6){updateTzVoiceQueues(_0xbd3c1e[_0x22a2('0x38')])[_0x22a2('0x58')](function(_0x1d5f8d){var _0x15782b=util[_0x22a2('0xe')](_0x22a2('0x8b'),_0x11f4b2,_0x168511,_0x5443b4,_0xbd3c1e['ListId'],_0xbd3c1e['CompanyId']||null,NOW,NOW);if(_[_0x22a2('0x5b')](_0x20eb45[_0x22a2('0x21')])){_0x15782b+=',\x20scheduledAt\x20=\x20NOW()';}_0x1b6253['push'](_0x15782b);if(_0xbd3c1e['duplicates']&&_0xbd3c1e[_0x22a2('0x83')]['length']){_0x1b6253[_0x22a2('0x48')](insertCmContact(_0xbd3c1e[_0x22a2('0x38')],_0x168511,_0xbd3c1e[_0x22a2('0x83')],_0x20eb45));_0x1b6253[_0x22a2('0x48')](_0x22a2('0x8c')+_0x168511+';');}if(hasTZ){_0x1b6253[_0x22a2('0x48')](insertTzCmHopper(_0xbd3c1e['ListId'],_0x22a2('0x8d'),'voice_queues',_0x22a2('0x8e'),_0x6b2104,tmp_voice_queues));_0x1b6253[_0x22a2('0x48')](insertTzCmHopperBlack(_0xbd3c1e['ListId'],_0x22a2('0x8f'),_0x22a2('0x56'),'VoiceQueueId'));_0x1b6253[_0x22a2('0x48')](insertTzCmHopper(_0xbd3c1e[_0x22a2('0x38')],_0x22a2('0x50'),_0x22a2('0x4f'),'CampaignId',_0x6b2104,tmp_campaigns));_0x1b6253[_0x22a2('0x48')](insertTzCmHopperBlack(_0xbd3c1e['ListId'],_0x22a2('0x90'),_0x22a2('0x4f'),'CampaignId'));}else{_0x1b6253[_0x22a2('0x48')](insertCmHopper(_0xbd3c1e[_0x22a2('0x38')],_0x22a2('0x8d'),_0x22a2('0x56'),'VoiceQueueId',_0x6b2104));_0x1b6253[_0x22a2('0x48')](insertCmHopperBlack(_0xbd3c1e['ListId'],_0x22a2('0x8f'),'voice_queues','VoiceQueueId'));_0x1b6253[_0x22a2('0x48')](insertCmHopper(_0xbd3c1e[_0x22a2('0x38')],_0x22a2('0x50'),_0x22a2('0x4f'),_0x22a2('0x91'),_0x6b2104));_0x1b6253[_0x22a2('0x48')](insertCmHopperBlack(_0xbd3c1e[_0x22a2('0x38')],_0x22a2('0x90'),_0x22a2('0x4f'),'CampaignId'));}_0x1b6253[_0x22a2('0x48')]('DROP\x20TABLE\x20'+tmp_campaigns+';');_0x1b6253['push'](_0x22a2('0x8c')+tmp_voice_queues+';');BPromise[_0x22a2('0x8a')](_0x1b6253,handleQuery)[_0x22a2('0x58')](function(_0x146590){stats[_0x22a2('0x92')]=!![];stats['affectedRows']=_0xbd3c1e[_0x22a2('0x83')]&&_0xbd3c1e[_0x22a2('0x83')][_0x22a2('0x53')]?results[0x2][_0x22a2('0x93')]:results[0x0][_0x22a2('0x93')];socket[_0x22a2('0x7d')](_0x22a2('0x7e')+_0x432059,stats);fs['unlink'](_0x237c87);fs['unlink'](_0x11f4b2);process[_0x22a2('0x46')](0x0);})[_0x22a2('0x59')](function(_0x384ea8){logger[_0x22a2('0x45')](_0x384ea8[_0x22a2('0x4a')]);process[_0x22a2('0x46')](0x1);});});});});}catch(_0x170820){logger[_0x22a2('0x45')](_0x22a2('0x94'),_0x170820[_0x22a2('0x4a')]);process[_0x22a2('0x46')](0x1);}},'error':function(_0x437e99,_0x42505d,_0x40a2e2,_0xc0e5a8){throw new Error(_0xc0e5a8);}});}function validate(){if(process[_0x22a2('0x95')]&&process[_0x22a2('0x95')][_0x22a2('0x53')]<0x4){throw new Error('arguments\x20\x20\x20');}var _0x2c787d=path['join'](config['root'],_0x22a2('0x96'),process[_0x22a2('0x95')][0x2]);if(!fs[_0x22a2('0x97')](_0x2c787d)){throw new Error(_0x22a2('0x98'));}var _0x5c48cc={};try{_0x5c48cc=JSON[_0x22a2('0x68')](process[_0x22a2('0x95')][0x3]);if(!_0x5c48cc[_0x22a2('0x62')]){throw new Error(_0x22a2('0x99'));}if(!_0x5c48cc[_0x22a2('0x62')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x5c48cc[_0x22a2('0x62')][_0x22a2('0x79')]){throw new Error(_0x22a2('0x9a'));}var _0x27146e=0x0;if(_0x5c48cc['binding'][_0x22a2('0x24')]){_0x27146e=0x1;}if(!_0x5c48cc['ListId']){throw new Error(_0x22a2('0x9b'));}}catch(_0x5af8bd){throw new Error(_0x22a2('0x9c'));}var _0xf3cc86=[];try{_0xf3cc86=_[_0x22a2('0x9d')](JSON[_0x22a2('0x68')](process[_0x22a2('0x95')][0x4]),'id');}catch(_0x3e8cb2){logger[_0x22a2('0x43')](_0x22a2('0x9e'));}main(_0x2c787d,_0x5c48cc,_0xf3cc86,_0x27146e);}validate();process['on']('SIGINT',handleStop);process['on'](_0x22a2('0x9f'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 066f2fb..13fded7 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 _0x567c=['destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','Duration','duration','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','push','queue','variable','calleridnum','outbound','Outbound\x20Call','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name'];(function(_0x1b04c3,_0x2de114){var _0x696a39=function(_0xf325e0){while(--_0xf325e0){_0x1b04c3['push'](_0x1b04c3['shift']());}};_0x696a39(++_0x2de114);}(_0x567c,0x15b));var _0xc567=function(_0x5a32e3,_0x36dda2){_0x5a32e3=_0x5a32e3-0x0;var _0x5e27ba=_0x567c[_0x5a32e3];return _0x5e27ba;};'use strict';exports[_0xc567('0x0')]=function(_0x54ca7e,_0x586ed0){var _0x380ada=[{'type':'string','content':_0xc567('0x1'),'variableName':null}];switch(_0x54ca7e[_0xc567('0x2')]()){case'voice':switch(_0x586ed0[_0xc567('0x2')]()){case'inbound':_0x380ada[_0xc567('0x3')]({'type':'variable','content':'','variableName':_0xc567('0x4')});_0x380ada[_0xc567('0x3')]({'type':_0xc567('0x5'),'content':'','variableName':_0xc567('0x6')});break;case _0xc567('0x7'):_0x380ada[_0xc567('0x3')]({'type':'string','content':_0xc567('0x8'),'variableName':null});_0x380ada[_0xc567('0x3')]({'type':_0xc567('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x380ada;};exports[_0xc567('0x9')]=function(_0x1ee78c,_0x50ef80){var _0x3e521f=[];switch(_0x1ee78c[_0xc567('0x2')]()){case'voice':switch(_0x50ef80[_0xc567('0x2')]()){case _0xc567('0xa'):_0x3e521f=[{'type':'string','content':_0xc567('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0xd'),'keyType':_0xc567('0x5'),'variableName':_0xc567('0x6')},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0xe'),'keyType':_0xc567('0x5'),'variableName':_0xc567('0xf')},{'type':_0xc567('0xc'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0xc567('0x10')},{'type':_0xc567('0xc'),'content':'','key':'Queue','keyType':_0xc567('0x5'),'variableName':'queue'},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x11'),'keyType':_0xc567('0x5'),'variableName':_0xc567('0x12')},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x13'),'keyType':'variable','variableName':'agentcalledAt'},{'type':'string','content':_0xc567('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xc567('0x15'),'keyType':_0xc567('0x5'),'variableName':_0xc567('0x16')},{'type':'keyValue','content':'','key':_0xc567('0x17'),'keyType':'variable','variableName':_0xc567('0x18')},{'type':'string','content':_0xc567('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x1a'),'keyType':'variable','variableName':'agentcalledAt'},{'type':'keyValue','content':'','key':_0xc567('0x1b'),'keyType':'variable','variableName':_0xc567('0x1c')},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0xc567('0x1d')},{'type':'keyValue','content':'','key':_0xc567('0x1e'),'keyType':_0xc567('0x5'),'variableName':'holdtime'},{'type':'keyValue','content':'','key':_0xc567('0x1f'),'keyType':_0xc567('0x5'),'variableName':_0xc567('0x20')}];break;case _0xc567('0x7'):_0x3e521f=[{'type':'string','content':_0xc567('0xb'),'variableName':null},{'type':_0xc567('0xc'),'content':'','key':'Called\x20Number','keyType':'variable','keyContent':'','variableName':_0xc567('0x18')},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x21'),'keyType':_0xc567('0x5'),'keyContent':'','variableName':_0xc567('0x22')},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x11'),'keyType':_0xc567('0x5'),'keyContent':'','variableName':_0xc567('0x12')},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x13'),'keyType':_0xc567('0x5'),'keyContent':'','variableName':_0xc567('0x23')},{'type':'string','content':_0xc567('0x19')},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x24'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x25'),'keyType':_0xc567('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0xc567('0xc'),'content':'','key':_0xc567('0x26'),'keyType':_0xc567('0x5'),'keyContent':'','variableName':_0xc567('0x27')},{'type':_0xc567('0xc'),'content':'','key':'Billable\x20Time','keyType':_0xc567('0x5'),'keyContent':'','variableName':_0xc567('0x28')}];break;}}return _0x3e521f;}; \ No newline at end of file +var _0x4fe3=['queue','calleridnum','outbound','string','Outbound\x20Call','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','destcalleridnum','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','membername','starttime','Answer\x20Time','answertime','endtime','Duration','duration','Billable\x20Time','billableseconds','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x4fe3,0x190));var _0x34fe=function(_0x3bb928,_0x2fb2ae){_0x3bb928=_0x3bb928-0x0;var _0x56a0a6=_0x4fe3[_0x3bb928];return _0x56a0a6;};'use strict';exports['getSubjects']=function(_0x4ef6f5,_0xc71b1a){var _0x3095c3=[{'type':'string','content':_0x34fe('0x0'),'variableName':null}];switch(_0x4ef6f5[_0x34fe('0x1')]()){case _0x34fe('0x2'):switch(_0xc71b1a[_0x34fe('0x1')]()){case'inbound':_0x3095c3[_0x34fe('0x3')]({'type':_0x34fe('0x4'),'content':'','variableName':_0x34fe('0x5')});_0x3095c3[_0x34fe('0x3')]({'type':_0x34fe('0x4'),'content':'','variableName':_0x34fe('0x6')});break;case _0x34fe('0x7'):_0x3095c3[_0x34fe('0x3')]({'type':_0x34fe('0x8'),'content':_0x34fe('0x9'),'variableName':null});_0x3095c3[_0x34fe('0x3')]({'type':_0x34fe('0x4'),'content':'','variableName':'destcalleridnum'});break;}}return _0x3095c3;};exports[_0x34fe('0xa')]=function(_0x3f4454,_0x59478e){var _0x347717=[];switch(_0x3f4454[_0x34fe('0x1')]()){case _0x34fe('0x2'):switch(_0x59478e[_0x34fe('0x1')]()){case _0x34fe('0xb'):_0x347717=[{'type':'string','content':_0x34fe('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0xe'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x6')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0xf'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x10')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x11'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x12')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x13'),'keyType':'variable','variableName':_0x34fe('0x5')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x14'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x15')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x16'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x17')},{'type':'string','content':_0x34fe('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x19'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x1a')},{'type':_0x34fe('0xd'),'content':'','key':'Agent\x20Number','keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x1b')},{'type':_0x34fe('0x8'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x34fe('0xd'),'content':'','key':'Agent\x20Ring','keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x17')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x1c'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x1d')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x1e'),'keyType':_0x34fe('0x4'),'variableName':_0x34fe('0x1f')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x20'),'keyType':_0x34fe('0x4'),'variableName':'holdtime'},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x21'),'keyType':'variable','variableName':_0x34fe('0x22')}];break;case'outbound':_0x347717=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x23'),'keyType':_0x34fe('0x4'),'keyContent':'','variableName':_0x34fe('0x1b')},{'type':_0x34fe('0xd'),'content':'','key':'Member\x20Name','keyType':_0x34fe('0x4'),'keyContent':'','variableName':_0x34fe('0x24')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x14'),'keyType':_0x34fe('0x4'),'keyContent':'','variableName':_0x34fe('0x15')},{'type':_0x34fe('0xd'),'content':'','key':'Date','keyType':_0x34fe('0x4'),'keyContent':'','variableName':_0x34fe('0x25')},{'type':_0x34fe('0x8'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x26'),'keyType':'variable','keyContent':'','variableName':_0x34fe('0x27')},{'type':_0x34fe('0xd'),'content':'','key':'Complete\x20Time','keyType':_0x34fe('0x4'),'keyContent':'','variableName':_0x34fe('0x28')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x29'),'keyType':_0x34fe('0x4'),'keyContent':'','variableName':_0x34fe('0x2a')},{'type':_0x34fe('0xd'),'content':'','key':_0x34fe('0x2b'),'keyType':'variable','keyContent':'','variableName':_0x34fe('0x2c')}];break;}}return _0x347717;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 84e2129..fade16f 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 _0x83a1=['sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','stringify','null','findOne','then','catch','error','tracked','user','clone','body','omit','html','phone','fax','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions'];(function(_0x33a349,_0x5b73b7){var _0x2ab26e=function(_0xe86c1f){while(--_0xe86c1f){_0x33a349['push'](_0x33a349['shift']());}};_0x2ab26e(++_0x5b73b7);}(_0x83a1,0x1bd));var _0x183a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x83a1[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var db=require(_0x183a('0x0'))['db'];var loggers={'openchannel':require(_0x183a('0x1'))(_0x183a('0x2')),'mail':require(_0x183a('0x1'))(_0x183a('0x3')),'fax':require(_0x183a('0x1'))(_0x183a('0x4')),'sms':require(_0x183a('0x1'))(_0x183a('0x5')),'chat':require('../../config/logger')(_0x183a('0x6')),'whatsapp':require(_0x183a('0x1'))('whatsapp-interactions')};function getInteractionId(_0x4e3f9b,_0x2e39ad,_0x1655db){if(_0x4e3f9b&&_0x4e3f9b[_[_0x183a('0x7')](_0x1655db)+_0x183a('0x8')]){return _0x4e3f9b[_['upperFirst'](_0x1655db)+'InteractionId'];}else if(_0x4e3f9b&&_0x4e3f9b['id']){return _0x4e3f9b['id'];}else if(_0x2e39ad&&_0x2e39ad['id']){return _0x2e39ad['id'];}else{return _0x183a('0x9');}}function log(_0x5ab64c,_0x57dfa7,_0x27a816,_0x59de0c,_0x539adf,_0x118924){loggers[_0x539adf[_0x183a('0xa')]()][_0x5ab64c]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x118924['toUpperCase'](),_0x57dfa7?_0x57dfa7['id']:null,_0x57dfa7?_0x57dfa7['name']:null,_0x57dfa7?_0x57dfa7['role']:null,getInteractionId(_0x27a816,_0x59de0c,_0x539adf),_0x27a816?JSON[_0x183a('0xb')](_0x27a816):_0x183a('0xc'));}function updateUser(_0x57a776,_0xbaf3ec,_0x17406f,_0x3e0db1,_0x49d5a5){db[_[_0x183a('0x7')](_0x3e0db1)+'Interaction'][_0x183a('0xd')]({'where':{'id':getInteractionId(_0xbaf3ec,_0x17406f,_0x3e0db1)}})[_0x183a('0xe')](function(_0x55f00f){if(_0x55f00f){return _0x55f00f['update']({'UserId':_0x57a776?_0x57a776['id']:null});}})['then'](function(_0x5629eb){if(_0x5629eb){log('info',_0x57a776,_0xbaf3ec,_0x17406f,_0x3e0db1,_0x49d5a5);}})[_0x183a('0xf')](function(){log(_0x183a('0x10'),_0x57a776,_0xbaf3ec,_0x17406f,_0x3e0db1,_0x49d5a5);});}exports[_0x183a('0x11')]=function(_0x3d8ecc,_0x2a698d){return function(_0x26e89f,_0xf6aaa1,_0xc2c90e){var _0x2dde4b=_0x26e89f[_0x183a('0x12')];var _0x4d0d23={};var _0x34b39e=_0x26e89f['query'];if(_0x4d0d23){_0x4d0d23=_[_0x183a('0x13')](_0x26e89f[_0x183a('0x14')]);_0x4d0d23=_[_0x183a('0x15')](_0x4d0d23,[_0x183a('0x14'),_0x183a('0x16'),_0x183a('0x17'),_0x183a('0x18'),'mobile']);}updateUser(_0x2dde4b,_0x4d0d23,_0x34b39e,_0x3d8ecc,_0x2a698d);_0xc2c90e(null);};}; \ No newline at end of file +var _0x54a0=['info','tracked','query','clone','body','omit','html','phone','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','findOne','then','update'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x54a0,0x6c));var _0x054a=function(_0x4ec9a7,_0x4a75bb){_0x4ec9a7=_0x4ec9a7-0x0;var _0x4824fa=_0x54a0[_0x4ec9a7];return _0x4824fa;};'use strict';var _=require(_0x054a('0x0'));var db=require(_0x054a('0x1'))['db'];var loggers={'openchannel':require(_0x054a('0x2'))(_0x054a('0x3')),'mail':require(_0x054a('0x2'))(_0x054a('0x4')),'fax':require('../../config/logger')(_0x054a('0x5')),'sms':require(_0x054a('0x2'))('sms-interactions'),'chat':require(_0x054a('0x2'))(_0x054a('0x6')),'whatsapp':require(_0x054a('0x2'))(_0x054a('0x7'))};function getInteractionId(_0x52b65d,_0x5d3ff4,_0x59b2dc){if(_0x52b65d&&_0x52b65d[_[_0x054a('0x8')](_0x59b2dc)+_0x054a('0x9')]){return _0x52b65d[_[_0x054a('0x8')](_0x59b2dc)+'InteractionId'];}else if(_0x52b65d&&_0x52b65d['id']){return _0x52b65d['id'];}else if(_0x5d3ff4&&_0x5d3ff4['id']){return _0x5d3ff4['id'];}else{return _0x054a('0xa');}}function log(_0xb68813,_0x538f84,_0x544e76,_0x35cd4b,_0x491231,_0xb00d89){loggers[_0x491231['toLowerCase']()][_0xb68813](_0x054a('0xb'),_0xb00d89[_0x054a('0xc')](),_0x538f84?_0x538f84['id']:null,_0x538f84?_0x538f84['name']:null,_0x538f84?_0x538f84['role']:null,getInteractionId(_0x544e76,_0x35cd4b,_0x491231),_0x544e76?JSON[_0x054a('0xd')](_0x544e76):'null');}function updateUser(_0x2e1293,_0x220edc,_0x2f2311,_0x3d72d5,_0x7b5103){db[_[_0x054a('0x8')](_0x3d72d5)+'Interaction'][_0x054a('0xe')]({'where':{'id':getInteractionId(_0x220edc,_0x2f2311,_0x3d72d5)}})[_0x054a('0xf')](function(_0x1fd352){if(_0x1fd352){return _0x1fd352[_0x054a('0x10')]({'UserId':_0x2e1293?_0x2e1293['id']:null});}})[_0x054a('0xf')](function(_0x51a762){if(_0x51a762){log(_0x054a('0x11'),_0x2e1293,_0x220edc,_0x2f2311,_0x3d72d5,_0x7b5103);}})['catch'](function(){log('error',_0x2e1293,_0x220edc,_0x2f2311,_0x3d72d5,_0x7b5103);});}exports[_0x054a('0x12')]=function(_0x50cadf,_0x30a2c2){return function(_0x44328d,_0x5ce203,_0x521b51){var _0x25eabb=_0x44328d['user'];var _0x14d0d8={};var _0x353b54=_0x44328d[_0x054a('0x13')];if(_0x14d0d8){_0x14d0d8=_[_0x054a('0x14')](_0x44328d[_0x054a('0x15')]);_0x14d0d8=_[_0x054a('0x16')](_0x14d0d8,[_0x054a('0x15'),_0x054a('0x17'),_0x054a('0x18'),'fax','mobile']);}updateUser(_0x25eabb,_0x14d0d8,_0x353b54,_0x50cadf,_0x30a2c2);_0x521b51(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index dac9380..f70ce05 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 _0x0ea7=['parse','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','isUserLimit','crypto','util','composable-middleware','../../mysqldb','data1','license','split','format','%s:%s:%s','update','utf8','final'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x0ea7,0xfc));var _0x70ea=function(_0xaba0e2,_0x3d5c4f){_0xaba0e2=_0xaba0e2-0x0;var _0x5b866c=_0x0ea7[_0xaba0e2];return _0x5b866c;};'use strict';var crypto=require(_0x70ea('0x0'));var util=require(_0x70ea('0x1'));var compose=require(_0x70ea('0x2'));var db=require(_0x70ea('0x3'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x5df422,_0xf98902){if(_0x5df422&&_0xf98902){if(_0xf98902[_0x70ea('0x4')]&&_0xf98902[_0x70ea('0x5')]){var _0x4e0257=_0xf98902[_0x70ea('0x4')];var _0x337c91=_0xf98902[_0x70ea('0x5')];var _0x1cbf3c=_0x4e0257[_0x70ea('0x6')]('-')[0x4];var _0x51bbf9=_0x4e0257[_0x70ea('0x6')]('-')[0x0];var _0x2dca53=crypto['createDecipher']('aes-256-ctr',util[_0x70ea('0x7')](_0x70ea('0x8'),_0x1cbf3c,_0x4e0257,_0x51bbf9));var _0x326a7d=_0x2dca53[_0x70ea('0x9')](_0x337c91,'base64',_0x70ea('0xa'));_0x326a7d+=_0x2dca53[_0x70ea('0xb')](_0x70ea('0xa'));var _0x3a7284=JSON[_0x70ea('0xc')](_0x326a7d);return _0x3a7284['hasOwnProperty'](_0x5df422)?_0x3a7284[_0x5df422]:null;}}return null;}function isLimit(_0x1ae6e5,_0x19d35d,_0x1cc08c,_0x20c8de){var _0x49a9d0=_0x19d35d;return compose()[_0x70ea('0xd')](function(_0x5b5a0c,_0x44dc2d,_0x202df4){return db[_0x70ea('0xe')][_0x70ea('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x188d35){var _0x1717cf=getValueFromLicense(_0x1ae6e5,_0x188d35);return _0x1717cf?_0x1717cf:_0x49a9d0;})['then'](function(_0x29f5dd){_0x49a9d0=_0x29f5dd;return _0x1cc08c['count'](_0x20c8de);})[_0x70ea('0x10')](function(_0x3fce4f){if(_0x3fce4f>=_0x49a9d0){return _0x44dc2d[_0x70ea('0x11')](0x193)[_0x70ea('0x12')]({'message':util[_0x70ea('0x7')](_0x70ea('0x13'),_0x1ae6e5)});}_0x202df4();})[_0x70ea('0x14')](function(_0x285309){_0x202df4(_0x285309);});});}function isUserLimit(){return isLimit(_0x70ea('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x70ea('0x16')},{'role':'user'}]}});}exports[_0x70ea('0x17')]=isUserLimit; \ No newline at end of file +var _0x1dcc=['License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','isUserLimit','crypto','util','composable-middleware','../../config/environment','license','data1','split','aes-256-ctr','format','%s:%s:%s','update','final','utf8','parse','hasOwnProperty','use'];(function(_0x2c4153,_0x1759ba){var _0x3a36e3=function(_0xb905ba){while(--_0xb905ba){_0x2c4153['push'](_0x2c4153['shift']());}};_0x3a36e3(++_0x1759ba);}(_0x1dcc,0x8c));var _0xc1dc=function(_0x51d1b0,_0xdb4dd9){_0x51d1b0=_0x51d1b0-0x0;var _0x4de6ed=_0x1dcc[_0x51d1b0];return _0x4de6ed;};'use strict';var crypto=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var compose=require(_0xc1dc('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xc1dc('0x3'));function getValueFromLicense(_0x1d797f,_0xda6bb){if(_0x1d797f&&_0xda6bb){if(_0xda6bb['data1']&&_0xda6bb[_0xc1dc('0x4')]){var _0x59e624=_0xda6bb[_0xc1dc('0x5')];var _0x7ec0fe=_0xda6bb[_0xc1dc('0x4')];var _0x155803=_0x59e624['split']('-')[0x4];var _0x3168f8=_0x59e624[_0xc1dc('0x6')]('-')[0x0];var _0x128d3c=crypto['createDecipher'](_0xc1dc('0x7'),util[_0xc1dc('0x8')](_0xc1dc('0x9'),_0x155803,_0x59e624,_0x3168f8));var _0x5208aa=_0x128d3c[_0xc1dc('0xa')](_0x7ec0fe,'base64','utf8');_0x5208aa+=_0x128d3c[_0xc1dc('0xb')](_0xc1dc('0xc'));var _0x775fea=JSON[_0xc1dc('0xd')](_0x5208aa);return _0x775fea[_0xc1dc('0xe')](_0x1d797f)?_0x775fea[_0x1d797f]:null;}}return null;}function isLimit(_0x27d4ca,_0x32fcc0,_0x5709cc,_0x144e89){var _0x9b64c9=_0x32fcc0;return compose()[_0xc1dc('0xf')](function(_0x399f01,_0x757cb7,_0x184917){return db[_0xc1dc('0x10')][_0xc1dc('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xc1dc('0x12')](function(_0x13d79e){var _0x584d9e=getValueFromLicense(_0x27d4ca,_0x13d79e);return _0x584d9e?_0x584d9e:_0x9b64c9;})[_0xc1dc('0x12')](function(_0x2ff29b){_0x9b64c9=_0x2ff29b;return _0x5709cc[_0xc1dc('0x13')](_0x144e89);})[_0xc1dc('0x12')](function(_0x6d3d4){if(_0x6d3d4>=_0x9b64c9){return _0x757cb7[_0xc1dc('0x14')](0x193)[_0xc1dc('0x15')]({'message':util[_0xc1dc('0x8')](_0xc1dc('0x16'),_0x27d4ca)});}_0x184917();})[_0xc1dc('0x17')](function(_0x5cd764){_0x184917(_0x5cd764);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc1dc('0x18')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xc1dc('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index c6902df..6394553 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 _0xfcb3=['moment','parseSearch','startsWith','and','[$and]','replace','[$or]','split','length','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','DATE','operator','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$notIn','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$ne','<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','$in','start','$startsWith','pop','utcOffset','minutes','seconds','lodash'];(function(_0x1552bc,_0x20c651){var _0xd55ef9=function(_0x516f4c){while(--_0x516f4c){_0x1552bc['push'](_0x1552bc['shift']());}};_0xd55ef9(++_0x20c651);}(_0xfcb3,0x9e));var _0x3fcb=function(_0x436266,_0x37c497){_0x436266=_0x436266-0x0;var _0x544a9d=_0xfcb3[_0x436266];return _0x544a9d;};'use strict';var _=require(_0x3fcb('0x0'));var moment=require(_0x3fcb('0x1'));exports[_0x3fcb('0x2')]=function(_0x460bec){var _0x9c996c={'conditions':[]};_0x9c996c['sqlOperator']=_[_0x3fcb('0x3')](_0x460bec,'[$or]')?'or':_0x3fcb('0x4');var _0x3e4d16=_0x460bec['replace'](_0x3fcb('0x5'),'')[_0x3fcb('0x6')](_0x3fcb('0x7'),'')[_0x3fcb('0x8')]('||');for(var _0x58122b=0x0;_0x58122b<_0x3e4d16[_0x3fcb('0x9')];_0x58122b++){var _0x59bc7e=_0x3e4d16[_0x58122b][_0x3fcb('0x8')](':=');var _0x32114f=_0x59bc7e[0x0];var _0x576b7=_0x59bc7e[_0x3fcb('0xa')](0x1);_0x576b7[_0x3fcb('0xb')](function(_0x2453a5){var _0x167827=_0x2453a5[_0x3fcb('0x8')]('[')[_0x3fcb('0xc')]();var _0x5b5fbc=_0x2453a5[_0x3fcb('0xd')](/\[(.*?)\]/g);_0x5b5fbc[_0x3fcb('0xb')](function(_0xf408fc){var _0x48e885=_0xf408fc[_0x3fcb('0x8')]('[')[_0x3fcb('0xe')](function(_0x1cb0f4){return _0x1cb0f4[_0x3fcb('0xf')](']')>-0x1;})[_0x3fcb('0x10')](function(_0x4e9d48){return _0x4e9d48[_0x3fcb('0x8')](']')[0x0];})[0x0];_0x9c996c['conditions'][_0x3fcb('0x11')]({'field':_0x32114f,'operator':_0x167827,'value':_0x48e885});});});}return _0x9c996c;};exports[_0x3fcb('0x12')]=function(_0x489a35,_0x56459e,_0x3b06d5){var _0x199186={};if(_0x56459e===_0x3fcb('0x13')){if(_0x3b06d5['operator']==='$eq'){_0x3b06d5[_0x3fcb('0x14')]='$between';_0x3b06d5['value']+=','+_0x3b06d5[_0x3fcb('0x15')];}else if(_['includes'](['$gt',_0x3fcb('0x16')],_0x3b06d5[_0x3fcb('0x14')])){_0x3b06d5[_0x3fcb('0x15')]=moment(_0x3b06d5[_0x3fcb('0x15')])[_0x3fcb('0x17')](0x1,_0x3fcb('0x18'))[_0x3fcb('0x19')](_0x3fcb('0x1a'));}}if(_0x3b06d5[_0x3fcb('0x1b')]){_0x56459e=_0x3b06d5['castTo'];_0x199186[_0x3fcb('0x1c')]='CAST('+_0x489a35+'.'+_0x3b06d5[_0x3fcb('0x1d')]+_0x3fcb('0x1e')+_0x3b06d5['castTo']+')\x20'+parseOperator(_0x3b06d5[_0x3fcb('0x14')]);}else{_0x199186['text']=_0x489a35+'.'+_0x3b06d5['field']+'\x20'+parseOperator(_0x3b06d5[_0x3fcb('0x14')]);}if(_['includes'](['$ne',_0x3fcb('0x1f')],_0x3b06d5['operator']))_0x199186[_0x3fcb('0x1c')]='('+_0x199186[_0x3fcb('0x1c')]+'\x20OR\x20'+_0x489a35+'.'+_0x3b06d5[_0x3fcb('0x1d')]+_0x3fcb('0x20');_0x199186[_0x3fcb('0x15')]=parseValue(_0x56459e,_0x3b06d5['operator'],_0x3b06d5['value']);return _0x199186;};function parseOperator(_0x57a956){var _0x2cddfd;switch(_0x57a956){case'$in':_0x2cddfd=_0x3fcb('0x21');break;case'$notIn':_0x2cddfd=_0x3fcb('0x22');break;case'$eq':_0x2cddfd='=\x20?';break;case _0x3fcb('0x23'):_0x2cddfd=_0x3fcb('0x24');break;case _0x3fcb('0x25'):case'$startsWith':case _0x3fcb('0x26'):_0x2cddfd=_0x3fcb('0x27');break;case _0x3fcb('0x28'):_0x2cddfd='<\x20?';break;case'$gt':_0x2cddfd=_0x3fcb('0x29');break;case'$lte':_0x2cddfd=_0x3fcb('0x2a');break;case _0x3fcb('0x2b'):_0x2cddfd='>=\x20?';break;case _0x3fcb('0x2c'):_0x2cddfd=_0x3fcb('0x2d');break;}return _0x2cddfd;}function parseValue(_0x111889,_0x161a09,_0x3f4019){var _0x1de261={'start':undefined,'end':undefined};switch(_0x161a09){case _0x3fcb('0x2e'):case _0x3fcb('0x1f'):_0x1de261[_0x3fcb('0x2f')]=_0x3f4019['split'](',');break;case _0x3fcb('0x25'):_0x1de261[_0x3fcb('0x2f')]='%'+_0x3f4019+'%';break;case _0x3fcb('0x30'):_0x1de261['start']=_0x3f4019+'%';break;case _0x3fcb('0x26'):_0x1de261[_0x3fcb('0x2f')]='%'+_0x3f4019;break;case _0x3fcb('0x2c'):var _0x380948=_0x3f4019['split'](',');var _0x3f4019=_0x380948[_0x3fcb('0xc')]();var _0x3af81f=_0x380948[_0x3fcb('0x31')]();if(_0x111889===_0x3fcb('0x13')){_0x3f4019=moment(_0x3f4019)[_0x3fcb('0x32')](0x0,!![])['format']();_0x3af81f=moment(_0x3af81f)[_0x3fcb('0x32')](0x0,!![])[_0x3fcb('0x17')](0x17,'hours')[_0x3fcb('0x17')](0x3b,_0x3fcb('0x33'))['add'](0x3b,_0x3fcb('0x34'))[_0x3fcb('0x19')]();}_0x1de261={'start':_0x3f4019,'end':_0x3af81f};break;default:_0x1de261[_0x3fcb('0x2f')]=_0x3f4019;break;}return _0x1de261;} \ No newline at end of file +var _0xce98=['<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','$endsWith','pop','utcOffset','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','replace','[$and]','length','split','slice','shift','match','filter','indexOf','push','buildExpression','DATE','operator','$eq','$between','value','$gt','$lte','add','format','castTo','CAST(','field','\x20AS\x20','text','includes','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','=\x20?','$ne','$substring','$lt','<\x20?','>\x20?'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xce98,0xdf));var _0x8ce9=function(_0x28cb51,_0x4e4b03){_0x28cb51=_0x28cb51-0x0;var _0x494d51=_0xce98[_0x28cb51];return _0x494d51;};'use strict';var _=require(_0x8ce9('0x0'));var moment=require(_0x8ce9('0x1'));exports[_0x8ce9('0x2')]=function(_0x3e18fb){var _0x23b40e={'conditions':[]};_0x23b40e[_0x8ce9('0x3')]=_['startsWith'](_0x3e18fb,_0x8ce9('0x4'))?'or':'and';var _0xa3bed9=_0x3e18fb[_0x8ce9('0x5')](_0x8ce9('0x6'),'')[_0x8ce9('0x5')](_0x8ce9('0x4'),'')['split']('||');for(var _0x5749a6=0x0;_0x5749a6<_0xa3bed9[_0x8ce9('0x7')];_0x5749a6++){var _0x4fbb8e=_0xa3bed9[_0x5749a6][_0x8ce9('0x8')](':=');var _0x54bb46=_0x4fbb8e[0x0];var _0xd047ac=_0x4fbb8e[_0x8ce9('0x9')](0x1);_0xd047ac['forEach'](function(_0x514d9b){var _0x2ddc1a=_0x514d9b[_0x8ce9('0x8')]('[')[_0x8ce9('0xa')]();var _0x4a51dd=_0x514d9b[_0x8ce9('0xb')](/\[(.*?)\]/g);_0x4a51dd['forEach'](function(_0x572c6f){var _0x2658c3=_0x572c6f[_0x8ce9('0x8')]('[')[_0x8ce9('0xc')](function(_0x10cb19){return _0x10cb19[_0x8ce9('0xd')](']')>-0x1;})['map'](function(_0x50b0df){return _0x50b0df[_0x8ce9('0x8')](']')[0x0];})[0x0];_0x23b40e['conditions'][_0x8ce9('0xe')]({'field':_0x54bb46,'operator':_0x2ddc1a,'value':_0x2658c3});});});}return _0x23b40e;};exports[_0x8ce9('0xf')]=function(_0x2c02f4,_0x21985d,_0x39ce23){var _0x2f51d9={};if(_0x21985d===_0x8ce9('0x10')){if(_0x39ce23[_0x8ce9('0x11')]===_0x8ce9('0x12')){_0x39ce23['operator']=_0x8ce9('0x13');_0x39ce23[_0x8ce9('0x14')]+=','+_0x39ce23[_0x8ce9('0x14')];}else if(_['includes']([_0x8ce9('0x15'),_0x8ce9('0x16')],_0x39ce23[_0x8ce9('0x11')])){_0x39ce23[_0x8ce9('0x14')]=moment(_0x39ce23[_0x8ce9('0x14')])[_0x8ce9('0x17')](0x1,'days')[_0x8ce9('0x18')]('YYYY-MM-DD');}}if(_0x39ce23[_0x8ce9('0x19')]){_0x21985d=_0x39ce23[_0x8ce9('0x19')];_0x2f51d9['text']=_0x8ce9('0x1a')+_0x2c02f4+'.'+_0x39ce23[_0x8ce9('0x1b')]+_0x8ce9('0x1c')+_0x39ce23[_0x8ce9('0x19')]+')\x20'+parseOperator(_0x39ce23[_0x8ce9('0x11')]);}else{_0x2f51d9[_0x8ce9('0x1d')]=_0x2c02f4+'.'+_0x39ce23[_0x8ce9('0x1b')]+'\x20'+parseOperator(_0x39ce23[_0x8ce9('0x11')]);}if(_[_0x8ce9('0x1e')](['$ne','$notIn'],_0x39ce23[_0x8ce9('0x11')]))_0x2f51d9['text']='('+_0x2f51d9[_0x8ce9('0x1d')]+_0x8ce9('0x1f')+_0x2c02f4+'.'+_0x39ce23[_0x8ce9('0x1b')]+_0x8ce9('0x20');_0x2f51d9[_0x8ce9('0x14')]=parseValue(_0x21985d,_0x39ce23[_0x8ce9('0x11')],_0x39ce23[_0x8ce9('0x14')]);return _0x2f51d9;};function parseOperator(_0x344be9){var _0x49673a;switch(_0x344be9){case _0x8ce9('0x21'):_0x49673a=_0x8ce9('0x22');break;case _0x8ce9('0x23'):_0x49673a='NOT\x20IN\x20?';break;case _0x8ce9('0x12'):_0x49673a=_0x8ce9('0x24');break;case _0x8ce9('0x25'):_0x49673a='<>\x20?';break;case _0x8ce9('0x26'):case'$startsWith':case'$endsWith':_0x49673a='LIKE\x20?';break;case _0x8ce9('0x27'):_0x49673a=_0x8ce9('0x28');break;case _0x8ce9('0x15'):_0x49673a=_0x8ce9('0x29');break;case _0x8ce9('0x16'):_0x49673a=_0x8ce9('0x2a');break;case _0x8ce9('0x2b'):_0x49673a=_0x8ce9('0x2c');break;case _0x8ce9('0x13'):_0x49673a=_0x8ce9('0x2d');break;}return _0x49673a;}function parseValue(_0x318f97,_0x317c18,_0x173229){var _0x42a7f7={'start':undefined,'end':undefined};switch(_0x317c18){case'$in':case _0x8ce9('0x23'):_0x42a7f7[_0x8ce9('0x2e')]=_0x173229[_0x8ce9('0x8')](',');break;case _0x8ce9('0x26'):_0x42a7f7['start']='%'+_0x173229+'%';break;case _0x8ce9('0x2f'):_0x42a7f7[_0x8ce9('0x2e')]=_0x173229+'%';break;case _0x8ce9('0x30'):_0x42a7f7[_0x8ce9('0x2e')]='%'+_0x173229;break;case _0x8ce9('0x13'):var _0x1a2817=_0x173229['split'](',');var _0x173229=_0x1a2817[_0x8ce9('0xa')]();var _0x2160ef=_0x1a2817[_0x8ce9('0x31')]();if(_0x318f97===_0x8ce9('0x10')){_0x173229=moment(_0x173229)[_0x8ce9('0x32')](0x0,!![])[_0x8ce9('0x18')]();_0x2160ef=moment(_0x2160ef)[_0x8ce9('0x32')](0x0,!![])[_0x8ce9('0x17')](0x17,'hours')[_0x8ce9('0x17')](0x3b,_0x8ce9('0x33'))[_0x8ce9('0x17')](0x3b,_0x8ce9('0x34'))[_0x8ce9('0x18')]();}_0x42a7f7={'start':_0x173229,'end':_0x2160ef};break;default:_0x42a7f7[_0x8ce9('0x2e')]=_0x173229;break;}return _0x42a7f7;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index b2335d5..952f2e2 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 _0x24ca=['format','YYYY-MM-DD','utc','$lte','subtract','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','isEmail','push','getOptions','query','$id','model','map','name','filters','intersection','attributes','fields','hasOwnProperty','order','where','filter','columns','merge','type','VIRTUAL','lower','options','lodash','moment','parse','keys','includes','split','isEmpty','forOwn','find','DATE','isPlainObject','$gte'];(function(_0x1fdac8,_0x208f54){var _0x2caefd=function(_0xea5068){while(--_0xea5068){_0x1fdac8['push'](_0x1fdac8['shift']());}};_0x2caefd(++_0x208f54);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0x24ca[_0x1f0679];return _0x3dc3a4;};'use strict';var _=require(_0xa24c('0x0'));var sequelize=require('sequelize');var moment=require(_0xa24c('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4ebab4){var _0x4defb1=['ne'];try{var _0x5876d6=JSON[_0xa24c('0x2')](_0x4ebab4);var _0x8a54a0=Object[_0xa24c('0x3')](_0x5876d6)[0x0];return _0x4defb1[_0xa24c('0x4')](_0x8a54a0);}catch(_0xe76a30){return![];}}function getOperatorValue(_0x15a5cd){var _0xf0511=JSON[_0xa24c('0x2')](_0x15a5cd);var _0x2dd348=Object[_0xa24c('0x3')](_0xf0511)[0x0];var _0x9a5013=_0xf0511[_0x2dd348];return{['$'+_0x2dd348]:_0x9a5013};}exports['fields']=function(_0x42d89c){var _0x3a5727=null;if(_0x42d89c){_0x3a5727=_0x42d89c[_0xa24c('0x5')](',');}return _0x3a5727;};exports['filters']=function(_0x399f32,_0x325c6d){var _0x288f76={};if(!_[_0xa24c('0x6')](_0x399f32)){_[_0xa24c('0x7')](_0x399f32,function(_0x43aa5a,_0x1a71a8){try{if(_0x325c6d){var _0xc82af0=_[_0xa24c('0x8')](_0x325c6d,{'name':_0x1a71a8})||{};if(hasSequelizeOperator(_0x43aa5a)){_0x288f76[_0x1a71a8]=getOperatorValue(_0x43aa5a);}else if(_0xc82af0['type']===_0xa24c('0x9')&&_[_0xa24c('0xa')](_0x43aa5a)){var _0xcee4fe=JSON[_0xa24c('0x2')](_0x43aa5a);var _0x5a9486={'$gte':moment(moment(_0xcee4fe[_0xa24c('0xb')])[_0xa24c('0xc')](_0xa24c('0xd')))[_0xa24c('0xe')]()[_0xa24c('0xc')](),'$lte':moment(moment(_0xcee4fe[_0xa24c('0xf')])[_0xa24c('0xc')]('YYYY-MM-DD'))['utc']()[_0xa24c('0x10')](0x1,'s')[_0xa24c('0xc')]()};_0x288f76[_0x1a71a8]=_0x5a9486;}else if(_0xc82af0['name']==='uniqueid'){_0x288f76[_0x1a71a8]=_0x43aa5a;}else{_0x288f76[_0x1a71a8]=_[_0xa24c('0x11')](_0x43aa5a)?_0x43aa5a:JSON[_0xa24c('0x2')](_0x43aa5a);}}else{_0x288f76[_0x1a71a8]=_['isArray'](_0x43aa5a)?_0x43aa5a:JSON[_0xa24c('0x2')](_0x43aa5a);}}catch(_0x5de3e6){_0x288f76[_0x1a71a8]=_0x43aa5a[_0xa24c('0x5')](',');}});}return _0x288f76;};exports[_0xa24c('0x12')]=function(_0x1fcd4b){_0x1fcd4b=parseInt(_0x1fcd4b,0xa);if(!_0x1fcd4b||_0x1fcd4b<0x0){_0x1fcd4b=LIMIT_VALUE;}return _0x1fcd4b;};exports[_0xa24c('0x13')]=function(_0x4ff97c){_0x4ff97c=parseInt(_0x4ff97c,0xa);if(!_0x4ff97c||_0x4ff97c<0x0){_0x4ff97c=0x0;}return _0x4ff97c;};exports[_0xa24c('0x14')]=function(_0x18b7e0){var _0x773f70,_0x4d4bab=null;if(_0x18b7e0){_0x773f70=_0x18b7e0['split'](',');_0x4d4bab=_['map'](_0x773f70,function(_0x4cd77e){if(_0x4cd77e[_0xa24c('0x15')]('-')===0x0){return[_0x4cd77e===_0xa24c('0x16')?sequelize[_0xa24c('0x17')](sequelize[_0xa24c('0x18')]('priority'),_0xa24c('0x19')):_0x4cd77e['substr'](0x1),_0xa24c('0x1a')];}else{return[_0x4cd77e===_0xa24c('0x16')?sequelize['cast'](sequelize[_0xa24c('0x18')](_0xa24c('0x16')),_0xa24c('0x19')):_0x4cd77e,_0xa24c('0x1b')];}});}return _0x4d4bab;};exports[_0xa24c('0x1c')]=function(_0x47e0eb,_0xec9167){if(_['isEmpty'](_0x47e0eb)){return _0x47e0eb;}if(_[_0xa24c('0x11')](_0x47e0eb)){for(var _0x3951ae=0x0;_0x3951ae<_0x47e0eb[_0xa24c('0x1d')];_0x3951ae+=0x1){_0x47e0eb[_0x3951ae]=this['omit'](_0x47e0eb[_0x3951ae],_0xec9167);}return _0x47e0eb;}if(!_[_0xa24c('0x1e')](_0x47e0eb)){return _0x47e0eb;}if(_[_0xa24c('0x1f')](_0xec9167)){_0xec9167=[_0xec9167];}if(!_[_0xa24c('0x11')](_0xec9167)){return _0x47e0eb;}for(var _0x314121=0x0;_0x314121<_0xec9167[_0xa24c('0x1d')];_0x314121+=0x1){_[_0xa24c('0x20')](_0x47e0eb,_0xec9167[_0x314121]);}for(var _0x39609a in _0x47e0eb){if(_0x47e0eb['hasOwnProperty'](_0x39609a)){_0x47e0eb[_0x39609a]=this[_0xa24c('0x1c')](_0x47e0eb[_0x39609a],_0xec9167);}}return _0x47e0eb;};exports[_0xa24c('0x21')]=function(_0x152120){return _0x152120[_0xa24c('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xa24c('0x23')]=function(_0xc96ce7){return _0xc96ce7[_0xa24c('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x15eaaf){var _0x3dcb1b=[];_0x15eaaf[_0xa24c('0x5')](/[ ,]+/)['forEach'](function(_0x245fb2){_0x245fb2=_0x245fb2['replace'](/([^:]")"+/g,'$1');_0x245fb2='+'+_0x245fb2+'*';var _0x1102ab=/[ `!@#$%^&*()_\-?~]/;if(_0x245fb2[_0xa24c('0x22')](_0x1102ab))_0x245fb2='\x22'+_0x245fb2+'\x22';_0x3dcb1b[_0xa24c('0x24')](_0x245fb2);});return _0x3dcb1b['join']('\x20');};exports[_0xa24c('0x25')]=function(_0x53f90,_0x1d0379,_0x52572f){var _0x1c1ed3={},_0x57c340={};if(_0x1d0379[_0xa24c('0x26')][_0xa24c('0x27')]){_0x1d0379['query']['id']=_0x1d0379['query'][_0xa24c('0x27')];delete _0x1d0379[_0xa24c('0x26')][_0xa24c('0x27')];}_0x1c1ed3[_0xa24c('0x28')]=_[_0xa24c('0x29')](_0x53f90,_0xa24c('0x2a'));_0x1c1ed3[_0xa24c('0x26')]=_['keys'](_0x1d0379[_0xa24c('0x26')]);_0x1c1ed3[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x1c1ed3[_0xa24c('0x28')],_0x1c1ed3[_0xa24c('0x26')]);_0x57c340[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x1c1ed3[_0xa24c('0x28')],this[_0xa24c('0x2e')](_0x1d0379[_0xa24c('0x26')]['fields']));_0x57c340[_0xa24c('0x2d')]=_0x57c340[_0xa24c('0x2d')][_0xa24c('0x1d')]?_0x57c340[_0xa24c('0x2d')]:_0x1c1ed3['model'];if(!_0x1d0379['query'][_0xa24c('0x2f')]('nolimit')){_0x57c340[_0xa24c('0x12')]=this[_0xa24c('0x12')](_0x1d0379[_0xa24c('0x26')][_0xa24c('0x12')]);_0x57c340[_0xa24c('0x13')]=this['offset'](_0x1d0379['query'][_0xa24c('0x13')]);}_0x57c340[_0xa24c('0x30')]=this[_0xa24c('0x14')](_0x1d0379[_0xa24c('0x26')][_0xa24c('0x14')]);_0x57c340[_0xa24c('0x31')]=this['filters'](_['pick'](_0x1d0379[_0xa24c('0x26')],_0x1c1ed3[_0xa24c('0x2b')]),_0x53f90);if(_0x1d0379[_0xa24c('0x26')][_0xa24c('0x32')]){var _0x43beff=_0x53f90;var _0x4c5b7e=_0x1d0379[_0xa24c('0x26')][_0xa24c('0x32')];if(typeof _0x4c5b7e==='object'){_0x43beff=_['filter'](_0x53f90,function(_0xba7407){return _[_0xa24c('0x4')](_0x4c5b7e[_0xa24c('0x33')],_0xba7407['name']);});_0x4c5b7e=_0x4c5b7e['value'];}_0x57c340[_0xa24c('0x31')]=_[_0xa24c('0x34')](_0x57c340[_0xa24c('0x31')],{'$or':_[_0xa24c('0x29')](_0x43beff,function(_0x3f640e){if(_0x3f640e[_0xa24c('0x35')]!==_0xa24c('0x36')){if(_0x52572f){return sequelize[_0xa24c('0x31')](sequelize['fn']('lower',sequelize['col'](_0x3f640e[_0xa24c('0x2a')])),{'$like':sequelize['fn'](_0xa24c('0x37'),'%'+_0x1d0379[_0xa24c('0x26')]['filter']+'%')});}else{var _0x472c1e={};_0x472c1e[_0x3f640e[_0xa24c('0x2a')]]={'$like':'%'+_0x1d0379[_0xa24c('0x26')][_0xa24c('0x32')]+'%'};return _0x472c1e;}}})});}_0x57c340=_[_0xa24c('0x34')]({},_0x57c340,_0x1d0379[_0xa24c('0x38')]);return _0x57c340;}; \ No newline at end of file +var _0xae24=['query','$id','intersection','model','attributes','fields','nolimit','offset','order','where','pick','filter','includes','columns','value','VIRTUAL','lower','col','merge','options','lodash','moment','keys','parse','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','split','limit','sort','map','indexOf','cast','unsigned','substr','DESC','priority','ASC','omit','length','isObject','unset','hasOwnProperty','match','getFullTextValue','forEach','replace','push','join','getOptions'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xae24,0x182));var _0x4ae2=function(_0x2e30ff,_0x2c7323){_0x2e30ff=_0x2e30ff-0x0;var _0x4d3710=_0xae24[_0x2e30ff];return _0x4d3710;};'use strict';var _=require(_0x4ae2('0x0'));var sequelize=require('sequelize');var moment=require(_0x4ae2('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4997b0){var _0xf4c45d=['ne'];try{var _0x1bf293=JSON['parse'](_0x4997b0);var _0x5b6f4d=Object[_0x4ae2('0x2')](_0x1bf293)[0x0];return _0xf4c45d['includes'](_0x5b6f4d);}catch(_0x2ed9ff){return![];}}function getOperatorValue(_0xf26f45){var _0x20c85c=JSON[_0x4ae2('0x3')](_0xf26f45);var _0x428054=Object[_0x4ae2('0x2')](_0x20c85c)[0x0];var _0x4f2e84=_0x20c85c[_0x428054];return{['$'+_0x428054]:_0x4f2e84};}exports['fields']=function(_0x41cdf1){var _0x4d3d8a=null;if(_0x41cdf1){_0x4d3d8a=_0x41cdf1['split'](',');}return _0x4d3d8a;};exports[_0x4ae2('0x4')]=function(_0xb01e8e,_0x5c32b7){var _0x3b3acc={};if(!_[_0x4ae2('0x5')](_0xb01e8e)){_[_0x4ae2('0x6')](_0xb01e8e,function(_0xb70265,_0x52458f){try{if(_0x5c32b7){var _0x19b222=_[_0x4ae2('0x7')](_0x5c32b7,{'name':_0x52458f})||{};if(hasSequelizeOperator(_0xb70265)){_0x3b3acc[_0x52458f]=getOperatorValue(_0xb70265);}else if(_0x19b222[_0x4ae2('0x8')]==='DATE'&&_[_0x4ae2('0x9')](_0xb70265)){var _0x22ac1e=JSON[_0x4ae2('0x3')](_0xb70265);var _0x3c70bd={'$gte':moment(moment(_0x22ac1e[_0x4ae2('0xa')])[_0x4ae2('0xb')](_0x4ae2('0xc')))[_0x4ae2('0xd')]()[_0x4ae2('0xb')](),'$lte':moment(moment(_0x22ac1e['$lte'])['format']('YYYY-MM-DD'))[_0x4ae2('0xd')]()[_0x4ae2('0xe')](0x1,'s')['format']()};_0x3b3acc[_0x52458f]=_0x3c70bd;}else if(_0x19b222[_0x4ae2('0xf')]===_0x4ae2('0x10')){_0x3b3acc[_0x52458f]=_0xb70265;}else{_0x3b3acc[_0x52458f]=_[_0x4ae2('0x11')](_0xb70265)?_0xb70265:JSON[_0x4ae2('0x3')](_0xb70265);}}else{_0x3b3acc[_0x52458f]=_[_0x4ae2('0x11')](_0xb70265)?_0xb70265:JSON[_0x4ae2('0x3')](_0xb70265);}}catch(_0x3d4259){_0x3b3acc[_0x52458f]=_0xb70265[_0x4ae2('0x12')](',');}});}return _0x3b3acc;};exports[_0x4ae2('0x13')]=function(_0x18936a){_0x18936a=parseInt(_0x18936a,0xa);if(!_0x18936a||_0x18936a<0x0){_0x18936a=LIMIT_VALUE;}return _0x18936a;};exports['offset']=function(_0x4a97af){_0x4a97af=parseInt(_0x4a97af,0xa);if(!_0x4a97af||_0x4a97af<0x0){_0x4a97af=0x0;}return _0x4a97af;};exports[_0x4ae2('0x14')]=function(_0x2d910c){var _0x51e20c,_0x45c1bf=null;if(_0x2d910c){_0x51e20c=_0x2d910c[_0x4ae2('0x12')](',');_0x45c1bf=_[_0x4ae2('0x15')](_0x51e20c,function(_0x2ad222){if(_0x2ad222[_0x4ae2('0x16')]('-')===0x0){return[_0x2ad222==='priority'?sequelize[_0x4ae2('0x17')](sequelize['col']('priority'),_0x4ae2('0x18')):_0x2ad222[_0x4ae2('0x19')](0x1),_0x4ae2('0x1a')];}else{return[_0x2ad222===_0x4ae2('0x1b')?sequelize[_0x4ae2('0x17')](sequelize['col'](_0x4ae2('0x1b')),'unsigned'):_0x2ad222,_0x4ae2('0x1c')];}});}return _0x45c1bf;};exports[_0x4ae2('0x1d')]=function(_0x130239,_0x57933b){if(_[_0x4ae2('0x5')](_0x130239)){return _0x130239;}if(_[_0x4ae2('0x11')](_0x130239)){for(var _0x2454b3=0x0;_0x2454b3<_0x130239[_0x4ae2('0x1e')];_0x2454b3+=0x1){_0x130239[_0x2454b3]=this[_0x4ae2('0x1d')](_0x130239[_0x2454b3],_0x57933b);}return _0x130239;}if(!_[_0x4ae2('0x1f')](_0x130239)){return _0x130239;}if(_['isString'](_0x57933b)){_0x57933b=[_0x57933b];}if(!_['isArray'](_0x57933b)){return _0x130239;}for(var _0x9508d7=0x0;_0x9508d7<_0x57933b[_0x4ae2('0x1e')];_0x9508d7+=0x1){_[_0x4ae2('0x20')](_0x130239,_0x57933b[_0x9508d7]);}for(var _0x329588 in _0x130239){if(_0x130239[_0x4ae2('0x21')](_0x329588)){_0x130239[_0x329588]=this[_0x4ae2('0x1d')](_0x130239[_0x329588],_0x57933b);}}return _0x130239;};exports['isNumeric']=function(_0x5ec1fd){return _0x5ec1fd[_0x4ae2('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x5e9f03){return _0x5e9f03[_0x4ae2('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x4ae2('0x23')]=function(_0x55fafd){var _0x883fd5=[];_0x55fafd[_0x4ae2('0x12')](/[ ,]+/)[_0x4ae2('0x24')](function(_0x146bc2){_0x146bc2=_0x146bc2[_0x4ae2('0x25')](/([^:]")"+/g,'$1');_0x146bc2='+'+_0x146bc2+'*';var _0x23f954=/[ `!@#$%^&*()_\-?~]/;if(_0x146bc2[_0x4ae2('0x22')](_0x23f954))_0x146bc2='\x22'+_0x146bc2+'\x22';_0x883fd5[_0x4ae2('0x26')](_0x146bc2);});return _0x883fd5[_0x4ae2('0x27')]('\x20');};exports[_0x4ae2('0x28')]=function(_0x386687,_0x12815f,_0x3ab303){var _0x27c6d4={},_0x548a1={};if(_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x2a')]){_0x12815f['query']['id']=_0x12815f[_0x4ae2('0x29')]['$id'];delete _0x12815f[_0x4ae2('0x29')][_0x4ae2('0x2a')];}_0x27c6d4['model']=_[_0x4ae2('0x15')](_0x386687,_0x4ae2('0xf'));_0x27c6d4[_0x4ae2('0x29')]=_[_0x4ae2('0x2')](_0x12815f['query']);_0x27c6d4[_0x4ae2('0x4')]=_[_0x4ae2('0x2b')](_0x27c6d4[_0x4ae2('0x2c')],_0x27c6d4[_0x4ae2('0x29')]);_0x548a1[_0x4ae2('0x2d')]=_[_0x4ae2('0x2b')](_0x27c6d4[_0x4ae2('0x2c')],this[_0x4ae2('0x2e')](_0x12815f[_0x4ae2('0x29')]['fields']));_0x548a1[_0x4ae2('0x2d')]=_0x548a1['attributes'][_0x4ae2('0x1e')]?_0x548a1[_0x4ae2('0x2d')]:_0x27c6d4[_0x4ae2('0x2c')];if(!_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x21')](_0x4ae2('0x2f'))){_0x548a1['limit']=this[_0x4ae2('0x13')](_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x13')]);_0x548a1[_0x4ae2('0x30')]=this['offset'](_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x30')]);}_0x548a1[_0x4ae2('0x31')]=this[_0x4ae2('0x14')](_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x14')]);_0x548a1[_0x4ae2('0x32')]=this[_0x4ae2('0x4')](_[_0x4ae2('0x33')](_0x12815f[_0x4ae2('0x29')],_0x27c6d4[_0x4ae2('0x4')]),_0x386687);if(_0x12815f['query'][_0x4ae2('0x34')]){var _0x3f0b3f=_0x386687;var _0x23f120=_0x12815f[_0x4ae2('0x29')]['filter'];if(typeof _0x23f120==='object'){_0x3f0b3f=_[_0x4ae2('0x34')](_0x386687,function(_0x45527a){return _[_0x4ae2('0x35')](_0x23f120[_0x4ae2('0x36')],_0x45527a['name']);});_0x23f120=_0x23f120[_0x4ae2('0x37')];}_0x548a1[_0x4ae2('0x32')]=_['merge'](_0x548a1[_0x4ae2('0x32')],{'$or':_[_0x4ae2('0x15')](_0x3f0b3f,function(_0x11a5d9){if(_0x11a5d9['type']!==_0x4ae2('0x38')){if(_0x3ab303){return sequelize[_0x4ae2('0x32')](sequelize['fn'](_0x4ae2('0x39'),sequelize[_0x4ae2('0x3a')](_0x11a5d9[_0x4ae2('0xf')])),{'$like':sequelize['fn'](_0x4ae2('0x39'),'%'+_0x12815f[_0x4ae2('0x29')][_0x4ae2('0x34')]+'%')});}else{var _0x5cce26={};_0x5cce26[_0x11a5d9[_0x4ae2('0xf')]]={'$like':'%'+_0x12815f[_0x4ae2('0x29')]['filter']+'%'};return _0x5cce26;}}})});}_0x548a1=_[_0x4ae2('0x3b')]({},_0x548a1,_0x12815f[_0x4ae2('0x3c')]);return _0x548a1;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 1032df2..74c0911 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x5b9860,_0x6decaf){var _0x7906d7=function(_0x3a814c){while(--_0x3a814c){_0x5b9860['push'](_0x5b9860['shift']());}};_0x7906d7(++_0x6decaf);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x1c6471,_0x29f86e){var _0x474a68=function(_0x2a14d4){while(--_0x2a14d4){_0x1c6471['push'](_0x1c6471['shift']());}};_0x474a68(++_0x29f86e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index ef6cdfe..97ecca3 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 _0x7039=['networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','model','createHash','md5','getUuid','licenseToken','win32','dmidecode\x20--string\x20system-uuid','replace','ipAddress','digest','hex','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7039,0x14e));var _0x9703=function(_0x2d97b4,_0x487b11){_0x2d97b4=_0x2d97b4-0x0;var _0x3ff911=_0x7039[_0x2d97b4];return _0x3ff911;};'use strict';var _=require(_0x9703('0x0'));var os=require('os');var crypto=require(_0x9703('0x1'));var machine=require(_0x9703('0x2'));var exec=require(_0x9703('0x3'))[_0x9703('0x4')];var config=require(_0x9703('0x5'));function getInterfaces(){var _0x21f2b4=[];var _0xa616bd=os[_0x9703('0x6')]();var _0x2e1652=_[_0x9703('0x7')](_[_0x9703('0x8')](_0xa616bd));for(var _0x122f22=0x0;_0x122f22<_0x2e1652[_0x9703('0x9')];_0x122f22++){var _0x2a2040=_0xa616bd[_0x2e1652[_0x122f22]][_0x9703('0xa')](function(_0x25de74){return _0x25de74[_0x9703('0xb')]===_0x9703('0xc')&&_0x25de74[_0x9703('0xd')]===![];});_0x21f2b4=_0x21f2b4[_0x9703('0xe')](_0x2a2040);}return _0x21f2b4;}function getFirstInterface(){var _0x451a98=_[_0x9703('0xf')](getInterfaces());return{'macAddress':_0x451a98&&_0x451a98[_0x9703('0x10')]?_0x451a98[_0x9703('0x10')]:_0x9703('0x11'),'ipAddress':_0x451a98&&_0x451a98[_0x9703('0x12')]?_0x451a98['address']:_0x9703('0x13')};}exports[_0x9703('0x14')]=getFirstInterface;function getCPUhash(){var _0x504c03=_[_0x9703('0x7')](os['cpus']()[_0x9703('0x15')](function(_0x4281ab){return _0x4281ab[_0x9703('0x16')];}))['join'](':');return crypto[_0x9703('0x17')](_0x9703('0x18'))['update'](_0x504c03)['digest']('hex');}exports[_0x9703('0x19')]=function(){var _0x4f2d00=os['platform']();var _0x48c311=/[0-9a-f-]{36}/;if(config[_0x9703('0x1a')]&&_0x48c311['test'](config[_0x9703('0x1a')])){return config[_0x9703('0x1a')];}else if(_0x4f2d00===_0x9703('0x1b')){return exec(_0x9703('0x1c'),{'encoding':'utf8'})[_0x9703('0x1d')]('\x0d\x0a','');}else{var _0x18eb4a=getFirstInterface();var _0x47f730=getCPUhash();var _0x70d60b=_0x47f730+'|'+os['hostname']()+'|'+_0x18eb4a['macAddress']+'|'+_0x18eb4a[_0x9703('0x1e')];var _0x1624c1=crypto['createHash'](_0x9703('0x18'))['update'](_0x70d60b)[_0x9703('0x1f')](_0x9703('0x20'));return _0x1624c1['substring'](0x0,0x8)+'-'+_0x1624c1['substring'](0x8,0xc)+'-'+_0x1624c1[_0x9703('0x21')](0xc,0x10)+'-'+_0x1624c1[_0x9703('0x21')](0x10,0x14)+'-'+_0x1624c1['substring'](0x14);}}; \ No newline at end of file +var _0xf7be=['update','substring','lodash','crypto','bimedia-machine-uuid','../environment','networkInterfaces','length','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','orderBy','cpus','map','join','md5','digest','hex','getUuid','test','licenseToken','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','createHash'];(function(_0x20c7fb,_0x32fff2){var _0x4695e4=function(_0x761664){while(--_0x761664){_0x20c7fb['push'](_0x20c7fb['shift']());}};_0x4695e4(++_0x32fff2);}(_0xf7be,0x65));var _0xef7b=function(_0x3e95f9,_0x163f10){_0x3e95f9=_0x3e95f9-0x0;var _0x2e8b86=_0xf7be[_0x3e95f9];return _0x2e8b86;};'use strict';var _=require(_0xef7b('0x0'));var os=require('os');var crypto=require(_0xef7b('0x1'));var machine=require(_0xef7b('0x2'));var exec=require('child_process')['execSync'];var config=require(_0xef7b('0x3'));function getInterfaces(){var _0x224658=[];var _0x115e23=os[_0xef7b('0x4')]();var _0x4ec119=_['orderBy'](_['keys'](_0x115e23));for(var _0x884c09=0x0;_0x884c09<_0x4ec119[_0xef7b('0x5')];_0x884c09++){var _0xf0b15c=_0x115e23[_0x4ec119[_0x884c09]][_0xef7b('0x6')](function(_0x60372f){return _0x60372f[_0xef7b('0x7')]===_0xef7b('0x8')&&_0x60372f[_0xef7b('0x9')]===![];});_0x224658=_0x224658['concat'](_0xf0b15c);}return _0x224658;}function getFirstInterface(){var _0x400006=_[_0xef7b('0xa')](getInterfaces());return{'macAddress':_0x400006&&_0x400006[_0xef7b('0xb')]?_0x400006[_0xef7b('0xb')]:_0xef7b('0xc'),'ipAddress':_0x400006&&_0x400006['address']?_0x400006['address']:_0xef7b('0xd')};}exports[_0xef7b('0xe')]=getFirstInterface;function getCPUhash(){var _0x47439a=_[_0xef7b('0xf')](os[_0xef7b('0x10')]()[_0xef7b('0x11')](function(_0x2c159f){return _0x2c159f['model'];}))[_0xef7b('0x12')](':');return crypto['createHash'](_0xef7b('0x13'))['update'](_0x47439a)[_0xef7b('0x14')](_0xef7b('0x15'));}exports[_0xef7b('0x16')]=function(){var _0x2d6dfd=os['platform']();var _0x6a4f69=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x6a4f69[_0xef7b('0x17')](config[_0xef7b('0x18')])){return config[_0xef7b('0x18')];}else if(_0x2d6dfd==='win32'){return exec(_0xef7b('0x19'),{'encoding':_0xef7b('0x1a')})[_0xef7b('0x1b')]('\x0d\x0a','');}else{var _0x1b5f6c=getFirstInterface();var _0x379a36=getCPUhash();var _0x312ec1=_0x379a36+'|'+os['hostname']()+'|'+_0x1b5f6c[_0xef7b('0x1c')]+'|'+_0x1b5f6c[_0xef7b('0x1d')];var _0x149315=crypto[_0xef7b('0x1e')](_0xef7b('0x13'))[_0xef7b('0x1f')](_0x312ec1)[_0xef7b('0x14')](_0xef7b('0x15'));return _0x149315[_0xef7b('0x20')](0x0,0x8)+'-'+_0x149315[_0xef7b('0x20')](0x8,0xc)+'-'+_0x149315[_0xef7b('0x20')](0xc,0x10)+'-'+_0x149315[_0xef7b('0x20')](0x10,0x14)+'-'+_0x149315['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 725307b..870e714 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 _0xa40c=['License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','DEMO\x20START\x20AT\x20%s','getUuid'];(function(_0x2cd4f6,_0x28c765){var _0x5765d5=function(_0x1af3cf){while(--_0x1af3cf){_0x2cd4f6['push'](_0x2cd4f6['shift']());}};_0x5765d5(++_0x28c765);}(_0xa40c,0x19d));var _0xca40=function(_0x3f8556,_0x35c394){_0x3f8556=_0x3f8556-0x0;var _0x391def=_0xa40c[_0x3f8556];return _0x391def;};'use strict';var util=require('util');var moment=require(_0xca40('0x0'));var rp=require(_0xca40('0x1'));var BPromise=require(_0xca40('0x2'));var pkginfo=require(_0xca40('0x3'))(module,_0xca40('0x4'));var db=require(_0xca40('0x5'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require('../logger')(_0xca40('0x6'));var HOST=_0xca40('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x379757){return new BPromise(function(_0x361b51,_0x5ee268){var _0x2f59dd=util[_0xca40('0x8')](_0xca40('0x9'),HOST,_0x379757,module[_0xca40('0xa')]['version']);if(oldToken){_0x2f59dd=util['format'](_0xca40('0xb'),HOST,_0x379757,module[_0xca40('0xa')][_0xca40('0x4')],oldToken);}var _0x132ab3={'uri':_0x2f59dd,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x132ab3)[_0xca40('0xc')](function(_0x100b34){_0x361b51(_0x100b34);})[_0xca40('0xd')](function(_0x51f0bd){_0x5ee268(_0x51f0bd);});});}function manageLicense(_0x226ab6,_0x302312){var _0x5dd94f=_0x302312[_0xca40('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x5dd94f[_0xca40('0xf')]!==_0x226ab6&&!_0x5dd94f[_0xca40('0x10')]){oldToken=_0x5dd94f[_0xca40('0xf')];}httpRequest(_0x226ab6)[_0xca40('0xc')](function(_0x403aa8){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x403aa8['active']){isOldTokenSent=![];if(!_0x5dd94f[_0xca40('0x6')]&&_0x5dd94f[_0xca40('0x6')]!=_0x403aa8[_0xca40('0x6')]||_0x5dd94f[_0xca40('0x6')]&&_0x5dd94f['data2']){logger['info'](_0xca40('0x11'));}if(_0x5dd94f[_0xca40('0x6')]&&!_0x5dd94f['data2']&&_0x5dd94f['license']!=_0x403aa8['license']){logger[_0xca40('0x12')](_0xca40('0x13'));}if(_0x5dd94f['license']&&!_0x5dd94f['data2']&&_0x5dd94f[_0xca40('0x6')]==_0x403aa8['license']){return _0x302312;}return _0x302312[_0xca40('0x14')]({'data1':_0x226ab6,'data2':null,'license':_0x403aa8[_0xca40('0x6')]});}else{if(_0x403aa8[_0xca40('0x6')]||_0x5dd94f[_0xca40('0x6')]){if(!_0x5dd94f['data2']){if(_0x5dd94f[_0xca40('0xf')]==_0x226ab6){GRAY_PERIOD_REASON=_0xca40('0x15');logger[_0xca40('0x12')](_0xca40('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xca40('0x12')](_0xca40('0x17'),_0x5dd94f[_0xca40('0xf')],_0x226ab6);}logger[_0xca40('0x12')](_0xca40('0x18'),GRAY_PERIOD_REASON[_0xca40('0x19')](),moment()['format'](_0xca40('0x1a')));return _0x302312[_0xca40('0x14')]({'data2':encryptor[_0xca40('0x1b')](moment()['format'](_0xca40('0x1a')))});}else{if(moment()[_0xca40('0x1c')](encryptor['decryptString'](_0x5dd94f[_0xca40('0x10')]),'days')>DAYS){logger[_0xca40('0x12')](_0xca40('0x1d'),moment()[_0xca40('0x8')](_0xca40('0x1a')));isOldTokenSent=![];return _0x302312[_0xca40('0x14')]({'data1':_0x226ab6,'data2':null,'license':null});}}}else{if(_0x5dd94f[_0xca40('0xf')]!=_0x226ab6){logger[_0xca40('0x12')](_0xca40('0x17'),_0x5dd94f[_0xca40('0xf')],_0x226ab6);return _0x302312[_0xca40('0x14')]({'data1':_0x226ab6,'data2':null,'license':null});}}}return _0x302312;})['then'](function(_0x5051e2){_0x302312=_0x5051e2;})['catch'](function(_0xd8bc22){logger['error'](_0xd8bc22['message']);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xca40('0x1e')](),_0x302312);},TIME);});}function defaultLicense(){var _0x23e55f=hardware[_0xca40('0x1e')]();if(_0x23e55f){return db[_0xca40('0x1f')][_0xca40('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x23e55f}})[_0xca40('0x21')](function(_0x52d6ad,_0x1ea440){logger['info'](_0xca40('0x22'),_0x23e55f);manageLicense(_0x23e55f,_0x52d6ad);})[_0xca40('0xd')](function(_0x22cd6d){logger[_0xca40('0x23')](_0x22cd6d['message']);});}}exports[_0xca40('0x24')]=defaultLicense; \ No newline at end of file +var _0xf7b6=['findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','message','default','util','request-promise','bluebird','version','../../components/encryptor','./hardware','../logger','format','%s/api/servers/%s/check?version=%s','exports','GET','catch','get','data2','data1','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','finally','License'];(function(_0x552d09,_0x16ca8a){var _0x2a3f9e=function(_0x11d83e){while(--_0x11d83e){_0x552d09['push'](_0x552d09['shift']());}};_0x2a3f9e(++_0x16ca8a);}(_0xf7b6,0x7e));var _0x6f7b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf7b6[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x6f7b('0x0'));var moment=require('moment');var rp=require(_0x6f7b('0x1'));var BPromise=require(_0x6f7b('0x2'));var pkginfo=require('pkginfo')(module,_0x6f7b('0x3'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x6f7b('0x4'));var hardware=require(_0x6f7b('0x5'));var logger=require(_0x6f7b('0x6'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x41689c){return new BPromise(function(_0x44497a,_0x2ad326){var _0x4b5d7c=util[_0x6f7b('0x7')](_0x6f7b('0x8'),HOST,_0x41689c,module[_0x6f7b('0x9')][_0x6f7b('0x3')]);if(oldToken){_0x4b5d7c=util[_0x6f7b('0x7')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x41689c,module[_0x6f7b('0x9')][_0x6f7b('0x3')],oldToken);}var _0x403ed2={'uri':_0x4b5d7c,'method':_0x6f7b('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x403ed2)['then'](function(_0x468603){_0x44497a(_0x468603);})[_0x6f7b('0xb')](function(_0x564266){_0x2ad326(_0x564266);});});}function manageLicense(_0x338350,_0xa1c792){var _0x27c771=_0xa1c792[_0x6f7b('0xc')]({'plain':!![]});if(!isOldTokenSent&&_0x27c771['data1']!==_0x338350&&!_0x27c771[_0x6f7b('0xd')]){oldToken=_0x27c771[_0x6f7b('0xe')];}httpRequest(_0x338350)[_0x6f7b('0xf')](function(_0x27259b){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x27259b[_0x6f7b('0x10')]){isOldTokenSent=![];if(!_0x27c771[_0x6f7b('0x11')]&&_0x27c771['license']!=_0x27259b[_0x6f7b('0x11')]||_0x27c771[_0x6f7b('0x11')]&&_0x27c771[_0x6f7b('0xd')]){logger[_0x6f7b('0x12')](_0x6f7b('0x13'));}if(_0x27c771[_0x6f7b('0x11')]&&!_0x27c771[_0x6f7b('0xd')]&&_0x27c771[_0x6f7b('0x11')]!=_0x27259b[_0x6f7b('0x11')]){logger['info'](_0x6f7b('0x14'));}if(_0x27c771[_0x6f7b('0x11')]&&!_0x27c771[_0x6f7b('0xd')]&&_0x27c771[_0x6f7b('0x11')]==_0x27259b['license']){return _0xa1c792;}return _0xa1c792[_0x6f7b('0x15')]({'data1':_0x338350,'data2':null,'license':_0x27259b[_0x6f7b('0x11')]});}else{if(_0x27259b['license']||_0x27c771[_0x6f7b('0x11')]){if(!_0x27c771[_0x6f7b('0xd')]){if(_0x27c771[_0x6f7b('0xe')]==_0x338350){GRAY_PERIOD_REASON=_0x6f7b('0x16');logger[_0x6f7b('0x12')](_0x6f7b('0x17'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x6f7b('0x12')](_0x6f7b('0x18'),_0x27c771[_0x6f7b('0xe')],_0x338350);}logger[_0x6f7b('0x12')](_0x6f7b('0x19'),GRAY_PERIOD_REASON[_0x6f7b('0x1a')](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0xa1c792['update']({'data2':encryptor['encryptString'](moment()['format'](_0x6f7b('0x1b')))});}else{if(moment()[_0x6f7b('0x1c')](encryptor[_0x6f7b('0x1d')](_0x27c771[_0x6f7b('0xd')]),_0x6f7b('0x1e'))>DAYS){logger[_0x6f7b('0x12')](_0x6f7b('0x1f'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0xa1c792[_0x6f7b('0x15')]({'data1':_0x338350,'data2':null,'license':null});}}}else{if(_0x27c771[_0x6f7b('0xe')]!=_0x338350){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x27c771[_0x6f7b('0xe')],_0x338350);return _0xa1c792[_0x6f7b('0x15')]({'data1':_0x338350,'data2':null,'license':null});}}}return _0xa1c792;})[_0x6f7b('0xf')](function(_0x308a49){_0xa1c792=_0x308a49;})['catch'](function(_0x433fca){logger['error'](_0x433fca['message']);})[_0x6f7b('0x20')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xa1c792);},TIME);});}function defaultLicense(){var _0x14b1d8=hardware['getUuid']();if(_0x14b1d8){return db[_0x6f7b('0x21')][_0x6f7b('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x14b1d8}})[_0x6f7b('0x23')](function(_0x4e35de,_0x4fad46){logger[_0x6f7b('0x12')](_0x6f7b('0x24'),_0x14b1d8);manageLicense(_0x14b1d8,_0x4e35de);})[_0x6f7b('0xb')](function(_0x66c965){logger[_0x6f7b('0x25')](_0x66c965[_0x6f7b('0x26')]);});}}exports[_0x6f7b('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 6039685..5adc9e2 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 _0xf6bb=['parse','demo','machineUuid','add','grayReason','changed','message','User','findAll','role','COUNT','count','admin','user','telephone','users','telephones','forEach','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','decryptString','format','%s:%s:%s'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0xf6bb,0x12c));var _0xbf6b=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0xf6bb[_0x45d1fd];return _0xd0e542;};'use strict';var util=require('util');var _=require(_0xbf6b('0x0'));var moment=require(_0xbf6b('0x1'));var BPromise=require(_0xbf6b('0x2'));var hardware=require(_0xbf6b('0x3'));var encryptor=require(_0xbf6b('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbf6b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbf6b('0x6'),'machineUuid':hardware[_0xbf6b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbf6b('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xbf6b('0x8'),'machineUuid':hardware[_0xbf6b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xfe507a){return new BPromise(function(_0x48ff31,_0x293809){return db[_0xbf6b('0x9')][_0xbf6b('0xa')](_[_0xbf6b('0xb')](_0xfe507a,{'raw':!![],'where':{'id':0x1}}))[_0xbf6b('0xc')](function(_0x1be973){return checkLicense(_0x1be973,null);})[_0xbf6b('0xc')](function(_0x36e697){_0x48ff31(_0x36e697);return;})['catch'](function(_0x3f0827){_0x293809(_0x3f0827);});});}function checkLicense(_0x3b709e,_0x3a4fd7){if(!_0x3b709e){demoLicense[_0xbf6b('0xd')]=_0x3b709e['data1'];return demoLicense;}try{var _0x1a4a78=_0x3a4fd7||_0x3b709e['license'];if(_[_0xbf6b('0xe')](_0x1a4a78)){throw new Error(_0xbf6b('0xf'));}var _0x26c464=_0x3b709e[_0xbf6b('0x10')];var _0x6afb3a=_0x3b709e[_0xbf6b('0x11')];var _0x4e9be6=_0x26c464[_0xbf6b('0x12')]('-')[0x4];var _0x551748=_0x26c464[_0xbf6b('0x12')]('-')[0x0];var _0x5e8b5e=encryptor[_0xbf6b('0x13')](_0x1a4a78,util[_0xbf6b('0x14')](_0xbf6b('0x15'),_0x4e9be6,_0x26c464,_0x551748));var _0x1337fa=JSON[_0xbf6b('0x16')](_0x5e8b5e);_0x1337fa[_0xbf6b('0x17')]=![];_0x1337fa[_0xbf6b('0xd')]=_0x26c464;_0x1337fa[_0xbf6b('0x18')]=hardware[_0xbf6b('0x7')]();if(_0x6afb3a){var _0x57c62d=encryptor[_0xbf6b('0x13')](_0x6afb3a);_0x1337fa['gray']=_0x57c62d;_0x1337fa['deadline']=moment(_0x57c62d)[_0xbf6b('0x19')](0x7,'days')[_0xbf6b('0x14')]();_0x1337fa[_0xbf6b('0x1a')]=_0x1337fa[_0xbf6b('0xd')]!=_0x1337fa[_0xbf6b('0x18')]?_0xbf6b('0x1b'):'disabled';}return _0x1337fa;}catch(_0x4d0398){breakingLicense['uuid']=_0x3b709e[_0xbf6b('0x10')];breakingLicense[_0xbf6b('0x1c')]=_0x4d0398[_0xbf6b('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1114b4,_0x4956dd){getLicense()[_0xbf6b('0xc')](function(_0x1bfe71){return db[_0xbf6b('0x1d')][_0xbf6b('0x1e')]({'attributes':[_0xbf6b('0x1f'),[db['sequelize']['fn'](_0xbf6b('0x20'),db['sequelize']['col'](_0xbf6b('0x1f'))),_0xbf6b('0x21')]],'group':_0xbf6b('0x1f'),'where':{'role':{'$or':[_0xbf6b('0x22'),_0xbf6b('0x23'),_0xbf6b('0x24')]}},'raw':!![]})[_0xbf6b('0xc')](function(_0x381dff){var _0x259ad2={'user':_0x1bfe71[_0xbf6b('0x25')]||0x0,'telephone':_0x1bfe71[_0xbf6b('0x26')]||0x0};_0x381dff[_0xbf6b('0x27')](function(_0x483ba0){var _0x47fb62=_0x483ba0[_0xbf6b('0x1f')]===_0xbf6b('0x22')?_0xbf6b('0x23'):_0x483ba0['role'];_0x259ad2[_0x47fb62]-=_0x483ba0[_0xbf6b('0x21')];if(_0x259ad2[_0x47fb62]<0x0)_0x259ad2[_0x47fb62]=0x0;});_0x1114b4(_0x259ad2);return;});})[_0xbf6b('0x28')](function(_0x11d447){_0x4956dd(_0x11d447);});});}function checkUserLimits(_0x9207b0){return new BPromise(function(_0x2b61d9,_0x3abfc6){getLimits()[_0xbf6b('0xc')](function(_0x27e11e){var _0x33d26e=_[_0xbf6b('0x29')](_[_0xbf6b('0x2a')](_0x9207b0,_0xbf6b('0x1f')),[_0xbf6b('0x22'),_0xbf6b('0x23'),_0xbf6b('0x24')]);var _0x1f32bc=(_0x33d26e[_0xbf6b('0x22')]||0x0)+(_0x33d26e[_0xbf6b('0x23')]||0x0);var _0x23534e=_0x33d26e[_0xbf6b('0x24')]||0x0;if(_0x1f32bc>_0x27e11e[_0xbf6b('0x23')])return _0x3abfc6(_0xbf6b('0x2b'));if(_0x23534e>_0x27e11e[_0xbf6b('0x24')])return _0x3abfc6(_0xbf6b('0x2c'));return _0x2b61d9();})[_0xbf6b('0x28')](function(_0x57ac32){_0x3abfc6(_0x57ac32);});});}module[_0xbf6b('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xc79d=['getUuid','gray','deadline','add','days','format','grayReason','changed','disabled','message','role','COUNT','sequelize','count','user','telephone','users','forEach','admin','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','demo','machineUuid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc79d,0x7b));var _0xdc79=function(_0x4d0953,_0x2b409a){_0x4d0953=_0x4d0953-0x0;var _0x2ce6cb=_0xc79d[_0x4d0953];return _0x2ce6cb;};'use strict';var util=require(_0xdc79('0x0'));var _=require('lodash');var moment=require(_0xdc79('0x1'));var BPromise=require(_0xdc79('0x2'));var hardware=require(_0xdc79('0x3'));var encryptor=require(_0xdc79('0x4'));var db=require(_0xdc79('0x5'))['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':_0xdc79('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdc79('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdc79('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x42e8b9){return new BPromise(function(_0x2c953c,_0x3193af){return db[_0xdc79('0x9')][_0xdc79('0xa')](_[_0xdc79('0xb')](_0x42e8b9,{'raw':!![],'where':{'id':0x1}}))[_0xdc79('0xc')](function(_0x5d8216){return checkLicense(_0x5d8216,null);})[_0xdc79('0xc')](function(_0x39f6d5){_0x2c953c(_0x39f6d5);return;})['catch'](function(_0x45eb59){_0x3193af(_0x45eb59);});});}function checkLicense(_0x861f4c,_0x26bd8a){if(!_0x861f4c){demoLicense[_0xdc79('0xd')]=_0x861f4c[_0xdc79('0xe')];return demoLicense;}try{var _0x3dec52=_0x26bd8a||_0x861f4c[_0xdc79('0xf')];if(_[_0xdc79('0x10')](_0x3dec52)){throw new Error(_0xdc79('0x11'));}var _0x2c1a56=_0x861f4c[_0xdc79('0xe')];var _0x39fdee=_0x861f4c[_0xdc79('0x12')];var _0x1ed003=_0x2c1a56[_0xdc79('0x13')]('-')[0x4];var _0x2643cf=_0x2c1a56[_0xdc79('0x13')]('-')[0x0];var _0x3bddcc=encryptor[_0xdc79('0x14')](_0x3dec52,util['format'](_0xdc79('0x15'),_0x1ed003,_0x2c1a56,_0x2643cf));var _0x4069c7=JSON['parse'](_0x3bddcc);_0x4069c7[_0xdc79('0x16')]=![];_0x4069c7[_0xdc79('0xd')]=_0x2c1a56;_0x4069c7[_0xdc79('0x17')]=hardware[_0xdc79('0x18')]();if(_0x39fdee){var _0x516184=encryptor[_0xdc79('0x14')](_0x39fdee);_0x4069c7[_0xdc79('0x19')]=_0x516184;_0x4069c7[_0xdc79('0x1a')]=moment(_0x516184)[_0xdc79('0x1b')](0x7,_0xdc79('0x1c'))[_0xdc79('0x1d')]();_0x4069c7[_0xdc79('0x1e')]=_0x4069c7[_0xdc79('0xd')]!=_0x4069c7[_0xdc79('0x17')]?_0xdc79('0x1f'):_0xdc79('0x20');}return _0x4069c7;}catch(_0x5e1cda){breakingLicense[_0xdc79('0xd')]=_0x861f4c[_0xdc79('0xe')];breakingLicense[_0xdc79('0x21')]=_0x5e1cda[_0xdc79('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2883f4,_0x55135a){getLicense()[_0xdc79('0xc')](function(_0x29f3d3){return db['User']['findAll']({'attributes':[_0xdc79('0x22'),[db['sequelize']['fn'](_0xdc79('0x23'),db[_0xdc79('0x24')]['col'](_0xdc79('0x22'))),_0xdc79('0x25')]],'group':_0xdc79('0x22'),'where':{'role':{'$or':['admin',_0xdc79('0x26'),_0xdc79('0x27')]}},'raw':!![]})[_0xdc79('0xc')](function(_0xb0d8c0){var _0x3d8066={'user':_0x29f3d3[_0xdc79('0x28')]||0x0,'telephone':_0x29f3d3['telephones']||0x0};_0xb0d8c0[_0xdc79('0x29')](function(_0x4dc7a5){var _0x930d26=_0x4dc7a5[_0xdc79('0x22')]===_0xdc79('0x2a')?_0xdc79('0x26'):_0x4dc7a5[_0xdc79('0x22')];_0x3d8066[_0x930d26]-=_0x4dc7a5[_0xdc79('0x25')];if(_0x3d8066[_0x930d26]<0x0)_0x3d8066[_0x930d26]=0x0;});_0x2883f4(_0x3d8066);return;});})[_0xdc79('0x2b')](function(_0x131a50){_0x55135a(_0x131a50);});});}function checkUserLimits(_0x11e07d){return new BPromise(function(_0x4a5b4a,_0x589549){getLimits()[_0xdc79('0xc')](function(_0x564bf0){var _0x2d8346=_[_0xdc79('0x2c')](_[_0xdc79('0x2d')](_0x11e07d,_0xdc79('0x22')),[_0xdc79('0x2a'),_0xdc79('0x26'),_0xdc79('0x27')]);var _0x3c260e=(_0x2d8346[_0xdc79('0x2a')]||0x0)+(_0x2d8346[_0xdc79('0x26')]||0x0);var _0x5ad2c6=_0x2d8346[_0xdc79('0x27')]||0x0;if(_0x3c260e>_0x564bf0['user'])return _0x589549(_0xdc79('0x2e'));if(_0x5ad2c6>_0x564bf0['telephone'])return _0x589549(_0xdc79('0x2f'));return _0x4a5b4a();})[_0xdc79('0x2b')](function(_0x582cff){_0x589549(_0x582cff);});});}module[_0xdc79('0x30')]={'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 644a2d3..a573779 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 _0xb10b=['app-id','secret','exports','myappanuglar-secret'];(function(_0x116eb0,_0x3e72dd){var _0x306f49=function(_0x23c4f8){while(--_0x23c4f8){_0x116eb0['push'](_0x116eb0['shift']());}};_0x306f49(++_0x3e72dd);}(_0xb10b,0x12a));var _0xbb10=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xb10b[_0x4409e7];return _0x24c751;};'use strict';module[_0xbb10('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0xbb10('0x1'),'GOOGLE_ID':_0xbb10('0x2'),'GOOGLE_SECRET':_0xbb10('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x7334=['myappanuglar-secret','exports','http://localhost:9000'];(function(_0x2d1060,_0x26a8ca){var _0x218f04=function(_0x125d1a){while(--_0x125d1a){_0x2d1060['push'](_0x2d1060['shift']());}};_0x218f04(++_0x26a8ca);}(_0x7334,0x184));var _0x4733=function(_0x3c3a0d,_0x4eb1a5){_0x3c3a0d=_0x3c3a0d-0x0;var _0x3bfea1=_0x7334[_0x3c3a0d];return _0x3bfea1;};'use strict';module[_0x4733('0x0')]={'DOMAIN':_0x4733('0x1'),'SESSION_SECRET':_0x4733('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 5868f75..2f397e3 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcf89=['fileLogger','exports','../utils/loggers'];(function(_0x1d762d,_0x50c04e){var _0x110f17=function(_0x287cc1){while(--_0x287cc1){_0x1d762d['push'](_0x1d762d['shift']());}};_0x110f17(++_0x50c04e);}(_0xcf89,0x6b));var _0x9cf8=function(_0x37f543,_0x4df6b9){_0x37f543=_0x37f543-0x0;var _0xa5c9d8=_0xcf89[_0x37f543];return _0xa5c9d8;};'use strict';var fileLogger=require(_0x9cf8('0x0'))[_0x9cf8('0x1')];module[_0x9cf8('0x2')]=fileLogger; \ No newline at end of file +var _0x902c=['fileLogger','../utils/loggers'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x902c,0x77));var _0xc902=function(_0x5d8742,_0x34ece5){_0x5d8742=_0x5d8742-0x0;var _0xba5983=_0x902c[_0x5d8742];return _0xba5983;};'use strict';var fileLogger=require(_0xc902('0x0'))[_0xc902('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9cda042..d460696 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 _0x61a8=['exports','path','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','../../services/xdr/index.js'];(function(_0x373a0d,_0x57f241){var _0x295c01=function(_0x1943bd){while(--_0x1943bd){_0x373a0d['push'](_0x373a0d['shift']());}};_0x295c01(++_0x57f241);}(_0x61a8,0x9b));var _0x861a=function(_0x401609,_0x5eb61d){_0x401609=_0x401609-0x0;var _0x35fd57=_0x61a8[_0x401609];return _0x35fd57;};'use strict';var path=require(_0x861a('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x861a('0x1')](__dirname,_0x861a('0x2'))},{'name':'ami','script':path[_0x861a('0x1')](__dirname,_0x861a('0x3'))},{'name':_0x861a('0x4'),'script':path[_0x861a('0x1')](__dirname,_0x861a('0x5'))},{'name':_0x861a('0x6'),'script':path[_0x861a('0x1')](__dirname,_0x861a('0x7'))},{'name':'routing','script':path[_0x861a('0x1')](__dirname,_0x861a('0x8'))},{'name':'xdr','script':path['join'](__dirname,_0x861a('0x9'))}]};module[_0x861a('0xa')]=config; \ No newline at end of file +var _0x004a=['join','../../services/express/index.js','ami','../../services/ami/index.js','email','routing','../../services/routing/index.js','exports','path','express'];(function(_0x4ea2f7,_0x11c547){var _0x532c3c=function(_0x5c9966){while(--_0x5c9966){_0x4ea2f7['push'](_0x4ea2f7['shift']());}};_0x532c3c(++_0x11c547);}(_0x004a,0x15c));var _0xa004=function(_0x5a6f32,_0x55b359){_0x5a6f32=_0x5a6f32-0x0;var _0x512785=_0x004a[_0x5a6f32];return _0x512785;};'use strict';var path=require(_0xa004('0x0'));var os=require('os');var config={'apps':[{'name':_0xa004('0x1'),'script':path[_0xa004('0x2')](__dirname,_0xa004('0x3'))},{'name':_0xa004('0x4'),'script':path['join'](__dirname,_0xa004('0x5'))},{'name':'agi','script':path[_0xa004('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0xa004('0x6'),'script':path[_0xa004('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xa004('0x7'),'script':path[_0xa004('0x2')](__dirname,_0xa004('0x8'))},{'name':'xdr','script':path['join'](__dirname,'../../services/xdr/index.js')}]};module[_0xa004('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index dd14bef..bbc9ccc 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 _0xa8ad=['then','disconnect','stop','restart','list','delete','dump','saved','pm2','bluebird','./config','connect','connected','start'];(function(_0x4f2aa1,_0x574dcf){var _0x33252e=function(_0x392b4c){while(--_0x392b4c){_0x4f2aa1['push'](_0x4f2aa1['shift']());}};_0x33252e(++_0x574dcf);}(_0xa8ad,0x1f2));var _0xda8a=function(_0x2db1ef,_0x3bc088){_0x2db1ef=_0x2db1ef-0x0;var _0x5312b4=_0xa8ad[_0x2db1ef];return _0x5312b4;};'use strict';var pm2=require(_0xda8a('0x0'));var BPromise=require(_0xda8a('0x1'));var config=require(_0xda8a('0x2'));function connect(){return new BPromise(function(_0x4ac406,_0x37d0ef){return pm2[_0xda8a('0x3')](function(_0x29118d){if(_0x29118d){return _0x37d0ef(_0x29118d);}return _0x4ac406(_0xda8a('0x4'));});});};exports[_0xda8a('0x5')]=function(_0x1b2578){return connect()[_0xda8a('0x6')](function(){return new BPromise(function(_0x176604,_0x487b59){return pm2[_0xda8a('0x5')](_0x1b2578,function(_0x484646,_0x4ccf68){if(_0x484646){return _0x487b59(_0x484646);}pm2[_0xda8a('0x7')]();return _0x176604(_0x4ccf68);});});});};exports[_0xda8a('0x8')]=function(_0x38c448){return connect()[_0xda8a('0x6')](function(){return new BPromise(function(_0x45d3ba,_0x1c7385){return pm2[_0xda8a('0x8')](_0x38c448,function(_0x370188,_0x41ed18){if(_0x370188){return _0x1c7385(_0x370188);}pm2['disconnect']();return _0x45d3ba(_0x41ed18);});});});};exports['restart']=function(_0x3bd2b7){return connect()[_0xda8a('0x6')](function(){return new BPromise(function(_0x4de440,_0x2da932){return pm2[_0xda8a('0x9')](_0x3bd2b7,function(_0x3b051f,_0x3f05ea){if(_0x3b051f){return _0x2da932(_0x3b051f);}pm2[_0xda8a('0x7')]();return _0x4de440(_0x3f05ea);});});});};exports[_0xda8a('0xa')]=function(){return connect()[_0xda8a('0x6')](function(){return new BPromise(function(_0x7d8cc2,_0x27857a){return pm2[_0xda8a('0xa')](function(_0x1c2af5,_0x177cad){if(_0x1c2af5){return _0x27857a(_0x1c2af5);}pm2[_0xda8a('0x7')]();return _0x7d8cc2(_0x177cad);});});});};exports['describe']=function(_0x5f3ff1){return connect()['then'](function(){return new BPromise(function(_0x4df54e,_0x3a07ab){return pm2['describe'](_0x5f3ff1,function(_0x337492,_0x298a22){if(_0x337492){return _0x3a07ab(_0x337492);}pm2[_0xda8a('0x7')]();return _0x4df54e(_0x298a22);});});});};exports['delete']=function(_0x2d3687){return connect()['then'](function(){return new BPromise(function(_0x206870,_0x453da3){return pm2[_0xda8a('0xb')](_0x2d3687,function(_0x3e492d,_0x5b8d24){if(_0x3e492d){return _0x453da3(_0x3e492d);}pm2[_0xda8a('0x7')]();return _0x206870(_0x5b8d24);});});});};exports[_0xda8a('0xc')]=function(){return connect()[_0xda8a('0x6')](function(){return new BPromise(function(_0x15bc0c,_0x38be9d){return pm2[_0xda8a('0xc')](function(_0x1dffb0){if(_0x1dffb0){return _0x38be9d(_0x1dffb0);}return _0x15bc0c(_0xda8a('0xd'));});});});}; \ No newline at end of file +var _0x15af=['connect','connected','start','disconnect','stop','then','restart','list','describe','delete','dump','saved','pm2','./config'];(function(_0xdd3cd2,_0x4b8c91){var _0xd1044=function(_0x169586){while(--_0x169586){_0xdd3cd2['push'](_0xdd3cd2['shift']());}};_0xd1044(++_0x4b8c91);}(_0x15af,0x8a));var _0xf15a=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x15af[_0x39c734];return _0xb2a2f9;};'use strict';var pm2=require(_0xf15a('0x0'));var BPromise=require('bluebird');var config=require(_0xf15a('0x1'));function connect(){return new BPromise(function(_0x2cb9a5,_0x2de69b){return pm2[_0xf15a('0x2')](function(_0x5d63b7){if(_0x5d63b7){return _0x2de69b(_0x5d63b7);}return _0x2cb9a5(_0xf15a('0x3'));});});};exports[_0xf15a('0x4')]=function(_0x3c23f2){return connect()['then'](function(){return new BPromise(function(_0x32bb6a,_0x10b6e7){return pm2[_0xf15a('0x4')](_0x3c23f2,function(_0x3202fa,_0x10b166){if(_0x3202fa){return _0x10b6e7(_0x3202fa);}pm2[_0xf15a('0x5')]();return _0x32bb6a(_0x10b166);});});});};exports[_0xf15a('0x6')]=function(_0xe734b5){return connect()[_0xf15a('0x7')](function(){return new BPromise(function(_0x2e9847,_0x4cbdee){return pm2[_0xf15a('0x6')](_0xe734b5,function(_0x11df8f,_0x3e2300){if(_0x11df8f){return _0x4cbdee(_0x11df8f);}pm2[_0xf15a('0x5')]();return _0x2e9847(_0x3e2300);});});});};exports['restart']=function(_0x3abce0){return connect()['then'](function(){return new BPromise(function(_0x1f8434,_0x6b786){return pm2[_0xf15a('0x8')](_0x3abce0,function(_0x180f6a,_0x3d3ffe){if(_0x180f6a){return _0x6b786(_0x180f6a);}pm2[_0xf15a('0x5')]();return _0x1f8434(_0x3d3ffe);});});});};exports[_0xf15a('0x9')]=function(){return connect()[_0xf15a('0x7')](function(){return new BPromise(function(_0x1bb799,_0x1cf298){return pm2[_0xf15a('0x9')](function(_0x3b4f43,_0x385a79){if(_0x3b4f43){return _0x1cf298(_0x3b4f43);}pm2['disconnect']();return _0x1bb799(_0x385a79);});});});};exports[_0xf15a('0xa')]=function(_0x1d1b3e){return connect()[_0xf15a('0x7')](function(){return new BPromise(function(_0x43abe5,_0x416de5){return pm2['describe'](_0x1d1b3e,function(_0x57ad10,_0x3c8854){if(_0x57ad10){return _0x416de5(_0x57ad10);}pm2[_0xf15a('0x5')]();return _0x43abe5(_0x3c8854);});});});};exports[_0xf15a('0xb')]=function(_0x3b508d){return connect()[_0xf15a('0x7')](function(){return new BPromise(function(_0x335ba9,_0x2d7059){return pm2[_0xf15a('0xb')](_0x3b508d,function(_0x3959fd,_0x58d207){if(_0x3959fd){return _0x2d7059(_0x3959fd);}pm2[_0xf15a('0x5')]();return _0x335ba9(_0x58d207);});});});};exports['dump']=function(){return connect()[_0xf15a('0x7')](function(){return new BPromise(function(_0x50e442,_0x4f6f76){return pm2[_0xf15a('0xc')](function(_0x10310c){if(_0x10310c){return _0x4f6f76(_0x10310c);}return _0x50e442(_0xf15a('0xd'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 2fe0b54..f8cabb6 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 _0x24c7=['chatTimeout','lastMsgAt','subtract','minutes','then','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter','Setting'];(function(_0x1cf5ae,_0x41b203){var _0x1e68ac=function(_0x53a6f1){while(--_0x53a6f1){_0x1cf5ae['push'](_0x1cf5ae['shift']());}};_0x1e68ac(++_0x41b203);}(_0x24c7,0x1c6));var _0x724c=function(_0x2e29ec,_0x5920e3){_0x2e29ec=_0x2e29ec-0x0;var _0x4bbb5b=_0x24c7[_0x2e29ec];return _0x4bbb5b;};'use strict';var _=require(_0x724c('0x0'));var moment=require(_0x724c('0x1'));var Redis=require(_0x724c('0x2'));var util=require(_0x724c('0x3'));var config=require(_0x724c('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x724c('0x5'))(_0x724c('0x6'));config[_0x724c('0x7')]=_['defaults'](config[_0x724c('0x7')],{'host':_0x724c('0x8'),'port':0x18eb});var io=require(_0x724c('0x9'))(new Redis(config[_0x724c('0x7')]));function closeInteractions(){var _0x22c8b6=0x0;var _0x1edd56=[];return db[_0x724c('0xa')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x5dbbfc){_0x22c8b6=_0x5dbbfc[_0x724c('0xb')];if(_0x22c8b6){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x724c('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x724c('0xd')](_0x5dbbfc[_0x724c('0xb')],_0x724c('0xe'))}}});}else{return[];}})[_0x724c('0xf')](function(_0x4b40c4){if(_0x4b40c4&&_0x4b40c4[_0x724c('0x10')]){_0x1edd56=_['map'](_0x4b40c4||[],'id');logger[_0x724c('0x11')](_0x724c('0x12'),_0x1edd56[_0x724c('0x13')]());return db[_0x724c('0x14')]['update']({'closeReason':_0x724c('0x15'),'disposition':_0x724c('0x16'),'closed':!![],'closedAt':moment()['format'](_0x724c('0x17'))},{'where':{'id':_0x1edd56}});}})[_0x724c('0xf')](function(){if(_0x1edd56&&_0x1edd56[_0x724c('0x10')]){logger[_0x724c('0x11')](_0x724c('0x18'),_0x1edd56['join']());for(var _0x15eb9a=0x0;_0x15eb9a<_0x1edd56[_0x724c('0x10')];_0x15eb9a++){io['emit'](_0x724c('0x19'),{'id':_0x1edd56[_0x15eb9a],'closed':!![]});}}})[_0x724c('0x1a')](function(_0x370348){logger[_0x724c('0x1b')](_0x724c('0x1c'),_0x370348?util[_0x724c('0x1d')](_0x370348,{'showHidden':![],'depth':null}):'');});}exports[_0x724c('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xe627=['YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','format'];(function(_0x1cfc51,_0x34420a){var _0x44308b=function(_0x1549a6){while(--_0x1549a6){_0x1cfc51['push'](_0x1cfc51['shift']());}};_0x44308b(++_0x34420a);}(_0xe627,0x1ba));var _0x7e62=function(_0x515780,_0x21a125){_0x515780=_0x515780-0x0;var _0x28d44c=_0xe627[_0x515780];return _0x28d44c;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x7e62('0x0'));var util=require(_0x7e62('0x1'));var config=require(_0x7e62('0x2'));var db=require(_0x7e62('0x3'))['db'];var logger=require(_0x7e62('0x4'))('schedule');config[_0x7e62('0x5')]=_['defaults'](config[_0x7e62('0x5')],{'host':_0x7e62('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7e62('0x5')]));function closeInteractions(){var _0x237b56=0x0;var _0x7d690b=[];return db['Setting'][_0x7e62('0x7')]({'raw':!![],'attributes':['id',_0x7e62('0x8')],'where':{'id':0x1}})[_0x7e62('0x9')](function(_0x36fe69){_0x237b56=_0x36fe69['chatTimeout'];if(_0x237b56){return db[_0x7e62('0xa')][_0x7e62('0xb')]({'raw':!![],'attributes':['id',_0x7e62('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x7e62('0xd')](_0x36fe69[_0x7e62('0x8')],_0x7e62('0xe'))}}});}else{return[];}})[_0x7e62('0x9')](function(_0x4d1a24){if(_0x4d1a24&&_0x4d1a24[_0x7e62('0xf')]){_0x7d690b=_['map'](_0x4d1a24||[],'id');logger[_0x7e62('0x10')](_0x7e62('0x11'),_0x7d690b[_0x7e62('0x12')]());return db[_0x7e62('0xa')][_0x7e62('0x13')]({'closeReason':_0x7e62('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x7e62('0x15')](_0x7e62('0x16'))},{'where':{'id':_0x7d690b}});}})['then'](function(){if(_0x7d690b&&_0x7d690b[_0x7e62('0xf')]){logger['info'](_0x7e62('0x17'),_0x7d690b[_0x7e62('0x12')]());for(var _0x57fd02=0x0;_0x57fd02<_0x7d690b['length'];_0x57fd02++){io[_0x7e62('0x18')](_0x7e62('0x19'),{'id':_0x7d690b[_0x57fd02],'closed':!![]});}}})[_0x7e62('0x1a')](function(_0x1f1e51){logger[_0x7e62('0x1b')](_0x7e62('0x1c'),_0x1f1e51?util['inspect'](_0x1f1e51,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 6da1012..0555f56 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47fd=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x368550,_0x3c7aa2){var _0x2efd25=function(_0x51e3c8){while(--_0x51e3c8){_0x368550['push'](_0x368550['shift']());}};_0x2efd25(++_0x3c7aa2);}(_0x47fd,0xec));var _0xd47f=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0x47fd[_0xf5d71c];return _0x5af672;};'use strict';function start(){var _0x4f3f16=require(_0xd47f('0x0'));return _0x4f3f16[_0xd47f('0x1')]();}module[_0xd47f('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x4eb1=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x5c90ea,_0x3b85cd){var _0x4eff62=function(_0x3dc31d){while(--_0x3dc31d){_0x5c90ea['push'](_0x5c90ea['shift']());}};_0x4eff62(++_0x3b85cd);}(_0x4eb1,0x6a));var _0x14eb=function(_0x5d2f62,_0x264dc9){_0x5d2f62=_0x5d2f62-0x0;var _0x4e193a=_0x4eb1[_0x5d2f62];return _0x4e193a;};'use strict';function start(){var _0x443da7=require(_0x14eb('0x0'));return _0x443da7['startAllRefreshIntervals']();}module[_0x14eb('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index ada592c..7c0fc10 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 _0x8546=['exists','stop','deleteJob','delete\x20cron','index','resolve','run\x20job','cron','active','endAt','add','start','add\x20cron','stop\x20cron','startAt','update','update\x20cron','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','http','info','MailAccount','service','Smtp','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','%s.%s','savename','existsSync','status','Sent','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','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','then','error','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','keys','jobs','toString','keyBy','difference','length'];(function(_0x3f5ade,_0x26253b){var _0x52a5ba=function(_0x357634){while(--_0x357634){_0x3f5ade['push'](_0x3f5ade['shift']());}};_0x52a5ba(++_0x26253b);}(_0x8546,0x10e));var _0x6854=function(_0x250576,_0x2f22a8){_0x250576=_0x250576-0x0;var _0x284760=_0x8546[_0x250576];return _0x284760;};'use strict';var fs=require('fs');var util=require(_0x6854('0x0'));var path=require(_0x6854('0x1'));var _=require(_0x6854('0x2'));var moment=require(_0x6854('0x3'));var CronJobManager=require(_0x6854('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x6854('0x5'));var logger=require(_0x6854('0x6'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0x6854('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xcf5f0b,_0x9b98f7){return function(){logger[_0x6854('0x8')]('Try\x20to\x20send\x20a\x20mail\x20to',_0xcf5f0b['email']);var _0x523e2f=!![];var _0x59e07a={'tls':{'rejectUnauthorized':![]}};if(_0xcf5f0b[_0x6854('0x9')]['Smtp'][_0x6854('0xa')]){_0x59e07a[_0x6854('0xa')]=_0xcf5f0b[_0x6854('0x9')][_0x6854('0xb')][_0x6854('0xa')];}else{_0x59e07a[_0x6854('0xc')]=_0xcf5f0b['MailAccount'][_0x6854('0xb')][_0x6854('0xc')];_0x59e07a[_0x6854('0xd')]=_0xcf5f0b[_0x6854('0x9')]['Smtp'][_0x6854('0xd')];_0x59e07a[_0x6854('0xe')]=_0xcf5f0b['MailAccount'][_0x6854('0xb')][_0x6854('0xe')];}if(_0xcf5f0b[_0x6854('0x9')][_0x6854('0xb')][_0x6854('0xf')]){_0x59e07a[_0x6854('0x10')]={'user':_0xcf5f0b['MailAccount'][_0x6854('0xb')]['user'],'pass':_0xcf5f0b[_0x6854('0x9')]['Smtp'][_0x6854('0x11')]};}var _0x529e1f={'account':_0x59e07a,'message':{'from':util[_0x6854('0x12')](_0x6854('0x13'),_0xcf5f0b[_0x6854('0x9')][_0x6854('0x14')],_0xcf5f0b[_0x6854('0x9')][_0x6854('0x15')]||_0xcf5f0b['MailAccount'][_0x6854('0xb')][_0x6854('0x16')]),'to':_0xcf5f0b[_0x6854('0x15')],'cc':_0xcf5f0b['cc'],'bcc':_0xcf5f0b[_0x6854('0x17')],'subject':util[_0x6854('0x12')](_0x6854('0x18'),_0x9b98f7[_0x6854('0x14')],_0xcf5f0b[_0x6854('0x19')],_0xcf5f0b[_0x6854('0x1a')])}};var _0x177a1b=path[_0x6854('0x1b')](__dirname,_0x6854('0x1c'));var _0x5f0f1f=_0x9b98f7['savename'];var _0x1d0105=util[_0x6854('0x12')](_0x6854('0x1d'),path['basename'](_0x9b98f7[_0x6854('0x1e')],path['extname'](_0x9b98f7['savename'])),'zip');var _0x3506ea=path[_0x6854('0x1b')](_0x177a1b,_0x5f0f1f);var _0x46267d=path[_0x6854('0x1b')](_0x177a1b,_0x1d0105);if(fs[_0x6854('0x1f')](_0x3506ea)){_0x9b98f7[_0x6854('0x20')]=_0x6854('0x21');_0x529e1f['message']['attachments']=[{'filename':_0x5f0f1f,'path':_0x3506ea}];_0x529e1f[_0x6854('0x22')][_0x6854('0x23')]=util['format'](_0x6854('0x24'),JSON[_0x6854('0x25')](_0x9b98f7,null,0x2));}else if(fs[_0x6854('0x1f')](_0x46267d)){_0x9b98f7[_0x6854('0x20')]='Sent';_0x529e1f[_0x6854('0x22')][_0x6854('0x26')]=[{'filename':_0x1d0105,'path':_0x46267d}];}else{_0x529e1f['message']['text']=_0x6854('0x27');if(!_0xcf5f0b[_0x6854('0x28')]){_0x523e2f=![];logger['info'](_0x6854('0x29'));}}if(_0x523e2f){return client['request']('SendMail',_0x529e1f)[_0x6854('0x2a')](function(_0x1959d1){if(_0x1959d1[_0x6854('0x2b')]){return logger[_0x6854('0x2b')]('error\x20mail',JSON['stringify'](_0x1959d1));}return logger[_0x6854('0x8')]('email\x20sent');})[_0x6854('0x2c')](function(_0x20a73e){return logger[_0x6854('0x2b')](_0x6854('0x2d'),JSON[_0x6854('0x25')](_0x20a73e));});}};}function handleError(){return function(_0x4e41f7){return logger[_0x6854('0x2b')](JSON[_0x6854('0x25')](_0x4e41f7));};}function handleResult(_0x52163a){return function(_0x15d2c6){logger[_0x6854('0x8')](_0x6854('0x2e'),JSON[_0x6854('0x25')](_0x15d2c6));if(_0x52163a[_0x6854('0x9')]&&_0x52163a[_0x6854('0x9')]['Smtp']&&!_[_0x6854('0x2f')](_0x52163a[_0x6854('0x15')])){setTimeout(handleSendEmail(_0x52163a,_0x15d2c6),0x3c*0x3e8);}};}function handleJob(_0x5bbc3b){return function(){try{if(_[_0x6854('0x2f')](_0x5bbc3b[_0x6854('0x19')])){return logger[_0x6854('0x8')](_0x6854('0x30'));}if(_['isNil'](_0x5bbc3b[_0x6854('0x1a')])){return logger['info'](_0x6854('0x31'));}var _0x203639={'startDate':moment()[_0x6854('0x32')](_0x5bbc3b[_0x6854('0x19')],_0x5bbc3b['subtractUnit'])['format'](_0x6854('0x33')),'endDate':moment()[_0x6854('0x12')](_0x6854('0x33')),'type':'scheduled','output':_0x5bbc3b[_0x6854('0x34')],'name':_0x5bbc3b['name']};if(!_[_0x6854('0x2f')](_0x5bbc3b['DefaultReportId'])){logger[_0x6854('0x8')](_0x6854('0x35'),_0x5bbc3b[_0x6854('0x36')]);return analyticDefaultReportController[_0x6854('0x37')]({'id':_0x5bbc3b['DefaultReportId']},_0x203639)[_0x6854('0x2a')](handleResult(_0x5bbc3b))['catch'](handleError());}if(!_[_0x6854('0x2f')](_0x5bbc3b[_0x6854('0x38')])){logger[_0x6854('0x8')](_0x6854('0x39'),_0x5bbc3b['CustomReportId']);return analyticCustomReportController[_0x6854('0x37')]({'id':_0x5bbc3b[_0x6854('0x38')]},_0x203639)[_0x6854('0x2a')](handleResult(_0x5bbc3b))['catch'](handleError());}}catch(_0x582807){logger['error'](JSON['stringify'](_0x582807));}return logger[_0x6854('0x8')](_0x6854('0x3a'));};}function getJobs(_0x1380a9){var _0x322412={};if(_0x1380a9){_0x322412['id']=_0x1380a9;}return db[_0x6854('0x3b')]['findAll']({'where':_0x322412,'include':[{'model':db['MailAccount'],'attributes':['id',_0x6854('0x14'),_0x6854('0x15')],'include':[{'model':db['MailServerOut'],'as':_0x6854('0xb')}]}]})['then'](function(_0xf14839){var _0x4913ff=_[_0x6854('0x3c')](manager[_0x6854('0x3d')]);var _0x2d150a=_['map'](_0xf14839,function(_0x30862d){return _0x30862d['id'][_0x6854('0x3e')]();});var _0x4856af=_[_0x6854('0x3f')](_0xf14839,function(_0x21cdeb){return _0x21cdeb['id'][_0x6854('0x3e')]();});var _0x1214ad=_0x1380a9?_0x2d150a:_['difference'](_0x2d150a,_0x4913ff);var _0x1e4000=_['intersection'](_0x2d150a,_0x4913ff);var _0x3aabbf=_[_0x6854('0x40')](_0x4913ff,_0x2d150a);var _0x2c0304;var _0x42a8d9;for(_0x2c0304=0x0;_0x2c0304<_0x3aabbf[_0x6854('0x41')]&&!_0x1380a9;_0x2c0304+=0x1){_0x42a8d9=_0x3aabbf[_0x2c0304][_0x6854('0x3e')]();if(manager[_0x6854('0x42')](_0x42a8d9)){manager[_0x6854('0x43')](_0x42a8d9);manager[_0x6854('0x44')](_0x42a8d9);logger[_0x6854('0x8')](_0x6854('0x45'),_0x42a8d9);}}logger[_0x6854('0x8')]('toRun',JSON[_0x6854('0x25')](_0x1214ad));for(_0x2c0304=0x0;_0x2c0304<_0x1214ad['length'];_0x2c0304+=0x1){_0x42a8d9=_0x1214ad[_0x2c0304][_0x6854('0x3e')]();logger[_0x6854('0x8')](_0x6854('0x46'),_0x42a8d9);if(_0x1380a9){logger[_0x6854('0x8')]('my\x20id',_0x1380a9);logger[_0x6854('0x8')](JSON[_0x6854('0x25')](_0x4856af[_0x42a8d9]));BPromise[_0x6854('0x47')]()[_0x6854('0x2a')](handleJob(_0x4856af[_0x42a8d9]));logger[_0x6854('0x8')](_0x6854('0x48'),_0x4856af[_0x42a8d9][_0x6854('0x14')],_0x4856af[_0x42a8d9][_0x6854('0x49')]);}else if(_0x4856af[_0x42a8d9][_0x6854('0x49')]&&_0x4856af[_0x42a8d9][_0x6854('0x4a')]&&moment()['isBetween'](_0x4856af[_0x42a8d9]['startAt'],_0x4856af[_0x42a8d9][_0x6854('0x4b')])){manager[_0x6854('0x4c')](_0x42a8d9,_0x4856af[_0x42a8d9][_0x6854('0x49')],handleJob(_0x4856af[_0x42a8d9]));manager[_0x6854('0x4d')](_0x42a8d9);logger[_0x6854('0x8')](_0x6854('0x4e'),_0x4856af[_0x42a8d9][_0x6854('0x14')],_0x4856af[_0x42a8d9]['cron']);}else if(manager[_0x6854('0x42')](_0x42a8d9)){manager[_0x6854('0x43')](_0x42a8d9);manager['deleteJob'](_0x42a8d9);logger[_0x6854('0x8')](_0x6854('0x4f'),_0x4856af[_0x42a8d9][_0x6854('0x14')],_0x4856af[_0x42a8d9][_0x6854('0x49')]);}}for(_0x2c0304=0x0,_0x42a8d9;_0x2c0304<_0x1e4000[_0x6854('0x41')]&&!_0x1380a9;_0x2c0304+=0x1){_0x42a8d9=_0x1e4000[_0x2c0304][_0x6854('0x3e')]();if(manager['exists'](_0x42a8d9)){if(_0x4856af[_0x42a8d9][_0x6854('0x49')]&&_0x4856af[_0x42a8d9][_0x6854('0x4a')]&&moment()['isBetween'](_0x4856af[_0x42a8d9][_0x6854('0x50')],_0x4856af[_0x42a8d9][_0x6854('0x4b')])){manager[_0x6854('0x51')](_0x42a8d9,_0x4856af[_0x42a8d9][_0x6854('0x49')],handleJob(_0x4856af[_0x42a8d9]));logger['info'](_0x6854('0x52'),_0x4856af[_0x42a8d9][_0x6854('0x14')],_0x4856af[_0x42a8d9]['cron']);}else{manager[_0x6854('0x43')](_0x42a8d9);manager['deleteJob'](_0x42a8d9);logger[_0x6854('0x8')](_0x6854('0x4f'),_0x4856af[_0x42a8d9][_0x6854('0x14')],_0x4856af[_0x42a8d9][_0x6854('0x49')]);}}}})[_0x6854('0x2c')](function(_0x5dedc1){logger[_0x6854('0x2b')](JSON[_0x6854('0x25')](_0x5dedc1));});}exports[_0x6854('0x53')]=function(_0x16489f){return getJobs(_0x16489f);};exports[_0x6854('0x4d')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xa4d9=['bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','basename','extname','zip','join','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','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','runReport','DefaultReportId','CustomReportId','exec\x20custom\x20report\x20id:%s','MailServerOut','keys','jobs','toString','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','startAt','add','start','exists','stop\x20cron','endAt','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','MailAccount','service','Smtp','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>'];(function(_0x21df10,_0x2a9bbc){var _0x549367=function(_0x3117b8){while(--_0x3117b8){_0x21df10['push'](_0x21df10['shift']());}};_0x549367(++_0x2a9bbc);}(_0xa4d9,0x14f));var _0x9a4d=function(_0x535955,_0x2446bb){_0x535955=_0x535955-0x0;var _0x537a96=_0xa4d9[_0x535955];return _0x537a96;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x9a4d('0x0'));var _=require(_0x9a4d('0x1'));var moment=require(_0x9a4d('0x2'));var CronJobManager=require(_0x9a4d('0x3'));var jayson=require(_0x9a4d('0x4'));var BPromise=require(_0x9a4d('0x5'));var logger=require(_0x9a4d('0x6'))(_0x9a4d('0x7'));var db=require(_0x9a4d('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x9a4d('0x9'));var client=jayson[_0x9a4d('0xa')][_0x9a4d('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x30f84b,_0x2678e7){return function(){logger[_0x9a4d('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x30f84b[_0x9a4d('0xd')]);var _0x53f8db=!![];var _0x2b5916={'tls':{'rejectUnauthorized':![]}};if(_0x30f84b[_0x9a4d('0xe')]['Smtp'][_0x9a4d('0xf')]){_0x2b5916[_0x9a4d('0xf')]=_0x30f84b[_0x9a4d('0xe')][_0x9a4d('0x10')][_0x9a4d('0xf')];}else{_0x2b5916['host']=_0x30f84b[_0x9a4d('0xe')][_0x9a4d('0x10')][_0x9a4d('0x11')];_0x2b5916[_0x9a4d('0x12')]=_0x30f84b['MailAccount']['Smtp']['port'];_0x2b5916['secure']=_0x30f84b[_0x9a4d('0xe')][_0x9a4d('0x10')][_0x9a4d('0x13')];}if(_0x30f84b[_0x9a4d('0xe')][_0x9a4d('0x10')][_0x9a4d('0x14')]){_0x2b5916['auth']={'user':_0x30f84b[_0x9a4d('0xe')][_0x9a4d('0x10')][_0x9a4d('0x15')],'pass':_0x30f84b['MailAccount']['Smtp'][_0x9a4d('0x16')]};}var _0x545f6a={'account':_0x2b5916,'message':{'from':util[_0x9a4d('0x17')](_0x9a4d('0x18'),_0x30f84b['MailAccount']['name'],_0x30f84b['MailAccount']['email']||_0x30f84b['MailAccount'][_0x9a4d('0x10')][_0x9a4d('0x15')]),'to':_0x30f84b['email'],'cc':_0x30f84b['cc'],'bcc':_0x30f84b[_0x9a4d('0x19')],'subject':util['format'](_0x9a4d('0x1a'),_0x2678e7['name'],_0x30f84b[_0x9a4d('0x1b')],_0x30f84b[_0x9a4d('0x1c')])}};var _0x23ebdd=path['join'](__dirname,_0x9a4d('0x1d'));var _0x449647=_0x2678e7[_0x9a4d('0x1e')];var _0x3f6c22=util[_0x9a4d('0x17')]('%s.%s',path[_0x9a4d('0x1f')](_0x2678e7[_0x9a4d('0x1e')],path[_0x9a4d('0x20')](_0x2678e7[_0x9a4d('0x1e')])),_0x9a4d('0x21'));var _0x290670=path[_0x9a4d('0x22')](_0x23ebdd,_0x449647);var _0x38ce60=path[_0x9a4d('0x22')](_0x23ebdd,_0x3f6c22);if(fs[_0x9a4d('0x23')](_0x290670)){_0x2678e7[_0x9a4d('0x24')]=_0x9a4d('0x25');_0x545f6a[_0x9a4d('0x26')][_0x9a4d('0x27')]=[{'filename':_0x449647,'path':_0x290670}];_0x545f6a[_0x9a4d('0x26')][_0x9a4d('0x28')]=util[_0x9a4d('0x17')](_0x9a4d('0x29'),JSON[_0x9a4d('0x2a')](_0x2678e7,null,0x2));}else if(fs[_0x9a4d('0x23')](_0x38ce60)){_0x2678e7[_0x9a4d('0x24')]=_0x9a4d('0x25');_0x545f6a[_0x9a4d('0x26')][_0x9a4d('0x27')]=[{'filename':_0x3f6c22,'path':_0x38ce60}];}else{_0x545f6a[_0x9a4d('0x26')][_0x9a4d('0x28')]=_0x9a4d('0x2b');if(!_0x30f84b[_0x9a4d('0x2c')]){_0x53f8db=![];logger[_0x9a4d('0xc')](_0x9a4d('0x2d'));}}if(_0x53f8db){return client[_0x9a4d('0x2e')](_0x9a4d('0x2f'),_0x545f6a)[_0x9a4d('0x30')](function(_0x251248){if(_0x251248[_0x9a4d('0x31')]){return logger[_0x9a4d('0x31')]('error\x20mail',JSON[_0x9a4d('0x2a')](_0x251248));}return logger[_0x9a4d('0xc')]('email\x20sent');})[_0x9a4d('0x32')](function(_0x1521bc){return logger[_0x9a4d('0x31')](_0x9a4d('0x33'),JSON['stringify'](_0x1521bc));});}};}function handleError(){return function(_0x12fff5){return logger[_0x9a4d('0x31')](JSON[_0x9a4d('0x2a')](_0x12fff5));};}function handleResult(_0x495049){return function(_0x32d75e){logger[_0x9a4d('0xc')](_0x9a4d('0x34'),JSON['stringify'](_0x32d75e));if(_0x495049[_0x9a4d('0xe')]&&_0x495049[_0x9a4d('0xe')][_0x9a4d('0x10')]&&!_[_0x9a4d('0x35')](_0x495049[_0x9a4d('0xd')])){setTimeout(handleSendEmail(_0x495049,_0x32d75e),0x3c*0x3e8);}};}function handleJob(_0x17d473){return function(){try{if(_[_0x9a4d('0x35')](_0x17d473[_0x9a4d('0x1b')])){return logger[_0x9a4d('0xc')](_0x9a4d('0x36'));}if(_[_0x9a4d('0x35')](_0x17d473[_0x9a4d('0x1c')])){return logger[_0x9a4d('0xc')](_0x9a4d('0x37'));}var _0x37bfdf={'startDate':moment()[_0x9a4d('0x38')](_0x17d473[_0x9a4d('0x1b')],_0x17d473[_0x9a4d('0x1c')])[_0x9a4d('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x9a4d('0x17')](_0x9a4d('0x39')),'type':_0x9a4d('0x3a'),'output':_0x17d473[_0x9a4d('0x3b')],'name':_0x17d473[_0x9a4d('0x3c')]};if(!_[_0x9a4d('0x35')](_0x17d473['DefaultReportId'])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x17d473['DefaultReportId']);return analyticDefaultReportController[_0x9a4d('0x3d')]({'id':_0x17d473[_0x9a4d('0x3e')]},_0x37bfdf)[_0x9a4d('0x30')](handleResult(_0x17d473))[_0x9a4d('0x32')](handleError());}if(!_[_0x9a4d('0x35')](_0x17d473[_0x9a4d('0x3f')])){logger[_0x9a4d('0xc')](_0x9a4d('0x40'),_0x17d473['CustomReportId']);return analyticCustomReportController[_0x9a4d('0x3d')]({'id':_0x17d473[_0x9a4d('0x3f')]},_0x37bfdf)['then'](handleResult(_0x17d473))[_0x9a4d('0x32')](handleError());}}catch(_0x39e48c){logger[_0x9a4d('0x31')](JSON[_0x9a4d('0x2a')](_0x39e48c));}return logger[_0x9a4d('0xc')]('no\x20report\x20id');};}function getJobs(_0x22f851){var _0x59dc32={};if(_0x22f851){_0x59dc32['id']=_0x22f851;}return db['Schedule']['findAll']({'where':_0x59dc32,'include':[{'model':db[_0x9a4d('0xe')],'attributes':['id',_0x9a4d('0x3c'),'email'],'include':[{'model':db[_0x9a4d('0x41')],'as':_0x9a4d('0x10')}]}]})[_0x9a4d('0x30')](function(_0x7f8dc4){var _0x4783f1=_[_0x9a4d('0x42')](manager[_0x9a4d('0x43')]);var _0x5e41dc=_['map'](_0x7f8dc4,function(_0x4516ed){return _0x4516ed['id'][_0x9a4d('0x44')]();});var _0x4e280f=_['keyBy'](_0x7f8dc4,function(_0x3868dc){return _0x3868dc['id'][_0x9a4d('0x44')]();});var _0x30cfd3=_0x22f851?_0x5e41dc:_[_0x9a4d('0x45')](_0x5e41dc,_0x4783f1);var _0x359755=_[_0x9a4d('0x46')](_0x5e41dc,_0x4783f1);var _0x5e0629=_[_0x9a4d('0x45')](_0x4783f1,_0x5e41dc);var _0x3e6ce1;var _0x4076d5;for(_0x3e6ce1=0x0;_0x3e6ce1<_0x5e0629[_0x9a4d('0x47')]&&!_0x22f851;_0x3e6ce1+=0x1){_0x4076d5=_0x5e0629[_0x3e6ce1]['toString']();if(manager['exists'](_0x4076d5)){manager[_0x9a4d('0x48')](_0x4076d5);manager[_0x9a4d('0x49')](_0x4076d5);logger[_0x9a4d('0xc')](_0x9a4d('0x4a'),_0x4076d5);}}logger[_0x9a4d('0xc')](_0x9a4d('0x4b'),JSON[_0x9a4d('0x2a')](_0x30cfd3));for(_0x3e6ce1=0x0;_0x3e6ce1<_0x30cfd3[_0x9a4d('0x47')];_0x3e6ce1+=0x1){_0x4076d5=_0x30cfd3[_0x3e6ce1][_0x9a4d('0x44')]();logger[_0x9a4d('0xc')]('index',_0x4076d5);if(_0x22f851){logger[_0x9a4d('0xc')]('my\x20id',_0x22f851);logger[_0x9a4d('0xc')](JSON[_0x9a4d('0x2a')](_0x4e280f[_0x4076d5]));BPromise[_0x9a4d('0x4c')]()[_0x9a4d('0x30')](handleJob(_0x4e280f[_0x4076d5]));logger[_0x9a4d('0xc')](_0x9a4d('0x4d'),_0x4e280f[_0x4076d5][_0x9a4d('0x3c')],_0x4e280f[_0x4076d5][_0x9a4d('0x4e')]);}else if(_0x4e280f[_0x4076d5]['cron']&&_0x4e280f[_0x4076d5][_0x9a4d('0x4f')]&&moment()[_0x9a4d('0x50')](_0x4e280f[_0x4076d5][_0x9a4d('0x51')],_0x4e280f[_0x4076d5]['endAt'])){manager[_0x9a4d('0x52')](_0x4076d5,_0x4e280f[_0x4076d5][_0x9a4d('0x4e')],handleJob(_0x4e280f[_0x4076d5]));manager[_0x9a4d('0x53')](_0x4076d5);logger['info']('add\x20cron',_0x4e280f[_0x4076d5][_0x9a4d('0x3c')],_0x4e280f[_0x4076d5][_0x9a4d('0x4e')]);}else if(manager[_0x9a4d('0x54')](_0x4076d5)){manager[_0x9a4d('0x48')](_0x4076d5);manager['deleteJob'](_0x4076d5);logger[_0x9a4d('0xc')](_0x9a4d('0x55'),_0x4e280f[_0x4076d5][_0x9a4d('0x3c')],_0x4e280f[_0x4076d5][_0x9a4d('0x4e')]);}}for(_0x3e6ce1=0x0,_0x4076d5;_0x3e6ce1<_0x359755[_0x9a4d('0x47')]&&!_0x22f851;_0x3e6ce1+=0x1){_0x4076d5=_0x359755[_0x3e6ce1][_0x9a4d('0x44')]();if(manager[_0x9a4d('0x54')](_0x4076d5)){if(_0x4e280f[_0x4076d5][_0x9a4d('0x4e')]&&_0x4e280f[_0x4076d5]['active']&&moment()[_0x9a4d('0x50')](_0x4e280f[_0x4076d5][_0x9a4d('0x51')],_0x4e280f[_0x4076d5][_0x9a4d('0x56')])){manager[_0x9a4d('0x57')](_0x4076d5,_0x4e280f[_0x4076d5]['cron'],handleJob(_0x4e280f[_0x4076d5]));logger[_0x9a4d('0xc')](_0x9a4d('0x58'),_0x4e280f[_0x4076d5][_0x9a4d('0x3c')],_0x4e280f[_0x4076d5][_0x9a4d('0x4e')]);}else{manager[_0x9a4d('0x48')](_0x4076d5);manager['deleteJob'](_0x4076d5);logger[_0x9a4d('0xc')](_0x9a4d('0x55'),_0x4e280f[_0x4076d5][_0x9a4d('0x3c')],_0x4e280f[_0x4076d5]['cron']);}}}})['catch'](function(_0x3d37c0){logger['error'](JSON[_0x9a4d('0x2a')](_0x3d37c0));});}exports[_0x9a4d('0x59')]=function(_0x2a0d6a){return getJobs(_0x2a0d6a);};exports['start']=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 db45803..6c8c2b5 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 _0x407f=['COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','then','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','bucket','CloudProvider','Neutral','catch','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','all','SequelizeValidationError','start','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeName','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText'];(function(_0x335ce5,_0x19323f){var _0x2581c6=function(_0x5dc4c6){while(--_0x5dc4c6){_0x335ce5['push'](_0x335ce5['shift']());}};_0x2581c6(++_0x19323f);}(_0x407f,0xc2));var _0xf407=function(_0x3aa50b,_0x2c9bbb){_0x3aa50b=_0x3aa50b-0x0;var _0x48928c=_0x407f[_0x3aa50b];return _0x48928c;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xf407('0x0'));var BPromise=require(_0xf407('0x1'));var db=require(_0xf407('0x2'))['db'];var logger=require(_0xf407('0x3'))(_0xf407('0x4'));function getTranscriptionJob(_0x886ba,_0x185726,_0x2bb1e4,_0x14df0c){return new Promise(function(_0x160f5c,_0x438076){var _0x2bce9d=new AWS[(_0xf407('0x5'))]({'accessKeyId':_0x185726,'secretAccessKey':_0x886ba,'region':_0x2bb1e4});_0x2bce9d[_0xf407('0x6')]({'TranscriptionJobName':_0x14df0c},function(_0x38ee37,_0x3ab539){if(_0x38ee37){return _0x438076(_0x38ee37);}else{return _0x160f5c(_0x3ab539);}});});}function sentiment(_0x5dc169,_0x2291a7,_0xc3473a,_0x436e03,_0x5af7b8){return new Promise(function(_0x4ff28e,_0x4f4840){var _0x5583fc=new AWS[(_0xf407('0x7'))]({'accessKeyId':_0x2291a7,'secretAccessKey':_0x5dc169,'region':_0xc3473a});_0x5583fc[_0xf407('0x8')]({'Text':_0x436e03,'LanguageCode':_0x5af7b8[_0xf407('0x9')](0x0,0x2)},function(_0x8f126,_0x261ac2){if(_0x8f126){return _0x4f4840(_0x8f126);}else{return _0x4ff28e(_0x261ac2);}});});}function checkTranscribeJob(_0x5637a5,_0x2ee485,_0x3f4ca0){var _0x3b26ae;return new BPromise(function(_0x12e1fc,_0x44f4bf){logger[_0xf407('0xa')](util[_0xf407('0xb')](_0xf407('0xc'),_0x5637a5['id'],_0x5637a5['transcribeName']));return getTranscriptionJob(_0x3f4ca0['data1'],_0x3f4ca0[_0xf407('0xd')],_0x2ee485['transcribeRegion'],_0x5637a5[_0xf407('0xe')])['then'](function(_0x48fd5d){logger[_0xf407('0xa')](util[_0xf407('0xb')](_0xf407('0xf'),_0x5637a5['id'],_0x5637a5[_0xf407('0xe')],_0x48fd5d[_0xf407('0x10')][_0xf407('0x11')]));if(!_0x5637a5[_0xf407('0x12')]){switch(_0x48fd5d[_0xf407('0x10')]['TranscriptionJobStatus']){case _0xf407('0x13'):var _0x1cd48f={'transcribeStatus':_0x48fd5d[_0xf407('0x10')][_0xf407('0x11')],'fileUri':_0x48fd5d[_0xf407('0x10')][_0xf407('0x14')]['TranscriptFileUri']};logger[_0xf407('0xa')](util[_0xf407('0xb')](_0xf407('0x15'),_0x5637a5['id']));return rp({'uri':_0x48fd5d[_0xf407('0x10')]['Transcript'][_0xf407('0x16')],'json':!![]})[_0xf407('0x17')](function(_0x23659c){logger[_0xf407('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x5637a5['id']));if(_0x23659c&&_0x23659c[_0xf407('0x18')]&&_0x23659c[_0xf407('0x18')][_0xf407('0x19')]&&_0x23659c[_0xf407('0x18')][_0xf407('0x19')][_0xf407('0x1a')]){_0x1cd48f[_0xf407('0x12')]='';for(var _0x5aecf2=0x0;_0x5aecf2<_0x23659c[_0xf407('0x18')][_0xf407('0x19')][_0xf407('0x1a')];_0x5aecf2++){_0x1cd48f['fileText']+=_0x23659c[_0xf407('0x18')][_0xf407('0x19')][_0x5aecf2][_0xf407('0x1b')]+'';}}return _0x5637a5[_0xf407('0x1c')](_0x1cd48f);})[_0xf407('0x17')](function(){logger[_0xf407('0xa')](util['format'](_0xf407('0x1d'),_0x5637a5['id']));if(!_0x5637a5['tempSentiment']){throw new db['Sequelize'][(_0xf407('0x1e'))](_0xf407('0x1f'));}if(!_0x2ee485[_0xf407('0x20')]||!_0x2ee485[_0xf407('0x21')]||!_0x2ee485[_0xf407('0x22')]||!_0x2ee485[_0xf407('0x23')]||!_0x2ee485['bucket']){throw new db[(_0xf407('0x24'))][(_0xf407('0x1e'))](_0xf407('0x25'));}if(!_0x1cd48f[_0xf407('0x12')]){throw new Error(_0xf407('0x26'));}if(_0x2ee485['sentimentAccountId']===_0x3f4ca0['id']){return _0x3f4ca0;}else{return db['CloudProvider'][_0xf407('0x27')]({'where':{'id':_settings[_0xf407('0x21')]}});}})[_0xf407('0x17')](function(_0x50c461){if(!_0x50c461){throw new db[(_0xf407('0x24'))][(_0xf407('0x1e'))](_0xf407('0x28'));}if(!_0x50c461['data1']||!_0x50c461[_0xf407('0xd')]){throw new db['Sequelize'][(_0xf407('0x1e'))](_0xf407('0x29'));}_0x3b26ae=_0x50c461;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5637a5['id']));return sentiment(_0x3b26ae[_0xf407('0x2a')],_0x3b26ae[_0xf407('0xd')],_0x2ee485['sentimentRegion'],_0x1cd48f[_0xf407('0x12')],_0x2ee485[_0xf407('0x23')]);})[_0xf407('0x17')](function(_0x1adc41){logger['info'](util['format'](_0xf407('0x2b'),_0x5637a5['id']));return _0x5637a5[_0xf407('0x1c')]({'sentiment':_0x1adc41[_0xf407('0x2c')],'sPositive':_0x1adc41[_0xf407('0x2d')][_0xf407('0x2e')],'sNegative':_0x1adc41[_0xf407('0x2d')][_0xf407('0x2f')],'sMixed':_0x1adc41[_0xf407('0x2d')][_0xf407('0x30')],'sNeutral':_0x1adc41[_0xf407('0x2d')]['Neutral']});})[_0xf407('0x17')](function(){logger['info'](util[_0xf407('0xb')](_0xf407('0x1d'),_0x5637a5['id']));_0x12e1fc();});case _0xf407('0x31'):return _0x5637a5[_0xf407('0x1c')]({'transcribeStatus':_0xf407('0x31'),'failureReason':_0x48fd5d['TranscriptionJob'][_0xf407('0x32')]})[_0xf407('0x17')](function(){logger[_0xf407('0xa')](util[_0xf407('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5637a5['id']));_0x12e1fc();});default:logger[_0xf407('0xa')](util[_0xf407('0xb')](_0xf407('0x33'),_0x5637a5['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x5637a5[_0xf407('0x34')]){throw new db['Sequelize']['ValidationError'](_0xf407('0x1f'));}if(!_0x2ee485[_0xf407('0x20')]||!_0x2ee485['sentimentAccountId']||!_0x2ee485[_0xf407('0x22')]||!_0x2ee485[_0xf407('0x23')]||!_0x2ee485[_0xf407('0x35')]){throw new db[(_0xf407('0x24'))][(_0xf407('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5637a5[_0xf407('0x12')]){throw new Error('Transcript\x20not\x20available');}if(_0x2ee485['sentimentAccountId']===_0x3f4ca0['id']){return _0x3f4ca0;}else{return db[_0xf407('0x36')][_0xf407('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xf407('0x17')](function(_0x44b01a){if(!_0x44b01a){throw new db[(_0xf407('0x24'))][(_0xf407('0x1e'))](_0xf407('0x28'));}if(!_0x44b01a[_0xf407('0x2a')]||!_0x44b01a[_0xf407('0xd')]){throw new db[(_0xf407('0x24'))]['ValidationError'](_0xf407('0x29'));}_0x3b26ae=_0x44b01a;logger['info'](util[_0xf407('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5637a5['id']));return sentiment(_0x3b26ae[_0xf407('0x2a')],_0x3b26ae['data2'],_0x2ee485[_0xf407('0x22')],_0x5637a5[_0xf407('0x12')],_0x2ee485[_0xf407('0x23')]);})[_0xf407('0x17')](function(_0x3ab411){logger[_0xf407('0xa')](util[_0xf407('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5637a5['id']));return _0x5637a5[_0xf407('0x1c')]({'sentiment':_0x3ab411[_0xf407('0x2c')],'sPositive':_0x3ab411[_0xf407('0x2d')][_0xf407('0x2e')],'sNegative':_0x3ab411[_0xf407('0x2d')][_0xf407('0x2f')],'sMixed':_0x3ab411['SentimentScore'][_0xf407('0x30')],'sNeutral':_0x3ab411[_0xf407('0x2d')][_0xf407('0x37')],'transcribeStatus':_0xf407('0x13')});})[_0xf407('0x17')](function(){logger[_0xf407('0xa')](util['format'](_0xf407('0x1d'),_0x5637a5['id']));_0x12e1fc();});}})[_0xf407('0x38')](function(_0x5945e6){if(_0x5945e6){if(!_0x5945e6['name']||_0x5945e6[_0xf407('0x39')]!=='SequelizeValidationError'){logger[_0xf407('0x3a')](util[_0xf407('0xb')](_0xf407('0x3b'),_0x5637a5['id']),util[_0xf407('0x3c')](_0x5945e6,{'showHidden':![],'depth':null}));}}_0x12e1fc();});});}function checkTranscribe(){var _0x4b5626;var _0x46147d;var _0x3b6c44;return db[_0xf407('0x3d')]['findAll']({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xf407('0x17')](function(_0x1b804e){if(!_0x1b804e||!_0x1b804e[_0xf407('0x1a')]){throw new db['Sequelize'][(_0xf407('0x1e'))](_0xf407('0x3e'));}_0x4b5626=_0x1b804e;return db[_0xf407('0x3f')][_0xf407('0x27')]({'where':{'id':0x1}});})['then'](function(_0x1282df){if(!_0x1282df){throw new db[(_0xf407('0x24'))]['ValidationError'](_0xf407('0x40'));}_0x46147d=_0x1282df;if(!_0x46147d[_0xf407('0x4')]||!_0x46147d[_0xf407('0x41')]||!_0x46147d['transcribeRegion']||!_0x46147d[_0xf407('0x23')]||!_0x46147d[_0xf407('0x35')]){throw new db[(_0xf407('0x24'))][(_0xf407('0x1e'))]('Transcribe\x20not\x20configured');}return db[_0xf407('0x36')][_0xf407('0x27')]({'where':{'id':_0x46147d['transcribeAccountId']}});})[_0xf407('0x17')](function(_0x588fd7){if(!_0x588fd7){throw new db[(_0xf407('0x24'))][(_0xf407('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x588fd7[_0xf407('0x2a')]||!_0x588fd7[_0xf407('0xd')]){throw new db['Sequelize'][(_0xf407('0x1e'))]('Cloud\x20Provider\x20not\x20configured');}_0x3b6c44=_0x588fd7;var _0x56bb63=[];_0x4b5626[_0xf407('0x42')](function(_0x5b6693){_0x56bb63[_0xf407('0x43')](checkTranscribeJob(_0x5b6693,_0x46147d,_0x3b6c44));});return BPromise[_0xf407('0x44')](_0x56bb63);})[_0xf407('0x38')](function(_0x1376b9){if(_0x1376b9){if(!_0x1376b9['name']||_0x1376b9['name']!==_0xf407('0x45')){logger[_0xf407('0x3a')](util[_0xf407('0x3c')](_0x1376b9,{'showHidden':![],'depth':null}));}}});}exports[_0xf407('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x4058=['util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2','transcribeRegion','transcribeName','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','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','Sentiment','SentimentScore','Positive','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','Mixed','catch','name','SequelizeValidationError','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','push','all','error','start','lodash','aws-sdk','request-promise'];(function(_0x26f4f5,_0x53419e){var _0x91bf0a=function(_0x144da0){while(--_0x144da0){_0x26f4f5['push'](_0x26f4f5['shift']());}};_0x91bf0a(++_0x53419e);}(_0x4058,0x129));var _0x8405=function(_0x3985d8,_0x3e8d55){_0x3985d8=_0x3985d8-0x0;var _0x40e77d=_0x4058[_0x3985d8];return _0x40e77d;};var _=require(_0x8405('0x0'));var AWS=require(_0x8405('0x1'));var rp=require(_0x8405('0x2'));var util=require(_0x8405('0x3'));var BPromise=require(_0x8405('0x4'));var db=require(_0x8405('0x5'))['db'];var logger=require(_0x8405('0x6'))(_0x8405('0x7'));function getTranscriptionJob(_0xf8c24c,_0x4948b2,_0x5ebf0e,_0x57fb07){return new Promise(function(_0x1db7ea,_0x257d43){var _0x3d9bf6=new AWS[(_0x8405('0x8'))]({'accessKeyId':_0x4948b2,'secretAccessKey':_0xf8c24c,'region':_0x5ebf0e});_0x3d9bf6[_0x8405('0x9')]({'TranscriptionJobName':_0x57fb07},function(_0x479c97,_0x16d810){if(_0x479c97){return _0x257d43(_0x479c97);}else{return _0x1db7ea(_0x16d810);}});});}function sentiment(_0x2b1c0a,_0x8a537e,_0x53bd7c,_0x30705f,_0x5e132b){return new Promise(function(_0x6979fd,_0xb442){var _0x50344e=new AWS[(_0x8405('0xa'))]({'accessKeyId':_0x8a537e,'secretAccessKey':_0x2b1c0a,'region':_0x53bd7c});_0x50344e[_0x8405('0xb')]({'Text':_0x30705f,'LanguageCode':_0x5e132b['substring'](0x0,0x2)},function(_0x5dfaf4,_0x56aca5){if(_0x5dfaf4){return _0xb442(_0x5dfaf4);}else{return _0x6979fd(_0x56aca5);}});});}function checkTranscribeJob(_0x4e5124,_0x262d32,_0x575fcb){var _0x495190;return new BPromise(function(_0x4e6477,_0x5388de){logger['info'](util[_0x8405('0xc')](_0x8405('0xd'),_0x4e5124['id'],_0x4e5124['transcribeName']));return getTranscriptionJob(_0x575fcb[_0x8405('0xe')],_0x575fcb[_0x8405('0xf')],_0x262d32[_0x8405('0x10')],_0x4e5124[_0x8405('0x11')])['then'](function(_0x218fe7){logger[_0x8405('0x12')](util[_0x8405('0xc')](_0x8405('0x13'),_0x4e5124['id'],_0x4e5124[_0x8405('0x11')],_0x218fe7[_0x8405('0x14')][_0x8405('0x15')]));if(!_0x4e5124[_0x8405('0x16')]){switch(_0x218fe7[_0x8405('0x14')][_0x8405('0x15')]){case _0x8405('0x17'):var _0x21376d={'transcribeStatus':_0x218fe7[_0x8405('0x14')][_0x8405('0x15')],'fileUri':_0x218fe7[_0x8405('0x14')][_0x8405('0x18')][_0x8405('0x19')]};logger[_0x8405('0x12')](util[_0x8405('0xc')](_0x8405('0x1a'),_0x4e5124['id']));return rp({'uri':_0x218fe7[_0x8405('0x14')][_0x8405('0x18')][_0x8405('0x19')],'json':!![]})[_0x8405('0x1b')](function(_0x1ceff7){logger[_0x8405('0x12')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4e5124['id']));if(_0x1ceff7&&_0x1ceff7[_0x8405('0x1c')]&&_0x1ceff7[_0x8405('0x1c')][_0x8405('0x1d')]&&_0x1ceff7['results'][_0x8405('0x1d')]['length']){_0x21376d[_0x8405('0x16')]='';for(var _0x480ad2=0x0;_0x480ad2<_0x1ceff7[_0x8405('0x1c')][_0x8405('0x1d')][_0x8405('0x1e')];_0x480ad2++){_0x21376d[_0x8405('0x16')]+=_0x1ceff7[_0x8405('0x1c')][_0x8405('0x1d')][_0x480ad2][_0x8405('0x1f')]+'';}}return _0x4e5124[_0x8405('0x20')](_0x21376d);})[_0x8405('0x1b')](function(){logger[_0x8405('0x12')](util[_0x8405('0xc')](_0x8405('0x21'),_0x4e5124['id']));if(!_0x4e5124['tempSentiment']){throw new db[(_0x8405('0x22'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x262d32[_0x8405('0x23')]||!_0x262d32[_0x8405('0x24')]||!_0x262d32[_0x8405('0x25')]||!_0x262d32[_0x8405('0x26')]||!_0x262d32[_0x8405('0x27')]){throw new db[(_0x8405('0x22'))][(_0x8405('0x28'))](_0x8405('0x29'));}if(!_0x21376d[_0x8405('0x16')]){throw new Error(_0x8405('0x2a'));}if(_0x262d32[_0x8405('0x24')]===_0x575fcb['id']){return _0x575fcb;}else{return db[_0x8405('0x2b')][_0x8405('0x2c')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x8405('0x1b')](function(_0x305fe8){if(!_0x305fe8){throw new db['Sequelize'][(_0x8405('0x28'))](_0x8405('0x2d'));}if(!_0x305fe8[_0x8405('0xe')]||!_0x305fe8['data2']){throw new db[(_0x8405('0x22'))][(_0x8405('0x28'))](_0x8405('0x2e'));}_0x495190=_0x305fe8;logger['info'](util[_0x8405('0xc')](_0x8405('0x2f'),_0x4e5124['id']));return sentiment(_0x495190['data1'],_0x495190[_0x8405('0xf')],_0x262d32['sentimentRegion'],_0x21376d[_0x8405('0x16')],_0x262d32[_0x8405('0x26')]);})[_0x8405('0x1b')](function(_0xe8de32){logger[_0x8405('0x12')](util[_0x8405('0xc')](_0x8405('0x30'),_0x4e5124['id']));return _0x4e5124[_0x8405('0x20')]({'sentiment':_0xe8de32[_0x8405('0x31')],'sPositive':_0xe8de32[_0x8405('0x32')][_0x8405('0x33')],'sNegative':_0xe8de32[_0x8405('0x32')]['Negative'],'sMixed':_0xe8de32[_0x8405('0x32')]['Mixed'],'sNeutral':_0xe8de32['SentimentScore'][_0x8405('0x34')]});})[_0x8405('0x1b')](function(){logger['info'](util[_0x8405('0xc')](_0x8405('0x21'),_0x4e5124['id']));_0x4e6477();});case _0x8405('0x35'):return _0x4e5124[_0x8405('0x20')]({'transcribeStatus':_0x8405('0x35'),'failureReason':_0x218fe7['TranscriptionJob'][_0x8405('0x36')]})[_0x8405('0x1b')](function(){logger[_0x8405('0x12')](util[_0x8405('0xc')](_0x8405('0x21'),_0x4e5124['id']));_0x4e6477();});default:logger['info'](util[_0x8405('0xc')](_0x8405('0x37'),_0x4e5124['id']));break;}}else{return BPromise[_0x8405('0x38')]()[_0x8405('0x1b')](function(){if(!_0x4e5124[_0x8405('0x39')]){throw new db[(_0x8405('0x22'))]['ValidationError'](_0x8405('0x3a'));}if(!_0x262d32[_0x8405('0x23')]||!_0x262d32[_0x8405('0x24')]||!_0x262d32[_0x8405('0x25')]||!_0x262d32[_0x8405('0x26')]||!_0x262d32[_0x8405('0x27')]){throw new db[(_0x8405('0x22'))]['ValidationError'](_0x8405('0x29'));}if(!_0x4e5124['fileText']){throw new Error(_0x8405('0x2a'));}if(_0x262d32[_0x8405('0x24')]===_0x575fcb['id']){return _0x575fcb;}else{return db['CloudProvider'][_0x8405('0x2c')]({'where':{'id':_settings[_0x8405('0x24')]}});}})[_0x8405('0x1b')](function(_0xaf6465){if(!_0xaf6465){throw new db[(_0x8405('0x22'))][(_0x8405('0x28'))](_0x8405('0x2d'));}if(!_0xaf6465[_0x8405('0xe')]||!_0xaf6465[_0x8405('0xf')]){throw new db[(_0x8405('0x22'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x495190=_0xaf6465;logger[_0x8405('0x12')](util['format'](_0x8405('0x2f'),_0x4e5124['id']));return sentiment(_0x495190[_0x8405('0xe')],_0x495190[_0x8405('0xf')],_0x262d32['sentimentRegion'],_0x4e5124[_0x8405('0x16')],_0x262d32[_0x8405('0x26')]);})['then'](function(_0x15c121){logger[_0x8405('0x12')](util[_0x8405('0xc')](_0x8405('0x30'),_0x4e5124['id']));return _0x4e5124[_0x8405('0x20')]({'sentiment':_0x15c121[_0x8405('0x31')],'sPositive':_0x15c121[_0x8405('0x32')]['Positive'],'sNegative':_0x15c121['SentimentScore']['Negative'],'sMixed':_0x15c121[_0x8405('0x32')][_0x8405('0x3b')],'sNeutral':_0x15c121[_0x8405('0x32')][_0x8405('0x34')],'transcribeStatus':'COMPLETED'});})['then'](function(){logger[_0x8405('0x12')](util[_0x8405('0xc')](_0x8405('0x21'),_0x4e5124['id']));_0x4e6477();});}})[_0x8405('0x3c')](function(_0x2eced5){if(_0x2eced5){if(!_0x2eced5[_0x8405('0x3d')]||_0x2eced5[_0x8405('0x3d')]!==_0x8405('0x3e')){logger['error'](util[_0x8405('0xc')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4e5124['id']),util[_0x8405('0x3f')](_0x2eced5,{'showHidden':![],'depth':null}));}}_0x4e6477();});});}function checkTranscribe(){var _0xe34167;var _0x14eca4;var _0x3e0861;return db[_0x8405('0x40')][_0x8405('0x41')]({'where':{'transcribeStatus':_0x8405('0x42')}})[_0x8405('0x1b')](function(_0x5f0c29){if(!_0x5f0c29||!_0x5f0c29[_0x8405('0x1e')]){throw new db[(_0x8405('0x22'))][(_0x8405('0x28'))](_0x8405('0x43'));}_0xe34167=_0x5f0c29;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x8405('0x1b')](function(_0x30b761){if(!_0x30b761){throw new db[(_0x8405('0x22'))][(_0x8405('0x28'))](_0x8405('0x44'));}_0x14eca4=_0x30b761;if(!_0x14eca4[_0x8405('0x7')]||!_0x14eca4[_0x8405('0x45')]||!_0x14eca4['transcribeRegion']||!_0x14eca4['language']||!_0x14eca4[_0x8405('0x27')]){throw new db['Sequelize'][(_0x8405('0x28'))](_0x8405('0x46'));}return db[_0x8405('0x2b')]['findOne']({'where':{'id':_0x14eca4['transcribeAccountId']}});})[_0x8405('0x1b')](function(_0x4d4e37){if(!_0x4d4e37){throw new db[(_0x8405('0x22'))][(_0x8405('0x28'))](_0x8405('0x2d'));}if(!_0x4d4e37[_0x8405('0xe')]||!_0x4d4e37[_0x8405('0xf')]){throw new db[(_0x8405('0x22'))][(_0x8405('0x28'))](_0x8405('0x2e'));}_0x3e0861=_0x4d4e37;var _0x3c0e6d=[];_0xe34167['forEach'](function(_0x1773fe){_0x3c0e6d[_0x8405('0x47')](checkTranscribeJob(_0x1773fe,_0x14eca4,_0x3e0861));});return BPromise[_0x8405('0x48')](_0x3c0e6d);})[_0x8405('0x3c')](function(_0x58dbfa){if(_0x58dbfa){if(!_0x58dbfa[_0x8405('0x3d')]||_0x58dbfa[_0x8405('0x3d')]!==_0x8405('0x3e')){logger[_0x8405('0x49')](util[_0x8405('0x3f')](_0x58dbfa,{'showHidden':![],'depth':null}));}}});}exports[_0x8405('0x4a')]=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 d52f131..1176e3f 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 _0x66a5=['WhatsappInteraction','findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','localhost','socket.io-emitter'];(function(_0x297da6,_0x599100){var _0x1f3e99=function(_0x3854d3){while(--_0x3854d3){_0x297da6['push'](_0x297da6['shift']());}};_0x1f3e99(++_0x599100);}(_0x66a5,0x1e6));var _0x566a=function(_0x4cd846,_0x4a0f50){_0x4cd846=_0x4cd846-0x0;var _0x2f2a7d=_0x66a5[_0x4cd846];return _0x2f2a7d;};'use strict';var _=require(_0x566a('0x0'));var moment=require(_0x566a('0x1'));var Redis=require(_0x566a('0x2'));var util=require(_0x566a('0x3'));var config=require(_0x566a('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x566a('0x5'))(_0x566a('0x6'));config[_0x566a('0x7')]=_['defaults'](config['redis'],{'host':_0x566a('0x8'),'port':0x18eb});var io=require(_0x566a('0x9'))(new Redis(config[_0x566a('0x7')]));function closeInteractions(){var _0x46bf72=[];return db[_0x566a('0xa')][_0x566a('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x566a('0xc')](0x18,_0x566a('0xd'))}}})[_0x566a('0xe')](function(_0x2d4ea7){if(_0x2d4ea7&&_0x2d4ea7[_0x566a('0xf')]){_0x46bf72=_[_0x566a('0x10')](_0x2d4ea7||[],'id');logger[_0x566a('0x11')](_0x566a('0x12'),_0x46bf72[_0x566a('0x13')]());return db[_0x566a('0xa')]['update']({'closeReason':_0x566a('0x14'),'disposition':_0x566a('0x15'),'closed':!![],'closedAt':moment()[_0x566a('0x16')](_0x566a('0x17'))},{'where':{'id':_0x46bf72}});}})['then'](function(){if(_0x46bf72&&_0x46bf72[_0x566a('0xf')]){logger[_0x566a('0x11')](_0x566a('0x18'),_0x46bf72[_0x566a('0x13')]());for(var _0x547d1c=0x0;_0x547d1c<_0x46bf72[_0x566a('0xf')];_0x547d1c++){io[_0x566a('0x19')](_0x566a('0x1a'),{'id':_0x46bf72[_0x547d1c],'closed':!![]});}}})['catch'](function(_0x1bf9a4){logger[_0x566a('0x1b')](_0x566a('0x1c'),_0x1bf9a4?util[_0x566a('0x1d')](_0x1bf9a4,{'showHidden':![],'depth':null}):'');});}exports[_0x566a('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x310f=['findAll','hours','then','length','map','info','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','util','../../mysqldb','schedule','redis','defaults','localhost','WhatsappInteraction'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x310f,0x13b));var _0xf310=function(_0x1fc42b,_0x1ee157){_0x1fc42b=_0x1fc42b-0x0;var _0x3bbe18=_0x310f[_0x1fc42b];return _0x3bbe18;};'use strict';var _=require(_0xf310('0x0'));var moment=require(_0xf310('0x1'));var Redis=require('ioredis');var util=require(_0xf310('0x2'));var config=require('../../config/environment');var db=require(_0xf310('0x3'))['db'];var logger=require('../logger')(_0xf310('0x4'));config[_0xf310('0x5')]=_[_0xf310('0x6')](config[_0xf310('0x5')],{'host':_0xf310('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf310('0x5')]));function closeInteractions(){var _0x620858=[];return db[_0xf310('0x8')][_0xf310('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xf310('0xa'))}}})[_0xf310('0xb')](function(_0x13b125){if(_0x13b125&&_0x13b125[_0xf310('0xc')]){_0x620858=_[_0xf310('0xd')](_0x13b125||[],'id');logger[_0xf310('0xe')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x620858[_0xf310('0xf')]());return db[_0xf310('0x8')][_0xf310('0x10')]({'closeReason':_0xf310('0x11'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xf310('0x12')](_0xf310('0x13'))},{'where':{'id':_0x620858}});}})[_0xf310('0xb')](function(){if(_0x620858&&_0x620858[_0xf310('0xc')]){logger[_0xf310('0xe')](_0xf310('0x14'),_0x620858['join']());for(var _0x57289c=0x0;_0x57289c<_0x620858[_0xf310('0xc')];_0x57289c++){io[_0xf310('0x15')](_0xf310('0x16'),{'id':_0x620858[_0x57289c],'closed':!![]});}}})[_0xf310('0x17')](function(_0x2652f9){logger[_0xf310('0x18')](_0xf310('0x19'),_0x2652f9?util[_0xf310('0x1a')](_0x2652f9,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 3574791..3954cee 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0360=['now','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating','hopper1','contacts2','hopper2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com'];(function(_0x253f0e,_0x3d2fe7){var _0x5d231a=function(_0x1f7f33){while(--_0x1f7f33){_0x253f0e['push'](_0x253f0e['shift']());}};_0x5d231a(++_0x3d2fe7);}(_0x0360,0x92));var _0x0036=function(_0x1df980,_0x2bb80a){_0x1df980=_0x1df980-0x0;var _0x3d0e9a=_0x0360[_0x1df980];return _0x3d0e9a;};'use strict';var util=require(_0x0036('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0036('0x1')]({'id':i,'firstName':_0x0036('0x2')+i,'lastName':_0x0036('0x3')+i,'phone':0xf879fb460+i,'email':_0x0036('0x4')+i+_0x0036('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0036('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0036('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x0036('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x0036('0x2')+i,'lastName':_0x0036('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x0036('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0036('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x0036('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0036('0x6')](),'updatedAt':Date[_0x0036('0x6')]()});}db[_0x0036('0x7')][_0x0036('0x8')]({'where':{}})[_0x0036('0x9')](function(){return db['CmContact'][_0x0036('0xa')](contacts);})['then'](function(){console[_0x0036('0xb')]('finished\x20populating',_0x0036('0xc'));return db[_0x0036('0xd')][_0x0036('0x8')]({'where':{}});})[_0x0036('0x9')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x0036('0x9')](function(){console[_0x0036('0xb')](_0x0036('0xe'),_0x0036('0xf'));return db[_0x0036('0x7')]['bulkCreate'](contacts2);})['then'](function(){console[_0x0036('0xb')](_0x0036('0xe'),_0x0036('0x10'));return db['CmHopper'][_0x0036('0xa')](hopper2);})['then'](function(){console[_0x0036('0xb')](_0x0036('0xe'),_0x0036('0x11'));})[_0x0036('0x12')](function(_0x27927d){console[_0x0036('0xb')](_0x27927d);}); \ No newline at end of file +var _0x4875=['CmContact','destroy','then','CmHopper','bulkCreate','log','finished\x20populating','contacts2','hopper2','catch','../mysqldb','push','Biondo','innocenzo.biondo','@xcally.com','now'];(function(_0x2bdcfd,_0x32697d){var _0x53a635=function(_0x5de676){while(--_0x5de676){_0x2bdcfd['push'](_0x2bdcfd['shift']());}};_0x53a635(++_0x32697d);}(_0x4875,0x18a));var _0x5487=function(_0xa2049b,_0x7eeb1e){_0xa2049b=_0xa2049b-0x0;var _0x2fd615=_0x4875[_0xa2049b];return _0x2fd615;};'use strict';var util=require('util');var db=require(_0x5487('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x5487('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5487('0x2')+i,'phone':0xf879fb460+i,'email':_0x5487('0x3')+i+_0x5487('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x5487('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x5487('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x5487('0x5')](),'updatedAt':Date[_0x5487('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x5487('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x5487('0x2')+i,'phone':0xf879fb460+i,'email':_0x5487('0x3')+i+_0x5487('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x5487('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x5487('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x5487('0x5')]()});}db[_0x5487('0x6')][_0x5487('0x7')]({'where':{}})[_0x5487('0x8')](function(){return db[_0x5487('0x6')]['bulkCreate'](contacts);})[_0x5487('0x8')](function(){console['log']('finished\x20populating','contacts1');return db[_0x5487('0x9')][_0x5487('0x7')]({'where':{}});})[_0x5487('0x8')](function(){return db[_0x5487('0x9')][_0x5487('0xa')](hopper);})[_0x5487('0x8')](function(){console[_0x5487('0xb')](_0x5487('0xc'),'hopper1');return db[_0x5487('0x6')][_0x5487('0xa')](contacts2);})[_0x5487('0x8')](function(){console[_0x5487('0xb')](_0x5487('0xc'),_0x5487('0xd'));return db[_0x5487('0x9')]['bulkCreate'](hopper2);})[_0x5487('0x8')](function(){console[_0x5487('0xb')](_0x5487('0xc'),_0x5487('0xe'));})[_0x5487('0xf')](function(_0x2383e){console[_0x5487('0xb')](_0x2383e);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index d5648cd..c465c00 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3bfb=['password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x3bfb,0x1d9));var _0xb3bf=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x3bfb[_0xd336fa];return _0x3370b1;};'use strict';var util=require(_0xb3bf('0x0'));var db=require(_0xb3bf('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb3bf('0x2')]({'name':util[_0xb3bf('0x3')](_0xb3bf('0x4'),_0xb3bf('0x5'),i),'fullname':util['format']('%s%s','agent',i),'email':util[_0xb3bf('0x3')](_0xb3bf('0x6'),_0xb3bf('0x5'),i),'role':_0xb3bf('0x5'),'password':_0xb3bf('0x7'),'internal':0xfa0+i,'type':_0xb3bf('0x8'),'transport':[_0xb3bf('0x9'),'ws',_0xb3bf('0xa')],'disallow':[_0xb3bf('0xb')],'allow':[_0xb3bf('0xc')],'defaultuser':util[_0xb3bf('0x3')](_0xb3bf('0x4'),_0xb3bf('0x5'),i),'encryption':_0xb3bf('0xd'),'avpf':_0xb3bf('0xd'),'force_avp':_0xb3bf('0xd'),'icesupport':_0xb3bf('0xd'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xb3bf('0xe'),'dtlsprivatekey':_0xb3bf('0xf'),'dtlssetup':_0xb3bf('0x10'),'callerid':util[_0xb3bf('0x3')](_0xb3bf('0x11'),util[_0xb3bf('0x3')](_0xb3bf('0x4'),_0xb3bf('0x5'),i),0xfa0+i)});}db[_0xb3bf('0x12')][_0xb3bf('0x13')](users)[_0xb3bf('0x14')](function(){console[_0xb3bf('0x15')](_0xb3bf('0x16'));})[_0xb3bf('0x17')](function(_0x16be16){console[_0xb3bf('0x15')](_0x16be16);}); \ No newline at end of file +var _0x3b5b=['ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','add\x20user','log','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','wss','all'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x3b5b,0xc7));var _0xb3b5=function(_0x297eea,_0x5060be){_0x297eea=_0x297eea-0x0;var _0x1c42d2=_0x3b5b[_0x297eea];return _0x1c42d2;};'use strict';var util=require(_0xb3b5('0x0'));var db=require(_0xb3b5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb3b5('0x2')]({'name':util[_0xb3b5('0x3')](_0xb3b5('0x4'),_0xb3b5('0x5'),i),'fullname':util[_0xb3b5('0x3')](_0xb3b5('0x4'),_0xb3b5('0x5'),i),'email':util[_0xb3b5('0x3')](_0xb3b5('0x6'),_0xb3b5('0x5'),i),'role':'agent','password':_0xb3b5('0x7'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0xb3b5('0x8')],'disallow':[_0xb3b5('0x9')],'allow':[_0xb3b5('0xa')],'defaultuser':util[_0xb3b5('0x3')]('%s%s','agent',i),'encryption':_0xb3b5('0xb'),'avpf':'yes','force_avp':_0xb3b5('0xb'),'icesupport':_0xb3b5('0xb'),'dtlsenable':_0xb3b5('0xb'),'dtlsverify':'no','dtlscertfile':_0xb3b5('0xc'),'dtlsprivatekey':_0xb3b5('0xd'),'dtlssetup':_0xb3b5('0xe'),'callerid':util[_0xb3b5('0x3')]('\x22%s\x22\x20<%s>',util[_0xb3b5('0x3')](_0xb3b5('0x4'),_0xb3b5('0x5'),i),0xfa0+i)});}db['User'][_0xb3b5('0xf')](users)[_0xb3b5('0x10')](function(){console['log'](_0xb3b5('0x11'));})['catch'](function(_0x26c3d3){console[_0xb3b5('0x12')](_0x26c3d3);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 9de32a9..f12a116 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3ace=['telephone:%s','trunk:%s','leave','removeChatInteractions','emit','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','remoteAddress','request','SocketIO\x20','nsp','disconnect','CONNECTED','util','bluebird','../mysqldb','Agents','User','name','agent','type','ivr','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','telephone','Campaign','format','length','user:%s','query','userProfileId','handshake','ChatInteraction','ChatInteractions','MailInteraction','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','role','voice:inbound','voice:outbound','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','getVoiceQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp'];(function(_0x4944ab,_0x48aead){var _0x11863e=function(_0x49580d){while(--_0x49580d){_0x4944ab['push'](_0x4944ab['shift']());}};_0x11863e(++_0x48aead);}(_0x3ace,0xda));var _0xe3ac=function(_0x25abca,_0x26b484){_0x25abca=_0x25abca-0x0;var _0x13a424=_0x3ace[_0x25abca];return _0x13a424;};'use strict';var _=require('lodash');var util=require(_0xe3ac('0x0'));var BPromise=require(_0xe3ac('0x1'));var db=require(_0xe3ac('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0xe3ac('0x3'),'model':db[_0xe3ac('0x4')],'attributes':['id',_0xe3ac('0x5'),'role'],'raw':!![],'where':{'role':_0xe3ac('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0xe3ac('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xe3ac('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xe3ac('0x7')],'where':{'type':_0xe3ac('0x8')}};function getAssociatedResources(_0x15f13f,_0x4213a9,_0x29ba64){return db['UserProfileSection'][_0xe3ac('0x9')]({'where':{'name':_0x15f13f,'userProfileId':_0x4213a9},'raw':!![]})[_0xe3ac('0xa')](function(_0x1000f8){if(_0x1000f8){if(_0x1000f8['autoAssociation']){switch(_0x15f13f){case _0xe3ac('0xb'):case _0xe3ac('0xc'):case _0xe3ac('0xd'):case _0xe3ac('0xe'):case _0xe3ac('0xf'):case _0xe3ac('0x10'):case _0xe3ac('0x11'):return db[_0x29ba64][_0xe3ac('0x12')](queryQueues);case _0xe3ac('0x13'):return db[_0x29ba64][_0xe3ac('0x12')](queryTelephones);case _0xe3ac('0x14'):return db[_0x29ba64][_0xe3ac('0x12')](queryTrunks);case _0xe3ac('0x15'):return db[_0x29ba64][_0xe3ac('0x12')](queryCampaigns);}}else{return db[_0xe3ac('0x16')][_0xe3ac('0x12')]({'attributes':[_0xe3ac('0x17')],'where':{'sectionId':_0x1000f8['id']},'raw':!![]})['then'](function(_0x1e4109){if(_0x1e4109){var _0xd8ccd8={'where':{'id':_[_0xe3ac('0x18')](_0x1e4109,'resourceId')},'raw':!![]};switch(_0x29ba64){case'User':_0xd8ccd8[_0xe3ac('0x19')]['role']=_0xe3ac('0x1a');break;case _0xe3ac('0x1b'):_0xd8ccd8['where'][_0xe3ac('0x7')]='ivr';break;}return db[_0x29ba64][_0xe3ac('0x12')](_0xd8ccd8);}else{return[];}});}}else{return[];}})['then'](function(_0x22f661){return _0x22f661;});}function joinOrLeaveQueues(_0x110ec9,_0x18508d,_0x1eabfb,_0x3834f9){_0x110ec9[_0x18508d](util[_0xe3ac('0x1c')]('%s:queue:%s',_0x1eabfb,_0x3834f9[_0xe3ac('0x5')]));if(_0x3834f9[_0xe3ac('0x3')]){for(var _0x59cd4d=0x0;_0x59cd4d<_0x3834f9[_0xe3ac('0x3')][_0xe3ac('0x1d')];_0x59cd4d+=0x1){_0x110ec9[_0x18508d](util[_0xe3ac('0x1c')](_0xe3ac('0x1e'),_0x3834f9[_0xe3ac('0x3')][_0x59cd4d]['name']));}}}function joinOrLeave(_0x45ab09,_0x3c685f,_0x32d011){var _0x11b2d8;if(_0x45ab09['handshake'][_0xe3ac('0x1f')]['id']){db[_0xe3ac('0x4')]['find']({'attributes':['id',_0xe3ac('0x5'),'role',_0xe3ac('0x20')],'where':{'id':_0x45ab09[_0xe3ac('0x21')][_0xe3ac('0x1f')]['id']},'include':[{'model':db[_0xe3ac('0x22')],'as':_0xe3ac('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xe3ac('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe3ac('0x25')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe3ac('0x26')],'as':_0xe3ac('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xe3ac('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xe3ac('0x29')],'as':_0xe3ac('0x2a'),'attributes':['id'],'raw':!![]}]})[_0xe3ac('0xa')](function(_0x3c9c36){if(_0x3c9c36){_0x11b2d8=_0x3c9c36;_0x45ab09[_0x3c685f](util[_0xe3ac('0x1c')]('user:%s',_0x3c9c36[_0xe3ac('0x5')]));var _0x2c0bc2=[];switch(_0x3c9c36[_0xe3ac('0x2b')]){case'admin':_0x45ab09[_0x3c685f](_0xe3ac('0x2c'));_0x45ab09[_0x3c685f](_0xe3ac('0x2d'));if(queryQueues['hasOwnProperty'](_0xe3ac('0x2e'))){delete queryQueues[_0xe3ac('0x2e')];}_0x2c0bc2[_0xe3ac('0x2f')](db['VoiceQueue']['findAll'](queryQueues));_0x2c0bc2[_0xe3ac('0x2f')](db[_0xe3ac('0x30')][_0xe3ac('0x12')](queryQueues));_0x2c0bc2[_0xe3ac('0x2f')](db[_0xe3ac('0x31')][_0xe3ac('0x12')](queryQueues));_0x2c0bc2[_0xe3ac('0x2f')](db[_0xe3ac('0x32')][_0xe3ac('0x12')](queryQueues));_0x2c0bc2['push'](db[_0xe3ac('0x33')][_0xe3ac('0x12')](queryQueues));_0x2c0bc2[_0xe3ac('0x2f')](db[_0xe3ac('0x34')][_0xe3ac('0x12')](queryQueues));_0x2c0bc2[_0xe3ac('0x2f')](db['WhatsappQueue'][_0xe3ac('0x12')](queryQueues));_0x2c0bc2[_0xe3ac('0x2f')](db[_0xe3ac('0x4')][_0xe3ac('0x12')](queryTelephones));_0x2c0bc2[_0xe3ac('0x2f')](db[_0xe3ac('0x35')][_0xe3ac('0x12')](queryTrunks));_0x2c0bc2['push'](db[_0xe3ac('0x1b')][_0xe3ac('0x12')](queryCampaigns));_0x2c0bc2[_0xe3ac('0x2f')](db['User'][_0xe3ac('0x12')](queryAgents));break;case _0xe3ac('0x36'):_0x45ab09[_0x3c685f](_0xe3ac('0x2c'));_0x45ab09[_0x3c685f](_0xe3ac('0x2d'));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources('VoiceQueues',_0x3c9c36[_0xe3ac('0x20')],'VoiceQueue'));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources(_0xe3ac('0xc'),_0x3c9c36[_0xe3ac('0x20')],_0xe3ac('0x30')));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources(_0xe3ac('0xd'),_0x3c9c36[_0xe3ac('0x20')],'FaxQueue'));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources(_0xe3ac('0xe'),_0x3c9c36['userProfileId'],_0xe3ac('0x32')));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources('MailQueues',_0x3c9c36[_0xe3ac('0x20')],_0xe3ac('0x33')));_0x2c0bc2['push'](getAssociatedResources(_0xe3ac('0x10'),_0x3c9c36['userProfileId'],'OpenchannelQueue'));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources(_0xe3ac('0x11'),_0x3c9c36[_0xe3ac('0x20')],'WhatsappQueue'));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources(_0xe3ac('0x13'),_0x3c9c36[_0xe3ac('0x20')],_0xe3ac('0x4')));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources(_0xe3ac('0x14'),_0x3c9c36[_0xe3ac('0x20')],'Trunk'));_0x2c0bc2[_0xe3ac('0x2f')](getAssociatedResources('IvrCampaigns',_0x3c9c36[_0xe3ac('0x20')],_0xe3ac('0x1b')));_0x2c0bc2[_0xe3ac('0x2f')](db[_0xe3ac('0x4')][_0xe3ac('0x12')](queryAgents));break;case _0xe3ac('0x6'):_0x45ab09[_0x3c685f](_0xe3ac('0x2c'));_0x45ab09[_0x3c685f](_0xe3ac('0x2d'));_0x2c0bc2['push'](_0x3c9c36[_0xe3ac('0x37')]({'attributes':['id',_0xe3ac('0x5')]}));_0x2c0bc2[_0xe3ac('0x2f')](_0x3c9c36['getChatQueues']({'attributes':['id',_0xe3ac('0x5')]}));_0x2c0bc2[_0xe3ac('0x2f')](_0x3c9c36['getFaxQueues']({'attributes':['id','name']}));_0x2c0bc2[_0xe3ac('0x2f')](_0x3c9c36[_0xe3ac('0x38')]({'attributes':['id',_0xe3ac('0x5')]}));_0x2c0bc2[_0xe3ac('0x2f')](_0x3c9c36['getMailQueues']({'attributes':['id','name']}));_0x2c0bc2[_0xe3ac('0x2f')](_0x3c9c36[_0xe3ac('0x39')]({'attributes':['id','name']}));_0x2c0bc2[_0xe3ac('0x2f')](_0x3c9c36[_0xe3ac('0x3a')]({'attributes':['id','name']}));break;}return BPromise[_0xe3ac('0x3b')](_0x2c0bc2);}})[_0xe3ac('0xa')](function(_0x24462b){if(_0x24462b&&_0x24462b[_0xe3ac('0x1d')]){for(var _0x146e09=0x0;_0x146e09<_0x24462b[_0xe3ac('0x1d')];_0x146e09+=0x1){for(var _0x233ddf=0x0;_0x233ddf<_0x24462b[_0x146e09]['length'];_0x233ddf+=0x1){switch(_0x146e09){case 0x0:joinOrLeaveQueues(_0x45ab09,_0x3c685f,_0xe3ac('0x3c'),_0x24462b[_0x146e09][_0x233ddf]);break;case 0x1:joinOrLeaveQueues(_0x45ab09,_0x3c685f,_0xe3ac('0x3d'),_0x24462b[_0x146e09][_0x233ddf]);break;case 0x2:joinOrLeaveQueues(_0x45ab09,_0x3c685f,_0xe3ac('0x3e'),_0x24462b[_0x146e09][_0x233ddf]);break;case 0x3:joinOrLeaveQueues(_0x45ab09,_0x3c685f,_0xe3ac('0x3f'),_0x24462b[_0x146e09][_0x233ddf]);break;case 0x4:joinOrLeaveQueues(_0x45ab09,_0x3c685f,_0xe3ac('0x40'),_0x24462b[_0x146e09][_0x233ddf]);break;case 0x5:joinOrLeaveQueues(_0x45ab09,_0x3c685f,_0xe3ac('0x41'),_0x24462b[_0x146e09][_0x233ddf]);break;case 0x6:joinOrLeaveQueues(_0x45ab09,_0x3c685f,_0xe3ac('0x42'),_0x24462b[_0x146e09][_0x233ddf]);break;case 0x7:if(_0x11b2d8['role']!=='agent')_0x45ab09[_0x3c685f](util['format'](_0xe3ac('0x43'),_0x24462b[_0x146e09][_0x233ddf][_0xe3ac('0x5')]));break;case 0x8:if(_0x11b2d8[_0xe3ac('0x2b')]!==_0xe3ac('0x6'))_0x45ab09[_0x3c685f](util[_0xe3ac('0x1c')](_0xe3ac('0x44'),_0x24462b[_0x146e09][_0x233ddf]['name']));break;case 0x9:if(_0x11b2d8['role']!==_0xe3ac('0x6'))_0x45ab09[_0x3c685f](util['format']('campaign:%s:%s',_0x24462b[_0x146e09][_0x233ddf][_0xe3ac('0x7')],_0x24462b[_0x146e09][_0x233ddf][_0xe3ac('0x5')]));break;case 0xa:_0x45ab09[_0x3c685f](util['format'](_0xe3ac('0x1e'),_0x24462b[_0x146e09][_0x233ddf][_0xe3ac('0x5')]));break;}}}}})[_0xe3ac('0xa')](function(){if(_0x3c685f===_0xe3ac('0x45')){var _0x3e0090=_[_0xe3ac('0x18')](_0x11b2d8['ChatInteractions'],'id');return _0x11b2d8[_0xe3ac('0x46')](_0x3e0090)['then'](function(){for(var _0x361964=0x0;_0x361964<_0x3e0090[_0xe3ac('0x1d')];_0x361964+=0x1){_0x32d011[_0xe3ac('0x47')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x3e0090[_0x361964]),'UserId':Number(_0x11b2d8['id'])});}});}})['then'](function(){if(_0x3c685f==='leave'){var _0x2f0e49=_[_0xe3ac('0x18')](_0x11b2d8[_0xe3ac('0x48')],'id');return _0x11b2d8[_0xe3ac('0x49')](_0x2f0e49)['then'](function(){for(var _0x1ff130=0x0;_0x1ff130<_0x2f0e49[_0xe3ac('0x1d')];_0x1ff130+=0x1){_0x32d011['emit'](_0xe3ac('0x4a'),{'MailInteractionId':Number(_0x2f0e49[_0x1ff130]),'UserId':Number(_0x11b2d8['id'])});}});}})[_0xe3ac('0xa')](function(){if(_0x3c685f===_0xe3ac('0x45')){var _0x2a29fe=_['map'](_0x11b2d8['FaxInteractions'],'id');return _0x11b2d8[_0xe3ac('0x4b')](_0x2a29fe)['then'](function(){for(var _0x48b8b9=0x0;_0x48b8b9<_0x2a29fe[_0xe3ac('0x1d')];_0x48b8b9+=0x1){_0x32d011[_0xe3ac('0x47')](_0xe3ac('0x4c'),{'FaxInteractionId':Number(_0x2a29fe[_0x48b8b9]),'UserId':Number(_0x11b2d8['id'])});}});}})['then'](function(){if(_0x3c685f===_0xe3ac('0x45')){var _0x5f24d9=_[_0xe3ac('0x18')](_0x11b2d8[_0xe3ac('0x27')],'id');return _0x11b2d8[_0xe3ac('0x4d')](_0x5f24d9)['then'](function(){for(var _0x22089a=0x0;_0x22089a<_0x5f24d9['length'];_0x22089a+=0x1){_0x32d011[_0xe3ac('0x47')](_0xe3ac('0x4e'),{'SmsInteractionId':Number(_0x5f24d9[_0x22089a]),'UserId':Number(_0x11b2d8['id'])});}});}})[_0xe3ac('0xa')](function(){if(_0x3c685f===_0xe3ac('0x45')){var _0x612828=_['map'](_0x11b2d8['OpenchannelInteractions'],'id');return _0x11b2d8[_0xe3ac('0x4f')](_0x612828)['then'](function(){for(var _0x109ea9=0x0;_0x109ea9<_0x612828[_0xe3ac('0x1d')];_0x109ea9+=0x1){_0x32d011[_0xe3ac('0x47')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x612828[_0x109ea9]),'UserId':Number(_0x11b2d8['id'])});}});}})[_0xe3ac('0xa')](function(){if(_0x3c685f===_0xe3ac('0x45')){var _0xa2d6ba=_[_0xe3ac('0x18')](_0x11b2d8[_0xe3ac('0x2a')],'id');return _0x11b2d8[_0xe3ac('0x50')](_0xa2d6ba)[_0xe3ac('0xa')](function(){for(var _0x474acd=0x0;_0x474acd<_0xa2d6ba[_0xe3ac('0x1d')];_0x474acd+=0x1){_0x32d011[_0xe3ac('0x47')](_0xe3ac('0x51'),{'WhatsappInteractionId':Number(_0xa2d6ba[_0x474acd]),'UserId':Number(_0x11b2d8['id'])});}});}})[_0xe3ac('0x52')](function(_0x31e998){_0x45ab09[_0xe3ac('0x53')](_0x31e998);});}}function onDisconnect(_0x9e0d4e,_0x19d7d5){joinOrLeave(_0x9e0d4e,_0xe3ac('0x45'),_0x19d7d5);}function onConnect(_0x33c0b3){joinOrLeave(_0x33c0b3,_0xe3ac('0x54'));}exports[_0xe3ac('0x55')]=function(_0x58f65a){_0x58f65a['on'](_0xe3ac('0x56'),function(_0x58e165){_0x58e165[_0xe3ac('0x57')](0x0);_0x58e165[_0xe3ac('0x58')]=_0x58e165['request'][_0xe3ac('0x56')][_0xe3ac('0x59')]+':'+_0x58e165[_0xe3ac('0x5a')]['connection']['remotePort'];_0x58e165['connectedAt']=new Date();_0x58e165[_0xe3ac('0x53')]=function(_0x4ad637){console[_0xe3ac('0x53')](_0xe3ac('0x5b')+_0x58e165[_0xe3ac('0x5c')]['name']+'['+_0x58e165[_0xe3ac('0x58')]+']',_0x4ad637);};_0x58e165['on'](_0xe3ac('0x5d'),function(){onDisconnect(_0x58e165,_0x58f65a);_0x58e165[_0xe3ac('0x53')]('DISCONNECTED');});onConnect(_0x58e165);_0x58e165[_0xe3ac('0x53')](_0xe3ac('0x5e'));});}; \ No newline at end of file +var _0x55c3=['CONNECTED','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','Trunks','findAll','IvrCampaigns','map','resourceId','where','Campaign','%s:queue:%s','length','format','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','ChatQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED'];(function(_0x54cc62,_0x1404c2){var _0x136795=function(_0x35394a){while(--_0x35394a){_0x54cc62['push'](_0x54cc62['shift']());}};_0x136795(++_0x1404c2);}(_0x55c3,0x189));var _0x355c=function(_0x3a6f1d,_0xd06270){_0x3a6f1d=_0x3a6f1d-0x0;var _0x2e66da=_0x55c3[_0x3a6f1d];return _0x2e66da;};'use strict';var _=require('lodash');var util=require(_0x355c('0x0'));var BPromise=require(_0x355c('0x1'));var db=require(_0x355c('0x2'))['db'];var config=require(_0x355c('0x3'));var queryQueues={'attributes':['id',_0x355c('0x4')],'include':[{'as':_0x355c('0x5'),'model':db[_0x355c('0x6')],'attributes':['id',_0x355c('0x4'),_0x355c('0x7')],'raw':!![],'where':{'role':_0x355c('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x355c('0x4')],'where':{'role':_0x355c('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x355c('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x355c('0x4')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x355c('0xa')],'where':{'type':_0x355c('0xb')}};function getAssociatedResources(_0x30f2fb,_0x42737a,_0x40ead2){return db[_0x355c('0xc')][_0x355c('0xd')]({'where':{'name':_0x30f2fb,'userProfileId':_0x42737a},'raw':!![]})[_0x355c('0xe')](function(_0x3cdc28){if(_0x3cdc28){if(_0x3cdc28[_0x355c('0xf')]){switch(_0x30f2fb){case _0x355c('0x10'):case _0x355c('0x11'):case _0x355c('0x12'):case _0x355c('0x13'):case'MailQueues':case _0x355c('0x14'):case _0x355c('0x15'):return db[_0x40ead2]['findAll'](queryQueues);case _0x355c('0x16'):return db[_0x40ead2]['findAll'](queryTelephones);case _0x355c('0x17'):return db[_0x40ead2][_0x355c('0x18')](queryTrunks);case _0x355c('0x19'):return db[_0x40ead2][_0x355c('0x18')](queryCampaigns);}}else{return db['UserProfileResource'][_0x355c('0x18')]({'attributes':['resourceId'],'where':{'sectionId':_0x3cdc28['id']},'raw':!![]})['then'](function(_0x1ddf94){if(_0x1ddf94){var _0xfbf43={'where':{'id':_[_0x355c('0x1a')](_0x1ddf94,_0x355c('0x1b'))},'raw':!![]};switch(_0x40ead2){case _0x355c('0x6'):_0xfbf43[_0x355c('0x1c')][_0x355c('0x7')]=_0x355c('0x9');break;case _0x355c('0x1d'):_0xfbf43['where'][_0x355c('0xa')]=_0x355c('0xb');break;}return db[_0x40ead2]['findAll'](_0xfbf43);}else{return[];}});}}else{return[];}})['then'](function(_0x4ad154){return _0x4ad154;});}function joinOrLeaveQueues(_0x582344,_0x445302,_0x11b117,_0x47839f){_0x582344[_0x445302](util['format'](_0x355c('0x1e'),_0x11b117,_0x47839f[_0x355c('0x4')]));if(_0x47839f[_0x355c('0x5')]){for(var _0x390f69=0x0;_0x390f69<_0x47839f[_0x355c('0x5')][_0x355c('0x1f')];_0x390f69+=0x1){_0x582344[_0x445302](util[_0x355c('0x20')](_0x355c('0x21'),_0x47839f['Agents'][_0x390f69]['name']));}}}function joinOrLeave(_0xe612be,_0x2d14b3,_0x27946d){var _0x5a378e;if(_0xe612be[_0x355c('0x22')]['query']['id']){db[_0x355c('0x6')][_0x355c('0x23')]({'attributes':['id',_0x355c('0x4'),_0x355c('0x7'),_0x355c('0x24')],'where':{'id':_0xe612be['handshake'][_0x355c('0x25')]['id']},'include':[{'model':db[_0x355c('0x26')],'as':_0x355c('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x355c('0x28')],'as':_0x355c('0x29'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x355c('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x355c('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x355c('0x2c')],'as':_0x355c('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x355c('0x2e')],'as':_0x355c('0x2f'),'attributes':['id'],'raw':!![]}]})[_0x355c('0xe')](function(_0x302391){if(_0x302391){_0x5a378e=_0x302391;_0xe612be[_0x2d14b3](util['format'](_0x355c('0x21'),_0x302391[_0x355c('0x4')]));var _0xe3acb0=[];switch(_0x302391[_0x355c('0x7')]){case _0x355c('0x30'):_0xe612be[_0x2d14b3](_0x355c('0x31'));_0xe612be[_0x2d14b3](_0x355c('0x32'));if(queryQueues[_0x355c('0x33')]('include')){delete queryQueues[_0x355c('0x34')];}_0xe3acb0[_0x355c('0x35')](db[_0x355c('0x36')]['findAll'](queryQueues));_0xe3acb0[_0x355c('0x35')](db['ChatQueue'][_0x355c('0x18')](queryQueues));_0xe3acb0[_0x355c('0x35')](db[_0x355c('0x37')]['findAll'](queryQueues));_0xe3acb0[_0x355c('0x35')](db[_0x355c('0x38')]['findAll'](queryQueues));_0xe3acb0[_0x355c('0x35')](db[_0x355c('0x39')][_0x355c('0x18')](queryQueues));_0xe3acb0['push'](db[_0x355c('0x3a')]['findAll'](queryQueues));_0xe3acb0[_0x355c('0x35')](db[_0x355c('0x3b')][_0x355c('0x18')](queryQueues));_0xe3acb0['push'](db[_0x355c('0x6')][_0x355c('0x18')](queryTelephones));_0xe3acb0[_0x355c('0x35')](db['Trunk'][_0x355c('0x18')](queryTrunks));_0xe3acb0['push'](db[_0x355c('0x1d')][_0x355c('0x18')](queryCampaigns));_0xe3acb0[_0x355c('0x35')](db[_0x355c('0x6')][_0x355c('0x18')](queryAgents));break;case'user':_0xe612be[_0x2d14b3]('voice:inbound');_0xe612be[_0x2d14b3](_0x355c('0x32'));_0xe3acb0['push'](getAssociatedResources('VoiceQueues',_0x302391[_0x355c('0x24')],_0x355c('0x36')));_0xe3acb0[_0x355c('0x35')](getAssociatedResources('ChatQueues',_0x302391[_0x355c('0x24')],_0x355c('0x3c')));_0xe3acb0[_0x355c('0x35')](getAssociatedResources('FaxQueues',_0x302391[_0x355c('0x24')],_0x355c('0x37')));_0xe3acb0[_0x355c('0x35')](getAssociatedResources(_0x355c('0x13'),_0x302391[_0x355c('0x24')],_0x355c('0x38')));_0xe3acb0['push'](getAssociatedResources('MailQueues',_0x302391['userProfileId'],'MailQueue'));_0xe3acb0[_0x355c('0x35')](getAssociatedResources('OpenchannelQueues',_0x302391['userProfileId'],_0x355c('0x3a')));_0xe3acb0['push'](getAssociatedResources(_0x355c('0x15'),_0x302391[_0x355c('0x24')],_0x355c('0x3b')));_0xe3acb0[_0x355c('0x35')](getAssociatedResources(_0x355c('0x16'),_0x302391[_0x355c('0x24')],_0x355c('0x6')));_0xe3acb0[_0x355c('0x35')](getAssociatedResources('Trunks',_0x302391[_0x355c('0x24')],_0x355c('0x3d')));_0xe3acb0[_0x355c('0x35')](getAssociatedResources('IvrCampaigns',_0x302391[_0x355c('0x24')],_0x355c('0x1d')));_0xe3acb0['push'](db[_0x355c('0x6')][_0x355c('0x18')](queryAgents));break;case _0x355c('0x8'):_0xe612be[_0x2d14b3](_0x355c('0x31'));_0xe612be[_0x2d14b3](_0x355c('0x32'));_0xe3acb0[_0x355c('0x35')](_0x302391[_0x355c('0x3e')]({'attributes':['id',_0x355c('0x4')]}));_0xe3acb0[_0x355c('0x35')](_0x302391[_0x355c('0x3f')]({'attributes':['id',_0x355c('0x4')]}));_0xe3acb0[_0x355c('0x35')](_0x302391[_0x355c('0x40')]({'attributes':['id',_0x355c('0x4')]}));_0xe3acb0[_0x355c('0x35')](_0x302391['getSmsQueues']({'attributes':['id','name']}));_0xe3acb0[_0x355c('0x35')](_0x302391[_0x355c('0x41')]({'attributes':['id',_0x355c('0x4')]}));_0xe3acb0['push'](_0x302391[_0x355c('0x42')]({'attributes':['id',_0x355c('0x4')]}));_0xe3acb0[_0x355c('0x35')](_0x302391['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise['all'](_0xe3acb0);}})[_0x355c('0xe')](function(_0x4c763c){if(_0x4c763c&&_0x4c763c[_0x355c('0x1f')]){for(var _0x331b93=0x0;_0x331b93<_0x4c763c[_0x355c('0x1f')];_0x331b93+=0x1){for(var _0x1afda3=0x0;_0x1afda3<_0x4c763c[_0x331b93][_0x355c('0x1f')];_0x1afda3+=0x1){switch(_0x331b93){case 0x0:joinOrLeaveQueues(_0xe612be,_0x2d14b3,'voice',_0x4c763c[_0x331b93][_0x1afda3]);break;case 0x1:joinOrLeaveQueues(_0xe612be,_0x2d14b3,'chat',_0x4c763c[_0x331b93][_0x1afda3]);break;case 0x2:joinOrLeaveQueues(_0xe612be,_0x2d14b3,'fax',_0x4c763c[_0x331b93][_0x1afda3]);break;case 0x3:joinOrLeaveQueues(_0xe612be,_0x2d14b3,_0x355c('0x43'),_0x4c763c[_0x331b93][_0x1afda3]);break;case 0x4:joinOrLeaveQueues(_0xe612be,_0x2d14b3,_0x355c('0x44'),_0x4c763c[_0x331b93][_0x1afda3]);break;case 0x5:joinOrLeaveQueues(_0xe612be,_0x2d14b3,_0x355c('0x45'),_0x4c763c[_0x331b93][_0x1afda3]);break;case 0x6:joinOrLeaveQueues(_0xe612be,_0x2d14b3,_0x355c('0x46'),_0x4c763c[_0x331b93][_0x1afda3]);break;case 0x7:if(_0x5a378e['role']!==_0x355c('0x8'))_0xe612be[_0x2d14b3](util[_0x355c('0x20')](_0x355c('0x47'),_0x4c763c[_0x331b93][_0x1afda3][_0x355c('0x4')]));break;case 0x8:if(_0x5a378e[_0x355c('0x7')]!==_0x355c('0x8'))_0xe612be[_0x2d14b3](util[_0x355c('0x20')]('trunk:%s',_0x4c763c[_0x331b93][_0x1afda3][_0x355c('0x4')]));break;case 0x9:if(_0x5a378e[_0x355c('0x7')]!==_0x355c('0x8'))_0xe612be[_0x2d14b3](util[_0x355c('0x20')](_0x355c('0x48'),_0x4c763c[_0x331b93][_0x1afda3][_0x355c('0xa')],_0x4c763c[_0x331b93][_0x1afda3][_0x355c('0x4')]));break;case 0xa:_0xe612be[_0x2d14b3](util[_0x355c('0x20')](_0x355c('0x21'),_0x4c763c[_0x331b93][_0x1afda3][_0x355c('0x4')]));break;}}}}})[_0x355c('0xe')](function(){if(_0x2d14b3===_0x355c('0x49')){var _0x51b24d=_[_0x355c('0x1a')](_0x5a378e[_0x355c('0x27')],'id');return _0x5a378e[_0x355c('0x4a')](_0x51b24d)[_0x355c('0xe')](function(){for(var _0x15fbc1=0x0;_0x15fbc1<_0x51b24d[_0x355c('0x1f')];_0x15fbc1+=0x1){_0x27946d['emit'](_0x355c('0x4b'),{'ChatInteractionId':Number(_0x51b24d[_0x15fbc1]),'UserId':Number(_0x5a378e['id'])});}});}})[_0x355c('0xe')](function(){if(_0x2d14b3==='leave'){var _0x1891b7=_['map'](_0x5a378e[_0x355c('0x29')],'id');return _0x5a378e[_0x355c('0x4c')](_0x1891b7)['then'](function(){for(var _0x3d4ff3=0x0;_0x3d4ff3<_0x1891b7[_0x355c('0x1f')];_0x3d4ff3+=0x1){_0x27946d[_0x355c('0x4d')](_0x355c('0x4e'),{'MailInteractionId':Number(_0x1891b7[_0x3d4ff3]),'UserId':Number(_0x5a378e['id'])});}});}})[_0x355c('0xe')](function(){if(_0x2d14b3===_0x355c('0x49')){var _0x5f28f6=_['map'](_0x5a378e[_0x355c('0x2a')],'id');return _0x5a378e['removeFaxInteractions'](_0x5f28f6)[_0x355c('0xe')](function(){for(var _0x105b85=0x0;_0x105b85<_0x5f28f6[_0x355c('0x1f')];_0x105b85+=0x1){_0x27946d[_0x355c('0x4d')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5f28f6[_0x105b85]),'UserId':Number(_0x5a378e['id'])});}});}})[_0x355c('0xe')](function(){if(_0x2d14b3===_0x355c('0x49')){var _0xf5ee5c=_['map'](_0x5a378e[_0x355c('0x2b')],'id');return _0x5a378e[_0x355c('0x4f')](_0xf5ee5c)[_0x355c('0xe')](function(){for(var _0x4717d2=0x0;_0x4717d2<_0xf5ee5c[_0x355c('0x1f')];_0x4717d2+=0x1){_0x27946d[_0x355c('0x4d')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xf5ee5c[_0x4717d2]),'UserId':Number(_0x5a378e['id'])});}});}})['then'](function(){if(_0x2d14b3===_0x355c('0x49')){var _0x2cf499=_['map'](_0x5a378e[_0x355c('0x2d')],'id');return _0x5a378e[_0x355c('0x50')](_0x2cf499)[_0x355c('0xe')](function(){for(var _0x34cb65=0x0;_0x34cb65<_0x2cf499[_0x355c('0x1f')];_0x34cb65+=0x1){_0x27946d[_0x355c('0x4d')](_0x355c('0x51'),{'OpenchannelInteractionId':Number(_0x2cf499[_0x34cb65]),'UserId':Number(_0x5a378e['id'])});}});}})[_0x355c('0xe')](function(){if(_0x2d14b3==='leave'){var _0x3bd48a=_[_0x355c('0x1a')](_0x5a378e[_0x355c('0x2f')],'id');return _0x5a378e[_0x355c('0x52')](_0x3bd48a)['then'](function(){for(var _0x3339b7=0x0;_0x3339b7<_0x3bd48a[_0x355c('0x1f')];_0x3339b7+=0x1){_0x27946d[_0x355c('0x4d')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3bd48a[_0x3339b7]),'UserId':Number(_0x5a378e['id'])});}});}})['catch'](function(_0x178bf0){_0xe612be['log'](_0x178bf0);});}}function onDisconnect(_0x3ad1ba,_0x573060){joinOrLeave(_0x3ad1ba,_0x355c('0x49'),_0x573060);}function onConnect(_0x463564){joinOrLeave(_0x463564,_0x355c('0x53'));}exports[_0x355c('0x54')]=function(_0x4ebcdc){_0x4ebcdc['on'](_0x355c('0x55'),function(_0x59fa7b){_0x59fa7b[_0x355c('0x56')](0x0);_0x59fa7b[_0x355c('0x57')]=_0x59fa7b[_0x355c('0x58')][_0x355c('0x55')][_0x355c('0x59')]+':'+_0x59fa7b[_0x355c('0x58')][_0x355c('0x55')][_0x355c('0x5a')];_0x59fa7b[_0x355c('0x5b')]=new Date();_0x59fa7b[_0x355c('0x5c')]=function(_0x195c5b){console[_0x355c('0x5c')](_0x355c('0x5d')+_0x59fa7b[_0x355c('0x5e')][_0x355c('0x4')]+'['+_0x59fa7b[_0x355c('0x57')]+']',_0x195c5b);};_0x59fa7b['on'](_0x355c('0x5f'),function(){onDisconnect(_0x59fa7b,_0x4ebcdc);_0x59fa7b['log'](_0x355c('0x60'));});onConnect(_0x59fa7b);_0x59fa7b[_0x355c('0x5c')](_0x355c('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 4ac0190..f46748c 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 _0x9d82=['SIP/%s','AfterCreate','changed','closed','substatus','sequelize','interface','AfterUpdate','User','find','fullname','internal','default','length','hasOwnProperty','model','hook','toLowerCase','condition','util','../../mysqldb','../logger','triggers','client','http','Chat','ChatInteraction','newinteraction','afterUpdate','closedinteraction','ChatOfflineMessage','afterCreate','newmessage','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelMessage','then','Trigger,\x20%s','EventManager','error','catch','channel','motionChannel','event','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','contact','UserId','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','offlineMessage','opened','resolve','QueryTypes','SELECT','format'];(function(_0x47a12a,_0x70f591){var _0x30cd40=function(_0x46b68f){while(--_0x46b68f){_0x47a12a['push'](_0x47a12a['shift']());}};_0x30cd40(++_0x70f591);}(_0x9d82,0x13b));var _0x29d8=function(_0x5d6cd5,_0x4b43ae){_0x5d6cd5=_0x5d6cd5-0x0;var _0x5448c5=_0x9d82[_0x5d6cd5];return _0x5448c5;};'use strict';var util=require(_0x29d8('0x0'));var db=require(_0x29d8('0x1'))['db'];var jayson=require('jayson/promise');var logger=require(_0x29d8('0x2'))(_0x29d8('0x3'));var client=jayson[_0x29d8('0x4')][_0x29d8('0x5')]({'port':0x232a});var triggers=[{'channel':_0x29d8('0x6'),'model':_0x29d8('0x7'),'event':'afterCreate','condition':_0x29d8('0x8'),'callback':afterCreate},{'channel':_0x29d8('0x6'),'model':_0x29d8('0x7'),'event':_0x29d8('0x9'),'condition':_0x29d8('0xa'),'callback':afterUpdate},{'channel':_0x29d8('0x6'),'model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x29d8('0x6'),'model':_0x29d8('0xb'),'event':_0x29d8('0xc'),'condition':_0x29d8('0xd'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x29d8('0xe'),'event':_0x29d8('0xc'),'condition':_0x29d8('0x8'),'callback':afterCreate},{'channel':'Sms','model':_0x29d8('0xe'),'event':_0x29d8('0x9'),'condition':_0x29d8('0xa'),'callback':afterUpdate},{'channel':'Sms','model':_0x29d8('0xf'),'event':_0x29d8('0xc'),'condition':_0x29d8('0xd'),'callback':afterCreateMessage},{'channel':_0x29d8('0x10'),'model':_0x29d8('0x11'),'event':_0x29d8('0xc'),'condition':_0x29d8('0x8'),'callback':afterCreate},{'channel':_0x29d8('0x10'),'model':_0x29d8('0x11'),'event':_0x29d8('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x29d8('0x10'),'model':_0x29d8('0x12'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x29d8('0x13'),'model':_0x29d8('0x14'),'event':_0x29d8('0xc'),'condition':_0x29d8('0x8'),'callback':afterCreate},{'channel':_0x29d8('0x13'),'model':_0x29d8('0x14'),'event':'afterUpdate','condition':_0x29d8('0xa'),'callback':afterUpdate},{'channel':_0x29d8('0x13'),'model':_0x29d8('0x15'),'event':_0x29d8('0xc'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x29d8('0x16'),'model':_0x29d8('0x17'),'event':_0x29d8('0xc'),'condition':_0x29d8('0x8'),'callback':afterCreate},{'channel':'Mail','model':_0x29d8('0x17'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0x29d8('0x18'),'event':'afterCreate','condition':_0x29d8('0xd'),'callback':afterCreateMessage},{'channel':_0x29d8('0x19'),'model':'OpenchannelInteraction','event':'afterCreate','condition':_0x29d8('0x8'),'callback':afterCreate},{'channel':_0x29d8('0x19'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x29d8('0xa'),'callback':afterUpdate},{'channel':_0x29d8('0x19'),'model':_0x29d8('0x1a'),'event':'afterCreate','condition':_0x29d8('0xd'),'callback':afterCreateMessage}];function request(_0xb574f){return client['request']('EventManager',_0xb574f)[_0x29d8('0x1b')](function(_0x1afc47){logger['info'](_0x29d8('0x1c'),_0x29d8('0x1d'),_0x1afc47);if(_0x1afc47[_0x29d8('0x1e')]){if(_0x1afc47['error']['code']===0x1f4){logger['error']('Trigger,\x20%s',_0x29d8('0x1d'),_0x1afc47[_0x29d8('0x1e')]);}}})[_0x29d8('0x1f')](function(_0x196ff6){logger[_0x29d8('0x1e')](_0x29d8('0x1c'),_0x29d8('0x1d'),_0x196ff6);});}function afterCreateMessage(_0x4259a0){return function(_0x1593ea){_0x1593ea=_0x1593ea['get']({'plain':!![]});_0x1593ea[_0x29d8('0x20')]=_0x4259a0;_0x1593ea[_0x29d8('0x21')]=_0x4259a0;_0x1593ea[_0x29d8('0x22')]=_0x1593ea[_0x29d8('0x23')];Promise['resolve']()[_0x29d8('0x1b')](function(){if(typeof _0x1593ea[_0x29d8('0x24')]===_0x29d8('0x25'))return null;var _0xdc9e49=_0x29d8('0x26')+_0x1593ea[_0x29d8('0x24')];return db['sequelize'][_0x29d8('0x27')](_0xdc9e49,{'type':db[_0x29d8('0x28')]['QueryTypes']['SELECT'],'raw':!![]});})[_0x29d8('0x1b')](function(_0x16cbbc){if(_0x16cbbc){_0x1593ea[_0x29d8('0x29')]=_0x16cbbc[0x0];}if(typeof _0x1593ea['UserId']==='undefined')return;return getAgent(_0x1593ea[_0x29d8('0x2a')]);})[_0x29d8('0x1b')](function(_0x276958){if(_0x276958){_0x1593ea['interface']=util['format']('SIP/%s',_0x276958[_0x29d8('0x2b')]);_0x1593ea[_0x29d8('0x2c')]=_0x276958;_0x1593ea['channel']=_0x4259a0;return request({'event':_0x29d8('0x2d'),'message':_0x1593ea});}else{return request({'event':_0x29d8('0x2e'),'message':_0x1593ea});}})[_0x29d8('0x1f')](function(_0x549161){logger[_0x29d8('0x1e')](_0x29d8('0x1c'),_0x29d8('0x2f'),_0x549161);});};}function afterCreateOfflineMessage(_0x4008e7){return function(_0x34e305){_0x34e305=_0x34e305[_0x29d8('0x30')]({'plain':!![]});_0x34e305[_0x29d8('0x20')]=_0x4008e7;_0x34e305[_0x29d8('0x21')]=_0x4008e7;_0x34e305[_0x29d8('0x22')]=_0x29d8('0x31');return request({'event':_0x34e305[_0x29d8('0x22')],'message':_0x34e305});};}function afterCreate(_0x43ff72,_0x172f62){return function(_0x4ce82d){_0x4ce82d=_0x4ce82d['get']({'plain':!![]});_0x4ce82d[_0x29d8('0x20')]=_0x43ff72;_0x4ce82d[_0x29d8('0x21')]=_0x43ff72;_0x4ce82d[_0x29d8('0x22')]=_0x29d8('0x32');Promise[_0x29d8('0x33')]()['then'](function(){var _0x470e20=_0x29d8('0x26')+_0x4ce82d[_0x29d8('0x24')];return db['sequelize']['query'](_0x470e20,{'type':db['Sequelize'][_0x29d8('0x34')][_0x29d8('0x35')],'raw':!![]});})[_0x29d8('0x1b')](function(_0x36b94c){if(_0x36b94c){_0x4ce82d[_0x29d8('0x29')]=_0x36b94c[0x0];}if(typeof _0x4ce82d['UserId']===_0x29d8('0x25'))return;return getAgent(_0x4ce82d['UserId']);})[_0x29d8('0x1b')](function(_0xf400ce){if(_0xf400ce){_0x4ce82d['interface']=util[_0x29d8('0x36')](_0x29d8('0x37'),_0xf400ce[_0x29d8('0x2b')]);_0x4ce82d[_0x29d8('0x2c')]=_0xf400ce;}return request({'event':_0x172f62,'message':_0x4ce82d});})[_0x29d8('0x1f')](function(_0xc849fa){logger[_0x29d8('0x1e')](_0x29d8('0x1c'),_0x29d8('0x38'),_0xc849fa);});};}function afterUpdate(_0x4afda2){return function(_0x5b1a42){var _0x480596=_0x5b1a42[_0x29d8('0x39')]('closed')&&_0x5b1a42[_0x29d8('0x3a')];var _0x436f02=_0x5b1a42['changed'](_0x29d8('0x3b'));if(_0x480596||_0x436f02){var _0x54703a=_0x480596?_0x29d8('0xa'):_0x29d8('0x3b');var _0x4b769e=_0x5b1a42[_0x29d8('0x30')]({'plain':!![]});_0x4b769e[_0x29d8('0x20')]=_0x4afda2;_0x4b769e[_0x29d8('0x21')]=_0x4afda2;_0x4b769e[_0x29d8('0x22')]=_0x480596?'closed':_0x29d8('0x3b');var _0x574411='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b769e[_0x29d8('0x24')];return db[_0x29d8('0x3c')]['query'](_0x574411,{'type':db['Sequelize'][_0x29d8('0x34')][_0x29d8('0x35')],'raw':!![]})['then'](function(_0x3000eb){if(_0x3000eb){_0x4b769e['contact']=_0x3000eb[0x0];}if(typeof _0x4b769e['UserId']===_0x29d8('0x25'))return;return getAgent(_0x4b769e['UserId']);})[_0x29d8('0x1b')](function(_0x37e390){if(_0x37e390){_0x4b769e[_0x29d8('0x3d')]=util[_0x29d8('0x36')]('SIP/%s',_0x37e390[_0x29d8('0x2b')]);_0x4b769e[_0x29d8('0x2c')]=_0x37e390;}return request({'event':_0x54703a,'message':_0x4b769e});})[_0x29d8('0x1f')](function(_0x59e816){logger[_0x29d8('0x1e')](_0x29d8('0x1c'),_0x29d8('0x3e'),_0x59e816);});}};}function getAgent(_0x14e221){return db[_0x29d8('0x3f')][_0x29d8('0x40')]({'where':{'id':_0x14e221},'attributes':['id',_0x29d8('0x2b'),_0x29d8('0x41'),'email',_0x29d8('0x42')],'raw':!![]})['then'](function(_0x3e141d){return _0x3e141d;});}exports[_0x29d8('0x43')]=function(){for(var _0x40178e=0x0;_0x40178e=_0x250590[_0x4e46('0x13')]){throw Error(_0x4e46('0x14'));}_0x1d1d70(_0x364785);})['catch'](function(_0x4ce6f2){_0x215f0b(_0x4ce6f2);});});}; \ No newline at end of file +var _0x75b8=['User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','mail','fax','sms','openchannel','getChannels','includes','isUndefined','updateAttributes','getLicense','role','agent'];(function(_0x146a72,_0x1dd8f2){var _0x5d5b6d=function(_0x26074e){while(--_0x26074e){_0x146a72['push'](_0x146a72['shift']());}};_0x5d5b6d(++_0x1dd8f2);}(_0x75b8,0x6f));var _0x875b=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0x75b8[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require(_0x875b('0x0'));var BPromise=require('bluebird');var db=require(_0x875b('0x1'))['db'];var util=require(_0x875b('0x2'));var channels=[_0x875b('0x3'),_0x875b('0x4'),'chat',_0x875b('0x5'),_0x875b('0x6'),'whatsapp',_0x875b('0x7')];exports[_0x875b('0x8')]=function(){return channels;};exports['isValidChannel']=function(_0x5ce642){_0x5ce642=_0x5ce642['toLowerCase']();return _[_0x875b('0x9')](channels,_0x5ce642);};exports['clearBlockUser']=function(_0x44781f,_0x54763b,_0x324c46,_0x331c16){var _0x5da878={'loginAttempts':_0x54763b,'blocked':_0x324c46};if(!_[_0x875b('0xa')](_0x331c16)){_0x5da878['blockedAt']=_0x331c16;}return _0x44781f[_0x875b('0xb')](_0x5da878);};exports[_0x875b('0xc')]=function(_0x4e215b){return new BPromise(function(_0x122cc9,_0x4e2e91){var _0x54b1ec=0x0;if(_0x4e215b[_0x875b('0xd')]!==_0x875b('0xe')){_0x122cc9(_0x4e215b);}db[_0x875b('0xf')][_0x875b('0x10')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4e215b['id']}}})[_0x875b('0x11')](function(_0x292a6b){_0x54b1ec=_0x292a6b;return util[_0x875b('0xc')]();})[_0x875b('0x11')](function(_0x3b1720){if(_0x3b1720&&_0x3b1720[_0x875b('0x12')]&&_0x54b1ec>=_0x3b1720[_0x875b('0x12')]){throw Error(_0x875b('0x13'));}_0x122cc9(_0x4e215b);})[_0x875b('0x14')](function(_0x1384b5){_0x4e2e91(_0x1384b5);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 6ba32b6..d5b1751 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7145=['404','status','json','send'];(function(_0x51a608,_0x4bab41){var _0x4ef812=function(_0x1a934a){while(--_0x1a934a){_0x51a608['push'](_0x51a608['shift']());}};_0x4ef812(++_0x4bab41);}(_0x7145,0x98));var _0x5714=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7145[_0x20a584];return _0x4b41a8;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2cde29,_0xdce033){var _0x11ade0=_0x5714('0x0');var _0x48bbcf=0x194;var _0x1ae560={'status':_0x48bbcf};_0xdce033[_0x5714('0x1')](_0x1ae560['status']);_0xdce033['render'](_0x11ade0,{},function(_0x1c6674,_0x2ecd59){if(_0x1c6674){return _0xdce033[_0x5714('0x1')](_0x1ae560[_0x5714('0x1')])[_0x5714('0x2')](_0x1ae560);}_0xdce033[_0x5714('0x3')](_0x2ecd59);});}; \ No newline at end of file +var _0xc437=['json','send','exports','404','status'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xc437,0xca));var _0x7c43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc437[_0x2641f9];return _0x585741;};'use strict';module[_0x7c43('0x0')][0x194]=function pageNotFound(_0x4e7f8e,_0x1c4a21){var _0x430d97=_0x7c43('0x1');var _0x2e4bec=0x194;var _0x47f227={'status':_0x2e4bec};_0x1c4a21['status'](_0x47f227[_0x7c43('0x2')]);_0x1c4a21['render'](_0x430d97,{},function(_0x3eaea8,_0x52ab13){if(_0x3eaea8){return _0x1c4a21['status'](_0x47f227['status'])[_0x7c43('0x3')](_0x47f227);}_0x1c4a21[_0x7c43('0x4')](_0x52ab13);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 97e857c..17de4fd 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3d4=['MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','FaxAccount','../api/faxAccount/faxAccount.model','../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/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../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','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','VoicePrefix','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../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','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserSetting','VoiceMail','cascade','UserId','hasOne','userSetting','hasMany','Recordings','Extensions','HopperFinals','CmHopperHistory','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','UserProfile','userProfileId','chat_group_has_users','belongsToMany','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','user_has_teams','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoicePrefix','ChatQueues','UserChatQueue','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccount','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','BlackLists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Answers','MailMessage','Interactions','List','Pause','Teams','MailInteractionId','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachment','Attachments','Account','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','MailQueueReport','ListId','DashboardItem','Items','Dispositions','FaxAccountId','FaxApplication','Exntensions','TagId','Owner','fax_interaction_has_tags','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','ChatProactiveAction','ProactiveActions','ChatApplication','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','ChatGroup','Members','CompanyId','HopperHistories','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','ParentId','Intervals','ChatApplications','FaxApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Action','Actions','TriggerId','Fields','Configurations','Subjects','SubjectId','Descriptions','FieldId','AccountId','Description','DescriptionId','VariableId','Field','int_desk_configuration_has_tags','Subject','ZohoConfiguration','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowAccount','ChatQueueReport','FromId','ToId','SessionId','ProjectId','MailQueues','FaxQueues','team_has_openchannel_queues','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','HopperHistory','Queues','cm_user_has_lists','UserProfileSections','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','WhatsappQueueId','Imap','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','name','username','options','database','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model'];(function(_0x2f694f,_0x75d9c7){var _0x21cee6=function(_0x35180c){while(--_0x35180c){_0x2f694f['push'](_0x2f694f['shift']());}};_0x21cee6(++_0x75d9c7);}(_0xc3d4,0x1be));var _0x4c3d=function(_0x11d830,_0x116d43){_0x11d830=_0x11d830-0x0;var _0x4868e7=_0xc3d4[_0x11d830];return _0x4868e7;};'use strict';var config=require(_0x4c3d('0x0'));var Sequelize=require(_0x4c3d('0x1'));var _=require(_0x4c3d('0x2'));var jstz=require(_0x4c3d('0x3'));var timezone=jstz[_0x4c3d('0x4')]();config[_0x4c3d('0x1')]=_[_0x4c3d('0x5')](config['sequelize'],{'database':_0x4c3d('0x6'),'username':_0x4c3d('0x7'),'password':'xC@LL1234','options':{'host':_0x4c3d('0x8'),'port':0xcea,'dialect':_0x4c3d('0x9'),'dialectOptions':{'charset':_0x4c3d('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x4c3d('0xb'),'collate':_0x4c3d('0xc')}}});config[_0x4c3d('0xd')]=_[_0x4c3d('0x5')](config[_0x4c3d('0xd')],{'database':_0x4c3d('0x6'),'username':_0x4c3d('0x7'),'password':_0x4c3d('0xe'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x4c3d('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4c3d('0xf')](),'define':{'charset':_0x4c3d('0xb'),'collate':_0x4c3d('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize']['database'],config[_0x4c3d('0x1')][_0x4c3d('0x10')],config['sequelize']['password'],config[_0x4c3d('0x1')][_0x4c3d('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4c3d('0xd')][_0x4c3d('0x12')],config['sequelizeHistory'][_0x4c3d('0x10')],config['sequelizeHistory'][_0x4c3d('0x13')],config[_0x4c3d('0xd')][_0x4c3d('0x11')])};db[_0x4c3d('0x14')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x16'));db['VoiceChanSpy']=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x17'));db['VoiceContext']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x18'));db[_0x4c3d('0x19')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x1a'));db['VoiceMusicOnHold']=db['sequelize'][_0x4c3d('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x4c3d('0x1b')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x1c'));db[_0x4c3d('0x1d')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x1e'));db[_0x4c3d('0x1f')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x20'));db['VoiceMail']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x21'));db[_0x4c3d('0x22')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x23'));db[_0x4c3d('0x24')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x25'));db['VoiceDialReport']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4c3d('0x26')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x27'));db['VoiceQueueReport']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x28'));db[_0x4c3d('0x29')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x2a'));db[_0x4c3d('0x2b')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/trunk/trunk.model');db[_0x4c3d('0x2c')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x2d'));db[_0x4c3d('0x2e')]=db['sequelize']['import'](_0x4c3d('0x2f'));db[_0x4c3d('0x30')]=db[_0x4c3d('0x1')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/userChatQueue/userChatQueue.model');db[_0x4c3d('0x31')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x32'));db[_0x4c3d('0x33')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x34'));db[_0x4c3d('0x35')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x36'));db[_0x4c3d('0x37')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x38'));db[_0x4c3d('0x39')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x3a'));db[_0x4c3d('0x3b')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x3c'));db[_0x4c3d('0x3d')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/mailServerOut/mailServerOut.model');db[_0x4c3d('0x3e')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x3f'));db[_0x4c3d('0x40')]=db[_0x4c3d('0x1')]['import']('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db['sequelize']['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x4c3d('0x41')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x42'));db['MailMessage']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x43'));db[_0x4c3d('0x44')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x45'));db['MailQueueReport']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x46'));db[_0x4c3d('0x47')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x48'));db['DashboardItem']=db[_0x4c3d('0x1')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x4c3d('0x49')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x4a'));db['FaxApplication']=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x4b'));db[_0x4c3d('0x4c')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x4d'));db[_0x4c3d('0x4e')]=db['sequelize']['import'](_0x4c3d('0x4f'));db[_0x4c3d('0x50')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x51'));db[_0x4c3d('0x52')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x53'));db[_0x4c3d('0x54')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x55'));db[_0x4c3d('0x56')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x57'));db[_0x4c3d('0x58')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x59'));db['SmsQueue']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/smsQueue/smsQueue.model');db[_0x4c3d('0x5a')]=db['sequelize'][_0x4c3d('0x15')]('../api/openchannelAccount/openchannelAccount.model');db[_0x4c3d('0x5b')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x5c'));db[_0x4c3d('0x5d')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x5e'));db[_0x4c3d('0x5f')]=db[_0x4c3d('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0x4c3d('0x60')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0x4c3d('0x61')]=db['sequelize'][_0x4c3d('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0x4c3d('0x62')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x63'));db['ChatApplication']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x64'));db[_0x4c3d('0x65')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x66'));db[_0x4c3d('0x67')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x68'));db['ChatOfflineMessage']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x4c3d('0x69')]=db['sequelize']['import'](_0x4c3d('0x6a'));db['ChatGroup']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x6b'));db['ChatProactiveAction']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x6c'));db[_0x4c3d('0x6d')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x6e'));db['CmContact']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x6f'));db[_0x4c3d('0x70')]=db['sequelize'][_0x4c3d('0x15')]('../api/cmHopper/cmHopper.model');db[_0x4c3d('0x71')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x72'));db[_0x4c3d('0x73')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x74'));db['CmHopperHistory']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x75'));db[_0x4c3d('0x76')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x77'));db[_0x4c3d('0x78')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x79'));db['Action']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x7a'));db[_0x4c3d('0x7b')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x7c'));db[_0x4c3d('0x7d')]=db[_0x4c3d('0x1')]['import']('../api/cannedAnswer/cannedAnswer.model');db[_0x4c3d('0x7e')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x7f'));db[_0x4c3d('0x80')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x81'));db[_0x4c3d('0x82')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x83'));db['Pause']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x84'));db[_0x4c3d('0x85')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x86'));db[_0x4c3d('0x87')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x88'));db[_0x4c3d('0x89')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x8a'));db[_0x4c3d('0x8b')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x8c'));db[_0x4c3d('0x8d')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x8e'));db[_0x4c3d('0x8f')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x90'));db[_0x4c3d('0x91')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x92'));db[_0x4c3d('0x93')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x94'));db[_0x4c3d('0x95')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x96'));db['IntegrationReport']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/integrationReport/integrationReport.model');db[_0x4c3d('0x97')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x98'));db['AnalyticDefaultReport']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x99'));db[_0x4c3d('0x9a')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x9b'));db[_0x4c3d('0x9c')]=db['sequelize'][_0x4c3d('0x15')]('../api/analyticMetric/analyticMetric.model');db[_0x4c3d('0x9d')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x9e'));db[_0x4c3d('0x9f')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xa0'));db[_0x4c3d('0xa1')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xa2'));db[_0x4c3d('0xa3')]=db['sequelize']['import'](_0x4c3d('0xa4'));db[_0x4c3d('0xa5')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xa6'));db[_0x4c3d('0xa7')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xa8'));db[_0x4c3d('0xa9')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xaa'));db[_0x4c3d('0xab')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0xac'));db[_0x4c3d('0xad')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xae'));db[_0x4c3d('0xaf')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xb0'));db[_0x4c3d('0xb1')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xb2'));db['ZohoConfiguration']=db['sequelize'][_0x4c3d('0x15')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x4c3d('0xb3')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xb4'));db['ZendeskConfiguration']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xb5'));db[_0x4c3d('0xb6')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xb7'));db[_0x4c3d('0xb8')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xb9'));db['FreshdeskConfiguration']=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0xba'));db[_0x4c3d('0xbb')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xbc'));db[_0x4c3d('0xbd')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xbe'));db[_0x4c3d('0xbf')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xc0'));db[_0x4c3d('0xc1')]=db[_0x4c3d('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xc2'));db[_0x4c3d('0xc3')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xc4'));db[_0x4c3d('0xc5')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xc6'));db[_0x4c3d('0xc7')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xc8'));db[_0x4c3d('0xc9')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x4c3d('0xca')]=db['sequelize'][_0x4c3d('0x15')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x4c3d('0xcb')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xcc'));db[_0x4c3d('0xcd')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xce'));db[_0x4c3d('0xcf')]=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xd0'));db[_0x4c3d('0x95')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0x96'));db[_0x4c3d('0xd1')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xd2'));db['ChatQueueReport']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0xd3'));db[_0x4c3d('0xd4')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xd5'));db[_0x4c3d('0xd6')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0xd7'));db[_0x4c3d('0xd8')]=db['sequelize'][_0x4c3d('0x15')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x4c3d('0xd9')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xda'));db[_0x4c3d('0xdb')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xdc'));db[_0x4c3d('0xdd')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xde'));db[_0x4c3d('0xdf')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xe0'));db[_0x4c3d('0xe1')]=db[_0x4c3d('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x4c3d('0xe2')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xe3'));db['SquareOdbc']=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0xe4'));db[_0x4c3d('0xe5')]=db[_0x4c3d('0x1')]['import']('../api/squareProject/squareProject.model');db[_0x4c3d('0xe6')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0xe7'));db['SquareMessage']=db['sequelize']['import'](_0x4c3d('0xe8'));db[_0x4c3d('0xe9')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xea'));db[_0x4c3d('0xeb')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0xec'));db[_0x4c3d('0xed')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xee'));db[_0x4c3d('0xef')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xf0'));db['Attachment']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xf1'));db[_0x4c3d('0xf2')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/plugin/plugin.model');db[_0x4c3d('0xf3')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0x4c3d('0xf4')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xf5'));db[_0x4c3d('0xf6')]=db['sequelize'][_0x4c3d('0x15')](_0x4c3d('0xf7'));db['OpenchannelTransferReport']=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xf8'));db[_0x4c3d('0xf9')]=db[_0x4c3d('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/cmList/cmList.model');db[_0x4c3d('0xfa')]=db[_0x4c3d('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0x4c3d('0x1')]['import']('../api/userProfile/userProfile.model');db[_0x4c3d('0xfb')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xfc'));db[_0x4c3d('0xfd')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0x4c3d('0xfe')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0xff'));db['WhatsappAccount']=db[_0x4c3d('0x1')]['import'](_0x4c3d('0x100'));db[_0x4c3d('0x101')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x102'));db[_0x4c3d('0x103')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x104'));db[_0x4c3d('0x105')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x106'));db[_0x4c3d('0x107')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x108'));db[_0x4c3d('0x109')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x10a'));db[_0x4c3d('0x10b')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x10c'));db['CloudProvider']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/cloudProvider/cloudProvider.model');db[_0x4c3d('0x10d')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x10e'));db[_0x4c3d('0x10f')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')](_0x4c3d('0x110'));db['UserVoicePrefix']=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x4c3d('0x111')]=db[_0x4c3d('0x1')][_0x4c3d('0x15')]('../api/user-setting/user-setting.model');db['User']['hasOne'](db[_0x4c3d('0x112')],{'as':'VoiceMail','onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')][_0x4c3d('0x115')](db[_0x4c3d('0x111')],{'as':_0x4c3d('0x116'),'onDelete':_0x4c3d('0x113'),'foreignKey':'UserId'});db['User'][_0x4c3d('0x117')](db['VoiceRecording'],{'as':_0x4c3d('0x118'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')][_0x4c3d('0x117')](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x4c3d('0x114')});db['User'][_0x4c3d('0x117')](db['VoiceExtension'],{'as':_0x4c3d('0x119'),'onDelete':'cascade','hooks':!![]});db[_0x4c3d('0x14')][_0x4c3d('0x117')](db[_0x4c3d('0x73')],{'as':_0x4c3d('0x11a'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')][_0x4c3d('0x117')](db[_0x4c3d('0x11b')],{'as':'HopperHistory','foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')][_0x4c3d('0x117')](db[_0x4c3d('0x76')],{'as':_0x4c3d('0x76'),'foreignKey':_0x4c3d('0x114')});db['User'][_0x4c3d('0x117')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x4c3d('0x114')});db['User'][_0x4c3d('0x117')](db[_0x4c3d('0x65')],{'as':_0x4c3d('0x11c'),'foreignKey':'UserId'});db['User'][_0x4c3d('0x117')](db['SmsInteraction'],{'as':_0x4c3d('0x11d'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')]['hasMany'](db[_0x4c3d('0x4c')],{'as':_0x4c3d('0x11e'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')][_0x4c3d('0x117')](db[_0x4c3d('0x41')],{'as':_0x4c3d('0x11f'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')][_0x4c3d('0x117')](db['WhatsappInteraction'],{'as':_0x4c3d('0x120'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x14')][_0x4c3d('0x117')](db[_0x4c3d('0xfe')],{'as':_0x4c3d('0x121'),'foreignKey':_0x4c3d('0x122')});db[_0x4c3d('0x14')]['belongsTo'](db[_0x4c3d('0x123')],{'as':_0x4c3d('0x123'),'foreignKey':_0x4c3d('0x124')});db['User']['belongsToMany'](db['ChatGroup'],{'as':'Groups','through':_0x4c3d('0x125')});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x128'),'through':_0x4c3d('0x129')});db['User'][_0x4c3d('0x126')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x12b'),'through':'cm_user_has_lists'});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0xe9')],{'through':_0x4c3d('0x12c')});db['User'][_0x4c3d('0x126')](db[_0x4c3d('0x41')],{'as':_0x4c3d('0x11f'),'through':'user_has_mail_interactions'});db[_0x4c3d('0x14')]['belongsToMany'](db[_0x4c3d('0x65')],{'as':'ChatInteractions','through':_0x4c3d('0x12d')});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x4c')],{'as':_0x4c3d('0x11e'),'through':_0x4c3d('0x12e')});db[_0x4c3d('0x14')]['belongsToMany'](db[_0x4c3d('0x56')],{'as':_0x4c3d('0x11d'),'through':_0x4c3d('0x12f')});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db['OpenchannelInteraction'],{'as':_0x4c3d('0x130'),'through':_0x4c3d('0x131')});db['User']['belongsToMany'](db[_0x4c3d('0x103')],{'as':_0x4c3d('0x120'),'through':_0x4c3d('0x132')});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x1b')],{'as':_0x4c3d('0x133'),'through':_0x4c3d('0x30'),'required':![]});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0xfa')],{'as':'VoicePrefixes','through':_0x4c3d('0x134'),'required':![]});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x40')],{'as':'MailQueues','through':_0x4c3d('0x31'),'required':![]});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x69')],{'as':_0x4c3d('0x135'),'through':_0x4c3d('0x136'),'required':![],'hooks':!![]});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x50')],{'as':'FaxQueues','through':_0x4c3d('0x33'),'required':![]});db['User'][_0x4c3d('0x126')](db[_0x4c3d('0x137')],{'as':_0x4c3d('0x138'),'through':'UserSmsQueue','required':![]});db[_0x4c3d('0x14')]['belongsToMany'](db[_0x4c3d('0x60')],{'as':_0x4c3d('0x139'),'through':_0x4c3d('0x37'),'required':![]});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x10b')],{'as':_0x4c3d('0x13a'),'through':_0x4c3d('0x39'),'required':![]});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x12a')],{'through':'cm_user_has_lists'});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db['ChatWebsite'],{'as':'ChatWebsites','through':_0x4c3d('0x13b')});db['User'][_0x4c3d('0x126')](db['FaxAccount'],{'as':_0x4c3d('0x13c'),'through':_0x4c3d('0x13d')});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x3e')],{'as':_0x4c3d('0x13e'),'through':'user_has_mail_accounts'});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x5a')],{'as':_0x4c3d('0x13f'),'through':_0x4c3d('0x140')});db['User'][_0x4c3d('0x126')](db[_0x4c3d('0x54')],{'as':'SmsAccounts','through':_0x4c3d('0x141')});db[_0x4c3d('0x14')][_0x4c3d('0x126')](db[_0x4c3d('0x142')],{'as':'WhatsappAccounts','through':_0x4c3d('0x143')});db['User']['belongsToMany'](db[_0x4c3d('0xe5')],{'as':_0x4c3d('0x144'),'through':_0x4c3d('0x145')});db['VoiceChanSpy'][_0x4c3d('0x117')](db[_0x4c3d('0x19')],{'as':_0x4c3d('0x146'),'onDelete':'cascade','foreignKey':_0x4c3d('0x147')});db[_0x4c3d('0x148')][_0x4c3d('0x117')](db[_0x4c3d('0x19')],{'onDelete':'cascade'});db[_0x4c3d('0x19')][_0x4c3d('0x117')](db[_0x4c3d('0x19')],{'as':_0x4c3d('0x149'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x14a')][_0x4c3d('0x126')](db['Sound'],{'as':_0x4c3d('0x14b'),'through':_0x4c3d('0x14c')});db[_0x4c3d('0x1b')][_0x4c3d('0x117')](db[_0x4c3d('0x2e')],{'as':'Members','foreignKey':_0x4c3d('0x14d')});db[_0x4c3d('0x1b')]['hasMany'](db['CmHopper'],{'as':_0x4c3d('0x14e'),'foreignKey':'VoiceQueueId'});db[_0x4c3d('0x1b')][_0x4c3d('0x117')](db['CmHopperFinal'],{'as':_0x4c3d('0x11a'),'foreignKey':_0x4c3d('0x14d')});db[_0x4c3d('0x1b')]['hasMany'](db[_0x4c3d('0x11b')],{'as':'HopperHistories','foreignKey':_0x4c3d('0x14d')});db[_0x4c3d('0x1b')][_0x4c3d('0x117')](db['ReportAgentPreview'],{'as':_0x4c3d('0x76'),'foreignKey':_0x4c3d('0x14d')});db[_0x4c3d('0x1b')][_0x4c3d('0x117')](db[_0x4c3d('0x71')],{'as':_0x4c3d('0x14f'),'foreignKey':'VoiceQueueId'});db[_0x4c3d('0x1b')]['hasMany'](db[_0x4c3d('0xd9')],{'as':_0x4c3d('0x150'),'foreignKey':_0x4c3d('0x14d')});db['VoiceQueue'][_0x4c3d('0x151')](db[_0x4c3d('0x2b')],{'as':'Trunk','foreignKey':_0x4c3d('0x152')});db[_0x4c3d('0x1b')]['belongsTo'](db['Trunk'],{'as':_0x4c3d('0x153'),'foreignKey':_0x4c3d('0x154')});db[_0x4c3d('0x1b')][_0x4c3d('0x151')](db[_0x4c3d('0x82')],{'as':_0x4c3d('0x82'),'foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x1b')][_0x4c3d('0x151')](db['Pause'],{'as':_0x4c3d('0x156'),'foreignKey':_0x4c3d('0x157')});db[_0x4c3d('0x1b')][_0x4c3d('0x126')](db['CmList'],{'as':_0x4c3d('0x12b'),'through':_0x4c3d('0x158')});db[_0x4c3d('0x1b')][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x30')});db[_0x4c3d('0x1b')][_0x4c3d('0x126')](db[_0x4c3d('0xe9')],{'as':'Teams','through':_0x4c3d('0x10d')});db['VoiceQueue']['belongsToMany'](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x15a'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':'User','foreignKey':'UserId'});db['ScreenRecording']['belongsTo'](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x14'),'foreignKey':'UserId'});db[_0x4c3d('0x112')][_0x4c3d('0x117')](db['VoiceMailMessage'],{'as':_0x4c3d('0x15b'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x15c'),'sourceKey':'mailbox'});db[_0x4c3d('0x22')]['belongsTo'](db[_0x4c3d('0x112')],{'foreignKey':_0x4c3d('0x15c'),'targetKey':_0x4c3d('0x15d')});db[_0x4c3d('0x24')][_0x4c3d('0x117')](db[_0x4c3d('0x15e')],{'as':_0x4c3d('0x15f'),'foreignKey':_0x4c3d('0x160'),'constraints':![]});db[_0x4c3d('0x24')][_0x4c3d('0x117')](db[_0x4c3d('0x26')],{'as':_0x4c3d('0x161'),'foreignKey':'uniqueid','constraints':![]});db[_0x4c3d('0x24')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x14'),'foreignKey':'UserId'});db[_0x4c3d('0x24')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x3b')][_0x4c3d('0x151')](db[_0x4c3d('0x3e')],{'as':_0x4c3d('0x3e'),'foreignKey':_0x4c3d('0x164')});db[_0x4c3d('0x3b')][_0x4c3d('0x151')](db[_0x4c3d('0x165')],{'as':'CloudProvider','foreignKey':_0x4c3d('0x166'),'onDelete':'restrict'});db[_0x4c3d('0x3d')][_0x4c3d('0x151')](db['MailAccount'],{'as':_0x4c3d('0x3e'),'foreignKey':_0x4c3d('0x164')});db['MailServerOut']['belongsTo'](db[_0x4c3d('0x165')],{'as':'CloudProvider','foreignKey':_0x4c3d('0x166'),'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x3e')][_0x4c3d('0x115')](db[_0x4c3d('0x3b')],{'as':'Imap','onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x3e')][_0x4c3d('0x115')](db[_0x4c3d('0x3d')],{'as':'Smtp','onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x3e')][_0x4c3d('0x117')](db[_0x4c3d('0x7e')],{'as':'Dispositions','foreignKey':_0x4c3d('0x164'),'onDelete':'cascade'});db['MailAccount'][_0x4c3d('0x117')](db[_0x4c3d('0x7d')],{'as':_0x4c3d('0x168'),'foreignKey':_0x4c3d('0x164')});db[_0x4c3d('0x3e')]['hasMany'](db[_0x4c3d('0x169')],{'as':_0x4c3d('0x15b'),'foreignKey':_0x4c3d('0x164')});db[_0x4c3d('0x3e')][_0x4c3d('0x117')](db[_0x4c3d('0x41')],{'as':_0x4c3d('0x16a')});db[_0x4c3d('0x3e')]['hasMany'](db[_0x4c3d('0x44')],{'as':'Applications'});db['MailAccount'][_0x4c3d('0x151')](db['CmList'],{'as':_0x4c3d('0x16b'),'foreignKey':'ListId'});db['MailAccount'][_0x4c3d('0x151')](db['Template'],{'as':'Template','foreignKey':'TemplateId'});db[_0x4c3d('0x3e')][_0x4c3d('0x151')](db[_0x4c3d('0x16c')],{'as':_0x4c3d('0x156'),'foreignKey':_0x4c3d('0x157')});db[_0x4c3d('0x3e')][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':'Agents','through':'user_has_mail_accounts'});db['MailQueue'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':'Agents','through':_0x4c3d('0x31')});db[_0x4c3d('0x40')]['belongsToMany'](db['Team'],{'through':'team_has_mail_queues','as':_0x4c3d('0x16d')});db['MailInteraction'][_0x4c3d('0x117')](db[_0x4c3d('0x169')],{'as':_0x4c3d('0x15b'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x16e')});db[_0x4c3d('0x41')][_0x4c3d('0x151')](db[_0x4c3d('0x3e')],{'as':'Account','foreignKey':_0x4c3d('0x164')});db[_0x4c3d('0x41')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x41')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':'Owner','foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x41')][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':'mail_interaction_has_tags','as':_0x4c3d('0x16f')});db['MailInteraction'][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x170'),'as':_0x4c3d('0x171')});db[_0x4c3d('0x41')]['belongsToMany'](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x172'),'through':_0x4c3d('0x173'),'foreignKey':_0x4c3d('0x16e')});db[_0x4c3d('0x169')]['hasMany'](db[_0x4c3d('0x174')],{'as':_0x4c3d('0x175'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x169')][_0x4c3d('0x151')](db['User'],{'as':_0x4c3d('0x14')});db[_0x4c3d('0x169')][_0x4c3d('0x151')](db['CmContact'],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x162')});db[_0x4c3d('0x169')][_0x4c3d('0x151')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0x4c3d('0x16e')});db[_0x4c3d('0x169')]['belongsTo'](db[_0x4c3d('0x3e')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x164')});db[_0x4c3d('0x169')][_0x4c3d('0x151')](db['ChatWebsite'],{'as':_0x4c3d('0x61'),'foreignKey':_0x4c3d('0x177')});db[_0x4c3d('0x169')][_0x4c3d('0x151')](db[_0x4c3d('0x178')],{'as':_0x4c3d('0x178'),'foreignKey':_0x4c3d('0x179')});db[_0x4c3d('0x44')]['belongsTo'](db[_0x4c3d('0x14')],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x44')]['belongsTo'](db[_0x4c3d('0x40')],{'onDelete':'restrict'});db[_0x4c3d('0x44')][_0x4c3d('0x151')](db['MailAccount'],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x44')][_0x4c3d('0x151')](db[_0x4c3d('0x82')],{'onDelete':_0x4c3d('0x167'),'foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x44')]['belongsTo'](db[_0x4c3d('0x8d')],{'onDelete':_0x4c3d('0x167'),'foreignKey':'TagId'});db[_0x4c3d('0x17a')][_0x4c3d('0x151')](db[_0x4c3d('0x3e')],{});db['MailQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0x17a')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x17a')][_0x4c3d('0x151')](db[_0x4c3d('0x41')],{});db[_0x4c3d('0x17a')]['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{});db[_0x4c3d('0x17a')]['belongsTo'](db[_0x4c3d('0x40')],{});db[_0x4c3d('0x47')]['hasMany'](db[_0x4c3d('0x17c')],{'as':_0x4c3d('0x17d'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x49')][_0x4c3d('0x117')](db[_0x4c3d('0x7e')],{'as':_0x4c3d('0x17e'),'foreignKey':_0x4c3d('0x17f'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x49')]['hasMany'](db[_0x4c3d('0x7d')],{'as':_0x4c3d('0x168'),'foreignKey':'FaxAccountId'});db[_0x4c3d('0x49')][_0x4c3d('0x117')](db[_0x4c3d('0x4c')],{'as':'Interactions'});db[_0x4c3d('0x49')][_0x4c3d('0x117')](db[_0x4c3d('0x180')],{'as':_0x4c3d('0x149')});db[_0x4c3d('0x49')]['hasMany'](db[_0x4c3d('0x19')],{'as':_0x4c3d('0x181'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x49')][_0x4c3d('0x117')](db['FaxMessage'],{'as':_0x4c3d('0x15b')});db['FaxAccount'][_0x4c3d('0x151')](db[_0x4c3d('0x2b')],{'as':_0x4c3d('0x2b')});db[_0x4c3d('0x49')]['belongsTo'](db[_0x4c3d('0x12a')],{'as':'List','foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0x49')][_0x4c3d('0x151')](db[_0x4c3d('0x16c')],{'as':_0x4c3d('0x156'),'foreignKey':_0x4c3d('0x157')});db['FaxAccount'][_0x4c3d('0x126')](db['User'],{'as':'Agents','through':_0x4c3d('0x13d')});db[_0x4c3d('0x180')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'onDelete':'restrict'});db[_0x4c3d('0x180')]['belongsTo'](db[_0x4c3d('0x50')],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x180')][_0x4c3d('0x151')](db['FaxAccount'],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x180')][_0x4c3d('0x151')](db[_0x4c3d('0x8d')],{'onDelete':_0x4c3d('0x167'),'foreignKey':_0x4c3d('0x182')});db[_0x4c3d('0x4c')][_0x4c3d('0x117')](db[_0x4c3d('0x4e')],{'as':_0x4c3d('0x15b'),'onDelete':_0x4c3d('0x113'),'foreignKey':'FaxInteractionId'});db[_0x4c3d('0x4c')]['belongsTo'](db[_0x4c3d('0x49')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x17f')});db['FaxInteraction'][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':'ContactId'});db[_0x4c3d('0x4c')][_0x4c3d('0x151')](db['User'],{'as':_0x4c3d('0x183'),'foreignKey':_0x4c3d('0x114')});db['FaxInteraction'][_0x4c3d('0x126')](db['Tag'],{'through':_0x4c3d('0x184'),'as':'Tags'});db[_0x4c3d('0x4c')][_0x4c3d('0x126')](db['Tag'],{'through':_0x4c3d('0x184'),'as':_0x4c3d('0x171')});db['FaxInteraction']['belongsToMany'](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x172'),'through':_0x4c3d('0x12e'),'foreignKey':_0x4c3d('0x185')});db['FaxMessage'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x14')});db[_0x4c3d('0x4e')][_0x4c3d('0x151')](db[_0x4c3d('0x4c')],{'as':'Interaction','foreignKey':_0x4c3d('0x185')});db[_0x4c3d('0x4e')][_0x4c3d('0x151')](db['CmContact'],{'onDelete':'cascade','as':_0x4c3d('0x162')});db[_0x4c3d('0x4e')][_0x4c3d('0x151')](db[_0x4c3d('0x174')],{'as':_0x4c3d('0x174'),'foreignKey':'AttachmentId'});db['FaxMessage']['belongsTo'](db['FaxAccount'],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x17f')});db['FaxQueue'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x33')});db['FaxQueue'][_0x4c3d('0x126')](db[_0x4c3d('0xe9')],{'through':_0x4c3d('0x186'),'as':'Teams'});db['FaxQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x49')],{});db[_0x4c3d('0x52')]['belongsTo'](db[_0x4c3d('0x12a')],{'as':'List','foreignKey':'ListId'});db[_0x4c3d('0x52')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x4c')],{});db[_0x4c3d('0x52')]['belongsTo'](db['FaxMessage'],{});db['FaxQueueReport'][_0x4c3d('0x151')](db['User'],{});db[_0x4c3d('0x52')][_0x4c3d('0x151')](db[_0x4c3d('0x50')],{});db[_0x4c3d('0x54')]['hasMany'](db[_0x4c3d('0x7e')],{'as':'Dispositions','foreignKey':_0x4c3d('0x187'),'onDelete':'cascade'});db[_0x4c3d('0x54')][_0x4c3d('0x117')](db[_0x4c3d('0x7d')],{'as':_0x4c3d('0x168'),'foreignKey':_0x4c3d('0x187')});db[_0x4c3d('0x54')][_0x4c3d('0x117')](db[_0x4c3d('0x58')],{'as':_0x4c3d('0x15b'),'foreignKey':_0x4c3d('0x187')});db[_0x4c3d('0x54')][_0x4c3d('0x117')](db[_0x4c3d('0x56')],{'as':_0x4c3d('0x16a')});db[_0x4c3d('0x54')][_0x4c3d('0x117')](db[_0x4c3d('0x188')],{'as':_0x4c3d('0x149')});db['SmsAccount'][_0x4c3d('0x151')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':'ListId'});db['SmsAccount']['belongsTo'](db[_0x4c3d('0x16c')],{'as':'mandatoryDispositionPause','foreignKey':_0x4c3d('0x157')});db['SmsAccount']['belongsToMany'](db['User'],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x141')});db[_0x4c3d('0x188')]['belongsTo'](db[_0x4c3d('0x14')],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x188')][_0x4c3d('0x151')](db[_0x4c3d('0x137')],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x188')][_0x4c3d('0x151')](db[_0x4c3d('0x54')],{'onDelete':'restrict'});db[_0x4c3d('0x188')][_0x4c3d('0x151')](db[_0x4c3d('0x82')],{'onDelete':_0x4c3d('0x167'),'foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x188')][_0x4c3d('0x151')](db[_0x4c3d('0x8d')],{'onDelete':_0x4c3d('0x167'),'foreignKey':_0x4c3d('0x182')});db[_0x4c3d('0x56')][_0x4c3d('0x117')](db[_0x4c3d('0x58')],{'as':_0x4c3d('0x15b'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x189')});db[_0x4c3d('0x56')][_0x4c3d('0x151')](db[_0x4c3d('0x54')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x187')});db['SmsInteraction'][_0x4c3d('0x151')](db['CmContact'],{'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x56')]['belongsTo'](db['User'],{'as':_0x4c3d('0x183'),'foreignKey':'UserId'});db[_0x4c3d('0x56')][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x18a'),'as':_0x4c3d('0x16f')});db['SmsInteraction']['belongsToMany'](db[_0x4c3d('0x8d')],{'through':'sms_interaction_has_tags','as':_0x4c3d('0x171')});db[_0x4c3d('0x56')][_0x4c3d('0x126')](db['User'],{'as':'Users','through':_0x4c3d('0x12f'),'foreignKey':_0x4c3d('0x189')});db[_0x4c3d('0x58')]['belongsTo'](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x14')});db[_0x4c3d('0x58')][_0x4c3d('0x151')](db['CmContact'],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x162')});db[_0x4c3d('0x58')][_0x4c3d('0x151')](db[_0x4c3d('0x56')],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x18b'),'foreignKey':'SmsInteractionId'});db[_0x4c3d('0x58')][_0x4c3d('0x151')](db[_0x4c3d('0x54')],{'as':'Account','foreignKey':_0x4c3d('0x187')});db['SmsQueue'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':'UserSmsQueue','foreignKey':_0x4c3d('0x18c')});db[_0x4c3d('0x137')][_0x4c3d('0x126')](db['Team'],{'through':_0x4c3d('0x18d'),'as':_0x4c3d('0x16d')});db[_0x4c3d('0x5a')][_0x4c3d('0x117')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4c3d('0x18e'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x5a')][_0x4c3d('0x117')](db[_0x4c3d('0x7d')],{'as':_0x4c3d('0x168'),'foreignKey':_0x4c3d('0x18e')});db[_0x4c3d('0x5a')][_0x4c3d('0x117')](db[_0x4c3d('0x5d')],{'as':_0x4c3d('0x16a'),'foreignKey':_0x4c3d('0x18e')});db[_0x4c3d('0x5a')][_0x4c3d('0x117')](db[_0x4c3d('0x5f')],{'as':_0x4c3d('0x15b'),'foreignKey':_0x4c3d('0x18e')});db[_0x4c3d('0x5a')][_0x4c3d('0x117')](db['OpenchannelApplication'],{'as':_0x4c3d('0x149'),'foreignKey':_0x4c3d('0x18e')});db[_0x4c3d('0x5a')][_0x4c3d('0x151')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b')});db['OpenchannelAccount'][_0x4c3d('0x151')](db[_0x4c3d('0x16c')],{'as':'mandatoryDispositionPause','foreignKey':_0x4c3d('0x157')});db[_0x4c3d('0x5a')]['belongsToMany'](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x140')});db[_0x4c3d('0x5b')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x5b')][_0x4c3d('0x151')](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x4c3d('0x18f')});db[_0x4c3d('0x5b')][_0x4c3d('0x151')](db[_0x4c3d('0x5a')],{'onDelete':_0x4c3d('0x167'),'foreignKey':_0x4c3d('0x18e')});db[_0x4c3d('0x5b')][_0x4c3d('0x151')](db['Interval'],{'onDelete':_0x4c3d('0x167'),'foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x5b')][_0x4c3d('0x151')](db[_0x4c3d('0x8d')],{'onDelete':_0x4c3d('0x167'),'foreignKey':'TagId'});db[_0x4c3d('0x5d')]['hasMany'](db['OpenchannelMessage'],{'as':_0x4c3d('0x15b'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x190')});db[_0x4c3d('0x5d')][_0x4c3d('0x151')](db[_0x4c3d('0x5a')],{'as':_0x4c3d('0x176'),'foreignKey':'OpenchannelAccountId'});db[_0x4c3d('0x5d')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x5d')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x183'),'foreignKey':'UserId'});db[_0x4c3d('0x5d')][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x191'),'as':_0x4c3d('0x16f')});db[_0x4c3d('0x5d')][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x191'),'as':_0x4c3d('0x171')});db[_0x4c3d('0x5d')][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x172'),'through':_0x4c3d('0x131'),'foreignKey':_0x4c3d('0x190')});db[_0x4c3d('0x5f')]['belongsTo'](db[_0x4c3d('0x14')],{'onDelete':'cascade','as':_0x4c3d('0x14')});db[_0x4c3d('0x5f')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'onDelete':'cascade','as':_0x4c3d('0x162')});db[_0x4c3d('0x5f')]['belongsTo'](db[_0x4c3d('0x5d')],{'onDelete':_0x4c3d('0x113'),'as':'Interaction','foreignKey':_0x4c3d('0x190')});db['OpenchannelMessage'][_0x4c3d('0x151')](db['Attachment'],{'as':_0x4c3d('0x174'),'foreignKey':_0x4c3d('0x192')});db[_0x4c3d('0x5f')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x18e')});db[_0x4c3d('0x60')][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x37'),'foreignKey':_0x4c3d('0x18f')});db[_0x4c3d('0x60')][_0x4c3d('0x126')](db['Team'],{'through':'team_has_openchannel_queues','as':_0x4c3d('0x16d')});db[_0x4c3d('0x61')][_0x4c3d('0x117')](db[_0x4c3d('0x7e')],{'as':'Dispositions','foreignKey':_0x4c3d('0x177'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x61')]['hasMany'](db[_0x4c3d('0x7d')],{'as':_0x4c3d('0x168'),'foreignKey':_0x4c3d('0x177')});db[_0x4c3d('0x61')]['hasMany'](db[_0x4c3d('0x193')],{'as':_0x4c3d('0x194')});db['ChatWebsite'][_0x4c3d('0x117')](db['ChatInteraction'],{'as':_0x4c3d('0x16a')});db[_0x4c3d('0x61')]['hasMany'](db[_0x4c3d('0x195')],{'as':_0x4c3d('0x149')});db[_0x4c3d('0x61')][_0x4c3d('0x117')](db[_0x4c3d('0x67')],{'as':'Messages'});db[_0x4c3d('0x61')]['belongsTo'](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b')});db['ChatWebsite']['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x61')][_0x4c3d('0x151')](db[_0x4c3d('0x3e')],{'as':_0x4c3d('0x3e'),'foreignKey':'MailAccountId'});db[_0x4c3d('0x61')][_0x4c3d('0x151')](db['Pause'],{'as':_0x4c3d('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x13b')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelAccount'],{});db[_0x4c3d('0x62')][_0x4c3d('0x151')](db['CmList'],{'as':_0x4c3d('0x16b'),'foreignKey':'ListId'});db['OpenchannelQueueReport']['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0x4c3d('0x62')][_0x4c3d('0x151')](db[_0x4c3d('0x5d')],{});db[_0x4c3d('0x62')][_0x4c3d('0x151')](db[_0x4c3d('0x5f')],{});db[_0x4c3d('0x62')]['belongsTo'](db[_0x4c3d('0x14')],{});db['OpenchannelQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x60')],{});db[_0x4c3d('0x195')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x196'),'foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0x4c3d('0x69')],{'as':_0x4c3d('0x197'),'foreignKey':_0x4c3d('0x198'),'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x195')][_0x4c3d('0x151')](db[_0x4c3d('0x61')],{'as':_0x4c3d('0x199'),'foreignKey':'ChatWebsiteId','onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x195')][_0x4c3d('0x151')](db[_0x4c3d('0x8d')],{'onDelete':_0x4c3d('0x167'),'foreignKey':_0x4c3d('0x182')});db[_0x4c3d('0x65')]['hasMany'](db['ChatMessage'],{'as':_0x4c3d('0x15b'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x19a')});db[_0x4c3d('0x65')][_0x4c3d('0x151')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x4c3d('0x65')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':'ContactId'});db['ChatInteraction'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x183'),'foreignKey':_0x4c3d('0x114')});db['ChatInteraction'][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':'chat_interaction_has_tags','as':'Tags'});db['ChatInteraction']['belongsToMany'](db['Tag'],{'through':_0x4c3d('0x19b'),'as':'ThroughTags'});db['ChatInteraction'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x172'),'through':_0x4c3d('0x12d'),'foreignKey':_0x4c3d('0x19a')});db['ChatMessage']['belongsTo'](db['User'],{'onDelete':_0x4c3d('0x113'),'as':'User'});db[_0x4c3d('0x67')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x67')][_0x4c3d('0x151')](db['ChatInteraction'],{'onDelete':_0x4c3d('0x113'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x4c3d('0x67')]['belongsTo'](db[_0x4c3d('0x174')],{'as':_0x4c3d('0x174'),'foreignKey':'AttachmentId'});db[_0x4c3d('0x67')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0x4c3d('0x177')});db['ChatOfflineMessage'][_0x4c3d('0x117')](db[_0x4c3d('0x174')],{'as':_0x4c3d('0x175'),'foreignKey':'ChatOfflineMessageId','onDelete':'cascade','hooks':!![]});db[_0x4c3d('0x178')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x162'),'foreignKey':'ContactId'});db[_0x4c3d('0x178')][_0x4c3d('0x151')](db['ChatWebsite'],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x177')});db[_0x4c3d('0x69')]['belongsToMany'](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x4c3d('0x126')](db[_0x4c3d('0xe9')],{'through':_0x4c3d('0x19c'),'as':_0x4c3d('0x16d')});db['ChatGroup'][_0x4c3d('0x117')](db[_0x4c3d('0xd4')],{'as':_0x4c3d('0x15b'),'foreignKey':_0x4c3d('0x19d'),'onDelete':'cascade'});db[_0x4c3d('0x19e')][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x19f'),'through':'chat_group_has_users'});db[_0x4c3d('0x193')]['belongsTo'](db['ChatWebsite'],{'as':_0x4c3d('0x199'),'foreignKey':'ChatWebsiteId'});db[_0x4c3d('0x6d')]['hasMany'](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x128'),'foreignKey':_0x4c3d('0x1a0')});db[_0x4c3d('0x127')][_0x4c3d('0x117')](db[_0x4c3d('0x70')],{'as':_0x4c3d('0x14e'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x127')][_0x4c3d('0x117')](db['CmHopperFinal'],{'as':_0x4c3d('0x11a'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x127')][_0x4c3d('0x117')](db[_0x4c3d('0x11b')],{'as':_0x4c3d('0x1a1'),'foreignKey':'ContactId'});db[_0x4c3d('0x127')][_0x4c3d('0x117')](db[_0x4c3d('0x76')],{'as':_0x4c3d('0x76'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x127')][_0x4c3d('0x117')](db[_0x4c3d('0xd9')],{'as':_0x4c3d('0x150'),'foreignKey':'ContactId'});db[_0x4c3d('0x127')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x4c3d('0x130'),'foreignKey':_0x4c3d('0x163'),'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x127')]['hasMany'](db[_0x4c3d('0x65')],{'as':_0x4c3d('0x11c'),'foreignKey':_0x4c3d('0x163'),'onDelete':_0x4c3d('0x167')});db['CmContact'][_0x4c3d('0x117')](db[_0x4c3d('0x56')],{'as':_0x4c3d('0x11d'),'foreignKey':_0x4c3d('0x163'),'onDelete':_0x4c3d('0x167')});db['CmContact']['hasMany'](db[_0x4c3d('0x4c')],{'as':_0x4c3d('0x11e'),'foreignKey':_0x4c3d('0x163'),'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x127')][_0x4c3d('0x117')](db[_0x4c3d('0x41')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x127')]['belongsTo'](db[_0x4c3d('0x6d')],{'as':'Company','foreignKey':_0x4c3d('0x1a0')});db[_0x4c3d('0x127')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x127')]['belongsToMany'](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x172'),'through':_0x4c3d('0x129')});db[_0x4c3d('0x127')][_0x4c3d('0x126')](db['Tag'],{'as':_0x4c3d('0x16f'),'through':'cm_contact_has_tags'});db['CmContact'][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x1a2'),'as':_0x4c3d('0x171')});db['CmHopper'][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':'Contact','foreignKey':_0x4c3d('0x163'),'onDelete':'cascade'});db[_0x4c3d('0x70')][_0x4c3d('0x151')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x70')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x196'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x70')]['belongsTo'](db[_0x4c3d('0x1b')],{'as':_0x4c3d('0x197'),'foreignKey':_0x4c3d('0x14d'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x70')]['belongsTo'](db[_0x4c3d('0xed')],{'as':_0x4c3d('0xed'),'foreignKey':_0x4c3d('0x1a3'),'onDelete':_0x4c3d('0x113')});db['CmHopper'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x183'),'foreignKey':_0x4c3d('0x1a4')});db['CmHopperBlack'][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0x4c3d('0x71')][_0x4c3d('0x151')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b'),'onDelete':_0x4c3d('0x113')});db['CmHopperBlack'][_0x4c3d('0x151')](db[_0x4c3d('0x1b')],{'as':_0x4c3d('0x197'),'foreignKey':_0x4c3d('0x14d'),'onDelete':'cascade'});db[_0x4c3d('0x71')][_0x4c3d('0x151')](db['Campaign'],{'as':_0x4c3d('0xed'),'foreignKey':_0x4c3d('0x1a3'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x7b')][_0x4c3d('0x117')](db['Condition'],{'as':{'plural':'All','singular':_0x4c3d('0x1a5')},'foreignKey':_0x4c3d('0x1a6'),'onDelete':_0x4c3d('0x113'),'hooks':!![]});db[_0x4c3d('0x7b')][_0x4c3d('0x117')](db[_0x4c3d('0x80')],{'as':{'plural':_0x4c3d('0x1a7'),'singular':_0x4c3d('0x1a8')},'foreignKey':_0x4c3d('0x1a9'),'onDelete':_0x4c3d('0x113'),'hooks':!![]});db[_0x4c3d('0x7b')]['hasMany'](db['Action'],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x4c3d('0x113'),'hooks':!![]});db['Disposition'][_0x4c3d('0x117')](db[_0x4c3d('0x7e')],{'as':_0x4c3d('0x17e'),'foreignKey':_0x4c3d('0x1aa'),'onDelete':'cascade'});db[_0x4c3d('0x82')][_0x4c3d('0x117')](db[_0x4c3d('0x82')],{'as':_0x4c3d('0x1ab'),'foreignKey':_0x4c3d('0x155'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x4c3d('0x82')][_0x4c3d('0x117')](db[_0x4c3d('0x19')],{'as':'Extensions','foreignKey':_0x4c3d('0x155'),'onDelete':'restrict'});db['Interval'][_0x4c3d('0x117')](db[_0x4c3d('0x44')],{'as':'MailApplications','foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x82')][_0x4c3d('0x117')](db['ChatApplication'],{'as':_0x4c3d('0x1ac'),'foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x82')][_0x4c3d('0x117')](db[_0x4c3d('0x180')],{'as':_0x4c3d('0x1ad'),'foreignKey':_0x4c3d('0x155')});db[_0x4c3d('0x82')][_0x4c3d('0x117')](db[_0x4c3d('0x188')],{'as':'SmsApplications','foreignKey':'IntervalId'});db[_0x4c3d('0x89')][_0x4c3d('0x151')](db[_0x4c3d('0x3e')],{});db[_0x4c3d('0x89')][_0x4c3d('0x151')](db[_0x4c3d('0x1ae')],{'foreignKey':_0x4c3d('0x1af')});db[_0x4c3d('0x89')][_0x4c3d('0x151')](db[_0x4c3d('0x97')],{'foreignKey':_0x4c3d('0x1b0')});db[_0x4c3d('0x8b')][_0x4c3d('0x126')](db[_0x4c3d('0x14a')],{'as':_0x4c3d('0x1b1'),'through':_0x4c3d('0x14c'),'onDelete':'restrict'});db[_0x4c3d('0x8d')][_0x4c3d('0x126')](db['CmContact'],{'through':_0x4c3d('0x1a2')});db[_0x4c3d('0x8d')][_0x4c3d('0x126')](db[_0x4c3d('0x65')],{'through':_0x4c3d('0x19b')});db[_0x4c3d('0x8d')][_0x4c3d('0x126')](db[_0x4c3d('0x41')],{'through':'mail_interaction_has_tags'});db[_0x4c3d('0x8d')][_0x4c3d('0x126')](db[_0x4c3d('0x56')],{'through':'sms_interaction_has_tags'});db['Tag'][_0x4c3d('0x126')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db['Tag'][_0x4c3d('0x126')](db[_0x4c3d('0x5d')],{'through':'openchannel_interaction_has_tags'});db[_0x4c3d('0x8d')]['belongsToMany'](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x4c3d('0x91')][_0x4c3d('0x117')](db[_0x4c3d('0x80')],{'as':{'plural':_0x4c3d('0x1b2'),'singular':'AllCondition'},'foreignKey':_0x4c3d('0x1b3'),'onDelete':_0x4c3d('0x113'),'hooks':!![]});db['Trigger'][_0x4c3d('0x117')](db[_0x4c3d('0x80')],{'as':{'plural':_0x4c3d('0x1b4'),'singular':_0x4c3d('0x1b5')},'foreignKey':_0x4c3d('0x1b6'),'onDelete':_0x4c3d('0x113'),'hooks':!![]});db['Trigger'][_0x4c3d('0x117')](db[_0x4c3d('0x1b7')],{'as':_0x4c3d('0x1b8'),'foreignKey':_0x4c3d('0x1b9'),'onDelete':_0x4c3d('0x113'),'hooks':!![]});db[_0x4c3d('0x97')][_0x4c3d('0x117')](db[_0x4c3d('0x9d')],{'as':_0x4c3d('0x1ba'),'onDelete':'cascade','foreignKey':_0x4c3d('0x1b0'),'hooks':!![]});db[_0x4c3d('0x1ae')][_0x4c3d('0x117')](db[_0x4c3d('0x9d')],{'as':_0x4c3d('0x1ba'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1af')});db['AnalyticMetric']['hasMany'](db[_0x4c3d('0x9d')],{'as':_0x4c3d('0x1ba'),'onDelete':_0x4c3d('0x113'),'foreignKey':'MetricId'});db[_0x4c3d('0x9d')][_0x4c3d('0x151')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x4c3d('0x9f')]['hasMany'](db[_0x4c3d('0xa1')],{'as':_0x4c3d('0x1bb'),'onDelete':_0x4c3d('0x113'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0x4c3d('0x117')](db[_0x4c3d('0xa3')],{'as':_0x4c3d('0x1bc'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xa1')]['hasMany'](db[_0x4c3d('0xa3')],{'as':_0x4c3d('0x1be'),'onDelete':_0x4c3d('0x113'),'foreignKey':'DescriptionId'});db[_0x4c3d('0xa1')][_0x4c3d('0x117')](db[_0x4c3d('0xa3')],{'as':_0x4c3d('0x1ba'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xa1')]['belongsTo'](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xa3')][_0x4c3d('0x117')](db[_0x4c3d('0xa3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4c3d('0xa3')]['hasMany'](db[_0x4c3d('0xa3')],{'as':_0x4c3d('0x1c1'),'foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xa3')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xa3')][_0x4c3d('0x151')](db[_0x4c3d('0x93')],{'as':_0x4c3d('0x93'),'foreignKey':_0x4c3d('0x1c3')});db['SugarcrmAccount'][_0x4c3d('0x117')](db[_0x4c3d('0xa7')],{'as':_0x4c3d('0x1bb'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1c0')});db['SugarcrmConfiguration']['hasMany'](db[_0x4c3d('0xa9')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xa7')][_0x4c3d('0x117')](db[_0x4c3d('0xa9')],{'as':_0x4c3d('0x1be'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1c2')});db['SugarcrmConfiguration'][_0x4c3d('0x117')](db[_0x4c3d('0xa9')],{'as':_0x4c3d('0x1ba'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xa7')]['belongsTo'](db['SugarcrmAccount'],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xa9')][_0x4c3d('0x117')](db[_0x4c3d('0xa9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4c3d('0xa9')][_0x4c3d('0x117')](db[_0x4c3d('0xa9')],{'as':'Description','foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xa9')][_0x4c3d('0x117')](db[_0x4c3d('0xa9')],{'as':_0x4c3d('0x1c4'),'foreignKey':_0x4c3d('0x1bf')});db['SugarcrmField'][_0x4c3d('0x151')](db[_0x4c3d('0x93')],{'as':_0x4c3d('0x93'),'foreignKey':_0x4c3d('0x1c3')});db[_0x4c3d('0xab')][_0x4c3d('0x117')](db[_0x4c3d('0xad')],{'as':_0x4c3d('0x1bb'),'onDelete':'cascade','foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xad')]['hasMany'](db[_0x4c3d('0xaf')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['DeskConfiguration']['hasMany'](db[_0x4c3d('0xaf')],{'as':'Descriptions','onDelete':_0x4c3d('0x113'),'foreignKey':'DescriptionId'});db[_0x4c3d('0xad')][_0x4c3d('0x117')](db[_0x4c3d('0xaf')],{'as':_0x4c3d('0x1ba'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xad')]['belongsTo'](db[_0x4c3d('0xab')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1c0')});db['DeskConfiguration'][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x1c5')});db[_0x4c3d('0xaf')][_0x4c3d('0x117')](db['DeskField'],{'as':_0x4c3d('0x1c6'),'foreignKey':'SubjectId'});db[_0x4c3d('0xaf')][_0x4c3d('0x117')](db[_0x4c3d('0xaf')],{'as':'Description','foreignKey':_0x4c3d('0x1c2')});db['DeskField'][_0x4c3d('0x117')](db[_0x4c3d('0xaf')],{'as':_0x4c3d('0x1c4'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xaf')][_0x4c3d('0x151')](db['Variable'],{'as':_0x4c3d('0x93'),'foreignKey':_0x4c3d('0x1c3')});db[_0x4c3d('0xb1')][_0x4c3d('0x117')](db[_0x4c3d('0x1c7')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration']['hasMany'](db[_0x4c3d('0xb3')],{'as':_0x4c3d('0x1bc'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1bd')});db['ZohoConfiguration'][_0x4c3d('0x117')](db[_0x4c3d('0xb3')],{'as':_0x4c3d('0x1be'),'onDelete':'cascade','foreignKey':_0x4c3d('0x1c2')});db['ZohoConfiguration'][_0x4c3d('0x117')](db[_0x4c3d('0xb3')],{'as':'Fields','onDelete':_0x4c3d('0x113'),'foreignKey':'FieldId'});db[_0x4c3d('0x1c7')][_0x4c3d('0x151')](db[_0x4c3d('0xb1')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xb3')]['hasMany'](db['ZohoField'],{'as':_0x4c3d('0x1c6'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xb3')][_0x4c3d('0x117')](db[_0x4c3d('0xb3')],{'as':_0x4c3d('0x1c1'),'foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xb3')][_0x4c3d('0x117')](db[_0x4c3d('0xb3')],{'as':'Field','foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xb3')][_0x4c3d('0x151')](db[_0x4c3d('0x93')],{'as':_0x4c3d('0x93'),'foreignKey':_0x4c3d('0x1c3')});db[_0x4c3d('0x1c8')][_0x4c3d('0x117')](db[_0x4c3d('0x1c9')],{'as':_0x4c3d('0x1bb'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0x1c9')][_0x4c3d('0x117')](db['ZendeskField'],{'as':_0x4c3d('0x1bc'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0x1c9')][_0x4c3d('0x117')](db[_0x4c3d('0xb6')],{'as':_0x4c3d('0x1be'),'foreignKey':'DescriptionId'});db[_0x4c3d('0x1c9')][_0x4c3d('0x117')](db[_0x4c3d('0xb6')],{'as':_0x4c3d('0x1ba'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0x1c9')][_0x4c3d('0x151')](db[_0x4c3d('0x1c8')],{'as':'Account','foreignKey':_0x4c3d('0x1c0')});db['ZendeskConfiguration'][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x1ca')});db[_0x4c3d('0xb6')][_0x4c3d('0x117')](db[_0x4c3d('0xb6')],{'as':_0x4c3d('0x1c6'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xb6')]['hasMany'](db['ZendeskField'],{'as':'Description','foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xb6')][_0x4c3d('0x117')](db['ZendeskField'],{'as':_0x4c3d('0x1c4'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xb6')][_0x4c3d('0x151')](db['Variable'],{'as':_0x4c3d('0x93'),'foreignKey':_0x4c3d('0x1c3')});db[_0x4c3d('0xb8')][_0x4c3d('0x117')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0x1cb')][_0x4c3d('0x117')](db[_0x4c3d('0xbb')],{'as':'Subjects','onDelete':_0x4c3d('0x113'),'foreignKey':'SubjectId'});db[_0x4c3d('0x1cb')][_0x4c3d('0x117')](db[_0x4c3d('0xbb')],{'as':'Descriptions','onDelete':_0x4c3d('0x113'),'foreignKey':'DescriptionId'});db[_0x4c3d('0x1cb')][_0x4c3d('0x117')](db[_0x4c3d('0xbb')],{'as':_0x4c3d('0x1ba'),'onDelete':'cascade','foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0x1cb')][_0x4c3d('0x151')](db['FreshdeskAccount'],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0x1cb')]['belongsToMany'](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x1cc')});db[_0x4c3d('0xbb')][_0x4c3d('0x117')](db[_0x4c3d('0xbb')],{'as':_0x4c3d('0x1c6'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xbb')][_0x4c3d('0x117')](db[_0x4c3d('0xbb')],{'as':_0x4c3d('0x1c1'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x4c3d('0xbb')],{'as':_0x4c3d('0x1c4'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xbb')]['belongsTo'](db[_0x4c3d('0x93')],{'as':_0x4c3d('0x93'),'foreignKey':'VariableId'});db[_0x4c3d('0xbd')][_0x4c3d('0x117')](db[_0x4c3d('0xbf')],{'as':'Configurations','onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xbf')][_0x4c3d('0x117')](db[_0x4c3d('0xc1')],{'as':_0x4c3d('0x1bc'),'foreignKey':_0x4c3d('0x1bd')});db['VtigerConfiguration'][_0x4c3d('0x117')](db[_0x4c3d('0xc1')],{'as':_0x4c3d('0x1be'),'foreignKey':'DescriptionId'});db[_0x4c3d('0xbf')][_0x4c3d('0x117')](db['VtigerField'],{'as':_0x4c3d('0x1ba'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xbf')][_0x4c3d('0x151')](db[_0x4c3d('0xbd')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xc1')][_0x4c3d('0x117')](db['VtigerField'],{'as':_0x4c3d('0x1c6'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xc1')][_0x4c3d('0x117')](db[_0x4c3d('0xc1')],{'as':_0x4c3d('0x1c1'),'foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xc1')][_0x4c3d('0x117')](db[_0x4c3d('0xc1')],{'as':_0x4c3d('0x1c4'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xc1')][_0x4c3d('0x151')](db['Variable'],{'as':'Variable','foreignKey':_0x4c3d('0x1c3')});db[_0x4c3d('0x1cd')][_0x4c3d('0x117')](db[_0x4c3d('0xc3')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xc3')][_0x4c3d('0x117')](db['ServicenowField'],{'as':'Subjects','foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xc3')][_0x4c3d('0x117')](db[_0x4c3d('0xc5')],{'as':_0x4c3d('0x1be'),'foreignKey':_0x4c3d('0x1c2')});db['ServicenowConfiguration'][_0x4c3d('0x117')](db['ServicenowField'],{'as':_0x4c3d('0x1ba'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x4c3d('0x151')](db[_0x4c3d('0x1cd')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1c0')});db['ServicenowField'][_0x4c3d('0x117')](db[_0x4c3d('0xc5')],{'as':_0x4c3d('0x1c6'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xc5')]['hasMany'](db[_0x4c3d('0xc5')],{'as':'Description','foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xc5')]['hasMany'](db[_0x4c3d('0xc5')],{'as':'Field','foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xc5')]['belongsTo'](db['Variable'],{'as':_0x4c3d('0x93'),'foreignKey':'VariableId'});db[_0x4c3d('0xc7')][_0x4c3d('0x117')](db[_0x4c3d('0xc9')],{'as':_0x4c3d('0x1bb'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xc7')][_0x4c3d('0x151')](db[_0x4c3d('0x165')],{'as':_0x4c3d('0x165'),'foreignKey':_0x4c3d('0x166')});db[_0x4c3d('0xc9')][_0x4c3d('0x117')](db[_0x4c3d('0xca')],{'as':_0x4c3d('0x1bc'),'onDelete':'cascade','foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xc9')][_0x4c3d('0x117')](db[_0x4c3d('0xca')],{'as':_0x4c3d('0x1be'),'onDelete':_0x4c3d('0x113'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x4c3d('0x117')](db[_0x4c3d('0xca')],{'as':_0x4c3d('0x1ba'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1bf')});db['Dynamics365Configuration'][_0x4c3d('0x151')](db['Dynamics365Account'],{'as':_0x4c3d('0x176'),'foreignKey':'AccountId'});db[_0x4c3d('0xca')][_0x4c3d('0x117')](db[_0x4c3d('0xca')],{'as':_0x4c3d('0x1c6'),'foreignKey':'SubjectId'});db[_0x4c3d('0xca')][_0x4c3d('0x117')](db[_0x4c3d('0xca')],{'as':'Description','foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xca')]['hasMany'](db[_0x4c3d('0xca')],{'as':_0x4c3d('0x1c4'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xca')]['belongsTo'](db[_0x4c3d('0x93')],{'as':_0x4c3d('0x93'),'foreignKey':_0x4c3d('0x1c3')});db[_0x4c3d('0xcb')]['hasMany'](db[_0x4c3d('0xcd')],{'as':_0x4c3d('0x1bb'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xcd')]['hasMany'](db[_0x4c3d('0xcf')],{'as':_0x4c3d('0x1bc'),'foreignKey':_0x4c3d('0x1bd')});db[_0x4c3d('0xcd')][_0x4c3d('0x117')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0x4c3d('0x1c2')});db[_0x4c3d('0xcd')][_0x4c3d('0x117')](db['FreshsalesField'],{'as':_0x4c3d('0x1ba'),'foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xcd')]['belongsTo'](db['FreshsalesAccount'],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1c0')});db[_0x4c3d('0xcf')][_0x4c3d('0x117')](db[_0x4c3d('0xcf')],{'as':'Subject','foreignKey':_0x4c3d('0x1bd')});db['FreshsalesField'][_0x4c3d('0x117')](db['FreshsalesField'],{'as':_0x4c3d('0x1c1'),'foreignKey':'DescriptionId'});db[_0x4c3d('0xcf')]['hasMany'](db['FreshsalesField'],{'as':'Field','foreignKey':_0x4c3d('0x1bf')});db[_0x4c3d('0xcf')]['belongsTo'](db[_0x4c3d('0x93')],{'as':_0x4c3d('0x93'),'foreignKey':_0x4c3d('0x1c3')});db[_0x4c3d('0x1ce')][_0x4c3d('0x151')](db['ChatWebsite'],{});db[_0x4c3d('0x1ce')][_0x4c3d('0x151')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b')});db['ChatQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x1ce')][_0x4c3d('0x151')](db[_0x4c3d('0x65')],{});db[_0x4c3d('0x1ce')][_0x4c3d('0x151')](db[_0x4c3d('0x67')],{});db[_0x4c3d('0x1ce')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{});db[_0x4c3d('0x1ce')][_0x4c3d('0x151')](db['ChatQueue'],{});db['ChatInternalMessage'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1cf')});db['ChatInternalMessage']['belongsTo'](db['User'],{'onDelete':'cascade','foreignKey':_0x4c3d('0x1d0')});db[_0x4c3d('0xd9')][_0x4c3d('0x117')](db[_0x4c3d('0xd8')],{'foreignKey':_0x4c3d('0x1d1'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0xd9')][_0x4c3d('0x117')](db[_0x4c3d('0xd6')],{'foreignKey':_0x4c3d('0x1d1'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0xdb')][_0x4c3d('0x151')](db[_0x4c3d('0x54')],{});db['SmsQueueReport'][_0x4c3d('0x151')](db['CmList'],{'as':'List','foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0xdb')][_0x4c3d('0x151')](db[_0x4c3d('0x127')],{'as':'Contact','foreignKey':_0x4c3d('0x163')});db['SmsQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x56')],{});db[_0x4c3d('0xdb')][_0x4c3d('0x151')](db['SmsMessage'],{});db[_0x4c3d('0xdb')][_0x4c3d('0x151')](db['User'],{});db[_0x4c3d('0xdb')][_0x4c3d('0x151')](db[_0x4c3d('0x137')],{});db[_0x4c3d('0xe1')]['hasMany'](db[_0x4c3d('0xd9')],{'foreignKey':'ProjectId'});db[_0x4c3d('0xe1')][_0x4c3d('0x117')](db[_0x4c3d('0xd8')],{'foreignKey':_0x4c3d('0x1d2')});db[_0x4c3d('0xe1')][_0x4c3d('0x117')](db[_0x4c3d('0xd6')],{'foreignKey':_0x4c3d('0x1d2')});db['SquareProject'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':'Users','through':'user_has_square_projects'});db['Team'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x12c')});db[_0x4c3d('0xe9')][_0x4c3d('0x126')](db[_0x4c3d('0x1b')],{'through':_0x4c3d('0x10d'),'as':_0x4c3d('0x133')});db[_0x4c3d('0xe9')][_0x4c3d('0x126')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x4c3d('0x1d3')});db['Team'][_0x4c3d('0x126')](db[_0x4c3d('0x69')],{'through':_0x4c3d('0x19c'),'as':'ChatQueues'});db[_0x4c3d('0xe9')]['belongsToMany'](db[_0x4c3d('0x50')],{'through':_0x4c3d('0x186'),'as':_0x4c3d('0x1d4')});db[_0x4c3d('0xe9')]['belongsToMany'](db[_0x4c3d('0x137')],{'through':_0x4c3d('0x18d'),'as':_0x4c3d('0x138')});db[_0x4c3d('0xe9')][_0x4c3d('0x126')](db[_0x4c3d('0x60')],{'through':_0x4c3d('0x1d5'),'as':_0x4c3d('0x139')});db[_0x4c3d('0xe9')][_0x4c3d('0x126')](db[_0x4c3d('0x10b')],{'through':_0x4c3d('0x1d6'),'as':'WhatsappQueues'});db[_0x4c3d('0xe9')]['belongsToMany'](db[_0x4c3d('0xfa')],{'through':_0x4c3d('0x10f'),'as':'VoicePrefixes'});db['Campaign'][_0x4c3d('0x117')](db[_0x4c3d('0x70')],{'as':'Hoppers','foreignKey':_0x4c3d('0x1a3')});db[_0x4c3d('0xed')][_0x4c3d('0x117')](db[_0x4c3d('0x73')],{'as':_0x4c3d('0x11a'),'foreignKey':_0x4c3d('0x1a3')});db[_0x4c3d('0xed')][_0x4c3d('0x117')](db['CmHopperHistory'],{'as':_0x4c3d('0x1a1'),'foreignKey':_0x4c3d('0x1a3')});db[_0x4c3d('0xed')][_0x4c3d('0x117')](db[_0x4c3d('0x71')],{'as':_0x4c3d('0x14f'),'foreignKey':_0x4c3d('0x1a3')});db[_0x4c3d('0xed')]['belongsTo'](db[_0x4c3d('0x2b')],{'as':_0x4c3d('0x2b'),'foreignKey':'TrunkId'});db[_0x4c3d('0xed')][_0x4c3d('0x151')](db['Trunk'],{'as':_0x4c3d('0x153'),'foreignKey':_0x4c3d('0x154')});db[_0x4c3d('0xed')][_0x4c3d('0x151')](db[_0x4c3d('0x82')],{'as':_0x4c3d('0x82'),'foreignKey':'IntervalId'});db['Campaign'][_0x4c3d('0x151')](db[_0x4c3d('0xe5')],{'as':'SquareProject','foreignKey':_0x4c3d('0x1d7')});db['Campaign'][_0x4c3d('0x126')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x12b'),'through':'campaigns_has_cm_lists'});db[_0x4c3d('0xed')][_0x4c3d('0x126')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x15a'),'through':_0x4c3d('0x1d8')});db['Attachment'][_0x4c3d('0x151')](db[_0x4c3d('0x178')],{'as':'ChatOfflineMessage','foreignKey':_0x4c3d('0x179')});db['MailTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x169')],{});db[_0x4c3d('0xf3')][_0x4c3d('0x151')](db[_0x4c3d('0x41')],{});db[_0x4c3d('0xf3')][_0x4c3d('0x151')](db[_0x4c3d('0x3e')],{'foreignKey':_0x4c3d('0x1d9'),'as':_0x4c3d('0x1da')});db[_0x4c3d('0xf3')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'foreignKey':_0x4c3d('0x1db'),'as':_0x4c3d('0x1dc')});db[_0x4c3d('0xf3')][_0x4c3d('0x151')](db['User'],{'foreignKey':_0x4c3d('0x1dd'),'as':_0x4c3d('0x1de')});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':_0x4c3d('0x1df'),'as':_0x4c3d('0x1e0')});db[_0x4c3d('0xf3')][_0x4c3d('0x151')](db[_0x4c3d('0x3e')],{'foreignKey':_0x4c3d('0x1e1'),'as':_0x4c3d('0x1e2')});db[_0x4c3d('0xf4')][_0x4c3d('0x151')](db['ChatMessage'],{});db[_0x4c3d('0xf4')][_0x4c3d('0x151')](db['ChatInteraction'],{});db[_0x4c3d('0xf4')][_0x4c3d('0x151')](db['ChatWebsite'],{'foreignKey':_0x4c3d('0x1e3'),'as':_0x4c3d('0x1da')});db[_0x4c3d('0xf4')][_0x4c3d('0x151')](db['User'],{'foreignKey':_0x4c3d('0x1db'),'as':_0x4c3d('0x1dc')});db[_0x4c3d('0xf4')]['belongsTo'](db['User'],{'foreignKey':_0x4c3d('0x1dd'),'as':_0x4c3d('0x1de')});db['ChatTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x69')],{'foreignKey':_0x4c3d('0x1e4'),'as':_0x4c3d('0x1e0')});db[_0x4c3d('0xf4')][_0x4c3d('0x151')](db[_0x4c3d('0x61')],{'foreignKey':_0x4c3d('0x1e5'),'as':_0x4c3d('0x1e2')});db[_0x4c3d('0xf6')]['belongsTo'](db['FaxMessage'],{});db[_0x4c3d('0xf6')][_0x4c3d('0x151')](db[_0x4c3d('0x4c')],{});db['FaxTransferReport']['belongsTo'](db['FaxAccount'],{'foreignKey':_0x4c3d('0x1e6'),'as':_0x4c3d('0x1da')});db['FaxTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'foreignKey':'FromUserId','as':_0x4c3d('0x1dc')});db[_0x4c3d('0xf6')][_0x4c3d('0x151')](db['User'],{'foreignKey':'ToUserId','as':_0x4c3d('0x1de')});db[_0x4c3d('0xf6')]['belongsTo'](db[_0x4c3d('0x50')],{'foreignKey':_0x4c3d('0x1e7'),'as':'ToQueue'});db['FaxTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x49')],{'foreignKey':_0x4c3d('0x1e8'),'as':'ToAccount'});db['OpenchannelTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x5f')],{});db['OpenchannelTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x5d')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0x4c3d('0x5a')],{'foreignKey':_0x4c3d('0x1e9'),'as':'FromAccount'});db[_0x4c3d('0x1ea')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'foreignKey':_0x4c3d('0x1db'),'as':_0x4c3d('0x1dc')});db[_0x4c3d('0x1ea')][_0x4c3d('0x151')](db['User'],{'foreignKey':_0x4c3d('0x1dd'),'as':'ToAgent'});db[_0x4c3d('0x1ea')][_0x4c3d('0x151')](db[_0x4c3d('0x60')],{'foreignKey':_0x4c3d('0x1eb'),'as':_0x4c3d('0x1e0')});db[_0x4c3d('0x1ea')][_0x4c3d('0x151')](db['OpenchannelAccount'],{'foreignKey':_0x4c3d('0x1ec'),'as':'ToAccount'});db[_0x4c3d('0xf9')][_0x4c3d('0x151')](db[_0x4c3d('0x58')],{});db['SmsTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x56')],{});db[_0x4c3d('0xf9')][_0x4c3d('0x151')](db[_0x4c3d('0x54')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x4c3d('0xf9')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'foreignKey':_0x4c3d('0x1db'),'as':_0x4c3d('0x1dc')});db['SmsTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'foreignKey':_0x4c3d('0x1dd'),'as':_0x4c3d('0x1de')});db['SmsTransferReport'][_0x4c3d('0x151')](db[_0x4c3d('0x137')],{'foreignKey':'ToSmsQueueId','as':_0x4c3d('0x1e0')});db[_0x4c3d('0xf9')]['belongsTo'](db[_0x4c3d('0x54')],{'foreignKey':_0x4c3d('0x1ed'),'as':'ToAccount'});db[_0x4c3d('0x12a')][_0x4c3d('0x117')](db[_0x4c3d('0x7e')],{'as':_0x4c3d('0x17e'),'foreignKey':_0x4c3d('0x17b'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x12a')][_0x4c3d('0x117')](db[_0x4c3d('0x78')],{'as':_0x4c3d('0x1ee'),'foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0x12a')][_0x4c3d('0x117')](db[_0x4c3d('0x127')],{'as':_0x4c3d('0x128'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0x12a')][_0x4c3d('0x117')](db[_0x4c3d('0x73')],{'as':_0x4c3d('0x11a'),'foreignKey':'ListId'});db[_0x4c3d('0x12a')][_0x4c3d('0x117')](db['CmHopperHistory'],{'as':_0x4c3d('0x1ef'),'foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0x12a')][_0x4c3d('0x117')](db['ReportAgentPreview'],{'as':_0x4c3d('0x76'),'foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0x12a')]['belongsToMany'](db['VoiceQueue'],{'as':_0x4c3d('0x1f0'),'through':'voice_queues_has_cm_lists'});db[_0x4c3d('0x12a')][_0x4c3d('0x126')](db['User'],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x1f1')});db[_0x4c3d('0xfa')]['hasMany'](db[_0x4c3d('0x19')],{'as':_0x4c3d('0x119'),'onDelete':'cascade'});db[_0x4c3d('0xfa')][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x134')});db[_0x4c3d('0xfa')][_0x4c3d('0x126')](db[_0x4c3d('0xe9')],{'through':_0x4c3d('0x10f'),'as':_0x4c3d('0x16d')});db[_0x4c3d('0x123')]['hasMany'](db[_0x4c3d('0x14')],{'as':'Users','foreignKey':_0x4c3d('0x124')});db[_0x4c3d('0x123')]['hasMany'](db[_0x4c3d('0xfb')],{'as':_0x4c3d('0x1f2'),'foreignKey':_0x4c3d('0x124'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0xfb')][_0x4c3d('0x117')](db[_0x4c3d('0xfd')],{'as':'Resources','foreignKey':_0x4c3d('0x1f3'),'onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x142')][_0x4c3d('0x117')](db['Disposition'],{'as':_0x4c3d('0x17e'),'foreignKey':'WhatsappAccountId','onDelete':_0x4c3d('0x113')});db[_0x4c3d('0x142')]['hasMany'](db[_0x4c3d('0x7d')],{'as':_0x4c3d('0x168'),'foreignKey':_0x4c3d('0x1f4')});db['WhatsappAccount'][_0x4c3d('0x117')](db['WhatsappMessage'],{'as':_0x4c3d('0x15b'),'foreignKey':_0x4c3d('0x1f4')});db['WhatsappAccount'][_0x4c3d('0x117')](db[_0x4c3d('0x103')],{'as':_0x4c3d('0x16a')});db[_0x4c3d('0x142')][_0x4c3d('0x117')](db[_0x4c3d('0x101')],{'as':_0x4c3d('0x149')});db[_0x4c3d('0x142')]['belongsTo'](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b')});db['WhatsappAccount'][_0x4c3d('0x151')](db[_0x4c3d('0x16c')],{'as':'mandatoryDispositionPause','foreignKey':_0x4c3d('0x157')});db['WhatsappAccount'][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x159'),'through':_0x4c3d('0x143')});db[_0x4c3d('0x101')][_0x4c3d('0x151')](db['User'],{'onDelete':'restrict'});db['WhatsappApplication'][_0x4c3d('0x151')](db[_0x4c3d('0x10b')],{'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x101')]['belongsTo'](db[_0x4c3d('0x142')],{'onDelete':'restrict'});db[_0x4c3d('0x101')][_0x4c3d('0x151')](db['Interval'],{'onDelete':_0x4c3d('0x167'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0x4c3d('0x151')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x4c3d('0x103')][_0x4c3d('0x117')](db[_0x4c3d('0x105')],{'as':_0x4c3d('0x15b'),'onDelete':_0x4c3d('0x113'),'foreignKey':_0x4c3d('0x1f5')});db['WhatsappInteraction']['belongsTo'](db[_0x4c3d('0x142')],{'as':_0x4c3d('0x176'),'foreignKey':'WhatsappAccountId'});db[_0x4c3d('0x103')][_0x4c3d('0x151')](db['CmContact'],{'as':_0x4c3d('0x162'),'foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x103')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x183'),'foreignKey':_0x4c3d('0x114')});db[_0x4c3d('0x103')][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x1f6'),'as':_0x4c3d('0x16f')});db[_0x4c3d('0x103')][_0x4c3d('0x126')](db[_0x4c3d('0x8d')],{'through':_0x4c3d('0x1f6'),'as':_0x4c3d('0x171')});db[_0x4c3d('0x103')]['belongsToMany'](db['User'],{'as':'Users','through':_0x4c3d('0x132'),'foreignKey':_0x4c3d('0x1f5')});db[_0x4c3d('0x105')][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{'as':_0x4c3d('0x14')});db['WhatsappMessage']['belongsTo'](db[_0x4c3d('0x127')],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x162')});db[_0x4c3d('0x105')][_0x4c3d('0x151')](db[_0x4c3d('0x103')],{'onDelete':_0x4c3d('0x113'),'as':_0x4c3d('0x18b'),'foreignKey':_0x4c3d('0x1f5')});db['WhatsappMessage'][_0x4c3d('0x151')](db[_0x4c3d('0x142')],{'as':_0x4c3d('0x176'),'foreignKey':_0x4c3d('0x1f4')});db[_0x4c3d('0x107')]['belongsTo'](db[_0x4c3d('0x142')],{});db[_0x4c3d('0x107')][_0x4c3d('0x151')](db[_0x4c3d('0x12a')],{'as':_0x4c3d('0x16b'),'foreignKey':_0x4c3d('0x17b')});db[_0x4c3d('0x107')]['belongsTo'](db[_0x4c3d('0x127')],{'as':'Contact','foreignKey':_0x4c3d('0x163')});db[_0x4c3d('0x107')][_0x4c3d('0x151')](db[_0x4c3d('0x103')],{});db[_0x4c3d('0x107')][_0x4c3d('0x151')](db[_0x4c3d('0x10b')],{});db[_0x4c3d('0x107')]['belongsTo'](db[_0x4c3d('0x105')],{});db['WhatsappQueueReport'][_0x4c3d('0x151')](db[_0x4c3d('0x14')],{});db[_0x4c3d('0x109')]['belongsTo'](db[_0x4c3d('0x105')],{});db[_0x4c3d('0x109')][_0x4c3d('0x151')](db[_0x4c3d('0x103')],{});db[_0x4c3d('0x109')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x4c3d('0x1f7'),'as':_0x4c3d('0x1da')});db['WhatsappTransferReport'][_0x4c3d('0x151')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db['WhatsappTransferReport']['belongsTo'](db[_0x4c3d('0x10b')],{'foreignKey':'ToQueueId','as':'ToQueue'});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x4c3d('0x1dc')});db[_0x4c3d('0x109')]['belongsTo'](db[_0x4c3d('0x14')],{'foreignKey':_0x4c3d('0x1dd'),'as':_0x4c3d('0x1de')});db[_0x4c3d('0x10b')][_0x4c3d('0x126')](db[_0x4c3d('0x14')],{'as':'Agents','through':_0x4c3d('0x39'),'foreignKey':_0x4c3d('0x1f8')});db[_0x4c3d('0x10b')][_0x4c3d('0x126')](db[_0x4c3d('0xe9')],{'through':_0x4c3d('0x1d6'),'as':_0x4c3d('0x16d')});db[_0x4c3d('0x111')][_0x4c3d('0x151')](db['User'],{'as':'user','foreignKey':_0x4c3d('0x114'),'onDelete':'cascade','hooks':!![]});db[_0x4c3d('0x165')][_0x4c3d('0x115')](db[_0x4c3d('0xc7')],{'as':_0x4c3d('0xc7'),'onDelete':_0x4c3d('0x167')});db[_0x4c3d('0x165')]['hasOne'](db['MailServerIn'],{'as':_0x4c3d('0x1f9'),'onDelete':'restrict'});db['CloudProvider'][_0x4c3d('0x115')](db[_0x4c3d('0x3d')],{'as':'Smtp','onDelete':_0x4c3d('0x167')});module[_0x4c3d('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xb386=['../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperFinal','CmHopperHistory','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','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','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','VoiceRecording','HopperHistory','ChatInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','Contacts','belongsToMany','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','MailQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperBlack','JscriptySessionReport','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','ContactId','MailAccountId','restrict','MailServerOut','CloudProviderId','Imap','Smtp','Dispositions','List','ListId','mandatoryDispositionPause','Agents','team_has_mail_queues','Account','Tags','mail_interaction_has_tags','ThroughTags','Users','Attachments','Contact','MailInteractionId','ChatWebsiteId','ChatOfflineMessageId','TagId','Items','FaxAccountId','Answers','Interactions','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','SmsApplication','mandatoryDispositionPauseId','SmsInteractionId','Owner','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatApplication','OpenchannelQueueReport','Agent','ChatQueue','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','ChatInternalMessage','ChatGroupId','CompanyId','HopperFinals','HopperHistories','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Action','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceField','Subjects','Descriptions','DescriptionId','Subject','SubjectId','Description','Field','FieldId','Variable','VariableId','DeskAccount','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowConfiguration','ServicenowField','Dynamics365Account','Dynamics365Field','FreshsalesField','ToId','SessionId','SmsQueueReport','ProjectId','ChatQueues','team_has_whatsapp_queues','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromUserId','FromAgent','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToUserId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','voice_queues_has_cm_lists','Extensions','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','user','exports','sequelize','lodash','jstz','determine','defaultsDeep','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','xC@LL1234','username','password','options','database','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','../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','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../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','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsInteraction','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb386,0x190));var _0x6b38=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xb386[_0x35885a];return _0xe86249;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x6b38('0x0'));var _=require(_0x6b38('0x1'));var jstz=require(_0x6b38('0x2'));var timezone=jstz[_0x6b38('0x3')]();config[_0x6b38('0x0')]=_[_0x6b38('0x4')](config[_0x6b38('0x0')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':_0x6b38('0x5'),'port':0xcea,'dialect':_0x6b38('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x6b38('0x7')](),'define':{'charset':_0x6b38('0x8'),'collate':_0x6b38('0x9')}}});config[_0x6b38('0xa')]=_[_0x6b38('0x4')](config['sequelizeHistory'],{'database':_0x6b38('0xb'),'username':_0x6b38('0xc'),'password':_0x6b38('0xd'),'options':{'host':_0x6b38('0x5'),'port':0xcea,'dialect':_0x6b38('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x6b38('0x7')](),'define':{'charset':'utf8','collate':_0x6b38('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6b38('0x0')]['database'],config[_0x6b38('0x0')][_0x6b38('0xe')],config[_0x6b38('0x0')][_0x6b38('0xf')],config[_0x6b38('0x0')][_0x6b38('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x6b38('0xa')][_0x6b38('0x11')],config[_0x6b38('0xa')][_0x6b38('0xe')],config['sequelizeHistory'][_0x6b38('0xf')],config[_0x6b38('0xa')][_0x6b38('0x10')])};db[_0x6b38('0x12')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/user/user.model');db[_0x6b38('0x14')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x15'));db[_0x6b38('0x16')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x17'));db[_0x6b38('0x18')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x19'));db[_0x6b38('0x1a')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x1b'));db['VoiceRecording']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x1c'));db[_0x6b38('0x1d')]=db['sequelize']['import'](_0x6b38('0x1e'));db[_0x6b38('0x1f')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x20'));db[_0x6b38('0x21')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x22'));db[_0x6b38('0x23')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x24'));db[_0x6b38('0x25')]=db['sequelize'][_0x6b38('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x6b38('0x26')]=db['sequelize']['import'](_0x6b38('0x27'));db[_0x6b38('0x28')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x29'));db[_0x6b38('0x2a')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x2b'));db[_0x6b38('0x2c')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x2d'));db[_0x6b38('0x2e')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x2f'));db[_0x6b38('0x30')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x31'));db[_0x6b38('0x32')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x33'));db[_0x6b38('0x34')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x35'));db[_0x6b38('0x36')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x37'));db[_0x6b38('0x38')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x39'));db[_0x6b38('0x3a')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x3b'));db[_0x6b38('0x3c')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x3d'));db[_0x6b38('0x3e')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x3f'));db[_0x6b38('0x40')]=db['sequelize'][_0x6b38('0x13')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x41'));db[_0x6b38('0x42')]=db[_0x6b38('0x0')]['import']('../api/mailAccount/mailAccount.model');db[_0x6b38('0x43')]=db['sequelize']['import'](_0x6b38('0x44'));db[_0x6b38('0x45')]=db['sequelize']['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x6b38('0x46')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x47'));db[_0x6b38('0x48')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x49'));db[_0x6b38('0x4a')]=db['sequelize']['import'](_0x6b38('0x4b'));db[_0x6b38('0x4c')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x4d'));db[_0x6b38('0x4e')]=db['sequelize'][_0x6b38('0x13')]('../api/dashboard/dashboard.model');db[_0x6b38('0x4f')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x50'));db[_0x6b38('0x51')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/faxAccount/faxAccount.model');db[_0x6b38('0x52')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x53'));db['FaxInteraction']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x54'));db[_0x6b38('0x55')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x56'));db[_0x6b38('0x57')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x58'));db[_0x6b38('0x59')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x5a'));db[_0x6b38('0x5b')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x5c'));db['SmsApplication']=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/smsApplication/smsApplication.model');db[_0x6b38('0x5d')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x6b38('0x0')]['import'](_0x6b38('0x5e'));db[_0x6b38('0x5f')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x60'));db[_0x6b38('0x61')]=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0x6b38('0x62')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x63'));db[_0x6b38('0x64')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x65'));db[_0x6b38('0x66')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x67'));db[_0x6b38('0x68')]=db['sequelize']['import'](_0x6b38('0x69'));db[_0x6b38('0x6a')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x6b'));db['OpenchannelQueueReport']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x6c'));db['ChatApplication']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x6d'));db[_0x6b38('0x6e')]=db[_0x6b38('0x0')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x6b38('0x6f')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x70'));db[_0x6b38('0x71')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x72'));db['ChatQueue']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x73'));db[_0x6b38('0x74')]=db['sequelize'][_0x6b38('0x13')]('../api/chatGroup/chatGroup.model');db[_0x6b38('0x75')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x76'));db[_0x6b38('0x77')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x78'));db[_0x6b38('0x79')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x7a'));db[_0x6b38('0x7b')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x7c'));db['CmHopperBlack']=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x6b38('0x7d')]=db[_0x6b38('0x0')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x6b38('0x7e')]=db[_0x6b38('0x0')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x6b38('0x7f')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x6b38('0x80')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x81'));db['Action']=db[_0x6b38('0x0')]['import'](_0x6b38('0x82'));db[_0x6b38('0x83')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x84'));db[_0x6b38('0x85')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0x6b38('0x86')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x87'));db[_0x6b38('0x88')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x89'));db[_0x6b38('0x8a')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/interval/interval.model');db[_0x6b38('0x8b')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x8c'));db[_0x6b38('0x8d')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x8e'));db[_0x6b38('0x8f')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x90'));db[_0x6b38('0x91')]=db['sequelize']['import']('../api/schedule/schedule.model');db[_0x6b38('0x92')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x93'));db[_0x6b38('0x94')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x95'));db[_0x6b38('0x96')]=db['sequelize'][_0x6b38('0x13')]('../api/template/template.model');db[_0x6b38('0x97')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/trigger/trigger.model');db['Variable']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x98'));db['Integration']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x99'));db[_0x6b38('0x9a')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x9b'));db[_0x6b38('0x9c')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x6b38('0x9d')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x9e'));db[_0x6b38('0x9f')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x6b38('0xa0')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xa1'));db[_0x6b38('0xa2')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xa3'));db[_0x6b38('0xa4')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xa5'));db[_0x6b38('0xa6')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xa7'));db[_0x6b38('0xa8')]=db['sequelize'][_0x6b38('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xa9'));db[_0x6b38('0xaa')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x6b38('0xab')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xac'));db[_0x6b38('0xad')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xae'));db['DeskAccount']=db[_0x6b38('0x0')]['import'](_0x6b38('0xaf'));db[_0x6b38('0xb0')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xb1'));db[_0x6b38('0xb2')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xb3'));db[_0x6b38('0xb4')]=db[_0x6b38('0x0')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x6b38('0xb5')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xb6'));db[_0x6b38('0xb7')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xb8'));db[_0x6b38('0xb9')]=db['sequelize']['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x6b38('0xba')]=db['sequelize']['import'](_0x6b38('0xbb'));db[_0x6b38('0xbc')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xbd'));db[_0x6b38('0xbe')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x6b38('0xbf')]=db['sequelize'][_0x6b38('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xc0'));db[_0x6b38('0xc1')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xc2'));db[_0x6b38('0xc3')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0xc4'));db[_0x6b38('0xc5')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xc6'));db['ServicenowAccount']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xc7'));db['ServicenowConfiguration']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xc8'));db['ServicenowField']=db[_0x6b38('0x0')]['import'](_0x6b38('0xc9'));db['Dynamics365Account']=db['sequelize'][_0x6b38('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x6b38('0xca')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db['Dynamics365Field']=db['sequelize'][_0x6b38('0x13')](_0x6b38('0xcb'));db[_0x6b38('0xcc')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x6b38('0xcd')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xce'));db[_0x6b38('0xcf')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x99'));db[_0x6b38('0xd0')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/network/network.model');db[_0x6b38('0xd1')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xd2'));db['ChatInternalMessage']=db['sequelize'][_0x6b38('0x13')](_0x6b38('0xd3'));db[_0x6b38('0xd4')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xd5'));db[_0x6b38('0xd6')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xd7'));db['JscriptySessionReport']=db[_0x6b38('0x0')]['import'](_0x6b38('0xd8'));db['SmsQueueReport']=db[_0x6b38('0x0')]['import'](_0x6b38('0xd9'));db['SquareReport']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xda'));db['SquareDetailsReport']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xdb'));db[_0x6b38('0xdc')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0xdd'));db[_0x6b38('0xde')]=db['sequelize']['import'](_0x6b38('0xdf'));db[_0x6b38('0xe0')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xe1'));db['SquareProject']=db[_0x6b38('0x0')]['import'](_0x6b38('0xe2'));db[_0x6b38('0xe3')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xe4'));db[_0x6b38('0xe5')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0xe6'));db[_0x6b38('0xe7')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xe8'));db[_0x6b38('0xe9')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/license/license.model');db[_0x6b38('0xea')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xeb'));db['Migration']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xec'));db[_0x6b38('0xed')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/attachment/attachment.model');db[_0x6b38('0xee')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xef'));db['MailTransferReport']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xf0'));db['ChatTransferReport']=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0x6b38('0xf1')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0xf2'));db[_0x6b38('0xf3')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xf4'));db['SmsTransferReport']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xf5'));db[_0x6b38('0xf6')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xf7'));db[_0x6b38('0xf8')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x6b38('0xf9')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xfa'));db[_0x6b38('0xfb')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0xfc'));db[_0x6b38('0xfd')]=db[_0x6b38('0x0')]['import'](_0x6b38('0xfe'));db[_0x6b38('0xff')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x100'));db['WhatsappApplication']=db['sequelize'][_0x6b38('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x6b38('0x101')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x102'));db[_0x6b38('0x103')]=db[_0x6b38('0x0')][_0x6b38('0x13')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x104'));db[_0x6b38('0x105')]=db[_0x6b38('0x0')][_0x6b38('0x13')](_0x6b38('0x106'));db[_0x6b38('0x107')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x108'));db[_0x6b38('0x109')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x10a'));db[_0x6b38('0x10b')]=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x10c'));db[_0x6b38('0x10d')]=db['sequelize']['import'](_0x6b38('0x10e'));db[_0x6b38('0x10f')]=db[_0x6b38('0x0')]['import'](_0x6b38('0x110'));db['UserSetting']=db['sequelize'][_0x6b38('0x13')](_0x6b38('0x111'));db[_0x6b38('0x12')][_0x6b38('0x112')](db[_0x6b38('0x1f')],{'as':_0x6b38('0x1f'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')]['hasOne'](db['UserSetting'],{'as':_0x6b38('0x115'),'onDelete':_0x6b38('0x113'),'foreignKey':'UserId'});db['User'][_0x6b38('0x116')](db[_0x6b38('0x117')],{'as':'Recordings','foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')][_0x6b38('0x116')](db[_0x6b38('0x30')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0x6b38('0x12')][_0x6b38('0x116')](db[_0x6b38('0x18')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x6b38('0x12')]['hasMany'](db[_0x6b38('0x7d')],{'as':'HopperFinals','foreignKey':'UserId'});db['User'][_0x6b38('0x116')](db[_0x6b38('0x7e')],{'as':_0x6b38('0x118'),'foreignKey':'UserId'});db[_0x6b38('0x12')]['hasMany'](db[_0x6b38('0x7f')],{'as':_0x6b38('0x7f'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')][_0x6b38('0x116')](db[_0x6b38('0x64')],{'as':'OpenchannelInteractions','foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')][_0x6b38('0x116')](db['ChatInteraction'],{'as':_0x6b38('0x119'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')]['hasMany'](db[_0x6b38('0x5d')],{'as':'SmsInteractions','foreignKey':_0x6b38('0x114')});db['User']['hasMany'](db[_0x6b38('0x11a')],{'as':'FaxInteractions','foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')][_0x6b38('0x116')](db[_0x6b38('0x46')],{'as':_0x6b38('0x11b'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')][_0x6b38('0x116')](db['WhatsappInteraction'],{'as':_0x6b38('0x11c'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x12')][_0x6b38('0x116')](db[_0x6b38('0xfd')],{'as':_0x6b38('0x11d'),'foreignKey':_0x6b38('0x11e')});db[_0x6b38('0x12')][_0x6b38('0x11f')](db[_0x6b38('0xf9')],{'as':'UserProfile','foreignKey':_0x6b38('0x120')});db[_0x6b38('0x12')]['belongsToMany'](db[_0x6b38('0x74')],{'as':_0x6b38('0x121'),'through':_0x6b38('0x122')});db['User']['belongsToMany'](db[_0x6b38('0x79')],{'as':_0x6b38('0x123'),'through':'cm_user_has_contacts'});db['User'][_0x6b38('0x124')](db['CmList'],{'as':_0x6b38('0x125'),'through':_0x6b38('0x126')});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0xe7')],{'through':_0x6b38('0x127')});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0x46')],{'as':_0x6b38('0x11b'),'through':_0x6b38('0x128')});db[_0x6b38('0x12')]['belongsToMany'](db[_0x6b38('0x6e')],{'as':'ChatInteractions','through':_0x6b38('0x129')});db[_0x6b38('0x12')]['belongsToMany'](db[_0x6b38('0x11a')],{'as':_0x6b38('0x12a'),'through':_0x6b38('0x12b')});db[_0x6b38('0x12')][_0x6b38('0x124')](db['SmsInteraction'],{'as':_0x6b38('0x12c'),'through':_0x6b38('0x12d')});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0x64')],{'as':_0x6b38('0x12e'),'through':_0x6b38('0x12f')});db['User'][_0x6b38('0x124')](db[_0x6b38('0x101')],{'as':'WhatsappInteractions','through':_0x6b38('0x130')});db['User']['belongsToMany'](db[_0x6b38('0x131')],{'as':_0x6b38('0x132'),'through':'UserVoiceQueue','required':![]});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0xf8')],{'as':_0x6b38('0x133'),'through':_0x6b38('0x10f'),'required':![]});db[_0x6b38('0x12')][_0x6b38('0x124')](db['MailQueue'],{'as':_0x6b38('0x134'),'through':'UserMailQueue','required':![]});db['User'][_0x6b38('0x124')](db['ChatQueue'],{'as':'ChatQueues','through':_0x6b38('0x34'),'required':![],'hooks':!![]});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0x57')],{'as':_0x6b38('0x135'),'through':'UserFaxQueue','required':![]});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0x5f')],{'as':_0x6b38('0x136'),'through':'UserSmsQueue','required':![]});db[_0x6b38('0x12')][_0x6b38('0x124')](db['OpenchannelQueue'],{'as':_0x6b38('0x137'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x6b38('0x124')](db[_0x6b38('0x107')],{'as':_0x6b38('0x138'),'through':_0x6b38('0x3e'),'required':![]});db[_0x6b38('0x12')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x6b38('0x12')][_0x6b38('0x124')](db['ChatWebsite'],{'as':_0x6b38('0x139'),'through':_0x6b38('0x13a')});db[_0x6b38('0x12')]['belongsToMany'](db[_0x6b38('0x51')],{'as':_0x6b38('0x13b'),'through':_0x6b38('0x13c')});db['User'][_0x6b38('0x124')](db[_0x6b38('0x42')],{'as':_0x6b38('0x13d'),'through':_0x6b38('0x13e')});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0x61')],{'as':_0x6b38('0x13f'),'through':_0x6b38('0x140')});db[_0x6b38('0x12')][_0x6b38('0x124')](db['SmsAccount'],{'as':'SmsAccounts','through':_0x6b38('0x141')});db[_0x6b38('0x12')]['belongsToMany'](db['WhatsappAccount'],{'as':_0x6b38('0x142'),'through':_0x6b38('0x143')});db[_0x6b38('0x12')][_0x6b38('0x124')](db[_0x6b38('0x144')],{'as':_0x6b38('0x145'),'through':_0x6b38('0x146')});db[_0x6b38('0x14')][_0x6b38('0x116')](db['VoiceExtension'],{'as':_0x6b38('0x147'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x148')});db['VoiceContext'][_0x6b38('0x116')](db[_0x6b38('0x18')],{'onDelete':_0x6b38('0x113')});db[_0x6b38('0x18')][_0x6b38('0x116')](db[_0x6b38('0x18')],{'as':_0x6b38('0x149'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0x6b38('0x124')](db['Sound'],{'as':_0x6b38('0x14a'),'through':_0x6b38('0x14b')});db[_0x6b38('0x131')][_0x6b38('0x116')](db['UserVoiceQueueRt'],{'as':_0x6b38('0x14c'),'foreignKey':_0x6b38('0x14d')});db[_0x6b38('0x131')]['hasMany'](db[_0x6b38('0x7b')],{'as':_0x6b38('0x14e'),'foreignKey':_0x6b38('0x14d')});db['VoiceQueue'][_0x6b38('0x116')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x6b38('0x14d')});db[_0x6b38('0x131')]['hasMany'](db[_0x6b38('0x7e')],{'as':'HopperHistories','foreignKey':_0x6b38('0x14d')});db[_0x6b38('0x131')][_0x6b38('0x116')](db[_0x6b38('0x7f')],{'as':_0x6b38('0x7f'),'foreignKey':_0x6b38('0x14d')});db[_0x6b38('0x131')]['hasMany'](db[_0x6b38('0x14f')],{'as':'HopperBlacks','foreignKey':_0x6b38('0x14d')});db[_0x6b38('0x131')]['hasMany'](db[_0x6b38('0x150')],{'as':'JscriptySessions','foreignKey':'VoiceQueueId'});db['VoiceQueue']['belongsTo'](db[_0x6b38('0x2c')],{'as':'Trunk','foreignKey':_0x6b38('0x151')});db['VoiceQueue'][_0x6b38('0x11f')](db[_0x6b38('0x2c')],{'as':_0x6b38('0x152'),'foreignKey':_0x6b38('0x153')});db[_0x6b38('0x131')][_0x6b38('0x11f')](db['Interval'],{'as':_0x6b38('0x8a'),'foreignKey':_0x6b38('0x154')});db[_0x6b38('0x131')]['belongsTo'](db[_0x6b38('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x6b38('0x131')][_0x6b38('0x124')](db['CmList'],{'as':_0x6b38('0x125'),'through':'voice_queues_has_cm_lists'});db[_0x6b38('0x131')][_0x6b38('0x124')](db['User'],{'as':'Agents','through':_0x6b38('0x32')});db[_0x6b38('0x131')]['belongsToMany'](db['Team'],{'as':_0x6b38('0x155'),'through':_0x6b38('0x10b')});db['VoiceQueue']['belongsToMany'](db['CmList'],{'as':_0x6b38('0x156'),'through':_0x6b38('0x157')});db['VoiceRecording']['belongsTo'](db['User'],{'as':_0x6b38('0x12'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x1d')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':_0x6b38('0x12'),'foreignKey':_0x6b38('0x114')});db['VoiceMail'][_0x6b38('0x116')](db[_0x6b38('0x21')],{'as':_0x6b38('0x158'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x159'),'sourceKey':_0x6b38('0x15a')});db[_0x6b38('0x21')][_0x6b38('0x11f')](db[_0x6b38('0x1f')],{'foreignKey':_0x6b38('0x159'),'targetKey':_0x6b38('0x15a')});db[_0x6b38('0x23')][_0x6b38('0x116')](db['VoiceQueueReport'],{'as':_0x6b38('0x15b'),'foreignKey':_0x6b38('0x15c'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x6b38('0x26')],{'as':'AgentReports','foreignKey':_0x6b38('0x15c'),'constraints':![]});db[_0x6b38('0x23')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':_0x6b38('0x12'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x23')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':'Contact','foreignKey':_0x6b38('0x15d')});db['MailServerIn'][_0x6b38('0x11f')](db[_0x6b38('0x42')],{'as':'MailAccount','foreignKey':_0x6b38('0x15e')});db['MailServerIn'][_0x6b38('0x11f')](db[_0x6b38('0x109')],{'as':_0x6b38('0x109'),'foreignKey':'CloudProviderId','onDelete':_0x6b38('0x15f')});db[_0x6b38('0x160')][_0x6b38('0x11f')](db[_0x6b38('0x42')],{'as':_0x6b38('0x42'),'foreignKey':_0x6b38('0x15e')});db[_0x6b38('0x160')][_0x6b38('0x11f')](db['CloudProvider'],{'as':_0x6b38('0x109'),'foreignKey':_0x6b38('0x161'),'onDelete':'restrict'});db['MailAccount'][_0x6b38('0x112')](db[_0x6b38('0x40')],{'as':_0x6b38('0x162'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x42')][_0x6b38('0x112')](db[_0x6b38('0x160')],{'as':_0x6b38('0x163'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x42')][_0x6b38('0x116')](db['Disposition'],{'as':_0x6b38('0x164'),'foreignKey':_0x6b38('0x15e'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x42')][_0x6b38('0x116')](db[_0x6b38('0x85')],{'as':'Answers','foreignKey':_0x6b38('0x15e')});db[_0x6b38('0x42')][_0x6b38('0x116')](db[_0x6b38('0x48')],{'as':_0x6b38('0x158'),'foreignKey':_0x6b38('0x15e')});db[_0x6b38('0x42')][_0x6b38('0x116')](db[_0x6b38('0x46')],{'as':'Interactions'});db[_0x6b38('0x42')][_0x6b38('0x116')](db['MailApplication'],{'as':_0x6b38('0x149')});db[_0x6b38('0x42')]['belongsTo'](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0x42')]['belongsTo'](db[_0x6b38('0x96')],{'as':_0x6b38('0x96'),'foreignKey':'TemplateId'});db[_0x6b38('0x42')][_0x6b38('0x11f')](db[_0x6b38('0x8b')],{'as':_0x6b38('0x167'),'foreignKey':'mandatoryDispositionPauseId'});db['MailAccount'][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':'Agents','through':_0x6b38('0x13e')});db[_0x6b38('0x43')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':'UserMailQueue'});db[_0x6b38('0x43')][_0x6b38('0x124')](db[_0x6b38('0xe7')],{'through':_0x6b38('0x169'),'as':_0x6b38('0x155')});db[_0x6b38('0x46')][_0x6b38('0x116')](db[_0x6b38('0x48')],{'as':'Messages','onDelete':_0x6b38('0x113'),'foreignKey':'MailInteractionId'});db[_0x6b38('0x46')][_0x6b38('0x11f')](db[_0x6b38('0x42')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x15e')});db[_0x6b38('0x46')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':'Contact','foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x46')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':'Owner','foreignKey':_0x6b38('0x114')});db[_0x6b38('0x46')][_0x6b38('0x124')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0x6b38('0x16b')});db[_0x6b38('0x46')]['belongsToMany'](db[_0x6b38('0x94')],{'through':_0x6b38('0x16c'),'as':_0x6b38('0x16d')});db[_0x6b38('0x46')]['belongsToMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x16e'),'through':_0x6b38('0x128'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x6b38('0x116')](db[_0x6b38('0xed')],{'as':_0x6b38('0x16f'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x48')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':_0x6b38('0x12')});db['MailMessage'][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x170')});db['MailMessage'][_0x6b38('0x11f')](db[_0x6b38('0x46')],{'as':'Interaction','foreignKey':_0x6b38('0x171')});db[_0x6b38('0x48')][_0x6b38('0x11f')](db['MailAccount'],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x15e')});db['MailMessage'][_0x6b38('0x11f')](db[_0x6b38('0x6a')],{'as':_0x6b38('0x6a'),'foreignKey':_0x6b38('0x172')});db[_0x6b38('0x48')][_0x6b38('0x11f')](db[_0x6b38('0x71')],{'as':_0x6b38('0x71'),'foreignKey':_0x6b38('0x173')});db['MailApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0x6b38('0x4a')][_0x6b38('0x11f')](db[_0x6b38('0x43')],{'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x4a')]['belongsTo'](db[_0x6b38('0x42')],{'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x4a')]['belongsTo'](db[_0x6b38('0x8a')],{'onDelete':'restrict','foreignKey':_0x6b38('0x154')});db['MailApplication'][_0x6b38('0x11f')](db[_0x6b38('0x94')],{'onDelete':_0x6b38('0x15f'),'foreignKey':_0x6b38('0x174')});db[_0x6b38('0x4c')][_0x6b38('0x11f')](db[_0x6b38('0x42')],{});db['MailQueueReport'][_0x6b38('0x11f')](db['CmList'],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0x4c')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db['MailQueueReport'][_0x6b38('0x11f')](db['MailInteraction'],{});db[_0x6b38('0x4c')][_0x6b38('0x11f')](db[_0x6b38('0x48')],{});db[_0x6b38('0x4c')]['belongsTo'](db[_0x6b38('0x12')],{});db[_0x6b38('0x4c')]['belongsTo'](db[_0x6b38('0x43')],{});db[_0x6b38('0x4e')]['hasMany'](db[_0x6b38('0x4f')],{'as':_0x6b38('0x175'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x51')][_0x6b38('0x116')](db['Disposition'],{'as':_0x6b38('0x164'),'foreignKey':_0x6b38('0x176'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x51')]['hasMany'](db['CannedAnswer'],{'as':_0x6b38('0x177'),'foreignKey':_0x6b38('0x176')});db['FaxAccount'][_0x6b38('0x116')](db[_0x6b38('0x11a')],{'as':_0x6b38('0x178')});db[_0x6b38('0x51')]['hasMany'](db[_0x6b38('0x52')],{'as':_0x6b38('0x149')});db[_0x6b38('0x51')]['hasMany'](db[_0x6b38('0x18')],{'as':'Exntensions','onDelete':'cascade'});db[_0x6b38('0x51')][_0x6b38('0x116')](db[_0x6b38('0x55')],{'as':_0x6b38('0x158')});db[_0x6b38('0x51')][_0x6b38('0x11f')](db['Trunk'],{'as':_0x6b38('0x2c')});db['FaxAccount'][_0x6b38('0x11f')](db['CmList'],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db['FaxAccount'][_0x6b38('0x11f')](db[_0x6b38('0x8b')],{'as':_0x6b38('0x167'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x6b38('0x51')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':'user_has_fax_accounts'});db[_0x6b38('0x52')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x52')][_0x6b38('0x11f')](db[_0x6b38('0x57')],{'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x52')]['belongsTo'](db[_0x6b38('0x51')],{'onDelete':'restrict'});db[_0x6b38('0x52')][_0x6b38('0x11f')](db[_0x6b38('0x94')],{'onDelete':_0x6b38('0x15f'),'foreignKey':_0x6b38('0x174')});db[_0x6b38('0x11a')][_0x6b38('0x116')](db['FaxMessage'],{'as':_0x6b38('0x158'),'onDelete':'cascade','foreignKey':_0x6b38('0x179')});db[_0x6b38('0x11a')][_0x6b38('0x11f')](db[_0x6b38('0x51')],{'as':_0x6b38('0x16a'),'foreignKey':'FaxAccountId'});db[_0x6b38('0x11a')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x11a')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':'Owner','foreignKey':_0x6b38('0x114')});db[_0x6b38('0x11a')][_0x6b38('0x124')](db[_0x6b38('0x94')],{'through':_0x6b38('0x17a'),'as':_0x6b38('0x16b')});db[_0x6b38('0x11a')]['belongsToMany'](db[_0x6b38('0x94')],{'through':_0x6b38('0x17a'),'as':_0x6b38('0x16d')});db[_0x6b38('0x11a')][_0x6b38('0x124')](db['User'],{'as':_0x6b38('0x16e'),'through':_0x6b38('0x12b'),'foreignKey':_0x6b38('0x179')});db['FaxMessage'][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'onDelete':_0x6b38('0x113'),'as':'User'});db[_0x6b38('0x55')]['belongsTo'](db[_0x6b38('0x11a')],{'as':_0x6b38('0x17b'),'foreignKey':_0x6b38('0x179')});db[_0x6b38('0x55')]['belongsTo'](db[_0x6b38('0x79')],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x170')});db[_0x6b38('0x55')][_0x6b38('0x11f')](db[_0x6b38('0xed')],{'as':_0x6b38('0xed'),'foreignKey':_0x6b38('0x17c')});db[_0x6b38('0x55')][_0x6b38('0x11f')](db[_0x6b38('0x51')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x176')});db['FaxQueue']['belongsToMany'](db['User'],{'as':'Agents','through':_0x6b38('0x38')});db[_0x6b38('0x57')]['belongsToMany'](db[_0x6b38('0xe7')],{'through':_0x6b38('0x17d'),'as':'Teams'});db[_0x6b38('0x59')]['belongsTo'](db[_0x6b38('0x51')],{});db['FaxQueueReport'][_0x6b38('0x11f')](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':'ListId'});db[_0x6b38('0x59')]['belongsTo'](db['CmContact'],{'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x59')][_0x6b38('0x11f')](db[_0x6b38('0x11a')],{});db['FaxQueueReport'][_0x6b38('0x11f')](db[_0x6b38('0x55')],{});db[_0x6b38('0x59')][_0x6b38('0x11f')](db['User'],{});db[_0x6b38('0x59')]['belongsTo'](db[_0x6b38('0x57')],{});db[_0x6b38('0x5b')][_0x6b38('0x116')](db[_0x6b38('0x86')],{'as':_0x6b38('0x164'),'foreignKey':_0x6b38('0x17e'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x5b')]['hasMany'](db[_0x6b38('0x85')],{'as':'Answers','foreignKey':_0x6b38('0x17e')});db[_0x6b38('0x5b')]['hasMany'](db[_0x6b38('0x17f')],{'as':_0x6b38('0x158'),'foreignKey':'SmsAccountId'});db[_0x6b38('0x5b')][_0x6b38('0x116')](db[_0x6b38('0x5d')],{'as':_0x6b38('0x178')});db[_0x6b38('0x5b')]['hasMany'](db[_0x6b38('0x180')],{'as':_0x6b38('0x149')});db['SmsAccount'][_0x6b38('0x11f')](db[_0x6b38('0xf6')],{'as':'List','foreignKey':_0x6b38('0x166')});db['SmsAccount'][_0x6b38('0x11f')](db[_0x6b38('0x8b')],{'as':_0x6b38('0x167'),'foreignKey':_0x6b38('0x181')});db[_0x6b38('0x5b')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':'user_has_sms_accounts'});db[_0x6b38('0x180')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x180')][_0x6b38('0x11f')](db['SmsQueue'],{'onDelete':_0x6b38('0x15f')});db['SmsApplication'][_0x6b38('0x11f')](db[_0x6b38('0x5b')],{'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x180')][_0x6b38('0x11f')](db[_0x6b38('0x8a')],{'onDelete':_0x6b38('0x15f'),'foreignKey':_0x6b38('0x154')});db[_0x6b38('0x180')][_0x6b38('0x11f')](db['Tag'],{'onDelete':_0x6b38('0x15f'),'foreignKey':'TagId'});db[_0x6b38('0x5d')][_0x6b38('0x116')](db[_0x6b38('0x17f')],{'as':_0x6b38('0x158'),'onDelete':'cascade','foreignKey':_0x6b38('0x182')});db[_0x6b38('0x5d')][_0x6b38('0x11f')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x6b38('0x5d')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':'Contact','foreignKey':_0x6b38('0x15d')});db['SmsInteraction'][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':_0x6b38('0x183'),'foreignKey':_0x6b38('0x114')});db['SmsInteraction'][_0x6b38('0x124')](db[_0x6b38('0x94')],{'through':'sms_interaction_has_tags','as':_0x6b38('0x16b')});db[_0x6b38('0x5d')][_0x6b38('0x124')](db[_0x6b38('0x94')],{'through':_0x6b38('0x184'),'as':'ThroughTags'});db[_0x6b38('0x5d')]['belongsToMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x16e'),'through':_0x6b38('0x12d'),'foreignKey':_0x6b38('0x182')});db[_0x6b38('0x17f')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':'User'});db['SmsMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x170')});db['SmsMessage'][_0x6b38('0x11f')](db[_0x6b38('0x5d')],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x17b'),'foreignKey':_0x6b38('0x182')});db[_0x6b38('0x17f')]['belongsTo'](db[_0x6b38('0x5b')],{'as':_0x6b38('0x16a'),'foreignKey':'SmsAccountId'});db[_0x6b38('0x5f')]['belongsToMany'](db[_0x6b38('0x12')],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0x6b38('0x185')});db[_0x6b38('0x5f')][_0x6b38('0x124')](db[_0x6b38('0xe7')],{'through':_0x6b38('0x186'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x6b38('0x86')],{'as':_0x6b38('0x164'),'foreignKey':'OpenchannelAccountId','onDelete':_0x6b38('0x113')});db['OpenchannelAccount']['hasMany'](db[_0x6b38('0x85')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x6b38('0x61')][_0x6b38('0x116')](db[_0x6b38('0x64')],{'as':_0x6b38('0x178'),'foreignKey':_0x6b38('0x187')});db['OpenchannelAccount'][_0x6b38('0x116')](db[_0x6b38('0x66')],{'as':_0x6b38('0x158'),'foreignKey':_0x6b38('0x187')});db[_0x6b38('0x61')]['hasMany'](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x6b38('0x187')});db[_0x6b38('0x61')]['belongsTo'](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0x61')][_0x6b38('0x11f')](db[_0x6b38('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x6b38('0x61')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':_0x6b38('0x140')});db[_0x6b38('0x62')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'onDelete':'restrict'});db[_0x6b38('0x62')][_0x6b38('0x11f')](db[_0x6b38('0x68')],{'onDelete':_0x6b38('0x15f'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0x6b38('0x11f')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x6b38('0x62')]['belongsTo'](db[_0x6b38('0x8a')],{'onDelete':_0x6b38('0x15f'),'foreignKey':_0x6b38('0x154')});db[_0x6b38('0x62')][_0x6b38('0x11f')](db['Tag'],{'onDelete':_0x6b38('0x15f'),'foreignKey':_0x6b38('0x174')});db[_0x6b38('0x64')][_0x6b38('0x116')](db['OpenchannelMessage'],{'as':_0x6b38('0x158'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x188')});db[_0x6b38('0x64')]['belongsTo'](db[_0x6b38('0x61')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x187')});db[_0x6b38('0x64')][_0x6b38('0x11f')](db['CmContact'],{'as':_0x6b38('0x170'),'foreignKey':'ContactId'});db[_0x6b38('0x64')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x6b38('0x64')][_0x6b38('0x124')](db['Tag'],{'through':_0x6b38('0x189'),'as':_0x6b38('0x16b')});db['OpenchannelInteraction'][_0x6b38('0x124')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0x6b38('0x64')]['belongsToMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x16e'),'through':_0x6b38('0x12f'),'foreignKey':_0x6b38('0x188')});db['OpenchannelMessage']['belongsTo'](db['User'],{'onDelete':_0x6b38('0x113'),'as':'User'});db[_0x6b38('0x66')]['belongsTo'](db[_0x6b38('0x79')],{'onDelete':'cascade','as':_0x6b38('0x170')});db['OpenchannelMessage'][_0x6b38('0x11f')](db['OpenchannelInteraction'],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x17b'),'foreignKey':_0x6b38('0x188')});db['OpenchannelMessage'][_0x6b38('0x11f')](db[_0x6b38('0xed')],{'as':_0x6b38('0xed'),'foreignKey':_0x6b38('0x17c')});db['OpenchannelMessage'][_0x6b38('0x11f')](db[_0x6b38('0x61')],{'as':'Account','foreignKey':_0x6b38('0x187')});db[_0x6b38('0x68')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db[_0x6b38('0x68')]['belongsToMany'](db[_0x6b38('0xe7')],{'through':_0x6b38('0x18a'),'as':_0x6b38('0x155')});db[_0x6b38('0x6a')]['hasMany'](db[_0x6b38('0x86')],{'as':'Dispositions','foreignKey':_0x6b38('0x172'),'onDelete':_0x6b38('0x113')});db['ChatWebsite'][_0x6b38('0x116')](db['CannedAnswer'],{'as':_0x6b38('0x177'),'foreignKey':_0x6b38('0x172')});db[_0x6b38('0x6a')]['hasMany'](db[_0x6b38('0x75')],{'as':'ProactiveActions'});db[_0x6b38('0x6a')][_0x6b38('0x116')](db[_0x6b38('0x6e')],{'as':_0x6b38('0x178')});db['ChatWebsite'][_0x6b38('0x116')](db[_0x6b38('0x18b')],{'as':'Applications'});db[_0x6b38('0x6a')][_0x6b38('0x116')](db[_0x6b38('0x6f')],{'as':_0x6b38('0x158')});db[_0x6b38('0x6a')][_0x6b38('0x11f')](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0x6a')]['belongsTo'](db['Interval'],{'as':'Interval','foreignKey':_0x6b38('0x154')});db[_0x6b38('0x6a')][_0x6b38('0x11f')](db['MailAccount'],{'as':_0x6b38('0x42'),'foreignKey':'MailAccountId'});db[_0x6b38('0x6a')][_0x6b38('0x11f')](db['Pause'],{'as':_0x6b38('0x167'),'foreignKey':_0x6b38('0x181')});db[_0x6b38('0x6a')]['belongsToMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':_0x6b38('0x13a')});db[_0x6b38('0x18c')][_0x6b38('0x11f')](db[_0x6b38('0x61')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db['OpenchannelQueueReport']['belongsTo'](db[_0x6b38('0x79')],{'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db['OpenchannelQueueReport'][_0x6b38('0x11f')](db[_0x6b38('0x64')],{});db[_0x6b38('0x18c')][_0x6b38('0x11f')](db[_0x6b38('0x66')],{});db[_0x6b38('0x18c')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{});db[_0x6b38('0x18c')][_0x6b38('0x11f')](db[_0x6b38('0x68')],{});db['ChatApplication'][_0x6b38('0x11f')](db['User'],{'as':_0x6b38('0x18d'),'foreignKey':'UserId','onDelete':_0x6b38('0x15f')});db['ChatApplication'][_0x6b38('0x11f')](db[_0x6b38('0x18e')],{'as':_0x6b38('0x18f'),'foreignKey':_0x6b38('0x190'),'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x18b')]['belongsTo'](db[_0x6b38('0x6a')],{'as':'Website','foreignKey':_0x6b38('0x172'),'onDelete':'restrict'});db[_0x6b38('0x18b')]['belongsTo'](db[_0x6b38('0x94')],{'onDelete':_0x6b38('0x15f'),'foreignKey':'TagId'});db[_0x6b38('0x6e')][_0x6b38('0x116')](db[_0x6b38('0x6f')],{'as':_0x6b38('0x158'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x191')});db[_0x6b38('0x6e')][_0x6b38('0x11f')](db[_0x6b38('0x6a')],{'as':_0x6b38('0x16a'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db['ChatInteraction'][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':_0x6b38('0x183'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x6e')][_0x6b38('0x124')](db[_0x6b38('0x94')],{'through':_0x6b38('0x192'),'as':_0x6b38('0x16b')});db[_0x6b38('0x6e')]['belongsToMany'](db[_0x6b38('0x94')],{'through':_0x6b38('0x192'),'as':_0x6b38('0x16d')});db[_0x6b38('0x6e')][_0x6b38('0x124')](db['User'],{'as':'Users','through':_0x6b38('0x129'),'foreignKey':_0x6b38('0x191')});db[_0x6b38('0x6f')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'onDelete':_0x6b38('0x113'),'as':'User'});db[_0x6b38('0x6f')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x6f')][_0x6b38('0x11f')](db[_0x6b38('0x6e')],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x17b'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x6b38('0x11f')](db[_0x6b38('0xed')],{'as':'Attachment','foreignKey':_0x6b38('0x17c')});db[_0x6b38('0x6f')][_0x6b38('0x11f')](db[_0x6b38('0x6a')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0x6b38('0x71')]['hasMany'](db[_0x6b38('0xed')],{'as':_0x6b38('0x16f'),'foreignKey':_0x6b38('0x173'),'onDelete':'cascade','hooks':!![]});db[_0x6b38('0x71')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db['ChatOfflineMessage']['belongsTo'](db[_0x6b38('0x6a')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x172')});db[_0x6b38('0x18e')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':'UserChatQueue','hooks':!![]});db[_0x6b38('0x18e')][_0x6b38('0x124')](db['Team'],{'through':'team_has_chat_queues','as':_0x6b38('0x155')});db[_0x6b38('0x74')][_0x6b38('0x116')](db[_0x6b38('0x193')],{'as':_0x6b38('0x158'),'foreignKey':_0x6b38('0x194'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x74')]['belongsToMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x14c'),'through':_0x6b38('0x122')});db[_0x6b38('0x75')]['belongsTo'](db[_0x6b38('0x6a')],{'as':'Website','foreignKey':_0x6b38('0x172')});db[_0x6b38('0x77')][_0x6b38('0x116')](db[_0x6b38('0x79')],{'as':_0x6b38('0x123'),'foreignKey':_0x6b38('0x195')});db['CmContact']['hasMany'](db[_0x6b38('0x7b')],{'as':'Hoppers','foreignKey':'ContactId'});db[_0x6b38('0x79')][_0x6b38('0x116')](db[_0x6b38('0x7d')],{'as':_0x6b38('0x196'),'foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x79')][_0x6b38('0x116')](db[_0x6b38('0x7e')],{'as':_0x6b38('0x197'),'foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x79')][_0x6b38('0x116')](db['ReportAgentPreview'],{'as':_0x6b38('0x7f'),'foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x79')]['hasMany'](db[_0x6b38('0x150')],{'as':'JscriptySessions','foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x79')][_0x6b38('0x116')](db[_0x6b38('0x64')],{'as':_0x6b38('0x12e'),'foreignKey':_0x6b38('0x15d'),'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x79')][_0x6b38('0x116')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x6b38('0x15f')});db[_0x6b38('0x79')][_0x6b38('0x116')](db[_0x6b38('0x5d')],{'as':_0x6b38('0x12c'),'foreignKey':_0x6b38('0x15d'),'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x79')][_0x6b38('0x116')](db[_0x6b38('0x11a')],{'as':_0x6b38('0x12a'),'foreignKey':_0x6b38('0x15d'),'onDelete':_0x6b38('0x15f')});db['CmContact']['hasMany'](db[_0x6b38('0x46')],{'as':_0x6b38('0x11b'),'foreignKey':_0x6b38('0x15d'),'onDelete':_0x6b38('0x15f')});db['CmContact']['belongsTo'](db[_0x6b38('0x77')],{'as':_0x6b38('0x198'),'foreignKey':_0x6b38('0x195')});db[_0x6b38('0x79')]['belongsTo'](db[_0x6b38('0xf6')],{'as':'List','foreignKey':_0x6b38('0x166'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x79')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x16e'),'through':_0x6b38('0x199')});db[_0x6b38('0x79')][_0x6b38('0x124')](db['Tag'],{'as':_0x6b38('0x16b'),'through':_0x6b38('0x19a')});db[_0x6b38('0x79')][_0x6b38('0x124')](db['Tag'],{'through':_0x6b38('0x19a'),'as':_0x6b38('0x16d')});db[_0x6b38('0x7b')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':'Contact','foreignKey':_0x6b38('0x15d'),'onDelete':_0x6b38('0x113')});db['CmHopper'][_0x6b38('0x11f')](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166'),'onDelete':'cascade'});db['CmHopper'][_0x6b38('0x11f')](db['User'],{'as':_0x6b38('0x18d'),'foreignKey':_0x6b38('0x114')});db[_0x6b38('0x7b')][_0x6b38('0x11f')](db[_0x6b38('0x131')],{'as':_0x6b38('0x18f'),'foreignKey':_0x6b38('0x14d'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x7b')]['belongsTo'](db[_0x6b38('0xea')],{'as':_0x6b38('0xea'),'foreignKey':_0x6b38('0x19b'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x7b')]['belongsTo'](db[_0x6b38('0x12')],{'as':_0x6b38('0x183'),'foreignKey':_0x6b38('0x19c')});db[_0x6b38('0x14f')]['belongsTo'](db[_0x6b38('0x79')],{'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d'),'onDelete':_0x6b38('0x113')});db['CmHopperBlack'][_0x6b38('0x11f')](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':'ListId','onDelete':'cascade'});db['CmHopperBlack'][_0x6b38('0x11f')](db[_0x6b38('0x131')],{'as':'Queue','foreignKey':_0x6b38('0x14d'),'onDelete':_0x6b38('0x113')});db['CmHopperBlack'][_0x6b38('0x11f')](db[_0x6b38('0xea')],{'as':_0x6b38('0xea'),'foreignKey':'CampaignId','onDelete':_0x6b38('0x113')});db[_0x6b38('0x83')]['hasMany'](db[_0x6b38('0x88')],{'as':{'plural':_0x6b38('0x19d'),'singular':_0x6b38('0x19e')},'foreignKey':'AutomationAllId','onDelete':_0x6b38('0x113'),'hooks':!![]});db[_0x6b38('0x83')]['hasMany'](db[_0x6b38('0x88')],{'as':{'plural':_0x6b38('0x19f'),'singular':_0x6b38('0x1a0')},'foreignKey':_0x6b38('0x1a1'),'onDelete':_0x6b38('0x113'),'hooks':!![]});db[_0x6b38('0x83')]['hasMany'](db['Action'],{'as':_0x6b38('0x1a2'),'foreignKey':_0x6b38('0x1a3'),'onDelete':_0x6b38('0x113'),'hooks':!![]});db[_0x6b38('0x86')][_0x6b38('0x116')](db[_0x6b38('0x86')],{'as':'Dispositions','foreignKey':'ParentId','onDelete':'cascade'});db[_0x6b38('0x8a')][_0x6b38('0x116')](db[_0x6b38('0x8a')],{'as':_0x6b38('0x1a4'),'foreignKey':_0x6b38('0x154'),'onDelete':_0x6b38('0x113'),'hooks':!![],'required':![]});db[_0x6b38('0x8a')]['hasMany'](db[_0x6b38('0x18')],{'as':'Extensions','foreignKey':_0x6b38('0x154'),'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x8a')][_0x6b38('0x116')](db[_0x6b38('0x4a')],{'as':_0x6b38('0x1a5'),'foreignKey':'IntervalId'});db[_0x6b38('0x8a')][_0x6b38('0x116')](db[_0x6b38('0x18b')],{'as':'ChatApplications','foreignKey':_0x6b38('0x154')});db[_0x6b38('0x8a')]['hasMany'](db[_0x6b38('0x52')],{'as':_0x6b38('0x1a6'),'foreignKey':'IntervalId'});db['Interval'][_0x6b38('0x116')](db[_0x6b38('0x180')],{'as':_0x6b38('0x1a7'),'foreignKey':'IntervalId'});db[_0x6b38('0x91')][_0x6b38('0x11f')](db['MailAccount'],{});db[_0x6b38('0x91')][_0x6b38('0x11f')](db[_0x6b38('0x9d')],{'foreignKey':_0x6b38('0x1a8')});db[_0x6b38('0x91')][_0x6b38('0x11f')](db[_0x6b38('0x9c')],{'foreignKey':_0x6b38('0x1a9')});db[_0x6b38('0x92')][_0x6b38('0x124')](db['VoiceMusicOnHold'],{'as':_0x6b38('0x1aa'),'through':_0x6b38('0x14b'),'onDelete':'restrict'});db[_0x6b38('0x94')]['belongsToMany'](db[_0x6b38('0x79')],{'through':_0x6b38('0x19a')});db[_0x6b38('0x94')][_0x6b38('0x124')](db[_0x6b38('0x6e')],{'through':_0x6b38('0x192')});db['Tag'][_0x6b38('0x124')](db[_0x6b38('0x46')],{'through':_0x6b38('0x16c')});db[_0x6b38('0x94')][_0x6b38('0x124')](db[_0x6b38('0x5d')],{'through':_0x6b38('0x184')});db['Tag']['belongsToMany'](db[_0x6b38('0x11a')],{'through':_0x6b38('0x17a')});db[_0x6b38('0x94')][_0x6b38('0x124')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x6b38('0x94')][_0x6b38('0x124')](db[_0x6b38('0x101')],{'through':_0x6b38('0x1ab')});db[_0x6b38('0x97')][_0x6b38('0x116')](db[_0x6b38('0x88')],{'as':{'plural':_0x6b38('0x1ac'),'singular':_0x6b38('0x1ad')},'foreignKey':'TriggerAllId','onDelete':_0x6b38('0x113'),'hooks':!![]});db['Trigger'][_0x6b38('0x116')](db[_0x6b38('0x88')],{'as':{'plural':_0x6b38('0x1ae'),'singular':'AnyCondition'},'foreignKey':_0x6b38('0x1af'),'onDelete':_0x6b38('0x113'),'hooks':!![]});db[_0x6b38('0x97')][_0x6b38('0x116')](db[_0x6b38('0x1b0')],{'as':_0x6b38('0x1a2'),'foreignKey':_0x6b38('0x1b1'),'onDelete':'cascade','hooks':!![]});db[_0x6b38('0x9c')][_0x6b38('0x116')](db[_0x6b38('0xa2')],{'as':_0x6b38('0x1b2'),'onDelete':'cascade','foreignKey':_0x6b38('0x1a9'),'hooks':!![]});db['AnalyticDefaultReport'][_0x6b38('0x116')](db[_0x6b38('0xa2')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x6b38('0x1a8')});db[_0x6b38('0xa0')][_0x6b38('0x116')](db[_0x6b38('0xa2')],{'as':_0x6b38('0x1b2'),'onDelete':'cascade','foreignKey':_0x6b38('0x1b3')});db[_0x6b38('0xa2')]['belongsTo'](db[_0x6b38('0xa0')],{'foreignKey':_0x6b38('0x1b3')});db[_0x6b38('0xa6')]['hasMany'](db['SalesforceConfiguration'],{'as':_0x6b38('0x1b4'),'onDelete':'cascade','foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0xa8')]['hasMany'](db[_0x6b38('0x1b6')],{'as':_0x6b38('0x1b7'),'onDelete':_0x6b38('0x113'),'foreignKey':'SubjectId'});db[_0x6b38('0xa8')]['hasMany'](db['SalesforceField'],{'as':_0x6b38('0x1b8'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b9')});db['SalesforceConfiguration']['hasMany'](db[_0x6b38('0x1b6')],{'as':_0x6b38('0x1b2'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x6b38('0xa8')][_0x6b38('0x11f')](db['SalesforceAccount'],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0x1b6')][_0x6b38('0x116')](db[_0x6b38('0x1b6')],{'as':_0x6b38('0x1ba'),'foreignKey':_0x6b38('0x1bb')});db['SalesforceField'][_0x6b38('0x116')](db[_0x6b38('0x1b6')],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0x1b6')][_0x6b38('0x116')](db[_0x6b38('0x1b6')],{'as':_0x6b38('0x1bd'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0x1b6')][_0x6b38('0x11f')](db[_0x6b38('0x1bf')],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db[_0x6b38('0xaa')]['hasMany'](db[_0x6b38('0xab')],{'as':'Configurations','onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0xab')]['hasMany'](db[_0x6b38('0xad')],{'as':_0x6b38('0x1b7'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0xab')][_0x6b38('0x116')](db['SugarcrmField'],{'as':_0x6b38('0x1b8'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xab')][_0x6b38('0x116')](db[_0x6b38('0xad')],{'as':_0x6b38('0x1b2'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xab')]['belongsTo'](db[_0x6b38('0xaa')],{'as':_0x6b38('0x16a'),'foreignKey':'AccountId'});db[_0x6b38('0xad')][_0x6b38('0x116')](db[_0x6b38('0xad')],{'as':_0x6b38('0x1ba'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0xad')][_0x6b38('0x116')](db[_0x6b38('0xad')],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xad')][_0x6b38('0x116')](db['SugarcrmField'],{'as':_0x6b38('0x1bd'),'foreignKey':_0x6b38('0x1be')});db['SugarcrmField'][_0x6b38('0x11f')](db[_0x6b38('0x1bf')],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db[_0x6b38('0x1c1')][_0x6b38('0x116')](db[_0x6b38('0xb0')],{'as':_0x6b38('0x1b4'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0xb0')][_0x6b38('0x116')](db[_0x6b38('0xb2')],{'as':_0x6b38('0x1b7'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1bb')});db['DeskConfiguration'][_0x6b38('0x116')](db[_0x6b38('0xb2')],{'as':'Descriptions','onDelete':_0x6b38('0x113'),'foreignKey':'DescriptionId'});db[_0x6b38('0xb0')][_0x6b38('0x116')](db[_0x6b38('0xb2')],{'as':_0x6b38('0x1b2'),'onDelete':_0x6b38('0x113'),'foreignKey':'FieldId'});db['DeskConfiguration'][_0x6b38('0x11f')](db[_0x6b38('0x1c1')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0xb0')][_0x6b38('0x124')](db[_0x6b38('0x94')],{'through':_0x6b38('0x1c2')});db[_0x6b38('0xb2')][_0x6b38('0x116')](db[_0x6b38('0xb2')],{'as':_0x6b38('0x1ba'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0xb2')][_0x6b38('0x116')](db[_0x6b38('0xb2')],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xb2')][_0x6b38('0x116')](db[_0x6b38('0xb2')],{'as':_0x6b38('0x1bd'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xb2')][_0x6b38('0x11f')](db[_0x6b38('0x1bf')],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db['ZohoAccount'][_0x6b38('0x116')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b5')});db['ZohoConfiguration'][_0x6b38('0x116')](db[_0x6b38('0xb7')],{'as':_0x6b38('0x1b7'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1bb')});db['ZohoConfiguration'][_0x6b38('0x116')](db[_0x6b38('0xb7')],{'as':_0x6b38('0x1b8'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xb5')][_0x6b38('0x116')](db[_0x6b38('0xb7')],{'as':_0x6b38('0x1b2'),'onDelete':'cascade','foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xb5')][_0x6b38('0x11f')](db[_0x6b38('0xb4')],{'as':'Account','foreignKey':_0x6b38('0x1b5')});db['ZohoField'][_0x6b38('0x116')](db[_0x6b38('0xb7')],{'as':_0x6b38('0x1ba'),'foreignKey':'SubjectId'});db[_0x6b38('0xb7')][_0x6b38('0x116')](db['ZohoField'],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db['ZohoField'][_0x6b38('0x116')](db[_0x6b38('0xb7')],{'as':_0x6b38('0x1bd'),'foreignKey':_0x6b38('0x1be')});db['ZohoField'][_0x6b38('0x11f')](db[_0x6b38('0x1bf')],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db['ZendeskAccount']['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0xba')][_0x6b38('0x116')](db[_0x6b38('0xbc')],{'as':_0x6b38('0x1b7'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0xba')]['hasMany'](db[_0x6b38('0xbc')],{'as':'Descriptions','foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xba')][_0x6b38('0x116')](db[_0x6b38('0xbc')],{'as':_0x6b38('0x1b2'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xba')][_0x6b38('0x11f')](db[_0x6b38('0xb9')],{'as':_0x6b38('0x16a'),'foreignKey':'AccountId'});db[_0x6b38('0xba')][_0x6b38('0x124')](db['Tag'],{'through':_0x6b38('0x1c3')});db[_0x6b38('0xbc')][_0x6b38('0x116')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0xbc')][_0x6b38('0x116')](db[_0x6b38('0xbc')],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db['ZendeskField'][_0x6b38('0x116')](db[_0x6b38('0xbc')],{'as':_0x6b38('0x1bd'),'foreignKey':'FieldId'});db[_0x6b38('0xbc')][_0x6b38('0x11f')](db['Variable'],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db[_0x6b38('0xbe')]['hasMany'](db[_0x6b38('0xbf')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x6b38('0x1b5')});db['FreshdeskConfiguration']['hasMany'](db[_0x6b38('0x1c4')],{'as':'Subjects','onDelete':_0x6b38('0x113'),'foreignKey':'SubjectId'});db[_0x6b38('0xbf')][_0x6b38('0x116')](db['FreshdeskField'],{'as':_0x6b38('0x1b8'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xbf')][_0x6b38('0x116')](db[_0x6b38('0x1c4')],{'as':_0x6b38('0x1b2'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xbf')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0xbf')][_0x6b38('0x124')](db[_0x6b38('0x94')],{'through':_0x6b38('0x1c5')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x6b38('0x1ba'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0x1c4')][_0x6b38('0x116')](db[_0x6b38('0x1c4')],{'as':'Description','foreignKey':_0x6b38('0x1b9')});db['FreshdeskField'][_0x6b38('0x116')](db[_0x6b38('0x1c4')],{'as':_0x6b38('0x1bd'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0x1c4')][_0x6b38('0x11f')](db[_0x6b38('0x1bf')],{'as':'Variable','foreignKey':_0x6b38('0x1c0')});db['VtigerAccount'][_0x6b38('0x116')](db[_0x6b38('0xc3')],{'as':_0x6b38('0x1b4'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0xc3')][_0x6b38('0x116')](db[_0x6b38('0xc5')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x6b38('0xc3')][_0x6b38('0x116')](db[_0x6b38('0xc5')],{'as':_0x6b38('0x1b8'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xc3')][_0x6b38('0x116')](db['VtigerField'],{'as':'Fields','foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xc3')][_0x6b38('0x11f')](db[_0x6b38('0xc1')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x1b5')});db['VtigerField'][_0x6b38('0x116')](db[_0x6b38('0xc5')],{'as':'Subject','foreignKey':_0x6b38('0x1bb')});db['VtigerField'][_0x6b38('0x116')](db[_0x6b38('0xc5')],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xc5')]['hasMany'](db['VtigerField'],{'as':_0x6b38('0x1bd'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xc5')][_0x6b38('0x11f')](db[_0x6b38('0x1bf')],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db[_0x6b38('0x1c6')]['hasMany'](db[_0x6b38('0x1c7')],{'as':_0x6b38('0x1b4'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0x1c7')][_0x6b38('0x116')](db['ServicenowField'],{'as':_0x6b38('0x1b7'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0x1c7')]['hasMany'](db[_0x6b38('0x1c8')],{'as':_0x6b38('0x1b8'),'foreignKey':_0x6b38('0x1b9')});db['ServicenowConfiguration'][_0x6b38('0x116')](db[_0x6b38('0x1c8')],{'as':_0x6b38('0x1b2'),'foreignKey':_0x6b38('0x1be')});db[_0x6b38('0x1c7')][_0x6b38('0x11f')](db[_0x6b38('0x1c6')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x1b5')});db['ServicenowField'][_0x6b38('0x116')](db['ServicenowField'],{'as':_0x6b38('0x1ba'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0x1c8')][_0x6b38('0x116')](db[_0x6b38('0x1c8')],{'as':_0x6b38('0x1bc'),'foreignKey':'DescriptionId'});db[_0x6b38('0x1c8')]['hasMany'](db['ServicenowField'],{'as':'Field','foreignKey':'FieldId'});db[_0x6b38('0x1c8')][_0x6b38('0x11f')](db[_0x6b38('0x1bf')],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db[_0x6b38('0x1c9')][_0x6b38('0x116')](db['Dynamics365Configuration'],{'as':_0x6b38('0x1b4'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0x1c9')][_0x6b38('0x11f')](db[_0x6b38('0x109')],{'as':'CloudProvider','foreignKey':'CloudProviderId'});db[_0x6b38('0xca')]['hasMany'](db[_0x6b38('0x1ca')],{'as':'Subjects','onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1bb')});db['Dynamics365Configuration'][_0x6b38('0x116')](db[_0x6b38('0x1ca')],{'as':'Descriptions','onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0xca')]['hasMany'](db[_0x6b38('0x1ca')],{'as':_0x6b38('0x1b2'),'onDelete':_0x6b38('0x113'),'foreignKey':'FieldId'});db[_0x6b38('0xca')][_0x6b38('0x11f')](db[_0x6b38('0x1c9')],{'as':_0x6b38('0x16a'),'foreignKey':'AccountId'});db[_0x6b38('0x1ca')]['hasMany'](db['Dynamics365Field'],{'as':_0x6b38('0x1ba'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0x1ca')][_0x6b38('0x116')](db[_0x6b38('0x1ca')],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0x1ca')][_0x6b38('0x116')](db[_0x6b38('0x1ca')],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field'][_0x6b38('0x11f')](db['Variable'],{'as':_0x6b38('0x1bf'),'foreignKey':_0x6b38('0x1c0')});db['FreshsalesAccount'][_0x6b38('0x116')](db[_0x6b38('0xcd')],{'as':_0x6b38('0x1b4'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x6b38('0xcd')][_0x6b38('0x116')](db[_0x6b38('0x1cb')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x6b38('0xcd')][_0x6b38('0x116')](db[_0x6b38('0x1cb')],{'as':_0x6b38('0x1b8'),'foreignKey':_0x6b38('0x1b9')});db['FreshsalesConfiguration'][_0x6b38('0x116')](db[_0x6b38('0x1cb')],{'as':'Fields','foreignKey':_0x6b38('0x1be')});db[_0x6b38('0xcd')]['belongsTo'](db[_0x6b38('0xcc')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x1b5')});db[_0x6b38('0x1cb')][_0x6b38('0x116')](db[_0x6b38('0x1cb')],{'as':_0x6b38('0x1ba'),'foreignKey':_0x6b38('0x1bb')});db[_0x6b38('0x1cb')][_0x6b38('0x116')](db[_0x6b38('0x1cb')],{'as':_0x6b38('0x1bc'),'foreignKey':_0x6b38('0x1b9')});db[_0x6b38('0x1cb')][_0x6b38('0x116')](db['FreshsalesField'],{'as':'Field','foreignKey':_0x6b38('0x1be')});db[_0x6b38('0x1cb')][_0x6b38('0x11f')](db['Variable'],{'as':_0x6b38('0x1bf'),'foreignKey':'VariableId'});db[_0x6b38('0xd1')][_0x6b38('0x11f')](db['ChatWebsite'],{});db[_0x6b38('0xd1')][_0x6b38('0x11f')](db['CmList'],{'as':'List','foreignKey':_0x6b38('0x166')});db[_0x6b38('0xd1')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':_0x6b38('0x170'),'foreignKey':'ContactId'});db[_0x6b38('0xd1')][_0x6b38('0x11f')](db[_0x6b38('0x6e')],{});db[_0x6b38('0xd1')]['belongsTo'](db[_0x6b38('0x6f')],{});db[_0x6b38('0xd1')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{});db['ChatQueueReport'][_0x6b38('0x11f')](db[_0x6b38('0x18e')],{});db['ChatInternalMessage']['belongsTo'](db[_0x6b38('0x12')],{'onDelete':_0x6b38('0x113'),'foreignKey':'FromId'});db[_0x6b38('0x193')][_0x6b38('0x11f')](db['User'],{'onDelete':'cascade','foreignKey':_0x6b38('0x1cc')});db[_0x6b38('0x150')][_0x6b38('0x116')](db[_0x6b38('0xd6')],{'foreignKey':_0x6b38('0x1cd'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0x150')]['hasMany'](db[_0x6b38('0xd4')],{'foreignKey':_0x6b38('0x1cd'),'onDelete':'cascade'});db[_0x6b38('0x1ce')]['belongsTo'](db[_0x6b38('0x5b')],{});db[_0x6b38('0x1ce')][_0x6b38('0x11f')](db[_0x6b38('0xf6')],{'as':'List','foreignKey':_0x6b38('0x166')});db[_0x6b38('0x1ce')]['belongsTo'](db['CmContact'],{'as':_0x6b38('0x170'),'foreignKey':'ContactId'});db[_0x6b38('0x1ce')]['belongsTo'](db['SmsInteraction'],{});db[_0x6b38('0x1ce')][_0x6b38('0x11f')](db[_0x6b38('0x17f')],{});db[_0x6b38('0x1ce')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{});db[_0x6b38('0x1ce')][_0x6b38('0x11f')](db[_0x6b38('0x5f')],{});db[_0x6b38('0xdc')][_0x6b38('0x116')](db[_0x6b38('0x150')],{'foreignKey':_0x6b38('0x1cf')});db[_0x6b38('0xdc')][_0x6b38('0x116')](db[_0x6b38('0xd6')],{'foreignKey':_0x6b38('0x1cf')});db[_0x6b38('0xdc')][_0x6b38('0x116')](db[_0x6b38('0xd4')],{'foreignKey':_0x6b38('0x1cf')});db[_0x6b38('0x144')][_0x6b38('0x124')](db['User'],{'as':'Users','through':_0x6b38('0x146')});db[_0x6b38('0xe7')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':'user_has_teams'});db[_0x6b38('0xe7')][_0x6b38('0x124')](db[_0x6b38('0x131')],{'through':_0x6b38('0x10b'),'as':_0x6b38('0x132')});db['Team'][_0x6b38('0x124')](db[_0x6b38('0x43')],{'through':_0x6b38('0x169'),'as':_0x6b38('0x134')});db[_0x6b38('0xe7')][_0x6b38('0x124')](db[_0x6b38('0x18e')],{'through':'team_has_chat_queues','as':_0x6b38('0x1d0')});db[_0x6b38('0xe7')][_0x6b38('0x124')](db[_0x6b38('0x57')],{'through':_0x6b38('0x17d'),'as':_0x6b38('0x135')});db[_0x6b38('0xe7')]['belongsToMany'](db[_0x6b38('0x5f')],{'through':_0x6b38('0x186'),'as':_0x6b38('0x136')});db[_0x6b38('0xe7')]['belongsToMany'](db[_0x6b38('0x68')],{'through':_0x6b38('0x18a'),'as':_0x6b38('0x137')});db[_0x6b38('0xe7')][_0x6b38('0x124')](db[_0x6b38('0x107')],{'through':_0x6b38('0x1d1'),'as':_0x6b38('0x138')});db[_0x6b38('0xe7')][_0x6b38('0x124')](db[_0x6b38('0xf8')],{'through':'TeamVoicePrefix','as':_0x6b38('0x133')});db[_0x6b38('0xea')][_0x6b38('0x116')](db[_0x6b38('0x7b')],{'as':'Hoppers','foreignKey':_0x6b38('0x19b')});db[_0x6b38('0xea')]['hasMany'](db['CmHopperFinal'],{'as':_0x6b38('0x196'),'foreignKey':_0x6b38('0x19b')});db['Campaign'][_0x6b38('0x116')](db[_0x6b38('0x7e')],{'as':_0x6b38('0x197'),'foreignKey':_0x6b38('0x19b')});db[_0x6b38('0xea')][_0x6b38('0x116')](db['CmHopperBlack'],{'as':_0x6b38('0x1d2'),'foreignKey':'CampaignId'});db[_0x6b38('0xea')]['belongsTo'](db[_0x6b38('0x2c')],{'as':_0x6b38('0x2c'),'foreignKey':_0x6b38('0x151')});db[_0x6b38('0xea')]['belongsTo'](db[_0x6b38('0x2c')],{'as':_0x6b38('0x152'),'foreignKey':'TrunkBackupId'});db[_0x6b38('0xea')][_0x6b38('0x11f')](db['Interval'],{'as':'Interval','foreignKey':_0x6b38('0x154')});db[_0x6b38('0xea')]['belongsTo'](db[_0x6b38('0x144')],{'as':'SquareProject','foreignKey':_0x6b38('0x1d3')});db[_0x6b38('0xea')]['belongsToMany'](db[_0x6b38('0xf6')],{'as':_0x6b38('0x125'),'through':_0x6b38('0x1d4')});db[_0x6b38('0xea')][_0x6b38('0x124')](db[_0x6b38('0xf6')],{'as':_0x6b38('0x156'),'through':_0x6b38('0x1d5')});db[_0x6b38('0xed')][_0x6b38('0x11f')](db[_0x6b38('0x71')],{'as':'ChatOfflineMessage','foreignKey':_0x6b38('0x173')});db[_0x6b38('0x1d6')][_0x6b38('0x11f')](db['MailMessage'],{});db[_0x6b38('0x1d6')][_0x6b38('0x11f')](db[_0x6b38('0x46')],{});db[_0x6b38('0x1d6')][_0x6b38('0x11f')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x6b38('0x1d7')});db[_0x6b38('0x1d6')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1d8'),'as':_0x6b38('0x1d9')});db[_0x6b38('0x1d6')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'foreignKey':'ToUserId','as':_0x6b38('0x1da')});db['MailTransferReport'][_0x6b38('0x11f')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x6b38('0x1db')});db[_0x6b38('0x1d6')]['belongsTo'](db['MailAccount'],{'foreignKey':_0x6b38('0x1dc'),'as':_0x6b38('0x1dd')});db['ChatTransferReport'][_0x6b38('0x11f')](db['ChatMessage'],{});db[_0x6b38('0x1de')]['belongsTo'](db['ChatInteraction'],{});db['ChatTransferReport'][_0x6b38('0x11f')](db[_0x6b38('0x6a')],{'foreignKey':_0x6b38('0x1df'),'as':_0x6b38('0x1d7')});db[_0x6b38('0x1de')]['belongsTo'](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1d8'),'as':_0x6b38('0x1d9')});db[_0x6b38('0x1de')]['belongsTo'](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1e0'),'as':'ToAgent'});db['ChatTransferReport'][_0x6b38('0x11f')](db[_0x6b38('0x18e')],{'foreignKey':'ToChatQueueId','as':_0x6b38('0x1db')});db[_0x6b38('0x1de')]['belongsTo'](db[_0x6b38('0x6a')],{'foreignKey':_0x6b38('0x1e1'),'as':'ToAccount'});db['FaxTransferReport'][_0x6b38('0x11f')](db['FaxMessage'],{});db[_0x6b38('0xf1')][_0x6b38('0x11f')](db[_0x6b38('0x11a')],{});db[_0x6b38('0xf1')]['belongsTo'](db[_0x6b38('0x51')],{'foreignKey':_0x6b38('0x1e2'),'as':_0x6b38('0x1d7')});db[_0x6b38('0xf1')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1d8'),'as':'FromAgent'});db[_0x6b38('0xf1')]['belongsTo'](db['User'],{'foreignKey':_0x6b38('0x1e0'),'as':_0x6b38('0x1da')});db[_0x6b38('0xf1')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0x6b38('0x1e3'),'as':_0x6b38('0x1db')});db['FaxTransferReport']['belongsTo'](db['FaxAccount'],{'foreignKey':_0x6b38('0x1e4'),'as':'ToAccount'});db[_0x6b38('0xf3')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x6b38('0xf3')][_0x6b38('0x11f')](db['OpenchannelInteraction'],{});db[_0x6b38('0xf3')]['belongsTo'](db[_0x6b38('0x61')],{'foreignKey':_0x6b38('0x1e5'),'as':'FromAccount'});db[_0x6b38('0xf3')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1d8'),'as':_0x6b38('0x1d9')});db[_0x6b38('0xf3')]['belongsTo'](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1e0'),'as':'ToAgent'});db[_0x6b38('0xf3')][_0x6b38('0x11f')](db[_0x6b38('0x68')],{'foreignKey':_0x6b38('0x1e6'),'as':_0x6b38('0x1db')});db[_0x6b38('0xf3')][_0x6b38('0x11f')](db['OpenchannelAccount'],{'foreignKey':_0x6b38('0x1e7'),'as':_0x6b38('0x1dd')});db[_0x6b38('0x1e8')]['belongsTo'](db[_0x6b38('0x17f')],{});db[_0x6b38('0x1e8')][_0x6b38('0x11f')](db[_0x6b38('0x5d')],{});db[_0x6b38('0x1e8')][_0x6b38('0x11f')](db[_0x6b38('0x5b')],{'foreignKey':_0x6b38('0x1e9'),'as':'FromAccount'});db[_0x6b38('0x1e8')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'foreignKey':'FromUserId','as':_0x6b38('0x1d9')});db[_0x6b38('0x1e8')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1e0'),'as':_0x6b38('0x1da')});db[_0x6b38('0x1e8')][_0x6b38('0x11f')](db[_0x6b38('0x5f')],{'foreignKey':_0x6b38('0x1ea'),'as':_0x6b38('0x1db')});db[_0x6b38('0x1e8')]['belongsTo'](db[_0x6b38('0x5b')],{'foreignKey':'ToSmsAccountId','as':_0x6b38('0x1dd')});db['CmList'][_0x6b38('0x116')](db[_0x6b38('0x86')],{'as':'Dispositions','foreignKey':_0x6b38('0x166'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0xf6')]['hasMany'](db['CmCustomField'],{'as':_0x6b38('0x1eb'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0xf6')][_0x6b38('0x116')](db[_0x6b38('0x79')],{'as':_0x6b38('0x123'),'onDelete':_0x6b38('0x113'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0xf6')][_0x6b38('0x116')](db[_0x6b38('0x7d')],{'as':_0x6b38('0x196'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0xf6')]['hasMany'](db[_0x6b38('0x7e')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x6b38('0xf6')][_0x6b38('0x116')](db[_0x6b38('0x7f')],{'as':_0x6b38('0x7f'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0xf6')][_0x6b38('0x124')](db[_0x6b38('0x131')],{'as':_0x6b38('0x1ec'),'through':_0x6b38('0x1ed')});db['CmList'][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':_0x6b38('0x126')});db[_0x6b38('0xf8')][_0x6b38('0x116')](db['VoiceExtension'],{'as':_0x6b38('0x1ee'),'onDelete':'cascade'});db['VoicePrefix'][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':_0x6b38('0x10f')});db[_0x6b38('0xf8')][_0x6b38('0x124')](db[_0x6b38('0xe7')],{'through':_0x6b38('0x10d'),'as':_0x6b38('0x155')});db['UserProfile']['hasMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x16e'),'foreignKey':_0x6b38('0x120')});db[_0x6b38('0xf9')][_0x6b38('0x116')](db[_0x6b38('0xfb')],{'as':_0x6b38('0x1ef'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0x6b38('0xfb')][_0x6b38('0x116')](db['UserProfileResource'],{'as':_0x6b38('0x1f0'),'foreignKey':_0x6b38('0x1f1'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0xff')][_0x6b38('0x116')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x6b38('0x1f2'),'onDelete':_0x6b38('0x113')});db[_0x6b38('0xff')][_0x6b38('0x116')](db['CannedAnswer'],{'as':_0x6b38('0x177'),'foreignKey':'WhatsappAccountId'});db[_0x6b38('0xff')][_0x6b38('0x116')](db[_0x6b38('0x103')],{'as':'Messages','foreignKey':_0x6b38('0x1f2')});db[_0x6b38('0xff')][_0x6b38('0x116')](db[_0x6b38('0x101')],{'as':'Interactions'});db[_0x6b38('0xff')]['hasMany'](db[_0x6b38('0x1f3')],{'as':_0x6b38('0x149')});db[_0x6b38('0xff')][_0x6b38('0x11f')](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0xff')]['belongsTo'](db[_0x6b38('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x6b38('0xff')]['belongsToMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':'user_has_whatsapp_accounts'});db[_0x6b38('0x1f3')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x1f3')][_0x6b38('0x11f')](db[_0x6b38('0x107')],{'onDelete':_0x6b38('0x15f')});db['WhatsappApplication'][_0x6b38('0x11f')](db['WhatsappAccount'],{'onDelete':_0x6b38('0x15f')});db['WhatsappApplication'][_0x6b38('0x11f')](db[_0x6b38('0x8a')],{'onDelete':'restrict','foreignKey':_0x6b38('0x154')});db[_0x6b38('0x1f3')][_0x6b38('0x11f')](db[_0x6b38('0x94')],{'onDelete':_0x6b38('0x15f'),'foreignKey':_0x6b38('0x174')});db[_0x6b38('0x101')]['hasMany'](db[_0x6b38('0x103')],{'as':_0x6b38('0x158'),'onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db['WhatsappInteraction'][_0x6b38('0x11f')](db[_0x6b38('0xff')],{'as':_0x6b38('0x16a'),'foreignKey':_0x6b38('0x1f2')});db['WhatsappInteraction']['belongsTo'](db[_0x6b38('0x79')],{'as':_0x6b38('0x170'),'foreignKey':_0x6b38('0x15d')});db['WhatsappInteraction'][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':'Owner','foreignKey':_0x6b38('0x114')});db[_0x6b38('0x101')][_0x6b38('0x124')](db[_0x6b38('0x94')],{'through':_0x6b38('0x1ab'),'as':_0x6b38('0x16b')});db[_0x6b38('0x101')]['belongsToMany'](db[_0x6b38('0x94')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x6b38('0x101')][_0x6b38('0x124')](db[_0x6b38('0x12')],{'as':_0x6b38('0x16e'),'through':_0x6b38('0x130'),'foreignKey':_0x6b38('0x1f4')});db[_0x6b38('0x103')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':_0x6b38('0x12')});db[_0x6b38('0x103')][_0x6b38('0x11f')](db['CmContact'],{'onDelete':'cascade','as':_0x6b38('0x170')});db[_0x6b38('0x103')][_0x6b38('0x11f')](db[_0x6b38('0x101')],{'onDelete':_0x6b38('0x113'),'as':_0x6b38('0x17b'),'foreignKey':_0x6b38('0x1f4')});db[_0x6b38('0x103')]['belongsTo'](db[_0x6b38('0xff')],{'as':'Account','foreignKey':_0x6b38('0x1f2')});db[_0x6b38('0x1f5')][_0x6b38('0x11f')](db['WhatsappAccount'],{});db[_0x6b38('0x1f5')]['belongsTo'](db[_0x6b38('0xf6')],{'as':_0x6b38('0x165'),'foreignKey':_0x6b38('0x166')});db[_0x6b38('0x1f5')][_0x6b38('0x11f')](db[_0x6b38('0x79')],{'as':'Contact','foreignKey':_0x6b38('0x15d')});db[_0x6b38('0x1f5')][_0x6b38('0x11f')](db[_0x6b38('0x101')],{});db[_0x6b38('0x1f5')][_0x6b38('0x11f')](db[_0x6b38('0x107')],{});db[_0x6b38('0x1f5')][_0x6b38('0x11f')](db[_0x6b38('0x103')],{});db[_0x6b38('0x1f5')][_0x6b38('0x11f')](db[_0x6b38('0x12')],{});db[_0x6b38('0x105')][_0x6b38('0x11f')](db[_0x6b38('0x103')],{});db[_0x6b38('0x105')]['belongsTo'](db[_0x6b38('0x101')],{});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x6b38('0x1f6'),'as':'FromAccount'});db[_0x6b38('0x105')][_0x6b38('0x11f')](db[_0x6b38('0xff')],{'foreignKey':_0x6b38('0x1f7'),'as':_0x6b38('0x1dd')});db[_0x6b38('0x105')]['belongsTo'](db['WhatsappQueue'],{'foreignKey':_0x6b38('0x1f8'),'as':_0x6b38('0x1db')});db[_0x6b38('0x105')]['belongsTo'](db['User'],{'foreignKey':_0x6b38('0x1d8'),'as':_0x6b38('0x1d9')});db[_0x6b38('0x105')]['belongsTo'](db[_0x6b38('0x12')],{'foreignKey':_0x6b38('0x1e0'),'as':_0x6b38('0x1da')});db['WhatsappQueue']['belongsToMany'](db[_0x6b38('0x12')],{'as':_0x6b38('0x168'),'through':_0x6b38('0x3e'),'foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0x6b38('0x124')](db['Team'],{'through':_0x6b38('0x1d1'),'as':_0x6b38('0x155')});db['UserSetting'][_0x6b38('0x11f')](db[_0x6b38('0x12')],{'as':_0x6b38('0x1f9'),'foreignKey':_0x6b38('0x114'),'onDelete':_0x6b38('0x113'),'hooks':!![]});db['CloudProvider'][_0x6b38('0x112')](db[_0x6b38('0x1c9')],{'as':'Dynamics365Account','onDelete':_0x6b38('0x15f')});db['CloudProvider']['hasOne'](db[_0x6b38('0x40')],{'as':_0x6b38('0x162'),'onDelete':_0x6b38('0x15f')});db[_0x6b38('0x109')][_0x6b38('0x112')](db[_0x6b38('0x160')],{'as':_0x6b38('0x163'),'onDelete':'restrict'});module[_0x6b38('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a76592a..0500e8b 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d17=['/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/squareOdbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','./api/version','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/demo','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','/index.html','path','express','./config/environment','./utils/client-side-logger','./api/client-side-logs','default','then','/api/users','use','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/faxAccount','/api/fax/applications','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/condition','/api/intervals','./api/interval','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField'];(function(_0x2f4112,_0x2373b3){var _0x27c326=function(_0x51885c){while(--_0x51885c){_0x2f4112['push'](_0x2f4112['shift']());}};_0x27c326(++_0x2373b3);}(_0x2d17,0x17e));var _0x72d1=function(_0x4d0257,_0x187b17){_0x4d0257=_0x4d0257-0x0;var _0x5604d5=_0x2d17[_0x4d0257];return _0x5604d5;};'use strict';var path=require(_0x72d1('0x0'));var express=require(_0x72d1('0x1'));var errors=require('./errors');var config=require(_0x72d1('0x2'));var setupLoggers=require(_0x72d1('0x3'))['setupLoggers'];var clientSideLogs=require(_0x72d1('0x4'));exports[_0x72d1('0x5')]=function(_0x55b722){return setupLoggers(_0x55b722)[_0x72d1('0x6')](function(){_0x55b722['use'](_0x72d1('0x7'),require('./api/user'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x9'),require('./api/voiceChanSpy'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xa'),require(_0x72d1('0xb')));_0x55b722['use'](_0x72d1('0xc'),require(_0x72d1('0xd')));_0x55b722[_0x72d1('0x8')]('/api/voice/mohs',require(_0x72d1('0xe')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xf'),require(_0x72d1('0x10')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x11'),require(_0x72d1('0x12')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x13'),require(_0x72d1('0x14')));_0x55b722['use'](_0x72d1('0x15'),require(_0x72d1('0x16')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x17'),require(_0x72d1('0x18')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x19'),require(_0x72d1('0x1a')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x1b'),require(_0x72d1('0x1c')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x1d'),require('./api/voiceAgentReport'));_0x55b722[_0x72d1('0x8')]('/api/voice/queues/reports',require(_0x72d1('0x1e')));_0x55b722[_0x72d1('0x8')]('/api/members/reports',require(_0x72d1('0x1f')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x20'),require('./api/trunk'));_0x55b722['use'](_0x72d1('0x21'),require(_0x72d1('0x22')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x23'),require(_0x72d1('0x24')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x25'),require('./api/mailAccount'));_0x55b722[_0x72d1('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x55b722['use']('/api/mail/substatuses',require(_0x72d1('0x26')));_0x55b722[_0x72d1('0x8')]('/api/mail/interactions',require(_0x72d1('0x27')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x28'),require(_0x72d1('0x29')));_0x55b722[_0x72d1('0x8')]('/api/mail/applications',require('./api/mailApplication'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x2a'),require(_0x72d1('0x2b')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x2c'),require(_0x72d1('0x2d')));_0x55b722[_0x72d1('0x8')]('/api/dashboards/items',require('./api/dashboardItem'));_0x55b722[_0x72d1('0x8')]('/api/fax/accounts',require(_0x72d1('0x2e')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x2f'),require('./api/faxApplication'));_0x55b722[_0x72d1('0x8')]('/api/fax/interactions',require(_0x72d1('0x30')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x31'),require(_0x72d1('0x32')));_0x55b722['use'](_0x72d1('0x33'),require('./api/faxQueue'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x34'),require('./api/faxQueueReport'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x35'),require(_0x72d1('0x36')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x37'),require('./api/smsApplication'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x38'),require(_0x72d1('0x39')));_0x55b722['use'](_0x72d1('0x3a'),require(_0x72d1('0x3b')));_0x55b722['use'](_0x72d1('0x3c'),require(_0x72d1('0x3d')));_0x55b722[_0x72d1('0x8')]('/api/openchannel/accounts',require(_0x72d1('0x3e')));_0x55b722['use'](_0x72d1('0x3f'),require(_0x72d1('0x40')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x41'),require(_0x72d1('0x42')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x43'),require(_0x72d1('0x44')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x45'),require(_0x72d1('0x46')));_0x55b722['use'](_0x72d1('0x47'),require(_0x72d1('0x48')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x49'),require('./api/openchannelQueueReport'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x4a'),require(_0x72d1('0x4b')));_0x55b722['use'](_0x72d1('0x4c'),require(_0x72d1('0x4d')));_0x55b722[_0x72d1('0x8')]('/api/chat/messages',require(_0x72d1('0x4e')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x4f'),require('./api/chatOfflineMessage'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x50'),require(_0x72d1('0x51')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x52'),require(_0x72d1('0x53')));_0x55b722[_0x72d1('0x8')]('/api/chat/proactive_actions',require(_0x72d1('0x54')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x55'),require(_0x72d1('0x56')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x57'),require(_0x72d1('0x58')));_0x55b722[_0x72d1('0x8')]('/api/cm/hopper',require(_0x72d1('0x59')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x5a'),require(_0x72d1('0x5b')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x5c'),require(_0x72d1('0x5d')));_0x55b722[_0x72d1('0x8')]('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x5e'),require(_0x72d1('0x5f')));_0x55b722[_0x72d1('0x8')]('/api/actions',require(_0x72d1('0x60')));_0x55b722[_0x72d1('0x8')]('/api/automations',require(_0x72d1('0x61')));_0x55b722['use'](_0x72d1('0x62'),require(_0x72d1('0x63')));_0x55b722['use'](_0x72d1('0x64'),require('./api/disposition'));_0x55b722['use']('/api/conditions',require(_0x72d1('0x65')));_0x55b722['use'](_0x72d1('0x66'),require(_0x72d1('0x67')));_0x55b722[_0x72d1('0x8')]('/api/pauses',require('./api/pause'));_0x55b722[_0x72d1('0x8')]('/api/cdr',require('./api/cdr'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x68'),require(_0x72d1('0x69')));_0x55b722['use']('/api/schedules',require('./api/schedule'));_0x55b722['use'](_0x72d1('0x6a'),require(_0x72d1('0x6b')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x6c'),require(_0x72d1('0x6d')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x6e'),require(_0x72d1('0x6f')));_0x55b722[_0x72d1('0x8')]('/api/triggers',require(_0x72d1('0x70')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x71'),require('./api/variable'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x72'),require(_0x72d1('0x73')));_0x55b722['use'](_0x72d1('0x74'),require(_0x72d1('0x75')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x76'),require('./api/analyticCustomReport'));_0x55b722['use'](_0x72d1('0x77'),require(_0x72d1('0x78')));_0x55b722[_0x72d1('0x8')]('/api/analytics/extracted_reports',require(_0x72d1('0x79')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x7a'),require(_0x72d1('0x7b')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x7c'),require(_0x72d1('0x7d')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x7e'),require(_0x72d1('0x7f')));_0x55b722[_0x72d1('0x8')]('/api/integrations/salesforce/accounts',require(_0x72d1('0x80')));_0x55b722['use']('/api/integrations/salesforce/configurations',require(_0x72d1('0x81')));_0x55b722['use'](_0x72d1('0x82'),require(_0x72d1('0x83')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x84'),require(_0x72d1('0x85')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x86'),require(_0x72d1('0x87')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x88'),require(_0x72d1('0x89')));_0x55b722['use'](_0x72d1('0x8a'),require(_0x72d1('0x8b')));_0x55b722[_0x72d1('0x8')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x8c'),require(_0x72d1('0x8d')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x8e'),require('./api/intZohoAccount'));_0x55b722[_0x72d1('0x8')]('/api/integrations/zoho/configurations',require(_0x72d1('0x8f')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x90'),require(_0x72d1('0x91')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x92'),require(_0x72d1('0x93')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x94'),require(_0x72d1('0x95')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x96'),require(_0x72d1('0x97')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x98'),require(_0x72d1('0x99')));_0x55b722[_0x72d1('0x8')]('/api/integrations/freshdesk/configurations',require(_0x72d1('0x9a')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x9b'),require(_0x72d1('0x9c')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x9d'),require('./api/intVtigerAccount'));_0x55b722[_0x72d1('0x8')](_0x72d1('0x9e'),require(_0x72d1('0x9f')));_0x55b722['use']('/api/integrations/vtiger/fields',require(_0x72d1('0xa0')));_0x55b722['use'](_0x72d1('0xa1'),require(_0x72d1('0xa2')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xa3'),require(_0x72d1('0xa4')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xa5'),require(_0x72d1('0xa6')));_0x55b722[_0x72d1('0x8')]('/api/integrations/dynamics365/accounts',require('./api/intDynamics365Account'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xa7'),require(_0x72d1('0xa8')));_0x55b722['use'](_0x72d1('0xa9'),require(_0x72d1('0xaa')));_0x55b722['use'](_0x72d1('0xab'),require(_0x72d1('0xac')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xad'),require(_0x72d1('0xae')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xaf'),require(_0x72d1('0xb0')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xb1'),require(_0x72d1('0xb2')));_0x55b722[_0x72d1('0x8')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xb3'),require(_0x72d1('0xb4')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xb5'),require(_0x72d1('0xb6')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xb7'),require('./api/jscriptyQuestionReport'));_0x55b722[_0x72d1('0x8')]('/api/jscripty/sessions/reports',require(_0x72d1('0xb8')));_0x55b722[_0x72d1('0x8')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xb9'),require(_0x72d1('0xba')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xbb'),require(_0x72d1('0xbc')));_0x55b722[_0x72d1('0x8')]('/api/jscripty/projects',require(_0x72d1('0xbd')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xbe'),require('./api/setting'));_0x55b722[_0x72d1('0x8')]('/api/square/odbc',require(_0x72d1('0xbf')));_0x55b722[_0x72d1('0x8')]('/api/square/projects',require(_0x72d1('0xc0')));_0x55b722[_0x72d1('0x8')]('/api/square/recordings',require(_0x72d1('0xc1')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xc2'),require(_0x72d1('0xc3')));_0x55b722['use']('/api/teams',require('./api/team'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xc4'),require(_0x72d1('0xc5')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xc6'),require(_0x72d1('0xc7')));_0x55b722['use']('/api/migrations',require(_0x72d1('0xc8')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xc9'),require(_0x72d1('0xca')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xcb'),require('./api/plugin'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xcc'),require(_0x72d1('0xcd')));_0x55b722['use'](_0x72d1('0xce'),require(_0x72d1('0xcf')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xd0'),require(_0x72d1('0xd1')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xd2'),require(_0x72d1('0xd3')));_0x55b722['use'](_0x72d1('0xd4'),require(_0x72d1('0xd5')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xd6'),require('./api/cmList'));_0x55b722['use'](_0x72d1('0xd7'),require(_0x72d1('0xd8')));_0x55b722['use'](_0x72d1('0xd9'),require(_0x72d1('0xda')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xdb'),require(_0x72d1('0xdc')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xdd'),require(_0x72d1('0xde')));_0x55b722['use'](_0x72d1('0xdf'),require(_0x72d1('0xe0')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xe1'),require(_0x72d1('0xe2')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xe3'),require(_0x72d1('0xe4')));_0x55b722['use'](_0x72d1('0xe5'),require(_0x72d1('0xe6')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xe7'),require(_0x72d1('0xe8')));_0x55b722[_0x72d1('0x8')]('/api/whatsapp/reports/queue',require(_0x72d1('0xe9')));_0x55b722[_0x72d1('0x8')]('/api/whatsapp/reports/transfer',require(_0x72d1('0xea')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xeb'),require(_0x72d1('0xec')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xed'),require('./api/cloudProvider'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xee'),require('./api/realtime'));_0x55b722['use'](_0x72d1('0xef'),require(_0x72d1('0xf0')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xf1'),require('./api/authLocal'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xf2'),require(_0x72d1('0xf3')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xf4'),require(_0x72d1('0xf5')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xf6'),require('./api/jira'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xf7'),require(_0x72d1('0xf8')));_0x55b722[_0x72d1('0x8')]('/api/version',require(_0x72d1('0xf9')));_0x55b722[_0x72d1('0x8')]('/api/system',require(_0x72d1('0xfa')));_0x55b722['use'](_0x72d1('0xfb'),require('./api/pm2'));_0x55b722[_0x72d1('0x8')](_0x72d1('0xfc'),require(_0x72d1('0xfd')));_0x55b722[_0x72d1('0x8')](_0x72d1('0xfe'),clientSideLogs);_0x55b722['use'](_0x72d1('0xff'),express[_0x72d1('0x100')](path[_0x72d1('0x101')](config['root'],_0x72d1('0xff'))));_0x55b722[_0x72d1('0x8')]('/www',express[_0x72d1('0x100')](path[_0x72d1('0x101')](config[_0x72d1('0x102')],'/www')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x103'),express[_0x72d1('0x100')](path['join'](config[_0x72d1('0x102')],'/demo')));_0x55b722[_0x72d1('0x8')]('/snippet',express[_0x72d1('0x100')](path[_0x72d1('0x101')](config[_0x72d1('0x102')],_0x72d1('0x104'),'3.0.0')));_0x55b722[_0x72d1('0x8')](_0x72d1('0x105'),express[_0x72d1('0x100')](path[_0x72d1('0x101')](config['root'],_0x72d1('0x106'))));_0x55b722[_0x72d1('0x107')](_0x72d1('0x108'))[_0x72d1('0x109')](errors[0x194]);_0x55b722[_0x72d1('0x107')]('/*')[_0x72d1('0x109')](function(_0x3258d6,_0x5317be){_0x5317be['sendFile'](path['resolve'](_0x55b722[_0x72d1('0x109')]('appPath')+_0x72d1('0x10a')));});return _0x55b722;});}; \ No newline at end of file +var _0x5fc3=['./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/dispositions','/api/conditions','./api/condition','/api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/chat/reports/queue','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','static','/demo','/snippet','snippet','3.0.0','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','path','express','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./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/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields'];(function(_0x17bafc,_0x2b7fb1){var _0x3ab9d3=function(_0x300b89){while(--_0x300b89){_0x17bafc['push'](_0x17bafc['shift']());}};_0x3ab9d3(++_0x2b7fb1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5bc5fe,_0x2afaef){_0x5bc5fe=_0x5bc5fe-0x0;var _0x298ea7=_0x5fc3[_0x5bc5fe];return _0x298ea7;};'use strict';var path=require(_0x35fc('0x0'));var express=require(_0x35fc('0x1'));var errors=require('./errors');var config=require(_0x35fc('0x2'));var setupLoggers=require(_0x35fc('0x3'))[_0x35fc('0x4')];var clientSideLogs=require(_0x35fc('0x5'));exports[_0x35fc('0x6')]=function(_0x5e75e6){return setupLoggers(_0x5e75e6)[_0x35fc('0x7')](function(){_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x9'),require('./api/user'));_0x5e75e6['use'](_0x35fc('0xa'),require('./api/voiceChanSpy'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb'),require(_0x35fc('0xc')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd'),require(_0x35fc('0xe')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/mohs',require(_0x35fc('0xf')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/queues',require(_0x35fc('0x10')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/recordings',require(_0x35fc('0x11')));_0x5e75e6[_0x35fc('0x8')]('/api/screen/recordings',require('./api/screenRecording'));_0x5e75e6[_0x35fc('0x8')]('/api/voice/mails',require(_0x35fc('0x12')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x13'),require(_0x35fc('0x14')));_0x5e75e6[_0x35fc('0x8')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x5e75e6['use']('/api/voice/dials/reports',require(_0x35fc('0x15')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x16'),require(_0x35fc('0x17')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x18'),require('./api/voiceQueueReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x19'),require('./api/memberReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x1a'),require(_0x35fc('0x1b')));_0x5e75e6['use'](_0x35fc('0x1c'),require(_0x35fc('0x1d')));_0x5e75e6[_0x35fc('0x8')]('/api/mail/out_servers',require(_0x35fc('0x1e')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x1f'),require(_0x35fc('0x20')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x21'),require(_0x35fc('0x22')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x23'),require(_0x35fc('0x24')));_0x5e75e6['use'](_0x35fc('0x25'),require(_0x35fc('0x26')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x27'),require(_0x35fc('0x28')));_0x5e75e6['use'](_0x35fc('0x29'),require(_0x35fc('0x2a')));_0x5e75e6['use'](_0x35fc('0x2b'),require(_0x35fc('0x2c')));_0x5e75e6[_0x35fc('0x8')]('/api/dashboards',require(_0x35fc('0x2d')));_0x5e75e6['use'](_0x35fc('0x2e'),require(_0x35fc('0x2f')));_0x5e75e6['use']('/api/fax/accounts',require(_0x35fc('0x30')));_0x5e75e6['use'](_0x35fc('0x31'),require(_0x35fc('0x32')));_0x5e75e6['use'](_0x35fc('0x33'),require(_0x35fc('0x34')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x35'),require(_0x35fc('0x36')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x37'),require(_0x35fc('0x38')));_0x5e75e6['use'](_0x35fc('0x39'),require(_0x35fc('0x3a')));_0x5e75e6[_0x35fc('0x8')]('/api/sms/accounts',require(_0x35fc('0x3b')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x3c'),require(_0x35fc('0x3d')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x3e'),require(_0x35fc('0x3f')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x40'),require(_0x35fc('0x41')));_0x5e75e6['use']('/api/sms/queues',require(_0x35fc('0x42')));_0x5e75e6['use'](_0x35fc('0x43'),require(_0x35fc('0x44')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x45'),require(_0x35fc('0x46')));_0x5e75e6[_0x35fc('0x8')]('/api/openchannel/interactions',require(_0x35fc('0x47')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x48'),require(_0x35fc('0x49')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x4a'),require('./api/openchannelQueue'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x4b'),require(_0x35fc('0x4c')));_0x5e75e6['use'](_0x35fc('0x4d'),require('./api/openchannelQueueReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x4e'),require(_0x35fc('0x4f')));_0x5e75e6[_0x35fc('0x8')]('/api/chat/interactions',require('./api/chatInteraction'));_0x5e75e6['use'](_0x35fc('0x50'),require('./api/chatMessage'));_0x5e75e6[_0x35fc('0x8')]('/api/chat/offline_messages',require(_0x35fc('0x51')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x52'),require(_0x35fc('0x53')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x54'),require(_0x35fc('0x55')));_0x5e75e6['use'](_0x35fc('0x56'),require(_0x35fc('0x57')));_0x5e75e6['use'](_0x35fc('0x58'),require(_0x35fc('0x59')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5a'),require(_0x35fc('0x5b')));_0x5e75e6[_0x35fc('0x8')]('/api/cm/hopper',require(_0x35fc('0x5c')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5d'),require('./api/cmHopperBlack'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5e'),require('./api/cmHopperFinal'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x5f'),require(_0x35fc('0x60')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x61'),require(_0x35fc('0x62')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x63'),require('./api/action'));_0x5e75e6['use'](_0x35fc('0x64'),require(_0x35fc('0x65')));_0x5e75e6['use']('/api/canned_answers',require('./api/cannedAnswer'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x66'),require('./api/disposition'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x67'),require(_0x35fc('0x68')));_0x5e75e6[_0x35fc('0x8')]('/api/intervals',require('./api/interval'));_0x5e75e6['use']('/api/pauses',require('./api/pause'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x69'),require('./api/cdr'));_0x5e75e6[_0x35fc('0x8')]('/api/voiceQueuesLog',require(_0x35fc('0x6a')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x6b'),require(_0x35fc('0x6c')));_0x5e75e6[_0x35fc('0x8')]('/api/sounds',require(_0x35fc('0x6d')));_0x5e75e6[_0x35fc('0x8')]('/api/tags',require(_0x35fc('0x6e')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x6f'),require(_0x35fc('0x70')));_0x5e75e6['use'](_0x35fc('0x71'),require('./api/trigger'));_0x5e75e6['use'](_0x35fc('0x72'),require(_0x35fc('0x73')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x74'),require(_0x35fc('0x75')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x76'),require(_0x35fc('0x77')));_0x5e75e6['use'](_0x35fc('0x78'),require(_0x35fc('0x79')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x7a'),require(_0x35fc('0x7b')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x7c'),require(_0x35fc('0x7d')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x7e'),require(_0x35fc('0x7f')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x80'),require(_0x35fc('0x81')));_0x5e75e6['use']('/api/analytics/tree_reports',require(_0x35fc('0x82')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x83'),require(_0x35fc('0x84')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x85'),require('./api/intSalesforceConfiguration'));_0x5e75e6['use'](_0x35fc('0x86'),require(_0x35fc('0x87')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x88'),require('./api/intSugarcrmAccount'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x89'),require('./api/intSugarcrmConfiguration'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x8a'),require('./api/intSugarcrmField'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x8b'),require(_0x35fc('0x8c')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/desk/configurations',require('./api/intDeskConfiguration'));_0x5e75e6['use'](_0x35fc('0x8d'),require(_0x35fc('0x8e')));_0x5e75e6['use'](_0x35fc('0x8f'),require(_0x35fc('0x90')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x91'),require(_0x35fc('0x92')));_0x5e75e6['use'](_0x35fc('0x93'),require(_0x35fc('0x94')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/zendesk/accounts',require(_0x35fc('0x95')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/zendesk/configurations',require(_0x35fc('0x96')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x97'),require(_0x35fc('0x98')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x99'),require(_0x35fc('0x9a')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/freshdesk/configurations',require(_0x35fc('0x9b')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x9c'),require('./api/intFreshdeskField'));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x5e75e6['use'](_0x35fc('0x9d'),require(_0x35fc('0x9e')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x9f'),require(_0x35fc('0xa0')));_0x5e75e6['use']('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x5e75e6['use']('/api/integrations/servicenow/configurations',require(_0x35fc('0xa1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xa2'),require(_0x35fc('0xa3')));_0x5e75e6['use'](_0x35fc('0xa4'),require(_0x35fc('0xa5')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xa6'),require(_0x35fc('0xa7')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xa8'),require(_0x35fc('0xa9')));_0x5e75e6[_0x35fc('0x8')]('/api/integrations/freshsales/accounts',require(_0x35fc('0xaa')));_0x5e75e6['use'](_0x35fc('0xab'),require(_0x35fc('0xac')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xad'),require('./api/intFreshsalesField'));_0x5e75e6[_0x35fc('0x8')]('/api/networks',require('./api/network'));_0x5e75e6['use'](_0x35fc('0xae'),require('./api/chatQueueReport'));_0x5e75e6[_0x35fc('0x8')]('/api/chat/internal/messages',require(_0x35fc('0xaf')));_0x5e75e6['use'](_0x35fc('0xb0'),require(_0x35fc('0xb1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb2'),require('./api/jscriptyQuestionReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb3'),require(_0x35fc('0xb4')));_0x5e75e6['use'](_0x35fc('0xb5'),require(_0x35fc('0xb6')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb7'),require(_0x35fc('0xb8')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xb9'),require(_0x35fc('0xba')));_0x5e75e6['use'](_0x35fc('0xbb'),require(_0x35fc('0xbc')));_0x5e75e6[_0x35fc('0x8')]('/api/settings',require(_0x35fc('0xbd')));_0x5e75e6[_0x35fc('0x8')]('/api/square/odbc',require('./api/squareOdbc'));_0x5e75e6[_0x35fc('0x8')]('/api/square/projects',require(_0x35fc('0xbe')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xbf'),require(_0x35fc('0xc0')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc1'),require(_0x35fc('0xc2')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc3'),require(_0x35fc('0xc4')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc5'),require(_0x35fc('0xc6')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc7'),require(_0x35fc('0xc8')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xc9'),require(_0x35fc('0xca')));_0x5e75e6[_0x35fc('0x8')]('/api/attachments',require(_0x35fc('0xcb')));_0x5e75e6['use'](_0x35fc('0xcc'),require(_0x35fc('0xcd')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xce'),require(_0x35fc('0xcf')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd0'),require(_0x35fc('0xd1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd2'),require(_0x35fc('0xd3')));_0x5e75e6['use'](_0x35fc('0xd4'),require(_0x35fc('0xd5')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd6'),require(_0x35fc('0xd7')));_0x5e75e6[_0x35fc('0x8')]('/api/cm/lists',require(_0x35fc('0xd8')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xd9'),require(_0x35fc('0xda')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xdb'),require(_0x35fc('0xdc')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xdd'),require('./api/userProfileSection'));_0x5e75e6[_0x35fc('0x8')]('/api/userProfile/resources',require(_0x35fc('0xde')));_0x5e75e6[_0x35fc('0x8')]('/api/userNotifications',require(_0x35fc('0xdf')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe0'),require(_0x35fc('0xe1')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe2'),require(_0x35fc('0xe3')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe4'),require('./api/whatsappInteraction'));_0x5e75e6['use']('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe5'),require(_0x35fc('0xe6')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe7'),require('./api/whatsappTransferReport'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xe8'),require(_0x35fc('0xe9')));_0x5e75e6[_0x35fc('0x8')]('/api/cloudProviders',require(_0x35fc('0xea')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xeb'),require('./api/realtime'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xec'),require(_0x35fc('0xed')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xee'),require(_0x35fc('0xef')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf0'),require('./api/authGoogle'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf1'),require(_0x35fc('0xf2')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf3'),require(_0x35fc('0xf4')));_0x5e75e6['use'](_0x35fc('0xf5'),require('./api/rpc'));_0x5e75e6['use'](_0x35fc('0xf6'),require('./api/version'));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xf7'),require(_0x35fc('0xf8')));_0x5e75e6['use'](_0x35fc('0xf9'),require(_0x35fc('0xfa')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0xfb'),require(_0x35fc('0xfc')));_0x5e75e6['use']('/api/logs',clientSideLogs);_0x5e75e6['use'](_0x35fc('0xfd'),express['static'](path[_0x35fc('0xfe')](config[_0x35fc('0xff')],_0x35fc('0xfd'))));_0x5e75e6[_0x35fc('0x8')]('/www',express[_0x35fc('0x100')](path[_0x35fc('0xfe')](config[_0x35fc('0xff')],'/www')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x101'),express[_0x35fc('0x100')](path['join'](config['root'],'/demo')));_0x5e75e6[_0x35fc('0x8')](_0x35fc('0x102'),express[_0x35fc('0x100')](path[_0x35fc('0xfe')](config['root'],_0x35fc('0x103'),_0x35fc('0x104'))));_0x5e75e6['use']('/plugins',express[_0x35fc('0x100')](path[_0x35fc('0xfe')](config[_0x35fc('0xff')],'/server/files/plugins')));_0x5e75e6['route'](_0x35fc('0x105'))[_0x35fc('0x106')](errors[0x194]);_0x5e75e6['route']('/*')[_0x35fc('0x106')](function(_0x163edb,_0x1d96c9){_0x1d96c9['sendFile'](path[_0x35fc('0x107')](_0x5e75e6[_0x35fc('0x106')](_0x35fc('0x108'))+_0x35fc('0x109')));});return _0x5e75e6;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 72f983e..7a921e5 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5524=['../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.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','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/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/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5524,0xea));var _0x4552=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5524[_0x1d1779];return _0x2377e9;};'use strict';var jayson=require(_0x4552('0x0'));var _=require('lodash');var config=require(_0x4552('0x1'));exports[_0x4552('0x2')]=function(){return new Promise(function(_0x53519c,_0x5d4f5b){var _0x487a9c={};_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x4')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x5')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x6')));_0x487a9c=_['merge'](_0x487a9c,require('../api/voiceRecording/voiceRecording.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x7')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x8')));_0x487a9c=_['merge'](_0x487a9c,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x9')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/memberReport/memberReport.rpc'));_0x487a9c=_['merge'](_0x487a9c,require('../api/trunk/trunk.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0xa')));_0x487a9c=_['merge'](_0x487a9c,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0xb')));_0x487a9c=_['merge'](_0x487a9c,require('../api/mailAccount/mailAccount.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0xc')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0xd')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0xe')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0xf')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x10')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/faxAccount/faxAccount.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x11')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x12')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/faxMessage/faxMessage.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x13')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x14')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x15')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x16')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x17')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/smsQueue/smsQueue.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x18')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x19')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x1a')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x1b')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x1c')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x1d')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x1e')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x1f')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x20')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x21')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x22')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x23')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x24')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x25')));_0x487a9c=_['merge'](_0x487a9c,require('../api/sound/sound.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x26')));_0x487a9c=_['merge'](_0x487a9c,require('../api/trigger/trigger.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x27')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x28')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x29')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x2a')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x2b')));_0x487a9c=_['merge'](_0x487a9c,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x2c')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x2d')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x2e')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x2f')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x30')));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x31')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/setting/setting.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x32')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/squareProject/squareProject.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x33')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x34')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x35')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x36')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x37')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x487a9c=_['merge'](_0x487a9c,require(_0x4552('0x38')));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x39')));_0x487a9c=_['merge'](_0x487a9c,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x487a9c=_[_0x4552('0x3')](_0x487a9c,require(_0x4552('0x3a')));var _0x288831=jayson[_0x4552('0x3b')](_0x487a9c)[_0x4552('0x3c')]();var _0x5b675f=config[_0x4552('0x3d')][_0x4552('0x3e')]||config[_0x4552('0x3e')]+0x1;var _0x1f78f7=config[_0x4552('0x3d')]['ip']||_0x4552('0x3f');_0x288831['on'](_0x4552('0x40'),function(_0x47f0a0){return _0x5d4f5b(_0x47f0a0);});_0x288831['listen'](_0x5b675f,_0x1f78f7,function(){console[_0x4552('0x41')](_0x4552('0x42'),_0x1f78f7,_0x5b675f);require('../config/triggers')['default']();return _0x53519c(_0x4552('0x43')+_0x1f78f7+':'+_0x5b675f);});});}; \ No newline at end of file +var _0x6bf4=['port','localhost','listen','log','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.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/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.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','http'];(function(_0x1f5e71,_0x1b6fde){var _0x2b1538=function(_0x112a69){while(--_0x112a69){_0x1f5e71['push'](_0x1f5e71['shift']());}};_0x2b1538(++_0x1b6fde);}(_0x6bf4,0x122));var _0x46bf=function(_0x3543f5,_0x563b9c){_0x3543f5=_0x3543f5-0x0;var _0x34e0c1=_0x6bf4[_0x3543f5];return _0x34e0c1;};'use strict';var jayson=require(_0x46bf('0x0'));var _=require(_0x46bf('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x1acf79,_0x36a290){var _0x2da170={};_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x3')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x4')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x5')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x6')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x7')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x8')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x9')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0xa')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0xb')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0xc')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0xd')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/mailAccount/mailAccount.rpc'));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0xe')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0xf')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x10')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x11')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/faxAccount/faxAccount.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x12')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x13')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x14')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x15')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x16')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x17')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x18')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x19')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x1a')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x1b')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x1c')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x1d')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x1e')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/chatMessage/chatMessage.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x1f')));_0x2da170=_['merge'](_0x2da170,require('../api/cmContact/cmContact.rpc'));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x20')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x21')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x22')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x23')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x24')));_0x2da170=_['merge'](_0x2da170,require('../api/interval/interval.rpc'));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x25')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x26')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x27')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x28')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x29')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x2a')));_0x2da170=_['merge'](_0x2da170,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x2b')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x2c')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x2d')));_0x2da170=_['merge'](_0x2da170,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x2e')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x2f')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x30')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x31')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x32')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x33')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x34')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x35')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x36')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x37')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x38')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x39')));_0x2da170=_['merge'](_0x2da170,require('../api/campaign/campaign.rpc'));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x3a')));_0x2da170=_['merge'](_0x2da170,require(_0x46bf('0x3b')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x3c')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x3d')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x3e')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require(_0x46bf('0x3f')));_0x2da170=_[_0x46bf('0x2')](_0x2da170,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x10e638=jayson['server'](_0x2da170)[_0x46bf('0x40')]();var _0x1a9c55=config['rpc'][_0x46bf('0x41')]||config['port']+0x1;var _0xe10be1=config['rpc']['ip']||_0x46bf('0x42');_0x10e638['on']('error',function(_0x3dd667){return _0x36a290(_0x3dd667);});_0x10e638[_0x46bf('0x43')](_0x1a9c55,_0xe10be1,function(){console[_0x46bf('0x44')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0xe10be1,_0x1a9c55);require('../config/triggers')[_0x46bf('0x45')]();return _0x1acf79(_0x46bf('0x46')+_0xe10be1+':'+_0x1a9c55);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 930e44d..e4c3ff2 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 _0xf17a=['events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','emit','line','toLowerCase','hangup','substring','search','no\x20code','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','function','inherits','prototype','sync','answer','sendRequest','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','format','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','setExtension','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','wait','exports','util','lodash'];(function(_0x2f7781,_0x514e77){var _0x33d1b5=function(_0xb450f8){while(--_0xb450f8){_0x2f7781['push'](_0x2f7781['shift']());}};_0x33d1b5(++_0x514e77);}(_0xf17a,0x136));var _0xaf17=function(_0x2d134b,_0x492426){_0x2d134b=_0x2d134b-0x0;var _0x197065=_0xf17a[_0x2d134b];return _0x197065;};'use strict';var util=require(_0xaf17('0x0'));var _=require(_0xaf17('0x1'));var EventEmitter=require(_0xaf17('0x2'))[_0xaf17('0x3')];var AGIReply=require(_0xaf17('0x4'));var AGIError=require(_0xaf17('0x5'));function AGIChannel(_0x55c227){var _0x4c1e46=this,_0x4ed2f2=new AGIReply(),_0x112b7f=![],_0x1cc7ba={};EventEmitter[_0xaf17('0x6')](_0x4c1e46);_0x55c227[_0xaf17('0x7')](_0xaf17('0x8'));_0x55c227[_0xaf17('0x9')](0x8*0x3c*0x3c*0x3e8);_0x4ed2f2['setEncoding'](_0xaf17('0x8'));_0x4ed2f2['on']('headers',function(_0x712f31){for(var _0x341164 in _0x712f31){_0x4c1e46[_0x341164]=_0x712f31[_0x341164];}_0x4c1e46[_0xaf17('0xa')]('ready');});_0x4ed2f2['on'](_0xaf17('0xb'),function(_0x993cda){if(_0x993cda[_0xaf17('0xc')]()==_0xaf17('0xd')){_0x4c1e46[_0xaf17('0xa')](_0xaf17('0xd'));return;}if(_0x993cda[_0xaf17('0xe')](0x0,0xb)=='520-Invalid'){_0x112b7f=!![];}if(_0x112b7f){_0x1cc7ba['rx']+=_0x993cda+'\x0a';if(_0x993cda[_0xaf17('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x112b7f=![];}}else{_0x1cc7ba['rx']=_0x993cda;}if(_0x112b7f){return;}if(typeof _0x1cc7ba['cb']=='function'){var _0x209bce=_0x1cc7ba['rx'][_0xaf17('0xe')](0x0,0x3),_0x136968=null,_0x3a53bb=null;_0x209bce=parseInt(_0x209bce);if(isNaN(_0x209bce)){_0x1cc7ba['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xaf17('0x10')});return;}if(_0x209bce!=0xc8){_0x1cc7ba['cb'](null,{'code':_0x209bce,'result':-0x1,'extra':'KO'});return;}_0x136968=_0x1cc7ba['rx']['substring'](0x4)[_0xaf17('0x11')](_0xaf17('0x12'),'');if(_0x136968[_0xaf17('0x13')]('\x20')!=-0x1){_0x136968=_0x136968[_0xaf17('0x14')](0x0,_0x136968[_0xaf17('0x13')]('\x20'));}if(_['startsWith'](_0x136968,'-1')){_0x136968=parseInt(_0x136968);}_0x3a53bb=_0x1cc7ba['rx'][_0xaf17('0x15')]('\x20');if(_0x3a53bb[_0xaf17('0x16')]==0x3){_0x3a53bb=_0x3a53bb[0x2]['substring'](0x1,_0x3a53bb[0x2][_0xaf17('0x16')]-0x1);}else if(_0x3a53bb['length']>0x3){var _0x1b37d4=/\((.+)\)/;var _0x13f5fd=_0x1cc7ba['rx'][_0xaf17('0x17')](_0x1b37d4);if(_0x13f5fd){_0x3a53bb=_0x13f5fd[0x1];}else{_0x3a53bb=null;}}else{_0x3a53bb=null;}_0x1cc7ba['cb'](null,{'code':_0x209bce,'result':_0x136968,'extra':_0x3a53bb});}});_0x55c227['on'](_0xaf17('0x18'),function(_0x8fecdf){_0x4c1e46[_0xaf17('0xa')](_0xaf17('0x18'),new AGIError(_0xaf17('0x19'),_0x8fecdf['code']));});_0x55c227['on'](_0xaf17('0x1a'),function(){_0x4c1e46[_0xaf17('0xa')]('close',new AGIError(_0xaf17('0x1b')));});_0x55c227['on'](_0xaf17('0x1c'),function(){_0x4c1e46['emit'](_0xaf17('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x55c227[_0xaf17('0x1d')]();});_0x55c227[_0xaf17('0x1e')](_0x4ed2f2);this[_0xaf17('0x1f')]=function(_0x26ea00,_0x3d9a7a){var _0x26ea00=_0x26ea00||'',_0x3d9a7a=typeof _0x3d9a7a==_0xaf17('0x20')?_0x3d9a7a:new Function();_0x1cc7ba={'tx':_0x26ea00,'rx':'','cb':_0x3d9a7a};_0x55c227['write'](_0x26ea00+'\x0a');},this[_0xaf17('0x1a')]=function(){_0x55c227[_0xaf17('0x1d')]();};}util[_0xaf17('0x21')](AGIChannel,EventEmitter);AGIChannel[_0xaf17('0x22')]['sendRequest']=function(_0x148338){return this['command'][_0xaf17('0x23')](this,_0x148338);};AGIChannel['prototype'][_0xaf17('0x24')]=function(){return this[_0xaf17('0x25')]('ANSWER');};AGIChannel[_0xaf17('0x22')][_0xaf17('0x26')]=function(_0x2da69e,_0x419bb2,_0x1acde9){_0x2da69e=_0x2da69e===undefined?'beep':_0x2da69e;_0x419bb2=_0x419bb2===undefined?'5':_0x419bb2;_0x1acde9=_0x1acde9===undefined?'1':_0x1acde9;return this[_0xaf17('0x25')](util['format'](_0xaf17('0x27'),_0x2da69e,_0x419bb2*0x3e8,_0x1acde9));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x28')]=function(_0x34eeb7){_0x34eeb7=_0x34eeb7||'NO\x20MESSAGE';return this[_0xaf17('0x25')](util['format'](_0xaf17('0x29'),_0x34eeb7));};AGIChannel['prototype'][_0xaf17('0x2a')]=function(_0x50fd90,_0x139dbc){if(_[_0xaf17('0x2b')](_0x139dbc)){return this[_0xaf17('0x25')](util[_0xaf17('0x2c')](_0xaf17('0x2d'),_0x50fd90,_0x139dbc[_0xaf17('0x2e')](',')));}return this[_0xaf17('0x25')](util[_0xaf17('0x2c')](_0xaf17('0x2d'),_0x50fd90,_0x139dbc));};AGIChannel[_0xaf17('0x22')]['setContext']=function(_0x5196f7){return this[_0xaf17('0x25')](util[_0xaf17('0x2c')](_0xaf17('0x2f'),_0x5196f7));};AGIChannel[_0xaf17('0x22')]['setExtension']=function(_0x529cd8){return this[_0xaf17('0x25')](util[_0xaf17('0x2c')](_0xaf17('0x30'),_0x529cd8));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x31')]=function(_0xb73661){return this[_0xaf17('0x25')](util['format'](_0xaf17('0x32'),_0xb73661));};AGIChannel[_0xaf17('0x22')][_0xaf17('0xd')]=function(){return this[_0xaf17('0x25')](_0xaf17('0x33'));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x34')]=function(_0x3ae510,_0x89176b){var _0x1976b9=_[_0xaf17('0x35')](_0x89176b)||_[_0xaf17('0x36')](_0x89176b)?_0x89176b[_0xaf17('0x37')]():_0x89176b;return this[_0xaf17('0x25')](util[_0xaf17('0x2c')](_0xaf17('0x38'),_0x3ae510,_0x1976b9?_0x1976b9[_0xaf17('0x37')]()[_0xaf17('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x39')]=function(_0x2e6fe,_0x28ddc0){return this[_0xaf17('0x25')](util[_0xaf17('0x2c')]('SAY\x20NUMBER\x20%s\x20%s',_0x2e6fe,_0x28ddc0));};AGIChannel['prototype'][_0xaf17('0x3a')]=function(_0x51f27a,_0x22f9f4){return this['sendRequest'](util[_0xaf17('0x2c')](_0xaf17('0x3b'),_0x51f27a,_0x22f9f4));};AGIChannel['prototype']['sayPhonetic']=function(_0x3863ce,_0x455ac9){return this['sendRequest'](util['format'](_0xaf17('0x3c'),_0x3863ce,_0x455ac9));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x3d')]=function(_0x759ae,_0x4190d3,_0x43215b){_0x4190d3=_0x4190d3||this[_0xaf17('0x3e')];_0x43215b=_0x43215b||0x1;this[_0xaf17('0x3f')](_0x759ae);this[_0xaf17('0x40')](_0x4190d3);this[_0xaf17('0x31')](_0x43215b);return this[_0xaf17('0x28')](util[_0xaf17('0x2c')](_0xaf17('0x41'),_0x759ae,_0x4190d3,_0x43215b));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x42')]=function(_0xcf5bd8){return this['sendRequest'](util[_0xaf17('0x2c')](_0xaf17('0x43'),_0xcf5bd8));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x44')]=function(_0x57cb18,_0x43cafb,_0x5685e6,_0x41fe20,_0x282f96,_0x2feec0){_0x43cafb=_0x43cafb||_0xaf17('0x45');_0x5685e6=_0x5685e6||'';_0x41fe20=_0x41fe20===undefined?-0x1:_0x41fe20==='-1'?-0x1:_0x41fe20*0x3e8;_0x282f96=_0x282f96===undefined?'':'s='+_0x282f96;_0x2feec0=_0x2feec0?_0xaf17('0x46'):'';return this[_0xaf17('0x25')](util[_0xaf17('0x2c')](_0xaf17('0x47'),_0x57cb18,_0x43cafb,_0x5685e6,_0x41fe20,_0x2feec0,_0x282f96));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x48')]=function(_0x3f3244,_0x531ef1){_0x531ef1=_0x531ef1||'';return this[_0xaf17('0x25')](util['format'](_0xaf17('0x49'),_0x3f3244,_0x531ef1));};AGIChannel[_0xaf17('0x22')][_0xaf17('0x4a')]=function(_0x4c346c){return this[_0xaf17('0x2a')](_0xaf17('0x4b'),_0x4c346c);};AGIChannel[_0xaf17('0x22')][_0xaf17('0x4c')]=function(_0xa92de2){return this[_0xaf17('0x2a')]('WAIT',_0xa92de2);};AGIChannel[_0xaf17('0x22')]['error']=function(_0x3b1eff,_0x5cc5f7){this[_0xaf17('0x28')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x3b1eff['id'],_0x3b1eff['label'],_0x5cc5f7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xaf17('0x4d')]=AGIChannel; \ No newline at end of file +var _0x890b=['util','events','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','emit','ready','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','indexOf','startsWith','split','length','match','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','write','close','prototype','sendRequest','sync','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','HANGUP','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','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','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s'];(function(_0x24aa69,_0x5db814){var _0x1fbfff=function(_0x5a306f){while(--_0x5a306f){_0x24aa69['push'](_0x24aa69['shift']());}};_0x1fbfff(++_0x5db814);}(_0x890b,0x168));var _0xb890=function(_0x1d855c,_0x18e088){_0x1d855c=_0x1d855c-0x0;var _0x3fcac9=_0x890b[_0x1d855c];return _0x3fcac9;};'use strict';var util=require(_0xb890('0x0'));var _=require('lodash');var EventEmitter=require(_0xb890('0x1'))[_0xb890('0x2')];var AGIReply=require(_0xb890('0x3'));var AGIError=require(_0xb890('0x4'));function AGIChannel(_0x1246ca){var _0x409b21=this,_0x240155=new AGIReply(),_0x53cfb1=![],_0x523efb={};EventEmitter[_0xb890('0x5')](_0x409b21);_0x1246ca['setEncoding'](_0xb890('0x6'));_0x1246ca[_0xb890('0x7')](0x8*0x3c*0x3c*0x3e8);_0x240155[_0xb890('0x8')]('utf8');_0x240155['on']('headers',function(_0x38175e){for(var _0x23a816 in _0x38175e){_0x409b21[_0x23a816]=_0x38175e[_0x23a816];}_0x409b21[_0xb890('0x9')](_0xb890('0xa'));});_0x240155['on']('line',function(_0x249744){if(_0x249744['toLowerCase']()==_0xb890('0xb')){_0x409b21[_0xb890('0x9')](_0xb890('0xb'));return;}if(_0x249744[_0xb890('0xc')](0x0,0xb)==_0xb890('0xd')){_0x53cfb1=!![];}if(_0x53cfb1){_0x523efb['rx']+=_0x249744+'\x0a';if(_0x249744[_0xb890('0xe')](_0xb890('0xf'))!=-0x1){_0x53cfb1=![];}}else{_0x523efb['rx']=_0x249744;}if(_0x53cfb1){return;}if(typeof _0x523efb['cb']==_0xb890('0x10')){var _0xa89df9=_0x523efb['rx'][_0xb890('0xc')](0x0,0x3),_0x4e2638=null,_0x525fbc=null;_0xa89df9=parseInt(_0xa89df9);if(isNaN(_0xa89df9)){_0x523efb['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xa89df9!=0xc8){_0x523efb['cb'](null,{'code':_0xa89df9,'result':-0x1,'extra':'KO'});return;}_0x4e2638=_0x523efb['rx']['substring'](0x4)[_0xb890('0x11')]('result=','');if(_0x4e2638[_0xb890('0x12')]('\x20')!=-0x1){_0x4e2638=_0x4e2638['substr'](0x0,_0x4e2638[_0xb890('0x12')]('\x20'));}if(_[_0xb890('0x13')](_0x4e2638,'-1')){_0x4e2638=parseInt(_0x4e2638);}_0x525fbc=_0x523efb['rx'][_0xb890('0x14')]('\x20');if(_0x525fbc[_0xb890('0x15')]==0x3){_0x525fbc=_0x525fbc[0x2][_0xb890('0xc')](0x1,_0x525fbc[0x2][_0xb890('0x15')]-0x1);}else if(_0x525fbc[_0xb890('0x15')]>0x3){var _0x46075a=/\((.+)\)/;var _0x365f5c=_0x523efb['rx'][_0xb890('0x16')](_0x46075a);if(_0x365f5c){_0x525fbc=_0x365f5c[0x1];}else{_0x525fbc=null;}}else{_0x525fbc=null;}_0x523efb['cb'](null,{'code':_0xa89df9,'result':_0x4e2638,'extra':_0x525fbc});}});_0x1246ca['on']('error',function(_0x1596bd){_0x409b21[_0xb890('0x9')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x1596bd[_0xb890('0x17')]));});_0x1246ca['on']('close',function(){_0x409b21[_0xb890('0x9')]('close',new AGIError(_0xb890('0x18')));});_0x1246ca['on'](_0xb890('0x19'),function(){_0x409b21[_0xb890('0x9')](_0xb890('0x19'),new AGIError(_0xb890('0x1a')));_0x1246ca[_0xb890('0x1b')]();});_0x1246ca['pipe'](_0x240155);this[_0xb890('0x1c')]=function(_0x4de0be,_0x19b521){var _0x4de0be=_0x4de0be||'',_0x19b521=typeof _0x19b521==_0xb890('0x10')?_0x19b521:new Function();_0x523efb={'tx':_0x4de0be,'rx':'','cb':_0x19b521};_0x1246ca[_0xb890('0x1d')](_0x4de0be+'\x0a');},this[_0xb890('0x1e')]=function(){_0x1246ca[_0xb890('0x1b')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xb890('0x1f')][_0xb890('0x20')]=function(_0x10f11f){return this[_0xb890('0x1c')][_0xb890('0x21')](this,_0x10f11f);};AGIChannel['prototype']['answer']=function(){return this[_0xb890('0x20')]('ANSWER');};AGIChannel['prototype'][_0xb890('0x22')]=function(_0x42570c,_0x52a256,_0x2a2413){_0x42570c=_0x42570c===undefined?_0xb890('0x23'):_0x42570c;_0x52a256=_0x52a256===undefined?'5':_0x52a256;_0x2a2413=_0x2a2413===undefined?'1':_0x2a2413;return this[_0xb890('0x20')](util[_0xb890('0x24')](_0xb890('0x25'),_0x42570c,_0x52a256*0x3e8,_0x2a2413));};AGIChannel['prototype']['noop']=function(_0x4f3e4e){_0x4f3e4e=_0x4f3e4e||_0xb890('0x26');return this[_0xb890('0x20')](util[_0xb890('0x24')](_0xb890('0x27'),_0x4f3e4e));};AGIChannel[_0xb890('0x1f')][_0xb890('0x28')]=function(_0x1b81f9,_0x2be72a){if(_[_0xb890('0x29')](_0x2be72a)){return this['sendRequest'](util[_0xb890('0x24')](_0xb890('0x2a'),_0x1b81f9,_0x2be72a[_0xb890('0x2b')](',')));}return this[_0xb890('0x20')](util['format'](_0xb890('0x2a'),_0x1b81f9,_0x2be72a));};AGIChannel[_0xb890('0x1f')][_0xb890('0x2c')]=function(_0x5c052e){return this[_0xb890('0x20')](util[_0xb890('0x24')]('SET\x20CONTEXT\x20%s',_0x5c052e));};AGIChannel[_0xb890('0x1f')]['setExtension']=function(_0xa5c678){return this['sendRequest'](util[_0xb890('0x24')](_0xb890('0x2d'),_0xa5c678));};AGIChannel[_0xb890('0x1f')]['setPriority']=function(_0x3a2e31){return this['sendRequest'](util[_0xb890('0x24')]('SET\x20PRIORITY\x20%s',_0x3a2e31));};AGIChannel[_0xb890('0x1f')][_0xb890('0xb')]=function(){return this[_0xb890('0x20')](_0xb890('0x2e'));};AGIChannel[_0xb890('0x1f')]['setVariable']=function(_0x4e2181,_0x1f4eec){var _0x19d689=_[_0xb890('0x2f')](_0x1f4eec)||_['isNumber'](_0x1f4eec)?_0x1f4eec[_0xb890('0x30')]():_0x1f4eec;return this[_0xb890('0x20')](util[_0xb890('0x24')](_0xb890('0x31'),_0x4e2181,_0x19d689?_0x19d689[_0xb890('0x30')]()[_0xb890('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xb890('0x1f')][_0xb890('0x32')]=function(_0x54e410,_0x3fcfdf){return this[_0xb890('0x20')](util['format'](_0xb890('0x33'),_0x54e410,_0x3fcfdf));};AGIChannel['prototype'][_0xb890('0x34')]=function(_0x51c1e1,_0x2882b8){return this[_0xb890('0x20')](util['format'](_0xb890('0x35'),_0x51c1e1,_0x2882b8));};AGIChannel[_0xb890('0x1f')][_0xb890('0x36')]=function(_0x238cef,_0x5673d9){return this[_0xb890('0x20')](util[_0xb890('0x24')](_0xb890('0x37'),_0x238cef,_0x5673d9));};AGIChannel[_0xb890('0x1f')]['continueAt']=function(_0x1a3406,_0x2e6672,_0x2f5719){_0x2e6672=_0x2e6672||this[_0xb890('0x38')];_0x2f5719=_0x2f5719||0x1;this[_0xb890('0x2c')](_0x1a3406);this[_0xb890('0x39')](_0x2e6672);this[_0xb890('0x3a')](_0x2f5719);return this['noop'](util[_0xb890('0x24')](_0xb890('0x3b'),_0x1a3406,_0x2e6672,_0x2f5719));};AGIChannel[_0xb890('0x1f')]['getVariable']=function(_0x68a621){return this['sendRequest'](util[_0xb890('0x24')]('GET\x20VARIABLE\x20\x22%s\x22',_0x68a621));};AGIChannel['prototype'][_0xb890('0x3c')]=function(_0x481ef3,_0x38111e,_0x1124f7,_0x5c5b4c,_0x19ee93,_0x402ded){_0x38111e=_0x38111e||_0xb890('0x3d');_0x1124f7=_0x1124f7||'';_0x5c5b4c=_0x5c5b4c===undefined?-0x1:_0x5c5b4c==='-1'?-0x1:_0x5c5b4c*0x3e8;_0x19ee93=_0x19ee93===undefined?'':'s='+_0x19ee93;_0x402ded=_0x402ded?_0xb890('0x3e'):'';return this[_0xb890('0x20')](util[_0xb890('0x24')](_0xb890('0x3f'),_0x481ef3,_0x38111e,_0x1124f7,_0x5c5b4c,_0x402ded,_0x19ee93));};AGIChannel[_0xb890('0x1f')][_0xb890('0x40')]=function(_0x56e260,_0x34bb02){_0x34bb02=_0x34bb02||'';return this[_0xb890('0x20')](util['format'](_0xb890('0x41'),_0x56e260,_0x34bb02));};AGIChannel[_0xb890('0x1f')][_0xb890('0x42')]=function(_0x16d0bb){return this[_0xb890('0x28')](_0xb890('0x43'),_0x16d0bb);};AGIChannel[_0xb890('0x1f')][_0xb890('0x44')]=function(_0xd73568){return this[_0xb890('0x28')](_0xb890('0x45'),_0xd73568);};AGIChannel[_0xb890('0x1f')]['error']=function(_0x43c62c,_0x25a437){this[_0xb890('0x46')](util[_0xb890('0x24')](_0xb890('0x47'),_0x43c62c['id'],_0x43c62c['label'],_0x25a437));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index d236309..a82d867 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 _0x925f=['apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x2918fb,_0x1ac725){var _0xef01f8=function(_0xd97c6){while(--_0xd97c6){_0x2918fb['push'](_0x2918fb['shift']());}};_0xef01f8(++_0x1ac725);}(_0x925f,0x111));var _0xf925=function(_0x367054,_0x1debc3){_0x367054=_0x367054-0x0;var _0x472454=_0x925f[_0x367054];return _0x472454;};'use strict';var util=require(_0xf925('0x0'));var error={'E_AGI_UNDEFINED':_0xf925('0x1'),'E_AGI_ARGUMENT_PORT':_0xf925('0x2'),'E_AGI_SERVER_ERROR':_0xf925('0x3'),'E_AGI_SERVER_CLOSE':_0xf925('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xf925('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xf925('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xf925('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xf925('0x8'),'E_AGI_COMMAND_EMPTY':_0xf925('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xf925('0xa'),'E_AGI_IVR_ENTRY':_0xf925('0xb')};function AGIError(_0x3ee117){var _0x3ee117=_0x3ee117||null,_0x369acd=_0x369acd||[],_0x5a3ffb=0x1,_0x5df2c3='';if(!error[_0x3ee117]){_0x3ee117=_0xf925('0xc');}_0x369acd[_0xf925('0xd')](error[_0x3ee117]);while(arguments[_0x5a3ffb]){_0x369acd[_0xf925('0xd')](arguments[_0x5a3ffb]);_0x5a3ffb++;}_0x5df2c3=util[_0xf925('0xe')][_0xf925('0xf')](util,_0x369acd);this[_0xf925('0x10')]=_0x5df2c3;this[_0xf925('0x11')]=_0x3ee117;}module['exports']=AGIError; \ No newline at end of file +var _0x669c=['format','apply','message','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x5a921a,_0x4d71d0){var _0x5d50d8=function(_0x22a01a){while(--_0x22a01a){_0x5a921a['push'](_0x5a921a['shift']());}};_0x5d50d8(++_0x4d71d0);}(_0x669c,0x99));var _0xc669=function(_0x1491bd,_0x221066){_0x1491bd=_0x1491bd-0x0;var _0x29133b=_0x669c[_0x1491bd];return _0x29133b;};'use strict';var util=require(_0xc669('0x0'));var error={'E_AGI_UNDEFINED':_0xc669('0x1'),'E_AGI_ARGUMENT_PORT':_0xc669('0x2'),'E_AGI_SERVER_ERROR':_0xc669('0x3'),'E_AGI_SERVER_CLOSE':_0xc669('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xc669('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xc669('0x6'),'E_AGI_SOCKET_ERROR':_0xc669('0x7'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xc669('0x8'),'E_AGI_COMMAND_EMPTY':_0xc669('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xc669('0xa')};function AGIError(_0x3afaa5){var _0x3afaa5=_0x3afaa5||null,_0xdf06de=_0xdf06de||[],_0x332c37=0x1,_0x1a34d0='';if(!error[_0x3afaa5]){_0x3afaa5=_0xc669('0xb');}_0xdf06de['push'](error[_0x3afaa5]);while(arguments[_0x332c37]){_0xdf06de['push'](arguments[_0x332c37]);_0x332c37++;}_0x1a34d0=util[_0xc669('0xc')][_0xc669('0xd')](util,_0xdf06de);this[_0xc669('0xe')]=_0x1a34d0;this['name']=_0x3afaa5;}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 1d0b53d..9f5b903 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 _0x1beb=['getdigits','getsecretdigits','edges','numberOfEdges','addVertex','vertices','prototype','addEdge','size','relations','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','menu'];(function(_0x5691bd,_0x1b9089){var _0x5aa0b1=function(_0x1115a1){while(--_0x1115a1){_0x5691bd['push'](_0x5691bd['shift']());}};_0x5aa0b1(++_0x1b9089);}(_0x1beb,0x165));var _0xb1be=function(_0x2c99f4,_0x781ad2){_0x2c99f4=_0x2c99f4-0x0;var _0x40c20d=_0x1beb[_0x2c99f4];return _0x40c20d;};'use strict';var _=require(_0xb1be('0x0'));var logger=require(_0xb1be('0x1'))('agi');var verticesWithRetry=[_0xb1be('0x2'),_0xb1be('0x3'),_0xb1be('0x4')];var Graph=function(){this['vertices']={};this[_0xb1be('0x5')]={};this[_0xb1be('0x6')]=0x0;};Graph['prototype'][_0xb1be('0x7')]=function(_0x3e7119){this[_0xb1be('0x8')][_0x3e7119['id']]=_0x3e7119;this[_0xb1be('0x5')][_0x3e7119['id']]=[];};Graph[_0xb1be('0x9')][_0xb1be('0xa')]=function(_0x42014d,_0x1c8f2e,_0x533389){this[_0xb1be('0x5')][_0x42014d]['push']({'target':_0x1c8f2e,'condition':_0x533389});this['numberOfEdges']+=0x1;};Graph[_0xb1be('0x9')][_0xb1be('0xb')]=function(){return _['size'](this['vertices']);};Graph[_0xb1be('0x9')][_0xb1be('0xc')]=function(){return this['numberOfEdges'];};Graph[_0xb1be('0x9')]['getVertex']=function(_0x3f497a){return this[_0xb1be('0x8')][_0x3f497a];};Graph['prototype'][_0xb1be('0xd')]=function(_0x33fd7e,_0x3d47f7){if(!this[_0xb1be('0x8')][_0x33fd7e]){return logger[_0xb1be('0xe')](_0xb1be('0xf'));}var _0xe9afab=_0x3d47f7(this[_0xb1be('0x8')][_0x33fd7e]);if(!_0xe9afab){return logger['info'](_0xb1be('0x10'));}if(this['edges'][_0x33fd7e][_0xb1be('0x11')]===0x0){return logger[_0xb1be('0xe')](_0xb1be('0x12'));}for(var _0x45a8e4=0x0,_0x373a1b=[],_0x4a0176=![];_0x45a8e4\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','start','clear','vertex','agicommand','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','toString','finally','isUndefined','agicommand\x20not\x20found','[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','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','xml2json','util','moment','../../config/logger','../../config/license/util','./rpc','./mailRpc','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info'];(function(_0x1b5591,_0x427b11){var _0x55d94a=function(_0x2f8a32){while(--_0x2f8a32){_0x1b5591['push'](_0x1b5591['shift']());}};_0x55d94a(++_0x427b11);}(_0x0847,0x9e));var _0x7084=function(_0x164442,_0x5279ea){_0x164442=_0x164442-0x0;var _0x349e25=_0x0847[_0x164442];return _0x349e25;};'use strict';var parser=require(_0x7084('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0x7084('0x1'));var moment=require(_0x7084('0x2'));var config=require('../../config/environment');var logger=require(_0x7084('0x3'))('agi');var utilLicense=require(_0x7084('0x4'));var rpc=require(_0x7084('0x5'));var mailRpc=require(_0x7084('0x6'));var Graph=require('./graph');var Vertices=require(_0x7084('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7084('0x8')]=_[_0x7084('0x9')](config[_0x7084('0x8')],{'ip':_0x7084('0xa'),'port':0x11dd});function connectionHandler(_0x194aca){process[_0x7084('0xb')](function(){syncho(function(){try{setChannelVariables(_0x194aca);agiHandler(_0x194aca);}catch(_0x22aae8){logger[_0x7084('0xc')](_0x22aae8[_0x7084('0xd')]);}});});}function listeningHandler(){console[_0x7084('0xe')](_0x7084('0xf'),config[_0x7084('0x8')][_0x7084('0x10')]);logger[_0x7084('0x11')](util[_0x7084('0x12')](_0x7084('0x13'),config[_0x7084('0x8')]['ip'],config[_0x7084('0x8')][_0x7084('0x10')]));}function errorHandler(_0x2494c5){if(_0x2494c5&&_0x2494c5[_0x7084('0x14')]&&_0x2494c5[_0x7084('0x15')]){logger[_0x7084('0xc')](util[_0x7084('0x12')]('[%s]\x20%s',_0x2494c5[_0x7084('0x14')],_0x2494c5[_0x7084('0x15')]));}else{logger['error'](util[_0x7084('0x12')](_0x7084('0x16'),_0x2494c5[_0x7084('0xd')]));}}function closeHandler(){logger[_0x7084('0x11')](util[_0x7084('0x12')](_0x7084('0x17'),this[_0x7084('0x18')],this[_0x7084('0x19')],this[_0x7084('0x1a')],this[_0x7084('0x1b')],this[_0x7084('0x1c')]));try{createSquareReport(this);}catch(_0x278091){logger['error'](_0x278091[_0x7084('0xd')]);}}function timeoutHandler(){logger[_0x7084('0x11')](util[_0x7084('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x7084('0x18')],this[_0x7084('0x19')],this[_0x7084('0x1a')],this[_0x7084('0x1b')],this[_0x7084('0x1c')]));}function hangupHandler(){logger[_0x7084('0x11')](util[_0x7084('0x12')](_0x7084('0x1d'),this[_0x7084('0x18')],this[_0x7084('0x19')],this[_0x7084('0x1a')],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x1943ef){return parser[_0x7084('0x1e')](_0x1943ef,{'object':!![]})[_0x7084('0x1f')][_0x7084('0x20')];}function addVertex(_0x1a0578,_0x3a4dc1,_0x419142){_0x3a4dc1['agicommand']=_0x419142;if(_0x3a4dc1[_0x7084('0x21')](_0x7084('0x22'))){_0x3a4dc1[_0x7084('0x23')]=parseInt(_0x3a4dc1['retry'],0xa);}_0x1a0578[_0x7084('0x24')](_[_0x7084('0x25')](_0x3a4dc1,'mxCell'));}function initGraph(_0xcd4e14,_0x371ceb){var _0x5a94ed=new Graph();for(var _0x4bb05b in _0xcd4e14){if(_0xcd4e14['hasOwnProperty'](_0x4bb05b)){if(_[_0x7084('0x26')](_0xcd4e14[_0x4bb05b])){for(var _0x4891ff=0x0;_0x4891ff<_0xcd4e14[_0x4bb05b][_0x7084('0x27')];_0x4891ff+=0x1){addVertex(_0x5a94ed,_0xcd4e14[_0x4bb05b][_0x4891ff],_0x4bb05b);}}else{addVertex(_0x5a94ed,_0xcd4e14[_0x4bb05b],_0x4bb05b);}}}for(var _0x25471d=0x0;_0x25471d<_0x371ceb[_0x7084('0x27')];_0x25471d+=0x1){if(_0x371ceb[_0x25471d][_0x7084('0x28')]&&_0x371ceb[_0x25471d][_0x7084('0x29')]){_0x5a94ed[_0x7084('0x2a')](_0x371ceb[_0x25471d][_0x7084('0x28')],_0x371ceb[_0x25471d]['target'],_0x371ceb[_0x25471d][_0x7084('0x2b')]);}}return _0x5a94ed;}function getSquareProject(_0x459b25,_0x17c7a9){rpc[_0x7084('0x2c')](_0x459b25)[_0x7084('0x2d')](function(_0x53c4b3){_0x17c7a9(null,_0x53c4b3);})[_0x7084('0x2e')](function(_0x3fa2b4){_0x17c7a9(null,_0x3fa2b4);});}function createSquareReport(_0x20c0f8,_0x3d5973){rpc[_0x7084('0x2f')](_0x20c0f8)['then'](function(_0x4778f3){if(_0x3d5973){_0x3d5973(null,_0x4778f3);}})[_0x7084('0x2e')](function(_0x6ec857){if(_0x3d5973){_0x3d5973(null,_0x6ec857);}});}function setChannelVariables(_0x2b7446){for(var _0x3ccd9f in _0x2b7446){if(_0x2b7446[_0x7084('0x21')](_0x3ccd9f)){if(_0x3ccd9f[_0x7084('0x30')](_0x7084('0x31'))===0x0){_0x2b7446[_0x3ccd9f[_0x7084('0x32')](0x4)]=_0x2b7446[_0x3ccd9f];delete _0x2b7446[_0x3ccd9f];}}}}function getLogFromObject(_0x3303b6){return util['inspect'](_0x3303b6,{'showHidden':![],'depth':null});}function agiHandler(_0x38be6e){var _0x313d0a,_0x382e75,_0x91102c,_0x13a862,_0x4f7154;logger[_0x7084('0x33')]('variables',JSON[_0x7084('0x34')](_0x38be6e,null,0x2));logger[_0x7084('0x11')](util['format'](_0x7084('0x35'),_0x38be6e['arg_1'],_0x38be6e[_0x7084('0x19')],_0x38be6e[_0x7084('0x1a')],_0x38be6e[_0x7084('0x1b')],_0x38be6e[_0x7084('0x1c')]));_0x38be6e['on'](_0x7084('0xc'),errorHandler);_0x38be6e['on'](_0x7084('0x36'),closeHandler);_0x38be6e['on'](_0x7084('0x37'),timeoutHandler);_0x38be6e['evtHangup']=![];_0x38be6e['on']('hangup',hangupHandler);var _0x2f5d36=getSquareProject['sync'](null,_0x38be6e['arg_1']);if(_0x2f5d36){if(_0x2f5d36[_0x7084('0x38')]){_0x313d0a=getRoot(_0x2f5d36['production']);if(_0x313d0a&&_0x313d0a['start']){logger[_0x7084('0x33')]('root',JSON[_0x7084('0x34')](_0x313d0a,null,0x2));_0x38be6e[_0x7084('0x39')]=moment()[_0x7084('0x12')](_0x7084('0x3a'));_0x382e75=initGraph(_[_0x7084('0x25')](_0x313d0a,_0x7084('0x3b')),_0x313d0a[_0x7084('0x3b')]);_0x91102c=new Vertices(_0x38be6e,rpc,mailRpc);logger['info'](util[_0x7084('0x12')](_0x7084('0x3c'),_0x38be6e[_0x7084('0x18')],_0x38be6e[_0x7084('0x19')],_0x38be6e['callerid'],_0x38be6e[_0x7084('0x1b')],_0x38be6e[_0x7084('0x1c')]));_0x382e75['traverseBFS'](_0x313d0a[_0x7084('0x3d')]['id'],function(_0x706e62){try{_0x706e62=_0x91102c[_0x7084('0x3e')](_0x706e62);logger[_0x7084('0x33')](_0x7084('0x3f'),JSON['stringify'](_0x706e62,null,0x2));if(_0x706e62[_0x7084('0x40')]==='gotoc'){logger[_0x7084('0x11')](_0x7084('0x41'));_0x38be6e[_0x7084('0x42')]=_0x706e62['context']||_0x38be6e[_0x7084('0x42')];_0x38be6e[_0x7084('0x43')]=_0x706e62[_0x7084('0x43')];_0x38be6e['priority']=_0x706e62['priority']?_0x706e62[_0x7084('0x44')]-0x1:0x1;return null;}else if(_0x706e62&&_0x91102c[_0x706e62[_0x7084('0x40')]]){_0x4f7154=_0x91102c[_0x706e62['agicommand']](_0x706e62);logger['info'](_0x7084('0x45'),JSON[_0x7084('0x34')](_0x4f7154,null,0x2));if(_0x4f7154&&_0x4f7154['code']===AGI_CODE_SUCCESS&&_0x4f7154[_0x7084('0x46')]!==AGI_RESULT_ERROR&&!_0x38be6e[_0x7084('0x47')]){logger['debug'](_0x7084('0x45'),getLogFromObject(_0x4f7154));return _['isUndefined'](_0x4f7154[_0x7084('0x46')])?null:_0x4f7154[_0x7084('0x46')][_0x7084('0x48')]();}else{logger['error'](_0x7084('0x45'),getLogFromObject(_0x4f7154));return null;}}else{logger[_0x7084('0xc')]('agicommand\x20not\x20found');return null;}}catch(_0x25ed43){logger[_0x7084('0xc')](_0x25ed43[_0x7084('0xd')]);return null;}});if(_0x313d0a[_0x7084('0x49')]){logger['info'](util[_0x7084('0x12')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x38be6e[_0x7084('0x18')],_0x38be6e['calleridname'],_0x38be6e[_0x7084('0x1a')],_0x38be6e[_0x7084('0x1b')],_0x38be6e['uniqueid']));_0x382e75['traverseBFS'](_0x313d0a['finally']['id'],function(_0x42bd4a){try{_0x42bd4a=_0x91102c[_0x7084('0x3e')](_0x42bd4a);logger[_0x7084('0x33')](_0x7084('0x3f'),JSON[_0x7084('0x34')](_0x42bd4a,null,0x2));if(_0x42bd4a&&_0x91102c[_0x42bd4a[_0x7084('0x40')]]){_0x4f7154=_0x91102c[_0x42bd4a['agicommand']](_0x42bd4a);if(_0x4f7154){logger[_0x7084('0x33')]('response',getLogFromObject(_0x4f7154));return _[_0x7084('0x4a')](_0x4f7154[_0x7084('0x46')])?null:_0x4f7154[_0x7084('0x46')]['toString']();}else{logger[_0x7084('0xc')](_0x7084('0x45'),getLogFromObject(_0x4f7154));return null;}}else{logger[_0x7084('0xc')](_0x7084('0x4b'));return null;}}catch(_0x172709){logger[_0x7084('0xc')](_0x172709['stack']);return null;}});}logger['info'](util[_0x7084('0x12')](_0x7084('0x4c'),_0x38be6e[_0x7084('0x18')],_0x38be6e[_0x7084('0x19')],_0x38be6e[_0x7084('0x1a')],_0x38be6e['dnid'],_0x38be6e[_0x7084('0x1c')]));logger[_0x7084('0x11')](util[_0x7084('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x38be6e[_0x7084('0x42')],_0x38be6e[_0x7084('0x43')],parseInt(_0x38be6e[_0x7084('0x44')],0xa)+0x1));_0x38be6e[_0x7084('0x4d')](_0x38be6e[_0x7084('0x42')],_0x38be6e[_0x7084('0x43')],parseInt(_0x38be6e[_0x7084('0x44')],0xa)+0x1);_0x38be6e[_0x7084('0x36')]();}}else{logger[_0x7084('0xc')](util[_0x7084('0x12')](_0x7084('0x4e'),_0x38be6e[_0x7084('0x18')]));_0x38be6e['continueAt'](_0x38be6e[_0x7084('0x42')],_0x38be6e['extension'],parseInt(_0x38be6e[_0x7084('0x44')],0xa)+0x1);_0x38be6e[_0x7084('0x36')]();}}else{logger[_0x7084('0xc')](util[_0x7084('0x12')](_0x7084('0x4f'),_0x38be6e[_0x7084('0x18')]));_0x38be6e['continueAt'](_0x38be6e[_0x7084('0x42')],_0x38be6e[_0x7084('0x43')],parseInt(_0x38be6e[_0x7084('0x44')],0xa)+0x1);_0x38be6e[_0x7084('0x36')]();}}function main(){var _0x4cae6b;return utilLicense[_0x7084('0x50')]()['then'](function(_0x4d00f9){if(_0x4d00f9){if(_0x4d00f9[_0x7084('0x51')]){if(_0x4d00f9[_0x7084('0x52')]&&_0x4d00f9[_0x7084('0x52')]>0x0){logger[_0x7084('0x11')](util['format'](_0x7084('0x53'),_0x4d00f9['callysquare']));_0x4cae6b=_0x4d00f9[_0x7084('0x52')];}else{logger[_0x7084('0x11')](_0x7084('0x54'));}}else{logger[_0x7084('0x11')](_0x7084('0x55'));_0x4cae6b=-0x1;}}})[_0x7084('0x2e')](function(_0x1b90ea){logger[_0x7084('0xc')](_0x7084('0x56'),_0x1b90ea[_0x7084('0xd')]);})[_0x7084('0x49')](function(){var _0x27ac48=require(_0x7084('0x57'))(config[_0x7084('0x8')][_0x7084('0x10')],config['agi']['ip'],_0x4cae6b);_0x27ac48['on']('error',errorHandler);_0x27ac48['on']('listening',listeningHandler);_0x27ac48['on']('connection',connectionHandler);_0x27ac48['on'](_0x7084('0x36'),closeHandler);});}main(); \ No newline at end of file +var _0x2b27=['evtHangup','root','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','start','debug','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','context','extension','priority','response','code','result','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','connection','xml2json','syncho','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','defaults','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b27,0xe5));var _0x72b2=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x2b27[_0x454165];return _0x56db53;};'use strict';var parser=require(_0x72b2('0x0'));var _=require('lodash');var syncho=require(_0x72b2('0x1'));var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x72b2('0x2'))(_0x72b2('0x3'));var utilLicense=require(_0x72b2('0x4'));var rpc=require(_0x72b2('0x5'));var mailRpc=require(_0x72b2('0x6'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x72b2('0x7')](config[_0x72b2('0x3')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x26e513){process[_0x72b2('0x8')](function(){syncho(function(){try{setChannelVariables(_0x26e513);agiHandler(_0x26e513);}catch(_0x1dc54a){logger[_0x72b2('0x9')](_0x1dc54a[_0x72b2('0xa')]);}});});}function listeningHandler(){console[_0x72b2('0xb')](_0x72b2('0xc'),config[_0x72b2('0x3')][_0x72b2('0xd')]);logger[_0x72b2('0xe')](util[_0x72b2('0xf')](_0x72b2('0x10'),config[_0x72b2('0x3')]['ip'],config[_0x72b2('0x3')][_0x72b2('0xd')]));}function errorHandler(_0x13eb11){if(_0x13eb11&&_0x13eb11[_0x72b2('0x11')]&&_0x13eb11[_0x72b2('0x12')]){logger['error'](util[_0x72b2('0xf')](_0x72b2('0x13'),_0x13eb11[_0x72b2('0x11')],_0x13eb11['message']));}else{logger[_0x72b2('0x9')](util[_0x72b2('0xf')](_0x72b2('0x14'),_0x13eb11[_0x72b2('0xa')]));}}function closeHandler(){logger[_0x72b2('0xe')](util[_0x72b2('0xf')](_0x72b2('0x15'),this[_0x72b2('0x16')],this[_0x72b2('0x17')],this['callerid'],this['dnid'],this[_0x72b2('0x18')]));try{createSquareReport(this);}catch(_0x38021f){logger[_0x72b2('0x9')](_0x38021f[_0x72b2('0xa')]);}}function timeoutHandler(){logger[_0x72b2('0xe')](util[_0x72b2('0xf')](_0x72b2('0x19'),this['arg_1'],this[_0x72b2('0x17')],this[_0x72b2('0x1a')],this[_0x72b2('0x1b')],this[_0x72b2('0x18')]));}function hangupHandler(){logger[_0x72b2('0xe')](util[_0x72b2('0xf')](_0x72b2('0x1c'),this[_0x72b2('0x16')],this['calleridname'],this[_0x72b2('0x1a')],this[_0x72b2('0x1b')],this[_0x72b2('0x18')]));this[_0x72b2('0x1d')]=!![];}function getRoot(_0x2d943c){return parser['toJson'](_0x2d943c,{'object':!![]})['mxGraphModel'][_0x72b2('0x1e')];}function addVertex(_0x97157d,_0x20bd9f,_0x6cb14a){_0x20bd9f[_0x72b2('0x1f')]=_0x6cb14a;if(_0x20bd9f[_0x72b2('0x20')]('retry')){_0x20bd9f[_0x72b2('0x21')]=parseInt(_0x20bd9f[_0x72b2('0x22')],0xa);}_0x97157d[_0x72b2('0x23')](_[_0x72b2('0x24')](_0x20bd9f,_0x72b2('0x25')));}function initGraph(_0x380837,_0x4efbd0){var _0xee89f4=new Graph();for(var _0x4d7557 in _0x380837){if(_0x380837[_0x72b2('0x20')](_0x4d7557)){if(_[_0x72b2('0x26')](_0x380837[_0x4d7557])){for(var _0x2dee1d=0x0;_0x2dee1d<_0x380837[_0x4d7557][_0x72b2('0x27')];_0x2dee1d+=0x1){addVertex(_0xee89f4,_0x380837[_0x4d7557][_0x2dee1d],_0x4d7557);}}else{addVertex(_0xee89f4,_0x380837[_0x4d7557],_0x4d7557);}}}for(var _0x4ef758=0x0;_0x4ef758<_0x4efbd0['length'];_0x4ef758+=0x1){if(_0x4efbd0[_0x4ef758]['source']&&_0x4efbd0[_0x4ef758][_0x72b2('0x28')]){_0xee89f4[_0x72b2('0x29')](_0x4efbd0[_0x4ef758][_0x72b2('0x2a')],_0x4efbd0[_0x4ef758][_0x72b2('0x28')],_0x4efbd0[_0x4ef758][_0x72b2('0x2b')]);}}return _0xee89f4;}function getSquareProject(_0x475d48,_0x1349a4){rpc[_0x72b2('0x2c')](_0x475d48)[_0x72b2('0x2d')](function(_0x4946b8){_0x1349a4(null,_0x4946b8);})[_0x72b2('0x2e')](function(_0x2ac7c6){_0x1349a4(null,_0x2ac7c6);});}function createSquareReport(_0x13a850,_0x38e2fc){rpc[_0x72b2('0x2f')](_0x13a850)[_0x72b2('0x2d')](function(_0x2e98ef){if(_0x38e2fc){_0x38e2fc(null,_0x2e98ef);}})['catch'](function(_0x391c75){if(_0x38e2fc){_0x38e2fc(null,_0x391c75);}});}function setChannelVariables(_0x448361){for(var _0x15c88b in _0x448361){if(_0x448361[_0x72b2('0x20')](_0x15c88b)){if(_0x15c88b[_0x72b2('0x30')](_0x72b2('0x31'))===0x0){_0x448361[_0x15c88b[_0x72b2('0x32')](0x4)]=_0x448361[_0x15c88b];delete _0x448361[_0x15c88b];}}}}function getLogFromObject(_0x4868bc){return util[_0x72b2('0x33')](_0x4868bc,{'showHidden':![],'depth':null});}function agiHandler(_0x35bd64){var _0x382bc0,_0x3fc798,_0x466a7d,_0xcf5a6b,_0x37e09f;logger['debug'](_0x72b2('0x34'),JSON[_0x72b2('0x35')](_0x35bd64,null,0x2));logger['info'](util[_0x72b2('0xf')](_0x72b2('0x36'),_0x35bd64[_0x72b2('0x16')],_0x35bd64[_0x72b2('0x17')],_0x35bd64[_0x72b2('0x1a')],_0x35bd64[_0x72b2('0x1b')],_0x35bd64['uniqueid']));_0x35bd64['on'](_0x72b2('0x9'),errorHandler);_0x35bd64['on'](_0x72b2('0x37'),closeHandler);_0x35bd64['on'](_0x72b2('0x38'),timeoutHandler);_0x35bd64[_0x72b2('0x1d')]=![];_0x35bd64['on'](_0x72b2('0x39'),hangupHandler);var _0x4334d1=getSquareProject['sync'](null,_0x35bd64[_0x72b2('0x16')]);if(_0x4334d1){if(_0x4334d1[_0x72b2('0x3a')]){_0x382bc0=getRoot(_0x4334d1['production']);if(_0x382bc0&&_0x382bc0[_0x72b2('0x3b')]){logger[_0x72b2('0x3c')](_0x72b2('0x1e'),JSON[_0x72b2('0x35')](_0x382bc0,null,0x2));_0x35bd64[_0x72b2('0x3d')]=moment()[_0x72b2('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x3fc798=initGraph(_[_0x72b2('0x24')](_0x382bc0,_0x72b2('0x25')),_0x382bc0[_0x72b2('0x25')]);_0x466a7d=new Vertices(_0x35bd64,rpc,mailRpc);logger[_0x72b2('0xe')](util['format'](_0x72b2('0x3e'),_0x35bd64['arg_1'],_0x35bd64['calleridname'],_0x35bd64[_0x72b2('0x1a')],_0x35bd64['dnid'],_0x35bd64[_0x72b2('0x18')]));_0x3fc798[_0x72b2('0x3f')](_0x382bc0[_0x72b2('0x3b')]['id'],function(_0x1ffc51){try{_0x1ffc51=_0x466a7d[_0x72b2('0x40')](_0x1ffc51);logger[_0x72b2('0x3c')](_0x72b2('0x41'),JSON[_0x72b2('0x35')](_0x1ffc51,null,0x2));if(_0x1ffc51[_0x72b2('0x1f')]===_0x72b2('0x42')){logger[_0x72b2('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x35bd64['context']=_0x1ffc51[_0x72b2('0x43')]||_0x35bd64[_0x72b2('0x43')];_0x35bd64[_0x72b2('0x44')]=_0x1ffc51[_0x72b2('0x44')];_0x35bd64['priority']=_0x1ffc51[_0x72b2('0x45')]?_0x1ffc51[_0x72b2('0x45')]-0x1:0x1;return null;}else if(_0x1ffc51&&_0x466a7d[_0x1ffc51[_0x72b2('0x1f')]]){_0x37e09f=_0x466a7d[_0x1ffc51['agicommand']](_0x1ffc51);logger[_0x72b2('0xe')](_0x72b2('0x46'),JSON['stringify'](_0x37e09f,null,0x2));if(_0x37e09f&&_0x37e09f[_0x72b2('0x47')]===AGI_CODE_SUCCESS&&_0x37e09f[_0x72b2('0x48')]!==AGI_RESULT_ERROR&&!_0x35bd64[_0x72b2('0x1d')]){logger[_0x72b2('0x3c')](_0x72b2('0x46'),getLogFromObject(_0x37e09f));return _[_0x72b2('0x49')](_0x37e09f[_0x72b2('0x48')])?null:_0x37e09f[_0x72b2('0x48')][_0x72b2('0x4a')]();}else{logger[_0x72b2('0x9')](_0x72b2('0x46'),getLogFromObject(_0x37e09f));return null;}}else{logger[_0x72b2('0x9')]('agicommand\x20not\x20found');return null;}}catch(_0x1bbd0c){logger[_0x72b2('0x9')](_0x1bbd0c['stack']);return null;}});if(_0x382bc0[_0x72b2('0x4b')]){logger[_0x72b2('0xe')](util[_0x72b2('0xf')](_0x72b2('0x4c'),_0x35bd64[_0x72b2('0x16')],_0x35bd64[_0x72b2('0x17')],_0x35bd64[_0x72b2('0x1a')],_0x35bd64[_0x72b2('0x1b')],_0x35bd64[_0x72b2('0x18')]));_0x3fc798['traverseBFS'](_0x382bc0[_0x72b2('0x4b')]['id'],function(_0x5c1cf5){try{_0x5c1cf5=_0x466a7d[_0x72b2('0x40')](_0x5c1cf5);logger['debug']('vertex',JSON[_0x72b2('0x35')](_0x5c1cf5,null,0x2));if(_0x5c1cf5&&_0x466a7d[_0x5c1cf5[_0x72b2('0x1f')]]){_0x37e09f=_0x466a7d[_0x5c1cf5['agicommand']](_0x5c1cf5);if(_0x37e09f){logger['debug'](_0x72b2('0x46'),getLogFromObject(_0x37e09f));return _[_0x72b2('0x49')](_0x37e09f[_0x72b2('0x48')])?null:_0x37e09f[_0x72b2('0x48')]['toString']();}else{logger[_0x72b2('0x9')]('response',getLogFromObject(_0x37e09f));return null;}}else{logger[_0x72b2('0x9')](_0x72b2('0x4d'));return null;}}catch(_0x168f55){logger['error'](_0x168f55[_0x72b2('0xa')]);return null;}});}logger['info'](util[_0x72b2('0xf')](_0x72b2('0x4e'),_0x35bd64[_0x72b2('0x16')],_0x35bd64[_0x72b2('0x17')],_0x35bd64[_0x72b2('0x1a')],_0x35bd64[_0x72b2('0x1b')],_0x35bd64[_0x72b2('0x18')]));logger[_0x72b2('0xe')](util[_0x72b2('0xf')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x35bd64[_0x72b2('0x43')],_0x35bd64[_0x72b2('0x44')],parseInt(_0x35bd64[_0x72b2('0x45')],0xa)+0x1));_0x35bd64[_0x72b2('0x4f')](_0x35bd64[_0x72b2('0x43')],_0x35bd64[_0x72b2('0x44')],parseInt(_0x35bd64[_0x72b2('0x45')],0xa)+0x1);_0x35bd64[_0x72b2('0x37')]();}}else{logger['error'](util['format'](_0x72b2('0x50'),_0x35bd64[_0x72b2('0x16')]));_0x35bd64['continueAt'](_0x35bd64[_0x72b2('0x43')],_0x35bd64['extension'],parseInt(_0x35bd64[_0x72b2('0x45')],0xa)+0x1);_0x35bd64[_0x72b2('0x37')]();}}else{logger[_0x72b2('0x9')](util[_0x72b2('0xf')]('Project\x20%s\x20not\x20found',_0x35bd64['arg_1']));_0x35bd64[_0x72b2('0x4f')](_0x35bd64[_0x72b2('0x43')],_0x35bd64[_0x72b2('0x44')],parseInt(_0x35bd64[_0x72b2('0x45')],0xa)+0x1);_0x35bd64[_0x72b2('0x37')]();}}function main(){var _0x493eb6;return utilLicense[_0x72b2('0x51')]()[_0x72b2('0x2d')](function(_0x164ca7){if(_0x164ca7){if(_0x164ca7['voice']){if(_0x164ca7[_0x72b2('0x52')]&&_0x164ca7[_0x72b2('0x52')]>0x0){logger['info'](util[_0x72b2('0xf')]('[LICENSE]\x20CHANNELS:\x20%s',_0x164ca7[_0x72b2('0x52')]));_0x493eb6=_0x164ca7[_0x72b2('0x52')];}else{logger[_0x72b2('0xe')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger['info'](_0x72b2('0x53'));_0x493eb6=-0x1;}}})[_0x72b2('0x2e')](function(_0x38b50d){logger[_0x72b2('0x9')](_0x72b2('0x54'),_0x38b50d[_0x72b2('0xa')]);})[_0x72b2('0x4b')](function(){var _0x4f1dd4=require('./server')(config[_0x72b2('0x3')]['port'],config[_0x72b2('0x3')]['ip'],_0x493eb6);_0x4f1dd4['on'](_0x72b2('0x9'),errorHandler);_0x4f1dd4['on']('listening',listeningHandler);_0x4f1dd4['on'](_0x72b2('0x55'),connectionHandler);_0x4f1dd4['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 30c5103..d1bdbb2 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 _0x487a=['bluebird','jayson/promise','http','sendMailMessage','SendMail'];(function(_0x2d6305,_0xd11ebb){var _0x3bbe1a=function(_0x488417){while(--_0x488417){_0x2d6305['push'](_0x2d6305['shift']());}};_0x3bbe1a(++_0xd11ebb);}(_0x487a,0x113));var _0xa487=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x487a[_0x9aada2];return _0x196dff;};'use strict';var BPromise=require(_0xa487('0x0'));var jayson=require(_0xa487('0x1'));var client=jayson['client'][_0xa487('0x2')]({'port':0x232b});function request(_0x343f56,_0xea84a1){return new BPromise(function(_0x74136d,_0x12d1e2){return client['request'](_0x343f56,_0xea84a1)['then'](function(_0x280844){if(_0x280844['error']){return _0x12d1e2(_0x280844['error']['message']);}else{return _0x74136d(_0x280844['result']);}})['catch'](function(_0x31feb6){return _0x12d1e2(_0x31feb6);});});}exports[_0xa487('0x3')]=function(_0x121cc9,_0x2ebec1){return request(_0xa487('0x4'),{'account':_0x121cc9,'message':_0x2ebec1});}; \ No newline at end of file +var _0xb681=['SendMail','client','request','then','message','sendMailMessage'];(function(_0x50cb3e,_0x2677e3){var _0x117eb8=function(_0x536103){while(--_0x536103){_0x50cb3e['push'](_0x50cb3e['shift']());}};_0x117eb8(++_0x2677e3);}(_0xb681,0xf1));var _0x1b68=function(_0x531e17,_0x1f0289){_0x531e17=_0x531e17-0x0;var _0x1d265b=_0xb681[_0x531e17];return _0x1d265b;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x1b68('0x0')]['http']({'port':0x232b});function request(_0x9a236f,_0xcd018b){return new BPromise(function(_0x217a15,_0x41e995){return client[_0x1b68('0x1')](_0x9a236f,_0xcd018b)[_0x1b68('0x2')](function(_0x53bfbc){if(_0x53bfbc['error']){return _0x41e995(_0x53bfbc['error'][_0x1b68('0x3')]);}else{return _0x217a15(_0x53bfbc['result']);}})['catch'](function(_0xc60fe0){return _0x41e995(_0xc60fe0);});});}exports[_0x1b68('0x4')]=function(_0x22c0a6,_0x4a6bcf){return request(_0x1b68('0x5'),{'account':_0x22c0a6,'message':_0x4a6bcf});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 760990d..80a9c2a 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 _0x93a0=['slice','trim','emit','exports','Transform','call','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split'];(function(_0x278119,_0x2f6fda){var _0x2e8f1b=function(_0x6d69af){while(--_0x6d69af){_0x278119['push'](_0x278119['shift']());}};_0x2e8f1b(++_0x2f6fda);}(_0x93a0,0x1c4));var _0x093a=function(_0x4b0f79,_0x38f376){_0x4b0f79=_0x4b0f79-0x0;var _0x31b54f=_0x93a0[_0x4b0f79];return _0x31b54f;};'use strict';var util=require('util');var Transform=require('stream')[_0x093a('0x0')];function AGIReply(_0x595002){Transform[_0x093a('0x1')](this,_0x595002);this[_0x093a('0x2')]='';this[_0x093a('0x3')]=![];}util[_0x093a('0x4')](AGIReply,Transform);AGIReply[_0x093a('0x5')]['_transform']=function(_0x3a3ecd,_0x2c54e9,_0x3beb5f){var _0x256ad9='\x0a',_0x41ce4e=['\x0a\x0a',_0x093a('0x6')],_0x3990af=-0x1,_0x2970f2=-0x1,_0x25ac09='',_0x83c5a9=0x0,_0x2b63f4='',_0xf8848c='';this['_localBuffer']+=_0x3a3ecd[_0x093a('0x7')]();_0x2b63f4=this[_0x093a('0x2')];if(!this['_inBody']){_0x83c5a9=0x0;while(_0x41ce4e[_0x83c5a9]){while((_0x2970f2=_0x2b63f4[_0x093a('0x8')](_0x41ce4e[_0x83c5a9]))!=-0x1){_0x25ac09=_0x41ce4e[_0x83c5a9];_0xf8848c=_0x2b63f4[_0x093a('0x9')](0x0,_0x2970f2);_0x2b63f4=_0x2b63f4[_0x093a('0x9')](_0x2970f2+_0x25ac09[_0x093a('0xa')]);var _0x1fe857=_0xf8848c[_0x093a('0xb')](_0x256ad9),_0xe6abc8=0x0,_0x91d3f6={},_0x26cafd='',_0x3cf6ff='',_0x30b6f9=-0x1;while(_0x1fe857[_0xe6abc8]){_0x30b6f9=_0x1fe857[_0xe6abc8]['indexOf'](':');if(_0x30b6f9!=-0x1){_0x26cafd=_0x1fe857[_0xe6abc8][_0x093a('0xc')](0x0,_0x30b6f9)[_0x093a('0xd')]();_0x3cf6ff=_0x1fe857[_0xe6abc8][_0x093a('0xc')](_0x30b6f9+0x1)[_0x093a('0xd')]();if(_0x26cafd[_0x093a('0xa')]>0x0){_0x91d3f6[_0x26cafd]=_0x3cf6ff;}}else{}_0xe6abc8++;}this['emit']('headers',_0x91d3f6);this[_0x093a('0x3')]=!![];}_0x83c5a9++;}this[_0x093a('0x2')]=_0x2b63f4;}else{while((_0x3990af=_0x2b63f4[_0x093a('0x8')](_0x256ad9))!=-0x1){_0xf8848c=_0x2b63f4[_0x093a('0x9')](0x0,_0x3990af);this[_0x093a('0xe')]('line',_0xf8848c);_0x2b63f4=_0x2b63f4[_0x093a('0x9')](_0x3990af+_0x256ad9[_0x093a('0xa')]);}this[_0x093a('0x2')]=_0x2b63f4;}_0x3beb5f();};module[_0x093a('0xf')]=AGIReply; \ No newline at end of file +var _0xccac=['_inBody','indexOf','substring','length','slice','trim','emit','line','exports','util','stream','Transform','call','_localBuffer','prototype'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0xccac,0x1cb));var _0xccca=function(_0x35c46e,_0x10deaa){_0x35c46e=_0x35c46e-0x0;var _0x3f926=_0xccac[_0x35c46e];return _0x3f926;};'use strict';var util=require(_0xccca('0x0'));var Transform=require(_0xccca('0x1'))[_0xccca('0x2')];function AGIReply(_0x186226){Transform[_0xccca('0x3')](this,_0x186226);this[_0xccca('0x4')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xccca('0x5')]['_transform']=function(_0x2c24ae,_0x1fcf9e,_0x346c79){var _0x1be72e='\x0a',_0x461c34=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x56a775=-0x1,_0x57f5a2=-0x1,_0x6fbff0='',_0xa7856f=0x0,_0x217ce7='',_0x25364d='';this['_localBuffer']+=_0x2c24ae['toString']();_0x217ce7=this[_0xccca('0x4')];if(!this[_0xccca('0x6')]){_0xa7856f=0x0;while(_0x461c34[_0xa7856f]){while((_0x57f5a2=_0x217ce7[_0xccca('0x7')](_0x461c34[_0xa7856f]))!=-0x1){_0x6fbff0=_0x461c34[_0xa7856f];_0x25364d=_0x217ce7[_0xccca('0x8')](0x0,_0x57f5a2);_0x217ce7=_0x217ce7[_0xccca('0x8')](_0x57f5a2+_0x6fbff0[_0xccca('0x9')]);var _0x1eff93=_0x25364d['split'](_0x1be72e),_0x114f94=0x0,_0x57d54a={},_0x38ff4a='',_0x1f2a99='',_0x27d396=-0x1;while(_0x1eff93[_0x114f94]){_0x27d396=_0x1eff93[_0x114f94][_0xccca('0x7')](':');if(_0x27d396!=-0x1){_0x38ff4a=_0x1eff93[_0x114f94][_0xccca('0xa')](0x0,_0x27d396)[_0xccca('0xb')]();_0x1f2a99=_0x1eff93[_0x114f94]['slice'](_0x27d396+0x1)['trim']();if(_0x38ff4a[_0xccca('0x9')]>0x0){_0x57d54a[_0x38ff4a]=_0x1f2a99;}}else{}_0x114f94++;}this[_0xccca('0xc')]('headers',_0x57d54a);this[_0xccca('0x6')]=!![];}_0xa7856f++;}this[_0xccca('0x4')]=_0x217ce7;}else{while((_0x56a775=_0x217ce7[_0xccca('0x7')](_0x1be72e))!=-0x1){_0x25364d=_0x217ce7[_0xccca('0x8')](0x0,_0x56a775);this[_0xccca('0xc')](_0xccca('0xd'),_0x25364d);_0x217ce7=_0x217ce7['substring'](_0x56a775+_0x1be72e[_0xccca('0x9')]);}this['_localBuffer']=_0x217ce7;}_0x346c79();};module[_0xccca('0xe')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index c53ed90..ddfaf45 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 _0xb1a3=['request','then','error','message','result','catch','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise'];(function(_0x7f82c7,_0x2bec9d){var _0xccd46=function(_0x14083a){while(--_0x14083a){_0x7f82c7['push'](_0x7f82c7['shift']());}};_0xccd46(++_0x2bec9d);}(_0xb1a3,0x1cc));var _0x3b1a=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xb1a3[_0x311c35];return _0x5cc50c;};'use strict';var BPromise=require(_0x3b1a('0x0'));var moment=require(_0x3b1a('0x1'));var _=require(_0x3b1a('0x2'));var util=require('util');var jayson=require(_0x3b1a('0x3'));var client=jayson['client']['http']({'port':0x2329});function request(_0x41fe6c,_0x77489e){return new BPromise(function(_0xd2c9e1,_0x3fcfd5){return client[_0x3b1a('0x4')](_0x41fe6c,_0x77489e)[_0x3b1a('0x5')](function(_0x208d05){if(_0x208d05['error']){return _0x3fcfd5(_0x208d05[_0x3b1a('0x6')][_0x3b1a('0x7')]);}else{return _0xd2c9e1(_0x208d05[_0x3b1a('0x8')]);}})[_0x3b1a('0x9')](function(_0x55a5d2){return _0x3fcfd5(_0x55a5d2);});});}exports['getSquareProject']=function(_0x2196c3){return request(_0x3b1a('0xa'),{'options':{'raw':![],'where':{'name':_0x2196c3},'attributes':['production']}});};exports[_0x3b1a('0xb')]=function(_0x553d63){return request(_0x3b1a('0xc'),{'options':{'raw':![],'where':{'id':_0x553d63},'include':[{'model':'MailServerOut','as':_0x3b1a('0xd')}],'attributes':['id',_0x3b1a('0xe'),_0x3b1a('0xf')]}});};exports[_0x3b1a('0x10')]=function(_0x314843){return request(_0x3b1a('0xa'),{'options':{'where':{'id':_0x314843},'attributes':[_0x3b1a('0xe')]}});};exports[_0x3b1a('0x11')]=function(_0x438726){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x438726},'attributes':['name']}});};exports[_0x3b1a('0x12')]=function(_0x3dfeda){return request(_0x3b1a('0x13'),{'options':{'where':{'id':_0x3dfeda},'attributes':[_0x3b1a('0xe')]}});};exports['getSquareOdbcById']=function(_0x1b175e){return request(_0x3b1a('0x14'),{'options':{'where':{'id':_0x1b175e},'attributes':['dsn']}});};exports[_0x3b1a('0x15')]=function(_0x882ced){return request(_0x3b1a('0x16'),{'options':{'where':{'id':_0x882ced},'attributes':[_0x3b1a('0xe')]}});};exports[_0x3b1a('0x17')]=function(_0xf10b60){return request(_0x3b1a('0x18'),{'options':{'where':{'phone':_0xf10b60[_0x3b1a('0x19')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x14996f){return request(_0x3b1a('0x1a'),{'options':{'where':{'id':_0x14996f},'attributes':['name']}});};exports[_0x3b1a('0x1b')]=function(_0x5758fd){return request(_0x3b1a('0x1c'),{'options':{'where':{'id':_0x5758fd},'attributes':[_0x3b1a('0x1d')]}});};exports[_0x3b1a('0x1e')]=function(_0x3cb500){return request(_0x3b1a('0x1f'),{'options':{'raw':![],'where':{'id':_0x3cb500},'include':[{'model':_0x3b1a('0x20'),'as':'Intervals'}]}});};exports[_0x3b1a('0x21')]=function(_0x3f91ae){return request(_0x3b1a('0x22'),{'options':{'where':{'id':_0x3f91ae},'attributes':['id',_0x3b1a('0xe')]}});};exports[_0x3b1a('0x23')]=function(_0x4f5f52){return request('CreateSmsMessage',{'body':_0x4f5f52});};exports[_0x3b1a('0x24')]=function(_0x447d94){return request(_0x3b1a('0x25'),{'body':_0x447d94});};exports[_0x3b1a('0x26')]=function(_0x1728df){return request(_0x3b1a('0x27'),{'body':_[_0x3b1a('0x28')](_0x1728df,{'project_name':_0x1728df['arg_1'],'prev_project_name':_0x1728df[_0x3b1a('0x29')]||'','is_subproject':_0x1728df[_0x3b1a('0x29')]?!![]:![],'leaveAt':moment()[_0x3b1a('0x2a')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x3b1a('0x2b')]=function(_0x3744f0){return request(_0x3b1a('0x2c'),{'body':_0x3744f0});};exports[_0x3b1a('0x2d')]=function(_0x8c3bb6){return request(_0x3b1a('0x2e'),{'body':_0x8c3bb6});};exports['createCmContact']=function(_0x43049f){return request(_0x3b1a('0x2f'),{'options':{'raw':![],'where':{'phone':_0x43049f[_0x3b1a('0x19')],'ListId':_0x43049f[_0x3b1a('0x30')]}}})[_0x3b1a('0x5')](function(_0x1c6399){if(_0x1c6399){return _0x1c6399;}return request('CreateCmContact',{'body':_0x43049f});});};exports['getPauseById']=function(_0x44c0eb){return request(_0x3b1a('0x31'),{'options':{'where':{'id':_0x44c0eb},'attributes':[_0x3b1a('0xe')]}});};exports[_0x3b1a('0x32')]=function(_0x387ffa,_0xd6d630){return request(_0x3b1a('0x33'),{'body':{'interface':_0xd6d630},'options':{'where':_0x387ffa}});};exports[_0x3b1a('0x34')]=function(_0x22b748,_0x4cf242,_0x392f49){return request(_0x3b1a('0x35'),{'body':{'type':_0x4cf242,'uniqueid':_0x392f49},'options':{'where':_0x22b748}});};exports[_0x3b1a('0x36')]=function(_0x36631d){return request(_0x3b1a('0x37'),{'body':{},'options':{'where':_0x36631d}});};exports[_0x3b1a('0x38')]=function(_0x31befb){return request(_0x3b1a('0x39'),{'body':{},'options':{'where':_0x31befb}});}; \ No newline at end of file +var _0xea81=['MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','util','http','error','message','result','getSquareProject','ShowSquareProject','production'];(function(_0x277a2e,_0x30dd0e){var _0x4d9be4=function(_0x1b1db5){while(--_0x1b1db5){_0x277a2e['push'](_0x277a2e['shift']());}};_0x4d9be4(++_0x30dd0e);}(_0xea81,0x1ed));var _0x1ea8=function(_0xdb0ce1,_0x1db757){_0xdb0ce1=_0xdb0ce1-0x0;var _0x24fa8b=_0xea81[_0xdb0ce1];return _0x24fa8b;};'use strict';var BPromise=require(_0x1ea8('0x0'));var moment=require(_0x1ea8('0x1'));var _=require(_0x1ea8('0x2'));var util=require(_0x1ea8('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1ea8('0x4')]({'port':0x2329});function request(_0x8f20e2,_0x2e6a47){return new BPromise(function(_0x298375,_0x292a48){return client['request'](_0x8f20e2,_0x2e6a47)['then'](function(_0x5f4538){if(_0x5f4538[_0x1ea8('0x5')]){return _0x292a48(_0x5f4538[_0x1ea8('0x5')][_0x1ea8('0x6')]);}else{return _0x298375(_0x5f4538[_0x1ea8('0x7')]);}})['catch'](function(_0x1e2577){return _0x292a48(_0x1e2577);});});}exports[_0x1ea8('0x8')]=function(_0x35160b){return request(_0x1ea8('0x9'),{'options':{'raw':![],'where':{'name':_0x35160b},'attributes':[_0x1ea8('0xa')]}});};exports['getMailAccountById']=function(_0x5be789){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x5be789},'include':[{'model':_0x1ea8('0xb'),'as':_0x1ea8('0xc')}],'attributes':['id',_0x1ea8('0xd'),_0x1ea8('0xe')]}});};exports[_0x1ea8('0xf')]=function(_0x5b35ea){return request('ShowSquareProject',{'options':{'where':{'id':_0x5b35ea},'attributes':[_0x1ea8('0xd')]}});};exports[_0x1ea8('0x10')]=function(_0x4f543e){return request(_0x1ea8('0x11'),{'options':{'where':{'id':_0x4f543e},'attributes':[_0x1ea8('0xd')]}});};exports[_0x1ea8('0x12')]=function(_0x184601){return request(_0x1ea8('0x13'),{'options':{'where':{'id':_0x184601},'attributes':['name']}});};exports[_0x1ea8('0x14')]=function(_0x3f9156){return request(_0x1ea8('0x15'),{'options':{'where':{'id':_0x3f9156},'attributes':['dsn']}});};exports[_0x1ea8('0x16')]=function(_0x3a600c){return request('ShowUser',{'options':{'where':{'id':_0x3a600c},'attributes':['name']}});};exports[_0x1ea8('0x17')]=function(_0x4b80f9){return request(_0x1ea8('0x18'),{'options':{'where':{'phone':_0x4b80f9['phone']},'attributes':['id']}});};exports[_0x1ea8('0x19')]=function(_0x228391){return request(_0x1ea8('0x1a'),{'options':{'where':{'id':_0x228391},'attributes':[_0x1ea8('0xd')]}});};exports[_0x1ea8('0x1b')]=function(_0x8db288){return request(_0x1ea8('0x1c'),{'options':{'where':{'id':_0x8db288},'attributes':[_0x1ea8('0x1d')]}});};exports['getIntervalById']=function(_0x45db99){return request(_0x1ea8('0x1e'),{'options':{'raw':![],'where':{'id':_0x45db99},'include':[{'model':_0x1ea8('0x1f'),'as':_0x1ea8('0x20')}]}});};exports[_0x1ea8('0x21')]=function(_0x39fce5){return request(_0x1ea8('0x22'),{'options':{'where':{'id':_0x39fce5},'attributes':['id',_0x1ea8('0xd')]}});};exports[_0x1ea8('0x23')]=function(_0x247a47){return request('CreateSmsMessage',{'body':_0x247a47});};exports[_0x1ea8('0x24')]=function(_0x489180){return request(_0x1ea8('0x25'),{'body':_0x489180});};exports['createSquareReport']=function(_0x311e2e){return request('CreateSquareReport',{'body':_[_0x1ea8('0x26')](_0x311e2e,{'project_name':_0x311e2e['arg_1'],'prev_project_name':_0x311e2e['arg_2']||'','is_subproject':_0x311e2e[_0x1ea8('0x27')]?!![]:![],'leaveAt':moment()[_0x1ea8('0x28')](_0x1ea8('0x29'))})});};exports['createSquareRecording']=function(_0x5b3d5c){return request(_0x1ea8('0x2a'),{'body':_0x5b3d5c});};exports[_0x1ea8('0x2b')]=function(_0x34e04b){return request(_0x1ea8('0x2c'),{'body':_0x34e04b});};exports[_0x1ea8('0x2d')]=function(_0x140092){return request(_0x1ea8('0x2e'),{'options':{'raw':![],'where':{'phone':_0x140092['phone'],'ListId':_0x140092[_0x1ea8('0x2f')]}}})['then'](function(_0x6129d4){if(_0x6129d4){return _0x6129d4;}return request('CreateCmContact',{'body':_0x140092});});};exports[_0x1ea8('0x30')]=function(_0x1f605c){return request('ShowPause',{'options':{'where':{'id':_0x1f605c},'attributes':[_0x1ea8('0xd')]}});};exports[_0x1ea8('0x31')]=function(_0x3cb0bb,_0x3831c4){return request(_0x1ea8('0x32'),{'body':{'interface':_0x3831c4},'options':{'where':_0x3cb0bb}});};exports[_0x1ea8('0x33')]=function(_0x37cac7,_0x33d7c8,_0x1091c2){return request(_0x1ea8('0x34'),{'body':{'type':_0x33d7c8,'uniqueid':_0x1091c2},'options':{'where':_0x37cac7}});};exports[_0x1ea8('0x35')]=function(_0x39eb2d){return request(_0x1ea8('0x36'),{'body':{},'options':{'where':_0x39eb2d}});};exports[_0x1ea8('0x37')]=function(_0x43023f){return request('LogoutUser',{'body':{},'options':{'where':_0x43023f}});}; \ 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 da2b815..67eaafc 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 _0x77a9=['./polly','exports'];(function(_0x4c1e63,_0x4309f8){var _0x484e5b=function(_0x1b6bf3){while(--_0x1b6bf3){_0x4c1e63['push'](_0x4c1e63['shift']());}};_0x484e5b(++_0x4309f8);}(_0x77a9,0x19e));var _0x977a=function(_0x8b78fe,_0x3e9ddd){_0x8b78fe=_0x8b78fe-0x0;var _0x284866=_0x77a9[_0x8b78fe];return _0x284866;};var polly=require(_0x977a('0x0'));var lex=require('./lex');module[_0x977a('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x1354=['./lex','exports','./polly'];(function(_0x24e2fe,_0x17b452){var _0x349218=function(_0x26428c){while(--_0x26428c){_0x24e2fe['push'](_0x24e2fe['shift']());}};_0x349218(++_0x17b452);}(_0x1354,0x95));var _0x4135=function(_0x53874d,_0x522af1){_0x53874d=_0x53874d-0x0;var _0x391c4e=_0x1354[_0x53874d];return _0x391c4e;};var polly=require(_0x4135('0x0'));var lex=require(_0x4135('0x1'));module[_0x4135('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 4d1f9d1..a1eb364 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 _0x96cc=['./lib/api'];(function(_0x518460,_0x363e34){var _0x2b12b2=function(_0x1fd119){while(--_0x1fd119){_0x518460['push'](_0x518460['shift']());}};_0x2b12b2(++_0x363e34);}(_0x96cc,0x16c));var _0xc96c=function(_0x461467,_0x81d0dd){_0x461467=_0x461467-0x0;var _0x5c47da=_0x96cc[_0x461467];return _0x5c47da;};'use strict';var lex=require(_0xc96c('0x0'));module['exports']=function(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701){return lex(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701);}; \ No newline at end of file +var _0x6c76=['./lib/api','exports'];(function(_0x2f811f,_0x493ebc){var _0x41f3a3=function(_0x324ed5){while(--_0x324ed5){_0x2f811f['push'](_0x2f811f['shift']());}};_0x41f3a3(++_0x493ebc);}(_0x6c76,0x184));var _0x66c7=function(_0x513d80,_0x1649db){_0x513d80=_0x513d80-0x0;var _0x174463=_0x6c76[_0x513d80];return _0x174463;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ 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 d14662d..b7b60ac 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(_0x2008c9,_0x2ba02a){var _0x50b239=function(_0xc96ddc){while(--_0xc96ddc){_0x2008c9['push'](_0x2008c9['shift']());}};_0x50b239(++_0x2ba02a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x551c90,_0x366b9b){var _0x1ae2ae=function(_0x467b7e){while(--_0x467b7e){_0x551c90['push'](_0x551c90['shift']());}};_0x1ae2ae(++_0x366b9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 b212e4c..c4865a9 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 _0x654b=['exports','./lib/api'];(function(_0x1e5db8,_0x44ef41){var _0x219a51=function(_0x5b86a3){while(--_0x5b86a3){_0x1e5db8['push'](_0x1e5db8['shift']());}};_0x219a51(++_0x44ef41);}(_0x654b,0x183));var _0xb654=function(_0x57db4c,_0x8f9084){_0x57db4c=_0x57db4c-0x0;var _0x1758f2=_0x654b[_0x57db4c];return _0x1758f2;};'use strict';var polly=require(_0xb654('0x0'));module[_0xb654('0x1')]=function(_0x20e1c0,_0xe046e,_0x51609e,_0x485c89,_0x595f3e,_0x294d05,_0x84fa9e){return polly(_0x20e1c0,_0xe046e,_0x51609e,_0x485c89,_0x595f3e,_0x294d05,_0x84fa9e);}; \ No newline at end of file +var _0x04a4=['./lib/api'];(function(_0x1621dd,_0x172229){var _0x3b0046=function(_0x53ab32){while(--_0x53ab32){_0x1621dd['push'](_0x1621dd['shift']());}};_0x3b0046(++_0x172229);}(_0x04a4,0x153));var _0x404a=function(_0x291226,_0x171993){_0x291226=_0x291226-0x0;var _0x270b04=_0x04a4[_0x291226];return _0x270b04;};'use strict';var polly=require(_0x404a('0x0'));module['exports']=function(_0x394099,_0xaa7789,_0x75279b,_0x4faa30,_0x2bfcac,_0x378feb,_0x120636){return polly(_0x394099,_0xaa7789,_0x75279b,_0x4faa30,_0x2bfcac,_0x378feb,_0x120636);}; \ 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 a49af06..55ea336 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 _0x9612=['randomstring','synthesizeSpeech','AudioStream','text','mp3','path','bluebird'];(function(_0x5790d6,_0x58cc3e){var _0x12b714=function(_0x2b0017){while(--_0x2b0017){_0x5790d6['push'](_0x5790d6['shift']());}};_0x12b714(++_0x58cc3e);}(_0x9612,0x11d));var _0x2961=function(_0x1ca107,_0xcfa92){_0x1ca107=_0x1ca107-0x0;var _0x4fe197=_0x9612[_0x1ca107];return _0x4fe197;};'use strict';var fs=require('fs');var path=require(_0x2961('0x0'));var BPromise=require(_0x2961('0x1'));var rs=require(_0x2961('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x2f3d05,_0x1c588f,_0x447e18){return new BPromise(function(_0x27273d,_0x252c6a){_0x2f3d05[_0x2961('0x3')](_0x1c588f,function(_0x3705ca,_0xcb3351){if(_0x3705ca){_0x252c6a(_0x3705ca);}else if(_0xcb3351){if(_0xcb3351['AudioStream']instanceof Buffer){fs['writeFile'](_0x447e18,_0xcb3351[_0x2961('0x4')],function(_0x576a38){if(_0x576a38){_0x252c6a(_0x576a38);}else{_0x27273d();}});}else{_0x252c6a(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x252c6a(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x362a0f,_0xb63cd1,_0x227a85,_0x1fbd2f,_0x5319c9,_0x1dcd96,_0x4170ee){var _0x1bab2b=new AWS['Polly']({'accessKeyId':_0x362a0f,'secretAccessKey':_0xb63cd1,'region':_0x227a85});var _0x456cec={'Text':_0x5319c9,'TextType':_0x1dcd96||_0x2961('0x5'),'OutputFormat':_0x2961('0x6'),'VoiceId':_0x1fbd2f};return pollyResult(_0x1bab2b,_0x456cec,_0x4170ee);}; \ No newline at end of file +var _0x8519=['text','mp3','bluebird','aws-sdk','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x2fa963,_0x1adee8){var _0x328634=function(_0x3b39e8){while(--_0x3b39e8){_0x2fa963['push'](_0x2fa963['shift']());}};_0x328634(++_0x1adee8);}(_0x8519,0xe3));var _0x9851=function(_0x2d1e18,_0x40162e){_0x2d1e18=_0x2d1e18-0x0;var _0x2f99dc=_0x8519[_0x2d1e18];return _0x2f99dc;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x9851('0x0'));var rs=require('randomstring');var AWS=require(_0x9851('0x1'));function pollyResult(_0x2f44e0,_0x3aecd4,_0x27f227){return new BPromise(function(_0xb39b1,_0x2fdbd0){_0x2f44e0[_0x9851('0x2')](_0x3aecd4,function(_0x24f277,_0x123f5e){if(_0x24f277){_0x2fdbd0(_0x24f277);}else if(_0x123f5e){if(_0x123f5e[_0x9851('0x3')]instanceof Buffer){fs['writeFile'](_0x27f227,_0x123f5e[_0x9851('0x3')],function(_0xfdd575){if(_0xfdd575){_0x2fdbd0(_0xfdd575);}else{_0xb39b1();}});}else{_0x2fdbd0(new Error(_0x9851('0x4')));}}else{_0x2fdbd0(new Error(_0x9851('0x5')));}});});}module[_0x9851('0x6')]=function(_0x39a9c3,_0x290f3b,_0x2f7f79,_0x250928,_0x39dcae,_0x215dee,_0x5ee971){var _0x3d97e6=new AWS['Polly']({'accessKeyId':_0x39a9c3,'secretAccessKey':_0x290f3b,'region':_0x2f7f79});var _0x324a42={'Text':_0x39dcae,'TextType':_0x215dee||_0x9851('0x7'),'OutputFormat':_0x9851('0x8'),'VoiceId':_0x250928};return pollyResult(_0x3d97e6,_0x324a42,_0x5ee971);}; \ 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 3a1881b..6dbbc14 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 _0x4fcc=['exports','./lib/api'];(function(_0x2fe5fa,_0x528194){var _0x47a039=function(_0x30241a){while(--_0x30241a){_0x2fe5fa['push'](_0x2fe5fa['shift']());}};_0x47a039(++_0x528194);}(_0x4fcc,0x1d9));var _0xc4fc=function(_0x312f73,_0x4e49e7){_0x312f73=_0x312f73-0x0;var _0x43d00d=_0x4fcc[_0x312f73];return _0x43d00d;};'use strict';var asr=require(_0xc4fc('0x0'));module[_0xc4fc('0x1')]=function(_0x5ebd3b,_0x58a55c,_0x5c9095,_0x5f01f7){return asr(_0x5ebd3b,_0x58a55c,_0x5c9095);}; \ No newline at end of file +var _0x3681=['./lib/api'];(function(_0x4e389e,_0x517372){var _0x5e0cdd=function(_0x2f6ef7){while(--_0x2f6ef7){_0x4e389e['push'](_0x4e389e['shift']());}};_0x5e0cdd(++_0x517372);}(_0x3681,0x1e2));var _0x1368=function(_0x577946,_0x41edb9){_0x577946=_0x577946-0x0;var _0x7dc722=_0x3681[_0x577946];return _0x7dc722;};'use strict';var asr=require(_0x1368('0x0'));module['exports']=function(_0x5996c4,_0x58ef47,_0xe530a2,_0x254b40){return asr(_0x5996c4,_0x58ef47,_0xe530a2);}; \ 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 c75b391..c0a6bc5 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 _0xd49c=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','exports','string','length'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0xd49c,0x1d8));var _0xcd49=function(_0x2964e2,_0x1dbe2d){_0x2964e2=_0x2964e2-0x0;var _0x4c16cc=_0xd49c[_0x2964e2];return _0x4c16cc;};'use strict';var url=require('url');var BPromise=require(_0xcd49('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xcd49('0x1')]=function(_0x190db1,_0x5bda72,_0x1181d4){return new BPromise(function(_0x52362d,_0x3a3034){var _0x4c36ab;if(typeof _0x190db1!==_0xcd49('0x2')||_0x190db1[_0xcd49('0x3')]===0x0){return _0x3a3034(_0xcd49('0x4'));}if(typeof _0x5bda72!==_0xcd49('0x2')||_0x5bda72[_0xcd49('0x3')]===0x0){return _0x3a3034(_0xcd49('0x5'));}if(typeof _0x1181d4!==_0xcd49('0x6')&&(typeof _0x1181d4!==_0xcd49('0x2')||_0x1181d4[_0xcd49('0x3')]===0x0)){return _0x3a3034(_0xcd49('0x7'));}try{_0x4c36ab=fs[_0xcd49('0x8')](_0x190db1)['toString'](_0xcd49('0x9'));}catch(_0x14dd47){return _0x3a3034(_0x14dd47);}return _0x52362d({'method':_0xcd49('0xa'),'uri':host+_0xcd49('0xb')+_0x5bda72,'body':{'config':{'encoding':_0xcd49('0xc'),'sampleRateHertz':_0xcd49('0xd'),'languageCode':_0x1181d4},'audio':{'content':_0x4c36ab}},'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(_0x89e63d,_0x418dfb){var _0x2c53e7=function(_0x5743ac){while(--_0x5743ac){_0x89e63d['push'](_0x89e63d['shift']());}};_0x2c53e7(++_0x418dfb);}(_0x750a,0x140));var _0xa750=function(_0x372888,_0x44063f){_0x372888=_0x372888-0x0;var _0x31ce8d=_0x750a[_0x372888];return _0x31ce8d;};'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 1722e79..91ee6f5 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 _0x3056=['exports','./asr'];(function(_0x1e4577,_0xbad8a1){var _0x4da555=function(_0x68c245){while(--_0x68c245){_0x1e4577['push'](_0x1e4577['shift']());}};_0x4da555(++_0xbad8a1);}(_0x3056,0x163));var _0x6305=function(_0x81124b,_0x58b268){_0x81124b=_0x81124b-0x0;var _0x3dd40a=_0x3056[_0x81124b];return _0x3dd40a;};var asr=require(_0x6305('0x0'));module[_0x6305('0x1')]={'asr':asr}; \ No newline at end of file +var _0x0ae3=['./asr','exports'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x0ae3,0xe8));var _0x30ae=function(_0x36ee53,_0x222d7c){_0x36ee53=_0x36ee53-0x0;var _0x1c2a34=_0x0ae3[_0x36ee53];return _0x1c2a34;};var asr=require(_0x30ae('0x0'));module[_0x30ae('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 6170e2e..aa1e6f5 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 _0x8b05=['.wav','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','data','goggleTTS\x20path','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','name','message','googleDialogflow','source','result','action','fulfillment','speech','status','code','metadata','endConversation','googleDialogflowV2','replace','sessionPath','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','randomstring','parse','util','./aws','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','https:','wav','finish\x20to\x20convert','tmp','generate','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','input','voice','audioConfig','MP3','POST','then','resolve','.mp3','from','audioContent','writeFile'];(function(_0x5713ff,_0x50accd){var _0xa68776=function(_0x2b6d84){while(--_0x2b6d84){_0x5713ff['push'](_0x5713ff['shift']());}};_0xa68776(++_0x50accd);}(_0x8b05,0x1cf));var _0x58b0=function(_0x1fd921,_0x56f7b9){_0x1fd921=_0x1fd921-0x0;var _0x180b82=_0x8b05[_0x1fd921];return _0x180b82;};'use strict';var apiai=require(_0x58b0('0x0'));var BPromise=require(_0x58b0('0x1'));var dialogflow=require(_0x58b0('0x2'));var fs=require('fs');var http=require(_0x58b0('0x3'));var https=require(_0x58b0('0x4'));var md5=require(_0x58b0('0x5'));var path=require(_0x58b0('0x6'));var querystring=require(_0x58b0('0x7'));var rp=require('request-promise');var rs=require(_0x58b0('0x8'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require('url')[_0x58b0('0x9')];var util=require(_0x58b0('0xa'));var aws=require(_0x58b0('0xb'));var google=require('./google');var sestek=require(_0x58b0('0xc'));var tilde=require(_0x58b0('0xd'));var logger=require(_0x58b0('0xe'))('agi');var ISPEECH_API=_0x58b0('0xf');function downloadFile(_0x466d78,_0x1e38a7){return new BPromise(function(_0x372237,_0x1406fb){var _0x5946bc=urlParse(_0x466d78);var _0x18b582=_0x5946bc[_0x58b0('0x10')]==='https:'?https:http;var _0x1735bd={'host':_0x5946bc[_0x58b0('0x11')],'path':_0x5946bc[_0x58b0('0x6')],'headers':{'user-agent':_0x58b0('0x12')}};_0x18b582[_0x58b0('0x13')](_0x1735bd,function(_0x5e0d14){if(_0x5e0d14[_0x58b0('0x14')]!==0xc8){logger[_0x58b0('0x15')](_0x58b0('0x16')+_0x466d78+_0x58b0('0x17')+_0x5e0d14['statusCode']+'\x20('+_0x5e0d14['statusMessage']+')');_0x1406fb(new Error(_0x58b0('0x16')+_0x466d78+'\x20failed,\x20status\x20code\x20=\x20'+_0x5e0d14[_0x58b0('0x14')]+'\x20('+_0x5e0d14[_0x58b0('0x18')]+')'));return;}var _0x23ece2=fs[_0x58b0('0x19')](_0x1e38a7);_0x23ece2['on']('finish',function(){logger[_0x58b0('0x1a')](_0x58b0('0x1b'));_0x23ece2['close'](_0x372237);});_0x23ece2['on']('error',function(_0x12a512){fs[_0x58b0('0x1c')](_0x1e38a7);logger['error'](_0x58b0('0x1d'),_0x12a512);_0x1406fb(_0x12a512);});_0x5e0d14[_0x58b0('0x1e')](_0x23ece2);})['on'](_0x58b0('0x15'),function(_0x785742){logger[_0x58b0('0x15')](_0x785742);_0x1406fb(_0x785742);})[_0x58b0('0x1f')]();});}function uploadFile(_0x4f9815){return new BPromise(function(_0x43d340,_0x396bf0){var _0x5899a7=urlParse(_0x4f9815);var _0x31ff6f=_0x5899a7[_0x58b0('0x10')]===_0x58b0('0x20')?https:http;var _0x375c93={'host':_0x5899a7[_0x58b0('0x11')],'path':_0x5899a7[_0x58b0('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x31ff6f['get'](_0x375c93,function(_0x391a9b){if(_0x391a9b[_0x58b0('0x14')]!==0xc8){_0x396bf0(new Error(_0x58b0('0x16')+_0x4f9815+_0x58b0('0x17')+_0x391a9b[_0x58b0('0x14')]+'\x20('+_0x391a9b[_0x58b0('0x18')]+')'));return;}var _0x3db8b8='';_0x391a9b['on']('data',function(_0x2e4024){_0x3db8b8+=_0x2e4024;});_0x391a9b['on'](_0x58b0('0x1f'),function(){_0x43d340(_0x3db8b8);});})['on'](_0x58b0('0x15'),function(_0x37bb2b){_0x396bf0(_0x37bb2b);})[_0x58b0('0x1f')]();});}function convertFile(_0x517edd,_0x1f7be8){return new BPromise(function(_0x3fb9cc,_0xdda285){var _0x4e6360=sox['transcode'](_0x517edd,_0x1f7be8,{'sampleRate':0x1f40,'format':_0x58b0('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4e6360['on'](_0x58b0('0x15'),function(_0x3d1ae2){logger[_0x58b0('0x15')]('error\x20convert',_0x3d1ae2);_0xdda285(_0x3d1ae2);});_0x4e6360['on'](_0x58b0('0x1f'),function(){logger[_0x58b0('0x1a')](_0x58b0('0x22'));_0x3fb9cc();});_0x4e6360['start']();});}function base64Decode(_0x39b2a5,_0x31d3ac){var _0x2fa372=path['resolve'](__dirname,_0x58b0('0x23'),rs[_0x58b0('0x24')](0x4)+'.wav');fs[_0x58b0('0x25')](_0x2fa372,_0x39b2a5,_0x58b0('0x26'));return convertFile(_0x2fa372,_0x31d3ac)['then'](function(){try{fs['unlink'](_0x2fa372);fs[_0x58b0('0x27')](_0x31d3ac,_0x58b0('0x28'));}catch(_0x3321f8){logger[_0x58b0('0x15')](_0x3321f8);}return _0x31d3ac[_0x58b0('0x29')]('.')[0x0];});}function base64Encode(_0x17ab46){var _0x122e38=fs[_0x58b0('0x2a')](_0x17ab46);return new Buffer(_0x122e38)[_0x58b0('0x2b')](_0x58b0('0x26'));}exports[_0x58b0('0x2c')]=function(_0x22290a,_0x117d78,_0x5d3471,_0x4ee602,_0x313cb0,_0x2c7d60){var _0x4e1b61,_0xff750a;var _0x5e9b83='https://texttospeech.googleapis.com/v1/';var _0x165f3a=_0x58b0('0x2d')+_0x22290a;var _0x1f7a67={};if(_0x117d78==='ssml'){_0x1f7a67[_0x58b0('0x2e')]={'ssml':_0x5d3471};}else{_0x1f7a67[_0x58b0('0x2e')]={'text':_0x5d3471};};_0x1f7a67[_0x58b0('0x2f')]={'languageCode':_0x4ee602,'ssmlGender':_0x313cb0};_0x1f7a67[_0x58b0('0x30')]={'audioEncoding':_0x58b0('0x31'),'sampleRateHertz':0x1f40};var _0x4daee3={'url':_0x5e9b83+'text:synthesize'+_0x165f3a,'method':_0x58b0('0x32'),'json':!![],'body':_0x1f7a67};return rp(_0x4daee3)[_0x58b0('0x33')](function(_0x46824f){return new BPromise(function(_0x4f6eab,_0x4fb11d){_0x4e1b61=path[_0x58b0('0x34')](__dirname,_0x58b0('0x23'),rs[_0x58b0('0x24')](0x4)+_0x58b0('0x35'));var _0x226fd8=Buffer[_0x58b0('0x36')](_0x46824f[_0x58b0('0x37')],'base64');return fs[_0x58b0('0x38')](_0x4e1b61,_0x226fd8,function(_0x4390b7){_0x4fb11d(_0x4390b7);},function(_0x2526fb){fs[_0x58b0('0x27')](_0x4e1b61,_0x58b0('0x28'));_0x4f6eab(_0x2526fb);});});})[_0x58b0('0x33')](function(_0x30b4ee){_0xff750a=path[_0x58b0('0x34')](__dirname,_0x58b0('0x23'),rs[_0x58b0('0x24')](0x4)+_0x58b0('0x39'));return convertFile(_0x4e1b61,_0xff750a);})['then'](function(){try{fs['unlink'](_0x4e1b61);fs[_0x58b0('0x27')](_0xff750a,_0x58b0('0x28'));}catch(_0x4d871c){logger[_0x58b0('0x15')](_0x4d871c);}logger[_0x58b0('0x1a')](_0x58b0('0x3a'),_0xff750a[_0x58b0('0x29')]('.')[0x0]);return _0xff750a[_0x58b0('0x29')]('.')[0x0];});};exports[_0x58b0('0x3b')]=function(_0x3a543b,_0x2e0b18){var _0x550eb4=_0x58b0('0x3c');var _0x39ee46,_0x55c3f;var _0x412f83;var _0x71112={'encoding':_0x58b0('0x3d'),'method':_0x58b0('0x32'),'timeout':0x2710,'url':_0x550eb4,'headers':{'Content-Type':_0x58b0('0x3e')},'body':_0x58b0('0x3f')+encodeURIComponent(JSON['stringify']([[[_0x58b0('0x40'),JSON[_0x58b0('0x41')]([_0x3a543b,_0x2e0b18||'en',![],_0x58b0('0x42')]),null,'generic']]]))};return rp(_0x71112)[_0x58b0('0x33')](function(_0x35080d){try{_0x412f83=eval(_0x35080d[_0x58b0('0x43')](0x5))[0x0][0x2];}catch(_0x50ae36){throw new Error(_0x58b0('0x44')+_0x35080d['data']);}if(!_0x412f83){if(_0x3a543b[_0x58b0('0x45')]>0xc8){throw new Error(_0x58b0('0x46'));}else{throw new Error(_0x58b0('0x47')+_0x2e0b18+_0x58b0('0x48'));}}try{_0x412f83=eval(_0x412f83)[0x0];}catch(_0x34d03d){throw new Error(_0x58b0('0x44')+res[_0x58b0('0x49')]);}const _0x48762e=_0x412f83;_0x39ee46=path[_0x58b0('0x34')](__dirname,_0x58b0('0x23'),rs['generate'](0x4)+_0x58b0('0x35'));fs[_0x58b0('0x25')](_0x39ee46,_0x412f83,{'encoding':_0x58b0('0x26')});_0x55c3f=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x58b0('0x39'));return convertFile(_0x39ee46,_0x55c3f);})[_0x58b0('0x33')](function(){try{fs[_0x58b0('0x1c')](_0x39ee46);fs['chmodSync'](_0x55c3f,_0x58b0('0x28'));}catch(_0x36861b){logger[_0x58b0('0x15')](_0x36861b);}logger[_0x58b0('0x1a')](_0x58b0('0x4a'),_0x55c3f[_0x58b0('0x29')]('.')[0x0]);return _0x55c3f[_0x58b0('0x29')]('.')[0x0];});};exports['googleASR']=function(_0xf4583f,_0x4d5627,_0x43c0f0){return google['asr'](_0xf4583f,_0x4d5627,_0x43c0f0)['then'](function(_0x25c3fa){logger[_0x58b0('0x1a')](_0x25c3fa[_0x58b0('0x4b')]);return rp(_0x25c3fa);})['then'](function(_0x1dd3d0){var _0x471739='';var _0x434507=0x0;try{fs[_0x58b0('0x1c')](_0xf4583f);}catch(_0x3cc43a){logger[_0x58b0('0x15')](_0x3cc43a);}if(_0x1dd3d0&&_0x1dd3d0[_0x58b0('0x4c')]){_0x471739=_0x1dd3d0['results'][_0x58b0('0x4d')](function(_0x2eb281){return _0x2eb281&&_0x2eb281[_0x58b0('0x4e')][0x0]&&_0x2eb281[_0x58b0('0x4e')][0x0]['transcript']?_0x2eb281[_0x58b0('0x4e')][0x0][_0x58b0('0x4f')]:'';})['join']('\x0a');_0x434507=_0x1dd3d0[_0x58b0('0x4c')][_0x58b0('0x4d')](function(_0x405706){return _0x405706&&_0x405706[_0x58b0('0x4e')][0x0]&&_0x405706['alternatives'][0x0][_0x58b0('0x50')]?_0x405706['alternatives'][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x58b0('0x1a')](_0x58b0('0x51'),_0x471739);logger[_0x58b0('0x1a')](_0x58b0('0x52'),_0x434507);return{'transcript':_0x471739,'confidence':_0x434507};})['catch'](function(_0x1fd72c){logger['error']('[%s]\x20%s:%s',_0x1fd72c[_0x58b0('0x14')],_0x1fd72c[_0x58b0('0x53')],_0x1fd72c[_0x58b0('0x54')]);});};exports[_0x58b0('0x55')]=function(_0x4f3fff,_0x12a87d,_0x38fbc6,_0x57ef49){var _0x293f6e=apiai(_0x12a87d,{'language':_0x57ef49||'en'});return _0x293f6e['textRequest'](_0x38fbc6,{'sessionId':md5(_0x4f3fff)})[_0x58b0('0x33')](function(_0x101d10){logger[_0x58b0('0x1a')](JSON['stringify'](_0x101d10));return{'source':_0x101d10['result'][_0x58b0('0x56')],'resolvedQuery':_0x101d10[_0x58b0('0x57')]['resolvedQuery'],'action':_0x101d10[_0x58b0('0x57')][_0x58b0('0x58')],'actionIncomplete':_0x101d10[_0x58b0('0x57')]['actionIncomplete'],'speech':_0x101d10['result'][_0x58b0('0x59')][_0x58b0('0x5a')],'score':_0x101d10[_0x58b0('0x57')]['score'],'statusCode':_0x101d10[_0x58b0('0x5b')][_0x58b0('0x5c')],'endConversation':_0x101d10[_0x58b0('0x57')][_0x58b0('0x5d')][_0x58b0('0x5e')]||![],'isFallbackIntent':_0x101d10[_0x58b0('0x57')][_0x58b0('0x5d')]['isFallbackIntent']};});};exports[_0x58b0('0x5f')]=function(_0x3a4eb4,_0x54d005,_0x4aedbf,_0x5eff39,_0x137f21,_0x404611){var _0x40ef08=_0x5eff39[_0x58b0('0x60')](/\\n/g,'\x0a');var _0x2cf19e={'credentials':{'private_key':_0x40ef08,'client_email':_0x4aedbf}};var _0x538765=new dialogflow['SessionsClient'](_0x2cf19e);var _0x42225b=_0x538765[_0x58b0('0x61')](_0x54d005,md5(_0x3a4eb4));var _0x3b52f8={'session':_0x42225b,'queryInput':{'text':{'text':_0x137f21,'languageCode':_0x404611}}};return _0x538765['detectIntent'](_0x3b52f8)[_0x58b0('0x33')](function(_0x16221b){if(_0x16221b&&_0x16221b[_0x58b0('0x45')]){logger[_0x58b0('0x1a')]('Dialogflow\x20V2\x20response:',JSON[_0x58b0('0x41')](_0x16221b));var _0x3de7ca=_0x16221b[0x0];if(_0x3de7ca){var _0xd87a7b={'action':_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x58')],'allRequiredParamsPresent':_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x63')],'endConversation':_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x64')]&&_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x64')]['fields']?_0x3de7ca['queryResult']['diagnosticInfo'][_0x58b0('0x65')][_0x58b0('0x66')][_0x58b0('0x67')]:![],'fulfillmentText':_0x3de7ca['queryResult'][_0x58b0('0x68')],'intentName':_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x69')][_0x58b0('0x53')],'intentDisplayName':_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x69')][_0x58b0('0x6a')],'isFallbackIntent':_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x69')][_0x58b0('0x6b')],'languageCode':_0x3de7ca[_0x58b0('0x62')]['languageCode'],'queryText':_0x3de7ca['queryResult'][_0x58b0('0x6c')],'responseId':_0x3de7ca[_0x58b0('0x6d')],'score':_0x3de7ca[_0x58b0('0x62')]['intentDetectionConfidence'],'speech':_0x3de7ca[_0x58b0('0x62')][_0x58b0('0x68')],'providerResponse':JSON[_0x58b0('0x41')](_0x16221b)};return _0xd87a7b;}}});};exports[_0x58b0('0x6e')]=function(_0x4ab27a,_0x375f4f,_0x4eff61,_0x19ee74){return tilde['asr'](_0x4ab27a,_0x375f4f,_0x4eff61,_0x19ee74)[_0x58b0('0x33')](function(_0x5bf769){try{fs[_0x58b0('0x1c')](_0x4ab27a);}catch(_0x3eadd9){logger['error'](_0x3eadd9);}logger[_0x58b0('0x1a')](_0x58b0('0x6f'),_0x5bf769[_0x58b0('0x4f')]);logger[_0x58b0('0x1a')](_0x58b0('0x70'),_0x5bf769[_0x58b0('0x50')]);return _0x5bf769;});};exports[_0x58b0('0x71')]=function(_0x4eb585,_0x29c9ed,_0x52f078,_0x169e14,_0x22525e,_0x31d853){var _0x29bd4c=path[_0x58b0('0x34')](__dirname,_0x58b0('0x23'),rs[_0x58b0('0x24')](0x4)+_0x58b0('0x35'));var _0x48eb58;return aws[_0x58b0('0x72')](_0x4eb585,_0x29c9ed,_0x52f078,_0x169e14,_0x22525e,_0x31d853,_0x29bd4c)[_0x58b0('0x33')](function(){_0x48eb58=path['resolve'](__dirname,'tmp',rs[_0x58b0('0x24')](0x4)+_0x58b0('0x39'));return convertFile(_0x29bd4c,_0x48eb58);})[_0x58b0('0x33')](function(){try{fs[_0x58b0('0x1c')](_0x29bd4c);fs[_0x58b0('0x27')](_0x48eb58,'777');}catch(_0x4a64bf){logger[_0x58b0('0x15')](_0x4a64bf);}return _0x48eb58[_0x58b0('0x29')]('.')[0x0];});};exports[_0x58b0('0x73')]=function(_0x311ab4,_0x78a251,_0x950f53,_0x1013fb,_0x5ca489,_0x5bb700){return aws[_0x58b0('0x74')](_0x311ab4,_0x78a251,_0x950f53,_0x1013fb,_0x5ca489,_0x5bb700)[_0x58b0('0x33')](function(_0x2c5496){logger[_0x58b0('0x1a')](JSON[_0x58b0('0x41')](_0x2c5496));return _0x2c5496;});};exports[_0x58b0('0x75')]=function(_0x4eb1bc,_0x52f016,_0x441f2e,_0x53cad3){var _0x14e4ec=util['format'](_0x58b0('0x76'),ISPEECH_API,_0x4eb1bc,encodeURIComponent(_0x52f016),_0x441f2e,_0x53cad3);var _0x1f3f52=path[_0x58b0('0x34')](__dirname,_0x58b0('0x23'),rs[_0x58b0('0x24')](0x4)+_0x58b0('0x35'));var _0x329458;return downloadFile(_0x14e4ec,_0x1f3f52)[_0x58b0('0x33')](function(){_0x329458=path['resolve'](__dirname,_0x58b0('0x23'),rs[_0x58b0('0x24')](0x4)+_0x58b0('0x39'));return convertFile(_0x1f3f52,_0x329458);})[_0x58b0('0x33')](function(){try{fs[_0x58b0('0x1c')](_0x1f3f52);fs['chmodSync'](_0x329458,_0x58b0('0x28'));}catch(_0x2d8768){logger[_0x58b0('0x15')](_0x2d8768);}return _0x329458[_0x58b0('0x29')]('.')[0x0];});};exports['ispeechASR']=function(_0x30f409,_0x157ca5,_0x28301d,_0x10e8cd){var _0x408e51=util[_0x58b0('0x77')](_0x58b0('0x78'),ISPEECH_API,_0x157ca5,_0x28301d,base64Encode(_0x30f409),_0x10e8cd?util[_0x58b0('0x77')]('model=%s',encodeURIComponent(_0x10e8cd)):_0x58b0('0x79'));return uploadFile(_0x408e51)['then'](function(_0x392c11){return querystring['parse'](_0x392c11);});};exports['sestekNDA']=function(_0x5f54fe,_0x476981){return sestek[_0x58b0('0x7a')](_0x5f54fe,_0x476981)[_0x58b0('0x33')](function(_0x545cca){logger[_0x58b0('0x1a')](JSON[_0x58b0('0x41')](_0x545cca));var _0x39a2c2={'speech':_0x545cca[_0x58b0('0x7b')],'action':_0x545cca[_0x58b0('0x7c')]?_0x545cca[_0x58b0('0x7c')]['CustomAction']:undefined,'actiondata':_0x545cca[_0x58b0('0x7c')]?_0x545cca[_0x58b0('0x7c')][_0x58b0('0x7d')]:undefined};if(_0x545cca[_0x58b0('0x7c')]&&_0x545cca[_0x58b0('0x7c')][_0x58b0('0x7e')]){return base64Decode(_0x545cca[_0x58b0('0x7c')][_0x58b0('0x7e')][_0x58b0('0x7f')],path[_0x58b0('0x34')](__dirname,_0x58b0('0x23'),rs[_0x58b0('0x24')](0x4)+_0x58b0('0x39')))[_0x58b0('0x33')](function(_0x52452c){_0x39a2c2[_0x58b0('0x80')]=_0x52452c;return _0x39a2c2;});}return _0x39a2c2;});};exports[_0x58b0('0x81')]=function(){return __dirname;}; \ No newline at end of file +var _0xd1ee=['goggleTTS\x20path','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','md5','querystring','request-promise','sox','google-tts-api','util','./aws','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','createWriteStream','finish\x20download\x20file','unlink','download\x20error','pipe','end','https:','path','statusMessage','data','transcode','wav','info','finish\x20to\x20convert','start','resolve','tmp','generate','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','.mp3','from','audioContent','writeFile','.wav','then','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync'];(function(_0x15a45e,_0x7c6f59){var _0x15d82d=function(_0x3ec8be){while(--_0x3ec8be){_0x15a45e['push'](_0x15a45e['shift']());}};_0x15d82d(++_0x7c6f59);}(_0xd1ee,0x1dc));var _0xed1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ee[_0x3dd15e];return _0x231fd0;};'use strict';var apiai=require(_0xed1e('0x0'));var BPromise=require(_0xed1e('0x1'));var dialogflow=require(_0xed1e('0x2'));var fs=require('fs');var http=require(_0xed1e('0x3'));var https=require('https');var md5=require(_0xed1e('0x4'));var path=require('path');var querystring=require(_0xed1e('0x5'));var rp=require(_0xed1e('0x6'));var rs=require('randomstring');var sox=require(_0xed1e('0x7'));var tts=require(_0xed1e('0x8'));var urlParse=require('url')['parse'];var util=require(_0xed1e('0x9'));var aws=require(_0xed1e('0xa'));var google=require('./google');var sestek=require(_0xed1e('0xb'));var tilde=require('./tilde');var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0xed1e('0xc');function downloadFile(_0x4f495a,_0x4f55dd){return new BPromise(function(_0x541d67,_0x250271){var _0x49a747=urlParse(_0x4f495a);var _0x36319c=_0x49a747['protocol']==='https:'?https:http;var _0x1dc6c6={'host':_0x49a747[_0xed1e('0xd')],'path':_0x49a747['path'],'headers':{'user-agent':_0xed1e('0xe')}};_0x36319c[_0xed1e('0xf')](_0x1dc6c6,function(_0x2a649d){if(_0x2a649d['statusCode']!==0xc8){logger[_0xed1e('0x10')](_0xed1e('0x11')+_0x4f495a+_0xed1e('0x12')+_0x2a649d[_0xed1e('0x13')]+'\x20('+_0x2a649d['statusMessage']+')');_0x250271(new Error(_0xed1e('0x11')+_0x4f495a+'\x20failed,\x20status\x20code\x20=\x20'+_0x2a649d[_0xed1e('0x13')]+'\x20('+_0x2a649d['statusMessage']+')'));return;}var _0x139cf9=fs[_0xed1e('0x14')](_0x4f55dd);_0x139cf9['on']('finish',function(){logger['info'](_0xed1e('0x15'));_0x139cf9['close'](_0x541d67);});_0x139cf9['on'](_0xed1e('0x10'),function(_0x16955f){fs[_0xed1e('0x16')](_0x4f55dd);logger[_0xed1e('0x10')](_0xed1e('0x17'),_0x16955f);_0x250271(_0x16955f);});_0x2a649d[_0xed1e('0x18')](_0x139cf9);})['on'](_0xed1e('0x10'),function(_0x160b85){logger[_0xed1e('0x10')](_0x160b85);_0x250271(_0x160b85);})[_0xed1e('0x19')]();});}function uploadFile(_0x28168c){return new BPromise(function(_0x118ad3,_0x3a461b){var _0x53b7cb=urlParse(_0x28168c);var _0x21b471=_0x53b7cb['protocol']===_0xed1e('0x1a')?https:http;var _0x4e60bf={'host':_0x53b7cb['host'],'path':_0x53b7cb[_0xed1e('0x1b')],'headers':{'user-agent':_0xed1e('0xe')}};_0x21b471[_0xed1e('0xf')](_0x4e60bf,function(_0x47917c){if(_0x47917c[_0xed1e('0x13')]!==0xc8){_0x3a461b(new Error(_0xed1e('0x11')+_0x28168c+_0xed1e('0x12')+_0x47917c[_0xed1e('0x13')]+'\x20('+_0x47917c[_0xed1e('0x1c')]+')'));return;}var _0x9211ee='';_0x47917c['on'](_0xed1e('0x1d'),function(_0x24a426){_0x9211ee+=_0x24a426;});_0x47917c['on'](_0xed1e('0x19'),function(){_0x118ad3(_0x9211ee);});})['on']('error',function(_0x37114){_0x3a461b(_0x37114);})['end']();});}function convertFile(_0x1ec4b3,_0x1f8faf){return new BPromise(function(_0x16660a,_0x387ef2){var _0x41b40c=sox[_0xed1e('0x1e')](_0x1ec4b3,_0x1f8faf,{'sampleRate':0x1f40,'format':_0xed1e('0x1f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x41b40c['on'](_0xed1e('0x10'),function(_0x3c11b3){logger[_0xed1e('0x10')]('error\x20convert',_0x3c11b3);_0x387ef2(_0x3c11b3);});_0x41b40c['on'](_0xed1e('0x19'),function(){logger[_0xed1e('0x20')](_0xed1e('0x21'));_0x16660a();});_0x41b40c[_0xed1e('0x22')]();});}function base64Decode(_0x13b9ca,_0x4b8c9f){var _0x57d081=path[_0xed1e('0x23')](__dirname,_0xed1e('0x24'),rs[_0xed1e('0x25')](0x4)+'.wav');fs['writeFileSync'](_0x57d081,_0x13b9ca,_0xed1e('0x26'));return convertFile(_0x57d081,_0x4b8c9f)['then'](function(){try{fs[_0xed1e('0x16')](_0x57d081);fs[_0xed1e('0x27')](_0x4b8c9f,_0xed1e('0x28'));}catch(_0x227a99){logger[_0xed1e('0x10')](_0x227a99);}return _0x4b8c9f[_0xed1e('0x29')]('.')[0x0];});}function base64Encode(_0x96b585){var _0x4dd9e0=fs[_0xed1e('0x2a')](_0x96b585);return new Buffer(_0x4dd9e0)[_0xed1e('0x2b')]('base64');}exports[_0xed1e('0x2c')]=function(_0x3f3db7,_0x201582,_0x3a9d97,_0x20dc10,_0x1e8e6b,_0x39bac7){var _0x4d1b69,_0x4d4e14;var _0x5a2e10=_0xed1e('0x2d');var _0x5e9324=_0xed1e('0x2e')+_0x3f3db7;var _0x4967c4={};if(_0x201582===_0xed1e('0x2f')){_0x4967c4[_0xed1e('0x30')]={'ssml':_0x3a9d97};}else{_0x4967c4[_0xed1e('0x30')]={'text':_0x3a9d97};};_0x4967c4[_0xed1e('0x31')]={'languageCode':_0x20dc10,'ssmlGender':_0x1e8e6b};_0x4967c4[_0xed1e('0x32')]={'audioEncoding':_0xed1e('0x33'),'sampleRateHertz':0x1f40};var _0x1a28b5={'url':_0x5a2e10+_0xed1e('0x34')+_0x5e9324,'method':'POST','json':!![],'body':_0x4967c4};return rp(_0x1a28b5)['then'](function(_0x3e932c){return new BPromise(function(_0x397a53,_0x48724a){_0x4d1b69=path[_0xed1e('0x23')](__dirname,'tmp',rs[_0xed1e('0x25')](0x4)+_0xed1e('0x35'));var _0x10a347=Buffer[_0xed1e('0x36')](_0x3e932c[_0xed1e('0x37')],'base64');return fs[_0xed1e('0x38')](_0x4d1b69,_0x10a347,function(_0x50954b){_0x48724a(_0x50954b);},function(_0x3736fc){fs[_0xed1e('0x27')](_0x4d1b69,_0xed1e('0x28'));_0x397a53(_0x3736fc);});});})['then'](function(_0x8e9539){_0x4d4e14=path[_0xed1e('0x23')](__dirname,_0xed1e('0x24'),rs[_0xed1e('0x25')](0x4)+_0xed1e('0x39'));return convertFile(_0x4d1b69,_0x4d4e14);})[_0xed1e('0x3a')](function(){try{fs[_0xed1e('0x16')](_0x4d1b69);fs[_0xed1e('0x27')](_0x4d4e14,_0xed1e('0x28'));}catch(_0xb9adb1){logger[_0xed1e('0x10')](_0xb9adb1);}logger[_0xed1e('0x20')](_0xed1e('0x3b'),_0x4d4e14['split']('.')[0x0]);return _0x4d4e14['split']('.')[0x0];});};exports[_0xed1e('0x3c')]=function(_0x47976f,_0x1890b5){var _0x2c77e8=_0xed1e('0x3d');var _0x451d9e,_0x4f4f09;var _0x216673;var _0x220263={'encoding':_0xed1e('0x3e'),'method':_0xed1e('0x3f'),'timeout':0x2710,'url':_0x2c77e8,'headers':{'Content-Type':_0xed1e('0x40')},'body':_0xed1e('0x41')+encodeURIComponent(JSON['stringify']([[[_0xed1e('0x42'),JSON[_0xed1e('0x43')]([_0x47976f,_0x1890b5||'en',![],_0xed1e('0x44')]),null,'generic']]]))};return rp(_0x220263)[_0xed1e('0x3a')](function(_0x52fd10){try{_0x216673=eval(_0x52fd10[_0xed1e('0x45')](0x5))[0x0][0x2];}catch(_0x12d911){throw new Error(_0xed1e('0x46')+_0x52fd10[_0xed1e('0x1d')]);}if(!_0x216673){if(_0x47976f[_0xed1e('0x47')]>0xc8){throw new Error(_0xed1e('0x48'));}else{throw new Error(_0xed1e('0x49')+_0x1890b5+_0xed1e('0x4a'));}}try{_0x216673=eval(_0x216673)[0x0];}catch(_0x33968e){throw new Error(_0xed1e('0x46')+res['data']);}const _0x2f0382=_0x216673;_0x451d9e=path[_0xed1e('0x23')](__dirname,_0xed1e('0x24'),rs[_0xed1e('0x25')](0x4)+'.mp3');fs[_0xed1e('0x4b')](_0x451d9e,_0x216673,{'encoding':_0xed1e('0x26')});_0x4f4f09=path[_0xed1e('0x23')](__dirname,_0xed1e('0x24'),rs[_0xed1e('0x25')](0x4)+'.wav');return convertFile(_0x451d9e,_0x4f4f09);})[_0xed1e('0x3a')](function(){try{fs[_0xed1e('0x16')](_0x451d9e);fs[_0xed1e('0x27')](_0x4f4f09,_0xed1e('0x28'));}catch(_0x51bca8){logger[_0xed1e('0x10')](_0x51bca8);}logger['info'](_0xed1e('0x4c'),_0x4f4f09[_0xed1e('0x29')]('.')[0x0]);return _0x4f4f09[_0xed1e('0x29')]('.')[0x0];});};exports['googleASR']=function(_0x3581f0,_0x493956,_0x184a42){return google[_0xed1e('0x4d')](_0x3581f0,_0x493956,_0x184a42)[_0xed1e('0x3a')](function(_0x3a810f){logger[_0xed1e('0x20')](_0x3a810f[_0xed1e('0x4e')]);return rp(_0x3a810f);})['then'](function(_0x490046){var _0x31fdc0='';var _0x16d6ce=0x0;try{fs['unlink'](_0x3581f0);}catch(_0x49c21d){logger[_0xed1e('0x10')](_0x49c21d);}if(_0x490046&&_0x490046[_0xed1e('0x4f')]){_0x31fdc0=_0x490046[_0xed1e('0x4f')]['map'](function(_0x38f2d6){return _0x38f2d6&&_0x38f2d6[_0xed1e('0x50')][0x0]&&_0x38f2d6[_0xed1e('0x50')][0x0]['transcript']?_0x38f2d6[_0xed1e('0x50')][0x0][_0xed1e('0x51')]:'';})[_0xed1e('0x52')]('\x0a');_0x16d6ce=_0x490046[_0xed1e('0x4f')]['map'](function(_0xdeaf4a){return _0xdeaf4a&&_0xdeaf4a[_0xed1e('0x50')][0x0]&&_0xdeaf4a[_0xed1e('0x50')][0x0][_0xed1e('0x53')]?_0xdeaf4a[_0xed1e('0x50')][0x0]['confidence']:0x0;})[_0xed1e('0x52')]('\x0a');}logger[_0xed1e('0x20')](_0xed1e('0x54'),_0x31fdc0);logger[_0xed1e('0x20')](_0xed1e('0x55'),_0x16d6ce);return{'transcript':_0x31fdc0,'confidence':_0x16d6ce};})[_0xed1e('0x56')](function(_0x1c1268){logger['error'](_0xed1e('0x57'),_0x1c1268[_0xed1e('0x13')],_0x1c1268['name'],_0x1c1268['message']);});};exports[_0xed1e('0x58')]=function(_0x252359,_0x5dadf8,_0x1751dd,_0xbf8111){var _0x5a697=apiai(_0x5dadf8,{'language':_0xbf8111||'en'});return _0x5a697[_0xed1e('0x59')](_0x1751dd,{'sessionId':md5(_0x252359)})[_0xed1e('0x3a')](function(_0x3c35be){logger['info'](JSON[_0xed1e('0x43')](_0x3c35be));return{'source':_0x3c35be[_0xed1e('0x5a')][_0xed1e('0x5b')],'resolvedQuery':_0x3c35be[_0xed1e('0x5a')][_0xed1e('0x5c')],'action':_0x3c35be['result'][_0xed1e('0x5d')],'actionIncomplete':_0x3c35be[_0xed1e('0x5a')]['actionIncomplete'],'speech':_0x3c35be[_0xed1e('0x5a')][_0xed1e('0x5e')][_0xed1e('0x5f')],'score':_0x3c35be[_0xed1e('0x5a')][_0xed1e('0x60')],'statusCode':_0x3c35be[_0xed1e('0x61')][_0xed1e('0x62')],'endConversation':_0x3c35be[_0xed1e('0x5a')][_0xed1e('0x63')][_0xed1e('0x64')]||![],'isFallbackIntent':_0x3c35be[_0xed1e('0x5a')][_0xed1e('0x63')][_0xed1e('0x65')]};});};exports['googleDialogflowV2']=function(_0x29086b,_0x103184,_0x4b9242,_0x5f556d,_0x1b4f7e,_0x3e6281){var _0x430e25=_0x5f556d['replace'](/\\n/g,'\x0a');var _0x1f9d39={'credentials':{'private_key':_0x430e25,'client_email':_0x4b9242}};var _0x141162=new dialogflow[(_0xed1e('0x66'))](_0x1f9d39);var _0x46e9d5=_0x141162[_0xed1e('0x67')](_0x103184,md5(_0x29086b));var _0x13850a={'session':_0x46e9d5,'queryInput':{'text':{'text':_0x1b4f7e,'languageCode':_0x3e6281}}};return _0x141162[_0xed1e('0x68')](_0x13850a)[_0xed1e('0x3a')](function(_0x590c9d){if(_0x590c9d&&_0x590c9d[_0xed1e('0x47')]){logger[_0xed1e('0x20')](_0xed1e('0x69'),JSON[_0xed1e('0x43')](_0x590c9d));var _0x3a1c79=_0x590c9d[0x0];if(_0x3a1c79){var _0x6c1f12={'action':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x5d')],'allRequiredParamsPresent':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x6b')],'endConversation':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x6c')]&&_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x6c')][_0xed1e('0x6d')]?_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x6c')][_0xed1e('0x6d')][_0xed1e('0x6e')][_0xed1e('0x6f')]:![],'fulfillmentText':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x70')],'intentName':_0x3a1c79[_0xed1e('0x6a')]['intent']['name'],'intentDisplayName':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x71')][_0xed1e('0x72')],'isFallbackIntent':_0x3a1c79['queryResult'][_0xed1e('0x71')][_0xed1e('0x73')],'languageCode':_0x3a1c79['queryResult']['languageCode'],'queryText':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x74')],'responseId':_0x3a1c79[_0xed1e('0x75')],'score':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x76')],'speech':_0x3a1c79[_0xed1e('0x6a')][_0xed1e('0x70')],'providerResponse':JSON[_0xed1e('0x43')](_0x590c9d)};return _0x6c1f12;}}});};exports[_0xed1e('0x77')]=function(_0x2af5ff,_0x1bfa5c,_0x44f820,_0x1bcd33){return tilde[_0xed1e('0x4d')](_0x2af5ff,_0x1bfa5c,_0x44f820,_0x1bcd33)[_0xed1e('0x3a')](function(_0x34cbb0){try{fs[_0xed1e('0x16')](_0x2af5ff);}catch(_0x2c2227){logger[_0xed1e('0x10')](_0x2c2227);}logger[_0xed1e('0x20')](_0xed1e('0x78'),_0x34cbb0[_0xed1e('0x51')]);logger[_0xed1e('0x20')]('Tilde\x20ASR\x20confidence',_0x34cbb0['confidence']);return _0x34cbb0;});};exports['awsPolly']=function(_0x32bb10,_0x5be270,_0x271a2f,_0x873ead,_0x27be5e,_0x47ca08){var _0x5b8084=path[_0xed1e('0x23')](__dirname,_0xed1e('0x24'),rs[_0xed1e('0x25')](0x4)+_0xed1e('0x35'));var _0x32421a;return aws[_0xed1e('0x79')](_0x32bb10,_0x5be270,_0x271a2f,_0x873ead,_0x27be5e,_0x47ca08,_0x5b8084)['then'](function(){_0x32421a=path[_0xed1e('0x23')](__dirname,_0xed1e('0x24'),rs['generate'](0x4)+_0xed1e('0x39'));return convertFile(_0x5b8084,_0x32421a);})[_0xed1e('0x3a')](function(){try{fs[_0xed1e('0x16')](_0x5b8084);fs[_0xed1e('0x27')](_0x32421a,_0xed1e('0x28'));}catch(_0xebd46c){logger['error'](_0xebd46c);}return _0x32421a[_0xed1e('0x29')]('.')[0x0];});};exports[_0xed1e('0x7a')]=function(_0x18a674,_0x3f3ec7,_0x562937,_0x4d5e97,_0x90d662,_0x22072f){return aws[_0xed1e('0x7b')](_0x18a674,_0x3f3ec7,_0x562937,_0x4d5e97,_0x90d662,_0x22072f)[_0xed1e('0x3a')](function(_0x3a2fc0){logger['info'](JSON[_0xed1e('0x43')](_0x3a2fc0));return _0x3a2fc0;});};exports[_0xed1e('0x7c')]=function(_0x198967,_0x37781d,_0x37c696,_0x5276b5){var _0xc49c3f=util[_0xed1e('0x7d')](_0xed1e('0x7e'),ISPEECH_API,_0x198967,encodeURIComponent(_0x37781d),_0x37c696,_0x5276b5);var _0x171218=path['resolve'](__dirname,_0xed1e('0x24'),rs['generate'](0x4)+_0xed1e('0x35'));var _0x260e8b;return downloadFile(_0xc49c3f,_0x171218)[_0xed1e('0x3a')](function(){_0x260e8b=path[_0xed1e('0x23')](__dirname,'tmp',rs[_0xed1e('0x25')](0x4)+_0xed1e('0x39'));return convertFile(_0x171218,_0x260e8b);})[_0xed1e('0x3a')](function(){try{fs[_0xed1e('0x16')](_0x171218);fs[_0xed1e('0x27')](_0x260e8b,'777');}catch(_0x25d57c){logger[_0xed1e('0x10')](_0x25d57c);}return _0x260e8b[_0xed1e('0x29')]('.')[0x0];});};exports[_0xed1e('0x7f')]=function(_0x2d2cd4,_0x2af3d3,_0xe59413,_0x4f8533){var _0x32be67=util[_0xed1e('0x7d')](_0xed1e('0x80'),ISPEECH_API,_0x2af3d3,_0xe59413,base64Encode(_0x2d2cd4),_0x4f8533?util[_0xed1e('0x7d')](_0xed1e('0x81'),encodeURIComponent(_0x4f8533)):_0xed1e('0x82'));return uploadFile(_0x32be67)[_0xed1e('0x3a')](function(_0x581a5e){return querystring['parse'](_0x581a5e);});};exports['sestekNDA']=function(_0xa205fb,_0x3c4f21){return sestek[_0xed1e('0x83')](_0xa205fb,_0x3c4f21)[_0xed1e('0x3a')](function(_0x35b557){logger[_0xed1e('0x20')](JSON['stringify'](_0x35b557));var _0x13d25f={'speech':_0x35b557['text'],'action':_0x35b557[_0xed1e('0x84')]?_0x35b557[_0xed1e('0x84')]['CustomAction']:undefined,'actiondata':_0x35b557[_0xed1e('0x84')]?_0x35b557[_0xed1e('0x84')][_0xed1e('0x85')]:undefined};if(_0x35b557['channelData']&&_0x35b557[_0xed1e('0x84')]['AudioFromTts']){return base64Decode(_0x35b557[_0xed1e('0x84')][_0xed1e('0x86')][_0xed1e('0x87')],path['resolve'](__dirname,'tmp',rs[_0xed1e('0x25')](0x4)+_0xed1e('0x39')))[_0xed1e('0x3a')](function(_0x7ddb0e){_0x13d25f[_0xed1e('0x88')]=_0x7ddb0e;return _0x13d25f;});}return _0x13d25f;});};exports[_0xed1e('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 98ec3d3..f0882d7 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 _0x9b47=['exports','./nda'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b47,0xc7));var _0x79b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b47[_0x3dd15e];return _0x231fd0;};var nda=require(_0x79b4('0x0'));module[_0x79b4('0x1')]={'nda':nda}; \ No newline at end of file +var _0xa9ca=['exports'];(function(_0x5b8a7b,_0x1db55f){var _0x3f17eb=function(_0x4890ad){while(--_0x4890ad){_0x5b8a7b['push'](_0x5b8a7b['shift']());}};_0x3f17eb(++_0x1db55f);}(_0xa9ca,0xa0));var _0xaa9c=function(_0x2ac63a,_0x3bbccb){_0x2ac63a=_0x2ac63a-0x0;var _0x491b99=_0xa9ca[_0x2ac63a];return _0x491b99;};var nda=require('./nda');module[_0xaa9c('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 7b44340..b64b39e 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 _0xad95=['text','Bearer\x20','access_token','project','body','channelData','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','resolve','password','then','POST','ndassistant_url','message','Nda','uniqueid','calleridname','dnid'];(function(_0x5466ab,_0x227b13){var _0x40751a=function(_0x477f9e){while(--_0x477f9e){_0x5466ab['push'](_0x5466ab['shift']());}};_0x40751a(++_0x227b13);}(_0xad95,0x70));var _0x5ad9=function(_0x42728b,_0x4955c8){_0x42728b=_0x42728b-0x0;var _0x2613d9=_0xad95[_0x42728b];return _0x2613d9;};'use strict';var rp=require(_0x5ad9('0x0'));var url=require(_0x5ad9('0x1'));var logger=require(_0x5ad9('0x2'))('agi');module['exports']=function(_0x409d5b,_0x235c61){var _0x59809d={'method':'POST','uri':url[_0x5ad9('0x3')](_0x235c61['ndauth_url'],'/token'),'form':{'grant_type':'password','username':_0x235c61['username'],'password':_0x235c61[_0x5ad9('0x4')]},'json':!![]};return rp(_0x59809d)[_0x5ad9('0x5')](function(_0x2a0915){var _0x3d937a={'method':_0x5ad9('0x6'),'uri':url['resolve'](_0x235c61[_0x5ad9('0x7')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x235c61['ndaactivity_type']||_0x5ad9('0x8'),'channelId':_0x5ad9('0x9'),'conversation':{'id':_0x409d5b[_0x5ad9('0xa')]},'from':{'id':_0x409d5b['callerid'],'name':_0x409d5b[_0x5ad9('0xb')]},'recipient':{'id':_0x409d5b[_0x5ad9('0xc')],'name':_0x409d5b['extension']},'text':_0x235c61[_0x5ad9('0xd')],'channelData':{}},'headers':{'Authorization':_0x5ad9('0xe')+_0x2a0915[_0x5ad9('0xf')]},'json':!![]};if(_0x235c61[_0x5ad9('0x10')]){_0x3d937a[_0x5ad9('0x11')][_0x5ad9('0x12')]['ProjectName']=_0x235c61['project'];}if(_0x235c61['ndagenerate_audio']=='1'){_0x3d937a[_0x5ad9('0x11')][_0x5ad9('0x12')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5ad9('0x13')};}if(_0x235c61[_0x5ad9('0x14')]){_0x3d937a[_0x5ad9('0x11')][_0x5ad9('0x12')][_0x5ad9('0x15')]=_0x235c61[_0x5ad9('0x14')];if(_0x235c61[_0x5ad9('0x16')]){_0x3d937a[_0x5ad9('0x11')][_0x5ad9('0x12')][_0x5ad9('0x17')]=_0x235c61['custom_action_data'];}}logger[_0x5ad9('0x18')](JSON['stringify'](_0x3d937a));return rp(_0x3d937a);});}; \ No newline at end of file +var _0xb575=['ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','agi','POST','ndauth_url','/token','password','username','resolve','ndassistant_url','ndaactivity_type','message','Nda','callerid','calleridname','text','Bearer\x20','access_token','project','body','channelData','ProjectName'];(function(_0x59e2e3,_0x3068f3){var _0x32f2d1=function(_0x1ea33d){while(--_0x1ea33d){_0x59e2e3['push'](_0x59e2e3['shift']());}};_0x32f2d1(++_0x3068f3);}(_0xb575,0xda));var _0x5b57=function(_0x7ed1a,_0x3a2365){_0x7ed1a=_0x7ed1a-0x0;var _0x22bfd1=_0xb575[_0x7ed1a];return _0x22bfd1;};'use strict';var rp=require(_0x5b57('0x0'));var url=require(_0x5b57('0x1'));var logger=require('../../../../../config/logger')(_0x5b57('0x2'));module['exports']=function(_0x4a644c,_0x585c94){var _0x3e984f={'method':_0x5b57('0x3'),'uri':url['resolve'](_0x585c94[_0x5b57('0x4')],_0x5b57('0x5')),'form':{'grant_type':_0x5b57('0x6'),'username':_0x585c94[_0x5b57('0x7')],'password':_0x585c94[_0x5b57('0x6')]},'json':!![]};return rp(_0x3e984f)['then'](function(_0x4232d0){var _0x5dd0c7={'method':_0x5b57('0x3'),'uri':url[_0x5b57('0x8')](_0x585c94[_0x5b57('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x585c94[_0x5b57('0xa')]||_0x5b57('0xb'),'channelId':_0x5b57('0xc'),'conversation':{'id':_0x4a644c['uniqueid']},'from':{'id':_0x4a644c[_0x5b57('0xd')],'name':_0x4a644c[_0x5b57('0xe')]},'recipient':{'id':_0x4a644c['dnid'],'name':_0x4a644c['extension']},'text':_0x585c94[_0x5b57('0xf')],'channelData':{}},'headers':{'Authorization':_0x5b57('0x10')+_0x4232d0[_0x5b57('0x11')]},'json':!![]};if(_0x585c94[_0x5b57('0x12')]){_0x5dd0c7[_0x5b57('0x13')][_0x5b57('0x14')][_0x5b57('0x15')]=_0x585c94[_0x5b57('0x12')];}if(_0x585c94[_0x5b57('0x16')]=='1'){_0x5dd0c7[_0x5b57('0x13')]['channelData'][_0x5b57('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5b57('0x18')};}if(_0x585c94[_0x5b57('0x19')]){_0x5dd0c7['body'][_0x5b57('0x14')][_0x5b57('0x1a')]=_0x585c94[_0x5b57('0x19')];if(_0x585c94[_0x5b57('0x1b')]){_0x5dd0c7[_0x5b57('0x13')][_0x5b57('0x14')][_0x5b57('0x1c')]=_0x585c94[_0x5b57('0x1b')];}}logger['info'](JSON[_0x5b57('0x1d')](_0x5dd0c7));return rp(_0x5dd0c7);});}; \ 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 2d29925..4214150 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 _0xe3f7=['exports'];(function(_0x5377cc,_0x722052){var _0x9612b5=function(_0x37e0b7){while(--_0x37e0b7){_0x5377cc['push'](_0x5377cc['shift']());}};_0x9612b5(++_0x722052);}(_0xe3f7,0x133));var _0x7e3f=function(_0x509adf,_0xc1af33){_0x509adf=_0x509adf-0x0;var _0x55ad2a=_0xe3f7[_0x509adf];return _0x55ad2a;};'use strict';var asr=require('./lib/api');module[_0x7e3f('0x0')]=function(_0x2d2a07,_0x419505,_0x4a135e,_0x10ca27){return asr(_0x2d2a07,_0x419505,_0x4a135e,_0x10ca27);}; \ No newline at end of file +var _0xe2a5=['./lib/api','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe2a5,0x1a2));var _0x5e2a=function(_0x5ac3e8,_0x5e1c29){_0x5ac3e8=_0x5ac3e8-0x0;var _0xcb4423=_0xe2a5[_0x5ac3e8];return _0xcb4423;};'use strict';var asr=require(_0x5e2a('0x0'));module[_0x5e2a('0x1')]=function(_0xe54b2a,_0x2cfe76,_0x26f180,_0xbf6832){return asr(_0xe54b2a,_0x2cfe76,_0x26f180,_0xbf6832);}; \ 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 9e88749..7813c06 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 _0xa46b=['bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest','hex','info','stringify','createReadStream','data','send','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message','close'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xa46b,0xbe));var _0xba46=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa46b[_0x432682];return _0x463d05;};'use strict';var BPromise=require(_0xba46('0x0'));var _=require(_0xba46('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xba46('0x2'));var crypto=require(_0xba46('0x3'));var logger=require(_0xba46('0x4'))('agi');module[_0xba46('0x5')]=function(_0x1fb049,_0x5d81c3,_0x358fe3,_0x2bb373){return new BPromise(function(_0x373749,_0x3c677e){logger['info'](_0xba46('0x6'),_0x2bb373||_0xba46('0x7'));var _0x3b5301=new WebSocket(_0x2bb373||_0xba46('0x7'),{'perMessageDeflate':![]});var _0x1cfb43='';var _0x2031da='0';var _0xba3af7='1';var _0x1d42e1=_0xba46('0x8');function _0x64acf1(_0x23574a){var _0x1073cc=crypto['createHash']('sha1');_0x1073cc[_0xba46('0x9')](_0x23574a);return _0x1073cc[_0xba46('0xa')](_0xba46('0xb'));}function _0x3c15ae(){try{logger[_0xba46('0xc')]('Open\x20Tilde\x20ASR\x20socket');var _0xabac4f=moment()['unix']();var _0x28f467=_0x64acf1(_0xabac4f+_0x5d81c3+_0x358fe3);_0x3b5301['send'](JSON[_0xba46('0xd')]({'appID':_0x5d81c3,'timestamp':_0xabac4f,'appKey':_0x28f467}));var _0x8419c4=fs[_0xba46('0xe')](_0x1fb049);_0x8419c4['on'](_0xba46('0xf'),function(_0xb78448){_0x3b5301[_0xba46('0x10')](_0xb78448);});_0x8419c4['on']('close',function(){_0x3b5301[_0xba46('0x10')](_0xba46('0x11'));});}catch(_0x32b9bf){logger[_0xba46('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x32b9bf));_0x3b5301[_0xba46('0x13')]();}}function _0x44a513(_0x630429){try{if(_0x630429){var _0x20b03a=JSON[_0xba46('0x14')](_0x630429);switch(_0x20b03a[_0xba46('0x15')]){case 0x0:if(_0x20b03a['result']){if(_0x20b03a[_0xba46('0x16')][_0xba46('0x17')]){logger[_0xba46('0xc')](_0xba46('0x18'),JSON[_0xba46('0xd')](_0x20b03a[_0xba46('0x16')][_0xba46('0x19')]));_0x1cfb43=_0x20b03a['result'][_0xba46('0x19')][0x0]['transcript'];_0x2031da=_0x20b03a[_0xba46('0x16')][_0xba46('0x19')][0x0][_0xba46('0x1a')];_0xba3af7='0';_0x1d42e1=_0xba46('0x1b');_0x3b5301[_0xba46('0x13')]();}}break;case 0x1:logger['info'](_0xba46('0x8'));_0xba3af7='1';_0x1d42e1=_0xba46('0x8');break;case 0x2:logger[_0xba46('0xc')](_0xba46('0x1c'));_0xba3af7='2';_0x1d42e1=_0xba46('0x1c');break;case 0x9:logger[_0xba46('0xc')](_0xba46('0x1d'));_0xba3af7='9';_0x1d42e1=_0xba46('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0xba3af7='10';_0x1d42e1=_0xba46('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xba3af7='11';_0x1d42e1=_0xba46('0x1f');}}}catch(_0x347034){logger[_0xba46('0x12')](_0xba46('0x20'),JSON['stringify'](_0x347034));_0x3b5301[_0xba46('0x13')]();}}function _0x130950(){logger[_0xba46('0xc')](_0xba46('0x21'));_0x373749({'transcript':_0x1cfb43,'confidence':_0x2031da,'status':_0xba3af7,'status_message':_0x1d42e1});}function _0x1f2ace(_0x5c217b){logger[_0xba46('0x12')](_0xba46('0x22'));if(!_[_0xba46('0x23')](_0x5c217b)){logger['error'](_['isObject'](_0x5c217b)?JSON[_0xba46('0xd')](_0x5c217b):_0x5c217b);}}_0x3b5301['on']('open',_0x3c15ae);_0x3b5301['on'](_0xba46('0x24'),_0x44a513);_0x3b5301['on'](_0xba46('0x25'),_0x130950);_0x3b5301['on'](_0xba46('0x12'),_0x1f2ace);});}; \ No newline at end of file +var _0x28ea=['close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','status','result','final','hypotheses','transcript','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','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','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','Open\x20Tilde\x20ASR\x20socket','send','createReadStream','data'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0x28ea,0xbb));var _0xa28e=function(_0x7045c1,_0x491d3d){_0x7045c1=_0x7045c1-0x0;var _0xe56018=_0x28ea[_0x7045c1];return _0xe56018;};'use strict';var BPromise=require(_0xa28e('0x0'));var _=require(_0xa28e('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa28e('0x2'));var crypto=require(_0xa28e('0x3'));var logger=require(_0xa28e('0x4'))(_0xa28e('0x5'));module[_0xa28e('0x6')]=function(_0x589ce9,_0x57e74a,_0x53603e,_0x5e4d29){return new BPromise(function(_0x4b2a2a,_0x35bcaa){logger[_0xa28e('0x7')](_0xa28e('0x8'),_0x5e4d29||_0xa28e('0x9'));var _0x54c5d0=new WebSocket(_0x5e4d29||_0xa28e('0x9'),{'perMessageDeflate':![]});var _0x2bf580='';var _0x58683d='0';var _0x20ea1d='1';var _0x18f1d5='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x380e41(_0x2b4490){var _0x12d747=crypto['createHash'](_0xa28e('0xa'));_0x12d747[_0xa28e('0xb')](_0x2b4490);return _0x12d747[_0xa28e('0xc')](_0xa28e('0xd'));}function _0x25935b(){try{logger[_0xa28e('0x7')](_0xa28e('0xe'));var _0x27768f=moment()['unix']();var _0x3ff3df=_0x380e41(_0x27768f+_0x57e74a+_0x53603e);_0x54c5d0[_0xa28e('0xf')](JSON['stringify']({'appID':_0x57e74a,'timestamp':_0x27768f,'appKey':_0x3ff3df}));var _0x5a0af0=fs[_0xa28e('0x10')](_0x589ce9);_0x5a0af0['on'](_0xa28e('0x11'),function(_0x15b8db){_0x54c5d0[_0xa28e('0xf')](_0x15b8db);});_0x5a0af0['on'](_0xa28e('0x12'),function(){_0x54c5d0[_0xa28e('0xf')](_0xa28e('0x13'));});}catch(_0xf92ab5){logger[_0xa28e('0x14')](_0xa28e('0x15'),JSON[_0xa28e('0x16')](_0xf92ab5));_0x54c5d0[_0xa28e('0x17')]();}}function _0x65beac(_0x17482b){try{if(_0x17482b){var _0x3e4e4d=JSON['parse'](_0x17482b);switch(_0x3e4e4d[_0xa28e('0x18')]){case 0x0:if(_0x3e4e4d[_0xa28e('0x19')]){if(_0x3e4e4d[_0xa28e('0x19')][_0xa28e('0x1a')]){logger[_0xa28e('0x7')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x3e4e4d['result']['hypotheses']));_0x2bf580=_0x3e4e4d[_0xa28e('0x19')][_0xa28e('0x1b')][0x0][_0xa28e('0x1c')];_0x58683d=_0x3e4e4d[_0xa28e('0x19')][_0xa28e('0x1b')][0x0][_0xa28e('0x1d')];_0x20ea1d='0';_0x18f1d5='Success.';_0x54c5d0['terminate']();}}break;case 0x1:logger[_0xa28e('0x7')](_0xa28e('0x1e'));_0x20ea1d='1';_0x18f1d5='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xa28e('0x7')](_0xa28e('0x1f'));_0x20ea1d='2';_0x18f1d5=_0xa28e('0x1f');break;case 0x9:logger[_0xa28e('0x7')](_0xa28e('0x20'));_0x20ea1d='9';_0x18f1d5=_0xa28e('0x20');break;case 0xa:logger[_0xa28e('0x7')](_0xa28e('0x21'));_0x20ea1d='10';_0x18f1d5=_0xa28e('0x21');break;case 0xb:logger[_0xa28e('0x7')](_0xa28e('0x22'));_0x20ea1d='11';_0x18f1d5=_0xa28e('0x22');}}}catch(_0x279447){logger[_0xa28e('0x14')](_0xa28e('0x23'),JSON[_0xa28e('0x16')](_0x279447));_0x54c5d0[_0xa28e('0x17')]();}}function _0x14e21b(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x4b2a2a({'transcript':_0x2bf580,'confidence':_0x58683d,'status':_0x20ea1d,'status_message':_0x18f1d5});}function _0x50c18a(_0x44c8cf){logger[_0xa28e('0x14')](_0xa28e('0x24'));if(!_[_0xa28e('0x25')](_0x44c8cf)){logger['error'](_[_0xa28e('0x26')](_0x44c8cf)?JSON['stringify'](_0x44c8cf):_0x44c8cf);}}_0x54c5d0['on'](_0xa28e('0x27'),_0x25935b);_0x54c5d0['on'](_0xa28e('0x28'),_0x65beac);_0x54c5d0['on'](_0xa28e('0x12'),_0x14e21b);_0x54c5d0['on']('error',_0x50c18a);});}; \ 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 f8bf1a4..6914853 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 _0x9371=['exports','./asr'];(function(_0x2ac6b6,_0x3d41c4){var _0x4f97c5=function(_0x284dfd){while(--_0x284dfd){_0x2ac6b6['push'](_0x2ac6b6['shift']());}};_0x4f97c5(++_0x3d41c4);}(_0x9371,0x189));var _0x1937=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9371[_0x59ee6f];return _0x4c0979;};var asr=require(_0x1937('0x0'));module[_0x1937('0x1')]={'asr':asr}; \ No newline at end of file +var _0x965d=['./asr','exports'];(function(_0x11707c,_0x30ebac){var _0x4e71d2=function(_0x33c973){while(--_0x33c973){_0x11707c['push'](_0x11707c['shift']());}};_0x4e71d2(++_0x30ebac);}(_0x965d,0xea));var _0xd965=function(_0x49c350,_0x569a29){_0x49c350=_0x49c350-0x0;var _0x358436=_0x965d[_0x49c350];return _0x358436;};var asr=require(_0xd965('0x0'));module[_0xd965('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index fdba4ba..27a910f 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 _0xc1e4=['E_AGI_SERVER_CLOSE','nextTick','inherits','exports','net','events','EventEmitter','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','connection','code','close'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xc1e4,0x94));var _0x4c1e=function(_0x1d6436,_0x1e6b3c){_0x1d6436=_0x1d6436-0x0;var _0x5a410a=_0xc1e4[_0x1d6436];return _0x5a410a;};'use strict';var util=require('util');var net=require(_0x4c1e('0x0'));var EventEmitter=require(_0x4c1e('0x1'))[_0x4c1e('0x2')];var AGIError=require(_0x4c1e('0x3'));var AGIChannel=require(_0x4c1e('0x4'));var AGIServer=function(_0x8206db,_0x6fd4a3,_0x44acde){var _0x545e2d=this,_0x8206db=_0x8206db||0x11dd,_0x6fd4a3=_0x6fd4a3||_0x4c1e('0x5'),_0x52fd01=null,_0x206ee=0x0;EventEmitter['call'](_0x545e2d);function _0x52febe(){if(!_0x8206db){_0x545e2d[_0x4c1e('0x6')](_0x4c1e('0x7'),new AGIError(_0x4c1e('0x8')));return![];}_0x52fd01=net[_0x4c1e('0x9')]();_0x52fd01[_0x4c1e('0xa')](_0x8206db,_0x6fd4a3);_0x52fd01['on'](_0x4c1e('0xb'),function(){_0x545e2d[_0x4c1e('0x6')](_0x4c1e('0xb'));});_0x52fd01['on']('connection',function(_0x1a6770){_0x52fd01[_0x4c1e('0xc')](function(_0x1d1ec2,_0x4fb116){if(_0x1d1ec2){_0x545e2d[_0x4c1e('0x6')](_0x4c1e('0x7'),new AGIError(_0x4c1e('0xd'),_0x1d1ec2));}else if(_0x44acde&&_0x44acde<0x0){_0x545e2d['emit'](_0x4c1e('0x7'),new AGIError(_0x4c1e('0xe')));_0x1a6770['destroy']();}else if(_0x44acde&&_0x44acde>0x0&&_0x44acde<_0x4fb116){_0x206ee+=0x1;_0x545e2d[_0x4c1e('0x6')](_0x4c1e('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x206ee));_0x1a6770[_0x4c1e('0xf')]();}else{var _0x4bdba5=new AGIChannel(_0x1a6770);_0x4bdba5['on'](_0x4c1e('0x10'),function(){_0x545e2d['emit'](_0x4c1e('0x11'),_0x4bdba5);});}});});_0x52fd01['on'](_0x4c1e('0x7'),function(_0x3d889a){_0x545e2d[_0x4c1e('0x6')](_0x4c1e('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x3d889a[_0x4c1e('0x12')]));});_0x52fd01['on'](_0x4c1e('0x13'),function(){_0x545e2d['emit'](_0x4c1e('0x13'),new AGIError(_0x4c1e('0x14')));});}process[_0x4c1e('0x15')](function(){_0x52febe();});};util[_0x4c1e('0x16')](AGIServer,EventEmitter);module[_0x4c1e('0x17')]=function(_0x2821e7,_0x431595,_0x3a8e1b){return new AGIServer(_0x2821e7,_0x431595,_0x3a8e1b);}; \ No newline at end of file +var _0x456f=['destroy','ready','code','close','inherits','exports','util','net','events','./error','./channel','127.0.0.1','emit','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','error'];(function(_0x266f9d,_0x62e67b){var _0x10c8d4=function(_0x573eec){while(--_0x573eec){_0x266f9d['push'](_0x266f9d['shift']());}};_0x10c8d4(++_0x62e67b);}(_0x456f,0x1a8));var _0xf456=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x456f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf456('0x0'));var net=require(_0xf456('0x1'));var EventEmitter=require(_0xf456('0x2'))['EventEmitter'];var AGIError=require(_0xf456('0x3'));var AGIChannel=require(_0xf456('0x4'));var AGIServer=function(_0x16a928,_0x2a810a,_0x31f72a){var _0x5b38de=this,_0x16a928=_0x16a928||0x11dd,_0x2a810a=_0x2a810a||_0xf456('0x5'),_0x25120f=null,_0x49b6a6=0x0;EventEmitter['call'](_0x5b38de);function _0x421be6(){if(!_0x16a928){_0x5b38de[_0xf456('0x6')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x25120f=net[_0xf456('0x7')]();_0x25120f['listen'](_0x16a928,_0x2a810a);_0x25120f['on'](_0xf456('0x8'),function(){_0x5b38de[_0xf456('0x6')]('listening');});_0x25120f['on'](_0xf456('0x9'),function(_0x5b1878){_0x25120f[_0xf456('0xa')](function(_0x58fabe,_0x124892){if(_0x58fabe){_0x5b38de[_0xf456('0x6')]('error',new AGIError(_0xf456('0xb'),_0x58fabe));}else if(_0x31f72a&&_0x31f72a<0x0){_0x5b38de[_0xf456('0x6')](_0xf456('0xc'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x5b1878[_0xf456('0xd')]();}else if(_0x31f72a&&_0x31f72a>0x0&&_0x31f72a<_0x124892){_0x49b6a6+=0x1;_0x5b38de[_0xf456('0x6')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x49b6a6));_0x5b1878[_0xf456('0xd')]();}else{var _0x3b13ca=new AGIChannel(_0x5b1878);_0x3b13ca['on'](_0xf456('0xe'),function(){_0x5b38de[_0xf456('0x6')](_0xf456('0x9'),_0x3b13ca);});}});});_0x25120f['on'](_0xf456('0xc'),function(_0x14dcbf){_0x5b38de[_0xf456('0x6')](_0xf456('0xc'),new AGIError('E_AGI_SERVER_ERROR',_0x14dcbf[_0xf456('0xf')]));});_0x25120f['on'](_0xf456('0x10'),function(){_0x5b38de['emit'](_0xf456('0x10'),new AGIError('E_AGI_SERVER_CLOSE'));});}process['nextTick'](function(){_0x421be6();});};util[_0xf456('0x11')](AGIServer,EventEmitter);module[_0xf456('0x12')]=function(_0xb43ed5,_0x462306,_0x32f2fe){return new AGIServer(_0xb43ed5,_0x462306,_0x32f2fe);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 506e52b..60cc446 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 _0x8b04=['%s.%s','setVariable','replaceObjectAllVariables','stringify','replaceAllVariables','split','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','isConfigured','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','sestekasr','SESTEK_ASR_CONFIDENCE','RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','createSquareDetailsReport','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','googleDialogflow','DIALOGFLOW_%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','client_email','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','sesteknda','audiofile','streamFile','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','no\x20key\x20configured','wav','%s/recordings/%s','beep','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','recordFile','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','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','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','authentication','user','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','path','util','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','prototype','getSquareProject','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getSound','getSoundById','getSoundPath','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','channel','uniqueid','label','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','dnid','file','createSquareMessage','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','timezones','utcOffset','scheduledat','add','minutes','insertContact','getPause','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','en-US','MALE','audioEncoding','MP3','googleTTS','text','restAPI','url','timeout','includes','POST','PUT','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','key','dialogflow_language','googleDialogflowV2','private_key','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject'];(function(_0x3d4864,_0x10ff93){var _0x489010=function(_0x577f25){while(--_0x577f25){_0x3d4864['push'](_0x3d4864['shift']());}};_0x489010(++_0x10ff93);}(_0x8b04,0x130));var _0x48b0=function(_0x5d2e58,_0x409613){_0x5d2e58=_0x5d2e58-0x0;var _0x375957=_0x8b04[_0x5d2e58];return _0x375957;};'use strict';var fs=require('fs');var path=require(_0x48b0('0x0'));var util=require(_0x48b0('0x1'));var _=require('lodash');var sh=require(_0x48b0('0x2'));var odbc=require('odbc')();var rs=require(_0x48b0('0x3'));var moment=require(_0x48b0('0x4'));var Mustache=require(_0x48b0('0x5'));var rp=require(_0x48b0('0x6'));var logger=require(_0x48b0('0x7'))(_0x48b0('0x8'));var config=require(_0x48b0('0x9'));var shared=require(_0x48b0('0xa'));var scripts=require(_0x48b0('0xb'));var FILES_PATH=_0x48b0('0xc');var recursiveMapAttributes=['rawHeaders',_0x48b0('0xd')];var verticesWithRetry=[_0x48b0('0xe'),_0x48b0('0xf'),_0x48b0('0x10')];var AGIVertices=function(_0x3ca1e6,_0x3baa46,_0x6f19eb){this['channel']=_0x3ca1e6;this[_0x48b0('0x11')]=_0x3baa46;this[_0x48b0('0x12')]=_0x6f19eb;};AGIVertices['prototype'][_0x48b0('0x13')]=function(_0x157769,_0x50610f){this[_0x48b0('0x11')][_0x48b0('0x14')](_0x157769)[_0x48b0('0x15')](function(_0x3a70df){_0x50610f(null,_0x3a70df?_0x3a70df[_0x48b0('0x16')]:![]);})[_0x48b0('0x17')](function(_0x52bb16){_0x50610f(_0x52bb16);});};AGIVertices['prototype'][_0x48b0('0x18')]=function(_0x5458f5,_0x35f755){this['rpc'][_0x48b0('0x19')](_0x5458f5)[_0x48b0('0x15')](function(_0x2e736d){_0x35f755(null,_0x2e736d?_0x2e736d[_0x48b0('0x16')]:![]);})['catch'](function(_0x377f65){_0x35f755(_0x377f65);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1b')]=function(_0x4ccc45,_0x2cb409){this['rpc']['getSquareProjectById'](_0x4ccc45)[_0x48b0('0x15')](function(_0x55a3b9){_0x2cb409(null,_0x55a3b9?_0x55a3b9[_0x48b0('0x16')]:![]);})['catch'](function(_0x424ecf){_0x2cb409(_0x424ecf);});};AGIVertices['prototype'][_0x48b0('0x1c')]=function(_0x23d72f,_0x33841b){this[_0x48b0('0x11')][_0x48b0('0x1d')](_0x23d72f)['then'](function(_0x5ebcbb){_0x33841b(null,_0x5ebcbb?_0x5ebcbb['dsn']:![]);})['catch'](function(_0x520d13){_0x33841b(_0x520d13);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1e')]=function(_0x24866b,_0x1557dc){this['rpc'][_0x48b0('0x1f')](_0x24866b)['then'](function(_0xc79ca7){_0x1557dc(null,_0xc79ca7?_0xc79ca7[_0x48b0('0x16')]:![]);})[_0x48b0('0x17')](function(_0x259d5b){_0x1557dc(_0x259d5b);});};AGIVertices[_0x48b0('0x1a')]['getTrunk']=function(_0x53f366,_0x57012b){this['rpc']['getTrunkById'](_0x53f366)[_0x48b0('0x15')](function(_0x27d858){_0x57012b(null,_0x27d858?_0x27d858[_0x48b0('0x16')]:![]);})[_0x48b0('0x17')](function(_0x590eb4){_0x57012b(_0x590eb4);});};AGIVertices['prototype'][_0x48b0('0x20')]=function(_0x2f7e72,_0x52451b){var _0x50e7cf=this;this[_0x48b0('0x11')][_0x48b0('0x21')](_0x2f7e72)['then'](function(_0x175f52){_0x52451b(null,_0x175f52?_0x50e7cf[_0x48b0('0x22')](_0x175f52['save_name']):![]);})['catch'](function(_0x171ddf){_0x52451b(_0x171ddf);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x23')]=function(_0x32e8e6,_0x4d6cab){this[_0x48b0('0x11')]['getMailAccountById'](_0x32e8e6)[_0x48b0('0x15')](function(_0x2ae3ec){_0x4d6cab(null,_0x2ae3ec?_0x2ae3ec:![]);})[_0x48b0('0x17')](function(_0x5268f2){_0x4d6cab(_0x5268f2);});};AGIVertices['prototype'][_0x48b0('0x24')]=function(_0x265c34,_0x254220,_0x51d0a1){this['mailRpc'][_0x48b0('0x24')](_0x265c34,_0x254220)[_0x48b0('0x15')](function(){_0x51d0a1(null);})[_0x48b0('0x17')](function(_0x1dc474){_0x51d0a1(_0x1dc474);});};AGIVertices['prototype'][_0x48b0('0x25')]=function(_0x5ac207,_0x417257){this[_0x48b0('0x11')][_0x48b0('0x26')](_0x5ac207)[_0x48b0('0x15')](function(_0x2df849){if(_0x2df849){if(_0x2df849[_0x48b0('0x27')]){_0x417257(null,[_0x2df849[_0x48b0('0x28')]]);}else{_0x417257(null,_[_0x48b0('0x29')](_0x2df849[_0x48b0('0x2a')],'interval'));}}else{_0x417257(null,![]);}})[_0x48b0('0x17')](function(_0x262a9f){_0x417257(_0x262a9f);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x22')]=function(_0xf8d84){return util[_0x48b0('0x2b')](_0x48b0('0x2c'),FILES_PATH,_0xf8d84);};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x2d')]=function(_0x5d932e,_0x3d3dd3,_0x2ab321){odbc['open'](_0x5d932e,function(_0x34ddfd){if(_0x34ddfd){logger[_0x48b0('0x2e')](_0x48b0('0x2f'),_0x34ddfd);_0x2ab321(_0x34ddfd);}else{logger[_0x48b0('0x30')](_0x48b0('0x31'));odbc[_0x48b0('0x32')](_0x3d3dd3,function(_0x473f59,_0x4fa25b){if(_0x473f59){logger['info']('Error\x20executing\x20query\x20%s',_0x3d3dd3);_0x2ab321(_0x473f59);}else{logger[_0x48b0('0x30')](_0x48b0('0x33'),_0x3d3dd3);odbc[_0x48b0('0x34')](function(_0x204222){if(_0x204222){logger['error'](_0x48b0('0x35'),_0x204222);}_0x2ab321(null,_0x4fa25b);});}});}});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x36')]=function(_0x5c194b,_0x444af0){this[_0x48b0('0x11')][_0x48b0('0x37')](_0x5c194b)[_0x48b0('0x15')](function(_0x5b1c7a){_0x444af0(null,_0x5b1c7a?_0x5b1c7a:![]);})['catch'](function(_0x58883f){_0x444af0(_0x58883f);});};AGIVertices['prototype']['createSmsMessage']=function(_0x59170e,_0x394239){this[_0x48b0('0x11')][_0x48b0('0x38')](_0x59170e)[_0x48b0('0x15')](function(_0x55f90b){_0x394239(null,_0x55f90b);})[_0x48b0('0x17')](function(_0x4cf7a9){_0x394239(_0x4cf7a9);});};AGIVertices[_0x48b0('0x1a')]['createSquareDetailsReport']=function(_0x7c2495,_0x9f8223,_0x4245dc){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x48b0('0x39')][_0x48b0('0x3a')],'node':_0x7c2495[_0x48b0('0x3b')],'application':_0x7c2495['agicommand'],'data':_0x9f8223||null,'project_name':this['channel'][_0x48b0('0x3c')],'callerid':this['channel'][_0x48b0('0x3d')]})['then'](function(_0x32b532){if(_0x4245dc){_0x4245dc(null,_0x32b532);}})[_0x48b0('0x17')](function(_0x3e0425){if(_0x4245dc){_0x4245dc(_0x3e0425);}});};AGIVertices['prototype'][_0x48b0('0x3e')]=function(_0x18141a,_0x2be18e,_0x504eb8,_0x123612){this[_0x48b0('0x11')][_0x48b0('0x3e')]({'uniqueid':this[_0x48b0('0x39')][_0x48b0('0x3a')],'callerid':this[_0x48b0('0x39')][_0x48b0('0x3d')],'calleridname':this[_0x48b0('0x39')]['calleridname'],'context':this[_0x48b0('0x39')][_0x48b0('0x3f')],'extension':this[_0x48b0('0x39')][_0x48b0('0x40')],'priority':this['channel'][_0x48b0('0x41')],'accountcode':this[_0x48b0('0x39')][_0x48b0('0x42')],'dnid':this[_0x48b0('0x39')][_0x48b0('0x43')],'projectName':this[_0x48b0('0x39')][_0x48b0('0x3c')],'saveName':_0x2be18e,'filename':_0x18141a[_0x48b0('0x44')]||_0x2be18e,'savePath':_0x504eb8})['then'](function(_0x1d52be){_0x123612(null,_0x1d52be);})[_0x48b0('0x17')](function(_0x4d0536){_0x123612(_0x4d0536);});};AGIVertices[_0x48b0('0x1a')]['createSquareMessage']=function(_0x526a78,_0x3e5738,_0x305132,_0x3db9f5,_0x2c08d3){this['rpc'][_0x48b0('0x45')]({'uniqueid':this['channel']['uniqueid'],'body':_0x526a78,'direction':_0x3e5738,'providerName':_0x305132,'providerResponse':_0x3db9f5})['then'](function(_0x47935f){if(_0x2c08d3){_0x2c08d3(null,_0x47935f);}})[_0x48b0('0x17')](function(_0x505ffa){if(_0x2c08d3){_0x2c08d3(_0x505ffa);}});};AGIVertices[_0x48b0('0x1a')]['createCmContact']=function(_0x1c3f6a,_0x486e31){var _0xd33acf=this;var _0x5507c5=0x0;var _0x317e53={'firstName':_[_0x48b0('0x46')](_0x1c3f6a[_0x48b0('0x16')])||_[_0x48b0('0x47')](_0x1c3f6a[_0x48b0('0x16')])?_0x48b0('0x48')+Math[_0x48b0('0x49')]():_0x1c3f6a[_0x48b0('0x16')],'lastName':_[_0x48b0('0x46')](_0x1c3f6a[_0x48b0('0x4a')])||_['isNil'](_0x1c3f6a['lastName'])?null:_0x1c3f6a[_0x48b0('0x4a')],'phone':_0x1c3f6a[_0x48b0('0x4b')],'ListId':_0x1c3f6a[_0x48b0('0x4c')],'scheduledat':_0x1c3f6a[_0x48b0('0x4d')],'callbackUniqueid':this[_0x48b0('0x39')][_0x48b0('0x3a')],'tags':_0x48b0('0x4e'),'description':_0x48b0('0x4f')+_0x1c3f6a['scheduledAt'][_0x48b0('0x50')](),'priority':_0x1c3f6a[_0x48b0('0x51')]};if(_[_0x48b0('0x52')](_0x1c3f6a,'dialTimezone')){if(!_[_0x48b0('0x47')](_0x1c3f6a[_0x48b0('0x53')])){var _0x13e1f9=_0x1c3f6a[_0x48b0('0x53')];if(_0x1c3f6a['dialTimezone']==_0x48b0('0x54')){this[_0x48b0('0x11')][_0x48b0('0x55')]({'phone':_0x1c3f6a[_0x48b0('0x4b')]})[_0x48b0('0x15')](function(_0x194a8a){if(!_['isNil'](_0x194a8a)){var _0x2e63c1=_0x194a8a[_0x48b0('0x53')];if(!_['isNil'](_0x2e63c1)){var _0x4f35a7=shared[_0x48b0('0x56')][_0x2e63c1];if(!_[_0x48b0('0x47')](_0x4f35a7)){var _0xd8e2b0=-0x1*_0x4f35a7[_0x48b0('0x57')];_0x317e53[_0x48b0('0x58')]=moment(_0x1c3f6a[_0x48b0('0x58')])[_0x48b0('0x59')](_0xd8e2b0,_0x48b0('0x5a'));_0xd33acf[_0x48b0('0x5b')](_0x317e53,_0x1c3f6a,_0x486e31);}else{_0xd33acf['insertContact'](_0x317e53,_0x1c3f6a,_0x486e31);}}else{_0xd33acf[_0x48b0('0x5b')](_0x317e53,_0x1c3f6a,_0x486e31);}}else{_0xd33acf[_0x48b0('0x5b')](_0x317e53,_0x1c3f6a,_0x486e31);}});}else{var _0x5507c5=shared[_0x48b0('0x56')][_0x13e1f9];if(!_[_0x48b0('0x47')](_0x5507c5)){var _0x161724=-0x1*_0x5507c5[_0x48b0('0x57')];_0x317e53['scheduledat']=moment(_0x1c3f6a[_0x48b0('0x58')])[_0x48b0('0x59')](_0x161724,_0x48b0('0x5a'));_0xd33acf[_0x48b0('0x5b')](_0x317e53,_0x1c3f6a,_0x486e31);}else{_0xd33acf['insertContact'](_0x317e53,_0x1c3f6a,_0x486e31);}}}else{_0xd33acf[_0x48b0('0x5b')](_0x317e53,_0x1c3f6a,_0x486e31);}}else{_0xd33acf['insertContact'](_0x317e53,_0x1c3f6a,_0x486e31);}};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x5c')]=function(_0x182cff,_0x4591c6){this['rpc']['getPauseById'](_0x182cff)['then'](function(_0x243bd3){_0x4591c6(null,_0x243bd3?_0x243bd3['name']:![]);})[_0x48b0('0x17')](function(_0x197a19){_0x4591c6(_0x197a19);});};AGIVertices['prototype'][_0x48b0('0x5d')]=function(_0x3dcdd6,_0x29aad9,_0x3cb221){var _0x17eb8a={'role':_0x48b0('0x5e')};_0x17eb8a[_0x3dcdd6]=this[_0x48b0('0x39')][_0x48b0('0x3d')];this[_0x48b0('0x11')][_0x48b0('0x5d')](_0x17eb8a,_0x29aad9,this['channel'][_0x48b0('0x3a')])['then'](function(_0x3f4eb3){_0x3cb221(null,_[_0x48b0('0x47')](_0x3f4eb3)?![]:!![]);})['catch'](function(_0x49f47f){logger[_0x48b0('0x2e')](_0x49f47f);_0x3cb221(null,![]);});};AGIVertices['prototype'][_0x48b0('0x5f')]=function(_0x3613b8,_0x524740){var _0x1b76ad={'role':_0x48b0('0x5e')};_0x1b76ad[_0x3613b8]=this['channel'][_0x48b0('0x3d')];this[_0x48b0('0x11')][_0x48b0('0x5f')](_0x1b76ad)[_0x48b0('0x15')](function(_0x24d92b){_0x524740(null,_[_0x48b0('0x47')](_0x24d92b)?![]:!![]);})[_0x48b0('0x17')](function(_0x45acec){logger[_0x48b0('0x2e')](_0x45acec);_0x524740(null,![]);});};AGIVertices[_0x48b0('0x1a')]['agentLogout']=function(_0x545367,_0x2089cf){var _0x135620={'role':_0x48b0('0x5e')};_0x135620[_0x545367]=this[_0x48b0('0x39')][_0x48b0('0x3d')];this[_0x48b0('0x11')][_0x48b0('0x60')](_0x135620)[_0x48b0('0x15')](function(_0x5bfe92){_0x2089cf(null,_['isNil'](_0x5bfe92)?![]:!![]);})[_0x48b0('0x17')](function(_0x329aab){logger[_0x48b0('0x2e')](_0x329aab);_0x2089cf(null,![]);});};AGIVertices[_0x48b0('0x1a')]['agentLogin']=function(_0x165ff0,_0x57e160){var _0x29d6b1={'role':_0x48b0('0x5e')};_0x29d6b1[_0x165ff0]=this[_0x48b0('0x39')][_0x48b0('0x3d')];var _0x2b0232=_0x165ff0!=_0x48b0('0x61')?util[_0x48b0('0x2b')](_0x48b0('0x62'),'LOCAL',this['channel']['callerid']):undefined;this['rpc'][_0x48b0('0x63')](_0x29d6b1,_0x2b0232)[_0x48b0('0x15')](function(_0x399e74){_0x57e160(null,_['isNil'](_0x399e74)?![]:!![]);})['catch'](function(_0x165de3){logger[_0x48b0('0x2e')](_0x165de3);_0x57e160(null,![]);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x64')]=function(_0x3c2d33,_0x206850){sh[_0x48b0('0x65')](_[_0x48b0('0x66')](_0x3c2d33),function(_0x4a903d,_0x1fa1d8){var _0x4a6b4b=_0x1fa1d8[_0x48b0('0x67')](/(\r\n|\n|\r)/gm,'');_0x206850(null,_0x4a6b4b);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x68')]=function(_0x4e2c6a,_0x30d85e){scripts[_0x48b0('0x68')](_0x4e2c6a[_0x48b0('0x69')],_0x4e2c6a[_0x48b0('0x6a')]||'text',_0x4e2c6a['text'],_0x4e2c6a['languageCode']||_0x48b0('0x6b'),_0x4e2c6a['ssmlGender']||_0x48b0('0x6c'),_0x4e2c6a[_0x48b0('0x6d')]||_0x48b0('0x6e'))[_0x48b0('0x15')](function(_0x238591){_0x30d85e(null,_0x238591);})['catch'](function(_0x2a5611){_0x30d85e(_0x2a5611);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x6f')]=function(_0x34310b,_0x51c992){scripts['googleTTS'](_0x34310b[_0x48b0('0x70')],_0x34310b['google_tts_language']||'en',0x1)[_0x48b0('0x15')](function(_0xe1816d){_0x51c992(null,_0xe1816d);})[_0x48b0('0x17')](function(_0x163fdc){_0x51c992(_0x163fdc);});};AGIVertices['prototype'][_0x48b0('0x71')]=function(_0x38db91,_0x4fc98e){var _0x108cd9={'uri':_0x38db91[_0x48b0('0x72')],'method':_0x38db91['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x38db91[_0x48b0('0x73')])==='number'&&parseInt(_0x38db91['timeout'])>=0x1?parseInt(_0x38db91[_0x48b0('0x73')])*0x3e8:0x5*0x3e8};if(_[_0x48b0('0x74')]([_0x48b0('0x75'),_0x48b0('0x76')],_0x108cd9[_0x48b0('0x77')][_0x48b0('0x78')]())){try{_0x108cd9[_0x48b0('0x79')]=_0x38db91[_0x48b0('0xd')]?JSON[_0x48b0('0x7a')](_0x38db91[_0x48b0('0xd')]):{};}catch(_0x1c82ec){logger[_0x48b0('0x2e')](_0x48b0('0x7b'),_0x1c82ec);}}try{_0x108cd9[_0x48b0('0x7c')]=_0x38db91[_0x48b0('0x7d')]?JSON[_0x48b0('0x7a')](_0x38db91[_0x48b0('0x7d')]):{};}catch(_0x50398b){logger['error'](_0x48b0('0x7e'),_0x50398b);}if(_0x38db91['computedVariables']){try{var _0x504bb5=require(_0x38db91['computedVariables'])[_0x48b0('0x7f')](this,_0x108cd9);_0x108cd9[_0x48b0('0x80')]=Mustache[_0x48b0('0x81')](_0x38db91[_0x48b0('0x72')],_0x504bb5,{},['$$','$$']);if(_0x108cd9['headers']){_0x108cd9[_0x48b0('0x7c')]=JSON[_0x48b0('0x7a')](Mustache[_0x48b0('0x81')](JSON['stringify'](_0x108cd9['headers']),_0x504bb5,{},['$$','$$']));}if(_0x108cd9[_0x48b0('0x79')]){_0x108cd9['body']=JSON['parse'](Mustache[_0x48b0('0x81')](JSON['stringify'](_0x108cd9[_0x48b0('0x79')]),_0x504bb5,{},['$$','$$']));}}catch(_0x234888){logger[_0x48b0('0x2e')](_0x48b0('0x82'),_0x234888);}}rp(_0x108cd9)[_0x48b0('0x15')](function(_0x2c6f0a){var _0x2edf6d={'statusCode':_0x2c6f0a[_0x48b0('0x83')]||0xc8,'statusMessage':_0x2c6f0a['statusMessage']||'OK','headers':_0x2c6f0a[_0x48b0('0x7c')]||{},'body':_0x2c6f0a[_0x48b0('0x79')]||{}};_0x4fc98e(null,_0x2edf6d);})['catch'](function(_0x3ac9f1){var _0x32a2dd={'statusCode':_0x3ac9f1[_0x48b0('0x83')]||0x1f4,'statusMessage':_0x3ac9f1[_0x48b0('0x84')]||_0x48b0('0x85'),'headers':_0x3ac9f1[_0x48b0('0x86')][_0x48b0('0x7c')]||{},'body':_0x3ac9f1[_0x48b0('0x86')][_0x48b0('0x79')]||{}};_0x4fc98e(null,_0x32a2dd);});};AGIVertices[_0x48b0('0x1a')]['googleDialogflow']=function(_0x5911a7,_0x160196){scripts['googleDialogflow'](this[_0x48b0('0x39')][_0x48b0('0x3a')],_0x5911a7[_0x48b0('0x87')],_0x5911a7[_0x48b0('0x70')],_0x5911a7[_0x48b0('0x88')]||'en')['then'](function(_0xa3a413){_0x160196(null,_0xa3a413);})['catch'](function(_0x7f5b3d){_0x160196(_0x7f5b3d);});};AGIVertices['prototype'][_0x48b0('0x89')]=function(_0x280cad,_0x5c764e){scripts[_0x48b0('0x89')](this[_0x48b0('0x39')][_0x48b0('0x3a')],_0x280cad['dialogflowV2_project_id'],_0x280cad['client_email'],_0x280cad[_0x48b0('0x8a')],_0x280cad[_0x48b0('0x70')],_0x280cad[_0x48b0('0x8b')]||'en')[_0x48b0('0x15')](function(_0x4d9690){_0x5c764e(null,_0x4d9690);})[_0x48b0('0x17')](function(_0x266c95){_0x5c764e(_0x266c95);});};AGIVertices['prototype']['sestekNDA']=function(_0x37381d,_0xe1d41a){scripts['sestekNDA'](this[_0x48b0('0x39')],_0x37381d)[_0x48b0('0x15')](function(_0x35db03){_0xe1d41a(null,_0x35db03);})[_0x48b0('0x17')](function(_0x89b161){_0xe1d41a(_0x89b161);});};AGIVertices['prototype']['ispeechTTS']=function(_0x14d80b,_0x52942c){scripts[_0x48b0('0x8c')](_0x14d80b[_0x48b0('0x87')],_0x14d80b[_0x48b0('0x70')],_0x14d80b[_0x48b0('0x8d')]||_0x48b0('0x6b'),_0x14d80b[_0x48b0('0x8e')])[_0x48b0('0x15')](function(_0x44d229){_0x52942c(null,_0x44d229);})['catch'](function(_0x19059b){_0x52942c(_0x19059b);});};AGIVertices['prototype']['ispeechASR']=function(_0x4e2869,_0x1c18be,_0x2a9545){scripts[_0x48b0('0x8f')](_0x1c18be,_0x4e2869[_0x48b0('0x87')],_0x4e2869[_0x48b0('0x90')]||_0x48b0('0x6b'),this['isConfigured'](_0x4e2869[_0x48b0('0x91')])?_0x4e2869[_0x48b0('0x91')]:undefined)[_0x48b0('0x15')](function(_0x11091c){_0x2a9545(null,_0x11091c);})[_0x48b0('0x17')](function(_0x4c5320){_0x2a9545(_0x4c5320);});};AGIVertices[_0x48b0('0x1a')]['awsPolly']=function(_0x369b4a,_0x3a8a73){scripts[_0x48b0('0x92')](_0x369b4a['aws_access_key_id'],_0x369b4a[_0x48b0('0x93')],_0x369b4a[_0x48b0('0x94')],_0x369b4a[_0x48b0('0x95')]||_0x48b0('0x96'),_0x369b4a['text'],_0x369b4a[_0x48b0('0x97')]||'text')[_0x48b0('0x15')](function(_0x39ef48){_0x3a8a73(null,_0x39ef48);})['catch'](function(_0x24541c){_0x3a8a73(_0x24541c);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x98')]=function(_0x1063ba,_0x2e70de){scripts[_0x48b0('0x98')](this['channel']['uniqueid'],_0x1063ba[_0x48b0('0x99')],_0x1063ba['aws_secret_access_key'],_0x1063ba[_0x48b0('0x9a')],_0x1063ba[_0x48b0('0x70')],_0x1063ba[_0x48b0('0x9b')])['then'](function(_0x898ac6){_0x2e70de(null,_0x898ac6);})[_0x48b0('0x17')](function(_0x9b92d0){_0x2e70de(_0x9b92d0);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x9c')]=function(_0x1b6eda,_0x5b45a4,_0x13fa05){scripts['googleASR'](_0x5b45a4,_0x1b6eda['key'],_0x1b6eda[_0x48b0('0x9d')]||_0x48b0('0x6b'))[_0x48b0('0x15')](function(_0x175c36){_0x13fa05(null,_0x175c36);})[_0x48b0('0x17')](function(_0x79b570){_0x13fa05(_0x79b570);});};AGIVertices['prototype'][_0x48b0('0x9e')]=function(_0x768d2d,_0x4fa37f,_0x4601c9){scripts[_0x48b0('0x9e')](_0x4fa37f,_0x768d2d[_0x48b0('0x9f')],_0x768d2d[_0x48b0('0xa0')],_0x768d2d[_0x48b0('0x80')])[_0x48b0('0x15')](function(_0x109cd9){_0x4601c9(null,_0x109cd9);})[_0x48b0('0x17')](function(_0x7754d7){_0x4601c9(_0x7754d7);});};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xa1')]=function(_0x14403c){var _0x347187=_[_0x48b0('0x74')](verticesWithRetry,_0x14403c['agicommand'])?_0x14403c:_[_0x48b0('0xa2')](_0x14403c);for(var _0x5e78a7 in _0x347187){if(_0x347187[_0x48b0('0xa3')](_0x5e78a7)){if(_0x347187[_0x5e78a7]&&_[_0x48b0('0xa4')](_0x347187[_0x5e78a7])){if(_[_0x48b0('0x74')](recursiveMapAttributes,_0x5e78a7)){_0x347187[_0x5e78a7]=this['replaceObjectAllVariables'](_0x347187[_0x5e78a7]);}else{_0x347187[_0x5e78a7]=this['replaceAllVariables'](_0x347187[_0x5e78a7]);}}}}return _0x347187;};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xa5')]=function(_0x162744){for(var _0x159986 in _0x162744){if(_0x162744[_0x48b0('0xa3')](_0x159986)){if(_['isPlainObject'](_0x162744[_0x159986])){this[_0x48b0('0xa5')](_0x162744[_0x159986]);}else if(_[_0x48b0('0xa6')](_0x162744[_0x159986])){for(var _0x2bf950=0x0;_0x2bf950<_0x162744[_0x159986][_0x48b0('0xa7')];_0x2bf950++){this[_0x48b0('0xa5')](_0x162744[_0x159986][_0x2bf950]);}}else if(_[_0x48b0('0xa4')](_0x162744[_0x159986])){_0x162744[_0x159986]=this['replaceAllVariables'](_0x162744[_0x159986]);}}}};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xa8')]=function(_0x2a7691,_0x167c85){for(var _0x423568 in _0x2a7691){if(_0x2a7691[_0x48b0('0xa3')](_0x423568)){if(_[_0x48b0('0xa9')](_0x2a7691[_0x423568])){if(!_[_0x48b0('0x46')](_0x2a7691[_0x423568])){this[_0x48b0('0xa8')](_0x2a7691[_0x423568],util[_0x48b0('0x2b')]('%s.%s',_0x167c85,_0x423568));}}else if(_[_0x48b0('0xa6')](_0x2a7691[_0x423568])){for(var _0x4eb21e=0x0;_0x4eb21e<_0x2a7691[_0x423568][_0x48b0('0xa7')];_0x4eb21e++){this[_0x48b0('0xa8')](_0x2a7691[_0x423568][_0x4eb21e],util[_0x48b0('0x2b')](_0x48b0('0xaa'),_0x167c85,_0x423568+'['+_0x4eb21e+']'));}}else{if(!_[_0x48b0('0x47')](_0x2a7691[_0x423568])){this[_0x48b0('0x39')][_0x48b0('0xab')](util['format'](_0x48b0('0xaa'),_0x167c85,_0x423568),_0x2a7691[_0x423568]);}}}}};AGIVertices['prototype'][_0x48b0('0xac')]=function(_0x2eaebb){try{var _0x491a95=JSON[_0x48b0('0x7a')](_0x2eaebb);this['recursiveNodeIndex'](_0x491a95);return JSON[_0x48b0('0xad')](_0x491a95);}catch(_0x58a8b5){return this['replaceAllVariables'](_0x2eaebb);}};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xae')]=function(_0x1ccc32){var _0x4c2b63=_0x1ccc32[_0x48b0('0xaf')]('{');for(var _0x308fbb=0x1;_0x308fbb<_0x4c2b63[_0x48b0('0xa7')];_0x308fbb+=0x1){var _0x19c61a=_0x4c2b63[_0x308fbb][_0x48b0('0xaf')]('}');if(_0x19c61a[_0x48b0('0xa7')]>0x1){_0x1ccc32=_0x1ccc32['replaceAll']('{'+_0x19c61a[0x0]+'}',this[_0x48b0('0x39')][_0x48b0('0x13')](_0x19c61a[0x0])['extra']||_0x19c61a[0x0]);}}if(_0x4c2b63['length']===0x1){return _0x1ccc32[_0x48b0('0x50')]();}return this[_0x48b0('0xae')](_0x1ccc32);};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xb0')]=function(_0x5bb62d,_0x24d5a3){var _0x5c9b91=this['channel']['getVariable'](_0x5bb62d);if(_0x5c9b91[_0x48b0('0xb1')]===-0x1){return _0x5c9b91;}logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xb2'),_0x24d5a3,_0x5c9b91[_0x48b0('0xb3')]));return this[_0x48b0('0x39')][_0x48b0('0xab')](_0x24d5a3,_0x5c9b91['extra']);};AGIVertices[_0x48b0('0x1a')]['isConfigured']=function(_0x2c271a){return _0x2c271a&&_0x2c271a!=='0'&&_0x2c271a!=='-1'&&_0x2c271a!=='';};AGIVertices['prototype'][_0x48b0('0xb4')]=function(_0x6ecd0c){this['createSquareDetailsReport']['sync'](this,_0x6ecd0c,'-');_0x6ecd0c[_0x48b0('0xb5')]=_0x6ecd0c['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xb6')]=function(_0x513df4){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xb7'),_0x513df4[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x513df4[_0x48b0('0x70')])){return this['channel'][_0x48b0('0xb9')](_0x48b0('0xba'));}var _0x2684d2='\x22'+_0x513df4['text']+'\x22';if(this[_0x48b0('0xb8')](_0x513df4[_0x48b0('0x86')])){_0x2684d2+=','+_0x513df4[_0x48b0('0x86')];}var _0x1b5385=this['channel']['exec'](_0x48b0('0xbb'),_0x2684d2);if(_0x1b5385['result']===-0x1){return _0x1b5385;}return this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')](_0x48b0('0xbc'),_0x2684d2));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xbd')]=function(_0x23fed6){logger[_0x48b0('0x30')](util['format'](_0x48b0('0xbe'),_0x23fed6['label']));if(!this[_0x48b0('0xb8')](_0x23fed6['grammar'])){return this[_0x48b0('0x39')]['noop']('no\x20grammar\x20configured');}var _0x32df4a=_0x23fed6['grammar'];if(this[_0x48b0('0xb8')](_0x23fed6[_0x48b0('0x86')])){_0x32df4a+=','+_0x23fed6[_0x48b0('0x86')];}var _0xba5df9=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x48b0('0xbf'),_0x32df4a);if(_0xba5df9[_0x48b0('0xb1')]===-0x1){return _0xba5df9;}var _0x41bbc2=this[_0x48b0('0xb0')](_0x48b0('0xc0'),_0x48b0('0xc1'));if(_0x41bbc2['result']===-0x1){return _0x41bbc2;}var _0x351cc8=this[_0x48b0('0xb0')]('RECOG_INPUT()',_0x48b0('0xc2'));if(_0x351cc8[_0x48b0('0xb1')]===-0x1){return _0x351cc8;}var _0x3d4a15=this[_0x48b0('0xb0')]('RECOG_INSTANCE()',_0x48b0('0xc3'));if(_0x3d4a15[_0x48b0('0xb1')]===-0x1){return _0x3d4a15;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xc4'),_0x32df4a));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x8')]=function(_0x3d8301){logger['info'](util[_0x48b0('0x2b')](_0x48b0('0xc5'),_0x3d8301[_0x48b0('0x3b')]));return this[_0x48b0('0x39')][_0x48b0('0x8')]([_0x3d8301[_0x48b0('0xc6')],_0x3d8301[_0x48b0('0xc7')]]);};AGIVertices['prototype'][_0x48b0('0xc8')]=function(_0x367381){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xc9'),_0x367381[_0x48b0('0x3b')]));if(this[_0x48b0('0xb8')](_0x367381[_0x48b0('0x73')])){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xca'),_0x367381[_0x48b0('0x73')]));var _0xa13ff6=this[_0x48b0('0x39')][_0x48b0('0xcb')](_0x367381[_0x48b0('0x73')]);if(_0xa13ff6[_0x48b0('0xb1')]===-0x1){return _0xa13ff6;}}return this[_0x48b0('0x39')]['answer']();};AGIVertices[_0x48b0('0x1a')]['callback']=function(_0x284cac){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xcc'),_0x284cac[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x284cac[_0x48b0('0x4c')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x284cac,_0x48b0('0xcd'));}_0x284cac['scheduledAt']=moment();if(this[_0x48b0('0xb8')](_0x284cac[_0x48b0('0xce')])){_0x284cac[_0x48b0('0x4d')]=moment()[_0x48b0('0x59')](_0x284cac[_0x48b0('0xce')],_0x48b0('0x5a'));}if(!this[_0x48b0('0xb8')](_0x284cac[_0x48b0('0x51')])){_0x284cac[_0x48b0('0x51')]=0x2;}this[_0x48b0('0xcf')][_0x48b0('0x7f')](this,_0x284cac);return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0xd0'),_0x284cac['phone'],_0x284cac[_0x48b0('0x4c')],_0x284cac['scheduledAt']));};AGIVertices[_0x48b0('0x1a')]['custom_app']=function(_0x311ecf){logger[_0x48b0('0x30')](util['format'](_0x48b0('0xd1'),_0x311ecf[_0x48b0('0x3b')]));var _0x4356e0=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x311ecf['application'],_0x311ecf[_0x48b0('0x86')]);if(_0x4356e0[_0x48b0('0xb1')]===-0x1){return _0x4356e0;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xd2'),_0x311ecf[_0x48b0('0xd3')],_0x311ecf['options']));};AGIVertices['prototype'][_0x48b0('0xd4')]=function(_0xfe57d5){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xd5'),_0xfe57d5['label']));if(!this['isConfigured'](_0xfe57d5[_0x48b0('0x70')])){return this[_0x48b0('0x39')]['noop'](_0x48b0('0xba'));}var _0xac6fa6='\x22'+_0xfe57d5[_0x48b0('0x70')]+'\x22';if(this[_0x48b0('0xb8')](_0xfe57d5['options'])){_0xac6fa6+=','+_0xfe57d5[_0x48b0('0x86')];}var _0x15e990=this[_0x48b0('0x39')]['exec'](_0x48b0('0xbb'),_0xac6fa6);if(_0x15e990[_0x48b0('0xb1')]===-0x1){return _0x15e990;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0xbc'),_0xac6fa6));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xd6')]=function(_0x18bb24){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xd7'),_0x18bb24[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x18bb24[_0x48b0('0x70')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0xba'));}var _0x15cef8='\x22'+_0x18bb24[_0x48b0('0x70')]+'\x22';if(this['isConfigured'](_0x18bb24[_0x48b0('0x86')])){_0x15cef8+=','+_0x18bb24['options'];}var _0x6447d4=this[_0x48b0('0x39')]['exec'](_0x48b0('0xbb'),_0x15cef8);if(_0x6447d4[_0x48b0('0xb1')]===-0x1){return _0x6447d4;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xbc'),_0x15cef8));};AGIVertices[_0x48b0('0x1a')]['lumenvoxasr']=function(_0x3543f9){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xd8'),_0x3543f9[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x3543f9[_0x48b0('0xd9')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0xda'));}var _0x312f50=_0x3543f9['grammar'];if(this[_0x48b0('0xb8')](_0x3543f9[_0x48b0('0x86')])){_0x312f50+=','+_0x3543f9[_0x48b0('0x86')];}var _0x4ca7ca=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x48b0('0xbf'),_0x312f50);if(_0x4ca7ca[_0x48b0('0xb1')]===-0x1){return _0x4ca7ca;}var _0x344fff=this[_0x48b0('0xb0')]('RECOG_CONFIDENCE()',_0x48b0('0xdb'));if(_0x344fff[_0x48b0('0xb1')]===-0x1){return _0x344fff;}var _0x5d4507=this[_0x48b0('0xb0')]('RECOG_INPUT()',_0x48b0('0xdc'));if(_0x5d4507['result']===-0x1){return _0x5d4507;}var _0x48532b=this[_0x48b0('0xb0')](_0x48b0('0xdd'),'LUMENVOX_ASR_INSTANCE');if(_0x48532b[_0x48b0('0xb1')]===-0x1){return _0x48532b;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xc4'),_0x312f50));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xde')]=function(_0x5e194b){logger['info'](util[_0x48b0('0x2b')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5e194b[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x5e194b[_0x48b0('0xd9')])){return this['channel'][_0x48b0('0xb9')](_0x48b0('0xda'));}var _0x3441c9=_0x5e194b[_0x48b0('0xd9')];if(this[_0x48b0('0xb8')](_0x5e194b[_0x48b0('0x86')])){_0x3441c9+=','+_0x5e194b[_0x48b0('0x86')];}var _0x3c2ebc=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x48b0('0xbf'),_0x3441c9);if(_0x3c2ebc[_0x48b0('0xb1')]===-0x1){return _0x3c2ebc;}var _0x148271=this[_0x48b0('0xb0')](_0x48b0('0xc0'),_0x48b0('0xdf'));if(_0x148271[_0x48b0('0xb1')]===-0x1){return _0x148271;}var _0x2d3e24=this[_0x48b0('0xb0')](_0x48b0('0xe0'),_0x48b0('0xe1'));if(_0x2d3e24['result']===-0x1){return _0x2d3e24;}var _0x2e2abb=this[_0x48b0('0xb0')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x2e2abb['result']===-0x1){return _0x2e2abb;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0xc4'),_0x3441c9));};AGIVertices[_0x48b0('0x1a')]['database']=function(_0x1b567a){logger['info'](util['format'](_0x48b0('0xe2'),_0x1b567a['label']));if(!this[_0x48b0('0xb8')](_0x1b567a['odbc_id'])){return this[_0x48b0('0x39')]['error'](_0x1b567a,_0x48b0('0xe3'));}var _0xd72665=this[_0x48b0('0x1c')][_0x48b0('0x7f')](this,_0x1b567a['odbc_id']);if(!_0xd72665){return this['channel']['error'](_0x1b567a,_0x48b0('0xe4'));}if(!this['isConfigured'](_0x1b567a[_0x48b0('0x32')])){return this['channel'][_0x48b0('0x2e')](_0x1b567a,'no\x20query\x20configured');}var _0x51dae1=_0x1b567a['query'][_0x48b0('0x67')](/(\r\n|\n|\r)/gm,'\x20');this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xe5'),_0x51dae1));var _0x844556=this['getQueryOdbc'][_0x48b0('0x7f')](this,_0xd72665,_0x51dae1);this[_0x48b0('0xe6')]['sync'](this,_0x1b567a,_0x51dae1);if(!this['isConfigured'](_0x1b567a[_0x48b0('0xe7')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0xe8'));}var _0x195a62=this['getVariable'][_0x48b0('0x7f')](this,_0x1b567a[_0x48b0('0xe7')]);if(!_0x195a62){return this['channel']['error'](_0x1b567a,_0x48b0('0xe9'));}var _0x255504=this;_0x844556[_0x48b0('0xea')](function(_0x4c0501,_0x5a97a2){Object[_0x48b0('0xeb')](_0x4c0501)[_0x48b0('0xea')](function(_0x3ca821){_0x255504['channel'][_0x48b0('0xab')](util['format'](_0x48b0('0xec'),_0x195a62,_0x5a97a2,_0x3ca821),_0x4c0501[_0x3ca821]);});});this[_0x48b0('0x39')][_0x48b0('0xab')](util[_0x48b0('0x2b')]('%s_ROWS_COUNT',_0x195a62),_0x844556[_0x48b0('0xa7')]);return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format']('variable\x20%s\x20set',_0x195a62));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xed')]=function(_0x571d82){logger[_0x48b0('0xee')](util[_0x48b0('0x2b')](_0x48b0('0xef'),_0x571d82['label']));if(!this[_0x48b0('0xb8')](_0x571d82[_0x48b0('0xf0')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x571d82,'no\x20user\x20selected');}var _0x33bc81=this[_0x48b0('0x1e')][_0x48b0('0x7f')](this,_0x571d82[_0x48b0('0xf0')]);if(!_0x33bc81){return this[_0x48b0('0x39')]['error'](_0x571d82,_0x48b0('0xf1'));}var _0x4119e7=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x48b0('0xf2'),[util[_0x48b0('0x2b')](_0x48b0('0xf3'),_0x33bc81),_0x571d82[_0x48b0('0x73')],_0x571d82[_0x48b0('0xf4')],_0x571d82['url']]);if(_0x4119e7[_0x48b0('0xb1')]===-0x1){return _0x4119e7;}return this['channel'][_0x48b0('0xb9')](util[_0x48b0('0x2b')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xf5')]=function(_0x324aa0){logger['info'](util['format'](_0x48b0('0xf6'),_0x324aa0['label']));if(!this[_0x48b0('0xb8')](_0x324aa0[_0x48b0('0x87')])){return this['channel'][_0x48b0('0xb9')]('no\x20key\x20configured');}if(!this[_0x48b0('0xb8')](_0x324aa0[_0x48b0('0x70')])){return this['channel'][_0x48b0('0xb9')]('no\x20text\x20configured');}this['channel'][_0x48b0('0xf7')]=!![];this[_0x48b0('0xe6')](_0x324aa0);this[_0x48b0('0x45')](_0x324aa0['text'],'in','','');this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')]('Trying\x20Dialogflow:\x20%s',_0x324aa0[_0x48b0('0x70')]));var _0x10c463=this[_0x48b0('0xf8')][_0x48b0('0x7f')](this,_0x324aa0);if(_0x10c463){for(var _0x2da801 in _0x10c463){if(_0x10c463[_0x48b0('0xa3')](_0x2da801)){this[_0x48b0('0x39')][_0x48b0('0xab')](util[_0x48b0('0x2b')](_0x48b0('0xf9'),_0x2da801[_0x48b0('0x78')]()),_0x10c463[_0x2da801]);}}this[_0x48b0('0x45')](_0x10c463['speech'],_0x48b0('0xfa'),_0x48b0('0xf5'),'');return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xfb'),_0x10c463[_0x48b0('0xfc')]));}return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x324aa0,_0x48b0('0xfd'));};AGIVertices['prototype'][_0x48b0('0xfe')]=function(_0x580439){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0xff'),_0x580439[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x580439[_0x48b0('0x100')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x101'));}if(!this[_0x48b0('0xb8')](_0x580439[_0x48b0('0x102')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x103'));}if(!this['isConfigured'](_0x580439['private_key'])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x104'));}if(!this[_0x48b0('0xb8')](_0x580439[_0x48b0('0x8b')])){return this['channel'][_0x48b0('0xb9')](_0x48b0('0x105'));}if(!this[_0x48b0('0xb8')](_0x580439[_0x48b0('0x70')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0xba'));}this[_0x48b0('0x39')][_0x48b0('0xf7')]=!![];this[_0x48b0('0xe6')](_0x580439);this[_0x48b0('0x45')](_0x580439['text'],'in','','');this['channel'][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x106'),_0x580439[_0x48b0('0x70')]));var _0x2cbbce=this[_0x48b0('0x89')][_0x48b0('0x7f')](this,_0x580439);if(_0x2cbbce){for(var _0x228e69 in _0x2cbbce){if(_0x2cbbce[_0x48b0('0xa3')](_0x228e69)){if(_0x228e69!=='providerResponse'){this[_0x48b0('0x39')][_0x48b0('0xab')](util['format'](_0x48b0('0xf9'),_0x228e69['toUpperCase']()),_0x2cbbce[_0x228e69]);}}}this[_0x48b0('0x45')](_0x2cbbce['speech'],_0x48b0('0xfa'),_0x48b0('0xfe'),_0x2cbbce['providerResponse']);return this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')](_0x48b0('0x107'),_0x2cbbce['speech']));}return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x580439,_0x48b0('0x108'));};AGIVertices[_0x48b0('0x1a')]['sesteknda']=function(_0x26061f){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x109'),_0x26061f[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x26061f[_0x48b0('0x10a')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x10b'));}if(!this[_0x48b0('0xb8')](_0x26061f[_0x48b0('0x10c')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x10d'));}if(!this[_0x48b0('0xb8')](_0x26061f[_0x48b0('0x10e')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x10f'));}if(!this[_0x48b0('0xb8')](_0x26061f[_0x48b0('0x110')])){return this[_0x48b0('0x39')]['noop']('no\x20text\x20configured');}this['channel'][_0x48b0('0xf7')]=!![];this[_0x48b0('0xe6')](_0x26061f);this[_0x48b0('0x45')](_0x26061f['text'],'in','','');this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x26061f['text']));var _0x263d6e=this['sestekNDA'][_0x48b0('0x7f')](this,_0x26061f);if(_0x263d6e){for(var _0x22568e in _0x263d6e){if(_0x263d6e[_0x48b0('0xa3')](_0x22568e)){this[_0x48b0('0x39')][_0x48b0('0xab')](util[_0x48b0('0x2b')](_0x48b0('0x111'),_0x22568e[_0x48b0('0x78')]()),_0x263d6e[_0x22568e]);}}this[_0x48b0('0x45')](_0x263d6e[_0x48b0('0xfc')],'out',_0x48b0('0x112'),'');if(_0x263d6e[_0x48b0('0x113')]){this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x263d6e['audiofile']));var _0x24efb4=this['channel'][_0x48b0('0x114')](_0x263d6e['audiofile']);try{fs['unlink'](_0x263d6e['audiofile']+_0x48b0('0x115'));}catch(_0x4f057a){logger[_0x48b0('0x2e')](_0x4f057a);}return _0x24efb4;}else{return this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')]('SestekNDA\x20Result\x20%s',_0x263d6e[_0x48b0('0xfc')]));}}return this[_0x48b0('0x39')]['error'](_0x26061f,_0x48b0('0x116'));};AGIVertices[_0x48b0('0x1a')]['end']=function(_0x1a2064){logger[_0x48b0('0x30')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x1a2064[_0x48b0('0x3b')]));return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x117'));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x118')]=function(_0x50baae){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x119'),_0x50baae[_0x48b0('0x3b')]));var _0x498a4f='';if(_0x50baae[_0x48b0('0x11a')]){if(!this[_0x48b0('0xb8')](_0x50baae[_0x48b0('0x11a')])){return this['channel'][_0x48b0('0x2e')](_0x50baae,_0x48b0('0x11b'));}else{var _0x210f20=parseInt(_0x50baae[_0x48b0('0x11a')],0xa);if(isNaN(_0x210f20)){_0x498a4f=_0x50baae[_0x48b0('0x11a')];}else{_0x498a4f=this['getTrunk'][_0x48b0('0x7f')](this,_0x50baae[_0x48b0('0x11a')]);if(!_0x498a4f){return this['channel'][_0x48b0('0x2e')](_0x50baae,_0x48b0('0x11c'));}}}}else if(_0x50baae['trunk_name']){_0x498a4f=_0x50baae[_0x48b0('0x11d')];}else{return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x50baae,_0x48b0('0x11b'));}var _0x274353=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x48b0('0xf2'),[util[_0x48b0('0x2b')](_0x48b0('0x11e'),_0x498a4f,_0x50baae['phone']),_0x50baae['timeout'],_0x50baae['opts'],_0x50baae[_0x48b0('0x72')]]);if(_0x274353['result']===-0x1){return _0x274353;}return this['channel'][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x11f'),_0x48b0('0xf2')));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x120')]=function(_0x37ae8f){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x121'),_0x37ae8f[_0x48b0('0x3b')]));return this[_0x48b0('0x39')][_0x48b0('0xb9')]('finally');};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xf')]=function(_0x96aaf1){logger['info'](util[_0x48b0('0x2b')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x96aaf1[_0x48b0('0x3b')]));if(_0x96aaf1['retry']===0x0){return this[_0x48b0('0xb4')](_0x96aaf1);}_0x96aaf1[_0x48b0('0xb5')]-=0x1;if(!this['isConfigured'](_0x96aaf1[_0x48b0('0x122')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x96aaf1,'no\x20file\x20audio\x20selected');}var _0x56825f=this[_0x48b0('0x20')][_0x48b0('0x7f')](this,_0x96aaf1[_0x48b0('0x122')]);if(!_0x56825f){return this[_0x48b0('0x39')]['error'](_0x96aaf1,_0x48b0('0x123'));}if(!this[_0x48b0('0xb8')](_0x96aaf1['variable_id'])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x48b0('0xe8'));}var _0x2ea123=this[_0x48b0('0x39')]['getData'](_0x56825f,_0x96aaf1[_0x48b0('0x124')],_0x96aaf1[_0x48b0('0x125')]);var _0x400c75=_0x2ea123[_0x48b0('0xb1')]?_0x2ea123['result'][_0x48b0('0x50')]():'';logger[_0x48b0('0x30')]('test',JSON['stringify'](_0x2ea123));if(_0x2ea123[_0x48b0('0xb1')]===-0x1){this[_0x48b0('0xe6')][_0x48b0('0x7f')](this,_0x96aaf1,_0x400c75);return _0x2ea123;}else if(_0x2ea123['extra']==='timeout'){_0x2ea123[_0x48b0('0xb1')]=_0x400c75[_0x48b0('0xa7')]>=parseInt(_0x96aaf1['mindigit'])?'x':'i';}else{_0x2ea123[_0x48b0('0xb1')]=_0x400c75[_0x48b0('0xa7')]>=parseInt(_0x96aaf1[_0x48b0('0x126')])&&_0x400c75[_0x48b0('0xa7')]<=parseInt(_0x96aaf1[_0x48b0('0x125')])?'x':'i';}var _0x34352e=this['getVariable'][_0x48b0('0x7f')](this,_0x96aaf1[_0x48b0('0xe7')]);if(!_0x34352e){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x96aaf1,_0x48b0('0xe9'));}this[_0x48b0('0x39')]['setVariable'](_0x34352e,_0x400c75);if(this[_0x48b0('0xb8')](_0x96aaf1[_0x48b0('0x127')])){var _0x359b0f=parseInt(_0x96aaf1['hiddendigitsnum'],0xa);var _0x70f6a9=rs[_0x48b0('0x128')]({'charset':'*','length':_0x359b0f});var _0x36f630=_0x400c75[_0x48b0('0xa7')];if(_0x36f630>0x0){if(_0x36f630>_0x359b0f){this[_0x48b0('0xe6')][_0x48b0('0x7f')](this,_0x96aaf1,_0x96aaf1[_0x48b0('0x129')]===_0x48b0('0x12a')?_0x70f6a9+_0x400c75[_0x48b0('0x12b')](_0x359b0f):_0x400c75[_0x48b0('0x12b')](0x0,_0x36f630-_0x359b0f)+_0x70f6a9);}else{this[_0x48b0('0xe6')]['sync'](this,_0x96aaf1,rs[_0x48b0('0x128')]({'charset':'*','length':_0x36f630}));}}else{this[_0x48b0('0xe6')]['sync'](this,_0x96aaf1,'');}}else{this['createSquareDetailsReport']['sync'](this,_0x96aaf1,_0x400c75);}return _0x2ea123;};AGIVertices['prototype']['getsecretdigits']=function(_0x5aac62){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x12c'),_0x5aac62[_0x48b0('0x3b')]));return this[_0x48b0('0xf')](_0x5aac62);};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x12d')]=function(_0x3bf1b9){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x12e'),_0x3bf1b9[_0x48b0('0x3b')]));this[_0x48b0('0xe6')][_0x48b0('0x7f')](this,_0x3bf1b9,_0x3bf1b9[_0x48b0('0x12f')]);return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format']('GOAL\x20%s',_0x3bf1b9[_0x48b0('0x12f')]));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x130')]=function(_0xab882a){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x131'),_0xab882a[_0x48b0('0x3b')]));if(!this['isConfigured'](_0xab882a['aws_access_key_id'])||!this[_0x48b0('0xb8')](_0xab882a['aws_secret_access_key'])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x132'));}if(!this[_0x48b0('0xb8')](_0xab882a[_0x48b0('0x70')])){return this[_0x48b0('0x39')]['noop'](_0x48b0('0xba'));}this['channel'][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x133'),_0xab882a[_0x48b0('0x70')]));var _0x2ddf13=this[_0x48b0('0x92')]['sync'](this,_0xab882a);if(_0x2ddf13){this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0x134'),_0x2ddf13));var _0x388e59=this['channel'][_0x48b0('0x114')](_0x2ddf13);try{fs[_0x48b0('0x135')](_0x2ddf13+_0x48b0('0x115'));}catch(_0x4716dd){logger['error'](_0x4716dd);}return _0x388e59;}return this['channel'][_0x48b0('0x2e')](_0xab882a,_0x48b0('0x136'));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x137')]=function(_0x510a09){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x138'),_0x510a09[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x510a09['aws_access_key_id'])||!this['isConfigured'](_0x510a09[_0x48b0('0x93')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x132'));}if(!this[_0x48b0('0xb8')](_0x510a09['aws_bot_name'])){return this[_0x48b0('0x39')]['noop']('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x510a09['text'])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0xba'));}this['channel'][_0x48b0('0xf7')]=!![];this['createSquareDetailsReport'](_0x510a09);this['createSquareMessage'](_0x510a09[_0x48b0('0x70')],'in','','');this['channel'][_0x48b0('0xb9')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x510a09[_0x48b0('0x70')]));var _0x44adbd=this['awsLex'][_0x48b0('0x7f')](this,_0x510a09);if(_0x44adbd){for(var _0x1da0f1 in _0x44adbd){if(_0x44adbd[_0x48b0('0xa3')](_0x1da0f1)&&_['isString'](_0x44adbd[_0x1da0f1])){this[_0x48b0('0x39')]['setVariable'](util['format'](_0x48b0('0x139'),_0x1da0f1[_0x48b0('0x78')]()),_0x44adbd[_0x1da0f1]);}}if(_[_0x48b0('0x47')](_0x44adbd[_0x48b0('0x84')])){return this['channel'][_0x48b0('0xb9')](_0x48b0('0x13a'));}else{this[_0x48b0('0x45')](_0x44adbd[_0x48b0('0x84')],_0x48b0('0xfa'),_0x48b0('0x13b'),'');return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x13c'),_0x44adbd[_0x48b0('0x84')]));}}return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x510a09,_0x48b0('0x13d'));};AGIVertices[_0x48b0('0x1a')]['googleasr']=function(_0x5b1a58){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x5b1a58[_0x48b0('0x3b')],_0x5b1a58[_0x48b0('0x73')]));if(!this[_0x48b0('0xb8')](_0x5b1a58[_0x48b0('0x87')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x13e'));}var _0x2bd115=_0x48b0('0x13f');var _0x439410=util[_0x48b0('0x2b')](_0x48b0('0x140'),FILES_PATH,rs['generate'](0x4));var _0xfd7ffd=util[_0x48b0('0x2b')](_0x48b0('0xaa'),_0x439410,_0x2bd115);var _0x3be480=!![];if(_0x5b1a58[_0x48b0('0x141')]==='NOBEEP'){_0x3be480=![];}var _0x949330=this[_0x48b0('0x39')]['recordFile'](_0x439410,_0x2bd115,_0x5b1a58[_0x48b0('0x142')],_0x5b1a58[_0x48b0('0x73')],undefined,_0x3be480);if(_0x949330['result']!==-0x1){this['channel'][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x143'),_0xfd7ffd));var _0x1c5100=this[_0x48b0('0x9c')]['sync'](this,_0x5b1a58,_0xfd7ffd);if(_0x1c5100){for(var _0x48cb04 in _0x1c5100){if(_0x1c5100['hasOwnProperty'](_0x48cb04)){this[_0x48b0('0x39')][_0x48b0('0xab')](util['format'](_0x48b0('0x144'),_0x48cb04['toUpperCase']()),_0x1c5100[_0x48cb04]);}}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x145'),JSON[_0x48b0('0xad')](_0x1c5100)));}}return _0x949330;};AGIVertices[_0x48b0('0x1a')]['tildeasr']=function(_0x309353){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x146'),_0x309353[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x309353[_0x48b0('0x9f')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x147'));}if(!this[_0x48b0('0xb8')](_0x309353[_0x48b0('0xa0')])){return this[_0x48b0('0x39')]['noop']('no\x20appsecret\x20configured');}var _0x388e02='wav';var _0x23484c=util['format'](_0x48b0('0x140'),FILES_PATH,rs[_0x48b0('0x128')](0x4));var _0x5358b3=util[_0x48b0('0x2b')](_0x48b0('0xaa'),_0x23484c,_0x388e02);var _0x5dfe88=!![];if(_0x309353[_0x48b0('0x141')]===_0x48b0('0x148')){_0x5dfe88=![];}var _0x5ae40c=this[_0x48b0('0x39')]['recordFile'](_0x23484c,_0x388e02,_0x309353['intKey'],_0x309353['timeout'],undefined,_0x5dfe88);if(_0x5ae40c[_0x48b0('0xb1')]!==-0x1){this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')](_0x48b0('0x149'),_0x5358b3));var _0x598937=this['tildeASR'][_0x48b0('0x7f')](this,_0x309353,_0x5358b3);if(_0x598937){for(var _0x28015f in _0x598937){if(_0x598937[_0x48b0('0xa3')](_0x28015f)){this[_0x48b0('0x39')][_0x48b0('0xab')](util['format'](_0x48b0('0x14a'),_0x28015f[_0x48b0('0x78')]()),_0x598937[_0x28015f]);}}return this['channel'][_0x48b0('0xb9')](util['format'](_0x48b0('0x14b'),JSON[_0x48b0('0xad')](_0x598937)));}}return _0x5ae40c;};AGIVertices['prototype'][_0x48b0('0x14c')]=function(_0x45d43c){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x14d'),_0x45d43c[_0x48b0('0x3b')]));return this[_0x48b0('0x39')][_0x48b0('0x14e')](_0x45d43c[_0x48b0('0x3f')],_0x45d43c[_0x48b0('0x40')],_0x45d43c[_0x48b0('0x41')]);};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x14f')]=function(_0x273955){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x150'),_0x273955[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x273955[_0x48b0('0x151')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x273955,'no\x20condition\x20configured');}try{var _0x2a7da1=eval(_0x273955[_0x48b0('0x151')])?_0x48b0('0x152'):_0x48b0('0x153');this['channel']['noop'](util[_0x48b0('0x2b')](_0x48b0('0x154'),_0x273955['condition'],_0x2a7da1));return{'code':0xc8,'result':_0x2a7da1};}catch(_0x35da1e){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x155')]=function(_0x3c5768){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x156'),_0x3c5768[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x3c5768['interval_id'])){return this['channel']['error'](_0x3c5768,'no\x20interval\x20configured');}var _0x451cbf=this['getIntervals'][_0x48b0('0x7f')](this,_0x3c5768[_0x48b0('0x157')]);if(!_0x451cbf){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x3c5768,'no\x20intervals\x20found');}for(var _0xab7169=0x0;_0xab7169<_0x451cbf[_0x48b0('0xa7')];_0xab7169+=0x1){var _0x4d6f6b=this['channel']['getVariable'](util[_0x48b0('0x2b')](_0x48b0('0x158'),_0x451cbf[_0xab7169]));if(_0x4d6f6b[_0x48b0('0xb1')]===-0x1){return _0x4d6f6b;}logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x159'),_0x451cbf[_0xab7169],_0x4d6f6b[_0x48b0('0xb3')]));if(_0x4d6f6b[_0x48b0('0xb3')]===_0x48b0('0x152')){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('IFTIME\x20%s\x20%s',_0x451cbf[_0xab7169],_0x48b0('0x152')));this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')]('IFTIME\x20%s\x20%s',_0x451cbf[_0xab7169],_0x48b0('0x152')));return{'code':0xc8,'result':_0x48b0('0x152')};}else{logger['info'](util['format'](_0x48b0('0x159'),_0x451cbf[_0xab7169],_0x48b0('0x153')));this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0x159'),_0x451cbf[_0xab7169],_0x48b0('0x153')));}}return{'code':0xc8,'result':_0x48b0('0x153')};};AGIVertices['prototype'][_0x48b0('0x15a')]=function(_0x21e13b){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x15b'),_0x21e13b[_0x48b0('0x3b')]));return this['channel'][_0x48b0('0x15a')]();};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x15c')]=function(_0x2ac17b){logger[_0x48b0('0x30')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2ac17b[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x2ac17b[_0x48b0('0x87')])){return this[_0x48b0('0x39')]['noop'](_0x48b0('0x13e'));}var _0x2f78d=_0x48b0('0x13f');var _0x20b800=util[_0x48b0('0x2b')](_0x48b0('0x140'),FILES_PATH,rs[_0x48b0('0x128')](0x4));var _0x5ccb7f=util[_0x48b0('0x2b')](_0x48b0('0xaa'),_0x20b800,_0x2f78d);var _0x195361=!![];if(_0x2ac17b[_0x48b0('0x141')]===_0x48b0('0x148')){_0x195361=![];}var _0x2ecf20=this[_0x48b0('0x39')][_0x48b0('0x15d')](_0x20b800,_0x2f78d,_0x2ac17b[_0x48b0('0x142')],_0x2ac17b[_0x48b0('0x73')],undefined,_0x195361);if(_0x2ecf20[_0x48b0('0xb1')]!==-0x1){this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0x15e'),_0x5ccb7f));var _0x3e76ec=this[_0x48b0('0x8f')][_0x48b0('0x7f')](this,_0x2ac17b,_0x5ccb7f);if(_0x3e76ec){for(var _0x1da927 in _0x3e76ec){if(_0x3e76ec[_0x48b0('0xa3')](_0x1da927)){this[_0x48b0('0x39')][_0x48b0('0xab')](util[_0x48b0('0x2b')](_0x48b0('0x15f'),_0x1da927[_0x48b0('0x78')]()),_0x3e76ec[_0x1da927]);}}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x48b0('0xad')](_0x3e76ec)));}}return _0x2ecf20;};AGIVertices['prototype'][_0x48b0('0x160')]=function(_0x282dae){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x161'),_0x282dae[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x282dae[_0x48b0('0x87')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x13e'));}if(!this[_0x48b0('0xb8')](_0x282dae[_0x48b0('0x70')])){return this['channel'][_0x48b0('0xb9')](_0x48b0('0xba'));}this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x282dae[_0x48b0('0x70')]));var _0x589e19=this[_0x48b0('0x8c')][_0x48b0('0x7f')](this,_0x282dae);if(_0x589e19){this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x15e'),_0x589e19));var _0x4ac07b=this[_0x48b0('0x39')][_0x48b0('0x114')](_0x589e19,_0x282dae[_0x48b0('0x142')]);try{fs['unlink'](_0x589e19+_0x48b0('0x115'));}catch(_0x24b294){logger[_0x48b0('0x2e')](_0x24b294);}return _0x4ac07b;}return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x282dae,_0x48b0('0x162'));};AGIVertices[_0x48b0('0x1a')]['login']=function(_0x53ee82){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x163'),_0x53ee82[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x53ee82[_0x48b0('0x164')])){return this['channel']['error'](_0x53ee82,_0x48b0('0x165'));}logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x166'),this['channel'][_0x48b0('0x3d')],_0x53ee82['findBy']));var _0x208eae=this[_0x48b0('0x63')]['sync'](this,_0x53ee82[_0x48b0('0x164')]);if(_0x208eae){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x167'),this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x53ee82[_0x48b0('0x164')]));this[_0x48b0('0x39')]['noop'](util['format'](_0x48b0('0x167'),this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x53ee82[_0x48b0('0x164')]));return{'code':0xc8,'result':_0x48b0('0x168')};}else{logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x53ee82['findBy']));this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')](_0x48b0('0x169'),this[_0x48b0('0x39')]['callerid'],_0x53ee82[_0x48b0('0x164')]));return{'code':0xc8,'result':_0x48b0('0x16a')};}};AGIVertices['prototype'][_0x48b0('0x16b')]=function(_0x12bb5){logger['info'](util[_0x48b0('0x2b')](_0x48b0('0x16c'),_0x12bb5[_0x48b0('0x3b')]));if(!this['isConfigured'](_0x12bb5[_0x48b0('0x164')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x12bb5,_0x48b0('0x165'));}logger[_0x48b0('0x30')](util['format'](_0x48b0('0x166'),this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x12bb5[_0x48b0('0x164')]));var _0x2097eb=this[_0x48b0('0x60')]['sync'](this,_0x12bb5['findBy']);if(_0x2097eb){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x167'),this['channel'][_0x48b0('0x3d')],_0x12bb5['findBy']));this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x167'),this[_0x48b0('0x39')]['callerid'],_0x12bb5['findBy']));return{'code':0xc8,'result':_0x48b0('0x168')};}else{logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x48b0('0x3d')],_0x12bb5[_0x48b0('0x164')]));this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x12bb5[_0x48b0('0x164')]));return{'code':0xc8,'result':_0x48b0('0x16a')};}};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x16d')]=function(_0x5ad731){logger['info'](util[_0x48b0('0x2b')](_0x48b0('0x16e'),_0x5ad731[_0x48b0('0x3b')]));if(!this['isConfigured'](_0x5ad731[_0x48b0('0x16f')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x5ad731,_0x48b0('0x170'));}this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')]('math\x20%s',_0x5ad731[_0x48b0('0x16f')]));var _0x25278f=eval(_0x5ad731[_0x48b0('0x16f')]);if(!this[_0x48b0('0xb8')](_0x5ad731[_0x48b0('0xe7')])){return this[_0x48b0('0x39')]['noop'](_0x48b0('0xe8'));}var _0x5cc9dc=this['getVariable'][_0x48b0('0x7f')](this,_0x5ad731[_0x48b0('0xe7')]);if(!_0x5cc9dc){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x5ad731,_0x48b0('0xe9'));}if(_[_0x48b0('0xa6')](_0x25278f)){var _0x21d81c=this;_0x25278f[_0x48b0('0xea')](function(_0x18b667,_0x2618b4){_0x21d81c['channel'][_0x48b0('0xab')](util[_0x48b0('0x2b')](_0x48b0('0x171'),_0x5cc9dc,_0x2618b4),_0x18b667);});return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x172'),_0x5cc9dc));}else{return this[_0x48b0('0x39')][_0x48b0('0xab')](_0x5cc9dc,_0x25278f);}};AGIVertices['prototype']['menu']=function(_0x8a6e4b){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x173'),_0x8a6e4b['label']));if(_0x8a6e4b[_0x48b0('0xb5')]===0x0){return this['maxRetry'](_0x8a6e4b);}_0x8a6e4b['retry']-=0x1;if(!this[_0x48b0('0xb8')](_0x8a6e4b[_0x48b0('0x122')])){return this[_0x48b0('0x39')]['error'](_0x8a6e4b,_0x48b0('0x174'));}var _0x3c8c8a=this['getSound'][_0x48b0('0x7f')](this,_0x8a6e4b[_0x48b0('0x122')]);if(!_0x3c8c8a){return this[_0x48b0('0x39')]['error'](_0x8a6e4b,_0x48b0('0x123'));}var _0x4a51c1=this[_0x48b0('0x39')]['getData'](_0x3c8c8a,_0x8a6e4b[_0x48b0('0x124')],_0x8a6e4b[_0x48b0('0x175')]);var _0x1b3b76=_0x4a51c1['result'];if(_0x4a51c1[_0x48b0('0xb1')]===-0x1){this[_0x48b0('0xe6')][_0x48b0('0x7f')](this,_0x8a6e4b,'-1');return _0x4a51c1;}else if(_0x4a51c1[_0x48b0('0xb3')]===_0x48b0('0x73')){_0x4a51c1[_0x48b0('0xb1')]=_0x4a51c1[_0x48b0('0xb1')][_0x48b0('0xa7')]>0x0?_0x4a51c1[_0x48b0('0xb1')]:'t';}else if(_[_0x48b0('0x46')](_0x4a51c1[_0x48b0('0xb1')])){_0x4a51c1[_0x48b0('0xb1')]='#';_0x1b3b76='#';}if(!this['isConfigured'](_0x8a6e4b[_0x48b0('0xe7')])){this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0xe8'));}else{var _0x7343b8=this['getVariable'][_0x48b0('0x7f')](this,_0x8a6e4b[_0x48b0('0xe7')]);if(!_0x7343b8){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x8a6e4b,_0x48b0('0xe9'));}this[_0x48b0('0x39')][_0x48b0('0xab')](_0x7343b8,_0x1b3b76);}this[_0x48b0('0xe6')][_0x48b0('0x7f')](this,_0x8a6e4b,_0x1b3b76);return _0x4a51c1;};AGIVertices[_0x48b0('0x1a')][_0x48b0('0xb9')]=function(_0x5629fa){logger[_0x48b0('0x30')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5629fa[_0x48b0('0x3b')]));return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x5629fa[_0x48b0('0x176')]||_0x5629fa[_0x48b0('0x3b')]);};AGIVertices['prototype']['pause']=function(_0x470799){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x470799[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x470799[_0x48b0('0x164')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x470799,_0x48b0('0x165'));}logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x470799[_0x48b0('0x164')]));var _0x5df26f=this[_0x48b0('0x5c')][_0x48b0('0x7f')](this,_0x470799[_0x48b0('0x177')]);var _0xf2fa39=this[_0x48b0('0x5d')][_0x48b0('0x7f')](this,_0x470799[_0x48b0('0x164')],_0x5df26f);if(_0xf2fa39){logger['info'](util[_0x48b0('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x470799[_0x48b0('0x164')]));this['channel']['noop'](util[_0x48b0('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x48b0('0x3d')],_0x470799[_0x48b0('0x164')]));return{'code':0xc8,'result':_0x48b0('0x168')};}else{logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x169'),this[_0x48b0('0x39')]['callerid'],_0x470799[_0x48b0('0x164')]));this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')](_0x48b0('0x167'),this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x470799[_0x48b0('0x164')]));return{'code':0xc8,'result':_0x48b0('0x16a')};}};AGIVertices['prototype'][_0x48b0('0x178')]=function(_0x2d9b86){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x179'),_0x2d9b86['label']));if(!this['isConfigured'](_0x2d9b86[_0x48b0('0x122')])){return this['channel'][_0x48b0('0x2e')](_0x2d9b86,_0x48b0('0x174'));}var _0x17dc13=this[_0x48b0('0x20')]['sync'](this,_0x2d9b86['file_id']);if(!_0x17dc13){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x2d9b86,_0x48b0('0x123'));}var _0x11177c=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x48b0('0x17a'),[_0x17dc13,_0x2d9b86[_0x48b0('0xf4')]]);if(_0x11177c[_0x48b0('0xb1')]===-0x1){return _0x11177c;}return this['channel'][_0x48b0('0xb9')](util[_0x48b0('0x2b')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x17dc13));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x17b')]=function(_0x3311b4){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3311b4[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x3311b4[_0x48b0('0x17c')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x3311b4,_0x48b0('0x17d'));}var _0x5ef126='';var _0xfd5c19=parseInt(_0x3311b4[_0x48b0('0x17c')],0xa);if(isNaN(_0xfd5c19)){_0x5ef126=_0x3311b4['queue_id'];}else{_0x5ef126=this[_0x48b0('0x18')][_0x48b0('0x7f')](this,_0x3311b4['queue_id']);if(!_0x5ef126){return this[_0x48b0('0x39')]['error'](_0x3311b4,'no\x20queue\x20found');}}var _0x2be495='';if(this[_0x48b0('0xb8')](_0x3311b4[_0x48b0('0x122')])){var _0x432583=this[_0x48b0('0x20')][_0x48b0('0x7f')](this,_0x3311b4[_0x48b0('0x122')]);if(_0x432583){_0x2be495=_0x432583;}}this[_0x48b0('0xe6')][_0x48b0('0x7f')](this,_0x3311b4,_0x5ef126);if(_0x3311b4[_0x48b0('0xf4')][_0x48b0('0x17e')]('x')<0x0){_0x3311b4[_0x48b0('0xf4')]+='x';}if(_0x3311b4[_0x48b0('0xf4')][_0x48b0('0x17e')]('X')<0x0){_0x3311b4[_0x48b0('0xf4')]+='X';}this[_0x48b0('0x39')][_0x48b0('0xab')](_0x48b0('0x17f'),_0x5ef126?_0x5ef126[_0x48b0('0x180')]():'');var _0x68fde1=this['channel'][_0x48b0('0x65')](_0x48b0('0x181'),[_0x5ef126,_0x3311b4['opts'],_0x3311b4[_0x48b0('0x72')],_0x2be495,_0x3311b4[_0x48b0('0x73')],_0x3311b4[_0x48b0('0x8')],_0x3311b4[_0x48b0('0x182')],_0x3311b4[_0x48b0('0x183')],'',_0x3311b4['position']]);if(_0x68fde1[_0x48b0('0xb1')]===-0x1){return _0x68fde1;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xd2'),_0x48b0('0x181'),_0x5ef126));};AGIVertices['prototype'][_0x48b0('0x184')]=function(_0x415161){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x185'),_0x415161['label']));var _0x244393=_0x415161['recordingFormat']||'wav';var _0x84d5a3=util['format'](_0x48b0('0x186'),this['channel']['uniqueid'],rs[_0x48b0('0x128')](0x5));var _0x24b03f=util['format'](_0x48b0('0x187'),FILES_PATH,_0x84d5a3,_0x244393);var _0x4d84a0=util[_0x48b0('0x2b')](_0x48b0('0x140'),FILES_PATH,_0x84d5a3);this['createSquareRecording'][_0x48b0('0x7f')](this,_0x415161,_0x84d5a3,_0x24b03f);this[_0x48b0('0x39')]['setVariable'](_0x48b0('0x188'),_0x84d5a3);logger[_0x48b0('0x30')](_0x48b0('0x189'),_0x4d84a0,_0x244393,_0x415161[_0x48b0('0x18a')],_0x415161['timeout']);return this[_0x48b0('0x39')][_0x48b0('0x15d')](_0x4d84a0,_0x244393,_0x415161['escape_digits'],_0x415161['timeout'],undefined,!![]);};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x18b')]=function(_0x524a4a){logger[_0x48b0('0x30')](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x524a4a[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x524a4a[_0x48b0('0x72')])){return this['channel'][_0x48b0('0xb9')](_0x48b0('0x18c'));}var _0x18c385=this[_0x48b0('0x71')][_0x48b0('0x7f')](this,_0x524a4a);logger['info'](util[_0x48b0('0x2b')](_0x48b0('0x18d'),util[_0x48b0('0x18e')](_0x18c385,{'showHidden':![],'depth':null})));if(!this[_0x48b0('0xb8')](_0x524a4a['variable_id'])){return this[_0x48b0('0x39')]['noop'](_0x48b0('0x18f'));}var _0x132ad9=this['getVariable'][_0x48b0('0x7f')](this,_0x524a4a[_0x48b0('0xe7')]);if(!_0x132ad9){return this[_0x48b0('0x39')]['error'](_0x524a4a,_0x48b0('0xe9'));}this[_0x48b0('0x39')][_0x48b0('0xab')](util[_0x48b0('0x2b')](_0x48b0('0x190'),_0x132ad9),_0x18c385[_0x48b0('0x83')]?_0x18c385['statusCode']:_0x48b0('0x191'));this[_0x48b0('0x39')][_0x48b0('0xab')](util[_0x48b0('0x2b')](_0x48b0('0x192'),_0x132ad9),_0x18c385[_0x48b0('0x193')]?_0x18c385['statusMessage']:'OK');if(_0x18c385[_0x48b0('0x79')]){try{this['saveRestApiResult'](_0x18c385[_0x48b0('0x79')],_0x132ad9);}catch(_0x4d2b12){logger[_0x48b0('0x2e')](util[_0x48b0('0x2b')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x132ad9));}}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x194'),_0x132ad9));};AGIVertices[_0x48b0('0x1a')]['saydigits']=function(_0x1b9b4b){logger['info'](util[_0x48b0('0x2b')](_0x48b0('0x195'),_0x1b9b4b['label']));return this[_0x48b0('0x39')][_0x48b0('0x196')](_0x1b9b4b[_0x48b0('0x197')]['replace'](/\s+/g,''),_0x1b9b4b['escape_digits']);};AGIVertices['prototype'][_0x48b0('0x198')]=function(_0x3aeaf2){logger[_0x48b0('0x30')](util['format']('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3aeaf2['label']));return this[_0x48b0('0x39')]['sayNumber'](_0x3aeaf2[_0x48b0('0x199')][_0x48b0('0x67')](/\s+/g,''),_0x3aeaf2['escape_digits']);};AGIVertices['prototype'][_0x48b0('0x19a')]=function(_0x313309){logger[_0x48b0('0x30')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x313309[_0x48b0('0x3b')]));return this[_0x48b0('0x39')][_0x48b0('0x19b')](_0x313309[_0x48b0('0x70')],_0x313309[_0x48b0('0x18a')]);};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x19c')]=function(_0x3eb88f){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x19d'),_0x3eb88f[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x3eb88f[_0x48b0('0x19e')])){return this[_0x48b0('0x39')]['noop'](_0x48b0('0x19f'));}var _0x4ec886=this[_0x48b0('0x23')][_0x48b0('0x7f')](this,_0x3eb88f[_0x48b0('0x19e')]);if(!_0x4ec886||!_0x4ec886[_0x48b0('0x1a0')]){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x3eb88f,_0x48b0('0x1a1'));}var _0x4890a1={'from':util[_0x48b0('0x2b')](_0x48b0('0x1a2'),_0x4ec886['name'],_0x4ec886[_0x48b0('0x1a3')]||_0x4ec886['Smtp']['user']),'to':_0x3eb88f['to']||'','cc':_0x3eb88f['cc']||'','bcc':_0x3eb88f[_0x48b0('0x1a4')]||'','subject':_0x3eb88f[_0x48b0('0x1a5')],'html':_0x3eb88f[_0x48b0('0x70')],'text':_0x3eb88f[_0x48b0('0x70')]};var _0x5a3745={'tls':{'rejectUnauthorized':![]}};if(_0x4ec886['Smtp'][_0x48b0('0x1a6')]){_0x5a3745['service']=_0x4ec886[_0x48b0('0x1a0')][_0x48b0('0x1a6')];}else{_0x5a3745[_0x48b0('0x1a7')]=_0x4ec886[_0x48b0('0x1a0')][_0x48b0('0x1a7')];_0x5a3745['port']=_0x4ec886[_0x48b0('0x1a0')][_0x48b0('0x1a8')];_0x5a3745[_0x48b0('0x1a9')]=_0x4ec886[_0x48b0('0x1a0')][_0x48b0('0x1a9')];}if(_0x4ec886[_0x48b0('0x1a0')][_0x48b0('0x1aa')]){_0x5a3745['auth']={'user':_0x4ec886['Smtp'][_0x48b0('0x1ab')],'pass':_0x4ec886[_0x48b0('0x1a0')][_0x48b0('0x1ac')]};}if(this['isConfigured'](_0x3eb88f[_0x48b0('0x1ad')])){}logger['debug']('sendMail\x20message',JSON[_0x48b0('0xad')](_0x4890a1));this[_0x48b0('0xe6')]['sync'](this,_0x3eb88f,_0x3eb88f[_0x48b0('0x19e')]);this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x1ae'),_0x4ec886['name']));this[_0x48b0('0x24')]['sync'](this,_0x5a3745,_0x4890a1);return this[_0x48b0('0x39')][_0x48b0('0xb9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1af')]=function(_0x45c26b){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x1b0'),_0x45c26b[_0x48b0('0x3b')]));return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x1b1'));};AGIVertices[_0x48b0('0x1a')]['sendSMS']=function(_0x3835fb){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x3835fb[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x3835fb['sms_account_id'])){return this['channel'][_0x48b0('0xb9')](_0x48b0('0x1b2'));}var _0x10b4c5=this[_0x48b0('0x36')]['sync'](this,_0x3835fb[_0x48b0('0x1b3')]);if(!_0x10b4c5){return this[_0x48b0('0x39')]['error'](_0x3835fb,_0x48b0('0x1b4'));}var _0x4299b7={'body':_0x3835fb[_0x48b0('0x1b5')],'phone':_0x3835fb['to']||'','SmsAccountId':_0x10b4c5['id']};logger[_0x48b0('0xee')](_0x48b0('0x1b6'),JSON['stringify'](_0x4299b7));this[_0x48b0('0xe6')]['sync'](this,_0x3835fb,_0x3835fb[_0x48b0('0x1b3')]);this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0x1b7'),_0x10b4c5[_0x48b0('0x16')]));this[_0x48b0('0x38')]['sync'](this,_0x4299b7);return this[_0x48b0('0x39')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x48b0('0x1a')]['set']=function(_0x194ecc){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x194ecc['label']));if(!this['isConfigured'](_0x194ecc['variable_id'])){return this[_0x48b0('0x39')]['error'](_0x194ecc,'no\x20variable\x20selected');}var _0x34fef8=this['getVariable'][_0x48b0('0x7f')](this,_0x194ecc['variable_id']);if(!_0x34fef8){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x194ecc,'no\x20variable\x20found');}return this[_0x48b0('0x39')][_0x48b0('0xab')](_0x34fef8,_0x194ecc[_0x48b0('0x1b8')]);};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1b9')]=function(_0x382711){logger['info'](util[_0x48b0('0x2b')](_0x48b0('0x1ba'),_0x382711[_0x48b0('0x3b')]));this[_0x48b0('0x39')][_0x48b0('0xb9')]('START\x20CALLY\x20SQUARE');if(_0x382711[_0x48b0('0xc8')]==='yes'){this[_0x48b0('0x39')]['noop'](_0x48b0('0x1bb'));return this[_0x48b0('0x39')][_0x48b0('0xc8')]();}return this['channel'][_0x48b0('0xb9')]('Skipped\x20Answer');};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1bc')]=function(_0x1279c0){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1279c0[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x1279c0[_0x48b0('0x1bd')])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x1279c0,_0x48b0('0x1be'));}var _0x4c58a1=this[_0x48b0('0x1b')]['sync'](this,_0x1279c0[_0x48b0('0x1bd')]);if(!this['isConfigured'](_0x4c58a1)){return this['channel'][_0x48b0('0x2e')](_0x1279c0,util[_0x48b0('0x2b')](_0x48b0('0x1bf'),_0x1279c0[_0x48b0('0x1bd')]));}if(_0x4c58a1===this[_0x48b0('0x39')][_0x48b0('0x3c')]){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x1279c0,_0x48b0('0x1c0'));}this[_0x48b0('0xe6')]['sync'](this,_0x1279c0,_0x4c58a1);var _0x59d7ca=this[_0x48b0('0x39')][_0x48b0('0x65')](_0x48b0('0x1c1'),util[_0x48b0('0x2b')](_0x48b0('0x1c2'),config[_0x48b0('0x8')]['host']||_0x48b0('0x1c3'),_0x4c58a1,this[_0x48b0('0x39')][_0x48b0('0x3c')]));if(_0x59d7ca[_0x48b0('0xb1')]===-0x1){return _0x59d7ca;}return this['channel'][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xd2'),'AGI',_0x4c58a1));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1c4')]=function(_0x5792bb){logger['info'](util[_0x48b0('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5792bb[_0x48b0('0x3b')]));var _0x32b9e0=this[_0x48b0('0x64')][_0x48b0('0x7f')](this,_0x5792bb[_0x48b0('0xc6')]);this[_0x48b0('0xe6')][_0x48b0('0x7f')](this,_0x5792bb,_0x5792bb[_0x48b0('0xc6')]);if(this['isConfigured'](_0x5792bb[_0x48b0('0xe7')])){var _0x5a33cd=this['getVariable'][_0x48b0('0x7f')](this,_0x5792bb[_0x48b0('0xe7')]);if(_0x5a33cd){this[_0x48b0('0x39')][_0x48b0('0xab')](_0x5a33cd,_0x32b9e0);return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0x1c5'),_0x5792bb['command'],_0x5a33cd));}}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0x1c6'),_0x5792bb[_0x48b0('0xc6')]));};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1c7')]=function(_0x24da47){logger[_0x48b0('0x30')](util['format'](_0x48b0('0x1c8'),_0x24da47[_0x48b0('0x3b')]));_0x24da47[_0x48b0('0x70')]=_0x24da47[_0x48b0('0x70')][_0x48b0('0x67')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x48b0('0xb8')](_0x24da47['apiKey'])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0x1c9'));}if(!this[_0x48b0('0xb8')](_0x24da47[_0x48b0('0x70')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')](_0x48b0('0xba'));}this['channel']['noop'](util['format'](_0x48b0('0x1ca'),_0x24da47['text']));var _0x4b5b53=this[_0x48b0('0x68')][_0x48b0('0x7f')](this,_0x24da47);if(_0x4b5b53){this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x1cb'),_0x4b5b53));var _0x3872ae=this['channel'][_0x48b0('0x114')](_0x4b5b53);try{fs['unlink'](_0x4b5b53+'.wav');}catch(_0x1b1109){logger[_0x48b0('0x2e')](_0x1b1109);}return _0x3872ae;}return this['channel'][_0x48b0('0x2e')](_0x24da47,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1cc')]=function(_0x48442f){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x1cd'),_0x48442f[_0x48b0('0x3b')]));_0x48442f[_0x48b0('0x70')]=_0x48442f[_0x48b0('0x70')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x48b0('0xb8')](_0x48442f[_0x48b0('0x70')])){return this[_0x48b0('0x39')][_0x48b0('0xb9')]('no\x20text\x20configured');}this[_0x48b0('0x39')]['noop'](util[_0x48b0('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x48442f[_0x48b0('0x70')]));var _0x62bfe0=this[_0x48b0('0x6f')][_0x48b0('0x7f')](this,_0x48442f);if(_0x62bfe0){this[_0x48b0('0x39')][_0x48b0('0xb9')](util['format'](_0x48b0('0x1ce'),_0x62bfe0));var _0x39a867=this[_0x48b0('0x39')][_0x48b0('0x114')](_0x62bfe0);try{fs[_0x48b0('0x135')](_0x62bfe0+_0x48b0('0x115'));}catch(_0x107c81){logger[_0x48b0('0x2e')](_0x107c81);}return _0x39a867;}return this[_0x48b0('0x39')]['error'](_0x48442f,_0x48b0('0x1cf'));};AGIVertices[_0x48b0('0x1a')]['unpause']=function(_0x49950e){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x1d0'),_0x49950e['label']));if(!this['isConfigured'](_0x49950e['findBy'])){return this['channel'][_0x48b0('0x2e')](_0x49950e,'no\x20find\x20by\x20configured');}logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x166'),this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x49950e[_0x48b0('0x164')]));var _0x50dc28=this['agentUnpause'][_0x48b0('0x7f')](this,_0x49950e['findBy']);if(_0x50dc28){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x167'),this[_0x48b0('0x39')]['callerid'],_0x49950e[_0x48b0('0x164')]));this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x167'),this[_0x48b0('0x39')][_0x48b0('0x3d')],_0x49950e[_0x48b0('0x164')]));return{'code':0xc8,'result':_0x48b0('0x168')};}else{logger[_0x48b0('0x30')](util['format'](_0x48b0('0x169'),this['channel'][_0x48b0('0x3d')],_0x49950e[_0x48b0('0x164')]));this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0x169'),this['channel'][_0x48b0('0x3d')],_0x49950e[_0x48b0('0x164')]));return{'code':0xc8,'result':_0x48b0('0x16a')};}};AGIVertices[_0x48b0('0x1a')][_0x48b0('0x1d1')]=function(_0x3df492){logger[_0x48b0('0x30')](util[_0x48b0('0x2b')](_0x48b0('0x1d2'),_0x3df492[_0x48b0('0x3b')]));var _0x42e60e=this['channel'][_0x48b0('0x65')]('VOICEMAIL',[_0x3df492['mailbox'],_0x3df492['options']]);if(_0x42e60e[_0x48b0('0xb1')]===-0x1){return _0x42e60e;}return this[_0x48b0('0x39')][_0x48b0('0xb9')](util[_0x48b0('0x2b')](_0x48b0('0xd2'),_0x48b0('0x1d3'),_0x3df492[_0x48b0('0x1d4')]));};AGIVertices['prototype'][_0x48b0('0x1d5')]=function(_0x2758fe){logger['info'](util[_0x48b0('0x2b')](_0x48b0('0x1d6'),_0x2758fe[_0x48b0('0x3b')]));if(!this[_0x48b0('0xb8')](_0x2758fe['variable_id'])){return this[_0x48b0('0x39')][_0x48b0('0x2e')](_0x2758fe,'no\x20variable\x20selected');}var _0x4c33a7=this[_0x48b0('0x13')][_0x48b0('0x7f')](this,_0x2758fe[_0x48b0('0xe7')]);if(!_0x4c33a7){return this[_0x48b0('0x39')]['error'](_0x2758fe,_0x48b0('0xe9'));}var _0x355704=this[_0x48b0('0x39')][_0x48b0('0x13')](_0x4c33a7);return{'code':0xc8,'result':_0x355704[_0x48b0('0xb3')]?_0x355704[_0x48b0('0xb3')]:'-'};};String[_0x48b0('0x1a')][_0x48b0('0x1d7')]=function(_0x3aef98,_0x4c0d4d){return this[_0x48b0('0xaf')](_0x3aef98)[_0x48b0('0x1d8')](_0x4c0d4d);};module[_0x48b0('0x1d9')]=AGIVertices; \ No newline at end of file +var _0x27bf=['Executed\x20command\x20MRCPSynth\x20%s','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','no\x20database\x20selected','odbc_id','no\x20query\x20configured','replace','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','getUser','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','dialogflowV2','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','username','ndassistant_url','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','toString','test','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','unlink','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','awsLex','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','priority','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','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','Enter\x20in\x20LOGOUT\x20(%s)\x20block','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','getData','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','no\x20file\x20audio\x20found','opts','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','%s_STATUS_MESSAGE','statusMessage','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','getMailAccount','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','pass','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','debug','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','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','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','getVariableById','then','name','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','catch','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','interval','map','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','isNil','timezones','utcOffset','scheduledat','add','insertContact','minutes','getPause','getPauseById','agentPause','agentUnpause','agentLogout','agent','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','restAPI','url','timeout','number','POST','PUT','method','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','uri','render','stringify','statusCode','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','key','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_secret_access_key','Amy','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','parse','split','replaceAll','getVariable','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','no\x20text\x20configured','exec','MRCPSynth','result','noop'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x27bf,0x117));var _0xf27b=function(_0x155256,_0x5a04ca){_0x155256=_0x155256-0x0;var _0x999c12=_0x27bf[_0x155256];return _0x999c12;};'use strict';var fs=require('fs');var path=require(_0xf27b('0x0'));var util=require(_0xf27b('0x1'));var _=require(_0xf27b('0x2'));var sh=require(_0xf27b('0x3'));var odbc=require(_0xf27b('0x4'))();var rs=require(_0xf27b('0x5'));var moment=require(_0xf27b('0x6'));var Mustache=require(_0xf27b('0x7'));var rp=require(_0xf27b('0x8'));var logger=require(_0xf27b('0x9'))(_0xf27b('0xa'));var config=require('../../config/environment');var shared=require(_0xf27b('0xb'));var scripts=require(_0xf27b('0xc'));var FILES_PATH=_0xf27b('0xd');var recursiveMapAttributes=[_0xf27b('0xe'),_0xf27b('0xf')];var verticesWithRetry=[_0xf27b('0x10'),'getdigits',_0xf27b('0x11')];var AGIVertices=function(_0x9ca64e,_0x969a6f,_0x122944){this[_0xf27b('0x12')]=_0x9ca64e;this[_0xf27b('0x13')]=_0x969a6f;this[_0xf27b('0x14')]=_0x122944;};AGIVertices['prototype']['getVariable']=function(_0x4876b0,_0x3526ec){this['rpc'][_0xf27b('0x15')](_0x4876b0)[_0xf27b('0x16')](function(_0x308389){_0x3526ec(null,_0x308389?_0x308389[_0xf27b('0x17')]:![]);})['catch'](function(_0x324006){_0x3526ec(_0x324006);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x19')]=function(_0x32e55f,_0x4bbf93){this[_0xf27b('0x13')][_0xf27b('0x1a')](_0x32e55f)['then'](function(_0x552f2d){_0x4bbf93(null,_0x552f2d?_0x552f2d[_0xf27b('0x17')]:![]);})['catch'](function(_0x24f610){_0x4bbf93(_0x24f610);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1b')]=function(_0x5305d9,_0x42f512){this[_0xf27b('0x13')][_0xf27b('0x1c')](_0x5305d9)['then'](function(_0x472f1a){_0x42f512(null,_0x472f1a?_0x472f1a[_0xf27b('0x17')]:![]);})[_0xf27b('0x1d')](function(_0x1e58e4){_0x42f512(_0x1e58e4);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1e')]=function(_0x28b7e6,_0x5f1222){this[_0xf27b('0x13')]['getSquareOdbcById'](_0x28b7e6)[_0xf27b('0x16')](function(_0x5e0ca4){_0x5f1222(null,_0x5e0ca4?_0x5e0ca4[_0xf27b('0x1f')]:![]);})[_0xf27b('0x1d')](function(_0x4124b5){_0x5f1222(_0x4124b5);});};AGIVertices[_0xf27b('0x18')]['getUser']=function(_0x43cee4,_0x162328){this[_0xf27b('0x13')][_0xf27b('0x20')](_0x43cee4)['then'](function(_0x3f4814){_0x162328(null,_0x3f4814?_0x3f4814[_0xf27b('0x17')]:![]);})[_0xf27b('0x1d')](function(_0xd9a319){_0x162328(_0xd9a319);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x21')]=function(_0x508db9,_0x4d9e29){this['rpc'][_0xf27b('0x22')](_0x508db9)[_0xf27b('0x16')](function(_0x1166db){_0x4d9e29(null,_0x1166db?_0x1166db['name']:![]);})[_0xf27b('0x1d')](function(_0x5dc2e7){_0x4d9e29(_0x5dc2e7);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x23')]=function(_0x2817cd,_0x1502ad){var _0x5651f2=this;this[_0xf27b('0x13')][_0xf27b('0x24')](_0x2817cd)['then'](function(_0x3ead4d){_0x1502ad(null,_0x3ead4d?_0x5651f2[_0xf27b('0x25')](_0x3ead4d[_0xf27b('0x26')]):![]);})[_0xf27b('0x1d')](function(_0x1a8a25){_0x1502ad(_0x1a8a25);});};AGIVertices[_0xf27b('0x18')]['getMailAccount']=function(_0x5202c1,_0x780e4){this[_0xf27b('0x13')][_0xf27b('0x27')](_0x5202c1)[_0xf27b('0x16')](function(_0x6033f1){_0x780e4(null,_0x6033f1?_0x6033f1:![]);})[_0xf27b('0x1d')](function(_0x9b7f){_0x780e4(_0x9b7f);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x28')]=function(_0x4ddacc,_0x83c81c,_0x616d93){this[_0xf27b('0x14')][_0xf27b('0x28')](_0x4ddacc,_0x83c81c)[_0xf27b('0x16')](function(){_0x616d93(null);})['catch'](function(_0x30fb76){_0x616d93(_0x30fb76);});};AGIVertices[_0xf27b('0x18')]['getIntervals']=function(_0x5f3356,_0x291096){this[_0xf27b('0x13')][_0xf27b('0x29')](_0x5f3356)[_0xf27b('0x16')](function(_0x4ce989){if(_0x4ce989){if(_0x4ce989['IntervalId']){_0x291096(null,[_0x4ce989[_0xf27b('0x2a')]]);}else{_0x291096(null,_[_0xf27b('0x2b')](_0x4ce989['Intervals'],'interval'));}}else{_0x291096(null,![]);}})[_0xf27b('0x1d')](function(_0x21698e){_0x291096(_0x21698e);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x25')]=function(_0x3f435a){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x3f435a);};AGIVertices[_0xf27b('0x18')][_0xf27b('0x2c')]=function(_0x18f143,_0x105ea7,_0x5d4e4f){odbc[_0xf27b('0x2d')](_0x18f143,function(_0x29d26a){if(_0x29d26a){logger[_0xf27b('0x2e')](_0xf27b('0x2f'),_0x29d26a);_0x5d4e4f(_0x29d26a);}else{logger[_0xf27b('0x30')]('ODBC\x20connection\x20successfully');odbc[_0xf27b('0x31')](_0x105ea7,function(_0x5f8955,_0x35934e){if(_0x5f8955){logger[_0xf27b('0x30')](_0xf27b('0x32'),_0x105ea7);_0x5d4e4f(_0x5f8955);}else{logger[_0xf27b('0x30')]('Query\x20executed\x20correctly\x20%s',_0x105ea7);odbc[_0xf27b('0x33')](function(_0x577123){if(_0x577123){logger[_0xf27b('0x2e')](_0xf27b('0x34'),_0x577123);}_0x5d4e4f(null,_0x35934e);});}});}});};AGIVertices[_0xf27b('0x18')]['getSmsAccount']=function(_0x3f28ed,_0xa305ff){this[_0xf27b('0x13')]['getSmsAccountById'](_0x3f28ed)[_0xf27b('0x16')](function(_0xc0cd27){_0xa305ff(null,_0xc0cd27?_0xc0cd27:![]);})[_0xf27b('0x1d')](function(_0x253069){_0xa305ff(_0x253069);});};AGIVertices['prototype']['createSmsMessage']=function(_0x5a376d,_0x1ef3f7){this[_0xf27b('0x13')][_0xf27b('0x35')](_0x5a376d)[_0xf27b('0x16')](function(_0x5966e9){_0x1ef3f7(null,_0x5966e9);})[_0xf27b('0x1d')](function(_0x4f79f1){_0x1ef3f7(_0x4f79f1);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x36')]=function(_0x2a2d3b,_0x3ca3a9,_0x385ca6){this[_0xf27b('0x13')][_0xf27b('0x36')]({'uniqueid':this[_0xf27b('0x12')][_0xf27b('0x37')],'node':_0x2a2d3b[_0xf27b('0x38')],'application':_0x2a2d3b[_0xf27b('0x39')],'data':_0x3ca3a9||null,'project_name':this[_0xf27b('0x12')][_0xf27b('0x3a')],'callerid':this[_0xf27b('0x12')][_0xf27b('0x3b')]})[_0xf27b('0x16')](function(_0x4e482b){if(_0x385ca6){_0x385ca6(null,_0x4e482b);}})[_0xf27b('0x1d')](function(_0x75cfea){if(_0x385ca6){_0x385ca6(_0x75cfea);}});};AGIVertices[_0xf27b('0x18')]['createSquareRecording']=function(_0x27a94f,_0x2c78b5,_0x14d6d5,_0x1fb4c5){this[_0xf27b('0x13')][_0xf27b('0x3c')]({'uniqueid':this[_0xf27b('0x12')][_0xf27b('0x37')],'callerid':this[_0xf27b('0x12')][_0xf27b('0x3b')],'calleridname':this['channel'][_0xf27b('0x3d')],'context':this[_0xf27b('0x12')][_0xf27b('0x3e')],'extension':this[_0xf27b('0x12')][_0xf27b('0x3f')],'priority':this[_0xf27b('0x12')]['priority'],'accountcode':this['channel'][_0xf27b('0x40')],'dnid':this[_0xf27b('0x12')][_0xf27b('0x41')],'projectName':this[_0xf27b('0x12')][_0xf27b('0x3a')],'saveName':_0x2c78b5,'filename':_0x27a94f[_0xf27b('0x42')]||_0x2c78b5,'savePath':_0x14d6d5})['then'](function(_0x3afd95){_0x1fb4c5(null,_0x3afd95);})['catch'](function(_0x2bd074){_0x1fb4c5(_0x2bd074);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x43')]=function(_0xd1373e,_0x479f98,_0x52a4c6,_0x33148b,_0x320915){this[_0xf27b('0x13')][_0xf27b('0x43')]({'uniqueid':this['channel']['uniqueid'],'body':_0xd1373e,'direction':_0x479f98,'providerName':_0x52a4c6,'providerResponse':_0x33148b})[_0xf27b('0x16')](function(_0x19e9dd){if(_0x320915){_0x320915(null,_0x19e9dd);}})['catch'](function(_0xe4ea01){if(_0x320915){_0x320915(_0xe4ea01);}});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x44')]=function(_0x4aaa66,_0x21a336){var _0x5b929e=this;var _0x178b73=0x0;var _0x512319={'firstName':_[_0xf27b('0x45')](_0x4aaa66[_0xf27b('0x17')])||_['isNil'](_0x4aaa66[_0xf27b('0x17')])?'callback_'+Math['random']():_0x4aaa66[_0xf27b('0x17')],'lastName':_[_0xf27b('0x45')](_0x4aaa66['lastName'])||_['isNil'](_0x4aaa66['lastName'])?null:_0x4aaa66[_0xf27b('0x46')],'phone':_0x4aaa66[_0xf27b('0x47')],'ListId':_0x4aaa66[_0xf27b('0x48')],'scheduledat':_0x4aaa66[_0xf27b('0x49')],'callbackUniqueid':this[_0xf27b('0x12')][_0xf27b('0x37')],'tags':_0xf27b('0x4a'),'description':_0xf27b('0x4b')+_0x4aaa66[_0xf27b('0x49')]['toString'](),'priority':_0x4aaa66[_0xf27b('0x4c')]};if(_[_0xf27b('0x4d')](_0x4aaa66,'dialTimezone')){if(!_['isNil'](_0x4aaa66['dialTimezone'])){var _0x257c1a=_0x4aaa66['dialTimezone'];if(_0x4aaa66[_0xf27b('0x4e')]==_0xf27b('0x4f')){this[_0xf27b('0x13')][_0xf27b('0x50')]({'phone':_0x4aaa66[_0xf27b('0x47')]})[_0xf27b('0x16')](function(_0x13e231){if(!_[_0xf27b('0x51')](_0x13e231)){var _0x578c4d=_0x13e231['dialTimezone'];if(!_[_0xf27b('0x51')](_0x578c4d)){var _0x229569=shared[_0xf27b('0x52')][_0x578c4d];if(!_[_0xf27b('0x51')](_0x229569)){var _0x2d2665=-0x1*_0x229569[_0xf27b('0x53')];_0x512319[_0xf27b('0x54')]=moment(_0x4aaa66[_0xf27b('0x54')])[_0xf27b('0x55')](_0x2d2665,'minutes');_0x5b929e[_0xf27b('0x56')](_0x512319,_0x4aaa66,_0x21a336);}else{_0x5b929e[_0xf27b('0x56')](_0x512319,_0x4aaa66,_0x21a336);}}else{_0x5b929e[_0xf27b('0x56')](_0x512319,_0x4aaa66,_0x21a336);}}else{_0x5b929e['insertContact'](_0x512319,_0x4aaa66,_0x21a336);}});}else{var _0x178b73=shared['timezones'][_0x257c1a];if(!_[_0xf27b('0x51')](_0x178b73)){var _0x121d14=-0x1*_0x178b73[_0xf27b('0x53')];_0x512319['scheduledat']=moment(_0x4aaa66[_0xf27b('0x54')])[_0xf27b('0x55')](_0x121d14,_0xf27b('0x57'));_0x5b929e[_0xf27b('0x56')](_0x512319,_0x4aaa66,_0x21a336);}else{_0x5b929e[_0xf27b('0x56')](_0x512319,_0x4aaa66,_0x21a336);}}}else{_0x5b929e[_0xf27b('0x56')](_0x512319,_0x4aaa66,_0x21a336);}}else{_0x5b929e[_0xf27b('0x56')](_0x512319,_0x4aaa66,_0x21a336);}};AGIVertices[_0xf27b('0x18')][_0xf27b('0x58')]=function(_0x40ef0f,_0x93adfa){this[_0xf27b('0x13')][_0xf27b('0x59')](_0x40ef0f)[_0xf27b('0x16')](function(_0x3e5182){_0x93adfa(null,_0x3e5182?_0x3e5182[_0xf27b('0x17')]:![]);})[_0xf27b('0x1d')](function(_0x56535d){_0x93adfa(_0x56535d);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x5a')]=function(_0x11d310,_0x3cb377,_0x4d5652){var _0x5f4298={'role':'agent'};_0x5f4298[_0x11d310]=this[_0xf27b('0x12')][_0xf27b('0x3b')];this[_0xf27b('0x13')][_0xf27b('0x5a')](_0x5f4298,_0x3cb377,this['channel'][_0xf27b('0x37')])[_0xf27b('0x16')](function(_0x4482ef){_0x4d5652(null,_[_0xf27b('0x51')](_0x4482ef)?![]:!![]);})[_0xf27b('0x1d')](function(_0x20d24d){logger[_0xf27b('0x2e')](_0x20d24d);_0x4d5652(null,![]);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x5b')]=function(_0x581926,_0x133e97){var _0x17fae1={'role':'agent'};_0x17fae1[_0x581926]=this[_0xf27b('0x12')]['callerid'];this[_0xf27b('0x13')]['agentUnpause'](_0x17fae1)[_0xf27b('0x16')](function(_0x18cff4){_0x133e97(null,_[_0xf27b('0x51')](_0x18cff4)?![]:!![]);})['catch'](function(_0x21a3e2){logger[_0xf27b('0x2e')](_0x21a3e2);_0x133e97(null,![]);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x5c')]=function(_0x3cccf7,_0x4d0ad3){var _0x906b83={'role':_0xf27b('0x5d')};_0x906b83[_0x3cccf7]=this[_0xf27b('0x12')][_0xf27b('0x3b')];this[_0xf27b('0x13')][_0xf27b('0x5c')](_0x906b83)[_0xf27b('0x16')](function(_0x5e0c96){_0x4d0ad3(null,_[_0xf27b('0x51')](_0x5e0c96)?![]:!![]);})[_0xf27b('0x1d')](function(_0xe445f3){logger[_0xf27b('0x2e')](_0xe445f3);_0x4d0ad3(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x3a1c63,_0x1869a6){var _0x203a46={'role':_0xf27b('0x5d')};_0x203a46[_0x3a1c63]=this['channel'][_0xf27b('0x3b')];var _0x1b995a=_0x3a1c63!=_0xf27b('0x5e')?util[_0xf27b('0x5f')](_0xf27b('0x60'),_0xf27b('0x61'),this[_0xf27b('0x12')][_0xf27b('0x3b')]):undefined;this[_0xf27b('0x13')]['agentLogin'](_0x203a46,_0x1b995a)[_0xf27b('0x16')](function(_0x2b6978){_0x1869a6(null,_[_0xf27b('0x51')](_0x2b6978)?![]:!![]);})[_0xf27b('0x1d')](function(_0xfd1f63){logger[_0xf27b('0x2e')](_0xfd1f63);_0x1869a6(null,![]);});};AGIVertices['prototype'][_0xf27b('0x62')]=function(_0x35061a,_0x5cbc36){sh['exec'](_[_0xf27b('0x63')](_0x35061a),function(_0x22dbcc,_0x4aa7b6){var _0x58666b=_0x4aa7b6['replace'](/(\r\n|\n|\r)/gm,'');_0x5cbc36(null,_0x58666b);});};AGIVertices[_0xf27b('0x18')]['googleCloudTTS']=function(_0x32db4,_0x52fda2){scripts[_0xf27b('0x64')](_0x32db4[_0xf27b('0x65')],_0x32db4[_0xf27b('0x66')]||_0xf27b('0x67'),_0x32db4[_0xf27b('0x67')],_0x32db4[_0xf27b('0x68')]||_0xf27b('0x69'),_0x32db4[_0xf27b('0x6a')]||_0xf27b('0x6b'),_0x32db4[_0xf27b('0x6c')]||'MP3')[_0xf27b('0x16')](function(_0x17b7b8){_0x52fda2(null,_0x17b7b8);})[_0xf27b('0x1d')](function(_0x3e2cb5){_0x52fda2(_0x3e2cb5);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x6d')]=function(_0x26e36d,_0x1bc6f8){scripts[_0xf27b('0x6d')](_0x26e36d[_0xf27b('0x67')],_0x26e36d['google_tts_language']||'en',0x1)[_0xf27b('0x16')](function(_0x22a74b){_0x1bc6f8(null,_0x22a74b);})['catch'](function(_0x2c285e){_0x1bc6f8(_0x2c285e);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x6e')]=function(_0x4fc9e5,_0x2113ce){var _0x1db8d2={'uri':_0x4fc9e5[_0xf27b('0x6f')],'method':_0x4fc9e5['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4fc9e5[_0xf27b('0x70')])===_0xf27b('0x71')&&parseInt(_0x4fc9e5[_0xf27b('0x70')])>=0x1?parseInt(_0x4fc9e5[_0xf27b('0x70')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xf27b('0x72'),_0xf27b('0x73')],_0x1db8d2[_0xf27b('0x74')][_0xf27b('0x75')]())){try{_0x1db8d2[_0xf27b('0x76')]=_0x4fc9e5[_0xf27b('0xf')]?JSON['parse'](_0x4fc9e5[_0xf27b('0xf')]):{};}catch(_0x2b7175){logger['error'](_0xf27b('0x77'),_0x2b7175);}}try{_0x1db8d2[_0xf27b('0x78')]=_0x4fc9e5['rawHeaders']?JSON['parse'](_0x4fc9e5['rawHeaders']):{};}catch(_0x17f3a4){logger['error'](_0xf27b('0x79'),_0x17f3a4);}if(_0x4fc9e5['computedVariables']){try{var _0x274db9=require(_0x4fc9e5['computedVariables'])[_0xf27b('0x7a')](this,_0x1db8d2);_0x1db8d2[_0xf27b('0x7b')]=Mustache['render'](_0x4fc9e5['url'],_0x274db9,{},['$$','$$']);if(_0x1db8d2['headers']){_0x1db8d2[_0xf27b('0x78')]=JSON['parse'](Mustache[_0xf27b('0x7c')](JSON[_0xf27b('0x7d')](_0x1db8d2[_0xf27b('0x78')]),_0x274db9,{},['$$','$$']));}if(_0x1db8d2['body']){_0x1db8d2['body']=JSON['parse'](Mustache[_0xf27b('0x7c')](JSON['stringify'](_0x1db8d2[_0xf27b('0x76')]),_0x274db9,{},['$$','$$']));}}catch(_0x3b1543){logger[_0xf27b('0x2e')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3b1543);}}rp(_0x1db8d2)[_0xf27b('0x16')](function(_0x11b584){var _0x4a753e={'statusCode':_0x11b584['statusCode']||0xc8,'statusMessage':_0x11b584['statusMessage']||'OK','headers':_0x11b584[_0xf27b('0x78')]||{},'body':_0x11b584[_0xf27b('0x76')]||{}};_0x2113ce(null,_0x4a753e);})[_0xf27b('0x1d')](function(_0x529012){var _0x1ab089={'statusCode':_0x529012[_0xf27b('0x7e')]||0x1f4,'statusMessage':_0x529012[_0xf27b('0x7f')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x529012[_0xf27b('0x80')][_0xf27b('0x78')]||{},'body':_0x529012['options']['body']||{}};_0x2113ce(null,_0x1ab089);});};AGIVertices['prototype'][_0xf27b('0x81')]=function(_0x54432a,_0x27098b){scripts['googleDialogflow'](this['channel'][_0xf27b('0x37')],_0x54432a['key'],_0x54432a[_0xf27b('0x67')],_0x54432a[_0xf27b('0x82')]||'en')[_0xf27b('0x16')](function(_0x7d2bd6){_0x27098b(null,_0x7d2bd6);})[_0xf27b('0x1d')](function(_0x8e52b3){_0x27098b(_0x8e52b3);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x83')]=function(_0x3c7609,_0x2926fc){scripts[_0xf27b('0x83')](this[_0xf27b('0x12')][_0xf27b('0x37')],_0x3c7609[_0xf27b('0x84')],_0x3c7609['client_email'],_0x3c7609[_0xf27b('0x85')],_0x3c7609['text'],_0x3c7609[_0xf27b('0x86')]||'en')[_0xf27b('0x16')](function(_0x4ea218){_0x2926fc(null,_0x4ea218);})[_0xf27b('0x1d')](function(_0x52e00d){_0x2926fc(_0x52e00d);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x87')]=function(_0x4c8dfc,_0x7e972c){scripts['sestekNDA'](this[_0xf27b('0x12')],_0x4c8dfc)[_0xf27b('0x16')](function(_0x4f5620){_0x7e972c(null,_0x4f5620);})[_0xf27b('0x1d')](function(_0x248619){_0x7e972c(_0x248619);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x88')]=function(_0x40bd76,_0x500f8b){scripts[_0xf27b('0x88')](_0x40bd76[_0xf27b('0x89')],_0x40bd76[_0xf27b('0x67')],_0x40bd76['ispeech_tts_language']||_0xf27b('0x69'),_0x40bd76[_0xf27b('0x8a')])['then'](function(_0x99a0b1){_0x500f8b(null,_0x99a0b1);})[_0xf27b('0x1d')](function(_0x5c5ccd){_0x500f8b(_0x5c5ccd);});};AGIVertices['prototype'][_0xf27b('0x8b')]=function(_0x509f84,_0x5e48d2,_0x5e8c9a){scripts['ispeechASR'](_0x5e48d2,_0x509f84[_0xf27b('0x89')],_0x509f84[_0xf27b('0x8c')]||'en-US',this['isConfigured'](_0x509f84[_0xf27b('0x8d')])?_0x509f84['model']:undefined)[_0xf27b('0x16')](function(_0x354047){_0x5e8c9a(null,_0x354047);})[_0xf27b('0x1d')](function(_0x16ec1f){_0x5e8c9a(_0x16ec1f);});};AGIVertices['prototype']['awsPolly']=function(_0x354f96,_0x262c77){scripts[_0xf27b('0x8e')](_0x354f96['aws_access_key_id'],_0x354f96[_0xf27b('0x8f')],_0x354f96['aws_polly_region'],_0x354f96['aws_polly_voice']||_0xf27b('0x90'),_0x354f96[_0xf27b('0x67')],_0x354f96['aws_text_type']||_0xf27b('0x67'))[_0xf27b('0x16')](function(_0x509fb2){_0x262c77(null,_0x509fb2);})['catch'](function(_0xb191b7){_0x262c77(_0xb191b7);});};AGIVertices['prototype']['awsLex']=function(_0x2baabd,_0x25d710){scripts['awsLex'](this[_0xf27b('0x12')][_0xf27b('0x37')],_0x2baabd['aws_access_key_id'],_0x2baabd[_0xf27b('0x8f')],_0x2baabd['aws_lex_region'],_0x2baabd['text'],_0x2baabd[_0xf27b('0x91')])[_0xf27b('0x16')](function(_0x4c74c5){_0x25d710(null,_0x4c74c5);})[_0xf27b('0x1d')](function(_0x1a845d){_0x25d710(_0x1a845d);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x92')]=function(_0x49c56a,_0x7544af,_0x58ed48){scripts[_0xf27b('0x92')](_0x7544af,_0x49c56a[_0xf27b('0x89')],_0x49c56a[_0xf27b('0x93')]||'en-US')['then'](function(_0xb66081){_0x58ed48(null,_0xb66081);})[_0xf27b('0x1d')](function(_0x2c62dc){_0x58ed48(_0x2c62dc);});};AGIVertices['prototype'][_0xf27b('0x94')]=function(_0x2ef6a0,_0x579bc9,_0x5305ba){scripts[_0xf27b('0x94')](_0x579bc9,_0x2ef6a0[_0xf27b('0x95')],_0x2ef6a0[_0xf27b('0x96')],_0x2ef6a0[_0xf27b('0x7b')])['then'](function(_0x598549){_0x5305ba(null,_0x598549);})['catch'](function(_0x4d9a08){_0x5305ba(_0x4d9a08);});};AGIVertices[_0xf27b('0x18')][_0xf27b('0x97')]=function(_0x3fb300){var _0x13d2eb=_[_0xf27b('0x98')](verticesWithRetry,_0x3fb300[_0xf27b('0x39')])?_0x3fb300:_[_0xf27b('0x99')](_0x3fb300);for(var _0x15db43 in _0x13d2eb){if(_0x13d2eb[_0xf27b('0x9a')](_0x15db43)){if(_0x13d2eb[_0x15db43]&&_[_0xf27b('0x9b')](_0x13d2eb[_0x15db43])){if(_[_0xf27b('0x98')](recursiveMapAttributes,_0x15db43)){_0x13d2eb[_0x15db43]=this[_0xf27b('0x9c')](_0x13d2eb[_0x15db43]);}else{_0x13d2eb[_0x15db43]=this[_0xf27b('0x9d')](_0x13d2eb[_0x15db43]);}}}}return _0x13d2eb;};AGIVertices[_0xf27b('0x18')][_0xf27b('0x9e')]=function(_0x3a49fe){for(var _0x3a1a63 in _0x3a49fe){if(_0x3a49fe[_0xf27b('0x9a')](_0x3a1a63)){if(_[_0xf27b('0x9f')](_0x3a49fe[_0x3a1a63])){this['recursiveNodeIndex'](_0x3a49fe[_0x3a1a63]);}else if(_['isArray'](_0x3a49fe[_0x3a1a63])){for(var _0x69aab6=0x0;_0x69aab6<_0x3a49fe[_0x3a1a63][_0xf27b('0xa0')];_0x69aab6++){this[_0xf27b('0x9e')](_0x3a49fe[_0x3a1a63][_0x69aab6]);}}else if(_[_0xf27b('0x9b')](_0x3a49fe[_0x3a1a63])){_0x3a49fe[_0x3a1a63]=this[_0xf27b('0x9d')](_0x3a49fe[_0x3a1a63]);}}}};AGIVertices[_0xf27b('0x18')][_0xf27b('0xa1')]=function(_0x333e53,_0x506f12){for(var _0x4fb9cf in _0x333e53){if(_0x333e53[_0xf27b('0x9a')](_0x4fb9cf)){if(_[_0xf27b('0x9f')](_0x333e53[_0x4fb9cf])){if(!_[_0xf27b('0x45')](_0x333e53[_0x4fb9cf])){this[_0xf27b('0xa1')](_0x333e53[_0x4fb9cf],util[_0xf27b('0x5f')](_0xf27b('0xa2'),_0x506f12,_0x4fb9cf));}}else if(_[_0xf27b('0xa3')](_0x333e53[_0x4fb9cf])){for(var _0x3eba29=0x0;_0x3eba29<_0x333e53[_0x4fb9cf]['length'];_0x3eba29++){this[_0xf27b('0xa1')](_0x333e53[_0x4fb9cf][_0x3eba29],util[_0xf27b('0x5f')]('%s.%s',_0x506f12,_0x4fb9cf+'['+_0x3eba29+']'));}}else{if(!_[_0xf27b('0x51')](_0x333e53[_0x4fb9cf])){this['channel'][_0xf27b('0xa4')](util['format'](_0xf27b('0xa2'),_0x506f12,_0x4fb9cf),_0x333e53[_0x4fb9cf]);}}}}};AGIVertices[_0xf27b('0x18')][_0xf27b('0x9c')]=function(_0x1c8303){try{var _0x2da4a6=JSON[_0xf27b('0xa5')](_0x1c8303);this['recursiveNodeIndex'](_0x2da4a6);return JSON[_0xf27b('0x7d')](_0x2da4a6);}catch(_0x2bf19f){return this[_0xf27b('0x9d')](_0x1c8303);}};AGIVertices[_0xf27b('0x18')][_0xf27b('0x9d')]=function(_0x4f3b35){var _0x486573=_0x4f3b35[_0xf27b('0xa6')]('{');for(var _0x277297=0x1;_0x277297<_0x486573[_0xf27b('0xa0')];_0x277297+=0x1){var _0x832c8f=_0x486573[_0x277297][_0xf27b('0xa6')]('}');if(_0x832c8f[_0xf27b('0xa0')]>0x1){_0x4f3b35=_0x4f3b35[_0xf27b('0xa7')]('{'+_0x832c8f[0x0]+'}',this[_0xf27b('0x12')][_0xf27b('0xa8')](_0x832c8f[0x0])[_0xf27b('0xa9')]||_0x832c8f[0x0]);}}if(_0x486573[_0xf27b('0xa0')]===0x1){return _0x4f3b35['toString']();}return this[_0xf27b('0x9d')](_0x4f3b35);};AGIVertices[_0xf27b('0x18')][_0xf27b('0xaa')]=function(_0x3fa476,_0x3e44af){var _0x511002=this['channel'][_0xf27b('0xa8')](_0x3fa476);if(_0x511002['result']===-0x1){return _0x511002;}logger['info'](util[_0xf27b('0x5f')](_0xf27b('0xab'),_0x3e44af,_0x511002[_0xf27b('0xa9')]));return this['channel'][_0xf27b('0xa4')](_0x3e44af,_0x511002[_0xf27b('0xa9')]);};AGIVertices[_0xf27b('0x18')][_0xf27b('0xac')]=function(_0x33d152){return _0x33d152&&_0x33d152!=='0'&&_0x33d152!=='-1'&&_0x33d152!=='';};AGIVertices[_0xf27b('0x18')][_0xf27b('0xad')]=function(_0x3ecae4){this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x3ecae4,'-');_0x3ecae4[_0xf27b('0xae')]=_0x3ecae4[_0xf27b('0xad')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xf27b('0x18')][_0xf27b('0xaf')]=function(_0x582758){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x582758[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x582758[_0xf27b('0x67')])){return this['channel']['noop'](_0xf27b('0xb0'));}var _0x48b1f6='\x22'+_0x582758[_0xf27b('0x67')]+'\x22';if(this['isConfigured'](_0x582758[_0xf27b('0x80')])){_0x48b1f6+=','+_0x582758[_0xf27b('0x80')];}var _0x46de83=this[_0xf27b('0x12')][_0xf27b('0xb1')](_0xf27b('0xb2'),_0x48b1f6);if(_0x46de83[_0xf27b('0xb3')]===-0x1){return _0x46de83;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xb5'),_0x48b1f6));};AGIVertices[_0xf27b('0x18')]['mrcprecog']=function(_0x3f67bd){logger[_0xf27b('0x30')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3f67bd['label']));if(!this[_0xf27b('0xac')](_0x3f67bd[_0xf27b('0xb6')])){return this['channel'][_0xf27b('0xb4')]('no\x20grammar\x20configured');}var _0x3e0d76=_0x3f67bd[_0xf27b('0xb6')];if(this[_0xf27b('0xac')](_0x3f67bd[_0xf27b('0x80')])){_0x3e0d76+=','+_0x3f67bd[_0xf27b('0x80')];}var _0x3b924a=this['channel'][_0xf27b('0xb1')](_0xf27b('0xb7'),_0x3e0d76);if(_0x3b924a[_0xf27b('0xb3')]===-0x1){return _0x3b924a;}var _0x48b2b2=this['getAndSetVariable'](_0xf27b('0xb8'),_0xf27b('0xb9'));if(_0x48b2b2[_0xf27b('0xb3')]===-0x1){return _0x48b2b2;}var _0x1b935c=this[_0xf27b('0xaa')](_0xf27b('0xba'),_0xf27b('0xbb'));if(_0x1b935c[_0xf27b('0xb3')]===-0x1){return _0x1b935c;}var _0x5765f7=this['getAndSetVariable']('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x5765f7[_0xf27b('0xb3')]===-0x1){return _0x5765f7;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xbc'),_0x3e0d76));};AGIVertices['prototype']['agi']=function(_0x459ad3){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0xbd'),_0x459ad3[_0xf27b('0x38')]));return this[_0xf27b('0x12')][_0xf27b('0xa')]([_0x459ad3[_0xf27b('0xbe')],_0x459ad3[_0xf27b('0xbf')]]);};AGIVertices['prototype']['answer']=function(_0x4286ef){logger[_0xf27b('0x30')](util['format'](_0xf27b('0xc0'),_0x4286ef[_0xf27b('0x38')]));if(this['isConfigured'](_0x4286ef[_0xf27b('0x70')])){logger[_0xf27b('0x30')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x4286ef[_0xf27b('0x70')]));var _0x4e6898=this['channel'][_0xf27b('0xc1')](_0x4286ef[_0xf27b('0x70')]);if(_0x4e6898[_0xf27b('0xb3')]===-0x1){return _0x4e6898;}}return this[_0xf27b('0x12')][_0xf27b('0xc2')]();};AGIVertices[_0xf27b('0x18')][_0xf27b('0x4a')]=function(_0x5ee5ce){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0xc3'),_0x5ee5ce[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x5ee5ce[_0xf27b('0x48')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x5ee5ce,_0xf27b('0xc4'));}_0x5ee5ce[_0xf27b('0x49')]=moment();if(this[_0xf27b('0xac')](_0x5ee5ce[_0xf27b('0xc5')])){_0x5ee5ce[_0xf27b('0x49')]=moment()[_0xf27b('0x55')](_0x5ee5ce[_0xf27b('0xc5')],_0xf27b('0x57'));}if(!this['isConfigured'](_0x5ee5ce[_0xf27b('0x4c')])){_0x5ee5ce['callback_priority']=0x2;}this[_0xf27b('0x44')][_0xf27b('0x7a')](this,_0x5ee5ce);return this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xc6'),_0x5ee5ce[_0xf27b('0x47')],_0x5ee5ce[_0xf27b('0x48')],_0x5ee5ce[_0xf27b('0x49')]));};AGIVertices[_0xf27b('0x18')][_0xf27b('0xc7')]=function(_0x1658b5){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1658b5['label']));var _0x533910=this[_0xf27b('0x12')][_0xf27b('0xb1')](_0x1658b5[_0xf27b('0xc8')],_0x1658b5[_0xf27b('0x80')]);if(_0x533910[_0xf27b('0xb3')]===-0x1){return _0x533910;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xc9'),_0x1658b5[_0xf27b('0xc8')],_0x1658b5['options']));};AGIVertices[_0xf27b('0x18')][_0xf27b('0xca')]=function(_0x11efc9){logger['info'](util[_0xf27b('0x5f')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x11efc9[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x11efc9[_0xf27b('0x67')])){return this[_0xf27b('0x12')]['noop']('no\x20text\x20configured');}var _0xb37b9d='\x22'+_0x11efc9[_0xf27b('0x67')]+'\x22';if(this['isConfigured'](_0x11efc9['options'])){_0xb37b9d+=','+_0x11efc9[_0xf27b('0x80')];}var _0x4e3f5a=this[_0xf27b('0x12')][_0xf27b('0xb1')](_0xf27b('0xb2'),_0xb37b9d);if(_0x4e3f5a[_0xf27b('0xb3')]===-0x1){return _0x4e3f5a;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0xb37b9d));};AGIVertices['prototype']['sestektts']=function(_0x56b0a3){logger[_0xf27b('0x30')](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x56b0a3[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x56b0a3[_0xf27b('0x67')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xb0'));}var _0x5e22cf='\x22'+_0x56b0a3[_0xf27b('0x67')]+'\x22';if(this[_0xf27b('0xac')](_0x56b0a3[_0xf27b('0x80')])){_0x5e22cf+=','+_0x56b0a3[_0xf27b('0x80')];}var _0x20b8eb=this[_0xf27b('0x12')][_0xf27b('0xb1')](_0xf27b('0xb2'),_0x5e22cf);if(_0x20b8eb[_0xf27b('0xb3')]===-0x1){return _0x20b8eb;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5e22cf));};AGIVertices[_0xf27b('0x18')][_0xf27b('0xcb')]=function(_0x2a8e09){logger['info'](util[_0xf27b('0x5f')](_0xf27b('0xcc'),_0x2a8e09[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x2a8e09[_0xf27b('0xb6')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xcd'));}var _0x32a380=_0x2a8e09[_0xf27b('0xb6')];if(this['isConfigured'](_0x2a8e09[_0xf27b('0x80')])){_0x32a380+=','+_0x2a8e09[_0xf27b('0x80')];}var _0x421d10=this[_0xf27b('0x12')]['exec']('MRCPRecog',_0x32a380);if(_0x421d10[_0xf27b('0xb3')]===-0x1){return _0x421d10;}var _0x32d095=this[_0xf27b('0xaa')](_0xf27b('0xb8'),_0xf27b('0xce'));if(_0x32d095[_0xf27b('0xb3')]===-0x1){return _0x32d095;}var _0x90ed1a=this['getAndSetVariable'](_0xf27b('0xba'),_0xf27b('0xcf'));if(_0x90ed1a[_0xf27b('0xb3')]===-0x1){return _0x90ed1a;}var _0x922cac=this[_0xf27b('0xaa')](_0xf27b('0xd0'),_0xf27b('0xd1'));if(_0x922cac[_0xf27b('0xb3')]===-0x1){return _0x922cac;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xbc'),_0x32a380));};AGIVertices[_0xf27b('0x18')][_0xf27b('0xd2')]=function(_0x3bf4dd){logger['info'](util[_0xf27b('0x5f')](_0xf27b('0xd3'),_0x3bf4dd[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x3bf4dd['grammar'])){return this['channel'][_0xf27b('0xb4')](_0xf27b('0xcd'));}var _0xfb3fa0=_0x3bf4dd['grammar'];if(this['isConfigured'](_0x3bf4dd[_0xf27b('0x80')])){_0xfb3fa0+=','+_0x3bf4dd['options'];}var _0x6ae60=this[_0xf27b('0x12')]['exec']('MRCPRecog',_0xfb3fa0);if(_0x6ae60[_0xf27b('0xb3')]===-0x1){return _0x6ae60;}var _0x1670a2=this[_0xf27b('0xaa')](_0xf27b('0xb8'),_0xf27b('0xd4'));if(_0x1670a2['result']===-0x1){return _0x1670a2;}var _0x127a6d=this[_0xf27b('0xaa')](_0xf27b('0xba'),_0xf27b('0xd5'));if(_0x127a6d[_0xf27b('0xb3')]===-0x1){return _0x127a6d;}var _0x398f09=this['getAndSetVariable'](_0xf27b('0xd0'),'SESTEK_ASR_INSTANCE');if(_0x398f09['result']===-0x1){return _0x398f09;}return this['channel']['noop'](util[_0xf27b('0x5f')]('Executed\x20command\x20MRCPRecog\x20%s',_0xfb3fa0));};AGIVertices[_0xf27b('0x18')]['database']=function(_0x261793){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x261793[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x261793['odbc_id'])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x261793,_0xf27b('0xd6'));}var _0x42678c=this[_0xf27b('0x1e')]['sync'](this,_0x261793[_0xf27b('0xd7')]);if(!_0x42678c){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x261793,'no\x20odbc\x20database\x20found');}if(!this[_0xf27b('0xac')](_0x261793[_0xf27b('0x31')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x261793,_0xf27b('0xd8'));}var _0x5d103a=_0x261793[_0xf27b('0x31')][_0xf27b('0xd9')](/(\r\n|\n|\r)/gm,'\x20');this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format'](_0xf27b('0xda'),_0x5d103a));var _0x31709f=this[_0xf27b('0x2c')][_0xf27b('0x7a')](this,_0x42678c,_0x5d103a);this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x261793,_0x5d103a);if(!this['isConfigured'](_0x261793['variable_id'])){return this['channel']['noop'](_0xf27b('0xdb'));}var _0x10166d=this[_0xf27b('0xa8')][_0xf27b('0x7a')](this,_0x261793[_0xf27b('0xdc')]);if(!_0x10166d){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x261793,_0xf27b('0xdd'));}var _0x246066=this;_0x31709f[_0xf27b('0xde')](function(_0x5eec84,_0x52ea0d){Object[_0xf27b('0xdf')](_0x5eec84)[_0xf27b('0xde')](function(_0x36da9f){_0x246066[_0xf27b('0x12')]['setVariable'](util['format']('%s[%s][%s]',_0x10166d,_0x52ea0d,_0x36da9f),_0x5eec84[_0x36da9f]);});});this[_0xf27b('0x12')][_0xf27b('0xa4')](util['format']('%s_ROWS_COUNT',_0x10166d),_0x31709f[_0xf27b('0xa0')]);return this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')]('variable\x20%s\x20set',_0x10166d));};AGIVertices['prototype']['dial']=function(_0xc36a8){logger['debug'](util[_0xf27b('0x5f')](_0xf27b('0xe0'),_0xc36a8[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0xc36a8[_0xf27b('0xe1')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0xc36a8,'no\x20user\x20selected');}var _0x18aa7f=this[_0xf27b('0xe2')]['sync'](this,_0xc36a8[_0xf27b('0xe1')]);if(!_0x18aa7f){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0xc36a8,_0xf27b('0xe3'));}var _0x526cc5=this[_0xf27b('0x12')][_0xf27b('0xb1')](_0xf27b('0xe4'),[util[_0xf27b('0x5f')](_0xf27b('0xe5'),_0x18aa7f),_0xc36a8[_0xf27b('0x70')],_0xc36a8['opts'],_0xc36a8[_0xf27b('0x6f')]]);if(_0x526cc5[_0xf27b('0xb3')]===-0x1){return _0x526cc5;}return this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')]('Executed\x20command\x20%s',_0xf27b('0xe4')));};AGIVertices[_0xf27b('0x18')][_0xf27b('0xe6')]=function(_0xd9704c){logger['info'](util['format'](_0xf27b('0xe7'),_0xd9704c[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0xd9704c['key'])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20key\x20configured');}if(!this['isConfigured'](_0xd9704c[_0xf27b('0x67')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xb0'));}this[_0xf27b('0x12')][_0xf27b('0xe8')]=!![];this['createSquareDetailsReport'](_0xd9704c);this['createSquareMessage'](_0xd9704c[_0xf27b('0x67')],'in','','');this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')]('Trying\x20Dialogflow:\x20%s',_0xd9704c[_0xf27b('0x67')]));var _0x2d43d7=this[_0xf27b('0x81')][_0xf27b('0x7a')](this,_0xd9704c);if(_0x2d43d7){for(var _0x203668 in _0x2d43d7){if(_0x2d43d7['hasOwnProperty'](_0x203668)){this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0xe9'),_0x203668[_0xf27b('0x75')]()),_0x2d43d7[_0x203668]);}}this[_0xf27b('0x43')](_0x2d43d7[_0xf27b('0xea')],'out',_0xf27b('0xe6'),'');return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xeb'),_0x2d43d7['speech']));}return this['channel']['error'](_0xd9704c,_0xf27b('0xec'));};AGIVertices['prototype']['dialogflowV2']=function(_0x7ad390){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0xed'),_0x7ad390['label']));if(!this[_0xf27b('0xac')](_0x7ad390[_0xf27b('0x84')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xee'));}if(!this['isConfigured'](_0x7ad390['client_email'])){return this[_0xf27b('0x12')]['noop'](_0xf27b('0xef'));}if(!this[_0xf27b('0xac')](_0x7ad390['private_key'])){return this[_0xf27b('0x12')]['noop'](_0xf27b('0xf0'));}if(!this[_0xf27b('0xac')](_0x7ad390[_0xf27b('0x86')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xf1'));}if(!this[_0xf27b('0xac')](_0x7ad390[_0xf27b('0x67')])){return this['channel'][_0xf27b('0xb4')](_0xf27b('0xb0'));}this[_0xf27b('0x12')][_0xf27b('0xe8')]=!![];this[_0xf27b('0x36')](_0x7ad390);this['createSquareMessage'](_0x7ad390[_0xf27b('0x67')],'in','','');this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xf2'),_0x7ad390['text']));var _0x14a08b=this[_0xf27b('0x83')][_0xf27b('0x7a')](this,_0x7ad390);if(_0x14a08b){for(var _0x3aa01e in _0x14a08b){if(_0x14a08b[_0xf27b('0x9a')](_0x3aa01e)){if(_0x3aa01e!=='providerResponse'){this['channel'][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0xe9'),_0x3aa01e[_0xf27b('0x75')]()),_0x14a08b[_0x3aa01e]);}}}this[_0xf27b('0x43')](_0x14a08b[_0xf27b('0xea')],'out',_0xf27b('0xf3'),_0x14a08b['providerResponse']);return this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')]('DialogflowV2\x20Result\x20%s',_0x14a08b['speech']));}return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x7ad390,_0xf27b('0xf4'));};AGIVertices[_0xf27b('0x18')][_0xf27b('0xf5')]=function(_0x325b44){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x325b44['label']));if(!this[_0xf27b('0xac')](_0x325b44[_0xf27b('0xf6')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xf7'));}if(!this['isConfigured'](_0x325b44[_0xf27b('0xf8')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x325b44['password'])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x325b44[_0xf27b('0xf9')])){return this['channel'][_0xf27b('0xb4')]('no\x20text\x20configured');}this[_0xf27b('0x12')]['bot']=!![];this[_0xf27b('0x36')](_0x325b44);this[_0xf27b('0x43')](_0x325b44[_0xf27b('0x67')],'in','','');this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format']('Trying\x20SestekNDA:\x20%s',_0x325b44[_0xf27b('0x67')]));var _0x53c897=this[_0xf27b('0x87')][_0xf27b('0x7a')](this,_0x325b44);if(_0x53c897){for(var _0x24aea9 in _0x53c897){if(_0x53c897[_0xf27b('0x9a')](_0x24aea9)){this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')]('SESTEK_NDA_%s',_0x24aea9[_0xf27b('0x75')]()),_0x53c897[_0x24aea9]);}}this[_0xf27b('0x43')](_0x53c897[_0xf27b('0xea')],_0xf27b('0xfa'),'sesteknda','');if(_0x53c897[_0xf27b('0xfb')]){this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xfc'),_0x53c897[_0xf27b('0xfb')]));var _0x4e285c=this['channel'][_0xf27b('0xfd')](_0x53c897['audiofile']);try{fs['unlink'](_0x53c897[_0xf27b('0xfb')]+_0xf27b('0xfe'));}catch(_0x6d4118){logger[_0xf27b('0x2e')](_0x6d4118);}return _0x4e285c;}else{return this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format'](_0xf27b('0xff'),_0x53c897['speech']));}}return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x325b44,_0xf27b('0x100'));};AGIVertices['prototype'][_0xf27b('0x101')]=function(_0x934a66){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x102'),_0x934a66['label']));return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x101'));};AGIVertices[_0xf27b('0x18')][_0xf27b('0x103')]=function(_0x4db0ee){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x104'),_0x4db0ee[_0xf27b('0x38')]));var _0x9710f8='';if(_0x4db0ee[_0xf27b('0x105')]){if(!this['isConfigured'](_0x4db0ee[_0xf27b('0x105')])){return this['channel'][_0xf27b('0x2e')](_0x4db0ee,_0xf27b('0x106'));}else{var _0x4ad377=parseInt(_0x4db0ee['trunk_id'],0xa);if(isNaN(_0x4ad377)){_0x9710f8=_0x4db0ee[_0xf27b('0x105')];}else{_0x9710f8=this[_0xf27b('0x21')][_0xf27b('0x7a')](this,_0x4db0ee['trunk_id']);if(!_0x9710f8){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x4db0ee,_0xf27b('0x107'));}}}}else if(_0x4db0ee[_0xf27b('0x108')]){_0x9710f8=_0x4db0ee[_0xf27b('0x108')];}else{return this['channel'][_0xf27b('0x2e')](_0x4db0ee,_0xf27b('0x106'));}var _0x5a2bf4=this[_0xf27b('0x12')][_0xf27b('0xb1')]('DIAL',[util['format']('SIP/%s/%s',_0x9710f8,_0x4db0ee[_0xf27b('0x47')]),_0x4db0ee['timeout'],_0x4db0ee['opts'],_0x4db0ee[_0xf27b('0x6f')]]);if(_0x5a2bf4[_0xf27b('0xb3')]===-0x1){return _0x5a2bf4;}return this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0xf27b('0x109')]=function(_0x28f91a){logger['info'](util[_0xf27b('0x5f')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x28f91a[_0xf27b('0x38')]));return this['channel'][_0xf27b('0xb4')](_0xf27b('0x109'));};AGIVertices['prototype'][_0xf27b('0x10a')]=function(_0x3d6bea){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x10b'),_0x3d6bea[_0xf27b('0x38')]));if(_0x3d6bea['retry']===0x0){return this[_0xf27b('0xad')](_0x3d6bea);}_0x3d6bea[_0xf27b('0xae')]-=0x1;if(!this[_0xf27b('0xac')](_0x3d6bea['file_id'])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x3d6bea,_0xf27b('0x10c'));}var _0x339c27=this[_0xf27b('0x23')][_0xf27b('0x7a')](this,_0x3d6bea[_0xf27b('0x10d')]);if(!_0x339c27){return this[_0xf27b('0x12')]['error'](_0x3d6bea,'no\x20file\x20audio\x20found');}if(!this[_0xf27b('0xac')](_0x3d6bea['variable_id'])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0xf27b('0xdb'));}var _0x213580=this[_0xf27b('0x12')]['getData'](_0x339c27,_0x3d6bea['response'],_0x3d6bea['maxdigit']);var _0x13acd2=_0x213580[_0xf27b('0xb3')]?_0x213580[_0xf27b('0xb3')][_0xf27b('0x10e')]():'';logger[_0xf27b('0x30')](_0xf27b('0x10f'),JSON['stringify'](_0x213580));if(_0x213580['result']===-0x1){this[_0xf27b('0x36')]['sync'](this,_0x3d6bea,_0x13acd2);return _0x213580;}else if(_0x213580[_0xf27b('0xa9')]===_0xf27b('0x70')){_0x213580[_0xf27b('0xb3')]=_0x13acd2[_0xf27b('0xa0')]>=parseInt(_0x3d6bea[_0xf27b('0x110')])?'x':'i';}else{_0x213580[_0xf27b('0xb3')]=_0x13acd2['length']>=parseInt(_0x3d6bea[_0xf27b('0x110')])&&_0x13acd2['length']<=parseInt(_0x3d6bea[_0xf27b('0x111')])?'x':'i';}var _0x47a4d7=this[_0xf27b('0xa8')][_0xf27b('0x7a')](this,_0x3d6bea['variable_id']);if(!_0x47a4d7){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x3d6bea,_0xf27b('0xdd'));}this['channel'][_0xf27b('0xa4')](_0x47a4d7,_0x13acd2);if(this['isConfigured'](_0x3d6bea[_0xf27b('0x112')])){var _0x2a2262=parseInt(_0x3d6bea['hiddendigitsnum'],0xa);var _0x5c9c0d=rs[_0xf27b('0x113')]({'charset':'*','length':_0x2a2262});var _0x444591=_0x13acd2[_0xf27b('0xa0')];if(_0x444591>0x0){if(_0x444591>_0x2a2262){this[_0xf27b('0x36')]['sync'](this,_0x3d6bea,_0x3d6bea[_0xf27b('0x114')]===_0xf27b('0x115')?_0x5c9c0d+_0x13acd2[_0xf27b('0x116')](_0x2a2262):_0x13acd2[_0xf27b('0x116')](0x0,_0x444591-_0x2a2262)+_0x5c9c0d);}else{this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x3d6bea,rs[_0xf27b('0x113')]({'charset':'*','length':_0x444591}));}}else{this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x3d6bea,'');}}else{this['createSquareDetailsReport'][_0xf27b('0x7a')](this,_0x3d6bea,_0x13acd2);}return _0x213580;};AGIVertices['prototype'][_0xf27b('0x11')]=function(_0x2b7c64){logger['info'](util['format'](_0xf27b('0x117'),_0x2b7c64[_0xf27b('0x38')]));return this[_0xf27b('0x10a')](_0x2b7c64);};AGIVertices[_0xf27b('0x18')][_0xf27b('0x118')]=function(_0x9dc60){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x119'),_0x9dc60[_0xf27b('0x38')]));this['createSquareDetailsReport'][_0xf27b('0x7a')](this,_0x9dc60,_0x9dc60[_0xf27b('0x11a')]);return this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')]('GOAL\x20%s',_0x9dc60[_0xf27b('0x11a')]));};AGIVertices[_0xf27b('0x18')][_0xf27b('0x11b')]=function(_0x56cf01){logger[_0xf27b('0x30')](util['format']('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x56cf01['label']));if(!this[_0xf27b('0xac')](_0x56cf01[_0xf27b('0x11c')])||!this[_0xf27b('0xac')](_0x56cf01[_0xf27b('0x8f')])){return this['channel'][_0xf27b('0xb4')](_0xf27b('0x11d'));}if(!this[_0xf27b('0xac')](_0x56cf01[_0xf27b('0x67')])){return this['channel'][_0xf27b('0xb4')](_0xf27b('0xb0'));}this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')](_0xf27b('0x11e'),_0x56cf01[_0xf27b('0x67')]));var _0x351de6=this['awsPolly'][_0xf27b('0x7a')](this,_0x56cf01);if(_0x351de6){this['channel'][_0xf27b('0xb4')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x351de6));var _0x14642e=this[_0xf27b('0x12')][_0xf27b('0xfd')](_0x351de6);try{fs[_0xf27b('0x11f')](_0x351de6+'.wav');}catch(_0x5bac47){logger[_0xf27b('0x2e')](_0x5bac47);}return _0x14642e;}return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x56cf01,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xf27b('0x18')]['awslex']=function(_0x198642){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x120'),_0x198642[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x198642[_0xf27b('0x11c')])||!this[_0xf27b('0xac')](_0x198642[_0xf27b('0x8f')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x11d'));}if(!this[_0xf27b('0xac')](_0x198642[_0xf27b('0x91')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20bot\x20name\x20configured');}if(!this[_0xf27b('0xac')](_0x198642[_0xf27b('0x67')])){return this[_0xf27b('0x12')]['noop'](_0xf27b('0xb0'));}this[_0xf27b('0x12')][_0xf27b('0xe8')]=!![];this[_0xf27b('0x36')](_0x198642);this['createSquareMessage'](_0x198642[_0xf27b('0x67')],'in','','');this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x121'),_0x198642['text']));var _0x1caf0c=this[_0xf27b('0x122')][_0xf27b('0x7a')](this,_0x198642);if(_0x1caf0c){for(var _0x66d084 in _0x1caf0c){if(_0x1caf0c[_0xf27b('0x9a')](_0x66d084)&&_[_0xf27b('0x9b')](_0x1caf0c[_0x66d084])){this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0x123'),_0x66d084['toUpperCase']()),_0x1caf0c[_0x66d084]);}}if(_['isNil'](_0x1caf0c['message'])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x124'));}else{this['createSquareMessage'](_0x1caf0c[_0xf27b('0x7f')],_0xf27b('0xfa'),_0xf27b('0x125'),'');return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x126'),_0x1caf0c[_0xf27b('0x7f')]));}}return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x198642,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0xf27b('0x18')][_0xf27b('0x127')]=function(_0x62f9bf){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x128'),_0x62f9bf[_0xf27b('0x38')],_0x62f9bf[_0xf27b('0x70')]));if(!this[_0xf27b('0xac')](_0x62f9bf[_0xf27b('0x89')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x129'));}var _0x5548e9=_0xf27b('0x12a');var _0x38aff7=util['format'](_0xf27b('0x12b'),FILES_PATH,rs[_0xf27b('0x113')](0x4));var _0x60be5d=util[_0xf27b('0x5f')](_0xf27b('0xa2'),_0x38aff7,_0x5548e9);var _0x4d912f=!![];if(_0x62f9bf['beep']===_0xf27b('0x12c')){_0x4d912f=![];}var _0x512212=this['channel'][_0xf27b('0x12d')](_0x38aff7,_0x5548e9,_0x62f9bf[_0xf27b('0x12e')],_0x62f9bf['timeout'],undefined,_0x4d912f);if(_0x512212['result']!==-0x1){this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x12f'),_0x60be5d));var _0x4cc4a5=this[_0xf27b('0x92')][_0xf27b('0x7a')](this,_0x62f9bf,_0x60be5d);if(_0x4cc4a5){for(var _0x4c75a8 in _0x4cc4a5){if(_0x4cc4a5[_0xf27b('0x9a')](_0x4c75a8)){this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0x130'),_0x4c75a8[_0xf27b('0x75')]()),_0x4cc4a5[_0x4c75a8]);}}return this[_0xf27b('0x12')]['noop'](util['format'](_0xf27b('0x131'),JSON[_0xf27b('0x7d')](_0x4cc4a5)));}}return _0x512212;};AGIVertices['prototype']['tildeasr']=function(_0x453f80){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x132'),_0x453f80[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x453f80[_0xf27b('0x95')])){return this['channel']['noop'](_0xf27b('0x133'));}if(!this[_0xf27b('0xac')](_0x453f80['appsecret'])){return this['channel'][_0xf27b('0xb4')](_0xf27b('0x134'));}var _0xc9bdfe='wav';var _0x25c010=util['format'](_0xf27b('0x12b'),FILES_PATH,rs[_0xf27b('0x113')](0x4));var _0x58de18=util[_0xf27b('0x5f')](_0xf27b('0xa2'),_0x25c010,_0xc9bdfe);var _0x335409=!![];if(_0x453f80['beep']==='NOBEEP'){_0x335409=![];}var _0x2de11c=this[_0xf27b('0x12')]['recordFile'](_0x25c010,_0xc9bdfe,_0x453f80[_0xf27b('0x12e')],_0x453f80[_0xf27b('0x70')],undefined,_0x335409);if(_0x2de11c[_0xf27b('0xb3')]!==-0x1){this['channel'][_0xf27b('0xb4')](util['format'](_0xf27b('0x135'),_0x58de18));var _0x2fc827=this[_0xf27b('0x94')][_0xf27b('0x7a')](this,_0x453f80,_0x58de18);if(_0x2fc827){for(var _0xdad868 in _0x2fc827){if(_0x2fc827['hasOwnProperty'](_0xdad868)){this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0x136'),_0xdad868[_0xf27b('0x75')]()),_0x2fc827[_0xdad868]);}}return this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')](_0xf27b('0x137'),JSON[_0xf27b('0x7d')](_0x2fc827)));}}return _0x2de11c;};AGIVertices['prototype'][_0xf27b('0x138')]=function(_0x356eab){logger['info'](util['format'](_0xf27b('0x139'),_0x356eab[_0xf27b('0x38')]));return this['channel']['continueAt'](_0x356eab['context'],_0x356eab[_0xf27b('0x3f')],_0x356eab[_0xf27b('0x13a')]);};AGIVertices[_0xf27b('0x18')][_0xf27b('0x13b')]=function(_0x165bab){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x13c'),_0x165bab[_0xf27b('0x38')]));if(!this['isConfigured'](_0x165bab[_0xf27b('0x13d')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x165bab,_0xf27b('0x13e'));}try{var _0x599cd2=eval(_0x165bab[_0xf27b('0x13d')])?_0xf27b('0x13f'):_0xf27b('0x140');this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x141'),_0x165bab[_0xf27b('0x13d')],_0x599cd2));return{'code':0xc8,'result':_0x599cd2};}catch(_0x5770d4){return{'code':0xc8,'result':_0xf27b('0x140')};}};AGIVertices[_0xf27b('0x18')][_0xf27b('0x142')]=function(_0x6f835c){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x143'),_0x6f835c['label']));if(!this['isConfigured'](_0x6f835c[_0xf27b('0x144')])){return this[_0xf27b('0x12')]['error'](_0x6f835c,_0xf27b('0x145'));}var _0x5d5d7a=this[_0xf27b('0x146')][_0xf27b('0x7a')](this,_0x6f835c['interval_id']);if(!_0x5d5d7a){return this['channel'][_0xf27b('0x2e')](_0x6f835c,_0xf27b('0x147'));}for(var _0x1eb739=0x0;_0x1eb739<_0x5d5d7a['length'];_0x1eb739+=0x1){var _0x25a4f5=this['channel'][_0xf27b('0xa8')](util[_0xf27b('0x5f')](_0xf27b('0x148'),_0x5d5d7a[_0x1eb739]));if(_0x25a4f5[_0xf27b('0xb3')]===-0x1){return _0x25a4f5;}logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x149'),_0x5d5d7a[_0x1eb739],_0x25a4f5['extra']));if(_0x25a4f5['extra']===_0xf27b('0x13f')){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x149'),_0x5d5d7a[_0x1eb739],_0xf27b('0x13f')));this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x149'),_0x5d5d7a[_0x1eb739],_0xf27b('0x13f')));return{'code':0xc8,'result':_0xf27b('0x13f')};}else{logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x149'),_0x5d5d7a[_0x1eb739],'false'));this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x149'),_0x5d5d7a[_0x1eb739],_0xf27b('0x140')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xf27b('0x18')][_0xf27b('0x14a')]=function(_0x4cbfda){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x4cbfda['label']));return this[_0xf27b('0x12')][_0xf27b('0x14a')]();};AGIVertices[_0xf27b('0x18')][_0xf27b('0x14b')]=function(_0x723f2a){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x14c'),_0x723f2a[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x723f2a[_0xf27b('0x89')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x129'));}var _0x1535f0='wav';var _0x3ea6b6=util[_0xf27b('0x5f')](_0xf27b('0x12b'),FILES_PATH,rs['generate'](0x4));var _0x3bc82c=util[_0xf27b('0x5f')](_0xf27b('0xa2'),_0x3ea6b6,_0x1535f0);var _0x27df2c=!![];if(_0x723f2a['beep']===_0xf27b('0x12c')){_0x27df2c=![];}var _0x5787a8=this[_0xf27b('0x12')][_0xf27b('0x12d')](_0x3ea6b6,_0x1535f0,_0x723f2a[_0xf27b('0x12e')],_0x723f2a[_0xf27b('0x70')],undefined,_0x27df2c);if(_0x5787a8[_0xf27b('0xb3')]!==-0x1){this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')]('ispeech\x20%s\x20file\x20created',_0x3bc82c));var _0x467663=this['ispeechASR'][_0xf27b('0x7a')](this,_0x723f2a,_0x3bc82c);if(_0x467663){for(var _0xe8a200 in _0x467663){if(_0x467663[_0xf27b('0x9a')](_0xe8a200)){this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0x14d'),_0xe8a200[_0xf27b('0x75')]()),_0x467663[_0xe8a200]);}}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x14e'),JSON[_0xf27b('0x7d')](_0x467663)));}}return _0x5787a8;};AGIVertices['prototype'][_0xf27b('0x14f')]=function(_0x1a536e){logger['info'](util[_0xf27b('0x5f')](_0xf27b('0x150'),_0x1a536e[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x1a536e['key'])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x129'));}if(!this[_0xf27b('0xac')](_0x1a536e[_0xf27b('0x67')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20text\x20configured');}this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x1a536e[_0xf27b('0x67')]));var _0x24e0b6=this[_0xf27b('0x88')][_0xf27b('0x7a')](this,_0x1a536e);if(_0x24e0b6){this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format']('ispeech\x20%s\x20file\x20created',_0x24e0b6));var _0x38019d=this[_0xf27b('0x12')][_0xf27b('0xfd')](_0x24e0b6,_0x1a536e[_0xf27b('0x12e')]);try{fs[_0xf27b('0x11f')](_0x24e0b6+_0xf27b('0xfe'));}catch(_0x4e2014){logger['error'](_0x4e2014);}return _0x38019d;}return this['channel']['error'](_0x1a536e,_0xf27b('0x151'));};AGIVertices['prototype'][_0xf27b('0x152')]=function(_0x34abd4){logger['info'](util[_0xf27b('0x5f')](_0xf27b('0x153'),_0x34abd4['label']));if(!this[_0xf27b('0xac')](_0x34abd4[_0xf27b('0x154')])){return this['channel'][_0xf27b('0x2e')](_0x34abd4,_0xf27b('0x155'));}logger[_0xf27b('0x30')](util['format'](_0xf27b('0x156'),this[_0xf27b('0x12')]['callerid'],_0x34abd4[_0xf27b('0x154')]));var _0x543674=this['agentLogin'][_0xf27b('0x7a')](this,_0x34abd4[_0xf27b('0x154')]);if(_0x543674){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x157'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x34abd4['findBy']));this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x157'),this[_0xf27b('0x12')]['callerid'],_0x34abd4[_0xf27b('0x154')]));return{'code':0xc8,'result':_0xf27b('0x158')};}else{logger[_0xf27b('0x30')](util['format'](_0xf27b('0x159'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x34abd4[_0xf27b('0x154')]));this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x159'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x34abd4['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['logout']=function(_0x3ae947){logger['info'](util[_0xf27b('0x5f')](_0xf27b('0x15a'),_0x3ae947[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x3ae947[_0xf27b('0x154')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x3ae947,'no\x20find\x20by\x20configured');}logger['info'](util[_0xf27b('0x5f')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x3ae947[_0xf27b('0x154')]));var _0x561fc1=this[_0xf27b('0x5c')]['sync'](this,_0x3ae947[_0xf27b('0x154')]);if(_0x561fc1){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x157'),this['channel'][_0xf27b('0x3b')],_0x3ae947[_0xf27b('0x154')]));this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x3ae947[_0xf27b('0x154')]));return{'code':0xc8,'result':'success'};}else{logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x159'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x3ae947[_0xf27b('0x154')]));this['channel']['noop'](util[_0xf27b('0x5f')](_0xf27b('0x159'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x3ae947[_0xf27b('0x154')]));return{'code':0xc8,'result':_0xf27b('0x15b')};}};AGIVertices[_0xf27b('0x18')]['math']=function(_0x37eb83){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x15c'),_0x37eb83[_0xf27b('0x38')]));if(!this['isConfigured'](_0x37eb83[_0xf27b('0x15d')])){return this[_0xf27b('0x12')]['error'](_0x37eb83,_0xf27b('0x15e'));}this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x15f'),_0x37eb83[_0xf27b('0x15d')]));var _0x3f5a11=eval(_0x37eb83[_0xf27b('0x15d')]);if(!this['isConfigured'](_0x37eb83[_0xf27b('0xdc')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5d978f=this[_0xf27b('0xa8')][_0xf27b('0x7a')](this,_0x37eb83[_0xf27b('0xdc')]);if(!_0x5d978f){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x37eb83,_0xf27b('0xdd'));}if(_[_0xf27b('0xa3')](_0x3f5a11)){var _0x4bb4e9=this;_0x3f5a11['forEach'](function(_0x522760,_0x4aad40){_0x4bb4e9['channel'][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0x160'),_0x5d978f,_0x4aad40),_0x522760);});return this['channel']['noop'](util[_0xf27b('0x5f')](_0xf27b('0x161'),_0x5d978f));}else{return this['channel'][_0xf27b('0xa4')](_0x5d978f,_0x3f5a11);}};AGIVertices['prototype'][_0xf27b('0x10')]=function(_0x4072f3){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x162'),_0x4072f3[_0xf27b('0x38')]));if(_0x4072f3[_0xf27b('0xae')]===0x0){return this[_0xf27b('0xad')](_0x4072f3);}_0x4072f3[_0xf27b('0xae')]-=0x1;if(!this['isConfigured'](_0x4072f3[_0xf27b('0x10d')])){return this['channel'][_0xf27b('0x2e')](_0x4072f3,_0xf27b('0x10c'));}var _0x31a6d9=this[_0xf27b('0x23')][_0xf27b('0x7a')](this,_0x4072f3[_0xf27b('0x10d')]);if(!_0x31a6d9){return this['channel'][_0xf27b('0x2e')](_0x4072f3,'no\x20file\x20audio\x20found');}var _0x27a23b=this[_0xf27b('0x12')][_0xf27b('0x163')](_0x31a6d9,_0x4072f3[_0xf27b('0x164')],_0x4072f3[_0xf27b('0x165')]);var _0x58945c=_0x27a23b[_0xf27b('0xb3')];if(_0x27a23b['result']===-0x1){this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x4072f3,'-1');return _0x27a23b;}else if(_0x27a23b['extra']===_0xf27b('0x70')){_0x27a23b['result']=_0x27a23b[_0xf27b('0xb3')][_0xf27b('0xa0')]>0x0?_0x27a23b[_0xf27b('0xb3')]:'t';}else if(_[_0xf27b('0x45')](_0x27a23b[_0xf27b('0xb3')])){_0x27a23b[_0xf27b('0xb3')]='#';_0x58945c='#';}if(!this[_0xf27b('0xac')](_0x4072f3['variable_id'])){this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xdb'));}else{var _0x29d0a2=this['getVariable'][_0xf27b('0x7a')](this,_0x4072f3[_0xf27b('0xdc')]);if(!_0x29d0a2){return this[_0xf27b('0x12')]['error'](_0x4072f3,'no\x20variable\x20found');}this[_0xf27b('0x12')]['setVariable'](_0x29d0a2,_0x58945c);}this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x4072f3,_0x58945c);return _0x27a23b;};AGIVertices[_0xf27b('0x18')][_0xf27b('0xb4')]=function(_0x369daf){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x166'),_0x369daf[_0xf27b('0x38')]));return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0x369daf[_0xf27b('0x167')]||_0x369daf[_0xf27b('0x38')]);};AGIVertices['prototype'][_0xf27b('0x168')]=function(_0x2ca71d){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x169'),_0x2ca71d[_0xf27b('0x38')]));if(!this['isConfigured'](_0x2ca71d[_0xf27b('0x154')])){return this[_0xf27b('0x12')]['error'](_0x2ca71d,'no\x20find\x20by\x20configured');}logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x156'),this['channel'][_0xf27b('0x3b')],_0x2ca71d[_0xf27b('0x154')]));var _0x4f3702=this[_0xf27b('0x58')]['sync'](this,_0x2ca71d[_0xf27b('0x16a')]);var _0x445361=this[_0xf27b('0x5a')][_0xf27b('0x7a')](this,_0x2ca71d[_0xf27b('0x154')],_0x4f3702);if(_0x445361){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x2ca71d['findBy']));this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x2ca71d['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x159'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x2ca71d['findBy']));this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x157'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0x2ca71d[_0xf27b('0x154')]));return{'code':0xc8,'result':_0xf27b('0x15b')};}};AGIVertices[_0xf27b('0x18')]['playback']=function(_0x12d1f9){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x12d1f9['label']));if(!this['isConfigured'](_0x12d1f9[_0xf27b('0x10d')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x12d1f9,_0xf27b('0x10c'));}var _0x4ff869=this[_0xf27b('0x23')][_0xf27b('0x7a')](this,_0x12d1f9[_0xf27b('0x10d')]);if(!_0x4ff869){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x12d1f9,_0xf27b('0x16b'));}var _0xe64a32=this[_0xf27b('0x12')][_0xf27b('0xb1')]('PLAYBACK',[_0x4ff869,_0x12d1f9[_0xf27b('0x16c')]]);if(_0xe64a32[_0xf27b('0xb3')]===-0x1){return _0xe64a32;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format'](_0xf27b('0xc9'),_0xf27b('0x16d'),_0x4ff869));};AGIVertices[_0xf27b('0x18')]['queue']=function(_0x3fdfc8){logger['info'](util[_0xf27b('0x5f')](_0xf27b('0x16e'),_0x3fdfc8[_0xf27b('0x38')]));if(!this['isConfigured'](_0x3fdfc8['queue_id'])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x3fdfc8,_0xf27b('0x16f'));}var _0xabccf6='';var _0x354749=parseInt(_0x3fdfc8[_0xf27b('0x170')],0xa);if(isNaN(_0x354749)){_0xabccf6=_0x3fdfc8[_0xf27b('0x170')];}else{_0xabccf6=this['getVoiceQueue'][_0xf27b('0x7a')](this,_0x3fdfc8[_0xf27b('0x170')]);if(!_0xabccf6){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x3fdfc8,'no\x20queue\x20found');}}var _0x19ba3b='';if(this[_0xf27b('0xac')](_0x3fdfc8[_0xf27b('0x10d')])){var _0x1e19f1=this[_0xf27b('0x23')][_0xf27b('0x7a')](this,_0x3fdfc8[_0xf27b('0x10d')]);if(_0x1e19f1){_0x19ba3b=_0x1e19f1;}}this[_0xf27b('0x36')]['sync'](this,_0x3fdfc8,_0xabccf6);if(_0x3fdfc8['opts'][_0xf27b('0x171')]('x')<0x0){_0x3fdfc8[_0xf27b('0x16c')]+='x';}if(_0x3fdfc8[_0xf27b('0x16c')][_0xf27b('0x171')]('X')<0x0){_0x3fdfc8[_0xf27b('0x16c')]+='X';}this['channel'][_0xf27b('0xa4')](_0xf27b('0x172'),_0xabccf6?_0xabccf6[_0xf27b('0x173')]():'');var _0x168b43=this[_0xf27b('0x12')]['exec'](_0xf27b('0x174'),[_0xabccf6,_0x3fdfc8['opts'],_0x3fdfc8['url'],_0x19ba3b,_0x3fdfc8[_0xf27b('0x70')],_0x3fdfc8[_0xf27b('0xa')],_0x3fdfc8[_0xf27b('0x175')],_0x3fdfc8[_0xf27b('0x176')],'',_0x3fdfc8[_0xf27b('0x177')]]);if(_0x168b43[_0xf27b('0xb3')]===-0x1){return _0x168b43;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xc9'),_0xf27b('0x174'),_0xabccf6));};AGIVertices[_0xf27b('0x18')][_0xf27b('0x178')]=function(_0x2abcb1){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x179'),_0x2abcb1['label']));var _0x4bf83a=_0x2abcb1[_0xf27b('0x17a')]||_0xf27b('0x12a');var _0x3d6848=util[_0xf27b('0x5f')](_0xf27b('0x17b'),this[_0xf27b('0x12')][_0xf27b('0x37')],rs[_0xf27b('0x113')](0x5));var _0x330940=util[_0xf27b('0x5f')](_0xf27b('0x17c'),FILES_PATH,_0x3d6848,_0x4bf83a);var _0x911a0a=util[_0xf27b('0x5f')](_0xf27b('0x12b'),FILES_PATH,_0x3d6848);this[_0xf27b('0x3c')][_0xf27b('0x7a')](this,_0x2abcb1,_0x3d6848,_0x330940);this[_0xf27b('0x12')][_0xf27b('0xa4')](_0xf27b('0x17d'),_0x3d6848);logger[_0xf27b('0x30')](_0xf27b('0x17e'),_0x911a0a,_0x4bf83a,_0x2abcb1['escape_digits'],_0x2abcb1['timeout']);return this[_0xf27b('0x12')][_0xf27b('0x12d')](_0x911a0a,_0x4bf83a,_0x2abcb1[_0xf27b('0x17f')],_0x2abcb1['timeout'],undefined,!![]);};AGIVertices['prototype'][_0xf27b('0x180')]=function(_0x43144a){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x43144a[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x43144a['url'])){return this['channel']['noop'](_0xf27b('0x181'));}var _0x16b738=this[_0xf27b('0x6e')][_0xf27b('0x7a')](this,_0x43144a);logger[_0xf27b('0x30')](util['format'](_0xf27b('0x182'),util[_0xf27b('0x183')](_0x16b738,{'showHidden':![],'depth':null})));if(!this[_0xf27b('0xac')](_0x43144a[_0xf27b('0xdc')])){return this['channel'][_0xf27b('0xb4')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0xb310cf=this['getVariable'][_0xf27b('0x7a')](this,_0x43144a[_0xf27b('0xdc')]);if(!_0xb310cf){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x43144a,_0xf27b('0xdd'));}this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0x184'),_0xb310cf),_0x16b738[_0xf27b('0x7e')]?_0x16b738[_0xf27b('0x7e')]:'200');this[_0xf27b('0x12')][_0xf27b('0xa4')](util[_0xf27b('0x5f')](_0xf27b('0x185'),_0xb310cf),_0x16b738['statusMessage']?_0x16b738[_0xf27b('0x186')]:'OK');if(_0x16b738[_0xf27b('0x76')]){try{this[_0xf27b('0xa1')](_0x16b738[_0xf27b('0x76')],_0xb310cf);}catch(_0x3f9e8a){logger[_0xf27b('0x2e')](util[_0xf27b('0x5f')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0xb310cf));}}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x187'),_0xb310cf));};AGIVertices['prototype']['saydigits']=function(_0x582c6c){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x188'),_0x582c6c['label']));return this[_0xf27b('0x12')][_0xf27b('0x189')](_0x582c6c[_0xf27b('0x18a')][_0xf27b('0xd9')](/\s+/g,''),_0x582c6c[_0xf27b('0x17f')]);};AGIVertices[_0xf27b('0x18')]['saynumber']=function(_0x4bbb2c){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x18b'),_0x4bbb2c[_0xf27b('0x38')]));return this[_0xf27b('0x12')][_0xf27b('0x18c')](_0x4bbb2c[_0xf27b('0x71')][_0xf27b('0xd9')](/\s+/g,''),_0x4bbb2c['escape_digits']);};AGIVertices[_0xf27b('0x18')][_0xf27b('0x18d')]=function(_0x43b9f2){logger[_0xf27b('0x30')](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x43b9f2[_0xf27b('0x38')]));return this['channel'][_0xf27b('0x18e')](_0x43b9f2[_0xf27b('0x67')],_0x43b9f2[_0xf27b('0x17f')]);};AGIVertices[_0xf27b('0x18')][_0xf27b('0x18f')]=function(_0x3c3407){logger[_0xf27b('0x30')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x3c3407[_0xf27b('0x38')]));if(!this['isConfigured'](_0x3c3407[_0xf27b('0x190')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x191'));}var _0x49197c=this[_0xf27b('0x192')][_0xf27b('0x7a')](this,_0x3c3407[_0xf27b('0x190')]);if(!_0x49197c||!_0x49197c[_0xf27b('0x193')]){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x3c3407,_0xf27b('0x194'));}var _0xdaf58b={'from':util[_0xf27b('0x5f')](_0xf27b('0x195'),_0x49197c[_0xf27b('0x17')],_0x49197c[_0xf27b('0x196')]||_0x49197c[_0xf27b('0x193')][_0xf27b('0x197')]),'to':_0x3c3407['to']||'','cc':_0x3c3407['cc']||'','bcc':_0x3c3407[_0xf27b('0x198')]||'','subject':_0x3c3407['subject'],'html':_0x3c3407[_0xf27b('0x67')],'text':_0x3c3407[_0xf27b('0x67')]};var _0x582a66={'tls':{'rejectUnauthorized':![]}};if(_0x49197c[_0xf27b('0x193')][_0xf27b('0x199')]){_0x582a66['service']=_0x49197c[_0xf27b('0x193')][_0xf27b('0x199')];}else{_0x582a66[_0xf27b('0x19a')]=_0x49197c[_0xf27b('0x193')][_0xf27b('0x19a')];_0x582a66[_0xf27b('0x19b')]=_0x49197c[_0xf27b('0x193')][_0xf27b('0x19b')];_0x582a66['secure']=_0x49197c[_0xf27b('0x193')][_0xf27b('0x19c')];}if(_0x49197c[_0xf27b('0x193')][_0xf27b('0x19d')]){_0x582a66['auth']={'user':_0x49197c[_0xf27b('0x193')][_0xf27b('0x197')],'pass':_0x49197c[_0xf27b('0x193')][_0xf27b('0x19e')]};}if(this[_0xf27b('0xac')](_0x3c3407[_0xf27b('0x19f')])){}logger['debug']('sendMail\x20message',JSON[_0xf27b('0x7d')](_0xdaf58b));this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x3c3407,_0x3c3407[_0xf27b('0x190')]);this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x1a0'),_0x49197c['name']));this[_0xf27b('0x28')][_0xf27b('0x7a')](this,_0x582a66,_0xdaf58b);return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x1a1'));};AGIVertices['prototype'][_0xf27b('0x1a2')]=function(_0x4034b0){logger['info'](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4034b0[_0xf27b('0x38')]));return this[_0xf27b('0x12')][_0xf27b('0xb4')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1a3')]=function(_0x260037){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x1a4'),_0x260037[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x260037[_0xf27b('0x1a5')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20sms\x20account\x20configured');}var _0x29fc28=this[_0xf27b('0x1a6')][_0xf27b('0x7a')](this,_0x260037[_0xf27b('0x1a5')]);if(!_0x29fc28){return this[_0xf27b('0x12')]['error'](_0x260037,_0xf27b('0x1a7'));}var _0x384204={'body':_0x260037[_0xf27b('0x1a8')],'phone':_0x260037['to']||'','SmsAccountId':_0x29fc28['id']};logger[_0xf27b('0x1a9')](_0xf27b('0x1aa'),JSON[_0xf27b('0x7d')](_0x384204));this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x260037,_0x260037[_0xf27b('0x1a5')]);this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x29fc28[_0xf27b('0x17')]));this[_0xf27b('0x35')]['sync'](this,_0x384204);return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x1ab'));};AGIVertices[_0xf27b('0x18')]['set']=function(_0x545003){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x545003[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x545003['variable_id'])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x545003,'no\x20variable\x20selected');}var _0x1fef1c=this[_0xf27b('0xa8')][_0xf27b('0x7a')](this,_0x545003[_0xf27b('0xdc')]);if(!_0x1fef1c){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x545003,_0xf27b('0xdd'));}return this[_0xf27b('0x12')][_0xf27b('0xa4')](_0x1fef1c,_0x545003[_0xf27b('0x1ac')]);};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1ad')]=function(_0x5e9f15){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x1ae'),_0x5e9f15[_0xf27b('0x38')]));this['channel'][_0xf27b('0xb4')](_0xf27b('0x1af'));if(_0x5e9f15[_0xf27b('0xc2')]===_0xf27b('0x1b0')){this[_0xf27b('0x12')]['noop']('Answer');return this[_0xf27b('0x12')]['answer']();}return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0x1b1'));};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1b2')]=function(_0x544c7d){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x544c7d[_0xf27b('0x38')]));if(!this['isConfigured'](_0x544c7d['project_id'])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x544c7d,_0xf27b('0x1b3'));}var _0x1955e8=this['getSquareProject']['sync'](this,_0x544c7d[_0xf27b('0x1b4')]);if(!this['isConfigured'](_0x1955e8)){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x544c7d,util[_0xf27b('0x5f')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x544c7d[_0xf27b('0x1b4')]));}if(_0x1955e8===this['channel'][_0xf27b('0x3a')]){return this['channel'][_0xf27b('0x2e')](_0x544c7d,_0xf27b('0x1b5'));}this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x544c7d,_0x1955e8);var _0x5dbc56=this[_0xf27b('0x12')][_0xf27b('0xb1')](_0xf27b('0x1b6'),util[_0xf27b('0x5f')](_0xf27b('0x1b7'),config[_0xf27b('0xa')][_0xf27b('0x19a')]||_0xf27b('0x1b8'),_0x1955e8,this['channel'][_0xf27b('0x3a')]));if(_0x5dbc56['result']===-0x1){return _0x5dbc56;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xc9'),'AGI',_0x1955e8));};AGIVertices[_0xf27b('0x18')]['system']=function(_0x53a8cc){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x1b9'),_0x53a8cc[_0xf27b('0x38')]));var _0x3cf81b=this[_0xf27b('0x62')][_0xf27b('0x7a')](this,_0x53a8cc[_0xf27b('0xbe')]);this[_0xf27b('0x36')][_0xf27b('0x7a')](this,_0x53a8cc,_0x53a8cc['command']);if(this['isConfigured'](_0x53a8cc[_0xf27b('0xdc')])){var _0x31e471=this[_0xf27b('0xa8')][_0xf27b('0x7a')](this,_0x53a8cc[_0xf27b('0xdc')]);if(_0x31e471){this[_0xf27b('0x12')]['setVariable'](_0x31e471,_0x3cf81b);return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x1ba'),_0x53a8cc[_0xf27b('0xbe')],_0x31e471));}}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x1bb'),_0x53a8cc['command']));};AGIVertices['prototype']['google_cloud_tts']=function(_0x1b7679){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1b7679[_0xf27b('0x38')]));_0x1b7679[_0xf27b('0x67')]=_0x1b7679[_0xf27b('0x67')][_0xf27b('0xd9')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1b7679[_0xf27b('0x65')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20apiKey\x20configured');}if(!this[_0xf27b('0xac')](_0x1b7679[_0xf27b('0x67')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')]('no\x20text\x20configured');}this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x1bc'),_0x1b7679['text']));var _0x359897=this[_0xf27b('0x64')][_0xf27b('0x7a')](this,_0x1b7679);if(_0x359897){this['channel'][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0x1bd'),_0x359897));var _0x27a7aa=this[_0xf27b('0x12')]['streamFile'](_0x359897);try{fs['unlink'](_0x359897+'.wav');}catch(_0x31f347){logger[_0xf27b('0x2e')](_0x31f347);}return _0x27a7aa;}return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x1b7679,_0xf27b('0x1be'));};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1bf')]=function(_0x1d086b){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x1c0'),_0x1d086b[_0xf27b('0x38')]));_0x1d086b[_0xf27b('0x67')]=_0x1d086b['text'][_0xf27b('0xd9')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xf27b('0xac')](_0x1d086b[_0xf27b('0x67')])){return this[_0xf27b('0x12')][_0xf27b('0xb4')](_0xf27b('0xb0'));}this[_0xf27b('0x12')][_0xf27b('0xb4')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x1d086b[_0xf27b('0x67')]));var _0x17cc9d=this[_0xf27b('0x6d')]['sync'](this,_0x1d086b);if(_0x17cc9d){this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')](_0xf27b('0x1c1'),_0x17cc9d));var _0x33e936=this[_0xf27b('0x12')][_0xf27b('0xfd')](_0x17cc9d);try{fs[_0xf27b('0x11f')](_0x17cc9d+_0xf27b('0xfe'));}catch(_0x4ac548){logger['error'](_0x4ac548);}return _0x33e936;}return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x1d086b,_0xf27b('0x1c2'));};AGIVertices['prototype'][_0xf27b('0x1c3')]=function(_0xc802a4){logger['info'](util['format'](_0xf27b('0x1c4'),_0xc802a4[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0xc802a4[_0xf27b('0x154')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0xc802a4,'no\x20find\x20by\x20configured');}logger[_0xf27b('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xf27b('0x12')][_0xf27b('0x3b')],_0xc802a4['findBy']));var _0x533720=this[_0xf27b('0x5b')][_0xf27b('0x7a')](this,_0xc802a4[_0xf27b('0x154')]);if(_0x533720){logger[_0xf27b('0x30')](util['format'](_0xf27b('0x157'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0xc802a4['findBy']));this[_0xf27b('0x12')]['noop'](util['format'](_0xf27b('0x157'),this['channel'][_0xf27b('0x3b')],_0xc802a4[_0xf27b('0x154')]));return{'code':0xc8,'result':_0xf27b('0x158')};}else{logger[_0xf27b('0x30')](util[_0xf27b('0x5f')](_0xf27b('0x159'),this['channel'][_0xf27b('0x3b')],_0xc802a4[_0xf27b('0x154')]));this[_0xf27b('0x12')]['noop'](util[_0xf27b('0x5f')](_0xf27b('0x159'),this[_0xf27b('0x12')][_0xf27b('0x3b')],_0xc802a4['findBy']));return{'code':0xc8,'result':_0xf27b('0x15b')};}};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1c5')]=function(_0x55aed5){logger[_0xf27b('0x30')](util[_0xf27b('0x5f')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x55aed5['label']));var _0x2c5364=this[_0xf27b('0x12')][_0xf27b('0xb1')](_0xf27b('0x1c6'),[_0x55aed5['mailbox'],_0x55aed5[_0xf27b('0x80')]]);if(_0x2c5364['result']===-0x1){return _0x2c5364;}return this[_0xf27b('0x12')][_0xf27b('0xb4')](util[_0xf27b('0x5f')](_0xf27b('0xc9'),_0xf27b('0x1c6'),_0x55aed5[_0xf27b('0x1c7')]));};AGIVertices[_0xf27b('0x18')][_0xf27b('0x1c8')]=function(_0x2539b4){logger[_0xf27b('0x30')](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2539b4[_0xf27b('0x38')]));if(!this[_0xf27b('0xac')](_0x2539b4[_0xf27b('0xdc')])){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x2539b4,_0xf27b('0x1c9'));}var _0x1b767c=this[_0xf27b('0xa8')][_0xf27b('0x7a')](this,_0x2539b4['variable_id']);if(!_0x1b767c){return this[_0xf27b('0x12')][_0xf27b('0x2e')](_0x2539b4,'no\x20variable\x20found');}var _0x563bdb=this[_0xf27b('0x12')][_0xf27b('0xa8')](_0x1b767c);return{'code':0xc8,'result':_0x563bdb[_0xf27b('0xa9')]?_0x563bdb[_0xf27b('0xa9')]:'-'};};String['prototype']['replaceAll']=function(_0x2452f7,_0x40a05a){return this[_0xf27b('0xa6')](_0x2452f7)[_0xf27b('0x1ca')](_0x40a05a);};module[_0xf27b('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 5cd3bdd..26b518e 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 _0xc1c9=['[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','updateAcw','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw'];(function(_0x11097b,_0x5b4acc){var _0x5ede31=function(_0x4426d4){while(--_0x4426d4){_0x11097b['push'](_0x11097b['shift']());}};_0x5ede31(++_0x5b4acc);}(_0xc1c9,0x65));var _0x9c1c=function(_0x2e3107,_0x25f970){_0x2e3107=_0x2e3107-0x0;var _0x833d69=_0xc1c9[_0x2e3107];return _0x833d69;};'use strict';var util=require(_0x9c1c('0x0'));var _=require(_0x9c1c('0x1'));var moment=require('moment');var ami=require(_0x9c1c('0x2'));var logger=require('../../../config/logger')(_0x9c1c('0x3'));var RpcUser=require(_0x9c1c('0x4'));var RpcVoiceAgentReport=require(_0x9c1c('0x5'));function Acw(_0x24bf13){this[_0x9c1c('0x6')]=_0x24bf13[_0x9c1c('0x6')];this[_0x9c1c('0x7')]=_0x24bf13['agents'];this[_0x9c1c('0x8')]=_0x24bf13[_0x9c1c('0x8')];this[_0x9c1c('0x9')]={};ami['on'](_0x9c1c('0xa'),this[_0x9c1c('0xb')][_0x9c1c('0xc')](this));ami['on'](_0x9c1c('0xd'),this[_0x9c1c('0xe')][_0x9c1c('0xc')](this));ami['on'](_0x9c1c('0xf'),this[_0x9c1c('0x10')]['bind'](this));ami['on']('agentringnoanswer',this[_0x9c1c('0x11')][_0x9c1c('0xc')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x9c1c('0x12'),this[_0x9c1c('0x13')][_0x9c1c('0xc')](this));ami['on'](_0x9c1c('0x14'),this[_0x9c1c('0x15')]['bind'](this));}function getDiff(_0x9d4461){var _0x5e0f03=moment()[_0x9c1c('0x16')](0x0);var _0x11decb=moment(_0x9d4461)[_0x9c1c('0x16')](0x0);return _0x5e0f03['diff'](_0x11decb,_0x9c1c('0x17'));}Acw[_0x9c1c('0x18')]['startAcw']=function(_0x5064e2){try{var _0x44d2bb=this;var _0x2bafeb=this[_0x9c1c('0x9')][_0x5064e2][_0x9c1c('0x19')];var _0x289cb7=this[_0x9c1c('0x9')][_0x5064e2][_0x9c1c('0x1a')];var _0x3f9d56=this['voiceQueues'][_0x289cb7];var _0x1e3b5d=![];var _0x26798a='ACW';if(_0x3f9d56[_0x9c1c('0x1b')]){if(_0x3f9d56[_0x9c1c('0x1c')][_0x9c1c('0x1d')]){_0x1e3b5d=!![];_0x26798a=_0x3f9d56[_0x9c1c('0x1c')]['name'];}}ami[_0x9c1c('0x1e')]({'action':_0x9c1c('0x1f'),'interface':_0x2bafeb,'paused':!![],'reason':_0x26798a})[_0x9c1c('0x20')](function(_0x5582bb){if(_0x44d2bb[_0x9c1c('0x7')][_0x2bafeb]){return RpcUser[_0x9c1c('0x21')](_0x44d2bb['agents'][_0x2bafeb]['id'])[_0x9c1c('0x20')](function(_0x1078f5){if(_0x1078f5&&!_0x1078f5[_0x9c1c('0x22')]){logger[_0x9c1c('0x23')](_0x9c1c('0x24'),_0x5064e2,_0x2bafeb,_0x289cb7);var _0x32c891=_0x44d2bb[_0x9c1c('0x9')][_0x5064e2]['attended']&&_0x44d2bb[_0x9c1c('0x9')][_0x5064e2][_0x9c1c('0x25')]?_0x44d2bb[_0x9c1c('0x9')][_0x5064e2][_0x9c1c('0x25')]:_0x5064e2;return RpcUser[_0x9c1c('0x26')](_0x44d2bb[_0x9c1c('0x7')][_0x2bafeb],_0x26798a,_0x32c891)[_0x9c1c('0x20')](function(_0x4fe0bb){if(!_0x1e3b5d){_0x44d2bb['timers'][_0x2bafeb]={};logger[_0x9c1c('0x23')](_0x9c1c('0x27'),_0x5064e2,_0x44d2bb['voiceQueues'][_0x289cb7][_0x9c1c('0x28')],_0x2bafeb,_0x289cb7);_0x44d2bb['timers'][_0x2bafeb]['timer']=setTimeout(_0x44d2bb[_0x9c1c('0x29')]['bind'](_0x44d2bb,_0x2bafeb),_0x44d2bb['voiceQueues'][_0x289cb7][_0x9c1c('0x28')]*0x3e8);_0x44d2bb[_0x9c1c('0x8')][_0x2bafeb][_0x9c1c('0x2a')]=moment()[_0x9c1c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');_0x44d2bb['timers'][_0x2bafeb]['uniqueid']=_0x5064e2;_0x44d2bb[_0x9c1c('0x8')][_0x2bafeb][_0x9c1c('0x1a')]=_0x289cb7;_0x44d2bb[_0x9c1c('0x8')][_0x2bafeb][_0x9c1c('0x2c')]=function(){var _0x49a446=getDiff(_0x44d2bb['timers'][_0x2bafeb]['lastPauseAt']);clearTimeout(_0x44d2bb[_0x9c1c('0x8')][_0x2bafeb]['timer']);_0x44d2bb['timers'][_0x2bafeb][_0x9c1c('0x2d')]=![];RpcVoiceAgentReport[_0x9c1c('0x2e')]({'acwtime':_0x49a446},_0x44d2bb[_0x9c1c('0x8')][_0x2bafeb][_0x9c1c('0x2f')],_0x2bafeb)['then'](function(_0x5a1161){logger[_0x9c1c('0x23')](_0x9c1c('0x30'),_0x5064e2,_0x49a446,_0x5a1161);})[_0x9c1c('0x31')](function(_0x279fe1){logger[_0x9c1c('0x32')](_0x9c1c('0x33'),_0x5064e2,_0x279fe1);});delete _0x44d2bb[_0x9c1c('0x8')][_0x2bafeb];};}});}else{logger[_0x9c1c('0x23')](_0x9c1c('0x34'),_0x5064e2,_0x2bafeb,_0x289cb7);}});}})[_0x9c1c('0x31')](function(_0x2fd3f8){logger[_0x9c1c('0x32')](_0x9c1c('0x27'),_0x5064e2,_0x44d2bb[_0x9c1c('0x6')][_0x289cb7][_0x9c1c('0x28')],_0x2bafeb,_0x289cb7);})[_0x9c1c('0x35')](function(){delete _0x44d2bb['channels'][_0x5064e2];});}catch(_0x15dabe){logger['error'](_0x9c1c('0x36'),_0x15dabe[_0x9c1c('0x37')]);}};Acw['prototype'][_0x9c1c('0x29')]=function(_0x329408){try{var _0xa59875=this;if(_0xa59875['timers'][_0x329408]){_0xa59875[_0x9c1c('0x8')][_0x329408]['timer']=![];var _0x31a476=_0xa59875[_0x9c1c('0x8')][_0x329408][_0x9c1c('0x2f')];var _0x89d4c3=_0xa59875['timers'][_0x329408][_0x9c1c('0x1a')];var _0x45f7b9=_0xa59875[_0x9c1c('0x6')][_0x89d4c3][_0x9c1c('0x28')];logger['info'](_0x9c1c('0x38'),_0x31a476,_0x329408);RpcUser[_0x9c1c('0x39')](this[_0x9c1c('0x7')][_0x329408]);RpcVoiceAgentReport[_0x9c1c('0x2e')]({'acwtime':_0x45f7b9,'agentacw':!![]},_0x31a476,_0x329408)[_0x9c1c('0x20')](function(_0x299d94){logger[_0x9c1c('0x23')](_0x9c1c('0x30'),_0x31a476,_0x45f7b9,_0x299d94);})[_0x9c1c('0x31')](function(_0x336bbd){logger[_0x9c1c('0x32')](_0x9c1c('0x33'),_0x31a476,_0x336bbd);});}else{logger[_0x9c1c('0x32')](_0x9c1c('0x3a'),_0x329408);if(_0xa59875[_0x9c1c('0x8')]){logger['info'](_0x9c1c('0x3b'),JSON[_0x9c1c('0x3c')](_0xa59875[_0x9c1c('0x8')]));}}}catch(_0x5a9d5d){logger[_0x9c1c('0x32')](_0x9c1c('0x3d'),_0x5a9d5d[_0x9c1c('0x37')]);}};Acw[_0x9c1c('0x18')]['syncAgentConnect']=function(_0xd28a43){try{if(this[_0x9c1c('0x6')][_0xd28a43[_0x9c1c('0x1a')]]&&(this[_0x9c1c('0x6')][_0xd28a43['queue']][_0x9c1c('0x3')]||this[_0x9c1c('0x6')][_0xd28a43['queue']][_0x9c1c('0x1b')])){if(this[_0x9c1c('0x7')][_0xd28a43[_0x9c1c('0x19')]]){this['channels'][_0xd28a43[_0x9c1c('0x2f')]]={'queue':_0xd28a43[_0x9c1c('0x1a')],'interface':_0xd28a43[_0x9c1c('0x19')],'destlinkedid':_0xd28a43[_0x9c1c('0x25')]};}}}catch(_0x84eddb){logger[_0x9c1c('0x32')](_0x9c1c('0x3e'),_0x84eddb[_0x9c1c('0x37')]);}};Acw[_0x9c1c('0x18')][_0x9c1c('0x15')]=function(_0x5df814){try{if(this[_0x9c1c('0x6')][_0x5df814[_0x9c1c('0x1a')]]&&(this[_0x9c1c('0x6')][_0x5df814[_0x9c1c('0x1a')]][_0x9c1c('0x3')]||this['voiceQueues'][_0x5df814[_0x9c1c('0x1a')]][_0x9c1c('0x1b')])){if(this['agents'][_0x5df814[_0x9c1c('0x19')]]){this['channels'][_0x5df814[_0x9c1c('0x2f')]]={'queue':_0x5df814[_0x9c1c('0x1a')],'interface':_0x5df814[_0x9c1c('0x19')]};}}}catch(_0x5cdea5){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x5cdea5[_0x9c1c('0x37')]);}};Acw[_0x9c1c('0x18')][_0x9c1c('0xe')]=function(_0x37de7c){try{if(this[_0x9c1c('0x9')][_0x37de7c['uniqueid']]&&_[_0x9c1c('0x3f')](this[_0x9c1c('0x9')][_0x37de7c[_0x9c1c('0x2f')]][_0x9c1c('0x40')])){logger['info'](_0x9c1c('0x41'),_0x37de7c[_0x9c1c('0x2f')]);this['startAcw'](_0x37de7c[_0x9c1c('0x2f')]);}else if(this[_0x9c1c('0x9')][_0x37de7c[_0x9c1c('0x42')]]&&_['isUndefined'](this[_0x9c1c('0x9')][_0x37de7c['linkedid']][_0x9c1c('0x40')])){logger[_0x9c1c('0x23')](_0x9c1c('0x43'),_0x37de7c[_0x9c1c('0x42')]);this[_0x9c1c('0x44')](_0x37de7c[_0x9c1c('0x42')]);}}catch(_0x4df73f){logger[_0x9c1c('0x32')](_0x9c1c('0x45'),_0x4df73f[_0x9c1c('0x37')]);}};Acw['prototype'][_0x9c1c('0x10')]=function(_0x9daff5){try{if(this[_0x9c1c('0x9')][_0x9daff5[_0x9c1c('0x2f')]]&&this['channels'][_0x9daff5[_0x9c1c('0x2f')]][_0x9c1c('0x40')]){logger[_0x9c1c('0x23')](_0x9c1c('0x46'),_0x9daff5[_0x9c1c('0x2f')]);this['startAcw'](_0x9daff5[_0x9c1c('0x2f')]);}else if(this['channels'][_0x9daff5[_0x9c1c('0x42')]]&&this[_0x9c1c('0x9')][_0x9daff5['linkedid']][_0x9c1c('0x40')]){logger[_0x9c1c('0x23')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x9daff5[_0x9c1c('0x42')]);this['startAcw'](_0x9daff5[_0x9c1c('0x42')]);}}catch(_0x369186){logger['error'](_0x9c1c('0x47'),_0x369186['message']);}};Acw[_0x9c1c('0x18')]['syncAttendedTransfer']=function(_0x39c3ed){try{if(!_['isNil'](this['channels'][_0x39c3ed[_0x9c1c('0x48')]])){this[_0x9c1c('0x44')](_0x39c3ed[_0x9c1c('0x48')]);if(this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x49')]]){this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x49')]][_0x9c1c('0x40')]=!![];this[_0x9c1c('0x9')][_0x39c3ed['transfertargetuniqueid']]=this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x49')]];delete this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x49')]];}}else if(!_[_0x9c1c('0x4a')](this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x4b')]])){this['startAcw'](_0x39c3ed[_0x9c1c('0x4b')]);if(this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x4c')]]){this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x4c')]][_0x9c1c('0x40')]=!![];this['channels'][_0x39c3ed[_0x9c1c('0x48')]]=this['channels'][_0x39c3ed[_0x9c1c('0x4c')]];delete this[_0x9c1c('0x9')][_0x39c3ed[_0x9c1c('0x4c')]];}}}catch(_0x17386d){logger[_0x9c1c('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x17386d[_0x9c1c('0x37')]);}};Acw[_0x9c1c('0x18')][_0x9c1c('0x13')]=function(_0x1d097d){try{if(this[_0x9c1c('0x9')][_0x1d097d['transfereruniqueid']]){logger[_0x9c1c('0x23')](_0x9c1c('0x4d'),JSON[_0x9c1c('0x3c')](_0x1d097d['transfereruniqueid']));this[_0x9c1c('0x44')](_0x1d097d[_0x9c1c('0x4e')]);}else if(this[_0x9c1c('0x9')][_0x1d097d['transfererlinkedid']]){logger[_0x9c1c('0x23')](_0x9c1c('0x4f'),JSON[_0x9c1c('0x3c')](_0x1d097d[_0x9c1c('0x50')]));this[_0x9c1c('0x44')](_0x1d097d[_0x9c1c('0x50')]);}}catch(_0xb032ea){logger[_0x9c1c('0x32')](_0x9c1c('0x51'),_0xb032ea[_0x9c1c('0x37')]);}};Acw[_0x9c1c('0x18')][_0x9c1c('0x11')]=function(_0x47be20){try{if(this['voiceQueues'][_0x47be20[_0x9c1c('0x1a')]]&&this[_0x9c1c('0x6')][_0x47be20[_0x9c1c('0x1a')]]['autopause']===_0x9c1c('0x52')){if(this['agents'][_0x47be20[_0x9c1c('0x19')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x47be20[_0x9c1c('0x2f')],_0x47be20[_0x9c1c('0x19')],_0x47be20[_0x9c1c('0x1a')]);return RpcUser['savePause'](this[_0x9c1c('0x7')][_0x47be20[_0x9c1c('0x19')]],_0x9c1c('0x53'),_0x47be20[_0x9c1c('0x2f')]);}}}catch(_0xde6828){logger[_0x9c1c('0x32')](_0x9c1c('0x54'),_0xde6828[_0x9c1c('0x37')]);}};module['exports']=Acw; \ No newline at end of file +var _0xed67=['info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','queue','[ACW][syncAgentConnect]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','syncAgentRingNoAnswer','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','Action','QueuePause','then','getAgent'];(function(_0x19a5fa,_0x2b2004){var _0x2c158d=function(_0x1fc843){while(--_0x1fc843){_0x19a5fa['push'](_0x19a5fa['shift']());}};_0x2c158d(++_0x2b2004);}(_0xed67,0x12f));var _0x7ed6=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xed67[_0x4fbfd9];return _0x31dc94;};'use strict';var util=require(_0x7ed6('0x0'));var _=require('lodash');var moment=require(_0x7ed6('0x1'));var ami=require(_0x7ed6('0x2'));var logger=require(_0x7ed6('0x3'))(_0x7ed6('0x4'));var RpcUser=require(_0x7ed6('0x5'));var RpcVoiceAgentReport=require(_0x7ed6('0x6'));function Acw(_0x405b32){this[_0x7ed6('0x7')]=_0x405b32[_0x7ed6('0x7')];this[_0x7ed6('0x8')]=_0x405b32[_0x7ed6('0x8')];this[_0x7ed6('0x9')]=_0x405b32['timers'];this[_0x7ed6('0xa')]={};ami['on'](_0x7ed6('0xb'),this['syncAgentConnect'][_0x7ed6('0xc')](this));ami['on']('hanguprequest',this[_0x7ed6('0xd')][_0x7ed6('0xc')](this));ami['on'](_0x7ed6('0xe'),this['syncHangup'][_0x7ed6('0xc')](this));ami['on'](_0x7ed6('0xf'),this['syncAgentRingNoAnswer'][_0x7ed6('0xc')](this));ami['on'](_0x7ed6('0x10'),this[_0x7ed6('0x11')][_0x7ed6('0xc')](this));ami['on'](_0x7ed6('0x12'),this[_0x7ed6('0x13')][_0x7ed6('0xc')](this));ami['on'](_0x7ed6('0x14'),this[_0x7ed6('0x15')][_0x7ed6('0xc')](this));}function getDiff(_0x3bf06f){var _0x472967=moment()[_0x7ed6('0x16')](0x0);var _0x40a740=moment(_0x3bf06f)[_0x7ed6('0x16')](0x0);return _0x472967['diff'](_0x40a740,_0x7ed6('0x17'));}Acw[_0x7ed6('0x18')][_0x7ed6('0x19')]=function(_0x4b3172){try{var _0x45eec3=this;var _0x52608f=this['channels'][_0x4b3172][_0x7ed6('0x1a')];var _0x57c7dc=this['channels'][_0x4b3172]['queue'];var _0x28c8f1=this['voiceQueues'][_0x57c7dc];var _0x294f56=![];var _0x2975ea=_0x7ed6('0x1b');if(_0x28c8f1[_0x7ed6('0x1c')]){if(_0x28c8f1['mandatoryDispositionPause']['name']){_0x294f56=!![];_0x2975ea=_0x28c8f1['mandatoryDispositionPause']['name'];}}ami[_0x7ed6('0x1d')]({'action':_0x7ed6('0x1e'),'interface':_0x52608f,'paused':!![],'reason':_0x2975ea})[_0x7ed6('0x1f')](function(_0xfb4d3f){if(_0x45eec3[_0x7ed6('0x8')][_0x52608f]){return RpcUser[_0x7ed6('0x20')](_0x45eec3[_0x7ed6('0x8')][_0x52608f]['id'])[_0x7ed6('0x1f')](function(_0x5f0d3a){if(_0x5f0d3a&&!_0x5f0d3a['voicePause']){logger[_0x7ed6('0x21')](_0x7ed6('0x22'),_0x4b3172,_0x52608f,_0x57c7dc);var _0x19c207=_0x45eec3[_0x7ed6('0xa')][_0x4b3172][_0x7ed6('0x23')]&&_0x45eec3['channels'][_0x4b3172]['destlinkedid']?_0x45eec3[_0x7ed6('0xa')][_0x4b3172][_0x7ed6('0x24')]:_0x4b3172;return RpcUser[_0x7ed6('0x25')](_0x45eec3[_0x7ed6('0x8')][_0x52608f],_0x2975ea,_0x19c207)[_0x7ed6('0x1f')](function(_0x107609){if(!_0x294f56){_0x45eec3[_0x7ed6('0x9')][_0x52608f]={};logger[_0x7ed6('0x21')](_0x7ed6('0x26'),_0x4b3172,_0x45eec3[_0x7ed6('0x7')][_0x57c7dc]['acwTimeout'],_0x52608f,_0x57c7dc);_0x45eec3[_0x7ed6('0x9')][_0x52608f][_0x7ed6('0x27')]=setTimeout(_0x45eec3[_0x7ed6('0x28')]['bind'](_0x45eec3,_0x52608f),_0x45eec3[_0x7ed6('0x7')][_0x57c7dc][_0x7ed6('0x29')]*0x3e8);_0x45eec3[_0x7ed6('0x9')][_0x52608f][_0x7ed6('0x2a')]=moment()['format'](_0x7ed6('0x2b'));_0x45eec3[_0x7ed6('0x9')][_0x52608f][_0x7ed6('0x2c')]=_0x4b3172;_0x45eec3['timers'][_0x52608f]['queue']=_0x57c7dc;_0x45eec3[_0x7ed6('0x9')][_0x52608f][_0x7ed6('0x2d')]=function(){var _0x40e59f=getDiff(_0x45eec3[_0x7ed6('0x9')][_0x52608f]['lastPauseAt']);clearTimeout(_0x45eec3[_0x7ed6('0x9')][_0x52608f][_0x7ed6('0x27')]);_0x45eec3[_0x7ed6('0x9')][_0x52608f]['timer']=![];RpcVoiceAgentReport[_0x7ed6('0x2e')]({'acwtime':_0x40e59f},_0x45eec3['timers'][_0x52608f][_0x7ed6('0x2c')],_0x52608f)['then'](function(_0x46f1f1){logger[_0x7ed6('0x21')](_0x7ed6('0x2f'),_0x4b3172,_0x40e59f,_0x46f1f1);})[_0x7ed6('0x30')](function(_0x57db5c){logger[_0x7ed6('0x31')](_0x7ed6('0x32'),_0x4b3172,_0x57db5c);});delete _0x45eec3[_0x7ed6('0x9')][_0x52608f];};}});}else{logger['info'](_0x7ed6('0x33'),_0x4b3172,_0x52608f,_0x57c7dc);}});}})[_0x7ed6('0x30')](function(_0x52740f){logger['error'](_0x7ed6('0x26'),_0x4b3172,_0x45eec3[_0x7ed6('0x7')][_0x57c7dc][_0x7ed6('0x29')],_0x52608f,_0x57c7dc);})[_0x7ed6('0x34')](function(){delete _0x45eec3['channels'][_0x4b3172];});}catch(_0x24deff){logger['error'](_0x7ed6('0x35'),_0x24deff[_0x7ed6('0x36')]);}};Acw[_0x7ed6('0x18')][_0x7ed6('0x28')]=function(_0x3ab9f6){try{var _0x334a76=this;if(_0x334a76[_0x7ed6('0x9')][_0x3ab9f6]){_0x334a76['timers'][_0x3ab9f6][_0x7ed6('0x27')]=![];var _0x30deb9=_0x334a76[_0x7ed6('0x9')][_0x3ab9f6][_0x7ed6('0x2c')];var _0x81a810=_0x334a76[_0x7ed6('0x9')][_0x3ab9f6]['queue'];var _0x1d315f=_0x334a76[_0x7ed6('0x7')][_0x81a810]['acwTimeout'];logger['info'](_0x7ed6('0x37'),_0x30deb9,_0x3ab9f6);RpcUser[_0x7ed6('0x38')](this[_0x7ed6('0x8')][_0x3ab9f6]);RpcVoiceAgentReport[_0x7ed6('0x2e')]({'acwtime':_0x1d315f,'agentacw':!![]},_0x30deb9,_0x3ab9f6)[_0x7ed6('0x1f')](function(_0x29f9ec){logger[_0x7ed6('0x21')](_0x7ed6('0x2f'),_0x30deb9,_0x1d315f,_0x29f9ec);})[_0x7ed6('0x30')](function(_0x1edae7){logger['error'](_0x7ed6('0x32'),_0x30deb9,_0x1edae7);});}else{logger[_0x7ed6('0x31')](_0x7ed6('0x39'),_0x3ab9f6);if(_0x334a76[_0x7ed6('0x9')]){logger[_0x7ed6('0x21')]('[ACW][TIMERS]',JSON[_0x7ed6('0x3a')](_0x334a76[_0x7ed6('0x9')]));}}}catch(_0x3e211c){logger[_0x7ed6('0x31')](_0x7ed6('0x3b'),_0x3e211c[_0x7ed6('0x36')]);}};Acw[_0x7ed6('0x18')][_0x7ed6('0x3c')]=function(_0xe07492){try{if(this['voiceQueues'][_0xe07492[_0x7ed6('0x3d')]]&&(this['voiceQueues'][_0xe07492[_0x7ed6('0x3d')]][_0x7ed6('0x4')]||this[_0x7ed6('0x7')][_0xe07492[_0x7ed6('0x3d')]][_0x7ed6('0x1c')])){if(this[_0x7ed6('0x8')][_0xe07492[_0x7ed6('0x1a')]]){this[_0x7ed6('0xa')][_0xe07492['uniqueid']]={'queue':_0xe07492[_0x7ed6('0x3d')],'interface':_0xe07492['interface'],'destlinkedid':_0xe07492[_0x7ed6('0x24')]};}}}catch(_0x48685c){logger[_0x7ed6('0x31')](_0x7ed6('0x3e'),_0x48685c[_0x7ed6('0x36')]);}};Acw[_0x7ed6('0x18')][_0x7ed6('0x15')]=function(_0x5ac93e){try{if(this['voiceQueues'][_0x5ac93e[_0x7ed6('0x3d')]]&&(this[_0x7ed6('0x7')][_0x5ac93e['queue']][_0x7ed6('0x4')]||this['voiceQueues'][_0x5ac93e[_0x7ed6('0x3d')]][_0x7ed6('0x1c')])){if(this[_0x7ed6('0x8')][_0x5ac93e['interface']]){this['channels'][_0x5ac93e['uniqueid']]={'queue':_0x5ac93e[_0x7ed6('0x3d')],'interface':_0x5ac93e[_0x7ed6('0x1a')]};}}}catch(_0x34ffbb){logger[_0x7ed6('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x34ffbb['message']);}};Acw[_0x7ed6('0x18')][_0x7ed6('0xd')]=function(_0xcab147){try{if(this['channels'][_0xcab147['uniqueid']]&&_[_0x7ed6('0x3f')](this[_0x7ed6('0xa')][_0xcab147['uniqueid']][_0x7ed6('0x23')])){logger[_0x7ed6('0x21')](_0x7ed6('0x40'),_0xcab147[_0x7ed6('0x2c')]);this[_0x7ed6('0x19')](_0xcab147['uniqueid']);}else if(this[_0x7ed6('0xa')][_0xcab147[_0x7ed6('0x41')]]&&_[_0x7ed6('0x3f')](this[_0x7ed6('0xa')][_0xcab147[_0x7ed6('0x41')]][_0x7ed6('0x23')])){logger[_0x7ed6('0x21')](_0x7ed6('0x42'),_0xcab147['linkedid']);this[_0x7ed6('0x19')](_0xcab147[_0x7ed6('0x41')]);}}catch(_0x104324){logger[_0x7ed6('0x31')](_0x7ed6('0x43'),_0x104324[_0x7ed6('0x36')]);}};Acw[_0x7ed6('0x18')][_0x7ed6('0x44')]=function(_0x1c0066){try{if(this[_0x7ed6('0xa')][_0x1c0066[_0x7ed6('0x2c')]]&&this[_0x7ed6('0xa')][_0x1c0066['uniqueid']][_0x7ed6('0x23')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x1c0066[_0x7ed6('0x2c')]);this['startAcw'](_0x1c0066[_0x7ed6('0x2c')]);}else if(this[_0x7ed6('0xa')][_0x1c0066['linkedid']]&&this['channels'][_0x1c0066[_0x7ed6('0x41')]][_0x7ed6('0x23')]){logger[_0x7ed6('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1c0066[_0x7ed6('0x41')]);this[_0x7ed6('0x19')](_0x1c0066[_0x7ed6('0x41')]);}}catch(_0x48ee74){logger[_0x7ed6('0x31')](_0x7ed6('0x45'),_0x48ee74[_0x7ed6('0x36')]);}};Acw['prototype'][_0x7ed6('0x11')]=function(_0x180fea){try{if(!_[_0x7ed6('0x46')](this[_0x7ed6('0xa')][_0x180fea[_0x7ed6('0x47')]])){this[_0x7ed6('0x19')](_0x180fea['transfereeuniqueid']);if(this[_0x7ed6('0xa')][_0x180fea[_0x7ed6('0x48')]]){this[_0x7ed6('0xa')][_0x180fea['secondtransfereruniqueid']]['attended']=!![];this[_0x7ed6('0xa')][_0x180fea['transfertargetuniqueid']]=this[_0x7ed6('0xa')][_0x180fea['secondtransfereruniqueid']];delete this['channels'][_0x180fea[_0x7ed6('0x48')]];}}else if(!_[_0x7ed6('0x46')](this[_0x7ed6('0xa')][_0x180fea[_0x7ed6('0x49')]])){this[_0x7ed6('0x19')](_0x180fea[_0x7ed6('0x49')]);if(this[_0x7ed6('0xa')][_0x180fea[_0x7ed6('0x4a')]]){this['channels'][_0x180fea['origtransfereruniqueid']][_0x7ed6('0x23')]=!![];this[_0x7ed6('0xa')][_0x180fea[_0x7ed6('0x47')]]=this[_0x7ed6('0xa')][_0x180fea[_0x7ed6('0x4a')]];delete this['channels'][_0x180fea[_0x7ed6('0x4a')]];}}}catch(_0x35cbca){logger[_0x7ed6('0x31')](_0x7ed6('0x4b'),_0x35cbca['message']);}};Acw[_0x7ed6('0x18')][_0x7ed6('0x13')]=function(_0x71d122){try{if(this[_0x7ed6('0xa')][_0x71d122[_0x7ed6('0x4c')]]){logger[_0x7ed6('0x21')](_0x7ed6('0x4d'),JSON['stringify'](_0x71d122[_0x7ed6('0x4c')]));this['startAcw'](_0x71d122[_0x7ed6('0x4c')]);}else if(this['channels'][_0x71d122[_0x7ed6('0x4e')]]){logger[_0x7ed6('0x21')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x71d122['transfererlinkedid']));this[_0x7ed6('0x19')](_0x71d122[_0x7ed6('0x4e')]);}}catch(_0x2310e4){logger[_0x7ed6('0x31')]('[ACW][syncBlindTransfer]\x20%s',_0x2310e4['message']);}};Acw[_0x7ed6('0x18')][_0x7ed6('0x4f')]=function(_0x4f0b96){try{if(this[_0x7ed6('0x7')][_0x4f0b96['queue']]&&this[_0x7ed6('0x7')][_0x4f0b96[_0x7ed6('0x3d')]][_0x7ed6('0x50')]==='all'){if(this[_0x7ed6('0x8')][_0x4f0b96['interface']]){logger[_0x7ed6('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4f0b96[_0x7ed6('0x2c')],_0x4f0b96[_0x7ed6('0x1a')],_0x4f0b96[_0x7ed6('0x3d')]);return RpcUser[_0x7ed6('0x25')](this[_0x7ed6('0x8')][_0x4f0b96['interface']],_0x7ed6('0x51'),_0x4f0b96['uniqueid']);}}}catch(_0x1d9416){logger[_0x7ed6('0x31')](_0x7ed6('0x52'),_0x1d9416[_0x7ed6('0x36')]);}};module[_0x7ed6('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index eaff97d..ddc0503 100644 --- a/server/services/ami/ami.js +++ b/server/services/ami/ami.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x1a6514,_0x47a1ba){var _0x4b0ed8=function(_0x49b57d){while(--_0x49b57d){_0x1a6514['push'](_0x1a6514['shift']());}};_0x4b0ed8(++_0x47a1ba);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file +var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x5d6cce,_0x3e2f1b){var _0x18e315=function(_0x4cbca6){while(--_0x4cbca6){_0x5d6cce['push'](_0x5d6cce['shift']());}};_0x18e315(++_0x3e2f1b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a8c0d9c..5d496f8 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 _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x5e9d35,_0x382c91){var _0x3beb2e=function(_0x4242cf){while(--_0x4242cf){_0x5e9d35['push'](_0x5e9d35['shift']());}};_0x3beb2e(++_0x382c91);}(_0xb7e7,0x121));var _0x7b7e=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0xb7e7[_0x341e0f];return _0x59555a;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file +var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xcb91[_0x58afd5];return _0x3e503b;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('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 2077f79..051bd38 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 _0xd743=['Contact','phone','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','getQueue','exports','util','lodash','string','name'];(function(_0x57966a,_0x477964){var _0x191765=function(_0x106a01){while(--_0x106a01){_0x57966a['push'](_0x57966a['shift']());}};_0x191765(++_0x477964);}(_0xd743,0x1a0));var _0x3d74=function(_0x7eac63,_0x2da992){_0x7eac63=_0x7eac63-0x0;var _0x23de16=_0xd743[_0x7eac63];return _0x23de16;};'use strict';var util=require(_0x3d74('0x0'));var _=require(_0x3d74('0x1'));var moment=require('moment');function checkNameSurname(_0x307f86,_0x3e56ec,_0x1e85b6){var _0x238d67='';if(!_['isNil'](_0x3e56ec)&&_0x3d74('0x2')===typeof _0x3e56ec){_0x238d67+=_0x3e56ec;}if(!_['isNil'](_0x1e85b6)&&_0x3d74('0x2')===typeof _0x1e85b6){_0x238d67+='\x20'+_0x1e85b6;}if(_0x238d67!==''){return _0x238d67;}return _0x307f86;}function Action(_0x198aa9,_0x29881d,_0x54a2a0){this['voiceQueue']=_0x198aa9;this['uniqueid']=_0x54a2a0||undefined;this[_0x3d74('0x3')]=checkNameSurname(_0x29881d[_0x3d74('0x4')][_0x3d74('0x5')],_0x29881d[_0x3d74('0x4')]['firstName'],_0x29881d['Contact'][_0x3d74('0x6')]);this[_0x3d74('0x7')]=_0x29881d['Contact']['phone'];this[_0x3d74('0x8')]=_0x198aa9[_0x3d74('0x3')];this['active']=_0x29881d[_0x3d74('0x9')]||![];this[_0x3d74('0xa')]=_0x198aa9[_0x3d74('0xa')];this['dialQueueTimeout']=_0x198aa9[_0x3d74('0xb')]||0x3;this[_0x3d74('0xc')]=_0x29881d[_0x3d74('0xc')];this[_0x3d74('0xd')]=_0x29881d[_0x3d74('0xd')];this['countcongestionretry']=_0x29881d[_0x3d74('0xe')];this[_0x3d74('0xf')]=_0x29881d['countnoanswerretry'];this[_0x3d74('0x10')]=_0x29881d[_0x3d74('0x10')];this[_0x3d74('0x11')]=_0x29881d[_0x3d74('0x11')];this[_0x3d74('0x12')]=_0x29881d[_0x3d74('0x12')];this['countmachineretry']=_0x29881d['countmachineretry'];this['countagentrejectretry']=_0x29881d[_0x3d74('0x13')];this[_0x3d74('0x14')]=_0x29881d[_0x3d74('0x14')];this[_0x3d74('0x15')]=_0x29881d[_0x3d74('0x15')];this[_0x3d74('0x16')]=_0x29881d[_0x3d74('0x16')];this[_0x3d74('0x17')]=_0x29881d[_0x3d74('0x17')];this[_0x3d74('0x18')]=_0x29881d[_0x3d74('0x18')];this['idHopper']=_0x29881d['id'];this[_0x3d74('0x19')]=_0x29881d[_0x3d74('0x4')][_0x3d74('0x1a')]||'';this['starttime']=moment()[_0x3d74('0x1b')](_0x3d74('0x1c'));this[_0x3d74('0x1d')]=_0x29881d[_0x3d74('0x1d')];this[_0x3d74('0x1e')]=_0x29881d['callbackuniqueid'];this[_0x3d74('0x1f')]=_0x29881d['callbackat'];this[_0x3d74('0x20')]=_0x29881d['recallme'];this[_0x3d74('0x21')]='';this['originatecalleridname']='';}Action[_0x3d74('0x22')][_0x3d74('0x23')]=function(){return util[_0x3d74('0x1b')](_0x3d74('0x24'),this[_0x3d74('0x3')],this[_0x3d74('0x25')][_0x3d74('0x26')]>0x0?this['number'][_0x3d74('0x27')](this[_0x3d74('0x25')][_0x3d74('0x26')]):this[_0x3d74('0x7')]);};Action[_0x3d74('0x22')][_0x3d74('0x28')]=function(){return this[_0x3d74('0x8')];};module[_0x3d74('0x29')]=Action; \ No newline at end of file +var _0xa67e=['getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit'];(function(_0x1ceda1,_0x4d697f){var _0x429be6=function(_0x320d2b){while(--_0x320d2b){_0x1ceda1['push'](_0x1ceda1['shift']());}};_0x429be6(++_0x4d697f);}(_0xa67e,0xb6));var _0xea67=function(_0x1979c6,_0x582fea){_0x1979c6=_0x1979c6-0x0;var _0x507dbd=_0xa67e[_0x1979c6];return _0x507dbd;};'use strict';var util=require(_0xea67('0x0'));var _=require('lodash');var moment=require(_0xea67('0x1'));function checkNameSurname(_0xe6f1cd,_0xd02309,_0x68da33){var _0x221ea2='';if(!_[_0xea67('0x2')](_0xd02309)&&_0xea67('0x3')===typeof _0xd02309){_0x221ea2+=_0xd02309;}if(!_[_0xea67('0x2')](_0x68da33)&&_0xea67('0x3')===typeof _0x68da33){_0x221ea2+='\x20'+_0x68da33;}if(_0x221ea2!==''){return _0x221ea2;}return _0xe6f1cd;}function Action(_0x59ce12,_0x14be45,_0x28b6fc){this[_0xea67('0x4')]=_0x59ce12;this[_0xea67('0x5')]=_0x28b6fc||undefined;this[_0xea67('0x6')]=checkNameSurname(_0x14be45[_0xea67('0x7')][_0xea67('0x8')],_0x14be45[_0xea67('0x7')][_0xea67('0x9')],_0x14be45[_0xea67('0x7')][_0xea67('0xa')]);this[_0xea67('0xb')]=_0x14be45['Contact'][_0xea67('0x8')];this[_0xea67('0xc')]=_0x59ce12['name'];this[_0xea67('0xd')]=_0x14be45[_0xea67('0xd')]||![];this[_0xea67('0xe')]=_0x59ce12[_0xea67('0xe')];this[_0xea67('0xf')]=_0x59ce12[_0xea67('0xf')]||0x3;this['scheduledat']=_0x14be45[_0xea67('0x10')];this['countbusyretry']=_0x14be45[_0xea67('0x11')];this[_0xea67('0x12')]=_0x14be45[_0xea67('0x12')];this[_0xea67('0x13')]=_0x14be45[_0xea67('0x13')];this['countnosuchnumberretry']=_0x14be45[_0xea67('0x14')];this['countdropretry']=_0x14be45[_0xea67('0x15')];this[_0xea67('0x16')]=_0x14be45[_0xea67('0x16')];this[_0xea67('0x17')]=_0x14be45['countmachineretry'];this[_0xea67('0x18')]=_0x14be45[_0xea67('0x18')];this[_0xea67('0x19')]=_0x14be45[_0xea67('0x19')];this[_0xea67('0x1a')]=_0x14be45['ListId'];this['UserId']=_0x14be45[_0xea67('0x1b')];this[_0xea67('0x1c')]=_0x14be45[_0xea67('0x1c')];this['CampaignId']=_0x14be45[_0xea67('0x1d')];this[_0xea67('0x1e')]=_0x14be45['id'];this[_0xea67('0x1f')]=_0x14be45[_0xea67('0x7')][_0xea67('0x9')]||'';this[_0xea67('0x20')]=moment()['format'](_0xea67('0x21'));this['callback']=_0x14be45['callback'];this[_0xea67('0x22')]=_0x14be45[_0xea67('0x22')];this[_0xea67('0x23')]=_0x14be45[_0xea67('0x23')];this['recallme']=_0x14be45['recallme'];this[_0xea67('0x24')]='';this[_0xea67('0x25')]='';}Action[_0xea67('0x26')][_0xea67('0x27')]=function(){return util[_0xea67('0x28')](_0xea67('0x29'),this[_0xea67('0x6')],this[_0xea67('0x4')][_0xea67('0x2a')]>0x0?this['number']['substring'](this[_0xea67('0x4')][_0xea67('0x2a')]):this[_0xea67('0xb')]);};Action[_0xea67('0x26')][_0xea67('0x2b')]=function(){return this[_0xea67('0xc')];};module[_0xea67('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 6756938..6bd0f2d 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 _0xc18f=['holdtime','talktime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','ringtime'];(function(_0x42bb95,_0x449ff5){var _0x5de2e9=function(_0x2039fe){while(--_0x2039fe){_0x42bb95['push'](_0x42bb95['shift']());}};_0x5de2e9(++_0x449ff5);}(_0xc18f,0x1dc));var _0xfc18=function(_0x11ed68,_0x81fbe2){_0x11ed68=_0x11ed68-0x0;var _0x4ce5a0=_0xc18f[_0x11ed68];return _0x4ce5a0;};'use strict';var util=require(_0xfc18('0x0'));var _=require(_0xfc18('0x1'));var moment=require(_0xfc18('0x2'));function getSeconds(_0x375c10,_0x251377){var _0xbb881=moment(_0x375c10)[_0xfc18('0x3')](0x0);var _0x3fa9f=moment(_0x251377)['milliseconds'](0x0);return _0xbb881[_0xfc18('0x4')](_0x3fa9f,'seconds');}function AgentComplete(_0x2d4b55,_0x525d56){this[_0xfc18('0x5')]=0x4;this[_0xfc18('0x6')]=_0xfc18('0x7');this[_0xfc18('0x8')]=_0x2d4b55[_0xfc18('0x8')];this['type']=_0x2d4b55[_0xfc18('0x9')];this[_0xfc18('0xa')]=_0x2d4b55['type']==='outbound'?'queue':_0x2d4b55['type'];this[_0xfc18('0xb')]=_0x2d4b55[_0xfc18('0xb')];this[_0xfc18('0xc')]=_0x2d4b55[_0xfc18('0xc')];this[_0xfc18('0xd')]=_0x2d4b55[_0xfc18('0xd')];this[_0xfc18('0xe')]=_0x2d4b55[_0xfc18('0xb')]+_0x2d4b55[_0xfc18('0xc')]+_0x2d4b55['countnoanswerretry']+_0x2d4b55[_0xfc18('0xf')]+_0x2d4b55[_0xfc18('0x10')]+_0x2d4b55[_0xfc18('0x11')]+_0x2d4b55['countmachineretry']+_0x2d4b55['countagentrejectretry'];this['countnosuchnumberretry']=_0x2d4b55[_0xfc18('0xf')];this['countdropretry']=_0x2d4b55['countdropretry'];this[_0xfc18('0x11')]=_0x2d4b55[_0xfc18('0x11')];this[_0xfc18('0x12')]=_0x2d4b55[_0xfc18('0x12')];this[_0xfc18('0x13')]=_0x2d4b55[_0xfc18('0x13')];this[_0xfc18('0x14')]=_0x525d56[_0xfc18('0x14')];this[_0xfc18('0x15')]=_0x2d4b55[_0xfc18('0x16')];this[_0xfc18('0x17')]=_0x2d4b55[_0xfc18('0x18')];this[_0xfc18('0x19')]=_0x2d4b55[_0xfc18('0x19')];this[_0xfc18('0x1a')]=_0x2d4b55['responsetime'];this[_0xfc18('0x1b')]=_0x2d4b55[_0xfc18('0x1b')];this['endtime']=moment()[_0xfc18('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xfc18('0x1d')]=getSeconds(_0x2d4b55[_0xfc18('0x1a')],_0x2d4b55[_0xfc18('0x19')]);this[_0xfc18('0x1e')]=getSeconds(_0x2d4b55[_0xfc18('0x1b')],_0x2d4b55[_0xfc18('0x1a')]);this[_0xfc18('0x1f')]=getSeconds(this[_0xfc18('0x20')],_0x2d4b55['answertime']);this[_0xfc18('0x21')]=_0x525d56['queue'];this[_0xfc18('0x22')]=_0x525d56['membername'];this[_0xfc18('0x23')]=_0x525d56[_0xfc18('0x23')];this[_0xfc18('0x24')]=_0x2d4b55[_0xfc18('0x24')];this[_0xfc18('0x25')]=_0x2d4b55[_0xfc18('0x25')];this[_0xfc18('0x26')]=_0x2d4b55[_0xfc18('0x26')];this[_0xfc18('0x27')]=_0x2d4b55[_0xfc18('0x27')];this['ContactId']=_0x2d4b55[_0xfc18('0x28')];this[_0xfc18('0x29')]=_0x2d4b55[_0xfc18('0x29')];this['UserId']=_0x2d4b55['UserId'];this['VoiceQueueId']=_0x2d4b55[_0xfc18('0x2a')];this[_0xfc18('0x2b')]=_0x2d4b55['CampaignId'];this[_0xfc18('0x2c')]=_0x2d4b55[_0xfc18('0x2c')]||'';this[_0xfc18('0x2d')]=_0x2d4b55['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x4fa0=['CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x4fa0,0xea));var _0x04fa=function(_0x3af704,_0x58486b){_0x3af704=_0x3af704-0x0;var _0x4ac16c=_0x4fa0[_0x3af704];return _0x4ac16c;};'use strict';var util=require(_0x04fa('0x0'));var _=require(_0x04fa('0x1'));var moment=require(_0x04fa('0x2'));function getSeconds(_0x20cd68,_0x23923a){var _0x30529e=moment(_0x20cd68)[_0x04fa('0x3')](0x0);var _0x8238c4=moment(_0x23923a)[_0x04fa('0x3')](0x0);return _0x30529e[_0x04fa('0x4')](_0x8238c4,_0x04fa('0x5'));}function AgentComplete(_0x8b5326,_0x3e2ae5){this[_0x04fa('0x6')]=0x4;this[_0x04fa('0x7')]='Answer';this[_0x04fa('0x8')]=_0x8b5326[_0x04fa('0x8')];this[_0x04fa('0x9')]=_0x8b5326['type'];this['campaigntype']=_0x8b5326[_0x04fa('0x9')]===_0x04fa('0xa')?_0x04fa('0xb'):_0x8b5326[_0x04fa('0x9')];this[_0x04fa('0xc')]=_0x8b5326[_0x04fa('0xc')];this[_0x04fa('0xd')]=_0x8b5326[_0x04fa('0xd')];this[_0x04fa('0xe')]=_0x8b5326[_0x04fa('0xe')];this[_0x04fa('0xf')]=_0x8b5326[_0x04fa('0xc')]+_0x8b5326[_0x04fa('0xd')]+_0x8b5326[_0x04fa('0xe')]+_0x8b5326[_0x04fa('0x10')]+_0x8b5326['countdropretry']+_0x8b5326[_0x04fa('0x11')]+_0x8b5326[_0x04fa('0x12')]+_0x8b5326['countagentrejectretry'];this[_0x04fa('0x10')]=_0x8b5326[_0x04fa('0x10')];this[_0x04fa('0x13')]=_0x8b5326[_0x04fa('0x13')];this['countabandonedretry']=_0x8b5326[_0x04fa('0x11')];this[_0x04fa('0x12')]=_0x8b5326[_0x04fa('0x12')];this[_0x04fa('0x14')]=_0x8b5326['countagentrejectretry'];this[_0x04fa('0x15')]=_0x3e2ae5[_0x04fa('0x15')];this[_0x04fa('0x16')]=_0x8b5326[_0x04fa('0x17')];this['calleridnum']=_0x8b5326[_0x04fa('0x18')];this[_0x04fa('0x19')]=_0x8b5326['starttime'];this[_0x04fa('0x1a')]=_0x8b5326[_0x04fa('0x1a')];this['answertime']=_0x8b5326[_0x04fa('0x1b')];this[_0x04fa('0x1c')]=moment()[_0x04fa('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x04fa('0x1e')]=getSeconds(_0x8b5326[_0x04fa('0x1a')],_0x8b5326['starttime']);this[_0x04fa('0x1f')]=getSeconds(_0x8b5326[_0x04fa('0x1b')],_0x8b5326['responsetime']);this['talktime']=getSeconds(this[_0x04fa('0x1c')],_0x8b5326['answertime']);this[_0x04fa('0xb')]=_0x3e2ae5['queue'];this[_0x04fa('0x20')]=_0x3e2ae5[_0x04fa('0x20')];this[_0x04fa('0x21')]=_0x3e2ae5[_0x04fa('0x21')];this[_0x04fa('0x22')]=_0x8b5326[_0x04fa('0x22')];this[_0x04fa('0x23')]=_0x8b5326[_0x04fa('0x23')];this[_0x04fa('0x24')]=_0x8b5326['callbackat'];this[_0x04fa('0x25')]=_0x8b5326[_0x04fa('0x25')];this['ContactId']=_0x8b5326[_0x04fa('0x26')];this[_0x04fa('0x27')]=_0x8b5326[_0x04fa('0x27')];this['UserId']=_0x8b5326[_0x04fa('0x28')];this[_0x04fa('0x29')]=_0x8b5326[_0x04fa('0x29')];this['CampaignId']=_0x8b5326[_0x04fa('0x2a')];this[_0x04fa('0x2b')]=_0x8b5326[_0x04fa('0x2b')]||'';this[_0x04fa('0x2c')]=_0x8b5326[_0x04fa('0x2c')]||'';}module[_0x04fa('0x2d')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index a274666..22e4711 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 _0xa3e6=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','starttime','responsetime'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x6a3a64,_0x21a8ee){_0x6a3a64=_0x6a3a64-0x0;var _0x20610e=_0xa3e6[_0x6a3a64];return _0x20610e;};'use strict';var util=require(_0x6a3e('0x0'));var _=require('lodash');var moment=require(_0x6a3e('0x1'));function getSeconds(_0x479726,_0x1dbcdb){var _0x111a5d=moment(_0x479726)[_0x6a3e('0x2')](0x0);var _0x56e3f4=moment(_0x1dbcdb)[_0x6a3e('0x2')](0x0);return _0x111a5d['diff'](_0x56e3f4,_0x6a3e('0x3'));}function Final(_0x23599b){this[_0x6a3e('0x4')]=_0x23599b[_0x6a3e('0x4')];this[_0x6a3e('0x5')]=_0x23599b['scheduledat'];this[_0x6a3e('0x6')]=_0x23599b[_0x6a3e('0x6')];this['campaigntype']=_0x23599b['type']===_0x6a3e('0x7')?'queue':_0x23599b['type'];this[_0x6a3e('0x8')]=_0x23599b['countbusyretry'];this[_0x6a3e('0x9')]=_0x23599b['countcongestionretry'];this[_0x6a3e('0xa')]=_0x23599b[_0x6a3e('0xa')];this[_0x6a3e('0xb')]=_0x23599b[_0x6a3e('0x8')]+_0x23599b[_0x6a3e('0x9')]+_0x23599b[_0x6a3e('0xa')]+_0x23599b['countnosuchnumberretry']+_0x23599b[_0x6a3e('0xc')]+_0x23599b[_0x6a3e('0xd')]+_0x23599b[_0x6a3e('0xe')]+_0x23599b[_0x6a3e('0xf')];this[_0x6a3e('0x10')]=_0x23599b[_0x6a3e('0x10')];this[_0x6a3e('0xc')]=_0x23599b['countdropretry'];this[_0x6a3e('0xd')]=_0x23599b[_0x6a3e('0xd')];this[_0x6a3e('0xe')]=_0x23599b[_0x6a3e('0xe')];this['countagentrejectretry']=_0x23599b[_0x6a3e('0xf')];this[_0x6a3e('0x11')]=_0x23599b['queue'];this['calleridname']=_0x23599b['calleridname'];this['calleridnum']=_0x23599b['calleridnum'];this[_0x6a3e('0x12')]=_0x23599b[_0x6a3e('0x12')];this[_0x6a3e('0x13')]=_0x23599b[_0x6a3e('0x13')];this[_0x6a3e('0x14')]=_0x23599b[_0x6a3e('0x13')];this[_0x6a3e('0x15')]=_0x23599b[_0x6a3e('0x15')]||0x0;this['holdtime']=_0x23599b[_0x6a3e('0x16')]||0x0;this['talktime']=_0x23599b[_0x6a3e('0x17')]||0x0;this['callback']=_0x23599b[_0x6a3e('0x18')];this[_0x6a3e('0x19')]=_0x23599b[_0x6a3e('0x19')];this[_0x6a3e('0x1a')]=_0x23599b['callbackat'];this['recallme']=_0x23599b[_0x6a3e('0x1b')];this[_0x6a3e('0x1c')]=_0x23599b[_0x6a3e('0x1c')];this[_0x6a3e('0x1d')]=_0x23599b[_0x6a3e('0x1d')];this[_0x6a3e('0x1e')]=_0x23599b[_0x6a3e('0x1e')];this[_0x6a3e('0x1f')]=_0x23599b[_0x6a3e('0x1f')];this[_0x6a3e('0x20')]=_0x23599b[_0x6a3e('0x20')];this[_0x6a3e('0x21')]=_0x23599b[_0x6a3e('0x21')]||'';this[_0x6a3e('0x22')]=_0x23599b[_0x6a3e('0x22')]||'';}module['exports']=Final; \ No newline at end of file +var _0xa3e6=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue','starttime','responsetime'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x58c2b1,_0x21c6dc){_0x58c2b1=_0x58c2b1-0x0;var _0x2b1cca=_0xa3e6[_0x58c2b1];return _0x2b1cca;};'use strict';var util=require(_0x6a3e('0x0'));var _=require('lodash');var moment=require(_0x6a3e('0x1'));function getSeconds(_0x479726,_0x1dbcdb){var _0x111a5d=moment(_0x479726)[_0x6a3e('0x2')](0x0);var _0x56e3f4=moment(_0x1dbcdb)[_0x6a3e('0x2')](0x0);return _0x111a5d['diff'](_0x56e3f4,_0x6a3e('0x3'));}function Final(_0x23599b){this[_0x6a3e('0x4')]=_0x23599b[_0x6a3e('0x4')];this[_0x6a3e('0x5')]=_0x23599b['scheduledat'];this[_0x6a3e('0x6')]=_0x23599b[_0x6a3e('0x6')];this['campaigntype']=_0x23599b['type']===_0x6a3e('0x7')?'queue':_0x23599b['type'];this[_0x6a3e('0x8')]=_0x23599b['countbusyretry'];this[_0x6a3e('0x9')]=_0x23599b['countcongestionretry'];this[_0x6a3e('0xa')]=_0x23599b[_0x6a3e('0xa')];this[_0x6a3e('0xb')]=_0x23599b[_0x6a3e('0x8')]+_0x23599b[_0x6a3e('0x9')]+_0x23599b[_0x6a3e('0xa')]+_0x23599b['countnosuchnumberretry']+_0x23599b[_0x6a3e('0xc')]+_0x23599b[_0x6a3e('0xd')]+_0x23599b[_0x6a3e('0xe')]+_0x23599b[_0x6a3e('0xf')];this[_0x6a3e('0x10')]=_0x23599b[_0x6a3e('0x10')];this[_0x6a3e('0xc')]=_0x23599b['countdropretry'];this[_0x6a3e('0xd')]=_0x23599b[_0x6a3e('0xd')];this[_0x6a3e('0xe')]=_0x23599b[_0x6a3e('0xe')];this['countagentrejectretry']=_0x23599b[_0x6a3e('0xf')];this[_0x6a3e('0x11')]=_0x23599b['queue'];this['calleridname']=_0x23599b['calleridname'];this['calleridnum']=_0x23599b['calleridnum'];this[_0x6a3e('0x12')]=_0x23599b[_0x6a3e('0x12')];this[_0x6a3e('0x13')]=_0x23599b[_0x6a3e('0x13')];this[_0x6a3e('0x14')]=_0x23599b[_0x6a3e('0x13')];this[_0x6a3e('0x15')]=_0x23599b[_0x6a3e('0x15')]||0x0;this['holdtime']=_0x23599b[_0x6a3e('0x16')]||0x0;this['talktime']=_0x23599b[_0x6a3e('0x17')]||0x0;this['callback']=_0x23599b[_0x6a3e('0x18')];this[_0x6a3e('0x19')]=_0x23599b[_0x6a3e('0x19')];this[_0x6a3e('0x1a')]=_0x23599b['callbackat'];this['recallme']=_0x23599b[_0x6a3e('0x1b')];this[_0x6a3e('0x1c')]=_0x23599b[_0x6a3e('0x1c')];this[_0x6a3e('0x1d')]=_0x23599b[_0x6a3e('0x1d')];this[_0x6a3e('0x1e')]=_0x23599b[_0x6a3e('0x1e')];this[_0x6a3e('0x1f')]=_0x23599b[_0x6a3e('0x1f')];this[_0x6a3e('0x20')]=_0x23599b[_0x6a3e('0x20')];this[_0x6a3e('0x21')]=_0x23599b[_0x6a3e('0x21')]||'';this[_0x6a3e('0x22')]=_0x23599b[_0x6a3e('0x22')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 120e4cf..e885228 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 _0x73f9=['countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x73f9,0x163));var _0x973f=function(_0x42b287,_0x23f09d){_0x42b287=_0x42b287-0x0;var _0x3a03d7=_0x73f9[_0x42b287];return _0x3a03d7;};'use strict';var util=require(_0x973f('0x0'));var _=require(_0x973f('0x1'));var moment=require('moment');function getSeconds(_0x1ea172,_0x24b983){var _0x4cc00b=moment(_0x1ea172)[_0x973f('0x2')](0x0);var _0x73ada0=moment(_0x24b983)[_0x973f('0x2')](0x0);return _0x4cc00b[_0x973f('0x3')](_0x73ada0,_0x973f('0x4'));}function Hangup(_0x17f802,_0x48357e){this[_0x973f('0x5')]=0x4;this['statedesc']=_0x973f('0x6');this['scheduledat']=_0x17f802[_0x973f('0x7')];this[_0x973f('0x8')]=_0x17f802['type'];this[_0x973f('0x9')]=_0x17f802[_0x973f('0x8')]===_0x973f('0xa')?_0x973f('0xb'):_0x17f802[_0x973f('0x8')];this['countbusyretry']=_0x17f802['countbusyretry'];this['countcongestionretry']=_0x17f802[_0x973f('0xc')];this[_0x973f('0xd')]=_0x17f802[_0x973f('0xd')];this[_0x973f('0xe')]=_0x17f802[_0x973f('0xf')]+_0x17f802[_0x973f('0xc')]+_0x17f802[_0x973f('0xd')]+_0x17f802[_0x973f('0x10')]+_0x17f802[_0x973f('0x11')]+_0x17f802[_0x973f('0x12')]+_0x17f802['countmachineretry']+_0x17f802[_0x973f('0x13')];this[_0x973f('0x10')]=_0x17f802[_0x973f('0x10')];this[_0x973f('0x11')]=_0x17f802[_0x973f('0x11')];this[_0x973f('0x12')]=_0x17f802[_0x973f('0x12')];this['countmachineretry']=_0x17f802[_0x973f('0x14')];this['countagentrejectretry']=_0x17f802[_0x973f('0x13')];this[_0x973f('0x15')]=_0x48357e[_0x973f('0x15')];this[_0x973f('0x16')]=_0x17f802['name'];this[_0x973f('0x17')]=_0x17f802[_0x973f('0x18')];this[_0x973f('0x19')]=_0x17f802[_0x973f('0x19')];this[_0x973f('0x1a')]=_0x17f802[_0x973f('0x1a')];this[_0x973f('0x1b')]=moment()[_0x973f('0x1c')](_0x973f('0x1d'));this[_0x973f('0x1e')]=getSeconds(_0x17f802[_0x973f('0x1a')],_0x17f802['starttime']);this[_0x973f('0x1f')]=0x0;this[_0x973f('0x20')]=getSeconds(this[_0x973f('0x1b')],_0x17f802[_0x973f('0x1a')]);this['queue']=_0x17f802[_0x973f('0xb')];this[_0x973f('0x21')]=_0x973f('0x22');this[_0x973f('0x23')]=_0x48357e[_0x973f('0x24')];this[_0x973f('0x25')]=_0x17f802[_0x973f('0x25')];this[_0x973f('0x26')]=_0x17f802[_0x973f('0x26')];this[_0x973f('0x27')]=_0x17f802[_0x973f('0x27')];this['recallme']=_0x17f802['recallme'];this[_0x973f('0x28')]=_0x17f802['ContactId'];this[_0x973f('0x29')]=_0x17f802[_0x973f('0x29')];this[_0x973f('0x2a')]=_0x17f802['UserId'];this[_0x973f('0x2b')]=_0x17f802[_0x973f('0x2b')];this['CampaignId']=_0x17f802[_0x973f('0x2c')];}module[_0x973f('0x2d')]=Hangup; \ No newline at end of file +var _0xce55=['countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0xd13a88,_0x3c5269){var _0x1c993c=function(_0x245af5){while(--_0x245af5){_0xd13a88['push'](_0xd13a88['shift']());}};_0x1c993c(++_0x3c5269);}(_0xce55,0x12b));var _0x5ce5=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0xce55[_0xfb0281];return _0x408dd3;};'use strict';var util=require(_0x5ce5('0x0'));var _=require('lodash');var moment=require(_0x5ce5('0x1'));function getSeconds(_0x443602,_0x25bd11){var _0x32b56d=moment(_0x443602)[_0x5ce5('0x2')](0x0);var _0x12d759=moment(_0x25bd11)[_0x5ce5('0x2')](0x0);return _0x32b56d['diff'](_0x12d759,_0x5ce5('0x3'));}function Hangup(_0x29d3d7,_0x3bc58c){this[_0x5ce5('0x4')]=0x4;this[_0x5ce5('0x5')]=_0x5ce5('0x6');this['scheduledat']=_0x29d3d7[_0x5ce5('0x7')];this[_0x5ce5('0x8')]=_0x29d3d7[_0x5ce5('0x8')];this[_0x5ce5('0x9')]=_0x29d3d7[_0x5ce5('0x8')]===_0x5ce5('0xa')?_0x5ce5('0xb'):_0x29d3d7[_0x5ce5('0x8')];this[_0x5ce5('0xc')]=_0x29d3d7[_0x5ce5('0xc')];this[_0x5ce5('0xd')]=_0x29d3d7[_0x5ce5('0xd')];this['countnoanswerretry']=_0x29d3d7[_0x5ce5('0xe')];this[_0x5ce5('0xf')]=_0x29d3d7[_0x5ce5('0xc')]+_0x29d3d7[_0x5ce5('0xd')]+_0x29d3d7[_0x5ce5('0xe')]+_0x29d3d7[_0x5ce5('0x10')]+_0x29d3d7['countdropretry']+_0x29d3d7[_0x5ce5('0x11')]+_0x29d3d7[_0x5ce5('0x12')]+_0x29d3d7['countagentrejectretry'];this[_0x5ce5('0x10')]=_0x29d3d7[_0x5ce5('0x10')];this[_0x5ce5('0x13')]=_0x29d3d7[_0x5ce5('0x13')];this['countabandonedretry']=_0x29d3d7[_0x5ce5('0x11')];this['countmachineretry']=_0x29d3d7[_0x5ce5('0x12')];this[_0x5ce5('0x14')]=_0x29d3d7[_0x5ce5('0x14')];this[_0x5ce5('0x15')]=_0x3bc58c['uniqueid'];this['calleridname']=_0x29d3d7[_0x5ce5('0x16')];this[_0x5ce5('0x17')]=_0x29d3d7['number'];this[_0x5ce5('0x18')]=_0x29d3d7[_0x5ce5('0x18')];this[_0x5ce5('0x19')]=_0x29d3d7[_0x5ce5('0x19')];this[_0x5ce5('0x1a')]=moment()[_0x5ce5('0x1b')](_0x5ce5('0x1c'));this[_0x5ce5('0x1d')]=getSeconds(_0x29d3d7[_0x5ce5('0x19')],_0x29d3d7[_0x5ce5('0x18')]);this[_0x5ce5('0x1e')]=0x0;this[_0x5ce5('0x1f')]=getSeconds(this[_0x5ce5('0x1a')],_0x29d3d7[_0x5ce5('0x19')]);this['queue']=_0x29d3d7['queue'];this[_0x5ce5('0x20')]='IVR';this[_0x5ce5('0x21')]=_0x3bc58c[_0x5ce5('0x22')];this[_0x5ce5('0x23')]=_0x29d3d7[_0x5ce5('0x23')];this['callbackuniqueid']=_0x29d3d7[_0x5ce5('0x24')];this[_0x5ce5('0x25')]=_0x29d3d7[_0x5ce5('0x25')];this[_0x5ce5('0x26')]=_0x29d3d7['recallme'];this[_0x5ce5('0x27')]=_0x29d3d7['ContactId'];this['ListId']=_0x29d3d7[_0x5ce5('0x28')];this[_0x5ce5('0x29')]=_0x29d3d7['UserId'];this[_0x5ce5('0x2a')]=_0x29d3d7['VoiceQueueId'];this[_0x5ce5('0x2b')]=_0x29d3d7['CampaignId'];}module[_0x5ce5('0x2c')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 9086e69..0f6d029 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 _0xd026=['countagentrejectretry','countmachineretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xd026,0x17f));var _0x6d02=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xd026[_0x2b10c6];return _0x3789d2;};'use strict';var util=require(_0x6d02('0x0'));var _=require(_0x6d02('0x1'));var moment=require('moment');function getSeconds(_0x5c139a,_0xf3e257){var _0x1d4e36=moment(_0x5c139a)[_0x6d02('0x2')](0x0);var _0x6ed189=moment(_0xf3e257)['milliseconds'](0x0);return _0x1d4e36[_0x6d02('0x3')](_0x6ed189,_0x6d02('0x4'));}function History(_0xf8f56){this[_0x6d02('0x5')]=_0xf8f56[_0x6d02('0x5')];this[_0x6d02('0x6')]=_0xf8f56[_0x6d02('0x6')]||undefined;this[_0x6d02('0x7')]=_0xf8f56['type'];this[_0x6d02('0x8')]=_0xf8f56['type']==='outbound'?_0x6d02('0x9'):_0xf8f56[_0x6d02('0x7')];this[_0x6d02('0xa')]=_0xf8f56[_0x6d02('0xa')];this[_0x6d02('0xb')]=_0xf8f56[_0x6d02('0xb')];this[_0x6d02('0xc')]=_0xf8f56[_0x6d02('0xc')];this[_0x6d02('0xd')]=_0xf8f56[_0x6d02('0xa')]+_0xf8f56[_0x6d02('0xb')]+_0xf8f56[_0x6d02('0xc')]+_0xf8f56[_0x6d02('0xe')]+_0xf8f56[_0x6d02('0xf')]+_0xf8f56[_0x6d02('0x10')]+_0xf8f56['countmachineretry']+_0xf8f56[_0x6d02('0x11')];this[_0x6d02('0xe')]=_0xf8f56[_0x6d02('0xe')];this[_0x6d02('0xf')]=_0xf8f56['countdropretry'];this['countabandonedretry']=_0xf8f56[_0x6d02('0x10')];this[_0x6d02('0x12')]=_0xf8f56[_0x6d02('0x12')];this[_0x6d02('0x11')]=_0xf8f56['countagentrejectretry'];this[_0x6d02('0x9')]=_0xf8f56[_0x6d02('0x9')];this[_0x6d02('0x13')]=_0xf8f56[_0x6d02('0x14')];this[_0x6d02('0x15')]=_0xf8f56['number'];this[_0x6d02('0x16')]=_0xf8f56[_0x6d02('0x16')];this[_0x6d02('0x17')]=_0xf8f56[_0x6d02('0x17')];this[_0x6d02('0x18')]=_0xf8f56[_0x6d02('0x17')];this[_0x6d02('0x19')]=getSeconds(_0xf8f56[_0x6d02('0x17')],_0xf8f56[_0x6d02('0x16')]);this[_0x6d02('0x1a')]=0x0;this[_0x6d02('0x1b')]=0x0;this[_0x6d02('0x1c')]=_0xf8f56[_0x6d02('0x1c')];this[_0x6d02('0x1d')]=_0xf8f56['callbackuniqueid'];this[_0x6d02('0x1e')]=_0xf8f56[_0x6d02('0x1e')];this[_0x6d02('0x1f')]=_0xf8f56[_0x6d02('0x1f')];this['ContactId']=_0xf8f56[_0x6d02('0x20')];this[_0x6d02('0x21')]=_0xf8f56[_0x6d02('0x21')];this[_0x6d02('0x22')]=_0xf8f56[_0x6d02('0x22')];this[_0x6d02('0x23')]=_0xf8f56[_0x6d02('0x23')];this[_0x6d02('0x24')]=_0xf8f56[_0x6d02('0x24')];this[_0x6d02('0x25')]=_0xf8f56[_0x6d02('0x25')]||'';this[_0x6d02('0x26')]=_0xf8f56[_0x6d02('0x26')]||'';}module[_0x6d02('0x27')]=History; \ No newline at end of file +var _0x8450=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8450,0xf4));var _0x0845=function(_0x39f578,_0xe9c95c){_0x39f578=_0x39f578-0x0;var _0x179fac=_0x8450[_0x39f578];return _0x179fac;};'use strict';var util=require(_0x0845('0x0'));var _=require('lodash');var moment=require(_0x0845('0x1'));function getSeconds(_0x4eb1a7,_0x48ff7a){var _0x5a541a=moment(_0x4eb1a7)[_0x0845('0x2')](0x0);var _0x1232b1=moment(_0x48ff7a)[_0x0845('0x2')](0x0);return _0x5a541a[_0x0845('0x3')](_0x1232b1,_0x0845('0x4'));}function History(_0x325d47){this[_0x0845('0x5')]=_0x325d47[_0x0845('0x5')];this[_0x0845('0x6')]=_0x325d47[_0x0845('0x6')]||undefined;this[_0x0845('0x7')]=_0x325d47[_0x0845('0x7')];this[_0x0845('0x8')]=_0x325d47['type']===_0x0845('0x9')?_0x0845('0xa'):_0x325d47[_0x0845('0x7')];this[_0x0845('0xb')]=_0x325d47[_0x0845('0xb')];this[_0x0845('0xc')]=_0x325d47[_0x0845('0xc')];this[_0x0845('0xd')]=_0x325d47[_0x0845('0xd')];this[_0x0845('0xe')]=_0x325d47[_0x0845('0xb')]+_0x325d47[_0x0845('0xc')]+_0x325d47[_0x0845('0xd')]+_0x325d47[_0x0845('0xf')]+_0x325d47['countdropretry']+_0x325d47['countabandonedretry']+_0x325d47[_0x0845('0x10')]+_0x325d47[_0x0845('0x11')];this['countnosuchnumberretry']=_0x325d47[_0x0845('0xf')];this[_0x0845('0x12')]=_0x325d47[_0x0845('0x12')];this['countabandonedretry']=_0x325d47['countabandonedretry'];this[_0x0845('0x10')]=_0x325d47['countmachineretry'];this[_0x0845('0x11')]=_0x325d47[_0x0845('0x11')];this[_0x0845('0xa')]=_0x325d47['queue'];this[_0x0845('0x13')]=_0x325d47[_0x0845('0x14')];this[_0x0845('0x15')]=_0x325d47[_0x0845('0x16')];this['starttime']=_0x325d47[_0x0845('0x17')];this[_0x0845('0x18')]=_0x325d47[_0x0845('0x18')];this[_0x0845('0x19')]=_0x325d47[_0x0845('0x18')];this[_0x0845('0x1a')]=getSeconds(_0x325d47[_0x0845('0x18')],_0x325d47[_0x0845('0x17')]);this['holdtime']=0x0;this[_0x0845('0x1b')]=0x0;this['callback']=_0x325d47[_0x0845('0x1c')];this['callbackuniqueid']=_0x325d47[_0x0845('0x1d')];this['callbackat']=_0x325d47[_0x0845('0x1e')];this[_0x0845('0x1f')]=_0x325d47[_0x0845('0x1f')];this[_0x0845('0x20')]=_0x325d47['ContactId'];this[_0x0845('0x21')]=_0x325d47[_0x0845('0x21')];this['UserId']=_0x325d47[_0x0845('0x22')];this[_0x0845('0x23')]=_0x325d47[_0x0845('0x23')];this[_0x0845('0x24')]=_0x325d47['CampaignId'];this[_0x0845('0x25')]=_0x325d47['originatecalleridnum']||'';this[_0x0845('0x26')]=_0x325d47['originatecalleridname']||'';}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 39d58e4..b1c614f 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 _0xcf21=['agiafterat','dialDropRetryFrequency','[rescheduleContact][Drop]','Drop','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','locked','paused','stateinterface','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','all','some','[ifTime][promiseAll]','Global:\x20','checkDialMethod','dialMethod','progressive','handlePower','power','booked','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','dialPreviewRecallmeReminder','pow','match','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialer','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','callProgressDetecting','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','busyFactor','check\x20failure','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','getContactDialer','[getContactDialer2]','tryOriginatePredictive','[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]','Error','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','../preview/util/util','../../../config/logger','predictive','syncQueueSummary','../ami','defaults','redis','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./agentComplete','env','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','isEmpty','INTERVAL_IS_NULL','[ifTime][Action]','milliseconds','diff','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','format','voice:queue:%s','type','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','isUndefined','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','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22\x22\x20<>','inspect','error','stack','length','undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','loopClearZombieChannels','clearZombieChannels','uniqueId','[uniqueid]','[actions]','sequence','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','averageHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','saveInDb','syncVarSet','uniqueid','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD]','value','MACHINE','Machine','membername','AMD','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countglobal','add','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','TIMEOUT'];(function(_0x2ebada,_0x7efb9e){var _0x5af67f=function(_0x5f4dd6){while(--_0x5f4dd6){_0x2ebada['push'](_0x2ebada['shift']());}};_0x5af67f(++_0x7efb9e);}(_0xcf21,0x108));var _0x1cf2=function(_0x531f8c,_0x5de470){_0x531f8c=_0x531f8c-0x0;var _0x499eed=_0xcf21[_0x531f8c];return _0x499eed;};'use strict';var util=require(_0x1cf2('0x0'));var _=require(_0x1cf2('0x1'));var BPromise=require(_0x1cf2('0x2'));var uuid=require(_0x1cf2('0x3'));var moment=require(_0x1cf2('0x4'));var rr=require('rr');var md5=require(_0x1cf2('0x5'));var Redis=require('ioredis');var ut=require(_0x1cf2('0x6'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x1cf2('0x7'))('booked');var loggerPredictive=require(_0x1cf2('0x7'))(_0x1cf2('0x8'));var loggerPredictiveCalls=require(_0x1cf2('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x1cf2('0x7'))(_0x1cf2('0x9'));var ami=require(_0x1cf2('0xa'));config['redis']=_[_0x1cf2('0xb')](config[_0x1cf2('0xc')],{'host':_0x1cf2('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x1cf2('0xe'));var cmHopperHistory=require(_0x1cf2('0xf'));var cmHopperBlack=require(_0x1cf2('0x10'));var voiceQueueRt=require(_0x1cf2('0x11'));var RpcSetting=require(_0x1cf2('0x12'));var Action=require(_0x1cf2('0x13'));var History=require(_0x1cf2('0x14'));var Final=require('./final');var AgentComplete=require(_0x1cf2('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x1cf2('0x16')]['XCALLY_IP_AGI']||_0x1cf2('0x17');var strategy={'rrmemory':_0x1cf2('0x18'),'roundrobin':_0x1cf2('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x1cf2('0x1a')][_0x1cf2('0x1b')]=function(_0x456a22){this[_0x1cf2('0x1c')]=this[_0x1cf2('0x1c')]?this['tail'][_0x1cf2('0x1d')](_0x456a22):_0x456a22();};function Dialer(_0x16fef2,_0x377d06){this['sequence']=new Sequence();this[_0x1cf2('0x1e')]=_0x377d06;this[_0x1cf2('0x1f')]=_0x16fef2['voiceQueues'];this[_0x1cf2('0x20')]=_0x16fef2[_0x1cf2('0x20')];this[_0x1cf2('0x21')]=_0x16fef2[_0x1cf2('0x21')];this['trunks']=_0x16fef2[_0x1cf2('0x22')];this[_0x1cf2('0x23')]=config[_0x1cf2('0x23')]||0x2;this[_0x1cf2('0x24')]={};this['actions']={};this[_0x1cf2('0x25')]={};this['uniqueId']={};this[_0x1cf2('0x26')]={};this[_0x1cf2('0x27')]={};this[_0x1cf2('0x28')]={};this[_0x1cf2('0x29')]={};this['queueBooked']={};this[_0x1cf2('0x2a')]={};ami['on']('agentconnect',this[_0x1cf2('0x2b')][_0x1cf2('0x2c')](this));ami['on'](_0x1cf2('0x2d'),this[_0x1cf2('0x2e')]['bind'](this));ami['on'](_0x1cf2('0x2f'),this[_0x1cf2('0x30')][_0x1cf2('0x2c')](this));ami['on'](_0x1cf2('0x31'),this[_0x1cf2('0x32')][_0x1cf2('0x2c')](this));ami['on']('custom:queuesummary',this[_0x1cf2('0x9')][_0x1cf2('0x2c')](this));ami['on'](_0x1cf2('0x33'),this[_0x1cf2('0x34')][_0x1cf2('0x2c')](this));ami['on'](_0x1cf2('0x35'),this[_0x1cf2('0x36')][_0x1cf2('0x2c')](this));ami['on'](_0x1cf2('0x37'),this['syncVarSet'][_0x1cf2('0x2c')](this));ami['on'](_0x1cf2('0x38'),this[_0x1cf2('0x39')][_0x1cf2('0x2c')](this));ami['on']('queuestatuscomplete',this[_0x1cf2('0x3a')][_0x1cf2('0x2c')](this));this[_0x1cf2('0x3b')]();this['loopClearZombieChannels']();RpcSetting[_0x1cf2('0x3c')]()[_0x1cf2('0x3d')](function(_0x4e03b7){previewRecallmeReminderInterval=_0x4e03b7[_0x1cf2('0x3e')];});}function isNotNull(_0x30ac08){return _0x30ac08!==null&&!_['isUndefined'](_0x30ac08);}function checkIsLoggedIn(_0x14ee65,_0x3003d8){return function(){if(_0x3003d8<=0x0){_0x14ee65[_0x1cf2('0x3f')]=_0x1cf2('0x40');throw _0x14ee65[_0x1cf2('0x41')]+_0x1cf2('0x42');}};}function isActive(_0x4125df){return _0x4125df;}function checkIsActive(_0x17cff3,_0xc586ce){return function(){if(!isActive(_0xc586ce)){_0x17cff3['message']=_0x1cf2('0x43');throw _0x17cff3[_0x1cf2('0x41')]+_0x1cf2('0x44');}};}function checkInterval(_0x4af123){return function(){if(!isNotNull(_0x4af123[_0x1cf2('0x45')])){_0x4af123[_0x1cf2('0x3f')]='INTERVAL_IS_NULL';throw _0x4af123[_0x1cf2('0x41')]+_0x1cf2('0x46');}if(!isNotNull(_0x4af123['Interval'][_0x1cf2('0x47')])){_0x4af123[_0x1cf2('0x3f')]='INTERVAL_IS_NULL';throw _0x4af123[_0x1cf2('0x41')]+_0x1cf2('0x46');}if(!isNotNull(_[_0x1cf2('0x48')](_0x4af123[_0x1cf2('0x45')][_0x1cf2('0x47')]))){_0x4af123[_0x1cf2('0x3f')]=_0x1cf2('0x49');throw _0x4af123[_0x1cf2('0x41')]+_0x1cf2('0x46');}};}function msgResponse(_0x55b60a,_0x1f13f2,_0xe2374a){return{'action':_0x55b60a,'response':_0x1f13f2,'message':_0xe2374a,'stack':_0xe2374a};}function myreject(_0x583298){return function(_0x146ab9){return _0x583298(msgResponse(_0x1cf2('0x4a'),'Error',JSON['stringify'](_0x146ab9)));};}function getSeconds(_0x32eb00,_0x5d2276){var _0x57bb4f=moment(_0x32eb00)[_0x1cf2('0x4b')](0x0);var _0x15ce91=moment(_0x5d2276)[_0x1cf2('0x4b')](0x0);return _0x57bb4f[_0x1cf2('0x4c')](_0x15ce91,'seconds');}function emit(_0x26d761,_0x20ae79,_0x395467){io['to'](_0x26d761)['emit'](_0x20ae79,_0x395467);}function emitVoiceQueueSummary(_0x8d1071){if(_0x8d1071['type']===_0x1cf2('0x4d')){var _0x484b14={'id':_0x8d1071['id'],'name':_0x8d1071[_0x1cf2('0x41')],'strategy':_0x8d1071[_0x1cf2('0x4e')],'answered':_0x8d1071[_0x1cf2('0x4f')],'available':_0x8d1071[_0x1cf2('0x50')],'loggedIn':_0x8d1071[_0x1cf2('0x51')],'pTalking':_0x8d1071[_0x1cf2('0x52')],'sumBillable':_0x8d1071['sumBillable'],'sumDuration':_0x8d1071[_0x1cf2('0x53')],'sumHoldTime':_0x8d1071['sumHoldTime']||0x0,'talking':_0x8d1071[_0x1cf2('0x54')],'total':_0x8d1071[_0x1cf2('0x55')],'type':_0x8d1071['type'],'unmanaged':_0x8d1071['unmanaged'],'abandoned':_0x8d1071['abandoned'],'waiting':_0x8d1071[_0x1cf2('0x56')],'loggedInDb':_0x8d1071[_0x1cf2('0x57')],'dialActive':_0x8d1071[_0x1cf2('0x58')],'dialMethod':_0x8d1071['dialMethod'],'dialOriginateCallerIdName':_0x8d1071[_0x1cf2('0x59')],'dialOriginateCallerIdNumber':_0x8d1071['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x8d1071[_0x1cf2('0x5a')],'dialPrefix':_0x8d1071['dialPrefix'],'outboundAnswerAgiCallsDay':_0x8d1071[_0x1cf2('0x5b')],'outboundAnswerCallsDay':_0x8d1071[_0x1cf2('0x5c')],'outboundBlacklistCallsDay':_0x8d1071[_0x1cf2('0x5d')],'outboundBusyCallsDay':_0x8d1071[_0x1cf2('0x5e')],'outboundCongestionCallsDay':_0x8d1071[_0x1cf2('0x5f')],'outboundDropCallsDayACS':_0x8d1071[_0x1cf2('0x60')],'outboundDropCallsDayCallersExit':_0x8d1071[_0x1cf2('0x61')],'outboundDropCallsDayTimeout':_0x8d1071[_0x1cf2('0x62')],'outboundNoAnswerCallsDay':_0x8d1071[_0x1cf2('0x63')],'outboundNoSuchCallsDay':_0x8d1071['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x8d1071[_0x1cf2('0x64')],'outboundReCallsDay':_0x8d1071[_0x1cf2('0x65')],'outboundRejectCallsDay':_0x8d1071[_0x1cf2('0x66')],'outboundUnknownCallsDay':_0x8d1071[_0x1cf2('0x67')],'predictiveIntervalAnsweredCalls':_0x8d1071[_0x1cf2('0x68')],'predictiveIntervalAvgHoldtime':_0x8d1071[_0x1cf2('0x69')],'predictiveIntervalAvgTalktime':_0x8d1071[_0x1cf2('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x8d1071[_0x1cf2('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0x8d1071[_0x1cf2('0x6c')],'predictiveIntervalErlangCalls':_0x8d1071[_0x1cf2('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0x8d1071['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x8d1071[_0x1cf2('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x8d1071['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x8d1071['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x8d1071[_0x1cf2('0x6f')],'predictiveIntervalTotalCalls':_0x8d1071[_0x1cf2('0x70')],'message':_0x8d1071[_0x1cf2('0x3f')],'originated':_0x8d1071[_0x1cf2('0x71')],'erlangCalls':_0x8d1071['erlangCalls'],'erlangCallToSecond':_0x8d1071[_0x1cf2('0x72')],'erlangAbandonmentRate':_0x8d1071[_0x1cf2('0x73')],'erlangBusyFactor':_0x8d1071['erlangBusyFactor'],'startPredictive':_0x8d1071[_0x1cf2('0x27')],'startProgressive':_0x8d1071[_0x1cf2('0x28')]};if(_0x8d1071['Trunk']){_0x484b14[_0x1cf2('0x74')]={'id':_0x8d1071[_0x1cf2('0x74')]['id'],'name':_0x8d1071[_0x1cf2('0x74')]['name'],'active':_0x8d1071[_0x1cf2('0x74')][_0x1cf2('0x75')],'callerid':_0x8d1071['Trunk'][_0x1cf2('0x76')]};}if(_0x8d1071[_0x1cf2('0x45')]){_0x484b14[_0x1cf2('0x45')]={'id':_0x8d1071[_0x1cf2('0x45')]['id'],'name':_0x8d1071[_0x1cf2('0x45')][_0x1cf2('0x41')]};}var _0x2df259=md5(JSON['stringify'](_0x484b14));if(_0x8d1071[_0x1cf2('0x5')]!==_0x2df259){_0x8d1071[_0x1cf2('0x5')]=_0x2df259;emit(util[_0x1cf2('0x77')](_0x1cf2('0x78'),_0x484b14['name']),'voice_queue:save',_0x484b14);}}}function emitCampaignSummary(_0x34f147){if(_0x34f147[_0x1cf2('0x79')]===_0x1cf2('0x7a')){emit(util[_0x1cf2('0x77')](_0x1cf2('0x7b'),_0x34f147['name']),'campaign:save',_0x34f147);}}function checkGetDataPredictive(_0x470be4){if(isNotNull(_0x470be4)&&!_[_0x1cf2('0x48')](_0x470be4)){loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x7d'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x470be4['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x470be4[_0x1cf2('0x68')]);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x7e'),_0x470be4[_0x1cf2('0x6c')]);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x7f'),_0x470be4[_0x1cf2('0x6b')]);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x80'),_0x470be4[_0x1cf2('0x69')]);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x81'),_0x470be4['predictiveIntervalAvgTalktime']);loggerPredictive[_0x1cf2('0x7c')]('---------------------------');if(_0x470be4[_0x1cf2('0x70')]>0x0){if(!_[_0x1cf2('0x82')](_0x470be4['predictiveIntervalAvgTalktime'])&&_0x470be4[_0x1cf2('0x6a')]>0x0){return!![];}loggerPredictive['info'](_0x1cf2('0x83'));if(!_[_0x1cf2('0x82')](_0x470be4[_0x1cf2('0x69')])&&_0x470be4[_0x1cf2('0x69')]>0x0){return!![];}loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x84'));}else{loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x85'));}}else{loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x86'));}return![];}function mergeDataErlangB(_0x1923cd){return function(_0x464472){loggerPredictive[_0x1cf2('0x7c')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x87'),_0x464472[_0x1cf2('0x88')]);loggerPredictive[_0x1cf2('0x7c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x464472[_0x1cf2('0x72')]);loggerPredictive['info'](_0x1cf2('0x89'),_0x464472[_0x1cf2('0x73')]);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x8a'),_0x464472[_0x1cf2('0x8b')]);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x89'),_0x464472[_0x1cf2('0x73')]);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x8c'));_[_0x1cf2('0x8d')](_0x1923cd,_0x464472);};}function getDiff(_0x5e9b12){var _0x19459e=moment()[_0x1cf2('0x4b')](0x0);var _0x1210ed=moment(_0x5e9b12)[_0x1cf2('0x4b')](0x0);return _0x19459e[_0x1cf2('0x4c')](_0x1210ed,_0x1cf2('0x8e'));}function ifInterval(_0x26c373,_0x1788be){if(_['isUndefined'](_0x1788be)){return![];}return getDiff(_0x1788be)<_0x26c373*0x3c;}function freeVariablesPredictive(_0x5ca4fa){if(isNotNull(_0x5ca4fa)){if(!_[_0x1cf2('0x82')](_0x5ca4fa[_0x1cf2('0x28')])){_0x5ca4fa[_0x1cf2('0x28')]=undefined;loggerPredictive[_0x1cf2('0x7c')](_0x5ca4fa[_0x1cf2('0x41')],_0x1cf2('0x8f'));}if(!_[_0x1cf2('0x82')](_0x5ca4fa[_0x1cf2('0x27')])){_0x5ca4fa[_0x1cf2('0x27')]=undefined;loggerPredictive[_0x1cf2('0x7c')](_0x5ca4fa[_0x1cf2('0x41')],_0x1cf2('0x90'));}if(!_['isUndefined'](_0x5ca4fa[_0x1cf2('0x91')])){clearInterval(_0x5ca4fa['handlePredictive']);_0x5ca4fa[_0x1cf2('0x91')]=undefined;loggerPredictive['info'](_0x5ca4fa[_0x1cf2('0x41')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x113fc0,_0x5d699c){if(_0x5d699c===0x0){return 0x0;}var _0x377c85=0x1;for(var _0x249a2c=0x1;_0x249a2c<=_0x5d699c;_0x249a2c+=0x1){_0x377c85=0x1+_0x377c85*_0x249a2c/_0x113fc0;}return 0x1/_0x377c85;}function isVoiceQueueOutbound(_0x5afc09){return _0x5afc09===_0x1cf2('0x4d');}function isNotPreview(_0x2c8138){return _0x2c8138!=='preview';}function isCampaignIvr(_0x2b0bee){return _0x2b0bee===_0x1cf2('0x7a');}function getCallerId(_0x25027d,_0x551738,_0x3d1376){if(!_[_0x1cf2('0x82')](_0x3d1376)&&typeof _0x3d1376===_0x1cf2('0x92')&&!_['isEmpty'](_0x3d1376)){if(!_[_0x1cf2('0x82')](_0x551738)&&typeof _0x551738===_0x1cf2('0x92')&&!_[_0x1cf2('0x48')](_0x551738)){return util[_0x1cf2('0x77')]('\x22%s\x22\x20<%s>',_0x551738,_0x3d1376);}return util['format']('\x22%s\x22\x20<%s>',_0x3d1376,_0x3d1376);}if(!_['isUndefined'](_0x25027d)&&typeof _0x25027d==='string'&&!_[_0x1cf2('0x48')](_0x25027d)){return _0x25027d;}return _0x1cf2('0x93');}function loggerCatchQueueSummary(_0x39aeb1,_0x2554b1){return function(_0x2a6cfc){freeVariablesPredictive(_0x2554b1);emitVoiceQueueSummary(_0x2554b1);emitCampaignSummary(_0x2554b1);loggerSyncQueueSummary['error'](_0x39aeb1,util[_0x1cf2('0x94')](_0x2a6cfc,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x119dca,_0x22e49b){return function(_0x54a746){loggerPredictive['error'](_0x22e49b[_0x1cf2('0x41')],_0x119dca);loggerPredictive[_0x1cf2('0x95')](_0x54a746[_0x1cf2('0x96')]);freeVariablesPredictive(_0x22e49b);};}function loggerCatch(_0x1fe393){return function(_0x429059){logger[_0x1cf2('0x95')](_0x1fe393,util[_0x1cf2('0x94')](_0x429059,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x42bac7){return _0x42bac7&&!_[_0x1cf2('0x82')](_0x42bac7)&&_0x42bac7[_0x1cf2('0x97')]>0x0;}function decremetOriginate(_0x447379){if(!_[_0x1cf2('0x82')](_0x447379)&&_0x447379!==null){if(typeof _0x447379['originated']!==_0x1cf2('0x98')){if(_0x447379[_0x1cf2('0x71')]>0x0){_0x447379[_0x1cf2('0x71')]-=0x1;}else{logger[_0x1cf2('0x95')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x1cf2('0x95')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x499379,_0x571ca5,_0x376e0d){if(_0x571ca5>_0x376e0d){for(var _0x46b5c9=0x0;_0x46b5c9<_0x571ca5-_0x376e0d;_0x46b5c9+=0x1){decremetOriginate(_0x499379);}}}function loggerGetContactDialer(_0x5936f2,_0x1ad3b8,_0x1c198c){return function(_0x233aee){checkContactLowerLimitOriginate(_0x1ad3b8,_0x1c198c,0x0);logger['error'](_0x5936f2,util['inspect'](_0x233aee,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x415182){return function(_0x4db7ab){if(isNotNull(_0x4db7ab)&&isNotNull(_0x4db7ab[0x0])){if(_0x4db7ab[0x0][_0x1cf2('0x99')]>0x0){_0x415182[_0x1cf2('0x3f')]=_0x1cf2('0x9a');logger[_0x1cf2('0x7c')](_0x1cf2('0x9b')+_0x415182['name'],_0x4db7ab[0x0]['contactsRescheduled'],_0x1cf2('0x9c'));}else{_0x415182[_0x1cf2('0x3f')]=_0x1cf2('0x9d');logger[_0x1cf2('0x7c')](_0x1cf2('0x9e')+_0x415182['name']);}}};}function notSendMessagesQueue(_0x430e5a){if(_0x430e5a[_0x1cf2('0x9f')]){freeVariablesPredictive(_0x430e5a);if(_0x430e5a[_0x1cf2('0x71')]===0x0&&_0x430e5a['talking']===0x0&&_0x430e5a[_0x1cf2('0x56')]===0x0&&(_0x430e5a[_0x1cf2('0x52')]||0x0)===0x0){_0x430e5a[_0x1cf2('0x9f')]=![];_0x430e5a[_0x1cf2('0x50')]=0x0;_0x430e5a[_0x1cf2('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x1cf2('0x95')](_0x1cf2('0xa0'),_0x430e5a[_0x1cf2('0x41')],'is\x20not\x20active');}else{_0x430e5a[_0x1cf2('0x3f')]=_0x1cf2('0xa1');loggerSyncQueueSummary['error'](_0x1cf2('0xa0'),_0x430e5a[_0x1cf2('0x41')],_0x1cf2('0xa2'));}emitVoiceQueueSummary(_0x430e5a);}}function notSendMessagesCampaign(_0x5f1b38){if(_0x5f1b38['sendMessageOneNotActive']){if(_0x5f1b38['originated']===0x0){_0x5f1b38[_0x1cf2('0x9f')]=![];_0x5f1b38[_0x1cf2('0x3f')]=_0x1cf2('0x43');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5f1b38[_0x1cf2('0x41')],_0x1cf2('0xa3'));}else{_0x5f1b38[_0x1cf2('0x3f')]=_0x1cf2('0xa1');loggerSyncQueueSummary['error'](_0x1cf2('0xa4'),_0x5f1b38[_0x1cf2('0x41')],_0x1cf2('0xa2'));}emitCampaignSummary(_0x5f1b38);}}function createObjHistory(_0x2b1eb2,_0x298d94,_0x124565,_0x26acef,_0x3ffd05){_0x2b1eb2[_0x1cf2('0x3f')]=_0x124565;var _0x49dc17=new Action(_0x2b1eb2,_0x298d94);var _0x5d7b7a=new History(_0x49dc17);_0x5d7b7a[_0x1cf2('0xa5')]=_0x26acef;_0x5d7b7a[_0x1cf2('0xa6')]=_0x3ffd05;_0x5d7b7a[_0x1cf2('0xa7')]=_0x49dc17['starttime'];return _0x5d7b7a;}Dialer[_0x1cf2('0x1a')][_0x1cf2('0xa8')]=function(){var _0x30b7f4=this;setInterval(function(){_0x30b7f4[_0x1cf2('0xa9')](_0x30b7f4[_0x1cf2('0xaa')],_0x1cf2('0xab'));_0x30b7f4[_0x1cf2('0xa9')](_0x30b7f4['actions'],_0x1cf2('0xac'));},0x32c8);};Dialer['prototype'][_0x1cf2('0xa9')]=function(_0x139a26,_0x1e4168){var _0x2f9d80=this;for(var _0x17130e in _0x139a26){if(typeof _0x139a26[_0x17130e]!=='undefined'){this[_0x1cf2('0xad')][_0x1cf2('0x1b')](function(){if(!_[_0x1cf2('0xae')](_0x139a26[_0x17130e])){return ami[_0x1cf2('0xaf')]({'action':_0x1cf2('0xb0'),'channel':_0x139a26[_0x17130e]['channel']})[_0x1cf2('0xb1')](function(_0x8692f){if(_0x8692f['message']===_0x1cf2('0xb2')){setTimeout(function(){if(_0x139a26[_0x17130e]&&_0x139a26[_0x17130e][_0x1cf2('0x79')]!==_0x1cf2('0x7a')){_0x2f9d80[_0x1cf2('0xb3')](_0x2f9d80[_0x1cf2('0x1f')][_0x139a26[_0x17130e]['queue']]);logger[_0x1cf2('0x95')]('[Dialer][checkChannel]',_0x1e4168,_0x17130e,_0x139a26[_0x17130e][_0x1cf2('0xb4')]);delete _0x139a26[_0x17130e];}if(_0x139a26[_0x17130e]&&_0x139a26[_0x17130e][_0x1cf2('0x79')]==='ivr'){_0x2f9d80[_0x1cf2('0xb3')](_0x2f9d80[_0x1cf2('0x20')][_0x139a26[_0x17130e]['queue']]);logger['error']('[Dialer][checkChannel][ivr]',_0x1e4168,_0x17130e,_0x139a26[_0x17130e]['queue']);delete _0x139a26[_0x17130e];}},0x2328);}});}});}}};Dialer['prototype'][_0x1cf2('0xb5')]=function(_0x196272){return BPromise[_0x1cf2('0xb6')]()['then'](cmHopper[_0x1cf2('0xb5')](_0x196272))[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xb7')));};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xb8')]=function(_0x505c92){return BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](cmHopperBlack['checkIsBlackList'](_0x505c92))[_0x1cf2('0xb1')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xb9')]=function(_0x1f7cca){return BPromise[_0x1cf2('0xb6')]()['then'](cmHopperBlack[_0x1cf2('0xb9')](_0x1f7cca))[_0x1cf2('0xb1')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xba')]=function(_0x1d3e31){return BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](cmHopperHistory['avgHandleTime'](_0x1d3e31))[_0x1cf2('0xb1')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype']['rescheduleContact']=function(_0x5b1a38){return BPromise['resolve']()[_0x1cf2('0x3d')](cmHopper[_0x1cf2('0xbb')](_0x5b1a38))[_0x1cf2('0xb1')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xbc')]=function(_0x5c18c5,_0x5f31c5,_0x4f499c){return BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](cmHopper[_0x1cf2('0xbc')](_0x5c18c5,_0x5f31c5,_0x4f499c))[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xbd')));};Dialer[_0x1cf2('0x1a')]['getContactDialer']=function(_0x3d74a1,_0x2aab91,_0x1abb52,_0x25b54c,_0x24354c){return BPromise[_0x1cf2('0xb6')]()['then'](cmHopper['getContactDialer'](_0x3d74a1,_0x2aab91,_0x1abb52,_0x25b54c))[_0x1cf2('0xb1')](function(_0x4c98ff){_0x24354c[_0x1cf2('0xbe')]-=_0x1abb52;_0x24354c['temp']=_0x24354c[_0x1cf2('0xbe')]>0x0?_0x24354c[_0x1cf2('0xbe')]:0x0;loggerCatch(_0x1cf2('0xbf'))(_0x4c98ff);});};Dialer[_0x1cf2('0x1a')]['getContactDialerIvr']=function(_0x1424d5,_0x30c2db,_0x7a686c,_0x2614b1){return BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](cmHopper[_0x1cf2('0xc0')](_0x1424d5,_0x30c2db,_0x7a686c))['catch'](function(_0x4b47c3){_0x2614b1[_0x1cf2('0xbe')]-=_0x30c2db;_0x2614b1['temp']=_0x2614b1[_0x1cf2('0xbe')]>0x0?_0x2614b1['temp']:0x0;loggerCatch(_0x1cf2('0xc1'))(_0x4b47c3);});};Dialer[_0x1cf2('0x1a')]['getVoiceQueueRtPauses']=function(_0x3bfda6){return BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](voiceQueueRt[_0x1cf2('0xc2')](_0x3bfda6))[_0x1cf2('0xb1')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0x1cf2('0xc3')]=function(_0x1bccba){return BPromise['resolve']()['then'](cmHopper[_0x1cf2('0xc3')](_0x1bccba))[_0x1cf2('0xb1')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xc4')]=function(_0x172f43){return BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](cmHopperHistory[_0x1cf2('0xc4')](_0x172f43))[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xc5')));};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xb3')]=function(_0x5b3b12){if(!_[_0x1cf2('0x82')](_0x5b3b12)&&_0x5b3b12!==null){if(typeof _0x5b3b12[_0x1cf2('0x71')]!=='undefined'){if(_0x5b3b12[_0x1cf2('0x71')]>0x0){_0x5b3b12['originated']-=0x1;}else{logger[_0x1cf2('0x95')](_0x1cf2('0xc6'));}}}else{logger[_0x1cf2('0x95')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x1cf2('0xc7')]=function(_0x5abb8b,_0x20d038){var _0x4e1f72=this;return function(_0x5a1e45){_0x4e1f72['updateOriginated'](_0x20d038);logger[_0x1cf2('0x95')](_0x5abb8b,util['inspect'](_0x5a1e45,{'showHidden':![],'depth':null}));};};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xc8')]=function(_0xc9de93,_0x542660,_0x3d42c3){var _0x2aa76e={'state':0x19,'statedesc':'notFound'};this[_0x1cf2('0xb3')](_0x542660);this['saveInDb'](_[_0x1cf2('0x8d')](_0x2aa76e,_['pick'](_0x3d42c3,['ContactId',_0x1cf2('0xc9'),_0x1cf2('0xca'),_0x1cf2('0xcb'),_0x1cf2('0xcc')])),'[emptyContact][createHistory]',_0x1cf2('0xcd'));logger['error'](_0xc9de93);};Dialer['prototype'][_0x1cf2('0xce')]=function(_0x1254d3){return _0x1254d3===_0x1cf2('0xcf');};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xd0')]=function(_0x5742cd){return!_[_0x1cf2('0x82')](_0x5742cd)&&_0x5742cd&&!_[_0x1cf2('0x82')](_0x5742cd['name'])&&!_[_0x1cf2('0x82')](_0x5742cd[_0x1cf2('0x75')])&&_0x5742cd[_0x1cf2('0x75')]&&(this[_0x1cf2('0x22')][util[_0x1cf2('0x77')](_0x1cf2('0xd1'),_0x5742cd[_0x1cf2('0x41')])]['status']===_0x1cf2('0xd2')||this[_0x1cf2('0x22')][util[_0x1cf2('0x77')]('SIP/%s',_0x5742cd['name'])][_0x1cf2('0xb0')]==='unmonitored');};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xd3')]=function(_0x56e7a0,_0x3ecc3d,_0x59a107){this[_0x1cf2('0xc4')](_0x56e7a0)[_0x1cf2('0xb1')](loggerCatch(_0x3ecc3d));this[_0x1cf2('0xc3')](_0x56e7a0)[_0x1cf2('0xb1')](loggerCatch(_0x59a107));};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xd4')]=function(_0x956e9d){var _0x54eb82=this[_0x1cf2('0xaa')][_0x956e9d[_0x1cf2('0xd5')]];var _0x7e04e9;if(!_[_0x1cf2('0xae')](_0x956e9d)&&!_['isNil'](_0x956e9d['variable'])&&!_[_0x1cf2('0xae')](_0x956e9d['variable'][_0x1cf2('0xd6')])&&_0x956e9d[_0x1cf2('0xd7')]===_0x1cf2('0xd8')&&_0x54eb82){if(_0x54eb82['type']!=='ivr'&&this['voiceQueues'][_0x54eb82[_0x1cf2('0xb4')]][_0x1cf2('0xd9')]&&_0x956e9d['value']===_0x1cf2('0xda')){delete this[_0x1cf2('0xaa')][_0x956e9d[_0x1cf2('0xd5')]];this[_0x1cf2('0xb3')](this[_0x1cf2('0x1f')][_0x54eb82[_0x1cf2('0xb4')]]);this[_0x1cf2('0x1f')][_0x54eb82[_0x1cf2('0xb4')]][_0x1cf2('0x5c')]+=0x1;this[_0x1cf2('0x1f')][_0x54eb82[_0x1cf2('0xb4')]][_0x1cf2('0x5b')]+=0x1;_0x7e04e9=new Hangup(_0x54eb82,_0x956e9d);_0x7e04e9[_0x1cf2('0xa5')]=0x12;_0x7e04e9[_0x1cf2('0xa6')]=_0x1cf2('0xdb');_0x7e04e9['membername']='AMD';ami[_0x1cf2('0xdc')](_0x1cf2('0xdd'),ut[_0x1cf2('0xde')](_0x7e04e9,_0x1cf2('0xdf')));this['saveInDb'](_0x7e04e9,'[syncHangupInAMD][createHistory]',_0x1cf2('0xe0'));}if(_0x54eb82[_0x1cf2('0x79')]!==_0x1cf2('0x7a')&&this[_0x1cf2('0x1f')][_0x54eb82[_0x1cf2('0xb4')]]['dialAMDActive']&&_0x956e9d[_0x1cf2('0xe1')]===_0x1cf2('0xe2')){var _0x20dd07=this;return new BPromise(function(_0xae76ad,_0x42480c){delete _0x20dd07['uniqueId'][_0x956e9d[_0x1cf2('0xd5')]];_0x20dd07[_0x1cf2('0xb3')](_0x20dd07[_0x1cf2('0x1f')][_0x54eb82[_0x1cf2('0xb4')]]);_0x20dd07[_0x1cf2('0x1f')][_0x54eb82[_0x1cf2('0xb4')]][_0x1cf2('0x5c')]+=0x1;_0x20dd07[_0x1cf2('0x1f')][_0x54eb82[_0x1cf2('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x251695=_0x20dd07['voiceQueues'][_0x54eb82[_0x1cf2('0xb4')]];var _0x148a06=new Hangup(_0x54eb82,_0x956e9d);_0x148a06[_0x1cf2('0xa5')]=0x13;_0x148a06[_0x1cf2('0xa6')]=_0x1cf2('0xe3');_0x148a06[_0x1cf2('0xe4')]=_0x1cf2('0xe5');_0x148a06['countmachineretry']+=0x1;_0x148a06['countglobal']+=0x1;_0x148a06[_0x1cf2('0xdf')]=!![];ami['emit'](_0x1cf2('0xdd'),ut['buildObj'](_0x148a06,_0x1cf2('0xdf')));_0x20dd07[_0x1cf2('0xc4')](_0x148a06)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xe6')));if(_0x148a06[_0x1cf2('0xe7')]+_0x148a06[_0x1cf2('0xe8')]+_0x148a06['countnoanswerretry']+_0x148a06[_0x1cf2('0xe9')]+_0x148a06[_0x1cf2('0xea')]+_0x148a06[_0x1cf2('0xeb')]+_0x148a06['countmachineretry']+_0x148a06[_0x1cf2('0xec')]>=_0x251695[_0x1cf2('0xed')]){_0x20dd07[_0x1cf2('0xee')](_0x148a06,_0xae76ad,_0x42480c,_0x1cf2('0xef'));}else{if(_0x148a06[_0x1cf2('0xf0')]>=_0x251695[_0x1cf2('0xf1')]){_0x20dd07[_0x1cf2('0xf2')](_0x148a06,_0xae76ad,_0x42480c,_0x1cf2('0xf3'));}else{_0x20dd07[_0x1cf2('0xbb')]({'active':![],'countmachineretry':_0x148a06[_0x1cf2('0xf0')],'scheduledat':moment()['add'](_0x251695[_0x1cf2('0xf4')],_0x1cf2('0xf5'))[_0x1cf2('0x77')](_0x1cf2('0xf6')),'ContactId':_0x148a06[_0x1cf2('0xf7')],'ListId':_0x148a06[_0x1cf2('0xc9')],'VoiceQueueId':_0x148a06['VoiceQueueId']||undefined,'CampaignId':_0x148a06['CampaignId']||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xf8')));_0xae76ad({'reschedule':0x1});}}});}if(_0x54eb82[_0x1cf2('0x79')]===_0x1cf2('0x7a')&&this[_0x1cf2('0x20')][_0x54eb82['queue']][_0x1cf2('0xd9')]&&_0x956e9d[_0x1cf2('0xe1')]===_0x1cf2('0xda')){delete this[_0x1cf2('0xaa')][_0x956e9d[_0x1cf2('0xd5')]];this[_0x1cf2('0xb3')](this[_0x1cf2('0x20')][_0x54eb82[_0x1cf2('0xb4')]]);_0x7e04e9=new Hangup(_0x54eb82,_0x956e9d);_0x7e04e9[_0x1cf2('0xa5')]=0x12;_0x7e04e9['statedesc']='HangupInAMD';_0x7e04e9[_0x1cf2('0xe4')]=_0x1cf2('0xe5');ami[_0x1cf2('0xdc')]('custom:amd',ut[_0x1cf2('0xde')](_0x7e04e9,_0x1cf2('0xdf')));this[_0x1cf2('0xd3')](_0x7e04e9,_0x1cf2('0xf9'),_0x1cf2('0xfa'));}if(_0x54eb82[_0x1cf2('0x79')]===_0x1cf2('0x7a')&&this['campaigns'][_0x54eb82[_0x1cf2('0xb4')]][_0x1cf2('0xd9')]&&_0x956e9d[_0x1cf2('0xe1')]==='MACHINE'){var _0x20dd07=this;return new BPromise(function(_0x3f8aef,_0x41dfe1){delete _0x20dd07[_0x1cf2('0xaa')][_0x956e9d['uniqueid']];_0x20dd07[_0x1cf2('0xb3')](_0x20dd07[_0x1cf2('0x20')][_0x54eb82['queue']]);_0x20dd07['campaigns'][_0x54eb82[_0x1cf2('0xb4')]][_0x1cf2('0x5c')]+=0x1;_0x20dd07[_0x1cf2('0x20')][_0x54eb82[_0x1cf2('0xb4')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x17846a=_0x20dd07[_0x1cf2('0x20')][_0x54eb82[_0x1cf2('0xb4')]];var _0x3c19f0=new Hangup(_0x54eb82,_0x956e9d);_0x3c19f0[_0x1cf2('0xa5')]=0x13;_0x3c19f0[_0x1cf2('0xa6')]='Machine';_0x3c19f0['membername']='AMD';_0x3c19f0[_0x1cf2('0xf0')]+=0x1;_0x3c19f0[_0x1cf2('0xfb')]+=0x1;_0x3c19f0[_0x1cf2('0xdf')]=!![];ami[_0x1cf2('0xdc')](_0x1cf2('0xdd'),ut['buildObj'](_0x3c19f0,_0x1cf2('0xdf')));_0x20dd07[_0x1cf2('0xc4')](_0x3c19f0)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xe6')));if(_0x3c19f0['countbusyretry']+_0x3c19f0['countcongestionretry']+_0x3c19f0['countnoanswerretry']+_0x3c19f0[_0x1cf2('0xe9')]+_0x3c19f0[_0x1cf2('0xea')]+_0x3c19f0[_0x1cf2('0xeb')]+_0x3c19f0[_0x1cf2('0xf0')]+_0x3c19f0[_0x1cf2('0xec')]>=_0x17846a[_0x1cf2('0xed')]){_0x20dd07['stateGlobal'](_0x3c19f0,_0x3f8aef,_0x41dfe1,_0x1cf2('0xef'));}else{if(_0x3c19f0['countmachineretry']>=_0x17846a[_0x1cf2('0xf1')]){_0x20dd07[_0x1cf2('0xf2')](_0x3c19f0,_0x3f8aef,_0x41dfe1,_0x1cf2('0xf3'));}else{_0x20dd07['rescheduleContact']({'active':![],'countmachineretry':_0x3c19f0['countmachineretry'],'scheduledat':moment()[_0x1cf2('0xfc')](_0x17846a[_0x1cf2('0xf4')],_0x1cf2('0xf5'))[_0x1cf2('0x77')](_0x1cf2('0xf6')),'ContactId':_0x3c19f0[_0x1cf2('0xf7')],'ListId':_0x3c19f0[_0x1cf2('0xc9')],'VoiceQueueId':_0x3c19f0['VoiceQueueId']||undefined,'CampaignId':_0x3c19f0[_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch('[rescheduleContact][Machine]'));_0x3f8aef({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x37380e){var _0x487ac2=this[_0x1cf2('0xaa')][_0x37380e[_0x1cf2('0xd5')]];var _0x3ba560=this;var _0x2c0442;if(_0x487ac2&&_0x487ac2['type']===_0x1cf2('0x7a')){delete this['uniqueId'][_0x37380e[_0x1cf2('0xd5')]];this[_0x1cf2('0xb3')](this['campaigns'][_0x487ac2['queue']]);this['campaigns'][_0x487ac2[_0x1cf2('0xb4')]]['ivrAnswerCallsDay']+=0x1;_0x2c0442=new Hangup(_0x487ac2,_0x37380e);this[_0x1cf2('0xc4')](_0x2c0442)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xfd')));this['moveContactManagedDialer'](_0x2c0442)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xfe')));}if(_0x487ac2&&_0x487ac2['type']!==_0x1cf2('0x7a')&&isNotNull(this['voiceQueues'][_0x487ac2[_0x1cf2('0xb4')]][_0x1cf2('0xff')])){delete this[_0x1cf2('0xaa')][_0x37380e['uniqueid']];this[_0x1cf2('0xb3')](this[_0x1cf2('0x1f')][_0x487ac2[_0x1cf2('0xb4')]]);this[_0x1cf2('0x1f')][_0x487ac2['queue']][_0x1cf2('0x5c')]+=0x1;this['voiceQueues'][_0x487ac2['queue']][_0x1cf2('0x5b')]+=0x1;_0x2c0442=new Hangup(_0x487ac2,_0x37380e);_0x2c0442['state']=0x10;_0x2c0442[_0x1cf2('0xa6')]='AnswerAGI';_0x2c0442[_0x1cf2('0xe4')]=_0x1cf2('0x100');this[_0x1cf2('0xc4')](_0x2c0442)['catch'](loggerCatch(_0x1cf2('0xfd')));this[_0x1cf2('0xc3')](_0x2c0442)[_0x1cf2('0xb1')](loggerCatch('[syncHangupIvr]'));}if(_0x487ac2&&_0x487ac2[_0x1cf2('0x79')]!==_0x1cf2('0x7a')&&!isNotNull(this[_0x1cf2('0x1f')][_0x487ac2['queue']][_0x1cf2('0xff')])){delete this[_0x1cf2('0xaa')][_0x37380e[_0x1cf2('0xd5')]];this[_0x1cf2('0xb3')](this[_0x1cf2('0x1f')][_0x487ac2['queue']]);this[_0x1cf2('0x1f')][_0x487ac2[_0x1cf2('0xb4')]][_0x1cf2('0x67')]+=0x1;_0x2c0442=new Hangup(_0x487ac2,_0x37380e);_0x2c0442['state']=0xc;_0x2c0442[_0x1cf2('0xa6')]=_0x37380e[_0x1cf2('0x101')];_0x2c0442[_0x1cf2('0xe4')]='Unknow';this[_0x1cf2('0xc4')](_0x2c0442)['catch'](loggerCatch(_0x1cf2('0xfd')));this['moveContactManagedDialer'](_0x2c0442)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xfe')));}};Dialer['prototype'][_0x1cf2('0x32')]=function(_0x906fc0){var _0x539630=this[_0x1cf2('0xaa')][_0x906fc0[_0x1cf2('0xd5')]];var _0x4eb9ab=this;if(this[_0x1cf2('0x1f')][_0x906fc0[_0x1cf2('0xb4')]]){if(_0x539630&&_0x539630[_0x1cf2('0x79')]!==_0x1cf2('0x7a')){delete this[_0x1cf2('0xaa')][_0x906fc0['uniqueid']];this['voiceQueues'][_0x906fc0[_0x1cf2('0xb4')]][_0x1cf2('0x5c')]+=0x1;var _0x5d7e11=new AgentComplete(_0x539630,_0x906fc0);if(_0x906fc0[_0x1cf2('0x102')]===_0x1cf2('0x103')){_0x5d7e11['agiafterat']=this['voiceQueues'][_0x906fc0[_0x1cf2('0xb4')]][_0x1cf2('0x104')]&&this['voiceQueues'][_0x906fc0['queue']][_0x1cf2('0x105')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x5d7e11)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x106')));this['moveContactManagedDialer'](_0x5d7e11)[_0x1cf2('0xb1')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x2b')]=function(_0x233d46){if(this[_0x1cf2('0x1f')][_0x233d46[_0x1cf2('0xb4')]]){if(this[_0x1cf2('0xaa')][_0x233d46[_0x1cf2('0xd5')]]&&this[_0x1cf2('0xaa')][_0x233d46[_0x1cf2('0xd5')]][_0x1cf2('0x79')]!==_0x1cf2('0x7a')){this[_0x1cf2('0xb3')](this['voiceQueues'][_0x233d46['queue']]);this[_0x1cf2('0xaa')][_0x233d46[_0x1cf2('0xd5')]][_0x1cf2('0x107')]=moment()[_0x1cf2('0x77')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0x1cf2('0x108')]=function(_0x2825f8){this['createHistory'](_0x2825f8)[_0x1cf2('0xb1')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x1cf2('0xc3')](_0x2825f8)[_0x1cf2('0xb1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x1cf2('0x1a')]['syncQueueCallerAbandon']=function(_0x3e9ec7){var _0x5621c8=this[_0x1cf2('0xaa')][_0x3e9ec7['uniqueid']];var _0x2d260a=this;if(this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]]){if(_0x5621c8&&_0x5621c8['type']!=='ivr'){delete this[_0x1cf2('0xaa')][_0x3e9ec7[_0x1cf2('0xd5')]];this[_0x1cf2('0xb3')](this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]]);_0x5621c8[_0x1cf2('0x109')]=moment()[_0x1cf2('0x77')](_0x1cf2('0xf6'));var _0x45d79c=new QueueCallerAbandon(_0x5621c8,_0x3e9ec7);if(getSeconds(_0x5621c8[_0x1cf2('0x109')],_0x5621c8[_0x1cf2('0x10a')])>=_0x5621c8[_0x1cf2('0x10b')]){this[_0x1cf2('0x1f')][_0x3e9ec7['queue']][_0x1cf2('0x6c')]+=0x1;this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]][_0x1cf2('0x62')]+=0x1;this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x45d79c[_0x1cf2('0xa5')]=0xa;_0x45d79c[_0x1cf2('0xa6')]='Drop';_0x45d79c['dropreason']=_0x1cf2('0x10c');_0x45d79c[_0x1cf2('0x10d')]=this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]][_0x1cf2('0x104')]?moment()[_0x1cf2('0x77')](_0x1cf2('0xf6')):undefined;_0x45d79c[_0x1cf2('0xea')]+=0x1;_0x45d79c['countglobal']+=0x1;if(_0x45d79c[_0x1cf2('0xea')]>=this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x45d79c);}else{this[_0x1cf2('0xbb')]({'active':![],'countdropretry':_0x45d79c[_0x1cf2('0xea')],'scheduledat':moment()[_0x1cf2('0xfc')](this['voiceQueues'][_0x3e9ec7[_0x1cf2('0xb4')]][_0x1cf2('0x10e')],_0x1cf2('0xf5'))[_0x1cf2('0x77')](_0x1cf2('0xf6')),'ContactId':_0x5621c8[_0x1cf2('0xf7')],'ListId':_0x5621c8[_0x1cf2('0xc9')],'VoiceQueueId':_0x5621c8[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x5621c8[_0x1cf2('0xcc')]||undefined})['catch'](loggerCatch(_0x1cf2('0x10f')));var _0x1ddca8=new History(_0x45d79c);_0x1ddca8[_0x1cf2('0xa5')]=0xa;_0x1ddca8['statedesc']=_0x1cf2('0x110');_0x1ddca8['starttime']=moment()[_0x1cf2('0x77')](_0x1cf2('0xf6'));_0x1ddca8[_0x1cf2('0xa7')]=_0x1ddca8[_0x1cf2('0x111')];_0x1ddca8['calleridname']=_0x45d79c[_0x1cf2('0x112')];_0x1ddca8[_0x1cf2('0x113')]=_0x45d79c['calleridnum'];this[_0x1cf2('0xc4')](_0x1ddca8)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x114')));}}else{this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]][_0x1cf2('0x6b')]+=0x1;this['voiceQueues'][_0x3e9ec7[_0x1cf2('0xb4')]][_0x1cf2('0x61')]+=0x1;_0x45d79c[_0x1cf2('0xa5')]=0xb;_0x45d79c['statedesc']=_0x1cf2('0x115');_0x45d79c[_0x1cf2('0x116')]=_0x1cf2('0x117');_0x45d79c['countabandonedretry']+=0x1;_0x45d79c['countglobal']+=0x1;if(_0x45d79c[_0x1cf2('0xeb')]>=this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]][_0x1cf2('0x118')]){this[_0x1cf2('0x108')](_0x45d79c);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x45d79c[_0x1cf2('0xeb')],'scheduledat':moment()[_0x1cf2('0xfc')](this[_0x1cf2('0x1f')][_0x3e9ec7[_0x1cf2('0xb4')]][_0x1cf2('0x119')],'minutes')[_0x1cf2('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5621c8[_0x1cf2('0xf7')],'ListId':_0x5621c8['ListId'],'VoiceQueueId':_0x5621c8[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x5621c8[_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x11a')));var _0x1ddca8=new History(_0x45d79c);_0x1ddca8[_0x1cf2('0xa5')]=0xb;_0x1ddca8[_0x1cf2('0xa6')]='Abandoned';_0x1ddca8[_0x1cf2('0x111')]=moment()['format'](_0x1cf2('0xf6'));_0x1ddca8[_0x1cf2('0xa7')]=_0x1ddca8[_0x1cf2('0x111')];_0x1ddca8['calleridname']=_0x45d79c[_0x1cf2('0x112')];_0x1ddca8[_0x1cf2('0x113')]=_0x45d79c[_0x1cf2('0x113')];this[_0x1cf2('0xc4')](_0x1ddca8)['catch'](loggerCatch(_0x1cf2('0x11b')));}}}}};Dialer['prototype'][_0x1cf2('0x36')]=function(_0x1fc96c){if(this['actions'][_0x1fc96c[_0x1cf2('0xd5')]]){this[_0x1cf2('0x11c')][_0x1fc96c[_0x1cf2('0xd5')]][_0x1cf2('0x11d')]=_0x1fc96c[_0x1cf2('0x11d')];}if(this['uniqueId'][_0x1fc96c[_0x1cf2('0xd5')]]){this['uniqueId'][_0x1fc96c[_0x1cf2('0xd5')]][_0x1cf2('0x11d')]=_0x1fc96c[_0x1cf2('0x11d')];}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x39')]=function(_0x39f97d){if(strategy[this[_0x1cf2('0x1f')][this[_0x1cf2('0x11c')][_0x39f97d[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]][_0x1cf2('0x4e')]]===_0x1cf2('0x19')){if(this[_0x1cf2('0x11c')][_0x39f97d['actionid']]&&_[_0x1cf2('0xae')](this['actions'][_0x39f97d[_0x1cf2('0x11e')]][_0x1cf2('0x11f')])&&_0x39f97d[_0x1cf2('0xb0')]==='1'&&_0x39f97d[_0x1cf2('0x120')]==='0'){if(this[_0x1cf2('0x21')][_0x39f97d['stateinterface']]){if(!this[_0x1cf2('0x21')][_0x39f97d['stateinterface']][_0x1cf2('0x11f')]){this[_0x1cf2('0x21')][_0x39f97d[_0x1cf2('0x121')]][_0x1cf2('0x11f')]=!![];this[_0x1cf2('0x11c')][_0x39f97d[_0x1cf2('0x11e')]]['locked']=!![];this[_0x1cf2('0x11c')][_0x39f97d[_0x1cf2('0x11e')]][_0x1cf2('0x121')]=_0x39f97d[_0x1cf2('0x121')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x39f97d[_0x1cf2('0x11e')]]['queue']]['strategy']]||_0x1cf2('0x18'))===_0x1cf2('0x18')){if(this[_0x1cf2('0x11c')][_0x39f97d[_0x1cf2('0x11e')]]){if(this[_0x1cf2('0x21')][_0x39f97d[_0x1cf2('0x121')]]){this['actions'][_0x39f97d[_0x1cf2('0x11e')]][_0x1cf2('0x121')]=_0x39f97d[_0x1cf2('0x121')];if(_[_0x1cf2('0xae')](this[_0x1cf2('0x122')][this['actions'][_0x39f97d['actionid']][_0x1cf2('0xb4')]])){this['queueBooked'][this['actions'][_0x39f97d[_0x1cf2('0x11e')]]['queue']]=[];}this['queueBooked'][this[_0x1cf2('0x11c')][_0x39f97d[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]]['push'](_['merge'](_['pick'](this['actions'][_0x39f97d[_0x1cf2('0x11e')]],[_0x1cf2('0x123'),_0x1cf2('0x121')]),{'status':_0x39f97d[_0x1cf2('0xb0')],'paused':_0x39f97d['paused']}));}}}};function unlockQueueStatus(_0x381a0e,_0xf62c8e){setTimeout(function(){if(_['isUndefined'](_0x381a0e[_0x1cf2('0x124')])){loggerBooked[_0x1cf2('0x95')](_0x1cf2('0x125'),_0xf62c8e);}_0x381a0e[_0x1cf2('0x124')]=!![];loggerBooked[_0x1cf2('0x7c')](_0x1cf2('0x126'),_0xf62c8e,JSON[_0x1cf2('0x127')](_[_0x1cf2('0x128')](_0x381a0e,[_0x1cf2('0x41'),_0x1cf2('0x124')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0xbd7149){var _0xf2962d=this;var _0x47235e=_0xf2962d[_0x1cf2('0x1f')][_0xf2962d[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]];if(strategy[this[_0x1cf2('0x1f')][this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]][_0x1cf2('0x4e')]]===_0x1cf2('0x19')){if(this[_0x1cf2('0x11c')][_0xbd7149['actionid']]&&this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0x121')]){this[_0x1cf2('0x1e')][_0x1cf2('0x129')](this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]]['idHopper'],this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0x121')])[_0x1cf2('0xb1')](function(_0x4a7dc5){logger[_0x1cf2('0x95')](_0x1cf2('0x12a'),util['inspect'](_0x4a7dc5,{'showHidden':![],'depth':null}));})[_0x1cf2('0x1d')](function(){_0xf2962d[_0x1cf2('0xb3')](_0xf2962d[_0x1cf2('0x1f')][_0xf2962d[_0x1cf2('0x11c')][_0xbd7149['actionid']]['queue']]);_0xf2962d[_0x1cf2('0x21')][_0xf2962d[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0x121')]][_0x1cf2('0x11f')]=![];delete _0xf2962d['actions'][_0xbd7149[_0x1cf2('0x11e')]];unlockQueueStatus(_0x47235e);});}else{this['updateOriginated'](this[_0x1cf2('0x1f')][this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]]);this[_0x1cf2('0xbb')]({'active':![],'ContactId':this['actions'][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xf7')],'ListId':this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xc9')],'VoiceQueueId':this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xcb')]||undefined,'CampaignId':this['actions'][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]];unlockQueueStatus(_0x47235e);}}else if((strategy[this[_0x1cf2('0x1f')][this['actions'][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]][_0x1cf2('0x4e')]]||'rrmemory')==='rrmemory'){var _0x1a62fe;if(this['actions'][_0xbd7149[_0x1cf2('0x11e')]]&&!_[_0x1cf2('0x48')](this['queueBooked'][this[_0x1cf2('0x11c')][_0xbd7149['actionid']]['queue']])){if(this[_0x1cf2('0x2a')][_0xf2962d[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]]){this[_0x1cf2('0x2a')][_0xf2962d['actions'][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]]=this[_0x1cf2('0x2a')][this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]]['queue']]?this[_0x1cf2('0x2a')][this['actions'][_0xbd7149['actionid']][_0x1cf2('0xb4')]]:this[_0x1cf2('0x122')][this[_0x1cf2('0x11c')][_0xbd7149['actionid']][_0x1cf2('0xb4')]]?this[_0x1cf2('0x122')][this['actions'][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]][_0x1cf2('0x12b')]||0x0:0x0;}this[_0x1cf2('0x122')][this[_0x1cf2('0x11c')][_0xbd7149[_0x1cf2('0x11e')]][_0x1cf2('0xb4')]][_0x1cf2('0x12b')]=this[_0x1cf2('0x2a')][this[_0x1cf2('0x11c')][_0xbd7149['actionid']][_0x1cf2('0xb4')]];for(var _0x32211c=0x0;_0x32211c=0x0;})[_0x1cf2('0xb1')](myreject(_0x33d1d3)));}}else{_0x4e0062[_0x1cf2('0x141')](ami[_0x1cf2('0xaf')]({'action':'command','command':util['format'](_0x1cf2('0x143'),_0x393a3f,!_[_0x1cf2('0x82')](config[_0x1cf2('0x13d')][_0x2d5c9f])?_0x2d5c9f:'')})[_0x1cf2('0x3d')](function(_0xeb17e3){return _0xeb17e3['content']['indexOf']('true')>=0x0;})[_0x1cf2('0xb1')](myreject(_0x33d1d3)));}BPromise[_0x1cf2('0x147')](_0x4e0062)['then'](function(_0x1e64e3){var _0x2b1c6d=_[_0x1cf2('0x148')](_0x1e64e3);if(_0x2b1c6d){return _0x1aacda(_0x2b1c6d);}else{_0x2989b4[_0x1cf2('0x3f')]=_0x5aecbf?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x33d1d3(msgResponse(_0x1cf2('0x149'),_0x1cf2('0x13a'),_0x1cf2('0x14a')+_0x5aecbf+'\x20'+_0x43093e+'\x20Interval\x20is\x20overtime:\x20'+util[_0x1cf2('0x94')](_0x393a3f,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x2d5c9f));}})[_0x1cf2('0xb1')](function(_0x831da5){return _0x33d1d3(msgResponse(_0x1cf2('0x138'),_0x1cf2('0x13a'),JSON[_0x1cf2('0x127')](_0x831da5)));});});};Dialer['prototype'][_0x1cf2('0x14b')]=function(_0x74a416){var _0x36e491=this;return function(){switch(_0x74a416[_0x1cf2('0x14c')]){case _0x1cf2('0x14d'):freeVariablesPredictive(_0x74a416);_0x36e491[_0x1cf2('0x14e')](_0x74a416,0x1);break;case _0x1cf2('0x14f'):freeVariablesPredictive(_0x74a416);_0x36e491[_0x1cf2('0x14e')](_0x74a416,_0x74a416['dialPowerLevel']);break;case _0x1cf2('0x8'):_0x36e491[_0x1cf2('0x8')](_0x74a416);break;case _0x1cf2('0x150'):freeVariablesPredictive(_0x74a416);_0x36e491[_0x1cf2('0x14e')](_0x74a416,0x1);break;default:freeVariablesPredictive(_0x74a416);logger[_0x1cf2('0x95')](_0x1cf2('0x151'),_0x74a416[_0x1cf2('0x41')],'method\x20not\x20recognized');}};};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x152')]=_['throttle'](function(_0x22a295){return BPromise['resolve']()['then'](cmHopper[_0x1cf2('0x153')](_0x22a295['id'],previewRecallmeReminderInterval))[_0x1cf2('0x3d')](function(_0x1c8c8e){for(var _0x2d9ef5=0x0;_0x2d9ef5<_0x1c8c8e[_0x1cf2('0x97')];_0x2d9ef5++){var _0x50d0fb=_0x1c8c8e[_0x2d9ef5][_0x1cf2('0x154')]['name'];if(_0x50d0fb)io['to'](util[_0x1cf2('0x77')](_0x1cf2('0x155'),_0x50d0fb))[_0x1cf2('0xdc')]('user:dialPreviewRecallReminder',{'hopper':_0x1c8c8e[_0x2d9ef5]});}})[_0x1cf2('0xb1')](function(_0x48327b){logger[_0x1cf2('0x95')](_0x1cf2('0x152'),_0x48327b);});},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x1cf2('0x156')]=function(_0x43b496){var _0xa1d42d=this;return function(){_0xa1d42d[_0x1cf2('0x157')](_0x43b496);};};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x9')]=function(_0x4a46a6){var _0x2e752b=this;if(isNotPreview(_0x4a46a6[_0x1cf2('0x14c')])){if(isVoiceQueueOutbound(_0x4a46a6[_0x1cf2('0x79')])&&isActive(_0x4a46a6[_0x1cf2('0x58')])){_0x4a46a6[_0x1cf2('0x9f')]=!![];BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](checkIsLoggedIn(_0x4a46a6,_0x4a46a6[_0x1cf2('0x51')]))[_0x1cf2('0x3d')](checkIsActive(_0x4a46a6,_0x4a46a6[_0x1cf2('0x58')]))[_0x1cf2('0x3d')](checkInterval(_0x4a46a6))['then'](_0x2e752b[_0x1cf2('0x158')](_0x4a46a6))[_0x1cf2('0x3d')](_0x2e752b[_0x1cf2('0x137')](_0x4a46a6[_0x1cf2('0x159')],_0x4a46a6[_0x1cf2('0x15a')],_0x4a46a6['name'],_0x4a46a6))['then'](_0x2e752b[_0x1cf2('0x139')](_0x4a46a6['Interval'],_0x4a46a6[_0x1cf2('0x15a')],_0x4a46a6[_0x1cf2('0x41')],_0x4a46a6))[_0x1cf2('0x3d')](_0x2e752b[_0x1cf2('0x14b')](_0x4a46a6))['catch'](loggerCatchQueueSummary(_0x1cf2('0x15b'),_0x4a46a6));}else{notSendMessagesQueue(_0x4a46a6);}}else{freeVariablesPredictive(_0x4a46a6);if(_0x4a46a6[_0x1cf2('0x15c')]){_0x2e752b[_0x1cf2('0x152')](_0x4a46a6);}}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x134')]=function(){var _0x15b78c=this;var _0x351a53;for(var _0x34e9af in this[_0x1cf2('0x20')]){if(typeof this[_0x1cf2('0x20')][_0x34e9af]!=='undefined'){_0x351a53=this[_0x1cf2('0x20')][_0x34e9af];if(isCampaignIvr(_0x351a53[_0x1cf2('0x79')])&&isActive(_0x351a53['active'])){_0x351a53[_0x1cf2('0x9f')]=!![];BPromise[_0x1cf2('0xb6')]()[_0x1cf2('0x3d')](checkIsActive(_0x351a53,_0x351a53['active']))['then'](checkInterval(_0x351a53))[_0x1cf2('0x3d')](_0x15b78c[_0x1cf2('0x158')](_0x351a53))['then'](_0x15b78c['checkIfTime'](_0x351a53[_0x1cf2('0x159')],_0x351a53['dialTimezone'],_0x351a53[_0x1cf2('0x41')],_0x351a53))[_0x1cf2('0x3d')](_0x15b78c[_0x1cf2('0x139')](_0x351a53['Interval'],_0x351a53[_0x1cf2('0x15a')],_0x351a53[_0x1cf2('0x41')],_0x351a53))[_0x1cf2('0x3d')](_0x15b78c[_0x1cf2('0x156')](_0x351a53))[_0x1cf2('0xb1')](loggerCatchQueueSummary('[syncCampaigns]',_0x351a53));}else{notSendMessagesCampaign(_0x351a53);}}}};function getCallerIdRandom(_0x5ed50f,_0x3a1a88){var _0x5dbf16;var _0x483196;var _0xcbf7b3;if(_0x3a1a88<=0x0){_0x3a1a88=0x1;}_0x5dbf16=new RegExp('\x5cw{0,'+_0x3a1a88+'}$');_0x483196=Math[_0x1cf2('0x15d')](0xa,_0x3a1a88-0x1);_0xcbf7b3=Math[_0x1cf2('0x15d')](0xa,_0x3a1a88)-0x1;return util[_0x1cf2('0x77')]('%s',_['replace'](_0x5ed50f,_0x5dbf16,_['random'](_0x483196,_0xcbf7b3)));}function extractCalleridName(_0x380399){var _0x1cfc33=_0x380399[_0x1cf2('0x15e')](/"(.*?)"/);return _0x1cfc33?_0x1cfc33[0x1]:_0x380399;}function extractCalleridNumber(_0x44327f){var _0x3b5a53=_0x44327f['match'](/<(.*?)>/);return _0x3b5a53?_0x3b5a53[0x1]:_0x44327f;}Dialer[_0x1cf2('0x1a')]['actionOriginate']=function(_0x1a0931,_0xf7fd47){var _0x5f126c=this;var _0x114413=uuid['v4']();this[_0x1cf2('0x11c')][_0x114413]=new Action(_0x1a0931,_0xf7fd47,_0x114413);return new BPromise(function(_0x202029,_0x25ce40){if(_[_0x1cf2('0x82')](_0x1a0931)&&typeof _0x1a0931!=='object'){return _0x25ce40(msgResponse(_0x1cf2('0x15f'),'Failure',_0x1cf2('0x160')));}if(_['isUndefined'](_0xf7fd47[_0x1cf2('0x161')][_0x1cf2('0x162')])||_0xf7fd47['Contact'][_0x1cf2('0x162')]===null){return _0x25ce40(msgResponse('originate',_0x1cf2('0x13a'),_0x1cf2('0x163')));}var _0x181bfa={'XMD-CALLERID':_0x5f126c[_0x1cf2('0x11c')][_0x114413]['getCaller'](),'XMD-AGI':_0x1a0931[_0x1cf2('0xff')]?util[_0x1cf2('0x77')](_0x1cf2('0x164'),ipAgi,_0x1a0931[_0x1cf2('0xff')]):_0x1cf2('0x165'),'XMD-AGIAFTER':_0x1a0931[_0x1cf2('0x104')]?util[_0x1cf2('0x77')](_0x1cf2('0x164'),ipAgi,_0x1a0931['dialQueueProject2']):_0x1cf2('0x165'),'XMD-QUEUE':_0x1a0931[_0x1cf2('0x79')]===_0x1cf2('0x4d')?util[_0x1cf2('0x77')](_0x1cf2('0x166'),_0x1a0931['name'],_0x1a0931['dialQueueOptions']||'',_0x1a0931[_0x1cf2('0x105')]?'c':'',_0x1a0931[_0x1cf2('0x10b')]||0x3):_0x1cf2('0x165'),'XMD-CONTACTID':_0xf7fd47[_0x1cf2('0xf7')],'XMD-CDRTYPE':_0x1cf2('0x167'),'CALLERID(all)':_0x5f126c[_0x1cf2('0x11c')][_0x114413][_0x1cf2('0x168')](),'XMD-AMD':_0x1a0931[_0x1cf2('0xd9')]?_0x1cf2('0x169'):_0x1cf2('0x165'),'XMD-DESTINATION':_0x1cf2('0xd8')};if(_0x1a0931['dialAMDActive']){_0x181bfa[_0x1cf2('0x16a')]=_0x1a0931['dialAMDInitialSilence']||0x9c4;_0x181bfa[_0x1cf2('0x16b')]=_0x1a0931[_0x1cf2('0x16c')]||0x5dc;_0x181bfa[_0x1cf2('0x16d')]=_0x1a0931[_0x1cf2('0x16e')]||0x320;_0x181bfa[_0x1cf2('0x16f')]=_0x1a0931[_0x1cf2('0x170')]||0x1388;_0x181bfa[_0x1cf2('0x171')]=_0x1a0931['dialAMDMinWordLength']||0x64;_0x181bfa[_0x1cf2('0x172')]=_0x1a0931[_0x1cf2('0x173')]||0x32;_0x181bfa[_0x1cf2('0x174')]=_0x1a0931[_0x1cf2('0x175')]||0x3;_0x181bfa[_0x1cf2('0x176')]=_0x1a0931[_0x1cf2('0x177')]||0x100;_0x181bfa[_0x1cf2('0x178')]=_0x1a0931['dialAMDMaximumWordLength']||0x1388;}if(_0x1a0931[_0x1cf2('0x79')]===_0x1cf2('0x4d')){_0x181bfa['XMD-VOICEQUEUEID']=_0xf7fd47['VoiceQueueId'];}else{_0x181bfa[_0x1cf2('0x179')]=_0xf7fd47[_0x1cf2('0xcc')];}for(var _0x420bf4 in _0xf7fd47[_0x1cf2('0x161')]){if(typeof _0xf7fd47['Contact'][_0x420bf4]!==_0x1cf2('0x98')){if(isNotNull(_0xf7fd47[_0x1cf2('0x161')][_0x420bf4])&&_0x420bf4!=='id'&&_0x420bf4!==_0x1cf2('0x17a')&&_0x420bf4!==_0x1cf2('0x17b')&&_0x420bf4!==_0x1cf2('0x17c')){_0x181bfa[util[_0x1cf2('0x77')](_0x1cf2('0x17d'),_0x1cf2('0x17e'),_['toUpper'](_0x420bf4))]=_0xf7fd47[_0x1cf2('0x161')][_0x420bf4];}}}var _0x2c3ebe=_0x5f126c[_0x1cf2('0xd0')](_0x1a0931[_0x1cf2('0x74')])?getCallerId(_0x1a0931[_0x1cf2('0x74')][_0x1cf2('0x76')],_0x1a0931[_0x1cf2('0x59')],_0x1a0931[_0x1cf2('0x17f')]>0x0?getCallerIdRandom(_0x1a0931[_0x1cf2('0x180')],_0x1a0931[_0x1cf2('0x17f')]):_0x1a0931[_0x1cf2('0x180')]):getCallerId(_[_0x1cf2('0xae')](_0x1a0931[_0x1cf2('0x181')])?_0x1a0931[_0x1cf2('0x74')]['callerid']:_0x1a0931['TrunkBackup'][_0x1cf2('0x76')],_0x1a0931[_0x1cf2('0x59')],_0x1a0931[_0x1cf2('0x17f')]>0x0?getCallerIdRandom(_0x1a0931[_0x1cf2('0x180')],_0x1a0931[_0x1cf2('0x17f')]):_0x1a0931[_0x1cf2('0x180')]);if(_0x2c3ebe){_0x181bfa['XMD-ORIGINATECALLERIDNAME']=_0x5f126c[_0x1cf2('0x11c')][_0x114413][_0x1cf2('0x182')]=extractCalleridName(_0x2c3ebe);_0x181bfa[_0x1cf2('0x183')]=_0x5f126c[_0x1cf2('0x11c')][_0x114413][_0x1cf2('0x184')]=extractCalleridNumber(_0x2c3ebe);}return ami[_0x1cf2('0xaf')]({'actionid':_0x114413,'action':'originate','channel':_0x5f126c['isTrunkReachable'](_0x1a0931['Trunk'])?util[_0x1cf2('0x77')](_0x1cf2('0x185'),_0x1a0931[_0x1cf2('0x74')][_0x1cf2('0x41')],isNotNull(_0x1a0931[_0x1cf2('0x186')])?_0x1a0931[_0x1cf2('0x186')]['trim']()||'':'',_0x1a0931[_0x1cf2('0x187')]>0x0?_0xf7fd47[_0x1cf2('0x161')]['phone'][_0x1cf2('0x188')](_0x1a0931[_0x1cf2('0x187')]):_0xf7fd47['Contact'][_0x1cf2('0x162')]):util[_0x1cf2('0x77')](_0x1cf2('0x185'),_[_0x1cf2('0xae')](_0x1a0931[_0x1cf2('0x181')])?_0x1a0931['Trunk'][_0x1cf2('0x41')]:_0x1a0931['TrunkBackup']['name'],isNotNull(_0x1a0931[_0x1cf2('0x186')])?_0x1a0931[_0x1cf2('0x186')]['trim']()||'':'',_0x1a0931[_0x1cf2('0x187')]>0x0?_0xf7fd47[_0x1cf2('0x161')][_0x1cf2('0x162')][_0x1cf2('0x188')](_0x1a0931['dialCutDigit']):_0xf7fd47[_0x1cf2('0x161')][_0x1cf2('0x162')]),'callerid':_0x2c3ebe,'Exten':_0x1cf2('0xd8'),'Context':_0x1cf2('0x189'),'Priority':'1','variable':_0x181bfa,'timeout':(_0x1a0931[_0x1cf2('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x114413})[_0x1cf2('0x3d')](function(_0x1a8228){return _0x202029(_0x1a8228);})[_0x1cf2('0xb1')](function(_0x1cb859){_0x1a0931[_0x1cf2('0x64')]+=0x1;var _0x200d76=new History(_0x5f126c[_0x1cf2('0x11c')][_0x114413]);logger[_0x1cf2('0x95')](util[_0x1cf2('0x77')](_0x1cf2('0x18a'),JSON[_0x1cf2('0x127')](_0x1cb859)));_0x200d76[_0x1cf2('0xa5')]=0xe;_0x200d76[_0x1cf2('0xa6')]=_0x1cf2('0x18b');_0x200d76['starttime']=moment()[_0x1cf2('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x200d76[_0x1cf2('0xa7')]=_0x200d76[_0x1cf2('0x111')];_0x5f126c[_0x1cf2('0xc4')](_0x200d76)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x18c')));_0x5f126c['moveContactManagedDialer'](_0x200d76)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x18c')))[_0x1cf2('0x1d')](function(){delete _0x5f126c[_0x1cf2('0x11c')][_0x114413];return _0x25ce40(msgResponse(_0x1cf2('0x15f'),'Error',_0x1cf2('0x18d')));});});});};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x30')]=function(_0x2b8ec7){var _0x3f7b75=this[_0x1cf2('0x11c')][_0x2b8ec7['actionid']];if(_0x3f7b75){delete this['actions'][_0x2b8ec7[_0x1cf2('0x11e')]];_0x3f7b75[_0x1cf2('0x10a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x1f072e=_0x3f7b75[_0x1cf2('0x79')]===_0x1cf2('0x7a')?this[_0x1cf2('0x20')][_0x3f7b75[_0x1cf2('0xb4')]]:this[_0x1cf2('0x1f')][_0x3f7b75[_0x1cf2('0x18e')]()];if(!this[_0x1cf2('0xce')](_0x2b8ec7[_0x1cf2('0x18f')])){this['updateOriginated'](_0x1f072e);return this['callProgressDetecting'](_0x3f7b75,_0x1f072e,_0x2b8ec7)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x190')));}this[_0x1cf2('0xaa')][_0x2b8ec7[_0x1cf2('0xd5')]]=_0x3f7b75;}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x191')]=function(_0x49d124,_0x17c094,_0x332824){var _0x413e95=new History(_0x17c094);if(_0x413e95[_0x1cf2('0xe7')]+_0x413e95['countcongestionretry']+_0x413e95['countnoanswerretry']+_0x413e95[_0x1cf2('0xe9')]+_0x413e95[_0x1cf2('0xea')]+_0x413e95[_0x1cf2('0xeb')]+_0x413e95[_0x1cf2('0xf0')]+_0x413e95[_0x1cf2('0xec')]>=_0x332824['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x49d124){case 0x3:if(_0x413e95[_0x1cf2('0x192')]>=_0x332824['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x1cf2('0xbb')]({'active':![],'countnoanswerretry':_0x413e95[_0x1cf2('0x192')]+=0x1,'scheduledat':moment()['add'](_0x332824[_0x1cf2('0x193')],_0x1cf2('0xf5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x413e95[_0x1cf2('0xf7')],'ListId':_0x413e95[_0x1cf2('0xc9')],'VoiceQueueId':_0x413e95[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x413e95['CampaignId']||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x194')));break;case 0x5:if(_0x413e95[_0x1cf2('0xe7')]>=_0x332824[_0x1cf2('0x195')]-0x1){return!![];}this[_0x1cf2('0xbb')]({'active':![],'countbusyretry':_0x413e95[_0x1cf2('0xe7')]+=0x1,'scheduledat':moment()[_0x1cf2('0xfc')](_0x332824[_0x1cf2('0x196')],'minutes')[_0x1cf2('0x77')](_0x1cf2('0xf6')),'ContactId':_0x413e95[_0x1cf2('0xf7')],'ListId':_0x413e95['ListId'],'VoiceQueueId':_0x413e95[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x413e95[_0x1cf2('0xcc')]||undefined})['catch'](loggerCatch(_0x1cf2('0x197')));break;case 0x8:if(_0x413e95[_0x1cf2('0xe8')]>=_0x332824[_0x1cf2('0x198')]-0x1){return!![];}this[_0x1cf2('0xbb')]({'active':![],'countcongestionretry':_0x413e95[_0x1cf2('0xe8')]+=0x1,'scheduledat':moment()['add'](_0x332824[_0x1cf2('0x199')],_0x1cf2('0xf5'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x413e95[_0x1cf2('0xf7')],'ListId':_0x413e95[_0x1cf2('0xc9')],'VoiceQueueId':_0x413e95['VoiceQueueId']||undefined,'CampaignId':_0x413e95[_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x413e95[_0x1cf2('0xe9')]>=_0x332824[_0x1cf2('0x19a')]-0x1){return!![];}else{this[_0x1cf2('0xbb')]({'active':![],'countnosuchnumberretry':_0x413e95[_0x1cf2('0xe9')]+=0x1,'scheduledat':moment()[_0x1cf2('0xfc')](_0x332824[_0x1cf2('0x19b')],_0x1cf2('0xf5'))[_0x1cf2('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x413e95[_0x1cf2('0xf7')],'ListId':_0x413e95[_0x1cf2('0xc9')],'VoiceQueueId':_0x413e95[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x413e95[_0x1cf2('0xcc')]||undefined})['catch'](loggerCatch(_0x1cf2('0x19c')));}break;case 0xa:if(_0x413e95[_0x1cf2('0xea')]>=_0x332824[_0x1cf2('0x19d')]-0x1){return!![];}this[_0x1cf2('0xbb')]({'active':![],'countdropretry':_0x413e95[_0x1cf2('0xea')]+=0x1,'scheduledat':moment()['add'](_0x332824['dialDropRetryFrequency'],_0x1cf2('0xf5'))[_0x1cf2('0x77')](_0x1cf2('0xf6')),'ContactId':_0x413e95[_0x1cf2('0xf7')],'ListId':_0x413e95[_0x1cf2('0xc9')],'VoiceQueueId':_0x413e95[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x413e95[_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x10f')));break;case 0xb:if(_0x413e95['countabandonedretry']>=_0x332824[_0x1cf2('0x118')]-0x1){return!![];}this[_0x1cf2('0xbb')]({'active':![],'countabandonedretry':_0x413e95['countabandonedretry']+=0x1,'scheduledat':moment()[_0x1cf2('0xfc')](_0x332824[_0x1cf2('0x119')],_0x1cf2('0xf5'))['format'](_0x1cf2('0xf6')),'ContactId':_0x413e95[_0x1cf2('0xf7')],'ListId':_0x413e95[_0x1cf2('0xc9')],'VoiceQueueId':_0x413e95[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x413e95[_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x11a')));break;case 0x13:if(_0x413e95[_0x1cf2('0xf0')]>=_0x332824[_0x1cf2('0xf1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x413e95[_0x1cf2('0xf0')]+=0x1,'scheduledat':moment()[_0x1cf2('0xfc')](_0x332824[_0x1cf2('0xf4')],_0x1cf2('0xf5'))[_0x1cf2('0x77')](_0x1cf2('0xf6')),'ContactId':_0x413e95['ContactId'],'ListId':_0x413e95[_0x1cf2('0xc9')],'VoiceQueueId':_0x413e95[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x413e95[_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xf8')));break;case 0x14:if(_0x413e95[_0x1cf2('0xec')]>=_0x332824[_0x1cf2('0x19e')]-0x1){return!![];}this[_0x1cf2('0xbb')]({'active':![],'countagentrejectretry':_0x413e95[_0x1cf2('0xec')]+=0x1,'scheduledat':moment()['add'](_0x332824['dialAgentRejectRetryFrequency'],'minutes')[_0x1cf2('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x413e95[_0x1cf2('0xf7')],'ListId':_0x413e95[_0x1cf2('0xc9')],'VoiceQueueId':_0x413e95[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x413e95[_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x19f')));break;default:return!![];}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x1a0')]=function(_0xec204,_0x43863e,_0x12dbf9){var _0x114c9f=this;var _0x49bb9d=new History(_0xec204);return new BPromise(function(_0x297eab,_0x2f73b8){if(_[_0x1cf2('0x82')](_0x43863e)&&typeof _0x43863e!==_0x1cf2('0x1a1')){return _0x2f73b8(msgResponse(_0x1cf2('0x1a2'),'Failure',_0x1cf2('0x1a3')));}if(_[_0x1cf2('0x82')](_0x12dbf9)&&typeof _0x12dbf9!==_0x1cf2('0x1a1')){return _0x2f73b8(msgResponse(_0x1cf2('0x1a2'),_0x1cf2('0x13a'),_0x1cf2('0x1a4')));}switch(_0x12dbf9[_0x1cf2('0x102')]){case'0':_0x43863e[_0x1cf2('0x1a5')]+=0x1;_0x49bb9d[_0x1cf2('0xa5')]=0x0;_0x49bb9d[_0x1cf2('0xa6')]='NoSuchNumber';_0x49bb9d[_0x1cf2('0xe9')]+=0x1;_0x49bb9d[_0x1cf2('0xfb')]+=0x1;ami[_0x1cf2('0xdc')](_0x1cf2('0x1a6'),ut[_0x1cf2('0xde')](_0xec204,_0x1cf2('0x1a7')));_0x114c9f[_0x1cf2('0xc4')](_0x49bb9d)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xe6')));if(_0x114c9f['checkRetriveMax'](0x0,_0xec204,_0x43863e)){if(_0x49bb9d[_0x1cf2('0xe9')]>=_0x43863e[_0x1cf2('0x19a')]){_0x114c9f[_0x1cf2('0xf2')](_0x49bb9d,_0x297eab,_0x2f73b8,'reason\x200\x20no\x20such\x20number....');}else{_0x114c9f['stateGlobal'](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1a8'));}}break;case'3':_0x43863e[_0x1cf2('0x63')]+=0x1;_0x49bb9d[_0x1cf2('0xa5')]=0x3;_0x49bb9d[_0x1cf2('0xa6')]=_0x1cf2('0x1a9');_0x49bb9d[_0x1cf2('0x192')]+=0x1;_0x49bb9d[_0x1cf2('0xfb')]+=0x1;ami[_0x1cf2('0xdc')](_0x1cf2('0x1aa'),ut[_0x1cf2('0xde')](_0xec204,_0x1cf2('0x1ab')));_0x114c9f[_0x1cf2('0xc4')](_0x49bb9d)['catch'](loggerCatch(_0x1cf2('0x1ac')));if(_0x114c9f['checkRetriveMax'](0x3,_0xec204,_0x43863e)){if(_0x49bb9d[_0x1cf2('0x192')]>=_0x43863e[_0x1cf2('0x1ad')]){_0x114c9f[_0x1cf2('0xf2')](_0x49bb9d,_0x297eab,_0x2f73b8,'reason\x203\x20ringing\x20no\x20answer');}else{_0x114c9f['stateGlobal'](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1ae'));}}break;case'5':_0x43863e[_0x1cf2('0x5e')]+=0x1;_0x49bb9d[_0x1cf2('0xa5')]=0x5;_0x49bb9d[_0x1cf2('0xa6')]=_0x1cf2('0x1af');_0x49bb9d[_0x1cf2('0xe7')]+=0x1;_0x49bb9d[_0x1cf2('0xfb')]+=0x1;ami[_0x1cf2('0xdc')]('custom:agentbusy',ut[_0x1cf2('0xde')](_0xec204,_0x1cf2('0x1b0')));_0x114c9f[_0x1cf2('0xc4')](_0x49bb9d)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x1b1')));if(_0x114c9f[_0x1cf2('0x191')](0x5,_0xec204,_0x43863e)){if(_0x49bb9d[_0x1cf2('0xe7')]>=_0x43863e[_0x1cf2('0x195')]){_0x114c9f[_0x1cf2('0xf2')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1b2'));}else{_0x114c9f[_0x1cf2('0xee')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1b2'));}}break;case'8':_0x43863e[_0x1cf2('0x5f')]+=0x1;_0x49bb9d['state']=0x8;_0x49bb9d[_0x1cf2('0xa6')]='Congestion';_0x49bb9d[_0x1cf2('0xe8')]+=0x1;_0x49bb9d[_0x1cf2('0xfb')]+=0x1;ami[_0x1cf2('0xdc')]('custom:agentcongestion',ut[_0x1cf2('0xde')](_0xec204,_0x1cf2('0x1b3')));_0x114c9f[_0x1cf2('0xc4')](_0x49bb9d)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x1b4')));if(_0x114c9f[_0x1cf2('0x191')](0x8,_0xec204,_0x43863e)){if(_0x49bb9d[_0x1cf2('0xe8')]>=_0x43863e[_0x1cf2('0x198')]){_0x114c9f[_0x1cf2('0xf2')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1b5'));}else{_0x114c9f[_0x1cf2('0xee')](_0x49bb9d,_0x297eab,_0x2f73b8,'reason\x208\x20congestion');}}break;case'11':_0x43863e[_0x1cf2('0x1b6')]+=0x1;_0x49bb9d[_0x1cf2('0xa5')]=0xb;_0x49bb9d[_0x1cf2('0xa6')]=_0x1cf2('0x115');_0x49bb9d[_0x1cf2('0xeb')]+=0x1;_0x49bb9d[_0x1cf2('0xfb')]+=0x1;_0x114c9f[_0x1cf2('0xc4')](_0x49bb9d)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x11b')));if(_0x114c9f[_0x1cf2('0x191')](0xb,_0xec204,_0x43863e)){if(_0x49bb9d[_0x1cf2('0xeb')]>=_0x43863e[_0x1cf2('0x118')]){_0x114c9f[_0x1cf2('0xf2')](_0x49bb9d,_0x297eab,_0x2f73b8,'reason\x2011\x20abandoned');}else{_0x114c9f[_0x1cf2('0xee')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1b7'));}}break;case'20':_0x43863e[_0x1cf2('0x66')]+=0x1;_0x49bb9d['state']=0x14;_0x49bb9d['statedesc']=_0x1cf2('0x1b8');_0x49bb9d[_0x1cf2('0xec')]+=0x1;_0x49bb9d[_0x1cf2('0xfb')]+=0x1;ami[_0x1cf2('0xdc')]('custom:agentreject',ut['buildObj'](_0xec204,_0x1cf2('0x1b9')));_0x114c9f[_0x1cf2('0xc4')](_0x49bb9d)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x114c9f[_0x1cf2('0x191')](0x14,_0xec204,_0x43863e)){if(_0x49bb9d['countagentrejectretry']>=_0x43863e[_0x1cf2('0x19e')]){_0x114c9f[_0x1cf2('0xf2')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1ba'));}else{_0x114c9f[_0x1cf2('0xee')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x1cf2('0x1ba'));}}break;default:_0x43863e[_0x1cf2('0x67')]+=0x1;_0x49bb9d['state']=0xc;_0x49bb9d[_0x1cf2('0xa6')]=_0x12dbf9[_0x1cf2('0x102')];_0x114c9f['createHistory'](_0x49bb9d)[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x1bb')));if(_0x114c9f[_0x1cf2('0x191')](_0x12dbf9[_0x1cf2('0x102')],_0xec204,_0x43863e)){if(_0x49bb9d['countbusyretry']+_0x49bb9d['countcongestionretry']+_0x49bb9d[_0x1cf2('0x192')]+_0x49bb9d[_0x1cf2('0xe9')]+_0x49bb9d[_0x1cf2('0xea')]+_0x49bb9d['countabandonedretry']+_0x49bb9d[_0x1cf2('0xf0')]+_0x49bb9d[_0x1cf2('0xec')]>=_0x43863e[_0x1cf2('0xed')]){_0x114c9f[_0x1cf2('0xee')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x12dbf9[_0x1cf2('0x102')]);}else{_0x114c9f[_0x1cf2('0xf2')](_0x49bb9d,_0x297eab,_0x2f73b8,_0x12dbf9[_0x1cf2('0x102')]);}}}});};Dialer['prototype']['stateGlobal']=function(_0x231665,_0x4319d1,_0x349297,_0x183aa5){var _0x5606f9=new Final(_0x231665);_0x5606f9['state']=0xf;_0x5606f9['statedesc']='Global';this['createStateFinal'](_0x5606f9,_0x4319d1,_0x349297,_0x183aa5);};Dialer[_0x1cf2('0x1a')][_0x1cf2('0xf2')]=function(_0x41bcbd,_0x2a2988,_0x27854f,_0x226994){this['moveContactManagedDialer'](_0x41bcbd)[_0x1cf2('0x3d')](function(){return _0x2a2988(msgResponse('[callProgressDetecting]',_0x1cf2('0xcf'),_0x226994));})[_0x1cf2('0xb1')](function(){return _0x27854f(msgResponse('[moveContactManagedDialer][0]',_0x1cf2('0x13a'),_0x1cf2('0x1bc')));});};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x8')]=function(_0x6d75c6){var _0x7ff94c=_0x6d75c6[_0x1cf2('0x1bd')]/0x64;var _0x492870=_0x6d75c6[_0x1cf2('0x62')]/(_0x6d75c6[_0x1cf2('0x62')]+_0x6d75c6[_0x1cf2('0x5c')]);var _0x348b06=Math[_0x1cf2('0x1be')](_0x6d75c6['predictiveIntervalAvailable']*(_0x6d75c6['predictiveIntervalMaxThreshold']/0x64));var _0x3724e8=Math[_0x1cf2('0x1be')](_0x6d75c6[_0x1cf2('0x6f')]*(_0x6d75c6[_0x1cf2('0x1bf')]/0x64));var _0x151672=_0x6d75c6['available']+_0x6d75c6[_0x1cf2('0x54')];var _0x2b9549=Math[_0x1cf2('0x1c0')](_0x6d75c6[_0x1cf2('0x88')]*_0x6d75c6[_0x1cf2('0x73')]*_0x6d75c6[_0x1cf2('0x6e')]*_0x6d75c6[_0x1cf2('0x1c1')]);if(_[_0x1cf2('0x82')](_0x6d75c6[_0x1cf2('0x28')])){if(!_[_0x1cf2('0x82')](_0x6d75c6[_0x1cf2('0x27')])){_0x6d75c6['startPredictive']=undefined;loggerPredictive[_0x1cf2('0x95')]('[startMethodPredictive][StartProgressive]',_0x1cf2('0x1c2'));}if(!_[_0x1cf2('0x82')](_0x6d75c6[_0x1cf2('0x91')])){loggerPredictive[_0x1cf2('0x95')](_0x1cf2('0x1c3'),_0x1cf2('0x1c4'));clearInterval(_0x6d75c6[_0x1cf2('0x91')]);_0x6d75c6[_0x1cf2('0x91')]=undefined;}_0x6d75c6[_0x1cf2('0x28')]=moment()[_0x1cf2('0x77')](_0x1cf2('0xf6'));loggerPredictive[_0x1cf2('0x7c')](_0x6d75c6['name'],'collection\x20data\x20in\x20progressive\x20at',_0x6d75c6[_0x1cf2('0x28')]);this[_0x1cf2('0x14e')](_0x6d75c6,0x1);}else if(ifInterval(_0x6d75c6[_0x1cf2('0x1c5')],_0x6d75c6[_0x1cf2('0x28')])){this['handlePower'](_0x6d75c6,0x1);loggerPredictiveCalls[_0x1cf2('0x7c')](_0x1cf2('0x1c6'),_0x6d75c6['startProgressive'],_0x6d75c6[_0x1cf2('0x41')]);_0x6d75c6[_0x1cf2('0x88')]=0x0;_0x6d75c6[_0x1cf2('0x1c7')]=0x0;}else if(_0x7ff94c<_0x492870&&_0x6d75c6[_0x1cf2('0x1c8')]===_0x1cf2('0x1c9')){freeVariablesPredictive(_0x6d75c6);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x1ca'),_0x1cf2('0x1cb'),_0x492870,_0x1cf2('0x28'),_0x6d75c6[_0x1cf2('0x41')]);}else if(_0x2b9549<_0x6d75c6[_0x1cf2('0x1c7')]&&_0x6d75c6[_0x1cf2('0x1c8')]===_0x1cf2('0x1c9')){freeVariablesPredictive(_0x6d75c6);loggerPredictive['info'](_0x1cf2('0x1cc'),'Max\x20Drop\x20',_0x2b9549,'Drop\x20in\x20this\x20interval',_0x6d75c6['predictiveIntervalErlangCallsDroppedCalls'],_0x1cf2('0x28'),_0x6d75c6[_0x1cf2('0x41')]);}else if(!ifInterval(_0x6d75c6[_0x1cf2('0x1c5')],_0x6d75c6[_0x1cf2('0x28')])&&_['isUndefined'](_0x6d75c6[_0x1cf2('0x27')])&&!_[_0x1cf2('0x82')](_0x6d75c6[_0x1cf2('0x28')])){_0x6d75c6['startPredictive']=moment()[_0x1cf2('0x77')](_0x1cf2('0xf6'));loggerPredictive['info'](_0x6d75c6['name'],'started\x20in\x20predictive\x20at',_0x6d75c6[_0x1cf2('0x27')]);this['averageHandleTime'](_0x6d75c6[_0x1cf2('0x1c5')])[_0x1cf2('0x3d')](this['getDataPredictive'](_0x6d75c6))[_0x1cf2('0x3d')](mergeDataErlangB(_0x6d75c6))[_0x1cf2('0x3d')](this[_0x1cf2('0x1cd')](_0x6d75c6))[_0x1cf2('0xb1')](loggerCatchPredictive(_0x1cf2('0x1ce'),_0x6d75c6));}else if(!ifInterval(_0x6d75c6[_0x1cf2('0x1c5')],_0x6d75c6[_0x1cf2('0x27')])){_0x6d75c6[_0x1cf2('0x1c7')]=0x0;_0x6d75c6['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x1cf2('0x7c')](_0x6d75c6[_0x1cf2('0x41')],_0x1cf2('0x1cf'),_0x6d75c6[_0x1cf2('0x27')]);clearInterval(_0x6d75c6[_0x1cf2('0x91')]);_0x6d75c6[_0x1cf2('0x91')]=undefined;this[_0x1cf2('0xba')](_0x6d75c6[_0x1cf2('0x1c5')])[_0x1cf2('0x3d')](this[_0x1cf2('0x1d0')](_0x6d75c6))['then'](mergeDataErlangB(_0x6d75c6))[_0x1cf2('0x3d')](this[_0x1cf2('0x1cd')](_0x6d75c6))[_0x1cf2('0xb1')](loggerCatchPredictive(_0x1cf2('0x1d1'),_0x6d75c6));}else if(_0x6d75c6[_0x1cf2('0x6f')]&&_0x151672<_0x6d75c6['predictiveIntervalAvailable']-_0x3724e8){freeVariablesPredictive(_0x6d75c6);loggerPredictive[_0x1cf2('0x7c')](_0x6d75c6[_0x1cf2('0x41')],_0x1cf2('0x1d2'),_0x151672,_0x1cf2('0x1d3'),_0x6d75c6[_0x1cf2('0x6f')],'-',_0x3724e8,'=',_0x6d75c6[_0x1cf2('0x6f')]-_0x3724e8,')');}else if(_0x6d75c6[_0x1cf2('0x6f')]&&_0x151672>_0x6d75c6[_0x1cf2('0x6f')]+_0x348b06){freeVariablesPredictive(_0x6d75c6);loggerPredictive[_0x1cf2('0x7c')](_0x6d75c6['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x151672,')\x20are\x20more\x20than\x20threshold\x20(',_0x6d75c6[_0x1cf2('0x6f')],'+',_0x348b06,'=',_0x6d75c6['predictiveIntervalAvailable']+_0x348b06,')');}};Dialer[_0x1cf2('0x1a')]['getDataPredictive']=function(_0x61382e){var _0x5bcc4b=this;return function(_0x4cc431){return new BPromise(function(_0x28b8a7,_0x8734f3){_[_0x1cf2('0x8d')](_0x61382e,_0x4cc431[0x0]);if(checkGetDataPredictive(_0x4cc431[0x0])){var _0x423363=_0x61382e['predictiveIntervalAvailable']=_0x61382e[_0x1cf2('0x54')]+_0x61382e[_0x1cf2('0x50')];var _0x1513f4=_0x61382e['dialPredictiveInterval']*0x3c;var _0x354387=_0x4cc431[0x0][_0x1cf2('0x6a')]+_0x4cc431[0x0][_0x1cf2('0x69')];var _0x5437e1=(_0x4cc431[0x0]['predictiveIntervalAnsweredCalls']+_0x4cc431[0x0][_0x1cf2('0x6c')]+_0x4cc431[0x0][_0x1cf2('0x6b')])/_0x4cc431[0x0]['predictiveIntervalTotalCalls'];_0x61382e[_0x1cf2('0x6e')]=_0x5437e1>0x0?_0x5437e1:0x1;switch(_0x61382e[_0x1cf2('0x1c8')]){case'dropRate':var _0x4cbc0e=_0x61382e[_0x1cf2('0x1bd')]/0x64;return _0x5bcc4b[_0x1cf2('0x1d4')](_0x423363,_0x1513f4,_0x354387,_0x5437e1,_0x4cbc0e)['then'](function(_0x40c5a7){return _0x28b8a7(_0x40c5a7);});case _0x1cf2('0x1d5'):var _0x5973ae=_0x61382e[_0x1cf2('0x1bd')]/0x64;return _0x5bcc4b['busyFactor'](_0x423363,_0x1513f4,_0x354387,_0x5437e1,_0x5973ae)[_0x1cf2('0x3d')](function(_0x1f1e5d){return _0x28b8a7(_0x1f1e5d);});default:return _0x8734f3(msgResponse(_0x1cf2('0x1d6'),_0x1cf2('0x13a'),_0x1cf2('0x1d7')));}}else{return _0x8734f3(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x1d8')]=function(_0x4faeff){var _0x452a6c=this;return function(_0x58bcc3){return new BPromise(function(_0xf13708,_0x325aa5){_[_0x1cf2('0x8d')](_0x4faeff,_0x58bcc3[0x0]);if(checkGetDataPredictive(_0x58bcc3[0x0])){loggerPredictive['info'](JSON['stringify'](_0x58bcc3[0x0]));if(_0x4faeff[_0x1cf2('0x1c8')]===_0x1cf2('0x1c9')){return _0x452a6c[_0x1cf2('0xc2')](_0x4faeff['id'])[_0x1cf2('0x3d')](function(_0x35fe2a){var _0x37683a=_0x4faeff[_0x1cf2('0x51')]-_0x35fe2a[0x0]['outboundQueuePauses'];var _0x5999d9=_0x4faeff['dialPredictiveInterval']*0x3c;var _0x37df59=_0x58bcc3[0x0][_0x1cf2('0x6a')]+_0x58bcc3[0x0]['predictiveIntervalAvgHoldtime'];var _0x309753=(_0x58bcc3[0x0][_0x1cf2('0x68')]+_0x58bcc3[0x0][_0x1cf2('0x6c')]+_0x58bcc3[0x0][_0x1cf2('0x6b')])/_0x58bcc3[0x0]['predictiveIntervalTotalCalls'];var _0x210344=_0x4faeff['dialPredictiveOptimizationPercentage']/0x64;_0x4faeff['predictiveIntervalPauses']=_0x35fe2a[0x0][_0x1cf2('0x1d9')]||0x0;_0x4faeff['predictiveIntervalHitRate']=_0x309753>0x0?_0x309753:0x1;return _0x452a6c[_0x1cf2('0x1d4')](_0x37683a,_0x5999d9,_0x37df59,_0x309753,_0x210344);})[_0x1cf2('0x3d')](function(_0x280ca6){return _0xf13708(_0x280ca6);})['catch'](function(_0x2f99d7){return _0x325aa5(msgResponse(_0x1cf2('0x1da'),'Failure',JSON[_0x1cf2('0x127')](_0x2f99d7)));});}if(_0x4faeff[_0x1cf2('0x1c8')]===_0x1cf2('0x1d5')){return _0x452a6c[_0x1cf2('0xc2')](_0x4faeff['id'])['then'](function(_0x2a934f){var _0x1aac48=_0x4faeff[_0x1cf2('0x51')]-_0x2a934f[0x0][_0x1cf2('0x1d9')];var _0x435576=_0x4faeff[_0x1cf2('0x1c5')]*0x3c;var _0x43db6a=_0x58bcc3[0x0][_0x1cf2('0x6a')]+_0x58bcc3[0x0]['predictiveIntervalAvgHoldtime'];var _0x5ce339=(_0x58bcc3[0x0][_0x1cf2('0x68')]+_0x58bcc3[0x0][_0x1cf2('0x6c')]+_0x58bcc3[0x0][_0x1cf2('0x6b')])/_0x58bcc3[0x0][_0x1cf2('0x70')];var _0x2860eb=_0x4faeff[_0x1cf2('0x1bd')]/0x64;_0x4faeff[_0x1cf2('0x1db')]=_0x2a934f[0x0][_0x1cf2('0x1d9')]||0x0;_0x4faeff[_0x1cf2('0x6e')]=_0x5ce339>0x0?_0x5ce339:0x1;return _0x452a6c[_0x1cf2('0x1dc')](_0x1aac48,_0x435576,_0x43db6a,_0x5ce339,_0x2860eb);})['then'](function(_0x5c5c54){return _0xf13708(_0x5c5c54);})['catch'](function(_0x1c82dc){return _0x325aa5(msgResponse(_0x1cf2('0x1da'),_0x1cf2('0x13a'),JSON[_0x1cf2('0x127')](_0x1c82dc)));});}}else{return _0x325aa5(msgResponse(_0x1cf2('0x1d6'),_0x1cf2('0x13a'),_0x1cf2('0x1dd')));}});};};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x1cd')]=function(_0x2b4f26){var _0x1f5bb3=this;return function(){var _0x3521e5=0x0;var _0xf80d81=Math['floor'](_0x2b4f26['erlangCallToSecond']*0x3e8);if(_0xf80d81>0x0){_0xf80d81=_0xf80d81<0x64?0x64:_0xf80d81;loggerPredictive['info'](_0x2b4f26[_0x1cf2('0x41')],_0x1cf2('0x1de'),_0xf80d81,'milliseconds');_0x2b4f26[_0x1cf2('0x91')]=setInterval(function(){_0x1f5bb3['handlePredictive'](_0x2b4f26);loggerPredictiveCalls['info'](_0x1cf2('0x1df'),_0x3521e5+=0x1);},_0xf80d81);}else{loggerPredictive[_0x1cf2('0x7c')](_0x2b4f26[_0x1cf2('0x41')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x1e0')]=function(_0x1a2a03,_0x5a3dd7){var _0x23c2f8=this;return function(_0x4fb0fc){if(_[_0x1cf2('0x48')](_0x4fb0fc)){if(_[_0x1cf2('0xae')](_0x5a3dd7[_0x1cf2('0xca')])||!_0x5a3dd7[_0x1cf2('0x1e1')]){if(_0x1a2a03[_0x1cf2('0x14c')]==='booked'){_0x1a2a03[_0x1cf2('0x124')]=_[_0x1cf2('0x82')](_0x1a2a03['queueStatusComplete'])?!![]:_0x1a2a03[_0x1cf2('0x124')];var _0x59f3f2=uuid['v4']();_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2]=new Action(_0x1a2a03,_0x5a3dd7,_0x59f3f2);loggerBooked[_0x1cf2('0x7c')]('[booked][checkContactBlack]',_0x59f3f2,_0x1cf2('0x1e2'),JSON[_0x1cf2('0x127')](_0x1a2a03[_0x1cf2('0x124')]),_0x1cf2('0x1e3'),_0x1a2a03[_0x1cf2('0x41')]);if(_0x1a2a03[_0x1cf2('0x124')]){_0x1a2a03[_0x1cf2('0x124')]=![];_0x23c2f8[_0x1cf2('0x122')][_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xb4')]]=[];ami['Action']({'actionid':_0x59f3f2,'action':'queuestatus','queue':_0x1a2a03[_0x1cf2('0x41')]})[_0x1cf2('0xb1')](function(){_0x23c2f8[_0x1cf2('0xb3')](_0x1a2a03);_0x23c2f8[_0x1cf2('0xbb')]({'active':![],'ContactId':_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xf7')],'ListId':_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xc9')],'VoiceQueueId':_0x23c2f8['actions'][_0x59f3f2]['VoiceQueueId']||undefined,'CampaignId':_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x1e4')));delete _0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2];});}else{loggerBooked[_0x1cf2('0x7c')](_0x1cf2('0x1e5'),JSON['stringify'](_0x1a2a03[_0x1cf2('0x124')]),_0x1cf2('0x1e3'),_0x1a2a03[_0x1cf2('0x41')]);_0x23c2f8[_0x1cf2('0xb3')](_0x1a2a03);_0x23c2f8[_0x1cf2('0xbb')]({'active':![],'ContactId':_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xf7')],'ListId':_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xc9')],'VoiceQueueId':_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xcb')]||undefined,'CampaignId':_0x23c2f8[_0x1cf2('0x11c')][_0x59f3f2][_0x1cf2('0xcc')]||undefined})[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0x1e4')));delete _0x23c2f8['actions'][_0x59f3f2];}}else{return _0x23c2f8[_0x1cf2('0x1e6')](_0x1a2a03,_0x5a3dd7);}}else{if(getDiff(_0x5a3dd7[_0x1cf2('0x1e7')])<_0x1a2a03[_0x1cf2('0x1e8')]*0x3c){if(_0x5a3dd7[_0x1cf2('0x154')]&&!_0x5a3dd7[_0x1cf2('0x154')]['voicePause']){_0x23c2f8['preview'][_0x1cf2('0x129')](_0x5a3dd7['id'])[_0x1cf2('0x1d')](function(){_0x23c2f8[_0x1cf2('0xb3')](_0x1a2a03);});}else{_0x23c2f8['unlockContact']({'active':![]},_0x5a3dd7['id'],0x1)[_0x1cf2('0x1d')](function(){_0x23c2f8['updateOriginated'](_0x1a2a03);});}}else{_0x1a2a03[_0x1cf2('0x65')]+=0x1;_0x23c2f8[_0x1cf2('0xb3')](_0x1a2a03);if(_0x1a2a03[_0x1cf2('0x1e9')]){_0x23c2f8[_0x1cf2('0xbb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a3dd7['ContactId'],'ListId':_0x5a3dd7['ListId'],'VoiceQueueId':_0x5a3dd7[_0x1cf2('0xcb')]||undefined,'CampaignId':_0x5a3dd7['CampaignId']||undefined})['catch'](loggerCatch(_0x1cf2('0x1ea')));_0x23c2f8['createHistory'](createObjHistory(_0x1a2a03,_0x5a3dd7,_0x1cf2('0x1eb'),0x17,_0x1cf2('0x1ec')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x23c2f8[_0x1cf2('0xd3')](createObjHistory(_0x1a2a03,_0x5a3dd7,'RECALLFAILEDTIMEOUT',0x16,_0x1cf2('0x1ed')),_0x1cf2('0x1ee'),_0x1cf2('0x1ef'));}}}}else{_0x1a2a03[_0x1cf2('0x5d')]+=0x1;_0x23c2f8[_0x1cf2('0xd3')](createObjHistory(_0x1a2a03,_0x5a3dd7,_0x1cf2('0x1f0'),0xd,_0x1cf2('0x1f1')),_0x1cf2('0x1f2'),_0x1cf2('0x1f3'));throw _0x1cf2('0x1f4');}};};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x157')]=function(_0x3d1ea3){var _0xf1ae12=this;var _0x3d113d=_0x3d1ea3[_0x1cf2('0x1f5')]-_0x3d1ea3[_0x1cf2('0x71')]-_0x3d1ea3[_0x1cf2('0xbe')];emitCampaignSummary(_0x3d1ea3);if(_0x3d113d>0x0){if(_0x3d113d>this['maxNumberOriginate']){_0x3d113d=this['maxNumberOriginate'];}_0x3d1ea3[_0x1cf2('0xbe')]+=_0x3d113d;this[_0x1cf2('0xc0')](_0x3d1ea3['id'],_0x3d113d,_0x3d1ea3[_0x1cf2('0x1f6')],_0x3d1ea3)[_0x1cf2('0x3d')](function(_0x885892){_0x3d1ea3['temp']-=_0x3d113d;_0x3d1ea3[_0x1cf2('0xbe')]=_0x3d1ea3[_0x1cf2('0xbe')]>0x0?_0x3d1ea3[_0x1cf2('0xbe')]:0x0;if(!checkContactEmpty(_0x885892)){_0x3d1ea3['message']=_0x1cf2('0x9d');logger[_0x1cf2('0x7c')](_0x1cf2('0x1f7')+_0x3d1ea3[_0x1cf2('0x41')]);}else{_0x3d1ea3[_0x1cf2('0x71')]+=_0x885892[_0x1cf2('0x97')];_0x3d1ea3['message']=_0x1cf2('0x1f8');for(var _0x53bf8b=0x0;_0x53bf8b<_0x885892[_0x1cf2('0x97')];_0x53bf8b+=0x1){_0x3d1ea3[_0x1cf2('0x1f9')]+=0x1;if(_[_0x1cf2('0xae')](_0x885892[_0x53bf8b])||_['isNil'](_0x885892[_0x53bf8b]['Contact'])||_[_0x1cf2('0xae')](_0x885892[_0x53bf8b][_0x1cf2('0x161')]['phone'])){_0xf1ae12[_0x1cf2('0xc8')](_0x1cf2('0x1fa'),_0x3d1ea3,_0x885892[_0x53bf8b]);}else{_0xf1ae12[_0x1cf2('0xb9')](_['pick'](_0x885892[_0x53bf8b],[_0x1cf2('0xcc'),_0x1cf2('0x1fb')]))[_0x1cf2('0x3d')](_0xf1ae12[_0x1cf2('0x1e0')](_0x3d1ea3,_0x885892[_0x53bf8b]))[_0x1cf2('0xb1')](_0xf1ae12['loggerHandler'](_0x1cf2('0x1fc'),_0x3d1ea3));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x3d1ea3,_0x3d113d));}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x14e')]=function(_0x244e85,_0x2a0d26){var _0x32571c=this;var _0x149f1f=[];var _0x8325cb=_0x2a0d26>=0x1?_0x2a0d26:0x1;if(_0x244e85[_0x1cf2('0x14c')]===_0x1cf2('0x150')){_0x8325cb=0x1;}var _0x2f9ff3=Math[_0x1cf2('0x1c0')](_0x244e85['available']*_0x8325cb)-_0x244e85['originated']-_0x244e85[_0x1cf2('0xbe')];emitVoiceQueueSummary(_0x244e85);if(_0x244e85[_0x1cf2('0x1fd')]>0x0){var _0x2ed015=_0x244e85['dialLimitQueue']-_0x244e85[_0x1cf2('0x71')]-_0x244e85[_0x1cf2('0x54')]-_0x244e85[_0x1cf2('0xbe')]-_0x244e85[_0x1cf2('0x52')];if(_0x2f9ff3>_0x2ed015){_0x2f9ff3=_0x2ed015;}}if(_0x2f9ff3>0x0){if(_0x244e85[_0x1cf2('0x14c')]===_0x1cf2('0x150')){_0x2f9ff3=0x1;}if(_0x2f9ff3>this[_0x1cf2('0x23')]){_0x2f9ff3=this[_0x1cf2('0x23')];}_0x244e85['temp']+=_0x2f9ff3;for(var _0x4aed62 in this['agents']){if(typeof this[_0x1cf2('0x21')][_0x4aed62]!=='undefined'){if(this[_0x1cf2('0x21')][_0x4aed62][_0x1cf2('0xa5')]===_0x1cf2('0x1fe')&&this[_0x1cf2('0x21')][_0x4aed62][_0x1cf2('0xb0')]===_0x1cf2('0xd2')){_0x149f1f[_0x1cf2('0x141')](this[_0x1cf2('0x21')][_0x4aed62]['id']);}}}this[_0x1cf2('0x1ff')](_0x244e85['id'],_0x149f1f,_0x2f9ff3,_0x244e85[_0x1cf2('0x1f6')],_0x244e85)[_0x1cf2('0x3d')](function(_0x5e5c0d){_0x244e85[_0x1cf2('0xbe')]-=_0x2f9ff3;_0x244e85[_0x1cf2('0xbe')]=_0x244e85[_0x1cf2('0xbe')]>0x0?_0x244e85[_0x1cf2('0xbe')]:0x0;if(!checkContactEmpty(_0x5e5c0d)){_0x32571c['countReScheduled'](_0x244e85)[_0x1cf2('0x3d')](sendMessageReschedule(_0x244e85))[_0x1cf2('0xb1')](loggerCatch(_0x1cf2('0xb7')));}else{_0x244e85[_0x1cf2('0x71')]+=_0x5e5c0d[_0x1cf2('0x97')];_0x244e85[_0x1cf2('0x3f')]=_0x244e85['dialMethod']===_0x1cf2('0x150')?_0x1cf2('0x169'):_0x1cf2('0x1f8');for(var _0x274057=0x0;_0x274057<_0x5e5c0d['length'];_0x274057+=0x1){if(_[_0x1cf2('0xae')](_0x5e5c0d[_0x274057])||_['isNil'](_0x5e5c0d[_0x274057][_0x1cf2('0x161')])||_[_0x1cf2('0xae')](_0x5e5c0d[_0x274057][_0x1cf2('0x161')][_0x1cf2('0x162')])){_0x32571c[_0x1cf2('0xc8')](_0x1cf2('0x1fa'),_0x244e85,_0x5e5c0d[_0x274057]);}else{_0x32571c[_0x1cf2('0xb8')](_[_0x1cf2('0x128')](_0x5e5c0d[_0x274057],[_0x1cf2('0xcb'),'Contact.phone']))[_0x1cf2('0x3d')](_0x32571c[_0x1cf2('0x1e0')](_0x244e85,_0x5e5c0d[_0x274057]))[_0x1cf2('0xb1')](_0x32571c['loggerHandler'](_0x1cf2('0x1fa'),_0x244e85));}}}})[_0x1cf2('0xb1')](loggerGetContactDialer(_0x1cf2('0x200'),_0x244e85,_0x2f9ff3));}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x91')]=function(_0x5b8f30){if(_0x5b8f30['dialLimitQueue']>0x0){var _0x4e14ff=_0x5b8f30[_0x1cf2('0x1fd')]-_0x5b8f30['originated']-_0x5b8f30[_0x1cf2('0x54')];if(_0x4e14ff>0x0){this['tryOriginatePredictive'](_0x5b8f30);}else{loggerPredictiveCalls[_0x1cf2('0x7c')]('[handlePredictive][limitChannel]');}}else{this[_0x1cf2('0x201')](_0x5b8f30);}};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x201')]=function(_0x1ca739){var _0x172f0e=this;var _0x4bddb9=[];_0x1ca739[_0x1cf2('0x71')]+=0x1;for(var _0x321962 in this[_0x1cf2('0x21')]){if(typeof this[_0x1cf2('0x21')][_0x321962]!==_0x1cf2('0x98')){if(this['agents'][_0x321962][_0x1cf2('0xa5')]===_0x1cf2('0x1fe')&&this['agents'][_0x321962][_0x1cf2('0xb0')]===_0x1cf2('0xd2')){_0x4bddb9[_0x1cf2('0x141')](this[_0x1cf2('0x21')][_0x321962]['id']);}}}this[_0x1cf2('0x1ff')](_0x1ca739['id'],_0x4bddb9,0x1,_0x1ca739[_0x1cf2('0x1f6')],_0x1ca739)[_0x1cf2('0x3d')](function(_0x129f4e){if(!checkContactEmpty(_0x129f4e)){checkContactLowerLimitOriginate(_0x1ca739,0x1,0x0);_0x172f0e[_0x1cf2('0xb5')](_0x1ca739)[_0x1cf2('0x3d')](sendMessageReschedule(_0x1ca739))['catch'](loggerCatch(_0x1cf2('0xb7')));}else{_0x1ca739[_0x1cf2('0x3f')]=_0x1cf2('0x1f8');if(_[_0x1cf2('0xae')](_0x129f4e[0x0])||_[_0x1cf2('0xae')](_0x129f4e[0x0][_0x1cf2('0x161')])||_[_0x1cf2('0xae')](_0x129f4e[0x0][_0x1cf2('0x161')][_0x1cf2('0x162')])){_0x172f0e[_0x1cf2('0xc8')](_0x1cf2('0x1fa'),_0x1ca739,_0x129f4e[0x0]);}else{_0x172f0e[_0x1cf2('0xb8')](_[_0x1cf2('0x128')](_0x129f4e[0x0],[_0x1cf2('0xcb'),_0x1cf2('0x1fb')]))[_0x1cf2('0x3d')](_0x172f0e['checkContactBlack'](_0x1ca739,_0x129f4e[0x0]))[_0x1cf2('0xb1')](_0x172f0e[_0x1cf2('0xc7')](_0x1cf2('0x202'),_0x1ca739));}}})[_0x1cf2('0xb1')](loggerGetContactDialer(_0x1cf2('0x203'),_0x1ca739,0x1));emitVoiceQueueSummary(_0x1ca739);};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x1d4')]=function(_0x13fe01,_0x29d7ca,_0x1af39b,_0x101a47,_0x4332ae,_0x6d9054){loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x204'));loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x205'),_0x13fe01);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x206'),_0x29d7ca);loggerPredictive['info'](_0x1cf2('0x207'),_0x1af39b);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x208'),_0x101a47);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x209'),_0x4332ae);loggerPredictive[_0x1cf2('0x7c')]('---------------------------');return new BPromise(function(_0x5e6e82,_0x3eaa35){if(_0x13fe01<=0x0||isNaN(_0x13fe01)){return _0x3eaa35(msgResponse(_0x1cf2('0x20a'),_0x1cf2('0x20b'),_0x1cf2('0x20c')+_0x13fe01));}if(_0x1af39b<=0x0||isNaN(_0x1af39b)){return _0x3eaa35(msgResponse('[abandonmentRate]','Error','Ts\x20=\x20'+_0x1af39b));}if(_0x101a47<=0x0||isNaN(_0x101a47)){return _0x3eaa35(msgResponse(_0x1cf2('0x20a'),_0x1cf2('0x20b'),_0x1cf2('0x20d')+_0x101a47));}if(_0x29d7ca<=0x0||isNaN(_0x29d7ca)){return _0x3eaa35(msgResponse(_0x1cf2('0x20a'),_0x1cf2('0x20b'),_0x1cf2('0x20e')+_0x29d7ca));}if(_0x4332ae<=0x0||isNaN(_0x4332ae)){return _0x3eaa35(msgResponse('[abandonmentRate]',_0x1cf2('0x20b'),_0x1cf2('0x20f')+_0x4332ae));}_0x6d9054=_0x6d9054||0x0;var _0x3a56b9=0x1/_0x1af39b;var _0x1932ab=0x0;var _0x1a886e=0x0;var _0x3716bb=0x0;var _0x4dda5c=0x0;for(var _0x13cd2f=0x0;_0x3716bb<_0x4332ae;_0x13cd2f+=0x1){_0x1a886e=_0x13cd2f/_0x29d7ca;_0x1932ab=(_0x101a47*_0x1a886e+_0x6d9054)/_0x3a56b9;_0x3716bb=erlangb(_0x1932ab,_0x13fe01);_0x4dda5c=_0x1932ab/_0x13fe01*(0x1-erlangb(_0x1932ab,_0x13fe01));}return _0x5e6e82({'erlangCalls':_0x13cd2f,'erlangCallToSecond':_0x29d7ca/_0x13cd2f,'erlangAbandonmentRate':_0x3716bb,'erlangBusyFactor':_0x4dda5c});});};Dialer[_0x1cf2('0x1a')][_0x1cf2('0x1dc')]=function(_0x5717c0,_0x2f83ee,_0x575a95,_0x2b0227,_0x3a619e,_0x375e9f){loggerPredictive[_0x1cf2('0x7c')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x1cf2('0x7c')]('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',_0x5717c0);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x206'),_0x2f83ee);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x575a95);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x208'),_0x2b0227);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x210'),_0x3a619e);loggerPredictive[_0x1cf2('0x7c')](_0x1cf2('0x8c'));return new BPromise(function(_0x13de6a,_0x5b2c47){if(_0x5717c0<=0x0||isNaN(_0x5717c0)){return _0x5b2c47(msgResponse(_0x1cf2('0x211'),_0x1cf2('0x20b'),_0x1cf2('0x20c')+_0x5717c0));}if(_0x575a95<=0x0||isNaN(_0x575a95)){return _0x5b2c47(msgResponse(_0x1cf2('0x211'),_0x1cf2('0x20b'),_0x1cf2('0x212')+_0x575a95));}if(_0x2b0227<=0x0||isNaN(_0x2b0227)){return _0x5b2c47(msgResponse('[busyFactor]',_0x1cf2('0x20b'),'p\x20=\x20'+_0x2b0227));}if(_0x2f83ee<=0x0||isNaN(_0x2f83ee)){return _0x5b2c47(msgResponse(_0x1cf2('0x211'),_0x1cf2('0x20b'),'interval\x20=\x20'+_0x2f83ee));}if(_0x3a619e<=0x0||isNaN(_0x3a619e)){return _0x5b2c47(msgResponse(_0x1cf2('0x211'),'Error',_0x1cf2('0x213')+_0x3a619e));}_0x375e9f=_0x375e9f||0x0;var _0x3c63b9=0x1/_0x575a95;var _0x1700c8=0x0;var _0x2af787=0x0;var _0x35fb16=0x0;var _0x5c7e6e=0x0;for(var _0x104313=0x0;_0x5c7e6e<_0x3a619e;_0x104313+=0x1){_0x2af787=_0x104313/_0x2f83ee;_0x1700c8=(_0x2b0227*_0x2af787+_0x375e9f)/_0x3c63b9;_0x35fb16=erlangb(_0x1700c8,_0x5717c0);_0x5c7e6e=_0x1700c8/_0x5717c0*(0x1-erlangb(_0x1700c8,_0x5717c0));}return _0x13de6a({'erlangCalls':_0x104313,'erlangCallToSecond':_0x2f83ee/_0x104313,'erlangAbandonmentRate':_0x35fb16,'erlangBusyFactor':_0x5c7e6e});});};module[_0x1cf2('0x214')]=Dialer; \ No newline at end of file +var _0x17ff=['isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','membername','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','YYYY-MM-DD\x20HH:mm:ss','ListId','CampaignId','stateGlobal','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','syncHangup','dialQueueProject','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','outboundUnknownCallsDay','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','paused','locked','stateinterface','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','online','log','checkPreviewRecallReminder\x20availableAgentsIds','handlePreviewRecallNotifications','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','launchHandleIvr','handleIvr','dialGlobalInterval','checkDialMethod','[syncQueueSummary]','checkIsTrunkReachable','dialTimezone','\x5cw{0,','pow','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','checkRetriveMax','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','outboundAbandonedCallsDay','dialAbandonedMaxRetry','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','loggedIn','check\x20failure','startMethodPredictive','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','countReScheduled','ACTIVE','[getContactDialer2]','tryOriginatePredictive','not_inuse','[getContactDialerPredictive]','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','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','util','uuid','moment','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncAgentComplete','custom:queuesummary','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','milliseconds','diff','emit','outbound','strategy','answered','available','sumBillable','sumDuration','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCallToSecond','Trunk','active','stringify','md5','format','type','ivr','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','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','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---------','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','stack','error','length','undefined','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','pTalking','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success'];(function(_0x82daf4,_0x1e4256){var _0x47b7ae=function(_0x9c120c){while(--_0x9c120c){_0x82daf4['push'](_0x82daf4['shift']());}};_0x47b7ae(++_0x1e4256);}(_0x17ff,0x13f));var _0xf17f=function(_0x10d7cb,_0x36abd2){_0x10d7cb=_0x10d7cb-0x0;var _0x3211d4=_0x17ff[_0x10d7cb];return _0x3211d4;};'use strict';var util=require(_0xf17f('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xf17f('0x1'));var moment=require(_0xf17f('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0xf17f('0x3'));var config=require(_0xf17f('0x4'));var logger=require(_0xf17f('0x5'))(_0xf17f('0x6'));var loggerBooked=require('../../../config/logger')(_0xf17f('0x7'));var loggerPredictive=require(_0xf17f('0x5'))(_0xf17f('0x8'));var loggerPredictiveCalls=require(_0xf17f('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xf17f('0x5'))(_0xf17f('0x9'));var ami=require(_0xf17f('0xa'));config[_0xf17f('0xb')]=_[_0xf17f('0xc')](config[_0xf17f('0xb')],{'host':_0xf17f('0xd'),'port':0x18eb});var io=require(_0xf17f('0xe'))(new Redis(config[_0xf17f('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xf17f('0xf'));var cmHopperBlack=require(_0xf17f('0x10'));var voiceQueueRt=require(_0xf17f('0x11'));var RpcSetting=require(_0xf17f('0x12'));var Action=require(_0xf17f('0x13'));var History=require(_0xf17f('0x14'));var Final=require(_0xf17f('0x15'));var AgentComplete=require(_0xf17f('0x16'));var QueueCallerAbandon=require(_0xf17f('0x17'));var Hangup=require(_0xf17f('0x18'));var ipAgi=process['env'][_0xf17f('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0xf17f('0x1a'),'roundrobin':_0xf17f('0x1b')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xf17f('0x1c')][_0xf17f('0x1d')]=function(_0x4bca50){this[_0xf17f('0x1e')]=this[_0xf17f('0x1e')]?this[_0xf17f('0x1e')][_0xf17f('0x1f')](_0x4bca50):_0x4bca50();};function Dialer(_0x391b8d,_0x3d423d){this[_0xf17f('0x20')]=new Sequence();this[_0xf17f('0x21')]=_0x3d423d;this[_0xf17f('0x22')]=_0x391b8d[_0xf17f('0x22')];this[_0xf17f('0x23')]=_0x391b8d[_0xf17f('0x23')];this['agents']=_0x391b8d[_0xf17f('0x24')];this[_0xf17f('0x25')]=_0x391b8d['trunks'];this[_0xf17f('0x26')]=config[_0xf17f('0x26')]||0x2;this[_0xf17f('0x27')]={};this[_0xf17f('0x28')]={};this[_0xf17f('0x29')]={};this[_0xf17f('0x2a')]={};this[_0xf17f('0x2b')]={};this[_0xf17f('0x2c')]={};this[_0xf17f('0x2d')]={};this[_0xf17f('0x2e')]={};this[_0xf17f('0x2f')]={};this[_0xf17f('0x30')]={};ami['on'](_0xf17f('0x31'),this[_0xf17f('0x32')][_0xf17f('0x33')](this));ami['on'](_0xf17f('0x34'),this['syncQueueCallerAbandon'][_0xf17f('0x33')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on']('agentcomplete',this[_0xf17f('0x35')]['bind'](this));ami['on'](_0xf17f('0x36'),this[_0xf17f('0x9')][_0xf17f('0x33')](this));ami['on']('hangup',this['syncHangup'][_0xf17f('0x33')](this));ami['on']('newexten',this[_0xf17f('0x37')][_0xf17f('0x33')](this));ami['on'](_0xf17f('0x38'),this[_0xf17f('0x39')][_0xf17f('0x33')](this));ami['on'](_0xf17f('0x3a'),this[_0xf17f('0x3b')][_0xf17f('0x33')](this));ami['on'](_0xf17f('0x3c'),this['syncQueueStatusComplete']['bind'](this));this[_0xf17f('0x3d')]();this[_0xf17f('0x3e')]();RpcSetting[_0xf17f('0x3f')]()[_0xf17f('0x40')](function(_0x11c90d){previewRecallmeReminderInterval=_0x11c90d[_0xf17f('0x41')];});}function isNotNull(_0x22cbee){return _0x22cbee!==null&&!_[_0xf17f('0x42')](_0x22cbee);}function checkIsLoggedIn(_0x3b4a09,_0x382b02){return function(){if(_0x382b02<=0x0){_0x3b4a09[_0xf17f('0x43')]=_0xf17f('0x44');throw _0x3b4a09[_0xf17f('0x45')]+_0xf17f('0x46');}};}function isActive(_0x3d0c80){return _0x3d0c80;}function checkIsActive(_0x190423,_0x134ae8){return function(){if(!isActive(_0x134ae8)){_0x190423['message']=_0xf17f('0x47');throw _0x190423[_0xf17f('0x45')]+_0xf17f('0x48');}};}function checkInterval(_0x3426de){return function(){if(!isNotNull(_0x3426de[_0xf17f('0x49')])){_0x3426de[_0xf17f('0x43')]='INTERVAL_IS_NULL';throw _0x3426de['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3426de['Interval'][_0xf17f('0x4a')])){_0x3426de[_0xf17f('0x43')]=_0xf17f('0x4b');throw _0x3426de[_0xf17f('0x45')]+_0xf17f('0x4c');}if(!isNotNull(_[_0xf17f('0x4d')](_0x3426de['Interval'][_0xf17f('0x4a')]))){_0x3426de['message']=_0xf17f('0x4b');throw _0x3426de[_0xf17f('0x45')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x356a34,_0x54bca6,_0x48c568){return{'action':_0x356a34,'response':_0x54bca6,'message':_0x48c568,'stack':_0x48c568};}function myreject(_0x479f33){return function(_0x3c1930){return _0x479f33(msgResponse(_0xf17f('0x4e'),_0xf17f('0x4f'),JSON['stringify'](_0x3c1930)));};}function getSeconds(_0x1f4e6f,_0x59eda7){var _0x3d9c86=moment(_0x1f4e6f)[_0xf17f('0x50')](0x0);var _0x29bf6a=moment(_0x59eda7)['milliseconds'](0x0);return _0x3d9c86[_0xf17f('0x51')](_0x29bf6a,'seconds');}function emit(_0x4f21d8,_0x115e76,_0x36ec0f){io['to'](_0x4f21d8)[_0xf17f('0x52')](_0x115e76,_0x36ec0f);}function emitVoiceQueueSummary(_0x28fa3f){if(_0x28fa3f['type']===_0xf17f('0x53')){var _0x3ce10c={'id':_0x28fa3f['id'],'name':_0x28fa3f['name'],'strategy':_0x28fa3f[_0xf17f('0x54')],'answered':_0x28fa3f[_0xf17f('0x55')],'available':_0x28fa3f[_0xf17f('0x56')],'loggedIn':_0x28fa3f['loggedIn'],'pTalking':_0x28fa3f['pTalking'],'sumBillable':_0x28fa3f[_0xf17f('0x57')],'sumDuration':_0x28fa3f[_0xf17f('0x58')],'sumHoldTime':_0x28fa3f['sumHoldTime']||0x0,'talking':_0x28fa3f[_0xf17f('0x59')],'total':_0x28fa3f[_0xf17f('0x5a')],'type':_0x28fa3f['type'],'unmanaged':_0x28fa3f[_0xf17f('0x5b')],'abandoned':_0x28fa3f[_0xf17f('0x5c')],'waiting':_0x28fa3f[_0xf17f('0x5d')],'loggedInDb':_0x28fa3f[_0xf17f('0x5e')],'dialActive':_0x28fa3f[_0xf17f('0x5f')],'dialMethod':_0x28fa3f[_0xf17f('0x60')],'dialOriginateCallerIdName':_0x28fa3f[_0xf17f('0x61')],'dialOriginateCallerIdNumber':_0x28fa3f[_0xf17f('0x62')],'dialOriginateTimeout':_0x28fa3f['dialOriginateTimeout'],'dialPrefix':_0x28fa3f[_0xf17f('0x63')],'outboundAnswerAgiCallsDay':_0x28fa3f[_0xf17f('0x64')],'outboundAnswerCallsDay':_0x28fa3f['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x28fa3f['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x28fa3f[_0xf17f('0x65')],'outboundCongestionCallsDay':_0x28fa3f[_0xf17f('0x66')],'outboundDropCallsDayACS':_0x28fa3f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x28fa3f[_0xf17f('0x67')],'outboundDropCallsDayTimeout':_0x28fa3f[_0xf17f('0x68')],'outboundNoAnswerCallsDay':_0x28fa3f[_0xf17f('0x69')],'outboundNoSuchCallsDay':_0x28fa3f[_0xf17f('0x6a')],'outboundOriginateFailureCallsDay':_0x28fa3f[_0xf17f('0x6b')],'outboundReCallsDay':_0x28fa3f['outboundReCallsDay'],'outboundRejectCallsDay':_0x28fa3f[_0xf17f('0x6c')],'outboundUnknownCallsDay':_0x28fa3f['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x28fa3f[_0xf17f('0x6d')],'predictiveIntervalAvgHoldtime':_0x28fa3f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x28fa3f['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x28fa3f[_0xf17f('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x28fa3f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x28fa3f[_0xf17f('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x28fa3f[_0xf17f('0x70')],'predictiveIntervalHitRate':_0x28fa3f[_0xf17f('0x71')],'predictiveIntervalMultiplicativeFactor':_0x28fa3f[_0xf17f('0x72')],'predictiveIntervalPauses':_0x28fa3f[_0xf17f('0x73')],'predictiveIntervalAvailable':_0x28fa3f[_0xf17f('0x74')],'predictiveIntervalTotalCalls':_0x28fa3f[_0xf17f('0x75')],'message':_0x28fa3f[_0xf17f('0x43')],'originated':_0x28fa3f['originated'],'erlangCalls':_0x28fa3f['erlangCalls'],'erlangCallToSecond':_0x28fa3f[_0xf17f('0x76')],'erlangAbandonmentRate':_0x28fa3f['erlangAbandonmentRate'],'erlangBusyFactor':_0x28fa3f['erlangBusyFactor'],'startPredictive':_0x28fa3f['startPredictive'],'startProgressive':_0x28fa3f[_0xf17f('0x2d')]};if(_0x28fa3f[_0xf17f('0x77')]){_0x3ce10c[_0xf17f('0x77')]={'id':_0x28fa3f[_0xf17f('0x77')]['id'],'name':_0x28fa3f[_0xf17f('0x77')]['name'],'active':_0x28fa3f[_0xf17f('0x77')][_0xf17f('0x78')],'callerid':_0x28fa3f[_0xf17f('0x77')]['callerid']};}if(_0x28fa3f[_0xf17f('0x49')]){_0x3ce10c[_0xf17f('0x49')]={'id':_0x28fa3f[_0xf17f('0x49')]['id'],'name':_0x28fa3f[_0xf17f('0x49')]['name']};}var _0x41942e=md5(JSON[_0xf17f('0x79')](_0x3ce10c));if(_0x28fa3f[_0xf17f('0x7a')]!==_0x41942e){_0x28fa3f['md5']=_0x41942e;emit(util[_0xf17f('0x7b')]('voice:queue:%s',_0x3ce10c[_0xf17f('0x45')]),'voice_queue:save',_0x3ce10c);}}}function emitCampaignSummary(_0x98563e){if(_0x98563e[_0xf17f('0x7c')]===_0xf17f('0x7d')){emit(util[_0xf17f('0x7b')]('campaign:ivr:%s',_0x98563e[_0xf17f('0x45')]),_0xf17f('0x7e'),_0x98563e);}}function checkGetDataPredictive(_0x1346ff){if(isNotNull(_0x1346ff)&&!_[_0xf17f('0x4d')](_0x1346ff)){loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x80'));loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x81'),_0x1346ff[_0xf17f('0x75')]);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x82'),_0x1346ff[_0xf17f('0x6d')]);loggerPredictive[_0xf17f('0x7f')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1346ff[_0xf17f('0x83')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1346ff['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x84'),_0x1346ff[_0xf17f('0x85')]);loggerPredictive['info'](_0xf17f('0x86'),_0x1346ff[_0xf17f('0x87')]);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x88'));if(_0x1346ff[_0xf17f('0x75')]>0x0){if(!_[_0xf17f('0x42')](_0x1346ff[_0xf17f('0x87')])&&_0x1346ff[_0xf17f('0x87')]>0x0){return!![];}loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x89'));if(!_[_0xf17f('0x42')](_0x1346ff[_0xf17f('0x85')])&&_0x1346ff[_0xf17f('0x85')]>0x0){return!![];}loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x8a'));}else{loggerPredictive['info'](_0xf17f('0x8b'));}}else{loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x8c'));}return![];}function mergeDataErlangB(_0x22ef42){return function(_0x3188ab){loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x8d'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3188ab[_0xf17f('0x8e')]);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x8f'),_0x3188ab['erlangCallToSecond']);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x90'),_0x3188ab[_0xf17f('0x91')]);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x92'),_0x3188ab[_0xf17f('0x93')]);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x90'),_0x3188ab[_0xf17f('0x91')]);loggerPredictive[_0xf17f('0x7f')]('---------------------------');_[_0xf17f('0x94')](_0x22ef42,_0x3188ab);};}function getDiff(_0x2c3bb4){var _0x110aae=moment()[_0xf17f('0x50')](0x0);var _0x3cccba=moment(_0x2c3bb4)[_0xf17f('0x50')](0x0);return _0x110aae[_0xf17f('0x51')](_0x3cccba,_0xf17f('0x95'));}function ifInterval(_0x54ce9f,_0x159190){if(_[_0xf17f('0x42')](_0x159190)){return![];}return getDiff(_0x159190)<_0x54ce9f*0x3c;}function freeVariablesPredictive(_0x436c05){if(isNotNull(_0x436c05)){if(!_[_0xf17f('0x42')](_0x436c05['startProgressive'])){_0x436c05[_0xf17f('0x2d')]=undefined;loggerPredictive[_0xf17f('0x7f')](_0x436c05[_0xf17f('0x45')],_0xf17f('0x96'));}if(!_['isUndefined'](_0x436c05[_0xf17f('0x2c')])){_0x436c05[_0xf17f('0x2c')]=undefined;loggerPredictive[_0xf17f('0x7f')](_0x436c05[_0xf17f('0x45')],_0xf17f('0x97'));}if(!_[_0xf17f('0x42')](_0x436c05[_0xf17f('0x98')])){clearInterval(_0x436c05['handlePredictive']);_0x436c05[_0xf17f('0x98')]=undefined;loggerPredictive[_0xf17f('0x7f')](_0x436c05[_0xf17f('0x45')],_0xf17f('0x99'));}}}function erlangb(_0x10f251,_0x5ecb37){if(_0x5ecb37===0x0){return 0x0;}var _0x3b3bb3=0x1;for(var _0x539832=0x1;_0x539832<=_0x5ecb37;_0x539832+=0x1){_0x3b3bb3=0x1+_0x3b3bb3*_0x539832/_0x10f251;}return 0x1/_0x3b3bb3;}function isVoiceQueueOutbound(_0x29f06b){return _0x29f06b==='outbound';}function isNotPreview(_0x68253e){return _0x68253e!==_0xf17f('0x21');}function isCampaignIvr(_0x3e6bc8){return _0x3e6bc8===_0xf17f('0x7d');}function getCallerId(_0x4f8913,_0xa764a6,_0x4ab261){if(!_[_0xf17f('0x42')](_0x4ab261)&&typeof _0x4ab261===_0xf17f('0x9a')&&!_[_0xf17f('0x4d')](_0x4ab261)){if(!_['isUndefined'](_0xa764a6)&&typeof _0xa764a6===_0xf17f('0x9a')&&!_[_0xf17f('0x4d')](_0xa764a6)){return util[_0xf17f('0x7b')](_0xf17f('0x9b'),_0xa764a6,_0x4ab261);}return util['format'](_0xf17f('0x9b'),_0x4ab261,_0x4ab261);}if(!_['isUndefined'](_0x4f8913)&&typeof _0x4f8913==='string'&&!_[_0xf17f('0x4d')](_0x4f8913)){return _0x4f8913;}return _0xf17f('0x9c');}function loggerCatchQueueSummary(_0x553c1c,_0x3ebeb9){return function(_0x10624c){freeVariablesPredictive(_0x3ebeb9);emitVoiceQueueSummary(_0x3ebeb9);emitCampaignSummary(_0x3ebeb9);loggerSyncQueueSummary['error'](_0x553c1c,util[_0xf17f('0x9d')](_0x10624c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x45e421,_0x4fd7fb){return function(_0xbf4c5f){loggerPredictive['error'](_0x4fd7fb['name'],_0x45e421);loggerPredictive['error'](_0xbf4c5f[_0xf17f('0x9e')]);freeVariablesPredictive(_0x4fd7fb);};}function loggerCatch(_0x4f463e){return function(_0x53819e){logger[_0xf17f('0x9f')](_0x4f463e,util['inspect'](_0x53819e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xd2321d){return _0xd2321d&&!_['isUndefined'](_0xd2321d)&&_0xd2321d[_0xf17f('0xa0')]>0x0;}function decremetOriginate(_0x200d00){if(!_[_0xf17f('0x42')](_0x200d00)&&_0x200d00!==null){if(typeof _0x200d00['originated']!==_0xf17f('0xa1')){if(_0x200d00[_0xf17f('0xa2')]>0x0){_0x200d00[_0xf17f('0xa2')]-=0x1;}else{logger[_0xf17f('0x9f')](_0xf17f('0xa3'));}}}else{logger[_0xf17f('0x9f')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x1841f5,_0x33ad50,_0x58176d){if(_0x33ad50>_0x58176d){for(var _0xc89173=0x0;_0xc89173<_0x33ad50-_0x58176d;_0xc89173+=0x1){decremetOriginate(_0x1841f5);}}}function loggerGetContactDialer(_0xccf22e,_0x3207f9,_0x494336){return function(_0x5678b0){checkContactLowerLimitOriginate(_0x3207f9,_0x494336,0x0);logger[_0xf17f('0x9f')](_0xccf22e,util[_0xf17f('0x9d')](_0x5678b0,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x288ee2){return function(_0x465e0d){if(isNotNull(_0x465e0d)&&isNotNull(_0x465e0d[0x0])){if(_0x465e0d[0x0][_0xf17f('0xa4')]>0x0){_0x288ee2[_0xf17f('0x43')]=_0xf17f('0xa5');logger[_0xf17f('0x7f')](_0xf17f('0xa6')+_0x288ee2[_0xf17f('0x45')],_0x465e0d[0x0]['contactsRescheduled'],_0xf17f('0xa7'));}else{_0x288ee2[_0xf17f('0x43')]=_0xf17f('0xa8');logger[_0xf17f('0x7f')](_0xf17f('0xa9')+_0x288ee2['name']);}}};}function notSendMessagesQueue(_0x1a48f9){if(_0x1a48f9['sendMessageOneNotActive']){freeVariablesPredictive(_0x1a48f9);if(_0x1a48f9[_0xf17f('0xa2')]===0x0&&_0x1a48f9[_0xf17f('0x59')]===0x0&&_0x1a48f9[_0xf17f('0x5d')]===0x0&&(_0x1a48f9[_0xf17f('0xaa')]||0x0)===0x0){_0x1a48f9[_0xf17f('0xab')]=![];_0x1a48f9[_0xf17f('0x56')]=0x0;_0x1a48f9[_0xf17f('0x43')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1a48f9[_0xf17f('0x45')],_0xf17f('0xac'));}else{_0x1a48f9['message']=_0xf17f('0xad');loggerSyncQueueSummary['error'](_0xf17f('0xae'),_0x1a48f9[_0xf17f('0x45')],_0xf17f('0xaf'));}emitVoiceQueueSummary(_0x1a48f9);}}function notSendMessagesCampaign(_0x171a40){if(_0x171a40[_0xf17f('0xab')]){if(_0x171a40[_0xf17f('0xa2')]===0x0){_0x171a40[_0xf17f('0xab')]=![];_0x171a40['message']=_0xf17f('0x47');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x171a40['name'],_0xf17f('0xac'));}else{_0x171a40[_0xf17f('0x43')]=_0xf17f('0xad');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x171a40[_0xf17f('0x45')],_0xf17f('0xaf'));}emitCampaignSummary(_0x171a40);}}function createObjHistory(_0x302d85,_0x2190e1,_0x2bd42f,_0x1b7dbe,_0x26b83f){_0x302d85[_0xf17f('0x43')]=_0x2bd42f;var _0x2f7521=new Action(_0x302d85,_0x2190e1);var _0x151554=new History(_0x2f7521);_0x151554[_0xf17f('0xb0')]=_0x1b7dbe;_0x151554[_0xf17f('0xb1')]=_0x26b83f;_0x151554[_0xf17f('0xb2')]=_0x2f7521[_0xf17f('0xb3')];return _0x151554;}Dialer[_0xf17f('0x1c')]['loopClearZombieChannels']=function(){var _0x338bfb=this;setInterval(function(){_0x338bfb[_0xf17f('0xb4')](_0x338bfb[_0xf17f('0x2a')],_0xf17f('0xb5'));_0x338bfb[_0xf17f('0xb4')](_0x338bfb['actions'],'[actions]');},0x32c8);};Dialer[_0xf17f('0x1c')]['clearZombieChannels']=function(_0x2ceba2,_0x148414){var _0x47b14f=this;for(var _0x17fc8a in _0x2ceba2){if(typeof _0x2ceba2[_0x17fc8a]!==_0xf17f('0xa1')){this[_0xf17f('0x20')][_0xf17f('0x1d')](function(){if(!_['isNil'](_0x2ceba2[_0x17fc8a])){return ami[_0xf17f('0xb6')]({'action':_0xf17f('0xb7'),'channel':_0x2ceba2[_0x17fc8a]['channel']})[_0xf17f('0xb8')](function(_0x69ed){if(_0x69ed[_0xf17f('0x43')]===_0xf17f('0xb9')){setTimeout(function(){if(_0x2ceba2[_0x17fc8a]&&_0x2ceba2[_0x17fc8a][_0xf17f('0x7c')]!==_0xf17f('0x7d')){_0x47b14f[_0xf17f('0xba')](_0x47b14f[_0xf17f('0x22')][_0x2ceba2[_0x17fc8a][_0xf17f('0xbb')]]);logger['error'](_0xf17f('0xbc'),_0x148414,_0x17fc8a,_0x2ceba2[_0x17fc8a][_0xf17f('0xbb')]);delete _0x2ceba2[_0x17fc8a];}if(_0x2ceba2[_0x17fc8a]&&_0x2ceba2[_0x17fc8a][_0xf17f('0x7c')]==='ivr'){_0x47b14f[_0xf17f('0xba')](_0x47b14f['campaigns'][_0x2ceba2[_0x17fc8a]['queue']]);logger[_0xf17f('0x9f')](_0xf17f('0xbd'),_0x148414,_0x17fc8a,_0x2ceba2[_0x17fc8a][_0xf17f('0xbb')]);delete _0x2ceba2[_0x17fc8a];}},0x2328);}});}});}}};Dialer[_0xf17f('0x1c')]['countReScheduled']=function(_0x44f380){return BPromise['resolve']()[_0xf17f('0x40')](cmHopper['countReScheduled'](_0x44f380))[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xbe')));};Dialer[_0xf17f('0x1c')][_0xf17f('0xbf')]=function(_0x3ddbca){return BPromise[_0xf17f('0xc0')]()['then'](cmHopperBlack[_0xf17f('0xbf')](_0x3ddbca))[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xc1')));};Dialer[_0xf17f('0x1c')][_0xf17f('0xc2')]=function(_0x28ce2a){return BPromise['resolve']()[_0xf17f('0x40')](cmHopperBlack['checkIsBlackListIvr'](_0x28ce2a))[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xc3')));};Dialer[_0xf17f('0x1c')][_0xf17f('0xc4')]=function(_0xdac50b){return BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](cmHopperHistory[_0xf17f('0xc5')](_0xdac50b))[_0xf17f('0xb8')](loggerCatch('[averageHandleTime]\x20'));};Dialer['prototype']['rescheduleContact']=function(_0xe96a9f){return BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](cmHopper[_0xf17f('0xc6')](_0xe96a9f))[_0xf17f('0xb8')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0xf17f('0xc7')]=function(_0x1d81a8,_0x54aadc,_0x1a3b25){return BPromise[_0xf17f('0xc0')]()['then'](cmHopper['unlockContact'](_0x1d81a8,_0x54aadc,_0x1a3b25))['catch'](loggerCatch(_0xf17f('0xc8')));};Dialer[_0xf17f('0x1c')][_0xf17f('0xc9')]=function(_0x47ae1b,_0x1374af,_0x1ef176,_0x3c4e6a,_0x42e077){return BPromise[_0xf17f('0xc0')]()['then'](cmHopper['getContactDialer'](_0x47ae1b,_0x1374af,_0x1ef176,_0x3c4e6a))['catch'](function(_0x535a5b){_0x42e077[_0xf17f('0xca')]-=_0x1ef176;_0x42e077[_0xf17f('0xca')]=_0x42e077[_0xf17f('0xca')]>0x0?_0x42e077[_0xf17f('0xca')]:0x0;loggerCatch(_0xf17f('0xcb'))(_0x535a5b);});};Dialer[_0xf17f('0x1c')]['getContactDialerIvr']=function(_0x385819,_0x5c2e96,_0x261ac0,_0x15e9dd){return BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](cmHopper[_0xf17f('0xcc')](_0x385819,_0x5c2e96,_0x261ac0))['catch'](function(_0x80a1ea){_0x15e9dd[_0xf17f('0xca')]-=_0x5c2e96;_0x15e9dd[_0xf17f('0xca')]=_0x15e9dd[_0xf17f('0xca')]>0x0?_0x15e9dd[_0xf17f('0xca')]:0x0;loggerCatch(_0xf17f('0xcd'))(_0x80a1ea);});};Dialer[_0xf17f('0x1c')]['getVoiceQueueRtPauses']=function(_0x2c80f3){return BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](voiceQueueRt[_0xf17f('0xce')](_0x2c80f3))[_0xf17f('0xb8')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xf17f('0x1c')][_0xf17f('0xcf')]=function(_0xec0ec8){return BPromise['resolve']()[_0xf17f('0x40')](cmHopper[_0xf17f('0xcf')](_0xec0ec8))[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xd0')));};Dialer['prototype'][_0xf17f('0xd1')]=function(_0x215b18){return BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](cmHopperHistory[_0xf17f('0xd1')](_0x215b18))[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xd2')));};Dialer['prototype'][_0xf17f('0xba')]=function(_0x32be89){if(!_[_0xf17f('0x42')](_0x32be89)&&_0x32be89!==null){if(typeof _0x32be89['originated']!==_0xf17f('0xa1')){if(_0x32be89[_0xf17f('0xa2')]>0x0){_0x32be89[_0xf17f('0xa2')]-=0x1;}else{logger['error'](_0xf17f('0xd3'));}}}else{logger[_0xf17f('0x9f')](_0xf17f('0xd4'));}};Dialer[_0xf17f('0x1c')][_0xf17f('0xd5')]=function(_0x43ea12,_0x3cf728){var _0x246609=this;return function(_0x30d5c9){_0x246609['updateOriginated'](_0x3cf728);logger['error'](_0x43ea12,util[_0xf17f('0x9d')](_0x30d5c9,{'showHidden':![],'depth':null}));};};Dialer[_0xf17f('0x1c')][_0xf17f('0xd6')]=function(_0x4472e6,_0x3e88f2,_0x568068){var _0x398c20={'state':0x19,'statedesc':_0xf17f('0xd7')};this[_0xf17f('0xba')](_0x3e88f2);this[_0xf17f('0xd8')](_[_0xf17f('0x94')](_0x398c20,_[_0xf17f('0xd9')](_0x568068,[_0xf17f('0xda'),'ListId',_0xf17f('0xdb'),_0xf17f('0xdc'),'CampaignId'])),_0xf17f('0xdd'),_0xf17f('0xde'));logger[_0xf17f('0x9f')](_0x4472e6);};Dialer['prototype'][_0xf17f('0xdf')]=function(_0x2a3904){return _0x2a3904===_0xf17f('0xe0');};Dialer['prototype'][_0xf17f('0xe1')]=function(_0x3e0818){return!_[_0xf17f('0x42')](_0x3e0818)&&_0x3e0818&&!_[_0xf17f('0x42')](_0x3e0818[_0xf17f('0x45')])&&!_[_0xf17f('0x42')](_0x3e0818[_0xf17f('0x78')])&&_0x3e0818[_0xf17f('0x78')]&&(this[_0xf17f('0x25')][util[_0xf17f('0x7b')](_0xf17f('0xe2'),_0x3e0818['name'])][_0xf17f('0xb7')]===_0xf17f('0xe3')||this[_0xf17f('0x25')][util['format']('SIP/%s',_0x3e0818[_0xf17f('0x45')])]['status']===_0xf17f('0xe4'));};Dialer['prototype'][_0xf17f('0xd8')]=function(_0xcec243,_0x1e0b5e,_0x816d58){this[_0xf17f('0xd1')](_0xcec243)['catch'](loggerCatch(_0x1e0b5e));this['moveContactManagedDialer'](_0xcec243)['catch'](loggerCatch(_0x816d58));};Dialer['prototype'][_0xf17f('0x39')]=function(_0x182684){var _0x4b8cc8=this[_0xf17f('0x2a')][_0x182684[_0xf17f('0xe5')]];var _0x2ca520;if(!_[_0xf17f('0xe6')](_0x182684)&&!_[_0xf17f('0xe6')](_0x182684['variable'])&&!_[_0xf17f('0xe6')](_0x182684[_0xf17f('0xe7')][_0xf17f('0xe8')])&&_0x182684[_0xf17f('0xe9')]===_0xf17f('0xea')&&_0x4b8cc8){if(_0x4b8cc8['type']!==_0xf17f('0x7d')&&this[_0xf17f('0x22')][_0x4b8cc8['queue']][_0xf17f('0xeb')]&&_0x182684[_0xf17f('0xec')]===_0xf17f('0xed')){delete this['uniqueId'][_0x182684[_0xf17f('0xe5')]];this[_0xf17f('0xba')](this[_0xf17f('0x22')][_0x4b8cc8[_0xf17f('0xbb')]]);this[_0xf17f('0x22')][_0x4b8cc8[_0xf17f('0xbb')]][_0xf17f('0xee')]+=0x1;this['voiceQueues'][_0x4b8cc8['queue']][_0xf17f('0x64')]+=0x1;_0x2ca520=new Hangup(_0x4b8cc8,_0x182684);_0x2ca520['state']=0x12;_0x2ca520['statedesc']=_0xf17f('0xef');_0x2ca520['membername']='AMD';ami[_0xf17f('0x52')](_0xf17f('0xf0'),ut[_0xf17f('0xf1')](_0x2ca520,_0xf17f('0xf2')));this[_0xf17f('0xd8')](_0x2ca520,_0xf17f('0xf3'),'[syncHangupInAMD]');}if(_0x4b8cc8[_0xf17f('0x7c')]!==_0xf17f('0x7d')&&this[_0xf17f('0x22')][_0x4b8cc8[_0xf17f('0xbb')]][_0xf17f('0xeb')]&&_0x182684[_0xf17f('0xec')]===_0xf17f('0xf4')){var _0x564fb6=this;return new BPromise(function(_0x1c6e00,_0x52f539){delete _0x564fb6[_0xf17f('0x2a')][_0x182684[_0xf17f('0xe5')]];_0x564fb6['updateOriginated'](_0x564fb6[_0xf17f('0x22')][_0x4b8cc8[_0xf17f('0xbb')]]);_0x564fb6['voiceQueues'][_0x4b8cc8[_0xf17f('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x564fb6[_0xf17f('0x22')][_0x4b8cc8[_0xf17f('0xbb')]][_0xf17f('0x64')]+=0x1;var _0x213331=_0x564fb6[_0xf17f('0x22')][_0x4b8cc8[_0xf17f('0xbb')]];var _0x568b03=new Hangup(_0x4b8cc8,_0x182684);_0x568b03[_0xf17f('0xb0')]=0x13;_0x568b03[_0xf17f('0xb1')]=_0xf17f('0xf5');_0x568b03[_0xf17f('0xf6')]=_0xf17f('0xf7');_0x568b03[_0xf17f('0xf8')]+=0x1;_0x568b03[_0xf17f('0xf9')]+=0x1;_0x568b03['amd']=!![];ami[_0xf17f('0x52')](_0xf17f('0xf0'),ut['buildObj'](_0x568b03,_0xf17f('0xf2')));_0x564fb6[_0xf17f('0xd1')](_0x568b03)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xfa')));if(_0x568b03[_0xf17f('0xfb')]+_0x568b03[_0xf17f('0xfc')]+_0x568b03[_0xf17f('0xfd')]+_0x568b03[_0xf17f('0xfe')]+_0x568b03[_0xf17f('0xff')]+_0x568b03[_0xf17f('0x100')]+_0x568b03['countmachineretry']+_0x568b03[_0xf17f('0x101')]>=_0x213331[_0xf17f('0x102')]){_0x564fb6['stateGlobal'](_0x568b03,_0x1c6e00,_0x52f539,_0xf17f('0x103'));}else{if(_0x568b03[_0xf17f('0xf8')]>=_0x213331[_0xf17f('0x104')]){_0x564fb6[_0xf17f('0x105')](_0x568b03,_0x1c6e00,_0x52f539,_0xf17f('0x106'));}else{_0x564fb6[_0xf17f('0xc6')]({'active':![],'countmachineretry':_0x568b03[_0xf17f('0xf8')],'scheduledat':moment()['add'](_0x213331['dialMachineRetryFrequency'],'minutes')['format'](_0xf17f('0x107')),'ContactId':_0x568b03['ContactId'],'ListId':_0x568b03[_0xf17f('0x108')],'VoiceQueueId':_0x568b03[_0xf17f('0xdc')]||undefined,'CampaignId':_0x568b03[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x1c6e00({'reschedule':0x1});}}});}if(_0x4b8cc8['type']===_0xf17f('0x7d')&&this[_0xf17f('0x23')][_0x4b8cc8[_0xf17f('0xbb')]][_0xf17f('0xeb')]&&_0x182684[_0xf17f('0xec')]===_0xf17f('0xed')){delete this[_0xf17f('0x2a')][_0x182684['uniqueid']];this[_0xf17f('0xba')](this[_0xf17f('0x23')][_0x4b8cc8[_0xf17f('0xbb')]]);_0x2ca520=new Hangup(_0x4b8cc8,_0x182684);_0x2ca520[_0xf17f('0xb0')]=0x12;_0x2ca520[_0xf17f('0xb1')]=_0xf17f('0xef');_0x2ca520[_0xf17f('0xf6')]='AMD';ami[_0xf17f('0x52')](_0xf17f('0xf0'),ut['buildObj'](_0x2ca520,_0xf17f('0xf2')));this[_0xf17f('0xd8')](_0x2ca520,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x4b8cc8['type']===_0xf17f('0x7d')&&this[_0xf17f('0x23')][_0x4b8cc8[_0xf17f('0xbb')]][_0xf17f('0xeb')]&&_0x182684[_0xf17f('0xec')]===_0xf17f('0xf4')){var _0x564fb6=this;return new BPromise(function(_0x4ae890,_0x485eb5){delete _0x564fb6['uniqueId'][_0x182684[_0xf17f('0xe5')]];_0x564fb6[_0xf17f('0xba')](_0x564fb6[_0xf17f('0x23')][_0x4b8cc8[_0xf17f('0xbb')]]);_0x564fb6[_0xf17f('0x23')][_0x4b8cc8[_0xf17f('0xbb')]][_0xf17f('0xee')]+=0x1;_0x564fb6[_0xf17f('0x23')][_0x4b8cc8[_0xf17f('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x58d2ee=_0x564fb6[_0xf17f('0x23')][_0x4b8cc8[_0xf17f('0xbb')]];var _0x37d855=new Hangup(_0x4b8cc8,_0x182684);_0x37d855['state']=0x13;_0x37d855[_0xf17f('0xb1')]=_0xf17f('0xf5');_0x37d855[_0xf17f('0xf6')]=_0xf17f('0xf7');_0x37d855['countmachineretry']+=0x1;_0x37d855[_0xf17f('0xf9')]+=0x1;_0x37d855[_0xf17f('0xf2')]=!![];ami[_0xf17f('0x52')](_0xf17f('0xf0'),ut[_0xf17f('0xf1')](_0x37d855,_0xf17f('0xf2')));_0x564fb6[_0xf17f('0xd1')](_0x37d855)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xfa')));if(_0x37d855[_0xf17f('0xfb')]+_0x37d855[_0xf17f('0xfc')]+_0x37d855[_0xf17f('0xfd')]+_0x37d855[_0xf17f('0xfe')]+_0x37d855['countdropretry']+_0x37d855[_0xf17f('0x100')]+_0x37d855[_0xf17f('0xf8')]+_0x37d855[_0xf17f('0x101')]>=_0x58d2ee[_0xf17f('0x102')]){_0x564fb6[_0xf17f('0x10a')](_0x37d855,_0x4ae890,_0x485eb5,_0xf17f('0x103'));}else{if(_0x37d855[_0xf17f('0xf8')]>=_0x58d2ee[_0xf17f('0x104')]){_0x564fb6['createStateFinal'](_0x37d855,_0x4ae890,_0x485eb5,_0xf17f('0x106'));}else{_0x564fb6[_0xf17f('0xc6')]({'active':![],'countmachineretry':_0x37d855['countmachineretry'],'scheduledat':moment()[_0xf17f('0x10b')](_0x58d2ee[_0xf17f('0x10c')],_0xf17f('0x10d'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x37d855[_0xf17f('0xda')],'ListId':_0x37d855['ListId'],'VoiceQueueId':_0x37d855[_0xf17f('0xdc')]||undefined,'CampaignId':_0x37d855[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x10e')));_0x4ae890({'reschedule':0x1});}}});}}};Dialer[_0xf17f('0x1c')][_0xf17f('0x10f')]=function(_0x4cd5c9){var _0x2f0a8f=this[_0xf17f('0x2a')][_0x4cd5c9[_0xf17f('0xe5')]];var _0x5941f8=this;var _0x39f96a;if(_0x2f0a8f&&_0x2f0a8f[_0xf17f('0x7c')]===_0xf17f('0x7d')){delete this[_0xf17f('0x2a')][_0x4cd5c9[_0xf17f('0xe5')]];this[_0xf17f('0xba')](this['campaigns'][_0x2f0a8f['queue']]);this[_0xf17f('0x23')][_0x2f0a8f[_0xf17f('0xbb')]]['ivrAnswerCallsDay']+=0x1;_0x39f96a=new Hangup(_0x2f0a8f,_0x4cd5c9);this[_0xf17f('0xd1')](_0x39f96a)[_0xf17f('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x39f96a)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x2f0a8f&&_0x2f0a8f['type']!==_0xf17f('0x7d')&&isNotNull(this[_0xf17f('0x22')][_0x2f0a8f[_0xf17f('0xbb')]][_0xf17f('0x110')])){delete this[_0xf17f('0x2a')][_0x4cd5c9[_0xf17f('0xe5')]];this[_0xf17f('0xba')](this['voiceQueues'][_0x2f0a8f['queue']]);this['voiceQueues'][_0x2f0a8f[_0xf17f('0xbb')]][_0xf17f('0xee')]+=0x1;this[_0xf17f('0x22')][_0x2f0a8f[_0xf17f('0xbb')]][_0xf17f('0x64')]+=0x1;_0x39f96a=new Hangup(_0x2f0a8f,_0x4cd5c9);_0x39f96a[_0xf17f('0xb0')]=0x10;_0x39f96a[_0xf17f('0xb1')]='AnswerAGI';_0x39f96a['membername']=_0xf17f('0x111');this[_0xf17f('0xd1')](_0x39f96a)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x112')));this[_0xf17f('0xcf')](_0x39f96a)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x113')));}if(_0x2f0a8f&&_0x2f0a8f[_0xf17f('0x7c')]!==_0xf17f('0x7d')&&!isNotNull(this[_0xf17f('0x22')][_0x2f0a8f[_0xf17f('0xbb')]]['dialQueueProject'])){delete this[_0xf17f('0x2a')][_0x4cd5c9[_0xf17f('0xe5')]];this['updateOriginated'](this[_0xf17f('0x22')][_0x2f0a8f[_0xf17f('0xbb')]]);this[_0xf17f('0x22')][_0x2f0a8f[_0xf17f('0xbb')]][_0xf17f('0x114')]+=0x1;_0x39f96a=new Hangup(_0x2f0a8f,_0x4cd5c9);_0x39f96a['state']=0xc;_0x39f96a[_0xf17f('0xb1')]=_0x4cd5c9[_0xf17f('0x115')];_0x39f96a[_0xf17f('0xf6')]=_0xf17f('0x116');this[_0xf17f('0xd1')](_0x39f96a)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x112')));this['moveContactManagedDialer'](_0x39f96a)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xf17f('0x1c')]['syncAgentComplete']=function(_0x3206a3){var _0x50b563=this[_0xf17f('0x2a')][_0x3206a3[_0xf17f('0xe5')]];var _0x1571b6=this;if(this[_0xf17f('0x22')][_0x3206a3[_0xf17f('0xbb')]]){if(_0x50b563&&_0x50b563[_0xf17f('0x7c')]!==_0xf17f('0x7d')){delete this[_0xf17f('0x2a')][_0x3206a3[_0xf17f('0xe5')]];this['voiceQueues'][_0x3206a3[_0xf17f('0xbb')]][_0xf17f('0xee')]+=0x1;var _0xf08ba3=new AgentComplete(_0x50b563,_0x3206a3);if(_0x3206a3['reason']===_0xf17f('0x117')){_0xf08ba3[_0xf17f('0x118')]=this[_0xf17f('0x22')][_0x3206a3['queue']][_0xf17f('0x119')]&&this['voiceQueues'][_0x3206a3[_0xf17f('0xbb')]][_0xf17f('0x11a')]?moment()[_0xf17f('0x7b')](_0xf17f('0x107')):undefined;}this[_0xf17f('0xd1')](_0xf08ba3)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x11b')));this['moveContactManagedDialer'](_0xf08ba3)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xf17f('0x1c')][_0xf17f('0x32')]=function(_0x555735){if(this[_0xf17f('0x22')][_0x555735[_0xf17f('0xbb')]]){if(this['uniqueId'][_0x555735['uniqueid']]&&this[_0xf17f('0x2a')][_0x555735[_0xf17f('0xe5')]][_0xf17f('0x7c')]!==_0xf17f('0x7d')){this['updateOriginated'](this['voiceQueues'][_0x555735[_0xf17f('0xbb')]]);this[_0xf17f('0x2a')][_0x555735[_0xf17f('0xe5')]][_0xf17f('0x11c')]=moment()[_0xf17f('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4cccb1){this[_0xf17f('0xd1')](_0x4cccb1)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x11b')));this['moveContactManagedDialer'](_0x4cccb1)[_0xf17f('0xb8')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xf17f('0x1c')][_0xf17f('0x11d')]=function(_0x1413c1){var _0x44e3a8=this['uniqueId'][_0x1413c1[_0xf17f('0xe5')]];var _0x18756e=this;if(this[_0xf17f('0x22')][_0x1413c1[_0xf17f('0xbb')]]){if(_0x44e3a8&&_0x44e3a8['type']!==_0xf17f('0x7d')){delete this['uniqueId'][_0x1413c1[_0xf17f('0xe5')]];this[_0xf17f('0xba')](this[_0xf17f('0x22')][_0x1413c1['queue']]);_0x44e3a8[_0xf17f('0x11e')]=moment()[_0xf17f('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2140ab=new QueueCallerAbandon(_0x44e3a8,_0x1413c1);if(getSeconds(_0x44e3a8[_0xf17f('0x11e')],_0x44e3a8[_0xf17f('0x11f')])>=_0x44e3a8[_0xf17f('0x120')]){this['voiceQueues'][_0x1413c1[_0xf17f('0xbb')]][_0xf17f('0x83')]+=0x1;this['voiceQueues'][_0x1413c1['queue']][_0xf17f('0x68')]+=0x1;this[_0xf17f('0x22')][_0x1413c1[_0xf17f('0xbb')]][_0xf17f('0x70')]+=0x1;_0x2140ab[_0xf17f('0xb0')]=0xa;_0x2140ab[_0xf17f('0xb1')]=_0xf17f('0x121');_0x2140ab['dropreason']=_0xf17f('0x122');_0x2140ab[_0xf17f('0x118')]=this[_0xf17f('0x22')][_0x1413c1[_0xf17f('0xbb')]][_0xf17f('0x119')]?moment()[_0xf17f('0x7b')](_0xf17f('0x107')):undefined;_0x2140ab[_0xf17f('0xff')]+=0x1;_0x2140ab[_0xf17f('0xf9')]+=0x1;if(_0x2140ab[_0xf17f('0xff')]>=this[_0xf17f('0x22')][_0x1413c1[_0xf17f('0xbb')]]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x2140ab);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x2140ab[_0xf17f('0xff')],'scheduledat':moment()[_0xf17f('0x10b')](this[_0xf17f('0x22')][_0x1413c1[_0xf17f('0xbb')]]['dialDropRetryFrequency'],_0xf17f('0x10d'))[_0xf17f('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44e3a8[_0xf17f('0xda')],'ListId':_0x44e3a8['ListId'],'VoiceQueueId':_0x44e3a8[_0xf17f('0xdc')]||undefined,'CampaignId':_0x44e3a8[_0xf17f('0x109')]||undefined})['catch'](loggerCatch(_0xf17f('0x123')));var _0x5dc95f=new History(_0x2140ab);_0x5dc95f['state']=0xa;_0x5dc95f[_0xf17f('0xb1')]='Drop';_0x5dc95f[_0xf17f('0xb3')]=moment()[_0xf17f('0x7b')](_0xf17f('0x107'));_0x5dc95f['endtime']=_0x5dc95f[_0xf17f('0xb3')];_0x5dc95f[_0xf17f('0x124')]=_0x2140ab[_0xf17f('0x124')];_0x5dc95f['calleridnum']=_0x2140ab[_0xf17f('0x125')];this[_0xf17f('0xd1')](_0x5dc95f)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x126')));}}else{this['voiceQueues'][_0x1413c1[_0xf17f('0xbb')]][_0xf17f('0x6e')]+=0x1;this[_0xf17f('0x22')][_0x1413c1[_0xf17f('0xbb')]][_0xf17f('0x67')]+=0x1;_0x2140ab[_0xf17f('0xb0')]=0xb;_0x2140ab['statedesc']=_0xf17f('0x127');_0x2140ab['dropreason']=_0xf17f('0x128');_0x2140ab[_0xf17f('0x100')]+=0x1;_0x2140ab[_0xf17f('0xf9')]+=0x1;if(_0x2140ab[_0xf17f('0x100')]>=this[_0xf17f('0x22')][_0x1413c1[_0xf17f('0xbb')]]['dialAbandonedMaxRetry']){this['queueCallerAbandonCreateState'](_0x2140ab);}else{this[_0xf17f('0xc6')]({'active':![],'countabandonedretry':_0x2140ab[_0xf17f('0x100')],'scheduledat':moment()[_0xf17f('0x10b')](this[_0xf17f('0x22')][_0x1413c1['queue']][_0xf17f('0x129')],_0xf17f('0x10d'))[_0xf17f('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44e3a8[_0xf17f('0xda')],'ListId':_0x44e3a8[_0xf17f('0x108')],'VoiceQueueId':_0x44e3a8['VoiceQueueId']||undefined,'CampaignId':_0x44e3a8[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x12a')));var _0x5dc95f=new History(_0x2140ab);_0x5dc95f[_0xf17f('0xb0')]=0xb;_0x5dc95f[_0xf17f('0xb1')]=_0xf17f('0x127');_0x5dc95f[_0xf17f('0xb3')]=moment()[_0xf17f('0x7b')](_0xf17f('0x107'));_0x5dc95f[_0xf17f('0xb2')]=_0x5dc95f[_0xf17f('0xb3')];_0x5dc95f[_0xf17f('0x124')]=_0x2140ab[_0xf17f('0x124')];_0x5dc95f[_0xf17f('0x125')]=_0x2140ab[_0xf17f('0x125')];this[_0xf17f('0xd1')](_0x5dc95f)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x12b')));}}}}};Dialer[_0xf17f('0x1c')][_0xf17f('0x37')]=function(_0x38d670){if(this[_0xf17f('0x28')][_0x38d670[_0xf17f('0xe5')]]){this[_0xf17f('0x28')][_0x38d670[_0xf17f('0xe5')]][_0xf17f('0x12c')]=_0x38d670['channel'];}if(this['uniqueId'][_0x38d670[_0xf17f('0xe5')]]){this[_0xf17f('0x2a')][_0x38d670[_0xf17f('0xe5')]][_0xf17f('0x12c')]=_0x38d670[_0xf17f('0x12c')];}};Dialer[_0xf17f('0x1c')][_0xf17f('0x3b')]=function(_0x1d644c){if(strategy[this[_0xf17f('0x22')][this[_0xf17f('0x28')][_0x1d644c[_0xf17f('0x12d')]][_0xf17f('0xbb')]][_0xf17f('0x54')]]===_0xf17f('0x1b')){if(this[_0xf17f('0x28')][_0x1d644c[_0xf17f('0x12d')]]&&_[_0xf17f('0xe6')](this[_0xf17f('0x28')][_0x1d644c[_0xf17f('0x12d')]]['locked'])&&_0x1d644c[_0xf17f('0xb7')]==='1'&&_0x1d644c[_0xf17f('0x12e')]==='0'){if(this['agents'][_0x1d644c['stateinterface']]){if(!this[_0xf17f('0x24')][_0x1d644c['stateinterface']][_0xf17f('0x12f')]){this[_0xf17f('0x24')][_0x1d644c[_0xf17f('0x130')]]['locked']=!![];this[_0xf17f('0x28')][_0x1d644c['actionid']][_0xf17f('0x12f')]=!![];this['actions'][_0x1d644c['actionid']][_0xf17f('0x130')]=_0x1d644c[_0xf17f('0x130')];}}}}else if((strategy[this[_0xf17f('0x22')][this[_0xf17f('0x28')][_0x1d644c[_0xf17f('0x12d')]][_0xf17f('0xbb')]][_0xf17f('0x54')]]||_0xf17f('0x1a'))===_0xf17f('0x1a')){if(this[_0xf17f('0x28')][_0x1d644c['actionid']]){if(this[_0xf17f('0x24')][_0x1d644c[_0xf17f('0x130')]]){this[_0xf17f('0x28')][_0x1d644c['actionid']][_0xf17f('0x130')]=_0x1d644c[_0xf17f('0x130')];if(_['isNil'](this['queueBooked'][this[_0xf17f('0x28')][_0x1d644c[_0xf17f('0x12d')]][_0xf17f('0xbb')]])){this[_0xf17f('0x2f')][this[_0xf17f('0x28')][_0x1d644c[_0xf17f('0x12d')]]['queue']]=[];}this[_0xf17f('0x2f')][this[_0xf17f('0x28')][_0x1d644c[_0xf17f('0x12d')]][_0xf17f('0xbb')]]['push'](_[_0xf17f('0x94')](_[_0xf17f('0xd9')](this[_0xf17f('0x28')][_0x1d644c['actionid']],[_0xf17f('0x131'),'stateinterface']),{'status':_0x1d644c[_0xf17f('0xb7')],'paused':_0x1d644c[_0xf17f('0x12e')]}));}}}};function unlockQueueStatus(_0xeb932e,_0x58c622){setTimeout(function(){if(_['isUndefined'](_0xeb932e[_0xf17f('0x132')])){loggerBooked[_0xf17f('0x9f')](_0xf17f('0x133'),_0x58c622);}_0xeb932e['queueStatusComplete']=!![];loggerBooked[_0xf17f('0x7f')]('[booked][unlockQueueStatus]',_0x58c622,JSON[_0xf17f('0x79')](_[_0xf17f('0xd9')](_0xeb932e,[_0xf17f('0x45'),_0xf17f('0x132')])));},0x1f3);}Dialer[_0xf17f('0x1c')][_0xf17f('0x134')]=function(_0x307408){var _0x2ca58b=this;var _0x142eb9=_0x2ca58b[_0xf17f('0x22')][_0x2ca58b[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]]['queue']];if(strategy[this[_0xf17f('0x22')][this[_0xf17f('0x28')][_0x307408['actionid']]['queue']][_0xf17f('0x54')]]===_0xf17f('0x1b')){if(this[_0xf17f('0x28')][_0x307408['actionid']]&&this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]]['stateinterface']){this['preview'][_0xf17f('0x135')](this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0x131')],this[_0xf17f('0x28')][_0x307408['actionid']][_0xf17f('0x130')])['catch'](function(_0x3e9c2d){logger[_0xf17f('0x9f')](_0xf17f('0x136'),util['inspect'](_0x3e9c2d,{'showHidden':![],'depth':null}));})[_0xf17f('0x1f')](function(){_0x2ca58b['updateOriginated'](_0x2ca58b[_0xf17f('0x22')][_0x2ca58b[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0xbb')]]);_0x2ca58b[_0xf17f('0x24')][_0x2ca58b[_0xf17f('0x28')][_0x307408['actionid']]['stateinterface']][_0xf17f('0x12f')]=![];delete _0x2ca58b[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]];unlockQueueStatus(_0x142eb9);});}else{this[_0xf17f('0xba')](this[_0xf17f('0x22')][this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]]['queue']]);this[_0xf17f('0xc6')]({'active':![],'ContactId':this[_0xf17f('0x28')][_0x307408['actionid']][_0xf17f('0xda')],'ListId':this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0x108')],'VoiceQueueId':this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0xdc')]||undefined,'CampaignId':this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]]['CampaignId']||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x137')));delete this['actions'][_0x307408[_0xf17f('0x12d')]];unlockQueueStatus(_0x142eb9);}}else if((strategy[this[_0xf17f('0x22')][this[_0xf17f('0x28')][_0x307408['actionid']]['queue']][_0xf17f('0x54')]]||_0xf17f('0x1a'))===_0xf17f('0x1a')){var _0x3aa078;if(this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]]&&!_[_0xf17f('0x4d')](this[_0xf17f('0x2f')][this[_0xf17f('0x28')][_0x307408['actionid']]['queue']])){if(this['queueBookedRR'][_0x2ca58b['actions'][_0x307408[_0xf17f('0x12d')]][_0xf17f('0xbb')]]){this[_0xf17f('0x30')][_0x2ca58b[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0xbb')]]=this['queueBookedRR'][this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0xbb')]]?this[_0xf17f('0x30')][this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]]['queue']]:this[_0xf17f('0x2f')][this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0xbb')]]?this[_0xf17f('0x2f')][this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]]['queue']][_0xf17f('0x138')]||0x0:0x0;}this[_0xf17f('0x2f')][this[_0xf17f('0x28')][_0x307408['actionid']]['queue']]['_rr']=this['queueBookedRR'][this[_0xf17f('0x28')][_0x307408[_0xf17f('0x12d')]][_0xf17f('0xbb')]];for(var _0x5c0c72=0x0;_0x5c0c72=0x0;})[_0xf17f('0xb8')](myreject(_0x40a3a0)));}}else{_0x285128[_0xf17f('0x14e')](ami[_0xf17f('0xb6')]({'action':_0xf17f('0x14f'),'command':util[_0xf17f('0x7b')](_0xf17f('0x150'),_0xc688fa,!_[_0xf17f('0x42')](config[_0xf17f('0x14b')][_0x5764b1])?_0x5764b1:'')})[_0xf17f('0x40')](function(_0x2ee51b){return _0x2ee51b['content'][_0xf17f('0x153')](_0xf17f('0x154'))>=0x0;})[_0xf17f('0xb8')](myreject(_0x40a3a0)));}BPromise[_0xf17f('0x155')](_0x285128)[_0xf17f('0x40')](function(_0xa6aed){var _0x266b10=_['some'](_0xa6aed);if(_0x266b10){return _0x7c6881(_0x266b10);}else{_0x4d87e0[_0xf17f('0x43')]=_0x4845c3?_0xf17f('0x156'):'INTERVAL_IS_OVERTIME';return _0x40a3a0(msgResponse(_0xf17f('0x157'),_0xf17f('0x147'),_0xf17f('0x158')+_0x4845c3+'\x20'+_0x928400+_0xf17f('0x159')+util[_0xf17f('0x9d')](_0xc688fa,{'showHidden':![],'depth':null})+_0xf17f('0x15a')+_0x5764b1));}})[_0xf17f('0xb8')](function(_0x546a81){return _0x40a3a0(msgResponse(_0xf17f('0x145'),_0xf17f('0x147'),JSON[_0xf17f('0x79')](_0x546a81)));});});};Dialer['prototype']['checkDialMethod']=function(_0x1ab8bd){var _0x8d4d58=this;return function(){switch(_0x1ab8bd[_0xf17f('0x60')]){case'progressive':freeVariablesPredictive(_0x1ab8bd);_0x8d4d58['handlePower'](_0x1ab8bd,0x1);break;case'power':freeVariablesPredictive(_0x1ab8bd);_0x8d4d58[_0xf17f('0x15b')](_0x1ab8bd,_0x1ab8bd[_0xf17f('0x15c')]);break;case'predictive':_0x8d4d58[_0xf17f('0x8')](_0x1ab8bd);break;case _0xf17f('0x7'):freeVariablesPredictive(_0x1ab8bd);_0x8d4d58['handlePower'](_0x1ab8bd,0x1);break;default:freeVariablesPredictive(_0x1ab8bd);logger[_0xf17f('0x9f')](_0xf17f('0x15d'),_0x1ab8bd[_0xf17f('0x45')],_0xf17f('0x15e'));}};};Dialer[_0xf17f('0x1c')]['checkPreviewRecallReminder']=_['throttle'](function(_0x46fc85){var _0x5aa181=[];for(var _0x2867df in this[_0xf17f('0x24')]){if(typeof this[_0xf17f('0x24')][_0x2867df]!==_0xf17f('0xa1')){if(this['agents'][_0x2867df][_0xf17f('0x15f')]&&this[_0xf17f('0x24')][_0x2867df]['state']==='not_inuse'&&this[_0xf17f('0x24')][_0x2867df][_0xf17f('0xb7')]===_0xf17f('0xe3')){_0x5aa181['push'](this[_0xf17f('0x24')][_0x2867df]['id']);}}}console[_0xf17f('0x160')](_0xf17f('0x161'),_0x5aa181[_0xf17f('0xa0')],_0x5aa181);return BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](cmHopper[_0xf17f('0x162')](_0x46fc85['id'],previewRecallmeReminderInterval,_0x5aa181))['then'](function(_0x5e899f){for(var _0x4b6b18=0x0;_0x4b6b18<_0x5e899f['length'];_0x4b6b18++){var _0x286013=_0x5e899f[_0x4b6b18][_0xf17f('0x163')][_0xf17f('0x45')];if(_0x286013)io['to'](util[_0xf17f('0x7b')](_0xf17f('0x164'),_0x286013))[_0xf17f('0x52')](_0xf17f('0x165'),{'hopper':_0x5e899f[_0x4b6b18]});}})[_0xf17f('0xb8')](function(_0x346b9f){logger[_0xf17f('0x9f')](_0xf17f('0x166'),_0x346b9f);});},0x3c*0x3e8,{'leading':!![]});Dialer[_0xf17f('0x1c')][_0xf17f('0x167')]=function(_0x4c5156){var _0x5bb7d9=this;return function(){_0x5bb7d9[_0xf17f('0x168')](_0x4c5156);};};Dialer[_0xf17f('0x1c')]['syncQueueSummary']=function(_0x2339c7){var _0x22efac=this;if(isNotPreview(_0x2339c7['dialMethod'])){if(isVoiceQueueOutbound(_0x2339c7['type'])&&isActive(_0x2339c7[_0xf17f('0x5f')])){_0x2339c7[_0xf17f('0xab')]=!![];BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](checkIsLoggedIn(_0x2339c7,_0x2339c7['loggedIn']))['then'](checkIsActive(_0x2339c7,_0x2339c7[_0xf17f('0x5f')]))[_0xf17f('0x40')](checkInterval(_0x2339c7))[_0xf17f('0x40')](_0x22efac['checkIsTrunkReachable'](_0x2339c7))['then'](_0x22efac['checkIfTime'](_0x2339c7[_0xf17f('0x169')],_0x2339c7['dialTimezone'],_0x2339c7['name'],_0x2339c7))[_0xf17f('0x40')](_0x22efac[_0xf17f('0x146')](_0x2339c7[_0xf17f('0x49')],_0x2339c7['dialTimezone'],_0x2339c7[_0xf17f('0x45')],_0x2339c7))[_0xf17f('0x40')](_0x22efac[_0xf17f('0x16a')](_0x2339c7))[_0xf17f('0xb8')](loggerCatchQueueSummary(_0xf17f('0x16b'),_0x2339c7));}else{notSendMessagesQueue(_0x2339c7);}}else{freeVariablesPredictive(_0x2339c7);if(_0x2339c7['dialPreviewRecallmeReminder']){_0x22efac['checkPreviewRecallReminder'](_0x2339c7);}}};Dialer[_0xf17f('0x1c')]['syncCampaigns']=function(){var _0x211f16=this;var _0x337bd6;for(var _0x562b81 in this[_0xf17f('0x23')]){if(typeof this['campaigns'][_0x562b81]!==_0xf17f('0xa1')){_0x337bd6=this['campaigns'][_0x562b81];if(isCampaignIvr(_0x337bd6['type'])&&isActive(_0x337bd6[_0xf17f('0x78')])){_0x337bd6[_0xf17f('0xab')]=!![];BPromise[_0xf17f('0xc0')]()[_0xf17f('0x40')](checkIsActive(_0x337bd6,_0x337bd6[_0xf17f('0x78')]))[_0xf17f('0x40')](checkInterval(_0x337bd6))[_0xf17f('0x40')](_0x211f16[_0xf17f('0x16c')](_0x337bd6))['then'](_0x211f16[_0xf17f('0x144')](_0x337bd6[_0xf17f('0x169')],_0x337bd6[_0xf17f('0x16d')],_0x337bd6[_0xf17f('0x45')],_0x337bd6))[_0xf17f('0x40')](_0x211f16[_0xf17f('0x146')](_0x337bd6[_0xf17f('0x49')],_0x337bd6[_0xf17f('0x16d')],_0x337bd6[_0xf17f('0x45')],_0x337bd6))['then'](_0x211f16[_0xf17f('0x167')](_0x337bd6))[_0xf17f('0xb8')](loggerCatchQueueSummary('[syncCampaigns]',_0x337bd6));}else{notSendMessagesCampaign(_0x337bd6);}}}};function getCallerIdRandom(_0x530f74,_0x1affd5){var _0x4ab2e2;var _0x1ef345;var _0x54f78c;if(_0x1affd5<=0x0){_0x1affd5=0x1;}_0x4ab2e2=new RegExp(_0xf17f('0x16e')+_0x1affd5+'}$');_0x1ef345=Math[_0xf17f('0x16f')](0xa,_0x1affd5-0x1);_0x54f78c=Math[_0xf17f('0x16f')](0xa,_0x1affd5)-0x1;return util[_0xf17f('0x7b')]('%s',_['replace'](_0x530f74,_0x4ab2e2,_['random'](_0x1ef345,_0x54f78c)));}function extractCalleridName(_0x1dd0de){var _0x327f73=_0x1dd0de['match'](/"(.*?)"/);return _0x327f73?_0x327f73[0x1]:_0x1dd0de;}function extractCalleridNumber(_0x23087e){var _0x6bbd36=_0x23087e[_0xf17f('0x170')](/<(.*?)>/);return _0x6bbd36?_0x6bbd36[0x1]:_0x23087e;}Dialer[_0xf17f('0x1c')]['actionOriginate']=function(_0x23a7b9,_0x57bf2a){var _0x35882f=this;var _0x4f07a1=uuid['v4']();this['actions'][_0x4f07a1]=new Action(_0x23a7b9,_0x57bf2a,_0x4f07a1);return new BPromise(function(_0x13a879,_0x2b8ae4){if(_[_0xf17f('0x42')](_0x23a7b9)&&typeof _0x23a7b9!==_0xf17f('0x171')){return _0x2b8ae4(msgResponse(_0xf17f('0x172'),_0xf17f('0x147'),_0xf17f('0x173')));}if(_['isUndefined'](_0x57bf2a[_0xf17f('0x174')]['phone'])||_0x57bf2a['Contact'][_0xf17f('0x175')]===null){return _0x2b8ae4(msgResponse(_0xf17f('0x172'),_0xf17f('0x147'),_0xf17f('0x176')));}var _0x20f73d={'XMD-CALLERID':_0x35882f[_0xf17f('0x28')][_0x4f07a1][_0xf17f('0x177')](),'XMD-AGI':_0x23a7b9['dialQueueProject']?util[_0xf17f('0x7b')](_0xf17f('0x178'),ipAgi,_0x23a7b9[_0xf17f('0x110')]):_0xf17f('0x179'),'XMD-AGIAFTER':_0x23a7b9[_0xf17f('0x119')]?util[_0xf17f('0x7b')](_0xf17f('0x178'),ipAgi,_0x23a7b9['dialQueueProject2']):'NONE','XMD-QUEUE':_0x23a7b9['type']===_0xf17f('0x53')?util['format'](_0xf17f('0x17a'),_0x23a7b9[_0xf17f('0x45')],_0x23a7b9[_0xf17f('0x17b')]||'',_0x23a7b9[_0xf17f('0x11a')]?'c':'',_0x23a7b9[_0xf17f('0x120')]||0x3):_0xf17f('0x179'),'XMD-CONTACTID':_0x57bf2a['ContactId'],'XMD-CDRTYPE':_0xf17f('0x6'),'CALLERID(all)':_0x35882f['actions'][_0x4f07a1][_0xf17f('0x177')](),'XMD-AMD':_0x23a7b9['dialAMDActive']?'ACTIVE':'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x23a7b9[_0xf17f('0xeb')]){_0x20f73d[_0xf17f('0x17c')]=_0x23a7b9[_0xf17f('0x17d')]||0x9c4;_0x20f73d['XMD-AMDGREETING']=_0x23a7b9['dialAMDGreeting']||0x5dc;_0x20f73d[_0xf17f('0x17e')]=_0x23a7b9['dialAMDAfterGreetingSilence']||0x320;_0x20f73d[_0xf17f('0x17f')]=_0x23a7b9[_0xf17f('0x180')]||0x1388;_0x20f73d[_0xf17f('0x181')]=_0x23a7b9[_0xf17f('0x182')]||0x64;_0x20f73d[_0xf17f('0x183')]=_0x23a7b9['dialAMDBetweenWordsSilence']||0x32;_0x20f73d['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x23a7b9[_0xf17f('0x184')]||0x3;_0x20f73d['XMD-AMDSILENCETHRESHOLD']=_0x23a7b9[_0xf17f('0x185')]||0x100;_0x20f73d[_0xf17f('0x186')]=_0x23a7b9['dialAMDMaximumWordLength']||0x1388;}if(_0x23a7b9[_0xf17f('0x7c')]===_0xf17f('0x53')){_0x20f73d['XMD-VOICEQUEUEID']=_0x57bf2a[_0xf17f('0xdc')];}else{_0x20f73d[_0xf17f('0x187')]=_0x57bf2a[_0xf17f('0x109')];}for(var _0x306546 in _0x57bf2a[_0xf17f('0x174')]){if(typeof _0x57bf2a[_0xf17f('0x174')][_0x306546]!==_0xf17f('0xa1')){if(isNotNull(_0x57bf2a[_0xf17f('0x174')][_0x306546])&&_0x306546!=='id'&&_0x306546!==_0xf17f('0x188')&&_0x306546!==_0xf17f('0x189')&&_0x306546!=='updatedAt'){_0x20f73d[util[_0xf17f('0x7b')](_0xf17f('0x18a'),_0xf17f('0x18b'),_[_0xf17f('0x18c')](_0x306546))]=_0x57bf2a[_0xf17f('0x174')][_0x306546];}}}var _0x5276ee=_0x35882f[_0xf17f('0xe1')](_0x23a7b9[_0xf17f('0x77')])?getCallerId(_0x23a7b9[_0xf17f('0x77')][_0xf17f('0x18d')],_0x23a7b9[_0xf17f('0x61')],_0x23a7b9[_0xf17f('0x18e')]>0x0?getCallerIdRandom(_0x23a7b9['dialOriginateCallerIdNumber'],_0x23a7b9[_0xf17f('0x18e')]):_0x23a7b9['dialOriginateCallerIdNumber']):getCallerId(_[_0xf17f('0xe6')](_0x23a7b9[_0xf17f('0x142')])?_0x23a7b9[_0xf17f('0x77')][_0xf17f('0x18d')]:_0x23a7b9[_0xf17f('0x142')][_0xf17f('0x18d')],_0x23a7b9[_0xf17f('0x61')],_0x23a7b9[_0xf17f('0x18e')]>0x0?getCallerIdRandom(_0x23a7b9['dialOriginateCallerIdNumber'],_0x23a7b9[_0xf17f('0x18e')]):_0x23a7b9[_0xf17f('0x62')]);if(_0x5276ee){_0x20f73d[_0xf17f('0x18f')]=_0x35882f['actions'][_0x4f07a1][_0xf17f('0x190')]=extractCalleridName(_0x5276ee);_0x20f73d[_0xf17f('0x191')]=_0x35882f[_0xf17f('0x28')][_0x4f07a1][_0xf17f('0x192')]=extractCalleridNumber(_0x5276ee);}return ami[_0xf17f('0xb6')]({'actionid':_0x4f07a1,'action':'originate','channel':_0x35882f[_0xf17f('0xe1')](_0x23a7b9[_0xf17f('0x77')])?util[_0xf17f('0x7b')](_0xf17f('0x193'),_0x23a7b9[_0xf17f('0x77')][_0xf17f('0x45')],isNotNull(_0x23a7b9['dialPrefix'])?_0x23a7b9[_0xf17f('0x63')][_0xf17f('0x194')]()||'':'',_0x23a7b9[_0xf17f('0x195')]>0x0?_0x57bf2a[_0xf17f('0x174')]['phone'][_0xf17f('0x196')](_0x23a7b9[_0xf17f('0x195')]):_0x57bf2a['Contact'][_0xf17f('0x175')]):util[_0xf17f('0x7b')]('SIP/%s/%s%s',_[_0xf17f('0xe6')](_0x23a7b9[_0xf17f('0x142')])?_0x23a7b9['Trunk'][_0xf17f('0x45')]:_0x23a7b9[_0xf17f('0x142')][_0xf17f('0x45')],isNotNull(_0x23a7b9[_0xf17f('0x63')])?_0x23a7b9[_0xf17f('0x63')][_0xf17f('0x194')]()||'':'',_0x23a7b9[_0xf17f('0x195')]>0x0?_0x57bf2a['Contact']['phone'][_0xf17f('0x196')](_0x23a7b9[_0xf17f('0x195')]):_0x57bf2a[_0xf17f('0x174')]['phone']),'callerid':_0x5276ee,'Exten':'xcally-motion-dialer','Context':_0xf17f('0x197'),'Priority':'1','variable':_0x20f73d,'timeout':(_0x23a7b9[_0xf17f('0x198')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4f07a1})[_0xf17f('0x40')](function(_0x13e9bb){return _0x13a879(_0x13e9bb);})[_0xf17f('0xb8')](function(_0x3a7186){_0x23a7b9[_0xf17f('0x6b')]+=0x1;var _0x48510a=new History(_0x35882f[_0xf17f('0x28')][_0x4f07a1]);logger[_0xf17f('0x9f')](util[_0xf17f('0x7b')](_0xf17f('0x199'),JSON['stringify'](_0x3a7186)));_0x48510a[_0xf17f('0xb0')]=0xe;_0x48510a['statedesc']='OriginateError';_0x48510a[_0xf17f('0xb3')]=moment()[_0xf17f('0x7b')](_0xf17f('0x107'));_0x48510a[_0xf17f('0xb2')]=_0x48510a['starttime'];_0x35882f[_0xf17f('0xd1')](_0x48510a)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x19a')));_0x35882f['moveContactManagedDialer'](_0x48510a)['catch'](loggerCatch(_0xf17f('0x19a')))[_0xf17f('0x1f')](function(){delete _0x35882f[_0xf17f('0x28')][_0x4f07a1];return _0x2b8ae4(msgResponse('originate','Error',_0xf17f('0x19b')));});});});};Dialer['prototype'][_0xf17f('0x19c')]=function(_0x5b7606){var _0x59f808=this['actions'][_0x5b7606[_0xf17f('0x12d')]];if(_0x59f808){delete this[_0xf17f('0x28')][_0x5b7606[_0xf17f('0x12d')]];_0x59f808[_0xf17f('0x11f')]=moment()[_0xf17f('0x7b')](_0xf17f('0x107'));var _0x26e47b=_0x59f808['type']==='ivr'?this['campaigns'][_0x59f808[_0xf17f('0xbb')]]:this[_0xf17f('0x22')][_0x59f808['getQueue']()];if(!this[_0xf17f('0xdf')](_0x5b7606[_0xf17f('0x19d')])){this['updateOriginated'](_0x26e47b);return this[_0xf17f('0x19e')](_0x59f808,_0x26e47b,_0x5b7606)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x19f')));}this[_0xf17f('0x2a')][_0x5b7606[_0xf17f('0xe5')]]=_0x59f808;}};Dialer[_0xf17f('0x1c')]['checkRetriveMax']=function(_0x1fb3cd,_0x15b616,_0x503036){var _0x4c2530=new History(_0x15b616);if(_0x4c2530['countbusyretry']+_0x4c2530[_0xf17f('0xfc')]+_0x4c2530[_0xf17f('0xfd')]+_0x4c2530[_0xf17f('0xfe')]+_0x4c2530[_0xf17f('0xff')]+_0x4c2530[_0xf17f('0x100')]+_0x4c2530[_0xf17f('0xf8')]+_0x4c2530[_0xf17f('0x101')]>=_0x503036[_0xf17f('0x102')]-0x1){return!![];}switch(_0x1fb3cd){case 0x3:if(_0x4c2530[_0xf17f('0xfd')]>=_0x503036[_0xf17f('0x1a0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4c2530[_0xf17f('0xfd')]+=0x1,'scheduledat':moment()[_0xf17f('0x10b')](_0x503036['dialNoAnswerRetryFrequency'],_0xf17f('0x10d'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c2530[_0xf17f('0xda')],'ListId':_0x4c2530[_0xf17f('0x108')],'VoiceQueueId':_0x4c2530[_0xf17f('0xdc')]||undefined,'CampaignId':_0x4c2530[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x4c2530[_0xf17f('0xfb')]>=_0x503036[_0xf17f('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x4c2530[_0xf17f('0xfb')]+=0x1,'scheduledat':moment()['add'](_0x503036[_0xf17f('0x1a2')],_0xf17f('0x10d'))['format'](_0xf17f('0x107')),'ContactId':_0x4c2530[_0xf17f('0xda')],'ListId':_0x4c2530['ListId'],'VoiceQueueId':_0x4c2530[_0xf17f('0xdc')]||undefined,'CampaignId':_0x4c2530['CampaignId']||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x1a3')));break;case 0x8:if(_0x4c2530[_0xf17f('0xfc')]>=_0x503036['dialCongestionMaxRetry']-0x1){return!![];}this[_0xf17f('0xc6')]({'active':![],'countcongestionretry':_0x4c2530[_0xf17f('0xfc')]+=0x1,'scheduledat':moment()[_0xf17f('0x10b')](_0x503036[_0xf17f('0x1a4')],_0xf17f('0x10d'))[_0xf17f('0x7b')](_0xf17f('0x107')),'ContactId':_0x4c2530[_0xf17f('0xda')],'ListId':_0x4c2530[_0xf17f('0x108')],'VoiceQueueId':_0x4c2530['VoiceQueueId']||undefined,'CampaignId':_0x4c2530[_0xf17f('0x109')]||undefined})['catch'](loggerCatch(_0xf17f('0x1a5')));break;case 0x0:if(_0x4c2530['countnosuchnumberretry']>=_0x503036[_0xf17f('0x1a6')]-0x1){return!![];}else{this[_0xf17f('0xc6')]({'active':![],'countnosuchnumberretry':_0x4c2530[_0xf17f('0xfe')]+=0x1,'scheduledat':moment()[_0xf17f('0x10b')](_0x503036[_0xf17f('0x1a7')],_0xf17f('0x10d'))[_0xf17f('0x7b')](_0xf17f('0x107')),'ContactId':_0x4c2530[_0xf17f('0xda')],'ListId':_0x4c2530[_0xf17f('0x108')],'VoiceQueueId':_0x4c2530['VoiceQueueId']||undefined,'CampaignId':_0x4c2530[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x4c2530[_0xf17f('0xff')]>=_0x503036[_0xf17f('0x1a8')]-0x1){return!![];}this[_0xf17f('0xc6')]({'active':![],'countdropretry':_0x4c2530[_0xf17f('0xff')]+=0x1,'scheduledat':moment()[_0xf17f('0x10b')](_0x503036[_0xf17f('0x1a9')],_0xf17f('0x10d'))[_0xf17f('0x7b')](_0xf17f('0x107')),'ContactId':_0x4c2530[_0xf17f('0xda')],'ListId':_0x4c2530[_0xf17f('0x108')],'VoiceQueueId':_0x4c2530[_0xf17f('0xdc')]||undefined,'CampaignId':_0x4c2530[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x123')));break;case 0xb:if(_0x4c2530[_0xf17f('0x100')]>=_0x503036['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xf17f('0xc6')]({'active':![],'countabandonedretry':_0x4c2530[_0xf17f('0x100')]+=0x1,'scheduledat':moment()[_0xf17f('0x10b')](_0x503036[_0xf17f('0x129')],'minutes')[_0xf17f('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c2530[_0xf17f('0xda')],'ListId':_0x4c2530[_0xf17f('0x108')],'VoiceQueueId':_0x4c2530['VoiceQueueId']||undefined,'CampaignId':_0x4c2530[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4c2530[_0xf17f('0xf8')]>=_0x503036['dialMachineMaxRetry']-0x1){return!![];}this[_0xf17f('0xc6')]({'active':![],'countmachineretry':_0x4c2530[_0xf17f('0xf8')]+=0x1,'scheduledat':moment()[_0xf17f('0x10b')](_0x503036[_0xf17f('0x10c')],_0xf17f('0x10d'))[_0xf17f('0x7b')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c2530[_0xf17f('0xda')],'ListId':_0x4c2530[_0xf17f('0x108')],'VoiceQueueId':_0x4c2530[_0xf17f('0xdc')]||undefined,'CampaignId':_0x4c2530[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x10e')));break;case 0x14:if(_0x4c2530[_0xf17f('0x101')]>=_0x503036[_0xf17f('0x1aa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x4c2530[_0xf17f('0x101')]+=0x1,'scheduledat':moment()['add'](_0x503036[_0xf17f('0x1ab')],_0xf17f('0x10d'))['format'](_0xf17f('0x107')),'ContactId':_0x4c2530['ContactId'],'ListId':_0x4c2530['ListId'],'VoiceQueueId':_0x4c2530['VoiceQueueId']||undefined,'CampaignId':_0x4c2530[_0xf17f('0x109')]||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x1ac')));break;default:return!![];}};Dialer[_0xf17f('0x1c')][_0xf17f('0x19e')]=function(_0x598a9b,_0x2c8aa6,_0x502ce5){var _0x5c6367=this;var _0x58c33c=new History(_0x598a9b);return new BPromise(function(_0x14c2a3,_0x202d00){if(_[_0xf17f('0x42')](_0x2c8aa6)&&typeof _0x2c8aa6!==_0xf17f('0x171')){return _0x202d00(msgResponse(_0xf17f('0x1ad'),_0xf17f('0x147'),_0xf17f('0x1ae')));}if(_[_0xf17f('0x42')](_0x502ce5)&&typeof _0x502ce5!==_0xf17f('0x171')){return _0x202d00(msgResponse('[callProgressDetecting]',_0xf17f('0x147'),_0xf17f('0x1af')));}switch(_0x502ce5[_0xf17f('0x1b0')]){case'0':_0x2c8aa6[_0xf17f('0x6a')]+=0x1;_0x58c33c[_0xf17f('0xb0')]=0x0;_0x58c33c[_0xf17f('0xb1')]=_0xf17f('0x1b1');_0x58c33c['countnosuchnumberretry']+=0x1;_0x58c33c[_0xf17f('0xf9')]+=0x1;ami[_0xf17f('0x52')](_0xf17f('0x1b2'),ut['buildObj'](_0x598a9b,'nosuchnumber'));_0x5c6367[_0xf17f('0xd1')](_0x58c33c)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xfa')));if(_0x5c6367[_0xf17f('0x1b3')](0x0,_0x598a9b,_0x2c8aa6)){if(_0x58c33c['countnosuchnumberretry']>=_0x2c8aa6[_0xf17f('0x1a6')]){_0x5c6367[_0xf17f('0x105')](_0x58c33c,_0x14c2a3,_0x202d00,'reason\x200\x20no\x20such\x20number....');}else{_0x5c6367['stateGlobal'](_0x58c33c,_0x14c2a3,_0x202d00,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x2c8aa6[_0xf17f('0x69')]+=0x1;_0x58c33c['state']=0x3;_0x58c33c[_0xf17f('0xb1')]=_0xf17f('0x1b4');_0x58c33c[_0xf17f('0xfd')]+=0x1;_0x58c33c[_0xf17f('0xf9')]+=0x1;ami[_0xf17f('0x52')](_0xf17f('0x1b5'),ut[_0xf17f('0xf1')](_0x598a9b,'noanswer'));_0x5c6367[_0xf17f('0xd1')](_0x58c33c)[_0xf17f('0xb8')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x5c6367[_0xf17f('0x1b3')](0x3,_0x598a9b,_0x2c8aa6)){if(_0x58c33c[_0xf17f('0xfd')]>=_0x2c8aa6[_0xf17f('0x1a0')]){_0x5c6367[_0xf17f('0x105')](_0x58c33c,_0x14c2a3,_0x202d00,_0xf17f('0x1b6'));}else{_0x5c6367['stateGlobal'](_0x58c33c,_0x14c2a3,_0x202d00,_0xf17f('0x1b6'));}}break;case'5':_0x2c8aa6[_0xf17f('0x65')]+=0x1;_0x58c33c[_0xf17f('0xb0')]=0x5;_0x58c33c[_0xf17f('0xb1')]=_0xf17f('0x1b7');_0x58c33c[_0xf17f('0xfb')]+=0x1;_0x58c33c[_0xf17f('0xf9')]+=0x1;ami[_0xf17f('0x52')](_0xf17f('0x1b8'),ut['buildObj'](_0x598a9b,_0xf17f('0x1b9')));_0x5c6367['createHistory'](_0x58c33c)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x1ba')));if(_0x5c6367[_0xf17f('0x1b3')](0x5,_0x598a9b,_0x2c8aa6)){if(_0x58c33c[_0xf17f('0xfb')]>=_0x2c8aa6['dialBusyMaxRetry']){_0x5c6367[_0xf17f('0x105')](_0x58c33c,_0x14c2a3,_0x202d00,'reason\x205\x20busy');}else{_0x5c6367['stateGlobal'](_0x58c33c,_0x14c2a3,_0x202d00,_0xf17f('0x1bb'));}}break;case'8':_0x2c8aa6['outboundCongestionCallsDay']+=0x1;_0x58c33c[_0xf17f('0xb0')]=0x8;_0x58c33c[_0xf17f('0xb1')]=_0xf17f('0x1bc');_0x58c33c[_0xf17f('0xfc')]+=0x1;_0x58c33c[_0xf17f('0xf9')]+=0x1;ami[_0xf17f('0x52')](_0xf17f('0x1bd'),ut['buildObj'](_0x598a9b,_0xf17f('0x1be')));_0x5c6367[_0xf17f('0xd1')](_0x58c33c)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x1bf')));if(_0x5c6367[_0xf17f('0x1b3')](0x8,_0x598a9b,_0x2c8aa6)){if(_0x58c33c[_0xf17f('0xfc')]>=_0x2c8aa6['dialCongestionMaxRetry']){_0x5c6367[_0xf17f('0x105')](_0x58c33c,_0x14c2a3,_0x202d00,'reason\x208\x20congestion');}else{_0x5c6367['stateGlobal'](_0x58c33c,_0x14c2a3,_0x202d00,'reason\x208\x20congestion');}}break;case'11':_0x2c8aa6[_0xf17f('0x1c0')]+=0x1;_0x58c33c[_0xf17f('0xb0')]=0xb;_0x58c33c[_0xf17f('0xb1')]=_0xf17f('0x127');_0x58c33c[_0xf17f('0x100')]+=0x1;_0x58c33c[_0xf17f('0xf9')]+=0x1;_0x5c6367[_0xf17f('0xd1')](_0x58c33c)[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x12b')));if(_0x5c6367['checkRetriveMax'](0xb,_0x598a9b,_0x2c8aa6)){if(_0x58c33c[_0xf17f('0x100')]>=_0x2c8aa6[_0xf17f('0x1c1')]){_0x5c6367[_0xf17f('0x105')](_0x58c33c,_0x14c2a3,_0x202d00,_0xf17f('0x1c2'));}else{_0x5c6367[_0xf17f('0x10a')](_0x58c33c,_0x14c2a3,_0x202d00,'reason\x2011\x20abandoned');}}break;case'20':_0x2c8aa6[_0xf17f('0x6c')]+=0x1;_0x58c33c[_0xf17f('0xb0')]=0x14;_0x58c33c[_0xf17f('0xb1')]=_0xf17f('0x1c3');_0x58c33c[_0xf17f('0x101')]+=0x1;_0x58c33c[_0xf17f('0xf9')]+=0x1;ami['emit'](_0xf17f('0x1c4'),ut['buildObj'](_0x598a9b,_0xf17f('0x1c5')));_0x5c6367[_0xf17f('0xd1')](_0x58c33c)['catch'](loggerCatch(_0xf17f('0x1c6')));if(_0x5c6367['checkRetriveMax'](0x14,_0x598a9b,_0x2c8aa6)){if(_0x58c33c[_0xf17f('0x101')]>=_0x2c8aa6[_0xf17f('0x1aa')]){_0x5c6367['createStateFinal'](_0x58c33c,_0x14c2a3,_0x202d00,_0xf17f('0x1c7'));}else{_0x5c6367[_0xf17f('0x10a')](_0x58c33c,_0x14c2a3,_0x202d00,_0xf17f('0x1c7'));}}break;default:_0x2c8aa6[_0xf17f('0x114')]+=0x1;_0x58c33c[_0xf17f('0xb0')]=0xc;_0x58c33c['statedesc']=_0x502ce5['reason'];_0x5c6367['createHistory'](_0x58c33c)[_0xf17f('0xb8')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x5c6367[_0xf17f('0x1b3')](_0x502ce5[_0xf17f('0x1b0')],_0x598a9b,_0x2c8aa6)){if(_0x58c33c[_0xf17f('0xfb')]+_0x58c33c['countcongestionretry']+_0x58c33c['countnoanswerretry']+_0x58c33c['countnosuchnumberretry']+_0x58c33c['countdropretry']+_0x58c33c[_0xf17f('0x100')]+_0x58c33c[_0xf17f('0xf8')]+_0x58c33c['countagentrejectretry']>=_0x2c8aa6[_0xf17f('0x102')]){_0x5c6367[_0xf17f('0x10a')](_0x58c33c,_0x14c2a3,_0x202d00,_0x502ce5[_0xf17f('0x1b0')]);}else{_0x5c6367[_0xf17f('0x105')](_0x58c33c,_0x14c2a3,_0x202d00,_0x502ce5[_0xf17f('0x1b0')]);}}}});};Dialer[_0xf17f('0x1c')][_0xf17f('0x10a')]=function(_0x2f43f6,_0x2dd36c,_0x492478,_0x5b97eb){var _0x3a7e76=new Final(_0x2f43f6);_0x3a7e76[_0xf17f('0xb0')]=0xf;_0x3a7e76['statedesc']='Global';this[_0xf17f('0x105')](_0x3a7e76,_0x2dd36c,_0x492478,_0x5b97eb);};Dialer['prototype'][_0xf17f('0x105')]=function(_0x4c5bbf,_0x4fee25,_0x382826,_0x467c91){this[_0xf17f('0xcf')](_0x4c5bbf)[_0xf17f('0x40')](function(){return _0x4fee25(msgResponse(_0xf17f('0x1ad'),'Success',_0x467c91));})[_0xf17f('0xb8')](function(){return _0x382826(msgResponse('[moveContactManagedDialer][0]',_0xf17f('0x147'),_0xf17f('0x1c8')));});};Dialer[_0xf17f('0x1c')]['predictive']=function(_0x1e2379){var _0x43eac4=_0x1e2379['dialPredictiveOptimizationPercentage']/0x64;var _0x47a423=_0x1e2379[_0xf17f('0x68')]/(_0x1e2379[_0xf17f('0x68')]+_0x1e2379[_0xf17f('0xee')]);var _0x115211=Math[_0xf17f('0x1c9')](_0x1e2379[_0xf17f('0x74')]*(_0x1e2379[_0xf17f('0x1ca')]/0x64));var _0x367cb7=Math[_0xf17f('0x1c9')](_0x1e2379[_0xf17f('0x74')]*(_0x1e2379[_0xf17f('0x1cb')]/0x64));var _0x6fd704=_0x1e2379[_0xf17f('0x56')]+_0x1e2379[_0xf17f('0x59')];var _0x430e61=Math['floor'](_0x1e2379[_0xf17f('0x8e')]*_0x1e2379[_0xf17f('0x91')]*_0x1e2379['predictiveIntervalHitRate']*_0x1e2379[_0xf17f('0x72')]);if(_[_0xf17f('0x42')](_0x1e2379[_0xf17f('0x2d')])){if(!_[_0xf17f('0x42')](_0x1e2379[_0xf17f('0x2c')])){_0x1e2379[_0xf17f('0x2c')]=undefined;loggerPredictive[_0xf17f('0x9f')](_0xf17f('0x1cc'),_0xf17f('0x1cd'));}if(!_['isUndefined'](_0x1e2379['handlePredictive'])){loggerPredictive[_0xf17f('0x9f')]('[startMethodPredictive][StartProgressive]',_0xf17f('0x1ce'));clearInterval(_0x1e2379['handlePredictive']);_0x1e2379[_0xf17f('0x98')]=undefined;}_0x1e2379[_0xf17f('0x2d')]=moment()[_0xf17f('0x7b')](_0xf17f('0x107'));loggerPredictive[_0xf17f('0x7f')](_0x1e2379['name'],_0xf17f('0x1cf'),_0x1e2379['startProgressive']);this[_0xf17f('0x15b')](_0x1e2379,0x1);}else if(ifInterval(_0x1e2379['dialPredictiveInterval'],_0x1e2379[_0xf17f('0x2d')])){this[_0xf17f('0x15b')](_0x1e2379,0x1);loggerPredictiveCalls[_0xf17f('0x7f')](_0xf17f('0x1d0'),_0x1e2379[_0xf17f('0x2d')],_0x1e2379['name']);_0x1e2379['erlangCalls']=0x0;_0x1e2379[_0xf17f('0x70')]=0x0;}else if(_0x43eac4<_0x47a423&&_0x1e2379[_0xf17f('0x1d1')]===_0xf17f('0x1d2')){freeVariablesPredictive(_0x1e2379);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x1d3'),_0xf17f('0x1d4'),_0x47a423,'startProgressive',_0x1e2379[_0xf17f('0x45')]);}else if(_0x430e61<_0x1e2379[_0xf17f('0x70')]&&_0x1e2379[_0xf17f('0x1d1')]===_0xf17f('0x1d2')){freeVariablesPredictive(_0x1e2379);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x1d5'),_0xf17f('0x1d6'),_0x430e61,_0xf17f('0x1d7'),_0x1e2379[_0xf17f('0x70')],_0xf17f('0x2d'),_0x1e2379[_0xf17f('0x45')]);}else if(!ifInterval(_0x1e2379['dialPredictiveInterval'],_0x1e2379[_0xf17f('0x2d')])&&_['isUndefined'](_0x1e2379['startPredictive'])&&!_['isUndefined'](_0x1e2379[_0xf17f('0x2d')])){_0x1e2379[_0xf17f('0x2c')]=moment()[_0xf17f('0x7b')](_0xf17f('0x107'));loggerPredictive['info'](_0x1e2379['name'],'started\x20in\x20predictive\x20at',_0x1e2379['startPredictive']);this['averageHandleTime'](_0x1e2379['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x1e2379))[_0xf17f('0x40')](mergeDataErlangB(_0x1e2379))[_0xf17f('0x40')](this['startMethodPredictive'](_0x1e2379))[_0xf17f('0xb8')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x1e2379));}else if(!ifInterval(_0x1e2379[_0xf17f('0x1d8')],_0x1e2379['startPredictive'])){_0x1e2379[_0xf17f('0x70')]=0x0;_0x1e2379[_0xf17f('0x2c')]=moment()[_0xf17f('0x7b')](_0xf17f('0x107'));loggerPredictive[_0xf17f('0x7f')](_0x1e2379[_0xf17f('0x45')],_0xf17f('0x1d9'),_0x1e2379['startPredictive']);clearInterval(_0x1e2379['handlePredictive']);_0x1e2379[_0xf17f('0x98')]=undefined;this[_0xf17f('0xc4')](_0x1e2379['dialPredictiveInterval'])[_0xf17f('0x40')](this[_0xf17f('0x1da')](_0x1e2379))[_0xf17f('0x40')](mergeDataErlangB(_0x1e2379))['then'](this['startMethodPredictive'](_0x1e2379))['catch'](loggerCatchPredictive(_0xf17f('0x1db'),_0x1e2379));}else if(_0x1e2379['predictiveIntervalAvailable']&&_0x6fd704<_0x1e2379[_0xf17f('0x74')]-_0x367cb7){freeVariablesPredictive(_0x1e2379);loggerPredictive[_0xf17f('0x7f')](_0x1e2379[_0xf17f('0x45')],_0xf17f('0x1dc'),_0x6fd704,_0xf17f('0x1dd'),_0x1e2379[_0xf17f('0x74')],'-',_0x367cb7,'=',_0x1e2379[_0xf17f('0x74')]-_0x367cb7,')');}else if(_0x1e2379[_0xf17f('0x74')]&&_0x6fd704>_0x1e2379[_0xf17f('0x74')]+_0x115211){freeVariablesPredictive(_0x1e2379);loggerPredictive[_0xf17f('0x7f')](_0x1e2379[_0xf17f('0x45')],_0xf17f('0x1dc'),_0x6fd704,')\x20are\x20more\x20than\x20threshold\x20(',_0x1e2379[_0xf17f('0x74')],'+',_0x115211,'=',_0x1e2379[_0xf17f('0x74')]+_0x115211,')');}};Dialer[_0xf17f('0x1c')][_0xf17f('0x1da')]=function(_0x13ba60){var _0x1921eb=this;return function(_0x1d265b){return new BPromise(function(_0x2f49a4,_0x392b98){_[_0xf17f('0x94')](_0x13ba60,_0x1d265b[0x0]);if(checkGetDataPredictive(_0x1d265b[0x0])){var _0x2faff5=_0x13ba60['predictiveIntervalAvailable']=_0x13ba60['talking']+_0x13ba60['available'];var _0x46e5cc=_0x13ba60[_0xf17f('0x1d8')]*0x3c;var _0xe0ed0c=_0x1d265b[0x0][_0xf17f('0x87')]+_0x1d265b[0x0][_0xf17f('0x85')];var _0x5dce53=(_0x1d265b[0x0]['predictiveIntervalAnsweredCalls']+_0x1d265b[0x0][_0xf17f('0x83')]+_0x1d265b[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1d265b[0x0][_0xf17f('0x75')];_0x13ba60['predictiveIntervalHitRate']=_0x5dce53>0x0?_0x5dce53:0x1;switch(_0x13ba60[_0xf17f('0x1d1')]){case'dropRate':var _0x1d8629=_0x13ba60[_0xf17f('0x1de')]/0x64;return _0x1921eb[_0xf17f('0x1df')](_0x2faff5,_0x46e5cc,_0xe0ed0c,_0x5dce53,_0x1d8629)[_0xf17f('0x40')](function(_0x1dc51a){return _0x2f49a4(_0x1dc51a);});case'agentBusyFactor':var _0xc83376=_0x13ba60[_0xf17f('0x1de')]/0x64;return _0x1921eb[_0xf17f('0x1e0')](_0x2faff5,_0x46e5cc,_0xe0ed0c,_0x5dce53,_0xc83376)[_0xf17f('0x40')](function(_0x2890e8){return _0x2f49a4(_0x2890e8);});default:return _0x392b98(msgResponse(_0xf17f('0x1e1'),_0xf17f('0x147'),'Unknown\x20Predictive'));}}else{return _0x392b98(msgResponse(_0xf17f('0x1e1'),_0xf17f('0x147'),'check\x20failure'));}});};};Dialer[_0xf17f('0x1c')][_0xf17f('0x1e2')]=function(_0x576340){var _0x11f7af=this;return function(_0x554703){return new BPromise(function(_0x2d4c42,_0x1ac1b1){_['merge'](_0x576340,_0x554703[0x0]);if(checkGetDataPredictive(_0x554703[0x0])){loggerPredictive['info'](JSON[_0xf17f('0x79')](_0x554703[0x0]));if(_0x576340[_0xf17f('0x1d1')]===_0xf17f('0x1d2')){return _0x11f7af['getVoiceQueueRtPauses'](_0x576340['id'])['then'](function(_0x673333){var _0xdde190=_0x576340['loggedIn']-_0x673333[0x0][_0xf17f('0x1e3')];var _0x5e63e4=_0x576340[_0xf17f('0x1d8')]*0x3c;var _0x46c2ce=_0x554703[0x0]['predictiveIntervalAvgTalktime']+_0x554703[0x0]['predictiveIntervalAvgHoldtime'];var _0x345181=(_0x554703[0x0][_0xf17f('0x6d')]+_0x554703[0x0][_0xf17f('0x83')]+_0x554703[0x0][_0xf17f('0x6e')])/_0x554703[0x0][_0xf17f('0x75')];var _0x1c9189=_0x576340[_0xf17f('0x1de')]/0x64;_0x576340['predictiveIntervalPauses']=_0x673333[0x0][_0xf17f('0x1e3')]||0x0;_0x576340[_0xf17f('0x71')]=_0x345181>0x0?_0x345181:0x1;return _0x11f7af[_0xf17f('0x1df')](_0xdde190,_0x5e63e4,_0x46c2ce,_0x345181,_0x1c9189);})[_0xf17f('0x40')](function(_0x59fdbd){return _0x2d4c42(_0x59fdbd);})[_0xf17f('0xb8')](function(_0x17fb71){return _0x1ac1b1(msgResponse(_0xf17f('0x1e4'),_0xf17f('0x147'),JSON[_0xf17f('0x79')](_0x17fb71)));});}if(_0x576340[_0xf17f('0x1d1')]===_0xf17f('0x1e5')){return _0x11f7af[_0xf17f('0xce')](_0x576340['id'])[_0xf17f('0x40')](function(_0x5596d3){var _0x287b12=_0x576340[_0xf17f('0x1e6')]-_0x5596d3[0x0][_0xf17f('0x1e3')];var _0x1b8bc8=_0x576340[_0xf17f('0x1d8')]*0x3c;var _0x360788=_0x554703[0x0][_0xf17f('0x87')]+_0x554703[0x0][_0xf17f('0x85')];var _0x5564d3=(_0x554703[0x0][_0xf17f('0x6d')]+_0x554703[0x0][_0xf17f('0x83')]+_0x554703[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x554703[0x0][_0xf17f('0x75')];var _0x4c6978=_0x576340['dialPredictiveOptimizationPercentage']/0x64;_0x576340['predictiveIntervalPauses']=_0x5596d3[0x0]['outboundQueuePauses']||0x0;_0x576340[_0xf17f('0x71')]=_0x5564d3>0x0?_0x5564d3:0x1;return _0x11f7af[_0xf17f('0x1e0')](_0x287b12,_0x1b8bc8,_0x360788,_0x5564d3,_0x4c6978);})[_0xf17f('0x40')](function(_0x3e4306){return _0x2d4c42(_0x3e4306);})[_0xf17f('0xb8')](function(_0x14ac06){return _0x1ac1b1(msgResponse('[CatchErlangB]',_0xf17f('0x147'),JSON[_0xf17f('0x79')](_0x14ac06)));});}}else{return _0x1ac1b1(msgResponse(_0xf17f('0x1e1'),_0xf17f('0x147'),_0xf17f('0x1e7')));}});};};Dialer[_0xf17f('0x1c')][_0xf17f('0x1e8')]=function(_0xb78fb9){var _0x47d6c4=this;return function(){var _0x4dd556=0x0;var _0x473f11=Math[_0xf17f('0x1e9')](_0xb78fb9[_0xf17f('0x76')]*0x3e8);if(_0x473f11>0x0){_0x473f11=_0x473f11<0x64?0x64:_0x473f11;loggerPredictive[_0xf17f('0x7f')](_0xb78fb9['name'],_0xf17f('0x1ea'),_0x473f11,_0xf17f('0x50'));_0xb78fb9[_0xf17f('0x98')]=setInterval(function(){_0x47d6c4['handlePredictive'](_0xb78fb9);loggerPredictiveCalls[_0xf17f('0x7f')](_0xf17f('0x1eb'),_0x4dd556+=0x1);},_0x473f11);}else{loggerPredictive['info'](_0xb78fb9[_0xf17f('0x45')],_0xf17f('0x1ec'));}};};Dialer[_0xf17f('0x1c')][_0xf17f('0x1ed')]=function(_0x586646,_0x5e7f0d){var _0x504b20=this;return function(_0x20cc25){if(_[_0xf17f('0x4d')](_0x20cc25)){if(_[_0xf17f('0xe6')](_0x5e7f0d[_0xf17f('0xdb')])||!_0x5e7f0d['recallme']){if(_0x586646[_0xf17f('0x60')]===_0xf17f('0x7')){_0x586646[_0xf17f('0x132')]=_[_0xf17f('0x42')](_0x586646[_0xf17f('0x132')])?!![]:_0x586646[_0xf17f('0x132')];var _0x329f00=uuid['v4']();_0x504b20['actions'][_0x329f00]=new Action(_0x586646,_0x5e7f0d,_0x329f00);loggerBooked['info'](_0xf17f('0x1ee'),_0x329f00,_0xf17f('0x1ef'),JSON[_0xf17f('0x79')](_0x586646[_0xf17f('0x132')]),_0xf17f('0x1f0'),_0x586646[_0xf17f('0x45')]);if(_0x586646[_0xf17f('0x132')]){_0x586646[_0xf17f('0x132')]=![];_0x504b20['queueBooked'][_0x504b20[_0xf17f('0x28')][_0x329f00][_0xf17f('0xbb')]]=[];ami[_0xf17f('0xb6')]({'actionid':_0x329f00,'action':'queuestatus','queue':_0x586646[_0xf17f('0x45')]})[_0xf17f('0xb8')](function(){_0x504b20[_0xf17f('0xba')](_0x586646);_0x504b20[_0xf17f('0xc6')]({'active':![],'ContactId':_0x504b20['actions'][_0x329f00][_0xf17f('0xda')],'ListId':_0x504b20[_0xf17f('0x28')][_0x329f00]['ListId'],'VoiceQueueId':_0x504b20[_0xf17f('0x28')][_0x329f00][_0xf17f('0xdc')]||undefined,'CampaignId':_0x504b20[_0xf17f('0x28')][_0x329f00]['CampaignId']||undefined})[_0xf17f('0xb8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x504b20[_0xf17f('0x28')][_0x329f00];});}else{loggerBooked[_0xf17f('0x7f')](_0xf17f('0x1f1'),JSON[_0xf17f('0x79')](_0x586646[_0xf17f('0x132')]),'Queue:\x20',_0x586646['name']);_0x504b20[_0xf17f('0xba')](_0x586646);_0x504b20[_0xf17f('0xc6')]({'active':![],'ContactId':_0x504b20[_0xf17f('0x28')][_0x329f00]['ContactId'],'ListId':_0x504b20[_0xf17f('0x28')][_0x329f00][_0xf17f('0x108')],'VoiceQueueId':_0x504b20[_0xf17f('0x28')][_0x329f00][_0xf17f('0xdc')]||undefined,'CampaignId':_0x504b20[_0xf17f('0x28')][_0x329f00][_0xf17f('0x109')]||undefined})['catch'](loggerCatch(_0xf17f('0x1f2')));delete _0x504b20[_0xf17f('0x28')][_0x329f00];}}else{return _0x504b20[_0xf17f('0x1f3')](_0x586646,_0x5e7f0d);}}else{if(getDiff(_0x5e7f0d[_0xf17f('0x1f4')])<_0x586646[_0xf17f('0x1f5')]*0x3c){if(_0x5e7f0d[_0xf17f('0x163')]&&!_0x5e7f0d['Agent'][_0xf17f('0x1f6')]){_0x504b20['preview'][_0xf17f('0x135')](_0x5e7f0d['id'])[_0xf17f('0x1f')](function(){_0x504b20[_0xf17f('0xba')](_0x586646);});}else{_0x504b20[_0xf17f('0xc7')]({'active':![]},_0x5e7f0d['id'],0x1)[_0xf17f('0x1f')](function(){_0x504b20[_0xf17f('0xba')](_0x586646);});}}else{_0x586646['outboundReCallsDay']+=0x1;_0x504b20[_0xf17f('0xba')](_0x586646);if(_0x586646[_0xf17f('0x1f7')]){_0x504b20[_0xf17f('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e7f0d[_0xf17f('0xda')],'ListId':_0x5e7f0d[_0xf17f('0x108')],'VoiceQueueId':_0x5e7f0d[_0xf17f('0xdc')]||undefined,'CampaignId':_0x5e7f0d['CampaignId']||undefined})[_0xf17f('0xb8')](loggerCatch(_0xf17f('0x1f8')));_0x504b20[_0xf17f('0xd1')](createObjHistory(_0x586646,_0x5e7f0d,'RECALLINQUEUE',0x17,_0xf17f('0x1f9')))[_0xf17f('0xb8')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x504b20[_0xf17f('0xd8')](createObjHistory(_0x586646,_0x5e7f0d,_0xf17f('0x1fa'),0x16,_0xf17f('0x1fb')),_0xf17f('0x1fc'),_0xf17f('0x1fd'));}}}}else{_0x586646['outboundBlacklistCallsDay']+=0x1;_0x504b20['saveInDb'](createObjHistory(_0x586646,_0x5e7f0d,_0xf17f('0x1fe'),0xd,_0xf17f('0x1ff')),'[Originate][historyBlacklist]',_0xf17f('0x200'));throw _0xf17f('0x201');}};};Dialer[_0xf17f('0x1c')][_0xf17f('0x168')]=function(_0x3baef5){var _0x1627d5=this;var _0x4e06d4=_0x3baef5[_0xf17f('0x202')]-_0x3baef5[_0xf17f('0xa2')]-_0x3baef5['temp'];emitCampaignSummary(_0x3baef5);if(_0x4e06d4>0x0){if(_0x4e06d4>this[_0xf17f('0x26')]){_0x4e06d4=this[_0xf17f('0x26')];}_0x3baef5[_0xf17f('0xca')]+=_0x4e06d4;this[_0xf17f('0xcc')](_0x3baef5['id'],_0x4e06d4,_0x3baef5[_0xf17f('0x203')],_0x3baef5)[_0xf17f('0x40')](function(_0x5a2945){_0x3baef5[_0xf17f('0xca')]-=_0x4e06d4;_0x3baef5[_0xf17f('0xca')]=_0x3baef5[_0xf17f('0xca')]>0x0?_0x3baef5[_0xf17f('0xca')]:0x0;if(!checkContactEmpty(_0x5a2945)){_0x3baef5['message']=_0xf17f('0xa8');logger['info'](_0xf17f('0x204')+_0x3baef5[_0xf17f('0x45')]);}else{_0x3baef5[_0xf17f('0xa2')]+=_0x5a2945['length'];_0x3baef5['message']=_0xf17f('0x205');for(var _0x3dafad=0x0;_0x3dafad<_0x5a2945['length'];_0x3dafad+=0x1){_0x3baef5[_0xf17f('0x206')]+=0x1;if(_[_0xf17f('0xe6')](_0x5a2945[_0x3dafad])||_[_0xf17f('0xe6')](_0x5a2945[_0x3dafad][_0xf17f('0x174')])||_[_0xf17f('0xe6')](_0x5a2945[_0x3dafad][_0xf17f('0x174')][_0xf17f('0x175')])){_0x1627d5[_0xf17f('0xd6')](_0xf17f('0x207'),_0x3baef5,_0x5a2945[_0x3dafad]);}else{_0x1627d5[_0xf17f('0xc2')](_[_0xf17f('0xd9')](_0x5a2945[_0x3dafad],[_0xf17f('0x109'),_0xf17f('0x208')]))['then'](_0x1627d5[_0xf17f('0x1ed')](_0x3baef5,_0x5a2945[_0x3dafad]))[_0xf17f('0xb8')](_0x1627d5[_0xf17f('0xd5')](_0xf17f('0x209'),_0x3baef5));}}}})['catch'](loggerGetContactDialer('[getContactCampaign2]',_0x3baef5,_0x4e06d4));}};Dialer[_0xf17f('0x1c')]['handlePower']=function(_0x174dbe,_0x4a74ff){var _0x5beada=this;var _0x43ed76=[];var _0x45f655=_0x4a74ff>=0x1?_0x4a74ff:0x1;if(_0x174dbe[_0xf17f('0x60')]==='booked'){_0x45f655=0x1;}var _0x497cff=Math[_0xf17f('0x1e9')](_0x174dbe[_0xf17f('0x56')]*_0x45f655)-_0x174dbe[_0xf17f('0xa2')]-_0x174dbe['temp'];emitVoiceQueueSummary(_0x174dbe);if(_0x174dbe[_0xf17f('0x20a')]>0x0){var _0x94f6c3=_0x174dbe['dialLimitQueue']-_0x174dbe['originated']-_0x174dbe[_0xf17f('0x59')]-_0x174dbe['temp']-_0x174dbe[_0xf17f('0xaa')];if(_0x497cff>_0x94f6c3){_0x497cff=_0x94f6c3;}}if(_0x497cff>0x0){if(_0x174dbe[_0xf17f('0x60')]===_0xf17f('0x7')){_0x497cff=0x1;}if(_0x497cff>this[_0xf17f('0x26')]){_0x497cff=this[_0xf17f('0x26')];}_0x174dbe[_0xf17f('0xca')]+=_0x497cff;for(var _0x5d3b73 in this[_0xf17f('0x24')]){if(typeof this['agents'][_0x5d3b73]!==_0xf17f('0xa1')){if(this[_0xf17f('0x24')][_0x5d3b73][_0xf17f('0xb0')]==='not_inuse'&&this[_0xf17f('0x24')][_0x5d3b73]['status']==='reachable'){_0x43ed76['push'](this[_0xf17f('0x24')][_0x5d3b73]['id']);}}}this[_0xf17f('0xc9')](_0x174dbe['id'],_0x43ed76,_0x497cff,_0x174dbe['dialOrderByScheduledAt'],_0x174dbe)[_0xf17f('0x40')](function(_0x285b94){_0x174dbe[_0xf17f('0xca')]-=_0x497cff;_0x174dbe[_0xf17f('0xca')]=_0x174dbe[_0xf17f('0xca')]>0x0?_0x174dbe[_0xf17f('0xca')]:0x0;if(!checkContactEmpty(_0x285b94)){_0x5beada[_0xf17f('0x20b')](_0x174dbe)[_0xf17f('0x40')](sendMessageReschedule(_0x174dbe))[_0xf17f('0xb8')](loggerCatch(_0xf17f('0xbe')));}else{_0x174dbe[_0xf17f('0xa2')]+=_0x285b94[_0xf17f('0xa0')];_0x174dbe['message']=_0x174dbe[_0xf17f('0x60')]===_0xf17f('0x7')?_0xf17f('0x20c'):_0xf17f('0x205');for(var _0x46a572=0x0;_0x46a572<_0x285b94[_0xf17f('0xa0')];_0x46a572+=0x1){if(_['isNil'](_0x285b94[_0x46a572])||_[_0xf17f('0xe6')](_0x285b94[_0x46a572]['Contact'])||_[_0xf17f('0xe6')](_0x285b94[_0x46a572]['Contact'][_0xf17f('0x175')])){_0x5beada[_0xf17f('0xd6')](_0xf17f('0x207'),_0x174dbe,_0x285b94[_0x46a572]);}else{_0x5beada['checkIsBlackList'](_[_0xf17f('0xd9')](_0x285b94[_0x46a572],[_0xf17f('0xdc'),'Contact.phone']))['then'](_0x5beada[_0xf17f('0x1ed')](_0x174dbe,_0x285b94[_0x46a572]))['catch'](_0x5beada[_0xf17f('0xd5')]('[actionOriginate]\x20',_0x174dbe));}}}})[_0xf17f('0xb8')](loggerGetContactDialer(_0xf17f('0x20d'),_0x174dbe,_0x497cff));}};Dialer[_0xf17f('0x1c')][_0xf17f('0x98')]=function(_0x596361){if(_0x596361[_0xf17f('0x20a')]>0x0){var _0x48b1c0=_0x596361[_0xf17f('0x20a')]-_0x596361[_0xf17f('0xa2')]-_0x596361[_0xf17f('0x59')];if(_0x48b1c0>0x0){this[_0xf17f('0x20e')](_0x596361);}else{loggerPredictiveCalls[_0xf17f('0x7f')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x596361);}};Dialer[_0xf17f('0x1c')][_0xf17f('0x20e')]=function(_0x236f31){var _0x57702f=this;var _0x5f4981=[];_0x236f31['originated']+=0x1;for(var _0x57c7d5 in this[_0xf17f('0x24')]){if(typeof this['agents'][_0x57c7d5]!=='undefined'){if(this[_0xf17f('0x24')][_0x57c7d5][_0xf17f('0xb0')]===_0xf17f('0x20f')&&this[_0xf17f('0x24')][_0x57c7d5]['status']==='reachable'){_0x5f4981['push'](this[_0xf17f('0x24')][_0x57c7d5]['id']);}}}this[_0xf17f('0xc9')](_0x236f31['id'],_0x5f4981,0x1,_0x236f31['dialOrderByScheduledAt'],_0x236f31)[_0xf17f('0x40')](function(_0x34d175){if(!checkContactEmpty(_0x34d175)){checkContactLowerLimitOriginate(_0x236f31,0x1,0x0);_0x57702f['countReScheduled'](_0x236f31)['then'](sendMessageReschedule(_0x236f31))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x236f31[_0xf17f('0x43')]=_0xf17f('0x205');if(_[_0xf17f('0xe6')](_0x34d175[0x0])||_['isNil'](_0x34d175[0x0]['Contact'])||_[_0xf17f('0xe6')](_0x34d175[0x0][_0xf17f('0x174')][_0xf17f('0x175')])){_0x57702f[_0xf17f('0xd6')](_0xf17f('0x207'),_0x236f31,_0x34d175[0x0]);}else{_0x57702f[_0xf17f('0xbf')](_[_0xf17f('0xd9')](_0x34d175[0x0],[_0xf17f('0xdc'),_0xf17f('0x208')]))['then'](_0x57702f[_0xf17f('0x1ed')](_0x236f31,_0x34d175[0x0]))['catch'](_0x57702f['loggerHandler']('[actionOriginatePredictive]\x20',_0x236f31));}}})[_0xf17f('0xb8')](loggerGetContactDialer(_0xf17f('0x210'),_0x236f31,0x1));emitVoiceQueueSummary(_0x236f31);};Dialer[_0xf17f('0x1c')][_0xf17f('0x1df')]=function(_0x39bfe3,_0x321811,_0x51e64c,_0x411fff,_0x2616b1,_0xaa496){loggerPredictive[_0xf17f('0x7f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xf17f('0x7f')]('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',_0x39bfe3);loggerPredictive[_0xf17f('0x7f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x321811);loggerPredictive['info'](_0xf17f('0x211'),_0x51e64c);loggerPredictive['info'](_0xf17f('0x212'),_0x411fff);loggerPredictive['info'](_0xf17f('0x213'),_0x2616b1);loggerPredictive['info'](_0xf17f('0x88'));return new BPromise(function(_0x2791f5,_0x15d8d7){if(_0x39bfe3<=0x0||isNaN(_0x39bfe3)){return _0x15d8d7(msgResponse(_0xf17f('0x214'),_0xf17f('0x4f'),_0xf17f('0x215')+_0x39bfe3));}if(_0x51e64c<=0x0||isNaN(_0x51e64c)){return _0x15d8d7(msgResponse(_0xf17f('0x214'),_0xf17f('0x4f'),'Ts\x20=\x20'+_0x51e64c));}if(_0x411fff<=0x0||isNaN(_0x411fff)){return _0x15d8d7(msgResponse(_0xf17f('0x214'),_0xf17f('0x4f'),'p\x20=\x20'+_0x411fff));}if(_0x321811<=0x0||isNaN(_0x321811)){return _0x15d8d7(msgResponse(_0xf17f('0x214'),'Error',_0xf17f('0x216')+_0x321811));}if(_0x2616b1<=0x0||isNaN(_0x2616b1)){return _0x15d8d7(msgResponse(_0xf17f('0x214'),_0xf17f('0x4f'),_0xf17f('0x217')+_0x2616b1));}_0xaa496=_0xaa496||0x0;var _0x5be1b7=0x1/_0x51e64c;var _0x3c9b5f=0x0;var _0x3dc4ac=0x0;var _0x536443=0x0;var _0x17bf53=0x0;for(var _0xfdaa10=0x0;_0x536443<_0x2616b1;_0xfdaa10+=0x1){_0x3dc4ac=_0xfdaa10/_0x321811;_0x3c9b5f=(_0x411fff*_0x3dc4ac+_0xaa496)/_0x5be1b7;_0x536443=erlangb(_0x3c9b5f,_0x39bfe3);_0x17bf53=_0x3c9b5f/_0x39bfe3*(0x1-erlangb(_0x3c9b5f,_0x39bfe3));}return _0x2791f5({'erlangCalls':_0xfdaa10,'erlangCallToSecond':_0x321811/_0xfdaa10,'erlangAbandonmentRate':_0x536443,'erlangBusyFactor':_0x17bf53});});};Dialer[_0xf17f('0x1c')]['busyFactor']=function(_0x324400,_0x17e89f,_0x37e63f,_0x3310bb,_0x26d103,_0x2d5740){loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x218'));loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x219'),_0x324400);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x21a'),_0x17e89f);loggerPredictive['info'](_0xf17f('0x211'),_0x37e63f);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x212'),_0x3310bb);loggerPredictive[_0xf17f('0x7f')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x26d103);loggerPredictive[_0xf17f('0x7f')](_0xf17f('0x88'));return new BPromise(function(_0x1eba21,_0x5788c2){if(_0x324400<=0x0||isNaN(_0x324400)){return _0x5788c2(msgResponse('[busyFactor]',_0xf17f('0x4f'),_0xf17f('0x215')+_0x324400));}if(_0x37e63f<=0x0||isNaN(_0x37e63f)){return _0x5788c2(msgResponse(_0xf17f('0x21b'),_0xf17f('0x4f'),_0xf17f('0x21c')+_0x37e63f));}if(_0x3310bb<=0x0||isNaN(_0x3310bb)){return _0x5788c2(msgResponse('[busyFactor]',_0xf17f('0x4f'),_0xf17f('0x21d')+_0x3310bb));}if(_0x17e89f<=0x0||isNaN(_0x17e89f)){return _0x5788c2(msgResponse(_0xf17f('0x21b'),_0xf17f('0x4f'),_0xf17f('0x216')+_0x17e89f));}if(_0x26d103<=0x0||isNaN(_0x26d103)){return _0x5788c2(msgResponse(_0xf17f('0x21b'),_0xf17f('0x4f'),_0xf17f('0x21e')+_0x26d103));}_0x2d5740=_0x2d5740||0x0;var _0x52682f=0x1/_0x37e63f;var _0xce5f35=0x0;var _0x17e3d6=0x0;var _0x5db3ab=0x0;var _0x4b38db=0x0;for(var _0xb4f4d0=0x0;_0x4b38db<_0x26d103;_0xb4f4d0+=0x1){_0x17e3d6=_0xb4f4d0/_0x17e89f;_0xce5f35=(_0x3310bb*_0x17e3d6+_0x2d5740)/_0x52682f;_0x5db3ab=erlangb(_0xce5f35,_0x324400);_0x4b38db=_0xce5f35/_0x324400*(0x1-erlangb(_0xce5f35,_0x324400));}return _0x1eba21({'erlangCalls':_0xb4f4d0,'erlangCallToSecond':_0x17e89f/_0xb4f4d0,'erlangAbandonmentRate':_0x5db3ab,'erlangBusyFactor':_0x4b38db});});};module[_0xf17f('0x21f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 4d01a26..cbe492d 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 _0x1e93=['countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','membername','connectedlinename','reason','callback','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x4ab99,_0x219ed2){var _0x29e39c=function(_0x2dd986){while(--_0x2dd986){_0x4ab99['push'](_0x4ab99['shift']());}};_0x29e39c(++_0x219ed2);}(_0x1e93,0x14b));var _0x31e9=function(_0x4b9219,_0x287ae7){_0x4b9219=_0x4b9219-0x0;var _0x8cd1=_0x1e93[_0x4b9219];return _0x8cd1;};'use strict';var util=require(_0x31e9('0x0'));var _=require(_0x31e9('0x1'));var moment=require(_0x31e9('0x2'));function getSeconds(_0x404393,_0x53eb08){var _0x2e6f3a=moment(_0x404393)[_0x31e9('0x3')](0x0);var _0x56873b=moment(_0x53eb08)['milliseconds'](0x0);return _0x2e6f3a[_0x31e9('0x4')](_0x56873b,_0x31e9('0x5'));}function QueueCallerAbandon(_0x48caa0,_0x551707){this['scheduledat']=_0x48caa0[_0x31e9('0x6')];this[_0x31e9('0x7')]=_0x48caa0[_0x31e9('0x7')];this['campaigntype']=_0x48caa0['type']===_0x31e9('0x8')?'queue':_0x48caa0[_0x31e9('0x7')];this[_0x31e9('0x9')]=_0x48caa0[_0x31e9('0x9')];this[_0x31e9('0xa')]=_0x48caa0['countcongestionretry'];this[_0x31e9('0xb')]=_0x48caa0[_0x31e9('0xb')];this[_0x31e9('0xc')]=_0x48caa0['countbusyretry']+_0x48caa0[_0x31e9('0xa')]+_0x48caa0[_0x31e9('0xb')]+_0x48caa0[_0x31e9('0xd')]+_0x48caa0[_0x31e9('0xe')]+_0x48caa0[_0x31e9('0xf')]+_0x48caa0['countmachineretry']+_0x48caa0[_0x31e9('0x10')];this[_0x31e9('0xd')]=_0x48caa0['countnosuchnumberretry'];this[_0x31e9('0xe')]=_0x48caa0['countdropretry'];this[_0x31e9('0xf')]=_0x48caa0[_0x31e9('0xf')];this['countmachineretry']=_0x48caa0[_0x31e9('0x11')];this[_0x31e9('0x10')]=_0x48caa0[_0x31e9('0x10')];this[_0x31e9('0x12')]=_0x551707[_0x31e9('0x12')];this[_0x31e9('0x13')]=_0x48caa0[_0x31e9('0x14')];this[_0x31e9('0x15')]=_0x48caa0[_0x31e9('0x16')];this[_0x31e9('0x17')]=_0x48caa0['starttime'];this[_0x31e9('0x18')]=_0x48caa0[_0x31e9('0x18')];this[_0x31e9('0x19')]=_0x48caa0[_0x31e9('0x19')];this[_0x31e9('0x1a')]=this[_0x31e9('0x19')];this[_0x31e9('0x1b')]=getSeconds(_0x48caa0[_0x31e9('0x18')],_0x48caa0[_0x31e9('0x17')]);this[_0x31e9('0x1c')]=getSeconds(this[_0x31e9('0x19')],_0x48caa0[_0x31e9('0x18')]);this['talktime']=0x0;this['queue']=_0x551707[_0x31e9('0x1d')];this[_0x31e9('0x1e')]=_0x551707[_0x31e9('0x1f')];this[_0x31e9('0x20')]=_0x551707['reason'];this[_0x31e9('0x21')]=_0x48caa0[_0x31e9('0x21')];this['callbackuniqueid']=_0x48caa0['callbackuniqueid'];this[_0x31e9('0x22')]=_0x48caa0['callbackat'];this['recallme']=_0x48caa0['recallme'];this[_0x31e9('0x23')]=_0x48caa0['ContactId'];this[_0x31e9('0x24')]=_0x48caa0['ListId'];this[_0x31e9('0x25')]=_0x48caa0[_0x31e9('0x25')];this[_0x31e9('0x26')]=_0x48caa0[_0x31e9('0x26')];this[_0x31e9('0x27')]=_0x48caa0[_0x31e9('0x27')];this[_0x31e9('0x28')]=_0x48caa0[_0x31e9('0x28')]||'';this[_0x31e9('0x29')]=_0x48caa0[_0x31e9('0x29')]||'';}module[_0x31e9('0x2a')]=QueueCallerAbandon; \ No newline at end of file +var _0xc164=['droptime','endtime','ringtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','number','starttime','responsetime'];(function(_0x3fb070,_0x4f1802){var _0x113367=function(_0x38a31e){while(--_0x38a31e){_0x3fb070['push'](_0x3fb070['shift']());}};_0x113367(++_0x4f1802);}(_0xc164,0x18e));var _0x4c16=function(_0x531d39,_0x3d999e){_0x531d39=_0x531d39-0x0;var _0x960b86=_0xc164[_0x531d39];return _0x960b86;};'use strict';var util=require('util');var _=require(_0x4c16('0x0'));var moment=require(_0x4c16('0x1'));function getSeconds(_0x384cb9,_0x1cb967){var _0x6e91f0=moment(_0x384cb9)[_0x4c16('0x2')](0x0);var _0x22bb3b=moment(_0x1cb967)[_0x4c16('0x2')](0x0);return _0x6e91f0['diff'](_0x22bb3b,_0x4c16('0x3'));}function QueueCallerAbandon(_0xd00c7,_0x37810f){this[_0x4c16('0x4')]=_0xd00c7[_0x4c16('0x4')];this['type']=_0xd00c7[_0x4c16('0x5')];this[_0x4c16('0x6')]=_0xd00c7[_0x4c16('0x5')]===_0x4c16('0x7')?'queue':_0xd00c7[_0x4c16('0x5')];this[_0x4c16('0x8')]=_0xd00c7[_0x4c16('0x8')];this[_0x4c16('0x9')]=_0xd00c7[_0x4c16('0x9')];this[_0x4c16('0xa')]=_0xd00c7[_0x4c16('0xa')];this[_0x4c16('0xb')]=_0xd00c7[_0x4c16('0x8')]+_0xd00c7['countcongestionretry']+_0xd00c7['countnoanswerretry']+_0xd00c7[_0x4c16('0xc')]+_0xd00c7[_0x4c16('0xd')]+_0xd00c7['countabandonedretry']+_0xd00c7[_0x4c16('0xe')]+_0xd00c7[_0x4c16('0xf')];this[_0x4c16('0xc')]=_0xd00c7['countnosuchnumberretry'];this['countdropretry']=_0xd00c7[_0x4c16('0xd')];this[_0x4c16('0x10')]=_0xd00c7[_0x4c16('0x10')];this[_0x4c16('0xe')]=_0xd00c7['countmachineretry'];this['countagentrejectretry']=_0xd00c7[_0x4c16('0xf')];this[_0x4c16('0x11')]=_0x37810f[_0x4c16('0x11')];this['calleridname']=_0xd00c7[_0x4c16('0x12')];this['calleridnum']=_0xd00c7[_0x4c16('0x13')];this['starttime']=_0xd00c7[_0x4c16('0x14')];this[_0x4c16('0x15')]=_0xd00c7[_0x4c16('0x15')];this[_0x4c16('0x16')]=_0xd00c7[_0x4c16('0x16')];this[_0x4c16('0x17')]=this[_0x4c16('0x16')];this[_0x4c16('0x18')]=getSeconds(_0xd00c7[_0x4c16('0x15')],_0xd00c7[_0x4c16('0x14')]);this['holdtime']=getSeconds(this[_0x4c16('0x16')],_0xd00c7['responsetime']);this[_0x4c16('0x19')]=0x0;this[_0x4c16('0x1a')]=_0x37810f[_0x4c16('0x1a')];this[_0x4c16('0x1b')]=_0x37810f[_0x4c16('0x1c')];this[_0x4c16('0x1d')]=_0x37810f['reason'];this[_0x4c16('0x1e')]=_0xd00c7[_0x4c16('0x1e')];this[_0x4c16('0x1f')]=_0xd00c7['callbackuniqueid'];this[_0x4c16('0x20')]=_0xd00c7['callbackat'];this['recallme']=_0xd00c7[_0x4c16('0x21')];this[_0x4c16('0x22')]=_0xd00c7[_0x4c16('0x22')];this['ListId']=_0xd00c7[_0x4c16('0x23')];this[_0x4c16('0x24')]=_0xd00c7[_0x4c16('0x24')];this[_0x4c16('0x25')]=_0xd00c7[_0x4c16('0x25')];this[_0x4c16('0x26')]=_0xd00c7[_0x4c16('0x26')];this[_0x4c16('0x27')]=_0xd00c7['originatecalleridnum']||'';this[_0x4c16('0x28')]=_0xd00c7[_0x4c16('0x28')]||'';}module[_0x4c16('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 6165f5f..45904e3 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(_0x3ec501,_0x1d035a){var _0x5a3037=function(_0x383d66){while(--_0x383d66){_0x3ec501['push'](_0x3ec501['shift']());}};_0x5a3037(++_0x1d035a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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(_0x439ec2,_0x22f39f){var _0x1c5c00=function(_0xfded82){while(--_0xfded82){_0x439ec2['push'](_0x439ec2['shift']());}};_0x1c5c00(++_0x22f39f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 6c9ba70..a9c027c 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 _0xd8b0=['\x20result\x20conversion\x20file\x20','message','create','application/pdf','notify','calleridnum','.pdf','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','AttachmentId','update','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk\x20Reachable','format','parse','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','path','tiff2pdf','./util/gs','../../../config/logger','fax','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','varset','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','channelstate','channelstatedesc','value','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/'];(function(_0x4fd919,_0x1b3d46){var _0x3c98d1=function(_0xc6fa98){while(--_0xc6fa98){_0x4fd919['push'](_0x4fd919['shift']());}};_0x3c98d1(++_0x1b3d46);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var path=require(_0x0d8b('0x2'));var tiff2pdf=require(_0x0d8b('0x3'));var gs=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x0d8b('0x7'));var ut=require(_0x0d8b('0x8'));var Action=require(_0x0d8b('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x0d8b('0xa'));var faxMessage=require(_0x0d8b('0xb'));function Fax(_0x58e4e2){this[_0x0d8b('0xc')]={};this[_0x0d8b('0xd')]=_0x58e4e2[_0x0d8b('0xd')];this[_0x0d8b('0xe')]=_0x58e4e2[_0x0d8b('0xe')];this[_0x0d8b('0xf')]={};ami['on'](_0x0d8b('0x10'),this[_0x0d8b('0x11')]['bind'](this));ami['on'](_0x0d8b('0x12'),this['syncVarSet'][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x14'),this[_0x0d8b('0x15')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x16'),this[_0x0d8b('0x17')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x18'),this[_0x0d8b('0x19')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x1a'),this[_0x0d8b('0x1b')][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x1c'),this['syncHangup'][_0x0d8b('0x13')](this));ami['on'](_0x0d8b('0x1d'),this[_0x0d8b('0x1e')][_0x0d8b('0x13')](this));}Fax[_0x0d8b('0x1f')]['syncNewchannel']=function(_0x106a01){if(_0x106a01[_0x0d8b('0x20')]===_0x0d8b('0x21')){for(var _0x5fecbd in this[_0x0d8b('0xd')]){if(this[_0x0d8b('0xd')][_0x0d8b('0x22')](_0x5fecbd)){if(_0x106a01[_0x0d8b('0x23')]===this['faxAccounts'][_0x5fecbd][_0x0d8b('0x24')]){this[_0x0d8b('0xc')][_0x106a01[_0x0d8b('0x25')]]={};this[_0x0d8b('0xc')][_0x106a01[_0x0d8b('0x25')]][_0x0d8b('0x26')]=_0x106a01[_0x0d8b('0x26')];this[_0x0d8b('0xc')][_0x106a01['uniqueid']]['id']=this['faxAccounts'][_0x5fecbd]['id'];this[_0x0d8b('0xc')][_0x106a01['uniqueid']]['name']=this['faxAccounts'][_0x5fecbd][_0x0d8b('0x27')];logger[_0x0d8b('0x28')](_0x106a01[_0x0d8b('0x25')],_0x0d8b('0x29'));}}}}if(this[_0x0d8b('0xf')][_0x106a01[_0x0d8b('0x25')]]){this[_0x0d8b('0xc')][_0x106a01[_0x0d8b('0x25')]]={};this[_0x0d8b('0xc')][_0x106a01['uniqueid']][_0x0d8b('0x26')]=_0x106a01[_0x0d8b('0x26')];logger['info'](_0x106a01[_0x0d8b('0x25')],'\x20syncNewchannel\x20');}};Fax[_0x0d8b('0x1f')][_0x0d8b('0x2a')]=function(_0xa2af02){if(this['channels'][_0xa2af02['uniqueid']]){for(var _0x28f639 in _0xa2af02[_0x0d8b('0x2b')]){if(_0xa2af02['variable'][_0x0d8b('0x22')](_0x28f639)){this['channels'][_0xa2af02[_0x0d8b('0x25')]][_0x28f639]=_0xa2af02['value'];}}}};Fax[_0x0d8b('0x1f')]['syncNewState']=function(_0x2ab00d){if(this['channels'][_0x2ab00d[_0x0d8b('0x25')]]){this['channels'][_0x2ab00d[_0x0d8b('0x25')]][_0x0d8b('0x2c')]=_0x2ab00d[_0x0d8b('0x2c')];this['channels'][_0x2ab00d['uniqueid']]['channelstatedesc']=_0x2ab00d[_0x0d8b('0x2d')];}};Fax['prototype'][_0x0d8b('0x17')]=function(_0x54f6f3){if(this['channels'][_0x54f6f3[_0x0d8b('0x25')]]){for(var _0x1b6920 in _0x54f6f3[_0x0d8b('0x2b')]){if(_0x54f6f3[_0x0d8b('0x2b')][_0x0d8b('0x22')](_0x1b6920)){this[_0x0d8b('0xc')][_0x54f6f3[_0x0d8b('0x25')]][_0x1b6920]=_0x54f6f3[_0x0d8b('0x2e')];}}}};Fax['prototype'][_0x0d8b('0x19')]=function(_0x3ef48d){if(this['channels'][_0x3ef48d[_0x0d8b('0x25')]]){this[_0x0d8b('0xc')][_0x3ef48d[_0x0d8b('0x25')]]['operation']=_0x3ef48d[_0x0d8b('0x2f')];this[_0x0d8b('0xc')][_0x3ef48d[_0x0d8b('0x25')]][_0x0d8b('0x30')]=_0x3ef48d[_0x0d8b('0x30')];this['channels'][_0x3ef48d[_0x0d8b('0x25')]][_0x0d8b('0x24')]=_0x3ef48d['localstationid'];this[_0x0d8b('0xc')][_0x3ef48d[_0x0d8b('0x25')]][_0x0d8b('0x31')]=_0x3ef48d[_0x0d8b('0x31')];logger[_0x0d8b('0x28')](_0x3ef48d['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x0d8b('0x1f')]['syncReceiveFax']=function(_0x531c55){var _0xc179bd=this;if(this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]]){var _0x1388b1=this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]]['id'];this['channels'][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x32')]=_0x531c55[_0x0d8b('0x32')];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x33')]=_0x531c55[_0x0d8b('0x33')];this['channels'][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x24')]=_0x531c55[_0x0d8b('0x24')];this[_0x0d8b('0xc')][_0x531c55['uniqueid']][_0x0d8b('0x34')]=_0x531c55['resolution'];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x35')]=_0x531c55[_0x0d8b('0x35')];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]][_0x0d8b('0x31')]=_0x531c55[_0x0d8b('0x31')];this[_0x0d8b('0xc')][_0x531c55[_0x0d8b('0x25')]]['calleridnum']=_0x531c55['calleridnum'];if(this['channels'][_0x531c55['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x531c55[_0x0d8b('0x31')],_0x0d8b('0x36'),function(_0x1e2433){logger['info'](_0x531c55['uniqueid'],_0x0d8b('0x37'),_0x1e2433[_0x0d8b('0x38')]);attachment[_0x0d8b('0x39')]({'name':path['parse'](_0x531c55[_0x0d8b('0x31')])[_0x0d8b('0x27')],'basename':path['parse'](_0x531c55['filename'])[_0x0d8b('0x27')]+'.pdf','type':_0x0d8b('0x3a')})['then'](function(_0x53f643){faxAccount[_0x0d8b('0x3b')](_0x1388b1,{'from':_0x531c55[_0x0d8b('0x3c')],'mapKey':'fax','body':path['parse'](_0x531c55['filename'])['name']+_0x0d8b('0x3d'),'AttachmentId':_0x53f643['id']})[_0x0d8b('0x3e')](function(_0xd9d4c3){logger['error'](_0x531c55[_0x0d8b('0x25')],_0x0d8b('0x3f'),JSON[_0x0d8b('0x40')](_0xd9d4c3));});})[_0x0d8b('0x3e')](function(_0x423ecd){logger[_0x0d8b('0x41')](_0x531c55[_0x0d8b('0x25')],_0x0d8b('0x42'),JSON[_0x0d8b('0x40')](_0x423ecd));});});}logger[_0x0d8b('0x28')](_0x531c55[_0x0d8b('0x25')],_0x0d8b('0x42'));}};Fax[_0x0d8b('0x1f')][_0x0d8b('0x1e')]=function(_0x570af8){if(this[_0x0d8b('0xf')][_0x570af8[_0x0d8b('0x25')]]){_[_0x0d8b('0x43')](this[_0x0d8b('0xc')][_0x570af8['uniqueid']],_[_0x0d8b('0x44')](_0x570af8,['response','reason']));}};function updateStatus(_0x39a31d){if(_0x39a31d[_0x0d8b('0x45')]){faxMessage[_0x0d8b('0x46')](_0x39a31d[_0x0d8b('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x0d8b('0x47')](function(_0x1106d6){ut[_0x0d8b('0x48')](_0x0d8b('0x49'),_0x1106d6);})[_0x0d8b('0x3e')](function(_0x4cd85a){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x4cd85a);});}else{ut['logger'](_0x0d8b('0x4a'));}}Fax[_0x0d8b('0x1f')]['updateStatus']=function(_0x4950a8,_0x44c5c1,_0x3d3cb6){var _0x5c5bd7=this;var _0x5ef6c3={};if(_0x44c5c1){_0x5ef6c3={'read':_0x44c5c1};}else{_0x5ef6c3={'failMessage':_0x3d3cb6};}if(this[_0x0d8b('0xf')][_0x4950a8][_0x0d8b('0x45')]){faxMessage[_0x0d8b('0x46')](this[_0x0d8b('0xf')][_0x4950a8][_0x0d8b('0x45')],_0x5ef6c3)['then'](function(_0x2de903){ut[_0x0d8b('0x48')]('[Fax][Message][Updated]',_0x2de903);})['catch'](function(_0xf6a773){ut[_0x0d8b('0x48')]('[Fax][Message][NoUpdate1]',_0xf6a773);})['finally'](function(){delete _0x5c5bd7[_0x0d8b('0xc')][_0x4950a8];delete _0x5c5bd7[_0x0d8b('0xf')][_0x4950a8];});}else{ut[_0x0d8b('0x48')](_0x0d8b('0x4b'));delete this['channels'][_0x4950a8];delete this[_0x0d8b('0xf')][_0x4950a8];}};Fax['prototype']['syncHangup']=function(_0x38c24e){var _0x44043b=this;if(this['channels'][_0x38c24e['uniqueid']]){if(this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]){this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['id']=this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]['id'];this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['name']=this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]][_0x0d8b('0x27')];}logger[_0x0d8b('0x28')](_0x38c24e[_0x0d8b('0x25')],this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]?_0x0d8b('0x4c'):_0x0d8b('0x4d'),JSON['stringify'](this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]));if(this[_0x0d8b('0xf')][_0x38c24e[_0x0d8b('0x25')]]){if(this[_0x0d8b('0xc')][_0x38c24e['uniqueid']][_0x0d8b('0x4e')]>0x0&&this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]][_0x0d8b('0x18')]===_0x0d8b('0x4f')){this['updateStatus'](_0x38c24e['uniqueid'],!![]);}else{this[_0x0d8b('0x50')](_0x38c24e[_0x0d8b('0x25')],![],this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['faxstatusstring']?_0x0d8b('0x51')+this[_0x0d8b('0xc')][_0x38c24e[_0x0d8b('0x25')]]['faxstatusstring']:_0x0d8b('0x52'));}}}};Fax['prototype'][_0x0d8b('0x53')]=function(_0x3ed63e){var _0x1efce6=this;return new BPromise(function(_0x26ccf0,_0x2b6eb6){_0x1efce6[_0x0d8b('0x54')](_0x3ed63e,_0x1efce6['faxAccounts'][_0x3ed63e[_0x0d8b('0x55')]])['then'](function(_0x71e8d8){ut[_0x0d8b('0x48')](_0x0d8b('0x56'),_0x71e8d8);_0x26ccf0(ut[_0x0d8b('0x38')]('Fax\x20received'));})[_0x0d8b('0x3e')](function(_0x34d01f){ut[_0x0d8b('0x48')](_0x0d8b('0x57'),_0x34d01f);updateStatus(_0x3ed63e);_0x2b6eb6(ut[_0x0d8b('0x38')](_0x0d8b('0x58')));});});};Fax[_0x0d8b('0x1f')][_0x0d8b('0x59')]=function(_0x2ce282){var _0x34affb=this;return new BPromise(function(_0x57e39a,_0x4ee1e8){var _0x6388ae=_0x34affb[_0x0d8b('0x5a')](_0x34affb['faxAccounts'][_0x2ce282[_0x0d8b('0x55')]]['Trunk'],_0x2ce282);if(_0x6388ae['isValid']){_0x57e39a(ut[_0x0d8b('0x38')](_0x0d8b('0x5b')));}else{_0x4ee1e8(ut['message'](_0x6388ae['message']));}});};function originate(_0x1900e3,_0x1c007b,_0x70e4b2){return new BPromise(function(_0x435090,_0x2ab72b){if(_0x70e4b2){var _0x156859=util[_0x0d8b('0x5c')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x0d8b('0x5d')](_0x1900e3['path'])[_0x0d8b('0x27')],_0x1900e3[_0x0d8b('0x2')]);gs[_0x0d8b('0x5e')](_0x156859)[_0x0d8b('0x47')](function(){_0x1900e3['path']=util[_0x0d8b('0x5c')]('%s/%s.tif',path[_0x0d8b('0x5d')](_0x1900e3[_0x0d8b('0x2')])[_0x0d8b('0x5f')],path[_0x0d8b('0x5d')](_0x1900e3[_0x0d8b('0x2')])[_0x0d8b('0x27')]);_0x1c007b[_0x0d8b('0x60')]=_0x1900e3[_0x0d8b('0x2')];ut[_0x0d8b('0x48')](_0x0d8b('0x61'),'');ami['Action'](ut[_0x0d8b('0x62')](_0x1900e3,_0x1c007b))['then'](function(_0x3e4121){_0x435090(_0x3e4121);})[_0x0d8b('0x3e')](function(_0x52c458){_0x2ab72b(_0x52c458);});})[_0x0d8b('0x3e')](function(_0x56e03c){_0x2ab72b(_0x56e03c);});}else{ami[_0x0d8b('0x63')](ut[_0x0d8b('0x62')](_0x1900e3,_0x1c007b))[_0x0d8b('0x47')](function(_0x259ac9){_0x435090(_0x259ac9);})[_0x0d8b('0x3e')](function(_0x299f98){_0x2ab72b(_0x299f98);});}});}Fax[_0x0d8b('0x1f')][_0x0d8b('0x54')]=function(_0x4bde46,_0x10eca6){var _0x8ca59e=this;return new BPromise(function(_0x5b2916,_0x191a5a){var _0x105df9=uuid['v4']();var _0x303d6=ut[_0x0d8b('0x64')](_0x4bde46,_0x10eca6);_0x8ca59e[_0x0d8b('0xf')][_0x105df9]=new Action(_0x105df9,_0x10eca6,_0x4bde46);var _0x9e44b4=_0x8ca59e[_0x0d8b('0xf')][_0x105df9];if(path[_0x0d8b('0x5d')](_0x4bde46[_0x0d8b('0x2')])[_0x0d8b('0x65')]===_0x0d8b('0x3d')){originate(_0x9e44b4,_0x303d6,!![])[_0x0d8b('0x47')](function(_0x50c0ff){_0x5b2916(_0x50c0ff);})[_0x0d8b('0x3e')](function(_0x93fc55){_0x191a5a(_0x93fc55);});}else{originate(_0x9e44b4,_0x303d6,![])[_0x0d8b('0x47')](function(_0x58525c){_0x5b2916(_0x58525c);})['catch'](function(_0xebca83){_0x191a5a(_0xebca83);});}});};Fax[_0x0d8b('0x1f')][_0x0d8b('0x66')]=function(_0x5b76af){return!_['isNil'](_0x5b76af)&&!_[_0x0d8b('0x67')](_0x5b76af[_0x0d8b('0x27')])&&!_[_0x0d8b('0x67')](_0x5b76af[_0x0d8b('0x68')])&&_0x5b76af[_0x0d8b('0x68')]&&!_[_0x0d8b('0x67')](this[_0x0d8b('0xe')][util[_0x0d8b('0x5c')](_0x0d8b('0x69'),_0x5b76af[_0x0d8b('0x27')])])&&!_[_0x0d8b('0x67')](this[_0x0d8b('0xe')][util[_0x0d8b('0x5c')]('SIP/%s',_0x5b76af[_0x0d8b('0x27')])][_0x0d8b('0x30')])&&(this['trunks'][util['format'](_0x0d8b('0x69'),_0x5b76af[_0x0d8b('0x27')])][_0x0d8b('0x30')]===_0x0d8b('0x6a')||this[_0x0d8b('0xe')][util[_0x0d8b('0x5c')]('SIP/%s',_0x5b76af['name'])]['status']===_0x0d8b('0x6b'));};Fax[_0x0d8b('0x1f')][_0x0d8b('0x5a')]=function(_0x28f9b7,_0x3f1eee){if(!this[_0x0d8b('0x66')](_0x28f9b7)){ut['logger'](_0x0d8b('0x6c'),_[_0x0d8b('0x67')](_0x28f9b7)?'':_0x28f9b7['name']+_0x0d8b('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x0d8b('0x67')](_0x3f1eee[_0x0d8b('0x6')])){ut[_0x0d8b('0x48')](_0x0d8b('0x6e'),JSON[_0x0d8b('0x40')](_0x3f1eee));return{'isValid':![],'message':_0x0d8b('0x6f')};}if(_[_0x0d8b('0x67')](_0x3f1eee[_0x0d8b('0x2')])){ut[_0x0d8b('0x48')](_0x0d8b('0x70'),JSON[_0x0d8b('0x40')](_0x3f1eee));return{'isValid':![],'message':_0x0d8b('0x71')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0xab40=['syncHangup','originateresponse','syncOriginateResponse','prototype','exten','localstationid','channels','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','syncNewState','channelstate','hasOwnProperty','operation','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','execute','%s/%s.tif','XMF-PATH','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','status','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','path','tiff2pdf','./util/gs','../../../config/logger','fax','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup'];(function(_0x5a558e,_0x2c0473){var _0x44eb26=function(_0x1841b4){while(--_0x1841b4){_0x5a558e['push'](_0x5a558e['shift']());}};_0x44eb26(++_0x2c0473);}(_0xab40,0xcd));var _0x0ab4=function(_0x33aef6,_0x16e6f9){_0x33aef6=_0x33aef6-0x0;var _0x5575a4=_0xab40[_0x33aef6];return _0x5575a4;};'use strict';var util=require(_0x0ab4('0x0'));var _=require(_0x0ab4('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var path=require(_0x0ab4('0x2'));var tiff2pdf=require(_0x0ab4('0x3'));var gs=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x0ab4('0x7'));var ut=require('./util/util');var Action=require(_0x0ab4('0x8'));var faxAccount=require(_0x0ab4('0x9'));var attachment=require(_0x0ab4('0xa'));var faxMessage=require(_0x0ab4('0xb'));function Fax(_0x4cf8de){this['channels']={};this['faxAccounts']=_0x4cf8de[_0x0ab4('0xc')];this[_0x0ab4('0xd')]=_0x4cf8de[_0x0ab4('0xd')];this[_0x0ab4('0xe')]={};ami['on'](_0x0ab4('0xf'),this[_0x0ab4('0x10')][_0x0ab4('0x11')](this));ami['on'](_0x0ab4('0x12'),this['syncVarSet']['bind'](this));ami['on'](_0x0ab4('0x13'),this['syncNewState'][_0x0ab4('0x11')](this));ami['on'](_0x0ab4('0x14'),this[_0x0ab4('0x15')][_0x0ab4('0x11')](this));ami['on'](_0x0ab4('0x16'),this[_0x0ab4('0x17')][_0x0ab4('0x11')](this));ami['on'](_0x0ab4('0x18'),this[_0x0ab4('0x19')][_0x0ab4('0x11')](this));ami['on'](_0x0ab4('0x1a'),this[_0x0ab4('0x1b')][_0x0ab4('0x11')](this));ami['on'](_0x0ab4('0x1c'),this[_0x0ab4('0x1d')][_0x0ab4('0x11')](this));}Fax[_0x0ab4('0x1e')][_0x0ab4('0x10')]=function(_0x4f37b6){if(_0x4f37b6['context']==='from-voip-provider'){for(var _0x17422f in this[_0x0ab4('0xc')]){if(this[_0x0ab4('0xc')]['hasOwnProperty'](_0x17422f)){if(_0x4f37b6[_0x0ab4('0x1f')]===this[_0x0ab4('0xc')][_0x17422f][_0x0ab4('0x20')]){this[_0x0ab4('0x21')][_0x4f37b6['uniqueid']]={};this['channels'][_0x4f37b6[_0x0ab4('0x22')]]['channel']=_0x4f37b6[_0x0ab4('0x23')];this[_0x0ab4('0x21')][_0x4f37b6['uniqueid']]['id']=this[_0x0ab4('0xc')][_0x17422f]['id'];this[_0x0ab4('0x21')][_0x4f37b6[_0x0ab4('0x22')]][_0x0ab4('0x24')]=this[_0x0ab4('0xc')][_0x17422f]['name'];logger['info'](_0x4f37b6[_0x0ab4('0x22')],_0x0ab4('0x25'));}}}}if(this[_0x0ab4('0xe')][_0x4f37b6[_0x0ab4('0x22')]]){this['channels'][_0x4f37b6[_0x0ab4('0x22')]]={};this[_0x0ab4('0x21')][_0x4f37b6[_0x0ab4('0x22')]]['channel']=_0x4f37b6['channel'];logger[_0x0ab4('0x26')](_0x4f37b6[_0x0ab4('0x22')],_0x0ab4('0x25'));}};Fax['prototype']['syncVarSet']=function(_0x49c72d){if(this[_0x0ab4('0x21')][_0x49c72d['uniqueid']]){for(var _0x3bf844 in _0x49c72d[_0x0ab4('0x27')]){if(_0x49c72d['variable']['hasOwnProperty'](_0x3bf844)){this['channels'][_0x49c72d[_0x0ab4('0x22')]][_0x3bf844]=_0x49c72d[_0x0ab4('0x28')];}}}};Fax[_0x0ab4('0x1e')][_0x0ab4('0x29')]=function(_0x25385e){if(this['channels'][_0x25385e['uniqueid']]){this['channels'][_0x25385e[_0x0ab4('0x22')]][_0x0ab4('0x2a')]=_0x25385e[_0x0ab4('0x2a')];this[_0x0ab4('0x21')][_0x25385e[_0x0ab4('0x22')]]['channelstatedesc']=_0x25385e['channelstatedesc'];}};Fax[_0x0ab4('0x1e')][_0x0ab4('0x15')]=function(_0x361f7c){if(this['channels'][_0x361f7c['uniqueid']]){for(var _0x1b19db in _0x361f7c['variable']){if(_0x361f7c[_0x0ab4('0x27')][_0x0ab4('0x2b')](_0x1b19db)){this[_0x0ab4('0x21')][_0x361f7c[_0x0ab4('0x22')]][_0x1b19db]=_0x361f7c[_0x0ab4('0x28')];}}}};Fax[_0x0ab4('0x1e')]['syncFaxStatus']=function(_0x133311){if(this[_0x0ab4('0x21')][_0x133311[_0x0ab4('0x22')]]){this[_0x0ab4('0x21')][_0x133311['uniqueid']]['operation']=_0x133311[_0x0ab4('0x2c')];this[_0x0ab4('0x21')][_0x133311[_0x0ab4('0x22')]]['status']=_0x133311['status'];this['channels'][_0x133311[_0x0ab4('0x22')]][_0x0ab4('0x20')]=_0x133311[_0x0ab4('0x20')];this['channels'][_0x133311['uniqueid']]['filename']=_0x133311[_0x0ab4('0x2d')];logger[_0x0ab4('0x26')](_0x133311[_0x0ab4('0x22')],_0x0ab4('0x2e'));}};Fax[_0x0ab4('0x1e')][_0x0ab4('0x19')]=function(_0x52d9bf){var _0xfb7f92=this;if(this[_0x0ab4('0x21')][_0x52d9bf[_0x0ab4('0x22')]]){var _0x4f3853=this[_0x0ab4('0x21')][_0x52d9bf[_0x0ab4('0x22')]]['id'];this[_0x0ab4('0x21')][_0x52d9bf[_0x0ab4('0x22')]][_0x0ab4('0x2f')]=_0x52d9bf[_0x0ab4('0x2f')];this[_0x0ab4('0x21')][_0x52d9bf[_0x0ab4('0x22')]][_0x0ab4('0x30')]=_0x52d9bf[_0x0ab4('0x30')];this[_0x0ab4('0x21')][_0x52d9bf[_0x0ab4('0x22')]]['localstationid']=_0x52d9bf[_0x0ab4('0x20')];this[_0x0ab4('0x21')][_0x52d9bf[_0x0ab4('0x22')]][_0x0ab4('0x31')]=_0x52d9bf['resolution'];this[_0x0ab4('0x21')][_0x52d9bf['uniqueid']][_0x0ab4('0x32')]=_0x52d9bf[_0x0ab4('0x32')];this[_0x0ab4('0x21')][_0x52d9bf[_0x0ab4('0x22')]][_0x0ab4('0x2d')]=_0x52d9bf[_0x0ab4('0x2d')];this['channels'][_0x52d9bf[_0x0ab4('0x22')]][_0x0ab4('0x33')]=_0x52d9bf[_0x0ab4('0x33')];if(this['channels'][_0x52d9bf[_0x0ab4('0x22')]][_0x0ab4('0x30')]>0x0){tiff2pdf(_0x52d9bf[_0x0ab4('0x2d')],_0x0ab4('0x34'),function(_0x35678e){logger['info'](_0x52d9bf['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x35678e[_0x0ab4('0x35')]);attachment[_0x0ab4('0x36')]({'name':path['parse'](_0x52d9bf[_0x0ab4('0x2d')])['name'],'basename':path[_0x0ab4('0x37')](_0x52d9bf['filename'])[_0x0ab4('0x24')]+_0x0ab4('0x38'),'type':_0x0ab4('0x39')})[_0x0ab4('0x3a')](function(_0x1e01a7){faxAccount[_0x0ab4('0x3b')](_0x4f3853,{'from':_0x52d9bf['calleridnum'],'mapKey':_0x0ab4('0x6'),'body':path[_0x0ab4('0x37')](_0x52d9bf[_0x0ab4('0x2d')])[_0x0ab4('0x24')]+_0x0ab4('0x38'),'AttachmentId':_0x1e01a7['id']})[_0x0ab4('0x3c')](function(_0x54c201){logger[_0x0ab4('0x3d')](_0x52d9bf['uniqueid'],_0x0ab4('0x3e'),JSON[_0x0ab4('0x3f')](_0x54c201));});})[_0x0ab4('0x3c')](function(_0x518762){logger[_0x0ab4('0x3d')](_0x52d9bf[_0x0ab4('0x22')],_0x0ab4('0x40'),JSON[_0x0ab4('0x3f')](_0x518762));});});}logger[_0x0ab4('0x26')](_0x52d9bf[_0x0ab4('0x22')],'\x20receiveFax\x20');}};Fax[_0x0ab4('0x1e')][_0x0ab4('0x1d')]=function(_0x302894){if(this[_0x0ab4('0xe')][_0x302894[_0x0ab4('0x22')]]){_[_0x0ab4('0x41')](this[_0x0ab4('0x21')][_0x302894[_0x0ab4('0x22')]],_[_0x0ab4('0x42')](_0x302894,[_0x0ab4('0x43'),_0x0ab4('0x44')]));}};function updateStatus(_0x2cead1){if(_0x2cead1[_0x0ab4('0x45')]){faxMessage['update'](_0x2cead1[_0x0ab4('0x45')],{'failMessage':_0x0ab4('0x46')})['then'](function(_0x23b899){ut['logger']('[Fax][Message][Error][Updated]',_0x23b899);})[_0x0ab4('0x3c')](function(_0x2cc8c4){ut[_0x0ab4('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x2cc8c4);});}else{ut[_0x0ab4('0x47')](_0x0ab4('0x48'));}}Fax[_0x0ab4('0x1e')][_0x0ab4('0x49')]=function(_0x30ba95,_0x3f20de,_0x1eea3b){var _0x52d0c5=this;var _0x20fd66={};if(_0x3f20de){_0x20fd66={'read':_0x3f20de};}else{_0x20fd66={'failMessage':_0x1eea3b};}if(this['actions'][_0x30ba95][_0x0ab4('0x45')]){faxMessage['update'](this[_0x0ab4('0xe')][_0x30ba95]['AttachmentId'],_0x20fd66)['then'](function(_0x3983ca){ut[_0x0ab4('0x47')](_0x0ab4('0x4a'),_0x3983ca);})[_0x0ab4('0x3c')](function(_0x4e2db5){ut[_0x0ab4('0x47')](_0x0ab4('0x4b'),_0x4e2db5);})[_0x0ab4('0x4c')](function(){delete _0x52d0c5[_0x0ab4('0x21')][_0x30ba95];delete _0x52d0c5[_0x0ab4('0xe')][_0x30ba95];});}else{ut[_0x0ab4('0x47')](_0x0ab4('0x4d'));delete this[_0x0ab4('0x21')][_0x30ba95];delete this[_0x0ab4('0xe')][_0x30ba95];}};Fax[_0x0ab4('0x1e')][_0x0ab4('0x1b')]=function(_0x355ba8){var _0x370183=this;if(this[_0x0ab4('0x21')][_0x355ba8[_0x0ab4('0x22')]]){if(this[_0x0ab4('0xe')][_0x355ba8[_0x0ab4('0x22')]]){this[_0x0ab4('0x21')][_0x355ba8[_0x0ab4('0x22')]]['id']=this['actions'][_0x355ba8[_0x0ab4('0x22')]]['id'];this[_0x0ab4('0x21')][_0x355ba8[_0x0ab4('0x22')]][_0x0ab4('0x24')]=this[_0x0ab4('0xe')][_0x355ba8[_0x0ab4('0x22')]][_0x0ab4('0x24')];}logger[_0x0ab4('0x26')](_0x355ba8['uniqueid'],this[_0x0ab4('0xe')][_0x355ba8[_0x0ab4('0x22')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x0ab4('0x3f')](this[_0x0ab4('0x21')][_0x355ba8['uniqueid']]));if(this['actions'][_0x355ba8[_0x0ab4('0x22')]]){if(this['channels'][_0x355ba8['uniqueid']][_0x0ab4('0x4e')]>0x0&&this[_0x0ab4('0x21')][_0x355ba8[_0x0ab4('0x22')]][_0x0ab4('0x16')]===_0x0ab4('0x4f')){this[_0x0ab4('0x49')](_0x355ba8[_0x0ab4('0x22')],!![]);}else{this['updateStatus'](_0x355ba8[_0x0ab4('0x22')],![],this[_0x0ab4('0x21')][_0x355ba8[_0x0ab4('0x22')]][_0x0ab4('0x50')]?_0x0ab4('0x51')+this[_0x0ab4('0x21')][_0x355ba8['uniqueid']][_0x0ab4('0x50')]:_0x0ab4('0x52'));}}}};Fax['prototype'][_0x0ab4('0x53')]=function(_0x5b41af){var _0x410198=this;return new BPromise(function(_0x4e7fc9,_0x268b23){_0x410198[_0x0ab4('0x54')](_0x5b41af,_0x410198[_0x0ab4('0xc')][_0x5b41af[_0x0ab4('0x55')]])['then'](function(_0x581547){ut[_0x0ab4('0x47')](_0x0ab4('0x56'),_0x581547);_0x4e7fc9(ut['message'](_0x0ab4('0x57')));})[_0x0ab4('0x3c')](function(_0x34f968){ut['logger'](_0x0ab4('0x58'),_0x34f968);updateStatus(_0x5b41af);_0x268b23(ut[_0x0ab4('0x35')](_0x0ab4('0x59')));});});};Fax[_0x0ab4('0x1e')][_0x0ab4('0x5a')]=function(_0x2f6afe){var _0x413817=this;return new BPromise(function(_0x2bd0f0,_0x4f043b){var _0x594027=_0x413817[_0x0ab4('0x5b')](_0x413817[_0x0ab4('0xc')][_0x2f6afe[_0x0ab4('0x55')]][_0x0ab4('0x5c')],_0x2f6afe);if(_0x594027['isValid']){_0x2bd0f0(ut[_0x0ab4('0x35')]('Trunk\x20Reachable'));}else{_0x4f043b(ut[_0x0ab4('0x35')](_0x594027[_0x0ab4('0x35')]));}});};function originate(_0x18308f,_0x3e5f11,_0x340129){return new BPromise(function(_0x41b65f,_0x46a008){if(_0x340129){var _0xf42b98=util[_0x0ab4('0x5d')]('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[_0x0ab4('0x37')](_0x18308f['path'])[_0x0ab4('0x24')],_0x18308f[_0x0ab4('0x2')]);gs[_0x0ab4('0x5e')](_0xf42b98)[_0x0ab4('0x3a')](function(){_0x18308f[_0x0ab4('0x2')]=util[_0x0ab4('0x5d')](_0x0ab4('0x5f'),path[_0x0ab4('0x37')](_0x18308f[_0x0ab4('0x2')])['dir'],path[_0x0ab4('0x37')](_0x18308f[_0x0ab4('0x2')])['name']);_0x3e5f11[_0x0ab4('0x60')]=_0x18308f[_0x0ab4('0x2')];ut[_0x0ab4('0x47')]('Convert\x20pdf\x20to\x20tif','');ami[_0x0ab4('0x61')](ut[_0x0ab4('0x62')](_0x18308f,_0x3e5f11))[_0x0ab4('0x3a')](function(_0x317c96){_0x41b65f(_0x317c96);})['catch'](function(_0x5bf57e){_0x46a008(_0x5bf57e);});})[_0x0ab4('0x3c')](function(_0x17d76b){_0x46a008(_0x17d76b);});}else{ami[_0x0ab4('0x61')](ut[_0x0ab4('0x62')](_0x18308f,_0x3e5f11))['then'](function(_0xa55ec6){_0x41b65f(_0xa55ec6);})[_0x0ab4('0x3c')](function(_0x5281da){_0x46a008(_0x5281da);});}});}Fax['prototype']['execOriginate']=function(_0x10852d,_0x2d2dbb){var _0x4c8c5a=this;return new BPromise(function(_0x16ec79,_0x46f69a){var _0x1c8965=uuid['v4']();var _0x2ae87e=ut['addVariables'](_0x10852d,_0x2d2dbb);_0x4c8c5a[_0x0ab4('0xe')][_0x1c8965]=new Action(_0x1c8965,_0x2d2dbb,_0x10852d);var _0x57ed73=_0x4c8c5a['actions'][_0x1c8965];if(path[_0x0ab4('0x37')](_0x10852d['path'])[_0x0ab4('0x63')]===_0x0ab4('0x38')){originate(_0x57ed73,_0x2ae87e,!![])[_0x0ab4('0x3a')](function(_0x368573){_0x16ec79(_0x368573);})[_0x0ab4('0x3c')](function(_0x4bffd4){_0x46f69a(_0x4bffd4);});}else{originate(_0x57ed73,_0x2ae87e,![])['then'](function(_0x88787f){_0x16ec79(_0x88787f);})[_0x0ab4('0x3c')](function(_0x55afa1){_0x46f69a(_0x55afa1);});}});};Fax['prototype'][_0x0ab4('0x64')]=function(_0x3e3ded){return!_['isNil'](_0x3e3ded)&&!_[_0x0ab4('0x65')](_0x3e3ded[_0x0ab4('0x24')])&&!_[_0x0ab4('0x65')](_0x3e3ded['active'])&&_0x3e3ded[_0x0ab4('0x66')]&&!_[_0x0ab4('0x65')](this[_0x0ab4('0xd')][util[_0x0ab4('0x5d')]('SIP/%s',_0x3e3ded[_0x0ab4('0x24')])])&&!_[_0x0ab4('0x65')](this[_0x0ab4('0xd')][util[_0x0ab4('0x5d')](_0x0ab4('0x67'),_0x3e3ded[_0x0ab4('0x24')])][_0x0ab4('0x68')])&&(this[_0x0ab4('0xd')][util[_0x0ab4('0x5d')](_0x0ab4('0x67'),_0x3e3ded['name'])][_0x0ab4('0x68')]===_0x0ab4('0x69')||this[_0x0ab4('0xd')][util[_0x0ab4('0x5d')](_0x0ab4('0x67'),_0x3e3ded['name'])][_0x0ab4('0x68')]===_0x0ab4('0x6a'));};Fax[_0x0ab4('0x1e')][_0x0ab4('0x5b')]=function(_0x1dcaee,_0x7af9c6){if(!this[_0x0ab4('0x64')](_0x1dcaee)){ut[_0x0ab4('0x47')](_0x0ab4('0x6b'),_[_0x0ab4('0x65')](_0x1dcaee)?'':_0x1dcaee[_0x0ab4('0x24')]+_0x0ab4('0x6c'));return{'isValid':![],'message':_0x0ab4('0x6d')};}if(_[_0x0ab4('0x65')](_0x7af9c6['fax'])){ut[_0x0ab4('0x47')](_0x0ab4('0x6e'),JSON[_0x0ab4('0x3f')](_0x7af9c6));return{'isValid':![],'message':_0x0ab4('0x6f')};}if(_['isNil'](_0x7af9c6['path'])){ut[_0x0ab4('0x47')](_0x0ab4('0x70'),JSON['stringify'](_0x7af9c6));return{'isValid':![],'message':_0x0ab4('0x71')};}return{'isValid':!![],'message':_0x0ab4('0x72')};};module[_0x0ab4('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6e11acb..c9d7816 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 _0xd477=['util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','inspect','resolve','then','notify','catch','[Notify]\x20'];(function(_0x1e446b,_0x36a631){var _0x17a422=function(_0x3fbcf3){while(--_0x3fbcf3){_0x1e446b['push'](_0x1e446b['shift']());}};_0x17a422(++_0x36a631);}(_0xd477,0x9a));var _0x7d47=function(_0x16e5b3,_0x30d91d){_0x16e5b3=_0x16e5b3-0x0;var _0x4d6874=_0xd477[_0x16e5b3];return _0x4d6874;};'use strict';var util=require(_0x7d47('0x0'));var BPromise=require(_0x7d47('0x1'));var logger=require(_0x7d47('0x2'))('preview');var _=require(_0x7d47('0x3'));var faxAccount=require(_0x7d47('0x4'));function loggerCatch(_0x2ff909){return function(_0x336fcf){logger['error'](_0x2ff909,util[_0x7d47('0x5')](_0x336fcf,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x3d3055,_0x14c196){return BPromise[_0x7d47('0x6')]()[_0x7d47('0x7')](faxAccount[_0x7d47('0x8')](_0x3d3055,_0x14c196))[_0x7d47('0x9')](loggerCatch(_0x7d47('0xa')));}; \ No newline at end of file +var _0x30c1=['bluebird','../../../config/logger','preview','lodash','error','notify','resolve','then','catch','util'];(function(_0x51ca28,_0x1eefba){var _0xec66bf=function(_0xc520e0){while(--_0xc520e0){_0x51ca28['push'](_0x51ca28['shift']());}};_0xec66bf(++_0x1eefba);}(_0x30c1,0x167));var _0x130c=function(_0x10fa46,_0x4dec57){_0x10fa46=_0x10fa46-0x0;var _0x2caf05=_0x30c1[_0x10fa46];return _0x2caf05;};'use strict';var util=require(_0x130c('0x0'));var BPromise=require(_0x130c('0x1'));var logger=require(_0x130c('0x2'))(_0x130c('0x3'));var _=require(_0x130c('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x3f3db7){return function(_0x6c367){logger[_0x130c('0x5')](_0x3f3db7,util['inspect'](_0x6c367,{'showHidden':![],'depth':null}));};}exports[_0x130c('0x6')]=function(_0x1732eb,_0x79f127){return BPromise[_0x130c('0x7')]()[_0x130c('0x8')](faxAccount[_0x130c('0x6')](_0x1732eb,_0x79f127))[_0x130c('0x9')](loggerCatch('[Notify]\x20'));}; \ 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 baf8fa6..1a17587 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 _0x80ad=['exec','Exec\x20gs','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x1b060f,_0x5b2c63){var _0x5bb96a=function(_0x58d082){while(--_0x58d082){_0x1b060f['push'](_0x1b060f['shift']());}};_0x5bb96a(++_0x5b2c63);}(_0x80ad,0x113));var _0xd80a=function(_0x7791d5,_0xdab65f){_0x7791d5=_0x7791d5-0x0;var _0x5ce288=_0x80ad[_0x7791d5];return _0x5ce288;};'use strict';var util=require(_0xd80a('0x0'));var logger=require(_0xd80a('0x1'))(_0xd80a('0x2'));var BPromise=require(_0xd80a('0x3'));var exec=require(_0xd80a('0x4'))[_0xd80a('0x5')];exports['execute']=function(_0x32e5e0){return new BPromise(function(_0x2abefc,_0x38e2c0){exec(_0x32e5e0,function(_0x6feb6a,_0x5a0028,_0x2c4f92){logger['info'](_0xd80a('0x6'),_0x5a0028);if(_0x6feb6a){logger[_0xd80a('0x7')](_0xd80a('0x6'),_0xd80a('0x8'),util[_0xd80a('0x9')](_0x6feb6a,{'showHidden':![],'depth':null}),_0x5a0028,_0x2c4f92);_0x38e2c0(_0x6feb6a);}_0x2abefc(_0x5a0028);});});}; \ No newline at end of file +var _0x292c=['info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','execute'];(function(_0xadb0fd,_0x287b47){var _0x29e113=function(_0xb3b140){while(--_0xb3b140){_0xadb0fd['push'](_0xadb0fd['shift']());}};_0x29e113(++_0x287b47);}(_0x292c,0x1aa));var _0xc292=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x292c[_0x333714];return _0x4c211e;};'use strict';var util=require(_0xc292('0x0'));var logger=require(_0xc292('0x1'))(_0xc292('0x2'));var BPromise=require(_0xc292('0x3'));var exec=require(_0xc292('0x4'))['exec'];exports[_0xc292('0x5')]=function(_0x31a42f){return new BPromise(function(_0x9908cf,_0xd67625){exec(_0x31a42f,function(_0x4685cc,_0x3371d4,_0x9ef9e5){logger[_0xc292('0x6')](_0xc292('0x7'),_0x3371d4);if(_0x4685cc){logger[_0xc292('0x6')](_0xc292('0x7'),_0xc292('0x8'),util['inspect'](_0x4685cc,{'showHidden':![],'depth':null}),_0x3371d4,_0x9ef9e5);_0xd67625(_0x4685cc);}_0x9908cf(_0x3371d4);});});}; \ 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 601bc38..c0aeb5d 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 _0x9916=['from-sip','format','\x22%s\x22\x20<%s>','moment','../../../../config/logger','message','info','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','channel','xcally-motion-fax'];(function(_0x56bc14,_0x746264){var _0x12611=function(_0x4224ca){while(--_0x4224ca){_0x56bc14['push'](_0x56bc14['shift']());}};_0x12611(++_0x746264);}(_0x9916,0x1a5));var _0x6991=function(_0x11009b,_0x12e41f){_0x11009b=_0x11009b-0x0;var _0x3aeee2=_0x9916[_0x11009b];return _0x3aeee2;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x6991('0x0'));var logger=require(_0x6991('0x1'))('fax');exports[_0x6991('0x2')]=function(_0x53bf9d){return{'message':_0x53bf9d};};exports['logger']=function(_0x23c041,_0x2145c7){logger[_0x6991('0x3')](_0x23c041,util['inspect'](_0x2145c7,{'showHidden':![],'depth':null}));};exports[_0x6991('0x4')]=function(_0x5baeb5,_0x1dc5b1){var _0x3c7708={'XMF-ECM':_0x1dc5b1[_0x6991('0x5')],'XMF-HEADERINFO':_0x1dc5b1[_0x6991('0x6')],'XMF-MINRATE':_0x1dc5b1['minrate'],'XMF-MAXRATE':_0x1dc5b1[_0x6991('0x7')],'XMF-MODEM':util['format'](_0x6991('0x8'),_0x1dc5b1[_0x6991('0x9')]),'XMF-GATEWAY':_0x1dc5b1[_0x6991('0xa')],'XMF-FAXDETECT':_0x1dc5b1[_0x6991('0xb')],'XMF-T38TIMEOUT':_0x1dc5b1[_0x6991('0xc')],'XMF-LOCALSTATIONID':_0x1dc5b1[_0x6991('0xd')],'XMF-PATH':_0x5baeb5[_0x6991('0xe')]};return _0x3c7708;};exports[_0x6991('0xf')]=function(_0xfab995,_0x530a8c){return{'actionid':_0xfab995[_0x6991('0x10')],'action':'originate','channel':_0xfab995[_0x6991('0x11')],'Exten':_0x6991('0x12'),'Context':_0x6991('0x13'),'Priority':'1','callerid':util[_0x6991('0x14')](_0x6991('0x15'),_0xfab995[_0x6991('0x6')]?_0xfab995['headerinfo']:'',_0xfab995[_0x6991('0xd')]),'variable':_0x530a8c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xfab995[_0x6991('0x10')]};}; \ No newline at end of file +var _0xcd94=['ecm','headerinfo','minrate','format','\x22%s\x22','modem','faxdetect','t38timeout','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables'];(function(_0x1a4169,_0x5ddf1a){var _0x197233=function(_0x36edaf){while(--_0x36edaf){_0x1a4169['push'](_0x1a4169['shift']());}};_0x197233(++_0x5ddf1a);}(_0xcd94,0x69));var _0x4cd9=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0xcd94[_0x53f0db];return _0xae0a5c;};'use strict';var util=require(_0x4cd9('0x0'));var _=require(_0x4cd9('0x1'));var moment=require(_0x4cd9('0x2'));var logger=require(_0x4cd9('0x3'))(_0x4cd9('0x4'));exports[_0x4cd9('0x5')]=function(_0x50cf3a){return{'message':_0x50cf3a};};exports[_0x4cd9('0x6')]=function(_0x3301c1,_0x1afc39){logger[_0x4cd9('0x7')](_0x3301c1,util[_0x4cd9('0x8')](_0x1afc39,{'showHidden':![],'depth':null}));};exports[_0x4cd9('0x9')]=function(_0x1b9746,_0x307efa){var _0x23c640={'XMF-ECM':_0x307efa[_0x4cd9('0xa')],'XMF-HEADERINFO':_0x307efa[_0x4cd9('0xb')],'XMF-MINRATE':_0x307efa[_0x4cd9('0xc')],'XMF-MAXRATE':_0x307efa['maxrate'],'XMF-MODEM':util[_0x4cd9('0xd')](_0x4cd9('0xe'),_0x307efa[_0x4cd9('0xf')]),'XMF-GATEWAY':_0x307efa['gateway'],'XMF-FAXDETECT':_0x307efa[_0x4cd9('0x10')],'XMF-T38TIMEOUT':_0x307efa[_0x4cd9('0x11')],'XMF-LOCALSTATIONID':_0x307efa['localstationid'],'XMF-PATH':_0x1b9746['path']};return _0x23c640;};exports['variablesAction']=function(_0x5cd40e,_0x112595){return{'actionid':_0x5cd40e[_0x4cd9('0x12')],'action':'originate','channel':_0x5cd40e[_0x4cd9('0x13')],'Exten':_0x4cd9('0x14'),'Context':_0x4cd9('0x15'),'Priority':'1','callerid':util[_0x4cd9('0xd')](_0x4cd9('0x16'),_0x5cd40e[_0x4cd9('0xb')]?_0x5cd40e[_0x4cd9('0xb')]:'',_0x5cd40e['localstationid']),'variable':_0x112595,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5cd40e[_0x4cd9('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index b13a012..e29b980 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 _0x2493=['./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','../../config/logger','ami','get','hour','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','listen','sync','[index.js][main]','inspect','bluebird','moment','./server','./realtime','./report','./acw'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2493,0x1a4));var _0x3249=function(_0x166bbf,_0x40d87f){_0x166bbf=_0x166bbf-0x0;var _0x4f6089=_0x2493[_0x166bbf];return _0x4f6089;};'use strict';var BPromise=require(_0x3249('0x0'));var util=require('util');var moment=require(_0x3249('0x1'));var server=require(_0x3249('0x2'));var Realtime=require(_0x3249('0x3'));var Report=require(_0x3249('0x4'));var Acw=require(_0x3249('0x5'));var Trigger=require(_0x3249('0x6'));var Dialer=require(_0x3249('0x7'));var Preview=require(_0x3249('0x8'));var Fax=require(_0x3249('0x9'));var user=require(_0x3249('0xa'));var voiceQueue=require(_0x3249('0xb'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x3249('0xc'));var trunk=require(_0x3249('0xd'));var trigger=require('./rpc/trigger');var template=require(_0x3249('0xe'));var cmHopperHistory=require(_0x3249('0xf'));var campaign=require(_0x3249('0x10'));var voiceExtension=require(_0x3249('0x11'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x3249('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0x3249('0x13'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x3249('0x14'));var freshsales=require(_0x3249('0x15'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x3249('0x16'))(_0x3249('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x3249('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x3249('0x18')](_0x3249('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3249('0x1a')]()[_0x3249('0x1b')](user[_0x3249('0x1c')]())[_0x3249('0x1b')](realtime['initAgents']())[_0x3249('0x1b')](user[_0x3249('0x1d')]())[_0x3249('0x1b')](realtime[_0x3249('0x1e')]())[_0x3249('0x1b')](trunk[_0x3249('0x1f')]())['then'](realtime[_0x3249('0x20')]())[_0x3249('0x1b')](voiceQueue[_0x3249('0x21')]())['then'](realtime[_0x3249('0x22')]())[_0x3249('0x1b')](trigger[_0x3249('0x23')]())['then'](realtime['initTriggers']())[_0x3249('0x1b')](template[_0x3249('0x24')]())[_0x3249('0x1b')](realtime['initTemplates']())[_0x3249('0x1b')](zendesk[_0x3249('0x25')]())[_0x3249('0x1b')](realtime[_0x3249('0x26')]())[_0x3249('0x1b')](salesforce[_0x3249('0x27')]())[_0x3249('0x1b')](realtime[_0x3249('0x28')]())['then'](sugarcrm[_0x3249('0x29')]())['then'](realtime[_0x3249('0x2a')]())[_0x3249('0x1b')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x3249('0x2b')]())[_0x3249('0x1b')](desk[_0x3249('0x2c')]())[_0x3249('0x1b')](realtime[_0x3249('0x2d')]())[_0x3249('0x1b')](zoho[_0x3249('0x2e')]())[_0x3249('0x1b')](realtime[_0x3249('0x2f')]())['then'](vtiger[_0x3249('0x30')]())[_0x3249('0x1b')](realtime[_0x3249('0x31')]())[_0x3249('0x1b')](freshsales[_0x3249('0x32')]())[_0x3249('0x1b')](realtime[_0x3249('0x33')]())[_0x3249('0x1b')](servicenow['getServicenowAccounts']())['then'](realtime[_0x3249('0x34')]())[_0x3249('0x1b')](dynamics365[_0x3249('0x35')]())[_0x3249('0x1b')](realtime['initDynamics365Accounts']())[_0x3249('0x1b')](campaign['getCampaigns']())[_0x3249('0x1b')](realtime['initCampaigns']())[_0x3249('0x1b')](voiceExtension[_0x3249('0x36')]())[_0x3249('0x1b')](realtime['initVoiceExtensions']())[_0x3249('0x1b')](faxAccount[_0x3249('0x37')]())[_0x3249('0x1b')](realtime['initFaxAccounts']())[_0x3249('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x3249('0x1a')]()[_0x3249('0x1b')](voiceQueueReport[_0x3249('0x38')]())[_0x3249('0x1b')](realtime[_0x3249('0x39')]())[_0x3249('0x1b')](cmHopperHistory[_0x3249('0x3a')]())[_0x3249('0x1b')](realtime[_0x3249('0x3b')]())[_0x3249('0x1b')](cmHopperHistory[_0x3249('0x3c')]())[_0x3249('0x1b')](realtime[_0x3249('0x3d')]())[_0x3249('0x1b')](voiceCallReport[_0x3249('0x3e')]())[_0x3249('0x1b')](realtime[_0x3249('0x3f')]())[_0x3249('0x40')](function(_0x3b0c41){logger[_0x3249('0x41')](_0x3249('0x42'),util['inspect'](_0x3b0c41,{'showHidden':![],'depth':null}));});}function main(){return server[_0x3249('0x43')](realtime,preview,fax)[_0x3249('0x1b')](function(_0xae41d4){return initRealtime();})[_0x3249('0x1b')](function(){return initParams();})[_0x3249('0x1b')](function(){report[_0x3249('0x44')]();setInterval(initRealtime,0x1388);})[_0x3249('0x40')](function(_0x30df2d){logger[_0x3249('0x41')](_0x3249('0x45'),util[_0x3249('0x46')](_0x30df2d,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4576=['./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','error','inspect','sync','catch','[index.js][main]','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0x4576,0x17f));var _0x6457=function(_0x162ea6,_0x29983d){_0x162ea6=_0x162ea6-0x0;var _0x168608=_0x4576[_0x162ea6];return _0x168608;};'use strict';var BPromise=require('bluebird');var util=require(_0x6457('0x0'));var moment=require(_0x6457('0x1'));var server=require(_0x6457('0x2'));var Realtime=require(_0x6457('0x3'));var Report=require(_0x6457('0x4'));var Acw=require(_0x6457('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x6457('0x6'));var Preview=require(_0x6457('0x7'));var Fax=require('./fax');var user=require(_0x6457('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x6457('0x9'));var voiceCallReport=require(_0x6457('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x6457('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x6457('0xc'));var campaign=require(_0x6457('0xd'));var voiceExtension=require(_0x6457('0xe'));var faxAccount=require(_0x6457('0xf'));var zendesk=require(_0x6457('0x10'));var salesforce=require(_0x6457('0x11'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x6457('0x12'));var zoho=require(_0x6457('0x13'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x6457('0x14'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x6457('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x6457('0x16'))(_0x6457('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x6457('0x18')](_0x6457('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6457('0x18')](_0x6457('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x6457('0x1a')]()[_0x6457('0x1b')](user['getAgents']())[_0x6457('0x1b')](realtime[_0x6457('0x1c')]())[_0x6457('0x1b')](user[_0x6457('0x1d')]())[_0x6457('0x1b')](realtime[_0x6457('0x1e')]())[_0x6457('0x1b')](trunk[_0x6457('0x1f')]())[_0x6457('0x1b')](realtime[_0x6457('0x20')]())[_0x6457('0x1b')](voiceQueue[_0x6457('0x21')]())[_0x6457('0x1b')](realtime[_0x6457('0x22')]())[_0x6457('0x1b')](trigger[_0x6457('0x23')]())[_0x6457('0x1b')](realtime['initTriggers']())['then'](template[_0x6457('0x24')]())[_0x6457('0x1b')](realtime[_0x6457('0x25')]())[_0x6457('0x1b')](zendesk['getZendeskAccounts']())[_0x6457('0x1b')](realtime[_0x6457('0x26')]())[_0x6457('0x1b')](salesforce[_0x6457('0x27')]())[_0x6457('0x1b')](realtime['initSalesforceAccounts']())[_0x6457('0x1b')](sugarcrm[_0x6457('0x28')]())[_0x6457('0x1b')](realtime['initSugarcrmAccounts']())[_0x6457('0x1b')](freshdesk[_0x6457('0x29')]())['then'](realtime['initFreshdeskAccounts']())[_0x6457('0x1b')](desk[_0x6457('0x2a')]())[_0x6457('0x1b')](realtime[_0x6457('0x2b')]())[_0x6457('0x1b')](zoho[_0x6457('0x2c')]())[_0x6457('0x1b')](realtime['initZohoAccounts']())['then'](vtiger[_0x6457('0x2d')]())['then'](realtime[_0x6457('0x2e')]())[_0x6457('0x1b')](freshsales['getFreshsalesAccounts']())[_0x6457('0x1b')](realtime[_0x6457('0x2f')]())[_0x6457('0x1b')](servicenow[_0x6457('0x30')]())[_0x6457('0x1b')](realtime[_0x6457('0x31')]())[_0x6457('0x1b')](dynamics365[_0x6457('0x32')]())[_0x6457('0x1b')](realtime['initDynamics365Accounts']())[_0x6457('0x1b')](campaign['getCampaigns']())['then'](realtime[_0x6457('0x33')]())[_0x6457('0x1b')](voiceExtension[_0x6457('0x34')]())['then'](realtime[_0x6457('0x35')]())[_0x6457('0x1b')](faxAccount[_0x6457('0x36')]())['then'](realtime[_0x6457('0x37')]())[_0x6457('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x6457('0x1a')]()[_0x6457('0x1b')](voiceQueueReport[_0x6457('0x38')]())[_0x6457('0x1b')](realtime['initVoiceQueueReports']())[_0x6457('0x1b')](cmHopperHistory[_0x6457('0x39')]())[_0x6457('0x1b')](realtime[_0x6457('0x3a')]())[_0x6457('0x1b')](cmHopperHistory[_0x6457('0x3b')]())[_0x6457('0x1b')](realtime[_0x6457('0x3c')]())[_0x6457('0x1b')](voiceCallReport['getVoiceCallReports']())[_0x6457('0x1b')](realtime[_0x6457('0x3d')]())['catch'](function(_0x14fa6f){logger[_0x6457('0x3e')]('[index.js][initParams]',util[_0x6457('0x3f')](_0x14fa6f,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x6457('0x1b')](function(_0x9f43d7){return initRealtime();})['then'](function(){return initParams();})[_0x6457('0x1b')](function(){report[_0x6457('0x40')]();setInterval(initRealtime,0x1388);})[_0x6457('0x41')](function(_0x730c42){logger['error'](_0x6457('0x42'),util[_0x6457('0x3f')](_0x730c42,{'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 dce3d94..fe1b8e1 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x1fdf98,_0x5b3431){var _0x4a5836=function(_0x4f4208){while(--_0x4f4208){_0x1fdf98['push'](_0x1fdf98['shift']());}};_0x4a5836(++_0x5b3431);}(_0x70e0,0x17b));var _0x070e=function(_0x296ba4,_0xeada14){_0x296ba4=_0x296ba4-0x0;var _0x5e13d4=_0x70e0[_0x296ba4];return _0x5e13d4;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x365c97,_0x4f87a7){var _0x549007=function(_0x187263){while(--_0x187263){_0x365c97['push'](_0x365c97['shift']());}};_0x549007(++_0x4f87a7);}(_0xe706,0xa3));var _0x6e70=function(_0x20945a,_0x1c99ad){_0x20945a=_0x20945a-0x0;var _0x260522=_0xe706[_0x20945a];return _0x260522;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 1ddefa9..2df4d70 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 _0xc015=['dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc015,0x116));var _0x5c01=function(_0x45313f,_0x46caf4){_0x45313f=_0x45313f-0x0;var _0x402910=_0xc015[_0x45313f];return _0x402910;};'use strict';function Campaign(_0x49d6a6){this['id']=_0x49d6a6['id']||0x0;this[_0x5c01('0x0')]=_0x49d6a6['name']||'';this['type']=_0x49d6a6['type']||'campaign';this[_0x5c01('0x1')]=0x0;this[_0x5c01('0x2')]=0x0;this[_0x5c01('0x3')]=0x0;this[_0x5c01('0x4')]=0x0;this[_0x5c01('0x5')]='';this[_0x5c01('0x6')]=!![];this[_0x5c01('0x7')]=_0x49d6a6['active'];this['limitCalls']=_0x49d6a6[_0x5c01('0x8')];this['dialTimezone']=_0x49d6a6[_0x5c01('0x9')]||null;this[_0x5c01('0xa')]=_0x49d6a6['dialGlobalInterval']?_0x49d6a6[_0x5c01('0xa')]:null;this[_0x5c01('0xb')]=_0x49d6a6[_0x5c01('0xb')];this[_0x5c01('0xc')]=_0x49d6a6[_0x5c01('0xc')];this['dialOriginateTimeout']=_0x49d6a6[_0x5c01('0xd')]||0x1e;this[_0x5c01('0xe')]=_0x49d6a6[_0x5c01('0xe')];this[_0x5c01('0xf')]=_0x49d6a6[_0x5c01('0xf')];this[_0x5c01('0x10')]=_0x49d6a6[_0x5c01('0x10')];this['dialBusyRetryFrequency']=_0x49d6a6['dialBusyRetryFrequency'];this[_0x5c01('0x11')]=_0x49d6a6[_0x5c01('0x11')];this['dialNoAnswerRetryFrequency']=_0x49d6a6[_0x5c01('0x12')];this[_0x5c01('0x13')]=_0x49d6a6[_0x5c01('0x13')];this[_0x5c01('0x14')]=_0x49d6a6[_0x5c01('0x14')]||0x3;this[_0x5c01('0x15')]=_0x49d6a6[_0x5c01('0x15')]||0x96;this[_0x5c01('0x16')]=_0x49d6a6[_0x5c01('0x16')]||0x3;this[_0x5c01('0x17')]=_0x49d6a6[_0x5c01('0x17')]||0x96;this[_0x5c01('0x18')]=_0x49d6a6[_0x5c01('0x18')]||0x3;this[_0x5c01('0x19')]=_0x49d6a6[_0x5c01('0x19')]||0x96;this[_0x5c01('0x1a')]=_0x49d6a6[_0x5c01('0x1a')]||0x3;this[_0x5c01('0x1b')]=_0x49d6a6[_0x5c01('0x1b')]||0x96;this[_0x5c01('0x1c')]=_0x49d6a6[_0x5c01('0x1c')]||0x3;this[_0x5c01('0x1d')]=_0x49d6a6[_0x5c01('0x1d')]||0x96;this[_0x5c01('0x1e')]=_0x49d6a6[_0x5c01('0x1e')]||_0x5c01('0x1f');this[_0x5c01('0x20')]=_0x49d6a6[_0x5c01('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x49d6a6['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5c01('0x21')]=_0x49d6a6[_0x5c01('0x21')]||undefined;this['TrunkBackup']=_0x49d6a6[_0x5c01('0x22')]?_0x49d6a6[_0x5c01('0x22')]:undefined;this[_0x5c01('0x23')]=_0x49d6a6[_0x5c01('0x23')]?_0x49d6a6[_0x5c01('0x23')]:undefined;this['Interval']=_0x49d6a6[_0x5c01('0x24')]?_0x49d6a6[_0x5c01('0x24')]:undefined;this[_0x5c01('0x25')]=_0x49d6a6[_0x5c01('0x25')]?_0x49d6a6[_0x5c01('0x25')]:undefined;this[_0x5c01('0x26')]=_0x49d6a6[_0x5c01('0x25')]?_0x49d6a6[_0x5c01('0x25')][_0x5c01('0x0')]:undefined;this['dialAMDActive']=_0x49d6a6[_0x5c01('0x27')]||![];this[_0x5c01('0x28')]=_0x49d6a6[_0x5c01('0x28')];this['dialAMDGreeting']=_0x49d6a6[_0x5c01('0x29')];this[_0x5c01('0x2a')]=_0x49d6a6[_0x5c01('0x2a')];this[_0x5c01('0x2b')]=_0x49d6a6[_0x5c01('0x2b')];this['dialAMDMinWordLength']=_0x49d6a6[_0x5c01('0x2c')];this[_0x5c01('0x2d')]=_0x49d6a6[_0x5c01('0x2d')];this[_0x5c01('0x2e')]=_0x49d6a6['dialAMDMaximumNumberOfWords'];this[_0x5c01('0x2f')]=_0x49d6a6[_0x5c01('0x2f')];this[_0x5c01('0x30')]=_0x49d6a6[_0x5c01('0x30')];}module[_0x5c01('0x31')]=Campaign; \ No newline at end of file +var _0xf2eb=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x3a6194,_0x4574e2){var _0x298116=function(_0x27297c){while(--_0x27297c){_0x3a6194['push'](_0x3a6194['shift']());}};_0x298116(++_0x4574e2);}(_0xf2eb,0x16d));var _0xbf2e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xf2eb[_0x92c450];return _0x2a9599;};'use strict';function Campaign(_0x75d6dd){this['id']=_0x75d6dd['id']||0x0;this[_0xbf2e('0x0')]=_0x75d6dd[_0xbf2e('0x0')]||'';this[_0xbf2e('0x1')]=_0x75d6dd['type']||'campaign';this['originated']=0x0;this[_0xbf2e('0x2')]=0x0;this[_0xbf2e('0x3')]=0x0;this[_0xbf2e('0x4')]=0x0;this['message']='';this[_0xbf2e('0x5')]=!![];this['active']=_0x75d6dd['active'];this[_0xbf2e('0x6')]=_0x75d6dd['limitCalls'];this[_0xbf2e('0x7')]=_0x75d6dd[_0xbf2e('0x7')]||null;this['dialGlobalInterval']=_0x75d6dd[_0xbf2e('0x8')]?_0x75d6dd['dialGlobalInterval']:null;this[_0xbf2e('0x9')]=_0x75d6dd[_0xbf2e('0x9')];this[_0xbf2e('0xa')]=_0x75d6dd[_0xbf2e('0xa')];this[_0xbf2e('0xb')]=_0x75d6dd[_0xbf2e('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x75d6dd[_0xbf2e('0xc')];this[_0xbf2e('0xd')]=_0x75d6dd[_0xbf2e('0xd')];this[_0xbf2e('0xe')]=_0x75d6dd[_0xbf2e('0xe')];this[_0xbf2e('0xf')]=_0x75d6dd[_0xbf2e('0xf')];this[_0xbf2e('0x10')]=_0x75d6dd[_0xbf2e('0x10')];this[_0xbf2e('0x11')]=_0x75d6dd[_0xbf2e('0x11')];this['dialGlobalMaxRetry']=_0x75d6dd[_0xbf2e('0x12')];this[_0xbf2e('0x13')]=_0x75d6dd[_0xbf2e('0x13')]||0x3;this[_0xbf2e('0x14')]=_0x75d6dd[_0xbf2e('0x14')]||0x96;this[_0xbf2e('0x15')]=_0x75d6dd[_0xbf2e('0x15')]||0x3;this[_0xbf2e('0x16')]=_0x75d6dd['dialDropRetryFrequency']||0x96;this[_0xbf2e('0x17')]=_0x75d6dd[_0xbf2e('0x17')]||0x3;this[_0xbf2e('0x18')]=_0x75d6dd['dialAbandonedRetryFrequency']||0x96;this[_0xbf2e('0x19')]=_0x75d6dd[_0xbf2e('0x19')]||0x3;this['dialMachineRetryFrequency']=_0x75d6dd[_0xbf2e('0x1a')]||0x96;this[_0xbf2e('0x1b')]=_0x75d6dd[_0xbf2e('0x1b')]||0x3;this[_0xbf2e('0x1c')]=_0x75d6dd[_0xbf2e('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x75d6dd[_0xbf2e('0x1d')]||_0xbf2e('0x1e');this[_0xbf2e('0x1f')]=_0x75d6dd[_0xbf2e('0x1f')]||undefined;this[_0xbf2e('0x20')]=_0x75d6dd[_0xbf2e('0x20')]||undefined;this[_0xbf2e('0x21')]=_0x75d6dd[_0xbf2e('0x21')]||undefined;this[_0xbf2e('0x22')]=_0x75d6dd['TrunkBackup']?_0x75d6dd[_0xbf2e('0x22')]:undefined;this[_0xbf2e('0x23')]=_0x75d6dd[_0xbf2e('0x23')]?_0x75d6dd[_0xbf2e('0x23')]:undefined;this[_0xbf2e('0x24')]=_0x75d6dd['Interval']?_0x75d6dd[_0xbf2e('0x24')]:undefined;this[_0xbf2e('0x25')]=_0x75d6dd[_0xbf2e('0x25')]?_0x75d6dd['SquareProject']:undefined;this['dialQueueProject']=_0x75d6dd[_0xbf2e('0x25')]?_0x75d6dd[_0xbf2e('0x25')][_0xbf2e('0x0')]:undefined;this['dialAMDActive']=_0x75d6dd[_0xbf2e('0x26')]||![];this[_0xbf2e('0x27')]=_0x75d6dd['dialAMDInitialSilence'];this[_0xbf2e('0x28')]=_0x75d6dd[_0xbf2e('0x28')];this[_0xbf2e('0x29')]=_0x75d6dd[_0xbf2e('0x29')];this[_0xbf2e('0x2a')]=_0x75d6dd[_0xbf2e('0x2a')];this[_0xbf2e('0x2b')]=_0x75d6dd[_0xbf2e('0x2b')];this['dialAMDBetweenWordsSilence']=_0x75d6dd[_0xbf2e('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x75d6dd[_0xbf2e('0x2d')];this[_0xbf2e('0x2e')]=_0x75d6dd[_0xbf2e('0x2e')];this['dialAMDMaximumWordLength']=_0x75d6dd[_0xbf2e('0x2f')];}module[_0xbf2e('0x30')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index dee8451..7cee721 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 _0x3f48=['abandoned','lastapplication','lastdata','duration','holdtime','type','tag','queue','monitors','transfercalleridnum','transferType','mohtime','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','linkedid','answered','answertime','endtime','unmanaged'];(function(_0x5abd7e,_0x539b6a){var _0x3fe592=function(_0x5249a0){while(--_0x5249a0){_0x5abd7e['push'](_0x5abd7e['shift']());}};_0x3fe592(++_0x539b6a);}(_0x3f48,0x17c));var _0x83f4=function(_0x4e70a6,_0x5a88c4){_0x4e70a6=_0x4e70a6-0x0;var _0x1692a0=_0x3f48[_0x4e70a6];return _0x1692a0;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x83f4('0x0')]='';this[_0x83f4('0x1')]=0x0;this[_0x83f4('0x2')]='';this[_0x83f4('0x3')]=undefined;this['connectedlinename']=undefined;this[_0x83f4('0x4')]=0x0;this[_0x83f4('0x5')]='';this['uniqueid']=0x0;this[_0x83f4('0x6')]=0x0;this['exten']=0x0;this[_0x83f4('0x7')]=![];this[_0x83f4('0x8')]=null;this[_0x83f4('0x9')]=null;this[_0x83f4('0xa')]=![];this[_0x83f4('0xb')]=![];this[_0x83f4('0xc')]='';this[_0x83f4('0xd')]='';this[_0x83f4('0xe')]=0x0;this['billableseconds']=0x0;this[_0x83f4('0xf')]=0x0;this[_0x83f4('0x10')]=null;this[_0x83f4('0x11')]=null;this['disposition']=null;this['monitor']=![];this['monitorFilename']=null;this[_0x83f4('0x12')]=null;this[_0x83f4('0x13')]=[];this[_0x83f4('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x83f4('0x15')]=undefined;this[_0x83f4('0x16')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x9666=['unmanaged','lastapplication','lastdata','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','starttime','channel','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','linkedid','exten','answered','answertime','endtime'];(function(_0x5106b3,_0x590329){var _0x5c6059=function(_0x2efaee){while(--_0x2efaee){_0x5106b3['push'](_0x5106b3['shift']());}};_0x5c6059(++_0x590329);}(_0x9666,0x17a));var _0x6966=function(_0x57b93a,_0x43a4bf){_0x57b93a=_0x57b93a-0x0;var _0x3ec2db=_0x9666[_0x57b93a];return _0x3ec2db;};'use strict';function Channel(){this[_0x6966('0x0')]=null;this[_0x6966('0x1')]='';this[_0x6966('0x2')]='';this[_0x6966('0x3')]=0x0;this['calleridname']='';this[_0x6966('0x4')]=undefined;this[_0x6966('0x5')]=undefined;this[_0x6966('0x6')]=0x0;this['context']='';this['uniqueid']=0x0;this[_0x6966('0x7')]=0x0;this[_0x6966('0x8')]=0x0;this[_0x6966('0x9')]=![];this[_0x6966('0xa')]=null;this[_0x6966('0xb')]=null;this[_0x6966('0xc')]=![];this['abandoned']=![];this[_0x6966('0xd')]='';this[_0x6966('0xe')]='';this[_0x6966('0xf')]=0x0;this['billableseconds']=0x0;this[_0x6966('0x10')]=0x0;this[_0x6966('0x11')]=null;this[_0x6966('0x12')]=null;this[_0x6966('0x13')]=null;this[_0x6966('0x14')]=![];this[_0x6966('0x15')]=null;this[_0x6966('0x16')]=null;this[_0x6966('0x17')]=[];this[_0x6966('0x18')]=undefined;this[_0x6966('0x19')]=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 1703764..7a0a93b 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 _0x12be=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x42784e,_0x25d342){var _0x16f90e=function(_0x1296ba){while(--_0x1296ba){_0x42784e['push'](_0x42784e['shift']());}};_0x16f90e(++_0x25d342);}(_0x12be,0x1a0));var _0xe12b=function(_0x4fb1b8,_0x32d98d){_0x4fb1b8=_0x4fb1b8-0x0;var _0x146c71=_0x12be[_0x4fb1b8];return _0x146c71;};'use strict';function DeskAccount(_0x2430b2){this['id']=_0x2430b2['id']||0x0;this[_0xe12b('0x0')]=_0x2430b2['name']||'';this['username']=_0x2430b2[_0xe12b('0x1')]||'';this[_0xe12b('0x2')]=_0x2430b2[_0xe12b('0x2')]||'';this['authType']=_0x2430b2['authType']||'';this[_0xe12b('0x3')]=_0x2430b2[_0xe12b('0x3')]||'';this[_0xe12b('0x4')]=_0x2430b2['consumerKey']||'';this[_0xe12b('0x5')]=_0x2430b2['consumerSecret']||'';this[_0xe12b('0x6')]=_0x2430b2['token']||'';this['tokenSecret']=_0x2430b2[_0xe12b('0x7')]||'';this[_0xe12b('0x8')]=_0x2430b2[_0xe12b('0x8')]||'';this['serverUrl']=_0x2430b2[_0xe12b('0x9')]||'';this[_0xe12b('0xa')]=_0x2430b2[_0xe12b('0xa')]||{};}module[_0xe12b('0xb')]=DeskAccount; \ No newline at end of file +var _0xf043=['exports','name','username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x3d7138,_0x28d4e3){var _0x1d501d=function(_0x396579){while(--_0x396579){_0x3d7138['push'](_0x3d7138['shift']());}};_0x1d501d(++_0x28d4e3);}(_0xf043,0xa9));var _0x3f04=function(_0x45a171,_0x4deadd){_0x45a171=_0x45a171-0x0;var _0x3d3f75=_0xf043[_0x45a171];return _0x3d3f75;};'use strict';function DeskAccount(_0x5f1a21){this['id']=_0x5f1a21['id']||0x0;this[_0x3f04('0x0')]=_0x5f1a21['name']||'';this[_0x3f04('0x1')]=_0x5f1a21[_0x3f04('0x1')]||'';this[_0x3f04('0x2')]=_0x5f1a21[_0x3f04('0x2')]||'';this['authType']=_0x5f1a21[_0x3f04('0x3')]||'';this[_0x3f04('0x4')]=_0x5f1a21[_0x3f04('0x4')]||'';this['consumerKey']=_0x5f1a21['consumerKey']||'';this[_0x3f04('0x5')]=_0x5f1a21[_0x3f04('0x5')]||'';this[_0x3f04('0x6')]=_0x5f1a21[_0x3f04('0x6')]||'';this[_0x3f04('0x7')]=_0x5f1a21[_0x3f04('0x7')]||'';this['type']=_0x5f1a21[_0x3f04('0x8')]||'';this[_0x3f04('0x9')]=_0x5f1a21[_0x3f04('0x9')]||'';this[_0x3f04('0xa')]=_0x5f1a21[_0x3f04('0xa')]||{};}module[_0x3f04('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c9fe561..72ed374 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 _0x4d95=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x523411,_0x5eb168){var _0x1af6a3=function(_0x404618){while(--_0x404618){_0x523411['push'](_0x523411['shift']());}};_0x1af6a3(++_0x5eb168);}(_0x4d95,0x159));var _0x54d9=function(_0x535b80,_0x5155f7){_0x535b80=_0x535b80-0x0;var _0x1c5532=_0x4d95[_0x535b80];return _0x1c5532;};'use strict';function Dynamics365Account(_0x3d2a25){this['id']=_0x3d2a25['id']||0x0;this[_0x54d9('0x0')]=_0x3d2a25['name']||'';this['username']=_0x3d2a25[_0x54d9('0x1')]||'';this[_0x54d9('0x2')]=_0x3d2a25[_0x54d9('0x2')]||'';this['remoteUri']=_0x3d2a25[_0x54d9('0x3')]||'';this[_0x54d9('0x4')]=_0x3d2a25[_0x54d9('0x4')]||'';this[_0x54d9('0x5')]=_0x3d2a25[_0x54d9('0x5')]||'';this[_0x54d9('0x6')]=_0x3d2a25['clientSecret']||{};this[_0x54d9('0x7')]=_0x3d2a25[_0x54d9('0x7')]||'';this['modernAuthentication']=_0x3d2a25[_0x54d9('0x8')]||![];this[_0x54d9('0x9')]=_0x3d2a25[_0x54d9('0x9')]||{};this['CloudProvider']=_0x3d2a25[_0x54d9('0xa')]||{};}module[_0x54d9('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x1eb8=['name','username','password','remoteUri','tenantId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x1476ba,_0x446421){var _0x5e7bc1=function(_0x4aa99c){while(--_0x4aa99c){_0x1476ba['push'](_0x1476ba['shift']());}};_0x5e7bc1(++_0x446421);}(_0x1eb8,0x6e));var _0x81eb=function(_0x18b4f0,_0x12a1c8){_0x18b4f0=_0x18b4f0-0x0;var _0x50adb8=_0x1eb8[_0x18b4f0];return _0x50adb8;};'use strict';function Dynamics365Account(_0x33170a){this['id']=_0x33170a['id']||0x0;this[_0x81eb('0x0')]=_0x33170a['name']||'';this[_0x81eb('0x1')]=_0x33170a[_0x81eb('0x1')]||'';this['password']=_0x33170a[_0x81eb('0x2')]||'';this[_0x81eb('0x3')]=_0x33170a[_0x81eb('0x3')]||'';this['tenantId']=_0x33170a[_0x81eb('0x4')]||'';this['clientId']=_0x33170a['clientId']||'';this[_0x81eb('0x5')]=_0x33170a['clientSecret']||{};this['serverUrl']=_0x33170a[_0x81eb('0x6')]||'';this[_0x81eb('0x7')]=_0x33170a[_0x81eb('0x7')]||![];this[_0x81eb('0x8')]=_0x33170a[_0x81eb('0x8')]||{};this[_0x81eb('0x9')]=_0x33170a[_0x81eb('0x9')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 903ca8f..3ef2fee 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 _0x0d58=['exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout','tech','Trunk','ListId'];(function(_0x290347,_0x44eb81){var _0x16fbff=function(_0x166272){while(--_0x166272){_0x290347['push'](_0x290347['shift']());}};_0x16fbff(++_0x44eb81);}(_0x0d58,0x1b4));var _0x80d5=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x0d58[_0x1cc8fe];return _0x230054;};'use strict';function FaxAccount(_0x19da4a){this['id']=_0x19da4a['id']||0x0;this['name']=_0x19da4a[_0x80d5('0x0')]||'';this[_0x80d5('0x1')]=_0x19da4a[_0x80d5('0x1')];this[_0x80d5('0x2')]=_0x19da4a[_0x80d5('0x2')];this['headerinfo']=_0x19da4a[_0x80d5('0x3')];this['localstationid']=_0x19da4a[_0x80d5('0x4')];this[_0x80d5('0x5')]=_0x19da4a['minrate']||0x960;this[_0x80d5('0x6')]=_0x19da4a['maxrate']||0x3840;this[_0x80d5('0x7')]=_0x19da4a[_0x80d5('0x7')]||_0x80d5('0x8');this[_0x80d5('0x9')]=_0x19da4a[_0x80d5('0x9')]||'no';this['faxdetect']=_0x19da4a['faxdetect']||'no';this[_0x80d5('0xa')]=_0x19da4a['t38timeout']||0x1388;this[_0x80d5('0xb')]=_0x19da4a['tech']||'SIP';this[_0x80d5('0xc')]=_0x19da4a['Trunk']?_0x19da4a[_0x80d5('0xc')]:undefined;this[_0x80d5('0xd')]=_0x19da4a[_0x80d5('0xd')];this['key']=_0x19da4a['key'];}module[_0x80d5('0xe')]=FaxAccount; \ No newline at end of file +var _0x5de9=['exports','name','description','ecm','headerinfo','localstationid','minrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key'];(function(_0x37c0ac,_0x47ec8f){var _0x6789e1=function(_0x346f91){while(--_0x346f91){_0x37c0ac['push'](_0x37c0ac['shift']());}};_0x6789e1(++_0x47ec8f);}(_0x5de9,0x181));var _0x95de=function(_0x3318fe,_0x3f5d89){_0x3318fe=_0x3318fe-0x0;var _0x574ad=_0x5de9[_0x3318fe];return _0x574ad;};'use strict';function FaxAccount(_0x556a9c){this['id']=_0x556a9c['id']||0x0;this[_0x95de('0x0')]=_0x556a9c[_0x95de('0x0')]||'';this[_0x95de('0x1')]=_0x556a9c[_0x95de('0x1')];this[_0x95de('0x2')]=_0x556a9c[_0x95de('0x2')];this['headerinfo']=_0x556a9c[_0x95de('0x3')];this[_0x95de('0x4')]=_0x556a9c['localstationid'];this[_0x95de('0x5')]=_0x556a9c['minrate']||0x960;this['maxrate']=_0x556a9c['maxrate']||0x3840;this['modem']=_0x556a9c['modem']||_0x95de('0x6');this[_0x95de('0x7')]=_0x556a9c[_0x95de('0x7')]||'no';this[_0x95de('0x8')]=_0x556a9c[_0x95de('0x8')]||'no';this['t38timeout']=_0x556a9c[_0x95de('0x9')]||0x1388;this[_0x95de('0xa')]=_0x556a9c[_0x95de('0xa')]||_0x95de('0xb');this['Trunk']=_0x556a9c[_0x95de('0xc')]?_0x556a9c[_0x95de('0xc')]:undefined;this[_0x95de('0xd')]=_0x556a9c[_0x95de('0xd')];this[_0x95de('0xe')]=_0x556a9c['key'];}module[_0x95de('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 1270f55..91c8b8a 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 _0x3332=['exports','name','username','token','remoteUri','Configurations'];(function(_0x43dc7e,_0x49a390){var _0x21e12d=function(_0x15cc1a){while(--_0x15cc1a){_0x43dc7e['push'](_0x43dc7e['shift']());}};_0x21e12d(++_0x49a390);}(_0x3332,0xcd));var _0x2333=function(_0x39c12e,_0x585534){_0x39c12e=_0x39c12e-0x0;var _0x58dbf4=_0x3332[_0x39c12e];return _0x58dbf4;};'use strict';function FreshdeskAccount(_0x2c0260){this['id']=_0x2c0260['id']||0x0;this[_0x2333('0x0')]=_0x2c0260[_0x2333('0x0')]||'';this[_0x2333('0x1')]=_0x2c0260[_0x2333('0x1')]||'';this['apiKey']=_0x2c0260[_0x2333('0x2')]||'';this[_0x2333('0x3')]=_0x2c0260[_0x2333('0x3')]||'';this['serverUrl']=_0x2c0260['serverUrl']||'';this[_0x2333('0x4')]=_0x2c0260[_0x2333('0x4')]||{};}module[_0x2333('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0x4ae2=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x886fb5,_0x3aef2a){var _0x44ee6b=function(_0x43fc01){while(--_0x43fc01){_0x886fb5['push'](_0x886fb5['shift']());}};_0x44ee6b(++_0x3aef2a);}(_0x4ae2,0x132));var _0x24ae=function(_0x2ada6a,_0x49cece){_0x2ada6a=_0x2ada6a-0x0;var _0x42b8fa=_0x4ae2[_0x2ada6a];return _0x42b8fa;};'use strict';function FreshdeskAccount(_0x302891){this['id']=_0x302891['id']||0x0;this[_0x24ae('0x0')]=_0x302891['name']||'';this['username']=_0x302891[_0x24ae('0x1')]||'';this[_0x24ae('0x2')]=_0x302891[_0x24ae('0x3')]||'';this[_0x24ae('0x4')]=_0x302891[_0x24ae('0x4')]||'';this['serverUrl']=_0x302891[_0x24ae('0x5')]||'';this[_0x24ae('0x6')]=_0x302891[_0x24ae('0x6')]||{};}module[_0x24ae('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 26c227c..b1a73fe 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 _0x61b8=['exports','name','username','remoteUri','serverUrl','Configurations'];(function(_0x8c364a,_0x48360b){var _0x4eaa41=function(_0x3bf44b){while(--_0x3bf44b){_0x8c364a['push'](_0x8c364a['shift']());}};_0x4eaa41(++_0x48360b);}(_0x61b8,0x169));var _0x861b=function(_0xe7ec99,_0x4b6860){_0xe7ec99=_0xe7ec99-0x0;var _0x28b34c=_0x61b8[_0xe7ec99];return _0x28b34c;};'use strict';function FreshsalesAccount(_0xfae3b6){this['id']=_0xfae3b6['id']||0x0;this[_0x861b('0x0')]=_0xfae3b6[_0x861b('0x0')]||'';this['username']=_0xfae3b6[_0x861b('0x1')]||'';this['apiKey']=_0xfae3b6['token']||'';this[_0x861b('0x2')]=_0xfae3b6[_0x861b('0x2')]||'';this[_0x861b('0x3')]=_0xfae3b6['serverUrl']||'';this[_0x861b('0x4')]=_0xfae3b6[_0x861b('0x4')]||{};}module[_0x861b('0x5')]=FreshsalesAccount; \ No newline at end of file +var _0xea89=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0xea89,0x1e2));var _0x9ea8=function(_0x54aa9a,_0x54a26d){_0x54aa9a=_0x54aa9a-0x0;var _0x34dac7=_0xea89[_0x54aa9a];return _0x34dac7;};'use strict';function FreshsalesAccount(_0x54725c){this['id']=_0x54725c['id']||0x0;this[_0x9ea8('0x0')]=_0x54725c[_0x9ea8('0x0')]||'';this[_0x9ea8('0x1')]=_0x54725c[_0x9ea8('0x1')]||'';this['apiKey']=_0x54725c[_0x9ea8('0x2')]||'';this['remoteUri']=_0x54725c[_0x9ea8('0x3')]||'';this['serverUrl']=_0x54725c[_0x9ea8('0x4')]||'';this[_0x9ea8('0x5')]=_0x54725c[_0x9ea8('0x5')]||{};}module[_0x9ea8('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index bde5989..f4e89c1 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 _0x7db9=['context','exten','priority','holdtime','assigned','motionChannel','mohtime','variables','exports','inbound','uniqueid','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode'];(function(_0xd2f4b6,_0x176e2b){var _0x34ac79=function(_0x265bca){while(--_0x265bca){_0xd2f4b6['push'](_0xd2f4b6['shift']());}};_0x34ac79(++_0x176e2b);}(_0x7db9,0x190));var _0x97db=function(_0x4b2eea,_0x3bd17e){_0x4b2eea=_0x4b2eea-0x0;var _0x132891=_0x7db9[_0x4b2eea];return _0x132891;};'use strict';function QueueReport(){this['type']=_0x97db('0x0');this[_0x97db('0x1')]='';this['calleridnum']='';this['calleridname']='';this[_0x97db('0x2')]='';this['queuecallerjoinAt']=null;this[_0x97db('0x3')]=null;this[_0x97db('0x4')]=0x1;this[_0x97db('0x5')]=0x1;this[_0x97db('0x6')]=![];this['queuecallerabandonAt']=null;this[_0x97db('0x7')]=![];this[_0x97db('0x8')]=null;this['queuecallerexit']=![];this[_0x97db('0x9')]=null;this[_0x97db('0xa')]=0x1;this[_0x97db('0xb')]='';this[_0x97db('0xc')]='';this['connectedlinename']='';this[_0x97db('0xd')]='';this[_0x97db('0xe')]='';this[_0x97db('0xf')]='';this[_0x97db('0x10')]='';this[_0x97db('0x11')]=0x0;this[_0x97db('0x12')]=![];this['lastAssignedTo']='';this[_0x97db('0x13')]='voice';this[_0x97db('0x14')]=0x0;this[_0x97db('0x15')]={};}module[_0x97db('0x16')]=QueueReport; \ No newline at end of file +var _0x274d=['connectedlinenum','connectedlinename','context','exten','holdtime','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','queue','queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition'];(function(_0x282aa5,_0x597349){var _0x4fab69=function(_0x5df667){while(--_0x5df667){_0x282aa5['push'](_0x282aa5['shift']());}};_0x4fab69(++_0x597349);}(_0x274d,0x99));var _0xd274=function(_0x5632da,_0x3a2a30){_0x5632da=_0x5632da-0x0;var _0x12ddcb=_0x274d[_0x5632da];return _0x12ddcb;};'use strict';function QueueReport(){this[_0xd274('0x0')]=_0xd274('0x1');this[_0xd274('0x2')]='';this[_0xd274('0x3')]='';this['calleridname']='';this[_0xd274('0x4')]='';this[_0xd274('0x5')]=null;this['queuecallerleaveAt']=null;this[_0xd274('0x6')]=0x1;this[_0xd274('0x7')]=0x1;this[_0xd274('0x8')]=![];this[_0xd274('0x9')]=null;this[_0xd274('0xa')]=![];this[_0xd274('0xb')]=null;this[_0xd274('0xc')]=![];this[_0xd274('0xd')]=null;this[_0xd274('0xe')]=0x1;this['channel']='';this[_0xd274('0xf')]='';this[_0xd274('0x10')]='';this['accountcode']='';this[_0xd274('0x11')]='';this[_0xd274('0x12')]='';this['priority']='';this[_0xd274('0x13')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this['motionChannel']=_0xd274('0x14');this[_0xd274('0x15')]=0x0;this[_0xd274('0x16')]={};}module[_0xd274('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index de44449..5e1de0a 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 _0x1bb9=['serverUrl','Configurations','exports','name','remoteUri','password','clientId','securityToken','type','integrationTab'];(function(_0x321e53,_0x372e6c){var _0x1d17d1=function(_0x1093c1){while(--_0x1093c1){_0x321e53['push'](_0x321e53['shift']());}};_0x1d17d1(++_0x372e6c);}(_0x1bb9,0x17f));var _0x91bb=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x1bb9[_0x296923];return _0x29af70;};'use strict';function SalesforceAccount(_0x853748){this['id']=_0x853748['id']||0x0;this[_0x91bb('0x0')]=_0x853748[_0x91bb('0x0')]||'';this['username']=_0x853748['username']||'';this[_0x91bb('0x1')]=_0x853748['remoteUri']||'';this[_0x91bb('0x2')]=_0x853748[_0x91bb('0x2')]||'';this[_0x91bb('0x3')]=_0x853748['clientId']||'';this['clientSecret']=_0x853748['clientSecret']||'';this[_0x91bb('0x4')]=_0x853748[_0x91bb('0x4')]||'';this[_0x91bb('0x5')]=_0x853748[_0x91bb('0x5')]||_0x91bb('0x6');this[_0x91bb('0x7')]=_0x853748[_0x91bb('0x7')]||'';this['Configurations']=_0x853748[_0x91bb('0x8')]||{};}module[_0x91bb('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x717b=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x428aeb,_0x52a2d4){var _0x435541=function(_0x505c62){while(--_0x505c62){_0x428aeb['push'](_0x428aeb['shift']());}};_0x435541(++_0x52a2d4);}(_0x717b,0x111));var _0xb717=function(_0x35324d,_0x190eb7){_0x35324d=_0x35324d-0x0;var _0x31f826=_0x717b[_0x35324d];return _0x31f826;};'use strict';function SalesforceAccount(_0x297344){this['id']=_0x297344['id']||0x0;this['name']=_0x297344[_0xb717('0x0')]||'';this['username']=_0x297344[_0xb717('0x1')]||'';this['remoteUri']=_0x297344[_0xb717('0x2')]||'';this[_0xb717('0x3')]=_0x297344[_0xb717('0x3')]||'';this[_0xb717('0x4')]=_0x297344[_0xb717('0x4')]||'';this[_0xb717('0x5')]=_0x297344['clientSecret']||'';this[_0xb717('0x6')]=_0x297344['securityToken']||'';this['type']=_0x297344[_0xb717('0x7')]||_0xb717('0x8');this['serverUrl']=_0x297344[_0xb717('0x9')]||'';this[_0xb717('0xa')]=_0x297344[_0xb717('0xa')]||{};}module[_0xb717('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 9fb2dc0..a9357d4 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 _0xce2d=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x36cabe,_0x12e282){var _0x24e6f6=function(_0x4ad851){while(--_0x4ad851){_0x36cabe['push'](_0x36cabe['shift']());}};_0x24e6f6(++_0x12e282);}(_0xce2d,0x1c7));var _0xdce2=function(_0x4d21f7,_0x4af33b){_0x4d21f7=_0x4d21f7-0x0;var _0x2f61a3=_0xce2d[_0x4d21f7];return _0x2f61a3;};'use strict';function ServicenowAccount(_0x36eeb9){this['id']=_0x36eeb9['id']||0x0;this[_0xdce2('0x0')]=_0x36eeb9['name']||'';this[_0xdce2('0x1')]=_0x36eeb9[_0xdce2('0x1')]||'';this[_0xdce2('0x2')]=_0x36eeb9[_0xdce2('0x2')]||'';this[_0xdce2('0x3')]=_0x36eeb9[_0xdce2('0x3')]||'';this[_0xdce2('0x4')]=_0x36eeb9[_0xdce2('0x4')]||'';this[_0xdce2('0x5')]=_0x36eeb9[_0xdce2('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x3eff=['password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4e38a0,_0x3a3866){var _0x37607b=function(_0x571430){while(--_0x571430){_0x4e38a0['push'](_0x4e38a0['shift']());}};_0x37607b(++_0x3a3866);}(_0x3eff,0x1b5));var _0xf3ef=function(_0x3b119f,_0x4f10d3){_0x3b119f=_0x3b119f-0x0;var _0x1aff29=_0x3eff[_0x3b119f];return _0x1aff29;};'use strict';function ServicenowAccount(_0x2bf52d){this['id']=_0x2bf52d['id']||0x0;this['name']=_0x2bf52d[_0xf3ef('0x0')]||'';this['username']=_0x2bf52d['username']||'';this[_0xf3ef('0x1')]=_0x2bf52d[_0xf3ef('0x1')]||'';this[_0xf3ef('0x2')]=_0x2bf52d['remoteUri']||'';this[_0xf3ef('0x3')]=_0x2bf52d[_0xf3ef('0x3')]||'';this[_0xf3ef('0x4')]=_0x2bf52d[_0xf3ef('0x4')]||{};}module[_0xf3ef('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 30004f5..ea26ed5 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 _0x5fd1=['username','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x5ab05b,_0x59ba0f){var _0x47b4ac=function(_0x100950){while(--_0x100950){_0x5ab05b['push'](_0x5ab05b['shift']());}};_0x47b4ac(++_0x59ba0f);}(_0x5fd1,0x155));var _0x15fd=function(_0x26bf0f,_0xd274c0){_0x26bf0f=_0x26bf0f-0x0;var _0x5ec4d4=_0x5fd1[_0x26bf0f];return _0x5ec4d4;};'use strict';function SugarcrmAccount(_0x46f785){this['id']=_0x46f785['id']||0x0;this['name']=_0x46f785[_0x15fd('0x0')]||'';this[_0x15fd('0x1')]=_0x46f785[_0x15fd('0x1')]||'';this['password']=_0x46f785['password']||'';this[_0x15fd('0x2')]=_0x46f785[_0x15fd('0x2')]||'';this[_0x15fd('0x3')]=_0x46f785['serverUrl']||'';this[_0x15fd('0x4')]=_0x46f785[_0x15fd('0x4')]||{};}module[_0x15fd('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0xa1a9=['username','password','serverUrl','Configurations','exports'];(function(_0x52d791,_0x14c894){var _0x27b070=function(_0x526e1e){while(--_0x526e1e){_0x52d791['push'](_0x52d791['shift']());}};_0x27b070(++_0x14c894);}(_0xa1a9,0x9b));var _0x9a1a=function(_0x3e4593,_0x58977f){_0x3e4593=_0x3e4593-0x0;var _0x227296=_0xa1a9[_0x3e4593];return _0x227296;};'use strict';function SugarcrmAccount(_0x2e6b07){this['id']=_0x2e6b07['id']||0x0;this['name']=_0x2e6b07['name']||'';this[_0x9a1a('0x0')]=_0x2e6b07['username']||'';this[_0x9a1a('0x1')]=_0x2e6b07[_0x9a1a('0x1')]||'';this['remoteUri']=_0x2e6b07['remoteUri']||'';this['serverUrl']=_0x2e6b07[_0x9a1a('0x2')]||'';this['Configurations']=_0x2e6b07[_0x9a1a('0x3')]||{};}module[_0x9a1a('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 161d7ee..6cdab82 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 _0xa5f1=['name','accountcode','state','unknown','status'];(function(_0x539d7b,_0x5f2eba){var _0x31953c=function(_0x2c792a){while(--_0x2c792a){_0x539d7b['push'](_0x539d7b['shift']());}};_0x31953c(++_0x5f2eba);}(_0xa5f1,0xff));var _0x1a5f=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xa5f1[_0xefd519];return _0x4bb882;};'use strict';function Telephone(_0x49d953){this['id']=_0x49d953['id']||0x0;this[_0x1a5f('0x0')]=_0x49d953[_0x1a5f('0x0')]||'';this[_0x1a5f('0x1')]=_0x49d953['accountcode']||'';this[_0x1a5f('0x2')]=_0x1a5f('0x3');this['stateTime']=0x0;this[_0x1a5f('0x4')]=_0x1a5f('0x3');this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0x4a00=['address','exports','name','accountcode','stateTime','status','unknown'];(function(_0x32fb9a,_0x3959a8){var _0x363750=function(_0x29cf49){while(--_0x29cf49){_0x32fb9a['push'](_0x32fb9a['shift']());}};_0x363750(++_0x3959a8);}(_0x4a00,0xc6));var _0x04a0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4a00[_0x2dafbe];return _0x58a45a;};'use strict';function Telephone(_0x2bde84){this['id']=_0x2bde84['id']||0x0;this[_0x04a0('0x0')]=_0x2bde84[_0x04a0('0x0')]||'';this['accountcode']=_0x2bde84[_0x04a0('0x1')]||'';this['state']='unknown';this[_0x04a0('0x2')]=0x0;this[_0x04a0('0x3')]=_0x04a0('0x4');this[_0x04a0('0x5')]='';}module[_0x04a0('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 6a2b6ee..f370d24 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(_0x226259,_0x55de59){var _0x161fb7=function(_0x35f9be){while(--_0x35f9be){_0x226259['push'](_0x226259['shift']());}};_0x161fb7(++_0x55de59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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(_0x9c3f29,_0x37500b){var _0x589374=function(_0x37746e){while(--_0x37746e){_0x9c3f29['push'](_0x9c3f29['shift']());}};_0x589374(++_0x37500b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 b9267a5..cb4bf70 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 _0x14a0=['voice','status','AnyConditions','Actions','name','channel'];(function(_0x8e4f00,_0x38ce67){var _0x204f4c=function(_0x1b5815){while(--_0x1b5815){_0x8e4f00['push'](_0x8e4f00['shift']());}};_0x204f4c(++_0x38ce67);}(_0x14a0,0x8e));var _0x014a=function(_0x385dad,_0x10da62){_0x385dad=_0x385dad-0x0;var _0x55dff8=_0x14a0[_0x385dad];return _0x55dff8;};'use strict';function Trigger(_0x1ee939){this['id']=_0x1ee939['id']||0x0;this[_0x014a('0x0')]=_0x1ee939[_0x014a('0x0')]||'';this[_0x014a('0x1')]=_0x1ee939[_0x014a('0x1')]||_0x014a('0x2');this[_0x014a('0x3')]=_0x1ee939[_0x014a('0x3')]||![];this['AllConditions']=_0x1ee939['AllConditions']||[];this[_0x014a('0x4')]=_0x1ee939[_0x014a('0x4')]||[];this[_0x014a('0x5')]=_0x1ee939['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x1a0a44,_0x1602b7){var _0x26d2fb=function(_0x38a381){while(--_0x38a381){_0x1a0a44['push'](_0x1a0a44['shift']());}};_0x26d2fb(++_0x1602b7);}(_0xb10b,0x12a));var _0xbb10=function(_0x21afd5,_0x57b9ba){_0x21afd5=_0x21afd5-0x0;var _0x59b71d=_0xb10b[_0x21afd5];return _0x59b71d;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index e4a5bee..7649377 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 _0x4fa1=['split','host','domainport','refresh','stateRegistry','registrationtime','address','exports','active','name','unknown','stateTime','status','registry'];(function(_0x2054ee,_0x234ce8){var _0x4e2a65=function(_0xb6c05b){while(--_0xb6c05b){_0x2054ee['push'](_0x2054ee['shift']());}};_0x4e2a65(++_0x234ce8);}(_0x4fa1,0x120));var _0x14fa=function(_0x1520ed,_0x550e59){_0x1520ed=_0x1520ed-0x0;var _0x544d50=_0x4fa1[_0x1520ed];return _0x544d50;};'use strict';function Trunk(_0x12ec8f){this['id']=_0x12ec8f['id']||0x0;this[_0x14fa('0x0')]=_0x12ec8f[_0x14fa('0x0')]||![];this['name']=_0x12ec8f[_0x14fa('0x1')]||'';this['state']=_0x14fa('0x2');this[_0x14fa('0x3')]=0x0;this[_0x14fa('0x4')]=_0x14fa('0x2');this[_0x14fa('0x5')]=_0x12ec8f['registry']&&_0x12ec8f[_0x14fa('0x5')]['indexOf'](':')?_0x12ec8f['registry'][_0x14fa('0x6')](':')[0x0]:'';this[_0x14fa('0x7')]='';this['port']='';this['domain']='';this[_0x14fa('0x8')]='';this[_0x14fa('0x9')]='';this[_0x14fa('0xa')]=_0x14fa('0x2');this[_0x14fa('0xb')]='';this[_0x14fa('0xc')]='';this['defaultuser']=_0x12ec8f['defaultuser']||'';}module[_0x14fa('0xd')]=Trunk; \ No newline at end of file +var _0xe58e=['indexOf','split','host','port','domain','domainport','refresh','registrationtime','exports','active','name','unknown','stateTime','status','registry'];(function(_0x3e4850,_0x2c8c56){var _0x17916f=function(_0x5cebeb){while(--_0x5cebeb){_0x3e4850['push'](_0x3e4850['shift']());}};_0x17916f(++_0x2c8c56);}(_0xe58e,0xea));var _0xee58=function(_0x5ac9b0,_0x5873d5){_0x5ac9b0=_0x5ac9b0-0x0;var _0x51b26f=_0xe58e[_0x5ac9b0];return _0x51b26f;};'use strict';function Trunk(_0x53ca49){this['id']=_0x53ca49['id']||0x0;this[_0xee58('0x0')]=_0x53ca49[_0xee58('0x0')]||![];this[_0xee58('0x1')]=_0x53ca49[_0xee58('0x1')]||'';this['state']=_0xee58('0x2');this[_0xee58('0x3')]=0x0;this[_0xee58('0x4')]=_0xee58('0x2');this[_0xee58('0x5')]=_0x53ca49[_0xee58('0x5')]&&_0x53ca49[_0xee58('0x5')][_0xee58('0x6')](':')?_0x53ca49[_0xee58('0x5')][_0xee58('0x7')](':')[0x0]:'';this[_0xee58('0x8')]='';this[_0xee58('0x9')]='';this[_0xee58('0xa')]='';this[_0xee58('0xb')]='';this[_0xee58('0xc')]='';this['stateRegistry']=_0xee58('0x2');this[_0xee58('0xd')]='';this['address']='';this['defaultuser']=_0x53ca49['defaultuser']||'';}module[_0xee58('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 1957165..be4f4f3 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 _0xb931=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x33ba6f,_0x462eaf){var _0x462aab=function(_0x543a5d){while(--_0x543a5d){_0x33ba6f['push'](_0x33ba6f['shift']());}};_0x462aab(++_0x462eaf);}(_0xb931,0x1f0));var _0x1b93=function(_0x59b1d7,_0x72689){_0x59b1d7=_0x59b1d7-0x0;var _0x270e97=_0xb931[_0x59b1d7];return _0x270e97;};'use strict';function voiceExtension(_0x272b70){this['id']=_0x272b70['id']||0x0;this[_0x1b93('0x0')]=_0x272b70['exten']||'';this[_0x1b93('0x1')]=_0x272b70[_0x1b93('0x1')]||_0x1b93('0x2');this[_0x1b93('0x3')]=_0x272b70[_0x1b93('0x3')]||![];}module[_0x1b93('0x4')]=voiceExtension; \ No newline at end of file +var _0xeb0a=['exten','recordingFormat','mandatoryDisposition','exports'];(function(_0x22e3ed,_0x260594){var _0x1f4c8e=function(_0x180e20){while(--_0x180e20){_0x22e3ed['push'](_0x22e3ed['shift']());}};_0x1f4c8e(++_0x260594);}(_0xeb0a,0x80));var _0xaeb0=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0xeb0a[_0x27bd2c];return _0x3784ea;};'use strict';function voiceExtension(_0x493987){this['id']=_0x493987['id']||0x0;this['exten']=_0x493987[_0xaeb0('0x0')]||'';this[_0xaeb0('0x1')]=_0x493987[_0xaeb0('0x1')]||'none';this['mandatoryDisposition']=_0x493987[_0xaeb0('0x2')]||![];}module[_0xaeb0('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index a8c9beb..e569561 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 _0x180f=['dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','busy','invalid','unavailable','ringing','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue'];(function(_0xa545b,_0x3db46b){var _0x2ccc57=function(_0x2a9b9d){while(--_0x2a9b9d){_0xa545b['push'](_0xa545b['shift']());}};_0x2ccc57(++_0x3db46b);}(_0x180f,0xfc));var _0xf180=function(_0x141e03,_0x18340e){_0x141e03=_0x141e03-0x0;var _0x2074e3=_0x180f[_0x141e03];return _0x2074e3;};'use strict';var statusDesc=['unknown',_0xf180('0x0'),'inuse',_0xf180('0x1'),_0xf180('0x2'),_0xf180('0x3'),_0xf180('0x4'),'ringinuse',_0xf180('0x5')];var monitorFormat={'wav':_0xf180('0x6'),'wav49':_0xf180('0x7'),'gsm':_0xf180('0x8')};var strategy={'rrmemory':_0xf180('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x4ccd1d){this['id']=_0x4ccd1d['id']||0x0;this[_0xf180('0xa')]=_0x4ccd1d['name']||'';this[_0xf180('0xb')]=_0x4ccd1d[_0xf180('0xb')]||'';this['type']=_0x4ccd1d[_0xf180('0xc')]||_0xf180('0xd');this['waiting']=0x0;this['talking']=0x0;this[_0xf180('0xe')]=0x0;this['answered']=0x0;this[_0xf180('0xf')]=0x0;this[_0xf180('0x10')]=0x0;this[_0xf180('0x11')]=0x0;this[_0xf180('0x12')]=0x0;this[_0xf180('0x13')]=0x0;this[_0xf180('0x14')]=0x0;this[_0xf180('0x15')]=0x0;this[_0xf180('0x16')]=_0x4ccd1d['acw']||![];this[_0xf180('0x17')]=_0x4ccd1d[_0xf180('0x17')]||0xa;this[_0xf180('0x18')]=_0x4ccd1d[_0xf180('0x18')]||'no';this[_0xf180('0x19')]=!![];this[_0xf180('0x1a')]='';this['originated']=0x0;this[_0xf180('0x1b')]=0x0;this[_0xf180('0x1c')]=_0x4ccd1d['dialTimezone']||null;this[_0xf180('0x1d')]=_0x4ccd1d[_0xf180('0x1d')]?_0x4ccd1d[_0xf180('0x1d')]:null;this['dialActive']=_0x4ccd1d[_0xf180('0x1e')];this[_0xf180('0x1f')]=_0x4ccd1d[_0xf180('0x1f')]||_0xf180('0x20');this[_0xf180('0x21')]=_0x4ccd1d['dialLimitChannel']||0x0;this[_0xf180('0x22')]=_0x4ccd1d[_0xf180('0x22')]||0x0;this[_0xf180('0x23')]=_0x4ccd1d['dialPowerLevel']||0x1;this[_0xf180('0x24')]=_0x4ccd1d[_0xf180('0x24')]||_0xf180('0x25');this[_0xf180('0x26')]=_0x4ccd1d[_0xf180('0x26')]||0.03;this[_0xf180('0x27')]=_0x4ccd1d['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x4ccd1d[_0xf180('0x28')]||_0xf180('0x29');this[_0xf180('0x2a')]=_0x4ccd1d[_0xf180('0x2a')]||_0xf180('0x29');this['dialOriginateTimeout']=_0x4ccd1d[_0xf180('0x2b')]||0x1e;this['dialQueueOptions']=_0x4ccd1d[_0xf180('0x2c')]||_0xf180('0x2d');this[_0xf180('0x2e')]=_0x4ccd1d[_0xf180('0x2e')]||0x3;this[_0xf180('0x2f')]=_0x4ccd1d[_0xf180('0x2f')]||undefined;this[_0xf180('0x30')]=_0x4ccd1d['dialCongestionMaxRetry']||0x3;this[_0xf180('0x31')]=_0x4ccd1d[_0xf180('0x31')]||0x96;this[_0xf180('0x32')]=_0x4ccd1d[_0xf180('0x32')]||0x3;this[_0xf180('0x33')]=_0x4ccd1d[_0xf180('0x33')]||0x96;this[_0xf180('0x34')]=_0x4ccd1d[_0xf180('0x34')]||0x3;this[_0xf180('0x35')]=_0x4ccd1d[_0xf180('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x4ccd1d['dialNoSuchNumberMaxRetry']||0x3;this[_0xf180('0x36')]=_0x4ccd1d['dialNoSuchNumberRetryFrequency']||0x96;this[_0xf180('0x37')]=_0x4ccd1d[_0xf180('0x37')]||0x3;this['dialDropRetryFrequency']=_0x4ccd1d[_0xf180('0x38')]||0x96;this[_0xf180('0x39')]=_0x4ccd1d[_0xf180('0x39')]||0x3;this['dialAbandonedRetryFrequency']=_0x4ccd1d['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x4ccd1d[_0xf180('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x4ccd1d[_0xf180('0x3b')]||0x96;this[_0xf180('0x3c')]=_0x4ccd1d[_0xf180('0x3c')]||0x3;this[_0xf180('0x3d')]=_0x4ccd1d['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x4ccd1d[_0xf180('0x3e')]||0x4;this[_0xf180('0x3f')]=_0x4ccd1d[_0xf180('0x3f')]?_0x4ccd1d['Trunk']:undefined;this[_0xf180('0x40')]=_0x4ccd1d[_0xf180('0x40')]?_0x4ccd1d[_0xf180('0x40')]:undefined;this[_0xf180('0x41')]=_0x4ccd1d[_0xf180('0x41')]||undefined;this[_0xf180('0x42')]=_0x4ccd1d['Interval']?_0x4ccd1d[_0xf180('0x42')]:undefined;this[_0xf180('0x43')]=_0x4ccd1d[_0xf180('0x43')]||_0xf180('0x44');this['dialRandomLastDigitCallerIdNumber']=_0x4ccd1d[_0xf180('0x45')]||undefined;this['dialCutDigit']=_0x4ccd1d['dialCutDigit']||undefined;this[_0xf180('0x46')]=strategy[_0x4ccd1d[_0xf180('0x46')]]||_0xf180('0x9');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x4ccd1d[_0xf180('0x47')]||![];this['dialAMDInitialSilence']=_0x4ccd1d[_0xf180('0x48')];this[_0xf180('0x49')]=_0x4ccd1d[_0xf180('0x49')];this['dialAMDAfterGreetingSilence']=_0x4ccd1d[_0xf180('0x4a')];this[_0xf180('0x4b')]=_0x4ccd1d['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x4ccd1d[_0xf180('0x4c')];this[_0xf180('0x4d')]=_0x4ccd1d[_0xf180('0x4d')];this['dialAMDMaximumNumberOfWords']=_0x4ccd1d['dialAMDMaximumNumberOfWords'];this[_0xf180('0x4e')]=_0x4ccd1d['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x4ccd1d[_0xf180('0x4f')];this[_0xf180('0x50')]=0x0;this['pTalking']=0x0;this['timeout']=_0x4ccd1d[_0xf180('0x51')];this[_0xf180('0x52')]=0x0;this[_0xf180('0x53')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xf180('0x54')]=0x0;this[_0xf180('0x55')]=0x0;this[_0xf180('0x56')]=0x0;this[_0xf180('0x57')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xf180('0x58')]=0x0;this[_0xf180('0x59')]=0x0;this[_0xf180('0x5a')]=0x0;this[_0xf180('0x5b')]=0x0;this[_0xf180('0x5c')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xf180('0x5d')]=undefined;this[_0xf180('0x5e')]=undefined;this[_0xf180('0x5f')]=undefined;this[_0xf180('0x60')]=1.05;this[_0xf180('0x61')]=0x0;this[_0xf180('0x62')]=0x0;this[_0xf180('0x63')]=0x0;this[_0xf180('0x64')]=0x0;this[_0xf180('0x65')]=0x0;this[_0xf180('0x66')]=0x0;this[_0xf180('0x67')]=0x0;this[_0xf180('0x68')]=0x0;this['predictiveIntervalMaxThreshold']=_0x4ccd1d[_0xf180('0x69')]||0x14;this[_0xf180('0x6a')]=_0x4ccd1d['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xf180('0x6b')]=0x0;this[_0xf180('0x6c')]=0x1;this[_0xf180('0x6d')]=0x0;this[_0xf180('0x6e')]=0x0;this[_0xf180('0x6f')]=0x0;this[_0xf180('0x70')]=0x0;this['dialRecallMeTimeout']=_0x4ccd1d['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x4ccd1d[_0xf180('0x71')]||![];this[_0xf180('0x72')]=!!_0x4ccd1d[_0xf180('0x72')]||![];this[_0xf180('0x73')]=!!_0x4ccd1d[_0xf180('0x73')]||![];this[_0xf180('0x74')]=_0x4ccd1d[_0xf180('0x74')]||undefined;this['dialAgiAfterHangupClient']=_0x4ccd1d[_0xf180('0x75')]||![];this[_0xf180('0x76')]=_0x4ccd1d[_0xf180('0x76')]||![];this[_0xf180('0xb')]=monitorFormat[_0x4ccd1d[_0xf180('0xb')]]?monitorFormat[_0x4ccd1d[_0xf180('0xb')]]:undefined;this[_0xf180('0x77')]=_0x4ccd1d[_0xf180('0x77')]||![];this[_0xf180('0x78')]=_0x4ccd1d['mandatoryDispositionPause']?_0x4ccd1d[_0xf180('0x78')]:undefined;}module[_0xf180('0x79')]=VoiceQueue; \ No newline at end of file +var _0x67fd=['unknown','inuse','busy','invalid','ringing','ringinuse','onhold','gsm','roundrobin','name','monitor_format','type','waiting','talking','total','answered','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x67fd,0x77));var _0xd67f=function(_0x507a25,_0xa05f50){_0x507a25=_0x507a25-0x0;var _0xfe03ef=_0x67fd[_0x507a25];return _0xfe03ef;};'use strict';var statusDesc=[_0xd67f('0x0'),'not_inuse',_0xd67f('0x1'),_0xd67f('0x2'),_0xd67f('0x3'),'unavailable',_0xd67f('0x4'),_0xd67f('0x5'),_0xd67f('0x6')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':_0xd67f('0x7')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xd67f('0x8')};function VoiceQueue(_0x2dab2c){this['id']=_0x2dab2c['id']||0x0;this[_0xd67f('0x9')]=_0x2dab2c[_0xd67f('0x9')]||'';this[_0xd67f('0xa')]=_0x2dab2c['monitor_format']||'';this[_0xd67f('0xb')]=_0x2dab2c[_0xd67f('0xb')]||'inbound';this[_0xd67f('0xc')]=0x0;this[_0xd67f('0xd')]=0x0;this[_0xd67f('0xe')]=0x0;this[_0xd67f('0xf')]=0x0;this['sumDuration']=0x0;this[_0xd67f('0x10')]=0x0;this[_0xd67f('0x11')]=0x0;this['unmanaged']=0x0;this[_0xd67f('0x12')]=0x0;this[_0xd67f('0x13')]=0x0;this[_0xd67f('0x14')]=0x0;this[_0xd67f('0x15')]=_0x2dab2c[_0xd67f('0x15')]||![];this[_0xd67f('0x16')]=_0x2dab2c[_0xd67f('0x16')]||0xa;this['autopause']=_0x2dab2c[_0xd67f('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0xd67f('0x18')]='';this[_0xd67f('0x19')]=0x0;this[_0xd67f('0x1a')]=0x0;this[_0xd67f('0x1b')]=_0x2dab2c[_0xd67f('0x1b')]||null;this[_0xd67f('0x1c')]=_0x2dab2c[_0xd67f('0x1c')]?_0x2dab2c[_0xd67f('0x1c')]:null;this[_0xd67f('0x1d')]=_0x2dab2c[_0xd67f('0x1d')];this[_0xd67f('0x1e')]=_0x2dab2c[_0xd67f('0x1e')]||_0xd67f('0x1f');this[_0xd67f('0x20')]=_0x2dab2c['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x2dab2c[_0xd67f('0x21')]||0x0;this[_0xd67f('0x22')]=_0x2dab2c[_0xd67f('0x22')]||0x1;this[_0xd67f('0x23')]=_0x2dab2c['dialPredictiveOptimization']||_0xd67f('0x24');this[_0xd67f('0x25')]=_0x2dab2c[_0xd67f('0x25')]||0.03;this['dialPredictiveInterval']=_0x2dab2c[_0xd67f('0x26')]||0x258;this[_0xd67f('0x27')]=_0x2dab2c[_0xd67f('0x27')]||_0xd67f('0x28');this['dialOriginateCallerIdNumber']=_0x2dab2c[_0xd67f('0x29')]||_0xd67f('0x28');this[_0xd67f('0x2a')]=_0x2dab2c[_0xd67f('0x2a')]||0x1e;this[_0xd67f('0x2b')]=_0x2dab2c[_0xd67f('0x2b')]||_0xd67f('0x2c');this[_0xd67f('0x2d')]=_0x2dab2c['dialQueueTimeout']||0x3;this[_0xd67f('0x2e')]=_0x2dab2c['dialQueueProject']||undefined;this[_0xd67f('0x2f')]=_0x2dab2c[_0xd67f('0x2f')]||0x3;this[_0xd67f('0x30')]=_0x2dab2c[_0xd67f('0x30')]||0x96;this['dialBusyMaxRetry']=_0x2dab2c[_0xd67f('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x2dab2c[_0xd67f('0x32')]||0x96;this[_0xd67f('0x33')]=_0x2dab2c[_0xd67f('0x33')]||0x3;this[_0xd67f('0x34')]=_0x2dab2c[_0xd67f('0x34')]||0x96;this[_0xd67f('0x35')]=_0x2dab2c[_0xd67f('0x35')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2dab2c['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd67f('0x36')]=_0x2dab2c['dialDropMaxRetry']||0x3;this[_0xd67f('0x37')]=_0x2dab2c[_0xd67f('0x37')]||0x96;this[_0xd67f('0x38')]=_0x2dab2c[_0xd67f('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x2dab2c[_0xd67f('0x39')]||0x96;this[_0xd67f('0x3a')]=_0x2dab2c[_0xd67f('0x3a')]||0x3;this[_0xd67f('0x3b')]=_0x2dab2c['dialMachineRetryFrequency']||0x96;this[_0xd67f('0x3c')]=_0x2dab2c[_0xd67f('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2dab2c['dialAgentRejectRetryFrequency']||0x96;this[_0xd67f('0x3d')]=_0x2dab2c[_0xd67f('0x3d')]||0x4;this[_0xd67f('0x3e')]=_0x2dab2c[_0xd67f('0x3e')]?_0x2dab2c['Trunk']:undefined;this['TrunkBackup']=_0x2dab2c[_0xd67f('0x3f')]?_0x2dab2c[_0xd67f('0x3f')]:undefined;this[_0xd67f('0x40')]=_0x2dab2c[_0xd67f('0x40')]||undefined;this['Interval']=_0x2dab2c['Interval']?_0x2dab2c['Interval']:undefined;this['dialOrderByScheduledAt']=_0x2dab2c[_0xd67f('0x41')]||'DESC';this[_0xd67f('0x42')]=_0x2dab2c[_0xd67f('0x42')]||undefined;this[_0xd67f('0x43')]=_0x2dab2c[_0xd67f('0x43')]||undefined;this[_0xd67f('0x44')]=strategy[_0x2dab2c[_0xd67f('0x44')]]||_0xd67f('0x45');this[_0xd67f('0x46')]=!![];this[_0xd67f('0x47')]=_0x2dab2c['dialAMDActive']||![];this[_0xd67f('0x48')]=_0x2dab2c['dialAMDInitialSilence'];this[_0xd67f('0x49')]=_0x2dab2c['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x2dab2c['dialAMDAfterGreetingSilence'];this[_0xd67f('0x4a')]=_0x2dab2c[_0xd67f('0x4a')];this[_0xd67f('0x4b')]=_0x2dab2c[_0xd67f('0x4b')];this[_0xd67f('0x4c')]=_0x2dab2c[_0xd67f('0x4c')];this['dialAMDMaximumNumberOfWords']=_0x2dab2c[_0xd67f('0x4d')];this[_0xd67f('0x4e')]=_0x2dab2c[_0xd67f('0x4e')];this['dialAMDMaximumWordLength']=_0x2dab2c['dialAMDMaximumWordLength'];this[_0xd67f('0x4f')]=0x0;this[_0xd67f('0x50')]=0x0;this[_0xd67f('0x51')]=_0x2dab2c[_0xd67f('0x51')];this[_0xd67f('0x52')]=0x0;this[_0xd67f('0x53')]=0x0;this[_0xd67f('0x54')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xd67f('0x55')]=0x0;this[_0xd67f('0x56')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xd67f('0x57')]=0x0;this[_0xd67f('0x58')]=0x0;this[_0xd67f('0x59')]=0x0;this[_0xd67f('0x5a')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xd67f('0x5b')]=0x0;this[_0xd67f('0x5c')]=0x0;this[_0xd67f('0x5d')]=undefined;this['startPredictive']=undefined;this[_0xd67f('0x5e')]=undefined;this[_0xd67f('0x5f')]=1.05;this[_0xd67f('0x60')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xd67f('0x61')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xd67f('0x62')]=0x0;this[_0xd67f('0x63')]=0x0;this[_0xd67f('0x64')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x2dab2c['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xd67f('0x65')]=_0x2dab2c['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xd67f('0x66')]=0x0;this[_0xd67f('0x67')]=0x0;this[_0xd67f('0x68')]=0x1;this[_0xd67f('0x69')]=0x0;this[_0xd67f('0x6a')]=0x0;this[_0xd67f('0x6b')]=0x0;this[_0xd67f('0x6c')]=0x0;this[_0xd67f('0x6d')]=_0x2dab2c[_0xd67f('0x6d')]||0x1e;this[_0xd67f('0x6e')]=_0x2dab2c['dialRecallInQueue']||![];this[_0xd67f('0x6f')]=!!_0x2dab2c[_0xd67f('0x6f')]||![];this[_0xd67f('0x70')]=!!_0x2dab2c[_0xd67f('0x70')]||![];this[_0xd67f('0x71')]=_0x2dab2c[_0xd67f('0x71')]||undefined;this[_0xd67f('0x72')]=_0x2dab2c[_0xd67f('0x72')]||![];this[_0xd67f('0x73')]=_0x2dab2c[_0xd67f('0x73')]||![];this[_0xd67f('0xa')]=monitorFormat[_0x2dab2c['monitor_format']]?monitorFormat[_0x2dab2c[_0xd67f('0xa')]]:undefined;this[_0xd67f('0x74')]=_0x2dab2c['mandatoryDisposition']||![];this[_0xd67f('0x75')]=_0x2dab2c['mandatoryDispositionPause']?_0x2dab2c[_0xd67f('0x75')]:undefined;}module[_0xd67f('0x76')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index b5308b6..3c85e2c 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 _0xbfce=['serverUrl','Configurations','exports','username','accessKey','remoteUri'];(function(_0x3100f9,_0x18f404){var _0x4067de=function(_0x56a06b){while(--_0x56a06b){_0x3100f9['push'](_0x3100f9['shift']());}};_0x4067de(++_0x18f404);}(_0xbfce,0xe7));var _0xebfc=function(_0xc72c28,_0x2c9936){_0xc72c28=_0xc72c28-0x0;var _0x5ed0f6=_0xbfce[_0xc72c28];return _0x5ed0f6;};'use strict';function VtigerAccount(_0x146ac4){this['id']=_0x146ac4['id']||0x0;this['name']=_0x146ac4['name']||'';this[_0xebfc('0x0')]=_0x146ac4[_0xebfc('0x0')]||'';this['accessKey']=_0x146ac4[_0xebfc('0x1')]||'';this[_0xebfc('0x2')]=_0x146ac4['remoteUri']||'';this['serverUrl']=_0x146ac4[_0xebfc('0x3')]||'';this['Configurations']=_0x146ac4[_0xebfc('0x4')]||{};}module[_0xebfc('0x5')]=VtigerAccount; \ No newline at end of file +var _0x9b8a=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x9b8a,0x106));var _0xa9b8=function(_0xf382e5,_0x4c8690){_0xf382e5=_0xf382e5-0x0;var _0x3272b6=_0x9b8a[_0xf382e5];return _0x3272b6;};'use strict';function VtigerAccount(_0x31b799){this['id']=_0x31b799['id']||0x0;this[_0xa9b8('0x0')]=_0x31b799[_0xa9b8('0x0')]||'';this[_0xa9b8('0x1')]=_0x31b799['username']||'';this['accessKey']=_0x31b799[_0xa9b8('0x2')]||'';this[_0xa9b8('0x3')]=_0x31b799[_0xa9b8('0x3')]||'';this['serverUrl']=_0x31b799[_0xa9b8('0x4')]||'';this['Configurations']=_0x31b799[_0xa9b8('0x5')]||{};}module[_0xa9b8('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 cfab08c..9ce89c1 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 _0x361c=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','exports'];(function(_0x9658dc,_0x4b1905){var _0x2ad48e=function(_0x3691e9){while(--_0x3691e9){_0x9658dc['push'](_0x9658dc['shift']());}};_0x2ad48e(++_0x4b1905);}(_0x361c,0x186));var _0xc361=function(_0x4eddc6,_0x111b89){_0x4eddc6=_0x4eddc6-0x0;var _0x1d6770=_0x361c[_0x4eddc6];return _0x1d6770;};'use strict';function ZendeskAccount(_0x433df5){this['id']=_0x433df5['id']||0x0;this['name']=_0x433df5[_0xc361('0x0')]||'';this[_0xc361('0x1')]=_0x433df5[_0xc361('0x1')]||'';this[_0xc361('0x2')]=_0x433df5[_0xc361('0x2')]||'';this['token']=_0x433df5[_0xc361('0x3')]||'';this[_0xc361('0x4')]=_0x433df5[_0xc361('0x4')]||'';this[_0xc361('0x5')]=_0x433df5[_0xc361('0x5')]||'';this[_0xc361('0x6')]=_0x433df5['type']||_0xc361('0x7');this[_0xc361('0x8')]=_0x433df5[_0xc361('0x8')]||'';this['Configurations']=_0x433df5['Configurations']||{};}module[_0xc361('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xd7da=['password','token','remoteUri','authType','type','integrationTab','Configurations','exports','name','username'];(function(_0x43acd6,_0x2bcc7b){var _0x3da9e5=function(_0x28170c){while(--_0x28170c){_0x43acd6['push'](_0x43acd6['shift']());}};_0x3da9e5(++_0x2bcc7b);}(_0xd7da,0x12a));var _0xad7d=function(_0x14c1f8,_0x3c04bf){_0x14c1f8=_0x14c1f8-0x0;var _0x311854=_0xd7da[_0x14c1f8];return _0x311854;};'use strict';function ZendeskAccount(_0x507bc3){this['id']=_0x507bc3['id']||0x0;this[_0xad7d('0x0')]=_0x507bc3[_0xad7d('0x0')]||'';this[_0xad7d('0x1')]=_0x507bc3[_0xad7d('0x1')]||'';this[_0xad7d('0x2')]=_0x507bc3[_0xad7d('0x2')]||'';this[_0xad7d('0x3')]=_0x507bc3[_0xad7d('0x3')]||'';this[_0xad7d('0x4')]=_0x507bc3[_0xad7d('0x4')]||'';this['authType']=_0x507bc3[_0xad7d('0x5')]||'';this[_0xad7d('0x6')]=_0x507bc3['type']||_0xad7d('0x7');this['serverUrl']=_0x507bc3['serverUrl']||'';this[_0xad7d('0x8')]=_0x507bc3[_0xad7d('0x8')]||{};}module[_0xad7d('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 5bcd4a1..88dd21a 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 _0x828d=['zone','clientSecret','serverUrl','code','refreshToken','name','description','host'];(function(_0x548614,_0x4efe8e){var _0x27dee6=function(_0x133c3c){while(--_0x133c3c){_0x548614['push'](_0x548614['shift']());}};_0x27dee6(++_0x4efe8e);}(_0x828d,0xf5));var _0xd828=function(_0x1e46b1,_0x1dbaba){_0x1e46b1=_0x1e46b1-0x0;var _0x3629cf=_0x828d[_0x1e46b1];return _0x3629cf;};'use strict';function ZohoAccount(_0x5c6bdd){this['id']=_0x5c6bdd['id']||0x0;this[_0xd828('0x0')]=_0x5c6bdd[_0xd828('0x0')]||'';this['description']=_0x5c6bdd[_0xd828('0x1')]||'';this[_0xd828('0x2')]=_0x5c6bdd[_0xd828('0x2')]||'';this[_0xd828('0x3')]=_0x5c6bdd[_0xd828('0x3')]||'';this['clientId']=_0x5c6bdd['clientId']||'';this['clientSecret']=_0x5c6bdd[_0xd828('0x4')]||'';this['serverUrl']=_0x5c6bdd[_0xd828('0x5')]||'';this['code']=_0x5c6bdd[_0xd828('0x6')]||'';this[_0xd828('0x7')]=_0x5c6bdd['refreshToken']||'';this['Configurations']=_0x5c6bdd['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x52e6=['Configurations','exports','name','description','host','clientId','clientSecret','serverUrl','refreshToken'];(function(_0x25d4e7,_0x1e2bb7){var _0xe667c8=function(_0x3716df){while(--_0x3716df){_0x25d4e7['push'](_0x25d4e7['shift']());}};_0xe667c8(++_0x1e2bb7);}(_0x52e6,0x119));var _0x652e=function(_0x24163a,_0x22396a){_0x24163a=_0x24163a-0x0;var _0x31e553=_0x52e6[_0x24163a];return _0x31e553;};'use strict';function ZohoAccount(_0x33b659){this['id']=_0x33b659['id']||0x0;this[_0x652e('0x0')]=_0x33b659[_0x652e('0x0')]||'';this[_0x652e('0x1')]=_0x33b659['description']||'';this[_0x652e('0x2')]=_0x33b659[_0x652e('0x2')]||'';this['zone']=_0x33b659['zone']||'';this[_0x652e('0x3')]=_0x33b659[_0x652e('0x3')]||'';this['clientSecret']=_0x33b659[_0x652e('0x4')]||'';this[_0x652e('0x5')]=_0x33b659[_0x652e('0x5')]||'';this['code']=_0x33b659['code']||'';this[_0x652e('0x6')]=_0x33b659['refreshToken']||'';this[_0x652e('0x7')]=_0x33b659[_0x652e('0x7')]||{};}module[_0x652e('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 9fc9e04..272d1b5 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 _0x0cfd=['recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','idContact','name','type','queue','Agent','channelAgent','membername','format','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','callbackuniqueid','callbackat'];(function(_0xff3e1c,_0x367bae){var _0x5a3b72=function(_0x3bc4e8){while(--_0x3bc4e8){_0xff3e1c['push'](_0xff3e1c['shift']());}};_0x5a3b72(++_0x367bae);}(_0x0cfd,0x185));var _0xd0cf=function(_0x3cb9be,_0x2ffba8){_0x3cb9be=_0x3cb9be-0x0;var _0xac9039=_0x0cfd[_0x3cb9be];return _0xac9039;};'use strict';var util=require(_0xd0cf('0x0'));var _=require('lodash');var moment=require(_0xd0cf('0x1'));function checkNameSurname(_0x414b28,_0x505093,_0x5d4a03){var _0x240a3f='';if(!_[_0xd0cf('0x2')](_0x505093)&&_0xd0cf('0x3')===typeof _0x505093){_0x240a3f+=_0x505093;}if(!_[_0xd0cf('0x2')](_0x5d4a03)&&_0xd0cf('0x3')===typeof _0x5d4a03){_0x240a3f+='\x20'+_0x5d4a03;}if(_0x240a3f!==''){return _0x240a3f;}return _0x414b28;}function Action(_0x30ed8f,_0x3b3347,_0x3ddaf5,_0x488f28,_0x371f13){this['uniqueid']=_0x3ddaf5||undefined;this[_0xd0cf('0x4')]=_0x30ed8f['id'];this['queue']=_0x3b3347[_0xd0cf('0x5')];this[_0xd0cf('0x6')]=_0x3b3347[_0xd0cf('0x6')];this['campaigntype']=_0xd0cf('0x7');this['dialAnswer']=![];this['membername']=_[_0xd0cf('0x2')](_0x30ed8f[_0xd0cf('0x8')])?undefined:_0x30ed8f['Agent']['name'];this[_0xd0cf('0x9')]=this[_0xd0cf('0xa')]?util[_0xd0cf('0xb')]('SIP/%s',this[_0xd0cf('0xa')]):_0x488f28||undefined;this[_0xd0cf('0xc')]=checkNameSurname(_0x30ed8f[_0xd0cf('0xd')][_0xd0cf('0xe')],_0x30ed8f[_0xd0cf('0xd')][_0xd0cf('0xf')],_0x30ed8f[_0xd0cf('0xd')][_0xd0cf('0x10')]);this[_0xd0cf('0x11')]=_0x30ed8f['active']||![];this['calleridnum']=_0x30ed8f['Contact'][_0xd0cf('0xe')];this[_0xd0cf('0x12')]=_0x30ed8f[_0xd0cf('0x12')];this['countbusyretry']=_0x30ed8f[_0xd0cf('0x13')]||0x0;this[_0xd0cf('0x14')]=_0x30ed8f[_0xd0cf('0x14')]||0x0;this[_0xd0cf('0x15')]=_0x30ed8f[_0xd0cf('0x15')]||0x0;this[_0xd0cf('0x16')]=(_0x30ed8f[_0xd0cf('0x13')]||0x0)+(_0x30ed8f[_0xd0cf('0x14')]||0x0)+(_0x30ed8f[_0xd0cf('0x15')]||0x0)+(_0x30ed8f['countnosuchnumberretry']||0x0)+(_0x30ed8f[_0xd0cf('0x17')]||0x0)+(_0x30ed8f['countabandonedretry']||0x0)+(_0x30ed8f['countmachineretry']||0x0)+(_0x30ed8f[_0xd0cf('0x18')]||0x0);this['countnosuchnumberretry']=_0x30ed8f['countnosuchnumberretry']||0x0;this[_0xd0cf('0x17')]=_0x30ed8f['countdropretry']||0x0;this[_0xd0cf('0x19')]=_0x30ed8f[_0xd0cf('0x19')]||0x0;this[_0xd0cf('0x1a')]=_0x30ed8f[_0xd0cf('0x1a')]||0x0;this[_0xd0cf('0x18')]=_0x30ed8f[_0xd0cf('0x18')]||0x0;this['callback']=_0x30ed8f['callback'];this[_0xd0cf('0x1b')]=_0x30ed8f[_0xd0cf('0x1b')];this[_0xd0cf('0x1c')]=_0x30ed8f[_0xd0cf('0x1c')];this['recallme']=_0x30ed8f[_0xd0cf('0x1d')];this[_0xd0cf('0x1e')]=_0x30ed8f['ContactId'];this[_0xd0cf('0x1f')]=_0x30ed8f[_0xd0cf('0x1f')];this[_0xd0cf('0x20')]=_[_0xd0cf('0x2')](_0x30ed8f[_0xd0cf('0x8')])?_0x30ed8f[_0xd0cf('0x20')]:_0x30ed8f['Agent']['id'];this[_0xd0cf('0x21')]=_0x30ed8f[_0xd0cf('0x21')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xd0cf('0x22')]['getCaller']=function(){return util[_0xd0cf('0xb')](_0xd0cf('0x23'),this[_0xd0cf('0xc')],this[_0xd0cf('0x24')]);};module[_0xd0cf('0x25')]=Action; \ No newline at end of file +var _0x6c66=['calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active'];(function(_0x196923,_0x3a5321){var _0x2cb920=function(_0x5ad8aa){while(--_0x5ad8aa){_0x196923['push'](_0x196923['shift']());}};_0x2cb920(++_0x3a5321);}(_0x6c66,0xee));var _0x66c6=function(_0x37e99a,_0x33c779){_0x37e99a=_0x37e99a-0x0;var _0x20bf21=_0x6c66[_0x37e99a];return _0x20bf21;};'use strict';var util=require('util');var _=require(_0x66c6('0x0'));var moment=require(_0x66c6('0x1'));function checkNameSurname(_0x483c7c,_0x8f663,_0x2b4499){var _0x5e99fe='';if(!_['isNil'](_0x8f663)&&'string'===typeof _0x8f663){_0x5e99fe+=_0x8f663;}if(!_[_0x66c6('0x2')](_0x2b4499)&&_0x66c6('0x3')===typeof _0x2b4499){_0x5e99fe+='\x20'+_0x2b4499;}if(_0x5e99fe!==''){return _0x5e99fe;}return _0x483c7c;}function Action(_0x4d2deb,_0x162f62,_0x3ca3e3,_0xf9de81,_0x3dedc6){this[_0x66c6('0x4')]=_0x3ca3e3||undefined;this[_0x66c6('0x5')]=_0x4d2deb['id'];this[_0x66c6('0x6')]=_0x162f62['name'];this[_0x66c6('0x7')]=_0x162f62[_0x66c6('0x7')];this[_0x66c6('0x8')]='queue';this[_0x66c6('0x9')]=![];this[_0x66c6('0xa')]=_[_0x66c6('0x2')](_0x4d2deb[_0x66c6('0xb')])?undefined:_0x4d2deb[_0x66c6('0xb')]['name'];this[_0x66c6('0xc')]=this['membername']?util[_0x66c6('0xd')](_0x66c6('0xe'),this['membername']):_0xf9de81||undefined;this[_0x66c6('0xf')]=checkNameSurname(_0x4d2deb['Contact']['phone'],_0x4d2deb[_0x66c6('0x10')][_0x66c6('0x11')],_0x4d2deb[_0x66c6('0x10')][_0x66c6('0x12')]);this[_0x66c6('0x13')]=_0x4d2deb[_0x66c6('0x13')]||![];this[_0x66c6('0x14')]=_0x4d2deb['Contact'][_0x66c6('0x15')];this[_0x66c6('0x16')]=_0x4d2deb[_0x66c6('0x16')];this[_0x66c6('0x17')]=_0x4d2deb[_0x66c6('0x17')]||0x0;this[_0x66c6('0x18')]=_0x4d2deb[_0x66c6('0x18')]||0x0;this['countnoanswerretry']=_0x4d2deb[_0x66c6('0x19')]||0x0;this[_0x66c6('0x1a')]=(_0x4d2deb[_0x66c6('0x17')]||0x0)+(_0x4d2deb[_0x66c6('0x18')]||0x0)+(_0x4d2deb[_0x66c6('0x19')]||0x0)+(_0x4d2deb[_0x66c6('0x1b')]||0x0)+(_0x4d2deb[_0x66c6('0x1c')]||0x0)+(_0x4d2deb[_0x66c6('0x1d')]||0x0)+(_0x4d2deb[_0x66c6('0x1e')]||0x0)+(_0x4d2deb['countagentrejectretry']||0x0);this[_0x66c6('0x1b')]=_0x4d2deb[_0x66c6('0x1b')]||0x0;this[_0x66c6('0x1c')]=_0x4d2deb[_0x66c6('0x1c')]||0x0;this[_0x66c6('0x1d')]=_0x4d2deb[_0x66c6('0x1d')]||0x0;this['countmachineretry']=_0x4d2deb[_0x66c6('0x1e')]||0x0;this[_0x66c6('0x1f')]=_0x4d2deb[_0x66c6('0x1f')]||0x0;this[_0x66c6('0x20')]=_0x4d2deb[_0x66c6('0x20')];this[_0x66c6('0x21')]=_0x4d2deb[_0x66c6('0x21')];this[_0x66c6('0x22')]=_0x4d2deb[_0x66c6('0x22')];this[_0x66c6('0x23')]=_0x4d2deb[_0x66c6('0x23')];this[_0x66c6('0x24')]=_0x4d2deb[_0x66c6('0x24')];this[_0x66c6('0x25')]=_0x4d2deb[_0x66c6('0x25')];this[_0x66c6('0x26')]=_[_0x66c6('0x2')](_0x4d2deb[_0x66c6('0xb')])?_0x4d2deb['UserId']:_0x4d2deb[_0x66c6('0xb')]['id'];this['VoiceQueueId']=_0x4d2deb[_0x66c6('0x27')];this[_0x66c6('0x28')]='';this[_0x66c6('0x29')]='';}Action['prototype']['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x66c6('0xf')],this['number']);};module[_0x66c6('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 195aa3c..ce0e14e 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 _0x9957=['[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','BUSY','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','agentreject','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectRetryFrequency','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','clone','responsetime','response','idContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','campaignsPreview','voiceQueues','trunks','actions','agents','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice_queue:save','info','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','syncCampaigns','preview','dialMethod','booked','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','dialPreviewAutoRecallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','Action','status','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','length','scheduledat','dialRecallMeTimeout','Agent','then','logger2','[RecallMe]','catch','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','ANSWER','answertime','[syncHangup][talking][increment]','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','decrementTalkink','[16]','Answer'];(function(_0x338722,_0x250312){var _0x3b3198=function(_0x1daeb4){while(--_0x1daeb4){_0x338722['push'](_0x338722['shift']());}};_0x3b3198(++_0x250312);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var BPromise=require(_0x7995('0x2'));var uuid=require(_0x7995('0x3'));var moment=require('moment');var md5=require(_0x7995('0x4'));var Redis=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('preview');var loggerAction=require(_0x7995('0x7'))(_0x7995('0x8'));var ami=require(_0x7995('0x9'));var rpcDb=require(_0x7995('0xa'));var Action=require(_0x7995('0xb'));var ut=require(_0x7995('0xc'));config['redis']=_[_0x7995('0xd')](config[_0x7995('0xe')],{'host':'localhost','port':0x18eb});var io=require(_0x7995('0xf'))(new Redis(config[_0x7995('0xe')]));var Sequence=function(){};Sequence[_0x7995('0x10')][_0x7995('0x11')]=function(_0x3c1d19){this[_0x7995('0x12')]=this[_0x7995('0x12')]?this['tail'][_0x7995('0x13')](_0x3c1d19):_0x3c1d19();};function Preview(_0x41c652){this['sequence']=new Sequence();this[_0x7995('0x14')]=_0x41c652[_0x7995('0x15')];this[_0x7995('0x16')]=_0x41c652[_0x7995('0x16')];this[_0x7995('0x17')]={};this[_0x7995('0x18')]=_0x41c652[_0x7995('0x18')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0x7995('0x19')][_0x7995('0x1a')](this));ami['on'](_0x7995('0x1b'),this[_0x7995('0x1c')][_0x7995('0x1a')](this));ami['on'](_0x7995('0x1d'),this[_0x7995('0x1e')][_0x7995('0x1a')](this));ami['on']('dialend',this[_0x7995('0x1f')]['bind'](this));ami['on'](_0x7995('0x20'),this[_0x7995('0x21')][_0x7995('0x1a')](this));ami['on'](_0x7995('0x22'),this[_0x7995('0x23')][_0x7995('0x1a')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7995('0x1a')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x7995('0x1a')](this));this[_0x7995('0x24')](this['campaignsPreview']);}function emit(_0x3a9b54,_0x51f276,_0x4b1a8e){io['to'](_0x3a9b54)[_0x7995('0x25')](_0x51f276,_0x4b1a8e);}function emitCampaignPreview(_0x327b1f){if(_0x327b1f[_0x7995('0x26')]===_0x7995('0x27')){var _0x460924={'id':_0x327b1f['id'],'name':_0x327b1f[_0x7995('0x28')],'strategy':_0x327b1f['strategy'],'answered':_0x327b1f[_0x7995('0x29')],'available':_0x327b1f[_0x7995('0x2a')],'loggedIn':_0x327b1f[_0x7995('0x2b')],'pTalking':_0x327b1f[_0x7995('0x2c')],'sumBillable':_0x327b1f[_0x7995('0x2d')],'sumDuration':_0x327b1f[_0x7995('0x2e')],'sumHoldTime':_0x327b1f[_0x7995('0x2f')]||0x0,'talking':_0x327b1f[_0x7995('0x30')],'total':_0x327b1f['total'],'type':_0x327b1f[_0x7995('0x26')],'unmanaged':_0x327b1f[_0x7995('0x31')],'abandoned':_0x327b1f[_0x7995('0x32')],'waiting':_0x327b1f[_0x7995('0x33')],'loggedInDb':_0x327b1f[_0x7995('0x34')],'dialActive':_0x327b1f[_0x7995('0x35')],'dialMethod':_0x327b1f['dialMethod'],'dialOriginateCallerIdName':_0x327b1f[_0x7995('0x36')],'dialOriginateCallerIdNumber':_0x327b1f['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x327b1f[_0x7995('0x37')],'dialPrefix':_0x327b1f[_0x7995('0x38')],'outboundAnswerAgiCallsDay':_0x327b1f[_0x7995('0x39')],'outboundAnswerCallsDay':_0x327b1f[_0x7995('0x3a')],'outboundBlacklistCallsDay':_0x327b1f[_0x7995('0x3b')],'outboundBusyCallsDay':_0x327b1f['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x327b1f[_0x7995('0x3c')],'outboundDropCallsDayACS':_0x327b1f['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x327b1f[_0x7995('0x3d')],'outboundDropCallsDayTimeout':_0x327b1f[_0x7995('0x3e')],'outboundNoAnswerCallsDay':_0x327b1f[_0x7995('0x3f')],'outboundNoSuchCallsDay':_0x327b1f['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x327b1f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x327b1f['outboundReCallsDay'],'outboundRejectCallsDay':_0x327b1f[_0x7995('0x40')],'outboundUnknownCallsDay':_0x327b1f[_0x7995('0x41')],'outboundAbandonedCallsDay':_0x327b1f[_0x7995('0x42')],'predictiveIntervalAnsweredCalls':_0x327b1f[_0x7995('0x43')],'predictiveIntervalAvgHoldtime':_0x327b1f[_0x7995('0x44')],'predictiveIntervalAvgTalktime':_0x327b1f[_0x7995('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x327b1f['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x327b1f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x327b1f[_0x7995('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x327b1f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x327b1f[_0x7995('0x47')],'predictiveIntervalMultiplicativeFactor':_0x327b1f[_0x7995('0x48')],'predictiveIntervalPauses':_0x327b1f[_0x7995('0x49')],'predictiveIntervalAvailable':_0x327b1f[_0x7995('0x4a')],'predictiveIntervalTotalCalls':_0x327b1f[_0x7995('0x4b')],'message':_0x327b1f['message'],'originated':_0x327b1f[_0x7995('0x4c')],'erlangCalls':_0x327b1f[_0x7995('0x4d')],'erlangCallToSecond':_0x327b1f['erlangCallToSecond'],'erlangAbandonmentRate':_0x327b1f['erlangAbandonmentRate'],'erlangBusyFactor':_0x327b1f['erlangBusyFactor'],'startPredictive':_0x327b1f[_0x7995('0x4e')],'startProgressive':_0x327b1f[_0x7995('0x4f')]};if(_0x327b1f['Trunk']){_0x460924[_0x7995('0x50')]={'id':_0x327b1f['Trunk']['id'],'name':_0x327b1f[_0x7995('0x50')][_0x7995('0x28')],'active':_0x327b1f[_0x7995('0x50')]['active'],'callerid':_0x327b1f['Trunk'][_0x7995('0x51')]};}if(_0x327b1f['Interval']){_0x460924['Interval']={'id':_0x327b1f[_0x7995('0x52')]['id'],'name':_0x327b1f[_0x7995('0x52')]['name']};}var _0x1baa15=md5(JSON[_0x7995('0x53')](_0x460924));if(_0x327b1f[_0x7995('0x4')]!==_0x1baa15){_0x327b1f[_0x7995('0x4')]=_0x1baa15;emit(util[_0x7995('0x54')]('voice:queue:%s',_0x460924[_0x7995('0x28')]),_0x7995('0x55'),_0x460924);}}}function emitVoiceQueueChannelRemove(_0xf612e6){logger[_0x7995('0x56')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x7995('0x53')](_0xf612e6));emit(util[_0x7995('0x54')](_0x7995('0x57'),_0xf612e6[_0x7995('0x28')]),_0x7995('0x58'),_0xf612e6);io[_0x7995('0x25')]('voice_queue_presence:remove',_0xf612e6);}function notSendMessagesQueue(_0x183a68){if(_0x183a68[_0x7995('0x59')]){if(_0x183a68[_0x7995('0x4c')]===0x0&&_0x183a68[_0x7995('0x2c')]===0x0){_0x183a68[_0x7995('0x59')]=![];_0x183a68[_0x7995('0x2a')]=0x0;_0x183a68[_0x7995('0x5a')]=0x0;_0x183a68[_0x7995('0x5b')]=_0x7995('0x5c');ut[_0x7995('0x5d')](_0x7995('0x5e'),_0x183a68[_0x7995('0x28')]+_0x7995('0x5f'));}else{_0x183a68['message']='IS_DISACTIVED';ut[_0x7995('0x5d')](_0x7995('0x5e'),_0x183a68['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x183a68);}}Preview[_0x7995('0x10')]['loopCampaigns']=function(){var _0x504a33=this;setInterval(function(){_0x504a33[_0x7995('0x60')]();},0x7cf);};Preview[_0x7995('0x10')][_0x7995('0x60')]=function(){var _0x576b96=this[_0x7995('0x14')];this['clockClearZombieChannels']+=0x1;for(var _0x3993b5 in _0x576b96){if(_0x576b96['hasOwnProperty'](_0x3993b5)&&(_0x576b96[_0x3993b5]['dialMethod']===_0x7995('0x61')||_0x576b96[_0x3993b5][_0x7995('0x62')]===_0x7995('0x63'))&&_0x576b96[_0x3993b5][_0x7995('0x26')]==='outbound'){if(this[_0x7995('0x64')]>0x7){this[_0x7995('0x64')]=0x0;this[_0x7995('0x65')]();}}if(_0x576b96[_0x7995('0x66')](_0x3993b5)&&_0x576b96[_0x3993b5]['dialMethod']==='preview'&&_0x576b96[_0x3993b5][_0x7995('0x26')]==='outbound'){if(_0x576b96[_0x3993b5][_0x7995('0x35')]){this['setMessage'](_0x576b96[_0x3993b5]);if(_0x576b96[_0x3993b5][_0x7995('0x67')])this['recallMe'](_0x576b96[_0x3993b5]);}else{notSendMessagesQueue(_0x576b96[_0x3993b5]);}}}};Preview[_0x7995('0x10')][_0x7995('0x68')]=function(_0x4d9245){var _0x3e9e62=this;this[_0x7995('0x69')][_0x7995('0x11')](function(){if(!_[_0x7995('0x6a')](_0x3e9e62['actions'][_0x4d9245])){loggerAction[_0x7995('0x56')](_0x7995('0x6b'),_0x4d9245,_0x7995('0x6c'),_0x3e9e62['actions'][_0x4d9245][_0x7995('0x6d')],_0x7995('0x6e'),JSON[_0x7995('0x53')](_0x3e9e62[_0x7995('0x14')][_0x3e9e62[_0x7995('0x17')][_0x4d9245]['queue']][_0x7995('0x4c')]),_0x7995('0x6f'),JSON['stringify'](_0x3e9e62[_0x7995('0x14')][_0x3e9e62['actions'][_0x4d9245][_0x7995('0x6d')]][_0x7995('0x2c')]),JSON[_0x7995('0x53')](_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x70')]),JSON[_0x7995('0x53')](_[_0x7995('0x71')](_0x3e9e62['actions'][_0x4d9245],[_0x7995('0x72'),_0x7995('0x73'),_0x7995('0x74'),'ListId'])));return ami[_0x7995('0x75')]({'action':_0x7995('0x76'),'channel':_0x3e9e62[_0x7995('0x17')][_0x4d9245]['channel']})['catch'](function(_0x5a592e){if(_0x5a592e[_0x7995('0x5b')]===_0x7995('0x77')){setTimeout(function(){if(_0x3e9e62['actions'][_0x4d9245]){ut[_0x7995('0x78')](_0x3e9e62[_0x7995('0x14')][_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x6d')]],_0x7995('0x79'));if(_0x3e9e62['actions'][_0x4d9245][_0x7995('0x70')]===!![]){ut['decrementTalkink'](_0x3e9e62[_0x7995('0x14')][_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x6d')]],'[clearZombieChannel]');ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x4d9245,_0x3e9e62['actions'][_0x4d9245][_0x7995('0x6d')]);}ut[_0x7995('0x7a')](_0x7995('0x7b')+_0x4d9245,_0x3e9e62[_0x7995('0x17')][_0x4d9245][_0x7995('0x6d')]);delete _0x3e9e62[_0x7995('0x17')][_0x4d9245];}},0x2328);}});}});};Preview[_0x7995('0x10')][_0x7995('0x65')]=function(){var _0x328671=this;loggerAction[_0x7995('0x56')](_0x7995('0x7c'),_[_0x7995('0x7d')](this[_0x7995('0x17')]));for(var _0x35bea3 in this[_0x7995('0x17')]){if(_0x328671[_0x7995('0x17')][_0x7995('0x66')](_0x35bea3)){_0x328671[_0x7995('0x68')](_0x35bea3);}}};Preview[_0x7995('0x10')]['recallMe']=function(_0x56a374){var _0x630737=this;rpcDb[_0x7995('0x7e')](_0x56a374['id'],ut[_0x7995('0x7f')](this['agents']))['then'](function(_0x402fa0){if(!_[_0x7995('0x6a')](_0x402fa0)){for(var _0x5b9467=0x0;_0x5b9467<_0x402fa0[_0x7995('0x80')];_0x5b9467+=0x1){if(ut['getDiff'](_0x402fa0[_0x5b9467][_0x7995('0x81')])<_0x56a374[_0x7995('0x82')]*0x3c){if(_0x402fa0[_0x5b9467][_0x7995('0x83')]&&!_0x402fa0[_0x5b9467][_0x7995('0x83')]['voicePause']){_0x630737['run'](_0x402fa0[_0x5b9467]['id'])[_0x7995('0x84')](ut[_0x7995('0x85')](_0x7995('0x86')))[_0x7995('0x87')](ut[_0x7995('0x85')](_0x7995('0x86')));}else{rpcDb[_0x7995('0x88')](_0x402fa0[_0x5b9467]['id']);}}else{var _0x1e2206=new Action(_0x402fa0[_0x5b9467],_0x56a374);_0x1e2206[_0x7995('0x89')]=moment()['format'](_0x7995('0x8a'));_0x56a374[_0x7995('0x8b')]+=0x1;ut[_0x7995('0x8c')](_0x1e2206,0x17,_0x7995('0x8d'));if(_0x56a374['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0x7995('0x8e')](_0x402fa0[_0x5b9467]));rpcDb[_0x7995('0x8f')](_0x1e2206,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x7995('0x8c')](_0x1e2206,0x16,_0x7995('0x90'));rpcDb[_0x7995('0x8f')](_0x1e2206,_0x7995('0x91'));rpcDb[_0x7995('0x92')](_0x1e2206,'[HistoryRecallClose]');}}}}})[_0x7995('0x87')](ut['logger2'](_0x7995('0x93')));};Preview[_0x7995('0x10')][_0x7995('0x94')]=function(_0x25b534){_0x25b534[_0x7995('0x59')]=!![];if(ut[_0x7995('0x95')](_0x25b534[_0x7995('0x2b')])){_0x25b534[_0x7995('0x5b')]=_0x7995('0x96');}else if(!ut[_0x7995('0x97')](_0x25b534[_0x7995('0x35')])){_0x25b534[_0x7995('0x5b')]='NOT_ACTIVE';}else if(!this[_0x7995('0x98')](_0x25b534[_0x7995('0x50')])){if(!this[_0x7995('0x98')](_0x25b534[_0x7995('0x99')])){_0x25b534[_0x7995('0x5b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x25b534['message']=_0x7995('0x9a');}}else{_0x25b534[_0x7995('0x5b')]=_0x7995('0x9a');}emitCampaignPreview(_0x25b534);};Preview[_0x7995('0x10')]['callProgressDetectingCustomer']=function(_0x22d317,_0x50a12e,_0x5df621){var _0xca8238=this;var _0x36d27d=this[_0x7995('0x17')][_0x50a12e];var _0x44bf2b=this[_0x7995('0x14')][_0x36d27d[_0x7995('0x6d')]];var _0x32a52f;if(_0x44bf2b){switch(_0x5df621){case'1':_0x44bf2b[_0x7995('0x9b')]+=0x1;_0x36d27d[_0x7995('0x9c')]+=0x1;_0x36d27d[_0x7995('0x9d')]=ut['totalGlobal'](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x0,_0x7995('0x9e'));ami[_0x7995('0x25')]('custom:agentnosuchnumber',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xa0')));rpcDb[_0x7995('0x8f')](_0x36d27d,_0x7995('0xa1'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xa6'));}else{if(_0x36d27d[_0x7995('0x9c')]>=_0x44bf2b['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x36d27d,_0x7995('0xa6'));}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0x9c'),_0x44bf2b['dialNoSuchNumberRetryFrequency']),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}delete this['actions'][_0x22d317['linkedid']];break;case _0x7995('0xab'):var _0x305b5a=moment()['format'](_0x7995('0x8a'));_0x36d27d['responsetime']=_0x305b5a;_0x36d27d[_0x7995('0xac')]=_0x305b5a;_0x36d27d[_0x7995('0x70')]=!![];_0x44bf2b['pTalking']+=0x1;logger['info'](_0x7995('0xad'),_0x36d27d['uniqueid'],_0x7995('0xae'),_0x44bf2b[_0x7995('0x28')],_0x7995('0x6f'),_0x44bf2b[_0x7995('0x2c')]);ami[_0x7995('0x25')](_0x7995('0xaf'),ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xb0'),this[_0x7995('0x14')][_0x36d27d[_0x7995('0x6d')]]));if(_0x44bf2b[_0x7995('0xb1')]){ami[_0x7995('0x25')](_0x7995('0xb2'),ut[_0x7995('0xb3')](_0x36d27d));}break;case'16':ami[_0x7995('0x25')](_0x7995('0xb4'),ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xb5'),this[_0x7995('0x14')][_0x36d27d[_0x7995('0x6d')]]));emitVoiceQueueChannelRemove(ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xb5')));_0x44bf2b[_0x7995('0x3a')]+=0x1;_0x44bf2b[_0x7995('0xb6')]+=0x1;_0x44bf2b[_0x7995('0x29')]+=0x1;ut[_0x7995('0xb7')](_0x44bf2b,_0x7995('0xb8'));_0x36d27d[_0x7995('0x9d')]=ut['totalGlobal'](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x4,_0x7995('0xb9'));rpcDb['createCustomerHistory'](_0x36d27d,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xba'));rpcDb[_0x7995('0xbb')](_0x36d27d);_0x44bf2b[_0x7995('0x2e')]+=_0x36d27d[_0x7995('0xbc')];_0x44bf2b[_0x7995('0x2d')]+=_0x36d27d['talktime'];logger[_0x7995('0x56')](_0x7995('0xbd'),_0x36d27d[_0x7995('0xbe')],_0x7995('0xae'),_0x44bf2b[_0x7995('0x28')],_0x7995('0x6f'),_0x44bf2b[_0x7995('0x2c')]);delete this[_0x7995('0x17')][_0x22d317['linkedid']];break;case _0x7995('0xbf'):_0x44bf2b[_0x7995('0xc0')]+=0x1;_0x36d27d['countbusyretry']+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x5,_0x7995('0xc1'));ami[_0x7995('0x25')](_0x7995('0xc2'),ut['buildObj'](_0x36d27d,_0x7995('0xc3')));rpcDb[_0x7995('0x8f')](_0x36d27d,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb['createCustomerFinal'](_0x32a52f,_0x7995('0xc4'));}else{if(_0x36d27d[_0x7995('0xc5')]>=_0x44bf2b[_0x7995('0xc6')]){rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xc7'));}else{rpcDb['rescheduleContact'](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0xc5'),_0x44bf2b[_0x7995('0xc8')]),_0x36d27d['unlockAgent'],_0x36d27d[_0x7995('0xaa')]);}}break;case _0x7995('0xc9'):_0x44bf2b[_0x7995('0x3f')]+=0x1;_0x36d27d[_0x7995('0xca')]+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x3,_0x7995('0xcb'));ami['emit']('custom:agentnoanswer',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xcc')));rpcDb['createCustomerHistory'](_0x36d27d,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x36d27d['countnoanswerretry']>=_0x44bf2b[_0x7995('0xcd')]){rpcDb['createCustomerFinal'](_0x36d27d,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0xca'),_0x44bf2b['dialNoAnswerRetryFrequency']),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case _0x7995('0xce'):_0x44bf2b[_0x7995('0x3c')]+=0x1;_0x36d27d[_0x7995('0xcf')]+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x8,_0x7995('0xd0'));ami[_0x7995('0x25')]('custom:agentcongestion',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xd1')));rpcDb['createCustomerHistory'](_0x36d27d,_0x7995('0xd2'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b['dialGlobalMaxRetry']){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,'Global');rpcDb[_0x7995('0x92')](_0x32a52f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x36d27d[_0x7995('0xcf')]>=_0x44bf2b['dialCongestionMaxRetry']){rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xd2'));}else{rpcDb['rescheduleContact'](ut[_0x7995('0xa8')](_0x36d27d,'countcongestionretry',_0x44bf2b['dialBusyRetryFrequency']),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case _0x7995('0xd3'):_0x44bf2b[_0x7995('0x40')]+=0x1;_0x36d27d['countagentrejectretry']+=0x1;_0x36d27d[_0x7995('0x9d')]=ut[_0x7995('0xa2')](_0x36d27d);ut['logCustomer'](_0x36d27d,0x14,'AgentReject');ami[_0x7995('0x25')]('custom:agentreject',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xd4')));rpcDb[_0x7995('0x8f')](_0x36d27d,'[syncHangupRequest][logAgentReject]');if(ut['totalGlobal'](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0x14,_0x7995('0xd5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xd6'));}else{if(_0x36d27d[_0x7995('0xd7')]>=_0x44bf2b['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x36d27d,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,_0x7995('0xd7'),_0x44bf2b[_0x7995('0xd8')]),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case'ABANDONED':_0x44bf2b['outboundAbandonedCallsDay']+=0x1;_0x36d27d[_0x7995('0xd9')]+=0x1;_0x36d27d['countglobal']=ut['totalGlobal'](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x36d27d,_0x7995('0xda'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xda'));}else{if(_0x36d27d[_0x7995('0xdb')]>=_0x44bf2b[_0x7995('0xdc')]){rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xda'));}else{rpcDb[_0x7995('0xa7')](ut[_0x7995('0xa8')](_0x36d27d,'countabandonedretry',_0x44bf2b[_0x7995('0xdd')]),_0x36d27d[_0x7995('0xa9')],_0x36d27d[_0x7995('0xaa')]);}}break;case'18':_0x44bf2b[_0x7995('0x41')]+=0x1;_0x36d27d[_0x7995('0xde')]+=0x1;_0x36d27d['countglobal']=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x12,_0x22d317[_0x7995('0xdf')]||_0x22d317['dialstatus']);ami['emit']('custom:amd',ut[_0x7995('0x9f')](_0x36d27d,_0x7995('0xe0')));rpcDb[_0x7995('0x8f')](_0x36d27d,_0x7995('0xe1'));if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut['cloneAction'](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb['createCustomerFinal'](_0x32a52f,_0x7995('0xe1'));}else{rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xe1'));}delete this[_0x7995('0x17')][_0x22d317[_0x7995('0xe2')]];break;case'19':_0x44bf2b[_0x7995('0x41')]+=0x1;_0x36d27d[_0x7995('0x9d')]=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0x13,_0x22d317[_0x7995('0xdf')]||_0x22d317[_0x7995('0xe3')]);ami['emit'](_0x7995('0xe4'),ut['buildObj'](_0x36d27d,_0x7995('0xe0')));rpcDb[_0x7995('0x8f')](_0x36d27d,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x36d27d)>=_0x44bf2b[_0x7995('0xa3')]){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,_0x7995('0xe5'));}else{rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xe5'));}delete this[_0x7995('0x17')][_0x22d317[_0x7995('0xe2')]];break;default:if(_0x36d27d[_0x7995('0x70')]){ut[_0x7995('0xb7')](_0x44bf2b,_0x7995('0xe6'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x44bf2b[_0x7995('0x28')],_0x22d317);}_0x44bf2b[_0x7995('0x41')]+=0x1;_0x36d27d[_0x7995('0x9d')]=ut[_0x7995('0xa2')](_0x36d27d);ut[_0x7995('0x8c')](_0x36d27d,0xc,_0x22d317['cause-txt']||_0x22d317[_0x7995('0xe3')]);rpcDb[_0x7995('0x8f')](_0x36d27d,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x7995('0xa2')](_0x36d27d)>=_0x44bf2b['dialGlobalMaxRetry']){_0x32a52f=ut[_0x7995('0xa4')](_0x36d27d,0xf,_0x7995('0xa5'));rpcDb[_0x7995('0x92')](_0x32a52f,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x7995('0x92')](_0x36d27d,_0x7995('0xe7'));}delete this[_0x7995('0x17')][_0x22d317[_0x7995('0xe2')]];}if(!(_0x36d27d[_0x7995('0x70')]&&_0x5df621==='16')){ut[_0x7995('0x78')](_0x44bf2b,_0x7995('0xe8'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x36d27d['uniqueid'],_0x7995('0xae'),_0x44bf2b[_0x7995('0x28')],'originated:\x20',_0x44bf2b['originated']);}if(_0x5df621!==_0x7995('0xab')){delete this[_0x7995('0x17')][_0x22d317['linkedid']];delete this['actions'][_0x22d317['destlinkedid']];}}};Preview['prototype'][_0x7995('0xe9')]=function(_0x15ae93,_0x346484,_0x421e44){if(_['isUndefined'](_0x346484)&&_0x7995('0xea')!==typeof _0x346484){return;}if(_[_0x7995('0xeb')](_0x421e44)&&'object'!==typeof _0x421e44){return;}switch(_0x421e44[_0x7995('0xec')]){case'0':ut[_0x7995('0xed')](_0x15ae93,0x0,_0x7995('0x9e'));rpcDb['createAgentHistory'](_0x15ae93,_0x7995('0xee'));break;case'3':ut[_0x7995('0xed')](_0x15ae93,0x3,'NoAnswer');rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf0'));break;case'5':ut[_0x7995('0xed')](_0x15ae93,0x5,_0x7995('0xc1'));rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf1'));break;case'8':ut[_0x7995('0xed')](_0x15ae93,0x8,_0x7995('0xd0'));rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf2'));break;case'22':ut[_0x7995('0xed')](_0x15ae93,0x16,_0x7995('0xf3'));rpcDb[_0x7995('0xef')](_0x15ae93,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x7995('0xed')](_0x15ae93,0xc,_0x421e44[_0x7995('0xec')]);rpcDb[_0x7995('0xef')](_0x15ae93,_0x7995('0xf2'));}ut['updateOriginated'](_0x346484,_0x7995('0xf4'));logger[_0x7995('0x56')](_0x7995('0xf5'),_0x15ae93['uniqueid'],_0x7995('0xae'),_0x346484[_0x7995('0x28')],_0x7995('0x6e'),_0x346484[_0x7995('0x4c')]);delete this[_0x7995('0x17')][_0x15ae93[_0x7995('0xbe')]];};Preview[_0x7995('0x10')]['checkInBlack']=function(_0x35dbd7,_0x4efc7f,_0x101bc6,_0x164c61,_0x2190d1){var _0x4cae1c=this;return new BPromise(function(_0xd012b9,_0x5a1892){if(_['isNil'](_0x4efc7f)||_['isNil'](_0x4efc7f['Contact'])||_[_0x7995('0x6a')](_0x4efc7f[_0x7995('0xf6')]['phone'])||_[_0x7995('0x6a')](_0x4efc7f[_0x7995('0x74')])){_0x5a1892(ut['message'](_0x7995('0xf7'),_0x164c61,_0x2190d1));return;}var _0xb80394=uuid['v4']();var _0x3e935f=_0x4cae1c[_0x7995('0x14')][_0x4efc7f[_0x7995('0x6c')]['name']];var _0x38ea3e=_0x101bc6?_0x4cae1c[_0x7995('0x18')][_0x101bc6]['id']:undefined;_0x4cae1c[_0x7995('0x17')][_0xb80394]=new Action(_0x4efc7f,_0x3e935f,_0xb80394,_0x101bc6,_0x38ea3e);var _0x186ebe=_0x4cae1c['actions'][_0xb80394];_0x186ebe[_0x7995('0xa9')]=_0x164c61;_0x186ebe[_0x7995('0xaa')]=_0x2190d1;_0x186ebe[_0x7995('0xf8')]=_0x101bc6;if(_[_0x7995('0xf9')](_0x35dbd7)){_0x4cae1c[_0x7995('0xfa')](_0x186ebe,_0x3e935f,_0x4efc7f,_0x101bc6)[_0x7995('0x84')](function(_0x30ad6e){logger[_0x7995('0x56')](_0x7995('0xfb'),_0x7995('0xfc')+_0x186ebe['queue']+_0x7995('0xfd')+_0x186ebe['idContact'],JSON[_0x7995('0x53')](_0x30ad6e));ami[_0x7995('0x25')](_0x7995('0xfe'),ut['buildObj'](_0x186ebe,'called',_0x4cae1c[_0x7995('0x14')][_0x186ebe[_0x7995('0x6d')]]));_0xd012b9(ut['message'](_0x7995('0xff')));})['catch'](function(_0x43de18){ut[_0x7995('0x5d')](_0x7995('0x100'),_0x43de18);_0x5a1892(ut[_0x7995('0x5b')]('Call\x20failed',_0x164c61,_0x2190d1));});}else{_0x3e935f['outboundBlacklistCallsDay']+=0x1;ut[_0x7995('0x101')](_0x186ebe);rpcDb[_0x7995('0x102')](_0x186ebe,_0x7995('0x103'));delete _0x4cae1c[_0x7995('0x17')][_0xb80394];_0x5a1892(ut['message'](_0x7995('0x104'),_0x164c61,_0x2190d1));}});};Preview[_0x7995('0x10')][_0x7995('0x98')]=function(_0x241427){return!_[_0x7995('0x6a')](_0x241427)&&!_['isNil'](_0x241427['name'])&&!_['isNil'](_0x241427[_0x7995('0x105')])&&_0x241427[_0x7995('0x105')]&&!_['isNil'](this[_0x7995('0x16')][util['format'](_0x7995('0x106'),_0x241427[_0x7995('0x28')])])&&!_[_0x7995('0x6a')](this[_0x7995('0x16')][util['format'](_0x7995('0x106'),_0x241427[_0x7995('0x28')])][_0x7995('0x76')])&&(this[_0x7995('0x16')][util[_0x7995('0x54')](_0x7995('0x106'),_0x241427[_0x7995('0x28')])][_0x7995('0x76')]===_0x7995('0x107')||this[_0x7995('0x16')][util[_0x7995('0x54')](_0x7995('0x106'),_0x241427[_0x7995('0x28')])][_0x7995('0x76')]==='unmonitored');};Preview[_0x7995('0x10')]['run']=function(_0x5dc3e5,_0xbd6c64){var _0x5cf7b2=this;return new BPromise(function(_0x433bb2,_0x55dc6c){_0x5cf7b2[_0x7995('0x108')](_0x5dc3e5,_0xbd6c64)[_0x7995('0x84')](function(_0x4ea477){_0x433bb2(_['pick'](_0x4ea477,['message']));})[_0x7995('0x87')](function(_0x198867){if(_0x198867[_0x7995('0x109')]){rpcDb[_0x7995('0x10a')](_0x5dc3e5);}if(_0x198867['active']){rpcDb[_0x7995('0x88')](_0x5dc3e5);}_0x55dc6c(_[_0x7995('0x71')](_0x198867,[_0x7995('0x5b')]));});});};Preview[_0x7995('0x10')][_0x7995('0x108')]=function(_0x3ab70c,_0x3e8479){var _0x2b874e=this;return new BPromise(function(_0x47f0d9,_0x2e93a9){var _0x5e12c4,_0x2cc43d;rpcDb[_0x7995('0x10b')](_0x3ab70c)['then'](function(_0x3e90a5){if(!_[_0x7995('0x6a')](_0x3e90a5[0x0])){_0x2cc43d=_0x3e90a5[0x0][_0x7995('0x10c')]?![]:!![];_0x5e12c4=_0x3e90a5[0x0][_0x7995('0x10c')]?!![]:![];_0x5e12c4=_0x3e8479?!![]:_0x5e12c4;}var _0x20949f=_0x2b874e[_0x7995('0x10d')](_0x3e90a5);if(_0x20949f['isValid']){rpcDb[_0x7995('0x10e')](_[_0x7995('0x71')](_0x3e90a5[0x0],[_0x7995('0x74'),_0x7995('0x10f')]))[_0x7995('0x84')](function(_0x3e3b05){_0x2b874e[_0x7995('0x110')](_0x3e3b05,_0x3e90a5[0x0],_0x3e8479,_0x2cc43d,_0x5e12c4)[_0x7995('0x84')](function(_0xf76f46){_0x47f0d9(_0xf76f46);})[_0x7995('0x87')](function(_0x370e25){_0x2e93a9(_0x370e25);});})[_0x7995('0x87')](function(_0x64a62d){ut[_0x7995('0x5d')](_0x7995('0x111'),_0x64a62d);_0x2e93a9(ut[_0x7995('0x5b')](_0x7995('0x112'),_0x2cc43d,_0x5e12c4));});}else{_0x2e93a9(ut[_0x7995('0x5b')](_0x20949f[_0x7995('0x5b')],_0x2cc43d,_0x5e12c4));}})[_0x7995('0x87')](function(_0x37e69d){ut['logger']('[Preview][getContactPreview]',_0x37e69d);_0x2e93a9(ut[_0x7995('0x5b')](_0x7995('0x112'),![],!![]));});});};Preview['prototype'][_0x7995('0x10d')]=function(_0x4c251c){if(_[_0x7995('0x6a')](_0x4c251c)||_['isEmpty'](_0x4c251c)||!_[_0x7995('0x6a')](_0x4c251c[0x0][_0x7995('0x83')])&&_[_0x7995('0x6a')](_0x4c251c[0x0][_0x7995('0x83')][_0x7995('0x28')])){ut[_0x7995('0x5d')](_0x7995('0x113'),_0x4c251c);return{'isValid':![],'message':_0x7995('0x114')};}var _0x10f635=this[_0x7995('0x14')][_0x4c251c[0x0]['Queue'][_0x7995('0x28')]];_0x10f635[_0x7995('0x5b')]=_0x7995('0x9a');if(_[_0x7995('0x6a')](_0x10f635)){ut['logger'](_0x7995('0x115'),_0x10f635);return{'isValid':![],'message':_0x7995('0x116')};}if(!this[_0x7995('0x98')](_0x10f635[_0x7995('0x50')])){ut['logger'](_0x7995('0x117'),_0x7995('0x118')+_0x10f635[_0x7995('0x28')]+_0x7995('0x119'));if(!this[_0x7995('0x98')](_0x10f635[_0x7995('0x99')])){ut[_0x7995('0x5d')](_0x7995('0x117'),_0x10f635[_0x7995('0x28')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x7995('0x11a')};}}if(!ut['isActive'](_0x10f635[_0x7995('0x35')])){ut[_0x7995('0x5d')](_0x7995('0x11b'),_0x10f635[_0x7995('0x28')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x7995('0x118')+_0x10f635[_0x7995('0x28')]+_0x7995('0x11c')};}return{'isValid':!![],'message':_0x7995('0x11d')};};Preview[_0x7995('0x10')][_0x7995('0xfa')]=function(_0x3661ab,_0x408692,_0x394a9f,_0xbfb30){var _0x45f389=this;return new BPromise(function(_0x44d6a8,_0x7d14e2){var _0x405711=_0x3661ab['uniqueid'];var _0x5cb30e=_0x45f389[_0x7995('0x98')](_0x408692[_0x7995('0x50')])?util[_0x7995('0x54')]('SIP/%s/%s%s',_0x408692[_0x7995('0x50')][_0x7995('0x28')],_[_0x7995('0x6a')](_0x408692['dialPrefix'])?'':_0x408692[_0x7995('0x38')][_0x7995('0x11e')]()||'',_0x408692[_0x7995('0x11f')]>0x0?_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')][_0x7995('0x121')](_0x408692[_0x7995('0x11f')]):_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')]):util[_0x7995('0x54')](_0x7995('0x122'),_['isNil'](_0x408692['TrunkBackup'])?_0x408692[_0x7995('0x50')]['name']:_0x408692[_0x7995('0x99')][_0x7995('0x28')],_[_0x7995('0x6a')](_0x408692[_0x7995('0x38')])?'':_0x408692[_0x7995('0x38')]['trim']()||'',_0x408692['dialCutDigit']>0x0?_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')][_0x7995('0x121')](_0x408692[_0x7995('0x11f')]):_0x394a9f[_0x7995('0xf6')][_0x7995('0x120')]);var _0x278cb3=_0x45f389[_0x7995('0x98')](_0x408692[_0x7995('0x50')])?ut[_0x7995('0x123')](_0x408692['Trunk'][_0x7995('0x51')],_0x408692[_0x7995('0x36')],_0x408692[_0x7995('0x124')]>0x0?ut[_0x7995('0x125')](_0x408692['dialOriginateCallerIdNumber'],_0x408692['dialRandomLastDigitCallerIdNumber']):_0x408692['dialOriginateCallerIdNumber']):ut['getCallerId'](_['isNil'](_0x408692[_0x7995('0x99')])?_0x408692['Trunk']['callerid']:_0x408692[_0x7995('0x99')][_0x7995('0x51')],_0x408692[_0x7995('0x36')],_0x408692['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x7995('0x125')](_0x408692['dialOriginateCallerIdNumber'],_0x408692[_0x7995('0x124')]):_0x408692[_0x7995('0x126')]);if(_0x278cb3){_0x3661ab[_0x7995('0x127')]=ut['extractCalleridName'](_0x278cb3);_0x3661ab[_0x7995('0x128')]=ut[_0x7995('0x129')](_0x278cb3);}var _0x1b5b5b=ut['addVariables'](_0x408692,_0x394a9f,_0x5cb30e,_0x278cb3,_0x405711,_0x3661ab);_[_0x7995('0x12a')](_0x3661ab,ut[_0x7995('0x12b')](_0x1b5b5b));_0x3661ab[_0x7995('0x89')]=moment()[_0x7995('0x54')](_0x7995('0x8a'));ami['Action'](ut[_0x7995('0x12c')](_0x3661ab,_0x408692,_0x1b5b5b,_0x3661ab[_0x7995('0xaa')],_0xbfb30))[_0x7995('0x84')](function(_0x484b6c){_0x408692[_0x7995('0x4c')]+=0x1;logger[_0x7995('0x56')](_0x7995('0x12d'),_0x405711,_0x7995('0xae'),_0x408692[_0x7995('0x28')],'originated:\x20',_0x408692[_0x7995('0x4c')]);_0x44d6a8(_0x484b6c);})[_0x7995('0x87')](function(_0x134724){ut[_0x7995('0xed')](_0x3661ab,0xe,_0x7995('0x12e'));rpcDb[_0x7995('0xef')](_0x3661ab,_0x7995('0x12f'));_0x7d14e2(_0x134724);});});};Preview['prototype']['syncNewExten']=function(_0x37e0b8){if(this[_0x7995('0x17')][_0x37e0b8['linkedid']]){this['actions'][_0x37e0b8[_0x7995('0xe2')]][_0x7995('0x130')]=_0x37e0b8[_0x7995('0x130')];}};Preview[_0x7995('0x10')][_0x7995('0x19')]=function(_0x24a68c){var _0x39a023=this;var _0x4dca11=this[_0x7995('0x17')][_0x24a68c[_0x7995('0x131')]];if(_0x4dca11){if(_0x4dca11[_0x7995('0xf8')]&&this[_0x7995('0x18')][_0x4dca11[_0x7995('0xf8')]]){ut[_0x7995('0x132')](_0x4dca11,this['agents'][_0x4dca11[_0x7995('0xf8')]][_0x7995('0x28')],this[_0x7995('0x18')][_0x4dca11[_0x7995('0xf8')]]['id']);}var _0x13c918=_[_0x7995('0x133')](_0x4dca11);_0x13c918[_0x7995('0x134')]=moment()['format'](_0x7995('0x8a'));var _0x202102=_0x39a023[_0x7995('0x14')][_0x4dca11[_0x7995('0x6d')]];if(ut['isFailure'](_0x24a68c[_0x7995('0x135')])){if(_0x4dca11['unlockAgent']){rpcDb[_0x7995('0x10a')](_0x4dca11[_0x7995('0x136')]);}if(_0x4dca11['activeContact']){rpcDb['disableContact'](_0x4dca11['idContact']);}ami[_0x7995('0x25')](_0x7995('0x137'),ut[_0x7995('0x9f')](_0x4dca11,_0x7995('0x138'),this[_0x7995('0x14')][_0x4dca11[_0x7995('0x6d')]]));this[_0x7995('0xe9')](_0x13c918,_0x202102,_0x24a68c);}else{_0x4dca11[_0x7995('0x89')]=moment()[_0x7995('0x54')](_0x7995('0x8a'));ut[_0x7995('0xed')](_0x13c918,0x4,_0x7995('0xb9'));rpcDb['createAgentHistory'](_0x13c918,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x7995('0x10')]['syncHangup']=function(_0x58a2e8){var _0x1a786e=this;var _0x363250=this[_0x7995('0x17')][_0x58a2e8[_0x7995('0xe2')]];var _0x2b5475;if(_0x363250){_0x2b5475=this[_0x7995('0x14')][_0x363250[_0x7995('0x6d')]];logger[_0x7995('0x56')](_0x7995('0x139'),_0x58a2e8[_0x7995('0xe2')],_0x7995('0xae'),_0x2b5475[_0x7995('0x28')],'pTalking:\x20',_0x2b5475[_0x7995('0x2c')]);}if(this[_0x7995('0x17')][_0x58a2e8[_0x7995('0xe2')]]&&_0x58a2e8[_0x7995('0xe2')]!==_0x58a2e8[_0x7995('0xbe')]){if(_0x58a2e8[_0x7995('0x13a')]==='16'&&this[_0x7995('0x17')][_0x58a2e8['linkedid']][_0x7995('0x70')]){this[_0x7995('0x13b')](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')]);}else if(this[_0x7995('0x17')][_0x58a2e8['linkedid']][_0x7995('0x70')]){logger['info'](_0x7995('0x13c'),_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')],'\x20Queue',_0x2b5475[_0x7995('0x28')],_0x7995('0x6f'),_0x2b5475[_0x7995('0x2c')]);this[_0x7995('0x13b')](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')]);}}else if(_0x363250&&_[_0x7995('0x6a')](_0x363250['statedesc'])&&_0x2b5475['dialQueueProject']&&_0x58a2e8[_0x7995('0xe2')]===_0x58a2e8[_0x7995('0xbe')]&&_[_0x7995('0x6a')](_0x58a2e8[_0x7995('0xec')])&&_0x58a2e8[_0x7995('0x13a')]==='16'&&_0x58a2e8[_0x7995('0x13d')]==='6'&&_['isUndefined'](_0x363250[_0x7995('0x13e')])){if(_0x363250[_0x7995('0xa9')]){rpcDb[_0x7995('0x10a')](_0x363250[_0x7995('0x136')]);}if(_0x363250['activeContact']){rpcDb['disableContact'](_0x363250[_0x7995('0x136')]);}_0x58a2e8[_0x7995('0xec')]='22';this['callProgressDetectingAgent'](_0x363250,_0x2b5475,_0x58a2e8);}else if(_0x363250&&_0x363250[_0x7995('0x13e')]){if(_0x58a2e8[_0x7995('0x13a')]==='16'&&this['actions'][_0x58a2e8[_0x7995('0xe2')]][_0x7995('0x70')]){logger[_0x7995('0x56')](_0x7995('0x13f'),_0x58a2e8[_0x7995('0xe2')],_0x58a2e8['cause'],'\x20Queue',_0x2b5475[_0x7995('0x28')],_0x7995('0x6f'),_0x2b5475[_0x7995('0x2c')]);this[_0x7995('0x13b')](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8['cause']);}else if(this[_0x7995('0x17')][_0x58a2e8[_0x7995('0xe2')]][_0x7995('0x70')]){logger[_0x7995('0x56')](_0x7995('0x13c'),_0x58a2e8['linkedid'],_0x58a2e8['cause'],'\x20Queue',_0x2b5475['name'],_0x7995('0x6f'),_0x2b5475[_0x7995('0x2c')]);this['callProgressDetectingCustomer'](_0x58a2e8,_0x58a2e8[_0x7995('0xe2')],_0x58a2e8[_0x7995('0x13a')]);}}};Preview['prototype']['syncDialEnd']=function(_0x1f4b2f){if(this[_0x7995('0x17')][_0x1f4b2f[_0x7995('0x140')]]&&_0x1f4b2f[_0x7995('0x140')]!==_0x1f4b2f[_0x7995('0x141')]){this[_0x7995('0x13b')](_0x1f4b2f,_0x1f4b2f[_0x7995('0x140')],_0x1f4b2f['dialstatus']);}};Preview['prototype'][_0x7995('0x1e')]=function(_0xb00787){if(this[_0x7995('0x17')][_0xb00787['linkedid']]&&_0xb00787[_0x7995('0xe2')]!==_0xb00787[_0x7995('0xbe')]&&!this[_0x7995('0x17')][_0xb00787[_0x7995('0xe2')]][_0x7995('0x70')]){if(_0xb00787[_0x7995('0x13a')]==='1'){this[_0x7995('0x13b')](_0xb00787,_0xb00787[_0x7995('0xe2')],_0xb00787[_0x7995('0x13a')]);}}};Preview['prototype']['addVariable']=function(_0x1161f2,_0x4bd222,_0x2ac8ac){if(this['actions'][_0x1161f2]){if(_[_0x7995('0x6a')](this[_0x7995('0x17')][_0x1161f2][_0x7995('0x142')])){this['actions'][_0x1161f2]['variables']={};}this[_0x7995('0x17')][_0x1161f2][_0x7995('0x142')][_0x4bd222]=_0x2ac8ac;}};Preview[_0x7995('0x10')][_0x7995('0x23')]=function(_0xc6d48c){try{if(!_[_0x7995('0x6a')](_0xc6d48c)){if(ut[_0x7995('0x143')](_[_0x7995('0x144')](_0xc6d48c[_0x7995('0x145')])[0x0])){this[_0x7995('0x146')](_0xc6d48c[_0x7995('0xbe')],_['keys'](_0xc6d48c[_0x7995('0x145')])[0x0],_0xc6d48c[_0x7995('0x147')]);}}}catch(_0x1b7e44){logger[_0x7995('0x148')](_0x7995('0x149'),util['inspect'](_0x1b7e44,{'showHidden':![],'depth':null}));}};Preview[_0x7995('0x10')][_0x7995('0x14a')]=function(_0x3c3cae){if(_0x3c3cae){if(this[_0x7995('0x17')][_0x3c3cae[_0x7995('0x14b')]]){this[_0x7995('0x17')][_0x3c3cae[_0x7995('0x14b')]][_0x7995('0x13e')]=!![];}}};Preview[_0x7995('0x10')]['syncBlindTransfer']=function(_0x5405ca){if(_0x5405ca){if(this[_0x7995('0x17')][_0x5405ca[_0x7995('0x14c')]]){this[_0x7995('0x17')][_0x5405ca[_0x7995('0x14c')]][_0x7995('0x13e')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0xbd50=['checkInBlack','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','campaign\x20Name:\x20','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','response','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','filterKey','variable','keys','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment','../../../config/logger','../ami','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','enqueue','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','syncHangup','hanguprequest','syncHangupRequest','bind','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','answered','available','loggedIn','sumBillable','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','emit','voice_queue_presence:remove','pTalking','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','preview','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','pick','contactId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[action]','size','getContactRecallMe','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','catch','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','logger2','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','responsetime','answertime','dialAnswer','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','buildAcw','complete','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','countabandonedretry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','run','unlockContact','execRun','getContactPreview','recallme','validateContact','checkIsBlackList'];(function(_0x5299e,_0x42e503){var _0x1118da=function(_0x5c27d0){while(--_0x5c27d0){_0x5299e['push'](_0x5299e['shift']());}};_0x1118da(++_0x42e503);}(_0xbd50,0x196));var _0x0bd5=function(_0x3841b4,_0x468e7c){_0x3841b4=_0x3841b4-0x0;var _0x378302=_0xbd50[_0x3841b4];return _0x378302;};'use strict';var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var BPromise=require(_0x0bd5('0x2'));var uuid=require('uuid');var moment=require(_0x0bd5('0x3'));var md5=require(_0x0bd5('0x4'));var Redis=require(_0x0bd5('0x5'));var config=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('preview');var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x0bd5('0x8'));var rpcDb=require(_0x0bd5('0x9'));var Action=require(_0x0bd5('0xa'));var ut=require(_0x0bd5('0xb'));config[_0x0bd5('0xc')]=_['defaults'](config['redis'],{'host':_0x0bd5('0xd'),'port':0x18eb});var io=require(_0x0bd5('0xe'))(new Redis(config[_0x0bd5('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x0bd5('0xf')]=function(_0x2fa7d1){this['tail']=this[_0x0bd5('0x10')]?this[_0x0bd5('0x10')]['finally'](_0x2fa7d1):_0x2fa7d1();};function Preview(_0x1ce7dd){this[_0x0bd5('0x11')]=new Sequence();this[_0x0bd5('0x12')]=_0x1ce7dd['voiceQueues'];this[_0x0bd5('0x13')]=_0x1ce7dd[_0x0bd5('0x13')];this[_0x0bd5('0x14')]={};this[_0x0bd5('0x15')]=_0x1ce7dd[_0x0bd5('0x15')];this[_0x0bd5('0x16')]=0x0;ami['on'](_0x0bd5('0x17'),this[_0x0bd5('0x18')]['bind'](this));ami['on'](_0x0bd5('0x19'),this[_0x0bd5('0x1a')]['bind'](this));ami['on'](_0x0bd5('0x1b'),this[_0x0bd5('0x1c')][_0x0bd5('0x1d')](this));ami['on'](_0x0bd5('0x1e'),this['syncDialEnd'][_0x0bd5('0x1d')](this));ami['on'](_0x0bd5('0x1f'),this[_0x0bd5('0x20')][_0x0bd5('0x1d')](this));ami['on'](_0x0bd5('0x21'),this[_0x0bd5('0x22')][_0x0bd5('0x1d')](this));ami['on'](_0x0bd5('0x23'),this[_0x0bd5('0x24')][_0x0bd5('0x1d')](this));ami['on'](_0x0bd5('0x25'),this[_0x0bd5('0x26')][_0x0bd5('0x1d')](this));this[_0x0bd5('0x27')](this['campaignsPreview']);}function emit(_0x5ba943,_0x596b6a,_0x4ed64e){io['to'](_0x5ba943)['emit'](_0x596b6a,_0x4ed64e);}function emitCampaignPreview(_0x6c06bd){if(_0x6c06bd[_0x0bd5('0x28')]===_0x0bd5('0x29')){var _0x4a6910={'id':_0x6c06bd['id'],'name':_0x6c06bd[_0x0bd5('0x2a')],'strategy':_0x6c06bd['strategy'],'answered':_0x6c06bd[_0x0bd5('0x2b')],'available':_0x6c06bd[_0x0bd5('0x2c')],'loggedIn':_0x6c06bd[_0x0bd5('0x2d')],'pTalking':_0x6c06bd['pTalking'],'sumBillable':_0x6c06bd[_0x0bd5('0x2e')],'sumDuration':_0x6c06bd['sumDuration'],'sumHoldTime':_0x6c06bd['sumHoldTime']||0x0,'talking':_0x6c06bd[_0x0bd5('0x2f')],'total':_0x6c06bd[_0x0bd5('0x30')],'type':_0x6c06bd[_0x0bd5('0x28')],'unmanaged':_0x6c06bd['unmanaged'],'abandoned':_0x6c06bd[_0x0bd5('0x31')],'waiting':_0x6c06bd['waiting'],'loggedInDb':_0x6c06bd[_0x0bd5('0x32')],'dialActive':_0x6c06bd[_0x0bd5('0x33')],'dialMethod':_0x6c06bd[_0x0bd5('0x34')],'dialOriginateCallerIdName':_0x6c06bd[_0x0bd5('0x35')],'dialOriginateCallerIdNumber':_0x6c06bd[_0x0bd5('0x36')],'dialOriginateTimeout':_0x6c06bd[_0x0bd5('0x37')],'dialPrefix':_0x6c06bd[_0x0bd5('0x38')],'outboundAnswerAgiCallsDay':_0x6c06bd[_0x0bd5('0x39')],'outboundAnswerCallsDay':_0x6c06bd[_0x0bd5('0x3a')],'outboundBlacklistCallsDay':_0x6c06bd[_0x0bd5('0x3b')],'outboundBusyCallsDay':_0x6c06bd[_0x0bd5('0x3c')],'outboundCongestionCallsDay':_0x6c06bd[_0x0bd5('0x3d')],'outboundDropCallsDayACS':_0x6c06bd[_0x0bd5('0x3e')],'outboundDropCallsDayCallersExit':_0x6c06bd[_0x0bd5('0x3f')],'outboundDropCallsDayTimeout':_0x6c06bd['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x6c06bd[_0x0bd5('0x40')],'outboundNoSuchCallsDay':_0x6c06bd[_0x0bd5('0x41')],'outboundOriginateFailureCallsDay':_0x6c06bd['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x6c06bd[_0x0bd5('0x42')],'outboundRejectCallsDay':_0x6c06bd[_0x0bd5('0x43')],'outboundUnknownCallsDay':_0x6c06bd['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x6c06bd[_0x0bd5('0x44')],'predictiveIntervalAnsweredCalls':_0x6c06bd[_0x0bd5('0x45')],'predictiveIntervalAvgHoldtime':_0x6c06bd[_0x0bd5('0x46')],'predictiveIntervalAvgTalktime':_0x6c06bd[_0x0bd5('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x6c06bd['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x6c06bd[_0x0bd5('0x48')],'predictiveIntervalErlangCalls':_0x6c06bd[_0x0bd5('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x6c06bd[_0x0bd5('0x4a')],'predictiveIntervalHitRate':_0x6c06bd[_0x0bd5('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x6c06bd[_0x0bd5('0x4c')],'predictiveIntervalPauses':_0x6c06bd[_0x0bd5('0x4d')],'predictiveIntervalAvailable':_0x6c06bd['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x6c06bd[_0x0bd5('0x4e')],'message':_0x6c06bd['message'],'originated':_0x6c06bd[_0x0bd5('0x4f')],'erlangCalls':_0x6c06bd[_0x0bd5('0x50')],'erlangCallToSecond':_0x6c06bd[_0x0bd5('0x51')],'erlangAbandonmentRate':_0x6c06bd[_0x0bd5('0x52')],'erlangBusyFactor':_0x6c06bd[_0x0bd5('0x53')],'startPredictive':_0x6c06bd[_0x0bd5('0x54')],'startProgressive':_0x6c06bd[_0x0bd5('0x55')]};if(_0x6c06bd[_0x0bd5('0x56')]){_0x4a6910[_0x0bd5('0x56')]={'id':_0x6c06bd[_0x0bd5('0x56')]['id'],'name':_0x6c06bd[_0x0bd5('0x56')][_0x0bd5('0x2a')],'active':_0x6c06bd[_0x0bd5('0x56')]['active'],'callerid':_0x6c06bd[_0x0bd5('0x56')][_0x0bd5('0x57')]};}if(_0x6c06bd['Interval']){_0x4a6910['Interval']={'id':_0x6c06bd[_0x0bd5('0x58')]['id'],'name':_0x6c06bd[_0x0bd5('0x58')][_0x0bd5('0x2a')]};}var _0x3155c5=md5(JSON[_0x0bd5('0x59')](_0x4a6910));if(_0x6c06bd[_0x0bd5('0x4')]!==_0x3155c5){_0x6c06bd[_0x0bd5('0x4')]=_0x3155c5;emit(util[_0x0bd5('0x5a')](_0x0bd5('0x5b'),_0x4a6910[_0x0bd5('0x2a')]),_0x0bd5('0x5c'),_0x4a6910);}}}function emitVoiceQueueChannelRemove(_0x3c6aa5){logger[_0x0bd5('0x5d')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x0bd5('0x59')](_0x3c6aa5));emit(util['format'](_0x0bd5('0x5b'),_0x3c6aa5[_0x0bd5('0x2a')]),_0x0bd5('0x5e'),_0x3c6aa5);io[_0x0bd5('0x5f')](_0x0bd5('0x60'),_0x3c6aa5);}function notSendMessagesQueue(_0x18e408){if(_0x18e408['sendMessageOneNotActive']){if(_0x18e408[_0x0bd5('0x4f')]===0x0&&_0x18e408[_0x0bd5('0x61')]===0x0){_0x18e408[_0x0bd5('0x62')]=![];_0x18e408[_0x0bd5('0x2c')]=0x0;_0x18e408[_0x0bd5('0x63')]=0x0;_0x18e408[_0x0bd5('0x64')]=_0x0bd5('0x65');ut[_0x0bd5('0x66')](_0x0bd5('0x67'),_0x18e408['name']+_0x0bd5('0x68'));}else{_0x18e408['message']=_0x0bd5('0x69');ut[_0x0bd5('0x66')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x18e408[_0x0bd5('0x2a')]+_0x0bd5('0x6a'));}emitCampaignPreview(_0x18e408);}}Preview[_0x0bd5('0x6b')][_0x0bd5('0x27')]=function(){var _0x1eff38=this;setInterval(function(){_0x1eff38[_0x0bd5('0x6c')]();},0x7cf);};Preview[_0x0bd5('0x6b')]['syncCampaigns']=function(){var _0x4d3ca5=this[_0x0bd5('0x12')];this['clockClearZombieChannels']+=0x1;for(var _0x5dd42b in _0x4d3ca5){if(_0x4d3ca5[_0x0bd5('0x6d')](_0x5dd42b)&&(_0x4d3ca5[_0x5dd42b][_0x0bd5('0x34')]==='preview'||_0x4d3ca5[_0x5dd42b]['dialMethod']==='booked')&&_0x4d3ca5[_0x5dd42b][_0x0bd5('0x28')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this[_0x0bd5('0x16')]=0x0;this[_0x0bd5('0x6e')]();}}if(_0x4d3ca5['hasOwnProperty'](_0x5dd42b)&&_0x4d3ca5[_0x5dd42b]['dialMethod']===_0x0bd5('0x6f')&&_0x4d3ca5[_0x5dd42b][_0x0bd5('0x28')]===_0x0bd5('0x29')){if(_0x4d3ca5[_0x5dd42b][_0x0bd5('0x33')]){this['setMessage'](_0x4d3ca5[_0x5dd42b]);if(_0x4d3ca5[_0x5dd42b][_0x0bd5('0x70')])this[_0x0bd5('0x71')](_0x4d3ca5[_0x5dd42b]);}else{notSendMessagesQueue(_0x4d3ca5[_0x5dd42b]);}}}};Preview[_0x0bd5('0x6b')][_0x0bd5('0x72')]=function(_0x1a9c33){var _0x34ce34=this;this['sequence'][_0x0bd5('0xf')](function(){if(!_[_0x0bd5('0x73')](_0x34ce34[_0x0bd5('0x14')][_0x1a9c33])){loggerAction['info'](_0x0bd5('0x74'),_0x1a9c33,_0x0bd5('0x75'),_0x34ce34[_0x0bd5('0x14')][_0x1a9c33]['queue'],_0x0bd5('0x76'),JSON[_0x0bd5('0x59')](_0x34ce34[_0x0bd5('0x12')][_0x34ce34[_0x0bd5('0x14')][_0x1a9c33][_0x0bd5('0x77')]]['originated']),_0x0bd5('0x78'),JSON[_0x0bd5('0x59')](_0x34ce34['campaignsPreview'][_0x34ce34[_0x0bd5('0x14')][_0x1a9c33][_0x0bd5('0x77')]][_0x0bd5('0x61')]),JSON[_0x0bd5('0x59')](_0x34ce34[_0x0bd5('0x14')][_0x1a9c33]['dialAnswer']),JSON[_0x0bd5('0x59')](_[_0x0bd5('0x79')](_0x34ce34['actions'][_0x1a9c33],[_0x0bd5('0x7a'),'UserId',_0x0bd5('0x7b'),_0x0bd5('0x7c')])));return ami[_0x0bd5('0x7d')]({'action':_0x0bd5('0x7e'),'channel':_0x34ce34['actions'][_0x1a9c33][_0x0bd5('0x7f')]})['catch'](function(_0x4db2ca){if(_0x4db2ca[_0x0bd5('0x64')]===_0x0bd5('0x80')){setTimeout(function(){if(_0x34ce34[_0x0bd5('0x14')][_0x1a9c33]){ut['updateOriginated'](_0x34ce34[_0x0bd5('0x12')][_0x34ce34['actions'][_0x1a9c33][_0x0bd5('0x77')]],_0x0bd5('0x81'));if(_0x34ce34[_0x0bd5('0x14')][_0x1a9c33]['dialAnswer']===!![]){ut['decrementTalkink'](_0x34ce34['campaignsPreview'][_0x34ce34[_0x0bd5('0x14')][_0x1a9c33][_0x0bd5('0x77')]],_0x0bd5('0x81'));ut['loggerError'](_0x0bd5('0x82')+_0x1a9c33,_0x34ce34[_0x0bd5('0x14')][_0x1a9c33]['queue']);}ut[_0x0bd5('0x83')]('[Dialer][checkChannel][Preview]'+_0x1a9c33,_0x34ce34['actions'][_0x1a9c33][_0x0bd5('0x77')]);delete _0x34ce34[_0x0bd5('0x14')][_0x1a9c33];}},0x2328);}});}});};Preview[_0x0bd5('0x6b')][_0x0bd5('0x6e')]=function(){var _0x5724bc=this;loggerAction[_0x0bd5('0x5d')](_0x0bd5('0x84'),_[_0x0bd5('0x85')](this['actions']));for(var _0x504e46 in this[_0x0bd5('0x14')]){if(_0x5724bc[_0x0bd5('0x14')]['hasOwnProperty'](_0x504e46)){_0x5724bc['clearZombieChannel'](_0x504e46);}}};Preview[_0x0bd5('0x6b')]['recallMe']=function(_0x3e20e9){var _0xe05093=this;rpcDb[_0x0bd5('0x86')](_0x3e20e9['id'],ut['agentReadyId'](this[_0x0bd5('0x15')]))[_0x0bd5('0x87')](function(_0x3eaea6){if(!_[_0x0bd5('0x73')](_0x3eaea6)){for(var _0x5e93fa=0x0;_0x5e93fa<_0x3eaea6[_0x0bd5('0x88')];_0x5e93fa+=0x1){if(ut[_0x0bd5('0x89')](_0x3eaea6[_0x5e93fa][_0x0bd5('0x8a')])<_0x3e20e9[_0x0bd5('0x8b')]*0x3c){if(_0x3eaea6[_0x5e93fa][_0x0bd5('0x8c')]&&!_0x3eaea6[_0x5e93fa]['Agent'][_0x0bd5('0x8d')]){_0xe05093['run'](_0x3eaea6[_0x5e93fa]['id'])[_0x0bd5('0x87')](ut['logger2']('[RecallMe]'))[_0x0bd5('0x8e')](ut['logger2'](_0x0bd5('0x8f')));}else{rpcDb[_0x0bd5('0x90')](_0x3eaea6[_0x5e93fa]['id']);}}else{var _0x6ed5=new Action(_0x3eaea6[_0x5e93fa],_0x3e20e9);_0x6ed5['starttime']=moment()[_0x0bd5('0x5a')](_0x0bd5('0x91'));_0x3e20e9['outboundReCallsDay']+=0x1;ut[_0x0bd5('0x92')](_0x6ed5,0x17,_0x0bd5('0x93'));if(_0x3e20e9['dialRecallInQueue']){rpcDb[_0x0bd5('0x94')](ut['createBody'](_0x3eaea6[_0x5e93fa]));rpcDb[_0x0bd5('0x95')](_0x6ed5,_0x0bd5('0x96'));}else{ut[_0x0bd5('0x92')](_0x6ed5,0x16,_0x0bd5('0x97'));rpcDb[_0x0bd5('0x95')](_0x6ed5,_0x0bd5('0x98'));rpcDb[_0x0bd5('0x99')](_0x6ed5,'[HistoryRecallClose]');}}}}})[_0x0bd5('0x8e')](ut[_0x0bd5('0x9a')](_0x0bd5('0x9b')));};Preview['prototype']['setMessage']=function(_0x1d2ece){_0x1d2ece[_0x0bd5('0x62')]=!![];if(ut[_0x0bd5('0x9c')](_0x1d2ece[_0x0bd5('0x2d')])){_0x1d2ece[_0x0bd5('0x64')]=_0x0bd5('0x9d');}else if(!ut[_0x0bd5('0x9e')](_0x1d2ece[_0x0bd5('0x33')])){_0x1d2ece[_0x0bd5('0x64')]=_0x0bd5('0x65');}else if(!this[_0x0bd5('0x9f')](_0x1d2ece[_0x0bd5('0x56')])){if(!this[_0x0bd5('0x9f')](_0x1d2ece[_0x0bd5('0xa0')])){_0x1d2ece[_0x0bd5('0x64')]=_0x0bd5('0xa1');}else{_0x1d2ece[_0x0bd5('0x64')]=_0x0bd5('0xa2');}}else{_0x1d2ece['message']=_0x0bd5('0xa2');}emitCampaignPreview(_0x1d2ece);};Preview[_0x0bd5('0x6b')]['callProgressDetectingCustomer']=function(_0x7cc5b0,_0x51b486,_0x2b43db){var _0xd80562=this;var _0x4f7170=this[_0x0bd5('0x14')][_0x51b486];var _0x309aeb=this[_0x0bd5('0x12')][_0x4f7170[_0x0bd5('0x77')]];var _0xe920d1;if(_0x309aeb){switch(_0x2b43db){case'1':_0x309aeb[_0x0bd5('0x41')]+=0x1;_0x4f7170[_0x0bd5('0xa3')]+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut[_0x0bd5('0xa5')](_0x4f7170);ut['logCustomer'](_0x4f7170,0x0,_0x0bd5('0xa6'));ami[_0x0bd5('0x5f')]('custom:agentnosuchnumber',ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xa8')));rpcDb['createCustomerHistory'](_0x4f7170,_0x0bd5('0xa9'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb['dialGlobalMaxRetry']){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,'Global');rpcDb[_0x0bd5('0x99')](_0xe920d1,_0x0bd5('0xab'));}else{if(_0x4f7170[_0x0bd5('0xa3')]>=_0x309aeb[_0x0bd5('0xac')]){rpcDb[_0x0bd5('0x99')](_0x4f7170,_0x0bd5('0xab'));}else{rpcDb[_0x0bd5('0xad')](ut[_0x0bd5('0xae')](_0x4f7170,_0x0bd5('0xa3'),_0x309aeb[_0x0bd5('0xaf')]),_0x4f7170[_0x0bd5('0xb0')],_0x4f7170[_0x0bd5('0xb1')]);}}delete this[_0x0bd5('0x14')][_0x7cc5b0[_0x0bd5('0xb2')]];break;case'ANSWER':var _0x2707f7=moment()[_0x0bd5('0x5a')](_0x0bd5('0x91'));_0x4f7170[_0x0bd5('0xb3')]=_0x2707f7;_0x4f7170[_0x0bd5('0xb4')]=_0x2707f7;_0x4f7170[_0x0bd5('0xb5')]=!![];_0x309aeb['pTalking']+=0x1;logger[_0x0bd5('0x5d')](_0x0bd5('0xb6'),_0x4f7170[_0x0bd5('0xb7')],_0x0bd5('0xb8'),_0x309aeb[_0x0bd5('0x2a')],_0x0bd5('0x78'),_0x309aeb[_0x0bd5('0x61')]);ami['emit']('custom:agentconnect',ut['buildObj'](_0x4f7170,_0x0bd5('0xb9'),this[_0x0bd5('0x12')][_0x4f7170[_0x0bd5('0x77')]]));if(_0x309aeb[_0x0bd5('0xba')]){ami[_0x0bd5('0x5f')]('custom:agentConnectPreview',ut[_0x0bd5('0xbb')](_0x4f7170));}break;case'16':ami[_0x0bd5('0x5f')]('custom:agentcomplete',ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xbc'),this[_0x0bd5('0x12')][_0x4f7170[_0x0bd5('0x77')]]));emitVoiceQueueChannelRemove(ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xbc')));_0x309aeb[_0x0bd5('0x3a')]+=0x1;_0x309aeb[_0x0bd5('0x30')]+=0x1;_0x309aeb[_0x0bd5('0x2b')]+=0x1;ut[_0x0bd5('0xbd')](_0x309aeb,_0x0bd5('0xbe'));_0x4f7170['countglobal']=ut[_0x0bd5('0xa5')](_0x4f7170);ut[_0x0bd5('0x92')](_0x4f7170,0x4,_0x0bd5('0xbf'));rpcDb[_0x0bd5('0x95')](_0x4f7170,_0x0bd5('0xc0'));rpcDb['createCustomerFinal'](_0x4f7170,_0x0bd5('0xc1'));rpcDb[_0x0bd5('0xc2')](_0x4f7170);_0x309aeb[_0x0bd5('0xc3')]+=_0x4f7170[_0x0bd5('0xc4')];_0x309aeb[_0x0bd5('0x2e')]+=_0x4f7170[_0x0bd5('0xc4')];logger[_0x0bd5('0x5d')](_0x0bd5('0xc5'),_0x4f7170[_0x0bd5('0xb7')],_0x0bd5('0xb8'),_0x309aeb[_0x0bd5('0x2a')],_0x0bd5('0x78'),_0x309aeb[_0x0bd5('0x61')]);delete this[_0x0bd5('0x14')][_0x7cc5b0[_0x0bd5('0xb2')]];break;case _0x0bd5('0xc6'):_0x309aeb[_0x0bd5('0x3c')]+=0x1;_0x4f7170[_0x0bd5('0xc7')]+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut['totalGlobal'](_0x4f7170);ut['logCustomer'](_0x4f7170,0x5,_0x0bd5('0xc8'));ami[_0x0bd5('0x5f')](_0x0bd5('0xc9'),ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xca')));rpcDb['createCustomerHistory'](_0x4f7170,_0x0bd5('0xcb'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb[_0x0bd5('0xcc')]){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,_0x0bd5('0xcd'));rpcDb['createCustomerFinal'](_0xe920d1,_0x0bd5('0xce'));}else{if(_0x4f7170[_0x0bd5('0xc7')]>=_0x309aeb[_0x0bd5('0xcf')]){rpcDb[_0x0bd5('0x99')](_0x4f7170,_0x0bd5('0xcb'));}else{rpcDb[_0x0bd5('0xad')](ut[_0x0bd5('0xae')](_0x4f7170,_0x0bd5('0xc7'),_0x309aeb[_0x0bd5('0xd0')]),_0x4f7170[_0x0bd5('0xb0')],_0x4f7170[_0x0bd5('0xb1')]);}}break;case'NOANSWER':_0x309aeb[_0x0bd5('0x40')]+=0x1;_0x4f7170[_0x0bd5('0xd1')]+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut[_0x0bd5('0xa5')](_0x4f7170);ut[_0x0bd5('0x92')](_0x4f7170,0x3,_0x0bd5('0xd2'));ami[_0x0bd5('0x5f')](_0x0bd5('0xd3'),ut['buildObj'](_0x4f7170,_0x0bd5('0xd4')));rpcDb[_0x0bd5('0x95')](_0x4f7170,_0x0bd5('0xd5'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb[_0x0bd5('0xcc')]){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,_0x0bd5('0xcd'));rpcDb[_0x0bd5('0x99')](_0xe920d1,_0x0bd5('0xd6'));}else{if(_0x4f7170[_0x0bd5('0xd1')]>=_0x309aeb[_0x0bd5('0xd7')]){rpcDb[_0x0bd5('0x99')](_0x4f7170,_0x0bd5('0xd5'));}else{rpcDb[_0x0bd5('0xad')](ut[_0x0bd5('0xae')](_0x4f7170,_0x0bd5('0xd1'),_0x309aeb['dialNoAnswerRetryFrequency']),_0x4f7170[_0x0bd5('0xb0')],_0x4f7170[_0x0bd5('0xb1')]);}}break;case _0x0bd5('0xd8'):_0x309aeb[_0x0bd5('0x3d')]+=0x1;_0x4f7170[_0x0bd5('0xd9')]+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut[_0x0bd5('0xa5')](_0x4f7170);ut[_0x0bd5('0x92')](_0x4f7170,0x8,_0x0bd5('0xda'));ami['emit'](_0x0bd5('0xdb'),ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xdc')));rpcDb['createCustomerHistory'](_0x4f7170,_0x0bd5('0xdd'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb[_0x0bd5('0xcc')]){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,_0x0bd5('0xcd'));rpcDb[_0x0bd5('0x99')](_0xe920d1,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x4f7170[_0x0bd5('0xd9')]>=_0x309aeb['dialCongestionMaxRetry']){rpcDb[_0x0bd5('0x99')](_0x4f7170,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x0bd5('0xae')](_0x4f7170,_0x0bd5('0xd9'),_0x309aeb[_0x0bd5('0xd0')]),_0x4f7170[_0x0bd5('0xb0')],_0x4f7170['activeContact']);}}break;case _0x0bd5('0xde'):_0x309aeb[_0x0bd5('0x43')]+=0x1;_0x4f7170['countagentrejectretry']+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut[_0x0bd5('0xa5')](_0x4f7170);ut[_0x0bd5('0x92')](_0x4f7170,0x14,_0x0bd5('0xdf'));ami[_0x0bd5('0x5f')](_0x0bd5('0xe0'),ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xe1')));rpcDb[_0x0bd5('0x95')](_0x4f7170,_0x0bd5('0xe2'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb[_0x0bd5('0xcc')]){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0x14,_0x0bd5('0xdf'));rpcDb[_0x0bd5('0x99')](_0xe920d1,_0x0bd5('0xe3'));}else{if(_0x4f7170[_0x0bd5('0xe4')]>=_0x309aeb[_0x0bd5('0xe5')]){rpcDb[_0x0bd5('0x99')](_0x4f7170,_0x0bd5('0xe3'));}else{rpcDb[_0x0bd5('0xad')](ut[_0x0bd5('0xae')](_0x4f7170,_0x0bd5('0xe4'),_0x309aeb[_0x0bd5('0xe6')]),_0x4f7170[_0x0bd5('0xb0')],_0x4f7170[_0x0bd5('0xb1')]);}}break;case'ABANDONED':_0x309aeb[_0x0bd5('0x44')]+=0x1;_0x4f7170['countabandonedretry']+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut[_0x0bd5('0xa5')](_0x4f7170);ut[_0x0bd5('0x92')](_0x4f7170,0xb,_0x0bd5('0xe7'));rpcDb[_0x0bd5('0x95')](_0x4f7170,_0x0bd5('0xe8'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb[_0x0bd5('0xcc')]){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,'Global');rpcDb['createCustomerFinal'](_0xe920d1,_0x0bd5('0xe8'));}else{if(_0x4f7170[_0x0bd5('0xe9')]>=_0x309aeb['dialAbandonedMaxRety']){rpcDb[_0x0bd5('0x99')](_0x4f7170,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x0bd5('0xad')](ut[_0x0bd5('0xae')](_0x4f7170,_0x0bd5('0xea'),_0x309aeb[_0x0bd5('0xeb')]),_0x4f7170['unlockAgent'],_0x4f7170[_0x0bd5('0xb1')]);}}break;case'18':_0x309aeb[_0x0bd5('0xec')]+=0x1;_0x4f7170[_0x0bd5('0xed')]+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut['totalGlobal'](_0x4f7170);ut[_0x0bd5('0x92')](_0x4f7170,0x12,_0x7cc5b0[_0x0bd5('0xee')]||_0x7cc5b0[_0x0bd5('0xef')]);ami[_0x0bd5('0x5f')](_0x0bd5('0xf0'),ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xf1')));rpcDb[_0x0bd5('0x95')](_0x4f7170,_0x0bd5('0xf2'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb[_0x0bd5('0xcc')]){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,'Global');rpcDb[_0x0bd5('0x99')](_0xe920d1,_0x0bd5('0xf2'));}else{rpcDb[_0x0bd5('0x99')](_0x4f7170,_0x0bd5('0xf2'));}delete this[_0x0bd5('0x14')][_0x7cc5b0[_0x0bd5('0xb2')]];break;case'19':_0x309aeb[_0x0bd5('0xec')]+=0x1;_0x4f7170[_0x0bd5('0xa4')]=ut[_0x0bd5('0xa5')](_0x4f7170);ut[_0x0bd5('0x92')](_0x4f7170,0x13,_0x7cc5b0[_0x0bd5('0xee')]||_0x7cc5b0['dialstatus']);ami[_0x0bd5('0x5f')]('custom:amd',ut[_0x0bd5('0xa7')](_0x4f7170,_0x0bd5('0xf1')));rpcDb[_0x0bd5('0x95')](_0x4f7170,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x4f7170)>=_0x309aeb['dialGlobalMaxRetry']){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,_0x0bd5('0xcd'));rpcDb[_0x0bd5('0x99')](_0xe920d1,_0x0bd5('0xf3'));}else{rpcDb[_0x0bd5('0x99')](_0x4f7170,_0x0bd5('0xf3'));}delete this[_0x0bd5('0x14')][_0x7cc5b0[_0x0bd5('0xb2')]];break;default:if(_0x4f7170[_0x0bd5('0xb5')]){ut[_0x0bd5('0xbd')](_0x309aeb,_0x0bd5('0xf4'));ut['loggerError'](_0x0bd5('0xf5')+_0x309aeb[_0x0bd5('0x2a')],_0x7cc5b0);}_0x309aeb['outboundUnknownCallsDay']+=0x1;_0x4f7170['countglobal']=ut[_0x0bd5('0xa5')](_0x4f7170);ut['logCustomer'](_0x4f7170,0xc,_0x7cc5b0['cause-txt']||_0x7cc5b0[_0x0bd5('0xef')]);rpcDb[_0x0bd5('0x95')](_0x4f7170,_0x0bd5('0xf6'));if(ut[_0x0bd5('0xa5')](_0x4f7170)>=_0x309aeb[_0x0bd5('0xcc')]){_0xe920d1=ut[_0x0bd5('0xaa')](_0x4f7170,0xf,_0x0bd5('0xcd'));rpcDb[_0x0bd5('0x99')](_0xe920d1,_0x0bd5('0xf7'));}else{rpcDb[_0x0bd5('0x99')](_0x4f7170,_0x0bd5('0xf7'));}delete this['actions'][_0x7cc5b0[_0x0bd5('0xb2')]];}if(!(_0x4f7170[_0x0bd5('0xb5')]&&_0x2b43db==='16')){ut[_0x0bd5('0xf8')](_0x309aeb,_0x0bd5('0xf9'));logger[_0x0bd5('0x5d')](_0x0bd5('0xfa'),_0x4f7170[_0x0bd5('0xb7')],_0x0bd5('0xb8'),_0x309aeb[_0x0bd5('0x2a')],_0x0bd5('0x76'),_0x309aeb[_0x0bd5('0x4f')]);}if(_0x2b43db!==_0x0bd5('0xfb')){delete this['actions'][_0x7cc5b0[_0x0bd5('0xb2')]];delete this['actions'][_0x7cc5b0[_0x0bd5('0xfc')]];}}};Preview['prototype'][_0x0bd5('0xfd')]=function(_0x3dfcd3,_0x3149a7,_0x20db9e){if(_[_0x0bd5('0xfe')](_0x3149a7)&&_0x0bd5('0xff')!==typeof _0x3149a7){return;}if(_[_0x0bd5('0xfe')](_0x20db9e)&&_0x0bd5('0xff')!==typeof _0x20db9e){return;}switch(_0x20db9e[_0x0bd5('0x100')]){case'0':ut[_0x0bd5('0x101')](_0x3dfcd3,0x0,'NoSuchNumber');rpcDb[_0x0bd5('0x102')](_0x3dfcd3,_0x0bd5('0x103'));break;case'3':ut[_0x0bd5('0x101')](_0x3dfcd3,0x3,_0x0bd5('0xd2'));rpcDb[_0x0bd5('0x102')](_0x3dfcd3,_0x0bd5('0x104'));break;case'5':ut[_0x0bd5('0x101')](_0x3dfcd3,0x5,_0x0bd5('0xc8'));rpcDb[_0x0bd5('0x102')](_0x3dfcd3,_0x0bd5('0x105'));break;case'8':ut[_0x0bd5('0x101')](_0x3dfcd3,0x8,_0x0bd5('0xda'));rpcDb[_0x0bd5('0x102')](_0x3dfcd3,_0x0bd5('0x106'));break;case'22':ut[_0x0bd5('0x101')](_0x3dfcd3,0x16,_0x0bd5('0x107'));rpcDb[_0x0bd5('0x102')](_0x3dfcd3,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x3dfcd3,0xc,_0x20db9e[_0x0bd5('0x100')]);rpcDb[_0x0bd5('0x102')](_0x3dfcd3,_0x0bd5('0x106'));}ut['updateOriginated'](_0x3149a7,_0x0bd5('0x108'));logger[_0x0bd5('0x5d')](_0x0bd5('0x109'),_0x3dfcd3['uniqueid'],_0x0bd5('0xb8'),_0x3149a7[_0x0bd5('0x2a')],_0x0bd5('0x76'),_0x3149a7[_0x0bd5('0x4f')]);delete this[_0x0bd5('0x14')][_0x3dfcd3['uniqueid']];};Preview[_0x0bd5('0x6b')]['checkInBlack']=function(_0x44d41f,_0x582427,_0x39a94f,_0x382e58,_0x2063f0){var _0x11f52c=this;return new BPromise(function(_0x361783,_0x486472){if(_[_0x0bd5('0x73')](_0x582427)||_['isNil'](_0x582427[_0x0bd5('0x10a')])||_['isNil'](_0x582427['Contact'][_0x0bd5('0x10b')])||_[_0x0bd5('0x73')](_0x582427[_0x0bd5('0x7b')])){_0x486472(ut[_0x0bd5('0x64')]('Contact\x20is\x20undefined',_0x382e58,_0x2063f0));return;}var _0xf0dfb4=uuid['v4']();var _0xfa2a90=_0x11f52c[_0x0bd5('0x12')][_0x582427[_0x0bd5('0x75')]['name']];var _0x266097=_0x39a94f?_0x11f52c[_0x0bd5('0x15')][_0x39a94f]['id']:undefined;_0x11f52c[_0x0bd5('0x14')][_0xf0dfb4]=new Action(_0x582427,_0xfa2a90,_0xf0dfb4,_0x39a94f,_0x266097);var _0x2f5d4a=_0x11f52c[_0x0bd5('0x14')][_0xf0dfb4];_0x2f5d4a[_0x0bd5('0xb0')]=_0x382e58;_0x2f5d4a[_0x0bd5('0xb1')]=_0x2063f0;_0x2f5d4a[_0x0bd5('0x10c')]=_0x39a94f;if(_[_0x0bd5('0x10d')](_0x44d41f)){_0x11f52c[_0x0bd5('0x10e')](_0x2f5d4a,_0xfa2a90,_0x582427,_0x39a94f)['then'](function(_0x3dc03a){logger['info'](_0x0bd5('0x10f'),_0x0bd5('0x110')+_0x2f5d4a[_0x0bd5('0x77')]+_0x0bd5('0x111')+_0x2f5d4a[_0x0bd5('0x112')],JSON[_0x0bd5('0x59')](_0x3dc03a));ami[_0x0bd5('0x5f')]('custom:agentcalled',ut['buildObj'](_0x2f5d4a,_0x0bd5('0x113'),_0x11f52c[_0x0bd5('0x12')][_0x2f5d4a[_0x0bd5('0x77')]]));_0x361783(ut['message'](_0x0bd5('0x114')));})[_0x0bd5('0x8e')](function(_0x31e0bf){ut[_0x0bd5('0x66')](_0x0bd5('0x115'),_0x31e0bf);_0x486472(ut[_0x0bd5('0x64')]('Call\x20failed',_0x382e58,_0x2063f0));});}else{_0xfa2a90['outboundBlacklistCallsDay']+=0x1;ut[_0x0bd5('0x116')](_0x2f5d4a);rpcDb['createHistory'](_0x2f5d4a,_0x0bd5('0x117'));delete _0x11f52c[_0x0bd5('0x14')][_0xf0dfb4];_0x486472(ut[_0x0bd5('0x64')](_0x0bd5('0x118'),_0x382e58,_0x2063f0));}});};Preview[_0x0bd5('0x6b')][_0x0bd5('0x9f')]=function(_0x3da9b5){return!_[_0x0bd5('0x73')](_0x3da9b5)&&!_[_0x0bd5('0x73')](_0x3da9b5[_0x0bd5('0x2a')])&&!_[_0x0bd5('0x73')](_0x3da9b5['active'])&&_0x3da9b5[_0x0bd5('0x119')]&&!_[_0x0bd5('0x73')](this[_0x0bd5('0x13')][util[_0x0bd5('0x5a')](_0x0bd5('0x11a'),_0x3da9b5[_0x0bd5('0x2a')])])&&!_[_0x0bd5('0x73')](this[_0x0bd5('0x13')][util[_0x0bd5('0x5a')](_0x0bd5('0x11a'),_0x3da9b5[_0x0bd5('0x2a')])][_0x0bd5('0x7e')])&&(this[_0x0bd5('0x13')][util[_0x0bd5('0x5a')](_0x0bd5('0x11a'),_0x3da9b5[_0x0bd5('0x2a')])][_0x0bd5('0x7e')]===_0x0bd5('0x11b')||this[_0x0bd5('0x13')][util[_0x0bd5('0x5a')](_0x0bd5('0x11a'),_0x3da9b5['name'])][_0x0bd5('0x7e')]===_0x0bd5('0x11c'));};Preview[_0x0bd5('0x6b')][_0x0bd5('0x11d')]=function(_0x4376fa,_0x449f2b){var _0x1aa82a=this;return new BPromise(function(_0x293702,_0x337810){_0x1aa82a['execRun'](_0x4376fa,_0x449f2b)[_0x0bd5('0x87')](function(_0x3337c5){_0x293702(_[_0x0bd5('0x79')](_0x3337c5,[_0x0bd5('0x64')]));})['catch'](function(_0x251ea3){if(_0x251ea3['unlock']){rpcDb[_0x0bd5('0x11e')](_0x4376fa);}if(_0x251ea3[_0x0bd5('0x119')]){rpcDb[_0x0bd5('0x90')](_0x4376fa);}_0x337810(_['pick'](_0x251ea3,[_0x0bd5('0x64')]));});});};Preview[_0x0bd5('0x6b')][_0x0bd5('0x11f')]=function(_0x1d07be,_0x12255a){var _0x28960b=this;return new BPromise(function(_0x17c137,_0x466126){var _0x23366d,_0x4db162;rpcDb[_0x0bd5('0x120')](_0x1d07be)[_0x0bd5('0x87')](function(_0x55e267){if(!_[_0x0bd5('0x73')](_0x55e267[0x0])){_0x4db162=_0x55e267[0x0][_0x0bd5('0x121')]?![]:!![];_0x23366d=_0x55e267[0x0][_0x0bd5('0x121')]?!![]:![];_0x23366d=_0x12255a?!![]:_0x23366d;}var _0x5f0753=_0x28960b[_0x0bd5('0x122')](_0x55e267);if(_0x5f0753['isValid']){rpcDb[_0x0bd5('0x123')](_['pick'](_0x55e267[0x0],['VoiceQueueId','Contact.phone']))[_0x0bd5('0x87')](function(_0x16a038){_0x28960b[_0x0bd5('0x124')](_0x16a038,_0x55e267[0x0],_0x12255a,_0x4db162,_0x23366d)[_0x0bd5('0x87')](function(_0x22185f){_0x17c137(_0x22185f);})['catch'](function(_0x394d40){_0x466126(_0x394d40);});})[_0x0bd5('0x8e')](function(_0x1e4e9d){ut[_0x0bd5('0x66')]('[Preview][checkIsBlackList]',_0x1e4e9d);_0x466126(ut['message']('Call\x20unsuccessful',_0x4db162,_0x23366d));});}else{_0x466126(ut[_0x0bd5('0x64')](_0x5f0753['message'],_0x4db162,_0x23366d));}})[_0x0bd5('0x8e')](function(_0x3e764f){ut['logger'](_0x0bd5('0x125'),_0x3e764f);_0x466126(ut[_0x0bd5('0x64')](_0x0bd5('0x126'),![],!![]));});});};Preview[_0x0bd5('0x6b')][_0x0bd5('0x122')]=function(_0x3b617f){if(_['isNil'](_0x3b617f)||_[_0x0bd5('0x10d')](_0x3b617f)||!_[_0x0bd5('0x73')](_0x3b617f[0x0][_0x0bd5('0x8c')])&&_['isNil'](_0x3b617f[0x0]['Agent'][_0x0bd5('0x2a')])){ut[_0x0bd5('0x66')](_0x0bd5('0x127'),_0x3b617f);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x7f3193=this[_0x0bd5('0x12')][_0x3b617f[0x0][_0x0bd5('0x75')]['name']];_0x7f3193[_0x0bd5('0x64')]=_0x0bd5('0xa2');if(_[_0x0bd5('0x73')](_0x7f3193)){ut[_0x0bd5('0x66')](_0x0bd5('0x128'),_0x7f3193);return{'isValid':![],'message':_0x0bd5('0x129')};}if(!this[_0x0bd5('0x9f')](_0x7f3193['Trunk'])){ut[_0x0bd5('0x66')]('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x7f3193[_0x0bd5('0x2a')]+_0x0bd5('0x12a'));if(!this[_0x0bd5('0x9f')](_0x7f3193[_0x0bd5('0xa0')])){ut[_0x0bd5('0x66')](_0x0bd5('0x12b'),_0x7f3193[_0x0bd5('0x2a')]+_0x0bd5('0x12c'));return{'isValid':![],'message':_0x0bd5('0x12d')};}}if(!ut[_0x0bd5('0x9e')](_0x7f3193[_0x0bd5('0x33')])){ut['logger'](_0x0bd5('0x12e'),_0x7f3193[_0x0bd5('0x2a')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x0bd5('0x12f')+_0x7f3193[_0x0bd5('0x2a')]+_0x0bd5('0x130')};}return{'isValid':!![],'message':_0x0bd5('0x131')};};Preview[_0x0bd5('0x6b')][_0x0bd5('0x10e')]=function(_0x5f106a,_0x2fa7c8,_0x329c00,_0x3361fb){var _0x33a031=this;return new BPromise(function(_0x492216,_0x343371){var _0x14e5d2=_0x5f106a['uniqueid'];var _0x3bc8c7=_0x33a031[_0x0bd5('0x9f')](_0x2fa7c8['Trunk'])?util[_0x0bd5('0x5a')](_0x0bd5('0x132'),_0x2fa7c8['Trunk']['name'],_[_0x0bd5('0x73')](_0x2fa7c8[_0x0bd5('0x38')])?'':_0x2fa7c8[_0x0bd5('0x38')][_0x0bd5('0x133')]()||'',_0x2fa7c8['dialCutDigit']>0x0?_0x329c00['Contact'][_0x0bd5('0x10b')][_0x0bd5('0x134')](_0x2fa7c8[_0x0bd5('0x135')]):_0x329c00[_0x0bd5('0x10a')][_0x0bd5('0x10b')]):util[_0x0bd5('0x5a')](_0x0bd5('0x132'),_['isNil'](_0x2fa7c8[_0x0bd5('0xa0')])?_0x2fa7c8['Trunk']['name']:_0x2fa7c8[_0x0bd5('0xa0')][_0x0bd5('0x2a')],_[_0x0bd5('0x73')](_0x2fa7c8[_0x0bd5('0x38')])?'':_0x2fa7c8['dialPrefix'][_0x0bd5('0x133')]()||'',_0x2fa7c8[_0x0bd5('0x135')]>0x0?_0x329c00[_0x0bd5('0x10a')][_0x0bd5('0x10b')][_0x0bd5('0x134')](_0x2fa7c8[_0x0bd5('0x135')]):_0x329c00[_0x0bd5('0x10a')][_0x0bd5('0x10b')]);var _0x290134=_0x33a031['isTrunkReachable'](_0x2fa7c8[_0x0bd5('0x56')])?ut[_0x0bd5('0x136')](_0x2fa7c8[_0x0bd5('0x56')][_0x0bd5('0x57')],_0x2fa7c8[_0x0bd5('0x35')],_0x2fa7c8[_0x0bd5('0x137')]>0x0?ut[_0x0bd5('0x138')](_0x2fa7c8[_0x0bd5('0x36')],_0x2fa7c8[_0x0bd5('0x137')]):_0x2fa7c8['dialOriginateCallerIdNumber']):ut[_0x0bd5('0x136')](_[_0x0bd5('0x73')](_0x2fa7c8[_0x0bd5('0xa0')])?_0x2fa7c8[_0x0bd5('0x56')][_0x0bd5('0x57')]:_0x2fa7c8[_0x0bd5('0xa0')][_0x0bd5('0x57')],_0x2fa7c8[_0x0bd5('0x35')],_0x2fa7c8[_0x0bd5('0x137')]>0x0?ut['getCallerIdRandom'](_0x2fa7c8[_0x0bd5('0x36')],_0x2fa7c8[_0x0bd5('0x137')]):_0x2fa7c8[_0x0bd5('0x36')]);if(_0x290134){_0x5f106a[_0x0bd5('0x139')]=ut[_0x0bd5('0x13a')](_0x290134);_0x5f106a[_0x0bd5('0x13b')]=ut['extractCalleridNumber'](_0x290134);}var _0x5ec377=ut[_0x0bd5('0x13c')](_0x2fa7c8,_0x329c00,_0x3bc8c7,_0x290134,_0x14e5d2,_0x5f106a);_[_0x0bd5('0x13d')](_0x5f106a,ut[_0x0bd5('0x13e')](_0x5ec377));_0x5f106a['starttime']=moment()[_0x0bd5('0x5a')](_0x0bd5('0x91'));ami[_0x0bd5('0x7d')](ut[_0x0bd5('0x13f')](_0x5f106a,_0x2fa7c8,_0x5ec377,_0x5f106a[_0x0bd5('0xb1')],_0x3361fb))[_0x0bd5('0x87')](function(_0x31f710){_0x2fa7c8['originated']+=0x1;logger[_0x0bd5('0x5d')](_0x0bd5('0x140'),_0x14e5d2,'\x20Queue',_0x2fa7c8[_0x0bd5('0x2a')],'originated:\x20',_0x2fa7c8[_0x0bd5('0x4f')]);_0x492216(_0x31f710);})['catch'](function(_0x4fa9de){ut[_0x0bd5('0x101')](_0x5f106a,0xe,_0x0bd5('0x141'));rpcDb[_0x0bd5('0x102')](_0x5f106a,_0x0bd5('0x142'));_0x343371(_0x4fa9de);});});};Preview[_0x0bd5('0x6b')][_0x0bd5('0x20')]=function(_0x27b20a){if(this[_0x0bd5('0x14')][_0x27b20a['linkedid']]){this[_0x0bd5('0x14')][_0x27b20a[_0x0bd5('0xb2')]][_0x0bd5('0x7f')]=_0x27b20a[_0x0bd5('0x7f')];}};Preview[_0x0bd5('0x6b')][_0x0bd5('0x18')]=function(_0x2a5795){var _0x5433d6=this;var _0x9e8ff3=this[_0x0bd5('0x14')][_0x2a5795[_0x0bd5('0x143')]];if(_0x9e8ff3){if(_0x9e8ff3[_0x0bd5('0x10c')]&&this[_0x0bd5('0x15')][_0x9e8ff3[_0x0bd5('0x10c')]]){ut['logLookAgent'](_0x9e8ff3,this[_0x0bd5('0x15')][_0x9e8ff3['lookAgent']][_0x0bd5('0x2a')],this[_0x0bd5('0x15')][_0x9e8ff3[_0x0bd5('0x10c')]]['id']);}var _0xa3aaf9=_[_0x0bd5('0x144')](_0x9e8ff3);_0xa3aaf9[_0x0bd5('0xb3')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x47607d=_0x5433d6[_0x0bd5('0x12')][_0x9e8ff3[_0x0bd5('0x77')]];if(ut[_0x0bd5('0x145')](_0x2a5795[_0x0bd5('0x146')])){if(_0x9e8ff3[_0x0bd5('0xb0')]){rpcDb['unlockContact'](_0x9e8ff3[_0x0bd5('0x112')]);}if(_0x9e8ff3[_0x0bd5('0xb1')]){rpcDb[_0x0bd5('0x90')](_0x9e8ff3['idContact']);}ami[_0x0bd5('0x5f')]('custom:agentringnoanswer',ut['buildObj'](_0x9e8ff3,_0x0bd5('0x147'),this[_0x0bd5('0x12')][_0x9e8ff3[_0x0bd5('0x77')]]));this[_0x0bd5('0xfd')](_0xa3aaf9,_0x47607d,_0x2a5795);}else{_0x9e8ff3['starttime']=moment()['format'](_0x0bd5('0x91'));ut[_0x0bd5('0x101')](_0xa3aaf9,0x4,_0x0bd5('0xbf'));rpcDb[_0x0bd5('0x102')](_0xa3aaf9,_0x0bd5('0x148'));}}};Preview[_0x0bd5('0x6b')]['syncHangup']=function(_0xd45ee4){var _0x14a7a2=this;var _0x4c2abd=this[_0x0bd5('0x14')][_0xd45ee4['linkedid']];var _0x38f0e7;if(_0x4c2abd){_0x38f0e7=this[_0x0bd5('0x12')][_0x4c2abd['queue']];logger[_0x0bd5('0x5d')](_0x0bd5('0x149'),_0xd45ee4[_0x0bd5('0xb2')],_0x0bd5('0xb8'),_0x38f0e7[_0x0bd5('0x2a')],'pTalking:\x20',_0x38f0e7[_0x0bd5('0x61')]);}if(this[_0x0bd5('0x14')][_0xd45ee4['linkedid']]&&_0xd45ee4['linkedid']!==_0xd45ee4[_0x0bd5('0xb7')]){if(_0xd45ee4[_0x0bd5('0x14a')]==='16'&&this[_0x0bd5('0x14')][_0xd45ee4[_0x0bd5('0xb2')]][_0x0bd5('0xb5')]){this[_0x0bd5('0x14b')](_0xd45ee4,_0xd45ee4[_0x0bd5('0xb2')],_0xd45ee4['cause']);}else if(this[_0x0bd5('0x14')][_0xd45ee4[_0x0bd5('0xb2')]][_0x0bd5('0xb5')]){logger[_0x0bd5('0x5d')](_0x0bd5('0x14c'),_0xd45ee4[_0x0bd5('0xb2')],_0xd45ee4[_0x0bd5('0x14a')],_0x0bd5('0xb8'),_0x38f0e7[_0x0bd5('0x2a')],_0x0bd5('0x78'),_0x38f0e7[_0x0bd5('0x61')]);this['callProgressDetectingCustomer'](_0xd45ee4,_0xd45ee4[_0x0bd5('0xb2')],_0xd45ee4[_0x0bd5('0x14a')]);}}else if(_0x4c2abd&&_[_0x0bd5('0x73')](_0x4c2abd['statedesc'])&&_0x38f0e7[_0x0bd5('0x14d')]&&_0xd45ee4[_0x0bd5('0xb2')]===_0xd45ee4['uniqueid']&&_[_0x0bd5('0x73')](_0xd45ee4[_0x0bd5('0x100')])&&_0xd45ee4[_0x0bd5('0x14a')]==='16'&&_0xd45ee4[_0x0bd5('0x14e')]==='6'&&_[_0x0bd5('0xfe')](_0x4c2abd[_0x0bd5('0x14f')])){if(_0x4c2abd[_0x0bd5('0xb0')]){rpcDb[_0x0bd5('0x11e')](_0x4c2abd[_0x0bd5('0x112')]);}if(_0x4c2abd[_0x0bd5('0xb1')]){rpcDb[_0x0bd5('0x90')](_0x4c2abd[_0x0bd5('0x112')]);}_0xd45ee4[_0x0bd5('0x100')]='22';this['callProgressDetectingAgent'](_0x4c2abd,_0x38f0e7,_0xd45ee4);}else if(_0x4c2abd&&_0x4c2abd[_0x0bd5('0x14f')]){if(_0xd45ee4[_0x0bd5('0x14a')]==='16'&&this[_0x0bd5('0x14')][_0xd45ee4[_0x0bd5('0xb2')]][_0x0bd5('0xb5')]){logger[_0x0bd5('0x5d')](_0x0bd5('0x150'),_0xd45ee4[_0x0bd5('0xb2')],_0xd45ee4[_0x0bd5('0x14a')],_0x0bd5('0xb8'),_0x38f0e7[_0x0bd5('0x2a')],'pTalking:\x20',_0x38f0e7['pTalking']);this[_0x0bd5('0x14b')](_0xd45ee4,_0xd45ee4[_0x0bd5('0xb2')],_0xd45ee4[_0x0bd5('0x14a')]);}else if(this[_0x0bd5('0x14')][_0xd45ee4['linkedid']]['dialAnswer']){logger[_0x0bd5('0x5d')](_0x0bd5('0x14c'),_0xd45ee4[_0x0bd5('0xb2')],_0xd45ee4[_0x0bd5('0x14a')],_0x0bd5('0xb8'),_0x38f0e7[_0x0bd5('0x2a')],_0x0bd5('0x78'),_0x38f0e7[_0x0bd5('0x61')]);this[_0x0bd5('0x14b')](_0xd45ee4,_0xd45ee4[_0x0bd5('0xb2')],_0xd45ee4[_0x0bd5('0x14a')]);}}};Preview[_0x0bd5('0x6b')][_0x0bd5('0x151')]=function(_0x494e05){if(this[_0x0bd5('0x14')][_0x494e05[_0x0bd5('0xfc')]]&&_0x494e05[_0x0bd5('0xfc')]!==_0x494e05[_0x0bd5('0x152')]){this[_0x0bd5('0x14b')](_0x494e05,_0x494e05[_0x0bd5('0xfc')],_0x494e05[_0x0bd5('0xef')]);}};Preview[_0x0bd5('0x6b')][_0x0bd5('0x1c')]=function(_0x2e853f){if(this['actions'][_0x2e853f[_0x0bd5('0xb2')]]&&_0x2e853f[_0x0bd5('0xb2')]!==_0x2e853f[_0x0bd5('0xb7')]&&!this[_0x0bd5('0x14')][_0x2e853f['linkedid']][_0x0bd5('0xb5')]){if(_0x2e853f[_0x0bd5('0x14a')]==='1'){this[_0x0bd5('0x14b')](_0x2e853f,_0x2e853f['linkedid'],_0x2e853f['cause']);}}};Preview['prototype'][_0x0bd5('0x153')]=function(_0x16c3ac,_0x35c8bf,_0x5828be){if(this[_0x0bd5('0x14')][_0x16c3ac]){if(_['isNil'](this[_0x0bd5('0x14')][_0x16c3ac][_0x0bd5('0x154')])){this['actions'][_0x16c3ac]['variables']={};}this[_0x0bd5('0x14')][_0x16c3ac][_0x0bd5('0x154')][_0x35c8bf]=_0x5828be;}};Preview[_0x0bd5('0x6b')][_0x0bd5('0x22')]=function(_0x658116){try{if(!_[_0x0bd5('0x73')](_0x658116)){if(ut[_0x0bd5('0x155')](_['keys'](_0x658116[_0x0bd5('0x156')])[0x0])){this[_0x0bd5('0x153')](_0x658116['uniqueid'],_[_0x0bd5('0x157')](_0x658116['variable'])[0x0],_0x658116['value']);}}}catch(_0x469c0b){logger[_0x0bd5('0x158')](_0x0bd5('0x159'),util[_0x0bd5('0x15a')](_0x469c0b,{'showHidden':![],'depth':null}));}};Preview[_0x0bd5('0x6b')]['syncAttendedTransfer']=function(_0x42aea0){if(_0x42aea0){if(this[_0x0bd5('0x14')][_0x42aea0[_0x0bd5('0x15b')]]){this[_0x0bd5('0x14')][_0x42aea0[_0x0bd5('0x15b')]][_0x0bd5('0x14f')]=!![];}}};Preview['prototype'][_0x0bd5('0x26')]=function(_0x1881ce){if(_0x1881ce){if(this[_0x0bd5('0x14')][_0x1881ce[_0x0bd5('0x15c')]]){this[_0x0bd5('0x14')][_0x1881ce[_0x0bd5('0x15c')]][_0x0bd5('0x14f')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 8fa4c4c..2dd9c7d 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 _0x9895=['type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercompleteAt','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','countReScheduled','unlockContact','disableContact','crateCustomerReportQueue'];(function(_0x483c0a,_0xcc3bc1){var _0x312228=function(_0x7c6585){while(--_0x7c6585){_0x483c0a['push'](_0x483c0a['shift']());}};_0x312228(++_0xcc3bc1);}(_0x9895,0x1bb));var _0x5989=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9895[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var BPromise=require(_0x5989('0x0'));var logger=require(_0x5989('0x1'))(_0x5989('0x2'));var _=require(_0x5989('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x5989('0x4'));var cmHopperBlack=require(_0x5989('0x5'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x5989('0x6'));function loggerCatch(_0x4406e1){return function(_0x321217){logger[_0x5989('0x7')](_0x4406e1,util[_0x5989('0x8')](_0x321217,{'showHidden':![],'depth':null}));};}function create(_0x191d31){return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](cmHopperHistory[_0x5989('0xb')](_0x191d31))[_0x5989('0xc')](loggerCatch(_0x5989('0xd')));}function createAgent(_0x31f645){return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](agentReportPreview[_0x5989('0xb')](_0x31f645))['catch'](loggerCatch(_0x5989('0xd')));}function moveContact(_0x15612f){return BPromise[_0x5989('0x9')]()['then'](cmHopper['moveContactManagedDialer'](_0x15612f,!![]))[_0x5989('0xc')](loggerCatch(_0x5989('0xe')));}exports[_0x5989('0xf')]=function(_0x327520){return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](cmHopperBlack['checkIsBlackList'](_0x327520))[_0x5989('0xc')](loggerCatch(_0x5989('0x10')));};exports[_0x5989('0x11')]=function(_0x58ee56){return BPromise['resolve']()[_0x5989('0xa')](cmHopper[_0x5989('0x11')](_0x58ee56))[_0x5989('0xc')](loggerCatch(_0x5989('0x12')));};exports[_0x5989('0xb')]=function(_0x524300,_0x16d16d){create(_0x524300)[_0x5989('0xc')](loggerCatch(_0x16d16d));moveContact(_0x524300)[_0x5989('0xc')](loggerCatch(_0x16d16d));};exports[_0x5989('0x13')]=function(_0x1205cb,_0x443abf){createAgent(_0x1205cb)[_0x5989('0xc')](loggerCatch(_0x443abf));};exports[_0x5989('0x14')]=function(_0x4681be,_0x21a55b){create(_0x4681be)[_0x5989('0xc')](loggerCatch(_0x21a55b));};exports[_0x5989('0x15')]=function(_0x53e940,_0x4ea44f){moveContact(_0x53e940)[_0x5989('0xc')](loggerCatch(_0x4ea44f));};exports[_0x5989('0x16')]=function(_0x5ac1f9,_0x19e683,_0x396045){if(_0x19e683){_0x5ac1f9['UserId']=null;}if(_0x396045){_0x5ac1f9['active']=![];}return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](cmHopper[_0x5989('0x16')](_0x5ac1f9))[_0x5989('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x2bd414){return BPromise['resolve']()[_0x5989('0xa')](cmHopper[_0x5989('0x17')](_0x2bd414))[_0x5989('0xc')](loggerCatch('[countReScheduled]\x20'));};exports[_0x5989('0x18')]=function(_0x32ab51){return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](cmHopper['unlockContact']({'UserId':null},_0x32ab51,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0x5989('0x19')]=function(_0x4a255c){return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](cmHopper[_0x5989('0x18')]({'active':![]},_0x4a255c,0x1))[_0x5989('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0x5989('0x1a')]=function(_0x278222){var _0x5ab991={};_0x5ab991[_0x5989('0x1b')]=_0x278222['type'];_0x5ab991[_0x5989('0x1c')]=_0x278222[_0x5989('0x1c')];_0x5ab991[_0x5989('0x1d')]=_0x278222[_0x5989('0x1d')];_0x5ab991[_0x5989('0x1e')]=_0x278222['calleridname'];_0x5ab991[_0x5989('0x1f')]=_0x278222[_0x5989('0x1f')];_0x5ab991['queuecallerjoinAt']=_0x278222['answertime'];_0x5ab991['queuecallerleaveAt']=_0x278222[_0x5989('0x20')];_0x5ab991['queuecallercomplete']=0x1;_0x5ab991[_0x5989('0x21')]=_0x278222['endtime'];_0x5ab991[_0x5989('0x22')]=_0x278222[_0x5989('0x23')];_0x5ab991[_0x5989('0x24')]=_0x5989('0x25');_0x5ab991['exten']=_0x5989('0x26');_0x5ab991[_0x5989('0x27')]=0x0;_0x5ab991[_0x5989('0x28')]=0x1;_0x5ab991[_0x5989('0x29')]=_0x278222[_0x5989('0x23')];_0x5ab991[_0x5989('0x2a')]=_0x5989('0x2b');return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](voiceQueueReport['create'](_0x5ab991))[_0x5989('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x5989('0x2c')]=function(_0x39ba04,_0x4f3598){return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](cmHopper[_0x5989('0x2c')](_0x39ba04,_0x4f3598))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x5989('0x2d')]=function(_0x28eae2){return BPromise[_0x5989('0x9')]()[_0x5989('0xa')](cmHopper['rescheduleContact'](_0x28eae2,!![],!![]))[_0x5989('0xc')](loggerCatch(_0x5989('0x2e')));}; \ No newline at end of file +var _0x6f10=['rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerleaveAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal'];(function(_0x291e4c,_0x3a6c6d){var _0x412f78=function(_0x2729bf){while(--_0x2729bf){_0x291e4c['push'](_0x291e4c['shift']());}};_0x412f78(++_0x3a6c6d);}(_0x6f10,0x1d8));var _0x06f1=function(_0x20d0e6,_0x579837){_0x20d0e6=_0x20d0e6-0x0;var _0x4cc540=_0x6f10[_0x20d0e6];return _0x4cc540;};'use strict';var util=require(_0x06f1('0x0'));var BPromise=require(_0x06f1('0x1'));var logger=require('../../../config/logger')(_0x06f1('0x2'));var _=require('lodash');var cmHopper=require(_0x06f1('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x06f1('0x4'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x06f1('0x5'));var agentReportPreview=require(_0x06f1('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xbcfa8b){return function(_0x51e6f0){logger[_0x06f1('0x7')](_0xbcfa8b,util['inspect'](_0x51e6f0,{'showHidden':![],'depth':null}));};}function create(_0x3290ef){return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](cmHopperHistory[_0x06f1('0xa')](_0x3290ef))[_0x06f1('0xb')](loggerCatch(_0x06f1('0xc')));}function createAgent(_0x34c944){return BPromise['resolve']()[_0x06f1('0x9')](agentReportPreview['createHistory'](_0x34c944))[_0x06f1('0xb')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x18d3ff){return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](cmHopper[_0x06f1('0xd')](_0x18d3ff,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports['checkIsBlackList']=function(_0x3b1e84){return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](cmHopperBlack['checkIsBlackList'](_0x3b1e84))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x06f1('0xe')]=function(_0x1805f7){return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](cmHopper[_0x06f1('0xe')](_0x1805f7))[_0x06f1('0xb')](loggerCatch(_0x06f1('0xf')));};exports[_0x06f1('0xa')]=function(_0x59be61,_0x4a48a1){create(_0x59be61)[_0x06f1('0xb')](loggerCatch(_0x4a48a1));moveContact(_0x59be61)[_0x06f1('0xb')](loggerCatch(_0x4a48a1));};exports['createAgentHistory']=function(_0x5d2b08,_0x576683){createAgent(_0x5d2b08)[_0x06f1('0xb')](loggerCatch(_0x576683));};exports[_0x06f1('0x10')]=function(_0x515d7f,_0x4b8659){create(_0x515d7f)[_0x06f1('0xb')](loggerCatch(_0x4b8659));};exports[_0x06f1('0x11')]=function(_0x939b94,_0x44a8e6){moveContact(_0x939b94)[_0x06f1('0xb')](loggerCatch(_0x44a8e6));};exports[_0x06f1('0x12')]=function(_0x4bfa9b,_0x4beaf2,_0x564122){if(_0x4beaf2){_0x4bfa9b[_0x06f1('0x13')]=null;}if(_0x564122){_0x4bfa9b[_0x06f1('0x14')]=![];}return BPromise[_0x06f1('0x8')]()['then'](cmHopper[_0x06f1('0x12')](_0x4bfa9b))[_0x06f1('0xb')](loggerCatch(_0x06f1('0x15')));};exports[_0x06f1('0x16')]=function(_0x321ea9){return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](cmHopper[_0x06f1('0x16')](_0x321ea9))[_0x06f1('0xb')](loggerCatch(_0x06f1('0x17')));};exports[_0x06f1('0x18')]=function(_0x5f30a0){return BPromise[_0x06f1('0x8')]()['then'](cmHopper[_0x06f1('0x18')]({'UserId':null},_0x5f30a0,0x1))['catch'](loggerCatch(_0x06f1('0x19')));};exports['disableContact']=function(_0xa873fa){return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](cmHopper[_0x06f1('0x18')]({'active':![]},_0xa873fa,0x1))[_0x06f1('0xb')](loggerCatch(_0x06f1('0x1a')));};exports[_0x06f1('0x1b')]=function(_0x465592){var _0xb366e5={};_0xb366e5[_0x06f1('0x1c')]=_0x465592[_0x06f1('0x1c')];_0xb366e5['uniqueid']=_0x465592['uniqueid'];_0xb366e5[_0x06f1('0x1d')]=_0x465592[_0x06f1('0x1d')];_0xb366e5['calleridname']=_0x465592[_0x06f1('0x1e')];_0xb366e5[_0x06f1('0x1f')]=_0x465592[_0x06f1('0x1f')];_0xb366e5['queuecallerjoinAt']=_0x465592['answertime'];_0xb366e5[_0x06f1('0x20')]=_0x465592[_0x06f1('0x21')];_0xb366e5['queuecallercomplete']=0x1;_0xb366e5[_0x06f1('0x22')]=_0x465592[_0x06f1('0x23')];_0xb366e5[_0x06f1('0x24')]=_0x465592[_0x06f1('0x25')];_0xb366e5[_0x06f1('0x26')]=_0x06f1('0x27');_0xb366e5['exten']=_0x06f1('0x28');_0xb366e5[_0x06f1('0x29')]=0x0;_0xb366e5[_0x06f1('0x2a')]=0x1;_0xb366e5[_0x06f1('0x2b')]=_0x465592[_0x06f1('0x25')];_0xb366e5[_0x06f1('0x2c')]='COMPLETED';return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](voiceQueueReport['create'](_0xb366e5))['catch'](loggerCatch(_0x06f1('0x2d')));};exports[_0x06f1('0x2e')]=function(_0x3dbc0b,_0x806698){return BPromise[_0x06f1('0x8')]()[_0x06f1('0x9')](cmHopper[_0x06f1('0x2e')](_0x3dbc0b,_0x806698))['catch'](loggerCatch(_0x06f1('0x2f')));};exports[_0x06f1('0x30')]=function(_0x252dfe){return BPromise['resolve']()[_0x06f1('0x9')](cmHopper[_0x06f1('0x12')](_0x252dfe,!![],!![]))[_0x06f1('0xb')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 d17740b..291fe7d 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 _0xc3fd=['BOOKED','uniqueid','channelAgent','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','Global','scheduledAt','active','ContactId','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','dialAnswer','scheduledat','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','random','extractCalleridName','extractCalleridNumber','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','inspect','loggerError','error','logger2','info','message','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','dialQueueProject2','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','ringtime','starttime','membername','UserId','logCustomer','talktime','answertime','Failure','RECALL'];(function(_0x2762ce,_0x4505a0){var _0x444b75=function(_0xad562a){while(--_0xad562a){_0x2762ce['push'](_0x2762ce['shift']());}};_0x444b75(++_0x4505a0);}(_0xc3fd,0xcb));var _0xdc3f=function(_0x186674,_0x36bf20){_0x186674=_0x186674-0x0;var _0x8d6700=_0xc3fd[_0x186674];return _0x8d6700;};'use strict';var util=require('util');var _=require(_0xdc3f('0x0'));var moment=require(_0xdc3f('0x1'));var logger=require(_0xdc3f('0x2'))('preview');var ipAgi=process[_0xdc3f('0x3')][_0xdc3f('0x4')]||_0xdc3f('0x5');function getSeconds(_0x2daf8f,_0x129a9f){var _0x245dae=moment(_0x2daf8f)[_0xdc3f('0x6')](0x0);var _0x491f40=moment(_0x129a9f)[_0xdc3f('0x6')](0x0);return _0x245dae[_0xdc3f('0x7')](_0x491f40,_0xdc3f('0x8'));}exports['loggerCatch']=function(_0x4f5df5){return function(_0x1d5148){logger['error'](_0x4f5df5,util['inspect'](_0x1d5148,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1216f0,_0x8b2d61){logger['info'](_0x1216f0,util[_0xdc3f('0x9')](_0x8b2d61,{'showHidden':![],'depth':null}));};exports[_0xdc3f('0xa')]=function(_0x29c74f,_0x24a57b){logger[_0xdc3f('0xb')](_0x29c74f,util[_0xdc3f('0x9')](_0x24a57b,{'showHidden':![],'depth':null}));};exports[_0xdc3f('0xc')]=function(_0x3b3321){return function(_0x3864c8){logger[_0xdc3f('0xd')](_0x3b3321,util[_0xdc3f('0x9')](_0x3864c8,{'showHidden':![],'depth':null}));};};exports[_0xdc3f('0xe')]=function(_0x458f91,_0x372147,_0x42959d){return{'message':_0x458f91,'unlock':_0x372147,'active':_0x42959d};};exports['getCallerId']=function(_0x1bc57a,_0x15fa36,_0xea7d44){if(!_[_0xdc3f('0xf')](_0xea7d44)&&'string'===typeof _0xea7d44&&!_[_0xdc3f('0x10')](_0xea7d44)){if(!_[_0xdc3f('0xf')](_0x15fa36)&&_0xdc3f('0x11')===typeof _0x15fa36&&!_[_0xdc3f('0x10')](_0x15fa36)){return util[_0xdc3f('0x12')](_0xdc3f('0x13'),_0x15fa36,_0xea7d44);}return util[_0xdc3f('0x12')](_0xdc3f('0x13'),_0xea7d44,_0xea7d44);}if(!_['isUndefined'](_0x1bc57a)&&_0xdc3f('0x11')===typeof _0x1bc57a&&!_[_0xdc3f('0x10')](_0x1bc57a)){return _0x1bc57a;}return'\x22\x22\x20<>';};exports[_0xdc3f('0x14')]=function(_0x208f0e){if(_[_0xdc3f('0x15')](_0x208f0e)){return![];}return _0x208f0e;};exports[_0xdc3f('0x16')]=function(_0x17aed4,_0x19a899,_0x2dfdf9,_0x4f2d72,_0x2111c9,_0x594489){var _0xdbe6a7={'XMD-QUEUE':_0x19a899[_0xdc3f('0x17')]?_0x19a899['Queue'][_0xdc3f('0x18')]:'','XMD-CALLERID':_0x4f2d72,'XMD-CALLERID-PREVIEW':_0x594489?util[_0xdc3f('0x12')](_0xdc3f('0x13'),_0x594489[_0xdc3f('0x19')],_0x594489[_0xdc3f('0x1a')]):_0x4f2d72,'XMD-DIALID':_0x2111c9,'XMD-CONTACTID':_0x19a899['ContactId'],'XMD-CDRTYPE':_0xdc3f('0x1b'),'CALLERID(all)':_0x4f2d72,'XMD-VOICEQUEUEID':_0x19a899[_0xdc3f('0x1c')],'XMD-DIALCHANNEL':_0x2dfdf9,'XMD-DIALTIMEOUT':_0x17aed4[_0xdc3f('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xdc3f('0x12')](_0xdc3f('0x1e'),_0x17aed4['dialQueueProject2']?'g':'',_[_0xdc3f('0x10')](_0x17aed4[_0xdc3f('0x1f')])?'':_0xdc3f('0x20')),'XMD-DIALURL':_0x17aed4[_0xdc3f('0x21')]||'','XMD-AGI':_0x17aed4['dialQueueProject']?util[_0xdc3f('0x12')](_0xdc3f('0x22'),ipAgi,_0x17aed4[_0xdc3f('0x23')]):'NONE','XMD-AGIAFTER':_0x17aed4[_0xdc3f('0x24')]?util['format'](_0xdc3f('0x22'),ipAgi,_0x17aed4[_0xdc3f('0x24')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x594489?_0x594489[_0xdc3f('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x594489?_0x594489[_0xdc3f('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xdc3f('0x27')};if(!_[_0xdc3f('0x10')](_0x17aed4[_0xdc3f('0x1f')])){_0xdbe6a7[util[_0xdc3f('0x12')]('%s',_0xdc3f('0x28'))]=_0x17aed4['monitor_format'];_0xdbe6a7[util['format']('%s',_0xdc3f('0x29'))]=_0x2111c9;}if(_0x19a899&&_0x19a899[_0xdc3f('0x2a')]){for(var _0x17ae86 in _0x19a899[_0xdc3f('0x2a')]){if(_0x19a899[_0xdc3f('0x2a')][_0xdc3f('0x2b')](_0x17ae86)){if(!_[_0xdc3f('0x15')](_0x19a899['Contact'][_0x17ae86])&&_0x17ae86!=='id'&&_0x17ae86!==_0xdc3f('0x2c')&&_0x17ae86!==_0xdc3f('0x2d')&&_0x17ae86!==_0xdc3f('0x2e')){_0xdbe6a7[util[_0xdc3f('0x12')]('%s%s',_0xdc3f('0x2f'),_[_0xdc3f('0x30')](_0x17ae86))]=_0x19a899[_0xdc3f('0x2a')][_0x17ae86];}}}}return _0xdbe6a7;};exports['toLowerVariables']=function(_0x1ead3e){var _0x1ddc0e={};for(var _0x5de495 in _0x1ead3e){if(_0x1ead3e['hasOwnProperty'](_0x5de495)){_0x1ddc0e[util[_0xdc3f('0x12')]('%s',_[_0xdc3f('0x31')](_0x5de495))]=_0x1ead3e[_0x5de495];}}return{'variables':_0x1ddc0e};};exports[_0xdc3f('0x32')]=function(_0x19e702,_0x408a44){if(!_['isNil'](_0x19e702)){if(_0x19e702[_0xdc3f('0x2b')](_0xdc3f('0x33'))){if(_0x19e702[_0xdc3f('0x33')]>0x0){_0x19e702[_0xdc3f('0x33')]-=0x1;}else{logger[_0xdc3f('0xb')](_0xdc3f('0x34'),_0x408a44);}}}else{logger[_0xdc3f('0xb')](_0xdc3f('0x35'),_0x408a44);}};exports['logBlacklist']=function(_0xe7a5f1){var _0x1745e1=moment()[_0xdc3f('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xe7a5f1[_0xdc3f('0x36')]=0xd;_0xe7a5f1[_0xdc3f('0x37')]='Blacklist';_0xe7a5f1['starttime']=_0x1745e1;_0xe7a5f1['responsetime']=_0x1745e1;_0xe7a5f1[_0xdc3f('0x38')]=_0x1745e1;};exports[_0xdc3f('0x39')]=function(_0x30351e,_0x44b00a,_0x306f66){var _0x5cda13=moment()['format'](_0xdc3f('0x3a'));_0x30351e[_0xdc3f('0x36')]=_0x44b00a;_0x30351e[_0xdc3f('0x37')]=_0x306f66;_0x30351e[_0xdc3f('0x3b')]=_0x5cda13;_0x30351e[_0xdc3f('0x3c')]=getSeconds(_0x30351e[_0xdc3f('0x3b')],_0x30351e[_0xdc3f('0x3d')]);};exports['logLookAgent']=function(_0x28a2f8,_0x2896e3,_0x36bb95){_0x28a2f8[_0xdc3f('0x3e')]=_0x2896e3;_0x28a2f8[_0xdc3f('0x3f')]=_0x36bb95;};exports[_0xdc3f('0x40')]=function(_0x16ac77,_0x4d7230,_0x35733f){var _0x226fa2=moment()[_0xdc3f('0x12')](_0xdc3f('0x3a'));_0x16ac77[_0xdc3f('0x36')]=_0x4d7230;_0x16ac77[_0xdc3f('0x37')]=_0x35733f;_0x16ac77[_0xdc3f('0x3b')]=_0x16ac77['responsetime']?_0x16ac77[_0xdc3f('0x3b')]:_0x226fa2;_0x16ac77[_0xdc3f('0x38')]=_0x16ac77[_0xdc3f('0x38')]?_0x16ac77[_0xdc3f('0x38')]:_0x226fa2;_0x16ac77[_0xdc3f('0x3c')]=getSeconds(_0x16ac77[_0xdc3f('0x3b')]||0x0,_0x16ac77[_0xdc3f('0x3d')]||0x0);_0x16ac77[_0xdc3f('0x41')]=_0x16ac77[_0xdc3f('0x42')]?getSeconds(_0x16ac77[_0xdc3f('0x38')],_0x16ac77[_0xdc3f('0x42')]):0x0;};exports['isFailure']=function(_0x4e5427){return _0x4e5427===_0xdc3f('0x43');};exports['variablesAction']=function(_0x136c7f,_0x182f05,_0x4616bd,_0x3ddae6,_0x44e305){var _0x21f498=_0x3ddae6?_0xdc3f('0x44'):_0x136c7f[_0xdc3f('0x19')];_0x21f498=_0x44e305?_0xdc3f('0x45'):_0x21f498;return{'actionid':_0x136c7f[_0xdc3f('0x46')],'action':'originate','channel':_0x136c7f[_0xdc3f('0x47')],'callerid':util[_0xdc3f('0x12')](_0xdc3f('0x13'),_0x21f498,_0x136c7f[_0xdc3f('0x1a')]),'Exten':_0xdc3f('0x48'),'Context':_0xdc3f('0x49'),'Priority':'1','variable':_0x4616bd,'timeout':(_0x182f05[_0xdc3f('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x136c7f['uniqueid']};};exports[_0xdc3f('0x4b')]=function(_0x87ed2){return _0x87ed2[_0xdc3f('0x4c')]+_0x87ed2[_0xdc3f('0x4d')]+_0x87ed2['countnoanswerretry']+_0x87ed2[_0xdc3f('0x4e')]+_0x87ed2['countnosuchnumberretry'];};exports[_0xdc3f('0x4f')]=function(_0x19585e){var _0x5ea89a=_['clone'](_0x19585e);_0x5ea89a[_0xdc3f('0x36')]=0xf;_0x5ea89a[_0xdc3f('0x37')]=_0xdc3f('0x50');return _0x5ea89a;};exports[_0xdc3f('0x51')]=function(_0xcc005f,_0x26f794,_0x3499fc){var _0x1b293e={};_0x1b293e[_0x26f794]=_0xcc005f[_0x26f794];_0x1b293e[_0xdc3f('0x52')]=![];_0x1b293e['scheduledat']=moment()['add'](_0x3499fc,'minutes')[_0xdc3f('0x12')](_0xdc3f('0x3a'));_0x1b293e[_0xdc3f('0x53')]=_0xcc005f[_0xdc3f('0x53')];_0x1b293e[_0xdc3f('0x54')]=_0xcc005f[_0xdc3f('0x54')];_0x1b293e[_0xdc3f('0x1c')]=_0xcc005f[_0xdc3f('0x1c')]||undefined;return _0x1b293e;};exports['decrementTalkink']=function(_0x58ad3f,_0x26d8eb){if(!_[_0xdc3f('0x15')](_0x58ad3f)){if(_0x58ad3f[_0xdc3f('0x55')]>0x0){_0x58ad3f[_0xdc3f('0x55')]-=0x1;}else{logger[_0xdc3f('0xb')](_0x26d8eb,_0xdc3f('0x56'));}}else{logger[_0xdc3f('0xb')](_0x26d8eb,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x1c2a5d){if(_0x1c2a5d<=0x0){return!![];}return![];};exports[_0xdc3f('0x57')]=function(_0x570b43,_0x4c5d4f,_0x2801c9){_0x570b43[_0xdc3f('0x58')]=_0x4c5d4f;_0x570b43['name']=_0x570b43[_0xdc3f('0x59')];_0x570b43[_0xdc3f('0x5a')]=_0x570b43['channelAgent'];_0x570b43['motionChannel']=_0xdc3f('0x5b');if(_0x2801c9){_0x570b43['mandatoryDisposition']=_0x2801c9[_0xdc3f('0x5c')];}return _0x570b43;};exports['buildAcw']=function(_0xf0ce8a){var _0x4a646a={};_0x4a646a['queue']=_0xf0ce8a[_0xdc3f('0x59')];_0x4a646a['interface']=_0xf0ce8a[_0xdc3f('0x47')];_0x4a646a[_0xdc3f('0x46')]=_0xf0ce8a[_0xdc3f('0x46')];return _0x4a646a;};exports[_0xdc3f('0x5d')]=function(_0x12b3c7){var _0x4ecfaf=[];for(var _0x2d203a in _0x12b3c7){if(_0x12b3c7[_0xdc3f('0x2b')](_0x2d203a)){if(!_[_0xdc3f('0x15')](_0x12b3c7[_0x2d203a])&&_0x12b3c7[_0x2d203a][_0xdc3f('0x36')]===_0xdc3f('0x5e')&&_0x12b3c7[_0x2d203a][_0xdc3f('0x5f')]===_0xdc3f('0x60')){_0x4ecfaf[_0xdc3f('0x61')](_0x12b3c7[_0x2d203a]['id']);}}}return _0x4ecfaf;};exports[_0xdc3f('0x62')]=function(_0x5f0dc1){var _0x1b508c=moment()[_0xdc3f('0x6')](0x0);var _0x14d264=moment(_0x5f0dc1)[_0xdc3f('0x6')](0x0);return _0x1b508c[_0xdc3f('0x7')](_0x14d264,'seconds');};exports[_0xdc3f('0x63')]=function(_0x52c44b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x52c44b[_0xdc3f('0x53')],'ListId':_0x52c44b[_0xdc3f('0x54')],'VoiceQueueId':_0x52c44b[_0xdc3f('0x1c')]||undefined,'CampaignId':_0x52c44b[_0xdc3f('0x64')]||undefined};};exports[_0xdc3f('0x65')]=function(_0x185adb){if(_0x185adb===_0xdc3f('0x46')||_0x185adb===_0xdc3f('0x66')||_0x185adb===_0xdc3f('0x59')||_0x185adb===_0xdc3f('0x67')||_0x185adb==='campaigntype'||_0x185adb===_0xdc3f('0x68')||_0x185adb===_0xdc3f('0x3e')||_0x185adb===_0xdc3f('0x47')||_0x185adb===_0xdc3f('0x19')||_0x185adb===_0xdc3f('0x52')||_0x185adb==='calleridnum'||_0x185adb===_0xdc3f('0x69')||_0x185adb===_0xdc3f('0x4c')||_0x185adb===_0xdc3f('0x4d')||_0x185adb===_0xdc3f('0x6a')||_0x185adb===_0xdc3f('0x6b')||_0x185adb===_0xdc3f('0x6c')||_0x185adb===_0xdc3f('0x6d')||_0x185adb===_0xdc3f('0x6e')||_0x185adb==='recallme'||_0x185adb===_0xdc3f('0x53')||_0x185adb===_0xdc3f('0x54')||_0x185adb===_0xdc3f('0x3f')||_0x185adb===_0xdc3f('0x1c')||_0x185adb===_0xdc3f('0x6f')||_0x185adb===_0xdc3f('0x70')||_0x185adb===_0xdc3f('0x71')||_0x185adb==='xmd-phone'||_0x185adb==='xmd-listid'||_0x185adb===_0xdc3f('0x72')||_0x185adb==='xmd-dialtimeout'||_0x185adb===_0xdc3f('0x73')||_0x185adb===_0xdc3f('0x74')||_0x185adb===_0xdc3f('0x75')||_0x185adb==='xmd-contactid'||_0x185adb==='xmd-cdrtype'||_0x185adb===_0xdc3f('0x76')||_0x185adb===_0xdc3f('0x77')||_0x185adb===_0xdc3f('0x78')||_0x185adb==='rtpaudioqos'||_0x185adb===_0xdc3f('0x79')||_0x185adb===_0xdc3f('0x7a')||_0x185adb===_0xdc3f('0x7b')||_0x185adb===_0xdc3f('0x7c')||_0x185adb==='rtpaudioqoslossbridged'||_0x185adb===_0xdc3f('0x7d')||_0x185adb===_0xdc3f('0x7e')||_0x185adb==='rtpaudioqos'||_0x185adb===_0xdc3f('0x79')||_0x185adb===_0xdc3f('0x7a')||_0x185adb===_0xdc3f('0x7b')||_0x185adb===_0xdc3f('0x7c')||_0x185adb===_0xdc3f('0x7f')||_0x185adb===_0xdc3f('0x7d')||_0x185adb===_0xdc3f('0x7e')||_0x185adb===_0xdc3f('0x80')||_0x185adb===_0xdc3f('0x81')||_0x185adb==='state'||_0x185adb===_0xdc3f('0x37')){return![];}return!![];};exports[_0xdc3f('0x82')]=function(_0x19d005,_0x4fea30){var _0x2f98c0,_0xce8564,_0x2460c8;if(_0x4fea30<=0x0){_0x4fea30=0x1;}_0x2f98c0=new RegExp(_0xdc3f('0x83')+_0x4fea30+'}$');_0xce8564=Math['pow'](0xa,_0x4fea30-0x1);_0x2460c8=Math['pow'](0xa,_0x4fea30)-0x1;return util[_0xdc3f('0x12')]('%s',_[_0xdc3f('0x84')](_0x19d005,_0x2f98c0,_[_0xdc3f('0x85')](_0xce8564,_0x2460c8)));};exports[_0xdc3f('0x86')]=function(_0x3a2fbe){var _0x1e52d5=_0x3a2fbe['match'](/"(.*?)"/);return _0x1e52d5?_0x1e52d5[0x1]:_0x3a2fbe;};exports[_0xdc3f('0x87')]=function(_0x71e9dd){var _0x2fa89c=_0x71e9dd['match'](/<(.*?)>/);return _0x2fa89c?_0x2fa89c[0x1]:_0x71e9dd;}; \ No newline at end of file +var _0xc98f=['voice','mandatoryDisposition','agentReadyId','status','reachable','push','getDiff','seconds','createBody','campaigntype','dialAnswer','membername','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','ContactId','dialer','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','UserId','logCustomer','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','buildObj','lastevent','queue','interface','motionChannel'];(function(_0x324685,_0x973b4f){var _0x2a36e9=function(_0xfe1c8c){while(--_0xfe1c8c){_0x324685['push'](_0x324685['shift']());}};_0x2a36e9(++_0x973b4f);}(_0xc98f,0x14e));var _0xfc98=function(_0x188d60,_0x578fd0){_0x188d60=_0x188d60-0x0;var _0x51116b=_0xc98f[_0x188d60];return _0x51116b;};'use strict';var util=require(_0xfc98('0x0'));var _=require(_0xfc98('0x1'));var moment=require(_0xfc98('0x2'));var logger=require(_0xfc98('0x3'))(_0xfc98('0x4'));var ipAgi=process[_0xfc98('0x5')][_0xfc98('0x6')]||_0xfc98('0x7');function getSeconds(_0x16f2ef,_0x333e01){var _0x2e8ecc=moment(_0x16f2ef)[_0xfc98('0x8')](0x0);var _0x2d86c3=moment(_0x333e01)[_0xfc98('0x8')](0x0);return _0x2e8ecc[_0xfc98('0x9')](_0x2d86c3,'seconds');}exports[_0xfc98('0xa')]=function(_0x26de73){return function(_0x3bf10a){logger['error'](_0x26de73,util[_0xfc98('0xb')](_0x3bf10a,{'showHidden':![],'depth':null}));};};exports[_0xfc98('0xc')]=function(_0x31a33c,_0x2b6a7e){logger[_0xfc98('0xd')](_0x31a33c,util[_0xfc98('0xb')](_0x2b6a7e,{'showHidden':![],'depth':null}));};exports[_0xfc98('0xe')]=function(_0x13d200,_0x4083b8){logger['error'](_0x13d200,util[_0xfc98('0xb')](_0x4083b8,{'showHidden':![],'depth':null}));};exports[_0xfc98('0xf')]=function(_0x5ca171){return function(_0x4b3f4c){logger[_0xfc98('0xd')](_0x5ca171,util[_0xfc98('0xb')](_0x4b3f4c,{'showHidden':![],'depth':null}));};};exports[_0xfc98('0x10')]=function(_0x1f075a,_0x1a1842,_0x583bb6){return{'message':_0x1f075a,'unlock':_0x1a1842,'active':_0x583bb6};};exports[_0xfc98('0x11')]=function(_0xa42662,_0x396da9,_0x5b5c18){if(!_[_0xfc98('0x12')](_0x5b5c18)&&_0xfc98('0x13')===typeof _0x5b5c18&&!_[_0xfc98('0x14')](_0x5b5c18)){if(!_['isUndefined'](_0x396da9)&&'string'===typeof _0x396da9&&!_[_0xfc98('0x14')](_0x396da9)){return util[_0xfc98('0x15')]('\x22%s\x22\x20<%s>',_0x396da9,_0x5b5c18);}return util[_0xfc98('0x15')](_0xfc98('0x16'),_0x5b5c18,_0x5b5c18);}if(!_[_0xfc98('0x12')](_0xa42662)&&_0xfc98('0x13')===typeof _0xa42662&&!_[_0xfc98('0x14')](_0xa42662)){return _0xa42662;}return'\x22\x22\x20<>';};exports[_0xfc98('0x17')]=function(_0x841bbc){if(_[_0xfc98('0x18')](_0x841bbc)){return![];}return _0x841bbc;};exports[_0xfc98('0x19')]=function(_0xde2a09,_0x349ae3,_0x62bad1,_0x199139,_0xda662a,_0x2c57a3){var _0x1b5a32={'XMD-QUEUE':_0x349ae3[_0xfc98('0x1a')]?_0x349ae3[_0xfc98('0x1a')][_0xfc98('0x1b')]:'','XMD-CALLERID':_0x199139,'XMD-CALLERID-PREVIEW':_0x2c57a3?util[_0xfc98('0x15')](_0xfc98('0x16'),_0x2c57a3[_0xfc98('0x1c')],_0x2c57a3['calleridnum']):_0x199139,'XMD-DIALID':_0xda662a,'XMD-CONTACTID':_0x349ae3[_0xfc98('0x1d')],'XMD-CDRTYPE':_0xfc98('0x1e'),'CALLERID(all)':_0x199139,'XMD-VOICEQUEUEID':_0x349ae3['VoiceQueueId'],'XMD-DIALCHANNEL':_0x62bad1,'XMD-DIALTIMEOUT':_0xde2a09[_0xfc98('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xfc98('0x15')]('\x22rtTxX%s%s\x22',_0xde2a09[_0xfc98('0x20')]?'g':'',_['isEmpty'](_0xde2a09['monitor_format'])?'':_0xfc98('0x21')),'XMD-DIALURL':_0xde2a09[_0xfc98('0x22')]||'','XMD-AGI':_0xde2a09[_0xfc98('0x23')]?util[_0xfc98('0x15')](_0xfc98('0x24'),ipAgi,_0xde2a09['dialQueueProject']):_0xfc98('0x25'),'XMD-AGIAFTER':_0xde2a09[_0xfc98('0x20')]?util[_0xfc98('0x15')](_0xfc98('0x24'),ipAgi,_0xde2a09[_0xfc98('0x20')]):_0xfc98('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x2c57a3?_0x2c57a3[_0xfc98('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x2c57a3?_0x2c57a3[_0xfc98('0x27')]:'','XMD-DESTINATION':_0xfc98('0x28'),'SIPADDHEADER':_0xfc98('0x29')};if(!_[_0xfc98('0x14')](_0xde2a09[_0xfc98('0x2a')])){_0x1b5a32[util['format']('%s',_0xfc98('0x2b'))]=_0xde2a09[_0xfc98('0x2a')];_0x1b5a32[util[_0xfc98('0x15')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0xda662a;}if(_0x349ae3&&_0x349ae3[_0xfc98('0x2c')]){for(var _0xf18945 in _0x349ae3['Contact']){if(_0x349ae3[_0xfc98('0x2c')][_0xfc98('0x2d')](_0xf18945)){if(!_[_0xfc98('0x18')](_0x349ae3[_0xfc98('0x2c')][_0xf18945])&&_0xf18945!=='id'&&_0xf18945!=='tags'&&_0xf18945!==_0xfc98('0x2e')&&_0xf18945!==_0xfc98('0x2f')){_0x1b5a32[util[_0xfc98('0x15')](_0xfc98('0x30'),_0xfc98('0x31'),_['toUpper'](_0xf18945))]=_0x349ae3['Contact'][_0xf18945];}}}}return _0x1b5a32;};exports[_0xfc98('0x32')]=function(_0x309748){var _0x4cd7b8={};for(var _0x16c62d in _0x309748){if(_0x309748[_0xfc98('0x2d')](_0x16c62d)){_0x4cd7b8[util[_0xfc98('0x15')]('%s',_[_0xfc98('0x33')](_0x16c62d))]=_0x309748[_0x16c62d];}}return{'variables':_0x4cd7b8};};exports[_0xfc98('0x34')]=function(_0xfedf94,_0x5821af){if(!_['isNil'](_0xfedf94)){if(_0xfedf94[_0xfc98('0x2d')]('originated')){if(_0xfedf94[_0xfc98('0x35')]>0x0){_0xfedf94[_0xfc98('0x35')]-=0x1;}else{logger[_0xfc98('0x36')](_0xfc98('0x37'),_0x5821af);}}}else{logger['error'](_0xfc98('0x38'),_0x5821af);}};exports[_0xfc98('0x39')]=function(_0x384f1f){var _0x3de7a5=moment()[_0xfc98('0x15')](_0xfc98('0x3a'));_0x384f1f[_0xfc98('0x3b')]=0xd;_0x384f1f[_0xfc98('0x3c')]=_0xfc98('0x3d');_0x384f1f[_0xfc98('0x3e')]=_0x3de7a5;_0x384f1f[_0xfc98('0x3f')]=_0x3de7a5;_0x384f1f[_0xfc98('0x40')]=_0x3de7a5;};exports[_0xfc98('0x41')]=function(_0x5a4ead,_0x2343da,_0x6d1113){var _0x1a061f=moment()[_0xfc98('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a4ead[_0xfc98('0x3b')]=_0x2343da;_0x5a4ead[_0xfc98('0x3c')]=_0x6d1113;_0x5a4ead[_0xfc98('0x3f')]=_0x1a061f;_0x5a4ead[_0xfc98('0x42')]=getSeconds(_0x5a4ead[_0xfc98('0x3f')],_0x5a4ead[_0xfc98('0x3e')]);};exports[_0xfc98('0x43')]=function(_0x3401c0,_0x405e85,_0x14aac4){_0x3401c0['membername']=_0x405e85;_0x3401c0[_0xfc98('0x44')]=_0x14aac4;};exports[_0xfc98('0x45')]=function(_0x50a5c0,_0x2eab98,_0x1c546b){var _0x491881=moment()[_0xfc98('0x15')](_0xfc98('0x3a'));_0x50a5c0[_0xfc98('0x3b')]=_0x2eab98;_0x50a5c0[_0xfc98('0x3c')]=_0x1c546b;_0x50a5c0['responsetime']=_0x50a5c0[_0xfc98('0x3f')]?_0x50a5c0['responsetime']:_0x491881;_0x50a5c0['endtime']=_0x50a5c0[_0xfc98('0x40')]?_0x50a5c0['endtime']:_0x491881;_0x50a5c0[_0xfc98('0x42')]=getSeconds(_0x50a5c0['responsetime']||0x0,_0x50a5c0[_0xfc98('0x3e')]||0x0);_0x50a5c0['talktime']=_0x50a5c0[_0xfc98('0x46')]?getSeconds(_0x50a5c0[_0xfc98('0x40')],_0x50a5c0['answertime']):0x0;};exports[_0xfc98('0x47')]=function(_0x32a62e){return _0x32a62e===_0xfc98('0x48');};exports['variablesAction']=function(_0x2ae965,_0x4c456c,_0x31895c,_0x3514d6,_0x138ec0){var _0x49fa34=_0x3514d6?_0xfc98('0x49'):_0x2ae965[_0xfc98('0x1c')];_0x49fa34=_0x138ec0?_0xfc98('0x4a'):_0x49fa34;return{'actionid':_0x2ae965[_0xfc98('0x4b')],'action':_0xfc98('0x4c'),'channel':_0x2ae965[_0xfc98('0x4d')],'callerid':util[_0xfc98('0x15')]('\x22%s\x22\x20<%s>',_0x49fa34,_0x2ae965['calleridnum']),'Exten':_0xfc98('0x28'),'Context':_0xfc98('0x4e'),'Priority':'1','variable':_0x31895c,'timeout':(_0x4c456c['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x2ae965['uniqueid']};};exports[_0xfc98('0x4f')]=function(_0x3d39e8){return _0x3d39e8[_0xfc98('0x50')]+_0x3d39e8['countcongestionretry']+_0x3d39e8[_0xfc98('0x51')]+_0x3d39e8[_0xfc98('0x52')]+_0x3d39e8[_0xfc98('0x53')];};exports[_0xfc98('0x54')]=function(_0x4d94fc){var _0x144ca2=_['clone'](_0x4d94fc);_0x144ca2[_0xfc98('0x3b')]=0xf;_0x144ca2[_0xfc98('0x3c')]=_0xfc98('0x55');return _0x144ca2;};exports[_0xfc98('0x56')]=function(_0x17028d,_0xb63e99,_0xcb1f20){var _0xed805={};_0xed805[_0xb63e99]=_0x17028d[_0xb63e99];_0xed805[_0xfc98('0x57')]=![];_0xed805[_0xfc98('0x58')]=moment()[_0xfc98('0x59')](_0xcb1f20,_0xfc98('0x5a'))[_0xfc98('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0xed805['ContactId']=_0x17028d[_0xfc98('0x1d')];_0xed805[_0xfc98('0x5b')]=_0x17028d[_0xfc98('0x5b')];_0xed805[_0xfc98('0x5c')]=_0x17028d['VoiceQueueId']||undefined;return _0xed805;};exports[_0xfc98('0x5d')]=function(_0x400776,_0x36315b){if(!_['isNil'](_0x400776)){if(_0x400776[_0xfc98('0x5e')]>0x0){_0x400776[_0xfc98('0x5e')]-=0x1;}else{logger[_0xfc98('0x36')](_0x36315b,_0xfc98('0x5f'));}}else{logger[_0xfc98('0x36')](_0x36315b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x25f81d){if(_0x25f81d<=0x0){return!![];}return![];};exports[_0xfc98('0x60')]=function(_0x2b71bf,_0xbbead7,_0x2f00e0){_0x2b71bf[_0xfc98('0x61')]=_0xbbead7;_0x2b71bf[_0xfc98('0x1b')]=_0x2b71bf[_0xfc98('0x62')];_0x2b71bf[_0xfc98('0x63')]=_0x2b71bf[_0xfc98('0x4d')];_0x2b71bf[_0xfc98('0x64')]=_0xfc98('0x65');if(_0x2f00e0){_0x2b71bf['mandatoryDisposition']=_0x2f00e0[_0xfc98('0x66')];}return _0x2b71bf;};exports['buildAcw']=function(_0x3b89c1){var _0x402d9b={};_0x402d9b[_0xfc98('0x62')]=_0x3b89c1[_0xfc98('0x62')];_0x402d9b[_0xfc98('0x63')]=_0x3b89c1[_0xfc98('0x4d')];_0x402d9b[_0xfc98('0x4b')]=_0x3b89c1[_0xfc98('0x4b')];return _0x402d9b;};exports[_0xfc98('0x67')]=function(_0x3fb747){var _0x3e659c=[];for(var _0xd18204 in _0x3fb747){if(_0x3fb747['hasOwnProperty'](_0xd18204)){if(!_[_0xfc98('0x18')](_0x3fb747[_0xd18204])&&_0x3fb747[_0xd18204][_0xfc98('0x3b')]==='not_inuse'&&_0x3fb747[_0xd18204][_0xfc98('0x68')]===_0xfc98('0x69')){_0x3e659c[_0xfc98('0x6a')](_0x3fb747[_0xd18204]['id']);}}}return _0x3e659c;};exports[_0xfc98('0x6b')]=function(_0x27cb8f){var _0x54f4bc=moment()[_0xfc98('0x8')](0x0);var _0x22fa1c=moment(_0x27cb8f)[_0xfc98('0x8')](0x0);return _0x54f4bc[_0xfc98('0x9')](_0x22fa1c,_0xfc98('0x6c'));};exports[_0xfc98('0x6d')]=function(_0x2708c7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2708c7[_0xfc98('0x1d')],'ListId':_0x2708c7[_0xfc98('0x5b')],'VoiceQueueId':_0x2708c7['VoiceQueueId']||undefined,'CampaignId':_0x2708c7['CampaignId']||undefined};};exports['filterKey']=function(_0x24cae1){if(_0x24cae1===_0xfc98('0x4b')||_0x24cae1==='idContact'||_0x24cae1===_0xfc98('0x62')||_0x24cae1==='type'||_0x24cae1===_0xfc98('0x6e')||_0x24cae1===_0xfc98('0x6f')||_0x24cae1===_0xfc98('0x70')||_0x24cae1==='channelAgent'||_0x24cae1==='calleridname'||_0x24cae1==='active'||_0x24cae1==='calleridnum'||_0x24cae1===_0xfc98('0x58')||_0x24cae1===_0xfc98('0x50')||_0x24cae1===_0xfc98('0x71')||_0x24cae1===_0xfc98('0x51')||_0x24cae1===_0xfc98('0x72')||_0x24cae1===_0xfc98('0x73')||_0x24cae1===_0xfc98('0x74')||_0x24cae1===_0xfc98('0x75')||_0x24cae1===_0xfc98('0x76')||_0x24cae1===_0xfc98('0x1d')||_0x24cae1===_0xfc98('0x5b')||_0x24cae1===_0xfc98('0x44')||_0x24cae1==='VoiceQueueId'||_0x24cae1===_0xfc98('0x77')||_0x24cae1===_0xfc98('0x78')||_0x24cae1===_0xfc98('0x79')||_0x24cae1===_0xfc98('0x7a')||_0x24cae1===_0xfc98('0x7b')||_0x24cae1===_0xfc98('0x7c')||_0x24cae1==='xmd-dialtimeout'||_0x24cae1==='xmd-dialoptions'||_0x24cae1===_0xfc98('0x7d')||_0x24cae1===_0xfc98('0x7e')||_0x24cae1===_0xfc98('0x7f')||_0x24cae1===_0xfc98('0x80')||_0x24cae1==='xmd-callerid'||_0x24cae1===_0xfc98('0x81')||_0x24cae1===_0xfc98('0x82')||_0x24cae1===_0xfc98('0x83')||_0x24cae1===_0xfc98('0x84')||_0x24cae1==='rtpaudioqosjitter'||_0x24cae1===_0xfc98('0x85')||_0x24cae1==='rtpaudioqosloss'||_0x24cae1===_0xfc98('0x86')||_0x24cae1===_0xfc98('0x87')||_0x24cae1==='rtpaudioqosrttbridged'||_0x24cae1===_0xfc98('0x83')||_0x24cae1===_0xfc98('0x84')||_0x24cae1==='rtpaudioqosjitter'||_0x24cae1===_0xfc98('0x85')||_0x24cae1===_0xfc98('0x88')||_0x24cae1==='rtpaudioqoslossbridged'||_0x24cae1===_0xfc98('0x87')||_0x24cae1===_0xfc98('0x89')||_0x24cae1===_0xfc98('0x8a')||_0x24cae1===_0xfc98('0x8b')||_0x24cae1===_0xfc98('0x3b')||_0x24cae1===_0xfc98('0x3c')){return![];}return!![];};exports[_0xfc98('0x8c')]=function(_0x205c0b,_0x44e87e){var _0x4afa86,_0x4d0c59,_0x20f3d7;if(_0x44e87e<=0x0){_0x44e87e=0x1;}_0x4afa86=new RegExp('\x5cw{0,'+_0x44e87e+'}$');_0x4d0c59=Math[_0xfc98('0x8d')](0xa,_0x44e87e-0x1);_0x20f3d7=Math[_0xfc98('0x8d')](0xa,_0x44e87e)-0x1;return util[_0xfc98('0x15')]('%s',_['replace'](_0x205c0b,_0x4afa86,_['random'](_0x4d0c59,_0x20f3d7)));};exports[_0xfc98('0x8e')]=function(_0x20499f){var _0x68b702=_0x20499f[_0xfc98('0x8f')](/"(.*?)"/);return _0x68b702?_0x68b702[0x1]:_0x20499f;};exports[_0xfc98('0x90')]=function(_0x129c1d){var _0x1bf809=_0x129c1d['match'](/<(.*?)>/);return _0x1bf809?_0x1bf809[0x1]:_0x129c1d;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 76a833f..7e7d9de 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 _0x0a7f=['queuepause','boolean','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queueremove'];(function(_0x2aa406,_0x556be6){var _0x3b91bd=function(_0x192ae5){while(--_0x192ae5){_0x2aa406['push'](_0x2aa406['shift']());}};_0x3b91bd(++_0x556be6);}(_0x0a7f,0x1b6));var _0xf0a7=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x0a7f[_0x468a77];return _0x2d1c33;};'use strict';exports[_0xf0a7('0x0')]={'queue':{'type':_0xf0a7('0x1'),'required':!![]},'interface':{'type':_0xf0a7('0x1'),'required':!![]},'membername':{'type':_0xf0a7('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xf0a7('0x2')]={'queue':{'type':_0xf0a7('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xf0a7('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0xf0a7('0x4')},'reason':{'type':'string','required':![]}};exports[_0xf0a7('0x5')]={'module':{'type':_0xf0a7('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xf0a7('0x1'),'required':!![]}};exports[_0xf0a7('0x6')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xf0a7('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf0a7('0x1')}};exports[_0xf0a7('0x7')]={'uniqueid':{'type':_0xf0a7('0x1'),'required':!![]}};exports[_0xf0a7('0x8')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xf0a7('0x1'),'required':!![]},'context':{'type':_0xf0a7('0x1')}}; \ No newline at end of file +var _0x97fa=['queueadd','string','number','boolean','queuepause','voicequeuechannel','voicequeuechannelredirect'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97fa,0x17a));var _0xa97f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97fa[_0x3dd15e];return _0x231fd0;};'use strict';exports[_0xa97f('0x0')]={'queue':{'type':_0xa97f('0x1'),'required':!![]},'interface':{'type':_0xa97f('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xa97f('0x2'),'required':![]},'paused':{'type':_0xa97f('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':'string','required':!![]},'interface':{'type':_0xa97f('0x1'),'required':!![]}};exports[_0xa97f('0x4')]={'interface':{'type':_0xa97f('0x1'),'required':!![]},'paused':{'type':_0xa97f('0x3')},'reason':{'type':_0xa97f('0x1'),'required':![]}};exports['reload']={'module':{'type':_0xa97f('0x1'),'required':![]}};exports[_0xa97f('0x5')]={'uniqueid':{'type':_0xa97f('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0xa97f('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xa97f('0x1'),'required':!![]}};exports[_0xa97f('0x6')]={'uniqueid':{'type':_0xa97f('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xa97f('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 7e464fd..50ef84b 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 _0xa043=['disposition','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','name','total','answered','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','initVoiceCallReports','duration'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa043,0x161));var _0x3a04=function(_0x71bd4c,_0x4ede31){_0x71bd4c=_0x71bd4c-0x0;var _0x24b3dd=_0xa043[_0x71bd4c];return _0x24b3dd;};'use strict';var BPromise=require(_0x3a04('0x0'));var util=require(_0x3a04('0x1'));var _=require(_0x3a04('0x2'));var moment=require(_0x3a04('0x3'));var Agent=require('../model/agent');var Telephone=require(_0x3a04('0x4'));var Trunk=require(_0x3a04('0x5'));var VoiceQueue=require(_0x3a04('0x6'));var Trigger=require(_0x3a04('0x7'));var Template=require(_0x3a04('0x8'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x3a04('0x9'));var ZendeskAccount=require(_0x3a04('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x3a04('0xb'));var SugarcrmAccount=require(_0x3a04('0xc'));var ZohoAccount=require(_0x3a04('0xd'));var DeskAccount=require(_0x3a04('0xe'));var VtigerAccount=require(_0x3a04('0xf'));var ServicenowAccount=require(_0x3a04('0x10'));var Dynamics365Account=require(_0x3a04('0x11'));var FreshsalesAccount=require(_0x3a04('0x12'));var FaxAccount=require(_0x3a04('0x13'));var Realtime=function(){this['agents']={};this[_0x3a04('0x14')]={};this[_0x3a04('0x15')]={};this[_0x3a04('0x16')]={};this[_0x3a04('0x17')]={};this[_0x3a04('0x18')]={};this[_0x3a04('0x19')]={};this[_0x3a04('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x3a04('0x1b')]={};this[_0x3a04('0x1c')]={};this['outboundChannels']={};this['timers']={};this['settings']={};this[_0x3a04('0x1d')]={};this[_0x3a04('0x1e')]={};this[_0x3a04('0x1f')]={};this[_0x3a04('0x20')]={};this[_0x3a04('0x21')]={};this['deskAccounts']={};this[_0x3a04('0x22')]={};this[_0x3a04('0x23')]={};this[_0x3a04('0x24')]={};this[_0x3a04('0x25')]={};this['faxAccounts']={};};function freeIsNotKey(_0x5c57c0,_0x5841d5,_0x185766){var _0x39ceca=_[_0x3a04('0x26')](_0x5c57c0,function(_0x1bed28,_0x1ead78){return _0x1bed28[_0x185766];});for(var _0x55cafe in _0x5841d5){if(_0x5841d5[_0x3a04('0x27')](_0x55cafe)){if(!_0x39ceca[_0x55cafe]){delete _0x5841d5[_0x55cafe];}}}}function freeIsNotKeySip(_0x4a32fb,_0xd84452){var _0xf93cef=_[_0x3a04('0x26')](_0x4a32fb,function(_0x15650c,_0x48d0c3){return util[_0x3a04('0x28')](_0x3a04('0x29'),_0x15650c['name']);});for(var _0x43e0e9 in _0xd84452){if(_0xd84452[_0x3a04('0x27')](_0x43e0e9)){if(!_0xf93cef[_0x43e0e9]){delete _0xd84452[_0x43e0e9];}}}}function freeIsNotKeyAgent(_0x184150,_0x3ee5dc){var _0x2c6753=_[_0x3a04('0x26')](_0x184150,function(_0x1dcb7d,_0x350765){var _0x2b8b6c=_[_0x3a04('0x2a')](_0x1dcb7d[_0x3a04('0x2b')])?util[_0x3a04('0x28')](_0x3a04('0x29'),_0x1dcb7d[_0x3a04('0x2c')]):_0x1dcb7d[_0x3a04('0x2b')];return _0x2b8b6c;});for(var _0x744f5e in _0x3ee5dc){if(_0x3ee5dc[_0x3a04('0x27')](_0x744f5e)){if(!_0x2c6753[_0x744f5e]){delete _0x3ee5dc[_0x744f5e];}}}}function clearVoiceCallReports(_0x1a4448){_0x1a4448[_0x3a04('0x2d')]=0x0;_0x1a4448[_0x3a04('0x2e')]=0x0;_0x1a4448['sumHoldTime']=0x0;_0x1a4448[_0x3a04('0x2f')]=0x0;_0x1a4448[_0x3a04('0x30')]=0x0;}function clearCampaigns(_0x11cd3c){if(!_[_0x3a04('0x31')](_0x11cd3c)){for(var _0x48502d in _0x11cd3c){if(_0x11cd3c[_0x3a04('0x27')](_0x48502d)){_0x11cd3c[_0x48502d]['ivrTotalCallsDays']=0x0;_0x11cd3c[_0x48502d][_0x3a04('0x32')]=0x0;}}}}function clearVoiceQueues(_0x619eb6){if(!_[_0x3a04('0x31')](_0x619eb6)){for(var _0x17a674 in _0x619eb6){if(_0x619eb6[_0x3a04('0x27')](_0x17a674)){_0x619eb6[_0x17a674]['total']=0x0;_0x619eb6[_0x17a674][_0x3a04('0x2e')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x33')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x34')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x35')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x2f')]=0x0;_0x619eb6[_0x17a674]['sumBillable']=0x0;_0x619eb6[_0x17a674][_0x3a04('0x36')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x37')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x38')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x39')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x3a')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x3b')]=0x0;_0x619eb6[_0x17a674]['outboundDropCallsDayTimeout']=0x0;_0x619eb6[_0x17a674][_0x3a04('0x3c')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x3d')]=0x0;_0x619eb6[_0x17a674]['outboundOriginateFailureCallsDay']=0x0;_0x619eb6[_0x17a674][_0x3a04('0x3e')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x3f')]=0x0;_0x619eb6[_0x17a674]['outboundAnswerAgiCallsDay']=0x0;_0x619eb6[_0x17a674][_0x3a04('0x40')]=0x0;_0x619eb6[_0x17a674][_0x3a04('0x41')]=!![];}}}}Realtime[_0x3a04('0x42')][_0x3a04('0x43')]=function(_0x5715d9,_0x338ae0){for(var _0x5c7aaf in _0x338ae0){if(_0x5715d9['hasOwnProperty'](_0x5c7aaf)){_0x5715d9[_0x5c7aaf]=_0x338ae0[_0x5c7aaf];}}};Realtime[_0x3a04('0x42')][_0x3a04('0x44')]=function(){var _0x29d8f8=this;return function(_0x59bdef){if(_0x59bdef){freeIsNotKeyAgent(_0x59bdef,_0x29d8f8[_0x3a04('0x45')]);for(var _0x1a4fc5=0x0,_0x1126b3={},_0x39f4cb={};_0x1a4fc5<_0x59bdef[_0x3a04('0x46')];_0x1a4fc5+=0x1){_0x1126b3=_0x59bdef[_0x1a4fc5];var _0xddb8c6=_[_0x3a04('0x2a')](_0x1126b3[_0x3a04('0x2b')])?util[_0x3a04('0x28')](_0x3a04('0x29'),_0x1126b3['name']):_0x1126b3[_0x3a04('0x2b')];if(_[_0x3a04('0x47')](_0x29d8f8[_0x3a04('0x45')][_0xddb8c6])){_0x29d8f8[_0x3a04('0x45')][_0xddb8c6]=new Agent(_0x1126b3);}else{_0x29d8f8['mergeFromDatabase'](_0x29d8f8[_0x3a04('0x45')][_0xddb8c6],_0x1126b3);}}}return _0x29d8f8[_0x3a04('0x45')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x48')]=function(){var _0x4be11e=this;return function(_0x5d53a5){if(_0x5d53a5){freeIsNotKeySip(_0x5d53a5,_0x4be11e[_0x3a04('0x14')]);for(var _0x102753=0x0,_0x5669a6={},_0x4a87f7={};_0x102753<_0x5d53a5['length'];_0x102753+=0x1){_0x5669a6=_0x5d53a5[_0x102753];if(_[_0x3a04('0x47')](_0x4be11e[_0x3a04('0x14')][util[_0x3a04('0x28')](_0x3a04('0x29'),_0x5669a6[_0x3a04('0x2c')])])){_0x4be11e[_0x3a04('0x14')][util['format'](_0x3a04('0x29'),_0x5669a6[_0x3a04('0x2c')])]=new Telephone(_0x5669a6);}else{_0x4be11e[_0x3a04('0x43')](_0x4be11e[_0x3a04('0x14')][util[_0x3a04('0x28')](_0x3a04('0x29'),_0x5669a6[_0x3a04('0x2c')])],_0x5669a6);}}}return _0x4be11e[_0x3a04('0x14')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x49')]=function(){var _0x2f7bdf=this;return function(_0x34cd9d){if(_0x34cd9d){freeIsNotKeySip(_0x34cd9d,_0x2f7bdf[_0x3a04('0x15')]);for(var _0x3770ea=0x0,_0x23b94b={},_0x1d1f7b={};_0x3770ea<_0x34cd9d[_0x3a04('0x46')];_0x3770ea+=0x1){_0x23b94b=_0x34cd9d[_0x3770ea];if(_[_0x3a04('0x47')](_0x2f7bdf['trunks'][util[_0x3a04('0x28')](_0x3a04('0x29'),_0x23b94b[_0x3a04('0x2c')])])){_0x2f7bdf['trunks'][util['format'](_0x3a04('0x29'),_0x23b94b[_0x3a04('0x2c')])]=new Trunk(_0x23b94b);}else{_0x2f7bdf[_0x3a04('0x43')](_0x2f7bdf[_0x3a04('0x15')][util[_0x3a04('0x28')](_0x3a04('0x29'),_0x23b94b[_0x3a04('0x2c')])],_0x23b94b);}}}return _0x2f7bdf[_0x3a04('0x15')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x4a')]=function(){var _0xa0aa34=this;return function(_0x260fab){if(_0x260fab){freeIsNotKey(_0x260fab,_0xa0aa34[_0x3a04('0x16')],_0x3a04('0x2c'));for(var _0x2de6ac=0x0,_0x5d01fd={},_0xcb0d2a={};_0x2de6ac<_0x260fab[_0x3a04('0x46')];_0x2de6ac+=0x1){_0x5d01fd=_0x260fab[_0x2de6ac];if(_['isUndefined'](_0xa0aa34[_0x3a04('0x16')][_0x5d01fd[_0x3a04('0x2c')]])){_0xa0aa34['voiceQueues'][_0x5d01fd[_0x3a04('0x2c')]]=new VoiceQueue(_0x5d01fd);}else{_0xa0aa34['mergeFromDatabase'](_0xa0aa34[_0x3a04('0x16')][_0x5d01fd['name']],_0x5d01fd);}}}return _0xa0aa34[_0x3a04('0x16')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x4b')]=function(){var _0x421b91=this;return function(_0x37f2e){if(_0x37f2e){freeIsNotKey(_0x37f2e,_0x421b91[_0x3a04('0x17')],'id');for(var _0x55bdb6=0x0,_0x181a4d={},_0x52abaa={};_0x55bdb6<_0x37f2e[_0x3a04('0x46')];_0x55bdb6+=0x1){_0x181a4d=_0x37f2e[_0x55bdb6];if(_[_0x3a04('0x47')](_0x421b91['triggers'][_0x181a4d['id']])){_0x421b91[_0x3a04('0x17')][_0x181a4d['id']]=new Trigger(_0x181a4d);}else{_0x421b91[_0x3a04('0x43')](_0x421b91[_0x3a04('0x17')][_0x181a4d['id']],_0x181a4d);}}}return _0x421b91['triggers'];};};Realtime[_0x3a04('0x42')][_0x3a04('0x4c')]=function(){var _0x1fab5e=this;return function(_0x1bc5cf){if(_0x1bc5cf){freeIsNotKey(_0x1bc5cf,_0x1fab5e['templates'],'id');for(var _0x168409=0x0,_0x12704d={},_0x142b4f={};_0x168409<_0x1bc5cf['length'];_0x168409+=0x1){_0x12704d=_0x1bc5cf[_0x168409];if(_['isUndefined'](_0x1fab5e[_0x3a04('0x19')][_0x12704d['id']])){_0x1fab5e[_0x3a04('0x19')][_0x12704d['id']]=new Template(_0x12704d);}else{_0x1fab5e[_0x3a04('0x43')](_0x1fab5e[_0x3a04('0x19')][_0x12704d['id']],_0x12704d);}}}return _0x1fab5e[_0x3a04('0x19')];};};Realtime['prototype'][_0x3a04('0x4d')]=function(){var _0x4d9f94=this;return function(_0x35d08d){if(_0x35d08d){freeIsNotKey(_0x35d08d,_0x4d9f94['zendeskAccounts'],'id');for(var _0x451939=0x0,_0xfc10e5={},_0x30f556={};_0x451939<_0x35d08d[_0x3a04('0x46')];_0x451939+=0x1){_0xfc10e5=_0x35d08d[_0x451939];if(_[_0x3a04('0x47')](_0x4d9f94[_0x3a04('0x1d')][_0xfc10e5['id']])){_0x4d9f94[_0x3a04('0x1d')][_0xfc10e5['id']]=new ZendeskAccount(_0xfc10e5);}else{_0x4d9f94['mergeFromDatabase'](_0x4d9f94[_0x3a04('0x1d')][_0xfc10e5['id']],_0xfc10e5);}}}return _0x4d9f94[_0x3a04('0x1d')];};};Realtime['prototype'][_0x3a04('0x4e')]=function(){var _0x501d80=this;return function(_0x11ac6e){if(_0x11ac6e){freeIsNotKey(_0x11ac6e,_0x501d80[_0x3a04('0x1e')],'id');for(var _0x4255cb=0x0,_0x7fda45={},_0xe394c3={};_0x4255cb<_0x11ac6e[_0x3a04('0x46')];_0x4255cb+=0x1){_0x7fda45=_0x11ac6e[_0x4255cb];if(_[_0x3a04('0x47')](_0x501d80[_0x3a04('0x1e')][_0x7fda45['id']])){_0x501d80[_0x3a04('0x1e')][_0x7fda45['id']]=new SalesforceAccount(_0x7fda45);}else{_0x501d80[_0x3a04('0x43')](_0x501d80[_0x3a04('0x1e')][_0x7fda45['id']],_0x7fda45);}}}return _0x501d80[_0x3a04('0x1e')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x4f')]=function(){var _0x9c8a0f=this;return function(_0x48b1ef){if(_0x48b1ef){freeIsNotKey(_0x48b1ef,_0x9c8a0f[_0x3a04('0x20')],'id');for(var _0xad33e9=0x0,_0x535cb8={},_0x52b964={};_0xad33e9<_0x48b1ef[_0x3a04('0x46')];_0xad33e9+=0x1){_0x535cb8=_0x48b1ef[_0xad33e9];if(_['isUndefined'](_0x9c8a0f[_0x3a04('0x20')][_0x535cb8['id']])){_0x9c8a0f[_0x3a04('0x20')][_0x535cb8['id']]=new FreshdeskAccount(_0x535cb8);}else{_0x9c8a0f[_0x3a04('0x43')](_0x9c8a0f[_0x3a04('0x20')][_0x535cb8['id']],_0x535cb8);}}}return _0x9c8a0f['freshdeskAccounts'];};};Realtime['prototype'][_0x3a04('0x50')]=function(){var _0x31824c=this;return function(_0x1f7219){if(_0x1f7219){freeIsNotKey(_0x1f7219,_0x31824c[_0x3a04('0x21')],'id');for(var _0x2a6117=0x0,_0x5b0f6e={},_0xec2bc2={};_0x2a6117<_0x1f7219[_0x3a04('0x46')];_0x2a6117+=0x1){_0x5b0f6e=_0x1f7219[_0x2a6117];if(_[_0x3a04('0x47')](_0x31824c[_0x3a04('0x21')][_0x5b0f6e['id']])){_0x31824c['zohoAccounts'][_0x5b0f6e['id']]=new ZohoAccount(_0x5b0f6e);}else{_0x31824c[_0x3a04('0x43')](_0x31824c[_0x3a04('0x21')][_0x5b0f6e['id']],_0x5b0f6e);}}}return _0x31824c[_0x3a04('0x21')];};};Realtime[_0x3a04('0x42')]['initDeskAccounts']=function(){var _0x1f8c56=this;return function(_0x3f6eb2){if(_0x3f6eb2){freeIsNotKey(_0x3f6eb2,_0x1f8c56[_0x3a04('0x51')],'id');for(var _0x3c25fb=0x0,_0x411f4a={},_0x56850a={};_0x3c25fb<_0x3f6eb2['length'];_0x3c25fb+=0x1){_0x411f4a=_0x3f6eb2[_0x3c25fb];if(_['isUndefined'](_0x1f8c56['deskAccounts'][_0x411f4a['id']])){_0x1f8c56['deskAccounts'][_0x411f4a['id']]=new DeskAccount(_0x411f4a);}else{_0x1f8c56[_0x3a04('0x43')](_0x1f8c56[_0x3a04('0x51')][_0x411f4a['id']],_0x411f4a);}}}return _0x1f8c56[_0x3a04('0x51')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x52')]=function(){var _0x4ca0ce=this;return function(_0x40b410){if(_0x40b410){freeIsNotKey(_0x40b410,_0x4ca0ce[_0x3a04('0x1f')],'id');for(var _0x15c3d8=0x0,_0xfc186={},_0x242688={};_0x15c3d8<_0x40b410[_0x3a04('0x46')];_0x15c3d8+=0x1){_0xfc186=_0x40b410[_0x15c3d8];if(_['isUndefined'](_0x4ca0ce[_0x3a04('0x1f')][_0xfc186['id']])){_0x4ca0ce['sugarcrmAccounts'][_0xfc186['id']]=new SugarcrmAccount(_0xfc186);}else{_0x4ca0ce['mergeFromDatabase'](_0x4ca0ce['sugarcrmAccounts'][_0xfc186['id']],_0xfc186);}}}return _0x4ca0ce[_0x3a04('0x1f')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x53')]=function(){var _0x35dc8f=this;return function(_0x36b8d4){if(_0x36b8d4){freeIsNotKey(_0x36b8d4,_0x35dc8f[_0x3a04('0x22')],'id');for(var _0x1a8b44=0x0,_0x11b00b={},_0x5bb1be={};_0x1a8b44<_0x36b8d4[_0x3a04('0x46')];_0x1a8b44+=0x1){_0x11b00b=_0x36b8d4[_0x1a8b44];if(_['isUndefined'](_0x35dc8f[_0x3a04('0x22')][_0x11b00b['id']])){_0x35dc8f[_0x3a04('0x22')][_0x11b00b['id']]=new VtigerAccount(_0x11b00b);}else{_0x35dc8f[_0x3a04('0x43')](_0x35dc8f[_0x3a04('0x22')][_0x11b00b['id']],_0x11b00b);}}}return _0x35dc8f[_0x3a04('0x22')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x54')]=function(){var _0x3d87f4=this;return function(_0x29cab8){if(_0x29cab8){freeIsNotKey(_0x29cab8,_0x3d87f4[_0x3a04('0x23')],'id');for(var _0x473ecd=0x0,_0x1a35bb={},_0x58d398={};_0x473ecd<_0x29cab8[_0x3a04('0x46')];_0x473ecd+=0x1){_0x1a35bb=_0x29cab8[_0x473ecd];if(_[_0x3a04('0x47')](_0x3d87f4[_0x3a04('0x23')][_0x1a35bb['id']])){_0x3d87f4[_0x3a04('0x23')][_0x1a35bb['id']]=new ServicenowAccount(_0x1a35bb);}else{_0x3d87f4[_0x3a04('0x43')](_0x3d87f4[_0x3a04('0x23')][_0x1a35bb['id']],_0x1a35bb);}}}return _0x3d87f4[_0x3a04('0x23')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x55')]=function(){var _0x4a46df=this;return function(_0x2c0a66){if(_0x2c0a66){freeIsNotKey(_0x2c0a66,_0x4a46df[_0x3a04('0x24')],'id');for(var _0x53d3f5=0x0,_0x157c01={},_0x424561={};_0x53d3f5<_0x2c0a66[_0x3a04('0x46')];_0x53d3f5+=0x1){_0x157c01=_0x2c0a66[_0x53d3f5];if(_[_0x3a04('0x47')](_0x4a46df[_0x3a04('0x24')][_0x157c01['id']])){_0x4a46df[_0x3a04('0x24')][_0x157c01['id']]=new Dynamics365Account(_0x157c01);}else{_0x4a46df[_0x3a04('0x43')](_0x4a46df[_0x3a04('0x24')][_0x157c01['id']],_0x157c01);}}}return _0x4a46df['dynamics365Accounts'];};};Realtime[_0x3a04('0x42')][_0x3a04('0x56')]=function(){var _0x2f58f8=this;return function(_0x7e0ebd){if(_0x7e0ebd){freeIsNotKey(_0x7e0ebd,_0x2f58f8[_0x3a04('0x25')],'id');for(var _0xdcacc5=0x0,_0x116066={},_0x109d8c={};_0xdcacc5<_0x7e0ebd[_0x3a04('0x46')];_0xdcacc5+=0x1){_0x116066=_0x7e0ebd[_0xdcacc5];if(_[_0x3a04('0x47')](_0x2f58f8[_0x3a04('0x25')][_0x116066['id']])){_0x2f58f8[_0x3a04('0x25')][_0x116066['id']]=new FreshsalesAccount(_0x116066);}else{_0x2f58f8[_0x3a04('0x43')](_0x2f58f8[_0x3a04('0x25')][_0x116066['id']],_0x116066);}}}return _0x2f58f8[_0x3a04('0x25')];};};Realtime['prototype'][_0x3a04('0x57')]=function(){var _0x44c8ac=this;return function(_0x37b5b4){for(var _0x4a0e1c=0x0;_0x4a0e1c<_0x37b5b4['length'];_0x4a0e1c+=0x1){_[_0x3a04('0x58')](_0x44c8ac['voiceQueues'][_0x37b5b4[_0x4a0e1c][_0x3a04('0x2c')]],_0x37b5b4[_0x4a0e1c]);}return _0x44c8ac['voiceQueues'];};};Realtime[_0x3a04('0x42')][_0x3a04('0x59')]=function(){var _0x3c9889=this;return function(_0x46bc03){clearVoiceQueues(_0x3c9889[_0x3a04('0x16')]);if(_0x46bc03){_0x46bc03=_['groupBy'](_0x46bc03,_0x3a04('0x5a'));for(var _0x551cd3 in _0x46bc03){if(_0x46bc03[_0x3a04('0x27')](_0x551cd3)){var _0x369538={};for(var _0x45641b=0x0;_0x45641b<_0x46bc03[_0x551cd3][_0x3a04('0x46')];_0x45641b+=0x1){var _0x40f474=_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x5b')];if(_0x3c9889['voiceQueues'][_0x40f474]){if(_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x5c')]){_0x3c9889[_0x3a04('0x16')][_0x40f474]['unmanaged']+=0x1;}if(_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x5d')]){_0x3c9889['voiceQueues'][_0x40f474][_0x3a04('0x34')]+=0x1;}_0x3c9889[_0x3a04('0x16')][_0x40f474][_0x3a04('0x35')]+=moment(_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x5e')])[_0x3a04('0x5f')](moment(_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x60')]),_0x3a04('0x61'))||0x0;if(_0x45641b===_0x46bc03[_0x551cd3][_0x3a04('0x46')]-0x1){_0x3c9889['voiceQueues'][_0x40f474][_0x3a04('0x2f')]+=moment(_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x62')]||_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x63')]||_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x64')])[_0x3a04('0x5f')](moment(_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x60')]),'seconds')||0x0;_0x3c9889[_0x3a04('0x16')][_0x40f474][_0x3a04('0x2d')]+=0x1;if(_0x46bc03[_0x551cd3][_0x45641b]['queuecallercomplete']){_0x3c9889['voiceQueues'][_0x40f474][_0x3a04('0x2e')]+=0x1;_0x3c9889['voiceQueues'][_0x40f474][_0x3a04('0x30')]+=moment(_0x46bc03[_0x551cd3][_0x45641b][_0x3a04('0x62')])[_0x3a04('0x5f')](moment(_0x46bc03[_0x551cd3][_0x45641b]['queuecallerleaveAt']),_0x3a04('0x61'))||0x0;}}else{_0x3c9889[_0x3a04('0x16')][_0x40f474][_0x3a04('0x2f')]+=_0x3c9889[_0x3a04('0x16')][_0x40f474][_0x3a04('0x35')]||0x0;}}}}}}return _0x3c9889[_0x3a04('0x16')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x65')]=function(){var _0x528d35=this;return function(_0x39209b){clearVoiceCallReports(_0x528d35[_0x3a04('0x1a')]);if(_0x39209b){for(var _0x3e058f=0x0;_0x3e058f<_0x39209b['length'];_0x3e058f+=0x1){_0x528d35['outbound']['total']+=0x1;_0x528d35['outbound'][_0x3a04('0x2f')]+=_0x39209b[_0x3e058f][_0x3a04('0x66')];if(_0x39209b[_0x3e058f][_0x3a04('0x67')]==='ANSWERED'){_0x528d35[_0x3a04('0x1a')][_0x3a04('0x2e')]+=0x1;_0x528d35[_0x3a04('0x1a')][_0x3a04('0x35')]+=_0x39209b[_0x3e058f]['duration']-_0x39209b[_0x3e058f][_0x3a04('0x68')]||0x0;_0x528d35[_0x3a04('0x1a')][_0x3a04('0x30')]+=_0x39209b[_0x3e058f]['billableseconds'];}}}return _0x528d35[_0x3a04('0x1a')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x69')]=function(){var _0x5b0778=this;return function(_0x652bc3){if(_0x652bc3){freeIsNotKey(_0x652bc3,_0x5b0778[_0x3a04('0x18')],_0x3a04('0x2c'));for(var _0x307b20=0x0,_0x294e0e={};_0x307b20<_0x652bc3['length'];_0x307b20+=0x1){_0x294e0e=_0x652bc3[_0x307b20];if(_[_0x3a04('0x47')](_0x5b0778['campaigns'][_0x294e0e[_0x3a04('0x2c')]])){_0x5b0778[_0x3a04('0x18')][_0x294e0e['name']]=new Campaign(_0x294e0e);}else{_0x5b0778[_0x3a04('0x43')](_0x5b0778[_0x3a04('0x18')][_0x294e0e['name']],_0x294e0e);_0x5b0778[_0x3a04('0x18')][_0x294e0e[_0x3a04('0x2c')]][_0x3a04('0x6a')]=_0x294e0e[_0x3a04('0x6b')]?_0x294e0e[_0x3a04('0x6b')][_0x3a04('0x2c')]:undefined;}}}return _0x5b0778[_0x3a04('0x18')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x6c')]=function(){var _0x13a7ae=this;return function(_0x539ea9){if(_0x539ea9){freeIsNotKey(_0x539ea9,_0x13a7ae[_0x3a04('0x6d')],'id');for(var _0x38d124=0x0,_0x558112={};_0x38d124<_0x539ea9[_0x3a04('0x46')];_0x38d124+=0x1){_0x558112=_0x539ea9[_0x38d124];if(_[_0x3a04('0x47')](_0x13a7ae['voiceExtensions'][_0x558112['id']])){_0x13a7ae[_0x3a04('0x6d')][_0x558112['id']]=new VoiceExtension(_0x558112);}else{_0x13a7ae['mergeFromDatabase'](_0x13a7ae[_0x3a04('0x6d')][_0x558112['id']],_0x558112);}}}return _0x13a7ae[_0x3a04('0x6d')];};};Realtime[_0x3a04('0x42')][_0x3a04('0x6e')]=function(){var _0x1f8c48=this;return function(_0x5422b3){clearCampaigns(_0x1f8c48[_0x3a04('0x18')]);for(var _0x48b385=0x0;_0x48b385<_0x5422b3['length'];_0x48b385+=0x1){_[_0x3a04('0x58')](_0x1f8c48[_0x3a04('0x18')][_0x5422b3[_0x48b385]['name']],_0x5422b3[_0x48b385]);}return _0x1f8c48['campaigns'];};};Realtime[_0x3a04('0x42')][_0x3a04('0x6f')]=function(){var _0x1a9908=this;return function(_0x2eeff1){if(_0x2eeff1){freeIsNotKey(_0x2eeff1,_0x1a9908[_0x3a04('0x70')],'id');for(var _0xf32e5=0x0,_0x477be3={},_0x410e27={};_0xf32e5<_0x2eeff1['length'];_0xf32e5+=0x1){_0x477be3=_0x2eeff1[_0xf32e5];if(_['isUndefined'](_0x1a9908[_0x3a04('0x70')][_0x477be3['id']])){_0x1a9908[_0x3a04('0x70')][_0x477be3['id']]=new FaxAccount(_0x477be3);}else{_0x1a9908[_0x3a04('0x43')](_0x1a9908[_0x3a04('0x70')][_0x477be3['id']],_0x477be3);}}}return _0x1a9908[_0x3a04('0x70')];};};module[_0x3a04('0x71')]=Realtime; \ No newline at end of file +var _0xe090=['initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerjoinAt','queuecallercomplete','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','lodash','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','deskAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','abandoned','sumHoldTime','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initZohoAccounts','zohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge'];(function(_0x44c04a,_0x3247a9){var _0xc62965=function(_0x307eb1){while(--_0x307eb1){_0x44c04a['push'](_0x44c04a['shift']());}};_0xc62965(++_0x3247a9);}(_0xe090,0x81));var _0x0e09=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xe090[_0x178e48];return _0x440d7e;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x0e09('0x0'));var moment=require('moment');var Agent=require(_0x0e09('0x1'));var Telephone=require(_0x0e09('0x2'));var Trunk=require(_0x0e09('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x0e09('0x4'));var Template=require(_0x0e09('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x0e09('0x6'));var ZendeskAccount=require(_0x0e09('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x0e09('0x8'));var DeskAccount=require(_0x0e09('0x9'));var VtigerAccount=require(_0x0e09('0xa'));var ServicenowAccount=require(_0x0e09('0xb'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x0e09('0xc'));var Realtime=function(){this[_0x0e09('0xd')]={};this[_0x0e09('0xe')]={};this[_0x0e09('0xf')]={};this[_0x0e09('0x10')]={};this[_0x0e09('0x11')]={};this['campaigns']={};this[_0x0e09('0x12')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x0e09('0x13')]={};this['channels']={};this[_0x0e09('0x14')]={};this[_0x0e09('0x15')]={};this[_0x0e09('0x16')]={};this[_0x0e09('0x17')]={};this[_0x0e09('0x18')]={};this[_0x0e09('0x19')]={};this['sugarcrmAccounts']={};this[_0x0e09('0x1a')]={};this['zohoAccounts']={};this[_0x0e09('0x1b')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x0e09('0x1c')]={};this[_0x0e09('0x1d')]={};this[_0x0e09('0x1e')]={};};function freeIsNotKey(_0x495443,_0x5c9ac1,_0x2d9adb){var _0x2bbdde=_[_0x0e09('0x1f')](_0x495443,function(_0x4e6462,_0x4606ac){return _0x4e6462[_0x2d9adb];});for(var _0x2cb6ac in _0x5c9ac1){if(_0x5c9ac1[_0x0e09('0x20')](_0x2cb6ac)){if(!_0x2bbdde[_0x2cb6ac]){delete _0x5c9ac1[_0x2cb6ac];}}}}function freeIsNotKeySip(_0x2e4ab0,_0x2ca39d){var _0x1a3ee3=_[_0x0e09('0x1f')](_0x2e4ab0,function(_0x55542b,_0x58b321){return util[_0x0e09('0x21')](_0x0e09('0x22'),_0x55542b[_0x0e09('0x23')]);});for(var _0x4c5a34 in _0x2ca39d){if(_0x2ca39d['hasOwnProperty'](_0x4c5a34)){if(!_0x1a3ee3[_0x4c5a34]){delete _0x2ca39d[_0x4c5a34];}}}}function freeIsNotKeyAgent(_0x5cbce6,_0x142305){var _0x26846b=_['mapKeys'](_0x5cbce6,function(_0x35e860,_0x5732a6){var _0x28cc76=_['isNil'](_0x35e860[_0x0e09('0x24')])?util[_0x0e09('0x21')](_0x0e09('0x22'),_0x35e860['name']):_0x35e860[_0x0e09('0x24')];return _0x28cc76;});for(var _0x3f8297 in _0x142305){if(_0x142305[_0x0e09('0x20')](_0x3f8297)){if(!_0x26846b[_0x3f8297]){delete _0x142305[_0x3f8297];}}}}function clearVoiceCallReports(_0x36d550){_0x36d550[_0x0e09('0x25')]=0x0;_0x36d550[_0x0e09('0x26')]=0x0;_0x36d550['sumHoldTime']=0x0;_0x36d550[_0x0e09('0x27')]=0x0;_0x36d550[_0x0e09('0x28')]=0x0;}function clearCampaigns(_0x18b5cb){if(!_[_0x0e09('0x29')](_0x18b5cb)){for(var _0x1c6077 in _0x18b5cb){if(_0x18b5cb[_0x0e09('0x20')](_0x1c6077)){_0x18b5cb[_0x1c6077]['ivrTotalCallsDays']=0x0;_0x18b5cb[_0x1c6077][_0x0e09('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x264e70){if(!_[_0x0e09('0x29')](_0x264e70)){for(var _0x4f5a08 in _0x264e70){if(_0x264e70['hasOwnProperty'](_0x4f5a08)){_0x264e70[_0x4f5a08]['total']=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x26')]=0x0;_0x264e70[_0x4f5a08]['unmanaged']=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x2b')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x2c')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x27')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x28')]=0x0;_0x264e70[_0x4f5a08]['outboundAnswerAgiCallsDay']=0x0;_0x264e70[_0x4f5a08]['outboundNoAnswerCallsDay']=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x2d')]=0x0;_0x264e70[_0x4f5a08]['outboundCongestionCallsDay']=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x2e')]=0x0;_0x264e70[_0x4f5a08]['outboundUnknownCallsDay']=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x2f')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x30')]=0x0;_0x264e70[_0x4f5a08]['outboundBlacklistCallsDay']=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x31')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x32')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x33')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x34')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x35')]=0x0;_0x264e70[_0x4f5a08][_0x0e09('0x36')]=!![];}}}}Realtime[_0x0e09('0x37')][_0x0e09('0x38')]=function(_0x5bc628,_0xd81089){for(var _0x5ca49a in _0xd81089){if(_0x5bc628[_0x0e09('0x20')](_0x5ca49a)){_0x5bc628[_0x5ca49a]=_0xd81089[_0x5ca49a];}}};Realtime['prototype'][_0x0e09('0x39')]=function(){var _0x4285af=this;return function(_0x29435b){if(_0x29435b){freeIsNotKeyAgent(_0x29435b,_0x4285af[_0x0e09('0xd')]);for(var _0x228681=0x0,_0x6ff5e4={},_0x8457a8={};_0x228681<_0x29435b[_0x0e09('0x3a')];_0x228681+=0x1){_0x6ff5e4=_0x29435b[_0x228681];var _0x4964f7=_[_0x0e09('0x3b')](_0x6ff5e4[_0x0e09('0x24')])?util[_0x0e09('0x21')](_0x0e09('0x22'),_0x6ff5e4[_0x0e09('0x23')]):_0x6ff5e4[_0x0e09('0x24')];if(_[_0x0e09('0x3c')](_0x4285af['agents'][_0x4964f7])){_0x4285af[_0x0e09('0xd')][_0x4964f7]=new Agent(_0x6ff5e4);}else{_0x4285af['mergeFromDatabase'](_0x4285af[_0x0e09('0xd')][_0x4964f7],_0x6ff5e4);}}}return _0x4285af['agents'];};};Realtime[_0x0e09('0x37')][_0x0e09('0x3d')]=function(){var _0x578550=this;return function(_0x1f2445){if(_0x1f2445){freeIsNotKeySip(_0x1f2445,_0x578550[_0x0e09('0xe')]);for(var _0x1554b2=0x0,_0x4d13e9={},_0x4da115={};_0x1554b2<_0x1f2445[_0x0e09('0x3a')];_0x1554b2+=0x1){_0x4d13e9=_0x1f2445[_0x1554b2];if(_['isUndefined'](_0x578550['telephones'][util['format'](_0x0e09('0x22'),_0x4d13e9[_0x0e09('0x23')])])){_0x578550[_0x0e09('0xe')][util[_0x0e09('0x21')](_0x0e09('0x22'),_0x4d13e9[_0x0e09('0x23')])]=new Telephone(_0x4d13e9);}else{_0x578550[_0x0e09('0x38')](_0x578550[_0x0e09('0xe')][util[_0x0e09('0x21')]('SIP/%s',_0x4d13e9[_0x0e09('0x23')])],_0x4d13e9);}}}return _0x578550[_0x0e09('0xe')];};};Realtime[_0x0e09('0x37')][_0x0e09('0x3e')]=function(){var _0x5ec30a=this;return function(_0x266bee){if(_0x266bee){freeIsNotKeySip(_0x266bee,_0x5ec30a['trunks']);for(var _0x2a23be=0x0,_0xccbb10={},_0x58b62f={};_0x2a23be<_0x266bee[_0x0e09('0x3a')];_0x2a23be+=0x1){_0xccbb10=_0x266bee[_0x2a23be];if(_['isUndefined'](_0x5ec30a[_0x0e09('0xf')][util['format'](_0x0e09('0x22'),_0xccbb10[_0x0e09('0x23')])])){_0x5ec30a[_0x0e09('0xf')][util['format'](_0x0e09('0x22'),_0xccbb10['name'])]=new Trunk(_0xccbb10);}else{_0x5ec30a[_0x0e09('0x38')](_0x5ec30a[_0x0e09('0xf')][util['format'](_0x0e09('0x22'),_0xccbb10['name'])],_0xccbb10);}}}return _0x5ec30a[_0x0e09('0xf')];};};Realtime[_0x0e09('0x37')][_0x0e09('0x3f')]=function(){var _0x478dee=this;return function(_0x50bed7){if(_0x50bed7){freeIsNotKey(_0x50bed7,_0x478dee[_0x0e09('0x10')],'name');for(var _0x24beaf=0x0,_0x19bc8c={},_0x14cb06={};_0x24beaf<_0x50bed7[_0x0e09('0x3a')];_0x24beaf+=0x1){_0x19bc8c=_0x50bed7[_0x24beaf];if(_[_0x0e09('0x3c')](_0x478dee[_0x0e09('0x10')][_0x19bc8c[_0x0e09('0x23')]])){_0x478dee[_0x0e09('0x10')][_0x19bc8c[_0x0e09('0x23')]]=new VoiceQueue(_0x19bc8c);}else{_0x478dee['mergeFromDatabase'](_0x478dee[_0x0e09('0x10')][_0x19bc8c[_0x0e09('0x23')]],_0x19bc8c);}}}return _0x478dee[_0x0e09('0x10')];};};Realtime[_0x0e09('0x37')][_0x0e09('0x40')]=function(){var _0x5b6c04=this;return function(_0x1126cf){if(_0x1126cf){freeIsNotKey(_0x1126cf,_0x5b6c04[_0x0e09('0x11')],'id');for(var _0x5f44f6=0x0,_0x278814={},_0x482b46={};_0x5f44f6<_0x1126cf[_0x0e09('0x3a')];_0x5f44f6+=0x1){_0x278814=_0x1126cf[_0x5f44f6];if(_[_0x0e09('0x3c')](_0x5b6c04[_0x0e09('0x11')][_0x278814['id']])){_0x5b6c04['triggers'][_0x278814['id']]=new Trigger(_0x278814);}else{_0x5b6c04['mergeFromDatabase'](_0x5b6c04[_0x0e09('0x11')][_0x278814['id']],_0x278814);}}}return _0x5b6c04['triggers'];};};Realtime[_0x0e09('0x37')][_0x0e09('0x41')]=function(){var _0x4b1094=this;return function(_0x583d89){if(_0x583d89){freeIsNotKey(_0x583d89,_0x4b1094[_0x0e09('0x12')],'id');for(var _0x5b67c5=0x0,_0x589085={},_0x537d58={};_0x5b67c5<_0x583d89[_0x0e09('0x3a')];_0x5b67c5+=0x1){_0x589085=_0x583d89[_0x5b67c5];if(_['isUndefined'](_0x4b1094[_0x0e09('0x12')][_0x589085['id']])){_0x4b1094[_0x0e09('0x12')][_0x589085['id']]=new Template(_0x589085);}else{_0x4b1094[_0x0e09('0x38')](_0x4b1094[_0x0e09('0x12')][_0x589085['id']],_0x589085);}}}return _0x4b1094[_0x0e09('0x12')];};};Realtime['prototype'][_0x0e09('0x42')]=function(){var _0x5ab64d=this;return function(_0x269945){if(_0x269945){freeIsNotKey(_0x269945,_0x5ab64d[_0x0e09('0x18')],'id');for(var _0xec7563=0x0,_0x221a13={},_0x4baa15={};_0xec7563<_0x269945[_0x0e09('0x3a')];_0xec7563+=0x1){_0x221a13=_0x269945[_0xec7563];if(_[_0x0e09('0x3c')](_0x5ab64d[_0x0e09('0x18')][_0x221a13['id']])){_0x5ab64d[_0x0e09('0x18')][_0x221a13['id']]=new ZendeskAccount(_0x221a13);}else{_0x5ab64d[_0x0e09('0x38')](_0x5ab64d[_0x0e09('0x18')][_0x221a13['id']],_0x221a13);}}}return _0x5ab64d[_0x0e09('0x18')];};};Realtime[_0x0e09('0x37')]['initSalesforceAccounts']=function(){var _0x528bcf=this;return function(_0x5a33b6){if(_0x5a33b6){freeIsNotKey(_0x5a33b6,_0x528bcf[_0x0e09('0x19')],'id');for(var _0x484942=0x0,_0x519737={},_0x2e7e0d={};_0x484942<_0x5a33b6[_0x0e09('0x3a')];_0x484942+=0x1){_0x519737=_0x5a33b6[_0x484942];if(_[_0x0e09('0x3c')](_0x528bcf[_0x0e09('0x19')][_0x519737['id']])){_0x528bcf[_0x0e09('0x19')][_0x519737['id']]=new SalesforceAccount(_0x519737);}else{_0x528bcf[_0x0e09('0x38')](_0x528bcf['salesforceAccounts'][_0x519737['id']],_0x519737);}}}return _0x528bcf[_0x0e09('0x19')];};};Realtime[_0x0e09('0x37')]['initFreshdeskAccounts']=function(){var _0x495821=this;return function(_0x3df8ec){if(_0x3df8ec){freeIsNotKey(_0x3df8ec,_0x495821[_0x0e09('0x1a')],'id');for(var _0x2dc0f5=0x0,_0xd07db1={},_0x144d3c={};_0x2dc0f5<_0x3df8ec[_0x0e09('0x3a')];_0x2dc0f5+=0x1){_0xd07db1=_0x3df8ec[_0x2dc0f5];if(_[_0x0e09('0x3c')](_0x495821[_0x0e09('0x1a')][_0xd07db1['id']])){_0x495821[_0x0e09('0x1a')][_0xd07db1['id']]=new FreshdeskAccount(_0xd07db1);}else{_0x495821[_0x0e09('0x38')](_0x495821['freshdeskAccounts'][_0xd07db1['id']],_0xd07db1);}}}return _0x495821[_0x0e09('0x1a')];};};Realtime[_0x0e09('0x37')][_0x0e09('0x43')]=function(){var _0x271e7e=this;return function(_0x4a60f6){if(_0x4a60f6){freeIsNotKey(_0x4a60f6,_0x271e7e[_0x0e09('0x44')],'id');for(var _0x133baf=0x0,_0x4a409b={},_0x505699={};_0x133baf<_0x4a60f6[_0x0e09('0x3a')];_0x133baf+=0x1){_0x4a409b=_0x4a60f6[_0x133baf];if(_[_0x0e09('0x3c')](_0x271e7e[_0x0e09('0x44')][_0x4a409b['id']])){_0x271e7e[_0x0e09('0x44')][_0x4a409b['id']]=new ZohoAccount(_0x4a409b);}else{_0x271e7e[_0x0e09('0x38')](_0x271e7e[_0x0e09('0x44')][_0x4a409b['id']],_0x4a409b);}}}return _0x271e7e[_0x0e09('0x44')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x1276a6=this;return function(_0x4ec316){if(_0x4ec316){freeIsNotKey(_0x4ec316,_0x1276a6[_0x0e09('0x1b')],'id');for(var _0x1c9bc4=0x0,_0x2de238={},_0x577693={};_0x1c9bc4<_0x4ec316[_0x0e09('0x3a')];_0x1c9bc4+=0x1){_0x2de238=_0x4ec316[_0x1c9bc4];if(_[_0x0e09('0x3c')](_0x1276a6[_0x0e09('0x1b')][_0x2de238['id']])){_0x1276a6[_0x0e09('0x1b')][_0x2de238['id']]=new DeskAccount(_0x2de238);}else{_0x1276a6[_0x0e09('0x38')](_0x1276a6[_0x0e09('0x1b')][_0x2de238['id']],_0x2de238);}}}return _0x1276a6[_0x0e09('0x1b')];};};Realtime['prototype'][_0x0e09('0x45')]=function(){var _0x4f0ff1=this;return function(_0x555b85){if(_0x555b85){freeIsNotKey(_0x555b85,_0x4f0ff1[_0x0e09('0x46')],'id');for(var _0x1e9268=0x0,_0x39bd84={},_0x3b083e={};_0x1e9268<_0x555b85['length'];_0x1e9268+=0x1){_0x39bd84=_0x555b85[_0x1e9268];if(_[_0x0e09('0x3c')](_0x4f0ff1[_0x0e09('0x46')][_0x39bd84['id']])){_0x4f0ff1[_0x0e09('0x46')][_0x39bd84['id']]=new SugarcrmAccount(_0x39bd84);}else{_0x4f0ff1['mergeFromDatabase'](_0x4f0ff1[_0x0e09('0x46')][_0x39bd84['id']],_0x39bd84);}}}return _0x4f0ff1['sugarcrmAccounts'];};};Realtime[_0x0e09('0x37')]['initVtigerAccounts']=function(){var _0x362b91=this;return function(_0xf456d8){if(_0xf456d8){freeIsNotKey(_0xf456d8,_0x362b91[_0x0e09('0x47')],'id');for(var _0x32603d=0x0,_0x224f88={},_0x2e2860={};_0x32603d<_0xf456d8[_0x0e09('0x3a')];_0x32603d+=0x1){_0x224f88=_0xf456d8[_0x32603d];if(_['isUndefined'](_0x362b91[_0x0e09('0x47')][_0x224f88['id']])){_0x362b91[_0x0e09('0x47')][_0x224f88['id']]=new VtigerAccount(_0x224f88);}else{_0x362b91[_0x0e09('0x38')](_0x362b91[_0x0e09('0x47')][_0x224f88['id']],_0x224f88);}}}return _0x362b91[_0x0e09('0x47')];};};Realtime['prototype'][_0x0e09('0x48')]=function(){var _0x5b08be=this;return function(_0x369c04){if(_0x369c04){freeIsNotKey(_0x369c04,_0x5b08be[_0x0e09('0x49')],'id');for(var _0x442881=0x0,_0x2e9b14={},_0x535da1={};_0x442881<_0x369c04[_0x0e09('0x3a')];_0x442881+=0x1){_0x2e9b14=_0x369c04[_0x442881];if(_[_0x0e09('0x3c')](_0x5b08be['servicenowAccounts'][_0x2e9b14['id']])){_0x5b08be[_0x0e09('0x49')][_0x2e9b14['id']]=new ServicenowAccount(_0x2e9b14);}else{_0x5b08be[_0x0e09('0x38')](_0x5b08be[_0x0e09('0x49')][_0x2e9b14['id']],_0x2e9b14);}}}return _0x5b08be[_0x0e09('0x49')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x39a675=this;return function(_0x541332){if(_0x541332){freeIsNotKey(_0x541332,_0x39a675[_0x0e09('0x1c')],'id');for(var _0x4efee7=0x0,_0x4b2314={},_0x502c58={};_0x4efee7<_0x541332[_0x0e09('0x3a')];_0x4efee7+=0x1){_0x4b2314=_0x541332[_0x4efee7];if(_[_0x0e09('0x3c')](_0x39a675['dynamics365Accounts'][_0x4b2314['id']])){_0x39a675[_0x0e09('0x1c')][_0x4b2314['id']]=new Dynamics365Account(_0x4b2314);}else{_0x39a675[_0x0e09('0x38')](_0x39a675[_0x0e09('0x1c')][_0x4b2314['id']],_0x4b2314);}}}return _0x39a675[_0x0e09('0x1c')];};};Realtime[_0x0e09('0x37')][_0x0e09('0x4a')]=function(){var _0x5c88e7=this;return function(_0x5f7d6f){if(_0x5f7d6f){freeIsNotKey(_0x5f7d6f,_0x5c88e7[_0x0e09('0x1d')],'id');for(var _0x135242=0x0,_0x4f6e95={},_0x663541={};_0x135242<_0x5f7d6f[_0x0e09('0x3a')];_0x135242+=0x1){_0x4f6e95=_0x5f7d6f[_0x135242];if(_[_0x0e09('0x3c')](_0x5c88e7[_0x0e09('0x1d')][_0x4f6e95['id']])){_0x5c88e7[_0x0e09('0x1d')][_0x4f6e95['id']]=new FreshsalesAccount(_0x4f6e95);}else{_0x5c88e7['mergeFromDatabase'](_0x5c88e7[_0x0e09('0x1d')][_0x4f6e95['id']],_0x4f6e95);}}}return _0x5c88e7[_0x0e09('0x1d')];};};Realtime[_0x0e09('0x37')][_0x0e09('0x4b')]=function(){var _0x1d957f=this;return function(_0xa14ec9){for(var _0x1924dc=0x0;_0x1924dc<_0xa14ec9[_0x0e09('0x3a')];_0x1924dc+=0x1){_[_0x0e09('0x4c')](_0x1d957f['voiceQueues'][_0xa14ec9[_0x1924dc][_0x0e09('0x23')]],_0xa14ec9[_0x1924dc]);}return _0x1d957f['voiceQueues'];};};Realtime[_0x0e09('0x37')][_0x0e09('0x4d')]=function(){var _0x308408=this;return function(_0x53553f){clearVoiceQueues(_0x308408[_0x0e09('0x10')]);if(_0x53553f){_0x53553f=_[_0x0e09('0x4e')](_0x53553f,_0x0e09('0x4f'));for(var _0x123306 in _0x53553f){if(_0x53553f['hasOwnProperty'](_0x123306)){var _0x145a8d={};for(var _0x22addb=0x0;_0x22addb<_0x53553f[_0x123306][_0x0e09('0x3a')];_0x22addb+=0x1){var _0x48059f=_0x53553f[_0x123306][_0x22addb]['queue'];if(_0x308408[_0x0e09('0x10')][_0x48059f]){if(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x50')]){_0x308408[_0x0e09('0x10')][_0x48059f][_0x0e09('0x51')]+=0x1;}if(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x52')]){_0x308408[_0x0e09('0x10')][_0x48059f][_0x0e09('0x2b')]+=0x1;}_0x308408[_0x0e09('0x10')][_0x48059f]['sumHoldTime']+=moment(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x53')])[_0x0e09('0x54')](moment(_0x53553f[_0x123306][_0x22addb]['queuecallerjoinAt']),_0x0e09('0x55'))||0x0;if(_0x22addb===_0x53553f[_0x123306][_0x0e09('0x3a')]-0x1){_0x308408[_0x0e09('0x10')][_0x48059f]['sumDuration']+=moment(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x56')]||_0x53553f[_0x123306][_0x22addb][_0x0e09('0x57')]||_0x53553f[_0x123306][_0x22addb]['queuecallerexitAt'])[_0x0e09('0x54')](moment(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x58')]),_0x0e09('0x55'))||0x0;_0x308408[_0x0e09('0x10')][_0x48059f][_0x0e09('0x25')]+=0x1;if(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x59')]){_0x308408['voiceQueues'][_0x48059f][_0x0e09('0x26')]+=0x1;_0x308408[_0x0e09('0x10')][_0x48059f][_0x0e09('0x28')]+=moment(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x56')])[_0x0e09('0x54')](moment(_0x53553f[_0x123306][_0x22addb][_0x0e09('0x53')]),_0x0e09('0x55'))||0x0;}}else{_0x308408[_0x0e09('0x10')][_0x48059f][_0x0e09('0x27')]+=_0x308408['voiceQueues'][_0x48059f][_0x0e09('0x2c')]||0x0;}}}}}}return _0x308408['voiceQueues'];};};Realtime[_0x0e09('0x37')]['initVoiceCallReports']=function(){var _0x517f3e=this;return function(_0x117f8a){clearVoiceCallReports(_0x517f3e['outbound']);if(_0x117f8a){for(var _0xd1e8d1=0x0;_0xd1e8d1<_0x117f8a[_0x0e09('0x3a')];_0xd1e8d1+=0x1){_0x517f3e[_0x0e09('0x5a')]['total']+=0x1;_0x517f3e['outbound']['sumDuration']+=_0x117f8a[_0xd1e8d1][_0x0e09('0x5b')];if(_0x117f8a[_0xd1e8d1][_0x0e09('0x5c')]===_0x0e09('0x5d')){_0x517f3e[_0x0e09('0x5a')][_0x0e09('0x26')]+=0x1;_0x517f3e[_0x0e09('0x5a')]['sumHoldTime']+=_0x117f8a[_0xd1e8d1][_0x0e09('0x5b')]-_0x117f8a[_0xd1e8d1][_0x0e09('0x5e')]||0x0;_0x517f3e['outbound'][_0x0e09('0x28')]+=_0x117f8a[_0xd1e8d1][_0x0e09('0x5e')];}}}return _0x517f3e[_0x0e09('0x5a')];};};Realtime['prototype'][_0x0e09('0x5f')]=function(){var _0x413c6f=this;return function(_0x268413){if(_0x268413){freeIsNotKey(_0x268413,_0x413c6f[_0x0e09('0x60')],_0x0e09('0x23'));for(var _0x3283c1=0x0,_0x34d820={};_0x3283c1<_0x268413[_0x0e09('0x3a')];_0x3283c1+=0x1){_0x34d820=_0x268413[_0x3283c1];if(_[_0x0e09('0x3c')](_0x413c6f[_0x0e09('0x60')][_0x34d820['name']])){_0x413c6f['campaigns'][_0x34d820[_0x0e09('0x23')]]=new Campaign(_0x34d820);}else{_0x413c6f['mergeFromDatabase'](_0x413c6f['campaigns'][_0x34d820[_0x0e09('0x23')]],_0x34d820);_0x413c6f['campaigns'][_0x34d820['name']][_0x0e09('0x61')]=_0x34d820[_0x0e09('0x62')]?_0x34d820['SquareProject'][_0x0e09('0x23')]:undefined;}}}return _0x413c6f[_0x0e09('0x60')];};};Realtime['prototype'][_0x0e09('0x63')]=function(){var _0x8fa754=this;return function(_0x16bc23){if(_0x16bc23){freeIsNotKey(_0x16bc23,_0x8fa754[_0x0e09('0x13')],'id');for(var _0x5a2c83=0x0,_0x4d4688={};_0x5a2c83<_0x16bc23[_0x0e09('0x3a')];_0x5a2c83+=0x1){_0x4d4688=_0x16bc23[_0x5a2c83];if(_[_0x0e09('0x3c')](_0x8fa754[_0x0e09('0x13')][_0x4d4688['id']])){_0x8fa754['voiceExtensions'][_0x4d4688['id']]=new VoiceExtension(_0x4d4688);}else{_0x8fa754[_0x0e09('0x38')](_0x8fa754[_0x0e09('0x13')][_0x4d4688['id']],_0x4d4688);}}}return _0x8fa754[_0x0e09('0x13')];};};Realtime[_0x0e09('0x37')][_0x0e09('0x64')]=function(){var _0x32fd56=this;return function(_0x1ec351){clearCampaigns(_0x32fd56[_0x0e09('0x60')]);for(var _0x206f98=0x0;_0x206f98<_0x1ec351[_0x0e09('0x3a')];_0x206f98+=0x1){_[_0x0e09('0x4c')](_0x32fd56[_0x0e09('0x60')][_0x1ec351[_0x206f98][_0x0e09('0x23')]],_0x1ec351[_0x206f98]);}return _0x32fd56[_0x0e09('0x60')];};};Realtime['prototype'][_0x0e09('0x65')]=function(){var _0x21d2ca=this;return function(_0x93b167){if(_0x93b167){freeIsNotKey(_0x93b167,_0x21d2ca[_0x0e09('0x1e')],'id');for(var _0x1a0fcd=0x0,_0x501753={},_0x14a1c3={};_0x1a0fcd<_0x93b167[_0x0e09('0x3a')];_0x1a0fcd+=0x1){_0x501753=_0x93b167[_0x1a0fcd];if(_[_0x0e09('0x3c')](_0x21d2ca[_0x0e09('0x1e')][_0x501753['id']])){_0x21d2ca[_0x0e09('0x1e')][_0x501753['id']]=new FaxAccount(_0x501753);}else{_0x21d2ca[_0x0e09('0x38')](_0x21d2ca[_0x0e09('0x1e')][_0x501753['id']],_0x501753);}}}return _0x21d2ca[_0x0e09('0x1e')];};};module[_0x0e09('0x66')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 929cf17..9a43394 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 _0x0e1b=['createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','lodash','moment','util','../../../config/environment','../rpc/voiceCallReport','../rpc/memberReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','format','connectedlinenum','interface','isNil','SIP/%s','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','length','getCallType','channel','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','calleridname','transfers','linkedid','uniqueid','UserId','split','membername','monitor','monitors','monitorFilename'];(function(_0x91a997,_0x411892){var _0x2ee914=function(_0x5443a5){while(--_0x5443a5){_0x91a997['push'](_0x91a997['shift']());}};_0x2ee914(++_0x411892);}(_0x0e1b,0x1c5));var _0xb0e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0e1b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb0e1('0x0'));var moment=require(_0xb0e1('0x1'));var util=require(_0xb0e1('0x2'));var config=require(_0xb0e1('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xb0e1('0x4'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xb0e1('0x5'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xb0e1('0x6'));var VoiceAgentReport=require(_0xb0e1('0x7'));var VoiceDialReport=require(_0xb0e1('0x8'));var UserReport=require(_0xb0e1('0x9'));function Report(_0xe370fb){this['realtime']=_0xe370fb;this[_0xb0e1('0xa')]=_0xe370fb[_0xb0e1('0xa')];this['telephones']=_0xe370fb[_0xb0e1('0xb')];}Report['prototype'][_0xb0e1('0xc')]=function(_0x536c8b){var _0x4a2cf9=new VoiceQueueReport(this[_0xb0e1('0xd')]);var _0x11d996=new VoiceAgentReport(this[_0xb0e1('0xd')]);var _0x5e01fc=new VoiceDialReport(this['realtime']);var _0x5164ac=new VoiceCallReport(this['realtime']);var _0x31a0a6=new UserReport(this[_0xb0e1('0xd')]);if(config[_0xb0e1('0xe')]&&config['xdr'][_0xb0e1('0xf')]){ami['on'](_0xb0e1('0x10'),this[_0xb0e1('0x11')][_0xb0e1('0x12')](this));ami['on'](_0xb0e1('0x13'),this[_0xb0e1('0x14')][_0xb0e1('0x12')](this));ami['on'](_0xb0e1('0x15'),this[_0xb0e1('0x16')][_0xb0e1('0x12')](this));ami['on'](_0xb0e1('0x17'),this[_0xb0e1('0x18')][_0xb0e1('0x12')](this));ami['on']('blindtransfer',this[_0xb0e1('0x19')][_0xb0e1('0x12')](this));ami['on'](_0xb0e1('0x1a'),this[_0xb0e1('0x1b')][_0xb0e1('0x12')](this));}};Report[_0xb0e1('0x1c')][_0xb0e1('0x1d')]=function(_0x3dcecf){var _0x55f6be;_0x55f6be=_[_0xb0e1('0x1e')](this[_0xb0e1('0xa')],function(_0x2422a0){return _0x2422a0[_0xb0e1('0x1f')]==_0x3dcecf||_0x2422a0[_0xb0e1('0x20')]==_0x3dcecf;});if(_['isNil'](_0x55f6be)){var _0x4aabdd=_[_0xb0e1('0x1e')](this[_0xb0e1('0xb')],function(_0x280854){return _0x280854[_0xb0e1('0x1f')]==_0x3dcecf||_0x280854[_0xb0e1('0x20')]==_0x3dcecf;});if(_0x4aabdd){_0x55f6be=_[_0xb0e1('0x1e')](this[_0xb0e1('0xa')],function(_0x35dfde){return _0x35dfde['interface']==util[_0xb0e1('0x21')]('SIP/%s',_0x4aabdd[_0xb0e1('0x20')]);});}}return _0x55f6be;};Report[_0xb0e1('0x1c')][_0xb0e1('0x11')]=function(_0xc42653){for(var _0x2ca278=0x0;_0x2ca278<_0xc42653['length'];_0x2ca278+=0x1){var _0x1eda49=this[_0xb0e1('0x1d')](_0xc42653[_0x2ca278][_0xb0e1('0x22')]);if(_0x1eda49){_0xc42653[_0x2ca278][_0xb0e1('0x1f')]=_0x1eda49['accountcode'];_0xc42653[_0x2ca278]['assigned']=!![];_0xc42653[_0x2ca278]['lastAssignedTo']=_0x1eda49[_0xb0e1('0x20')];_0xc42653[_0x2ca278][_0xb0e1('0x23')]=_[_0xb0e1('0x24')](_0x1eda49['interface'])?util[_0xb0e1('0x21')](_0xb0e1('0x25'),_0x1eda49[_0xb0e1('0x20')]):_0x1eda49[_0xb0e1('0x23')];if(_0xc42653[_0x2ca278][_0xb0e1('0x26')]){_0xc42653[_0x2ca278]['queuecallercompleteAt']=moment()[_0xb0e1('0x21')](_0xb0e1('0x27'));}if(_0xc42653[_0x2ca278]['queuecallerexit']){_0xc42653[_0x2ca278][_0xb0e1('0x28')]=moment()[_0xb0e1('0x21')](_0xb0e1('0x27'));}RpcMemberReport[_0xb0e1('0x11')](_0xc42653[_0x2ca278]);}RpcVoiceQueueReport[_0xb0e1('0x29')](_0xc42653[_0x2ca278]);}};function extractCalleridNumber(_0xa9f5ae){var _0x507dcf=_0xa9f5ae[_0xb0e1('0x2a')](/<(.*?)>/);return _0x507dcf?_0x507dcf[0x1]:_0xa9f5ae;}Report[_0xb0e1('0x1c')][_0xb0e1('0x2b')]=function(_0xdb51e){for(var _0x2e8034=0x0;_0x2e8034',_0x2fa44f[_0xb0e1('0x41')],_0x2fa44f[_0xb0e1('0x30')]);}if(RpcVoiceTransferReport['transfers'][_0x2fa44f['linkedid']]){var _0x50c9de=RpcVoiceTransferReport[_0xb0e1('0x42')][_0x2fa44f[_0xb0e1('0x43')]];_0x50c9de['transfereelinkedid']=_0x2fa44f[_0xb0e1('0x44')];RpcVoiceTransferReport[_0xb0e1('0x19')](_0x50c9de);delete RpcVoiceTransferReport[_0xb0e1('0x42')][_0x2fa44f[_0xb0e1('0x43')]];}if(_['isNil'](_0x2fa44f[_0xb0e1('0x35')])){_0x2fa44f[_0xb0e1('0x35')]=this[_0xb0e1('0x2e')](_0x2fa44f);}if(_[_0xb0e1('0x24')](_0x2fa44f[_0xb0e1('0x45')])){var _0x389105=_0x2fa44f['channel'][_0xb0e1('0x46')]('-')[0x0];var _0x11ddf2=this['agents'][_0x389105];if(!_0x11ddf2)_0x11ddf2=this[_0xb0e1('0x2b')](_0x2fa44f[_0xb0e1('0x1f')]);if(_0x11ddf2){_0x2fa44f[_0xb0e1('0x45')]=_0x11ddf2['id'];_0x2fa44f[_0xb0e1('0x47')]=_0x11ddf2[_0xb0e1('0x20')];}}RpcVoiceCallReport[_0xb0e1('0x29')](_0x2fa44f);if(_0x2fa44f[_0xb0e1('0x48')]){for(var _0x2d9071=0x0;_0x2d9071<_0x2fa44f[_0xb0e1('0x49')]['length'];_0x2d9071+=0x1){_0x2fa44f[_0xb0e1('0x4a')]=_0x2fa44f[_0xb0e1('0x49')][_0x2d9071]['filename'];_0x2fa44f[_0xb0e1('0x4b')]=_0x2fa44f[_0xb0e1('0x49')][_0x2d9071][_0xb0e1('0x4b')];if(_0x2fa44f[_0xb0e1('0x34')]==_0xb0e1('0x3c')){_0x2fa44f[_0xb0e1('0x30')]=_0x2fa44f[_0xb0e1('0x22')];_0x2fa44f[_0xb0e1('0x41')]=_0x2fa44f['connectedlinename'];_0x2fa44f[_0xb0e1('0x22')]=_0x2fa44f[_0xb0e1('0x1f')];_0x2fa44f[_0xb0e1('0x4c')]=_0x2fa44f[_0xb0e1('0x47')];_0x2fa44f[_0xb0e1('0x34')]=_0x2fa44f[_0xb0e1('0x3e')];}else if(_0x2fa44f[_0xb0e1('0x34')]==_0xb0e1('0x4d')){_0x2fa44f[_0xb0e1('0x30')]=_0x2fa44f[_0xb0e1('0x33')];_0x2fa44f[_0xb0e1('0x34')]=_0x2fa44f[_0xb0e1('0x3e')];}RpcVoiceRecording[_0xb0e1('0x29')](_0x2fa44f);}}};Report['prototype'][_0xb0e1('0x16')]=function(_0x454545){if(_[_0xb0e1('0x4e')](_0x454545)){_0x454545[_0xb0e1('0x4f')](function(_0x106f7f){RpcVoiceAgentReport[_0xb0e1('0x29')](_0x106f7f);});}else{RpcVoiceAgentReport[_0xb0e1('0x29')](_0x454545);}};Report[_0xb0e1('0x1c')][_0xb0e1('0x18')]=function(_0x5760a2){RpcVoiceDialReport[_0xb0e1('0x29')](_0x5760a2);var _0x2fea78;var _0x1365e9;var _0x497a33=_0x5760a2[_0xb0e1('0x2f')];if(_[_0xb0e1('0x50')](_0x497a33,_0xb0e1('0x51'))){_0x1365e9=_0x497a33[_0xb0e1('0x52')](_0x497a33[_0xb0e1('0x53')]('/')+0x1,_0x497a33[_0xb0e1('0x53')]('@'));_0x2fea78=_[_0xb0e1('0x1e')](this[_0xb0e1('0xa')],function(_0x379096){return _0x379096[_0xb0e1('0x54')]==_0x1365e9||_0x379096[_0xb0e1('0x55')]==_0x1365e9||_0x379096[_0xb0e1('0x1f')]==_0x1365e9;});}else{_0x1365e9=_0x497a33[_0xb0e1('0x52')](_0x497a33[_0xb0e1('0x53')]('/')+0x1,_0x497a33[_0xb0e1('0x56')]('-'));_0x2fea78=this[_0xb0e1('0x1d')](_0x1365e9);}if(_0x2fea78){_0x5760a2['interface']=_[_0xb0e1('0x24')](_0x2fea78[_0xb0e1('0x23')])?util[_0xb0e1('0x21')](_0xb0e1('0x25'),_0x2fea78[_0xb0e1('0x20')]):_0x2fea78[_0xb0e1('0x23')];_0x5760a2[_0xb0e1('0x47')]=_0x2fea78[_0xb0e1('0x20')];_0x5760a2[_0xb0e1('0x1f')]=_0x2fea78[_0xb0e1('0x1f')];RpcMemberReport[_0xb0e1('0x18')](_0x5760a2);}};Report[_0xb0e1('0x1c')][_0xb0e1('0x19')]=function(_0x4a66be){RpcVoiceTransferReport['transfers'][_0x4a66be[_0xb0e1('0x57')]]=_0x4a66be;};Report['prototype']['attendedTransfer']=function(_0x4b9be7){RpcVoiceTransferReport[_0xb0e1('0x1b')](_0x4b9be7);};module['exports']=Report; \ No newline at end of file +var _0x61bf=['queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','channel','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','calleridpreview','originatecalleridnum','destinationchannel','callerid','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','getCallType','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','exten','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xb096ef,_0x20ebdf){var _0x5ac5b=function(_0x11b4be){while(--_0x11b4be){_0xb096ef['push'](_0xb096ef['shift']());}};_0x5ac5b(++_0x20ebdf);}(_0x61bf,0x15b));var _0xf61b=function(_0x231f3e,_0x208148){_0x231f3e=_0x231f3e-0x0;var _0x3a7734=_0x61bf[_0x231f3e];return _0x3a7734;};'use strict';var _=require(_0xf61b('0x0'));var moment=require(_0xf61b('0x1'));var util=require(_0xf61b('0x2'));var config=require(_0xf61b('0x3'));var ami=require(_0xf61b('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xf61b('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xf61b('0x6'));var RpcVoiceRecording=require(_0xf61b('0x7'));var RpcVoiceTransferReport=require(_0xf61b('0x8'));var VoiceQueueReport=require(_0xf61b('0x9'));var VoiceCallReport=require(_0xf61b('0xa'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require('./userReport');function Report(_0x3c8e01){this[_0xf61b('0xb')]=_0x3c8e01;this[_0xf61b('0xc')]=_0x3c8e01['agents'];this[_0xf61b('0xd')]=_0x3c8e01[_0xf61b('0xd')];}Report['prototype'][_0xf61b('0xe')]=function(_0x32e713){var _0x403ba6=new VoiceQueueReport(this['realtime']);var _0x476b93=new VoiceAgentReport(this['realtime']);var _0xb8c686=new VoiceDialReport(this[_0xf61b('0xb')]);var _0xa634ad=new VoiceCallReport(this['realtime']);var _0x184895=new UserReport(this['realtime']);if(config[_0xf61b('0xf')]&&config[_0xf61b('0xf')][_0xf61b('0x10')]){ami['on'](_0xf61b('0x11'),this[_0xf61b('0x12')]['bind'](this));ami['on'](_0xf61b('0x13'),this[_0xf61b('0x14')][_0xf61b('0x15')](this));ami['on'](_0xf61b('0x16'),this[_0xf61b('0x17')][_0xf61b('0x15')](this));ami['on'](_0xf61b('0x18'),this[_0xf61b('0x19')][_0xf61b('0x15')](this));ami['on'](_0xf61b('0x1a'),this[_0xf61b('0x1b')]['bind'](this));ami['on'](_0xf61b('0x1c'),this[_0xf61b('0x1d')][_0xf61b('0x15')](this));}};Report[_0xf61b('0x1e')][_0xf61b('0x1f')]=function(_0x21d8b3){var _0x178c76;_0x178c76=_[_0xf61b('0x20')](this[_0xf61b('0xc')],function(_0x40a2bb){return _0x40a2bb[_0xf61b('0x21')]==_0x21d8b3||_0x40a2bb[_0xf61b('0x22')]==_0x21d8b3;});if(_[_0xf61b('0x23')](_0x178c76)){var _0x5077d8=_[_0xf61b('0x20')](this[_0xf61b('0xd')],function(_0x580d67){return _0x580d67['accountcode']==_0x21d8b3||_0x580d67[_0xf61b('0x22')]==_0x21d8b3;});if(_0x5077d8){_0x178c76=_[_0xf61b('0x20')](this[_0xf61b('0xc')],function(_0x2c15dd){return _0x2c15dd[_0xf61b('0x24')]==util[_0xf61b('0x25')](_0xf61b('0x26'),_0x5077d8['name']);});}}return _0x178c76;};Report[_0xf61b('0x1e')]['voiceQueueReport']=function(_0x5ba4c8){for(var _0x365794=0x0;_0x365794<_0x5ba4c8[_0xf61b('0x27')];_0x365794+=0x1){var _0x11491c=this[_0xf61b('0x1f')](_0x5ba4c8[_0x365794][_0xf61b('0x28')]);if(_0x11491c){_0x5ba4c8[_0x365794][_0xf61b('0x21')]=_0x11491c[_0xf61b('0x21')];_0x5ba4c8[_0x365794][_0xf61b('0x29')]=!![];_0x5ba4c8[_0x365794][_0xf61b('0x2a')]=_0x11491c[_0xf61b('0x22')];_0x5ba4c8[_0x365794]['interface']=_['isNil'](_0x11491c[_0xf61b('0x24')])?util[_0xf61b('0x25')](_0xf61b('0x26'),_0x11491c[_0xf61b('0x22')]):_0x11491c[_0xf61b('0x24')];if(_0x5ba4c8[_0x365794][_0xf61b('0x2b')]){_0x5ba4c8[_0x365794]['queuecallercompleteAt']=moment()[_0xf61b('0x25')](_0xf61b('0x2c'));}if(_0x5ba4c8[_0x365794][_0xf61b('0x2d')]){_0x5ba4c8[_0x365794][_0xf61b('0x2e')]=moment()[_0xf61b('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xf61b('0x12')](_0x5ba4c8[_0x365794]);}RpcVoiceQueueReport[_0xf61b('0x2f')](_0x5ba4c8[_0x365794]);}};function extractCalleridNumber(_0x1d081f){var _0x15a518=_0x1d081f[_0xf61b('0x30')](/<(.*?)>/);return _0x15a518?_0x15a518[0x1]:_0x1d081f;}Report[_0xf61b('0x1e')][_0xf61b('0x31')]=function(_0x7eeeca){for(var _0x451e7f=0x0;_0x451e7f0x0?_0x50d714:0x0;this['voiceQueues'][_0x3d86c8[_0x6249('0x66')]][_0x6249('0x2d')]=this[_0x6249('0x68')][_0x3d86c8[_0x6249('0x66')]][_0x6249('0x2d')]>_[_0x6249('0x6e')](_0x3d86c8[_0x6249('0x6f')])?_['toNumber'](_0x3d86c8[_0x6249('0x6f')]):this[_0x6249('0x68')][_0x3d86c8['queue']][_0x6249('0x2d')];this[_0x6249('0x70')](this[_0x6249('0x68')][_0x3d86c8[_0x6249('0x66')]],'queuesummary');}logger[_0x6249('0x40')](_0x6249('0x71'),util[_0x6249('0x38')](this[_0x6249('0x68')][_0x3d86c8[_0x6249('0x66')]],{'showHidden':![],'depth':null}));ami['emit'](_0x6249('0x72'),this['voiceQueues'][_0x3d86c8[_0x6249('0x66')]]);}}}catch(_0x3a8657){logger[_0x6249('0x36')]('[voiceQueueReport][queuesummary]',util[_0x6249('0x38')](_0x3a8657,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6249('0xd')][_0x6249('0x19')]=function(_0x5ae26b){logger[_0x6249('0x40')](_0x6249('0x73'),util[_0x6249('0x38')](_0x5ae26b,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x6249('0xd')][_0x6249('0x1b')]=function(_0x435c5e){try{if(this[_0x6249('0x5f')](_0x435c5e)){logger[_0x6249('0x40')](_0x6249('0x74'),_0x435c5e[_0x6249('0x48')],util[_0x6249('0x38')](_0x435c5e,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x435c5e[_0x6249('0x48')]]))this[_0x6249('0x11')][_0x435c5e['uniqueid']]=[];if(_['isUndefined'](this[_0x6249('0x13')][_0x435c5e['uniqueid']]))this['channels'][_0x435c5e[_0x6249('0x48')]]={};var _0xb5eec=new QueueReport();_0xb5eec[_0x6249('0x4b')]=_0x435c5e[_0x6249('0x66')];_0xb5eec[_0x6249('0x4e')]=this[_0x6249('0x68')][_0xb5eec[_0x6249('0x4b')]]&&this['voiceQueues'][_0xb5eec[_0x6249('0x4b')]][_0x6249('0x4e')]?this['voiceQueues'][_0xb5eec['name']]['type']||_0x6249('0x4f'):_0x6249('0x4f');_0xb5eec[_0x6249('0x66')]=_0x435c5e[_0x6249('0x66')];_0xb5eec[_0x6249('0x75')]=moment()['format'](_0x6249('0x76'));_0xb5eec[_0x6249('0x77')]=_0x435c5e['position'];_0xb5eec['count']=_0x435c5e[_0x6249('0x78')];_0xb5eec[_0x6249('0x48')]=_0x435c5e['uniqueid'];_0xb5eec[_0x6249('0x79')]=this[_0x6249('0x13')][_0x435c5e['uniqueid']][_0x6249('0x79')];logger[_0x6249('0x69')](_0x6249('0x7a'),_0xb5eec[_0x6249('0x4b')],_0xb5eec[_0x6249('0x4e')]);_['merge'](_0xb5eec,_['pick'](_0x435c5e,_[_0x6249('0x7b')](_0xb5eec)));this[_0x6249('0x11')][_0x435c5e[_0x6249('0x48')]][_0x6249('0x7c')](_0xb5eec);this[_0x6249('0x13')][_0x435c5e['uniqueid']]=_0xb5eec;this[_0x6249('0x3f')](_0xb5eec,_0x6249('0x7d'));}}catch(_0x32c162){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x435c5e[_0x6249('0x48')],util[_0x6249('0x38')](_0x32c162,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6249('0x1c')]=function(_0x4ff46d){try{if(this[_0x6249('0x5f')](_0x4ff46d)){logger[_0x6249('0x40')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4ff46d[_0x6249('0x48')],util[_0x6249('0x38')](_0x4ff46d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4ff46d['uniqueid']]){var _0xd1ea9f=_[_0x6249('0x7e')](this[_0x6249('0x11')][_0x4ff46d[_0x6249('0x48')]]);_0xd1ea9f['queuecallercomplete']=![];_0xd1ea9f[_0x6249('0x7f')]=null;_0xd1ea9f[_0x6249('0x80')]=_0x4ff46d['holdtime'];_0xd1ea9f[_0x6249('0x81')]=_0x4ff46d[_0x6249('0x81')];_0xd1ea9f[_0x6249('0x82')]=!![];_0xd1ea9f['queuecallerabandonAt']=moment()[_0x6249('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0xd1ea9f[_0x6249('0x49')]=_0x6249('0x83');_0xd1ea9f['lastAssignedTo']=null;logger[_0x6249('0x69')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0xd1ea9f[_0x6249('0x4b')],_0xd1ea9f[_0x6249('0x4e')]);this[_0x6249('0x13')][_0x4ff46d[_0x6249('0x48')]]=_0xd1ea9f;this[_0x6249('0x3d')](_0xd1ea9f,_0x6249('0x82'));}}}catch(_0x19c7c8){logger['error'](_0x6249('0x84'),_0x4ff46d[_0x6249('0x48')],util[_0x6249('0x38')](_0x19c7c8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x2c74e6){try{if(this[_0x6249('0x5f')](_0x2c74e6)){logger['debug'](_0x6249('0x85'),_0x2c74e6[_0x6249('0x48')],util[_0x6249('0x38')](_0x2c74e6,{'showHidden':![],'depth':null}));if(this[_0x6249('0x11')][_0x2c74e6['uniqueid']]){var _0x5888ac=_[_0x6249('0x7e')](this[_0x6249('0x11')][_0x2c74e6[_0x6249('0x48')]]);_0x5888ac[_0x6249('0x86')]=moment()[_0x6249('0x43')](_0x6249('0x76'));_0x5888ac[_0x6249('0x87')]=_0x2c74e6[_0x6249('0x87')];_0x5888ac[_0x6249('0x88')]=_0x2c74e6[_0x6249('0x88')];logger[_0x6249('0x69')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5888ac[_0x6249('0x4b')],_0x5888ac[_0x6249('0x4e')],_0x2c74e6[_0x6249('0x87')],_0x2c74e6[_0x6249('0x88')]);this['channels'][_0x2c74e6[_0x6249('0x48')]]=_0x5888ac;this[_0x6249('0x3f')](_0x5888ac,_0x6249('0x89'));}}}catch(_0x4a4706){logger[_0x6249('0x36')](_0x6249('0x85'),_0x2c74e6[_0x6249('0x48')],util['inspect'](_0x4a4706,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6249('0xd')][_0x6249('0x8a')]=function(_0x2dcb20){try{if(this[_0x6249('0x5f')](_0x2dcb20)){logger[_0x6249('0x40')](_0x6249('0x8b'),_0x2dcb20[_0x6249('0x48')],util['inspect'](_0x2dcb20,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2dcb20[_0x6249('0x48')]]){var _0xd045da=_['last'](this[_0x6249('0x11')][_0x2dcb20['uniqueid']]);_0xd045da[_0x6249('0x8c')]=!![];_0xd045da['queuecallerexitreason']=_0x6249('0x8d');logger[_0x6249('0x69')](_0x6249('0x8e'),_0xd045da[_0x6249('0x4b')],_0xd045da[_0x6249('0x4e')]);}}}catch(_0x475a45){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x2dcb20[_0x6249('0x48')],util[_0x6249('0x38')](_0x475a45,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6249('0xd')][_0x6249('0x1e')]=function(_0x3eb4af){try{if(this[_0x6249('0x5f')](_0x3eb4af)){logger[_0x6249('0x40')](_0x6249('0x8f'),_0x3eb4af[_0x6249('0x48')],util[_0x6249('0x38')](_0x3eb4af,{'showHidden':![],'depth':null}));if(this[_0x6249('0x11')][_0x3eb4af[_0x6249('0x48')]]){var _0x27b33f=_[_0x6249('0x7e')](this[_0x6249('0x11')][_0x3eb4af[_0x6249('0x48')]]);_0x27b33f[_0x6249('0x82')]=![];_0x27b33f[_0x6249('0x90')]=null;_0x27b33f[_0x6249('0x91')]=!![];_0x27b33f['lastAssignedTo']=_0x3eb4af['membername'];_0x27b33f['holdtime']=_0x3eb4af[_0x6249('0x80')];_0x27b33f[_0x6249('0x8c')]=!![];_0x27b33f['queuecallerexit']=![];_0x27b33f[_0x6249('0x92')]=null;if(!_0x27b33f[_0x6249('0x93')]){if(_0x3eb4af[_0x6249('0x94')]==_0x6249('0x93')){_0x27b33f[_0x6249('0x49')]=_0x6249('0x95');logger[_0x6249('0x69')](_0x6249('0x96'),_0x27b33f[_0x6249('0x4b')],_0x27b33f[_0x6249('0x4e')]);}else{if(_[_0x6249('0x97')](_0x3eb4af[_0x6249('0x33')]['toLowerCase'](),_0x6249('0x98'))){if(this[_0x6249('0x11')][_0x3eb4af['linkedid']]){var _0x415362=_[_0x6249('0x7e')](this[_0x6249('0x11')][_0x3eb4af[_0x6249('0x99')]]);_0x415362[_0x6249('0x8c')]=![];_0x415362[_0x6249('0x9a')]=!![];_0x415362[_0x6249('0x92')]=moment(_0x27b33f[_0x6249('0x75')])[_0x6249('0x9b')](_0x3eb4af['holdtime'],_0x6249('0x9c'))['format'](_0x6249('0x76'));_0x415362['queuecallerexitreason']=_0x6249('0x9d');_0x415362[_0x6249('0x93')]=!![];_0x415362[_0x6249('0x9e')]=_0x6249('0x9f');_0x415362['transferexten']=_0x3eb4af[_0x6249('0xa0')];_0x415362[_0x6249('0xa1')]=_0x3eb4af[_0x6249('0x48')];logger[_0x6249('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x415362[_0x6249('0x4b')],_0x415362['type']);var _0x31d605=this[_0x6249('0x11')][_0x3eb4af[_0x6249('0x99')]];this[_0x6249('0x11')][_0x3eb4af['linkedid']]=this[_0x6249('0x11')][_0x3eb4af[_0x6249('0x48')]];this[_0x6249('0x11')][_0x3eb4af[_0x6249('0x48')]]=_0x31d605;}}else{_0x27b33f[_0x6249('0x49')]='COMPLETEDBY'+_0x3eb4af[_0x6249('0x94')][_0x6249('0xa2')]();logger['info'](_0x6249('0xa3'),_0x27b33f[_0x6249('0x4b')],_0x27b33f[_0x6249('0x4e')],_0x27b33f[_0x6249('0x49')]);}}}this['channels'][_0x3eb4af['uniqueid']]=_0x27b33f;this['emitVoiceQueueChannelRemove'](_0x27b33f,_0x6249('0xa4'));}}}catch(_0x46aacd){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x3eb4af[_0x6249('0x48')],util[_0x6249('0x38')](_0x46aacd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6249('0xd')][_0x6249('0xa5')]=function(_0x439008){try{if(this[_0x6249('0x5f')](_0x439008)){logger[_0x6249('0x40')](_0x6249('0xa6'),_0x439008[_0x6249('0x48')],util['inspect'](_0x439008,{'showHidden':![],'depth':null}));this[_0x6249('0xa7')](_0x439008[_0x6249('0x48')],_['keys'](_0x439008[_0x6249('0xa8')])[0x0],_0x439008[_0x6249('0xa9')]);if(this['queueReports'][_0x439008[_0x6249('0x48')]]){var _0x2cd4f9=_['last'](this[_0x6249('0x11')][_0x439008[_0x6249('0x48')]]);if(_0x2cd4f9){if(this['isNotNull'](_0x439008['variable'])&&this[_0x6249('0x5f')](_0x439008['variable'][_0x6249('0xaa')])){switch(_0x439008[_0x6249('0xa9')]){case'CONTINUE':_0x2cd4f9[_0x6249('0x9a')]=![];_0x2cd4f9[_0x6249('0x92')]=null;break;case'TIMEOUT':_0x2cd4f9[_0x6249('0xab')]=_0x6249('0xac');_0x2cd4f9[_0x6249('0x9a')]=!![];_0x2cd4f9[_0x6249('0x92')]=moment()[_0x6249('0x43')](_0x6249('0x76'));_0x2cd4f9[_0x6249('0x86')]=moment()[_0x6249('0x43')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x6249('0x40')](_0x6249('0xad'),_0x439008[_0x6249('0x48')],util[_0x6249('0x38')](_0x2cd4f9,{'showHidden':![],'depth':null}));ami[_0x6249('0x3e')](_0x6249('0xae'),_0x2cd4f9);break;default:_0x2cd4f9[_0x6249('0x9a')]=!![];_0x2cd4f9[_0x6249('0x92')]=moment()[_0x6249('0x43')](_0x6249('0x76'));_0x2cd4f9[_0x6249('0x86')]=moment()[_0x6249('0x43')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2cd4f9[_0x6249('0x82')]=![];_0x2cd4f9[_0x6249('0x90')]=null;_0x2cd4f9['queuecallerexitreason']=_0x439008[_0x6249('0xa9')];this[_0x6249('0x13')][_0x439008[_0x6249('0x48')]]=_0x2cd4f9;this['emitVoiceQueueChannelRemove'](_0x2cd4f9,'varset');}else if(this[_0x6249('0x5f')](_0x439008['variable'])&&this[_0x6249('0x5f')](_0x439008[_0x6249('0xa8')][_0x6249('0xaf')])){if(!_0x2cd4f9[_0x6249('0x82')]){_0x2cd4f9[_0x6249('0x9a')]=!![];_0x2cd4f9[_0x6249('0x92')]=moment()['format'](_0x6249('0x76'));_0x2cd4f9[_0x6249('0x49')]=_0x6249('0xb0');_0x2cd4f9[_0x6249('0x86')]=moment()[_0x6249('0x43')](_0x6249('0x76'));this[_0x6249('0x13')][_0x439008[_0x6249('0x48')]]=_0x2cd4f9;}}logger[_0x6249('0x69')](_0x6249('0xb1'),_0x439008[_0x6249('0x48')],_0x2cd4f9[_0x6249('0x4b')],_0x2cd4f9['type'],_[_0x6249('0x7b')](_0x439008[_0x6249('0xa8')])[0x0],_0x439008[_0x6249('0xa9')]);_0x2cd4f9[_0x6249('0x16')]=this[_0x6249('0x16')][_0x439008[_0x6249('0x48')]];}}}}catch(_0x3229fe){logger[_0x6249('0x36')](_0x6249('0xa6'),_0x439008[_0x6249('0x48')],util[_0x6249('0x38')](_0x3229fe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x6249('0xa7')]=function(_0x23e9c3,_0x21339b,_0x464cf4){var _0x593662=[_0x6249('0xb2'),_0x6249('0xb3'),_0x6249('0xb4'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt',_0x6249('0xb5'),_0x6249('0xb6'),_0x6249('0xb7'),'bridgepeer',_0x6249('0xb8'),_0x6249('0xb9'),_0x6249('0xba'),_0x6249('0xbb'),_0x6249('0xbc'),_0x6249('0xbd'),_0x6249('0xbe'),'memberrealtime'];if(!_[_0x6249('0xbf')](_0x21339b)&&!_[_0x6249('0xc0')](_0x593662,_0x21339b)){if(_[_0x6249('0x60')](this[_0x6249('0x16')][_0x23e9c3])){this[_0x6249('0x16')][_0x23e9c3]={};}this[_0x6249('0x16')][_0x23e9c3][_0x21339b]=_0x464cf4;}};VoiceQueueReport['prototype'][_0x6249('0x1f')]=function(_0x573c6c){try{if(this[_0x6249('0x5f')](_0x573c6c)){logger[_0x6249('0x40')](_0x6249('0xc1'),_0x573c6c[_0x6249('0x48')],util[_0x6249('0x38')](_0x573c6c,{'showHidden':![],'depth':null}));if(this[_0x6249('0x11')][_0x573c6c['uniqueid']]){for(var _0x9de7c4=0x0,_0x18fb78={};_0x9de7c40x0?_0x50fc67:0x0;this[_0x102a('0xf')][_0x123ea6['queue']][_0x102a('0x72')]=this[_0x102a('0xf')][_0x123ea6[_0x102a('0x6b')]][_0x102a('0x72')]>_[_0x102a('0x70')](_0x123ea6['loggedin'])?_[_0x102a('0x70')](_0x123ea6[_0x102a('0x71')]):this[_0x102a('0xf')][_0x123ea6['queue']]['talking'];this[_0x102a('0x50')](this[_0x102a('0xf')][_0x123ea6['queue']],_0x102a('0x69'));}logger[_0x102a('0x46')](_0x102a('0x73'),util['inspect'](this[_0x102a('0xf')][_0x123ea6[_0x102a('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x102a('0x44')](_0x102a('0x74'),this[_0x102a('0xf')][_0x123ea6[_0x102a('0x6b')]]);}}}catch(_0x2e2d2f){logger[_0x102a('0x3c')](_0x102a('0x6a'),util['inspect'](_0x2e2d2f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x102a('0x3f')][_0x102a('0x15')]=function(_0x10ff4a){logger[_0x102a('0x46')](_0x102a('0x75'),util[_0x102a('0x3b')](_0x10ff4a,{'showHidden':![],'depth':null}));this[_0x102a('0x10')]=!![];};VoiceQueueReport[_0x102a('0x3f')][_0x102a('0x76')]=function(_0x2fad69){try{if(this[_0x102a('0x64')](_0x2fad69)){logger[_0x102a('0x46')](_0x102a('0x77'),_0x2fad69[_0x102a('0x4c')],util['inspect'](_0x2fad69,{'showHidden':![],'depth':null}));if(_[_0x102a('0x65')](this['queueReports'][_0x2fad69[_0x102a('0x4c')]]))this['queueReports'][_0x2fad69['uniqueid']]=[];if(_[_0x102a('0x65')](this[_0x102a('0xd')][_0x2fad69[_0x102a('0x4c')]]))this[_0x102a('0xd')][_0x2fad69[_0x102a('0x4c')]]={};var _0x2b2165=new QueueReport();_0x2b2165['name']=_0x2fad69[_0x102a('0x6b')];_0x2b2165[_0x102a('0x51')]=this[_0x102a('0xf')][_0x2b2165[_0x102a('0x49')]]&&this[_0x102a('0xf')][_0x2b2165[_0x102a('0x49')]][_0x102a('0x51')]?this[_0x102a('0xf')][_0x2b2165[_0x102a('0x49')]][_0x102a('0x51')]||_0x102a('0x52'):_0x102a('0x52');_0x2b2165[_0x102a('0x6b')]=_0x2fad69['queue'];_0x2b2165[_0x102a('0x78')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2b2165[_0x102a('0x79')]=_0x2fad69[_0x102a('0x79')];_0x2b2165[_0x102a('0x7a')]=_0x2fad69[_0x102a('0x7a')];_0x2b2165[_0x102a('0x4c')]=_0x2fad69['uniqueid'];_0x2b2165[_0x102a('0x7b')]=this[_0x102a('0xd')][_0x2fad69[_0x102a('0x4c')]][_0x102a('0x7b')];logger[_0x102a('0x7c')](_0x102a('0x7d'),_0x2b2165[_0x102a('0x49')],_0x2b2165[_0x102a('0x51')]);_[_0x102a('0x7e')](_0x2b2165,_[_0x102a('0x7f')](_0x2fad69,_['keys'](_0x2b2165)));this[_0x102a('0xb')][_0x2fad69[_0x102a('0x4c')]][_0x102a('0x80')](_0x2b2165);this[_0x102a('0xd')][_0x2fad69[_0x102a('0x4c')]]=_0x2b2165;this[_0x102a('0x45')](_0x2b2165,_0x102a('0x81'));}}catch(_0x33032f){logger[_0x102a('0x3c')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2fad69[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x33032f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x102a('0x3f')][_0x102a('0x17')]=function(_0x620fe3){try{if(this[_0x102a('0x64')](_0x620fe3)){logger['debug'](_0x102a('0x82'),_0x620fe3[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x620fe3,{'showHidden':![],'depth':null}));if(this[_0x102a('0xb')][_0x620fe3['uniqueid']]){var _0x2da0d3=_[_0x102a('0x83')](this[_0x102a('0xb')][_0x620fe3[_0x102a('0x4c')]]);_0x2da0d3[_0x102a('0x84')]=![];_0x2da0d3[_0x102a('0x85')]=null;_0x2da0d3[_0x102a('0x86')]=_0x620fe3[_0x102a('0x86')];_0x2da0d3[_0x102a('0x87')]=_0x620fe3[_0x102a('0x87')];_0x2da0d3[_0x102a('0x16')]=!![];_0x2da0d3['queuecallerabandonAt']=moment()[_0x102a('0x62')](_0x102a('0x88'));_0x2da0d3[_0x102a('0x4d')]=_0x102a('0x89');_0x2da0d3[_0x102a('0x8a')]=null;logger[_0x102a('0x7c')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x2da0d3[_0x102a('0x49')],_0x2da0d3[_0x102a('0x51')]);this[_0x102a('0xd')][_0x620fe3[_0x102a('0x4c')]]=_0x2da0d3;this['emitVoiceQueueChannelRemove'](_0x2da0d3,_0x102a('0x16'));}}}catch(_0x54bf90){logger[_0x102a('0x3c')](_0x102a('0x82'),_0x620fe3[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x54bf90,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x2d1720){try{if(this['isNotNull'](_0x2d1720)){logger[_0x102a('0x46')](_0x102a('0x8b'),_0x2d1720[_0x102a('0x4c')],util['inspect'](_0x2d1720,{'showHidden':![],'depth':null}));if(this[_0x102a('0xb')][_0x2d1720[_0x102a('0x4c')]]){var _0x1185d7=_[_0x102a('0x83')](this[_0x102a('0xb')][_0x2d1720['uniqueid']]);_0x1185d7[_0x102a('0x8c')]=moment()[_0x102a('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x1185d7[_0x102a('0x8d')]=_0x2d1720[_0x102a('0x8d')];_0x1185d7[_0x102a('0x8e')]=_0x2d1720[_0x102a('0x8e')];logger[_0x102a('0x7c')](_0x102a('0x8f'),_0x1185d7[_0x102a('0x49')],_0x1185d7[_0x102a('0x51')],_0x2d1720[_0x102a('0x8d')],_0x2d1720[_0x102a('0x8e')]);this[_0x102a('0xd')][_0x2d1720['uniqueid']]=_0x1185d7;this['emitVoiceQueueChannelSave'](_0x1185d7,_0x102a('0x18'));}}}catch(_0x589758){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x2d1720[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x589758,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x102a('0x3f')]['syncAgentConnect']=function(_0x4b6f2d){try{if(this[_0x102a('0x64')](_0x4b6f2d)){logger['debug'](_0x102a('0x90'),_0x4b6f2d[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x4b6f2d,{'showHidden':![],'depth':null}));if(this[_0x102a('0xb')][_0x4b6f2d[_0x102a('0x4c')]]){var _0x198836=_['last'](this[_0x102a('0xb')][_0x4b6f2d[_0x102a('0x4c')]]);_0x198836[_0x102a('0x84')]=!![];_0x198836[_0x102a('0x4d')]=_0x102a('0x91');logger[_0x102a('0x7c')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x198836[_0x102a('0x49')],_0x198836[_0x102a('0x51')]);}}}catch(_0x79119){logger['error'](_0x102a('0x90'),_0x4b6f2d[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x79119,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x102a('0x3f')][_0x102a('0x1b')]=function(_0x172a5a){try{if(this['isNotNull'](_0x172a5a)){logger[_0x102a('0x46')](_0x102a('0x92'),_0x172a5a[_0x102a('0x4c')],util['inspect'](_0x172a5a,{'showHidden':![],'depth':null}));if(this[_0x102a('0xb')][_0x172a5a['uniqueid']]){var _0x49fdba=_['last'](this[_0x102a('0xb')][_0x172a5a[_0x102a('0x4c')]]);_0x49fdba[_0x102a('0x16')]=![];_0x49fdba['queuecallerabandonAt']=null;_0x49fdba['assigned']=!![];_0x49fdba[_0x102a('0x8a')]=_0x172a5a['membername'];_0x49fdba[_0x102a('0x86')]=_0x172a5a[_0x102a('0x86')];_0x49fdba[_0x102a('0x84')]=!![];_0x49fdba['queuecallerexit']=![];_0x49fdba[_0x102a('0x93')]=null;if(!_0x49fdba[_0x102a('0x94')]){if(_0x172a5a[_0x102a('0x95')]==_0x102a('0x94')){_0x49fdba[_0x102a('0x4d')]=_0x102a('0x96');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x49fdba[_0x102a('0x49')],_0x49fdba[_0x102a('0x51')]);}else{if(_['startsWith'](_0x172a5a[_0x102a('0x36')]['toLowerCase'](),_0x102a('0x97'))){if(this[_0x102a('0xb')][_0x172a5a['linkedid']]){var _0x2a74ca=_[_0x102a('0x83')](this[_0x102a('0xb')][_0x172a5a[_0x102a('0x98')]]);_0x2a74ca[_0x102a('0x84')]=![];_0x2a74ca[_0x102a('0x99')]=!![];_0x2a74ca[_0x102a('0x93')]=moment(_0x49fdba[_0x102a('0x78')])['add'](_0x172a5a[_0x102a('0x86')],_0x102a('0x9a'))[_0x102a('0x62')](_0x102a('0x88'));_0x2a74ca[_0x102a('0x4d')]=_0x102a('0x9b');_0x2a74ca[_0x102a('0x94')]=!![];_0x2a74ca[_0x102a('0x9c')]=_0x102a('0x9d');_0x2a74ca[_0x102a('0x9e')]=_0x172a5a['destexten'];_0x2a74ca['transferuniqueid']=_0x172a5a[_0x102a('0x4c')];logger['info'](_0x102a('0x9f'),_0x2a74ca[_0x102a('0x49')],_0x2a74ca[_0x102a('0x51')]);var _0x379213=this[_0x102a('0xb')][_0x172a5a[_0x102a('0x98')]];this['queueReports'][_0x172a5a[_0x102a('0x98')]]=this[_0x102a('0xb')][_0x172a5a['uniqueid']];this[_0x102a('0xb')][_0x172a5a[_0x102a('0x4c')]]=_0x379213;}}else{_0x49fdba[_0x102a('0x4d')]=_0x102a('0xa0')+_0x172a5a[_0x102a('0x95')][_0x102a('0xa1')]();logger[_0x102a('0x7c')](_0x102a('0xa2'),_0x49fdba['name'],_0x49fdba[_0x102a('0x51')],_0x49fdba[_0x102a('0x4d')]);}}}this[_0x102a('0xd')][_0x172a5a[_0x102a('0x4c')]]=_0x49fdba;this[_0x102a('0x42')](_0x49fdba,_0x102a('0x1a'));}}}catch(_0x318aac){logger[_0x102a('0x3c')](_0x102a('0x92'),_0x172a5a['uniqueid'],util[_0x102a('0x3b')](_0x318aac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x102a('0x3f')][_0x102a('0x1f')]=function(_0x3e0abd){try{if(this['isNotNull'](_0x3e0abd)){logger['debug'](_0x102a('0xa3'),_0x3e0abd[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x3e0abd,{'showHidden':![],'depth':null}));this[_0x102a('0xa4')](_0x3e0abd[_0x102a('0x4c')],_[_0x102a('0xa5')](_0x3e0abd[_0x102a('0xa6')])[0x0],_0x3e0abd[_0x102a('0xa7')]);if(this[_0x102a('0xb')][_0x3e0abd['uniqueid']]){var _0x49e148=_[_0x102a('0x83')](this['queueReports'][_0x3e0abd[_0x102a('0x4c')]]);if(_0x49e148){if(this[_0x102a('0x64')](_0x3e0abd[_0x102a('0xa6')])&&this['isNotNull'](_0x3e0abd[_0x102a('0xa6')]['queuestatus'])){switch(_0x3e0abd['value']){case'CONTINUE':_0x49e148['queuecallerexit']=![];_0x49e148[_0x102a('0x93')]=null;break;case _0x102a('0xa8'):_0x49e148['lastevent']='timeout';_0x49e148[_0x102a('0x99')]=!![];_0x49e148[_0x102a('0x93')]=moment()[_0x102a('0x62')](_0x102a('0x88'));_0x49e148[_0x102a('0x8c')]=moment()[_0x102a('0x62')](_0x102a('0x88'));logger[_0x102a('0x46')](_0x102a('0xa9'),_0x3e0abd['uniqueid'],util[_0x102a('0x3b')](_0x49e148,{'showHidden':![],'depth':null}));ami[_0x102a('0x44')](_0x102a('0xaa'),_0x49e148);break;default:_0x49e148[_0x102a('0x99')]=!![];_0x49e148[_0x102a('0x93')]=moment()[_0x102a('0x62')](_0x102a('0x88'));_0x49e148[_0x102a('0x8c')]=moment()[_0x102a('0x62')](_0x102a('0x88'));}_0x49e148[_0x102a('0x16')]=![];_0x49e148[_0x102a('0xab')]=null;_0x49e148['queuecallerexitreason']=_0x3e0abd['value'];this[_0x102a('0xd')][_0x3e0abd[_0x102a('0x4c')]]=_0x49e148;this['emitVoiceQueueChannelRemove'](_0x49e148,_0x102a('0x1e'));}else if(this[_0x102a('0x64')](_0x3e0abd[_0x102a('0xa6')])&&this[_0x102a('0x64')](_0x3e0abd[_0x102a('0xa6')][_0x102a('0xac')])){if(!_0x49e148[_0x102a('0x16')]){_0x49e148[_0x102a('0x99')]=!![];_0x49e148[_0x102a('0x93')]=moment()['format'](_0x102a('0x88'));_0x49e148[_0x102a('0x4d')]=_0x102a('0xad');_0x49e148[_0x102a('0x8c')]=moment()[_0x102a('0x62')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x102a('0xd')][_0x3e0abd[_0x102a('0x4c')]]=_0x49e148;}}logger[_0x102a('0x7c')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3e0abd[_0x102a('0x4c')],_0x49e148[_0x102a('0x49')],_0x49e148['type'],_[_0x102a('0xa5')](_0x3e0abd[_0x102a('0xa6')])[0x0],_0x3e0abd[_0x102a('0xa7')]);_0x49e148[_0x102a('0x12')]=this['variables'][_0x3e0abd[_0x102a('0x4c')]];}}}}catch(_0x2b0323){logger[_0x102a('0x3c')](_0x102a('0xa3'),_0x3e0abd[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x2b0323,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x102a('0x3f')][_0x102a('0xa4')]=function(_0x2ecfa8,_0x3035b5,_0x586fc0){var _0x2023a8=[_0x102a('0xae'),_0x102a('0xaf'),_0x102a('0xb0'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x102a('0xb1'),'rtpaudioqosrtt',_0x102a('0xb2'),'sipcallid',_0x102a('0xb3'),_0x102a('0xb4'),_0x102a('0xb5'),_0x102a('0xb6'),_0x102a('0xb7'),_0x102a('0xb8'),_0x102a('0xb9'),_0x102a('0xba'),_0x102a('0xbb'),'memberrealtime'];if(!_['isNil'](_0x3035b5)&&!_[_0x102a('0xbc')](_0x2023a8,_0x3035b5)){if(_['isUndefined'](this[_0x102a('0x12')][_0x2ecfa8])){this[_0x102a('0x12')][_0x2ecfa8]={};}this[_0x102a('0x12')][_0x2ecfa8][_0x3035b5]=_0x586fc0;}};VoiceQueueReport[_0x102a('0x3f')][_0x102a('0xbd')]=function(_0x3be4e5){try{if(this[_0x102a('0x64')](_0x3be4e5)){logger['debug'](_0x102a('0xbe'),_0x3be4e5[_0x102a('0x4c')],util[_0x102a('0x3b')](_0x3be4e5,{'showHidden':![],'depth':null}));if(this[_0x102a('0xb')][_0x3be4e5[_0x102a('0x4c')]]){for(var _0x57fb26=0x0,_0x533b53={};_0x57fb26=0x0?moment(_0x464132[_0x44e6('0x15')])[_0x44e6('0xb')](_0x464132[_0x44e6('0x14')],'seconds'):null,'data1':_0x44e6('0x16'),'data2':_0x464132[_0x44e6('0x12')],'data3':_0x464132[_0x44e6('0x17')],'data4':_0x464132[_0x44e6('0x18')]||null,'role':_0x44e6('0x10'),'internal':_0x464132[_0x44e6('0x12')]?_['toNumber'](_0x464132['accountcode']):undefined,'uniqueid':_0x464132[_0x44e6('0x19')]},'log':_0x44e6('0x13')});}; \ No newline at end of file +var _0x445c=['queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','diff','outbound','dialstring','toNumber','moment','lodash','util','../client','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING'];(function(_0x4ffab6,_0x303961){var _0x507dc7=function(_0x597ed4){while(--_0x597ed4){_0x4ffab6['push'](_0x4ffab6['shift']());}};_0x507dc7(++_0x303961);}(_0x445c,0x133));var _0xc445=function(_0x34a9c6,_0x250e00){_0x34a9c6=_0x34a9c6-0x0;var _0x2a392c=_0x445c[_0x34a9c6];return _0x2a392c;};'use strict';var moment=require(_0xc445('0x0'));var _=require(_0xc445('0x1'));var util=require(_0xc445('0x2'));var client=require(_0xc445('0x3'));exports['voiceQueueReport']=function(_0x113e97){var _0x56e1b0=_0x113e97['queuecallercompleteAt']||_0x113e97['queuecallerexitAt'];return client[_0xc445('0x4')](_0xc445('0x5'),{'body':{'channel':_0xc445('0x6'),'membername':_0x113e97[_0xc445('0x7')],'interface':_['isNil'](_0x113e97[_0xc445('0x8')])?util[_0xc445('0x9')](_0xc445('0xa'),_0x113e97[_0xc445('0x7')]):_0x113e97[_0xc445('0x8')],'type':_0xc445('0xb'),'enterAt':_0x113e97['queuecallerleaveAt'],'exitAt':_0x56e1b0,'duration':moment(_0x56e1b0)['diff'](_0x113e97[_0xc445('0xc')],_0xc445('0xd')),'data1':_0xc445('0xe'),'data2':_0x113e97[_0xc445('0xf')],'data3':_0x113e97[_0xc445('0x10')],'data4':null,'data5':_0x113e97[_0xc445('0x11')],'role':_0xc445('0x12'),'internal':_0x113e97['accountcode']?_['toNumber'](_0x113e97[_0xc445('0x13')]):undefined,'uniqueid':_0x113e97[_0xc445('0x14')]},'log':_0xc445('0x5')});};exports[_0xc445('0x15')]=function(_0x29fea7){return client['Request'](_0xc445('0x5'),{'body':{'channel':_0xc445('0x6'),'membername':_0x29fea7[_0xc445('0x16')],'interface':_0x29fea7[_0xc445('0x8')],'type':'TALKING','enterAt':_0x29fea7[_0xc445('0x17')],'exitAt':_0x29fea7[_0xc445('0x18')],'duration':moment(_0x29fea7[_0xc445('0x18')])[_0xc445('0x19')](_0x29fea7[_0xc445('0x17')],'seconds')>=0x0?moment(_0x29fea7[_0xc445('0x18')])[_0xc445('0x19')](_0x29fea7[_0xc445('0x17')],_0xc445('0xd')):null,'data1':_0xc445('0x1a'),'data2':_0x29fea7[_0xc445('0x13')],'data3':_0x29fea7[_0xc445('0x10')],'data4':_0x29fea7[_0xc445('0x1b')]||null,'role':'agent','internal':_0x29fea7[_0xc445('0x13')]?_[_0xc445('0x1c')](_0x29fea7[_0xc445('0x13')]):undefined,'uniqueid':_0x29fea7[_0xc445('0x14')]},'log':_0xc445('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index f4b21a1..1da75a0 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 _0xa3b7=['../client','Request','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings'];(function(_0x18295b,_0x1c0aea){var _0x59890b=function(_0x1ff845){while(--_0x1ff845){_0x18295b['push'](_0x18295b['shift']());}};_0x59890b(++_0x1c0aea);}(_0xa3b7,0xe6));var _0x7a3b=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xa3b7[_0x2c7618];return _0x5ce3f0;};'use strict';var client=require(_0x7a3b('0x0'));exports['getSettings']=function(){return client[_0x7a3b('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7a3b('0x2'),_0x7a3b('0x3')]},'log':_0x7a3b('0x4')});}; \ No newline at end of file +var _0xd844=['stopRecordingOnTransfer','../client','getSettings','ShowSetting'];(function(_0x871bfb,_0x36e69e){var _0x38b4aa=function(_0x32cd91){while(--_0x32cd91){_0x871bfb['push'](_0x871bfb['shift']());}};_0x38b4aa(++_0x36e69e);}(_0xd844,0x6d));var _0x4d84=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd844[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x4d84('0x0'));exports[_0x4d84('0x1')]=function(){return client['Request'](_0x4d84('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4d84('0x3'),'previewRecallmeReminderInterval']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 1aab0aa..aa300e8 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 _0x8ee4=['html','../client','GetTemplate'];(function(_0x1252d9,_0xb59816){var _0x76c018=function(_0x52e72c){while(--_0x52e72c){_0x1252d9['push'](_0x1252d9['shift']());}};_0x76c018(++_0xb59816);}(_0x8ee4,0x115));var _0x48ee=function(_0x32e884,_0x4ee995){_0x32e884=_0x32e884-0x0;var _0xcb3de3=_0x8ee4[_0x32e884];return _0xcb3de3;};'use strict';var client=require(_0x48ee('0x0'));exports['getTemplates']=function(_0x10731d){return function(_0x1fcb83){return client['Request'](_0x48ee('0x1'),{'options':{'raw':!![],'attributes':['id','name',_0x48ee('0x2')]},'log':_0x48ee('0x1')});};}; \ No newline at end of file +var _0xb2a6=['../client','getTemplates','GetTemplate','name','html'];(function(_0x45e83a,_0x430070){var _0x2e46e9=function(_0x24c909){while(--_0x24c909){_0x45e83a['push'](_0x45e83a['shift']());}};_0x2e46e9(++_0x430070);}(_0xb2a6,0xf0));var _0x6b2a=function(_0x20b1f9,_0x4e68e8){_0x20b1f9=_0x20b1f9-0x0;var _0x2bf851=_0xb2a6[_0x20b1f9];return _0x2bf851;};'use strict';var client=require(_0x6b2a('0x0'));exports[_0x6b2a('0x1')]=function(_0x55e542){return function(_0x293056){return client['Request'](_0x6b2a('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6b2a('0x3'),_0x6b2a('0x4')]},'log':_0x6b2a('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 534ae9d..6afc80a 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 _0x5057=['field','operator','value','Condition','AnyConditions','Action','action','data1','data2','data3','data4','data5','data7','../client','name','status','AllConditions'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x5057,0xfb));var _0x7505=function(_0x5b7218,_0x51cb1f){_0x5b7218=_0x5b7218-0x0;var _0x424010=_0x5057[_0x5b7218];return _0x424010;};'use strict';var client=require(_0x7505('0x0'));exports['getTriggers']=function(_0x289370){return function(_0x149175){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x7505('0x1'),'channel',_0x7505('0x2')],'include':[{'model':'Condition','as':_0x7505('0x3'),'attributes':['id',_0x7505('0x4'),_0x7505('0x5'),_0x7505('0x6')]},{'model':_0x7505('0x7'),'as':_0x7505('0x8'),'attributes':['id',_0x7505('0x4'),_0x7505('0x5'),_0x7505('0x6')]},{'model':_0x7505('0x9'),'as':'Actions','attributes':['id',_0x7505('0xa'),_0x7505('0xb'),_0x7505('0xc'),_0x7505('0xd'),_0x7505('0xe'),_0x7505('0xf'),'data6',_0x7505('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x7ca6=['field','operator','value','Action','Actions','action','data1','data2','data3','data4','data6','data7','GetTrigger','../client','getTriggers','Request','name','channel','status','Condition'];(function(_0x4ad069,_0x4dfd6d){var _0x576b8f=function(_0x4a8a6f){while(--_0x4a8a6f){_0x4ad069['push'](_0x4ad069['shift']());}};_0x576b8f(++_0x4dfd6d);}(_0x7ca6,0x1ed));var _0x67ca=function(_0x3dbf46,_0x299fb5){_0x3dbf46=_0x3dbf46-0x0;var _0x4410eb=_0x7ca6[_0x3dbf46];return _0x4410eb;};'use strict';var client=require(_0x67ca('0x0'));exports[_0x67ca('0x1')]=function(_0x346051){return function(_0x5a604e){return client[_0x67ca('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x67ca('0x3'),_0x67ca('0x4'),_0x67ca('0x5')],'include':[{'model':_0x67ca('0x6'),'as':'AllConditions','attributes':['id',_0x67ca('0x7'),_0x67ca('0x8'),_0x67ca('0x9')]},{'model':_0x67ca('0x6'),'as':'AnyConditions','attributes':['id',_0x67ca('0x7'),_0x67ca('0x8'),'value']},{'model':_0x67ca('0xa'),'as':_0x67ca('0xb'),'attributes':['id',_0x67ca('0xc'),_0x67ca('0xd'),_0x67ca('0xe'),_0x67ca('0xf'),_0x67ca('0x10'),'data5',_0x67ca('0x11'),_0x67ca('0x12')]}]},'log':_0x67ca('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 2f92ca3..742132f 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 _0x028d=['name','registry','defaultuser','getTrunks','Request','GetTrunk'];(function(_0x21b072,_0xcb09f3){var _0x5945ca=function(_0x807857){while(--_0x807857){_0x21b072['push'](_0x21b072['shift']());}};_0x5945ca(++_0xcb09f3);}(_0x028d,0xff));var _0xd028=function(_0x2e2f44,_0x28e3e6){_0x2e2f44=_0x2e2f44-0x0;var _0x26a69a=_0x028d[_0x2e2f44];return _0x26a69a;};'use strict';var client=require('../client');exports[_0xd028('0x0')]=function(_0x124fc2){return function(_0x51288f){return client[_0xd028('0x1')](_0xd028('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd028('0x3'),_0xd028('0x4'),_0xd028('0x5')]},'log':_0xd028('0x2')});};}; \ No newline at end of file +var _0x15ab=['defaultuser','../client','getTrunks','Request','GetTrunk','name','registry'];(function(_0x39bea2,_0x3ba326){var _0x566f0a=function(_0xc248b0){while(--_0xc248b0){_0x39bea2['push'](_0x39bea2['shift']());}};_0x566f0a(++_0x3ba326);}(_0x15ab,0xda));var _0xb15a=function(_0x13d46a,_0x1eb4b5){_0x13d46a=_0x13d46a-0x0;var _0x1d67a9=_0x15ab[_0x13d46a];return _0x1d67a9;};'use strict';var client=require(_0xb15a('0x0'));exports[_0xb15a('0x1')]=function(_0x20bc73){return function(_0x1b1e16){return client[_0xb15a('0x2')](_0xb15a('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb15a('0x4'),_0xb15a('0x5'),_0xb15a('0x6')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 1e5b63f..fb8241c 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(_0x57227b,_0x561a3a){var _0x2d90f1=function(_0x418b8a){while(--_0x418b8a){_0x57227b['push'](_0x57227b['shift']());}};_0x2d90f1(++_0x561a3a);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e8712,_0x46f28c){_0x4e8712=_0x4e8712-0x0;var _0x131241=_0xedd9[_0x4e8712];return _0x131241;};'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(_0x583700,_0xd451){var _0x37a58f=function(_0x5d3bc6){while(--_0x5d3bc6){_0x583700['push'](_0x583700['shift']());}};_0x37a58f(++_0xd451);}(_0x70e0,0x17b));var _0x070e=function(_0x219ad8,_0x463561){_0x219ad8=_0x219ad8-0x0;var _0x56de96=_0x70e0[_0x219ad8];return _0x56de96;};'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 2f2ffbc..4b7aaa0 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 _0x8f37=['CreateVoiceAgentReport','UpdateVoiceAgentReport','create','Request'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x8f37,0x15a));var _0x78f3=function(_0x1e4608,_0x2c8ecf){_0x1e4608=_0x1e4608-0x0;var _0x498289=_0x8f37[_0x1e4608];return _0x498289;};'use strict';var client=require('../client');exports[_0x78f3('0x0')]=function(_0x30daee){return client[_0x78f3('0x1')]('CreateVoiceAgentReport',{'body':_0x30daee,'log':_0x78f3('0x2')});};exports['update']=function(_0x17a35d,_0x119a8b,_0x46cb57){return client[_0x78f3('0x1')](_0x78f3('0x3'),{'body':_0x17a35d,'options':{'where':{'uniqueid':_0x119a8b,'interface':_0x46cb57,'agentcomplete':!![]}},'log':_0x78f3('0x3')});}; \ No newline at end of file +var _0xe982=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xe982,0x198));var _0x2e98=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe982[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0x2e98('0x0'));exports[_0x2e98('0x1')]=function(_0x3b7413){return client[_0x2e98('0x2')](_0x2e98('0x3'),{'body':_0x3b7413,'log':_0x2e98('0x3')});};exports[_0x2e98('0x4')]=function(_0x4aada2,_0x1fbf56,_0x4cd646){return client[_0x2e98('0x2')](_0x2e98('0x5'),{'body':_0x4aada2,'options':{'where':{'uniqueid':_0x1fbf56,'interface':_0x4cd646,'agentcomplete':!![]}},'log':_0x2e98('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index e9775b6..1a9681f 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 _0x613d=['CreateVoiceCallReport','merge','callerid','DOCUMENTATION','getVoiceCallReports','Request','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client'];(function(_0x45a08b,_0x14c134){var _0xac8e84=function(_0x3a7a3f){while(--_0x3a7a3f){_0x45a08b['push'](_0x45a08b['shift']());}};_0xac8e84(++_0x14c134);}(_0x613d,0x1a0));var _0xd613=function(_0x24ae03,_0x334660){_0x24ae03=_0x24ae03-0x0;var _0x38a29e=_0x613d[_0x24ae03];return _0x38a29e;};'use strict';var moment=require(_0xd613('0x0'));var util=require(_0xd613('0x1'));var _=require(_0xd613('0x2'));var client=require(_0xd613('0x3'));exports['create']=function(_0x52e258){return client['Request'](_0xd613('0x4'),{'body':_[_0xd613('0x5')](_0x52e258,{'source':_0x52e258['calleridnum'],'destinationcontext':_0x52e258['context'],'callerid':_0x52e258[_0xd613('0x6')],'amaflags':_0xd613('0x7')}),'log':_0xd613('0x4')});};exports[_0xd613('0x8')]=function(){return function(){return client[_0xd613('0x9')](_0xd613('0xa'),{'options':{'where':{'type':[_0xd613('0xb')],'createdAt':{'$between':[moment()[_0xd613('0xc')](_0xd613('0xd'))[_0xd613('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xd613('0xf')]('day')[_0xd613('0xe')](_0xd613('0x10'))]}},'attributes':['type','disposition',_0xd613('0x11'),_0xd613('0x12')]},'log':_0xd613('0x13')});};}; \ No newline at end of file +var _0x2100=['create','Request','CreateVoiceCallReport','merge','context','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','../client'];(function(_0x2d4d40,_0x2744ed){var _0xf1c1cc=function(_0x11b82b){while(--_0x11b82b){_0x2d4d40['push'](_0x2d4d40['shift']());}};_0xf1c1cc(++_0x2744ed);}(_0x2100,0xec));var _0x0210=function(_0x1bd3ab,_0x352c42){_0x1bd3ab=_0x1bd3ab-0x0;var _0x37e394=_0x2100[_0x1bd3ab];return _0x37e394;};'use strict';var moment=require(_0x0210('0x0'));var util=require(_0x0210('0x1'));var _=require(_0x0210('0x2'));var client=require(_0x0210('0x3'));exports[_0x0210('0x4')]=function(_0x19fb52){return client[_0x0210('0x5')](_0x0210('0x6'),{'body':_[_0x0210('0x7')](_0x19fb52,{'source':_0x19fb52['calleridnum'],'destinationcontext':_0x19fb52[_0x0210('0x8')],'callerid':_0x19fb52['callerid'],'amaflags':_0x0210('0x9')}),'log':_0x0210('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x0210('0x5')](_0x0210('0xa'),{'options':{'where':{'type':[_0x0210('0xb')],'createdAt':{'$between':[moment()[_0x0210('0xc')](_0x0210('0xd'))[_0x0210('0xe')](_0x0210('0xf')),moment()['endOf']('day')[_0x0210('0xe')](_0x0210('0xf'))]}},'attributes':[_0x0210('0x10'),_0x0210('0x11'),'duration',_0x0210('0x12')]},'log':_0x0210('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d9ed8cb..8aa02c2 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 _0x2d9e=['CreateVoiceDialReport','../client'];(function(_0x20bc8f,_0x3d65c7){var _0x1e93f6=function(_0x52d710){while(--_0x52d710){_0x20bc8f['push'](_0x20bc8f['shift']());}};_0x1e93f6(++_0x3d65c7);}(_0x2d9e,0x1b3));var _0xe2d9=function(_0x1a974c,_0x3c8740){_0x1a974c=_0x1a974c-0x0;var _0x7c9971=_0x2d9e[_0x1a974c];return _0x7c9971;};'use strict';var client=require(_0xe2d9('0x0'));exports['create']=function(_0x213094){return client['Request'](_0xe2d9('0x1'),{'body':_0x213094,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x544b=['../client','Request','CreateVoiceDialReport'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x544b,0x72));var _0xb544=function(_0x69e2cb,_0x4e57b9){_0x69e2cb=_0x69e2cb-0x0;var _0x22cf22=_0x544b[_0x69e2cb];return _0x22cf22;};'use strict';var client=require(_0xb544('0x0'));exports['create']=function(_0x2bafc7){return client[_0xb544('0x1')](_0xb544('0x2'),{'body':_0x2bafc7,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 1dac733..9032253 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 _0x97a2=['getVoiceExtensions','../client','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x4f21fd,_0x324269){var _0x5eeb53=function(_0x1aa9dc){while(--_0x1aa9dc){_0x4f21fd['push'](_0x4f21fd['shift']());}};_0x5eeb53(++_0x324269);}(_0x97a2,0x1b1));var _0x297a=function(_0x2c99ea,_0x1472d2){_0x2c99ea=_0x2c99ea-0x0;var _0xa92ce2=_0x97a2[_0x2c99ea];return _0xa92ce2;};'use strict';var client=require(_0x297a('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x297a('0x1')](_0x297a('0x2'),{'options':{'raw':!![],'attributes':['id',_0x297a('0x3'),_0x297a('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x297a('0x5')});};}; \ No newline at end of file +var _0x5b02=['GetVoiceExtension','../client','getVoiceExtensions','Request'];(function(_0x45ca6c,_0x55162c){var _0x4650c7=function(_0xa9d987){while(--_0xa9d987){_0x45ca6c['push'](_0x45ca6c['shift']());}};_0x4650c7(++_0x55162c);}(_0x5b02,0xe9));var _0x25b0=function(_0x4c9993,_0x3ab497){_0x4c9993=_0x4c9993-0x0;var _0x3cf412=_0x5b02[_0x4c9993];return _0x3cf412;};'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 c9862ee..c79ebab 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 _0x78d4=['dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x78d4,0xf7));var _0x478d=function(_0xefcf0,_0xd75aa){_0xefcf0=_0xefcf0-0x0;var _0x418209=_0x78d4[_0xefcf0];return _0x418209;};'use strict';var client=require(_0x478d('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x478d('0x1')](_0x478d('0x2'),{'options':{'raw':![],'attributes':['id',_0x478d('0x3'),'acw',_0x478d('0x4'),_0x478d('0x5'),_0x478d('0x6'),_0x478d('0x7'),_0x478d('0x8'),_0x478d('0x9'),_0x478d('0xa'),_0x478d('0xb'),_0x478d('0xc'),_0x478d('0xd'),'dialPredictiveOptimizationPercentage',_0x478d('0xe'),_0x478d('0xf'),_0x478d('0x10'),_0x478d('0x11'),_0x478d('0x12'),_0x478d('0x13'),_0x478d('0x14'),_0x478d('0x15'),_0x478d('0x16'),_0x478d('0x17'),_0x478d('0x18'),_0x478d('0x19'),_0x478d('0x1a'),_0x478d('0x1b'),_0x478d('0x1c'),'dialGlobalInterval',_0x478d('0x1d'),_0x478d('0x1e'),_0x478d('0x1f'),_0x478d('0x20'),_0x478d('0x21'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x478d('0x22'),_0x478d('0x23'),'dialAMDMaximumNumberOfWords',_0x478d('0x24'),_0x478d('0x25'),'timeout','dialRecallMeTimeout',_0x478d('0x26'),_0x478d('0x27'),'dialAgiAfterHangupAgent',_0x478d('0x28'),_0x478d('0x29'),_0x478d('0x6'),_0x478d('0x2a'),_0x478d('0x2b'),'dialCutDigit',_0x478d('0x2c'),'dialNoSuchNumberRetryFrequency',_0x478d('0x2d'),_0x478d('0x2e'),_0x478d('0x2f'),_0x478d('0x30'),_0x478d('0x31'),_0x478d('0x32'),'dialAgentRejectMaxRetry',_0x478d('0x33'),_0x478d('0x34'),_0x478d('0x35'),_0x478d('0x36'),_0x478d('0x37'),_0x478d('0x38')],'include':[{'model':_0x478d('0x39'),'as':_0x478d('0x39'),'attributes':['id',_0x478d('0x3'),_0x478d('0x3a'),_0x478d('0x3b')]},{'model':'Pause','as':_0x478d('0x3c'),'attributes':['id',_0x478d('0x3')]},{'model':'Trunk','as':_0x478d('0x3d'),'attributes':['id',_0x478d('0x3'),_0x478d('0x3a'),_0x478d('0x3b')]},{'model':'Interval','as':_0x478d('0x3e'),'attributes':['id',_0x478d('0x3')],'include':[{'model':'Interval','as':_0x478d('0x3f'),'attributes':['id',_0x478d('0x3'),_0x478d('0x40')]}]}]},'log':_0x478d('0x41')});};}; \ No newline at end of file +var _0x80d1=['dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','Interval','interval','getVoiceQueues','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue'];(function(_0x3dfcef,_0x407f9d){var _0x248d9d=function(_0x2a619c){while(--_0x2a619c){_0x3dfcef['push'](_0x3dfcef['shift']());}};_0x248d9d(++_0x407f9d);}(_0x80d1,0xb7));var _0x180d=function(_0x4becf2,_0x52a2d6){_0x4becf2=_0x4becf2-0x0;var _0x2c07af=_0x80d1[_0x4becf2];return _0x2c07af;};'use strict';var client=require(_0x180d('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x180d('0x1')](_0x180d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x180d('0x3'),_0x180d('0x4'),_0x180d('0x5'),_0x180d('0x6'),_0x180d('0x7'),_0x180d('0x8'),_0x180d('0x9'),_0x180d('0xa'),_0x180d('0xb'),_0x180d('0xc'),_0x180d('0xd'),_0x180d('0xe'),_0x180d('0xf'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x180d('0x10'),_0x180d('0x11'),_0x180d('0x12'),_0x180d('0x13'),_0x180d('0x14'),_0x180d('0x15'),'dialBusyMaxRetry',_0x180d('0x16'),_0x180d('0x17'),_0x180d('0x18'),_0x180d('0x19'),_0x180d('0x1a'),_0x180d('0x1b'),'dialPrefix','dialCheckDuplicateType',_0x180d('0x1c'),_0x180d('0x1d'),_0x180d('0x1e'),'dialAMDAfterGreetingSilence',_0x180d('0x1f'),_0x180d('0x20'),_0x180d('0x21'),_0x180d('0x22'),_0x180d('0x23'),'dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue',_0x180d('0x24'),_0x180d('0x25'),_0x180d('0x26'),_0x180d('0x27'),'monitor_format',_0x180d('0x28'),_0x180d('0x29'),_0x180d('0x2a'),_0x180d('0x2b'),_0x180d('0x2c'),_0x180d('0x2d'),'dialDropRetryFrequency',_0x180d('0x2e'),_0x180d('0x2f'),'dialMachineMaxRetry',_0x180d('0x30'),_0x180d('0x31'),_0x180d('0x32'),_0x180d('0x33'),_0x180d('0x34'),_0x180d('0x35'),_0x180d('0x36'),_0x180d('0x37')],'include':[{'model':_0x180d('0x38'),'as':_0x180d('0x38'),'attributes':['id',_0x180d('0x39'),_0x180d('0x3a'),_0x180d('0x3b')]},{'model':_0x180d('0x3c'),'as':_0x180d('0x3d'),'attributes':['id',_0x180d('0x39')]},{'model':_0x180d('0x38'),'as':'TrunkBackup','attributes':['id',_0x180d('0x39'),_0x180d('0x3a'),_0x180d('0x3b')]},{'model':_0x180d('0x3e'),'as':_0x180d('0x3e'),'attributes':['id',_0x180d('0x39')],'include':[{'model':_0x180d('0x3e'),'as':'Intervals','attributes':['id',_0x180d('0x39'),_0x180d('0x3f')]}]}]},'log':_0x180d('0x40')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 590d53c..8cbd1c8 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(_0x2b0468,_0xca7a6b){var _0x14f07a=function(_0x4083c0){while(--_0x4083c0){_0x2b0468['push'](_0x2b0468['shift']());}};_0x14f07a(++_0xca7a6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x4a048d,_0x2dba04){var _0x57adaa=function(_0x3a29ab){while(--_0x3a29ab){_0x4a048d['push'](_0x4a048d['shift']());}};_0x57adaa(++_0x2dba04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 76a9fc9..a75ec30 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 _0x764d=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x2847d0,_0x10a787){var _0x1cc209=function(_0x3863ff){while(--_0x3863ff){_0x2847d0['push'](_0x2847d0['shift']());}};_0x1cc209(++_0x10a787);}(_0x764d,0x1de));var _0xd764=function(_0x3f2a90,_0x50baf1){_0x3f2a90=_0x3f2a90-0x0;var _0xb46279=_0x764d[_0x3f2a90];return _0xb46279;};'use strict';var client=require(_0xd764('0x0'));exports[_0xd764('0x1')]=function(_0x5cfd85){return function(){return client[_0xd764('0x2')](_0xd764('0x3'),{'options':{'where':{'VoiceQueueId':_0x5cfd85,'paused':!![]},'raw':!![]},'log':_0xd764('0x1')});};}; \ No newline at end of file +var _0xd85e=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x4428ee,_0x372f10){var _0x3e8cb4=function(_0x22807c){while(--_0x22807c){_0x4428ee['push'](_0x4428ee['shift']());}};_0x3e8cb4(++_0x372f10);}(_0xd85e,0x181));var _0xed85=function(_0x2456e1,_0x5293fd){_0x2456e1=_0x2456e1-0x0;var _0x24dc85=_0xd85e[_0x2456e1];return _0x24dc85;};'use strict';var client=require(_0xed85('0x0'));exports[_0xed85('0x1')]=function(_0x1a3217){return function(){return client[_0xed85('0x2')](_0xed85('0x3'),{'options':{'where':{'VoiceQueueId':_0x1a3217,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index ae285a7..5dd1e3f 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x152a80,_0x40ee0a){var _0x4255ce=function(_0x220da2){while(--_0x220da2){_0x152a80['push'](_0x152a80['shift']());}};_0x4255ce(++_0x40ee0a);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x1aa7eb,_0x11398b){var _0x1c0659=function(_0x4a37a3){while(--_0x4a37a3){_0x1aa7eb['push'](_0x1aa7eb['shift']());}};_0x1c0659(++_0x11398b);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 bfe4477..713ce83 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 _0x8d76=['origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeaccountcode','transfereecontext','transfereelinkedid','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext'];(function(_0x352420,_0x20f263){var _0x447752=function(_0x587534){while(--_0x587534){_0x352420['push'](_0x352420['shift']());}};_0x447752(++_0x20f263);}(_0x8d76,0x1bb));var _0x68d7=function(_0x518aa7,_0x53c94d){_0x518aa7=_0x518aa7-0x0;var _0x1a1215=_0x8d76[_0x518aa7];return _0x1a1215;};'use strict';var client=require(_0x68d7('0x0'));exports['transfers']={};exports[_0x68d7('0x1')]=function(_0x29450a){return client['Request'](_0x68d7('0x2'),{'body':{'result':_0x29450a[_0x68d7('0x3')],'transfererchannel':_0x29450a['transfererchannel'],'transferercalleridnum':_0x29450a['transferercalleridnum'],'transferercalleridname':_0x29450a[_0x68d7('0x4')],'transfererconnectedlinenum':_0x29450a[_0x68d7('0x5')],'transfererconnectedlinename':_0x29450a[_0x68d7('0x6')],'transfereraccountcode':_0x29450a['transfereraccountcode'],'transferercontext':_0x29450a['transferercontext'],'transfererexten':_0x29450a['transfererexten'],'transfererlinkedid':_0x29450a[_0x68d7('0x7')],'transfereechannel':_0x29450a[_0x68d7('0x8')],'transfereecalleridnum':_0x29450a[_0x68d7('0x9')],'transfereecalleridname':_0x29450a[_0x68d7('0xa')],'transfereeconnectedlinenum':_0x29450a['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x29450a['transfereeconnectedlinename'],'transfereeaccountcode':_0x29450a[_0x68d7('0xb')],'transfereecontext':_0x29450a[_0x68d7('0xc')],'transfereeexten':_0x29450a['transfereeexten'],'transfereelinkedid':_0x29450a[_0x68d7('0xd')],'isexternal':_0x29450a['isexternal'],'context':_0x29450a[_0x68d7('0xe')],'extension':_0x29450a[_0x68d7('0xf')],'type':_0x68d7('0x10')},'log':_0x68d7('0x2')});};exports[_0x68d7('0x11')]=function(_0x319f0e){return client['Request'](_0x68d7('0x2'),{'body':{'result':_0x319f0e[_0x68d7('0x3')],'transfererchannel':_0x319f0e[_0x68d7('0x12')],'transferercalleridnum':_0x319f0e[_0x68d7('0x13')],'transferercalleridname':_0x319f0e[_0x68d7('0x14')],'transfererconnectedlinenum':_0x319f0e[_0x68d7('0x15')],'transfererconnectedlinename':_0x319f0e[_0x68d7('0x16')],'transfereraccountcode':_0x319f0e[_0x68d7('0x17')],'transferercontext':_0x319f0e[_0x68d7('0x18')],'transfererexten':_0x319f0e['secondtransfererexten'],'transfererlinkedid':_0x319f0e[_0x68d7('0x19')],'transfereechannel':_0x319f0e[_0x68d7('0x1a')],'transfereecalleridnum':_0x319f0e[_0x68d7('0x1b')],'transfereecalleridname':_0x319f0e[_0x68d7('0x1c')],'transfereeconnectedlinenum':_0x319f0e['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x319f0e['transfertargetconnectedlinename'],'transfereeaccountcode':_0x319f0e[_0x68d7('0x1d')],'transfereecontext':_0x319f0e[_0x68d7('0x1e')],'transfereeexten':_0x319f0e[_0x68d7('0x1f')],'transfereelinkedid':_0x319f0e[_0x68d7('0x20')],'isexternal':_0x319f0e[_0x68d7('0x21')],'context':_0x319f0e[_0x68d7('0x22')],'extension':_0x319f0e['origtransfererexten'],'type':_0x68d7('0x23')},'log':_0x68d7('0x2')});}; \ No newline at end of file +var _0x2cd4=['transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel'];(function(_0x33d778,_0x1a1ceb){var _0x489a34=function(_0x46cf9a){while(--_0x46cf9a){_0x33d778['push'](_0x33d778['shift']());}};_0x489a34(++_0x1a1ceb);}(_0x2cd4,0x16f));var _0x42cd=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0x2cd4[_0x8af54b];return _0x27d8f0;};'use strict';var client=require(_0x42cd('0x0'));exports[_0x42cd('0x1')]={};exports[_0x42cd('0x2')]=function(_0x4bf78b){return client[_0x42cd('0x3')](_0x42cd('0x4'),{'body':{'result':_0x4bf78b[_0x42cd('0x5')],'transfererchannel':_0x4bf78b[_0x42cd('0x6')],'transferercalleridnum':_0x4bf78b[_0x42cd('0x7')],'transferercalleridname':_0x4bf78b[_0x42cd('0x8')],'transfererconnectedlinenum':_0x4bf78b[_0x42cd('0x9')],'transfererconnectedlinename':_0x4bf78b[_0x42cd('0xa')],'transfereraccountcode':_0x4bf78b[_0x42cd('0xb')],'transferercontext':_0x4bf78b[_0x42cd('0xc')],'transfererexten':_0x4bf78b[_0x42cd('0xd')],'transfererlinkedid':_0x4bf78b['transfererlinkedid'],'transfereechannel':_0x4bf78b['transfereechannel'],'transfereecalleridnum':_0x4bf78b[_0x42cd('0xe')],'transfereecalleridname':_0x4bf78b['transfereecalleridname'],'transfereeconnectedlinenum':_0x4bf78b[_0x42cd('0xf')],'transfereeconnectedlinename':_0x4bf78b[_0x42cd('0x10')],'transfereeaccountcode':_0x4bf78b[_0x42cd('0x11')],'transfereecontext':_0x4bf78b[_0x42cd('0x12')],'transfereeexten':_0x4bf78b[_0x42cd('0x13')],'transfereelinkedid':_0x4bf78b['transfereelinkedid'],'isexternal':_0x4bf78b[_0x42cd('0x14')],'context':_0x4bf78b[_0x42cd('0x15')],'extension':_0x4bf78b['extension'],'type':_0x42cd('0x16')},'log':_0x42cd('0x4')});};exports['attendedTransfer']=function(_0x5a88c7){return client[_0x42cd('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x5a88c7['result'],'transfererchannel':_0x5a88c7[_0x42cd('0x17')],'transferercalleridnum':_0x5a88c7[_0x42cd('0x18')],'transferercalleridname':_0x5a88c7[_0x42cd('0x19')],'transfererconnectedlinenum':_0x5a88c7[_0x42cd('0x1a')],'transfererconnectedlinename':_0x5a88c7[_0x42cd('0x1b')],'transfereraccountcode':_0x5a88c7[_0x42cd('0x1c')],'transferercontext':_0x5a88c7[_0x42cd('0x1d')],'transfererexten':_0x5a88c7[_0x42cd('0x1e')],'transfererlinkedid':_0x5a88c7[_0x42cd('0x1f')],'transfereechannel':_0x5a88c7[_0x42cd('0x20')],'transfereecalleridnum':_0x5a88c7[_0x42cd('0x21')],'transfereecalleridname':_0x5a88c7[_0x42cd('0x22')],'transfereeconnectedlinenum':_0x5a88c7['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x5a88c7['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5a88c7[_0x42cd('0x23')],'transfereecontext':_0x5a88c7[_0x42cd('0x24')],'transfereeexten':_0x5a88c7[_0x42cd('0x25')],'transfereelinkedid':_0x5a88c7['transfertargetlinkedid'],'isexternal':_0x5a88c7[_0x42cd('0x14')],'context':_0x5a88c7[_0x42cd('0x26')],'extension':_0x5a88c7['origtransfererexten'],'type':_0x42cd('0x27')},'log':_0x42cd('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 93dd187..bca6687 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 _0x90ec=['undefined','values','channels','voicechannel','map','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','StopMixMonitor\x20Success','voicequeuechannel','voicequeuechannelhangup','queueChannels','Hangup','Redirect','exten','context','agents','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','listen','format','%s/%s','SIP','name','timers','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','action','Action','then','message','catch','join','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','push','length','find','omit'];(function(_0x4d585d,_0x45fe07){var _0x371652=function(_0x4259c8){while(--_0x4259c8){_0x4d585d['push'](_0x4d585d['shift']());}};_0x371652(++_0x45fe07);}(_0x90ec,0x1d4));var _0xc90e=function(_0x4f3039,_0x100a43){_0x4f3039=_0x4f3039-0x0;var _0x13218c=_0x90ec[_0x4f3039];return _0x13218c;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var jayson=require('jayson/promise');var schema=require(_0xc90e('0x2'));var BPromise=require(_0xc90e('0x3'));var moment=require(_0xc90e('0x4'));var config=require(_0xc90e('0x5'));var properties=require(_0xc90e('0x6'));var ami=require('../ami');exports[_0xc90e('0x7')]=function(_0x207b98,_0x206583,_0x54a0a8){return new BPromise(function(_0x259c62,_0x48bea9){var _0x42051a={'QueuePause':function(_0x14311a){return new Promise(function(_0x48253c,_0x3bc98f){var _0xd539f6=util[_0xc90e('0x8')](_0xc90e('0x9'),_0xc90e('0xa'),_0x14311a[_0xc90e('0xb')]);if(_0x207b98[_0xc90e('0xc')]&&_0x207b98[_0xc90e('0xc')][_0xd539f6]&&_0x207b98[_0xc90e('0xc')][_0xd539f6]['timer']){_0x207b98[_0xc90e('0xc')][_0xd539f6]['updateAcw']();}if(_0x207b98['agents'][_0xd539f6]){_0x207b98['agents'][_0xd539f6]['updateStatusRealtime']({'statePause':_0x14311a[_0xc90e('0xd')]?!![]:![]});}_0x48253c({'code':0xc8,'message':_0xc90e('0xe')});});},'Reload':function(_0x5cef50){var _0x37321a=this;return new Promise(function(_0x98aa2b,_0x52beef){if(ami[_0xc90e('0xf')]()==![]){return _0x52beef(_0x37321a[_0xc90e('0x10')](0x1f4,[config[_0xc90e('0x11')]['ip'],config[_0xc90e('0x11')][_0xc90e('0x12')],_0xc90e('0x13')]['join']('\x20')));}_0x5cef50=_[_0xc90e('0x14')](_0x5cef50,_[_0xc90e('0x15')](properties['module']));_0x5cef50[_0xc90e('0x16')]='Reload';return ami[_0xc90e('0x17')](_0x5cef50)[_0xc90e('0x18')](function(_0x558b22){_0x98aa2b({'code':0xc8,'message':_0x558b22[_0xc90e('0x19')]});})[_0xc90e('0x1a')](function(_0x17ec6b){_0x52beef(_0x37321a['error'](0x1f5,_0x17ec6b['message']));});});},'Command':function(_0x486725){var _0x161a3a=this;return new Promise(function(_0x147120,_0x25b1d7){if(ami[_0xc90e('0xf')]()==![]){return _0x25b1d7(_0x161a3a[_0xc90e('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xc90e('0x11')]['username'],_0xc90e('0x13')][_0xc90e('0x1b')]('\x20')));}_0x486725=_['pick'](_0x486725,_0xc90e('0x1c'));_0x486725[_0xc90e('0x16')]=_0xc90e('0x1d');return ami[_0xc90e('0x17')](_0x486725)[_0xc90e('0x18')](function(_0x282c53){_0x147120({'code':0xc8,'message':_0x282c53[_0xc90e('0x1e')]});})[_0xc90e('0x1a')](function(_0x1cff73){_0x25b1d7(_0x161a3a['error'](0x1f5,_0x1cff73[_0xc90e('0x19')]));});});},'VoiceQueues':function(_0x41deea){return new Promise(function(_0x25223e,_0x380f3f){var _0x3371aa=[];for(var _0x59d731 in _0x207b98[_0xc90e('0x1f')]){if(_0x207b98[_0xc90e('0x1f')][_0xc90e('0x20')](_0x59d731)){var _0x4fde04=_0x207b98[_0xc90e('0x1f')][_0x59d731];var _0x2ea6e6={'id':_0x4fde04['id'],'name':_0x4fde04[_0xc90e('0xb')],'strategy':_0x4fde04[_0xc90e('0x21')],'answered':_0x4fde04[_0xc90e('0x22')],'available':_0x4fde04[_0xc90e('0x23')],'loggedIn':_0x4fde04['loggedIn'],'pTalking':_0x4fde04['pTalking'],'sumBillable':_0x4fde04[_0xc90e('0x24')],'sumDuration':_0x4fde04['sumDuration'],'sumHoldTime':_0x4fde04[_0xc90e('0x25')]||0x0,'talking':_0x4fde04[_0xc90e('0x26')],'total':_0x4fde04[_0xc90e('0x27')],'type':_0x4fde04[_0xc90e('0x28')],'unmanaged':_0x4fde04[_0xc90e('0x29')],'abandoned':_0x4fde04[_0xc90e('0x2a')],'waiting':_0x4fde04[_0xc90e('0x2b')],'loggedInDb':_0x4fde04['loggedInDb']};if(_0x4fde04[_0xc90e('0x28')]===_0xc90e('0x2c')){_0x2ea6e6['dialActive']=_0x4fde04[_0xc90e('0x2d')];_0x2ea6e6['dialMethod']=_0x4fde04[_0xc90e('0x2e')];_0x2ea6e6[_0xc90e('0x2f')]=_0x4fde04[_0xc90e('0x2f')];_0x2ea6e6[_0xc90e('0x30')]=_0x4fde04[_0xc90e('0x30')];_0x2ea6e6[_0xc90e('0x31')]=_0x4fde04[_0xc90e('0x31')];_0x2ea6e6[_0xc90e('0x32')]=_0x4fde04[_0xc90e('0x32')];_0x2ea6e6['temp']=_0x4fde04['temp'];_0x2ea6e6[_0xc90e('0x33')]=_0x4fde04[_0xc90e('0x33')];_0x2ea6e6[_0xc90e('0x34')]=_0x4fde04[_0xc90e('0x34')];_0x2ea6e6[_0xc90e('0x35')]=_0x4fde04[_0xc90e('0x35')];_0x2ea6e6[_0xc90e('0x36')]=_0x4fde04[_0xc90e('0x36')];_0x2ea6e6[_0xc90e('0x37')]=_0x4fde04[_0xc90e('0x37')];_0x2ea6e6['outboundDropCallsDayACS']=_0x4fde04[_0xc90e('0x38')];_0x2ea6e6[_0xc90e('0x39')]=_0x4fde04[_0xc90e('0x39')];_0x2ea6e6[_0xc90e('0x3a')]=_0x4fde04['outboundDropCallsDayTimeout'];_0x2ea6e6['outboundNoAnswerCallsDay']=_0x4fde04['outboundNoAnswerCallsDay'];_0x2ea6e6[_0xc90e('0x3b')]=_0x4fde04[_0xc90e('0x3b')];_0x2ea6e6[_0xc90e('0x3c')]=_0x4fde04[_0xc90e('0x3c')];_0x2ea6e6[_0xc90e('0x3d')]=_0x4fde04['outboundReCallsDay'];_0x2ea6e6[_0xc90e('0x3e')]=_0x4fde04[_0xc90e('0x3e')];_0x2ea6e6[_0xc90e('0x3f')]=_0x4fde04[_0xc90e('0x3f')];_0x2ea6e6[_0xc90e('0x40')]=_0x4fde04[_0xc90e('0x40')];_0x2ea6e6[_0xc90e('0x41')]=_0x4fde04[_0xc90e('0x41')];_0x2ea6e6[_0xc90e('0x42')]=_0x4fde04[_0xc90e('0x42')];_0x2ea6e6[_0xc90e('0x43')]=_0x4fde04[_0xc90e('0x43')];_0x2ea6e6[_0xc90e('0x44')]=_0x4fde04['predictiveIntervalDroppedCallsTimeout'];_0x2ea6e6[_0xc90e('0x45')]=_0x4fde04[_0xc90e('0x45')];_0x2ea6e6['predictiveIntervalErlangCallsDroppedCalls']=_0x4fde04['predictiveIntervalErlangCallsDroppedCalls'];_0x2ea6e6[_0xc90e('0x46')]=_0x4fde04['predictiveIntervalHitRate'];_0x2ea6e6[_0xc90e('0x47')]=_0x4fde04[_0xc90e('0x47')];_0x2ea6e6['predictiveIntervalPauses']=_0x4fde04[_0xc90e('0x48')];_0x2ea6e6['predictiveIntervalAvailable']=_0x4fde04['predictiveIntervalAvailable'];_0x2ea6e6[_0xc90e('0x49')]=_0x4fde04['predictiveIntervalTotalCalls'];_0x2ea6e6['message']=_0x4fde04[_0xc90e('0x19')];_0x2ea6e6[_0xc90e('0x4a')]=_0x4fde04['originated'];_0x2ea6e6[_0xc90e('0x4b')]=_0x4fde04[_0xc90e('0x4b')];_0x2ea6e6[_0xc90e('0x4c')]=_0x4fde04[_0xc90e('0x4c')];_0x2ea6e6[_0xc90e('0x4d')]=_0x4fde04[_0xc90e('0x4d')];_0x2ea6e6[_0xc90e('0x4e')]=_0x4fde04[_0xc90e('0x4e')];_0x2ea6e6['startPredictive']=_0x4fde04[_0xc90e('0x4f')];_0x2ea6e6['startProgressive']=_0x4fde04['startProgressive'];}if(_0x4fde04[_0xc90e('0x50')]){_0x2ea6e6['Trunk']={'id':_0x4fde04[_0xc90e('0x50')]['id'],'name':_0x4fde04['Trunk'][_0xc90e('0xb')],'active':_0x4fde04[_0xc90e('0x50')][_0xc90e('0x51')],'callerid':_0x4fde04[_0xc90e('0x50')][_0xc90e('0x52')]};}if(_0x4fde04[_0xc90e('0x53')]){_0x2ea6e6[_0xc90e('0x53')]={'id':_0x4fde04[_0xc90e('0x53')]['id'],'name':_0x4fde04[_0xc90e('0x53')]['name']};}_0x3371aa[_0xc90e('0x54')](_0x2ea6e6);}}_0x25223e({'count':_0x3371aa[_0xc90e('0x55')],'rows':_0x3371aa});});},'UpdateVoiceQueue':function(_0x317aa7){return new Promise(function(_0x24d0ca,_0x5dd284){var _0x21408a=_[_0xc90e('0x56')](_0x207b98[_0xc90e('0x1f')],{'id':parseInt(_0x317aa7['id'])});var _0x48cb44=_[_0xc90e('0x57')](_0x317aa7,['id']);if(_0x21408a){for(var _0x49c8ab in _0x48cb44){if(typeof _0x48cb44[_0x49c8ab]!==_0xc90e('0x58')&&typeof _0x21408a[_0x49c8ab]!=='undefined'){_0x21408a[_0x49c8ab]=_0x48cb44[_0x49c8ab];}}_0x24d0ca(_0x21408a);}else{_0x5dd284();}});},'VoiceChannels':function(_0x130263){return new Promise(function(_0x55e36b,_0x18cd72){var _0x45c1e0=_[_0xc90e('0x59')](_0x207b98[_0xc90e('0x5a')]);_0x55e36b({'count':_0x45c1e0[_0xc90e('0x55')],'rows':_0x45c1e0});});},'VoiceChannelMixMonitor':function(_0x35f401){var _0x1ebe62=this;return new Promise(function(_0x1d7f6a,_0x53957d){if(ami[_0xc90e('0xf')]()==![]){return _0x53957d(_0x1ebe62[_0xc90e('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xc90e('0x12')],'ami\x20disconnected'][_0xc90e('0x1b')]('\x20')));}var _0x3ae820=schema(properties[_0xc90e('0x5b')])[_0xc90e('0x2')](_0x35f401);if(_0x3ae820[_0xc90e('0x55')]>0x0){return _0x53957d(_0x1ebe62['error'](0x1f4,_[_0xc90e('0x5c')](_0x3ae820,_0xc90e('0x19'))['join'](',\x20')));}var _0x2f6d54=_['find'](_0x207b98[_0xc90e('0x5a')],{'uniqueid':_0x35f401['uniqueid']});if(_0x2f6d54&&_0x2f6d54[_0xc90e('0x5d')]){var _0x1d8bd0=util[_0xc90e('0x8')](_0xc90e('0x5e'),_0x35f401[_0xc90e('0x5f')]||_0x35f401[_0xc90e('0x60')],_0x35f401[_0xc90e('0x8')]||_0xc90e('0x61'));return ami[_0xc90e('0x17')]({'action':_0xc90e('0x62'),'channel':_0x2f6d54[_0xc90e('0x5d')],'file':_0x1d8bd0,'options':_0xc90e('0x63')})[_0xc90e('0x18')](function(_0x6d0a9d){var _0x358568=_[_0xc90e('0x56')](_0x2f6d54['monitors'],{'filename':_0xc90e('0x64')+_0x1d8bd0[_0xc90e('0x65')]()});if(_[_0xc90e('0x66')](_0x358568)){_0x2f6d54[_0xc90e('0x67')][_0xc90e('0x54')]({'filename':_0xc90e('0x64')+_0x1d8bd0[_0xc90e('0x65')](),'createdAt':moment()['format'](_0xc90e('0x68')),'mixmonitorid':_0x6d0a9d['mixmonitorid'],'status':_0xc90e('0x69')});}else{_0x358568[_0xc90e('0x6a')]=_0x6d0a9d[_0xc90e('0x6a')];_0x358568[_0xc90e('0x6b')]=_0xc90e('0x69');}_0x1d7f6a({'code':0xc8,'message':[_0x35f401['uniqueid'],_0xc90e('0x6c'),_0x6d0a9d[_0xc90e('0x6a')]]['join']('\x20'),'mixmonitorid':_0x6d0a9d[_0xc90e('0x6a')]});})[_0xc90e('0x1a')](function(_0x288571){_0x53957d(_0x1ebe62[_0xc90e('0x10')](0x1f5,[_0x35f401['uniqueid'],_0x288571['message'][_0xc90e('0x65')]()][_0xc90e('0x1b')]('\x20')));});}else{return _0x53957d(_0x1ebe62[_0xc90e('0x10')](0x1f5,_0xc90e('0x6d')));}});},'VoiceChannelStopMixMonitor':function(_0x2cc917){var _0x4c44ea=this;return new Promise(function(_0x3e8c0d,_0x40b61e){if(ami['isConnected']()==![]){return _0x40b61e(_0x4c44ea['error'](0x1f4,[config[_0xc90e('0x11')]['ip'],config[_0xc90e('0x11')][_0xc90e('0x12')],_0xc90e('0x13')]['join']('\x20')));}var _0x33cd37=schema(properties[_0xc90e('0x5b')])[_0xc90e('0x2')](_0x2cc917);if(_0x33cd37[_0xc90e('0x55')]>0x0){return _0x40b61e(_0x4c44ea[_0xc90e('0x10')](0x1f4,_[_0xc90e('0x5c')](_0x33cd37,_0xc90e('0x19'))[_0xc90e('0x1b')](',\x20')));}var _0x57db5e=_[_0xc90e('0x56')](_0x207b98[_0xc90e('0x5a')],{'uniqueid':_0x2cc917[_0xc90e('0x60')]});if(_0x57db5e){return BPromise[_0xc90e('0x6e')]()[_0xc90e('0x18')](function(){if(_0x57db5e['channel']){return ami[_0xc90e('0x17')]({'action':_0xc90e('0x6f'),'channel':_0x57db5e[_0xc90e('0x5d')],'mixmonitorid':_0x2cc917['mixmonitorid']})['catch'](function(_0x31bca6){});}})['then'](function(){if(_0x57db5e[_0xc90e('0x70')]){return ami['Action']({'action':_0xc90e('0x6f'),'channel':_0x57db5e[_0xc90e('0x70')],'mixmonitorid':_0x2cc917[_0xc90e('0x6a')]})[_0xc90e('0x1a')](function(_0x10d31b){});}})[_0xc90e('0x18')](function(_0xb44c95){var _0x5db362=_[_0xc90e('0x56')](_0x57db5e[_0xc90e('0x67')],{'mixmonitorid':_0x2cc917[_0xc90e('0x6a')]});if(_0x5db362){_0x5db362[_0xc90e('0x6b')]='stop';}})[_0xc90e('0x18')](function(){var _0x511e33=util['format']('%s.%s',_0x2cc917['filename']||_0x2cc917[_0xc90e('0x60')],_0x2cc917[_0xc90e('0x8')]||'wav');var _0x5c6240=_[_0xc90e('0x56')](_0x57db5e[_0xc90e('0x67')],{'filename':_0xc90e('0x64')+_0x511e33[_0xc90e('0x65')]()});if(_0x5c6240){_0x5c6240[_0xc90e('0x6b')]='stop';}})[_0xc90e('0x18')](function(){_0x3e8c0d({'code':0xc8,'message':[_0x2cc917[_0xc90e('0x60')],_0xc90e('0x71')][_0xc90e('0x1b')]('\x20')});})[_0xc90e('0x1a')](function(_0x4783fb){_0x40b61e(_0x4c44ea['error'](0x1f5,[_0x2cc917[_0xc90e('0x60')],_0x4783fb['message'][_0xc90e('0x65')]()]['join']('\x20')));});}else{return _0x40b61e(_0x4c44ea['error'](0x1f5,_0xc90e('0x6d')));}});},'VoiceQueuesChannels':function(_0x2b02f1){return new Promise(function(_0x51f714,_0x441879){var _0x59765e=_['values'](_0x207b98['queueChannels']);_0x51f714({'count':_0x59765e['length'],'rows':_0x59765e});});},'VoiceQueuesChannel':function(_0xa26ec4){var _0x1ac648=this;return new Promise(function(_0x5a3fc6,_0x104288){var _0x115f53=schema(properties[_0xc90e('0x72')])[_0xc90e('0x2')](_0xa26ec4);if(_0x115f53[_0xc90e('0x55')]>0x0){return _0x104288(_0x1ac648[_0xc90e('0x10')](0x1f4,_[_0xc90e('0x5c')](_0x115f53,'message')[_0xc90e('0x1b')](',\x20')));}var _0x3e88de=_['find'](_0x207b98['queueChannels'],{'uniqueid':_0xa26ec4[_0xc90e('0x60')]});if(_0x3e88de){_0x5a3fc6(_0x3e88de);}else{return _0x104288(_0x1ac648['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x1df4de){var _0x3f44f0=this;return new Promise(function(_0x3fa878,_0x16a95f){if(ami[_0xc90e('0xf')]()==![]){return _0x16a95f(_0x3f44f0[_0xc90e('0x10')](0x1f4,[config[_0xc90e('0x11')]['ip'],config['asterisk'][_0xc90e('0x12')],_0xc90e('0x13')]['join']('\x20')));}var _0x29619f=schema(properties[_0xc90e('0x73')])[_0xc90e('0x2')](_0x1df4de);if(_0x29619f['length']>0x0){return _0x16a95f(_0x3f44f0['error'](0x1f4,_[_0xc90e('0x5c')](_0x29619f,'message')[_0xc90e('0x1b')](',\x20')));}var _0x2f86a6=_[_0xc90e('0x56')](_0x207b98[_0xc90e('0x74')],{'uniqueid':_0x1df4de['uniqueid']});if(_0x2f86a6&&_0x2f86a6[_0xc90e('0x5d')]){return ami[_0xc90e('0x17')]({'action':_0xc90e('0x75'),'channel':_0x2f86a6[_0xc90e('0x5d')]})['then'](function(_0x12a7cd){_0x3fa878({'code':0xc8,'message':[_0x1df4de['uniqueid'],_0x12a7cd[_0xc90e('0x19')][_0xc90e('0x65')]()][_0xc90e('0x1b')]('\x20')});})[_0xc90e('0x1a')](function(_0x264b7f){_0x16a95f(_0x3f44f0['error'](0x1f5,[_0x1df4de[_0xc90e('0x60')],_0x264b7f[_0xc90e('0x19')]['toLowerCase']()][_0xc90e('0x1b')]('\x20')));});}else{return _0x16a95f(_0x3f44f0[_0xc90e('0x10')](0x1f5,_0xc90e('0x6d')));}});},'VoiceQueuesChannelRedirect':function(_0x387964){var _0x306002=this;return new Promise(function(_0x2915bf,_0x4b5843){if(ami['isConnected']()==![]){return _0x4b5843(_0x306002[_0xc90e('0x10')](0x1f4,[config[_0xc90e('0x11')]['ip'],config[_0xc90e('0x11')][_0xc90e('0x12')],'ami\x20disconnected'][_0xc90e('0x1b')]('\x20')));}var _0x5a3b0f=schema(properties['voicequeuechannelredirect'])[_0xc90e('0x2')](_0x387964);if(_0x5a3b0f[_0xc90e('0x55')]>0x0){return _0x4b5843(_0x306002[_0xc90e('0x10')](0x1f4,_['map'](_0x5a3b0f,_0xc90e('0x19'))[_0xc90e('0x1b')](',\x20')));}var _0xcbdef4=_[_0xc90e('0x56')](_0x207b98[_0xc90e('0x74')],{'uniqueid':_0x387964['uniqueid']});if(_0xcbdef4&&_0xcbdef4[_0xc90e('0x5d')]){return ami[_0xc90e('0x17')]({'action':_0xc90e('0x76'),'channel':_0xcbdef4[_0xc90e('0x5d')],'exten':_0x387964[_0xc90e('0x77')],'context':_0x387964['context']||_0xcbdef4[_0xc90e('0x78')],'priority':0x1})[_0xc90e('0x18')](function(_0x3926e3){_0x2915bf({'code':0xc8,'message':[_0x387964[_0xc90e('0x60')],_0x3926e3['message'][_0xc90e('0x65')]()][_0xc90e('0x1b')]('\x20')});})[_0xc90e('0x1a')](function(_0x7dd466){_0x4b5843(_0x306002['error'](0x1f5,[_0x387964[_0xc90e('0x60')],_0x7dd466[_0xc90e('0x19')][_0xc90e('0x65')]()][_0xc90e('0x1b')]('\x20')));});}else{return _0x4b5843(_0x306002['error'](0x1f5,_0xc90e('0x6d')));}});},'Agents':function(_0x5c844d){return new Promise(function(_0x466275,_0xa83990){var _0x58f17d=_[_0xc90e('0x59')](_0x207b98[_0xc90e('0x79')]);_0x466275({'count':_0x58f17d[_0xc90e('0x55')],'rows':_0x58f17d});});},'Telephones':function(_0x474b17){return new Promise(function(_0x169cf2,_0x51c8c5){var _0x1054dc=_[_0xc90e('0x59')](_0x207b98[_0xc90e('0x7a')]);_0x169cf2({'count':_0x1054dc[_0xc90e('0x55')],'rows':_0x1054dc});});},'Trunks':function(_0x32e063){return new Promise(function(_0x9ac7e9,_0x1e3aba){var _0x20adcb=_[_0xc90e('0x59')](_0x207b98[_0xc90e('0x7b')]);_0x9ac7e9({'count':_0x20adcb[_0xc90e('0x55')],'rows':_0x20adcb});});},'OutboundChannels':function(_0x5a1a79){return new Promise(function(_0x103a51,_0x1019dd){var _0x546b39=_['values'](_0x207b98[_0xc90e('0x7c')]);_0x103a51({'count':_0x546b39[_0xc90e('0x55')],'rows':_0x546b39});});},'Outbound':function(_0x4bc529){return new Promise(function(_0x5743ec,_0x49bee2){_0x5743ec(_0x207b98['outbound']);});},'Campaigns':function(_0x5f2c65){return new Promise(function(_0x1eb1b9,_0x5ba415){var _0x34ee10=_[_0xc90e('0x59')](_0x207b98[_0xc90e('0x7d')]);_0x1eb1b9({'count':_0x34ee10['length'],'rows':_0x34ee10});});},'VoiceQueuesPreview':function(_0x4fbb50){var _0x3e1e4a=this;return new Promise(function(_0x58df42,_0x2a792c){_0x206583[_0xc90e('0x7e')](_0x4fbb50['id'])[_0xc90e('0x18')](function(_0x4bad23){_0x58df42({'code':0xc8,'message':_0x4bad23[_0xc90e('0x19')]});})[_0xc90e('0x1a')](function(_0x3810fe){_0x2a792c(_0x3e1e4a['error'](0x1f4,_0x3810fe[_0xc90e('0x19')]));});});},'EventManager':function(_0x3b2c01){var _0x46e954=this;return new Promise(function(_0x5b49fe,_0x328a92){if(!_0x3b2c01['event']){return _0x328a92(_0x46e954['error'](0x1f4,_0xc90e('0x7f')));}ami[_0xc90e('0x80')](_0xc90e('0x81')+_0x3b2c01[_0xc90e('0x82')],_0x3b2c01[_0xc90e('0x19')]);_0x5b49fe({'code':0xc8,'message':_0x3b2c01});});},'FaxAccounts':function(_0x347673){return new Promise(function(_0x247c1c,_0x322f90){var _0x1800ae=_[_0xc90e('0x59')](_0x207b98[_0xc90e('0x83')]);_0x247c1c({'count':_0x1800ae['length'],'rows':_0x1800ae});});},'SendFax':function(_0x2c01f5){var _0x5c12e2=this;return new Promise(function(_0x2e8d6a,_0x19de29){_0x54a0a8[_0xc90e('0x84')](_0x2c01f5)['then'](function(_0x1ca398){_0x2e8d6a({'code':0xc8,'message':_0x1ca398[_0xc90e('0x19')]});})[_0xc90e('0x1a')](function(_0x349040){_0x19de29(_0x5c12e2[_0xc90e('0x10')](0x1f4,_0x349040[_0xc90e('0x19')]));});});},'CheckAfterSend':function(_0x467b3e){var _0x3784ba=this;return new Promise(function(_0x21ce32,_0x146b6e){_0x54a0a8[_0xc90e('0x85')](_0x467b3e)['then'](function(_0x104005){_0x21ce32({'code':0xc8,'message':_0x104005[_0xc90e('0x19')]});})[_0xc90e('0x1a')](function(_0x17e531){_0x146b6e(_0x3784ba[_0xc90e('0x10')](0x1f4,_0x17e531[_0xc90e('0x19')]));});});}};var _0x3922f5=jayson[_0xc90e('0x86')](_0x42051a)[_0xc90e('0x87')]();_0x3922f5['on'](_0xc90e('0x10'),function(_0x590b13){return _0x48bea9(_0x590b13);});_0x3922f5[_0xc90e('0x7')](0x232a,_0xc90e('0x88'),function(){console['log'](_0xc90e('0x89'),0x232a);return _0x259c62(_0xc90e('0x8a')+0x232a);});});}; \ No newline at end of file +var _0x6657=['loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','values','channels','map','uniqueid','filename','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','isConnected','command','Command','content','voiceQueues','hasOwnProperty','answered','available'];(function(_0x23eeac,_0x3b38e2){var _0x34c005=function(_0x87d52d){while(--_0x87d52d){_0x23eeac['push'](_0x23eeac['shift']());}};_0x34c005(++_0x3b38e2);}(_0x6657,0x17f));var _0x7665=function(_0x44e377,_0x44d89f){_0x44e377=_0x44e377-0x0;var _0x58a854=_0x6657[_0x44e377];return _0x58a854;};'use strict';var _=require(_0x7665('0x0'));var util=require('util');var jayson=require(_0x7665('0x1'));var schema=require(_0x7665('0x2'));var BPromise=require(_0x7665('0x3'));var moment=require(_0x7665('0x4'));var config=require('../../../config/environment');var properties=require(_0x7665('0x5'));var ami=require(_0x7665('0x6'));exports[_0x7665('0x7')]=function(_0x1c33b1,_0xcf83a8,_0x28b410){return new BPromise(function(_0x1a6f2f,_0x3387d8){var _0x4c0b5c={'QueuePause':function(_0x31da89){return new Promise(function(_0x464ec1,_0x24e6aa){var _0x37f647=util[_0x7665('0x8')](_0x7665('0x9'),_0x7665('0xa'),_0x31da89[_0x7665('0xb')]);if(_0x1c33b1['timers']&&_0x1c33b1[_0x7665('0xc')][_0x37f647]&&_0x1c33b1[_0x7665('0xc')][_0x37f647][_0x7665('0xd')]){_0x1c33b1['timers'][_0x37f647][_0x7665('0xe')]();}if(_0x1c33b1['agents'][_0x37f647]){_0x1c33b1[_0x7665('0xf')][_0x37f647][_0x7665('0x10')]({'statePause':_0x31da89['pause']?!![]:![]});}_0x464ec1({'code':0xc8,'message':_0x7665('0x11')});});},'Reload':function(_0x2e8dda){var _0x4dd9aa=this;return new Promise(function(_0x3e2717,_0x3ee33){if(ami['isConnected']()==![]){return _0x3ee33(_0x4dd9aa[_0x7665('0x12')](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}_0x2e8dda=_[_0x7665('0x17')](_0x2e8dda,_[_0x7665('0x18')](properties[_0x7665('0x19')]));_0x2e8dda[_0x7665('0x1a')]=_0x7665('0x1b');return ami[_0x7665('0x1c')](_0x2e8dda)[_0x7665('0x1d')](function(_0x34e7a8){_0x3e2717({'code':0xc8,'message':_0x34e7a8[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x522944){_0x3ee33(_0x4dd9aa[_0x7665('0x12')](0x1f5,_0x522944[_0x7665('0x1e')]));});});},'Command':function(_0x4f1f1d){var _0x32b37a=this;return new Promise(function(_0x2033a5,_0x6dd715){if(ami[_0x7665('0x20')]()==![]){return _0x6dd715(_0x32b37a['error'](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}_0x4f1f1d=_['pick'](_0x4f1f1d,_0x7665('0x21'));_0x4f1f1d['action']=_0x7665('0x22');return ami[_0x7665('0x1c')](_0x4f1f1d)['then'](function(_0x5652dd){_0x2033a5({'code':0xc8,'message':_0x5652dd[_0x7665('0x23')]});})[_0x7665('0x1f')](function(_0x4a9a25){_0x6dd715(_0x32b37a[_0x7665('0x12')](0x1f5,_0x4a9a25[_0x7665('0x1e')]));});});},'VoiceQueues':function(_0xcc4a89){return new Promise(function(_0x488d86,_0x5b5be6){var _0x566415=[];for(var _0x4dc736 in _0x1c33b1[_0x7665('0x24')]){if(_0x1c33b1[_0x7665('0x24')][_0x7665('0x25')](_0x4dc736)){var _0x5809e9=_0x1c33b1[_0x7665('0x24')][_0x4dc736];var _0x383d06={'id':_0x5809e9['id'],'name':_0x5809e9['name'],'strategy':_0x5809e9['strategy'],'answered':_0x5809e9[_0x7665('0x26')],'available':_0x5809e9[_0x7665('0x27')],'loggedIn':_0x5809e9[_0x7665('0x28')],'pTalking':_0x5809e9[_0x7665('0x29')],'sumBillable':_0x5809e9[_0x7665('0x2a')],'sumDuration':_0x5809e9[_0x7665('0x2b')],'sumHoldTime':_0x5809e9['sumHoldTime']||0x0,'talking':_0x5809e9[_0x7665('0x2c')],'total':_0x5809e9['total'],'type':_0x5809e9['type'],'unmanaged':_0x5809e9[_0x7665('0x2d')],'abandoned':_0x5809e9[_0x7665('0x2e')],'waiting':_0x5809e9[_0x7665('0x2f')],'loggedInDb':_0x5809e9[_0x7665('0x30')]};if(_0x5809e9[_0x7665('0x31')]===_0x7665('0x32')){_0x383d06[_0x7665('0x33')]=_0x5809e9[_0x7665('0x33')];_0x383d06[_0x7665('0x34')]=_0x5809e9[_0x7665('0x34')];_0x383d06[_0x7665('0x35')]=_0x5809e9[_0x7665('0x35')];_0x383d06[_0x7665('0x36')]=_0x5809e9[_0x7665('0x36')];_0x383d06[_0x7665('0x37')]=_0x5809e9[_0x7665('0x37')];_0x383d06[_0x7665('0x38')]=_0x5809e9[_0x7665('0x38')];_0x383d06[_0x7665('0x39')]=_0x5809e9['temp'];_0x383d06[_0x7665('0x3a')]=_0x5809e9[_0x7665('0x3a')];_0x383d06[_0x7665('0x3b')]=_0x5809e9[_0x7665('0x3b')];_0x383d06[_0x7665('0x3c')]=_0x5809e9[_0x7665('0x3c')];_0x383d06['outboundBusyCallsDay']=_0x5809e9[_0x7665('0x3d')];_0x383d06[_0x7665('0x3e')]=_0x5809e9[_0x7665('0x3e')];_0x383d06[_0x7665('0x3f')]=_0x5809e9[_0x7665('0x3f')];_0x383d06['outboundDropCallsDayCallersExit']=_0x5809e9[_0x7665('0x40')];_0x383d06['outboundDropCallsDayTimeout']=_0x5809e9[_0x7665('0x41')];_0x383d06['outboundNoAnswerCallsDay']=_0x5809e9[_0x7665('0x42')];_0x383d06[_0x7665('0x43')]=_0x5809e9[_0x7665('0x43')];_0x383d06[_0x7665('0x44')]=_0x5809e9[_0x7665('0x44')];_0x383d06[_0x7665('0x45')]=_0x5809e9['outboundReCallsDay'];_0x383d06[_0x7665('0x46')]=_0x5809e9[_0x7665('0x46')];_0x383d06[_0x7665('0x47')]=_0x5809e9[_0x7665('0x47')];_0x383d06['predictiveIntervalAnsweredCalls']=_0x5809e9[_0x7665('0x48')];_0x383d06[_0x7665('0x49')]=_0x5809e9[_0x7665('0x49')];_0x383d06[_0x7665('0x4a')]=_0x5809e9[_0x7665('0x4a')];_0x383d06['predictiveIntervalDroppedCallsCallersExit']=_0x5809e9[_0x7665('0x4b')];_0x383d06[_0x7665('0x4c')]=_0x5809e9[_0x7665('0x4c')];_0x383d06[_0x7665('0x4d')]=_0x5809e9[_0x7665('0x4d')];_0x383d06[_0x7665('0x4e')]=_0x5809e9[_0x7665('0x4e')];_0x383d06[_0x7665('0x4f')]=_0x5809e9[_0x7665('0x4f')];_0x383d06[_0x7665('0x50')]=_0x5809e9['predictiveIntervalMultiplicativeFactor'];_0x383d06['predictiveIntervalPauses']=_0x5809e9[_0x7665('0x51')];_0x383d06[_0x7665('0x52')]=_0x5809e9['predictiveIntervalAvailable'];_0x383d06['predictiveIntervalTotalCalls']=_0x5809e9[_0x7665('0x53')];_0x383d06[_0x7665('0x1e')]=_0x5809e9['message'];_0x383d06[_0x7665('0x54')]=_0x5809e9[_0x7665('0x54')];_0x383d06[_0x7665('0x55')]=_0x5809e9[_0x7665('0x55')];_0x383d06[_0x7665('0x56')]=_0x5809e9[_0x7665('0x56')];_0x383d06[_0x7665('0x57')]=_0x5809e9[_0x7665('0x57')];_0x383d06[_0x7665('0x58')]=_0x5809e9[_0x7665('0x58')];_0x383d06[_0x7665('0x59')]=_0x5809e9[_0x7665('0x59')];_0x383d06[_0x7665('0x5a')]=_0x5809e9[_0x7665('0x5a')];}if(_0x5809e9['Trunk']){_0x383d06[_0x7665('0x5b')]={'id':_0x5809e9['Trunk']['id'],'name':_0x5809e9[_0x7665('0x5b')][_0x7665('0xb')],'active':_0x5809e9[_0x7665('0x5b')][_0x7665('0x5c')],'callerid':_0x5809e9[_0x7665('0x5b')]['callerid']};}if(_0x5809e9[_0x7665('0x5d')]){_0x383d06[_0x7665('0x5d')]={'id':_0x5809e9['Interval']['id'],'name':_0x5809e9[_0x7665('0x5d')]['name']};}_0x566415[_0x7665('0x5e')](_0x383d06);}}_0x488d86({'count':_0x566415[_0x7665('0x5f')],'rows':_0x566415});});},'UpdateVoiceQueue':function(_0x1a1cd9){return new Promise(function(_0x503679,_0x4bc743){var _0x1c174c=_[_0x7665('0x60')](_0x1c33b1['voiceQueues'],{'id':parseInt(_0x1a1cd9['id'])});var _0x2343de=_[_0x7665('0x61')](_0x1a1cd9,['id']);if(_0x1c174c){for(var _0x2bc404 in _0x2343de){if(typeof _0x2343de[_0x2bc404]!==_0x7665('0x62')&&typeof _0x1c174c[_0x2bc404]!==_0x7665('0x62')){_0x1c174c[_0x2bc404]=_0x2343de[_0x2bc404];}}_0x503679(_0x1c174c);}else{_0x4bc743();}});},'VoiceChannels':function(_0x9bca68){return new Promise(function(_0x41dd53,_0x453904){var _0x2fe046=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x64')]);_0x41dd53({'count':_0x2fe046['length'],'rows':_0x2fe046});});},'VoiceChannelMixMonitor':function(_0x3762b6){var _0x5a21ee=this;return new Promise(function(_0x3d1ed0,_0x1cf4e2){if(ami[_0x7665('0x20')]()==![]){return _0x1cf4e2(_0x5a21ee[_0x7665('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x69912d=schema(properties['voicechannel'])[_0x7665('0x2')](_0x3762b6);if(_0x69912d['length']>0x0){return _0x1cf4e2(_0x5a21ee[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x69912d,'message')['join'](',\x20')));}var _0x9d5c0b=_[_0x7665('0x60')](_0x1c33b1[_0x7665('0x64')],{'uniqueid':_0x3762b6[_0x7665('0x66')]});if(_0x9d5c0b&&_0x9d5c0b['channel']){var _0x4d2d7a=util[_0x7665('0x8')]('%s.%s',_0x3762b6[_0x7665('0x67')]||_0x3762b6[_0x7665('0x66')],_0x3762b6[_0x7665('0x8')]||'wav');return ami[_0x7665('0x1c')]({'action':_0x7665('0x68'),'channel':_0x9d5c0b[_0x7665('0x69')],'file':_0x4d2d7a,'options':_0x7665('0x6a')})[_0x7665('0x1d')](function(_0x1d6814){var _0x13d10b=_[_0x7665('0x60')](_0x9d5c0b[_0x7665('0x6b')],{'filename':_0x7665('0x6c')+_0x4d2d7a[_0x7665('0x6d')]()});if(_[_0x7665('0x6e')](_0x13d10b)){_0x9d5c0b[_0x7665('0x6b')][_0x7665('0x5e')]({'filename':'/var/spool/asterisk/monitor/'+_0x4d2d7a['toLowerCase'](),'createdAt':moment()[_0x7665('0x8')](_0x7665('0x6f')),'mixmonitorid':_0x1d6814['mixmonitorid'],'status':'rec'});}else{_0x13d10b['mixmonitorid']=_0x1d6814[_0x7665('0x70')];_0x13d10b[_0x7665('0x71')]=_0x7665('0x72');}_0x3d1ed0({'code':0xc8,'message':[_0x3762b6[_0x7665('0x66')],_0x7665('0x73'),_0x1d6814[_0x7665('0x70')]][_0x7665('0x16')]('\x20'),'mixmonitorid':_0x1d6814[_0x7665('0x70')]});})[_0x7665('0x1f')](function(_0x242386){_0x1cf4e2(_0x5a21ee['error'](0x1f5,[_0x3762b6['uniqueid'],_0x242386[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x1cf4e2(_0x5a21ee['error'](0x1f5,_0x7665('0x74')));}});},'VoiceChannelStopMixMonitor':function(_0x56ee91){var _0x17bbbe=this;return new Promise(function(_0xed47d0,_0x3d056c){if(ami[_0x7665('0x20')]()==![]){return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x3c6515=schema(properties['voicechannel'])[_0x7665('0x2')](_0x56ee91);if(_0x3c6515[_0x7665('0x5f')]>0x0){return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x3c6515,_0x7665('0x1e'))[_0x7665('0x16')](',\x20')));}var _0x42932e=_[_0x7665('0x60')](_0x1c33b1['channels'],{'uniqueid':_0x56ee91['uniqueid']});if(_0x42932e){return BPromise[_0x7665('0x75')]()[_0x7665('0x1d')](function(){if(_0x42932e[_0x7665('0x69')]){return ami[_0x7665('0x1c')]({'action':_0x7665('0x76'),'channel':_0x42932e[_0x7665('0x69')],'mixmonitorid':_0x56ee91['mixmonitorid']})[_0x7665('0x1f')](function(_0x38743a){});}})[_0x7665('0x1d')](function(){if(_0x42932e[_0x7665('0x77')]){return ami[_0x7665('0x1c')]({'action':_0x7665('0x76'),'channel':_0x42932e['destinationchannel'],'mixmonitorid':_0x56ee91[_0x7665('0x70')]})[_0x7665('0x1f')](function(_0x21151d){});}})[_0x7665('0x1d')](function(_0x54fc74){var _0x3b2b96=_[_0x7665('0x60')](_0x42932e[_0x7665('0x6b')],{'mixmonitorid':_0x56ee91[_0x7665('0x70')]});if(_0x3b2b96){_0x3b2b96[_0x7665('0x71')]='stop';}})[_0x7665('0x1d')](function(){var _0x44a17a=util['format'](_0x7665('0x78'),_0x56ee91['filename']||_0x56ee91[_0x7665('0x66')],_0x56ee91[_0x7665('0x8')]||'wav');var _0x2af15f=_['find'](_0x42932e['monitors'],{'filename':_0x7665('0x6c')+_0x44a17a[_0x7665('0x6d')]()});if(_0x2af15f){_0x2af15f['status']='stop';}})[_0x7665('0x1d')](function(){_0xed47d0({'code':0xc8,'message':[_0x56ee91['uniqueid'],_0x7665('0x79')][_0x7665('0x16')]('\x20')});})['catch'](function(_0x49562b){_0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f5,[_0x56ee91[_0x7665('0x66')],_0x49562b[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'VoiceQueuesChannels':function(_0x4b86be){return new Promise(function(_0x3d3acd,_0x1f6b54){var _0x269621=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x7a')]);_0x3d3acd({'count':_0x269621[_0x7665('0x5f')],'rows':_0x269621});});},'VoiceQueuesChannel':function(_0xa89a8b){var _0x4ea88e=this;return new Promise(function(_0x561c2f,_0x2a4d06){var _0x52dd8d=schema(properties[_0x7665('0x7b')])['validate'](_0xa89a8b);if(_0x52dd8d[_0x7665('0x5f')]>0x0){return _0x2a4d06(_0x4ea88e[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x52dd8d,'message')[_0x7665('0x16')](',\x20')));}var _0xeac63f=_['find'](_0x1c33b1['queueChannels'],{'uniqueid':_0xa89a8b[_0x7665('0x66')]});if(_0xeac63f){_0x561c2f(_0xeac63f);}else{return _0x2a4d06(_0x4ea88e[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'VoiceQueuesChannelHangup':function(_0xe6732){var _0x2d888a=this;return new Promise(function(_0x430dd0,_0xa8e489){if(ami[_0x7665('0x20')]()==![]){return _0xa8e489(_0x2d888a['error'](0x1f4,[config['asterisk']['ip'],config[_0x7665('0x13')][_0x7665('0x14')],'ami\x20disconnected'][_0x7665('0x16')]('\x20')));}var _0x48f351=schema(properties['voicequeuechannelhangup'])[_0x7665('0x2')](_0xe6732);if(_0x48f351[_0x7665('0x5f')]>0x0){return _0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x48f351,_0x7665('0x1e'))['join'](',\x20')));}var _0x59b28c=_['find'](_0x1c33b1[_0x7665('0x7a')],{'uniqueid':_0xe6732['uniqueid']});if(_0x59b28c&&_0x59b28c[_0x7665('0x69')]){return ami['Action']({'action':_0x7665('0x7c'),'channel':_0x59b28c[_0x7665('0x69')]})[_0x7665('0x1d')](function(_0xe149cd){_0x430dd0({'code':0xc8,'message':[_0xe6732['uniqueid'],_0xe149cd['message'][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')});})[_0x7665('0x1f')](function(_0x2d8f53){_0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f5,[_0xe6732[_0x7665('0x66')],_0x2d8f53[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x106908){var _0x18e913=this;return new Promise(function(_0x5d8b95,_0x1b6506){if(ami['isConnected']()==![]){return _0x1b6506(_0x18e913['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x506c71=schema(properties[_0x7665('0x7d')])[_0x7665('0x2')](_0x106908);if(_0x506c71[_0x7665('0x5f')]>0x0){return _0x1b6506(_0x18e913[_0x7665('0x12')](0x1f4,_['map'](_0x506c71,_0x7665('0x1e'))[_0x7665('0x16')](',\x20')));}var _0x5ce6b1=_[_0x7665('0x60')](_0x1c33b1[_0x7665('0x7a')],{'uniqueid':_0x106908[_0x7665('0x66')]});if(_0x5ce6b1&&_0x5ce6b1['channel']){return ami[_0x7665('0x1c')]({'action':'Redirect','channel':_0x5ce6b1['channel'],'exten':_0x106908[_0x7665('0x7e')],'context':_0x106908[_0x7665('0x7f')]||_0x5ce6b1[_0x7665('0x7f')],'priority':0x1})[_0x7665('0x1d')](function(_0x535e29){_0x5d8b95({'code':0xc8,'message':[_0x106908[_0x7665('0x66')],_0x535e29[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')});})[_0x7665('0x1f')](function(_0x244e57){_0x1b6506(_0x18e913[_0x7665('0x12')](0x1f5,[_0x106908[_0x7665('0x66')],_0x244e57[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x1b6506(_0x18e913[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'Agents':function(_0x1ff152){return new Promise(function(_0x5c7eae,_0x2e1868){var _0x1b8830=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0xf')]);_0x5c7eae({'count':_0x1b8830['length'],'rows':_0x1b8830});});},'Telephones':function(_0x36f154){return new Promise(function(_0xdf3ff2,_0x52108b){var _0x3bb518=_[_0x7665('0x63')](_0x1c33b1['telephones']);_0xdf3ff2({'count':_0x3bb518[_0x7665('0x5f')],'rows':_0x3bb518});});},'Trunks':function(_0x117d07){return new Promise(function(_0x1ec913,_0x4b6fc7){var _0xd8a3f6=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x80')]);_0x1ec913({'count':_0xd8a3f6[_0x7665('0x5f')],'rows':_0xd8a3f6});});},'OutboundChannels':function(_0x52090c){return new Promise(function(_0x2e1a9b,_0xa3e105){var _0x509904=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x81')]);_0x2e1a9b({'count':_0x509904[_0x7665('0x5f')],'rows':_0x509904});});},'Outbound':function(_0x294e3f){return new Promise(function(_0x3e79c4,_0x5ee9a6){_0x3e79c4(_0x1c33b1[_0x7665('0x32')]);});},'Campaigns':function(_0x2a9601){return new Promise(function(_0x1d82b2,_0x37540f){var _0x53c492=_[_0x7665('0x63')](_0x1c33b1['campaigns']);_0x1d82b2({'count':_0x53c492[_0x7665('0x5f')],'rows':_0x53c492});});},'VoiceQueuesPreview':function(_0x4f3a38){var _0x101e40=this;return new Promise(function(_0xf05cae,_0x231282){_0xcf83a8[_0x7665('0x82')](_0x4f3a38['id'])[_0x7665('0x1d')](function(_0xb074a7){_0xf05cae({'code':0xc8,'message':_0xb074a7[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x1088c8){_0x231282(_0x101e40[_0x7665('0x12')](0x1f4,_0x1088c8[_0x7665('0x1e')]));});});},'EventManager':function(_0x1983bd){var _0x58cb69=this;return new Promise(function(_0x51837a,_0x41bbb4){if(!_0x1983bd['event']){return _0x41bbb4(_0x58cb69['error'](0x1f4,_0x7665('0x83')));}ami[_0x7665('0x84')](_0x7665('0x85')+_0x1983bd[_0x7665('0x86')],_0x1983bd[_0x7665('0x1e')]);_0x51837a({'code':0xc8,'message':_0x1983bd});});},'FaxAccounts':function(_0x1e617f){return new Promise(function(_0x346328,_0x39a6e2){var _0x21af97=_['values'](_0x1c33b1[_0x7665('0x87')]);_0x346328({'count':_0x21af97[_0x7665('0x5f')],'rows':_0x21af97});});},'SendFax':function(_0x3a5993){var _0xd4452b=this;return new Promise(function(_0x4558ea,_0x442d83){_0x28b410['send'](_0x3a5993)[_0x7665('0x1d')](function(_0x1c505e){_0x4558ea({'code':0xc8,'message':_0x1c505e[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x3a4045){_0x442d83(_0xd4452b[_0x7665('0x12')](0x1f4,_0x3a4045['message']));});});},'CheckAfterSend':function(_0xba1a77){var _0x6949dc=this;return new Promise(function(_0x165ddd,_0xa64995){_0x28b410[_0x7665('0x88')](_0xba1a77)[_0x7665('0x1d')](function(_0x4410fe){_0x165ddd({'code':0xc8,'message':_0x4410fe[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x132170){_0xa64995(_0x6949dc[_0x7665('0x12')](0x1f4,_0x132170['message']));});});}};var _0x356786=jayson['server'](_0x4c0b5c)['http']();_0x356786['on'](_0x7665('0x12'),function(_0x1c83cb){return _0x3387d8(_0x1c83cb);});_0x356786[_0x7665('0x7')](0x232a,_0x7665('0x89'),function(){console[_0x7665('0x8a')](_0x7665('0x8b'),0x232a);return _0x1a6f2f(_0x7665('0x8c')+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 d48e551..ae31bc7 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 _0x81bd=['Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','','calleridname'];(function(_0x528a67,_0x3d0bc5){var _0xc2deb5=function(_0x522621){while(--_0x522621){_0x528a67['push'](_0x528a67['shift']());}};_0xc2deb5(++_0x3d0bc5);}(_0x81bd,0x7c));var _0xd81b=function(_0x563188,_0x157c4d){_0x563188=_0x563188-0x0;var _0x211dde=_0x81bd[_0x563188];return _0x211dde;};'use strict';var _=require(_0xd81b('0x0'));var BPromise=require(_0xd81b('0x1'));var Redis=require(_0xd81b('0x2'));var util=require(_0xd81b('0x3'));var config=require(_0xd81b('0x4'));var logger=require(_0xd81b('0x5'))(_0xd81b('0x6'));var cmContactRpc=require('../../rpc/cmContact');config[_0xd81b('0x7')]=_[_0xd81b('0x8')](config[_0xd81b('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd81b('0x9'))(new Redis(config[_0xd81b('0x7')]));function emit(_0x1f3f2c,_0x562084,_0x5e14e8,_0xa4cf97,_0x5468d5){logger[_0xd81b('0xa')](_0xd81b('0xb'),_0x1f3f2c,_0x562084['id'],_0x5e14e8,_0xa4cf97,JSON[_0xd81b('0xc')](_0x5468d5));io['to'](_0x5e14e8)[_0xd81b('0xd')](_0xa4cf97,_0x5468d5);}exports[_0xd81b('0xe')]=function(_0x1ff60f,_0x4391be,_0x17e09f,_0x2090e1){var _0x23c789,_0x215b92;var _0x3914f7={};var _0x1afb8f=Number(_0x17e09f['data1']);var _0x21dfff=_0x17e09f['data2']?Boolean(Number(_0x17e09f[_0xd81b('0xf')])):![];var _0xe75568;var _0x5f0b6b=![];if(!_[_0xd81b('0x10')](_0x17e09f['data5'])){if(_0x17e09f[_0xd81b('0x11')]=='1')_0x5f0b6b=!![];}if(!_0x5f0b6b){if(_0x2090e1[_0xd81b('0x12')]){_0x3914f7['id']=_0x2090e1[_0xd81b('0x12')];}}if(!_0x3914f7['id']){_0x3914f7[_0xd81b('0x13')]=_0x1afb8f;_0xe75568=_0x17e09f[_0xd81b('0x14')]&&_0x17e09f['data3']!=='0'?_0x17e09f[_0xd81b('0x14')][_0xd81b('0x15')](','):['phone'];_0x3914f7[_0xd81b('0x16')]=_[_0xd81b('0x17')](_0xe75568,function(_0x4657cf){var _0x15e860={};_0x15e860[_0x4657cf]=_0x2090e1[_0xd81b('0x18')]?_0x2090e1[_0xd81b('0x19')]:_0x2090e1[_0xd81b('0x1a')];return _0x15e860;});}var _0x3d4d34=['id',_0xd81b('0x1b'),_0xd81b('0x1c'),_0xd81b('0x1d'),_0xd81b('0x1e'),_0xd81b('0x1f'),_0xd81b('0x13'),_0xd81b('0x20'),_0xd81b('0x21'),'updatedAt'];var _0x4d566e=_[_0xd81b('0x22')](_0x3d4d34,_0xe75568);BPromise[_0xd81b('0x23')]()[_0xd81b('0x24')](cmContactRpc['getContacts']({'attributes':_0x4d566e,'where':_0x3914f7}))[_0xd81b('0x24')](function(_0x6571a6){_0x215b92=_0x6571a6;if(!_['isEmpty'](_0x215b92)){if(_0x215b92[_0xd81b('0x25')]===0x1){_0x23c789=_0x215b92[0x0];logger[_0xd81b('0xa')](_0xd81b('0x26'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id'],_0x23c789['id']);}else{logger[_0xd81b('0xa')](_0xd81b('0x28'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id'],_[_0xd81b('0x17')](_0x215b92,'id')[_0xd81b('0x29')](','));}return;}else{logger[_0xd81b('0xa')](_0xd81b('0x2a'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id']);var _0x596389={'ListId':_0x1afb8f};var _0x28768f=_0x17e09f[_0xd81b('0x2b')]&&_0x17e09f[_0xd81b('0x2b')]!=='0'?_0x17e09f[_0xd81b('0x2b')]:_0xd81b('0x1d');if(_0x21dfff){logger[_0xd81b('0xa')](_0xd81b('0x2c'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id']);_0x596389[_0x28768f]=_[_0xd81b('0x10')](_0x2090e1['routeId'])?_0x2090e1[_0xd81b('0x1a')]:_0x2090e1['destcalleridnum'];if(_['isNil'](_0x2090e1[_0xd81b('0x18')])){_0x596389[_0xd81b('0x1b')]=_0x2090e1['calleridname']&&_0x2090e1['calleridname']!==_0xd81b('0x2d')?_0x2090e1[_0xd81b('0x2e')]:_0xd81b('0x2f');}else{_0x596389[_0xd81b('0x1b')]=_0x2090e1[_0xd81b('0x30')]&&_0x2090e1[_0xd81b('0x30')]!==''?_0x2090e1[_0xd81b('0x30')]:_0xd81b('0x2f');}return BPromise['resolve']()['then'](cmContactRpc[_0xd81b('0x31')](_0x596389))[_0xd81b('0x24')](function(_0x50472a){_0x23c789=_0x50472a;_0x215b92['push'](_0x50472a);if(_0x23c789){logger['info'](_0xd81b('0x32'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id'],_0x23c789['id']);}return;});}else{logger[_0xd81b('0xa')](_0xd81b('0x33'),_0x2090e1[_0xd81b('0x27')],_0x4391be['id']);_0x596389[_0x28768f]=_[_0xd81b('0x10')](_0x2090e1[_0xd81b('0x18')])?_0x2090e1['calleridnum']:_0x2090e1[_0xd81b('0x19')];if(_['isNil'](_0x2090e1[_0xd81b('0x18')])){_0x596389[_0xd81b('0x1b')]=_0x2090e1[_0xd81b('0x2e')]&&_0x2090e1[_0xd81b('0x2e')]!==_0xd81b('0x2d')?_0x2090e1[_0xd81b('0x2e')]:_0xd81b('0x2f');}else{_0x596389[_0xd81b('0x1b')]=_0x2090e1[_0xd81b('0x30')]&&_0x2090e1[_0xd81b('0x30')]!==_0xd81b('0x2d')?_0x2090e1[_0xd81b('0x30')]:_0xd81b('0x2f');}_0x23c789=_0x596389;_0x215b92['push'](_0x596389);return;}}})['then'](function(){if(_0x1ff60f){emit(_0x2090e1[_0xd81b('0x27')],_0x4391be,util[_0xd81b('0x34')](_0xd81b('0x35'),_0x1ff60f['name']),util[_0xd81b('0x34')](_0xd81b('0x36'),_0x17e09f['action'][_0xd81b('0x37')]()),{'evt':_[_0xd81b('0x38')](_0x2090e1,{'autoCreate':_0x21dfff}),'contact':_0x23c789===undefined?{}:_0x23c789,'contacts':_0x215b92['length']===0x0?undefined:_0x215b92});}});}; \ No newline at end of file +var _0x6aa7=['xmd-contactid','data3','split','$or','routeId','destcalleridnum','calleridnum','phone','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','trigger:%s','action','merge','lodash','ioredis','util','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data2','isNil','data5'];(function(_0x5ecec4,_0x595f35){var _0xe43539=function(_0x56d666){while(--_0x56d666){_0x5ecec4['push'](_0x5ecec4['shift']());}};_0xe43539(++_0x595f35);}(_0x6aa7,0x178));var _0x76aa=function(_0x4a7e4c,_0x4545bd){_0x4a7e4c=_0x4a7e4c-0x0;var _0x379274=_0x6aa7[_0x4a7e4c];return _0x379274;};'use strict';var _=require(_0x76aa('0x0'));var BPromise=require('bluebird');var Redis=require(_0x76aa('0x1'));var util=require(_0x76aa('0x2'));var config=require(_0x76aa('0x3'));var logger=require(_0x76aa('0x4'))('trigger');var cmContactRpc=require(_0x76aa('0x5'));config[_0x76aa('0x6')]=_[_0x76aa('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x76aa('0x8'))(new Redis(config['redis']));function emit(_0x32dee5,_0x36d12b,_0xa9b695,_0x56d6bc,_0x3dae33){logger[_0x76aa('0x9')](_0x76aa('0xa'),_0x32dee5,_0x36d12b['id'],_0xa9b695,_0x56d6bc,JSON['stringify'](_0x3dae33));io['to'](_0xa9b695)[_0x76aa('0xb')](_0x56d6bc,_0x3dae33);}exports[_0x76aa('0xc')]=function(_0x41643a,_0x16cb50,_0x37f1ab,_0x128435){var _0x2c5075,_0x8dc35c;var _0xd6327={};var _0x17a417=Number(_0x37f1ab['data1']);var _0x112c39=_0x37f1ab['data2']?Boolean(Number(_0x37f1ab[_0x76aa('0xd')])):![];var _0x12dde0;var _0x3f8f6b=![];if(!_[_0x76aa('0xe')](_0x37f1ab[_0x76aa('0xf')])){if(_0x37f1ab['data5']=='1')_0x3f8f6b=!![];}if(!_0x3f8f6b){if(_0x128435['xmd-contactid']){_0xd6327['id']=_0x128435[_0x76aa('0x10')];}}if(!_0xd6327['id']){_0xd6327['ListId']=_0x17a417;_0x12dde0=_0x37f1ab[_0x76aa('0x11')]&&_0x37f1ab[_0x76aa('0x11')]!=='0'?_0x37f1ab['data3'][_0x76aa('0x12')](','):['phone'];_0xd6327[_0x76aa('0x13')]=_['map'](_0x12dde0,function(_0x1515e9){var _0x413cf6={};_0x413cf6[_0x1515e9]=_0x128435[_0x76aa('0x14')]?_0x128435[_0x76aa('0x15')]:_0x128435[_0x76aa('0x16')];return _0x413cf6;});}var _0x3ead3f=['id','firstName','lastName',_0x76aa('0x17'),_0x76aa('0x18'),_0x76aa('0x19'),_0x76aa('0x1a'),_0x76aa('0x1b'),_0x76aa('0x1c'),_0x76aa('0x1d')];var _0x2eaf48=_[_0x76aa('0x1e')](_0x3ead3f,_0x12dde0);BPromise['resolve']()[_0x76aa('0x1f')](cmContactRpc[_0x76aa('0x20')]({'attributes':_0x2eaf48,'where':_0xd6327}))[_0x76aa('0x1f')](function(_0x5b3f55){_0x8dc35c=_0x5b3f55;if(!_[_0x76aa('0x21')](_0x8dc35c)){if(_0x8dc35c[_0x76aa('0x22')]===0x1){_0x2c5075=_0x8dc35c[0x0];logger[_0x76aa('0x9')](_0x76aa('0x23'),_0x128435[_0x76aa('0x24')],_0x16cb50['id'],_0x2c5075['id']);}else{logger[_0x76aa('0x9')](_0x76aa('0x25'),_0x128435[_0x76aa('0x24')],_0x16cb50['id'],_[_0x76aa('0x26')](_0x8dc35c,'id')[_0x76aa('0x27')](','));}return;}else{logger[_0x76aa('0x9')](_0x76aa('0x28'),_0x128435[_0x76aa('0x24')],_0x16cb50['id']);var _0x4ef9b0={'ListId':_0x17a417};var _0xb5e8a9=_0x37f1ab[_0x76aa('0x29')]&&_0x37f1ab[_0x76aa('0x29')]!=='0'?_0x37f1ab[_0x76aa('0x29')]:_0x76aa('0x17');if(_0x112c39){logger[_0x76aa('0x9')](_0x76aa('0x2a'),_0x128435[_0x76aa('0x24')],_0x16cb50['id']);_0x4ef9b0[_0xb5e8a9]=_[_0x76aa('0xe')](_0x128435[_0x76aa('0x14')])?_0x128435['calleridnum']:_0x128435[_0x76aa('0x15')];if(_['isNil'](_0x128435[_0x76aa('0x14')])){_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2c')]&&_0x128435[_0x76aa('0x2c')]!==_0x76aa('0x2d')?_0x128435[_0x76aa('0x2c')]:_0x76aa('0x2e');}else{_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2f')]&&_0x128435[_0x76aa('0x2f')]!==''?_0x128435[_0x76aa('0x2f')]:_0x76aa('0x2e');}return BPromise[_0x76aa('0x30')]()[_0x76aa('0x1f')](cmContactRpc[_0x76aa('0x31')](_0x4ef9b0))[_0x76aa('0x1f')](function(_0x35a705){_0x2c5075=_0x35a705;_0x8dc35c['push'](_0x35a705);if(_0x2c5075){logger[_0x76aa('0x9')](_0x76aa('0x32'),_0x128435['uniqueid'],_0x16cb50['id'],_0x2c5075['id']);}return;});}else{logger[_0x76aa('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x128435[_0x76aa('0x24')],_0x16cb50['id']);_0x4ef9b0[_0xb5e8a9]=_['isNil'](_0x128435[_0x76aa('0x14')])?_0x128435['calleridnum']:_0x128435['destcalleridnum'];if(_[_0x76aa('0xe')](_0x128435[_0x76aa('0x14')])){_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2c')]&&_0x128435['calleridname']!==''?_0x128435[_0x76aa('0x2c')]:_0x76aa('0x2e');}else{_0x4ef9b0[_0x76aa('0x2b')]=_0x128435[_0x76aa('0x2f')]&&_0x128435[_0x76aa('0x2f')]!==''?_0x128435[_0x76aa('0x2f')]:'Unknown';}_0x2c5075=_0x4ef9b0;_0x8dc35c['push'](_0x4ef9b0);return;}}})[_0x76aa('0x1f')](function(){if(_0x41643a){emit(_0x128435[_0x76aa('0x24')],_0x16cb50,util[_0x76aa('0x33')](_0x76aa('0x34'),_0x41643a['name']),util[_0x76aa('0x33')](_0x76aa('0x35'),_0x37f1ab[_0x76aa('0x36')]['toLowerCase']()),{'evt':_[_0x76aa('0x37')](_0x128435,{'autoCreate':_0x112c39}),'contact':_0x2c5075===undefined?{}:_0x2c5075,'contacts':_0x8dc35c[_0x76aa('0x22')]===0x0?undefined:_0x8dc35c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index d3840c9..9341089 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 _0x838a=['dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','clone','motionChannel','undefined','voice','checkTriggers','interface','triggers','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','templates','render','template\x20not\x20found','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','800','windowHeight','data6','winapp','winApplication','format','user:%s','name','trigger:%s:%s','trigger:%s','exec','routeId','urlforward','script','parse','query','search','channel','AllConditions','every','checkConditions','AnyConditions','some','field','account','ChatWebsiteId','value','upperFirst','AccountId','operator','message','event','queue','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','equals','exports','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','popup','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts'];(function(_0x550a9b,_0x474bcf){var _0x5bdbbb=function(_0x5c7bdb){while(--_0x5c7bdb){_0x550a9b['push'](_0x550a9b['shift']());}};_0x5bdbbb(++_0x474bcf);}(_0x838a,0x65));var _0xa838=function(_0x217a6f,_0x3ecd8b){_0x217a6f=_0x217a6f-0x0;var _0x5553f3=_0x838a[_0x217a6f];return _0x5553f3;};'use strict';var util=require('util');var _=require('lodash');var url=require(_0xa838('0x0'));var Mustache=require(_0xa838('0x1'));var Redis=require(_0xa838('0x2'));var urlforward=require(_0xa838('0x3'));var integration=require(_0xa838('0x4'));var cmContact=require(_0xa838('0x5'));var script=require(_0xa838('0x6'));var config=require(_0xa838('0x7'));var logger=require(_0xa838('0x8'))('trigger');var ami=require('../ami');config[_0xa838('0x9')]=_[_0xa838('0xa')](config[_0xa838('0x9')],{'host':_0xa838('0xb'),'port':0x18eb});var io=require(_0xa838('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x50bcc5,_0xf71015){return _0x50bcc5==_0xf71015;},'not_equals':function(_0x506d96,_0x8177a7){return _0x506d96!=_0x8177a7;}};var barAndWebActions=[_0xa838('0xd'),_0xa838('0x0'),'winapp'];function Trigger(_0x529853){this['triggers']=_0x529853['triggers'];this[_0xa838('0xe')]=_0x529853['agents'];this[_0xa838('0xf')]=_0x529853[_0xa838('0xf')];this['templates']=_0x529853['templates'];this[_0xa838('0x10')]=_0x529853[_0xa838('0x10')];this['zendeskAccounts']=_0x529853[_0xa838('0x11')];this[_0xa838('0x12')]=_0x529853[_0xa838('0x12')];this['salesforceAccounts']=_0x529853[_0xa838('0x13')];this[_0xa838('0x14')]=_0x529853[_0xa838('0x14')];this['zohoAccounts']=_0x529853[_0xa838('0x15')];this[_0xa838('0x16')]=_0x529853[_0xa838('0x16')];this[_0xa838('0x17')]=_0x529853[_0xa838('0x17')];this['servicenowAccounts']=_0x529853[_0xa838('0x18')];this[_0xa838('0x19')]=_0x529853[_0xa838('0x19')];this['freshsalesAccounts']=_0x529853[_0xa838('0x1a')];this[_0xa838('0x1b')]={'zendesk':this[_0xa838('0x11')],'salesforce':this[_0xa838('0x13')],'freshdesk':this[_0xa838('0x12')],'sugarcrm':this[_0xa838('0x14')],'zoho':this[_0xa838('0x15')],'desk':this[_0xa838('0x16')],'vtiger':this[_0xa838('0x17')],'dynamics365':this[_0xa838('0x19')],'freshsales':this[_0xa838('0x1a')],'servicenow':this['servicenowAccounts']};ami['on'](_0xa838('0x1c'),this[_0xa838('0x1d')][_0xa838('0x1e')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xa838('0x1e')](this));ami['on'](_0xa838('0x1f'),this[_0xa838('0x1d')][_0xa838('0x1e')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0xa838('0x1e')](this));ami['on']('custom:agentnosuchnumber',this[_0xa838('0x1d')][_0xa838('0x1e')](this));ami['on'](_0xa838('0x20'),this[_0xa838('0x1d')]['bind'](this));ami['on'](_0xa838('0x21'),this[_0xa838('0x1d')][_0xa838('0x1e')](this));ami['on'](_0xa838('0x22'),this[_0xa838('0x1d')][_0xa838('0x1e')](this));ami['on'](_0xa838('0x23'),this['syncCustomEvent']['bind'](this));ami['on']('custom:amd',this['syncCustomEvent'][_0xa838('0x1e')](this));ami['on'](_0xa838('0x24'),this['syncCustomEvent'][_0xa838('0x1e')](this));ami['on'](_0xa838('0x25'),this['syncCustomEvent'][_0xa838('0x1e')](this));ami['on']('custom:dialbegin',this['syncAgentDial'][_0xa838('0x1e')](this));ami['on'](_0xa838('0x26'),this[_0xa838('0x27')][_0xa838('0x1e')](this));ami['on'](_0xa838('0x28'),this[_0xa838('0x27')][_0xa838('0x1e')](this));ami['on'](_0xa838('0x29'),this[_0xa838('0x1d')]['bind'](this));ami['on'](_0xa838('0x2a'),this[_0xa838('0x1d')][_0xa838('0x1e')](this));ami['on'](_0xa838('0x2b'),this['syncCustomEvent'][_0xa838('0x1e')](this));ami['on'](_0xa838('0x2c'),this[_0xa838('0x1d')]['bind'](this));ami['on'](_0xa838('0x2d'),this[_0xa838('0x1d')][_0xa838('0x1e')](this));ami['on'](_0xa838('0x2e'),this['syncCustomEvent'][_0xa838('0x1e')](this));ami['on'](_0xa838('0x2f'),this[_0xa838('0x1d')]['bind'](this));ami['on'](_0xa838('0x30'),this[_0xa838('0x1d')][_0xa838('0x1e')](this));}Trigger[_0xa838('0x31')][_0xa838('0x32')]=function(_0xcb389b,_0xf61d5c,_0x3e7b94){logger[_0xa838('0x33')](_0xcb389b,_0xf61d5c,JSON['stringify'](_0x3e7b94));io['to'](_0xcb389b)[_0xa838('0x32')](_0xf61d5c,_0x3e7b94);};Trigger[_0xa838('0x31')][_0xa838('0x1d')]=function(_0x17d933){var _0x513542=_[_0xa838('0x34')](_0x17d933);if(typeof _0x513542[_0xa838('0x35')]===_0xa838('0x36')){_0x513542[_0xa838('0x35')]=_0xa838('0x37');}this[_0xa838('0x38')](_0x513542);};Trigger['prototype']['syncAgentDial']=function(_0x1ad061){if(this['agents'][_0x1ad061[_0xa838('0x39')]]){this[_0xa838('0x1d')](_0x1ad061);}};Trigger[_0xa838('0x31')][_0xa838('0x38')]=function(_0x31565d){var _0x2e3d70;for(var _0x2038d4 in this[_0xa838('0x3a')]){if(this['triggers']['hasOwnProperty'](_0x2038d4)){if(this['triggers'][_0x2038d4][_0xa838('0x3b')]){_0x2e3d70=this[_0xa838('0x3c')](this[_0xa838('0x3a')][_0x2038d4],_0x31565d);if(_0x2e3d70){_[_0xa838('0x3d')](_0x31565d,_0x31565d[_0xa838('0x3e')]);for(var _0x2174e3=0x0,_0xdbb18b,_0x539be8,_0xfac641;_0x2174e30x0){_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 +var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14b,0x93));var _0xbe14=function(_0x48bce2,_0x982c2a){_0x48bce2=_0x48bce2-0x0;var _0x20e39d=_0xe14b[_0x48bce2];return _0x20e39d;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index e9839ed..dcf2b88 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 _0xf1a5=['headers','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','telephone1','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','type','nameField','customField','idField','indexOf','content','ticketType','incidents','assign','getString','Subjects','/contacts(','Fields','4.0','phonecall','callDirection','queue','phonecalls','Descriptions','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','CloudProvider','tenantId','data2','data5','POST','clientId','remoteUri','username','access_token','toUpperCase',']\x20Wrong\x20credentials!','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','userEmail','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','internalemailaddress','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers('];(function(_0x55f9f5,_0x5c162b){var _0x362bd9=function(_0x35a2c0){while(--_0x35a2c0){_0x55f9f5['push'](_0x55f9f5['shift']());}};_0x362bd9(++_0x5c162b);}(_0xf1a5,0x184));var _0x5f1a=function(_0x256882,_0x1b0192){_0x256882=_0x256882-0x0;var _0x487e5c=_0xf1a5[_0x256882];return _0x487e5c;};'use strict';var _=require('lodash');var rp=require(_0x5f1a('0x0'));var util=require(_0x5f1a('0x1'));var intUtil=require(_0x5f1a('0x2'));var md5=require(_0x5f1a('0x3'));var Redis=require(_0x5f1a('0x4'));var logger=require('../../../../config/logger')(_0x5f1a('0x5'));var config=require(_0x5f1a('0x6'));config[_0x5f1a('0x7')]=_[_0x5f1a('0x8')](config['redis'],{'host':_0x5f1a('0x9'),'port':0x18eb});var io=require(_0x5f1a('0xa'))(new Redis(config[_0x5f1a('0x7')]));function getAuthToken(_0x1f110c,_0x1d955e,_0x5c0ea4){if(_0x1f110c['modernAuthentication']){_0x1f110c['remoteUri']=_0x1f110c[_0x5f1a('0xb')]['data7'];_0x1f110c[_0x5f1a('0xc')]=_0x1f110c[_0x5f1a('0xb')][_0x5f1a('0xd')];return Promise['resolve'](_0x1f110c[_0x5f1a('0xb')][_0x5f1a('0xe')]);}var _0x37de8f={'method':_0x5f1a('0xf'),'uri':_0x1d955e,'form':{'client_id':_0x1f110c[_0x5f1a('0x10')],'resource':_0x1f110c[_0x5f1a('0x11')],'username':_0x1f110c[_0x5f1a('0x12')],'password':_0x1f110c['password'],'grant_type':'password','client_secret':_0x1f110c['clientSecret']},'json':!![]};return rp(_0x37de8f)['then'](function(_0x51ab1a){return _0x51ab1a[_0x5f1a('0x13')];})['catch'](function(_0x4e620b){logger['error']('['+[_0x5c0ea4[_0x5f1a('0x14')]()]+_0x5f1a('0x15'));return _0x4e620b[_0x5f1a('0x16')];});}function getUser(_0x4cd4d6,_0x52b00d,_0x34a8a7,_0x2b5ad0,_0x80d15a,_0x372e3d){return new Promise(function(_0x30dcf3,_0x4f40ea){return getAuthToken(_0x52b00d,_0x2b5ad0,_0x372e3d)[_0x5f1a('0x17')](function(_0x403e9e){var _0x28b65c={'method':'GET','uri':_0x80d15a+_0x5f1a('0x18'),'headers':{'Authorization':_0x5f1a('0x19')+_0x403e9e,'OData-Version':'4.0'},'json':!![]};return rp(_0x28b65c);})['then'](function(_0x4594b1){var _0x55279d=_0x4594b1[_0x5f1a('0x1a')];var _0x4232c9=![];var _0x3d740a=null;if(!_[_0x5f1a('0x1b')](_0x34a8a7)){if(intUtil['validateEmail'](_0x34a8a7['email'])){_0x4cd4d6[_0x5f1a('0x1c')]=_0x34a8a7[_0x5f1a('0x1d')];for(_0x3d740a=0x0;_0x3d740a<_0x55279d[_0x5f1a('0x1e')];_0x3d740a++){if(_0x55279d[_0x3d740a]['internalemailaddress']===_0x34a8a7['email']&&!_0x55279d[_0x3d740a][_0x5f1a('0x1f')]){_0x4232c9=!![];logger[_0x5f1a('0x20')]('['+[_0x372e3d[_0x5f1a('0x14')]()]+_0x5f1a('0x21')+_0x55279d[_0x3d740a][_0x5f1a('0x22')]+'!');_0x4cd4d6[_0x5f1a('0x23')]=_0x55279d[_0x3d740a][_0x5f1a('0x22')];}}}}if(!_0x4232c9){logger[_0x5f1a('0x20')]('['+[_0x372e3d[_0x5f1a('0x14')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4cd4d6[_0x5f1a('0x1c')]=_0x52b00d[_0x5f1a('0x12')];for(_0x3d740a=0x0;_0x3d740a<_0x55279d[_0x5f1a('0x1e')];_0x3d740a++){if(_0x55279d[_0x3d740a][_0x5f1a('0x24')]===_0x52b00d[_0x5f1a('0x12')]){_0x4cd4d6[_0x5f1a('0x23')]=_0x55279d[_0x3d740a][_0x5f1a('0x22')];}}}_0x30dcf3(_0x4cd4d6);})[_0x5f1a('0x25')](function(_0x460d52){_0x4f40ea(_0x460d52[_0x5f1a('0x16')]);});});}function createEndUser(_0x17ff24,_0x4c988a,_0x31a0dc,_0x48c57e,_0x5dece0,_0x190608){return new Promise(function(_0x26a743,_0xd94a8b){return getAuthToken(_0x4c988a,_0x31a0dc,_0x190608)['then'](function(_0xc51cb2){var _0x37deaa=_0x190608[_0x5f1a('0x26')]()===_0x5f1a('0x27')?_0x5dece0[_0x5f1a('0x28')]:_0x5dece0[_0x5f1a('0x29')];var _0xe36f79={'method':_0x5f1a('0xf'),'uri':_0x48c57e+_0x5f1a('0x2a'),'body':{'telephone1':_0x37deaa,'fullname':_0x37deaa,'firstname':_0x37deaa,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5f1a('0x2b')+_0x17ff24['userId']+')'},'headers':{'Authorization':_0x5f1a('0x19')+_0xc51cb2,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xe36f79);})[_0x5f1a('0x17')](function(_0x4555f4){var _0x103b67=_0x4555f4[_0x5f1a('0x2c')]['odata-entityid'];var _0x512800=_0x103b67[_0x5f1a('0x2d')](_0x103b67[_0x5f1a('0x2e')]('(')+0x1,_0x103b67[_0x5f1a('0x2e')](')'));_0x17ff24[_0x5f1a('0x2f')]=_0x512800;_0x26a743(_0x17ff24);})[_0x5f1a('0x25')](function(_0x37c862){_0xd94a8b(_0x37c862[_0x5f1a('0x16')]);});});}function getEndUser(_0x4bac10,_0x1bc586,_0x289165,_0x1116d9,_0x2a3844,_0x263c05,_0x59da0e){var _0x4081ac=_0x263c05[_0x5f1a('0x26')]()===_0x5f1a('0x27')?_0x2a3844[_0x5f1a('0x28')]:_0x2a3844['calleridnum'];return getAuthToken(_0x1bc586,_0x289165,_0x263c05)[_0x5f1a('0x17')](function(_0x2b4ef9){var _0xdaab23={'method':'GET','uri':_0x1116d9+_0x5f1a('0x30')+_0x4081ac['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x5f1a('0x19')+_0x2b4ef9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xdaab23);})['then'](function(_0x1fe196){var _0x2a3e9e=![];if(!_0x1fe196)return _0x2a3e9e;var _0xb41605=_0x1fe196[_0x5f1a('0x1a')];for(var _0x478a36=0x0;_0x478a36<_0xb41605[_0x5f1a('0x1e')];_0x478a36++){if(_0xb41605[_0x478a36][_0x5f1a('0x31')]===_0x4081ac){_0x2a3e9e=!![];_0x4bac10[_0x5f1a('0x2f')]=_0xb41605[_0x478a36][_0x5f1a('0x32')];}}return _0x2a3e9e;})[_0x5f1a('0x17')](function(_0x48aa96){if(_0x48aa96)return _0x4bac10;if(_0x59da0e===_0x5f1a('0x33')){logger[_0x5f1a('0x20')]('['+[_0x263c05[_0x5f1a('0x14')]()]+_0x5f1a('0x34'));return _0x4bac10;}return createEndUser(_0x4bac10,_0x1bc586,_0x289165,_0x1116d9,_0x2a3844,_0x263c05)[_0x5f1a('0x17')](function(_0x51596c){logger['info']('['+[_0x263c05[_0x5f1a('0x14')]()]+_0x5f1a('0x35'),_0x51596c[_0x5f1a('0x2f')]);return _0x51596c;});});}function getCustomFields(_0x5ca472,_0x55a7f0,_0x5d0d79){var _0x5a00de={};if(_0x5ca472[_0x5f1a('0x1e')]>0x0){_[_0x5f1a('0x36')](_0x5ca472,function(_0x446a36){if(_[_0x5f1a('0x37')]([_0x5f1a('0x38'),'picklist'],_0x446a36[_0x5f1a('0x39')])&&_0x446a36[_0x5f1a('0x3a')]&&!_0x446a36[_0x5f1a('0x3b')]){var _0x156731=_0x446a36[_0x5f1a('0x3c')][_0x5f1a('0x26')]();var _0x1f5b30=_0x156731[_0x5f1a('0x2d')](0x0,_0x156731[_0x5f1a('0x3d')]('_'));var _0x180776=_0x156731[_0x5f1a('0x2d')](_0x156731[_0x5f1a('0x3d')]('_')+0x1);if(_0x1f5b30===_0x5d0d79){_0x5a00de[_0x180776]=_0x446a36[_0x5f1a('0x3e')];}}});}return _0x5a00de;}function getTicket(_0x1e9e0a,_0x5f0b86,_0x2d77f8,_0x527bc8,_0x20d8ac,_0x160f1c,_0x384358){return new Promise(function(_0x115109,_0x2465e1){var _0x490607;return getAuthToken(_0x5f0b86,_0x2d77f8,_0x384358)[_0x5f1a('0x17')](function(_0x2fadd4){if(_0x160f1c[_0x5f1a('0x3f')]==='incident'){_0x490607={'method':_0x5f1a('0xf'),'uri':_0x527bc8+_0x5f1a('0x40'),'body':Object[_0x5f1a('0x41')]({},{'title':intUtil[_0x5f1a('0x42')](_0x160f1c[_0x5f1a('0x43')],_0x20d8ac,'\x20'),'description':intUtil[_0x5f1a('0x42')](_0x160f1c['Descriptions'],_0x20d8ac,'\x0a'),'customerid_contact@odata.bind':_0x1e9e0a[_0x5f1a('0x2f')]?_0x5f1a('0x44')+_0x1e9e0a['enduserId']+')':undefined,'ownerid@odata.bind':_0x5f1a('0x2b')+_0x1e9e0a[_0x5f1a('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x160f1c[_0x5f1a('0x45')],_0x20d8ac,_0x160f1c[_0x5f1a('0x3f')])),'headers':{'Authorization':_0x5f1a('0x19')+_0x2fadd4,'OData-Version':_0x5f1a('0x46')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x160f1c[_0x5f1a('0x3f')]===_0x5f1a('0x47')){var _0x2f7496=_0x1e9e0a[_0x5f1a('0x2f')]?[{'partyid_systemuser@odata.bind':_0x5f1a('0x2b')+_0x1e9e0a['userId']+')','participationtypemask':_0x1e9e0a[_0x5f1a('0x48')]===_0x5f1a('0x49')?0x2:0x1},{'partyid_contact@odata.bind':_0x5f1a('0x44')+_0x1e9e0a[_0x5f1a('0x2f')]+')','participationtypemask':_0x1e9e0a[_0x5f1a('0x48')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x5f1a('0x2b')+_0x1e9e0a[_0x5f1a('0x23')]+')','participationtypemask':_0x1e9e0a[_0x5f1a('0x48')]===_0x5f1a('0x49')?0x2:0x1}];_0x490607={'method':_0x5f1a('0xf'),'uri':_0x527bc8+_0x5f1a('0x4a'),'body':Object[_0x5f1a('0x41')]({},{'subject':intUtil[_0x5f1a('0x42')](_0x160f1c[_0x5f1a('0x43')],_0x20d8ac,'\x20'),'phonenumber':String(_0x20d8ac['calleridnum']),'description':intUtil[_0x5f1a('0x42')](_0x160f1c[_0x5f1a('0x4b')],_0x20d8ac,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1e9e0a['enduserId']?_0x5f1a('0x44')+_0x1e9e0a['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x1e9e0a[_0x5f1a('0x23')]+')','directioncode':_0x1e9e0a[_0x5f1a('0x48')]===_0x5f1a('0x49')?![]:!![],'phonecall_activity_parties':_0x2f7496},getCustomFields(_0x160f1c['Fields'],_0x20d8ac,_0x160f1c[_0x5f1a('0x3f')])),'headers':{'Authorization':_0x5f1a('0x19')+_0x2fadd4,'OData-Version':_0x5f1a('0x46')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x490607);})[_0x5f1a('0x17')](function(_0x6c406){var _0x52030d=_0x6c406[_0x5f1a('0x2c')][_0x5f1a('0x4c')];var _0x2d70ca=_0x52030d[_0x5f1a('0x2d')](_0x52030d[_0x5f1a('0x2e')]('(')+0x1,_0x52030d[_0x5f1a('0x2e')](')'));_0x1e9e0a[_0x5f1a('0x4d')]=_0x2d70ca;_0x115109(_0x1e9e0a);})[_0x5f1a('0x25')](function(_0x5e30ad){_0x2465e1(_0x5e30ad[_0x5f1a('0x16')]);});});}function emit(_0x34ac54,_0x281a98,_0x28fe94,_0x467cc1){var _0x1c8c80={'uri':util[_0x5f1a('0x4e')](_0x5f1a('0x4f'),_0x34ac54,_0x28fe94,_0x467cc1)};io['to'](util[_0x5f1a('0x4e')](_0x5f1a('0x50'),_0x281a98))[_0x5f1a('0x51')](_0x5f1a('0x52'),_0x1c8c80);}exports['cs']=function(_0x336532,_0xb09687,_0x32aa74,_0x2ef9ea,_0x45e4a4,_0x35d8c3,_0x5b96ff,_0x1e24ef){var _0x53ba14={};_0x35d8c3[_0x5f1a('0x11')]=_0x35d8c3[_0x5f1a('0x53')]?intUtil[_0x5f1a('0x54')](_0x35d8c3[_0x5f1a('0xb')][_0x5f1a('0x55')]):intUtil[_0x5f1a('0x54')](_0x35d8c3[_0x5f1a('0x11')]);_0x35d8c3[_0x5f1a('0x56')]=intUtil['stripTrailingSlash'](_0x35d8c3['serverUrl']);_0x53ba14[_0x5f1a('0x48')]=_0x1e24ef===_0x5f1a('0x49')||_0x1e24ef===_0x5f1a('0x57')?_0x5f1a('0x49'):_0x5f1a('0x27');var _0x7d84e=_0x35d8c3['modernAuthentication']?util[_0x5f1a('0x4e')](_0x5f1a('0x58'),_0x35d8c3[_0x5f1a('0xb')]['data7']):util[_0x5f1a('0x4e')]('%s/api/data/v9.0/',_0x35d8c3['remoteUri']);var _0x4f70ff=util[_0x5f1a('0x4e')](_0x5f1a('0x59'),_0x35d8c3[_0x5f1a('0xc')]);var _0x3ab2dc=util[_0x5f1a('0x4e')](_0x5f1a('0x5a'),_0x35d8c3[_0x5f1a('0x56')],_0xb09687[_0x5f1a('0x5b')],md5(_0xb09687[_0x5f1a('0x5b')]));if(_0x45e4a4&&_0x45e4a4[_0x5f1a('0x5c')]){logger['info'](_0x5f1a('0x5d'),_0x5f1a('0x5e'));_0xb09687['recordingURL']=_0x3ab2dc;}else if(_0x5b96ff&&_0x5b96ff[_0x5f1a('0x5f')]&&_0x5b96ff['recordingFormat']!==_0x5f1a('0x60')){logger[_0x5f1a('0x20')](_0x5f1a('0x61'),_0x5f1a('0x5e'));_0xb09687[_0x5f1a('0x62')]=_0x3ab2dc;}else{_0xb09687[_0x5f1a('0x62')]='';}return getUser(_0x53ba14,_0x35d8c3,_0x2ef9ea,_0x4f70ff,_0x7d84e,_0x1e24ef)[_0x5f1a('0x17')](function(_0x32b2ed){logger['info']('['+_0x1e24ef[_0x5f1a('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0x32b2ed[_0x5f1a('0x23')]);logger[_0x5f1a('0x20')]('['+_0x1e24ef[_0x5f1a('0x14')]()+_0x5f1a('0x63'),_0x32b2ed[_0x5f1a('0x1c')]);return getEndUser(_0x32b2ed,_0x35d8c3,_0x4f70ff,_0x7d84e,_0xb09687,_0x1e24ef,_0x32aa74[_0x5f1a('0x64')]);})[_0x5f1a('0x17')](function(_0x3be7a3){logger[_0x5f1a('0x20')]('['+_0x1e24ef[_0x5f1a('0x14')]()+_0x5f1a('0x65'),_0x3be7a3[_0x5f1a('0x2f')]);logger['info']('['+_0x1e24ef[_0x5f1a('0x14')]()+_0x5f1a('0x66'),_0xb09687[_0x5f1a('0x29')]);return getTicket(_0x3be7a3,_0x35d8c3,_0x4f70ff,_0x7d84e,_0xb09687,_0x32aa74,_0x1e24ef);})['then'](function(_0x306931){logger[_0x5f1a('0x20')](util[_0x5f1a('0x4e')]('['+_0x1e24ef[_0x5f1a('0x14')]()+_0x5f1a('0x67'),_0x32aa74[_0x5f1a('0x3f')],_0x306931[_0x5f1a('0x4d')]));logger[_0x5f1a('0x20')](util['format']('['+_0x1e24ef[_0x5f1a('0x14')]()+_0x5f1a('0x68'),_0x1e24ef));if(_0x1e24ef!==_0x5f1a('0x57')){logger['info']('['+_0x1e24ef['toUpperCase']()+']',_0x5f1a('0x69'));emit(_0x35d8c3[_0x5f1a('0x11')],_0x2ef9ea[_0x5f1a('0x6a')],_0x32aa74['ticketType'],_0x306931['ticketId']);}})['catch'](function(_0x442cd3){logger['error']('['+_0x1e24ef[_0x5f1a('0x14')]()+_0x5f1a('0x6b'),_0x442cd3['message']);});}; \ No newline at end of file +var _0x1fee=['format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','then','access_token','error',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','userEmail','length','internalemailaddress','email','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','message','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','lastIndexOf','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','enduserId','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','/contacts(','phonecall','queue','callDirection','phonecalls','Descriptions','ticketId'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1fee,0x1de));var _0xe1fe=function(_0x18fdac,_0x4134d5){_0x18fdac=_0x18fdac-0x0;var _0x469f92=_0x1fee[_0x18fdac];return _0x469f92;};'use strict';var _=require(_0xe1fe('0x0'));var rp=require(_0xe1fe('0x1'));var util=require('util');var intUtil=require(_0xe1fe('0x2'));var md5=require(_0xe1fe('0x3'));var Redis=require(_0xe1fe('0x4'));var logger=require(_0xe1fe('0x5'))(_0xe1fe('0x6'));var config=require(_0xe1fe('0x7'));config['redis']=_[_0xe1fe('0x8')](config[_0xe1fe('0x9')],{'host':_0xe1fe('0xa'),'port':0x18eb});var io=require(_0xe1fe('0xb'))(new Redis(config[_0xe1fe('0x9')]));function getAuthToken(_0x2ef815,_0x2cdb6d,_0x256e24){if(_0x2ef815[_0xe1fe('0xc')]){_0x2ef815[_0xe1fe('0xd')]=_0x2ef815[_0xe1fe('0xe')][_0xe1fe('0xf')];_0x2ef815[_0xe1fe('0x10')]=_0x2ef815[_0xe1fe('0xe')][_0xe1fe('0x11')];return Promise[_0xe1fe('0x12')](_0x2ef815['CloudProvider'][_0xe1fe('0x13')]);}var _0x4e8b28={'method':_0xe1fe('0x14'),'uri':_0x2cdb6d,'form':{'client_id':_0x2ef815[_0xe1fe('0x15')],'resource':_0x2ef815[_0xe1fe('0xd')],'username':_0x2ef815[_0xe1fe('0x16')],'password':_0x2ef815[_0xe1fe('0x17')],'grant_type':_0xe1fe('0x17'),'client_secret':_0x2ef815['clientSecret']},'json':!![]};return rp(_0x4e8b28)[_0xe1fe('0x18')](function(_0x48da0d){return _0x48da0d[_0xe1fe('0x19')];})['catch'](function(_0x2cd710){logger[_0xe1fe('0x1a')]('['+[_0x256e24['toUpperCase']()]+_0xe1fe('0x1b'));return _0x2cd710['message'];});}function getUser(_0x3c28f1,_0x49de71,_0x41dacd,_0x1769d1,_0x38a9a3,_0x3d684c){return new Promise(function(_0x4e631a,_0x527fc4){return getAuthToken(_0x49de71,_0x1769d1,_0x3d684c)['then'](function(_0x311eec){var _0xbb53a9={'method':_0xe1fe('0x1c'),'uri':_0x38a9a3+_0xe1fe('0x1d'),'headers':{'Authorization':_0xe1fe('0x1e')+_0x311eec,'OData-Version':_0xe1fe('0x1f')},'json':!![]};return rp(_0xbb53a9);})[_0xe1fe('0x18')](function(_0x439434){var _0x2e87e6=_0x439434[_0xe1fe('0x20')];var _0x3ebd1c=![];var _0x326177=null;if(!_[_0xe1fe('0x21')](_0x41dacd)){if(intUtil['validateEmail'](_0x41dacd['email'])){_0x3c28f1[_0xe1fe('0x22')]=_0x41dacd['email'];for(_0x326177=0x0;_0x326177<_0x2e87e6[_0xe1fe('0x23')];_0x326177++){if(_0x2e87e6[_0x326177][_0xe1fe('0x24')]===_0x41dacd[_0xe1fe('0x25')]&&!_0x2e87e6[_0x326177][_0xe1fe('0x26')]){_0x3ebd1c=!![];logger[_0xe1fe('0x27')]('['+[_0x3d684c[_0xe1fe('0x28')]()]+_0xe1fe('0x29')+_0x2e87e6[_0x326177]['systemuserid']+'!');_0x3c28f1[_0xe1fe('0x2a')]=_0x2e87e6[_0x326177][_0xe1fe('0x2b')];}}}}if(!_0x3ebd1c){logger['info']('['+[_0x3d684c[_0xe1fe('0x28')]()]+_0xe1fe('0x2c'));_0x3c28f1[_0xe1fe('0x22')]=_0x49de71[_0xe1fe('0x16')];for(_0x326177=0x0;_0x326177<_0x2e87e6[_0xe1fe('0x23')];_0x326177++){if(_0x2e87e6[_0x326177][_0xe1fe('0x24')]===_0x49de71[_0xe1fe('0x16')]){_0x3c28f1[_0xe1fe('0x2a')]=_0x2e87e6[_0x326177]['systemuserid'];}}}_0x4e631a(_0x3c28f1);})[_0xe1fe('0x2d')](function(_0xf862bd){_0x527fc4(_0xf862bd[_0xe1fe('0x2e')]);});});}function createEndUser(_0x4659e7,_0x499c8e,_0x531845,_0x58e336,_0x25f941,_0x1fc946){return new Promise(function(_0xea7729,_0x14f3c9){return getAuthToken(_0x499c8e,_0x531845,_0x1fc946)[_0xe1fe('0x18')](function(_0x5b3ca8){var _0x1c97d8=_0x1fc946[_0xe1fe('0x2f')]()===_0xe1fe('0x30')?_0x25f941[_0xe1fe('0x31')]:_0x25f941[_0xe1fe('0x32')];var _0x51f25f={'method':'POST','uri':_0x58e336+_0xe1fe('0x33'),'body':{'telephone1':_0x1c97d8,'fullname':_0x1c97d8,'firstname':_0x1c97d8,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe1fe('0x34')+_0x4659e7[_0xe1fe('0x2a')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x5b3ca8,'OData-Version':_0xe1fe('0x1f')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x51f25f);})[_0xe1fe('0x18')](function(_0x4216dc){var _0x5b6254=_0x4216dc['headers'][_0xe1fe('0x35')];var _0x2a182b=_0x5b6254['substring'](_0x5b6254[_0xe1fe('0x36')]('(')+0x1,_0x5b6254[_0xe1fe('0x36')](')'));_0x4659e7['enduserId']=_0x2a182b;_0xea7729(_0x4659e7);})[_0xe1fe('0x2d')](function(_0x4a326e){_0x14f3c9(_0x4a326e['message']);});});}function getEndUser(_0x37b526,_0xa7886c,_0x3f3b78,_0x46d5bf,_0x435024,_0x6a0cb,_0x1652c5){var _0x2e3cd7=_0x6a0cb['toLowerCase']()===_0xe1fe('0x30')?_0x435024[_0xe1fe('0x31')]:_0x435024[_0xe1fe('0x32')];return getAuthToken(_0xa7886c,_0x3f3b78,_0x6a0cb)[_0xe1fe('0x18')](function(_0x11044b){var _0x32ba3f={'method':_0xe1fe('0x1c'),'uri':_0x46d5bf+_0xe1fe('0x37')+_0x2e3cd7[_0xe1fe('0x38')]('+',_0xe1fe('0x39'))+'\x27','headers':{'Authorization':_0xe1fe('0x1e')+_0x11044b,'If-None-Match':null,'OData-Version':_0xe1fe('0x1f')},'json':!![]};return rp(_0x32ba3f);})[_0xe1fe('0x18')](function(_0x20a8e7){var _0x12a33a=![];if(!_0x20a8e7)return _0x12a33a;var _0x17bd91=_0x20a8e7[_0xe1fe('0x20')];for(var _0x200822=0x0;_0x200822<_0x17bd91['length'];_0x200822++){if(_0x17bd91[_0x200822]['telephone1']===_0x2e3cd7){_0x12a33a=!![];_0x37b526[_0xe1fe('0x3a')]=_0x17bd91[_0x200822][_0xe1fe('0x3b')];}}return _0x12a33a;})[_0xe1fe('0x18')](function(_0x367e5e){if(_0x367e5e)return _0x37b526;if(_0x1652c5===_0xe1fe('0x3c')){logger['info']('['+[_0x6a0cb[_0xe1fe('0x28')]()]+_0xe1fe('0x3d'));return _0x37b526;}return createEndUser(_0x37b526,_0xa7886c,_0x3f3b78,_0x46d5bf,_0x435024,_0x6a0cb)['then'](function(_0x35dc0d){logger[_0xe1fe('0x27')]('['+[_0x6a0cb[_0xe1fe('0x28')]()]+_0xe1fe('0x3e'),_0x35dc0d[_0xe1fe('0x3a')]);return _0x35dc0d;});});}function getCustomFields(_0x55bce9,_0x1ecd2d,_0x45004e){var _0x30fc72={};if(_0x55bce9[_0xe1fe('0x23')]>0x0){_[_0xe1fe('0x3f')](_0x55bce9,function(_0x46c11b){if(_[_0xe1fe('0x40')]([_0xe1fe('0x41'),_0xe1fe('0x42')],_0x46c11b[_0xe1fe('0x43')])&&_0x46c11b[_0xe1fe('0x44')]&&!_0x46c11b[_0xe1fe('0x45')]){var _0x314bda=_0x46c11b[_0xe1fe('0x46')][_0xe1fe('0x2f')]();var _0x4bb7bf=_0x314bda[_0xe1fe('0x47')](0x0,_0x314bda[_0xe1fe('0x48')]('_'));var _0x377585=_0x314bda['substring'](_0x314bda[_0xe1fe('0x48')]('_')+0x1);if(_0x4bb7bf===_0x45004e){_0x30fc72[_0x377585]=_0x46c11b[_0xe1fe('0x49')];}}});}return _0x30fc72;}function getTicket(_0x3fd8f1,_0x28120c,_0x36f8f1,_0x556830,_0xbb5d55,_0x18e2b0,_0x36f2c0){return new Promise(function(_0x5af42b,_0x3c2022){var _0x3abc70;return getAuthToken(_0x28120c,_0x36f8f1,_0x36f2c0)[_0xe1fe('0x18')](function(_0x31d1af){if(_0x18e2b0[_0xe1fe('0x4a')]===_0xe1fe('0x4b')){_0x3abc70={'method':'POST','uri':_0x556830+_0xe1fe('0x4c'),'body':Object[_0xe1fe('0x4d')]({},{'title':intUtil[_0xe1fe('0x4e')](_0x18e2b0[_0xe1fe('0x4f')],_0xbb5d55,'\x20'),'description':intUtil['getString'](_0x18e2b0['Descriptions'],_0xbb5d55,'\x0a'),'customerid_contact@odata.bind':_0x3fd8f1[_0xe1fe('0x3a')]?_0xe1fe('0x50')+_0x3fd8f1['enduserId']+')':undefined,'ownerid@odata.bind':_0xe1fe('0x34')+_0x3fd8f1['userId']+')','caseorigincode':'1'},getCustomFields(_0x18e2b0['Fields'],_0xbb5d55,_0x18e2b0[_0xe1fe('0x4a')])),'headers':{'Authorization':_0xe1fe('0x1e')+_0x31d1af,'OData-Version':_0xe1fe('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x18e2b0[_0xe1fe('0x4a')]===_0xe1fe('0x51')){var _0x4b77a6=_0x3fd8f1[_0xe1fe('0x3a')]?[{'partyid_systemuser@odata.bind':_0xe1fe('0x34')+_0x3fd8f1[_0xe1fe('0x2a')]+')','participationtypemask':_0x3fd8f1['callDirection']===_0xe1fe('0x52')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x3fd8f1[_0xe1fe('0x3a')]+')','participationtypemask':_0x3fd8f1[_0xe1fe('0x53')]===_0xe1fe('0x52')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xe1fe('0x34')+_0x3fd8f1[_0xe1fe('0x2a')]+')','participationtypemask':_0x3fd8f1[_0xe1fe('0x53')]==='queue'?0x2:0x1}];_0x3abc70={'method':'POST','uri':_0x556830+_0xe1fe('0x54'),'body':Object[_0xe1fe('0x4d')]({},{'subject':intUtil[_0xe1fe('0x4e')](_0x18e2b0[_0xe1fe('0x4f')],_0xbb5d55,'\x20'),'phonenumber':String(_0xbb5d55[_0xe1fe('0x32')]),'description':intUtil['getString'](_0x18e2b0[_0xe1fe('0x55')],_0xbb5d55,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3fd8f1['enduserId']?_0xe1fe('0x50')+_0x3fd8f1['enduserId']+')':undefined,'ownerid@odata.bind':_0xe1fe('0x34')+_0x3fd8f1['userId']+')','directioncode':_0x3fd8f1[_0xe1fe('0x53')]===_0xe1fe('0x52')?![]:!![],'phonecall_activity_parties':_0x4b77a6},getCustomFields(_0x18e2b0['Fields'],_0xbb5d55,_0x18e2b0[_0xe1fe('0x4a')])),'headers':{'Authorization':_0xe1fe('0x1e')+_0x31d1af,'OData-Version':_0xe1fe('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3abc70);})[_0xe1fe('0x18')](function(_0xe3ff04){var _0x182238=_0xe3ff04['headers'][_0xe1fe('0x35')];var _0x9a0c7f=_0x182238[_0xe1fe('0x47')](_0x182238[_0xe1fe('0x36')]('(')+0x1,_0x182238[_0xe1fe('0x36')](')'));_0x3fd8f1[_0xe1fe('0x56')]=_0x9a0c7f;_0x5af42b(_0x3fd8f1);})[_0xe1fe('0x2d')](function(_0x1143d7){_0x3c2022(_0x1143d7[_0xe1fe('0x2e')]);});});}function emit(_0x37d76b,_0x384589,_0x33723f,_0x1ac1ef){var _0x564ae1={'uri':util[_0xe1fe('0x57')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x37d76b,_0x33723f,_0x1ac1ef)};io['to'](util['format'](_0xe1fe('0x58'),_0x384589))[_0xe1fe('0x59')](_0xe1fe('0x5a'),_0x564ae1);}exports['cs']=function(_0x49d096,_0x498fa0,_0x28e896,_0x466fce,_0x37d2b0,_0x4558ee,_0x465087,_0x666794){var _0x1e30bf={};_0x4558ee[_0xe1fe('0xd')]=_0x4558ee[_0xe1fe('0xc')]?intUtil[_0xe1fe('0x5b')](_0x4558ee[_0xe1fe('0xe')][_0xe1fe('0xf')]):intUtil[_0xe1fe('0x5b')](_0x4558ee[_0xe1fe('0xd')]);_0x4558ee['serverUrl']=intUtil[_0xe1fe('0x5b')](_0x4558ee[_0xe1fe('0x5c')]);_0x1e30bf['callDirection']=_0x666794===_0xe1fe('0x52')||_0x666794===_0xe1fe('0x5d')?_0xe1fe('0x52'):_0xe1fe('0x30');var _0x456180=_0x4558ee[_0xe1fe('0xc')]?util[_0xe1fe('0x57')](_0xe1fe('0x5e'),_0x4558ee['CloudProvider'][_0xe1fe('0xf')]):util[_0xe1fe('0x57')](_0xe1fe('0x5e'),_0x4558ee['remoteUri']);var _0x5883ef=util[_0xe1fe('0x57')](_0xe1fe('0x5f'),_0x4558ee[_0xe1fe('0x10')]);var _0x463feb=util[_0xe1fe('0x57')](_0xe1fe('0x60'),_0x4558ee['serverUrl'],_0x498fa0['uniqueid'],md5(_0x498fa0[_0xe1fe('0x61')]));if(_0x37d2b0&&_0x37d2b0[_0xe1fe('0x62')]){logger['info'](_0xe1fe('0x63'),'Recording\x20is\x20enabled!');_0x498fa0[_0xe1fe('0x64')]=_0x463feb;}else if(_0x465087&&_0x465087[_0xe1fe('0x65')]&&_0x465087['recordingFormat']!==_0xe1fe('0x66')){logger[_0xe1fe('0x27')](_0xe1fe('0x67'),_0xe1fe('0x68'));_0x498fa0[_0xe1fe('0x64')]=_0x463feb;}else{_0x498fa0[_0xe1fe('0x64')]='';}return getUser(_0x1e30bf,_0x4558ee,_0x466fce,_0x5883ef,_0x456180,_0x666794)[_0xe1fe('0x18')](function(_0x29b505){logger[_0xe1fe('0x27')]('['+_0x666794[_0xe1fe('0x28')]()+_0xe1fe('0x69'),_0x29b505[_0xe1fe('0x2a')]);logger['info']('['+_0x666794[_0xe1fe('0x28')]()+']\x20The\x20User\x20email\x20is:',_0x29b505[_0xe1fe('0x22')]);return getEndUser(_0x29b505,_0x4558ee,_0x5883ef,_0x456180,_0x498fa0,_0x666794,_0x28e896[_0xe1fe('0x6a')]);})[_0xe1fe('0x18')](function(_0x3ae5b9){logger[_0xe1fe('0x27')]('['+_0x666794['toUpperCase']()+_0xe1fe('0x6b'),_0x3ae5b9[_0xe1fe('0x3a')]);logger['info']('['+_0x666794[_0xe1fe('0x28')]()+_0xe1fe('0x6c'),_0x498fa0[_0xe1fe('0x32')]);return getTicket(_0x3ae5b9,_0x4558ee,_0x5883ef,_0x456180,_0x498fa0,_0x28e896,_0x666794);})[_0xe1fe('0x18')](function(_0xed5d6d){logger[_0xe1fe('0x27')](util[_0xe1fe('0x57')]('['+_0x666794['toUpperCase']()+_0xe1fe('0x6d'),_0x28e896[_0xe1fe('0x4a')],_0xed5d6d[_0xe1fe('0x56')]));logger[_0xe1fe('0x27')](util[_0xe1fe('0x57')]('['+_0x666794['toUpperCase']()+_0xe1fe('0x6e'),_0x666794));if(_0x666794!==_0xe1fe('0x5d')){logger['info']('['+_0x666794[_0xe1fe('0x28')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4558ee[_0xe1fe('0xd')],_0x466fce[_0xe1fe('0x6f')],_0x28e896['ticketType'],_0xed5d6d['ticketId']);}})[_0xe1fe('0x2d')](function(_0x169a98){logger[_0xe1fe('0x1a')]('['+_0x666794[_0xe1fe('0x28')]()+_0xe1fe('0x70'),_0x169a98[_0xe1fe('0x2e')]);});}; \ 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 259d7ef..ba91ee9 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 _0x7125=['custom_fields','mapValues','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','[HTTP]','stringify','forEach','includes','string','type','nameField','customField','toLowerCase','toString','picklist','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','catch','unmanaged','lastevent','toUpperCase','lodash','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name'];(function(_0x5da32a,_0x2c926a){var _0xa705e1=function(_0x4579f0){while(--_0x4579f0){_0x5da32a['push'](_0x5da32a['shift']());}};_0xa705e1(++_0x2c926a);}(_0x7125,0xf0));var _0x5712=function(_0x311348,_0x523c03){_0x311348=_0x311348-0x0;var _0x39c61e=_0x7125[_0x311348];return _0x39c61e;};'use strict';var _=require(_0x5712('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x5712('0x1'));var config=require(_0x5712('0x2'));var logger=require(_0x5712('0x3'))(_0x5712('0x4'));config['redis']=_[_0x5712('0x5')](config[_0x5712('0x6')],{'host':_0x5712('0x7'),'port':0x18eb});var io=require(_0x5712('0x8'))(new Redis(config[_0x5712('0x6')]));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x23d4e9,_0xe3c72e,_0x4eba1e){io['to'](_0x23d4e9)['emit'](_0xe3c72e,_0x4eba1e);}function getTicket(_0x202a9c,_0x1a5d76,_0x5be5da,_0x4727dc,_0x552114){logger[_0x5712('0x9')]('Creating\x20new\x20ticket...');var _0x52e8fa=_[_0x5712('0xa')]({'responder_id':_0x1a5d76['id'],'requester_id':_0x5be5da['id'],'name':util[_0x5712('0xb')](_0x5712('0xc'),_0x552114[_0x5712('0xd')]),'phone':_0x552114[_0x5712('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5712('0xf')](_0x4727dc[_0x5712('0x10')],_0x552114,'\x20'),'description':intUtil[_0x5712('0xf')](_0x4727dc[_0x5712('0x11')],_0x552114,_0x5712('0x12')),'tags':getTags(_0x4727dc[_0x5712('0x13')],_0x5712('0x14'))},getCustomFields(_0x4727dc['Fields'],_0x552114));_0x52e8fa[_0x5712('0x15')]=_[_0x5712('0x16')](_['keyBy'](_0x52e8fa[_0x5712('0x15')],'id'),'value');return request({'uri':util[_0x5712('0xb')](_0x5712('0x17'),_0x202a9c[_0x5712('0x18')]),'method':_0x5712('0x19'),'body':_0x52e8fa})[_0x5712('0x1a')](function(_0x3ea7fc){logger[_0x5712('0x9')](_0x5712('0x1b'));return _0x3ea7fc;});}function getUser(_0x12a4f8,_0xee5170){if(intUtil[_0x5712('0x1c')](_0xee5170)){return request({'uri':util[_0x5712('0xb')](_0x5712('0x1d'),_0x12a4f8[_0x5712('0x18')]),'qs':{'email':_0xee5170}})[_0x5712('0x1a')](function(_0xd5052b){if(_0xd5052b[_0x5712('0x1e')]){logger['info'](_0x5712('0x1f'));return _[_0x5712('0x20')](_0xd5052b,function(_0x5afa47){return _0x5afa47[_0x5712('0x21')][_0x5712('0x22')]===_0xee5170;});}else{logger[_0x5712('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5712('0xb')]('%s/api/v2/agents/me',_0x12a4f8['remoteUri'])})[_0x5712('0x1a')](function(_0x5a1ebc){logger[_0x5712('0x9')](_0x5712('0x23'));return _0x5a1ebc;});}});}else{logger['info'](_0x5712('0x24'));return request({'uri':util[_0x5712('0xb')](_0x5712('0x25'),_0x12a4f8[_0x5712('0x18')])})[_0x5712('0x1a')](function(_0x31f53f){logger[_0x5712('0x9')](_0x5712('0x23'));return _0x31f53f;});}}function getEndUser(_0x54cced,_0x5dcde7,_0x333a77){logger[_0x5712('0x9')]('Searching\x20enduser\x20with\x20phone',_0x333a77);return request({'uri':util[_0x5712('0xb')](_0x5712('0x26'),_0x54cced['remoteUri']),'qs':{'phone':_0x333a77}})[_0x5712('0x1a')](function(_0x31acde){if(_0x31acde[_0x5712('0x1e')]){logger[_0x5712('0x9')](_0x5712('0x27'));return _[_0x5712('0x20')](_0x31acde,{'phone':_0x333a77});}else{logger['info'](_0x5712('0x28'));return request({'uri':util['format']('%s/api/v2/contacts',_0x54cced[_0x5712('0x18')]),'method':_0x5712('0x19'),'body':{'name':_0x5dcde7,'phone':_0x333a77}})['then'](function(_0x563ff0){logger['info'](_0x5712('0x29'));return _0x563ff0;});}});}function getAuth(_0x5137ae){return util[_0x5712('0xb')](_0x5712('0x2a'),new Buffer(_0x5137ae['apiKey']+':X')['toString'](_0x5712('0x2b')));}function request(_0x1b2afc){logger['debug'](_0x5712('0x2c'),JSON[_0x5712('0x2d')](_0x1b2afc));return rp(_[_0x5712('0x5')](_0x1b2afc,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x39d409,_0x32a89d){var _0x428393=[];if(_0x39d409&&_0x39d409[_0x5712('0x1e')]>0x0){_0x428393=_['map'](_0x39d409,_0x32a89d);}return _0x428393;}function getCustomFields(_0x56642c,_0x3c76ab){var _0x350195=[];var _0x33a05b={'custom_fields':[]};if(_0x56642c[_0x5712('0x1e')]>0x0){_[_0x5712('0x2e')](_0x56642c,function(_0x5e432f){if(_[_0x5712('0x2f')]([_0x5712('0x30'),'picklist'],_0x5e432f[_0x5712('0x31')])&&_0x5e432f[_0x5712('0x32')]&&!_0x5e432f[_0x5712('0x33')]){_0x33a05b[_0x5e432f[_0x5712('0x32')][_0x5712('0x34')]()]=_0x5e432f['content'][_0x5712('0x35')]();}else if(_[_0x5712('0x2f')]([_0x5712('0x30'),_0x5712('0x36')],_0x5e432f[_0x5712('0x31')])&&_0x5e432f['idField']&&_0x5e432f[_0x5712('0x33')]){_0x33a05b[_0x5712('0x15')][_0x5712('0x37')]({'id':_0x5e432f[_0x5712('0x38')],'value':_0x5e432f['content'][_0x5712('0x35')]()});}else if(_0x5e432f[_0x5712('0x31')]===_0x5712('0x39')&&_0x5e432f[_0x5712('0x3a')]&&_0x5e432f[_0x5712('0x38')]&&_0x5e432f['customField']){_0x3c76ab[_0x5e432f[_0x5712('0x3a')]]&&_0x33a05b[_0x5712('0x15')][_0x5712('0x37')]({'id':_0x5e432f[_0x5712('0x38')],'value':_0x3c76ab[_0x5e432f[_0x5712('0x3a')]][_0x5712('0x35')]()});}else if(_0x5e432f[_0x5712('0x31')]===_0x5712('0x3b')&&_0x5e432f['Variable']&&_0x5e432f[_0x5712('0x3c')]['name']&&_0x5e432f[_0x5712('0x38')]&&_0x5e432f[_0x5712('0x33')]){_0x3c76ab[_0x5e432f['Variable'][_0x5712('0x14')]['toLowerCase']()]&&_0x33a05b[_0x5712('0x15')]['push']({'id':_0x5e432f[_0x5712('0x38')],'value':_0x3c76ab[_0x5e432f['Variable'][_0x5712('0x14')][_0x5712('0x34')]()]['toString']()});}});}return _0x33a05b;}exports[_0x5712('0x3d')]=function(_0x24ccc1,_0x50d1a0,_0x3d9a21,_0x2a125b,_0x5288b5,_0x362f02){var _0x5b49e5,_0x49af75;_0x362f02['remoteUri']=intUtil[_0x5712('0x3e')](_0x362f02[_0x5712('0x18')]);_0x362f02[_0x5712('0x3f')]=intUtil[_0x5712('0x3e')](_0x362f02['serverUrl']);if(_0x5288b5&&_0x5288b5[_0x5712('0x40')]){logger['info'](_0x5712('0x41'),_0x5712('0x42'));_0x50d1a0[_0x5712('0x43')]=util[_0x5712('0xb')](_0x5712('0x44'),_0x362f02['serverUrl'],_0x50d1a0['uniqueid'],md5(_0x50d1a0['uniqueid']));}else{_0x50d1a0[_0x5712('0x43')]='';}headers[_0x5712('0x45')]=getAuth(_0x362f02);return getUser(_0x362f02,_0x2a125b[_0x5712('0x22')])[_0x5712('0x1a')](function(_0x1b2618){_0x5b49e5=_0x1b2618;logger['info'](_0x5712('0x46'),_0x5b49e5['id']);return getEndUser(_0x362f02,_0x50d1a0[_0x5712('0xd')],_0x50d1a0[_0x5712('0xe')]);})[_0x5712('0x1a')](function(_0x7c2c61){_0x49af75=_0x7c2c61;logger[_0x5712('0x9')](_0x5712('0x47'),_0x49af75['id']);return getTicket(_0x362f02,_0x5b49e5,_0x49af75,_0x3d9a21,_0x50d1a0);})[_0x5712('0x1a')](function(_0x4d4671){if(_0x4d4671&&_0x4d4671['id']){logger[_0x5712('0x9')](_0x5712('0x1b'));logger[_0x5712('0x9')](_0x5712('0x48'),_0x4d4671['id']);logger[_0x5712('0x9')](_0x5712('0x41'),_0x5712('0x49'));emit(util[_0x5712('0xb')](_0x5712('0x4a'),_0x2a125b['name']),_0x5712('0x4b'),{'uri':util[_0x5712('0xb')]('%s/helpdesk/tickets/%d',_0x362f02['remoteUri'],_0x4d4671['id'])});}})['catch'](function(_0x3b07d2){logger[_0x5712('0x4c')]('[QUEUE]',JSON[_0x5712('0x2d')](_0x3b07d2));});};exports[_0x5712('0x4d')]=function(_0x34fa44,_0x1b24e4,_0xabdb3b,_0x2538fc,_0x2c6a58,_0xab0e59,_0x402aba){var _0xd52e5b,_0x43d64;_0xab0e59[_0x5712('0x18')]=intUtil[_0x5712('0x3e')](_0xab0e59[_0x5712('0x18')]);_0xab0e59[_0x5712('0x3f')]=intUtil['stripTrailingSlash'](_0xab0e59['serverUrl']);if(_0x402aba&&_0x402aba['recordingFormat']&&_0x402aba[_0x5712('0x4e')]!==_0x5712('0x4f')){logger['info'](_0x5712('0x50'),_0x5712('0x42'));_0x1b24e4[_0x5712('0x43')]=util['format'](_0x5712('0x44'),_0xab0e59[_0x5712('0x3f')],_0x1b24e4[_0x5712('0x51')],md5(_0x1b24e4['uniqueid']));}headers[_0x5712('0x45')]=getAuth(_0xab0e59);return getUser(_0xab0e59,_0x2538fc[_0x5712('0x22')])[_0x5712('0x1a')](function(_0x11ef22){_0xd52e5b=_0x11ef22;logger['info'](_0x5712('0x46'),_0xd52e5b['id']);return getEndUser(_0xab0e59,_0x1b24e4[_0x5712('0x52')],_0x1b24e4['destcalleridnum']);})[_0x5712('0x1a')](function(_0x56dc89){_0x43d64=_0x56dc89;logger[_0x5712('0x9')]('The\x20Enduser\x20ID\x20is:',_0x43d64['id']);return getTicket(_0xab0e59,_0xd52e5b,_0x43d64,_0xabdb3b,_0x1b24e4);})['then'](function(_0x42d686){if(_0x42d686&&_0x42d686['id']){logger['info'](_0x5712('0x1b'));logger['info'](_0x5712('0x48'),_0x42d686['id']);logger['info'](_0x5712('0x50'),_0x5712('0x49'));emit(util['format'](_0x5712('0x4a'),_0x2538fc[_0x5712('0x14')]),_0x5712('0x4b'),{'uri':util[_0x5712('0xb')]('%s/helpdesk/tickets/%d',_0xab0e59[_0x5712('0x18')],_0x42d686['id'])});}})[_0x5712('0x53')](function(_0x2723ea){logger[_0x5712('0x4c')](_0x5712('0x50'),JSON['stringify'](_0x2723ea));});};exports[_0x5712('0x54')]=function(_0x4921de,_0x212ca3,_0x213561,_0xa0e039,_0xf54c89,_0x239f7e){var _0x31d973,_0x225706;_0x239f7e['remoteUri']=intUtil[_0x5712('0x3e')](_0x239f7e['remoteUri']);_0x239f7e[_0x5712('0x3f')]=intUtil[_0x5712('0x3e')](_0x239f7e[_0x5712('0x3f')]);if(_0xf54c89&&_0xf54c89['monitor_format']){logger[_0x5712('0x9')]('['+_0x212ca3[_0x5712('0x55')][_0x5712('0x56')]()+']',_0x5712('0x42'));_0x212ca3['recordingURL']=util[_0x5712('0xb')](_0x5712('0x44'),_0x239f7e['serverUrl'],_0x212ca3[_0x5712('0x51')],md5(_0x212ca3[_0x5712('0x51')]));}else{_0x212ca3[_0x5712('0x43')]='';}headers[_0x5712('0x45')]=getAuth(_0x239f7e);return getUser(_0x239f7e,'')[_0x5712('0x1a')](function(_0x4ec838){_0x31d973=_0x4ec838;logger[_0x5712('0x9')](_0x5712('0x46'),_0x31d973['id']);return getEndUser(_0x239f7e,_0x212ca3['calleridname'],_0x212ca3[_0x5712('0xe')]);})[_0x5712('0x1a')](function(_0x2886f1){_0x225706=_0x2886f1;logger[_0x5712('0x9')](_0x5712('0x47'),_0x225706['id']);return getTicket(_0x239f7e,_0x31d973,_0x225706,_0x213561,_0x212ca3);})['then'](function(_0xeca724){if(_0xeca724){logger[_0x5712('0x9')]('Ticket\x20created!');logger['info'](_0x5712('0x48'),_0xeca724['id']);}})[_0x5712('0x53')](function(_0x3cf641){logger['error']('['+_0x212ca3[_0x5712('0x55')][_0x5712('0x56')]()+']',JSON[_0x5712('0x2d')](_0x3cf641));});}; \ No newline at end of file +var _0x21f6=['localhost','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','catch','lastevent','ioredis','./util','../../../../config/logger','freshdesk','redis'];(function(_0x3831ce,_0x587f67){var _0x5d1730=function(_0x1b2e73){while(--_0x1b2e73){_0x3831ce['push'](_0x3831ce['shift']());}};_0x5d1730(++_0x587f67);}(_0x21f6,0x1c2));var _0x621f=function(_0x16947e,_0x262501){_0x16947e=_0x16947e-0x0;var _0x1e36ec=_0x21f6[_0x16947e];return _0x1e36ec;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0x621f('0x0'));var intUtil=require(_0x621f('0x1'));var config=require('../../../../config/environment');var logger=require(_0x621f('0x2'))(_0x621f('0x3'));config[_0x621f('0x4')]=_['defaults'](config[_0x621f('0x4')],{'host':_0x621f('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x621f('0x4')]));var headers={'Content-Type':_0x621f('0x6'),'Accept':_0x621f('0x6')};function emit(_0x5a4a52,_0x3118ec,_0x3827a7){io['to'](_0x5a4a52)[_0x621f('0x7')](_0x3118ec,_0x3827a7);}function getTicket(_0xec1756,_0x3fcbca,_0x4140fa,_0x308d30,_0x3c565d){logger[_0x621f('0x8')](_0x621f('0x9'));var _0x5a191d=_['merge']({'responder_id':_0x3fcbca['id'],'requester_id':_0x4140fa['id'],'name':util[_0x621f('0xa')](_0x621f('0xb'),_0x3c565d['calleridname']),'phone':_0x3c565d[_0x621f('0xc')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x308d30[_0x621f('0xd')],_0x3c565d,'\x20'),'description':intUtil[_0x621f('0xe')](_0x308d30[_0x621f('0xf')],_0x3c565d,'
'),'tags':getTags(_0x308d30[_0x621f('0x10')],_0x621f('0x11'))},getCustomFields(_0x308d30[_0x621f('0x12')],_0x3c565d));_0x5a191d[_0x621f('0x13')]=_[_0x621f('0x14')](_[_0x621f('0x15')](_0x5a191d[_0x621f('0x13')],'id'),_0x621f('0x16'));return request({'uri':util[_0x621f('0xa')](_0x621f('0x17'),_0xec1756[_0x621f('0x18')]),'method':_0x621f('0x19'),'body':_0x5a191d})[_0x621f('0x1a')](function(_0x1e53a2){logger[_0x621f('0x8')](_0x621f('0x1b'));return _0x1e53a2;});}function getUser(_0x2d33c8,_0x10a414){if(intUtil[_0x621f('0x1c')](_0x10a414)){return request({'uri':util[_0x621f('0xa')](_0x621f('0x1d'),_0x2d33c8[_0x621f('0x18')]),'qs':{'email':_0x10a414}})[_0x621f('0x1a')](function(_0x3ee513){if(_0x3ee513[_0x621f('0x1e')]){logger[_0x621f('0x8')](_0x621f('0x1f'));return _[_0x621f('0x20')](_0x3ee513,function(_0x431f0c){return _0x431f0c[_0x621f('0x21')][_0x621f('0x22')]===_0x10a414;});}else{logger[_0x621f('0x8')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x621f('0xa')](_0x621f('0x23'),_0x2d33c8[_0x621f('0x18')])})[_0x621f('0x1a')](function(_0x3944dc){logger[_0x621f('0x8')](_0x621f('0x24'));return _0x3944dc;});}});}else{logger['info'](_0x621f('0x25'));return request({'uri':util[_0x621f('0xa')]('%s/api/v2/agents/me',_0x2d33c8['remoteUri'])})[_0x621f('0x1a')](function(_0x3e079f){logger[_0x621f('0x8')](_0x621f('0x24'));return _0x3e079f;});}}function getEndUser(_0x18e13f,_0x39a862,_0x4344c8){logger[_0x621f('0x8')](_0x621f('0x26'),_0x4344c8);return request({'uri':util[_0x621f('0xa')](_0x621f('0x27'),_0x18e13f[_0x621f('0x18')]),'qs':{'phone':_0x4344c8}})[_0x621f('0x1a')](function(_0x4d4a84){if(_0x4d4a84['length']){logger[_0x621f('0x8')](_0x621f('0x28'));return _[_0x621f('0x20')](_0x4d4a84,{'phone':_0x4344c8});}else{logger[_0x621f('0x8')](_0x621f('0x29'));return request({'uri':util[_0x621f('0xa')](_0x621f('0x27'),_0x18e13f[_0x621f('0x18')]),'method':_0x621f('0x19'),'body':{'name':_0x39a862,'phone':_0x4344c8}})[_0x621f('0x1a')](function(_0x50d4f4){logger[_0x621f('0x8')](_0x621f('0x2a'));return _0x50d4f4;});}});}function getAuth(_0x55f3df){return util['format'](_0x621f('0x2b'),new Buffer(_0x55f3df['apiKey']+':X')[_0x621f('0x2c')](_0x621f('0x2d')));}function request(_0x472219){logger['debug'](_0x621f('0x2e'),JSON[_0x621f('0x2f')](_0x472219));return rp(_[_0x621f('0x30')](_0x472219,{'method':_0x621f('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x576b24,_0x4aab81){var _0x1548f9=[];if(_0x576b24&&_0x576b24['length']>0x0){_0x1548f9=_[_0x621f('0x32')](_0x576b24,_0x4aab81);}return _0x1548f9;}function getCustomFields(_0x42482a,_0xb40f7d){var _0x39168a=[];var _0x1adbff={'custom_fields':[]};if(_0x42482a['length']>0x0){_[_0x621f('0x33')](_0x42482a,function(_0x46ce38){if(_[_0x621f('0x34')]([_0x621f('0x35'),'picklist'],_0x46ce38[_0x621f('0x36')])&&_0x46ce38['nameField']&&!_0x46ce38[_0x621f('0x37')]){_0x1adbff[_0x46ce38[_0x621f('0x38')][_0x621f('0x39')]()]=_0x46ce38[_0x621f('0x3a')][_0x621f('0x2c')]();}else if(_[_0x621f('0x34')](['string',_0x621f('0x3b')],_0x46ce38[_0x621f('0x36')])&&_0x46ce38[_0x621f('0x3c')]&&_0x46ce38[_0x621f('0x37')]){_0x1adbff['custom_fields'][_0x621f('0x3d')]({'id':_0x46ce38['idField'],'value':_0x46ce38[_0x621f('0x3a')][_0x621f('0x2c')]()});}else if(_0x46ce38['type']===_0x621f('0x3e')&&_0x46ce38[_0x621f('0x3f')]&&_0x46ce38[_0x621f('0x3c')]&&_0x46ce38['customField']){_0xb40f7d[_0x46ce38[_0x621f('0x3f')]]&&_0x1adbff[_0x621f('0x13')][_0x621f('0x3d')]({'id':_0x46ce38['idField'],'value':_0xb40f7d[_0x46ce38[_0x621f('0x3f')]][_0x621f('0x2c')]()});}else if(_0x46ce38['type']===_0x621f('0x40')&&_0x46ce38[_0x621f('0x41')]&&_0x46ce38[_0x621f('0x41')][_0x621f('0x11')]&&_0x46ce38[_0x621f('0x3c')]&&_0x46ce38['customField']){_0xb40f7d[_0x46ce38[_0x621f('0x41')][_0x621f('0x11')]['toLowerCase']()]&&_0x1adbff[_0x621f('0x13')][_0x621f('0x3d')]({'id':_0x46ce38['idField'],'value':_0xb40f7d[_0x46ce38['Variable'][_0x621f('0x11')]['toLowerCase']()][_0x621f('0x2c')]()});}});}return _0x1adbff;}exports[_0x621f('0x42')]=function(_0x4deff7,_0xb55cbb,_0x1c9ec4,_0x59eaaa,_0x318fbe,_0x2d9953){var _0x4ee3b0,_0x342a5c;_0x2d9953[_0x621f('0x18')]=intUtil[_0x621f('0x43')](_0x2d9953['remoteUri']);_0x2d9953[_0x621f('0x44')]=intUtil[_0x621f('0x43')](_0x2d9953[_0x621f('0x44')]);if(_0x318fbe&&_0x318fbe[_0x621f('0x45')]){logger[_0x621f('0x8')](_0x621f('0x46'),_0x621f('0x47'));_0xb55cbb[_0x621f('0x48')]=util[_0x621f('0xa')](_0x621f('0x49'),_0x2d9953[_0x621f('0x44')],_0xb55cbb[_0x621f('0x4a')],md5(_0xb55cbb['uniqueid']));}else{_0xb55cbb['recordingURL']='';}headers[_0x621f('0x4b')]=getAuth(_0x2d9953);return getUser(_0x2d9953,_0x59eaaa[_0x621f('0x22')])[_0x621f('0x1a')](function(_0x11fdf8){_0x4ee3b0=_0x11fdf8;logger[_0x621f('0x8')](_0x621f('0x4c'),_0x4ee3b0['id']);return getEndUser(_0x2d9953,_0xb55cbb['calleridname'],_0xb55cbb[_0x621f('0xc')]);})['then'](function(_0x31b23c){_0x342a5c=_0x31b23c;logger[_0x621f('0x8')](_0x621f('0x4d'),_0x342a5c['id']);return getTicket(_0x2d9953,_0x4ee3b0,_0x342a5c,_0x1c9ec4,_0xb55cbb);})[_0x621f('0x1a')](function(_0x10a4b7){if(_0x10a4b7&&_0x10a4b7['id']){logger[_0x621f('0x8')](_0x621f('0x1b'));logger[_0x621f('0x8')](_0x621f('0x4e'),_0x10a4b7['id']);logger[_0x621f('0x8')](_0x621f('0x46'),_0x621f('0x4f'));emit(util['format'](_0x621f('0x50'),_0x59eaaa[_0x621f('0x11')]),_0x621f('0x51'),{'uri':util[_0x621f('0xa')](_0x621f('0x52'),_0x2d9953['remoteUri'],_0x10a4b7['id'])});}})['catch'](function(_0x118cde){logger[_0x621f('0x53')](_0x621f('0x46'),JSON[_0x621f('0x2f')](_0x118cde));});};exports[_0x621f('0x54')]=function(_0x1a5ba2,_0x2bacab,_0xa9811a,_0x2b6cbd,_0x5bc1a7,_0x447e73,_0x5ad291){var _0x34d1ea,_0x5485ba;_0x447e73['remoteUri']=intUtil[_0x621f('0x43')](_0x447e73['remoteUri']);_0x447e73[_0x621f('0x44')]=intUtil[_0x621f('0x43')](_0x447e73[_0x621f('0x44')]);if(_0x5ad291&&_0x5ad291[_0x621f('0x55')]&&_0x5ad291[_0x621f('0x55')]!=='none'){logger['info'](_0x621f('0x56'),_0x621f('0x47'));_0x2bacab[_0x621f('0x48')]=util[_0x621f('0xa')](_0x621f('0x49'),_0x447e73[_0x621f('0x44')],_0x2bacab[_0x621f('0x4a')],md5(_0x2bacab[_0x621f('0x4a')]));}headers[_0x621f('0x4b')]=getAuth(_0x447e73);return getUser(_0x447e73,_0x2b6cbd[_0x621f('0x22')])['then'](function(_0x23b059){_0x34d1ea=_0x23b059;logger[_0x621f('0x8')](_0x621f('0x4c'),_0x34d1ea['id']);return getEndUser(_0x447e73,_0x2bacab[_0x621f('0x57')],_0x2bacab[_0x621f('0x58')]);})[_0x621f('0x1a')](function(_0x1a3d33){_0x5485ba=_0x1a3d33;logger[_0x621f('0x8')](_0x621f('0x4d'),_0x5485ba['id']);return getTicket(_0x447e73,_0x34d1ea,_0x5485ba,_0xa9811a,_0x2bacab);})[_0x621f('0x1a')](function(_0x212168){if(_0x212168&&_0x212168['id']){logger['info'](_0x621f('0x1b'));logger[_0x621f('0x8')](_0x621f('0x4e'),_0x212168['id']);logger[_0x621f('0x8')](_0x621f('0x56'),_0x621f('0x4f'));emit(util[_0x621f('0xa')](_0x621f('0x50'),_0x2b6cbd[_0x621f('0x11')]),_0x621f('0x51'),{'uri':util[_0x621f('0xa')](_0x621f('0x52'),_0x447e73['remoteUri'],_0x212168['id'])});}})[_0x621f('0x59')](function(_0x433b8b){logger[_0x621f('0x53')](_0x621f('0x56'),JSON[_0x621f('0x2f')](_0x433b8b));});};exports['unmanaged']=function(_0x5cb201,_0x47eeea,_0xe6bd6b,_0x41beb0,_0x217cdc,_0x1ee148){var _0x293281,_0x3db3f7;_0x1ee148[_0x621f('0x18')]=intUtil[_0x621f('0x43')](_0x1ee148['remoteUri']);_0x1ee148['serverUrl']=intUtil[_0x621f('0x43')](_0x1ee148[_0x621f('0x44')]);if(_0x217cdc&&_0x217cdc[_0x621f('0x45')]){logger[_0x621f('0x8')]('['+_0x47eeea[_0x621f('0x5a')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x47eeea[_0x621f('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1ee148[_0x621f('0x44')],_0x47eeea[_0x621f('0x4a')],md5(_0x47eeea['uniqueid']));}else{_0x47eeea[_0x621f('0x48')]='';}headers['Authorization']=getAuth(_0x1ee148);return getUser(_0x1ee148,'')[_0x621f('0x1a')](function(_0x55a87d){_0x293281=_0x55a87d;logger['info'](_0x621f('0x4c'),_0x293281['id']);return getEndUser(_0x1ee148,_0x47eeea['calleridname'],_0x47eeea[_0x621f('0xc')]);})[_0x621f('0x1a')](function(_0x234896){_0x3db3f7=_0x234896;logger[_0x621f('0x8')](_0x621f('0x4d'),_0x3db3f7['id']);return getTicket(_0x1ee148,_0x293281,_0x3db3f7,_0xe6bd6b,_0x47eeea);})[_0x621f('0x1a')](function(_0x593823){if(_0x593823){logger[_0x621f('0x8')]('Ticket\x20created!');logger[_0x621f('0x8')](_0x621f('0x4e'),_0x593823['id']);}})[_0x621f('0x59')](function(_0xd52389){logger[_0x621f('0x53')]('['+_0x47eeea[_0x621f('0x5a')]['toUpperCase']()+']',JSON[_0x621f('0x2f')](_0xd52389));});}; \ 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 45f84bc..9c564f2 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 _0xa288=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','util','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','headers','then','users','length','email','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','adminEmail','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','task','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','serverUrl','stripTrailingSlash','remoteUri','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xa288,0xb1));var _0x8a28=function(_0x14ca65,_0x54a880){_0x14ca65=_0x14ca65-0x0;var _0x4c3dca=_0xa288[_0x14ca65];return _0x4c3dca;};'use strict';var _=require('lodash');var rp=require(_0x8a28('0x0'));var md5=require('md5');var util=require(_0x8a28('0x1'));var moment=require('moment');var Promise=require(_0x8a28('0x2'));var Redis=require(_0x8a28('0x3'));var intUtil=require(_0x8a28('0x4'));var config=require('../../../../config/environment');var logger=require(_0x8a28('0x5'))(_0x8a28('0x6'));config[_0x8a28('0x7')]=_['defaults'](config[_0x8a28('0x7')],{'host':_0x8a28('0x8'),'port':0x18eb});var io=require(_0x8a28('0x9'))(new Redis(config[_0x8a28('0x7')]));function getAdminId(_0x5b5a2d,_0x5be22b,_0x366389,_0x5d332f){return new Promise(function(_0x4e8514,_0xcace9d){var _0x49aecd=![];var _0x9fdc85={'method':_0x8a28('0xa'),'uri':_0x5d332f+'/api/selector/owners','json':!![]};_0x9fdc85[_0x8a28('0xb')]=_0x366389;logger['info']('Getting\x20admin\x20information');return rp(_0x9fdc85)[_0x8a28('0xc')](function(_0x1f920a){if(_0x1f920a){var _0x1d46b2=_0x1f920a[_0x8a28('0xd')];var _0x3ff3c5=null;for(_0x3ff3c5=0x0;_0x3ff3c5<_0x1d46b2[_0x8a28('0xe')];_0x3ff3c5++){if(_0x1d46b2[_0x3ff3c5][_0x8a28('0xf')]===_0x5b5a2d['adminEmail']){_0x5b5a2d['adminId']=_0x1d46b2[_0x3ff3c5]['id'];_0x49aecd=!![];}}if(_0x49aecd){logger[_0x8a28('0x10')](_0x8a28('0x11'),_0x5b5a2d[_0x8a28('0x12')]);_0x4e8514(_0x5b5a2d);}else{_0xcace9d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xcace9d({'statusCode':0x194,'message':_0x8a28('0x13')});}})[_0x8a28('0x14')](function(_0x2743cd){logger[_0x8a28('0x15')]('['+[_0x5be22b[_0x8a28('0x16')]()]+']',_0x2743cd['message']);_0xcace9d(_0x2743cd);});});}function getUser(_0x346b60,_0x2381b0,_0x55db21){return function(_0x3f28ec){return new Promise(function(_0x5bca06,_0x118c7c){var _0x48d297={'method':_0x8a28('0xa'),'uri':_0x55db21+_0x8a28('0x17'),'json':!![]};_0x48d297[_0x8a28('0xb')]=_0x2381b0;logger[_0x8a28('0x10')](_0x8a28('0x18'));return rp(_0x48d297)[_0x8a28('0xc')](function(_0x595505){if(_0x595505){var _0x21ca14=_0x595505[_0x8a28('0xd')];var _0x500c71=![];var _0x4492aa=null;if(_0x3f28ec[_0x8a28('0x19')]!==null){logger['info'](_0x8a28('0x1a'),_0x3f28ec[_0x8a28('0x19')]);_0x3f28ec[_0x8a28('0x1b')]=_0x3f28ec[_0x8a28('0x19')];for(_0x4492aa=0x0;_0x4492aa<_0x21ca14[_0x8a28('0xe')];_0x4492aa++){if(_0x21ca14[_0x4492aa][_0x8a28('0xf')]===_0x3f28ec[_0x8a28('0x19')]){_0x500c71=!![];_0x3f28ec[_0x8a28('0x1c')]=_0x21ca14[_0x4492aa]['id'];logger['info']('User\x20found:',_0x3f28ec[_0x8a28('0x1c')]);}}}if(!_0x500c71){logger[_0x8a28('0x10')](_0x8a28('0x1d'));_0x3f28ec[_0x8a28('0x1b')]=_0x3f28ec[_0x8a28('0x1e')];_0x3f28ec['userId']=_0x3f28ec['adminId'];_0x500c71=!![];}if(_0x500c71){_0x5bca06(_0x3f28ec);}else{_0x118c7c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x118c7c({'statusCode':0x194,'message':_0x8a28('0x13')});}})[_0x8a28('0x14')](function(_0x5632a7){logger[_0x8a28('0x15')]('['+[_0x346b60[_0x8a28('0x16')]()]+']',_0x5632a7[_0x8a28('0x1f')]);_0x118c7c(_0x5632a7);});});};}function searchContact(_0xd221f1,_0x5926f5,_0xfbc8f3,_0x58b275){return new Promise(function(_0xaf085b,_0x3a0b38){var _0xd1c8a1={'method':'GET','headers':_0x5926f5,'uri':_0xd221f1+_0x8a28('0x20')+_0x58b275+_0x8a28('0x21')+_0xfbc8f3+_0x8a28('0x22'),'json':!![]};rp(_0xd1c8a1)[_0x8a28('0xc')](function(_0x4bce12){var _0x40d65d=_[_0x8a28('0x23')](_0x4bce12['contacts'][_0x8a28('0x24')],[_0xfbc8f3,_0x58b275]);_0xaf085b(_0x40d65d);})[_0x8a28('0x14')](function(_0x30eb24){_0x3a0b38(_0x30eb24);});});}function getEndUser(_0x29d1be,_0x3d2711,_0x5b3d83){return function(_0x459f48){return new Promise(function(_0x5563bd,_0x19911c){logger[_0x8a28('0x10')](util[_0x8a28('0x25')](_0x8a28('0x26'),_0x459f48[_0x8a28('0x27')]));searchContact(_0x5b3d83,_0x3d2711,_0x8a28('0x28'),_0x459f48[_0x8a28('0x27')])['then'](function(_0x370d45){if(_0x370d45){_0x459f48[_0x8a28('0x29')]=_0x370d45['id'];logger['info'](_0x8a28('0x2a'),_0x459f48['endUserId']);return _0x5563bd(_0x459f48);}searchContact(_0x5b3d83,_0x3d2711,_0x8a28('0x2b'),_0x459f48['contactNumber'])[_0x8a28('0xc')](function(_0x2755c){if(_0x2755c){_0x459f48[_0x8a28('0x29')]=_0x2755c['id'];logger[_0x8a28('0x10')](_0x8a28('0x2c'),_0x459f48['endUserId']);return _0x5563bd(_0x459f48);}createEndUser(_0x459f48,_0x29d1be,_0x3d2711,_0x5b3d83)['then'](function(_0x5b3879){logger['info'](_0x8a28('0x2d'),_0x5b3879[_0x8a28('0x29')]);return _0x5563bd(_0x5b3879);});});})[_0x8a28('0x14')](function(_0x25695e){_0x19911c(_0x25695e);});});};}function createEndUser(_0x298d8b,_0x3a0e8e,_0x4298f7,_0x567465){return new Promise(function(_0x1a2d17,_0x574b7d){var _0x3976a2=moment();var _0x4bd87e={'method':_0x8a28('0x2e'),'uri':_0x567465+'/api/contacts','body':{'contact':{'last_name':_0x298d8b[_0x8a28('0x27')],'work_number':_0x298d8b['contactNumber'],'mobile_number':_0x298d8b[_0x8a28('0x27')],'owner_id':_0x298d8b['userId'],'created_at':_0x3976a2[_0x8a28('0x25')](_0x8a28('0x2f'))}},'json':!![]};_0x4bd87e['headers']=_0x4298f7;logger[_0x8a28('0x10')](_0x8a28('0x30'));return rp(_0x4bd87e)[_0x8a28('0xc')](function(_0x237add){_0x298d8b['endUserId']=_0x237add[_0x8a28('0x31')]['id'];_0x1a2d17(_0x298d8b);})[_0x8a28('0x14')](function(_0x2eb5a7){logger[_0x8a28('0x15')]('['+[_0x3a0e8e[_0x8a28('0x16')]()]+']',_0x2eb5a7[_0x8a28('0x1f')]);_0x574b7d(_0x2eb5a7['message']);});});}function getTicket(_0x56693b,_0x2c3931,_0x7d3023,_0x396cfb,_0x1378f7){return function(_0x3b3f2f){logger[_0x8a28('0x10')](_0x8a28('0x32'));return new Promise(function(_0x9b2da2,_0x27f7a6){var _0x255e70=moment();var _0x44c9cf={'method':_0x8a28('0x2e'),'uri':_0x7d3023+_0x8a28('0x33'),'body':{'title':intUtil[_0x8a28('0x34')](_0x396cfb['Subjects'],_0x1378f7,'\x20'),'description':intUtil['getString'](_0x396cfb[_0x8a28('0x35')],_0x1378f7,'\x0a'),'owner_id':_0x3b3f2f['userId'],'creater_id':_0x3b3f2f['adminId'],'targetable_id':_0x3b3f2f[_0x8a28('0x29')],'targetable_type':'Contact','created_at':_0x255e70[_0x8a28('0x25')](_0x8a28('0x2f')),'due_date':_0x255e70[_0x8a28('0x36')](0x1e,'m')[_0x8a28('0x25')](_0x8a28('0x2f'))},'json':!![]};_0x44c9cf[_0x8a28('0xb')]=_0x2c3931;return rp(_0x44c9cf)[_0x8a28('0xc')](function(_0x306a98){_0x3b3f2f[_0x8a28('0x37')]=_0x306a98[_0x8a28('0x38')]['id'];logger['info']('Task\x20created:',_0x3b3f2f['ticketId']);_0x9b2da2(_0x3b3f2f);})[_0x8a28('0x14')](function(_0x4e9346){logger[_0x8a28('0x15')]('['+[_0x56693b[_0x8a28('0x16')]()]+']',_0x4e9346[_0x8a28('0x1f')]);_0x27f7a6(_0x4e9346[_0x8a28('0x1f')]);});});};}function emit(_0x427073,_0x466aed,_0x44ef51){var _0x3b7b4d={'uri':_0x427073+_0x8a28('0x39')+_0x44ef51};io['to'](util['format']('user:%s',_0x466aed))[_0x8a28('0x3a')](_0x8a28('0x3b'),_0x3b7b4d);}exports['cs']=function(_0x66a6c3,_0x31e66a,_0x14041b,_0x450d90,_0x464374,_0x3454a9,_0x349df1,_0x42d50d){var _0x1e5c2c={};var _0x128ea6={'Authorization':_0x8a28('0x3c')+_0x3454a9[_0x8a28('0x3d')]};_0x3454a9['remoteUri']=intUtil['stripTrailingSlash'](_0x3454a9['remoteUri']);_0x3454a9[_0x8a28('0x3e')]=intUtil[_0x8a28('0x3f')](_0x3454a9['serverUrl']);var _0x278a4a=_0x3454a9[_0x8a28('0x40')];_0x1e5c2c[_0x8a28('0x1e')]=_0x3454a9['username'];_0x1e5c2c[_0x8a28('0x27')]=_0x42d50d[_0x8a28('0x41')]()===_0x8a28('0x42')?_0x31e66a[_0x8a28('0x43')]:_0x31e66a[_0x8a28('0x44')];_0x1e5c2c[_0x8a28('0x45')]=_0x42d50d===_0x8a28('0x46')||_0x42d50d===_0x8a28('0x47')?'queue':_0x8a28('0x42');if(_0x450d90){_0x1e5c2c[_0x8a28('0x19')]=_0x450d90[_0x8a28('0xf')];}var _0x32afbb=util[_0x8a28('0x25')](_0x8a28('0x48'),_0x3454a9[_0x8a28('0x3e')],_0x31e66a[_0x8a28('0x49')],md5(_0x31e66a['uniqueid']));if(_0x464374&&_0x464374['monitor_format']){logger[_0x8a28('0x10')]('[QUEUE]',_0x8a28('0x4a'));_0x31e66a['recordingURL']=_0x32afbb;}else if(_0x349df1&&_0x349df1[_0x8a28('0x4b')]&&_0x349df1[_0x8a28('0x4b')]!==_0x8a28('0x4c')){logger[_0x8a28('0x10')](_0x8a28('0x4d'),_0x8a28('0x4a'));_0x31e66a[_0x8a28('0x4e')]=_0x32afbb;}else{_0x31e66a['recordingURL']='';}return getAdminId(_0x1e5c2c,_0x42d50d,_0x128ea6,_0x278a4a)['then'](getUser(_0x42d50d,_0x128ea6,_0x278a4a))[_0x8a28('0xc')](getEndUser(_0x42d50d,_0x128ea6,_0x278a4a))[_0x8a28('0xc')](getTicket(_0x42d50d,_0x128ea6,_0x278a4a,_0x14041b,_0x31e66a))[_0x8a28('0xc')](function(_0x49d99d){logger['info'](util[_0x8a28('0x25')](_0x8a28('0x4f'),_0x49d99d['ticketId']));if(_0x42d50d!==_0x8a28('0x47')){logger[_0x8a28('0x10')]('['+[_0x42d50d[_0x8a28('0x16')]()]+']',_0x8a28('0x50'));emit(_0x278a4a,_0x450d90[_0x8a28('0x51')],_0x49d99d[_0x8a28('0x29')]);}})['catch'](function(_0x540fcd){logger[_0x8a28('0x15')]('['+[_0x42d50d[_0x8a28('0x16')]()]+_0x8a28('0x52'),util['inspect'](_0x540fcd,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x52fa=['../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','userEmail','email','userId','User\x20found:','Admin\x20selected','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','work_number','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','getString','Subjects','Descriptions','add','ticketId','task','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','destcalleridnum','calleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x52fa,0x9f));var _0xa52f=function(_0x2b2154,_0x4fe60f){_0x2b2154=_0x2b2154-0x0;var _0x860ae6=_0x52fa[_0x2b2154];return _0x860ae6;};'use strict';var _=require(_0xa52f('0x0'));var rp=require(_0xa52f('0x1'));var md5=require(_0xa52f('0x2'));var util=require(_0xa52f('0x3'));var moment=require(_0xa52f('0x4'));var Promise=require(_0xa52f('0x5'));var Redis=require(_0xa52f('0x6'));var intUtil=require(_0xa52f('0x7'));var config=require(_0xa52f('0x8'));var logger=require(_0xa52f('0x9'))(_0xa52f('0xa'));config[_0xa52f('0xb')]=_['defaults'](config[_0xa52f('0xb')],{'host':_0xa52f('0xc'),'port':0x18eb});var io=require(_0xa52f('0xd'))(new Redis(config[_0xa52f('0xb')]));function getAdminId(_0x42567f,_0x4890a2,_0x1737f9,_0x59be9d){return new Promise(function(_0x9fdf18,_0x5e0ad5){var _0x51c07a=![];var _0x15b9eb={'method':'GET','uri':_0x59be9d+_0xa52f('0xe'),'json':!![]};_0x15b9eb[_0xa52f('0xf')]=_0x1737f9;logger[_0xa52f('0x10')](_0xa52f('0x11'));return rp(_0x15b9eb)[_0xa52f('0x12')](function(_0x6a6434){if(_0x6a6434){var _0x497834=_0x6a6434[_0xa52f('0x13')];var _0x540565=null;for(_0x540565=0x0;_0x540565<_0x497834[_0xa52f('0x14')];_0x540565++){if(_0x497834[_0x540565]['email']===_0x42567f[_0xa52f('0x15')]){_0x42567f[_0xa52f('0x16')]=_0x497834[_0x540565]['id'];_0x51c07a=!![];}}if(_0x51c07a){logger[_0xa52f('0x10')]('Admin\x20found:',_0x42567f[_0xa52f('0x16')]);_0x9fdf18(_0x42567f);}else{_0x5e0ad5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5e0ad5({'statusCode':0x194,'message':_0xa52f('0x17')});}})[_0xa52f('0x18')](function(_0x190171){logger[_0xa52f('0x19')]('['+[_0x4890a2[_0xa52f('0x1a')]()]+']',_0x190171[_0xa52f('0x1b')]);_0x5e0ad5(_0x190171);});});}function getUser(_0x513fd6,_0x3d20fd,_0x2824b1){return function(_0x4ddd8e){return new Promise(function(_0x21213e,_0x53b3e4){var _0xd379e4={'method':_0xa52f('0x1c'),'uri':_0x2824b1+_0xa52f('0xe'),'json':!![]};_0xd379e4[_0xa52f('0xf')]=_0x3d20fd;logger[_0xa52f('0x10')](_0xa52f('0x1d'));return rp(_0xd379e4)['then'](function(_0x9b16f9){if(_0x9b16f9){var _0x9b8172=_0x9b16f9[_0xa52f('0x13')];var _0x4eae2b=![];var _0xeac3c4=null;if(_0x4ddd8e[_0xa52f('0x1e')]!==null){logger[_0xa52f('0x10')]('Getting\x20user\x20with\x20email',_0x4ddd8e[_0xa52f('0x1e')]);_0x4ddd8e[_0xa52f('0x1f')]=_0x4ddd8e[_0xa52f('0x1e')];for(_0xeac3c4=0x0;_0xeac3c4<_0x9b8172['length'];_0xeac3c4++){if(_0x9b8172[_0xeac3c4][_0xa52f('0x20')]===_0x4ddd8e[_0xa52f('0x1e')]){_0x4eae2b=!![];_0x4ddd8e[_0xa52f('0x21')]=_0x9b8172[_0xeac3c4]['id'];logger[_0xa52f('0x10')](_0xa52f('0x22'),_0x4ddd8e['userId']);}}}if(!_0x4eae2b){logger[_0xa52f('0x10')](_0xa52f('0x23'));_0x4ddd8e[_0xa52f('0x1f')]=_0x4ddd8e[_0xa52f('0x15')];_0x4ddd8e['userId']=_0x4ddd8e['adminId'];_0x4eae2b=!![];}if(_0x4eae2b){_0x21213e(_0x4ddd8e);}else{_0x53b3e4({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x53b3e4({'statusCode':0x194,'message':_0xa52f('0x17')});}})['catch'](function(_0x381122){logger[_0xa52f('0x19')]('['+[_0x513fd6[_0xa52f('0x1a')]()]+']',_0x381122[_0xa52f('0x1b')]);_0x53b3e4(_0x381122);});});};}function searchContact(_0x2183de,_0x1c512c,_0x56b6cf,_0x4d3efc){return new Promise(function(_0x1d5ec5,_0x31552d){var _0x35316d={'method':_0xa52f('0x1c'),'headers':_0x1c512c,'uri':_0x2183de+_0xa52f('0x24')+_0x4d3efc+_0xa52f('0x25')+_0x56b6cf+_0xa52f('0x26'),'json':!![]};rp(_0x35316d)[_0xa52f('0x12')](function(_0x3a7570){var _0x35781a=_[_0xa52f('0x27')](_0x3a7570[_0xa52f('0x28')][_0xa52f('0x28')],[_0x56b6cf,_0x4d3efc]);_0x1d5ec5(_0x35781a);})[_0xa52f('0x18')](function(_0x4736de){_0x31552d(_0x4736de);});});}function getEndUser(_0x49bb4a,_0x2b0dbd,_0x468925){return function(_0x4fb151){return new Promise(function(_0x3f7172,_0x2304c4){logger[_0xa52f('0x10')](util[_0xa52f('0x29')](_0xa52f('0x2a'),_0x4fb151[_0xa52f('0x2b')]));searchContact(_0x468925,_0x2b0dbd,_0xa52f('0x2c'),_0x4fb151[_0xa52f('0x2b')])['then'](function(_0x477566){if(_0x477566){_0x4fb151['endUserId']=_0x477566['id'];logger[_0xa52f('0x10')](_0xa52f('0x2d'),_0x4fb151['endUserId']);return _0x3f7172(_0x4fb151);}searchContact(_0x468925,_0x2b0dbd,_0xa52f('0x2e'),_0x4fb151[_0xa52f('0x2b')])[_0xa52f('0x12')](function(_0x144482){if(_0x144482){_0x4fb151[_0xa52f('0x2f')]=_0x144482['id'];logger['info'](_0xa52f('0x30'),_0x4fb151[_0xa52f('0x2f')]);return _0x3f7172(_0x4fb151);}createEndUser(_0x4fb151,_0x49bb4a,_0x2b0dbd,_0x468925)[_0xa52f('0x12')](function(_0x3e6abf){logger[_0xa52f('0x10')](_0xa52f('0x31'),_0x3e6abf[_0xa52f('0x2f')]);return _0x3f7172(_0x3e6abf);});});})[_0xa52f('0x18')](function(_0x286993){_0x2304c4(_0x286993);});});};}function createEndUser(_0x523cdf,_0x9128ab,_0x413b5a,_0x5a8102){return new Promise(function(_0x4d2267,_0x2dfea0){var _0x2db4b7=moment();var _0x2db9c7={'method':'POST','uri':_0x5a8102+_0xa52f('0x32'),'body':{'contact':{'last_name':_0x523cdf[_0xa52f('0x2b')],'work_number':_0x523cdf['contactNumber'],'mobile_number':_0x523cdf['contactNumber'],'owner_id':_0x523cdf[_0xa52f('0x21')],'created_at':_0x2db4b7[_0xa52f('0x29')](_0xa52f('0x33'))}},'json':!![]};_0x2db9c7[_0xa52f('0xf')]=_0x413b5a;logger[_0xa52f('0x10')](_0xa52f('0x34'));return rp(_0x2db9c7)[_0xa52f('0x12')](function(_0x36d14f){_0x523cdf[_0xa52f('0x2f')]=_0x36d14f['contact']['id'];_0x4d2267(_0x523cdf);})[_0xa52f('0x18')](function(_0x20f750){logger[_0xa52f('0x19')]('['+[_0x9128ab['toUpperCase']()]+']',_0x20f750[_0xa52f('0x1b')]);_0x2dfea0(_0x20f750[_0xa52f('0x1b')]);});});}function getTicket(_0x238b81,_0x688afd,_0x3c5ad6,_0x5ee383,_0x551cc8){return function(_0x12b647){logger[_0xa52f('0x10')](_0xa52f('0x35'));return new Promise(function(_0x3a8fcf,_0x15467e){var _0x388aa2=moment();var _0xc32e99={'method':'POST','uri':_0x3c5ad6+'/api/tasks','body':{'title':intUtil[_0xa52f('0x36')](_0x5ee383[_0xa52f('0x37')],_0x551cc8,'\x20'),'description':intUtil[_0xa52f('0x36')](_0x5ee383[_0xa52f('0x38')],_0x551cc8,'\x0a'),'owner_id':_0x12b647['userId'],'creater_id':_0x12b647[_0xa52f('0x16')],'targetable_id':_0x12b647[_0xa52f('0x2f')],'targetable_type':'Contact','created_at':_0x388aa2['format'](_0xa52f('0x33')),'due_date':_0x388aa2[_0xa52f('0x39')](0x1e,'m')[_0xa52f('0x29')](_0xa52f('0x33'))},'json':!![]};_0xc32e99['headers']=_0x688afd;return rp(_0xc32e99)[_0xa52f('0x12')](function(_0x186115){_0x12b647[_0xa52f('0x3a')]=_0x186115[_0xa52f('0x3b')]['id'];logger[_0xa52f('0x10')]('Task\x20created:',_0x12b647[_0xa52f('0x3a')]);_0x3a8fcf(_0x12b647);})['catch'](function(_0x58eb71){logger[_0xa52f('0x19')]('['+[_0x238b81[_0xa52f('0x1a')]()]+']',_0x58eb71[_0xa52f('0x1b')]);_0x15467e(_0x58eb71['message']);});});};}function emit(_0x34e2a8,_0x15f822,_0x3915a3){var _0x571f75={'uri':_0x34e2a8+_0xa52f('0x3c')+_0x3915a3};io['to'](util[_0xa52f('0x29')](_0xa52f('0x3d'),_0x15f822))[_0xa52f('0x3e')]('trigger:browser:url',_0x571f75);}exports['cs']=function(_0x563c73,_0xdf17b2,_0x3b6ba8,_0x13a03f,_0x4ea490,_0x30447d,_0x2f4acb,_0x52b55e){var _0x59f561={};var _0x18e296={'Authorization':_0xa52f('0x3f')+_0x30447d[_0xa52f('0x40')]};_0x30447d[_0xa52f('0x41')]=intUtil[_0xa52f('0x42')](_0x30447d['remoteUri']);_0x30447d[_0xa52f('0x43')]=intUtil[_0xa52f('0x42')](_0x30447d[_0xa52f('0x43')]);var _0x4a4be4=_0x30447d[_0xa52f('0x41')];_0x59f561[_0xa52f('0x15')]=_0x30447d[_0xa52f('0x44')];_0x59f561[_0xa52f('0x2b')]=_0x52b55e['toLowerCase']()==='outbound'?_0xdf17b2[_0xa52f('0x45')]:_0xdf17b2[_0xa52f('0x46')];_0x59f561['callDirection']=_0x52b55e===_0xa52f('0x47')||_0x52b55e===_0xa52f('0x48')?_0xa52f('0x47'):'outbound';if(_0x13a03f){_0x59f561[_0xa52f('0x1e')]=_0x13a03f[_0xa52f('0x20')];}var _0x5132e2=util[_0xa52f('0x29')](_0xa52f('0x49'),_0x30447d[_0xa52f('0x43')],_0xdf17b2['uniqueid'],md5(_0xdf17b2[_0xa52f('0x4a')]));if(_0x4ea490&&_0x4ea490[_0xa52f('0x4b')]){logger['info']('[QUEUE]',_0xa52f('0x4c'));_0xdf17b2['recordingURL']=_0x5132e2;}else if(_0x2f4acb&&_0x2f4acb[_0xa52f('0x4d')]&&_0x2f4acb[_0xa52f('0x4d')]!==_0xa52f('0x4e')){logger['info']('[OUTBOUND]',_0xa52f('0x4c'));_0xdf17b2[_0xa52f('0x4f')]=_0x5132e2;}else{_0xdf17b2[_0xa52f('0x4f')]='';}return getAdminId(_0x59f561,_0x52b55e,_0x18e296,_0x4a4be4)[_0xa52f('0x12')](getUser(_0x52b55e,_0x18e296,_0x4a4be4))['then'](getEndUser(_0x52b55e,_0x18e296,_0x4a4be4))[_0xa52f('0x12')](getTicket(_0x52b55e,_0x18e296,_0x4a4be4,_0x3b6ba8,_0xdf17b2))[_0xa52f('0x12')](function(_0x345849){logger['info'](util['format'](_0xa52f('0x50'),_0x345849[_0xa52f('0x3a')]));if(_0x52b55e!==_0xa52f('0x48')){logger[_0xa52f('0x10')]('['+[_0x52b55e[_0xa52f('0x1a')]()]+']',_0xa52f('0x51'));emit(_0x4a4be4,_0x13a03f['name'],_0x345849[_0xa52f('0x2f')]);}})[_0xa52f('0x18')](function(_0x12e173){logger[_0xa52f('0x19')]('['+[_0x52b55e[_0xa52f('0x1a')]()]+_0xa52f('0x52'),util[_0xa52f('0x53')](_0x12e173,{'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 26d4fa5..26c1e61 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 _0x0c47=['data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zoho','servicenow','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./salesforce','./sugarcrm','./freshdesk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','includes','data1','toLowerCase'];(function(_0x14cfec,_0x21f117){var _0x91ac79=function(_0x1308f2){while(--_0x1308f2){_0x14cfec['push'](_0x14cfec['shift']());}};_0x91ac79(++_0x21f117);}(_0x0c47,0xf7));var _0x70c4=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x0c47[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0x70c4('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x70c4('0x1'));var sugarcrm=require(_0x70c4('0x2'));var freshdesk=require(_0x70c4('0x3'));var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0x70c4('0x4'));var servicenow=require(_0x70c4('0x5'));var dynamics365=require(_0x70c4('0x6'));var freshsales=require(_0x70c4('0x7'));var integrations=[_0x70c4('0x8'),_0x70c4('0x9'),_0x70c4('0xa'),_0x70c4('0xb'),'zoho',_0x70c4('0xc'),_0x70c4('0xd'),_0x70c4('0xe'),_0x70c4('0xf'),'servicenow'];exports['exec']=function(_0xaded7b,_0x323d86,_0x3a9e45,_0x5696a3,_0x4ab163,_0x5d5e28){if(_0x3a9e45){if(_[_0x70c4('0x10')](integrations,_0xaded7b[_0x70c4('0x11')][_0x70c4('0x12')]())){try{var _0x391067=null;var _0x462ab5='';var _0x421884=_0x3a9e45[_0xaded7b[_0x70c4('0x11')][_0x70c4('0x12')]()];if(_0x421884){var _0x2fc6ac=_0x421884[_0xaded7b[_0x70c4('0x13')]];if(_0x2fc6ac){var _0x336924=_[_0x70c4('0x14')](_0x2fc6ac[_0x70c4('0x15')],{'id':parseInt(_0xaded7b[_0x70c4('0x16')],0xa)});if(_0x336924){if(_0x5696a3){if(_0x4ab163&&_0x323d86[_0x70c4('0x17')]){_0x462ab5='queue';}else if(_0x323d86[_0x70c4('0x18')]){_0x462ab5=_0x70c4('0x19');}else{console[_0x70c4('0x1a')](_0x70c4('0x1b'),_0x323d86);}}else{_0x462ab5=_0x70c4('0x1c');}switch(_0xaded7b[_0x70c4('0x11')][_0x70c4('0x12')]()){case _0x70c4('0x8'):zendesk[_0x462ab5](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28);break;case _0x70c4('0x9'):salesforce[_0x462ab5](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28);break;case _0x70c4('0xa'):sugarcrm[_0x462ab5](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28);break;case _0x70c4('0xb'):freshdesk[_0x462ab5](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28);break;case _0x70c4('0x1d'):zoho[_0x462ab5](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28);break;case'desk':desk[_0x462ab5](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28);break;case'vtiger':vtiger[_0x462ab5](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28);break;case _0x70c4('0xf'):freshsales['cs'](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28,_0x462ab5);break;case _0x70c4('0x1e'):servicenow['cs'](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28,_0x462ab5);break;case _0x70c4('0xe'):dynamics365['cs'](_0xaded7b,_0x323d86,_0x336924,_0x5696a3,_0x4ab163,_0x2fc6ac,_0x5d5e28,_0x462ab5);break;default:console[_0x70c4('0x1a')](_0x70c4('0x1f'));}}else{_0x391067=require(_0x70c4('0x20'))(_0xaded7b['data1'][_0x70c4('0x12')]());_0x391067[_0x70c4('0x21')](_0x70c4('0x22'),util[_0x70c4('0x23')](_0x70c4('0x24'),_0xaded7b['data1'][_0x70c4('0x12')](),_0xaded7b['data3']));}}else{_0x391067=require('../../../../config/logger')(_0xaded7b['data1'][_0x70c4('0x12')]());_0x391067[_0x70c4('0x21')](_0x70c4('0x22'),util[_0x70c4('0x23')](_0x70c4('0x25'),_0xaded7b['data1']['toLowerCase'](),_0xaded7b[_0x70c4('0x13')]));}}else{}}catch(_0x40b72f){console['error'](_0x40b72f);}}}}; \ No newline at end of file +var _0x6e37=['[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','unmanaged','unknown\x20integration','../../../../config/logger','error'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x6e37,0x16c));var _0x76e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e37[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x76e3('0x0'));var util=require(_0x76e3('0x1'));var zendesk=require(_0x76e3('0x2'));var salesforce=require(_0x76e3('0x3'));var sugarcrm=require(_0x76e3('0x4'));var freshdesk=require(_0x76e3('0x5'));var zoho=require(_0x76e3('0x6'));var desk=require(_0x76e3('0x7'));var vtiger=require(_0x76e3('0x8'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require('./freshsales');var integrations=[_0x76e3('0x9'),_0x76e3('0xa'),_0x76e3('0xb'),_0x76e3('0xc'),_0x76e3('0xd'),_0x76e3('0xe'),_0x76e3('0xf'),_0x76e3('0x10'),_0x76e3('0x11'),_0x76e3('0x12')];exports['exec']=function(_0x3cc726,_0x113574,_0x355f65,_0x412d0a,_0x4f6399,_0x2c2dd6){if(_0x355f65){if(_['includes'](integrations,_0x3cc726[_0x76e3('0x13')][_0x76e3('0x14')]())){try{var _0x4dc686=null;var _0x29627e='';var _0x4e7742=_0x355f65[_0x3cc726[_0x76e3('0x13')][_0x76e3('0x14')]()];if(_0x4e7742){var _0x5a6a96=_0x4e7742[_0x3cc726['data2']];if(_0x5a6a96){var _0x531b80=_[_0x76e3('0x15')](_0x5a6a96[_0x76e3('0x16')],{'id':parseInt(_0x3cc726[_0x76e3('0x17')],0xa)});if(_0x531b80){if(_0x412d0a){if(_0x4f6399&&_0x113574[_0x76e3('0x18')]){_0x29627e=_0x76e3('0x18');}else if(_0x113574[_0x76e3('0x19')]){_0x29627e=_0x76e3('0x1a');}else{console[_0x76e3('0x1b')]('EVENT\x20UNKNOWN',_0x113574);}}else{_0x29627e=_0x76e3('0x1c');}switch(_0x3cc726[_0x76e3('0x13')][_0x76e3('0x14')]()){case _0x76e3('0x9'):zendesk[_0x29627e](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6);break;case _0x76e3('0xa'):salesforce[_0x29627e](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6);break;case'sugarcrm':sugarcrm[_0x29627e](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6);break;case _0x76e3('0xc'):freshdesk[_0x29627e](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6);break;case _0x76e3('0xd'):zoho[_0x29627e](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6);break;case'desk':desk[_0x29627e](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6);break;case'vtiger':vtiger[_0x29627e](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6);break;case _0x76e3('0x11'):freshsales['cs'](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6,_0x29627e);break;case _0x76e3('0x12'):servicenow['cs'](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6,_0x29627e);break;case _0x76e3('0x10'):dynamics365['cs'](_0x3cc726,_0x113574,_0x531b80,_0x412d0a,_0x4f6399,_0x5a6a96,_0x2c2dd6,_0x29627e);break;default:console[_0x76e3('0x1b')](_0x76e3('0x1d'));}}else{_0x4dc686=require(_0x76e3('0x1e'))(_0x3cc726[_0x76e3('0x13')][_0x76e3('0x14')]());_0x4dc686[_0x76e3('0x1f')](_0x76e3('0x20'),util[_0x76e3('0x21')](_0x76e3('0x22'),_0x3cc726['data1'][_0x76e3('0x14')](),_0x3cc726[_0x76e3('0x17')]));}}else{_0x4dc686=require('../../../../config/logger')(_0x3cc726['data1']['toLowerCase']());_0x4dc686[_0x76e3('0x1f')]('[EXEC]',util[_0x76e3('0x21')](_0x76e3('0x23'),_0x3cc726[_0x76e3('0x13')][_0x76e3('0x14')](),_0x3cc726['data2']));}}else{}}catch(_0x21aac9){console['error'](_0x21aac9);}}}}; \ 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 10e7c73..f18973c 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 _0xc180=['Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','execute','additionalSearchLead','Lead','additionalSearchAccount','Account','first','Phone','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','upperFirst','create','forEach','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','login','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','recordingFormat','none','[OUTBOUND]','[OUTBOUND]\x20Ticket\x20%s\x20created.','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','md5','ioredis','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','contact','WhoId','endUserType','account','ContactId','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','sobject','User','find','then','length','Email','Agent\x20%s\x20found.','resolve'];(function(_0x361480,_0x24e60e){var _0x26e902=function(_0x45f084){while(--_0x45f084){_0x361480['push'](_0x361480['shift']());}};_0x26e902(++_0x24e60e);}(_0xc180,0x145));var _0x0c18=function(_0x1045be,_0x3b1f7f){_0x1045be=_0x1045be-0x0;var _0x3cdcce=_0xc180[_0x1045be];return _0x3cdcce;};'use strict';var _=require(_0x0c18('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x0c18('0x1'));var jsforce=require('jsforce');var util=require('util');var Redis=require(_0x0c18('0x2'));var intUtil=require('./util');var config=require(_0x0c18('0x3'));var logger=require('../../../../config/logger')(_0x0c18('0x4'));config[_0x0c18('0x5')]=_[_0x0c18('0x6')](config['redis'],{'host':_0x0c18('0x7'),'port':0x18eb});var io=require(_0x0c18('0x8'))(new Redis(config['redis']));function emit(_0x430333,_0x5df6b0,_0x11e888){io['to'](_0x430333)['emit'](_0x5df6b0,_0x11e888);}function getTicket(_0x3e7a2e,_0x51267,_0x2501bf,_0x400b3a,_0x5c11d1,_0x27ed6,_0x1aa6b2,_0x6c6536){var _0x53ad20=Object['assign']({},{'OwnerId':_0x51267['id'],'Subject':intUtil[_0x0c18('0x9')](_0x400b3a[_0x0c18('0xa')],_0x5c11d1,'\x20'),'Description':intUtil[_0x0c18('0x9')](_0x400b3a[_0x0c18('0xb')],_0x5c11d1,'\x0a')},getCustomFields(_0x27ed6,_0x5c11d1));if(_0x2501bf){if(_0x400b3a[_0x0c18('0xc')]===_0x0c18('0xd')){_0x53ad20[_0x0c18('0xe')]=moment[_0x0c18('0xf')]();_0x53ad20[_0x0c18('0x10')]=![];_0x53ad20[_0x0c18('0x11')]=![];if(_0x2501bf['endUserType']===_0x0c18('0x12')||_0x2501bf['endUserType']==='lead'){_0x53ad20[_0x0c18('0x13')]=_0x2501bf['id'];}else if(_0x2501bf[_0x0c18('0x14')]===_0x0c18('0x15')){_0x53ad20['WhatId']=_0x2501bf['id'];}}else if(_0x400b3a['ticketType']==='Case'){if(_0x2501bf[_0x0c18('0x14')]===_0x0c18('0x12')){_0x53ad20[_0x0c18('0x16')]=_0x2501bf['id'];}else if(_0x2501bf[_0x0c18('0x14')]===_0x0c18('0x15')){_0x53ad20[_0x0c18('0x17')]=_0x2501bf['id'];}else if(_0x2501bf[_0x0c18('0x14')]===_0x0c18('0x18')&&_0x400b3a['leadId']){_0x53ad20[_0x400b3a[_0x0c18('0x19')]]=_0x2501bf['id'];}else{logger[_0x0c18('0x1a')](_0x0c18('0x1b'));}}}return _0x1aa6b2['sobject'](_0x400b3a[_0x0c18('0xc')])['create'](_0x53ad20);}function getUser(_0x329575,_0x226f9b,_0x50844d){if(!_[_0x0c18('0x1c')](_0x226f9b)&&intUtil[_0x0c18('0x1d')](_0x226f9b)){var _0x405284={'Email':_0x226f9b};var _0x11aa77={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x50844d[_0x0c18('0x1e')](_0x0c18('0x1f'))[_0x0c18('0x20')](_0x405284,_0x11aa77)['execute']()[_0x0c18('0x21')](function(_0x5e0153){if(_0x5e0153[_0x0c18('0x22')]){var _0x3c9589=_['find'](_0x5e0153,function(_0x52cd0d){return _0x52cd0d[_0x0c18('0x23')]===_0x226f9b;});if(_0x3c9589){logger[_0x0c18('0x1a')](_0x0c18('0x24'),_0x226f9b);return BPromise[_0x0c18('0x25')]({'id':_0x3c9589['Id'],'name':_0x3c9589[_0x0c18('0x26')]});}}else{logger[_0x0c18('0x1a')](_0x0c18('0x27'),_0x226f9b);return _0x50844d[_0x0c18('0x28')]()[_0x0c18('0x21')](function(_0x52535b){return BPromise[_0x0c18('0x25')]({'id':_0x52535b[_0x0c18('0x29')],'name':_0x52535b[_0x0c18('0x2a')]});});}});}else{logger[_0x0c18('0x1a')](_0x0c18('0x27'),_0x226f9b);return _0x50844d['identity']()[_0x0c18('0x21')](function(_0x2a2d0d){return BPromise[_0x0c18('0x25')]({'id':_0x2a2d0d[_0x0c18('0x29')],'name':_0x2a2d0d['display_name']});});}}function getEndUser(_0x59cbf7,_0x5c68ed,_0x509c54,_0x4d2701,_0x167a5b){var _0x28ec45={'$or':{'Phone':_0x4d2701}};var _0x2324b7={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x0c18('0x21')](function(){logger[_0x0c18('0x1a')](_0x0c18('0x2b'),_0x4d2701,_0x5c68ed[_0x0c18('0x2c')]);switch(_0x5c68ed[_0x0c18('0x2c')]){case _0x0c18('0x2d'):var _0x2ac2cd=_[_0x0c18('0x2e')](_0x28ec45);if(_0x5c68ed[_0x0c18('0x2f')]){var _0x287d0e={};_0x287d0e[_0x5c68ed['additionalSearchContact']]=_0x4d2701;_[_0x0c18('0x30')](_0x2ac2cd[_0x0c18('0x31')],_0x287d0e);}return _0x167a5b[_0x0c18('0x1e')](_0x0c18('0x32'))[_0x0c18('0x20')](_0x2ac2cd,_0x2324b7)[_0x0c18('0x33')]()[_0x0c18('0x21')](function(_0x5db8c7){if(_0x5db8c7&&_0x5db8c7[_0x0c18('0x22')]){return _0x5db8c7;}else{var _0x5b5e4d=_[_0x0c18('0x2e')](_0x28ec45);if(_0x5c68ed['additionalSearchLead']){var _0x5d127f={};_0x5d127f[_0x5c68ed[_0x0c18('0x34')]]=_0x4d2701;_[_0x0c18('0x30')](_0x5b5e4d[_0x0c18('0x31')],_0x5d127f);}return _0x167a5b[_0x0c18('0x1e')](_0x0c18('0x35'))[_0x0c18('0x20')](_0x5b5e4d,_0x2324b7);}});case'account_contact_lead':var _0x433ec3=_[_0x0c18('0x2e')](_0x28ec45);if(_0x5c68ed[_0x0c18('0x36')]){var _0x287d0e={};_0x287d0e[_0x5c68ed['additionalSearchAccount']]=_0x4d2701;_[_0x0c18('0x30')](_0x433ec3[_0x0c18('0x31')],_0x287d0e);}return _0x167a5b['sobject']('Account')['find'](_0x433ec3,_0x2324b7)[_0x0c18('0x33')]()[_0x0c18('0x21')](function(_0x217ab3){if(_0x217ab3&&_0x217ab3['length']){return _0x217ab3;}else{var _0x41d82e=_['cloneDeep'](_0x28ec45);if(_0x5c68ed[_0x0c18('0x2f')]){var _0x5f2ae2={};_0x5f2ae2[_0x5c68ed[_0x0c18('0x2f')]]=_0x4d2701;_[_0x0c18('0x30')](_0x41d82e[_0x0c18('0x31')],_0x5f2ae2);}return _0x167a5b['sobject'](_0x0c18('0x32'))[_0x0c18('0x20')](_0x41d82e,_0x2324b7)[_0x0c18('0x21')](function(_0x1ef187){if(_0x1ef187&&_0x1ef187['length']){return _0x1ef187;}else{var _0x1f9900=_['cloneDeep'](_0x28ec45);if(_0x5c68ed[_0x0c18('0x34')]){var _0xd43b3c={};_0xd43b3c[_0x5c68ed[_0x0c18('0x34')]]=_0x4d2701;_[_0x0c18('0x30')](_0x1f9900[_0x0c18('0x31')],_0xd43b3c);}return _0x167a5b[_0x0c18('0x1e')](_0x0c18('0x35'))[_0x0c18('0x20')](_0x1f9900,_0x2324b7);}});}});case'contact':var _0x2ac2cd=_['cloneDeep'](_0x28ec45);if(_0x5c68ed[_0x0c18('0x2f')]){var _0x287d0e={};_0x287d0e[_0x5c68ed[_0x0c18('0x2f')]]=_0x4d2701;_[_0x0c18('0x30')](_0x2ac2cd['$or'],_0x287d0e);}return _0x167a5b[_0x0c18('0x1e')](_0x0c18('0x32'))[_0x0c18('0x20')](_0x2ac2cd,_0x2324b7)['execute']();case _0x0c18('0x18'):var _0x257f9d=_[_0x0c18('0x2e')](_0x28ec45);if(_0x5c68ed[_0x0c18('0x34')]){var _0x287d0e={};_0x287d0e[_0x5c68ed[_0x0c18('0x34')]]=_0x4d2701;_['merge'](_0x257f9d[_0x0c18('0x31')],_0x287d0e);}return _0x167a5b[_0x0c18('0x1e')](_0x0c18('0x35'))['find'](_0x257f9d,_0x2324b7);case'account':var _0x433ec3=_['cloneDeep'](_0x28ec45);if(_0x5c68ed[_0x0c18('0x36')]){var _0x287d0e={};_0x287d0e[_0x5c68ed[_0x0c18('0x36')]]=_0x4d2701;_['merge'](_0x433ec3[_0x0c18('0x31')],_0x287d0e);}return _0x167a5b[_0x0c18('0x1e')](_0x0c18('0x37'))[_0x0c18('0x20')](_0x433ec3,_0x2324b7);default:return null;}})['then'](function(_0x5f18a0){if(_0x5f18a0&&_0x5f18a0['length']){var _0x519f9d=_[_0x0c18('0x38')](_0x5f18a0);if(_0x519f9d){return BPromise['resolve']({'id':_0x519f9d['Id'],'name':_0x519f9d['Name'],'phone':_0x519f9d[_0x0c18('0x39')],'endUserType':_0x519f9d['attributes']['type'][_0x0c18('0x3a')]()});}}})['then'](function(_0x130470){if(_0x130470){logger[_0x0c18('0x1a')](_0x0c18('0x3b'),_0x130470[_0x0c18('0x14')],_0x4d2701);return BPromise[_0x0c18('0x25')](_0x130470);}else{logger['info'](_0x0c18('0x3c'),_0x4d2701);var _0x37f355={'Phone':_0x4d2701};if(_0x5c68ed[_0x0c18('0x3d')]){if(_0x5c68ed[_0x0c18('0x3d')]===_0x0c18('0x12')){logger['info'](_0x0c18('0x3e'),_0x4d2701,_0x5c68ed['moduleCreate']);_0x37f355[_0x0c18('0x3f')]=_0x509c54!==_0x0c18('0x40')?_0x509c54:util[_0x0c18('0x41')](_0x0c18('0x42'),_0x4d2701);}else if(_0x5c68ed[_0x0c18('0x3d')]===_0x0c18('0x18')){logger[_0x0c18('0x1a')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4d2701,_0x5c68ed[_0x0c18('0x3d')]);_0x37f355[_0x0c18('0x3f')]=_0x509c54!==_0x0c18('0x40')?_0x509c54:util[_0x0c18('0x41')](_0x0c18('0x42'),_0x4d2701);_0x37f355[_0x0c18('0x43')]='No\x20Company';}else if(_0x5c68ed[_0x0c18('0x3d')]===_0x0c18('0x15')){logger[_0x0c18('0x1a')](_0x0c18('0x3e'),_0x4d2701,_0x5c68ed[_0x0c18('0x3d')]);_0x37f355['Name']=_0x509c54!==''?_0x509c54:util[_0x0c18('0x41')](_0x0c18('0x42'),_0x4d2701);}else{return null;}}return _0x167a5b[_0x0c18('0x1e')](_[_0x0c18('0x44')](_0x5c68ed[_0x0c18('0x3d')]))[_0x0c18('0x45')](_0x37f355)[_0x0c18('0x21')](function(_0x244397){return BPromise[_0x0c18('0x25')]({'id':_0x244397['id'],'endUserType':_0x5c68ed[_0x0c18('0x3d')]});});}});}function getCustomFields(_0x4cdfa5,_0x4e5044){var _0x49dc35={};if(_0x4cdfa5[_0x0c18('0x22')]>0x0){_[_0x0c18('0x46')](_0x4cdfa5,function(_0x18c86e){if(_['includes'](['string',_0x0c18('0x47')],_0x18c86e[_0x0c18('0x48')])&&_0x18c86e['idField']){_0x49dc35[_0x18c86e[_0x0c18('0x49')]]=_0x18c86e[_0x0c18('0x4a')][_0x0c18('0x4b')]();}else if(_0x18c86e[_0x0c18('0x48')]===_0x0c18('0x4c')&&_0x18c86e['variableName']&&_0x18c86e['idField']){_0x4e5044[_0x18c86e[_0x0c18('0x4d')]]&&(_0x49dc35[_0x18c86e[_0x0c18('0x49')]]=_0x4e5044[_0x18c86e[_0x0c18('0x4d')]][_0x0c18('0x4b')]());}else if(_0x18c86e['type']===_0x0c18('0x4e')&&_0x18c86e[_0x0c18('0x4f')]&&_0x18c86e[_0x0c18('0x4f')][_0x0c18('0x50')]&&_0x18c86e[_0x0c18('0x49')]){_0x4e5044[_0x18c86e[_0x0c18('0x4f')][_0x0c18('0x50')]['toLowerCase']()]&&(_0x49dc35[_0x18c86e[_0x0c18('0x49')]]=_0x4e5044[_0x18c86e[_0x0c18('0x4f')][_0x0c18('0x50')][_0x0c18('0x3a')]()][_0x0c18('0x4b')]());}});}return _0x49dc35;}function getConnection(_0x4a818c){var _0xbbe01e=_0x4a818c['password'][_0x0c18('0x51')](_0x4a818c[_0x0c18('0x52')]);var _0x2b6bf5=new jsforce[(_0x0c18('0x53'))]({'oauth2':{'loginUrl':_0x4a818c[_0x0c18('0x54')]||_0x0c18('0x55'),'clientId':_0x4a818c[_0x0c18('0x56')],'clientSecret':_0x4a818c['clientSecret']}});return _0x2b6bf5[_0x0c18('0x57')](_0x4a818c['username'],_0xbbe01e)['then'](function(){logger[_0x0c18('0x1a')]('Connection\x20established.');return _0x2b6bf5;});}exports[_0x0c18('0x58')]=function(_0x3a3ac7,_0x2e5ed5,_0x3eb74a,_0x2a5073,_0x4684ad,_0x1a4774){var _0x664344,_0x1ee302,_0x140767,_0x4f489b;_0x1a4774[_0x0c18('0x59')]=intUtil[_0x0c18('0x5a')](_0x1a4774[_0x0c18('0x59')]);_0x1a4774[_0x0c18('0x54')]=intUtil['stripTrailingSlash'](_0x1a4774['remoteUri']);if(_0x4684ad&&_0x4684ad[_0x0c18('0x5b')]){logger[_0x0c18('0x1a')](_0x0c18('0x5c'),_0x0c18('0x5d'));_0x2e5ed5[_0x0c18('0x5e')]=util[_0x0c18('0x41')](_0x0c18('0x5f'),_0x1a4774[_0x0c18('0x59')],_0x2e5ed5[_0x0c18('0x60')],md5(_0x2e5ed5[_0x0c18('0x60')]));}else{_0x2e5ed5[_0x0c18('0x5e')]='';}return getConnection(_0x1a4774)[_0x0c18('0x21')](function(_0x5e43e0){_0x4f489b=_0x5e43e0;return getUser(_0x1a4774,_0x2a5073[_0x0c18('0x61')],_0x4f489b);})[_0x0c18('0x21')](function(_0x135b28){_0x664344=_0x135b28;return getEndUser(_0x1a4774,_0x3eb74a,_0x2e5ed5[_0x0c18('0x62')],_0x2e5ed5[_0x0c18('0x63')],_0x4f489b);})[_0x0c18('0x21')](function(_0x59a966){_0x1ee302=_0x59a966;return getTicket(_0x1a4774,_0x664344,_0x1ee302,_0x3eb74a,_0x2e5ed5,_0x3eb74a[_0x0c18('0x64')],_0x4f489b,_0x0c18('0x58'));})[_0x0c18('0x21')](function(_0x348d1a){_0x140767=_0x348d1a;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x140767['id']);logger[_0x0c18('0x1a')](_0x0c18('0x65'),_0x140767['id'],_0x2a5073[_0x0c18('0x50')],_0x1a4774[_0x0c18('0x48')]);switch(_0x1a4774[_0x0c18('0x48')]){case _0x0c18('0x66'):emit(util['format'](_0x0c18('0x67'),_0x2a5073['name']),_0x0c18('0x68'),{'recordId':_0x140767['id']});break;case _0x0c18('0x69'):emit(util[_0x0c18('0x41')](_0x0c18('0x67'),_0x2a5073[_0x0c18('0x50')]),_0x0c18('0x6a'),{'uri':util[_0x0c18('0x41')](_0x0c18('0x6b'),_0x4f489b[_0x0c18('0x6c')],_0x140767['id'])});break;default:logger[_0x0c18('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x0c18('0x6e')](function(_0x1478b5){logger[_0x0c18('0x6d')](_0x0c18('0x5c'),_0x1478b5);});};exports[_0x0c18('0x6f')]=function(_0x13ddcc,_0x5d57ca,_0xf7774c,_0x5c263e,_0x21daa8,_0x3baff0,_0x2c81a0){var _0x975d66,_0x4186d2,_0x4a28c6,_0x128bd;_0x3baff0[_0x0c18('0x59')]=intUtil['stripTrailingSlash'](_0x3baff0[_0x0c18('0x59')]);_0x3baff0['remoteUri']=intUtil[_0x0c18('0x5a')](_0x3baff0[_0x0c18('0x54')]);if(_0x2c81a0&&_0x2c81a0[_0x0c18('0x70')]&&_0x2c81a0['recordingFormat']!==_0x0c18('0x71')){logger[_0x0c18('0x1a')](_0x0c18('0x72'),_0x0c18('0x5d'));_0x5d57ca[_0x0c18('0x5e')]=util[_0x0c18('0x41')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3baff0[_0x0c18('0x59')],_0x5d57ca['uniqueid'],md5(_0x5d57ca['uniqueid']));}return getConnection(_0x3baff0)[_0x0c18('0x21')](function(_0x3325b9){_0x128bd=_0x3325b9;return getUser(_0x3baff0,_0x5c263e[_0x0c18('0x61')],_0x128bd);})['then'](function(_0x4fce34){_0x975d66=_0x4fce34;return getEndUser(_0x3baff0,_0xf7774c,_0x5d57ca['destcalleridname'],_0x5d57ca['destcalleridnum'],_0x128bd);})[_0x0c18('0x21')](function(_0x497499){_0x4186d2=_0x497499;return getTicket(_0x3baff0,_0x975d66,_0x4186d2,_0xf7774c,_0x5d57ca,_0xf7774c[_0x0c18('0x64')],_0x128bd,'outbound');})[_0x0c18('0x21')](function(_0x561384){_0x4a28c6=_0x561384;logger[_0x0c18('0x1a')](_0x0c18('0x73'),_0x4a28c6['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x4a28c6['id'],_0x5c263e[_0x0c18('0x50')],_0x3baff0[_0x0c18('0x48')]);switch(_0x3baff0['type']){case _0x0c18('0x66'):emit(util[_0x0c18('0x41')](_0x0c18('0x67'),_0x5c263e['name']),_0x0c18('0x68'),{'recordId':_0x4a28c6['id']});break;case _0x0c18('0x69'):emit(util[_0x0c18('0x41')](_0x0c18('0x67'),_0x5c263e[_0x0c18('0x50')]),_0x0c18('0x6a'),{'uri':util['format'](_0x0c18('0x6b'),_0x128bd[_0x0c18('0x6c')],_0x4a28c6['id'])});break;default:logger[_0x0c18('0x6d')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x0c18('0x6e')](function(_0x5a4d57){logger[_0x0c18('0x6d')]('[OUTBOUND]',_0x5a4d57);});};exports[_0x0c18('0x74')]=function(_0x54a279,_0x3af0f7,_0x4aecd3,_0x3a31fb,_0x4fa7eb,_0x87d4c1){var _0x42163e,_0x5bf09b,_0x33b3a1,_0x526cfc;_0x87d4c1['serverUrl']=intUtil['stripTrailingSlash'](_0x87d4c1[_0x0c18('0x59')]);_0x87d4c1[_0x0c18('0x54')]=intUtil['stripTrailingSlash'](_0x87d4c1['remoteUri']);if(_0x4fa7eb&&_0x4fa7eb[_0x0c18('0x5b')]){logger[_0x0c18('0x1a')]('['+_0x3af0f7[_0x0c18('0x75')][_0x0c18('0x76')]()+']',_0x0c18('0x5d'));_0x3af0f7[_0x0c18('0x5e')]=util[_0x0c18('0x41')](_0x0c18('0x5f'),_0x87d4c1['serverUrl'],_0x3af0f7[_0x0c18('0x60')],md5(_0x3af0f7[_0x0c18('0x60')]));}else{_0x3af0f7[_0x0c18('0x5e')]='';}return getConnection(_0x87d4c1)[_0x0c18('0x21')](function(_0x1a72be){_0x526cfc=_0x1a72be;if(!_[_0x0c18('0x1c')](_0x3a31fb)){return getUser(_0x87d4c1,_0x3a31fb[_0x0c18('0x50')],_0x526cfc);}else{return getUser(_0x87d4c1,null,_0x526cfc);}})[_0x0c18('0x21')](function(_0x4f2dd){_0x42163e=_0x4f2dd;return getEndUser(_0x87d4c1,_0x4aecd3,_0x3af0f7[_0x0c18('0x62')],_0x3af0f7[_0x0c18('0x63')],_0x526cfc);})[_0x0c18('0x21')](function(_0x528999){_0x5bf09b=_0x528999;return getTicket(_0x87d4c1,_0x42163e,_0x5bf09b,_0x4aecd3,_0x3af0f7,_0x4aecd3[_0x0c18('0x64')],_0x526cfc);})['then'](function(_0x16650a){_0x33b3a1=_0x16650a;logger['info']('['+_0x3af0f7[_0x0c18('0x75')][_0x0c18('0x76')]()+_0x0c18('0x77'),_0x33b3a1['id']);logger[_0x0c18('0x1a')]('['+_0x3af0f7[_0x0c18('0x75')][_0x0c18('0x76')]()+_0x0c18('0x78'),_0x87d4c1['type']);})[_0x0c18('0x6e')](function(_0x1272c8){logger[_0x0c18('0x6d')]('['+_0x3af0f7[_0x0c18('0x75')]['toUpperCase']()+']',_0x1272c8);});}; \ No newline at end of file +var _0x5e3a=['Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','$or','Account','additionalSearchContact','Lead','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','password','concat','remoteUri','clientId','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','newTab','user:%s','trigger:browser:url','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','%s/%s/e','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','toUpperCase','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/environment','salesforce','defaults','localhost','socket.io-emitter','redis','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity'];(function(_0x130157,_0xb8009b){var _0x4cac06=function(_0x437f86){while(--_0x437f86){_0x130157['push'](_0x130157['shift']());}};_0x4cac06(++_0xb8009b);}(_0x5e3a,0x154));var _0xa5e3=function(_0x2bdfe1,_0x31249a){_0x2bdfe1=_0x2bdfe1-0x0;var _0x322f55=_0x5e3a[_0x2bdfe1];return _0x322f55;};'use strict';var _=require(_0xa5e3('0x0'));var rp=require('request-promise');var moment=require(_0xa5e3('0x1'));var BPromise=require(_0xa5e3('0x2'));var md5=require(_0xa5e3('0x3'));var jsforce=require(_0xa5e3('0x4'));var util=require(_0xa5e3('0x5'));var Redis=require(_0xa5e3('0x6'));var intUtil=require('./util');var config=require(_0xa5e3('0x7'));var logger=require('../../../../config/logger')(_0xa5e3('0x8'));config['redis']=_[_0xa5e3('0x9')](config['redis'],{'host':_0xa5e3('0xa'),'port':0x18eb});var io=require(_0xa5e3('0xb'))(new Redis(config[_0xa5e3('0xc')]));function emit(_0x4d1b6a,_0x1b6f7c,_0x29bd08){io['to'](_0x4d1b6a)['emit'](_0x1b6f7c,_0x29bd08);}function getTicket(_0x736735,_0x1863d8,_0x232016,_0x382908,_0x568ebf,_0x1e6e14,_0x251df1,_0xc7826f){var _0x5e2a41=Object[_0xa5e3('0xd')]({},{'OwnerId':_0x1863d8['id'],'Subject':intUtil[_0xa5e3('0xe')](_0x382908[_0xa5e3('0xf')],_0x568ebf,'\x20'),'Description':intUtil[_0xa5e3('0xe')](_0x382908[_0xa5e3('0x10')],_0x568ebf,'\x0a')},getCustomFields(_0x1e6e14,_0x568ebf));if(_0x232016){if(_0x382908[_0xa5e3('0x11')]===_0xa5e3('0x12')){_0x5e2a41[_0xa5e3('0x13')]=moment[_0xa5e3('0x14')]();_0x5e2a41['IsReminderSet']=![];_0x5e2a41[_0xa5e3('0x15')]=![];if(_0x232016[_0xa5e3('0x16')]===_0xa5e3('0x17')||_0x232016['endUserType']===_0xa5e3('0x18')){_0x5e2a41[_0xa5e3('0x19')]=_0x232016['id'];}else if(_0x232016[_0xa5e3('0x16')]===_0xa5e3('0x1a')){_0x5e2a41[_0xa5e3('0x1b')]=_0x232016['id'];}}else if(_0x382908['ticketType']===_0xa5e3('0x1c')){if(_0x232016[_0xa5e3('0x16')]===_0xa5e3('0x17')){_0x5e2a41['ContactId']=_0x232016['id'];}else if(_0x232016[_0xa5e3('0x16')]===_0xa5e3('0x1a')){_0x5e2a41[_0xa5e3('0x1d')]=_0x232016['id'];}else if(_0x232016[_0xa5e3('0x16')]===_0xa5e3('0x18')&&_0x382908[_0xa5e3('0x1e')]){_0x5e2a41[_0x382908[_0xa5e3('0x1e')]]=_0x232016['id'];}else{logger[_0xa5e3('0x1f')](_0xa5e3('0x20'));}}}return _0x251df1[_0xa5e3('0x21')](_0x382908[_0xa5e3('0x11')])[_0xa5e3('0x22')](_0x5e2a41);}function getUser(_0x397210,_0x876b7,_0x18898e){if(!_[_0xa5e3('0x23')](_0x876b7)&&intUtil[_0xa5e3('0x24')](_0x876b7)){var _0x4fe8f2={'Email':_0x876b7};var _0xc45e68={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x18898e[_0xa5e3('0x21')](_0xa5e3('0x25'))[_0xa5e3('0x26')](_0x4fe8f2,_0xc45e68)[_0xa5e3('0x27')]()[_0xa5e3('0x28')](function(_0x13e4db){if(_0x13e4db[_0xa5e3('0x29')]){var _0x539f7e=_['find'](_0x13e4db,function(_0x25a1cd){return _0x25a1cd[_0xa5e3('0x2a')]===_0x876b7;});if(_0x539f7e){logger[_0xa5e3('0x1f')](_0xa5e3('0x2b'),_0x876b7);return BPromise[_0xa5e3('0x2c')]({'id':_0x539f7e['Id'],'name':_0x539f7e[_0xa5e3('0x2d')]});}}else{logger[_0xa5e3('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x876b7);return _0x18898e[_0xa5e3('0x2e')]()[_0xa5e3('0x28')](function(_0x17ece0){return BPromise['resolve']({'id':_0x17ece0['user_id'],'name':_0x17ece0['display_name']});});}});}else{logger['info'](_0xa5e3('0x2f'),_0x876b7);return _0x18898e[_0xa5e3('0x2e')]()['then'](function(_0x2f750f){return BPromise[_0xa5e3('0x2c')]({'id':_0x2f750f[_0xa5e3('0x30')],'name':_0x2f750f[_0xa5e3('0x31')]});});}}function getEndUser(_0x216011,_0x257e2b,_0x580856,_0x12fda4,_0x4d4067){var _0x464a67={'$or':{'Phone':_0x12fda4}};var _0x3dd548={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa5e3('0x2c')]()[_0xa5e3('0x28')](function(){logger[_0xa5e3('0x1f')](_0xa5e3('0x32'),_0x12fda4,_0x257e2b['moduleSearch']);switch(_0x257e2b[_0xa5e3('0x33')]){case _0xa5e3('0x34'):var _0x2516da=_[_0xa5e3('0x35')](_0x464a67);if(_0x257e2b['additionalSearchContact']){var _0x5968db={};_0x5968db[_0x257e2b['additionalSearchContact']]=_0x12fda4;_[_0xa5e3('0x36')](_0x2516da['$or'],_0x5968db);}return _0x4d4067[_0xa5e3('0x21')](_0xa5e3('0x37'))[_0xa5e3('0x26')](_0x2516da,_0x3dd548)[_0xa5e3('0x27')]()['then'](function(_0x42ca74){if(_0x42ca74&&_0x42ca74[_0xa5e3('0x29')]){return _0x42ca74;}else{var _0x19eccd=_[_0xa5e3('0x35')](_0x464a67);if(_0x257e2b[_0xa5e3('0x38')]){var _0x2ede7e={};_0x2ede7e[_0x257e2b[_0xa5e3('0x38')]]=_0x12fda4;_[_0xa5e3('0x36')](_0x19eccd['$or'],_0x2ede7e);}return _0x4d4067[_0xa5e3('0x21')]('Lead')[_0xa5e3('0x26')](_0x19eccd,_0x3dd548);}});case _0xa5e3('0x39'):var _0x3edc8e=_['cloneDeep'](_0x464a67);if(_0x257e2b[_0xa5e3('0x3a')]){var _0x5968db={};_0x5968db[_0x257e2b['additionalSearchAccount']]=_0x12fda4;_[_0xa5e3('0x36')](_0x3edc8e[_0xa5e3('0x3b')],_0x5968db);}return _0x4d4067['sobject'](_0xa5e3('0x3c'))[_0xa5e3('0x26')](_0x3edc8e,_0x3dd548)['execute']()['then'](function(_0x1fa84e){if(_0x1fa84e&&_0x1fa84e[_0xa5e3('0x29')]){return _0x1fa84e;}else{var _0x5b3b25=_['cloneDeep'](_0x464a67);if(_0x257e2b[_0xa5e3('0x3d')]){var _0x3aaff3={};_0x3aaff3[_0x257e2b['additionalSearchContact']]=_0x12fda4;_['merge'](_0x5b3b25[_0xa5e3('0x3b')],_0x3aaff3);}return _0x4d4067[_0xa5e3('0x21')](_0xa5e3('0x37'))['find'](_0x5b3b25,_0x3dd548)[_0xa5e3('0x28')](function(_0x1a523f){if(_0x1a523f&&_0x1a523f[_0xa5e3('0x29')]){return _0x1a523f;}else{var _0x44a9ee=_[_0xa5e3('0x35')](_0x464a67);if(_0x257e2b[_0xa5e3('0x38')]){var _0x5373e1={};_0x5373e1[_0x257e2b['additionalSearchLead']]=_0x12fda4;_[_0xa5e3('0x36')](_0x44a9ee[_0xa5e3('0x3b')],_0x5373e1);}return _0x4d4067['sobject'](_0xa5e3('0x3e'))['find'](_0x44a9ee,_0x3dd548);}});}});case'contact':var _0x2516da=_[_0xa5e3('0x35')](_0x464a67);if(_0x257e2b[_0xa5e3('0x3d')]){var _0x5968db={};_0x5968db[_0x257e2b['additionalSearchContact']]=_0x12fda4;_[_0xa5e3('0x36')](_0x2516da[_0xa5e3('0x3b')],_0x5968db);}return _0x4d4067[_0xa5e3('0x21')]('Contact')['find'](_0x2516da,_0x3dd548)[_0xa5e3('0x27')]();case _0xa5e3('0x18'):var _0x28a875=_[_0xa5e3('0x35')](_0x464a67);if(_0x257e2b['additionalSearchLead']){var _0x5968db={};_0x5968db[_0x257e2b['additionalSearchLead']]=_0x12fda4;_[_0xa5e3('0x36')](_0x28a875[_0xa5e3('0x3b')],_0x5968db);}return _0x4d4067[_0xa5e3('0x21')](_0xa5e3('0x3e'))[_0xa5e3('0x26')](_0x28a875,_0x3dd548);case _0xa5e3('0x1a'):var _0x3edc8e=_[_0xa5e3('0x35')](_0x464a67);if(_0x257e2b[_0xa5e3('0x3a')]){var _0x5968db={};_0x5968db[_0x257e2b[_0xa5e3('0x3a')]]=_0x12fda4;_['merge'](_0x3edc8e['$or'],_0x5968db);}return _0x4d4067[_0xa5e3('0x21')](_0xa5e3('0x3c'))[_0xa5e3('0x26')](_0x3edc8e,_0x3dd548);default:return null;}})[_0xa5e3('0x28')](function(_0x73651e){if(_0x73651e&&_0x73651e[_0xa5e3('0x29')]){var _0x14d0a0=_[_0xa5e3('0x3f')](_0x73651e);if(_0x14d0a0){return BPromise[_0xa5e3('0x2c')]({'id':_0x14d0a0['Id'],'name':_0x14d0a0[_0xa5e3('0x2d')],'phone':_0x14d0a0['Phone'],'endUserType':_0x14d0a0[_0xa5e3('0x40')][_0xa5e3('0x41')][_0xa5e3('0x42')]()});}}})[_0xa5e3('0x28')](function(_0x5eba48){if(_0x5eba48){logger[_0xa5e3('0x1f')](_0xa5e3('0x43'),_0x5eba48['endUserType'],_0x12fda4);return BPromise['resolve'](_0x5eba48);}else{logger['info'](_0xa5e3('0x44'),_0x12fda4);var _0x13d5d2={'Phone':_0x12fda4};if(_0x257e2b[_0xa5e3('0x45')]){if(_0x257e2b['moduleCreate']===_0xa5e3('0x17')){logger[_0xa5e3('0x1f')](_0xa5e3('0x46'),_0x12fda4,_0x257e2b[_0xa5e3('0x45')]);_0x13d5d2[_0xa5e3('0x47')]=_0x580856!==_0xa5e3('0x48')?_0x580856:util[_0xa5e3('0x49')](_0xa5e3('0x4a'),_0x12fda4);}else if(_0x257e2b[_0xa5e3('0x45')]===_0xa5e3('0x18')){logger[_0xa5e3('0x1f')](_0xa5e3('0x46'),_0x12fda4,_0x257e2b['moduleCreate']);_0x13d5d2[_0xa5e3('0x47')]=_0x580856!==_0xa5e3('0x48')?_0x580856:util[_0xa5e3('0x49')](_0xa5e3('0x4a'),_0x12fda4);_0x13d5d2[_0xa5e3('0x4b')]=_0xa5e3('0x4c');}else if(_0x257e2b[_0xa5e3('0x45')]===_0xa5e3('0x1a')){logger[_0xa5e3('0x1f')](_0xa5e3('0x46'),_0x12fda4,_0x257e2b[_0xa5e3('0x45')]);_0x13d5d2[_0xa5e3('0x2d')]=_0x580856!==_0xa5e3('0x48')?_0x580856:util['format'](_0xa5e3('0x4a'),_0x12fda4);}else{return null;}}return _0x4d4067[_0xa5e3('0x21')](_[_0xa5e3('0x4d')](_0x257e2b[_0xa5e3('0x45')]))[_0xa5e3('0x22')](_0x13d5d2)[_0xa5e3('0x28')](function(_0x394cae){return BPromise['resolve']({'id':_0x394cae['id'],'endUserType':_0x257e2b['moduleCreate']});});}});}function getCustomFields(_0x454be2,_0x596ce6){var _0x261e71={};if(_0x454be2[_0xa5e3('0x29')]>0x0){_[_0xa5e3('0x4e')](_0x454be2,function(_0x1e0dc3){if(_['includes']([_0xa5e3('0x4f'),_0xa5e3('0x50')],_0x1e0dc3['type'])&&_0x1e0dc3[_0xa5e3('0x51')]){_0x261e71[_0x1e0dc3['idField']]=_0x1e0dc3[_0xa5e3('0x52')]['toString']();}else if(_0x1e0dc3[_0xa5e3('0x41')]==='variable'&&_0x1e0dc3[_0xa5e3('0x53')]&&_0x1e0dc3[_0xa5e3('0x51')]){_0x596ce6[_0x1e0dc3[_0xa5e3('0x53')]]&&(_0x261e71[_0x1e0dc3[_0xa5e3('0x51')]]=_0x596ce6[_0x1e0dc3[_0xa5e3('0x53')]][_0xa5e3('0x54')]());}else if(_0x1e0dc3[_0xa5e3('0x41')]===_0xa5e3('0x55')&&_0x1e0dc3['Variable']&&_0x1e0dc3[_0xa5e3('0x56')][_0xa5e3('0x57')]&&_0x1e0dc3[_0xa5e3('0x51')]){_0x596ce6[_0x1e0dc3[_0xa5e3('0x56')][_0xa5e3('0x57')][_0xa5e3('0x42')]()]&&(_0x261e71[_0x1e0dc3[_0xa5e3('0x51')]]=_0x596ce6[_0x1e0dc3[_0xa5e3('0x56')][_0xa5e3('0x57')][_0xa5e3('0x42')]()][_0xa5e3('0x54')]());}});}return _0x261e71;}function getConnection(_0x2c189f){var _0xa2619c=_0x2c189f[_0xa5e3('0x58')][_0xa5e3('0x59')](_0x2c189f['securityToken']);var _0x530114=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2c189f[_0xa5e3('0x5a')]||'https://login.salesforce.com','clientId':_0x2c189f[_0xa5e3('0x5b')],'clientSecret':_0x2c189f['clientSecret']}});return _0x530114['login'](_0x2c189f['username'],_0xa2619c)[_0xa5e3('0x28')](function(){logger[_0xa5e3('0x1f')](_0xa5e3('0x5c'));return _0x530114;});}exports[_0xa5e3('0x5d')]=function(_0x19fe5f,_0x2118ea,_0x2abcc8,_0x35ac24,_0x2cf039,_0x2db2bb){var _0x50e548,_0x1322bb,_0x212ab1,_0x4e2663;_0x2db2bb[_0xa5e3('0x5e')]=intUtil['stripTrailingSlash'](_0x2db2bb[_0xa5e3('0x5e')]);_0x2db2bb[_0xa5e3('0x5a')]=intUtil[_0xa5e3('0x5f')](_0x2db2bb[_0xa5e3('0x5a')]);if(_0x2cf039&&_0x2cf039[_0xa5e3('0x60')]){logger['info'](_0xa5e3('0x61'),'Recording\x20is\x20enabled!');_0x2118ea['recordingURL']=util[_0xa5e3('0x49')](_0xa5e3('0x62'),_0x2db2bb[_0xa5e3('0x5e')],_0x2118ea[_0xa5e3('0x63')],md5(_0x2118ea['uniqueid']));}else{_0x2118ea[_0xa5e3('0x64')]='';}return getConnection(_0x2db2bb)[_0xa5e3('0x28')](function(_0x1b6e24){_0x4e2663=_0x1b6e24;return getUser(_0x2db2bb,_0x35ac24[_0xa5e3('0x65')],_0x4e2663);})[_0xa5e3('0x28')](function(_0x58cdc5){_0x50e548=_0x58cdc5;return getEndUser(_0x2db2bb,_0x2abcc8,_0x2118ea[_0xa5e3('0x66')],_0x2118ea[_0xa5e3('0x67')],_0x4e2663);})[_0xa5e3('0x28')](function(_0x33916f){_0x1322bb=_0x33916f;return getTicket(_0x2db2bb,_0x50e548,_0x1322bb,_0x2abcc8,_0x2118ea,_0x2abcc8[_0xa5e3('0x68')],_0x4e2663,_0xa5e3('0x5d'));})[_0xa5e3('0x28')](function(_0x56560a){_0x212ab1=_0x56560a;logger[_0xa5e3('0x1f')](_0xa5e3('0x69'),_0x212ab1['id']);logger[_0xa5e3('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x212ab1['id'],_0x35ac24['name'],_0x2db2bb[_0xa5e3('0x41')]);switch(_0x2db2bb['type']){case'integrationTab':emit(util[_0xa5e3('0x49')]('user:%s',_0x35ac24[_0xa5e3('0x57')]),'trigger:salesforce:display',{'recordId':_0x212ab1['id']});break;case _0xa5e3('0x6a'):emit(util[_0xa5e3('0x49')](_0xa5e3('0x6b'),_0x35ac24[_0xa5e3('0x57')]),_0xa5e3('0x6c'),{'uri':util[_0xa5e3('0x49')]('%s/%s/e',_0x4e2663[_0xa5e3('0x6d')],_0x212ab1['id'])});break;default:logger['error'](_0xa5e3('0x6e'));}})[_0xa5e3('0x6f')](function(_0x2fc56a){logger[_0xa5e3('0x70')]('[QUEUE]',_0x2fc56a);});};exports[_0xa5e3('0x71')]=function(_0x3b24c1,_0x342bc3,_0x2fd426,_0xcaabac,_0x3ccc7c,_0x3b73ae,_0x5046e7){var _0x91abbd,_0x328bdd,_0x3ea907,_0x21697b;_0x3b73ae[_0xa5e3('0x5e')]=intUtil[_0xa5e3('0x5f')](_0x3b73ae[_0xa5e3('0x5e')]);_0x3b73ae['remoteUri']=intUtil[_0xa5e3('0x5f')](_0x3b73ae[_0xa5e3('0x5a')]);if(_0x5046e7&&_0x5046e7['recordingFormat']&&_0x5046e7[_0xa5e3('0x72')]!==_0xa5e3('0x73')){logger['info'](_0xa5e3('0x74'),_0xa5e3('0x75'));_0x342bc3['recordingURL']=util['format'](_0xa5e3('0x62'),_0x3b73ae[_0xa5e3('0x5e')],_0x342bc3[_0xa5e3('0x63')],md5(_0x342bc3[_0xa5e3('0x63')]));}return getConnection(_0x3b73ae)[_0xa5e3('0x28')](function(_0x1b214f){_0x21697b=_0x1b214f;return getUser(_0x3b73ae,_0xcaabac[_0xa5e3('0x65')],_0x21697b);})[_0xa5e3('0x28')](function(_0x31da9b){_0x91abbd=_0x31da9b;return getEndUser(_0x3b73ae,_0x2fd426,_0x342bc3[_0xa5e3('0x76')],_0x342bc3[_0xa5e3('0x77')],_0x21697b);})[_0xa5e3('0x28')](function(_0x13d331){_0x328bdd=_0x13d331;return getTicket(_0x3b73ae,_0x91abbd,_0x328bdd,_0x2fd426,_0x342bc3,_0x2fd426['Fields'],_0x21697b,_0xa5e3('0x71'));})[_0xa5e3('0x28')](function(_0x54f803){_0x3ea907=_0x54f803;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3ea907['id']);logger['info'](_0xa5e3('0x78'),_0x3ea907['id'],_0xcaabac[_0xa5e3('0x57')],_0x3b73ae[_0xa5e3('0x41')]);switch(_0x3b73ae['type']){case'integrationTab':emit(util[_0xa5e3('0x49')](_0xa5e3('0x6b'),_0xcaabac[_0xa5e3('0x57')]),_0xa5e3('0x79'),{'recordId':_0x3ea907['id']});break;case _0xa5e3('0x6a'):emit(util[_0xa5e3('0x49')](_0xa5e3('0x6b'),_0xcaabac[_0xa5e3('0x57')]),_0xa5e3('0x6c'),{'uri':util[_0xa5e3('0x49')](_0xa5e3('0x7a'),_0x21697b[_0xa5e3('0x6d')],_0x3ea907['id'])});break;default:logger['error'](_0xa5e3('0x74'),_0xa5e3('0x7b'));}})['catch'](function(_0x50af17){logger[_0xa5e3('0x70')](_0xa5e3('0x74'),_0x50af17);});};exports[_0xa5e3('0x7c')]=function(_0x56a2a5,_0x307ac7,_0x599a1f,_0x124f36,_0x40254c,_0x382981){var _0x381540,_0x384213,_0x3fb689,_0x5a909c;_0x382981[_0xa5e3('0x5e')]=intUtil[_0xa5e3('0x5f')](_0x382981['serverUrl']);_0x382981[_0xa5e3('0x5a')]=intUtil[_0xa5e3('0x5f')](_0x382981[_0xa5e3('0x5a')]);if(_0x40254c&&_0x40254c[_0xa5e3('0x60')]){logger[_0xa5e3('0x1f')]('['+_0x307ac7['lastevent'][_0xa5e3('0x7d')]()+']',_0xa5e3('0x75'));_0x307ac7[_0xa5e3('0x64')]=util[_0xa5e3('0x49')](_0xa5e3('0x62'),_0x382981[_0xa5e3('0x5e')],_0x307ac7['uniqueid'],md5(_0x307ac7[_0xa5e3('0x63')]));}else{_0x307ac7[_0xa5e3('0x64')]='';}return getConnection(_0x382981)[_0xa5e3('0x28')](function(_0x96331f){_0x5a909c=_0x96331f;if(!_['isNil'](_0x124f36)){return getUser(_0x382981,_0x124f36[_0xa5e3('0x57')],_0x5a909c);}else{return getUser(_0x382981,null,_0x5a909c);}})['then'](function(_0x8dd5b1){_0x381540=_0x8dd5b1;return getEndUser(_0x382981,_0x599a1f,_0x307ac7[_0xa5e3('0x66')],_0x307ac7['calleridnum'],_0x5a909c);})[_0xa5e3('0x28')](function(_0x34b09c){_0x384213=_0x34b09c;return getTicket(_0x382981,_0x381540,_0x384213,_0x599a1f,_0x307ac7,_0x599a1f[_0xa5e3('0x68')],_0x5a909c);})['then'](function(_0x1db072){_0x3fb689=_0x1db072;logger[_0xa5e3('0x1f')]('['+_0x307ac7[_0xa5e3('0x7e')]['toUpperCase']()+_0xa5e3('0x7f'),_0x3fb689['id']);logger[_0xa5e3('0x1f')]('['+_0x307ac7[_0xa5e3('0x7e')][_0xa5e3('0x7d')]()+_0xa5e3('0x80'),_0x382981[_0xa5e3('0x41')]);})[_0xa5e3('0x6f')](function(_0x1b0e82){logger[_0xa5e3('0x70')]('['+_0x307ac7[_0xa5e3('0x7e')][_0xa5e3('0x7d')]()+']',_0x1b0e82);});}; \ 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 1a7970b..b67a150 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 _0xa656=['number',']\x20getTicket\x20crm','label','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','POST','endUserNumber','user','true','System','sys_id','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','content','toString','includes','idField','toLowerCase','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields','ticketId','ticketNumber'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa656,0xfc));var _0x6a65=function(_0x49e02c,_0x88247){_0x49e02c=_0x49e02c-0x0;var _0xa40e64=_0xa656[_0x49e02c];return _0xa40e64;};'use strict';var _=require(_0x6a65('0x0'));var Promise=require(_0x6a65('0x1'));var rp=require(_0x6a65('0x2'));var util=require(_0x6a65('0x3'));var md5=require(_0x6a65('0x4'));var Redis=require(_0x6a65('0x5'));var intUtil=require('./util');var config=require(_0x6a65('0x6'));var logger=require(_0x6a65('0x7'))('servicenow');config[_0x6a65('0x8')]=_[_0x6a65('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6a65('0xa'))(new Redis(config[_0x6a65('0x8')]));function getAdminUser(_0x20fac8,_0x1a3c17,_0x20f0a7,_0x1eba16,_0x3a2cb1,_0x1c5d95){return new Promise(function(_0x5a54c1,_0x460480){var _0x25cecd={'method':_0x6a65('0xb'),'uri':_0x1eba16+_0x6a65('0xc')+'&'+_0x3a2cb1+'&'+_0x1c5d95,'auth':_0x1a3c17,'json':!![]};return rp(_0x25cecd)[_0x6a65('0xd')](function(_0x26d078){if(_0x26d078[_0x6a65('0xe')][_0x6a65('0xf')]>0x0){_0x20f0a7[_0x6a65('0x10')]=_0x26d078['result'][0x0]['sys_id'];}logger['info']('['+[_0x20fac8[_0x6a65('0x11')]()]+_0x6a65('0x12'),_0x20f0a7);_0x5a54c1(_0x20f0a7);})[_0x6a65('0x13')](function(_0x432706){logger[_0x6a65('0x14')]('['+[_0x20fac8['toUpperCase']()]+']',_0x432706['message']);_0x460480(_0x432706[_0x6a65('0x15')]);});});}function getUser(_0x41af65,_0x5960e8,_0x574e2f,_0x24228e,_0x5d08e2){return function(_0x5c2fae){logger[_0x6a65('0x16')]('['+[_0x41af65[_0x6a65('0x11')]()]+_0x6a65('0x17'),_0x5c2fae);return new Promise(function(_0x2c2abe,_0x3311e1){if(intUtil[_0x6a65('0x18')](_0x5c2fae['userEmail'])){var _0x48e2fb={'method':_0x6a65('0xb'),'uri':_0x574e2f+'sys_user?sysparm_query=email%3D'+_0x5c2fae[_0x6a65('0x19')]+'&'+_0x24228e+'&'+_0x5d08e2,'auth':_0x5960e8,'json':!![]};logger['info']('['+[_0x41af65[_0x6a65('0x11')]()]+_0x6a65('0x1a'),_0x48e2fb);return rp(_0x48e2fb)[_0x6a65('0xd')](function(_0x520a40){logger[_0x6a65('0x16')]('['+[_0x41af65['toUpperCase']()]+_0x6a65('0x1b'),_0x520a40);if(_0x520a40[_0x6a65('0xe')]['length']>0x0&&String(_0x520a40[_0x6a65('0xe')][0x0][_0x6a65('0x1c')])==='true'){_0x5c2fae['userId']=_0x520a40[_0x6a65('0xe')][0x0]['sys_id'];}else{_0x5c2fae[_0x6a65('0x1d')]=_0x5c2fae[_0x6a65('0x10')];_0x5c2fae['userEmail']=_0x5c2fae['adminEmail'];}logger[_0x6a65('0x16')]('['+[_0x41af65[_0x6a65('0x11')]()]+_0x6a65('0x1e'),_0x5c2fae);_0x2c2abe(_0x5c2fae);})[_0x6a65('0x13')](function(_0x2df1b4){logger[_0x6a65('0x14')]('['+[_0x41af65[_0x6a65('0x11')]()]+']',_0x2df1b4[_0x6a65('0x15')]);_0x3311e1(_0x2df1b4[_0x6a65('0x15')]);});}else{logger[_0x6a65('0x16')]('['+[_0x41af65[_0x6a65('0x11')]()]+_0x6a65('0x1f'));_0x5c2fae['userId']=_0x5c2fae[_0x6a65('0x10')];_0x5c2fae['userEmail']=_0x5c2fae[_0x6a65('0x20')];_0x2c2abe(_0x5c2fae);}});};}function createEndUser(_0x21fcef,_0x343955,_0x16f47f,_0x1e9032,_0x588acc){logger[_0x6a65('0x16')]('['+[_0x21fcef[_0x6a65('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x16f47f);return new Promise(function(_0x48fd3e,_0x1d4eec){var _0x3cb817={'method':_0x6a65('0x21'),'uri':_0x1e9032+'sys_user?'+_0x588acc,'body':{'user_name':_0x16f47f[_0x6a65('0x22')],'roles':_0x6a65('0x23'),'first_name':_0x16f47f[_0x6a65('0x22')],'active':_0x6a65('0x24'),'date_format':_0x6a65('0x25'),'phone':_0x16f47f[_0x6a65('0x22')]},'auth':_0x343955,'json':!![]};return rp(_0x3cb817)[_0x6a65('0xd')](function(_0x268449){logger[_0x6a65('0x16')]('['+[_0x21fcef[_0x6a65('0x11')]()]+'],\x20EndUser\x20schema',_0x268449[_0x6a65('0xe')]);_0x16f47f['endUserId']=_0x268449[_0x6a65('0xe')][_0x6a65('0x26')];_0x48fd3e(_0x16f47f);})['catch'](function(_0x4d61dc){logger[_0x6a65('0x14')]('['+[_0x21fcef[_0x6a65('0x11')]()]+']',_0x4d61dc[_0x6a65('0x15')]);_0x1d4eec(_0x4d61dc['message']);});});}function getEndUser(_0xafc028,_0x1ef5ba,_0x5c4bec,_0x128fc8,_0x3a3e56){return function(_0x908ef0){logger[_0x6a65('0x16')]('['+[_0xafc028[_0x6a65('0x11')]()]+_0x6a65('0x27'),_0x908ef0);return new Promise(function(_0xc6ee28,_0x4aa21d){var _0x4ce546={'method':_0x6a65('0xb'),'uri':_0x5c4bec+_0x6a65('0x28')+_0x908ef0[_0x6a65('0x22')]+'&'+_0x128fc8+'&'+_0x3a3e56,'auth':_0x1ef5ba,'json':!![]};return rp(_0x4ce546)[_0x6a65('0xd')](function(_0x4ac4a0){if(_0x4ac4a0[_0x6a65('0xe')][_0x6a65('0xf')]>0x0){_0x908ef0[_0x6a65('0x29')]=_0x4ac4a0['result'][0x0]['sys_id'];logger[_0x6a65('0x16')]('['+[_0xafc028[_0x6a65('0x11')]()]+_0x6a65('0x2a'),_0x908ef0);_0xc6ee28(_0x908ef0);}else{return createEndUser(_0xafc028,_0x1ef5ba,_0x908ef0,_0x5c4bec,_0x128fc8)['then'](function(_0xb73634){logger[_0x6a65('0x16')]('['+[_0xafc028[_0x6a65('0x11')]()]+_0x6a65('0x2b'),_0xb73634);_0xc6ee28(_0xb73634);});}})[_0x6a65('0x13')](function(_0x475c8a){logger[_0x6a65('0x14')]('['+[_0xafc028['toUpperCase']()]+']',_0x475c8a['message']);_0x4aa21d(_0x475c8a['message']);});});};}function getCustomFields(_0x2033af,_0x326a63){var _0x25e74d={};if(_0x2033af['length']>0x0){_[_0x6a65('0x2c')](_0x2033af,function(_0x4241a1){if(_['includes']([_0x6a65('0x2d'),_0x6a65('0x2e')],_0x4241a1[_0x6a65('0x2f')])&&_0x4241a1[_0x6a65('0x30')]&&!_0x4241a1[_0x6a65('0x31')]){_0x25e74d[_0x4241a1[_0x6a65('0x30')]['toLowerCase']()]=_0x4241a1[_0x6a65('0x32')][_0x6a65('0x33')]();}else if(_[_0x6a65('0x34')]([_0x6a65('0x2d'),_0x6a65('0x2e')],_0x4241a1[_0x6a65('0x2f')])&&_0x4241a1['idField']&&_0x4241a1[_0x6a65('0x31')]){_0x25e74d[_0x4241a1[_0x6a65('0x35')][_0x6a65('0x36')]()]=_0x4241a1['content'][_0x6a65('0x33')]();}else if(_0x4241a1[_0x6a65('0x2f')]===_0x6a65('0x37')&&_0x4241a1[_0x6a65('0x38')]&&_0x4241a1['idField']&&_0x4241a1[_0x6a65('0x31')]){_0x25e74d[_0x4241a1[_0x6a65('0x35')]['toLowerCase']()]=_0x326a63[_0x4241a1[_0x6a65('0x38')]]['toString']();}else if(_0x4241a1[_0x6a65('0x2f')]===_0x6a65('0x39')&&_0x4241a1[_0x6a65('0x3a')]&&_0x4241a1['Variable'][_0x6a65('0x3b')]&&_0x4241a1[_0x6a65('0x35')]&&_0x4241a1[_0x6a65('0x31')]){_0x25e74d[_0x4241a1['idField'][_0x6a65('0x36')]()]=_0x326a63[_0x4241a1[_0x6a65('0x3a')][_0x6a65('0x3b')][_0x6a65('0x36')]()][_0x6a65('0x33')]();}});}return _0x25e74d;}function getTicket(_0x5061dc,_0x138790,_0x270418,_0x7dac17,_0x463752,_0x1a8ff8){return function(_0x408d69){logger['info']('['+[_0x5061dc[_0x6a65('0x11')]()]+_0x6a65('0x3c'),_0x408d69);return new Promise(function(_0x2f1454,_0x36742e){var _0x5c76d6=_0x5061dc['toLowerCase']()===_0x6a65('0x3d')?_0x408d69[_0x6a65('0x1d')]:_0x408d69[_0x6a65('0x29')];var _0x5226f6={'method':_0x6a65('0x21'),'uri':_0x270418+_0x6a65('0x3e')+'?'+_0x1a8ff8,'body':Object[_0x6a65('0x3f')]({},{'active':_0x6a65('0x24'),'caller_id':_0x5c76d6,'assigned_to':_0x408d69[_0x6a65('0x1d')],'short_description':intUtil['getString'](_0x7dac17['Subjects'],_0x463752,'\x20'),'description':intUtil[_0x6a65('0x40')](_0x7dac17[_0x6a65('0x41')],_0x463752,'\x0a')},getCustomFields(_0x7dac17[_0x6a65('0x42')],_0x463752)),'auth':_0x138790,'json':!![]};return rp(_0x5226f6)[_0x6a65('0xd')](function(_0x270919){logger[_0x6a65('0x16')]('['+[_0x5061dc['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x270919[_0x6a65('0xe')]);_0x408d69[_0x6a65('0x43')]=_0x270919[_0x6a65('0xe')][_0x6a65('0x26')];_0x408d69[_0x6a65('0x44')]=_0x270919[_0x6a65('0xe')][_0x6a65('0x45')];logger[_0x6a65('0x16')]('['+[_0x5061dc['toUpperCase']()]+_0x6a65('0x46'),_0x408d69);_0x2f1454(_0x408d69);})[_0x6a65('0x13')](function(_0x2396aa){logger[_0x6a65('0x14')]('['+[_0x5061dc[_0x6a65('0x11')]()]+']',_0x2396aa[_0x6a65('0x15')]);_0x36742e(_0x2396aa[_0x6a65('0x15')]);});});};}function createRemoteTag(_0x51883f,_0x5f4fcf,_0x9922eb,_0x3ee1d7){return new Promise(function(_0x40b6b5,_0x3ffc3f){var _0x7913f3={'method':_0x6a65('0x21'),'uri':_0x9922eb+'label'+'?'+_0x3ee1d7,'body':{'short_description':_0x51883f,'global':!![],'active':!![],'name':_0x51883f},'auth':_0x5f4fcf,'json':!![]};return rp(_0x7913f3)[_0x6a65('0xd')](function(_0x457ddd){var _0x476438=_0x457ddd[_0x6a65('0xe')][_0x6a65('0x26')];_0x40b6b5(_0x476438);});});}function getRemoteTag(_0x34b6db,_0x37828e,_0x5f37e7,_0x5bbf84,_0x19addc){return new Promise(function(_0xa76d02,_0x173c8d){var _0x2b6c0e={'method':_0x6a65('0xb'),'uri':_0x5f37e7+_0x6a65('0x47')+'?sysparm_query=name%3D'+_0x34b6db+'&'+_0x5bbf84,'auth':_0x37828e,'json':!![]};return rp(_0x2b6c0e)[_0x6a65('0xd')](function(_0x4051aa){if(_0x4051aa[_0x6a65('0xe')][_0x6a65('0xf')]>0x0){var _0x133680=_0x4051aa[_0x6a65('0xe')][0x0]['sys_id'];_0xa76d02(_0x133680);}else{return createRemoteTag(_0x34b6db,_0x37828e,_0x5f37e7,_0x5bbf84)['then'](function(_0x507a03){_0xa76d02(_0x507a03);});}});});}function assignTagToIncident(_0x5d0103,_0x233037,_0x425374,_0x3d6cd1,_0x4630b8){return new Promise(function(_0x54a3d6,_0x59b657){var _0x3016db={'method':_0x6a65('0x21'),'uri':_0x425374+'label_entry'+'?'+_0x4630b8,'body':{'label':_0x5d0103,'table':'incident','id_type':_0x6a65('0x48'),'table_key':_0x3d6cd1[_0x6a65('0x43')],'title':_0x6a65('0x49')+_0x3d6cd1[_0x6a65('0x44')],'id_display':_0x3d6cd1[_0x6a65('0x44')]},'auth':_0x233037,'json':!![]};return rp(_0x3016db)[_0x6a65('0xd')](function(_0x34c588){_0x54a3d6();})[_0x6a65('0x13')](function(){_0x54a3d6();});});}function manageTags(_0x56de66,_0x4ebb71,_0x3861bf,_0x5921c3,_0x44a82a,_0x58b84d,_0x1db000){return new Promise(function(_0xfbb5ef,_0x4a25fe){var _0x279708=[];_0x4ebb71['forEach'](function(_0xdfa14d){_0x279708[_0x6a65('0x4a')](getRemoteTag(_0xdfa14d,_0x3861bf,_0x5921c3,_0x58b84d,_0x1db000));});return Promise[_0x6a65('0x4b')](_0x279708)[_0x6a65('0xd')](function(_0x42e0cc){if(_0x42e0cc['length']){logger[_0x6a65('0x16')]('['+[_0x56de66[_0x6a65('0x11')]()]+_0x6a65('0x4c'),_0x42e0cc);var _0x581f09=[];_0x42e0cc[_0x6a65('0x2c')](function(_0x48c1ed){_0x581f09[_0x6a65('0x4a')](assignTagToIncident(_0x48c1ed,_0x3861bf,_0x5921c3,_0x44a82a,_0x58b84d));});return Promise[_0x6a65('0x4b')](_0x581f09)[_0x6a65('0xd')](function(){_0xfbb5ef();})[_0x6a65('0x13')](function(){_0xfbb5ef();});}else{_0xfbb5ef();}});});}function getTags(_0x56473c,_0x5499ce,_0x3f2d61,_0x284c0a,_0x5a4238,_0x1e19f3){return function(_0x1afb8d){return new Promise(function(_0x49f80a,_0x57a216){var _0x255469=[];var _0x4608fd=_0x284c0a['Tags'];if(_0x4608fd&&_0x4608fd[_0x6a65('0xf')]>0x0){_0x255469=_[_0x6a65('0x4d')](_0x4608fd,_0x6a65('0x3b'));}if(_0x255469[_0x6a65('0xf')]>0x0){return manageTags(_0x56473c,_0x255469,_0x5499ce,_0x3f2d61,_0x1afb8d,_0x5a4238,_0x1e19f3)[_0x6a65('0xd')](function(){_0x49f80a(_0x1afb8d);});}else{_0x49f80a(_0x1afb8d);}});};}function emit(_0x1a1546,_0x1d08a9,_0x27701d){var _0x3ac7c1=_0x6a65('0x4e')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x6a65('0x4f')+_0x6a65('0x50');var _0x182f3c={'uri':_0x1a1546+_0x6a65('0x51')+_0x27701d+_0x3ac7c1};io['to'](util[_0x6a65('0x52')](_0x6a65('0x53'),_0x1d08a9))['emit'](_0x6a65('0x54'),_0x182f3c);}exports['cs']=function(_0x9a217b,_0x169e01,_0x1372f2,_0x27021a,_0x37cde7,_0x51800e,_0x44c736,_0x506566){var _0x14aa36={};var _0x6aa1de={'user':_0x51800e[_0x6a65('0x55')],'pass':_0x51800e[_0x6a65('0x56')]};var _0xc158c8=_0x6a65('0x57');var _0x134883=_0x6a65('0x58');_0x51800e[_0x6a65('0x59')]=intUtil[_0x6a65('0x5a')](_0x51800e[_0x6a65('0x59')]);_0x51800e[_0x6a65('0x5b')]=intUtil[_0x6a65('0x5a')](_0x51800e['serverUrl']);var _0x4c378e=util[_0x6a65('0x52')](_0x6a65('0x5c'),_0x51800e[_0x6a65('0x59')]);_0x14aa36[_0x6a65('0x19')]=!_[_0x6a65('0x5d')](_0x27021a)?_0x27021a['email']:null;_0x14aa36[_0x6a65('0x20')]=_0x51800e['email'];_0x14aa36[_0x6a65('0x22')]=_0x506566['toLowerCase']()===_0x6a65('0x3d')?_0x169e01[_0x6a65('0x5e')]:_0x169e01[_0x6a65('0x5f')];_0x14aa36[_0x6a65('0x60')]=_0x506566==='queue'||_0x506566==='unmanaged'?'queue':'outbound';var _0x44eebc=util['format'](_0x6a65('0x61'),_0x51800e['serverUrl'],_0x169e01[_0x6a65('0x62')],md5(_0x169e01[_0x6a65('0x62')]));if(_0x37cde7&&_0x37cde7[_0x6a65('0x63')]){logger[_0x6a65('0x16')]('[QUEUE]',_0x6a65('0x64'));_0x169e01[_0x6a65('0x65')]=_0x44eebc;}else if(_0x44c736&&_0x44c736[_0x6a65('0x66')]&&_0x44c736[_0x6a65('0x66')]!=='none'){logger[_0x6a65('0x16')](_0x6a65('0x67'),_0x6a65('0x64'));_0x169e01[_0x6a65('0x65')]=_0x44eebc;}else{_0x169e01['recordingURL']='';}return getAdminUser(_0x506566,_0x6aa1de,_0x14aa36,_0x4c378e,_0x134883,_0xc158c8)['then'](getUser(_0x506566,_0x6aa1de,_0x4c378e,_0x134883,_0xc158c8))[_0x6a65('0xd')](getEndUser(_0x506566,_0x6aa1de,_0x4c378e,_0x134883,_0xc158c8))[_0x6a65('0xd')](getTicket(_0x506566,_0x6aa1de,_0x4c378e,_0x1372f2,_0x169e01,_0x134883))[_0x6a65('0xd')](function(_0x2d32d1){logger[_0x6a65('0x16')](util[_0x6a65('0x52')]('The\x20ticket\x20ID\x20is:\x20%s',_0x2d32d1[_0x6a65('0x43')]));logger[_0x6a65('0x16')](util[_0x6a65('0x52')]('call\x20direction:\x20%s',_0x506566));if(_0x506566!=='unmanaged'){logger[_0x6a65('0x16')]('['+[_0x506566['toUpperCase']()]+']',_0x6a65('0x68'));emit(_0x51800e[_0x6a65('0x59')],_0x27021a[_0x6a65('0x3b')],_0x2d32d1['ticketId']);}})[_0x6a65('0x13')](function(_0x348ec3){logger[_0x6a65('0x14')]('['+[_0x506566[_0x6a65('0x11')]()]+_0x6a65('0x69'),util[_0x6a65('0x6a')](_0x348ec3,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xcdd3=['validateEmail','GET','sys_user?sysparm_query=email%3D','userEmail','toUpperCase','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','POST','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','includes','string','type','customField','nameField','toLowerCase','content','toString','picklist','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','format','user:%s','trigger:browser:url','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','message'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xcdd3,0x12a));var _0x3cdd=function(_0x2f708e,_0x312f9b){_0x2f708e=_0x2f708e-0x0;var _0x3771fb=_0xcdd3[_0x2f708e];return _0x3771fb;};'use strict';var _=require(_0x3cdd('0x0'));var Promise=require(_0x3cdd('0x1'));var rp=require(_0x3cdd('0x2'));var util=require('util');var md5=require('md5');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x3cdd('0x3'));var logger=require(_0x3cdd('0x4'))(_0x3cdd('0x5'));config[_0x3cdd('0x6')]=_[_0x3cdd('0x7')](config[_0x3cdd('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3cdd('0x8'))(new Redis(config['redis']));function getAdminUser(_0x64ee2e,_0x206435,_0x1a1cb0,_0xb61327,_0x1b1734,_0x3f1e7f){return new Promise(function(_0x4debe2,_0x456a65){var _0x18b6d0={'method':'GET','uri':_0xb61327+_0x3cdd('0x9')+'&'+_0x1b1734+'&'+_0x3f1e7f,'auth':_0x206435,'json':!![]};return rp(_0x18b6d0)[_0x3cdd('0xa')](function(_0xe4b741){if(_0xe4b741[_0x3cdd('0xb')][_0x3cdd('0xc')]>0x0){_0x1a1cb0[_0x3cdd('0xd')]=_0xe4b741[_0x3cdd('0xb')][0x0][_0x3cdd('0xe')];}logger[_0x3cdd('0xf')]('['+[_0x64ee2e['toUpperCase']()]+_0x3cdd('0x10'),_0x1a1cb0);_0x4debe2(_0x1a1cb0);})[_0x3cdd('0x11')](function(_0x21faf5){logger[_0x3cdd('0x12')]('['+[_0x64ee2e['toUpperCase']()]+']',_0x21faf5[_0x3cdd('0x13')]);_0x456a65(_0x21faf5[_0x3cdd('0x13')]);});});}function getUser(_0x2d59c2,_0x3163cd,_0x1b3bc5,_0x183725,_0x2a022b){return function(_0x46276d){logger[_0x3cdd('0xf')]('['+[_0x2d59c2['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x46276d);return new Promise(function(_0x3a30a9,_0x756f73){if(intUtil[_0x3cdd('0x14')](_0x46276d['userEmail'])){var _0x1cad74={'method':_0x3cdd('0x15'),'uri':_0x1b3bc5+_0x3cdd('0x16')+_0x46276d[_0x3cdd('0x17')]+'&'+_0x183725+'&'+_0x2a022b,'auth':_0x3163cd,'json':!![]};logger[_0x3cdd('0xf')]('['+[_0x2d59c2[_0x3cdd('0x18')]()]+_0x3cdd('0x19'),_0x1cad74);return rp(_0x1cad74)[_0x3cdd('0xa')](function(_0x54485c){logger[_0x3cdd('0xf')]('['+[_0x2d59c2[_0x3cdd('0x18')]()]+_0x3cdd('0x1a'),_0x54485c);if(_0x54485c['result'][_0x3cdd('0xc')]>0x0&&String(_0x54485c['result'][0x0][_0x3cdd('0x1b')])===_0x3cdd('0x1c')){_0x46276d[_0x3cdd('0x1d')]=_0x54485c[_0x3cdd('0xb')][0x0][_0x3cdd('0xe')];}else{_0x46276d[_0x3cdd('0x1d')]=_0x46276d[_0x3cdd('0xd')];_0x46276d[_0x3cdd('0x17')]=_0x46276d[_0x3cdd('0x1e')];}logger[_0x3cdd('0xf')]('['+[_0x2d59c2['toUpperCase']()]+_0x3cdd('0x1f'),_0x46276d);_0x3a30a9(_0x46276d);})[_0x3cdd('0x11')](function(_0x57b59b){logger[_0x3cdd('0x12')]('['+[_0x2d59c2[_0x3cdd('0x18')]()]+']',_0x57b59b['message']);_0x756f73(_0x57b59b[_0x3cdd('0x13')]);});}else{logger[_0x3cdd('0xf')]('['+[_0x2d59c2['toUpperCase']()]+']\x20using\x20admin\x20profile');_0x46276d[_0x3cdd('0x1d')]=_0x46276d[_0x3cdd('0xd')];_0x46276d[_0x3cdd('0x17')]=_0x46276d[_0x3cdd('0x1e')];_0x3a30a9(_0x46276d);}});};}function createEndUser(_0x1e458e,_0x5e08fb,_0x622798,_0xe6cba3,_0x2c1686){logger[_0x3cdd('0xf')]('['+[_0x1e458e[_0x3cdd('0x18')]()]+'],\x20createEndUser\x20input\x20crm',_0x622798);return new Promise(function(_0x569122,_0x49da3c){var _0x3e3ba0={'method':_0x3cdd('0x20'),'uri':_0xe6cba3+'sys_user?'+_0x2c1686,'body':{'user_name':_0x622798[_0x3cdd('0x21')],'roles':_0x3cdd('0x22'),'first_name':_0x622798['endUserNumber'],'active':_0x3cdd('0x1c'),'date_format':_0x3cdd('0x23'),'phone':_0x622798['endUserNumber']},'auth':_0x5e08fb,'json':!![]};return rp(_0x3e3ba0)['then'](function(_0x326f36){logger[_0x3cdd('0xf')]('['+[_0x1e458e[_0x3cdd('0x18')]()]+_0x3cdd('0x24'),_0x326f36[_0x3cdd('0xb')]);_0x622798[_0x3cdd('0x25')]=_0x326f36[_0x3cdd('0xb')]['sys_id'];_0x569122(_0x622798);})[_0x3cdd('0x11')](function(_0x5a1163){logger[_0x3cdd('0x12')]('['+[_0x1e458e[_0x3cdd('0x18')]()]+']',_0x5a1163[_0x3cdd('0x13')]);_0x49da3c(_0x5a1163['message']);});});}function getEndUser(_0x4deab6,_0x578eae,_0xd69b3c,_0x2e7b10,_0x55e9cb){return function(_0x41f0f7){logger[_0x3cdd('0xf')]('['+[_0x4deab6['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x41f0f7);return new Promise(function(_0x3c1401,_0x5c7341){var _0xe475b={'method':_0x3cdd('0x15'),'uri':_0xd69b3c+_0x3cdd('0x26')+_0x41f0f7[_0x3cdd('0x21')]+'&'+_0x2e7b10+'&'+_0x55e9cb,'auth':_0x578eae,'json':!![]};return rp(_0xe475b)[_0x3cdd('0xa')](function(_0x257d76){if(_0x257d76[_0x3cdd('0xb')][_0x3cdd('0xc')]>0x0){_0x41f0f7['endUserId']=_0x257d76[_0x3cdd('0xb')][0x0]['sys_id'];logger[_0x3cdd('0xf')]('['+[_0x4deab6[_0x3cdd('0x18')]()]+_0x3cdd('0x27'),_0x41f0f7);_0x3c1401(_0x41f0f7);}else{return createEndUser(_0x4deab6,_0x578eae,_0x41f0f7,_0xd69b3c,_0x2e7b10)['then'](function(_0x3d7a60){logger[_0x3cdd('0xf')]('['+[_0x4deab6[_0x3cdd('0x18')]()]+'],\x20createEndUser\x20crm',_0x3d7a60);_0x3c1401(_0x3d7a60);});}})['catch'](function(_0x27de4e){logger[_0x3cdd('0x12')]('['+[_0x4deab6[_0x3cdd('0x18')]()]+']',_0x27de4e[_0x3cdd('0x13')]);_0x5c7341(_0x27de4e['message']);});});};}function getCustomFields(_0x325cfd,_0x1080fc){var _0x14c822={};if(_0x325cfd['length']>0x0){_[_0x3cdd('0x28')](_0x325cfd,function(_0x2f38d9){if(_[_0x3cdd('0x29')]([_0x3cdd('0x2a'),'picklist'],_0x2f38d9[_0x3cdd('0x2b')])&&_0x2f38d9['nameField']&&!_0x2f38d9[_0x3cdd('0x2c')]){_0x14c822[_0x2f38d9[_0x3cdd('0x2d')][_0x3cdd('0x2e')]()]=_0x2f38d9[_0x3cdd('0x2f')][_0x3cdd('0x30')]();}else if(_['includes']([_0x3cdd('0x2a'),_0x3cdd('0x31')],_0x2f38d9[_0x3cdd('0x2b')])&&_0x2f38d9[_0x3cdd('0x32')]&&_0x2f38d9[_0x3cdd('0x2c')]){_0x14c822[_0x2f38d9[_0x3cdd('0x32')][_0x3cdd('0x2e')]()]=_0x2f38d9['content'][_0x3cdd('0x30')]();}else if(_0x2f38d9[_0x3cdd('0x2b')]===_0x3cdd('0x33')&&_0x2f38d9[_0x3cdd('0x34')]&&_0x2f38d9[_0x3cdd('0x32')]&&_0x2f38d9[_0x3cdd('0x2c')]){_0x14c822[_0x2f38d9['idField']['toLowerCase']()]=_0x1080fc[_0x2f38d9[_0x3cdd('0x34')]][_0x3cdd('0x30')]();}else if(_0x2f38d9[_0x3cdd('0x2b')]===_0x3cdd('0x35')&&_0x2f38d9[_0x3cdd('0x36')]&&_0x2f38d9[_0x3cdd('0x36')][_0x3cdd('0x37')]&&_0x2f38d9[_0x3cdd('0x32')]&&_0x2f38d9[_0x3cdd('0x2c')]){_0x14c822[_0x2f38d9[_0x3cdd('0x32')][_0x3cdd('0x2e')]()]=_0x1080fc[_0x2f38d9[_0x3cdd('0x36')]['name'][_0x3cdd('0x2e')]()][_0x3cdd('0x30')]();}});}return _0x14c822;}function getTicket(_0x42f617,_0x172a4a,_0x4b45a1,_0x6cc780,_0x95f814,_0x428036){return function(_0x2d4571){logger[_0x3cdd('0xf')]('['+[_0x42f617[_0x3cdd('0x18')]()]+_0x3cdd('0x38'),_0x2d4571);return new Promise(function(_0xd92a04,_0xd327e4){var _0x162188=_0x42f617[_0x3cdd('0x2e')]()===_0x3cdd('0x39')?_0x2d4571[_0x3cdd('0x1d')]:_0x2d4571[_0x3cdd('0x25')];var _0xb55ac1={'method':_0x3cdd('0x20'),'uri':_0x4b45a1+'incident'+'?'+_0x428036,'body':Object[_0x3cdd('0x3a')]({},{'active':_0x3cdd('0x1c'),'caller_id':_0x162188,'assigned_to':_0x2d4571[_0x3cdd('0x1d')],'short_description':intUtil['getString'](_0x6cc780['Subjects'],_0x95f814,'\x20'),'description':intUtil[_0x3cdd('0x3b')](_0x6cc780[_0x3cdd('0x3c')],_0x95f814,'\x0a')},getCustomFields(_0x6cc780[_0x3cdd('0x3d')],_0x95f814)),'auth':_0x172a4a,'json':!![]};return rp(_0xb55ac1)[_0x3cdd('0xa')](function(_0x5a46c6){logger[_0x3cdd('0xf')]('['+[_0x42f617[_0x3cdd('0x18')]()]+_0x3cdd('0x3e'),_0x5a46c6[_0x3cdd('0xb')]);_0x2d4571[_0x3cdd('0x3f')]=_0x5a46c6[_0x3cdd('0xb')][_0x3cdd('0xe')];_0x2d4571[_0x3cdd('0x40')]=_0x5a46c6[_0x3cdd('0xb')][_0x3cdd('0x41')];logger['info']('['+[_0x42f617[_0x3cdd('0x18')]()]+_0x3cdd('0x42'),_0x2d4571);_0xd92a04(_0x2d4571);})[_0x3cdd('0x11')](function(_0x4ace21){logger['error']('['+[_0x42f617['toUpperCase']()]+']',_0x4ace21[_0x3cdd('0x13')]);_0xd327e4(_0x4ace21[_0x3cdd('0x13')]);});});};}function createRemoteTag(_0x3ab0ec,_0x56a2aa,_0x27f028,_0x5de0fd){return new Promise(function(_0x2af205,_0x3fbf4e){var _0x5b06c2={'method':'POST','uri':_0x27f028+_0x3cdd('0x43')+'?'+_0x5de0fd,'body':{'short_description':_0x3ab0ec,'global':!![],'active':!![],'name':_0x3ab0ec},'auth':_0x56a2aa,'json':!![]};return rp(_0x5b06c2)['then'](function(_0x197f5e){var _0x49655e=_0x197f5e[_0x3cdd('0xb')]['sys_id'];_0x2af205(_0x49655e);});});}function getRemoteTag(_0x497b7,_0xbf4f1b,_0xdc92d5,_0x68e22f,_0x502e59){return new Promise(function(_0x271ebf,_0x23c1f6){var _0x4309af={'method':_0x3cdd('0x15'),'uri':_0xdc92d5+_0x3cdd('0x43')+_0x3cdd('0x44')+_0x497b7+'&'+_0x68e22f,'auth':_0xbf4f1b,'json':!![]};return rp(_0x4309af)[_0x3cdd('0xa')](function(_0x274d46){if(_0x274d46[_0x3cdd('0xb')][_0x3cdd('0xc')]>0x0){var _0x1f74bb=_0x274d46[_0x3cdd('0xb')][0x0]['sys_id'];_0x271ebf(_0x1f74bb);}else{return createRemoteTag(_0x497b7,_0xbf4f1b,_0xdc92d5,_0x68e22f)[_0x3cdd('0xa')](function(_0x374e20){_0x271ebf(_0x374e20);});}});});}function assignTagToIncident(_0x49c1fb,_0x6946a,_0x150b49,_0x2842b2,_0x3789d2){return new Promise(function(_0x36a8bb,_0x20f7fd){var _0x1ec174={'method':_0x3cdd('0x20'),'uri':_0x150b49+_0x3cdd('0x45')+'?'+_0x3789d2,'body':{'label':_0x49c1fb,'table':_0x3cdd('0x46'),'id_type':_0x3cdd('0x47'),'table_key':_0x2842b2[_0x3cdd('0x3f')],'title':_0x3cdd('0x48')+_0x2842b2[_0x3cdd('0x40')],'id_display':_0x2842b2['ticketNumber']},'auth':_0x6946a,'json':!![]};return rp(_0x1ec174)[_0x3cdd('0xa')](function(_0x4d91a8){_0x36a8bb();})[_0x3cdd('0x11')](function(){_0x36a8bb();});});}function manageTags(_0xcd08d9,_0x5106f0,_0x10bd9d,_0x3c224f,_0x2b6e73,_0x523d13,_0x343719){return new Promise(function(_0x164cff,_0x2ef99f){var _0xc7536=[];_0x5106f0[_0x3cdd('0x28')](function(_0x14f135){_0xc7536[_0x3cdd('0x49')](getRemoteTag(_0x14f135,_0x10bd9d,_0x3c224f,_0x523d13,_0x343719));});return Promise[_0x3cdd('0x4a')](_0xc7536)[_0x3cdd('0xa')](function(_0xbb68bf){if(_0xbb68bf['length']){logger[_0x3cdd('0xf')]('['+[_0xcd08d9[_0x3cdd('0x18')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xbb68bf);var _0x237079=[];_0xbb68bf[_0x3cdd('0x28')](function(_0x22957d){_0x237079[_0x3cdd('0x49')](assignTagToIncident(_0x22957d,_0x10bd9d,_0x3c224f,_0x2b6e73,_0x523d13));});return Promise['all'](_0x237079)['then'](function(){_0x164cff();})[_0x3cdd('0x11')](function(){_0x164cff();});}else{_0x164cff();}});});}function getTags(_0x27d7e7,_0x2ce9b9,_0x3b01cd,_0x480dc0,_0x3cf6f5,_0xa51010){return function(_0x4d1076){return new Promise(function(_0x141e4a,_0x5391fc){var _0x5be5e7=[];var _0x44cf53=_0x480dc0[_0x3cdd('0x4b')];if(_0x44cf53&&_0x44cf53['length']>0x0){_0x5be5e7=_['map'](_0x44cf53,'name');}if(_0x5be5e7['length']>0x0){return manageTags(_0x27d7e7,_0x5be5e7,_0x2ce9b9,_0x3b01cd,_0x4d1076,_0x3cf6f5,_0xa51010)[_0x3cdd('0xa')](function(){_0x141e4a(_0x4d1076);});}else{_0x141e4a(_0x4d1076);}});};}function emit(_0x3c1156,_0x252049,_0x50e424){var _0x528cae=_0x3cdd('0x4c')+_0x3cdd('0x4d')+_0x3cdd('0x4e')+'%255EORDERBYDESCnumber';var _0x1f3603={'uri':_0x3c1156+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x50e424+_0x528cae};io['to'](util[_0x3cdd('0x4f')](_0x3cdd('0x50'),_0x252049))['emit'](_0x3cdd('0x51'),_0x1f3603);}exports['cs']=function(_0x2a6bcc,_0x365aaf,_0x5bed2e,_0x17aa4f,_0x2f3dc1,_0x3f13c9,_0x425383,_0x49126f){var _0x201be2={};var _0x398b96={'user':_0x3f13c9['username'],'pass':_0x3f13c9['password']};var _0x3b12b3=_0x3cdd('0x52');var _0x101fc3=_0x3cdd('0x53');_0x3f13c9['remoteUri']=intUtil['stripTrailingSlash'](_0x3f13c9[_0x3cdd('0x54')]);_0x3f13c9['serverUrl']=intUtil[_0x3cdd('0x55')](_0x3f13c9[_0x3cdd('0x56')]);var _0x3ea6ea=util[_0x3cdd('0x4f')](_0x3cdd('0x57'),_0x3f13c9['remoteUri']);_0x201be2[_0x3cdd('0x17')]=!_[_0x3cdd('0x58')](_0x17aa4f)?_0x17aa4f[_0x3cdd('0x59')]:null;_0x201be2['adminEmail']=_0x3f13c9[_0x3cdd('0x59')];_0x201be2['endUserNumber']=_0x49126f['toLowerCase']()===_0x3cdd('0x39')?_0x365aaf[_0x3cdd('0x5a')]:_0x365aaf['calleridnum'];_0x201be2[_0x3cdd('0x5b')]=_0x49126f===_0x3cdd('0x5c')||_0x49126f==='unmanaged'?'queue':_0x3cdd('0x39');var _0x2151ee=util[_0x3cdd('0x4f')](_0x3cdd('0x5d'),_0x3f13c9['serverUrl'],_0x365aaf['uniqueid'],md5(_0x365aaf[_0x3cdd('0x5e')]));if(_0x2f3dc1&&_0x2f3dc1[_0x3cdd('0x5f')]){logger['info'](_0x3cdd('0x60'),_0x3cdd('0x61'));_0x365aaf[_0x3cdd('0x62')]=_0x2151ee;}else if(_0x425383&&_0x425383[_0x3cdd('0x63')]&&_0x425383[_0x3cdd('0x63')]!==_0x3cdd('0x64')){logger[_0x3cdd('0xf')](_0x3cdd('0x65'),_0x3cdd('0x61'));_0x365aaf[_0x3cdd('0x62')]=_0x2151ee;}else{_0x365aaf[_0x3cdd('0x62')]='';}return getAdminUser(_0x49126f,_0x398b96,_0x201be2,_0x3ea6ea,_0x101fc3,_0x3b12b3)[_0x3cdd('0xa')](getUser(_0x49126f,_0x398b96,_0x3ea6ea,_0x101fc3,_0x3b12b3))[_0x3cdd('0xa')](getEndUser(_0x49126f,_0x398b96,_0x3ea6ea,_0x101fc3,_0x3b12b3))['then'](getTicket(_0x49126f,_0x398b96,_0x3ea6ea,_0x5bed2e,_0x365aaf,_0x101fc3))[_0x3cdd('0xa')](function(_0x58ed8d){logger['info'](util[_0x3cdd('0x4f')](_0x3cdd('0x66'),_0x58ed8d[_0x3cdd('0x3f')]));logger[_0x3cdd('0xf')](util[_0x3cdd('0x4f')](_0x3cdd('0x67'),_0x49126f));if(_0x49126f!=='unmanaged'){logger['info']('['+[_0x49126f[_0x3cdd('0x18')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3f13c9[_0x3cdd('0x54')],_0x17aa4f[_0x3cdd('0x37')],_0x58ed8d['ticketId']);}})[_0x3cdd('0x11')](function(_0x37d3cf){logger[_0x3cdd('0x12')]('['+[_0x49126f[_0x3cdd('0x18')]()]+_0x3cdd('0x68'),util[_0x3cdd('0x69')](_0x37d3cf,{'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 47ce18c..5087e94 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 _0xc223=['ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','name','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','parent_name','length','forEach','variableName','push','idField','set_entry','stringify','format','Basic\x20%s','apiKey','toString','base64','get_server_info','JSON','isNil','info','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','find','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','user_name','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','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','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','The\x20Ticket\x20ID\x20is:','lastevent','toUpperCase','lodash','bluebird','md5'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc223,0x1d9));var _0x3c22=function(_0x48b89d,_0x3808bf){_0x48b89d=_0x48b89d-0x0;var _0x5d0bd7=_0xc223[_0x48b89d];return _0x5d0bd7;};'use strict';var _=require(_0x3c22('0x0'));var rp=require('request-promise');var BPromise=require(_0x3c22('0x1'));var md5=require(_0x3c22('0x2'));var util=require('util');var Redis=require(_0x3c22('0x3'));var intUtil=require(_0x3c22('0x4'));var config=require(_0x3c22('0x5'));var logger=require(_0x3c22('0x6'))(_0x3c22('0x7'));config[_0x3c22('0x8')]=_['defaults'](config['redis'],{'host':_0x3c22('0x9'),'port':0x18eb});var io=require(_0x3c22('0xa'))(new Redis(config[_0x3c22('0x8')]));var def={'method':_0x3c22('0xb'),'json':!![]};function emit(_0x3e7ca1,_0xfe5f03,_0x543941){io['to'](_0x3e7ca1)[_0x3c22('0xc')](_0xfe5f03,_0x543941);}function getTicket(_0x12372a,_0x12ab52,_0x4f46ff,_0x2a1332,_0xc3d9eb,_0x40ed01,_0x4aa79d,_0x1443b7){logger['info']('Creating\x20new\x20ticket...');var _0x567e5f=new Date();var _0x554570=[{'name':_0x3c22('0xd'),'value':intUtil[_0x3c22('0xe')](_0x2a1332[_0x3c22('0xf')],_0xc3d9eb,'\x20')},{'name':_0x3c22('0x10'),'value':_0x12ab52['id']},{'name':'created_by','value':_0x12ab52['id']},{'name':_0x3c22('0x11'),'value':intUtil[_0x3c22('0xe')](_0x2a1332[_0x3c22('0x12')],_0xc3d9eb,'\x0a')},{'name':_0x3c22('0x13'),'value':_0x567e5f[_0x3c22('0x14')]()[_0x3c22('0x15')](0x0,0x13)[_0x3c22('0x16')]('T','\x20')},{'name':_0x3c22('0x17'),'value':'0'},{'name':_0x3c22('0x18'),'value':'15'},{'name':_0x3c22('0x19'),'value':_0x4f46ff['id']},{'name':'parent_type','value':_0x3c22('0x1a')},{'name':_0x3c22('0x1b'),'value':_0x4f46ff[_0x3c22('0xd')]},{'name':'direction','value':_0x1443b7}];if(_0x40ed01[_0x3c22('0x1c')]){_[_0x3c22('0x1d')](_0x40ed01,function(_0x233a1d){if(_0xc3d9eb[_0x233a1d[_0x3c22('0x1e')]]){_0x554570[_0x3c22('0x1f')]({'name':_0x233a1d[_0x3c22('0x20')],'value':_0xc3d9eb[_0x233a1d[_0x3c22('0x1e')]]});}});}return request({'form':{'method':_0x3c22('0x21'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3c22('0x22')]({'session':_0x4aa79d['id'],'module_name':'Calls','name_value_list':_0x554570})}});}function getAuth(_0x11b530){return util[_0x3c22('0x23')](_0x3c22('0x24'),new Buffer(_0x11b530[_0x3c22('0x25')]+':X')[_0x3c22('0x26')](_0x3c22('0x27')));}function getServerInfo(_0x40f697){return request({'form':{'method':_0x3c22('0x28'),'input_type':_0x3c22('0x29'),'response_type':_0x3c22('0x29'),'rest_data':JSON['stringify']({'session':_0x40f697['id']})}});}function getUser(_0x247f43,_0x3be4c8,_0x2e9ddd){if(!_[_0x3c22('0x2a')](_0x3be4c8)){logger[_0x3c22('0x2b')](_0x3c22('0x2c'),_0x3be4c8);return request({'form':{'method':'get_entry_list','input_type':_0x3c22('0x29'),'response_type':_0x3c22('0x29'),'rest_data':JSON[_0x3c22('0x22')]({'session':_0x2e9ddd['id'],'module_name':_0x3c22('0x2d'),'query':util['format'](_0x3c22('0x2e'),_0x3be4c8),'order_by':'','offset':'0','select_fields':['id',_0x3c22('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3c22('0x2f')](function(_0x323cf6){if(_0x323cf6[_0x3c22('0x30')][_0x3c22('0x1c')]){var _0x2ba8bf=_[_0x3c22('0x31')](_0x323cf6[_0x3c22('0x30')],function(_0x182abe){return _0x182abe[_0x3c22('0x32')]['user_name']['value']===_0x3be4c8;});if(_0x2ba8bf){logger[_0x3c22('0x2b')](_0x3c22('0x33'));return BPromise['resolve']({'id':_0x2ba8bf['name_value_list']['id']['value'],'name':_0x2ba8bf[_0x3c22('0x32')][_0x3c22('0xd')][_0x3c22('0x34')]});}}logger[_0x3c22('0x2b')](_0x3c22('0x35'));return BPromise[_0x3c22('0x36')]({'id':_0x2e9ddd[_0x3c22('0x32')][_0x3c22('0x37')][_0x3c22('0x34')],'name':_0x2e9ddd['name_value_list']['user_name'][_0x3c22('0x34')]});});}else{logger[_0x3c22('0x2b')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2e9ddd[_0x3c22('0x32')][_0x3c22('0x37')]['value'],'name':_0x2e9ddd[_0x3c22('0x32')][_0x3c22('0x38')]['value']});}}function getEndUser(_0x1caee1,_0xdd2a24,_0x5d6fb4,_0x4ef3f4){logger[_0x3c22('0x2b')](_0x3c22('0x39'),_0x5d6fb4);return request({'form':{'method':_0x3c22('0x3a'),'input_type':_0x3c22('0x29'),'response_type':'JSON','rest_data':JSON[_0x3c22('0x22')]({'session':_0x4ef3f4['id'],'module_name':'Contacts','query':util[_0x3c22('0x23')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x5d6fb4),'order_by':'','offset':'0','select_fields':['id','name',_0x3c22('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3c22('0x2f')](function(_0x3b8ebc){if(_0x3b8ebc['entry_list'][_0x3c22('0x1c')]){var _0x18e608=_[_0x3c22('0x31')](_0x3b8ebc[_0x3c22('0x30')],function(_0x30afba){return _0x30afba[_0x3c22('0x32')][_0x3c22('0x3b')]['value']===_0x5d6fb4;});if(_0x18e608){logger['info']('Enduser\x20found!');return BPromise[_0x3c22('0x36')]({'id':_0x18e608[_0x3c22('0x32')]['id'][_0x3c22('0x34')],'name':_0x18e608['name_value_list'][_0x3c22('0xd')][_0x3c22('0x34')],'phone':_0x18e608[_0x3c22('0x32')][_0x3c22('0x3b')][_0x3c22('0x34')]});}}else{logger[_0x3c22('0x2b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':_0x3c22('0x29'),'response_type':_0x3c22('0x29'),'rest_data':JSON[_0x3c22('0x22')]({'session':_0x4ef3f4['id'],'module_name':'Contacts','name_value_list':[{'name':_0x3c22('0x3c'),'value':_0xdd2a24!==_0x3c22('0x3d')?_0xdd2a24:util['format'](_0x3c22('0x3e'),_0x5d6fb4)},{'name':_0x3c22('0x3b'),'value':_0x5d6fb4}]})}})[_0x3c22('0x2f')](function(_0xeeec91){logger[_0x3c22('0x2b')](_0x3c22('0x3f'));return BPromise[_0x3c22('0x36')]({'id':_0xeeec91['id'],'name':_0xeeec91[_0x3c22('0x30')][_0x3c22('0x3c')][_0x3c22('0x34')],'phone':_0xeeec91['entry_list']['phone_home'][_0x3c22('0x34')]});});}});}function request(_0x22cf1f){logger['debug'](_0x3c22('0x40'),JSON[_0x3c22('0x22')](_0x22cf1f));return rp(_[_0x3c22('0x41')](def,_0x22cf1f));}function getTags(_0x29d739,_0x3b6660){var _0x228adb=[];if(_0x29d739&&_0x29d739[_0x3c22('0x1c')]>0x0){_0x228adb=_[_0x3c22('0x42')](_0x29d739,_0x3b6660);}return _0x228adb;}function getCustomFields(_0x1dd890,_0x2b5bc2){var _0x32f87c=[];var _0x559290={'custom_fields':[]};if(_0x1dd890['length']>0x0){_[_0x3c22('0x1d')](_0x1dd890,function(_0x5c800b){if(_0x5c800b[_0x3c22('0x43')]===_0x3c22('0x44')&&_0x5c800b[_0x3c22('0x45')]&&!_0x5c800b[_0x3c22('0x46')]){_0x559290[_0x5c800b[_0x3c22('0x45')][_0x3c22('0x47')]()]=_0x5c800b[_0x3c22('0x48')][_0x3c22('0x26')]();}else if(_0x5c800b[_0x3c22('0x43')]===_0x3c22('0x44')&&_0x5c800b[_0x3c22('0x20')]&&_0x5c800b[_0x3c22('0x46')]){_0x559290[_0x3c22('0x49')][_0x3c22('0x1f')]({'id':_0x5c800b[_0x3c22('0x20')],'value':_0x5c800b[_0x3c22('0x48')][_0x3c22('0x26')]()});}else if(_0x5c800b[_0x3c22('0x43')]===_0x3c22('0x4a')&&_0x5c800b['variableName']&&_0x5c800b[_0x3c22('0x20')]&&_0x5c800b[_0x3c22('0x46')]){_0x2b5bc2[_0x5c800b[_0x3c22('0x1e')]]&&_0x559290[_0x3c22('0x49')][_0x3c22('0x1f')]({'id':_0x5c800b[_0x3c22('0x20')],'value':_0x2b5bc2[_0x5c800b[_0x3c22('0x1e')]][_0x3c22('0x26')]()});}else if(_0x5c800b[_0x3c22('0x43')]===_0x3c22('0x4b')&&_0x5c800b[_0x3c22('0x4c')]&&_0x5c800b[_0x3c22('0x4c')][_0x3c22('0xd')]&&_0x5c800b[_0x3c22('0x20')]&&_0x5c800b[_0x3c22('0x46')]){_0x2b5bc2[_0x5c800b['Variable'][_0x3c22('0xd')][_0x3c22('0x47')]()]&&_0x559290['custom_fields'][_0x3c22('0x1f')]({'id':_0x5c800b['idField'],'value':_0x2b5bc2[_0x5c800b[_0x3c22('0x4c')][_0x3c22('0xd')][_0x3c22('0x47')]()][_0x3c22('0x26')]()});}});}return _0x559290;}function getConnection(_0x142295){return request({'method':_0x3c22('0xb'),'form':{'method':_0x3c22('0x4d'),'input_type':_0x3c22('0x29'),'response_type':_0x3c22('0x29'),'rest_data':JSON[_0x3c22('0x22')]({'user_auth':{'user_name':_0x142295[_0x3c22('0x4e')],'password':_0x142295[_0x3c22('0x4f')],'encryption':_0x3c22('0x50')},'application':_0x3c22('0x51')})}})[_0x3c22('0x2f')](function(_0x5f2d3e){var _0x1ecf55=_0x5f2d3e;if(_0x1ecf55['id']){def[_0x3c22('0x52')]=_0x1ecf55['id'];return BPromise[_0x3c22('0x36')](_0x1ecf55);}else{throw new Error(util[_0x3c22('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x142295['id']));}});}function setRelationship(_0x3598b8,_0x593e43,_0x518132,_0x35f123){return request({'form':{'method':_0x3c22('0x53'),'input_type':_0x3c22('0x29'),'response_type':'JSON','rest_data':JSON[_0x3c22('0x22')]({'session':_0x3598b8['id'],'module_name':_0x3c22('0x54'),'module_id':_0x518132['id'],'link_field_name':_0x35f123,'related_ids':[_0x593e43['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3c22('0x55')]=function(_0x1a8acb,_0x37a803,_0x2615a0,_0x37e00d,_0x2c73a2,_0x302bdf){var _0x3cbaac,_0x372b00,_0x22f027,_0x3e51b6;_0x302bdf[_0x3c22('0x56')]=intUtil['stripTrailingSlash'](_0x302bdf[_0x3c22('0x56')]);_0x302bdf[_0x3c22('0x57')]=intUtil['stripTrailingSlash'](_0x302bdf['serverUrl']);def[_0x3c22('0x58')]=util[_0x3c22('0x23')](_0x3c22('0x59'),_0x302bdf['remoteUri']);if(_0x2c73a2&&_0x2c73a2['monitor_format']){logger[_0x3c22('0x2b')](_0x3c22('0x5a'),_0x3c22('0x5b'));_0x37a803[_0x3c22('0x5c')]=util[_0x3c22('0x23')](_0x3c22('0x5d'),_0x302bdf[_0x3c22('0x57')],_0x37a803[_0x3c22('0x5e')],md5(_0x37a803[_0x3c22('0x5e')]));}else{_0x37a803[_0x3c22('0x5c')]='';}return getConnection(_0x302bdf)[_0x3c22('0x2f')](function(_0x2cf4ce){_0x3e51b6=_0x2cf4ce;return getUser(_0x302bdf,_0x37e00d[_0x3c22('0xd')],_0x3e51b6);})[_0x3c22('0x2f')](function(_0x4f8566){_0x3cbaac=_0x4f8566;logger[_0x3c22('0x2b')](_0x3c22('0x5f'),_0x3cbaac['id']);return getEndUser(_0x302bdf,_0x37a803[_0x3c22('0x60')],_0x37a803[_0x3c22('0x61')],_0x3e51b6);})[_0x3c22('0x2f')](function(_0x124de9){_0x372b00=_0x124de9;logger[_0x3c22('0x2b')](_0x3c22('0x62'),_0x372b00['id']);return getTicket(_0x302bdf,_0x3cbaac,_0x372b00,_0x2615a0,_0x37a803,_0x2615a0[_0x3c22('0x63')],_0x3e51b6,_0x3c22('0x64'));})[_0x3c22('0x2f')](function(_0x13dfca){_0x22f027=_0x13dfca;logger[_0x3c22('0x2b')](_0x3c22('0x65'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x22f027['id']);return setRelationship(_0x3e51b6,_0x3cbaac,_0x22f027,_0x3c22('0x66'));})[_0x3c22('0x2f')](function(){return setRelationship(_0x3e51b6,_0x372b00,_0x22f027,_0x3c22('0x67'));})[_0x3c22('0x2f')](function(){return getServerInfo(_0x3e51b6);})[_0x3c22('0x2f')](function(_0x2c0956){var _0xb3b700=parseInt(_0x2c0956[_0x3c22('0x68')][_0x3c22('0x69')](0x0));var _0x4447fc=util[_0x3c22('0x23')](_0x3c22('0x6a'),_0x302bdf[_0x3c22('0x56')],_0x22f027['id']);if(_0xb3b700>0x6){_0x4447fc=util[_0x3c22('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x302bdf['remoteUri'],_0x22f027['id']);}logger[_0x3c22('0x2b')](_0x3c22('0x5a'),_0x3c22('0x6b'));emit(util['format'](_0x3c22('0x6c'),_0x37e00d[_0x3c22('0xd')]),_0x3c22('0x6d'),{'uri':_0x4447fc});})[_0x3c22('0x6e')](function(_0xf9d0e4){logger[_0x3c22('0x6f')](_0x3c22('0x5a'),JSON[_0x3c22('0x22')](_0xf9d0e4));});};exports[_0x3c22('0x70')]=function(_0x5706b4,_0x5a3360,_0xb9fc8,_0x2153e1,_0x38f387,_0x32a584,_0x4a43d9){var _0xfd787e,_0x101f98,_0x24350a,_0xe80030;_0x32a584[_0x3c22('0x56')]=intUtil[_0x3c22('0x71')](_0x32a584['remoteUri']);_0x32a584[_0x3c22('0x57')]=intUtil[_0x3c22('0x71')](_0x32a584[_0x3c22('0x57')]);def[_0x3c22('0x58')]=util[_0x3c22('0x23')](_0x3c22('0x59'),_0x32a584[_0x3c22('0x56')]);if(_0x4a43d9&&_0x4a43d9['recordingFormat']&&_0x4a43d9[_0x3c22('0x72')]!=='none'){logger[_0x3c22('0x2b')](_0x3c22('0x73'),'Recording\x20is\x20enabled!');_0x5a3360[_0x3c22('0x5c')]=util[_0x3c22('0x23')](_0x3c22('0x5d'),_0x32a584['serverUrl'],_0x5a3360[_0x3c22('0x5e')],md5(_0x5a3360[_0x3c22('0x5e')]));}return getConnection(_0x32a584)[_0x3c22('0x2f')](function(_0x3464b3){_0xe80030=_0x3464b3;return getUser(_0x32a584,_0x2153e1[_0x3c22('0xd')],_0xe80030);})['then'](function(_0x4230aa){_0xfd787e=_0x4230aa;logger[_0x3c22('0x2b')](_0x3c22('0x5f'),_0xfd787e['id']);return getEndUser(_0x32a584,_0x5a3360['destcalleridname'],_0x5a3360['destcalleridnum'],_0xe80030);})[_0x3c22('0x2f')](function(_0x28c4ec){_0x101f98=_0x28c4ec;logger[_0x3c22('0x2b')](_0x3c22('0x62'),_0x101f98['id']);return getTicket(_0x32a584,_0xfd787e,_0x101f98,_0xb9fc8,_0x5a3360,_0xb9fc8[_0x3c22('0x63')],_0xe80030,'Outbound');})[_0x3c22('0x2f')](function(_0x3771bf){_0x24350a=_0x3771bf;logger[_0x3c22('0x2b')](_0x3c22('0x65'));logger[_0x3c22('0x2b')](_0x3c22('0x74'),_0x24350a['id']);return setRelationship(_0xe80030,_0xfd787e,_0x24350a,_0x3c22('0x66'));})[_0x3c22('0x2f')](function(){return setRelationship(_0xe80030,_0x101f98,_0x24350a,'contacts');})['then'](function(){return getServerInfo(_0xe80030);})[_0x3c22('0x2f')](function(_0x20f603){var _0x402c24=parseInt(_0x20f603[_0x3c22('0x68')]['charAt'](0x0));var _0x26a3a0=util[_0x3c22('0x23')](_0x3c22('0x6a'),_0x32a584[_0x3c22('0x56')],_0x24350a['id']);if(_0x402c24>0x6){_0x26a3a0=util[_0x3c22('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x32a584[_0x3c22('0x56')],_0x24350a['id']);}logger[_0x3c22('0x2b')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3c22('0x23')]('user:%s',_0x2153e1['name']),_0x3c22('0x6d'),{'uri':_0x26a3a0});})['catch'](function(_0xdbfcdf){logger['error'](_0x3c22('0x73'),JSON[_0x3c22('0x22')](_0xdbfcdf));});};exports['unmanaged']=function(_0x1e738f,_0xfa3557,_0x3ea16e,_0x549da0,_0x1f92ae,_0x20e4b2){var _0x3b7f8e,_0x12ce21,_0x39175a,_0x5ba39a;_0x20e4b2[_0x3c22('0x56')]=intUtil[_0x3c22('0x71')](_0x20e4b2[_0x3c22('0x56')]);_0x20e4b2[_0x3c22('0x57')]=intUtil[_0x3c22('0x71')](_0x20e4b2[_0x3c22('0x57')]);def['uri']=util[_0x3c22('0x23')](_0x3c22('0x59'),_0x20e4b2[_0x3c22('0x56')]);if(_0x1f92ae&&_0x1f92ae['monitor_format']){logger[_0x3c22('0x2b')]('['+_0xfa3557[_0x3c22('0x75')][_0x3c22('0x76')]()+']',_0x3c22('0x5b'));_0xfa3557['recordingURL']=util[_0x3c22('0x23')](_0x3c22('0x5d'),_0x20e4b2[_0x3c22('0x57')],_0xfa3557[_0x3c22('0x5e')],md5(_0xfa3557['uniqueid']));}else{_0xfa3557[_0x3c22('0x5c')]='';}return getConnection(_0x20e4b2)[_0x3c22('0x2f')](function(_0x51394e){_0x5ba39a=_0x51394e;if(!_[_0x3c22('0x2a')](_0x549da0)){return getUser(_0x20e4b2,_0x549da0[_0x3c22('0xd')],_0x5ba39a);}else{return getUser(_0x20e4b2,null,_0x5ba39a);}})['then'](function(_0x15a946){_0x3b7f8e=_0x15a946;logger['info'](_0x3c22('0x5f'),_0x3b7f8e['id']);return getEndUser(_0x20e4b2,_0xfa3557[_0x3c22('0x60')],_0xfa3557[_0x3c22('0x61')],_0x5ba39a);})[_0x3c22('0x2f')](function(_0x25b63b){_0x12ce21=_0x25b63b;logger[_0x3c22('0x2b')](_0x3c22('0x62'),_0x12ce21['id']);return getTicket(_0x20e4b2,_0x3b7f8e,_0x12ce21,_0x3ea16e,_0xfa3557,_0x3ea16e[_0x3c22('0x63')],_0x5ba39a,'Inbound');})[_0x3c22('0x2f')](function(_0x26bf51){_0x39175a=_0x26bf51;logger[_0x3c22('0x2b')](_0x3c22('0x65'));logger['info'](_0x3c22('0x74'),_0x39175a['id']);return setRelationship(_0x5ba39a,_0x3b7f8e,_0x39175a,_0x3c22('0x66'));})[_0x3c22('0x2f')](function(){return setRelationship(_0x5ba39a,_0x12ce21,_0x39175a,'contacts');})[_0x3c22('0x2f')](function(){return getServerInfo(_0x5ba39a);})[_0x3c22('0x6e')](function(_0x13e821){logger[_0x3c22('0x6f')]('['+_0xfa3557[_0x3c22('0x75')][_0x3c22('0x76')]()+']',JSON[_0x3c22('0x22')](_0x13e821));});}; \ No newline at end of file +var _0x4be0=['Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','Outbound','Ticket\x20created!','version','unmanaged','lastevent','toUpperCase','isNil','calleridname','Inbound','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','redis','localhost','POST','emit','name','Subjects','description','getString','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','length','forEach','variableName','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','base64','info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','custom_fields','push','content','variable','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID'];(function(_0x38c643,_0x2a120f){var _0x195fcd=function(_0xff3815){while(--_0xff3815){_0x38c643['push'](_0x38c643['shift']());}};_0x195fcd(++_0x2a120f);}(_0x4be0,0x1f1));var _0x04be=function(_0x3959dc,_0x37c963){_0x3959dc=_0x3959dc-0x0;var _0x3b3656=_0x4be0[_0x3959dc];return _0x3b3656;};'use strict';var _=require('lodash');var rp=require(_0x04be('0x0'));var BPromise=require(_0x04be('0x1'));var md5=require('md5');var util=require(_0x04be('0x2'));var Redis=require(_0x04be('0x3'));var intUtil=require(_0x04be('0x4'));var config=require(_0x04be('0x5'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x04be('0x6')]=_['defaults'](config[_0x04be('0x6')],{'host':_0x04be('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x04be('0x6')]));var def={'method':_0x04be('0x8'),'json':!![]};function emit(_0x151893,_0x3c0222,_0x4f7009){io['to'](_0x151893)[_0x04be('0x9')](_0x3c0222,_0x4f7009);}function getTicket(_0x415d74,_0x397721,_0x494acf,_0x4dff75,_0x18b0ef,_0x45c049,_0x3e9b34,_0x213a2b){logger['info']('Creating\x20new\x20ticket...');var _0x3a1bb1=new Date();var _0x1bd2a8=[{'name':_0x04be('0xa'),'value':intUtil['getString'](_0x4dff75[_0x04be('0xb')],_0x18b0ef,'\x20')},{'name':'assigned_user_id','value':_0x397721['id']},{'name':'created_by','value':_0x397721['id']},{'name':_0x04be('0xc'),'value':intUtil[_0x04be('0xd')](_0x4dff75['Descriptions'],_0x18b0ef,'\x0a')},{'name':_0x04be('0xe'),'value':_0x3a1bb1[_0x04be('0xf')]()[_0x04be('0x10')](0x0,0x13)[_0x04be('0x11')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x04be('0x12'),'value':'15'},{'name':_0x04be('0x13'),'value':_0x494acf['id']},{'name':_0x04be('0x14'),'value':'Contacts'},{'name':'parent_name','value':_0x494acf[_0x04be('0xa')]},{'name':'direction','value':_0x213a2b}];if(_0x45c049[_0x04be('0x15')]){_[_0x04be('0x16')](_0x45c049,function(_0x2fba76){if(_0x18b0ef[_0x2fba76[_0x04be('0x17')]]){_0x1bd2a8['push']({'name':_0x2fba76[_0x04be('0x18')],'value':_0x18b0ef[_0x2fba76[_0x04be('0x17')]]});}});}return request({'form':{'method':_0x04be('0x19'),'input_type':_0x04be('0x1a'),'response_type':_0x04be('0x1a'),'rest_data':JSON[_0x04be('0x1b')]({'session':_0x3e9b34['id'],'module_name':'Calls','name_value_list':_0x1bd2a8})}});}function getAuth(_0x489a2f){return util[_0x04be('0x1c')](_0x04be('0x1d'),new Buffer(_0x489a2f[_0x04be('0x1e')]+':X')[_0x04be('0x1f')](_0x04be('0x20')));}function getServerInfo(_0x2910dc){return request({'form':{'method':'get_server_info','input_type':'JSON','response_type':_0x04be('0x1a'),'rest_data':JSON[_0x04be('0x1b')]({'session':_0x2910dc['id']})}});}function getUser(_0x3051e8,_0x26bde,_0xa327b5){if(!_['isNil'](_0x26bde)){logger[_0x04be('0x21')](_0x04be('0x22'),_0x26bde);return request({'form':{'method':_0x04be('0x23'),'input_type':_0x04be('0x1a'),'response_type':'JSON','rest_data':JSON[_0x04be('0x1b')]({'session':_0xa327b5['id'],'module_name':_0x04be('0x24'),'query':util[_0x04be('0x1c')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x26bde),'order_by':'','offset':'0','select_fields':['id','name',_0x04be('0x25')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x04be('0x26')](function(_0x554e26){if(_0x554e26[_0x04be('0x27')][_0x04be('0x15')]){var _0x5f03bf=_['find'](_0x554e26[_0x04be('0x27')],function(_0xb6034){return _0xb6034[_0x04be('0x28')][_0x04be('0x25')][_0x04be('0x29')]===_0x26bde;});if(_0x5f03bf){logger['info'](_0x04be('0x2a'));return BPromise[_0x04be('0x2b')]({'id':_0x5f03bf['name_value_list']['id'][_0x04be('0x29')],'name':_0x5f03bf[_0x04be('0x28')][_0x04be('0xa')]['value']});}}logger[_0x04be('0x21')](_0x04be('0x2c'));return BPromise[_0x04be('0x2b')]({'id':_0xa327b5['name_value_list']['user_id'][_0x04be('0x29')],'name':_0xa327b5[_0x04be('0x28')][_0x04be('0x25')][_0x04be('0x29')]});});}else{logger[_0x04be('0x21')](_0x04be('0x2d'));return BPromise[_0x04be('0x2b')]({'id':_0xa327b5[_0x04be('0x28')]['user_id'][_0x04be('0x29')],'name':_0xa327b5[_0x04be('0x28')]['user_name'][_0x04be('0x29')]});}}function getEndUser(_0x9e46a8,_0x3ad8ff,_0x443bb7,_0x1b5d2a){logger[_0x04be('0x21')](_0x04be('0x2e'),_0x443bb7);return request({'form':{'method':_0x04be('0x23'),'input_type':_0x04be('0x1a'),'response_type':_0x04be('0x1a'),'rest_data':JSON[_0x04be('0x1b')]({'session':_0x1b5d2a['id'],'module_name':_0x04be('0x2f'),'query':util[_0x04be('0x1c')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x443bb7),'order_by':'','offset':'0','select_fields':['id',_0x04be('0xa'),_0x04be('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2ac172){if(_0x2ac172['entry_list'][_0x04be('0x15')]){var _0x464b3e=_['find'](_0x2ac172[_0x04be('0x27')],function(_0x19db64){return _0x19db64['name_value_list'][_0x04be('0x30')][_0x04be('0x29')]===_0x443bb7;});if(_0x464b3e){logger['info']('Enduser\x20found!');return BPromise[_0x04be('0x2b')]({'id':_0x464b3e[_0x04be('0x28')]['id']['value'],'name':_0x464b3e['name_value_list'][_0x04be('0xa')][_0x04be('0x29')],'phone':_0x464b3e['name_value_list'][_0x04be('0x30')]['value']});}}else{logger['info'](_0x04be('0x31'));return request({'form':{'method':_0x04be('0x19'),'input_type':'JSON','response_type':_0x04be('0x1a'),'rest_data':JSON[_0x04be('0x1b')]({'session':_0x1b5d2a['id'],'module_name':_0x04be('0x2f'),'name_value_list':[{'name':_0x04be('0x32'),'value':_0x3ad8ff!==_0x04be('0x33')?_0x3ad8ff:util['format'](_0x04be('0x34'),_0x443bb7)},{'name':_0x04be('0x30'),'value':_0x443bb7}]})}})[_0x04be('0x26')](function(_0x22e7de){logger['info']('Enduser\x20created.');return BPromise[_0x04be('0x2b')]({'id':_0x22e7de['id'],'name':_0x22e7de[_0x04be('0x27')][_0x04be('0x32')][_0x04be('0x29')],'phone':_0x22e7de[_0x04be('0x27')][_0x04be('0x30')][_0x04be('0x29')]});});}});}function request(_0x2c4613){logger[_0x04be('0x35')](_0x04be('0x36'),JSON[_0x04be('0x1b')](_0x2c4613));return rp(_[_0x04be('0x37')](def,_0x2c4613));}function getTags(_0x31e346,_0x4c0d14){var _0x2d4aaf=[];if(_0x31e346&&_0x31e346[_0x04be('0x15')]>0x0){_0x2d4aaf=_[_0x04be('0x38')](_0x31e346,_0x4c0d14);}return _0x2d4aaf;}function getCustomFields(_0x19f95d,_0x4f5005){var _0x270f8a=[];var _0x1392ba={'custom_fields':[]};if(_0x19f95d[_0x04be('0x15')]>0x0){_[_0x04be('0x16')](_0x19f95d,function(_0x5619bd){if(_0x5619bd[_0x04be('0x39')]===_0x04be('0x3a')&&_0x5619bd[_0x04be('0x3b')]&&!_0x5619bd[_0x04be('0x3c')]){_0x1392ba[_0x5619bd[_0x04be('0x3b')][_0x04be('0x3d')]()]=_0x5619bd['content']['toString']();}else if(_0x5619bd['type']===_0x04be('0x3a')&&_0x5619bd[_0x04be('0x18')]&&_0x5619bd[_0x04be('0x3c')]){_0x1392ba[_0x04be('0x3e')][_0x04be('0x3f')]({'id':_0x5619bd['idField'],'value':_0x5619bd[_0x04be('0x40')][_0x04be('0x1f')]()});}else if(_0x5619bd[_0x04be('0x39')]===_0x04be('0x41')&&_0x5619bd['variableName']&&_0x5619bd[_0x04be('0x18')]&&_0x5619bd[_0x04be('0x3c')]){_0x4f5005[_0x5619bd[_0x04be('0x17')]]&&_0x1392ba[_0x04be('0x3e')][_0x04be('0x3f')]({'id':_0x5619bd[_0x04be('0x18')],'value':_0x4f5005[_0x5619bd[_0x04be('0x17')]][_0x04be('0x1f')]()});}else if(_0x5619bd[_0x04be('0x39')]===_0x04be('0x42')&&_0x5619bd[_0x04be('0x43')]&&_0x5619bd['Variable']['name']&&_0x5619bd[_0x04be('0x18')]&&_0x5619bd['customField']){_0x4f5005[_0x5619bd[_0x04be('0x43')][_0x04be('0xa')][_0x04be('0x3d')]()]&&_0x1392ba[_0x04be('0x3e')]['push']({'id':_0x5619bd[_0x04be('0x18')],'value':_0x4f5005[_0x5619bd[_0x04be('0x43')]['name']['toLowerCase']()][_0x04be('0x1f')]()});}});}return _0x1392ba;}function getConnection(_0x682d27){return request({'method':_0x04be('0x8'),'form':{'method':'login','input_type':_0x04be('0x1a'),'response_type':_0x04be('0x1a'),'rest_data':JSON[_0x04be('0x1b')]({'user_auth':{'user_name':_0x682d27[_0x04be('0x44')],'password':_0x682d27[_0x04be('0x45')],'encryption':_0x04be('0x46')},'application':_0x04be('0x47')})}})[_0x04be('0x26')](function(_0x30bad4){var _0x5e537f=_0x30bad4;if(_0x5e537f['id']){def[_0x04be('0x48')]=_0x5e537f['id'];return BPromise[_0x04be('0x2b')](_0x5e537f);}else{throw new Error(util[_0x04be('0x1c')](_0x04be('0x49'),_0x682d27['id']));}});}function setRelationship(_0x29d915,_0x472f67,_0x3f84f1,_0x4e00f4){return request({'form':{'method':_0x04be('0x4a'),'input_type':'JSON','response_type':_0x04be('0x1a'),'rest_data':JSON[_0x04be('0x1b')]({'session':_0x29d915['id'],'module_name':_0x04be('0x4b'),'module_id':_0x3f84f1['id'],'link_field_name':_0x4e00f4,'related_ids':[_0x472f67['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x04be('0x4c')]=function(_0x560b5c,_0x205623,_0x24327a,_0x37451,_0x292d28,_0x26576e){var _0x3d5ed0,_0x2787ac,_0x38d4af,_0x19c296;_0x26576e[_0x04be('0x4d')]=intUtil['stripTrailingSlash'](_0x26576e[_0x04be('0x4d')]);_0x26576e[_0x04be('0x4e')]=intUtil[_0x04be('0x4f')](_0x26576e[_0x04be('0x4e')]);def[_0x04be('0x50')]=util[_0x04be('0x1c')]('%s/service/v4_1/rest.php',_0x26576e[_0x04be('0x4d')]);if(_0x292d28&&_0x292d28[_0x04be('0x51')]){logger[_0x04be('0x21')](_0x04be('0x52'),_0x04be('0x53'));_0x205623[_0x04be('0x54')]=util[_0x04be('0x1c')](_0x04be('0x55'),_0x26576e[_0x04be('0x4e')],_0x205623[_0x04be('0x56')],md5(_0x205623[_0x04be('0x56')]));}else{_0x205623[_0x04be('0x54')]='';}return getConnection(_0x26576e)['then'](function(_0x295b20){_0x19c296=_0x295b20;return getUser(_0x26576e,_0x37451[_0x04be('0xa')],_0x19c296);})[_0x04be('0x26')](function(_0xaaada5){_0x3d5ed0=_0xaaada5;logger[_0x04be('0x21')](_0x04be('0x57'),_0x3d5ed0['id']);return getEndUser(_0x26576e,_0x205623['calleridname'],_0x205623[_0x04be('0x58')],_0x19c296);})[_0x04be('0x26')](function(_0x78d311){_0x2787ac=_0x78d311;logger[_0x04be('0x21')](_0x04be('0x59'),_0x2787ac['id']);return getTicket(_0x26576e,_0x3d5ed0,_0x2787ac,_0x24327a,_0x205623,_0x24327a[_0x04be('0x5a')],_0x19c296,'Inbound');})[_0x04be('0x26')](function(_0x55035f){_0x38d4af=_0x55035f;logger[_0x04be('0x21')]('Ticket\x20created!');logger['info'](_0x04be('0x5b'),_0x38d4af['id']);return setRelationship(_0x19c296,_0x3d5ed0,_0x38d4af,_0x04be('0x5c'));})[_0x04be('0x26')](function(){return setRelationship(_0x19c296,_0x2787ac,_0x38d4af,_0x04be('0x5d'));})[_0x04be('0x26')](function(){return getServerInfo(_0x19c296);})[_0x04be('0x26')](function(_0x2a608d){var _0x55e374=parseInt(_0x2a608d['version'][_0x04be('0x5e')](0x0));var _0x2576f5=util[_0x04be('0x1c')](_0x04be('0x5f'),_0x26576e[_0x04be('0x4d')],_0x38d4af['id']);if(_0x55e374>0x6){_0x2576f5=util[_0x04be('0x1c')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x26576e['remoteUri'],_0x38d4af['id']);}logger['info'](_0x04be('0x52'),_0x04be('0x60'));emit(util[_0x04be('0x1c')](_0x04be('0x61'),_0x37451[_0x04be('0xa')]),_0x04be('0x62'),{'uri':_0x2576f5});})[_0x04be('0x63')](function(_0x4a44b9){logger[_0x04be('0x64')]('[QUEUE]',JSON[_0x04be('0x1b')](_0x4a44b9));});};exports[_0x04be('0x65')]=function(_0x4e2c4f,_0x4b280d,_0x5e1e97,_0xceb81,_0x5bce12,_0x1c31ee,_0x5e2c13){var _0x130b3f,_0x2cc29b,_0x1736b0,_0x1afe49;_0x1c31ee[_0x04be('0x4d')]=intUtil[_0x04be('0x4f')](_0x1c31ee[_0x04be('0x4d')]);_0x1c31ee['serverUrl']=intUtil[_0x04be('0x4f')](_0x1c31ee[_0x04be('0x4e')]);def[_0x04be('0x50')]=util['format']('%s/service/v4_1/rest.php',_0x1c31ee[_0x04be('0x4d')]);if(_0x5e2c13&&_0x5e2c13[_0x04be('0x66')]&&_0x5e2c13[_0x04be('0x66')]!=='none'){logger[_0x04be('0x21')](_0x04be('0x67'),_0x04be('0x53'));_0x4b280d['recordingURL']=util[_0x04be('0x1c')](_0x04be('0x55'),_0x1c31ee[_0x04be('0x4e')],_0x4b280d[_0x04be('0x56')],md5(_0x4b280d[_0x04be('0x56')]));}return getConnection(_0x1c31ee)['then'](function(_0xa87ee3){_0x1afe49=_0xa87ee3;return getUser(_0x1c31ee,_0xceb81['name'],_0x1afe49);})[_0x04be('0x26')](function(_0x517c76){_0x130b3f=_0x517c76;logger[_0x04be('0x21')](_0x04be('0x57'),_0x130b3f['id']);return getEndUser(_0x1c31ee,_0x4b280d['destcalleridname'],_0x4b280d[_0x04be('0x68')],_0x1afe49);})[_0x04be('0x26')](function(_0x2ff02c){_0x2cc29b=_0x2ff02c;logger[_0x04be('0x21')](_0x04be('0x59'),_0x2cc29b['id']);return getTicket(_0x1c31ee,_0x130b3f,_0x2cc29b,_0x5e1e97,_0x4b280d,_0x5e1e97[_0x04be('0x5a')],_0x1afe49,_0x04be('0x69'));})[_0x04be('0x26')](function(_0x232772){_0x1736b0=_0x232772;logger[_0x04be('0x21')](_0x04be('0x6a'));logger[_0x04be('0x21')](_0x04be('0x5b'),_0x1736b0['id']);return setRelationship(_0x1afe49,_0x130b3f,_0x1736b0,'users');})[_0x04be('0x26')](function(){return setRelationship(_0x1afe49,_0x2cc29b,_0x1736b0,_0x04be('0x5d'));})['then'](function(){return getServerInfo(_0x1afe49);})['then'](function(_0x2de383){var _0x2d7116=parseInt(_0x2de383[_0x04be('0x6b')][_0x04be('0x5e')](0x0));var _0x32c96d=util[_0x04be('0x1c')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1c31ee[_0x04be('0x4d')],_0x1736b0['id']);if(_0x2d7116>0x6){_0x32c96d=util[_0x04be('0x1c')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1c31ee['remoteUri'],_0x1736b0['id']);}logger[_0x04be('0x21')]('[OUTBOUND]',_0x04be('0x60'));emit(util['format']('user:%s',_0xceb81[_0x04be('0xa')]),'trigger:browser:url',{'uri':_0x32c96d});})[_0x04be('0x63')](function(_0x5c6de2){logger[_0x04be('0x64')]('[OUTBOUND]',JSON[_0x04be('0x1b')](_0x5c6de2));});};exports[_0x04be('0x6c')]=function(_0x24fe34,_0x4f9844,_0x52616d,_0xe28f6c,_0x487e92,_0x34aa99){var _0x1bb76f,_0x5b6d70,_0x24aa0a,_0x53fc0e;_0x34aa99[_0x04be('0x4d')]=intUtil[_0x04be('0x4f')](_0x34aa99[_0x04be('0x4d')]);_0x34aa99[_0x04be('0x4e')]=intUtil['stripTrailingSlash'](_0x34aa99[_0x04be('0x4e')]);def[_0x04be('0x50')]=util['format']('%s/service/v4_1/rest.php',_0x34aa99[_0x04be('0x4d')]);if(_0x487e92&&_0x487e92['monitor_format']){logger[_0x04be('0x21')]('['+_0x4f9844[_0x04be('0x6d')][_0x04be('0x6e')]()+']','Recording\x20is\x20enabled!');_0x4f9844[_0x04be('0x54')]=util[_0x04be('0x1c')](_0x04be('0x55'),_0x34aa99['serverUrl'],_0x4f9844[_0x04be('0x56')],md5(_0x4f9844[_0x04be('0x56')]));}else{_0x4f9844[_0x04be('0x54')]='';}return getConnection(_0x34aa99)[_0x04be('0x26')](function(_0x221a5f){_0x53fc0e=_0x221a5f;if(!_[_0x04be('0x6f')](_0xe28f6c)){return getUser(_0x34aa99,_0xe28f6c[_0x04be('0xa')],_0x53fc0e);}else{return getUser(_0x34aa99,null,_0x53fc0e);}})['then'](function(_0x222acc){_0x1bb76f=_0x222acc;logger[_0x04be('0x21')](_0x04be('0x57'),_0x1bb76f['id']);return getEndUser(_0x34aa99,_0x4f9844[_0x04be('0x70')],_0x4f9844[_0x04be('0x58')],_0x53fc0e);})[_0x04be('0x26')](function(_0xf0ee4b){_0x5b6d70=_0xf0ee4b;logger[_0x04be('0x21')]('The\x20Enduser\x20ID\x20is:',_0x5b6d70['id']);return getTicket(_0x34aa99,_0x1bb76f,_0x5b6d70,_0x52616d,_0x4f9844,_0x52616d[_0x04be('0x5a')],_0x53fc0e,_0x04be('0x71'));})[_0x04be('0x26')](function(_0x402a0a){_0x24aa0a=_0x402a0a;logger[_0x04be('0x21')](_0x04be('0x6a'));logger[_0x04be('0x21')](_0x04be('0x5b'),_0x24aa0a['id']);return setRelationship(_0x53fc0e,_0x1bb76f,_0x24aa0a,_0x04be('0x5c'));})[_0x04be('0x26')](function(){return setRelationship(_0x53fc0e,_0x5b6d70,_0x24aa0a,'contacts');})[_0x04be('0x26')](function(){return getServerInfo(_0x53fc0e);})[_0x04be('0x63')](function(_0x340f62){logger[_0x04be('0x64')]('['+_0x4f9844[_0x04be('0x6d')][_0x04be('0x6e')]()+']',JSON[_0x04be('0x1b')](_0x340f62));});}; \ 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 9ad2b32..775cf52 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 _0x55a9=['push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','keyContent','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','util','getString','length','sortBy','type','string'];(function(_0x205d2b,_0xeebb7a){var _0x2f3c0f=function(_0x1afd5c){while(--_0x1afd5c){_0x205d2b['push'](_0x205d2b['shift']());}};_0x2f3c0f(++_0xeebb7a);}(_0x55a9,0x14a));var _0x955a=function(_0x1b5992,_0x398bc5){_0x1b5992=_0x1b5992-0x0;var _0x261dd0=_0x55a9[_0x1b5992];return _0x261dd0;};'use strict';var _=require('lodash');var util=require(_0x955a('0x0'));exports[_0x955a('0x1')]=function(_0x1fe191,_0x4c52b5,_0x984a88){var _0x5a9dfe=[];if(_0x1fe191[_0x955a('0x2')]>0x0){var _0x3936e9=_[_0x955a('0x3')](_0x1fe191,['id']);for(var _0x1f2142=0x0;_0x1f2142<_0x3936e9[_0x955a('0x2')];_0x1f2142++){var _0x8590a6=_0x3936e9[_0x1f2142];if(_0x8590a6[_0x955a('0x4')]===_0x955a('0x5')){_0x5a9dfe[_0x955a('0x6')](_0x8590a6[_0x955a('0x7')]);}else if(_0x8590a6[_0x955a('0x4')]===_0x955a('0x8')&&_0x8590a6['variableName']){_0x4c52b5[_0x8590a6['variableName']]&&_0x5a9dfe[_0x955a('0x6')](_0x4c52b5[_0x8590a6[_0x955a('0x9')]][_0x955a('0xa')]());}else if(_0x8590a6[_0x955a('0x4')]===_0x955a('0xb')&&_0x8590a6['Variable']&&_0x8590a6[_0x955a('0xc')][_0x955a('0xd')]){_0x4c52b5[_0x8590a6[_0x955a('0xc')][_0x955a('0xd')][_0x955a('0xe')]()]&&_0x5a9dfe['push'](_0x4c52b5[_0x8590a6[_0x955a('0xc')][_0x955a('0xd')][_0x955a('0xe')]()][_0x955a('0xa')]());}else if(_0x8590a6['type']===_0x955a('0xf')){if(_0x8590a6[_0x955a('0x10')]===_0x955a('0x5')&&_0x8590a6[_0x955a('0x11')]){_0x5a9dfe[_0x955a('0x6')](util['format']('%s:\x20%s',_0x8590a6[_0x955a('0x11')],_0x8590a6[_0x955a('0x12')]));}else if(_0x8590a6['keyType']===_0x955a('0x8')&&_0x8590a6[_0x955a('0x9')]&&_0x8590a6[_0x955a('0x11')]){_0x4c52b5[_0x8590a6[_0x955a('0x9')]]&&_0x5a9dfe[_0x955a('0x6')](util[_0x955a('0x13')](_0x955a('0x14'),_0x8590a6[_0x955a('0x11')],_0x4c52b5[_0x8590a6[_0x955a('0x9')]]));}else if(_0x8590a6['keyType']===_0x955a('0xb')&&_0x8590a6[_0x955a('0xc')]&&_0x8590a6['Variable'][_0x955a('0xd')]&&_0x8590a6[_0x955a('0x11')]){_0x4c52b5[_0x8590a6[_0x955a('0xc')][_0x955a('0xd')][_0x955a('0xe')]()]&&_0x5a9dfe[_0x955a('0x6')](util[_0x955a('0x13')](_0x955a('0x14'),_0x8590a6['key'],_0x4c52b5[_0x8590a6['Variable'][_0x955a('0xd')]['toLowerCase']()]));}}}}return _0x5a9dfe[_0x955a('0x15')](_0x984a88);};exports[_0x955a('0x16')]=function(_0x382385){var _0x163fad=_0x382385[_0x955a('0x17')](-0x1);if(_0x163fad==='/'){_0x382385=_0x382385[_0x955a('0x18')](0x0,_0x382385[_0x955a('0x19')](_0x163fad));}return _0x382385;};exports['validateEmail']=function(_0x40b869){if(!_[_0x955a('0x1a')](_0x40b869)&&_0x40b869!==''){var _0x11c88c=/^(([^<>()\[\]\\.,;:\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 _0x11c88c[_0x955a('0x1b')](String(_0x40b869)[_0x955a('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xe1d6=['validateEmail','isNil','lodash','util','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','key','keyContent','join','slice','substring','lastIndexOf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1d6,0xbf));var _0x6e1d=function(_0xad8f02,_0x3b94bf){_0xad8f02=_0xad8f02-0x0;var _0x36ab56=_0xe1d6[_0xad8f02];return _0x36ab56;};'use strict';var _=require(_0x6e1d('0x0'));var util=require(_0x6e1d('0x1'));exports['getString']=function(_0x20eb10,_0x2e71c9,_0x5d703c){var _0x1c59d8=[];if(_0x20eb10[_0x6e1d('0x2')]>0x0){var _0x4348df=_[_0x6e1d('0x3')](_0x20eb10,['id']);for(var _0x41cdda=0x0;_0x41cdda<_0x4348df[_0x6e1d('0x2')];_0x41cdda++){var _0x5e6c1c=_0x4348df[_0x41cdda];if(_0x5e6c1c[_0x6e1d('0x4')]===_0x6e1d('0x5')){_0x1c59d8[_0x6e1d('0x6')](_0x5e6c1c[_0x6e1d('0x7')]);}else if(_0x5e6c1c[_0x6e1d('0x4')]===_0x6e1d('0x8')&&_0x5e6c1c[_0x6e1d('0x9')]){_0x2e71c9[_0x5e6c1c[_0x6e1d('0x9')]]&&_0x1c59d8['push'](_0x2e71c9[_0x5e6c1c[_0x6e1d('0x9')]][_0x6e1d('0xa')]());}else if(_0x5e6c1c[_0x6e1d('0x4')]===_0x6e1d('0xb')&&_0x5e6c1c['Variable']&&_0x5e6c1c[_0x6e1d('0xc')]['name']){_0x2e71c9[_0x5e6c1c[_0x6e1d('0xc')][_0x6e1d('0xd')]['toLowerCase']()]&&_0x1c59d8[_0x6e1d('0x6')](_0x2e71c9[_0x5e6c1c[_0x6e1d('0xc')][_0x6e1d('0xd')][_0x6e1d('0xe')]()][_0x6e1d('0xa')]());}else if(_0x5e6c1c['type']===_0x6e1d('0xf')){if(_0x5e6c1c[_0x6e1d('0x10')]===_0x6e1d('0x5')&&_0x5e6c1c['key']){_0x1c59d8['push'](util[_0x6e1d('0x11')](_0x6e1d('0x12'),_0x5e6c1c[_0x6e1d('0x13')],_0x5e6c1c[_0x6e1d('0x14')]));}else if(_0x5e6c1c[_0x6e1d('0x10')]===_0x6e1d('0x8')&&_0x5e6c1c[_0x6e1d('0x9')]&&_0x5e6c1c[_0x6e1d('0x13')]){_0x2e71c9[_0x5e6c1c['variableName']]&&_0x1c59d8[_0x6e1d('0x6')](util[_0x6e1d('0x11')](_0x6e1d('0x12'),_0x5e6c1c['key'],_0x2e71c9[_0x5e6c1c[_0x6e1d('0x9')]]));}else if(_0x5e6c1c[_0x6e1d('0x10')]===_0x6e1d('0xb')&&_0x5e6c1c[_0x6e1d('0xc')]&&_0x5e6c1c[_0x6e1d('0xc')][_0x6e1d('0xd')]&&_0x5e6c1c[_0x6e1d('0x13')]){_0x2e71c9[_0x5e6c1c['Variable'][_0x6e1d('0xd')][_0x6e1d('0xe')]()]&&_0x1c59d8[_0x6e1d('0x6')](util[_0x6e1d('0x11')](_0x6e1d('0x12'),_0x5e6c1c[_0x6e1d('0x13')],_0x2e71c9[_0x5e6c1c[_0x6e1d('0xc')][_0x6e1d('0xd')][_0x6e1d('0xe')]()]));}}}}return _0x1c59d8[_0x6e1d('0x15')](_0x5d703c);};exports['stripTrailingSlash']=function(_0x1e8254){var _0x346703=_0x1e8254[_0x6e1d('0x16')](-0x1);if(_0x346703==='/'){_0x1e8254=_0x1e8254[_0x6e1d('0x17')](0x0,_0x1e8254[_0x6e1d('0x18')](_0x346703));}return _0x1e8254;};exports[_0x6e1d('0x19')]=function(_0x4ce5e7){if(!_[_0x6e1d('0x1a')](_0x4ce5e7)&&_0x4ce5e7!==''){var _0x3152a1=/^(([^<>()\[\]\\.,;:\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 _0x3152a1['test'](String(_0x4ce5e7)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 860668c..01bb7a6 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(_0x16b156,_0x50304a){var _0x4e65ef=function(_0x5e740c){while(--_0x5e740c){_0x16b156['push'](_0x16b156['shift']());}};_0x4e65ef(++_0x50304a);}(_0xe706,0xa3));var _0x6e70=function(_0x2a0bc2,_0x33f79b){_0x2a0bc2=_0x2a0bc2-0x0;var _0x840555=_0xe706[_0x2a0bc2];return _0x840555;};'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(_0x50059f,_0x3883bd){var _0x5b52b8=function(_0x46de53){while(--_0x46de53){_0x50059f['push'](_0x50059f['shift']());}};_0x5b52b8(++_0x3883bd);}(_0x34e8,0x12c));var _0x834e=function(_0x414936,_0x363f42){_0x414936=_0x414936-0x0;var _0x103e8f=_0x34e8[_0x414936];return _0x103e8f;};'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 ee6ffdb..ab97892 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 _0x0481=['zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','then','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','authType','password','username','token','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','variable','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','./util','../../../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0481,0x13f));var _0x1048=function(_0x4d7116,_0xdb8175){_0x4d7116=_0x4d7116-0x0;var _0x4593dc=_0x0481[_0x4d7116];return _0x4593dc;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x1048('0x0'));var util=require(_0x1048('0x1'));var Redis=require(_0x1048('0x2'));var intUtil=require(_0x1048('0x3'));var config=require('../../../../config/environment');var logger=require(_0x1048('0x4'))(_0x1048('0x5'));config[_0x1048('0x6')]=_[_0x1048('0x7')](config[_0x1048('0x6')],{'host':_0x1048('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1048('0x6')]));function emit(_0x5cb391,_0x4ff7d4,_0x4e1d9c){io['to'](_0x5cb391)[_0x1048('0x9')](_0x4ff7d4,_0x4e1d9c);}var headers={'Content-Type':'application/json','Accept':_0x1048('0xa')};function getTicket(_0x35e813,_0x55e744,_0x302a97,_0x1a8ce3,_0x26d43a){logger[_0x1048('0xb')](_0x1048('0xc'));return request({'uri':util['format']('%s/tickets.json',_0x35e813[_0x1048('0xd')]),'method':_0x1048('0xe'),'body':{'ticket':_[_0x1048('0xf')]({'requester_id':_0x302a97['id'],'submitter_id':_0x55e744?_0x55e744['id']:undefined,'assignee_id':_0x55e744?_0x55e744['id']:undefined,'tags':getTags(_0x1a8ce3[_0x1048('0x10')],_0x1048('0x11')),'subject':intUtil[_0x1048('0x12')](_0x1a8ce3[_0x1048('0x13')],_0x26d43a,'\x20'),'description':intUtil[_0x1048('0x12')](_0x1a8ce3['Descriptions'],_0x26d43a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1048('0x12')](_0x1a8ce3[_0x1048('0x14')],_0x26d43a,'\x0a')}},getCustomFields(_0x1a8ce3[_0x1048('0x15')],_0x26d43a))}})['then'](function(_0x1a7177){logger[_0x1048('0xb')](_0x1048('0x16'));return _0x1a7177[_0x1048('0x17')];});}function getUser(_0x147b1b,_0x609f1e){if(intUtil[_0x1048('0x18')](_0x609f1e)){logger[_0x1048('0xb')](_0x1048('0x19'),_0x609f1e);return request({'uri':util[_0x1048('0x1a')](_0x1048('0x1b'),_0x147b1b[_0x1048('0xd')]),'qs':{'query':util[_0x1048('0x1a')]('type:user\x20role:agent\x20email:%s',_0x609f1e)}})[_0x1048('0x1c')](function(_0x42701f){if(_0x42701f[_0x1048('0x1d')]){logger['info'](_0x1048('0x1e'));return _[_0x1048('0x1f')](_0x42701f[_0x1048('0x20')],{'email':_0x609f1e,'role':'agent'});}else{logger['info'](_0x1048('0x21'));return request({'uri':util[_0x1048('0x1a')](_0x1048('0x22'),_0x147b1b[_0x1048('0xd')])})['then'](function(_0x4b2837){logger[_0x1048('0xb')]('Admin\x20account\x20selected.');return _0x4b2837[_0x1048('0x23')];});}});}else{logger[_0x1048('0xb')](_0x1048('0x21'));return request({'uri':util[_0x1048('0x1a')]('%s/users/me.json',_0x147b1b[_0x1048('0xd')])})[_0x1048('0x1c')](function(_0x130855){logger[_0x1048('0xb')]('Admin\x20account\x20selected.');return _0x130855['user'];});}}function getEndUser(_0x3c2ee9,_0x423528,_0x290b99){logger[_0x1048('0xb')]('Searching\x20enduser\x20with\x20phone',_0x290b99);return request({'uri':util[_0x1048('0x1a')]('%s/search.json',_0x3c2ee9[_0x1048('0xd')]),'qs':{'query':util[_0x1048('0x1a')](_0x1048('0x24'),_0x290b99)}})[_0x1048('0x1c')](function(_0x1a3121){var _0x101e89;if(_0x1a3121[_0x1048('0x20')]['length']){_0x1a3121[_0x1048('0x20')]=_[_0x1048('0x25')](_0x1a3121[_0x1048('0x20')],{'suspended':![],'role':_0x1048('0x26')});if(_0x1a3121['results'][_0x1048('0x27')]){_0x101e89=_['first'](_0x1a3121[_0x1048('0x20')]);}}if(_0x101e89){logger[_0x1048('0xb')](_0x1048('0x28'));return _0x101e89;}else{logger[_0x1048('0xb')](_0x1048('0x29'));return request({'uri':util[_0x1048('0x1a')](_0x1048('0x2a'),_0x3c2ee9[_0x1048('0xd')]),'method':_0x1048('0xe'),'body':{'user':{'role':_0x1048('0x26'),'name':util[_0x1048('0x1a')]('Caller\x20-\x20%s',_0x423528||_0x290b99),'phone':_0x290b99}}})[_0x1048('0x1c')](function(_0x56415f){logger['info'](_0x1048('0x2b'));return _0x56415f[_0x1048('0x23')];});}});}function getAuth(_0x3ab192){var _0x2a4711;if(_0x3ab192[_0x1048('0x2c')]===_0x1048('0x2d')){_0x2a4711=util['format']('%s:%s',_0x3ab192['username'],_0x3ab192['password']);}else if(_0x3ab192[_0x1048('0x2c')]==='token'){_0x2a4711=util['format']('%s/token:%s',_0x3ab192[_0x1048('0x2e')],_0x3ab192[_0x1048('0x2f')]);}return util['format']('Basic\x20%s',new Buffer(_0x2a4711)[_0x1048('0x30')]('base64'));}function request(_0x172d5a){logger[_0x1048('0x31')](_0x1048('0x32'),JSON[_0x1048('0x33')](_0x172d5a));return rp(_[_0x1048('0x7')](_0x172d5a,{'method':_0x1048('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x5885a7,_0x441a02){var _0x32ff65=[];if(_0x5885a7&&_0x5885a7[_0x1048('0x27')]>0x0){_0x32ff65=_[_0x1048('0x35')](_0x5885a7,_0x441a02);}return _0x32ff65;}function getCustomFields(_0x9ef90f,_0x1fd0d1){var _0x2444cb=[];var _0x400333={'custom_fields':[]};if(_0x9ef90f[_0x1048('0x27')]>0x0){_[_0x1048('0x36')](_0x9ef90f,function(_0x195e58){if(_[_0x1048('0x37')]([_0x1048('0x38'),_0x1048('0x39')],_0x195e58[_0x1048('0x3a')])&&_0x195e58[_0x1048('0x3b')]&&!_0x195e58[_0x1048('0x3c')]){_0x400333[_0x195e58[_0x1048('0x3b')][_0x1048('0x3d')]()]=_0x195e58['content'][_0x1048('0x30')]();}else if(_[_0x1048('0x37')](['string','picklist'],_0x195e58[_0x1048('0x3a')])&&_0x195e58[_0x1048('0x3e')]&&_0x195e58[_0x1048('0x3c')]){_0x400333[_0x1048('0x3f')]['push']({'id':_0x195e58[_0x1048('0x3e')],'value':_0x195e58['content'][_0x1048('0x30')]()});}else if(_0x195e58[_0x1048('0x3a')]===_0x1048('0x40')&&_0x195e58['variableName']&&_0x195e58['idField']&&_0x195e58[_0x1048('0x3c')]){_0x1fd0d1[_0x195e58['variableName']]&&_0x400333[_0x1048('0x3f')]['push']({'id':_0x195e58[_0x1048('0x3e')],'value':_0x1fd0d1[_0x195e58['variableName']][_0x1048('0x30')]()});}else if(_0x195e58['type']===_0x1048('0x41')&&_0x195e58[_0x1048('0x42')]&&_0x195e58[_0x1048('0x42')][_0x1048('0x11')]&&_0x195e58[_0x1048('0x3e')]&&_0x195e58[_0x1048('0x3c')]){_0x1fd0d1[_0x195e58[_0x1048('0x42')][_0x1048('0x11')]['toLowerCase']()]&&_0x400333[_0x1048('0x3f')]['push']({'id':_0x195e58[_0x1048('0x3e')],'value':_0x1fd0d1[_0x195e58[_0x1048('0x42')]['name'][_0x1048('0x3d')]()]['toString']()});}});}return _0x400333;}exports[_0x1048('0x43')]=function(_0x4955b9,_0xf4250a,_0x1c1f3c,_0x163f9b,_0x24cc80,_0x19ea11){var _0x4dc8fe,_0x1c942a;_0x19ea11[_0x1048('0xd')]=intUtil[_0x1048('0x44')](_0x19ea11[_0x1048('0xd')]);_0x19ea11[_0x1048('0x45')]=intUtil['stripTrailingSlash'](_0x19ea11[_0x1048('0x45')]);if(_0x24cc80&&_0x24cc80[_0x1048('0x46')]){logger[_0x1048('0xb')](_0x1048('0x47'),_0x1048('0x48'));_0xf4250a['recordingURL']=util['format'](_0x1048('0x49'),_0x19ea11[_0x1048('0x45')],_0xf4250a[_0x1048('0x4a')],md5(_0xf4250a[_0x1048('0x4a')]));}else{_0xf4250a[_0x1048('0x4b')]='';}headers['Authorization']=getAuth(_0x19ea11);return getUser(_0x19ea11,_0x163f9b[_0x1048('0x4c')])['then'](function(_0x368393){_0x4dc8fe=_0x368393;logger['info'](_0x1048('0x4d'),_0x4dc8fe['id']);return getEndUser(_0x19ea11,_0xf4250a[_0x1048('0x4e')],_0xf4250a[_0x1048('0x4f')]);})['then'](function(_0x5964a9){_0x1c942a=_0x5964a9;logger[_0x1048('0xb')](_0x1048('0x50'),_0x1c942a['id']);return getTicket(_0x19ea11,_0x4dc8fe,_0x1c942a,_0x1c1f3c,_0xf4250a);})[_0x1048('0x1c')](function(_0x23ced0){if(_0x23ced0){logger[_0x1048('0xb')](_0x1048('0x51'),_0x23ced0['id']);switch(_0x19ea11[_0x1048('0x3a')]){case _0x1048('0x52'):logger[_0x1048('0xb')](_0x1048('0x47'),_0x1048('0x53'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x19ea11[_0x1048('0xd')],_0x4dc8fe['id'],_0x23ced0['id']),'method':'POST'});case _0x1048('0x54'):logger[_0x1048('0xb')](_0x1048('0x47'),_0x1048('0x55'));emit(util['format'](_0x1048('0x56'),_0x163f9b['name']),_0x1048('0x57'),{'uri':util[_0x1048('0x1a')]('%s/agent/tickets/%s',_0x19ea11[_0x1048('0xd')][_0x1048('0x58')](_0x1048('0x59'),''),_0x23ced0['id'])});break;default:logger['error']('[QUEUE]',_0x1048('0x5a'));}}})[_0x1048('0x5b')](function(_0xb8dbee){logger[_0x1048('0x5c')](_0x1048('0x5d'),util[_0x1048('0x5e')](_0xb8dbee,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x22293a,_0x19885f,_0x177046,_0x2f3f76,_0x1499bb,_0x18a8b0,_0x354eb2){var _0xd3a337,_0x2a1bc6;_0x18a8b0[_0x1048('0xd')]=intUtil['stripTrailingSlash'](_0x18a8b0[_0x1048('0xd')]);_0x18a8b0[_0x1048('0x45')]=intUtil[_0x1048('0x44')](_0x18a8b0['serverUrl']);if(_0x354eb2&&_0x354eb2['recordingFormat']&&_0x354eb2[_0x1048('0x5f')]!==_0x1048('0x60')){logger[_0x1048('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x19885f[_0x1048('0x4b')]=util[_0x1048('0x1a')](_0x1048('0x49'),_0x18a8b0[_0x1048('0x45')],_0x19885f[_0x1048('0x4a')],md5(_0x19885f[_0x1048('0x4a')]));}headers[_0x1048('0x61')]=getAuth(_0x18a8b0);return getUser(_0x18a8b0,_0x2f3f76['email'])[_0x1048('0x1c')](function(_0x39fce4){_0xd3a337=_0x39fce4;logger[_0x1048('0xb')](_0x1048('0x4d'),_0xd3a337['id']);return getEndUser(_0x18a8b0,_0x19885f[_0x1048('0x62')],_0x19885f[_0x1048('0x63')]);})['then'](function(_0x4a4b9f){_0x2a1bc6=_0x4a4b9f;logger['info'](_0x1048('0x50'),_0x2a1bc6['id']);return getTicket(_0x18a8b0,_0xd3a337,_0x2a1bc6,_0x177046,_0x19885f);})[_0x1048('0x1c')](function(_0x46e95f){if(_0x46e95f){logger[_0x1048('0xb')](_0x1048('0x51'),_0x46e95f['id']);switch(_0x18a8b0[_0x1048('0x3a')]){case'integrationTab':logger[_0x1048('0xb')](_0x1048('0x64'),_0x1048('0x53'));return request({'uri':util[_0x1048('0x1a')](_0x1048('0x65'),_0x18a8b0[_0x1048('0xd')],_0xd3a337['id'],_0x46e95f['id']),'method':_0x1048('0xe')});case _0x1048('0x54'):logger[_0x1048('0xb')]('[OUTBOUND]',_0x1048('0x55'));emit(util['format'](_0x1048('0x56'),_0x2f3f76[_0x1048('0x11')]),_0x1048('0x57'),{'uri':util['format'](_0x1048('0x66'),_0x18a8b0['remoteUri'][_0x1048('0x58')]('/api/v2',''),_0x46e95f['id'])});break;default:logger['error'](_0x1048('0x64'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x1048('0x5b')](function(_0x1a8162){logger[_0x1048('0x5c')](_0x1048('0x67'),util[_0x1048('0x5e')](_0x1a8162,{'showHidden':!![],'depth':null}));});};exports[_0x1048('0x68')]=function(_0x27b648,_0x3ecc61,_0xe20769,_0x1df54a,_0x4cc49e,_0x16e3f1){var _0x8dcd7f,_0x2c1342;_0x16e3f1[_0x1048('0xd')]=intUtil[_0x1048('0x44')](_0x16e3f1[_0x1048('0xd')]);_0x16e3f1[_0x1048('0x45')]=intUtil[_0x1048('0x44')](_0x16e3f1[_0x1048('0x45')]);if(_0x4cc49e&&_0x4cc49e[_0x1048('0x46')]){logger[_0x1048('0xb')]('['+_0x3ecc61['lastevent']['toUpperCase']()+']',_0x1048('0x48'));_0x3ecc61[_0x1048('0x4b')]=util[_0x1048('0x1a')](_0x1048('0x49'),_0x16e3f1[_0x1048('0x45')],_0x3ecc61['uniqueid'],md5(_0x3ecc61[_0x1048('0x4a')]));}else{_0x3ecc61[_0x1048('0x4b')]='';}headers[_0x1048('0x61')]=getAuth(_0x16e3f1);return getUser(_0x16e3f1)[_0x1048('0x1c')](function(_0xea2bf6){_0x8dcd7f=_0xea2bf6;logger[_0x1048('0xb')](_0x1048('0x4d'),_0x8dcd7f['id']);return getEndUser(_0x16e3f1,_0x3ecc61[_0x1048('0x4e')],_0x3ecc61[_0x1048('0x4f')]);})[_0x1048('0x1c')](function(_0x4cb09a){_0x2c1342=_0x4cb09a;logger[_0x1048('0xb')]('The\x20Enduser\x20ID\x20is:',_0x2c1342['id']);return getTicket(_0x16e3f1,_0x8dcd7f,_0x2c1342,_0xe20769,_0x3ecc61);})[_0x1048('0x1c')](function(_0x283aa7){if(_0x283aa7){logger['info'](_0x1048('0x51'),_0x283aa7['id']);}})['catch'](function(_0x18fd38){logger[_0x1048('0x5c')]('['+_0x3ecc61[_0x1048('0x69')][_0x1048('0x6a')]()+']'+_0x1048('0x6b'),util[_0x1048('0x5e')](_0x18fd38,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2834=['customField','custom_fields','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','user:%s','%s/agent/tickets/%s','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','Authorization','destcalleridname','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','replace','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','%s/users.json','Enduser\x20created.','authType','password','%s:%s','username','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','length','map','forEach','includes','string','type','nameField','toLowerCase','content','picklist','idField'];(function(_0x34a84e,_0x2d0495){var _0x3a1cd5=function(_0x510869){while(--_0x510869){_0x34a84e['push'](_0x34a84e['shift']());}};_0x3a1cd5(++_0x2d0495);}(_0x2834,0xff));var _0x4283=function(_0x47e5e0,_0x33d4f1){_0x47e5e0=_0x47e5e0-0x0;var _0x22cc74=_0x2834[_0x47e5e0];return _0x22cc74;};'use strict';var _=require(_0x4283('0x0'));var rp=require(_0x4283('0x1'));var md5=require(_0x4283('0x2'));var util=require(_0x4283('0x3'));var Redis=require(_0x4283('0x4'));var intUtil=require(_0x4283('0x5'));var config=require(_0x4283('0x6'));var logger=require('../../../../config/logger')(_0x4283('0x7'));config[_0x4283('0x8')]=_[_0x4283('0x9')](config['redis'],{'host':_0x4283('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4283('0x8')]));function emit(_0x526409,_0x3ea193,_0x312784){io['to'](_0x526409)[_0x4283('0xb')](_0x3ea193,_0x312784);}var headers={'Content-Type':_0x4283('0xc'),'Accept':_0x4283('0xc')};function getTicket(_0x5ab8d5,_0x18cadd,_0x48de61,_0x5b37c5,_0x30c9b4){logger[_0x4283('0xd')](_0x4283('0xe'));return request({'uri':util[_0x4283('0xf')](_0x4283('0x10'),_0x5ab8d5[_0x4283('0x11')]),'method':_0x4283('0x12'),'body':{'ticket':_[_0x4283('0x13')]({'requester_id':_0x48de61['id'],'submitter_id':_0x18cadd?_0x18cadd['id']:undefined,'assignee_id':_0x18cadd?_0x18cadd['id']:undefined,'tags':getTags(_0x5b37c5[_0x4283('0x14')],_0x4283('0x15')),'subject':intUtil[_0x4283('0x16')](_0x5b37c5['Subjects'],_0x30c9b4,'\x20'),'description':intUtil[_0x4283('0x16')](_0x5b37c5[_0x4283('0x17')],_0x30c9b4,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4283('0x16')](_0x5b37c5['Descriptions'],_0x30c9b4,'\x0a')}},getCustomFields(_0x5b37c5['Fields'],_0x30c9b4))}})[_0x4283('0x18')](function(_0x3aaeb7){logger['info'](_0x4283('0x19'));return _0x3aaeb7[_0x4283('0x1a')];});}function getUser(_0xaffcf8,_0x4baccd){if(intUtil['validateEmail'](_0x4baccd)){logger[_0x4283('0xd')](_0x4283('0x1b'),_0x4baccd);return request({'uri':util['format'](_0x4283('0x1c'),_0xaffcf8['remoteUri']),'qs':{'query':util[_0x4283('0xf')](_0x4283('0x1d'),_0x4baccd)}})['then'](function(_0x4665eb){if(_0x4665eb[_0x4283('0x1e')]){logger[_0x4283('0xd')](_0x4283('0x1f'));return _[_0x4283('0x20')](_0x4665eb[_0x4283('0x21')],{'email':_0x4baccd,'role':_0x4283('0x22')});}else{logger[_0x4283('0xd')](_0x4283('0x23'));return request({'uri':util[_0x4283('0xf')]('%s/users/me.json',_0xaffcf8[_0x4283('0x11')])})['then'](function(_0x3a93e1){logger[_0x4283('0xd')]('Admin\x20account\x20selected.');return _0x3a93e1[_0x4283('0x24')];});}});}else{logger[_0x4283('0xd')](_0x4283('0x23'));return request({'uri':util[_0x4283('0xf')]('%s/users/me.json',_0xaffcf8['remoteUri'])})[_0x4283('0x18')](function(_0x5f0331){logger['info']('Admin\x20account\x20selected.');return _0x5f0331[_0x4283('0x24')];});}}function getEndUser(_0xcdc16a,_0x140e0a,_0x4ae324){logger['info'](_0x4283('0x25'),_0x4ae324);return request({'uri':util[_0x4283('0xf')](_0x4283('0x1c'),_0xcdc16a['remoteUri']),'qs':{'query':util[_0x4283('0xf')](_0x4283('0x26'),_0x4ae324)}})[_0x4283('0x18')](function(_0x5c359f){var _0x471423;if(_0x5c359f[_0x4283('0x21')]['length']){_0x5c359f[_0x4283('0x21')]=_['filter'](_0x5c359f[_0x4283('0x21')],{'suspended':![],'role':_0x4283('0x27')});if(_0x5c359f[_0x4283('0x21')]['length']){_0x471423=_['first'](_0x5c359f[_0x4283('0x21')]);}}if(_0x471423){logger[_0x4283('0xd')]('Enduser\x20found!');return _0x471423;}else{logger[_0x4283('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x4283('0xf')](_0x4283('0x28'),_0xcdc16a[_0x4283('0x11')]),'method':_0x4283('0x12'),'body':{'user':{'role':'end-user','name':util[_0x4283('0xf')]('Caller\x20-\x20%s',_0x140e0a||_0x4ae324),'phone':_0x4ae324}}})[_0x4283('0x18')](function(_0x5168ba){logger[_0x4283('0xd')](_0x4283('0x29'));return _0x5168ba[_0x4283('0x24')];});}});}function getAuth(_0x49af12){var _0x30b823;if(_0x49af12[_0x4283('0x2a')]===_0x4283('0x2b')){_0x30b823=util[_0x4283('0xf')](_0x4283('0x2c'),_0x49af12[_0x4283('0x2d')],_0x49af12[_0x4283('0x2b')]);}else if(_0x49af12[_0x4283('0x2a')]==='token'){_0x30b823=util['format'](_0x4283('0x2e'),_0x49af12[_0x4283('0x2d')],_0x49af12['token']);}return util[_0x4283('0xf')](_0x4283('0x2f'),new Buffer(_0x30b823)[_0x4283('0x30')](_0x4283('0x31')));}function request(_0x23e621){logger['debug'](_0x4283('0x32'),JSON[_0x4283('0x33')](_0x23e621));return rp(_['defaults'](_0x23e621,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3cf0c4,_0x59a395){var _0x11b651=[];if(_0x3cf0c4&&_0x3cf0c4[_0x4283('0x34')]>0x0){_0x11b651=_[_0x4283('0x35')](_0x3cf0c4,_0x59a395);}return _0x11b651;}function getCustomFields(_0x16e0b3,_0x4e9984){var _0x2d0f2b=[];var _0x180a69={'custom_fields':[]};if(_0x16e0b3[_0x4283('0x34')]>0x0){_[_0x4283('0x36')](_0x16e0b3,function(_0x2fa093){if(_[_0x4283('0x37')]([_0x4283('0x38'),'picklist'],_0x2fa093[_0x4283('0x39')])&&_0x2fa093[_0x4283('0x3a')]&&!_0x2fa093['customField']){_0x180a69[_0x2fa093[_0x4283('0x3a')][_0x4283('0x3b')]()]=_0x2fa093[_0x4283('0x3c')][_0x4283('0x30')]();}else if(_['includes'](['string',_0x4283('0x3d')],_0x2fa093[_0x4283('0x39')])&&_0x2fa093[_0x4283('0x3e')]&&_0x2fa093[_0x4283('0x3f')]){_0x180a69[_0x4283('0x40')][_0x4283('0x41')]({'id':_0x2fa093[_0x4283('0x3e')],'value':_0x2fa093['content']['toString']()});}else if(_0x2fa093[_0x4283('0x39')]===_0x4283('0x42')&&_0x2fa093['variableName']&&_0x2fa093['idField']&&_0x2fa093[_0x4283('0x3f')]){_0x4e9984[_0x2fa093[_0x4283('0x43')]]&&_0x180a69['custom_fields'][_0x4283('0x41')]({'id':_0x2fa093[_0x4283('0x3e')],'value':_0x4e9984[_0x2fa093[_0x4283('0x43')]][_0x4283('0x30')]()});}else if(_0x2fa093[_0x4283('0x39')]==='customVariable'&&_0x2fa093[_0x4283('0x44')]&&_0x2fa093['Variable'][_0x4283('0x15')]&&_0x2fa093[_0x4283('0x3e')]&&_0x2fa093['customField']){_0x4e9984[_0x2fa093['Variable'][_0x4283('0x15')][_0x4283('0x3b')]()]&&_0x180a69[_0x4283('0x40')][_0x4283('0x41')]({'id':_0x2fa093['idField'],'value':_0x4e9984[_0x2fa093[_0x4283('0x44')][_0x4283('0x15')][_0x4283('0x3b')]()]['toString']()});}});}return _0x180a69;}exports[_0x4283('0x45')]=function(_0xc07505,_0x46525c,_0x21ee77,_0x9bce5d,_0x45a92c,_0x50ed5a){var _0x1ca3c5,_0x5dda7f;_0x50ed5a[_0x4283('0x11')]=intUtil[_0x4283('0x46')](_0x50ed5a[_0x4283('0x11')]);_0x50ed5a[_0x4283('0x47')]=intUtil[_0x4283('0x46')](_0x50ed5a[_0x4283('0x47')]);if(_0x45a92c&&_0x45a92c[_0x4283('0x48')]){logger['info'](_0x4283('0x49'),_0x4283('0x4a'));_0x46525c[_0x4283('0x4b')]=util[_0x4283('0xf')](_0x4283('0x4c'),_0x50ed5a['serverUrl'],_0x46525c[_0x4283('0x4d')],md5(_0x46525c['uniqueid']));}else{_0x46525c[_0x4283('0x4b')]='';}headers['Authorization']=getAuth(_0x50ed5a);return getUser(_0x50ed5a,_0x9bce5d[_0x4283('0x4e')])[_0x4283('0x18')](function(_0x47c02d){_0x1ca3c5=_0x47c02d;logger[_0x4283('0xd')](_0x4283('0x4f'),_0x1ca3c5['id']);return getEndUser(_0x50ed5a,_0x46525c[_0x4283('0x50')],_0x46525c[_0x4283('0x51')]);})[_0x4283('0x18')](function(_0x38e3c1){_0x5dda7f=_0x38e3c1;logger[_0x4283('0xd')](_0x4283('0x52'),_0x5dda7f['id']);return getTicket(_0x50ed5a,_0x1ca3c5,_0x5dda7f,_0x21ee77,_0x46525c);})['then'](function(_0x492e57){if(_0x492e57){logger[_0x4283('0xd')](_0x4283('0x53'),_0x492e57['id']);switch(_0x50ed5a[_0x4283('0x39')]){case _0x4283('0x54'):logger[_0x4283('0xd')](_0x4283('0x49'),_0x4283('0x55'));return request({'uri':util[_0x4283('0xf')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x50ed5a[_0x4283('0x11')],_0x1ca3c5['id'],_0x492e57['id']),'method':_0x4283('0x12')});case _0x4283('0x56'):logger[_0x4283('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4283('0xf')](_0x4283('0x57'),_0x9bce5d[_0x4283('0x15')]),'trigger:browser:url',{'uri':util[_0x4283('0xf')](_0x4283('0x58'),_0x50ed5a['remoteUri']['replace'](_0x4283('0x59'),''),_0x492e57['id'])});break;default:logger['error'](_0x4283('0x49'),_0x4283('0x5a'));}}})[_0x4283('0x5b')](function(_0x1c497e){logger[_0x4283('0x5c')](_0x4283('0x5d'),util[_0x4283('0x5e')](_0x1c497e,{'showHidden':!![],'depth':null}));});};exports[_0x4283('0x5f')]=function(_0x4aee9e,_0x252093,_0x19b6d3,_0x30f680,_0x5dd70c,_0x22eefc,_0x224a25){var _0x1ef047,_0x855ff7;_0x22eefc[_0x4283('0x11')]=intUtil['stripTrailingSlash'](_0x22eefc[_0x4283('0x11')]);_0x22eefc['serverUrl']=intUtil[_0x4283('0x46')](_0x22eefc[_0x4283('0x47')]);if(_0x224a25&&_0x224a25[_0x4283('0x60')]&&_0x224a25[_0x4283('0x60')]!=='none'){logger[_0x4283('0xd')]('[OUTBOUND]',_0x4283('0x4a'));_0x252093['recordingURL']=util[_0x4283('0xf')](_0x4283('0x4c'),_0x22eefc['serverUrl'],_0x252093['uniqueid'],md5(_0x252093[_0x4283('0x4d')]));}headers[_0x4283('0x61')]=getAuth(_0x22eefc);return getUser(_0x22eefc,_0x30f680[_0x4283('0x4e')])[_0x4283('0x18')](function(_0x2a402a){_0x1ef047=_0x2a402a;logger[_0x4283('0xd')](_0x4283('0x4f'),_0x1ef047['id']);return getEndUser(_0x22eefc,_0x252093[_0x4283('0x62')],_0x252093['destcalleridnum']);})[_0x4283('0x18')](function(_0x3cb07b){_0x855ff7=_0x3cb07b;logger[_0x4283('0xd')](_0x4283('0x52'),_0x855ff7['id']);return getTicket(_0x22eefc,_0x1ef047,_0x855ff7,_0x19b6d3,_0x252093);})[_0x4283('0x18')](function(_0x1b2098){if(_0x1b2098){logger[_0x4283('0xd')](_0x4283('0x53'),_0x1b2098['id']);switch(_0x22eefc['type']){case _0x4283('0x54'):logger[_0x4283('0xd')](_0x4283('0x63'),_0x4283('0x55'));return request({'uri':util[_0x4283('0xf')](_0x4283('0x64'),_0x22eefc[_0x4283('0x11')],_0x1ef047['id'],_0x1b2098['id']),'method':_0x4283('0x12')});case _0x4283('0x56'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4283('0x57'),_0x30f680[_0x4283('0x15')]),_0x4283('0x65'),{'uri':util['format'](_0x4283('0x58'),_0x22eefc['remoteUri'][_0x4283('0x66')](_0x4283('0x59'),''),_0x1b2098['id'])});break;default:logger['error'](_0x4283('0x63'),_0x4283('0x5a'));}}})[_0x4283('0x5b')](function(_0xff1edc){logger[_0x4283('0x5c')](_0x4283('0x67'),util[_0x4283('0x5e')](_0xff1edc,{'showHidden':!![],'depth':null}));});};exports[_0x4283('0x68')]=function(_0x2970ac,_0xccb310,_0x128b58,_0x88bad0,_0x4746be,_0x5d42e6){var _0x3fae87,_0x457f0f;_0x5d42e6['remoteUri']=intUtil[_0x4283('0x46')](_0x5d42e6[_0x4283('0x11')]);_0x5d42e6[_0x4283('0x47')]=intUtil[_0x4283('0x46')](_0x5d42e6[_0x4283('0x47')]);if(_0x4746be&&_0x4746be[_0x4283('0x48')]){logger[_0x4283('0xd')]('['+_0xccb310['lastevent'][_0x4283('0x69')]()+']','Recording\x20is\x20enabled!');_0xccb310[_0x4283('0x4b')]=util['format'](_0x4283('0x4c'),_0x5d42e6[_0x4283('0x47')],_0xccb310['uniqueid'],md5(_0xccb310[_0x4283('0x4d')]));}else{_0xccb310[_0x4283('0x4b')]='';}headers['Authorization']=getAuth(_0x5d42e6);return getUser(_0x5d42e6)[_0x4283('0x18')](function(_0x1ca9e4){_0x3fae87=_0x1ca9e4;logger[_0x4283('0xd')](_0x4283('0x4f'),_0x3fae87['id']);return getEndUser(_0x5d42e6,_0xccb310[_0x4283('0x50')],_0xccb310[_0x4283('0x51')]);})['then'](function(_0x34c1d3){_0x457f0f=_0x34c1d3;logger[_0x4283('0xd')](_0x4283('0x52'),_0x457f0f['id']);return getTicket(_0x5d42e6,_0x3fae87,_0x457f0f,_0x128b58,_0xccb310);})[_0x4283('0x18')](function(_0x229bde){if(_0x229bde){logger[_0x4283('0xd')](_0x4283('0x53'),_0x229bde['id']);}})[_0x4283('0x5b')](function(_0x36d66a){logger['error']('['+_0xccb310['lastevent'][_0x4283('0x69')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x4283('0x5e')](_0x36d66a,{'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 d3fce69..b1486fd 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 _0x44b4=['/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientSecret','refresh_token','then','add','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','profile','Administrator','user','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Creating\x20new\x20call...','Subject','Subjects','Description','getString','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','talktime','format','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','Call_Result','Called','complete','connect','abandoned','Abandoned','timeout','Timeout','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','user:%s','trigger:browser:url','https://crm.','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x44b4,0x143));var _0x444b=function(_0x412a0f,_0x3f986f){_0x412a0f=_0x412a0f-0x0;var _0x497be4=_0x44b4[_0x412a0f];return _0x497be4;};'use strict';var _=require(_0x444b('0x0'));var rp=require(_0x444b('0x1'));var md5=require(_0x444b('0x2'));var util=require(_0x444b('0x3'));var intUtil=require(_0x444b('0x4'));var moment=require(_0x444b('0x5'));var Redis=require(_0x444b('0x6'));var BPromise=require(_0x444b('0x7'));var config=require(_0x444b('0x8'));var logger=require('../../../../config/logger')('zoho');config[_0x444b('0x9')]=_[_0x444b('0xa')](config[_0x444b('0x9')],{'host':_0x444b('0xb'),'port':0x18eb});var io=require(_0x444b('0xc'))(new Redis(config[_0x444b('0x9')]));function emit(_0x419d38,_0x261623,_0x51c6a7){io['to'](_0x419d38)[_0x444b('0xd')](_0x261623,_0x51c6a7);}function request(_0x3e7dfb){logger[_0x444b('0xe')](_0x444b('0xf'),JSON[_0x444b('0x10')](_0x3e7dfb));return rp(_0x3e7dfb);}function getCustomFields(_0x36835b,_0x1032f0){var _0x422fab={};if(_0x36835b['length']>0x0){_[_0x444b('0x11')](_0x36835b,function(_0x418324){if(_[_0x444b('0x12')]([_0x444b('0x13'),_0x444b('0x14')],_0x418324[_0x444b('0x15')])&&_0x418324[_0x444b('0x16')]){_0x422fab[_0x418324['idField']]=_0x418324[_0x444b('0x17')][_0x444b('0x18')]();}else if(_0x418324[_0x444b('0x15')]===_0x444b('0x19')&&_0x418324[_0x444b('0x1a')]&&_0x418324['idField']&&_0x1032f0[_0x418324[_0x444b('0x1a')]]){_0x422fab[_0x418324['idField']]=_0x1032f0[_0x418324[_0x444b('0x1a')]]['toString']();}else if(_0x418324[_0x444b('0x15')]===_0x444b('0x1b')&&_0x418324[_0x444b('0x1c')]&&_0x418324[_0x444b('0x1c')][_0x444b('0x1d')]&&_0x418324[_0x444b('0x16')]&&_0x1032f0[_0x418324['Variable'][_0x444b('0x1d')][_0x444b('0x1e')]()]){_0x422fab[_0x418324['idField']]=_0x1032f0[_0x418324[_0x444b('0x1c')]['name'][_0x444b('0x1e')]()]['toString']();}});}return _0x422fab;}function getName(_0x2770c5){if(_0x2770c5[_0x444b('0x1f')]('\x20')>0x0){var _0x25e7ae=_0x2770c5[_0x444b('0x20')](/ (.+)/);if(_0x25e7ae[0x1]){return _0x25e7ae;}}return[_0x2770c5,_0x2770c5];}var accountsTokens={};function getAccessToken(_0x37c79e){return new Promise(function(_0x347973,_0x165010){if(!_[_0x444b('0x21')](accountsTokens[_0x37c79e['id']])&&!_[_0x444b('0x21')](accountsTokens[_0x37c79e['id']][_0x444b('0x22')])){if(moment()[_0x444b('0x23')](accountsTokens[_0x37c79e['id']][_0x444b('0x24')])){_0x347973(accountsTokens[_0x37c79e['id']]['access_token']);}}var _0xdc61b2;switch(_0x37c79e['zone']){case'US':_0xdc61b2=_0x444b('0x25');break;case'AU':_0xdc61b2=_0x444b('0x26');break;case'EU':_0xdc61b2=_0x444b('0x27');break;case'IN':_0xdc61b2=_0x444b('0x28');break;case'CN':_0xdc61b2='https://accounts.zoho.com.cn';break;default:_0xdc61b2=_0x444b('0x27');break;}var _0x3b107f={'method':_0x444b('0x29'),'uri':_0xdc61b2+'/oauth/v2/token','qs':{'refresh_token':_0x37c79e[_0x444b('0x2a')],'client_id':_0x37c79e['clientId'],'client_secret':_0x37c79e[_0x444b('0x2b')],'grant_type':_0x444b('0x2c')},'json':!![]};return rp(_0x3b107f)[_0x444b('0x2d')](function(_0x50d9c2){accountsTokens[_0x37c79e['id']]={'access_token':_0x50d9c2[_0x444b('0x22')],'expires_in':moment()[_0x444b('0x2e')](_0x50d9c2[_0x444b('0x24')],'seconds')};_0x347973(_0x50d9c2['access_token']);})['catch'](function(_0x17b8f4){logger[_0x444b('0x2f')](_0x444b('0x30'),_0x17b8f4[_0x444b('0x31')]);_0x165010(_0x17b8f4);});});}function getUser(_0x5700ce,_0x45bdcd,_0x462eb8,_0x5baf47){logger[_0x444b('0x32')](_0x444b('0x33'));return request({'method':_0x444b('0x34'),'uri':util['format'](_0x444b('0x35'),_0x45bdcd),'qs':{'type':_0x444b('0x36')},'headers':{'Authorization':_0x444b('0x37')+_0x5700ce},'json':!![]})[_0x444b('0x2d')](function(_0x538d42){if(_0x538d42[_0x444b('0x38')]){var _0x243846=-0x1;if(_[_0x444b('0x39')](_0x538d42[_0x444b('0x38')])){if(!_[_0x444b('0x21')](_0x5baf47)){_0x243846=_[_0x444b('0x3a')](_0x538d42[_0x444b('0x38')],function(_0x1b642b){return _0x1b642b[_0x444b('0x3b')]===_0x5baf47;});}if(_0x243846>=0x0){logger[_0x444b('0x32')](_0x444b('0x3c'));}else{logger[_0x444b('0x32')]('Using\x20the\x20admin\x20account!');_0x243846=_['findIndex'](_0x538d42['users'],function(_0xbcd544){return _0xbcd544[_0x444b('0x3d')][_0x444b('0x1d')]===_0x444b('0x3e');});}return _0x538d42[_0x444b('0x38')][_0x243846];}else{if(_0x538d42[_0x444b('0x3f')][_0x444b('0x3d')][_0x444b('0x1d')]==='Administrator'){logger['info'](_0x444b('0x40'));user=_0x538d42[_0x444b('0x3f')];return user;}else{logger['error'](_0x444b('0x41'),JSON[_0x444b('0x10')](_0x538d42));throw new Error(_0x444b('0x42')+JSON['stringify'](_0x538d42));}}}else{logger['error'](_0x444b('0x41'),JSON[_0x444b('0x10')](_0x538d42));throw new Error(_0x444b('0x42')+JSON[_0x444b('0x10')](_0x538d42));}})[_0x444b('0x43')](function(_0x22f125){console[_0x444b('0x2f')](_0x22f125);});}function getZohoUser(_0x4a3201,_0x1723ac){return new BPromise(function(_0x26ea1d,_0x4a92d0){request(_0x4a3201)['then'](function(_0x2e3c12){var _0x547dcb=null;if(_0x2e3c12){_0x547dcb=_0x2e3c12[_0x444b('0x44')][0x0];_0x547dcb[_0x444b('0x45')]=_0x1723ac;}_0x26ea1d(_0x547dcb);})[_0x444b('0x43')](function(_0x5dcc6c){_0x4a92d0(_0x5dcc6c);});});}function createEndUser(_0x12f3ce,_0x328605,_0xdf79e3,_0x5b3ecc,_0x38b249,_0x5c558a){var _0xdf79e3=getName(_0xdf79e3);return request({'method':_0x444b('0x29'),'uri':'https://www.zohoapis.'+_0x328605+'/crm/v2/'+_[_0x444b('0x46')](_0x5c558a[_0x444b('0x47')])+'s','body':{'data':[{'Last_Name':_0xdf79e3[0x1],'First_Name':_0xdf79e3[0x0],'Phone':_0x5b3ecc,'Owner':{'name':!_[_0x444b('0x21')](_0x38b249[_0x444b('0x48')][_0x444b('0x1d')])?_0x38b249['role'][_0x444b('0x1d')]:!_[_0x444b('0x21')](_0x38b249[_0x444b('0x49')])?_0x38b249[_0x444b('0x49')]+'\x20'+_0x38b249['last_name']:_0x38b249[_0x444b('0x4a')],'id':_0x38b249['id']}}]},'headers':{'Authorization':_0x444b('0x37')+_0x12f3ce},'json':!![]})[_0x444b('0x2d')](function(_0x4eb7f4){if(_0x4eb7f4&&_0x4eb7f4[_0x444b('0x44')][0x0][_0x444b('0x4b')]===_0x444b('0x4c')){var _0x17967d=_0x4eb7f4['data'][0x0]['details'];_0x17967d[_0x444b('0x45')]=_[_0x444b('0x46')](_0x5c558a[_0x444b('0x47')])+'s';return _0x17967d;}logger['error'](_0x444b('0x41'),JSON['stringify'](data));throw new Error('Error:\x20'+JSON[_0x444b('0x10')](data));})[_0x444b('0x43')](function(_0xc7d659){console[_0x444b('0x4d')](_0x444b('0x4e'),_0xc7d659);});}function getEndUser(_0x2fe0ec,_0x194732,_0x1320cb,_0x2ae1c2,_0x5af3ac,_0x53fad8,_0x1df573){var _0x28366b={'method':_0x444b('0x34'),'uri':'','headers':{'Authorization':_0x444b('0x37')+_0x2fe0ec},'json':!![]};switch(_0x1df573[_0x444b('0x4f')]){case _0x444b('0x50'):_0x28366b[_0x444b('0x51')]='https://www.zohoapis.'+_0x194732+_0x444b('0x52')+_0x5af3ac+'))';return getZohoUser(_0x28366b,_0x444b('0x53'))['then'](function(_0x15db36){if(_0x15db36)return _0x15db36;_0x28366b['uri']=_0x444b('0x54')+_0x194732+_0x444b('0x55')+_0x5af3ac+'))';return getZohoUser(_0x28366b,_0x444b('0x56'))[_0x444b('0x2d')](function(_0x4e02dc){if(_0x4e02dc)return _0x4e02dc;if(_0x1df573[_0x444b('0x47')]!=_0x444b('0x57')){return createEndUser(_0x2fe0ec,_0x194732,_0x2ae1c2,_0x5af3ac,_0x53fad8,_0x1df573);}else{return{};}});});break;case _0x444b('0x58'):_0x28366b['uri']=_0x444b('0x54')+_0x194732+_0x444b('0x52')+_0x5af3ac+'))';return getZohoUser(_0x28366b,_0x444b('0x53'))[_0x444b('0x2d')](function(_0x361e84){if(_0x361e84)return _0x361e84;if(_0x1df573[_0x444b('0x47')]!=_0x444b('0x57')){return createEndUser(_0x2fe0ec,_0x194732,_0x2ae1c2,_0x5af3ac,_0x53fad8,_0x1df573);}else{return{};}});break;case _0x444b('0x59'):_0x28366b['uri']=_0x444b('0x54')+_0x194732+_0x444b('0x55')+_0x5af3ac+'))';return getZohoUser(_0x28366b,_0x444b('0x56'))[_0x444b('0x2d')](function(_0x3583b6){if(_0x3583b6)return _0x3583b6;if(_0x1df573[_0x444b('0x47')]!=_0x444b('0x57')){return createEndUser(_0x2fe0ec,_0x194732,_0x2ae1c2,_0x5af3ac,_0x53fad8,_0x1df573);}else{return{};}});break;}}function getCall(_0x36a037,_0x2e023e,_0x5daea7,_0x2f35ee,_0x5a67c8,_0x28d7eb,_0x46d3b1,_0x1c8076){logger[_0x444b('0x32')](_0x444b('0x5a'));var _0x27fb9a={};_0x27fb9a['Owner']={'name':!_[_0x444b('0x21')](_0x2f35ee[_0x444b('0x48')][_0x444b('0x1d')])&&!_[_0x444b('0x21')](_0x2f35ee[_0x444b('0x3d')]['name'])&&_0x2f35ee[_0x444b('0x3d')][_0x444b('0x1d')]==='administrator'?_0x2f35ee['role'][_0x444b('0x1d')]:!_[_0x444b('0x21')](_0x2f35ee[_0x444b('0x49')])?_0x2f35ee['first_name']+'\x20'+_0x2f35ee[_0x444b('0x4a')]:_0x2f35ee[_0x444b('0x4a')],'id':_0x2f35ee['id']};_0x27fb9a[_0x444b('0x5b')]=intUtil['getString'](_0x28d7eb[_0x444b('0x5c')],_0x46d3b1,'\x20');_0x27fb9a[_0x444b('0x5d')]=intUtil[_0x444b('0x5e')](_0x28d7eb[_0x444b('0x5f')],_0x46d3b1,'\x0a');if(_0x5a67c8['enduserType']==='Contacts'){_0x27fb9a[_0x444b('0x60')]={'name':!_[_0x444b('0x21')](_0x5a67c8['Full_Name'])?_0x5a67c8[_0x444b('0x61')]:!_[_0x444b('0x21')](_0x5a67c8['First_Name'])?_0x5a67c8[_0x444b('0x62')]+'\x20'+_0x5a67c8[_0x444b('0x63')]:_0x5a67c8['Last_Name'],'id':_0x5a67c8['id']};}if(_0x5a67c8['enduserType']===_0x444b('0x56')){_0x27fb9a[_0x444b('0x64')]={'name':!_[_0x444b('0x21')](_0x5a67c8[_0x444b('0x61')])?_0x5a67c8[_0x444b('0x61')]:!_[_0x444b('0x21')](_0x5a67c8[_0x444b('0x62')])?_0x5a67c8['First_Name']+'\x20'+_0x5a67c8[_0x444b('0x63')]:_0x5a67c8['Last_Name'],'id':_0x5a67c8['id']};_0x27fb9a[_0x444b('0x65')]=_[_0x444b('0x46')](_0x5a67c8[_0x444b('0x45')]);}if(_0x46d3b1['talktime']){_0x27fb9a[_0x444b('0x66')]=moment['utc'](parseInt(_0x46d3b1[_0x444b('0x67')])*0x3e8)[_0x444b('0x68')]('mm:ss');}else if(_0x46d3b1[_0x444b('0x69')]&&_0x46d3b1[_0x444b('0x6a')]){_0x27fb9a[_0x444b('0x66')]=moment[_0x444b('0x6b')](moment(_0x46d3b1[_0x444b('0x6a')],_0x444b('0x6c'))[_0x444b('0x6d')](moment(_0x46d3b1[_0x444b('0x6e')],'YYYY-MM-DDTHH:mm:ss')))[_0x444b('0x68')](_0x444b('0x6f'));}switch(_0x46d3b1['lastevent']){case'called':_0x27fb9a[_0x444b('0x70')]=_0x444b('0x71');break;case _0x444b('0x72'):case _0x444b('0x73'):_0x27fb9a[_0x444b('0x70')]='Answered';break;case'rejected':_0x27fb9a[_0x444b('0x70')]='Rejected';break;case _0x444b('0x74'):_0x27fb9a['Call_Result']=_0x444b('0x75');break;case _0x444b('0x76'):_0x27fb9a['Call_Result']=_0x444b('0x77');default:}_0x27fb9a['Call_Start_Time']=(_0x1c8076===_0x444b('0x78')?moment(_0x46d3b1[_0x444b('0x6e')])[_0x444b('0x68')](_0x444b('0x6c')):moment(_0x46d3b1['agentcalledAt'])[_0x444b('0x68')](_0x444b('0x6c')))||moment()['format'](_0x444b('0x6c'));_0x27fb9a[_0x444b('0x79')]=_0x1c8076||_0x444b('0x7a');_0x27fb9a=_[_0x444b('0x7b')](_0x27fb9a,getCustomFields(_0x28d7eb[_0x444b('0x7c')],_0x46d3b1));return request({'method':_0x444b('0x29'),'uri':'https://www.zohoapis.'+_0x2e023e+_0x444b('0x7d'),'headers':{'Authorization':_0x444b('0x37')+_0x36a037},'body':{'data':[_0x27fb9a]},'json':!![]})[_0x444b('0x2d')](function(_0x53c332){if(_0x53c332&&_0x53c332['data'][0x0][_0x444b('0x4b')]==='SUCCESS'){logger[_0x444b('0x32')](_0x444b('0x7e'));return{'id':_0x53c332['data'][0x0][_0x444b('0x7f')]['id']};}})[_0x444b('0x43')](function(_0x31878f){logger[_0x444b('0x32')](_0x444b('0x80'),_0x31878f[_0x444b('0x31')]);console['log'](_0x444b('0x80'),_0x31878f);});}exports[_0x444b('0x81')]=function(_0x17a97e,_0xc6d1b7,_0x40c7ed,_0x364ee9,_0x454075,_0x139eaf){var _0x5295d6,_0x9cc883,_0x118a2c;_0x139eaf[_0x444b('0x82')]=intUtil[_0x444b('0x83')](_0x139eaf[_0x444b('0x82')]);_0x139eaf[_0x444b('0x84')]=intUtil['stripTrailingSlash'](_0x139eaf[_0x444b('0x84')]);if(_0x454075&&_0x454075['monitor_format']){logger[_0x444b('0x32')]('[QUEUE]',_0x444b('0x85'));_0xc6d1b7[_0x444b('0x86')]=_0x139eaf[_0x444b('0x84')]+_0x444b('0x87')+_0xc6d1b7[_0x444b('0x88')]+_0x444b('0x89')+md5(_0xc6d1b7[_0x444b('0x88')]);}else{_0xc6d1b7[_0x444b('0x86')]='';}var _0xd085c=_0x139eaf[_0x444b('0x82')]===_0x444b('0x8a')?'eu':_0x444b('0x8b');return getAccessToken(_0x139eaf)[_0x444b('0x2d')](function(_0x4db23a){_0x118a2c=_0x4db23a;return getUser(_0x118a2c,_0xd085c,_0x139eaf,_0x364ee9['email']);})['then'](function(_0x5099f0){_0x5295d6=_0x5099f0;logger[_0x444b('0x32')]('The\x20User\x20ID\x20is:',_0x5295d6['id']);return getEndUser(_0x118a2c,_0xd085c,_0x139eaf,_0xc6d1b7[_0x444b('0x8c')],_0xc6d1b7[_0x444b('0x8d')],_0x5295d6,_0x40c7ed);})[_0x444b('0x2d')](function(_0x58e4c4){_0x9cc883=_0x58e4c4;return getCall(_0x118a2c,_0xd085c,_0x139eaf,_0x5295d6,_0x9cc883,_0x40c7ed,_0xc6d1b7,_0x444b('0x7a'));})[_0x444b('0x2d')](function(_0x5a920c){if(_0x5a920c){logger[_0x444b('0x32')](_0x444b('0x8e'),_0x5a920c['id']);logger['info'](_0x444b('0x8f'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x444b('0x68')](_0x444b('0x90'),_0x364ee9[_0x444b('0x1d')]),_0x444b('0x91'),{'uri':_0x444b('0x92')+_0x139eaf['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x5a920c['id']});}})[_0x444b('0x43')](function(_0x467b54){logger[_0x444b('0x2f')](_0x444b('0x8f'),JSON[_0x444b('0x10')](_0x467b54));});};exports['outbound']=function(_0x1d8a18,_0x14abf7,_0x178ea0,_0x57c062,_0x168147,_0x2b045e,_0x4d10fe){var _0x9cfd4a,_0xae42c2,_0x18c608;_0x2b045e['host']=intUtil[_0x444b('0x83')](_0x2b045e['host']);_0x2b045e[_0x444b('0x84')]=intUtil['stripTrailingSlash'](_0x2b045e[_0x444b('0x84')]);if(_0x4d10fe&&_0x4d10fe['recordingFormat']&&_0x4d10fe[_0x444b('0x93')]!=='none'){logger[_0x444b('0x32')](_0x444b('0x94'),_0x444b('0x85'));_0x14abf7['recordingURL']=_0x2b045e[_0x444b('0x84')]+_0x444b('0x87')+_0x14abf7['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x14abf7[_0x444b('0x88')]);}var _0x42ed03=_0x2b045e['host']==='zoho.eu'?'eu':_0x444b('0x8b');return getAccessToken(_0x2b045e)[_0x444b('0x2d')](function(_0x596913){_0x18c608=_0x596913;return getUser(_0x18c608,_0x42ed03,_0x2b045e,_0x57c062[_0x444b('0x3b')]);})[_0x444b('0x2d')](function(_0xa1b14e){_0x9cfd4a=_0xa1b14e;logger[_0x444b('0x32')](_0x444b('0x95'),_0x9cfd4a['id']);return getEndUser(_0x18c608,_0x42ed03,_0x2b045e,_0x14abf7[_0x444b('0x96')],_0x14abf7[_0x444b('0x97')],_0x9cfd4a,_0x178ea0);})['then'](function(_0x28bed4){_0xae42c2=_0x28bed4;return getCall(_0x18c608,_0x42ed03,_0x2b045e,_0x9cfd4a,_0xae42c2,_0x178ea0,_0x14abf7,_0x444b('0x98'));})[_0x444b('0x2d')](function(_0x1b960e){if(_0x1b960e){logger[_0x444b('0x32')](_0x444b('0x8e'),_0x1b960e['id']);logger[_0x444b('0x32')](_0x444b('0x94'),_0x444b('0x99'));emit(util[_0x444b('0x68')](_0x444b('0x90'),_0x57c062['name']),'trigger:browser:url',{'uri':_0x444b('0x92')+_0x2b045e[_0x444b('0x82')]+_0x444b('0x9a')+_0x1b960e['id']});}})[_0x444b('0x43')](function(_0x6f1058){logger['error'](_0x444b('0x94'),JSON[_0x444b('0x10')](_0x6f1058));});};exports[_0x444b('0x9b')]=function(_0xb0fd5b,_0x46a186,_0x19cd11,_0x54ad07,_0x392a83,_0x18c6b2){var _0x2288bf,_0x57189a,_0x4af8d3;_0x18c6b2['host']=intUtil[_0x444b('0x83')](_0x18c6b2[_0x444b('0x82')]);_0x18c6b2[_0x444b('0x84')]=intUtil[_0x444b('0x83')](_0x18c6b2['serverUrl']);if(_0x392a83&&_0x392a83[_0x444b('0x9c')]){logger[_0x444b('0x32')]('['+_0x46a186['lastevent'][_0x444b('0x9d')]()+']',_0x444b('0x85'));_0x46a186['recordingURL']=_0x18c6b2['serverUrl']+_0x444b('0x87')+_0x46a186[_0x444b('0x88')]+_0x444b('0x89')+md5(_0x46a186[_0x444b('0x88')]);}else{_0x46a186[_0x444b('0x86')]='';}var _0x5594c9=_0x18c6b2[_0x444b('0x82')]===_0x444b('0x8a')?'eu':_0x444b('0x8b');return getAccessToken(_0x18c6b2)[_0x444b('0x2d')](function(_0x152704){_0x4af8d3=_0x152704;return getUser(_0x4af8d3,_0x5594c9,_0x18c6b2);})[_0x444b('0x2d')](function(_0x4c501d){_0x2288bf=_0x4c501d;logger['info'](_0x444b('0x95'),_0x2288bf['id']);return getEndUser(_0x4af8d3,_0x5594c9,_0x18c6b2,_0x46a186[_0x444b('0x8c')],_0x46a186['calleridnum'],_0x2288bf,_0x19cd11);})[_0x444b('0x2d')](function(_0x158e72){_0x57189a=_0x158e72;return getCall(_0x4af8d3,_0x5594c9,_0x18c6b2,_0x2288bf,_0x57189a,_0x19cd11,_0x46a186,_0x444b('0x7a'));})[_0x444b('0x2d')](function(_0x30939c){if(_0x30939c){logger[_0x444b('0x32')](_0x444b('0x8e'),_0x30939c['id']);}})[_0x444b('0x43')](function(_0x2a9f71){logger['error']('['+_0x46a186[_0x444b('0x9e')][_0x444b('0x9d')]()+']',JSON[_0x444b('0x10')](_0x2a9f71));});}; \ No newline at end of file +var _0x51a1=['[HTTP]','stringify','includes','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','access_token','isBefore','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','POST','/oauth/v2/token','refreshToken','refresh_token','then','add','error','Failing\x20creating\x20the\x20access_token','info','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','isNil','email','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','details','enduserType','moduleCreate','Error:\x20','log','CREATE\x20ERROR','GET','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','nothing','contact','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','administrator','Subject','getString','Subjects','Description','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','lastevent','connect','Call_Result','Answered','rejected','Rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','code','SUCCESS','Call\x20created!','err','stack','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','https://crm.','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','socket.io-emitter','redis','emit','debug'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x51a1,0x1b7));var _0x151a=function(_0x407d93,_0x4fad40){_0x407d93=_0x407d93-0x0;var _0x3c0bec=_0x51a1[_0x407d93];return _0x3c0bec;};'use strict';var _=require(_0x151a('0x0'));var rp=require(_0x151a('0x1'));var md5=require('md5');var util=require(_0x151a('0x2'));var intUtil=require(_0x151a('0x3'));var moment=require(_0x151a('0x4'));var Redis=require(_0x151a('0x5'));var BPromise=require('bluebird');var config=require(_0x151a('0x6'));var logger=require(_0x151a('0x7'))(_0x151a('0x8'));config['redis']=_[_0x151a('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x151a('0xa'))(new Redis(config[_0x151a('0xb')]));function emit(_0x1ee8a9,_0x32c652,_0x23b2ad){io['to'](_0x1ee8a9)[_0x151a('0xc')](_0x32c652,_0x23b2ad);}function request(_0x1ae016){logger[_0x151a('0xd')](_0x151a('0xe'),JSON[_0x151a('0xf')](_0x1ae016));return rp(_0x1ae016);}function getCustomFields(_0x47d443,_0xbd8d7b){var _0xfa0b2b={};if(_0x47d443['length']>0x0){_['forEach'](_0x47d443,function(_0x54782a){if(_[_0x151a('0x10')](['string','picklist'],_0x54782a[_0x151a('0x11')])&&_0x54782a[_0x151a('0x12')]){_0xfa0b2b[_0x54782a[_0x151a('0x12')]]=_0x54782a[_0x151a('0x13')][_0x151a('0x14')]();}else if(_0x54782a['type']===_0x151a('0x15')&&_0x54782a['variableName']&&_0x54782a[_0x151a('0x12')]&&_0xbd8d7b[_0x54782a['variableName']]){_0xfa0b2b[_0x54782a[_0x151a('0x12')]]=_0xbd8d7b[_0x54782a[_0x151a('0x16')]]['toString']();}else if(_0x54782a[_0x151a('0x11')]===_0x151a('0x17')&&_0x54782a['Variable']&&_0x54782a['Variable']['name']&&_0x54782a['idField']&&_0xbd8d7b[_0x54782a[_0x151a('0x18')][_0x151a('0x19')][_0x151a('0x1a')]()]){_0xfa0b2b[_0x54782a[_0x151a('0x12')]]=_0xbd8d7b[_0x54782a[_0x151a('0x18')][_0x151a('0x19')][_0x151a('0x1a')]()][_0x151a('0x14')]();}});}return _0xfa0b2b;}function getName(_0x5cad85){if(_0x5cad85['indexOf']('\x20')>0x0){var _0x458099=_0x5cad85[_0x151a('0x1b')](/ (.+)/);if(_0x458099[0x1]){return _0x458099;}}return[_0x5cad85,_0x5cad85];}var accountsTokens={};function getAccessToken(_0x321c5a){return new Promise(function(_0x29aba5,_0x3c4295){if(!_['isNil'](accountsTokens[_0x321c5a['id']])&&!_['isNil'](accountsTokens[_0x321c5a['id']][_0x151a('0x1c')])){if(moment()[_0x151a('0x1d')](accountsTokens[_0x321c5a['id']][_0x151a('0x1e')])){_0x29aba5(accountsTokens[_0x321c5a['id']][_0x151a('0x1c')]);}}var _0x1fbdad;switch(_0x321c5a[_0x151a('0x1f')]){case'US':_0x1fbdad=_0x151a('0x20');break;case'AU':_0x1fbdad=_0x151a('0x21');break;case'EU':_0x1fbdad=_0x151a('0x22');break;case'IN':_0x1fbdad=_0x151a('0x23');break;case'CN':_0x1fbdad=_0x151a('0x24');break;default:_0x1fbdad=_0x151a('0x22');break;}var _0x4f15a6={'method':_0x151a('0x25'),'uri':_0x1fbdad+_0x151a('0x26'),'qs':{'refresh_token':_0x321c5a[_0x151a('0x27')],'client_id':_0x321c5a['clientId'],'client_secret':_0x321c5a['clientSecret'],'grant_type':_0x151a('0x28')},'json':!![]};return rp(_0x4f15a6)[_0x151a('0x29')](function(_0x447651){accountsTokens[_0x321c5a['id']]={'access_token':_0x447651[_0x151a('0x1c')],'expires_in':moment()[_0x151a('0x2a')](_0x447651[_0x151a('0x1e')],'seconds')};_0x29aba5(_0x447651[_0x151a('0x1c')]);})['catch'](function(_0x208442){logger[_0x151a('0x2b')](_0x151a('0x2c'),_0x208442['stack']);_0x3c4295(_0x208442);});});}function getUser(_0x3c3143,_0x5c1b01,_0x406041,_0x2fac5b){logger[_0x151a('0x2d')]('Search\x20user');return request({'method':'GET','uri':util[_0x151a('0x2e')](_0x151a('0x2f'),_0x5c1b01),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x151a('0x30')+_0x3c3143},'json':!![]})[_0x151a('0x29')](function(_0x12f106){if(_0x12f106[_0x151a('0x31')]){var _0x44cbbd=-0x1;if(_[_0x151a('0x32')](_0x12f106[_0x151a('0x31')])){if(!_[_0x151a('0x33')](_0x2fac5b)){_0x44cbbd=_['findIndex'](_0x12f106[_0x151a('0x31')],function(_0x3add69){return _0x3add69[_0x151a('0x34')]===_0x2fac5b;});}if(_0x44cbbd>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x151a('0x2d')](_0x151a('0x35'));_0x44cbbd=_[_0x151a('0x36')](_0x12f106['users'],function(_0xfe994a){return _0xfe994a['profile']['name']==='Administrator';});}return _0x12f106[_0x151a('0x31')][_0x44cbbd];}else{if(_0x12f106['user'][_0x151a('0x37')]['name']===_0x151a('0x38')){logger['info'](_0x151a('0x35'));user=_0x12f106['user'];return user;}else{logger[_0x151a('0x2b')](_0x151a('0x39'),JSON[_0x151a('0xf')](_0x12f106));throw new Error(_0x151a('0x3a')+JSON[_0x151a('0xf')](_0x12f106));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x151a('0xf')](_0x12f106));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x151a('0xf')](_0x12f106));}})[_0x151a('0x3b')](function(_0x1300c8){console[_0x151a('0x2b')](_0x1300c8);});}function getZohoUser(_0x2c1270,_0x467323){return new BPromise(function(_0x1d62fb,_0x5b1ffe){request(_0x2c1270)[_0x151a('0x29')](function(_0x5ab23b){var _0x2d093f=null;if(_0x5ab23b){_0x2d093f=_0x5ab23b[_0x151a('0x3c')][0x0];_0x2d093f['enduserType']=_0x467323;}_0x1d62fb(_0x2d093f);})[_0x151a('0x3b')](function(_0x451040){_0x5b1ffe(_0x451040);});});}function createEndUser(_0x31f879,_0x4300e3,_0x12912,_0x4355e3,_0x3f1289,_0x3057ea){var _0x12912=getName(_0x12912);return request({'method':'POST','uri':_0x151a('0x3d')+_0x4300e3+_0x151a('0x3e')+_[_0x151a('0x3f')](_0x3057ea['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x12912[0x1],'First_Name':_0x12912[0x0],'Phone':_0x4355e3,'Owner':{'name':!_[_0x151a('0x33')](_0x3f1289[_0x151a('0x40')][_0x151a('0x19')])?_0x3f1289[_0x151a('0x40')][_0x151a('0x19')]:!_[_0x151a('0x33')](_0x3f1289[_0x151a('0x41')])?_0x3f1289[_0x151a('0x41')]+'\x20'+_0x3f1289[_0x151a('0x42')]:_0x3f1289[_0x151a('0x42')],'id':_0x3f1289['id']}}]},'headers':{'Authorization':_0x151a('0x30')+_0x31f879},'json':!![]})[_0x151a('0x29')](function(_0x4454df){if(_0x4454df&&_0x4454df[_0x151a('0x3c')][0x0]['code']==='SUCCESS'){var _0x122473=_0x4454df[_0x151a('0x3c')][0x0][_0x151a('0x43')];_0x122473[_0x151a('0x44')]=_[_0x151a('0x3f')](_0x3057ea[_0x151a('0x45')])+'s';return _0x122473;}logger[_0x151a('0x2b')]('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0x151a('0x46')+JSON['stringify'](data));})[_0x151a('0x3b')](function(_0x15210e){console[_0x151a('0x47')](_0x151a('0x48'),_0x15210e);});}function getEndUser(_0x4835d4,_0x12c8a1,_0x3fe508,_0x502be9,_0x19b9ae,_0x51f9ec,_0x33ffc3){var _0x9cb10b={'method':_0x151a('0x49'),'uri':'','headers':{'Authorization':_0x151a('0x30')+_0x4835d4},'json':!![]};switch(_0x33ffc3['moduleSearch']){case _0x151a('0x4a'):_0x9cb10b[_0x151a('0x4b')]='https://www.zohoapis.'+_0x12c8a1+_0x151a('0x4c')+_0x19b9ae+'))';return getZohoUser(_0x9cb10b,_0x151a('0x4d'))[_0x151a('0x29')](function(_0x21b322){if(_0x21b322)return _0x21b322;_0x9cb10b[_0x151a('0x4b')]=_0x151a('0x3d')+_0x12c8a1+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x19b9ae+'))';return getZohoUser(_0x9cb10b,_0x151a('0x4e'))[_0x151a('0x29')](function(_0x404bb6){if(_0x404bb6)return _0x404bb6;if(_0x33ffc3[_0x151a('0x45')]!=_0x151a('0x4f')){return createEndUser(_0x4835d4,_0x12c8a1,_0x502be9,_0x19b9ae,_0x51f9ec,_0x33ffc3);}else{return{};}});});break;case _0x151a('0x50'):_0x9cb10b[_0x151a('0x4b')]=_0x151a('0x3d')+_0x12c8a1+_0x151a('0x4c')+_0x19b9ae+'))';return getZohoUser(_0x9cb10b,_0x151a('0x4d'))[_0x151a('0x29')](function(_0x1d9654){if(_0x1d9654)return _0x1d9654;if(_0x33ffc3['moduleCreate']!=_0x151a('0x4f')){return createEndUser(_0x4835d4,_0x12c8a1,_0x502be9,_0x19b9ae,_0x51f9ec,_0x33ffc3);}else{return{};}});break;case'lead':_0x9cb10b[_0x151a('0x4b')]=_0x151a('0x3d')+_0x12c8a1+_0x151a('0x51')+_0x19b9ae+'))';return getZohoUser(_0x9cb10b,'Leads')[_0x151a('0x29')](function(_0x1dc4ad){if(_0x1dc4ad)return _0x1dc4ad;if(_0x33ffc3[_0x151a('0x45')]!=_0x151a('0x4f')){return createEndUser(_0x4835d4,_0x12c8a1,_0x502be9,_0x19b9ae,_0x51f9ec,_0x33ffc3);}else{return{};}});break;}}function getCall(_0x40cfcc,_0x2e82f5,_0x32cd12,_0x5be6ea,_0x3b23c4,_0x3537ed,_0x1dde58,_0xb5c30f){logger[_0x151a('0x2d')]('Creating\x20new\x20call...');var _0x2056a9={};_0x2056a9[_0x151a('0x52')]={'name':!_[_0x151a('0x33')](_0x5be6ea[_0x151a('0x40')]['name'])&&!_[_0x151a('0x33')](_0x5be6ea['profile']['name'])&&_0x5be6ea[_0x151a('0x37')][_0x151a('0x19')]===_0x151a('0x53')?_0x5be6ea['role'][_0x151a('0x19')]:!_['isNil'](_0x5be6ea['first_name'])?_0x5be6ea[_0x151a('0x41')]+'\x20'+_0x5be6ea[_0x151a('0x42')]:_0x5be6ea[_0x151a('0x42')],'id':_0x5be6ea['id']};_0x2056a9[_0x151a('0x54')]=intUtil[_0x151a('0x55')](_0x3537ed[_0x151a('0x56')],_0x1dde58,'\x20');_0x2056a9[_0x151a('0x57')]=intUtil[_0x151a('0x55')](_0x3537ed['Descriptions'],_0x1dde58,'\x0a');if(_0x3b23c4[_0x151a('0x44')]==='Contacts'){_0x2056a9[_0x151a('0x58')]={'name':!_[_0x151a('0x33')](_0x3b23c4[_0x151a('0x59')])?_0x3b23c4[_0x151a('0x59')]:!_[_0x151a('0x33')](_0x3b23c4['First_Name'])?_0x3b23c4['First_Name']+'\x20'+_0x3b23c4[_0x151a('0x5a')]:_0x3b23c4[_0x151a('0x5a')],'id':_0x3b23c4['id']};}if(_0x3b23c4[_0x151a('0x44')]===_0x151a('0x4e')){_0x2056a9[_0x151a('0x5b')]={'name':!_['isNil'](_0x3b23c4[_0x151a('0x59')])?_0x3b23c4['Full_Name']:!_[_0x151a('0x33')](_0x3b23c4[_0x151a('0x5c')])?_0x3b23c4[_0x151a('0x5c')]+'\x20'+_0x3b23c4[_0x151a('0x5a')]:_0x3b23c4['Last_Name'],'id':_0x3b23c4['id']};_0x2056a9[_0x151a('0x5d')]=_[_0x151a('0x3f')](_0x3b23c4['enduserType']);}if(_0x1dde58[_0x151a('0x5e')]){_0x2056a9[_0x151a('0x5f')]=moment[_0x151a('0x60')](parseInt(_0x1dde58[_0x151a('0x5e')])*0x3e8)[_0x151a('0x2e')](_0x151a('0x61'));}else if(_0x1dde58[_0x151a('0x62')]&&_0x1dde58[_0x151a('0x63')]){_0x2056a9[_0x151a('0x5f')]=moment[_0x151a('0x60')](moment(_0x1dde58[_0x151a('0x63')],_0x151a('0x64'))['diff'](moment(_0x1dde58['starttime'],_0x151a('0x64'))))['format'](_0x151a('0x61'));}switch(_0x1dde58[_0x151a('0x65')]){case'called':_0x2056a9['Call_Result']='Called';break;case'complete':case _0x151a('0x66'):_0x2056a9[_0x151a('0x67')]=_0x151a('0x68');break;case _0x151a('0x69'):_0x2056a9['Call_Result']=_0x151a('0x6a');break;case _0x151a('0x6b'):_0x2056a9[_0x151a('0x67')]='Abandoned';break;case _0x151a('0x6c'):_0x2056a9[_0x151a('0x67')]=_0x151a('0x6d');default:}_0x2056a9[_0x151a('0x6e')]=(_0xb5c30f===_0x151a('0x6f')?moment(_0x1dde58[_0x151a('0x70')])[_0x151a('0x2e')](_0x151a('0x64')):moment(_0x1dde58[_0x151a('0x71')])['format'](_0x151a('0x64')))||moment()[_0x151a('0x2e')](_0x151a('0x64'));_0x2056a9[_0x151a('0x72')]=_0xb5c30f||_0x151a('0x73');_0x2056a9=_[_0x151a('0x74')](_0x2056a9,getCustomFields(_0x3537ed[_0x151a('0x75')],_0x1dde58));return request({'method':'POST','uri':_0x151a('0x3d')+_0x2e82f5+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x40cfcc},'body':{'data':[_0x2056a9]},'json':!![]})[_0x151a('0x29')](function(_0x5e2fc5){if(_0x5e2fc5&&_0x5e2fc5['data'][0x0][_0x151a('0x76')]===_0x151a('0x77')){logger[_0x151a('0x2d')](_0x151a('0x78'));return{'id':_0x5e2fc5['data'][0x0]['details']['id']};}})[_0x151a('0x3b')](function(_0x589fd7){logger['info'](_0x151a('0x79'),_0x589fd7[_0x151a('0x7a')]);console['log']('err',_0x589fd7);});}exports[_0x151a('0x7b')]=function(_0x152098,_0x302fa6,_0x1db904,_0x12a38d,_0x22f609,_0x16524d){var _0x1c3e65,_0x477b06,_0x43adcc;_0x16524d[_0x151a('0x7c')]=intUtil[_0x151a('0x7d')](_0x16524d[_0x151a('0x7c')]);_0x16524d['serverUrl']=intUtil['stripTrailingSlash'](_0x16524d[_0x151a('0x7e')]);if(_0x22f609&&_0x22f609[_0x151a('0x7f')]){logger['info'](_0x151a('0x80'),'Recording\x20is\x20enabled!');_0x302fa6['recordingURL']=_0x16524d[_0x151a('0x7e')]+_0x151a('0x81')+_0x302fa6[_0x151a('0x82')]+_0x151a('0x83')+md5(_0x302fa6[_0x151a('0x82')]);}else{_0x302fa6[_0x151a('0x84')]='';}var _0x4e16fb=_0x16524d[_0x151a('0x7c')]===_0x151a('0x85')?'eu':_0x151a('0x86');return getAccessToken(_0x16524d)[_0x151a('0x29')](function(_0x1d2696){_0x43adcc=_0x1d2696;return getUser(_0x43adcc,_0x4e16fb,_0x16524d,_0x12a38d['email']);})['then'](function(_0x24a74a){_0x1c3e65=_0x24a74a;logger[_0x151a('0x2d')](_0x151a('0x87'),_0x1c3e65['id']);return getEndUser(_0x43adcc,_0x4e16fb,_0x16524d,_0x302fa6['calleridname'],_0x302fa6[_0x151a('0x88')],_0x1c3e65,_0x1db904);})[_0x151a('0x29')](function(_0x3835bf){_0x477b06=_0x3835bf;return getCall(_0x43adcc,_0x4e16fb,_0x16524d,_0x1c3e65,_0x477b06,_0x1db904,_0x302fa6,_0x151a('0x73'));})[_0x151a('0x29')](function(_0x4105ee){if(_0x4105ee){logger[_0x151a('0x2d')](_0x151a('0x89'),_0x4105ee['id']);logger[_0x151a('0x2d')](_0x151a('0x80'),_0x151a('0x8a'));emit(util[_0x151a('0x2e')](_0x151a('0x8b'),_0x12a38d[_0x151a('0x19')]),_0x151a('0x8c'),{'uri':'https://crm.'+_0x16524d[_0x151a('0x7c')]+_0x151a('0x8d')+_0x4105ee['id']});}})['catch'](function(_0x1ad76c){logger[_0x151a('0x2b')]('[QUEUE]',JSON['stringify'](_0x1ad76c));});};exports[_0x151a('0x6f')]=function(_0x29e6c9,_0x5144bd,_0x1f4e82,_0x208a37,_0x4a97ea,_0x7acbb8,_0x370bb3){var _0x340928,_0x2e9507,_0xd27cdf;_0x7acbb8['host']=intUtil['stripTrailingSlash'](_0x7acbb8[_0x151a('0x7c')]);_0x7acbb8[_0x151a('0x7e')]=intUtil[_0x151a('0x7d')](_0x7acbb8[_0x151a('0x7e')]);if(_0x370bb3&&_0x370bb3[_0x151a('0x8e')]&&_0x370bb3[_0x151a('0x8e')]!==_0x151a('0x8f')){logger['info'](_0x151a('0x90'),'Recording\x20is\x20enabled!');_0x5144bd[_0x151a('0x84')]=_0x7acbb8[_0x151a('0x7e')]+_0x151a('0x81')+_0x5144bd[_0x151a('0x82')]+_0x151a('0x83')+md5(_0x5144bd['uniqueid']);}var _0x48bd3a=_0x7acbb8[_0x151a('0x7c')]==='zoho.eu'?'eu':_0x151a('0x86');return getAccessToken(_0x7acbb8)[_0x151a('0x29')](function(_0x27605b){_0xd27cdf=_0x27605b;return getUser(_0xd27cdf,_0x48bd3a,_0x7acbb8,_0x208a37[_0x151a('0x34')]);})[_0x151a('0x29')](function(_0x26f833){_0x340928=_0x26f833;logger[_0x151a('0x2d')](_0x151a('0x87'),_0x340928['id']);return getEndUser(_0xd27cdf,_0x48bd3a,_0x7acbb8,_0x5144bd[_0x151a('0x91')],_0x5144bd[_0x151a('0x92')],_0x340928,_0x1f4e82);})['then'](function(_0x17d645){_0x2e9507=_0x17d645;return getCall(_0xd27cdf,_0x48bd3a,_0x7acbb8,_0x340928,_0x2e9507,_0x1f4e82,_0x5144bd,_0x151a('0x93'));})['then'](function(_0x5ead12){if(_0x5ead12){logger[_0x151a('0x2d')](_0x151a('0x89'),_0x5ead12['id']);logger['info'](_0x151a('0x90'),_0x151a('0x8a'));emit(util[_0x151a('0x2e')](_0x151a('0x8b'),_0x208a37[_0x151a('0x19')]),_0x151a('0x8c'),{'uri':_0x151a('0x94')+_0x7acbb8[_0x151a('0x7c')]+_0x151a('0x8d')+_0x5ead12['id']});}})[_0x151a('0x3b')](function(_0x1470ed){logger[_0x151a('0x2b')](_0x151a('0x90'),JSON[_0x151a('0xf')](_0x1470ed));});};exports['unmanaged']=function(_0x312ee9,_0x290afb,_0x2e3b14,_0x2a7882,_0x3efcf5,_0x149db4){var _0x5eb931,_0x2d37eb,_0x1f9af2;_0x149db4[_0x151a('0x7c')]=intUtil[_0x151a('0x7d')](_0x149db4[_0x151a('0x7c')]);_0x149db4[_0x151a('0x7e')]=intUtil[_0x151a('0x7d')](_0x149db4[_0x151a('0x7e')]);if(_0x3efcf5&&_0x3efcf5[_0x151a('0x7f')]){logger[_0x151a('0x2d')]('['+_0x290afb[_0x151a('0x65')][_0x151a('0x95')]()+']',_0x151a('0x96'));_0x290afb['recordingURL']=_0x149db4[_0x151a('0x7e')]+'/api/voice/recordings/'+_0x290afb[_0x151a('0x82')]+_0x151a('0x83')+md5(_0x290afb[_0x151a('0x82')]);}else{_0x290afb[_0x151a('0x84')]='';}var _0x4d831e=_0x149db4[_0x151a('0x7c')]===_0x151a('0x85')?'eu':_0x151a('0x86');return getAccessToken(_0x149db4)[_0x151a('0x29')](function(_0x2e820b){_0x1f9af2=_0x2e820b;return getUser(_0x1f9af2,_0x4d831e,_0x149db4);})[_0x151a('0x29')](function(_0x539537){_0x5eb931=_0x539537;logger[_0x151a('0x2d')](_0x151a('0x87'),_0x5eb931['id']);return getEndUser(_0x1f9af2,_0x4d831e,_0x149db4,_0x290afb['calleridname'],_0x290afb[_0x151a('0x88')],_0x5eb931,_0x2e3b14);})['then'](function(_0x3f25b4){_0x2d37eb=_0x3f25b4;return getCall(_0x1f9af2,_0x4d831e,_0x149db4,_0x5eb931,_0x2d37eb,_0x2e3b14,_0x290afb,_0x151a('0x73'));})['then'](function(_0x252ddc){if(_0x252ddc){logger['info']('The\x20Call\x20ID\x20is:',_0x252ddc['id']);}})[_0x151a('0x3b')](function(_0x2c1058){logger[_0x151a('0x2b')]('['+_0x290afb['lastevent']['toUpperCase']()+']',JSON[_0x151a('0xf')](_0x2c1058));});}; \ 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 b335026..9c51b6a 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 _0xa335=['format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xa335,0xc2));var _0x5a33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa335[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x5a33('0x0'));var sh=require(_0x5a33('0x1'));var Mustache=require('mustache');var logger=require(_0x5a33('0x2'))(_0x5a33('0x3'));exports[_0x5a33('0x4')]=function(_0x32f108,_0x1f9d8b){var _0x809b93=_0x32f108[_0x5a33('0x5')]?_0x32f108[_0x5a33('0x5')]:_0x5a33('0x6');var _0x41e8cc=_0x32f108[_0x5a33('0x7')]?Mustache['render'](_0x32f108[_0x5a33('0x7')],_0x1f9d8b):_0x1f9d8b;sh[_0x5a33('0x4')](_0x41e8cc,function(_0x46e391,_0x1a63a4,_0x38d6cf){if(_0x46e391!==0x0){logger['error'](util['format'](_0x5a33('0x8'),_0x809b93,_0x41e8cc,_0x46e391,_0x38d6cf));}else{logger[_0x5a33('0x9')](util[_0x5a33('0xa')](_0x5a33('0xb'),_0x809b93,_0x41e8cc,_0x1a63a4));}});}; \ No newline at end of file +var _0xeb98=['data2','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger','exec'];(function(_0x19b43f,_0x25982d){var _0x1fb7b5=function(_0x39f99a){while(--_0x39f99a){_0x19b43f['push'](_0x19b43f['shift']());}};_0x1fb7b5(++_0x25982d);}(_0xeb98,0x11a));var _0x8eb9=function(_0x2351a7,_0x1fc96a){_0x2351a7=_0x2351a7-0x0;var _0x15df63=_0xeb98[_0x2351a7];return _0x15df63;};'use strict';var util=require(_0x8eb9('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x8eb9('0x1'))(_0x8eb9('0x2'));exports[_0x8eb9('0x3')]=function(_0x3ba513,_0x32d52d){var _0x55e1ca=_0x3ba513['data2']?_0x3ba513[_0x8eb9('0x4')]:'Script';var _0x329766=_0x3ba513['data3']?Mustache[_0x8eb9('0x5')](_0x3ba513[_0x8eb9('0x6')],_0x32d52d):_0x32d52d;sh[_0x8eb9('0x3')](_0x329766,function(_0x5322a8,_0x4d0a97,_0x4596f4){if(_0x5322a8!==0x0){logger[_0x8eb9('0x7')](util[_0x8eb9('0x8')](_0x8eb9('0x9'),_0x55e1ca,_0x329766,_0x5322a8,_0x4596f4));}else{logger['info'](util[_0x8eb9('0x8')](_0x8eb9('0xa'),_0x55e1ca,_0x329766,_0x4d0a97));}});}; \ 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 c26a737..4f0ba17 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 _0x5ac9=['lodash','../../../../config/logger','exec','toUpperCase','render','data2','data5','headers','data6','parse','error','stack','data1','GET','PUT','data7','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','%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','util'];(function(_0x47fad0,_0x205240){var _0x721330=function(_0x14f3d7){while(--_0x14f3d7){_0x47fad0['push'](_0x47fad0['shift']());}};_0x721330(++_0x205240);}(_0x5ac9,0x116));var _0x95ac=function(_0x132449,_0x5320c7){_0x132449=_0x132449-0x0;var _0x27e642=_0x5ac9[_0x132449];return _0x27e642;};'use strict';var rp=require('request-promise');var util=require(_0x95ac('0x0'));var _=require(_0x95ac('0x1'));var Mustache=require('mustache');var logger=require(_0x95ac('0x2'))('trigger');exports[_0x95ac('0x3')]=function(_0x38b940,_0x3b4c62){var _0x4a3217,_0x17f5e4;var _0xeb0f61={'method':_0x38b940['data1'][_0x95ac('0x4')](),'uri':Mustache[_0x95ac('0x5')](_0x38b940[_0x95ac('0x6')],_0x3b4c62),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x38b940['data5'])==='number'&&parseInt(_0x38b940[_0x95ac('0x7')])>=0x1&&parseInt(_0x38b940[_0x95ac('0x7')])<=0xa?parseInt(_0x38b940['data5'])*0x3e8:0x5*0x3e8};try{_0xeb0f61[_0x95ac('0x8')]=_0x38b940[_0x95ac('0x9')]?JSON[_0x95ac('0xa')](Mustache[_0x95ac('0x5')](_0x38b940[_0x95ac('0x9')],_0x3b4c62)):{};}catch(_0x30fde7){logger[_0x95ac('0xb')](_0x30fde7[_0x95ac('0xc')]);}switch(_0x38b940[_0x95ac('0xd')][_0x95ac('0x4')]()){case _0x95ac('0xe'):case'DELETE':_0x4a3217=null;_0xeb0f61['qs']=_0x3b4c62;break;case'POST':case _0x95ac('0xf'):if(_0x38b940[_0x95ac('0x10')]){try{_0x4a3217=JSON[_0x95ac('0xa')](Mustache[_0x95ac('0x5')](_0x38b940[_0x95ac('0x10')],_0x3b4c62));_0xeb0f61[_0x95ac('0x11')]=_0x4a3217;}catch(_0x12f6aa){logger[_0x95ac('0xb')](_0x12f6aa[_0x95ac('0xc')]);logger[_0x95ac('0xb')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4a3217=_0x3b4c62;_0xeb0f61[_0x95ac('0x11')]=_0x4a3217;}break;}logger[_0x95ac('0x12')](util[_0x95ac('0x13')](_0x95ac('0x14'),_0x38b940['data1'],_0x38b940[_0x95ac('0x6')],JSON[_0x95ac('0x15')](_0xeb0f61)));rp(_0xeb0f61)[_0x95ac('0x16')](function(_0x5e72ae){_0x4a3217=!_[_0x95ac('0x17')](_0x4a3217)?_0x95ac('0x18')+_0x4a3217:'';_0x17f5e4=typeof _0x5e72ae[_0x95ac('0x11')]==='object'?JSON['stringify'](_0x5e72ae[_0x95ac('0x11')]):_0x5e72ae[_0x95ac('0x11')];logger[_0x95ac('0x12')](util['format'](_0x95ac('0x19'),_0x38b940[_0x95ac('0xd')],_0x38b940[_0x95ac('0x6')],_0x5e72ae[_0x95ac('0x1a')],_0x17f5e4));})[_0x95ac('0x1b')](function(_0x34bc85){logger['error'](util['format'](_0x95ac('0x1c'),_0x38b940['data1'],_0x38b940[_0x95ac('0x6')],_0x34bc85['statusCode'],_0x34bc85[_0x95ac('0x1d')],_0x34bc85[_0x95ac('0x1e')]));});}; \ No newline at end of file +var _0x73ed=['data1','GET','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','isNil',',\x20request\x20body:\x20','info','%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','lodash','mustache','../../../../config/logger','trigger','toUpperCase','render','data5','data6','parse','error','stack'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x73ed,0x129));var _0xd73e=function(_0x11f907,_0x38aaf0){_0x11f907=_0x11f907-0x0;var _0x2b8ae9=_0x73ed[_0x11f907];return _0x2b8ae9;};'use strict';var rp=require(_0xd73e('0x0'));var util=require(_0xd73e('0x1'));var _=require(_0xd73e('0x2'));var Mustache=require(_0xd73e('0x3'));var logger=require(_0xd73e('0x4'))(_0xd73e('0x5'));exports['exec']=function(_0x16a92b,_0x18a2be){var _0x421f3c,_0x13fdcf;var _0x19d003={'method':_0x16a92b['data1'][_0xd73e('0x6')](),'uri':Mustache[_0xd73e('0x7')](_0x16a92b['data2'],_0x18a2be),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x16a92b['data5'])==='number'&&parseInt(_0x16a92b[_0xd73e('0x8')])>=0x1&&parseInt(_0x16a92b[_0xd73e('0x8')])<=0xa?parseInt(_0x16a92b[_0xd73e('0x8')])*0x3e8:0x5*0x3e8};try{_0x19d003['headers']=_0x16a92b[_0xd73e('0x9')]?JSON[_0xd73e('0xa')](Mustache[_0xd73e('0x7')](_0x16a92b[_0xd73e('0x9')],_0x18a2be)):{};}catch(_0x1480e8){logger[_0xd73e('0xb')](_0x1480e8[_0xd73e('0xc')]);}switch(_0x16a92b[_0xd73e('0xd')][_0xd73e('0x6')]()){case _0xd73e('0xe'):case'DELETE':_0x421f3c=null;_0x19d003['qs']=_0x18a2be;break;case _0xd73e('0xf'):case'PUT':if(_0x16a92b[_0xd73e('0x10')]){try{_0x421f3c=JSON[_0xd73e('0xa')](Mustache[_0xd73e('0x7')](_0x16a92b[_0xd73e('0x10')],_0x18a2be));_0x19d003['body']=_0x421f3c;}catch(_0x4673b0){logger['error'](_0x4673b0[_0xd73e('0xc')]);logger['error'](_0xd73e('0x11'));}}else{_0x421f3c=_0x18a2be;_0x19d003[_0xd73e('0x12')]=_0x421f3c;}break;}logger['info'](util[_0xd73e('0x13')](_0xd73e('0x14'),_0x16a92b[_0xd73e('0xd')],_0x16a92b[_0xd73e('0x15')],JSON['stringify'](_0x19d003)));rp(_0x19d003)['then'](function(_0x138242){_0x421f3c=!_[_0xd73e('0x16')](_0x421f3c)?_0xd73e('0x17')+_0x421f3c:'';_0x13fdcf=typeof _0x138242[_0xd73e('0x12')]==='object'?JSON['stringify'](_0x138242[_0xd73e('0x12')]):_0x138242[_0xd73e('0x12')];logger[_0xd73e('0x18')](util[_0xd73e('0x13')](_0xd73e('0x19'),_0x16a92b[_0xd73e('0xd')],_0x16a92b[_0xd73e('0x15')],_0x138242[_0xd73e('0x1a')],_0x13fdcf));})[_0xd73e('0x1b')](function(_0x9beaf5){logger['error'](util[_0xd73e('0x13')](_0xd73e('0x1c'),_0x16a92b[_0xd73e('0xd')],_0x16a92b['data2'],_0x9beaf5[_0xd73e('0x1a')],_0x9beaf5[_0xd73e('0x1d')],_0x9beaf5[_0xd73e('0x1e')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 2161d39..7340a69 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 _0xdb10=['request','then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','../../config/logger','http','Request'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0xdb10,0xa4));var _0x0db1=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xdb10[_0x33032e];return _0x13316b;};'use strict';var jayson=require(_0x0db1('0x0'));var BPromise=require('bluebird');var logger=require(_0x0db1('0x1'))('routing');var client=jayson['client'][_0x0db1('0x2')]({'port':0x2329});client[_0x0db1('0x3')]=function(_0x5f3d0c,_0x1e8dc3){return new BPromise(function(_0x12a8eb,_0x2e023f){return client[_0x0db1('0x4')](_0x5f3d0c,_0x1e8dc3)[_0x0db1('0x5')](function(_0x5c2835){logger[_0x0db1('0x6')](_0x0db1('0x7'),_0x0db1('0x8'),_0x5f3d0c,_0x1e8dc3,_0x5c2835);if(_0x5c2835[_0x0db1('0x9')]){logger['error'](_0x0db1('0x7'),_0x0db1('0x8'),_0x5f3d0c,_0x5c2835['error'][_0x0db1('0xa')],_0x1e8dc3);return _0x2e023f(_0x5c2835[_0x0db1('0x9')]['message']);}else{return _0x12a8eb(_0x5c2835[_0x0db1('0xb')]);}})[_0x0db1('0xc')](function(_0x2c8047){logger['error']('rpc',_0x0db1('0x8'),_0x5f3d0c,_0x2c8047,_0x1e8dc3);return _0x2e023f(_0x2c8047);});});};module[_0x0db1('0xd')]=client; \ No newline at end of file +var _0x3ed3=['Request','request','debug','rpc','routing','error','message','exports','jayson/promise','bluebird','../../config/logger','client'];(function(_0x2646f6,_0x287adf){var _0x577237=function(_0x4d2d6f){while(--_0x4d2d6f){_0x2646f6['push'](_0x2646f6['shift']());}};_0x577237(++_0x287adf);}(_0x3ed3,0x140));var _0x33ed=function(_0x3f15d0,_0x34623f){_0x3f15d0=_0x3f15d0-0x0;var _0x9ae48f=_0x3ed3[_0x3f15d0];return _0x9ae48f;};'use strict';var jayson=require(_0x33ed('0x0'));var BPromise=require(_0x33ed('0x1'));var logger=require(_0x33ed('0x2'))('routing');var client=jayson[_0x33ed('0x3')]['http']({'port':0x2329});client[_0x33ed('0x4')]=function(_0x126090,_0x46bfec){return new BPromise(function(_0x2a511d,_0x49c1fe){return client[_0x33ed('0x5')](_0x126090,_0x46bfec)['then'](function(_0x2cae8a){logger[_0x33ed('0x6')](_0x33ed('0x7'),_0x33ed('0x8'),_0x126090,_0x46bfec,_0x2cae8a);if(_0x2cae8a['error']){logger['error'](_0x33ed('0x7'),_0x33ed('0x8'),_0x126090,_0x2cae8a[_0x33ed('0x9')][_0x33ed('0xa')],_0x46bfec);return _0x49c1fe(_0x2cae8a[_0x33ed('0x9')][_0x33ed('0xa')]);}else{return _0x2a511d(_0x2cae8a['result']);}})['catch'](function(_0x591cdd){logger[_0x33ed('0x9')](_0x33ed('0x7'),'routing',_0x126090,_0x591cdd,_0x46bfec);return _0x49c1fe(_0x591cdd);});});};module[_0x33ed('0xb')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 930ccf7..79286fa 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 _0xe038=['email','getMailAccounts','initMailAccounts','then','mailAccounts','listen','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./lib/email','../../config/logger'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe038,0x8c));var _0x8e03=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe038[_0x53ccf2];return _0x5a2964;};'use strict';var server=require(_0x8e03('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x8e03('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0x8e03('0x2'))(_0x8e03('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount[_0x8e03('0x4')]())['then'](realtime[_0x8e03('0x5')]())[_0x8e03('0x6')](function(){email['refresh'](realtime[_0x8e03('0x7')]);return realtime;});}function main(){return server[_0x8e03('0x8')](realtime,email)[_0x8e03('0x6')](function(){return initRealtime();})[_0x8e03('0x6')](function(){return setting[_0x8e03('0x9')]();})[_0x8e03('0x6')](function(_0x298e70){return setInterval(initRealtime,_0x298e70[_0x8e03('0xa')]*0x3e8);})[_0x8e03('0xb')](function(_0x2610b6){logger['error'](_0x8e03('0xc'),_0x2610b6);});}main(); \ No newline at end of file +var _0x2ae0=['error','./server','./realtime','./lib/email','./rpc/mailAccount','then','getMailAccounts','initMailAccounts','mailAccounts','listen','loginMailFrequency','catch'];(function(_0x54904e,_0x5647ff){var _0x179c42=function(_0x318885){while(--_0x318885){_0x54904e['push'](_0x54904e['shift']());}};_0x179c42(++_0x5647ff);}(_0x2ae0,0x18d));var _0x02ae=function(_0x283365,_0x704c4d){_0x283365=_0x283365-0x0;var _0x178caf=_0x2ae0[_0x283365];return _0x178caf;};'use strict';var server=require(_0x02ae('0x0'));var Realtime=require(_0x02ae('0x1'));var EmailChannel=require(_0x02ae('0x2'));var mailAccount=require(_0x02ae('0x3'));var setting=require('./rpc/setting');var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x02ae('0x4')](mailAccount[_0x02ae('0x5')]())['then'](realtime[_0x02ae('0x6')]())[_0x02ae('0x4')](function(){email['refresh'](realtime[_0x02ae('0x7')]);return realtime;});}function main(){return server[_0x02ae('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0x02ae('0x4')](function(){return setting['getSettings']();})['then'](function(_0x362ff9){return setInterval(initRealtime,_0x362ff9[_0x02ae('0x9')]*0x3e8);})[_0x02ae('0xa')](function(_0x28565d){logger[_0x02ae('0xb')]('Email\x20service\x20initialization',_0x28565d);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index ecc4c35..5415f00 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 _0x65d0=['Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','send','Smtp','verify','exports','lodash','moment','ioredis','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','name','key','Imap','messageStatus','total','isNil','emit','mailAccount:update','prototype','refresh','hasOwnProperty','active','service','provider','custom','box','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','status','disabled','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch'];(function(_0x2408e9,_0x25d054){var _0x21b69c=function(_0x1de3ca){while(--_0x1de3ca){_0x2408e9['push'](_0x2408e9['shift']());}};_0x21b69c(++_0x25d054);}(_0x65d0,0x152));var _0x065d=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x65d0[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x065d('0x0'));var moment=require(_0x065d('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0x065d('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x065d('0x3'));config[_0x065d('0x4')]=_[_0x065d('0x5')](config[_0x065d('0x4')],{'host':_0x065d('0x6'),'port':0x18eb});var io=require(_0x065d('0x7'))(new Redis(config[_0x065d('0x4')]));var EmailImap=require(_0x065d('0x8'));var EmailSmtp=require(_0x065d('0x9'));var mailAccount=require(_0x065d('0xa'));var md5Accounts={};function EmailChannel(_0x5ba192){logger['info']('start\x20email\x20channel');this[_0x065d('0xb')]=_0x5ba192[_0x065d('0xb')];this[_0x065d('0xc')]={};this[_0x065d('0xd')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x2bbdf3){var _0x22d243=this[_0x065d('0xb')][_0x2bbdf3];var _0x248e96={'id':_0x22d243['id'],'name':_0x22d243[_0x065d('0xe')],'key':_0x22d243[_0x065d('0xf')],'active':_0x22d243['active'],'Imap':{'status':_0x22d243['Imap']['status'],'messageStatus':_0x22d243[_0x065d('0x10')][_0x065d('0x11')],'total':_0x22d243[_0x065d('0x10')][_0x065d('0x12')]}};if(_[_0x065d('0x13')](md5Accounts[_0x2bbdf3])){md5Accounts[_0x2bbdf3]={};}var _0x138852=md5(JSON['stringify'](_0x248e96));if(md5Accounts[_0x2bbdf3]['md5']!==_0x138852){md5Accounts[_0x2bbdf3]['md5']=_0x138852;io[_0x065d('0x14')](_0x065d('0x15'),_0x248e96);}};EmailChannel[_0x065d('0x16')][_0x065d('0x17')]=function(_0x1f9e19){for(var _0x3de6bf in _0x1f9e19){if(_0x1f9e19[_0x065d('0x18')](_0x3de6bf)){if(_0x1f9e19[_0x3de6bf][_0x065d('0x10')]&&_0x1f9e19[_0x3de6bf][_0x065d('0x19')]){var _0xc79d38=_0x1f9e19[_0x3de6bf][_0x065d('0x10')];if(!_0xc79d38[_0x065d('0x1a')]&&_0x1f9e19[_0x3de6bf][_0x065d('0x1b')]!==_0x065d('0x1c'))_0xc79d38[_0x065d('0x1a')]=_0x1f9e19[_0x3de6bf][_0x065d('0x1b')];if(!this[_0x065d('0xc')]['hasOwnProperty'](_0xc79d38['id'])){this[_0x065d('0xc')][_0xc79d38['id']]=new EmailImap(_0xc79d38,_0x1f9e19[_0x3de6bf][_0x065d('0x3')]);this['imapAccounts'][_0xc79d38['id']]['on'](_0x065d('0x1d'),this['handleImapBox']['bind'](this,_0x3de6bf));this[_0x065d('0xc')][_0xc79d38['id']]['on'](_0x065d('0x3'),this[_0x065d('0x1e')][_0x065d('0x1f')](this,_0x3de6bf));this[_0x065d('0xc')][_0xc79d38['id']]['on'](_0x065d('0x20'),this[_0x065d('0x21')]['bind'](this,_0x3de6bf));this[_0x065d('0xc')][_0xc79d38['id']]['on'](_0x065d('0x22'),this[_0x065d('0x23')][_0x065d('0x1f')](this,_0x3de6bf));}}else{if(_[_0x065d('0x13')](this[_0x065d('0xb')][_0x3de6bf]['Imap'])){this[_0x065d('0xb')][_0x3de6bf][_0x065d('0x10')]={};}this[_0x065d('0xb')][_0x3de6bf][_0x065d('0x10')][_0x065d('0x24')]=_0x065d('0x25');this[_0x065d('0xb')][_0x3de6bf][_0x065d('0x10')][_0x065d('0x11')]='';this[_0x065d('0x14')](_0x3de6bf);}}}};EmailChannel[_0x065d('0x16')]['handleImapBox']=function(_0x4f6fab,_0x46e0a9){if(this[_0x065d('0xb')][_0x4f6fab]){this[_0x065d('0xb')][_0x4f6fab][_0x065d('0x10')]['status']='connected';this[_0x065d('0xb')][_0x4f6fab][_0x065d('0x10')][_0x065d('0x11')]=_0x46e0a9['name'];if(_0x46e0a9[_0x065d('0x26')]){this[_0x065d('0xb')][_0x4f6fab]['Imap'][_0x065d('0x12')]=_0x46e0a9[_0x065d('0x26')][_0x065d('0x12')];}return this[_0x065d('0x14')](_0x4f6fab);}};EmailChannel[_0x065d('0x16')][_0x065d('0x1e')]=function(_0x4597d0,_0x372f51){logger[_0x065d('0x27')](_0x065d('0x28'),_0x372f51[_0x065d('0x29')],_0x372f51[_0x065d('0x2a')],_0x372f51[_0x065d('0x2b')],_0x4597d0);if(this['mailAccounts'][_0x4597d0]){return mailAccount['notify'](_0x4597d0,_0x372f51)[_0x065d('0x2c')](function(_0xea4447){if(_0xea4447){logger[_0x065d('0x27')](_0x065d('0x2d'));}})[_0x065d('0x2e')](function(_0xcfc98e){logger['error'](_0x065d('0x2f'),JSON[_0x065d('0x30')](_0xcfc98e));});}};EmailChannel[_0x065d('0x16')]['handleImapEnd']=function(_0x53159b){if(this[_0x065d('0xb')][_0x53159b]&&this[_0x065d('0xb')][_0x53159b][_0x065d('0x10')]){if(this[_0x065d('0xc')][this[_0x065d('0xb')][_0x53159b]['Imap']['id']]){delete this[_0x065d('0xc')][this[_0x065d('0xb')][_0x53159b][_0x065d('0x10')]['id']];}this[_0x065d('0xb')][_0x53159b][_0x065d('0x10')][_0x065d('0x31')]=moment();this[_0x065d('0x14')](_0x53159b);}};EmailChannel[_0x065d('0x16')][_0x065d('0x23')]=function(_0xab2142,_0x428412){if(this[_0x065d('0xb')][_0xab2142]){this[_0x065d('0xb')][_0xab2142]['Imap'][_0x065d('0x24')]=_0x065d('0x22');this[_0x065d('0xb')][_0xab2142]['Imap'][_0x065d('0x11')]=_0x428412;return this[_0x065d('0x14')](_0xab2142);}};EmailChannel[_0x065d('0x16')][_0x065d('0x32')]=function(_0xf253eb,_0x19225e){return this['smtp'][_0x065d('0x33')](_0xf253eb,_0x19225e);};EmailChannel['prototype']['verifySmtp']=function(_0x13dd92){var _0x2c9cfc=this;if(this['mailAccounts'][_0x13dd92['id']]){if(_['isNil'](this[_0x065d('0xb')][_0x13dd92['id']][_0x065d('0x34')])){this[_0x065d('0xb')][_0x13dd92['id']][_0x065d('0x34')]={};}this[_0x065d('0xb')][_0x13dd92['id']][_0x065d('0x34')][_0x065d('0x31')]=moment();return new BPromise(function(_0x5120a7,_0x385aa8){return _0x2c9cfc[_0x065d('0xd')][_0x065d('0x35')](_0x13dd92)[_0x065d('0x2c')](function(_0x42c8df){_0x2c9cfc['mailAccounts'][_0x13dd92['id']]['Smtp'][_0x065d('0x24')]='verified';_0x2c9cfc['mailAccounts'][_0x13dd92['id']]['Smtp']['messageStatus']='';_0x2c9cfc[_0x065d('0x14')](_0x13dd92['id']);_0x5120a7(_0x42c8df);})['catch'](function(_0x383688){_0x2c9cfc[_0x065d('0xb')][_0x13dd92['id']][_0x065d('0x34')][_0x065d('0x24')]=_0x065d('0x22');_0x2c9cfc['mailAccounts'][_0x13dd92['id']][_0x065d('0x34')][_0x065d('0x11')]=_0x383688;_0x2c9cfc[_0x065d('0x14')](_0x13dd92['id']);_0x385aa8(_0x383688);});});}return this[_0x065d('0xd')][_0x065d('0x35')](_0x13dd92);};module[_0x065d('0x36')]=EmailChannel; \ No newline at end of file +var _0xb32a=['smtp','emit','name','key','active','Imap','status','isNil','stringify','mailAccount:update','prototype','hasOwnProperty','service','provider','email','bind','handleImapEmail','end','error','handleImapError','disabled','messageStatus','connected','messages','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','Smtp','verify','verified','catch','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts'];(function(_0x4a780b,_0x1b83ce){var _0x10c344=function(_0x4bc7d9){while(--_0x4bc7d9){_0x4a780b['push'](_0x4a780b['shift']());}};_0x10c344(++_0x1b83ce);}(_0xb32a,0x1af));var _0xab32=function(_0x328db7,_0x2fc419){_0x328db7=_0x328db7-0x0;var _0x15c76b=_0xb32a[_0x328db7];return _0x15c76b;};'use strict';var _=require(_0xab32('0x0'));var moment=require(_0xab32('0x1'));var BPromise=require(_0xab32('0x2'));var md5=require(_0xab32('0x3'));var Redis=require(_0xab32('0x4'));var config=require(_0xab32('0x5'));var logger=require('../../../config/logger')('email');config[_0xab32('0x6')]=_[_0xab32('0x7')](config[_0xab32('0x6')],{'host':_0xab32('0x8'),'port':0x18eb});var io=require(_0xab32('0x9'))(new Redis(config['redis']));var EmailImap=require(_0xab32('0xa'));var EmailSmtp=require(_0xab32('0xb'));var mailAccount=require(_0xab32('0xc'));var md5Accounts={};function EmailChannel(_0x3faa43){logger[_0xab32('0xd')](_0xab32('0xe'));this[_0xab32('0xf')]=_0x3faa43[_0xab32('0xf')];this[_0xab32('0x10')]={};this[_0xab32('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xab32('0x12')]=function(_0x5b6cb8){var _0x504c65=this['mailAccounts'][_0x5b6cb8];var _0x452810={'id':_0x504c65['id'],'name':_0x504c65[_0xab32('0x13')],'key':_0x504c65[_0xab32('0x14')],'active':_0x504c65[_0xab32('0x15')],'Imap':{'status':_0x504c65[_0xab32('0x16')][_0xab32('0x17')],'messageStatus':_0x504c65['Imap']['messageStatus'],'total':_0x504c65[_0xab32('0x16')]['total']}};if(_[_0xab32('0x18')](md5Accounts[_0x5b6cb8])){md5Accounts[_0x5b6cb8]={};}var _0x41ecaf=md5(JSON[_0xab32('0x19')](_0x452810));if(md5Accounts[_0x5b6cb8][_0xab32('0x3')]!==_0x41ecaf){md5Accounts[_0x5b6cb8][_0xab32('0x3')]=_0x41ecaf;io['emit'](_0xab32('0x1a'),_0x452810);}};EmailChannel[_0xab32('0x1b')]['refresh']=function(_0x42d051){for(var _0x3a13ba in _0x42d051){if(_0x42d051[_0xab32('0x1c')](_0x3a13ba)){if(_0x42d051[_0x3a13ba][_0xab32('0x16')]&&_0x42d051[_0x3a13ba]['active']){var _0x2e4875=_0x42d051[_0x3a13ba][_0xab32('0x16')];if(!_0x2e4875[_0xab32('0x1d')]&&_0x42d051[_0x3a13ba][_0xab32('0x1e')]!=='custom')_0x2e4875[_0xab32('0x1d')]=_0x42d051[_0x3a13ba][_0xab32('0x1e')];if(!this[_0xab32('0x10')][_0xab32('0x1c')](_0x2e4875['id'])){this[_0xab32('0x10')][_0x2e4875['id']]=new EmailImap(_0x2e4875,_0x42d051[_0x3a13ba][_0xab32('0x1f')]);this[_0xab32('0x10')][_0x2e4875['id']]['on']('box',this['handleImapBox'][_0xab32('0x20')](this,_0x3a13ba));this[_0xab32('0x10')][_0x2e4875['id']]['on'](_0xab32('0x1f'),this[_0xab32('0x21')][_0xab32('0x20')](this,_0x3a13ba));this['imapAccounts'][_0x2e4875['id']]['on'](_0xab32('0x22'),this['handleImapEnd'][_0xab32('0x20')](this,_0x3a13ba));this[_0xab32('0x10')][_0x2e4875['id']]['on'](_0xab32('0x23'),this[_0xab32('0x24')][_0xab32('0x20')](this,_0x3a13ba));}}else{if(_[_0xab32('0x18')](this[_0xab32('0xf')][_0x3a13ba]['Imap'])){this[_0xab32('0xf')][_0x3a13ba][_0xab32('0x16')]={};}this[_0xab32('0xf')][_0x3a13ba][_0xab32('0x16')][_0xab32('0x17')]=_0xab32('0x25');this[_0xab32('0xf')][_0x3a13ba][_0xab32('0x16')][_0xab32('0x26')]='';this['emit'](_0x3a13ba);}}}};EmailChannel[_0xab32('0x1b')]['handleImapBox']=function(_0xc328cd,_0x1d6102){if(this[_0xab32('0xf')][_0xc328cd]){this['mailAccounts'][_0xc328cd][_0xab32('0x16')][_0xab32('0x17')]=_0xab32('0x27');this['mailAccounts'][_0xc328cd][_0xab32('0x16')][_0xab32('0x26')]=_0x1d6102[_0xab32('0x13')];if(_0x1d6102[_0xab32('0x28')]){this[_0xab32('0xf')][_0xc328cd][_0xab32('0x16')][_0xab32('0x29')]=_0x1d6102[_0xab32('0x28')]['total'];}return this[_0xab32('0x12')](_0xc328cd);}};EmailChannel[_0xab32('0x1b')]['handleImapEmail']=function(_0x56dd75,_0x39382d){logger[_0xab32('0xd')](_0xab32('0x2a'),_0x39382d[_0xab32('0x2b')],_0x39382d['lastName'],_0x39382d[_0xab32('0x2c')],_0x56dd75);if(this[_0xab32('0xf')][_0x56dd75]){return mailAccount[_0xab32('0x2d')](_0x56dd75,_0x39382d)['then'](function(_0x3ea20f){if(_0x3ea20f){logger[_0xab32('0xd')](_0xab32('0x2e'));}})['catch'](function(_0x36c6f2){logger[_0xab32('0x23')](_0xab32('0x2f'),JSON[_0xab32('0x19')](_0x36c6f2));});}};EmailChannel[_0xab32('0x1b')]['handleImapEnd']=function(_0x74bda){if(this['mailAccounts'][_0x74bda]&&this[_0xab32('0xf')][_0x74bda][_0xab32('0x16')]){if(this[_0xab32('0x10')][this[_0xab32('0xf')][_0x74bda]['Imap']['id']]){delete this[_0xab32('0x10')][this['mailAccounts'][_0x74bda][_0xab32('0x16')]['id']];}this[_0xab32('0xf')][_0x74bda]['Imap'][_0xab32('0x30')]=moment();this['emit'](_0x74bda);}};EmailChannel[_0xab32('0x1b')]['handleImapError']=function(_0x48e60d,_0x252b6f){if(this[_0xab32('0xf')][_0x48e60d]){this[_0xab32('0xf')][_0x48e60d]['Imap'][_0xab32('0x17')]=_0xab32('0x23');this[_0xab32('0xf')][_0x48e60d]['Imap']['messageStatus']=_0x252b6f;return this['emit'](_0x48e60d);}};EmailChannel['prototype'][_0xab32('0x31')]=function(_0x46fa8c,_0x4efe19){return this[_0xab32('0x11')][_0xab32('0x32')](_0x46fa8c,_0x4efe19);};EmailChannel['prototype']['verifySmtp']=function(_0x4eb5fc){var _0x4a51a4=this;if(this[_0xab32('0xf')][_0x4eb5fc['id']]){if(_['isNil'](this['mailAccounts'][_0x4eb5fc['id']][_0xab32('0x33')])){this[_0xab32('0xf')][_0x4eb5fc['id']][_0xab32('0x33')]={};}this['mailAccounts'][_0x4eb5fc['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0xcce6df,_0x3a99c4){return _0x4a51a4['smtp'][_0xab32('0x34')](_0x4eb5fc)['then'](function(_0x11ec94){_0x4a51a4[_0xab32('0xf')][_0x4eb5fc['id']][_0xab32('0x33')][_0xab32('0x17')]=_0xab32('0x35');_0x4a51a4['mailAccounts'][_0x4eb5fc['id']][_0xab32('0x33')][_0xab32('0x26')]='';_0x4a51a4[_0xab32('0x12')](_0x4eb5fc['id']);_0xcce6df(_0x11ec94);})[_0xab32('0x36')](function(_0x4b0899){_0x4a51a4[_0xab32('0xf')][_0x4eb5fc['id']][_0xab32('0x33')][_0xab32('0x17')]='error';_0x4a51a4[_0xab32('0xf')][_0x4eb5fc['id']]['Smtp'][_0xab32('0x26')]=_0x4b0899;_0x4a51a4['emit'](_0x4eb5fc['id']);_0x3a99c4(_0x4b0899);});});}return this[_0xab32('0x11')][_0xab32('0x34')](_0x4eb5fc);};module[_0xab32('0x37')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 7dacadd..1f47cde 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 _0x5496=['Iconv','EventEmitter','./utils','../../../config/logger','mailbox','account','getAccount','once','ready','handleReady','bind','handleEnd','error','handleError','connect','inherits','connTimeout','isNil','service','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','getHost','email','anonymous@xcally.com','prototype','openBox','handleOpenBox','emit','box','handleCloseBox','search','handleReadUnseen','fetch','message','handleFetchMessage','end','handleFetchEnd','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser'];(function(_0x39cc8f,_0xb60cd8){var _0x15e616=function(_0x513d9e){while(--_0x513d9e){_0x39cc8f['push'](_0x39cc8f['shift']());}};_0x15e616(++_0xb60cd8);}(_0x5496,0x175));var _0x6549=function(_0x35f685,_0x44b68d){_0x35f685=_0x35f685-0x0;var _0x44c861=_0x5496[_0x35f685];return _0x44c861;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var Imap=require(_0x6549('0x2'));var simpleParser=require(_0x6549('0x3'))[_0x6549('0x4')];var Iconv=require('iconv')[_0x6549('0x5')];var EventEmitter=require('events')[_0x6549('0x6')];var utils=require(_0x6549('0x7'));var logger=require(_0x6549('0x8'))('email');function EmailImap(_0x5a4658,_0x43cb17){this[_0x6549('0x9')]='INBOX';this[_0x6549('0xa')]=this[_0x6549('0xb')](_0x5a4658,_0x43cb17);this[_0x6549('0x2')]=new Imap(this['account']);this[_0x6549('0x2')][_0x6549('0xc')](_0x6549('0xd'),this[_0x6549('0xe')][_0x6549('0xf')](this));this[_0x6549('0x2')]['once']('end',this[_0x6549('0x10')][_0x6549('0xf')](this));this[_0x6549('0x2')]['on'](_0x6549('0x11'),this[_0x6549('0x12')]['bind'](this));this['imap'][_0x6549('0x13')]();}util[_0x6549('0x14')](EmailImap,EventEmitter);EmailImap['prototype'][_0x6549('0xb')]=function(_0x150fc8,_0x195d25){var _0x12b068={'connTimeout':_0x150fc8[_0x6549('0x15')]?_0x150fc8[_0x6549('0x15')]*0x3e8:0x2710,'authTimeout':_0x150fc8['authTimeout']?_0x150fc8['authTimeout']*0x3e8:0x1388};if(_[_0x6549('0x16')](_0x150fc8[_0x6549('0x17')])){if(_0x150fc8['authentication']){_0x12b068[_0x6549('0x18')]=_0x150fc8[_0x6549('0x18')];_0x12b068[_0x6549('0x19')]=_0x150fc8[_0x6549('0x19')];}_0x12b068[_0x6549('0x1a')]=_0x150fc8['host'];_0x12b068['port']=_0x150fc8[_0x6549('0x1b')]||0x3e1;if(_0x150fc8['tls']){_0x12b068['tls']=!![];}else{_0x12b068[_0x6549('0x1c')]=![];_0x12b068[_0x6549('0x1d')]=_0x6549('0x1e');}}else{if(_0x150fc8[_0x6549('0x1f')]){_0x12b068[_0x6549('0x20')]=utils['generateXOAuth2Token'](_0x150fc8[_0x6549('0x21')]['data5'],_0x150fc8[_0x6549('0x18')]);_0x12b068[_0x6549('0x18')]=_0x150fc8[_0x6549('0x18')];}else{_0x12b068[_0x6549('0x18')]=_0x150fc8[_0x6549('0x18')];_0x12b068[_0x6549('0x19')]=_0x150fc8[_0x6549('0x19')];}_0x12b068[_0x6549('0x1a')]=utils[_0x6549('0x22')](_0x150fc8[_0x6549('0x17')]);_0x12b068[_0x6549('0x1b')]=0x3e1;_0x12b068[_0x6549('0x1c')]=!![];}_0x12b068[_0x6549('0x23')]=_0x195d25||_0x150fc8['user']||_0x6549('0x24');return _0x12b068;};EmailImap[_0x6549('0x25')]['handleReady']=function(){this[_0x6549('0x2')][_0x6549('0x26')](this[_0x6549('0x9')],![],this['handleOpenBox'][_0x6549('0xf')](this));};EmailImap[_0x6549('0x25')][_0x6549('0x27')]=function(_0x2900cd,_0x442862){if(_0x2900cd){this[_0x6549('0x12')](_0x2900cd,!![]);}else{this[_0x6549('0x28')](_0x6549('0x29'),_0x442862);this['readUnseen']();}};EmailImap[_0x6549('0x25')][_0x6549('0x2a')]=function(_0x17fdfb){if(_0x17fdfb){this['handleError'](_0x17fdfb,!![]);}else{this[_0x6549('0x2')]['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x6549('0x2')][_0x6549('0x2b')](['UNSEEN'],this[_0x6549('0x2c')][_0x6549('0xf')](this));};EmailImap[_0x6549('0x25')][_0x6549('0x2c')]=function(_0x2aec2c,_0xebf799){if(_0x2aec2c){this[_0x6549('0x12')](_0x2aec2c,!![]);}else{if(_0xebf799['length']){try{var _0x1b453c=this[_0x6549('0x2')][_0x6549('0x2d')](_0xebf799,{'bodies':'','markSeen':!![]});_0x1b453c['on'](_0x6549('0x2e'),this[_0x6549('0x2f')][_0x6549('0xf')](this));_0x1b453c['once'](_0x6549('0x11'),this['handleFetchError'][_0x6549('0xf')](this));_0x1b453c['once'](_0x6549('0x30'),this[_0x6549('0x31')][_0x6549('0xf')](this));}catch(_0x589f70){logger[_0x6549('0x11')](_0x589f70);}}else{this[_0x6549('0x2')][_0x6549('0x32')](!![],this[_0x6549('0x2a')]['bind'](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x9d88fa){_0x9d88fa['on'](_0x6549('0x33'),this['handleMessageBody'][_0x6549('0xf')](this));_0x9d88fa[_0x6549('0xc')](_0x6549('0x34'),this[_0x6549('0x35')][_0x6549('0xf')](this));_0x9d88fa['once']('end',this[_0x6549('0x36')][_0x6549('0xf')](this));};EmailImap[_0x6549('0x25')][_0x6549('0x37')]=function(_0xa96598){simpleParser(_0xa96598,{'Iconv':Iconv},this[_0x6549('0x38')][_0x6549('0xf')](this));};EmailImap[_0x6549('0x25')][_0x6549('0x35')]=function(){};EmailImap[_0x6549('0x25')]['handleMessageEnd']=function(){};EmailImap[_0x6549('0x25')][_0x6549('0x38')]=function(_0x2ea977,_0x38f048){if(_0x2ea977){logger[_0x6549('0x11')](_0x2ea977);}else{var _0x50ee2e=this;utils['parser'](this['account'],_0x38f048,function(_0x22b919){_0x50ee2e[_0x6549('0x28')](_0x6549('0x23'),_0x22b919);});}};EmailImap[_0x6549('0x25')]['handleFetchEnd']=function(){this['imap'][_0x6549('0x32')](!![],this[_0x6549('0x2a')][_0x6549('0xf')](this));};EmailImap['prototype'][_0x6549('0x39')]=function(_0x519622){this[_0x6549('0x12')](_0x519622);this[_0x6549('0x2')][_0x6549('0x32')](!![],this[_0x6549('0x2a')][_0x6549('0xf')](this));};EmailImap[_0x6549('0x25')][_0x6549('0x10')]=function(){this['emit'](_0x6549('0x30'));};EmailImap[_0x6549('0x25')][_0x6549('0x12')]=function(_0x29ae27,_0xc5edba){logger[_0x6549('0x11')](_0x6549('0x12'),this[_0x6549('0xa')][_0x6549('0x23')],JSON[_0x6549('0x3a')](_0x29ae27));var _0x2b7b6a='';if(_0x29ae27){if(_0x29ae27[_0x6549('0x3b')]){_0x2b7b6a=_0x29ae27[_0x6549('0x3b')];}else{for(var _0x283cfe in _0x29ae27){if(_0x29ae27[_0x6549('0x3c')](_0x283cfe)){_0x2b7b6a+=_[_0x6549('0x3d')](_0x283cfe)+':\x20'+_0x29ae27[_0x283cfe]+'\x0a';}}}}if(_0xc5edba){this['imap'][_0x6549('0x30')]();}else{this[_0x6549('0x28')](_0x6549('0x11'),_0x2b7b6a);this[_0x6549('0x28')]('end');}};module[_0x6549('0x3e')]=EmailImap; \ No newline at end of file +var _0xd117=['once','ready','handleReady','handleEnd','error','bind','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','getHost','service','anonymous@xcally.com','handleOpenBox','emit','box','readUnseen','handleCloseBox','handleError','UNSEEN','handleReadUnseen','length','message','handleFetchError','end','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchEnd','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','account'];(function(_0x5d1573,_0x3514f9){var _0x557037=function(_0x122924){while(--_0x122924){_0x5d1573['push'](_0x5d1573['shift']());}};_0x557037(++_0x3514f9);}(_0xd117,0x182));var _0x7d11=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0xd117[_0xfad1a7];return _0x571012;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var Imap=require(_0x7d11('0x2'));var simpleParser=require(_0x7d11('0x3'))[_0x7d11('0x4')];var Iconv=require(_0x7d11('0x5'))[_0x7d11('0x6')];var EventEmitter=require(_0x7d11('0x7'))[_0x7d11('0x8')];var utils=require(_0x7d11('0x9'));var logger=require(_0x7d11('0xa'))(_0x7d11('0xb'));function EmailImap(_0x27d7e8,_0x40c3c4){this[_0x7d11('0xc')]=_0x7d11('0xd');this['account']=this[_0x7d11('0xe')](_0x27d7e8,_0x40c3c4);this[_0x7d11('0x2')]=new Imap(this[_0x7d11('0xf')]);this['imap'][_0x7d11('0x10')](_0x7d11('0x11'),this[_0x7d11('0x12')]['bind'](this));this[_0x7d11('0x2')]['once']('end',this[_0x7d11('0x13')]['bind'](this));this['imap']['on'](_0x7d11('0x14'),this['handleError'][_0x7d11('0x15')](this));this[_0x7d11('0x2')]['connect']();}util[_0x7d11('0x16')](EmailImap,EventEmitter);EmailImap[_0x7d11('0x17')]['getAccount']=function(_0x324de5,_0x16949d){var _0x20a2df={'connTimeout':_0x324de5[_0x7d11('0x18')]?_0x324de5[_0x7d11('0x18')]*0x3e8:0x2710,'authTimeout':_0x324de5[_0x7d11('0x19')]?_0x324de5[_0x7d11('0x19')]*0x3e8:0x1388};if(_[_0x7d11('0x1a')](_0x324de5['service'])){if(_0x324de5[_0x7d11('0x1b')]){_0x20a2df[_0x7d11('0x1c')]=_0x324de5[_0x7d11('0x1c')];_0x20a2df[_0x7d11('0x1d')]=_0x324de5[_0x7d11('0x1d')];}_0x20a2df['host']=_0x324de5[_0x7d11('0x1e')];_0x20a2df[_0x7d11('0x1f')]=_0x324de5['port']||0x3e1;if(_0x324de5['tls']){_0x20a2df[_0x7d11('0x20')]=!![];}else{_0x20a2df['tls']=![];_0x20a2df[_0x7d11('0x21')]='required';}}else{if(_0x324de5[_0x7d11('0x22')]){_0x20a2df[_0x7d11('0x23')]=utils[_0x7d11('0x24')](_0x324de5[_0x7d11('0x25')][_0x7d11('0x26')],_0x324de5[_0x7d11('0x1c')]);_0x20a2df[_0x7d11('0x1c')]=_0x324de5[_0x7d11('0x1c')];}else{_0x20a2df['user']=_0x324de5[_0x7d11('0x1c')];_0x20a2df['password']=_0x324de5['password'];}_0x20a2df['host']=utils[_0x7d11('0x27')](_0x324de5[_0x7d11('0x28')]);_0x20a2df[_0x7d11('0x1f')]=0x3e1;_0x20a2df[_0x7d11('0x20')]=!![];}_0x20a2df[_0x7d11('0xb')]=_0x16949d||_0x324de5[_0x7d11('0x1c')]||_0x7d11('0x29');return _0x20a2df;};EmailImap[_0x7d11('0x17')]['handleReady']=function(){this[_0x7d11('0x2')]['openBox'](this['mailbox'],![],this['handleOpenBox'][_0x7d11('0x15')](this));};EmailImap['prototype'][_0x7d11('0x2a')]=function(_0x30e4c6,_0x328ab7){if(_0x30e4c6){this['handleError'](_0x30e4c6,!![]);}else{this[_0x7d11('0x2b')](_0x7d11('0x2c'),_0x328ab7);this[_0x7d11('0x2d')]();}};EmailImap['prototype'][_0x7d11('0x2e')]=function(_0x35a789){if(_0x35a789){this[_0x7d11('0x2f')](_0x35a789,!![]);}else{this[_0x7d11('0x2')]['end']();}};EmailImap[_0x7d11('0x17')]['readUnseen']=function(){this[_0x7d11('0x2')]['search']([_0x7d11('0x30')],this[_0x7d11('0x31')][_0x7d11('0x15')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x8e0a53,_0x1ed210){if(_0x8e0a53){this['handleError'](_0x8e0a53,!![]);}else{if(_0x1ed210[_0x7d11('0x32')]){try{var _0x1d3d86=this[_0x7d11('0x2')]['fetch'](_0x1ed210,{'bodies':'','markSeen':!![]});_0x1d3d86['on'](_0x7d11('0x33'),this['handleFetchMessage']['bind'](this));_0x1d3d86[_0x7d11('0x10')]('error',this[_0x7d11('0x34')][_0x7d11('0x15')](this));_0x1d3d86[_0x7d11('0x10')](_0x7d11('0x35'),this['handleFetchEnd'][_0x7d11('0x15')](this));}catch(_0x1f282b){logger['error'](_0x1f282b);}}else{this['imap'][_0x7d11('0x36')](!![],this[_0x7d11('0x2e')]['bind'](this));}}};EmailImap[_0x7d11('0x17')]['handleFetchMessage']=function(_0x5c0113){_0x5c0113['on'](_0x7d11('0x37'),this['handleMessageBody']['bind'](this));_0x5c0113[_0x7d11('0x10')](_0x7d11('0x38'),this[_0x7d11('0x39')][_0x7d11('0x15')](this));_0x5c0113[_0x7d11('0x10')](_0x7d11('0x35'),this[_0x7d11('0x3a')][_0x7d11('0x15')](this));};EmailImap[_0x7d11('0x17')][_0x7d11('0x3b')]=function(_0x1a9f18){simpleParser(_0x1a9f18,{'Iconv':Iconv},this[_0x7d11('0x3c')]['bind'](this));};EmailImap[_0x7d11('0x17')]['handleMessageAttributes']=function(){};EmailImap[_0x7d11('0x17')][_0x7d11('0x3a')]=function(){};EmailImap[_0x7d11('0x17')][_0x7d11('0x3c')]=function(_0x4f8fd2,_0xd36cd3){if(_0x4f8fd2){logger[_0x7d11('0x14')](_0x4f8fd2);}else{var _0x19284=this;utils[_0x7d11('0x3d')](this['account'],_0xd36cd3,function(_0x22730e){_0x19284['emit'](_0x7d11('0xb'),_0x22730e);});}};EmailImap['prototype'][_0x7d11('0x3e')]=function(){this[_0x7d11('0x2')][_0x7d11('0x36')](!![],this[_0x7d11('0x2e')]['bind'](this));};EmailImap['prototype'][_0x7d11('0x34')]=function(_0x332243){this['handleError'](_0x332243);this[_0x7d11('0x2')][_0x7d11('0x36')](!![],this[_0x7d11('0x2e')][_0x7d11('0x15')](this));};EmailImap[_0x7d11('0x17')][_0x7d11('0x13')]=function(){this['emit'](_0x7d11('0x35'));};EmailImap['prototype'][_0x7d11('0x2f')]=function(_0x44eeed,_0x23c2b6){logger[_0x7d11('0x14')](_0x7d11('0x2f'),this[_0x7d11('0xf')]['email'],JSON['stringify'](_0x44eeed));var _0x55e78a='';if(_0x44eeed){if(_0x44eeed[_0x7d11('0x3f')]){_0x55e78a=_0x44eeed[_0x7d11('0x3f')];}else{for(var _0x31b76c in _0x44eeed){if(_0x44eeed[_0x7d11('0x40')](_0x31b76c)){_0x55e78a+=_[_0x7d11('0x41')](_0x31b76c)+':\x20'+_0x44eeed[_0x31b76c]+'\x0a';}}}}if(_0x23c2b6){this['imap'][_0x7d11('0x35')]();}else{this[_0x7d11('0x2b')]('error',_0x55e78a);this[_0x7d11('0x2b')](_0x7d11('0x35'));}};module[_0x7d11('0x42')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 0e05dfb..037f484 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 _0x1a0e=['toString','Not\x20verifired','exports','send','createTransport','use','compile','sendMail','prototype','verify'];(function(_0x226260,_0x32accb){var _0x23034d=function(_0xbfc89f){while(--_0xbfc89f){_0x226260['push'](_0x226260['shift']());}};_0x23034d(++_0x32accb);}(_0x1a0e,0x85));var _0xe1a0=function(_0x435e3c,_0x4ffd0b){_0x435e3c=_0x435e3c-0x0;var _0x5250b9=_0x1a0e[_0x435e3c];return _0x5250b9;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0xe1a0('0x0')]=function(_0x171d5c,_0x4c2538){return new Promise(function(_0x4a7c63,_0x5d30fb){var _0xa80c76=nodemailer[_0xe1a0('0x1')](_0x171d5c);_0xa80c76[_0xe1a0('0x2')](_0xe1a0('0x3'),inlineBase64());_0xa80c76[_0xe1a0('0x4')](_0x4c2538,function(_0x180dfd,_0x217d65){if(_0x180dfd){_0x5d30fb(_0x180dfd['toString']());}else{_0x4a7c63(_0x217d65);}});});};EmailSmtp[_0xe1a0('0x5')][_0xe1a0('0x6')]=function(_0x191fe6){return new Promise(function(_0x2f2c46,_0xfe382){var _0x438c85=nodemailer[_0xe1a0('0x1')](_0x191fe6);_0x438c85[_0xe1a0('0x6')](function(_0x2d997e,_0x351abd){if(_0x2d997e){_0xfe382(_0x2d997e[_0xe1a0('0x7')]());}else{if(_0x351abd){_0x2f2c46(_0x351abd);}else{_0xfe382(_0xe1a0('0x8'));}}});});};module[_0xe1a0('0x9')]=EmailSmtp; \ No newline at end of file +var _0x06f9=['use','toString','verify','Not\x20verifired','exports','nodemailer','send','createTransport'];(function(_0x6dcdb3,_0x26bf43){var _0x4958a3=function(_0x3ecf0e){while(--_0x3ecf0e){_0x6dcdb3['push'](_0x6dcdb3['shift']());}};_0x4958a3(++_0x26bf43);}(_0x06f9,0xdd));var _0x906f=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x06f9[_0x397cfb];return _0x15fed9;};'use strict';var nodemailer=require(_0x906f('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x906f('0x1')]=function(_0x3a7a9a,_0x5d9e37){return new Promise(function(_0x4e0c49,_0x196cd9){var _0x36de96=nodemailer[_0x906f('0x2')](_0x3a7a9a);_0x36de96[_0x906f('0x3')]('compile',inlineBase64());_0x36de96['sendMail'](_0x5d9e37,function(_0x5f5a01,_0x57321a){if(_0x5f5a01){_0x196cd9(_0x5f5a01[_0x906f('0x4')]());}else{_0x4e0c49(_0x57321a);}});});};EmailSmtp['prototype'][_0x906f('0x5')]=function(_0x3559a1){return new Promise(function(_0x26fca1,_0x20187c){var _0x186248=nodemailer[_0x906f('0x2')](_0x3559a1);_0x186248['verify'](function(_0x545565,_0xcbbfd8){if(_0x545565){_0x20187c(_0x545565[_0x906f('0x4')]());}else{if(_0xcbbfd8){_0x26fca1(_0xcbbfd8);}else{_0x20187c(_0x906f('0x6'));}}});});};module[_0x906f('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index d2174b1..1158de1 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 _0xb259=['imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','generateXOAuth2Token','user=','utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','slice','join','value','length','pop','isEmpty','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','originTo','message','originCc','attachment','filename','attachment-','%s-%s','now','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','parser','from','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','getHost','gmail'];(function(_0x585e41,_0x4ee5b1){var _0x1f8e8c=function(_0x4e299c){while(--_0x4e299c){_0x585e41['push'](_0x585e41['shift']());}};_0x1f8e8c(++_0x4ee5b1);}(_0xb259,0xf8));var _0x9b25=function(_0x5d71fb,_0x5b3f42){_0x5d71fb=_0x5d71fb-0x0;var _0x19bac8=_0xb259[_0x5d71fb];return _0x19bac8;};'use strict';var _=require(_0x9b25('0x0'));var moment=require(_0x9b25('0x1'));var random=require(_0x9b25('0x2'));var fs=require('fs');var path=require(_0x9b25('0x3'));var util=require(_0x9b25('0x4'));var tnef=require(_0x9b25('0x5'));var logger=require(_0x9b25('0x6'))(_0x9b25('0x7'));var config=require(_0x9b25('0x8'));function getAddress(_0xd6dac6){var _0x325f50=_[_0x9b25('0x9')](_0xd6dac6['value']);return _0x325f50&&_0x325f50['address']?_0x325f50[_0x9b25('0xa')]:_0x9b25('0xb')+random[_0x9b25('0xc')](0x6)+_0x9b25('0xd');}function getFirstName(_0x59fee5){var _0x3a1012=_[_0x9b25('0x9')](_0x59fee5['value']);if(_0x3a1012&&_0x3a1012['name']){if(_0x3a1012['name']==_0x3a1012[_0x9b25('0xa')]){return _0x3a1012[_0x9b25('0xe')][_0x9b25('0xf')](0x0,_0x3a1012['name'][_0x9b25('0x10')]('@'));}var _0x21e7ea=_0x3a1012[_0x9b25('0xe')][_0x9b25('0x11')](/\s+/);return _0x21e7ea['length']>0x1?_0x21e7ea[_0x9b25('0x12')](0x0,-0x1)[_0x9b25('0x13')]('\x20'):_0x3a1012[_0x9b25('0xe')];}return'Anonymous';}function getLastName(_0x173bae){var _0x1f1099=_[_0x9b25('0x9')](_0x173bae[_0x9b25('0x14')]);if(_0x1f1099&&_0x1f1099['name']){var _0x2cd7b8=_0x1f1099[_0x9b25('0xe')]['split'](/\s+/);return _0x2cd7b8[_0x9b25('0x15')]>0x1?_0x2cd7b8[_0x9b25('0x16')]():'';}return'';}function getMails(_0x503b46,_0x42a6ee){var _0x3be1f7='';for(var _0x18bea6=0x0;_0x18bea6<_0x42a6ee[_0x9b25('0x14')][_0x9b25('0x15')];_0x18bea6+=0x1){if(_0x42a6ee[_0x9b25('0x14')][_0x18bea6][_0x9b25('0xa')]!==_0x503b46){if(!_[_0x9b25('0x17')](_0x3be1f7)){_0x3be1f7+=',';}_0x3be1f7+=_0x42a6ee[_0x9b25('0x14')][_0x18bea6][_0x9b25('0xe')]||_0x42a6ee[_0x9b25('0x14')][_0x18bea6][_0x9b25('0xa')]||'';_0x3be1f7+='\x20<';_0x3be1f7+=_0x42a6ee[_0x9b25('0x14')][_0x18bea6][_0x9b25('0xa')]?_0x42a6ee['value'][_0x18bea6][_0x9b25('0xa')]:_0x9b25('0xb')+random[_0x9b25('0xc')](0x6)+_0x9b25('0xd');_0x3be1f7+='>';}}return _0x3be1f7;}function parseEmail(_0x4adb86,_0x2a1860,_0x39ea26){if(_0x2a1860[_0x9b25('0x18')]){var _0x1730c7=/)<[^<]*)*<\/script>/gi;while(_0x1730c7['test'](_0x2a1860['html'])){_0x2a1860[_0x9b25('0x18')]=_0x2a1860[_0x9b25('0x18')][_0x9b25('0x19')](_0x1730c7,'');}if(_0x2a1860[_0x9b25('0x18')][_0x9b25('0x1a')](_0x9b25('0x1b'))){var _0x337ae1=[];_0x2a1860[_0x9b25('0x1c')][_0x9b25('0x1d')](_0x232716=>{_0x337ae1[_0x9b25('0x1e')](_0x232716['filename']);});var _0x884ee5=/]+>/g;var _0x28a3f4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x54c076=_0x2a1860['html'][_0x9b25('0x19')](_0x28a3f4,_0x9b25('0x1f'));var _0xccc253=_0x54c076['replace'](_0x884ee5,'_IMG');for(let _0x5ad56a=0x0;_0x5ad56a<_0x337ae1[_0x9b25('0x15')];_0x5ad56a++){var _0x504a8f=_0xccc253['replace']('_IMG',_0x9b25('0x20')+_0x337ae1[_0x5ad56a]+_0x9b25('0x21'));_0xccc253=_0x504a8f;}_0x2a1860[_0x9b25('0x18')]=_0xccc253;}_0x39ea26[_0x9b25('0x22')]=_0x2a1860['html'];}else{_0x39ea26[_0x9b25('0x22')]=_0x2a1860[_0x9b25('0x23')];}if(_0x39ea26['body']){_0x39ea26['body']=_0x39ea26[_0x9b25('0x22')]['replace'](/0x0){var _0x1d716c=[_0x9b25('0x30'),_0x9b25('0x31'),'Precedence:\x20auto_reply'];for(var _0x4ac868=0x0;_0x4ac868<_0x2a1860['headerLines'][_0x9b25('0x15')];_0x4ac868++){var _0x754f77=_[_0x9b25('0x10')](_0x1d716c,_0x2a1860[_0x9b25('0x2f')][_0x4ac868][_0x9b25('0x32')]);if(_0x754f77>=0x0){_0x39ea26['isAutoreply']=!![];}}}return _0x39ea26;}exports[_0x9b25('0x33')]=function(_0x5a5de3,_0x4f220f,_0x5af3f1){var _0x549d6c={'from':getAddress(_0x4f220f['from']),'firstName':getFirstName(_0x4f220f[_0x9b25('0x34')]),'lastName':getLastName(_0x4f220f[_0x9b25('0x34')]),'mapKey':_0x9b25('0x7'),'message':{'from':getMails(_0x5a5de3[_0x9b25('0x7')],_0x4f220f[_0x9b25('0x34')]),'to':_0x5a5de3[_0x9b25('0x7')],'cc':'','subject':_0x4f220f['subject']||'','messageId':_0x4f220f['messageId'],'inReplyTo':_0x4f220f['inReplyTo'],'sentAt':moment(_0x4f220f[_0x9b25('0x35')])['format'](_0x9b25('0x36')),'attach':![],'attachments':[]}};if(!_0x4f220f[_0x9b25('0x18')]&&!_0x4f220f['textAsHtml']){var _0x572ab9=_[_0x9b25('0x37')](_0x4f220f[_0x9b25('0x1c')],{'contentType':_0x9b25('0x38')});if(_0x572ab9[_0x9b25('0x15')]){logger[_0x9b25('0x39')](util['format'](_0x9b25('0x3a'),_0x4f220f[_0x9b25('0x3b')]));tnef[_0x9b25('0x3c')](_[_0x9b25('0x3d')](_0x572ab9)[_0x9b25('0x2d')],function(_0x16b11b,_0x4391bf){if(_0x4391bf){_0x4f220f[_0x9b25('0x18')]=_0x4391bf[_0x9b25('0x3e')]||_0x9b25('0x3f');if(_0x4391bf[_0x9b25('0x40')]){for(var _0x5d9313=0x0;_0x5d9313<_0x4391bf[_0x9b25('0x40')]['length'];_0x5d9313++){var _0x5417c5=_0x4391bf[_0x9b25('0x40')][_0x5d9313];_0x549d6c[_0x9b25('0x25')]['attachments'][_0x9b25('0x1e')]({'filename':_0x5417c5[_0x9b25('0x41')],'content':Buffer[_0x9b25('0x34')](_0x5417c5['Data'])});}}}_0x5af3f1(parseEmail(_0x5a5de3,_0x4f220f,_0x549d6c));});}else{_0x4f220f[_0x9b25('0x18')]=_0x9b25('0x3f');_0x5af3f1(parseEmail(_0x5a5de3,_0x4f220f,_0x549d6c));}}else{_0x5af3f1(parseEmail(_0x5a5de3,_0x4f220f,_0x549d6c));}};exports[_0x9b25('0x42')]=function(_0x1a6dfc){switch(_0x1a6dfc){case _0x9b25('0x43'):return _0x9b25('0x44');case _0x9b25('0x45'):return'imap.mail.yahoo.com';case _0x9b25('0x46'):return _0x9b25('0x47');case _0x9b25('0x48'):return _0x9b25('0x49');}return _0x9b25('0x4a');};exports[_0x9b25('0x4b')]=function(_0x298b31,_0x538af9){var _0x38e412=[_0x9b25('0x4c')+(_0x538af9||''),'auth=Bearer\x20'+_0x298b31,'',''];return Buffer[_0x9b25('0x34')](_0x38e412['join'](''),_0x9b25('0x4d'))[_0x9b25('0x4e')]('base64');}; \ No newline at end of file +var _0x97ae=['utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','value','address','anonymous','generate','@xcally.com','head','name','indexOf','split','Anonymous','length','pop','isEmpty','html','test','replace','includes','attachments','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','127.0.0.1','generateXOAuth2Token','user=','auth=Bearer\x20','join'];(function(_0x34109c,_0x40e4b8){var _0x540d2d=function(_0x1e4d34){while(--_0x1e4d34){_0x34109c['push'](_0x34109c['shift']());}};_0x540d2d(++_0x40e4b8);}(_0x97ae,0x152));var _0xe97a=function(_0x34bf63,_0x5740fa){_0x34bf63=_0x34bf63-0x0;var _0x315ab2=_0x97ae[_0x34bf63];return _0x315ab2;};'use strict';var _=require(_0xe97a('0x0'));var moment=require(_0xe97a('0x1'));var random=require(_0xe97a('0x2'));var fs=require('fs');var path=require(_0xe97a('0x3'));var util=require(_0xe97a('0x4'));var tnef=require(_0xe97a('0x5'));var logger=require(_0xe97a('0x6'))('email');var config=require('../../../config/environment');function getAddress(_0x2371dc){var _0x464d3b=_['head'](_0x2371dc[_0xe97a('0x7')]);return _0x464d3b&&_0x464d3b[_0xe97a('0x8')]?_0x464d3b['address']:_0xe97a('0x9')+random[_0xe97a('0xa')](0x6)+_0xe97a('0xb');}function getFirstName(_0x327e25){var _0x253012=_[_0xe97a('0xc')](_0x327e25[_0xe97a('0x7')]);if(_0x253012&&_0x253012[_0xe97a('0xd')]){if(_0x253012[_0xe97a('0xd')]==_0x253012['address']){return _0x253012[_0xe97a('0xd')]['substring'](0x0,_0x253012[_0xe97a('0xd')][_0xe97a('0xe')]('@'));}var _0x146c00=_0x253012[_0xe97a('0xd')][_0xe97a('0xf')](/\s+/);return _0x146c00['length']>0x1?_0x146c00['slice'](0x0,-0x1)['join']('\x20'):_0x253012[_0xe97a('0xd')];}return _0xe97a('0x10');}function getLastName(_0x277f18){var _0x49fba6=_['head'](_0x277f18[_0xe97a('0x7')]);if(_0x49fba6&&_0x49fba6[_0xe97a('0xd')]){var _0x2a295d=_0x49fba6[_0xe97a('0xd')][_0xe97a('0xf')](/\s+/);return _0x2a295d[_0xe97a('0x11')]>0x1?_0x2a295d[_0xe97a('0x12')]():'';}return'';}function getMails(_0x3d91a6,_0x1792b0){var _0x3355f5='';for(var _0x386344=0x0;_0x386344<_0x1792b0[_0xe97a('0x7')]['length'];_0x386344+=0x1){if(_0x1792b0[_0xe97a('0x7')][_0x386344][_0xe97a('0x8')]!==_0x3d91a6){if(!_[_0xe97a('0x13')](_0x3355f5)){_0x3355f5+=',';}_0x3355f5+=_0x1792b0[_0xe97a('0x7')][_0x386344][_0xe97a('0xd')]||_0x1792b0['value'][_0x386344]['address']||'';_0x3355f5+='\x20<';_0x3355f5+=_0x1792b0[_0xe97a('0x7')][_0x386344][_0xe97a('0x8')]?_0x1792b0[_0xe97a('0x7')][_0x386344][_0xe97a('0x8')]:_0xe97a('0x9')+random[_0xe97a('0xa')](0x6)+_0xe97a('0xb');_0x3355f5+='>';}}return _0x3355f5;}function parseEmail(_0x555de7,_0x4088bd,_0x29e049){if(_0x4088bd[_0xe97a('0x14')]){var _0xb4f2de=/)<[^<]*)*<\/script>/gi;while(_0xb4f2de[_0xe97a('0x15')](_0x4088bd[_0xe97a('0x14')])){_0x4088bd['html']=_0x4088bd[_0xe97a('0x14')][_0xe97a('0x16')](_0xb4f2de,'');}if(_0x4088bd['html'][_0xe97a('0x17')]('{_0x5eef32['push'](_0xe97913['filename']);});var _0x5c5dba=/]+>/g;var _0x2abb4f=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5bb53c=_0x4088bd[_0xe97a('0x14')][_0xe97a('0x16')](_0x2abb4f,_0xe97a('0x19'));var _0x21344c=_0x5bb53c[_0xe97a('0x16')](_0x5c5dba,_0xe97a('0x1a'));for(let _0xd73ad8=0x0;_0xd73ad8<_0x5eef32[_0xe97a('0x11')];_0xd73ad8++){var _0x73d18=_0x21344c[_0xe97a('0x16')](_0xe97a('0x1a'),_0xe97a('0x1b')+_0x5eef32[_0xd73ad8]+_0xe97a('0x1c'));_0x21344c=_0x73d18;}_0x4088bd[_0xe97a('0x14')]=_0x21344c;}_0x29e049[_0xe97a('0x1d')]=_0x4088bd[_0xe97a('0x14')];}else{_0x29e049[_0xe97a('0x1d')]=_0x4088bd[_0xe97a('0x1e')];}if(_0x29e049[_0xe97a('0x1d')]){_0x29e049[_0xe97a('0x1d')]=_0x29e049[_0xe97a('0x1d')][_0xe97a('0x16')](/0x0){var _0x2daa0e=[_0xe97a('0x32'),_0xe97a('0x33'),'Precedence:\x20auto_reply'];for(var _0x133d4e=0x0;_0x133d4e<_0x4088bd[_0xe97a('0x31')][_0xe97a('0x11')];_0x133d4e++){var _0x2f84c7=_['indexOf'](_0x2daa0e,_0x4088bd[_0xe97a('0x31')][_0x133d4e][_0xe97a('0x34')]);if(_0x2f84c7>=0x0){_0x29e049['isAutoreply']=!![];}}}return _0x29e049;}exports[_0xe97a('0x35')]=function(_0xb3d59f,_0x593106,_0x7180e1){var _0x4f275a={'from':getAddress(_0x593106[_0xe97a('0x36')]),'firstName':getFirstName(_0x593106[_0xe97a('0x36')]),'lastName':getLastName(_0x593106[_0xe97a('0x36')]),'mapKey':_0xe97a('0x22'),'message':{'from':getMails(_0xb3d59f[_0xe97a('0x22')],_0x593106[_0xe97a('0x36')]),'to':_0xb3d59f['email'],'cc':'','subject':_0x593106[_0xe97a('0x37')]||'','messageId':_0x593106['messageId'],'inReplyTo':_0x593106[_0xe97a('0x38')],'sentAt':moment(_0x593106[_0xe97a('0x39')])[_0xe97a('0x3a')](_0xe97a('0x3b')),'attach':![],'attachments':[]}};if(!_0x593106[_0xe97a('0x14')]&&!_0x593106[_0xe97a('0x1e')]){var _0x2c43fb=_[_0xe97a('0x3c')](_0x593106[_0xe97a('0x18')],{'contentType':'application/ms-tnef'});if(_0x2c43fb[_0xe97a('0x11')]){logger[_0xe97a('0x3d')](util[_0xe97a('0x3a')](_0xe97a('0x3e'),_0x593106[_0xe97a('0x3f')]));tnef['parseBuffer'](_[_0xe97a('0x40')](_0x2c43fb)[_0xe97a('0x2f')],function(_0x169160,_0x206aae){if(_0x206aae){_0x593106['html']=_0x206aae[_0xe97a('0x41')]||_0xe97a('0x42');if(_0x206aae[_0xe97a('0x43')]){for(var _0x556561=0x0;_0x556561<_0x206aae[_0xe97a('0x43')][_0xe97a('0x11')];_0x556561++){var _0x2b7bb0=_0x206aae[_0xe97a('0x43')][_0x556561];_0x4f275a[_0xe97a('0x20')][_0xe97a('0x18')][_0xe97a('0x30')]({'filename':_0x2b7bb0[_0xe97a('0x44')],'content':Buffer[_0xe97a('0x36')](_0x2b7bb0[_0xe97a('0x45')])});}}}_0x7180e1(parseEmail(_0xb3d59f,_0x593106,_0x4f275a));});}else{_0x593106[_0xe97a('0x14')]='

Empty\x20message

';_0x7180e1(parseEmail(_0xb3d59f,_0x593106,_0x4f275a));}}else{_0x7180e1(parseEmail(_0xb3d59f,_0x593106,_0x4f275a));}};exports[_0xe97a('0x46')]=function(_0x13381e){switch(_0x13381e){case _0xe97a('0x47'):return _0xe97a('0x48');case _0xe97a('0x49'):return _0xe97a('0x4a');case _0xe97a('0x4b'):return _0xe97a('0x4c');case'outlook365':return'outlook.office365.com';}return _0xe97a('0x4d');};exports[_0xe97a('0x4e')]=function(_0x45e2fe,_0x6340ce){var _0xb18541=[_0xe97a('0x4f')+(_0x6340ce||''),_0xe97a('0x50')+_0x45e2fe,'',''];return Buffer[_0xe97a('0x36')](_0xb18541[_0xe97a('0x51')](''),_0xe97a('0x52'))[_0xe97a('0x53')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c2ac33e..e42c364 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 _0x0c80=['Smtp','name','key','SERV','active','Imap'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0x0c80,0xbb));var _0x00c8=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0c80[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');function MailAccount(_0x5448a8){this['id']=_0x5448a8['id']||0x0;this[_0x00c8('0x0')]=_0x5448a8[_0x00c8('0x0')]||'Service';this['key']=_0x5448a8[_0x00c8('0x1')]||_0x00c8('0x2');this[_0x00c8('0x3')]=_0x5448a8[_0x00c8('0x3')]||![];this[_0x00c8('0x4')]=_0x5448a8[_0x00c8('0x4')]||[];this[_0x00c8('0x5')]=_0x5448a8[_0x00c8('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x35f5=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x2fbcf6,_0x2e7155){var _0x3e7265=function(_0x15a3c3){while(--_0x15a3c3){_0x2fbcf6['push'](_0x2fbcf6['shift']());}};_0x3e7265(++_0x2e7155);}(_0x35f5,0x7e));var _0x535f=function(_0xf34895,_0x21fb70){_0xf34895=_0xf34895-0x0;var _0x143f44=_0x35f5[_0xf34895];return _0x143f44;};'use strict';var _=require(_0x535f('0x0'));function MailAccount(_0x379363){this['id']=_0x379363['id']||0x0;this[_0x535f('0x1')]=_0x379363[_0x535f('0x1')]||_0x535f('0x2');this[_0x535f('0x3')]=_0x379363[_0x535f('0x3')]||_0x535f('0x4');this[_0x535f('0x5')]=_0x379363[_0x535f('0x5')]||![];this[_0x535f('0x6')]=_0x379363['Imap']||[];this['Smtp']=_0x379363[_0x535f('0x7')]||[];}module[_0x535f('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 55583ac..edb8591 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 _0x9db5=['initMailAccounts','mailAccounts','length','merge','exports','lodash','../model/mailAccount','mapKeys','mergeFromDatabase','hasOwnProperty','prototype'];(function(_0x3037cc,_0x3f9060){var _0x13b1c2=function(_0x5d2fde){while(--_0x5d2fde){_0x3037cc['push'](_0x3037cc['shift']());}};_0x13b1c2(++_0x3f9060);}(_0x9db5,0x68));var _0x59db=function(_0x158d38,_0x147e1c){_0x158d38=_0x158d38-0x0;var _0x2cb2a2=_0x9db5[_0x158d38];return _0x2cb2a2;};'use strict';var _=require(_0x59db('0x0'));var MailAccount=require(_0x59db('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x193f35,_0x2f16ad,_0x278ad0){var _0x231710=_[_0x59db('0x2')](_0x193f35,function(_0x45f066,_0x3c98d3){return _0x45f066[_0x278ad0];});for(var _0x566869 in _0x2f16ad){if(_0x2f16ad['hasOwnProperty'](_0x566869)){if(!_0x231710[_0x566869]){delete _0x2f16ad[_0x566869];}}}}Realtime['prototype'][_0x59db('0x3')]=function(_0xd3e60f,_0x2c667b){for(var _0x139243 in _0x2c667b){if(_0xd3e60f[_0x59db('0x4')](_0x139243)){_0xd3e60f[_0x139243]=_0x2c667b[_0x139243];}}};Realtime[_0x59db('0x5')][_0x59db('0x6')]=function(){var _0x3c15c4=this;return function(_0x18fdbc){if(_0x18fdbc){freeIsNotKey(_0x18fdbc,_0x3c15c4[_0x59db('0x7')],'id');for(var _0x19410e=0x0,_0x1a0af6={},_0xdd1bd4={};_0x19410e<_0x18fdbc[_0x59db('0x8')];_0x19410e+=0x1){_0x1a0af6=_0x18fdbc[_0x19410e];if(_['isUndefined'](_0x3c15c4['mailAccounts'][_0x1a0af6['id']])){_0x3c15c4[_0x59db('0x7')][_0x1a0af6['id']]=new MailAccount(_0x1a0af6);}else{_[_0x59db('0x9')](_0x3c15c4[_0x59db('0x7')][_0x1a0af6['id']],_0x1a0af6);}}}return _0x3c15c4[_0x59db('0x7')];};};module[_0x59db('0xa')]=Realtime; \ No newline at end of file +var _0x1cee=['lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','merge','exports'];(function(_0x30a193,_0x158ad6){var _0x5d6ccd=function(_0xaf5a46){while(--_0xaf5a46){_0x30a193['push'](_0x30a193['shift']());}};_0x5d6ccd(++_0x158ad6);}(_0x1cee,0x14a));var _0xe1ce=function(_0x36178f,_0x44606b){_0x36178f=_0x36178f-0x0;var _0x4bfb09=_0x1cee[_0x36178f];return _0x4bfb09;};'use strict';var _=require(_0xe1ce('0x0'));var MailAccount=require(_0xe1ce('0x1'));var Realtime=function(){this[_0xe1ce('0x2')]={};};function freeIsNotKey(_0x479bf6,_0x36cc45,_0x5233cf){var _0xf66dcd=_[_0xe1ce('0x3')](_0x479bf6,function(_0x33c1d1,_0xd6b96e){return _0x33c1d1[_0x5233cf];});for(var _0x166632 in _0x36cc45){if(_0x36cc45[_0xe1ce('0x4')](_0x166632)){if(!_0xf66dcd[_0x166632]){delete _0x36cc45[_0x166632];}}}}Realtime[_0xe1ce('0x5')]['mergeFromDatabase']=function(_0x24ce01,_0x207b9c){for(var _0x2b6314 in _0x207b9c){if(_0x24ce01['hasOwnProperty'](_0x2b6314)){_0x24ce01[_0x2b6314]=_0x207b9c[_0x2b6314];}}};Realtime[_0xe1ce('0x5')][_0xe1ce('0x6')]=function(){var _0x40d2eb=this;return function(_0x2c1b79){if(_0x2c1b79){freeIsNotKey(_0x2c1b79,_0x40d2eb[_0xe1ce('0x2')],'id');for(var _0x1fa85b=0x0,_0x19a8c3={},_0x5242f8={};_0x1fa85b<_0x2c1b79[_0xe1ce('0x7')];_0x1fa85b+=0x1){_0x19a8c3=_0x2c1b79[_0x1fa85b];if(_[_0xe1ce('0x8')](_0x40d2eb[_0xe1ce('0x2')][_0x19a8c3['id']])){_0x40d2eb[_0xe1ce('0x2')][_0x19a8c3['id']]=new MailAccount(_0x19a8c3);}else{_[_0xe1ce('0x9')](_0x40d2eb[_0xe1ce('0x2')][_0x19a8c3['id']],_0x19a8c3);}}}return _0x40d2eb['mailAccounts'];};};module[_0xe1ce('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index d5c5c8d..8f7a8ad 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 _0xdc6f=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','key','MailServerIn','Imap','CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify'];(function(_0x15f244,_0x637334){var _0x9fc215=function(_0x2af14a){while(--_0x2af14a){_0x15f244['push'](_0x15f244['shift']());}};_0x9fc215(++_0x637334);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x232719,_0x37a326){_0x232719=_0x232719-0x0;var _0x21ee88=_0xdc6f[_0x232719];return _0x21ee88;};'use strict';var client=require(_0xfdc6('0x0'));exports[_0xfdc6('0x1')]=function(){return function(){return client[_0xfdc6('0x2')](_0xfdc6('0x3'),{'options':{'attributes':['id',_0xfdc6('0x4'),_0xfdc6('0x5'),_0xfdc6('0x6'),'email','active',_0xfdc6('0x7'),'ListId','TemplateId'],'raw':![],'include':[{'model':_0xfdc6('0x8'),'as':_0xfdc6('0x9'),'include':[{'model':_0xfdc6('0xa'),'attributes':['id','name',_0xfdc6('0x6'),_0xfdc6('0xb'),_0xfdc6('0xc')],'as':_0xfdc6('0xa')}]},{'model':_0xfdc6('0xd'),'as':_0xfdc6('0xe'),'include':[{'model':_0xfdc6('0xa'),'attributes':['id','name','service','type',_0xfdc6('0xc')],'as':_0xfdc6('0xa')}]}]},'log':_0xfdc6('0xf')});};};exports[_0xfdc6('0x10')]=function(_0x289006,_0x3fdd30){return client[_0xfdc6('0x2')](_0xfdc6('0x11'),{'account':{'id':_0x289006},'body':_0x3fdd30,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x7add=['email','key','ListId','Imap','service','data5','CloudProvider','MailServerOut','type','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','name','provider'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7add,0x72));var _0xd7ad=function(_0x2e108e,_0x42f889){_0x2e108e=_0x2e108e-0x0;var _0xb2404a=_0x7add[_0x2e108e];return _0xb2404a;};'use strict';var client=require(_0xd7ad('0x0'));exports[_0xd7ad('0x1')]=function(){return function(){return client[_0xd7ad('0x2')]('GetMailAccount',{'options':{'attributes':['id',_0xd7ad('0x3'),_0xd7ad('0x4'),'service',_0xd7ad('0x5'),'active',_0xd7ad('0x6'),_0xd7ad('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xd7ad('0x8'),'include':[{'model':'CloudProvider','attributes':['id','name',_0xd7ad('0x9'),'type',_0xd7ad('0xa')],'as':_0xd7ad('0xb')}]},{'model':_0xd7ad('0xc'),'as':'Smtp','include':[{'model':_0xd7ad('0xb'),'attributes':['id',_0xd7ad('0x3'),'service',_0xd7ad('0xd'),_0xd7ad('0xa')],'as':'CloudProvider'}]}]},'log':_0xd7ad('0xe')});};};exports[_0xd7ad('0xf')]=function(_0x1ee2e6,_0x509d1f){return client['Request'](_0xd7ad('0x10'),{'account':{'id':_0x1ee2e6},'body':_0x509d1f,'log':_0xd7ad('0x10')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 30bbae7..8890dc1 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 _0x9ba3=['loginMailFrequency','../client','getSettings','Request','ShowSetting'];(function(_0xb0846c,_0x2e868b){var _0x318cc6=function(_0x35c8bc){while(--_0x35c8bc){_0xb0846c['push'](_0xb0846c['shift']());}};_0x318cc6(++_0x2e868b);}(_0x9ba3,0xe2));var _0x39ba=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9ba3[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x39ba('0x0'));exports[_0x39ba('0x1')]=function(){return client[_0x39ba('0x2')](_0x39ba('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x39ba('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0xa072=['GetSettings','../client','getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xa072,0x139));var _0x2a07=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0xa072[_0x4d8dc3];return _0x9b03d9;};'use strict';var client=require(_0x2a07('0x0'));exports[_0x2a07('0x1')]=function(){return client[_0x2a07('0x2')](_0x2a07('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2a07('0x4')]},'log':_0x2a07('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 68e56b9..6aceee6 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 b0f6a52..92919b3 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 _0x0f21=['../../routes','default','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','../../config/environment','createServer','timeout','listen','port','socket.io','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio'];(function(_0x1f087b,_0x43625a){var _0x3f2c40=function(_0xb9b6dc){while(--_0xb9b6dc){_0x1f087b['push'](_0x1f087b['shift']());}};_0x3f2c40(++_0x43625a);}(_0x0f21,0x196));var _0x10f2=function(_0x73e822,_0x4eb998){_0x73e822=_0x73e822-0x0;var _0x52bc3c=_0x0f21[_0x73e822];return _0x52bc3c;};'use strict';var _=require(_0x10f2('0x0'));var http=require('http');var express=require(_0x10f2('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x10f2('0x2'));var app=express();var server=http[_0x10f2('0x3')](app);server[_0x10f2('0x4')]=0xdbba0;if(sticky[_0x10f2('0x5')](server,config[_0x10f2('0x6')])){var socketio=require(_0x10f2('0x7'))(server,{'transports':['websocket','polling']});config[_0x10f2('0x8')]=_['defaults'](config[_0x10f2('0x8')],{'host':_0x10f2('0x9'),'port':0x18eb});socketio[_0x10f2('0xa')](require(_0x10f2('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x10f2('0xc'))['default']();require(_0x10f2('0xd'))['default'](socketio);require('../../config/express')['default'](app);require(_0x10f2('0xe'))[_0x10f2('0xf')](app);}else{server[_0x10f2('0x10')](_0x10f2('0x11'),function(){console[_0x10f2('0x12')](_0x10f2('0x13'),config[_0x10f2('0x6')]);});}exports=module[_0x10f2('0x14')]=app; \ No newline at end of file +var _0x36d3=['http','express','ioredis','port','websocket','polling','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash'];(function(_0x4e5e9c,_0x1a7911){var _0x535683=function(_0x38ffa2){while(--_0x38ffa2){_0x4e5e9c['push'](_0x4e5e9c['shift']());}};_0x535683(++_0x1a7911);}(_0x36d3,0x98));var _0x336d=function(_0x56ecfa,_0x3caeb1){_0x56ecfa=_0x56ecfa-0x0;var _0x23eea1=_0x36d3[_0x56ecfa];return _0x23eea1;};'use strict';var _=require(_0x336d('0x0'));var http=require(_0x336d('0x1'));var express=require(_0x336d('0x2'));var sticky=require('sticky-session');var Redis=require(_0x336d('0x3'));var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x336d('0x4')])){var socketio=require('socket.io')(server,{'transports':[_0x336d('0x5'),_0x336d('0x6')]});config[_0x336d('0x7')]=_['defaults'](config[_0x336d('0x7')],{'host':_0x336d('0x8'),'port':0x18eb});socketio[_0x336d('0x9')](require(_0x336d('0xa'))({'pubClient':new Redis(config[_0x336d('0x7')]),'subClient':new Redis(config[_0x336d('0x7')])}));require(_0x336d('0xb'))[_0x336d('0xc')]();require('../../config/socketio')[_0x336d('0xc')](socketio);require(_0x336d('0xd'))[_0x336d('0xc')](app);require(_0x336d('0xe'))[_0x336d('0xc')](app);}else{server[_0x336d('0xf')]('listening',function(){console['log'](_0x336d('0x10'),config[_0x336d('0x4')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index d4b4de0..7417735 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 _0xe0bd=['http','Request','request','then','debug','rpc','error','message','result','exports','jayson/promise','../../config/logger','routing','client'];(function(_0x451978,_0x82f764){var _0x2828bd=function(_0x369c82){while(--_0x369c82){_0x451978['push'](_0x451978['shift']());}};_0x2828bd(++_0x82f764);}(_0xe0bd,0x1ca));var _0xde0b=function(_0x5ac4b6,_0x4d9360){_0x5ac4b6=_0x5ac4b6-0x0;var _0x29ced8=_0xe0bd[_0x5ac4b6];return _0x29ced8;};'use strict';var jayson=require(_0xde0b('0x0'));var BPromise=require('bluebird');var logger=require(_0xde0b('0x1'))(_0xde0b('0x2'));var client=jayson[_0xde0b('0x3')][_0xde0b('0x4')]({'port':0x2329});client[_0xde0b('0x5')]=function(_0x544ee8,_0xf45404){return new BPromise(function(_0x591190,_0x1cb8b7){return client[_0xde0b('0x6')](_0x544ee8,_0xf45404)[_0xde0b('0x7')](function(_0x340289){logger[_0xde0b('0x8')](_0xde0b('0x9'),'routing',_0x544ee8,_0xf45404,_0x340289);if(_0x340289['error']){logger[_0xde0b('0xa')](_0xde0b('0x9'),_0xde0b('0x2'),_0x544ee8,_0x340289[_0xde0b('0xa')][_0xde0b('0xb')],_0xf45404);return _0x1cb8b7(_0x340289[_0xde0b('0xa')][_0xde0b('0xb')]);}else{return _0x591190(_0x340289[_0xde0b('0xc')]);}})['catch'](function(_0x560e24){logger[_0xde0b('0xa')](_0xde0b('0x9'),'routing',_0x544ee8,_0x560e24,_0xf45404);return _0x1cb8b7(_0x560e24);});});};module[_0xde0b('0xd')]=client; \ No newline at end of file +var _0x933b=['Request','request','then','error','rpc','message','result','catch','exports','jayson/promise','../../config/logger','routing','client','http'];(function(_0x522185,_0x1567cf){var _0x4517f1=function(_0x3bf5a5){while(--_0x3bf5a5){_0x522185['push'](_0x522185['shift']());}};_0x4517f1(++_0x1567cf);}(_0x933b,0xe9));var _0xb933=function(_0x1d52cb,_0x11ccfd){_0x1d52cb=_0x1d52cb-0x0;var _0x55c28a=_0x933b[_0x1d52cb];return _0x55c28a;};'use strict';var jayson=require(_0xb933('0x0'));var BPromise=require('bluebird');var logger=require(_0xb933('0x1'))(_0xb933('0x2'));var client=jayson[_0xb933('0x3')][_0xb933('0x4')]({'port':0x2329});client[_0xb933('0x5')]=function(_0x571e94,_0x2eb152){return new BPromise(function(_0x495d7b,_0x3bfe8b){return client[_0xb933('0x6')](_0x571e94,_0x2eb152)[_0xb933('0x7')](function(_0xeaa2b6){logger['debug']('rpc',_0xb933('0x2'),_0x571e94,_0x2eb152,_0xeaa2b6);if(_0xeaa2b6['error']){logger[_0xb933('0x8')](_0xb933('0x9'),_0xb933('0x2'),_0x571e94,_0xeaa2b6[_0xb933('0x8')][_0xb933('0xa')],_0x2eb152);return _0x3bfe8b(_0xeaa2b6['error']['message']);}else{return _0x495d7b(_0xeaa2b6[_0xb933('0xb')]);}})[_0xb933('0xc')](function(_0x45c30f){logger['error'](_0xb933('0x9'),_0xb933('0x2'),_0x571e94,_0x45c30f,_0x2eb152);return _0x3bfe8b(_0x45c30f);});});};module[_0xb933('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 17a1c87..7a55fdb 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 _0xa3ec=['initMailQueues','initFaxQueues','getWhatsappQueues','listen','log','bluebird','./server','./realtime','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues'];(function(_0x510cdd,_0x1476e1){var _0x7af7e6=function(_0x25310b){while(--_0x25310b){_0x510cdd['push'](_0x510cdd['shift']());}};_0x7af7e6(++_0x1476e1);}(_0xa3ec,0xdd));var _0xca3e=function(_0x31145a,_0x46e38e){_0x31145a=_0x31145a-0x0;var _0x1eae52=_0xa3ec[_0x31145a];return _0x1eae52;};'use strict';var BPromise=require(_0xca3e('0x0'));var server=require(_0xca3e('0x1'));var Realtime=require(_0xca3e('0x2'));var user=require('./rpc/user');var interval=require(_0xca3e('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xca3e('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xca3e('0x5'));var faxQueue=require(_0xca3e('0x6'));var whatsappQueue=require(_0xca3e('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xca3e('0x8')]()[_0xca3e('0x9')](user[_0xca3e('0xa')]())[_0xca3e('0x9')](realtime[_0xca3e('0xb')]())['then'](interval[_0xca3e('0xc')]())['then'](realtime[_0xca3e('0xd')]())[_0xca3e('0x9')](openchannelQueue['getOpenchannelQueues']())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue[_0xca3e('0xe')]())[_0xca3e('0x9')](realtime[_0xca3e('0xf')]())[_0xca3e('0x9')](smsQueue[_0xca3e('0x10')]())[_0xca3e('0x9')](realtime[_0xca3e('0x11')]())[_0xca3e('0x9')](mailQueue[_0xca3e('0x12')]())[_0xca3e('0x9')](realtime[_0xca3e('0x13')]())[_0xca3e('0x9')](faxQueue['getFaxQueues']())['then'](realtime[_0xca3e('0x14')]())[_0xca3e('0x9')](whatsappQueue[_0xca3e('0x15')]())[_0xca3e('0x9')](realtime['initWhatsappQueues']())[_0xca3e('0x9')](function(){return realtime;});}function main(){return server[_0xca3e('0x16')](realtime)[_0xca3e('0x9')](function(_0x478999){return initRealtime();})[_0xca3e('0x9')](function(_0x11188f){return setInterval(initRealtime,0x1388);})['catch'](function(_0x19bdf5){console[_0xca3e('0x17')](_0x19bdf5);});}main(); \ No newline at end of file +var _0x67ba=['getAgents','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','log','bluebird','./server','./rpc/user','./rpc/interval','./rpc/smsQueue','./rpc/mailQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x44a9c8,_0x19facb){var _0x3a3d70=function(_0x133828){while(--_0x133828){_0x44a9c8['push'](_0x44a9c8['shift']());}};_0x3a3d70(++_0x19facb);}(_0x67ba,0x1da));var _0xa67b=function(_0x2da495,_0xc7e61c){_0x2da495=_0x2da495-0x0;var _0x514d87=_0x67ba[_0x2da495];return _0x514d87;};'use strict';var BPromise=require(_0xa67b('0x0'));var server=require(_0xa67b('0x1'));var Realtime=require('./realtime');var user=require(_0xa67b('0x2'));var interval=require(_0xa67b('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0xa67b('0x4'));var mailQueue=require(_0xa67b('0x5'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xa67b('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xa67b('0x7')]()[_0xa67b('0x8')](user[_0xa67b('0x9')]())[_0xa67b('0x8')](realtime[_0xa67b('0xa')]())[_0xa67b('0x8')](interval['getIntervals']())[_0xa67b('0x8')](realtime[_0xa67b('0xb')]())[_0xa67b('0x8')](openchannelQueue[_0xa67b('0xc')]())[_0xa67b('0x8')](realtime['initOpenchannelQueues']())[_0xa67b('0x8')](chatQueue[_0xa67b('0xd')]())['then'](realtime[_0xa67b('0xe')]())[_0xa67b('0x8')](smsQueue[_0xa67b('0xf')]())['then'](realtime['initSmsQueues']())[_0xa67b('0x8')](mailQueue[_0xa67b('0x10')]())[_0xa67b('0x8')](realtime[_0xa67b('0x11')]())[_0xa67b('0x8')](faxQueue[_0xa67b('0x12')]())['then'](realtime[_0xa67b('0x13')]())['then'](whatsappQueue[_0xa67b('0x14')]())['then'](realtime['initWhatsappQueues']())[_0xa67b('0x8')](function(){return realtime;});}function main(){return server[_0xa67b('0x15')](realtime)['then'](function(_0x1754fb){return initRealtime();})[_0xa67b('0x8')](function(_0x5c5ea3){return setInterval(initRealtime,0x1388);})['catch'](function(_0x30576b){console[_0xa67b('0x16')](_0x30576b);});}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 f0e4792..00b1cd0 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 _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x7c6b1d,_0x59021c){var _0x104a11=function(_0x324abd){while(--_0x324abd){_0x7c6b1d['push'](_0x7c6b1d['shift']());}};_0x104a11(++_0x59021c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x24875d,_0x4fb24d){_0x24875d=_0x24875d-0x0;var _0x181471=_0x5fc3[_0x24875d];return _0x181471;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x149dfc,_0x3c53df){var _0x4246ce=function(_0x159e35){while(--_0x159e35){_0x149dfc['push'](_0x149dfc['shift']());}};_0x4246ce(++_0x3c53df);}(_0x5fc3,0xa8));var _0x35fc=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0x5fc3[_0x375492];return _0x18ba5b;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};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 bc42f06..a0679a6 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 _0x4c52=['http','request','then','error','message','catch','sendMailMessage','bluebird','jayson/promise','client'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4c52,0x1f1));var _0x24c5=function(_0x3cb83f,_0x2bc6dd){_0x3cb83f=_0x3cb83f-0x0;var _0x105d68=_0x4c52[_0x3cb83f];return _0x105d68;};'use strict';var BPromise=require(_0x24c5('0x0'));var jayson=require(_0x24c5('0x1'));var client=jayson[_0x24c5('0x2')][_0x24c5('0x3')]({'port':0x232b});function request(_0x491fce,_0x50575b){return new BPromise(function(_0x4b1661,_0x27ddc2){return client[_0x24c5('0x4')](_0x491fce,_0x50575b)[_0x24c5('0x5')](function(_0x36a2d1){if(_0x36a2d1[_0x24c5('0x6')]){return _0x27ddc2(_0x36a2d1[_0x24c5('0x6')][_0x24c5('0x7')]);}else{return _0x4b1661(_0x36a2d1['result']);}})[_0x24c5('0x8')](function(_0x1becca){return _0x27ddc2(_0x1becca);});});}exports[_0x24c5('0x9')]=function(_0x1c83ff,_0x184569){return request('SendMail',{'account':_0x1c83ff,'message':_0x184569});}; \ No newline at end of file +var _0xae9d=['request','then','error','message','result','sendMailMessage','bluebird','client'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xae9d,0x146));var _0xdae9=function(_0x1c31fc,_0x39514d){_0x1c31fc=_0x1c31fc-0x0;var _0x400ade=_0xae9d[_0x1c31fc];return _0x400ade;};'use strict';var BPromise=require(_0xdae9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xdae9('0x1')]['http']({'port':0x232b});function request(_0x5da5b1,_0x3c9859){return new BPromise(function(_0x35bd02,_0x3a152f){return client[_0xdae9('0x2')](_0x5da5b1,_0x3c9859)[_0xdae9('0x3')](function(_0x31e399){if(_0x31e399[_0xdae9('0x4')]){return _0x3a152f(_0x31e399[_0xdae9('0x4')][_0xdae9('0x5')]);}else{return _0x35bd02(_0x31e399[_0xdae9('0x6')]);}})['catch'](function(_0x320411){return _0x3a152f(_0x320411);});});}exports[_0xdae9('0x7')]=function(_0x41389f,_0x242c1a){return request('SendMail',{'account':_0x41389f,'message':_0x242c1a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 61b50a3..15a6422 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 _0xe195=['chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCurrentCapacity','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','prototype','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','chatStatusTime','mailStatusTime','smsStatus','whatsappStatus','busyQueue','emit','user:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity'];(function(_0x456b77,_0x4fed12){var _0x118bb6=function(_0x2ea238){while(--_0x2ea238){_0x456b77['push'](_0x456b77['shift']());}};_0x118bb6(++_0x4fed12);}(_0xe195,0x1c6));var _0x5e19=function(_0x3ddf16,_0x327d21){_0x3ddf16=_0x3ddf16-0x0;var _0x3a98b8=_0xe195[_0x3ddf16];return _0x3a98b8;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x5e19('0x0'));var Redis=require(_0x5e19('0x1'));var config=require(_0x5e19('0x2'));config[_0x5e19('0x3')]=_[_0x5e19('0x4')](config['redis'],{'host':_0x5e19('0x5'),'port':0x18eb});var io=require(_0x5e19('0x6'))(new Redis(config[_0x5e19('0x3')]));function Agent(_0x14a70e){this['id']=_0x14a70e['id']||0x0;this[_0x5e19('0x7')]=_0x14a70e['name']||'';this[_0x5e19('0x8')]=_0x14a70e['online']||!![];this[_0x5e19('0x9')]=_0x14a70e[_0x5e19('0x9')]||![];this[_0x5e19('0xa')]=_0x14a70e[_0x5e19('0xa')]||![];this['mailPause']=_0x14a70e[_0x5e19('0xb')]||![];this['faxPause']=_0x14a70e[_0x5e19('0xc')]||![];this[_0x5e19('0xd')]=_0x14a70e[_0x5e19('0xd')]||![];this[_0x5e19('0xe')]=_0x14a70e[_0x5e19('0xe')]||![];this[_0x5e19('0xf')]=_0x5e19('0x10');this['chatStatusTime']=0x0;this[_0x5e19('0x11')]=_0x14a70e[_0x5e19('0x11')]||0x0;this[_0x5e19('0x12')]=0x0;this[_0x5e19('0x13')]=_0x5e19('0x10');this['mailStatusTime']=0x0;this[_0x5e19('0x14')]=_0x14a70e[_0x5e19('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x5e19('0x15')]=_0x5e19('0x10');this[_0x5e19('0x16')]=0x0;this['faxCapacity']=_0x14a70e['faxCapacity']||0x0;this[_0x5e19('0x17')]=0x0;this['smsStatus']=_0x5e19('0x10');this[_0x5e19('0x18')]=0x0;this[_0x5e19('0x19')]=_0x14a70e['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x5e19('0x1a')]=0x0;this[_0x5e19('0x1b')]=_0x14a70e['whatsappCapacity']||0x0;this[_0x5e19('0x1c')]=0x0;this[_0x5e19('0x1d')]=_0x5e19('0x10');this[_0x5e19('0x1e')]=0x0;this[_0x5e19('0x1f')]=_0x14a70e[_0x5e19('0x1f')]||0x0;this[_0x5e19('0x20')]=0x0;this[_0x5e19('0x21')]=![];this['busyQueue']=undefined;this[_0x5e19('0x0')]='';this[_0x5e19('0x22')]();}Agent['prototype'][_0x5e19('0x23')]=function(_0x36b6f0){if(this[_0x36b6f0+_0x5e19('0x24')]>0x0){if(this[_0x36b6f0+_0x5e19('0x25')]>0x0&&this[_0x36b6f0+_0x5e19('0x24')]>=this[_0x36b6f0+_0x5e19('0x25')]){return _0x5e19('0x26');}else{return _0x5e19('0x27');}}else{return'idle';}};Agent[_0x5e19('0x28')][_0x5e19('0x22')]=function(){var _0x3e2516=[_0x5e19('0x29'),_0x5e19('0x2a'),'openchannel',_0x5e19('0x2b'),_0x5e19('0x2c'),_0x5e19('0x2d')];for(var _0x2a6265=0x0;_0x2a6265<_0x3e2516[_0x5e19('0x2e')];_0x2a6265+=0x1){var _0x28cd99=this[_0x5e19('0x23')](_0x3e2516[_0x2a6265]);if(this[_0x3e2516[_0x2a6265]+_0x5e19('0x2f')]!==_0x28cd99){this[_0x3e2516[_0x2a6265]+_0x5e19('0x30')]=_[_0x5e19('0x31')](moment()[_0x5e19('0x32')]('x'));}this[_0x3e2516[_0x2a6265]+_0x5e19('0x2f')]=_0x28cd99;}var _0x425f82={'id':this['id'],'name':this[_0x5e19('0x7')],'online':this['online'],'voicePause':this[_0x5e19('0x9')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x5e19('0xd')],'faxPause':this[_0x5e19('0xc')],'openchannelPause':this[_0x5e19('0xe')],'chatStatus':this[_0x5e19('0xf')],'chatStatusTime':this[_0x5e19('0x33')],'chatCapacity':this[_0x5e19('0x11')],'chatCurrentCapacity':this[_0x5e19('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x5e19('0x34')],'mailCapacity':this[_0x5e19('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x5e19('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x5e19('0x35')],'smsStatusTime':this[_0x5e19('0x18')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x5e19('0x36')],'whatsappStatusTime':this[_0x5e19('0x1a')],'whatsappCapacity':this[_0x5e19('0x1b')],'whatsappCurrentCapacity':this[_0x5e19('0x1c')],'openchannelStatus':this[_0x5e19('0x1d')],'openchannelStatusTime':this[_0x5e19('0x1e')],'openchannelCapacity':this[_0x5e19('0x1f')],'openchannelCurrentCapacity':this[_0x5e19('0x20')],'busy':this[_0x5e19('0x21')],'busyQueue':this[_0x5e19('0x37')]};var _0x5d5418=md5(JSON['stringify'](_0x425f82));if(this[_0x5e19('0x0')]!==_0x5d5418){this['md5']=_0x5d5418;io[_0x5e19('0x38')](_0x5e19('0x39'),_0x425f82);}};module[_0x5e19('0x3a')]=Agent; \ No newline at end of file +var _0x3bc4=['faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','maxcapacity','working','idle','updateRealtime','chat','openchannel','fax','sms','Status','smsPause','mailCurrentCapacity','faxStatus','emit','user:save','exports','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatusTime','faxCapacity'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x3bc4,0xc9));var _0x43bc=function(_0x2385fc,_0x4c17b4){_0x2385fc=_0x2385fc-0x0;var _0x5e7e2e=_0x3bc4[_0x2385fc];return _0x5e7e2e;};'use strict';var _=require('lodash');var moment=require(_0x43bc('0x0'));var md5=require(_0x43bc('0x1'));var Redis=require(_0x43bc('0x2'));var config=require('../../../config/environment');config[_0x43bc('0x3')]=_[_0x43bc('0x4')](config[_0x43bc('0x3')],{'host':_0x43bc('0x5'),'port':0x18eb});var io=require(_0x43bc('0x6'))(new Redis(config[_0x43bc('0x3')]));function Agent(_0x5f1b2f){this['id']=_0x5f1b2f['id']||0x0;this[_0x43bc('0x7')]=_0x5f1b2f[_0x43bc('0x7')]||'';this[_0x43bc('0x8')]=_0x5f1b2f[_0x43bc('0x8')]||!![];this[_0x43bc('0x9')]=_0x5f1b2f[_0x43bc('0x9')]||![];this[_0x43bc('0xa')]=_0x5f1b2f[_0x43bc('0xa')]||![];this[_0x43bc('0xb')]=_0x5f1b2f[_0x43bc('0xb')]||![];this[_0x43bc('0xc')]=_0x5f1b2f[_0x43bc('0xc')]||![];this['smsPause']=_0x5f1b2f['smsPause']||![];this[_0x43bc('0xd')]=_0x5f1b2f[_0x43bc('0xd')]||![];this[_0x43bc('0xe')]='unknown';this['chatStatusTime']=0x0;this[_0x43bc('0xf')]=_0x5f1b2f[_0x43bc('0xf')]||0x0;this[_0x43bc('0x10')]=0x0;this[_0x43bc('0x11')]=_0x43bc('0x12');this[_0x43bc('0x13')]=0x0;this[_0x43bc('0x14')]=_0x5f1b2f[_0x43bc('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this['faxStatus']=_0x43bc('0x12');this[_0x43bc('0x15')]=0x0;this[_0x43bc('0x16')]=_0x5f1b2f[_0x43bc('0x16')]||0x0;this[_0x43bc('0x17')]=0x0;this[_0x43bc('0x18')]='unknown';this[_0x43bc('0x19')]=0x0;this[_0x43bc('0x1a')]=_0x5f1b2f[_0x43bc('0x1a')]||0x0;this[_0x43bc('0x1b')]=0x0;this[_0x43bc('0x1c')]='unknown';this[_0x43bc('0x1d')]=0x0;this[_0x43bc('0x1e')]=_0x5f1b2f['whatsappCapacity']||0x0;this[_0x43bc('0x1f')]=0x0;this[_0x43bc('0x20')]='unknown';this[_0x43bc('0x21')]=0x0;this[_0x43bc('0x22')]=_0x5f1b2f[_0x43bc('0x22')]||0x0;this[_0x43bc('0x23')]=0x0;this[_0x43bc('0x24')]=![];this[_0x43bc('0x25')]=undefined;this[_0x43bc('0x1')]='';this['updateRealtime']();}Agent[_0x43bc('0x26')][_0x43bc('0x27')]=function(_0x55d10e){if(this[_0x55d10e+_0x43bc('0x28')]>0x0){if(this[_0x55d10e+'Capacity']>0x0&&this[_0x55d10e+_0x43bc('0x28')]>=this[_0x55d10e+'Capacity']){return _0x43bc('0x29');}else{return _0x43bc('0x2a');}}else{return _0x43bc('0x2b');}};Agent[_0x43bc('0x26')][_0x43bc('0x2c')]=function(){var _0x349138=['mail',_0x43bc('0x2d'),_0x43bc('0x2e'),_0x43bc('0x2f'),_0x43bc('0x30'),'whatsapp'];for(var _0x50e2ee=0x0;_0x50e2ee<_0x349138['length'];_0x50e2ee+=0x1){var _0x21844d=this[_0x43bc('0x27')](_0x349138[_0x50e2ee]);if(this[_0x349138[_0x50e2ee]+'Status']!==_0x21844d){this[_0x349138[_0x50e2ee]+'StatusTime']=_['toNumber'](moment()['format']('x'));}this[_0x349138[_0x50e2ee]+_0x43bc('0x31')]=_0x21844d;}var _0x526c1b={'id':this['id'],'name':this[_0x43bc('0x7')],'online':this[_0x43bc('0x8')],'voicePause':this[_0x43bc('0x9')],'chatPause':this[_0x43bc('0xa')],'mailPause':this[_0x43bc('0xb')],'smsPause':this[_0x43bc('0x32')],'faxPause':this[_0x43bc('0xc')],'openchannelPause':this[_0x43bc('0xd')],'chatStatus':this[_0x43bc('0xe')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x43bc('0xf')],'chatCurrentCapacity':this[_0x43bc('0x10')],'mailStatus':this[_0x43bc('0x11')],'mailStatusTime':this[_0x43bc('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x43bc('0x33')],'faxStatus':this[_0x43bc('0x34')],'faxStatusTime':this[_0x43bc('0x15')],'faxCapacity':this[_0x43bc('0x16')],'faxCurrentCapacity':this[_0x43bc('0x17')],'smsStatus':this[_0x43bc('0x18')],'smsStatusTime':this[_0x43bc('0x19')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0x43bc('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x43bc('0x1e')],'whatsappCurrentCapacity':this[_0x43bc('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x43bc('0x21')],'openchannelCapacity':this[_0x43bc('0x22')],'openchannelCurrentCapacity':this[_0x43bc('0x23')],'busy':this[_0x43bc('0x24')],'busyQueue':this[_0x43bc('0x25')]};var _0x39b4b2=md5(JSON['stringify'](_0x526c1b));if(this[_0x43bc('0x1')]!==_0x39b4b2){this[_0x43bc('0x1')]=_0x39b4b2;io[_0x43bc('0x35')](_0x43bc('0x36'),_0x526c1b);}};module[_0x43bc('0x37')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index ef82b52..625204f 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 _0x2597=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','length','online','available','stringify','chat:queue:%s','emit','chat_queue:save','lodash','md5','util','ioredis','redis','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2597,0x1d6));var _0x7259=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x2597[_0x58c20f];return _0x3b0318;};'use strict';var _=require(_0x7259('0x0'));var md5=require(_0x7259('0x1'));var util=require(_0x7259('0x2'));var Redis=require(_0x7259('0x3'));var config=require('../../../config/environment');config[_0x7259('0x4')]=_[_0x7259('0x5')](config[_0x7259('0x4')],{'host':_0x7259('0x6'),'port':0x18eb});var io=require(_0x7259('0x7'))(new Redis(config[_0x7259('0x4')]));function ChatQueue(_0x4acc1c){this['id']=_0x4acc1c['id']||0x0;this[_0x7259('0x8')]=_0x4acc1c[_0x7259('0x8')]||'';this[_0x7259('0x9')]=_0x4acc1c['timeout']||0xa;this[_0x7259('0xa')]=_0x4acc1c[_0x7259('0xa')]||_0x7259('0xb');this[_0x7259('0xc')]=_0x4acc1c[_0x7259('0xc')];this[_0x7259('0xd')]={};this[_0x7259('0xe')]=0x0;this[_0x7259('0x1')]='';this['updateRouting']();this[_0x7259('0xf')]();}ChatQueue[_0x7259('0x10')][_0x7259('0x11')]=function(){var _0x254df3=this[_0x7259('0xd')][_0x7259('0x12')];this[_0x7259('0xd')]=_['map'](this['Agents'],'id');this[_0x7259('0xd')][_0x7259('0x12')]=_0x254df3;};ChatQueue['prototype'][_0x7259('0xf')]=function(){this[_0x7259('0x13')]=0x0;this[_0x7259('0x14')]=0x0;for(var _0x2167bd=0x0;_0x2167bd=0x0?this[_0x7259('0x17')]:0x0;var _0x295b05={'id':this['id'],'available':this[_0x7259('0x17')],'loggedIn':this[_0x7259('0x13')],'name':this[_0x7259('0x8')],'paused':this[_0x7259('0x14')],'waiting':this[_0x7259('0xe')]};var _0x32b6a6=md5(JSON[_0x7259('0x18')](_0x295b05));if(this[_0x7259('0x1')]!==_0x32b6a6){this['md5']=_0x32b6a6;io['to'](util['format'](_0x7259('0x19'),_0x295b05[_0x7259('0x8')]))[_0x7259('0x1a')](_0x7259('0x1b'),_0x295b05);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xe739=['emit','chat_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','paused','length','online','loggedIn','chatPause','available','format','chat:queue:%s'];(function(_0x560876,_0x438055){var _0xa01848=function(_0x4d6b71){while(--_0x4d6b71){_0x560876['push'](_0x560876['shift']());}};_0xa01848(++_0x438055);}(_0xe739,0x99));var _0x9e73=function(_0x48ba4d,_0x281910){_0x48ba4d=_0x48ba4d-0x0;var _0x22973a=_0xe739[_0x48ba4d];return _0x22973a;};'use strict';var _=require(_0x9e73('0x0'));var md5=require(_0x9e73('0x1'));var util=require(_0x9e73('0x2'));var Redis=require(_0x9e73('0x3'));var config=require('../../../config/environment');config['redis']=_[_0x9e73('0x4')](config[_0x9e73('0x5')],{'host':_0x9e73('0x6'),'port':0x18eb});var io=require(_0x9e73('0x7'))(new Redis(config[_0x9e73('0x5')]));function ChatQueue(_0x3f8428){this['id']=_0x3f8428['id']||0x0;this[_0x9e73('0x8')]=_0x3f8428[_0x9e73('0x8')]||'';this[_0x9e73('0x9')]=_0x3f8428['timeout']||0xa;this[_0x9e73('0xa')]=_0x3f8428[_0x9e73('0xa')]||_0x9e73('0xb');this[_0x9e73('0xc')]=_0x3f8428[_0x9e73('0xc')];this[_0x9e73('0xd')]={};this[_0x9e73('0xe')]=0x0;this['md5']='';this[_0x9e73('0xf')]();this[_0x9e73('0x10')]();}ChatQueue[_0x9e73('0x11')][_0x9e73('0xf')]=function(){var _0x55ea95=this[_0x9e73('0xd')]['_rr'];this[_0x9e73('0xd')]=_[_0x9e73('0x12')](this[_0x9e73('0xc')],'id');this[_0x9e73('0xd')]['_rr']=_0x55ea95;};ChatQueue[_0x9e73('0x11')][_0x9e73('0x10')]=function(){this['loggedIn']=0x0;this[_0x9e73('0x13')]=0x0;for(var _0xfb78f1=0x0;_0xfb78f1=0x0?this[_0x9e73('0x18')]:0x0;var _0x4229e6={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9e73('0x16')],'name':this[_0x9e73('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x27112e=md5(JSON['stringify'](_0x4229e6));if(this[_0x9e73('0x1')]!==_0x27112e){this[_0x9e73('0x1')]=_0x27112e;io['to'](util[_0x9e73('0x19')](_0x9e73('0x1a'),_0x4229e6[_0x9e73('0x8')]))[_0x9e73('0x1b')](_0x9e73('0x1c'),_0x4229e6);}};module[_0x9e73('0x1d')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 46f4fd6..45c9f12 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 _0x9ff6=['ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online','loggedIn','faxPause','available','waiting','format','fax:queue:%s','emit','exports','md5','util'];(function(_0x3372ec,_0x5445e9){var _0x4b076c=function(_0x3f34){while(--_0x3f34){_0x3372ec['push'](_0x3372ec['shift']());}};_0x4b076c(++_0x5445e9);}(_0x9ff6,0x120));var _0x69ff=function(_0x515e9f,_0xff9586){_0x515e9f=_0x515e9f-0x0;var _0x19cbf0=_0x9ff6[_0x515e9f];return _0x19cbf0;};'use strict';var _=require('lodash');var md5=require(_0x69ff('0x0'));var util=require(_0x69ff('0x1'));var Redis=require(_0x69ff('0x2'));var config=require('../../../config/environment');config[_0x69ff('0x3')]=_[_0x69ff('0x4')](config[_0x69ff('0x3')],{'host':_0x69ff('0x5'),'port':0x18eb});var io=require(_0x69ff('0x6'))(new Redis(config['redis']));function FaxQueue(_0x525ae0){this['id']=_0x525ae0['id']||0x0;this['name']=_0x525ae0[_0x69ff('0x7')]||'';this[_0x69ff('0x8')]=_0x525ae0[_0x69ff('0x8')]||0xa;this[_0x69ff('0x9')]=_0x525ae0[_0x69ff('0x9')]||_0x69ff('0xa');this['Agents']=_0x525ae0[_0x69ff('0xb')];this[_0x69ff('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this[_0x69ff('0xd')]();}FaxQueue[_0x69ff('0xe')][_0x69ff('0xf')]=function(){var _0x220aa3=this[_0x69ff('0xc')][_0x69ff('0x10')];this['mapAgentsId']=_[_0x69ff('0x11')](this['Agents'],'id');this[_0x69ff('0xc')]['_rr']=_0x220aa3;};FaxQueue[_0x69ff('0xe')][_0x69ff('0xd')]=function(){this['loggedIn']=0x0;this[_0x69ff('0x12')]=0x0;for(var _0x51184a=0x0;_0x51184a=0x0?this[_0x69ff('0x17')]:0x0;var _0x4d38bc={'id':this['id'],'available':this[_0x69ff('0x17')],'loggedIn':this[_0x69ff('0x15')],'name':this[_0x69ff('0x7')],'paused':this['paused'],'waiting':this[_0x69ff('0x18')]};var _0x4cdf6a=md5(JSON['stringify'](_0x4d38bc));if(this['md5']!==_0x4cdf6a){this[_0x69ff('0x0')]=_0x4cdf6a;io['to'](util[_0x69ff('0x19')](_0x69ff('0x1a'),_0x4d38bc[_0x69ff('0x7')]))[_0x69ff('0x1b')]('fax_queue:save',_0x4d38bc);}};module[_0x69ff('0x1c')]=FaxQueue; \ No newline at end of file +var _0x8cbb=['format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','updateRealtime','paused','length','online','loggedIn','faxPause','available','waiting','stringify'];(function(_0x3cb21e,_0x11849a){var _0xeacd6a=function(_0xef5a2e){while(--_0xef5a2e){_0x3cb21e['push'](_0x3cb21e['shift']());}};_0xeacd6a(++_0x11849a);}(_0x8cbb,0xde));var _0xb8cb=function(_0x3a13eb,_0x2f2512){_0x3a13eb=_0x3a13eb-0x0;var _0x4af64e=_0x8cbb[_0x3a13eb];return _0x4af64e;};'use strict';var _=require(_0xb8cb('0x0'));var md5=require(_0xb8cb('0x1'));var util=require(_0xb8cb('0x2'));var Redis=require(_0xb8cb('0x3'));var config=require(_0xb8cb('0x4'));config[_0xb8cb('0x5')]=_['defaults'](config[_0xb8cb('0x5')],{'host':_0xb8cb('0x6'),'port':0x18eb});var io=require(_0xb8cb('0x7'))(new Redis(config['redis']));function FaxQueue(_0x12eded){this['id']=_0x12eded['id']||0x0;this[_0xb8cb('0x8')]=_0x12eded[_0xb8cb('0x8')]||'';this[_0xb8cb('0x9')]=_0x12eded[_0xb8cb('0x9')]||0xa;this['strategy']=_0x12eded[_0xb8cb('0xa')]||_0xb8cb('0xb');this[_0xb8cb('0xc')]=_0x12eded[_0xb8cb('0xc')];this[_0xb8cb('0xd')]={};this['waiting']=0x0;this['md5']='';this[_0xb8cb('0xe')]();this['updateRealtime']();}FaxQueue[_0xb8cb('0xf')][_0xb8cb('0xe')]=function(){var _0xfd4d5=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0xb8cb('0xc')],'id');this[_0xb8cb('0xd')][_0xb8cb('0x10')]=_0xfd4d5;};FaxQueue[_0xb8cb('0xf')][_0xb8cb('0x11')]=function(){this['loggedIn']=0x0;this[_0xb8cb('0x12')]=0x0;for(var _0x260f93=0x0;_0x260f93=0x0?this[_0xb8cb('0x17')]:0x0;var _0x4ebfb0={'id':this['id'],'available':this[_0xb8cb('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0xb8cb('0x12')],'waiting':this[_0xb8cb('0x18')]};var _0x3fcd8d=md5(JSON[_0xb8cb('0x19')](_0x4ebfb0));if(this[_0xb8cb('0x1')]!==_0x3fcd8d){this[_0xb8cb('0x1')]=_0x3fcd8d;io['to'](util[_0xb8cb('0x1a')](_0xb8cb('0x1b'),_0x4ebfb0[_0xb8cb('0x8')]))[_0xb8cb('0x1c')](_0xb8cb('0x1d'),_0x4ebfb0);}};module[_0xb8cb('0x1e')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 7724f14..cf5ef47 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 _0x9464=['Intervals','exports'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0x9464,0x184));var _0x4946=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x9464[_0x387777];return _0x3f84c0;};'use strict';function Interval(_0x1d950f){this['id']=_0x1d950f['id']||0x0;this['name']=_0x1d950f['name']||'';this[_0x4946('0x0')]=_0x1d950f[_0x4946('0x0')]||{};}module[_0x4946('0x1')]=Interval; \ No newline at end of file +var _0x63fc=['exports','name','Intervals'];(function(_0x58736a,_0x5d0121){var _0x4518e2=function(_0x2d9433){while(--_0x2d9433){_0x58736a['push'](_0x58736a['shift']());}};_0x4518e2(++_0x5d0121);}(_0x63fc,0xd9));var _0xc63f=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x63fc[_0x1b6186];return _0x186121;};'use strict';function Interval(_0x39b6b7){this['id']=_0x39b6b7['id']||0x0;this[_0xc63f('0x0')]=_0x39b6b7[_0xc63f('0x0')]||'';this['Intervals']=_0x39b6b7[_0xc63f('0x1')]||{};}module[_0xc63f('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 7931118..a017e9a 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 _0x85da=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x439ee4,_0x48aa5e){var _0x3f0f50=function(_0x3320f9){while(--_0x3320f9){_0x439ee4['push'](_0x439ee4['shift']());}};_0x3f0f50(++_0x48aa5e);}(_0x85da,0x1f0));var _0xa85d=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0x85da[_0x2842b4];return _0x2b9521;};'use strict';var _=require(_0xa85d('0x0'));var md5=require(_0xa85d('0x1'));var util=require(_0xa85d('0x2'));var Redis=require(_0xa85d('0x3'));var config=require('../../../config/environment');config[_0xa85d('0x4')]=_[_0xa85d('0x5')](config[_0xa85d('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa85d('0x6'))(new Redis(config['redis']));function MailQueue(_0x494f12){this['id']=_0x494f12['id']||0x0;this[_0xa85d('0x7')]=_0x494f12[_0xa85d('0x7')]||'';this['timeout']=_0x494f12[_0xa85d('0x8')]||0xa;this[_0xa85d('0x9')]=_0x494f12[_0xa85d('0x9')]||_0xa85d('0xa');this[_0xa85d('0xb')]=_0x494f12[_0xa85d('0xb')];this[_0xa85d('0xc')]={};this[_0xa85d('0xd')]=0x0;this[_0xa85d('0x1')]='';this[_0xa85d('0xe')]();this[_0xa85d('0xf')]();}MailQueue[_0xa85d('0x10')][_0xa85d('0xe')]=function(){var _0x8f7d30=this[_0xa85d('0xc')][_0xa85d('0x11')];this[_0xa85d('0xc')]=_[_0xa85d('0x12')](this[_0xa85d('0xb')],'id');this[_0xa85d('0xc')][_0xa85d('0x11')]=_0x8f7d30;};MailQueue[_0xa85d('0x10')][_0xa85d('0xf')]=function(){this[_0xa85d('0x13')]=0x0;this[_0xa85d('0x14')]=0x0;for(var _0x3bee51=0x0;_0x3bee51=0x0?this[_0xa85d('0x18')]:0x0;var _0x2205a8={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xa85d('0x7')],'paused':this[_0xa85d('0x14')],'waiting':this[_0xa85d('0xd')]};var _0x27fd8d=md5(JSON[_0xa85d('0x19')](_0x2205a8));if(this[_0xa85d('0x1')]!==_0x27fd8d){this[_0xa85d('0x1')]=_0x27fd8d;io['to'](util['format'](_0xa85d('0x1a'),_0x2205a8[_0xa85d('0x7')]))[_0xa85d('0x1b')](_0xa85d('0x1c'),_0x2205a8);}};module[_0xa85d('0x1d')]=MailQueue; \ No newline at end of file +var _0x4af4=['defaults','localhost','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','prototype','updateRealtime','paused','length','online','loggedIn','mailPause','available','name','waiting','stringify','emit','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x38553c,_0x39ebaa){var _0x48b1d9=function(_0x5153ed){while(--_0x5153ed){_0x38553c['push'](_0x38553c['shift']());}};_0x48b1d9(++_0x39ebaa);}(_0x4af4,0x13f));var _0x44af=function(_0x49a32d,_0x30f788){_0x49a32d=_0x49a32d-0x0;var _0xcba295=_0x4af4[_0x49a32d];return _0xcba295;};'use strict';var _=require(_0x44af('0x0'));var md5=require(_0x44af('0x1'));var util=require(_0x44af('0x2'));var Redis=require('ioredis');var config=require(_0x44af('0x3'));config[_0x44af('0x4')]=_[_0x44af('0x5')](config['redis'],{'host':_0x44af('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x44af('0x4')]));function MailQueue(_0xb3fc7e){this['id']=_0xb3fc7e['id']||0x0;this['name']=_0xb3fc7e['name']||'';this[_0x44af('0x7')]=_0xb3fc7e[_0x44af('0x7')]||0xa;this[_0x44af('0x8')]=_0xb3fc7e['strategy']||_0x44af('0x9');this[_0x44af('0xa')]=_0xb3fc7e['Agents'];this[_0x44af('0xb')]={};this['waiting']=0x0;this[_0x44af('0x1')]='';this[_0x44af('0xc')]();this['updateRealtime']();}MailQueue['prototype'][_0x44af('0xc')]=function(){var _0x1ce2d6=this[_0x44af('0xb')][_0x44af('0xd')];this[_0x44af('0xb')]=_['map'](this['Agents'],'id');this[_0x44af('0xb')][_0x44af('0xd')]=_0x1ce2d6;};MailQueue[_0x44af('0xe')][_0x44af('0xf')]=function(){this['loggedIn']=0x0;this[_0x44af('0x10')]=0x0;for(var _0x29bfcc=0x0;_0x29bfcc=0x0?this[_0x44af('0x15')]:0x0;var _0x123eb4={'id':this['id'],'available':this['available'],'loggedIn':this[_0x44af('0x13')],'name':this[_0x44af('0x16')],'paused':this[_0x44af('0x10')],'waiting':this[_0x44af('0x17')]};var _0x259ad3=md5(JSON[_0x44af('0x18')](_0x123eb4));if(this[_0x44af('0x1')]!==_0x259ad3){this[_0x44af('0x1')]=_0x259ad3;io['to'](util['format']('mail:queue:%s',_0x123eb4[_0x44af('0x16')]))[_0x44af('0x19')]('mail_queue:save',_0x123eb4);}};module[_0x44af('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index f883357..2b7d3a0 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x7a54,0x106));var _0x47a5=function(_0x56ea8b,_0x4f1c4b){_0x56ea8b=_0x56ea8b-0x0;var _0x3e8fc8=_0x7a54[_0x56ea8b];return _0x3e8fc8;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index ce29db9..bc90e11 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 _0x07c3=['updateRouting','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype'];(function(_0x39d82c,_0x2ca533){var _0x1cd73a=function(_0x52b6cc){while(--_0x52b6cc){_0x39d82c['push'](_0x39d82c['shift']());}};_0x1cd73a(++_0x2ca533);}(_0x07c3,0x1bf));var _0x307c=function(_0x3240ff,_0x3b9c3d){_0x3240ff=_0x3240ff-0x0;var _0x514858=_0x07c3[_0x3240ff];return _0x514858;};'use strict';var _=require(_0x307c('0x0'));var md5=require(_0x307c('0x1'));var util=require(_0x307c('0x2'));var Redis=require(_0x307c('0x3'));var config=require(_0x307c('0x4'));config[_0x307c('0x5')]=_[_0x307c('0x6')](config[_0x307c('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x307c('0x7'))(new Redis(config[_0x307c('0x5')]));function SmsQueue(_0x27515b){this['id']=_0x27515b['id']||0x0;this[_0x307c('0x8')]=_0x27515b[_0x307c('0x8')]||'';this[_0x307c('0x9')]=_0x27515b[_0x307c('0x9')]||0xa;this[_0x307c('0xa')]=_0x27515b[_0x307c('0xa')]||_0x307c('0xb');this[_0x307c('0xc')]=_0x27515b[_0x307c('0xc')];this[_0x307c('0xd')]={};this[_0x307c('0xe')]=0x0;this[_0x307c('0x1')]='';this['updateRouting']();this[_0x307c('0xf')]();}SmsQueue[_0x307c('0x10')][_0x307c('0x11')]=function(){var _0x2af63f=this['mapAgentsId']['_rr'];this[_0x307c('0xd')]=_['map'](this[_0x307c('0xc')],'id');this[_0x307c('0xd')]['_rr']=_0x2af63f;};SmsQueue[_0x307c('0x10')][_0x307c('0xf')]=function(){this[_0x307c('0x12')]=0x0;this[_0x307c('0x13')]=0x0;for(var _0x4193d8=0x0;_0x4193d8=0x0?this[_0x307c('0x17')]:0x0;var _0x3e05e2={'id':this['id'],'available':this[_0x307c('0x17')],'loggedIn':this[_0x307c('0x12')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x307c('0xe')]};var _0x4aa3c8=md5(JSON[_0x307c('0x18')](_0x3e05e2));if(this['md5']!==_0x4aa3c8){this['md5']=_0x4aa3c8;io['to'](util[_0x307c('0x19')](_0x307c('0x1a'),_0x3e05e2['name']))[_0x307c('0x1b')](_0x307c('0x1c'),_0x3e05e2);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xb2ff=['smsPause','available','sms:queue:%s','sms_queue:save','exports','lodash','md5','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','online'];(function(_0xa1eec2,_0x13fca8){var _0x3255eb=function(_0x4598fe){while(--_0x4598fe){_0xa1eec2['push'](_0xa1eec2['shift']());}};_0x3255eb(++_0x13fca8);}(_0xb2ff,0x123));var _0xfb2f=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb2ff[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xfb2f('0x0'));var md5=require(_0xfb2f('0x1'));var util=require('util');var Redis=require(_0xfb2f('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xfb2f('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xfb2f('0x4'))(new Redis(config[_0xfb2f('0x3')]));function SmsQueue(_0x3c5835){this['id']=_0x3c5835['id']||0x0;this[_0xfb2f('0x5')]=_0x3c5835['name']||'';this['timeout']=_0x3c5835[_0xfb2f('0x6')]||0xa;this['strategy']=_0x3c5835[_0xfb2f('0x7')]||_0xfb2f('0x8');this[_0xfb2f('0x9')]=_0x3c5835[_0xfb2f('0x9')];this['mapAgentsId']={};this[_0xfb2f('0xa')]=0x0;this['md5']='';this[_0xfb2f('0xb')]();this['updateRealtime']();}SmsQueue[_0xfb2f('0xc')][_0xfb2f('0xb')]=function(){var _0x31ffea=this[_0xfb2f('0xd')][_0xfb2f('0xe')];this['mapAgentsId']=_[_0xfb2f('0xf')](this[_0xfb2f('0x9')],'id');this[_0xfb2f('0xd')][_0xfb2f('0xe')]=_0x31ffea;};SmsQueue[_0xfb2f('0xc')][_0xfb2f('0x10')]=function(){this[_0xfb2f('0x11')]=0x0;this[_0xfb2f('0x12')]=0x0;for(var _0x5f3893=0x0;_0x5f3893=0x0?this[_0xfb2f('0x16')]:0x0;var _0x239a88={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfb2f('0x11')],'name':this[_0xfb2f('0x5')],'paused':this[_0xfb2f('0x12')],'waiting':this[_0xfb2f('0xa')]};var _0x448216=md5(JSON['stringify'](_0x239a88));if(this['md5']!==_0x448216){this[_0xfb2f('0x1')]=_0x448216;io['to'](util['format'](_0xfb2f('0x17'),_0x239a88['name']))['emit'](_0xfb2f('0x18'),_0x239a88);}};module[_0xfb2f('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 6479e45..d220bbe 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 _0x17cf=['strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout'];(function(_0x13f257,_0x3c3d67){var _0x455f37=function(_0x3471eb){while(--_0x3471eb){_0x13f257['push'](_0x13f257['shift']());}};_0x455f37(++_0x3c3d67);}(_0x17cf,0xc2));var _0xf17c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x17cf[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xf17c('0x0'));var md5=require(_0xf17c('0x1'));var util=require('util');var Redis=require(_0xf17c('0x2'));var config=require(_0xf17c('0x3'));config[_0xf17c('0x4')]=_[_0xf17c('0x5')](config['redis'],{'host':_0xf17c('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf17c('0x4')]));function WhatsappQueue(_0x2707dd){this['id']=_0x2707dd['id']||0x0;this[_0xf17c('0x7')]=_0x2707dd['name']||'';this[_0xf17c('0x8')]=_0x2707dd[_0xf17c('0x8')]||0xa;this[_0xf17c('0x9')]=_0x2707dd[_0xf17c('0x9')]||_0xf17c('0xa');this[_0xf17c('0xb')]=_0x2707dd[_0xf17c('0xb')];this[_0xf17c('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xf17c('0xd')]();this[_0xf17c('0xe')]();}WhatsappQueue['prototype'][_0xf17c('0xd')]=function(){var _0x14458f=this[_0xf17c('0xc')]['_rr'];this[_0xf17c('0xc')]=_[_0xf17c('0xf')](this['Agents'],'id');this[_0xf17c('0xc')][_0xf17c('0x10')]=_0x14458f;};WhatsappQueue[_0xf17c('0x11')][_0xf17c('0xe')]=function(){this[_0xf17c('0x12')]=0x0;this[_0xf17c('0x13')]=0x0;for(var _0x5d94d4=0x0;_0x5d94d4=0x0?this[_0xf17c('0x16')]:0x0;var _0x4deaea={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf17c('0x12')],'name':this[_0xf17c('0x7')],'paused':this[_0xf17c('0x13')],'waiting':this['waiting']};var _0x51ae4b=md5(JSON[_0xf17c('0x17')](_0x4deaea));if(this[_0xf17c('0x1')]!==_0x51ae4b){this[_0xf17c('0x1')]=_0x51ae4b;io['to'](util[_0xf17c('0x18')](_0xf17c('0x19'),_0x4deaea['name']))[_0xf17c('0x1a')](_0xf17c('0x1b'),_0x4deaea);}};module[_0xf17c('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xf919=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','whatsappPause','available','stringify','md5','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','util','../../../config/environment','defaults'];(function(_0x3825ba,_0x3bd6cf){var _0x4e5c4d=function(_0xb0c93e){while(--_0xb0c93e){_0x3825ba['push'](_0x3825ba['shift']());}};_0x4e5c4d(++_0x3bd6cf);}(_0xf919,0x8d));var _0x9f91=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xf919[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x9f91('0x0'));var md5=require('md5');var util=require(_0x9f91('0x1'));var Redis=require('ioredis');var config=require(_0x9f91('0x2'));config['redis']=_[_0x9f91('0x3')](config['redis'],{'host':_0x9f91('0x4'),'port':0x18eb});var io=require(_0x9f91('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x162851){this['id']=_0x162851['id']||0x0;this[_0x9f91('0x6')]=_0x162851[_0x9f91('0x6')]||'';this[_0x9f91('0x7')]=_0x162851['timeout']||0xa;this[_0x9f91('0x8')]=_0x162851[_0x9f91('0x8')]||_0x9f91('0x9');this[_0x9f91('0xa')]=_0x162851[_0x9f91('0xa')];this['mapAgentsId']={};this[_0x9f91('0xb')]=0x0;this['md5']='';this[_0x9f91('0xc')]();this[_0x9f91('0xd')]();}WhatsappQueue[_0x9f91('0xe')][_0x9f91('0xc')]=function(){var _0x1d858a=this[_0x9f91('0xf')][_0x9f91('0x10')];this['mapAgentsId']=_[_0x9f91('0x11')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x1d858a;};WhatsappQueue[_0x9f91('0xe')][_0x9f91('0xd')]=function(){this[_0x9f91('0x12')]=0x0;this[_0x9f91('0x13')]=0x0;for(var _0x49e53f=0x0;_0x49e53f=0x0?this[_0x9f91('0x16')]:0x0;var _0x1e9d56={'id':this['id'],'available':this[_0x9f91('0x16')],'loggedIn':this[_0x9f91('0x12')],'name':this[_0x9f91('0x6')],'paused':this[_0x9f91('0x13')],'waiting':this[_0x9f91('0xb')]};var _0x2168d8=md5(JSON[_0x9f91('0x17')](_0x1e9d56));if(this[_0x9f91('0x18')]!==_0x2168d8){this[_0x9f91('0x18')]=_0x2168d8;io['to'](util[_0x9f91('0x19')](_0x9f91('0x1a'),_0x1e9d56[_0x9f91('0x6')]))['emit'](_0x9f91('0x1b'),_0x1e9d56);}};module[_0x9f91('0x1c')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index f31d3d3..2d303d2 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 04591ed..4f484b0 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 _0xfb4c=['AddTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x393ab0,_0x55a8d6){var _0x737c74=function(_0x21507c){while(--_0x21507c){_0x393ab0['push'](_0x393ab0['shift']());}};_0x737c74(++_0x55a8d6);}(_0xfb4c,0xc5));var _0xcfb4=function(_0x1dbfff,_0x67b8dd){_0x1dbfff=_0x1dbfff-0x0;var _0x59c703=_0xfb4c[_0x1dbfff];return _0x59c703;};'use strict';var client=require(_0xcfb4('0x0'));exports[_0xcfb4('0x1')]=function(_0x385fa1,_0x2702bf){return client[_0xcfb4('0x2')](_0xcfb4('0x3'),{'body':_0x2702bf,'options':{'where':{'id':_0x385fa1}},'log':_0xcfb4('0x4')});};exports[_0xcfb4('0x5')]=function(_0x2479d2,_0x4a1ae6){return client['Request'](_0xcfb4('0x6'),{'body':_0x4a1ae6,'options':{'where':{'id':_0x2479d2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x5ace=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x452858,_0x298e2b){var _0xb74d4e=function(_0x89be74){while(--_0x89be74){_0x452858['push'](_0x452858['shift']());}};_0xb74d4e(++_0x298e2b);}(_0x5ace,0x72));var _0xe5ac=function(_0x3a081b,_0x516437){_0x3a081b=_0x3a081b-0x0;var _0xb166c4=_0x5ace[_0x3a081b];return _0xb166c4;};'use strict';var client=require(_0xe5ac('0x0'));exports[_0xe5ac('0x1')]=function(_0x2e14e7,_0x6a43a3){return client[_0xe5ac('0x2')](_0xe5ac('0x3'),{'body':_0x6a43a3,'options':{'where':{'id':_0x2e14e7}},'log':_0xe5ac('0x4')});};exports[_0xe5ac('0x5')]=function(_0xdd4a5f,_0x1bc902){return client[_0xe5ac('0x2')](_0xe5ac('0x6'),{'body':_0x1bc902,'options':{'where':{'id':_0xdd4a5f}},'log':_0xe5ac('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 5fadde3..8b5a6ca 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 _0x92b2=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x47dc52,_0x57459f){var _0x31748f=function(_0x54a3a1){while(--_0x54a3a1){_0x47dc52['push'](_0x47dc52['shift']());}};_0x31748f(++_0x57459f);}(_0x92b2,0x115));var _0x292b=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x92b2[_0x1e500e];return _0x10dc5e;};'use strict';var client=require(_0x292b('0x0'));exports[_0x292b('0x1')]=function(_0x4a3044){return client[_0x292b('0x2')](_0x292b('0x3'),{'body':_0x4a3044,'log':_0x292b('0x4')});}; \ No newline at end of file +var _0x17f4=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0x17f4,0x138));var _0x417f=function(_0x2f8cc6,_0x18cf3b){_0x2f8cc6=_0x2f8cc6-0x0;var _0x168ac5=_0x17f4[_0x2f8cc6];return _0x168ac5;};'use strict';var client=require(_0x417f('0x0'));exports[_0x417f('0x1')]=function(_0x26ff57){return client[_0x417f('0x2')](_0x417f('0x3'),{'body':_0x26ff57,'log':_0x417f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 2a74ca1..52d7119 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 _0x64f5=['User','online','chatPause','getChatQueues','../client','name','strategy'];(function(_0x434e83,_0x13183f){var _0x1db86f=function(_0x122f01){while(--_0x122f01){_0x434e83['push'](_0x434e83['shift']());}};_0x1db86f(++_0x13183f);}(_0x64f5,0x17e));var _0x564f=function(_0xf45db7,_0x20af2d){_0xf45db7=_0xf45db7-0x0;var _0x36815f=_0x64f5[_0xf45db7];return _0x36815f;};'use strict';var client=require(_0x564f('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x564f('0x1'),'timeout',_0x564f('0x2')],'include':[{'model':_0x564f('0x3'),'as':'Agents','attributes':['id',_0x564f('0x1'),_0x564f('0x4'),_0x564f('0x5')]}]},'log':_0x564f('0x6')});};}; \ No newline at end of file +var _0x6011=['timeout','strategy','Agents','name','online','chatPause','getChatQueues'];(function(_0x53c0b0,_0x51005f){var _0x1c23e5=function(_0x3671cd){while(--_0x3671cd){_0x53c0b0['push'](_0x53c0b0['shift']());}};_0x1c23e5(++_0x51005f);}(_0x6011,0x196));var _0x1601=function(_0x11c532,_0x568f5e){_0x11c532=_0x11c532-0x0;var _0x3bc9cb=_0x6011[_0x11c532];return _0x3bc9cb;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x1601('0x0'),_0x1601('0x1')],'include':[{'model':'User','as':_0x1601('0x2'),'attributes':['id',_0x1601('0x3'),_0x1601('0x4'),_0x1601('0x5')]}]},'log':_0x1601('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 40f3cbe..f2b34d7 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 _0xb2ff=['DESC','../client','create','Request','UpdateChatQueueReport'];(function(_0x31b4aa,_0x9a6429){var _0x1bb3dd=function(_0x310869){while(--_0x310869){_0x31b4aa['push'](_0x31b4aa['shift']());}};_0x1bb3dd(++_0x9a6429);}(_0xb2ff,0x123));var _0xfb2f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb2ff[_0x3ab51d];return _0x29a04e;};'use strict';var client=require(_0xfb2f('0x0'));exports[_0xfb2f('0x1')]=function(_0x585db4){return client[_0xfb2f('0x2')]('CreateChatQueueReport',{'body':_0x585db4,'log':'CreateChatQueueReport'});};exports['update']=function(_0x13cb60,_0x484368){return client[_0xfb2f('0x2')](_0xfb2f('0x3'),{'body':_0x484368,'options':{'where':{'uniqueid':_0x13cb60},'order':[['id',_0xfb2f('0x4')]],'limit':0x1},'log':_0xfb2f('0x3')});}; \ No newline at end of file +var _0x3756=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x3756,0x116));var _0x6375=function(_0xeda956,_0x336035){_0xeda956=_0xeda956-0x0;var _0x2c8c25=_0x3756[_0xeda956];return _0x2c8c25;};'use strict';var client=require(_0x6375('0x0'));exports[_0x6375('0x1')]=function(_0x2cc1ad){return client[_0x6375('0x2')](_0x6375('0x3'),{'body':_0x2cc1ad,'log':_0x6375('0x3')});};exports[_0x6375('0x4')]=function(_0x206284,_0x3f7d9a){return client[_0x6375('0x2')](_0x6375('0x5'),{'body':_0x3f7d9a,'options':{'where':{'uniqueid':_0x206284},'order':[['id',_0x6375('0x6')]],'limit':0x1},'log':_0x6375('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 8c8d779..d6e7455 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(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x7a54,0x106));var _0x47a5=function(_0x7a22d,_0x526d44){_0x7a22d=_0x7a22d-0x0;var _0x370699=_0x7a54[_0x7a22d];return _0x370699;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4b4277,_0x22676f){var _0x1ff405=function(_0x2fa9e2){while(--_0x2fa9e2){_0x4b4277['push'](_0x4b4277['shift']());}};_0x1ff405(++_0x22676f);}(_0x7a54,0x106));var _0x47a5=function(_0x13568b,_0x83e367){_0x13568b=_0x13568b-0x0;var _0x1d3c5e=_0x7a54[_0x13568b];return _0x1d3c5e;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index b25d580..4ba45b8 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 _0x26c3=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x1b9c2a,_0x50582e){var _0x21ab47=function(_0x3382c6){while(--_0x3382c6){_0x1b9c2a['push'](_0x1b9c2a['shift']());}};_0x21ab47(++_0x50582e);}(_0x26c3,0xf3));var _0x326c=function(_0x5f1b0e,_0x557630){_0x5f1b0e=_0x5f1b0e-0x0;var _0x27b2b4=_0x26c3[_0x5f1b0e];return _0x27b2b4;};'use strict';var client=require(_0x326c('0x0'));exports[_0x326c('0x1')]=function(_0x1f8695){return client['Request'](_0x326c('0x2'),{'body':_0x1f8695,'log':_0x326c('0x3')});}; \ No newline at end of file +var _0x78c8=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x1ebe90,_0x5d29fc){var _0x447c82=function(_0x1c2646){while(--_0x1c2646){_0x1ebe90['push'](_0x1ebe90['shift']());}};_0x447c82(++_0x5d29fc);}(_0x78c8,0xb2));var _0x878c=function(_0x23582e,_0x2f3723){_0x23582e=_0x23582e-0x0;var _0x50b082=_0x78c8[_0x23582e];return _0x50b082;};'use strict';var client=require(_0x878c('0x0'));exports[_0x878c('0x1')]=function(_0x4da04b){return client['Request'](_0x878c('0x2'),{'body':_0x4da04b,'log':_0x878c('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d79b4c6..068c379 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 _0x1dd2=['strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x423aa4,_0x43b67d){var _0x1b5390=function(_0x27cfea){while(--_0x27cfea){_0x423aa4['push'](_0x423aa4['shift']());}};_0x1b5390(++_0x43b67d);}(_0x1dd2,0x109));var _0x21dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x21dd('0x0'));exports[_0x21dd('0x1')]=function(){return function(){return client[_0x21dd('0x2')](_0x21dd('0x3'),{'options':{'raw':![],'attributes':['id',_0x21dd('0x4'),'timeout',_0x21dd('0x5')],'include':[{'model':_0x21dd('0x6'),'as':_0x21dd('0x7'),'attributes':['id',_0x21dd('0x4'),_0x21dd('0x8'),_0x21dd('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0xe922=['User','Agents','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name','strategy'];(function(_0x2d67b4,_0x4ca8fe){var _0x4cd582=function(_0x21180a){while(--_0x21180a){_0x2d67b4['push'](_0x2d67b4['shift']());}};_0x4cd582(++_0x4ca8fe);}(_0xe922,0x131));var _0x2e92=function(_0x3f3b53,_0x3d035f){_0x3f3b53=_0x3f3b53-0x0;var _0x3fa180=_0xe922[_0x3f3b53];return _0x3fa180;};'use strict';var client=require(_0x2e92('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x2e92('0x1')](_0x2e92('0x2'),{'options':{'raw':![],'attributes':['id',_0x2e92('0x3'),'timeout',_0x2e92('0x4')],'include':[{'model':_0x2e92('0x5'),'as':_0x2e92('0x6'),'attributes':['id','name',_0x2e92('0x7'),_0x2e92('0x8')]}]},'log':_0x2e92('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 4a32f9f..18a3fa1 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 _0x75a5=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x5aa0ea,_0x3dd445){var _0x34cee5=function(_0x2e1685){while(--_0x2e1685){_0x5aa0ea['push'](_0x5aa0ea['shift']());}};_0x34cee5(++_0x3dd445);}(_0x75a5,0x18b));var _0x575a=function(_0x1269bc,_0x4aacde){_0x1269bc=_0x1269bc-0x0;var _0x34aaf8=_0x75a5[_0x1269bc];return _0x34aaf8;};'use strict';var client=require(_0x575a('0x0'));exports[_0x575a('0x1')]=function(_0x457081){return client[_0x575a('0x2')](_0x575a('0x3'),{'body':_0x457081,'log':_0x575a('0x3')});};exports['update']=function(_0x46bf83,_0xae81e5){return client[_0x575a('0x2')](_0x575a('0x4'),{'body':_0xae81e5,'options':{'where':{'uniqueid':_0x46bf83},'order':[['id',_0x575a('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x8d04=['update','UpdateFaxQueueReport','DESC','create','CreateFaxQueueReport'];(function(_0x5e5964,_0x201efc){var _0xb11687=function(_0x544c1b){while(--_0x544c1b){_0x5e5964['push'](_0x5e5964['shift']());}};_0xb11687(++_0x201efc);}(_0x8d04,0x17f));var _0x48d0=function(_0x296721,_0x1faf76){_0x296721=_0x296721-0x0;var _0x48d377=_0x8d04[_0x296721];return _0x48d377;};'use strict';var client=require('../client');exports[_0x48d0('0x0')]=function(_0x435a9b){return client['Request'](_0x48d0('0x1'),{'body':_0x435a9b,'log':_0x48d0('0x1')});};exports[_0x48d0('0x2')]=function(_0x468e00,_0x56f380){return client['Request'](_0x48d0('0x3'),{'body':_0x56f380,'options':{'where':{'uniqueid':_0x468e00},'order':[['id',_0x48d0('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 41ed4d0..ab5e0be 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 _0x4c2d=['../client','getIntervals','GetInterval','name','Interval'];(function(_0x408762,_0x1e2f39){var _0x5e9e3e=function(_0x1e4e3e){while(--_0x1e4e3e){_0x408762['push'](_0x408762['shift']());}};_0x5e9e3e(++_0x1e2f39);}(_0x4c2d,0x73));var _0xd4c2=function(_0x713bd6,_0x22bbcf){_0x713bd6=_0x713bd6-0x0;var _0x568bb9=_0x4c2d[_0x713bd6];return _0x568bb9;};'use strict';var client=require(_0xd4c2('0x0'));exports[_0xd4c2('0x1')]=function(){return function(){return client['Request'](_0xd4c2('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd4c2('0x3')],'include':[{'model':_0xd4c2('0x4'),'as':'Intervals','attributes':['id',_0xd4c2('0x3'),'interval']}]},'log':_0xd4c2('0x1')});};}; \ No newline at end of file +var _0xc078=['../client','getIntervals','GetInterval','name','Intervals'];(function(_0x3b51b5,_0x4910ed){var _0x1564b8=function(_0x2e0cc0){while(--_0x2e0cc0){_0x3b51b5['push'](_0x3b51b5['shift']());}};_0x1564b8(++_0x4910ed);}(_0xc078,0x19f));var _0x8c07=function(_0x5132b3,_0x1688cf){_0x5132b3=_0x5132b3-0x0;var _0x48aac3=_0xc078[_0x5132b3];return _0x48aac3;};'use strict';var client=require(_0x8c07('0x0'));exports[_0x8c07('0x1')]=function(){return function(){return client['Request'](_0x8c07('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8c07('0x3')],'include':[{'model':'Interval','as':_0x8c07('0x4'),'attributes':['id',_0x8c07('0x3'),'interval']}]},'log':_0x8c07('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ab278fd..9fd5d9b 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 _0x056b=['addTags','AddTagsToMailInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x2a6596,_0x3e2807){var _0x5ef636=function(_0x21e5cc){while(--_0x21e5cc){_0x2a6596['push'](_0x2a6596['shift']());}};_0x5ef636(++_0x3e2807);}(_0x056b,0xb6));var _0xb056=function(_0x49813b,_0x4f170a){_0x49813b=_0x49813b-0x0;var _0x491ece=_0x056b[_0x49813b];return _0x491ece;};'use strict';var client=require('../client');exports[_0xb056('0x0')]=function(_0x556e84,_0xed6810){return client[_0xb056('0x1')](_0xb056('0x2'),{'body':_0xed6810,'options':{'where':{'id':_0x556e84}},'log':_0xb056('0x3')});};exports[_0xb056('0x4')]=function(_0x4157e0,_0x343d88){return client[_0xb056('0x1')](_0xb056('0x5'),{'body':_0x343d88,'options':{'where':{'id':_0x4157e0}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x1eba=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x5caf7e,_0x52e1bc){_0x5caf7e=_0x5caf7e-0x0;var _0x5c3435=_0x1eba[_0x5caf7e];return _0x5c3435;};'use strict';var client=require(_0xa1eb('0x0'));exports[_0xa1eb('0x1')]=function(_0x406a58,_0x2158d5){return client[_0xa1eb('0x2')]('UpdateMailInteraction',{'body':_0x2158d5,'options':{'where':{'id':_0x406a58}},'log':'updateMailInteraction'});};exports[_0xa1eb('0x3')]=function(_0x34be5a,_0x16a13a){return client[_0xa1eb('0x2')](_0xa1eb('0x4'),{'body':_0x16a13a,'options':{'where':{'id':_0x34be5a}},'log':_0xa1eb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index b7bbc88..b014453 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 _0xfda0=['createMailMessage','../client','Request'];(function(_0x3ab3af,_0x1714db){var _0x4ad1fe=function(_0x22a213){while(--_0x22a213){_0x3ab3af['push'](_0x3ab3af['shift']());}};_0x4ad1fe(++_0x1714db);}(_0xfda0,0x139));var _0x0fda=function(_0x4b2823,_0x2cea4a){_0x4b2823=_0x4b2823-0x0;var _0x289692=_0xfda0[_0x4b2823];return _0x289692;};'use strict';var client=require(_0x0fda('0x0'));exports['create']=function(_0x5e2c07){return client[_0x0fda('0x1')]('CreateMailMessage',{'body':_0x5e2c07,'log':_0x0fda('0x2')});}; \ No newline at end of file +var _0xc4a2=['../client','create','Request','createMailMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4a2,0x140));var _0x2c4a=function(_0x49e5b6,_0x3cf6d6){_0x49e5b6=_0x49e5b6-0x0;var _0x3d361f=_0xc4a2[_0x49e5b6];return _0x3d361f;};'use strict';var client=require(_0x2c4a('0x0'));exports[_0x2c4a('0x1')]=function(_0x57276e){return client[_0x2c4a('0x2')]('CreateMailMessage',{'body':_0x57276e,'log':_0x2c4a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index e83f100..d4ae0e4 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 _0x17d1=['getMailQueues','Request','GetMailQueue','timeout','strategy','Agents','name','online'];(function(_0x2eb1c1,_0x18f2f7){var _0x53e486=function(_0x1c0d9c){while(--_0x1c0d9c){_0x2eb1c1['push'](_0x2eb1c1['shift']());}};_0x53e486(++_0x18f2f7);}(_0x17d1,0x190));var _0x117d=function(_0x31dda8,_0x2112ef){_0x31dda8=_0x31dda8-0x0;var _0x28952b=_0x17d1[_0x31dda8];return _0x28952b;};'use strict';var client=require('../client');exports[_0x117d('0x0')]=function(){return function(){return client[_0x117d('0x1')](_0x117d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x117d('0x3'),_0x117d('0x4')],'include':[{'model':'User','as':_0x117d('0x5'),'attributes':['id',_0x117d('0x6'),_0x117d('0x7'),'mailPause']}]},'log':_0x117d('0x0')});};}; \ No newline at end of file +var _0x6b95=['GetMailQueue','timeout','strategy','Agents','mailPause','../client','getMailQueues','Request'];(function(_0x18ccde,_0xedacd3){var _0x274b6c=function(_0x5d4a2d){while(--_0x5d4a2d){_0x18ccde['push'](_0x18ccde['shift']());}};_0x274b6c(++_0xedacd3);}(_0x6b95,0x105));var _0x56b9=function(_0x2d611c,_0x3b0b84){_0x2d611c=_0x2d611c-0x0;var _0x33e699=_0x6b95[_0x2d611c];return _0x33e699;};'use strict';var client=require(_0x56b9('0x0'));exports[_0x56b9('0x1')]=function(){return function(){return client[_0x56b9('0x2')](_0x56b9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x56b9('0x4'),_0x56b9('0x5')],'include':[{'model':'User','as':_0x56b9('0x6'),'attributes':['id','name','online',_0x56b9('0x7')]}]},'log':_0x56b9('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index be6290a..6f49e52 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 _0xf95f=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0x4f3da4,_0x121375){var _0x1df1a1=function(_0x329dfc){while(--_0x329dfc){_0x4f3da4['push'](_0x4f3da4['shift']());}};_0x1df1a1(++_0x121375);}(_0xf95f,0x89));var _0xff95=function(_0x2382b5,_0x447dcf){_0x2382b5=_0x2382b5-0x0;var _0x4d5019=_0xf95f[_0x2382b5];return _0x4d5019;};'use strict';var client=require(_0xff95('0x0'));exports[_0xff95('0x1')]=function(_0x50b835){return client[_0xff95('0x2')]('CreateMailQueueReport',{'body':_0x50b835,'log':_0xff95('0x3')});};exports[_0xff95('0x4')]=function(_0x2a4385,_0x56090d){return client['Request'](_0xff95('0x5'),{'body':_0x56090d,'options':{'where':{'uniqueid':_0x2a4385},'order':[['id','DESC']],'limit':0x1},'log':_0xff95('0x5')});}; \ No newline at end of file +var _0xb515=['update','UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xb515,0x105));var _0x5b51=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xb515[_0x29dda1];return _0x21b0ef;};'use strict';var client=require(_0x5b51('0x0'));exports['create']=function(_0x5bbd92){return client[_0x5b51('0x1')](_0x5b51('0x2'),{'body':_0x5bbd92,'log':_0x5b51('0x2')});};exports[_0x5b51('0x3')]=function(_0x41bc9b,_0x20cc85){return client[_0x5b51('0x1')](_0x5b51('0x4'),{'body':_0x20cc85,'options':{'where':{'uniqueid':_0x41bc9b},'order':[['id',_0x5b51('0x5')]],'limit':0x1},'log':_0x5b51('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 4a5b7f8..18d653b 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 _0xd28c=['addTags','AddTagsToOpenchannelInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x1a5ccb,_0x129fed){var _0x3b01f1=function(_0x5eb0a8){while(--_0x5eb0a8){_0x1a5ccb['push'](_0x1a5ccb['shift']());}};_0x3b01f1(++_0x129fed);}(_0xd28c,0x194));var _0xcd28=function(_0x1d4527,_0x1e640d){_0x1d4527=_0x1d4527-0x0;var _0x95db1=_0xd28c[_0x1d4527];return _0x95db1;};'use strict';var client=require(_0xcd28('0x0'));exports['update']=function(_0x26b787,_0x599dba){return client[_0xcd28('0x1')](_0xcd28('0x2'),{'body':_0x599dba,'options':{'where':{'id':_0x26b787}},'log':_0xcd28('0x3')});};exports[_0xcd28('0x4')]=function(_0x4ff8a8,_0x2c17b8){return client[_0xcd28('0x1')](_0xcd28('0x5'),{'body':_0x2c17b8,'options':{'where':{'id':_0x4ff8a8}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x8d77=['UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x1c507f,_0x29b868){var _0x31d55f=function(_0x42c289){while(--_0x42c289){_0x1c507f['push'](_0x1c507f['shift']());}};_0x31d55f(++_0x29b868);}(_0x8d77,0xee));var _0x78d7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8d77[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x78d7('0x0'));exports[_0x78d7('0x1')]=function(_0x54e6dd,_0x40cc52){return client['Request'](_0x78d7('0x2'),{'body':_0x40cc52,'options':{'where':{'id':_0x54e6dd}},'log':_0x78d7('0x3')});};exports['addTags']=function(_0x54bee7,_0x448363){return client['Request'](_0x78d7('0x4'),{'body':_0x448363,'options':{'where':{'id':_0x54bee7}},'log':_0x78d7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 910af72..bd12459 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 _0x484a=['CreateOpenchannelMessage','../client','create','Request'];(function(_0x209205,_0x4e4d8c){var _0x1a13b1=function(_0x4e5bdc){while(--_0x4e5bdc){_0x209205['push'](_0x209205['shift']());}};_0x1a13b1(++_0x4e4d8c);}(_0x484a,0x71));var _0xa484=function(_0x13fecc,_0x5dcb99){_0x13fecc=_0x13fecc-0x0;var _0x1d1a7d=_0x484a[_0x13fecc];return _0x1d1a7d;};'use strict';var client=require(_0xa484('0x0'));exports[_0xa484('0x1')]=function(_0xc853c6){return client[_0xa484('0x2')](_0xa484('0x3'),{'body':_0xc853c6,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x7452=['../client','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x1e9df3,_0x267a60){var _0x14efc2=function(_0x54a072){while(--_0x54a072){_0x1e9df3['push'](_0x1e9df3['shift']());}};_0x14efc2(++_0x267a60);}(_0x7452,0x88));var _0x2745=function(_0x38a228,_0x2b23cd){_0x38a228=_0x38a228-0x0;var _0x206eea=_0x7452[_0x38a228];return _0x206eea;};'use strict';var client=require(_0x2745('0x0'));exports['create']=function(_0x1ce6de){return client[_0x2745('0x1')](_0x2745('0x2'),{'body':_0x1ce6de,'log':_0x2745('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 031a783..5223fe4 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 _0x20ab=['timeout','strategy','User','Agents','name','online','openchannelPause','getOpenchannelQueues','../client'];(function(_0xb949a9,_0x2f948a){var _0x31932b=function(_0x1e7414){while(--_0x1e7414){_0xb949a9['push'](_0xb949a9['shift']());}};_0x31932b(++_0x2f948a);}(_0x20ab,0x13a));var _0xb20a=function(_0xbe0d54,_0x5c3362){_0xbe0d54=_0xbe0d54-0x0;var _0x13e619=_0x20ab[_0xbe0d54];return _0x13e619;};'use strict';var client=require(_0xb20a('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0xb20a('0x1'),_0xb20a('0x2')],'include':[{'model':_0xb20a('0x3'),'as':_0xb20a('0x4'),'attributes':['id',_0xb20a('0x5'),_0xb20a('0x6'),_0xb20a('0x7')]}]},'log':_0xb20a('0x8')});};}; \ No newline at end of file +var _0xb84e=['Request','GetOpenchannelQueue','name','User','Agents','online','openchannelPause','getOpenchannelQueues'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xb84e,0xbf));var _0xeb84=function(_0x270a54,_0x307ff6){_0x270a54=_0x270a54-0x0;var _0x4d07d0=_0xb84e[_0x270a54];return _0x4d07d0;};'use strict';var client=require('../client');exports[_0xeb84('0x0')]=function(){return function(){return client[_0xeb84('0x1')](_0xeb84('0x2'),{'options':{'raw':![],'attributes':['id',_0xeb84('0x3'),'timeout','strategy'],'include':[{'model':_0xeb84('0x4'),'as':_0xeb84('0x5'),'attributes':['id',_0xeb84('0x3'),_0xeb84('0x6'),_0xeb84('0x7')]}]},'log':_0xeb84('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 05ebeaa..7d8d07f 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 _0x6b36=['DESC','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x49560a,_0x2c25cb){var _0x4cbc23=function(_0x4e9967){while(--_0x4e9967){_0x49560a['push'](_0x49560a['shift']());}};_0x4cbc23(++_0x2c25cb);}(_0x6b36,0xbf));var _0x66b3=function(_0x27b444,_0x345fdb){_0x27b444=_0x27b444-0x0;var _0x4419c1=_0x6b36[_0x27b444];return _0x4419c1;};'use strict';var client=require('../client');exports['create']=function(_0x4b7a3c){return client['Request'](_0x66b3('0x0'),{'body':_0x4b7a3c,'log':_0x66b3('0x0')});};exports[_0x66b3('0x1')]=function(_0x5c1915,_0x319c71){return client[_0x66b3('0x2')](_0x66b3('0x3'),{'body':_0x319c71,'options':{'where':{'uniqueid':_0x5c1915},'order':[['id',_0x66b3('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x8caf=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x1bb889,_0x49c4b5){var _0xd8b76d=function(_0x1df471){while(--_0x1df471){_0x1bb889['push'](_0x1bb889['shift']());}};_0xd8b76d(++_0x49c4b5);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x3014a4,_0x56b5aa){_0x3014a4=_0x3014a4-0x0;var _0x4ff3da=_0x8caf[_0x3014a4];return _0x4ff3da;};'use strict';var client=require('../client');exports[_0xf8ca('0x0')]=function(_0x215811){return client[_0xf8ca('0x1')](_0xf8ca('0x2'),{'body':_0x215811,'log':_0xf8ca('0x2')});};exports[_0xf8ca('0x3')]=function(_0x4e6684,_0x129ca9){return client[_0xf8ca('0x1')](_0xf8ca('0x4'),{'body':_0x129ca9,'options':{'where':{'uniqueid':_0x4e6684},'order':[['id',_0xf8ca('0x5')]],'limit':0x1},'log':_0xf8ca('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 945da99..7f97ad5 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 _0xeddd=['../client','update','UpdateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x45b013,_0x5d6935){var _0xcc303=function(_0x3b338b){while(--_0x3b338b){_0x45b013['push'](_0x45b013['shift']());}};_0xcc303(++_0x5d6935);}(_0xeddd,0x69));var _0xdedd=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xeddd[_0x36884e];return _0x1cc367;};'use strict';var client=require(_0xdedd('0x0'));exports[_0xdedd('0x1')]=function(_0x161609,_0x1dc143){return client['Request'](_0xdedd('0x2'),{'body':_0x1dc143,'options':{'where':{'id':_0x161609}},'log':'updateSmsInteraction'});};exports[_0xdedd('0x3')]=function(_0xd2ff49,_0x56e22a){return client[_0xdedd('0x4')](_0xdedd('0x5'),{'body':_0x56e22a,'options':{'where':{'id':_0xd2ff49}},'log':_0xdedd('0x6')});}; \ No newline at end of file +var _0x49c4=['addTagsToSmsInteraction','../client','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x2f1457,_0x324953){var _0x33db47=function(_0x55de13){while(--_0x55de13){_0x2f1457['push'](_0x2f1457['shift']());}};_0x33db47(++_0x324953);}(_0x49c4,0x9b));var _0x449c=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x49c4[_0x1d9aa0];return _0x226868;};'use strict';var client=require(_0x449c('0x0'));exports['update']=function(_0x47c5a9,_0x2ee18a){return client[_0x449c('0x1')](_0x449c('0x2'),{'body':_0x2ee18a,'options':{'where':{'id':_0x47c5a9}},'log':_0x449c('0x3')});};exports[_0x449c('0x4')]=function(_0x23314e,_0x5b564c){return client['Request'](_0x449c('0x5'),{'body':_0x5b564c,'options':{'where':{'id':_0x23314e}},'log':_0x449c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 02da162..c39fe7a 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 _0x8b95=['../client','CreateSmsMessage','createSmsMessage'];(function(_0x2aad57,_0x3a2bd0){var _0x5949dc=function(_0x4cc961){while(--_0x4cc961){_0x2aad57['push'](_0x2aad57['shift']());}};_0x5949dc(++_0x3a2bd0);}(_0x8b95,0xa5));var _0x58b9=function(_0x3af687,_0x54aab6){_0x3af687=_0x3af687-0x0;var _0x5ebc05=_0x8b95[_0x3af687];return _0x5ebc05;};'use strict';var client=require(_0x58b9('0x0'));exports['create']=function(_0x21610e){return client['Request'](_0x58b9('0x1'),{'body':_0x21610e,'log':_0x58b9('0x2')});}; \ No newline at end of file +var _0x15d5=['CreateSmsMessage','create'];(function(_0x685f2b,_0xebb461){var _0x4ec2fc=function(_0x45db78){while(--_0x45db78){_0x685f2b['push'](_0x685f2b['shift']());}};_0x4ec2fc(++_0xebb461);}(_0x15d5,0x175));var _0x515d=function(_0x5d2af5,_0xf0c67f){_0x5d2af5=_0x5d2af5-0x0;var _0x361ce2=_0x15d5[_0x5d2af5];return _0x361ce2;};'use strict';var client=require('../client');exports[_0x515d('0x0')]=function(_0x178b16){return client['Request'](_0x515d('0x1'),{'body':_0x178b16,'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 7d727e1..dfa78fb 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(_0x5e58d1,_0x4d0e36){var _0x452d4f=function(_0x104bcd){while(--_0x104bcd){_0x5e58d1['push'](_0x5e58d1['shift']());}};_0x452d4f(++_0x4d0e36);}(_0x70e0,0x17b));var _0x070e=function(_0x449397,_0x52c461){_0x449397=_0x449397-0x0;var _0x5bddf9=_0x70e0[_0x449397];return _0x5bddf9;};'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 _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x1cd3e7,_0x582f03){var _0x46e41c=function(_0x53559a){while(--_0x53559a){_0x1cd3e7['push'](_0x1cd3e7['shift']());}};_0x46e41c(++_0x582f03);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 8661201..d9a8662 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x3dafb4,_0x202138){var _0x36f7ee=function(_0x21fd64){while(--_0x21fd64){_0x3dafb4['push'](_0x3dafb4['shift']());}};_0x36f7ee(++_0x202138);}(_0x9c44,0x178));var _0x49c4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x9c44[_0x3ab51d];return _0x29a04e;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x3c1363,_0x5d5e56){var _0x392c58=function(_0x16db4a){while(--_0x16db4a){_0x3c1363['push'](_0x3c1363['shift']());}};_0x392c58(++_0x5d5e56);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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 2145bfb..8224a47 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(_0x40c6ef,_0x3148cb){var _0xb455cc=function(_0x46cb29){while(--_0x46cb29){_0x40c6ef['push'](_0x40c6ef['shift']());}};_0xb455cc(++_0x3148cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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(_0x3ba59f,_0x5824ce){var _0x38caae=function(_0x305994){while(--_0x305994){_0x3ba59f['push'](_0x3ba59f['shift']());}};_0x38caae(++_0x5824ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 af46b4e..03843f9 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 _0x6365=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x2e65e8,_0x366a9d){var _0x524b62=function(_0xc0e42e){while(--_0xc0e42e){_0x2e65e8['push'](_0x2e65e8['shift']());}};_0x524b62(++_0x366a9d);}(_0x6365,0x148));var _0x5636=function(_0x2f0c7f,_0x4e9ab9){_0x2f0c7f=_0x2f0c7f-0x0;var _0x13b613=_0x6365[_0x2f0c7f];return _0x13b613;};'use strict';var client=require(_0x5636('0x0'));exports[_0x5636('0x1')]=function(_0x3212a5,_0x1c3ebf){return client['Request'](_0x5636('0x2'),{'body':_0x1c3ebf,'options':{'where':{'id':_0x3212a5}},'log':_0x5636('0x3')});};exports[_0x5636('0x4')]=function(_0x27e6da,_0x34ca1e){return client['Request'](_0x5636('0x5'),{'body':_0x34ca1e,'options':{'where':{'id':_0x27e6da}},'log':_0x5636('0x6')});}; \ No newline at end of file +var _0xd9ef=['update','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x5400b4,_0xe3b8b6){var _0x545bc3=function(_0x327cf6){while(--_0x327cf6){_0x5400b4['push'](_0x5400b4['shift']());}};_0x545bc3(++_0xe3b8b6);}(_0xd9ef,0x95));var _0xfd9e=function(_0x106c8c,_0x46281c){_0x106c8c=_0x106c8c-0x0;var _0x12fdb0=_0xd9ef[_0x106c8c];return _0x12fdb0;};'use strict';var client=require(_0xfd9e('0x0'));exports[_0xfd9e('0x1')]=function(_0x4acfe1,_0x1e4dfc){return client['Request']('UpdateWhatsappInteraction',{'body':_0x1e4dfc,'options':{'where':{'id':_0x4acfe1}},'log':'updateWhatsappInteraction'});};exports[_0xfd9e('0x2')]=function(_0x28cfac,_0xe6990b){return client[_0xfd9e('0x3')](_0xfd9e('0x4'),{'body':_0xe6990b,'options':{'where':{'id':_0x28cfac}},'log':_0xfd9e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ecc6b34..5f4385a 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 _0x41a6=['CreateWhatsappMessage','createWhatsappMessage','Request'];(function(_0x2c0eea,_0x36f645){var _0x36a516=function(_0x29efda){while(--_0x29efda){_0x2c0eea['push'](_0x2c0eea['shift']());}};_0x36a516(++_0x36f645);}(_0x41a6,0x1a3));var _0x641a=function(_0x19cc94,_0x25d9d6){_0x19cc94=_0x19cc94-0x0;var _0x538bbe=_0x41a6[_0x19cc94];return _0x538bbe;};'use strict';var client=require('../client');exports['create']=function(_0x14c623){return client[_0x641a('0x0')](_0x641a('0x1'),{'body':_0x14c623,'log':_0x641a('0x2')});}; \ No newline at end of file +var _0x62ff=['Request','CreateWhatsappMessage','create'];(function(_0x556016,_0x5307a3){var _0x422cce=function(_0x272920){while(--_0x272920){_0x556016['push'](_0x556016['shift']());}};_0x422cce(++_0x5307a3);}(_0x62ff,0x8f));var _0xf62f=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x62ff[_0x4b73a2];return _0x383c66;};'use strict';var client=require('../client');exports[_0xf62f('0x0')]=function(_0x50ea85){return client[_0xf62f('0x1')](_0xf62f('0x2'),{'body':_0x50ea85,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 5a64099..8c24fa9 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 _0x4253=['Agents','online','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0x5762c6,_0x931c40){var _0x4c8210=function(_0x59945c){while(--_0x59945c){_0x5762c6['push'](_0x5762c6['shift']());}};_0x4c8210(++_0x931c40);}(_0x4253,0x70));var _0x3425=function(_0x5bba34,_0x3bae14){_0x5bba34=_0x5bba34-0x0;var _0xbfc48a=_0x4253[_0x5bba34];return _0xbfc48a;};'use strict';var client=require(_0x3425('0x0'));exports[_0x3425('0x1')]=function(){return function(){return client[_0x3425('0x2')](_0x3425('0x3'),{'options':{'raw':![],'attributes':['id',_0x3425('0x4'),_0x3425('0x5'),_0x3425('0x6')],'include':[{'model':_0x3425('0x7'),'as':_0x3425('0x8'),'attributes':['id',_0x3425('0x4'),_0x3425('0x9'),'whatsappPause']}]},'log':_0x3425('0x1')});};}; \ No newline at end of file +var _0xa12e=['getWhatsappQueues','GetWhatsappQueue','strategy','User','Agents','name','online','whatsappPause','../client'];(function(_0x2a974a,_0x3ebbd3){var _0x2ffff6=function(_0x4dae36){while(--_0x4dae36){_0x2a974a['push'](_0x2a974a['shift']());}};_0x2ffff6(++_0x3ebbd3);}(_0xa12e,0x8f));var _0xea12=function(_0x12f4d8,_0x1f6d82){_0x12f4d8=_0x12f4d8-0x0;var _0x265413=_0xa12e[_0x12f4d8];return _0x265413;};'use strict';var client=require(_0xea12('0x0'));exports[_0xea12('0x1')]=function(){return function(){return client['Request'](_0xea12('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xea12('0x3')],'include':[{'model':_0xea12('0x4'),'as':_0xea12('0x5'),'attributes':['id',_0xea12('0x6'),_0xea12('0x7'),_0xea12('0x8')]}]},'log':_0xea12('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 9080f3b..4ba1a65 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 _0x53d3=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x45876f,_0x3807c6){var _0x3c2d98=function(_0x50bd13){while(--_0x50bd13){_0x45876f['push'](_0x45876f['shift']());}};_0x3c2d98(++_0x3807c6);}(_0x53d3,0x17f));var _0x353d=function(_0x16e56e,_0x401c67){_0x16e56e=_0x16e56e-0x0;var _0x1cdf58=_0x53d3[_0x16e56e];return _0x1cdf58;};'use strict';var client=require(_0x353d('0x0'));exports[_0x353d('0x1')]=function(_0x40e994){return client[_0x353d('0x2')]('CreateWhatsappQueueReport',{'body':_0x40e994,'log':_0x353d('0x3')});};exports['update']=function(_0x441305,_0x15013c){return client[_0x353d('0x2')](_0x353d('0x4'),{'body':_0x15013c,'options':{'where':{'uniqueid':_0x441305},'order':[['id',_0x353d('0x5')]],'limit':0x1},'log':_0x353d('0x4')});}; \ No newline at end of file +var _0x6084=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x555337,_0x1559d1){var _0x49b217=function(_0x3cb634){while(--_0x3cb634){_0x555337['push'](_0x555337['shift']());}};_0x49b217(++_0x1559d1);}(_0x6084,0x189));var _0x4608=function(_0x4ade1b,_0x4237cf){_0x4ade1b=_0x4ade1b-0x0;var _0x3589b0=_0x6084[_0x4ade1b];return _0x3589b0;};'use strict';var client=require(_0x4608('0x0'));exports[_0x4608('0x1')]=function(_0x848db2){return client[_0x4608('0x2')](_0x4608('0x3'),{'body':_0x848db2,'log':_0x4608('0x3')});};exports[_0x4608('0x4')]=function(_0xcee50,_0x2848c2){return client[_0x4608('0x2')](_0x4608('0x5'),{'body':_0x2848c2,'options':{'where':{'uniqueid':_0xcee50},'order':[['id',_0x4608('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 bb6035a..25368a7 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 _0xd635=['length','error','[%s][AGENT]\x20%s','message','join','stop','find','agents','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','validate','lodash','seq-queue','../../../../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'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0xd635,0xe6));var _0x5d63=function(_0x195fbb,_0x3e7933){_0x195fbb=_0x195fbb-0x0;var _0x6c5304=_0xd635[_0x195fbb];return _0x6c5304;};'use strict';var schema=require(_0x5d63('0x0'));var _=require(_0x5d63('0x1'));var util=require('util');var seqqueue=require(_0x5d63('0x2'));var logger=require(_0x5d63('0x3'))(_0x5d63('0x4'));var strategy=require(_0x5d63('0x5'));var queue=schema({'name':{'type':_0x5d63('0x6'),'required':!![],'message':_0x5d63('0x7')},'timeout':{'type':_0x5d63('0x8'),'message':_0x5d63('0x9')}});function writeLog(_0x389605,_0x5357c6,_0x66f0){return logger[_0x5d63('0xa')](util[_0x5d63('0xb')](_0x5d63('0xc'),_0x389605,_0x5357c6[_0x5d63('0xd')],_0x66f0));}function handleFindAgent(_0x5c24e8){return function(_0x1b49ae){return _0x1b49ae[_0x5d63('0xd')][_0x5d63('0xe')]()===_0x5c24e8[_0x5d63('0xe')]();};}exports['consequence']=function(_0x4531fb,_0x180ae6,_0x12ca9c,_0x5509dd){return function(_0x2012c6){try{var _0x2cbc26={'name':_0x180ae6[0x0],'timeout':_0x180ae6[0x1]};var _0x462913=queue['validate'](_0x2cbc26,{'typecast':!![]});if(_0x462913[_0x5d63('0xf')]){logger[_0x5d63('0x10')](_0x5d63('0x11'),_0x4531fb,_['map'](_0x462913,_0x5d63('0x12'))[_0x5d63('0x13')](',\x20'));_0x2012c6[_0x5d63('0x14')]();}else{var _0x310698=_[_0x5d63('0x15')](_0x12ca9c[_0x5d63('0x16')],handleFindAgent(_0x2cbc26['name']));if(_0x310698){var _0x574f56=(_0x2cbc26['timeout']||0xa)*0x3e8;var _0x5c5b5d,_0x3a3201;var _0x9305f=seqqueue[_0x5d63('0x17')](_0x574f56);_0x9305f['id']=_0x4531fb;_0x9305f[_0x5d63('0x18')]=_0x574f56;_0x9305f[_0x5d63('0x19')]=_0x5509dd[_0x5d63('0x19')];writeLog(_0x4531fb,_0x310698,util[_0x5d63('0xb')](_0x5d63('0x1a'),_0x574f56));_0x12ca9c['rules'][_0x4531fb]['on'](_0x5d63('0x1b'),function(){logger[_0x5d63('0xa')](_0x5d63('0x1c'),_0x4531fb);clearTimeout(_0x3a3201);_0x3a3201=undefined;_0x9305f[_0x5d63('0x1d')]();if(_0x12ca9c[_0x5d63('0x1e')][_0x4531fb]){delete _0x12ca9c[_0x5d63('0x1e')][_0x4531fb];}_0x2012c6['stop']();});_0x12ca9c['rules'][_0x4531fb]['on']('complete',function(){if(_0x12ca9c[_0x5d63('0x1e')][_0x4531fb]){delete _0x12ca9c[_0x5d63('0x1e')][_0x4531fb];}});_0x3a3201=setTimeout(function(){logger[_0x5d63('0xa')](_0x5d63('0x1f'),_0x4531fb);clearTimeout(_0x3a3201);_0x9305f[_0x5d63('0x1d')]();_0x2012c6[_0x5d63('0x20')]();},_0x574f56);strategy[_0x5d63('0x21')](_0x9305f,_0x310698,_0x12ca9c,_0x5509dd);}else{logger[_0x5d63('0x10')](_0x5d63('0x22'),_0x4531fb,_0x2cbc26[_0x5d63('0xd')]);_0x2012c6['stop']();}}}catch(_0x550333){console['log'](_0x550333);logger[_0x5d63('0x10')]('[%s][QUEUE]\x20%s',_0x4531fb,_0x550333['stack']);_0x2012c6[_0x5d63('0x14')]();}};}; \ No newline at end of file +var _0xfd5c=['log','validate','lodash','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','consequence','length','error','message','join','stop','find','agents','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','close','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0x5e6eea,_0x205f86){var _0x4e5f10=function(_0x21afc9){while(--_0x21afc9){_0x5e6eea['push'](_0x5e6eea['shift']());}};_0x4e5f10(++_0x205f86);}(_0xfd5c,0x1f0));var _0xcfd5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd5c[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xcfd5('0x0'));var _=require(_0xcfd5('0x1'));var util=require('util');var seqqueue=require(_0xcfd5('0x2'));var logger=require(_0xcfd5('0x3'))(_0xcfd5('0x4'));var strategy=require(_0xcfd5('0x5'));var queue=schema({'name':{'type':_0xcfd5('0x6'),'required':!![],'message':_0xcfd5('0x7')},'timeout':{'type':_0xcfd5('0x8'),'message':_0xcfd5('0x9')}});function writeLog(_0x578400,_0x5b3ddc,_0x3c7e8d){return logger[_0xcfd5('0xa')](util[_0xcfd5('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x578400,_0x5b3ddc[_0xcfd5('0xc')],_0x3c7e8d));}function handleFindAgent(_0x221121){return function(_0x1f39f6){return _0x1f39f6[_0xcfd5('0xc')][_0xcfd5('0xd')]()===_0x221121[_0xcfd5('0xd')]();};}exports[_0xcfd5('0xe')]=function(_0x419f28,_0x45d6c2,_0x1825b7,_0x563cbe){return function(_0x1d4a4b){try{var _0x45c4f3={'name':_0x45d6c2[0x0],'timeout':_0x45d6c2[0x1]};var _0x2aa117=queue['validate'](_0x45c4f3,{'typecast':!![]});if(_0x2aa117[_0xcfd5('0xf')]){logger[_0xcfd5('0x10')]('[%s][AGENT]\x20%s',_0x419f28,_['map'](_0x2aa117,_0xcfd5('0x11'))[_0xcfd5('0x12')](',\x20'));_0x1d4a4b[_0xcfd5('0x13')]();}else{var _0x1a5530=_[_0xcfd5('0x14')](_0x1825b7[_0xcfd5('0x15')],handleFindAgent(_0x45c4f3[_0xcfd5('0xc')]));if(_0x1a5530){var _0x541e52=(_0x45c4f3[_0xcfd5('0x16')]||0xa)*0x3e8;var _0x540a1b,_0x519763;var _0x54ad93=seqqueue['createQueue'](_0x541e52);_0x54ad93['id']=_0x419f28;_0x54ad93[_0xcfd5('0x17')]=_0x541e52;_0x54ad93['channel']=_0x563cbe[_0xcfd5('0x18')];writeLog(_0x419f28,_0x1a5530,util[_0xcfd5('0xb')](_0xcfd5('0x19'),_0x541e52));_0x1825b7[_0xcfd5('0x1a')][_0x419f28]['on'](_0xcfd5('0x1b'),function(){logger[_0xcfd5('0xa')](_0xcfd5('0x1c'),_0x419f28);clearTimeout(_0x519763);_0x519763=undefined;_0x54ad93['close']();if(_0x1825b7[_0xcfd5('0x1a')][_0x419f28]){delete _0x1825b7[_0xcfd5('0x1a')][_0x419f28];}_0x1d4a4b['stop']();});_0x1825b7[_0xcfd5('0x1a')][_0x419f28]['on'](_0xcfd5('0x1d'),function(){if(_0x1825b7[_0xcfd5('0x1a')][_0x419f28]){delete _0x1825b7[_0xcfd5('0x1a')][_0x419f28];}});_0x519763=setTimeout(function(){logger[_0xcfd5('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x419f28);clearTimeout(_0x519763);_0x54ad93[_0xcfd5('0x1e')]();_0x1d4a4b['next']();},_0x541e52);strategy['agent'](_0x54ad93,_0x1a5530,_0x1825b7,_0x563cbe);}else{logger[_0xcfd5('0x10')](_0xcfd5('0x1f'),_0x419f28,_0x45c4f3[_0xcfd5('0xc')]);_0x1d4a4b[_0xcfd5('0x13')]();}}}catch(_0x4daeb9){console[_0xcfd5('0x20')](_0x4daeb9);logger[_0xcfd5('0x10')]('[%s][QUEUE]\x20%s',_0x419f28,_0x4daeb9['stack']);_0x1d4a4b[_0xcfd5('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 1a91019..730586c 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 _0xde34=['YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','body','Message','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','message','toString','postText','amazonlex','providerName','providerResponse','create','dialogState','Failed','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format'];(function(_0x4e5000,_0x48deeb){var _0x28896b=function(_0x215dd9){while(--_0x215dd9){_0x4e5000['push'](_0x4e5000['shift']());}};_0x28896b(++_0x48deeb);}(_0xde34,0x1e3));var _0x4de3=function(_0x83a06a,_0x4e01a7){_0x83a06a=_0x83a06a-0x0;var _0x7d98ce=_0xde34[_0x83a06a];return _0x7d98ce;};'use strict';var _=require('lodash');var moment=require(_0x4de3('0x0'));var AWS=require(_0x4de3('0x1'));var utils=require(_0x4de3('0x2'));var logger=require(_0x4de3('0x3'))(_0x4de3('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4de3('0x5')),'faxMessage':require(_0x4de3('0x6')),'whatsappMessage':require(_0x4de3('0x7'))};exports[_0x4de3('0x8')]=function(_0x2a6f6e,_0x567891){return function(_0x1c2e65){try{if(!_[_0x4de3('0x9')](this[_0x4de3('0xa')]['UserId'])){logger[_0x4de3('0xb')](_0x4de3('0xc'),_0x2a6f6e,_0x4de3('0xd'));return _0x1c2e65[_0x4de3('0xe')]();}var _0x31cccd={'ContactId':this[_0x4de3('0xf')]['id'],'sentAt':moment()[_0x4de3('0x10')](_0x4de3('0x11')),'direction':_0x4de3('0x12')};if(this[_0x4de3('0x13')]===_0x4de3('0x14')||this[_0x4de3('0x13')]===_0x4de3('0x15')){_0x31cccd['phone']=this[_0x4de3('0xa')][_0x4de3('0x16')];}var _0x682efe=this['channel'];if(_0x682efe===_0x4de3('0x17')){_0x31cccd[_0x4de3('0x18')]=this[_0x4de3('0x19')]['id'];}else{_0x31cccd[_[_0x4de3('0x1a')](_0x682efe)+_0x4de3('0x1b')]=this[_0x4de3('0x19')]['id'];}_0x31cccd[_[_0x4de3('0x1a')](_0x682efe)+_0x4de3('0x1c')]=this['interaction']['id'];if(this['interaction'][_0x4de3('0x1d')]){var _0x4c9ab4=_0x567891[0x4];if(!_['isEmpty'](_0x4c9ab4)){_0x31cccd[_0x4de3('0x1e')]=utils['getMustacheRender'](_0x4c9ab4,this);return rpc[_0x682efe+_0x4de3('0x1f')]['create'](_0x31cccd)[_0x4de3('0x20')](function(_0x54d690){logger['info'](_0x4de3('0xc'),_0x2a6f6e,_0x31cccd[_0x4de3('0x1e')]);})[_0x4de3('0x21')](function(_0x329930){logger[_0x4de3('0x22')](_0x4de3('0xc'),_0x2a6f6e,JSON[_0x4de3('0x23')](_0x329930));})[_0x4de3('0x24')](function(){logger[_0x4de3('0xb')](_0x4de3('0x25'),_0x2a6f6e);_0x1c2e65['stop']();});}else{logger[_0x4de3('0xb')](_0x4de3('0x26'),_0x2a6f6e);_0x1c2e65[_0x4de3('0x27')]();}}else{var _0x2d86a8=this;var _0x1b763f=new AWS[(_0x4de3('0x28'))]({'accessKeyId':_0x567891[0x0],'secretAccessKey':_0x567891[0x1],'region':_0x567891[0x2]});var _0x34b424={'botAlias':'$LATEST','botName':_0x567891[0x3],'inputText':this[_0x4de3('0x29')][_0x4de3('0x1e')],'userId':this[_0x4de3('0x13')]+':'+this[_0x4de3('0xa')]['id'][_0x4de3('0x2a')]()};_0x1b763f[_0x4de3('0x2b')](_0x34b424,function(_0x2a0249,_0xe3b47d){if(_0x2a0249){logger['error'](_0x4de3('0xc'),_0x2a6f6e,_0x2a0249['message']);_0x1c2e65[_0x4de3('0xe')]();}else if(_0xe3b47d&&_0xe3b47d['message']){_0x2d86a8['body'][_0x4de3('0x2c')]=_0xe3b47d;_0x31cccd[_0x4de3('0x1e')]=_0xe3b47d['message'];_0x31cccd[_0x4de3('0x2d')]=_0x4de3('0x2c');_0x31cccd[_0x4de3('0x2e')]=JSON[_0x4de3('0x23')](_0xe3b47d);return rpc[_0x682efe+_0x4de3('0x1f')][_0x4de3('0x2f')](_0x31cccd)['then'](function(_0x49bcc6){logger[_0x4de3('0xb')]('[%s][AMAZONLEX]\x20%s',_0x2a6f6e,_0x31cccd[_0x4de3('0x1e')]);if(_0xe3b47d[_0x4de3('0x30')]==_0x4de3('0x31')){_0x1c2e65['next']();}else{_0x1c2e65[_0x4de3('0x27')]();}})[_0x4de3('0x21')](function(_0x4c40bd){logger[_0x4de3('0x22')](_0x4de3('0xc'),_0x2a6f6e,JSON['stringify'](_0x4c40bd));_0x1c2e65[_0x4de3('0xe')]();});}else{_0x1c2e65[_0x4de3('0xe')]();}});}}catch(_0x4cf212){logger[_0x4de3('0x22')](_0x4de3('0xc'),_0x2a6f6e,JSON[_0x4de3('0x23')](_0x4cf212));_0x1c2e65[_0x4de3('0x27')]();}};}; \ No newline at end of file +var _0x9b8d=['created','isEmpty','body','getMustacheRender','create','then','catch','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerName','providerResponse','Message','dialogState','Failed','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','out','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account'];(function(_0x47bc5e,_0x6fc500){var _0x323a59=function(_0x32df89){while(--_0x32df89){_0x47bc5e['push'](_0x47bc5e['shift']());}};_0x323a59(++_0x6fc500);}(_0x9b8d,0xfd));var _0xd9b8=function(_0x422ac3,_0x48bbd4){_0x422ac3=_0x422ac3-0x0;var _0x53c0d4=_0x9b8d[_0x422ac3];return _0x53c0d4;};'use strict';var _=require(_0xd9b8('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0xd9b8('0x1'));var logger=require('../../../../config/logger')(_0xd9b8('0x2'));var rpc={'chatMessage':require(_0xd9b8('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd9b8('0x4')),'faxMessage':require(_0xd9b8('0x5')),'whatsappMessage':require(_0xd9b8('0x6'))};exports[_0xd9b8('0x7')]=function(_0x57788a,_0x1e4158){return function(_0xbe8564){try{if(!_['isNil'](this[_0xd9b8('0x8')][_0xd9b8('0x9')])){logger[_0xd9b8('0xa')](_0xd9b8('0xb'),_0x57788a,_0xd9b8('0xc'));return _0xbe8564[_0xd9b8('0xd')]();}var _0x28380f={'ContactId':this['contact']['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd9b8('0xe')};if(this['channel']==='sms'||this[_0xd9b8('0xf')]===_0xd9b8('0x10')){_0x28380f[_0xd9b8('0x11')]=this[_0xd9b8('0x8')][_0xd9b8('0x11')];}var _0x1f7a1e=this[_0xd9b8('0xf')];if(_0x1f7a1e===_0xd9b8('0x12')){_0x28380f[_0xd9b8('0x13')]=this['account']['id'];}else{_0x28380f[_[_0xd9b8('0x14')](_0x1f7a1e)+_0xd9b8('0x15')]=this[_0xd9b8('0x16')]['id'];}_0x28380f[_[_0xd9b8('0x14')](_0x1f7a1e)+'InteractionId']=this[_0xd9b8('0x8')]['id'];if(this[_0xd9b8('0x8')][_0xd9b8('0x17')]){var _0x5389c1=_0x1e4158[0x4];if(!_[_0xd9b8('0x18')](_0x5389c1)){_0x28380f[_0xd9b8('0x19')]=utils[_0xd9b8('0x1a')](_0x5389c1,this);return rpc[_0x1f7a1e+'Message'][_0xd9b8('0x1b')](_0x28380f)[_0xd9b8('0x1c')](function(_0x1d7fd2){logger[_0xd9b8('0xa')](_0xd9b8('0xb'),_0x57788a,_0x28380f[_0xd9b8('0x19')]);})[_0xd9b8('0x1d')](function(_0x319803){logger['error'](_0xd9b8('0xb'),_0x57788a,JSON['stringify'](_0x319803));})[_0xd9b8('0x1e')](function(){logger[_0xd9b8('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x57788a);_0xbe8564[_0xd9b8('0x1f')]();});}else{logger[_0xd9b8('0xa')](_0xd9b8('0x20'),_0x57788a);_0xbe8564['stop']();}}else{var _0x3eff6f=this;var _0x142e89=new AWS[(_0xd9b8('0x21'))]({'accessKeyId':_0x1e4158[0x0],'secretAccessKey':_0x1e4158[0x1],'region':_0x1e4158[0x2]});var _0x47dafe={'botAlias':_0xd9b8('0x22'),'botName':_0x1e4158[0x3],'inputText':this[_0xd9b8('0x23')]['body'],'userId':this[_0xd9b8('0xf')]+':'+this[_0xd9b8('0x8')]['id'][_0xd9b8('0x24')]()};_0x142e89[_0xd9b8('0x25')](_0x47dafe,function(_0x4e6a47,_0xd41acd){if(_0x4e6a47){logger[_0xd9b8('0x26')](_0xd9b8('0xb'),_0x57788a,_0x4e6a47[_0xd9b8('0x23')]);_0xbe8564[_0xd9b8('0xd')]();}else if(_0xd41acd&&_0xd41acd[_0xd9b8('0x23')]){_0x3eff6f[_0xd9b8('0x19')][_0xd9b8('0x27')]=_0xd41acd;_0x28380f[_0xd9b8('0x19')]=_0xd41acd[_0xd9b8('0x23')];_0x28380f[_0xd9b8('0x28')]=_0xd9b8('0x27');_0x28380f[_0xd9b8('0x29')]=JSON['stringify'](_0xd41acd);return rpc[_0x1f7a1e+_0xd9b8('0x2a')][_0xd9b8('0x1b')](_0x28380f)['then'](function(_0x3619b6){logger[_0xd9b8('0xa')](_0xd9b8('0xb'),_0x57788a,_0x28380f[_0xd9b8('0x19')]);if(_0xd41acd[_0xd9b8('0x2b')]==_0xd9b8('0x2c')){_0xbe8564[_0xd9b8('0xd')]();}else{_0xbe8564[_0xd9b8('0x1f')]();}})[_0xd9b8('0x1d')](function(_0x4f958f){logger[_0xd9b8('0x26')](_0xd9b8('0xb'),_0x57788a,JSON[_0xd9b8('0x2d')](_0x4f958f));_0xbe8564[_0xd9b8('0xd')]();});}else{_0xbe8564[_0xd9b8('0xd')]();}});}}catch(_0x1eb0a6){logger[_0xd9b8('0x26')](_0xd9b8('0xb'),_0x57788a,JSON[_0xd9b8('0x2d')](_0x1eb0a6));_0xbe8564[_0xd9b8('0x1f')]();}};}; \ 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 9b22c18..f1c9d1b 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 _0x8aa9=['','headers','auto-replied','auto_reply','sendMailMessage','then','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','out','mail','getMustacheRender','body','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','upperFirst','AccountId','account','InteractionId','Message','Smtp','service','host','port','secure','user','pass','inReplyTo','messageId','','replace',''+_[_0xd415('0x35')](_0xb09c2f[_0xd415('0x10')],_0xd415('0x36'),_0xd415('0x37'))+'';_0xb09c2f[_0xd415('0x38')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0xd415('0x39'),'Precedence':_0xd415('0x3a')};return mailRpc['sendMailMessage'](_0x5243a8,_0xb09c2f)[_0xd415('0x3b')](function(_0x1e161e){logger[_0xd415('0x11')](_0xd415('0x3c'),_0x3edd98);_0xb09c2f[_0xd415('0x33')]=_0x1e161e[_0xd415('0x21')][_0xd415('0x33')];return rpc[_0x4bfee0+_0xd415('0x3d')][_0xd415('0x3e')](_0xb09c2f);})['then'](function(_0x5e6bac){logger[_0xd415('0x11')]('[%s][AUTOREPLY]\x20%s',_0x3edd98,JSON[_0xd415('0x3f')](_0x5e6bac));})['catch'](function(_0x162c3f){logger[_0xd415('0x40')]('[RPC][%s][AUTOREPLY]\x20%s',_0x3edd98,JSON[_0xd415('0x3f')](_0x162c3f));})[_0xd415('0x41')](function(){Promise[_0xd415('0x42')]()[_0xd415('0x3b')](function(){if(_0x5a96af[0x0]!=='2'||_0x29bc02['autoreplyExecuted'])return;return rpc[_0x4bfee0+_0xd415('0x43')][_0xd415('0x44')](_0x29bc02['id'],{'autoreplyExecuted':!![]})[_0xd415('0x3b')](function(_0x3940e5){logger[_0xd415('0x11')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3edd98,JSON[_0xd415('0x3f')](_0x3940e5));})['catch'](function(_0x3be34c){logger[_0xd415('0x40')](_0xd415('0x45'),_0x3edd98,JSON['stringify'](_0x3be34c));});})['then'](function(){_0x8cdb63['next']();});});}else{return rpc[this[_0xd415('0x1e')]+'Message'][_0xd415('0x3e')](_0xb09c2f)[_0xd415('0x3b')](function(_0x13f032){logger['info']('[%s][AUTOREPLY]\x20%s',_0x3edd98,_0xb09c2f[_0xd415('0x10')]);})[_0xd415('0x46')](function(_0x59fe2a){logger['error'](_0xd415('0x12'),_0x3edd98,JSON[_0xd415('0x3f')](_0x59fe2a));})['finally'](function(){Promise['resolve']()[_0xd415('0x3b')](function(){if(_0x5a96af[0x0]!=='2'||_0x29bc02[_0xd415('0x18')])return;return rpc[_0x4bfee0+'Interaction'][_0xd415('0x44')](_0x29bc02['id'],{'autoreplyExecuted':!![]})[_0xd415('0x3b')](function(_0x57416e){logger[_0xd415('0x11')](_0xd415('0x19'),_0x3edd98,JSON[_0xd415('0x3f')](_0x57416e));})[_0xd415('0x46')](function(_0x13d8c7){logger[_0xd415('0x40')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3edd98,JSON[_0xd415('0x3f')](_0x13d8c7));});})[_0xd415('0x3b')](function(){_0x8cdb63[_0xd415('0x17')]();});});}}}catch(_0x3627e0){logger[_0xd415('0x40')](_0xd415('0x12'),_0x3edd98,JSON[_0xd415('0x3f')](_0x3627e0));_0x8cdb63[_0xd415('0x47')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 8b88fbb..c1a7528 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd840=['system','Interaction','channel','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0xd840,0x18c));var _0x0d84=function(_0x326c95,_0x4ec888){_0x326c95=_0x326c95-0x0;var _0x5e8b24=_0xd840[_0x326c95];return _0x5e8b24;};'use strict';var moment=require(_0x0d84('0x0'));var logger=require(_0x0d84('0x1'))(_0x0d84('0x2'));var rpc={'chatInteraction':require(_0x0d84('0x3')),'openchannelInteraction':require(_0x0d84('0x4')),'smsInteraction':require(_0x0d84('0x5')),'mailInteraction':require(_0x0d84('0x6')),'faxInteraction':require(_0x0d84('0x7')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x3d465e,_0x2a7202,_0x49480b,_0x4aa05c){return function(_0x5cc828){try{logger[_0x0d84('0x8')](_0x0d84('0x9'),_0x3d465e,_0x2a7202[0x0]);var _0x178073={'closed':0x1,'closedAt':moment()[_0x0d84('0xa')](_0x0d84('0xb')),'closeReason':_0x0d84('0xc'),'disposition':_0x2a7202[0x0]};if(rpc[_0x4aa05c['channel']+_0x0d84('0xd')]){rpc[_0x4aa05c[_0x0d84('0xe')]+_0x0d84('0xd')][_0x0d84('0xf')](_0x4aa05c['interaction']['id'],_0x178073)[_0x0d84('0x10')](function(_0x369e58){logger[_0x0d84('0x8')](_0x0d84('0x11'),_0x3d465e,_0x4aa05c[_0x0d84('0x12')]['id']);})[_0x0d84('0x13')](function(_0x4a5ead){logger[_0x0d84('0x14')](_0x0d84('0x15'),_0x3d465e,JSON[_0x0d84('0x16')](_0x4a5ead));})['finally'](function(){_0x5cc828[_0x0d84('0x17')]();});}}catch(_0x170f86){logger[_0x0d84('0x14')]('[%s][CLOSE]\x20%s',_0x3d465e,JSON[_0x0d84('0x16')](_0x170f86));_0x5cc828['stop']();}};}; \ No newline at end of file +var _0x1a8b=['info','error','stringify','finally','[%s][CLOSE]\x20%s','stop','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','then'];(function(_0x4eafed,_0x26e2bc){var _0x159c85=function(_0x6f129f){while(--_0x6f129f){_0x4eafed['push'](_0x4eafed['shift']());}};_0x159c85(++_0x26e2bc);}(_0x1a8b,0x1be));var _0xb1a8=function(_0x26fb3b,_0x2003ef){_0x26fb3b=_0x26fb3b-0x0;var _0x373378=_0x1a8b[_0x26fb3b];return _0x373378;};'use strict';var moment=require(_0xb1a8('0x0'));var logger=require(_0xb1a8('0x1'))('routing');var rpc={'chatInteraction':require(_0xb1a8('0x2')),'openchannelInteraction':require(_0xb1a8('0x3')),'smsInteraction':require(_0xb1a8('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xb1a8('0x5')),'whatsappInteraction':require(_0xb1a8('0x6'))};exports[_0xb1a8('0x7')]=function(_0x1052f3,_0x50c6ad,_0x315c3f,_0x5c5a29){return function(_0x44f833){try{logger['info'](_0xb1a8('0x8'),_0x1052f3,_0x50c6ad[0x0]);var _0x47978a={'closed':0x1,'closedAt':moment()[_0xb1a8('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xb1a8('0xa'),'disposition':_0x50c6ad[0x0]};if(rpc[_0x5c5a29[_0xb1a8('0xb')]+'Interaction']){rpc[_0x5c5a29['channel']+_0xb1a8('0xc')][_0xb1a8('0xd')](_0x5c5a29[_0xb1a8('0xe')]['id'],_0x47978a)[_0xb1a8('0xf')](function(_0x34f7e4){logger[_0xb1a8('0x10')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x1052f3,_0x5c5a29[_0xb1a8('0xe')]['id']);})['catch'](function(_0x271417){logger[_0xb1a8('0x11')]('[%s][CLOSE]\x20%s',_0x1052f3,JSON[_0xb1a8('0x12')](_0x271417));})[_0xb1a8('0x13')](function(){_0x44f833['stop']();});}}catch(_0x19a614){logger[_0xb1a8('0x11')](_0xb1a8('0x14'),_0x1052f3,JSON[_0xb1a8('0x12')](_0x19a614));_0x44f833[_0xb1a8('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index a67a9bd..6c70fd8 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb76d=['Message','then','info','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','create','metadata','endConversation','error','lodash','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender'];(function(_0x543477,_0x177c52){var _0x4d5cc0=function(_0x1ec70f){while(--_0x1ec70f){_0x543477['push'](_0x543477['shift']());}};_0x4d5cc0(++_0x177c52);}(_0xb76d,0x119));var _0xdb76=function(_0xb622e4,_0x576618){_0xb622e4=_0xb622e4-0x0;var _0x457232=_0xb76d[_0xb622e4];return _0x457232;};'use strict';var _=require(_0xdb76('0x0'));var moment=require('moment');var apiai=require(_0xdb76('0x1'));var md5=require(_0xdb76('0x2'));var utils=require(_0xdb76('0x3'));var logger=require('../../../../config/logger')(_0xdb76('0x4'));var rpc={'chatMessage':require(_0xdb76('0x5')),'openchannelMessage':require(_0xdb76('0x6')),'mailMessage':require(_0xdb76('0x7')),'smsMessage':require(_0xdb76('0x8')),'faxMessage':require(_0xdb76('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xdb76('0xa')]=function(_0x39c442,_0x34ccdc){return function(_0x3d80a0){try{if(!_['isNil'](this[_0xdb76('0xb')][_0xdb76('0xc')])){logger['info'](_0xdb76('0xd'),_0x39c442,_0xdb76('0xe'));return _0x3d80a0[_0xdb76('0xf')]();}var _0x370f4a={'ContactId':this[_0xdb76('0x10')]['id'],'sentAt':moment()[_0xdb76('0x11')](_0xdb76('0x12')),'direction':'out'};if(this['channel']===_0xdb76('0x13')||this[_0xdb76('0x14')]===_0xdb76('0x15')){_0x370f4a['phone']=this['interaction'][_0xdb76('0x16')];}var _0x4d1c44=this[_0xdb76('0x14')];if(_0x4d1c44==='chat'){_0x370f4a['ChatWebsiteId']=this[_0xdb76('0x17')]['id'];}else{_0x370f4a[_[_0xdb76('0x18')](_0x4d1c44)+_0xdb76('0x19')]=this[_0xdb76('0x17')]['id'];}_0x370f4a[_['upperFirst'](_0x4d1c44)+_0xdb76('0x1a')]=this[_0xdb76('0xb')]['id'];if(this['interaction'][_0xdb76('0x1b')]){var _0x1a61cf=_0x34ccdc[0x2];if(!_[_0xdb76('0x1c')](_0x1a61cf)){_0x370f4a[_0xdb76('0x1d')]=utils[_0xdb76('0x1e')](_0x1a61cf,this);return rpc[_0x4d1c44+_0xdb76('0x1f')]['create'](_0x370f4a)[_0xdb76('0x20')](function(_0x11ae59){logger[_0xdb76('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x39c442,_0x370f4a[_0xdb76('0x1d')]);})[_0xdb76('0x22')](function(_0x1257c0){logger['error'](_0xdb76('0xd'),_0x39c442,JSON[_0xdb76('0x23')](_0x1257c0));})[_0xdb76('0x24')](function(){logger[_0xdb76('0x21')](_0xdb76('0x25'),_0x39c442);_0x3d80a0[_0xdb76('0x26')]();});}else{logger[_0xdb76('0x21')](_0xdb76('0x27'),_0x39c442);_0x3d80a0[_0xdb76('0x26')]();}}else{var _0x389668=this;var _0x3718e1=apiai(_0x34ccdc[0x0],{'language':_0x34ccdc[0x1]||'en'});return _0x3718e1[_0xdb76('0x28')](this[_0xdb76('0x29')]['body'],{'sessionId':md5(this[_0xdb76('0xb')]['id'])})['then'](function(_0x12f479){_0x389668[_0xdb76('0x1d')][_0xdb76('0x2a')]=_0x12f479;_0x370f4a[_0xdb76('0x1d')]=_0x12f479[_0xdb76('0x2b')][_0xdb76('0x2c')][_0xdb76('0x2d')];_0x370f4a[_0xdb76('0x2e')]=_0xdb76('0x2a');_0x370f4a[_0xdb76('0x2f')]=JSON[_0xdb76('0x23')](_0x12f479);return rpc[_0x4d1c44+'Message'][_0xdb76('0x30')](_0x370f4a)['then'](function(_0x295317){logger[_0xdb76('0x21')](_0xdb76('0xd'),_0x39c442,_0x370f4a['body']);if(_0x12f479['result'][_0xdb76('0x31')][_0xdb76('0x32')]){_0x3d80a0[_0xdb76('0xf')]();}else{_0x3d80a0['stop']();}})[_0xdb76('0x22')](function(_0x6600a1){logger[_0xdb76('0x33')](_0xdb76('0xd'),_0x39c442,JSON[_0xdb76('0x23')](_0x6600a1));_0x3d80a0[_0xdb76('0xf')]();});})[_0xdb76('0x22')](function(_0x12c9b9){logger[_0xdb76('0x33')](_0xdb76('0xd'),_0x39c442,_0x12c9b9['message']);_0x3d80a0[_0xdb76('0xf')]();});}}catch(_0x3a469b){logger[_0xdb76('0x33')](_0xdb76('0xd'),_0x39c442,JSON['stringify'](_0x3a469b));_0x3d80a0['stop']();}};}; \ No newline at end of file +var _0x9a6b=['channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','isEmpty','body','Message','create','then','catch','error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','result','fulfillment','speech','dialogflow','providerResponse','stringify','metadata','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','sms','whatsapp','phone'];(function(_0x70804b,_0x43b71d){var _0x30d188=function(_0x1dce41){while(--_0x1dce41){_0x70804b['push'](_0x70804b['shift']());}};_0x30d188(++_0x43b71d);}(_0x9a6b,0x77));var _0xb9a6=function(_0x3d76fb,_0x5ccf03){_0x3d76fb=_0x3d76fb-0x0;var _0x3abd75=_0x9a6b[_0x3d76fb];return _0x3abd75;};'use strict';var _=require(_0xb9a6('0x0'));var moment=require(_0xb9a6('0x1'));var apiai=require(_0xb9a6('0x2'));var md5=require(_0xb9a6('0x3'));var utils=require(_0xb9a6('0x4'));var logger=require(_0xb9a6('0x5'))('routing');var rpc={'chatMessage':require(_0xb9a6('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb9a6('0x7')),'smsMessage':require(_0xb9a6('0x8')),'faxMessage':require(_0xb9a6('0x9')),'whatsappMessage':require(_0xb9a6('0xa'))};exports[_0xb9a6('0xb')]=function(_0x555d54,_0x1b85cc){return function(_0x2afba5){try{if(!_[_0xb9a6('0xc')](this[_0xb9a6('0xd')]['UserId'])){logger[_0xb9a6('0xe')](_0xb9a6('0xf'),_0x555d54,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2afba5[_0xb9a6('0x10')]();}var _0x13f166={'ContactId':this[_0xb9a6('0x11')]['id'],'sentAt':moment()[_0xb9a6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0xb9a6('0x13')||this['channel']===_0xb9a6('0x14')){_0x13f166['phone']=this[_0xb9a6('0xd')][_0xb9a6('0x15')];}var _0x200bd6=this[_0xb9a6('0x16')];if(_0x200bd6===_0xb9a6('0x17')){_0x13f166[_0xb9a6('0x18')]=this[_0xb9a6('0x19')]['id'];}else{_0x13f166[_[_0xb9a6('0x1a')](_0x200bd6)+_0xb9a6('0x1b')]=this['account']['id'];}_0x13f166[_[_0xb9a6('0x1a')](_0x200bd6)+_0xb9a6('0x1c')]=this[_0xb9a6('0xd')]['id'];if(this[_0xb9a6('0xd')]['created']){var _0x10761b=_0x1b85cc[0x2];if(!_[_0xb9a6('0x1d')](_0x10761b)){_0x13f166[_0xb9a6('0x1e')]=utils['getMustacheRender'](_0x10761b,this);return rpc[_0x200bd6+_0xb9a6('0x1f')][_0xb9a6('0x20')](_0x13f166)[_0xb9a6('0x21')](function(_0x1843e2){logger[_0xb9a6('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x555d54,_0x13f166[_0xb9a6('0x1e')]);})[_0xb9a6('0x22')](function(_0x305234){logger[_0xb9a6('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x555d54,JSON['stringify'](_0x305234));})[_0xb9a6('0x24')](function(){logger[_0xb9a6('0xe')](_0xb9a6('0x25'),_0x555d54);_0x2afba5['stop']();});}else{logger[_0xb9a6('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x555d54);_0x2afba5[_0xb9a6('0x26')]();}}else{var _0x36c6c1=this;var _0x50d3d4=apiai(_0x1b85cc[0x0],{'language':_0x1b85cc[0x1]||'en'});return _0x50d3d4[_0xb9a6('0x27')](this['message']['body'],{'sessionId':md5(this[_0xb9a6('0xd')]['id'])})[_0xb9a6('0x21')](function(_0x73dee3){_0x36c6c1[_0xb9a6('0x1e')]['dialogflow']=_0x73dee3;_0x13f166[_0xb9a6('0x1e')]=_0x73dee3[_0xb9a6('0x28')][_0xb9a6('0x29')][_0xb9a6('0x2a')];_0x13f166['providerName']=_0xb9a6('0x2b');_0x13f166[_0xb9a6('0x2c')]=JSON[_0xb9a6('0x2d')](_0x73dee3);return rpc[_0x200bd6+_0xb9a6('0x1f')][_0xb9a6('0x20')](_0x13f166)[_0xb9a6('0x21')](function(_0xce91fb){logger['info'](_0xb9a6('0xf'),_0x555d54,_0x13f166[_0xb9a6('0x1e')]);if(_0x73dee3['result'][_0xb9a6('0x2e')]['endConversation']){_0x2afba5[_0xb9a6('0x10')]();}else{_0x2afba5['stop']();}})[_0xb9a6('0x22')](function(_0x288111){logger['error'](_0xb9a6('0xf'),_0x555d54,JSON[_0xb9a6('0x2d')](_0x288111));_0x2afba5[_0xb9a6('0x10')]();});})[_0xb9a6('0x22')](function(_0x33f33a){logger[_0xb9a6('0x23')](_0xb9a6('0xf'),_0x555d54,_0x33f33a['message']);_0x2afba5[_0xb9a6('0x10')]();});}}catch(_0xff1edb){logger[_0xb9a6('0x23')](_0xb9a6('0xf'),_0x555d54,JSON['stringify'](_0xff1edb));_0x2afba5[_0xb9a6('0x26')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index d159d0e..1177786 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a96=['InteractionId','isEmpty','getMustacheRender','error','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId'];(function(_0x12c8c6,_0x2d9d1a){var _0x503dc1=function(_0x143732){while(--_0x143732){_0x12c8c6['push'](_0x12c8c6['shift']());}};_0x503dc1(++_0x2d9d1a);}(_0x1a96,0x1a3));var _0x61a9=function(_0x1f87cc,_0x53c4ea){_0x1f87cc=_0x1f87cc-0x0;var _0x353c64=_0x1a96[_0x1f87cc];return _0x353c64;};'use strict';var _=require(_0x61a9('0x0'));var dialogflow=require(_0x61a9('0x1'));var md5=require(_0x61a9('0x2'));var moment=require(_0x61a9('0x3'));var Promise=require('bluebird');var logger=require(_0x61a9('0x4'))(_0x61a9('0x5'));var utils=require(_0x61a9('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x61a9('0x7')),'mailMessage':require(_0x61a9('0x8')),'smsMessage':require(_0x61a9('0x9')),'faxMessage':require(_0x61a9('0xa')),'whatsappMessage':require(_0x61a9('0xb'))};function createMessage(_0x531b19,_0x2b01b0,_0xaf822,_0x2c092a){return new Promise(function(_0x28932f,_0x1755a7){var _0x4dab74=_[_0x61a9('0xc')](_0xaf822);_0x4dab74[_0x61a9('0xd')]=_0x2c092a;return rpc[_0x2b01b0+_0x61a9('0xe')][_0x61a9('0xf')](_0x4dab74)[_0x61a9('0x10')](function(){logger[_0x61a9('0x11')](_0x61a9('0x12'),_0x531b19,_0x4dab74[_0x61a9('0xd')]);_0x28932f();})[_0x61a9('0x13')](function(_0x372151){logger['error'](_0x61a9('0x12'),_0x531b19,JSON['stringify'](_0x372151));_0x1755a7(_0x372151);});});}exports[_0x61a9('0x14')]=function(_0x6eafc3,_0x459abe){return function(_0x32a404){try{if(!_[_0x61a9('0x15')](this[_0x61a9('0x16')][_0x61a9('0x17')])){logger[_0x61a9('0x11')](_0x61a9('0x12'),_0x6eafc3,_0x61a9('0x18'));return _0x32a404[_0x61a9('0x19')]();}var _0x34f0a2={'ContactId':this['contact']['id'],'sentAt':moment()[_0x61a9('0x1a')](_0x61a9('0x1b')),'direction':_0x61a9('0x1c')};if(this['channel']===_0x61a9('0x1d')||this[_0x61a9('0x1e')]===_0x61a9('0x1f')){_0x34f0a2[_0x61a9('0x20')]=this[_0x61a9('0x16')][_0x61a9('0x20')];}var _0x59ebf7=this[_0x61a9('0x1e')];if(_0x59ebf7==='chat'){_0x34f0a2[_0x61a9('0x21')]=this[_0x61a9('0x22')]['id'];}else{_0x34f0a2[_[_0x61a9('0x23')](_0x59ebf7)+_0x61a9('0x24')]=this[_0x61a9('0x22')]['id'];}_0x34f0a2[_[_0x61a9('0x23')](_0x59ebf7)+_0x61a9('0x25')]=this[_0x61a9('0x16')]['id'];if(this['interaction']['created']){var _0x558dfd=_0x459abe[0x4];if(!_[_0x61a9('0x26')](_0x558dfd)){_0x34f0a2[_0x61a9('0xd')]=utils[_0x61a9('0x27')](_0x558dfd,this);return rpc[_0x59ebf7+_0x61a9('0xe')][_0x61a9('0xf')](_0x34f0a2)['then'](function(_0x2bd4d3){logger[_0x61a9('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x6eafc3,_0x34f0a2['body']);})[_0x61a9('0x13')](function(_0x15a531){logger[_0x61a9('0x28')](_0x61a9('0x12'),_0x6eafc3,JSON[_0x61a9('0x29')](_0x15a531));})[_0x61a9('0x2a')](function(){logger[_0x61a9('0x11')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x6eafc3);_0x32a404[_0x61a9('0x2b')]();});}else{logger['info'](_0x61a9('0x2c'),_0x6eafc3);_0x32a404[_0x61a9('0x2b')]();}}else{var _0x2e9fed=this;var _0x2ce177=_0x459abe[0x2][_0x61a9('0x2d')](/\\n/g,'\x0a');var _0x2dc748={'credentials':{'private_key':_0x2ce177,'client_email':_0x459abe[0x1]}};var _0x4e033e=new dialogflow['SessionsClient'](_0x2dc748);var _0x20fe92=_0x4e033e[_0x61a9('0x2e')](_0x459abe[0x0],md5(_0x2e9fed[_0x61a9('0x16')]['id']));var _0x52b771={'session':_0x20fe92,'queryInput':{'text':{'text':_0x2e9fed[_0x61a9('0x2f')][_0x61a9('0xd')],'languageCode':_0x459abe[0x3]||'en'}}};return _0x4e033e[_0x61a9('0x30')](_0x52b771)['then'](function(_0x2d7779){if(_0x2d7779&&_0x2d7779[_0x61a9('0x31')]){_0x2e9fed[_0x61a9('0xd')][_0x61a9('0x32')]=_0x2d7779;var _0x5042e7=_0x2d7779[0x0];var _0x26f5c9=_0x5042e7[_0x61a9('0x33')][_0x61a9('0x34')]&&_0x5042e7[_0x61a9('0x33')][_0x61a9('0x34')][_0x61a9('0x35')]?_0x5042e7['queryResult'][_0x61a9('0x34')][_0x61a9('0x35')][_0x61a9('0x36')][_0x61a9('0x37')]:![];_0x2e9fed[_0x61a9('0xd')][_0x61a9('0x38')]=_0x5042e7['queryResult']['action'];_0x2e9fed[_0x61a9('0xd')][_0x61a9('0x39')]=_0x5042e7[_0x61a9('0x33')][_0x61a9('0x3a')];_0x2e9fed[_0x61a9('0xd')][_0x61a9('0x3b')]=_0x5042e7['queryResult'][_0x61a9('0x34')]&&_0x5042e7[_0x61a9('0x33')][_0x61a9('0x34')][_0x61a9('0x35')]?_0x5042e7['queryResult'][_0x61a9('0x34')][_0x61a9('0x35')][_0x61a9('0x36')][_0x61a9('0x37')]:![];_0x2e9fed[_0x61a9('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x5042e7[_0x61a9('0x33')][_0x61a9('0x3c')][_0x61a9('0x3d')];_0x2e9fed['body'][_0x61a9('0x3e')]=_0x5042e7['queryResult'][_0x61a9('0x3c')][_0x61a9('0x3f')];_0x2e9fed['body'][_0x61a9('0x40')]=_0x5042e7['queryResult'][_0x61a9('0x3c')]['isFallback'];_0x2e9fed[_0x61a9('0xd')][_0x61a9('0x41')]=_0x5042e7[_0x61a9('0x33')][_0x61a9('0x42')];_0x2e9fed['body'][_0x61a9('0x43')]=_0x5042e7['queryResult'][_0x61a9('0x44')];_0x2e9fed[_0x61a9('0xd')][_0x61a9('0x45')]=_0x5042e7[_0x61a9('0x33')][_0x61a9('0x46')];_0x34f0a2[_0x61a9('0x47')]=_0x61a9('0x32');_0x34f0a2[_0x61a9('0x48')]=JSON['stringify'](_0x2d7779);var _0x42e5ab=[];for(var _0x4790cd=0x0;_0x4790cd<_0x2d7779[_0x61a9('0x31')];_0x4790cd++){var _0x207f91=_0x2d7779[_0x4790cd];if(_0x207f91&&_0x207f91[_0x61a9('0x33')]&&_0x207f91[_0x61a9('0x33')][_0x61a9('0x49')]){_0x42e5ab[_0x61a9('0x4a')](createMessage(_0x6eafc3,_0x59ebf7,_0x34f0a2,_0x207f91['queryResult']['fulfillmentText']));}}return Promise[_0x61a9('0x4b')](_0x42e5ab)[_0x61a9('0x10')](function(){if(_0x26f5c9){_0x32a404['next']();}else{_0x32a404[_0x61a9('0x2b')]();}})[_0x61a9('0x13')](function(_0x3f7e91){logger[_0x61a9('0x28')](_0x61a9('0x12'),_0x6eafc3,JSON[_0x61a9('0x29')](_0x3f7e91));_0x32a404['next']();});}})[_0x61a9('0x13')](function(_0x13d744){logger[_0x61a9('0x28')](_0x61a9('0x12'),_0x6eafc3,_0x13d744[_0x61a9('0x2f')]);_0x32a404['next']();});}}catch(_0xacc09a){logger[_0x61a9('0x28')](_0x61a9('0x12'),_0x6eafc3,JSON[_0x61a9('0x29')](_0xacc09a));_0x32a404['stop']();}};}; \ No newline at end of file +var _0x79e5=['AccountId','upperFirst','InteractionId','created','isEmpty','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','dialogflowV2','queryResult','diagnosticInfo','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','fields','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','providerName','providerResponse','length','fulfillmentText','push','next','lodash','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','sms','whatsapp','phone','channel','chat'];(function(_0x3915a7,_0x1ed645){var _0x400d34=function(_0x2175b9){while(--_0x2175b9){_0x3915a7['push'](_0x3915a7['shift']());}};_0x400d34(++_0x1ed645);}(_0x79e5,0x170));var _0x579e=function(_0x7e16b3,_0x1adc72){_0x7e16b3=_0x7e16b3-0x0;var _0x472ded=_0x79e5[_0x7e16b3];return _0x472ded;};'use strict';var _=require(_0x579e('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x579e('0x1'));var moment=require(_0x579e('0x2'));var Promise=require(_0x579e('0x3'));var logger=require(_0x579e('0x4'))('routing');var utils=require(_0x579e('0x5'));var rpc={'chatMessage':require(_0x579e('0x6')),'openchannelMessage':require(_0x579e('0x7')),'mailMessage':require(_0x579e('0x8')),'smsMessage':require(_0x579e('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x579e('0xa'))};function createMessage(_0x4c53d3,_0x3de3e7,_0x11ad2e,_0x16f3f1){return new Promise(function(_0x5995d2,_0x36a7f4){var _0x4220f9=_['clone'](_0x11ad2e);_0x4220f9[_0x579e('0xb')]=_0x16f3f1;return rpc[_0x3de3e7+'Message']['create'](_0x4220f9)[_0x579e('0xc')](function(){logger[_0x579e('0xd')](_0x579e('0xe'),_0x4c53d3,_0x4220f9[_0x579e('0xb')]);_0x5995d2();})[_0x579e('0xf')](function(_0x3a8107){logger[_0x579e('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x4c53d3,JSON[_0x579e('0x11')](_0x3a8107));_0x36a7f4(_0x3a8107);});});}exports[_0x579e('0x12')]=function(_0x201202,_0x1594b8){return function(_0x419098){try{if(!_[_0x579e('0x13')](this[_0x579e('0x14')]['UserId'])){logger[_0x579e('0xd')](_0x579e('0xe'),_0x201202,_0x579e('0x15'));return _0x419098['next']();}var _0x21e6c7={'ContactId':this['contact']['id'],'sentAt':moment()[_0x579e('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x579e('0x17')||this['channel']===_0x579e('0x18')){_0x21e6c7[_0x579e('0x19')]=this[_0x579e('0x14')][_0x579e('0x19')];}var _0x1f772d=this[_0x579e('0x1a')];if(_0x1f772d===_0x579e('0x1b')){_0x21e6c7['ChatWebsiteId']=this['account']['id'];}else{_0x21e6c7[_['upperFirst'](_0x1f772d)+_0x579e('0x1c')]=this['account']['id'];}_0x21e6c7[_[_0x579e('0x1d')](_0x1f772d)+_0x579e('0x1e')]=this['interaction']['id'];if(this['interaction'][_0x579e('0x1f')]){var _0x1814a0=_0x1594b8[0x4];if(!_[_0x579e('0x20')](_0x1814a0)){_0x21e6c7['body']=utils['getMustacheRender'](_0x1814a0,this);return rpc[_0x1f772d+'Message'][_0x579e('0x21')](_0x21e6c7)[_0x579e('0xc')](function(_0x188995){logger[_0x579e('0xd')](_0x579e('0xe'),_0x201202,_0x21e6c7[_0x579e('0xb')]);})[_0x579e('0xf')](function(_0x26c9ea){logger[_0x579e('0x10')](_0x579e('0xe'),_0x201202,JSON[_0x579e('0x11')](_0x26c9ea));})[_0x579e('0x22')](function(){logger[_0x579e('0xd')](_0x579e('0x23'),_0x201202);_0x419098[_0x579e('0x24')]();});}else{logger[_0x579e('0xd')](_0x579e('0x25'),_0x201202);_0x419098[_0x579e('0x24')]();}}else{var _0x1ffd95=this;var _0x46b129=_0x1594b8[0x2][_0x579e('0x26')](/\\n/g,'\x0a');var _0x12668b={'credentials':{'private_key':_0x46b129,'client_email':_0x1594b8[0x1]}};var _0x19846a=new dialogflow[(_0x579e('0x27'))](_0x12668b);var _0x59aa51=_0x19846a[_0x579e('0x28')](_0x1594b8[0x0],md5(_0x1ffd95[_0x579e('0x14')]['id']));var _0x167679={'session':_0x59aa51,'queryInput':{'text':{'text':_0x1ffd95[_0x579e('0x29')][_0x579e('0xb')],'languageCode':_0x1594b8[0x3]||'en'}}};return _0x19846a[_0x579e('0x2a')](_0x167679)[_0x579e('0xc')](function(_0x55808c){if(_0x55808c&&_0x55808c['length']){_0x1ffd95[_0x579e('0xb')][_0x579e('0x2b')]=_0x55808c;var _0x1112cc=_0x55808c[0x0];var _0xf55610=_0x1112cc[_0x579e('0x2c')][_0x579e('0x2d')]&&_0x1112cc[_0x579e('0x2c')]['diagnosticInfo']['fields']?_0x1112cc[_0x579e('0x2c')][_0x579e('0x2d')]['fields'][_0x579e('0x2e')][_0x579e('0x2f')]:![];_0x1ffd95[_0x579e('0xb')][_0x579e('0x30')]=_0x1112cc[_0x579e('0x2c')]['action'];_0x1ffd95[_0x579e('0xb')][_0x579e('0x31')]=_0x1112cc['queryResult'][_0x579e('0x32')];_0x1ffd95[_0x579e('0xb')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x1112cc[_0x579e('0x2c')][_0x579e('0x2d')]&&_0x1112cc[_0x579e('0x2c')][_0x579e('0x2d')][_0x579e('0x33')]?_0x1112cc[_0x579e('0x2c')][_0x579e('0x2d')]['fields'][_0x579e('0x2e')][_0x579e('0x2f')]:![];_0x1ffd95[_0x579e('0xb')][_0x579e('0x34')]=_0x1112cc['queryResult'][_0x579e('0x35')][_0x579e('0x36')];_0x1ffd95['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x1112cc[_0x579e('0x2c')][_0x579e('0x35')][_0x579e('0x37')];_0x1ffd95['body'][_0x579e('0x38')]=_0x1112cc['queryResult']['intent'][_0x579e('0x39')];_0x1ffd95[_0x579e('0xb')][_0x579e('0x3a')]=_0x1112cc[_0x579e('0x2c')]['languageCode'];_0x1ffd95['body']['DIALOGFLOWV2_QUERYTEXT']=_0x1112cc[_0x579e('0x2c')][_0x579e('0x3b')];_0x1ffd95['body']['DIALOGFLOWV2_SCORE']=_0x1112cc['queryResult']['intentDetectionConfidence'];_0x21e6c7[_0x579e('0x3c')]='dialogflowV2';_0x21e6c7[_0x579e('0x3d')]=JSON['stringify'](_0x55808c);var _0x2e68d2=[];for(var _0x40366a=0x0;_0x40366a<_0x55808c[_0x579e('0x3e')];_0x40366a++){var _0x6dc9d1=_0x55808c[_0x40366a];if(_0x6dc9d1&&_0x6dc9d1[_0x579e('0x2c')]&&_0x6dc9d1[_0x579e('0x2c')][_0x579e('0x3f')]){_0x2e68d2[_0x579e('0x40')](createMessage(_0x201202,_0x1f772d,_0x21e6c7,_0x6dc9d1[_0x579e('0x2c')][_0x579e('0x3f')]));}}return Promise['all'](_0x2e68d2)[_0x579e('0xc')](function(){if(_0xf55610){_0x419098[_0x579e('0x41')]();}else{_0x419098[_0x579e('0x24')]();}})['catch'](function(_0x388fab){logger[_0x579e('0x10')](_0x579e('0xe'),_0x201202,JSON[_0x579e('0x11')](_0x388fab));_0x419098[_0x579e('0x41')]();});}})[_0x579e('0xf')](function(_0x5297ea){logger[_0x579e('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x201202,_0x5297ea[_0x579e('0x29')]);_0x419098[_0x579e('0x41')]();});}}catch(_0x46d44e){logger[_0x579e('0x10')](_0x579e('0xe'),_0x201202,JSON[_0x579e('0x11')](_0x46d44e));_0x419098[_0x579e('0x24')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 11cf38c..be8b111 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24d8=['priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','consequence','fromString','getMustacheRender','validate','map','message','join','stop','condition'];(function(_0x580819,_0x3a7906){var _0x3d083a=function(_0x4a480f){while(--_0x4a480f){_0x580819['push'](_0x580819['shift']());}};_0x3d083a(++_0x3a7906);}(_0x24d8,0x12e));var _0x824d=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x24d8[_0x2261ce];return _0x524640;};'use strict';var schema=require('validate');var _=require(_0x824d('0x0'));var htmlToText=require(_0x824d('0x1'));var utils=require('./utils');var logger=require(_0x824d('0x2'))(_0x824d('0x3'));var gotoif=schema({'condition':{'type':_0x824d('0x4'),'required':!![],'message':_0x824d('0x5')},'priorityTrue':{'type':'number','message':_0x824d('0x6')},'priorityFalse':{'type':_0x824d('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0x824d('0x8')]=function(_0x29b2ad,_0x4ee8d3){return function(_0x309dbe){try{var _0x5b4172={'condition':htmlToText[_0x824d('0x9')](utils[_0x824d('0xa')](_0x4ee8d3[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4ee8d3[0x1],'priorityFalse':_0x4ee8d3[0x2]};var _0x5813e7=gotoif[_0x824d('0xb')](_0x5b4172,{'typecast':!![]});if(_0x5813e7['length']){logger['error']('[%s][GOTOIF]\x20%s',_0x29b2ad,_[_0x824d('0xc')](_0x5813e7,_0x824d('0xd'))[_0x824d('0xe')](',\x20'));_0x309dbe[_0x824d('0xf')]();}else{try{var _0x4a51e5=eval('('+_0x5b4172[_0x824d('0x10')]+')');var _0x194a44=_0x4a51e5?_0x5b4172[_0x824d('0x11')]:_0x5b4172[_0x824d('0x12')];logger[_0x824d('0x13')](_0x824d('0x14'),_0x29b2ad,_0x5b4172[_0x824d('0x10')],_0x4a51e5,_0x194a44||_0x824d('0x15'));if(_0x194a44){var _0x47ffd0=_[_0x824d('0x16')](_0x309dbe[_0x824d('0x17')](),{'p':_0x194a44});if(_0x47ffd0>=0x0){logger[_0x824d('0x13')](_0x824d('0x18'),_0x29b2ad,_0x194a44||_0x824d('0x15'),_0x47ffd0);_0x309dbe['next'](_0x47ffd0);}else{logger[_0x824d('0x13')](_0x824d('0x19'),_0x29b2ad,_0x194a44||_0x824d('0x15'));_0x309dbe[_0x824d('0xf')]();}}else{_0x309dbe[_0x824d('0x15')]();}}catch(_0xaed854){logger[_0x824d('0x1a')](_0x824d('0x1b'),_0x29b2ad,_0xaed854[_0x824d('0xd')]);_0x309dbe[_0x824d('0xf')]();}}}catch(_0x609840){logger['error'](_0x824d('0x1c'),_0x29b2ad,JSON['stringify'](_0x609840));_0x309dbe['stop']();}};}; \ No newline at end of file +var _0xb952=['[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','error','[%s][GOTOIF]\x20%s','map','message','priorityFalse'];(function(_0x23c651,_0x143982){var _0xbe7bdb=function(_0x1979e2){while(--_0x1979e2){_0x23c651['push'](_0x23c651['shift']());}};_0xbe7bdb(++_0x143982);}(_0xb952,0x1a0));var _0x2b95=function(_0x2d9240,_0x1a3c39){_0x2d9240=_0x2d9240-0x0;var _0xa978b9=_0xb952[_0x2d9240];return _0xa978b9;};'use strict';var schema=require(_0x2b95('0x0'));var _=require(_0x2b95('0x1'));var htmlToText=require(_0x2b95('0x2'));var utils=require('./utils');var logger=require(_0x2b95('0x3'))(_0x2b95('0x4'));var gotoif=schema({'condition':{'type':_0x2b95('0x5'),'required':!![],'message':_0x2b95('0x6')},'priorityTrue':{'type':_0x2b95('0x7'),'message':_0x2b95('0x8')},'priorityFalse':{'type':_0x2b95('0x7'),'message':_0x2b95('0x9')}});exports[_0x2b95('0xa')]=function(_0x4b71b5,_0x31d010){return function(_0x460b31){try{var _0x8ca281={'condition':htmlToText[_0x2b95('0xb')](utils[_0x2b95('0xc')](_0x31d010[0x0],this),{'wordwrap':![]})[_0x2b95('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x31d010[0x1],'priorityFalse':_0x31d010[0x2]};var _0x2d67fa=gotoif[_0x2b95('0x0')](_0x8ca281,{'typecast':!![]});if(_0x2d67fa['length']){logger[_0x2b95('0xe')](_0x2b95('0xf'),_0x4b71b5,_[_0x2b95('0x10')](_0x2d67fa,_0x2b95('0x11'))['join'](',\x20'));_0x460b31['stop']();}else{try{var _0x326673=eval('('+_0x8ca281['condition']+')');var _0x5bb080=_0x326673?_0x8ca281['priorityTrue']:_0x8ca281[_0x2b95('0x12')];logger['info'](_0x2b95('0x13'),_0x4b71b5,_0x8ca281[_0x2b95('0x14')],_0x326673,_0x5bb080||_0x2b95('0x15'));if(_0x5bb080){var _0x3034b5=_[_0x2b95('0x16')](_0x460b31[_0x2b95('0x17')](),{'p':_0x5bb080});if(_0x3034b5>=0x0){logger[_0x2b95('0x18')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4b71b5,_0x5bb080||_0x2b95('0x15'),_0x3034b5);_0x460b31[_0x2b95('0x15')](_0x3034b5);}else{logger[_0x2b95('0x18')](_0x2b95('0x19'),_0x4b71b5,_0x5bb080||_0x2b95('0x15'));_0x460b31[_0x2b95('0x1a')]();}}else{_0x460b31[_0x2b95('0x15')]();}}catch(_0x26f5d9){logger[_0x2b95('0xe')](_0x2b95('0x1b'),_0x4b71b5,_0x26f5d9[_0x2b95('0x11')]);_0x460b31[_0x2b95('0x1a')]();}}}catch(_0x49d54a){logger[_0x2b95('0xe')](_0x2b95('0xf'),_0x4b71b5,JSON[_0x2b95('0x1c')](_0x49d54a));_0x460b31['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 94a2aeb..4e57eb7 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 _0x3af5=['info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join'];(function(_0x59b2a1,_0x1f631f){var _0x4908d1=function(_0x14c9b8){while(--_0x14c9b8){_0x59b2a1['push'](_0x59b2a1['shift']());}};_0x4908d1(++_0x1f631f);}(_0x3af5,0x197));var _0x53af=function(_0x1e003b,_0x3e4ded){_0x1e003b=_0x1e003b-0x0;var _0x268789=_0x3af5[_0x1e003b];return _0x268789;};'use strict';var schema=require(_0x53af('0x0'));var _=require('lodash');var logger=require(_0x53af('0x1'))(_0x53af('0x2'));var gotop=schema({'priority':{'type':_0x53af('0x3'),'required':!![],'message':_0x53af('0x4')}});exports[_0x53af('0x5')]=function(_0x5da09f,_0x9c438f){return function(_0x589f6b){try{var _0x5321db={'priority':_0x9c438f[0x0]};var _0x192f3a=gotop['validate'](_0x5321db,{'typecast':!![]});if(_0x192f3a[_0x53af('0x6')]){logger['error'](_0x53af('0x7'),_0x5da09f,_[_0x53af('0x8')](_0x192f3a,_0x53af('0x9'))[_0x53af('0xa')](',\x20'));_0x589f6b['stop']();}else{logger[_0x53af('0xb')](_0x53af('0xc'),_0x5da09f,_0x5321db[_0x53af('0xd')]);if(_0x5321db['priority']){var _0x2d4953=_[_0x53af('0xe')](_0x589f6b['rules'](),{'p':_0x5321db[_0x53af('0xd')]});if(_0x2d4953>=0x0){logger[_0x53af('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x5da09f,_0x5321db[_0x53af('0xd')]||_0x53af('0xf'),_0x2d4953);_0x589f6b[_0x53af('0xf')](_0x2d4953);}else{logger[_0x53af('0xb')](_0x53af('0x10'),_0x5da09f,_0x5321db[_0x53af('0xd')]||_0x53af('0xf'));_0x589f6b[_0x53af('0x11')]();}}else{_0x589f6b[_0x53af('0xf')]();}}}catch(_0x3a6d1c){logger[_0x53af('0x12')]('[%s][GOTOP]\x20%s',_0x5da09f,JSON['stringify'](_0x3a6d1c));_0x589f6b[_0x53af('0x11')]();}};}; \ No newline at end of file +var _0x6ff2=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','error','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','stop','stringify','lodash','../../../../config/logger','routing','number'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x6ff2,0x1b6));var _0x26ff=function(_0x62e8e7,_0x2e48bd){_0x62e8e7=_0x62e8e7-0x0;var _0x4fd776=_0x6ff2[_0x62e8e7];return _0x4fd776;};'use strict';var schema=require('validate');var _=require(_0x26ff('0x0'));var logger=require(_0x26ff('0x1'))(_0x26ff('0x2'));var gotop=schema({'priority':{'type':_0x26ff('0x3'),'required':!![],'message':_0x26ff('0x4')}});exports['consequence']=function(_0x3d60be,_0x2029cd){return function(_0x12a07c){try{var _0x4941eb={'priority':_0x2029cd[0x0]};var _0x130dda=gotop[_0x26ff('0x5')](_0x4941eb,{'typecast':!![]});if(_0x130dda['length']){logger[_0x26ff('0x6')]('[%s][GOTOP]\x20%s',_0x3d60be,_[_0x26ff('0x7')](_0x130dda,_0x26ff('0x8'))[_0x26ff('0x9')](',\x20'));_0x12a07c['stop']();}else{logger[_0x26ff('0xa')](_0x26ff('0xb'),_0x3d60be,_0x4941eb[_0x26ff('0xc')]);if(_0x4941eb[_0x26ff('0xc')]){var _0x13594f=_['findIndex'](_0x12a07c[_0x26ff('0xd')](),{'p':_0x4941eb[_0x26ff('0xc')]});if(_0x13594f>=0x0){logger[_0x26ff('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3d60be,_0x4941eb[_0x26ff('0xc')]||_0x26ff('0xe'),_0x13594f);_0x12a07c[_0x26ff('0xe')](_0x13594f);}else{logger[_0x26ff('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3d60be,_0x4941eb[_0x26ff('0xc')]||'next');_0x12a07c[_0x26ff('0xf')]();}}else{_0x12a07c[_0x26ff('0xe')]();}}}catch(_0x4c98ec){logger['error']('[%s][GOTOP]\x20%s',_0x3d60be,JSON[_0x26ff('0x10')](_0x4c98ec));_0x12a07c['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 97b06c7..dc1e002 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 _0x8b35=['ChatWebsiteId','account','upperFirst','InteractionId','interaction','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','channel','chat'];(function(_0x36bbcc,_0x5c455d){var _0x777427=function(_0x36a80c){while(--_0x36a80c){_0x36bbcc['push'](_0x36bbcc['shift']());}};_0x777427(++_0x5c455d);}(_0x8b35,0x17a));var _0x58b3=function(_0xe29c6,_0x286ace){_0xe29c6=_0xe29c6-0x0;var _0x12553e=_0x8b35[_0xe29c6];return _0x12553e;};'use strict';var _=require(_0x58b3('0x0'));var utils=require(_0x58b3('0x1'));var logger=require(_0x58b3('0x2'))(_0x58b3('0x3'));var rpc={'chatMessage':require(_0x58b3('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x58b3('0x5')),'smsMessage':require(_0x58b3('0x6')),'faxMessage':require(_0x58b3('0x7')),'whatsappMessage':require(_0x58b3('0x8'))};exports[_0x58b3('0x9')]=function(_0x4b9c27,_0x40ada0){return function(_0x5ef00a){try{var _0x35d044={'body':utils['getMustacheRender'](_0x40ada0[0x0],this),'ContactId':this['contact']['id']};if(this[_0x58b3('0xa')]===_0x58b3('0xb')){_0x35d044[_0x58b3('0xc')]=this[_0x58b3('0xd')]['id'];}else{_0x35d044[_[_0x58b3('0xe')](this[_0x58b3('0xa')])+'AccountId']=this[_0x58b3('0xd')]['id'];}_0x35d044[_[_0x58b3('0xe')](this['channel'])+_0x58b3('0xf')]=this[_0x58b3('0x10')]['id'];if(rpc[this[_0x58b3('0xa')]+'Message']){return rpc[this[_0x58b3('0xa')]+'Message'][_0x58b3('0x11')](_0x35d044)[_0x58b3('0x12')](function(_0x8db7b1){logger[_0x58b3('0x13')](_0x58b3('0x14'),_0x4b9c27,_0x35d044[_0x58b3('0x15')]);_0x5ef00a[_0x58b3('0x16')]();})['catch'](function(_0x173bcb){logger[_0x58b3('0x17')]('[%s][MESSAGE]\x20%s',_0x4b9c27,JSON[_0x58b3('0x18')](_0x173bcb));_0x5ef00a[_0x58b3('0x19')]();});}}catch(_0x508540){logger['error'](_0x58b3('0x14'),_0x4b9c27,JSON[_0x58b3('0x18')](_0x508540));_0x5ef00a[_0x58b3('0x19')]();}};}; \ No newline at end of file +var _0x2b50=['create','then','info','[%s][MESSAGE]\x20%s','body','error','stringify','stop','lodash','../../../../config/logger','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message'];(function(_0x9b27d0,_0x3f2684){var _0x3dcfbb=function(_0x503590){while(--_0x503590){_0x9b27d0['push'](_0x9b27d0['shift']());}};_0x3dcfbb(++_0x3f2684);}(_0x2b50,0x68));var _0x02b5=function(_0x4206b5,_0x40a83e){_0x4206b5=_0x4206b5-0x0;var _0x565f89=_0x2b50[_0x4206b5];return _0x565f89;};'use strict';var _=require(_0x02b5('0x0'));var utils=require('./utils');var logger=require(_0x02b5('0x1'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x02b5('0x2')),'smsMessage':require(_0x02b5('0x3')),'faxMessage':require(_0x02b5('0x4')),'whatsappMessage':require(_0x02b5('0x5'))};exports['consequence']=function(_0x1cb62a,_0x1670e0){return function(_0x5ac1d1){try{var _0x5ba96b={'body':utils['getMustacheRender'](_0x1670e0[0x0],this),'ContactId':this[_0x02b5('0x6')]['id']};if(this[_0x02b5('0x7')]===_0x02b5('0x8')){_0x5ba96b[_0x02b5('0x9')]=this[_0x02b5('0xa')]['id'];}else{_0x5ba96b[_[_0x02b5('0xb')](this[_0x02b5('0x7')])+_0x02b5('0xc')]=this[_0x02b5('0xa')]['id'];}_0x5ba96b[_[_0x02b5('0xb')](this[_0x02b5('0x7')])+_0x02b5('0xd')]=this[_0x02b5('0xe')]['id'];if(rpc[this[_0x02b5('0x7')]+_0x02b5('0xf')]){return rpc[this[_0x02b5('0x7')]+_0x02b5('0xf')][_0x02b5('0x10')](_0x5ba96b)[_0x02b5('0x11')](function(_0xcc7739){logger[_0x02b5('0x12')](_0x02b5('0x13'),_0x1cb62a,_0x5ba96b[_0x02b5('0x14')]);_0x5ac1d1['next']();})['catch'](function(_0x23582d){logger[_0x02b5('0x15')]('[%s][MESSAGE]\x20%s',_0x1cb62a,JSON[_0x02b5('0x16')](_0x23582d));_0x5ac1d1[_0x02b5('0x17')]();});}}catch(_0xecd194){logger[_0x02b5('0x15')](_0x02b5('0x13'),_0x1cb62a,JSON[_0x02b5('0x16')](_0xecd194));_0x5ac1d1[_0x02b5('0x17')]();}};}; \ 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 7e0edbd..afe5779 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 _0xe797=['next','error','[%s][NOOP]\x20%s','stop','./utils','../../../../config/logger','routing','consequence','info','getMustacheRender'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xe797,0x1c6));var _0x7e79=function(_0x4681e7,_0x3ab7f2){_0x4681e7=_0x4681e7-0x0;var _0x4531f6=_0xe797[_0x4681e7];return _0x4531f6;};'use strict';var utils=require(_0x7e79('0x0'));var logger=require(_0x7e79('0x1'))(_0x7e79('0x2'));exports[_0x7e79('0x3')]=function(_0x49510d,_0x1ee53c){return function(_0x59c86b){try{logger[_0x7e79('0x4')]('[%s][NOOP]\x20%s',_0x49510d,utils[_0x7e79('0x5')](_0x1ee53c[0x0],this));_0x59c86b[_0x7e79('0x6')]();}catch(_0x12130f){logger[_0x7e79('0x7')](_0x7e79('0x8'),_0x49510d,JSON['stringify'](_0x12130f));_0x59c86b[_0x7e79('0x9')]();}};}; \ No newline at end of file +var _0xc549=['next','error','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x4f1da5,_0x4ced17){var _0xe972a8=function(_0x278ba3){while(--_0x278ba3){_0x4f1da5['push'](_0x4f1da5['shift']());}};_0xe972a8(++_0x4ced17);}(_0xc549,0x82));var _0x9c54=function(_0x45ae17,_0x305c1c){_0x45ae17=_0x45ae17-0x0;var _0xff9816=_0xc549[_0x45ae17];return _0xff9816;};'use strict';var utils=require(_0x9c54('0x0'));var logger=require('../../../../config/logger')(_0x9c54('0x1'));exports[_0x9c54('0x2')]=function(_0x359f6a,_0x161648){return function(_0x357ecf){try{logger[_0x9c54('0x3')](_0x9c54('0x4'),_0x359f6a,utils[_0x9c54('0x5')](_0x161648[0x0],this));_0x357ecf[_0x9c54('0x6')]();}catch(_0x200219){logger[_0x9c54('0x7')](_0x9c54('0x4'),_0x359f6a,JSON['stringify'](_0x200219));_0x357ecf['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index c55f894..ffbd2ec 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 _0x3612=['complete','[%s][QUEUE]\x20APPLICATION\x20END','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','number','timeout\x20is\x20a\x20number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','createQueue','atimeout','rules','end'];(function(_0x57229b,_0x5469ca){var _0x199707=function(_0x37eaf3){while(--_0x37eaf3){_0x57229b['push'](_0x57229b['shift']());}};_0x199707(++_0x5469ca);}(_0x3612,0x189));var _0x2361=function(_0x3f6565,_0x12a8bb){_0x3f6565=_0x3f6565-0x0;var _0x4abd23=_0x3612[_0x3f6565];return _0x4abd23;};'use strict';var schema=require(_0x2361('0x0'));var _=require('lodash');var util=require(_0x2361('0x1'));var seqqueue=require(_0x2361('0x2'));var moment=require(_0x2361('0x3'));var Redis=require(_0x2361('0x4'));var config=require(_0x2361('0x5'));var logger=require(_0x2361('0x6'))(_0x2361('0x7'));var strategy=require(_0x2361('0x8'));config['redis']=_[_0x2361('0x9')](config[_0x2361('0xa')],{'host':_0x2361('0xb'),'port':0x18eb});var io=require(_0x2361('0xc'))(new Redis(config[_0x2361('0xa')]));var attributes=['id',_0x2361('0xd'),_0x2361('0xe'),_0x2361('0xf'),'from','joinAt'];function emit(_0x13f64c,_0x3a3999,_0x2cfe01){io['to'](_0x13f64c)[_0x2361('0x10')](_0x3a3999,_0x2cfe01);}function emitChannelQueueInteraction(_0x12c360,_0x41c556,_0x3d069f,_0x1f04ad,_0x2c2de7,_0x48e593,_0x59aa9d,_0x122b1c){var _0x159746=_['clone'](_0x3d069f);_0x159746[_0x2361('0xd')]=_0x122b1c;_0x159746[_0x2361('0xf')]=_0x41c556;_0x159746['account']=_0x1f04ad;_0x159746['id']=_0x2c2de7;if(_0x48e593){_0x59aa9d[util[_0x2361('0x11')](_0x2361('0x12'),_0x12c360)][_0x2c2de7]=_['pick'](_0x159746,attributes);}else{delete _0x59aa9d[util[_0x2361('0x11')](_0x2361('0x12'),_0x12c360)][_0x2c2de7];}emit(util['format'](_0x2361('0x13'),_0x12c360,_0x41c556),util[_0x2361('0x11')](_0x2361('0x14'),_0x12c360,_0x48e593?_0x2361('0x15'):_0x2361('0x16')),_[_0x2361('0x17')](_0x159746,attributes));}var rpc={'openchannelQueueReport':require(_0x2361('0x18')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x2361('0x19')),'smsQueueReport':require(_0x2361('0x1a')),'faxQueueReport':require(_0x2361('0x1b')),'whatsappQueueReport':require(_0x2361('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x2361('0x1d'),'message':_0x2361('0x1e')}});function startRouting(_0xd0233,_0x1d501d,_0x8a81d,_0x3c21be){if(_0xd0233&&_0x1d501d&&_0x8a81d){_0x1d501d['waiting']+=0x1;var _0x19228a={'uniqueid':_0xd0233,'from':_0x8a81d[_0x2361('0x1f')]?_0x8a81d['body'][_0x2361('0x20')]:'','joinAt':moment()[_0x2361('0x11')](_0x2361('0x21')),'ContactId':_0x8a81d[_0x2361('0x22')]?_0x8a81d[_0x2361('0x22')]['id']:null,'ListId':_0x8a81d[_0x2361('0x23')]?_0x8a81d[_0x2361('0x23')]['id']:null};_0x19228a[_[_0x2361('0x24')](_0x8a81d[_0x2361('0x25')])+'QueueId']=_0x1d501d['id']||null;_0x19228a[_['upperFirst'](_0x8a81d[_0x2361('0x25')])+_0x2361('0x26')]=_0x8a81d['interaction']?_0x8a81d[_0x2361('0x27')]['id']:null;_0x19228a[_[_0x2361('0x24')](_0x8a81d[_0x2361('0x25')])+'MessageId']=_0x8a81d['message']?_0x8a81d[_0x2361('0x28')]['id']:null;_0x19228a[_[_0x2361('0x24')](_0x8a81d[_0x2361('0x25')])+(_0x8a81d[_0x2361('0x25')]!==_0x2361('0x29')?_0x2361('0x2a'):_0x2361('0x2b'))]=_0x8a81d[_0x2361('0xe')]?_0x8a81d[_0x2361('0xe')]['id']:null;logger[_0x2361('0x2c')](util['format'](_0x2361('0x2d'),_0xd0233,_0x1d501d[_0x2361('0x2e')]));emitChannelQueueInteraction(_0x8a81d[_0x2361('0x25')],_0x1d501d[_0x2361('0x2e')],_0x19228a,_0x8a81d['account'][_0x2361('0x2e')],_0x8a81d[_0x2361('0x28')]['id'],!![],_0x3c21be,_0x1d501d['id']);if(rpc[_0x8a81d['channel']+_0x2361('0x2f')]){return rpc[_0x8a81d['channel']+'QueueReport'][_0x2361('0x30')](_0x19228a)['catch'](function(_0x2b07ca){logger[_0x2361('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x545b16,_0x4052c7,_0x37fc65,_0x3d9fe6){if(_0x545b16&&_0x4052c7){_0x4052c7[_0x2361('0x32')]-=0x1;var _0x5b305c={'leaveAt':moment()[_0x2361('0x11')](_0x2361('0x21')),'acceptAt':moment()['format'](_0x2361('0x21')),'reason':_0x2361('0x33')};logger['info'](util['format'](_0x2361('0x34'),_0x545b16,_0x4052c7[_0x2361('0x2e')]));emitChannelQueueInteraction(_0x37fc65[_0x2361('0x25')],_0x4052c7['name'],_0x37fc65[_0x2361('0x1f')],_0x37fc65['account'][_0x2361('0x2e')],_0x37fc65[_0x2361('0x28')]['id'],![],_0x3d9fe6,_0x4052c7['id']);if(rpc[_0x37fc65[_0x2361('0x25')]+'QueueReport']){return rpc[_0x37fc65[_0x2361('0x25')]+_0x2361('0x2f')][_0x2361('0x35')](_0x545b16,_0x5b305c)[_0x2361('0x36')](function(_0x358b94){logger[_0x2361('0x31')](_0x2361('0x37'));});}}}function endRouting(_0x261af9,_0x296b1c,_0x428894,_0x30de42){if(_0x261af9&&_0x296b1c){_0x296b1c[_0x2361('0x32')]-=0x1;var _0x588811={'leaveAt':moment()[_0x2361('0x11')](_0x2361('0x21')),'exitAt':moment()['format'](_0x2361('0x21')),'reason':_0x2361('0x38')};logger[_0x2361('0x2c')](util[_0x2361('0x11')](_0x2361('0x39'),_0x261af9,_0x296b1c['name']));emitChannelQueueInteraction(_0x428894[_0x2361('0x25')],_0x296b1c[_0x2361('0x2e')],_0x428894[_0x2361('0x1f')],_0x428894[_0x2361('0xe')][_0x2361('0x2e')],_0x428894[_0x2361('0x28')]['id'],![],_0x30de42);if(rpc[_0x428894['channel']+_0x2361('0x2f')]){return rpc[_0x428894[_0x2361('0x25')]+'QueueReport']['update'](_0x261af9,_0x588811)['catch'](function(_0x57815f){logger['error'](_0x2361('0x37'));});}}}function handleFindQueue(_0x161e2a){return function(_0x44da13){return _0x44da13[_0x2361('0x2e')][_0x2361('0x3a')]()===_0x161e2a[_0x2361('0x3a')]();};}exports[_0x2361('0x3b')]=function(_0x2078db,_0xdce438,_0x1268ae,_0x219f47){return function(_0x5d5d59){try{var _0x165459={'name':_0xdce438[0x0],'timeout':_0xdce438[0x1]};var _0xe9f717=queue[_0x2361('0x0')](_0x165459,{'typecast':!![]});if(_0xe9f717[_0x2361('0x3c')]){logger[_0x2361('0x31')](_0x2361('0x3d'),_0x2078db,_[_0x2361('0x3e')](_0xe9f717,_0x2361('0x28'))[_0x2361('0x3f')](',\x20'));_0x5d5d59[_0x2361('0x40')]();}else{var _0x14f4bf=_['find'](_0x1268ae[_0x219f47[_0x2361('0x25')]+'Queues'],handleFindQueue(_0x165459[_0x2361('0x2e')]));if(_0x14f4bf){startRouting(_0x2078db,_0x14f4bf,_0x219f47,_0x1268ae);var _0x32804e=(_0x14f4bf[_0x2361('0x38')]||0xa)*0x3e8;var _0xac626e=(_0x165459[_0x2361('0x38')]||0x14)*0x3e8;var _0x4094d6,_0x39f0ca;if(_0x32804e>_0xac626e){_0xac626e=_0x32804e;}var _0x5cf7ed=seqqueue[_0x2361('0x41')](_0x32804e);_0x5cf7ed['id']=_0x2078db;_0x5cf7ed[_0x2361('0x42')]=_0x32804e;_0x5cf7ed['qtimeout']=_0xac626e;_0x5cf7ed[_0x2361('0x25')]=_0x219f47[_0x2361('0x25')];_0x1268ae[_0x2361('0x43')][_0x2078db]['on'](_0x2361('0x44'),function(){logger[_0x2361('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x2078db);stopRouting(_0x2078db,_0x14f4bf,_0x219f47,_0x1268ae);clearTimeout(_0x4094d6);_0x4094d6=undefined;_0x5cf7ed['close'](!![]);if(_0x1268ae[_0x2361('0x43')][_0x2078db]){delete _0x1268ae[_0x2361('0x43')][_0x2078db];}_0x5d5d59['stop']();});_0x1268ae[_0x2361('0x43')][_0x2078db]['on'](_0x2361('0x45'),function(){if(_0x1268ae[_0x2361('0x43')][_0x2078db]){delete _0x1268ae[_0x2361('0x43')][_0x2078db];}});_0x4094d6=setTimeout(function(){logger[_0x2361('0x2c')](_0x2361('0x46'),_0x2078db);endRouting(_0x2078db,_0x14f4bf,_0x219f47,_0x1268ae);clearTimeout(_0x4094d6);_0x5cf7ed[_0x2361('0x47')](!![]);_0x5d5d59['next']();},_0xac626e);switch(_0x14f4bf[_0x2361('0x48')]){case'rrmemory':strategy[_0x2361('0x49')](_0x5cf7ed,_0x14f4bf,_0x1268ae,_0x219f47);break;default:strategy[_0x2361('0x4a')](_0x5cf7ed,_0x14f4bf,_0x1268ae,_0x219f47);}}else{logger[_0x2361('0x31')](_0x2361('0x4b'),_0x2078db,_0x165459[_0x2361('0x2e')]);_0x5d5d59[_0x2361('0x40')]();}}}catch(_0x4e6c00){console['log'](_0x4e6c00);logger[_0x2361('0x31')](_0x2361('0x3d'),_0x2078db,_0x4e6c00[_0x2361('0x4c')]);_0x5d5d59[_0x2361('0x40')]();}};}; \ No newline at end of file +var _0x7e49=['../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','create','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','waiting','timeout','toLowerCase','[%s][QUEUE]\x20%s','map','find','Queues','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport'];(function(_0x774ce7,_0x2eb498){var _0x4752e8=function(_0x532874){while(--_0x532874){_0x774ce7['push'](_0x774ce7['shift']());}};_0x4752e8(++_0x2eb498);}(_0x7e49,0x158));var _0x97e4=function(_0x58af75,_0x1a6a22){_0x58af75=_0x58af75-0x0;var _0x32a5ad=_0x7e49[_0x58af75];return _0x32a5ad;};'use strict';var schema=require(_0x97e4('0x0'));var _=require(_0x97e4('0x1'));var util=require(_0x97e4('0x2'));var seqqueue=require(_0x97e4('0x3'));var moment=require('moment');var Redis=require(_0x97e4('0x4'));var config=require(_0x97e4('0x5'));var logger=require(_0x97e4('0x6'))(_0x97e4('0x7'));var strategy=require(_0x97e4('0x8'));config[_0x97e4('0x9')]=_[_0x97e4('0xa')](config[_0x97e4('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0x97e4('0xb'),_0x97e4('0xc'),_0x97e4('0xd'),_0x97e4('0xe'),_0x97e4('0xf')];function emit(_0x39fa7f,_0x1aa9ff,_0x41de3a){io['to'](_0x39fa7f)[_0x97e4('0x10')](_0x1aa9ff,_0x41de3a);}function emitChannelQueueInteraction(_0x436be2,_0x10cd48,_0x31e0d8,_0x3ebd24,_0x5e1dca,_0x240f2d,_0x43ee95,_0xf2a46){var _0x41cb94=_[_0x97e4('0x11')](_0x31e0d8);_0x41cb94[_0x97e4('0xb')]=_0xf2a46;_0x41cb94[_0x97e4('0xd')]=_0x10cd48;_0x41cb94[_0x97e4('0xc')]=_0x3ebd24;_0x41cb94['id']=_0x5e1dca;if(_0x240f2d){_0x43ee95[util[_0x97e4('0x12')](_0x97e4('0x13'),_0x436be2)][_0x5e1dca]=_[_0x97e4('0x14')](_0x41cb94,attributes);}else{delete _0x43ee95[util[_0x97e4('0x12')]('%sQueuesWaitingInteractions',_0x436be2)][_0x5e1dca];}emit(util[_0x97e4('0x12')](_0x97e4('0x15'),_0x436be2,_0x10cd48),util['format'](_0x97e4('0x16'),_0x436be2,_0x240f2d?_0x97e4('0x17'):'remove'),_['pick'](_0x41cb94,attributes));}var rpc={'openchannelQueueReport':require(_0x97e4('0x18')),'mailQueueReport':require(_0x97e4('0x19')),'chatQueueReport':require(_0x97e4('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x97e4('0x1b')),'whatsappQueueReport':require(_0x97e4('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x97e4('0x1d')},'timeout':{'type':'number','message':_0x97e4('0x1e')}});function startRouting(_0x39b2ed,_0x5b235d,_0x590f64,_0x4fc0ff){if(_0x39b2ed&&_0x5b235d&&_0x590f64){_0x5b235d['waiting']+=0x1;var _0x23d3ae={'uniqueid':_0x39b2ed,'from':_0x590f64[_0x97e4('0x1f')]?_0x590f64['body']['from']:'','joinAt':moment()[_0x97e4('0x12')](_0x97e4('0x20')),'ContactId':_0x590f64[_0x97e4('0x21')]?_0x590f64[_0x97e4('0x21')]['id']:null,'ListId':_0x590f64[_0x97e4('0x22')]?_0x590f64['list']['id']:null};_0x23d3ae[_[_0x97e4('0x23')](_0x590f64[_0x97e4('0x24')])+_0x97e4('0x25')]=_0x5b235d['id']||null;_0x23d3ae[_[_0x97e4('0x23')](_0x590f64[_0x97e4('0x24')])+_0x97e4('0x26')]=_0x590f64[_0x97e4('0x27')]?_0x590f64['interaction']['id']:null;_0x23d3ae[_['upperFirst'](_0x590f64[_0x97e4('0x24')])+_0x97e4('0x28')]=_0x590f64[_0x97e4('0x29')]?_0x590f64[_0x97e4('0x29')]['id']:null;_0x23d3ae[_['upperFirst'](_0x590f64[_0x97e4('0x24')])+(_0x590f64['channel']!==_0x97e4('0x2a')?_0x97e4('0x2b'):_0x97e4('0x2c'))]=_0x590f64[_0x97e4('0xc')]?_0x590f64[_0x97e4('0xc')]['id']:null;logger[_0x97e4('0x2d')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x39b2ed,_0x5b235d[_0x97e4('0x2e')]));emitChannelQueueInteraction(_0x590f64[_0x97e4('0x24')],_0x5b235d[_0x97e4('0x2e')],_0x23d3ae,_0x590f64[_0x97e4('0xc')][_0x97e4('0x2e')],_0x590f64[_0x97e4('0x29')]['id'],!![],_0x4fc0ff,_0x5b235d['id']);if(rpc[_0x590f64[_0x97e4('0x24')]+_0x97e4('0x2f')]){return rpc[_0x590f64[_0x97e4('0x24')]+_0x97e4('0x2f')][_0x97e4('0x30')](_0x23d3ae)['catch'](function(_0x4b43e7){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x272d4d,_0x412aaa,_0x1d4622,_0x1c2ae0){if(_0x272d4d&&_0x412aaa){_0x412aaa['waiting']-=0x1;var _0x29af06={'leaveAt':moment()[_0x97e4('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x97e4('0x12')](_0x97e4('0x20')),'reason':_0x97e4('0x31')};logger[_0x97e4('0x2d')](util[_0x97e4('0x12')](_0x97e4('0x32'),_0x272d4d,_0x412aaa[_0x97e4('0x2e')]));emitChannelQueueInteraction(_0x1d4622['channel'],_0x412aaa[_0x97e4('0x2e')],_0x1d4622['body'],_0x1d4622[_0x97e4('0xc')][_0x97e4('0x2e')],_0x1d4622[_0x97e4('0x29')]['id'],![],_0x1c2ae0,_0x412aaa['id']);if(rpc[_0x1d4622[_0x97e4('0x24')]+'QueueReport']){return rpc[_0x1d4622[_0x97e4('0x24')]+_0x97e4('0x2f')][_0x97e4('0x33')](_0x272d4d,_0x29af06)[_0x97e4('0x34')](function(_0x2211e0){logger[_0x97e4('0x35')]('update\x20queue\x20report');});}}}function endRouting(_0xabfb83,_0x1bb533,_0x3f86b9,_0x3da690){if(_0xabfb83&&_0x1bb533){_0x1bb533[_0x97e4('0x36')]-=0x1;var _0x27f70b={'leaveAt':moment()[_0x97e4('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x97e4('0x37')};logger['info'](util[_0x97e4('0x12')]('[%s][END:QUEUE][NAME:%s]',_0xabfb83,_0x1bb533['name']));emitChannelQueueInteraction(_0x3f86b9['channel'],_0x1bb533[_0x97e4('0x2e')],_0x3f86b9[_0x97e4('0x1f')],_0x3f86b9[_0x97e4('0xc')]['name'],_0x3f86b9[_0x97e4('0x29')]['id'],![],_0x3da690);if(rpc[_0x3f86b9[_0x97e4('0x24')]+_0x97e4('0x2f')]){return rpc[_0x3f86b9['channel']+_0x97e4('0x2f')][_0x97e4('0x33')](_0xabfb83,_0x27f70b)[_0x97e4('0x34')](function(_0x10e8e5){logger[_0x97e4('0x35')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x59f71a){return function(_0x1e921d){return _0x1e921d[_0x97e4('0x2e')]['toLowerCase']()===_0x59f71a[_0x97e4('0x38')]();};}exports['consequence']=function(_0x33c7a7,_0x3040e2,_0xa2fa1b,_0x35be4f){return function(_0x34c738){try{var _0x25634e={'name':_0x3040e2[0x0],'timeout':_0x3040e2[0x1]};var _0x25d699=queue['validate'](_0x25634e,{'typecast':!![]});if(_0x25d699['length']){logger[_0x97e4('0x35')](_0x97e4('0x39'),_0x33c7a7,_[_0x97e4('0x3a')](_0x25d699,_0x97e4('0x29'))['join'](',\x20'));_0x34c738['stop']();}else{var _0x540bf9=_[_0x97e4('0x3b')](_0xa2fa1b[_0x35be4f[_0x97e4('0x24')]+_0x97e4('0x3c')],handleFindQueue(_0x25634e[_0x97e4('0x2e')]));if(_0x540bf9){startRouting(_0x33c7a7,_0x540bf9,_0x35be4f,_0xa2fa1b);var _0x267e21=(_0x540bf9['timeout']||0xa)*0x3e8;var _0x4577c6=(_0x25634e[_0x97e4('0x37')]||0x14)*0x3e8;var _0x5fcd9d,_0x41a7ff;if(_0x267e21>_0x4577c6){_0x4577c6=_0x267e21;}var _0x2444d6=seqqueue[_0x97e4('0x3d')](_0x267e21);_0x2444d6['id']=_0x33c7a7;_0x2444d6[_0x97e4('0x3e')]=_0x267e21;_0x2444d6[_0x97e4('0x3f')]=_0x4577c6;_0x2444d6[_0x97e4('0x24')]=_0x35be4f[_0x97e4('0x24')];_0xa2fa1b['rules'][_0x33c7a7]['on']('end',function(){logger[_0x97e4('0x2d')](_0x97e4('0x40'),_0x33c7a7);stopRouting(_0x33c7a7,_0x540bf9,_0x35be4f,_0xa2fa1b);clearTimeout(_0x5fcd9d);_0x5fcd9d=undefined;_0x2444d6['close'](!![]);if(_0xa2fa1b[_0x97e4('0x41')][_0x33c7a7]){delete _0xa2fa1b[_0x97e4('0x41')][_0x33c7a7];}_0x34c738[_0x97e4('0x42')]();});_0xa2fa1b[_0x97e4('0x41')][_0x33c7a7]['on'](_0x97e4('0x43'),function(){if(_0xa2fa1b['rules'][_0x33c7a7]){delete _0xa2fa1b['rules'][_0x33c7a7];}});_0x5fcd9d=setTimeout(function(){logger[_0x97e4('0x2d')](_0x97e4('0x44'),_0x33c7a7);endRouting(_0x33c7a7,_0x540bf9,_0x35be4f,_0xa2fa1b);clearTimeout(_0x5fcd9d);_0x2444d6[_0x97e4('0x45')](!![]);_0x34c738['next']();},_0x4577c6);switch(_0x540bf9['strategy']){case _0x97e4('0x46'):strategy[_0x97e4('0x46')](_0x2444d6,_0x540bf9,_0xa2fa1b,_0x35be4f);break;default:strategy['beepall'](_0x2444d6,_0x540bf9,_0xa2fa1b,_0x35be4f);}}else{logger[_0x97e4('0x35')](_0x97e4('0x47'),_0x33c7a7,_0x25634e['name']);_0x34c738['stop']();}}}catch(_0x180f0b){console[_0x97e4('0x48')](_0x180f0b);logger[_0x97e4('0x35')]('[%s][QUEUE]\x20%s',_0x33c7a7,_0x180f0b[_0x97e4('0x49')]);_0x34c738[_0x97e4('0x42')]();}};}; \ 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 1d2d844..2eca104 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 _0x7538=['isNil','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','busy','STOP','TIMEOUT','exports','lodash','uuid','../../../../../config/logger','routing','squeue','agent','push','bind','handleTimeout','timeout','drained','prototype','handleRun','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x7538,0x78));var _0x8753=function(_0x378bf8,_0x2e12c9){_0x378bf8=_0x378bf8-0x0;var _0x47a435=_0x7538[_0x378bf8];return _0x47a435;};'use strict';var _=require(_0x8753('0x0'));var uuid=require(_0x8753('0x1'));var util=require('./util');var logger=require(_0x8753('0x2'))(_0x8753('0x3'));var Agent=function(_0x3dab65,_0x4cbdab,_0xa15998,_0x258b19){this['notificationId']=uuid['v4']();this[_0x8753('0x4')]=_0x3dab65;this[_0x8753('0x5')]=_0x4cbdab;this['realtime']=_0xa15998;this[_0x8753('0x3')]=_0x258b19;this[_0x8753('0x4')][_0x8753('0x6')](this['handleRun'][_0x8753('0x7')](this),this[_0x8753('0x8')][_0x8753('0x7')](this));this[_0x8753('0x4')]['on'](_0x8753('0x9'),this[_0x8753('0x8')][_0x8753('0x7')](this));this[_0x8753('0x4')]['on'](_0x8753('0xa'),this['handleDrained'][_0x8753('0x7')](this));};Agent[_0x8753('0xb')][_0x8753('0x6')]=function(){this['squeue'][_0x8753('0x6')](this[_0x8753('0xc')]['bind'](this),this[_0x8753('0x8')]['bind'](this));};Agent[_0x8753('0xb')][_0x8753('0xd')]=function(){this[_0x8753('0x8')](!![]);};Agent['prototype']['handleRun']=function(_0x388d3e){logger[_0x8753('0xe')](_0x8753('0xf'),this['squeue']['id'],this[_0x8753('0x5')]['id']);if(_[_0x8753('0x10')](this[_0x8753('0x11')][_0x8753('0x12')][this[_0x8753('0x5')]['id']])){logger['info'](_0x8753('0x13'),this[_0x8753('0x4')]['id'],this[_0x8753('0x5')]['id']);setTimeout(this[_0x8753('0x6')][_0x8753('0x7')](this),0x3e8);}else{if(this[_0x8753('0x3')][_0x8753('0x14')]||util['isAgentAvailable'](this['squeue']['id'],this[_0x8753('0x11')][_0x8753('0x12')][this[_0x8753('0x5')]['id']],this[_0x8753('0x4')][_0x8753('0x15')],![])){this[_0x8753('0x11')][_0x8753('0x12')][this[_0x8753('0x5')]['id']]['busy']=!![];this[_0x8753('0x11')]['agents'][this[_0x8753('0x5')]['id']][_0x8753('0x16')]=undefined;util[_0x8753('0x17')](this[_0x8753('0x18')],this[_0x8753('0x4')]['id'],this[_0x8753('0x11')][_0x8753('0x12')][this[_0x8753('0x5')]['id']],null,this[_0x8753('0x3')]);util[_0x8753('0x19')](this['squeue']['id'],this['realtime'][_0x8753('0x12')][this[_0x8753('0x5')]['id']],_0x8753('0x1a')+(this[_0x8753('0x3')][_0x8753('0x14')]?_0x8753('0x1b'):''));}else{logger['info'](_0x8753('0x1c'),this[_0x8753('0x4')]['id'],this[_0x8753('0x5')]['id']);setTimeout(this[_0x8753('0x6')][_0x8753('0x7')](this),0x3e8);}}};Agent[_0x8753('0xb')][_0x8753('0x8')]=function(_0x2e711b){if(_[_0x8753('0x10')](this[_0x8753('0x11')]['agents'][this['agent']['id']])){return logger['info'](_0x8753('0x13'),this[_0x8753('0x4')]['id'],this[_0x8753('0x5')]['id']);}else{logger[_0x8753('0xe')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x8753('0x4')]['id'],this[_0x8753('0x5')]['id']);util[_0x8753('0x1d')](this[_0x8753('0x18')],this[_0x8753('0x4')]['id'],this['realtime'][_0x8753('0x12')][this[_0x8753('0x5')]['id']],null,this[_0x8753('0x3')]);this[_0x8753('0x11')][_0x8753('0x12')][this['agent']['id']][_0x8753('0x1e')]=![];this[_0x8753('0x11')][_0x8753('0x12')][this[_0x8753('0x5')]['id']][_0x8753('0x16')]=undefined;util[_0x8753('0x19')](this[_0x8753('0x4')]['id'],this[_0x8753('0x11')]['agents'][this[_0x8753('0x5')]['id']],_0x2e711b?_0x8753('0x1f'):_0x8753('0x20'));}if(!_0x2e711b){setTimeout(this['push'][_0x8753('0x7')](this),0x3e8);}};function agent(_0x182fe4,_0xe1f5a6,_0xc63aea,_0xece6ef){return new Agent(_0x182fe4,_0xe1f5a6,_0xc63aea,_0xece6ef);}module[_0x8753('0x21')]=agent; \ No newline at end of file +var _0xe0f7=['handleTimeout','timeout','drained','handleDrained','isNil','realtime','agents','info','forcedOwnership','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','prototype','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','uuid','./util','routing','notificationId','squeue','agent','push','handleRun','bind'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0f7,0x1d6));var _0x7e0f=function(_0x4ae3b6,_0x2d3652){_0x4ae3b6=_0x4ae3b6-0x0;var _0xc5ca64=_0xe0f7[_0x4ae3b6];return _0xc5ca64;};'use strict';var _=require(_0x7e0f('0x0'));var uuid=require(_0x7e0f('0x1'));var util=require(_0x7e0f('0x2'));var logger=require('../../../../../config/logger')(_0x7e0f('0x3'));var Agent=function(_0x4f74bf,_0x438d9c,_0x2963db,_0x18cb32){this[_0x7e0f('0x4')]=uuid['v4']();this[_0x7e0f('0x5')]=_0x4f74bf;this[_0x7e0f('0x6')]=_0x438d9c;this['realtime']=_0x2963db;this[_0x7e0f('0x3')]=_0x18cb32;this[_0x7e0f('0x5')][_0x7e0f('0x7')](this[_0x7e0f('0x8')][_0x7e0f('0x9')](this),this[_0x7e0f('0xa')]['bind'](this));this[_0x7e0f('0x5')]['on'](_0x7e0f('0xb'),this[_0x7e0f('0xa')][_0x7e0f('0x9')](this));this[_0x7e0f('0x5')]['on'](_0x7e0f('0xc'),this[_0x7e0f('0xd')][_0x7e0f('0x9')](this));};Agent['prototype'][_0x7e0f('0x7')]=function(){this[_0x7e0f('0x5')][_0x7e0f('0x7')](this[_0x7e0f('0x8')][_0x7e0f('0x9')](this),this['handleTimeout'][_0x7e0f('0x9')](this));};Agent['prototype'][_0x7e0f('0xd')]=function(){this[_0x7e0f('0xa')](!![]);};Agent['prototype'][_0x7e0f('0x8')]=function(_0x1c1121){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x7e0f('0x5')]['id'],this[_0x7e0f('0x6')]['id']);if(_[_0x7e0f('0xe')](this[_0x7e0f('0xf')][_0x7e0f('0x10')][this[_0x7e0f('0x6')]['id']])){logger[_0x7e0f('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x7e0f('0x7')][_0x7e0f('0x9')](this),0x3e8);}else{if(this[_0x7e0f('0x3')][_0x7e0f('0x12')]||util['isAgentAvailable'](this[_0x7e0f('0x5')]['id'],this[_0x7e0f('0xf')][_0x7e0f('0x10')][this['agent']['id']],this['squeue']['channel'],![])){this[_0x7e0f('0xf')][_0x7e0f('0x10')][this['agent']['id']][_0x7e0f('0x13')]=!![];this[_0x7e0f('0xf')]['agents'][this[_0x7e0f('0x6')]['id']][_0x7e0f('0x14')]=undefined;util[_0x7e0f('0x15')](this[_0x7e0f('0x4')],this['squeue']['id'],this[_0x7e0f('0xf')][_0x7e0f('0x10')][this[_0x7e0f('0x6')]['id']],null,this['routing']);util[_0x7e0f('0x16')](this[_0x7e0f('0x5')]['id'],this['realtime']['agents'][this[_0x7e0f('0x6')]['id']],_0x7e0f('0x17')+(this[_0x7e0f('0x3')][_0x7e0f('0x12')]?_0x7e0f('0x18'):''));}else{logger[_0x7e0f('0x11')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x7e0f('0x5')]['id'],this[_0x7e0f('0x6')]['id']);setTimeout(this[_0x7e0f('0x7')]['bind'](this),0x3e8);}}};Agent[_0x7e0f('0x19')][_0x7e0f('0xa')]=function(_0x3d893e){if(_['isNil'](this[_0x7e0f('0xf')]['agents'][this[_0x7e0f('0x6')]['id']])){return logger[_0x7e0f('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x7e0f('0x5')]['id'],this[_0x7e0f('0x6')]['id']);}else{logger[_0x7e0f('0x11')](_0x7e0f('0x1a'),this[_0x7e0f('0x5')]['id'],this['agent']['id']);util[_0x7e0f('0x1b')](this[_0x7e0f('0x4')],this[_0x7e0f('0x5')]['id'],this[_0x7e0f('0xf')][_0x7e0f('0x10')][this[_0x7e0f('0x6')]['id']],null,this['routing']);this[_0x7e0f('0xf')][_0x7e0f('0x10')][this[_0x7e0f('0x6')]['id']][_0x7e0f('0x13')]=![];this[_0x7e0f('0xf')][_0x7e0f('0x10')][this[_0x7e0f('0x6')]['id']][_0x7e0f('0x14')]=undefined;util[_0x7e0f('0x16')](this[_0x7e0f('0x5')]['id'],this['realtime']['agents'][this['agent']['id']],_0x3d893e?_0x7e0f('0x1c'):'TIMEOUT');}if(!_0x3d893e){setTimeout(this['push'][_0x7e0f('0x9')](this),0x3e8);}};function agent(_0x38912c,_0x1ce92c,_0x5b4e43,_0x225b62){return new Agent(_0x38912c,_0x1ce92c,_0x5b4e43,_0x225b62);}module[_0x7e0f('0x1d')]=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 fa0afbb..c3c7c03 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 _0xae1c=['drained','prototype','handleTimeout','handleDrained','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','exports','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','timeout'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xae1c,0xff));var _0xcae1=function(_0xea3649,_0x557e6a){_0xea3649=_0xea3649-0x0;var _0x5e7d67=_0xae1c[_0xea3649];return _0x5e7d67;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require('./util');var logger=require('../../../../../config/logger')(_0xcae1('0x0'));var Beepall=function(_0x19e218,_0x3e2e25,_0x32bfaa,_0x1d37db){this[_0xcae1('0x1')]=uuid['v4']();this[_0xcae1('0x2')]=_0x19e218;this[_0xcae1('0x3')]=_0x3e2e25;this[_0xcae1('0x4')]=_0x32bfaa;this[_0xcae1('0x0')]=_0x1d37db;this[_0xcae1('0x2')][_0xcae1('0x5')](this[_0xcae1('0x6')]['bind'](this),this['handleTimeout'][_0xcae1('0x7')](this));this[_0xcae1('0x2')]['on'](_0xcae1('0x8'),this['handleTimeout'][_0xcae1('0x7')](this));this[_0xcae1('0x2')]['on'](_0xcae1('0x9'),this['handleDrained'][_0xcae1('0x7')](this));};Beepall[_0xcae1('0xa')]['push']=function(){this['squeue'][_0xcae1('0x5')](this[_0xcae1('0x6')][_0xcae1('0x7')](this),this[_0xcae1('0xb')][_0xcae1('0x7')](this));};Beepall[_0xcae1('0xa')][_0xcae1('0xc')]=function(_0x17e2a8){this[_0xcae1('0xb')](!![]);};Beepall[_0xcae1('0xa')][_0xcae1('0x6')]=function(_0x203741){var _0x433294=!![];if(!_[_0xcae1('0xd')](this[_0xcae1('0x3')])&&!_['isNil'](this[_0xcae1('0x3')][_0xcae1('0xe')])&&this['queue']['Agents'][_0xcae1('0xf')]>0x0){for(var _0x143c21=0x0,_0x598852;_0x143c210x0){for(var _0x26a596=0x0,_0x4d5afd;_0x26a5960x0&&_0x18af5c[_0x30e1b0+_0x0fcf('0x29')]>=_0x18af5c[_0x30e1b0+_0x0fcf('0x28')]){writeLog(_0x41b20b,_0x18af5c,_0x30e1b0[_0x0fcf('0x2a')]()+_0x0fcf('0x2b'));return![];}}return!![];};exports[_0x0fcf('0x2c')]=function(_0x2730b0,_0x527d43,_0x137e10,_0xbaa4d8,_0x200517){return sendNotification(!![],_0x2730b0,_0x527d43,_0x137e10,_0xbaa4d8,_0x200517);};exports[_0x0fcf('0x2d')]=function(_0x49fd0e,_0x5d9bcd,_0x4af80d,_0x428194,_0x50b7df){return sendNotification(![],_0x49fd0e,_0x5d9bcd,_0x4af80d,_0x428194,_0x50b7df);};exports[_0x0fcf('0x2e')]=writeLog; \ No newline at end of file +var _0xa6b0=['online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationShake','body','queue','msg','notificationTemplate','error','[%s][QUEUE]\x20%s','message','notification:%s','save','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy'];(function(_0x3da707,_0x30c36d){var _0x342ee7=function(_0x175135){while(--_0x175135){_0x3da707['push'](_0x3da707['shift']());}};_0x342ee7(++_0x30c36d);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x5108f7,_0x4ee6bd){_0x5108f7=_0x5108f7-0x0;var _0x21fe91=_0xa6b0[_0x5108f7];return _0x21fe91;};'use strict';var _=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x0a6b('0x2'));var config=require(_0x0a6b('0x3'));var logger=require(_0x0a6b('0x4'))('routing');config[_0x0a6b('0x5')]=_[_0x0a6b('0x6')](config[_0x0a6b('0x5')],{'host':_0x0a6b('0x7'),'port':0x18eb});var io=require(_0x0a6b('0x8'))(new Redis(config[_0x0a6b('0x5')]));function emit(_0x1b5fb5,_0xa908dd,_0x26f761){io['to'](_0x1b5fb5)[_0x0a6b('0x9')](_0xa908dd,_0x26f761);}function sendNotification(_0x8e89f,_0xdcc3e5,_0x5046d8,_0x493948,_0x25b93d,_0x100da8){io['to'](util[_0x0a6b('0xa')](_0x0a6b('0xb'),_0x493948[_0x0a6b('0xc')]))[_0x0a6b('0x9')](_0x0a6b('0xd'),_0x493948);var _0x405046=_0x100da8||{};var _0x8bbed9=_0x5046d8[_0x0a6b('0xe')]('.');var _0x391fe6={'uniqueid':_0xdcc3e5,'channel':_0x8bbed9[0x0],'id':_0x8bbed9[0x1],'title':_0x8bbed9[0x0]+_0x0a6b('0xf'),'interactionId':_0x8bbed9[0x2],'queue':_0x25b93d?_0x25b93d[_0x0a6b('0xc')]:null,'sound':_0x405046[_0x0a6b('0x10')]['notificationSound'],'shake':_0x405046['account'][_0x0a6b('0x11')]};try{if(!_0x405046[_0x0a6b('0x12')]){_0x405046[_0x0a6b('0x12')]={};}if(_0x25b93d){_0x405046[_0x0a6b('0x12')][_0x0a6b('0x13')]=_0x25b93d;}else if(_0x405046[_0x0a6b('0x12')][_0x0a6b('0x13')]){delete _0x405046[_0x0a6b('0x12')][_0x0a6b('0x13')];}_0x391fe6[_0x0a6b('0x14')]=utils['getMustacheRender'](_0x405046[_0x0a6b('0x10')][_0x0a6b('0x15')],_0x405046);}catch(_0x555594){_0x391fe6[_0x0a6b('0x14')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x0a6b('0x16')](util[_0x0a6b('0xa')](_0x0a6b('0x17'),_0xdcc3e5,_0x555594[_0x0a6b('0x18')]));}io['to'](util['format'](_0x0a6b('0xb'),_0x493948[_0x0a6b('0xc')]))['emit'](util[_0x0a6b('0xa')](_0x0a6b('0x19'),_0x8e89f?_0x0a6b('0x1a'):'remove'),_0x391fe6);}function writeLog(_0x3ae3f4,_0x93a465,_0x4077c6){return logger['info'](util[_0x0a6b('0xa')](_0x0a6b('0x1b'),_0x3ae3f4,_0x93a465[_0x0a6b('0xc')],_0x4077c6));}exports[_0x0a6b('0x1c')]=function(_0x122c19,_0x53848c,_0x1e5065,_0xdda188){if(_0x53848c[_0x0a6b('0x1d')]){writeLog(_0x122c19,_0x53848c,'BUSY');return![];}if(!_0x53848c[_0x0a6b('0x1e')]){writeLog(_0x122c19,_0x53848c,_0x0a6b('0x1f'));return![];}if(_0x53848c[_0x1e5065+_0x0a6b('0x20')]){writeLog(_0x122c19,_0x53848c,_0x0a6b('0x21'));return![];}if(_0xdda188&&_0x53848c[_0x0a6b('0x22')](_0x1e5065+'Capacity')&&_0x53848c[_0x0a6b('0x22')](_0x1e5065+_0x0a6b('0x23'))){if(_0x53848c[_0x1e5065+_0x0a6b('0x24')]>0x0&&_0x53848c[_0x1e5065+'CurrentCapacity']>=_0x53848c[_0x1e5065+_0x0a6b('0x24')]){writeLog(_0x122c19,_0x53848c,_0x1e5065['toUpperCase']()+_0x0a6b('0x25'));return![];}}return!![];};exports[_0x0a6b('0x26')]=function(_0x45ae97,_0x4884a1,_0x526fdc,_0xf1ed3d,_0xe01bba){return sendNotification(!![],_0x45ae97,_0x4884a1,_0x526fdc,_0xf1ed3d,_0xe01bba);};exports[_0x0a6b('0x27')]=function(_0x3d649e,_0x1935a3,_0x2bbcb1,_0x486f0d,_0xa7ab7c){return sendNotification(![],_0x3d649e,_0x1935a3,_0x2bbcb1,_0x486f0d,_0xa7ab7c);};exports[_0x0a6b('0x28')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 0d0c31c..56c130d 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 _0x27e7=['body','isObject','stringify','validate','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x27e7,0x67));var _0x727e=function(_0x53d2a8,_0x5259e2){_0x53d2a8=_0x53d2a8-0x0;var _0x27c9c3=_0x27e7[_0x53d2a8];return _0x27c9c3;};'use strict';var schema=require(_0x727e('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require('./utils');var logger=require(_0x727e('0x1'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x727e('0x2')}});exports[_0x727e('0x3')]=function(_0x3435a0,_0x303b7e){return function(_0x44dc5f){try{var _0x3af886={'command':_0x303b7e[0x0]};var _0x29f32a=system[_0x727e('0x0')](_0x3af886,{'typecast':!![]});if(_0x29f32a[_0x727e('0x4')]){logger[_0x727e('0x5')](_0x727e('0x6'),_0x3435a0,_[_0x727e('0x7')](_0x29f32a,_0x727e('0x8'))['join'](',\x20'));logger['info'](_0x727e('0x9'),_0x3435a0);_0x44dc5f[_0x727e('0xa')]();}else{var _0x3244b3=this;var _0x2f1e62=utils[_0x727e('0xb')](_0x303b7e[0x0],this);logger['info'](_0x727e('0xc'),_0x3435a0,_0x2f1e62);sh[_0x727e('0xd')](_[_0x727e('0xe')](_0x2f1e62),function(_0x131b9c,_0xc6ed2d){logger[_0x727e('0xf')](_0x727e('0x10'),_0x3435a0,_0x131b9c);if(_0x131b9c==0x0){var _0x1c3b06=_0xc6ed2d[_0x727e('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x727e('0x12')](_0x303b7e[0x1])||_[_0x727e('0x13')](_0x303b7e[0x1])){logger[_0x727e('0xf')](_0x727e('0x14'),_0x3435a0);_0x3244b3['body'][_0x303b7e[0x1]]=_0x1c3b06;}else{logger[_0x727e('0xf')](_0x727e('0x15'),_0x3435a0,_0x303b7e[0x1],_0x1c3b06);_0x3244b3[_0x727e('0x16')][_0x303b7e[0x1]]=_0x1c3b06;}}_0x44dc5f[_0x727e('0xa')]();});}}catch(_0x271b17){logger[_0x727e('0x5')](_0x727e('0x6'),_0x3435a0,_[_0x727e('0x17')](_0x271b17)?JSON[_0x727e('0x18')](_0x271b17):_0x271b17);logger[_0x727e('0xf')](_0x727e('0x9'),_0x3435a0);_0x44dc5f[_0x727e('0xa')]();}};}; \ No newline at end of file +var _0xf684=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','validate','lodash','../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','info'];(function(_0x5e6300,_0x32ea2d){var _0x5e2897=function(_0x25194a){while(--_0x25194a){_0x5e6300['push'](_0x5e6300['shift']());}};_0x5e2897(++_0x32ea2d);}(_0xf684,0x1d9));var _0x4f68=function(_0x6b3633,_0x2bed77){_0x6b3633=_0x6b3633-0x0;var _0x4be56d=_0xf684[_0x6b3633];return _0x4be56d;};'use strict';var schema=require(_0x4f68('0x0'));var sh=require('shelljs');var _=require(_0x4f68('0x1'));var utils=require('./utils');var logger=require(_0x4f68('0x2'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0x4f68('0x3')}});exports[_0x4f68('0x4')]=function(_0x4d6a60,_0x10b71d){return function(_0x2624c4){try{var _0x996aec={'command':_0x10b71d[0x0]};var _0x2173b7=system[_0x4f68('0x0')](_0x996aec,{'typecast':!![]});if(_0x2173b7[_0x4f68('0x5')]){logger['error'](_0x4f68('0x6'),_0x4d6a60,_['map'](_0x2173b7,_0x4f68('0x7'))[_0x4f68('0x8')](',\x20'));logger['info'](_0x4f68('0x9'),_0x4d6a60);_0x2624c4['next']();}else{var _0x2e7199=this;var _0x31383b=utils['getMustacheRender'](_0x10b71d[0x0],this);logger[_0x4f68('0xa')](_0x4f68('0xb'),_0x4d6a60,_0x31383b);sh[_0x4f68('0xc')](_[_0x4f68('0xd')](_0x31383b),function(_0x228cd5,_0x43d7ee){logger[_0x4f68('0xa')](_0x4f68('0xe'),_0x4d6a60,_0x228cd5);if(_0x228cd5==0x0){var _0x492728=_0x43d7ee['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x10b71d[0x1])||_[_0x4f68('0xf')](_0x10b71d[0x1])){logger[_0x4f68('0xa')](_0x4f68('0x10'),_0x4d6a60);_0x2e7199['body'][_0x10b71d[0x1]]=_0x492728;}else{logger['info'](_0x4f68('0x11'),_0x4d6a60,_0x10b71d[0x1],_0x492728);_0x2e7199['body'][_0x10b71d[0x1]]=_0x492728;}}_0x2624c4[_0x4f68('0x12')]();});}}catch(_0x329aec){logger[_0x4f68('0x13')](_0x4f68('0x6'),_0x4d6a60,_[_0x4f68('0x14')](_0x329aec)?JSON[_0x4f68('0x15')](_0x329aec):_0x329aec);logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4d6a60);_0x2624c4[_0x4f68('0x12')]();}};}; \ 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 cbab74e..1591e85 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 _0xc110=['join','channel','Interaction','addTags','info','interaction','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','validate','../../rpc/chatInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x3203a1,_0x46c498){var _0x24215e=function(_0x4ffab0){while(--_0x4ffab0){_0x3203a1['push'](_0x3203a1['shift']());}};_0x24215e(++_0x46c498);}(_0xc110,0xf1));var _0x0c11=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc110[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x0c11('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x0c11('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x0c11('0x2')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x0c11('0x3'))(_0x0c11('0x4'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x0c11('0x5')]=function(_0x5187d9,_0x37756f,_0x1d7f8d,_0x223e4b){return function(_0x26c204){try{var _0x30c550={'tag':_0x37756f[0x0]};var _0x5aeea3=tag[_0x0c11('0x0')](_0x30c550,{'typecast':!![]});if(_0x5aeea3[_0x0c11('0x6')]){logger[_0x0c11('0x7')](_0x0c11('0x8'),_0x5187d9,_[_0x0c11('0x9')](_0x5aeea3,_0x0c11('0xa'))[_0x0c11('0xb')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5187d9);_0x26c204['next']();}else{var _0x256fb5={'ids':[_0x37756f[0x0]]};if(rpc[_0x223e4b[_0x0c11('0xc')]+_0x0c11('0xd')]){rpc[_0x223e4b['channel']+'Interaction'][_0x0c11('0xe')](_0x223e4b['interaction']['id'],_0x256fb5)['then'](function(_0x524351){logger[_0x0c11('0xf')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x5187d9,_0x37756f[0x1],_0x223e4b['channel'],_0x223e4b[_0x0c11('0x10')]['id']);})[_0x0c11('0x11')](function(_0x571291){logger['error'](_0x0c11('0x8'),_0x5187d9,JSON['stringify'](_0x571291));logger['info'](_0x0c11('0x12'),_0x5187d9);})[_0x0c11('0x13')](function(){_0x26c204['next']();});}}}catch(_0x573795){logger['error'](_0x0c11('0x8'),_0x5187d9,_['isObject'](_0x573795)?JSON['stringify'](_0x573795):_0x573795);logger['info'](_0x0c11('0x12'),_0x5187d9);_0x26c204[_0x0c11('0x14')]();}};}; \ No newline at end of file +var _0x7518=['error','message','join','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','isObject','validate','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x3fa99e,_0x204f31){var _0x5eeaa5=function(_0x509281){while(--_0x509281){_0x3fa99e['push'](_0x3fa99e['shift']());}};_0x5eeaa5(++_0x204f31);}(_0x7518,0x149));var _0x8751=function(_0x49d5c7,_0x3f77aa){_0x49d5c7=_0x49d5c7-0x0;var _0x2f1f5e=_0x7518[_0x49d5c7];return _0x2f1f5e;};'use strict';var schema=require(_0x8751('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x8751('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8751('0x2')),'whatsappInteraction':require(_0x8751('0x3'))};var logger=require(_0x8751('0x4'))('routing');var tag=schema({'tag':{'type':_0x8751('0x5'),'required':!![],'message':_0x8751('0x6')}});exports['consequence']=function(_0x477050,_0x500113,_0x178447,_0xffad88){return function(_0x10d597){try{var _0x451cb4={'tag':_0x500113[0x0]};var _0x358420=tag[_0x8751('0x0')](_0x451cb4,{'typecast':!![]});if(_0x358420['length']){logger[_0x8751('0x7')]('[%s][TAG]\x20%s',_0x477050,_['map'](_0x358420,_0x8751('0x8'))[_0x8751('0x9')](',\x20'));logger[_0x8751('0xa')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x477050);_0x10d597[_0x8751('0xb')]();}else{var _0x54d715={'ids':[_0x500113[0x0]]};if(rpc[_0xffad88[_0x8751('0xc')]+_0x8751('0xd')]){rpc[_0xffad88[_0x8751('0xc')]+_0x8751('0xd')][_0x8751('0xe')](_0xffad88[_0x8751('0xf')]['id'],_0x54d715)['then'](function(_0xcc1626){logger[_0x8751('0xa')](_0x8751('0x10'),_0x477050,_0x500113[0x1],_0xffad88[_0x8751('0xc')],_0xffad88[_0x8751('0xf')]['id']);})[_0x8751('0x11')](function(_0x38705d){logger[_0x8751('0x7')]('[%s][TAG]\x20%s',_0x477050,JSON[_0x8751('0x12')](_0x38705d));logger[_0x8751('0xa')](_0x8751('0x13'),_0x477050);})['finally'](function(){_0x10d597['next']();});}}}catch(_0x30bc3c){logger['error']('[%s][TAG]\x20%s',_0x477050,_[_0x8751('0x14')](_0x30bc3c)?JSON['stringify'](_0x30bc3c):_0x30bc3c);logger[_0x8751('0xa')](_0x8751('0x13'),_0x477050);_0x10d597['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 1213ad6..40cc9ae 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 _0xbf74=['?params=','urlOnRing','jsonrpc','2.0','login','push','params','stringify','utf8','POST','application/json-rpc','then','result','channelId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','urlOnAnswer'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xbf74,0xd2));var _0x4bf7=function(_0x5507ce,_0xa4a5bf){_0x5507ce=_0x5507ce-0x0;var _0x2840e6=_0xbf74[_0x5507ce];return _0x2840e6;};'use strict';var rp=require(_0x4bf7('0x0'));var logger=require(_0x4bf7('0x1'))('routing');var _=require(_0x4bf7('0x2'));var arr=[];exports[_0x4bf7('0x3')]=function(_0x35113e,_0x594fd4){return function(_0x4bd849){var _0x839c7f=_0x594fd4[0xa];var _0xf5839a=_0x594fd4[0xb];var _0x34a16b=_0x594fd4[0xc];var _0x5574bf=_0x594fd4[0xd];var _0x7384d6=_0x594fd4[0xe];var _0x341f14=_0x594fd4[0xf][_0x4bf7('0x4')](/\n/g,_0x4bf7('0x5'));var _0x30173b=_0x594fd4[0x10][_0x4bf7('0x4')](/\n/g,'\x20');if(!arr['includes'](_0xf5839a)){arr['push'](_0xf5839a);var _0x567e92=_0x594fd4[0x3];var _0x5ac050=_0x594fd4[0x4];var _0x40d24d=_0x594fd4[0x1];var _0x4c75f7=_0x594fd4[0x0];var _0x6b73d3={};_0x6b73d3[_0x4bf7('0x6')]=_0x594fd4[0x8]+_0x4bf7('0x7')+_0x34a16b+'|'+_0x839c7f+'|'+_0x5574bf+'|'+_0xf5839a+'|'+_0x7384d6;_0x6b73d3[_0x4bf7('0x8')]=_0x594fd4[0x7]+_0x4bf7('0x7')+_0x34a16b+'|'+_0x839c7f+'|'+_0x5574bf+'|'+_0xf5839a+'|'+_0x7384d6+'|'+_0x341f14+'|'+_0x30173b;_0x6b73d3['title']=_0x594fd4[0x9];var _0x415f7e={};_0x415f7e[_0x4bf7('0x9')]=_0x4bf7('0xa');_0x415f7e['method']=_0x4bf7('0xb');var _0x184e5a=[];_0x184e5a[_0x4bf7('0xc')](_0x594fd4[0x2]);_0x184e5a[_0x4bf7('0xc')](_0x594fd4[0x5]);_0x184e5a[_0x4bf7('0xc')](_0x594fd4[0x6]);_0x415f7e[_0x4bf7('0xd')]=_0x184e5a;_0x415f7e['id']=0x1;var _0x47ead0=JSON[_0x4bf7('0xe')](_0x415f7e);var _0x30f195={'encoding':_0x4bf7('0xf'),'method':_0x4bf7('0x10'),'timeout':0x2710,'url':_0x567e92,'headers':{'Content-Type':_0x4bf7('0x11')},'body':_0x47ead0};return rp(_0x30f195)[_0x4bf7('0x12')](function(_0x2e053e){const _0x18fce2=JSON['parse'](_0x2e053e);if(!_0x18fce2[_0x4bf7('0x13')]['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x186e19=_0xf5839a;var _0x3cf7ce=_0x4bf7('0x14')+_0x40d24d+'&serviceId='+_0x4c75f7+_0x4bf7('0x15')+_0x186e19+_0x4bf7('0x16')+JSON['stringify'](_0x6b73d3);var _0x3d4289=_0x5ac050+'?'+_0x3cf7ce;return rp(_0x3d4289);})[_0x4bf7('0x12')](function(_0x319470){logger[_0x4bf7('0x17')](_0x4bf7('0x18'),_0x35113e,_0x319470);_0x4bd849[_0x4bf7('0x19')]();})[_0x4bf7('0x1a')](function(_0x43f8cd){logger[_0x4bf7('0x1b')](_0x4bf7('0x1c'),_0x35113e,_[_0x4bf7('0x1d')](_0x43f8cd)?JSON[_0x4bf7('0xe')](_0x43f8cd):_0x43f8cd);_0x4bd849[_0x4bf7('0x19')]();});}else{logger[_0x4bf7('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x35113e);_0x4bd849[_0x4bf7('0x1e')]();}};}; \ No newline at end of file +var _0xf7e1=['stop','catch','error','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','routing','consequence','includes','push','urlOnAnswer','?params=','title','2.0','params','utf8','POST','application/json-rpc','parse','result','logged','&serviceId=','then','info'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0xf7e1,0x1f4));var _0x1f7e=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xf7e1[_0x3070dc];return _0x431489;};'use strict';var rp=require(_0x1f7e('0x0'));var logger=require(_0x1f7e('0x1'))(_0x1f7e('0x2'));var _=require('lodash');var arr=[];exports[_0x1f7e('0x3')]=function(_0x545f4c,_0x4a14d8){return function(_0x12c345){var _0xc28355=_0x4a14d8[0xa];var _0x3a5218=_0x4a14d8[0xb];var _0x260295=_0x4a14d8[0xc];var _0x5e0680=_0x4a14d8[0xd];var _0x375264=_0x4a14d8[0xe];var _0x56938c=_0x4a14d8[0xf]['replace'](/\n/g,'\x20-\x20');var _0xa83988=_0x4a14d8[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x1f7e('0x4')](_0x3a5218)){arr[_0x1f7e('0x5')](_0x3a5218);var _0x55388c=_0x4a14d8[0x3];var _0x1e44b8=_0x4a14d8[0x4];var _0x3d1cd3=_0x4a14d8[0x1];var _0x3bea06=_0x4a14d8[0x0];var _0x34b15f={};_0x34b15f[_0x1f7e('0x6')]=_0x4a14d8[0x8]+_0x1f7e('0x7')+_0x260295+'|'+_0xc28355+'|'+_0x5e0680+'|'+_0x3a5218+'|'+_0x375264;_0x34b15f['urlOnRing']=_0x4a14d8[0x7]+_0x1f7e('0x7')+_0x260295+'|'+_0xc28355+'|'+_0x5e0680+'|'+_0x3a5218+'|'+_0x375264+'|'+_0x56938c+'|'+_0xa83988;_0x34b15f[_0x1f7e('0x8')]=_0x4a14d8[0x9];var _0x179df1={};_0x179df1['jsonrpc']=_0x1f7e('0x9');_0x179df1['method']='login';var _0x30cdc1=[];_0x30cdc1[_0x1f7e('0x5')](_0x4a14d8[0x2]);_0x30cdc1[_0x1f7e('0x5')](_0x4a14d8[0x5]);_0x30cdc1[_0x1f7e('0x5')](_0x4a14d8[0x6]);_0x179df1[_0x1f7e('0xa')]=_0x30cdc1;_0x179df1['id']=0x1;var _0x499adf=JSON['stringify'](_0x179df1);var _0x3b5099={'encoding':_0x1f7e('0xb'),'method':_0x1f7e('0xc'),'timeout':0x2710,'url':_0x55388c,'headers':{'Content-Type':_0x1f7e('0xd')},'body':_0x499adf};return rp(_0x3b5099)['then'](function(_0x4af3db){const _0x119815=JSON[_0x1f7e('0xe')](_0x4af3db);if(!_0x119815[_0x1f7e('0xf')][_0x1f7e('0x10')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x220ee2=_0x3a5218;var _0x1aab05='channelId='+_0x3d1cd3+_0x1f7e('0x11')+_0x3bea06+'&sessionId='+_0x220ee2+'&data='+JSON['stringify'](_0x34b15f);var _0x302125=_0x1e44b8+'?'+_0x1aab05;return rp(_0x302125);})[_0x1f7e('0x12')](function(_0x59cccc){logger[_0x1f7e('0x13')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x545f4c,_0x59cccc);_0x12c345[_0x1f7e('0x14')]();})[_0x1f7e('0x15')](function(_0x537081){logger[_0x1f7e('0x16')](_0x1f7e('0x17'),_0x545f4c,_[_0x1f7e('0x18')](_0x537081)?JSON['stringify'](_0x537081):_0x537081);_0x12c345[_0x1f7e('0x14')]();});}else{logger[_0x1f7e('0x13')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x545f4c);_0x12c345[_0x1f7e('0x19')]();}};}; \ 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 ab365c1..cde652e 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x125c01,_0x57a6d6){var _0x550bc8=function(_0x22272d){while(--_0x22272d){_0x125c01['push'](_0x125c01['shift']());}};_0x550bc8(++_0x57a6d6);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x5dbcc7,_0x23b3b3){var _0x4ab3c3=function(_0x17c235){while(--_0x17c235){_0x5dbcc7['push'](_0x5dbcc7['shift']());}};_0x4ab3c3(++_0x23b3b3);}(_0xe706,0xa3));var _0x6e70=function(_0x47b7c9,_0x3848b2){_0x47b7c9=_0x47b7c9-0x0;var _0x435aaf=_0xe706[_0x47b7c9];return _0x435aaf;};'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 7efd2a9..7776ec1 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 _0x34b2=['Intervals','map','interval','listen','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','channel','mail','push','slice','dialogflow','amazonlex','tag','getMustacheRender','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','matchPath','emit','No\x20applications\x20to\x20execute','stack','agent','agents','busy','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../lib/rule-engine','isNil','IntervalId'];(function(_0x24b440,_0x40c14a){var _0x541811=function(_0x5c4fe1){while(--_0x5c4fe1){_0x24b440['push'](_0x24b440['shift']());}};_0x541811(++_0x40c14a);}(_0x34b2,0x11c));var _0x234b=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0x34b2[_0x135904];return _0x1ce7d5;};'use strict';var _=require(_0x234b('0x0'));var util=require(_0x234b('0x1'));var path=require(_0x234b('0x2'));var fs=require('fs');var jayson=require(_0x234b('0x3'));var BPromise=require(_0x234b('0x4'));var uuid=require(_0x234b('0x5'));var utils=require(_0x234b('0x6'));var config=require(_0x234b('0x7'));var logger=require(_0x234b('0x8'))(_0x234b('0x9'));var rpc={'openchannelQueueReport':require(_0x234b('0xa')),'mailQueueReport':require(_0x234b('0xb')),'chatQueueReport':require(_0x234b('0xc')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x234b('0xd'));function getId(_0x84f1f0,_0x153974,_0x36d33f){return util['format']('%s.%s.%s',_0x84f1f0,_0x153974||0x0,_0x36d33f||0x0);}function getIntervals(_0x1e81b6,_0x3a900b){var _0x277a27=[];if(!_[_0x234b('0xe')](_0x3a900b[_0x234b('0xf')])&&!_[_0x234b('0xe')](_0x1e81b6[_0x3a900b[_0x234b('0xf')]])&&!_[_0x234b('0xe')](_0x1e81b6[_0x3a900b[_0x234b('0xf')]][_0x234b('0x10')])){_0x277a27=_[_0x234b('0x11')](_0x1e81b6[_0x3a900b[_0x234b('0xf')]][_0x234b('0x10')],'interval');}else if(!_[_0x234b('0xe')](_0x3a900b[_0x234b('0x12')])){_0x277a27=[_0x3a900b['interval']];}return _0x277a27;}exports[_0x234b('0x13')]=function(_0x836f55){_0x836f55['rules']={};return new BPromise(function(_0x2623a8,_0x2d1a71){var _0x3ad95a={'Start':function(_0x9d98dd){var _0x2c3b6b=this;return new Promise(function(_0x20d6cb,_0x36564d){if(_0x9d98dd){try{var _0x271214=[];var _0x1fb3d8=getId(_0x9d98dd['channel'],_0x9d98dd[_0x234b('0x14')]?_0x9d98dd[_0x234b('0x14')]['id']:0x0,_0x9d98dd[_0x234b('0x15')]?_0x9d98dd[_0x234b('0x15')]['id']:0x0);if(_0x9d98dd[_0x234b('0x16')]&&_[_0x234b('0x17')](_0x9d98dd[_0x234b('0x16')])&&_0x9d98dd[_0x234b('0x16')][_0x234b('0x18')]){for(var _0x2f2b0f=0x0;_0x2f2b0f<_0x9d98dd['applications'][_0x234b('0x18')];_0x2f2b0f+=0x1){var _0xae1383=_0x9d98dd[_0x234b('0x16')][_0x2f2b0f];if(fs[_0x234b('0x19')](path[_0x234b('0x1a')](__dirname,'applications',_0xae1383[_0x234b('0x1b')]+_0x234b('0x1c')))){var _0x50dfec=[];switch(_0xae1383[_0x234b('0x1b')][_0x234b('0x1d')]()){case _0x234b('0x1e'):var _0x899b1b=_0xae1383[_0x234b('0x1f')][_0x234b('0x20')](',');if(_0x9d98dd[_0x234b('0x21')]===_0x234b('0x22')){_0x50dfec[_0x234b('0x23')](_0x899b1b[0x0]);_0x50dfec[_0x234b('0x23')](_0x899b1b[0x1]);_0x50dfec[_0x234b('0x23')](_0x899b1b['slice'](0x2,_0x899b1b[_0x234b('0x18')])['join'](','));}else{_0x50dfec[_0x234b('0x23')](_0x899b1b[0x0]);_0x50dfec[_0x234b('0x23')](_0x899b1b[_0x234b('0x24')](0x1,_0x899b1b[_0x234b('0x18')])[_0x234b('0x1a')](','));}break;case _0x234b('0x25'):var _0x1d0822=_0xae1383['appdata'][_0x234b('0x20')](',');_0x50dfec[_0x234b('0x23')](_0x1d0822[0x0]);_0x50dfec[_0x234b('0x23')](_0x1d0822[0x1]);_0x50dfec[_0x234b('0x23')](_0x1d0822[_0x234b('0x24')](0x2,_0x1d0822['length'])[_0x234b('0x1a')](','));break;case'dialogflowv2':var _0x439577=_0xae1383[_0x234b('0x1f')][_0x234b('0x20')](',');_0x50dfec['push'](_0x439577[0x0]);_0x50dfec['push'](_0x439577[0x1]);_0x50dfec['push'](_0x439577[0x2]);_0x50dfec[_0x234b('0x23')](_0x439577[0x3]);_0x50dfec['push'](_0x439577[_0x234b('0x24')](0x4,_0x439577[_0x234b('0x18')])[_0x234b('0x1a')](','));break;case _0x234b('0x26'):var _0x505547=_0xae1383['appdata']['split'](',');_0x50dfec[_0x234b('0x23')](_0x505547[0x0]);_0x50dfec[_0x234b('0x23')](_0x505547[0x1]);_0x50dfec[_0x234b('0x23')](_0x505547[0x2]);_0x50dfec['push'](_0x505547[0x3]);_0x50dfec[_0x234b('0x23')](_0x505547[_0x234b('0x24')](0x4,_0x505547[_0x234b('0x18')])[_0x234b('0x1a')](','));break;case _0x234b('0x14'):_0x50dfec[_0x234b('0x23')](_0xae1383[_0x234b('0x1f')]);break;case _0x234b('0x27'):_0x50dfec[_0x234b('0x23')](_0xae1383['TagId']);_0x50dfec[_0x234b('0x23')](_0xae1383[_0x234b('0x1f')]);break;case'tvox':var _0x87fcae=utils[_0x234b('0x28')](_0x9d98dd['account'][_0x234b('0x29')],_0x9d98dd);var _0x3ce7a7=_0xae1383['appdata'][_0x234b('0x20')](',');_0x50dfec[_0x234b('0x23')](_0x3ce7a7[0x0]);_0x50dfec[_0x234b('0x23')](_0x3ce7a7[0x1]);_0x50dfec['push'](_0x3ce7a7[0x2]);_0x50dfec[_0x234b('0x23')](_0x3ce7a7[0x3]);_0x50dfec[_0x234b('0x23')](_0x3ce7a7[0x4]);_0x50dfec['push'](_0x3ce7a7[0x5]);_0x50dfec[_0x234b('0x23')](_0x3ce7a7[0x6]);_0x50dfec['push'](_0x3ce7a7[0x7]);_0x50dfec[_0x234b('0x23')](_0x3ce7a7[0x8]);_0x50dfec['push'](_0x3ce7a7[0x9]);_0x50dfec['push'](_0x3ce7a7[0xa]);_0x50dfec['push'](_0x9d98dd[_0x234b('0x15')]['id']);_0x50dfec[_0x234b('0x23')](_0x9d98dd[_0x234b('0x14')]['id']);_0x50dfec[_0x234b('0x23')](_0xae1383[_0x234b('0x2a')]);_0x50dfec[_0x234b('0x23')](_0x9d98dd[_0x234b('0x15')][_0x234b('0x2b')]);_0x50dfec[_0x234b('0x23')](_0x9d98dd[_0x234b('0x2c')]['body']);_0x50dfec[_0x234b('0x23')](_0x87fcae);break;default:_0x50dfec=_[_0x234b('0xe')](_0xae1383[_0x234b('0x1f')])?[]:_0xae1383['appdata'][_0x234b('0x20')](',');}var _0x4d31fe={'id':util['format'](_0x234b('0x2d'),_0x1fb3d8,_0xae1383['id'],_0xae1383[_0x234b('0x1b')]),'condition':require('./interval')[_0x234b('0x2e')](_0x1fb3d8,getIntervals(_0x836f55[_0x234b('0x2f')],_0xae1383),_0x836f55),'consequence':require(_0x234b('0x30')+_0xae1383[_0x234b('0x1b')])[_0x234b('0x31')](_0x1fb3d8,_0x50dfec,_0x836f55,_0x9d98dd),'p':_0xae1383[_0x234b('0x32')]||0x0};logger[_0x234b('0x33')](_0x234b('0x34'),_0x4d31fe['id'],'on\x20interval',getIntervals(_0x836f55[_0x234b('0x2f')],_0xae1383)[_0x234b('0x1a')](_0x234b('0x35')));_0x271214[_0x234b('0x23')](_0x4d31fe);}else{logger[_0x234b('0x36')](_0x234b('0x37'),path['join'](__dirname,_0x234b('0x16'),_0xae1383[_0x234b('0x1b')]+_0x234b('0x1c')));}}_0x836f55[_0x234b('0x38')][_0x1fb3d8]=new RuleEngine(_0x271214);_0x836f55[_0x234b('0x38')][_0x1fb3d8][_0x234b('0x39')](_0x9d98dd,function(_0x4e2169){logger[_0x234b('0x33')]('Applications\x20executed',JSON['stringify'](_0x4e2169[_0x234b('0x3a')]));if(_0x836f55[_0x234b('0x38')][_0x1fb3d8]){_0x836f55[_0x234b('0x38')][_0x1fb3d8][_0x234b('0x3b')]('complete');}});return _0x20d6cb({'code':0xc8,'message':_0x9d98dd});}else{logger['info'](_0x234b('0x3c'));return _0x20d6cb({'code':0xc8,'message':_0x9d98dd});}}catch(_0x52a95b){logger[_0x234b('0x36')](_0x52a95b[_0x234b('0x3d')]);return _0x36564d(_0x2c3b6b[_0x234b('0x36')](0x1f4,_0x52a95b));}}return _0x36564d('routing\x20is\x20empty');});},'AcceptMessage':function(_0x61d331){var _0x5ef306=this;return new Promise(function(_0x9fdb90,_0x3d803d){if(_0x61d331[_0x234b('0x3e')]&&_0x61d331[_0x234b('0x3e')]['id']){if(_0x836f55['agents'][_0x61d331[_0x234b('0x3e')]['id']]){_0x836f55[_0x234b('0x3f')][_0x61d331[_0x234b('0x3e')]['id']][_0x234b('0x40')]=![];_0x836f55['agents'][_0x61d331['agent']['id']]['busyQueue']=undefined;}}if(_0x61d331['message']&&_0x61d331[_0x234b('0x14')]['id']){try{var _0x1774e1=getId(_0x61d331[_0x234b('0x21')],_0x61d331['message']?_0x61d331['message']['id']:0x0,_0x61d331[_0x234b('0x15')]?_0x61d331[_0x234b('0x15')]['id']:0x0);if(_0x836f55[_0x234b('0x38')][_0x1774e1]){_0x836f55[_0x234b('0x38')][_0x1774e1][_0x234b('0x3b')](_0x234b('0x41'));if(rpc[_0x61d331[_0x234b('0x21')]+_0x234b('0x42')]){rpc[_0x61d331['channel']+_0x234b('0x42')]['update'](_0x1774e1,{'UserId':_0x61d331[_0x234b('0x14')][_0x234b('0x43')]})['catch'](function(_0x5df029){logger[_0x234b('0x36')](_0x234b('0x44'));});}}return _0x9fdb90({'code':0xc8,'message':_0x61d331});}catch(_0x47d267){logger[_0x234b('0x36')](_0x47d267['stack']);return _0x3d803d(_0x5ef306[_0x234b('0x36')](0x1f4,_0x47d267));}}logger[_0x234b('0x36')](_0x234b('0x45'));return _0x3d803d(_0x5ef306['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x18732c){var _0x2fdae6=this;return new Promise(function(_0x54449b,_0x6560d1){if(_0x18732c['agent']&&_0x18732c['agent']['id']){try{if(_0x836f55[_0x234b('0x3f')][_0x18732c[_0x234b('0x3e')]['id']]){_0x836f55[_0x234b('0x3f')][_0x18732c[_0x234b('0x3e')]['id']]['busy']=![];_0x836f55[_0x234b('0x3f')][_0x18732c['agent']['id']]['busyQueue']=undefined;}return _0x54449b({'code':0xc8,'message':_0x18732c});}catch(_0x3e29fb){logger[_0x234b('0x36')](_0x3e29fb[_0x234b('0x3d')]);return _0x6560d1(_0x2fdae6[_0x234b('0x36')](0x1f4,_0x3e29fb));}}logger[_0x234b('0x36')](_0x234b('0x45'));return _0x6560d1(_0x2fdae6['error'](0x1f4,_0x234b('0x45')));});},'AbandonInteraction':function(_0x7ca0de){var _0x1a7aba=this;return new Promise(function(_0x235f01,_0x501d33){if(_0x7ca0de[_0x234b('0x21')]&&_0x7ca0de[_0x234b('0x15')]&&_0x7ca0de[_0x234b('0x15')]['id']){try{var _0x530a2e=getId(_0x7ca0de[_0x234b('0x21')],_0x7ca0de[_0x234b('0x14')]?_0x7ca0de[_0x234b('0x14')]['id']:0x0,_0x7ca0de[_0x234b('0x15')]?_0x7ca0de[_0x234b('0x15')]['id']:0x0);if(_0x836f55[_0x234b('0x38')][_0x530a2e]){_0x836f55['rules'][_0x530a2e][_0x234b('0x3b')](_0x234b('0x41'));}return _0x235f01({'code':0xc8,'message':_0x7ca0de});}catch(_0x2e7b09){logger[_0x234b('0x36')](_0x2e7b09['stack']);return _0x501d33(_0x1a7aba['error'](0x1f4,_0x2e7b09));}}logger[_0x234b('0x36')](_0x234b('0x45'));return _0x501d33(_0x1a7aba[_0x234b('0x36')](0x1f4,_0x234b('0x45')));});},'AgentCapacity':function(_0x55fd9c){var _0x5e1207=this;return new Promise(function(_0xe43832,_0x4e8537){if(_0x836f55[_0x234b('0x3f')]['hasOwnProperty'](_0x55fd9c['id'])){for(var _0x12082c in _0x55fd9c[_0x234b('0x46')]){if(_0x55fd9c[_0x234b('0x46')][_0x234b('0x47')](_0x12082c)){if(_0x836f55[_0x234b('0x3f')][_0x55fd9c['id']][_0x234b('0x47')](_0x12082c+_0x234b('0x48'))){_0x836f55[_0x234b('0x3f')][_0x55fd9c['id']][_0x12082c+_0x234b('0x48')]=parseInt(_0x55fd9c['capacity'][_0x12082c],0xa);}}}_0x836f55[_0x234b('0x3f')][_0x55fd9c['id']][_0x234b('0x49')]();return _0xe43832({'code':0xc8,'message':_0x836f55['agents'][_0x55fd9c['id']]});}else{return _0x4e8537(_0x5e1207[_0x234b('0x36')](0x1f4,_0x234b('0x4a')));}});},'Agents':function(_0x16d04d){return new Promise(function(_0x42446b,_0x1e5008){var _0x31262b=_[_0x234b('0x4b')](_0x836f55[_0x234b('0x3f')]);_0x42446b({'count':_0x31262b[_0x234b('0x18')],'rows':_0x31262b});});},'ChatQueues':function(_0x1d7116){return new Promise(function(_0x3f6f48,_0x13c437){var _0x2aab30=[];for(var _0x471f47 in _0x836f55[_0x234b('0x4c')]){if(_0x836f55['chatQueues'][_0x234b('0x47')](_0x471f47)){var _0x11a4b8=_0x836f55[_0x234b('0x4c')][_0x471f47];var _0x56b4e4={'id':_0x11a4b8['id'],'available':_0x11a4b8[_0x234b('0x4d')],'loggedIn':_0x11a4b8['loggedIn'],'name':_0x11a4b8[_0x234b('0x4e')],'paused':_0x11a4b8[_0x234b('0x4f')],'waiting':_0x11a4b8[_0x234b('0x50')]};_0x2aab30[_0x234b('0x23')](_0x56b4e4);}}_0x3f6f48({'count':_0x2aab30[_0x234b('0x18')],'rows':_0x2aab30});});},'MailQueues':function(_0x19cfb8){return new Promise(function(_0x2c2e00,_0x4bdca0){var _0x565d9d=[];for(var _0x891498 in _0x836f55['mailQueues']){if(_0x836f55[_0x234b('0x51')][_0x234b('0x47')](_0x891498)){var _0x552d2b=_0x836f55[_0x234b('0x51')][_0x891498];var _0x4b2eeb={'id':_0x552d2b['id'],'available':_0x552d2b['available'],'loggedIn':_0x552d2b['loggedIn'],'name':_0x552d2b[_0x234b('0x4e')],'paused':_0x552d2b[_0x234b('0x4f')],'waiting':_0x552d2b['waiting']};_0x565d9d['push'](_0x4b2eeb);}}_0x2c2e00({'count':_0x565d9d['length'],'rows':_0x565d9d});});},'OpenchannelQueues':function(_0xb431ec){return new Promise(function(_0x321472,_0x360425){var _0x1a38e6=[];for(var _0x54603e in _0x836f55[_0x234b('0x52')]){if(_0x836f55[_0x234b('0x52')][_0x234b('0x47')](_0x54603e)){var _0x2a1ff0=_0x836f55['openchannelQueues'][_0x54603e];var _0xdb4b79={'id':_0x2a1ff0['id'],'available':_0x2a1ff0['available'],'loggedIn':_0x2a1ff0[_0x234b('0x53')],'name':_0x2a1ff0[_0x234b('0x4e')],'paused':_0x2a1ff0[_0x234b('0x4f')],'waiting':_0x2a1ff0[_0x234b('0x50')]};_0x1a38e6[_0x234b('0x23')](_0xdb4b79);}}_0x321472({'count':_0x1a38e6[_0x234b('0x18')],'rows':_0x1a38e6});});},'SmsQueues':function(_0x52252b){return new Promise(function(_0x54fd7b,_0x22c2d4){var _0x14a6e9=[];for(var _0x236899 in _0x836f55[_0x234b('0x54')]){if(_0x836f55[_0x234b('0x54')][_0x234b('0x47')](_0x236899)){var _0x973066=_0x836f55[_0x234b('0x54')][_0x236899];var _0x3a83ad={'id':_0x973066['id'],'available':_0x973066[_0x234b('0x4d')],'loggedIn':_0x973066[_0x234b('0x53')],'name':_0x973066[_0x234b('0x4e')],'paused':_0x973066[_0x234b('0x4f')],'waiting':_0x973066[_0x234b('0x50')]};_0x14a6e9[_0x234b('0x23')](_0x3a83ad);}}_0x54fd7b({'count':_0x14a6e9[_0x234b('0x18')],'rows':_0x14a6e9});});},'FaxQueues':function(_0x5f858d){return new Promise(function(_0xf1637b,_0x380b47){var _0x5cd132=[];for(var _0xd64758 in _0x836f55[_0x234b('0x55')]){if(_0x836f55[_0x234b('0x55')][_0x234b('0x47')](_0xd64758)){var _0x5580f7=_0x836f55[_0x234b('0x55')][_0xd64758];var _0x444c8f={'id':_0x5580f7['id'],'available':_0x5580f7[_0x234b('0x4d')],'loggedIn':_0x5580f7[_0x234b('0x53')],'name':_0x5580f7[_0x234b('0x4e')],'paused':_0x5580f7[_0x234b('0x4f')],'waiting':_0x5580f7['waiting']};_0x5cd132['push'](_0x444c8f);}}_0xf1637b({'count':_0x5cd132[_0x234b('0x18')],'rows':_0x5cd132});});},'WhatsappQueues':function(_0x441073){return new Promise(function(_0x3c152a,_0x5f0549){var _0x2bf0a0=[];for(var _0x353152 in _0x836f55[_0x234b('0x56')]){if(_0x836f55[_0x234b('0x56')][_0x234b('0x47')](_0x353152)){var _0x55a5d1=_0x836f55[_0x234b('0x56')][_0x353152];var _0x21605e={'id':_0x55a5d1['id'],'available':_0x55a5d1[_0x234b('0x4d')],'loggedIn':_0x55a5d1[_0x234b('0x53')],'name':_0x55a5d1[_0x234b('0x4e')],'paused':_0x55a5d1[_0x234b('0x4f')],'waiting':_0x55a5d1[_0x234b('0x50')]};_0x2bf0a0['push'](_0x21605e);}}_0x3c152a({'count':_0x2bf0a0[_0x234b('0x18')],'rows':_0x2bf0a0});});},'ChatQueuesWaitingInteractions':function(_0x54d049){return new Promise(function(_0x1eedf8,_0x5f6b8e){var _0x3598d8=_[_0x234b('0x4b')](_0x836f55[_0x234b('0x57')]);_0x1eedf8({'count':_0x3598d8[_0x234b('0x18')],'rows':_0x3598d8});});},'MailQueuesWaitingInteractions':function(_0x2006a1){return new Promise(function(_0x50fe54,_0x495212){var _0x4dd6bb=_[_0x234b('0x4b')](_0x836f55[_0x234b('0x58')]);_0x50fe54({'count':_0x4dd6bb[_0x234b('0x18')],'rows':_0x4dd6bb});});},'OpenchannelQueuesWaitingInteractions':function(_0x5f404f){return new Promise(function(_0x14ff6d,_0x4e87ba){var _0x532da4=_[_0x234b('0x4b')](_0x836f55[_0x234b('0x59')]);_0x14ff6d({'count':_0x532da4[_0x234b('0x18')],'rows':_0x532da4});});},'SmsQueuesWaitingInteractions':function(_0x1cedc0){return new Promise(function(_0x56ecc2,_0x5fbefa){var _0x1cc408=_[_0x234b('0x4b')](_0x836f55[_0x234b('0x5a')]);_0x56ecc2({'count':_0x1cc408[_0x234b('0x18')],'rows':_0x1cc408});});},'FaxQueuesWaitingInteractions':function(_0x5afa8e){return new Promise(function(_0x576374,_0x5030a9){var _0x6a52c2=_[_0x234b('0x4b')](_0x836f55[_0x234b('0x5b')]);_0x576374({'count':_0x6a52c2[_0x234b('0x18')],'rows':_0x6a52c2});});},'WhatsappQueuesWaitingInteractions':function(_0x1c3088){return new Promise(function(_0x395d11,_0x363fc6){var _0x482d28=_[_0x234b('0x4b')](_0x836f55[_0x234b('0x5c')]);_0x395d11({'count':_0x482d28[_0x234b('0x18')],'rows':_0x482d28});});}};var _0x3822ab=jayson[_0x234b('0x5d')](_0x3ad95a)[_0x234b('0x5e')]();_0x3822ab['on'](_0x234b('0x36'),function(_0x54c20f){logger[_0x234b('0x36')](JSON[_0x234b('0x5f')](_0x54c20f));return _0x2d1a71(_0x54c20f);});_0x3822ab[_0x234b('0x13')](0x232c,_0x234b('0x60'),function(){console[_0x234b('0x61')](_0x234b('0x62'),0x232c);return _0x2623a8(_0x234b('0x63')+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(_0x5a9a1d,_0x227e3d){var _0x125479=function(_0x2d57b7){while(--_0x2d57b7){_0x5a9a1d['push'](_0x5a9a1d['shift']());}};_0x125479(++_0x227e3d);}(_0xcffe,0x1a1));var _0xecff=function(_0x580b15,_0x28afa4){_0x580b15=_0x580b15-0x0;var _0x1adb1b=_0xcffe[_0x580b15];return _0x1adb1b;};'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 0b3591e..29faf45 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 _0x0a34=['lodash','../../../config/logger','routing','client','http','request','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','then','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','util','bluebird','jayson/promise'];(function(_0x3de6e3,_0x3107d5){var _0x19fe3f=function(_0x52b640){while(--_0x52b640){_0x3de6e3['push'](_0x3de6e3['shift']());}};_0x19fe3f(++_0x3107d5);}(_0x0a34,0x15d));var _0x40a3=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x0a34[_0x2d34d6];return _0x1d3d12;};'use strict';var util=require(_0x40a3('0x0'));var BPromise=require(_0x40a3('0x1'));var jayson=require(_0x40a3('0x2'));var _=require(_0x40a3('0x3'));var logger=require(_0x40a3('0x4'))(_0x40a3('0x5'));var client=jayson[_0x40a3('0x6')][_0x40a3('0x7')]({'port':0x232a});function request(_0x1eb6fa,_0x18a845){return new BPromise(function(_0x1230fd,_0x51cd81){return client[_0x40a3('0x8')](_0x1eb6fa,_0x18a845)['then'](function(_0x3eba68){if(_0x3eba68[_0x40a3('0x9')]){return _0x51cd81(_0x3eba68[_0x40a3('0x9')][_0x40a3('0xa')]);}else{return _0x1230fd(_0x3eba68[_0x40a3('0xb')]);}})[_0x40a3('0xc')](function(_0x40a227){return _0x51cd81(_0x40a227);});});}exports['condition']=function(_0x2a756b,_0x59235c,_0x975803){return function(_0x3a70f3){if(_0x975803['rules']&&!_0x975803[_0x40a3('0xd')][_0x2a756b]){logger[_0x40a3('0xe')](_0x40a3('0xf'),_0x2a756b);return _0x3a70f3[_0x40a3('0x10')]();}var _0xb1528d=[];for(var _0x6198f1=0x0;_0x6198f1<_0x59235c['length'];_0x6198f1+=0x1){_0xb1528d[_0x40a3('0x11')](request(_0x40a3('0x12'),{'command':util[_0x40a3('0x13')](_0x40a3('0x14'),_0x59235c[_0x6198f1])})['then'](function(_0x432731){return _0x432731&&_0x432731['message']&&_0x432731[_0x40a3('0xa')][_0x40a3('0x15')](_0x40a3('0x16'))>=0x0?!![]:![];})['catch'](function(_0xe66a4e){logger[_0x40a3('0x9')](_0x40a3('0x17'),_0x2a756b,_0x59235c[_0x6198f1]);}));}BPromise[_0x40a3('0x18')](_0xb1528d)[_0x40a3('0x19')](function(_0x37309){var _0x10619b=_[_0x40a3('0x1a')](_0x37309);logger[_0x40a3('0xe')](_0x40a3('0x1b'),_0x2a756b,_0x59235c[_0x40a3('0x1c')]('\x20|\x20'),_0x10619b);_0x3a70f3[_0x40a3('0x1d')](_0x10619b);})['catch'](function(_0x4cf172){console[_0x40a3('0x1e')](_0x4cf172);logger[_0x40a3('0x9')](_0x40a3('0x1b'),_0x2a756b,_0x59235c['join'](_0x40a3('0x1f')),_0x4cf172['stack']);_0x3a70f3[_0x40a3('0x10')]();});};}; \ No newline at end of file +var _0x3972=['util','client','request','then','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','info','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x3972,0x104));var _0x2397=function(_0x2482bd,_0x1e21d0){_0x2482bd=_0x2482bd-0x0;var _0x370cea=_0x3972[_0x2482bd];return _0x370cea;};'use strict';var util=require(_0x2397('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require('../../../config/logger')('routing');var client=jayson[_0x2397('0x1')]['http']({'port':0x232a});function request(_0x1183a0,_0x3a33b1){return new BPromise(function(_0xbc98f9,_0x51b8ca){return client[_0x2397('0x2')](_0x1183a0,_0x3a33b1)[_0x2397('0x3')](function(_0x31283d){if(_0x31283d[_0x2397('0x4')]){return _0x51b8ca(_0x31283d[_0x2397('0x4')][_0x2397('0x5')]);}else{return _0xbc98f9(_0x31283d['result']);}})[_0x2397('0x6')](function(_0x3a4ee4){return _0x51b8ca(_0x3a4ee4);});});}exports[_0x2397('0x7')]=function(_0x3fd75c,_0x40f214,_0x2b6145){return function(_0x3d7737){if(_0x2b6145['rules']&&!_0x2b6145[_0x2397('0x8')][_0x3fd75c]){logger['info'](_0x2397('0x9'),_0x3fd75c);return _0x3d7737[_0x2397('0xa')]();}var _0x533362=[];for(var _0xb7c75d=0x0;_0xb7c75d<_0x40f214['length'];_0xb7c75d+=0x1){_0x533362[_0x2397('0xb')](request('Command',{'command':util[_0x2397('0xc')](_0x2397('0xd'),_0x40f214[_0xb7c75d])})[_0x2397('0x3')](function(_0x169632){return _0x169632&&_0x169632[_0x2397('0x5')]&&_0x169632['message'][_0x2397('0xe')](_0x2397('0xf'))>=0x0?!![]:![];})[_0x2397('0x6')](function(_0x2b4dba){logger['error'](_0x2397('0x10'),_0x3fd75c,_0x40f214[_0xb7c75d]);}));}BPromise[_0x2397('0x11')](_0x533362)[_0x2397('0x3')](function(_0x545b11){var _0x4282e9=_[_0x2397('0x12')](_0x545b11);logger[_0x2397('0x13')]('[%s][INTERVAL]\x20%s\x20%s',_0x3fd75c,_0x40f214[_0x2397('0x14')](_0x2397('0x15')),_0x4282e9);_0x3d7737[_0x2397('0x16')](_0x4282e9);})[_0x2397('0x6')](function(_0x51a94a){console[_0x2397('0x17')](_0x51a94a);logger[_0x2397('0x4')](_0x2397('0x18'),_0x3fd75c,_0x40f214['join'](_0x2397('0x15')),_0x51a94a[_0x2397('0x19')]);_0x3d7737[_0x2397('0xa')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 36bbac2..1dc5c30 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f68=['called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','uniqueid','channel','membername','interface','lastevent','queue','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0x4c8ceb,_0x14c0d2){var _0x49935a=function(_0x11f45b){while(--_0x11f45b){_0x4c8ceb['push'](_0x4c8ceb['shift']());}};_0x49935a(++_0x14c0d2);}(_0x2f68,0x9a));var _0x82f6=function(_0x577371,_0x58ef1e){_0x577371=_0x577371-0x0;var _0x4b1934=_0x2f68[_0x577371];return _0x4b1934;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var utils=require(_0x82f6('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c877,_0x3a9c8f){utils['info'](util[_0x82f6('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x24c877[_0x82f6('0x3')],_0x24c877[_0x82f6('0x4')],_0x24c877['queue'],_0x24c877[_0x82f6('0x5')],_0x24c877[_0x82f6('0x6')],_0x24c877['calleridnum'],_0x24c877['connectedlinenum'],_0x24c877[_0x82f6('0x7')]));if(_0x24c877['queue']){utils['getVoiceQueueByName'](_0x24c877[_0x82f6('0x8')])[_0x82f6('0x9')](function(_0x250d71){if(_0x250d71){_0x24c877['type']=_0x250d71[_0x82f6('0xa')];_0x24c877[_0x82f6('0xb')]=_0x24c877['agentcomplete']?_0x250d71[_0x82f6('0xc')]:![];_0x24c877[_0x82f6('0xd')]=_0x24c877[_0x82f6('0xb')]?_0x250d71[_0x82f6('0xe')]:0x0;}utils[_0x82f6('0xf')](_0x82f6('0x10'),_0x24c877);});}else{utils['request'](_0x82f6('0x10'),_0x24c877);}if(_0x3a9c8f){delete transfers[_0x24c877[_0x82f6('0x3')]];}else{delete agents[_0x24c877['destuniqueid']];}}exports[_0x82f6('0x11')]=function(_0x1f8bf5){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x13'),_0x1f8bf5[_0x82f6('0x3')]),_0x1f8bf5);agents[_0x1f8bf5[_0x82f6('0x14')]]=_0x1f8bf5;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x15')]=utils['now']();agents[_0x1f8bf5[_0x82f6('0x14')]]['lastevent']=_0x82f6('0x16');agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x17')]=null;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x18')]=null;utils[_0x82f6('0x19')](util[_0x82f6('0x2')](_0x82f6('0x1a'),_0x1f8bf5[_0x82f6('0x3')],agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x5')],_0x1f8bf5[_0x82f6('0x14')]));}catch(_0x2652a9){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')]('[%s][agents][agentcalled]',_0x1f8bf5[_0x82f6('0x3')]),_0x2652a9);}};exports[_0x82f6('0x1c')]=function(_0x55cbce){try{if(!_[_0x82f6('0x1d')](agents[_0x55cbce[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')]('[%s][agents][agentringnoanswer]',_0x55cbce[_0x82f6('0x3')]),_0x55cbce);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x1e'),_0x55cbce['uniqueid'],agents[_0x55cbce['destuniqueid']][_0x82f6('0x5')],_0x55cbce[_0x82f6('0x14')]));agents[_0x55cbce['destuniqueid']]['agentringnoanswer']=!![];agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x1f')]=utils['now']();agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x7')]='timeout';agents[_0x55cbce['destuniqueid']][_0x82f6('0x20')]='timeout';agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x21')]=_0x55cbce['ringtime']?parseInt(_0x55cbce[_0x82f6('0x22')])/0x3e8:0x0;agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x23')]=0x0;unanswered[_0x82f6('0x24')](_0x55cbce['destuniqueid']);}}catch(_0x40a071){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x25'),_0x55cbce[_0x82f6('0x3')]),_0x40a071);}};exports[_0x82f6('0x26')]=function(_0x27e473){try{_[_0x82f6('0x27')](agents,function(_0x1e1aa4,_0x402449){if(_0x1e1aa4[_0x82f6('0x3')]==_0x27e473[_0x82f6('0x3')]&&!_[_0x82f6('0x28')](unanswered,_0x1e1aa4[_0x82f6('0x14')])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x27e473);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x2a'),_0x27e473[_0x82f6('0x3')],_0x1e1aa4[_0x82f6('0x5')],_0x1e1aa4[_0x82f6('0x14')]));_0x1e1aa4[_0x82f6('0x1c')]=!![];_0x1e1aa4[_0x82f6('0x1f')]=utils[_0x82f6('0x2b')]();_0x1e1aa4[_0x82f6('0x7')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x20')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x21')]=_0x27e473[_0x82f6('0x21')];_0x1e1aa4['talktime']=0x0;writeDB(_0x1e1aa4);}});}catch(_0x13a409){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x13a409);}};exports[_0x82f6('0x2d')]=function(_0x34c2f1){try{if(agents[_0x34c2f1[_0x82f6('0x14')]]){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x34c2f1);utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34c2f1[_0x82f6('0x3')],agents[_0x34c2f1['destuniqueid']]['membername'],_0x34c2f1[_0x82f6('0x14')]));agents[_0x34c2f1[_0x82f6('0x14')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x17')]=_0x34c2f1['connectedlinenum'];agents[_0x34c2f1[_0x82f6('0x14')]]['connectedlinename']=_0x34c2f1[_0x82f6('0x18')];agents[_0x34c2f1['destuniqueid']][_0x82f6('0x21')]=_0x34c2f1['ringtime'];agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x7')]='connect';_[_0x82f6('0x27')](agents,function(_0x368c11,_0x3e7c53){if(_0x368c11[_0x82f6('0x14')]!=_0x34c2f1['destuniqueid']&&_0x368c11[_0x82f6('0x3')]==_0x34c2f1[_0x82f6('0x3')]){_0x368c11[_0x82f6('0x23')]=0x0;_0x368c11[_0x82f6('0x21')]=_0x34c2f1['ringtime'];_0x368c11[_0x82f6('0x1c')]=!![];_0x368c11[_0x82f6('0x1f')]=utils['now']();_0x368c11[_0x82f6('0x7')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x20')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x30')]=_0x34c2f1['destuniqueid'];_0x368c11[_0x82f6('0x31')]=_0x34c2f1['membername'];writeDB(_0x368c11);}});}}catch(_0x139614){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x139614);}};exports[_0x82f6('0x32')]=function(_0x43fefc){try{if(!_['isNil'](agents[_0x43fefc[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc['uniqueid']),_0x43fefc);utils[_0x82f6('0x19')](util['format'](_0x82f6('0x34'),_0x43fefc[_0x82f6('0x3')],agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x5')],_0x43fefc[_0x82f6('0x14')]));agents[_0x43fefc[_0x82f6('0x14')]]['agentcomplete']=!![];agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')],agents[_0x43fefc['destuniqueid']][_0x82f6('0x37')]);agents[_0x43fefc[_0x82f6('0x14')]]['reason']=_0x43fefc[_0x82f6('0x20')];agents[_0x43fefc['destuniqueid']][_0x82f6('0x7')]='complete';writeDB(agents[_0x43fefc[_0x82f6('0x14')]]);}}catch(_0x31dec7){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc[_0x82f6('0x3')]),_0x31dec7);}};exports['blindtransfer']=function(_0x3cb1f0){try{if(!_[_0x82f6('0x1d')](agents[_0x3cb1f0['transfereruniqueid']])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x38'),_0x3cb1f0[_0x82f6('0x3')]),_0x3cb1f0);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x39'),_0x3cb1f0[_0x82f6('0x3')],agents[_0x3cb1f0[_0x82f6('0x3a')]]['membername'],agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3')]));agents[_0x3cb1f0[_0x82f6('0x3a')]][_0x82f6('0x3b')]=!![];agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3c')]=_0x82f6('0x3d');agents[_0x3cb1f0['transfereruniqueid']]['transferexten']=_0x3cb1f0['extension'];agents[_0x3cb1f0[_0x82f6('0x3a')]]['transferuniqueid']=agents[_0x3cb1f0[_0x82f6('0x3a')]]['uniqueid'];}}catch(_0x33c359){utils['error'](util[_0x82f6('0x2')]('[%s][agents][blindtransfer]',_0x3cb1f0[_0x82f6('0x3')]),_0x33c359);}};exports[_0x82f6('0x3e')]=function(_0x44de65){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x44de65);if(_0x44de65[_0x82f6('0x40')]==_0x44de65[_0x82f6('0x41')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65['secondtransfereruniqueid']])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x43')]]['membername']));agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x43')]]['transfertype']='ATTENDED';agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x45')];agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x40')];}if(_0x44de65[_0x82f6('0x47')]&&agents[_0x44de65[_0x82f6('0x47')]]){agents[_0x44de65[_0x82f6('0x47')]]['agententerreason']=0x1;transfers[_0x44de65[_0x82f6('0x47')]]=_[_0x82f6('0x48')](agents[_0x44de65[_0x82f6('0x47')]]);transfers[_0x44de65[_0x82f6('0x47')]]['calleridnum']=agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x47')]]['calleridname']=agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x47')]]['agentcalledAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x37')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65['transfereeuniqueid']][_0x82f6('0x4b')]=0x2;}}else if(_0x44de65[_0x82f6('0x43')]==_0x44de65[_0x82f6('0x4c')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65[_0x82f6('0x40')]])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x5')]));agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x40')]]['transfertype']=_0x82f6('0x4d');agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x4e')];agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x43')];}if(_0x44de65[_0x82f6('0x4f')]&&agents[_0x44de65['transfertargetuniqueid']]){agents[_0x44de65['transfertargetuniqueid']][_0x82f6('0x4b')]=0x1;transfers[_0x44de65[_0x82f6('0x4f')]]=_['clone'](agents[_0x44de65['transfertargetuniqueid']]);transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x49')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4a')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x15')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4b')]=0x2;}}}catch(_0x4ef838){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x4ef838);}};exports[_0x82f6('0x50')]=function(_0x192dc7){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x192dc7);if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7['uniqueid']][_0x82f6('0x20')]==='timeout'){if(_0x192dc7[_0x82f6('0x52')]==='21'){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=_0x82f6('0x53');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x53');}utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')],agents[_0x192dc7[_0x82f6('0x3')]]['lastevent']));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);var _0x443547=unanswered['indexOf'](_0x192dc7['uniqueid']);if(_0x443547>-0x1){unanswered[_0x82f6('0x54')](_0x443547,0x1);}}if(transfers[_0x192dc7[_0x82f6('0x3')]]){transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x35')]=utils['now']();transfers[_0x192dc7[_0x82f6('0x3')]]['talktime']=utils[_0x82f6('0x36')](transfers[_0x192dc7['uniqueid']][_0x82f6('0x35')],transfers[_0x192dc7['uniqueid']][_0x82f6('0x37')]);transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]='agent';transfers[_0x192dc7[_0x82f6('0x3')]]['lastevent']=_0x82f6('0x55');utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],transfers[_0x192dc7['uniqueid']]['reason'],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]));writeDB(transfers[_0x192dc7[_0x82f6('0x3')]],!![]);}if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];agents[_0x192dc7['uniqueid']][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x192dc7['uniqueid']][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x192dc7[_0x82f6('0x3')]]['agentcompleteAt'],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]);agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=agents[_0x192dc7['uniqueid']][_0x82f6('0x3b')]?_0x82f6('0x3b'):_0x82f6('0x56');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x55');utils['info'](util[_0x82f6('0x2')](_0x82f6('0x57'),_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7['uniqueid']][_0x82f6('0x20')],agents[_0x192dc7['uniqueid']][_0x82f6('0x7')]));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);}}catch(_0x425e33){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x425e33);}}; \ No newline at end of file +var _0x4483=['agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','reason','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfertype','blind','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','transfer','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','transfertargetuniqueid','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentacw'];(function(_0xb3c69f,_0x4d0bbb){var _0x511f2f=function(_0x434bd4){while(--_0x434bd4){_0xb3c69f['push'](_0xb3c69f['shift']());}};_0x511f2f(++_0x4d0bbb);}(_0x4483,0x1a3));var _0x3448=function(_0x5e6e1a,_0x37936e){_0x5e6e1a=_0x5e6e1a-0x0;var _0x361ba5=_0x4483[_0x5e6e1a];return _0x361ba5;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var utils=require(_0x3448('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x481d0c,_0x202d3d){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x5'),_0x481d0c[_0x3448('0x6')],_0x481d0c['channel'],_0x481d0c[_0x3448('0x7')],_0x481d0c[_0x3448('0x8')],_0x481d0c[_0x3448('0x9')],_0x481d0c[_0x3448('0xa')],_0x481d0c[_0x3448('0xb')],_0x481d0c[_0x3448('0xc')]));if(_0x481d0c[_0x3448('0x7')]){utils[_0x3448('0xd')](_0x481d0c['queue'])['then'](function(_0x46b1ee){if(_0x46b1ee){_0x481d0c[_0x3448('0xe')]=_0x46b1ee[_0x3448('0xe')];_0x481d0c[_0x3448('0xf')]=_0x481d0c[_0x3448('0x10')]?_0x46b1ee[_0x3448('0x11')]:![];_0x481d0c[_0x3448('0x12')]=_0x481d0c[_0x3448('0xf')]?_0x46b1ee[_0x3448('0x13')]:0x0;}utils[_0x3448('0x14')](_0x3448('0x15'),_0x481d0c);});}else{utils['request']('CreateVoiceAgentReport',_0x481d0c);}if(_0x202d3d){delete transfers[_0x481d0c[_0x3448('0x6')]];}else{delete agents[_0x481d0c[_0x3448('0x16')]];}}exports['agentcalled']=function(_0x2661e1){try{utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentcalled]',_0x2661e1[_0x3448('0x6')]),_0x2661e1);agents[_0x2661e1[_0x3448('0x16')]]=_0x2661e1;agents[_0x2661e1['destuniqueid']][_0x3448('0x18')]=utils[_0x3448('0x19')]();agents[_0x2661e1[_0x3448('0x16')]]['lastevent']=_0x3448('0x1a');agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0xb')]=null;agents[_0x2661e1[_0x3448('0x16')]][_0x3448('0x1b')]=null;utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x1c'),_0x2661e1['uniqueid'],agents[_0x2661e1[_0x3448('0x16')]]['membername'],_0x2661e1['destuniqueid']));}catch(_0x53f8e7){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x1e'),_0x2661e1['uniqueid']),_0x53f8e7);}};exports[_0x3448('0x1f')]=function(_0x392c8d){try{if(!_[_0x3448('0x20')](agents[_0x392c8d[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][agentringnoanswer]',_0x392c8d['uniqueid']),_0x392c8d);utils['info'](util[_0x3448('0x4')](_0x3448('0x21'),_0x392c8d['uniqueid'],agents[_0x392c8d['destuniqueid']][_0x3448('0x8')],_0x392c8d[_0x3448('0x16')]));agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x1f')]=!![];agents[_0x392c8d[_0x3448('0x16')]]['agentringnoanswerAt']=utils[_0x3448('0x19')]();agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['reason']=_0x3448('0x22');agents[_0x392c8d[_0x3448('0x16')]]['holdtime']=_0x392c8d[_0x3448('0x23')]?parseInt(_0x392c8d[_0x3448('0x23')])/0x3e8:0x0;agents[_0x392c8d[_0x3448('0x16')]][_0x3448('0x24')]=0x0;unanswered[_0x3448('0x25')](_0x392c8d[_0x3448('0x16')]);}}catch(_0x31be64){utils[_0x3448('0x1d')](util['format'](_0x3448('0x26'),_0x392c8d[_0x3448('0x6')]),_0x31be64);}};exports[_0x3448('0x27')]=function(_0x52c09d){try{_[_0x3448('0x28')](agents,function(_0x5dfdf7,_0x486f2c){if(_0x5dfdf7['uniqueid']==_0x52c09d[_0x3448('0x6')]&&!_[_0x3448('0x29')](unanswered,_0x5dfdf7['destuniqueid'])){utils['debug'](util[_0x3448('0x4')](_0x3448('0x2a'),_0x52c09d[_0x3448('0x6')]),_0x52c09d);utils[_0x3448('0x3')](util['format'](_0x3448('0x2b'),_0x52c09d[_0x3448('0x6')],_0x5dfdf7[_0x3448('0x8')],_0x5dfdf7['destuniqueid']));_0x5dfdf7[_0x3448('0x1f')]=!![];_0x5dfdf7[_0x3448('0x2c')]=utils['now']();_0x5dfdf7['lastevent']=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2e')]=_0x3448('0x2d');_0x5dfdf7[_0x3448('0x2f')]=_0x52c09d['holdtime'];_0x5dfdf7[_0x3448('0x24')]=0x0;writeDB(_0x5dfdf7);}});}catch(_0x36291e){utils[_0x3448('0x1d')](util[_0x3448('0x4')]('[%s][agents][queuecallerabandon]',_0x52c09d[_0x3448('0x6')]),_0x36291e);}};exports[_0x3448('0x30')]=function(_0x5ea47c){try{if(agents[_0x5ea47c[_0x3448('0x16')]]){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x5ea47c);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x32'),_0x5ea47c[_0x3448('0x6')],agents[_0x5ea47c['destuniqueid']]['membername'],_0x5ea47c[_0x3448('0x16')]));agents[_0x5ea47c['destuniqueid']][_0x3448('0x33')]=utils[_0x3448('0x19')]();agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xb')]=_0x5ea47c['connectedlinenum'];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x1b')]=_0x5ea47c[_0x3448('0x1b')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];agents[_0x5ea47c[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x34');_['forIn'](agents,function(_0x39b22e,_0x3c92e2){if(_0x39b22e[_0x3448('0x16')]!=_0x5ea47c[_0x3448('0x16')]&&_0x39b22e[_0x3448('0x6')]==_0x5ea47c['uniqueid']){_0x39b22e[_0x3448('0x24')]=0x0;_0x39b22e[_0x3448('0x2f')]=_0x5ea47c[_0x3448('0x23')];_0x39b22e[_0x3448('0x1f')]=!![];_0x39b22e[_0x3448('0x2c')]=utils[_0x3448('0x19')]();_0x39b22e[_0x3448('0xc')]=_0x3448('0x35');_0x39b22e['reason']=_0x3448('0x35');_0x39b22e[_0x3448('0x36')]=_0x5ea47c[_0x3448('0x16')];_0x39b22e['answeredelsewheremembername']=_0x5ea47c[_0x3448('0x8')];writeDB(_0x39b22e);}});}}catch(_0x1d2a7c){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x31'),_0x5ea47c[_0x3448('0x6')]),_0x1d2a7c);}};exports[_0x3448('0x10')]=function(_0x4f54e7){try{if(!_[_0x3448('0x20')](agents[_0x4f54e7[_0x3448('0x16')]])){utils[_0x3448('0x17')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x4f54e7);utils['info'](util[_0x3448('0x4')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x4f54e7['uniqueid'],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x8')],_0x4f54e7['destuniqueid']));agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x10')]=!![];agents[_0x4f54e7['destuniqueid']][_0x3448('0x38')]=utils[_0x3448('0x19')]();agents[_0x4f54e7['destuniqueid']][_0x3448('0x24')]=utils[_0x3448('0x39')](agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x38')],agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0x33')]);agents[_0x4f54e7[_0x3448('0x16')]]['reason']=_0x4f54e7['reason'];agents[_0x4f54e7[_0x3448('0x16')]][_0x3448('0xc')]=_0x3448('0x3a');writeDB(agents[_0x4f54e7[_0x3448('0x16')]]);}}catch(_0x527259){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x37'),_0x4f54e7[_0x3448('0x6')]),_0x527259);}};exports[_0x3448('0x3b')]=function(_0x5d942b){try{if(!_[_0x3448('0x20')](agents[_0x5d942b['transfereruniqueid']])){utils[_0x3448('0x17')](util[_0x3448('0x4')]('[%s][agents][blindtransfer]',_0x5d942b[_0x3448('0x6')]),_0x5d942b);utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x3c'),_0x5d942b[_0x3448('0x6')],agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x8')],agents[_0x5d942b['transfereruniqueid']][_0x3448('0x6')]));agents[_0x5d942b[_0x3448('0x3d')]]['transfer']=!![];agents[_0x5d942b['transfereruniqueid']][_0x3448('0x3e')]=_0x3448('0x3f');agents[_0x5d942b['transfereruniqueid']]['transferexten']=_0x5d942b[_0x3448('0x40')];agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x41')]=agents[_0x5d942b[_0x3448('0x3d')]][_0x3448('0x6')];}}catch(_0x39db50){utils[_0x3448('0x1d')](util['format']('[%s][agents][blindtransfer]',_0x5d942b['uniqueid']),_0x39db50);}};exports[_0x3448('0x42')]=function(_0x3c734a){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x3c734a);if(_0x3c734a[_0x3448('0x44')]==_0x3c734a[_0x3448('0x45')]){if(!_['isNil'](agents[_0x3c734a[_0x3448('0x46')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a[_0x3448('0x44')],agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x8')]));agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x48')]=!![];agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x49')]=_0x3c734a[_0x3448('0x4a')];agents[_0x3c734a[_0x3448('0x46')]][_0x3448('0x41')]=_0x3c734a[_0x3448('0x44')];}if(_0x3c734a['transfereeuniqueid']&&agents[_0x3c734a[_0x3448('0x4b')]]){agents[_0x3c734a['transfereeuniqueid']][_0x3448('0x4c')]=0x1;transfers[_0x3c734a[_0x3448('0x4b')]]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x4b')]]);transfers[_0x3c734a[_0x3448('0x4b')]]['calleridnum']=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4e')]=agents[_0x3c734a['secondtransfereruniqueid']][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x33')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x2f')]=0x0;transfers[_0x3c734a[_0x3448('0x4b')]][_0x3448('0x4c')]=0x2;}}else if(_0x3c734a[_0x3448('0x46')]==_0x3c734a[_0x3448('0x4f')]){if(!_[_0x3448('0x20')](agents[_0x3c734a[_0x3448('0x44')]])){utils[_0x3448('0x3')](util[_0x3448('0x4')](_0x3448('0x47'),_0x3c734a['origtransfereruniqueid'],agents[_0x3c734a[_0x3448('0x44')]]['membername']));agents[_0x3c734a[_0x3448('0x44')]]['transfer']=!![];agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x3e')]='ATTENDED';agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x49')]=_0x3c734a['secondtransfererexten'];agents[_0x3c734a['origtransfereruniqueid']][_0x3448('0x41')]=_0x3c734a['secondtransfereruniqueid'];}if(_0x3c734a['transfertargetuniqueid']&&agents[_0x3c734a[_0x3448('0x50')]]){agents[_0x3c734a[_0x3448('0x50')]]['agententerreason']=0x1;transfers[_0x3c734a['transfertargetuniqueid']]=_[_0x3448('0x4d')](agents[_0x3c734a[_0x3448('0x50')]]);transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0xa')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0xa')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4e')]=agents[_0x3c734a[_0x3448('0x44')]][_0x3448('0x4e')];transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x18')]=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['agentconnectAt']=utils[_0x3448('0x19')]();transfers[_0x3c734a[_0x3448('0x50')]]['holdtime']=0x0;transfers[_0x3c734a[_0x3448('0x50')]][_0x3448('0x4c')]=0x2;}}}catch(_0x543959){utils[_0x3448('0x1d')](util[_0x3448('0x4')](_0x3448('0x43'),_0x3c734a['origtransfereruniqueid']),_0x543959);}};exports['hangup']=function(_0x41d459){try{utils['debug'](util[_0x3448('0x4')](_0x3448('0x51'),_0x41d459[_0x3448('0x6')]),_0x41d459);if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x2e')]===_0x3448('0x22')){if(_0x41d459['cause']==='21'){agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=_0x3448('0x52');agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]=_0x3448('0x52');}utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459['uniqueid'],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]]['lastevent']));writeDB(agents[_0x41d459['uniqueid']]);var _0x188f98=unanswered[_0x3448('0x54')](_0x41d459[_0x3448('0x6')]);if(_0x188f98>-0x1){unanswered[_0x3448('0x55')](_0x188f98,0x1);}}if(transfers[_0x41d459[_0x3448('0x6')]]){transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x10')]=!![];transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')]=utils[_0x3448('0x19')]();transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x24')]=utils[_0x3448('0x39')](transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x38')],transfers[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);transfers[_0x41d459['uniqueid']][_0x3448('0x2e')]='agent';transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]='complete';utils[_0x3448('0x3')](util['format'](_0x3448('0x53'),_0x41d459[_0x3448('0x6')],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0x8')],transfers[_0x41d459[_0x3448('0x6')]]['reason'],transfers[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(transfers[_0x41d459[_0x3448('0x6')]],!![]);}if(agents[_0x41d459['uniqueid']]&&agents[_0x41d459[_0x3448('0x6')]][_0x3448('0x33')]){agents[_0x41d459[_0x3448('0x6')]]['agentcomplete']=!![];agents[_0x41d459[_0x3448('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x41d459[_0x3448('0x6')]]['talktime']=utils[_0x3448('0x39')](agents[_0x41d459['uniqueid']][_0x3448('0x38')],agents[_0x41d459[_0x3448('0x6')]]['agentconnectAt']);agents[_0x41d459['uniqueid']][_0x3448('0x2e')]=agents[_0x41d459[_0x3448('0x6')]]['transfer']?_0x3448('0x48'):_0x3448('0x56');agents[_0x41d459['uniqueid']][_0x3448('0xc')]=_0x3448('0x3a');utils[_0x3448('0x3')](util[_0x3448('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x41d459[_0x3448('0x6')],agents[_0x41d459['uniqueid']][_0x3448('0x8')],agents[_0x41d459['uniqueid']][_0x3448('0x2e')],agents[_0x41d459[_0x3448('0x6')]][_0x3448('0xc')]));writeDB(agents[_0x41d459['uniqueid']]);}}catch(_0x17ebc9){utils[_0x3448('0x1d')](util['format'](_0x3448('0x51'),_0x41d459['uniqueid']),_0x17ebc9);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 96d3321..76668e1 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 _0xc77b=['[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','application','appdata','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','gotoif','toLowerCase','lastapplication','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate'];(function(_0x2f74e4,_0x4385c4){var _0x1498b8=function(_0x25b3b6){while(--_0x25b3b6){_0x2f74e4['push'](_0x2f74e4['shift']());}};_0x1498b8(++_0x4385c4);}(_0xc77b,0x187));var _0xbc77=function(_0x4c1ba7,_0x9ae57c){_0x4c1ba7=_0x4c1ba7-0x0;var _0x586e09=_0xc77b[_0x4c1ba7];return _0x586e09;};'use strict';var _=require(_0xbc77('0x0'));var util=require(_0xbc77('0x1'));var utils=require(_0xbc77('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0xbc77('0x3'),_0xbc77('0x4'),_0xbc77('0x4'),_0xbc77('0x3'),_0xbc77('0x3'),_0xbc77('0x3'),_0xbc77('0x5'),_0xbc77('0x6'),_0xbc77('0x4'),_0xbc77('0x4'),_0xbc77('0x4')];var channels={};function writeDB(_0x2352e2){var _0x22e6c8;if(transfers[_0xbc77('0x7')][_0x2352e2[_0xbc77('0x8')]]){_0x22e6c8=_0x2352e2['uniqueid'];_0x2352e2[_0xbc77('0x8')]=transfers[_0xbc77('0x7')][_0x2352e2['uniqueid']][_0xbc77('0x9')];}utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0xc'),_0x2352e2[_0xbc77('0x8')],_0x2352e2[_0xbc77('0xd')],_0x2352e2[_0xbc77('0xe')],_0x2352e2[_0xbc77('0xf')],_0x2352e2[_0xbc77('0x10')],_0x2352e2[_0xbc77('0x11')],_0x2352e2[_0xbc77('0x12')],_0x2352e2[_0xbc77('0x13')]));if(_0x2352e2['accountcode']){utils['getUserByInternal'](_0x2352e2[_0xbc77('0x14')])['then'](function(_0x12e266){if(_0x12e266){_0x2352e2['UserId']=_0x12e266['id'];}utils[_0xbc77('0x15')]('CreateVoiceCallReport',_0x2352e2);});}else{utils[_0xbc77('0x15')](_0xbc77('0x16'),_0x2352e2);}if(channels[_0x2352e2[_0xbc77('0x8')]]){delete channels[_0x2352e2[_0xbc77('0x8')]];}else if(_0x22e6c8&&channels[_0x22e6c8]){if(!transfers[_0xbc77('0x7')][_0x22e6c8][_0xbc77('0x17')])delete transfers[_0xbc77('0x7')][_0x22e6c8];delete channels[_0x22e6c8];}}exports[_0xbc77('0x18')]=function(_0x510661){try{utils[_0xbc77('0x19')](util[_0xbc77('0xb')](_0xbc77('0x1a'),_0x510661['uniqueid']),_0x510661);if(_0x510661['uniqueid']==_0x510661['linkedid']&&_0x510661[_0xbc77('0xd')]!=_0xbc77('0x1b')){utils['info'](util[_0xbc77('0xb')](_0xbc77('0x1c'),_0x510661[_0xbc77('0x8')],_0x510661[_0xbc77('0x1d')],_0x510661['exten']));channels[_0x510661['uniqueid']]={'uniqueid':_0x510661['uniqueid'],'accountcode':_0x510661['accountcode'],'source':_0x510661['calleridnum'],'destination':_0x510661['exten'],'destinationcontext':_0x510661[_0xbc77('0x1d')],'channel':_0x510661[_0xbc77('0xd')],'starttime':utils[_0xbc77('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xbc77('0x3'),'amaflags':_0xbc77('0x1f')};}}catch(_0x101e92){utils[_0xbc77('0x20')](util[_0xbc77('0xb')]('[%s][calls][newchannel]',_0x510661[_0xbc77('0x8')]),_0x101e92);}};exports[_0xbc77('0x21')]=function(_0x3fcc3e){try{utils[_0xbc77('0x19')](util[_0xbc77('0xb')](_0xbc77('0x22'),_0x3fcc3e[_0xbc77('0x8')]),_0x3fcc3e);if(!_[_0xbc77('0x23')](channels[_0x3fcc3e[_0xbc77('0x8')]])&&_0x3fcc3e[_0xbc77('0x24')]==0x6){utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x25'),_0x3fcc3e['uniqueid'],_0x3fcc3e[_0xbc77('0x1d')],_0x3fcc3e[_0xbc77('0xd')]));if(_['isNil'](channels[_0x3fcc3e['uniqueid']][_0xbc77('0x26')])){channels[_0x3fcc3e['uniqueid']][_0xbc77('0x26')]=utils[_0xbc77('0x1e')]();}}else if(!_['isNil'](channels[_0x3fcc3e[_0xbc77('0x27')]])&&_0x3fcc3e[_0xbc77('0x24')]==0x6&&_0x3fcc3e[_0xbc77('0x1d')]!=_0xbc77('0x28')){utils['info'](util[_0xbc77('0xb')](_0xbc77('0x29'),_0x3fcc3e['uniqueid'],_0x3fcc3e['linkedid'],_0x3fcc3e[_0xbc77('0x1d')],_0x3fcc3e['channel']));channels[_0x3fcc3e[_0xbc77('0x27')]][_0xbc77('0x14')]=_0x3fcc3e[_0xbc77('0x14')];channels[_0x3fcc3e['linkedid']][_0xbc77('0x2a')]=_0x3fcc3e[_0xbc77('0xd')];if(_[_0xbc77('0x23')](channels[_0x3fcc3e['linkedid']][_0xbc77('0x2b')])){channels[_0x3fcc3e[_0xbc77('0x27')]][_0xbc77('0x2b')]=utils['now']();}channels[_0x3fcc3e[_0xbc77('0x27')]]['disposition']=dispositions[_['toNumber'](_0x3fcc3e[_0xbc77('0x24')])]||_0xbc77('0x5');}}catch(_0x11229f){utils[_0xbc77('0x20')](util[_0xbc77('0xb')](_0xbc77('0x22'),_0x3fcc3e['uniqueid']),_0x11229f);}};exports[_0xbc77('0x2c')]=function(_0x5bee0d){try{if(!_['isNil'](channels[_0x5bee0d['uniqueid']])){utils['debug'](util[_0xbc77('0xb')]('[%s][calls][hangup]',_0x5bee0d['uniqueid']),_0x5bee0d);if(_[_0xbc77('0x23')](channels[_0x5bee0d[_0xbc77('0x8')]][_0xbc77('0x2d')])){channels[_0x5bee0d['uniqueid']]['callerid']=_0x5bee0d[_0xbc77('0x2e')]+'\x20<'+_0x5bee0d[_0xbc77('0x11')]+'>';}utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x2f'),_0x5bee0d[_0xbc77('0x8')],channels[_0x5bee0d[_0xbc77('0x8')]][_0xbc77('0x2d')],_0x5bee0d[_0xbc77('0x30')]));channels[_0x5bee0d['uniqueid']]['endtime']=utils['now']();channels[_0x5bee0d[_0xbc77('0x8')]][_0xbc77('0x31')]=utils[_0xbc77('0x32')](channels[_0x5bee0d['uniqueid']][_0xbc77('0x33')],channels[_0x5bee0d[_0xbc77('0x8')]][_0xbc77('0x34')]);channels[_0x5bee0d[_0xbc77('0x8')]][_0xbc77('0x35')]=channels[_0x5bee0d[_0xbc77('0x8')]][_0xbc77('0x2b')]?utils[_0xbc77('0x32')](channels[_0x5bee0d['uniqueid']][_0xbc77('0x33')],channels[_0x5bee0d['uniqueid']]['answertime']):0x0;writeDB(channels[_0x5bee0d[_0xbc77('0x8')]]);}}catch(_0xfa43dd){utils[_0xbc77('0x20')](util['format']('[%s][calls][hangup]',_0x5bee0d[_0xbc77('0x8')]),_0xfa43dd);}};exports[_0xbc77('0x36')]=function(_0x467813){try{if(!_[_0xbc77('0x23')](channels[_0x467813[_0xbc77('0x37')]])){utils[_0xbc77('0x19')](util[_0xbc77('0xb')](_0xbc77('0x38'),_0x467813['origtransfereruniqueid']),_0x467813);if(channels[_0x467813[_0xbc77('0x37')]][_0xbc77('0xd')]==_0x467813['transfereechannel']){utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x39'),_0x467813[_0xbc77('0x3a')],_0x467813[_0xbc77('0x37')],_0x467813[_0xbc77('0x3b')]));channels[_0x467813['localtwolinkedid']]['destinationchannel']=_0x467813[_0xbc77('0x3b')];channels[_0x467813[_0xbc77('0x37')]][_0xbc77('0x3c')]=_0xbc77('0x3d');}else if(channels[_0x467813[_0xbc77('0x37')]][_0xbc77('0xd')]=_0x467813['transfertargetchannel']){utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x39'),_0x467813[_0xbc77('0x3a')],_0x467813[_0xbc77('0x37')],_0x467813['origtransfererchannel']));channels[_0x467813[_0xbc77('0x37')]][_0xbc77('0x2a')]=_0x467813[_0xbc77('0x3e')];channels[_0x467813['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x3975fa){utils[_0xbc77('0x20')](util[_0xbc77('0xb')](_0xbc77('0x38'),_0x467813[_0xbc77('0x3a')]),_0x3975fa);}};exports[_0xbc77('0x3f')]=function(_0x2408ec){try{if(!_[_0xbc77('0x23')](channels[_0x2408ec[_0xbc77('0x8')]])){utils['debug'](util[_0xbc77('0xb')](_0xbc77('0x40'),_0x2408ec[_0xbc77('0x8')]),_0x2408ec);channels[_0x2408ec[_0xbc77('0x8')]][_0xbc77('0x41')]=utils[_0xbc77('0x1e')]();utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x42'),_0x2408ec[_0xbc77('0x8')],channels[_0x2408ec['uniqueid']][_0xbc77('0x41')]));}}catch(_0xd62aa0){utils[_0xbc77('0x20')](util['format']('[%s][calls][musiconholdstart]',_0x2408ec[_0xbc77('0x8')]),_0xd62aa0);}};exports[_0xbc77('0x43')]=function(_0x5ca74b){try{if(!_[_0xbc77('0x23')](channels[_0x5ca74b[_0xbc77('0x8')]])){utils[_0xbc77('0x19')](util['format'](_0xbc77('0x44'),_0x5ca74b[_0xbc77('0x8')]),_0x5ca74b);if(!_['isNil'](channels[_0x5ca74b['uniqueid']][_0xbc77('0x41')])){channels[_0x5ca74b[_0xbc77('0x8')]][_0xbc77('0x45')]+=utils[_0xbc77('0x32')](utils[_0xbc77('0x1e')](),channels[_0x5ca74b['uniqueid']][_0xbc77('0x41')]);utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x46'),_0x5ca74b[_0xbc77('0x8')],channels[_0x5ca74b[_0xbc77('0x8')]][_0xbc77('0x45')]));delete channels[_0x5ca74b[_0xbc77('0x8')]][_0xbc77('0x41')];}}}catch(_0x38d9eb){utils[_0xbc77('0x20')](util['format'](_0xbc77('0x44'),_0x5ca74b[_0xbc77('0x8')]),_0x38d9eb);}};exports['varset']=function(_0x1e9283){try{if(!_['isNil'](channels[_0x1e9283[_0xbc77('0x8')]])){utils['debug'](util[_0xbc77('0xb')]('[%s][calls][varset]',_0x1e9283[_0xbc77('0x8')]),_0x1e9283);if(!_['isNil'](_0x1e9283['variable'][_0xbc77('0x47')])){utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x48'),_0x1e9283[_0xbc77('0x8')],_0x1e9283[_0xbc77('0x49')]));channels[_0x1e9283['uniqueid']]['source']=_0x1e9283[_0xbc77('0x49')];}if(!_[_0xbc77('0x23')](_0x1e9283['variable']['xmd-phone'])){utils[_0xbc77('0xa')](util['format'](_0xbc77('0x4a'),_0x1e9283['uniqueid'],_0x1e9283[_0xbc77('0x49')]));channels[_0x1e9283[_0xbc77('0x8')]][_0xbc77('0x4b')]=_0x1e9283[_0xbc77('0x49')];channels[_0x1e9283[_0xbc77('0x8')]][_0xbc77('0x2d')]='\x22'+_0x1e9283[_0xbc77('0x49')]+_0xbc77('0x4c')+_0x1e9283[_0xbc77('0x49')]+'>';}if(!_['isNil'](_0x1e9283[_0xbc77('0x4d')][_0xbc77('0x4e')])||!_[_0xbc77('0x23')](_0x1e9283['variable'][_0xbc77('0x4f')])){utils['info'](util[_0xbc77('0xb')](_0xbc77('0x50'),_0x1e9283['uniqueid'],!_[_0xbc77('0x23')](_0x1e9283['variable']['xmd-callerid-preview'])?_0xbc77('0x4e'):'xmd-callerid',_0x1e9283[_0xbc77('0x49')]));channels[_0x1e9283[_0xbc77('0x8')]][_0xbc77('0x2d')]=_0x1e9283[_0xbc77('0x49')];}if(!_[_0xbc77('0x23')](_0x1e9283[_0xbc77('0x4d')]['xmd-queue'])||!_[_0xbc77('0x23')](_0x1e9283[_0xbc77('0x4d')]['xmcs-queue'])){utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x50'),_0x1e9283[_0xbc77('0x8')],!_[_0xbc77('0x23')](_0x1e9283[_0xbc77('0x4d')][_0xbc77('0x51')])?_0xbc77('0x51'):'xmcs-queue',_0x1e9283[_0xbc77('0x49')]));channels[_0x1e9283[_0xbc77('0x8')]]['lastapplication']='Queue';channels[_0x1e9283['uniqueid']][_0xbc77('0x52')]=_0x1e9283[_0xbc77('0x49')];channels[_0x1e9283[_0xbc77('0x8')]][_0xbc77('0xe')]=!![];}if(!_[_0xbc77('0x23')](_0x1e9283[_0xbc77('0x4d')]['xmd-contactid'])){utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x53'),_0x1e9283[_0xbc77('0x8')],_0x1e9283['value']));channels[_0x1e9283[_0xbc77('0x8')]][_0xbc77('0x54')]=_0x1e9283['value'];}if(!_[_0xbc77('0x23')](_0x1e9283[_0xbc77('0x4d')][_0xbc77('0x55')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1e9283['uniqueid'],_0x1e9283[_0xbc77('0x49')]));channels[_0x1e9283[_0xbc77('0x8')]][_0xbc77('0x56')]=_0x1e9283['value'];}if(!_[_0xbc77('0x23')](_0x1e9283[_0xbc77('0x4d')]['outboundrouteid'])){utils[_0xbc77('0xa')](util[_0xbc77('0xb')](_0xbc77('0x57'),_0x1e9283[_0xbc77('0x8')],_0x1e9283[_0xbc77('0x49')]));channels[_0x1e9283[_0xbc77('0x8')]][_0xbc77('0x58')]=_0x1e9283['value'];}if(!_[_0xbc77('0x23')](_0x1e9283[_0xbc77('0x4d')][_0xbc77('0x59')])){utils['info'](util[_0xbc77('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1e9283[_0xbc77('0x8')],_0x1e9283['value']));channels[_0x1e9283[_0xbc77('0x8')]]['sipcallid']=_0x1e9283[_0xbc77('0x49')];}}}catch(_0xf72169){utils[_0xbc77('0x20')](util['format'](_0xbc77('0x5a'),_0x1e9283[_0xbc77('0x8')]),_0xf72169);}};exports[_0xbc77('0x5b')]=function(_0x10842b){try{if(!_['isNil'](channels[_0x10842b[_0xbc77('0x8')]])){utils[_0xbc77('0x19')](util['format'](_0xbc77('0x5c'),_0x10842b[_0xbc77('0x8')]),_0x10842b);utils['info'](util[_0xbc77('0xb')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x10842b[_0xbc77('0x8')],_0x10842b[_0xbc77('0x5d')],_0x10842b[_0xbc77('0x5e')]));if(_0x10842b[_0xbc77('0x5d')]['toLowerCase']()==_0xbc77('0x5f')&&_[_0xbc77('0x60')](_0x10842b['appdata']['toLowerCase'](),_0xbc77('0x61'))){var _0x383c86=_0x10842b[_0xbc77('0x5e')][_0xbc77('0x62')]('=');var _0x41cbf0=_0x383c86[0x0][_0xbc77('0x63')](_0x383c86[0x0][_0xbc77('0x64')]('(')+0x1,_0x383c86[0x0]['lastIndexOf'](')'));var _0x42c9ed=_0x383c86[0x1];channels[_0x10842b['uniqueid']][_0x41cbf0]=_0x42c9ed;}if(!_[_0xbc77('0x65')]([_0xbc77('0x2c'),_0xbc77('0x66'),_0xbc77('0x67'),_0xbc77('0x5f'),_0xbc77('0x68')],_0x10842b[_0xbc77('0x5d')][_0xbc77('0x69')]())){channels[_0x10842b[_0xbc77('0x8')]][_0xbc77('0x6a')]=_0x10842b[_0xbc77('0x5d')];channels[_0x10842b[_0xbc77('0x8')]][_0xbc77('0x52')]=_0x10842b[_0xbc77('0x5e')];}}}catch(_0x1775dc){utils['error'](util[_0xbc77('0xb')]('[%s][calls][newexten]',_0x10842b[_0xbc77('0x8')]),_0x1775dc);}}; \ No newline at end of file +var _0xa9c7=['application','appdata','toLowerCase','set','startsWith','substring','includes','noop','execif','gotoif','lodash','./transfers.controller','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','starttime','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','_attended','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstop]','mohtime','diffTime','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','xmd-phone','value','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s'];(function(_0x3a75ec,_0x3bccd3){var _0x1eb902=function(_0x1c7c0f){while(--_0x1c7c0f){_0x3a75ec['push'](_0x3a75ec['shift']());}};_0x1eb902(++_0x3bccd3);}(_0xa9c7,0x148));var _0x7a9c=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0xa9c7[_0x1034bb];return _0x453fdb;};'use strict';var _=require(_0x7a9c('0x0'));var util=require('util');var utils=require('./utils');var transfers=require(_0x7a9c('0x1'));var dispositions=['NO\x20ANSWER',_0x7a9c('0x2'),'FAILED',_0x7a9c('0x3'),'NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0x7a9c('0x4'),_0x7a9c('0x2'),_0x7a9c('0x2'),_0x7a9c('0x2')];var channels={};function writeDB(_0x3a0458){var _0x91f4c3;if(transfers[_0x7a9c('0x5')][_0x3a0458[_0x7a9c('0x6')]]){_0x91f4c3=_0x3a0458[_0x7a9c('0x6')];_0x3a0458['uniqueid']=transfers['blinds'][_0x3a0458[_0x7a9c('0x6')]][_0x7a9c('0x7')];}utils['info'](util[_0x7a9c('0x8')](_0x7a9c('0x9'),_0x3a0458[_0x7a9c('0x6')],_0x3a0458[_0x7a9c('0xa')],_0x3a0458[_0x7a9c('0xb')],_0x3a0458['membername'],_0x3a0458[_0x7a9c('0xc')],_0x3a0458[_0x7a9c('0xd')],_0x3a0458[_0x7a9c('0xe')],_0x3a0458[_0x7a9c('0xf')]));if(_0x3a0458[_0x7a9c('0x10')]){utils[_0x7a9c('0x11')](_0x3a0458[_0x7a9c('0x10')])[_0x7a9c('0x12')](function(_0x48dc10){if(_0x48dc10){_0x3a0458[_0x7a9c('0x13')]=_0x48dc10['id'];}utils[_0x7a9c('0x14')](_0x7a9c('0x15'),_0x3a0458);});}else{utils['request'](_0x7a9c('0x15'),_0x3a0458);}if(channels[_0x3a0458[_0x7a9c('0x6')]]){delete channels[_0x3a0458[_0x7a9c('0x6')]];}else if(_0x91f4c3&&channels[_0x91f4c3]){if(!transfers[_0x7a9c('0x5')][_0x91f4c3][_0x7a9c('0x16')])delete transfers[_0x7a9c('0x5')][_0x91f4c3];delete channels[_0x91f4c3];}}exports[_0x7a9c('0x17')]=function(_0x18f04d){try{utils[_0x7a9c('0x18')](util[_0x7a9c('0x8')](_0x7a9c('0x19'),_0x18f04d[_0x7a9c('0x6')]),_0x18f04d);if(_0x18f04d[_0x7a9c('0x6')]==_0x18f04d[_0x7a9c('0x1a')]&&_0x18f04d[_0x7a9c('0xa')]!='OutgoingSpoolFailed'){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')](_0x7a9c('0x1c'),_0x18f04d[_0x7a9c('0x6')],_0x18f04d[_0x7a9c('0x1d')],_0x18f04d['exten']));channels[_0x18f04d[_0x7a9c('0x6')]]={'uniqueid':_0x18f04d[_0x7a9c('0x6')],'accountcode':_0x18f04d['accountcode'],'source':_0x18f04d[_0x7a9c('0xd')],'destination':_0x18f04d[_0x7a9c('0x1e')],'destinationcontext':_0x18f04d[_0x7a9c('0x1d')],'channel':_0x18f04d[_0x7a9c('0xa')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7a9c('0x3'),'amaflags':_0x7a9c('0x1f')};}}catch(_0x453539){utils[_0x7a9c('0x20')](util[_0x7a9c('0x8')](_0x7a9c('0x19'),_0x18f04d[_0x7a9c('0x6')]),_0x453539);}};exports[_0x7a9c('0x21')]=function(_0xfc3345){try{utils[_0x7a9c('0x18')](util[_0x7a9c('0x8')](_0x7a9c('0x22'),_0xfc3345[_0x7a9c('0x6')]),_0xfc3345);if(!_['isNil'](channels[_0xfc3345[_0x7a9c('0x6')]])&&_0xfc3345[_0x7a9c('0x23')]==0x6){utils['info'](util[_0x7a9c('0x8')](_0x7a9c('0x24'),_0xfc3345[_0x7a9c('0x6')],_0xfc3345['context'],_0xfc3345['channel']));if(_[_0x7a9c('0x25')](channels[_0xfc3345[_0x7a9c('0x6')]][_0x7a9c('0x26')])){channels[_0xfc3345[_0x7a9c('0x6')]]['systemanswertime']=utils[_0x7a9c('0x27')]();}}else if(!_[_0x7a9c('0x25')](channels[_0xfc3345[_0x7a9c('0x1a')]])&&_0xfc3345[_0x7a9c('0x23')]==0x6&&_0xfc3345[_0x7a9c('0x1d')]!=_0x7a9c('0x28')){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')](_0x7a9c('0x29'),_0xfc3345['uniqueid'],_0xfc3345[_0x7a9c('0x1a')],_0xfc3345[_0x7a9c('0x1d')],_0xfc3345[_0x7a9c('0xa')]));channels[_0xfc3345[_0x7a9c('0x1a')]]['accountcode']=_0xfc3345[_0x7a9c('0x10')];channels[_0xfc3345[_0x7a9c('0x1a')]][_0x7a9c('0x2a')]=_0xfc3345[_0x7a9c('0xa')];if(_[_0x7a9c('0x25')](channels[_0xfc3345['linkedid']]['answertime'])){channels[_0xfc3345[_0x7a9c('0x1a')]][_0x7a9c('0x2b')]=utils[_0x7a9c('0x27')]();}channels[_0xfc3345[_0x7a9c('0x1a')]]['disposition']=dispositions[_[_0x7a9c('0x2c')](_0xfc3345[_0x7a9c('0x23')])]||_0x7a9c('0x2d');}}catch(_0x1145c9){utils['error'](util[_0x7a9c('0x8')](_0x7a9c('0x22'),_0xfc3345[_0x7a9c('0x6')]),_0x1145c9);}};exports[_0x7a9c('0x2e')]=function(_0x4dafdc){try{if(!_[_0x7a9c('0x25')](channels[_0x4dafdc[_0x7a9c('0x6')]])){utils[_0x7a9c('0x18')](util['format'](_0x7a9c('0x2f'),_0x4dafdc[_0x7a9c('0x6')]),_0x4dafdc);if(_[_0x7a9c('0x25')](channels[_0x4dafdc[_0x7a9c('0x6')]][_0x7a9c('0x30')])){channels[_0x4dafdc[_0x7a9c('0x6')]][_0x7a9c('0x30')]=_0x4dafdc[_0x7a9c('0x31')]+'\x20<'+_0x4dafdc[_0x7a9c('0xd')]+'>';}utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x4dafdc['uniqueid'],channels[_0x4dafdc['uniqueid']][_0x7a9c('0x30')],_0x4dafdc[_0x7a9c('0x32')]));channels[_0x4dafdc[_0x7a9c('0x6')]][_0x7a9c('0x33')]=utils[_0x7a9c('0x27')]();channels[_0x4dafdc[_0x7a9c('0x6')]][_0x7a9c('0x34')]=utils['diffTime'](channels[_0x4dafdc[_0x7a9c('0x6')]][_0x7a9c('0x33')],channels[_0x4dafdc[_0x7a9c('0x6')]][_0x7a9c('0x35')]);channels[_0x4dafdc[_0x7a9c('0x6')]]['billableseconds']=channels[_0x4dafdc[_0x7a9c('0x6')]]['answertime']?utils['diffTime'](channels[_0x4dafdc[_0x7a9c('0x6')]][_0x7a9c('0x33')],channels[_0x4dafdc[_0x7a9c('0x6')]]['answertime']):0x0;writeDB(channels[_0x4dafdc[_0x7a9c('0x6')]]);}}catch(_0xe54310){utils[_0x7a9c('0x20')](util[_0x7a9c('0x8')]('[%s][calls][hangup]',_0x4dafdc[_0x7a9c('0x6')]),_0xe54310);}};exports[_0x7a9c('0x36')]=function(_0x39a936){try{if(!_[_0x7a9c('0x25')](channels[_0x39a936[_0x7a9c('0x37')]])){utils[_0x7a9c('0x18')](util[_0x7a9c('0x8')](_0x7a9c('0x38'),_0x39a936[_0x7a9c('0x39')]),_0x39a936);if(channels[_0x39a936[_0x7a9c('0x37')]]['channel']==_0x39a936[_0x7a9c('0x3a')]){utils[_0x7a9c('0x1b')](util['format'](_0x7a9c('0x3b'),_0x39a936['origtransfereruniqueid'],_0x39a936[_0x7a9c('0x37')],_0x39a936[_0x7a9c('0x3c')]));channels[_0x39a936[_0x7a9c('0x37')]][_0x7a9c('0x2a')]=_0x39a936['secondtransfererchannel'];channels[_0x39a936['localtwolinkedid']]['userfield']='_attended';}else if(channels[_0x39a936[_0x7a9c('0x37')]][_0x7a9c('0xa')]=_0x39a936[_0x7a9c('0x3d')]){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')](_0x7a9c('0x3b'),_0x39a936[_0x7a9c('0x39')],_0x39a936[_0x7a9c('0x37')],_0x39a936[_0x7a9c('0x3e')]));channels[_0x39a936[_0x7a9c('0x37')]][_0x7a9c('0x2a')]=_0x39a936[_0x7a9c('0x3e')];channels[_0x39a936['localtwolinkedid']]['userfield']=_0x7a9c('0x3f');}}}catch(_0x168ad5){utils[_0x7a9c('0x20')](util[_0x7a9c('0x8')]('[%s][calls][attendedtransfer]',_0x39a936[_0x7a9c('0x39')]),_0x168ad5);}};exports['musiconholdstart']=function(_0x5a33a0){try{if(!_[_0x7a9c('0x25')](channels[_0x5a33a0[_0x7a9c('0x6')]])){utils[_0x7a9c('0x18')](util[_0x7a9c('0x8')]('[%s][calls][musiconholdstart]',_0x5a33a0[_0x7a9c('0x6')]),_0x5a33a0);channels[_0x5a33a0[_0x7a9c('0x6')]][_0x7a9c('0x40')]=utils[_0x7a9c('0x27')]();utils['info'](util[_0x7a9c('0x8')](_0x7a9c('0x41'),_0x5a33a0['uniqueid'],channels[_0x5a33a0[_0x7a9c('0x6')]][_0x7a9c('0x40')]));}}catch(_0x11fc48){utils['error'](util['format'](_0x7a9c('0x42'),_0x5a33a0[_0x7a9c('0x6')]),_0x11fc48);}};exports['musiconholdstop']=function(_0x2bd5c7){try{if(!_[_0x7a9c('0x25')](channels[_0x2bd5c7[_0x7a9c('0x6')]])){utils[_0x7a9c('0x18')](util['format'](_0x7a9c('0x43'),_0x2bd5c7[_0x7a9c('0x6')]),_0x2bd5c7);if(!_[_0x7a9c('0x25')](channels[_0x2bd5c7[_0x7a9c('0x6')]][_0x7a9c('0x40')])){channels[_0x2bd5c7['uniqueid']][_0x7a9c('0x44')]+=utils[_0x7a9c('0x45')](utils[_0x7a9c('0x27')](),channels[_0x2bd5c7[_0x7a9c('0x6')]][_0x7a9c('0x40')]);utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x2bd5c7[_0x7a9c('0x6')],channels[_0x2bd5c7[_0x7a9c('0x6')]][_0x7a9c('0x44')]));delete channels[_0x2bd5c7[_0x7a9c('0x6')]][_0x7a9c('0x40')];}}}catch(_0x12eb2b){utils[_0x7a9c('0x20')](util[_0x7a9c('0x8')](_0x7a9c('0x43'),_0x2bd5c7['uniqueid']),_0x12eb2b);}};exports['varset']=function(_0x2c29bb){try{if(!_[_0x7a9c('0x25')](channels[_0x2c29bb['uniqueid']])){utils[_0x7a9c('0x18')](util['format'](_0x7a9c('0x46'),_0x2c29bb[_0x7a9c('0x6')]),_0x2c29bb);if(!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x48')])){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')](_0x7a9c('0x49'),_0x2c29bb['uniqueid'],_0x2c29bb['value']));channels[_0x2c29bb[_0x7a9c('0x6')]][_0x7a9c('0x4a')]=_0x2c29bb['value'];}if(!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x4b')])){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x2c29bb[_0x7a9c('0x6')],_0x2c29bb[_0x7a9c('0x4c')]));channels[_0x2c29bb[_0x7a9c('0x6')]][_0x7a9c('0x4d')]=_0x2c29bb['value'];channels[_0x2c29bb[_0x7a9c('0x6')]]['callerid']='\x22'+_0x2c29bb[_0x7a9c('0x4c')]+_0x7a9c('0x4e')+_0x2c29bb[_0x7a9c('0x4c')]+'>';}if(!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x4f')])||!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x50')])){utils['info'](util[_0x7a9c('0x8')](_0x7a9c('0x51'),_0x2c29bb[_0x7a9c('0x6')],!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x4f')])?_0x7a9c('0x4f'):_0x7a9c('0x50'),_0x2c29bb[_0x7a9c('0x4c')]));channels[_0x2c29bb[_0x7a9c('0x6')]][_0x7a9c('0x30')]=_0x2c29bb[_0x7a9c('0x4c')];}if(!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x52')])||!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')]['xmcs-queue'])){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x2c29bb[_0x7a9c('0x6')],!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x52')])?_0x7a9c('0x52'):'xmcs-queue',_0x2c29bb[_0x7a9c('0x4c')]));channels[_0x2c29bb[_0x7a9c('0x6')]]['lastapplication']=_0x7a9c('0x53');channels[_0x2c29bb['uniqueid']][_0x7a9c('0x54')]=_0x2c29bb[_0x7a9c('0x4c')];channels[_0x2c29bb[_0x7a9c('0x6')]][_0x7a9c('0xb')]=!![];}if(!_[_0x7a9c('0x25')](_0x2c29bb['variable'][_0x7a9c('0x55')])){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')](_0x7a9c('0x56'),_0x2c29bb[_0x7a9c('0x6')],_0x2c29bb[_0x7a9c('0x4c')]));channels[_0x2c29bb[_0x7a9c('0x6')]]['ContactId']=_0x2c29bb['value'];}if(!_[_0x7a9c('0x25')](_0x2c29bb['variable'][_0x7a9c('0x57')])){utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')](_0x7a9c('0x58'),_0x2c29bb[_0x7a9c('0x6')],_0x2c29bb[_0x7a9c('0x4c')]));channels[_0x2c29bb[_0x7a9c('0x6')]]['type']=_0x2c29bb[_0x7a9c('0x4c')];}if(!_[_0x7a9c('0x25')](_0x2c29bb[_0x7a9c('0x47')][_0x7a9c('0x59')])){utils[_0x7a9c('0x1b')](util['format'](_0x7a9c('0x5a'),_0x2c29bb['uniqueid'],_0x2c29bb[_0x7a9c('0x4c')]));channels[_0x2c29bb['uniqueid']][_0x7a9c('0x5b')]=_0x2c29bb[_0x7a9c('0x4c')];}if(!_[_0x7a9c('0x25')](_0x2c29bb['variable'][_0x7a9c('0x5c')])){utils[_0x7a9c('0x1b')](util['format'](_0x7a9c('0x5d'),_0x2c29bb[_0x7a9c('0x6')],_0x2c29bb[_0x7a9c('0x4c')]));channels[_0x2c29bb['uniqueid']]['sipcallid']=_0x2c29bb[_0x7a9c('0x4c')];}}}catch(_0x414051){utils[_0x7a9c('0x20')](util[_0x7a9c('0x8')](_0x7a9c('0x46'),_0x2c29bb[_0x7a9c('0x6')]),_0x414051);}};exports[_0x7a9c('0x5e')]=function(_0xfb9513){try{if(!_[_0x7a9c('0x25')](channels[_0xfb9513[_0x7a9c('0x6')]])){utils[_0x7a9c('0x18')](util[_0x7a9c('0x8')]('[%s][calls][newexten]',_0xfb9513[_0x7a9c('0x6')]),_0xfb9513);utils[_0x7a9c('0x1b')](util[_0x7a9c('0x8')](_0x7a9c('0x5f'),_0xfb9513['uniqueid'],_0xfb9513[_0x7a9c('0x60')],_0xfb9513[_0x7a9c('0x61')]));if(_0xfb9513[_0x7a9c('0x60')][_0x7a9c('0x62')]()==_0x7a9c('0x63')&&_[_0x7a9c('0x64')](_0xfb9513[_0x7a9c('0x61')][_0x7a9c('0x62')](),'cdr')){var _0x192721=_0xfb9513['appdata']['split']('=');var _0x399b8f=_0x192721[0x0][_0x7a9c('0x65')](_0x192721[0x0]['lastIndexOf']('(')+0x1,_0x192721[0x0]['lastIndexOf'](')'));var _0x493a31=_0x192721[0x1];channels[_0xfb9513[_0x7a9c('0x6')]][_0x399b8f]=_0x493a31;}if(!_[_0x7a9c('0x66')]([_0x7a9c('0x2e'),_0x7a9c('0x67'),_0x7a9c('0x68'),_0x7a9c('0x63'),_0x7a9c('0x69')],_0xfb9513[_0x7a9c('0x60')][_0x7a9c('0x62')]())){channels[_0xfb9513[_0x7a9c('0x6')]]['lastapplication']=_0xfb9513[_0x7a9c('0x60')];channels[_0xfb9513[_0x7a9c('0x6')]][_0x7a9c('0x54')]=_0xfb9513[_0x7a9c('0x61')];}}}catch(_0x2c984a){utils[_0x7a9c('0x20')](util['format']('[%s][calls][newexten]',_0xfb9513[_0x7a9c('0x6')]),_0x2c984a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index b68f516..781b49f 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 _0x57fd=['managerevent','connect','[core]\x20connected','shutdown','info','[core]\x20shutdown','error','[core]\x20error','[core]\x20close'];(function(_0x2dbd5e,_0x202f18){var _0x41855f=function(_0x1c8ed3){while(--_0x1c8ed3){_0x2dbd5e['push'](_0x2dbd5e['shift']());}};_0x41855f(++_0x202f18);}(_0x57fd,0xac));var _0xd57f=function(_0x4202e5,_0x279124){_0x4202e5=_0x4202e5-0x0;var _0x3ddb4d=_0x57fd[_0x4202e5];return _0x3ddb4d;};'use strict';var utils=require('./utils');exports[_0xd57f('0x0')]=function(){utils['info'](_0xd57f('0x1'));};exports[_0xd57f('0x2')]=function(){utils[_0xd57f('0x3')](_0xd57f('0x4'));};exports['fullybooted']=function(){utils[_0xd57f('0x3')]('[core]\x20fullybooted');};exports[_0xd57f('0x5')]=function(_0x229765){utils['error'](_0xd57f('0x6'),_0x229765);};exports['close']=function(){utils[_0xd57f('0x3')](_0xd57f('0x7'));};exports[_0xd57f('0x8')]=function(_0x38edc2){}; \ No newline at end of file +var _0xea5b=['[core]\x20close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x11376f,_0x3630aa){var _0x4ec55b=function(_0x157f19){while(--_0x157f19){_0x11376f['push'](_0x11376f['shift']());}};_0x4ec55b(++_0x3630aa);}(_0xea5b,0x183));var _0xbea5=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xea5b[_0x36ed48];return _0x51c63a;};'use strict';var utils=require(_0xbea5('0x0'));exports[_0xbea5('0x1')]=function(){utils[_0xbea5('0x2')]('[core]\x20connected');};exports[_0xbea5('0x3')]=function(){utils[_0xbea5('0x2')](_0xbea5('0x4'));};exports['fullybooted']=function(){utils[_0xbea5('0x2')](_0xbea5('0x5'));};exports[_0xbea5('0x6')]=function(_0x17068a){utils['error'](_0xbea5('0x7'),_0x17068a);};exports[_0xbea5('0x8')]=function(){utils['info'](_0xbea5('0x9'));};exports[_0xbea5('0xa')]=function(_0x39ca3b){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 0cfa1fc..6a006c6 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 _0x8a7a=['lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','diffTime','endtime','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','uniqueid','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','set','startsWith','toLowerCase','appdata','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now'];(function(_0x2e50f1,_0x4b3469){var _0x42ac15=function(_0x32c440){while(--_0x32c440){_0x2e50f1['push'](_0x2e50f1['shift']());}};_0x42ac15(++_0x4b3469);}(_0x8a7a,0x111));var _0xa8a7=function(_0x253236,_0x40d39c){_0x253236=_0x253236-0x0;var _0x29f4fc=_0x8a7a[_0x253236];return _0x29f4fc;};'use strict';var _=require(_0xa8a7('0x0'));var util=require(_0xa8a7('0x1'));var utils=require(_0xa8a7('0x2'));var dials={};function writeDB(_0xbd6a35){utils[_0xa8a7('0x3')](util[_0xa8a7('0x4')](_0xa8a7('0x5'),_0xbd6a35['uniqueid'],_0xbd6a35[_0xa8a7('0x6')],_0xbd6a35[_0xa8a7('0x7')],_0xbd6a35[_0xa8a7('0x8')],_0xbd6a35[_0xa8a7('0x9')],_0xbd6a35['dialstatus']));utils[_0xa8a7('0xa')](_0xa8a7('0xb'),_0xbd6a35);delete dials[_0xbd6a35[_0xa8a7('0xc')]];}exports['newexten']=function(_0x482b1d){try{utils[_0xa8a7('0xd')](util[_0xa8a7('0x4')]('[%s][dials][newexten]',_0x482b1d[_0xa8a7('0xc')]),_0x482b1d);utils[_0xa8a7('0x3')](util['format'](_0xa8a7('0xe'),_0x482b1d['uniqueid'],_0x482b1d[_0xa8a7('0xf')],_0x482b1d['appdata']));if(_0x482b1d['application']['toLowerCase']()==_0xa8a7('0x10')&&_[_0xa8a7('0x11')](_0x482b1d['appdata'][_0xa8a7('0x12')](),'cdr(routeid)')){var _0x36f394=_0x482b1d[_0xa8a7('0x13')][_0xa8a7('0x14')]('=');dials[_0x482b1d[_0xa8a7('0xc')]]={'routeId':_0x36f394[0x1]};}}catch(_0x40ddbe){utils[_0xa8a7('0x15')](util[_0xa8a7('0x4')](_0xa8a7('0x16'),_0x482b1d[_0xa8a7('0xc')]),_0x40ddbe);}};exports[_0xa8a7('0x17')]=function(_0x209999){try{utils[_0xa8a7('0xd')](util[_0xa8a7('0x4')](_0xa8a7('0x18'),_0x209999[_0xa8a7('0xc')]),_0x209999);if(!_[_0xa8a7('0x19')](_0x209999['variable'][_0xa8a7('0x1a')])){utils[_0xa8a7('0x3')](util[_0xa8a7('0x4')](_0xa8a7('0x1b'),_0x209999[_0xa8a7('0xc')],_0x209999[_0xa8a7('0x1c')]));dials[_0x209999[_0xa8a7('0xc')]]={'routeId':_0x209999[_0xa8a7('0x1c')]};}}catch(_0x4a1d1b){utils[_0xa8a7('0x15')](util[_0xa8a7('0x4')]('[%s][dials][varset]',_0x209999[_0xa8a7('0xc')]),_0x4a1d1b);}};exports['dialbegin']=function(_0x5b9e08){try{if(!_[_0xa8a7('0x19')](dials[_0x5b9e08[_0xa8a7('0xc')]])){utils[_0xa8a7('0xd')](util[_0xa8a7('0x4')](_0xa8a7('0x1d'),_0x5b9e08[_0xa8a7('0xc')]),_0x5b9e08);dials[_0x5b9e08[_0xa8a7('0xc')]]=_[_0xa8a7('0x1e')](dials[_0x5b9e08[_0xa8a7('0xc')]],_0x5b9e08);dials[_0x5b9e08[_0xa8a7('0xc')]][_0xa8a7('0x1f')]=utils[_0xa8a7('0x20')]();dials[_0x5b9e08[_0xa8a7('0xc')]][_0xa8a7('0x21')]=_0xa8a7('0x22');utils['info'](util['format'](_0xa8a7('0x23'),_0x5b9e08[_0xa8a7('0xc')],dials[_0x5b9e08[_0xa8a7('0xc')]]['starttime']));}}catch(_0xfcecef){utils[_0xa8a7('0x15')](util[_0xa8a7('0x4')]('[%s][dials][dialbegin]',_0x5b9e08['uniqueid']),_0xfcecef);}};exports[_0xa8a7('0x24')]=function(_0x99cbfe){try{if(!_[_0xa8a7('0x19')](dials[_0x99cbfe['uniqueid']])){utils['debug'](util[_0xa8a7('0x4')](_0xa8a7('0x25'),_0x99cbfe[_0xa8a7('0xc')]),_0x99cbfe);dials[_0x99cbfe[_0xa8a7('0xc')]][_0xa8a7('0x26')]=_0x99cbfe['dialstatus'];if(_0x99cbfe[_0xa8a7('0x26')]==_0xa8a7('0x27')){dials[_0x99cbfe[_0xa8a7('0xc')]]=_['assign'](dials[_0x99cbfe[_0xa8a7('0xc')]],_0x99cbfe);dials[_0x99cbfe[_0xa8a7('0xc')]][_0xa8a7('0x28')]=utils[_0xa8a7('0x20')]();dials[_0x99cbfe[_0xa8a7('0xc')]]['lastevent']=_0xa8a7('0x29');utils[_0xa8a7('0x3')](util[_0xa8a7('0x4')](_0xa8a7('0x2a'),_0x99cbfe[_0xa8a7('0xc')],_0x99cbfe[_0xa8a7('0x26')],dials[_0x99cbfe[_0xa8a7('0xc')]][_0xa8a7('0x28')]));}else{utils['info'](util[_0xa8a7('0x4')](_0xa8a7('0x2b'),_0x99cbfe['uniqueid'],_0x99cbfe[_0xa8a7('0x26')]));}}}catch(_0x8500cf){utils[_0xa8a7('0x15')](util[_0xa8a7('0x4')](_0xa8a7('0x25'),_0x99cbfe[_0xa8a7('0xc')]),_0x8500cf);}};exports[_0xa8a7('0x2c')]=function(_0x4f0e23){try{if(!_[_0xa8a7('0x19')](dials[_0x4f0e23[_0xa8a7('0xc')]])){utils[_0xa8a7('0xd')](util['format']('[%s][dials][hangup]',_0x4f0e23[_0xa8a7('0xc')]),_0x4f0e23);utils['info'](util[_0xa8a7('0x4')](_0xa8a7('0x2d'),_0x4f0e23['uniqueid'],_0x4f0e23[_0xa8a7('0x8')],_0x4f0e23['calleridname'],_0x4f0e23[_0xa8a7('0x2e')]));dials[_0x4f0e23[_0xa8a7('0xc')]]=_[_0xa8a7('0x1e')](dials[_0x4f0e23[_0xa8a7('0xc')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4f0e23[_0xa8a7('0xc')]][_0xa8a7('0x2f')]=utils[_0xa8a7('0x30')](dials[_0x4f0e23['uniqueid']][_0xa8a7('0x31')],dials[_0x4f0e23[_0xa8a7('0xc')]][_0xa8a7('0x1f')]);dials[_0x4f0e23['uniqueid']]['holdtime']=utils[_0xa8a7('0x30')](dials[_0x4f0e23['uniqueid']]['answertime']||dials[_0x4f0e23[_0xa8a7('0xc')]][_0xa8a7('0x31')],dials[_0x4f0e23['uniqueid']][_0xa8a7('0x1f')]);dials[_0x4f0e23['uniqueid']]['billableseconds']=dials[_0x4f0e23['uniqueid']]['answertime']?utils['diffTime'](dials[_0x4f0e23['uniqueid']]['endtime'],dials[_0x4f0e23[_0xa8a7('0xc')]][_0xa8a7('0x28')]):0x0;writeDB(dials[_0x4f0e23[_0xa8a7('0xc')]]);}}catch(_0x371c97){utils[_0xa8a7('0x15')](util['format'](_0xa8a7('0x32'),_0x4f0e23[_0xa8a7('0xc')]),_0x371c97);}}; \ No newline at end of file +var _0xd6e7=['assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','debug','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]'];(function(_0xdc8cb5,_0x4d14f0){var _0x4d71bb=function(_0x495e32){while(--_0x495e32){_0xdc8cb5['push'](_0xdc8cb5['shift']());}};_0x4d71bb(++_0x4d14f0);}(_0xd6e7,0x15e));var _0x7d6e=function(_0x458f6a,_0x36796f){_0x458f6a=_0x458f6a-0x0;var _0x1b9776=_0xd6e7[_0x458f6a];return _0x1b9776;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x5aa9e6){utils[_0x7d6e('0x0')](util[_0x7d6e('0x1')](_0x7d6e('0x2'),_0x5aa9e6[_0x7d6e('0x3')],_0x5aa9e6[_0x7d6e('0x4')],_0x5aa9e6[_0x7d6e('0x5')],_0x5aa9e6[_0x7d6e('0x6')],_0x5aa9e6['connectedlinenum'],_0x5aa9e6[_0x7d6e('0x7')]));utils[_0x7d6e('0x8')](_0x7d6e('0x9'),_0x5aa9e6);delete dials[_0x5aa9e6['uniqueid']];}exports['newexten']=function(_0x4bd513){try{utils[_0x7d6e('0xa')](util[_0x7d6e('0x1')]('[%s][dials][newexten]',_0x4bd513[_0x7d6e('0x3')]),_0x4bd513);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4bd513['uniqueid'],_0x4bd513[_0x7d6e('0xb')],_0x4bd513[_0x7d6e('0xc')]));if(_0x4bd513[_0x7d6e('0xb')][_0x7d6e('0xd')]()==_0x7d6e('0xe')&&_[_0x7d6e('0xf')](_0x4bd513[_0x7d6e('0xc')][_0x7d6e('0xd')](),_0x7d6e('0x10'))){var _0x44b23c=_0x4bd513[_0x7d6e('0xc')]['split']('=');dials[_0x4bd513[_0x7d6e('0x3')]]={'routeId':_0x44b23c[0x1]};}}catch(_0x3d7b1f){utils['error'](util[_0x7d6e('0x1')]('[%s][dials][newexten]',_0x4bd513['uniqueid']),_0x3d7b1f);}};exports[_0x7d6e('0x11')]=function(_0x82cbd7){try{utils[_0x7d6e('0xa')](util[_0x7d6e('0x1')](_0x7d6e('0x12'),_0x82cbd7['uniqueid']),_0x82cbd7);if(!_[_0x7d6e('0x13')](_0x82cbd7['variable'][_0x7d6e('0x14')])){utils[_0x7d6e('0x0')](util['format'](_0x7d6e('0x15'),_0x82cbd7[_0x7d6e('0x3')],_0x82cbd7['value']));dials[_0x82cbd7[_0x7d6e('0x3')]]={'routeId':_0x82cbd7[_0x7d6e('0x16')]};}}catch(_0x480d99){utils[_0x7d6e('0x17')](util[_0x7d6e('0x1')](_0x7d6e('0x12'),_0x82cbd7['uniqueid']),_0x480d99);}};exports[_0x7d6e('0x18')]=function(_0x158da8){try{if(!_[_0x7d6e('0x13')](dials[_0x158da8[_0x7d6e('0x3')]])){utils[_0x7d6e('0xa')](util[_0x7d6e('0x1')](_0x7d6e('0x19'),_0x158da8[_0x7d6e('0x3')]),_0x158da8);dials[_0x158da8[_0x7d6e('0x3')]]=_[_0x7d6e('0x1a')](dials[_0x158da8[_0x7d6e('0x3')]],_0x158da8);dials[_0x158da8[_0x7d6e('0x3')]][_0x7d6e('0x1b')]=utils[_0x7d6e('0x1c')]();dials[_0x158da8[_0x7d6e('0x3')]][_0x7d6e('0x1d')]=_0x7d6e('0x1e');utils[_0x7d6e('0x0')](util[_0x7d6e('0x1')](_0x7d6e('0x1f'),_0x158da8[_0x7d6e('0x3')],dials[_0x158da8[_0x7d6e('0x3')]][_0x7d6e('0x1b')]));}}catch(_0x5c9ba2){utils[_0x7d6e('0x17')](util[_0x7d6e('0x1')](_0x7d6e('0x19'),_0x158da8[_0x7d6e('0x3')]),_0x5c9ba2);}};exports[_0x7d6e('0x20')]=function(_0x106c2e){try{if(!_[_0x7d6e('0x13')](dials[_0x106c2e[_0x7d6e('0x3')]])){utils['debug'](util['format']('[%s][dials][dialend]',_0x106c2e[_0x7d6e('0x3')]),_0x106c2e);dials[_0x106c2e[_0x7d6e('0x3')]]['dialstatus']=_0x106c2e['dialstatus'];if(_0x106c2e[_0x7d6e('0x7')]==_0x7d6e('0x21')){dials[_0x106c2e[_0x7d6e('0x3')]]=_['assign'](dials[_0x106c2e['uniqueid']],_0x106c2e);dials[_0x106c2e[_0x7d6e('0x3')]][_0x7d6e('0x22')]=utils[_0x7d6e('0x1c')]();dials[_0x106c2e['uniqueid']][_0x7d6e('0x1d')]=_0x7d6e('0x23');utils['info'](util[_0x7d6e('0x1')](_0x7d6e('0x24'),_0x106c2e[_0x7d6e('0x3')],_0x106c2e['dialstatus'],dials[_0x106c2e['uniqueid']][_0x7d6e('0x22')]));}else{utils[_0x7d6e('0x0')](util[_0x7d6e('0x1')](_0x7d6e('0x25'),_0x106c2e[_0x7d6e('0x3')],_0x106c2e[_0x7d6e('0x7')]));}}}catch(_0x40672e){utils[_0x7d6e('0x17')](util['format']('[%s][dials][dialend]',_0x106c2e[_0x7d6e('0x3')]),_0x40672e);}};exports[_0x7d6e('0x26')]=function(_0x4f9bf9){try{if(!_[_0x7d6e('0x13')](dials[_0x4f9bf9[_0x7d6e('0x3')]])){utils[_0x7d6e('0xa')](util['format']('[%s][dials][hangup]',_0x4f9bf9[_0x7d6e('0x3')]),_0x4f9bf9);utils[_0x7d6e('0x0')](util[_0x7d6e('0x1')](_0x7d6e('0x27'),_0x4f9bf9[_0x7d6e('0x3')],_0x4f9bf9[_0x7d6e('0x6')],_0x4f9bf9['calleridname'],_0x4f9bf9[_0x7d6e('0x28')]));dials[_0x4f9bf9[_0x7d6e('0x3')]]=_[_0x7d6e('0x1a')](dials[_0x4f9bf9['uniqueid']],{'endtime':utils[_0x7d6e('0x1c')](),'lastevent':_0x7d6e('0x29')});dials[_0x4f9bf9[_0x7d6e('0x3')]]['duration']=utils[_0x7d6e('0x2a')](dials[_0x4f9bf9[_0x7d6e('0x3')]][_0x7d6e('0x2b')],dials[_0x4f9bf9['uniqueid']][_0x7d6e('0x1b')]);dials[_0x4f9bf9['uniqueid']][_0x7d6e('0x2c')]=utils[_0x7d6e('0x2a')](dials[_0x4f9bf9[_0x7d6e('0x3')]]['answertime']||dials[_0x4f9bf9[_0x7d6e('0x3')]][_0x7d6e('0x2b')],dials[_0x4f9bf9[_0x7d6e('0x3')]][_0x7d6e('0x1b')]);dials[_0x4f9bf9[_0x7d6e('0x3')]][_0x7d6e('0x2d')]=dials[_0x4f9bf9[_0x7d6e('0x3')]]['answertime']?utils[_0x7d6e('0x2a')](dials[_0x4f9bf9['uniqueid']][_0x7d6e('0x2b')],dials[_0x4f9bf9[_0x7d6e('0x3')]][_0x7d6e('0x22')]):0x0;writeDB(dials[_0x4f9bf9[_0x7d6e('0x3')]]);}}catch(_0x3bea6a){utils['error'](util[_0x7d6e('0x1')](_0x7d6e('0x2e'),_0x4f9bf9[_0x7d6e('0x3')]),_0x3bea6a);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 21b72ef..6233b4b 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 _0x2eb2=['[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','./agents.controller','./recordings.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','format','[%s][index][agentringnoanswer]','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]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend'];(function(_0x1f7356,_0x4a80ad){var _0x262d2b=function(_0x505ca6){while(--_0x505ca6){_0x1f7356['push'](_0x1f7356['shift']());}};_0x262d2b(++_0x4a80ad);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x2eb2[_0x397cfb];return _0x15fed9;};var AsteriskManager=require('asterisk-manager');var config=require(_0x22eb('0x0'));var utils=require(_0x22eb('0x1'));var util=require(_0x22eb('0x2'));var isXDREnabled=config[_0x22eb('0x3')]&&!config[_0x22eb('0x3')][_0x22eb('0x4')];var isProduction=config['env']===_0x22eb('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0x22eb('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x22eb('0x7')][_0x22eb('0x8')],config[_0x22eb('0x7')]['ip'],config[_0x22eb('0x7')][_0x22eb('0x9')],config[_0x22eb('0x7')][_0x22eb('0xa')],!![]);ami[_0x22eb('0xb')]();if(!isXDREnabled){utils[_0x22eb('0xc')](_0x22eb('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x22eb('0xc')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x22eb('0xe'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require(_0x22eb('0xf'));var members=require('./members.controller');var dials=require(_0x22eb('0x10'));var transfers=require(_0x22eb('0x11'));var core=require('./core.controller');ami['on']('connect',core[_0x22eb('0x12')]);ami['on'](_0x22eb('0x13'),core[_0x22eb('0x13')]);ami['on'](_0x22eb('0x14'),core[_0x22eb('0x14')]);ami['on']('error',core[_0x22eb('0x15')]);ami['on']('close',core[_0x22eb('0x16')]);ami['on']('managerevent',core[_0x22eb('0x17')]);ami['on'](_0x22eb('0x18'),function(_0x53abbf){try{utils['debug'](util['format'](_0x22eb('0x19'),_0x53abbf['device']),_0x53abbf);members['devicestatechange'](_0x53abbf);}catch(_0x428586){utils['error'](util['format'](_0x22eb('0x19'),_0x53abbf[_0x22eb('0x1a')]),_0x428586);}});ami['on'](_0x22eb('0x1b'),function(_0x1ff041){try{utils[_0x22eb('0x1c')](util['format'](_0x22eb('0x1d'),_0x1ff041[_0x22eb('0x1e')]),_0x1ff041);agents[_0x22eb('0x1b')](_0x1ff041);}catch(_0x410c25){utils[_0x22eb('0x15')](util['format'](_0x22eb('0x1d'),_0x1ff041[_0x22eb('0x1e')]),_0x410c25);}});ami['on'](_0x22eb('0x1f'),function(_0x49ce2a){try{utils['debug'](util[_0x22eb('0x20')](_0x22eb('0x21'),_0x49ce2a[_0x22eb('0x1e')]),_0x49ce2a);agents[_0x22eb('0x1f')](_0x49ce2a);}catch(_0x2d95f0){utils[_0x22eb('0x15')](util[_0x22eb('0x20')]('[%s][index][agentringnoanswer]',_0x49ce2a[_0x22eb('0x1e')]),_0x2d95f0);}});ami['on'](_0x22eb('0x22'),function(_0x3ffa9e){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')]('[%s][index][agentconnect]',_0x3ffa9e[_0x22eb('0x1e')]),_0x3ffa9e);agents[_0x22eb('0x22')](_0x3ffa9e);queues[_0x22eb('0x22')](_0x3ffa9e);}catch(_0x5a001e){utils[_0x22eb('0x15')](util[_0x22eb('0x20')]('[%s][index][agentconnect]',_0x3ffa9e[_0x22eb('0x1e')]),_0x5a001e);}});ami['on'](_0x22eb('0x23'),function(_0x1e3015){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')]('[%s][index][agentcomplete]',_0x1e3015['uniqueid']),_0x1e3015);agents[_0x22eb('0x23')](_0x1e3015);queues[_0x22eb('0x23')](_0x1e3015);members[_0x22eb('0x23')](_0x1e3015);}catch(_0x7c0119){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x24'),_0x1e3015[_0x22eb('0x1e')]),_0x7c0119);}});ami['on'](_0x22eb('0x25'),function(_0x39cec1){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')]('[%s][index][queuecallerabandon]',_0x39cec1[_0x22eb('0x1e')]),_0x39cec1);agents['queuecallerabandon'](_0x39cec1);queues[_0x22eb('0x25')](_0x39cec1);}catch(_0x1e035a){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x26'),_0x39cec1[_0x22eb('0x1e')]),_0x1e035a);}});ami['on'](_0x22eb('0x27'),function(_0x476cdb){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')]('[%s][index][queuecallerjoin]',_0x476cdb['uniqueid']),_0x476cdb);queues[_0x22eb('0x27')](_0x476cdb);recordings['queuecallerjoin'](_0x476cdb);}catch(_0x55ee20){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x28'),_0x476cdb[_0x22eb('0x1e')]),_0x55ee20);}});ami['on'](_0x22eb('0x29'),function(_0x332e9a){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')](_0x22eb('0x2a'),_0x332e9a[_0x22eb('0x1e')]),_0x332e9a);queues['queuecallerleave'](_0x332e9a);}catch(_0x9c8193){utils['error'](util['format'](_0x22eb('0x2a'),_0x332e9a[_0x22eb('0x1e')]),_0x9c8193);}});ami['on']('musiconholdstart',function(_0x42e9bd){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')](_0x22eb('0x2b'),_0x42e9bd[_0x22eb('0x1e')]),_0x42e9bd);queues['musiconholdstart'](_0x42e9bd);calls[_0x22eb('0x2c')](_0x42e9bd);}catch(_0x1aea5f){utils['error'](util[_0x22eb('0x20')](_0x22eb('0x2b'),_0x42e9bd[_0x22eb('0x1e')]),_0x1aea5f);}});ami['on'](_0x22eb('0x2d'),function(_0x9353f1){try{utils['debug'](util['format'](_0x22eb('0x2e'),_0x9353f1[_0x22eb('0x1e')]),_0x9353f1);queues['musiconholdstop'](_0x9353f1);calls[_0x22eb('0x2d')](_0x9353f1);}catch(_0x2e2a0c){utils[_0x22eb('0x15')](util['format'](_0x22eb('0x2e'),_0x9353f1[_0x22eb('0x1e')]),_0x2e2a0c);}});ami['on'](_0x22eb('0x2f'),function(_0x2a8517){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')]('[%s][index][newstate]',_0x2a8517[_0x22eb('0x1e')]),_0x2a8517);calls[_0x22eb('0x2f')](_0x2a8517);recordings['newstate'](_0x2a8517);}catch(_0x24ad2a){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x30'),_0x2a8517[_0x22eb('0x1e')]),_0x24ad2a);}});ami['on'](_0x22eb('0x31'),function(_0x1ff04a){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')](_0x22eb('0x32'),_0x1ff04a[_0x22eb('0x1e')]),_0x1ff04a);calls[_0x22eb('0x31')](_0x1ff04a);recordings[_0x22eb('0x31')](_0x1ff04a);dials[_0x22eb('0x31')](_0x1ff04a);agents[_0x22eb('0x31')](_0x1ff04a);queues[_0x22eb('0x31')](_0x1ff04a);}catch(_0x6996b4){utils[_0x22eb('0x15')](util['format'](_0x22eb('0x32'),_0x1ff04a[_0x22eb('0x1e')]),_0x6996b4);}});ami['on']('cdr',function(_0x10462d){try{utils[_0x22eb('0x1c')](util['format']('[%s][index][cdr]',_0x10462d['uniqueid']),_0x10462d);members[_0x22eb('0x33')](_0x10462d);}catch(_0x1efc65){utils['error'](util['format'](_0x22eb('0x34'),_0x10462d[_0x22eb('0x1e')]),_0x1efc65);}});ami['on'](_0x22eb('0x35'),function(_0x253508){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')](_0x22eb('0x36'),_0x253508[_0x22eb('0x1e')]),_0x253508);queues['blindtransfer'](_0x253508);agents['blindtransfer'](_0x253508);transfers[_0x22eb('0x35')](_0x253508);recordings['blindtransfer'](_0x253508);}catch(_0x5e695c){utils['error'](util[_0x22eb('0x20')]('[%s][index][blindtransfer]',_0x253508['uniqueid']),_0x5e695c);}});ami['on']('attendedtransfer',function(_0x517784){try{utils[_0x22eb('0x1c')](util['format'](_0x22eb('0x37'),_0x517784[_0x22eb('0x38')]),_0x517784);queues['attendedtransfer'](_0x517784);transfers[_0x22eb('0x39')](_0x517784);agents['attendedtransfer'](_0x517784);calls[_0x22eb('0x39')](_0x517784);}catch(_0x9c490b){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x37'),_0x517784[_0x22eb('0x38')]),_0x9c490b);}});ami['on'](_0x22eb('0x3a'),function(_0x517858){try{utils[_0x22eb('0x1c')](util['format'](_0x22eb('0x3b'),_0x517858[_0x22eb('0x1e')]),_0x517858);queues['varset'](_0x517858);recordings[_0x22eb('0x3a')](_0x517858);calls[_0x22eb('0x3a')](_0x517858);dials[_0x22eb('0x3a')](_0x517858);}catch(_0x31216f){utils['error'](util[_0x22eb('0x20')](_0x22eb('0x3b'),_0x517858[_0x22eb('0x1e')]),_0x31216f);}});ami['on'](_0x22eb('0x3c'),function(_0x447177){try{utils[_0x22eb('0x1c')](util['format'](_0x22eb('0x3d'),_0x447177['uniqueid']),_0x447177);calls[_0x22eb('0x3c')](_0x447177);recordings['newexten'](_0x447177);dials[_0x22eb('0x3c')](_0x447177);}catch(_0x254b53){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x3d'),_0x447177['uniqueid']),_0x254b53);}});ami['on']('newchannel',function(_0xfbf2e7){try{utils[_0x22eb('0x1c')](util['format'](_0x22eb('0x3e'),_0xfbf2e7[_0x22eb('0x1e')]),_0xfbf2e7);calls[_0x22eb('0x3f')](_0xfbf2e7);recordings[_0x22eb('0x3f')](_0xfbf2e7);}catch(_0x3337dd){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x3e'),_0xfbf2e7[_0x22eb('0x1e')]),_0x3337dd);}});ami['on'](_0x22eb('0x40'),function(_0x334710){try{utils['debug'](util[_0x22eb('0x20')](_0x22eb('0x41'),_0x334710[_0x22eb('0x1e')]),_0x334710);dials[_0x22eb('0x40')](_0x334710);}catch(_0x45c682){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x42'),_0x334710[_0x22eb('0x1e')]),_0x45c682);}});ami['on'](_0x22eb('0x43'),function(_0x3e9ab5){try{utils[_0x22eb('0x1c')](util[_0x22eb('0x20')](_0x22eb('0x44'),_0x3e9ab5['uniqueid']),_0x3e9ab5);dials['dialend'](_0x3e9ab5);}catch(_0x36ee0d){utils[_0x22eb('0x15')](util[_0x22eb('0x20')](_0x22eb('0x44'),_0x3e9ab5[_0x22eb('0x1e')]),_0x36ee0d);}});} \ No newline at end of file +var _0x9432=['port','username','password','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','format','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','xdr','disabled','local','asterisk'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x9432,0x1e3));var _0x2943=function(_0x5f1ae7,_0x54c5df){_0x5f1ae7=_0x5f1ae7-0x0;var _0xbc7776=_0x9432[_0x5f1ae7];return _0xbc7776;};var AsteriskManager=require(_0x2943('0x0'));var config=require(_0x2943('0x1'));var utils=require('./utils');var util=require(_0x2943('0x2'));var isXDREnabled=config[_0x2943('0x3')]&&!config['xdr'][_0x2943('0x4')];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x2943('0x3')]&&config[_0x2943('0x3')][_0x2943('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0x2943('0x6')][_0x2943('0x7')],config['asterisk']['ip'],config[_0x2943('0x6')][_0x2943('0x8')],config[_0x2943('0x6')][_0x2943('0x9')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x2943('0xa')](_0x2943('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x2943('0xa')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require(_0x2943('0xc'));var calls=require('./calls.controller');var queues=require(_0x2943('0xd'));var recordings=require(_0x2943('0xe'));var members=require(_0x2943('0xf'));var dials=require(_0x2943('0x10'));var transfers=require(_0x2943('0x11'));var core=require(_0x2943('0x12'));ami['on'](_0x2943('0x13'),core[_0x2943('0x13')]);ami['on'](_0x2943('0x14'),core[_0x2943('0x14')]);ami['on'](_0x2943('0x15'),core[_0x2943('0x15')]);ami['on'](_0x2943('0x16'),core['error']);ami['on'](_0x2943('0x17'),core[_0x2943('0x17')]);ami['on'](_0x2943('0x18'),core[_0x2943('0x18')]);ami['on'](_0x2943('0x19'),function(_0x390d1a){try{utils[_0x2943('0x1a')](util['format']('[%s][index][devicestatechange]',_0x390d1a[_0x2943('0x1b')]),_0x390d1a);members['devicestatechange'](_0x390d1a);}catch(_0x5ae07a){utils[_0x2943('0x16')](util['format'](_0x2943('0x1c'),_0x390d1a['device']),_0x5ae07a);}});ami['on'](_0x2943('0x1d'),function(_0x2e6b4f){try{utils[_0x2943('0x1a')](util['format'](_0x2943('0x1e'),_0x2e6b4f[_0x2943('0x1f')]),_0x2e6b4f);agents['agentcalled'](_0x2e6b4f);}catch(_0x20cace){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x1e'),_0x2e6b4f['uniqueid']),_0x20cace);}});ami['on'](_0x2943('0x21'),function(_0x36b2e7){try{utils['debug'](util[_0x2943('0x20')](_0x2943('0x22'),_0x36b2e7[_0x2943('0x1f')]),_0x36b2e7);agents[_0x2943('0x21')](_0x36b2e7);}catch(_0x4fcdc3){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x22'),_0x36b2e7[_0x2943('0x1f')]),_0x4fcdc3);}});ami['on']('agentconnect',function(_0x317a1c){try{utils['debug'](util[_0x2943('0x20')]('[%s][index][agentconnect]',_0x317a1c[_0x2943('0x1f')]),_0x317a1c);agents[_0x2943('0x23')](_0x317a1c);queues[_0x2943('0x23')](_0x317a1c);}catch(_0x18800c){utils[_0x2943('0x16')](util['format'](_0x2943('0x24'),_0x317a1c[_0x2943('0x1f')]),_0x18800c);}});ami['on'](_0x2943('0x25'),function(_0x5f1cb1){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')](_0x2943('0x26'),_0x5f1cb1[_0x2943('0x1f')]),_0x5f1cb1);agents[_0x2943('0x25')](_0x5f1cb1);queues[_0x2943('0x25')](_0x5f1cb1);members[_0x2943('0x25')](_0x5f1cb1);}catch(_0x357720){utils['error'](util[_0x2943('0x20')](_0x2943('0x26'),_0x5f1cb1[_0x2943('0x1f')]),_0x357720);}});ami['on'](_0x2943('0x27'),function(_0x238c38){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')](_0x2943('0x28'),_0x238c38['uniqueid']),_0x238c38);agents[_0x2943('0x27')](_0x238c38);queues[_0x2943('0x27')](_0x238c38);}catch(_0x117473){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x28'),_0x238c38['uniqueid']),_0x117473);}});ami['on']('queuecallerjoin',function(_0x4d5137){try{utils['debug'](util[_0x2943('0x20')](_0x2943('0x29'),_0x4d5137[_0x2943('0x1f')]),_0x4d5137);queues['queuecallerjoin'](_0x4d5137);recordings[_0x2943('0x2a')](_0x4d5137);}catch(_0x394fde){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x29'),_0x4d5137[_0x2943('0x1f')]),_0x394fde);}});ami['on'](_0x2943('0x2b'),function(_0x3f9b8c){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')](_0x2943('0x2c'),_0x3f9b8c[_0x2943('0x1f')]),_0x3f9b8c);queues[_0x2943('0x2b')](_0x3f9b8c);}catch(_0x1d80b4){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x2c'),_0x3f9b8c[_0x2943('0x1f')]),_0x1d80b4);}});ami['on'](_0x2943('0x2d'),function(_0x53eb35){try{utils['debug'](util['format']('[%s][index][musiconholdstart]',_0x53eb35['uniqueid']),_0x53eb35);queues[_0x2943('0x2d')](_0x53eb35);calls[_0x2943('0x2d')](_0x53eb35);}catch(_0x493af7){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x2e'),_0x53eb35['uniqueid']),_0x493af7);}});ami['on'](_0x2943('0x2f'),function(_0x50fc63){try{utils[_0x2943('0x1a')](util['format']('[%s][index][musiconholdstop]',_0x50fc63[_0x2943('0x1f')]),_0x50fc63);queues[_0x2943('0x2f')](_0x50fc63);calls['musiconholdstop'](_0x50fc63);}catch(_0x35f7ff){utils[_0x2943('0x16')](util[_0x2943('0x20')]('[%s][index][musiconholdstop]',_0x50fc63['uniqueid']),_0x35f7ff);}});ami['on']('newstate',function(_0x193788){try{utils['debug'](util[_0x2943('0x20')](_0x2943('0x30'),_0x193788[_0x2943('0x1f')]),_0x193788);calls[_0x2943('0x31')](_0x193788);recordings[_0x2943('0x31')](_0x193788);}catch(_0x37953d){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x30'),_0x193788[_0x2943('0x1f')]),_0x37953d);}});ami['on']('hangup',function(_0x5afb95){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')]('[%s][index][hangup]',_0x5afb95[_0x2943('0x1f')]),_0x5afb95);calls[_0x2943('0x32')](_0x5afb95);recordings[_0x2943('0x32')](_0x5afb95);dials[_0x2943('0x32')](_0x5afb95);agents[_0x2943('0x32')](_0x5afb95);queues[_0x2943('0x32')](_0x5afb95);}catch(_0x2100d4){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x33'),_0x5afb95[_0x2943('0x1f')]),_0x2100d4);}});ami['on'](_0x2943('0x34'),function(_0x145909){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')](_0x2943('0x35'),_0x145909[_0x2943('0x1f')]),_0x145909);members[_0x2943('0x34')](_0x145909);}catch(_0x448c01){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x35'),_0x145909[_0x2943('0x1f')]),_0x448c01);}});ami['on'](_0x2943('0x36'),function(_0x4da6f4){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')](_0x2943('0x37'),_0x4da6f4[_0x2943('0x1f')]),_0x4da6f4);queues[_0x2943('0x36')](_0x4da6f4);agents[_0x2943('0x36')](_0x4da6f4);transfers['blindtransfer'](_0x4da6f4);recordings[_0x2943('0x36')](_0x4da6f4);}catch(_0x5b31ef){utils['error'](util[_0x2943('0x20')](_0x2943('0x37'),_0x4da6f4[_0x2943('0x1f')]),_0x5b31ef);}});ami['on'](_0x2943('0x38'),function(_0x44d050){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')](_0x2943('0x39'),_0x44d050[_0x2943('0x3a')]),_0x44d050);queues[_0x2943('0x38')](_0x44d050);transfers['attendedtransfer'](_0x44d050);agents[_0x2943('0x38')](_0x44d050);calls[_0x2943('0x38')](_0x44d050);}catch(_0x23fe21){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x39'),_0x44d050[_0x2943('0x3a')]),_0x23fe21);}});ami['on']('varset',function(_0x1fe6cb){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')]('[%s][index][varset]',_0x1fe6cb['uniqueid']),_0x1fe6cb);queues[_0x2943('0x3b')](_0x1fe6cb);recordings[_0x2943('0x3b')](_0x1fe6cb);calls[_0x2943('0x3b')](_0x1fe6cb);dials['varset'](_0x1fe6cb);}catch(_0x408309){utils['error'](util[_0x2943('0x20')](_0x2943('0x3c'),_0x1fe6cb['uniqueid']),_0x408309);}});ami['on']('newexten',function(_0x5e7fc7){try{utils['debug'](util['format'](_0x2943('0x3d'),_0x5e7fc7['uniqueid']),_0x5e7fc7);calls[_0x2943('0x3e')](_0x5e7fc7);recordings[_0x2943('0x3e')](_0x5e7fc7);dials[_0x2943('0x3e')](_0x5e7fc7);}catch(_0x36dbff){utils[_0x2943('0x16')](util[_0x2943('0x20')](_0x2943('0x3d'),_0x5e7fc7['uniqueid']),_0x36dbff);}});ami['on'](_0x2943('0x3f'),function(_0x508349){try{utils[_0x2943('0x1a')](util['format']('[%s][index][newchannel]',_0x508349[_0x2943('0x1f')]),_0x508349);calls[_0x2943('0x3f')](_0x508349);recordings[_0x2943('0x3f')](_0x508349);}catch(_0x214710){utils['error'](util[_0x2943('0x20')](_0x2943('0x40'),_0x508349[_0x2943('0x1f')]),_0x214710);}});ami['on'](_0x2943('0x41'),function(_0x477339){try{utils[_0x2943('0x1a')](util['format'](_0x2943('0x42'),_0x477339['uniqueid']),_0x477339);dials['dialbegin'](_0x477339);}catch(_0x58ac5f){utils['error'](util['format'](_0x2943('0x43'),_0x477339[_0x2943('0x1f')]),_0x58ac5f);}});ami['on'](_0x2943('0x44'),function(_0x49f2a8){try{utils[_0x2943('0x1a')](util[_0x2943('0x20')]('[%s][index][dialend]',_0x49f2a8[_0x2943('0x1f')]),_0x49f2a8);dials[_0x2943('0x44')](_0x49f2a8);}catch(_0x45ba10){utils['error'](util['format'](_0x2943('0x45'),_0x49f2a8[_0x2943('0x1f')]),_0x45ba10);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index ae20f71..a25884f 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 _0xa8db=['interface','channel','data2','membername','getUserByInterface','then','name','internal','request','getUserByName','CreateMemberReport','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','info','state','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','split','assign','data1','type','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','destination','util','./utils','Local/_attended@transfer','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid'];(function(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0xa8db,0x16d));var _0xba8d=function(_0x1f530d,_0x18a19e){_0x1f530d=_0x1f530d-0x0;var _0x22103f=_0xa8db[_0x1f530d];return _0x22103f;};'use strict';var _=require('lodash');var util=require(_0xba8d('0x0'));var utils=require(_0xba8d('0x1'));var members={};var exclude=[_0xba8d('0x2'),'Queue:'];function writeDB(_0x3f9c3f){utils['info'](util[_0xba8d('0x3')](_0xba8d('0x4'),_0x3f9c3f[_0xba8d('0x5')],_0x3f9c3f[_0xba8d('0x6')],_0x3f9c3f[_0xba8d('0x7')],_0x3f9c3f[_0xba8d('0x8')],_0x3f9c3f[_0xba8d('0x9')],_0x3f9c3f['type']));if(_0x3f9c3f[_0xba8d('0x6')]){utils[_0xba8d('0xa')](_0x3f9c3f['interface'])[_0xba8d('0xb')](function(_0x11f10d){if(_0x11f10d){_0x3f9c3f[_0xba8d('0x9')]=_0x11f10d[_0xba8d('0xc')];_0x3f9c3f[_0xba8d('0xd')]=_0x11f10d['internal'];utils[_0xba8d('0xe')]('CreateMemberReport',_0x3f9c3f);}else{utils[_0xba8d('0xf')](_0x3f9c3f[_0xba8d('0x6')]['split']('/')[0x1])['then'](function(_0x2ac350){if(_0x2ac350){_0x3f9c3f[_0xba8d('0x9')]=_0x2ac350[_0xba8d('0xc')];_0x3f9c3f[_0xba8d('0xd')]=_0x2ac350[_0xba8d('0xd')];utils[_0xba8d('0xe')](_0xba8d('0x10'),_0x3f9c3f);}});}})[_0xba8d('0x11')](function(_0x386ca9){utils[_0xba8d('0x12')](util[_0xba8d('0x3')](_0xba8d('0x13'),_0x3f9c3f[_0xba8d('0x5')]),_0x386ca9);});}delete members[_0x3f9c3f[_0xba8d('0x6')]];}function startsWith(_0x1f1ba4,_0x46ca95){return _[_0xba8d('0x14')](_0x1f1ba4,function(_0x354a89){return _[_0xba8d('0x15')](_0x46ca95,_0x354a89);});}exports[_0xba8d('0x16')]=function(_0x3b4de2){try{utils[_0xba8d('0x17')](util[_0xba8d('0x3')](_0xba8d('0x18'),members[_0x3b4de2[_0xba8d('0x19')]]?members[_0x3b4de2[_0xba8d('0x19')]][_0xba8d('0x5')]:_0x3b4de2[_0xba8d('0x19')]),_0x3b4de2);utils[_0xba8d('0x1a')](util[_0xba8d('0x3')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x3b4de2[_0xba8d('0x19')]]?members[_0x3b4de2[_0xba8d('0x19')]][_0xba8d('0x5')]:_0x3b4de2['device'],_0x3b4de2[_0xba8d('0x1b')],_0x3b4de2[_0xba8d('0x19')]));switch(_0x3b4de2[_0xba8d('0x1b')]){case'INUSE':case _0xba8d('0x1c'):if(!startsWith(exclude,_0x3b4de2[_0xba8d('0x19')])){members[_0x3b4de2['device']]={'channel':_0xba8d('0x1d'),'interface':_0x3b4de2[_0xba8d('0x19')],'type':_0xba8d('0x1e'),'enterAt':utils[_0xba8d('0x1f')](),'role':_0xba8d('0x20')};}break;case'NOT_INUSE':if(!_[_0xba8d('0x21')](members[_0x3b4de2[_0xba8d('0x19')]])){members[_0x3b4de2[_0xba8d('0x19')]][_0xba8d('0x22')]=utils[_0xba8d('0x1f')]();members[_0x3b4de2['device']][_0xba8d('0x23')]=utils[_0xba8d('0x24')](members[_0x3b4de2[_0xba8d('0x19')]][_0xba8d('0x22')],members[_0x3b4de2['device']][_0xba8d('0x25')]);if(members[_0x3b4de2[_0xba8d('0x19')]][_0xba8d('0x5')]){writeDB(members[_0x3b4de2[_0xba8d('0x19')]]);}}break;default:break;}}catch(_0x13c226){utils[_0xba8d('0x12')](util[_0xba8d('0x3')](_0xba8d('0x18'),members[_0x3b4de2[_0xba8d('0x19')]]?members[_0x3b4de2[_0xba8d('0x19')]][_0xba8d('0x5')]:_0x3b4de2[_0xba8d('0x19')]),_0x13c226);}};exports[_0xba8d('0x26')]=function(_0x1db60c){try{if(!_['isNil'](members[_0x1db60c[_0xba8d('0x6')]])){utils[_0xba8d('0x17')](util[_0xba8d('0x3')](_0xba8d('0x27'),_0x1db60c[_0xba8d('0x5')]),_0x1db60c);utils[_0xba8d('0x1a')](util[_0xba8d('0x3')](_0xba8d('0x28'),_0x1db60c[_0xba8d('0x5')],_0x1db60c['interface'],_0x1db60c['queue']));members[_0x1db60c[_0xba8d('0x6')]]=_['assign'](members[_0x1db60c['interface']],{'data4':_0x1db60c[_0xba8d('0x29')],'uniqueid':_0x1db60c[_0xba8d('0x5')]});}}catch(_0x495582){utils[_0xba8d('0x12')](util['format'](_0xba8d('0x27'),_0x1db60c[_0xba8d('0x5')]),_0x495582);}};exports[_0xba8d('0x2a')]=function(_0x2700eb){try{utils[_0xba8d('0x17')](util[_0xba8d('0x3')](_0xba8d('0x2b'),_0x2700eb[_0xba8d('0x5')]),_0x2700eb);if(_0x2700eb[_0xba8d('0x7')]){var _0x1e5369=_0x2700eb[_0xba8d('0x7')][_0xba8d('0x2c')]('-')[0x0];if(!_['isNil'](members[_0x1e5369])){members[_0x1e5369]=_[_0xba8d('0x2d')](members[_0x1e5369],{'data1':members[_0x1e5369][_0xba8d('0x2e')]||_0x2700eb[_0xba8d('0x2f')],'data2':members[_0x1e5369][_0xba8d('0x8')]||_0x2700eb['source'],'data3':members[_0x1e5369][_0xba8d('0x30')]||_0x2700eb['destination'],'uniqueid':members[_0x1e5369]['uniqueid']||_0x2700eb[_0xba8d('0x5')]});utils['info'](util[_0xba8d('0x3')](_0xba8d('0x31'),_0x2700eb['uniqueid'],members[_0x1e5369][_0xba8d('0x2e')],members[_0x1e5369][_0xba8d('0x8')],members[_0x1e5369]['data3']));if(members[_0x1e5369][_0xba8d('0x22')]){writeDB(members[_0x1e5369]);}}}if(_0x2700eb[_0xba8d('0x32')]){var _0x5c5c09=_0x2700eb['destinationchannel'][_0xba8d('0x2c')]('-')[0x0];if(!_[_0xba8d('0x21')](members[_0x5c5c09])){members[_0x5c5c09]=_[_0xba8d('0x2d')](members[_0x5c5c09],{'data1':members[_0x5c5c09]['data1']||_0x2700eb[_0xba8d('0x2f')],'data2':members[_0x5c5c09][_0xba8d('0x8')]||_0x2700eb[_0xba8d('0x33')],'data3':members[_0x5c5c09][_0xba8d('0x30')]||_0x2700eb[_0xba8d('0x34')],'uniqueid':members[_0x5c5c09][_0xba8d('0x5')]||_0x2700eb['uniqueid']});utils['info'](util[_0xba8d('0x3')](_0xba8d('0x31'),_0x2700eb[_0xba8d('0x5')],members[_0x5c5c09][_0xba8d('0x2e')],members[_0x5c5c09][_0xba8d('0x8')],members[_0x5c5c09][_0xba8d('0x30')]));if(members[_0x5c5c09][_0xba8d('0x22')]){writeDB(members[_0x5c5c09]);}}}}catch(_0x1505fd){utils[_0xba8d('0x12')](util[_0xba8d('0x3')](_0xba8d('0x2b'),_0x2700eb[_0xba8d('0x5')]),_0x1505fd);}}; \ No newline at end of file +var _0xa971=['queue','assign','data1','source','data3','destination','destinationchannel','[%s][members][cdr]','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','then','name','internal','request','CreateMemberReport','split','error','some','startsWith','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][agentcomplete]'];(function(_0x1487ba,_0x1cd9dd){var _0xbaf906=function(_0x27375c){while(--_0x27375c){_0x1487ba['push'](_0x1487ba['shift']());}};_0xbaf906(++_0x1cd9dd);}(_0xa971,0xc4));var _0x1a97=function(_0x52803d,_0x25f828){_0x52803d=_0x52803d-0x0;var _0x2bb1a2=_0xa971[_0x52803d];return _0x2bb1a2;};'use strict';var _=require(_0x1a97('0x0'));var util=require(_0x1a97('0x1'));var utils=require('./utils');var members={};var exclude=[_0x1a97('0x2'),_0x1a97('0x3')];function writeDB(_0x25f489){utils[_0x1a97('0x4')](util[_0x1a97('0x5')](_0x1a97('0x6'),_0x25f489[_0x1a97('0x7')],_0x25f489[_0x1a97('0x8')],_0x25f489[_0x1a97('0x9')],_0x25f489[_0x1a97('0xa')],_0x25f489[_0x1a97('0xb')],_0x25f489[_0x1a97('0xc')]));if(_0x25f489[_0x1a97('0x8')]){utils['getUserByInterface'](_0x25f489[_0x1a97('0x8')])[_0x1a97('0xd')](function(_0x5b5f5a){if(_0x5b5f5a){_0x25f489['membername']=_0x5b5f5a[_0x1a97('0xe')];_0x25f489[_0x1a97('0xf')]=_0x5b5f5a['internal'];utils[_0x1a97('0x10')](_0x1a97('0x11'),_0x25f489);}else{utils['getUserByName'](_0x25f489[_0x1a97('0x8')][_0x1a97('0x12')]('/')[0x1])['then'](function(_0x76716e){if(_0x76716e){_0x25f489['membername']=_0x76716e[_0x1a97('0xe')];_0x25f489[_0x1a97('0xf')]=_0x76716e[_0x1a97('0xf')];utils[_0x1a97('0x10')](_0x1a97('0x11'),_0x25f489);}});}})['catch'](function(_0x3d3484){utils[_0x1a97('0x13')](util[_0x1a97('0x5')]('[%s][members][writeDB]',_0x25f489[_0x1a97('0x7')]),_0x3d3484);});}delete members[_0x25f489[_0x1a97('0x8')]];}function startsWith(_0x4f49fe,_0x371816){return _[_0x1a97('0x14')](_0x4f49fe,function(_0x1354e1){return _[_0x1a97('0x15')](_0x371816,_0x1354e1);});}exports['devicestatechange']=function(_0x510611){try{utils[_0x1a97('0x16')](util[_0x1a97('0x5')](_0x1a97('0x17'),members[_0x510611[_0x1a97('0x18')]]?members[_0x510611['device']][_0x1a97('0x7')]:_0x510611[_0x1a97('0x18')]),_0x510611);utils[_0x1a97('0x4')](util[_0x1a97('0x5')](_0x1a97('0x19'),members[_0x510611[_0x1a97('0x18')]]?members[_0x510611[_0x1a97('0x18')]]['uniqueid']:_0x510611['device'],_0x510611[_0x1a97('0x1a')],_0x510611[_0x1a97('0x18')]));switch(_0x510611['state']){case _0x1a97('0x1b'):case _0x1a97('0x1c'):if(!startsWith(exclude,_0x510611['device'])){members[_0x510611[_0x1a97('0x18')]]={'channel':'voice','interface':_0x510611[_0x1a97('0x18')],'type':_0x1a97('0x1d'),'enterAt':utils[_0x1a97('0x1e')](),'role':_0x1a97('0x1f')};}break;case _0x1a97('0x20'):if(!_[_0x1a97('0x21')](members[_0x510611[_0x1a97('0x18')]])){members[_0x510611[_0x1a97('0x18')]][_0x1a97('0x22')]=utils['now']();members[_0x510611[_0x1a97('0x18')]][_0x1a97('0x23')]=utils[_0x1a97('0x24')](members[_0x510611[_0x1a97('0x18')]]['exitAt'],members[_0x510611['device']][_0x1a97('0x25')]);if(members[_0x510611[_0x1a97('0x18')]]['uniqueid']){writeDB(members[_0x510611['device']]);}}break;default:break;}}catch(_0x52206d){utils[_0x1a97('0x13')](util[_0x1a97('0x5')](_0x1a97('0x17'),members[_0x510611['device']]?members[_0x510611[_0x1a97('0x18')]]['uniqueid']:_0x510611[_0x1a97('0x18')]),_0x52206d);}};exports['agentcomplete']=function(_0x276582){try{if(!_[_0x1a97('0x21')](members[_0x276582['interface']])){utils['debug'](util['format'](_0x1a97('0x26'),_0x276582[_0x1a97('0x7')]),_0x276582);utils[_0x1a97('0x4')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x276582[_0x1a97('0x7')],_0x276582[_0x1a97('0x8')],_0x276582[_0x1a97('0x27')]));members[_0x276582[_0x1a97('0x8')]]=_[_0x1a97('0x28')](members[_0x276582['interface']],{'data4':_0x276582['queue'],'uniqueid':_0x276582['uniqueid']});}}catch(_0x4e884a){utils[_0x1a97('0x13')](util[_0x1a97('0x5')](_0x1a97('0x26'),_0x276582[_0x1a97('0x7')]),_0x4e884a);}};exports['cdr']=function(_0x1d7df1){try{utils[_0x1a97('0x16')](util['format']('[%s][members][cdr]',_0x1d7df1[_0x1a97('0x7')]),_0x1d7df1);if(_0x1d7df1[_0x1a97('0x9')]){var _0x277dc4=_0x1d7df1[_0x1a97('0x9')][_0x1a97('0x12')]('-')[0x0];if(!_[_0x1a97('0x21')](members[_0x277dc4])){members[_0x277dc4]=_['assign'](members[_0x277dc4],{'data1':members[_0x277dc4][_0x1a97('0x29')]||_0x1d7df1[_0x1a97('0xc')],'data2':members[_0x277dc4][_0x1a97('0xa')]||_0x1d7df1[_0x1a97('0x2a')],'data3':members[_0x277dc4][_0x1a97('0x2b')]||_0x1d7df1[_0x1a97('0x2c')],'uniqueid':members[_0x277dc4]['uniqueid']||_0x1d7df1['uniqueid']});utils[_0x1a97('0x4')](util[_0x1a97('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1d7df1[_0x1a97('0x7')],members[_0x277dc4]['data1'],members[_0x277dc4]['data2'],members[_0x277dc4][_0x1a97('0x2b')]));if(members[_0x277dc4][_0x1a97('0x22')]){writeDB(members[_0x277dc4]);}}}if(_0x1d7df1[_0x1a97('0x2d')]){var _0x3914ef=_0x1d7df1[_0x1a97('0x2d')][_0x1a97('0x12')]('-')[0x0];if(!_[_0x1a97('0x21')](members[_0x3914ef])){members[_0x3914ef]=_[_0x1a97('0x28')](members[_0x3914ef],{'data1':members[_0x3914ef][_0x1a97('0x29')]||_0x1d7df1[_0x1a97('0xc')],'data2':members[_0x3914ef][_0x1a97('0xa')]||_0x1d7df1[_0x1a97('0x2a')],'data3':members[_0x3914ef]['data3']||_0x1d7df1[_0x1a97('0x2c')],'uniqueid':members[_0x3914ef]['uniqueid']||_0x1d7df1[_0x1a97('0x7')]});utils[_0x1a97('0x4')](util[_0x1a97('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1d7df1[_0x1a97('0x7')],members[_0x3914ef][_0x1a97('0x29')],members[_0x3914ef]['data2'],members[_0x3914ef][_0x1a97('0x2b')]));if(members[_0x3914ef][_0x1a97('0x22')]){writeDB(members[_0x3914ef]);}}}}catch(_0x34c523){utils[_0x1a97('0x13')](util[_0x1a97('0x5')](_0x1a97('0x2e'),_0x1d7df1[_0x1a97('0x7')]),_0x34c523);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 9f96c0c..dc57986 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 _0xb2e6=['lodash','util','./utils','info','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','now','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','[%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','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s'];(function(_0x4c10c1,_0x91ffd0){var _0x326189=function(_0x1e5337){while(--_0x1e5337){_0x4c10c1['push'](_0x4c10c1['shift']());}};_0x326189(++_0x91ffd0);}(_0xb2e6,0x6d));var _0x6b2e=function(_0x1f1ad0,_0x1f8599){_0x1f1ad0=_0x1f1ad0-0x0;var _0x2bd433=_0xb2e6[_0x1f1ad0];return _0x2bd433;};'use strict';var _=require(_0x6b2e('0x0'));var util=require(_0x6b2e('0x1'));var utils=require(_0x6b2e('0x2'));var queues={};function writeDB(_0x153d75){utils[_0x6b2e('0x3')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x153d75[_0x6b2e('0x4')],_0x153d75[_0x6b2e('0x5')],_0x153d75['queue'],_0x153d75[_0x6b2e('0x6')],_0x153d75[_0x6b2e('0x7')],_0x153d75[_0x6b2e('0x8')],_0x153d75[_0x6b2e('0x9')]));if(_0x153d75['queue']){utils[_0x6b2e('0xa')](_0x153d75[_0x6b2e('0xb')])[_0x6b2e('0xc')](function(_0x85afba){if(_0x85afba){_0x153d75[_0x6b2e('0xd')]=_0x85afba['type'];}utils['request'](_0x6b2e('0xe'),_0x153d75);});}else{utils[_0x6b2e('0xf')](_0x6b2e('0xe'),_0x153d75);}if(_0x153d75[_0x6b2e('0x10')]){delete queues[_0x153d75[_0x6b2e('0x10')]];}else{delete queues[_0x153d75[_0x6b2e('0x4')]];}}exports[_0x6b2e('0x11')]=function(_0x1c90ad){try{utils[_0x6b2e('0x12')](util[_0x6b2e('0x13')](_0x6b2e('0x14'),_0x1c90ad[_0x6b2e('0x4')]),_0x1c90ad);utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x15'),_0x1c90ad[_0x6b2e('0x4')],_0x1c90ad[_0x6b2e('0xb')],_0x1c90ad[_0x6b2e('0x16')]));queues[_0x1c90ad[_0x6b2e('0x4')]]=_[_0x6b2e('0x17')](_0x1c90ad,{'originalposition':_0x1c90ad[_0x6b2e('0x16')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x26c921){utils[_0x6b2e('0x18')](util['format'](_0x6b2e('0x14'),_0x1c90ad[_0x6b2e('0x4')]),_0x26c921);}};exports[_0x6b2e('0x19')]=function(_0x4b1067){try{if(!_[_0x6b2e('0x1a')](queues[_0x4b1067[_0x6b2e('0x4')]])){utils[_0x6b2e('0x12')](util[_0x6b2e('0x13')](_0x6b2e('0x1b'),_0x4b1067['uniqueid']),_0x4b1067);if(queues[_0x4b1067['uniqueid']][_0x6b2e('0x1c')]){if(!queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x1d')]&&!queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x1e')]){queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x1f')]=!![];queues[_0x4b1067[_0x6b2e('0x4')]]['queuecallercompleteAt']=utils['now']();queues[_0x4b1067[_0x6b2e('0x4')]]['queuecallerexitreason']=_0x6b2e('0x20');}utils[_0x6b2e('0x3')](util['format'](_0x6b2e('0x21'),_0x4b1067[_0x6b2e('0x4')],queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x22')],queues[_0x4b1067['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x4b1067['uniqueid']]);}else if(queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x10')]){utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x4b1067[_0x6b2e('0x4')],queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x22')],queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x10')]));queues[queues[_0x4b1067[_0x6b2e('0x4')]]['transfereduniqueid']]=queues[_0x4b1067[_0x6b2e('0x4')]];queues[queues[_0x4b1067[_0x6b2e('0x4')]][_0x6b2e('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x4b1067[_0x6b2e('0x4')]];}}}catch(_0x277ea9){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')](_0x6b2e('0x1b'),_0x4b1067[_0x6b2e('0x4')]),_0x277ea9);}};exports['varset']=function(_0x91ce7e){try{utils[_0x6b2e('0x12')](util['format']('[%s][queues][varset]',_0x91ce7e[_0x6b2e('0x4')]),_0x91ce7e);if(!_[_0x6b2e('0x1a')](_0x91ce7e[_0x6b2e('0x23')][_0x6b2e('0x24')])&&_0x91ce7e[_0x6b2e('0x25')][_0x6b2e('0x26')]()!==_0x6b2e('0x27')){if(!_[_0x6b2e('0x1a')](queues[_0x91ce7e['uniqueid']])){queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x1d')]=![];queues[_0x91ce7e[_0x6b2e('0x4')]]['queuecallerabandonAt']=null;queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x1e')]=!![];queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x28')]=utils[_0x6b2e('0x29')]();queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x9')]=_0x91ce7e['value'][_0x6b2e('0x26')]();utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x91ce7e['uniqueid'],queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x22')],_0x91ce7e[_0x6b2e('0x25')],queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x9')]));writeDB(queues[_0x91ce7e[_0x6b2e('0x4')]]);}}else if(!_[_0x6b2e('0x1a')](_0x91ce7e[_0x6b2e('0x23')][_0x6b2e('0x2a')])){if(!_[_0x6b2e('0x1a')](queues[_0x91ce7e[_0x6b2e('0x4')]])&&!queues[_0x91ce7e['uniqueid']][_0x6b2e('0x1d')]){queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x1d')]=![];queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x2b')]=null;queues[_0x91ce7e['uniqueid']][_0x6b2e('0x1e')]=!![];queues[_0x91ce7e['uniqueid']]['queuecallerexitAt']=utils[_0x6b2e('0x29')]();queues[_0x91ce7e[_0x6b2e('0x4')]][_0x6b2e('0x9')]=_0x6b2e('0x2c');utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x91ce7e[_0x6b2e('0x4')],queues[_0x91ce7e[_0x6b2e('0x4')]]['name'],_0x91ce7e[_0x6b2e('0x25')],queues[_0x91ce7e[_0x6b2e('0x4')]]['queuecallerexitreason']));}}}catch(_0x17d18b){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')](_0x6b2e('0x2d'),_0x91ce7e[_0x6b2e('0x4')]),_0x17d18b);}};exports[_0x6b2e('0x1d')]=function(_0x377134){try{if(!_['isNil'](queues[_0x377134[_0x6b2e('0x4')]])){utils['debug'](util[_0x6b2e('0x13')]('[%s][queues][queuecallerabandon]',_0x377134[_0x6b2e('0x4')]),_0x377134);queues[_0x377134[_0x6b2e('0x4')]][_0x6b2e('0x1e')]=![];queues[_0x377134[_0x6b2e('0x4')]][_0x6b2e('0x28')]=null;queues[_0x377134[_0x6b2e('0x4')]][_0x6b2e('0x1d')]=!![];queues[_0x377134[_0x6b2e('0x4')]][_0x6b2e('0x2b')]=utils[_0x6b2e('0x29')]();queues[_0x377134['uniqueid']]['queuecallerexitreason']=_0x6b2e('0x2e');utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x2f'),_0x377134[_0x6b2e('0x4')],queues[_0x377134[_0x6b2e('0x4')]][_0x6b2e('0x22')],queues[_0x377134['uniqueid']][_0x6b2e('0x9')]));}}catch(_0x4eb11a){utils['error'](util[_0x6b2e('0x13')](_0x6b2e('0x30'),_0x377134['uniqueid']),_0x4eb11a);}};exports[_0x6b2e('0x31')]=function(_0x2c259d){try{if(!_[_0x6b2e('0x1a')](queues[_0x2c259d['uniqueid']])){utils['debug'](util[_0x6b2e('0x13')](_0x6b2e('0x32'),_0x2c259d['uniqueid']),_0x2c259d);utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x33'),_0x2c259d[_0x6b2e('0x4')],queues[_0x2c259d[_0x6b2e('0x4')]][_0x6b2e('0x22')],_0x2c259d['connectedlinenum'],_0x2c259d['connectedlinename']));queues[_0x2c259d[_0x6b2e('0x4')]][_0x6b2e('0x31')]=!![];queues[_0x2c259d[_0x6b2e('0x4')]]['queuecallerleaveAt']=utils[_0x6b2e('0x29')]();queues[_0x2c259d[_0x6b2e('0x4')]][_0x6b2e('0x34')]=utils[_0x6b2e('0x35')](queues[_0x2c259d[_0x6b2e('0x4')]]['queuecallerleaveAt'],queues[_0x2c259d[_0x6b2e('0x4')]][_0x6b2e('0x36')]);queues[_0x2c259d['uniqueid']]['position']=_0x2c259d[_0x6b2e('0x16')];queues[_0x2c259d[_0x6b2e('0x4')]][_0x6b2e('0x37')]=_0x2c259d[_0x6b2e('0x37')];queues[_0x2c259d[_0x6b2e('0x4')]]['connectedlinenum']=_0x2c259d[_0x6b2e('0x38')];queues[_0x2c259d['uniqueid']][_0x6b2e('0x39')]=_0x2c259d[_0x6b2e('0x39')];}}catch(_0x3c77f5){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')](_0x6b2e('0x32'),_0x2c259d['uniqueid']),_0x3c77f5);}};exports[_0x6b2e('0x3a')]=function(_0x2f831e){try{if(!_[_0x6b2e('0x1a')](queues[_0x2f831e[_0x6b2e('0x4')]])){utils[_0x6b2e('0x12')](util[_0x6b2e('0x13')]('[%s][queues][agentconnect]',_0x2f831e['uniqueid']),_0x2f831e);utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x3b'),_0x2f831e[_0x6b2e('0x4')],queues[_0x2f831e['uniqueid']][_0x6b2e('0x22')],_0x2f831e[_0x6b2e('0x3c')],_0x2f831e[_0x6b2e('0x3d')]));queues[_0x2f831e[_0x6b2e('0x4')]][_0x6b2e('0x1d')]=![];queues[_0x2f831e[_0x6b2e('0x4')]]['queuecallerabandon']=![];queues[_0x2f831e['uniqueid']][_0x6b2e('0x2b')]=null;queues[_0x2f831e[_0x6b2e('0x4')]][_0x6b2e('0x1e')]=![];queues[_0x2f831e[_0x6b2e('0x4')]][_0x6b2e('0x9')]=null;queues[_0x2f831e[_0x6b2e('0x4')]]['queuecallerexitAt']=null;queues[_0x2f831e[_0x6b2e('0x4')]]['assigned']=!![];queues[_0x2f831e['uniqueid']]['accountcode']=_0x2f831e[_0x6b2e('0x3d')];queues[_0x2f831e['uniqueid']][_0x6b2e('0x6')]=_0x2f831e['membername'];}}catch(_0x49a170){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')](_0x6b2e('0x3e'),_0x2f831e[_0x6b2e('0x4')]),_0x49a170);}};exports[_0x6b2e('0x3f')]=function(_0x53474b){try{if(!_[_0x6b2e('0x1a')](queues[_0x53474b['uniqueid']])){if(queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x1c')]){utils['debug'](util[_0x6b2e('0x13')](_0x6b2e('0x40'),_0x53474b[_0x6b2e('0x4')]),_0x53474b);queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x1d')]=![];queues[_0x53474b['uniqueid']][_0x6b2e('0x1d')]=![];queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x2b')]=null;queues[_0x53474b[_0x6b2e('0x4')]]['queuecallerexit']=![];queues[_0x53474b[_0x6b2e('0x4')]]['queuecallerexitAt']=null;queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x41')]=!![];queues[_0x53474b[_0x6b2e('0x4')]]['lastAssignedTo']=_0x53474b[_0x6b2e('0x3c')];queues[_0x53474b['uniqueid']][_0x6b2e('0x1f')]=!![];queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x42')]=utils[_0x6b2e('0x29')]();if(_0x53474b[_0x6b2e('0x43')]==_0x6b2e('0x44')){if(!queues[_0x53474b[_0x6b2e('0x4')]]['transfer']){queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x9')]=_0x6b2e('0x45');}}else{queues[_0x53474b[_0x6b2e('0x4')]]['queuecallerexitreason']=_0x6b2e('0x46')+_0x53474b[_0x6b2e('0x43')][_0x6b2e('0x26')]();}utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x47'),_0x53474b['uniqueid'],queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x22')],_0x53474b[_0x6b2e('0x3c')],queues[_0x53474b[_0x6b2e('0x4')]][_0x6b2e('0x9')]));writeDB(queues[_0x53474b[_0x6b2e('0x4')]]);}}}catch(_0x3e340a){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')]('[%s][queues][agentcomplete]',_0x53474b[_0x6b2e('0x4')]),_0x3e340a);}};exports[_0x6b2e('0x48')]=function(_0x65af31){try{if(!_[_0x6b2e('0x1a')](queues[_0x65af31[_0x6b2e('0x49')]])){utils['debug'](util['format']('[%s][queues][blindtransfer]',_0x65af31[_0x6b2e('0x4')]),_0x65af31);queues[_0x65af31[_0x6b2e('0x49')]][_0x6b2e('0x44')]=!![];queues[_0x65af31[_0x6b2e('0x49')]]['transfertype']=_0x6b2e('0x4a');queues[_0x65af31['transfereeuniqueid']][_0x6b2e('0x4b')]=_0x65af31[_0x6b2e('0x4c')];queues[_0x65af31[_0x6b2e('0x49')]][_0x6b2e('0x4d')]=_0x65af31[_0x6b2e('0x49')];queues[_0x65af31[_0x6b2e('0x49')]][_0x6b2e('0x9')]=_0x6b2e('0x4e');utils['info'](util['format'](_0x6b2e('0x4f'),_0x65af31[_0x6b2e('0x4')],queues[_0x65af31[_0x6b2e('0x49')]][_0x6b2e('0x22')],_0x65af31['transfereeuniqueid'],_0x65af31[_0x6b2e('0x4c')]));}}catch(_0x4df502){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')](_0x6b2e('0x50'),_0x65af31[_0x6b2e('0x4')]),_0x4df502);}};exports['attendedtransfer']=function(_0x4a6267){try{utils[_0x6b2e('0x12')](util['format'](_0x6b2e('0x51'),_0x4a6267[_0x6b2e('0x52')]),_0x4a6267);if(_0x4a6267[_0x6b2e('0x52')]==_0x4a6267['origtransfererlinkedid']){if(!_[_0x6b2e('0x1a')](queues[_0x4a6267[_0x6b2e('0x53')]])){utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x54'),_0x4a6267['origtransfereruniqueid'],queues[_0x4a6267['secondtransfererlinkedid']][_0x6b2e('0x22')],_0x4a6267[_0x6b2e('0x55')]));queues[_0x4a6267[_0x6b2e('0x53')]]['transfer']=!![];queues[_0x4a6267[_0x6b2e('0x53')]][_0x6b2e('0x56')]='ATTENDED';queues[_0x4a6267[_0x6b2e('0x53')]][_0x6b2e('0x4b')]=_0x4a6267[_0x6b2e('0x55')];queues[_0x4a6267[_0x6b2e('0x53')]][_0x6b2e('0x4d')]=_0x4a6267[_0x6b2e('0x52')];queues[_0x4a6267[_0x6b2e('0x53')]][_0x6b2e('0x9')]=_0x6b2e('0x57');}if(!_[_0x6b2e('0x1a')](queues[_0x4a6267[_0x6b2e('0x58')]])){if(_0x4a6267[_0x6b2e('0x59')]&&queues[_0x4a6267['transfereelinkedid']]){queues[_0x4a6267[_0x6b2e('0x59')]][_0x6b2e('0x5a')]=0x1;queues[_0x4a6267[_0x6b2e('0x49')]]=_[_0x6b2e('0x5b')](queues[_0x4a6267[_0x6b2e('0x59')]]);queues[_0x4a6267[_0x6b2e('0x49')]][_0x6b2e('0x10')]=_0x4a6267[_0x6b2e('0x5c')];queues[_0x4a6267[_0x6b2e('0x49')]]['queuecallerenterreason']=0x2;queues[_0x4a6267[_0x6b2e('0x49')]][_0x6b2e('0x7')]=queues[_0x4a6267[_0x6b2e('0x53')]][_0x6b2e('0x7')];queues[_0x4a6267['transfereeuniqueid']][_0x6b2e('0x5d')]=queues[_0x4a6267[_0x6b2e('0x53')]][_0x6b2e('0x5d')];queues[_0x4a6267[_0x6b2e('0x49')]]['queuecallerjoinAt']=utils[_0x6b2e('0x29')]();queues[_0x4a6267[_0x6b2e('0x49')]][_0x6b2e('0x1c')]=utils[_0x6b2e('0x29')]();queues[_0x4a6267[_0x6b2e('0x49')]][_0x6b2e('0x34')]=0x0;queues[_0x4a6267[_0x6b2e('0x49')]]['mohtime']=0x0;utils['info'](util['format'](_0x6b2e('0x5e'),_0x4a6267['origtransfereruniqueid'],queues[_0x4a6267[_0x6b2e('0x49')]][_0x6b2e('0x22')],queues[_0x4a6267['transfereeuniqueid']][_0x6b2e('0x7')],queues[_0x4a6267['transfereeuniqueid']][_0x6b2e('0x5d')]));}else{utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x5f'),_0x4a6267['origtransfereruniqueid'],queues[_0x4a6267[_0x6b2e('0x58')]]['name'],_0x4a6267[_0x6b2e('0x53')]));queues[_0x4a6267[_0x6b2e('0x58')]][_0x6b2e('0x10')]=_0x4a6267[_0x6b2e('0x53')];}}}else if(_0x4a6267[_0x6b2e('0x60')]==_0x4a6267[_0x6b2e('0x53')]){if(!_[_0x6b2e('0x1a')](queues[_0x4a6267['origtransfererlinkedid']])){utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x61'),_0x4a6267[_0x6b2e('0x52')],queues[_0x4a6267[_0x6b2e('0x58')]][_0x6b2e('0x22')],_0x4a6267[_0x6b2e('0x60')],_0x4a6267[_0x6b2e('0x62')]));queues[_0x4a6267[_0x6b2e('0x58')]][_0x6b2e('0x44')]=!![];queues[_0x4a6267[_0x6b2e('0x58')]][_0x6b2e('0x56')]=_0x6b2e('0x63');queues[_0x4a6267['origtransfererlinkedid']][_0x6b2e('0x4b')]=_0x4a6267['secondtransfererexten'];queues[_0x4a6267[_0x6b2e('0x58')]][_0x6b2e('0x4d')]=_0x4a6267[_0x6b2e('0x60')];queues[_0x4a6267[_0x6b2e('0x58')]][_0x6b2e('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x4a6267['secondtransfererlinkedid']])){if(_0x4a6267[_0x6b2e('0x64')]&&queues[_0x4a6267[_0x6b2e('0x64')]]){queues[_0x4a6267[_0x6b2e('0x64')]][_0x6b2e('0x5a')]=0x1;queues[_0x4a6267[_0x6b2e('0x5c')]]=_[_0x6b2e('0x5b')](queues[_0x4a6267[_0x6b2e('0x64')]]);queues[_0x4a6267[_0x6b2e('0x5c')]][_0x6b2e('0x10')]=_0x4a6267[_0x6b2e('0x5c')];queues[_0x4a6267[_0x6b2e('0x5c')]][_0x6b2e('0x5a')]=0x2;queues[_0x4a6267[_0x6b2e('0x5c')]]['calleridnum']=queues[_0x4a6267[_0x6b2e('0x58')]]['calleridnum'];queues[_0x4a6267[_0x6b2e('0x5c')]][_0x6b2e('0x5d')]=queues[_0x4a6267[_0x6b2e('0x58')]][_0x6b2e('0x5d')];queues[_0x4a6267[_0x6b2e('0x5c')]]['queuecallerjoinAt']=utils[_0x6b2e('0x29')]();queues[_0x4a6267[_0x6b2e('0x5c')]][_0x6b2e('0x1c')]=utils['now']();queues[_0x4a6267['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x4a6267[_0x6b2e('0x5c')]][_0x6b2e('0x65')]=0x0;utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x66'),_0x4a6267['origtransfereruniqueid'],queues[_0x4a6267[_0x6b2e('0x5c')]][_0x6b2e('0x22')],queues[_0x4a6267['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x4a6267['transfertargetuniqueid']][_0x6b2e('0x7')],queues[_0x4a6267[_0x6b2e('0x5c')]]['calleridname']));}else{utils['info'](util[_0x6b2e('0x13')](_0x6b2e('0x5f'),_0x4a6267[_0x6b2e('0x52')],queues[_0x4a6267['secondtransfererlinkedid']][_0x6b2e('0x22')],_0x4a6267[_0x6b2e('0x58')]));queues[_0x4a6267['secondtransfererlinkedid']]['transfereduniqueid']=_0x4a6267['origtransfererlinkedid'];}}}}catch(_0x5d36b0){utils[_0x6b2e('0x18')](util['format'](_0x6b2e('0x51'),_0x4a6267[_0x6b2e('0x52')]),_0x5d36b0);}};exports[_0x6b2e('0x67')]=function(_0x3045eb){try{if(!_['isNil'](queues[_0x3045eb[_0x6b2e('0x4')]])){utils[_0x6b2e('0x12')](util['format'](_0x6b2e('0x68'),_0x3045eb['uniqueid']),_0x3045eb);queues[_0x3045eb['uniqueid']][_0x6b2e('0x69')]=utils[_0x6b2e('0x29')]();utils['info'](util['format'](_0x6b2e('0x6a'),_0x3045eb[_0x6b2e('0x4')],queues[_0x3045eb[_0x6b2e('0x4')]][_0x6b2e('0x22')],queues[_0x3045eb['uniqueid']][_0x6b2e('0x69')]));}}catch(_0x584010){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')](_0x6b2e('0x68'),_0x3045eb[_0x6b2e('0x4')]),_0x584010);}};exports['musiconholdstop']=function(_0x452a46){try{if(!_['isNil'](queues[_0x452a46['uniqueid']])){if(!_[_0x6b2e('0x1a')](queues[_0x452a46[_0x6b2e('0x4')]][_0x6b2e('0x69')])){utils[_0x6b2e('0x12')](util[_0x6b2e('0x13')](_0x6b2e('0x6b'),_0x452a46['uniqueid']),_0x452a46);queues[_0x452a46[_0x6b2e('0x4')]]['mohtime']+=utils['diffTime'](utils[_0x6b2e('0x29')](),queues[_0x452a46[_0x6b2e('0x4')]][_0x6b2e('0x69')]);utils[_0x6b2e('0x3')](util[_0x6b2e('0x13')](_0x6b2e('0x6c'),_0x452a46['uniqueid'],queues[_0x452a46['uniqueid']][_0x6b2e('0x22')],queues[_0x452a46[_0x6b2e('0x4')]][_0x6b2e('0x65')]));delete queues[_0x452a46[_0x6b2e('0x4')]][_0x6b2e('0x69')];}}}catch(_0x88f943){utils[_0x6b2e('0x18')](util[_0x6b2e('0x13')]('[%s][queues][musiconholdstop]',_0x452a46[_0x6b2e('0x4')]),_0x88f943);}}; \ No newline at end of file +var _0x495a=['error','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercompleteAt','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','transfereduniqueid','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexitAt','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleaveAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','queuecallerexit','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','type','request','CreateVoiceQueueReport','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x495a,0xb9));var _0xa495=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x495a[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xa495('0x0'));var util=require(_0xa495('0x1'));var utils=require(_0xa495('0x2'));var queues={};function writeDB(_0x4ad965){utils[_0xa495('0x3')](util[_0xa495('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x4ad965['uniqueid'],_0x4ad965[_0xa495('0x5')],_0x4ad965[_0xa495('0x6')],_0x4ad965[_0xa495('0x7')],_0x4ad965[_0xa495('0x8')],_0x4ad965[_0xa495('0x9')],_0x4ad965[_0xa495('0xa')]));if(_0x4ad965[_0xa495('0x6')]){utils['getVoiceQueueByName'](_0x4ad965[_0xa495('0x6')])['then'](function(_0x457883){if(_0x457883){_0x4ad965[_0xa495('0xb')]=_0x457883[_0xa495('0xb')];}utils[_0xa495('0xc')](_0xa495('0xd'),_0x4ad965);});}else{utils['request'](_0xa495('0xd'),_0x4ad965);}if(_0x4ad965['transfereduniqueid']){delete queues[_0x4ad965['transfereduniqueid']];}else{delete queues[_0x4ad965[_0xa495('0xe')]];}}exports[_0xa495('0xf')]=function(_0x5afcdc){try{utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x11'),_0x5afcdc[_0xa495('0xe')]),_0x5afcdc);utils[_0xa495('0x3')](util[_0xa495('0x4')](_0xa495('0x12'),_0x5afcdc['uniqueid'],_0x5afcdc['queue'],_0x5afcdc['position']));queues[_0x5afcdc['uniqueid']]=_['assign'](_0x5afcdc,{'originalposition':_0x5afcdc[_0xa495('0x13')],'queuecallerjoinAt':utils[_0xa495('0x14')](),'mohtime':0x0});}catch(_0x3eb810){utils[_0xa495('0x15')](util[_0xa495('0x4')](_0xa495('0x11'),_0x5afcdc[_0xa495('0xe')]),_0x3eb810);}};exports['hangup']=function(_0x2f5702){try{if(!_[_0xa495('0x16')](queues[_0x2f5702['uniqueid']])){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x17'),_0x2f5702['uniqueid']),_0x2f5702);if(queues[_0x2f5702['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x2f5702['uniqueid']][_0xa495('0x18')]&&!queues[_0x2f5702[_0xa495('0xe')]]['queuecallerexit']){queues[_0x2f5702[_0xa495('0xe')]]['queuecallercomplete']=!![];queues[_0x2f5702[_0xa495('0xe')]][_0xa495('0x19')]=utils[_0xa495('0x14')]();queues[_0x2f5702[_0xa495('0xe')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils['info'](util[_0xa495('0x4')](_0xa495('0x1a'),_0x2f5702['uniqueid'],queues[_0x2f5702['uniqueid']]['name'],queues[_0x2f5702['uniqueid']][_0xa495('0xa')]));writeDB(queues[_0x2f5702['uniqueid']]);}else if(queues[_0x2f5702[_0xa495('0xe')]][_0xa495('0x1b')]){utils[_0xa495('0x3')](util[_0xa495('0x4')](_0xa495('0x1c'),_0x2f5702[_0xa495('0xe')],queues[_0x2f5702[_0xa495('0xe')]][_0xa495('0x1d')],queues[_0x2f5702[_0xa495('0xe')]][_0xa495('0x1b')]));queues[queues[_0x2f5702[_0xa495('0xe')]][_0xa495('0x1b')]]=queues[_0x2f5702['uniqueid']];queues[queues[_0x2f5702[_0xa495('0xe')]][_0xa495('0x1b')]][_0xa495('0x1e')]=0x2;delete queues[_0x2f5702[_0xa495('0xe')]];}}}catch(_0x1d2d6c){utils['error'](util[_0xa495('0x4')](_0xa495('0x17'),_0x2f5702[_0xa495('0xe')]),_0x1d2d6c);}};exports[_0xa495('0x1f')]=function(_0xd6fff1){try{utils[_0xa495('0x10')](util['format']('[%s][queues][varset]',_0xd6fff1['uniqueid']),_0xd6fff1);if(!_['isNil'](_0xd6fff1[_0xa495('0x20')][_0xa495('0x21')])&&_0xd6fff1[_0xa495('0x22')][_0xa495('0x23')]()!==_0xa495('0x24')){if(!_[_0xa495('0x16')](queues[_0xd6fff1['uniqueid']])){queues[_0xd6fff1['uniqueid']]['queuecallerabandon']=![];queues[_0xd6fff1['uniqueid']]['queuecallerabandonAt']=null;queues[_0xd6fff1[_0xa495('0xe')]]['queuecallerexit']=!![];queues[_0xd6fff1['uniqueid']][_0xa495('0x25')]=utils[_0xa495('0x14')]();queues[_0xd6fff1[_0xa495('0xe')]]['queuecallerexitreason']=_0xd6fff1[_0xa495('0x22')]['toUpperCase']();utils['info'](util[_0xa495('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0xd6fff1[_0xa495('0xe')],queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0x1d')],_0xd6fff1['value'],queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0xa')]));writeDB(queues[_0xd6fff1[_0xa495('0xe')]]);}}else if(!_[_0xa495('0x16')](_0xd6fff1[_0xa495('0x20')][_0xa495('0x26')])){if(!_[_0xa495('0x16')](queues[_0xd6fff1[_0xa495('0xe')]])&&!queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0x18')]){queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0x18')]=![];queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0x27')]=null;queues[_0xd6fff1['uniqueid']]['queuecallerexit']=!![];queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0x25')]=utils[_0xa495('0x14')]();queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0xa')]=_0xa495('0x28');utils[_0xa495('0x3')](util['format'](_0xa495('0x29'),_0xd6fff1[_0xa495('0xe')],queues[_0xd6fff1[_0xa495('0xe')]][_0xa495('0x1d')],_0xd6fff1['value'],queues[_0xd6fff1[_0xa495('0xe')]]['queuecallerexitreason']));}}}catch(_0x31e37c){utils['error'](util['format'](_0xa495('0x2a'),_0xd6fff1[_0xa495('0xe')]),_0x31e37c);}};exports['queuecallerabandon']=function(_0xca04e0){try{if(!_['isNil'](queues[_0xca04e0[_0xa495('0xe')]])){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x2b'),_0xca04e0[_0xa495('0xe')]),_0xca04e0);queues[_0xca04e0['uniqueid']]['queuecallerexit']=![];queues[_0xca04e0[_0xa495('0xe')]][_0xa495('0x25')]=null;queues[_0xca04e0[_0xa495('0xe')]][_0xa495('0x18')]=!![];queues[_0xca04e0[_0xa495('0xe')]][_0xa495('0x27')]=utils[_0xa495('0x14')]();queues[_0xca04e0[_0xa495('0xe')]][_0xa495('0xa')]=_0xa495('0x2c');utils[_0xa495('0x3')](util['format'](_0xa495('0x2d'),_0xca04e0[_0xa495('0xe')],queues[_0xca04e0[_0xa495('0xe')]][_0xa495('0x1d')],queues[_0xca04e0[_0xa495('0xe')]]['queuecallerexitreason']));}}catch(_0x20ed42){utils[_0xa495('0x15')](util[_0xa495('0x4')](_0xa495('0x2b'),_0xca04e0[_0xa495('0xe')]),_0x20ed42);}};exports[_0xa495('0x2e')]=function(_0x18a85e){try{if(!_[_0xa495('0x16')](queues[_0x18a85e[_0xa495('0xe')]])){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x2f'),_0x18a85e['uniqueid']),_0x18a85e);utils['info'](util[_0xa495('0x4')](_0xa495('0x30'),_0x18a85e[_0xa495('0xe')],queues[_0x18a85e[_0xa495('0xe')]][_0xa495('0x1d')],_0x18a85e[_0xa495('0x31')],_0x18a85e['connectedlinename']));queues[_0x18a85e['uniqueid']][_0xa495('0x2e')]=!![];queues[_0x18a85e[_0xa495('0xe')]][_0xa495('0x32')]=utils['now']();queues[_0x18a85e[_0xa495('0xe')]]['holdtime']=utils['diffTime'](queues[_0x18a85e[_0xa495('0xe')]][_0xa495('0x32')],queues[_0x18a85e[_0xa495('0xe')]]['queuecallerjoinAt']);queues[_0x18a85e[_0xa495('0xe')]]['position']=_0x18a85e[_0xa495('0x13')];queues[_0x18a85e['uniqueid']][_0xa495('0x33')]=_0x18a85e[_0xa495('0x33')];queues[_0x18a85e[_0xa495('0xe')]][_0xa495('0x31')]=_0x18a85e[_0xa495('0x31')];queues[_0x18a85e[_0xa495('0xe')]]['connectedlinename']=_0x18a85e[_0xa495('0x34')];}}catch(_0x43e255){utils[_0xa495('0x15')](util[_0xa495('0x4')](_0xa495('0x2f'),_0x18a85e[_0xa495('0xe')]),_0x43e255);}};exports[_0xa495('0x35')]=function(_0x20858f){try{if(!_['isNil'](queues[_0x20858f['uniqueid']])){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x36'),_0x20858f[_0xa495('0xe')]),_0x20858f);utils[_0xa495('0x3')](util[_0xa495('0x4')](_0xa495('0x37'),_0x20858f[_0xa495('0xe')],queues[_0x20858f[_0xa495('0xe')]][_0xa495('0x1d')],_0x20858f[_0xa495('0x38')],_0x20858f[_0xa495('0x39')]));queues[_0x20858f[_0xa495('0xe')]][_0xa495('0x18')]=![];queues[_0x20858f['uniqueid']]['queuecallerabandon']=![];queues[_0x20858f[_0xa495('0xe')]]['queuecallerabandonAt']=null;queues[_0x20858f[_0xa495('0xe')]][_0xa495('0x3a')]=![];queues[_0x20858f[_0xa495('0xe')]][_0xa495('0xa')]=null;queues[_0x20858f[_0xa495('0xe')]]['queuecallerexitAt']=null;queues[_0x20858f['uniqueid']][_0xa495('0x3b')]=!![];queues[_0x20858f[_0xa495('0xe')]][_0xa495('0x9')]=_0x20858f[_0xa495('0x39')];queues[_0x20858f[_0xa495('0xe')]][_0xa495('0x7')]=_0x20858f[_0xa495('0x38')];}}catch(_0x56a13){utils[_0xa495('0x15')](util[_0xa495('0x4')](_0xa495('0x36'),_0x20858f['uniqueid']),_0x56a13);}};exports[_0xa495('0x3c')]=function(_0x3fc52e){try{if(!_[_0xa495('0x16')](queues[_0x3fc52e['uniqueid']])){if(queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0x32')]){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x3d'),_0x3fc52e[_0xa495('0xe')]),_0x3fc52e);queues[_0x3fc52e['uniqueid']]['queuecallerabandon']=![];queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0x18')]=![];queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0x27')]=null;queues[_0x3fc52e['uniqueid']][_0xa495('0x3a')]=![];queues[_0x3fc52e[_0xa495('0xe')]]['queuecallerexitAt']=null;queues[_0x3fc52e[_0xa495('0xe')]]['assigned']=!![];queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0x7')]=_0x3fc52e['membername'];queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0x3e')]=!![];queues[_0x3fc52e[_0xa495('0xe')]]['queuecallercompleteAt']=utils['now']();if(_0x3fc52e[_0xa495('0x3f')]=='transfer'){if(!queues[_0x3fc52e['uniqueid']][_0xa495('0x40')]){queues[_0x3fc52e[_0xa495('0xe')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0xa')]='COMPLETEDBY'+_0x3fc52e[_0xa495('0x3f')][_0xa495('0x23')]();}utils['info'](util[_0xa495('0x4')](_0xa495('0x41'),_0x3fc52e[_0xa495('0xe')],queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0x1d')],_0x3fc52e[_0xa495('0x38')],queues[_0x3fc52e[_0xa495('0xe')]][_0xa495('0xa')]));writeDB(queues[_0x3fc52e[_0xa495('0xe')]]);}}}catch(_0xdb7777){utils[_0xa495('0x15')](util[_0xa495('0x4')]('[%s][queues][agentcomplete]',_0x3fc52e[_0xa495('0xe')]),_0xdb7777);}};exports[_0xa495('0x42')]=function(_0x461858){try{if(!_[_0xa495('0x16')](queues[_0x461858[_0xa495('0x43')]])){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x44'),_0x461858[_0xa495('0xe')]),_0x461858);queues[_0x461858[_0xa495('0x43')]][_0xa495('0x40')]=!![];queues[_0x461858[_0xa495('0x43')]][_0xa495('0x45')]=_0xa495('0x46');queues[_0x461858[_0xa495('0x43')]][_0xa495('0x47')]=_0x461858[_0xa495('0x48')];queues[_0x461858[_0xa495('0x43')]][_0xa495('0x49')]=_0x461858[_0xa495('0x43')];queues[_0x461858[_0xa495('0x43')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0xa495('0x4')](_0xa495('0x4a'),_0x461858['uniqueid'],queues[_0x461858[_0xa495('0x43')]][_0xa495('0x1d')],_0x461858['transfereeuniqueid'],_0x461858[_0xa495('0x48')]));}}catch(_0x335b6d){utils[_0xa495('0x15')](util[_0xa495('0x4')](_0xa495('0x44'),_0x461858[_0xa495('0xe')]),_0x335b6d);}};exports['attendedtransfer']=function(_0x4f5285){try{utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x4b'),_0x4f5285['origtransfereruniqueid']),_0x4f5285);if(_0x4f5285[_0xa495('0x4c')]==_0x4f5285[_0xa495('0x4d')]){if(!_['isNil'](queues[_0x4f5285[_0xa495('0x4e')]])){utils[_0xa495('0x3')](util[_0xa495('0x4')](_0xa495('0x4f'),_0x4f5285[_0xa495('0x4c')],queues[_0x4f5285[_0xa495('0x4e')]][_0xa495('0x1d')],_0x4f5285[_0xa495('0x50')]));queues[_0x4f5285[_0xa495('0x4e')]][_0xa495('0x40')]=!![];queues[_0x4f5285[_0xa495('0x4e')]][_0xa495('0x45')]=_0xa495('0x51');queues[_0x4f5285[_0xa495('0x4e')]][_0xa495('0x47')]=_0x4f5285[_0xa495('0x50')];queues[_0x4f5285[_0xa495('0x4e')]][_0xa495('0x49')]=_0x4f5285[_0xa495('0x4c')];queues[_0x4f5285['secondtransfererlinkedid']][_0xa495('0xa')]=_0xa495('0x52');}if(!_[_0xa495('0x16')](queues[_0x4f5285[_0xa495('0x4d')]])){if(_0x4f5285[_0xa495('0x53')]&&queues[_0x4f5285[_0xa495('0x53')]]){queues[_0x4f5285[_0xa495('0x53')]]['queuecallerenterreason']=0x1;queues[_0x4f5285[_0xa495('0x43')]]=_['clone'](queues[_0x4f5285['transfereelinkedid']]);queues[_0x4f5285[_0xa495('0x43')]][_0xa495('0x1b')]=_0x4f5285[_0xa495('0x54')];queues[_0x4f5285[_0xa495('0x43')]][_0xa495('0x1e')]=0x2;queues[_0x4f5285[_0xa495('0x43')]]['calleridnum']=queues[_0x4f5285[_0xa495('0x4e')]][_0xa495('0x8')];queues[_0x4f5285['transfereeuniqueid']][_0xa495('0x55')]=queues[_0x4f5285[_0xa495('0x4e')]]['calleridname'];queues[_0x4f5285[_0xa495('0x43')]]['queuecallerjoinAt']=utils[_0xa495('0x14')]();queues[_0x4f5285[_0xa495('0x43')]][_0xa495('0x32')]=utils[_0xa495('0x14')]();queues[_0x4f5285[_0xa495('0x43')]][_0xa495('0x56')]=0x0;queues[_0x4f5285['transfereeuniqueid']][_0xa495('0x57')]=0x0;utils[_0xa495('0x3')](util[_0xa495('0x4')](_0xa495('0x58'),_0x4f5285[_0xa495('0x4c')],queues[_0x4f5285[_0xa495('0x43')]]['name'],queues[_0x4f5285[_0xa495('0x43')]]['calleridnum'],queues[_0x4f5285[_0xa495('0x43')]][_0xa495('0x55')]));}else{utils[_0xa495('0x3')](util[_0xa495('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4f5285[_0xa495('0x4c')],queues[_0x4f5285[_0xa495('0x4d')]]['name'],_0x4f5285['secondtransfererlinkedid']));queues[_0x4f5285[_0xa495('0x4d')]][_0xa495('0x1b')]=_0x4f5285[_0xa495('0x4e')];}}}else if(_0x4f5285[_0xa495('0x59')]==_0x4f5285[_0xa495('0x4e')]){if(!_[_0xa495('0x16')](queues[_0x4f5285['origtransfererlinkedid']])){utils['info'](util[_0xa495('0x4')](_0xa495('0x5a'),_0x4f5285[_0xa495('0x4c')],queues[_0x4f5285[_0xa495('0x4d')]]['name'],_0x4f5285[_0xa495('0x59')],_0x4f5285['secondtransfererexten']));queues[_0x4f5285['origtransfererlinkedid']][_0xa495('0x40')]=!![];queues[_0x4f5285[_0xa495('0x4d')]][_0xa495('0x45')]=_0xa495('0x51');queues[_0x4f5285[_0xa495('0x4d')]]['transferexten']=_0x4f5285[_0xa495('0x5b')];queues[_0x4f5285[_0xa495('0x4d')]]['transferuniqueid']=_0x4f5285['secondtransfereruniqueid'];queues[_0x4f5285[_0xa495('0x4d')]][_0xa495('0xa')]=_0xa495('0x52');}if(!_[_0xa495('0x16')](queues[_0x4f5285['secondtransfererlinkedid']])){if(_0x4f5285[_0xa495('0x5c')]&&queues[_0x4f5285['transfertargetlinkedid']]){queues[_0x4f5285[_0xa495('0x5c')]][_0xa495('0x1e')]=0x1;queues[_0x4f5285[_0xa495('0x54')]]=_[_0xa495('0x5d')](queues[_0x4f5285[_0xa495('0x5c')]]);queues[_0x4f5285[_0xa495('0x54')]][_0xa495('0x1b')]=_0x4f5285[_0xa495('0x54')];queues[_0x4f5285['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x4f5285['transfertargetuniqueid']][_0xa495('0x8')]=queues[_0x4f5285[_0xa495('0x4d')]][_0xa495('0x8')];queues[_0x4f5285[_0xa495('0x54')]]['calleridname']=queues[_0x4f5285['origtransfererlinkedid']][_0xa495('0x55')];queues[_0x4f5285[_0xa495('0x54')]]['queuecallerjoinAt']=utils['now']();queues[_0x4f5285[_0xa495('0x54')]][_0xa495('0x32')]=utils[_0xa495('0x14')]();queues[_0x4f5285['transfertargetuniqueid']][_0xa495('0x56')]=0x0;queues[_0x4f5285[_0xa495('0x54')]]['mohtime']=0x0;utils['info'](util[_0xa495('0x4')](_0xa495('0x5e'),_0x4f5285[_0xa495('0x4c')],queues[_0x4f5285[_0xa495('0x54')]][_0xa495('0x1d')],queues[_0x4f5285['transfertargetuniqueid']][_0xa495('0x1b')],queues[_0x4f5285['transfertargetuniqueid']]['calleridnum'],queues[_0x4f5285[_0xa495('0x54')]][_0xa495('0x55')]));}else{utils[_0xa495('0x3')](util[_0xa495('0x4')](_0xa495('0x5f'),_0x4f5285[_0xa495('0x4c')],queues[_0x4f5285[_0xa495('0x4e')]][_0xa495('0x1d')],_0x4f5285[_0xa495('0x4d')]));queues[_0x4f5285[_0xa495('0x4e')]]['transfereduniqueid']=_0x4f5285['origtransfererlinkedid'];}}}}catch(_0x22cc63){utils[_0xa495('0x15')](util['format'](_0xa495('0x4b'),_0x4f5285['origtransfereruniqueid']),_0x22cc63);}};exports[_0xa495('0x60')]=function(_0x400e16){try{if(!_['isNil'](queues[_0x400e16['uniqueid']])){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x61'),_0x400e16[_0xa495('0xe')]),_0x400e16);queues[_0x400e16[_0xa495('0xe')]][_0xa495('0x62')]=utils[_0xa495('0x14')]();utils[_0xa495('0x3')](util['format'](_0xa495('0x63'),_0x400e16[_0xa495('0xe')],queues[_0x400e16['uniqueid']]['name'],queues[_0x400e16[_0xa495('0xe')]][_0xa495('0x62')]));}}catch(_0x23acd6){utils[_0xa495('0x15')](util[_0xa495('0x4')](_0xa495('0x61'),_0x400e16[_0xa495('0xe')]),_0x23acd6);}};exports[_0xa495('0x64')]=function(_0x20944f){try{if(!_[_0xa495('0x16')](queues[_0x20944f[_0xa495('0xe')]])){if(!_[_0xa495('0x16')](queues[_0x20944f[_0xa495('0xe')]]['musiconholdstartAt'])){utils[_0xa495('0x10')](util[_0xa495('0x4')](_0xa495('0x65'),_0x20944f[_0xa495('0xe')]),_0x20944f);queues[_0x20944f[_0xa495('0xe')]][_0xa495('0x57')]+=utils['diffTime'](utils['now'](),queues[_0x20944f[_0xa495('0xe')]][_0xa495('0x62')]);utils[_0xa495('0x3')](util['format'](_0xa495('0x66'),_0x20944f[_0xa495('0xe')],queues[_0x20944f['uniqueid']][_0xa495('0x1d')],queues[_0x20944f[_0xa495('0xe')]][_0xa495('0x57')]));delete queues[_0x20944f[_0xa495('0xe')]][_0xa495('0x62')];}}}catch(_0x36f64d){utils['error'](util[_0xa495('0x4')]('[%s][queues][musiconholdstop]',_0x20944f['uniqueid']),_0x36f64d);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d34f185..bf98957 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 _0x645f=['isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][varset]','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','newexten','[%s][recordings][newexten]','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','getUserByInternal','accountcode','then','name','UserId','CreateVoiceRecording','request','newchannel','debug','format','[%s][recordings][newchannel]','context','exten','channel','error','newstate','[%s][recordings][newstate]'];(function(_0x4ab6a0,_0x5314d1){var _0x30deca=function(_0x3f3d88){while(--_0x3f3d88){_0x4ab6a0['push'](_0x4ab6a0['shift']());}};_0x30deca(++_0x5314d1);}(_0x645f,0x10b));var _0xf645=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x645f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf645('0x0'));var util=require(_0xf645('0x1'));var utils=require(_0xf645('0x2'));var transfers=require(_0xf645('0x3'));var recordings={};function writeDB(_0x22fa43){var _0x2c1717;utils[_0xf645('0x4')](util['format'](_0xf645('0x5'),_0x22fa43['uniqueid']));if(transfers[_0xf645('0x6')][_0x22fa43['uniqueid']]){_0x2c1717=_0x22fa43[_0xf645('0x7')];_0x22fa43[_0xf645('0x7')]=transfers[_0xf645('0x6')][_0x22fa43[_0xf645('0x7')]]['transfereeuniqueid'];}if(_0x22fa43['accountcode']){utils[_0xf645('0x8')](_0x22fa43[_0xf645('0x9')])[_0xf645('0xa')](function(_0x33c917){if(_0x33c917){_0x22fa43['membername']=_0x33c917[_0xf645('0xb')];_0x22fa43[_0xf645('0xc')]=_0x33c917['id'];}utils['request'](_0xf645('0xd'),_0x22fa43);});}else{utils[_0xf645('0xe')]('CreateVoiceRecording',_0x22fa43);}if(_0x2c1717)delete transfers[_0xf645('0x6')][_0x2c1717];}exports[_0xf645('0xf')]=function(_0x20493c){try{utils[_0xf645('0x10')](util[_0xf645('0x11')](_0xf645('0x12'),_0x20493c[_0xf645('0x7')]),_0x20493c);if(_0x20493c['uniqueid']==_0x20493c['linkedid']){utils[_0xf645('0x4')](util[_0xf645('0x11')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x20493c[_0xf645('0x7')],_0x20493c[_0xf645('0x13')],_0x20493c['exten']));recordings[_0x20493c[_0xf645('0x7')]]={'uniqueid':_0x20493c[_0xf645('0x7')],'accountcode':_0x20493c[_0xf645('0x9')],'exten':_0x20493c[_0xf645('0x14')],'context':_0x20493c[_0xf645('0x13')],'channel':_0x20493c[_0xf645('0x15')],'monitors':[]};}}catch(_0x2e75c0){utils[_0xf645('0x16')](util['format']('[%s][recordings][newchannel]',_0x20493c[_0xf645('0x7')]),_0x2e75c0);}};exports[_0xf645('0x17')]=function(_0x4bddd3){try{utils[_0xf645('0x10')](util[_0xf645('0x11')](_0xf645('0x18'),_0x4bddd3[_0xf645('0x7')]),_0x4bddd3);if(!_[_0xf645('0x19')](recordings[_0x4bddd3[_0xf645('0x7')]])&&_0x4bddd3[_0xf645('0x1a')]==0x6){utils['info'](util[_0xf645('0x11')](_0xf645('0x1b'),_0x4bddd3[_0xf645('0x7')],_0x4bddd3[_0xf645('0x13')],_0x4bddd3['channel']));}else if(!_[_0xf645('0x19')](recordings[_0x4bddd3[_0xf645('0x1c')]])&&_0x4bddd3['channelstate']==0x6&&_0x4bddd3[_0xf645('0x13')]!=_0xf645('0x1d')){utils[_0xf645('0x4')](util[_0xf645('0x11')](_0xf645('0x1e'),_0x4bddd3[_0xf645('0x7')],_0x4bddd3[_0xf645('0x1c')],_0x4bddd3[_0xf645('0x13')],_0x4bddd3[_0xf645('0x15')]));recordings[_0x4bddd3[_0xf645('0x1c')]][_0xf645('0x9')]=_0x4bddd3[_0xf645('0x9')];}}catch(_0x263652){utils[_0xf645('0x16')](util[_0xf645('0x11')]('[%s][recordings][newstate]',_0x4bddd3[_0xf645('0x7')]),_0x263652);}};exports[_0xf645('0x1f')]=function(_0x2816ce){try{if(!_[_0xf645('0x19')](_0x2816ce[_0xf645('0x20')])&&!_[_0xf645('0x19')](_0x2816ce[_0xf645('0x20')][_0xf645('0x21')])){utils[_0xf645('0x10')](util['format']('[%s][recordings][varset]',_0x2816ce[_0xf645('0x7')]),_0x2816ce);utils['info'](util[_0xf645('0x11')](_0xf645('0x22'),_0x2816ce[_0xf645('0x7')],_0x2816ce[_0xf645('0x20')],_0x2816ce[_0xf645('0x23')]));if(_[_0xf645('0x24')](_0x2816ce[_0xf645('0x23')],_0xf645('0x25'))){_0x2816ce['value']=_0x2816ce[_0xf645('0x23')][_0xf645('0x26')]('.wav49',_0xf645('0x27'));}if(recordings[_0x2816ce[_0xf645('0x1c')]]){var _0x537d63=_[_0xf645('0x28')](recordings[_0x2816ce[_0xf645('0x1c')]][_0xf645('0x29')],{'value':_0x2816ce['value']});if(_[_0xf645('0x19')](_0x537d63)){recordings[_0x2816ce[_0xf645('0x1c')]][_0xf645('0x29')][_0xf645('0x2a')]({'value':_0x2816ce[_0xf645('0x23')]});}}}}catch(_0x3c6543){utils['error'](util[_0xf645('0x11')](_0xf645('0x2b'),_0x2816ce[_0xf645('0x7')]),_0x3c6543);}};exports['hangup']=function(_0x153df1){try{if(!_['isNil'](recordings[_0x153df1[_0xf645('0x7')]])){utils['debug'](util[_0xf645('0x11')](_0xf645('0x2c'),_0x153df1[_0xf645('0x7')]),_0x153df1);utils[_0xf645('0x4')](util[_0xf645('0x11')](_0xf645('0x2d'),_0x153df1[_0xf645('0x7')],_0x153df1[_0xf645('0x2e')],_0x153df1[_0xf645('0x2f')],_0x153df1[_0xf645('0x30')]));recordings[_0x153df1[_0xf645('0x7')]]['calleridnum']=_0x153df1[_0xf645('0x2e')];recordings[_0x153df1[_0xf645('0x7')]]['calleridname']=_0x153df1[_0xf645('0x2f')];recordings[_0x153df1[_0xf645('0x7')]][_0xf645('0x31')]=_0x153df1[_0xf645('0x31')];recordings[_0x153df1['uniqueid']][_0xf645('0x32')]=_0x153df1[_0xf645('0x32')];if(recordings[_0x153df1[_0xf645('0x7')]]['type']=='outbound'&&recordings[_0x153df1['uniqueid']][_0xf645('0x9')]){recordings[_0x153df1[_0xf645('0x7')]]['connectedlinenum']=recordings[_0x153df1['uniqueid']][_0xf645('0x9')];recordings[_0x153df1[_0xf645('0x7')]]['connectedlinename']='';}recordings[_0x153df1[_0xf645('0x7')]][_0xf645('0x29')]['forEach'](function(_0x4737af){var _0x19379d=_['clone'](recordings[_0x153df1[_0xf645('0x7')]]);_0x19379d[_0xf645('0x23')]=_0x4737af['value'];writeDB(_0x19379d);});delete recordings[_0x153df1[_0xf645('0x7')]];}}catch(_0x52c68a){utils[_0xf645('0x16')](util['format'](_0xf645('0x2c'),_0x153df1[_0xf645('0x7')]),_0x52c68a);}};exports[_0xf645('0x33')]=function(_0x214b8f){try{if(!_[_0xf645('0x19')](recordings[_0x214b8f[_0xf645('0x7')]])){utils['debug'](util['format'](_0xf645('0x34'),_0x214b8f[_0xf645('0x7')]),_0x214b8f);utils['info'](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x214b8f['uniqueid'],_0x214b8f['application'],_0x214b8f[_0xf645('0x35')]));if(_0x214b8f['application'][_0xf645('0x36')]()==_0xf645('0x37')&&_[_0xf645('0x38')](_0x214b8f['appdata']['toLowerCase'](),_0xf645('0x39'))){var _0xee610d=_0x214b8f[_0xf645('0x35')][_0xf645('0x3a')]('=');var _0x45eda7=_0xee610d[0x0][_0xf645('0x3b')](_0xee610d[0x0]['lastIndexOf']('(')+0x1,_0xee610d[0x0][_0xf645('0x3c')](')'));var _0x8c5669=_0xee610d[0x1];recordings[_0x214b8f[_0xf645('0x7')]][_0x45eda7]=_0x8c5669;}}}catch(_0x55dbc6){utils[_0xf645('0x16')](util[_0xf645('0x11')](_0xf645('0x34'),_0x214b8f[_0xf645('0x7')]),_0x55dbc6);}};exports[_0xf645('0x3d')]=function(_0x46e0af){try{if(!_[_0xf645('0x19')](recordings[_0x46e0af[_0xf645('0x7')]])){utils['debug'](util[_0xf645('0x11')](_0xf645('0x3e'),_0x46e0af[_0xf645('0x7')]),_0x46e0af);utils['info'](util['format'](_0xf645('0x3f'),_0x46e0af[_0xf645('0x7')],_0x46e0af['queue']));recordings[_0x46e0af[_0xf645('0x7')]][_0xf645('0x40')]=_0x46e0af[_0xf645('0x40')];}}catch(_0x1ea84b){utils[_0xf645('0x16')](util[_0xf645('0x11')](_0xf645('0x3e'),_0x46e0af[_0xf645('0x7')]),_0x1ea84b);}};exports[_0xf645('0x41')]=function(_0x376786){try{utils[_0xf645('0x10')](util[_0xf645('0x11')](_0xf645('0x42'),_0x376786[_0xf645('0x7')]),_0x376786);utils['info'](util['format'](_0xf645('0x43'),_0x376786['uniqueid'],_0x376786[_0xf645('0x44')],_0x376786[_0xf645('0x45')],_0x376786['transfereecalleridnum'],_0x376786[_0xf645('0x46')]));if(recordings[_0x376786[_0xf645('0x47')]]&&transfers[_0xf645('0x6')][_0x376786[_0xf645('0x47')]]){transfers[_0xf645('0x6')][_0x376786[_0xf645('0x47')]][_0xf645('0x48')]=!![];}}catch(_0x7875e8){utils[_0xf645('0x16')](util[_0xf645('0x11')](_0xf645('0x42'),_0x376786[_0xf645('0x7')]),_0x7875e8);}}; \ No newline at end of file +var _0x3c9d=['transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','channel','varset','variable','value','replace','.wav49','find','monitors','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','appdata','application','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','blindtransfer','transferercalleridnum','transferercalleridname','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds'];(function(_0x48168a,_0xf9dfe5){var _0x346d98=function(_0x22e41f){while(--_0x22e41f){_0x48168a['push'](_0x48168a['shift']());}};_0x346d98(++_0xf9dfe5);}(_0x3c9d,0x10f));var _0xd3c9=function(_0x37a858,_0x370bc4){_0x37a858=_0x37a858-0x0;var _0x55ae33=_0x3c9d[_0x37a858];return _0x55ae33;};'use strict';var _=require(_0xd3c9('0x0'));var util=require(_0xd3c9('0x1'));var utils=require(_0xd3c9('0x2'));var transfers=require(_0xd3c9('0x3'));var recordings={};function writeDB(_0x5e0cf8){var _0x19c28b;utils[_0xd3c9('0x4')](util[_0xd3c9('0x5')](_0xd3c9('0x6'),_0x5e0cf8[_0xd3c9('0x7')]));if(transfers['blinds'][_0x5e0cf8['uniqueid']]){_0x19c28b=_0x5e0cf8['uniqueid'];_0x5e0cf8[_0xd3c9('0x7')]=transfers[_0xd3c9('0x8')][_0x5e0cf8['uniqueid']][_0xd3c9('0x9')];}if(_0x5e0cf8[_0xd3c9('0xa')]){utils[_0xd3c9('0xb')](_0x5e0cf8[_0xd3c9('0xa')])[_0xd3c9('0xc')](function(_0x13e679){if(_0x13e679){_0x5e0cf8[_0xd3c9('0xd')]=_0x13e679[_0xd3c9('0xe')];_0x5e0cf8[_0xd3c9('0xf')]=_0x13e679['id'];}utils[_0xd3c9('0x10')]('CreateVoiceRecording',_0x5e0cf8);});}else{utils[_0xd3c9('0x10')](_0xd3c9('0x11'),_0x5e0cf8);}if(_0x19c28b)delete transfers[_0xd3c9('0x8')][_0x19c28b];}exports[_0xd3c9('0x12')]=function(_0x593bd1){try{utils[_0xd3c9('0x13')](util[_0xd3c9('0x5')](_0xd3c9('0x14'),_0x593bd1[_0xd3c9('0x7')]),_0x593bd1);if(_0x593bd1[_0xd3c9('0x7')]==_0x593bd1[_0xd3c9('0x15')]){utils[_0xd3c9('0x4')](util[_0xd3c9('0x5')](_0xd3c9('0x16'),_0x593bd1[_0xd3c9('0x7')],_0x593bd1[_0xd3c9('0x17')],_0x593bd1[_0xd3c9('0x18')]));recordings[_0x593bd1['uniqueid']]={'uniqueid':_0x593bd1[_0xd3c9('0x7')],'accountcode':_0x593bd1[_0xd3c9('0xa')],'exten':_0x593bd1[_0xd3c9('0x18')],'context':_0x593bd1['context'],'channel':_0x593bd1['channel'],'monitors':[]};}}catch(_0x1337f1){utils[_0xd3c9('0x19')](util[_0xd3c9('0x5')]('[%s][recordings][newchannel]',_0x593bd1['uniqueid']),_0x1337f1);}};exports[_0xd3c9('0x1a')]=function(_0x56f6e9){try{utils['debug'](util[_0xd3c9('0x5')](_0xd3c9('0x1b'),_0x56f6e9[_0xd3c9('0x7')]),_0x56f6e9);if(!_[_0xd3c9('0x1c')](recordings[_0x56f6e9[_0xd3c9('0x7')]])&&_0x56f6e9['channelstate']==0x6){utils[_0xd3c9('0x4')](util[_0xd3c9('0x5')](_0xd3c9('0x1d'),_0x56f6e9['uniqueid'],_0x56f6e9['context'],_0x56f6e9['channel']));}else if(!_[_0xd3c9('0x1c')](recordings[_0x56f6e9[_0xd3c9('0x15')]])&&_0x56f6e9['channelstate']==0x6&&_0x56f6e9[_0xd3c9('0x17')]!=_0xd3c9('0x1e')){utils[_0xd3c9('0x4')](util[_0xd3c9('0x5')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x56f6e9[_0xd3c9('0x7')],_0x56f6e9[_0xd3c9('0x15')],_0x56f6e9[_0xd3c9('0x17')],_0x56f6e9[_0xd3c9('0x1f')]));recordings[_0x56f6e9[_0xd3c9('0x15')]][_0xd3c9('0xa')]=_0x56f6e9[_0xd3c9('0xa')];}}catch(_0x218f5b){utils['error'](util[_0xd3c9('0x5')](_0xd3c9('0x1b'),_0x56f6e9[_0xd3c9('0x7')]),_0x218f5b);}};exports[_0xd3c9('0x20')]=function(_0x4ce1e4){try{if(!_['isNil'](_0x4ce1e4['variable'])&&!_[_0xd3c9('0x1c')](_0x4ce1e4[_0xd3c9('0x21')]['mixmonitor_filename'])){utils[_0xd3c9('0x13')](util[_0xd3c9('0x5')]('[%s][recordings][varset]',_0x4ce1e4[_0xd3c9('0x7')]),_0x4ce1e4);utils['info'](util[_0xd3c9('0x5')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x4ce1e4[_0xd3c9('0x7')],_0x4ce1e4[_0xd3c9('0x21')],_0x4ce1e4[_0xd3c9('0x22')]));if(_['endsWith'](_0x4ce1e4[_0xd3c9('0x22')],'.wav49')){_0x4ce1e4[_0xd3c9('0x22')]=_0x4ce1e4['value'][_0xd3c9('0x23')](_0xd3c9('0x24'),'.WAV');}if(recordings[_0x4ce1e4['linkedid']]){var _0x22ef5d=_[_0xd3c9('0x25')](recordings[_0x4ce1e4['linkedid']][_0xd3c9('0x26')],{'value':_0x4ce1e4[_0xd3c9('0x22')]});if(_['isNil'](_0x22ef5d)){recordings[_0x4ce1e4[_0xd3c9('0x15')]]['monitors']['push']({'value':_0x4ce1e4[_0xd3c9('0x22')]});}}}}catch(_0x220f91){utils[_0xd3c9('0x19')](util[_0xd3c9('0x5')](_0xd3c9('0x27'),_0x4ce1e4[_0xd3c9('0x7')]),_0x220f91);}};exports[_0xd3c9('0x28')]=function(_0xf11625){try{if(!_[_0xd3c9('0x1c')](recordings[_0xf11625[_0xd3c9('0x7')]])){utils['debug'](util[_0xd3c9('0x5')](_0xd3c9('0x29'),_0xf11625[_0xd3c9('0x7')]),_0xf11625);utils[_0xd3c9('0x4')](util[_0xd3c9('0x5')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0xf11625[_0xd3c9('0x7')],_0xf11625['calleridnum'],_0xf11625[_0xd3c9('0x2a')],_0xf11625['cause-txt']));recordings[_0xf11625['uniqueid']][_0xd3c9('0x2b')]=_0xf11625[_0xd3c9('0x2b')];recordings[_0xf11625[_0xd3c9('0x7')]][_0xd3c9('0x2a')]=_0xf11625[_0xd3c9('0x2a')];recordings[_0xf11625[_0xd3c9('0x7')]][_0xd3c9('0x2c')]=_0xf11625[_0xd3c9('0x2c')];recordings[_0xf11625[_0xd3c9('0x7')]][_0xd3c9('0x2d')]=_0xf11625[_0xd3c9('0x2d')];if(recordings[_0xf11625[_0xd3c9('0x7')]][_0xd3c9('0x2e')]==_0xd3c9('0x2f')&&recordings[_0xf11625[_0xd3c9('0x7')]][_0xd3c9('0xa')]){recordings[_0xf11625[_0xd3c9('0x7')]]['connectedlinenum']=recordings[_0xf11625[_0xd3c9('0x7')]][_0xd3c9('0xa')];recordings[_0xf11625['uniqueid']][_0xd3c9('0x2d')]='';}recordings[_0xf11625[_0xd3c9('0x7')]]['monitors']['forEach'](function(_0x1ad29b){var _0x454f41=_[_0xd3c9('0x30')](recordings[_0xf11625[_0xd3c9('0x7')]]);_0x454f41[_0xd3c9('0x22')]=_0x1ad29b[_0xd3c9('0x22')];writeDB(_0x454f41);});delete recordings[_0xf11625[_0xd3c9('0x7')]];}}catch(_0x4da76f){utils['error'](util['format'](_0xd3c9('0x29'),_0xf11625['uniqueid']),_0x4da76f);}};exports[_0xd3c9('0x31')]=function(_0x5b71d5){try{if(!_['isNil'](recordings[_0x5b71d5[_0xd3c9('0x7')]])){utils[_0xd3c9('0x13')](util['format'](_0xd3c9('0x32'),_0x5b71d5[_0xd3c9('0x7')]),_0x5b71d5);utils[_0xd3c9('0x4')](util[_0xd3c9('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5b71d5[_0xd3c9('0x7')],_0x5b71d5['application'],_0x5b71d5[_0xd3c9('0x33')]));if(_0x5b71d5[_0xd3c9('0x34')][_0xd3c9('0x35')]()==_0xd3c9('0x36')&&_[_0xd3c9('0x37')](_0x5b71d5['appdata'][_0xd3c9('0x35')](),_0xd3c9('0x38'))){var _0x15bbe7=_0x5b71d5[_0xd3c9('0x33')][_0xd3c9('0x39')]('=');var _0x172001=_0x15bbe7[0x0][_0xd3c9('0x3a')](_0x15bbe7[0x0][_0xd3c9('0x3b')]('(')+0x1,_0x15bbe7[0x0][_0xd3c9('0x3b')](')'));var _0x13e95f=_0x15bbe7[0x1];recordings[_0x5b71d5[_0xd3c9('0x7')]][_0x172001]=_0x13e95f;}}}catch(_0x1c4b2a){utils[_0xd3c9('0x19')](util[_0xd3c9('0x5')]('[%s][recordings][newexten]',_0x5b71d5['uniqueid']),_0x1c4b2a);}};exports[_0xd3c9('0x3c')]=function(_0x6aad00){try{if(!_[_0xd3c9('0x1c')](recordings[_0x6aad00['uniqueid']])){utils[_0xd3c9('0x13')](util['format']('[%s][recordings][queuecallerjoin]',_0x6aad00[_0xd3c9('0x7')]),_0x6aad00);utils[_0xd3c9('0x4')](util[_0xd3c9('0x5')](_0xd3c9('0x3d'),_0x6aad00['uniqueid'],_0x6aad00[_0xd3c9('0x3e')]));recordings[_0x6aad00['uniqueid']][_0xd3c9('0x3e')]=_0x6aad00['queue'];}}catch(_0x104be3){utils[_0xd3c9('0x19')](util['format'](_0xd3c9('0x3f'),_0x6aad00[_0xd3c9('0x7')]),_0x104be3);}};exports[_0xd3c9('0x40')]=function(_0x3ab560){try{utils[_0xd3c9('0x13')](util[_0xd3c9('0x5')]('[%s][recordings][blindtransfer]',_0x3ab560['uniqueid']),_0x3ab560);utils[_0xd3c9('0x4')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x3ab560['uniqueid'],_0x3ab560[_0xd3c9('0x41')],_0x3ab560[_0xd3c9('0x42')],_0x3ab560['transfereecalleridnum'],_0x3ab560[_0xd3c9('0x43')]));if(recordings[_0x3ab560[_0xd3c9('0x44')]]&&transfers[_0xd3c9('0x8')][_0x3ab560[_0xd3c9('0x44')]]){transfers[_0xd3c9('0x8')][_0x3ab560['transfereruniqueid']][_0xd3c9('0x45')]=!![];}}catch(_0x32394e){utils[_0xd3c9('0x19')](util['format']('[%s][recordings][blindtransfer]',_0x3ab560[_0xd3c9('0x7')]),_0x32394e);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index f78d209..6f0f479 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 _0x52ab=['transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten'];(function(_0x286850,_0x1d91da){var _0x486c63=function(_0x569e3d){while(--_0x569e3d){_0x286850['push'](_0x286850['shift']());}};_0x486c63(++_0x1d91da);}(_0x52ab,0x161));var _0xb52a=function(_0x315364,_0x29518a){_0x315364=_0x315364-0x0;var _0x471741=_0x52ab[_0x315364];return _0x471741;};'use strict';var _=require(_0xb52a('0x0'));var util=require(_0xb52a('0x1'));var utils=require(_0xb52a('0x2'));function writeDB(_0x5e90b6){utils[_0xb52a('0x3')](util[_0xb52a('0x4')](_0xb52a('0x5'),_0x5e90b6['type']===_0xb52a('0x6')?_0x5e90b6[_0xb52a('0x7')]:_0x5e90b6[_0xb52a('0x8')],_0x5e90b6['type']));utils[_0xb52a('0x9')](_0xb52a('0xa'),_0x5e90b6);}exports[_0xb52a('0xb')]={};exports[_0xb52a('0xc')]=function(_0xddc76f){try{utils[_0xb52a('0xd')](util['format']('[%s][transfers][blindtransfer]',_0xddc76f['uniqueid']),_0xddc76f);utils[_0xb52a('0x3')](util[_0xb52a('0x4')](_0xb52a('0xe'),_0xddc76f[_0xb52a('0x8')],_0xddc76f[_0xb52a('0xf')],_0xddc76f[_0xb52a('0x10')],_0xddc76f[_0xb52a('0x11')],_0xddc76f[_0xb52a('0x12')]));_0xddc76f['type']=_0xb52a('0x13');exports['blinds'][_0xddc76f[_0xb52a('0x14')]]=_0xddc76f;writeDB(_0xddc76f);}catch(_0x552f38){utils['error'](util[_0xb52a('0x4')](_0xb52a('0x15'),_0xddc76f[_0xb52a('0x8')]),_0x552f38);}};exports[_0xb52a('0x16')]=function(_0x4d960f){try{utils[_0xb52a('0xd')](util[_0xb52a('0x4')]('[%s][transfers][attendedtransfer]',_0x4d960f[_0xb52a('0x7')]),_0x4d960f);utils['info'](util[_0xb52a('0x4')](_0xb52a('0x17'),_0x4d960f[_0xb52a('0x7')],_0x4d960f['origtransferercalleridnum'],_0x4d960f[_0xb52a('0x18')],_0x4d960f['transfertargetcalleridnum'],_0x4d960f['transfertargetcalleridname']));_0x4d960f=_[_0xb52a('0x19')](_0x4d960f,{'transfererchannel':_0x4d960f['origtransfererchannel'],'transferercalleridnum':_0x4d960f[_0xb52a('0x1a')],'transferercalleridname':_0x4d960f['origtransferercalleridname'],'transfererconnectedlinenum':_0x4d960f[_0xb52a('0x1b')],'transfererconnectedlinename':_0x4d960f[_0xb52a('0x1c')],'transfereraccountcode':_0x4d960f[_0xb52a('0x1d')],'transferercontext':_0x4d960f[_0xb52a('0x1e')],'transfererexten':_0x4d960f[_0xb52a('0x1f')],'transfererlinkedid':_0x4d960f['origtransfererlinkedid'],'context':_0x4d960f[_0xb52a('0x20')],'extension':_0x4d960f[_0xb52a('0x21')],'type':_0xb52a('0x6')});if(_['isNil'](_0x4d960f[_0xb52a('0x22')])){_0x4d960f=_['assign'](_0x4d960f,{'transfereechannel':_0x4d960f[_0xb52a('0x23')],'transfereecalleridnum':_0x4d960f[_0xb52a('0x24')],'transfereecalleridname':_0x4d960f[_0xb52a('0x25')],'transfereeconnectedlinenum':_0x4d960f[_0xb52a('0x26')],'transfereeconnectedlinename':_0x4d960f[_0xb52a('0x27')],'transfereeaccountcode':_0x4d960f['transfertargetaccountcode'],'transfereecontext':_0x4d960f[_0xb52a('0x28')],'transfereeexten':_0x4d960f['transfertargetexten'],'transfereelinkedid':_0x4d960f[_0xb52a('0x29')]});}writeDB(_0x4d960f);}catch(_0x464ad8){utils[_0xb52a('0x2a')](util[_0xb52a('0x4')]('[%s][transfers][attendedtransfer]',_0x4d960f['origtransfereruniqueid']),_0x464ad8);}}; \ No newline at end of file +var _0x4458=['origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','util','./utils','format','type','origtransfereruniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign'];(function(_0xac3aa1,_0x2c961f){var _0x9f98bc=function(_0x182bb0){while(--_0x182bb0){_0xac3aa1['push'](_0xac3aa1['shift']());}};_0x9f98bc(++_0x2c961f);}(_0x4458,0x1be));var _0x8445=function(_0x11744b,_0x41cefd){_0x11744b=_0x11744b-0x0;var _0x3f0c88=_0x4458[_0x11744b];return _0x3f0c88;};'use strict';var _=require('lodash');var util=require(_0x8445('0x0'));var utils=require(_0x8445('0x1'));function writeDB(_0x86eef2){utils['info'](util[_0x8445('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x86eef2[_0x8445('0x3')]==='attended'?_0x86eef2[_0x8445('0x4')]:_0x86eef2['uniqueid'],_0x86eef2[_0x8445('0x3')]));utils[_0x8445('0x5')]('CreateVoiceTransferReport',_0x86eef2);}exports['blinds']={};exports[_0x8445('0x6')]=function(_0x2750bd){try{utils[_0x8445('0x7')](util['format'](_0x8445('0x8'),_0x2750bd[_0x8445('0x9')]),_0x2750bd);utils[_0x8445('0xa')](util[_0x8445('0x2')](_0x8445('0xb'),_0x2750bd[_0x8445('0x9')],_0x2750bd[_0x8445('0xc')],_0x2750bd[_0x8445('0xd')],_0x2750bd[_0x8445('0xe')],_0x2750bd[_0x8445('0xf')]));_0x2750bd[_0x8445('0x3')]=_0x8445('0x10');exports[_0x8445('0x11')][_0x2750bd[_0x8445('0x12')]]=_0x2750bd;writeDB(_0x2750bd);}catch(_0x1d72b4){utils[_0x8445('0x13')](util[_0x8445('0x2')]('[%s][transfers][blindtransfer]',_0x2750bd[_0x8445('0x9')]),_0x1d72b4);}};exports[_0x8445('0x14')]=function(_0xe13616){try{utils[_0x8445('0x7')](util[_0x8445('0x2')](_0x8445('0x15'),_0xe13616[_0x8445('0x4')]),_0xe13616);utils[_0x8445('0xa')](util[_0x8445('0x2')](_0x8445('0x16'),_0xe13616[_0x8445('0x4')],_0xe13616['origtransferercalleridnum'],_0xe13616[_0x8445('0x17')],_0xe13616[_0x8445('0x18')],_0xe13616[_0x8445('0x19')]));_0xe13616=_[_0x8445('0x1a')](_0xe13616,{'transfererchannel':_0xe13616[_0x8445('0x1b')],'transferercalleridnum':_0xe13616[_0x8445('0x1c')],'transferercalleridname':_0xe13616[_0x8445('0x17')],'transfererconnectedlinenum':_0xe13616['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xe13616[_0x8445('0x1d')],'transfereraccountcode':_0xe13616[_0x8445('0x1e')],'transferercontext':_0xe13616[_0x8445('0x1f')],'transfererexten':_0xe13616[_0x8445('0x20')],'transfererlinkedid':_0xe13616[_0x8445('0x21')],'context':_0xe13616[_0x8445('0x22')],'extension':_0xe13616['origtransfererexten'],'type':_0x8445('0x23')});if(_[_0x8445('0x24')](_0xe13616[_0x8445('0x25')])){_0xe13616=_[_0x8445('0x1a')](_0xe13616,{'transfereechannel':_0xe13616[_0x8445('0x26')],'transfereecalleridnum':_0xe13616[_0x8445('0x18')],'transfereecalleridname':_0xe13616['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xe13616[_0x8445('0x27')],'transfereeconnectedlinename':_0xe13616[_0x8445('0x28')],'transfereeaccountcode':_0xe13616['transfertargetaccountcode'],'transfereecontext':_0xe13616[_0x8445('0x29')],'transfereeexten':_0xe13616[_0x8445('0x2a')],'transfereelinkedid':_0xe13616['transfertargetlinkedid']});}writeDB(_0xe13616);}catch(_0x29df8d){utils[_0x8445('0x13')](util[_0x8445('0x2')](_0x8445('0x15'),_0xe13616[_0x8445('0x4')]),_0x29df8d);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 019d128..004cfe5 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 _0x7f05=['bluebird','jayson/promise','moment','client','../../config/logger','xdr','inspect','debug','request','[utils][request]\x20name:%s','name','interface','then','[utils][getUser]\x20where:%s','result','info','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','error','[utils][getUserByInterface]','getUserByName','notfound','getVoiceQueueByName','GetVoiceQueue','type','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','format','subtractTime','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore'];(function(_0x3c7e91,_0x1a5c7e){var _0x3d6864=function(_0x57beac){while(--_0x57beac){_0x3c7e91['push'](_0x3c7e91['shift']());}};_0x3d6864(++_0x1a5c7e);}(_0x7f05,0xdc));var _0x57f0=function(_0x1c0c62,_0x2843dd){_0x1c0c62=_0x1c0c62-0x0;var _0x4a725c=_0x7f05[_0x1c0c62];return _0x4a725c;};'use strict';var BPromise=require(_0x57f0('0x0'));var jayson=require(_0x57f0('0x1'));var moment=require(_0x57f0('0x2'));var util=require('util');var client=jayson[_0x57f0('0x3')]['http']({'port':0x2329});var logger=require(_0x57f0('0x4'))(_0x57f0('0x5'));exports['info']=function(_0x25b25f,_0x615ad9){logger['info'](_0x25b25f,_0x615ad9?util[_0x57f0('0x6')](_0x615ad9,{'showHidden':![],'depth':null}):'');};exports[_0x57f0('0x7')]=function(_0x4975ec,_0x434121){logger[_0x57f0('0x7')](_0x4975ec,_0x434121?util[_0x57f0('0x6')](_0x434121,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x5b8d32,_0x5b3859){logger['error'](_0x5b8d32,_0x5b3859?util[_0x57f0('0x6')](_0x5b3859,{'showHidden':![],'depth':null}):'');};exports[_0x57f0('0x8')]=function(_0x24c617,_0xaa0ad7){return client['request'](_0x24c617,{'body':_0xaa0ad7})['then'](function(_0x173e14){logger['debug']('[utils][request]\x20name:%s',_0x24c617,_0x173e14?util['inspect'](_0x173e14,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x5cd266){logger['error'](_0x57f0('0x9'),_0x24c617,_0x5cd266?util[_0x57f0('0x6')](_0x5cd266,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5987ed){return client[_0x57f0('0x8')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x57f0('0xa'),_0x57f0('0xb')],'where':_0x5987ed,'limit':0x1}})[_0x57f0('0xc')](function(_0x2e57df){logger[_0x57f0('0x7')](_0x57f0('0xd'),JSON['stringify'](_0x5987ed),_0x2e57df?util['inspect'](_0x2e57df,{'showHidden':![],'depth':null}):'');return _0x2e57df[_0x57f0('0xe')]['length']?_0x2e57df['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x593fd7){return new BPromise(function(_0x20d0ba,_0x2a382e){if(_0x593fd7){return getUser({'internal':_0x593fd7})[_0x57f0('0xc')](function(_0x5277e4){logger[_0x57f0('0xf')](_0x57f0('0x10'),_0x593fd7,_0x5277e4?_0x57f0('0x11'):'notfound');return _0x20d0ba(_0x5277e4);})[_0x57f0('0x12')](function(_0xb04bf3){logger['error']('[utils][getUserByInternal]',_0xb04bf3?util[_0x57f0('0x6')](_0xb04bf3,{'showHidden':![],'depth':null}):'');return _0x20d0ba(null);});}return _0x20d0ba(null);});};exports[_0x57f0('0x13')]=function(_0x599aa2){return new BPromise(function(_0x28e659,_0x558de7){if(_0x599aa2){return getUser({'interface':_0x599aa2})[_0x57f0('0xc')](function(_0x9c498){logger[_0x57f0('0xf')](_0x57f0('0x14'),_0x599aa2,_0x9c498?'found':'notfound');return _0x28e659(_0x9c498);})[_0x57f0('0x12')](function(_0x56ceb5){logger[_0x57f0('0x15')](_0x57f0('0x16'),_0x56ceb5?util[_0x57f0('0x6')](_0x56ceb5,{'showHidden':![],'depth':null}):'');return _0x28e659(null);});}return _0x28e659(null);});};exports[_0x57f0('0x17')]=function(_0x1b0d2b){return new BPromise(function(_0x1c2cae,_0x4de0f5){if(_0x1b0d2b){return getUser({'name':_0x1b0d2b})[_0x57f0('0xc')](function(_0x5a079e){logger[_0x57f0('0xf')]('[utils][getUserByName]\x20name:%s\x20%s',_0x1b0d2b,_0x5a079e?'found':_0x57f0('0x18'));return _0x1c2cae(_0x5a079e);})['catch'](function(_0x407829){logger['error']('[utils][getUserByName]',_0x407829?util[_0x57f0('0x6')](_0x407829,{'showHidden':![],'depth':null}):'');return _0x1c2cae(null);});}return _0x1c2cae(null);});};exports[_0x57f0('0x19')]=function(_0x16c711){return new BPromise(function(_0x3ac9d3,_0x1858ea){if(_0x16c711){return client[_0x57f0('0x8')](_0x57f0('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x57f0('0xa'),_0x57f0('0x1b'),_0x57f0('0x1c'),'acwTimeout'],'where':{'name':_0x16c711},'limit':0x1}})[_0x57f0('0xc')](function(_0x390400){logger[_0x57f0('0x7')](_0x57f0('0x1d'),_0x16c711,_0x390400?util[_0x57f0('0x6')](_0x390400,{'showHidden':![],'depth':null}):'');logger[_0x57f0('0xf')](_0x57f0('0x1e'),_0x16c711,_0x390400?_0x57f0('0x11'):_0x57f0('0x18'));return _0x3ac9d3(_0x390400[_0x57f0('0xe')][_0x57f0('0x1f')]?_0x390400[_0x57f0('0xe')][0x0]:null);})[_0x57f0('0x12')](function(_0x3a8e5f){logger['error'](_0x57f0('0x20'),_0x3a8e5f?util[_0x57f0('0x6')](_0x3a8e5f,{'showHidden':![],'depth':null}):'');return _0x3ac9d3(null);});}return _0x3ac9d3(null);});};exports[_0x57f0('0x21')]=function(_0x3751d7,_0x5cf226){return moment(_0x3751d7)['add'](_0x5cf226,'seconds')[_0x57f0('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x57f0('0x23')]=function(_0x29587a,_0x2f3f1b){return moment(_0x29587a)['subtract'](_0x2f3f1b,_0x57f0('0x24'))[_0x57f0('0x22')](_0x57f0('0x25'));};exports[_0x57f0('0x26')]=function(_0x3e39f7,_0x28fe5c){return moment(_0x3e39f7)[_0x57f0('0x27')](moment(_0x28fe5c),_0x57f0('0x24'));};exports[_0x57f0('0x28')]=function(_0x28d237,_0xb5b61f){return parseInt(_0x28d237,0xa)+parseInt(_0xb5b61f,0xa);};exports[_0x57f0('0x29')]=function(){return moment()[_0x57f0('0x22')](_0x57f0('0x25'));};exports[_0x57f0('0x2a')]=function(_0x1c5345,_0x1769de){if(_0x1769de){return moment(_0x1c5345)[_0x57f0('0x2a')](_0x1769de);}return!![];};exports[_0x57f0('0x2b')]=function(_0x586c8d,_0x564355){if(_0x564355){return moment(_0x586c8d)[_0x57f0('0x2b')](_0x564355);}else if(_0x586c8d){return!![];}return![];}; \ No newline at end of file +var _0x0e4b=['catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','length','getUserByInternal','info','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','client','inspect','debug','error','request','then','[utils][request]\x20name:%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x441d96,_0x27b511){_0x441d96=_0x441d96-0x0;var _0x1f15b7=_0x0e4b[_0x441d96];return _0x1f15b7;};'use strict';var BPromise=require(_0xb0e4('0x0'));var jayson=require(_0xb0e4('0x1'));var moment=require(_0xb0e4('0x2'));var util=require('util');var client=jayson[_0xb0e4('0x3')]['http']({'port':0x2329});var logger=require('../../config/logger')('xdr');exports['info']=function(_0x79717e,_0x136402){logger['info'](_0x79717e,_0x136402?util[_0xb0e4('0x4')](_0x136402,{'showHidden':![],'depth':null}):'');};exports[_0xb0e4('0x5')]=function(_0x78e4ed,_0x3dff2f){logger[_0xb0e4('0x5')](_0x78e4ed,_0x3dff2f?util['inspect'](_0x3dff2f,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x101860,_0x9d4a99){logger[_0xb0e4('0x6')](_0x101860,_0x9d4a99?util[_0xb0e4('0x4')](_0x9d4a99,{'showHidden':![],'depth':null}):'');};exports[_0xb0e4('0x7')]=function(_0x140b7e,_0x16940b){return client[_0xb0e4('0x7')](_0x140b7e,{'body':_0x16940b})[_0xb0e4('0x8')](function(_0x397bf3){logger[_0xb0e4('0x5')](_0xb0e4('0x9'),_0x140b7e,_0x397bf3?util[_0xb0e4('0x4')](_0x397bf3,{'showHidden':![],'depth':null}):'');})[_0xb0e4('0xa')](function(_0xdfa7fd){logger['error'](_0xb0e4('0x9'),_0x140b7e,_0xdfa7fd?util[_0xb0e4('0x4')](_0xdfa7fd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x585441){return client[_0xb0e4('0x7')](_0xb0e4('0xb'),{'options':{'raw':!![],'attributes':['id',_0xb0e4('0xc'),_0xb0e4('0xd'),_0xb0e4('0xe')],'where':_0x585441,'limit':0x1}})['then'](function(_0x4b3f3f){logger[_0xb0e4('0x5')](_0xb0e4('0xf'),JSON['stringify'](_0x585441),_0x4b3f3f?util[_0xb0e4('0x4')](_0x4b3f3f,{'showHidden':![],'depth':null}):'');return _0x4b3f3f[_0xb0e4('0x10')][_0xb0e4('0x11')]?_0x4b3f3f[_0xb0e4('0x10')][0x0]:null;});}exports[_0xb0e4('0x12')]=function(_0x3355c6){return new BPromise(function(_0x570886,_0x491a29){if(_0x3355c6){return getUser({'internal':_0x3355c6})['then'](function(_0x42e43d){logger[_0xb0e4('0x13')](_0xb0e4('0x14'),_0x3355c6,_0x42e43d?_0xb0e4('0x15'):_0xb0e4('0x16'));return _0x570886(_0x42e43d);})[_0xb0e4('0xa')](function(_0x54b7ff){logger[_0xb0e4('0x6')](_0xb0e4('0x17'),_0x54b7ff?util[_0xb0e4('0x4')](_0x54b7ff,{'showHidden':![],'depth':null}):'');return _0x570886(null);});}return _0x570886(null);});};exports[_0xb0e4('0x18')]=function(_0x4bbb10){return new BPromise(function(_0x501668,_0x4f2488){if(_0x4bbb10){return getUser({'interface':_0x4bbb10})['then'](function(_0x2663f3){logger[_0xb0e4('0x13')](_0xb0e4('0x19'),_0x4bbb10,_0x2663f3?'found':_0xb0e4('0x16'));return _0x501668(_0x2663f3);})['catch'](function(_0x4bc636){logger[_0xb0e4('0x6')](_0xb0e4('0x1a'),_0x4bc636?util[_0xb0e4('0x4')](_0x4bc636,{'showHidden':![],'depth':null}):'');return _0x501668(null);});}return _0x501668(null);});};exports[_0xb0e4('0x1b')]=function(_0x13781c){return new BPromise(function(_0x248aa5,_0x6665e){if(_0x13781c){return getUser({'name':_0x13781c})['then'](function(_0x28ed88){logger['info'](_0xb0e4('0x1c'),_0x13781c,_0x28ed88?_0xb0e4('0x15'):_0xb0e4('0x16'));return _0x248aa5(_0x28ed88);})[_0xb0e4('0xa')](function(_0x4fc624){logger[_0xb0e4('0x6')](_0xb0e4('0x1d'),_0x4fc624?util[_0xb0e4('0x4')](_0x4fc624,{'showHidden':![],'depth':null}):'');return _0x248aa5(null);});}return _0x248aa5(null);});};exports[_0xb0e4('0x1e')]=function(_0x447f41){return new BPromise(function(_0x5c0ad0,_0x1dad0e){if(_0x447f41){return client[_0xb0e4('0x7')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xb0e4('0xd'),'type',_0xb0e4('0x1f'),_0xb0e4('0x20')],'where':{'name':_0x447f41},'limit':0x1}})['then'](function(_0x2c97aa){logger[_0xb0e4('0x5')](_0xb0e4('0x21'),_0x447f41,_0x2c97aa?util[_0xb0e4('0x4')](_0x2c97aa,{'showHidden':![],'depth':null}):'');logger[_0xb0e4('0x13')](_0xb0e4('0x22'),_0x447f41,_0x2c97aa?'found':_0xb0e4('0x16'));return _0x5c0ad0(_0x2c97aa['result']['length']?_0x2c97aa[_0xb0e4('0x10')][0x0]:null);})['catch'](function(_0xc51bcb){logger['error'](_0xb0e4('0x23'),_0xc51bcb?util['inspect'](_0xc51bcb,{'showHidden':![],'depth':null}):'');return _0x5c0ad0(null);});}return _0x5c0ad0(null);});};exports[_0xb0e4('0x24')]=function(_0x12f6a6,_0x404793){return moment(_0x12f6a6)['add'](_0x404793,_0xb0e4('0x25'))['format'](_0xb0e4('0x26'));};exports[_0xb0e4('0x27')]=function(_0x23ab51,_0x129aec){return moment(_0x23ab51)[_0xb0e4('0x28')](_0x129aec,'seconds')[_0xb0e4('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb0e4('0x2a')]=function(_0x434630,_0x3a7e82){return moment(_0x434630)['diff'](moment(_0x3a7e82),_0xb0e4('0x25'));};exports[_0xb0e4('0x2b')]=function(_0x4708ce,_0x739afb){return parseInt(_0x4708ce,0xa)+parseInt(_0x739afb,0xa);};exports['now']=function(){return moment()['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['isAfter']=function(_0x16812e,_0x4b924d){if(_0x4b924d){return moment(_0x16812e)[_0xb0e4('0x2c')](_0x4b924d);}return!![];};exports['isBefore']=function(_0x2415ce,_0x540536){if(_0x540536){return moment(_0x2415ce)[_0xb0e4('0x2d')](_0x540536);}else if(_0x2415ce){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 3a46397..6c3f3e1 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4990=['use','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','agent_name','test','fs-extra','path','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','set','logger','isEmpty','body','\x20body=%s','headers','x-forwarded-for','connection','statusCode'];(function(_0x57dfdd,_0x28e71d){var _0x132c7f=function(_0x5ba730){while(--_0x5ba730){_0x57dfdd['push'](_0x57dfdd['shift']());}};_0x132c7f(++_0x28e71d);}(_0x4990,0xac));var _0x0499=function(_0x8be9fb,_0x2f90d9){_0x8be9fb=_0x8be9fb-0x0;var _0x3b41ac=_0x4990[_0x8be9fb];return _0x3b41ac;};var fs=require(_0x0499('0x0'));var _=require('lodash');var ewinston=require('express-winston');var path=require(_0x0499('0x1'));var util=require(_0x0499('0x2'));var fileLogger=require(_0x0499('0x3'))[_0x0499('0x4')];var safeTemplate=require(_0x0499('0x5'))['safeTemplate'];var maskSensitiveData=require(_0x0499('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x52479e(_0x2cdcf8){var _0x5a8f3d=path[_0x0499('0x7')](_0x0499('0x8'),_0x0499('0x9'),_0x0499('0xa'));var _0x1535b1=path[_0x0499('0x7')](_0x0499('0xb'),_0x2cdcf8[_0x0499('0xc')]+'-'+_0x2cdcf8[_0x0499('0xd')]);return fs[_0x0499('0xe')](path[_0x0499('0x7')](_0x5a8f3d,_0x1535b1))[_0x0499('0xf')](function(){var _0x205aa2=fileLogger(_0x0499('0xb'),path[_0x0499('0x7')](_0x5a8f3d,_0x1535b1));return _0x205aa2;})[_0x0499('0x10')](function(_0x3dd43d){throw _0x3dd43d;});}this[_0x0499('0x9')]=function(_0x2c71ec,_0x324b2e,_0x19e822,_0x5c5730){return _0x52479e(_0x2c71ec[_0x0499('0x11')])[_0x0499('0xf')](function(_0x146e29){var _0x3ee09b=_0x146e29[_0x324b2e];return _0x3ee09b;})[_0x0499('0xf')](function(_0x1f13c8){var _0xdf3891=_0x2c71ec[_0x0499('0x11')]?_0x2c71ec[_0x0499('0x11')]['id']:_0x0499('0x12');var _0xe2b6f0=_0x5c5730[_0x0499('0x13')];var _0x5f5434=_0x5c5730[_0x0499('0x14')];var _0x4b07e7=new Date(Number(_0x5f5434));return _0x1f13c8(_0xdf3891,_0x4b07e7,_0x19e822,_0xe2b6f0);})[_0x0499('0x10')](function(_0x5d657d){fileLogger('client')[_0x0499('0x15')](_0x5d657d);});};}function setupLoggers(_0x3c1909){return new Promise(function(_0x3b6565){var _0x4d6ab8=new ClientSideLogger();var _0x182989=fileLogger(_0x0499('0x16'));var _0x4e1c5f=fileLogger(_0x0499('0x17'));_0x3c1909[_0x0499('0x18')]('client-side-logger',_0x4d6ab8);_0x3c1909['use'](ewinston[_0x0499('0x19')]({'winstonInstance':_0x182989,'meta':![],'statusLevels':!![],'msg':function(_0x2bfb2f,_0x5dd4e9){var _0x35adfb='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x0499('0x1a')](_0x2bfb2f[_0x0499('0x1b')])){_0x35adfb+=_0x0499('0x1c');var _0x8050bd=_0x2bfb2f[_0x0499('0x1b')];maskSensitiveData(_0x8050bd);}return safeTemplate(util['format'](_0x35adfb,_0x2bfb2f['method'],_0x2bfb2f[_0x0499('0x1d')][_0x0499('0x1e')]?_0x2bfb2f[_0x0499('0x1d')]['x-forwarded-for']:_0x2bfb2f[_0x0499('0x1f')]['remoteAddress']||_0x2bfb2f['ip'],_0x2bfb2f['url'],_0x5dd4e9[_0x0499('0x20')],_0x5dd4e9['responseTime'],_0x2bfb2f['user']?_0x2bfb2f[_0x0499('0x11')]['id']:null,_0x2bfb2f[_0x0499('0x11')]?_0x2bfb2f[_0x0499('0x11')]['name']:null,_0x2bfb2f[_0x0499('0x11')]?_0x2bfb2f[_0x0499('0x11')][_0x0499('0xc')]:null,_0x8050bd?util['inspect'](_0x8050bd,![],null):''));}}));_0x3c1909[_0x0499('0x21')](ewinston[_0x0499('0x19')]({'winstonInstance':_0x4e1c5f,'meta':![],'statusLevels':!![],'msg':function(_0x1d4394,_0xf337e3){var _0x4b57d8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1d4394['body']&&_0x1d4394[_0x0499('0x1b')][_0x0499('0x22')]&&_0x1d4394['body'][_0x0499('0x23')]){_0x4b57d8=_0x0499('0x24');}return util['format'](_0x4b57d8,_0x1d4394['method'],_0x1d4394[_0x0499('0x1d')][_0x0499('0x1e')]?_0x1d4394[_0x0499('0x1d')][_0x0499('0x1e')]:_0x1d4394[_0x0499('0x1f')][_0x0499('0x25')]||_0x1d4394['ip'],_0x1d4394[_0x0499('0x26')],_0xf337e3[_0x0499('0x20')],_0xf337e3['responseTime'],_0x1d4394[_0x0499('0x11')]?_0x1d4394[_0x0499('0x11')]['id']:null,_0x1d4394[_0x0499('0x11')]?_0x1d4394[_0x0499('0x11')][_0x0499('0xd')]:null,_0x1d4394[_0x0499('0x11')]?_0x1d4394['user'][_0x0499('0xc')]:null,_0x1d4394[_0x0499('0x1b')]&&_0x1d4394['body'][_0x0499('0x22')]?_0x1d4394[_0x0499('0x1b')]['device']:'other',_0x1d4394[_0x0499('0x1b')]&&_0x1d4394['body'][_0x0499('0x23')]?_0x1d4394[_0x0499('0x1b')][_0x0499('0x23')]:'',_0x1d4394[_0x0499('0x1b')]&&_0x1d4394[_0x0499('0x1b')][_0x0499('0x27')]?_0x1d4394[_0x0499('0x1b')][_0x0499('0x27')]:'');},'ignoreRoute':function(_0x185ea5){var _0x549430=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x549430[_0x0499('0x28')](_0x185ea5['url']);}}));return _0x3b6565();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file +var _0xb9c9=['name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','format','setupLoggers','express-winston','path','util','./loggers','fileLogger','maskSensitiveData','log','xcally','join','client'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0xb9c9,0x15e));var _0x9b9c=function(_0x4d8b6f,_0x315e1b){_0x4d8b6f=_0x4d8b6f-0x0;var _0x37602d=_0xb9c9[_0x4d8b6f];return _0x37602d;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require(_0x9b9c('0x0'));var path=require(_0x9b9c('0x1'));var util=require(_0x9b9c('0x2'));var fileLogger=require(_0x9b9c('0x3'))[_0x9b9c('0x4')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0x9b9c('0x5')];function ClientSideLogger(){function _0x5dfe3b(_0x4f28f2){var _0x28c681=path['join']('/var',_0x9b9c('0x6'),_0x9b9c('0x7'));var _0x1b0e16=path[_0x9b9c('0x8')](_0x9b9c('0x9'),_0x4f28f2['role']+'-'+_0x4f28f2[_0x9b9c('0xa')]);return fs[_0x9b9c('0xb')](path['join'](_0x28c681,_0x1b0e16))[_0x9b9c('0xc')](function(){var _0x5df9fe=fileLogger('client',path[_0x9b9c('0x8')](_0x28c681,_0x1b0e16));return _0x5df9fe;})[_0x9b9c('0xd')](function(_0x5dcda9){throw _0x5dcda9;});}this[_0x9b9c('0x6')]=function(_0x164aef,_0x4441ca,_0x30b2e9,_0x5c6652){return _0x5dfe3b(_0x164aef[_0x9b9c('0xe')])[_0x9b9c('0xc')](function(_0x390991){var _0x48d3bd=_0x390991[_0x4441ca];return _0x48d3bd;})['then'](function(_0x784ead){var _0x4d0e9c=_0x164aef[_0x9b9c('0xe')]?_0x164aef[_0x9b9c('0xe')]['id']:_0x9b9c('0xf');var _0x1a3087=_0x5c6652[_0x9b9c('0x10')];var _0x56c563=_0x5c6652[_0x9b9c('0x11')];var _0x552b49=new Date(Number(_0x56c563));return _0x784ead(_0x4d0e9c,_0x552b49,_0x30b2e9,_0x1a3087);})['catch'](function(_0x43e2fa){fileLogger(_0x9b9c('0x9'))[_0x9b9c('0x12')](_0x43e2fa);});};}function setupLoggers(_0x55ea0c){return new Promise(function(_0xe0811e){var _0x155d80=new ClientSideLogger();var _0x4e5c37=fileLogger(_0x9b9c('0x13'));var _0x2f7570=fileLogger(_0x9b9c('0x14'));_0x55ea0c['set']('client-side-logger',_0x155d80);_0x55ea0c['use'](ewinston[_0x9b9c('0x15')]({'winstonInstance':_0x4e5c37,'meta':![],'statusLevels':!![],'msg':function(_0x4e2254,_0xf61f36){var _0x41142b=_0x9b9c('0x16');if(!_['isEmpty'](_0x4e2254[_0x9b9c('0x17')])){_0x41142b+=_0x9b9c('0x18');var _0x1983f4=_0x4e2254[_0x9b9c('0x17')];maskSensitiveData(_0x1983f4);}return safeTemplate(util['format'](_0x41142b,_0x4e2254[_0x9b9c('0x19')],_0x4e2254[_0x9b9c('0x1a')][_0x9b9c('0x1b')]?_0x4e2254[_0x9b9c('0x1a')][_0x9b9c('0x1b')]:_0x4e2254[_0x9b9c('0x1c')][_0x9b9c('0x1d')]||_0x4e2254['ip'],_0x4e2254[_0x9b9c('0x1e')],_0xf61f36[_0x9b9c('0x1f')],_0xf61f36[_0x9b9c('0x20')],_0x4e2254['user']?_0x4e2254[_0x9b9c('0xe')]['id']:null,_0x4e2254['user']?_0x4e2254[_0x9b9c('0xe')][_0x9b9c('0xa')]:null,_0x4e2254[_0x9b9c('0xe')]?_0x4e2254[_0x9b9c('0xe')][_0x9b9c('0x21')]:null,_0x1983f4?util['inspect'](_0x1983f4,![],null):''));}}));_0x55ea0c[_0x9b9c('0x22')](ewinston[_0x9b9c('0x15')]({'winstonInstance':_0x2f7570,'meta':![],'statusLevels':!![],'msg':function(_0x3a2d95,_0x54fed5){var _0x37573d=_0x9b9c('0x23');if(_0x3a2d95[_0x9b9c('0x17')]&&_0x3a2d95[_0x9b9c('0x17')][_0x9b9c('0x24')]&&_0x3a2d95['body'][_0x9b9c('0x25')]){_0x37573d='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x9b9c('0x26')](_0x37573d,_0x3a2d95[_0x9b9c('0x19')],_0x3a2d95['headers'][_0x9b9c('0x1b')]?_0x3a2d95[_0x9b9c('0x1a')][_0x9b9c('0x1b')]:_0x3a2d95[_0x9b9c('0x1c')][_0x9b9c('0x1d')]||_0x3a2d95['ip'],_0x3a2d95[_0x9b9c('0x1e')],_0x54fed5[_0x9b9c('0x1f')],_0x54fed5['responseTime'],_0x3a2d95[_0x9b9c('0xe')]?_0x3a2d95['user']['id']:null,_0x3a2d95[_0x9b9c('0xe')]?_0x3a2d95[_0x9b9c('0xe')]['name']:null,_0x3a2d95[_0x9b9c('0xe')]?_0x3a2d95['user'][_0x9b9c('0x21')]:null,_0x3a2d95[_0x9b9c('0x17')]&&_0x3a2d95[_0x9b9c('0x17')][_0x9b9c('0x24')]?_0x3a2d95[_0x9b9c('0x17')][_0x9b9c('0x24')]:'other',_0x3a2d95[_0x9b9c('0x17')]&&_0x3a2d95['body'][_0x9b9c('0x25')]?_0x3a2d95['body'][_0x9b9c('0x25')]:'',_0x3a2d95[_0x9b9c('0x17')]&&_0x3a2d95[_0x9b9c('0x17')]['agent_name']?_0x3a2d95['body']['agent_name']:'');},'ignoreRoute':function(_0x3eb760){var _0x3197b7=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3197b7['test'](_0x3eb760[_0x9b9c('0x1e')]);}}));return _0xe0811e();});}exports[_0x9b9c('0x27')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index a8bcfae..c66ecbd 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x248c=['red','bold\x20white','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','fileLogger','util','moment','winston','../config/environment','debugLevel'];(function(_0x46d5e5,_0x130865){var _0x39b725=function(_0x39bd12){while(--_0x39bd12){_0x46d5e5['push'](_0x46d5e5['shift']());}};_0x39b725(++_0x130865);}(_0x248c,0x12d));var _0xc248=function(_0x4e336c,_0x1a5e21){_0x4e336c=_0x4e336c-0x0;var _0x4e781f=_0x248c[_0x4e336c];return _0x4e781f;};'use strict';var path=require('path');var util=require(_0xc248('0x0'));var moment=require(_0xc248('0x1'));var winston=require(_0xc248('0x2'));var config=require(_0xc248('0x3'));var debugLevel=config[_0xc248('0x4')]?config[_0xc248('0x4')]['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0xc248('0x5'),'warn':'bold\x20yellow','info':'white','print':_0xc248('0x6'),'success':'bold\x20green','http':_0xc248('0x7'),'verbose':'bold\x20magenta','debug':_0xc248('0x8'),'silly':_0xc248('0x9')};winston[_0xc248('0xa')](XC_LOG_COLORS);function getLogFileName(_0xf2619e,_0x40bccb,_0x22d152){var _0xda4fa=_0xf2619e||_0xc248('0xb');return path[_0xc248('0xc')](_0xda4fa,util[_0xc248('0xd')](_0xc248('0xe'),_0x40bccb,_0x22d152));}function formatter(_0x6acf5c,_0x4e025c){_0x4e025c[_0xc248('0xf')]=_0x4e025c[_0xc248('0xf')][_0xc248('0x10')](/@@{/g,_0xc248('0x11'))['replace'](/}@@/g,_0xc248('0x12'))['replace'](/@{/g,'{{')[_0xc248('0x10')](/}@/g,'}}');return util[_0xc248('0xd')](_0xc248('0x13'),moment()[_0xc248('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),_0x4e025c[_0xc248('0x14')][_0xc248('0x15')](),_0x6acf5c,_0x4e025c[_0xc248('0xf')]);}function fileFormat(_0x481925,_0x2e1616){_0x2e1616[_0xc248('0xf')]=_0x2e1616[_0xc248('0xf')]['replace'](/@@{/g,_0xc248('0x11'))[_0xc248('0x10')](/}@@/g,_0xc248('0x12'))[_0xc248('0x10')](/@{/g,'{{')[_0xc248('0x10')](/}@/g,'}}');var _0x1d803a=_0x2e1616['meta']&&Object[_0xc248('0x16')](_0x2e1616['meta'])['length']?'\x0a\x09'+JSON[_0xc248('0x17')](_0x2e1616['meta']):'';return util[_0xc248('0xd')](_0xc248('0x18'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x2e1616[_0xc248('0x14')][_0xc248('0x15')](),_0x481925,_0x2e1616['message'],_0x1d803a);}function consoleLogger(){var _0x2c460d=new winston[(_0xc248('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc248('0x1a'))][(_0xc248('0x1b'))]({'level':_0xc248('0x1c'),'json':![],'formatter':function(_0x57a746){return formatter('',_0x57a746);}})]});return _0x2c460d;}function fileLogger(_0x3d4198,_0x2a09ff){var _0x51912d=new winston[(_0xc248('0x19'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc248('0x1a'))]['File']({'name':util['format'](_0xc248('0x1d'),_0x3d4198,'error'),'filename':getLogFileName(_0x2a09ff,_0x3d4198,'error'),'level':_0xc248('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x87783c){return fileFormat(_0x3d4198,_0x87783c);}}),new winston[(_0xc248('0x1a'))][(_0xc248('0x1f'))]({'name':util['format'](_0xc248('0x1d'),_0x3d4198,debugLevel),'filename':getLogFileName(_0x2a09ff,_0x3d4198,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x24f441){return fileFormat(_0x3d4198,_0x24f441);}}),new winston[(_0xc248('0x1a'))]['Console']({'level':_0xc248('0x1c'),'json':![],'formatter':function(_0x5997fc){return fileFormat(_0x3d4198,_0x5997fc);}})]});return _0x51912d;}exports[_0xc248('0x20')]=consoleLogger;exports[_0xc248('0x21')]=fileLogger; \ No newline at end of file +var _0xf12f=['level','Logger','transports','File','%s-%s','error','fileLogger','path','moment','winston','../config/environment','debugLevel','redBG\x20white','red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','{{{','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf12f,0xe5));var _0xff12=function(_0xd360b5,_0x2d0d76){_0xd360b5=_0xd360b5-0x0;var _0x4c9e52=_0xf12f[_0xd360b5];return _0x4c9e52;};'use strict';var path=require(_0xff12('0x0'));var util=require('util');var moment=require(_0xff12('0x1'));var winston=require(_0xff12('0x2'));var config=require(_0xff12('0x3'));var debugLevel=config[_0xff12('0x4')]?config['debugLevel']['toLowerCase']():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xff12('0x5'),'error':_0xff12('0x6'),'warn':_0xff12('0x7'),'info':_0xff12('0x8'),'print':_0xff12('0x9'),'success':_0xff12('0xa'),'http':_0xff12('0xb'),'verbose':_0xff12('0xc'),'debug':_0xff12('0xd'),'silly':_0xff12('0xe')};winston[_0xff12('0xf')](XC_LOG_COLORS);function getLogFileName(_0xa0a39e,_0x9439d,_0xfa246f){var _0x564e58=_0xa0a39e||'/var/log/xcally';return path[_0xff12('0x10')](_0x564e58,util[_0xff12('0x11')](_0xff12('0x12'),_0x9439d,_0xfa246f));}function formatter(_0x14f4ce,_0x50f599){_0x50f599[_0xff12('0x13')]=_0x50f599[_0xff12('0x13')][_0xff12('0x14')](/@@{/g,'{{{')['replace'](/}@@/g,_0xff12('0x15'))['replace'](/@{/g,'{{')[_0xff12('0x14')](/}@/g,'}}');return util[_0xff12('0x11')](_0xff12('0x16'),moment()[_0xff12('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),_0x50f599['level'][_0xff12('0x17')](),_0x14f4ce,_0x50f599[_0xff12('0x13')]);}function fileFormat(_0x3fdb8e,_0x3d6615){_0x3d6615[_0xff12('0x13')]=_0x3d6615[_0xff12('0x13')][_0xff12('0x14')](/@@{/g,_0xff12('0x18'))['replace'](/}@@/g,_0xff12('0x15'))[_0xff12('0x14')](/@{/g,'{{')[_0xff12('0x14')](/}@/g,'}}');var _0x328e85=_0x3d6615[_0xff12('0x19')]&&Object[_0xff12('0x1a')](_0x3d6615['meta'])[_0xff12('0x1b')]?'\x0a\x09'+JSON['stringify'](_0x3d6615[_0xff12('0x19')]):'';return util['format'](_0xff12('0x1c'),moment()[_0xff12('0x11')](_0xff12('0x1d')),_0x3d6615[_0xff12('0x1e')][_0xff12('0x17')](),_0x3fdb8e,_0x3d6615['message'],_0x328e85);}function consoleLogger(){var _0x5bc6ef=new winston[(_0xff12('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xff12('0x20'))]['Console']({'level':'warn','json':![],'formatter':function(_0x414a7a){return formatter('',_0x414a7a);}})]});return _0x5bc6ef;}function fileLogger(_0x4b3f45,_0x2bda23){var _0x20f321=new winston[(_0xff12('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xff12('0x20'))][(_0xff12('0x21'))]({'name':util[_0xff12('0x11')](_0xff12('0x22'),_0x4b3f45,'error'),'filename':getLogFileName(_0x2bda23,_0x4b3f45,_0xff12('0x23')),'level':_0xff12('0x23'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x36261b){return fileFormat(_0x4b3f45,_0x36261b);}}),new winston[(_0xff12('0x20'))]['File']({'name':util['format'](_0xff12('0x22'),_0x4b3f45,debugLevel),'filename':getLogFileName(_0x2bda23,_0x4b3f45,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x969f3c){return fileFormat(_0x4b3f45,_0x969f3c);}}),new winston[(_0xff12('0x20'))]['Console']({'level':'warn','json':![],'formatter':function(_0x553603){return fileFormat(_0x4b3f45,_0x553603);}})]});return _0x20f321;}exports['consoleLogger']=consoleLogger;exports[_0xff12('0x24')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index d208a05..f5a105a 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x34b6f3,_0x59e4f8){var _0x46fbff=function(_0x3ed746){while(--_0x3ed746){_0x34b6f3['push'](_0x34b6f3['shift']());}};_0x46fbff(++_0x59e4f8);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x17984c,_0x270dbd){var _0x5c8dd4=function(_0x55dcd6){while(--_0x55dcd6){_0x17984c['push'](_0x17984c['shift']());}};_0x5c8dd4(++_0x270dbd);}(_0xda2d,0x102));var _0xdda2=function(_0x2058ee,_0x3a2e46){_0x2058ee=_0x2058ee-0x0;var _0x2975e0=_0xda2d[_0x2058ee];return _0x2975e0;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index acebf07..edb1a40 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['isArray','map','isPlainObject','keys','reduce','exports','safeTemplate','{\x20{\x20','\x20}\x20}','string'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2032,0xd9));var _0x2203=function(_0x2092ab,_0x394ea5){_0x2092ab=_0x2092ab-0x0;var _0x1a4f0f=_0x2032[_0x2092ab];return _0x1a4f0f;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2c2259){return _0x2c2259==='{{'?_0x2203('0x0'):_0x2203('0x1');}function safeTemplate(_0x4c28da){var _0x486390=_0x4c28da;if(typeof _0x4c28da===_0x2203('0x2')){_0x486390=_0x4c28da['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x2203('0x3')](_0x4c28da)){_0x486390=_0x4c28da[_0x2203('0x4')](function(_0x44ccfd){return safeTemplate(_0x44ccfd);});}else if(_[_0x2203('0x5')](_0x4c28da)){_0x486390=Object[_0x2203('0x6')](_0x4c28da)[_0x2203('0x7')](function(_0x2e0f63,_0x2676aa){_0x2e0f63[_0x2676aa]=safeTemplate(_0x4c28da[_0x2676aa]);return _0x2e0f63;},{});}return _0x486390;}module[_0x2203('0x8')][_0x2203('0x9')]=safeTemplate; \ No newline at end of file +var _0x14a0=['string','replace','isPlainObject','keys','exports','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x14a0,0x8e));var _0x014a=function(_0x5e14fa,_0x1b616d){_0x5e14fa=_0x5e14fa-0x0;var _0x3f7032=_0x14a0[_0x5e14fa];return _0x3f7032;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x105436){return _0x105436==='{{'?_0x014a('0x0'):_0x014a('0x1');}function safeTemplate(_0x28b0f6){var _0x32e88c=_0x28b0f6;if(typeof _0x28b0f6===_0x014a('0x2')){_0x32e88c=_0x28b0f6[_0x014a('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x28b0f6)){_0x32e88c=_0x28b0f6['map'](function(_0x1730a5){return safeTemplate(_0x1730a5);});}else if(_[_0x014a('0x4')](_0x28b0f6)){_0x32e88c=Object[_0x014a('0x5')](_0x28b0f6)['reduce'](function(_0x5a61ac,_0x11b8ce){_0x5a61ac[_0x11b8ce]=safeTemplate(_0x28b0f6[_0x11b8ce]);return _0x5a61ac;},{});}return _0x32e88c;}module[_0x014a('0x6')][_0x014a('0x7')]=safeTemplate; \ No newline at end of file